mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-16 01:26:44 +00:00
feat: Upgrade nodes-base package to use modern tsconfig.json (no-changelog) (#16884)
This commit is contained in:
@@ -116,6 +116,8 @@
|
||||
"vue-tsc@2.2.8": "patches/vue-tsc@2.2.8.patch",
|
||||
"element-plus@2.4.3": "patches/element-plus@2.4.3.patch",
|
||||
"js-base64": "patches/js-base64.patch",
|
||||
"ics": "patches/ics.patch",
|
||||
"minifaker": "patches/minifaker.patch",
|
||||
"z-vue-scan": "patches/z-vue-scan.patch"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
],
|
||||
"references": [
|
||||
{ "path": "../../core/tsconfig.build.json" },
|
||||
{ "path": "../../nodes-base/tsconfig.build.json" },
|
||||
{ "path": "../../nodes-base/tsconfig.build.cjs.json" },
|
||||
{ "path": "../../workflow/tsconfig.build.esm.json" }
|
||||
]
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
"moduleDetection": "force",
|
||||
"isolatedModules": true,
|
||||
"verbatimModuleSyntax": true,
|
||||
"incremental": true,
|
||||
|
||||
"strict": true,
|
||||
"noUncheckedIndexedAccess": true,
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
"include": ["src/**/*.ts", "test/**/*.ts", "src/sso.ee/saml/saml-schema-metadata-2.0.xsd"],
|
||||
"references": [
|
||||
{ "path": "../core/tsconfig.build.json" },
|
||||
{ "path": "../nodes-base/tsconfig.build.json" },
|
||||
{ "path": "../nodes-base/tsconfig.build.cjs.json" },
|
||||
{ "path": "../workflow/tsconfig.build.esm.json" },
|
||||
{ "path": "../@n8n/api-types/tsconfig.build.json" },
|
||||
{ "path": "../@n8n/client-oauth2/tsconfig.build.json" },
|
||||
|
||||
@@ -498,7 +498,7 @@ export class Aws implements ICredentialType {
|
||||
path,
|
||||
body: bodyContent,
|
||||
region,
|
||||
} as Request;
|
||||
} as unknown as Request;
|
||||
|
||||
const securityHeaders = {
|
||||
accessKeyId: `${credentials.accessKeyId}`.trim(),
|
||||
|
||||
@@ -37,7 +37,7 @@ export class JsTaskRunnerSandbox {
|
||||
|
||||
return executionResult.ok
|
||||
? executionResult.result
|
||||
: this.throwExecutionError(executionResult.error);
|
||||
: this.throwExecutionError('error' in executionResult ? executionResult.error : {});
|
||||
}
|
||||
|
||||
async runCodeForEachItem(numInputItems: number): Promise<INodeExecutionData[]> {
|
||||
@@ -64,7 +64,7 @@ export class JsTaskRunnerSandbox {
|
||||
);
|
||||
|
||||
if (!executionResult.ok) {
|
||||
return this.throwExecutionError(executionResult.error);
|
||||
return this.throwExecutionError('error' in executionResult ? executionResult.error : {});
|
||||
}
|
||||
|
||||
executionResults = executionResults.concat(executionResult.result);
|
||||
|
||||
@@ -4,6 +4,7 @@ import {
|
||||
type AssignmentCollectionValue,
|
||||
type IExecuteFunctions,
|
||||
type INodeTypes,
|
||||
type NodeParameterValueType,
|
||||
} from 'n8n-workflow';
|
||||
|
||||
import { GoogleSheet } from '../../Google/Sheet/v2/helpers/GoogleSheet';
|
||||
@@ -62,7 +63,7 @@ describe('Test Evaluation', () => {
|
||||
sheetMode: 'id',
|
||||
operation: 'setOutputs',
|
||||
};
|
||||
return mockParams[key] ?? fallbackValue;
|
||||
return (mockParams[key] ?? fallbackValue) as NodeParameterValueType;
|
||||
},
|
||||
);
|
||||
|
||||
@@ -88,7 +89,7 @@ describe('Test Evaluation', () => {
|
||||
sheetMode: 'id',
|
||||
operation: 'setOutputs',
|
||||
};
|
||||
return mockParams[key] ?? fallbackValue;
|
||||
return (mockParams[key] ?? fallbackValue) as NodeParameterValueType;
|
||||
},
|
||||
);
|
||||
|
||||
@@ -125,7 +126,7 @@ describe('Test Evaluation', () => {
|
||||
sheetMode: 'id',
|
||||
operation: 'setOutputs',
|
||||
};
|
||||
return mockParams[key] ?? fallbackValue;
|
||||
return (mockParams[key] ?? fallbackValue) as NodeParameterValueType;
|
||||
},
|
||||
);
|
||||
mockExecuteFunctions.getParentNodes.mockReturnValue([]);
|
||||
@@ -152,7 +153,7 @@ describe('Test Evaluation', () => {
|
||||
sheetMode: 'id',
|
||||
operation: 'setOutputs',
|
||||
};
|
||||
return mockParams[key] ?? fallbackValue;
|
||||
return (mockParams[key] ?? fallbackValue) as NodeParameterValueType;
|
||||
},
|
||||
);
|
||||
|
||||
@@ -299,7 +300,7 @@ describe('Test Evaluation', () => {
|
||||
const mockParams: { [key: string]: unknown } = {
|
||||
operation: 'checkIfEvaluating',
|
||||
};
|
||||
return mockParams[key] ?? fallbackValue;
|
||||
return (mockParams[key] ?? fallbackValue) as NodeParameterValueType;
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { mock } from 'jest-mock-extended';
|
||||
import type { IExecuteFunctions } from 'n8n-workflow';
|
||||
import type { IExecuteFunctions, NodeParameterValueType } from 'n8n-workflow';
|
||||
|
||||
import { GoogleSheet } from '../../Google/Sheet/v2/helpers/GoogleSheet';
|
||||
import { EvaluationTrigger } from '../EvaluationTrigger/EvaluationTrigger.node.ee';
|
||||
@@ -72,7 +72,7 @@ describe('Evaluation Trigger Node', () => {
|
||||
sheetName,
|
||||
sheetMode: 'id',
|
||||
};
|
||||
return mockParams[key] ?? fallbackValue;
|
||||
return (mockParams[key] ?? fallbackValue) as NodeParameterValueType;
|
||||
},
|
||||
);
|
||||
|
||||
@@ -123,7 +123,7 @@ describe('Evaluation Trigger Node', () => {
|
||||
sheetName,
|
||||
sheetMode: 'id',
|
||||
};
|
||||
return mockParams[key] ?? fallbackValue;
|
||||
return (mockParams[key] ?? fallbackValue) as NodeParameterValueType;
|
||||
},
|
||||
);
|
||||
|
||||
@@ -174,7 +174,7 @@ describe('Evaluation Trigger Node', () => {
|
||||
sheetName,
|
||||
sheetMode: 'id',
|
||||
};
|
||||
return mockParams[key] ?? fallbackValue;
|
||||
return (mockParams[key] ?? fallbackValue) as NodeParameterValueType;
|
||||
},
|
||||
);
|
||||
|
||||
@@ -213,7 +213,7 @@ describe('Evaluation Trigger Node', () => {
|
||||
limitRows: true,
|
||||
maxRows: 1,
|
||||
};
|
||||
return mockParams[key] ?? fallbackValue;
|
||||
return (mockParams[key] ?? fallbackValue) as NodeParameterValueType;
|
||||
},
|
||||
);
|
||||
|
||||
@@ -282,7 +282,7 @@ describe('Evaluation Trigger Node', () => {
|
||||
sheetName,
|
||||
sheetMode: 'id',
|
||||
};
|
||||
return mockParams[key] ?? fallbackValue;
|
||||
return (mockParams[key] ?? fallbackValue) as NodeParameterValueType;
|
||||
},
|
||||
);
|
||||
|
||||
@@ -364,7 +364,7 @@ describe('Evaluation Trigger Node', () => {
|
||||
limitRows: true,
|
||||
maxRows: 2,
|
||||
};
|
||||
return mockParams[key] ?? fallbackValue;
|
||||
return (mockParams[key] ?? fallbackValue) as NodeParameterValueType;
|
||||
},
|
||||
);
|
||||
|
||||
@@ -431,7 +431,7 @@ describe('Evaluation Trigger Node', () => {
|
||||
sheetName,
|
||||
sheetMode: 'id',
|
||||
};
|
||||
return mockParams[key] ?? fallbackValue;
|
||||
return (mockParams[key] ?? fallbackValue) as NodeParameterValueType;
|
||||
},
|
||||
);
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@ import { NodeApiError, NodeOperationError } from 'n8n-workflow';
|
||||
import type {
|
||||
AddressFixedCollection,
|
||||
FreshserviceCredentials,
|
||||
LoadedResource,
|
||||
LoadedUser,
|
||||
RolesParameter,
|
||||
} from './types';
|
||||
|
||||
@@ -12,6 +12,7 @@ import { NodeApiError, NodeOperationError } from 'n8n-workflow';
|
||||
import type {
|
||||
FreshworksConfigResponse,
|
||||
FreshworksCrmApiCredentials,
|
||||
LoadedResource,
|
||||
SalesAccounts,
|
||||
ViewsResponse,
|
||||
} from './types';
|
||||
|
||||
@@ -7,6 +7,11 @@ export type FreshworksConfigResponse<T> = {
|
||||
[key: string]: T[];
|
||||
};
|
||||
|
||||
export type LoadedResource = {
|
||||
id: string;
|
||||
name: string;
|
||||
};
|
||||
|
||||
export type LoadOption = {
|
||||
name: string;
|
||||
value: string;
|
||||
|
||||
@@ -56,7 +56,7 @@ export async function readSheet(
|
||||
data,
|
||||
headerRow: keyRowIndex,
|
||||
firstDataRow: dataStartRowIndex,
|
||||
} = prepareSheetData(sheetData, dataLocationOnSheetOptions);
|
||||
} = prepareSheetData(sheetData, dataLocationOnSheetOptions as RangeDetectionOptions);
|
||||
|
||||
let responseData = [];
|
||||
|
||||
|
||||
@@ -154,7 +154,7 @@ export async function execute(
|
||||
}
|
||||
|
||||
if (typeof entityToSplit !== 'object' || entityToSplit === null) {
|
||||
entityToSplit = [entityToSplit];
|
||||
entityToSplit = [entityToSplit] as unknown as IDataObject[];
|
||||
}
|
||||
|
||||
if (!Array.isArray(entityToSplit)) {
|
||||
|
||||
@@ -193,7 +193,9 @@ export function getAddressesUi(): INodeProperties {
|
||||
};
|
||||
}
|
||||
|
||||
export function adjustAddresses(addresses: [{ street: string; [key: string]: string }]): Address[] {
|
||||
export function adjustAddresses(
|
||||
addresses: Array<{ street: string; [key: string]: string }>,
|
||||
): Address[] {
|
||||
const _addresses: Address[] = [];
|
||||
for (let i = 0; i < addresses.length; i++) {
|
||||
if (addresses[i]?.region === '') {
|
||||
|
||||
@@ -169,6 +169,7 @@ export class Magento2 implements INodeType {
|
||||
)) as CustomerAttributeMetadata[];
|
||||
const returnData: INodePropertyOptions[] = [];
|
||||
for (const attribute of attributes) {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unnecessary-boolean-literal-compare
|
||||
if (attribute.system === false && attribute.frontend_label !== '') {
|
||||
returnData.push({
|
||||
name: attribute.frontend_label as string,
|
||||
@@ -189,6 +190,7 @@ export class Magento2 implements INodeType {
|
||||
)) as CustomerAttributeMetadata[];
|
||||
const returnData: INodePropertyOptions[] = [];
|
||||
for (const attribute of attributes) {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unnecessary-boolean-literal-compare
|
||||
if (attribute.system === true && attribute.frontend_label !== null) {
|
||||
returnData.push({
|
||||
name: attribute.frontend_label as string,
|
||||
@@ -346,7 +348,7 @@ export class Magento2 implements INodeType {
|
||||
|
||||
body.customer!.addresses = adjustAddresses(addresses?.address || []);
|
||||
|
||||
body.customer!.custom_attributes = customAttributes?.customAttribute || {};
|
||||
body.customer!.custom_attributes = customAttributes?.customAttribute || [];
|
||||
|
||||
body.customer!.extension_attributes = [
|
||||
'amazon_id',
|
||||
@@ -490,7 +492,7 @@ export class Magento2 implements INodeType {
|
||||
|
||||
body.customer!.addresses = adjustAddresses(addresses?.address || []);
|
||||
|
||||
body.customer!.custom_attributes = customAttributes?.customAttribute || {};
|
||||
body.customer!.custom_attributes = customAttributes?.customAttribute || [];
|
||||
|
||||
body.customer!.extension_attributes = [
|
||||
'amazon_id',
|
||||
@@ -661,7 +663,7 @@ export class Magento2 implements INodeType {
|
||||
},
|
||||
};
|
||||
|
||||
body.product!.custom_attributes = customAttributes?.customAttribute || {};
|
||||
body.product!.custom_attributes = customAttributes?.customAttribute || [];
|
||||
|
||||
Object.assign(body.product!, rest);
|
||||
|
||||
@@ -776,7 +778,7 @@ export class Magento2 implements INodeType {
|
||||
},
|
||||
};
|
||||
|
||||
body.product!.custom_attributes = customAttributes?.customAttribute || {};
|
||||
body.product!.custom_attributes = customAttributes?.customAttribute || [];
|
||||
|
||||
Object.assign(body.product!, rest);
|
||||
|
||||
|
||||
@@ -91,8 +91,8 @@ export async function execute(
|
||||
const mergeIntoSingleObject = selectMergeMethod(clashHandling);
|
||||
|
||||
for (let i = 0; i < numEntries; i++) {
|
||||
const preferredEntry = preferred[i] ?? {};
|
||||
const restEntries = inputsData.map((input) => input[i] ?? {});
|
||||
const preferredEntry = preferred[i] ?? ({} as INodeExecutionData);
|
||||
const restEntries = inputsData.map((input) => input[i] ?? ({} as INodeExecutionData));
|
||||
|
||||
const json = {
|
||||
...mergeIntoSingleObject(
|
||||
|
||||
@@ -207,7 +207,7 @@ export async function handleErrorPostReceive(
|
||||
if (resource === 'file' && operation === 'download' && Buffer.isBuffer(response.body)) {
|
||||
response.body = jsonParse((response.body as Buffer).toString());
|
||||
}
|
||||
const error = (response.body as IErrorResponse)?.error ?? {};
|
||||
const error = (response.body as IErrorResponse)?.error ?? ({} as IErrorResponse['error']);
|
||||
|
||||
if (resource === 'file') {
|
||||
if (operation === 'download') {
|
||||
|
||||
@@ -8,6 +8,7 @@ import type {
|
||||
IDataObject,
|
||||
ILoadOptionsFunctions,
|
||||
JsonObject,
|
||||
INodeExecutionData,
|
||||
} from 'n8n-workflow';
|
||||
import { NodeApiError, NodeConnectionTypes } from 'n8n-workflow';
|
||||
|
||||
@@ -388,7 +389,7 @@ export class MicrosoftTeamsTrigger implements INodeType {
|
||||
workflowData: eventNotifications.map((event) => [
|
||||
{
|
||||
json: (event.resourceData as IDataObject) ?? event,
|
||||
},
|
||||
} as INodeExecutionData,
|
||||
]),
|
||||
};
|
||||
|
||||
|
||||
@@ -271,8 +271,7 @@ function getTexts(texts: TextData[]) {
|
||||
type: 'mention',
|
||||
mention: {
|
||||
type: text.mentionType,
|
||||
//@ts-expect-error any
|
||||
[text.mentionType]: { id: text[text.mentionType] as string },
|
||||
[text.mentionType]: { id: text[text.mentionType as keyof TextData] as string },
|
||||
},
|
||||
annotations: text.annotationUi,
|
||||
});
|
||||
|
||||
@@ -184,10 +184,10 @@ export const parseMessage = async (
|
||||
};
|
||||
} else {
|
||||
let content: IDataObject | string = message.content.toString();
|
||||
if (options.jsonParseBody) {
|
||||
if ('jsonParseBody' in options && options.jsonParseBody) {
|
||||
content = jsonParse(content);
|
||||
}
|
||||
if (options.onlyContent) {
|
||||
if ('onlyContent' in options && options.onlyContent) {
|
||||
return { json: content as IDataObject };
|
||||
} else {
|
||||
message.content = content as unknown as Buffer;
|
||||
|
||||
@@ -208,7 +208,10 @@ export class SeaTableTriggerV2 implements INodeType {
|
||||
const newRows: any = [];
|
||||
for (const row of rows) {
|
||||
if (assetColumnType === 'digital-sign') {
|
||||
const signature = (row[assetColumn] as IColumnDigitalSignature) || [];
|
||||
const signature = (row[assetColumn] as IColumnDigitalSignature) || {
|
||||
sign_time: undefined,
|
||||
};
|
||||
|
||||
if (signature.sign_time) {
|
||||
if (new Date(signature.sign_time) > new Date(startDate)) {
|
||||
newRows.push(signature);
|
||||
|
||||
@@ -206,7 +206,7 @@ export const validateEntry = (
|
||||
if (ignoreErrors) {
|
||||
return { name, value: value ?? null };
|
||||
} else {
|
||||
const message = `${validationResult.errorMessage} [item ${itemIndex}]`;
|
||||
const message = `${'errorMessage' in validationResult ? validationResult.errorMessage : 'Error'} [item ${itemIndex}]`;
|
||||
throw new NodeOperationError(node, message, {
|
||||
itemIndex,
|
||||
description,
|
||||
|
||||
@@ -11,6 +11,7 @@ import type {
|
||||
IRequestOptions,
|
||||
} from 'n8n-workflow';
|
||||
import { NodeApiError, NodeOperationError } from 'n8n-workflow';
|
||||
import type { LoadedResource, Resource } from './types';
|
||||
|
||||
export async function getAuthorization(
|
||||
this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions | IWebhookFunctions,
|
||||
|
||||
@@ -26,6 +26,15 @@ import {
|
||||
throwOnEmptyUpdate,
|
||||
toOptions,
|
||||
} from './GenericFunctions';
|
||||
import type {
|
||||
LoadedEpic,
|
||||
LoadedResource,
|
||||
LoadedTags,
|
||||
LoadedUser,
|
||||
LoadedUserStory,
|
||||
Operation,
|
||||
Resource,
|
||||
} from './types';
|
||||
|
||||
export class Taiga implements INodeType {
|
||||
description: INodeTypeDescription = {
|
||||
|
||||
@@ -11,6 +11,7 @@ import {
|
||||
} from 'n8n-workflow';
|
||||
|
||||
import { getAutomaticSecret, taigaApiRequest } from './GenericFunctions';
|
||||
import type { Operations, Resources, WebhookPayload } from './types';
|
||||
|
||||
// import {
|
||||
// createHmac,
|
||||
|
||||
@@ -1,38 +1,38 @@
|
||||
type Resource = 'epic' | 'issue' | 'task' | 'userStory';
|
||||
export type Resource = 'epic' | 'issue' | 'task' | 'userStory';
|
||||
|
||||
type Operation = 'create' | 'delete' | 'update' | 'get' | 'getAll';
|
||||
export type Operation = 'create' | 'delete' | 'update' | 'get' | 'getAll';
|
||||
|
||||
type LoadedResource = {
|
||||
export type LoadedResource = {
|
||||
id: string;
|
||||
name: string;
|
||||
};
|
||||
|
||||
type LoadOption = {
|
||||
export type LoadOption = {
|
||||
value: string;
|
||||
name: string;
|
||||
};
|
||||
|
||||
type LoadedUser = {
|
||||
export type LoadedUser = {
|
||||
id: string;
|
||||
full_name_display: string;
|
||||
};
|
||||
|
||||
type LoadedUserStory = {
|
||||
export type LoadedUserStory = {
|
||||
id: string;
|
||||
subject: string;
|
||||
};
|
||||
|
||||
type LoadedEpic = LoadedUserStory;
|
||||
export type LoadedEpic = LoadedUserStory;
|
||||
|
||||
type LoadedTags = {
|
||||
export type LoadedTags = {
|
||||
[tagName: string]: string | null; // hex color
|
||||
};
|
||||
|
||||
type Operations = 'all' | 'create' | 'delete' | 'change';
|
||||
export type Operations = 'all' | 'create' | 'delete' | 'change';
|
||||
|
||||
type Resources = 'all' | 'issue' | 'milestone' | 'task' | 'userstory' | 'wikipage';
|
||||
export type Resources = 'all' | 'issue' | 'milestone' | 'task' | 'userstory' | 'wikipage';
|
||||
|
||||
type WebhookPayload = {
|
||||
export type WebhookPayload = {
|
||||
action: Operations;
|
||||
type: Resources;
|
||||
by: Record<string, string | number>;
|
||||
|
||||
@@ -5,7 +5,7 @@ import type {
|
||||
INodeTypeDescription,
|
||||
} from 'n8n-workflow';
|
||||
import { NodeConnectionTypes, NodeOperationError } from 'n8n-workflow';
|
||||
import OTPAuth from 'otpauth';
|
||||
import * as OTPAuth from 'otpauth';
|
||||
|
||||
export class Totp implements INodeType {
|
||||
description: INodeTypeDescription = {
|
||||
|
||||
@@ -173,7 +173,7 @@ export class SplitOut implements INodeType {
|
||||
}
|
||||
|
||||
if (typeof entityToSplit !== 'object' || entityToSplit === null) {
|
||||
entityToSplit = [entityToSplit];
|
||||
entityToSplit = [entityToSplit] as unknown as IDataObject[];
|
||||
}
|
||||
|
||||
if (!Array.isArray(entityToSplit)) {
|
||||
|
||||
@@ -8,12 +8,12 @@
|
||||
"copy-nodes-json": "node scripts/copy-nodes-json.js .",
|
||||
"dev": "pnpm watch",
|
||||
"typecheck": "tsc --noEmit",
|
||||
"build": "tsup --tsconfig tsconfig.build.json && pnpm copy-nodes-json && tsc-alias -p tsconfig.build.json && pnpm n8n-copy-static-files && pnpm n8n-generate-translations && pnpm n8n-generate-metadata",
|
||||
"build": "tsc --build tsconfig.build.cjs.json && pnpm copy-nodes-json && tsc-alias -p tsconfig.build.cjs.json && pnpm n8n-copy-static-files && pnpm n8n-generate-translations && pnpm n8n-generate-metadata",
|
||||
"format": "biome format --write .",
|
||||
"format:check": "biome ci .",
|
||||
"lint": "eslint nodes credentials utils test --quiet && node ./scripts/validate-load-options-methods.js",
|
||||
"lintfix": "eslint nodes credentials utils test --fix",
|
||||
"watch": "tsup --watch --tsconfig tsconfig.build.json --onSuccess \"pnpm copy-nodes-json && tsc-alias -p tsconfig.build.json && pnpm n8n-generate-metadata\"",
|
||||
"watch": "tsc-watch -p tsconfig.build.cjs.json --onCompilationComplete \"pnpm copy-nodes-json && tsc-alias -p tsconfig.build.cjs.json\" --onSuccess \"pnpm n8n-generate-metadata\"",
|
||||
"test": "jest",
|
||||
"test:dev": "jest --watch"
|
||||
},
|
||||
|
||||
1
packages/nodes-base/shims.d.ts
vendored
Normal file
1
packages/nodes-base/shims.d.ts
vendored
Normal file
@@ -0,0 +1 @@
|
||||
declare module 'minifaker';
|
||||
24
packages/nodes-base/tsconfig.build.cjs.json
Normal file
24
packages/nodes-base/tsconfig.build.cjs.json
Normal file
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"extends": ["./tsconfig.json", "@n8n/typescript-config/modern/tsconfig.cjs.json"],
|
||||
"compilerOptions": {
|
||||
"outDir": "dist",
|
||||
"module": "commonjs",
|
||||
"tsBuildInfoFile": "dist/typecheck.tsbuildinfo"
|
||||
},
|
||||
"include": [
|
||||
"credentials/**/*.ts",
|
||||
"credentials/translations/**/*.json",
|
||||
"nodes/**/*.ts",
|
||||
"nodes/**/*.json",
|
||||
"types/**/*.ts",
|
||||
"utils/**/*.ts"
|
||||
],
|
||||
"exclude": [
|
||||
"node_modules",
|
||||
"nodes/**/*.test.ts",
|
||||
"credentials/**/*.test.ts",
|
||||
"utils/**/*.test.ts",
|
||||
"test/**",
|
||||
"../core/nodes-testing"
|
||||
]
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
{
|
||||
"extends": ["./tsconfig.json", "@n8n/typescript-config/tsconfig.build.json"],
|
||||
"compilerOptions": {
|
||||
"outDir": "dist",
|
||||
"composite": true,
|
||||
"tsBuildInfoFile": "dist/build.tsbuildinfo"
|
||||
},
|
||||
"include": [
|
||||
"credentials/**/*.ts",
|
||||
"credentials/translations/**/*.json",
|
||||
"nodes/**/*.ts",
|
||||
"nodes/**/*.json",
|
||||
"types/**/*.ts",
|
||||
"utils/**/*.ts"
|
||||
],
|
||||
"exclude": ["nodes/**/*.test.ts", "credentials/**/*.test.ts", "utils/**/*.test.ts", "test/**"]
|
||||
}
|
||||
@@ -1,8 +1,5 @@
|
||||
{
|
||||
"extends": [
|
||||
"@n8n/typescript-config/tsconfig.common.json",
|
||||
"@n8n/typescript-config/tsconfig.backend.json"
|
||||
],
|
||||
"extends": ["@n8n/typescript-config/modern/tsconfig.json"],
|
||||
"compilerOptions": {
|
||||
"paths": {
|
||||
"@credentials/*": ["./credentials/*"],
|
||||
@@ -11,19 +8,39 @@
|
||||
"@nodes-testing/*": ["../core/nodes-testing/*"]
|
||||
},
|
||||
"tsBuildInfoFile": "dist/typecheck.tsbuildinfo",
|
||||
|
||||
"emitDecoratorMetadata": true,
|
||||
"experimentalDecorators": true,
|
||||
// TODO: remove all options below this line
|
||||
|
||||
// TODO: remove all options below this line to align with the modern config
|
||||
// TODO: "module" to be removed when we migrate to vitest
|
||||
"module": "commonjs",
|
||||
// TODO: "moduleResolution" to be removed when we migrate to vitest
|
||||
"moduleResolution": "node",
|
||||
"noImplicitReturns": false,
|
||||
"useUnknownInCatchVariables": false
|
||||
"useUnknownInCatchVariables": false,
|
||||
"isolatedModules": false,
|
||||
"verbatimModuleSyntax": false,
|
||||
"noUncheckedIndexedAccess": false,
|
||||
"noImplicitOverride": false,
|
||||
|
||||
"noImplicitAny": true,
|
||||
"noUnusedLocals": true,
|
||||
"noUnusedParameters": true,
|
||||
"strictNullChecks": true,
|
||||
"preserveConstEnums": true
|
||||
},
|
||||
"include": [
|
||||
"shims.d.ts",
|
||||
"credentials/**/*.ts",
|
||||
"nodes/**/*.ts",
|
||||
"nodes/**/*.json",
|
||||
"test/**/*.ts",
|
||||
"types/**/*.ts",
|
||||
"utils/**/*.ts"
|
||||
"utils/**/*.ts",
|
||||
"types/**/*.ts",
|
||||
"../core/nodes-testing/**/*.ts",
|
||||
"../../node_modules/jest-expect-message/types/index.d.ts"
|
||||
],
|
||||
"references": [
|
||||
{ "path": "../@n8n/imap/tsconfig.build.json" },
|
||||
|
||||
@@ -1,62 +0,0 @@
|
||||
import { defineConfig } from 'tsup';
|
||||
import glob from 'fast-glob';
|
||||
import { resolve } from 'path';
|
||||
import { readFile } from 'fs/promises';
|
||||
|
||||
const packagesDir = resolve(__dirname, '..');
|
||||
const aiNodesDir = resolve(packagesDir, '@n8n', 'nodes-langchain');
|
||||
const cliDir = resolve(packagesDir, 'cli');
|
||||
|
||||
const externalFiles = [
|
||||
...(await glob('nodes/**/*.ts', { cwd: aiNodesDir, absolute: true })),
|
||||
...(await glob('test/integration/**/*.ts', { cwd: cliDir, absolute: true })),
|
||||
];
|
||||
|
||||
const externalFilesContents = externalFiles.map((filePath) => readFile(filePath, 'utf-8'));
|
||||
|
||||
// Files used in other packages
|
||||
const externalPackageImports = (await Promise.all(externalFilesContents)).reduce(
|
||||
(acc, fileContents) => {
|
||||
const regex = /from\s+['"](n8n-nodes-base[^'"]+)['"]/g;
|
||||
let match;
|
||||
while ((match = regex.exec(fileContents)) !== null) {
|
||||
acc.add(match[1]);
|
||||
}
|
||||
|
||||
return acc;
|
||||
},
|
||||
new Set<string>(),
|
||||
);
|
||||
|
||||
const externalPackageDependencies = Array.from(externalPackageImports).map(
|
||||
(i) => i.replace(/^n8n-nodes-base\/(dist\/)?/, '') + '.ts',
|
||||
);
|
||||
|
||||
const commonIgnoredFiles = ['!**/*.d.ts', '!**/*.test.ts'];
|
||||
|
||||
export default defineConfig([
|
||||
{
|
||||
entry: [
|
||||
'{credentials,nodes,test,types,utils}/**/*.ts',
|
||||
...commonIgnoredFiles,
|
||||
...externalPackageDependencies.map((path) => `!${path}`),
|
||||
],
|
||||
format: ['cjs'],
|
||||
dts: false,
|
||||
bundle: false,
|
||||
sourcemap: true,
|
||||
silent: true,
|
||||
},
|
||||
{
|
||||
entry: [...externalPackageDependencies, ...commonIgnoredFiles],
|
||||
format: ['cjs'],
|
||||
dts: {
|
||||
compilerOptions: {
|
||||
composite: false,
|
||||
},
|
||||
},
|
||||
bundle: false,
|
||||
sourcemap: true,
|
||||
silent: true,
|
||||
},
|
||||
]);
|
||||
12
patches/ics.patch
Normal file
12
patches/ics.patch
Normal file
@@ -0,0 +1,12 @@
|
||||
diff --git a/package.json b/package.json
|
||||
index c69d9542b6f211d7dd3da0d11eb62002ed480457..a85c007d243ff0323c6ee271768147a848737241 100644
|
||||
--- a/package.json
|
||||
+++ b/package.json
|
||||
@@ -3,6 +3,7 @@
|
||||
"version": "2.40.0",
|
||||
"description": "iCal (ics) file generator",
|
||||
"exports": {
|
||||
+ "types": "./index.d.ts",
|
||||
"require": "./index.js",
|
||||
"default": "./dist/index.js"
|
||||
},
|
||||
12
patches/minifaker.patch
Normal file
12
patches/minifaker.patch
Normal file
@@ -0,0 +1,12 @@
|
||||
diff --git a/package.json b/package.json
|
||||
index 6ee7fa8ca1fc6daf7322b5278becb4e38c55eef8..7ebf0a67338ae7635a13d73952e7b4fa9c6c0f6b 100644
|
||||
--- a/package.json
|
||||
+++ b/package.json
|
||||
@@ -7,6 +7,7 @@
|
||||
"module": "./dist/esm/index.js",
|
||||
"exports": {
|
||||
".": {
|
||||
+ "types": "./dist/types/index.d.ts",
|
||||
"import": "./dist/esm/index.js",
|
||||
"require": "./dist/cjs/index.js"
|
||||
},
|
||||
20
pnpm-lock.yaml
generated
20
pnpm-lock.yaml
generated
@@ -219,9 +219,15 @@ patchedDependencies:
|
||||
element-plus@2.4.3:
|
||||
hash: 3bc4ea0a42ad52c6bbc3d06c12c2963d55b57d6b5b8d436e46e7fd8ff8c10661
|
||||
path: patches/element-plus@2.4.3.patch
|
||||
ics:
|
||||
hash: 163587ad2fa9bc787ed09cd5e958eace08b4aa8aaca651869e9434ba674e158d
|
||||
path: patches/ics.patch
|
||||
js-base64:
|
||||
hash: bb02fdf69495c7b0768791b60ab6e1a002053b8decd19a174f5755691e5c9500
|
||||
path: patches/js-base64.patch
|
||||
minifaker:
|
||||
hash: bc707e2c34a2464da2c9c93ead33e80fd9883a00434ef64907ddc45208a08b33
|
||||
path: patches/minifaker.patch
|
||||
pdfjs-dist@5.3.31:
|
||||
hash: 421253c8e411cdaef58ba96d2bb44ae0784e1b3e446f5caca50710daa1fa5dcd
|
||||
path: patches/pdfjs-dist@5.3.31.patch
|
||||
@@ -2665,7 +2671,7 @@ importers:
|
||||
version: 0.6.3
|
||||
ics:
|
||||
specifier: 2.40.0
|
||||
version: 2.40.0
|
||||
version: 2.40.0(patch_hash=163587ad2fa9bc787ed09cd5e958eace08b4aa8aaca651869e9434ba674e158d)
|
||||
isbot:
|
||||
specifier: 3.6.13
|
||||
version: 3.6.13
|
||||
@@ -2701,7 +2707,7 @@ importers:
|
||||
version: 3.6.7
|
||||
minifaker:
|
||||
specifier: 1.34.1
|
||||
version: 1.34.1
|
||||
version: 1.34.1(patch_hash=bc707e2c34a2464da2c9c93ead33e80fd9883a00434ef64907ddc45208a08b33)
|
||||
moment-timezone:
|
||||
specifier: 0.5.37
|
||||
version: 0.5.37
|
||||
@@ -21141,7 +21147,7 @@ snapshots:
|
||||
'@types/serve-static@1.15.0':
|
||||
dependencies:
|
||||
'@types/mime': 3.0.1
|
||||
'@types/node': 20.17.57
|
||||
'@types/node': 20.19.1
|
||||
|
||||
'@types/shelljs@0.8.11':
|
||||
dependencies:
|
||||
@@ -21162,11 +21168,11 @@ snapshots:
|
||||
|
||||
'@types/ssh2-streams@0.1.12':
|
||||
dependencies:
|
||||
'@types/node': 20.17.57
|
||||
'@types/node': 20.19.1
|
||||
|
||||
'@types/ssh2@0.5.52':
|
||||
dependencies:
|
||||
'@types/node': 20.17.57
|
||||
'@types/node': 20.19.1
|
||||
'@types/ssh2-streams': 0.1.12
|
||||
|
||||
'@types/ssh2@1.11.6':
|
||||
@@ -25392,7 +25398,7 @@ snapshots:
|
||||
dependencies:
|
||||
safer-buffer: 2.1.2
|
||||
|
||||
ics@2.40.0:
|
||||
ics@2.40.0(patch_hash=163587ad2fa9bc787ed09cd5e958eace08b4aa8aaca651869e9434ba674e158d):
|
||||
dependencies:
|
||||
nanoid: 3.3.11
|
||||
yup: 0.32.11
|
||||
@@ -27070,7 +27076,7 @@ snapshots:
|
||||
|
||||
min-indent@1.0.1: {}
|
||||
|
||||
minifaker@1.34.1:
|
||||
minifaker@1.34.1(patch_hash=bc707e2c34a2464da2c9c93ead33e80fd9883a00434ef64907ddc45208a08b33):
|
||||
dependencies:
|
||||
'@types/uuid': 8.3.4
|
||||
nanoid: 3.3.11
|
||||
|
||||
Reference in New Issue
Block a user