n8n 1.101.1 → 1.102.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (176) hide show
  1. package/bin/n8n +3 -11
  2. package/dist/auth/auth.service.d.ts +9 -5
  3. package/dist/auth/auth.service.js +46 -27
  4. package/dist/auth/auth.service.js.map +1 -1
  5. package/dist/auth/jwt.js +1 -1
  6. package/dist/auth/jwt.js.map +1 -1
  7. package/dist/build.tsbuildinfo +1 -1
  8. package/dist/command-registry.d.ts +17 -0
  9. package/dist/command-registry.js +191 -0
  10. package/dist/command-registry.js.map +1 -0
  11. package/dist/commands/audit.d.ts +13 -8
  12. package/dist/commands/audit.js +33 -21
  13. package/dist/commands/audit.js.map +1 -1
  14. package/dist/commands/base-command.d.ts +4 -3
  15. package/dist/commands/base-command.js +15 -11
  16. package/dist/commands/base-command.js.map +1 -1
  17. package/dist/commands/community-node.d.ts +19 -22
  18. package/dist/commands/community-node.js +34 -30
  19. package/dist/commands/community-node.js.map +1 -1
  20. package/dist/commands/db/revert.d.ts +3 -9
  21. package/dist/commands/db/revert.js +22 -15
  22. package/dist/commands/db/revert.js.map +1 -1
  23. package/dist/commands/execute-batch.d.ts +40 -17
  24. package/dist/commands/execute-batch.js +120 -96
  25. package/dist/commands/execute-batch.js.map +1 -1
  26. package/dist/commands/execute.d.ts +16 -8
  27. package/dist/commands/execute.js +24 -15
  28. package/dist/commands/execute.js.map +1 -1
  29. package/dist/commands/export/credentials.d.ts +28 -13
  30. package/dist/commands/export/credentials.js +47 -37
  31. package/dist/commands/export/credentials.js.map +1 -1
  32. package/dist/commands/export/workflow.d.ts +25 -12
  33. package/dist/commands/export/workflow.js +43 -34
  34. package/dist/commands/export/workflow.js.map +1 -1
  35. package/dist/commands/import/credentials.d.ts +19 -10
  36. package/dist/commands/import/credentials.js +44 -28
  37. package/dist/commands/import/credentials.js.map +1 -1
  38. package/dist/commands/import/workflow.d.ts +19 -10
  39. package/dist/commands/import/workflow.js +41 -28
  40. package/dist/commands/import/workflow.js.map +1 -1
  41. package/dist/commands/ldap/reset.d.ts +16 -9
  42. package/dist/commands/ldap/reset.js +37 -22
  43. package/dist/commands/ldap/reset.js.map +1 -1
  44. package/dist/commands/license/clear.d.ts +0 -2
  45. package/dist/commands/license/clear.js +15 -4
  46. package/dist/commands/license/clear.js.map +1 -1
  47. package/dist/commands/license/info.d.ts +0 -2
  48. package/dist/commands/license/info.js +15 -4
  49. package/dist/commands/license/info.js.map +1 -1
  50. package/dist/commands/list/workflow.d.ts +13 -8
  51. package/dist/commands/list/workflow.js +26 -19
  52. package/dist/commands/list/workflow.js.map +1 -1
  53. package/dist/commands/mfa/disable.d.ts +10 -8
  54. package/dist/commands/mfa/disable.js +22 -15
  55. package/dist/commands/mfa/disable.js.map +1 -1
  56. package/dist/commands/start.d.ts +16 -9
  57. package/dist/commands/start.js +31 -25
  58. package/dist/commands/start.js.map +1 -1
  59. package/dist/commands/update/workflow.d.ts +16 -9
  60. package/dist/commands/update/workflow.js +24 -21
  61. package/dist/commands/update/workflow.js.map +1 -1
  62. package/dist/commands/user-management/reset.d.ts +0 -2
  63. package/dist/commands/user-management/reset.js +16 -5
  64. package/dist/commands/user-management/reset.js.map +1 -1
  65. package/dist/commands/webhook.d.ts +0 -5
  66. package/dist/commands/webhook.js +15 -8
  67. package/dist/commands/webhook.js.map +1 -1
  68. package/dist/commands/worker.d.ts +12 -11
  69. package/dist/commands/worker.js +29 -14
  70. package/dist/commands/worker.js.map +1 -1
  71. package/dist/config/index.js +1 -1
  72. package/dist/config/index.js.map +1 -1
  73. package/dist/controller.registry.js +1 -1
  74. package/dist/controller.registry.js.map +1 -1
  75. package/dist/controllers/ai.controller.d.ts +1 -1
  76. package/dist/controllers/ai.controller.js +16 -0
  77. package/dist/controllers/ai.controller.js.map +1 -1
  78. package/dist/controllers/auth.controller.js +10 -3
  79. package/dist/controllers/auth.controller.js.map +1 -1
  80. package/dist/controllers/community-packages.controller.js +2 -2
  81. package/dist/controllers/community-packages.controller.js.map +1 -1
  82. package/dist/controllers/e2e.controller.js +13 -3
  83. package/dist/controllers/e2e.controller.js.map +1 -1
  84. package/dist/controllers/invitation.controller.js +1 -1
  85. package/dist/controllers/invitation.controller.js.map +1 -1
  86. package/dist/controllers/me.controller.js +2 -2
  87. package/dist/controllers/me.controller.js.map +1 -1
  88. package/dist/controllers/mfa.controller.d.ts +1 -0
  89. package/dist/controllers/mfa.controller.js +24 -6
  90. package/dist/controllers/mfa.controller.js.map +1 -1
  91. package/dist/controllers/oauth/abstract-oauth.controller.d.ts +1 -0
  92. package/dist/controllers/oauth/abstract-oauth.controller.js +6 -1
  93. package/dist/controllers/oauth/abstract-oauth.controller.js.map +1 -1
  94. package/dist/controllers/oauth/oauth2-credential.controller.js +2 -1
  95. package/dist/controllers/oauth/oauth2-credential.controller.js.map +1 -1
  96. package/dist/controllers/owner.controller.js +1 -1
  97. package/dist/controllers/owner.controller.js.map +1 -1
  98. package/dist/controllers/password-reset.controller.js +1 -1
  99. package/dist/controllers/password-reset.controller.js.map +1 -1
  100. package/dist/controllers/users.controller.d.ts +1 -0
  101. package/dist/credential-types.js +6 -5
  102. package/dist/credential-types.js.map +1 -1
  103. package/dist/credentials-helper.js +1 -1
  104. package/dist/credentials-helper.js.map +1 -1
  105. package/dist/environments.ee/source-control/source-control-export.service.ee.js +5 -1
  106. package/dist/environments.ee/source-control/source-control-export.service.ee.js.map +1 -1
  107. package/dist/environments.ee/source-control/source-control-git.service.ee.js +4 -0
  108. package/dist/environments.ee/source-control/source-control-git.service.ee.js.map +1 -1
  109. package/dist/environments.ee/source-control/source-control.service.ee.js +5 -4
  110. package/dist/environments.ee/source-control/source-control.service.ee.js.map +1 -1
  111. package/dist/errors/response-errors/content-too-large.error.d.ts +4 -0
  112. package/dist/errors/response-errors/content-too-large.error.js +11 -0
  113. package/dist/errors/response-errors/content-too-large.error.js.map +1 -0
  114. package/dist/errors/response-errors/too-many-requests.error.d.ts +4 -0
  115. package/dist/errors/response-errors/too-many-requests.error.js +11 -0
  116. package/dist/errors/response-errors/too-many-requests.error.js.map +1 -0
  117. package/dist/evaluation.ee/test-runner/test-runner.service.ee.js +1 -1
  118. package/dist/evaluation.ee/test-runner/test-runner.service.ee.js.map +1 -1
  119. package/dist/events/relays/telemetry.event-relay.js +7 -2
  120. package/dist/events/relays/telemetry.event-relay.js.map +1 -1
  121. package/dist/license/license.service.js +2 -0
  122. package/dist/license/license.service.js.map +1 -1
  123. package/dist/mfa/constants.d.ts +2 -0
  124. package/dist/mfa/constants.js +6 -0
  125. package/dist/mfa/constants.js.map +1 -0
  126. package/dist/mfa/mfa.service.d.ts +11 -2
  127. package/dist/mfa/mfa.service.js +39 -2
  128. package/dist/mfa/mfa.service.js.map +1 -1
  129. package/dist/modules/insights/insights.module.d.ts +1 -5
  130. package/dist/modules/insights/insights.module.js +6 -8
  131. package/dist/modules/insights/insights.module.js.map +1 -1
  132. package/dist/public-api/v1/openapi.yml +2 -2
  133. package/dist/push/index.js +1 -1
  134. package/dist/push/index.js.map +1 -1
  135. package/dist/requests.d.ts +4 -0
  136. package/dist/scaling/job-processor.js +1 -0
  137. package/dist/scaling/job-processor.js.map +1 -1
  138. package/dist/scaling/scaling.types.d.ts +1 -0
  139. package/dist/server.d.ts +1 -3
  140. package/dist/server.js +14 -18
  141. package/dist/server.js.map +1 -1
  142. package/dist/services/community-packages.service.d.ts +1 -1
  143. package/dist/services/community-packages.service.js +7 -9
  144. package/dist/services/community-packages.service.js.map +1 -1
  145. package/dist/services/frontend.service.d.ts +3 -1
  146. package/dist/services/frontend.service.js +9 -2
  147. package/dist/services/frontend.service.js.map +1 -1
  148. package/dist/services/hooks.service.d.ts +1 -0
  149. package/dist/services/hooks.service.js +3 -2
  150. package/dist/services/hooks.service.js.map +1 -1
  151. package/dist/services/user.service.d.ts +1 -0
  152. package/dist/services/user.service.js +1 -0
  153. package/dist/services/user.service.js.map +1 -1
  154. package/dist/sso.ee/oidc/routes/oidc.controller.ee.js +3 -1
  155. package/dist/sso.ee/oidc/routes/oidc.controller.ee.js.map +1 -1
  156. package/dist/sso.ee/saml/routes/saml.controller.ee.js +1 -1
  157. package/dist/sso.ee/saml/routes/saml.controller.ee.js.map +1 -1
  158. package/dist/task-runners/task-runner-process.d.ts +1 -0
  159. package/dist/task-runners/task-runner-process.js +7 -2
  160. package/dist/task-runners/task-runner-process.js.map +1 -1
  161. package/dist/telemetry/index.d.ts +1 -3
  162. package/dist/telemetry/index.js +1 -4
  163. package/dist/telemetry/index.js.map +1 -1
  164. package/dist/webhooks/webhook-helpers.js +1 -1
  165. package/dist/webhooks/webhook-helpers.js.map +1 -1
  166. package/dist/workflow-execute-additional-data.js +1 -0
  167. package/dist/workflow-execute-additional-data.js.map +1 -1
  168. package/dist/workflow-runner.js +2 -0
  169. package/dist/workflow-runner.js.map +1 -1
  170. package/dist/zod-alias-support.d.ts +9 -0
  171. package/dist/zod-alias-support.js +8 -0
  172. package/dist/zod-alias-support.js.map +1 -0
  173. package/package.json +24 -26
  174. package/dist/help.d.ts +0 -4
  175. package/dist/help.js +0 -12
  176. package/dist/help.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"community-node.js","sourceRoot":"","sources":["../../src/commands/community-node.ts"],"names":[],"mappings":";;;AACA,gCAA0F;AAC1F,gCAAoC;AACpC,sCAAoC;AAEpC,2EAAuE;AACvE,sFAAiF;AAEjF,iDAA6C;AAE7C,MAAa,aAAc,SAAQ,0BAAW;IA0B7C,KAAK,CAAC,IAAI;QACT,MAAM,KAAK,CAAC,IAAI,EAAE,CAAC;IACpB,CAAC;IAED,KAAK,CAAC,GAAG;QACR,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,UAAU,EAAE,CAAC;QAE1C,MAAM,WAAW,GAAG,KAAK,CAAC,OAAO,CAAC;QAClC,MAAM,cAAc,GAAG,KAAK,CAAC,UAAU,CAAC;QACxC,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;Q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B"}
