n8n-nodes-base 1.94.0 → 1.95.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.
- package/dist/credentials/GithubOAuth2Api.credentials.js +2 -2
- package/dist/credentials/GithubOAuth2Api.credentials.js.map +1 -1
- package/dist/credentials/MicrosoftSharePointOAuth2Api.credentials.js +9 -0
- package/dist/credentials/MicrosoftSharePointOAuth2Api.credentials.js.map +1 -1
- package/dist/credentials/PerplexityApi.credentials.js +70 -0
- package/dist/credentials/PerplexityApi.credentials.js.map +1 -0
- package/dist/credentials/icons/microsoftSharePoint.svg +59 -0
- package/dist/known/credentials.json +7 -0
- package/dist/known/nodes.json +4 -0
- package/dist/nodes/Evaluation/EvaluationTrigger/EvaluationTrigger.node.ee.js +12 -22
- package/dist/nodes/Evaluation/EvaluationTrigger/EvaluationTrigger.node.ee.js.map +1 -1
- package/dist/nodes/JinaAI/JinaAi.node.js +1 -1
- package/dist/nodes/JinaAI/JinaAi.node.js.map +1 -1
- package/dist/nodes/Perplexity/GenericFunctions.js +49 -0
- package/dist/nodes/Perplexity/GenericFunctions.js.map +1 -0
- package/dist/nodes/Perplexity/Perplexity.node.js +78 -0
- package/dist/nodes/Perplexity/Perplexity.node.js.map +1 -0
- package/dist/nodes/Perplexity/Perplexity.node.json +18 -0
- package/dist/nodes/Perplexity/descriptions/chat/Chat.resource.js +72 -0
- package/dist/nodes/Perplexity/descriptions/chat/Chat.resource.js.map +1 -0
- package/dist/nodes/Perplexity/descriptions/chat/complete.operation.js +328 -0
- package/dist/nodes/Perplexity/descriptions/chat/complete.operation.js.map +1 -0
- package/dist/nodes/Perplexity/descriptions/index.js +39 -0
- package/dist/nodes/Perplexity/descriptions/index.js.map +1 -0
- package/dist/nodes/Perplexity/perplexity.svg +35 -0
- package/dist/nodes/RespondToWebhook/RespondToWebhook.node.js +14 -3
- package/dist/nodes/RespondToWebhook/RespondToWebhook.node.js.map +1 -1
- package/dist/nodes/RespondToWebhook/utils.js +3 -2
- package/dist/nodes/RespondToWebhook/utils.js.map +1 -1
- package/dist/nodes/Telegram/Telegram.node.js +1 -1
- package/dist/nodes/Telegram/Telegram.node.js.map +1 -1
- package/dist/nodes/Transform/Sort/Sort.node.js +2 -2
- package/dist/nodes/Transform/Sort/Sort.node.js.map +1 -1
- package/dist/types/credentials.json +3 -2
- package/dist/types/nodes.json +7 -6
- package/package.json +12 -9
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../nodes/Transform/Sort/Sort.node.ts"],"sourcesContent":["import get from 'lodash/get';\nimport isEqual from 'lodash/isEqual';\nimport lt from 'lodash/lt';\nimport {\n\tNodeOperationError,\n\ttype IDataObject,\n\ttype IExecuteFunctions,\n\ttype INodeExecutionData,\n\ttype INodeType,\n\ttype INodeTypeDescription,\n\tNodeConnectionTypes,\n} from 'n8n-workflow';\n\nimport { shuffleArray } from '@utils/utilities';\n\nimport { sortByCode } from './utils';\n\nexport class Sort implements INodeType {\n\tdescription: INodeTypeDescription = {\n\t\tdisplayName: 'Sort',\n\t\tname: 'sort',\n\t\ticon: 'file:sort.svg',\n\t\tgroup: ['transform'],\n\t\tsubtitle: '',\n\t\tversion: 1,\n\t\tdescription: 'Change items order',\n\t\tdefaults: {\n\t\t\tname: 'Sort',\n\t\t},\n\t\tinputs: [NodeConnectionTypes.Main],\n\t\toutputs: [NodeConnectionTypes.Main],\n\t\tproperties: [\n\t\t\t{\n\t\t\t\tdisplayName: 'Type',\n\t\t\t\tname: 'type',\n\t\t\t\ttype: 'options',\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Simple',\n\t\t\t\t\t\tvalue: 'simple',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Random',\n\t\t\t\t\t\tvalue: 'random',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Code',\n\t\t\t\t\t\tvalue: 'code',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\tdefault: 'simple',\n\t\t\t\tdescription: 'The fields of the input items to compare to see if they are the same',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Fields To Sort By',\n\t\t\t\tname: 'sortFieldsUi',\n\t\t\t\ttype: 'fixedCollection',\n\t\t\t\ttypeOptions: {\n\t\t\t\t\tmultipleValues: true,\n\t\t\t\t},\n\t\t\t\tplaceholder: 'Add Field To Sort By',\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayName: '',\n\t\t\t\t\t\tname: 'sortField',\n\t\t\t\t\t\tvalues: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tdisplayName: 'Field Name',\n\t\t\t\t\t\t\t\tname: 'fieldName',\n\t\t\t\t\t\t\t\ttype: 'string',\n\t\t\t\t\t\t\t\trequired: true,\n\t\t\t\t\t\t\t\tdefault: '',\n\t\t\t\t\t\t\t\tdescription: 'The field to sort by',\n\t\t\t\t\t\t\t\t// eslint-disable-next-line n8n-nodes-base/node-param-placeholder-miscased-id\n\t\t\t\t\t\t\t\tplaceholder: 'e.g. id',\n\t\t\t\t\t\t\t\thint: ' Enter the field name as text',\n\t\t\t\t\t\t\t\trequiresDataPath: 'single',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tdisplayName: 'Order',\n\t\t\t\t\t\t\t\tname: 'order',\n\t\t\t\t\t\t\t\ttype: 'options',\n\t\t\t\t\t\t\t\toptions: [\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tname: 'Ascending',\n\t\t\t\t\t\t\t\t\t\tvalue: 'ascending',\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tname: 'Descending',\n\t\t\t\t\t\t\t\t\t\tvalue: 'descending',\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\tdefault: 'ascending',\n\t\t\t\t\t\t\t\tdescription: 'The order to sort by',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\tdefault: {},\n\t\t\t\tdescription: 'The fields of the input items to compare to see if they are the same',\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: {\n\t\t\t\t\t\ttype: ['simple'],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Code',\n\t\t\t\tname: 'code',\n\t\t\t\ttype: 'string',\n\t\t\t\ttypeOptions: {\n\t\t\t\t\talwaysOpenEditWindow: true,\n\t\t\t\t\teditor: 'jsEditor',\n\t\t\t\t\trows: 10,\n\t\t\t\t},\n\t\t\t\tdefault: `// The two items to compare are in the variables a and b\n\t// Access the fields in a.json and b.json\n\t// Return -1 if a should go before b\n\t// Return 1 if b should go before a\n\t// Return 0 if there's no difference\n\n\tfieldName = 'myField';\n\n\tif (a.json[fieldName] < b.json[fieldName]) {\n\treturn -1;\n\t}\n\tif (a.json[fieldName] > b.json[fieldName]) {\n\treturn 1;\n\t}\n\treturn 0;`,\n\t\t\t\tdescription: 'Javascript code to determine the order of any two items',\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: {\n\t\t\t\t\t\ttype: ['code'],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Options',\n\t\t\t\tname: 'options',\n\t\t\t\ttype: 'collection',\n\t\t\t\tplaceholder: 'Add Field',\n\t\t\t\tdefault: {},\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: {\n\t\t\t\t\t\ttype: ['simple'],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayName: 'Disable Dot Notation',\n\t\t\t\t\t\tname: 'disableDotNotation',\n\t\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\t\tdefault: false,\n\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t'Whether to disallow referencing child fields using `parent.child` in the field name',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t],\n\t};\n\n\tasync execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {\n\t\tconst items = this.getInputData();\n\t\tlet returnData = [...items];\n\t\tconst type = this.getNodeParameter('type', 0) as string;\n\t\tconst disableDotNotation = this.getNodeParameter(\n\t\t\t'options.disableDotNotation',\n\t\t\t0,\n\t\t\tfalse,\n\t\t) as boolean;\n\n\t\tif (type === 'random') {\n\t\t\tshuffleArray(returnData);\n\t\t\treturn [returnData];\n\t\t}\n\n\t\tif (type === 'simple') {\n\t\t\tconst sortFieldsUi = this.getNodeParameter('sortFieldsUi', 0) as IDataObject;\n\t\t\tconst sortFields = sortFieldsUi.sortField as Array<{\n\t\t\t\tfieldName: string;\n\t\t\t\torder: 'ascending' | 'descending';\n\t\t\t}>;\n\n\t\t\tif (!sortFields?.length) {\n\t\t\t\tthrow new NodeOperationError(\n\t\t\t\t\tthis.getNode(),\n\t\t\t\t\t'No sorting specified. Please add a field to sort by',\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tfor (const { fieldName } of sortFields) {\n\t\t\t\tlet found = false;\n\t\t\t\tfor (const item of items) {\n\t\t\t\t\tif (!disableDotNotation) {\n\t\t\t\t\t\tif (get(item.json, fieldName) !== undefined) {\n\t\t\t\t\t\t\tfound = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (item.json.hasOwnProperty(fieldName)) {\n\t\t\t\t\t\tfound = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (!found && disableDotNotation && fieldName.includes('.')) {\n\t\t\t\t\tthrow new NodeOperationError(\n\t\t\t\t\t\tthis.getNode(),\n\t\t\t\t\t\t`Couldn't find the field '${fieldName}' in the input data`,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t\t\"If you're trying to use a nested field, make sure you turn off 'disable dot notation' in the node options\",\n\t\t\t\t\t\t},\n\t\t\t\t\t);\n\t\t\t\t} else if (!found) {\n\t\t\t\t\tthrow new NodeOperationError(\n\t\t\t\t\t\tthis.getNode(),\n\t\t\t\t\t\t`Couldn't find the field '${fieldName}' in the input data`,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst sortFieldsWithDirection = sortFields.map((field) => ({\n\t\t\t\tname: field.fieldName,\n\t\t\t\tdir: field.order === 'ascending' ? 1 : -1,\n\t\t\t}));\n\n\t\t\treturnData.sort((a, b) => {\n\t\t\t\tlet result = 0;\n\t\t\t\tfor (const field of sortFieldsWithDirection) {\n\t\t\t\t\tlet equal;\n\t\t\t\t\tif (!disableDotNotation) {\n\t\t\t\t\t\tconst _a =\n\t\t\t\t\t\t\ttypeof get(a.json, field.name) === 'string'\n\t\t\t\t\t\t\t\t? (get(a.json, field.name) as string).toLowerCase()\n\t\t\t\t\t\t\t\t: get(a.json, field.name);\n\t\t\t\t\t\tconst _b =\n\t\t\t\t\t\t\ttypeof get(b.json, field.name) === 'string'\n\t\t\t\t\t\t\t\t? (get(b.json, field.name) as string).toLowerCase()\n\t\t\t\t\t\t\t\t: get(b.json, field.name);\n\t\t\t\t\t\tequal = isEqual(_a, _b);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconst _a =\n\t\t\t\t\t\t\ttypeof a.json[field.name] === 'string'\n\t\t\t\t\t\t\t\t? (a.json[field.name] as string).toLowerCase()\n\t\t\t\t\t\t\t\t: a.json[field.name];\n\t\t\t\t\t\tconst _b =\n\t\t\t\t\t\t\ttypeof b.json[field.name] === 'string'\n\t\t\t\t\t\t\t\t? (b.json[field.name] as string).toLowerCase()\n\t\t\t\t\t\t\t\t: b.json[field.name];\n\t\t\t\t\t\tequal = isEqual(_a, _b);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!equal) {\n\t\t\t\t\t\tlet lessThan;\n\t\t\t\t\t\tif (!disableDotNotation) {\n\t\t\t\t\t\t\tconst _a =\n\t\t\t\t\t\t\t\ttypeof get(a.json, field.name) === 'string'\n\t\t\t\t\t\t\t\t\t? (get(a.json, field.name) as string).toLowerCase()\n\t\t\t\t\t\t\t\t\t: get(a.json, field.name);\n\t\t\t\t\t\t\tconst _b =\n\t\t\t\t\t\t\t\ttypeof get(b.json, field.name) === 'string'\n\t\t\t\t\t\t\t\t\t? (get(b.json, field.name) as string).toLowerCase()\n\t\t\t\t\t\t\t\t\t: get(b.json, field.name);\n\t\t\t\t\t\t\tlessThan = lt(_a, _b);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tconst _a =\n\t\t\t\t\t\t\t\ttypeof a.json[field.name] === 'string'\n\t\t\t\t\t\t\t\t\t? (a.json[field.name] as string).toLowerCase()\n\t\t\t\t\t\t\t\t\t: a.json[field.name];\n\t\t\t\t\t\t\tconst _b =\n\t\t\t\t\t\t\t\ttypeof b.json[field.name] === 'string'\n\t\t\t\t\t\t\t\t\t? (b.json[field.name] as string).toLowerCase()\n\t\t\t\t\t\t\t\t\t: b.json[field.name];\n\t\t\t\t\t\t\tlessThan = lt(_a, _b);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (lessThan) {\n\t\t\t\t\t\t\tresult = -1 * field.dir;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tresult = 1 * field.dir;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn result;\n\t\t\t});\n\t\t} else {\n\t\t\treturnData = sortByCode.call(this, returnData);\n\t\t}\n\t\treturn [returnData];\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAAgB;AAChB,qBAAoB;AACpB,gBAAe;AACf,0BAQO;AAEP,uBAA6B;AAE7B,mBAA2B;AAEpB,MAAM,KAA0B;AAAA,EAAhC;AACN,uB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AAAA,YACrB;AACA,gBAAI,UAAU;AACb,uBAAS,KAAK,MAAM;AAAA,YACrB,OAAO;AACN,uBAAS,IAAI,MAAM;AAAA,YACpB;AACA;AAAA,UACD;AAAA,QACD;AACA,eAAO;AAAA,MACR,CAAC;AAAA,IACF,OAAO;AACN,mBAAa,wBAAW,KAAK,MAAM,UAAU;AAAA,IAC9C;AACA,WAAO,CAAC,UAAU;AAAA,EACnB;AACD;","names":["get","isEqual","lt"]}
|
|
1
|
+
{"version":3,"sources":["../../../../nodes/Transform/Sort/Sort.node.ts"],"sourcesContent":["import get from 'lodash/get';\nimport isEqual from 'lodash/isEqual';\nimport lt from 'lodash/lt';\nimport {\n\tNodeOperationError,\n\ttype IDataObject,\n\ttype IExecuteFunctions,\n\ttype INodeExecutionData,\n\ttype INodeType,\n\ttype INodeTypeDescription,\n\tNodeConnectionTypes,\n} from 'n8n-workflow';\n\nimport { shuffleArray } from '@utils/utilities';\n\nimport { sortByCode } from './utils';\n\nexport class Sort implements INodeType {\n\tdescription: INodeTypeDescription = {\n\t\tdisplayName: 'Sort',\n\t\tname: 'sort',\n\t\ticon: 'file:sort.svg',\n\t\tgroup: ['transform'],\n\t\tsubtitle: '',\n\t\tversion: 1,\n\t\tdescription: 'Change items order',\n\t\tdefaults: {\n\t\t\tname: 'Sort',\n\t\t},\n\t\tinputs: [NodeConnectionTypes.Main],\n\t\toutputs: [NodeConnectionTypes.Main],\n\t\tproperties: [\n\t\t\t{\n\t\t\t\tdisplayName: 'Type',\n\t\t\t\tname: 'type',\n\t\t\t\ttype: 'options',\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Simple',\n\t\t\t\t\t\tvalue: 'simple',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Random',\n\t\t\t\t\t\tvalue: 'random',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Code',\n\t\t\t\t\t\tvalue: 'code',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\tdefault: 'simple',\n\t\t\t\tdescription: 'The type of sorting to perform',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Fields To Sort By',\n\t\t\t\tname: 'sortFieldsUi',\n\t\t\t\ttype: 'fixedCollection',\n\t\t\t\ttypeOptions: {\n\t\t\t\t\tmultipleValues: true,\n\t\t\t\t},\n\t\t\t\tplaceholder: 'Add Field To Sort By',\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayName: '',\n\t\t\t\t\t\tname: 'sortField',\n\t\t\t\t\t\tvalues: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tdisplayName: 'Field Name',\n\t\t\t\t\t\t\t\tname: 'fieldName',\n\t\t\t\t\t\t\t\ttype: 'string',\n\t\t\t\t\t\t\t\trequired: true,\n\t\t\t\t\t\t\t\tdefault: '',\n\t\t\t\t\t\t\t\tdescription: 'The field to sort by',\n\t\t\t\t\t\t\t\t// eslint-disable-next-line n8n-nodes-base/node-param-placeholder-miscased-id\n\t\t\t\t\t\t\t\tplaceholder: 'e.g. id',\n\t\t\t\t\t\t\t\thint: ' Enter the field name as text',\n\t\t\t\t\t\t\t\trequiresDataPath: 'single',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tdisplayName: 'Order',\n\t\t\t\t\t\t\t\tname: 'order',\n\t\t\t\t\t\t\t\ttype: 'options',\n\t\t\t\t\t\t\t\toptions: [\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tname: 'Ascending',\n\t\t\t\t\t\t\t\t\t\tvalue: 'ascending',\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tname: 'Descending',\n\t\t\t\t\t\t\t\t\t\tvalue: 'descending',\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\tdefault: 'ascending',\n\t\t\t\t\t\t\t\tdescription: 'The order to sort by',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\tdefault: {},\n\t\t\t\tdescription: 'The fields of the input items to sort by',\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: {\n\t\t\t\t\t\ttype: ['simple'],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Code',\n\t\t\t\tname: 'code',\n\t\t\t\ttype: 'string',\n\t\t\t\ttypeOptions: {\n\t\t\t\t\talwaysOpenEditWindow: true,\n\t\t\t\t\teditor: 'jsEditor',\n\t\t\t\t\trows: 10,\n\t\t\t\t},\n\t\t\t\tdefault: `// The two items to compare are in the variables a and b\n\t// Access the fields in a.json and b.json\n\t// Return -1 if a should go before b\n\t// Return 1 if b should go before a\n\t// Return 0 if there's no difference\n\n\tfieldName = 'myField';\n\n\tif (a.json[fieldName] < b.json[fieldName]) {\n\treturn -1;\n\t}\n\tif (a.json[fieldName] > b.json[fieldName]) {\n\treturn 1;\n\t}\n\treturn 0;`,\n\t\t\t\tdescription: 'Javascript code to determine the order of any two items',\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: {\n\t\t\t\t\t\ttype: ['code'],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Options',\n\t\t\t\tname: 'options',\n\t\t\t\ttype: 'collection',\n\t\t\t\tplaceholder: 'Add Field',\n\t\t\t\tdefault: {},\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: {\n\t\t\t\t\t\ttype: ['simple'],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayName: 'Disable Dot Notation',\n\t\t\t\t\t\tname: 'disableDotNotation',\n\t\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\t\tdefault: false,\n\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t'Whether to disallow referencing child fields using `parent.child` in the field name',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t],\n\t};\n\n\tasync execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {\n\t\tconst items = this.getInputData();\n\t\tlet returnData = [...items];\n\t\tconst type = this.getNodeParameter('type', 0) as string;\n\t\tconst disableDotNotation = this.getNodeParameter(\n\t\t\t'options.disableDotNotation',\n\t\t\t0,\n\t\t\tfalse,\n\t\t) as boolean;\n\n\t\tif (type === 'random') {\n\t\t\tshuffleArray(returnData);\n\t\t\treturn [returnData];\n\t\t}\n\n\t\tif (type === 'simple') {\n\t\t\tconst sortFieldsUi = this.getNodeParameter('sortFieldsUi', 0) as IDataObject;\n\t\t\tconst sortFields = sortFieldsUi.sortField as Array<{\n\t\t\t\tfieldName: string;\n\t\t\t\torder: 'ascending' | 'descending';\n\t\t\t}>;\n\n\t\t\tif (!sortFields?.length) {\n\t\t\t\tthrow new NodeOperationError(\n\t\t\t\t\tthis.getNode(),\n\t\t\t\t\t'No sorting specified. Please add a field to sort by',\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tfor (const { fieldName } of sortFields) {\n\t\t\t\tlet found = false;\n\t\t\t\tfor (const item of items) {\n\t\t\t\t\tif (!disableDotNotation) {\n\t\t\t\t\t\tif (get(item.json, fieldName) !== undefined) {\n\t\t\t\t\t\t\tfound = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (item.json.hasOwnProperty(fieldName)) {\n\t\t\t\t\t\tfound = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (!found && disableDotNotation && fieldName.includes('.')) {\n\t\t\t\t\tthrow new NodeOperationError(\n\t\t\t\t\t\tthis.getNode(),\n\t\t\t\t\t\t`Couldn't find the field '${fieldName}' in the input data`,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t\t\"If you're trying to use a nested field, make sure you turn off 'disable dot notation' in the node options\",\n\t\t\t\t\t\t},\n\t\t\t\t\t);\n\t\t\t\t} else if (!found) {\n\t\t\t\t\tthrow new NodeOperationError(\n\t\t\t\t\t\tthis.getNode(),\n\t\t\t\t\t\t`Couldn't find the field '${fieldName}' in the input data`,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst sortFieldsWithDirection = sortFields.map((field) => ({\n\t\t\t\tname: field.fieldName,\n\t\t\t\tdir: field.order === 'ascending' ? 1 : -1,\n\t\t\t}));\n\n\t\t\treturnData.sort((a, b) => {\n\t\t\t\tlet result = 0;\n\t\t\t\tfor (const field of sortFieldsWithDirection) {\n\t\t\t\t\tlet equal;\n\t\t\t\t\tif (!disableDotNotation) {\n\t\t\t\t\t\tconst _a =\n\t\t\t\t\t\t\ttypeof get(a.json, field.name) === 'string'\n\t\t\t\t\t\t\t\t? (get(a.json, field.name) as string).toLowerCase()\n\t\t\t\t\t\t\t\t: get(a.json, field.name);\n\t\t\t\t\t\tconst _b =\n\t\t\t\t\t\t\ttypeof get(b.json, field.name) === 'string'\n\t\t\t\t\t\t\t\t? (get(b.json, field.name) as string).toLowerCase()\n\t\t\t\t\t\t\t\t: get(b.json, field.name);\n\t\t\t\t\t\tequal = isEqual(_a, _b);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconst _a =\n\t\t\t\t\t\t\ttypeof a.json[field.name] === 'string'\n\t\t\t\t\t\t\t\t? (a.json[field.name] as string).toLowerCase()\n\t\t\t\t\t\t\t\t: a.json[field.name];\n\t\t\t\t\t\tconst _b =\n\t\t\t\t\t\t\ttypeof b.json[field.name] === 'string'\n\t\t\t\t\t\t\t\t? (b.json[field.name] as string).toLowerCase()\n\t\t\t\t\t\t\t\t: b.json[field.name];\n\t\t\t\t\t\tequal = isEqual(_a, _b);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!equal) {\n\t\t\t\t\t\tlet lessThan;\n\t\t\t\t\t\tif (!disableDotNotation) {\n\t\t\t\t\t\t\tconst _a =\n\t\t\t\t\t\t\t\ttypeof get(a.json, field.name) === 'string'\n\t\t\t\t\t\t\t\t\t? (get(a.json, field.name) as string).toLowerCase()\n\t\t\t\t\t\t\t\t\t: get(a.json, field.name);\n\t\t\t\t\t\t\tconst _b =\n\t\t\t\t\t\t\t\ttypeof get(b.json, field.name) === 'string'\n\t\t\t\t\t\t\t\t\t? (get(b.json, field.name) as string).toLowerCase()\n\t\t\t\t\t\t\t\t\t: get(b.json, field.name);\n\t\t\t\t\t\t\tlessThan = lt(_a, _b);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tconst _a =\n\t\t\t\t\t\t\t\ttypeof a.json[field.name] === 'string'\n\t\t\t\t\t\t\t\t\t? (a.json[field.name] as string).toLowerCase()\n\t\t\t\t\t\t\t\t\t: a.json[field.name];\n\t\t\t\t\t\t\tconst _b =\n\t\t\t\t\t\t\t\ttypeof b.json[field.name] === 'string'\n\t\t\t\t\t\t\t\t\t? (b.json[field.name] as string).toLowerCase()\n\t\t\t\t\t\t\t\t\t: b.json[field.name];\n\t\t\t\t\t\t\tlessThan = lt(_a, _b);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (lessThan) {\n\t\t\t\t\t\t\tresult = -1 * field.dir;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tresult = 1 * field.dir;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn result;\n\t\t\t});\n\t\t} else {\n\t\t\treturnData = sortByCode.call(this, returnData);\n\t\t}\n\t\treturn [returnData];\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAAgB;AAChB,qBAAoB;AACpB,gBAAe;AACf,0BAQO;AAEP,uBAA6B;AAE7B,mBAA2B;AAEpB,MAAM,KAA0B;AAAA,EAAhC;AACN,uBAAoC;AAAA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;AACA,gBAAI,UAAU;AACb,uBAAS,KAAK,MAAM;AAAA,YACrB,OAAO;AACN,uBAAS,IAAI,MAAM;AAAA,YACpB;AACA;AAAA,UACD;AAAA,QACD;AACA,eAAO;AAAA,MACR,CAAC;AAAA,IACF,OAAO;AACN,mBAAa,wBAAW,KAAK,MAAM,UAAU;AAAA,IAC9C;AACA,WAAO,CAAC,UAAU;AAAA,EACnB;AACD;","names":["get","isEqual","lt"]}
|
|
@@ -102,7 +102,7 @@
|
|
|
102
102
|
{"name":"ghostAdminApi","displayName":"Ghost Admin API","documentationUrl":"ghost","properties":[{"displayName":"URL","name":"url","type":"string","default":"","placeholder":"http://localhost:3001"},{"displayName":"API Key","name":"apiKey","type":"string","typeOptions":{"password":true},"default":""}],"test":{"request":{"baseURL":"={{$credentials.url}}","url":"/ghost/api/v2/admin/pages/"}},"supportedNodes":["ghost"],"iconUrl":"icons/n8n-nodes-base/dist/nodes/Ghost/ghost.svg","authenticate":{}},
|
|
103
103
|
{"name":"ghostContentApi","displayName":"Ghost Content API","documentationUrl":"ghost","properties":[{"displayName":"URL","name":"url","type":"string","default":"","placeholder":"http://localhost:3001"},{"displayName":"API Key","name":"apiKey","type":"string","typeOptions":{"password":true},"default":""}],"test":{"request":{"baseURL":"={{$credentials.url}}","url":"/ghost/api/v3/content/settings/","method":"GET"}},"supportedNodes":["ghost"],"iconUrl":"icons/n8n-nodes-base/dist/nodes/Ghost/ghost.svg","authenticate":{}},
|
|
104
104
|
{"name":"githubApi","displayName":"GitHub API","documentationUrl":"github","properties":[{"displayName":"Github Server","name":"server","type":"string","default":"https://api.github.com","description":"The server to connect to. Only has to be set if Github Enterprise is used."},{"displayName":"User","name":"user","type":"string","default":""},{"displayName":"Access Token","name":"accessToken","type":"string","typeOptions":{"password":true},"default":""}],"authenticate":{"type":"generic","properties":{"headers":{"Authorization":"=token {{$credentials?.accessToken}}"}}},"test":{"request":{"baseURL":"={{$credentials?.server}}","url":"/user","method":"GET"}},"supportedNodes":["github","githubTrigger"],"iconUrl":{"light":"icons/n8n-nodes-base/dist/nodes/Github/github.svg","dark":"icons/n8n-nodes-base/dist/nodes/Github/github.dark.svg"}},
|
|
105
|
-
{"name":"githubOAuth2Api","extends":["oAuth2Api"],"displayName":"GitHub OAuth2 API","documentationUrl":"github","properties":[{"displayName":"Grant Type","name":"grantType","type":"hidden","default":"authorizationCode"},{"displayName":"Github Server","name":"server","type":"string","default":"https://api.github.com","description":"The server to connect to. Only has to be set if Github Enterprise is used."},{"displayName":"Authorization URL","name":"authUrl","type":"hidden","default":"={{$self[\"server\"] === \"https://api.github.com\" ? \"https://github.com\" : $self[\"server\"]}}/login/oauth/authorize","required":true},{"displayName":"Access Token URL","name":"accessTokenUrl","type":"hidden","default":"={{$self[\"server\"] === \"https://api.github.com\" ? \"https://github.com\" : $self[\"server\"]}}/login/oauth/access_token","required":true},{"displayName":"Scope","name":"scope","type":"hidden","default":"repo,admin:repo_hook,admin:org,admin:org_hook,gist,notifications,user,write:packages,read:packages,delete:packages,workflow"},{"displayName":"Auth URI Query Parameters","name":"authQueryParameters","type":"hidden","default":""},{"displayName":"Authentication","name":"authentication","type":"hidden","default":"header"}],"supportedNodes":["github","githubTrigger"],"iconUrl":{"light":"icons/n8n-nodes-base/dist/nodes/Github/github.svg","dark":"icons/n8n-nodes-base/dist/nodes/Github/github.dark.svg"}},
|
|
105
|
+
{"name":"githubOAuth2Api","extends":["oAuth2Api"],"displayName":"GitHub OAuth2 API","documentationUrl":"github","properties":[{"displayName":"Grant Type","name":"grantType","type":"hidden","default":"authorizationCode"},{"displayName":"Github Server","name":"server","type":"string","default":"https://api.github.com","description":"The server to connect to. Only has to be set if Github Enterprise is used."},{"displayName":"Authorization URL","name":"authUrl","type":"hidden","default":"={{$self[\"server\"] === \"https://api.github.com\" ? \"https://github.com\" : $self[\"server\"].split(\"://\")[0] + \"://\" + $self[\"server\"].split(\"://\")[1].split(\"/\")[0]}}/login/oauth/authorize","required":true},{"displayName":"Access Token URL","name":"accessTokenUrl","type":"hidden","default":"={{$self[\"server\"] === \"https://api.github.com\" ? \"https://github.com\" : $self[\"server\"].split(\"://\")[0] + \"://\" + $self[\"server\"].split(\"://\")[1].split(\"/\")[0]}}/login/oauth/access_token","required":true},{"displayName":"Scope","name":"scope","type":"hidden","default":"repo,admin:repo_hook,admin:org,admin:org_hook,gist,notifications,user,write:packages,read:packages,delete:packages,workflow"},{"displayName":"Auth URI Query Parameters","name":"authQueryParameters","type":"hidden","default":""},{"displayName":"Authentication","name":"authentication","type":"hidden","default":"header"}],"supportedNodes":["github","githubTrigger"],"iconUrl":{"light":"icons/n8n-nodes-base/dist/nodes/Github/github.svg","dark":"icons/n8n-nodes-base/dist/nodes/Github/github.dark.svg"}},
|
|
106
106
|
{"name":"gitlabApi","displayName":"GitLab API","documentationUrl":"gitlab","properties":[{"displayName":"Gitlab Server","name":"server","type":"string","default":"https://gitlab.com"},{"displayName":"Access Token","name":"accessToken","type":"string","typeOptions":{"password":true},"default":""}],"authenticate":{"type":"generic","properties":{"headers":{"Private-Token":"={{$credentials.accessToken}}"}}},"test":{"request":{"baseURL":"={{$credentials.server.replace(new RegExp(\"/$\"), \"\") + \"/api/v4\" }}","url":"/personal_access_tokens/self"}},"supportedNodes":["gitlab","gitlabTrigger"],"iconUrl":"icons/n8n-nodes-base/dist/nodes/Gitlab/gitlab.svg"},
|
|
107
107
|
{"name":"gitlabOAuth2Api","extends":["oAuth2Api"],"displayName":"GitLab OAuth2 API","documentationUrl":"gitlab","properties":[{"displayName":"Grant Type","name":"grantType","type":"hidden","default":"authorizationCode"},{"displayName":"Gitlab Server","name":"server","type":"string","default":"https://gitlab.com"},{"displayName":"Authorization URL","name":"authUrl","type":"hidden","default":"={{$self[\"server\"]}}/oauth/authorize","required":true},{"displayName":"Access Token URL","name":"accessTokenUrl","type":"hidden","default":"={{$self[\"server\"]}}/oauth/token","required":true},{"displayName":"Scope","name":"scope","type":"hidden","default":"api"},{"displayName":"Auth URI Query Parameters","name":"authQueryParameters","type":"hidden","default":""},{"displayName":"Authentication","name":"authentication","type":"hidden","default":"body"}],"supportedNodes":["gitlab","gitlabTrigger"],"iconUrl":"icons/n8n-nodes-base/dist/nodes/Gitlab/gitlab.svg"},
|
|
108
108
|
{"name":"gitPassword","displayName":"Git","documentationUrl":"git","properties":[{"displayName":"Username","name":"username","type":"string","default":"","description":"The username to authenticate with"},{"displayName":"Password","name":"password","type":"string","typeOptions":{"password":true},"default":"","description":"The password to use in combination with the user"}],"supportedNodes":["git"],"iconUrl":"icons/n8n-nodes-base/dist/nodes/Git/git.svg"},
|
|
@@ -212,7 +212,7 @@
|
|
|
212
212
|
{"name":"microsoftOAuth2Api","extends":["oAuth2Api"],"displayName":"Microsoft OAuth2 API","documentationUrl":"microsoft","properties":[{"displayName":"Grant Type","name":"grantType","type":"hidden","default":"authorizationCode"},{"displayName":"Authorization URL","name":"authUrl","type":"string","default":"https://login.microsoftonline.com/common/oauth2/v2.0/authorize"},{"displayName":"Access Token URL","name":"accessTokenUrl","type":"string","default":"https://login.microsoftonline.com/common/oauth2/v2.0/token"},{"displayName":"Auth URI Query Parameters","name":"authQueryParameters","type":"hidden","default":"response_mode=query"},{"displayName":"Authentication","name":"authentication","type":"hidden","default":"body"}],"iconUrl":"icons/n8n-nodes-base/dist/credentials/icons/Microsoft.svg","supportedNodes":[]},
|
|
213
213
|
{"name":"microsoftOneDriveOAuth2Api","extends":["microsoftOAuth2Api"],"displayName":"Microsoft Drive OAuth2 API","documentationUrl":"microsoft","properties":[{"displayName":"Scope","name":"scope","type":"hidden","default":"openid offline_access Files.ReadWrite.All"}],"supportedNodes":["microsoftOneDrive","microsoftOneDriveTrigger"],"iconUrl":"icons/n8n-nodes-base/dist/nodes/Microsoft/OneDrive/oneDrive.svg"},
|
|
214
214
|
{"name":"microsoftOutlookOAuth2Api","extends":["microsoftOAuth2Api"],"displayName":"Microsoft Outlook OAuth2 API","documentationUrl":"microsoft","properties":[{"displayName":"Scope","name":"scope","type":"hidden","default":"openid offline_access Contacts.Read Contacts.ReadWrite Calendars.Read Calendars.Read.Shared Calendars.ReadWrite Mail.ReadWrite Mail.ReadWrite.Shared Mail.Send Mail.Send.Shared MailboxSettings.Read"},{"displayName":"Use Shared Mailbox","name":"useShared","type":"boolean","default":false},{"displayName":"User Principal Name","name":"userPrincipalName","description":"Target user's UPN or ID","type":"string","default":"","displayOptions":{"show":{"useShared":[true]}}}],"supportedNodes":["microsoftOutlook","microsoftOutlookTrigger"],"iconUrl":"icons/n8n-nodes-base/dist/nodes/Microsoft/Outlook/outlook.svg"},
|
|
215
|
-
{"name":"microsoftSharePointOAuth2Api","extends":["microsoftOAuth2Api"],"displayName":"Microsoft SharePoint OAuth2 API","documentationUrl":"microsoft","properties":[{"displayName":"Scope","name":"scope","type":"hidden","default":"=openid offline_access https://{{$self.subdomain}}.sharepoint.com/.default"},{"displayName":"Subdomain","name":"subdomain","type":"string","default":"","hint":"You can extract the subdomain from the URL. For example, in the URL \"https://tenant123.sharepoint.com\", the subdomain is \"tenant123\"."}],"
|
|
215
|
+
{"name":"microsoftSharePointOAuth2Api","extends":["microsoftOAuth2Api"],"displayName":"Microsoft SharePoint OAuth2 API","documentationUrl":"microsoft","httpRequestNode":{"name":"Microsoft SharePoint","docsUrl":"https://learn.microsoft.com/en-us/sharepoint/dev/apis/sharepoint-rest-graph","apiBaseUrlPlaceholder":"https://{subdomain}.sharepoint.com/_api/v2.0/","hidden":true},"properties":[{"displayName":"Scope","name":"scope","type":"hidden","default":"=openid offline_access https://{{$self.subdomain}}.sharepoint.com/.default"},{"displayName":"Subdomain","name":"subdomain","type":"string","default":"","hint":"You can extract the subdomain from the URL. For example, in the URL \"https://tenant123.sharepoint.com\", the subdomain is \"tenant123\"."}],"iconUrl":{"light":"icons/n8n-nodes-base/dist/credentials/icons/microsoftSharePoint.svg","dark":"icons/n8n-nodes-base/dist/credentials/icons/microsoftSharePoint.svg"},"supportedNodes":["microsoftSharePoint"]},
|
|
216
216
|
{"name":"microsoftSql","displayName":"Microsoft SQL","documentationUrl":"microsoftSql","properties":[{"displayName":"Server","name":"server","type":"string","default":"localhost"},{"displayName":"Database","name":"database","type":"string","default":"master"},{"displayName":"User","name":"user","type":"string","default":"sa"},{"displayName":"Password","name":"password","type":"string","typeOptions":{"password":true},"default":""},{"displayName":"Port","name":"port","type":"number","default":1433},{"displayName":"Domain","name":"domain","type":"string","default":""},{"displayName":"TLS","name":"tls","type":"boolean","default":true},{"displayName":"Ignore SSL Issues (Insecure)","name":"allowUnauthorizedCerts","type":"boolean","default":false,"description":"Whether to connect even if SSL certificate validation is not possible"},{"displayName":"Connect Timeout","name":"connectTimeout","type":"number","default":15000,"description":"Connection timeout in ms"},{"displayName":"Request Timeout","name":"requestTimeout","type":"number","default":15000,"description":"Request timeout in ms"},{"displayName":"TDS Version","name":"tdsVersion","type":"options","options":[{"name":"7_4 (SQL Server 2012 ~ 2019)","value":"7_4"},{"name":"7_3_B (SQL Server 2008R2)","value":"7_3_B"},{"name":"7_3_A (SQL Server 2008)","value":"7_3_A"},{"name":"7_2 (SQL Server 2005)","value":"7_2"},{"name":"7_1 (SQL Server 2000)","value":"7_1"}],"default":"7_4","description":"The version of TDS to use. If server doesn't support specified version, negotiated version is used instead."}],"supportedNodes":["microsoftSql"],"iconUrl":"icons/n8n-nodes-base/dist/nodes/Microsoft/Sql/mssql.svg"},
|
|
217
217
|
{"name":"microsoftTeamsOAuth2Api","extends":["microsoftOAuth2Api"],"displayName":"Microsoft Teams OAuth2 API","documentationUrl":"microsoft","properties":[{"displayName":"Scope","name":"scope","type":"hidden","default":"openid offline_access User.ReadWrite.All Group.ReadWrite.All Chat.ReadWrite"},{"displayName":"\n Microsoft Teams Trigger requires the following permissions:\n <br><code>ChannelMessage.Read.All</code>\n <br><code>Chat.Read.All</code>\n <br><code>Team.ReadBasic.All</code>\n <br><code>Subscription.ReadWrite.All</code>\n <br>Configure these permissions in <a href=\"https://portal.azure.com\">Microsoft Entra</a>\n ","name":"notice","type":"notice","default":""}],"supportedNodes":["microsoftTeams","microsoftTeamsTrigger"],"iconUrl":"icons/n8n-nodes-base/dist/nodes/Microsoft/Teams/teams.svg"},
|
|
218
218
|
{"name":"microsoftToDoOAuth2Api","extends":["microsoftOAuth2Api"],"displayName":"Microsoft To Do OAuth2 API","documentationUrl":"microsoft","properties":[{"displayName":"Scope","name":"scope","type":"hidden","default":"openid offline_access Tasks.ReadWrite"}],"supportedNodes":["microsoftToDo"],"iconUrl":"icons/n8n-nodes-base/dist/nodes/Microsoft/ToDo/todo.svg"},
|
|
@@ -256,6 +256,7 @@
|
|
|
256
256
|
{"name":"pagerDutyOAuth2Api","extends":["oAuth2Api"],"displayName":"PagerDuty OAuth2 API","documentationUrl":"pagerDuty","properties":[{"displayName":"Grant Type","name":"grantType","type":"hidden","default":"authorizationCode"},{"displayName":"Authorization URL","name":"authUrl","type":"hidden","default":"https://app.pagerduty.com/oauth/authorize"},{"displayName":"Access Token URL","name":"accessTokenUrl","type":"hidden","default":"https://app.pagerduty.com/oauth/token"},{"displayName":"Auth URI Query Parameters","name":"authQueryParameters","type":"hidden","default":""},{"displayName":"Scope","name":"scope","type":"hidden","default":"write"},{"displayName":"Authentication","name":"authentication","type":"hidden","default":"header"}],"supportedNodes":["pagerDuty"],"iconUrl":"icons/n8n-nodes-base/dist/nodes/PagerDuty/pagerDuty.svg"},
|
|
257
257
|
{"name":"payPalApi","displayName":"PayPal API","documentationUrl":"payPal","properties":[{"displayName":"Client ID","name":"clientId","type":"string","default":""},{"displayName":"Secret","name":"secret","type":"string","typeOptions":{"password":true},"default":""},{"displayName":"Environment","name":"env","type":"options","default":"live","options":[{"name":"Sandbox","value":"sanbox"},{"name":"Live","value":"live"}]}],"supportedNodes":["payPal","payPalTrigger"],"iconUrl":"icons/n8n-nodes-base/dist/nodes/PayPal/paypal.svg"},
|
|
258
258
|
{"name":"peekalinkApi","displayName":"Peekalink API","documentationUrl":"peekalink","properties":[{"displayName":"API Key","name":"apiKey","type":"string","typeOptions":{"password":true},"default":""}],"supportedNodes":["peekalink"],"iconUrl":"icons/n8n-nodes-base/dist/nodes/Peekalink/peekalink.png"},
|
|
259
|
+
{"name":"perplexityApi","displayName":"Perplexity API","documentationUrl":"https://docs.perplexity.ai","properties":[{"displayName":"API Key","name":"apiKey","type":"string","typeOptions":{"password":true},"required":true,"default":"","description":"Your Perplexity API key. Get it from your Perplexity account."}],"authenticate":{"type":"generic","properties":{"headers":{"Authorization":"=Bearer {{$credentials.apiKey}}"}}},"test":{"request":{"baseURL":"https://api.perplexity.ai","url":"/chat/completions","method":"POST","body":{"model":"r1-1776","messages":[{"role":"user","content":"test"}]},"headers":{"Authorization":"=Bearer {{$credentials.apiKey}}","Content-Type":"application/json"},"json":true}},"supportedNodes":["perplexity"],"iconUrl":{"light":"icons/n8n-nodes-base/dist/nodes/Perplexity/perplexity.svg","dark":"icons/n8n-nodes-base/dist/nodes/Perplexity/perplexity.dark.svg"}},
|
|
259
260
|
{"name":"phantombusterApi","displayName":"Phantombuster API","documentationUrl":"phantombuster","properties":[{"displayName":"API Key","name":"apiKey","type":"string","typeOptions":{"password":true},"default":""}],"authenticate":{"type":"generic","properties":{"headers":{"X-Phantombuster-Key":"={{$credentials.apiKey}}"}}},"test":{"request":{"baseURL":"https://api.phantombuster.com/api/v2","url":"/agents/fetch-all"}},"supportedNodes":["phantombuster"],"iconUrl":"icons/n8n-nodes-base/dist/nodes/Phantombuster/phantombuster.png"},
|
|
260
261
|
{"name":"philipsHueOAuth2Api","extends":["oAuth2Api"],"displayName":"PhilipHue OAuth2 API","documentationUrl":"philipsHue","properties":[{"displayName":"Grant Type","name":"grantType","type":"hidden","default":"authorizationCode"},{"displayName":"APP ID","name":"appId","type":"string","default":""},{"displayName":"Authorization URL","name":"authUrl","type":"hidden","default":"https://api.meethue.com/v2/oauth2/authorize"},{"displayName":"Access Token URL","name":"accessTokenUrl","type":"hidden","default":"https://api.meethue.com/v2/oauth2/token"},{"displayName":"Auth URI Query Parameters","name":"authQueryParameters","type":"hidden","default":"={{\"appid=\"+$self[\"appId\"]}}"},{"displayName":"Scope","name":"scope","type":"hidden","default":""},{"displayName":"Authentication","name":"authentication","type":"hidden","default":"header"}],"supportedNodes":["philipsHue"],"iconUrl":"icons/n8n-nodes-base/dist/nodes/PhilipsHue/philipshue.png"},
|
|
261
262
|
{"name":"pipedriveApi","displayName":"Pipedrive API","documentationUrl":"pipedrive","properties":[{"displayName":"API Token","name":"apiToken","type":"string","typeOptions":{"password":true},"default":""}],"authenticate":{"type":"generic","properties":{"qs":{"api_token":"={{$credentials.apiToken}}"}}},"supportedNodes":["pipedrive","pipedriveTrigger"],"iconUrl":"icons/n8n-nodes-base/dist/nodes/Pipedrive/pipedrive.svg"},
|