n8n-nodes-base 1.64.1 → 1.66.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 (93) hide show
  1. package/dist/build.tsbuildinfo +1 -1
  2. package/dist/credentials/GoogleBusinessProfileOAuth2Api.credentials.d.ts +8 -0
  3. package/dist/credentials/GoogleBusinessProfileOAuth2Api.credentials.js +28 -0
  4. package/dist/credentials/GoogleBusinessProfileOAuth2Api.credentials.js.map +1 -0
  5. package/dist/known/credentials.json +15 -0
  6. package/dist/known/nodes.json +12 -0
  7. package/dist/nodes/Asana/GenericFunctions.js +1 -0
  8. package/dist/nodes/Asana/GenericFunctions.js.map +1 -1
  9. package/dist/nodes/Code/JsCodeValidator.js.map +1 -1
  10. package/dist/nodes/Code/JsTaskRunnerSandbox.js +5 -4
  11. package/dist/nodes/Code/JsTaskRunnerSandbox.js.map +1 -1
  12. package/dist/nodes/Code/Sandbox.d.ts +2 -2
  13. package/dist/nodes/Code/Sandbox.js.map +1 -1
  14. package/dist/nodes/Code/errors/WrappedExecutionError.js +0 -3
  15. package/dist/nodes/Code/errors/WrappedExecutionError.js.map +1 -1
  16. package/dist/nodes/DebugHelper/DebugHelper.node.js.map +1 -1
  17. package/dist/nodes/EmailReadImap/v2/EmailReadImapV2.node.js.map +1 -1
  18. package/dist/nodes/Form/Form.node.d.ts +18 -0
  19. package/dist/nodes/Form/Form.node.js +331 -0
  20. package/dist/nodes/Form/Form.node.js.map +1 -0
  21. package/dist/nodes/Form/Form.node.json +18 -0
  22. package/dist/nodes/Form/FormTrigger.node.js +3 -2
  23. package/dist/nodes/Form/FormTrigger.node.js.map +1 -1
  24. package/dist/nodes/Form/interfaces.d.ts +1 -15
  25. package/dist/nodes/Form/interfaces.js.map +1 -1
  26. package/dist/nodes/Form/utils.d.ts +24 -5
  27. package/dist/nodes/Form/utils.js +157 -78
  28. package/dist/nodes/Form/utils.js.map +1 -1
  29. package/dist/nodes/Form/v1/FormTriggerV1.node.d.ts +3 -1
  30. package/dist/nodes/Form/v1/FormTriggerV1.node.js +1 -1
  31. package/dist/nodes/Form/v1/FormTriggerV1.node.js.map +1 -1
  32. package/dist/nodes/Form/v2/FormTriggerV2.node.d.ts +3 -1
  33. package/dist/nodes/Form/v2/FormTriggerV2.node.js +33 -7
  34. package/dist/nodes/Form/v2/FormTriggerV2.node.js.map +1 -1
  35. package/dist/nodes/Github/GenericFunctions.d.ts +1 -0
  36. package/dist/nodes/Github/GenericFunctions.js +11 -0
  37. package/dist/nodes/Github/GenericFunctions.js.map +1 -1
  38. package/dist/nodes/Github/Github.node.d.ts +2 -1
  39. package/dist/nodes/Github/Github.node.js +169 -0
  40. package/dist/nodes/Github/Github.node.js.map +1 -1
  41. package/dist/nodes/Github/SearchFunctions.d.ts +1 -0
  42. package/dist/nodes/Github/SearchFunctions.js +23 -0
  43. package/dist/nodes/Github/SearchFunctions.js.map +1 -1
  44. package/dist/nodes/Google/BusinessProfile/GenericFunctions.d.ts +15 -0
  45. package/dist/nodes/Google/BusinessProfile/GenericFunctions.js +335 -0
  46. package/dist/nodes/Google/BusinessProfile/GenericFunctions.js.map +1 -0
  47. package/dist/nodes/Google/BusinessProfile/GoogleBusinessProfile.node.d.ts +13 -0
  48. package/dist/nodes/Google/BusinessProfile/GoogleBusinessProfile.node.js +79 -0
  49. package/dist/nodes/Google/BusinessProfile/GoogleBusinessProfile.node.js.map +1 -0
  50. package/dist/nodes/Google/BusinessProfile/GoogleBusinessProfile.node.json +19 -0
  51. package/dist/nodes/Google/BusinessProfile/GoogleBusinessProfileTrigger.node.d.ts +12 -0
  52. package/dist/nodes/Google/BusinessProfile/GoogleBusinessProfileTrigger.node.js +166 -0
  53. package/dist/nodes/Google/BusinessProfile/GoogleBusinessProfileTrigger.node.js.map +1 -0
  54. package/dist/nodes/Google/BusinessProfile/GoogleBusinessProfileTrigger.node.json +19 -0
  55. package/dist/nodes/Google/BusinessProfile/Interfaces.d.ts +21 -0
  56. package/dist/nodes/Google/BusinessProfile/Interfaces.js +3 -0
  57. package/dist/nodes/Google/BusinessProfile/Interfaces.js.map +1 -0
  58. package/dist/nodes/Google/BusinessProfile/PostDescription.d.ts +3 -0
  59. package/dist/nodes/Google/BusinessProfile/PostDescription.js +966 -0
  60. package/dist/nodes/Google/BusinessProfile/PostDescription.js.map +1 -0
  61. package/dist/nodes/Google/BusinessProfile/ReviewDescription.d.ts +3 -0
  62. package/dist/nodes/Google/BusinessProfile/ReviewDescription.js +552 -0
  63. package/dist/nodes/Google/BusinessProfile/ReviewDescription.js.map +1 -0
  64. package/dist/nodes/Google/BusinessProfile/googleBusinessProfile.svg +1 -0
  65. package/dist/nodes/Google/Sheet/v2/actions/sheet/append.operation.js +1 -1
  66. package/dist/nodes/Google/Sheet/v2/actions/sheet/append.operation.js.map +1 -1
  67. package/dist/nodes/InvoiceNinja/InvoiceNinja.node.js.map +1 -1
  68. package/dist/nodes/Kafka/Kafka.node.js.map +1 -1
  69. package/dist/nodes/Lemlist/GenericFunctions.js +1 -1
  70. package/dist/nodes/Lemlist/GenericFunctions.js.map +1 -1
  71. package/dist/nodes/Lemlist/v2/descriptions/EnrichmentDescription.js +2 -2
  72. package/dist/nodes/Lemlist/v2/descriptions/LeadDescription.js +1 -1
  73. package/dist/nodes/Lemlist/v2/descriptions/TeamDescription.js +1 -1
  74. package/dist/nodes/Lemlist/v2/descriptions/TeamDescription.js.map +1 -1
  75. package/dist/nodes/Microsoft/Sql/GenericFunctions.d.ts +2 -1
  76. package/dist/nodes/Microsoft/Sql/GenericFunctions.js +30 -1
  77. package/dist/nodes/Microsoft/Sql/GenericFunctions.js.map +1 -1
  78. package/dist/nodes/Microsoft/Sql/MicrosoftSql.node.js +3 -9
  79. package/dist/nodes/Microsoft/Sql/MicrosoftSql.node.js.map +1 -1
  80. package/dist/nodes/MongoDb/MongoDb.node.js.map +1 -1
  81. package/dist/nodes/Postgres/PostgresTrigger.node.js.map +1 -1
  82. package/dist/nodes/Postgres/v2/transport/index.js +5 -1
  83. package/dist/nodes/Postgres/v2/transport/index.js.map +1 -1
  84. package/dist/nodes/Set/v2/helpers/utils.d.ts +3 -3
  85. package/dist/nodes/Set/v2/helpers/utils.js.map +1 -1
  86. package/dist/nodes/Set/v2/manual.mode.d.ts +2 -2
  87. package/dist/nodes/Set/v2/manual.mode.js.map +1 -1
  88. package/dist/nodes/Ssh/Ssh.node.js +36 -38
  89. package/dist/nodes/Ssh/Ssh.node.js.map +1 -1
  90. package/dist/nodes/Transform/RemoveDuplicates/v1/RemoveDuplicatesV1.node.js.map +1 -1
  91. package/dist/types/credentials.json +1 -0
  92. package/dist/types/nodes.json +10 -7
  93. package/package.json +12 -8
