n8n-nodes-base 1.96.1 → 1.97.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.
Files changed (53) hide show
  1. package/dist/nodes/Evaluation/EvaluationTrigger/EvaluationTrigger.node.ee.js +18 -13
  2. package/dist/nodes/Evaluation/EvaluationTrigger/EvaluationTrigger.node.ee.js.map +1 -1
  3. package/dist/nodes/Form/Form.node.js +3 -3
  4. package/dist/nodes/Form/Form.node.js.map +1 -1
  5. package/dist/nodes/Form/formCompletionUtils.js.map +1 -0
  6. package/dist/nodes/Form/formNodeUtils.js.map +1 -0
  7. package/dist/nodes/Form/{utils/utils.js → utils.js} +7 -21
  8. package/dist/nodes/Form/utils.js.map +1 -0
  9. package/dist/nodes/Form/v1/FormTriggerV1.node.js +1 -1
  10. package/dist/nodes/Form/v1/FormTriggerV1.node.js.map +1 -1
  11. package/dist/nodes/Form/v2/FormTriggerV2.node.js +1 -1
  12. package/dist/nodes/Form/v2/FormTriggerV2.node.js.map +1 -1
  13. package/dist/nodes/Google/Gmail/GenericFunctions.js +1 -1
  14. package/dist/nodes/Google/Gmail/GenericFunctions.js.map +1 -1
  15. package/dist/nodes/Google/Gmail/v2/DraftDescription.js +7 -0
  16. package/dist/nodes/Google/Gmail/v2/DraftDescription.js.map +1 -1
  17. package/dist/nodes/Google/Gmail/v2/GmailV2.node.js +4 -0
  18. package/dist/nodes/Google/Gmail/v2/GmailV2.node.js.map +1 -1
  19. package/dist/nodes/Google/Gmail/v2/utils/draft.js +44 -0
  20. package/dist/nodes/Google/Gmail/v2/utils/draft.js.map +1 -0
  21. package/dist/nodes/HttpRequest/V3/HttpRequestV3.node.js +10 -4
  22. package/dist/nodes/HttpRequest/V3/HttpRequestV3.node.js.map +1 -1
  23. package/dist/nodes/HttpRequest/V3/utils/binaryData.js +37 -0
  24. package/dist/nodes/HttpRequest/V3/utils/binaryData.js.map +1 -0
  25. package/dist/nodes/HttpRequest/V3/utils/parse.js +34 -0
  26. package/dist/nodes/HttpRequest/V3/utils/parse.js.map +1 -0
  27. package/dist/nodes/Linear/CommentDescription.js +105 -0
  28. package/dist/nodes/Linear/CommentDescription.js.map +1 -0
  29. package/dist/nodes/Linear/IssueDescription.js +23 -1
  30. package/dist/nodes/Linear/IssueDescription.js.map +1 -1
  31. package/dist/nodes/Linear/Linear.node.js +37 -0
  32. package/dist/nodes/Linear/Linear.node.js.map +1 -1
  33. package/dist/nodes/Linear/Queries.js +17 -0
  34. package/dist/nodes/Linear/Queries.js.map +1 -1
  35. package/dist/nodes/Linear/test/workflow/apiRequest.js +280 -0
  36. package/dist/nodes/Linear/test/workflow/apiRequest.js.map +1 -0
  37. package/dist/nodes/Linear/test/workflow/apiResponses.js +198 -0
  38. package/dist/nodes/Linear/test/workflow/apiResponses.js.map +1 -0
  39. package/dist/nodes/Postgres/transport/index.js +55 -60
  40. package/dist/nodes/Postgres/transport/index.js.map +1 -1
  41. package/dist/nodes/Wait/Wait.node.js +1 -1
  42. package/dist/nodes/Wait/Wait.node.js.map +1 -1
  43. package/dist/types/nodes.json +4 -4
  44. package/dist/utils/connection-pool-manager.js +42 -30
  45. package/dist/utils/connection-pool-manager.js.map +1 -1
  46. package/dist/utils/sendAndWait/utils.js +1 -1
  47. package/dist/utils/sendAndWait/utils.js.map +1 -1
  48. package/package.json +7 -7
  49. package/dist/nodes/Form/utils/formCompletionUtils.js.map +0 -1
  50. package/dist/nodes/Form/utils/formNodeUtils.js.map +0 -1
  51. package/dist/nodes/Form/utils/utils.js.map +0 -1
  52. /package/dist/nodes/Form/{utils/formCompletionUtils.js → formCompletionUtils.js} +0 -0
  53. /package/dist/nodes/Form/{utils/formNodeUtils.js → formNodeUtils.js} +0 -0
