@fsai-flow/core 0.0.1 → 0.0.3

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 (86) hide show
  1. package/README.md +22 -2
  2. package/package.json +16 -6
  3. package/src/index.ts +1 -0
  4. package/src/lib/ActiveWorkflows.ts +326 -55
  5. package/src/lib/NodeExecuteFunctions.ts +0 -4
  6. package/src/lib/RedisLeaderElectionManager.ts +252 -0
  7. package/src/lib/WorkflowExecute.ts +26 -2
  8. package/tsconfig.base.json +28 -0
  9. package/tsconfig.json +1 -1
  10. package/dist/README.md +0 -11
  11. package/dist/package.json +0 -44
  12. package/dist/src/index.d.ts +0 -15
  13. package/dist/src/index.js +0 -29
  14. package/dist/src/index.js.map +0 -1
  15. package/dist/src/lib/ActiveWebhooks.d.ts +0 -59
  16. package/dist/src/lib/ActiveWebhooks.js +0 -184
  17. package/dist/src/lib/ActiveWebhooks.js.map +0 -1
  18. package/dist/src/lib/ActiveWorkflows.d.ts +0 -58
  19. package/dist/src/lib/ActiveWorkflows.js +0 -244
  20. package/dist/src/lib/ActiveWorkflows.js.map +0 -1
  21. package/dist/src/lib/BinaryDataManager/FileSystem.d.ts +0 -26
  22. package/dist/src/lib/BinaryDataManager/FileSystem.js +0 -179
  23. package/dist/src/lib/BinaryDataManager/FileSystem.js.map +0 -1
  24. package/dist/src/lib/BinaryDataManager/index.d.ts +0 -21
  25. package/dist/src/lib/BinaryDataManager/index.js +0 -146
  26. package/dist/src/lib/BinaryDataManager/index.js.map +0 -1
  27. package/dist/src/lib/ChangeCase.d.ts +0 -9
  28. package/dist/src/lib/ChangeCase.js +0 -43
  29. package/dist/src/lib/ChangeCase.js.map +0 -1
  30. package/dist/src/lib/Constants.d.ts +0 -14
  31. package/dist/src/lib/Constants.js +0 -19
  32. package/dist/src/lib/Constants.js.map +0 -1
  33. package/dist/src/lib/Credentials.d.ts +0 -27
  34. package/dist/src/lib/Credentials.js +0 -89
  35. package/dist/src/lib/Credentials.js.map +0 -1
  36. package/dist/src/lib/FileSystem.d.ts +0 -26
  37. package/dist/src/lib/FileSystem.js +0 -179
  38. package/dist/src/lib/FileSystem.js.map +0 -1
  39. package/dist/src/lib/InputConnectionDataLegacy.d.ts +0 -2
  40. package/dist/src/lib/InputConnectionDataLegacy.js +0 -79
  41. package/dist/src/lib/InputConnectionDataLegacy.js.map +0 -1
  42. package/dist/src/lib/Interfaces.d.ts +0 -148
  43. package/dist/src/lib/Interfaces.js +0 -3
  44. package/dist/src/lib/Interfaces.js.map +0 -1
  45. package/dist/src/lib/LoadNodeParameterOptions.d.ts +0 -39
  46. package/dist/src/lib/LoadNodeParameterOptions.js +0 -150
  47. package/dist/src/lib/LoadNodeParameterOptions.js.map +0 -1
  48. package/dist/src/lib/NodeExecuteFunctions.d.ts +0 -226
  49. package/dist/src/lib/NodeExecuteFunctions.js +0 -2483
  50. package/dist/src/lib/NodeExecuteFunctions.js.map +0 -1
  51. package/dist/src/lib/NodesLoader/constants.d.ts +0 -5
  52. package/dist/src/lib/NodesLoader/constants.js +0 -106
  53. package/dist/src/lib/NodesLoader/constants.js.map +0 -1
  54. package/dist/src/lib/NodesLoader/custom-directory-loader.d.ts +0 -9
  55. package/dist/src/lib/NodesLoader/custom-directory-loader.js +0 -36
  56. package/dist/src/lib/NodesLoader/custom-directory-loader.js.map +0 -1
  57. package/dist/src/lib/NodesLoader/directory-loader.d.ts +0 -66
  58. package/dist/src/lib/NodesLoader/directory-loader.js +0 -325
  59. package/dist/src/lib/NodesLoader/directory-loader.js.map +0 -1
  60. package/dist/src/lib/NodesLoader/index.d.ts +0 -5
  61. package/dist/src/lib/NodesLoader/index.js +0 -12
  62. package/dist/src/lib/NodesLoader/index.js.map +0 -1
  63. package/dist/src/lib/NodesLoader/lazy-package-directory-loader.d.ts +0 -7
  64. package/dist/src/lib/NodesLoader/lazy-package-directory-loader.js +0 -52
  65. package/dist/src/lib/NodesLoader/lazy-package-directory-loader.js.map +0 -1
  66. package/dist/src/lib/NodesLoader/load-class-in-isolation.d.ts +0 -1
  67. package/dist/src/lib/NodesLoader/load-class-in-isolation.js +0 -22
  68. package/dist/src/lib/NodesLoader/load-class-in-isolation.js.map +0 -1
  69. package/dist/src/lib/NodesLoader/package-directory-loader.d.ts +0 -17
  70. package/dist/src/lib/NodesLoader/package-directory-loader.js +0 -100
  71. package/dist/src/lib/NodesLoader/package-directory-loader.js.map +0 -1
  72. package/dist/src/lib/NodesLoader/types.d.ts +0 -14
  73. package/dist/src/lib/NodesLoader/types.js +0 -3
  74. package/dist/src/lib/NodesLoader/types.js.map +0 -1
  75. package/dist/src/lib/UserSettings.d.ts +0 -80
  76. package/dist/src/lib/UserSettings.js +0 -261
  77. package/dist/src/lib/UserSettings.js.map +0 -1
  78. package/dist/src/lib/WorkflowExecute.d.ts +0 -53
  79. package/dist/src/lib/WorkflowExecute.js +0 -835
  80. package/dist/src/lib/WorkflowExecute.js.map +0 -1
  81. package/dist/src/lib/index.d.ts +0 -21
  82. package/dist/src/lib/index.js +0 -146
  83. package/dist/src/lib/index.js.map +0 -1
  84. package/dist/src/utils/crypto.d.ts +0 -1
  85. package/dist/src/utils/crypto.js +0 -8
  86. package/dist/src/utils/crypto.js.map +0 -1