@@ -0,0 +1,331 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Form = void 0;
4
+ const n8n_workflow_1 = require("n8n-workflow");
5
+ const common_descriptions_1 = require("../Form/common.descriptions");
6
+ const utils_1 = require("../Form/utils");
7
+ const pageProperties = (0, n8n_workflow_1.updateDisplayOptions)({
8
+ show: {
9
+ operation: ['page'],
10
+ },
11
+ }, [
12
+ {
13
+ displayName: 'Define Form',
14
+ name: 'defineForm',
15
+ type: 'options',
16
+ noDataExpression: true,
17
+ options: [
18
+ {
19
+ name: 'Using Fields Below',
20
+ value: 'fields',
21
+ },
22
+ {
23
+ name: 'Using JSON',
24
+ value: 'json',
25
+ },
26
+ ],
27
+ default: 'fields',
28
+ },
29
+ {
30
+ displayName: 'Form Fields',
31
+ name: 'jsonOutput',
32
+ type: 'json',
33
+ typeOptions: {
34
+ rows: 5,
35
+ },
36
+ default: '[\n {\n "fieldLabel":"Name",\n "placeholder":"enter you name",\n "requiredField":true\n },\n {\n "fieldLabel":"Age",\n "fieldType":"number",\n "placeholder":"enter your age"\n },\n {\n "fieldLabel":"Email",\n "fieldType":"email",\n "requiredField":true\n }\n]',
37
+ validateType: 'form-fields',
38
+ ignoreValidationDuringExecution: true,
39
+ hint: '<a href="hhttps://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.form/" target="_blank">See docs</a> for field syntax',
40
+ displayOptions: {
41
+ show: {
42
+ defineForm: ['json'],
43
+ },
44
+ },
45
+ },
46
+ { ...common_descriptions_1.formFields, displayOptions: { show: { defineForm: ['fields'] } } },
47
+ {
48
+ displayName: 'Options',
49
+ name: 'options',
50
+ type: 'collection',
51
+ placeholder: 'Add option',
52
+ default: {},
53
+ options: [
54
+ { ...common_descriptions_1.formTitle, required: false },
55
+ common_descriptions_1.formDescription,
56
+ {
57
+ displayName: 'Button Label',
58
+ name: 'buttonLabel',
59
+ type: 'string',
60
+ default: 'Submit',
61
+ },
62
+ ],
63
+ },
64
+ ]);
65
+ const completionProperties = (0, n8n_workflow_1.updateDisplayOptions)({
66
+ show: {
67
+ operation: ['completion'],
68
+ },
69
+ }, [
70
+ {
71
+ displayName: 'On n8n Form Submission',
72
+ name: 'respondWith',
73
+ type: 'options',
74
+ default: 'text',
75
+ options: [
76
+ {
77
+ name: 'Show Completion Screen',
78
+ value: 'text',
79
+ description: 'Show a response text to the user',
80
+ },
81
+ {
82
+ name: 'Redirect to URL',
83
+ value: 'redirect',
84
+ description: 'Redirect the user to a URL',
85
+ },
86
+ ],
87
+ },
88
+ {
89
+ displayName: 'URL',
90
+ name: 'redirectUrl',
91
+ validateType: 'url',
92
+ type: 'string',
93
+ default: '',
94
+ required: true,
95
+ displayOptions: {
96
+ show: {
97
+ respondWith: ['redirect'],
98
+ },
99
+ },
100
+ },
101
+ {
102
+ displayName: 'Completion Title',
103
+ name: 'completionTitle',
104
+ type: 'string',
105
+ default: '',
106
+ required: true,
107
+ displayOptions: {
108
+ show: {
109
+ respondWith: ['text'],
110
+ },
111
+ },
112
+ },
113
+ {
114
+ displayName: 'Completion Message',
115
+ name: 'completionMessage',
116
+ type: 'string',
117
+ default: '',
118
+ typeOptions: {
119
+ rows: 2,
120
+ },
121
+ displayOptions: {
122
+ show: {
123
+ respondWith: ['text'],
124
+ },
125
+ },
126
+ },
127
+ {
128
+ displayName: 'Options',
129
+ name: 'options',
130
+ type: 'collection',
131
+ placeholder: 'Add option',
132
+ default: {},
133
+ options: [{ ...common_descriptions_1.formTitle, required: false, displayName: 'Completion Page Title' }],
134
+ displayOptions: {
135
+ show: {
136
+ respondWith: ['text'],
137
+ },
138
+ },
139
+ },
140
+ ]);
141
+ class Form extends n8n_workflow_1.Node {
142
+ constructor() {
143
+ super(...arguments);
144
+ this.nodeInputData = [];
145
+ this.description = {
146
+ displayName: 'n8n Form',
147
+ name: 'form',
148
+ icon: 'file:form.svg',
149
+ group: ['input'],
150
+ version: 1,
151
+ description: 'Generate webforms in n8n and pass their responses to the workflow',
152
+ defaults: {
153
+ name: 'Form',
154
+ },
155
+ inputs: ["main"],
156
+ outputs: ["main"],
157
+ webhooks: [
158
+ {
159
+ name: 'default',
160
+ httpMethod: 'GET',
161
+ responseMode: 'onReceived',
162
+ path: '',
163
+ restartWebhook: true,
164
+ isFullPath: true,
165
+ isForm: true,
166
+ },
167
+ {
168
+ name: 'default',
169
+ httpMethod: 'POST',
170
+ responseMode: 'onReceived',
171
+ path: '',
172
+ restartWebhook: true,
173
+ isFullPath: true,
174
+ isForm: true,
175
+ },
176
+ ],
177
+ properties: [
178
+ {
179
+ displayName: 'An n8n Form Trigger node must be set up before this node',
180
+ name: 'triggerNotice',
181
+ type: 'notice',
182
+ default: '',
183
+ },
184
+ {
185
+ displayName: 'Page Type',
186
+ name: 'operation',
187
+ type: 'options',
188
+ default: 'page',
189
+ noDataExpression: true,
190
+ options: [
191
+ {
192
+ name: 'Next Form Page',
193
+ value: 'page',
194
+ },
195
+ {
196
+ name: 'Form Ending',
197
+ value: 'completion',
198
+ },
199
+ ],
200
+ },
201
+ ...pageProperties,
202
+ ...completionProperties,
203
+ ],
204
+ };
205
+ }
206
+ async webhook(context) {
207
+ const res = context.getResponseObject();
208
+ const operation = context.getNodeParameter('operation', '');
209
+ const parentNodes = context.getParentNodes(context.getNode().name);
210
+ const trigger = parentNodes.find((node) => node.type === 'n8n-nodes-base.formTrigger');
211
+ const mode = context.evaluateExpression(`{{ $('${trigger?.name}').first().json.formMode }}`);
212
+ const defineForm = context.getNodeParameter('defineForm', false);
213
+ let fields = [];
214
+ if (defineForm === 'json') {
215
+ try {
216
+ const jsonOutput = context.getNodeParameter('jsonOutput', '', {
217
+ rawExpressions: true,
218
+ });
219
+ fields = (0, n8n_workflow_1.tryToParseJsonToFormFields)((0, utils_1.resolveRawData)(context, jsonOutput));
220
+ }
221
+ catch (error) {
222
+ throw new n8n_workflow_1.NodeOperationError(context.getNode(), error.message, {
223
+ description: error.message,
224
+ type: mode === 'test' ? 'manual-form-test' : undefined,
225
+ });
226
+ }
227
+ }
228
+ else {
229
+ fields = context.getNodeParameter('formFields.values', []);
230
+ }
231
+ const method = context.getRequestObject().method;
232
+ if (operation === 'completion') {
233
+ const respondWith = context.getNodeParameter('respondWith', '');
234
+ if (respondWith === 'redirect') {
235
+ const redirectUrl = context.getNodeParameter('redirectUrl', '');
236
+ res.redirect(redirectUrl);
237
+ return {
238
+ noWebhookResponse: true,
239
+ };
240
+ }
241
+ const completionTitle = context.getNodeParameter('completionTitle', '');
242
+ const completionMessage = context.getNodeParameter('completionMessage', '');
243
+ const options = context.getNodeParameter('options', {});
244
+ let title = options.formTitle;
245
+ if (!title) {
246
+ title = context.evaluateExpression(`{{ $('${trigger?.name}').params.formTitle }}`);
247
+ }
248
+ const appendAttribution = context.evaluateExpression(`{{ $('${trigger?.name}').params.options?.appendAttribution === false ? false : true }}`);
249
+ res.render('form-trigger-completion', {
250
+ title: completionTitle,
251
+ message: completionMessage,
252
+ formTitle: title,
253
+ appendAttribution,
254
+ });
255
+ return {
256
+ noWebhookResponse: true,
257
+ };
258
+ }
259
+ if (method === 'GET') {
260
+ const options = context.getNodeParameter('options', {});
261
+ let title = options.formTitle;
262
+ if (!title) {
263
+ title = context.evaluateExpression(`{{ $('${trigger?.name}').params.formTitle }}`);
264
+ }
265
+ let description = options.formDescription;
266
+ if (!description) {
267
+ description = context.evaluateExpression(`{{ $('${trigger?.name}').params.formDescription }}`);
268
+ }
269
+ let buttonLabel = options.buttonLabel;
270
+ if (!buttonLabel) {
271
+ buttonLabel =
272
+ context.evaluateExpression(`{{ $('${trigger?.name}').params.options?.buttonLabel }}`) || 'Submit';
273
+ }
274
+ const responseMode = 'onReceived';
275
+ let redirectUrl;
276
+ const connectedNodes = context.getChildNodes(context.getNode().name);
277
+ const hasNextPage = connectedNodes.some((node) => node.type === n8n_workflow_1.FORM_NODE_TYPE || node.type === n8n_workflow_1.WAIT_NODE_TYPE);
278
+ if (hasNextPage) {
279
+ redirectUrl = context.evaluateExpression('{{ $execution.resumeFormUrl }}');
280
+ }
281
+ const appendAttribution = context.evaluateExpression(`{{ $('${trigger?.name}').params.options?.appendAttribution === false ? false : true }}`);
282
+ (0, utils_1.renderForm)({
283
+ context,
284
+ res,
285
+ formTitle: title,
286
+ formDescription: description,
287
+ formFields: fields,
288
+ responseMode,
289
+ mode,
290
+ redirectUrl,
291
+ appendAttribution,
292
+ buttonLabel,
293
+ });
294
+ return {
295
+ noWebhookResponse: true,
296
+ };
297
+ }
298
+ let useWorkflowTimezone = context.evaluateExpression(`{{ $('${trigger?.name}').params.options?.useWorkflowTimezone }}`);
299
+ if (useWorkflowTimezone === undefined && trigger?.typeVersion > 2) {
300
+ useWorkflowTimezone = true;
301
+ }
302
+ const returnItem = await (0, utils_1.prepareFormReturnItem)(context, fields, mode, useWorkflowTimezone);
303
+ return {
304
+ webhookResponse: { status: 200 },
305
+ workflowData: [[returnItem]],
306
+ };
307
+ }
308
+ async execute(context) {
309
+ const operation = context.getNodeParameter('operation', 0);
310
+ if (operation === 'completion') {
311
+ this.nodeInputData = context.getInputData();
312
+ }
313
+ const parentNodes = context.getParentNodes(context.getNode().name);
314
+ const hasFormTrigger = parentNodes.some((node) => node.type === n8n_workflow_1.FORM_TRIGGER_NODE_TYPE);
315
+ if (!hasFormTrigger) {
316
+ throw new n8n_workflow_1.NodeOperationError(context.getNode(), 'Form Trigger node must be set before this node');
317
+ }
318
+ const childNodes = context.getChildNodes(context.getNode().name);
319
+ const hasNextPage = childNodes.some((node) => node.type === n8n_workflow_1.FORM_NODE_TYPE);
320
+ if (operation === 'completion' && hasNextPage) {
321
+ throw new n8n_workflow_1.NodeOperationError(context.getNode(), 'Completion has to be the last Form node in the workflow');
322
+ }
323
+ if (operation !== 'completion') {
324
+ const waitTill = new Date(n8n_workflow_1.WAIT_TIME_UNLIMITED);
325
+ await context.putExecutionToWait(waitTill);
326
+ }
327
+ return [context.getInputData()];
328
+ }
329
+ }
330
+ exports.Form = Form;
331
+ //# sourceMappingURL=Form.node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Form.node.js","sourceRoot":"","sources":["../../../nodes/Form/Form.node.ts"],"names":[],"mappings":";;;AAQA,+CAUsB;AAEtB,qEAAqF;AACrF,yCAAkF;AAElF,MAAM,cAAc,GAAG,IAAA,mCAAoB,EAC1C;IACC,IAAI,EAAE;QACL,SAAS,EAAE,CAAC,MAAM,CAAC;KACnB;CACD,EACD;IACC;QACC,WAAW,EAAE,aAAa;QAC1B,IAAI,EAAE,YAAY;QAClB,IAAI,EAAE,SAAS;QACf,gBAAgB,EAAE,IAAI;QACtB,OAAO,EAAE;YACR;gBACC,IAAI,EAAE,oBAAoB;gBAC1B,KAAK,EAAE,QAAQ;aACf;YACD;gBACC,IAAI,EAAE,YAAY;gBAClB,KAAK,EAAE,MAAM;aACb;SACD;QACD,OAAO,EAAE,QAAQ;KACjB;IACD;QACC,WAAW,EAAE,aAAa;QAC1B,IAAI,EAAE,YAAY;QAClB,IAAI,EAAE,MAAM;QACZ,WAAW,EAAE;YACZ,IAAI,EAAE,CAAC;SACP;QACD,OAAO,EACN,8TAA8T;QAC/T,YAAY,EAAE,aAAa;QAC3B,+BAA+B,EAAE,IAAI;QACrC,IAAI,EAAE,mIAAmI;QACzI,cAAc,EAAE;YACf,IAAI,EAAE;gBACL,UAAU,EAA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IAAI,IAAI,CAAC,kCAAmB,CAAC,CAAC;YAC/C,MAAM,OAAO,CAAC,kBAAkB,CAAC,QAAQ,CAAC,CAAC;QAC5C,CAAC;QAED,OAAO,CAAC,OAAO,CAAC,YAAY,EAAE,CAAC,CAAC;IACjC,CAAC;CACD;AA9PD,oBA8PC"}
@@ -0,0 +1,18 @@
1
+ {
2
+ "node": "n8n-nodes-base.form",
3
+ "nodeVersion": "1.0",
4
+ "codexVersion": "1.0",
5
+ "categories": ["Core Nodes"],
6
+ "alias": ["_Form", "form", "table", "submit", "post", "page", "step", "stage", "multi"],
7
+ "resources": {
8
+ "primaryDocumentation": [
9
+ {
10
+ "url": "https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.form/"
11
+ }
12
+ ],
13
+ "generic": []
14
+ },
15
+ "subcategories": {
16
+ "Core Nodes": ["Helpers"]
17
+ }
18
+ }
@@ -11,13 +11,14 @@ class FormTrigger extends n8n_workflow_1.VersionedNodeType {
11
11
  name: 'formTrigger',
12
12
  icon: 'file:form.svg',
13
13
  group: ['trigger'],
14
- description: 'Runs the flow when an n8n generated webform is submitted',
15
- defaultVersion: 2.1,
14
+ description: 'Generate webforms in n8n and pass their responses to the workflow',
15
+ defaultVersion: 2.2,
16
16
  };