@@ -0,0 +1,198 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var apiResponses_exports = {};
20
+ __export(apiResponses_exports, {
21
+ attachmentLinkURLResponse: () => attachmentLinkURLResponse,
22
+ commentCreateResponse: () => commentCreateResponse,
23
+ commentCreateWithParentResponse: () => commentCreateWithParentResponse,
24
+ deleteIssueResponse: () => deleteIssueResponse,
25
+ getIssueResponse: () => getIssueResponse,
26
+ getManyIssueResponse: () => getManyIssueResponse,
27
+ issueCreateResponse: () => issueCreateResponse,
28
+ issueUpdateResponse: () => issueUpdateResponse
29
+ });
30
+ module.exports = __toCommonJS(apiResponses_exports);
31
+ const commentCreateResponse = {
32
+ data: {
33
+ commentCreate: {
34
+ success: true,
35
+ comment: {
36
+ id: "ff12069e-fac8-4b18-8455-cc6b29fa1e77"
37
+ }
38
+ }
39
+ }
40
+ };
41
+ const commentCreateWithParentResponse = {
42
+ data: {
43
+ commentCreate: {
44
+ success: true,
45
+ comment: {
46
+ id: "bd0e4d70-7964-4877-aa30-d81534027f44"
47
+ }
48
+ }
49
+ }
50
+ };
51
+ const attachmentLinkURLResponse = {
52
+ data: {
53
+ attachmentLinkURL: {
54
+ success: true
55
+ }
56
+ }
57
+ };
58
+ const issueCreateResponse = {
59
+ data: {
60
+ issueCreate: {
61
+ success: true,
62
+ issue: {
63
+ id: "3c7316e3-4224-424d-8cc8-1dd3b96764b8",
64
+ identifier: "TEST-18",
65
+ title: "This is a test issue",
66
+ priority: 3,
67
+ archivedAt: null,
68
+ assignee: {
69
+ id: "1c51f0c4-c552-4614-a534-8de1752ba7d7",
70
+ displayName: "nathan"
71
+ },
72
+ state: {
73
+ id: "65a87a3a-5729-4d82-96bf-badccbeb49af",
74
+ name: "Backlog"
75
+ },
76
+ createdAt: "2025-06-12T10:38:35.296Z",
77
+ creator: {
78
+ id: "1c51f0c4-c552-4614-a534-8de1752ba7d7",
79
+ displayName: "nathan"
80
+ },
81
+ description: "test description",
82
+ dueDate: null,
83
+ cycle: null
84
+ }
85
+ }
86
+ }
87
+ };
88
+ const getIssueResponse = {
89
+ data: {
90
+ issue: {
91
+ id: "3c7316e3-4224-424d-8cc8-1dd3b96764b8",
92
+ identifier: "TEST-18",
93
+ title: "This is a test issue",
94
+ priority: 3,
95
+ archivedAt: null,
96
+ assignee: {
97
+ id: "1c51f0c4-c552-4614-a534-8de1752ba7d7",
98
+ displayName: "nathan"
99
+ },
100
+ state: {
101
+ id: "65a87a3a-5729-4d82-96bf-badccbeb49af",
102
+ name: "Backlog"
103
+ },
104
+ createdAt: "2025-06-12T10:38:35.296Z",
105
+ creator: {
106
+ id: "1c51f0c4-c552-4614-a534-8de1752ba7d7",
107
+ displayName: "nathan"
108
+ },
109
+ description: "test description",
110
+ dueDate: null,
111
+ cycle: null
112
+ }
113
+ }
114
+ };
115
+ const getManyIssueResponse = {
116
+ data: {
117
+ issues: {
118
+ nodes: [
119
+ {
120
+ id: "3c7316e3-4224-424d-8cc8-1dd3b96764b8",
121
+ identifier: "TEST-18",
122
+ title: "This is a test issue",
123
+ priority: 3,
124
+ archivedAt: null,
125
+ assignee: {
126
+ id: "1c51f0c4-c552-4614-a534-8de1752ba7d7",
127
+ displayName: "nathan"
128
+ },
129
+ state: {
130
+ id: "65a87a3a-5729-4d82-96bf-badccbeb49af",
131
+ name: "Backlog"
132
+ },
133
+ createdAt: "2025-06-12T10:38:35.296Z",
134
+ creator: {
135
+ id: "1c51f0c4-c552-4614-a534-8de1752ba7d7",
136
+ displayName: "nathan"
137
+ },
138
+ description: "test description",
139
+ dueDate: null,
140
+ cycle: null
141
+ }
142
+ ],
143
+ pageInfo: {
144
+ hasNextPage: true,
145
+ endCursor: "3c7316e3-4224-424d-8cc8-1dd3b96764b8"
146
+ }
147
+ }
148
+ }
149
+ };
150
+ const issueUpdateResponse = {
151
+ data: {
152
+ issueUpdate: {
153
+ success: true,
154
+ issue: {
155
+ id: "3c7316e3-4224-424d-8cc8-1dd3b96764b8",
156
+ identifier: "TEST-18",
157
+ title: "New Title",
158
+ priority: 3,
159
+ archivedAt: null,
160
+ assignee: {
161
+ id: "1c51f0c4-c552-4614-a534-8de1752ba7d7",
162
+ displayName: "nathan"
163
+ },
164
+ state: {
165
+ id: "622493c0-f4ee-456d-af65-49a7611ede7a",
166
+ name: "Canceled"
167
+ },
168
+ createdAt: "2025-06-12T10:38:35.296Z",
169
+ creator: {
170
+ id: "1c51f0c4-c552-4614-a534-8de1752ba7d7",
171
+ displayName: "nathan"
172
+ },
173
+ description: "New Description",
174
+ dueDate: null,
175
+ cycle: null
176
+ }
177
+ }
178
+ }
179
+ };
180
+ const deleteIssueResponse = {
181
+ data: {
182
+ issueDelete: {
183
+ success: true
184
+ }
185
+ }
186
+ };
187
+ // Annotate the CommonJS export names for ESM import in node:
188
+ 0 && (module.exports = {
189
+ attachmentLinkURLResponse,
190
+ commentCreateResponse,
191
+ commentCreateWithParentResponse,
192
+ deleteIssueResponse,
193
+ getIssueResponse,
194
+ getManyIssueResponse,
195
+ issueCreateResponse,
196
+ issueUpdateResponse
197
+ });
198
+ //# sourceMappingURL=apiResponses.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../nodes/Linear/test/workflow/apiResponses.ts"],"sourcesContent":["export const commentCreateResponse = {\n\tdata: {\n\t\tcommentCreate: {\n\t\t\tsuccess: true,\n\t\t\tcomment: {\n\t\t\t\tid: 'ff12069e-fac8-4b18-8455-cc6b29fa1e77',\n\t\t\t},\n\t\t},\n\t},\n};\n\nexport const commentCreateWithParentResponse = {\n\tdata: {\n\t\tcommentCreate: {\n\t\t\tsuccess: true,\n\t\t\tcomment: {\n\t\t\t\tid: 'bd0e4d70-7964-4877-aa30-d81534027f44',\n\t\t\t},\n\t\t},\n\t},\n};\n\nexport const attachmentLinkURLResponse = {\n\tdata: {\n\t\tattachmentLinkURL: {\n\t\t\tsuccess: true,\n\t\t},\n\t},\n};\n\nexport const issueCreateResponse = {\n\tdata: {\n\t\tissueCreate: {\n\t\t\tsuccess: true,\n\t\t\tissue: {\n\t\t\t\tid: '3c7316e3-4224-424d-8cc8-1dd3b96764b8',\n\t\t\t\tidentifier: 'TEST-18',\n\t\t\t\ttitle: 'This is a test issue',\n\t\t\t\tpriority: 3,\n\t\t\t\tarchivedAt: null,\n\t\t\t\tassignee: {\n\t\t\t\t\tid: '1c51f0c4-c552-4614-a534-8de1752ba7d7',\n\t\t\t\t\tdisplayName: 'nathan',\n\t\t\t\t},\n\t\t\t\tstate: {\n\t\t\t\t\tid: '65a87a3a-5729-4d82-96bf-badccbeb49af',\n\t\t\t\t\tname: 'Backlog',\n\t\t\t\t},\n\t\t\t\tcreatedAt: '2025-06-12T10:38:35.296Z',\n\t\t\t\tcreator: {\n\t\t\t\t\tid: '1c51f0c4-c552-4614-a534-8de1752ba7d7',\n\t\t\t\t\tdisplayName: 'nathan',\n\t\t\t\t},\n\t\t\t\tdescription: 'test description',\n\t\t\t\tdueDate: null,\n\t\t\t\tcycle: null,\n\t\t\t},\n\t\t},\n\t},\n};\n\nexport const getIssueResponse = {\n\tdata: {\n\t\tissue: {\n\t\t\tid: '3c7316e3-4224-424d-8cc8-1dd3b96764b8',\n\t\t\tidentifier: 'TEST-18',\n\t\t\ttitle: 'This is a test issue',\n\t\t\tpriority: 3,\n\t\t\tarchivedAt: null,\n\t\t\tassignee: {\n\t\t\t\tid: '1c51f0c4-c552-4614-a534-8de1752ba7d7',\n\t\t\t\tdisplayName: 'nathan',\n\t\t\t},\n\t\t\tstate: {\n\t\t\t\tid: '65a87a3a-5729-4d82-96bf-badccbeb49af',\n\t\t\t\tname: 'Backlog',\n\t\t\t},\n\t\t\tcreatedAt: '2025-06-12T10:38:35.296Z',\n\t\t\tcreator: {\n\t\t\t\tid: '1c51f0c4-c552-4614-a534-8de1752ba7d7',\n\t\t\t\tdisplayName: 'nathan',\n\t\t\t},\n\t\t\tdescription: 'test description',\n\t\t\tdueDate: null,\n\t\t\tcycle: null,\n\t\t},\n\t},\n};\n\nexport const getManyIssueResponse = {\n\tdata: {\n\t\tissues: {\n\t\t\tnodes: [\n\t\t\t\t{\n\t\t\t\t\tid: '3c7316e3-4224-424d-8cc8-1dd3b96764b8',\n\t\t\t\t\tidentifier: 'TEST-18',\n\t\t\t\t\ttitle: 'This is a test issue',\n\t\t\t\t\tpriority: 3,\n\t\t\t\t\tarchivedAt: null,\n\t\t\t\t\tassignee: {\n\t\t\t\t\t\tid: '1c51f0c4-c552-4614-a534-8de1752ba7d7',\n\t\t\t\t\t\tdisplayName: 'nathan',\n\t\t\t\t\t},\n\t\t\t\t\tstate: {\n\t\t\t\t\t\tid: '65a87a3a-5729-4d82-96bf-badccbeb49af',\n\t\t\t\t\t\tname: 'Backlog',\n\t\t\t\t\t},\n\t\t\t\t\tcreatedAt: '2025-06-12T10:38:35.296Z',\n\t\t\t\t\tcreator: {\n\t\t\t\t\t\tid: '1c51f0c4-c552-4614-a534-8de1752ba7d7',\n\t\t\t\t\t\tdisplayName: 'nathan',\n\t\t\t\t\t},\n\t\t\t\t\tdescription: 'test description',\n\t\t\t\t\tdueDate: null,\n\t\t\t\t\tcycle: null,\n\t\t\t\t},\n\t\t\t],\n\t\t\tpageInfo: {\n\t\t\t\thasNextPage: true,\n\t\t\t\tendCursor: '3c7316e3-4224-424d-8cc8-1dd3b96764b8',\n\t\t\t},\n\t\t},\n\t},\n};\n\nexport const issueUpdateResponse = {\n\tdata: {\n\t\tissueUpdate: {\n\t\t\tsuccess: true,\n\t\t\tissue: {\n\t\t\t\tid: '3c7316e3-4224-424d-8cc8-1dd3b96764b8',\n\t\t\t\tidentifier: 'TEST-18',\n\t\t\t\ttitle: 'New Title',\n\t\t\t\tpriority: 3,\n\t\t\t\tarchivedAt: null,\n\t\t\t\tassignee: {\n\t\t\t\t\tid: '1c51f0c4-c552-4614-a534-8de1752ba7d7',\n\t\t\t\t\tdisplayName: 'nathan',\n\t\t\t\t},\n\t\t\t\tstate: {\n\t\t\t\t\tid: '622493c0-f4ee-456d-af65-49a7611ede7a',\n\t\t\t\t\tname: 'Canceled',\n\t\t\t\t},\n\t\t\t\tcreatedAt: '2025-06-12T10:38:35.296Z',\n\t\t\t\tcreator: {\n\t\t\t\t\tid: '1c51f0c4-c552-4614-a534-8de1752ba7d7',\n\t\t\t\t\tdisplayName: 'nathan',\n\t\t\t\t},\n\t\t\t\tdescription: 'New Description',\n\t\t\t\tdueDate: null,\n\t\t\t\tcycle: null,\n\t\t\t},\n\t\t},\n\t},\n};\n\nexport const deleteIssueResponse = {\n\tdata: {\n\t\tissueDelete: {\n\t\t\tsuccess: true,\n\t\t},\n\t},\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,MAAM,wBAAwB;AAAA,EACpC,MAAM;AAAA,IACL,eAAe;AAAA,MACd,SAAS;AAAA,MACT,SAAS;AAAA,QACR,IAAI;AAAA,MACL;AAAA,IACD;AAAA,EACD;AACD;AAEO,MAAM,kCAAkC;AAAA,EAC9C,MAAM;AAAA,IACL,eAAe;AAAA,MACd,SAAS;AAAA,MACT,SAAS;AAAA,QACR,IAAI;AAAA,MACL;AAAA,IACD;AAAA,EACD;AACD;AAEO,MAAM,4BAA4B;AAAA,EACxC,MAAM;AAAA,IACL,mBAAmB;AAAA,MAClB,SAAS;AAAA,IACV;AAAA,EACD;AACD;AAEO,MAAM,sBAAsB;AAAA,EAClC,MAAM;AAAA,IACL,aAAa;AAAA,MACZ,SAAS;AA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AAA,UACT,OAAO;AAAA,QACR;AAAA,MACD;AAAA,MACA,UAAU;AAAA,QACT,aAAa;AAAA,QACb,WAAW;AAAA,MACZ;AAAA,IACD;AAAA,EACD;AACD;AAEO,MAAM,sBAAsB;AAAA,EAClC,MAAM;AAAA,IACL,aAAa;AAAA,MACZ,SAAS;AAAA,MACT,OAAO;AAAA,QACN,IAAI;AAAA,QACJ,YAAY;AAAA,QACZ,OAAO;AAAA,QACP,UAAU;AAAA,QACV,YAAY;AAAA,QACZ,UAAU;AAAA,UACT,IAAI;AAAA,UACJ,aAAa;AAAA,QACd;AAAA,QACA,OAAO;AAAA,UACN,IAAI;AAAA,UACJ,MAAM;AAAA,QACP;AAAA,QACA,WAAW;AAAA,QACX,SAAS;AAAA,UACR,IAAI;AAAA,UACJ,aAAa;AAAA,QACd;AAAA,QACA,aAAa;AAAA,QACb,SAAS;AAAA,QACT,OAAO;AAAA,MACR;AAAA,IACD;AAAA,EACD;AACD;AAEO,MAAM,sBAAsB;AAAA,EAClC,MAAM;AAAA,IACL,aAAa;AAAA,MACZ,SAAS;AAAA,IACV;AAAA,EACD;AACD;","names":[]}
@@ -62,9 +62,30 @@ const getPostgresConfig = (credentials, options = {}) => {
62
62
  }
63
63
  return dbConfig;
64
64
  };