@@ -0,0 +1,252 @@
1
+ import Redis, { RedisOptions } from 'ioredis';
2
+ import { LoggerProxy as Logger } from '@fsai-flow/workflow';
3
+
4
+ export interface RedisLeaderElectionCallbacks {
5
+ onStartedLeading: () => void;
6
+ onStoppedLeading: () => void;
7
+ onNewLeader?: (identity: string) => void;
8
+ }
9
+
10
+ export class RedisLeaderElectionManager {
11
+ private redis: Redis;
12
+ private isLeader = false;
13
+ private lockKey: string;
14
+ private nodeId: string;
15
+ private lockTTL: number = 30000; // 30 seconds in milliseconds
16
+ private renewalInterval: number = 10000; // 10 seconds in milliseconds
17
+ private renewalTimer?: NodeJS.Timeout;
18
+ private callbacks: RedisLeaderElectionCallbacks;
19
+
20
+ constructor(
21
+ lockKey: string,
22
+ redisConfig: string | RedisOptions,
23
+ callbacks: RedisLeaderElectionCallbacks
24
+ ) {
25
+ this.lockKey = `leader:${lockKey}`;
26
+ this.nodeId = this.generateNodeId();
27
+ this.callbacks = callbacks;
28
+
29
+ // Initialize Redis connection
30
+ if (typeof redisConfig === 'string') {
31
+ this.redis = new Redis(redisConfig);
32
+ } else {
33
+ this.redis = new Redis(redisConfig);
34
+ }
35
+
36
+ // Handle Redis connection events
37
+ this.redis.on('connect', () => {
38
+ Logger.info(`Redis connected for leader election: ${this.lockKey}`);
39
+ });
40
+
41
+ this.redis.on('error', (error: any) => {
42
+ Logger.error(`Redis connection error for leader election: ${error.message}`);
43
+ });
44
+ }
45
+
46
+ /**
47
+ * Start the leader election process
48
+ */
49
+ async start(): Promise<void> {
50
+ Logger.info(`🚀 Starting Redis leader election for ${this.nodeId} on key ${this.lockKey}`);
51
+ Logger.info(`🔧 Leader election config: TTL=${this.lockTTL}ms, RenewalInterval=${this.renewalInterval}ms`);
52
+
53
+ // Try to acquire leadership immediately
54
+ Logger.info(`🎯 ${this.nodeId} making initial leadership attempt...`);
55
+ await this.tryAcquireLeadership();
56
+
57
+ // Start the renewal/retry loop
58
+ this.startRenewalLoop();
59
+
60
+ Logger.info(`✅ Leader election process started for ${this.nodeId}`);
61
+ }
62
+
63
+ /**
64
+ * Stop the leader election process
65
+ */
66
+ async stop(): Promise<void> {
67
+ Logger.info(`🛑 Stopping Redis leader election for ${this.nodeId}`);
68
+
69
+ // Stop renewal timer
70
+ if (this.renewalTimer) {
71
+ Logger.debug(`⏹️ Stopping leadership monitoring loop for ${this.nodeId}`);
72
+ clearInterval(this.renewalTimer as NodeJS.Timeout);
73
+ this.renewalTimer = undefined;
74
+ }
75
+
76
+ // Release leadership if we have it
77
+ if (this.isLeader) {
78
+ Logger.info(`👋 ${this.nodeId} releasing leadership voluntarily for ${this.lockKey}`);
79
+ await this.releaseLock();
80
+ }
81
+
82
+ // Close Redis connection
83
+ Logger.debug(`🔌 Disconnecting Redis for ${this.nodeId}`);
84
+ this.redis.disconnect();
85
+
86
+ Logger.info(`✅ Leader election stopped for ${this.nodeId}`);
87
+ }
88
+
89
+ /**
90
+ * Check if this node is currently the leader
91
+ */
92
+ getIsLeader(): boolean {
93
+ return this.isLeader;
94
+ }
95
+
96
+ /**
97
+ * Try to acquire leadership
98
+ */
99
+ private async tryAcquireLeadership(): Promise<boolean> {
100
+ try {
101
+ Logger.debug(`Node ${this.nodeId} attempting to acquire leadership for ${this.lockKey}`);
102
+
103
+ // Use SET with NX (not exists) and PX (expire in milliseconds)
104
+ const result = await this.redis.set(
105
+ this.lockKey,
106
+ this.nodeId,
107
+ 'PX', this.lockTTL,
108
+ 'NX'
109
+ );
110
+
111
+ if (result === 'OK') {
112
+ // Successfully acquired leadership
113
+ if (!this.isLeader) {
114
+ this.isLeader = true;
115
+ Logger.info(`🏆 Node ${this.nodeId} ACQUIRED LEADERSHIP for ${this.lockKey} (TTL: ${this.lockTTL}ms)`);
116
+ this.callbacks.onStartedLeading();
117
+ } else {
118
+ Logger.debug(`Node ${this.nodeId} renewed leadership lock for ${this.lockKey}`);
119
+ }
120
+ return true;
121
+ } else {
122
+ // Failed to acquire leadership - check who is the current leader
123
+ const currentLeader = await this.redis.get(this.lockKey);
124
+ const lockTTL = await this.redis.pttl(this.lockKey);
125
+
126
+ if (currentLeader) {
127
+ if (currentLeader !== this.nodeId) {
128
+ Logger.debug(`👑 Node ${this.nodeId} sees ${currentLeader} is the current leader for ${this.lockKey} (TTL: ${lockTTL}ms)`);
129
+ if (this.callbacks.onNewLeader) {
130
+ this.callbacks.onNewLeader(currentLeader);
131
+ }
132
+ }
133
+ } else {
134
+ Logger.debug(`Node ${this.nodeId} found no current leader for ${this.lockKey}, but failed to acquire lock`);
135
+ }
136
+
137
+ // Lost leadership if we previously had it
138
+ if (this.isLeader) {
139
+ this.isLeader = false;
140
+ Logger.info(`📉 Node ${this.nodeId} LOST LEADERSHIP for ${this.lockKey}`);
141
+ this.callbacks.onStoppedLeading();
142
+ }
143
+ return false;
144
+ }
145
+ } catch (error: any) {
146
+ Logger.error(`❌ Error during leader election for ${this.nodeId}: ${error.message}`);
147
+
148
+ // If we had leadership and there's an error, assume we lost it
149
+ if (this.isLeader) {
150
+ this.isLeader = false;
151
+ Logger.info(`💥 Node ${this.nodeId} LOST LEADERSHIP due to error: ${this.lockKey}`);
152
+ this.callbacks.onStoppedLeading();
153
+ }
154
+ return false;
155
+ }
156
+ }
157
+
158
+ /**
159
+ * Renew the leadership lock
160
+ */
161
+ private async renewLock(): Promise<boolean> {
162
+ try {
163
+ Logger.debug(`🔄 Node ${this.nodeId} attempting to renew leadership for ${this.lockKey}`);
164
+
165
+ // Use Lua script to atomically check ownership and renew
166
+ const script = `
167
+ if redis.call("get", KEYS[1]) == ARGV[1] then
168
+ return redis.call("pexpire", KEYS[1], ARGV[2])
169
+ else
170
+ return 0
171
+ end
172
+ `;
173
+
174
+ const result = await this.redis.eval(
175
+ script,
176
+ 1,
177
+ this.lockKey,
178
+ this.nodeId,
179
+ this.lockTTL.toString()
180
+ );
181
+
182
+ if (result === 1) {
183
+ Logger.debug(`✅ Node ${this.nodeId} successfully renewed leadership for ${this.lockKey} (TTL: ${this.lockTTL}ms)`);
184
+ return true;
185
+ } else {
186
+ Logger.warn(`⚠️ Node ${this.nodeId} failed to renew leadership for ${this.lockKey} - lock no longer owned by this node`);
187
+ return false;
188
+ }
189
+ } catch (error: any) {
190
+ Logger.error(`❌ Error renewing leadership lock for ${this.nodeId}: ${error.message}`);
191
+ return false;
192
+ }
193
+ }
194
+
195
+ /**
196
+ * Release the leadership lock
197
+ */
198
+ private async releaseLock(): Promise<void> {
199
+ try {
200
+ // Use Lua script to atomically check ownership and delete
201
+ const script = `
202
+ if redis.call("get", KEYS[1]) == ARGV[1] then
203
+ return redis.call("del", KEYS[1])
204
+ else
205
+ return 0
206
+ end
207
+ `;
208
+
209
+ await this.redis.eval(script, 1, this.lockKey, this.nodeId);
210
+ Logger.info(`Node ${this.nodeId} released leadership lock for ${this.lockKey}`);
211
+ } catch (error: any) {
212
+ Logger.error(`Error releasing lock for ${this.nodeId}: ${error.message}`);
213
+ }
214
+ }
215
+
216
+ /**
217
+ * Start the renewal/retry loop
218
+ */
219
+ private startRenewalLoop(): void {
220
+ Logger.info(`Starting leadership monitoring loop for ${this.nodeId} (check every ${this.renewalInterval}ms)`);
221
+
222
+ this.renewalTimer = setInterval(async () => {
223
+ if (this.isLeader) {
224
+ // Leader: Try to renew the lock
225
+ Logger.debug(`⏰ [LEADER] Node ${this.nodeId} periodic leadership renewal check`);
226
+ const renewed = await this.renewLock();
227
+ if (!renewed) {
228
+ // Failed to renew - we lost leadership
229
+ this.isLeader = false;
230
+ Logger.info(`💔 [LEADER] Node ${this.nodeId} LOST LEADERSHIP (failed to renew) for ${this.lockKey}`);
231
+ this.callbacks.onStoppedLeading();
232
+ } else {
233
+ // Successfully renewed - keeping leadership
234
+ //Logger.info(`🔒 [LEADER] Node ${this.nodeId} RENEWED LEADERSHIP - staying active for ${this.lockKey}`);
235
+ }
236
+ } else {
237
+ // Follower: Try to acquire leadership
238
+ Logger.debug(`⏰ [FOLLOWER] Node ${this.nodeId} checking for available leadership`);
239
+ await this.tryAcquireLeadership();
240
+ }
241
+ }, this.renewalInterval);
242
+ }
243
+
244
+ /**
245
+ * Generate a unique node identifier
246
+ */
247
+ private generateNodeId(): string {
248
+ return process.env['POD_NAME'] ||
249
+ process.env['HOSTNAME'] ||
250
+ `node-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
251
+ }
252
+ }
@@ -1,4 +1,3 @@
1
-
2
1
  import PCancelable = require('p-cancelable');
3
2
 
4
3
  import {
@@ -284,6 +283,10 @@ export class WorkflowExecute {
284
283
  ): void {
285
284
  let stillDataMissing = false;
286
285
 
286
+ if (connectionData.node === '__proto__' || connectionData.node === 'constructor' || connectionData.node === 'prototype') {
287
+ throw new Error('Prototype pollution detected');
288
+ }
289
+
287
290
  // Check if node has multiple inputs as then we have to wait for all input data
288
291
  // to be present before we can add it to the node-execution-stack
289
292
  if (workflow.connectionsByDestinationNode[connectionData.node]['main'].length > 1) {
@@ -837,7 +840,7 @@ export class WorkflowExecute {
837
840
  }
838
841
 
839
842
  break;
840
- } catch (error) {
843
+ } catch (error: any) {
841
844
  this.runExecutionData.resultData.lastNodeExecuted = executionData.node.name;
842
845
 
843
846
  executionError = {
@@ -846,6 +849,27 @@ export class WorkflowExecute {
846
849
  stack: (error as NodeOperationError | NodeApiError).stack,
847
850
  };
848
851
 
852
+ // Check if it's a critical database connection error that should fail immediately
853
+ const isCriticalConnectionError = error.message?.includes('too many clients') ||
854
+ error.message?.includes('Connection terminated') ||
855
+ error.message?.includes('connection is closed') ||
856
+ error.message?.includes('ECONNRESET') ||
857
+ error.message?.includes('ENOTFOUND') ||
858
+ error.code === 'ECONNRESET' ||
859
+ error.code === 'ENOTFOUND';
860
+
861
+ if (isCriticalConnectionError) {
862
+ Logger.error(`Critical database connection error in node "${executionNode.name}": ${error.message}`, {
863
+ node: executionNode.name,
864
+ workflowId: workflow.id,
865
+ error: error.message
866
+ });
867
+
868
+ // For critical connection errors, break out of retry loop immediately
869
+ // This will cause the workflow to fail on this node
870
+ break;
871
+ }
872
+
849
873
  Logger.debug(`Running node "${executionNode.name}" finished with error`, {
850
874
  node: executionNode.name,
851
875
  workflowId: workflow.id,
@@ -0,0 +1,28 @@
1
+ {
2
+ "compileOnSave": false,
3
+ "compilerOptions": {
4
+ "rootDir": ".",
5
+ "sourceMap": true,
6
+ "declaration": false,
7
+ "moduleResolution": "node",
8
+ "emitDecoratorMetadata": true,
9
+ "experimentalDecorators": true,
10
+ "importHelpers": true,
11
+ "target": "es2015",
12
+ "module": "esnext",
13
+ "lib": ["es2020", "dom"],
14
+ "skipLibCheck": true,
15
+ "skipDefaultLibCheck": true,
16
+ "baseUrl": ".",
17
+ "paths": {
18
+ "@fsai-flow/core": ["libs/core/src/index.ts"],
19
+ "@fsai-flow/nodes-base": ["libs/nodes-base/src/index.ts"],
20
+ "@fsai-flow/nodes-langchain": ["libs/nodes-langchain/src/index.ts"],
21
+ "@fsai-flow/workflow": ["libs/workflow/src/index.ts"],
22
+ "@fsai-flow/design-system": ["apps/design-system/src/main.ts"],
23
+ "@fsai-flow/editor-ui": ["apps/editor-ui/src/index.ts"],
24
+ "@fsai-flow/cli": ["apps/cli/src/index.ts"],
25
+ }
26
+ },
27
+ "exclude": ["node_modules", "tmp"]
28
+ }
package/tsconfig.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "extends": "../../tsconfig.base.json",
2
+ "extends": "./tsconfig.base.json",
3
3
  "compilerOptions": {
4
4
  "baseUrl": ".",
5
5
  "paths": {
package/dist/README.md DELETED
@@ -1,11 +0,0 @@
1
- # core
2
-
3
- This library was generated with [Nx](https://nx.dev).
4
-
5
- ## Building
6
-
7
- Run `nx build core` to build the library.
8
-
9
- ## Running unit tests
10
-
11
- Run `nx test core` to execute the unit tests via [Jest](https://jestjs.io).
package/dist/package.json DELETED
@@ -1,44 +0,0 @@
1
- {
2
- "name": "@fsai-flow/core",
3
- "version": "0.0.1",
4
- "dependencies": {
5
- "@fsai-flow/workflow": "workspace:^",
6
- "client-oauth2": "^4.3.3",
7
- "cron": "~3.3.0",
8
- "crypto-js": "~4.2.0",
9
- "file-type": "^16.0.0",
10
- "form-data": "^4.0.0",
11
- "https-proxy-agent": "^7.0.6",
12
- "lodash": "^4.17.21",
13
- "mime-types": "^2.1.27",
14
- "oauth-1.0a": "^2.2.6",
15
- "p-cancelable": "^2.0.0",
16
- "qs": "^6.10.1",
17
- "request": "^2.88.2",
18
- "request-promise-native": "^1.0.9",
19
- "simple-oauth2": "^5.1.0",
20
- "tslib": "^2.3.0",
21
- "uuid": "^11.0.3",
22
- "fast-glob": "catalog:"
23
- },
24
- "devDependencies": {
25
- "@types/crypto-js": "^4.0.1",
26
- "@types/express": "^5.0.0",
27
- "@types/lodash": "^4.17.13",
28
- "@types/lodash.get": "^4.4.9",
29
- "@types/mime-types": "^2.1.0",
30
- "@types/node": "^22.10.2",
31
- "@types/qs": "^6.9.17",
32
- "@types/request": "^2.48.12",
33
- "@types/request-promise-native": "^1.0.15",
34
- "@types/simple-oauth2": "^5.0.7",
35
- "@types/uuid": "^10.0.0",
36
- "axios": "^1.7.9",
37
- "jsonc-eslint-parser": "^2.4.0",
38
- "typescript": "~5.7.2"
39
- },
40
- "type": "commonjs",
41
- "main": "dist/src/index",
42
- "types": "dist/src/index.d.ts",
43
- "private": true
44
- }
@@ -1,15 +0,0 @@
1
- import * as NodeExecuteFunctions from './lib/NodeExecuteFunctions';
2
- import * as UserSettings from './lib/UserSettings';
3
- import * as getInputConnectionDataLegacy from './lib/InputConnectionDataLegacy';
4
- export * from './lib/ActiveWorkflows';
5
- export * from './lib/ActiveWebhooks';
6
- export * from './lib/BinaryDataManager';
7
- export * from './lib/Constants';
8
- export * from './lib/Credentials';
9
- export * from './lib/Interfaces';
10
- export * from './lib/LoadNodeParameterOptions';
11
- export * from './lib/NodeExecuteFunctions';
12
- export * from './lib/WorkflowExecute';
13
- export * from './lib/ChangeCase';
14
- export * from './lib/NodesLoader';
15
- export { NodeExecuteFunctions, UserSettings, getInputConnectionDataLegacy };
package/dist/src/index.js DELETED
@@ -1,29 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getInputConnectionDataLegacy = exports.UserSettings = exports.NodeExecuteFunctions = void 0;
4
- const tslib_1 = require("tslib");
5
- /* eslint-disable import/no-cycle */
6
- const NodeExecuteFunctions = tslib_1.__importStar(require("./lib/NodeExecuteFunctions"));
7
- exports.NodeExecuteFunctions = NodeExecuteFunctions;
8
- const UserSettings = tslib_1.__importStar(require("./lib/UserSettings"));
9
- exports.UserSettings = UserSettings;
10
- const getInputConnectionDataLegacy = tslib_1.__importStar(require("./lib/InputConnectionDataLegacy"));
11
- exports.getInputConnectionDataLegacy = getInputConnectionDataLegacy;
12
- try {
13
- // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call, import/no-extraneous-dependencies, global-require, @typescript-eslint/no-var-requires
14
- require('source-map-support').install();
15
- // eslint-disable-next-line no-empty
16
- }
17
- catch (error) { }
18
- tslib_1.__exportStar(require("./lib/ActiveWorkflows"), exports);
19
- tslib_1.__exportStar(require("./lib/ActiveWebhooks"), exports);
20
- tslib_1.__exportStar(require("./lib/BinaryDataManager"), exports);
21
- tslib_1.__exportStar(require("./lib/Constants"), exports);
22
- tslib_1.__exportStar(require("./lib/Credentials"), exports);
23
- tslib_1.__exportStar(require("./lib/Interfaces"), exports);
24
- tslib_1.__exportStar(require("./lib/LoadNodeParameterOptions"), exports);
25
- tslib_1.__exportStar(require("./lib/NodeExecuteFunctions"), exports);
26
- tslib_1.__exportStar(require("./lib/WorkflowExecute"), exports);
27
- tslib_1.__exportStar(require("./lib/ChangeCase"), exports);
28
- tslib_1.__exportStar(require("./lib/NodesLoader"), exports);
29
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;AAAA,oCAAoC;AACpC,yFAAmE;AAsBlE,oDAAoB;AArBrB,yEAAmD;AAsBlD,oCAAY;AArBb,sGAAgF;AAsB/E,oEAA4B;AApB7B,IAAI,CAAC;IACJ,gMAAgM;IAChM,OAAO,CAAC,oBAAoB,CAAC,CAAC,OAAO,EAAE,CAAC;IACxC,oCAAoC;AACrC,CAAC;AAAC,OAAO,KAAK,EAAE,CAAC,CAAA,CAAC;AAElB,gEAAsC;AACtC,+DAAqC;AACrC,kEAAwC;AACxC,0DAAgC;AAChC,4DAAkC;AAClC,2DAAiC;AACjC,yEAA+C;AAC/C,qEAA2C;AAC3C,gEAAsC;AACtC,2DAAiC;AACjC,4DAAkC"}
@@ -1,59 +0,0 @@
1
- import { IWebhookData, WebhookHttpMethod, Workflow, WorkflowActivateMode, WorkflowExecuteMode } from '@fsai-flow/workflow';
2
- export declare class ActiveWebhooks {
3
- private workflowWebhooks;
4
- private webhookUrls;
5
- testWebhooks: boolean;
6
- /**
7
- * Adds a new webhook
8
- *
9
- * @param {IWebhookData} webhookData
10
- * @param {WorkflowExecuteMode} mode
11
- * @returns {Promise<void>}
12
- * @memberof ActiveWebhooks
13
- */
14
- add(workflow: Workflow, webhookData: IWebhookData, mode: WorkflowExecuteMode, activation: WorkflowActivateMode): Promise<void>;
15
- /**
16
- * Returns webhookData if a webhook with matches is currently registered
17
- *
18
- * @param {WebhookHttpMethod} httpMethod
19
- * @param {string} path
20
- * @param {(string | undefined)} webhookId
21
- * @returns {(IWebhookData | undefined)}
22
- * @memberof ActiveWebhooks
23
- */
24
- get(httpMethod: WebhookHttpMethod, path: string, webhookId?: string): IWebhookData | undefined;
25
- /**
26
- * Gets all request methods associated with a single webhook
27
- * @param path
28
- */
29
- getWebhookMethods(path: string): string[];
30
- /**
31
- * Returns the ids of all the workflows which have active webhooks
32
- *
33
- * @returns {string[]}
34
- * @memberof ActiveWebhooks
35
- */
36
- getWorkflowIds(): string[];
37
- /**
38
- * Returns key to uniquely identify a webhook
39
- *
40
- * @param {WebhookHttpMethod} httpMethod
41
- * @param {string} path
42
- * @param {(string | undefined)} webhookId
43
- * @returns {string}
44
- * @memberof ActiveWebhooks
45
- */
46
- getWebhookKey(httpMethod: WebhookHttpMethod, path: string, webhookId?: string): string;
47
- /**
48
- * Removes all webhooks of a workflow
49
- *
50
- * @param {Workflow} workflow
51
- * @returns {boolean}
52
- * @memberof ActiveWebhooks
53
- */
54
- removeWorkflow(workflow: Workflow): Promise<boolean>;
55
- /**
56
- * Removes all the webhooks of the given workflows
57
- */
58
- removeAll(workflows: Workflow[]): Promise<void>;
59
- }