17
17
  const nodeVersions = {
18
18
  1: new FormTriggerV1_node_1.FormTriggerV1(baseDescription),
19
19
  2: new FormTriggerV2_node_1.FormTriggerV2(baseDescription),
20
20
  2.1: new FormTriggerV2_node_1.FormTriggerV2(baseDescription),
21
+ 2.2: new FormTriggerV2_node_1.FormTriggerV2(baseDescription),
21
22
  };
22
23
  super(nodeVersions, baseDescription);
23
24
  }
@@ -1 +1 @@
1
- {"version":3,"file":"FormTrigger.node.js","sourceRoot":"","sources":["../../../nodes/Form/FormTrigger.node.ts"],"names":[],"mappings":";;;AACA,+CAAiD;AACjD,gEAAwD;AACxD,gEAAwD;AAExD,MAAa,WAAY,SAAQ,gCAAiB;IACjD;QACC,MAAM,eAAe,GAA6B;YACjD,WAAW,EAAE,kBAAkB;YAC/B,IAAI,EAAE,aAAa;YACnB,IAAI,EAAE,eAAe;YACrB,KAAK,EAAE,CAAC,SAAS,CAAC;YAClB,WAAW,EAAE,0DAA0D;YACvE,cAAc,EAAE,GAAG;SACnB,CAAC;QAEF,MAAM,YAAY,GAAuC;YACxD,CAAC,EAAE,IAAI,kCAAa,CAAC,eAAe,CAAC;YACrC,CAAC,EAAE,IAAI,kCAAa,CAAC,eAAe,CAAC;YACrC,GAAG,EAAE,IAAI,kCAAa,CAAC,eAAe,CAAC;SACvC,CAAC;QAEF,KAAK,CAAC,YAAY,EAAE,eAAe,CAAC,CAAC;IACtC,CAAC;CACD;AAnBD,kCAmBC"}
1
+ {"version":3,"file":"FormTrigger.node.js","sourceRoot":"","sources":["../../../nodes/Form/FormTrigger.node.ts"],"names":[],"mappings":";;;AACA,+CAAiD;AACjD,gEAAwD;AACxD,gEAAwD;AAExD,MAAa,WAAY,SAAQ,gCAAiB;IACjD;QACC,MAAM,eAAe,GAA6B;YACjD,WAAW,EAAE,kBAAkB;YAC/B,IAAI,EAAE,aAAa;YACnB,IAAI,EAAE,eAAe;YACrB,KAAK,EAAE,CAAC,SAAS,CAAC;YAClB,WAAW,EAAE,mEAAmE;YAChF,cAAc,EAAE,GAAG;SACnB,CAAC;QAEF,MAAM,YAAY,GAAuC;YACxD,CAAC,EAAE,IAAI,kCAAa,CAAC,eAAe,CAAC;YACrC,CAAC,EAAE,IAAI,kCAAa,CAAC,eAAe,CAAC;YACrC,GAAG,EAAE,IAAI,kCAAa,CAAC,eAAe,CAAC;YACvC,GAAG,EAAE,IAAI,kCAAa,CAAC,eAAe,CAAC;SACvC,CAAC;QAEF,KAAK,CAAC,YAAY,EAAE,eAAe,CAAC,CAAC;IACtC,CAAC;CACD;AApBD,kCAoBC"}
@@ -1,18 +1,3 @@
1
- export type FormField = {
2
- fieldLabel: string;
3
- fieldType: string;
4
- requiredField: boolean;
5
- fieldOptions?: {
6
- values: Array<{
7
- option: string;
8
- }>;
9
- };
10
- multiselect?: boolean;
11
- multipleFiles?: boolean;
12
- acceptFileTypes?: string;
13
- formatDate?: string;
14
- placeholder?: string;
15
- };
16
1
  export type FormTriggerInput = {
17
2
  isSelect?: boolean;
18
3
  isMultiSelect?: boolean;
@@ -45,5 +30,6 @@ export type FormTriggerData = {
45
30
  formFields: FormTriggerInput[];
46
31
  useResponseData?: boolean;
47
32
  appendAttribution?: boolean;
33
+ buttonLabel?: string;
48
34
  };
49
35
  export declare const FORM_TRIGGER_AUTHENTICATION_PROPERTY = "authentication";
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../nodes/Form/interfaces.ts"],"names":[],"mappings":";;;AA4Ca,QAAA,oCAAoC,GAAG,gBAAgB,CAAC"}
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../nodes/Form/interfaces.ts"],"names":[],"mappings":";;;AAiCa,QAAA,oCAAoC,GAAG,gBAAgB,CAAC"}
@@ -1,23 +1,42 @@
1
- import type { INodeExecutionData, IDataObject, IWebhookFunctions } from 'n8n-workflow';
2
- import type { FormField, FormTriggerData } from './interfaces';
3
- export declare function prepareFormData({ formTitle, formDescription, formSubmittedText, redirectUrl, formFields, testRun, query, instanceId, useResponseData, appendAttribution, }: {
1
+ import type { INodeExecutionData, IDataObject, IWebhookFunctions, FormFieldsParameter } from 'n8n-workflow';
2
+ import type { FormTriggerData } from './interfaces';
3
+ import type { Response } from 'express';
4
+ export declare function prepareFormData({ formTitle, formDescription, formSubmittedText, redirectUrl, formFields, testRun, query, instanceId, useResponseData, appendAttribution, buttonLabel, }: {
4
5
  formTitle: string;
5
6
  formDescription: string;
6
7
  formSubmittedText: string | undefined;
7
8
  redirectUrl: string | undefined;
8
- formFields: FormField[];
9
+ formFields: FormFieldsParameter;
9
10
  testRun: boolean;
10
11
  query: IDataObject;
11
12
  instanceId?: string;
12
13
  useResponseData?: boolean;
13
14
  appendAttribution?: boolean;
15
+ buttonLabel?: string;
14
16
  }): FormTriggerData;
17
+ export declare function prepareFormReturnItem(context: IWebhookFunctions, formFields: FormFieldsParameter, mode: 'test' | 'production', useWorkflowTimezone?: boolean): Promise<INodeExecutionData>;
18
+ export declare function renderForm({ context, res, formTitle, formDescription, formFields, responseMode, mode, formSubmittedText, redirectUrl, appendAttribution, buttonLabel, }: {
19
+ context: IWebhookFunctions;
20
+ res: Response;
21
+ formTitle: string;
22
+ formDescription: string;
23
+ formFields: FormFieldsParameter;
24
+ responseMode: string;
25
+ mode: 'test' | 'production';
26
+ formSubmittedText?: string;
27
+ redirectUrl?: string;
28
+ appendAttribution?: boolean;
29
+ buttonLabel?: string;
30
+ }): void;
15
31
  export declare function formWebhook(context: IWebhookFunctions, authProperty?: string): Promise<{
16
32
  noWebhookResponse: boolean;
17
33
  webhookResponse?: undefined;
18
34
  workflowData?: undefined;
19
35
  } | {
20
- webhookResponse: IDataObject;
36
+ webhookResponse: {
37
+ status: number;
38
+ };
21
39
  workflowData: INodeExecutionData[][];
22
40
  noWebhookResponse?: undefined;
23
41
  }>;
42
+ export declare function resolveRawData(context: IWebhookFunctions, rawData: string): string;