n8n-nodes-base 1.87.0 → 1.88.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 (58) hide show
  1. package/dist/credentials/SalesforceJwtApi.credentials.js +60 -0
  2. package/dist/credentials/SalesforceJwtApi.credentials.js.map +1 -1
  3. package/dist/nodes/Brevo/__schema__/v1.0.0/contact/getAll.json +1 -9
  4. package/dist/nodes/Dropbox/__schema__/v1.0.0/file/download.json +2 -5
  5. package/dist/nodes/Google/Analytics/__schema__/v2.0.0/report/get.json +2 -2
  6. package/dist/nodes/Google/Calendar/__schema__/v1.3.0/event/getAll.json +7 -1
  7. package/dist/nodes/Google/Firebase/CloudFirestore/__schema__/v1.1.0/document/get.json +1 -13
  8. package/dist/nodes/Google/Gmail/__schema__/v2.1.0/message/get.json +1 -7
  9. package/dist/nodes/Google/Gmail/__schema__/v2.1.0/message/getAll.json +1 -7
  10. package/dist/nodes/Google/Gmail/__schema__/v2.1.0/thread/get.json +4 -4
  11. package/dist/nodes/Google/YouTube/__schema__/v1.0.0/video/get.json +1 -35
  12. package/dist/nodes/Google/YouTube/__schema__/v1.0.0/video/rate.json +9 -0
  13. package/dist/nodes/HaloPSA/__schema__/v1.0.0/client/getAll.json +147 -1
  14. package/dist/nodes/Hubspot/__schema__/v2.1.0/company/getAll.json +1 -4
  15. package/dist/nodes/Hubspot/__schema__/v2.1.0/contact/search.json +4 -1
  16. package/dist/nodes/Hubspot/__schema__/v2.1.0/deal/getAll.json +1 -52
  17. package/dist/nodes/Hubspot/__schema__/v2.1.0/deal/search.json +5 -2
  18. package/dist/nodes/Hubspot/__schema__/v2.1.0/ticket/get.json +1 -258
  19. package/dist/nodes/ItemLists/__schema__/v3.0.0/itemList/limit.json +9 -0
  20. package/dist/nodes/Jira/__schema__/v1.0.0/issue/get.json +84 -1
  21. package/dist/nodes/Jira/__schema__/v1.0.0/issue/getAll.json +4 -565
  22. package/dist/nodes/Lemlist/__schema__/v2.0.0/campaign/getAll.json +1 -10
  23. package/dist/nodes/Linear/__schema__/v1.0.0/issue/create.json +12 -1
  24. package/dist/nodes/Microsoft/OneDrive/__schema__/v1.0.0/file/download.json +92 -1
  25. package/dist/nodes/Microsoft/Outlook/__schema__/v2.0.0/folderMessage/getAll.json +3 -81
  26. package/dist/nodes/Microsoft/Outlook/__schema__/v2.0.0/message/get.json +28 -1
  27. package/dist/nodes/Microsoft/Outlook/__schema__/v2.0.0/message/getAll.json +82 -1
  28. package/dist/nodes/Nasa/__schema__/v1.0.0/donkiSolarFlare/get.json +4 -1
  29. package/dist/nodes/Notion/__schema__/v2.2.0/databasePage/create.json +1 -4
  30. package/dist/nodes/Notion/__schema__/v2.2.0/databasePage/getAll.json +1 -4
  31. package/dist/nodes/Odoo/__schema__/v1.0.0/custom/get.json +1 -4
  32. package/dist/nodes/Odoo/__schema__/v1.0.0/custom/getAll.json +4 -1
  33. package/dist/nodes/Odoo/__schema__/v1.0.0/opportunity/getAll.json +1 -4
  34. package/dist/nodes/Phantombuster/__schema__/v1.0.0/agent/getOutput.json +1 -10
  35. package/dist/nodes/Pipedrive/__schema__/v1.0.0/person/search.json +12 -1
  36. package/dist/nodes/Salesforce/__schema__/v1.0.0/customObject/getAll.json +2 -2
  37. package/dist/nodes/Salesforce/__schema__/v1.0.0/opportunity/getAll.json +4 -1
  38. package/dist/nodes/Salesforce/__schema__/v1.0.0/search/query.json +1 -4
  39. package/dist/nodes/ServiceNow/__schema__/v1.0.0/tableRecord/getAll.json +1 -4
  40. package/dist/nodes/Slack/__schema__/v2.3.0/channel/history.json +4 -44
  41. package/dist/nodes/Ssh/__schema__/v1.0.0/command/execute.json +1 -4
  42. package/dist/nodes/Supabase/__schema__/v1.0.0/row/delete.json +7 -1
  43. package/dist/nodes/Telegram/__schema__/v1.2.0/chat/get.json +1 -10
  44. package/dist/nodes/Telegram/__schema__/v1.2.0/chat/member.json +1 -4
  45. package/dist/nodes/Transform/Summarize/utils.js +1 -1
  46. package/dist/nodes/Transform/Summarize/utils.js.map +1 -1
  47. package/dist/nodes/Trello/__schema__/v1.0.0/list/getAll.json +1 -4
  48. package/dist/nodes/Trello/__schema__/v1.0.0/list/getCards.json +4 -7
  49. package/dist/nodes/Twitter/__schema__/v2.0.0/tweet/search.json +1 -4
  50. package/dist/nodes/Wordpress/__schema__/v1.0.0/post/getAll.json +9 -1
  51. package/dist/nodes/Zoho/__schema__/v1.0.0/contact/getAll.json +1 -15
  52. package/dist/test/nodes/FakeCredentialsMap.js +30 -0
  53. package/dist/test/nodes/FakeCredentialsMap.js.map +1 -1
  54. package/dist/test/nodes/Helpers.js +1 -1
  55. package/dist/test/nodes/Helpers.js.map +1 -1
  56. package/dist/types/credentials.json +1 -1
  57. package/dist/types/nodes.json +2 -2
  58. package/package.json +8 -8
@@ -1,6 +1,12 @@
1
1
  {
2
2
  "type": "object",
3
3
  "properties": {
4
+ "content": {
5
+ "type": "string"
6
+ },
7
+ "embedding": {
8
+ "type": "string"
9
+ },
4
10
  "metadata": {
5
11
  "type": "object",
6
12
  "properties": {
@@ -32,5 +38,5 @@
32
38
  }
33
39
  }
34
40
  },
35
- "version": 1
41
+ "version": 2
36
42
  }
@@ -10,12 +10,6 @@
10
10
  "accent_color_id": {
11
11
  "type": "integer"
12
12
  },
13
- "active_usernames": {
14
- "type": "array",
15
- "items": {
16
- "type": "string"
17
- }
18
- },
19
13
  "can_send_gift": {
20
14
  "type": "boolean"
21
15
  },
@@ -30,12 +24,9 @@
30
24
  },
31
25
  "type": {
32
26
  "type": "string"
33
- },
34
- "username": {
35
- "type": "string"
36
27
  }
37
28
  }
38
29
  }
39
30
  },
40
- "version": 1
31
+ "version": 2
41
32
  }
@@ -7,9 +7,6 @@
7
7
  "result": {
8
8
  "type": "object",
9
9
  "properties": {
10
- "is_anonymous": {
11
- "type": "boolean"
12
- },
13
10
  "status": {
14
11
  "type": "string"
15
12
  },
@@ -36,5 +33,5 @@
36
33
  }
37
34
  }
38
35
  },
39
- "version": 1
36
+ "version": 2
40
37
  }
@@ -53,7 +53,7 @@ function isEmpty(value) {
53
53
  return value === void 0 || value === null || value === "";
54
54
  }
