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
@@ -29,6 +29,7 @@ var import_versionDescription = require("../../Google/Sheet/v2/actions/versionDe
29
29
  var import_methods = require("../methods");
30
30
  var import_evaluationTriggerUtils = require("../utils/evaluationTriggerUtils");
31
31
  const DEFAULT_STARTING_ROW = 2;
32
+ const MAX_ROWS = 1e3;
32
33
  class EvaluationTrigger {
33
34
  constructor() {
34
35
  this.description = {
@@ -110,11 +111,26 @@ class EvaluationTrigger {
110
111
  ]
111
112
  };
112
113
  this.methods = { loadOptions: import_methods.loadOptions, listSearch: import_methods.listSearch };
114
+ this.customOperations = {
115
+ dataset: {
116
+ async getRows() {
117
+ try {
118
+ const maxRows = this.getNodeParameter("limitRows", 0, false) ? this.getNodeParameter("maxRows", 0, MAX_ROWS) + 1 : MAX_ROWS;
119
+ const googleSheetInstance = import_evaluationTriggerUtils.getGoogleSheet.call(this);
120
+ const googleSheet = await import_evaluationTriggerUtils.getSheet.call(this, googleSheetInstance);
121
+ const results = await import_evaluationTriggerUtils.getResults.call(this, [], googleSheetInstance, googleSheet, {});
122
+ const result = results.slice(0, maxRows - 1);
123
+ return [result];
124
+ } catch (error) {
125
+ throw new import_n8n_workflow.NodeOperationError(this.getNode(), error);
126
+ }
127
+ }
128
+ }
129
+ };
113
130
  }
114
131
  async execute() {
115
132
  const inputData = this.getInputData();
116
- const MAX_ROWS = 1e3;
117
- const maxRows = this.getNodeParameter("limitRows", 0) ? this.getNodeParameter("maxRows", 0) + 1 : MAX_ROWS;
133
+ const maxRows = this.getNodeParameter("limitRows", 0, false) ? this.getNodeParameter("maxRows", 0, MAX_ROWS) + 1 : MAX_ROWS;
118
134
  const previousRunRowNumber = inputData?.[0]?.json?.row_number;
119
135
  const previousRunRowsLeft = inputData?.[0]?.json?._rowsLeft;
120
136
  const firstDataRow = typeof previousRunRowNumber === "number" && previousRunRowsLeft !== 0 ? previousRunRowNumber + 1 : DEFAULT_STARTING_ROW;
@@ -126,17 +142,6 @@ class EvaluationTrigger {
126
142
  const googleSheetInstance = import_evaluationTriggerUtils.getGoogleSheet.call(this);
127
143
  const googleSheet = await import_evaluationTriggerUtils.getSheet.call(this, googleSheetInstance);
128
144
  const allRows = await import_evaluationTriggerUtils.getResults.call(this, [], googleSheetInstance, googleSheet, rangeOptions);
129
- if (inputData[0].json.requestDataset) {
130
- const testRunnerResult = await import_evaluationTriggerUtils.getResults.call(
131
- this,
132
- [],
133
- googleSheetInstance,
134
- googleSheet,
135
- {}
136
- );
137
- const result = testRunnerResult.slice(0, maxRows - 1);
138
- return [result];
139
- }
140
145
  const hasFilter = this.getNodeParameter("filtersUI.values", 0, []);
141
146
  if (hasFilter.length > 0) {
142
147
  const currentRow = allRows[0];
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../nodes/Evaluation/EvaluationTrigger/EvaluationTrigger.node.ee.ts"],"sourcesContent":["/* eslint-disable n8n-nodes-base/node-filename-against-convention */\nimport type {\n\tINodeType,\n\tINodeTypeDescription,\n\tIExecuteFunctions,\n\tINodeExecutionData,\n} from 'n8n-workflow';\nimport { NodeConnectionTypes, NodeOperationError } from 'n8n-workflow';\n\nimport { document, sheet } from '../../Google/Sheet/GoogleSheetsTrigger.node';\nimport { readFilter } from '../../Google/Sheet/v2/actions/sheet/read.operation';\nimport { authentication } from '../../Google/Sheet/v2/actions/versionDescription';\nimport type { ILookupValues } from '../../Google/Sheet/v2/helpers/GoogleSheets.types';\nimport { listSearch, loadOptions } from '../methods';\nimport {\n\tgetGoogleSheet,\n\tgetResults,\n\tgetRowsLeft,\n\tgetNumberOfRowsLeftFiltered,\n\tgetSheet,\n} from '../utils/evaluationTriggerUtils';\n\nexport const DEFAULT_STARTING_ROW = 2;\n\nexport class EvaluationTrigger implements INodeType {\n\tdescription: INodeTypeDescription = {\n\t\tdisplayName: 'Evaluation Trigger',\n\t\ticon: 'fa:check-double',\n\t\tname: 'evaluationTrigger',\n\t\tgroup: ['trigger'],\n\t\tversion: 4.6,\n\t\tdescription: 'Run a test dataset through your workflow to check performance',\n\t\teventTriggerDescription: '',\n\t\tdefaults: {\n\t\t\tname: 'When fetching a dataset row',\n\t\t\tcolor: '#c3c9d5',\n\t\t},\n\t\tinputs: [],\n\t\toutputs: [NodeConnectionTypes.Main],\n\t\tproperties: [\n\t\t\t{\n\t\t\t\tdisplayName:\n\t\t\t\t\t'Pulls a test dataset from a Google Sheet. The workflow will run once for each row, in sequence. Tips for wiring this node up <a href=\"https://docs.n8n.io/advanced-ai/evaluations/tips-and-common-issues/#combining-multiple-triggers\">here</a>.',\n\t\t\t\tname: 'notice',\n\t\t\t\ttype: 'notice',\n\t\t\t\tdefault: '',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Credentials',\n\t\t\t\tname: 'credentials',\n\t\t\t\ttype: 'credentials',\n\t\t\t\tdefault: '',\n\t\t\t},\n\t\t\tauthentication,\n\t\t\t{\n\t\t\t\t...document,\n\t\t\t\tdisplayName: 'Document Containing Dataset',\n\t\t\t\thint: 'Example dataset format <a href=\"https://docs.google.com/spreadsheets/d/1vD_IdeFUg7sHsK9okL6Doy1rGOkWTnPJV3Dro4FBUsY/edit?gid=0#gid=0\">here</a>',\n\t\t\t},\n\t\t\t{ ...sheet, displayName: 'Sheet Containing Dataset' },\n\t\t\t{\n\t\t\t\tdisplayName: 'Limit Rows',\n\t\t\t\tname: 'limitRows',\n\t\t\t\ttype: 'boolean',\n\t\t\t\tdefault: false,\n\t\t\t\tnoDataExpression: true,\n\t\t\t\tdescription: 'Whether to limit number of rows to process',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Max Rows to Process',\n\t\t\t\tname: 'maxRows',\n\t\t\t\ttype: 'number',\n\t\t\t\tdefault: 10,\n\t\t\t\tdescription: 'Maximum number of rows to process',\n\t\t\t\tnoDataExpression: false,\n\t\t\t\tdisplayOptions: { show: { limitRows: [true] } },\n\t\t\t},\n\t\t\treadFilter,\n\t\t],\n\t\tcodex: {\n\t\t\talias: ['Test', 'Metrics', 'Evals', 'Set Output', 'Set Metrics'],\n\t\t},\n\t\tcredentials: [\n\t\t\t{\n\t\t\t\tname: 'googleApi',\n\t\t\t\trequired: true,\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: {\n\t\t\t\t\t\tauthentication: ['serviceAccount'],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\ttestedBy: 'googleApiCredentialTest',\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'googleSheetsOAuth2Api',\n\t\t\t\trequired: true,\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: {\n\t\t\t\t\t\tauthentication: ['oAuth2'],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t],\n\t};\n\n\tmethods = { loadOptions, listSearch };\n\n\tasync execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {\n\t\tconst inputData = this.getInputData();\n\n\t\tconst MAX_ROWS = 1000;\n\n\t\tconst maxRows = this.getNodeParameter('limitRows', 0)\n\t\t\t? (this.getNodeParameter('maxRows', 0) as number) + 1\n\t\t\t: MAX_ROWS;\n\n\t\tconst previousRunRowNumber = inputData?.[0]?.json?.row_number;\n\t\tconst previousRunRowsLeft = inputData?.[0]?.json?._rowsLeft;\n\n\t\tconst firstDataRow =\n\t\t\ttypeof previousRunRowNumber === 'number' && previousRunRowsLeft !== 0\n\t\t\t\t? previousRunRowNumber + 1\n\t\t\t\t: DEFAULT_STARTING_ROW;\n\t\tconst rangeOptions = {\n\t\t\trangeDefinition: 'specifyRange',\n\t\t\theaderRow: 1,\n\t\t\tfirstDataRow,\n\t\t};\n\n\t\tconst googleSheetInstance = getGoogleSheet.call(this);\n\n\t\tconst googleSheet = await getSheet.call(this, googleSheetInstance);\n\n\t\tconst allRows = await getResults.call(this, [], googleSheetInstance, googleSheet, rangeOptions);\n\n\t\t// This is for test runner which requires a different return format\n\t\tif (inputData[0].json.requestDataset) {\n\t\t\tconst testRunnerResult = await getResults.call(\n\t\t\t\tthis,\n\t\t\t\t[],\n\t\t\t\tgoogleSheetInstance,\n\t\t\t\tgoogleSheet,\n\t\t\t\t{},\n\t\t\t);\n\n\t\t\tconst result = testRunnerResult.slice(0, maxRows - 1);\n\n\t\t\treturn [result];\n\t\t}\n\n\t\tconst hasFilter = this.getNodeParameter('filtersUI.values', 0, []) as ILookupValues[];\n\n\t\tif (hasFilter.length > 0) {\n\t\t\tconst currentRow = allRows[0];\n\t\t\tconst currentRowNumber = currentRow.json?.row_number as number;\n\n\t\t\tif (currentRow === undefined) {\n\t\t\t\tthrow new NodeOperationError(this.getNode(), 'No row found');\n\t\t\t}\n\n\t\t\tconst rowsLeft = await getNumberOfRowsLeftFiltered.call(\n\t\t\t\tthis,\n\t\t\t\tgoogleSheetInstance,\n\t\t\t\tgoogleSheet.title,\n\t\t\t\tcurrentRowNumber + 1,\n\t\t\t\tmaxRows,\n\t\t\t);\n\n\t\t\tcurrentRow.json._rowsLeft = rowsLeft;\n\n\t\t\treturn [[currentRow]];\n\t\t} else {\n\t\t\tconst currentRow = allRows.find((row) => (row?.json?.row_number as number) === firstDataRow);\n\n\t\t\tconst rowsLeft = await getRowsLeft.call(\n\t\t\t\tthis,\n\t\t\t\tgoogleSheetInstance,\n\t\t\t\tgoogleSheet.title,\n\t\t\t\t`${googleSheet.title}!${firstDataRow}:${maxRows}`,\n\t\t\t);\n\n\t\t\tif (currentRow === undefined) {\n\t\t\t\tthrow new NodeOperationError(this.getNode(), 'No row found');\n\t\t\t}\n\n\t\t\tcurrentRow.json._rowsLeft = rowsLeft;\n\n\t\t\treturn [[currentRow]];\n\t\t}\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOA,0BAAwD;AAExD,iCAAgC;AAChC,kBAA2B;AAC3B,gCAA+B;AAE/B,qBAAwC;AACxC,oCAMO;AAEA,MAAM,uBAAuB;AAE7B,MAAM,kBAAuC;AAAA,EAA7C;AACN,uBAAoC;AAAA,MACnC,aAAa;AAAA,MACb,MAAM;AAAA,MACN,MAAM;AAAA,MACN,OAAO,CAAC,SAAS;AAAA,MACjB,SAAS;AAAA,MACT,aAAa;AAAA,MACb,yBAAyB;AAAA,MACzB,UAAU;AAAA,QACT,MAAM;AAAA,QACN,OAAO;AAAA,MACR;AAAA,MACA,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a,QAAQ,KAAK,CAAC,QAAS,KAAK,MAAM,eAA0B,YAAY;AAE3F,YAAM,WAAW,MAAM,0CAAY;AAAA,QAClC;AAAA,QACA;AAAA,QACA,YAAY;AAAA,QACZ,GAAG,YAAY,KAAK,IAAI,YAAY,IAAI,OAAO;AAAA,MAChD;AAEA,UAAI,eAAe,QAAW;AAC7B,cAAM,IAAI,uCAAmB,KAAK,QAAQ,GAAG,cAAc;AAAA,MAC5D;AAEA,iBAAW,KAAK,YAAY;AAE5B,aAAO,CAAC,CAAC,UAAU,CAAC;AAAA,IACrB;AAAA,EACD;AACD;","names":[]}
1
+ {"version":3,"sources":["../../../../nodes/Evaluation/EvaluationTrigger/EvaluationTrigger.node.ee.ts"],"sourcesContent":["/* eslint-disable n8n-nodes-base/node-filename-against-convention */\nimport type {\n\tINodeType,\n\tINodeTypeDescription,\n\tIExecuteFunctions,\n\tINodeExecutionData,\n\tNodeExecutionWithMetadata,\n} from 'n8n-workflow';\nimport { NodeConnectionTypes, NodeOperationError } from 'n8n-workflow';\n\nimport { document, sheet } from '../../Google/Sheet/GoogleSheetsTrigger.node';\nimport { readFilter } from '../../Google/Sheet/v2/actions/sheet/read.operation';\nimport { authentication } from '../../Google/Sheet/v2/actions/versionDescription';\nimport type { ILookupValues } from '../../Google/Sheet/v2/helpers/GoogleSheets.types';\nimport { listSearch, loadOptions } from '../methods';\nimport {\n\tgetGoogleSheet,\n\tgetResults,\n\tgetRowsLeft,\n\tgetNumberOfRowsLeftFiltered,\n\tgetSheet,\n} from '../utils/evaluationTriggerUtils';\n\nexport const DEFAULT_STARTING_ROW = 2;\n\nconst MAX_ROWS = 1000;\n\nexport class EvaluationTrigger implements INodeType {\n\tdescription: INodeTypeDescription = {\n\t\tdisplayName: 'Evaluation Trigger',\n\t\ticon: 'fa:check-double',\n\t\tname: 'evaluationTrigger',\n\t\tgroup: ['trigger'],\n\t\tversion: 4.6,\n\t\tdescription: 'Run a test dataset through your workflow to check performance',\n\t\teventTriggerDescription: '',\n\t\tdefaults: {\n\t\t\tname: 'When fetching a dataset row',\n\t\t\tcolor: '#c3c9d5',\n\t\t},\n\t\tinputs: [],\n\t\toutputs: [NodeConnectionTypes.Main],\n\t\tproperties: [\n\t\t\t{\n\t\t\t\tdisplayName:\n\t\t\t\t\t'Pulls a test dataset from a Google Sheet. The workflow will run once for each row, in sequence. Tips for wiring this node up <a href=\"https://docs.n8n.io/advanced-ai/evaluations/tips-and-common-issues/#combining-multiple-triggers\">here</a>.',\n\t\t\t\tname: 'notice',\n\t\t\t\ttype: 'notice',\n\t\t\t\tdefault: '',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Credentials',\n\t\t\t\tname: 'credentials',\n\t\t\t\ttype: 'credentials',\n\t\t\t\tdefault: '',\n\t\t\t},\n\t\t\tauthentication,\n\t\t\t{\n\t\t\t\t...document,\n\t\t\t\tdisplayName: 'Document Containing Dataset',\n\t\t\t\thint: 'Example dataset format <a href=\"https://docs.google.com/spreadsheets/d/1vD_IdeFUg7sHsK9okL6Doy1rGOkWTnPJV3Dro4FBUsY/edit?gid=0#gid=0\">here</a>',\n\t\t\t},\n\t\t\t{ ...sheet, displayName: 'Sheet Containing Dataset' },\n\t\t\t{\n\t\t\t\tdisplayName: 'Limit Rows',\n\t\t\t\tname: 'limitRows',\n\t\t\t\ttype: 'boolean',\n\t\t\t\tdefault: false,\n\t\t\t\tnoDataExpression: true,\n\t\t\t\tdescription: 'Whether to limit number of rows to process',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Max Rows to Process',\n\t\t\t\tname: 'maxRows',\n\t\t\t\ttype: 'number',\n\t\t\t\tdefault: 10,\n\t\t\t\tdescription: 'Maximum number of rows to process',\n\t\t\t\tnoDataExpression: false,\n\t\t\t\tdisplayOptions: { show: { limitRows: [true] } },\n\t\t\t},\n\t\t\treadFilter,\n\t\t],\n\t\tcodex: {\n\t\t\talias: ['Test', 'Metrics', 'Evals', 'Set Output', 'Set Metrics'],\n\t\t},\n\t\tcredentials: [\n\t\t\t{\n\t\t\t\tname: 'googleApi',\n\t\t\t\trequired: true,\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: {\n\t\t\t\t\t\tauthentication: ['serviceAccount'],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\ttestedBy: 'googleApiCredentialTest',\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'googleSheetsOAuth2Api',\n\t\t\t\trequired: true,\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: {\n\t\t\t\t\t\tauthentication: ['oAuth2'],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t],\n\t};\n\n\tmethods = { loadOptions, listSearch };\n\n\tasync execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {\n\t\tconst inputData = this.getInputData();\n\n\t\tconst maxRows = this.getNodeParameter('limitRows', 0, false)\n\t\t\t? (this.getNodeParameter('maxRows', 0, MAX_ROWS) as number) + 1\n\t\t\t: MAX_ROWS;\n\n\t\tconst previousRunRowNumber = inputData?.[0]?.json?.row_number;\n\t\tconst previousRunRowsLeft = inputData?.[0]?.json?._rowsLeft;\n\n\t\tconst firstDataRow =\n\t\t\ttypeof previousRunRowNumber === 'number' && previousRunRowsLeft !== 0\n\t\t\t\t? previousRunRowNumber + 1\n\t\t\t\t: DEFAULT_STARTING_ROW;\n\t\tconst rangeOptions = {\n\t\t\trangeDefinition: 'specifyRange',\n\t\t\theaderRow: 1,\n\t\t\tfirstDataRow,\n\t\t};\n\n\t\tconst googleSheetInstance = getGoogleSheet.call(this);\n\n\t\tconst googleSheet = await getSheet.call(this, googleSheetInstance);\n\n\t\tconst allRows = await getResults.call(this, [], googleSheetInstance, googleSheet, rangeOptions);\n\n\t\tconst hasFilter = this.getNodeParameter('filtersUI.values', 0, []) as ILookupValues[];\n\n\t\tif (hasFilter.length > 0) {\n\t\t\tconst currentRow = allRows[0];\n\t\t\tconst currentRowNumber = currentRow.json?.row_number as number;\n\n\t\t\tif (currentRow === undefined) {\n\t\t\t\tthrow new NodeOperationError(this.getNode(), 'No row found');\n\t\t\t}\n\n\t\t\tconst rowsLeft = await getNumberOfRowsLeftFiltered.call(\n\t\t\t\tthis,\n\t\t\t\tgoogleSheetInstance,\n\t\t\t\tgoogleSheet.title,\n\t\t\t\tcurrentRowNumber + 1,\n\t\t\t\tmaxRows,\n\t\t\t);\n\n\t\t\tcurrentRow.json._rowsLeft = rowsLeft;\n\n\t\t\treturn [[currentRow]];\n\t\t} else {\n\t\t\tconst currentRow = allRows.find((row) => (row?.json?.row_number as number) === firstDataRow);\n\n\t\t\tconst rowsLeft = await getRowsLeft.call(\n\t\t\t\tthis,\n\t\t\t\tgoogleSheetInstance,\n\t\t\t\tgoogleSheet.title,\n\t\t\t\t`${googleSheet.title}!${firstDataRow}:${maxRows}`,\n\t\t\t);\n\n\t\t\tif (currentRow === undefined) {\n\t\t\t\tthrow new NodeOperationError(this.getNode(), 'No row found');\n\t\t\t}\n\n\t\t\tcurrentRow.json._rowsLeft = rowsLeft;\n\n\t\t\treturn [[currentRow]];\n\t\t}\n\t}\n\n\tcustomOperations = {\n\t\tdataset: {\n\t\t\tasync getRows(\n\t\t\t\tthis: IExecuteFunctions,\n\t\t\t): Promise<INodeExecutionData[][] | NodeExecutionWithMetadata[][] | null> {\n\t\t\t\ttry {\n\t\t\t\t\tconst maxRows = this.getNodeParameter('limitRows', 0, false)\n\t\t\t\t\t\t? (this.getNodeParameter('maxRows', 0, MAX_ROWS) as number) + 1\n\t\t\t\t\t\t: MAX_ROWS;\n\n\t\t\t\t\tconst googleSheetInstance = getGoogleSheet.call(this);\n\t\t\t\t\tconst googleSheet = await getSheet.call(this, googleSheetInstance);\n\n\t\t\t\t\tconst results = await getResults.call(this, [], googleSheetInstance, googleSheet, {});\n\t\t\t\t\tconst result = results.slice(0, maxRows - 1);\n\n\t\t\t\t\treturn [result];\n\t\t\t\t} catch (error) {\n\t\t\t\t\tthrow new NodeOperationError(this.getNode(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onJS(Form_node_exports);
25
25
  var import_n8n_workflow = require("n8n-workflow");
26
26
  var import_cssVariables = require("./cssVariables");
27
- var import_formCompletionUtils = require("./utils/formCompletionUtils");
28
- var import_formNodeUtils = require("./utils/formNodeUtils");
29
- var import_utils = require("./utils/utils");
27
+ var import_formCompletionUtils = require("./formCompletionUtils");
28
+ var import_formNodeUtils = require("./formNodeUtils");
30
29
  var import_configureWaitTillDate = require("../../utils/sendAndWait/configureWaitTillDate.util");
31
30
  var import_descriptions = require("../../utils/sendAndWait/descriptions");
32
31
  var import_common = require("../Form/common.descriptions");
32
+ var import_utils = require("../Form/utils");
33
33
  const waitTimeProperties = [
34
34
  {
35
35
  displayName: "Limit Wait Time",
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../nodes/Form/Form.node.ts"],"sourcesContent":["import type {\n\tFormFieldsParameter,\n\tIExecuteFunctions,\n\tINodeExecutionData,\n\tINodeProperties,\n\tINodeTypeDescription,\n\tIWebhookFunctions,\n\tIWebhookResponseData,\n\tNodeTypeAndVersion,\n} from 'n8n-workflow';\nimport {\n\tNode,\n\tupdateDisplayOptions,\n\tNodeOperationError,\n\tFORM_NODE_TYPE,\n\tFORM_TRIGGER_NODE_TYPE,\n\ttryToParseJsonToFormFields,\n\tNodeConnectionTypes,\n} from 'n8n-workflow';\n\nimport { cssVariables } from './cssVariables';\nimport { renderFormCompletion } from './utils/formCompletionUtils';\nimport { renderFormNode } from './utils/formNodeUtils';\nimport { prepareFormReturnItem, resolveRawData } from './utils/utils';\nimport { configureWaitTillDate } from '../../utils/sendAndWait/configureWaitTillDate.util';\nimport { limitWaitTimeProperties } from '../../utils/sendAndWait/descriptions';\nimport { formDescription, formFields, formTitle } from '../Form/common.descriptions';\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},\n\t...updateDisplayOptions(\n\t\t{\n\t\t\tshow: {\n\t\t\t\tlimitWaitTime: [true],\n\t\t\t},\n\t\t},\n\t\tlimitWaitTimeProperties,\n\t),\n];\n\nexport const formFieldsProperties: INodeProperties[] = [\n\t{\n\t\tdisplayName: 'Define Form',\n\t\tname: 'defineForm',\n\t\ttype: 'options',\n\t\tnoDataExpression: true,\n\t\toptions: [\n\t\t\t{\n\t\t\t\tname: 'Using Fields Below',\n\t\t\t\tvalue: 'fields',\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'Using JSON',\n\t\t\t\tvalue: 'json',\n\t\t\t},\n\t\t],\n\t\tdefault: 'fields',\n\t},\n\t{\n\t\tdisplayName: 'Form Fields',\n\t\tname: 'jsonOutput',\n\t\ttype: 'json',\n\t\ttypeOptions: {\n\t\t\trows: 5,\n\t\t},\n\t\tdefault:\n\t\t\t'[\\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]',\n\t\tvalidateType: 'form-fields',\n\t\tignoreValidationDuringExecution: true,\n\t\thint: '<a href=\"https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.form/\" target=\"_blank\">See docs</a> for field syntax',\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\tdefineForm: ['json'],\n\t\t\t},\n\t\t},\n\t},\n\t{ ...formFields, displayOptions: { show: { defineForm: ['fields'] } } },\n];\n\nconst pageProperties = updateDisplayOptions(\n\t{\n\t\tshow: {\n\t\t\toperation: ['page'],\n\t\t},\n\t},\n\t[\n\t\t...formFieldsProperties,\n\t\t...waitTimeProperties,\n\t\t{\n\t\t\tdisplayName: 'Options',\n\t\t\tname: 'options',\n\t\t\ttype: 'collection',\n\t\t\tplaceholder: 'Add option',\n\t\t\tdefault: {},\n\t\t\toptions: [\n\t\t\t\t{ ...formTitle, required: false },\n\t\t\t\tformDescription,\n\t\t\t\t{\n\t\t\t\t\tdisplayName: 'Button Label',\n\t\t\t\t\tname: 'buttonLabel',\n\t\t\t\t\ttype: 'string',\n\t\t\t\t\tdefault: 'Submit',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tdisplayName: 'Custom Form Styling',\n\t\t\t\t\tname: 'customCss',\n\t\t\t\t\ttype: 'string',\n\t\t\t\t\ttypeOptions: {\n\t\t\t\t\t\trows: 10,\n\t\t\t\t\t\teditor: 'cssEditor',\n\t\t\t\t\t},\n\t\t\t\t\tdefault: cssVariables.trim(),\n\t\t\t\t\tdescription: 'Override default styling of the public form interface with CSS',\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t],\n);\n\nconst completionProperties = updateDisplayOptions(\n\t{\n\t\tshow: {\n\t\t\toperation: ['completion'],\n\t\t},\n\t},\n\t[\n\t\t{\n\t\t\t// eslint-disable-next-line n8n-nodes-base/node-param-display-name-miscased\n\t\t\tdisplayName: 'On n8n Form Submission',\n\t\t\tname: 'respondWith',\n\t\t\ttype: 'options',\n\t\t\tdefault: 'text',\n\t\t\toptions: [\n\t\t\t\t{\n\t\t\t\t\tname: 'Show Completion Screen',\n\t\t\t\t\tvalue: 'text',\n\t\t\t\t\tdescription: 'Show a response text to the user',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'Redirect to URL',\n\t\t\t\t\tvalue: 'redirect',\n\t\t\t\t\tdescription: 'Redirect the user to a URL',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'Show Text',\n\t\t\t\t\tvalue: 'showText',\n\t\t\t\t\tdescription: 'Display simple text or HTML',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'Return Binary File',\n\t\t\t\t\tvalue: 'returnBinary',\n\t\t\t\t\tdescription: 'Return incoming binary file',\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t\t{\n\t\t\tdisplayName: 'URL',\n\t\t\tname: 'redirectUrl',\n\t\t\tvalidateType: 'url',\n\t\t\ttype: 'string',\n\t\t\tdefault: '',\n\t\t\trequired: true,\n\t\t\tdisplayOptions: {\n\t\t\t\tshow: {\n\t\t\t\t\trespondWith: ['redirect'],\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tdisplayName: 'Completion Title',\n\t\t\tname: 'completionTitle',\n\t\t\ttype: 'string',\n\t\t\tdefault: '',\n\t\t\trequired: true,\n\t\t\tdisplayOptions: {\n\t\t\t\tshow: {\n\t\t\t\t\trespondWith: ['text', 'returnBinary'],\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tdisplayName: 'Completion Message',\n\t\t\tname: 'completionMessage',\n\t\t\ttype: 'string',\n\t\t\tdefault: '',\n\t\t\ttypeOptions: {\n\t\t\t\trows: 2,\n\t\t\t},\n\t\t\tdisplayOptions: {\n\t\t\t\tshow: {\n\t\t\t\t\trespondWith: ['text', 'returnBinary'],\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tdisplayName: 'Text',\n\t\t\tname: 'responseText',\n\t\t\ttype: 'string',\n\t\t\tdisplayOptions: {\n\t\t\t\tshow: {\n\t\t\t\t\trespondWith: ['showText'],\n\t\t\t\t},\n\t\t\t},\n\t\t\ttypeOptions: {\n\t\t\t\trows: 2,\n\t\t\t},\n\t\t\tdefault: '',\n\t\t\tplaceholder: 'e.g. Thanks for filling the form',\n\t\t\tdescription: 'The text to display on the page. Use HTML to show a customized web page.',\n\t\t},\n\t\t{\n\t\t\tdisplayName: 'Input Data Field Name',\n\t\t\tname: 'inputDataFieldName',\n\t\t\ttype: 'string',\n\t\t\tdisplayOptions: {\n\t\t\t\tshow: {\n\t\t\t\t\trespondWith: ['returnBinary'],\n\t\t\t\t},\n\t\t\t},\n\t\t\tdefault: 'data',\n\t\t\tplaceholder: 'e.g. data',\n\t\t\tdescription:\n\t\t\t\t'Find the name of input field containing the binary data to return in the Input panel on the left, in the Binary tab',\n\t\t\thint: 'The name of the input field containing the binary file data to be returned',\n\t\t},\n\t\t...waitTimeProperties,\n\t\t{\n\t\t\tdisplayName: 'Options',\n\t\t\tname: 'options',\n\t\t\ttype: 'collection',\n\t\t\tplaceholder: 'Add option',\n\t\t\tdefault: {},\n\t\t\toptions: [\n\t\t\t\t{ ...formTitle, required: false, displayName: 'Completion Page Title' },\n\t\t\t\t{\n\t\t\t\t\tdisplayName: 'Custom Form Styling',\n\t\t\t\t\tname: 'customCss',\n\t\t\t\t\ttype: 'string',\n\t\t\t\t\ttypeOptions: {\n\t\t\t\t\t\trows: 10,\n\t\t\t\t\t\teditor: 'cssEditor',\n\t\t\t\t\t},\n\t\t\t\t\tdefault: cssVariables.trim(),\n\t\t\t\t\tdescription: 'Override default styling of the public form interface with CSS',\n\t\t\t\t},\n\t\t\t],\n\t\t\tdisplayOptions: {\n\t\t\t\tshow: {\n\t\t\t\t\trespondWith: ['text', 'returnBinary'],\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t],\n);\n\nexport class Form extends Node {\n\tnodeInputData: INodeExecutionData[] = [];\n\n\tdescription: INodeTypeDescription = {\n\t\tdisplayName: 'n8n Form',\n\t\tname: 'form',\n\t\ticon: 'file:form.svg',\n\t\tgroup: ['input'],\n\t\tversion: 1,\n\t\tdescription: 'Generate webforms in n8n and pass their responses to the workflow',\n\t\tdefaults: {\n\t\t\tname: 'Form',\n\t\t},\n\t\tinputs: [NodeConnectionTypes.Main],\n\t\toutputs: [NodeConnectionTypes.Main],\n\t\twebhooks: [\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: '',\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: 'responseNode',\n\t\t\t\tpath: '',\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\t// eslint-disable-next-line n8n-nodes-base/node-param-display-name-miscased\n\t\t\t\tdisplayName: 'An n8n Form Trigger node must be set up before this node',\n\t\t\t\tname: 'triggerNotice',\n\t\t\t\ttype: 'notice',\n\t\t\t\tdefault: '',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Page Type',\n\t\t\t\tname: 'operation',\n\t\t\t\ttype: 'options',\n\t\t\t\tdefault: 'page',\n\t\t\t\tnoDataExpression: true,\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Next Form Page',\n\t\t\t\t\t\tvalue: 'page',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Form Ending',\n\t\t\t\t\t\tvalue: 'completion',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t\t...pageProperties,\n\t\t\t...completionProperties,\n\t\t],\n\t};\n\n\tasync webhook(context: IWebhookFunctions): Promise<IWebhookResponseData> {\n\t\tconst res = context.getResponseObject();\n\n\t\tconst operation = context.getNodeParameter('operation', '') as string;\n\n\t\tconst parentNodes = context.getParentNodes(context.getNode().name);\n\t\tconst trigger = parentNodes.find(\n\t\t\t(node) => node.type === 'n8n-nodes-base.formTrigger',\n\t\t) as NodeTypeAndVersion;\n\n\t\tconst mode = context.evaluateExpression(`{{ $('${trigger?.name}').first().json.formMode }}`) as\n\t\t\t| 'test'\n\t\t\t| 'production';\n\n\t\tconst defineForm = context.getNodeParameter('defineForm', false) as string;\n\n\t\tlet fields: FormFieldsParameter = [];\n\t\tif (defineForm === 'json') {\n\t\t\ttry {\n\t\t\t\tconst jsonOutput = context.getNodeParameter('jsonOutput', '', {\n\t\t\t\t\trawExpressions: true,\n\t\t\t\t}) as string;\n\n\t\t\t\tfields = tryToParseJsonToFormFields(resolveRawData(context, jsonOutput));\n\t\t\t} catch (error) {\n\t\t\t\tthrow new NodeOperationError(context.getNode(), error.message, {\n\t\t\t\t\tdescription: error.message,\n\t\t\t\t\ttype: mode === 'test' ? 'manual-form-test' : undefined,\n\t\t\t\t});\n\t\t\t}\n\t\t} else {\n\t\t\tfields = context.getNodeParameter('formFields.values', []) as FormFieldsParameter;\n\t\t}\n\n\t\tconst method = context.getRequestObject().method;\n\n\t\tif (operation === 'completion' && method === 'GET') {\n\t\t\treturn await renderFormCompletion(context, res, trigger);\n\t\t}\n\n\t\tif (operation === 'completion' && method === 'POST') {\n\t\t\treturn {\n\t\t\t\tworkflowData: [context.evaluateExpression('{{ $input.all() }}') as INodeExecutionData[]],\n\t\t\t};\n\t\t}\n\n\t\tif (method === 'GET') {\n\t\t\treturn await renderFormNode(context, res, trigger, fields, mode);\n\t\t}\n\n\t\tlet useWorkflowTimezone = context.evaluateExpression(\n\t\t\t`{{ $('${trigger?.name}').params.options?.useWorkflowTimezone }}`,\n\t\t) as boolean;\n\n\t\tif (useWorkflowTimezone === undefined && trigger?.typeVersion > 2) {\n\t\t\tuseWorkflowTimezone = true;\n\t\t}\n\n\t\tconst returnItem = await prepareFormReturnItem(context, fields, mode, useWorkflowTimezone);\n\n\t\treturn {\n\t\t\twebhookResponse: { status: 200 },\n\t\t\tworkflowData: [[returnItem]],\n\t\t};\n\t}\n\n\tasync execute(context: IExecuteFunctions): Promise<INodeExecutionData[][]> {\n\t\tconst operation = context.getNodeParameter('operation', 0);\n\n\t\tif (operation === 'completion') {\n\t\t\tthis.nodeInputData = context.getInputData();\n\t\t}\n\n\t\tconst parentNodes = context.getParentNodes(context.getNode().name);\n\t\tconst hasFormTrigger = parentNodes.some((node) => node.type === FORM_TRIGGER_NODE_TYPE);\n\n\t\tif (!hasFormTrigger) {\n\t\t\tthrow new NodeOperationError(\n\t\t\t\tcontext.getNode(),\n\t\t\t\t'Form Trigger node must be set before this node',\n\t\t\t);\n\t\t}\n\n\t\tconst childNodes = context.getChildNodes(context.getNode().name);\n\t\tconst hasNextPage = childNodes.some((node) => node.type === FORM_NODE_TYPE);\n\n\t\tif (operation === 'completion' && hasNextPage) {\n\t\t\tthrow new NodeOperationError(\n\t\t\t\tcontext.getNode(),\n\t\t\t\t'Completion has to be the last Form node in the workflow',\n\t\t\t);\n\t\t}\n\n\t\tconst waitTill = configureWaitTillDate(context, 'root');\n\t\tawait context.putExecutionToWait(waitTill);\n\n\t\tcontext.sendResponse({\n\t\t\theaders: {\n\t\t\t\tlocation: context.evaluateExpression('{{ $execution.resumeFormUrl }}', 0),\n\t\t\t},\n\t\t\tstatusCode: 307,\n\t\t});\n\n\t\treturn [context.getInputData()];\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAUA,0BAQO;AAEP,0BAA6B;AAC7B,iCAAqC;AACrC,2BAA+B;AAC/B,mBAAsD;AACtD,mCAAsC;AACtC,0BAAwC;AACxC,oBAAuD;AAEvD,MAAM,qBAAwC;AAAA,EAC7C;AAAA,IACC,aAAa;AAAA,IACb,MAAM;AAAA,IACN,MAAM;AAAA,IACN,SAAS;AAAA,IACT,aACC;AAAA,EACF;AAAA,EACA,OAAG;AAAA,IACF;AAAA,MACC,MAAM;AAAA,QACL,eAAe,CAAC,IAAI;AAAA,MACrB;AAAA,IACD;AAAA,IACA;AAAA,EACD;AACD;AAEO,MAAM,uBAA0C;AAAA,EACtD;AAAA,IACC,aAAa;AAAA,IACb,MAAM;AAAA,IACN,MAAM;AAAA,IACN,kBAAkB;AAAA,IAClB,SAAS;AAAA,MACR;AAAA,QACC,MAAM;AAAA,QACN,OAAO;AAAA,MACR;AAAA,MACA;AAAA,QACC,MAAM;AAAA,QACN,OAAO;AAAA,MACR;AAAA,IACD;AAAA,IACA,SAAS;AAAA,EACV;AAAA,EACA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,CAAC,SAAS,KAAK,SAAS,kCAAc;AAE1E,QAAI,cAAc,gBAAgB,aAAa;AAC9C,YAAM,IAAI;AAAA,QACT,QAAQ,QAAQ;AAAA,QAChB;AAAA,MACD;AAAA,IACD;AAEA,UAAM,eAAW,oDAAsB,SAAS,MAAM;AACtD,UAAM,QAAQ,mBAAmB,QAAQ;AAEzC,YAAQ,aAAa;AAAA,MACpB,SAAS;AAAA,QACR,UAAU,QAAQ,mBAAmB,kCAAkC,CAAC;AAAA,MACzE;AAAA,MACA,YAAY;AAAA,IACb,CAAC;AAED,WAAO,CAAC,QAAQ,aAAa,CAAC;AAAA,EAC/B;AACD;","names":[]}
1
+ {"version":3,"sources":["../../../nodes/Form/Form.node.ts"],"sourcesContent":["import type {\n\tFormFieldsParameter,\n\tIExecuteFunctions,\n\tINodeExecutionData,\n\tINodeProperties,\n\tINodeTypeDescription,\n\tIWebhookFunctions,\n\tIWebhookResponseData,\n\tNodeTypeAndVersion,\n} from 'n8n-workflow';\nimport {\n\tNode,\n\tupdateDisplayOptions,\n\tNodeOperationError,\n\tFORM_NODE_TYPE,\n\tFORM_TRIGGER_NODE_TYPE,\n\ttryToParseJsonToFormFields,\n\tNodeConnectionTypes,\n} from 'n8n-workflow';\n\nimport { cssVariables } from './cssVariables';\nimport { renderFormCompletion } from './formCompletionUtils';\nimport { renderFormNode } from './formNodeUtils';\nimport { configureWaitTillDate } from '../../utils/sendAndWait/configureWaitTillDate.util';\nimport { limitWaitTimeProperties } from '../../utils/sendAndWait/descriptions';\nimport { formDescription, formFields, formTitle } from '../Form/common.descriptions';\nimport { prepareFormReturnItem, resolveRawData } from '../Form/utils';\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},\n\t...updateDisplayOptions(\n\t\t{\n\t\t\tshow: {\n\t\t\t\tlimitWaitTime: [true],\n\t\t\t},\n\t\t},\n\t\tlimitWaitTimeProperties,\n\t),\n];\n\nexport const formFieldsProperties: INodeProperties[] = [\n\t{\n\t\tdisplayName: 'Define Form',\n\t\tname: 'defineForm',\n\t\ttype: 'options',\n\t\tnoDataExpression: true,\n\t\toptions: [\n\t\t\t{\n\t\t\t\tname: 'Using Fields Below',\n\t\t\t\tvalue: 'fields',\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'Using JSON',\n\t\t\t\tvalue: 'json',\n\t\t\t},\n\t\t],\n\t\tdefault: 'fields',\n\t},\n\t{\n\t\tdisplayName: 'Form Fields',\n\t\tname: 'jsonOutput',\n\t\ttype: 'json',\n\t\ttypeOptions: {\n\t\t\trows: 5,\n\t\t},\n\t\tdefault:\n\t\t\t'[\\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]',\n\t\tvalidateType: 'form-fields',\n\t\tignoreValidationDuringExecution: true,\n\t\thint: '<a href=\"https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.form/\" target=\"_blank\">See docs</a> for field syntax',\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\tdefineForm: ['json'],\n\t\t\t},\n\t\t},\n\t},\n\t{ ...formFields, displayOptions: { show: { defineForm: ['fields'] } } },\n];\n\nconst pageProperties = updateDisplayOptions(\n\t{\n\t\tshow: {\n\t\t\toperation: ['page'],\n\t\t},\n\t},\n\t[\n\t\t...formFieldsProperties,\n\t\t...waitTimeProperties,\n\t\t{\n\t\t\tdisplayName: 'Options',\n\t\t\tname: 'options',\n\t\t\ttype: 'collection',\n\t\t\tplaceholder: 'Add option',\n\t\t\tdefault: {},\n\t\t\toptions: [\n\t\t\t\t{ ...formTitle, required: false },\n\t\t\t\tformDescription,\n\t\t\t\t{\n\t\t\t\t\tdisplayName: 'Button Label',\n\t\t\t\t\tname: 'buttonLabel',\n\t\t\t\t\ttype: 'string',\n\t\t\t\t\tdefault: 'Submit',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tdisplayName: 'Custom Form Styling',\n\t\t\t\t\tname: 'customCss',\n\t\t\t\t\ttype: 'string',\n\t\t\t\t\ttypeOptions: {\n\t\t\t\t\t\trows: 10,\n\t\t\t\t\t\teditor: 'cssEditor',\n\t\t\t\t\t},\n\t\t\t\t\tdefault: cssVariables.trim(),\n\t\t\t\t\tdescription: 'Override default styling of the public form interface with CSS',\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t],\n);\n\nconst completionProperties = updateDisplayOptions(\n\t{\n\t\tshow: {\n\t\t\toperation: ['completion'],\n\t\t},\n\t},\n\t[\n\t\t{\n\t\t\t// eslint-disable-next-line n8n-nodes-base/node-param-display-name-miscased\n\t\t\tdisplayName: 'On n8n Form Submission',\n\t\t\tname: 'respondWith',\n\t\t\ttype: 'options',\n\t\t\tdefault: 'text',\n\t\t\toptions: [\n\t\t\t\t{\n\t\t\t\t\tname: 'Show Completion Screen',\n\t\t\t\t\tvalue: 'text',\n\t\t\t\t\tdescription: 'Show a response text to the user',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'Redirect to URL',\n\t\t\t\t\tvalue: 'redirect',\n\t\t\t\t\tdescription: 'Redirect the user to a URL',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'Show Text',\n\t\t\t\t\tvalue: 'showText',\n\t\t\t\t\tdescription: 'Display simple text or HTML',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'Return Binary File',\n\t\t\t\t\tvalue: 'returnBinary',\n\t\t\t\t\tdescription: 'Return incoming binary file',\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t\t{\n\t\t\tdisplayName: 'URL',\n\t\t\tname: 'redirectUrl',\n\t\t\tvalidateType: 'url',\n\t\t\ttype: 'string',\n\t\t\tdefault: '',\n\t\t\trequired: true,\n\t\t\tdisplayOptions: {\n\t\t\t\tshow: {\n\t\t\t\t\trespondWith: ['redirect'],\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tdisplayName: 'Completion Title',\n\t\t\tname: 'completionTitle',\n\t\t\ttype: 'string',\n\t\t\tdefault: '',\n\t\t\trequired: true,\n\t\t\tdisplayOptions: {\n\t\t\t\tshow: {\n\t\t\t\t\trespondWith: ['text', 'returnBinary'],\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tdisplayName: 'Completion Message',\n\t\t\tname: 'completionMessage',\n\t\t\ttype: 'string',\n\t\t\tdefault: '',\n\t\t\ttypeOptions: {\n\t\t\t\trows: 2,\n\t\t\t},\n\t\t\tdisplayOptions: {\n\t\t\t\tshow: {\n\t\t\t\t\trespondWith: ['text', 'returnBinary'],\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tdisplayName: 'Text',\n\t\t\tname: 'responseText',\n\t\t\ttype: 'string',\n\t\t\tdisplayOptions: {\n\t\t\t\tshow: {\n\t\t\t\t\trespondWith: ['showText'],\n\t\t\t\t},\n\t\t\t},\n\t\t\ttypeOptions: {\n\t\t\t\trows: 2,\n\t\t\t},\n\t\t\tdefault: '',\n\t\t\tplaceholder: 'e.g. Thanks for filling the form',\n\t\t\tdescription: 'The text to display on the page. Use HTML to show a customized web page.',\n\t\t},\n\t\t{\n\t\t\tdisplayName: 'Input Data Field Name',\n\t\t\tname: 'inputDataFieldName',\n\t\t\ttype: 'string',\n\t\t\tdisplayOptions: {\n\t\t\t\tshow: {\n\t\t\t\t\trespondWith: ['returnBinary'],\n\t\t\t\t},\n\t\t\t},\n\t\t\tdefault: 'data',\n\t\t\tplaceholder: 'e.g. data',\n\t\t\tdescription:\n\t\t\t\t'Find the name of input field containing the binary data to return in the Input panel on the left, in the Binary tab',\n\t\t\thint: 'The name of the input field containing the binary file data to be returned',\n\t\t},\n\t\t...waitTimeProperties,\n\t\t{\n\t\t\tdisplayName: 'Options',\n\t\t\tname: 'options',\n\t\t\ttype: 'collection',\n\t\t\tplaceholder: 'Add option',\n\t\t\tdefault: {},\n\t\t\toptions: [\n\t\t\t\t{ ...formTitle, required: false, displayName: 'Completion Page Title' },\n\t\t\t\t{\n\t\t\t\t\tdisplayName: 'Custom Form Styling',\n\t\t\t\t\tname: 'customCss',\n\t\t\t\t\ttype: 'string',\n\t\t\t\t\ttypeOptions: {\n\t\t\t\t\t\trows: 10,\n\t\t\t\t\t\teditor: 'cssEditor',\n\t\t\t\t\t},\n\t\t\t\t\tdefault: cssVariables.trim(),\n\t\t\t\t\tdescription: 'Override default styling of the public form interface with CSS',\n\t\t\t\t},\n\t\t\t],\n\t\t\tdisplayOptions: {\n\t\t\t\tshow: {\n\t\t\t\t\trespondWith: ['text', 'returnBinary'],\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t],\n);\n\nexport class Form extends Node {\n\tnodeInputData: INodeExecutionData[] = [];\n\n\tdescription: INodeTypeDescription = {\n\t\tdisplayName: 'n8n Form',\n\t\tname: 'form',\n\t\ticon: 'file:form.svg',\n\t\tgroup: ['input'],\n\t\tversion: 1,\n\t\tdescription: 'Generate webforms in n8n and pass their responses to the workflow',\n\t\tdefaults: {\n\t\t\tname: 'Form',\n\t\t},\n\t\tinputs: [NodeConnectionTypes.Main],\n\t\toutputs: [NodeConnectionTypes.Main],\n\t\twebhooks: [\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: '',\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: 'responseNode',\n\t\t\t\tpath: '',\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\t// eslint-disable-next-line n8n-nodes-base/node-param-display-name-miscased\n\t\t\t\tdisplayName: 'An n8n Form Trigger node must be set up before this node',\n\t\t\t\tname: 'triggerNotice',\n\t\t\t\ttype: 'notice',\n\t\t\t\tdefault: '',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Page Type',\n\t\t\t\tname: 'operation',\n\t\t\t\ttype: 'options',\n\t\t\t\tdefault: 'page',\n\t\t\t\tnoDataExpression: true,\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Next Form Page',\n\t\t\t\t\t\tvalue: 'page',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Form Ending',\n\t\t\t\t\t\tvalue: 'completion',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t\t...pageProperties,\n\t\t\t...completionProperties,\n\t\t],\n\t};\n\n\tasync webhook(context: IWebhookFunctions): Promise<IWebhookResponseData> {\n\t\tconst res = context.getResponseObject();\n\n\t\tconst operation = context.getNodeParameter('operation', '') as string;\n\n\t\tconst parentNodes = context.getParentNodes(context.getNode().name);\n\t\tconst trigger = parentNodes.find(\n\t\t\t(node) => node.type === 'n8n-nodes-base.formTrigger',\n\t\t) as NodeTypeAndVersion;\n\n\t\tconst mode = context.evaluateExpression(`{{ $('${trigger?.name}').first().json.formMode }}`) as\n\t\t\t| 'test'\n\t\t\t| 'production';\n\n\t\tconst defineForm = context.getNodeParameter('defineForm', false) as string;\n\n\t\tlet fields: FormFieldsParameter = [];\n\t\tif (defineForm === 'json') {\n\t\t\ttry {\n\t\t\t\tconst jsonOutput = context.getNodeParameter('jsonOutput', '', {\n\t\t\t\t\trawExpressions: true,\n\t\t\t\t}) as string;\n\n\t\t\t\tfields = tryToParseJsonToFormFields(resolveRawData(context, jsonOutput));\n\t\t\t} catch (error) {\n\t\t\t\tthrow new NodeOperationError(context.getNode(), error.message, {\n\t\t\t\t\tdescription: error.message,\n\t\t\t\t\ttype: mode === 'test' ? 'manual-form-test' : undefined,\n\t\t\t\t});\n\t\t\t}\n\t\t} else {\n\t\t\tfields = context.getNodeParameter('formFields.values', []) as FormFieldsParameter;\n\t\t}\n\n\t\tconst method = context.getRequestObject().method;\n\n\t\tif (operation === 'completion' && method === 'GET') {\n\t\t\treturn await renderFormCompletion(context, res, trigger);\n\t\t}\n\n\t\tif (operation === 'completion' && method === 'POST') {\n\t\t\treturn {\n\t\t\t\tworkflowData: [context.evaluateExpression('{{ $input.all() }}') as INodeExecutionData[]],\n\t\t\t};\n\t\t}\n\n\t\tif (method === 'GET') {\n\t\t\treturn await renderFormNode(context, res, trigger, fields, mode);\n\t\t}\n\n\t\tlet useWorkflowTimezone = context.evaluateExpression(\n\t\t\t`{{ $('${trigger?.name}').params.options?.useWorkflowTimezone }}`,\n\t\t) as boolean;\n\n\t\tif (useWorkflowTimezone === undefined && trigger?.typeVersion > 2) {\n\t\t\tuseWorkflowTimezone = true;\n\t\t}\n\n\t\tconst returnItem = await prepareFormReturnItem(context, fields, mode, useWorkflowTimezone);\n\n\t\treturn {\n\t\t\twebhookResponse: { status: 200 },\n\t\t\tworkflowData: [[returnItem]],\n\t\t};\n\t}\n\n\tasync execute(context: IExecuteFunctions): Promise<INodeExecutionData[][]> {\n\t\tconst operation = context.getNodeParameter('operation', 0);\n\n\t\tif (operation === 'completion') {\n\t\t\tthis.nodeInputData = context.getInputData();\n\t\t}\n\n\t\tconst parentNodes = context.getParentNodes(context.getNode().name);\n\t\tconst hasFormTrigger = parentNodes.some((node) => node.type === FORM_TRIGGER_NODE_TYPE);\n\n\t\tif (!hasFormTrigger) {\n\t\t\tthrow new NodeOperationError(\n\t\t\t\tcontext.getNode(),\n\t\t\t\t'Form Trigger node must be set before this node',\n\t\t\t);\n\t\t}\n\n\t\tconst childNodes = context.getChildNodes(context.getNode().name);\n\t\tconst hasNextPage = childNodes.some((node) => node.type === FORM_NODE_TYPE);\n\n\t\tif (operation === 'completion' && hasNextPage) {\n\t\t\tthrow new NodeOperationError(\n\t\t\t\tcontext.getNode(),\n\t\t\t\t'Completion has to be the last Form node in the workflow',\n\t\t\t);\n\t\t}\n\n\t\tconst waitTill = configureWaitTillDate(context, 'root');\n\t\tawait context.putExecutionToWait(waitTill);\n\n\t\tcontext.sendResponse({\n\t\t\theaders: {\n\t\t\t\tlocation: context.evaluateExpression('{{ $execution.resumeFormUrl }}', 0),\n\t\t\t},\n\t\t\tstatusCode: 307,\n\t\t});\n\n\t\treturn [context.getInputData()];\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAUA,0BAQO;AAEP,0BAA6B;AAC7B,iCAAqC;AACrC,2BAA+B;AAC/B,mCAAsC;AACtC,0BAAwC;AACxC,oBAAuD;AACvD,mBAAsD;AAEtD,MAAM,qBAAwC;AAAA,EAC7C;AAAA,IACC,aAAa;AAAA,IACb,MAAM;AAAA,IACN,MAAM;AAAA,IACN,SAAS;AAAA,IACT,aACC;AAAA,EACF;AAAA,EACA,OAAG;AAAA,IACF;AAAA,MACC,MAAM;AAAA,QACL,eAAe,CAAC,IAAI;AAAA,MACrB;AAAA,IACD;AAAA,IACA;AAAA,EACD;AACD;AAEO,MAAM,uBAA0C;AAAA,EACtD;AAAA,IACC,aAAa;AAAA,IACb,MAAM;AAAA,IACN,MAAM;AAAA,IACN,kBAAkB;AAAA,IAClB,SAAS;AAAA,MACR;AAAA,QACC,MAAM;AAAA,QACN,OAAO;AAAA,MACR;AAAA,MACA;AAAA,QACC,MAAM;AAAA,QACN,OAAO;AAAA,MACR;AAAA,IACD;AAAA,IACA,SAAS;AAAA,EACV;AAAA,EACA;AAAA,IACC,aAAa;AAAA,IACb,MAAM;AAAA,IACN,M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AAc,gBAAgB,aAAa;AAC9C,YAAM,IAAI;AAAA,QACT,QAAQ,QAAQ;AAAA,QAChB;AAAA,MACD;AAAA,IACD;AAEA,UAAM,eAAW,oDAAsB,SAAS,MAAM;AACtD,UAAM,QAAQ,mBAAmB,QAAQ;AAEzC,YAAQ,aAAa;AAAA,MACpB,SAAS;AAAA,QACR,UAAU,QAAQ,mBAAmB,kCAAkC,CAAC;AAAA,MACzE;AAAA,MACA,YAAY;AAAA,IACb,CAAC;AAED,WAAO,CAAC,QAAQ,aAAa,CAAC;AAAA,EAC/B;AACD;","names":[]}
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../nodes/Form/formCompletionUtils.ts"],"sourcesContent":["import { type Response } from 'express';\nimport {\n\ttype NodeTypeAndVersion,\n\ttype IWebhookFunctions,\n\ttype IWebhookResponseData,\n\ttype IBinaryData,\n\ttype IDataObject,\n\tOperationalError,\n} from 'n8n-workflow';\n\nimport { sanitizeCustomCss, sanitizeHtml } from './utils';\n\nconst getBinaryDataFromNode = (context: IWebhookFunctions, nodeName: string): IDataObject => {\n\treturn context.evaluateExpression(`{{ $('${nodeName}').first().binary }}`) as IDataObject;\n};\n\nexport const binaryResponse = async (\n\tcontext: IWebhookFunctions,\n): Promise<{ data: string | Buffer; fileName: string; type: string }> => {\n\tconst inputDataFieldName = context.getNodeParameter('inputDataFieldName', '') as string;\n\tconst parentNodes = context.getParentNodes(context.getNode().name);\n\tconst binaryNode = parentNodes\n\t\t.reverse()\n\t\t.find((node) => getBinaryDataFromNode(context, node?.name)?.hasOwnProperty(inputDataFieldName));\n\tif (!binaryNode) {\n\t\tthrow new OperationalError(`No binary data with field ${inputDataFieldName} found.`);\n\t}\n\tconst binaryData = getBinaryDataFromNode(context, binaryNode?.name)[\n\t\tinputDataFieldName\n\t] as IBinaryData;\n\n\treturn {\n\t\t// If a binaryData has an id, the following field is set:\n\t\t// N8N_DEFAULT_BINARY_DATA_MODE=filesystem\n\t\tdata: binaryData.id\n\t\t\t? await context.helpers.binaryToBuffer(await context.helpers.getBinaryStream(binaryData.id))\n\t\t\t: atob(binaryData.data),\n\t\tfileName: binaryData.fileName ?? 'file',\n\t\ttype: binaryData.mimeType,\n\t};\n};\n\nexport const renderFormCompletion = async (\n\tcontext: IWebhookFunctions,\n\tres: Response,\n\ttrigger: NodeTypeAndVersion,\n): Promise<IWebhookResponseData> => {\n\tconst completionTitle = context.getNodeParameter('completionTitle', '') as string;\n\tconst completionMessage = context.getNodeParameter('completionMessage', '') as string;\n\tconst redirectUrl = context.getNodeParameter('redirectUrl', '') as string;\n\tconst options = context.getNodeParameter('options', {}) as {\n\t\tformTitle: string;\n\t\tcustomCss?: string;\n\t};\n\tconst responseText = context.getNodeParameter('responseText', '') as string;\n\tconst binary =\n\t\tcontext.getNodeParameter('respondWith', '') === 'returnBinary'\n\t\t\t? await binaryResponse(context)\n\t\t\t: '';\n\n\tlet title = options.formTitle;\n\tif (!title) {\n\t\ttitle = context.evaluateExpression(`{{ $('${trigger?.name}').params.formTitle }}`) as string;\n\t}\n\tconst appendAttribution = context.evaluateExpression(\n\t\t`{{ $('${trigger?.name}').params.options?.appendAttribution === false ? false : true }}`,\n\t) as boolean;\n\n\tres.render('form-trigger-completion', {\n\t\ttitle: completionTitle,\n\t\tmessage: completionMessage,\n\t\tformTitle: title,\n\t\tappendAttribution,\n\t\tresponseText: sanitizeHtml(responseText),\n\t\tresponseBinary: encodeURIComponent(JSON.stringify(binary)),\n\t\tdangerousCustomCss: sanitizeCustomCss(options.customCss),\n\t\tredirectUrl,\n\t});\n\n\treturn { noWebhookResponse: true };\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,0BAOO;AAEP,mBAAgD;AAEhD,MAAM,wBAAwB,CAAC,SAA4B,aAAkC;AAC5F,SAAO,QAAQ,mBAAmB,SAAS,QAAQ,sBAAsB;AAC1E;AAEO,MAAM,iBAAiB,OAC7B,YACwE;AACxE,QAAM,qB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c,2BAAa,YAAY;AAAA,IACvC,gBAAgB,mBAAmB,KAAK,UAAU,MAAM,CAAC;AAAA,IACzD,wBAAoB,gCAAkB,QAAQ,SAAS;AAAA,IACvD;AAAA,EACD,CAAC;AAED,SAAO,EAAE,mBAAmB,KAAK;AAClC;","names":[]}
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../nodes/Form/formNodeUtils.ts"],"sourcesContent":["import { type Response } from 'express';\nimport {\n\ttype NodeTypeAndVersion,\n\ttype IWebhookFunctions,\n\ttype FormFieldsParameter,\n\ttype IWebhookResponseData,\n} from 'n8n-workflow';\n\nimport { renderForm } from './utils';\n\nexport const renderFormNode = async (\n\tcontext: IWebhookFunctions,\n\tres: Response,\n\ttrigger: NodeTypeAndVersion,\n\tfields: FormFieldsParameter,\n\tmode: 'test' | 'production',\n): Promise<IWebhookResponseData> => {\n\tconst options = context.getNodeParameter('options', {}) as {\n\t\tformTitle: string;\n\t\tformDescription: string;\n\t\tbuttonLabel: string;\n\t\tcustomCss?: string;\n\t};\n\n\tlet title = options.formTitle;\n\tif (!title) {\n\t\ttitle = context.evaluateExpression(`{{ $('${trigger?.name}').params.formTitle }}`) as string;\n\t}\n\n\tlet buttonLabel = options.buttonLabel;\n\tif (!buttonLabel) {\n\t\tbuttonLabel =\n\t\t\t(context.evaluateExpression(\n\t\t\t\t`{{ $('${trigger?.name}').params.options?.buttonLabel }}`,\n\t\t\t) as string) || 'Submit';\n\t}\n\n\tconst appendAttribution = context.evaluateExpression(\n\t\t`{{ $('${trigger?.name}').params.options?.appendAttribution === false ? false : true }}`,\n\t) as boolean;\n\n\trenderForm({\n\t\tcontext,\n\t\tres,\n\t\tformTitle: title,\n\t\tformDescription: options.formDescription,\n\t\tformFields: fields,\n\t\tresponseMode: 'responseNode',\n\t\tmode,\n\t\tredirectUrl: undefined,\n\t\tappendAttribution,\n\t\tbuttonLabel,\n\t\tcustomCss: options.customCss,\n\t});\n\n\treturn {\n\t\tnoWebhookResponse: true,\n\t};\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAQA,mBAA2B;AAEpB,MAAM,iBAAiB,OAC7B,SACA,KACA,SACA,QACA,SACmC;AACnC,QAAM,UAAU,QAAQ,iBAAiB,WAAW,CAAC,CAAC;AAOtD,MAAI,QAAQ,QAAQ;AACpB,MAAI,CAAC,OAAO;AACX,YAAQ,QAAQ,mBAAmB,SAAS,SAAS,IAAI,wBAAwB;AAAA,EAClF;AAEA,MAAI,cAAc,QAAQ;AAC1B,MAAI,CAAC,aAAa;AACjB,kBACE,QAAQ;AAAA,MACR,SAAS,SAAS,IAAI;AAAA,IACvB,KAAgB;AAAA,EAClB;AAEA,QAAM,oBAAoB,QAAQ;AAAA,IACjC,SAAS,SAAS,IAAI;AAAA,EACvB;AAEA,+BAAW;AAAA,IACV;AAAA,IACA;AAAA,IACA,WAAW;AAAA,IACX,iBAAiB,QAAQ;AAAA,IACzB,YAAY;AAAA,IACZ,cAAc;AAAA,IACd;AAAA,IACA,aAAa;AAAA,IACb;AAAA,IACA;AAAA,IACA,WAAW,QAAQ;AAAA,EACpB,CAAC;AAED,SAAO;AAAA,IACN,mBAAmB;AAAA,EACpB;AACD;","names":[]}
@@ -46,10 +46,10 @@ var import_isbot = __toESM(require("isbot"));
46
46
  var import_luxon = require("luxon");
47
47
  var import_n8n_workflow = require("n8n-workflow");
48
48
  var import_sanitize_html = __toESM(require("sanitize-html"));
49
- var import_utilities = require("../../../utils/utilities");
50
- var import_error = require("../../Webhook/error");
51
- var import_utils = require("../../Webhook/utils");
52
- var import_interfaces = require("../interfaces");
49
+ var import_interfaces = require("./interfaces");
50
+ var import_utilities = require("../../utils/utilities");
51
+ var import_error = require("../Webhook/error");
52
+ var import_utils = require("../Webhook/utils");
53
53
  function sanitizeHtml(text) {
54
54
  return (0, import_sanitize_html.default)(text, {
55
55
  allowedTags: [
@@ -84,24 +84,10 @@ function sanitizeHtml(text) {
84
84
  allowedAttributes: {
85
85
  a: ["href", "target", "rel"],
86
86
  img: ["src", "alt", "width", "height"],
87
- video: ["controls", "autoplay", "loop", "muted", "poster", "width", "height"],
88
- iframe: [
89
- "src",
90
- "width",
91
- "height",
92
- "frameborder",
93
- "allow",
94
- "allowfullscreen",
95
- "referrerpolicy"
96
- ],
97
- source: ["src", "type"]
87
+ video: ["*"],
88
+ iframe: ["*"],
89
+ source: ["*"]
98
90
  },
99
- allowedSchemes: ["https", "http"],
100
- allowedSchemesByTag: {
101
- source: ["https", "http"],
102
- iframe: ["https", "http"]
103
- },
104
- allowProtocolRelative: false,
105
91
  transformTags: {
106
92
  iframe: import_sanitize_html.default.simpleTransform("iframe", {
107
93
  sandbox: "",
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../nodes/Form/utils.ts"],"sourcesContent":["import type { Response } from 'express';\nimport isbot from 'isbot';\nimport { DateTime } from 'luxon';\nimport type {\n\tINodeExecutionData,\n\tMultiPartFormData,\n\tIDataObject,\n\tIWebhookFunctions,\n\tFormFieldsParameter,\n\tNodeTypeAndVersion,\n} from 'n8n-workflow';\nimport {\n\tFORM_NODE_TYPE,\n\tFORM_TRIGGER_NODE_TYPE,\n\tNodeOperationError,\n\tWAIT_NODE_TYPE,\n\tjsonParse,\n} from 'n8n-workflow';\nimport sanitize from 'sanitize-html';\n\nimport type { FormTriggerData, FormTriggerInput } from './interfaces';\nimport { FORM_TRIGGER_AUTHENTICATION_PROPERTY } from './interfaces';\nimport { getResolvables } from '../../utils/utilities';\nimport { WebhookAuthorizationError } from '../Webhook/error';\nimport { validateWebhookAuthentication } from '../Webhook/utils';\n\nexport function sanitizeHtml(text: string) {\n\treturn sanitize(text, {\n\t\tallowedTags: [\n\t\t\t'b',\n\t\t\t'div',\n\t\t\t'i',\n\t\t\t'iframe',\n\t\t\t'img',\n\t\t\t'video',\n\t\t\t'source',\n\t\t\t'em',\n\t\t\t'strong',\n\t\t\t'a',\n\t\t\t'h1',\n\t\t\t'h2',\n\t\t\t'h3',\n\t\t\t'h4',\n\t\t\t'h5',\n\t\t\t'h6',\n\t\t\t'u',\n\t\t\t'sub',\n\t\t\t'sup',\n\t\t\t'code',\n\t\t\t'pre',\n\t\t\t'span',\n\t\t\t'br',\n\t\t\t'ul',\n\t\t\t'ol',\n\t\t\t'li',\n\t\t\t'p',\n\t\t],\n\t\tallowedAttributes: {\n\t\t\ta: ['href', 'target', 'rel'],\n\t\t\timg: ['src', 'alt', 'width', 'height'],\n\t\t\tvideo: ['*'],\n\t\t\tiframe: ['*'],\n\t\t\tsource: ['*'],\n\t\t},\n\t\ttransformTags: {\n\t\t\tiframe: sanitize.simpleTransform('iframe', {\n\t\t\t\tsandbox: '',\n\t\t\t\treferrerpolicy: 'strict-origin-when-cross-origin',\n\t\t\t\tallow: 'fullscreen; autoplay; encrypted-media',\n\t\t\t}),\n\t\t},\n\t});\n}\n\nexport const prepareFormFields = (context: IWebhookFunctions, fields: FormFieldsParameter) => {\n\treturn fields.map((field) => {\n\t\tif (field.fieldType === 'html') {\n\t\t\tlet { html } = field;\n\n\t\t\tif (!html) return field;\n\n\t\t\tfor (const resolvable of getResolvables(html)) {\n\t\t\t\thtml = html.replace(resolvable, context.evaluateExpression(resolvable) as string);\n\t\t\t}\n\n\t\t\tfield.html = sanitizeHtml(html);\n\t\t}\n\n\t\tif (field.fieldType === 'hiddenField') {\n\t\t\tfield.fieldLabel = field.fieldName as string;\n\t\t}\n\n\t\treturn field;\n\t});\n};\n\nexport function sanitizeCustomCss(css: string | undefined): string | undefined {\n\tif (!css) return undefined;\n\n\t// Use sanitize-html with custom settings for CSS\n\treturn sanitize(css, {\n\t\tallowedTags: [], // No HTML tags allowed\n\t\tallowedAttributes: {}, // No attributes allowed\n\t\t// This ensures we're only keeping the text content\n\t\t// which should be the CSS, while removing any HTML/script tags\n\t});\n}\n\nexport function createDescriptionMetadata(description: string) {\n\treturn description === ''\n\t\t? 'n8n form'\n\t\t: description.replace(/^\\s*\\n+|<\\/?[^>]+(>|$)/g, '').slice(0, 150);\n}\n\nexport function prepareFormData({\n\tformTitle,\n\tformDescription,\n\tformSubmittedHeader,\n\tformSubmittedText,\n\tredirectUrl,\n\tformFields,\n\ttestRun,\n\tquery,\n\tinstanceId,\n\tuseResponseData,\n\tappendAttribution = true,\n\tbuttonLabel,\n\tcustomCss,\n}: {\n\tformTitle: string;\n\tformDescription: string;\n\tformSubmittedText: string | undefined;\n\tredirectUrl: string | undefined;\n\tformFields: FormFieldsParameter;\n\ttestRun: boolean;\n\tquery: IDataObject;\n\tinstanceId?: string;\n\tuseResponseData?: boolean;\n\tappendAttribution?: boolean;\n\tbuttonLabel?: string;\n\tformSubmittedHeader?: string;\n\tcustomCss?: string;\n}) {\n\tconst utm_campaign = instanceId ? `&utm_campaign=${instanceId}` : '';\n\tconst n8nWebsiteLink = `https://n8n.io/?utm_source=n8n-internal&utm_medium=form-trigger${utm_campaign}`;\n\n\tif (formSubmittedText === undefined) {\n\t\tformSubmittedText = 'Your response has been recorded';\n\t}\n\n\tconst formData: FormTriggerData = {\n\t\ttestRun,\n\t\tformTitle,\n\t\tformDescription,\n\t\tformDescriptionMetadata: createDescriptionMetadata(formDescription),\n\t\tformSubmittedHeader,\n\t\tformSubmittedText,\n\t\tn8nWebsiteLink,\n\t\tformFields: [],\n\t\tuseResponseData,\n\t\tappendAttribution,\n\t\tbuttonLabel,\n\t\tdangerousCustomCss: sanitizeCustomCss(customCss),\n\t};\n\n\tif (redirectUrl) {\n\t\tif (!redirectUrl.includes('://')) {\n\t\t\tredirectUrl = `http://${redirectUrl}`;\n\t\t}\n\t\tformData.redirectUrl = redirectUrl;\n\t}\n\n\tfor (const [index, field] of formFields.entries()) {\n\t\tconst { fieldType, requiredField, multiselect, placeholder } = field;\n\n\t\tconst input: IDataObject = {\n\t\t\tid: `field-${index}`,\n\t\t\terrorId: `error-field-${index}`,\n\t\t\tlabel: field.fieldLabel,\n\t\t\tinputRequired: requiredField ? 'form-required' : '',\n\t\t\tdefaultValue: query[field.fieldLabel] ?? '',\n\t\t\tplaceholder,\n\t\t};\n\n\t\tif (multiselect) {\n\t\t\tinput.isMultiSelect = true;\n\t\t\tinput.multiSelectOptions =\n\t\t\t\tfield.fieldOptions?.values.map((e, i) => ({\n\t\t\t\t\tid: `option${i}_${input.id}`,\n\t\t\t\t\tlabel: e.option,\n\t\t\t\t})) ?? [];\n\t\t} else if (fieldType === 'file') {\n\t\t\tinput.isFileInput = true;\n\t\t\tinput.acceptFileTypes = field.acceptFileTypes;\n\t\t\tinput.multipleFiles = field.multipleFiles ? 'multiple' : '';\n\t\t} else if (fieldType === 'dropdown') {\n\t\t\tinput.isSelect = true;\n\t\t\tconst fieldOptions = field.fieldOptions?.values ?? [];\n\t\t\tinput.selectOptions = fieldOptions.map((e) => e.option);\n\t\t} else if (fieldType === 'textarea') {\n\t\t\tinput.isTextarea = true;\n\t\t} else if (fieldType === 'html') {\n\t\t\tinput.isHtml = true;\n\t\t\tinput.html = field.html as string;\n\t\t} else if (fieldType === 'hiddenField') {\n\t\t\tinput.isHidden = true;\n\t\t\tinput.hiddenName = field.fieldName as string;\n\t\t\tinput.hiddenValue =\n\t\t\t\tinput.defaultValue === '' ? (field.fieldValue as string) : input.defaultValue;\n\t\t} else {\n\t\t\tinput.isInput = true;\n\t\t\tinput.type = fieldType as 'text' | 'number' | 'date' | 'email';\n\t\t}\n\n\t\tformData.formFields.push(input as FormTriggerInput);\n\t}\n\n\treturn formData;\n}\n\nexport const validateResponseModeConfiguration = (context: IWebhookFunctions) => {\n\tconst responseMode = context.getNodeParameter('responseMode', 'onReceived') as string;\n\tconst connectedNodes = context.getChildNodes(context.getNode().name);\n\tconst nodeVersion = context.getNode().typeVersion;\n\n\tconst isRespondToWebhookConnected = connectedNodes.some(\n\t\t(node) => node.type === 'n8n-nodes-base.respondToWebhook',\n\t);\n\n\tif (!isRespondToWebhookConnected && responseMode === 'responseNode') {\n\t\tthrow new NodeOperationError(\n\t\t\tcontext.getNode(),\n\t\t\tnew Error('No Respond to Webhook node found in the workflow'),\n\t\t\t{\n\t\t\t\tdescription:\n\t\t\t\t\t'Insert a Respond to Webhook node to your workflow to respond to the form submission or choose another option for the “Respond When” parameter',\n\t\t\t},\n\t\t);\n\t}\n\n\tif (isRespondToWebhookConnected && responseMode !== 'responseNode' && nodeVersion <= 2.1) {\n\t\tthrow new NodeOperationError(\n\t\t\tcontext.getNode(),\n\t\t\tnew Error(`${context.getNode().name} node not correctly configured`),\n\t\t\t{\n\t\t\t\tdescription:\n\t\t\t\t\t'Set the “Respond When” parameter to “Using Respond to Webhook Node” or remove the Respond to Webhook node',\n\t\t\t},\n\t\t);\n\t}\n\n\tif (isRespondToWebhookConnected && nodeVersion > 2.1) {\n\t\tthrow new NodeOperationError(\n\t\t\tcontext.getNode(),\n\t\t\tnew Error(\n\t\t\t\t'The \"Respond to Webhook\" node is not supported in workflows initiated by the \"n8n Form Trigger\"',\n\t\t\t),\n\t\t\t{\n\t\t\t\tdescription:\n\t\t\t\t\t'To configure your response, add an \"n8n Form\" node and set the \"Page Type\" to \"Form Ending\"',\n\t\t\t},\n\t\t);\n\t}\n};\n\nexport function addFormResponseDataToReturnItem(\n\treturnItem: INodeExecutionData,\n\tformFields: FormFieldsParameter,\n\tbodyData: IDataObject,\n) {\n\tfor (const [index, field] of formFields.entries()) {\n\t\tconst key = `field-${index}`;\n\t\tconst name = field.fieldLabel ?? field.fieldName;\n\t\tlet value = bodyData[key] ?? null;\n\n\t\tif (value === null) {\n\t\t\treturnItem.json[name] = null;\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (field.fieldType === 'html') {\n\t\t\tif (field.elementName) {\n\t\t\t\treturnItem.json[field.elementName] = value;\n\t\t\t}\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (field.fieldType === 'number') {\n\t\t\tvalue = Number(value);\n\t\t}\n\t\tif (field.fieldType === 'text') {\n\t\t\tvalue = String(value).trim();\n\t\t}\n\t\tif (field.multiselect && typeof value === 'string') {\n\t\t\tvalue = jsonParse(value);\n\t\t}\n\t\tif (field.fieldType === 'date' && value && field.formatDate !== '') {\n\t\t\tvalue = DateTime.fromFormat(String(value), 'yyyy-mm-dd').toFormat(field.formatDate as string);\n\t\t}\n\t\tif (field.fieldType === 'file' && field.multipleFiles && !Array.isArray(value)) {\n\t\t\tvalue = [value];\n\t\t}\n\n\t\treturnItem.json[name] = value;\n\t}\n}\n\nexport async function prepareFormReturnItem(\n\tcontext: IWebhookFunctions,\n\tformFields: FormFieldsParameter,\n\tmode: 'test' | 'production',\n\tuseWorkflowTimezone: boolean = false,\n) {\n\tconst bodyData = (context.getBodyData().data as IDataObject) ?? {};\n\tconst files = (context.getBodyData().files as IDataObject) ?? {};\n\n\tconst returnItem: INodeExecutionData = {\n\t\tjson: {},\n\t};\n\tif (files && Object.keys(files).length) {\n\t\treturnItem.binary = {};\n\t}\n\n\tfor (const key of Object.keys(files)) {\n\t\tconst processFiles: MultiPartFormData.File[] = [];\n\t\tlet multiFile = false;\n\t\tconst filesInput = files[key] as MultiPartFormData.File[] | MultiPartFormData.File;\n\n\t\tif (Array.isArray(filesInput)) {\n\t\t\tbodyData[key] = filesInput.map((file) => ({\n\t\t\t\tfilename: file.originalFilename,\n\t\t\t\tmimetype: file.mimetype,\n\t\t\t\tsize: file.size,\n\t\t\t}));\n\t\t\tprocessFiles.push(...filesInput);\n\t\t\tmultiFile = true;\n\t\t} else {\n\t\t\tbodyData[key] = {\n\t\t\t\tfilename: filesInput.originalFilename,\n\t\t\t\tmimetype: filesInput.mimetype,\n\t\t\t\tsize: filesInput.size,\n\t\t\t};\n\t\t\tprocessFiles.push(filesInput);\n\t\t}\n\n\t\tconst entryIndex = Number(key.replace(/field-/g, ''));\n\t\tconst fieldLabel = isNaN(entryIndex) ? key : formFields[entryIndex].fieldLabel;\n\n\t\tlet fileCount = 0;\n\t\tfor (const file of processFiles) {\n\t\t\tlet binaryPropertyName = fieldLabel.replace(/\\W/g, '_');\n\n\t\t\tif (multiFile) {\n\t\t\t\tbinaryPropertyName += `_${fileCount++}`;\n\t\t\t}\n\n\t\t\treturnItem.binary![binaryPropertyName] = await context.nodeHelpers.copyBinaryFile(\n\t\t\t\tfile.filepath,\n\t\t\t\tfile.originalFilename ?? file.newFilename,\n\t\t\t\tfile.mimetype,\n\t\t\t);\n\t\t}\n\t}\n\n\taddFormResponseDataToReturnItem(returnItem, formFields, bodyData);\n\n\tconst timezone = useWorkflowTimezone ? context.getTimezone() : 'UTC';\n\treturnItem.json.submittedAt = DateTime.now().setZone(timezone).toISO();\n\n\treturnItem.json.formMode = mode;\n\n\tif (\n\t\tcontext.getNode().type === FORM_TRIGGER_NODE_TYPE &&\n\t\tObject.keys(context.getRequestObject().query || {}).length\n\t) {\n\t\treturnItem.json.formQueryParameters = context.getRequestObject().query;\n\t}\n\n\treturn returnItem;\n}\n\nexport function renderForm({\n\tcontext,\n\tres,\n\tformTitle,\n\tformDescription,\n\tformFields,\n\tresponseMode,\n\tmode,\n\tformSubmittedText,\n\tredirectUrl,\n\tappendAttribution,\n\tbuttonLabel,\n\tcustomCss,\n}: {\n\tcontext: IWebhookFunctions;\n\tres: Response;\n\tformTitle: string;\n\tformDescription: string;\n\tformFields: FormFieldsParameter;\n\tresponseMode: string;\n\tmode: 'test' | 'production';\n\tformSubmittedText?: string;\n\tredirectUrl?: string;\n\tappendAttribution?: boolean;\n\tbuttonLabel?: string;\n\tcustomCss?: string;\n}) {\n\tformDescription = (formDescription || '').replace(/\\\\n/g, '\\n').replace(/<br>/g, '\\n');\n\tconst instanceId = context.getInstanceId();\n\n\tconst useResponseData = responseMode === 'responseNode';\n\n\tlet query: IDataObject = {};\n\n\tif (context.getNode().type === FORM_TRIGGER_NODE_TYPE) {\n\t\tquery = context.getRequestObject().query as IDataObject;\n\t} else if (context.getNode().type === FORM_NODE_TYPE) {\n\t\tconst parentNodes = context.getParentNodes(context.getNode().name);\n\t\tconst trigger = parentNodes.find(\n\t\t\t(node) => node.type === FORM_TRIGGER_NODE_TYPE,\n\t\t) as NodeTypeAndVersion;\n\t\ttry {\n\t\t\tconst triggerQueryParameters = context.evaluateExpression(\n\t\t\t\t`{{ $('${trigger?.name}').first().json.formQueryParameters }}`,\n\t\t\t) as IDataObject;\n\n\t\t\tif (triggerQueryParameters) {\n\t\t\t\tquery = triggerQueryParameters;\n\t\t\t}\n\t\t} catch (error) {}\n\t}\n\n\tformFields = prepareFormFields(context, formFields);\n\n\tconst data = prepareFormData({\n\t\tformTitle,\n\t\tformDescription,\n\t\tformSubmittedText,\n\t\tredirectUrl,\n\t\tformFields,\n\t\ttestRun: mode === 'test',\n\t\tquery,\n\t\tinstanceId,\n\t\tuseResponseData,\n\t\tappendAttribution,\n\t\tbuttonLabel,\n\t\tcustomCss,\n\t});\n\n\tres.render('form-trigger', data);\n}\n\nexport const isFormConnected = (nodes: NodeTypeAndVersion[]) => {\n\treturn nodes.some(\n\t\t(n) =>\n\t\t\tn.type === FORM_NODE_TYPE || (n.type === WAIT_NODE_TYPE && n.parameters?.resume === 'form'),\n\t);\n};\n\nexport async function formWebhook(\n\tcontext: IWebhookFunctions,\n\tauthProperty = FORM_TRIGGER_AUTHENTICATION_PROPERTY,\n) {\n\tconst node = context.getNode();\n\tconst options = context.getNodeParameter('options', {}) as {\n\t\tignoreBots?: boolean;\n\t\trespondWithOptions?: {\n\t\t\tvalues: {\n\t\t\t\trespondWith: 'text' | 'redirect';\n\t\t\t\tformSubmittedText: string;\n\t\t\t\tredirectUrl: string;\n\t\t\t};\n\t\t};\n\t\tformSubmittedText?: string;\n\t\tuseWorkflowTimezone?: boolean;\n\t\tappendAttribution?: boolean;\n\t\tbuttonLabel?: string;\n\t\tcustomCss?: string;\n\t};\n\tconst res = context.getResponseObject();\n\tconst req = context.getRequestObject();\n\n\ttry {\n\t\tif (options.ignoreBots && isbot(req.headers['user-agent'])) {\n\t\t\tthrow new WebhookAuthorizationError(403);\n\t\t}\n\t\tif (node.typeVersion > 1) {\n\t\t\tawait validateWebhookAuthentication(context, authProperty);\n\t\t}\n\t} catch (error) {\n\t\tif (error instanceof WebhookAuthorizationError) {\n\t\t\tres.setHeader('WWW-Authenticate', 'Basic realm=\"Enter credentials\"');\n\t\t\tres.status(401).send();\n\t\t\treturn { noWebhookResponse: true };\n\t\t}\n\t\tthrow error;\n\t}\n\n\tconst mode = context.getMode() === 'manual' ? 'test' : 'production';\n\tconst formFields = context.getNodeParameter('formFields.values', []) as FormFieldsParameter;\n\n\tconst method = context.getRequestObject().method;\n\n\tvalidateResponseModeConfiguration(context);\n\n\t//Show the form on GET request\n\tif (method === 'GET') {\n\t\tconst formTitle = context.getNodeParameter('formTitle', '') as string;\n\t\tconst formDescription = sanitizeHtml(context.getNodeParameter('formDescription', '') as string);\n\t\tlet responseMode = context.getNodeParameter('responseMode', '') as string;\n\n\t\tlet formSubmittedText;\n\t\tlet redirectUrl;\n\t\tlet appendAttribution = true;\n\n\t\tif (options.respondWithOptions) {\n\t\t\tconst values = (options.respondWithOptions as IDataObject).values as IDataObject;\n\t\t\tif (values.respondWith === 'text') {\n\t\t\t\tformSubmittedText = values.formSubmittedText as string;\n\t\t\t}\n\t\t\tif (values.respondWith === 'redirect') {\n\t\t\t\tredirectUrl = values.redirectUrl as string;\n\t\t\t}\n\t\t} else {\n\t\t\tformSubmittedText = options.formSubmittedText as string;\n\t\t}\n\n\t\tif (options.appendAttribution === false) {\n\t\t\tappendAttribution = false;\n\t\t}\n\n\t\tlet buttonLabel = 'Submit';\n\n\t\tif (options.buttonLabel) {\n\t\t\tbuttonLabel = options.buttonLabel;\n\t\t}\n\n\t\tconst connectedNodes = context.getChildNodes(context.getNode().name, {\n\t\t\tincludeNodeParameters: true,\n\t\t});\n\t\tconst hasNextPage = isFormConnected(connectedNodes);\n\n\t\tif (hasNextPage) {\n\t\t\tredirectUrl = undefined;\n\t\t\tresponseMode = 'responseNode';\n\t\t}\n\n\t\trenderForm({\n\t\t\tcontext,\n\t\t\tres,\n\t\t\tformTitle,\n\t\t\tformDescription,\n\t\t\tformFields,\n\t\t\tresponseMode,\n\t\t\tmode,\n\t\t\tformSubmittedText,\n\t\t\tredirectUrl,\n\t\t\tappendAttribution,\n\t\t\tbuttonLabel,\n\t\t\tcustomCss: options.customCss,\n\t\t});\n\n\t\treturn {\n\t\t\tnoWebhookResponse: true,\n\t\t};\n\t}\n\n\tlet { useWorkflowTimezone } = options;\n\n\tif (useWorkflowTimezone === undefined && node.typeVersion > 2) {\n\t\tuseWorkflowTimezone = true;\n\t}\n\n\tconst returnItem = await prepareFormReturnItem(context, formFields, mode, useWorkflowTimezone);\n\n\treturn {\n\t\twebhookResponse: { status: 200 },\n\t\tworkflowData: [[returnItem]],\n\t};\n}\n\nexport function resolveRawData(context: IWebhookFunctions, rawData: string) {\n\tconst resolvables = getResolvables(rawData);\n\tlet returnData: string = rawData;\n\n\tif (returnData.startsWith('=')) {\n\t\treturnData = returnData.replace(/^=+/, '');\n\t} else {\n\t\treturn returnData;\n\t}\n\n\tif (resolvables.length) {\n\t\tfor (const resolvable of resolvables) {\n\t\t\tconst resolvedValue = context.evaluateExpression(`${resolvable}`);\n\n\t\t\tif (typeof resolvedValue === 'object' && resolvedValue !== null) {\n\t\t\t\treturnData = returnData.replace(resolvable, JSON.stringify(resolvedValue));\n\t\t\t} else {\n\t\t\t\treturnData = returnData.replace(resolvable, resolvedValue as string);\n\t\t\t}\n\t\t}\n\t}\n\treturn returnData;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,mBAAkB;AAClB,mBAAyB;AASzB,0BAMO;AACP,2BAAqB;AAGrB,wBAAqD;AACrD,uBAA+B;AAC/B,mBAA0C;AAC1C,mBAA8C;AAEvC,SAAS,aAAa,MAAc;AAC1C,aAAO,qBAAAA,SAAS,MAAM;AAAA,IACrB,aAAa;AAAA,MACZ;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA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,WAAW,QAAQ,OAAO,EAAE;AAAA,EAC1C,OAAO;AACN,WAAO;AAAA,EACR;AAEA,MAAI,YAAY,QAAQ;AACvB,eAAW,cAAc,aAAa;AACrC,YAAM,gBAAgB,QAAQ,mBAAmB,GAAG,UAAU,EAAE;AAEhE,UAAI,OAAO,kBAAkB,YAAY,kBAAkB,MAAM;AAChE,qBAAa,WAAW,QAAQ,YAAY,KAAK,UAAU,aAAa,CAAC;AAAA,MAC1E,OAAO;AACN,qBAAa,WAAW,QAAQ,YAAY,aAAuB;AAAA,MACpE;AAAA,IACD;AAAA,EACD;AACA,SAAO;AACR;","names":["sanitize","isbot"]}
@@ -23,7 +23,7 @@ __export(FormTriggerV1_node_exports, {
23
23
  module.exports = __toCommonJS(FormTriggerV1_node_exports);
24
24
  var import_n8n_workflow = require("n8n-workflow");
25
25
  var import_common = require("../common.descriptions");
26
- var import_utils = require("../utils/utils");
26
+ var import_utils = require("../utils");
27
27
  const descriptionV1 = {
28
28
  displayName: "n8n Form Trigger",
29
29
  name: "formTrigger",
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../nodes/Form/v1/FormTriggerV1.node.ts"],"sourcesContent":["import {\n\tFORM_TRIGGER_PATH_IDENTIFIER,\n\tNodeConnectionTypes,\n\ttype INodeType,\n\ttype INodeTypeBaseDescription,\n\ttype INodeTypeDescription,\n\ttype IWebhookFunctions,\n} from 'n8n-workflow';\n\nimport {\n\tformDescription,\n\tformFields,\n\tformRespondMode,\n\tformTitle,\n\tformTriggerPanel,\n\twebhookPath,\n} from '../common.descriptions';\nimport { formWebhook } from '../utils/utils';\n\nconst descriptionV1: INodeTypeDescription = {\n\tdisplayName: 'n8n Form Trigger',\n\tname: 'formTrigger',\n\ticon: 'file:form.svg',\n\tgroup: ['trigger'],\n\tversion: 1,\n\tdescription: 'Generate webforms in n8n and pass their responses to the workflow',\n\tdefaults: {\n\t\tname: 'n8n Form Trigger',\n\t},\n\n\tinputs: [],\n\toutputs: [NodeConnectionTypes.Main],\n\twebhooks: [\n\t\t{\n\t\t\tname: 'setup',\n\t\t\thttpMethod: 'GET',\n\t\t\tresponseMode: 'onReceived',\n\t\t\tisFullPath: true,\n\t\t\tpath: `={{$parameter[\"path\"]}}/${FORM_TRIGGER_PATH_IDENTIFIER}`,\n\t\t\tndvHideUrl: true,\n\t\t},\n\t\t{\n\t\t\tname: 'default',\n\t\t\thttpMethod: 'POST',\n\t\t\tresponseMode: '={{$parameter[\"responseMode\"]}}',\n\t\t\tresponseData: '={{$parameter[\"responseMode\"] === \"lastNode\" ? \"noData\" : undefined}}',\n\t\t\tisFullPath: true,\n\t\t\tpath: `={{$parameter[\"path\"]}}/${FORM_TRIGGER_PATH_IDENTIFIER}`,\n\t\t\tndvHideMethod: true,\n\t\t},\n\t],\n\teventTriggerDescription: 'Waiting for you to submit the form',\n\tactivationMessage: 'You can now make calls to your production Form URL.',\n\ttriggerPanel: formTriggerPanel,\n\tproperties: [\n\t\twebhookPath,\n\t\tformTitle,\n\t\tformDescription,\n\t\tformFields,\n\t\tformRespondMode,\n\t\t{\n\t\t\tdisplayName: 'Options',\n\t\t\tname: 'options',\n\t\t\ttype: 'collection',\n\t\t\tplaceholder: 'Add option',\n\t\t\tdefault: {},\n\t\t\tdisplayOptions: {\n\t\t\t\thide: {\n\t\t\t\t\tresponseMode: ['responseNode'],\n\t\t\t\t},\n\t\t\t},\n\t\t\toptions: [\n\t\t\t\t{\n\t\t\t\t\tdisplayName: 'Form Submitted Text',\n\t\t\t\t\tname: 'formSubmittedText',\n\t\t\t\t\tdescription: 'The text displayed to users after they filled the form',\n\t\t\t\t\ttype: 'string',\n\t\t\t\t\tdefault: 'Your response has been recorded',\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t],\n};\n\nexport class FormTriggerV1 implements INodeType {\n\tdescription: INodeTypeDescription;\n\n\tconstructor(baseDescription: INodeTypeBaseDescription) {\n\t\tthis.description = {\n\t\t\t...baseDescription,\n\t\t\t...descriptionV1,\n\t\t};\n\t}\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,cAAmC;AAAA,EAG/C,YAAY,iBAA2C;AACtD,SAAK,cAAc;AAAA,MAClB,GAAG;AAAA,MACH,GAAG;AAAA,IACJ;AAAA,EACD;AAAA,EAEA,MAAM,UAAiC;AACtC,WAAO,UAAM,0BAAY,IAAI;AAAA,EAC9B;AACD;","names":[]}
1
+ {"version":3,"sources":["../../../../nodes/Form/v1/FormTriggerV1.node.ts"],"sourcesContent":["import {\n\tFORM_TRIGGER_PATH_IDENTIFIER,\n\tNodeConnectionTypes,\n\ttype INodeType,\n\ttype INodeTypeBaseDescription,\n\ttype INodeTypeDescription,\n\ttype IWebhookFunctions,\n} from 'n8n-workflow';\n\nimport {\n\tformDescription,\n\tformFields,\n\tformRespondMode,\n\tformTitle,\n\tformTriggerPanel,\n\twebhookPath,\n} from '../common.descriptions';\nimport { formWebhook } from '../utils';\n\nconst descriptionV1: INodeTypeDescription = {\n\tdisplayName: 'n8n Form Trigger',\n\tname: 'formTrigger',\n\ticon: 'file:form.svg',\n\tgroup: ['trigger'],\n\tversion: 1,\n\tdescription: 'Generate webforms in n8n and pass their responses to the workflow',\n\tdefaults: {\n\t\tname: 'n8n Form Trigger',\n\t},\n\n\tinputs: [],\n\toutputs: [NodeConnectionTypes.Main],\n\twebhooks: [\n\t\t{\n\t\t\tname: 'setup',\n\t\t\thttpMethod: 'GET',\n\t\t\tresponseMode: 'onReceived',\n\t\t\tisFullPath: true,\n\t\t\tpath: `={{$parameter[\"path\"]}}/${FORM_TRIGGER_PATH_IDENTIFIER}`,\n\t\t\tndvHideUrl: true,\n\t\t},\n\t\t{\n\t\t\tname: 'default',\n\t\t\thttpMethod: 'POST',\n\t\t\tresponseMode: '={{$parameter[\"responseMode\"]}}',\n\t\t\tresponseData: '={{$parameter[\"responseMode\"] === \"lastNode\" ? \"noData\" : undefined}}',\n\t\t\tisFullPath: true,\n\t\t\tpath: `={{$parameter[\"path\"]}}/${FORM_TRIGGER_PATH_IDENTIFIER}`,\n\t\t\tndvHideMethod: true,\n\t\t},\n\t],\n\teventTriggerDescription: 'Waiting for you to submit the form',\n\tactivationMessage: 'You can now make calls to your production Form URL.',\n\ttriggerPanel: formTriggerPanel,\n\tproperties: [\n\t\twebhookPath,\n\t\tformTitle,\n\t\tformDescription,\n\t\tformFields,\n\t\tformRespondMode,\n\t\t{\n\t\t\tdisplayName: 'Options',\n\t\t\tname: 'options',\n\t\t\ttype: 'collection',\n\t\t\tplaceholder: 'Add option',\n\t\t\tdefault: {},\n\t\t\tdisplayOptions: {\n\t\t\t\thide: {\n\t\t\t\t\tresponseMode: ['responseNode'],\n\t\t\t\t},\n\t\t\t},\n\t\t\toptions: [\n\t\t\t\t{\n\t\t\t\t\tdisplayName: 'Form Submitted Text',\n\t\t\t\t\tname: 'formSubmittedText',\n\t\t\t\t\tdescription: 'The text displayed to users after they filled the form',\n\t\t\t\t\ttype: 'string',\n\t\t\t\t\tdefault: 'Your response has been recorded',\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t],\n};\n\nexport class FormTriggerV1 implements INodeType {\n\tdescription: INodeTypeDescription;\n\n\tconstructor(baseDescription: INodeTypeBaseDescription) {\n\t\tthis.description = {\n\t\t\t...baseDescription,\n\t\t\t...descriptionV1,\n\t\t};\n\t}\n\n\tasync webhook(this: IWebhookFunctions) {\n\t\treturn await formWebhook(this);\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAOO;AAEP,oBAOO;AACP,mBAA4B;AAE5B,MAAM,gBAAsC;AAAA,EAC3C,aAAa;AAAA,EACb,MAAM;AAAA,EACN,MAAM;AAAA,EACN,OAAO,CAAC,SAAS;AAAA,EACjB,SAAS;AAAA,EACT,aAAa;AAAA,EACb,UAAU;AAAA,IACT,MAAM;AAAA,EACP;AAAA,EAEA,QAAQ,CAAC;AAAA,EACT,SAAS,CAAC,wCAAoB,IAAI;AAAA,EAClC,UAAU;AAAA,IACT;AAAA,MACC,MAAM;AAAA,MACN,YAAY;AAAA,MACZ,cAAc;AAAA,MACd,YAAY;AAAA,MACZ,MAAM,2BAA2B,gDAA4B;AAAA,MAC7D,YAAY;AAAA,IACb;AAAA,IACA;AAAA,MACC,MAAM;AAAA,MACN,YAAY;AAAA,MACZ,cAAc;AAAA,MACd,cAAc;AAAA,MACd,YAAY;AAAA,MACZ,MAAM,2BAA2B,gDAA4B;AAAA,MAC7D,eAAe;AAAA,IAChB;AAAA,EACD;AAAA,EACA,yBAAyB;AAAA,EACzB,mBAAmB;AAAA,EACnB,cAAc;AAAA,EACd,YAAY;AAAA,IACX;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,MACC,aAAa;AAAA,MACb,MAAM;AAAA,MACN,MAAM;AAAA,MACN,aAAa;AAAA,MACb,SAAS,CAAC;AAAA,MACV,gBAAgB;AAAA,QACf,MAAM;AAAA,UACL,cAAc,CAAC,cAAc;AAAA,QAC9B;AAAA,MACD;AAAA,MACA,SAAS;AAAA,QACR;AAAA,UACC,aAAa;AAAA,UACb,MAAM;AAAA,UACN,aAAa;AAAA,UACb,MAAM;AAAA,UACN,SAAS;AAAA,QACV;AAAA,MACD;AAAA,IACD;AAAA,EACD;AACD;AAEO,MAAM,cAAmC;AAAA,EAG/C,YAAY,iBAA2C;AACtD,SAAK,cAAc;AAAA,MAClB,GAAG;AAAA,MACH,GAAG;AAAA,IACJ;AAAA,EACD;AAAA,EAEA,MAAM,UAAiC;AACtC,WAAO,UAAM,0BAAY,IAAI;AAAA,EAC9B;AACD;","names":[]}
@@ -25,7 +25,7 @@ var import_n8n_workflow = require("n8n-workflow");
25
25
  var import_common = require("../common.descriptions");
26
26
  var import_cssVariables = require("../cssVariables");
27
27
  var import_interfaces = require("../interfaces");
28
- var import_utils = require("../utils/utils");
28
+ var import_utils = require("../utils");
29
29
  const useWorkflowTimezone = {
30
30
  displayName: "Use Workflow Timezone",
31
31
  name: "useWorkflowTimezone",
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../nodes/Form/v2/FormTriggerV2.node.ts"],"sourcesContent":["import {\n\tADD_FORM_NOTICE,\n\ttype INodePropertyOptions,\n\tNodeConnectionTypes,\n\ttype INodeProperties,\n\ttype INodeType,\n\ttype INodeTypeBaseDescription,\n\ttype INodeTypeDescription,\n\ttype IWebhookFunctions,\n} from 'n8n-workflow';\n\nimport {\n\tappendAttributionToForm,\n\tformDescription,\n\tformFields,\n\tformRespondMode,\n\tformTitle,\n\tformTriggerPanel,\n\trespondWithOptions,\n\twebhookPath,\n} from '../common.descriptions';\nimport { cssVariables } from '../cssVariables';\nimport { FORM_TRIGGER_AUTHENTICATION_PROPERTY } from '../interfaces';\nimport { formWebhook } from '../utils/utils';\n\nconst useWorkflowTimezone: INodeProperties = {\n\tdisplayName: 'Use Workflow Timezone',\n\tname: 'useWorkflowTimezone',\n\ttype: 'boolean',\n\tdefault: false,\n\tdescription: \"Whether to use the workflow timezone set in node's settings rather than UTC\",\n};\n\nconst descriptionV2: INodeTypeDescription = {\n\tdisplayName: 'n8n Form Trigger',\n\tname: 'formTrigger',\n\ticon: 'file:form.svg',\n\tgroup: ['trigger'],\n\tversion: [2, 2.1, 2.2],\n\tdescription: 'Generate webforms in n8n and pass their responses to the workflow',\n\tdefaults: {\n\t\tname: 'On form submission',\n\t},\n\n\tinputs: [],\n\toutputs: [NodeConnectionTypes.Main],\n\twebhooks: [\n\t\t{\n\t\t\tname: 'setup',\n\t\t\thttpMethod: 'GET',\n\t\t\tresponseMode: 'onReceived',\n\t\t\tisFullPath: true,\n\t\t\tpath: '={{ $parameter[\"path\"] || $parameter[\"options\"]?.path || $webhookId }}',\n\t\t\tndvHideUrl: true,\n\t\t\tnodeType: 'form',\n\t\t},\n\t\t{\n\t\t\tname: 'default',\n\t\t\thttpMethod: 'POST',\n\t\t\tresponseMode: '={{$parameter[\"responseMode\"]}}',\n\t\t\tresponseData: '={{$parameter[\"responseMode\"] === \"lastNode\" ? \"noData\" : undefined}}',\n\t\t\tisFullPath: true,\n\t\t\tpath: '={{ $parameter[\"path\"] || $parameter[\"options\"]?.path || $webhookId }}',\n\t\t\tndvHideMethod: true,\n\t\t\tnodeType: 'form',\n\t\t},\n\t],\n\teventTriggerDescription: 'Waiting for you to submit the form',\n\tactivationMessage: 'You can now make calls to your production Form URL.',\n\ttriggerPanel: formTriggerPanel,\n\tcredentials: [\n\t\t{\n\t\t\t// eslint-disable-next-line n8n-nodes-base/node-class-description-credentials-name-unsuffixed\n\t\t\tname: 'httpBasicAuth',\n\t\t\trequired: true,\n\t\t\tdisplayOptions: {\n\t\t\t\tshow: {\n\t\t\t\t\t[FORM_TRIGGER_AUTHENTICATION_PROPERTY]: ['basicAuth'],\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t],\n\tproperties: [\n\t\t{\n\t\t\tdisplayName: 'Authentication',\n\t\t\tname: FORM_TRIGGER_AUTHENTICATION_PROPERTY,\n\t\t\ttype: 'options',\n\t\t\toptions: [\n\t\t\t\t{\n\t\t\t\t\tname: 'Basic Auth',\n\t\t\t\t\tvalue: 'basicAuth',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'None',\n\t\t\t\t\tvalue: 'none',\n\t\t\t\t},\n\t\t\t],\n\t\t\tdefault: 'none',\n\t\t},\n\t\t{ ...webhookPath, displayOptions: { show: { '@version': [{ _cnd: { lte: 2.1 } }] } } },\n\t\tformTitle,\n\t\tformDescription,\n\t\tformFields,\n\t\t{ ...formRespondMode, displayOptions: { show: { '@version': [{ _cnd: { lte: 2.1 } }] } } },\n\t\t{\n\t\t\t...formRespondMode,\n\t\t\toptions: (formRespondMode.options as INodePropertyOptions[])?.filter(\n\t\t\t\t(option) => option.value !== 'responseNode',\n\t\t\t),\n\t\t\tdisplayOptions: { show: { '@version': [{ _cnd: { gte: 2.2 } }] } },\n\t\t},\n\t\t{\n\t\t\tdisplayName:\n\t\t\t\t\"In the 'Respond to Webhook' node, select 'Respond With JSON' and set the <strong>formSubmittedText</strong> key to display a custom response in the form, or the <strong>redirectURL</strong> key to redirect users to a URL\",\n\t\t\tname: 'formNotice',\n\t\t\ttype: 'notice',\n\t\t\tdisplayOptions: {\n\t\t\t\tshow: { responseMode: ['responseNode'] },\n\t\t\t},\n\t\t\tdefault: '',\n\t\t},\n\t\t// notice would be shown if no Form node was connected to trigger\n\t\t{\n\t\t\tdisplayName: 'Build multi-step forms by adding a form page later in your workflow',\n\t\t\tname: ADD_FORM_NOTICE,\n\t\t\ttype: 'notice',\n\t\t\tdefault: '',\n\t\t},\n\t\t{\n\t\t\tdisplayName: 'Options',\n\t\t\tname: 'options',\n\t\t\ttype: 'collection',\n\t\t\tplaceholder: 'Add option',\n\t\t\tdefault: {},\n\t\t\toptions: [\n\t\t\t\tappendAttributionToForm,\n\t\t\t\t{\n\t\t\t\t\tdisplayName: 'Button Label',\n\t\t\t\t\tdescription: 'The label of the submit button in the form',\n\t\t\t\t\tname: 'buttonLabel',\n\t\t\t\t\ttype: 'string',\n\t\t\t\t\tdefault: 'Submit',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t...webhookPath,\n\t\t\t\t\trequired: false,\n\t\t\t\t\tdisplayOptions: { show: { '@version': [{ _cnd: { gte: 2.2 } }] } },\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t...respondWithOptions,\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\thide: {\n\t\t\t\t\t\t\t'/responseMode': ['responseNode'],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tdisplayName: 'Ignore Bots',\n\t\t\t\t\tname: 'ignoreBots',\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: false,\n\t\t\t\t\tdescription: 'Whether to ignore requests from bots like link previewers and web crawlers',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t...useWorkflowTimezone,\n\t\t\t\t\tdefault: false,\n\t\t\t\t\tdescription: \"Whether to use the workflow timezone in 'submittedAt' field or UTC\",\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\t'@version': [2],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t...useWorkflowTimezone,\n\t\t\t\t\tdefault: true,\n\t\t\t\t\tdescription: \"Whether to use the workflow timezone in 'submittedAt' field or UTC\",\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\t'@version': [{ _cnd: { gt: 2 } }],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tdisplayName: 'Custom Form Styling',\n\t\t\t\t\tname: 'customCss',\n\t\t\t\t\ttype: 'string',\n\t\t\t\t\ttypeOptions: {\n\t\t\t\t\t\trows: 10,\n\t\t\t\t\t\teditor: 'cssEditor',\n\t\t\t\t\t},\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\t'@version': [{ _cnd: { gt: 2 } }],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\tdefault: cssVariables.trim(),\n\t\t\t\t\tdescription: 'Override default styling of the public form interface with CSS',\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t],\n};\n\nexport class FormTriggerV2 implements INodeType {\n\tdescription: INodeTypeDescription;\n\n\tconstructor(baseDescription: INodeTypeBaseDescription) {\n\t\tthis.description = {\n\t\t\t...baseDescription,\n\t\t\t...descriptionV2,\n\t\t};\n\t}\n\n\tasync webhook(this: IWebhookFunctions) {\n\t\treturn await formWebhook(this);\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BASO;AAEP,oBASO;AACP,0BAA6B;AAC7B,wBAAqD;AACrD,mBAA4B;AAE5B,MAAM,sBAAuC;AAAA,EAC5C,aAAa;AAAA,EACb,MAAM;AAAA,EACN,MAAM;A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a;AAAA,UACb,MAAM;AAAA,UACN,MAAM;AAAA,UACN,SAAS;AAAA,UACT,aAAa;AAAA,QACd;AAAA,QACA;AAAA,UACC,GAAG;AAAA,UACH,SAAS;AAAA,UACT,aAAa;AAAA,UACb,gBAAgB;AAAA,YACf,MAAM;AAAA,cACL,YAAY,CAAC,CAAC;AAAA,YACf;AAAA,UACD;AAAA,QACD;AAAA,QACA;AAAA,UACC,GAAG;AAAA,UACH,SAAS;AAAA,UACT,aAAa;AAAA,UACb,gBAAgB;AAAA,YACf,MAAM;AAAA,cACL,YAAY,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,CAAC;AAAA,YACjC;AAAA,UACD;AAAA,QACD;AAAA,QACA;AAAA,UACC,aAAa;AAAA,UACb,MAAM;AAAA,UACN,MAAM;AAAA,UACN,aAAa;AAAA,YACZ,MAAM;AAAA,YACN,QAAQ;AAAA,UACT;AAAA,UACA,gBAAgB;AAAA,YACf,MAAM;AAAA,cACL,YAAY,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,CAAC;AAAA,YACjC;AAAA,UACD;AAAA,UACA,SAAS,iCAAa,KAAK;AAAA,UAC3B,aAAa;AAAA,QACd;AAAA,MACD;AAAA,IACD;AAAA,EACD;AACD;AAEO,MAAM,cAAmC;AAAA,EAG/C,YAAY,iBAA2C;AACtD,SAAK,cAAc;AAAA,MAClB,GAAG;AAAA,MACH,GAAG;AAAA,IACJ;AAAA,EACD;AAAA,EAEA,MAAM,UAAiC;AACtC,WAAO,UAAM,0BAAY,IAAI;AAAA,EAC9B;AACD;","names":[]}
1
+ {"version":3,"sources":["../../../../nodes/Form/v2/FormTriggerV2.node.ts"],"sourcesContent":["import {\n\tADD_FORM_NOTICE,\n\ttype INodePropertyOptions,\n\tNodeConnectionTypes,\n\ttype INodeProperties,\n\ttype INodeType,\n\ttype INodeTypeBaseDescription,\n\ttype INodeTypeDescription,\n\ttype IWebhookFunctions,\n} from 'n8n-workflow';\n\nimport {\n\tappendAttributionToForm,\n\tformDescription,\n\tformFields,\n\tformRespondMode,\n\tformTitle,\n\tformTriggerPanel,\n\trespondWithOptions,\n\twebhookPath,\n} from '../common.descriptions';\nimport { cssVariables } from '../cssVariables';\nimport { FORM_TRIGGER_AUTHENTICATION_PROPERTY } from '../interfaces';\nimport { formWebhook } from '../utils';\n\nconst useWorkflowTimezone: INodeProperties = {\n\tdisplayName: 'Use Workflow Timezone',\n\tname: 'useWorkflowTimezone',\n\ttype: 'boolean',\n\tdefault: false,\n\tdescription: \"Whether to use the workflow timezone set in node's settings rather than UTC\",\n};\n\nconst descriptionV2: INodeTypeDescription = {\n\tdisplayName: 'n8n Form Trigger',\n\tname: 'formTrigger',\n\ticon: 'file:form.svg',\n\tgroup: ['trigger'],\n\tversion: [2, 2.1, 2.2],\n\tdescription: 'Generate webforms in n8n and pass their responses to the workflow',\n\tdefaults: {\n\t\tname: 'On form submission',\n\t},\n\n\tinputs: [],\n\toutputs: [NodeConnectionTypes.Main],\n\twebhooks: [\n\t\t{\n\t\t\tname: 'setup',\n\t\t\thttpMethod: 'GET',\n\t\t\tresponseMode: 'onReceived',\n\t\t\tisFullPath: true,\n\t\t\tpath: '={{ $parameter[\"path\"] || $parameter[\"options\"]?.path || $webhookId }}',\n\t\t\tndvHideUrl: true,\n\t\t\tnodeType: 'form',\n\t\t},\n\t\t{\n\t\t\tname: 'default',\n\t\t\thttpMethod: 'POST',\n\t\t\tresponseMode: '={{$parameter[\"responseMode\"]}}',\n\t\t\tresponseData: '={{$parameter[\"responseMode\"] === \"lastNode\" ? \"noData\" : undefined}}',\n\t\t\tisFullPath: true,\n\t\t\tpath: '={{ $parameter[\"path\"] || $parameter[\"options\"]?.path || $webhookId }}',\n\t\t\tndvHideMethod: true,\n\t\t\tnodeType: 'form',\n\t\t},\n\t],\n\teventTriggerDescription: 'Waiting for you to submit the form',\n\tactivationMessage: 'You can now make calls to your production Form URL.',\n\ttriggerPanel: formTriggerPanel,\n\tcredentials: [\n\t\t{\n\t\t\t// eslint-disable-next-line n8n-nodes-base/node-class-description-credentials-name-unsuffixed\n\t\t\tname: 'httpBasicAuth',\n\t\t\trequired: true,\n\t\t\tdisplayOptions: {\n\t\t\t\tshow: {\n\t\t\t\t\t[FORM_TRIGGER_AUTHENTICATION_PROPERTY]: ['basicAuth'],\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t],\n\tproperties: [\n\t\t{\n\t\t\tdisplayName: 'Authentication',\n\t\t\tname: FORM_TRIGGER_AUTHENTICATION_PROPERTY,\n\t\t\ttype: 'options',\n\t\t\toptions: [\n\t\t\t\t{\n\t\t\t\t\tname: 'Basic Auth',\n\t\t\t\t\tvalue: 'basicAuth',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'None',\n\t\t\t\t\tvalue: 'none',\n\t\t\t\t},\n\t\t\t],\n\t\t\tdefault: 'none',\n\t\t},\n\t\t{ ...webhookPath, displayOptions: { show: { '@version': [{ _cnd: { lte: 2.1 } }] } } },\n\t\tformTitle,\n\t\tformDescription,\n\t\tformFields,\n\t\t{ ...formRespondMode, displayOptions: { show: { '@version': [{ _cnd: { lte: 2.1 } }] } } },\n\t\t{\n\t\t\t...formRespondMode,\n\t\t\toptions: (formRespondMode.options as INodePropertyOptions[])?.filter(\n\t\t\t\t(option) => option.value !== 'responseNode',\n\t\t\t),\n\t\t\tdisplayOptions: { show: { '@version': [{ _cnd: { gte: 2.2 } }] } },\n\t\t},\n\t\t{\n\t\t\tdisplayName:\n\t\t\t\t\"In the 'Respond to Webhook' node, select 'Respond With JSON' and set the <strong>formSubmittedText</strong> key to display a custom response in the form, or the <strong>redirectURL</strong> key to redirect users to a URL\",\n\t\t\tname: 'formNotice',\n\t\t\ttype: 'notice',\n\t\t\tdisplayOptions: {\n\t\t\t\tshow: { responseMode: ['responseNode'] },\n\t\t\t},\n\t\t\tdefault: '',\n\t\t},\n\t\t// notice would be shown if no Form node was connected to trigger\n\t\t{\n\t\t\tdisplayName: 'Build multi-step forms by adding a form page later in your workflow',\n\t\t\tname: ADD_FORM_NOTICE,\n\t\t\ttype: 'notice',\n\t\t\tdefault: '',\n\t\t},\n\t\t{\n\t\t\tdisplayName: 'Options',\n\t\t\tname: 'options',\n\t\t\ttype: 'collection',\n\t\t\tplaceholder: 'Add option',\n\t\t\tdefault: {},\n\t\t\toptions: [\n\t\t\t\tappendAttributionToForm,\n\t\t\t\t{\n\t\t\t\t\tdisplayName: 'Button Label',\n\t\t\t\t\tdescription: 'The label of the submit button in the form',\n\t\t\t\t\tname: 'buttonLabel',\n\t\t\t\t\ttype: 'string',\n\t\t\t\t\tdefault: 'Submit',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t...webhookPath,\n\t\t\t\t\trequired: false,\n\t\t\t\t\tdisplayOptions: { show: { '@version': [{ _cnd: { gte: 2.2 } }] } },\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t...respondWithOptions,\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\thide: {\n\t\t\t\t\t\t\t'/responseMode': ['responseNode'],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tdisplayName: 'Ignore Bots',\n\t\t\t\t\tname: 'ignoreBots',\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: false,\n\t\t\t\t\tdescription: 'Whether to ignore requests from bots like link previewers and web crawlers',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t...useWorkflowTimezone,\n\t\t\t\t\tdefault: false,\n\t\t\t\t\tdescription: \"Whether to use the workflow timezone in 'submittedAt' field or UTC\",\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\t'@version': [2],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t...useWorkflowTimezone,\n\t\t\t\t\tdefault: true,\n\t\t\t\t\tdescription: \"Whether to use the workflow timezone in 'submittedAt' field or UTC\",\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\t'@version': [{ _cnd: { gt: 2 } }],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tdisplayName: 'Custom Form Styling',\n\t\t\t\t\tname: 'customCss',\n\t\t\t\t\ttype: 'string',\n\t\t\t\t\ttypeOptions: {\n\t\t\t\t\t\trows: 10,\n\t\t\t\t\t\teditor: 'cssEditor',\n\t\t\t\t\t},\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\t'@version': [{ _cnd: { gt: 2 } }],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\tdefault: cssVariables.trim(),\n\t\t\t\t\tdescription: 'Override default styling of the public form interface with CSS',\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t],\n};\n\nexport class FormTriggerV2 implements INodeType {\n\tdescription: INodeTypeDescription;\n\n\tconstructor(baseDescription: INodeTypeBaseDescription) {\n\t\tthis.description = {\n\t\t\t...baseDescription,\n\t\t\t...descriptionV2,\n\t\t};\n\t}\n\n\tasync webhook(this: IWebhookFunctions) {\n\t\treturn await formWebhook(this);\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BASO;AAEP,oBASO;AACP,0BAA6B;AAC7B,wBAAqD;AACrD,mBAA4B;AAE5B,MAAM,sBAAuC;AAAA,EAC5C,aAAa;AAAA,EACb,MAAM;AAAA,EACN,MAAM;AAAA,EACN,SAAS;AAAA,EACT,aAAa;AACd;AAEA,MAAM,gBAAsC;AAAA,EAC3C,aAAa;AAAA,EACb,MAAM;AAAA,EACN,MAAM;AAAA,EACN,OAAO,CAAC,SAAS;AAAA,EACjB,SAAS,CAAC,GAAG,KAAK,GAAG;AAAA,EACrB,aAAa;AAAA,EACb,UAAU;AAAA,IACT,MA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AAA,QACD;AAAA,QACA;AAAA,UACC,GAAG;AAAA,UACH,SAAS;AAAA,UACT,aAAa;AAAA,UACb,gBAAgB;AAAA,YACf,MAAM;AAAA,cACL,YAAY,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,CAAC;AAAA,YACjC;AAAA,UACD;AAAA,QACD;AAAA,QACA;AAAA,UACC,aAAa;AAAA,UACb,MAAM;AAAA,UACN,MAAM;AAAA,UACN,aAAa;AAAA,YACZ,MAAM;AAAA,YACN,QAAQ;AAAA,UACT;AAAA,UACA,gBAAgB;AAAA,YACf,MAAM;AAAA,cACL,YAAY,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,CAAC;AAAA,YACjC;AAAA,UACD;AAAA,UACA,SAAS,iCAAa,KAAK;AAAA,UAC3B,aAAa;AAAA,QACd;AAAA,MACD;AAAA,IACD;AAAA,EACD;AACD;AAEO,MAAM,cAAmC;AAAA,EAG/C,YAAY,iBAA2C;AACtD,SAAK,cAAc;AAAA,MAClB,GAAG;AAAA,MACH,GAAG;AAAA,IACJ;AAAA,EACD;AAAA,EAEA,MAAM,UAAiC;AACtC,WAAO,UAAM,0BAAY,IAAI;AAAA,EAC9B;AACD;","names":[]}
@@ -213,7 +213,7 @@ async function encodeEmail(email) {
213
213
  const mail = new import_mail_composer.default(mailOptions).compile();
214
214
  mail.keepBcc = true;
215
215
  const mailBody = await mail.build();
216
- return mailBody.toString("base64").replace(/\+/g, "-").replace(/\//g, "_");
216
+ return mailBody.toString("base64").replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
217
217
  }
218
218
  async function googleApiRequestAllItems(propertyName, method, endpoint, body = {}, query = {}) {
219
219
  const returnData = [];