n8n-nodes-base 0.233.0 → 0.234.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/{SendInBlueApi.credentials.d.ts → BrevoApi.credentials.d.ts} +1 -1
- package/dist/credentials/{SendInBlueApi.credentials.js → BrevoApi.credentials.js} +7 -7
- package/dist/credentials/BrevoApi.credentials.js.map +1 -0
- package/dist/credentials/CrowdDevApi.credentials.d.ts +9 -0
- package/dist/credentials/CrowdDevApi.credentials.js +62 -0
- package/dist/credentials/CrowdDevApi.credentials.js.map +1 -0
- package/dist/credentials/HttpCustomAuth.credentials.d.ts +9 -0
- package/dist/credentials/HttpCustomAuth.credentials.js +25 -0
- package/dist/credentials/HttpCustomAuth.credentials.js.map +1 -0
- package/dist/credentials/TwitterOAuth1Api.credentials.js +6 -0
- package/dist/credentials/TwitterOAuth1Api.credentials.js.map +1 -1
- package/dist/credentials/TwitterOAuth2Api.credentials.d.ts +8 -0
- package/dist/credentials/TwitterOAuth2Api.credentials.js +73 -0
- package/dist/credentials/TwitterOAuth2Api.credentials.js.map +1 -0
- package/dist/known/credentials.json +289 -12
- package/dist/known/nodes.json +16 -8
- package/dist/nodes/{SendInBlue → Brevo}/AttributeDescription.js +1 -1
- package/dist/nodes/Brevo/AttributeDescription.js.map +1 -0
- package/dist/nodes/{SendInBlue/SendInBlue.node.d.ts → Brevo/Brevo.node.d.ts} +1 -1
- package/dist/nodes/{SendInBlue/SendInBlue.node.js → Brevo/Brevo.node.js} +9 -9
- package/dist/nodes/Brevo/Brevo.node.js.map +1 -0
- package/dist/nodes/{SendInBlue/SendInBlue.node.json → Brevo/Brevo.node.json} +5 -4
- package/dist/nodes/{SendInBlue/SendInBlueTrigger.node.d.ts → Brevo/BrevoTrigger.node.d.ts} +1 -1
- package/dist/nodes/{SendInBlue/SendInBlueTrigger.node.js → Brevo/BrevoTrigger.node.js} +11 -11
- package/dist/nodes/Brevo/BrevoTrigger.node.js.map +1 -0
- package/dist/nodes/{SendInBlue/SendInBlueTrigger.node.json → Brevo/BrevoTrigger.node.json} +5 -4
- package/dist/nodes/Brevo/ContactDescription.js.map +1 -0
- package/dist/nodes/{SendInBlue → Brevo}/EmailDescription.js +10 -10
- package/dist/nodes/Brevo/EmailDescription.js.map +1 -0
- package/dist/nodes/{SendInBlue → Brevo}/GenericFunctions.d.ts +2 -2
- package/dist/nodes/{SendInBlue → Brevo}/GenericFunctions.js +14 -14
- package/dist/nodes/Brevo/GenericFunctions.js.map +1 -0
- package/dist/nodes/Brevo/SenderDescrition.js.map +1 -0
- package/dist/nodes/Brevo/brevo.svg +4 -0
- package/dist/nodes/CrowdDev/CrowdDev.node.d.ts +4 -0
- package/dist/nodes/CrowdDev/CrowdDev.node.js +36 -0
- package/dist/nodes/CrowdDev/CrowdDev.node.js.map +1 -0
- package/dist/nodes/CrowdDev/CrowdDev.node.json +18 -0
- package/dist/nodes/CrowdDev/CrowdDevTrigger.node.d.ts +12 -0
- package/dist/nodes/CrowdDev/CrowdDevTrigger.node.js +145 -0
- package/dist/nodes/CrowdDev/CrowdDevTrigger.node.js.map +1 -0
- package/dist/nodes/CrowdDev/CrowdDevTrigger.node.json +18 -0
- package/dist/nodes/CrowdDev/GenericFunctions.d.ts +7 -0
- package/dist/nodes/CrowdDev/GenericFunctions.js +157 -0
- package/dist/nodes/CrowdDev/GenericFunctions.js.map +1 -0
- package/dist/nodes/CrowdDev/crowdDev.svg +15 -0
- package/dist/nodes/CrowdDev/descriptions/activityFields.d.ts +4 -0
- package/dist/nodes/CrowdDev/descriptions/activityFields.js +180 -0
- package/dist/nodes/CrowdDev/descriptions/activityFields.js.map +1 -0
- package/dist/nodes/CrowdDev/descriptions/automationFields.d.ts +4 -0
- package/dist/nodes/CrowdDev/descriptions/automationFields.js +126 -0
- package/dist/nodes/CrowdDev/descriptions/automationFields.js.map +1 -0
- package/dist/nodes/CrowdDev/descriptions/index.d.ts +2 -0
- package/dist/nodes/CrowdDev/descriptions/index.js +26 -0
- package/dist/nodes/CrowdDev/descriptions/index.js.map +1 -0
- package/dist/nodes/CrowdDev/descriptions/memberFields.d.ts +4 -0
- package/dist/nodes/CrowdDev/descriptions/memberFields.js +291 -0
- package/dist/nodes/CrowdDev/descriptions/memberFields.js.map +1 -0
- package/dist/nodes/CrowdDev/descriptions/noteFields.d.ts +4 -0
- package/dist/nodes/CrowdDev/descriptions/noteFields.js +90 -0
- package/dist/nodes/CrowdDev/descriptions/noteFields.js.map +1 -0
- package/dist/nodes/CrowdDev/descriptions/organizationFields.d.ts +4 -0
- package/dist/nodes/CrowdDev/descriptions/organizationFields.js +146 -0
- package/dist/nodes/CrowdDev/descriptions/organizationFields.js.map +1 -0
- package/dist/nodes/CrowdDev/descriptions/resources.d.ts +2 -0
- package/dist/nodes/CrowdDev/descriptions/resources.js +38 -0
- package/dist/nodes/CrowdDev/descriptions/resources.js.map +1 -0
- package/dist/nodes/CrowdDev/descriptions/shared.d.ts +2 -0
- package/dist/nodes/CrowdDev/descriptions/shared.js +29 -0
- package/dist/nodes/CrowdDev/descriptions/shared.js.map +1 -0
- package/dist/nodes/CrowdDev/descriptions/taskFields.d.ts +4 -0
- package/dist/nodes/CrowdDev/descriptions/taskFields.js +159 -0
- package/dist/nodes/CrowdDev/descriptions/taskFields.js.map +1 -0
- package/dist/nodes/CrowdDev/descriptions/utils.d.ts +5 -0
- package/dist/nodes/CrowdDev/descriptions/utils.js +55 -0
- package/dist/nodes/CrowdDev/descriptions/utils.js.map +1 -0
- package/dist/nodes/Google/Drive/GoogleDriveTrigger.node.js +5 -4
- package/dist/nodes/Google/Drive/GoogleDriveTrigger.node.js.map +1 -1
- package/dist/nodes/Google/Drive/v1/GoogleDriveV1.node.js +7 -6
- package/dist/nodes/Google/Drive/v1/GoogleDriveV1.node.js.map +1 -1
- package/dist/nodes/Google/Drive/v2/actions/common.descriptions.js +11 -10
- package/dist/nodes/Google/Drive/v2/actions/common.descriptions.js.map +1 -1
- package/dist/nodes/Google/Sheet/GoogleSheetsTrigger.node.js +3 -2
- package/dist/nodes/Google/Sheet/GoogleSheetsTrigger.node.js.map +1 -1
- package/dist/nodes/Google/Sheet/v2/actions/sheet/Sheet.resource.js +3 -2
- package/dist/nodes/Google/Sheet/v2/actions/sheet/Sheet.resource.js.map +1 -1
- package/dist/nodes/Google/Sheet/v2/actions/spreadsheet/delete.operation.js +3 -2
- package/dist/nodes/Google/Sheet/v2/actions/spreadsheet/delete.operation.js.map +1 -1
- package/dist/nodes/Google/constants.d.ts +2 -0
- package/dist/nodes/Google/constants.js +6 -0
- package/dist/nodes/Google/constants.js.map +1 -0
- package/dist/nodes/GraphQL/GraphQL.node.js +32 -0
- package/dist/nodes/GraphQL/GraphQL.node.js.map +1 -1
- package/dist/nodes/HttpRequest/V1/HttpRequestV1.node.js +1 -0
- package/dist/nodes/HttpRequest/V1/HttpRequestV1.node.js.map +1 -1
- package/dist/nodes/HttpRequest/V2/HttpRequestV2.node.js +1 -0
- package/dist/nodes/HttpRequest/V2/HttpRequestV2.node.js.map +1 -1
- package/dist/nodes/HttpRequest/V3/HttpRequestV3.node.js +24 -1
- package/dist/nodes/HttpRequest/V3/HttpRequestV3.node.js.map +1 -1
- package/dist/nodes/ItemLists/ItemLists.node.js +3 -1
- package/dist/nodes/ItemLists/ItemLists.node.js.map +1 -1
- package/dist/nodes/ItemLists/V3/ItemListsV3.node.d.ts +6 -0
- package/dist/nodes/ItemLists/V3/ItemListsV3.node.js +18 -0
- package/dist/nodes/ItemLists/V3/ItemListsV3.node.js.map +1 -0
- package/dist/nodes/ItemLists/V3/actions/common.descriptions.d.ts +2 -0
- package/dist/nodes/ItemLists/V3/actions/common.descriptions.js +11 -0
- package/dist/nodes/ItemLists/V3/actions/common.descriptions.js.map +1 -0
- package/dist/nodes/ItemLists/V3/actions/itemList/concatenateItems.operation.d.ts +23 -0
- package/dist/nodes/ItemLists/V3/actions/itemList/concatenateItems.operation.js +303 -0
- package/dist/nodes/ItemLists/V3/actions/itemList/concatenateItems.operation.js.map +1 -0
- package/dist/nodes/ItemLists/V3/actions/itemList/index.d.ts +9 -0
- package/dist/nodes/ItemLists/V3/actions/itemList/index.js +97 -0
- package/dist/nodes/ItemLists/V3/actions/itemList/index.js.map +1 -0
- package/dist/nodes/ItemLists/V3/actions/itemList/limit.operation.d.ts +23 -0
- package/dist/nodes/ItemLists/V3/actions/itemList/limit.operation.js +57 -0
- package/dist/nodes/ItemLists/V3/actions/itemList/limit.operation.js.map +1 -0
- package/dist/nodes/ItemLists/V3/actions/itemList/removeDuplicates.operation.d.ts +23 -0
- package/dist/nodes/ItemLists/V3/actions/itemList/removeDuplicates.operation.js +204 -0
- package/dist/nodes/ItemLists/V3/actions/itemList/removeDuplicates.operation.js.map +1 -0
- package/dist/nodes/ItemLists/V3/actions/itemList/sort.operation.d.ts +23 -0
- package/dist/nodes/ItemLists/V3/actions/itemList/sort.operation.js +262 -0
- package/dist/nodes/ItemLists/V3/actions/itemList/sort.operation.js.map +1 -0
- package/dist/nodes/ItemLists/V3/actions/itemList/splitOutItems.operation.d.ts +23 -0
- package/dist/nodes/ItemLists/V3/actions/itemList/splitOutItems.operation.js +183 -0
- package/dist/nodes/ItemLists/V3/actions/itemList/splitOutItems.operation.js.map +1 -0
- package/dist/nodes/ItemLists/V3/actions/itemList/summarize.operation.d.ts +23 -0
- package/dist/nodes/ItemLists/V3/actions/itemList/summarize.operation.js +491 -0
- package/dist/nodes/ItemLists/V3/actions/itemList/summarize.operation.js.map +1 -0
- package/dist/nodes/ItemLists/V3/actions/node.type.d.ts +6 -0
- package/dist/nodes/ItemLists/V3/actions/node.type.js +3 -0
- package/dist/nodes/ItemLists/V3/actions/node.type.js.map +1 -0
- package/dist/nodes/ItemLists/V3/actions/router.d.ts +2 -0
- package/dist/nodes/ItemLists/V3/actions/router.js +53 -0
- package/dist/nodes/ItemLists/V3/actions/router.js.map +1 -0
- package/dist/nodes/ItemLists/V3/actions/versionDescription.d.ts +2 -0
- package/dist/nodes/ItemLists/V3/actions/versionDescription.js +58 -0
- package/dist/nodes/ItemLists/V3/actions/versionDescription.js.map +1 -0
- package/dist/nodes/ItemLists/V3/helpers/utils.d.ts +5 -0
- package/dist/nodes/ItemLists/V3/helpers/utils.js +57 -0
- package/dist/nodes/ItemLists/V3/helpers/utils.js.map +1 -0
- package/dist/nodes/ItemLists/test/node/workflow.update_3.json +606 -0
- package/dist/nodes/Microsoft/ToDo/MicrosoftToDo.node.js +7 -0
- package/dist/nodes/Microsoft/ToDo/MicrosoftToDo.node.js.map +1 -1
- package/dist/nodes/Microsoft/ToDo/TaskDescription.js +7 -0
- package/dist/nodes/Microsoft/ToDo/TaskDescription.js.map +1 -1
- package/dist/nodes/MySql/v2/actions/common.descriptions.js +4 -4
- package/dist/nodes/MySql/v2/actions/common.descriptions.js.map +1 -1
- package/dist/nodes/MySql/v2/actions/database/executeQuery.operation.js +1 -9
- package/dist/nodes/MySql/v2/actions/database/executeQuery.operation.js.map +1 -1
- package/dist/nodes/MySql/v2/actions/database/insert.operation.js +1 -1
- package/dist/nodes/MySql/v2/actions/database/insert.operation.js.map +1 -1
- package/dist/nodes/MySql/v2/actions/database/update.operation.js +2 -2
- package/dist/nodes/MySql/v2/actions/database/update.operation.js.map +1 -1
- package/dist/nodes/MySql/v2/actions/database/upsert.operation.js +2 -2
- package/dist/nodes/MySql/v2/actions/database/upsert.operation.js.map +1 -1
- package/dist/nodes/Notion/DatabasePageDescription.js +41 -0
- package/dist/nodes/Notion/DatabasePageDescription.js.map +1 -1
- package/dist/nodes/Notion/v2/NotionV2.node.js +9 -0
- package/dist/nodes/Notion/v2/NotionV2.node.js.map +1 -1
- package/dist/nodes/Postgres/v2/actions/common.descriptions.js +4 -4
- package/dist/nodes/Postgres/v2/actions/common.descriptions.js.map +1 -1
- package/dist/nodes/Postgres/v2/actions/database/executeQuery.operation.js +1 -9
- package/dist/nodes/Postgres/v2/actions/database/executeQuery.operation.js.map +1 -1
- package/dist/nodes/Postgres/v2/actions/database/insert.operation.js +1 -1
- package/dist/nodes/Postgres/v2/actions/database/insert.operation.js.map +1 -1
- package/dist/nodes/Postgres/v2/actions/database/update.operation.js +2 -2
- package/dist/nodes/Postgres/v2/actions/database/update.operation.js.map +1 -1
- package/dist/nodes/Postgres/v2/actions/database/upsert.operation.js +2 -2
- package/dist/nodes/Postgres/v2/actions/database/upsert.operation.js.map +1 -1
- package/dist/nodes/Postgres/v2/helpers/utils.d.ts +1 -1
- package/dist/nodes/Postgres/v2/helpers/utils.js +3 -3
- package/dist/nodes/Postgres/v2/helpers/utils.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/Salesforce/ContactDescription.js +3 -3
- package/dist/nodes/Salesforce/ContactDescription.js.map +1 -1
- package/dist/nodes/Strapi/GenericFunctions.js +2 -2
- package/dist/nodes/Strapi/GenericFunctions.js.map +1 -1
- package/dist/nodes/Strava/ActivityDescription.js +7 -0
- package/dist/nodes/Strava/ActivityDescription.js.map +1 -1
- package/dist/nodes/Strava/Strava.node.js +0 -6
- package/dist/nodes/Strava/Strava.node.js.map +1 -1
- package/dist/nodes/Twitter/Twitter.node.d.ts +3 -9
- package/dist/nodes/Twitter/Twitter.node.js +12 -224
- package/dist/nodes/Twitter/Twitter.node.js.map +1 -1
- package/dist/nodes/Twitter/Twitter.node.json +2 -1
- package/dist/nodes/Twitter/V1/DirectMessageDescription.js.map +1 -0
- package/dist/nodes/Twitter/V1/GenericFunctions.js.map +1 -0
- package/dist/nodes/Twitter/V1/TweetDescription.js.map +1 -0
- package/dist/nodes/Twitter/V1/TweetInterface.js.map +1 -0
- package/dist/nodes/Twitter/V1/TwitterV1.node.d.ts +11 -0
- package/dist/nodes/Twitter/V1/TwitterV1.node.js +235 -0
- package/dist/nodes/Twitter/V1/TwitterV1.node.js.map +1 -0
- package/dist/nodes/Twitter/V2/DirectMessageDescription.d.ts +3 -0
- package/dist/nodes/Twitter/V2/DirectMessageDescription.js +100 -0
- package/dist/nodes/Twitter/V2/DirectMessageDescription.js.map +1 -0
- package/dist/nodes/Twitter/V2/GenericFunctions.d.ts +5 -0
- package/dist/nodes/Twitter/V2/GenericFunctions.js +88 -0
- package/dist/nodes/Twitter/V2/GenericFunctions.js.map +1 -0
- package/dist/nodes/Twitter/V2/ListDescription.d.ts +3 -0
- package/dist/nodes/Twitter/V2/ListDescription.js +92 -0
- package/dist/nodes/Twitter/V2/ListDescription.js.map +1 -0
- package/dist/nodes/Twitter/V2/TweetDescription.d.ts +3 -0
- package/dist/nodes/Twitter/V2/TweetDescription.js +452 -0
- package/dist/nodes/Twitter/V2/TweetDescription.js.map +1 -0
- package/dist/nodes/Twitter/V2/TweetInterface.d.ts +23 -0
- package/dist/nodes/Twitter/V2/TweetInterface.js +3 -0
- package/dist/nodes/Twitter/V2/TweetInterface.js.map +1 -0
- package/dist/nodes/Twitter/V2/TwitterV2.node.d.ts +11 -0
- package/dist/nodes/Twitter/V2/TwitterV2.node.js +245 -0
- package/dist/nodes/Twitter/V2/TwitterV2.node.js.map +1 -0
- package/dist/nodes/Twitter/V2/UserDescription.d.ts +3 -0
- package/dist/nodes/Twitter/V2/UserDescription.js +76 -0
- package/dist/nodes/Twitter/V2/UserDescription.js.map +1 -0
- package/dist/nodes/Twitter/test/Workflow_Twitter_UnitTest.json +284 -0
- package/dist/nodes/Wait/Wait.node.d.ts +7 -4
- package/dist/nodes/Wait/Wait.node.js +77 -499
- package/dist/nodes/Wait/Wait.node.js.map +1 -1
- package/dist/nodes/Webhook/Webhook.node.d.ts +8 -3
- package/dist/nodes/Webhook/Webhook.node.js +148 -460
- package/dist/nodes/Webhook/Webhook.node.js.map +1 -1
- package/dist/nodes/Webhook/description.d.ts +10 -0
- package/dist/nodes/Webhook/description.js +325 -0
- package/dist/nodes/Webhook/description.js.map +1 -0
- package/dist/nodes/Webhook/error.d.ts +4 -0
- package/dist/nodes/Webhook/error.js +20 -0
- package/dist/nodes/Webhook/error.js.map +1 -0
- package/dist/nodes/Xml/Xml.node.js +1 -1
- package/dist/nodes/Xml/Xml.node.js.map +1 -1
- package/dist/nodes/Xml/test/node/workflow.xml-valid-data.json +134 -0
- package/dist/package.json +9 -4
- package/dist/types/credentials.json +5 -2
- package/dist/types/nodes.json +31 -27
- package/package.json +11 -6
- package/dist/credentials/SendInBlueApi.credentials.js.map +0 -1
- package/dist/nodes/SendInBlue/AttributeDescription.js.map +0 -1
- package/dist/nodes/SendInBlue/ContactDescription.js.map +0 -1
- package/dist/nodes/SendInBlue/EmailDescription.js.map +0 -1
- package/dist/nodes/SendInBlue/GenericFunctions.js.map +0 -1
- package/dist/nodes/SendInBlue/SendInBlue.node.js.map +0 -1
- package/dist/nodes/SendInBlue/SendInBlueTrigger.node.js.map +0 -1
- package/dist/nodes/SendInBlue/SenderDescrition.js.map +0 -1
- package/dist/nodes/SendInBlue/sendinblue.svg +0 -20
- package/dist/nodes/Twitter/DirectMessageDescription.js.map +0 -1
- package/dist/nodes/Twitter/GenericFunctions.js.map +0 -1
- package/dist/nodes/Twitter/TweetDescription.js.map +0 -1
- package/dist/nodes/Twitter/TweetInterface.js.map +0 -1
- /package/dist/nodes/{SendInBlue → Brevo}/AttributeDescription.d.ts +0 -0
- /package/dist/nodes/{SendInBlue → Brevo}/ContactDescription.d.ts +0 -0
- /package/dist/nodes/{SendInBlue → Brevo}/ContactDescription.js +0 -0
- /package/dist/nodes/{SendInBlue → Brevo}/EmailDescription.d.ts +0 -0
- /package/dist/nodes/{SendInBlue → Brevo}/SenderDescrition.d.ts +0 -0
- /package/dist/nodes/{SendInBlue → Brevo}/SenderDescrition.js +0 -0
- /package/dist/nodes/Twitter/{DirectMessageDescription.d.ts → V1/DirectMessageDescription.d.ts} +0 -0
- /package/dist/nodes/Twitter/{DirectMessageDescription.js → V1/DirectMessageDescription.js} +0 -0
- /package/dist/nodes/Twitter/{GenericFunctions.d.ts → V1/GenericFunctions.d.ts} +0 -0
- /package/dist/nodes/Twitter/{GenericFunctions.js → V1/GenericFunctions.js} +0 -0
- /package/dist/nodes/Twitter/{TweetDescription.d.ts → V1/TweetDescription.d.ts} +0 -0
- /package/dist/nodes/Twitter/{TweetDescription.js → V1/TweetDescription.js} +0 -0
- /package/dist/nodes/Twitter/{TweetInterface.d.ts → V1/TweetInterface.d.ts} +0 -0
- /package/dist/nodes/Twitter/{TweetInterface.js → V1/TweetInterface.js} +0 -0
|
@@ -1,36 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.Wait = void 0;
|
|
7
4
|
const n8n_workflow_1 = require("n8n-workflow");
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
function authorizationError(resp, realm, responseCode, message) {
|
|
17
|
-
if (message === undefined) {
|
|
18
|
-
message = 'Authorization problem!';
|
|
19
|
-
if (responseCode === 401) {
|
|
20
|
-
message = 'Authorization is required!';
|
|
21
|
-
}
|
|
22
|
-
else if (responseCode === 403) {
|
|
23
|
-
message = 'Authorization data is wrong!';
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
resp.writeHead(responseCode, { 'WWW-Authenticate': `Basic realm="${realm}"` });
|
|
27
|
-
resp.end(message);
|
|
28
|
-
return {
|
|
29
|
-
noWebhookResponse: true,
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
class Wait {
|
|
5
|
+
const description_1 = require("../Webhook/description");
|
|
6
|
+
const Webhook_node_1 = require("../Webhook/Webhook.node");
|
|
7
|
+
const displayOnWebhook = {
|
|
8
|
+
show: {
|
|
9
|
+
resume: ['webhook'],
|
|
10
|
+
},
|
|
11
|
+
};
|
|
12
|
+
class Wait extends Webhook_node_1.Webhook {
|
|
33
13
|
constructor() {
|
|
14
|
+
var _a, _b;
|
|
15
|
+
super(...arguments);
|
|
16
|
+
this.authPropertyName = 'incomingAuthentication';
|
|
34
17
|
this.description = {
|
|
35
18
|
displayName: 'Wait',
|
|
36
19
|
name: 'wait',
|
|
@@ -44,69 +27,16 @@ class Wait {
|
|
|
44
27
|
},
|
|
45
28
|
inputs: ['main'],
|
|
46
29
|
outputs: ['main'],
|
|
47
|
-
credentials:
|
|
48
|
-
{
|
|
49
|
-
name: 'httpBasicAuth',
|
|
50
|
-
required: true,
|
|
51
|
-
displayOptions: {
|
|
52
|
-
show: {
|
|
53
|
-
incomingAuthentication: ['basicAuth'],
|
|
54
|
-
},
|
|
55
|
-
},
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
name: 'httpHeaderAuth',
|
|
59
|
-
required: true,
|
|
60
|
-
displayOptions: {
|
|
61
|
-
show: {
|
|
62
|
-
incomingAuthentication: ['headerAuth'],
|
|
63
|
-
},
|
|
64
|
-
},
|
|
65
|
-
},
|
|
66
|
-
],
|
|
30
|
+
credentials: (0, description_1.credentialsProperty)(this.authPropertyName),
|
|
67
31
|
webhooks: [
|
|
68
32
|
{
|
|
69
|
-
|
|
70
|
-
httpMethod: '={{$parameter["httpMethod"]}}',
|
|
71
|
-
isFullPath: true,
|
|
72
|
-
responseCode: '={{$parameter["responseCode"]}}',
|
|
73
|
-
responseMode: '={{$parameter["responseMode"]}}',
|
|
33
|
+
...description_1.defaultWebhookDescription,
|
|
74
34
|
responseData: '={{$parameter["responseData"]}}',
|
|
75
|
-
responseBinaryPropertyName: '={{$parameter["responseBinaryPropertyName"]}}',
|
|
76
|
-
responseContentType: '={{$parameter["options"]["responseContentType"]}}',
|
|
77
|
-
responsePropertyName: '={{$parameter["options"]["responsePropertyName"]}}',
|
|
78
|
-
responseHeaders: '={{$parameter["options"]["responseHeaders"]}}',
|
|
79
35
|
path: '={{$parameter["options"]["webhookSuffix"] || ""}}',
|
|
80
36
|
restartWebhook: true,
|
|
81
37
|
},
|
|
82
38
|
],
|
|
83
39
|
properties: [
|
|
84
|
-
{
|
|
85
|
-
displayName: 'Webhook Authentication',
|
|
86
|
-
name: 'incomingAuthentication',
|
|
87
|
-
type: 'options',
|
|
88
|
-
displayOptions: {
|
|
89
|
-
show: {
|
|
90
|
-
resume: ['webhook'],
|
|
91
|
-
},
|
|
92
|
-
},
|
|
93
|
-
options: [
|
|
94
|
-
{
|
|
95
|
-
name: 'Basic Auth',
|
|
96
|
-
value: 'basicAuth',
|
|
97
|
-
},
|
|
98
|
-
{
|
|
99
|
-
name: 'Header Auth',
|
|
100
|
-
value: 'headerAuth',
|
|
101
|
-
},
|
|
102
|
-
{
|
|
103
|
-
name: 'None',
|
|
104
|
-
value: 'none',
|
|
105
|
-
},
|
|
106
|
-
],
|
|
107
|
-
default: 'none',
|
|
108
|
-
description: 'If and how incoming resume-webhook-requests to $execution.resumeUrl should be authenticated for additional security',
|
|
109
|
-
},
|
|
110
40
|
{
|
|
111
41
|
displayName: 'Resume',
|
|
112
42
|
name: 'resume',
|
|
@@ -131,6 +61,11 @@ class Wait {
|
|
|
131
61
|
default: 'timeInterval',
|
|
132
62
|
description: 'Determines the waiting mode to use before the workflow continues',
|
|
133
63
|
},
|
|
64
|
+
{
|
|
65
|
+
...(0, description_1.authenticationProperty)(this.authPropertyName),
|
|
66
|
+
description: 'If and how incoming resume-webhook-requests to $execution.resumeUrl should be authenticated for additional security',
|
|
67
|
+
displayOptions: displayOnWebhook,
|
|
68
|
+
},
|
|
134
69
|
{
|
|
135
70
|
displayName: 'Date and Time',
|
|
136
71
|
name: 'dateTime',
|
|
@@ -193,139 +128,39 @@ class Wait {
|
|
|
193
128
|
displayName: 'The webhook URL will be generated at run time. It can be referenced with the <strong>$execution.resumeUrl</strong> variable. Send it somewhere before getting to this node. <a href="https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.wait/?utm_source=n8n_app&utm_medium=node_settings_modal-credential_link&utm_campaign=n8n-nodes-base.wait" target="_blank">More info</a>',
|
|
194
129
|
name: 'webhookNotice',
|
|
195
130
|
type: 'notice',
|
|
196
|
-
displayOptions:
|
|
197
|
-
show: {
|
|
198
|
-
resume: ['webhook'],
|
|
199
|
-
},
|
|
200
|
-
},
|
|
131
|
+
displayOptions: displayOnWebhook,
|
|
201
132
|
default: '',
|
|
202
133
|
},
|
|
203
134
|
{
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
type: 'options',
|
|
207
|
-
displayOptions: {
|
|
208
|
-
show: {
|
|
209
|
-
resume: ['webhook'],
|
|
210
|
-
},
|
|
211
|
-
},
|
|
212
|
-
options: [
|
|
213
|
-
{
|
|
214
|
-
name: 'DELETE',
|
|
215
|
-
value: 'DELETE',
|
|
216
|
-
},
|
|
217
|
-
{
|
|
218
|
-
name: 'GET',
|
|
219
|
-
value: 'GET',
|
|
220
|
-
},
|
|
221
|
-
{
|
|
222
|
-
name: 'HEAD',
|
|
223
|
-
value: 'HEAD',
|
|
224
|
-
},
|
|
225
|
-
{
|
|
226
|
-
name: 'PATCH',
|
|
227
|
-
value: 'PATCH',
|
|
228
|
-
},
|
|
229
|
-
{
|
|
230
|
-
name: 'POST',
|
|
231
|
-
value: 'POST',
|
|
232
|
-
},
|
|
233
|
-
{
|
|
234
|
-
name: 'PUT',
|
|
235
|
-
value: 'PUT',
|
|
236
|
-
},
|
|
237
|
-
],
|
|
238
|
-
default: 'GET',
|
|
135
|
+
...description_1.httpMethodsProperty,
|
|
136
|
+
displayOptions: displayOnWebhook,
|
|
239
137
|
description: 'The HTTP method of the Webhook call',
|
|
240
138
|
},
|
|
241
139
|
{
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
type: 'number',
|
|
245
|
-
displayOptions: {
|
|
246
|
-
show: {
|
|
247
|
-
resume: ['webhook'],
|
|
248
|
-
},
|
|
249
|
-
},
|
|
250
|
-
typeOptions: {
|
|
251
|
-
minValue: 100,
|
|
252
|
-
maxValue: 599,
|
|
253
|
-
},
|
|
254
|
-
default: 200,
|
|
255
|
-
description: 'The HTTP Response code to return',
|
|
140
|
+
...description_1.responseCodeProperty,
|
|
141
|
+
displayOptions: displayOnWebhook,
|
|
256
142
|
},
|
|
257
143
|
{
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
type: 'options',
|
|
261
|
-
displayOptions: {
|
|
262
|
-
show: {
|
|
263
|
-
resume: ['webhook'],
|
|
264
|
-
},
|
|
265
|
-
},
|
|
266
|
-
options: [
|
|
267
|
-
{
|
|
268
|
-
name: 'Immediately',
|
|
269
|
-
value: 'onReceived',
|
|
270
|
-
description: 'As soon as this node executes',
|
|
271
|
-
},
|
|
272
|
-
{
|
|
273
|
-
name: 'When Last Node Finishes',
|
|
274
|
-
value: 'lastNode',
|
|
275
|
-
description: 'Returns data of the last-executed node',
|
|
276
|
-
},
|
|
277
|
-
{
|
|
278
|
-
name: "Using 'Respond to Webhook' Node",
|
|
279
|
-
value: 'responseNode',
|
|
280
|
-
description: 'Response defined in that node',
|
|
281
|
-
},
|
|
282
|
-
],
|
|
283
|
-
default: 'onReceived',
|
|
284
|
-
description: 'When and how to respond to the webhook',
|
|
144
|
+
...description_1.responseModeProperty,
|
|
145
|
+
displayOptions: displayOnWebhook,
|
|
285
146
|
},
|
|
286
147
|
{
|
|
287
|
-
|
|
288
|
-
name: 'responseData',
|
|
289
|
-
type: 'options',
|
|
148
|
+
...description_1.responseDataProperty,
|
|
290
149
|
displayOptions: {
|
|
291
150
|
show: {
|
|
292
|
-
|
|
293
|
-
|
|
151
|
+
...(_a = description_1.responseDataProperty.displayOptions) === null || _a === void 0 ? void 0 : _a.show,
|
|
152
|
+
...displayOnWebhook.show,
|
|
294
153
|
},
|
|
295
154
|
},
|
|
296
|
-
options: [
|
|
297
|
-
{
|
|
298
|
-
name: 'All Entries',
|
|
299
|
-
value: 'allEntries',
|
|
300
|
-
description: 'Returns all the entries of the last node. Always returns an array.',
|
|
301
|
-
},
|
|
302
|
-
{
|
|
303
|
-
name: 'First Entry JSON',
|
|
304
|
-
value: 'firstEntryJson',
|
|
305
|
-
description: 'Returns the JSON data of the first entry of the last node. Always returns a JSON object.',
|
|
306
|
-
},
|
|
307
|
-
{
|
|
308
|
-
name: 'First Entry Binary',
|
|
309
|
-
value: 'firstEntryBinary',
|
|
310
|
-
description: 'Returns the binary data of the first entry of the last node. Always returns a binary file.',
|
|
311
|
-
},
|
|
312
|
-
],
|
|
313
|
-
default: 'firstEntryJson',
|
|
314
|
-
description: 'What data should be returned. If it should return all the items as array or only the first item as object.',
|
|
315
155
|
},
|
|
316
156
|
{
|
|
317
|
-
|
|
318
|
-
name: 'responseBinaryPropertyName',
|
|
319
|
-
type: 'string',
|
|
320
|
-
required: true,
|
|
321
|
-
default: 'data',
|
|
157
|
+
...description_1.responseBinaryPropertyNameProperty,
|
|
322
158
|
displayOptions: {
|
|
323
159
|
show: {
|
|
324
|
-
|
|
325
|
-
|
|
160
|
+
...(_b = description_1.responseBinaryPropertyNameProperty.displayOptions) === null || _b === void 0 ? void 0 : _b.show,
|
|
161
|
+
...displayOnWebhook.show,
|
|
326
162
|
},
|
|
327
163
|
},
|
|
328
|
-
description: 'Name of the binary property to return',
|
|
329
164
|
},
|
|
330
165
|
{
|
|
331
166
|
displayName: 'Limit Wait Time',
|
|
@@ -333,11 +168,7 @@ class Wait {
|
|
|
333
168
|
type: 'boolean',
|
|
334
169
|
default: false,
|
|
335
170
|
description: 'If no webhook call is received, the workflow will automatically resume execution after the specified limit type',
|
|
336
|
-
displayOptions:
|
|
337
|
-
show: {
|
|
338
|
-
resume: ['webhook'],
|
|
339
|
-
},
|
|
340
|
-
},
|
|
171
|
+
displayOptions: displayOnWebhook,
|
|
341
172
|
},
|
|
342
173
|
{
|
|
343
174
|
displayName: 'Limit Type',
|
|
@@ -348,7 +179,7 @@ class Wait {
|
|
|
348
179
|
displayOptions: {
|
|
349
180
|
show: {
|
|
350
181
|
limitWaitTime: [true],
|
|
351
|
-
|
|
182
|
+
...displayOnWebhook.show,
|
|
352
183
|
},
|
|
353
184
|
},
|
|
354
185
|
options: [
|
|
@@ -372,7 +203,7 @@ class Wait {
|
|
|
372
203
|
show: {
|
|
373
204
|
limitType: ['afterTimeInterval'],
|
|
374
205
|
limitWaitTime: [true],
|
|
375
|
-
|
|
206
|
+
...displayOnWebhook.show,
|
|
376
207
|
},
|
|
377
208
|
},
|
|
378
209
|
typeOptions: {
|
|
@@ -390,7 +221,7 @@ class Wait {
|
|
|
390
221
|
show: {
|
|
391
222
|
limitType: ['afterTimeInterval'],
|
|
392
223
|
limitWaitTime: [true],
|
|
393
|
-
|
|
224
|
+
...displayOnWebhook.show,
|
|
394
225
|
},
|
|
395
226
|
},
|
|
396
227
|
options: [
|
|
@@ -422,128 +253,17 @@ class Wait {
|
|
|
422
253
|
show: {
|
|
423
254
|
limitType: ['atSpecifiedTime'],
|
|
424
255
|
limitWaitTime: [true],
|
|
425
|
-
|
|
256
|
+
...displayOnWebhook.show,
|
|
426
257
|
},
|
|
427
258
|
},
|
|
428
259
|
default: '',
|
|
429
260
|
description: 'Continue execution after the specified date and time',
|
|
430
261
|
},
|
|
431
262
|
{
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
type: 'collection',
|
|
435
|
-
displayOptions: {
|
|
436
|
-
show: {
|
|
437
|
-
resume: ['webhook'],
|
|
438
|
-
},
|
|
439
|
-
},
|
|
440
|
-
placeholder: 'Add Option',
|
|
441
|
-
default: {},
|
|
263
|
+
...description_1.optionsProperty,
|
|
264
|
+
displayOptions: displayOnWebhook,
|
|
442
265
|
options: [
|
|
443
|
-
|
|
444
|
-
displayName: 'Binary Data',
|
|
445
|
-
name: 'binaryData',
|
|
446
|
-
type: 'boolean',
|
|
447
|
-
displayOptions: {
|
|
448
|
-
show: {
|
|
449
|
-
'/httpMethod': ['PATCH', 'PUT', 'POST'],
|
|
450
|
-
},
|
|
451
|
-
},
|
|
452
|
-
default: false,
|
|
453
|
-
description: 'Whether the webhook will receive binary data',
|
|
454
|
-
},
|
|
455
|
-
{
|
|
456
|
-
displayName: 'Binary Property',
|
|
457
|
-
name: 'binaryPropertyName',
|
|
458
|
-
type: 'string',
|
|
459
|
-
default: 'data',
|
|
460
|
-
displayOptions: {
|
|
461
|
-
show: {
|
|
462
|
-
binaryData: [true],
|
|
463
|
-
},
|
|
464
|
-
},
|
|
465
|
-
description: 'Name of the binary property to which to write the data of the received file. If the data gets received via "Form-Data Multipart" it will be the prefix and a number starting with 0 will be attached to it.',
|
|
466
|
-
},
|
|
467
|
-
{
|
|
468
|
-
displayName: 'Ignore Bots',
|
|
469
|
-
name: 'ignoreBots',
|
|
470
|
-
type: 'boolean',
|
|
471
|
-
default: false,
|
|
472
|
-
description: 'Whether to ignore requests from bots like link previewers and web crawlers',
|
|
473
|
-
},
|
|
474
|
-
{
|
|
475
|
-
displayName: 'Response Data',
|
|
476
|
-
name: 'responseData',
|
|
477
|
-
type: 'string',
|
|
478
|
-
displayOptions: {
|
|
479
|
-
show: {
|
|
480
|
-
'/responseMode': ['onReceived'],
|
|
481
|
-
},
|
|
482
|
-
},
|
|
483
|
-
default: '',
|
|
484
|
-
placeholder: 'success',
|
|
485
|
-
description: 'Custom response data to send',
|
|
486
|
-
},
|
|
487
|
-
{
|
|
488
|
-
displayName: 'Response Content-Type',
|
|
489
|
-
name: 'responseContentType',
|
|
490
|
-
type: 'string',
|
|
491
|
-
displayOptions: {
|
|
492
|
-
show: {
|
|
493
|
-
'/responseData': ['firstEntryJson'],
|
|
494
|
-
'/responseMode': ['lastNode'],
|
|
495
|
-
},
|
|
496
|
-
},
|
|
497
|
-
default: '',
|
|
498
|
-
placeholder: 'application/xml',
|
|
499
|
-
description: 'Set a custom content-type to return if another one as the "application/json" should be returned',
|
|
500
|
-
},
|
|
501
|
-
{
|
|
502
|
-
displayName: 'Response Headers',
|
|
503
|
-
name: 'responseHeaders',
|
|
504
|
-
placeholder: 'Add Response Header',
|
|
505
|
-
description: 'Add headers to the webhook response',
|
|
506
|
-
type: 'fixedCollection',
|
|
507
|
-
typeOptions: {
|
|
508
|
-
multipleValues: true,
|
|
509
|
-
},
|
|
510
|
-
default: {},
|
|
511
|
-
options: [
|
|
512
|
-
{
|
|
513
|
-
name: 'entries',
|
|
514
|
-
displayName: 'Entries',
|
|
515
|
-
values: [
|
|
516
|
-
{
|
|
517
|
-
displayName: 'Name',
|
|
518
|
-
name: 'name',
|
|
519
|
-
type: 'string',
|
|
520
|
-
default: '',
|
|
521
|
-
description: 'Name of the header',
|
|
522
|
-
},
|
|
523
|
-
{
|
|
524
|
-
displayName: 'Value',
|
|
525
|
-
name: 'value',
|
|
526
|
-
type: 'string',
|
|
527
|
-
default: '',
|
|
528
|
-
description: 'Value of the header',
|
|
529
|
-
},
|
|
530
|
-
],
|
|
531
|
-
},
|
|
532
|
-
],
|
|
533
|
-
},
|
|
534
|
-
{
|
|
535
|
-
displayName: 'Property Name',
|
|
536
|
-
name: 'responsePropertyName',
|
|
537
|
-
type: 'string',
|
|
538
|
-
displayOptions: {
|
|
539
|
-
show: {
|
|
540
|
-
'/responseData': ['firstEntryJson'],
|
|
541
|
-
'/responseMode': ['lastNode'],
|
|
542
|
-
},
|
|
543
|
-
},
|
|
544
|
-
default: 'data',
|
|
545
|
-
description: 'Name of the property to return the data of instead of the whole JSON',
|
|
546
|
-
},
|
|
266
|
+
...description_1.optionsProperty.options,
|
|
547
267
|
{
|
|
548
268
|
displayName: 'Webhook Suffix',
|
|
549
269
|
name: 'webhookSuffix',
|
|
@@ -557,186 +277,15 @@ class Wait {
|
|
|
557
277
|
],
|
|
558
278
|
};
|
|
559
279
|
}
|
|
560
|
-
async
|
|
561
|
-
|
|
562
|
-
const incomingAuthentication = this.getNodeParameter('incomingAuthentication');
|
|
563
|
-
const options = this.getNodeParameter('options', {});
|
|
564
|
-
const req = this.getRequestObject();
|
|
565
|
-
const resp = this.getResponseObject();
|
|
566
|
-
const headers = this.getHeaderData();
|
|
567
|
-
const realm = 'Webhook';
|
|
568
|
-
const ignoreBots = options.ignoreBots;
|
|
569
|
-
if (ignoreBots && (0, isbot_1.default)(headers['user-agent'])) {
|
|
570
|
-
return authorizationError(resp, realm, 403);
|
|
571
|
-
}
|
|
572
|
-
if (incomingAuthentication === 'basicAuth') {
|
|
573
|
-
let httpBasicAuth;
|
|
574
|
-
try {
|
|
575
|
-
httpBasicAuth = await this.getCredentials('httpBasicAuth');
|
|
576
|
-
}
|
|
577
|
-
catch (error) {
|
|
578
|
-
}
|
|
579
|
-
if (httpBasicAuth === undefined || !httpBasicAuth.user || !httpBasicAuth.password) {
|
|
580
|
-
return authorizationError(resp, realm, 500, 'No authentication data defined on node!');
|
|
581
|
-
}
|
|
582
|
-
const basicAuthData = (0, basic_auth_1.default)(req);
|
|
583
|
-
if (basicAuthData === undefined) {
|
|
584
|
-
return authorizationError(resp, realm, 401);
|
|
585
|
-
}
|
|
586
|
-
if (basicAuthData.name !== httpBasicAuth.user ||
|
|
587
|
-
basicAuthData.pass !== httpBasicAuth.password) {
|
|
588
|
-
return authorizationError(resp, realm, 403);
|
|
589
|
-
}
|
|
590
|
-
}
|
|
591
|
-
else if (incomingAuthentication === 'headerAuth') {
|
|
592
|
-
let httpHeaderAuth;
|
|
593
|
-
try {
|
|
594
|
-
httpHeaderAuth = await this.getCredentials('httpHeaderAuth');
|
|
595
|
-
}
|
|
596
|
-
catch (error) {
|
|
597
|
-
}
|
|
598
|
-
if (httpHeaderAuth === undefined || !httpHeaderAuth.name || !httpHeaderAuth.value) {
|
|
599
|
-
return authorizationError(resp, realm, 500, 'No authentication data defined on node!');
|
|
600
|
-
}
|
|
601
|
-
const headerName = httpHeaderAuth.name.toLowerCase();
|
|
602
|
-
const headerValue = httpHeaderAuth.value;
|
|
603
|
-
if (!headers.hasOwnProperty(headerName) ||
|
|
604
|
-
headers[headerName] !== headerValue) {
|
|
605
|
-
return authorizationError(resp, realm, 403);
|
|
606
|
-
}
|
|
607
|
-
}
|
|
608
|
-
const mimeType = (_a = headers['content-type']) !== null && _a !== void 0 ? _a : 'application/json';
|
|
609
|
-
if (mimeType.includes('multipart/form-data')) {
|
|
610
|
-
const form = new formidable_1.default.IncomingForm({ multiples: true });
|
|
611
|
-
return new Promise((resolve, _reject) => {
|
|
612
|
-
form.parse(req, async (err, data, files) => {
|
|
613
|
-
const returnItem = {
|
|
614
|
-
binary: {},
|
|
615
|
-
json: {
|
|
616
|
-
headers,
|
|
617
|
-
params: this.getParamsData(),
|
|
618
|
-
query: this.getQueryData(),
|
|
619
|
-
body: data,
|
|
620
|
-
},
|
|
621
|
-
};
|
|
622
|
-
let count = 0;
|
|
623
|
-
for (const xfile of Object.keys(files)) {
|
|
624
|
-
const processFiles = [];
|
|
625
|
-
let multiFile = false;
|
|
626
|
-
if (Array.isArray(files[xfile])) {
|
|
627
|
-
processFiles.push(...files[xfile]);
|
|
628
|
-
multiFile = true;
|
|
629
|
-
}
|
|
630
|
-
else {
|
|
631
|
-
processFiles.push(files[xfile]);
|
|
632
|
-
}
|
|
633
|
-
let fileCount = 0;
|
|
634
|
-
for (const file of processFiles) {
|
|
635
|
-
let binaryPropertyName = xfile;
|
|
636
|
-
if (binaryPropertyName.endsWith('[]')) {
|
|
637
|
-
binaryPropertyName = binaryPropertyName.slice(0, -2);
|
|
638
|
-
}
|
|
639
|
-
if (multiFile) {
|
|
640
|
-
binaryPropertyName += fileCount++;
|
|
641
|
-
}
|
|
642
|
-
if (options.binaryPropertyName) {
|
|
643
|
-
binaryPropertyName = `${options.binaryPropertyName}${count}`;
|
|
644
|
-
}
|
|
645
|
-
const fileJson = file.toJSON();
|
|
646
|
-
returnItem.binary[binaryPropertyName] = await this.nodeHelpers.copyBinaryFile(file.path, fileJson.name || fileJson.filename, fileJson.type);
|
|
647
|
-
count += 1;
|
|
648
|
-
}
|
|
649
|
-
}
|
|
650
|
-
resolve({
|
|
651
|
-
workflowData: [[returnItem]],
|
|
652
|
-
});
|
|
653
|
-
});
|
|
654
|
-
});
|
|
655
|
-
}
|
|
656
|
-
if (options.binaryData === true) {
|
|
657
|
-
const binaryFile = await (0, tmp_promise_1.file)({ prefix: 'n8n-webhook-' });
|
|
658
|
-
try {
|
|
659
|
-
await pipeline(req, fs_1.default.createWriteStream(binaryFile.path));
|
|
660
|
-
const returnItem = {
|
|
661
|
-
binary: {},
|
|
662
|
-
json: {
|
|
663
|
-
headers,
|
|
664
|
-
params: this.getParamsData(),
|
|
665
|
-
query: this.getQueryData(),
|
|
666
|
-
body: this.getBodyData(),
|
|
667
|
-
},
|
|
668
|
-
};
|
|
669
|
-
const binaryPropertyName = (options.binaryPropertyName || 'data');
|
|
670
|
-
returnItem.binary[binaryPropertyName] = await this.nodeHelpers.copyBinaryFile(binaryFile.path, mimeType);
|
|
671
|
-
return {
|
|
672
|
-
workflowData: [[returnItem]],
|
|
673
|
-
};
|
|
674
|
-
}
|
|
675
|
-
catch (error) {
|
|
676
|
-
throw new n8n_workflow_1.NodeOperationError(this.getNode(), error);
|
|
677
|
-
}
|
|
678
|
-
finally {
|
|
679
|
-
await binaryFile.cleanup();
|
|
680
|
-
}
|
|
681
|
-
}
|
|
682
|
-
const response = {
|
|
683
|
-
json: {
|
|
684
|
-
headers,
|
|
685
|
-
params: this.getParamsData(),
|
|
686
|
-
query: this.getQueryData(),
|
|
687
|
-
body: this.getBodyData(),
|
|
688
|
-
},
|
|
689
|
-
};
|
|
690
|
-
if (options.rawBody) {
|
|
691
|
-
response.binary = {
|
|
692
|
-
data: {
|
|
693
|
-
data: req.rawBody.toString(n8n_workflow_1.BINARY_ENCODING),
|
|
694
|
-
mimeType,
|
|
695
|
-
},
|
|
696
|
-
};
|
|
697
|
-
}
|
|
698
|
-
let webhookResponse;
|
|
699
|
-
if (options.responseData) {
|
|
700
|
-
webhookResponse = options.responseData;
|
|
701
|
-
}
|
|
702
|
-
return {
|
|
703
|
-
webhookResponse,
|
|
704
|
-
workflowData: [[response]],
|
|
705
|
-
};
|
|
706
|
-
}
|
|
707
|
-
async execute() {
|
|
708
|
-
const resume = this.getNodeParameter('resume', 0);
|
|
280
|
+
async execute(context) {
|
|
281
|
+
const resume = context.getNodeParameter('resume', 0);
|
|
709
282
|
if (resume === 'webhook') {
|
|
710
|
-
|
|
711
|
-
const limitWaitTime = this.getNodeParameter('limitWaitTime', 0);
|
|
712
|
-
if (limitWaitTime === true) {
|
|
713
|
-
const limitType = this.getNodeParameter('limitType', 0);
|
|
714
|
-
if (limitType === 'afterTimeInterval') {
|
|
715
|
-
let waitAmount = this.getNodeParameter('resumeAmount', 0);
|
|
716
|
-
const resumeUnit = this.getNodeParameter('resumeUnit', 0);
|
|
717
|
-
if (resumeUnit === 'minutes') {
|
|
718
|
-
waitAmount *= 60;
|
|
719
|
-
}
|
|
720
|
-
if (resumeUnit === 'hours') {
|
|
721
|
-
waitAmount *= 60 * 60;
|
|
722
|
-
}
|
|
723
|
-
if (resumeUnit === 'days') {
|
|
724
|
-
waitAmount *= 60 * 60 * 24;
|
|
725
|
-
}
|
|
726
|
-
waitAmount *= 1000;
|
|
727
|
-
waitTill = new Date(new Date().getTime() + waitAmount);
|
|
728
|
-
}
|
|
729
|
-
else {
|
|
730
|
-
waitTill = new Date(this.getNodeParameter('maxDateAndTime', 0));
|
|
731
|
-
}
|
|
732
|
-
}
|
|
733
|
-
await this.putExecutionToWait(waitTill);
|
|
734
|
-
return [this.getInputData()];
|
|
283
|
+
return this.handleWebhookResume(context);
|
|
735
284
|
}
|
|
736
285
|
let waitTill;
|
|
737
286
|
if (resume === 'timeInterval') {
|
|
738
|
-
const unit =
|
|
739
|
-
let waitAmount =
|
|
287
|
+
const unit = context.getNodeParameter('unit', 0);
|
|
288
|
+
let waitAmount = context.getNodeParameter('amount', 0);
|
|
740
289
|
if (unit === 'minutes') {
|
|
741
290
|
waitAmount *= 60;
|
|
742
291
|
}
|
|
@@ -750,19 +299,48 @@ class Wait {
|
|
|
750
299
|
waitTill = new Date(new Date().getTime() + waitAmount);
|
|
751
300
|
}
|
|
752
301
|
else {
|
|
753
|
-
const dateTime =
|
|
302
|
+
const dateTime = context.getNodeParameter('dateTime', 0);
|
|
754
303
|
waitTill = new Date(dateTime);
|
|
755
304
|
}
|
|
756
305
|
const waitValue = Math.max(waitTill.getTime() - new Date().getTime(), 0);
|
|
757
306
|
if (waitValue < 65000) {
|
|
758
307
|
return new Promise((resolve, _reject) => {
|
|
759
308
|
setTimeout(() => {
|
|
760
|
-
resolve([
|
|
309
|
+
resolve([context.getInputData()]);
|
|
761
310
|
}, waitValue);
|
|
762
311
|
});
|
|
763
312
|
}
|
|
764
|
-
|
|
765
|
-
|
|
313
|
+
return this.putToWait(context, waitTill);
|
|
314
|
+
}
|
|
315
|
+
async handleWebhookResume(context) {
|
|
316
|
+
let waitTill = new Date(n8n_workflow_1.WAIT_TIME_UNLIMITED);
|
|
317
|
+
const limitWaitTime = context.getNodeParameter('limitWaitTime', 0);
|
|
318
|
+
if (limitWaitTime === true) {
|
|
319
|
+
const limitType = context.getNodeParameter('limitType', 0);
|
|
320
|
+
if (limitType === 'afterTimeInterval') {
|
|
321
|
+
let waitAmount = context.getNodeParameter('resumeAmount', 0);
|
|
322
|
+
const resumeUnit = context.getNodeParameter('resumeUnit', 0);
|
|
323
|
+
if (resumeUnit === 'minutes') {
|
|
324
|
+
waitAmount *= 60;
|
|
325
|
+
}
|
|
326
|
+
if (resumeUnit === 'hours') {
|
|
327
|
+
waitAmount *= 60 * 60;
|
|
328
|
+
}
|
|
329
|
+
if (resumeUnit === 'days') {
|
|
330
|
+
waitAmount *= 60 * 60 * 24;
|
|
331
|
+
}
|
|
332
|
+
waitAmount *= 1000;
|
|
333
|
+
waitTill = new Date(new Date().getTime() + waitAmount);
|
|
334
|
+
}
|
|
335
|
+
else {
|
|
336
|
+
waitTill = new Date(context.getNodeParameter('maxDateAndTime', 0));
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
return this.putToWait(context, waitTill);
|
|
340
|
+
}
|
|
341
|
+
async putToWait(context, waitTill) {
|
|
342
|
+
await context.putExecutionToWait(waitTill);
|
|
343
|
+
return [context.getInputData()];
|
|
766
344
|
}
|
|
767
345
|
}
|
|
768
346
|
exports.Wait = Wait;
|