55
55
  function normalizeFieldName(fieldName) {
56
- return fieldName.replace(/[\]\["]/g, "").replace(/[ .]/g, "");
56
+ return fieldName.replace(/[\]\["]/g, "").replace(/[ .]/g, "_");
57
57
  }
58
58
  const fieldValueGetter = (disableDotNotation) => {
59
59
  return (item, field) => disableDotNotation ? item[field] : (0, import_get.default)(item, field);
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../nodes/Transform/Summarize/utils.ts"],"sourcesContent":["import get from 'lodash/get';\nimport {\n\ttype GenericValue,\n\ttype IDataObject,\n\ttype IExecuteFunctions,\n\tNodeOperationError,\n} from 'n8n-workflow';\n\ntype AggregationType =\n\t| 'append'\n\t| 'average'\n\t| 'concatenate'\n\t| 'count'\n\t| 'countUnique'\n\t| 'max'\n\t| 'min'\n\t| 'sum';\n\nexport type Aggregation = {\n\taggregation: AggregationType;\n\tfield: string;\n\tincludeEmpty?: boolean;\n\tseparateBy?: string;\n\tcustomSeparator?: string;\n};\n\nexport type Aggregations = Aggregation[];\n\nconst AggregationDisplayNames = {\n\tappend: 'appended_',\n\taverage: 'average_',\n\tconcatenate: 'concatenated_',\n\tcount: 'count_',\n\tcountUnique: 'unique_count_',\n\tmax: 'max_',\n\tmin: 'min_',\n\tsum: 'sum_',\n};\n\nexport const NUMERICAL_AGGREGATIONS = ['average', 'sum'];\n\nexport type SummarizeOptions = {\n\tcontinueIfFieldNotFound: boolean;\n\tdisableDotNotation?: boolean;\n\toutputFormat?: 'separateItems' | 'singleItem';\n\tskipEmptySplitFields?: boolean;\n};\n\nexport type ValueGetterFn = (\n\titem: IDataObject,\n\tfield: string,\n) => IDataObject | IDataObject[] | GenericValue | GenericValue[];\n\nfunction isEmpty<T>(value: T) {\n\treturn value === undefined || value === null || value === '';\n}\n\nfunction normalizeFieldName(fieldName: string) {\n\treturn fieldName.replace(/[\\]\\[\"]/g, '').replace(/[ .]/g, '');\n}\n\nexport const fieldValueGetter = (disableDotNotation?: boolean) => {\n\treturn (item: IDataObject, field: string) =>\n\t\tdisableDotNotation ? item[field] : get(item, field);\n};\n\nexport function checkIfFieldExists(\n\tthis: IExecuteFunctions,\n\titems: IDataObject[],\n\taggregations: Aggregations,\n\tgetValue: ValueGetterFn,\n) {\n\tfor (const aggregation of aggregations) {\n\t\tif (aggregation.field === '') {\n\t\t\tcontinue;\n\t\t}\n\t\tconst exist = items.some((item) => getValue(item, aggregation.field) !== undefined);\n\t\tif (!exist) {\n\t\t\tthrow new NodeOperationError(\n\t\t\t\tthis.getNode(),\n\t\t\t\t`The field '${aggregation.field}' does not exist in any items`,\n\t\t\t);\n\t\t}\n\t}\n}\n\nfunction aggregate(items: IDataObject[], entry: Aggregation, getValue: ValueGetterFn) {\n\tconst { aggregation, field } = entry;\n\tlet data = [...items];\n\n\tif (NUMERICAL_AGGREGATIONS.includes(aggregation)) {\n\t\tdata = data.filter(\n\t\t\t(item) => typeof getValue(item, field) === 'number' && !isEmpty(getValue(item, field)),\n\t\t);\n\t}\n\n\tswitch (aggregation) {\n\t\t//combine operations\n\t\tcase 'append':\n\t\t\tif (!entry.includeEmpty) {\n\t\t\t\tdata = data.filter((item) => !isEmpty(getValue(item, field)));\n\t\t\t}\n\t\t\treturn data.map((item) => getValue(item, field));\n\t\tcase 'concatenate':\n\t\t\tconst separateBy = entry.separateBy === 'other' ? entry.customSeparator : entry.separateBy;\n\t\t\tif (!entry.includeEmpty) {\n\t\t\t\tdata = data.filter((item) => !isEmpty(getValue(item, field)));\n\t\t\t}\n\t\t\treturn data\n\t\t\t\t.map((item) => {\n\t\t\t\t\tlet value = getValue(item, field);\n\t\t\t\t\tif (typeof value === 'object') {\n\t\t\t\t\t\tvalue = JSON.stringify(value);\n\t\t\t\t\t}\n\t\t\t\t\tif (typeof value === 'undefined') {\n\t\t\t\t\t\tvalue = 'undefined';\n\t\t\t\t\t}\n\n\t\t\t\t\treturn value;\n\t\t\t\t})\n\t\t\t\t.join(separateBy);\n\n\t\t//numerical operations\n\t\tcase 'average':\n\t\t\treturn (\n\t\t\t\tdata.reduce((acc, item) => {\n\t\t\t\t\treturn acc + (getValue(item, field) as number);\n\t\t\t\t}, 0) / data.length\n\t\t\t);\n\t\tcase 'sum':\n\t\t\treturn data.reduce((acc, item) => {\n\t\t\t\treturn acc + (getValue(item, field) as number);\n\t\t\t}, 0);\n\t\t//comparison operations\n\t\tcase 'min':\n\t\t\tlet min;\n\t\t\tfor (const item of data) {\n\t\t\t\tconst value = getValue(item, field);\n\t\t\t\tif (value !== undefined && value !== null && value !== '') {\n\t\t\t\t\tif (min === undefined || value < min) {\n\t\t\t\t\t\tmin = value;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn min ?? null;\n\t\tcase 'max':\n\t\t\tlet max;\n\t\t\tfor (const item of data) {\n\t\t\t\tconst value = getValue(item, field);\n\t\t\t\tif (value !== undefined && value !== null && value !== '') {\n\t\t\t\t\tif (max === undefined || value > max) {\n\t\t\t\t\t\tmax = value;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn max ?? null;\n\n\t\t//count operations\n\t\tcase 'countUnique':\n\t\t\tif (!entry.includeEmpty) {\n\t\t\t\treturn new Set(data.map((item) => getValue(item, field)).filter((item) => !isEmpty(item)))\n\t\t\t\t\t.size;\n\t\t\t}\n\t\t\treturn new Set(data.map((item) => getValue(item, field))).size;\n\n\t\tdefault:\n\t\t\t//count by default\n\t\t\tif (!entry.includeEmpty) {\n\t\t\t\treturn data.filter((item) => !isEmpty(getValue(item, field))).length;\n\t\t\t}\n\t\t\treturn data.length;\n\t}\n}\n\nfunction aggregateData(\n\tdata: IDataObject[],\n\tfieldsToSummarize: Aggregations,\n\toptions: SummarizeOptions,\n\tgetValue: ValueGetterFn,\n): { returnData: IDataObject; pairedItems?: number[] } {\n\tconst returnData = Object.fromEntries(\n\t\tfieldsToSummarize.map((aggregation) => {\n\t\t\tconst key = normalizeFieldName(\n\t\t\t\t`${AggregationDisplayNames[aggregation.aggregation]}${aggregation.field}`,\n\t\t\t);\n\t\t\tconst result = aggregate(data, aggregation, getValue);\n\t\t\treturn [key, result];\n\t\t}),\n\t);\n\n\tif (options.outputFormat === 'singleItem') {\n\t\treturn { returnData };\n\t}\n\n\treturn { returnData, pairedItems: data.map((item) => item._itemIndex as number) };\n}\n\ntype AggregationResult = { returnData: IDataObject; pairedItems?: number[] };\ntype NestedAggregationResult =\n\t| AggregationResult\n\t| { fieldName: string; splits: Map<unknown, NestedAggregationResult> };\n\n// Using Map to preserve types\n// With a plain JS object, keys are converted to string\nexport function aggregateAndSplitData({\n\tsplitKeys,\n\tinputItems,\n\tfieldsToSummarize,\n\toptions,\n\tgetValue,\n\tconvertKeysToString = false,\n}: {\n\tsplitKeys: string[] | undefined;\n\tinputItems: IDataObject[];\n\tfieldsToSummarize: Aggregations;\n\toptions: SummarizeOptions;\n\tgetValue: ValueGetterFn;\n\tconvertKeysToString?: boolean; // Legacy option for v1\n}): NestedAggregationResult {\n\tif (!splitKeys?.length) {\n\t\treturn aggregateData(inputItems, fieldsToSummarize, options, getValue);\n\t}\n\n\tconst [firstSplitKey, ...restSplitKeys] = splitKeys;\n\n\tconst groupedItems = new Map<unknown, IDataObject[]>();\n\tfor (const item of inputItems) {\n\t\tlet key = getValue(item, firstSplitKey);\n\n\t\tif (key && typeof key === 'object') {\n\t\t\tkey = JSON.stringify(key);\n\t\t}\n\n\t\tif (convertKeysToString) {\n\t\t\tkey = normalizeFieldName(String(key));\n\t\t}\n\n\t\tif (options.skipEmptySplitFields && typeof key !== 'number' && !key) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst group = groupedItems.get(key) ?? [];\n\t\tgroupedItems.set(key, group.concat([item]));\n\t}\n\n\tconst splits = new Map(\n\t\tArray.from(groupedItems.entries()).map(([groupKey, items]) => [\n\t\t\tgroupKey,\n\t\t\taggregateAndSplitData({\n\t\t\t\tsplitKeys: restSplitKeys,\n\t\t\t\tinputItems: items,\n\t\t\t\tfieldsToSummarize,\n\t\t\t\toptions,\n\t\t\t\tgetValue,\n\t\t\t}),\n\t\t]),\n\t);\n\n\treturn { fieldName: firstSplitKey, splits };\n}\n\nexport function flattenAggregationResultToObject(result: NestedAggregationResult): IDataObject {\n\tif ('splits' in result) {\n\t\treturn Object.fromEntries(\n\t\t\tArray.from(result.splits.entries()).map(([key, value]) => [\n\t\t\t\tkey,\n\t\t\t\tflattenAggregationResultToObject(value),\n\t\t\t]),\n\t\t);\n\t}\n\n\treturn result.returnData;\n}\n\nexport function flattenAggregationResultToArray(\n\tresult: NestedAggregationResult,\n): AggregationResult[] {\n\tif ('splits' in result) {\n\t\treturn Array.from(result.splits.entries()).flatMap(([value, innerResult]) =>\n\t\t\tflattenAggregationResultToArray(innerResult).map((v) => {\n\t\t\t\tv.returnData[normalizeFieldName(result.fieldName)] = value as IDataObject;\n\t\t\t\treturn v;\n\t\t\t}),\n\t\t);\n\t}\n\treturn [result];\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAAgB;AAChB,0BAKO;AAsBP,MAAM,0BAA0B;AAAA,EAC/B,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,aAAa;AAAA,EACb,OAAO;AAAA,EACP,aAAa;AAAA,EACb,KAAK;AAAA,EACL,KAAK;AAAA,EACL,KAAK;AACN;AAEO,MAAM,yBAAyB,CAAC,WAAW,KAAK;AAcvD,SAAS,QAAW,OAAU;AAC7B,SAAO,UAAU,UAAa,UAAU,QAAQ,UAAU;AAC3D;AAEA,SAAS,mBAAmB,WAAmB;AAC9C,SAAO,UAAU,QAAQ,YAAY,EAAE,EAAE,QAAQ,SAAS,EAAE;AAC7D;AAEO,MAAM,mBAAmB,CAAC,uBAAiC;AACjE,SAAO,CAAC,MAAmB,UAC1B,qBAAqB,KAA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IAClB,MAAM,KAAK,aAAa,QAAQ,CAAC,EAAE,IAAI,CAAC,CAAC,UAAU,KAAK,MAAM;AAAA,MAC7D;AAAA,MACA,sBAAsB;AAAA,QACrB,WAAW;AAAA,QACX,YAAY;AAAA,QACZ;AAAA,QACA;AAAA,QACA;AAAA,MACD,CAAC;AAAA,IACF,CAAC;AAAA,EACF;AAEA,SAAO,EAAE,WAAW,eAAe,OAAO;AAC3C;AAEO,SAAS,iCAAiC,QAA8C;AAC9F,MAAI,YAAY,QAAQ;AACvB,WAAO,OAAO;AAAA,MACb,MAAM,KAAK,OAAO,OAAO,QAAQ,CAAC,EAAE,IAAI,CAAC,CAAC,KAAK,KAAK,MAAM;AAAA,QACzD;AAAA,QACA,iCAAiC,KAAK;AAAA,MACvC,CAAC;AAAA,IACF;AAAA,EACD;AAEA,SAAO,OAAO;AACf;AAEO,SAAS,gCACf,QACsB;AACtB,MAAI,YAAY,QAAQ;AACvB,WAAO,MAAM,KAAK,OAAO,OAAO,QAAQ,CAAC,EAAE;AAAA,MAAQ,CAAC,CAAC,OAAO,WAAW,MACtE,gCAAgC,WAAW,EAAE,IAAI,CAAC,MAAM;AACvD,UAAE,WAAW,mBAAmB,OAAO,SAAS,CAAC,IAAI;AACrD,eAAO;AAAA,MACR,CAAC;AAAA,IACF;AAAA,EACD;AACA,SAAO,CAAC,MAAM;AACf;","names":["get"]}
1
+ {"version":3,"sources":["../../../../nodes/Transform/Summarize/utils.ts"],"sourcesContent":["import get from 'lodash/get';\nimport {\n\ttype GenericValue,\n\ttype IDataObject,\n\ttype IExecuteFunctions,\n\tNodeOperationError,\n} from 'n8n-workflow';\n\ntype AggregationType =\n\t| 'append'\n\t| 'average'\n\t| 'concatenate'\n\t| 'count'\n\t| 'countUnique'\n\t| 'max'\n\t| 'min'\n\t| 'sum';\n\nexport type Aggregation = {\n\taggregation: AggregationType;\n\tfield: string;\n\tincludeEmpty?: boolean;\n\tseparateBy?: string;\n\tcustomSeparator?: string;\n};\n\nexport type Aggregations = Aggregation[];\n\nconst AggregationDisplayNames = {\n\tappend: 'appended_',\n\taverage: 'average_',\n\tconcatenate: 'concatenated_',\n\tcount: 'count_',\n\tcountUnique: 'unique_count_',\n\tmax: 'max_',\n\tmin: 'min_',\n\tsum: 'sum_',\n};\n\nexport const NUMERICAL_AGGREGATIONS = ['average', 'sum'];\n\nexport type SummarizeOptions = {\n\tcontinueIfFieldNotFound: boolean;\n\tdisableDotNotation?: boolean;\n\toutputFormat?: 'separateItems' | 'singleItem';\n\tskipEmptySplitFields?: boolean;\n};\n\nexport type ValueGetterFn = (\n\titem: IDataObject,\n\tfield: string,\n) => IDataObject | IDataObject[] | GenericValue | GenericValue[];\n\nfunction isEmpty<T>(value: T) {\n\treturn value === undefined || value === null || value === '';\n}\n\nfunction normalizeFieldName(fieldName: string) {\n\treturn fieldName.replace(/[\\]\\[\"]/g, '').replace(/[ .]/g, '_');\n}\n\nexport const fieldValueGetter = (disableDotNotation?: boolean) => {\n\treturn (item: IDataObject, field: string) =>\n\t\tdisableDotNotation ? item[field] : get(item, field);\n};\n\nexport function checkIfFieldExists(\n\tthis: IExecuteFunctions,\n\titems: IDataObject[],\n\taggregations: Aggregations,\n\tgetValue: ValueGetterFn,\n) {\n\tfor (const aggregation of aggregations) {\n\t\tif (aggregation.field === '') {\n\t\t\tcontinue;\n\t\t}\n\t\tconst exist = items.some((item) => getValue(item, aggregation.field) !== undefined);\n\t\tif (!exist) {\n\t\t\tthrow new NodeOperationError(\n\t\t\t\tthis.getNode(),\n\t\t\t\t`The field '${aggregation.field}' does not exist in any items`,\n\t\t\t);\n\t\t}\n\t}\n}\n\nfunction aggregate(items: IDataObject[], entry: Aggregation, getValue: ValueGetterFn) {\n\tconst { aggregation, field } = entry;\n\tlet data = [...items];\n\n\tif (NUMERICAL_AGGREGATIONS.includes(aggregation)) {\n\t\tdata = data.filter(\n\t\t\t(item) => typeof getValue(item, field) === 'number' && !isEmpty(getValue(item, field)),\n\t\t);\n\t}\n\n\tswitch (aggregation) {\n\t\t//combine operations\n\t\tcase 'append':\n\t\t\tif (!entry.includeEmpty) {\n\t\t\t\tdata = data.filter((item) => !isEmpty(getValue(item, field)));\n\t\t\t}\n\t\t\treturn data.map((item) => getValue(item, field));\n\t\tcase 'concatenate':\n\t\t\tconst separateBy = entry.separateBy === 'other' ? entry.customSeparator : entry.separateBy;\n\t\t\tif (!entry.includeEmpty) {\n\t\t\t\tdata = data.filter((item) => !isEmpty(getValue(item, field)));\n\t\t\t}\n\t\t\treturn data\n\t\t\t\t.map((item) => {\n\t\t\t\t\tlet value = getValue(item, field);\n\t\t\t\t\tif (typeof value === 'object') {\n\t\t\t\t\t\tvalue = JSON.stringify(value);\n\t\t\t\t\t}\n\t\t\t\t\tif (typeof value === 'undefined') {\n\t\t\t\t\t\tvalue = 'undefined';\n\t\t\t\t\t}\n\n\t\t\t\t\treturn value;\n\t\t\t\t})\n\t\t\t\t.join(separateBy);\n\n\t\t//numerical operations\n\t\tcase 'average':\n\t\t\treturn (\n\t\t\t\tdata.reduce((acc, item) => {\n\t\t\t\t\treturn acc + (getValue(item, field) as number);\n\t\t\t\t}, 0) / data.length\n\t\t\t);\n\t\tcase 'sum':\n\t\t\treturn data.reduce((acc, item) => {\n\t\t\t\treturn acc + (getValue(item, field) as number);\n\t\t\t}, 0);\n\t\t//comparison operations\n\t\tcase 'min':\n\t\t\tlet min;\n\t\t\tfor (const item of data) {\n\t\t\t\tconst value = getValue(item, field);\n\t\t\t\tif (value !== undefined && value !== null && value !== '') {\n\t\t\t\t\tif (min === undefined || value < min) {\n\t\t\t\t\t\tmin = value;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn min ?? null;\n\t\tcase 'max':\n\t\t\tlet max;\n\t\t\tfor (const item of data) {\n\t\t\t\tconst value = getValue(item, field);\n\t\t\t\tif (value !== undefined && value !== null && value !== '') {\n\t\t\t\t\tif (max === undefined || value > max) {\n\t\t\t\t\t\tmax = value;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn max ?? null;\n\n\t\t//count operations\n\t\tcase 'countUnique':\n\t\t\tif (!entry.includeEmpty) {\n\t\t\t\treturn new Set(data.map((item) => getValue(item, field)).filter((item) => !isEmpty(item)))\n\t\t\t\t\t.size;\n\t\t\t}\n\t\t\treturn new Set(data.map((item) => getValue(item, field))).size;\n\n\t\tdefault:\n\t\t\t//count by default\n\t\t\tif (!entry.includeEmpty) {\n\t\t\t\treturn data.filter((item) => !isEmpty(getValue(item, field))).length;\n\t\t\t}\n\t\t\treturn data.length;\n\t}\n}\n\nfunction aggregateData(\n\tdata: IDataObject[],\n\tfieldsToSummarize: Aggregations,\n\toptions: SummarizeOptions,\n\tgetValue: ValueGetterFn,\n): { returnData: IDataObject; pairedItems?: number[] } {\n\tconst returnData = Object.fromEntries(\n\t\tfieldsToSummarize.map((aggregation) => {\n\t\t\tconst key = normalizeFieldName(\n\t\t\t\t`${AggregationDisplayNames[aggregation.aggregation]}${aggregation.field}`,\n\t\t\t);\n\t\t\tconst result = aggregate(data, aggregation, getValue);\n\t\t\treturn [key, result];\n\t\t}),\n\t);\n\n\tif (options.outputFormat === 'singleItem') {\n\t\treturn { returnData };\n\t}\n\n\treturn { returnData, pairedItems: data.map((item) => item._itemIndex as number) };\n}\n\ntype AggregationResult = { returnData: IDataObject; pairedItems?: number[] };\ntype NestedAggregationResult =\n\t| AggregationResult\n\t| { fieldName: string; splits: Map<unknown, NestedAggregationResult> };\n\n// Using Map to preserve types\n// With a plain JS object, keys are converted to string\nexport function aggregateAndSplitData({\n\tsplitKeys,\n\tinputItems,\n\tfieldsToSummarize,\n\toptions,\n\tgetValue,\n\tconvertKeysToString = false,\n}: {\n\tsplitKeys: string[] | undefined;\n\tinputItems: IDataObject[];\n\tfieldsToSummarize: Aggregations;\n\toptions: SummarizeOptions;\n\tgetValue: ValueGetterFn;\n\tconvertKeysToString?: boolean; // Legacy option for v1\n}): NestedAggregationResult {\n\tif (!splitKeys?.length) {\n\t\treturn aggregateData(inputItems, fieldsToSummarize, options, getValue);\n\t}\n\n\tconst [firstSplitKey, ...restSplitKeys] = splitKeys;\n\n\tconst groupedItems = new Map<unknown, IDataObject[]>();\n\tfor (const item of inputItems) {\n\t\tlet key = getValue(item, firstSplitKey);\n\n\t\tif (key && typeof key === 'object') {\n\t\t\tkey = JSON.stringify(key);\n\t\t}\n\n\t\tif (convertKeysToString) {\n\t\t\tkey = normalizeFieldName(String(key));\n\t\t}\n\n\t\tif (options.skipEmptySplitFields && typeof key !== 'number' && !key) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst group = groupedItems.get(key) ?? [];\n\t\tgroupedItems.set(key, group.concat([item]));\n\t}\n\n\tconst splits = new Map(\n\t\tArray.from(groupedItems.entries()).map(([groupKey, items]) => [\n\t\t\tgroupKey,\n\t\t\taggregateAndSplitData({\n\t\t\t\tsplitKeys: restSplitKeys,\n\t\t\t\tinputItems: items,\n\t\t\t\tfieldsToSummarize,\n\t\t\t\toptions,\n\t\t\t\tgetValue,\n\t\t\t}),\n\t\t]),\n\t);\n\n\treturn { fieldName: firstSplitKey, splits };\n}\n\nexport function flattenAggregationResultToObject(result: NestedAggregationResult): IDataObject {\n\tif ('splits' in result) {\n\t\treturn Object.fromEntries(\n\t\t\tArray.from(result.splits.entries()).map(([key, value]) => [\n\t\t\t\tkey,\n\t\t\t\tflattenAggregationResultToObject(value),\n\t\t\t]),\n\t\t);\n\t}\n\n\treturn result.returnData;\n}\n\nexport function flattenAggregationResultToArray(\n\tresult: NestedAggregationResult,\n): AggregationResult[] {\n\tif ('splits' in result) {\n\t\treturn Array.from(result.splits.entries()).flatMap(([value, innerResult]) =>\n\t\t\tflattenAggregationResultToArray(innerResult).map((v) => {\n\t\t\t\tv.returnData[normalizeFieldName(result.fieldName)] = value as IDataObject;\n\t\t\t\treturn v;\n\t\t\t}),\n\t\t);\n\t}\n\treturn [result];\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AA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AAW,EAAE,IAAI,CAAC,MAAM;AACvD,UAAE,WAAW,mBAAmB,OAAO,SAAS,CAAC,IAAI;AACrD,eAAO;AAAA,MACR,CAAC;AAAA,IACF;AAAA,EACD;AACA,SAAO,CAAC,MAAM;AACf;","names":["get"]}
@@ -21,9 +21,6 @@
21
21
  "name": {
22
22
  "type": "string"
23
23
  },
24
- "softLimit": {
25
- "type": "null"
26
- },
27
24
  "subscribed": {
28
25
  "type": "boolean"
29
26
  },
@@ -31,5 +28,5 @@
31
28
  "type": "null"
32
29
  }
33
30
  },
34
- "version": 1
31
+ "version": 2
35
32
  }
@@ -47,6 +47,9 @@
47
47
  "location": {
48
48
  "type": "boolean"
49
49
  },
50
+ "maliciousAttachments": {
51
+ "type": "integer"
52
+ },
50
53
  "subscribed": {
51
54
  "type": "boolean"
52
55
  },
@@ -58,9 +61,6 @@
58
61
  }
59
62
  }
60
63
  },
61
- "cardRole": {
62
- "type": "null"
63
- },
64
64
  "checkItemStates": {
65
65
  "type": "array",
66
66
  "items": {
@@ -87,9 +87,6 @@
87
87
  "idPlugin": {
88
88
  "type": "null"
89
89
  },
90
- "idUploadedBackground": {
91
- "type": "null"
92
- },
93
90
  "size": {
94
91
  "type": "string"
95
92
  }
@@ -194,5 +191,5 @@
194
191
  "type": "string"
195
192
  }
196
193
  },
197
- "version": 1
194
+ "version": 2
198
195
  }
@@ -1,9 +1,6 @@
1
1
  {
2
2
  "type": "object",
3
3
  "properties": {
4
- "author_id": {
5
- "type": "string"
6
- },
7
4
  "edit_history_tweet_ids": {
8
5
  "type": "array",
9
6
  "items": {
@@ -17,5 +14,5 @@
17
14
  "type": "string"
18
15
  }
19
16
  },
20
- "version": 1
17
+ "version": 2
21
18
  }
@@ -225,6 +225,14 @@
225
225
  "link": {
226
226
  "type": "string"
227
227
  },
228
+ "meta": {
229
+ "type": "object",
230
+ "properties": {
231
+ "footnotes": {
232
+ "type": "string"
233
+ }
234
+ }
235
+ },
228
236
  "modified": {
229
237
  "type": "string"
230
238
  },
@@ -264,5 +272,5 @@
264
272
  "type": "string"
265
273
  }
266
274
  },
