n8n-nodes-base 1.35.0 → 1.37.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/build.tsbuildinfo +1 -1
- package/dist/credentials/icons/jwt.svg +112 -0
- package/dist/credentials/jwtAuth.credentials.d.ts +8 -0
- package/dist/credentials/jwtAuth.credentials.js +135 -0
- package/dist/credentials/jwtAuth.credentials.js.map +1 -0
- package/dist/known/credentials.json +15 -2
- package/dist/known/nodes.json +12 -0
- package/dist/methods/defined.json +3 -0
- package/dist/methods/referenced.json +3 -0
- package/dist/nodes/EmailReadImap/v1/EmailReadImapV1.node.js +10 -15
- package/dist/nodes/EmailReadImap/v1/EmailReadImapV1.node.js.map +1 -1
- package/dist/nodes/EmailReadImap/v2/EmailReadImapV2.node.js +16 -22
- package/dist/nodes/EmailReadImap/v2/EmailReadImapV2.node.js.map +1 -1
- package/dist/nodes/HttpRequest/GenericFunctions.d.ts +1 -0
- package/dist/nodes/HttpRequest/GenericFunctions.js +15 -0
- package/dist/nodes/HttpRequest/GenericFunctions.js.map +1 -1
- package/dist/nodes/HttpRequest/HttpRequest.node.js +2 -1
- package/dist/nodes/HttpRequest/HttpRequest.node.js.map +1 -1
- package/dist/nodes/HttpRequest/V3/HttpRequestV3.node.js +1 -1
- package/dist/nodes/HttpRequest/V3/HttpRequestV3.node.js.map +1 -1
- package/dist/nodes/Jwt/Jwt.node.d.ts +5 -0
- package/dist/nodes/Jwt/Jwt.node.js +410 -0
- package/dist/nodes/Jwt/Jwt.node.js.map +1 -0
- package/dist/nodes/Jwt/Jwt.node.json +19 -0
- package/dist/nodes/Jwt/jwt.svg +112 -0
- package/dist/nodes/Jwt/test/jwt.workflow.json +412 -0
- package/dist/nodes/MySql/MySql.node.js +2 -1
- package/dist/nodes/MySql/MySql.node.js.map +1 -1
- package/dist/nodes/MySql/v2/actions/database/executeQuery.operation.js +6 -0
- package/dist/nodes/MySql/v2/actions/database/executeQuery.operation.js.map +1 -1
- package/dist/nodes/MySql/v2/actions/versionDescription.js +1 -1
- package/dist/nodes/MySql/v2/actions/versionDescription.js.map +1 -1
- package/dist/nodes/Postgres/PostgresTrigger.functions.js +8 -0
- package/dist/nodes/Postgres/PostgresTrigger.functions.js.map +1 -1
- package/dist/nodes/Postgres/PostgresTrigger.node.js +26 -0
- package/dist/nodes/Postgres/PostgresTrigger.node.js.map +1 -1
- package/dist/nodes/Postgres/v2/actions/common.descriptions.js +10 -0
- package/dist/nodes/Postgres/v2/actions/common.descriptions.js.map +1 -1
- package/dist/nodes/Postgres/v2/actions/database/deleteTable.operation.d.ts +3 -3
- package/dist/nodes/Postgres/v2/actions/database/deleteTable.operation.js.map +1 -1
- package/dist/nodes/Postgres/v2/actions/database/executeQuery.operation.d.ts +3 -3
- package/dist/nodes/Postgres/v2/actions/database/executeQuery.operation.js.map +1 -1
- package/dist/nodes/Postgres/v2/actions/database/insert.operation.d.ts +3 -3
- package/dist/nodes/Postgres/v2/actions/database/insert.operation.js.map +1 -1
- package/dist/nodes/Postgres/v2/actions/database/select.operation.d.ts +3 -3
- package/dist/nodes/Postgres/v2/actions/database/select.operation.js.map +1 -1
- package/dist/nodes/Postgres/v2/actions/database/update.operation.d.ts +3 -3
- package/dist/nodes/Postgres/v2/actions/database/update.operation.js +1 -1
- package/dist/nodes/Postgres/v2/actions/database/update.operation.js.map +1 -1
- package/dist/nodes/Postgres/v2/actions/database/upsert.operation.d.ts +3 -3
- package/dist/nodes/Postgres/v2/actions/database/upsert.operation.js.map +1 -1
- package/dist/nodes/Postgres/v2/actions/router.js +1 -1
- package/dist/nodes/Postgres/v2/actions/router.js.map +1 -1
- package/dist/nodes/Postgres/v2/helpers/interfaces.d.ts +31 -0
- package/dist/nodes/Postgres/v2/methods/credentialTest.js.map +1 -1
- package/dist/nodes/Postgres/v2/methods/listSearch.js +2 -2
- package/dist/nodes/Postgres/v2/methods/listSearch.js.map +1 -1
- package/dist/nodes/Postgres/v2/methods/loadOptions.js +1 -1
- package/dist/nodes/Postgres/v2/methods/loadOptions.js.map +1 -1
- package/dist/nodes/Postgres/v2/methods/resourceMapping.js +1 -1
- package/dist/nodes/Postgres/v2/methods/resourceMapping.js.map +1 -1
- package/dist/nodes/Postgres/v2/transport/index.d.ts +2 -3
- package/dist/nodes/Postgres/v2/transport/index.js +4 -0
- package/dist/nodes/Postgres/v2/transport/index.js.map +1 -1
- package/dist/nodes/RespondToWebhook/RespondToWebhook.node.js +76 -3
- package/dist/nodes/RespondToWebhook/RespondToWebhook.node.js.map +1 -1
- package/dist/nodes/Salesforce/GenericFunctions.d.ts +3 -3
- package/dist/nodes/Salesforce/GenericFunctions.js.map +1 -1
- package/dist/nodes/Salesforce/SalesforceTrigger.node.d.ts +10 -0
- package/dist/nodes/Salesforce/SalesforceTrigger.node.js +258 -0
- package/dist/nodes/Salesforce/SalesforceTrigger.node.js.map +1 -0
- package/dist/nodes/Twilio/GenericFunctions.d.ts +2 -1
- package/dist/nodes/Twilio/GenericFunctions.js +14 -1
- package/dist/nodes/Twilio/GenericFunctions.js.map +1 -1
- package/dist/nodes/Twilio/TwilioTrigger.node.d.ts +12 -0
- package/dist/nodes/Twilio/TwilioTrigger.node.js +148 -0
- package/dist/nodes/Twilio/TwilioTrigger.node.js.map +1 -0
- package/dist/nodes/Twilio/TwilioTrigger.node.json +19 -0
- package/dist/nodes/Webhook/Webhook.node.js +83 -17
- package/dist/nodes/Webhook/Webhook.node.js.map +1 -1
- package/dist/nodes/Webhook/description.d.ts +2 -0
- package/dist/nodes/Webhook/description.js +100 -3
- package/dist/nodes/Webhook/description.js.map +1 -1
- package/dist/nodes/Webhook/utils.d.ts +29 -0
- package/dist/nodes/Webhook/utils.js +95 -0
- package/dist/nodes/Webhook/utils.js.map +1 -0
- package/dist/types/credentials.json +1 -0
- package/dist/types/nodes.json +15 -12
- package/dist/utils/utilities.d.ts +1 -1
- package/dist/utils/utilities.js +5 -2
- package/dist/utils/utilities.js.map +1 -1
- package/package.json +8 -5
|
@@ -12,8 +12,11 @@ const uuid_1 = require("uuid");
|
|
|
12
12
|
const basic_auth_1 = __importDefault(require("basic-auth"));
|
|
13
13
|
const isbot_1 = __importDefault(require("isbot"));
|
|
14
14
|
const tmp_promise_1 = require("tmp-promise");
|
|
15
|
+
const jsonwebtoken_1 = __importDefault(require("jsonwebtoken"));
|
|
15
16
|
const description_1 = require("./description");
|
|
16
17
|
const error_1 = require("./error");
|
|
18
|
+
const utils_1 = require("./utils");
|
|
19
|
+
const utilities_1 = require("../../utils/utilities");
|
|
17
20
|
class Webhook extends n8n_workflow_1.Node {
|
|
18
21
|
constructor() {
|
|
19
22
|
super(...arguments);
|
|
@@ -23,7 +26,7 @@ class Webhook extends n8n_workflow_1.Node {
|
|
|
23
26
|
icon: 'file:webhook.svg',
|
|
24
27
|
name: 'webhook',
|
|
25
28
|
group: ['trigger'],
|
|
26
|
-
version: [1, 1.1],
|
|
29
|
+
version: [1, 1.1, 2],
|
|
27
30
|
description: 'Starts the workflow when a webhook is called',
|
|
28
31
|
eventTriggerDescription: 'Waiting for you to call the Test URL',
|
|
29
32
|
activationMessage: 'You can now make calls to your production webhook URL.',
|
|
@@ -37,14 +40,13 @@ class Webhook extends n8n_workflow_1.Node {
|
|
|
37
40
|
inactive: 'Webhooks have two modes: test and production. <br /> <br /> <b>Use test mode while you build your workflow</b>. Click the \'listen\' button, then make a request to the test URL. The executions will show up in the editor.<br /> <br /> <b>Use production mode to run your workflow automatically</b>. <a data-key="activate">Activate</a> the workflow, then make requests to the production URL. These executions will show up in the executions list, but not in the editor.',
|
|
38
41
|
active: 'Webhooks have two modes: test and production. <br /> <br /> <b>Use test mode while you build your workflow</b>. Click the \'listen\' button, then make a request to the test URL. The executions will show up in the editor.<br /> <br /> <b>Use production mode to run your workflow automatically</b>. Since the workflow is activated, you can make requests to the production URL. These executions will show up in the <a data-key="executions">executions list</a>, but not in the editor.',
|
|
39
42
|
},
|
|
40
|
-
activationHint:
|
|
43
|
+
activationHint: "Once you've finished building your workflow, run it without having to click this button by using the production webhook URL.",
|
|
41
44
|
},
|
|
42
45
|
inputs: [],
|
|
43
|
-
outputs:
|
|
46
|
+
outputs: `={{(${utils_1.configuredOutputs})($parameter)}}`,
|
|
44
47
|
credentials: (0, description_1.credentialsProperty)(this.authPropertyName),
|
|
45
48
|
webhooks: [description_1.defaultWebhookDescription],
|
|
46
49
|
properties: [
|
|
47
|
-
(0, description_1.authenticationProperty)(this.authPropertyName),
|
|
48
50
|
description_1.httpMethodsProperty,
|
|
49
51
|
{
|
|
50
52
|
displayName: 'Path',
|
|
@@ -53,8 +55,9 @@ class Webhook extends n8n_workflow_1.Node {
|
|
|
53
55
|
default: '',
|
|
54
56
|
placeholder: 'webhook',
|
|
55
57
|
required: true,
|
|
56
|
-
description:
|
|
58
|
+
description: "The path to listen to, dynamic values could be specified by using ':', e.g. 'your-path/:dynamic-value'. If dynamic values are set 'webhookId' would be prepended to path.",
|
|
57
59
|
},
|
|
60
|
+
(0, description_1.authenticationProperty)(this.authPropertyName),
|
|
58
61
|
description_1.responseModeProperty,
|
|
59
62
|
{
|
|
60
63
|
displayName: 'Insert a \'Respond to Webhook\' node to control when and how you respond. <a href="https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.respondtowebhook/" target="_blank">More details</a>',
|
|
@@ -67,22 +70,53 @@ class Webhook extends n8n_workflow_1.Node {
|
|
|
67
70
|
},
|
|
68
71
|
default: '',
|
|
69
72
|
},
|
|
70
|
-
|
|
73
|
+
{
|
|
74
|
+
...description_1.responseCodeProperty,
|
|
75
|
+
displayOptions: {
|
|
76
|
+
show: {
|
|
77
|
+
'@version': [1, 1.1],
|
|
78
|
+
},
|
|
79
|
+
hide: {
|
|
80
|
+
responseMode: ['responseNode'],
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
},
|
|
71
84
|
description_1.responseDataProperty,
|
|
72
85
|
description_1.responseBinaryPropertyNameProperty,
|
|
73
|
-
|
|
86
|
+
{
|
|
87
|
+
...description_1.optionsProperty,
|
|
88
|
+
options: [...description_1.optionsProperty.options, description_1.responseCodeOption].sort((a, b) => {
|
|
89
|
+
const nameA = a.displayName.toUpperCase();
|
|
90
|
+
const nameB = b.displayName.toUpperCase();
|
|
91
|
+
if (nameA < nameB)
|
|
92
|
+
return -1;
|
|
93
|
+
if (nameA > nameB)
|
|
94
|
+
return 1;
|
|
95
|
+
return 0;
|
|
96
|
+
}),
|
|
97
|
+
},
|
|
74
98
|
],
|
|
75
99
|
};
|
|
76
100
|
}
|
|
77
101
|
async webhook(context) {
|
|
78
102
|
var _a, _b;
|
|
103
|
+
const { typeVersion: nodeVersion, type: nodeType } = context.getNode();
|
|
104
|
+
if (nodeVersion >= 2 && nodeType === 'n8n-nodes-base.webhook') {
|
|
105
|
+
(0, utils_1.checkResponseModeConfiguration)(context);
|
|
106
|
+
}
|
|
79
107
|
const options = context.getNodeParameter('options', {});
|
|
80
108
|
const req = context.getRequestObject();
|
|
81
109
|
const resp = context.getResponseObject();
|
|
110
|
+
if (!(0, utils_1.isIpWhitelisted)(options.ipWhitelist, req.ips, req.ip)) {
|
|
111
|
+
resp.writeHead(403);
|
|
112
|
+
resp.end('IP is not whitelisted to access the webhook!');
|
|
113
|
+
return { noWebhookResponse: true };
|
|
114
|
+
}
|
|
115
|
+
let validationData;
|
|
82
116
|
try {
|
|
83
117
|
if (options.ignoreBots && (0, isbot_1.default)(req.headers['user-agent']))
|
|
84
118
|
throw new error_1.WebhookAuthorizationError(403);
|
|
85
|
-
await this.validateAuth(context);
|
|
119
|
+
validationData = await this.validateAuth(context);
|
|
86
120
|
}
|
|
87
121
|
catch (error) {
|
|
88
122
|
if (error instanceof error_1.WebhookAuthorizationError) {
|
|
@@ -92,16 +126,18 @@ class Webhook extends n8n_workflow_1.Node {
|
|
|
92
126
|
}
|
|
93
127
|
throw error;
|
|
94
128
|
}
|
|
129
|
+
const prepareOutput = (0, utils_1.setupOutputConnection)(context, {
|
|
130
|
+
jwtPayload: validationData,
|
|
131
|
+
});
|
|
95
132
|
if (options.binaryData) {
|
|
96
|
-
return await this.handleBinaryData(context);
|
|
133
|
+
return await this.handleBinaryData(context, prepareOutput);
|
|
97
134
|
}
|
|
98
135
|
if (req.contentType === 'multipart/form-data') {
|
|
99
|
-
return await this.handleFormData(context);
|
|
136
|
+
return await this.handleFormData(context, prepareOutput);
|
|
100
137
|
}
|
|
101
|
-
const nodeVersion = context.getNode().typeVersion;
|
|
102
138
|
if (nodeVersion > 1 && !req.body && !options.rawBody) {
|
|
103
139
|
try {
|
|
104
|
-
return await this.handleBinaryData(context);
|
|
140
|
+
return await this.handleBinaryData(context, prepareOutput);
|
|
105
141
|
}
|
|
106
142
|
catch (error) { }
|
|
107
143
|
}
|
|
@@ -126,7 +162,7 @@ class Webhook extends n8n_workflow_1.Node {
|
|
|
126
162
|
};
|
|
127
163
|
return {
|
|
128
164
|
webhookResponse: options.responseData,
|
|
129
|
-
workflowData:
|
|
165
|
+
workflowData: prepareOutput(response),
|
|
130
166
|
};
|
|
131
167
|
}
|
|
132
168
|
async validateAuth(context) {
|
|
@@ -167,8 +203,38 @@ class Webhook extends n8n_workflow_1.Node {
|
|
|
167
203
|
throw new error_1.WebhookAuthorizationError(403);
|
|
168
204
|
}
|
|
169
205
|
}
|
|
206
|
+
else if (authentication === 'jwtAuth') {
|
|
207
|
+
let expectedAuth;
|
|
208
|
+
try {
|
|
209
|
+
expectedAuth = (await context.getCredentials('jwtAuth'));
|
|
210
|
+
}
|
|
211
|
+
catch { }
|
|
212
|
+
if (expectedAuth === undefined) {
|
|
213
|
+
throw new error_1.WebhookAuthorizationError(500, 'No authentication data defined on node!');
|
|
214
|
+
}
|
|
215
|
+
const authHeader = req.headers.authorization;
|
|
216
|
+
const token = authHeader && authHeader.split(' ')[1];
|
|
217
|
+
if (!token) {
|
|
218
|
+
throw new error_1.WebhookAuthorizationError(401, 'No token provided');
|
|
219
|
+
}
|
|
220
|
+
let secretOrPublicKey;
|
|
221
|
+
if (expectedAuth.keyType === 'passphrase') {
|
|
222
|
+
secretOrPublicKey = expectedAuth.secret;
|
|
223
|
+
}
|
|
224
|
+
else {
|
|
225
|
+
secretOrPublicKey = (0, utilities_1.formatPrivateKey)(expectedAuth.publicKey, true);
|
|
226
|
+
}
|
|
227
|
+
try {
|
|
228
|
+
return jsonwebtoken_1.default.verify(token, secretOrPublicKey, {
|
|
229
|
+
algorithms: [expectedAuth.algorithm],
|
|
230
|
+
});
|
|
231
|
+
}
|
|
232
|
+
catch (error) {
|
|
233
|
+
throw new error_1.WebhookAuthorizationError(403, error.message);
|
|
234
|
+
}
|
|
235
|
+
}
|
|
170
236
|
}
|
|
171
|
-
async handleFormData(context) {
|
|
237
|
+
async handleFormData(context, prepareOutput) {
|
|
172
238
|
var _a;
|
|
173
239
|
const req = context.getRequestObject();
|
|
174
240
|
const options = context.getNodeParameter('options', {});
|
|
@@ -211,9 +277,9 @@ class Webhook extends n8n_workflow_1.Node {
|
|
|
211
277
|
count += 1;
|
|
212
278
|
}
|
|
213
279
|
}
|
|
214
|
-
return { workflowData:
|
|
280
|
+
return { workflowData: prepareOutput(returnItem) };
|
|
215
281
|
}
|
|
216
|
-
async handleBinaryData(context) {
|
|
282
|
+
async handleBinaryData(context, prepareOutput) {
|
|
217
283
|
var _a, _b, _c, _d;
|
|
218
284
|
const req = context.getRequestObject();
|
|
219
285
|
const options = context.getNodeParameter('options', {});
|
|
@@ -235,7 +301,7 @@ class Webhook extends n8n_workflow_1.Node {
|
|
|
235
301
|
const binaryData = await context.nodeHelpers.copyBinaryFile(binaryFile.path, fileName, (_d = req.contentType) !== null && _d !== void 0 ? _d : 'application/octet-stream');
|
|
236
302
|
returnItem.binary = { [binaryPropertyName]: binaryData };
|
|
237
303
|
}
|
|
238
|
-
return { workflowData:
|
|
304
|
+
return { workflowData: prepareOutput(returnItem) };
|
|
239
305
|
}
|
|
240
306
|
catch (error) {
|
|
241
307
|
throw new n8n_workflow_1.NodeOperationError(context.getNode(), error);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Webhook.node.js","sourceRoot":"","sources":["../../../nodes/Webhook/Webhook.node.ts"],"names":[],"mappings":";;;;;;AACA,8CAA2C;AAC3C,2BAAuC;AACvC,0CAAmC;
|
|
1
|
+
{"version":3,"file":"Webhook.node.js","sourceRoot":"","sources":["../../../nodes/Webhook/Webhook.node.ts"],"names":[],"mappings":";;;;;;AACA,8CAA2C;AAC3C,2BAAuC;AACvC,0CAAmC;AAWnC,+CAAyE;AAEzE,+BAAkC;AAClC,4DAAmC;AACnC,kDAA0B;AAC1B,6CAA8C;AAC9C,gEAA+B;AAE/B,+CAWuB;AACvB,mCAAoD;AACpD,mCAKiB;AACjB,qDAAyD;AAEzD,MAAa,OAAQ,SAAQ,mBAAI;IAAjC;;QACC,qBAAgB,GAAG,gBAAgB,CAAC;QAEpC,gBAAW,GAAyB;YACnC,WAAW,EAAE,SAAS;YACtB,IAAI,EAAE,kBAAkB;YACxB,IAAI,EAAE,SAAS;YACf,KAAK,EAAE,CAAC,SAAS,CAAC;YAClB,OAAO,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC;YACpB,WAAW,EAAE,8CAA8C;YAC3D,uBAAuB,EAAE,sCAAsC;YAC/D,iBAAiB,EAAE,wDAAwD;YAC3E,QAAQ,EAAE;gBACT,IAAI,EAAE,SAAS;aACf;YACD,YAAY,EAAE,IAAI;YAClB,YAAY,EAAE;gBACb,MAAM,EAAE,EAAE;gBACV,cAAc,EAAE;oBACf,QAAQ,EACP,mdAAmd;oBACpd,MAAM,EACL,keAAke;iBACne;gBACD,cAAc,EACb,8HAA8H;aAC/H;YAED,MAAM,EAAE,EAAE;YACV,OAAO,EAAE,OAAO,yBAAiB,iBAAiB;YAClD,WAAW,EAAE,IAAA,iCAAmB,EAAC,IAAI,CAAC,gBAAgB,CAAC;YACvD,QAAQ,EAAE,CAAC,uCAAyB,CAAC;YACrC,UAAU,EAAE;gBACX,iCAAmB;gBACnB;oBACC,W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OAAO,KAAK,EAAE,CAAC;YAChB,MAAM,IAAI,iCAAkB,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,KAAc,CAAC,CAAC;QACjE,CAAC;gBAAS,CAAC;YACV,MAAM,UAAU,CAAC,OAAO,EAAE,CAAC;QAC5B,CAAC;IACF,CAAC;CACD;AAvWD,0BAuWC"}
|
|
@@ -8,3 +8,5 @@ export declare const responseModeProperty: INodeProperties;
|
|
|
8
8
|
export declare const responseDataProperty: INodeProperties;
|
|
9
9
|
export declare const responseBinaryPropertyNameProperty: INodeProperties;
|
|
10
10
|
export declare const optionsProperty: INodeProperties;
|
|
11
|
+
export declare const responseCodeSelector: INodeProperties;
|
|
12
|
+
export declare const responseCodeOption: INodeProperties;
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.optionsProperty = exports.responseBinaryPropertyNameProperty = exports.responseDataProperty = exports.responseModeProperty = exports.responseCodeProperty = exports.httpMethodsProperty = exports.authenticationProperty = exports.credentialsProperty = exports.defaultWebhookDescription = void 0;
|
|
3
|
+
exports.responseCodeOption = exports.responseCodeSelector = exports.optionsProperty = exports.responseBinaryPropertyNameProperty = exports.responseDataProperty = exports.responseModeProperty = exports.responseCodeProperty = exports.httpMethodsProperty = exports.authenticationProperty = exports.credentialsProperty = exports.defaultWebhookDescription = void 0;
|
|
4
|
+
const utils_1 = require("./utils");
|
|
4
5
|
exports.defaultWebhookDescription = {
|
|
5
6
|
name: 'default',
|
|
6
7
|
httpMethod: '={{$parameter["httpMethod"] || "GET"}}',
|
|
7
8
|
isFullPath: true,
|
|
8
|
-
responseCode:
|
|
9
|
+
responseCode: `={{(${utils_1.getResponseCode})($parameter)}}`,
|
|
9
10
|
responseMode: '={{$parameter["responseMode"]}}',
|
|
10
|
-
responseData:
|
|
11
|
+
responseData: `={{(${utils_1.getResponseData})($parameter)}}`,
|
|
11
12
|
responseBinaryPropertyName: '={{$parameter["responseBinaryPropertyName"]}}',
|
|
12
13
|
responseContentType: '={{$parameter["options"]["responseContentType"]}}',
|
|
13
14
|
responsePropertyName: '={{$parameter["options"]["responsePropertyName"]}}',
|
|
@@ -33,6 +34,15 @@ const credentialsProperty = (propertyName = 'authentication') => [
|
|
|
33
34
|
},
|
|
34
35
|
},
|
|
35
36
|
},
|
|
37
|
+
{
|
|
38
|
+
name: 'jwtAuth',
|
|
39
|
+
required: true,
|
|
40
|
+
displayOptions: {
|
|
41
|
+
show: {
|
|
42
|
+
[propertyName]: ['jwtAuth'],
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
},
|
|
36
46
|
];
|
|
37
47
|
exports.credentialsProperty = credentialsProperty;
|
|
38
48
|
const authenticationProperty = (propertyName = 'authentication') => ({
|
|
@@ -48,6 +58,10 @@ const authenticationProperty = (propertyName = 'authentication') => ({
|
|
|
48
58
|
name: 'Header Auth',
|
|
49
59
|
value: 'headerAuth',
|
|
50
60
|
},
|
|
61
|
+
{
|
|
62
|
+
name: 'JWT Auth',
|
|
63
|
+
value: 'jwtAuth',
|
|
64
|
+
},
|
|
51
65
|
{
|
|
52
66
|
name: 'None',
|
|
53
67
|
value: 'none',
|
|
@@ -230,6 +244,14 @@ exports.optionsProperty = {
|
|
|
230
244
|
default: false,
|
|
231
245
|
description: 'Whether to ignore requests from bots like link previewers and web crawlers',
|
|
232
246
|
},
|
|
247
|
+
{
|
|
248
|
+
displayName: 'IP(s) Whitelist',
|
|
249
|
+
name: 'ipWhitelist',
|
|
250
|
+
type: 'string',
|
|
251
|
+
placeholder: 'e.g. 127.0.0.1',
|
|
252
|
+
default: '',
|
|
253
|
+
description: 'Comma-separated list of allowed IP addresses. Leave empty to allow all IPs.',
|
|
254
|
+
},
|
|
233
255
|
{
|
|
234
256
|
displayName: 'No Response Body',
|
|
235
257
|
name: 'noResponseBody',
|
|
@@ -352,4 +374,79 @@ exports.optionsProperty = {
|
|
|
352
374
|
},
|
|
353
375
|
],
|
|
354
376
|
};
|
|
377
|
+
exports.responseCodeSelector = {
|
|
378
|
+
displayName: 'Response Code',
|
|
379
|
+
name: 'responseCode',
|
|
380
|
+
type: 'options',
|
|
381
|
+
options: [
|
|
382
|
+
{ name: '200', value: 200, description: 'OK - Request has succeeded' },
|
|
383
|
+
{ name: '201', value: 201, description: 'Created - Request has been fulfilled' },
|
|
384
|
+
{ name: '204', value: 204, description: 'No Content - Request processed, no content returned' },
|
|
385
|
+
{
|
|
386
|
+
name: '301',
|
|
387
|
+
value: 301,
|
|
388
|
+
description: 'Moved Permanently - Requested resource moved permanently',
|
|
389
|
+
},
|
|
390
|
+
{ name: '302', value: 302, description: 'Found - Requested resource moved temporarily' },
|
|
391
|
+
{ name: '304', value: 304, description: 'Not Modified - Resource has not been modified' },
|
|
392
|
+
{ name: '400', value: 400, description: 'Bad Request - Request could not be understood' },
|
|
393
|
+
{ name: '401', value: 401, description: 'Unauthorized - Request requires user authentication' },
|
|
394
|
+
{
|
|
395
|
+
name: '403',
|
|
396
|
+
value: 403,
|
|
397
|
+
description: 'Forbidden - Server understood, but refuses to fulfill',
|
|
398
|
+
},
|
|
399
|
+
{ name: '404', value: 404, description: 'Not Found - Server has not found a match' },
|
|
400
|
+
{
|
|
401
|
+
name: 'Custom Code',
|
|
402
|
+
value: 'customCode',
|
|
403
|
+
description: 'Write any HTTP code',
|
|
404
|
+
},
|
|
405
|
+
],
|
|
406
|
+
default: 200,
|
|
407
|
+
description: 'The HTTP response code to return',
|
|
408
|
+
};
|
|
409
|
+
exports.responseCodeOption = {
|
|
410
|
+
displayName: 'Response Code',
|
|
411
|
+
name: 'responseCode',
|
|
412
|
+
placeholder: 'Add Response Code',
|
|
413
|
+
type: 'fixedCollection',
|
|
414
|
+
default: {
|
|
415
|
+
values: {
|
|
416
|
+
responseCode: 200,
|
|
417
|
+
},
|
|
418
|
+
},
|
|
419
|
+
options: [
|
|
420
|
+
{
|
|
421
|
+
name: 'values',
|
|
422
|
+
displayName: 'Values',
|
|
423
|
+
values: [
|
|
424
|
+
exports.responseCodeSelector,
|
|
425
|
+
{
|
|
426
|
+
displayName: 'Code',
|
|
427
|
+
name: 'customCode',
|
|
428
|
+
type: 'number',
|
|
429
|
+
default: 200,
|
|
430
|
+
placeholder: 'e.g. 400',
|
|
431
|
+
typeOptions: {
|
|
432
|
+
minValue: 100,
|
|
433
|
+
},
|
|
434
|
+
displayOptions: {
|
|
435
|
+
show: {
|
|
436
|
+
responseCode: ['customCode'],
|
|
437
|
+
},
|
|
438
|
+
},
|
|
439
|
+
},
|
|
440
|
+
],
|
|
441
|
+
},
|
|
442
|
+
],
|
|
443
|
+
displayOptions: {
|
|
444
|
+
show: {
|
|
445
|
+
'@version': [{ _cnd: { gte: 2 } }],
|
|
446
|
+
},
|
|
447
|
+
hide: {
|
|
448
|
+
'/responseMode': ['responseNode'],
|
|
449
|
+
},
|
|
450
|
+
},
|
|
451
|
+
};
|
|
355
452
|
//# sourceMappingURL=description.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"description.js","sourceRoot":"","sources":["../../../nodes/Webhook/description.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"description.js","sourceRoot":"","sources":["../../../nodes/Webhook/description.ts"],"names":[],"mappings":";;;AACA,mCAA2D;AAE9C,QAAA,yBAAyB,GAAwB;IAC7D,IAAI,EAAE,SAAS;IACf,UAAU,EAAE,wCAAwC;IACpD,UAAU,EAAE,IAAI;IAChB,YAAY,EAAE,OAAO,uBAAe,iBAAiB;IACrD,YAAY,EAAE,iCAAiC;IAC/C,YAAY,EAAE,OAAO,uBAAe,iBAAiB;IACrD,0BAA0B,EAAE,+CAA+C;IAC3E,mBAAmB,EAAE,mDAAmD;IACxE,oBAAoB,EAAE,oDAAoD;IAC1E,eAAe,EAAE,+CAA+C;IAChE,IAAI,EAAE,yBAAyB;CAC/B,CAAC;AAEK,MAAM,mBAAmB,GAAG,CAClC,YAAY,GAAG,gBAAgB,EACO,EA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;KACD;CACD,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { IWebhookFunctions, INodeExecutionData, IDataObject } from 'n8n-workflow';
|
|
2
|
+
type WebhookParameters = {
|
|
3
|
+
httpMethod: string;
|
|
4
|
+
responseMode: string;
|
|
5
|
+
responseData: string;
|
|
6
|
+
responseCode?: number;
|
|
7
|
+
options?: {
|
|
8
|
+
responseData?: string;
|
|
9
|
+
responseCode?: {
|
|
10
|
+
values?: {
|
|
11
|
+
responseCode: number;
|
|
12
|
+
customCode?: number;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
noResponseBody?: boolean;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
export declare const getResponseCode: (parameters: WebhookParameters) => number;
|
|
19
|
+
export declare const getResponseData: (parameters: WebhookParameters) => string | undefined;
|
|
20
|
+
export declare const configuredOutputs: (parameters: WebhookParameters) => {
|
|
21
|
+
type: string;
|
|
22
|
+
displayName: string;
|
|
23
|
+
}[];
|
|
24
|
+
export declare const setupOutputConnection: (ctx: IWebhookFunctions, additionalData: {
|
|
25
|
+
jwtPayload?: IDataObject;
|
|
26
|
+
}) => (outputData: INodeExecutionData) => INodeExecutionData[][];
|
|
27
|
+
export declare const isIpWhitelisted: (whitelist: string | string[] | undefined, ips: string[], ip?: string) => boolean;
|
|
28
|
+
export declare const checkResponseModeConfiguration: (context: IWebhookFunctions) => void;
|
|
29
|
+
export {};
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.checkResponseModeConfiguration = exports.isIpWhitelisted = exports.setupOutputConnection = exports.configuredOutputs = exports.getResponseData = exports.getResponseCode = void 0;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const getResponseCode = (parameters) => {
|
|
6
|
+
var _a;
|
|
7
|
+
if (parameters.responseCode) {
|
|
8
|
+
return parameters.responseCode;
|
|
9
|
+
}
|
|
10
|
+
const responseCodeOptions = parameters.options;
|
|
11
|
+
if ((_a = responseCodeOptions === null || responseCodeOptions === void 0 ? void 0 : responseCodeOptions.responseCode) === null || _a === void 0 ? void 0 : _a.values) {
|
|
12
|
+
const { responseCode, customCode } = responseCodeOptions.responseCode.values;
|
|
13
|
+
if (customCode) {
|
|
14
|
+
return customCode;
|
|
15
|
+
}
|
|
16
|
+
return responseCode;
|
|
17
|
+
}
|
|
18
|
+
return 200;
|
|
19
|
+
};
|
|
20
|
+
exports.getResponseCode = getResponseCode;
|
|
21
|
+
const getResponseData = (parameters) => {
|
|
22
|
+
const { responseData, responseMode, options } = parameters;
|
|
23
|
+
if (responseData)
|
|
24
|
+
return responseData;
|
|
25
|
+
if (responseMode === 'onReceived') {
|
|
26
|
+
const data = options === null || options === void 0 ? void 0 : options.responseData;
|
|
27
|
+
if (data)
|
|
28
|
+
return data;
|
|
29
|
+
}
|
|
30
|
+
if (options === null || options === void 0 ? void 0 : options.noResponseBody)
|
|
31
|
+
return 'noData';
|
|
32
|
+
return undefined;
|
|
33
|
+
};
|
|
34
|
+
exports.getResponseData = getResponseData;
|
|
35
|
+
const configuredOutputs = (parameters) => {
|
|
36
|
+
const httpMethod = parameters.httpMethod;
|
|
37
|
+
return [
|
|
38
|
+
{
|
|
39
|
+
type: `${"main"}`,
|
|
40
|
+
displayName: httpMethod,
|
|
41
|
+
},
|
|
42
|
+
];
|
|
43
|
+
};
|
|
44
|
+
exports.configuredOutputs = configuredOutputs;
|
|
45
|
+
const setupOutputConnection = (ctx, additionalData) => {
|
|
46
|
+
let webhookUrl = ctx.getNodeWebhookUrl('default');
|
|
47
|
+
const executionMode = ctx.getMode() === 'manual' ? 'test' : 'production';
|
|
48
|
+
if (executionMode === 'test') {
|
|
49
|
+
webhookUrl = webhookUrl.replace('/webhook/', '/webhook-test/');
|
|
50
|
+
}
|
|
51
|
+
return (outputData) => {
|
|
52
|
+
outputData.json.webhookUrl = webhookUrl;
|
|
53
|
+
outputData.json.executionMode = executionMode;
|
|
54
|
+
if (additionalData === null || additionalData === void 0 ? void 0 : additionalData.jwtPayload) {
|
|
55
|
+
outputData.json.jwtPayload = additionalData.jwtPayload;
|
|
56
|
+
}
|
|
57
|
+
return [[outputData]];
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
exports.setupOutputConnection = setupOutputConnection;
|
|
61
|
+
const isIpWhitelisted = (whitelist, ips, ip) => {
|
|
62
|
+
if (whitelist === undefined || whitelist === '') {
|
|
63
|
+
return true;
|
|
64
|
+
}
|
|
65
|
+
if (!Array.isArray(whitelist)) {
|
|
66
|
+
whitelist = whitelist.split(',').map((entry) => entry.trim());
|
|
67
|
+
}
|
|
68
|
+
for (const address of whitelist) {
|
|
69
|
+
if (ip && ip.includes(address)) {
|
|
70
|
+
return true;
|
|
71
|
+
}
|
|
72
|
+
if (ips.some((entry) => entry.includes(address))) {
|
|
73
|
+
return true;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
return false;
|
|
77
|
+
};
|
|
78
|
+
exports.isIpWhitelisted = isIpWhitelisted;
|
|
79
|
+
const checkResponseModeConfiguration = (context) => {
|
|
80
|
+
const responseMode = context.getNodeParameter('responseMode', 'onReceived');
|
|
81
|
+
const connectedNodes = context.getChildNodes(context.getNode().name);
|
|
82
|
+
const isRespondToWebhookConnected = connectedNodes.some((node) => node.type === 'n8n-nodes-base.respondToWebhook');
|
|
83
|
+
if (!isRespondToWebhookConnected && responseMode === 'responseNode') {
|
|
84
|
+
throw new n8n_workflow_1.NodeOperationError(context.getNode(), new Error('No Respond to Webhook node found in the workflow'), {
|
|
85
|
+
description: 'Insert a Respond to Webhook node to your workflow to respond to the webhook or choose another option for the “Respond” parameter',
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
if (isRespondToWebhookConnected && responseMode !== 'responseNode') {
|
|
89
|
+
throw new n8n_workflow_1.NodeOperationError(context.getNode(), new Error('Webhook node not correctly configured'), {
|
|
90
|
+
description: 'Set the “Respond” parameter to “Using Respond to Webhook Node” or remove the Respond to Webhook node',
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
exports.checkResponseModeConfiguration = checkResponseModeConfiguration;
|
|
95
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../nodes/Webhook/utils.ts"],"names":[],"mappings":";;;AAAA,+CAAsE;AAoB/D,MAAM,eAAe,GAAG,CAAC,UAA6B,EAAE,EAAE;;IAChE,IAAI,UAAU,CAAC,YAAY,EAAE,CAAC;QAC7B,OAAO,UAAU,CAAC,YAAY,CAAC;IAChC,CAAC;IACD,MAAM,mBAAmB,GAAG,UAAU,CAAC,OAAO,CAAC;IAC/C,IAAI,MAAA,mBAAmB,aAAnB,mBAAmB,uBAAnB,mBAAmB,CAAE,YAAY,0CAAE,MAAM,EAAE,CAAC;QAC/C,MAAM,EAAE,YAAY,EAAE,UAAU,EAAE,GAAG,mBAAmB,CAAC,YAAY,CAAC,MAAM,CAAC;QAE7E,IAAI,UAAU,EAAE,CAAC;YAChB,OAAO,UAAU,CAAC;QACnB,CAAC;QAED,OAAO,YAAY,CAAC;IACrB,CAAC;IACD,OAAO,GAAG,CAAC;AACZ,CAAC,CAAC;AAfW,QAAA,eAAe,mBAe1B;AAEK,MAAM,eAAe,GAAG,CAAC,UAA6B,EAAE,EAAE;IAChE,MAAM,EAAE,YAAY,EAAE,YAAY,EAAE,OAAO,EAAE,GAAG,UAAU,CAAC;IAC3D,IAAI,YAAY;QAAE,OAAO,YAAY,CAAC;IAEtC,IAAI,YAAY,KAAK,YAAY,EAAE,CAAC;QACnC,MAAM,IAAI,GAAG,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,YAAY,CAAC;QACnC,IAAI,IAAI;YAAE,OAAO,IAAI,CAAC;IACvB,CAAC;IAED,IAAI,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,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IACH,CAAC;IAED,IAAI,2BAA2B,IAAI,YAAY,KAAK,cAAc,EAAE,CAAC;QACpE,MAAM,IAAI,iCAAkB,CAC3B,OAAO,CAAC,OAAO,EAAE,EACjB,IAAI,KAAK,CAAC,uCAAuC,CAAC,EAClD;YACC,WAAW,EACV,sGAAsG;SACvG,CACD,CAAC;IACH,CAAC;AACF,CAAC,CAAC;AA7BW,QAAA,8BAA8B,kCA6BzC"}
|
|
@@ -152,6 +152,7 @@
|
|
|
152
152
|
{"name":"jiraSoftwareCloudApi","displayName":"Jira SW Cloud API","documentationUrl":"jira","properties":[{"displayName":"Email","name":"email","type":"string","placeholder":"name@email.com","default":""},{"displayName":"API Token","name":"apiToken","type":"string","typeOptions":{"password":true},"default":""},{"displayName":"Domain","name":"domain","type":"string","default":"","placeholder":"https://example.atlassian.net"}],"authenticate":{"type":"generic","properties":{"auth":{"username":"={{$credentials.email}}","password":"={{$credentials.apiToken}}"}}},"test":{"request":{"baseURL":"={{$credentials?.domain}}","url":"/rest/api/2/project"}}},
|
|
153
153
|
{"name":"jiraSoftwareServerApi","displayName":"Jira SW Server API","documentationUrl":"jira","properties":[{"displayName":"Email","name":"email","type":"string","placeholder":"name@email.com","default":""},{"displayName":"Password","name":"password","typeOptions":{"password":true},"type":"string","default":""},{"displayName":"Domain","name":"domain","type":"string","default":"","placeholder":"https://example.com"}],"authenticate":{"type":"generic","properties":{"auth":{"username":"={{$credentials.email}}","password":"={{$credentials.password}}"}}},"test":{"request":{"baseURL":"={{$credentials?.domain}}","url":"/rest/api/2/project"}}},
|
|
154
154
|
{"name":"jotFormApi","displayName":"JotForm API","documentationUrl":"jotForm","properties":[{"displayName":"API Key","name":"apiKey","type":"string","typeOptions":{"password":true},"default":""},{"displayName":"API Domain","name":"apiDomain","type":"options","options":[{"name":"api.jotform.com","value":"api.jotform.com"},{"name":"eu-api.jotform.com","value":"eu-api.jotform.com"},{"name":"hipaa-api.jotform.com","value":"hipaa-api.jotform.com"}],"default":"api.jotform.com","description":"The API domain to use. Use \"eu-api.jotform.com\" if your account is in based in Europe."}]},
|
|
155
|
+
{"name":"jwtAuth","displayName":"JWT Auth","documentationUrl":"jwtAuth","properties":[{"displayName":"Key Type","name":"keyType","type":"options","description":"Choose either the secret passphrase or PEM encoded public keys","options":[{"name":"Passphrase","value":"passphrase"},{"name":"PEM Key","value":"pemKey"}],"default":"passphrase"},{"displayName":"Secret","name":"secret","type":"string","typeOptions":{"password":true},"default":"","displayOptions":{"show":{"keyType":["passphrase"]}}},{"displayName":"Private Key","name":"privateKey","type":"string","typeOptions":{"password":true},"displayOptions":{"show":{"keyType":["pemKey"]}},"default":""},{"displayName":"Public Key","name":"publicKey","type":"string","typeOptions":{"password":true},"displayOptions":{"show":{"keyType":["pemKey"]}},"default":""},{"displayName":"Algorithm","name":"algorithm","type":"options","default":"HS256","options":[{"name":"HS256","value":"HS256"},{"name":"HS384","value":"HS384"},{"name":"HS512","value":"HS512"},{"name":"RS256","value":"RS256"},{"name":"RS384","value":"RS384"},{"name":"RS512","value":"RS512"},{"name":"ES256","value":"ES256"},{"name":"ES384","value":"ES384"},{"name":"ES512","value":"ES512"},{"name":"PS256","value":"PS256"},{"name":"PS384","value":"PS384"},{"name":"PS512","value":"PS512"},{"name":"none","value":"none"}]}],"iconUrl":"icons/n8n-nodes-base/dist/credentials/icons/jwt.svg"},
|
|
155
156
|
{"name":"kafka","displayName":"Kafka","documentationUrl":"kafka","properties":[{"displayName":"Client ID","name":"clientId","type":"string","default":"","placeholder":"my-app","hint":"Will not affect the connection, but will be used to identify the client in the Kafka server logs. Read more <a href=\"https://kafka.apache.org/documentation/#design_quotasgroups\">here</a>"},{"displayName":"Brokers","name":"brokers","type":"string","default":"","placeholder":"kafka1:9092,kafka2:9092"},{"displayName":"SSL","name":"ssl","type":"boolean","default":true},{"displayName":"Authentication","name":"authentication","type":"boolean","default":false},{"displayName":"Username","name":"username","type":"string","displayOptions":{"show":{"authentication":[true]}},"default":"","description":"Optional username if authenticated is required"},{"displayName":"Password","name":"password","type":"string","displayOptions":{"show":{"authentication":[true]}},"typeOptions":{"password":true},"default":"","description":"Optional password if authenticated is required"},{"displayName":"SASL Mechanism","name":"saslMechanism","type":"options","displayOptions":{"show":{"authentication":[true]}},"options":[{"name":"Plain","value":"plain"},{"name":"scram-sha-256","value":"scram-sha-256"},{"name":"scram-sha-512","value":"scram-sha-512"}],"default":"plain"}]},
|
|
156
157
|
{"name":"keapOAuth2Api","extends":["oAuth2Api"],"displayName":"Keap OAuth2 API","documentationUrl":"keap","properties":[{"displayName":"Grant Type","name":"grantType","type":"hidden","default":"authorizationCode"},{"displayName":"Authorization URL","name":"authUrl","type":"hidden","default":"https://signin.infusionsoft.com/app/oauth/authorize"},{"displayName":"Access Token URL","name":"accessTokenUrl","type":"hidden","default":"https://api.infusionsoft.com/token"},{"displayName":"Scope","name":"scope","type":"hidden","default":"full"},{"displayName":"Auth URI Query Parameters","name":"authQueryParameters","type":"hidden","default":""},{"displayName":"Authentication","name":"authentication","type":"hidden","default":"body"}]},
|
|
157
158
|
{"name":"kibanaApi","displayName":"Kibana API","documentationUrl":"kibana","httpRequestNode":{"name":"Kibana","docsUrl":"https://www.elastic.co/guide/en/kibana/current/api.html","apiBaseUrl":""},"properties":[{"displayName":"URL","name":"url","type":"string","required":true,"default":"","placeholder":"http://localhost:5601"},{"displayName":"Username","name":"username","type":"string","required":true,"default":""},{"displayName":"Password","name":"password","type":"string","typeOptions":{"password":true},"required":true,"default":""}],"authenticate":{"type":"generic","properties":{"headers":{"kbn-xsrf":true},"auth":{"username":"={{$credentials.username}}","password":"={{$credentials.password}}"}}},"test":{"request":{"baseURL":"={{$credentials.url}}","url":"/api/features"}},"iconUrl":"icons/n8n-nodes-base/dist/credentials/icons/Kibana.svg"},
|