n8n-nodes-base 1.13.0 → 1.14.1
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/build.tsbuildinfo +1 -1
- package/dist/methods/defined.json +3 -0
- package/dist/methods/referenced.json +3 -0
- package/dist/nodes/Switch/Switch.node.d.ts +3 -4
- package/dist/nodes/Switch/Switch.node.js +9 -581
- package/dist/nodes/Switch/Switch.node.js.map +1 -1
- package/dist/nodes/Switch/V1/SwitchV1.node.d.ts +6 -0
- package/dist/nodes/Switch/V1/SwitchV1.node.js +593 -0
- package/dist/nodes/Switch/V1/SwitchV1.node.js.map +1 -0
- package/dist/nodes/Switch/V2/SwitchV2.node.d.ts +11 -0
- package/dist/nodes/Switch/V2/SwitchV2.node.js +610 -0
- package/dist/nodes/Switch/V2/SwitchV2.node.js.map +1 -0
- package/dist/nodes/Switch/V2/test/switch.expression.workflow.json +168 -0
- package/dist/nodes/Switch/V2/test/switch.rules.workflow.json +184 -0
- package/dist/types/nodes.json +4 -3
- package/package.json +3 -3
- /package/dist/nodes/Switch/{test → V1/test}/switch.expression.workflow.json +0 -0
- /package/dist/nodes/Switch/{test → V1/test}/switch.rules.workflow.json +0 -0
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
export declare class Switch
|
|
3
|
-
|
|
4
|
-
execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
|
|
1
|
+
import { VersionedNodeType } from 'n8n-workflow';
|
|
2
|
+
export declare class Switch extends VersionedNodeType {
|
|
3
|
+
constructor();
|
|
5
4
|
}
|
|
@@ -2,595 +2,23 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Switch = void 0;
|
|
4
4
|
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
-
|
|
5
|
+
const SwitchV1_node_1 = require("./V1/SwitchV1.node");
|
|
6
|
+
const SwitchV2_node_1 = require("./V2/SwitchV2.node");
|
|
7
|
+
class Switch extends n8n_workflow_1.VersionedNodeType {
|
|
6
8
|
constructor() {
|
|
7
|
-
|
|
9
|
+
const baseDescription = {
|
|
8
10
|
displayName: 'Switch',
|
|
9
11
|
name: 'switch',
|
|
10
12
|
icon: 'fa:map-signs',
|
|
11
13
|
group: ['transform'],
|
|
12
|
-
version: 1,
|
|
13
14
|
description: 'Route items depending on defined expression or rules',
|
|
14
|
-
|
|
15
|
-
name: 'Switch',
|
|
16
|
-
color: '#506000',
|
|
17
|
-
},
|
|
18
|
-
inputs: ['main'],
|
|
19
|
-
outputs: ['main', 'main', 'main', 'main'],
|
|
20
|
-
outputNames: ['0', '1', '2', '3'],
|
|
21
|
-
properties: [
|
|
22
|
-
{
|
|
23
|
-
displayName: 'Mode',
|
|
24
|
-
name: 'mode',
|
|
25
|
-
type: 'options',
|
|
26
|
-
options: [
|
|
27
|
-
{
|
|
28
|
-
name: 'Expression',
|
|
29
|
-
value: 'expression',
|
|
30
|
-
description: 'Expression decides how to route data',
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
name: 'Rules',
|
|
34
|
-
value: 'rules',
|
|
35
|
-
description: 'Rules decide how to route data',
|
|
36
|
-
},
|
|
37
|
-
],
|
|
38
|
-
default: 'rules',
|
|
39
|
-
description: 'How data should be routed',
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
displayName: 'Output',
|
|
43
|
-
name: 'output',
|
|
44
|
-
type: 'number',
|
|
45
|
-
typeOptions: {
|
|
46
|
-
minValue: 0,
|
|
47
|
-
maxValue: 3,
|
|
48
|
-
},
|
|
49
|
-
displayOptions: {
|
|
50
|
-
show: {
|
|
51
|
-
mode: ['expression'],
|
|
52
|
-
},
|
|
53
|
-
},
|
|
54
|
-
default: 0,
|
|
55
|
-
description: 'The index of output to which to send data to',
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
displayName: 'Data Type',
|
|
59
|
-
name: 'dataType',
|
|
60
|
-
type: 'options',
|
|
61
|
-
displayOptions: {
|
|
62
|
-
show: {
|
|
63
|
-
mode: ['rules'],
|
|
64
|
-
},
|
|
65
|
-
},
|
|
66
|
-
options: [
|
|
67
|
-
{
|
|
68
|
-
name: 'Boolean',
|
|
69
|
-
value: 'boolean',
|
|
70
|
-
},
|
|
71
|
-
{
|
|
72
|
-
name: 'Date & Time',
|
|
73
|
-
value: 'dateTime',
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
name: 'Number',
|
|
77
|
-
value: 'number',
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
name: 'String',
|
|
81
|
-
value: 'string',
|
|
82
|
-
},
|
|
83
|
-
],
|
|
84
|
-
default: 'number',
|
|
85
|
-
description: 'The type of data to route on',
|
|
86
|
-
},
|
|
87
|
-
{
|
|
88
|
-
displayName: 'Value 1',
|
|
89
|
-
name: 'value1',
|
|
90
|
-
type: 'boolean',
|
|
91
|
-
displayOptions: {
|
|
92
|
-
show: {
|
|
93
|
-
dataType: ['boolean'],
|
|
94
|
-
mode: ['rules'],
|
|
95
|
-
},
|
|
96
|
-
},
|
|
97
|
-
default: false,
|
|
98
|
-
description: 'The value to compare with the first one',
|
|
99
|
-
},
|
|
100
|
-
{
|
|
101
|
-
displayName: 'Routing Rules',
|
|
102
|
-
name: 'rules',
|
|
103
|
-
placeholder: 'Add Routing Rule',
|
|
104
|
-
type: 'fixedCollection',
|
|
105
|
-
typeOptions: {
|
|
106
|
-
multipleValues: true,
|
|
107
|
-
},
|
|
108
|
-
displayOptions: {
|
|
109
|
-
show: {
|
|
110
|
-
dataType: ['boolean'],
|
|
111
|
-
mode: ['rules'],
|
|
112
|
-
},
|
|
113
|
-
},
|
|
114
|
-
default: {},
|
|
115
|
-
options: [
|
|
116
|
-
{
|
|
117
|
-
name: 'rules',
|
|
118
|
-
displayName: 'Boolean',
|
|
119
|
-
values: [
|
|
120
|
-
{
|
|
121
|
-
displayName: 'Operation',
|
|
122
|
-
name: 'operation',
|
|
123
|
-
type: 'options',
|
|
124
|
-
options: [
|
|
125
|
-
{
|
|
126
|
-
name: 'Equal',
|
|
127
|
-
value: 'equal',
|
|
128
|
-
},
|
|
129
|
-
{
|
|
130
|
-
name: 'Not Equal',
|
|
131
|
-
value: 'notEqual',
|
|
132
|
-
},
|
|
133
|
-
],
|
|
134
|
-
default: 'equal',
|
|
135
|
-
description: 'Operation to decide where the the data should be mapped to',
|
|
136
|
-
},
|
|
137
|
-
{
|
|
138
|
-
displayName: 'Value 2',
|
|
139
|
-
name: 'value2',
|
|
140
|
-
type: 'boolean',
|
|
141
|
-
default: false,
|
|
142
|
-
description: 'The value to compare with the first one',
|
|
143
|
-
},
|
|
144
|
-
{
|
|
145
|
-
displayName: 'Output',
|
|
146
|
-
name: 'output',
|
|
147
|
-
type: 'number',
|
|
148
|
-
typeOptions: {
|
|
149
|
-
minValue: 0,
|
|
150
|
-
maxValue: 3,
|
|
151
|
-
},
|
|
152
|
-
default: 0,
|
|
153
|
-
description: 'The index of output to which to send data to if rule matches',
|
|
154
|
-
},
|
|
155
|
-
],
|
|
156
|
-
},
|
|
157
|
-
],
|
|
158
|
-
},
|
|
159
|
-
{
|
|
160
|
-
displayName: 'Value 1',
|
|
161
|
-
name: 'value1',
|
|
162
|
-
type: 'dateTime',
|
|
163
|
-
displayOptions: {
|
|
164
|
-
show: {
|
|
165
|
-
dataType: ['dateTime'],
|
|
166
|
-
mode: ['rules'],
|
|
167
|
-
},
|
|
168
|
-
},
|
|
169
|
-
default: '',
|
|
170
|
-
description: 'The value to compare with the second one',
|
|
171
|
-
},
|
|
172
|
-
{
|
|
173
|
-
displayName: 'Routing Rules',
|
|
174
|
-
name: 'rules',
|
|
175
|
-
placeholder: 'Add Routing Rule',
|
|
176
|
-
type: 'fixedCollection',
|
|
177
|
-
typeOptions: {
|
|
178
|
-
multipleValues: true,
|
|
179
|
-
},
|
|
180
|
-
displayOptions: {
|
|
181
|
-
show: {
|
|
182
|
-
dataType: ['dateTime'],
|
|
183
|
-
mode: ['rules'],
|
|
184
|
-
},
|
|
185
|
-
},
|
|
186
|
-
default: {},
|
|
187
|
-
options: [
|
|
188
|
-
{
|
|
189
|
-
name: 'rules',
|
|
190
|
-
displayName: 'Dates',
|
|
191
|
-
values: [
|
|
192
|
-
{
|
|
193
|
-
displayName: 'Operation',
|
|
194
|
-
name: 'operation',
|
|
195
|
-
type: 'options',
|
|
196
|
-
options: [
|
|
197
|
-
{
|
|
198
|
-
name: 'Occurred After',
|
|
199
|
-
value: 'after',
|
|
200
|
-
},
|
|
201
|
-
{
|
|
202
|
-
name: 'Occurred Before',
|
|
203
|
-
value: 'before',
|
|
204
|
-
},
|
|
205
|
-
],
|
|
206
|
-
default: 'after',
|
|
207
|
-
description: 'Operation to decide where the the data should be mapped to',
|
|
208
|
-
},
|
|
209
|
-
{
|
|
210
|
-
displayName: 'Value 2',
|
|
211
|
-
name: 'value2',
|
|
212
|
-
type: 'dateTime',
|
|
213
|
-
default: 0,
|
|
214
|
-
description: 'The value to compare with the first one',
|
|
215
|
-
},
|
|
216
|
-
{
|
|
217
|
-
displayName: 'Output',
|
|
218
|
-
name: 'output',
|
|
219
|
-
type: 'number',
|
|
220
|
-
typeOptions: {
|
|
221
|
-
minValue: 0,
|
|
222
|
-
maxValue: 3,
|
|
223
|
-
},
|
|
224
|
-
default: 0,
|
|
225
|
-
description: 'The index of output to which to send data to if rule matches',
|
|
226
|
-
},
|
|
227
|
-
],
|
|
228
|
-
},
|
|
229
|
-
],
|
|
230
|
-
},
|
|
231
|
-
{
|
|
232
|
-
displayName: 'Value 1',
|
|
233
|
-
name: 'value1',
|
|
234
|
-
type: 'number',
|
|
235
|
-
displayOptions: {
|
|
236
|
-
show: {
|
|
237
|
-
dataType: ['number'],
|
|
238
|
-
mode: ['rules'],
|
|
239
|
-
},
|
|
240
|
-
},
|
|
241
|
-
default: 0,
|
|
242
|
-
description: 'The value to compare with the second one',
|
|
243
|
-
},
|
|
244
|
-
{
|
|
245
|
-
displayName: 'Routing Rules',
|
|
246
|
-
name: 'rules',
|
|
247
|
-
placeholder: 'Add Routing Rule',
|
|
248
|
-
type: 'fixedCollection',
|
|
249
|
-
typeOptions: {
|
|
250
|
-
multipleValues: true,
|
|
251
|
-
},
|
|
252
|
-
displayOptions: {
|
|
253
|
-
show: {
|
|
254
|
-
dataType: ['number'],
|
|
255
|
-
mode: ['rules'],
|
|
256
|
-
},
|
|
257
|
-
},
|
|
258
|
-
default: {},
|
|
259
|
-
options: [
|
|
260
|
-
{
|
|
261
|
-
name: 'rules',
|
|
262
|
-
displayName: 'Numbers',
|
|
263
|
-
values: [
|
|
264
|
-
{
|
|
265
|
-
displayName: 'Operation',
|
|
266
|
-
name: 'operation',
|
|
267
|
-
type: 'options',
|
|
268
|
-
options: [
|
|
269
|
-
{
|
|
270
|
-
name: 'Smaller',
|
|
271
|
-
value: 'smaller',
|
|
272
|
-
},
|
|
273
|
-
{
|
|
274
|
-
name: 'Smaller Equal',
|
|
275
|
-
value: 'smallerEqual',
|
|
276
|
-
},
|
|
277
|
-
{
|
|
278
|
-
name: 'Equal',
|
|
279
|
-
value: 'equal',
|
|
280
|
-
},
|
|
281
|
-
{
|
|
282
|
-
name: 'Not Equal',
|
|
283
|
-
value: 'notEqual',
|
|
284
|
-
},
|
|
285
|
-
{
|
|
286
|
-
name: 'Larger',
|
|
287
|
-
value: 'larger',
|
|
288
|
-
},
|
|
289
|
-
{
|
|
290
|
-
name: 'Larger Equal',
|
|
291
|
-
value: 'largerEqual',
|
|
292
|
-
},
|
|
293
|
-
],
|
|
294
|
-
default: 'smaller',
|
|
295
|
-
description: 'Operation to decide where the the data should be mapped to',
|
|
296
|
-
},
|
|
297
|
-
{
|
|
298
|
-
displayName: 'Value 2',
|
|
299
|
-
name: 'value2',
|
|
300
|
-
type: 'number',
|
|
301
|
-
default: 0,
|
|
302
|
-
description: 'The value to compare with the first one',
|
|
303
|
-
},
|
|
304
|
-
{
|
|
305
|
-
displayName: 'Output',
|
|
306
|
-
name: 'output',
|
|
307
|
-
type: 'number',
|
|
308
|
-
typeOptions: {
|
|
309
|
-
minValue: 0,
|
|
310
|
-
maxValue: 3,
|
|
311
|
-
},
|
|
312
|
-
default: 0,
|
|
313
|
-
description: 'The index of output to which to send data to if rule matches',
|
|
314
|
-
},
|
|
315
|
-
],
|
|
316
|
-
},
|
|
317
|
-
],
|
|
318
|
-
},
|
|
319
|
-
{
|
|
320
|
-
displayName: 'Value 1',
|
|
321
|
-
name: 'value1',
|
|
322
|
-
type: 'string',
|
|
323
|
-
displayOptions: {
|
|
324
|
-
show: {
|
|
325
|
-
dataType: ['string'],
|
|
326
|
-
mode: ['rules'],
|
|
327
|
-
},
|
|
328
|
-
},
|
|
329
|
-
default: '',
|
|
330
|
-
description: 'The value to compare with the second one',
|
|
331
|
-
},
|
|
332
|
-
{
|
|
333
|
-
displayName: 'Routing Rules',
|
|
334
|
-
name: 'rules',
|
|
335
|
-
placeholder: 'Add Routing Rule',
|
|
336
|
-
type: 'fixedCollection',
|
|
337
|
-
typeOptions: {
|
|
338
|
-
multipleValues: true,
|
|
339
|
-
},
|
|
340
|
-
displayOptions: {
|
|
341
|
-
show: {
|
|
342
|
-
dataType: ['string'],
|
|
343
|
-
mode: ['rules'],
|
|
344
|
-
},
|
|
345
|
-
},
|
|
346
|
-
default: {},
|
|
347
|
-
options: [
|
|
348
|
-
{
|
|
349
|
-
name: 'rules',
|
|
350
|
-
displayName: 'Strings',
|
|
351
|
-
values: [
|
|
352
|
-
{
|
|
353
|
-
displayName: 'Operation',
|
|
354
|
-
name: 'operation',
|
|
355
|
-
type: 'options',
|
|
356
|
-
options: [
|
|
357
|
-
{
|
|
358
|
-
name: 'Contains',
|
|
359
|
-
value: 'contains',
|
|
360
|
-
},
|
|
361
|
-
{
|
|
362
|
-
name: 'Not Contains',
|
|
363
|
-
value: 'notContains',
|
|
364
|
-
},
|
|
365
|
-
{
|
|
366
|
-
name: 'Ends With',
|
|
367
|
-
value: 'endsWith',
|
|
368
|
-
},
|
|
369
|
-
{
|
|
370
|
-
name: 'Not Ends With',
|
|
371
|
-
value: 'notEndsWith',
|
|
372
|
-
},
|
|
373
|
-
{
|
|
374
|
-
name: 'Equal',
|
|
375
|
-
value: 'equal',
|
|
376
|
-
},
|
|
377
|
-
{
|
|
378
|
-
name: 'Not Equal',
|
|
379
|
-
value: 'notEqual',
|
|
380
|
-
},
|
|
381
|
-
{
|
|
382
|
-
name: 'Regex Match',
|
|
383
|
-
value: 'regex',
|
|
384
|
-
},
|
|
385
|
-
{
|
|
386
|
-
name: 'Regex Not Match',
|
|
387
|
-
value: 'notRegex',
|
|
388
|
-
},
|
|
389
|
-
{
|
|
390
|
-
name: 'Starts With',
|
|
391
|
-
value: 'startsWith',
|
|
392
|
-
},
|
|
393
|
-
{
|
|
394
|
-
name: 'Not Starts With',
|
|
395
|
-
value: 'notStartsWith',
|
|
396
|
-
},
|
|
397
|
-
],
|
|
398
|
-
default: 'equal',
|
|
399
|
-
description: 'Operation to decide where the the data should be mapped to',
|
|
400
|
-
},
|
|
401
|
-
{
|
|
402
|
-
displayName: 'Value 2',
|
|
403
|
-
name: 'value2',
|
|
404
|
-
type: 'string',
|
|
405
|
-
displayOptions: {
|
|
406
|
-
hide: {
|
|
407
|
-
operation: ['regex', 'notRegex'],
|
|
408
|
-
},
|
|
409
|
-
},
|
|
410
|
-
default: '',
|
|
411
|
-
description: 'The value to compare with the first one',
|
|
412
|
-
},
|
|
413
|
-
{
|
|
414
|
-
displayName: 'Regex',
|
|
415
|
-
name: 'value2',
|
|
416
|
-
type: 'string',
|
|
417
|
-
displayOptions: {
|
|
418
|
-
show: {
|
|
419
|
-
operation: ['regex', 'notRegex'],
|
|
420
|
-
},
|
|
421
|
-
},
|
|
422
|
-
default: '',
|
|
423
|
-
placeholder: '/text/i',
|
|
424
|
-
description: 'The regex which has to match',
|
|
425
|
-
},
|
|
426
|
-
{
|
|
427
|
-
displayName: 'Output',
|
|
428
|
-
name: 'output',
|
|
429
|
-
type: 'number',
|
|
430
|
-
typeOptions: {
|
|
431
|
-
minValue: 0,
|
|
432
|
-
maxValue: 3,
|
|
433
|
-
},
|
|
434
|
-
default: 0,
|
|
435
|
-
description: 'The index of output to which to send data to if rule matches',
|
|
436
|
-
},
|
|
437
|
-
],
|
|
438
|
-
},
|
|
439
|
-
],
|
|
440
|
-
},
|
|
441
|
-
{
|
|
442
|
-
displayName: 'Fallback Output',
|
|
443
|
-
name: 'fallbackOutput',
|
|
444
|
-
type: 'options',
|
|
445
|
-
displayOptions: {
|
|
446
|
-
show: {
|
|
447
|
-
mode: ['rules'],
|
|
448
|
-
},
|
|
449
|
-
},
|
|
450
|
-
options: [
|
|
451
|
-
{
|
|
452
|
-
name: 'None',
|
|
453
|
-
value: -1,
|
|
454
|
-
},
|
|
455
|
-
{
|
|
456
|
-
name: '0',
|
|
457
|
-
value: 0,
|
|
458
|
-
},
|
|
459
|
-
{
|
|
460
|
-
name: '1',
|
|
461
|
-
value: 1,
|
|
462
|
-
},
|
|
463
|
-
{
|
|
464
|
-
name: '2',
|
|
465
|
-
value: 2,
|
|
466
|
-
},
|
|
467
|
-
{
|
|
468
|
-
name: '3',
|
|
469
|
-
value: 3,
|
|
470
|
-
},
|
|
471
|
-
],
|
|
472
|
-
default: -1,
|
|
473
|
-
description: 'The output to which to route all items which do not match any of the rules',
|
|
474
|
-
},
|
|
475
|
-
],
|
|
15
|
+
defaultVersion: 2,
|
|
476
16
|
};
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
const items = this.getInputData();
|
|
481
|
-
let compareOperationResult;
|
|
482
|
-
let item;
|
|
483
|
-
let mode;
|
|
484
|
-
let outputIndex;
|
|
485
|
-
let ruleData;
|
|
486
|
-
const compareOperationFunctions = {
|
|
487
|
-
after: (value1, value2) => (value1 || 0) > (value2 || 0),
|
|
488
|
-
before: (value1, value2) => (value1 || 0) < (value2 || 0),
|
|
489
|
-
contains: (value1, value2) => (value1 || '').toString().includes((value2 || '').toString()),
|
|
490
|
-
notContains: (value1, value2) => !(value1 || '').toString().includes((value2 || '').toString()),
|
|
491
|
-
endsWith: (value1, value2) => value1.endsWith(value2),
|
|
492
|
-
notEndsWith: (value1, value2) => !value1.endsWith(value2),
|
|
493
|
-
equal: (value1, value2) => value1 === value2,
|
|
494
|
-
notEqual: (value1, value2) => value1 !== value2,
|
|
495
|
-
larger: (value1, value2) => (value1 || 0) > (value2 || 0),
|
|
496
|
-
largerEqual: (value1, value2) => (value1 || 0) >= (value2 || 0),
|
|
497
|
-
smaller: (value1, value2) => (value1 || 0) < (value2 || 0),
|
|
498
|
-
smallerEqual: (value1, value2) => (value1 || 0) <= (value2 || 0),
|
|
499
|
-
startsWith: (value1, value2) => value1.startsWith(value2),
|
|
500
|
-
notStartsWith: (value1, value2) => !value1.startsWith(value2),
|
|
501
|
-
regex: (value1, value2) => {
|
|
502
|
-
const regexMatch = (value2 || '').toString().match(new RegExp('^/(.*?)/([gimusy]*)$'));
|
|
503
|
-
let regex;
|
|
504
|
-
if (!regexMatch) {
|
|
505
|
-
regex = new RegExp((value2 || '').toString());
|
|
506
|
-
}
|
|
507
|
-
else if (regexMatch.length === 1) {
|
|
508
|
-
regex = new RegExp(regexMatch[1]);
|
|
509
|
-
}
|
|
510
|
-
else {
|
|
511
|
-
regex = new RegExp(regexMatch[1], regexMatch[2]);
|
|
512
|
-
}
|
|
513
|
-
return !!(value1 || '').toString().match(regex);
|
|
514
|
-
},
|
|
515
|
-
notRegex: (value1, value2) => {
|
|
516
|
-
const regexMatch = (value2 || '').toString().match(new RegExp('^/(.*?)/([gimusy]*)$'));
|
|
517
|
-
let regex;
|
|
518
|
-
if (!regexMatch) {
|
|
519
|
-
regex = new RegExp((value2 || '').toString());
|
|
520
|
-
}
|
|
521
|
-
else if (regexMatch.length === 1) {
|
|
522
|
-
regex = new RegExp(regexMatch[1]);
|
|
523
|
-
}
|
|
524
|
-
else {
|
|
525
|
-
regex = new RegExp(regexMatch[1], regexMatch[2]);
|
|
526
|
-
}
|
|
527
|
-
return !(value1 || '').toString().match(regex);
|
|
528
|
-
},
|
|
529
|
-
};
|
|
530
|
-
const convertDateTime = (value) => {
|
|
531
|
-
let returnValue = undefined;
|
|
532
|
-
if (typeof value === 'string') {
|
|
533
|
-
returnValue = new Date(value).getTime();
|
|
534
|
-
}
|
|
535
|
-
else if (typeof value === 'number') {
|
|
536
|
-
returnValue = value;
|
|
537
|
-
}
|
|
538
|
-
if (value instanceof Date) {
|
|
539
|
-
returnValue = value.getTime();
|
|
540
|
-
}
|
|
541
|
-
if (returnValue === undefined || isNaN(returnValue)) {
|
|
542
|
-
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `The value "${value}" is not a valid DateTime.`);
|
|
543
|
-
}
|
|
544
|
-
return returnValue;
|
|
545
|
-
};
|
|
546
|
-
const checkIndexRange = (index) => {
|
|
547
|
-
if (index < 0 || index >= returnData.length) {
|
|
548
|
-
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `The ouput ${index} is not allowed. It has to be between 0 and ${returnData.length - 1}!`);
|
|
549
|
-
}
|
|
17
|
+
const nodeVersions = {
|
|
18
|
+
1: new SwitchV1_node_1.SwitchV1(baseDescription),
|
|
19
|
+
2: new SwitchV2_node_1.SwitchV2(baseDescription),
|
|
550
20
|
};
|
|
551
|
-
|
|
552
|
-
try {
|
|
553
|
-
item = items[itemIndex];
|
|
554
|
-
mode = this.getNodeParameter('mode', itemIndex);
|
|
555
|
-
if (mode === 'expression') {
|
|
556
|
-
outputIndex = this.getNodeParameter('output', itemIndex);
|
|
557
|
-
checkIndexRange(outputIndex);
|
|
558
|
-
returnData[outputIndex].push(item);
|
|
559
|
-
}
|
|
560
|
-
else if (mode === 'rules') {
|
|
561
|
-
const dataType = this.getNodeParameter('dataType', 0);
|
|
562
|
-
let value1 = this.getNodeParameter('value1', itemIndex);
|
|
563
|
-
if (dataType === 'dateTime') {
|
|
564
|
-
value1 = convertDateTime(value1);
|
|
565
|
-
}
|
|
566
|
-
for (ruleData of this.getNodeParameter('rules.rules', itemIndex, [])) {
|
|
567
|
-
let value2 = ruleData.value2;
|
|
568
|
-
if (dataType === 'dateTime') {
|
|
569
|
-
value2 = convertDateTime(value2);
|
|
570
|
-
}
|
|
571
|
-
compareOperationResult = compareOperationFunctions[ruleData.operation](value1, value2);
|
|
572
|
-
if (compareOperationResult) {
|
|
573
|
-
checkIndexRange(ruleData.output);
|
|
574
|
-
returnData[ruleData.output].push(item);
|
|
575
|
-
continue itemLoop;
|
|
576
|
-
}
|
|
577
|
-
}
|
|
578
|
-
outputIndex = this.getNodeParameter('fallbackOutput', itemIndex);
|
|
579
|
-
if (outputIndex !== -1) {
|
|
580
|
-
checkIndexRange(outputIndex);
|
|
581
|
-
returnData[outputIndex].push(item);
|
|
582
|
-
}
|
|
583
|
-
}
|
|
584
|
-
}
|
|
585
|
-
catch (error) {
|
|
586
|
-
if (this.continueOnFail()) {
|
|
587
|
-
returnData[0].push({ json: { error: error.message } });
|
|
588
|
-
continue;
|
|
589
|
-
}
|
|
590
|
-
throw error;
|
|
591
|
-
}
|
|
592
|
-
}
|
|
593
|
-
return returnData;
|
|
21
|
+
super(nodeVersions, baseDescription);
|
|
594
22
|
}
|
|
595
23
|
}
|
|
596
24
|
exports.Switch = Switch;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Switch.node.js","sourceRoot":"","sources":["../../../nodes/Switch/Switch.node.ts"],"names":[],"mappings":";;;AAQA,+CAAkD;AAElD,MAAa,MAAM;IAAnB;QACC,gBAAW,GAAyB;YACnC,WAAW,EAAE,QAAQ;YACrB,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,cAAc;YACpB,KAAK,EAAE,CAAC,WAAW,CAAC;YACpB,OAAO,EAAE,CAAC;YACV,WAAW,EAAE,sDAAsD;YACnE,QAAQ,EAAE;gBACT,IAAI,EAAE,QAAQ;gBACd,KAAK,EAAE,SAAS;aAChB;YACD,MAAM,EAAE,CAAC,MAAM,CAAC;YAEhB,OAAO,EAAE,CAAC,MAAM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AC5C;QACC,MAAM,eAAe,GAA6B;YACjD,WAAW,EAAE,QAAQ;YACrB,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,cAAc;YACpB,KAAK,EAAE,CAAC,WAAW,CAAC;YACpB,WAAW,EAAE,sDAAsD;YACnE,cAAc,EAAE,CAAC;SACjB,CAAC;QAEF,MAAM,YAAY,GAAuC;YACxD,CAAC,EAAE,IAAI,wBAAQ,CAAC,eAAe,CAAC;YAChC,CAAC,EAAE,IAAI,wBAAQ,CAAC,eAAe,CAAC;SAChC,CAAC;QAEF,KAAK,CAAC,YAAY,EAAE,eAAe,CAAC,CAAC;IACtC,CAAC;CACD;AAlBD,wBAkBC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { IExecuteFunctions, INodeExecutionData, INodeType, INodeTypeBaseDescription, INodeTypeDescription } from 'n8n-workflow';
|
|
2
|
+
export declare class SwitchV1 implements INodeType {
|
|
3
|
+
description: INodeTypeDescription;
|
|
4
|
+
constructor(baseDescription: INodeTypeBaseDescription);
|
|
5
|
+
execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
|
|
6
|
+
}
|