267
- "version": 1
275
+ "version": 2
268
276
  }
@@ -154,20 +154,6 @@
154
154
  }
155
155
  }
156
156
  },
157
- "Tag": {
158
- "type": "array",
159
- "items": {
160
- "type": "object",
161
- "properties": {
162
- "id": {
163
- "type": "string"
164
- },
165
- "name": {
166
- "type": "string"
167
- }
168
- }
169
- }
170
- },
171
157
  "Unsubscribed_Mode": {
172
158
  "type": "null"
173
159
  },
@@ -175,5 +161,5 @@
175
161
  "type": "null"
176
162
  }
177
163
  },
178
- "version": 1
164
+ "version": 2
179
165
  }
@@ -224,6 +224,23 @@ BQIDAQAB
224
224
  expires_in: 86400
225
225
  }
226
226
  },
227
+ youTubeOAuth2Api: {
228
+ grantType: "authorizationCode",
229
+ authUrl: "https://accounts.google.com/o/oauth2/v2/auth",
230
+ accessTokenUrl: "https://oauth2.googleapis.com/token",
231
+ clientId: "CLIENTID",
232
+ clientSecret: "CLIENTSECRET",
233
+ scope: "https://www.googleapis.com/auth/youtube https://www.googleapis.com/auth/youtubepartner https://www.googleapis.com/auth/youtube.force-ssl https://www.googleapis.com/auth/youtube.upload https://www.googleapis.com/auth/youtubepartner-channel-audit",
234
+ authQueryParameters: "access_type=offline&prompt=consent",
235
+ authentication: "body",
236
+ oauthTokenData: {
237
+ access_token: "ACCESSTOKEN",
238
+ refresh_token: "REFRESHTOKEN",
239
+ scope: "https://www.googleapis.com/auth/youtube https://www.googleapis.com/auth/youtubepartner https://www.googleapis.com/auth/youtube.force-ssl https://www.googleapis.com/auth/youtube.upload https://www.googleapis.com/auth/youtubepartner-channel-audit",
240
+ token_type: "bearer",
241
+ expires_in: 86400
242
+ }
243
+ },
227
244
  notionApi: {
228
245
  apiKey: "key123"
229
246
  },
