@fsai-flow/workflow 0.0.3 → 0.1.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.
- package/dist/src/index.d.ts +21 -20
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +58 -23
- package/dist/src/index.js.map +1 -1
- package/dist/src/lib/Constants.d.ts +2 -1
- package/dist/src/lib/Constants.d.ts.map +1 -0
- package/dist/src/lib/Constants.js +60 -60
- package/dist/src/lib/Constants.js.map +1 -1
- package/dist/src/lib/DeferredPromise.d.ts +1 -0
- package/dist/src/lib/DeferredPromise.d.ts.map +1 -0
- package/dist/src/lib/Expression.d.ts +2 -1
- package/dist/src/lib/Expression.d.ts.map +1 -0
- package/dist/src/lib/Expression.js +47 -15
- package/dist/src/lib/Expression.js.map +1 -1
- package/dist/src/lib/Interfaces.d.ts +193 -149
- package/dist/src/lib/Interfaces.d.ts.map +1 -0
- package/dist/src/lib/Interfaces.js +12 -12
- package/dist/src/lib/Interfaces.js.map +1 -1
- package/dist/src/lib/LoggerProxy.d.ts +2 -1
- package/dist/src/lib/LoggerProxy.d.ts.map +1 -0
- package/dist/src/lib/LoggerProxy.js +6 -6
- package/dist/src/lib/MetadataUtils.d.ts +3 -2
- package/dist/src/lib/MetadataUtils.d.ts.map +1 -0
- package/dist/src/lib/MetadataUtils.js +2 -2
- package/dist/src/lib/MetadataUtils.js.map +1 -1
- package/dist/src/lib/NodeErrors.d.ts +3 -2
- package/dist/src/lib/NodeErrors.d.ts.map +1 -0
- package/dist/src/lib/NodeErrors.js +61 -66
- package/dist/src/lib/NodeErrors.js.map +1 -1
- package/dist/src/lib/NodeHelpers.d.ts +4 -3
- package/dist/src/lib/NodeHelpers.d.ts.map +1 -0
- package/dist/src/lib/NodeHelpers.js +226 -239
- package/dist/src/lib/NodeHelpers.js.map +1 -1
- package/dist/src/lib/ObservableObject.d.ts +2 -1
- package/dist/src/lib/ObservableObject.d.ts.map +1 -0
- package/dist/src/lib/ObservableObject.js +3 -3
- package/dist/src/lib/RoutingNode.d.ts +8 -2
- package/dist/src/lib/RoutingNode.d.ts.map +1 -0
- package/dist/src/lib/RoutingNode.js +87 -67
- package/dist/src/lib/RoutingNode.js.map +1 -1
- package/dist/src/lib/TelemetryHelpers.d.ts +2 -1
- package/dist/src/lib/TelemetryHelpers.d.ts.map +1 -0
- package/dist/src/lib/TelemetryHelpers.js +9 -11
- package/dist/src/lib/TelemetryHelpers.js.map +1 -1
- package/dist/src/lib/TypeValidation.d.ts +3 -2
- package/dist/src/lib/TypeValidation.d.ts.map +1 -0
- package/dist/src/lib/TypeValidation.js +85 -94
- package/dist/src/lib/TypeValidation.js.map +1 -1
- package/dist/src/lib/VersionedNodeType.d.ts +4 -3
- package/dist/src/lib/VersionedNodeType.d.ts.map +1 -0
- package/dist/src/lib/VersionedNodeType.js +1 -3
- package/dist/src/lib/VersionedNodeType.js.map +1 -1
- package/dist/src/lib/Workflow.d.ts +3 -2
- package/dist/src/lib/Workflow.d.ts.map +1 -0
- package/dist/src/lib/Workflow.js +54 -59
- package/dist/src/lib/Workflow.js.map +1 -1
- package/dist/src/lib/WorkflowDataProxy.d.ts +2 -1
- package/dist/src/lib/WorkflowDataProxy.d.ts.map +1 -0
- package/dist/src/lib/WorkflowDataProxy.js +96 -69
- package/dist/src/lib/WorkflowDataProxy.js.map +1 -1
- package/dist/src/lib/WorkflowErrors.d.ts +2 -1
- package/dist/src/lib/WorkflowErrors.d.ts.map +1 -0
- package/dist/src/lib/WorkflowHooks.d.ts +3 -2
- package/dist/src/lib/WorkflowHooks.d.ts.map +1 -0
- package/dist/src/lib/WorkflowHooks.js +0 -2
- package/dist/src/lib/WorkflowHooks.js.map +1 -1
- package/dist/src/lib/errors/base/base.error.d.ts +3 -3
- package/dist/src/lib/errors/base/base.error.d.ts.map +1 -0
- package/dist/src/lib/errors/base/base.error.js +9 -7
- package/dist/src/lib/errors/base/base.error.js.map +1 -1
- package/dist/src/lib/errors/base/operational.error.d.ts +5 -4
- package/dist/src/lib/errors/base/operational.error.d.ts.map +1 -0
- package/dist/src/lib/errors/base/operational.error.js +1 -1
- package/dist/src/lib/errors/error.types.d.ts +7 -4
- package/dist/src/lib/errors/error.types.d.ts.map +1 -0
- package/dist/src/lib/errors/index.d.ts +2 -1
- package/dist/src/lib/errors/index.d.ts.map +1 -0
- package/dist/src/lib/result.d.ts +1 -0
- package/dist/src/lib/result.d.ts.map +1 -0
- package/dist/src/lib/result.js +1 -1
- package/dist/src/lib/result.js.map +1 -1
- package/dist/src/lib/utils.d.ts +3 -2
- package/dist/src/lib/utils.d.ts.map +1 -0
- package/dist/src/lib/utils.js +6 -6
- package/dist/src/lib/utils.js.map +1 -1
- package/package.json +49 -39
- package/.eslintrc.json +0 -33
- package/eslint.config.js +0 -19
- package/jest.config.ts +0 -10
- package/project.json +0 -19
- package/src/index.ts +0 -33
- package/src/lib/Constants.ts +0 -124
- package/src/lib/DeferredPromise.ts +0 -14
- package/src/lib/Expression.ts +0 -375
- package/src/lib/Interfaces.ts +0 -2257
- package/src/lib/LoggerProxy.ts +0 -43
- package/src/lib/MetadataUtils.ts +0 -34
- package/src/lib/NodeErrors.ts +0 -332
- package/src/lib/NodeHelpers.ts +0 -1666
- package/src/lib/ObservableObject.ts +0 -77
- package/src/lib/RoutingNode.ts +0 -862
- package/src/lib/TelemetryHelpers.ts +0 -86
- package/src/lib/TypeValidation.ts +0 -431
- package/src/lib/VersionedNodeType.ts +0 -30
- package/src/lib/Workflow.ts +0 -1270
- package/src/lib/WorkflowDataProxy.ts +0 -708
- package/src/lib/WorkflowErrors.ts +0 -18
- package/src/lib/WorkflowHooks.ts +0 -51
- package/src/lib/errors/base/base.error.ts +0 -68
- package/src/lib/errors/base/operational.error.ts +0 -21
- package/src/lib/errors/error.types.ts +0 -14
- package/src/lib/errors/index.ts +0 -1
- package/src/lib/result.ts +0 -34
- package/src/lib/utils.ts +0 -145
- package/tests/Helpers.ts +0 -667
- package/tests/NodeHelpers.test.ts +0 -3053
- package/tests/ObservableObject.test.ts +0 -171
- package/tests/RoutingNode.test.ts +0 -1680
- package/tests/Workflow.test.ts +0 -1284
- package/tests/WorkflowDataProxy.test.ts +0 -199
- package/tsconfig.json +0 -27
- package/tsconfig.lib.json +0 -11
- package/tsconfig.spec.json +0 -14
|
@@ -46,7 +46,7 @@ const Interfaces_1 = require("./Interfaces");
|
|
|
46
46
|
function getConnectionTypes(connections) {
|
|
47
47
|
return connections
|
|
48
48
|
.map((connection) => {
|
|
49
|
-
if (typeof connection ===
|
|
49
|
+
if (typeof connection === "string") {
|
|
50
50
|
return connection;
|
|
51
51
|
}
|
|
52
52
|
return connection.type;
|
|
@@ -55,85 +55,85 @@ function getConnectionTypes(connections) {
|
|
|
55
55
|
}
|
|
56
56
|
exports.cronNodeOptions = [
|
|
57
57
|
{
|
|
58
|
-
name:
|
|
59
|
-
displayName:
|
|
58
|
+
name: "item",
|
|
59
|
+
displayName: "Item",
|
|
60
60
|
values: [
|
|
61
61
|
{
|
|
62
|
-
displayName:
|
|
63
|
-
name:
|
|
64
|
-
type:
|
|
62
|
+
displayName: "Mode",
|
|
63
|
+
name: "mode",
|
|
64
|
+
type: "options",
|
|
65
65
|
options: [
|
|
66
66
|
{
|
|
67
|
-
name:
|
|
68
|
-
value:
|
|
67
|
+
name: "Every Minute",
|
|
68
|
+
value: "everyMinute",
|
|
69
69
|
},
|
|
70
70
|
{
|
|
71
|
-
name:
|
|
72
|
-
value:
|
|
71
|
+
name: "Every Hour",
|
|
72
|
+
value: "everyHour",
|
|
73
73
|
},
|
|
74
74
|
{
|
|
75
|
-
name:
|
|
76
|
-
value:
|
|
75
|
+
name: "Every Day",
|
|
76
|
+
value: "everyDay",
|
|
77
77
|
},
|
|
78
78
|
{
|
|
79
|
-
name:
|
|
80
|
-
value:
|
|
79
|
+
name: "Every Week",
|
|
80
|
+
value: "everyWeek",
|
|
81
81
|
},
|
|
82
82
|
{
|
|
83
|
-
name:
|
|
84
|
-
value:
|
|
83
|
+
name: "Every Month",
|
|
84
|
+
value: "everyMonth",
|
|
85
85
|
},
|
|
86
86
|
{
|
|
87
|
-
name:
|
|
88
|
-
value:
|
|
87
|
+
name: "Every X",
|
|
88
|
+
value: "everyX",
|
|
89
89
|
},
|
|
90
90
|
{
|
|
91
|
-
name:
|
|
92
|
-
value:
|
|
91
|
+
name: "Custom",
|
|
92
|
+
value: "custom",
|
|
93
93
|
},
|
|
94
94
|
],
|
|
95
|
-
default:
|
|
96
|
-
description:
|
|
95
|
+
default: "everyDay",
|
|
96
|
+
description: "How often to trigger.",
|
|
97
97
|
},
|
|
98
98
|
{
|
|
99
|
-
displayName:
|
|
100
|
-
name:
|
|
101
|
-
type:
|
|
99
|
+
displayName: "Hour",
|
|
100
|
+
name: "hour",
|
|
101
|
+
type: "number",
|
|
102
102
|
typeOptions: {
|
|
103
103
|
minValue: 0,
|
|
104
104
|
maxValue: 23,
|
|
105
105
|
},
|
|
106
106
|
displayOptions: {
|
|
107
107
|
hide: {
|
|
108
|
-
mode: [
|
|
108
|
+
mode: ["custom", "everyHour", "everyMinute", "everyX"],
|
|
109
109
|
},
|
|
110
110
|
},
|
|
111
111
|
default: 14,
|
|
112
|
-
description:
|
|
112
|
+
description: "The hour of the day to trigger (24h format)",
|
|
113
113
|
},
|
|
114
114
|
{
|
|
115
|
-
displayName:
|
|
116
|
-
name:
|
|
117
|
-
type:
|
|
115
|
+
displayName: "Minute",
|
|
116
|
+
name: "minute",
|
|
117
|
+
type: "number",
|
|
118
118
|
typeOptions: {
|
|
119
119
|
minValue: 0,
|
|
120
120
|
maxValue: 59,
|
|
121
121
|
},
|
|
122
122
|
displayOptions: {
|
|
123
123
|
hide: {
|
|
124
|
-
mode: [
|
|
124
|
+
mode: ["custom", "everyMinute", "everyX"],
|
|
125
125
|
},
|
|
126
126
|
},
|
|
127
127
|
default: 0,
|
|
128
|
-
description:
|
|
128
|
+
description: "The minute of the day to trigger",
|
|
129
129
|
},
|
|
130
130
|
{
|
|
131
|
-
displayName:
|
|
132
|
-
name:
|
|
133
|
-
type:
|
|
131
|
+
displayName: "Day of Month",
|
|
132
|
+
name: "dayOfMonth",
|
|
133
|
+
type: "number",
|
|
134
134
|
displayOptions: {
|
|
135
135
|
show: {
|
|
136
|
-
mode: [
|
|
136
|
+
mode: ["everyMonth"],
|
|
137
137
|
},
|
|
138
138
|
},
|
|
139
139
|
typeOptions: {
|
|
@@ -141,115 +141,113 @@ exports.cronNodeOptions = [
|
|
|
141
141
|
maxValue: 31,
|
|
142
142
|
},
|
|
143
143
|
default: 1,
|
|
144
|
-
description:
|
|
144
|
+
description: "The day of the month to trigger",
|
|
145
145
|
},
|
|
146
146
|
{
|
|
147
|
-
displayName:
|
|
148
|
-
name:
|
|
149
|
-
type:
|
|
147
|
+
displayName: "Weekday",
|
|
148
|
+
name: "weekday",
|
|
149
|
+
type: "options",
|
|
150
150
|
displayOptions: {
|
|
151
151
|
show: {
|
|
152
|
-
mode: [
|
|
152
|
+
mode: ["everyWeek"],
|
|
153
153
|
},
|
|
154
154
|
},
|
|
155
155
|
options: [
|
|
156
156
|
{
|
|
157
|
-
name:
|
|
158
|
-
value:
|
|
157
|
+
name: "Monday",
|
|
158
|
+
value: "1",
|
|
159
159
|
},
|
|
160
160
|
{
|
|
161
|
-
name:
|
|
162
|
-
value:
|
|
161
|
+
name: "Tuesday",
|
|
162
|
+
value: "2",
|
|
163
163
|
},
|
|
164
164
|
{
|
|
165
|
-
name:
|
|
166
|
-
value:
|
|
165
|
+
name: "Wednesday",
|
|
166
|
+
value: "3",
|
|
167
167
|
},
|
|
168
168
|
{
|
|
169
|
-
name:
|
|
170
|
-
value:
|
|
169
|
+
name: "Thursday",
|
|
170
|
+
value: "4",
|
|
171
171
|
},
|
|
172
172
|
{
|
|
173
|
-
name:
|
|
174
|
-
value:
|
|
173
|
+
name: "Friday",
|
|
174
|
+
value: "5",
|
|
175
175
|
},
|
|
176
176
|
{
|
|
177
|
-
name:
|
|
178
|
-
value:
|
|
177
|
+
name: "Saturday",
|
|
178
|
+
value: "6",
|
|
179
179
|
},
|
|
180
180
|
{
|
|
181
|
-
name:
|
|
182
|
-
value:
|
|
181
|
+
name: "Sunday",
|
|
182
|
+
value: "0",
|
|
183
183
|
},
|
|
184
184
|
],
|
|
185
|
-
default:
|
|
186
|
-
description:
|
|
185
|
+
default: "1",
|
|
186
|
+
description: "The weekday to trigger",
|
|
187
187
|
},
|
|
188
188
|
{
|
|
189
|
-
displayName:
|
|
190
|
-
name:
|
|
191
|
-
type:
|
|
189
|
+
displayName: "Cron Expression",
|
|
190
|
+
name: "cronExpression",
|
|
191
|
+
type: "string",
|
|
192
192
|
displayOptions: {
|
|
193
193
|
show: {
|
|
194
|
-
mode: [
|
|
194
|
+
mode: ["custom"],
|
|
195
195
|
},
|
|
196
196
|
},
|
|
197
|
-
default:
|
|
198
|
-
description:
|
|
197
|
+
default: "* * * * * *",
|
|
198
|
+
description: "Use custom cron expression. Values and ranges as follows:<ul><li>Seconds: 0-59</li><li>Minutes: 0 - 59</li><li>Hours: 0 - 23</li><li>Day of Month: 1 - 31</li><li>Months: 0 - 11 (Jan - Dec)</li><li>Day of Week: 0 - 6 (Sun - Sat)</li></ul>",
|
|
199
199
|
},
|
|
200
200
|
{
|
|
201
|
-
displayName:
|
|
202
|
-
name:
|
|
203
|
-
type:
|
|
201
|
+
displayName: "Value",
|
|
202
|
+
name: "value",
|
|
203
|
+
type: "number",
|
|
204
204
|
typeOptions: {
|
|
205
205
|
minValue: 0,
|
|
206
206
|
maxValue: 1000,
|
|
207
207
|
},
|
|
208
208
|
displayOptions: {
|
|
209
209
|
show: {
|
|
210
|
-
mode: [
|
|
210
|
+
mode: ["everyX"],
|
|
211
211
|
},
|
|
212
212
|
},
|
|
213
213
|
default: 2,
|
|
214
|
-
description:
|
|
214
|
+
description: "All how many X minutes/hours it should trigger",
|
|
215
215
|
},
|
|
216
216
|
{
|
|
217
|
-
displayName:
|
|
218
|
-
name:
|
|
219
|
-
type:
|
|
217
|
+
displayName: "Unit",
|
|
218
|
+
name: "unit",
|
|
219
|
+
type: "options",
|
|
220
220
|
displayOptions: {
|
|
221
221
|
show: {
|
|
222
|
-
mode: [
|
|
222
|
+
mode: ["everyX"],
|
|
223
223
|
},
|
|
224
224
|
},
|
|
225
225
|
options: [
|
|
226
226
|
{
|
|
227
|
-
name:
|
|
228
|
-
value:
|
|
227
|
+
name: "Minutes",
|
|
228
|
+
value: "minutes",
|
|
229
229
|
},
|
|
230
230
|
{
|
|
231
|
-
name:
|
|
232
|
-
value:
|
|
231
|
+
name: "Hours",
|
|
232
|
+
value: "hours",
|
|
233
233
|
},
|
|
234
234
|
{
|
|
235
|
-
name:
|
|
236
|
-
value:
|
|
235
|
+
name: "Seconds",
|
|
236
|
+
value: "seconds",
|
|
237
237
|
},
|
|
238
238
|
],
|
|
239
|
-
default:
|
|
240
|
-
description:
|
|
239
|
+
default: "hours",
|
|
240
|
+
description: "If it should trigger all X minutes or hours",
|
|
241
241
|
},
|
|
242
242
|
],
|
|
243
243
|
},
|
|
244
244
|
];
|
|
245
245
|
function isSubNodeType(typeDescription) {
|
|
246
|
-
if (!typeDescription?.outputs || typeof typeDescription.outputs ===
|
|
246
|
+
if (!typeDescription?.outputs || typeof typeDescription.outputs === "string") {
|
|
247
247
|
return false;
|
|
248
248
|
}
|
|
249
249
|
const outputTypes = getConnectionTypes(typeDescription.outputs);
|
|
250
|
-
return outputTypes
|
|
251
|
-
? outputTypes.filter((output) => output !== Interfaces_1.NodeConnectionTypes.Main).length > 0
|
|
252
|
-
: false;
|
|
250
|
+
return outputTypes ? outputTypes.filter((output) => output !== Interfaces_1.NodeConnectionTypes.Main).length > 0 : false;
|
|
253
251
|
}
|
|
254
252
|
/**
|
|
255
253
|
* Gets special parameters which should be added to nodeTypes depending
|
|
@@ -263,97 +261,97 @@ function getSpecialNodeParameters(nodeType) {
|
|
|
263
261
|
if (nodeType.description.polling === true) {
|
|
264
262
|
return [
|
|
265
263
|
{
|
|
266
|
-
displayName:
|
|
267
|
-
name:
|
|
268
|
-
type:
|
|
264
|
+
displayName: "Poll Times",
|
|
265
|
+
name: "pollTimes",
|
|
266
|
+
type: "fixedCollection",
|
|
269
267
|
typeOptions: {
|
|
270
268
|
multipleValues: true,
|
|
271
|
-
multipleValueButtonText:
|
|
269
|
+
multipleValueButtonText: "Add Poll Time",
|
|
272
270
|
},
|
|
273
|
-
default: { item: [{ mode:
|
|
274
|
-
description:
|
|
275
|
-
placeholder:
|
|
271
|
+
default: { item: [{ mode: "everyMinute" }] },
|
|
272
|
+
description: "Time at which polling should occur",
|
|
273
|
+
placeholder: "Add Poll Time",
|
|
276
274
|
options: [
|
|
277
275
|
{
|
|
278
|
-
name:
|
|
279
|
-
displayName:
|
|
276
|
+
name: "item",
|
|
277
|
+
displayName: "Item",
|
|
280
278
|
values: [
|
|
281
279
|
{
|
|
282
|
-
displayName:
|
|
283
|
-
name:
|
|
284
|
-
type:
|
|
280
|
+
displayName: "Mode",
|
|
281
|
+
name: "mode",
|
|
282
|
+
type: "options",
|
|
285
283
|
options: [
|
|
286
284
|
{
|
|
287
|
-
name:
|
|
288
|
-
value:
|
|
285
|
+
name: "Every Minute",
|
|
286
|
+
value: "everyMinute",
|
|
289
287
|
},
|
|
290
288
|
{
|
|
291
|
-
name:
|
|
292
|
-
value:
|
|
289
|
+
name: "Every Hour",
|
|
290
|
+
value: "everyHour",
|
|
293
291
|
},
|
|
294
292
|
{
|
|
295
|
-
name:
|
|
296
|
-
value:
|
|
293
|
+
name: "Every Day",
|
|
294
|
+
value: "everyDay",
|
|
297
295
|
},
|
|
298
296
|
{
|
|
299
|
-
name:
|
|
300
|
-
value:
|
|
297
|
+
name: "Every Week",
|
|
298
|
+
value: "everyWeek",
|
|
301
299
|
},
|
|
302
300
|
{
|
|
303
|
-
name:
|
|
304
|
-
value:
|
|
301
|
+
name: "Every Month",
|
|
302
|
+
value: "everyMonth",
|
|
305
303
|
},
|
|
306
304
|
{
|
|
307
|
-
name:
|
|
308
|
-
value:
|
|
305
|
+
name: "Every X",
|
|
306
|
+
value: "everyX",
|
|
309
307
|
},
|
|
310
308
|
{
|
|
311
|
-
name:
|
|
312
|
-
value:
|
|
309
|
+
name: "Custom",
|
|
310
|
+
value: "custom",
|
|
313
311
|
},
|
|
314
312
|
],
|
|
315
|
-
default:
|
|
316
|
-
description:
|
|
313
|
+
default: "everyDay",
|
|
314
|
+
description: "How often to trigger.",
|
|
317
315
|
},
|
|
318
316
|
{
|
|
319
|
-
displayName:
|
|
320
|
-
name:
|
|
321
|
-
type:
|
|
317
|
+
displayName: "Hour",
|
|
318
|
+
name: "hour",
|
|
319
|
+
type: "number",
|
|
322
320
|
typeOptions: {
|
|
323
321
|
minValue: 0,
|
|
324
322
|
maxValue: 23,
|
|
325
323
|
},
|
|
326
324
|
displayOptions: {
|
|
327
325
|
hide: {
|
|
328
|
-
mode: [
|
|
326
|
+
mode: ["custom", "everyHour", "everyMinute", "everyX"],
|
|
329
327
|
},
|
|
330
328
|
},
|
|
331
329
|
default: 14,
|
|
332
|
-
description:
|
|
330
|
+
description: "The hour of the day to trigger (24h format)",
|
|
333
331
|
},
|
|
334
332
|
{
|
|
335
|
-
displayName:
|
|
336
|
-
name:
|
|
337
|
-
type:
|
|
333
|
+
displayName: "Minute",
|
|
334
|
+
name: "minute",
|
|
335
|
+
type: "number",
|
|
338
336
|
typeOptions: {
|
|
339
337
|
minValue: 0,
|
|
340
338
|
maxValue: 59,
|
|
341
339
|
},
|
|
342
340
|
displayOptions: {
|
|
343
341
|
hide: {
|
|
344
|
-
mode: [
|
|
342
|
+
mode: ["custom", "everyMinute", "everyX"],
|
|
345
343
|
},
|
|
346
344
|
},
|
|
347
345
|
default: 0,
|
|
348
|
-
description:
|
|
346
|
+
description: "The minute of the day to trigger",
|
|
349
347
|
},
|
|
350
348
|
{
|
|
351
|
-
displayName:
|
|
352
|
-
name:
|
|
353
|
-
type:
|
|
349
|
+
displayName: "Day of Month",
|
|
350
|
+
name: "dayOfMonth",
|
|
351
|
+
type: "number",
|
|
354
352
|
displayOptions: {
|
|
355
353
|
show: {
|
|
356
|
-
mode: [
|
|
354
|
+
mode: ["everyMonth"],
|
|
357
355
|
},
|
|
358
356
|
},
|
|
359
357
|
typeOptions: {
|
|
@@ -361,103 +359,103 @@ function getSpecialNodeParameters(nodeType) {
|
|
|
361
359
|
maxValue: 31,
|
|
362
360
|
},
|
|
363
361
|
default: 1,
|
|
364
|
-
description:
|
|
362
|
+
description: "The day of the month to trigger",
|
|
365
363
|
},
|
|
366
364
|
{
|
|
367
|
-
displayName:
|
|
368
|
-
name:
|
|
369
|
-
type:
|
|
365
|
+
displayName: "Weekday",
|
|
366
|
+
name: "weekday",
|
|
367
|
+
type: "options",
|
|
370
368
|
displayOptions: {
|
|
371
369
|
show: {
|
|
372
|
-
mode: [
|
|
370
|
+
mode: ["everyWeek"],
|
|
373
371
|
},
|
|
374
372
|
},
|
|
375
373
|
options: [
|
|
376
374
|
{
|
|
377
|
-
name:
|
|
378
|
-
value:
|
|
375
|
+
name: "Monday",
|
|
376
|
+
value: "1",
|
|
379
377
|
},
|
|
380
378
|
{
|
|
381
|
-
name:
|
|
382
|
-
value:
|
|
379
|
+
name: "Tuesday",
|
|
380
|
+
value: "2",
|
|
383
381
|
},
|
|
384
382
|
{
|
|
385
|
-
name:
|
|
386
|
-
value:
|
|
383
|
+
name: "Wednesday",
|
|
384
|
+
value: "3",
|
|
387
385
|
},
|
|
388
386
|
{
|
|
389
|
-
name:
|
|
390
|
-
value:
|
|
387
|
+
name: "Thursday",
|
|
388
|
+
value: "4",
|
|
391
389
|
},
|
|
392
390
|
{
|
|
393
|
-
name:
|
|
394
|
-
value:
|
|
391
|
+
name: "Friday",
|
|
392
|
+
value: "5",
|
|
395
393
|
},
|
|
396
394
|
{
|
|
397
|
-
name:
|
|
398
|
-
value:
|
|
395
|
+
name: "Saturday",
|
|
396
|
+
value: "6",
|
|
399
397
|
},
|
|
400
398
|
{
|
|
401
|
-
name:
|
|
402
|
-
value:
|
|
399
|
+
name: "Sunday",
|
|
400
|
+
value: "0",
|
|
403
401
|
},
|
|
404
402
|
],
|
|
405
|
-
default:
|
|
406
|
-
description:
|
|
403
|
+
default: "1",
|
|
404
|
+
description: "The weekday to trigger",
|
|
407
405
|
},
|
|
408
406
|
{
|
|
409
|
-
displayName:
|
|
410
|
-
name:
|
|
411
|
-
type:
|
|
407
|
+
displayName: "Cron Expression",
|
|
408
|
+
name: "cronExpression",
|
|
409
|
+
type: "string",
|
|
412
410
|
displayOptions: {
|
|
413
411
|
show: {
|
|
414
|
-
mode: [
|
|
412
|
+
mode: ["custom"],
|
|
415
413
|
},
|
|
416
414
|
},
|
|
417
|
-
default:
|
|
418
|
-
description:
|
|
415
|
+
default: "* * * * * *",
|
|
416
|
+
description: "Use custom cron expression. Values and ranges as follows:<ul><li>Seconds: 0-59</li><li>Minutes: 0 - 59</li><li>Hours: 0 - 23</li><li>Day of Month: 1 - 31</li><li>Months: 0 - 11 (Jan - Dec)</li><li>Day of Week: 0 - 6 (Sun - Sat)</li></ul>",
|
|
419
417
|
},
|
|
420
418
|
{
|
|
421
|
-
displayName:
|
|
422
|
-
name:
|
|
423
|
-
type:
|
|
419
|
+
displayName: "Value",
|
|
420
|
+
name: "value",
|
|
421
|
+
type: "number",
|
|
424
422
|
typeOptions: {
|
|
425
423
|
minValue: 0,
|
|
426
424
|
maxValue: 1000,
|
|
427
425
|
},
|
|
428
426
|
displayOptions: {
|
|
429
427
|
show: {
|
|
430
|
-
mode: [
|
|
428
|
+
mode: ["everyX"],
|
|
431
429
|
},
|
|
432
430
|
},
|
|
433
431
|
default: 2,
|
|
434
|
-
description:
|
|
432
|
+
description: "All how many X minutes/hours it should trigger",
|
|
435
433
|
},
|
|
436
434
|
{
|
|
437
|
-
displayName:
|
|
438
|
-
name:
|
|
439
|
-
type:
|
|
435
|
+
displayName: "Unit",
|
|
436
|
+
name: "unit",
|
|
437
|
+
type: "options",
|
|
440
438
|
displayOptions: {
|
|
441
439
|
show: {
|
|
442
|
-
mode: [
|
|
440
|
+
mode: ["everyX"],
|
|
443
441
|
},
|
|
444
442
|
},
|
|
445
443
|
options: [
|
|
446
444
|
{
|
|
447
|
-
name:
|
|
448
|
-
value:
|
|
445
|
+
name: "Minutes",
|
|
446
|
+
value: "minutes",
|
|
449
447
|
},
|
|
450
448
|
{
|
|
451
|
-
name:
|
|
452
|
-
value:
|
|
449
|
+
name: "Hours",
|
|
450
|
+
value: "hours",
|
|
453
451
|
},
|
|
454
452
|
{
|
|
455
|
-
name:
|
|
456
|
-
value:
|
|
453
|
+
name: "Seconds",
|
|
454
|
+
value: "seconds",
|
|
457
455
|
},
|
|
458
456
|
],
|
|
459
|
-
default:
|
|
460
|
-
description:
|
|
457
|
+
default: "hours",
|
|
458
|
+
description: "If it should trigger all X minutes or hours",
|
|
461
459
|
},
|
|
462
460
|
],
|
|
463
461
|
},
|
|
@@ -483,12 +481,11 @@ function displayParameter(nodeValues, parameter, nodeValuesRoot) {
|
|
|
483
481
|
}
|
|
484
482
|
nodeValuesRoot = nodeValuesRoot || nodeValues;
|
|
485
483
|
let value;
|
|
486
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
487
484
|
const values = [];
|
|
488
485
|
if (parameter.displayOptions.show) {
|
|
489
486
|
// All the defined rules have to match to display parameter
|
|
490
487
|
for (const propertyName of Object.keys(parameter.displayOptions.show)) {
|
|
491
|
-
if (propertyName.charAt(0) ===
|
|
488
|
+
if (propertyName.charAt(0) === "/") {
|
|
492
489
|
// Get the value from the root of the node
|
|
493
490
|
value = (0, lodash_1.get)(nodeValuesRoot, propertyName.slice(1));
|
|
494
491
|
}
|
|
@@ -503,11 +500,10 @@ function displayParameter(nodeValues, parameter, nodeValuesRoot) {
|
|
|
503
500
|
else {
|
|
504
501
|
values.push.apply(values, value);
|
|
505
502
|
}
|
|
506
|
-
if (values.some((v) => typeof v ===
|
|
503
|
+
if (values.some((v) => typeof v === "string" && v.charAt(0) === "=")) {
|
|
507
504
|
return true;
|
|
508
505
|
}
|
|
509
|
-
if (values.length === 0 ||
|
|
510
|
-
!parameter.displayOptions.show[propertyName].some((v) => values.includes(v))) {
|
|
506
|
+
if (values.length === 0 || !parameter.displayOptions.show[propertyName].some((v) => values.includes(v))) {
|
|
511
507
|
return false;
|
|
512
508
|
}
|
|
513
509
|
}
|
|
@@ -515,7 +511,7 @@ function displayParameter(nodeValues, parameter, nodeValuesRoot) {
|
|
|
515
511
|
if (parameter.displayOptions.hide) {
|
|
516
512
|
// Any of the defined hide rules have to match to hide the parameter
|
|
517
513
|
for (const propertyName of Object.keys(parameter.displayOptions.hide)) {
|
|
518
|
-
if (propertyName.charAt(0) ===
|
|
514
|
+
if (propertyName.charAt(0) === "/") {
|
|
519
515
|
// Get the value from the root of the node
|
|
520
516
|
value = (0, lodash_1.get)(nodeValuesRoot, propertyName.slice(1));
|
|
521
517
|
}
|
|
@@ -530,8 +526,7 @@ function displayParameter(nodeValues, parameter, nodeValuesRoot) {
|
|
|
530
526
|
else {
|
|
531
527
|
values.push.apply(values, value);
|
|
532
528
|
}
|
|
533
|
-
if (values.length !== 0 &&
|
|
534
|
-
parameter.displayOptions.hide[propertyName].some((v) => values.includes(v))) {
|
|
529
|
+
if (values.length !== 0 && parameter.displayOptions.hide[propertyName].some((v) => values.includes(v))) {
|
|
535
530
|
return false;
|
|
536
531
|
}
|
|
537
532
|
}
|
|
@@ -551,13 +546,13 @@ function displayParameter(nodeValues, parameter, nodeValuesRoot) {
|
|
|
551
546
|
*/
|
|
552
547
|
function displayParameterPath(nodeValues, parameter, path) {
|
|
553
548
|
let resolvedNodeValues = nodeValues;
|
|
554
|
-
if (path !==
|
|
549
|
+
if (path !== "") {
|
|
555
550
|
resolvedNodeValues = (0, lodash_1.get)(nodeValues, path);
|
|
556
551
|
}
|
|
557
552
|
// Get the root parameter data
|
|
558
553
|
let nodeValuesRoot = nodeValues;
|
|
559
|
-
if (path && path.split(
|
|
560
|
-
nodeValuesRoot = (0, lodash_1.get)(nodeValues,
|
|
554
|
+
if (path && path.split(".").indexOf("parameters") === 0) {
|
|
555
|
+
nodeValuesRoot = (0, lodash_1.get)(nodeValues, "parameters");
|
|
561
556
|
}
|
|
562
557
|
return displayParameter(resolvedNodeValues, parameter, nodeValuesRoot);
|
|
563
558
|
}
|
|
@@ -576,10 +571,10 @@ function getContext(runExecutionData, type, node) {
|
|
|
576
571
|
throw new Error('The "executionData" is not initialized!');
|
|
577
572
|
}
|
|
578
573
|
let key;
|
|
579
|
-
if (type ===
|
|
580
|
-
key =
|
|
574
|
+
if (type === "flow") {
|
|
575
|
+
key = "flow";
|
|
581
576
|
}
|
|
582
|
-
else if (type ===
|
|
577
|
+
else if (type === "node") {
|
|
583
578
|
if (node === undefined) {
|
|
584
579
|
throw new Error(`The request data of context type "node" the node parameter has to be set!`);
|
|
585
580
|
}
|
|
@@ -614,7 +609,7 @@ function getParamterDependencies(nodePropertiesArray) {
|
|
|
614
609
|
continue;
|
|
615
610
|
}
|
|
616
611
|
for (displayRule of Object.keys(nodeProperties.displayOptions)) {
|
|
617
|
-
// @ts-
|
|
612
|
+
// @ts-expect-error
|
|
618
613
|
for (parameterName of Object.keys(nodeProperties.displayOptions[displayRule])) {
|
|
619
614
|
if (!dependencies[nodeProperties.name].includes(parameterName)) {
|
|
620
615
|
dependencies[nodeProperties.name].push(parameterName);
|
|
@@ -635,7 +630,7 @@ function getParamterDependencies(nodePropertiesArray) {
|
|
|
635
630
|
*/
|
|
636
631
|
function getParamterResolveOrder(nodePropertiesArray, parameterDependencies) {
|
|
637
632
|
const executionOrder = [];
|
|
638
|
-
const indexToResolve = Array.from({ length: nodePropertiesArray.length }, (
|
|
633
|
+
const indexToResolve = Array.from({ length: nodePropertiesArray.length }, (_v, k) => k);
|
|
639
634
|
const resolvedParamters = [];
|
|
640
635
|
let index;
|
|
641
636
|
let property;
|
|
@@ -655,14 +650,13 @@ function getParamterResolveOrder(nodePropertiesArray, parameterDependencies) {
|
|
|
655
650
|
// Parameter has dependencies
|
|
656
651
|
for (const dependency of parameterDependencies[property.name]) {
|
|
657
652
|
if (!resolvedParamters.includes(dependency)) {
|
|
658
|
-
if (dependency.charAt(0) ===
|
|
653
|
+
if (dependency.charAt(0) === "/") {
|
|
659
654
|
// Assume that root level depenencies are resolved
|
|
660
655
|
continue;
|
|
661
656
|
}
|
|
662
657
|
// Dependencies for that paramter are still missing so
|
|
663
658
|
// try to add again later
|
|
664
659
|
indexToResolve.push(index);
|
|
665
|
-
continue;
|
|
666
660
|
}
|
|
667
661
|
}
|
|
668
662
|
// All dependencies got found so add
|
|
@@ -672,7 +666,7 @@ function getParamterResolveOrder(nodePropertiesArray, parameterDependencies) {
|
|
|
672
666
|
lastIndexReduction = iterations;
|
|
673
667
|
}
|
|
674
668
|
if (iterations > lastIndexReduction + nodePropertiesArray.length) {
|
|
675
|
-
throw new Error(
|
|
669
|
+
throw new Error("Could not resolve parameter depenencies. Max iterations reached! Hint: If `displayOptions` are specified in any child parameter of a parent `collection` or `fixedCollection`, remove the `displayOptions` from the child parameter.");
|
|
676
670
|
}
|
|
677
671
|
lastIndexLength = indexToResolve.length;
|
|
678
672
|
}
|
|
@@ -721,18 +715,16 @@ function getNodeParameters(nodePropertiesArray, nodeValues, returnDefaults, retu
|
|
|
721
715
|
const parameterItterationOrderIndex = getParamterResolveOrder(nodePropertiesArray, parameterDependencies);
|
|
722
716
|
for (const parameterIndex of parameterItterationOrderIndex) {
|
|
723
717
|
const nodeProperties = nodePropertiesArray[parameterIndex];
|
|
724
|
-
if (nodeValues[nodeProperties.name] === undefined &&
|
|
725
|
-
(!returnDefaults || parentType === 'collection')) {
|
|
718
|
+
if (nodeValues[nodeProperties.name] === undefined && (!returnDefaults || parentType === "collection")) {
|
|
726
719
|
// The value is not defined so go to the next
|
|
727
720
|
continue;
|
|
728
721
|
}
|
|
729
|
-
if (!returnNoneDisplayed &&
|
|
730
|
-
!displayParameter(nodeValuesDisplayCheck, nodeProperties, nodeValuesRoot)) {
|
|
722
|
+
if (!returnNoneDisplayed && !displayParameter(nodeValuesDisplayCheck, nodeProperties, nodeValuesRoot)) {
|
|
731
723
|
if (!returnNoneDisplayed || !returnDefaults) {
|
|
732
724
|
continue;
|
|
733
725
|
}
|
|
734
726
|
}
|
|
735
|
-
if (![
|
|
727
|
+
if (!["collection", "fixedCollection"].includes(nodeProperties.type)) {
|
|
736
728
|
// Is a simple property so can be set as it is
|
|
737
729
|
if (duplicateParameterNames.includes(nodeProperties.name)) {
|
|
738
730
|
if (!displayParameter(nodeValuesDisplayCheck, nodeProperties, nodeValuesRoot)) {
|
|
@@ -741,25 +733,22 @@ function getNodeParameters(nodePropertiesArray, nodeValues, returnDefaults, retu
|
|
|
741
733
|
}
|
|
742
734
|
if (returnDefaults) {
|
|
743
735
|
// Set also when it has the default value
|
|
744
|
-
if ([
|
|
736
|
+
if (["boolean", "number", "options"].includes(nodeProperties.type)) {
|
|
745
737
|
// Boolean, numbers and options are special as false and 0 are valid values
|
|
746
738
|
// and should not be replaced with default value
|
|
747
739
|
nodeParameters[nodeProperties.name] =
|
|
748
|
-
nodeValues[nodeProperties.name] !== undefined
|
|
749
|
-
? nodeValues[nodeProperties.name]
|
|
750
|
-
: nodeProperties.default;
|
|
740
|
+
nodeValues[nodeProperties.name] !== undefined ? nodeValues[nodeProperties.name] : nodeProperties.default;
|
|
751
741
|
}
|
|
752
742
|
else {
|
|
753
|
-
nodeParameters[nodeProperties.name] =
|
|
754
|
-
nodeValues[nodeProperties.name] || nodeProperties.default;
|
|
743
|
+
nodeParameters[nodeProperties.name] = nodeValues[nodeProperties.name] || nodeProperties.default;
|
|
755
744
|
}
|
|
756
745
|
nodeParametersFull[nodeProperties.name] = nodeParameters[nodeProperties.name];
|
|
757
746
|
}
|
|
758
747
|
else if ((nodeValues[nodeProperties.name] !== nodeProperties.default &&
|
|
759
|
-
typeof nodeValues[nodeProperties.name] !==
|
|
760
|
-
(typeof nodeValues[nodeProperties.name] ===
|
|
748
|
+
typeof nodeValues[nodeProperties.name] !== "object") ||
|
|
749
|
+
(typeof nodeValues[nodeProperties.name] === "object" &&
|
|
761
750
|
!(0, lodash_1.isEqual)(nodeValues[nodeProperties.name], nodeProperties.default)) ||
|
|
762
|
-
(nodeValues[nodeProperties.name] !== undefined && parentType ===
|
|
751
|
+
(nodeValues[nodeProperties.name] !== undefined && parentType === "collection")) {
|
|
763
752
|
// Set only if it is different to the default value
|
|
764
753
|
nodeParameters[nodeProperties.name] = nodeValues[nodeProperties.name];
|
|
765
754
|
nodeParametersFull[nodeProperties.name] = nodeParameters[nodeProperties.name];
|
|
@@ -772,10 +761,9 @@ function getNodeParameters(nodePropertiesArray, nodeValues, returnDefaults, retu
|
|
|
772
761
|
}
|
|
773
762
|
// Is a complex property so check lower levels
|
|
774
763
|
let tempValue;
|
|
775
|
-
if (nodeProperties.type ===
|
|
764
|
+
if (nodeProperties.type === "collection") {
|
|
776
765
|
// Is collection
|
|
777
|
-
if (nodeProperties.typeOptions !== undefined &&
|
|
778
|
-
nodeProperties.typeOptions.multipleValues === true) {
|
|
766
|
+
if (nodeProperties.typeOptions !== undefined && nodeProperties.typeOptions.multipleValues === true) {
|
|
779
767
|
// Multiple can be set so will be an array
|
|
780
768
|
// Return directly the values like they are
|
|
781
769
|
if (nodeValues[nodeProperties.name] !== undefined) {
|
|
@@ -808,7 +796,7 @@ function getNodeParameters(nodePropertiesArray, nodeValues, returnDefaults, retu
|
|
|
808
796
|
nodeParametersFull[nodeProperties.name] = nodeParameters[nodeProperties.name];
|
|
809
797
|
}
|
|
810
798
|
}
|
|
811
|
-
else if (nodeProperties.type ===
|
|
799
|
+
else if (nodeProperties.type === "fixedCollection") {
|
|
812
800
|
// Is fixedCollection
|
|
813
801
|
const collectionValues = {};
|
|
814
802
|
let tempNodeParameters;
|
|
@@ -822,8 +810,7 @@ function getNodeParameters(nodePropertiesArray, nodeValues, returnDefaults, retu
|
|
|
822
810
|
}
|
|
823
811
|
// Iterate over all collections
|
|
824
812
|
for (const itemName of Object.keys(propertyValues || {})) {
|
|
825
|
-
if (nodeProperties.typeOptions !== undefined &&
|
|
826
|
-
nodeProperties.typeOptions.multipleValues === true) {
|
|
813
|
+
if (nodeProperties.typeOptions !== undefined && nodeProperties.typeOptions.multipleValues === true) {
|
|
827
814
|
// Multiple can be set so will be an array
|
|
828
815
|
const tempArrayValue = [];
|
|
829
816
|
// Iterate over all items as it contains multiple ones
|
|
@@ -917,8 +904,8 @@ function getNodeWebhooks(workflow, node, additionalData, ignoreRestartWehbooks =
|
|
|
917
904
|
// Node does not have any webhooks so return
|
|
918
905
|
return [];
|
|
919
906
|
}
|
|
920
|
-
const workflowId = workflow.id ||
|
|
921
|
-
const mode =
|
|
907
|
+
const workflowId = workflow.id || "__UNSAVED__";
|
|
908
|
+
const mode = "internal";
|
|
922
909
|
const returnData = [];
|
|
923
910
|
for (const webhookDescription of nodeType.description.webhooks) {
|
|
924
911
|
if (ignoreRestartWehbooks && webhookDescription.restartWebhook === true) {
|
|
@@ -931,23 +918,23 @@ function getNodeWebhooks(workflow, node, additionalData, ignoreRestartWehbooks =
|
|
|
931
918
|
continue;
|
|
932
919
|
}
|
|
933
920
|
nodeWebhookPath = nodeWebhookPath.toString();
|
|
934
|
-
if (nodeWebhookPath.startsWith(
|
|
921
|
+
if (nodeWebhookPath.startsWith("/")) {
|
|
935
922
|
nodeWebhookPath = nodeWebhookPath.slice(1);
|
|
936
923
|
}
|
|
937
|
-
if (nodeWebhookPath.endsWith(
|
|
924
|
+
if (nodeWebhookPath.endsWith("/")) {
|
|
938
925
|
nodeWebhookPath = nodeWebhookPath.slice(0, -1);
|
|
939
926
|
}
|
|
940
|
-
const isFullPath = workflow.expression.getSimpleParameterValue(node, webhookDescription.isFullPath,
|
|
941
|
-
const restartWebhook = workflow.expression.getSimpleParameterValue(node, webhookDescription.restartWebhook,
|
|
927
|
+
const isFullPath = workflow.expression.getSimpleParameterValue(node, webhookDescription.isFullPath, "internal", {}, false);
|
|
928
|
+
const restartWebhook = workflow.expression.getSimpleParameterValue(node, webhookDescription.restartWebhook, "internal", {}, false);
|
|
942
929
|
const path = getNodeWebhookPath(workflowId, node, nodeWebhookPath, isFullPath, restartWebhook);
|
|
943
|
-
const httpMethod = workflow.expression.getSimpleParameterValue(node, webhookDescription.httpMethod, mode, {},
|
|
930
|
+
const httpMethod = workflow.expression.getSimpleParameterValue(node, webhookDescription.httpMethod, mode, {}, "GET");
|
|
944
931
|
if (httpMethod === undefined) {
|
|
945
932
|
// TODO: Use a proper logger
|
|
946
933
|
console.error(`The webhook "${path}" for node "${node.name}" in workflow "${workflowId}" could not be added because the httpMethod is not defined.`);
|
|
947
934
|
continue;
|
|
948
935
|
}
|
|
949
936
|
let webhookId;
|
|
950
|
-
if ((path.startsWith(
|
|
937
|
+
if ((path.startsWith(":") || path.includes("/:")) && node.webhookId) {
|
|
951
938
|
webhookId = node.webhookId;
|
|
952
939
|
}
|
|
953
940
|
returnData.push({
|
|
@@ -972,8 +959,8 @@ function getNodeWebhooksBasic(workflow, node) {
|
|
|
972
959
|
// Node does not have any webhooks so return
|
|
973
960
|
return [];
|
|
974
961
|
}
|
|
975
|
-
const workflowId = workflow.id ||
|
|
976
|
-
const mode =
|
|
962
|
+
const workflowId = workflow.id || "__UNSAVED__";
|
|
963
|
+
const mode = "internal";
|
|
977
964
|
const returnData = [];
|
|
978
965
|
for (const webhookDescription of nodeType.description.webhooks) {
|
|
979
966
|
let nodeWebhookPath = workflow.expression.getSimpleParameterValue(node, webhookDescription.path, mode, {});
|
|
@@ -983,10 +970,10 @@ function getNodeWebhooksBasic(workflow, node) {
|
|
|
983
970
|
continue;
|
|
984
971
|
}
|
|
985
972
|
nodeWebhookPath = nodeWebhookPath.toString();
|
|
986
|
-
if (nodeWebhookPath.startsWith(
|
|
973
|
+
if (nodeWebhookPath.startsWith("/")) {
|
|
987
974
|
nodeWebhookPath = nodeWebhookPath.slice(1);
|
|
988
975
|
}
|
|
989
|
-
if (nodeWebhookPath.endsWith(
|
|
976
|
+
if (nodeWebhookPath.endsWith("/")) {
|
|
990
977
|
nodeWebhookPath = nodeWebhookPath.slice(0, -1);
|
|
991
978
|
}
|
|
992
979
|
const isFullPath = workflow.expression.getSimpleParameterValue(node, webhookDescription.isFullPath, mode, {}, false);
|
|
@@ -997,7 +984,7 @@ function getNodeWebhooksBasic(workflow, node) {
|
|
|
997
984
|
console.error(`The webhook "${path}" for node "${node.name}" in workflow "${workflowId}" could not be added because the httpMethod is not defined.`);
|
|
998
985
|
continue;
|
|
999
986
|
}
|
|
1000
|
-
// @ts-
|
|
987
|
+
// @ts-expect-error
|
|
1001
988
|
returnData.push({
|
|
1002
989
|
httpMethod: httpMethod.toString(),
|
|
1003
990
|
node: node.name,
|
|
@@ -1018,7 +1005,7 @@ function getNodeWebhooksBasic(workflow, node) {
|
|
|
1018
1005
|
* @returns {string}
|
|
1019
1006
|
*/
|
|
1020
1007
|
function getNodeWebhookPath(workflowId, node, path, isFullPath, restartWebhook) {
|
|
1021
|
-
let webhookPath =
|
|
1008
|
+
let webhookPath = "";
|
|
1022
1009
|
if (restartWebhook === true) {
|
|
1023
1010
|
return path;
|
|
1024
1011
|
}
|
|
@@ -1045,11 +1032,11 @@ function getNodeWebhookPath(workflowId, node, path, isFullPath, restartWebhook)
|
|
|
1045
1032
|
* @returns {string}
|
|
1046
1033
|
*/
|
|
1047
1034
|
function getNodeWebhookUrl(baseUrl, workflowId, node, path, isFullPath) {
|
|
1048
|
-
if ((path.startsWith(
|
|
1035
|
+
if ((path.startsWith(":") || path.includes("/:")) && node.webhookId) {
|
|
1049
1036
|
// setting this to false to prefix the webhookId
|
|
1050
1037
|
isFullPath = false;
|
|
1051
1038
|
}
|
|
1052
|
-
if (path.startsWith(
|
|
1039
|
+
if (path.startsWith("/")) {
|
|
1053
1040
|
path = path.slice(1);
|
|
1054
1041
|
}
|
|
1055
1042
|
return `${baseUrl}/${getNodeWebhookPath(workflowId, node, path, isFullPath)}`;
|
|
@@ -1070,7 +1057,7 @@ function getNodeParametersIssues(nodePropertiesArray, node) {
|
|
|
1070
1057
|
return null;
|
|
1071
1058
|
}
|
|
1072
1059
|
for (const nodeProperty of nodePropertiesArray) {
|
|
1073
|
-
propertyIssues = getParameterIssues(nodeProperty, node.parameters,
|
|
1060
|
+
propertyIssues = getParameterIssues(nodeProperty, node.parameters, "");
|
|
1074
1061
|
mergeIssues(foundIssues, propertyIssues);
|
|
1075
1062
|
}
|
|
1076
1063
|
if (Object.keys(foundIssues).length === 0) {
|
|
@@ -1089,9 +1076,9 @@ function getNodeParametersIssues(nodePropertiesArray, node) {
|
|
|
1089
1076
|
function nodeIssuesToString(issues, node) {
|
|
1090
1077
|
const nodeIssues = [];
|
|
1091
1078
|
if (issues.execution !== undefined) {
|
|
1092
|
-
nodeIssues.push(
|
|
1079
|
+
nodeIssues.push("Execution Error.");
|
|
1093
1080
|
}
|
|
1094
|
-
const objectProperties = [
|
|
1081
|
+
const objectProperties = ["parameters", "credentials"];
|
|
1095
1082
|
let issueText;
|
|
1096
1083
|
let parameterName;
|
|
1097
1084
|
for (const propertyName of objectProperties) {
|
|
@@ -1108,7 +1095,7 @@ function nodeIssuesToString(issues, node) {
|
|
|
1108
1095
|
nodeIssues.push(`Node Type "${node.type}" is not known.`);
|
|
1109
1096
|
}
|
|
1110
1097
|
else {
|
|
1111
|
-
nodeIssues.push(
|
|
1098
|
+
nodeIssues.push("Node Type is not known.");
|
|
1112
1099
|
}
|
|
1113
1100
|
}
|
|
1114
1101
|
return nodeIssues;
|
|
@@ -1123,9 +1110,9 @@ function nodeIssuesToString(issues, node) {
|
|
|
1123
1110
|
*/
|
|
1124
1111
|
function addToIssuesIfMissing(foundIssues, nodeProperties, value) {
|
|
1125
1112
|
// TODO: Check what it really has when undefined
|
|
1126
|
-
if ((nodeProperties.type ===
|
|
1127
|
-
(nodeProperties.type ===
|
|
1128
|
-
(nodeProperties.type ===
|
|
1113
|
+
if ((nodeProperties.type === "string" && (value === "" || value === undefined)) ||
|
|
1114
|
+
(nodeProperties.type === "multiOptions" && Array.isArray(value) && value.length === 0) ||
|
|
1115
|
+
(nodeProperties.type === "dateTime" && value === undefined)) {
|
|
1129
1116
|
// Parameter is requried but empty
|
|
1130
1117
|
if (foundIssues.parameters === undefined) {
|
|
1131
1118
|
foundIssues.parameters = {};
|
|
@@ -1191,10 +1178,10 @@ function getParameterIssues(nodeProperties, nodeValues, path) {
|
|
|
1191
1178
|
// That means that the required flag works only for the current level only. If
|
|
1192
1179
|
// it is set on a lower level it means that the property is only required in case
|
|
1193
1180
|
// the parent property got set.
|
|
1194
|
-
let basePath = path ? `${path}.` :
|
|
1181
|
+
let basePath = path ? `${path}.` : "";
|
|
1195
1182
|
const checkChildNodeProperties = [];
|
|
1196
1183
|
// Collect all the properties to check
|
|
1197
|
-
if (nodeProperties.type ===
|
|
1184
|
+
if (nodeProperties.type === "collection") {
|
|
1198
1185
|
for (const option of nodeProperties.options) {
|
|
1199
1186
|
checkChildNodeProperties.push({
|
|
1200
1187
|
basePath,
|
|
@@ -1202,7 +1189,7 @@ function getParameterIssues(nodeProperties, nodeValues, path) {
|
|
|
1202
1189
|
});
|
|
1203
1190
|
}
|
|
1204
1191
|
}
|
|
1205
|
-
else if (nodeProperties.type ===
|
|
1192
|
+
else if (nodeProperties.type === "fixedCollection") {
|
|
1206
1193
|
basePath = basePath ? `${basePath}.` : `${nodeProperties.name}.`;
|
|
1207
1194
|
let propertyOptions;
|
|
1208
1195
|
for (propertyOptions of nodeProperties.options) {
|
|
@@ -1265,7 +1252,7 @@ function mergeIssues(destination, source) {
|
|
|
1265
1252
|
if (source.execution === true) {
|
|
1266
1253
|
destination.execution = true;
|
|
1267
1254
|
}
|
|
1268
|
-
const objectProperties = [
|
|
1255
|
+
const objectProperties = ["parameters", "credentials"];
|
|
1269
1256
|
let destinationProperty;
|
|
1270
1257
|
for (const propertyName of objectProperties) {
|
|
1271
1258
|
if (source[propertyName] !== undefined) {
|
|
@@ -1323,7 +1310,7 @@ function getVersionedNodeTypeAll(object) {
|
|
|
1323
1310
|
return [object];
|
|
1324
1311
|
}
|
|
1325
1312
|
function isNodeTypeVersioned(object) {
|
|
1326
|
-
return !!(
|
|
1313
|
+
return !!("getNodeType" in object);
|
|
1327
1314
|
}
|
|
1328
1315
|
/**
|
|
1329
1316
|
* Returns the parameter value from the node parameters
|
|
@@ -1341,8 +1328,8 @@ function getParameterValue(nodeParameters, parameterName, index = 0) {
|
|
|
1341
1328
|
}
|
|
1342
1329
|
if (Array.isArray(value)) {
|
|
1343
1330
|
const arrayValue = value[index];
|
|
1344
|
-
return typeof arrayValue ===
|
|
1331
|
+
return typeof arrayValue === "object" ? undefined : arrayValue;
|
|
1345
1332
|
}
|
|
1346
|
-
return typeof value ===
|
|
1333
|
+
return typeof value === "object" ? undefined : value;
|
|
1347
1334
|
}
|
|
1348
1335
|
//# sourceMappingURL=NodeHelpers.js.map
|