n8n-nodes-base 1.23.0 → 1.24.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/credentials/MondayComApi.credentials.d.ts +3 -1
- package/dist/credentials/MondayComApi.credentials.js +21 -0
- package/dist/credentials/MondayComApi.credentials.js.map +1 -1
- package/dist/credentials/MongoDb.credentials.js +62 -0
- package/dist/credentials/MongoDb.credentials.js.map +1 -1
- package/dist/methods/defined.json +0 -1
- package/dist/methods/referenced.json +1 -2
- package/dist/nodes/Airtable/AirtableTrigger.node.js +2 -2
- package/dist/nodes/Airtable/AirtableTrigger.node.js.map +1 -1
- package/dist/nodes/Aws/S3/V2/AwsS3V2.node.js +1 -1
- package/dist/nodes/Aws/S3/V2/AwsS3V2.node.js.map +1 -1
- package/dist/nodes/BambooHr/v1/actions/employee/create/execute.js +3 -3
- package/dist/nodes/BambooHr/v1/actions/employee/create/execute.js.map +1 -1
- package/dist/nodes/BambooHr/v1/actions/employee/update/execute.js +3 -3
- package/dist/nodes/BambooHr/v1/actions/employee/update/execute.js.map +1 -1
- package/dist/nodes/Cal/cal.svg +1 -1
- package/dist/nodes/Coda/GenericFunctions.js +4 -1
- package/dist/nodes/Coda/GenericFunctions.js.map +1 -1
- package/dist/nodes/Code/descriptions/JavascriptCodeDescription.js +0 -1
- package/dist/nodes/Code/descriptions/JavascriptCodeDescription.js.map +1 -1
- package/dist/nodes/Code/descriptions/PythonCodeDescription.js +0 -1
- package/dist/nodes/Code/descriptions/PythonCodeDescription.js.map +1 -1
- package/dist/nodes/Cortex/GenericFunctions.js +2 -2
- package/dist/nodes/Cortex/GenericFunctions.js.map +1 -1
- package/dist/nodes/Cron/Cron.node.js +1 -1
- package/dist/nodes/Cron/Cron.node.js.map +1 -1
- package/dist/nodes/DateTime/V2/GenericFunctions.js +2 -2
- package/dist/nodes/DateTime/V2/GenericFunctions.js.map +1 -1
- package/dist/nodes/Filter/V1/GenericFunctions.js +2 -2
- package/dist/nodes/Filter/V1/GenericFunctions.js.map +1 -1
- package/dist/nodes/Ftp/Ftp.node.js +2 -0
- package/dist/nodes/Ftp/Ftp.node.js.map +1 -1
- package/dist/nodes/Github/GithubTrigger.node.js +18 -1
- package/dist/nodes/Github/GithubTrigger.node.js.map +1 -1
- package/dist/nodes/GoToWebinar/GenericFunctions.js +4 -4
- package/dist/nodes/GoToWebinar/GenericFunctions.js.map +1 -1
- package/dist/nodes/Google/BigQuery/v2/actions/database/executeQuery.operation.js +0 -2
- package/dist/nodes/Google/BigQuery/v2/actions/database/executeQuery.operation.js.map +1 -1
- package/dist/nodes/Google/Calendar/GoogleCalendarTrigger.node.js +8 -8
- package/dist/nodes/Google/Calendar/GoogleCalendarTrigger.node.js.map +1 -1
- package/dist/nodes/Google/Contacts/GoogleContacts.node.js +5 -5
- package/dist/nodes/Google/Contacts/GoogleContacts.node.js.map +1 -1
- package/dist/nodes/Google/Drive/GoogleDriveTrigger.node.js +2 -2
- package/dist/nodes/Google/Drive/GoogleDriveTrigger.node.js.map +1 -1
- package/dist/nodes/Google/Drive/v2/actions/file/download.operation.js +2 -2
- package/dist/nodes/Google/Drive/v2/actions/file/download.operation.js.map +1 -1
- package/dist/nodes/Google/Drive/v2/transport/index.js +1 -1
- package/dist/nodes/Google/Drive/v2/transport/index.js.map +1 -1
- package/dist/nodes/Google/Sheet/GoogleSheetsTrigger.node.js +5 -5
- package/dist/nodes/Google/Sheet/GoogleSheetsTrigger.node.js.map +1 -1
- package/dist/nodes/Google/Sheet/v2/actions/router.js +6 -7
- package/dist/nodes/Google/Sheet/v2/actions/router.js.map +1 -1
- package/dist/nodes/Google/Sheet/v2/actions/sheet/Sheet.resource.js +6 -0
- package/dist/nodes/Google/Sheet/v2/actions/sheet/Sheet.resource.js.map +1 -1
- package/dist/nodes/Google/Sheet/v2/helpers/GoogleSheet.d.ts +6 -3
- package/dist/nodes/Google/Sheet/v2/helpers/GoogleSheet.js +10 -8
- package/dist/nodes/Google/Sheet/v2/helpers/GoogleSheet.js.map +1 -1
- package/dist/nodes/Google/Sheet/v2/helpers/GoogleSheets.types.d.ts +11 -1
- package/dist/nodes/Google/Sheet/v2/helpers/GoogleSheets.types.js +1 -0
- package/dist/nodes/Google/Sheet/v2/helpers/GoogleSheets.types.js.map +1 -1
- package/dist/nodes/Google/Sheet/v2/helpers/GoogleSheets.utils.d.ts +1 -0
- package/dist/nodes/Google/Sheet/v2/helpers/GoogleSheets.utils.js +7 -1
- package/dist/nodes/Google/Sheet/v2/helpers/GoogleSheets.utils.js.map +1 -1
- package/dist/nodes/Google/Sheet/v2/methods/loadOptions.js +3 -5
- package/dist/nodes/Google/Sheet/v2/methods/loadOptions.js.map +1 -1
- package/dist/nodes/Google/Sheet/v2/methods/resourceMapping.js +3 -5
- package/dist/nodes/Google/Sheet/v2/methods/resourceMapping.js.map +1 -1
- package/dist/nodes/HttpRequest/V1/HttpRequestV1.node.js +3 -1
- package/dist/nodes/HttpRequest/V1/HttpRequestV1.node.js.map +1 -1
- package/dist/nodes/HttpRequest/V2/HttpRequestV2.node.js +3 -1
- package/dist/nodes/HttpRequest/V2/HttpRequestV2.node.js.map +1 -1
- package/dist/nodes/HttpRequest/V3/HttpRequestV3.node.js +72 -54
- package/dist/nodes/HttpRequest/V3/HttpRequestV3.node.js.map +1 -1
- package/dist/nodes/Hubspot/V1/GenericFunctions.js +3 -3
- package/dist/nodes/Hubspot/V1/GenericFunctions.js.map +1 -1
- package/dist/nodes/Hubspot/V2/GenericFunctions.js +3 -3
- package/dist/nodes/Hubspot/V2/GenericFunctions.js.map +1 -1
- package/dist/nodes/ICalendar/ICalendar.node.json +1 -1
- package/dist/nodes/If/V1/IfV1.node.js +2 -2
- package/dist/nodes/If/V1/IfV1.node.js.map +1 -1
- package/dist/nodes/Interval/Interval.node.js +1 -1
- package/dist/nodes/Interval/Interval.node.js.map +1 -1
- package/dist/nodes/Mailchimp/Mailchimp.node.js +5 -5
- package/dist/nodes/Mailchimp/Mailchimp.node.js.map +1 -1
- package/dist/nodes/Mandrill/Mandrill.node.js +2 -2
- package/dist/nodes/Mandrill/Mandrill.node.js.map +1 -1
- package/dist/nodes/ManualTrigger/ManualTrigger.node.js +2 -2
- package/dist/nodes/ManualTrigger/ManualTrigger.node.js.map +1 -1
- package/dist/nodes/Microsoft/Sql/MicrosoftSql.node.js +2 -4
- package/dist/nodes/Microsoft/Sql/MicrosoftSql.node.js.map +1 -1
- package/dist/nodes/MondayCom/GenericFunctions.d.ts +1 -0
- package/dist/nodes/MondayCom/GenericFunctions.js +33 -10
- package/dist/nodes/MondayCom/GenericFunctions.js.map +1 -1
- package/dist/nodes/MondayCom/MondayCom.node.js +117 -91
- package/dist/nodes/MondayCom/MondayCom.node.js.map +1 -1
- package/dist/nodes/MongoDb/GenericFunctions.d.ts +2 -0
- package/dist/nodes/MongoDb/GenericFunctions.js +27 -1
- package/dist/nodes/MongoDb/GenericFunctions.js.map +1 -1
- package/dist/nodes/MongoDb/MongoDb.node.js +4 -3
- package/dist/nodes/MongoDb/MongoDb.node.js.map +1 -1
- package/dist/nodes/MoveBinaryData/MoveBinaryData.node.json +1 -1
- package/dist/nodes/MySql/MySql.node.js +1 -0
- package/dist/nodes/MySql/MySql.node.js.map +1 -1
- package/dist/nodes/MySql/v1/MySqlV1.node.js +0 -1
- package/dist/nodes/MySql/v1/MySqlV1.node.js.map +1 -1
- package/dist/nodes/MySql/v2/actions/database/deleteTable.operation.js +3 -3
- package/dist/nodes/MySql/v2/actions/database/deleteTable.operation.js.map +1 -1
- package/dist/nodes/MySql/v2/actions/database/executeQuery.operation.js +0 -1
- package/dist/nodes/MySql/v2/actions/database/executeQuery.operation.js.map +1 -1
- package/dist/nodes/MySql/v2/actions/database/insert.operation.js +4 -4
- package/dist/nodes/MySql/v2/actions/database/insert.operation.js.map +1 -1
- package/dist/nodes/MySql/v2/actions/database/select.operation.js +3 -3
- package/dist/nodes/MySql/v2/actions/database/select.operation.js.map +1 -1
- package/dist/nodes/MySql/v2/actions/database/update.operation.js +3 -3
- package/dist/nodes/MySql/v2/actions/database/update.operation.js.map +1 -1
- package/dist/nodes/MySql/v2/actions/database/upsert.operation.js +3 -3
- package/dist/nodes/MySql/v2/actions/database/upsert.operation.js.map +1 -1
- package/dist/nodes/MySql/v2/helpers/utils.d.ts +1 -0
- package/dist/nodes/MySql/v2/helpers/utils.js +18 -4
- package/dist/nodes/MySql/v2/helpers/utils.js.map +1 -1
- package/dist/nodes/MySql/v2/methods/loadOptions.js +2 -1
- package/dist/nodes/MySql/v2/methods/loadOptions.js.map +1 -1
- package/dist/nodes/Nasa/Nasa.node.js +13 -13
- package/dist/nodes/Nasa/Nasa.node.js.map +1 -1
- package/dist/nodes/NextCloud/GenericFunctions.d.ts +1 -1
- package/dist/nodes/NextCloud/GenericFunctions.js +8 -1
- package/dist/nodes/NextCloud/GenericFunctions.js.map +1 -1
- package/dist/nodes/NocoDB/GenericFunctions.js +11 -3
- package/dist/nodes/NocoDB/GenericFunctions.js.map +1 -1
- package/dist/nodes/Notion/NotionTrigger.node.js +7 -7
- package/dist/nodes/Notion/NotionTrigger.node.js.map +1 -1
- package/dist/nodes/OpenAi/ChatDescription.js +62 -0
- package/dist/nodes/OpenAi/ChatDescription.js.map +1 -1
- package/dist/nodes/OpenAi/ImageDescription.js +62 -0
- package/dist/nodes/OpenAi/ImageDescription.js.map +1 -1
- package/dist/nodes/OpenAi/OpenAi.node.js +1 -1
- package/dist/nodes/OpenAi/OpenAi.node.js.map +1 -1
- package/dist/nodes/OpenAi/TextDescription.js +2 -2
- package/dist/nodes/OpenAi/TextDescription.js.map +1 -1
- package/dist/nodes/Orbit/Orbit.node.js +3 -3
- package/dist/nodes/Orbit/Orbit.node.js.map +1 -1
- package/dist/nodes/Oura/Oura.node.js +3 -3
- package/dist/nodes/Oura/Oura.node.js.map +1 -1
- package/dist/nodes/Paddle/Paddle.node.js +6 -6
- package/dist/nodes/Paddle/Paddle.node.js.map +1 -1
- package/dist/nodes/Postgres/Postgres.node.js +1 -0
- package/dist/nodes/Postgres/Postgres.node.js.map +1 -1
- package/dist/nodes/Postgres/v1/PostgresV1.node.js +0 -1
- package/dist/nodes/Postgres/v1/PostgresV1.node.js.map +1 -1
- package/dist/nodes/Postgres/v2/actions/database/executeQuery.operation.js +0 -1
- package/dist/nodes/Postgres/v2/actions/database/executeQuery.operation.js.map +1 -1
- package/dist/nodes/Postgres/v2/helpers/interfaces.d.ts +2 -0
- package/dist/nodes/Postgres/v2/helpers/utils.d.ts +7 -1
- package/dist/nodes/Postgres/v2/helpers/utils.js +24 -3
- package/dist/nodes/Postgres/v2/helpers/utils.js.map +1 -1
- package/dist/nodes/Postgres/v2/methods/resourceMapping.js +5 -4
- package/dist/nodes/Postgres/v2/methods/resourceMapping.js.map +1 -1
- package/dist/nodes/QuestDb/QuestDb.node.js +1 -1
- package/dist/nodes/QuestDb/QuestDb.node.js.map +1 -1
- package/dist/nodes/ReadBinaryFile/ReadBinaryFile.node.json +1 -1
- package/dist/nodes/ReadBinaryFiles/ReadBinaryFiles.node.json +1 -1
- package/dist/nodes/ReadPdf/ReadPDF.node.json +1 -1
- package/dist/nodes/RssFeedRead/RssFeedReadTrigger.node.js +2 -2
- package/dist/nodes/RssFeedRead/RssFeedReadTrigger.node.js.map +1 -1
- package/dist/nodes/Schedule/ScheduleTrigger.node.js +1 -1
- package/dist/nodes/Schedule/ScheduleTrigger.node.js.map +1 -1
- package/dist/nodes/SeaTable/SeaTableTrigger.node.js +4 -4
- package/dist/nodes/SeaTable/SeaTableTrigger.node.js.map +1 -1
- package/dist/nodes/SecurityScorecard/SecurityScorecard.node.js +7 -7
- package/dist/nodes/SecurityScorecard/SecurityScorecard.node.js.map +1 -1
- package/dist/nodes/Set/v2/helpers/utils.js +15 -3
- package/dist/nodes/Set/v2/helpers/utils.js.map +1 -1
- package/dist/nodes/Set/v2/raw.mode.js +1 -1
- package/dist/nodes/Set/v2/raw.mode.js.map +1 -1
- package/dist/nodes/Slack/V1/SlackV1.node.js +2 -2
- package/dist/nodes/Slack/V1/SlackV1.node.js.map +1 -1
- package/dist/nodes/Slack/V2/SlackV2.node.js +2 -2
- package/dist/nodes/Slack/V2/SlackV2.node.js.map +1 -1
- package/dist/nodes/Snowflake/Snowflake.node.js +1 -1
- package/dist/nodes/Snowflake/Snowflake.node.js.map +1 -1
- package/dist/nodes/Spontit/Spontit.node.js +3 -3
- package/dist/nodes/Spontit/Spontit.node.js.map +1 -1
- package/dist/nodes/SpreadsheetFile/SpreadsheetFile.node.json +1 -1
- package/dist/nodes/Strava/Strava.node.js +2 -2
- package/dist/nodes/Strava/Strava.node.js.map +1 -1
- package/dist/nodes/Supabase/Supabase.node.js +8 -2
- package/dist/nodes/Supabase/Supabase.node.js.map +1 -1
- package/dist/nodes/Switch/Switch.node.js +3 -1
- package/dist/nodes/Switch/Switch.node.js.map +1 -1
- package/dist/nodes/Switch/V2/SwitchV2.node.js +1 -0
- package/dist/nodes/Switch/V2/SwitchV2.node.js.map +1 -1
- package/dist/nodes/Switch/V3/SwitchV3.node.d.ts +11 -0
- package/dist/nodes/Switch/V3/SwitchV3.node.js +351 -0
- package/dist/nodes/Switch/V3/SwitchV3.node.js.map +1 -0
- package/dist/nodes/Switch/V3/test/switch.expression.workflow.json +168 -0
- package/dist/nodes/Switch/V3/test/switch.rules.workflow.json +242 -0
- package/dist/nodes/TheHive/GenericFunctions.js +2 -2
- package/dist/nodes/TheHive/GenericFunctions.js.map +1 -1
- package/dist/nodes/TimescaleDb/TimescaleDb.node.js +1 -1
- package/dist/nodes/TimescaleDb/TimescaleDb.node.js.map +1 -1
- package/dist/nodes/Toggl/TogglTrigger.node.js +2 -2
- package/dist/nodes/Toggl/TogglTrigger.node.js.map +1 -1
- package/dist/nodes/Twist/Twist.node.js +5 -5
- package/dist/nodes/Twist/Twist.node.js.map +1 -1
- package/dist/nodes/UnleashedSoftware/UnleashedSoftware.node.js +6 -6
- package/dist/nodes/UnleashedSoftware/UnleashedSoftware.node.js.map +1 -1
- package/dist/nodes/Venafi/Datacenter/VenafiTlsProtectDatacenterTrigger.node.js +2 -2
- package/dist/nodes/Venafi/Datacenter/VenafiTlsProtectDatacenterTrigger.node.js.map +1 -1
- package/dist/nodes/Venafi/ProtectCloud/CertificateRequestDescription.js +0 -17
- package/dist/nodes/Venafi/ProtectCloud/CertificateRequestDescription.js.map +1 -1
- package/dist/nodes/Venafi/ProtectCloud/VenafiTlsProtectCloud.node.d.ts +0 -1
- package/dist/nodes/Venafi/ProtectCloud/VenafiTlsProtectCloud.node.js +0 -13
- package/dist/nodes/Venafi/ProtectCloud/VenafiTlsProtectCloud.node.js.map +1 -1
- package/dist/nodes/Venafi/ProtectCloud/VenafiTlsProtectCloudTrigger.node.js +7 -6
- package/dist/nodes/Venafi/ProtectCloud/VenafiTlsProtectCloudTrigger.node.js.map +1 -1
- package/dist/nodes/Webhook/Webhook.node.js +1 -1
- package/dist/nodes/Webhook/Webhook.node.js.map +1 -1
- package/dist/nodes/WriteBinaryFile/WriteBinaryFile.node.json +1 -1
- package/dist/nodes/Yourls/GenericFunctions.js +5 -0
- package/dist/nodes/Yourls/GenericFunctions.js.map +1 -1
- package/dist/types/credentials.json +2 -2
- package/dist/types/nodes.json +33 -32
- package/package.json +3 -4
|
@@ -0,0 +1,351 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SwitchV3 = void 0;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const utilities_1 = require("../../../utils/utilities");
|
|
6
|
+
const configuredOutputs = (parameters) => {
|
|
7
|
+
var _a, _b, _c, _d;
|
|
8
|
+
const mode = parameters.mode;
|
|
9
|
+
if (mode === 'expression') {
|
|
10
|
+
return Array.from({ length: parameters.numberOutputs }, (_, i) => ({
|
|
11
|
+
type: `${"main"}`,
|
|
12
|
+
displayName: i.toString(),
|
|
13
|
+
}));
|
|
14
|
+
}
|
|
15
|
+
else {
|
|
16
|
+
const rules = (_b = (_a = parameters.rules) === null || _a === void 0 ? void 0 : _a.values) !== null && _b !== void 0 ? _b : [];
|
|
17
|
+
const ruleOutputs = rules.map((rule, index) => {
|
|
18
|
+
return {
|
|
19
|
+
type: `${"main"}`,
|
|
20
|
+
displayName: rule.outputKey || index.toString(),
|
|
21
|
+
};
|
|
22
|
+
});
|
|
23
|
+
if (((_c = parameters.options) === null || _c === void 0 ? void 0 : _c.fallbackOutput) === 'extra') {
|
|
24
|
+
const renameFallbackOutput = (_d = parameters.options) === null || _d === void 0 ? void 0 : _d.renameFallbackOutput;
|
|
25
|
+
ruleOutputs.push({
|
|
26
|
+
type: `${"main"}`,
|
|
27
|
+
displayName: renameFallbackOutput || 'Fallback',
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
return ruleOutputs;
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
class SwitchV3 {
|
|
34
|
+
constructor(baseDescription) {
|
|
35
|
+
this.methods = {
|
|
36
|
+
loadOptions: {
|
|
37
|
+
async getFallbackOutputOptions() {
|
|
38
|
+
var _a;
|
|
39
|
+
const rules = (_a = this.getCurrentNodeParameter('rules.values')) !== null && _a !== void 0 ? _a : [];
|
|
40
|
+
const outputOptions = [
|
|
41
|
+
{
|
|
42
|
+
name: 'None (default)',
|
|
43
|
+
value: 'none',
|
|
44
|
+
description: 'Items will be ignored',
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
name: 'Extra Output',
|
|
48
|
+
value: 'extra',
|
|
49
|
+
description: 'Items will be sent to the extra, separate, output',
|
|
50
|
+
},
|
|
51
|
+
];
|
|
52
|
+
for (const [index, rule] of rules.entries()) {
|
|
53
|
+
outputOptions.push({
|
|
54
|
+
name: `Output ${rule.outputKey || index}`,
|
|
55
|
+
value: index,
|
|
56
|
+
description: `Items will be sent to the same output as when matched rule ${index + 1}`,
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
return outputOptions;
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
};
|
|
63
|
+
this.description = {
|
|
64
|
+
...baseDescription,
|
|
65
|
+
subtitle: `=mode: {{(${utilities_1.capitalize})($parameter["mode"])}}`,
|
|
66
|
+
version: [3],
|
|
67
|
+
defaults: {
|
|
68
|
+
name: 'Switch',
|
|
69
|
+
color: '#506000',
|
|
70
|
+
},
|
|
71
|
+
inputs: ['main'],
|
|
72
|
+
outputs: `={{(${configuredOutputs})($parameter)}}`,
|
|
73
|
+
properties: [
|
|
74
|
+
{
|
|
75
|
+
displayName: 'Mode',
|
|
76
|
+
name: 'mode',
|
|
77
|
+
type: 'options',
|
|
78
|
+
noDataExpression: true,
|
|
79
|
+
options: [
|
|
80
|
+
{
|
|
81
|
+
name: 'Rules',
|
|
82
|
+
value: 'rules',
|
|
83
|
+
description: 'Build a matching rule for each output',
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
name: 'Expression',
|
|
87
|
+
value: 'expression',
|
|
88
|
+
description: 'Write an expression to return the output index',
|
|
89
|
+
},
|
|
90
|
+
],
|
|
91
|
+
default: 'rules',
|
|
92
|
+
description: 'How data should be routed',
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
displayName: 'Number of Outputs',
|
|
96
|
+
name: 'numberOutputs',
|
|
97
|
+
type: 'number',
|
|
98
|
+
displayOptions: {
|
|
99
|
+
show: {
|
|
100
|
+
mode: ['expression'],
|
|
101
|
+
},
|
|
102
|
+
},
|
|
103
|
+
default: 4,
|
|
104
|
+
description: 'How many outputs to create',
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
displayName: 'Output Index',
|
|
108
|
+
name: 'output',
|
|
109
|
+
type: 'number',
|
|
110
|
+
validateType: 'number',
|
|
111
|
+
hint: 'The index to route the item to, starts at 0',
|
|
112
|
+
displayOptions: {
|
|
113
|
+
show: {
|
|
114
|
+
mode: ['expression'],
|
|
115
|
+
},
|
|
116
|
+
},
|
|
117
|
+
default: '={{}}',
|
|
118
|
+
description: "The output's index to which send an input item, use expressions to calculate what input item should be routed to which output, expression must return a number",
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
displayName: 'Routing Rules',
|
|
122
|
+
name: 'rules',
|
|
123
|
+
placeholder: 'Add Routing Rule',
|
|
124
|
+
type: 'fixedCollection',
|
|
125
|
+
typeOptions: {
|
|
126
|
+
multipleValues: true,
|
|
127
|
+
sortable: true,
|
|
128
|
+
},
|
|
129
|
+
default: {
|
|
130
|
+
values: [
|
|
131
|
+
{
|
|
132
|
+
conditions: {
|
|
133
|
+
options: {
|
|
134
|
+
caseSensitive: true,
|
|
135
|
+
leftValue: '',
|
|
136
|
+
typeValidation: 'strict',
|
|
137
|
+
},
|
|
138
|
+
conditions: [
|
|
139
|
+
{
|
|
140
|
+
leftValue: '',
|
|
141
|
+
rightValue: '',
|
|
142
|
+
operator: {
|
|
143
|
+
type: 'string',
|
|
144
|
+
operation: 'equals',
|
|
145
|
+
},
|
|
146
|
+
},
|
|
147
|
+
],
|
|
148
|
+
combinator: 'and',
|
|
149
|
+
},
|
|
150
|
+
},
|
|
151
|
+
],
|
|
152
|
+
},
|
|
153
|
+
displayOptions: {
|
|
154
|
+
show: {
|
|
155
|
+
mode: ['rules'],
|
|
156
|
+
},
|
|
157
|
+
},
|
|
158
|
+
options: [
|
|
159
|
+
{
|
|
160
|
+
name: 'values',
|
|
161
|
+
displayName: 'Values',
|
|
162
|
+
values: [
|
|
163
|
+
{
|
|
164
|
+
displayName: 'Conditions',
|
|
165
|
+
name: 'conditions',
|
|
166
|
+
placeholder: 'Add Condition',
|
|
167
|
+
type: 'filter',
|
|
168
|
+
default: {},
|
|
169
|
+
typeOptions: {
|
|
170
|
+
multipleValues: false,
|
|
171
|
+
filter: {
|
|
172
|
+
caseSensitive: '={{!$parameter.options.ignoreCase}}',
|
|
173
|
+
typeValidation: '={{$parameter.options.looseTypeValidation ? "loose" : "strict"}}',
|
|
174
|
+
},
|
|
175
|
+
},
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
displayName: 'Rename Output',
|
|
179
|
+
name: 'renameOutput',
|
|
180
|
+
type: 'boolean',
|
|
181
|
+
default: false,
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
displayName: 'Output Name',
|
|
185
|
+
name: 'outputKey',
|
|
186
|
+
type: 'string',
|
|
187
|
+
default: '',
|
|
188
|
+
description: 'The label of output to which to send data to if rule matches',
|
|
189
|
+
displayOptions: {
|
|
190
|
+
show: {
|
|
191
|
+
renameOutput: [true],
|
|
192
|
+
},
|
|
193
|
+
},
|
|
194
|
+
},
|
|
195
|
+
],
|
|
196
|
+
},
|
|
197
|
+
],
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
displayName: 'Options',
|
|
201
|
+
name: 'options',
|
|
202
|
+
type: 'collection',
|
|
203
|
+
placeholder: 'Add Option',
|
|
204
|
+
default: {},
|
|
205
|
+
displayOptions: {
|
|
206
|
+
show: {
|
|
207
|
+
mode: ['rules'],
|
|
208
|
+
},
|
|
209
|
+
},
|
|
210
|
+
options: [
|
|
211
|
+
{
|
|
212
|
+
displayName: 'Fallback Output',
|
|
213
|
+
name: 'fallbackOutput',
|
|
214
|
+
type: 'options',
|
|
215
|
+
typeOptions: {
|
|
216
|
+
loadOptionsDependsOn: ['rules.values', '/rules', '/rules.values'],
|
|
217
|
+
loadOptionsMethod: 'getFallbackOutputOptions',
|
|
218
|
+
},
|
|
219
|
+
default: 'none',
|
|
220
|
+
description: 'If no rule matches the item will be sent to this output, by default they will be ignored',
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
displayName: 'Ignore Case',
|
|
224
|
+
description: 'Whether to ignore letter case when evaluating conditions',
|
|
225
|
+
name: 'ignoreCase',
|
|
226
|
+
type: 'boolean',
|
|
227
|
+
default: true,
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
displayName: 'Less Strict Type Validation',
|
|
231
|
+
description: 'Whether to try casting value types based on the selected operator',
|
|
232
|
+
name: 'looseTypeValidation',
|
|
233
|
+
type: 'boolean',
|
|
234
|
+
default: true,
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
displayName: 'Rename Fallback Output',
|
|
238
|
+
name: 'renameFallbackOutput',
|
|
239
|
+
type: 'string',
|
|
240
|
+
placeholder: 'e.g. Fallback',
|
|
241
|
+
default: '',
|
|
242
|
+
displayOptions: {
|
|
243
|
+
show: {
|
|
244
|
+
fallbackOutput: ['extra'],
|
|
245
|
+
},
|
|
246
|
+
},
|
|
247
|
+
},
|
|
248
|
+
{
|
|
249
|
+
displayName: 'Send data to all matching outputs',
|
|
250
|
+
name: 'allMatchingOutputs',
|
|
251
|
+
type: 'boolean',
|
|
252
|
+
default: false,
|
|
253
|
+
description: 'Whether to send data to all outputs meeting conditions (and not just the first one)',
|
|
254
|
+
},
|
|
255
|
+
],
|
|
256
|
+
},
|
|
257
|
+
],
|
|
258
|
+
};
|
|
259
|
+
}
|
|
260
|
+
async execute() {
|
|
261
|
+
let returnData = [];
|
|
262
|
+
const items = this.getInputData();
|
|
263
|
+
const mode = this.getNodeParameter('mode', 0);
|
|
264
|
+
const checkIndexRange = (returnDataLength, index, itemIndex = 0) => {
|
|
265
|
+
if (Number(index) === returnDataLength) {
|
|
266
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `The ouput ${index} is not allowed. `, {
|
|
267
|
+
itemIndex,
|
|
268
|
+
description: `Output indexes are zero based, if you want to use the extra output use ${index - 1}`,
|
|
269
|
+
});
|
|
270
|
+
}
|
|
271
|
+
if (index < 0 || index > returnDataLength) {
|
|
272
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `The ouput ${index} is not allowed`, {
|
|
273
|
+
itemIndex,
|
|
274
|
+
description: `It has to be between 0 and ${returnDataLength - 1}`,
|
|
275
|
+
});
|
|
276
|
+
}
|
|
277
|
+
};
|
|
278
|
+
itemLoop: for (let itemIndex = 0; itemIndex < items.length; itemIndex++) {
|
|
279
|
+
try {
|
|
280
|
+
const item = items[itemIndex];
|
|
281
|
+
item.pairedItem = { item: itemIndex };
|
|
282
|
+
if (mode === 'expression') {
|
|
283
|
+
const numberOutputs = this.getNodeParameter('numberOutputs', itemIndex);
|
|
284
|
+
if (itemIndex === 0) {
|
|
285
|
+
returnData = new Array(numberOutputs).fill(0).map(() => []);
|
|
286
|
+
}
|
|
287
|
+
const outputIndex = this.getNodeParameter('output', itemIndex);
|
|
288
|
+
checkIndexRange(returnData.length, outputIndex, itemIndex);
|
|
289
|
+
returnData[outputIndex].push(item);
|
|
290
|
+
}
|
|
291
|
+
else if (mode === 'rules') {
|
|
292
|
+
const rules = this.getNodeParameter('rules.values', itemIndex, []);
|
|
293
|
+
if (!rules.length)
|
|
294
|
+
continue;
|
|
295
|
+
const options = this.getNodeParameter('options', itemIndex, {});
|
|
296
|
+
const fallbackOutput = options.fallbackOutput;
|
|
297
|
+
if (itemIndex === 0) {
|
|
298
|
+
returnData = new Array(rules.length).fill(0).map(() => []);
|
|
299
|
+
if (fallbackOutput === 'extra') {
|
|
300
|
+
returnData.push([]);
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
let matchFound = false;
|
|
304
|
+
for (const [ruleIndex, rule] of rules.entries()) {
|
|
305
|
+
let conditionPass;
|
|
306
|
+
try {
|
|
307
|
+
conditionPass = this.getNodeParameter(`rules.values[${ruleIndex}].conditions`, itemIndex, false, {
|
|
308
|
+
extractValue: true,
|
|
309
|
+
});
|
|
310
|
+
}
|
|
311
|
+
catch (error) {
|
|
312
|
+
if (!options.looseTypeValidation) {
|
|
313
|
+
error.description =
|
|
314
|
+
"Try to change the operator, switch ON the option 'Less Strict Type Validation', or change the type with an expression";
|
|
315
|
+
}
|
|
316
|
+
throw error;
|
|
317
|
+
}
|
|
318
|
+
if (conditionPass) {
|
|
319
|
+
matchFound = true;
|
|
320
|
+
checkIndexRange(returnData.length, rule.output, itemIndex);
|
|
321
|
+
returnData[ruleIndex].push(item);
|
|
322
|
+
if (!options.allMatchingOutputs) {
|
|
323
|
+
continue itemLoop;
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
if (fallbackOutput !== undefined && fallbackOutput !== 'none' && !matchFound) {
|
|
328
|
+
if (fallbackOutput === 'extra') {
|
|
329
|
+
returnData[returnData.length - 1].push(item);
|
|
330
|
+
continue;
|
|
331
|
+
}
|
|
332
|
+
checkIndexRange(returnData.length, fallbackOutput, itemIndex);
|
|
333
|
+
returnData[fallbackOutput].push(item);
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
catch (error) {
|
|
338
|
+
if (this.continueOnFail()) {
|
|
339
|
+
returnData[0].push({ json: { error: error.message } });
|
|
340
|
+
continue;
|
|
341
|
+
}
|
|
342
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), error);
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
if (!returnData.length)
|
|
346
|
+
return [[]];
|
|
347
|
+
return returnData;
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
exports.SwitchV3 = SwitchV3;
|
|
351
|
+
//# sourceMappingURL=SwitchV3.node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SwitchV3.node.js","sourceRoot":"","sources":["../../../../nodes/Switch/V3/SwitchV3.node.ts"],"names":[],"mappings":";;;AAWA,+CAAsE;AACtE,gDAA8C;AAE9C,MAAM,iBAAiB,GAAG,CAAC,UAA2B,EAAE,EAAE;;IACzD,MAAM,IAAI,GAAG,UAAU,CAAC,IAAc,CAAC;IAEvC,IAAI,IAAI,KAAK,YAAY,EAAE,CAAC;QAC3B,OAAO,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,UAAU,CAAC,aAAuB,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;YAC5E,IAAI,EAAE,GAAG,MAAuB,EAAE;YAClC,WAAW,EAAE,CAAC,CAAC,QAAQ,EAAE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AS,CAAC,CAAC;wBACxE,UAAU,CAAC,cAAwB,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;oBACjD,CAAC;gBACF,CAAC;YACF,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBAChB,IAAI,IAAI,CAAC,cAAc,EAAE,EAAE,CAAC;oBAC3B,UAAU,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;oBACvD,SAAS;gBACV,CAAC;gBACD,MAAM,IAAI,iCAAkB,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,KAAK,CAAC,CAAC;YACrD,CAAC;QACF,CAAC;QAED,IAAI,CAAC,UAAU,CAAC,MAAM;YAAE,OAAO,CAAC,EAAE,CAAC,CAAC;QAEpC,OAAO,UAAU,CAAC;IACnB,CAAC;CACD;AA5VD,4BA4VC"}
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "My workflow 64",
|
|
3
|
+
"nodes": [
|
|
4
|
+
{
|
|
5
|
+
"parameters": {},
|
|
6
|
+
"id": "58cc2d21-a8b1-424d-a8e4-e79d39955fa8",
|
|
7
|
+
"name": "When clicking \"Execute Workflow\"",
|
|
8
|
+
"type": "n8n-nodes-base.manualTrigger",
|
|
9
|
+
"typeVersion": 1,
|
|
10
|
+
"position": [
|
|
11
|
+
0,
|
|
12
|
+
620
|
|
13
|
+
]
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"parameters": {
|
|
17
|
+
"jsCode": "return [{\n \"output\": \"third\",\n \"text\": \"third output text\"\n}, {\n \"output\": \"fourth\",\n \"text\": \"fourth output text\"\n}, {\n \"output\": \"first\",\n \"text\": \"first output text\"\n}, {\n \"output\": \"second\",\n \"text\": \"second output text\"\n}]"
|
|
18
|
+
},
|
|
19
|
+
"id": "85adf7fc-2d33-49aa-b4bb-2000cce07ce0",
|
|
20
|
+
"name": "Code",
|
|
21
|
+
"type": "n8n-nodes-base.code",
|
|
22
|
+
"typeVersion": 2,
|
|
23
|
+
"position": [
|
|
24
|
+
220,
|
|
25
|
+
620
|
|
26
|
+
]
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"parameters": {},
|
|
30
|
+
"id": "ebab0b65-6feb-416c-828e-ca5e766ea048",
|
|
31
|
+
"name": "No Operation, do nothing",
|
|
32
|
+
"type": "n8n-nodes-base.noOp",
|
|
33
|
+
"typeVersion": 1,
|
|
34
|
+
"position": [
|
|
35
|
+
760,
|
|
36
|
+
460
|
|
37
|
+
]
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"parameters": {},
|
|
41
|
+
"id": "2f58a703-b7ae-4279-a60b-a0243af3b563",
|
|
42
|
+
"name": "No Operation, do nothing1",
|
|
43
|
+
"type": "n8n-nodes-base.noOp",
|
|
44
|
+
"typeVersion": 1,
|
|
45
|
+
"position": [
|
|
46
|
+
760,
|
|
47
|
+
620
|
|
48
|
+
]
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"parameters": {},
|
|
52
|
+
"id": "b1d0b310-6edf-4a40-a66d-689078ddbf31",
|
|
53
|
+
"name": "No Operation, do nothing2",
|
|
54
|
+
"type": "n8n-nodes-base.noOp",
|
|
55
|
+
"typeVersion": 1,
|
|
56
|
+
"position": [
|
|
57
|
+
760,
|
|
58
|
+
780
|
|
59
|
+
]
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"parameters": {
|
|
63
|
+
"mode": "expression",
|
|
64
|
+
"numberOutputs": 3,
|
|
65
|
+
"output": "={{ Math.max(0, ['first', 'second', 'third'].indexOf( $json.output)) }}"
|
|
66
|
+
},
|
|
67
|
+
"id": "437e2c46-81d8-4c76-a036-db767576f55d",
|
|
68
|
+
"name": "Switch",
|
|
69
|
+
"type": "n8n-nodes-base.switch",
|
|
70
|
+
"typeVersion": 3,
|
|
71
|
+
"position": [
|
|
72
|
+
460,
|
|
73
|
+
620
|
|
74
|
+
]
|
|
75
|
+
}
|
|
76
|
+
],
|
|
77
|
+
"pinData": {
|
|
78
|
+
"No Operation, do nothing2": [
|
|
79
|
+
{
|
|
80
|
+
"json": {
|
|
81
|
+
"output": "third",
|
|
82
|
+
"text": "third output text"
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
],
|
|
86
|
+
"No Operation, do nothing1": [
|
|
87
|
+
{
|
|
88
|
+
"json": {
|
|
89
|
+
"output": "second",
|
|
90
|
+
"text": "second output text"
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
],
|
|
94
|
+
"No Operation, do nothing": [
|
|
95
|
+
{
|
|
96
|
+
"json": {
|
|
97
|
+
"output": "fourth",
|
|
98
|
+
"text": "fourth output text"
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
"json": {
|
|
103
|
+
"output": "first",
|
|
104
|
+
"text": "first output text"
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
]
|
|
108
|
+
},
|
|
109
|
+
"connections": {
|
|
110
|
+
"When clicking \"Execute Workflow\"": {
|
|
111
|
+
"main": [
|
|
112
|
+
[
|
|
113
|
+
{
|
|
114
|
+
"node": "Code",
|
|
115
|
+
"type": "main",
|
|
116
|
+
"index": 0
|
|
117
|
+
}
|
|
118
|
+
]
|
|
119
|
+
]
|
|
120
|
+
},
|
|
121
|
+
"Code": {
|
|
122
|
+
"main": [
|
|
123
|
+
[
|
|
124
|
+
{
|
|
125
|
+
"node": "Switch",
|
|
126
|
+
"type": "main",
|
|
127
|
+
"index": 0
|
|
128
|
+
}
|
|
129
|
+
]
|
|
130
|
+
]
|
|
131
|
+
},
|
|
132
|
+
"Switch": {
|
|
133
|
+
"main": [
|
|
134
|
+
[
|
|
135
|
+
{
|
|
136
|
+
"node": "No Operation, do nothing",
|
|
137
|
+
"type": "main",
|
|
138
|
+
"index": 0
|
|
139
|
+
}
|
|
140
|
+
],
|
|
141
|
+
[
|
|
142
|
+
{
|
|
143
|
+
"node": "No Operation, do nothing1",
|
|
144
|
+
"type": "main",
|
|
145
|
+
"index": 0
|
|
146
|
+
}
|
|
147
|
+
],
|
|
148
|
+
[
|
|
149
|
+
{
|
|
150
|
+
"node": "No Operation, do nothing2",
|
|
151
|
+
"type": "main",
|
|
152
|
+
"index": 0
|
|
153
|
+
}
|
|
154
|
+
]
|
|
155
|
+
]
|
|
156
|
+
}
|
|
157
|
+
},
|
|
158
|
+
"active": false,
|
|
159
|
+
"settings": {
|
|
160
|
+
"executionOrder": "v1"
|
|
161
|
+
},
|
|
162
|
+
"versionId": "c72f2f9b-5089-42c2-8939-b70d9467a718",
|
|
163
|
+
"id": "1vDZkJN9SpYXu0Ic",
|
|
164
|
+
"meta": {
|
|
165
|
+
"instanceId": "b888bd11cd1ddbb95450babf3e199556799d999b896f650de768b8370ee50363"
|
|
166
|
+
},
|
|
167
|
+
"tags": []
|
|
168
|
+
}
|