@@ -274,6 +291,19 @@ BQIDAQAB
274
291
  },
275
292
  discordWebhookApi: {
276
293
  webhookUri: "https://discord.com/webhook"
294
+ },
295
+ salesforceOAuth2Api: {
296
+ grantType: "pkce",
297
+ environment: "production",
298
+ authUrl: "https://login.salesforce.com/services/oauth2/authorize",
299
+ accessTokenUrl: "https://login.salesforce.com/services/oauth2/token",
300
+ scope: "full refresh_token",
301
+ authQueryParameters: "",
302
+ authentication: "header",
303
+ oauthTokenData: {
304
+ access_token: "ACCESSTOKEN",
305
+ instance_url: "https://salesforce.instance"
306
+ }
277
307
  }
278
308
  };
279
309
  // Annotate the CommonJS export names for ESM import in node:
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../test/nodes/FakeCredentialsMap.ts"],"sourcesContent":["// If your test needs data from credentials, you can add it here.\n// as JSON.stringify({ id: 'credentials_ID', name: 'credentials_name' }) for specific credentials\n// or as 'credentials_type' for all credentials of that type\n// expected keys for credentials can be found in packages/nodes-base/credentials/[credentials_type].credentials.ts\nexport const FAKE_CREDENTIALS_DATA = {\n\t[JSON.stringify({ id: '20', name: 'Airtable account' })]: {\n\t\tapiKey: 'key456',\n\t},\n\t[JSON.stringify({ id: 'G45TOKX5kBEraTr1', name: 'JWT Auth test PEM' })]: {\n\t\tkeyType: 'pemKey',\n\t\tprivateKey: `\n-----BEGIN PRIVATE KEY-----\nMIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCfw0m1K+M1/6Tw\nCvLYDv0gmxa+reEdKBfT0/hfkkjFWqbMRo0f4CQ3PwrOavS+80PDy6nVL21BmGev\nw1bF7KXmqOzr+yKOUJ8A4u6vXUQKzVSFBqb2YZmZL1s7va9aaO6pVANTbmYHpTjh\nSBnBrXgidVOXNX1c+IG+OZZMiTFWg4lJTE9rvMbLh4o5FPwdZlA1rLAux4KXVNNr\nmE7T5/tsuikR06KMJS6V6YR4PZmTsy/3D2clADXDCtbUdEe0eBYoUmRLMhRL6umq\nh98Dsm5ZG+YB2dn0ThR/g7DPVwvmnrK2S5e4hpqFYxQ8V8pGx7dQLsc/utbvsn32\ndctGivkFAgMBAAECggEABDB0QdZtRlC2S/8VgBnghFbcwVJA6Wl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bI/lSxE216XwI/VBX50gg/Oy3aUl\nCibHHk2aKGlxVxe0Huv5gcjbZgVh1EMi4oxh4600IrWRH1Uz5AleXnheNiappKnA\nlOMhy99LXMlAOL7qOBnZHgrm\n-----END PRIVATE KEY-----\n\t\t`,\n\t\tpublicKey: `\n-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAn8NJtSvjNf+k8Ary2A79\nIJsWvq3hHSgX09P4X5JIxVqmzEaNH+AkNz8Kzmr0vvNDw8up1S9tQZhnr8NWxeyl\n5qjs6/sijlCfAOLur11ECs1UhQam9mGZmS9bO72vWmjuqVQDU25mB6U44UgZwa14\nInVTlzV9XPiBvjmWTIkxVoOJSUxPa7zGy4eKORT8HWZQNaywLseCl1TTa5hO0+f7\nbLopEdOijCUulemEeD2Zk7Mv9w9nJQA1wwrW1HRHtHgWKFJkSzIUS+rpqoffA7Ju\nWRvmAdnZ9E4Uf4Owz1cL5p6ytkuXuIaahWMUPFfKRse3UC7HP7rW77J99nXLRor5\nBQIDAQAB\n-----END PUBLIC KEY-----\n\t\t`,\n\t\talgorithm: 'RS256',\n\t},\n\tairtableApi: {\n\t\tapiKey: 'key123',\n\t},\n\tazureStorageOAuth2Api: {\n\t\tgrantType: 'authorizationCode',\n\t\tauthUrl: 'https://login.microsoftonline.com/common/oauth2/v2.0/authorize',\n\t\taccessTokenUrl: 'https://login.microsoftonline.com/common/oauth2/v2.0/token',\n\t\tclientId: 'CLIENTID',\n\t\tclientSecret: 'CLIENTSECRET',\n\t\tscope: 'https://storage.azure.com/user_impersonation',\n\t\tauthQueryParameters: 'response_mode=query',\n\t\tauthentication: 'body',\n\t\toauthTokenData: {\n\t\t\ttoken_type: 'Bearer',\n\t\t\tscope: 'https://storage.azure.com/user_impersonation',\n\t\t\texpires_in: 4730,\n\t\t\text_expires_in: 4730,\n\t\t\taccess_token: 'ACCESSTOKEN',\n\t\t\tcallbackQueryString: {\n\t\t\t\tsession_state: 'SESSIONSTATE',\n\t\t\t},\n\t\t},\n\t\taccount: 'myaccount',\n\t\tbaseUrl: 'https://myaccount.blob.core.windows.net',\n\t},\n\tazureStorageSharedKeyApi: {\n\t\taccount: 'devstoreaccount1',\n\t\tkey: 'Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==',\n\t\tbaseUrl: 'https://myaccount.blob.core.windows.net',\n\t},\n\tgongApi: {\n\t\tbaseUrl: 'https://api.gong.io',\n\t\taccessKey: 'accessKey123',\n\t\taccessKeySecret: 'accessKeySecret123',\n\t},\n\tgongOAuth2Api: {\n\t\tgrantType: 'authorizationCode',\n\t\tauthUrl: 'https://app.gong.io/oauth2/authorize',\n\t\taccessTokenUrl: 'https://app.gong.io/oauth2/generate-customer-token',\n\t\tclientId: 'CLIENTID',\n\t\tclientSecret: 'CLIENTSECRET',\n\t\tscope:\n\t\t\t'api:calls:read:transcript api:provisioning:read api:workspaces:read api:meetings:user:delete api:crm:get-objects api:data-privacy:delete api:crm:schema api:flows:write api:crm:upload api:meetings:integration:status api:calls:read:extensive api:meetings:user:update api:integration-settings:write api:settings:scorecards:read api:stats:scorecards api:stats:interaction api:stats:user-actions api:crm:integration:delete api:calls:read:basic api:calls:read:media-url api:digital-interactions:write api:crm:integrations:read api:library:read api:data-privacy:read api:users:read api:logs:read api:calls:create api:meetings:user:create api:stats:user-actions:detailed api:settings:trackers:read api:crm:integration:register api:provisioning:read-write api:engagement-data:write api:permission-profile:read api:permission-profile:write api:flows:read api:crm-calls:manual-association:read',\n\t\tauthQueryParameters: '',\n\t\tauthentication: 'header',\n\t\toauthTokenData: {\n\t\t\taccess_token: 'ACCESSTOKEN',\n\t\t\trefresh_token: 'REFRESHTOKEN',\n\t\t\tscope:\n\t\t\t\t'api:calls:read:transcript api:provisioning:read api:workspaces:read api:meetings:user:delete api:crm:get-objects api:data-privacy:delete api:crm:schema api:flows:write api:crm:upload api:meetings:integration:status api:calls:read:extensive api:meetings:user:update api:integration-settings:write api:settings:scorecards:read api:stats:scorecards api:stats:interaction api:stats:user-actions api:crm:integration:delete api:calls:read:basic api:calls:read:media-url api:digital-interactions:write api:crm:integrations:read api:library:read api:data-privacy:read api:users:read api:logs:read api:calls:create api:meetings:user:create api:stats:user-actions:detailed api:settings:trackers:read api:crm:integration:register api:provisioning:read-write api:engagement-data:write api:permission-profile:read api:permission-profile:write api:flows:read api:crm-calls:manual-association:read',\n\t\t\ttoken_type: 'bearer',\n\t\t\texpires_in: 86400,\n\t\t\tapi_base_url_for_customer: 'https://api.gong.io',\n\t\t},\n\t\tbaseUrl: 'https://api.gong.io',\n\t},\n\tmicrosoftAzureCosmosDbSharedKeyApi: {\n\t\taccount: 'n8n-us-east-account',\n\t\tkey: 'I3rwpzP0XoFpNzJ7hRIUXjwgpD1qaVKi71NZBbk7oOHUXrbd80WAoIAAoRaT47W9hHO3b6us1yABACDbVdilag==',\n\t\tdatabase: 'database_1',\n\t\tbaseUrl: 'https://n8n-us-east-account.documents.azure.com/dbs/database_1',\n\t},\n\tmicrosoftEntraOAuth2Api: {\n\t\tgrantType: 'authorizationCode',\n\t\tauthUrl: 'https://login.microsoftonline.com/common/oauth2/v2.0/authorize',\n\t\taccessTokenUrl: 'https://login.microsoftonline.com/common/oauth2/v2.0/token',\n\t\tclientId: 'CLIENTID',\n\t\tclientSecret: 'CLIENTSECRET',\n\t\tscope:\n\t\t\t'openid offline_access AccessReview.ReadWrite.All Directory.ReadWrite.All NetworkAccessPolicy.ReadWrite.All DelegatedAdminRelationship.ReadWrite.All EntitlementManagement.ReadWrite.All User.ReadWrite.All Directory.AccessAsUser.All Sites.FullControl.All',\n\t\tauthQueryParameters: 'response_mode=query',\n\t\tauthentication: 'body',\n\t\toauthTokenData: {\n\t\t\ttoken_type: 'Bearer',\n\t\t\tscope:\n\t\t\t\t'AccessReview.ReadWrite.All DelegatedAdminRelationship.ReadWrite.All Directory.AccessAsUser.All Directory.Read.All Directory.ReadWrite.All EntitlementManagement.ReadWrite.All Group.ReadWrite.All NetworkAccessPolicy.ReadWrite.All openid Sites.FullControl.All User.DeleteRestore.All User.EnableDisableAccount.All User.Export.All User.Invite.All User.ManageIdentities.All User.Read User.Read.All User.ReadBasic.All User.ReadWrite User.ReadWrite.All User.RevokeSessions.All profile email',\n\t\t\texpires_in: 4822,\n\t\t\text_expires_in: 4822,\n\t\t\taccess_token: 'ACCESSTOKEN',\n\t\t\trefresh_token: 'REFRESHTOKEN',\n\t\t\tid_token: 'IDTOKEN',\n\t\t\tcallbackQueryString: {\n\t\t\t\tsession_state: 'SESSIONSTATE',\n\t\t\t},\n\t\t},\n\t},\n\tmicrosoftExcelOAuth2Api: {\n\t\tscope: 'openid',\n\t\toauthTokenData: {\n\t\t\taccess_token: 'token',\n\t\t},\n\t},\n\tmicrosoftTeamsOAuth2Api: {\n\t\tscope: 'openid',\n\t\toauthTokenData: {\n\t\t\taccess_token: 'token',\n\t\t},\n\t},\n\tn8nApi: {\n\t\tapiKey: 'key123',\n\t\tbaseUrl: 'https://test.app.n8n.cloud/api/v1',\n\t},\n\tnpmApi: {\n\t\taccessToken: 'fake-npm-access-token',\n\t\tregistryUrl: 'https://fake.npm.registry',\n\t},\n\ttotpApi: {\n\t\tlabel: 'GitHub:john-doe',\n\t\tsecret: 'BVDRSBXQB2ZEL5HE',\n\t},\n\taws: {\n\t\tregion: 'eu-central-1',\n\t\taccessKeyId: 'key',\n\t\tsecretAccessKey: 'secret',\n\t},\n\ttwitterOAuth2Api: {\n\t\tgrantType: 'pkce',\n\t\tauthUrl: 'https://twitter.com/i/oauth2/authorize',\n\t\taccessTokenUrl: 'https://api.twitter.com/2/oauth2/token',\n\t\tclientId: 'CLIENTID',\n\t\tclientSecret: 'CLIENTSECRET',\n\t\tscope:\n\t\t\t'tweet.read users.read tweet.write tweet.moderate.write users.read follows.read follows.write offline.access like.read like.write dm.write dm.read list.read list.write',\n\t\tauthQueryParameters: '',\n\t\tauthentication: 'header',\n\t\toauthTokenData: {\n\t\t\ttoken_type: 'bearer',\n\t\t\texpires_in: 7200,\n\t\t\taccess_token: 'ACCESSTOKEN',\n\t\t\tscope:\n\t\t\t\t'tweet.moderate.write follows.read offline.access list.write dm.read list.read tweet.write like.write like.read users.read dm.write tweet.read follows.write',\n\t\t\trefresh_token: 'REFRESHTOKEN',\n\t\t},\n\t},\n\tjwtAuth: {\n\t\tkeyType: 'passphrase',\n\t\tsecret: 'baz',\n\t\talgorithm: 'HS256',\n\t},\n\ttelegramApi: {\n\t\taccessToken: 'testToken',\n\t\tbaseUrl: 'https://api.telegram.org',\n\t},\n\tgmailOAuth2: {\n\t\tgrantType: 'authorizationCode',\n\t\tauthUrl: 'https://accounts.google.com/o/oauth2/v2/auth',\n\t\taccessTokenUrl: 'https://oauth2.googleapis.com/token',\n\t\tclientId: 'CLIENTID',\n\t\tclientSecret: 'CLIENTSECRET',\n\t\tscope:\n\t\t\t'https://www.googleapis.com/auth/gmail.labels https://www.googleapis.com/auth/gmail.addons.current.action.compose https://www.googleapis.com/auth/gmail.addons.current.message.action https://mail.google.com/ https://www.googleapis.com/auth/gmail.modify https://www.googleapis.com/auth/gmail.compose',\n\t\tauthQueryParameters: 'access_type=offline&prompt=consent',\n\t\tauthentication: 'body',\n\t\toauthTokenData: {\n\t\t\taccess_token: 'ACCESSTOKEN',\n\t\t\trefresh_token: 'REFRESHTOKEN',\n\t\t\tscope:\n\t\t\t\t'https://www.googleapis.com/auth/gmail.labels https://www.googleapis.com/auth/gmail.addons.current.action.compose https://www.googleapis.com/auth/gmail.addons.current.message.action https://mail.google.com/ https://www.googleapis.com/auth/gmail.modify https://www.googleapis.com/auth/gmail.compose',\n\t\t\ttoken_type: 'bearer',\n\t\t\texpires_in: 86400,\n\t\t},\n\t},\n\tnotionApi: {\n\t\tapiKey: 'key123',\n\t},\n\tphilipsHueOAuth2Api: {\n\t\tgrantType: 'authorizationCode',\n\t\tappId: 'APPID',\n\t\tauthUrl: 'https://api.meethue.com/v2/oauth2/authorize',\n\t\taccessTokenUrl: 'https://api.meethue.com/v2/oauth2/token',\n\t\tauthQueryParameters: 'appid=APPID',\n\t\tscope: '',\n\t\tauthentication: 'header',\n\t\toauthTokenData: {\n\t\t\taccess_token: 'ACCESSTOKEN',\n\t\t\trefresh_token: 'REFRESHTOKEN',\n\t\t\tscope: '',\n\t\t\ttoken_type: 'bearer',\n\t\t\texpires_in: 86400,\n\t\t},\n\t},\n\tspotifyOAuth2Api: {\n\t\taccessTokenUrl: 'https://accounts.spotify.com/api/token',\n\t\tauthQueryParameters: '',\n\t\tauthUrl: 'https://accounts.spotify.com/authorize',\n\t\tauthentication: 'header',\n\t\tclientId: 'CLIENT_ID',\n\t\tclientSecret: 'CLIENT_SECRET',\n\t\tgrantType: 'authorizationCode',\n\t\toauthTokenData: {\n\t\t\taccess_token: 'ACCESS_TOKEN',\n\t\t\texpires_in: 3600,\n\t\t\trefresh_token: 'REFRESH_TOKEN',\n\t\t\tscope:\n\t\t\t\t'playlist-read-private playlist-read-collaborative user-modify-playback-state user-library-read user-follow-read playlist-modify-private playlist-modify-public user-read-playback-state user-read-currently-playing user-read-recently-played',\n\t\t\ttoken_type: 'Bearer',\n\t\t},\n\t\tscope:\n\t\t\t'user-read-playback-state playlist-read-collaborative user-modify-playback-state playlist-modify-public user-read-currently-playing playlist-read-private user-read-recently-played playlist-modify-private user-library-read user-follow-read',\n\t\tserver: 'https://api.spotify.com/',\n\t},\n\tbaserowApi: {\n\t\thost: 'https://api.baserow.io',\n\t\tusername: 'nathan@n8n.io',\n\t\tpassword: 'fake-password',\n\t},\n\twordpressApi: {\n\t\turl: 'https://myblog.com',\n\t\tallowUnauthorizedCerts: false,\n\t\tusername: 'nodeqa',\n\t\tpassword: 'fake-password',\n\t},\n\tdiscordWebhookApi: {\n\t\twebhookUri: 'https://discord.com/webhook',\n\t},\n} as const;\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;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Y;AAAA,IACb;AAAA,IACA,OACC;AAAA,IACD,QAAQ;AAAA,EACT;AAAA,EACA,YAAY;AAAA,IACX,MAAM;AAAA,IACN,UAAU;AAAA,IACV,UAAU;AAAA,EACX;AAAA,EACA,cAAc;AAAA,IACb,KAAK;AAAA,IACL,wBAAwB;AAAA,IACxB,UAAU;AAAA,IACV,UAAU;AAAA,EACX;AAAA,EACA,mBAAmB;AAAA,IAClB,YAAY;AAAA,EACb;AACD;","names":[]}
1
+ {"version":3,"sources":["../../../test/nodes/FakeCredentialsMap.ts"],"sourcesContent":["// If your test needs data from credentials, you can add it here.\n// as JSON.stringify({ id: 'credentials_ID', name: 'credentials_name' }) for specific credentials\n// or as 'credentials_type' for all credentials of that type\n// expected keys for credentials can be found in packages/nodes-base/credentials/[credentials_type].credentials.ts\nexport const FAKE_CREDENTIALS_DATA = {\n\t[JSON.stringify({ id: '20', name: 'Airtable account' })]: {\n\t\tapiKey: 'key456',\n\t},\n\t[JSON.stringify({ id: 'G45TOKX5kBEraTr1', name: 'JWT Auth test PEM' })]: {\n\t\tkeyType: 'pemKey',\n\t\tprivateKey: `\n-----BEGIN PRIVATE KEY-----\nMIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCfw0m1K+M1/6Tw\nCvLYDv0gmxa+reEdKBfT0/hfkkjFWqbMRo0f4CQ3PwrOavS+80PDy6nVL21BmGev\nw1bF7KXmqOzr+yKOUJ8A4u6vXUQKzVSFBqb2YZmZL1s7va9aaO6pVANTbmYHpTjh\nSBnBrXgidVOXNX1c+IG+OZZMiTFWg4lJTE9rvMbLh4o5FPwdZlA1rLAux4KXVNNr\nmE7T5/tsuikR06KMJS6V6YR4PZmTsy/3D2clADXDCtbUdEe0eBYoUmRLMhRL6umq\nh98Dsm5ZG+YB2dn0ThR/g7DPVwvmnrK2S5e4hpqFYxQ8V8pGx7dQLsc/utbvsn32\ndctGivkFAgMBAAECggEABDB0QdZtRlC2S/8VgBnghFbcwVJA6W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bbI/lSxE216XwI/VBX50gg/Oy3aUl\nCibHHk2aKGlxVxe0Huv5gcjbZgVh1EMi4oxh4600IrWRH1Uz5AleXnheNiappKnA\nlOMhy99LXMlAOL7qOBnZHgrm\n-----END PRIVATE KEY-----\n\t\t`,\n\t\tpublicKey: `\n-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAn8NJtSvjNf+k8Ary2A79\nIJsWvq3hHSgX09P4X5JIxVqmzEaNH+AkNz8Kzmr0vvNDw8up1S9tQZhnr8NWxeyl\n5qjs6/sijlCfAOLur11ECs1UhQam9mGZmS9bO72vWmjuqVQDU25mB6U44UgZwa14\nInVTlzV9XPiBvjmWTIkxVoOJSUxPa7zGy4eKORT8HWZQNaywLseCl1TTa5hO0+f7\nbLopEdOijCUulemEeD2Zk7Mv9w9nJQA1wwrW1HRHtHgWKFJkSzIUS+rpqoffA7Ju\nWRvmAdnZ9E4Uf4Owz1cL5p6ytkuXuIaahWMUPFfKRse3UC7HP7rW77J99nXLRor5\nBQIDAQAB\n-----END PUBLIC KEY-----\n\t\t`,\n\t\talgorithm: 'RS256',\n\t},\n\tairtableApi: {\n\t\tapiKey: 'key123',\n\t},\n\tazureStorageOAuth2Api: {\n\t\tgrantType: 'authorizationCode',\n\t\tauthUrl: 'https://login.microsoftonline.com/common/oauth2/v2.0/authorize',\n\t\taccessTokenUrl: 'https://login.microsoftonline.com/common/oauth2/v2.0/token',\n\t\tclientId: 'CLIENTID',\n\t\tclientSecret: 'CLIENTSECRET',\n\t\tscope: 'https://storage.azure.com/user_impersonation',\n\t\tauthQueryParameters: 'response_mode=query',\n\t\tauthentication: 'body',\n\t\toauthTokenData: {\n\t\t\ttoken_type: 'Bearer',\n\t\t\tscope: 'https://storage.azure.com/user_impersonation',\n\t\t\texpires_in: 4730,\n\t\t\text_expires_in: 4730,\n\t\t\taccess_token: 'ACCESSTOKEN',\n\t\t\tcallbackQueryString: {\n\t\t\t\tsession_state: 'SESSIONSTATE',\n\t\t\t},\n\t\t},\n\t\taccount: 'myaccount',\n\t\tbaseUrl: 'https://myaccount.blob.core.windows.net',\n\t},\n\tazureStorageSharedKeyApi: {\n\t\taccount: 'devstoreaccount1',\n\t\tkey: 'Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==',\n\t\tbaseUrl: 'https://myaccount.blob.core.windows.net',\n\t},\n\tgongApi: {\n\t\tbaseUrl: 'https://api.gong.io',\n\t\taccessKey: 'accessKey123',\n\t\taccessKeySecret: 'accessKeySecret123',\n\t},\n\tgongOAuth2Api: {\n\t\tgrantType: 'authorizationCode',\n\t\tauthUrl: 'https://app.gong.io/oauth2/authorize',\n\t\taccessTokenUrl: 'https://app.gong.io/oauth2/generate-customer-token',\n\t\tclientId: 'CLIENTID',\n\t\tclientSecret: 'CLIENTSECRET',\n\t\tscope:\n\t\t\t'api:calls:read:transcript api:provisioning:read api:workspaces:read api:meetings:user:delete api:crm:get-objects api:data-privacy:delete api:crm:schema api:flows:write api:crm:upload api:meetings:integration:status api:calls:read:extensive api:meetings:user:update api:integration-settings:write api:settings:scorecards:read api:stats:scorecards api:stats:interaction api:stats:user-actions api:crm:integration:delete api:calls:read:basic api:calls:read:media-url api:digital-interactions:write api:crm:integrations:read api:library:read api:data-privacy:read api:users:read api:logs:read api:calls:create api:meetings:user:create api:stats:user-actions:detailed api:settings:trackers:read api:crm:integration:register api:provisioning:read-write api:engagement-data:write api:permission-profile:read api:permission-profile:write api:flows:read api:crm-calls:manual-association:read',\n\t\tauthQueryParameters: '',\n\t\tauthentication: 'header',\n\t\toauthTokenData: {\n\t\t\taccess_token: 'ACCESSTOKEN',\n\t\t\trefresh_token: 'REFRESHTOKEN',\n\t\t\tscope:\n\t\t\t\t'api:calls:read:transcript api:provisioning:read api:workspaces:read api:meetings:user:delete api:crm:get-objects api:data-privacy:delete api:crm:schema api:flows:write api:crm:upload api:meetings:integration:status api:calls:read:extensive api:meetings:user:update api:integration-settings:write api:settings:scorecards:read api:stats:scorecards api:stats:interaction api:stats:user-actions api:crm:integration:delete api:calls:read:basic api:calls:read:media-url api:digital-interactions:write api:crm:integrations:read api:library:read api:data-privacy:read api:users:read api:logs:read api:calls:create api:meetings:user:create api:stats:user-actions:detailed api:settings:trackers:read api:crm:integration:register api:provisioning:read-write api:engagement-data:write api:permission-profile:read api:permission-profile:write api:flows:read api:crm-calls:manual-association:read',\n\t\t\ttoken_type: 'bearer',\n\t\t\texpires_in: 86400,\n\t\t\tapi_base_url_for_customer: 'https://api.gong.io',\n\t\t},\n\t\tbaseUrl: 'https://api.gong.io',\n\t},\n\tmicrosoftAzureCosmosDbSharedKeyApi: {\n\t\taccount: 'n8n-us-east-account',\n\t\tkey: 'I3rwpzP0XoFpNzJ7hRIUXjwgpD1qaVKi71NZBbk7oOHUXrbd80WAoIAAoRaT47W9hHO3b6us1yABACDbVdilag==',\n\t\tdatabase: 'database_1',\n\t\tbaseUrl: 'https://n8n-us-east-account.documents.azure.com/dbs/database_1',\n\t},\n\tmicrosoftEntraOAuth2Api: {\n\t\tgrantType: 'authorizationCode',\n\t\tauthUrl: 'https://login.microsoftonline.com/common/oauth2/v2.0/authorize',\n\t\taccessTokenUrl: 'https://login.microsoftonline.com/common/oauth2/v2.0/token',\n\t\tclientId: 'CLIENTID',\n\t\tclientSecret: 'CLIENTSECRET',\n\t\tscope:\n\t\t\t'openid offline_access AccessReview.ReadWrite.All Directory.ReadWrite.All NetworkAccessPolicy.ReadWrite.All DelegatedAdminRelationship.ReadWrite.All EntitlementManagement.ReadWrite.All User.ReadWrite.All Directory.AccessAsUser.All Sites.FullControl.All',\n\t\tauthQueryParameters: 'response_mode=query',\n\t\tauthentication: 'body',\n\t\toauthTokenData: {\n\t\t\ttoken_type: 'Bearer',\n\t\t\tscope:\n\t\t\t\t'AccessReview.ReadWrite.All DelegatedAdminRelationship.ReadWrite.All Directory.AccessAsUser.All Directory.Read.All Directory.ReadWrite.All EntitlementManagement.ReadWrite.All Group.ReadWrite.All NetworkAccessPolicy.ReadWrite.All openid Sites.FullControl.All User.DeleteRestore.All User.EnableDisableAccount.All User.Export.All User.Invite.All User.ManageIdentities.All User.Read User.Read.All User.ReadBasic.All User.ReadWrite User.ReadWrite.All User.RevokeSessions.All profile email',\n\t\t\texpires_in: 4822,\n\t\t\text_expires_in: 4822,\n\t\t\taccess_token: 'ACCESSTOKEN',\n\t\t\trefresh_token: 'REFRESHTOKEN',\n\t\t\tid_token: 'IDTOKEN',\n\t\t\tcallbackQueryString: {\n\t\t\t\tsession_state: 'SESSIONSTATE',\n\t\t\t},\n\t\t},\n\t},\n\tmicrosoftExcelOAuth2Api: {\n\t\tscope: 'openid',\n\t\toauthTokenData: {\n\t\t\taccess_token: 'token',\n\t\t},\n\t},\n\tmicrosoftTeamsOAuth2Api: {\n\t\tscope: 'openid',\n\t\toauthTokenData: {\n\t\t\taccess_token: 'token',\n\t\t},\n\t},\n\tn8nApi: {\n\t\tapiKey: 'key123',\n\t\tbaseUrl: 'https://test.app.n8n.cloud/api/v1',\n\t},\n\tnpmApi: {\n\t\taccessToken: 'fake-npm-access-token',\n\t\tregistryUrl: 'https://fake.npm.registry',\n\t},\n\ttotpApi: {\n\t\tlabel: 'GitHub:john-doe',\n\t\tsecret: 'BVDRSBXQB2ZEL5HE',\n\t},\n\taws: {\n\t\tregion: 'eu-central-1',\n\t\taccessKeyId: 'key',\n\t\tsecretAccessKey: 'secret',\n\t},\n\ttwitterOAuth2Api: {\n\t\tgrantType: 'pkce',\n\t\tauthUrl: 'https://twitter.com/i/oauth2/authorize',\n\t\taccessTokenUrl: 'https://api.twitter.com/2/oauth2/token',\n\t\tclientId: 'CLIENTID',\n\t\tclientSecret: 'CLIENTSECRET',\n\t\tscope:\n\t\t\t'tweet.read users.read tweet.write tweet.moderate.write users.read follows.read follows.write offline.access like.read like.write dm.write dm.read list.read list.write',\n\t\tauthQueryParameters: '',\n\t\tauthentication: 'header',\n\t\toauthTokenData: {\n\t\t\ttoken_type: 'bearer',\n\t\t\texpires_in: 7200,\n\t\t\taccess_token: 'ACCESSTOKEN',\n\t\t\tscope:\n\t\t\t\t'tweet.moderate.write follows.read offline.access list.write dm.read list.read tweet.write like.write like.read users.read dm.write tweet.read follows.write',\n\t\t\trefresh_token: 'REFRESHTOKEN',\n\t\t},\n\t},\n\tjwtAuth: {\n\t\tkeyType: 'passphrase',\n\t\tsecret: 'baz',\n\t\talgorithm: 'HS256',\n\t},\n\ttelegramApi: {\n\t\taccessToken: 'testToken',\n\t\tbaseUrl: 'https://api.telegram.org',\n\t},\n\tgmailOAuth2: {\n\t\tgrantType: 'authorizationCode',\n\t\tauthUrl: 'https://accounts.google.com/o/oauth2/v2/auth',\n\t\taccessTokenUrl: 'https://oauth2.googleapis.com/token',\n\t\tclientId: 'CLIENTID',\n\t\tclientSecret: 'CLIENTSECRET',\n\t\tscope:\n\t\t\t'https://www.googleapis.com/auth/gmail.labels https://www.googleapis.com/auth/gmail.addons.current.action.compose https://www.googleapis.com/auth/gmail.addons.current.message.action https://mail.google.com/ https://www.googleapis.com/auth/gmail.modify https://www.googleapis.com/auth/gmail.compose',\n\t\tauthQueryParameters: 'access_type=offline&prompt=consent',\n\t\tauthentication: 'body',\n\t\toauthTokenData: {\n\t\t\taccess_token: 'ACCESSTOKEN',\n\t\t\trefresh_token: 'REFRESHTOKEN',\n\t\t\tscope:\n\t\t\t\t'https://www.googleapis.com/auth/gmail.labels https://www.googleapis.com/auth/gmail.addons.current.action.compose https://www.googleapis.com/auth/gmail.addons.current.message.action https://mail.google.com/ https://www.googleapis.com/auth/gmail.modify https://www.googleapis.com/auth/gmail.compose',\n\t\t\ttoken_type: 'bearer',\n\t\t\texpires_in: 86400,\n\t\t},\n\t},\n\tyouTubeOAuth2Api: {\n\t\tgrantType: 'authorizationCode',\n\t\tauthUrl: 'https://accounts.google.com/o/oauth2/v2/auth',\n\t\taccessTokenUrl: 'https://oauth2.googleapis.com/token',\n\t\tclientId: 'CLIENTID',\n\t\tclientSecret: 'CLIENTSECRET',\n\t\tscope:\n\t\t\t'https://www.googleapis.com/auth/youtube https://www.googleapis.com/auth/youtubepartner https://www.googleapis.com/auth/youtube.force-ssl https://www.googleapis.com/auth/youtube.upload https://www.googleapis.com/auth/youtubepartner-channel-audit',\n\t\tauthQueryParameters: 'access_type=offline&prompt=consent',\n\t\tauthentication: 'body',\n\t\toauthTokenData: {\n\t\t\taccess_token: 'ACCESSTOKEN',\n\t\t\trefresh_token: 'REFRESHTOKEN',\n\t\t\tscope:\n\t\t\t\t'https://www.googleapis.com/auth/youtube https://www.googleapis.com/auth/youtubepartner https://www.googleapis.com/auth/youtube.force-ssl https://www.googleapis.com/auth/youtube.upload https://www.googleapis.com/auth/youtubepartner-channel-audit',\n\t\t\ttoken_type: 'bearer',\n\t\t\texpires_in: 86400,\n\t\t},\n\t},\n\tnotionApi: {\n\t\tapiKey: 'key123',\n\t},\n\tphilipsHueOAuth2Api: {\n\t\tgrantType: 'authorizationCode',\n\t\tappId: 'APPID',\n\t\tauthUrl: 'https://api.meethue.com/v2/oauth2/authorize',\n\t\taccessTokenUrl: 'https://api.meethue.com/v2/oauth2/token',\n\t\tauthQueryParameters: 'appid=APPID',\n\t\tscope: '',\n\t\tauthentication: 'header',\n\t\toauthTokenData: {\n\t\t\taccess_token: 'ACCESSTOKEN',\n\t\t\trefresh_token: 'REFRESHTOKEN',\n\t\t\tscope: '',\n\t\t\ttoken_type: 'bearer',\n\t\t\texpires_in: 86400,\n\t\t},\n\t},\n\tspotifyOAuth2Api: {\n\t\taccessTokenUrl: 'https://accounts.spotify.com/api/token',\n\t\tauthQueryParameters: '',\n\t\tauthUrl: 'https://accounts.spotify.com/authorize',\n\t\tauthentication: 'header',\n\t\tclientId: 'CLIENT_ID',\n\t\tclientSecret: 'CLIENT_SECRET',\n\t\tgrantType: 'authorizationCode',\n\t\toauthTokenData: {\n\t\t\taccess_token: 'ACCESS_TOKEN',\n\t\t\texpires_in: 3600,\n\t\t\trefresh_token: 'REFRESH_TOKEN',\n\t\t\tscope:\n\t\t\t\t'playlist-read-private playlist-read-collaborative user-modify-playback-state user-library-read user-follow-read playlist-modify-private playlist-modify-public user-read-playback-state user-read-currently-playing user-read-recently-played',\n\t\t\ttoken_type: 'Bearer',\n\t\t},\n\t\tscope:\n\t\t\t'user-read-playback-state playlist-read-collaborative user-modify-playback-state playlist-modify-public user-read-currently-playing playlist-read-private user-read-recently-played playlist-modify-private user-library-read user-follow-read',\n\t\tserver: 'https://api.spotify.com/',\n\t},\n\tbaserowApi: {\n\t\thost: 'https://api.baserow.io',\n\t\tusername: 'nathan@n8n.io',\n\t\tpassword: 'fake-password',\n\t},\n\twordpressApi: {\n\t\turl: 'https://myblog.com',\n\t\tallowUnauthorizedCerts: false,\n\t\tusername: 'nodeqa',\n\t\tpassword: 'fake-password',\n\t},\n\tdiscordWebhookApi: {\n\t\twebhookUri: 'https://discord.com/webhook',\n\t},\n\tsalesforceOAuth2Api: {\n\t\tgrantType: 'pkce',\n\t\tenvironment: 'production',\n\t\tauthUrl: 'https://login.salesforce.com/services/oauth2/authorize',\n\t\taccessTokenUrl: 'https://login.salesforce.com/services/oauth2/token',\n\t\tscope: 'full refresh_token',\n\t\tauthQueryParameters: '',\n\t\tauthentication: 'header',\n\t\toauthTokenData: {\n\t\t\taccess_token: 'ACCESSTOKEN',\n\t\t\tinstance_url: 'https://salesforce.instance',\n\t\t},\n\t},\n} as const;\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAIO,MAAM,wBAAwB;AAAA,EACpC,CAAC,KAAK,UAAU,EAAE,IAAI,MAAM,MAAM,mBAAmB,CAAC,CAAC,GAAG;AAAA,IACzD,QAAQ;AAAA,EACT;AAAA,EACA,CAAC,KAAK,UAAU,EAAE,IAAI,oBAAoB,MAAM,oBAAoB,CAAC,CAAC,GAAG;AAAA,IACxE,SAAS;AAA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,MACZ,eAAe;AAAA,MACf,OACC;AAAA,MACD,YAAY;AAAA,IACb;AAAA,IACA,OACC;AAAA,IACD,QAAQ;AAAA,EACT;AAAA,EACA,YAAY;AAAA,IACX,MAAM;AAAA,IACN,UAAU;AAAA,IACV,UAAU;AAAA,EACX;AAAA,EACA,cAAc;AAAA,IACb,KAAK;AAAA,IACL,wBAAwB;AAAA,IACxB,UAAU;AAAA,IACV,UAAU;AAAA,EACX;AAAA,EACA,mBAAmB;AAAA,IAClB,YAAY;AAAA,EACb;AAAA,EACA,qBAAqB;AAAA,IACpB,WAAW;AAAA,IACX,aAAa;AAAA,IACb,SAAS;AAAA,IACT,gBAAgB;AAAA,IAChB,OAAO;AAAA,IACP,qBAAqB;AAAA,IACrB,gBAAgB;AAAA,IAChB,gBAAgB;AAAA,MACf,cAAc;AAAA,MACd,cAAc;AAAA,IACf;AAAA,EACD;AACD;","names":[]}
@@ -110,7 +110,7 @@ const equalityTest = async (testData) => {
110
110
  delete binary.data.data;
111
111
  delete binary.data.directory;
112
112
  }
113
- if (json.error instanceof Error) {
113
+ if (json?.error instanceof Error) {
114
114
  json.error = JSON.parse(
115
115
  JSON.stringify(json.error, ["message", "name", "description", "context"])
116
116
  );
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../test/nodes/Helpers.ts"],"sourcesContent":["import { Container } from '@n8n/di';\nimport { readFileSync, readdirSync, mkdtempSync } from 'fs';\nimport { get } from 'lodash';\nimport { isEmpty } from 'lodash';\nimport { BinaryDataService, constructExecutionMetaData } from 'n8n-core';\nimport type {\n\tIDataObject,\n\tIExecuteFunctions,\n\tIGetNodeParameterOptions,\n\tINode,\n\tIRun,\n\tIWorkflowBase,\n\tWorkflowTestData,\n} from 'n8n-workflow';\nimport { ApplicationError } from 'n8n-workflow';\nimport nock from 'nock';\nimport { tmpdir } from 'os';\nimport path from 'path';\n\nimport { executeWorkflow } from './ExecuteWorkflow';\nimport { LoadNodesAndCredentials } from './load-nodes-and-credentials';\n\nconst baseDir = path.resolve(__dirname, '../..');\n\nexport const readJsonFileSync = <T = any>(filePath: string) =>\n\tJSON.parse(readFileSync(path.join(baseDir, filePath), 'utf-8')) as T;\n\nconst loadNodesAndCredentials = new LoadNodesAndCredentials(baseDir);\nContainer.set(LoadNodesAndCredentials, loadNodesAndCredentials);\n\nbeforeAll(async () => await loadNodesAndCredentials.init());\nbeforeEach(() => nock.disableNetConnect());\n\nexport function createTemporaryDir(prefix = 'n8n') {\n\treturn mkdtempSync(path.join(tmpdir(), prefix));\n}\n\nexport async function initBinaryDataService() {\n\tconst binaryDataService = new BinaryDataService();\n\tawait binaryDataService.init({\n\t\tmode: 'default',\n\t\tavailableModes: ['default'],\n\t\tlocalStoragePath: createTemporaryDir(),\n\t});\n\tContainer.set(BinaryDataService, binaryDataService);\n}\n\nexport function getResultNodeData(result: IRun, testData: WorkflowTestData) {\n\treturn Object.keys(testData.output.nodeData).map((nodeName) => {\n\t\tconst error = result.data.resultData.error;\n\t\t// If there was an error running the workflow throw it for easier debugging\n\t\t// and to surface all issues\n\t\tif (error?.cause) throw error.cause;\n\t\tif (error) throw error;\n\n\t\tif (result.data.resultData.runData[nodeName] === undefined) {\n\t\t\t// log errors from other nodes\n\t\t\tObject.keys(result.data.resultData.runData).forEach((key) => {\n\t\t\t\tconst error = result.data.resultData.runData[key][0]?.error;\n\t\t\t\tif (error) {\n\t\t\t\t\tconsole.log(`Node ${key}\\n`, error);\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tthrow new ApplicationError(`Data for node \"${nodeName}\" is missing!`, { level: 'warning' });\n\t\t}\n\t\tconst resultData = result.data.resultData.runData[nodeName].map((nodeData) => {\n\t\t\tif (nodeData.data === undefined) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn nodeData.data.main[0]!.map((entry) => {\n\t\t\t\tif (entry.binary && isEmpty(entry.binary)) delete entry.binary;\n\t\t\t\tdelete entry.pairedItem;\n\t\t\t\treturn entry;\n\t\t\t});\n\t\t});\n\t\treturn {\n\t\t\tnodeName,\n\t\t\tresultData,\n\t\t};\n\t});\n}\n\nexport const equalityTest = async (testData: WorkflowTestData) => {\n\t// execute workflow\n\tconst { result } = await executeWorkflow(testData);\n\n\t// check if result node data matches expected test data\n\tconst resultNodeData = getResultNodeData(result, testData);\n\tresultNodeData.forEach(({ nodeName, resultData }) => {\n\t\tconst msg = `Equality failed for \"${testData.description}\" at node \"${nodeName}\"`;\n\t\tresultData.forEach((item) => {\n\t\t\titem?.forEach(({ binary, json }) => {\n\t\t\t\tif (binary) {\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tdelete binary.data.data;\n\t\t\t\t\tdelete binary.data.directory;\n\t\t\t\t}\n\n\t\t\t\t// Convert errors to JSON so tests can compare\n\t\t\t\tif (json.error instanceof Error) {\n\t\t\t\t\tjson.error = JSON.parse(\n\t\t\t\t\t\tJSON.stringify(json.error, ['message', 'name', 'description', 'context']),\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t\treturn expect(resultData, msg).toEqual(testData.output.nodeData[nodeName]);\n\t});\n\n\texpect(result.finished || result.status === 'waiting').toEqual(true);\n};\n\nconst preparePinData = (pinData: IDataObject) => {\n\tconst returnData = Object.keys(pinData).reduce(\n\t\t(acc, key) => {\n\t\t\tconst data = pinData[key] as IDataObject[];\n\t\t\tacc[key] = [data];\n\t\t\treturn acc;\n\t\t},\n\t\t{} as {\n\t\t\t[key: string]: IDataObject[][];\n\t\t},\n\t);\n\treturn returnData;\n};\n\nexport const workflowToTests = (workflowFiles: string[]) => {\n\tconst testCases: WorkflowTestData[] = [];\n\tfor (const filePath of workflowFiles) {\n\t\tconst description = filePath.replace('.json', '');\n\t\tconst workflowData = readJsonFileSync<IWorkflowBase & Pick<WorkflowTestData, 'trigger'>>(\n\t\t\tfilePath,\n\t\t);\n\t\tconst testDir = path.join(baseDir, path.dirname(filePath));\n\t\tworkflowData.nodes.forEach((node) => {\n\t\t\tif (node.parameters) {\n\t\t\t\tnode.parameters = JSON.parse(\n\t\t\t\t\tJSON.stringify(node.parameters).replace(/\"C:\\\\\\\\Test\\\\\\\\(.*)\"/, `\"${testDir}/$1\"`),\n\t\t\t\t);\n\t\t\t}\n\t\t});\n\t\tif (workflowData.pinData === undefined) {\n\t\t\tthrow new ApplicationError('Workflow data does not contain pinData', { level: 'warning' });\n\t\t}\n\n\t\tconst nodeData = preparePinData(workflowData.pinData);\n\t\tdelete workflowData.pinData;\n\n\t\tconst { trigger } = workflowData;\n\t\tdelete workflowData.trigger;\n\n\t\tconst input = { workflowData };\n\t\tconst output = { nodeData };\n\n\t\ttestCases.push({ description, input, output, trigger });\n\t}\n\treturn testCases;\n};\n\nexport const testWorkflows = (workflows: string[]) => {\n\tconst tests = workflowToTests(workflows);\n\n\tfor (const testData of tests) {\n\t\ttest(testData.description, async () => await equalityTest(testData));\n\t}\n};\n\nexport const getWorkflowFilenames = (dirname: string) => {\n\tconst workflows: string[] = [];\n\n\tconst filenames = readdirSync(dirname);\n\tconst testFolder = dirname.split(`${path.sep}nodes-base${path.sep}`)[1];\n\tfilenames.forEach((file) => {\n\t\tif (file.endsWith('.json')) {\n\t\t\tworkflows.push(path.join(testFolder, file));\n\t\t}\n\t});\n\n\treturn workflows;\n};\n\nexport const createMockExecuteFunction = <T = IExecuteFunctions>(\n\tnodeParameters: IDataObject,\n\tnodeMock: INode,\n\tcontinueBool = false,\n) => {\n\tconst fakeExecuteFunction = {\n\t\tgetNodeParameter(\n\t\t\tparameterName: string,\n\t\t\t_itemIndex: number,\n\t\t\tfallbackValue?: IDataObject | undefined,\n\t\t\toptions?: IGetNodeParameterOptions | undefined,\n\t\t) {\n\t\t\tconst parameter = options?.extractValue ? `${parameterName}.value` : parameterName;\n\t\t\treturn get(nodeParameters, parameter, fallbackValue);\n\t\t},\n\t\tgetNode() {\n\t\t\treturn nodeMock;\n\t\t},\n\t\tcontinueOnFail() {\n\t\t\treturn continueBool;\n\t\t},\n\t\thelpers: {\n\t\t\tconstructExecutionMetaData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AAQ,QAAQ,CAAC;AAAA,EACvD;AACA,SAAO;AACR;AAEO,MAAM,gBAAgB,CAAC,cAAwB;AACrD,QAAM,QAAQ,gBAAgB,SAAS;AAEvC,aAAW,YAAY,OAAO;AAC7B,SAAK,SAAS,aAAa,YAAY,MAAM,aAAa,QAAQ,CAAC;AAAA,EACpE;AACD;AAEO,MAAM,uBAAuB,CAAC,YAAoB;AACxD,QAAM,YAAsB,CAAC;AAE7B,QAAM,gBAAY,uBAAY,OAAO;AACrC,QAAM,aAAa,QAAQ,MAAM,GAAG,YAAAA,QAAK,GAAG,aAAa,YAAAA,QAAK,GAAG,EAAE,EAAE,CAAC;AACtE,YAAU,QAAQ,CAAC,SAAS;AAC3B,QAAI,KAAK,SAAS,OAAO,GAAG;AAC3B,gBAAU,KAAK,YAAAA,QAAK,KAAK,YAAY,IAAI,CAAC;AAAA,IAC3C;AAAA,EACD,CAAC;AAED,SAAO;AACR;AAEO,MAAM,4BAA4B,CACxC,gBACA,UACA,eAAe,UACX;AACJ,QAAM,sBAAsB;AAAA,IAC3B,iBACC,eACA,YACA,eACA,SACC;AACD,YAAM,YAAY,SAAS,eAAe,GAAG,aAAa,WAAW;AACrE,iBAAO,mBAAI,gBAAgB,WAAW,aAAa;AAAA,IACpD;AAAA,IACA,UAAU;AACT,aAAO;AAAA,IACR;AAAA,IACA,iBAAiB;AAChB,aAAO;AAAA,IACR;AAAA,IACA,SAAS;AAAA,MACR;AAAA,IACD;AAAA,EACD;AACA,SAAO;AACR;","names":["import_lodash","path","nock","error"]}
1
+ {"version":3,"sources":["../../../test/nodes/Helpers.ts"],"sourcesContent":["import { Container } from '@n8n/di';\nimport { readFileSync, readdirSync, mkdtempSync } from 'fs';\nimport { get } from 'lodash';\nimport { isEmpty } from 'lodash';\nimport { BinaryDataService, constructExecutionMetaData } from 'n8n-core';\nimport type {\n\tIDataObject,\n\tIExecuteFunctions,\n\tIGetNodeParameterOptions,\n\tINode,\n\tIRun,\n\tIWorkflowBase,\n\tWorkflowTestData,\n} from 'n8n-workflow';\nimport { ApplicationError } from 'n8n-workflow';\nimport nock from 'nock';\nimport { tmpdir } from 'os';\nimport path from 'path';\n\nimport { executeWorkflow } from './ExecuteWorkflow';\nimport { LoadNodesAndCredentials } from './load-nodes-and-credentials';\n\nconst baseDir = path.resolve(__dirname, '../..');\n\nexport const readJsonFileSync = <T = any>(filePath: string) =>\n\tJSON.parse(readFileSync(path.join(baseDir, filePath), 'utf-8')) as T;\n\nconst loadNodesAndCredentials = new LoadNodesAndCredentials(baseDir);\nContainer.set(LoadNodesAndCredentials, loadNodesAndCredentials);\n\nbeforeAll(async () => await loadNodesAndCredentials.init());\nbeforeEach(() => nock.disableNetConnect());\n\nexport function createTemporaryDir(prefix = 'n8n') {\n\treturn mkdtempSync(path.join(tmpdir(), prefix));\n}\n\nexport async function initBinaryDataService() {\n\tconst binaryDataService = new BinaryDataService();\n\tawait binaryDataService.init({\n\t\tmode: 'default',\n\t\tavailableModes: ['default'],\n\t\tlocalStoragePath: createTemporaryDir(),\n\t});\n\tContainer.set(BinaryDataService, binaryDataService);\n}\n\nexport function getResultNodeData(result: IRun, testData: WorkflowTestData) {\n\treturn Object.keys(testData.output.nodeData).map((nodeName) => {\n\t\tconst error = result.data.resultData.error;\n\t\t// If there was an error running the workflow throw it for easier debugging\n\t\t// and to surface all issues\n\t\tif (error?.cause) throw error.cause;\n\t\tif (error) throw error;\n\n\t\tif (result.data.resultData.runData[nodeName] === undefined) {\n\t\t\t// log errors from other nodes\n\t\t\tObject.keys(result.data.resultData.runData).forEach((key) => {\n\t\t\t\tconst error = result.data.resultData.runData[key][0]?.error;\n\t\t\t\tif (error) {\n\t\t\t\t\tconsole.log(`Node ${key}\\n`, error);\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tthrow new ApplicationError(`Data for node \"${nodeName}\" is missing!`, { level: 'warning' });\n\t\t}\n\t\tconst resultData = result.data.resultData.runData[nodeName].map((nodeData) => {\n\t\t\tif (nodeData.data === undefined) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn nodeData.data.main[0]!.map((entry) => {\n\t\t\t\tif (entry.binary && isEmpty(entry.binary)) delete entry.binary;\n\t\t\t\tdelete entry.pairedItem;\n\t\t\t\treturn entry;\n\t\t\t});\n\t\t});\n\t\treturn {\n\t\t\tnodeName,\n\t\t\tresultData,\n\t\t};\n\t});\n}\n\nexport const equalityTest = async (testData: WorkflowTestData) => {\n\t// execute workflow\n\tconst { result } = await executeWorkflow(testData);\n\n\t// check if result node data matches expected test data\n\tconst resultNodeData = getResultNodeData(result, testData);\n\tresultNodeData.forEach(({ nodeName, resultData }) => {\n\t\tconst msg = `Equality failed for \"${testData.description}\" at node \"${nodeName}\"`;\n\t\tresultData.forEach((item) => {\n\t\t\titem?.forEach(({ binary, json }) => {\n\t\t\t\tif (binary) {\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tdelete binary.data.data;\n\t\t\t\t\tdelete binary.data.directory;\n\t\t\t\t}\n\n\t\t\t\t// Convert errors to JSON so tests can compare\n\t\t\t\tif (json?.error instanceof Error) {\n\t\t\t\t\tjson.error = JSON.parse(\n\t\t\t\t\t\tJSON.stringify(json.error, ['message', 'name', 'description', 'context']),\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t\treturn expect(resultData, msg).toEqual(testData.output.nodeData[nodeName]);\n\t});\n\n\texpect(result.finished || result.status === 'waiting').toEqual(true);\n};\n\nconst preparePinData = (pinData: IDataObject) => {\n\tconst returnData = Object.keys(pinData).reduce(\n\t\t(acc, key) => {\n\t\t\tconst data = pinData[key] as IDataObject[];\n\t\t\tacc[key] = [data];\n\t\t\treturn acc;\n\t\t},\n\t\t{} as {\n\t\t\t[key: string]: IDataObject[][];\n\t\t},\n\t);\n\treturn returnData;\n};\n\nexport const workflowToTests = (workflowFiles: string[]) => {\n\tconst testCases: WorkflowTestData[] = [];\n\tfor (const filePath of workflowFiles) {\n\t\tconst description = filePath.replace('.json', '');\n\t\tconst workflowData = readJsonFileSync<IWorkflowBase & Pick<WorkflowTestData, 'trigger'>>(\n\t\t\tfilePath,\n\t\t);\n\t\tconst testDir = path.join(baseDir, path.dirname(filePath));\n\t\tworkflowData.nodes.forEach((node) => {\n\t\t\tif (node.parameters) {\n\t\t\t\tnode.parameters = JSON.parse(\n\t\t\t\t\tJSON.stringify(node.parameters).replace(/\"C:\\\\\\\\Test\\\\\\\\(.*)\"/, `\"${testDir}/$1\"`),\n\t\t\t\t);\n\t\t\t}\n\t\t});\n\t\tif (workflowData.pinData === undefined) {\n\t\t\tthrow new ApplicationError('Workflow data does not contain pinData', { level: 'warning' });\n\t\t}\n\n\t\tconst nodeData = preparePinData(workflowData.pinData);\n\t\tdelete workflowData.pinData;\n\n\t\tconst { trigger } = workflowData;\n\t\tdelete workflowData.trigger;\n\n\t\tconst input = { workflowData };\n\t\tconst output = { nodeData };\n\n\t\ttestCases.push({ description, input, output, trigger });\n\t}\n\treturn testCases;\n};\n\nexport const testWorkflows = (workflows: string[]) => {\n\tconst tests = workflowToTests(workflows);\n\n\tfor (const testData of tests) {\n\t\ttest(testData.description, async () => await equalityTest(testData));\n\t}\n};\n\nexport const getWorkflowFilenames = (dirname: string) => {\n\tconst workflows: string[] = [];\n\n\tconst filenames = readdirSync(dirname);\n\tconst testFolder = dirname.split(`${path.sep}nodes-base${path.sep}`)[1];\n\tfilenames.forEach((file) => {\n\t\tif (file.endsWith('.json')) {\n\t\t\tworkflows.push(path.join(testFolder, file));\n\t\t}\n\t});\n\n\treturn workflows;\n};\n\nexport const createMockExecuteFunction = <T = IExecuteFunctions>(\n\tnodeParameters: IDataObject,\n\tnodeMock: INode,\n\tcontinueBool = false,\n) => {\n\tconst fakeExecuteFunction = {\n\t\tgetNodeParameter(\n\t\t\tparameterName: string,\n\t\t\t_itemIndex: number,\n\t\t\tfallbackValue?: IDataObject | undefined,\n\t\t\toptions?: IGetNodeParameterOptions | undefined,\n\t\t) {\n\t\t\tconst parameter = options?.extractValue ? `${parameterName}.value` : parameterName;\n\t\t\treturn get(nodeParameters, parameter, fallbackValue);\n\t\t},\n\t\tgetNode() {\n\t\t\treturn nodeMock;\n\t\t},\n\t\tcontinueOnFail() {\n\t\t\treturn continueBool;\n\t\t},\n\t\thelpers: {\n\t\t\tconstructExecutionMetaData,\n\t\t},\n\t} as unknown as T;\n\treturn fakeExecuteFunction;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gBAA0B;AAC1B,gBAAuD;AACvD,oBAAoB;AACpB,IAAAA,iBAAwB;AACxB,sBAA8D;AAU9D,0BAAiC;AACjC,kBAAiB;AACjB,gBAAuB;AACvB,kBAAiB;AAEjB,6BAAgC;AAChC,wCAAwC;AAExC,MAAM,UAAU,YAAAC,QAAK,QAAQ,WAAW,OAAO;AAExC,MAAM,mBAAmB,CAAU,aACzC,KAAK,UAAM,wBAAa,YAAAA,QAAK,KAAK,SAAS,QAAQ,GAAG,OAAO,CAAC;AAE/D,MAAM,0BAA0B,IAAI,0DAAwB,OAAO;AACnE,oBAAU,IAAI,2DAAyB,uBAAuB;AAE9D,UAAU,YAAY,MAAM,wBAAwB,KAAK,CAAC;AAC1D,WAAW,MAAM,YAAAC,QAAK,kBAAkB,CAAC;AAElC,SAAS,mBAAmB,SAAS,OAAO;AAClD,aAAO,uBAAY,YAAAD,QAAK,SAAK,kBAAO,GAAG,MAAM,CAAC;AAC/C;AAEA,eAAsB,wBAAwB;AAC7C,QAAM,oBAAoB,IAAI,kCAAkB;AAChD,QAAM,kBAAkB,KAAK;AAAA,IAC5B,MAAM;AAAA,IACN,gBAAgB,CAAC,SAAS;AAAA,IAC1B,kBAAkB,mBAAmB;AAAA,EACtC,CAAC;AACD,sBAAU,IAAI,mCAAmB,iBAAiB;AACnD;AAEO,SAAS,kBAAkB,QAAc,UAA4B;AAC3E,SAAO,OAAO,KA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