65
+ function withCleanupHandler(proxy, abortController, logger) {
66
+ proxy.on("error", (error) => {
67
+ logger.error("TCP Proxy: Got error, calling abort controller", { error });
68
+ abortController.abort();
69
+ });
70
+ proxy.on("close", () => {
71
+ logger.error("TCP Proxy: Was closed, calling abort controller");
72
+ abortController.abort();
73
+ });
74
+ proxy.on("drop", (dropArgument) => {
75
+ logger.error("TCP Proxy: Connection was dropped, calling abort controller", {
76
+ dropArgument
77
+ });
78
+ abortController.abort();
79
+ });
80
+ abortController.signal.addEventListener("abort", () => {
81
+ logger.debug("Got abort signal. Closing TCP proxy server.");
82
+ proxy.close();
83
+ });
84
+ return proxy;
85
+ }
65
86
  async function configurePostgres(credentials, options = {}) {
66
- const poolManager = import_connection_pool_manager.ConnectionPoolManager.getInstance();
67
- const fallBackHandler = async () => {
87
+ const poolManager = import_connection_pool_manager.ConnectionPoolManager.getInstance(this.logger);
88
+ const fallBackHandler = async (abortController) => {
68
89
  const pgp = (0, import_pg_promise.default)({
69
90
  // prevent spam in console "WARNING: Creating a duplicate database object for the same connection."
70
91
  // duplicate connections created when auto loading parameters, they are closed immediately after, but several could be open at the same time
@@ -97,75 +118,47 @@ async function configurePostgres(credentials, options = {}) {
97
118
  if (credentials.sshAuthenticateWith === "privateKey" && credentials.privateKey) {
98
119
  credentials.privateKey = (0, import_utilities.formatPrivateKey)(credentials.privateKey);
99
120
  }
100
- const sshClient = await this.helpers.getSSHClient(credentials);
101
- const proxy = (0, import_node_net.createServer)();
121
+ const sshClient = await this.helpers.getSSHClient(credentials, abortController);
122
+ const proxy = withCleanupHandler((0, import_node_net.createServer)(), abortController, this.logger);
102
123
  const proxyPort = await new Promise((resolve) => {
103
124
  proxy.listen(0, import_constants.LOCALHOST, () => {
104
125
  resolve(proxy.address().port);
105
126
  });
106
127
  });
107
- const close = () => {
108
- proxy.close();
109
- sshClient.off("end", close);
110
- sshClient.off("error", close);
111
- };
112
- sshClient.on("end", close);
113
- sshClient.on("error", close);
114
- await new Promise((resolve, reject) => {
115
- proxy.on("error", (err) => reject(err));
116
- proxy.on("connection", (localSocket) => {
117
- sshClient.forwardOut(
118
- import_constants.LOCALHOST,
119
- localSocket.remotePort,
120
- credentials.host,
121
- credentials.port,
122
- (err, clientChannel) => {
123
- if (err) {
124
- proxy.close();
125
- localSocket.destroy();
126
- } else {
127
- localSocket.pipe(clientChannel);
128
- clientChannel.pipe(localSocket);
129
- }
128
+ proxy.on("connection", (localSocket) => {
129
+ sshClient.forwardOut(
130
+ import_constants.LOCALHOST,
131
+ localSocket.remotePort,
132
+ credentials.host,
133
+ credentials.port,
134
+ (error, clientChannel) => {
135
+ if (error) {
136
+ this.logger.error("SSH Client: Port forwarding encountered an error", { error });
137
+ abortController.abort();
138
+ } else {
139
+ localSocket.pipe(clientChannel);
140
+ clientChannel.pipe(localSocket);
130
141
  }
131
- );
132
- });
133
- resolve();
134
- }).catch((err) => {
135
- proxy.close();
136
- let message = err.message;
137
- let description = err.description;
138
- if (err.message.includes("ECONNREFUSED")) {
139
- message = "Connection refused";
140
- try {
141
- description = err.message.split("ECONNREFUSED ")[1].trim();
142
- } catch (e) {
143
- }
144
- }
145
- if (err.message.includes("ENOTFOUND")) {
146
- message = "Host not found";
147
- try {
148
- description = err.message.split("ENOTFOUND ")[1].trim();
149
- } catch (e) {
150
- }
151
- }
152
- if (err.message.includes("ETIMEDOUT")) {
153
- message = "Connection timed out";
154
- try {
155
- description = err.message.split("ETIMEDOUT ")[1].trim();
156
- } catch (e) {
157
142
  }
158
- }
159
- err.message = message;
160
- err.description = description;
161
- throw err;
143
+ );
162
144
  });
163
145
  const db = pgp({
164
146
  ...dbConfig,
165
147
  port: proxyPort,
166
148
  host: import_constants.LOCALHOST
167
149
  });
168
- return { db, pgp };
150
+ abortController.signal.addEventListener("abort", async () => {
151
+ this.logger.debug("configurePostgres: Got abort signal, closing pg connection.");
152
+ try {
153
+ if (!db.$pool.ended) await db.$pool.end();
154
+ } catch (error) {
155
+ this.logger.error("configurePostgres: Encountered error while closing the pool.", {
156
+ error
157
+ });
158
+ throw error;
159
+ }
160
+ });
161
+ return { db, pgp, sshClient };
169
162
  }
170
163
  };
171
164
  return await poolManager.getConnection({
@@ -173,8 +166,10 @@ async function configurePostgres(credentials, options = {}) {
173
166
  nodeType: "postgres",
174
167
  nodeVersion: options.nodeVersion,
175
168
  fallBackHandler,
176
- cleanUpHandler: async ({ db }) => {
177
- if (!db.$pool.ended) await db.$pool.end();
169
+ wasUsed: ({ sshClient }) => {
170
+ if (sshClient) {
171
+ this.helpers.updateLastUsed(sshClient);
172
+ }
178
173
  }
179
174
  });
180
175
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../nodes/Postgres/transport/index.ts"],"sourcesContent":["import type {\n\tIExecuteFunctions,\n\tICredentialTestFunctions,\n\tILoadOptionsFunctions,\n\tITriggerFunctions,\n} from 'n8n-workflow';\nimport { createServer, type AddressInfo } from 'node:net';\nimport pgPromise from 'pg-promise';\n\nimport { ConnectionPoolManager } from '@utils/connection-pool-manager';\nimport { LOCALHOST } from '@utils/constants';\nimport { formatPrivateKey } from '@utils/utilities';\n\nimport type {\n\tConnectionsData,\n\tPgpConnectionParameters,\n\tPostgresNodeCredentials,\n\tPostgresNodeOptions,\n} from '../v2/helpers/interfaces';\n\nconst getPostgresConfig = (\n\tcredentials: PostgresNodeCredentials,\n\toptions: PostgresNodeOptions = {},\n) => {\n\tconst dbConfig: PgpConnectionParameters = {\n\t\thost: credentials.host,\n\t\tport: credentials.port,\n\t\tdatabase: credentials.database,\n\t\tuser: credentials.user,\n\t\tpassword: credentials.password,\n\t\tkeepAlive: true,\n\t\tmax: credentials.maxConnections,\n\t};\n\n\tif (options.connectionTimeout) {\n\t\tdbConfig.connectionTimeoutMillis = options.connectionTimeout * 1000;\n\t}\n\n\tif (options.delayClosingIdleConnection) {\n\t\tdbConfig.keepAliveInitialDelayMillis = options.delayClosingIdleConnection * 1000;\n\t}\n\n\tif (credentials.allowUnauthorizedCerts === true) {\n\t\tdbConfig.ssl = {\n\t\t\trejectUnauthorized: false,\n\t\t};\n\t} else {\n\t\tdbConfig.ssl = !['disable', undefined].includes(credentials.ssl as string | undefined);\n\t\t// @ts-ignore these typings need to be updated\n\t\tdbConfig.sslmode = credentials.ssl || 'disable';\n\t}\n\n\treturn dbConfig;\n};\n\nexport async function configurePostgres(\n\tthis: IExecuteFunctions | ICredentialTestFunctions | ILoadOptionsFunctions | ITriggerFunctions,\n\tcredentials: PostgresNodeCredentials,\n\toptions: PostgresNodeOptions = {},\n): Promise<ConnectionsData> {\n\tconst poolManager = ConnectionPoolManager.getInstance();\n\n\tconst fallBackHandler = async () => {\n\t\tconst pgp = pgPromise({\n\t\t\t// prevent spam in console \"WARNING: Creating a duplicate database object for the same connection.\"\n\t\t\t// duplicate connections created when auto loading parameters, they are closed immediately after, but several could be open at the same time\n\t\t\tnoWarnings: true,\n\t\t});\n\n\t\tif (typeof options.nodeVersion === 'number' && options.nodeVersion >= 2.1) {\n\t\t\t// Always return dates as ISO strings\n\t\t\t[pgp.pg.types.builtins.TIMESTAMP, pgp.pg.types.builtins.TIMESTAMPTZ].forEach((type) => {\n\t\t\t\tpgp.pg.types.setTypeParser(type, (value: string) => {\n\t\t\t\t\tconst parsedDate = new Date(value);\n\n\t\t\t\t\tif (isNaN(parsedDate.getTime())) {\n\t\t\t\t\t\treturn value;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn parsedDate.toISOString();\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\n\t\tif (options.largeNumbersOutput === 'numbers') {\n\t\t\tpgp.pg.types.setTypeParser(20, (value: string) => {\n\t\t\t\treturn parseInt(value, 10);\n\t\t\t});\n\t\t\tpgp.pg.types.setTypeParser(1700, (value: string) => {\n\t\t\t\treturn parseFloat(value);\n\t\t\t});\n\t\t}\n\n\t\tconst dbConfig = getPostgresConfig(credentials, options);\n\n\t\tif (!credentials.sshTunnel) {\n\t\t\tconst db = pgp(dbConfig);\n\n\t\t\treturn { db, pgp };\n\t\t} else {\n\t\t\tif (credentials.sshAuthenticateWith === 'privateKey' && credentials.privateKey) {\n\t\t\t\tcredentials.privateKey = formatPrivateKey(credentials.privateKey);\n\t\t\t}\n\t\t\tconst sshClient = await this.helpers.getSSHClient(credentials);\n\n\t\t\t// Create a TCP proxy listening on a random available port\n\t\t\tconst proxy = createServer();\n\t\t\tconst proxyPort = await new Promise<number>((resolve) => {\n\t\t\t\tproxy.listen(0, LOCALHOST, () => {\n\t\t\t\t\tresolve((proxy.address() as AddressInfo).port);\n\t\t\t\t});\n\t\t\t});\n\n\t\t\tconst close = () => {\n\t\t\t\tproxy.close();\n\t\t\t\tsshClient.off('end', close);\n\t\t\t\tsshClient.off('error', close);\n\t\t\t};\n\t\t\tsshClient.on('end', close);\n\t\t\tsshClient.on('error', close);\n\n\t\t\tawait new Promise<void>((resolve, reject) => {\n\t\t\t\tproxy.on('error', (err) => reject(err));\n\t\t\t\tproxy.on('connection', (localSocket) => {\n\t\t\t\t\tsshClient.forwardOut(\n\t\t\t\t\t\tLOCALHOST,\n\t\t\t\t\t\tlocalSocket.remotePort!,\n\t\t\t\t\t\tcredentials.host,\n\t\t\t\t\t\tcredentials.port,\n\t\t\t\t\t\t(err, clientChannel) => {\n\t\t\t\t\t\t\tif (err) {\n\t\t\t\t\t\t\t\tproxy.close();\n\t\t\t\t\t\t\t\tlocalSocket.destroy();\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tlocalSocket.pipe(clientChannel);\n\t\t\t\t\t\t\t\tclientChannel.pipe(localSocket);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t);\n\t\t\t\t});\n\t\t\t\tresolve();\n\t\t\t}).catch((err) => {\n\t\t\t\tproxy.close();\n\n\t\t\t\tlet message = err.message;\n\t\t\t\tlet description = err.description;\n\n\t\t\t\tif (err.message.includes('ECONNREFUSED')) {\n\t\t\t\t\tmessage = 'Connection refused';\n\t\t\t\t\ttry {\n\t\t\t\t\t\tdescription = err.message.split('ECONNREFUSED ')[1].trim();\n\t\t\t\t\t} catch (e) {}\n\t\t\t\t}\n\n\t\t\t\tif (err.message.includes('ENOTFOUND')) {\n\t\t\t\t\tmessage = 'Host not found';\n\t\t\t\t\ttry {\n\t\t\t\t\t\tdescription = err.message.split('ENOTFOUND ')[1].trim();\n\t\t\t\t\t} catch (e) {}\n\t\t\t\t}\n\n\t\t\t\tif (err.message.includes('ETIMEDOUT')) {\n\t\t\t\t\tmessage = 'Connection timed out';\n\t\t\t\t\ttry {\n\t\t\t\t\t\tdescription = err.message.split('ETIMEDOUT ')[1].trim();\n\t\t\t\t\t} catch (e) {}\n\t\t\t\t}\n\n\t\t\t\terr.message = message;\n\t\t\t\terr.description = description;\n\t\t\t\tthrow err;\n\t\t\t});\n\n\t\t\tconst db = pgp({\n\t\t\t\t...dbConfig,\n\t\t\t\tport: proxyPort,\n\t\t\t\thost: LOCALHOST,\n\t\t\t});\n\t\t\treturn { db, pgp };\n\t\t}\n\t};\n\n\treturn await poolManager.getConnection({\n\t\tcredentials,\n\t\tnodeType: 'postgres',\n\t\tnodeVersion: options.nodeVersion as unknown as string,\n\t\tfallBackHandler,\n\t\tcleanUpHandler: async ({ db }) => {\n\t\t\tif (!db.$pool.ended) await db.$pool.end();\n\t\t},\n\t});\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA,sBAA+C;AAC/C,wBAAsB;AAEtB,qCAAsC;AACtC,uBAA0B;AAC1B,uBAAiC;AASjC,MAAM,oBAAoB,CACzB,aACA,UAA+B,CAAC,MAC5B;AACJ,QAAM,WAAoC;AAAA,IACzC,MAAM,YAAY;AAAA,IAClB,MAAM,YAAY;AAAA,IAClB,UAAU,YAAY;AAAA,IACtB,MAAM,YAAY;AAAA,IAClB,UAAU,YAAY;AAAA,IACtB,WAAW;AAAA,IACX,KAAK,YAAY;AAAA,EAClB;AAEA,MAAI,QAAQ,mBAAmB;AAC9B,aAAS,0BAA0B,QAAQ,oBAAoB;AAAA,EAChE;AAEA,MAAI,QAAQ,4BAA4B;AACvC,aAAS,8BAA8B,QAAQ,6BAA6B;AAAA,EAC7E;AAEA,MAAI,YAAY,2BAA2B,MAAM;AAChD,aAAS,MAAM;AAAA,MACd,oBAAoB;AAAA,IACrB;AAAA,EACD,OAAO;AACN,aAAS,MAAM,CAAC,CAAC,WAAW,MAAS,EAAE,SAAS,YAAY,GAAyB;AAErF,aAAS,UAAU,YAAY,OAAO;AAAA,EACvC;AAEA,SAAO;AACR;AAEA,eAAsB,kBAErB,aACA,UAA+B,CAAC,GACL;AAC3B,QAAM,cAAc,qDAAsB,YAAY;AAEtD,QAAM,kBAAkB,YAAY;AACnC,UAAM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I,cAAc;AAClB,cAAM;AAAA,MACP,CAAC;AAED,YAAM,KAAK,IAAI;AAAA,QACd,GAAG;AAAA,QACH,MAAM;AAAA,QACN,MAAM;AAAA,MACP,CAAC;AACD,aAAO,EAAE,IAAI,IAAI;AAAA,IAClB;AAAA,EACD;AAEA,SAAO,MAAM,YAAY,cAAc;AAAA,IACtC;AAAA,IACA,UAAU;AAAA,IACV,aAAa,QAAQ;AAAA,IACrB;AAAA,IACA,gBAAgB,OAAO,EAAE,GAAG,MAAM;AACjC,UAAI,CAAC,GAAG,MAAM,MAAO,OAAM,GAAG,MAAM,IAAI;AAAA,IACzC;AAAA,EACD,CAAC;AACF;","names":["pgPromise"]}
1
+ {"version":3,"sources":["../../../../nodes/Postgres/transport/index.ts"],"sourcesContent":["import type {\n\tIExecuteFunctions,\n\tICredentialTestFunctions,\n\tILoadOptionsFunctions,\n\tITriggerFunctions,\n\tLogger,\n} from 'n8n-workflow';\nimport { createServer, type AddressInfo, type Server } from 'node:net';\nimport pgPromise from 'pg-promise';\n\nimport { ConnectionPoolManager } from '@utils/connection-pool-manager';\nimport { LOCALHOST } from '@utils/constants';\nimport { formatPrivateKey } from '@utils/utilities';\n\nimport type {\n\tConnectionsData,\n\tPgpConnectionParameters,\n\tPostgresNodeCredentials,\n\tPostgresNodeOptions,\n} from '../v2/helpers/interfaces';\n\nconst getPostgresConfig = (\n\tcredentials: PostgresNodeCredentials,\n\toptions: PostgresNodeOptions = {},\n) => {\n\tconst dbConfig: PgpConnectionParameters = {\n\t\thost: credentials.host,\n\t\tport: credentials.port,\n\t\tdatabase: credentials.database,\n\t\tuser: credentials.user,\n\t\tpassword: credentials.password,\n\t\tkeepAlive: true,\n\t\tmax: credentials.maxConnections,\n\t};\n\n\tif (options.connectionTimeout) {\n\t\tdbConfig.connectionTimeoutMillis = options.connectionTimeout * 1000;\n\t}\n\n\tif (options.delayClosingIdleConnection) {\n\t\tdbConfig.keepAliveInitialDelayMillis = options.delayClosingIdleConnection * 1000;\n\t}\n\n\tif (credentials.allowUnauthorizedCerts === true) {\n\t\tdbConfig.ssl = {\n\t\t\trejectUnauthorized: false,\n\t\t};\n\t} else {\n\t\tdbConfig.ssl = !['disable', undefined].includes(credentials.ssl as string | undefined);\n\t\t// @ts-ignore these typings need to be updated\n\t\tdbConfig.sslmode = credentials.ssl || 'disable';\n\t}\n\n\treturn dbConfig;\n};\n\nfunction withCleanupHandler(proxy: Server, abortController: AbortController, logger: Logger) {\n\tproxy.on('error', (error) => {\n\t\tlogger.error('TCP Proxy: Got error, calling abort controller', { error });\n\t\tabortController.abort();\n\t});\n\tproxy.on('close', () => {\n\t\tlogger.error('TCP Proxy: Was closed, calling abort controller');\n\t\tabortController.abort();\n\t});\n\tproxy.on('drop', (dropArgument) => {\n\t\tlogger.error('TCP Proxy: Connection was dropped, calling abort controller', {\n\t\t\tdropArgument,\n\t\t});\n\t\tabortController.abort();\n\t});\n\tabortController.signal.addEventListener('abort', () => {\n\t\tlogger.debug('Got abort signal. Closing TCP proxy server.');\n\t\tproxy.close();\n\t});\n\n\treturn proxy;\n}\n\nexport async function configurePostgres(\n\tthis: IExecuteFunctions | ICredentialTestFunctions | ILoadOptionsFunctions | ITriggerFunctions,\n\tcredentials: PostgresNodeCredentials,\n\toptions: PostgresNodeOptions = {},\n): Promise<ConnectionsData> {\n\tconst poolManager = ConnectionPoolManager.getInstance(this.logger);\n\n\tconst fallBackHandler = async (abortController: AbortController) => {\n\t\tconst pgp = pgPromise({\n\t\t\t// prevent spam in console \"WARNING: Creating a duplicate database object for the same connection.\"\n\t\t\t// duplicate connections created when auto loading parameters, they are closed immediately after, but several could be open at the same time\n\t\t\tnoWarnings: true,\n\t\t});\n\n\t\tif (typeof options.nodeVersion === 'number' && options.nodeVersion >= 2.1) {\n\t\t\t// Always return dates as ISO strings\n\t\t\t[pgp.pg.types.builtins.TIMESTAMP, pgp.pg.types.builtins.TIMESTAMPTZ].forEach((type) => {\n\t\t\t\tpgp.pg.types.setTypeParser(type, (value: string) => {\n\t\t\t\t\tconst parsedDate = new Date(value);\n\n\t\t\t\t\tif (isNaN(parsedDate.getTime())) {\n\t\t\t\t\t\treturn value;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn parsedDate.toISOString();\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\n\t\tif (options.largeNumbersOutput === 'numbers') {\n\t\t\tpgp.pg.types.setTypeParser(20, (value: string) => {\n\t\t\t\treturn parseInt(value, 10);\n\t\t\t});\n\t\t\tpgp.pg.types.setTypeParser(1700, (value: string) => {\n\t\t\t\treturn parseFloat(value);\n\t\t\t});\n\t\t}\n\n\t\tconst dbConfig = getPostgresConfig(credentials, options);\n\n\t\tif (!credentials.sshTunnel) {\n\t\t\tconst db = pgp(dbConfig);\n\n\t\t\treturn { db, pgp };\n\t\t} else {\n\t\t\tif (credentials.sshAuthenticateWith === 'privateKey' && credentials.privateKey) {\n\t\t\t\tcredentials.privateKey = formatPrivateKey(credentials.privateKey);\n\t\t\t}\n\t\t\tconst sshClient = await this.helpers.getSSHClient(credentials, abortController);\n\n\t\t\t// Create a TCP proxy listening on a random available port\n\t\t\tconst proxy = withCleanupHandler(createServer(), abortController, this.logger);\n\n\t\t\tconst proxyPort = await new Promise<number>((resolve) => {\n\t\t\t\tproxy.listen(0, LOCALHOST, () => {\n\t\t\t\t\tresolve((proxy.address() as AddressInfo).port);\n\t\t\t\t});\n\t\t\t});\n\n\t\t\tproxy.on('connection', (localSocket) => {\n\t\t\t\tsshClient.forwardOut(\n\t\t\t\t\tLOCALHOST,\n\t\t\t\t\tlocalSocket.remotePort!,\n\t\t\t\t\tcredentials.host,\n\t\t\t\t\tcredentials.port,\n\t\t\t\t\t(error, clientChannel) => {\n\t\t\t\t\t\tif (error) {\n\t\t\t\t\t\t\tthis.logger.error('SSH Client: Port forwarding encountered an error', { error });\n\t\t\t\t\t\t\tabortController.abort();\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tlocalSocket.pipe(clientChannel);\n\t\t\t\t\t\t\tclientChannel.pipe(localSocket);\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t);\n\t\t\t});\n\n\t\t\tconst db = pgp({\n\t\t\t\t...dbConfig,\n\t\t\t\tport: proxyPort,\n\t\t\t\thost: LOCALHOST,\n\t\t\t});\n\n\t\t\tabortController.signal.addEventListener('abort', async () => {\n\t\t\t\tthis.logger.debug('configurePostgres: Got abort signal, closing pg connection.');\n\t\t\t\ttry {\n\t\t\t\t\tif (!db.$pool.ended) await db.$pool.end();\n\t\t\t\t} catch (error) {\n\t\t\t\t\tthis.logger.error('configurePostgres: Encountered error while closing the pool.', {\n\t\t\t\t\t\terror,\n\t\t\t\t\t});\n\t\t\t\t\tthrow error;\n\t\t\t\t}\n\t\t\t});\n\n\t\t\treturn { db, pgp, sshClient };\n\t\t}\n\t};\n\n\treturn await poolManager.getConnection({\n\t\tcredentials,\n\t\tnodeType: 'postgres',\n\t\tnodeVersion: options.nodeVersion as unknown as string,\n\t\tfallBackHandler,\n\t\twasUsed: ({ sshClient }) => {\n\t\t\tif (sshClient) {\n\t\t\t\tthis.helpers.updateLastUsed(sshClient);\n\t\t\t}\n\t\t},\n\t});\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAOA,sBAA4D;AAC5D,wBAAsB;AAEtB,qCAAsC;AACtC,uBAA0B;AAC1B,uBAAiC;AASjC,MAAM,oBAAoB,CACzB,aACA,UAA+B,CAAC,MAC5B;AACJ,QAAM,WAAoC;AAAA,IACzC,MAAM,YAAY;AAAA,IAClB,MAAM,YAAY;AAAA,IAClB,UAAU,YAAY;AAAA,IACtB,MAAM,YAAY;AAAA,IAClB,UAAU,YAAY;AAAA,IACtB,WAAW;AAAA,IACX,KAAK,YAAY;AAAA,EAClB;AAEA,MAAI,QAAQ,mBAAmB;AAC9B,aAAS,0BAA0B,QAAQ,oBAAoB;AAAA,EAChE;AAEA,MAAI,QAAQ,4BAA4B;A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ACD;AAAA,QACD;AAAA,MACD,CAAC;AAED,YAAM,KAAK,IAAI;AAAA,QACd,GAAG;AAAA,QACH,MAAM;AAAA,QACN,MAAM;AAAA,MACP,CAAC;AAED,sBAAgB,OAAO,iBAAiB,SAAS,YAAY;AAC5D,aAAK,OAAO,MAAM,6DAA6D;AAC/E,YAAI;AACH,cAAI,CAAC,GAAG,MAAM,MAAO,OAAM,GAAG,MAAM,IAAI;AAAA,QACzC,SAAS,OAAO;AACf,eAAK,OAAO,MAAM,gEAAgE;AAAA,YACjF;AAAA,UACD,CAAC;AACD,gBAAM;AAAA,QACP;AAAA,MACD,CAAC;AAED,aAAO,EAAE,IAAI,KAAK,UAAU;AAAA,IAC7B;AAAA,EACD;AAEA,SAAO,MAAM,YAAY,cAAc;AAAA,IACtC;AAAA,IACA,UAAU;AAAA,IACV,aAAa,QAAQ;AAAA,IACrB;AAAA,IACA,SAAS,CAAC,EAAE,UAAU,MAAM;AAC3B,UAAI,WAAW;AACd,aAAK,QAAQ,eAAe,SAAS;AAAA,MACtC;AAAA,IACD;AAAA,EACD,CAAC;AACF;","names":["pgPromise"]}
@@ -24,7 +24,7 @@ module.exports = __toCommonJS(Wait_node_exports);
24
24
  var import_n8n_workflow = require("n8n-workflow");
25
25
  var import_utilities = require("../../utils/utilities");
26
26
  var import_common = require("../Form/common.descriptions");
27
- var import_utils = require("../Form/utils/utils");
27
+ var import_utils = require("../Form/utils");
28
28
  var import_description = require("../Webhook/description");
29
29
  var import_Webhook = require("../Webhook/Webhook.node");
30
30
  const toWaitAmount = {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../nodes/Wait/Wait.node.ts"],"sourcesContent":["import type {\n\tIExecuteFunctions,\n\tINodeExecutionData,\n\tINodeTypeDescription,\n\tINodeProperties,\n\tIDisplayOptions,\n\tIWebhookFunctions,\n} from 'n8n-workflow';\nimport {\n\tNodeConnectionTypes,\n\tWAIT_INDEFINITELY,\n\tFORM_TRIGGER_NODE_TYPE,\n\ttryToParseDateTime,\n\tNodeOperationError,\n} from 'n8n-workflow';\n\nimport { updateDisplayOptions } from '../../utils/utilities';\nimport {\n\tformDescription,\n\tformFields,\n\trespondWithOptions,\n\tformRespondMode,\n\tformTitle,\n\tappendAttributionToForm,\n} from '../Form/common.descriptions';\nimport { formWebhook } from '../Form/utils/utils';\nimport {\n\tauthenticationProperty,\n\tcredentialsProperty,\n\tdefaultWebhookDescription,\n\thttpMethodsProperty,\n\toptionsProperty,\n\tresponseBinaryPropertyNameProperty,\n\tresponseCodeProperty,\n\tresponseDataProperty,\n\tresponseModeProperty,\n} from '../Webhook/description';\nimport { Webhook } from '../Webhook/Webhook.node';\n\nconst toWaitAmount: INodeProperties = {\n\tdisplayName: 'Wait Amount',\n\tname: 'amount',\n\ttype: 'number',\n\ttypeOptions: {\n\t\tminValue: 0,\n\t\tnumberPrecision: 2,\n\t},\n\tdefault: 1,\n\tdescription: 'The time to wait',\n};\n\nconst unitSelector: INodeProperties = {\n\tdisplayName: 'Wait Unit',\n\tname: 'unit',\n\ttype: 'options',\n\toptions: [\n\t\t{\n\t\t\tname: 'Seconds',\n\t\t\tvalue: 'seconds',\n\t\t},\n\t\t{\n\t\t\tname: 'Minutes',\n\t\t\tvalue: 'minutes',\n\t\t},\n\t\t{\n\t\t\tname: 'Hours',\n\t\t\tvalue: 'hours',\n\t\t},\n\t\t{\n\t\t\tname: 'Days',\n\t\t\tvalue: 'days',\n\t\t},\n\t],\n\tdefault: 'hours',\n\tdescription: 'The time unit of the Wait Amount value',\n};\n\nconst waitTimeProperties: INodeProperties[] = [\n\t{\n\t\tdisplayName: 'Limit Wait Time',\n\t\tname: 'limitWaitTime',\n\t\ttype: 'boolean',\n\t\tdefault: false,\n\t\tdescription:\n\t\t\t'Whether to limit the time this node should wait for a user response before execution resumes',\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\tresume: ['webhook', 'form'],\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tdisplayName: 'Limit Type',\n\t\tname: 'limitType',\n\t\ttype: 'options',\n\t\tdefault: 'afterTimeInterval',\n\t\tdescription:\n\t\t\t'Sets the condition for the execution to resume. Can be a specified date or after some time.',\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\tlimitWaitTime: [true],\n\t\t\t\tresume: ['webhook', 'form'],\n\t\t\t},\n\t\t},\n\t\toptions: [\n\t\t\t{\n\t\t\t\tname: 'After Time Interval',\n\t\t\t\tdescription: 'Waits for a certain amount of time',\n\t\t\t\tvalue: 'afterTimeInterval',\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'At Specified Time',\n\t\t\t\tdescription: 'Waits until the set date and time to continue',\n\t\t\t\tvalue: 'atSpecifiedTime',\n\t\t\t},\n\t\t],\n\t},\n\t{\n\t\tdisplayName: 'Amount',\n\t\tname: 'resumeAmount',\n\t\ttype: 'number',\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\tlimitType: ['afterTimeInterval'],\n\t\t\t\tlimitWaitTime: [true],\n\t\t\t\tresume: ['webhook', 'form'],\n\t\t\t},\n\t\t},\n\t\ttypeOptions: {\n\t\t\tminValue: 0,\n\t\t\tnumberPrecision: 2,\n\t\t},\n\t\tdefault: 1,\n\t\tdescription: 'The time to wait',\n\t},\n\t{\n\t\tdisplayName: 'Unit',\n\t\tname: 'resumeUnit',\n\t\ttype: 'options',\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\tlimitType: ['afterTimeInterval'],\n\t\t\t\tlimitWaitTime: [true],\n\t\t\t\tresume: ['webhook', 'form'],\n\t\t\t},\n\t\t},\n\t\toptions: [\n\t\t\t{\n\t\t\t\tname: 'Seconds',\n\t\t\t\tvalue: 'seconds',\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'Minutes',\n\t\t\t\tvalue: 'minutes',\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'Hours',\n\t\t\t\tvalue: 'hours',\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'Days',\n\t\t\t\tvalue: 'days',\n\t\t\t},\n\t\t],\n\t\tdefault: 'hours',\n\t\tdescription: 'Unit of the interval value',\n\t},\n\t{\n\t\tdisplayName: 'Max Date and Time',\n\t\tname: 'maxDateAndTime',\n\t\ttype: 'dateTime',\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\tlimitType: ['atSpecifiedTime'],\n\t\t\t\tlimitWaitTime: [true],\n\t\t\t\tresume: ['webhook', 'form'],\n\t\t\t},\n\t\t},\n\t\tdefault: '',\n\t\tdescription: 'Continue execution after the specified date and time',\n\t},\n];\n\nconst webhookSuffix: INodeProperties = {\n\tdisplayName: 'Webhook Suffix',\n\tname: 'webhookSuffix',\n\ttype: 'string',\n\tdefault: '',\n\tplaceholder: 'webhook',\n\tnoDataExpression: true,\n\tdescription:\n\t\t'This suffix path will be appended to the restart URL. Helpful when using multiple wait nodes.',\n};\n\nconst displayOnWebhook: IDisplayOptions = {\n\tshow: {\n\t\tresume: ['webhook'],\n\t},\n};\n\nconst displayOnFormSubmission = {\n\tshow: {\n\t\tresume: ['form'],\n\t},\n};\n\nconst onFormSubmitProperties = updateDisplayOptions(displayOnFormSubmission, [\n\tformTitle,\n\tformDescription,\n\tformFields,\n\tformRespondMode,\n]);\n\nconst onWebhookCallProperties = updateDisplayOptions(displayOnWebhook, [\n\t{\n\t\t...httpMethodsProperty,\n\t\tdescription: 'The HTTP method of the Webhook call',\n\t},\n\tresponseCodeProperty,\n\tresponseModeProperty,\n\tresponseDataProperty,\n\tresponseBinaryPropertyNameProperty,\n]);\n\nconst webhookPath = '={{$parameter[\"options\"][\"webhookSuffix\"] || \"\"}}';\n\nexport class Wait extends Webhook {\n\tauthPropertyName = 'incomingAuthentication';\n\n\tdescription: INodeTypeDescription = {\n\t\tdisplayName: 'Wait',\n\t\tname: 'wait',\n\t\ticon: 'fa:pause-circle',\n\t\ticonColor: 'crimson',\n\t\tgroup: ['organization'],\n\t\tversion: [1, 1.1],\n\t\tdescription: 'Wait before continue with execution',\n\t\tdefaults: {\n\t\t\tname: 'Wait',\n\t\t\tcolor: '#804050',\n\t\t},\n\t\tinputs: [NodeConnectionTypes.Main],\n\t\toutputs: [NodeConnectionTypes.Main],\n\t\tcredentials: credentialsProperty(this.authPropertyName),\n\t\twebhooks: [\n\t\t\t{\n\t\t\t\t...defaultWebhookDescription,\n\t\t\t\tresponseData: '={{$parameter[\"responseData\"]}}',\n\t\t\t\tpath: webhookPath,\n\t\t\t\trestartWebhook: true,\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'default',\n\t\t\t\thttpMethod: 'GET',\n\t\t\t\tresponseMode: 'onReceived',\n\t\t\t\tpath: webhookPath,\n\t\t\t\trestartWebhook: true,\n\t\t\t\tisFullPath: true,\n\t\t\t\tnodeType: 'form',\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'default',\n\t\t\t\thttpMethod: 'POST',\n\t\t\t\tresponseMode: '={{$parameter[\"responseMode\"]}}',\n\t\t\t\tresponseData: '={{$parameter[\"responseMode\"] === \"lastNode\" ? \"noData\" : undefined}}',\n\t\t\t\tpath: webhookPath,\n\t\t\t\trestartWebhook: true,\n\t\t\t\tisFullPath: true,\n\t\t\t\tnodeType: 'form',\n\t\t\t},\n\t\t],\n\t\tproperties: [\n\t\t\t{\n\t\t\t\tdisplayName: 'Resume',\n\t\t\t\tname: 'resume',\n\t\t\t\ttype: 'options',\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'After Time Interval',\n\t\t\t\t\t\tvalue: 'timeInterval',\n\t\t\t\t\t\tdescription: 'Waits for a certain amount of time',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'At Specified Time',\n\t\t\t\t\t\tvalue: 'specificTime',\n\t\t\t\t\t\tdescription: 'Waits until a specific date and time to continue',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'On Webhook Call',\n\t\t\t\t\t\tvalue: 'webhook',\n\t\t\t\t\t\tdescription: 'Waits for a webhook call before continuing',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'On Form Submitted',\n\t\t\t\t\t\tvalue: 'form',\n\t\t\t\t\t\tdescription: 'Waits for a form submission before continuing',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\tdefault: 'timeInterval',\n\t\t\t\tdescription: 'Determines the waiting mode to use before the workflow continues',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Authentication',\n\t\t\t\tname: 'incomingAuthentication',\n\t\t\t\ttype: 'options',\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Basic Auth',\n\t\t\t\t\t\tvalue: 'basicAuth',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'None',\n\t\t\t\t\t\tvalue: 'none',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\tdefault: 'none',\n\t\t\t\tdescription:\n\t\t\t\t\t'If and how incoming resume-webhook-requests to $execution.resumeFormUrl should be authenticated for additional security',\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: {\n\t\t\t\t\t\tresume: ['form'],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\t...authenticationProperty(this.authPropertyName),\n\t\t\t\tdescription:\n\t\t\t\t\t'If and how incoming resume-webhook-requests to $execution.resumeUrl should be authenticated for additional security',\n\t\t\t\tdisplayOptions: displayOnWebhook,\n\t\t\t},\n\n\t\t\t// ----------------------------------\n\t\t\t// resume:specificTime\n\t\t\t// ----------------------------------\n\t\t\t{\n\t\t\t\tdisplayName: 'Date and Time',\n\t\t\t\tname: 'dateTime',\n\t\t\t\ttype: 'dateTime',\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: {\n\t\t\t\t\t\tresume: ['specificTime'],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tdefault: '',\n\t\t\t\tdescription: 'The date and time to wait for before continuing',\n\t\t\t\trequired: true,\n\t\t\t},\n\n\t\t\t// ----------------------------------\n\t\t\t// resume:timeInterval\n\t\t\t// ----------------------------------\n\t\t\t{\n\t\t\t\t...toWaitAmount,\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: {\n\t\t\t\t\t\tresume: ['timeInterval'],\n\t\t\t\t\t\t'@version': [1],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\t...toWaitAmount,\n\t\t\t\tdefault: 5,\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: {\n\t\t\t\t\t\tresume: ['timeInterval'],\n\t\t\t\t\t},\n\t\t\t\t\thide: {\n\t\t\t\t\t\t'@version': [1],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\t...unitSelector,\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: {\n\t\t\t\t\t\tresume: ['timeInterval'],\n\t\t\t\t\t\t'@version': [1],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\t...unitSelector,\n\t\t\t\tdefault: 'seconds',\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: {\n\t\t\t\t\t\tresume: ['timeInterval'],\n\t\t\t\t\t},\n\t\t\t\t\thide: {\n\t\t\t\t\t\t'@version': [1],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t// ----------------------------------\n\t\t\t// resume:webhook & form\n\t\t\t// ----------------------------------\n\t\t\t{\n\t\t\t\tdisplayName:\n\t\t\t\t\t'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>',\n\t\t\t\tname: 'webhookNotice',\n\t\t\t\ttype: 'notice',\n\t\t\t\tdisplayOptions: displayOnWebhook,\n\t\t\t\tdefault: '',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName:\n\t\t\t\t\t'The form url will be generated at run time. It can be referenced with the <strong>$execution.resumeFormUrl</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>',\n\t\t\t\tname: 'formNotice',\n\t\t\t\ttype: 'notice',\n\t\t\t\tdisplayOptions: displayOnFormSubmission,\n\t\t\t\tdefault: '',\n\t\t\t},\n\t\t\t...onFormSubmitProperties,\n\t\t\t...onWebhookCallProperties,\n\t\t\t...waitTimeProperties,\n\t\t\t{\n\t\t\t\t...optionsProperty,\n\t\t\t\tdisplayOptions: displayOnWebhook,\n\t\t\t\toptions: [...(optionsProperty.options as INodeProperties[]), webhookSuffix],\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Options',\n\t\t\t\tname: 'options',\n\t\t\t\ttype: 'collection',\n\t\t\t\tplaceholder: 'Add option',\n\t\t\t\tdefault: {},\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: {\n\t\t\t\t\t\tresume: ['form'],\n\t\t\t\t\t},\n\t\t\t\t\thide: {\n\t\t\t\t\t\tresponseMode: ['responseNode'],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\toptions: [appendAttributionToForm, respondWithOptions, webhookSuffix],\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Options',\n\t\t\t\tname: 'options',\n\t\t\t\ttype: 'collection',\n\t\t\t\tplaceholder: 'Add option',\n\t\t\t\tdefault: {},\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: {\n\t\t\t\t\t\tresume: ['form'],\n\t\t\t\t\t},\n\t\t\t\t\thide: {\n\t\t\t\t\t\tresponseMode: ['onReceived', 'lastNode'],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\toptions: [appendAttributionToForm, webhookSuffix],\n\t\t\t},\n\t\t],\n\t};\n\n\tasync webhook(context: IWebhookFunctions) {\n\t\tconst resume = context.getNodeParameter('resume', 0) as string;\n\t\tif (resume === 'form') return await formWebhook(context, this.authPropertyName);\n\t\treturn await super.webhook(context);\n\t}\n\n\tasync execute(context: IExecuteFunctions): Promise<INodeExecutionData[][]> {\n\t\tconst resume = context.getNodeParameter('resume', 0) as string;\n\n\t\tif (['webhook', 'form'].includes(resume)) {\n\t\t\tlet hasFormTrigger = false;\n\n\t\t\tif (resume === 'form') {\n\t\t\t\tconst parentNodes = context.getParentNodes(context.getNode().name);\n\t\t\t\thasFormTrigger = parentNodes.some((node) => node.type === FORM_TRIGGER_NODE_TYPE);\n\t\t\t}\n\n\t\t\tconst returnData = await this.configureAndPutToWait(context);\n\n\t\t\tif (resume === 'form' && hasFormTrigger) {\n\t\t\t\tcontext.sendResponse({\n\t\t\t\t\theaders: {\n\t\t\t\t\t\tlocation: context.evaluateExpression('{{ $execution.resumeFormUrl }}', 0),\n\t\t\t\t\t},\n\t\t\t\t\tstatusCode: 307,\n\t\t\t\t});\n\t\t\t}\n\n\t\t\treturn returnData;\n\t\t}\n\n\t\tlet waitTill: Date;\n\t\tif (resume === 'timeInterval') {\n\t\t\tconst unit = context.getNodeParameter('unit', 0) as string;\n\n\t\t\tlet waitAmount = context.getNodeParameter('amount', 0) as number;\n\t\t\tif (unit === 'minutes') {\n\t\t\t\twaitAmount *= 60;\n\t\t\t}\n\t\t\tif (unit === 'hours') {\n\t\t\t\twaitAmount *= 60 * 60;\n\t\t\t}\n\t\t\tif (unit === 'days') {\n\t\t\t\twaitAmount *= 60 * 60 * 24;\n\t\t\t}\n\n\t\t\twaitAmount *= 1000;\n\n\t\t\t// Timezone does not change relative dates, since they are just\n\t\t\t// a number of seconds added to the current timestamp\n\t\t\twaitTill = new Date(new Date().getTime() + waitAmount);\n\t\t} else {\n\t\t\ttry {\n\t\t\t\tconst dateTimeStrRaw = context.getNodeParameter('dateTime', 0);\n\t\t\t\tconst parsedDateTime = tryToParseDateTime(dateTimeStrRaw, context.getTimezone());\n\n\t\t\t\twaitTill = parsedDateTime.toUTC().toJSDate();\n\t\t\t} catch (e) {\n\t\t\t\tthrow new NodeOperationError(\n\t\t\t\t\tcontext.getNode(),\n\t\t\t\t\t'[Wait node] Cannot put execution to wait because `dateTime` parameter is not a valid date. Please pick a specific date and time to wait until.',\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tconst waitValue = Math.max(waitTill.getTime() - new Date().getTime(), 0);\n\n\t\tif (waitValue < 65000) {\n\t\t\t// If wait time is shorter than 65 seconds leave execution active because\n\t\t\t// we just check the database every 60 seconds.\n\t\t\treturn await new Promise((resolve) => {\n\t\t\t\tconst timer = setTimeout(() => resolve([context.getInputData()]), waitValue);\n\t\t\t\tcontext.onExecutionCancellation(() => clearTimeout(timer));\n\t\t\t});\n\t\t}\n\n\t\t// If longer than 65 seconds put execution to wait\n\t\treturn await this.putToWait(context, waitTill);\n\t}\n\n\tprivate async configureAndPutToWait(context: IExecuteFunctions) {\n\t\tlet waitTill = WAIT_INDEFINITELY;\n\t\tconst limitWaitTime = context.getNodeParameter('limitWaitTime', 0);\n\n\t\tif (limitWaitTime === true) {\n\t\t\tconst limitType = context.getNodeParameter('limitType', 0);\n\n\t\t\tif (limitType === 'afterTimeInterval') {\n\t\t\t\tlet waitAmount = context.getNodeParameter('resumeAmount', 0) as number;\n\t\t\t\tconst resumeUnit = context.getNodeParameter('resumeUnit', 0);\n\n\t\t\t\tif (resumeUnit === 'minutes') {\n\t\t\t\t\twaitAmount *= 60;\n\t\t\t\t}\n\t\t\t\tif (resumeUnit === 'hours') {\n\t\t\t\t\twaitAmount *= 60 * 60;\n\t\t\t\t}\n\t\t\t\tif (resumeUnit === 'days') {\n\t\t\t\t\twaitAmount *= 60 * 60 * 24;\n\t\t\t\t}\n\n\t\t\t\twaitAmount *= 1000;\n\t\t\t\twaitTill = new Date(new Date().getTime() + waitAmount);\n\t\t\t} else {\n\t\t\t\twaitTill = new Date(context.getNodeParameter('maxDateAndTime', 0) as string);\n\t\t\t}\n\t\t}\n\n\t\treturn await this.putToWait(context, waitTill);\n\t}\n\n\tprivate async putToWait(context: IExecuteFunctions, waitTill: Date) {\n\t\tawait context.putExecutionToWait(waitTill);\n\t\treturn [context.getInputData()];\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAQA,0BAMO;AAEP,uBAAqC;AACrC,oBAOO;AACP,mBAA4B;AAC5B,yBAUO;AACP,qBAAwB;AAExB,MAAM,eAAgC;AAAA,EACrC,aAAa;AAAA,EACb,MAAM;AAAA,EACN,MAAM;AAAA,EACN,aAAa;AAAA,IACZ,UAAU;AAAA,IACV,iBAAiB;AAAA,EAClB;AAAA,EACA,SAAS;AAAA,EACT,aAAa;AACd;AAEA,MAAM,eAAgC;AAAA,EACrC,aAAa;AAAA,EACb,MAAM;AAAA,EACN,MAAM;AAAA,EACN,SAAS;AAAA,IACR;AAAA,MACC,MAAM;AAAA,MACN,OAAO;AAAA,IACR;AAAA,IACA;AAAA,MACC,MAAM;AAAA,MACN,OAAO;AAAA,IACR;AAAA,IACA;AAAA,MACC,MAAM;AAAA,MACN,OAAO;AAAA,IACR;AAAA,IACA;AAAA,MACC,MAAM;AAAA,MACN,OAAO;AAAA,IACR;AAAA,EACD;AAAA,EACA,SAAS;AAAA,EACT,aAAa;AACd;AAEA,MAAM,qBAAwC;AAAA,EAC7C;AAAA,IACC,aAAa;AAAA,IACb,MAAM;AAAA,IACN,MAAM;AAAA,IACN,SAAS;AAAA,IACT,aACC;AAAA,IACD,gBAAgB;AAAA,MACf,MAAM;AAAA,QACL,QAAQ,CAAC,WAAW,MAAM;AAAA,MAC3B;AAAA,IACD;AAAA,EACD;AAAA,EACA;AAAA,IACC,aAAa;AAAA,IACb,MAAM;AAAA,IACN,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AAC3E,gBAAQ,wBAAwB,MAAM,aAAa,KAAK,CAAC;AAAA,MAC1D,CAAC;AAAA,IACF;AAGA,WAAO,MAAM,KAAK,UAAU,SAAS,QAAQ;AAAA,EAC9C;AAAA,EAEA,MAAc,sBAAsB,SAA4B;AAC/D,QAAI,WAAW;AACf,UAAM,gBAAgB,QAAQ,iBAAiB,iBAAiB,CAAC;AAEjE,QAAI,kBAAkB,MAAM;AAC3B,YAAM,YAAY,QAAQ,iBAAiB,aAAa,CAAC;AAEzD,UAAI,cAAc,qBAAqB;AACtC,YAAI,aAAa,QAAQ,iBAAiB,gBAAgB,CAAC;AAC3D,cAAM,aAAa,QAAQ,iBAAiB,cAAc,CAAC;AAE3D,YAAI,eAAe,WAAW;AAC7B,wBAAc;AAAA,QACf;AACA,YAAI,eAAe,SAAS;AAC3B,wBAAc,KAAK;AAAA,QACpB;AACA,YAAI,eAAe,QAAQ;AAC1B,wBAAc,KAAK,KAAK;AAAA,QACzB;AAEA,sBAAc;AACd,mBAAW,IAAI,MAAK,oBAAI,KAAK,GAAE,QAAQ,IAAI,UAAU;AAAA,MACtD,OAAO;AACN,mBAAW,IAAI,KAAK,QAAQ,iBAAiB,kBAAkB,CAAC,CAAW;AAAA,MAC5E;AAAA,IACD;AAEA,WAAO,MAAM,KAAK,UAAU,SAAS,QAAQ;AAAA,EAC9C;AAAA,EAEA,MAAc,UAAU,SAA4B,UAAgB;AACnE,UAAM,QAAQ,mBAAmB,QAAQ;AACzC,WAAO,CAAC,QAAQ,aAAa,CAAC;AAAA,EAC/B;AACD;","names":[]}
1
+ {"version":3,"sources":["../../../nodes/Wait/Wait.node.ts"],"sourcesContent":["import type {\n\tIExecuteFunctions,\n\tINodeExecutionData,\n\tINodeTypeDescription,\n\tINodeProperties,\n\tIDisplayOptions,\n\tIWebhookFunctions,\n} from 'n8n-workflow';\nimport {\n\tNodeConnectionTypes,\n\tWAIT_INDEFINITELY,\n\tFORM_TRIGGER_NODE_TYPE,\n\ttryToParseDateTime,\n\tNodeOperationError,\n} from 'n8n-workflow';\n\nimport { updateDisplayOptions } from '../../utils/utilities';\nimport {\n\tformDescription,\n\tformFields,\n\trespondWithOptions,\n\tformRespondMode,\n\tformTitle,\n\tappendAttributionToForm,\n} from '../Form/common.descriptions';\nimport { formWebhook } from '../Form/utils';\nimport {\n\tauthenticationProperty,\n\tcredentialsProperty,\n\tdefaultWebhookDescription,\n\thttpMethodsProperty,\n\toptionsProperty,\n\tresponseBinaryPropertyNameProperty,\n\tresponseCodeProperty,\n\tresponseDataProperty,\n\tresponseModeProperty,\n} from '../Webhook/description';\nimport { Webhook } from '../Webhook/Webhook.node';\n\nconst toWaitAmount: INodeProperties = {\n\tdisplayName: 'Wait Amount',\n\tname: 'amount',\n\ttype: 'number',\n\ttypeOptions: {\n\t\tminValue: 0,\n\t\tnumberPrecision: 2,\n\t},\n\tdefault: 1,\n\tdescription: 'The time to wait',\n};\n\nconst unitSelector: INodeProperties = {\n\tdisplayName: 'Wait Unit',\n\tname: 'unit',\n\ttype: 'options',\n\toptions: [\n\t\t{\n\t\t\tname: 'Seconds',\n\t\t\tvalue: 'seconds',\n\t\t},\n\t\t{\n\t\t\tname: 'Minutes',\n\t\t\tvalue: 'minutes',\n\t\t},\n\t\t{\n\t\t\tname: 'Hours',\n\t\t\tvalue: 'hours',\n\t\t},\n\t\t{\n\t\t\tname: 'Days',\n\t\t\tvalue: 'days',\n\t\t},\n\t],\n\tdefault: 'hours',\n\tdescription: 'The time unit of the Wait Amount value',\n};\n\nconst waitTimeProperties: INodeProperties[] = [\n\t{\n\t\tdisplayName: 'Limit Wait Time',\n\t\tname: 'limitWaitTime',\n\t\ttype: 'boolean',\n\t\tdefault: false,\n\t\tdescription:\n\t\t\t'Whether to limit the time this node should wait for a user response before execution resumes',\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\tresume: ['webhook', 'form'],\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tdisplayName: 'Limit Type',\n\t\tname: 'limitType',\n\t\ttype: 'options',\n\t\tdefault: 'afterTimeInterval',\n\t\tdescription:\n\t\t\t'Sets the condition for the execution to resume. Can be a specified date or after some time.',\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\tlimitWaitTime: [true],\n\t\t\t\tresume: ['webhook', 'form'],\n\t\t\t},\n\t\t},\n\t\toptions: [\n\t\t\t{\n\t\t\t\tname: 'After Time Interval',\n\t\t\t\tdescription: 'Waits for a certain amount of time',\n\t\t\t\tvalue: 'afterTimeInterval',\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'At Specified Time',\n\t\t\t\tdescription: 'Waits until the set date and time to continue',\n\t\t\t\tvalue: 'atSpecifiedTime',\n\t\t\t},\n\t\t],\n\t},\n\t{\n\t\tdisplayName: 'Amount',\n\t\tname: 'resumeAmount',\n\t\ttype: 'number',\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\tlimitType: ['afterTimeInterval'],\n\t\t\t\tlimitWaitTime: [true],\n\t\t\t\tresume: ['webhook', 'form'],\n\t\t\t},\n\t\t},\n\t\ttypeOptions: {\n\t\t\tminValue: 0,\n\t\t\tnumberPrecision: 2,\n\t\t},\n\t\tdefault: 1,\n\t\tdescription: 'The time to wait',\n\t},\n\t{\n\t\tdisplayName: 'Unit',\n\t\tname: 'resumeUnit',\n\t\ttype: 'options',\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\tlimitType: ['afterTimeInterval'],\n\t\t\t\tlimitWaitTime: [true],\n\t\t\t\tresume: ['webhook', 'form'],\n\t\t\t},\n\t\t},\n\t\toptions: [\n\t\t\t{\n\t\t\t\tname: 'Seconds',\n\t\t\t\tvalue: 'seconds',\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'Minutes',\n\t\t\t\tvalue: 'minutes',\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'Hours',\n\t\t\t\tvalue: 'hours',\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'Days',\n\t\t\t\tvalue: 'days',\n\t\t\t},\n\t\t],\n\t\tdefault: 'hours',\n\t\tdescription: 'Unit of the interval value',\n\t},\n\t{\n\t\tdisplayName: 'Max Date and Time',\n\t\tname: 'maxDateAndTime',\n\t\ttype: 'dateTime',\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\tlimitType: ['atSpecifiedTime'],\n\t\t\t\tlimitWaitTime: [true],\n\t\t\t\tresume: ['webhook', 'form'],\n\t\t\t},\n\t\t},\n\t\tdefault: '',\n\t\tdescription: 'Continue execution after the specified date and time',\n\t},\n];\n\nconst webhookSuffix: INodeProperties = {\n\tdisplayName: 'Webhook Suffix',\n\tname: 'webhookSuffix',\n\ttype: 'string',\n\tdefault: '',\n\tplaceholder: 'webhook',\n\tnoDataExpression: true,\n\tdescription:\n\t\t'This suffix path will be appended to the restart URL. Helpful when using multiple wait nodes.',\n};\n\nconst displayOnWebhook: IDisplayOptions = {\n\tshow: {\n\t\tresume: ['webhook'],\n\t},\n};\n\nconst displayOnFormSubmission = {\n\tshow: {\n\t\tresume: ['form'],\n\t},\n};\n\nconst onFormSubmitProperties = updateDisplayOptions(displayOnFormSubmission, [\n\tformTitle,\n\tformDescription,\n\tformFields,\n\tformRespondMode,\n]);\n\nconst onWebhookCallProperties = updateDisplayOptions(displayOnWebhook, [\n\t{\n\t\t...httpMethodsProperty,\n\t\tdescription: 'The HTTP method of the Webhook call',\n\t},\n\tresponseCodeProperty,\n\tresponseModeProperty,\n\tresponseDataProperty,\n\tresponseBinaryPropertyNameProperty,\n]);\n\nconst webhookPath = '={{$parameter[\"options\"][\"webhookSuffix\"] || \"\"}}';\n\nexport class Wait extends Webhook {\n\tauthPropertyName = 'incomingAuthentication';\n\n\tdescription: INodeTypeDescription = {\n\t\tdisplayName: 'Wait',\n\t\tname: 'wait',\n\t\ticon: 'fa:pause-circle',\n\t\ticonColor: 'crimson',\n\t\tgroup: ['organization'],\n\t\tversion: [1, 1.1],\n\t\tdescription: 'Wait before continue with execution',\n\t\tdefaults: {\n\t\t\tname: 'Wait',\n\t\t\tcolor: '#804050',\n\t\t},\n\t\tinputs: [NodeConnectionTypes.Main],\n\t\toutputs: [NodeConnectionTypes.Main],\n\t\tcredentials: credentialsProperty(this.authPropertyName),\n\t\twebhooks: [\n\t\t\t{\n\t\t\t\t...defaultWebhookDescription,\n\t\t\t\tresponseData: '={{$parameter[\"responseData\"]}}',\n\t\t\t\tpath: webhookPath,\n\t\t\t\trestartWebhook: true,\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'default',\n\t\t\t\thttpMethod: 'GET',\n\t\t\t\tresponseMode: 'onReceived',\n\t\t\t\tpath: webhookPath,\n\t\t\t\trestartWebhook: true,\n\t\t\t\tisFullPath: true,\n\t\t\t\tnodeType: 'form',\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'default',\n\t\t\t\thttpMethod: 'POST',\n\t\t\t\tresponseMode: '={{$parameter[\"responseMode\"]}}',\n\t\t\t\tresponseData: '={{$parameter[\"responseMode\"] === \"lastNode\" ? \"noData\" : undefined}}',\n\t\t\t\tpath: webhookPath,\n\t\t\t\trestartWebhook: true,\n\t\t\t\tisFullPath: true,\n\t\t\t\tnodeType: 'form',\n\t\t\t},\n\t\t],\n\t\tproperties: [\n\t\t\t{\n\t\t\t\tdisplayName: 'Resume',\n\t\t\t\tname: 'resume',\n\t\t\t\ttype: 'options',\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'After Time Interval',\n\t\t\t\t\t\tvalue: 'timeInterval',\n\t\t\t\t\t\tdescription: 'Waits for a certain amount of time',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'At Specified Time',\n\t\t\t\t\t\tvalue: 'specificTime',\n\t\t\t\t\t\tdescription: 'Waits until a specific date and time to continue',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'On Webhook Call',\n\t\t\t\t\t\tvalue: 'webhook',\n\t\t\t\t\t\tdescription: 'Waits for a webhook call before continuing',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'On Form Submitted',\n\t\t\t\t\t\tvalue: 'form',\n\t\t\t\t\t\tdescription: 'Waits for a form submission before continuing',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\tdefault: 'timeInterval',\n\t\t\t\tdescription: 'Determines the waiting mode to use before the workflow continues',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Authentication',\n\t\t\t\tname: 'incomingAuthentication',\n\t\t\t\ttype: 'options',\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Basic Auth',\n\t\t\t\t\t\tvalue: 'basicAuth',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'None',\n\t\t\t\t\t\tvalue: 'none',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\tdefault: 'none',\n\t\t\t\tdescription:\n\t\t\t\t\t'If and how incoming resume-webhook-requests to $execution.resumeFormUrl should be authenticated for additional security',\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: {\n\t\t\t\t\t\tresume: ['form'],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\t...authenticationProperty(this.authPropertyName),\n\t\t\t\tdescription:\n\t\t\t\t\t'If and how incoming resume-webhook-requests to $execution.resumeUrl should be authenticated for additional security',\n\t\t\t\tdisplayOptions: displayOnWebhook,\n\t\t\t},\n\n\t\t\t// ----------------------------------\n\t\t\t// resume:specificTime\n\t\t\t// ----------------------------------\n\t\t\t{\n\t\t\t\tdisplayName: 'Date and Time',\n\t\t\t\tname: 'dateTime',\n\t\t\t\ttype: 'dateTime',\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: {\n\t\t\t\t\t\tresume: ['specificTime'],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tdefault: '',\n\t\t\t\tdescription: 'The date and time to wait for before continuing',\n\t\t\t\trequired: true,\n\t\t\t},\n\n\t\t\t// ----------------------------------\n\t\t\t// resume:timeInterval\n\t\t\t// ----------------------------------\n\t\t\t{\n\t\t\t\t...toWaitAmount,\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: {\n\t\t\t\t\t\tresume: ['timeInterval'],\n\t\t\t\t\t\t'@version': [1],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\t...toWaitAmount,\n\t\t\t\tdefault: 5,\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: {\n\t\t\t\t\t\tresume: ['timeInterval'],\n\t\t\t\t\t},\n\t\t\t\t\thide: {\n\t\t\t\t\t\t'@version': [1],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\t...unitSelector,\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: {\n\t\t\t\t\t\tresume: ['timeInterval'],\n\t\t\t\t\t\t'@version': [1],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\t...unitSelector,\n\t\t\t\tdefault: 'seconds',\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: {\n\t\t\t\t\t\tresume: ['timeInterval'],\n\t\t\t\t\t},\n\t\t\t\t\thide: {\n\t\t\t\t\t\t'@version': [1],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t// ----------------------------------\n\t\t\t// resume:webhook & form\n\t\t\t// ----------------------------------\n\t\t\t{\n\t\t\t\tdisplayName:\n\t\t\t\t\t'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>',\n\t\t\t\tname: 'webhookNotice',\n\t\t\t\ttype: 'notice',\n\t\t\t\tdisplayOptions: displayOnWebhook,\n\t\t\t\tdefault: '',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName:\n\t\t\t\t\t'The form url will be generated at run time. It can be referenced with the <strong>$execution.resumeFormUrl</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>',\n\t\t\t\tname: 'formNotice',\n\t\t\t\ttype: 'notice',\n\t\t\t\tdisplayOptions: displayOnFormSubmission,\n\t\t\t\tdefault: '',\n\t\t\t},\n\t\t\t...onFormSubmitProperties,\n\t\t\t...onWebhookCallProperties,\n\t\t\t...waitTimeProperties,\n\t\t\t{\n\t\t\t\t...optionsProperty,\n\t\t\t\tdisplayOptions: displayOnWebhook,\n\t\t\t\toptions: [...(optionsProperty.options as INodeProperties[]), webhookSuffix],\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Options',\n\t\t\t\tname: 'options',\n\t\t\t\ttype: 'collection',\n\t\t\t\tplaceholder: 'Add option',\n\t\t\t\tdefault: {},\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: {\n\t\t\t\t\t\tresume: ['form'],\n\t\t\t\t\t},\n\t\t\t\t\thide: {\n\t\t\t\t\t\tresponseMode: ['responseNode'],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\toptions: [appendAttributionToForm, respondWithOptions, webhookSuffix],\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Options',\n\t\t\t\tname: 'options',\n\t\t\t\ttype: 'collection',\n\t\t\t\tplaceholder: 'Add option',\n\t\t\t\tdefault: {},\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: {\n\t\t\t\t\t\tresume: ['form'],\n\t\t\t\t\t},\n\t\t\t\t\thide: {\n\t\t\t\t\t\tresponseMode: ['onReceived', 'lastNode'],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\toptions: [appendAttributionToForm, webhookSuffix],\n\t\t\t},\n\t\t],\n\t};\n\n\tasync webhook(context: IWebhookFunctions) {\n\t\tconst resume = context.getNodeParameter('resume', 0) as string;\n\t\tif (resume === 'form') return await formWebhook(context, this.authPropertyName);\n\t\treturn await super.webhook(context);\n\t}\n\n\tasync execute(context: IExecuteFunctions): Promise<INodeExecutionData[][]> {\n\t\tconst resume = context.getNodeParameter('resume', 0) as string;\n\n\t\tif (['webhook', 'form'].includes(resume)) {\n\t\t\tlet hasFormTrigger = false;\n\n\t\t\tif (resume === 'form') {\n\t\t\t\tconst parentNodes = context.getParentNodes(context.getNode().name);\n\t\t\t\thasFormTrigger = parentNodes.some((node) => node.type === FORM_TRIGGER_NODE_TYPE);\n\t\t\t}\n\n\t\t\tconst returnData = await this.configureAndPutToWait(context);\n\n\t\t\tif (resume === 'form' && hasFormTrigger) {\n\t\t\t\tcontext.sendResponse({\n\t\t\t\t\theaders: {\n\t\t\t\t\t\tlocation: context.evaluateExpression('{{ $execution.resumeFormUrl }}', 0),\n\t\t\t\t\t},\n\t\t\t\t\tstatusCode: 307,\n\t\t\t\t});\n\t\t\t}\n\n\t\t\treturn returnData;\n\t\t}\n\n\t\tlet waitTill: Date;\n\t\tif (resume === 'timeInterval') {\n\t\t\tconst unit = context.getNodeParameter('unit', 0) as string;\n\n\t\t\tlet waitAmount = context.getNodeParameter('amount', 0) as number;\n\t\t\tif (unit === 'minutes') {\n\t\t\t\twaitAmount *= 60;\n\t\t\t}\n\t\t\tif (unit === 'hours') {\n\t\t\t\twaitAmount *= 60 * 60;\n\t\t\t}\n\t\t\tif (unit === 'days') {\n\t\t\t\twaitAmount *= 60 * 60 * 24;\n\t\t\t}\n\n\t\t\twaitAmount *= 1000;\n\n\t\t\t// Timezone does not change relative dates, since they are just\n\t\t\t// a number of seconds added to the current timestamp\n\t\t\twaitTill = new Date(new Date().getTime() + waitAmount);\n\t\t} else {\n\t\t\ttry {\n\t\t\t\tconst dateTimeStrRaw = context.getNodeParameter('dateTime', 0);\n\t\t\t\tconst parsedDateTime = tryToParseDateTime(dateTimeStrRaw, context.getTimezone());\n\n\t\t\t\twaitTill = parsedDateTime.toUTC().toJSDate();\n\t\t\t} catch (e) {\n\t\t\t\tthrow new NodeOperationError(\n\t\t\t\t\tcontext.getNode(),\n\t\t\t\t\t'[Wait node] Cannot put execution to wait because `dateTime` parameter is not a valid date. Please pick a specific date and time to wait until.',\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tconst waitValue = Math.max(waitTill.getTime() - new Date().getTime(), 0);\n\n\t\tif (waitValue < 65000) {\n\t\t\t// If wait time is shorter than 65 seconds leave execution active because\n\t\t\t// we just check the database every 60 seconds.\n\t\t\treturn await new Promise((resolve) => {\n\t\t\t\tconst timer = setTimeout(() => resolve([context.getInputData()]), waitValue);\n\t\t\t\tcontext.onExecutionCancellation(() => clearTimeout(timer));\n\t\t\t});\n\t\t}\n\n\t\t// If longer than 65 seconds put execution to wait\n\t\treturn await this.putToWait(context, waitTill);\n\t}\n\n\tprivate async configureAndPutToWait(context: IExecuteFunctions) {\n\t\tlet waitTill = WAIT_INDEFINITELY;\n\t\tconst limitWaitTime = context.getNodeParameter('limitWaitTime', 0);\n\n\t\tif (limitWaitTime === true) {\n\t\t\tconst limitType = context.getNodeParameter('limitType', 0);\n\n\t\t\tif (limitType === 'afterTimeInterval') {\n\t\t\t\tlet waitAmount = context.getNodeParameter('resumeAmount', 0) as number;\n\t\t\t\tconst resumeUnit = context.getNodeParameter('resumeUnit', 0);\n\n\t\t\t\tif (resumeUnit === 'minutes') {\n\t\t\t\t\twaitAmount *= 60;\n\t\t\t\t}\n\t\t\t\tif (resumeUnit === 'hours') {\n\t\t\t\t\twaitAmount *= 60 * 60;\n\t\t\t\t}\n\t\t\t\tif (resumeUnit === 'days') {\n\t\t\t\t\twaitAmount *= 60 * 60 * 24;\n\t\t\t\t}\n\n\t\t\t\twaitAmount *= 1000;\n\t\t\t\twaitTill = new Date(new Date().getTime() + waitAmount);\n\t\t\t} else {\n\t\t\t\twaitTill = new Date(context.getNodeParameter('maxDateAndTime', 0) as string);\n\t\t\t}\n\t\t}\n\n\t\treturn await this.putToWait(context, waitTill);\n\t}\n\n\tprivate async putToWait(context: IExecuteFunctions, waitTill: Date) {\n\t\tawait context.putExecutionToWait(waitTill);\n\t\treturn [context.getInputData()];\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAQA,0BAMO;AAEP,uBAAqC;AACrC,oBAOO;AACP,mBAA4B;AAC5B,yBAUO;AACP,qBAAwB;AAExB,MAAM,eAAgC;AAAA,EACrC,aAAa;AAAA,EACb,MAAM;AAAA,EACN,MAAM;AAAA,EACN,aAAa;AAAA,IACZ,UAAU;AAAA,IACV,iBAAiB;AAAA,EAClB;AAAA,EACA,SAAS;AAAA,EACT,aAAa;AACd;AAEA,MAAM,eAAgC;AAAA,EACrC,aAAa;AAAA,EACb,MAAM;AAAA,EACN,MAAM;AAAA,EACN,SAAS;AAAA,IACR;AAAA,MACC,MAAM;AAAA,MACN,OAAO;AAAA,IACR;AAAA,IACA;AAAA,MACC,MAAM;AAAA,MACN,OAAO;AAAA,IACR;AAAA,IACA;AAAA,MACC,MAAM;AAAA,MACN,OAAO;AAAA,IACR;AAAA,IACA;AAAA,MACC,MAAM;AAAA,MACN,OAAO;AAAA,IACR;AAAA,EACD;AAAA,EACA,SAAS;AAAA,EACT,aAAa;AACd;AAEA,MAAM,qBAAwC;AAAA,EAC7C;AAAA,IACC,aAAa;AAAA,IACb,MAAM;AAAA,IACN,MAAM;AAAA,IACN,SAAS;AAAA,IACT,aACC;AAAA,IACD,gBAAgB;AAAA,MACf,MAAM;AAAA,QACL,QAAQ,CAAC,WAAW,MAAM;AAAA,MAC3B;AAAA,IACD;AAAA,EACD;AAAA,EACA;AAAA,IACC,aAAa;AAAA,IACb,MAAM;AAAA,IACN,MAAM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