@@ -1,16 +1,10 @@
1
1
  import { Logger } from '@n8n/backend-common';
2
2
  import { MigrationExecutor, DataSource as Connection } from '@n8n/typeorm';
3
- import { Command } from '@oclif/core';
4
3
  export declare function main(logger: Logger, connection: Connection, migrationExecutor: MigrationExecutor): Promise<void>;
5
- export declare class DbRevertMigrationCommand extends Command {
6
- static description: string;
7
- static examples: string[];
8
- static flags: {
9
- help: import("@oclif/core/lib/interfaces").BooleanFlag<void>;
10
- };
11
- protected logger: Logger;
4
+ export declare class DbRevertMigrationCommand {
5
+ private readonly logger;
12
6
  private connection;
13
- init(): Promise<void>;
7
+ constructor(logger: Logger);
14
8
  run(): Promise<void>;
15
9
  catch(error: Error): Promise<void>;
16
10
  protected finally(error: Error | undefined): Promise<void>;
@@ -1,12 +1,21 @@
1
1
  "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
2
11
  Object.defineProperty(exports, "__esModule", { value: true });
3
12
  exports.DbRevertMigrationCommand = void 0;
4
13
  exports.main = main;
5
14
  const backend_common_1 = require("@n8n/backend-common");
6
15
  const db_1 = require("@n8n/db");
16
+ const decorators_1 = require("@n8n/decorators");
7
17
  const di_1 = require("@n8n/di");
8
18
  const typeorm_1 = require("@n8n/typeorm");
9
- const core_1 = require("@oclif/core");
10
19
  async function main(logger, connection, migrationExecutor) {
11
20
  const executedMigrations = await migrationExecutor.getExecutedMigrations();
12
21
  const lastExecutedMigration = executedMigrations.at(0);
@@ -36,13 +45,9 @@ async function main(logger, connection, migrationExecutor) {
36
45
  });
37
46
  await connection.destroy();
38
47
  }
39
- class DbRevertMigrationCommand extends core_1.Command {
40
- constructor() {
41
- super(...arguments);
42
- this.logger = di_1.Container.get(backend_common_1.Logger);
43
- }
44
- async init() {
45
- await this.parse(DbRevertMigrationCommand);
48
+ let DbRevertMigrationCommand = class DbRevertMigrationCommand {
49
+ constructor(logger) {
50
+ this.logger = logger;
46
51
  }
47
52
  async run() {
48
53
  const connectionOptions = {
@@ -66,13 +71,15 @@ class DbRevertMigrationCommand extends core_1.Command {
66
71
  async finally(error) {
67
72
  if (this.connection?.isInitialized)
68
73
  await this.connection.destroy();
69
- this.exit(error ? 1 : 0);
74
+ process.exit(error ? 1 : 0);
70
75
  }
71
- }
72
- exports.DbRevertMigrationCommand = DbRevertMigrationCommand;
73
- DbRevertMigrationCommand.description = 'Revert last database migration';
74
- DbRevertMigrationCommand.examples = ['$ n8n db:revert'];
75
- DbRevertMigrationCommand.flags = {
76
- help: core_1.Flags.help({ char: 'h' }),
77
76
  };
77
+ exports.DbRevertMigrationCommand = DbRevertMigrationCommand;
78
+ exports.DbRevertMigrationCommand = DbRevertMigrationCommand = __decorate([
79
+ (0, decorators_1.Command)({
80
+ name: 'db:revert',
81
+ description: 'Revert last database migration',
82
+ }),
83
+ __metadata("design:paramtypes", [backend_common_1.Logger])
84
+ ], DbRevertMigrationCommand);
78
85
  //# sourceMappingURL=revert.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"revert.js","sourceRoot":"","sources":["../../../src/commands/db/revert.ts"],"names":[],"mappings":";;;AAaA,oBA8CC;AA3DD,wDAA6C;AAE7C,gCAA6D;AAC7D,gCAAoC;AAIpC,0CAA2E;AAC3E,sCAA6C;AAKtC,KAAK,UAAU,IAAI,CACzB,MAAc,EACd,UAAsB,EACtB,iBAAoC;IAEpC,MAAM,kBAAkB,GAAG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AA+D,CAAC,CAAC;QACnF,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAClC,CAAC;IAES,KAAK,CAAC,OAAO,CAAC,KAAwB;QAC/C,IAAI,IAAI,CAAC,UAAU,EAAE,aAAa;YAAE,MAAM,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,CAAC;QAEpE,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC7B,CAAC;CACD,CAAA;AAnCY,4DAAwB;mCAAxB,wBAAwB;IAJpC,IAAA,oBAAO,EAAC;QACR,IAAI,EAAE,WAAW;QACjB,WAAW,EAAE,gCAAgC;KAC7C,CAAC;qCAIoC,uBAAM;GAH/B,wBAAwB,CAmCpC"}
@@ -1,9 +1,46 @@
1
1
  import type { User } from '@n8n/db';
2
2
  import type { IWorkflowBase } from 'n8n-workflow';
3
+ import { z } from 'zod';
3
4
  import { BaseCommand } from './base-command';
4
5
  import type { IExecutionResult, IResult, IWorkflowExecutionProgress } from '../types/commands.types';
5
- export declare class ExecuteBatch extends BaseCommand {
6
- static description: string;
6
+ declare const flagsSchema: z.ZodObject<{
7
+ debug: z.ZodDefault<z.ZodBoolean>;
8
+ ids: z.ZodOptional<z.ZodString>;
9
+ concurrency: z.ZodDefault<z.ZodNumber>;
10
+ output: z.ZodOptional<z.ZodString>;
11
+ snapshot: z.ZodOptional<z.ZodString>;
12
+ compare: z.ZodOptional<z.ZodString>;
13
+ shallow: z.ZodOptional<z.ZodBoolean>;
14
+ githubWorkflow: z.ZodOptional<z.ZodBoolean>;
15
+ skipList: z.ZodOptional<z.ZodString>;
16
+ retries: z.ZodDefault<z.ZodNumber>;
17
+ shortOutput: z.ZodOptional<z.ZodBoolean>;
18
+ }, "strip", z.ZodTypeAny, {
19
+ debug: boolean;
20
+ concurrency: number;
21
+ retries: number;
22
+ output?: string | undefined;
23
+ ids?: string | undefined;
24
+ snapshot?: string | undefined;
25
+ compare?: string | undefined;
26
+ shallow?: boolean | undefined;
27
+ githubWorkflow?: boolean | undefined;
28
+ skipList?: string | undefined;
29
+ shortOutput?: boolean | undefined;
30
+ }, {
31
+ debug?: boolean | undefined;
32
+ concurrency?: number | undefined;
33
+ output?: string | undefined;
34
+ ids?: string | undefined;
35
+ snapshot?: string | undefined;
36
+ compare?: string | undefined;
37
+ shallow?: boolean | undefined;
38
+ githubWorkflow?: boolean | undefined;
39
+ skipList?: string | undefined;
40
+ retries?: number | undefined;
41
+ shortOutput?: boolean | undefined;
42
+ }>;
43
+ export declare class ExecuteBatch extends BaseCommand<z.infer<typeof flagsSchema>> {
7
44
  static cancelled: boolean;
8
45
  static workflowExecutionsProgress: IWorkflowExecutionProgress[][];
9
46
  static shallow: boolean;
@@ -14,21 +51,6 @@ export declare class ExecuteBatch extends BaseCommand {
14
51
  static debug: boolean;
15
52
  static executionTimeout: number;
16
53
  static instanceOwner: User;
17
- static examples: string[];
18
- static flags: {
19
- help: import("@oclif/core/lib/interfaces").BooleanFlag<void>;
20
- debug: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
21
- ids: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
22
- concurrency: import("@oclif/core/lib/interfaces").OptionFlag<number, import("@oclif/core/lib/interfaces").CustomOptions>;
23
- output: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
24
- snapshot: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
25
- compare: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
26
- shallow: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
27
- githubWorkflow: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
28
- skipList: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
29
- retries: import("@oclif/core/lib/interfaces").OptionFlag<number, import("@oclif/core/lib/interfaces").CustomOptions>;
30
- shortOutput: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
31
- };
32
54
  static aliases: string[];
33
55
  needsCommunityPackages: boolean;
34
56
  needsTaskRunner: boolean;
@@ -44,3 +66,4 @@ export declare class ExecuteBatch extends BaseCommand {
44
66
  initializeLogs(): void;
45
67
  startThread(workflowData: IWorkflowBase): Promise<IExecutionResult>;
46
68
  }
69
+ export {};
@@ -1,18 +1,26 @@
1
1
  "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
2
8
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
9
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
10
  };
11
+ var ExecuteBatch_1;
5
12
  Object.defineProperty(exports, "__esModule", { value: true });
6
13
  exports.ExecuteBatch = void 0;
7
14
  const db_1 = require("@n8n/db");
15
+ const decorators_1 = require("@n8n/decorators");
8
16
  const di_1 = require("@n8n/di");
9
- const core_1 = require("@oclif/core");
10
17
  const fs_1 = __importDefault(require("fs"));
11
18
  const json_diff_1 = require("json-diff");
12
19
  const pick_1 = __importDefault(require("lodash/pick"));
13
20
  const n8n_workflow_1 = require("n8n-workflow");
14
21
  const os_1 = __importDefault(require("os"));
15
22
  const path_1 = require("path");
23
+ const zod_1 = require("zod");
16
24
  const active_executions_1 = require("../active-executions");
17
25
  const ownership_service_1 = require("../services/ownership.service");
18
26
  const utils_1 = require("../utils");
@@ -20,17 +28,65 @@ const workflow_runner_1 = require("../workflow-runner");
20
28
  const base_command_1 = require("./base-command");
21
29
  const config_1 = __importDefault(require("../config"));
22
30
  const re = /\d+/;
23
- class ExecuteBatch extends base_command_1.BaseCommand {
31
+ const flagsSchema = zod_1.z.object({
32
+ debug: zod_1.z
33
+ .boolean()
34
+ .describe('Toggles on displaying all errors and debug messages.')
35
+ .default(false),
36
+ ids: zod_1.z
37
+ .string()
38
+ .describe('Specifies workflow IDs to get executed, separated by a comma or a file containing the ids')
39
+ .optional(),
40
+ concurrency: zod_1.z
41
+ .number()
42
+ .int()
43
+ .default(1)
44
+ .describe('How many workflows can run in parallel. Defaults to 1 which means no concurrency.'),
45
+ output: zod_1.z
46
+ .string()
47
+ .describe('Enable execution saving, You must inform an existing folder to save execution via this param')
48
+ .optional(),
49
+ snapshot: zod_1.z
50
+ .string()
51
+ .describe('Enables snapshot saving. You must inform an existing folder to save snapshots via this param.')
52
+ .optional(),
53
+ compare: zod_1.z
54
+ .string()
55
+ .describe('Compares current execution with an existing snapshot. You must inform an existing folder where the snapshots are saved.')
56
+ .optional(),
57
+ shallow: zod_1.z
58
+ .boolean()
59
+ .describe('Compares only if attributes output from node are the same, with no regards to nested JSON objects.')
60
+ .optional(),
61
+ githubWorkflow: zod_1.z
62
+ .boolean()
63
+ .describe('Enables more lenient comparison for GitHub workflows. This is useful for reducing false positives when comparing Test workflows.')
64
+ .optional(),
65
+ skipList: zod_1.z
66
+ .string()
67
+ .describe('File containing a comma separated list of workflow IDs to skip.')
68
+ .optional(),
69
+ retries: zod_1.z
70
+ .number()
71
+ .int()
72
+ .default(1)
73
+ .describe('Retries failed workflows up to N tries. Default is 1. Set 0 to disable.'),
74
+ shortOutput: zod_1.z
75
+ .boolean()
76
+ .describe('Omits the full execution information from output, displaying only summary.')
77
+ .optional(),
78
+ });
79
+ let ExecuteBatch = ExecuteBatch_1 = class ExecuteBatch extends base_command_1.BaseCommand {
24
80
  constructor() {
25
81
  super(...arguments);
26
82
  this.needsCommunityPackages = true;
27
83
  this.needsTaskRunner = true;
28
84
  }
29
85
  async stopProcess(skipExit = false) {
30
- if (ExecuteBatch.cancelled) {
86
+ if (ExecuteBatch_1.cancelled) {
31
87
  process.exit(0);
32
88
  }
33
- ExecuteBatch.cancelled = true;
89
+ ExecuteBatch_1.cancelled = true;
34
90
  await di_1.Container.get(active_executions_1.ActiveExecutions).shutdown(true);
35
91
  if (skipExit !== true) {
36
92
  process.exit(0);
@@ -71,9 +127,9 @@ class ExecuteBatch extends base_command_1.BaseCommand {
71
127
  await this.initExternalHooks();
72
128
  }
73
129
  async run() {
74
- const { flags } = await this.parse(ExecuteBatch);
75
- ExecuteBatch.debug = flags.debug;
76
- ExecuteBatch.concurrency = flags.concurrency || 1;
130
+ const { flags } = this;
131
+ ExecuteBatch_1.debug = flags.debug;
132
+ ExecuteBatch_1.concurrency = flags.concurrency || 1;
77
133
  const ids = [];
78
134
  const skipIds = [];
79
135
  if (flags.snapshot !== undefined) {
@@ -87,7 +143,7 @@ class ExecuteBatch extends base_command_1.BaseCommand {
87
143
  this.logger.error('The parameter --snapshot must be an existing directory');
88
144
  return;
89
145
  }
90
- ExecuteBatch.snapshot = flags.snapshot;
146
+ ExecuteBatch_1.snapshot = flags.snapshot;
91
147
  }
92
148
  if (flags.compare !== undefined) {
93
149
  if (fs_1.default.existsSync(flags.compare)) {
@@ -100,7 +156,7 @@ class ExecuteBatch extends base_command_1.BaseCommand {
100
156
  this.logger.error('The parameter --compare must be an existing directory');
101
157
  return;
102
158
  }
103
- ExecuteBatch.compare = flags.compare;
159
+ ExecuteBatch_1.compare = flags.compare;
104
160
  }
105
161
  if (flags.output !== undefined) {
106
162
  if (fs_1.default.existsSync(flags.output)) {
@@ -148,12 +204,12 @@ class ExecuteBatch extends base_command_1.BaseCommand {
148
204
  }
149
205
  }
150
206
  if (flags.shallow) {
151
- ExecuteBatch.shallow = true;
207
+ ExecuteBatch_1.shallow = true;
152
208
  }
153
209
  if (flags.githubWorkflow) {
154
- ExecuteBatch.githubWorkflow = true;
210
+ ExecuteBatch_1.githubWorkflow = true;
155
211
  }
156
- ExecuteBatch.instanceOwner = await di_1.Container.get(ownership_service_1.OwnershipService).getInstanceOwner();
212
+ ExecuteBatch_1.instanceOwner = await di_1.Container.get(ownership_service_1.OwnershipService).getInstanceOwner();
157
213
  const query = di_1.Container.get(db_1.WorkflowRepository).createQueryBuilder('workflows');
158
214
  if (ids.length > 0) {
159
215
  query.andWhere('workflows.id in (:...ids)', { ids });
@@ -162,14 +218,14 @@ class ExecuteBatch extends base_command_1.BaseCommand {
162
218
  query.andWhere('workflows.id not in (:...skipIds)', { skipIds });
163
219
  }
164
220
  const allWorkflows = (await query.getMany());
165
- if (ExecuteBatch.debug) {
221
+ if (ExecuteBatch_1.debug) {
166
222
  process.stdout.write(`Found ${allWorkflows.length} workflows to execute.\n`);
167
223
  }
168
224
  const results = await this.runTests([...allWorkflows]);
169
225
  let { retries } = flags;
170
226
  while (retries > 0 &&
171
227
  results.summary.warningExecutions + results.summary.failedExecutions > 0 &&
172
- !ExecuteBatch.cancelled) {
228
+ !ExecuteBatch_1.cancelled) {
173
229
  const failedWorkflowIds = results.summary.errors.map((execution) => execution.workflowId);
174
230
  failedWorkflowIds.push(...results.summary.warnings.map((execution) => execution.workflowId));
175
231
  const newWorkflowList = allWorkflows.filter((workflow) => failedWorkflowIds.includes(workflow.id));
@@ -201,7 +257,7 @@ class ExecuteBatch extends base_command_1.BaseCommand {
201
257
  }
202
258
  await this.stopProcess(true);
203
259
  if (results.summary.failedExecutions > 0) {
204
- this.exit(1);
260
+ process.exit(1);
205
261
  }
206
262
  }
207
263
  mergeResults(results, retryResults) {
@@ -240,17 +296,17 @@ class ExecuteBatch extends base_command_1.BaseCommand {
240
296
  coveredNodes: {},
241
297
  executions: [],
242
298
  };
243
- if (ExecuteBatch.debug) {
299
+ if (ExecuteBatch_1.debug) {
244
300
  this.initializeLogs();
245
301
  }
246
302
  return await new Promise(async (res) => {
247
303
  const promisesArray = [];
248
- for (let i = 0; i < ExecuteBatch.concurrency; i++) {
304
+ for (let i = 0; i < ExecuteBatch_1.concurrency; i++) {
249
305
  const promise = new Promise(async (resolve) => {
250
306
  let workflow;
251
307
  while (allWorkflows.length > 0) {
252
308
  workflow = allWorkflows.shift();
253
- if (ExecuteBatch.cancelled) {
309
+ if (ExecuteBatch_1.cancelled) {
254
310
  process.stdout.write(`Thread ${i + 1} resolving and quitting.`);
255
311
  resolve(true);
256
312
  break;
@@ -259,21 +315,21 @@ class ExecuteBatch extends base_command_1.BaseCommand {
259
315
  resolve(true);
260
316
  return;
261
317
  }
262
- if (ExecuteBatch.debug) {
263
- ExecuteBatch.workflowExecutionsProgress[i].push({
318
+ if (ExecuteBatch_1.debug) {
319
+ ExecuteBatch_1.workflowExecutionsProgress[i].push({
264
320
  workflowId: workflow.id,
265
321
  status: 'running',
266
322
  });
267
323
  this.updateStatus();
268
324
  }
269
325
  await this.startThread(workflow).then((executionResult) => {
270
- if (ExecuteBatch.debug) {
271
- ExecuteBatch.workflowExecutionsProgress[i].pop();
326
+ if (ExecuteBatch_1.debug) {
327
+ ExecuteBatch_1.workflowExecutionsProgress[i].pop();
272
328
  }
273
329
  result.executions.push(executionResult);
274
330
  if (executionResult.executionStatus === 'success') {
275
- if (ExecuteBatch.debug) {
276
- ExecuteBatch.workflowExecutionsProgress[i].push({
331
+ if (ExecuteBatch_1.debug) {
332
+ ExecuteBatch_1.workflowExecutionsProgress[i].push({
277
333
  workflowId: workflow.id,
278
334
  status: 'success',
279
335
  });
@@ -294,8 +350,8 @@ class ExecuteBatch extends base_command_1.BaseCommand {
294
350
  workflowId: executionResult.workflowId,
295
351
  error: executionResult.error,
296
352
  });
297
- if (ExecuteBatch.debug) {
298
- ExecuteBatch.workflowExecutionsProgress[i].push({
353
+ if (ExecuteBatch_1.debug) {
354
+ ExecuteBatch_1.workflowExecutionsProgress[i].push({
299
355
  workflowId: workflow.id,
300
356
  status: 'warning',
301
357
  });
@@ -308,8 +364,8 @@ class ExecuteBatch extends base_command_1.BaseCommand {
308
364
  workflowId: executionResult.workflowId,
309
365
  error: executionResult.error,
310
366
  });
311
- if (ExecuteBatch.debug) {
312
- ExecuteBatch.workflowExecutionsProgress[i].push({
367
+ if (ExecuteBatch_1.debug) {
368
+ ExecuteBatch_1.workflowExecutionsProgress[i].push({
313
369
  workflowId: workflow.id,
314
370
  status: 'error',
315
371
  });
@@ -326,7 +382,7 @@ class ExecuteBatch extends base_command_1.BaseCommand {
326
382
  promisesArray.push(promise);
327
383
  }
328
384
  await Promise.allSettled(promisesArray);
329
- if (ExecuteBatch.githubWorkflow) {
385
+ if (ExecuteBatch_1.githubWorkflow) {
330
386
  if (result.summary.errors.length < 6) {
331
387
  const errorMessage = result.summary.errors.map((error) => {
332
388
  return `*${error.workflowId}*: ${error.error}`;
@@ -346,15 +402,15 @@ class ExecuteBatch extends base_command_1.BaseCommand {
346
402
  fs_1.default.appendFileSync(output, `${key}=${value}${os_1.default.EOL}`);
347
403
  }
348
404
  updateStatus() {
349
- if (ExecuteBatch.cancelled) {
405
+ if (ExecuteBatch_1.cancelled) {
350
406
  return;
351
407
  }
352
408
  if (process.stdout.isTTY) {
353
- process.stdout.moveCursor(0, -ExecuteBatch.concurrency);
409
+ process.stdout.moveCursor(0, -ExecuteBatch_1.concurrency);
354
410
  process.stdout.cursorTo(0);
355
411
  process.stdout.clearLine(0);
356
412
  }
357
- ExecuteBatch.workflowExecutionsProgress.map((concurrentThread, index) => {
413
+ ExecuteBatch_1.workflowExecutionsProgress.map((concurrentThread, index) => {
358
414
  let message = `${index + 1}: `;
359
415
  concurrentThread.map((executionItem, workflowIndex) => {
360
416
  let openColor = '\x1b[0m';
@@ -387,9 +443,9 @@ class ExecuteBatch extends base_command_1.BaseCommand {
387
443
  process.stdout.write('**********************************************\n');
388
444
  process.stdout.write('\n');
389
445
  process.stdout.write('Batch number:\n');
390
- ExecuteBatch.workflowExecutionsProgress = [];
391
- for (let i = 0; i < ExecuteBatch.concurrency; i++) {
392
- ExecuteBatch.workflowExecutionsProgress.push([]);
446
+ ExecuteBatch_1.workflowExecutionsProgress = [];
447
+ for (let i = 0; i < ExecuteBatch_1.concurrency; i++) {
448
+ ExecuteBatch_1.workflowExecutionsProgress.push([]);
393
449
  process.stdout.write(`${i + 1}: \n`);
394
450
  }
395
451
  }
@@ -441,19 +497,19 @@ class ExecuteBatch extends base_command_1.BaseCommand {
441
497
  executionResult.error = 'Workflow execution timed out.';
442
498
  executionResult.executionStatus = 'warning';
443
499
  resolve(executionResult);
444
- }, ExecuteBatch.executionTimeout);
500
+ }, ExecuteBatch_1.executionTimeout);
445
501
  try {
446
502
  const startingNode = (0, utils_1.findCliWorkflowStart)(workflowData.nodes);
447
503
  const runData = {
448
504
  executionMode: 'cli',
449
505
  startNodes: [{ name: startingNode.name, sourceData: null }],
450
506
  workflowData,
451
- userId: ExecuteBatch.instanceOwner.id,
507
+ userId: ExecuteBatch_1.instanceOwner.id,
452
508
  };
453
509
  const executionId = await workflowRunner.run(runData);
454
510
  const activeExecutions = di_1.Container.get(active_executions_1.ActiveExecutions);
455
511
  const data = await activeExecutions.getPostExecutePromise(executionId);
456
- if (gotCancel || ExecuteBatch.cancelled) {
512
+ if (gotCancel || ExecuteBatch_1.cancelled) {
457
513
  clearTimeout(timeoutTimer);
458
514
  return;
459
515
  }
@@ -479,7 +535,7 @@ class ExecuteBatch extends base_command_1.BaseCommand {
479
535
  }
480
536
  }
481
537
  else {
482
- if (ExecuteBatch.shallow) {
538
+ if (ExecuteBatch_1.shallow) {
483
539
  Object.keys(data.data.resultData.runData).map((nodeName) => {
484
540
  data.data.resultData.runData[nodeName].map((taskData) => {
485
541
  if (taskData.data === undefined) {
@@ -557,13 +613,13 @@ class ExecuteBatch extends base_command_1.BaseCommand {
557
613
  });
558
614
  }
559
615
  const serializedData = this.formatJsonOutput(data);
560
- if (ExecuteBatch.compare === undefined) {
616
+ if (ExecuteBatch_1.compare === undefined) {
561
617
  executionResult.executionStatus = 'success';
562
618
  }
563
619
  else {
564
- const fileName = `${ExecuteBatch.compare.endsWith(path_1.sep)
565
- ? ExecuteBatch.compare
566
- : ExecuteBatch.compare + path_1.sep}${workflowData.id}-snapshot.json`;
620
+ const fileName = `${ExecuteBatch_1.compare.endsWith(path_1.sep)
621
+ ? ExecuteBatch_1.compare
622
+ : ExecuteBatch_1.compare + path_1.sep}${workflowData.id}-snapshot.json`;
567
623
  if (fs_1.default.existsSync(fileName)) {
568
624
  const contents = fs_1.default.readFileSync(fileName, { encoding: 'utf-8' });
569
625
  const expected = (0, n8n_workflow_1.jsonParse)(contents);
@@ -572,7 +628,7 @@ class ExecuteBatch extends base_command_1.BaseCommand {
572
628
  if (changes !== undefined) {
573
629
  const changesJson = JSON.stringify(changes);
574
630
  if (changesJson.includes('__deleted')) {
575
- if (ExecuteBatch.githubWorkflow) {
631
+ if (ExecuteBatch_1.githubWorkflow) {
576
632
  const deletedChanges = changesJson.match(/__deleted/g) ?? [];
577
633
  executionResult.error = `Workflow contains ${deletedChanges.length} deleted data.`;
578
634
  }
@@ -598,10 +654,10 @@ class ExecuteBatch extends base_command_1.BaseCommand {
598
654
  executionResult.executionStatus = 'warning';
599
655
  }
600
656
  }
601
- if (ExecuteBatch.snapshot !== undefined) {
602
- const fileName = `${ExecuteBatch.snapshot.endsWith(path_1.sep)
603
- ? ExecuteBatch.snapshot
604
- : ExecuteBatch.snapshot + path_1.sep}${workflowData.id}-snapshot.json`;
657
+ if (ExecuteBatch_1.snapshot !== undefined) {
658
+ const fileName = `${ExecuteBatch_1.snapshot.endsWith(path_1.sep)
659
+ ? ExecuteBatch_1.snapshot
660
+ : ExecuteBatch_1.snapshot + path_1.sep}${workflowData.id}-snapshot.json`;
605
661
  fs_1.default.writeFileSync(fileName, serializedData);
606
662
  }
607
663
  }
@@ -620,60 +676,28 @@ class ExecuteBatch extends base_command_1.BaseCommand {
620
676
  resolve(executionResult);
621
677
  });
622
678
  }
623
- }
679
+ };
624
680
  exports.ExecuteBatch = ExecuteBatch;
625
- ExecuteBatch.description = '\nExecutes multiple workflows once';
626
681
  ExecuteBatch.cancelled = false;
627
682
  ExecuteBatch.shallow = false;
628
683
  ExecuteBatch.concurrency = 1;
629
684
  ExecuteBatch.githubWorkflow = false;
630
685
  ExecuteBatch.debug = false;
631
686
  ExecuteBatch.executionTimeout = 3 * 60 * 1000;
632
- ExecuteBatch.examples = [
633
- '$ n8n executeBatch',
634
- '$ n8n executeBatch --concurrency=10 --skipList=/data/skipList.json',
635
- '$ n8n executeBatch --debug --output=/data/output.json',
636
- '$ n8n executeBatch --ids=10,13,15 --shortOutput',
637
- '$ n8n executeBatch --snapshot=/data/snapshots --shallow',
638
- '$ n8n executeBatch --compare=/data/previousExecutionData --retries=2',
639
- ];
640
- ExecuteBatch.flags = {
641
- help: core_1.Flags.help({ char: 'h' }),
642
- debug: core_1.Flags.boolean({
643
- description: 'Toggles on displaying all errors and debug messages.',
644
- }),
645
- ids: core_1.Flags.string({
646
- description: 'Specifies workflow IDs to get executed, separated by a comma or a file containing the ids',
647
- }),
648
- concurrency: core_1.Flags.integer({
649
- default: 1,
650
- description: 'How many workflows can run in parallel. Defaults to 1 which means no concurrency.',
651
- }),
652
- output: core_1.Flags.string({
653
- description: 'Enable execution saving, You must inform an existing folder to save execution via this param',
654
- }),
655
- snapshot: core_1.Flags.string({
656
- description: 'Enables snapshot saving. You must inform an existing folder to save snapshots via this param.',
657
- }),
658
- compare: core_1.Flags.string({
659
- description: 'Compares current execution with an existing snapshot. You must inform an existing folder where the snapshots are saved.',
660
- }),
661
- shallow: core_1.Flags.boolean({
662
- description: 'Compares only if attributes output from node are the same, with no regards to nested JSON objects.',
663
- }),
664
- githubWorkflow: core_1.Flags.boolean({
665
- description: 'Enables more lenient comparison for GitHub workflows. This is useful for reducing false positives when comparing Test workflows.',
666
- }),
667
- skipList: core_1.Flags.string({
668
- description: 'File containing a comma separated list of workflow IDs to skip.',
669
- }),
670
- retries: core_1.Flags.integer({
671
- description: 'Retries failed workflows up to N tries. Default is 1. Set 0 to disable.',
672
- default: 1,
673
- }),
674
- shortOutput: core_1.Flags.boolean({
675
- description: 'Omits the full execution information from output, displaying only summary.',
676
- }),
677
- };
678
687
  ExecuteBatch.aliases = ['executeBatch'];
688
+ exports.ExecuteBatch = ExecuteBatch = ExecuteBatch_1 = __decorate([
689
+ (0, decorators_1.Command)({
690
+ name: 'execute-batch',
691
+ description: 'Executes multiple workflows once',
692
+ examples: [
693
+ '',
694
+ '--concurrency=10 --skipList=/data/skipList.json',
695
+ '--debug --output=/data/output.json',
696
+ '--ids=10,13,15 --shortOutput',
697
+ '--snapshot=/data/snapshots --shallow',
698
+ '--compare=/data/previousExecutionData --retries=2',
699
+ ],
700
+ flagsSchema,
701
+ })
702
+ ], ExecuteBatch);
679
703
  //# sourceMappingURL=execute-batch.js.map