@heines/n8n-nodes-pax8 1.0.2

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 (87) hide show
  1. package/README.md +1 -0
  2. package/dist/credentials/Pax8OAuth2Api.credentials.d.ts +6 -0
  3. package/dist/credentials/Pax8OAuth2Api.credentials.js +15 -0
  4. package/dist/index.d.ts +27 -0
  5. package/dist/index.js +66 -0
  6. package/dist/nodes/Pax8AccessToken.node.d.ts +7 -0
  7. package/dist/nodes/Pax8AccessToken.node.js +33 -0
  8. package/dist/nodes/Pax8Companies.node.d.ts +7 -0
  9. package/dist/nodes/Pax8Companies.node.js +33 -0
  10. package/dist/nodes/Pax8Contacts.node.d.ts +7 -0
  11. package/dist/nodes/Pax8Contacts.node.js +33 -0
  12. package/dist/nodes/Pax8Invoices.node.d.ts +7 -0
  13. package/dist/nodes/Pax8Invoices.node.js +33 -0
  14. package/dist/nodes/Pax8Libraryattachments.node.d.ts +7 -0
  15. package/dist/nodes/Pax8Libraryattachments.node.js +33 -0
  16. package/dist/nodes/Pax8Orders.node.d.ts +7 -0
  17. package/dist/nodes/Pax8Orders.node.js +33 -0
  18. package/dist/nodes/Pax8Preferenceattachments.node.d.ts +7 -0
  19. package/dist/nodes/Pax8Preferenceattachments.node.js +33 -0
  20. package/dist/nodes/Pax8Products.node.d.ts +7 -0
  21. package/dist/nodes/Pax8Products.node.js +33 -0
  22. package/dist/nodes/Pax8ProvisionAttempts.node.d.ts +7 -0
  23. package/dist/nodes/Pax8ProvisionAttempts.node.js +33 -0
  24. package/dist/nodes/Pax8ProvisionDetails.node.d.ts +7 -0
  25. package/dist/nodes/Pax8ProvisionDetails.node.js +33 -0
  26. package/dist/nodes/Pax8ProvisionRequests.node.d.ts +7 -0
  27. package/dist/nodes/Pax8ProvisionRequests.node.js +33 -0
  28. package/dist/nodes/Pax8ProvisionResults.node.d.ts +7 -0
  29. package/dist/nodes/Pax8ProvisionResults.node.js +33 -0
  30. package/dist/nodes/Pax8Provisioners.node.d.ts +7 -0
  31. package/dist/nodes/Pax8Provisioners.node.js +33 -0
  32. package/dist/nodes/Pax8ProvisioningSimulations.node.d.ts +7 -0
  33. package/dist/nodes/Pax8ProvisioningSimulations.node.js +33 -0
  34. package/dist/nodes/Pax8Quoteaccesslist.node.d.ts +7 -0
  35. package/dist/nodes/Pax8Quoteaccesslist.node.js +33 -0
  36. package/dist/nodes/Pax8Quoteattachments.node.d.ts +7 -0
  37. package/dist/nodes/Pax8Quoteattachments.node.js +33 -0
  38. package/dist/nodes/Pax8Quotelineitems.node.d.ts +7 -0
  39. package/dist/nodes/Pax8Quotelineitems.node.js +33 -0
  40. package/dist/nodes/Pax8Quotepreferences.node.d.ts +7 -0
  41. package/dist/nodes/Pax8Quotepreferences.node.js +33 -0
  42. package/dist/nodes/Pax8Quotes.node.d.ts +7 -0
  43. package/dist/nodes/Pax8Quotes.node.js +33 -0
  44. package/dist/nodes/Pax8Quotesections.node.d.ts +7 -0
  45. package/dist/nodes/Pax8Quotesections.node.js +33 -0
  46. package/dist/nodes/Pax8Subscriptions.node.d.ts +7 -0
  47. package/dist/nodes/Pax8Subscriptions.node.js +33 -0
  48. package/dist/nodes/Pax8TopicDefinitions.node.d.ts +7 -0
  49. package/dist/nodes/Pax8TopicDefinitions.node.js +33 -0
  50. package/dist/nodes/Pax8UsageLines.node.d.ts +7 -0
  51. package/dist/nodes/Pax8UsageLines.node.js +33 -0
  52. package/dist/nodes/Pax8UsageSummaries.node.d.ts +7 -0
  53. package/dist/nodes/Pax8UsageSummaries.node.js +33 -0
  54. package/dist/nodes/Pax8WebhookLogs.node.d.ts +7 -0
  55. package/dist/nodes/Pax8WebhookLogs.node.js +33 -0
  56. package/dist/nodes/Pax8Webhooks.node.d.ts +7 -0
  57. package/dist/nodes/Pax8Webhooks.node.js +33 -0
  58. package/package.json +55 -0
  59. package/src/credentials/Pax8OAuth2Api.credentials.ts +11 -0
  60. package/src/index.ts +27 -0
  61. package/src/nodes/Pax8AccessToken.node.ts +27 -0
  62. package/src/nodes/Pax8Companies.node.ts +27 -0
  63. package/src/nodes/Pax8Contacts.node.ts +27 -0
  64. package/src/nodes/Pax8Invoices.node.ts +27 -0
  65. package/src/nodes/Pax8Libraryattachments.node.ts +27 -0
  66. package/src/nodes/Pax8Orders.node.ts +27 -0
  67. package/src/nodes/Pax8Preferenceattachments.node.ts +27 -0
  68. package/src/nodes/Pax8Products.node.ts +27 -0
  69. package/src/nodes/Pax8ProvisionAttempts.node.ts +27 -0
  70. package/src/nodes/Pax8ProvisionDetails.node.ts +27 -0
  71. package/src/nodes/Pax8ProvisionRequests.node.ts +27 -0
  72. package/src/nodes/Pax8ProvisionResults.node.ts +27 -0
  73. package/src/nodes/Pax8Provisioners.node.ts +27 -0
  74. package/src/nodes/Pax8ProvisioningSimulations.node.ts +27 -0
  75. package/src/nodes/Pax8Quoteaccesslist.node.ts +27 -0
  76. package/src/nodes/Pax8Quoteattachments.node.ts +27 -0
  77. package/src/nodes/Pax8Quotelineitems.node.ts +27 -0
  78. package/src/nodes/Pax8Quotepreferences.node.ts +27 -0
  79. package/src/nodes/Pax8Quotes.node.ts +27 -0
  80. package/src/nodes/Pax8Quotesections.node.ts +27 -0
  81. package/src/nodes/Pax8Subscriptions.node.ts +27 -0
  82. package/src/nodes/Pax8TopicDefinitions.node.ts +27 -0
  83. package/src/nodes/Pax8UsageLines.node.ts +27 -0
  84. package/src/nodes/Pax8UsageSummaries.node.ts +27 -0
  85. package/src/nodes/Pax8WebhookLogs.node.ts +27 -0
  86. package/src/nodes/Pax8Webhooks.node.ts +27 -0
  87. package/tsconfig.json +13 -0
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.Pax8Webhooks = void 0;
7
+ const axios_1 = __importDefault(require("axios"));
8
+ const qs_1 = __importDefault(require("qs"));
9
+ class Pax8Webhooks {
10
+ constructor() {
11
+ this.description = {
12
+ displayName: 'Pax8 Webhooks', name: 'pax8Webhooks', group: ['transform'], version: 1,
13
+ description: 'Pax8 Webhooks', defaults: { name: 'Pax8 Webhooks' }, inputs: ['main'], outputs: ['main'],
14
+ credentials: [{ name: 'pax8OAuth2Api', required: true }],
15
+ properties: [{ displayName: 'Operation', name: 'operation', type: 'options', options: [{ "name": "GET /webhooks", "value": "get:/webhooks" }, { "name": "POST /webhooks", "value": "post:/webhooks" }, { "name": "GET /webhooks/{id}", "value": "get:/webhooks/{id}" }, { "name": "DELETE /webhooks/{id}", "value": "delete:/webhooks/{id}" }, { "name": "POST /webhooks/{id}/configuration", "value": "post:/webhooks/{id}/configuration" }, { "name": "POST /webhooks/{id}/status", "value": "post:/webhooks/{id}/status" }, { "name": "POST /webhooks/{id}/topics", "value": "post:/webhooks/{id}/topics" }, { "name": "PUT /webhooks/{id}/topics", "value": "put:/webhooks/{id}/topics" }, { "name": "DELETE /webhooks/{id}/topics/{topicId}", "value": "delete:/webhooks/{id}/topics/{topicId}" }, { "name": "POST /webhooks/{id}/topics/{topicId}/configuration", "value": "post:/webhooks/{id}/topics/{topicId}/configuration" }, { "name": "POST /webhooks/{id}/topics/{topic}/test", "value": "post:/webhooks/{id}/topics/{topic}/test" }], default: '' }]
16
+ };
17
+ }
18
+ async getAccessToken(creds) {
19
+ const data = qs_1.default.stringify({ grant_type: 'client_credentials', client_id: creds.clientId, client_secret: creds.clientSecret, scope: creds.scope });
20
+ const res = await axios_1.default.post('https://api.pax8.com/auth/connect/token', data, { headers: { 'Content-Type': 'application/x-www-form-urlencoded' } });
21
+ return res.data.access_token;
22
+ }
23
+ async execute() {
24
+ const op = this.getNodeParameter('operation', 0);
25
+ const [method, path] = op.split(':');
26
+ const creds = await this.getCredentials('pax8OAuth2Api');
27
+ const token = await this.getAccessToken(creds);
28
+ const url = 'https://api.pax8.com' + path;
29
+ const res = await (0, axios_1.default)({ method, url, headers: { Authorization: `Bearer ${token}` } });
30
+ return [this.helpers.returnJsonArray(res.data)];
31
+ }
32
+ }
33
+ exports.Pax8Webhooks = Pax8Webhooks;
package/package.json ADDED
@@ -0,0 +1,55 @@
1
+ {
2
+ "name": "@heines/n8n-nodes-pax8",
3
+ "version": "1.0.2",
4
+ "description": "Pax8 Node Suite",
5
+ "keywords": [
6
+ "n8n-community-node-package"
7
+ ],
8
+ "license": "MIT",
9
+ "main": "dist/index.js",
10
+ "scripts": {
11
+ "build": "tsc"
12
+ },
13
+ "n8n": {
14
+ "nodes": [
15
+ "dist/nodes/Pax8AccessToken.node.js",
16
+ "dist/nodes/Pax8Webhooks.node.js",
17
+ "dist/nodes/Pax8TopicDefinitions.node.js",
18
+ "dist/nodes/Pax8WebhookLogs.node.js",
19
+ "dist/nodes/Pax8Libraryattachments.node.js",
20
+ "dist/nodes/Pax8Quotepreferences.node.js",
21
+ "dist/nodes/Pax8Preferenceattachments.node.js",
22
+ "dist/nodes/Pax8Quotes.node.js",
23
+ "dist/nodes/Pax8Quoteaccesslist.node.js",
24
+ "dist/nodes/Pax8Quoteattachments.node.js",
25
+ "dist/nodes/Pax8Quotelineitems.node.js",
26
+ "dist/nodes/Pax8Quotesections.node.js",
27
+ "dist/nodes/Pax8Provisioners.node.js",
28
+ "dist/nodes/Pax8ProvisioningSimulations.node.js",
29
+ "dist/nodes/Pax8ProvisionResults.node.js",
30
+ "dist/nodes/Pax8ProvisionAttempts.node.js",
31
+ "dist/nodes/Pax8ProvisionRequests.node.js",
32
+ "dist/nodes/Pax8ProvisionDetails.node.js",
33
+ "dist/nodes/Pax8UsageLines.node.js",
34
+ "dist/nodes/Pax8Companies.node.js",
35
+ "dist/nodes/Pax8Contacts.node.js",
36
+ "dist/nodes/Pax8Products.node.js",
37
+ "dist/nodes/Pax8Orders.node.js",
38
+ "dist/nodes/Pax8Subscriptions.node.js",
39
+ "dist/nodes/Pax8Invoices.node.js",
40
+ "dist/nodes/Pax8UsageSummaries.node.js"
41
+ ],
42
+ "credentials": [
43
+ "dist/credentials/Pax8OAuth2Api.credentials.js"
44
+ ]
45
+ },
46
+ "dependencies": {
47
+ "axios": "^1.6.0",
48
+ "qs": "^6.11.1"
49
+ },
50
+ "devDependencies": {
51
+ "typescript": "^5.0.0",
52
+ "@types/node": "^18.0.0",
53
+ "n8n-workflow": "^1.0.0"
54
+ }
55
+ }
@@ -0,0 +1,11 @@
1
+
2
+ import { ICredentialType, INodeProperties } from 'n8n-workflow';
3
+ export class Pax8OAuth2Api implements ICredentialType {
4
+ name = 'pax8OAuth2Api';
5
+ displayName = 'Pax8 OAuth2 API';
6
+ properties: INodeProperties[] = [
7
+ {displayName:'Client ID', name:'clientId', type:'string', default:''},
8
+ {displayName:'Client Secret', name:'clientSecret', type:'string', typeOptions:{password:true}, default:''},
9
+ {displayName:'Scope', name:'scope', type:'string', default:'pax8api'}
10
+ ];
11
+ }
package/src/index.ts ADDED
@@ -0,0 +1,27 @@
1
+ export * as Pax8AccessToken from './nodes/Pax8AccessToken.node';
2
+ export * as Pax8Webhooks from './nodes/Pax8Webhooks.node';
3
+ export * as Pax8TopicDefinitions from './nodes/Pax8TopicDefinitions.node';
4
+ export * as Pax8WebhookLogs from './nodes/Pax8WebhookLogs.node';
5
+ export * as Pax8Libraryattachments from './nodes/Pax8Libraryattachments.node';
6
+ export * as Pax8Quotepreferences from './nodes/Pax8Quotepreferences.node';
7
+ export * as Pax8Preferenceattachments from './nodes/Pax8Preferenceattachments.node';
8
+ export * as Pax8Quotes from './nodes/Pax8Quotes.node';
9
+ export * as Pax8Quoteaccesslist from './nodes/Pax8Quoteaccesslist.node';
10
+ export * as Pax8Quoteattachments from './nodes/Pax8Quoteattachments.node';
11
+ export * as Pax8Quotelineitems from './nodes/Pax8Quotelineitems.node';
12
+ export * as Pax8Quotesections from './nodes/Pax8Quotesections.node';
13
+ export * as Pax8Provisioners from './nodes/Pax8Provisioners.node';
14
+ export * as Pax8ProvisioningSimulations from './nodes/Pax8ProvisioningSimulations.node';
15
+ export * as Pax8ProvisionResults from './nodes/Pax8ProvisionResults.node';
16
+ export * as Pax8ProvisionAttempts from './nodes/Pax8ProvisionAttempts.node';
17
+ export * as Pax8ProvisionRequests from './nodes/Pax8ProvisionRequests.node';
18
+ export * as Pax8ProvisionDetails from './nodes/Pax8ProvisionDetails.node';
19
+ export * as Pax8UsageLines from './nodes/Pax8UsageLines.node';
20
+ export * as Pax8Companies from './nodes/Pax8Companies.node';
21
+ export * as Pax8Contacts from './nodes/Pax8Contacts.node';
22
+ export * as Pax8Products from './nodes/Pax8Products.node';
23
+ export * as Pax8Orders from './nodes/Pax8Orders.node';
24
+ export * as Pax8Subscriptions from './nodes/Pax8Subscriptions.node';
25
+ export * as Pax8Invoices from './nodes/Pax8Invoices.node';
26
+ export * as Pax8UsageSummaries from './nodes/Pax8UsageSummaries.node';
27
+ export * from './credentials/Pax8OAuth2Api.credentials';
@@ -0,0 +1,27 @@
1
+
2
+ import axios from 'axios';
3
+ import qs from 'qs';
4
+ import { IExecuteFunctions } from 'n8n-workflow';
5
+ import { INodeType, INodeTypeDescription } from 'n8n-workflow';
6
+ export class Pax8AccessToken implements INodeType {
7
+ description: INodeTypeDescription = {
8
+ displayName:'Pax8 Access Token', name:'pax8AccessToken', group:['transform'], version:1,
9
+ description:'Pax8 Access Token', defaults:{name:'Pax8 Access Token'}, inputs:['main'], outputs:['main'],
10
+ credentials:[{name:'pax8OAuth2Api', required:true}],
11
+ properties:[{displayName:'Operation', name:'operation', type:'options', options:[{"name": "POST /token", "value": "post:/token"}], default:''}]
12
+ };
13
+ async getAccessToken(creds:any){
14
+ const data = qs.stringify({grant_type:'client_credentials', client_id:creds.clientId, client_secret:creds.clientSecret, scope:creds.scope});
15
+ const res = await axios.post('https://api.pax8.com/auth/connect/token', data, {headers:{'Content-Type':'application/x-www-form-urlencoded'}});
16
+ return res.data.access_token;
17
+ }
18
+ async execute(this:IExecuteFunctions){
19
+ const op=this.getNodeParameter('operation',0) as string;
20
+ const [method,path]=op.split(':');
21
+ const creds=await this.getCredentials('pax8OAuth2Api');
22
+ const token=await this.getAccessToken(creds);
23
+ const url='https://api.pax8.com'+path;
24
+ const res=await axios({method,url,headers:{Authorization:`Bearer ${token }`}});
25
+ return [this.helpers.returnJsonArray(res.data)];
26
+ }
27
+ }
@@ -0,0 +1,27 @@
1
+
2
+ import axios from 'axios';
3
+ import qs from 'qs';
4
+ import { IExecuteFunctions } from 'n8n-workflow';
5
+ import { INodeType, INodeTypeDescription } from 'n8n-workflow';
6
+ export class Pax8Companies implements INodeType {
7
+ description: INodeTypeDescription = {
8
+ displayName:'Pax8 Companies', name:'pax8Companies', group:['transform'], version:1,
9
+ description:'Pax8 Companies', defaults:{name:'Pax8 Companies'}, inputs:['main'], outputs:['main'],
10
+ credentials:[{name:'pax8OAuth2Api', required:true}],
11
+ properties:[{displayName:'Operation', name:'operation', type:'options', options:[{"name": "POST /companies", "value": "post:/companies"}, {"name": "GET /companies", "value": "get:/companies"}, {"name": "GET /companies/{companyId}", "value": "get:/companies/{companyId}"}, {"name": "PATCH /companies/{companyId}", "value": "patch:/companies/{companyId}"}], default:''}]
12
+ };
13
+ async getAccessToken(creds:any){
14
+ const data = qs.stringify({grant_type:'client_credentials', client_id:creds.clientId, client_secret:creds.clientSecret, scope:creds.scope});
15
+ const res = await axios.post('https://api.pax8.com/auth/connect/token', data, {headers:{'Content-Type':'application/x-www-form-urlencoded'}});
16
+ return res.data.access_token;
17
+ }
18
+ async execute(this:IExecuteFunctions){
19
+ const op=this.getNodeParameter('operation',0) as string;
20
+ const [method,path]=op.split(':');
21
+ const creds=await this.getCredentials('pax8OAuth2Api');
22
+ const token=await this.getAccessToken(creds);
23
+ const url='https://api.pax8.com'+path;
24
+ const res=await axios({method,url,headers:{Authorization:`Bearer ${token }`}});
25
+ return [this.helpers.returnJsonArray(res.data)];
26
+ }
27
+ }
@@ -0,0 +1,27 @@
1
+
2
+ import axios from 'axios';
3
+ import qs from 'qs';
4
+ import { IExecuteFunctions } from 'n8n-workflow';
5
+ import { INodeType, INodeTypeDescription } from 'n8n-workflow';
6
+ export class Pax8Contacts implements INodeType {
7
+ description: INodeTypeDescription = {
8
+ displayName:'Pax8 Contacts', name:'pax8Contacts', group:['transform'], version:1,
9
+ description:'Pax8 Contacts', defaults:{name:'Pax8 Contacts'}, inputs:['main'], outputs:['main'],
10
+ credentials:[{name:'pax8OAuth2Api', required:true}],
11
+ properties:[{displayName:'Operation', name:'operation', type:'options', options:[{"name": "POST /companies/{companyId}/contacts", "value": "post:/companies/{companyId}/contacts"}, {"name": "GET /companies/{companyId}/contacts", "value": "get:/companies/{companyId}/contacts"}, {"name": "GET /companies/{companyId}/contacts/{contactId}", "value": "get:/companies/{companyId}/contacts/{contactId}"}, {"name": "PUT /companies/{companyId}/contacts/{contactId}", "value": "put:/companies/{companyId}/contacts/{contactId}"}, {"name": "DELETE /companies/{companyId}/contacts/{contactId}", "value": "delete:/companies/{companyId}/contacts/{contactId}"}], default:''}]
12
+ };
13
+ async getAccessToken(creds:any){
14
+ const data = qs.stringify({grant_type:'client_credentials', client_id:creds.clientId, client_secret:creds.clientSecret, scope:creds.scope});
15
+ const res = await axios.post('https://api.pax8.com/auth/connect/token', data, {headers:{'Content-Type':'application/x-www-form-urlencoded'}});
16
+ return res.data.access_token;
17
+ }
18
+ async execute(this:IExecuteFunctions){
19
+ const op=this.getNodeParameter('operation',0) as string;
20
+ const [method,path]=op.split(':');
21
+ const creds=await this.getCredentials('pax8OAuth2Api');
22
+ const token=await this.getAccessToken(creds);
23
+ const url='https://api.pax8.com'+path;
24
+ const res=await axios({method,url,headers:{Authorization:`Bearer ${token }`}});
25
+ return [this.helpers.returnJsonArray(res.data)];
26
+ }
27
+ }
@@ -0,0 +1,27 @@
1
+
2
+ import axios from 'axios';
3
+ import qs from 'qs';
4
+ import { IExecuteFunctions } from 'n8n-workflow';
5
+ import { INodeType, INodeTypeDescription } from 'n8n-workflow';
6
+ export class Pax8Invoices implements INodeType {
7
+ description: INodeTypeDescription = {
8
+ displayName:'Pax8 Invoices', name:'pax8Invoices', group:['transform'], version:1,
9
+ description:'Pax8 Invoices', defaults:{name:'Pax8 Invoices'}, inputs:['main'], outputs:['main'],
10
+ credentials:[{name:'pax8OAuth2Api', required:true}],
11
+ properties:[{displayName:'Operation', name:'operation', type:'options', options:[{"name": "GET /invoices", "value": "get:/invoices"}, {"name": "GET /invoices/{invoiceId}", "value": "get:/invoices/{invoiceId}"}, {"name": "GET /invoices/{invoiceId}/items", "value": "get:/invoices/{invoiceId}/items"}, {"name": "GET /invoices/draftItems", "value": "get:/invoices/draftItems"}], default:''}]
12
+ };
13
+ async getAccessToken(creds:any){
14
+ const data = qs.stringify({grant_type:'client_credentials', client_id:creds.clientId, client_secret:creds.clientSecret, scope:creds.scope});
15
+ const res = await axios.post('https://api.pax8.com/auth/connect/token', data, {headers:{'Content-Type':'application/x-www-form-urlencoded'}});
16
+ return res.data.access_token;
17
+ }
18
+ async execute(this:IExecuteFunctions){
19
+ const op=this.getNodeParameter('operation',0) as string;
20
+ const [method,path]=op.split(':');
21
+ const creds=await this.getCredentials('pax8OAuth2Api');
22
+ const token=await this.getAccessToken(creds);
23
+ const url='https://api.pax8.com'+path;
24
+ const res=await axios({method,url,headers:{Authorization:`Bearer ${token }`}});
25
+ return [this.helpers.returnJsonArray(res.data)];
26
+ }
27
+ }
@@ -0,0 +1,27 @@
1
+
2
+ import axios from 'axios';
3
+ import qs from 'qs';
4
+ import { IExecuteFunctions } from 'n8n-workflow';
5
+ import { INodeType, INodeTypeDescription } from 'n8n-workflow';
6
+ export class Pax8Libraryattachments implements INodeType {
7
+ description: INodeTypeDescription = {
8
+ displayName:'Pax8 Library attachments', name:'pax8Libraryattachments', group:['transform'], version:1,
9
+ description:'Pax8 Library attachments', defaults:{name:'Pax8 Library attachments'}, inputs:['main'], outputs:['main'],
10
+ credentials:[{name:'pax8OAuth2Api', required:true}],
11
+ properties:[{displayName:'Operation', name:'operation', type:'options', options:[{"name": "GET /v2/quote-attachments", "value": "get:/v2/quote-attachments"}, {"name": "POST /v2/quote-attachments", "value": "post:/v2/quote-attachments"}, {"name": "PUT /v2/quote-attachments", "value": "put:/v2/quote-attachments"}, {"name": "POST /v2/quote-attachments/shared", "value": "post:/v2/quote-attachments/shared"}, {"name": "DELETE /v2/quote-attachments/{attachmentId}", "value": "delete:/v2/quote-attachments/{attachmentId}"}, {"name": "GET /v2/quote-attachments/{attachmentId}", "value": "get:/v2/quote-attachments/{attachmentId}"}, {"name": "PATCH /v2/quote-attachments/{attachmentId}", "value": "patch:/v2/quote-attachments/{attachmentId}"}], default:''}]
12
+ };
13
+ async getAccessToken(creds:any){
14
+ const data = qs.stringify({grant_type:'client_credentials', client_id:creds.clientId, client_secret:creds.clientSecret, scope:creds.scope});
15
+ const res = await axios.post('https://api.pax8.com/auth/connect/token', data, {headers:{'Content-Type':'application/x-www-form-urlencoded'}});
16
+ return res.data.access_token;
17
+ }
18
+ async execute(this:IExecuteFunctions){
19
+ const op=this.getNodeParameter('operation',0) as string;
20
+ const [method,path]=op.split(':');
21
+ const creds=await this.getCredentials('pax8OAuth2Api');
22
+ const token=await this.getAccessToken(creds);
23
+ const url='https://api.pax8.com'+path;
24
+ const res=await axios({method,url,headers:{Authorization:`Bearer ${token }`}});
25
+ return [this.helpers.returnJsonArray(res.data)];
26
+ }
27
+ }
@@ -0,0 +1,27 @@
1
+
2
+ import axios from 'axios';
3
+ import qs from 'qs';
4
+ import { IExecuteFunctions } from 'n8n-workflow';
5
+ import { INodeType, INodeTypeDescription } from 'n8n-workflow';
6
+ export class Pax8Orders implements INodeType {
7
+ description: INodeTypeDescription = {
8
+ displayName:'Pax8 Orders', name:'pax8Orders', group:['transform'], version:1,
9
+ description:'Pax8 Orders', defaults:{name:'Pax8 Orders'}, inputs:['main'], outputs:['main'],
10
+ credentials:[{name:'pax8OAuth2Api', required:true}],
11
+ properties:[{displayName:'Operation', name:'operation', type:'options', options:[{"name": "GET /orders", "value": "get:/orders"}, {"name": "POST /orders", "value": "post:/orders"}, {"name": "GET /orders/{orderId}", "value": "get:/orders/{orderId}"}], default:''}]
12
+ };
13
+ async getAccessToken(creds:any){
14
+ const data = qs.stringify({grant_type:'client_credentials', client_id:creds.clientId, client_secret:creds.clientSecret, scope:creds.scope});
15
+ const res = await axios.post('https://api.pax8.com/auth/connect/token', data, {headers:{'Content-Type':'application/x-www-form-urlencoded'}});
16
+ return res.data.access_token;
17
+ }
18
+ async execute(this:IExecuteFunctions){
19
+ const op=this.getNodeParameter('operation',0) as string;
20
+ const [method,path]=op.split(':');
21
+ const creds=await this.getCredentials('pax8OAuth2Api');
22
+ const token=await this.getAccessToken(creds);
23
+ const url='https://api.pax8.com'+path;
24
+ const res=await axios({method,url,headers:{Authorization:`Bearer ${token }`}});
25
+ return [this.helpers.returnJsonArray(res.data)];
26
+ }
27
+ }
@@ -0,0 +1,27 @@
1
+
2
+ import axios from 'axios';
3
+ import qs from 'qs';
4
+ import { IExecuteFunctions } from 'n8n-workflow';
5
+ import { INodeType, INodeTypeDescription } from 'n8n-workflow';
6
+ export class Pax8Preferenceattachments implements INodeType {
7
+ description: INodeTypeDescription = {
8
+ displayName:'Pax8 Preference attachments', name:'pax8Preferenceattachments', group:['transform'], version:1,
9
+ description:'Pax8 Preference attachments', defaults:{name:'Pax8 Preference attachments'}, inputs:['main'], outputs:['main'],
10
+ credentials:[{name:'pax8OAuth2Api', required:true}],
11
+ properties:[{displayName:'Operation', name:'operation', type:'options', options:[{"name": "POST /v2/quote-preferences/attachments", "value": "post:/v2/quote-preferences/attachments"}, {"name": "DELETE /v2/quote-preferences/attachments/{attachmentId}", "value": "delete:/v2/quote-preferences/attachments/{attachmentId}"}], default:''}]
12
+ };
13
+ async getAccessToken(creds:any){
14
+ const data = qs.stringify({grant_type:'client_credentials', client_id:creds.clientId, client_secret:creds.clientSecret, scope:creds.scope});
15
+ const res = await axios.post('https://api.pax8.com/auth/connect/token', data, {headers:{'Content-Type':'application/x-www-form-urlencoded'}});
16
+ return res.data.access_token;
17
+ }
18
+ async execute(this:IExecuteFunctions){
19
+ const op=this.getNodeParameter('operation',0) as string;
20
+ const [method,path]=op.split(':');
21
+ const creds=await this.getCredentials('pax8OAuth2Api');
22
+ const token=await this.getAccessToken(creds);
23
+ const url='https://api.pax8.com'+path;
24
+ const res=await axios({method,url,headers:{Authorization:`Bearer ${token }`}});
25
+ return [this.helpers.returnJsonArray(res.data)];
26
+ }
27
+ }
@@ -0,0 +1,27 @@
1
+
2
+ import axios from 'axios';
3
+ import qs from 'qs';
4
+ import { IExecuteFunctions } from 'n8n-workflow';
5
+ import { INodeType, INodeTypeDescription } from 'n8n-workflow';
6
+ export class Pax8Products implements INodeType {
7
+ description: INodeTypeDescription = {
8
+ displayName:'Pax8 Products', name:'pax8Products', group:['transform'], version:1,
9
+ description:'Pax8 Products', defaults:{name:'Pax8 Products'}, inputs:['main'], outputs:['main'],
10
+ credentials:[{name:'pax8OAuth2Api', required:true}],
11
+ properties:[{displayName:'Operation', name:'operation', type:'options', options:[{"name": "GET /products", "value": "get:/products"}, {"name": "GET /products/{productId}", "value": "get:/products/{productId}"}, {"name": "GET /products/{productId}/provision-details", "value": "get:/products/{productId}/provision-details"}, {"name": "GET /products/{productId}/dependencies", "value": "get:/products/{productId}/dependencies"}, {"name": "GET /products/{productId}/pricing", "value": "get:/products/{productId}/pricing"}], default:''}]
12
+ };
13
+ async getAccessToken(creds:any){
14
+ const data = qs.stringify({grant_type:'client_credentials', client_id:creds.clientId, client_secret:creds.clientSecret, scope:creds.scope});
15
+ const res = await axios.post('https://api.pax8.com/auth/connect/token', data, {headers:{'Content-Type':'application/x-www-form-urlencoded'}});
16
+ return res.data.access_token;
17
+ }
18
+ async execute(this:IExecuteFunctions){
19
+ const op=this.getNodeParameter('operation',0) as string;
20
+ const [method,path]=op.split(':');
21
+ const creds=await this.getCredentials('pax8OAuth2Api');
22
+ const token=await this.getAccessToken(creds);
23
+ const url='https://api.pax8.com'+path;
24
+ const res=await axios({method,url,headers:{Authorization:`Bearer ${token }`}});
25
+ return [this.helpers.returnJsonArray(res.data)];
26
+ }
27
+ }
@@ -0,0 +1,27 @@
1
+
2
+ import axios from 'axios';
3
+ import qs from 'qs';
4
+ import { IExecuteFunctions } from 'n8n-workflow';
5
+ import { INodeType, INodeTypeDescription } from 'n8n-workflow';
6
+ export class Pax8ProvisionAttempts implements INodeType {
7
+ description: INodeTypeDescription = {
8
+ displayName:'Pax8 Provision Attempts', name:'pax8ProvisionAttempts', group:['transform'], version:1,
9
+ description:'Pax8 Provision Attempts', defaults:{name:'Pax8 Provision Attempts'}, inputs:['main'], outputs:['main'],
10
+ credentials:[{name:'pax8OAuth2Api', required:true}],
11
+ properties:[{displayName:'Operation', name:'operation', type:'options', options:[{"name": "GET /provision-requests/{provisionRequestId}/attempts", "value": "get:/provision-requests/{provisionRequestId}/attempts"}, {"name": "POST /provision-requests/{provisionRequestId}/attempts", "value": "post:/provision-requests/{provisionRequestId}/attempts"}, {"name": "GET /provision-requests/{provisionRequestId}/attempts/{provisionAttemptId}", "value": "get:/provision-requests/{provisionRequestId}/attempts/{provisionAttemptId}"}, {"name": "GET /provision-requests/{provisionRequestId}/attempts/latest", "value": "get:/provision-requests/{provisionRequestId}/attempts/latest"}], default:''}]
12
+ };
13
+ async getAccessToken(creds:any){
14
+ const data = qs.stringify({grant_type:'client_credentials', client_id:creds.clientId, client_secret:creds.clientSecret, scope:creds.scope});
15
+ const res = await axios.post('https://api.pax8.com/auth/connect/token', data, {headers:{'Content-Type':'application/x-www-form-urlencoded'}});
16
+ return res.data.access_token;
17
+ }
18
+ async execute(this:IExecuteFunctions){
19
+ const op=this.getNodeParameter('operation',0) as string;
20
+ const [method,path]=op.split(':');
21
+ const creds=await this.getCredentials('pax8OAuth2Api');
22
+ const token=await this.getAccessToken(creds);
23
+ const url='https://api.pax8.com'+path;
24
+ const res=await axios({method,url,headers:{Authorization:`Bearer ${token }`}});
25
+ return [this.helpers.returnJsonArray(res.data)];
26
+ }
27
+ }
@@ -0,0 +1,27 @@
1
+
2
+ import axios from 'axios';
3
+ import qs from 'qs';
4
+ import { IExecuteFunctions } from 'n8n-workflow';
5
+ import { INodeType, INodeTypeDescription } from 'n8n-workflow';
6
+ export class Pax8ProvisionDetails implements INodeType {
7
+ description: INodeTypeDescription = {
8
+ displayName:'Pax8 Provision Details', name:'pax8ProvisionDetails', group:['transform'], version:1,
9
+ description:'Pax8 Provision Details', defaults:{name:'Pax8 Provision Details'}, inputs:['main'], outputs:['main'],
10
+ credentials:[{name:'pax8OAuth2Api', required:true}],
11
+ properties:[{displayName:'Operation', name:'operation', type:'options', options:[{"name": "GET /provision-requests/{provisionRequestId}/details", "value": "get:/provision-requests/{provisionRequestId}/details"}, {"name": "GET /provision-requests/{provisionRequestId}/details/{provisionDetailId}", "value": "get:/provision-requests/{provisionRequestId}/details/{provisionDetailId}"}, {"name": "GET /provision-requests/{provisionRequestId}/details/latest", "value": "get:/provision-requests/{provisionRequestId}/details/latest"}], default:''}]
12
+ };
13
+ async getAccessToken(creds:any){
14
+ const data = qs.stringify({grant_type:'client_credentials', client_id:creds.clientId, client_secret:creds.clientSecret, scope:creds.scope});
15
+ const res = await axios.post('https://api.pax8.com/auth/connect/token', data, {headers:{'Content-Type':'application/x-www-form-urlencoded'}});
16
+ return res.data.access_token;
17
+ }
18
+ async execute(this:IExecuteFunctions){
19
+ const op=this.getNodeParameter('operation',0) as string;
20
+ const [method,path]=op.split(':');
21
+ const creds=await this.getCredentials('pax8OAuth2Api');
22
+ const token=await this.getAccessToken(creds);
23
+ const url='https://api.pax8.com'+path;
24
+ const res=await axios({method,url,headers:{Authorization:`Bearer ${token }`}});
25
+ return [this.helpers.returnJsonArray(res.data)];
26
+ }
27
+ }
@@ -0,0 +1,27 @@
1
+
2
+ import axios from 'axios';
3
+ import qs from 'qs';
4
+ import { IExecuteFunctions } from 'n8n-workflow';
5
+ import { INodeType, INodeTypeDescription } from 'n8n-workflow';
6
+ export class Pax8ProvisionRequests implements INodeType {
7
+ description: INodeTypeDescription = {
8
+ displayName:'Pax8 Provision Requests', name:'pax8ProvisionRequests', group:['transform'], version:1,
9
+ description:'Pax8 Provision Requests', defaults:{name:'Pax8 Provision Requests'}, inputs:['main'], outputs:['main'],
10
+ credentials:[{name:'pax8OAuth2Api', required:true}],
11
+ properties:[{displayName:'Operation', name:'operation', type:'options', options:[{"name": "GET /provision-requests", "value": "get:/provision-requests"}, {"name": "GET /provision-requests/{provisionRequestId}", "value": "get:/provision-requests/{provisionRequestId}"}, {"name": "GET /provision-requests/unfulfilled", "value": "get:/provision-requests/unfulfilled"}], default:''}]
12
+ };
13
+ async getAccessToken(creds:any){
14
+ const data = qs.stringify({grant_type:'client_credentials', client_id:creds.clientId, client_secret:creds.clientSecret, scope:creds.scope});
15
+ const res = await axios.post('https://api.pax8.com/auth/connect/token', data, {headers:{'Content-Type':'application/x-www-form-urlencoded'}});
16
+ return res.data.access_token;
17
+ }
18
+ async execute(this:IExecuteFunctions){
19
+ const op=this.getNodeParameter('operation',0) as string;
20
+ const [method,path]=op.split(':');
21
+ const creds=await this.getCredentials('pax8OAuth2Api');
22
+ const token=await this.getAccessToken(creds);
23
+ const url='https://api.pax8.com'+path;
24
+ const res=await axios({method,url,headers:{Authorization:`Bearer ${token }`}});
25
+ return [this.helpers.returnJsonArray(res.data)];
26
+ }
27
+ }
@@ -0,0 +1,27 @@
1
+
2
+ import axios from 'axios';
3
+ import qs from 'qs';
4
+ import { IExecuteFunctions } from 'n8n-workflow';
5
+ import { INodeType, INodeTypeDescription } from 'n8n-workflow';
6
+ export class Pax8ProvisionResults implements INodeType {
7
+ description: INodeTypeDescription = {
8
+ displayName:'Pax8 Provision Results', name:'pax8ProvisionResults', group:['transform'], version:1,
9
+ description:'Pax8 Provision Results', defaults:{name:'Pax8 Provision Results'}, inputs:['main'], outputs:['main'],
10
+ credentials:[{name:'pax8OAuth2Api', required:true}],
11
+ properties:[{displayName:'Operation', name:'operation', type:'options', options:[{"name": "GET /provision-requests/{provisionRequestId}/results", "value": "get:/provision-requests/{provisionRequestId}/results"}, {"name": "POST /provision-requests/{provisionRequestId}/results", "value": "post:/provision-requests/{provisionRequestId}/results"}, {"name": "GET /provision-requests/{provisionRequestId}/results/{provisionResultId}", "value": "get:/provision-requests/{provisionRequestId}/results/{provisionResultId}"}, {"name": "GET /provision-requests/{provisionRequestId}/results/latest", "value": "get:/provision-requests/{provisionRequestId}/results/latest"}], default:''}]
12
+ };
13
+ async getAccessToken(creds:any){
14
+ const data = qs.stringify({grant_type:'client_credentials', client_id:creds.clientId, client_secret:creds.clientSecret, scope:creds.scope});
15
+ const res = await axios.post('https://api.pax8.com/auth/connect/token', data, {headers:{'Content-Type':'application/x-www-form-urlencoded'}});
16
+ return res.data.access_token;
17
+ }
18
+ async execute(this:IExecuteFunctions){
19
+ const op=this.getNodeParameter('operation',0) as string;
20
+ const [method,path]=op.split(':');
21
+ const creds=await this.getCredentials('pax8OAuth2Api');
22
+ const token=await this.getAccessToken(creds);
23
+ const url='https://api.pax8.com'+path;
24
+ const res=await axios({method,url,headers:{Authorization:`Bearer ${token }`}});
25
+ return [this.helpers.returnJsonArray(res.data)];
26
+ }
27
+ }
@@ -0,0 +1,27 @@
1
+
2
+ import axios from 'axios';
3
+ import qs from 'qs';
4
+ import { IExecuteFunctions } from 'n8n-workflow';
5
+ import { INodeType, INodeTypeDescription } from 'n8n-workflow';
6
+ export class Pax8Provisioners implements INodeType {
7
+ description: INodeTypeDescription = {
8
+ displayName:'Pax8 Provisioners', name:'pax8Provisioners', group:['transform'], version:1,
9
+ description:'Pax8 Provisioners', defaults:{name:'Pax8 Provisioners'}, inputs:['main'], outputs:['main'],
10
+ credentials:[{name:'pax8OAuth2Api', required:true}],
11
+ properties:[{displayName:'Operation', name:'operation', type:'options', options:[{"name": "GET /provisioners/{provisionerId}/webhooks", "value": "get:/provisioners/{provisionerId}/webhooks"}, {"name": "POST /provisioners/{provisionerId}/webhooks", "value": "post:/provisioners/{provisionerId}/webhooks"}, {"name": "GET /provisioners", "value": "get:/provisioners"}, {"name": "GET /provisioners/{provisionerId}", "value": "get:/provisioners/{provisionerId}"}, {"name": "GET /provisioners/{provisionerId}/webhooks/{webhookId}", "value": "get:/provisioners/{provisionerId}/webhooks/{webhookId}"}, {"name": "GET /provisioners/{provisionerId}/webhooks/latest", "value": "get:/provisioners/{provisionerId}/webhooks/latest"}], default:''}]
12
+ };
13
+ async getAccessToken(creds:any){
14
+ const data = qs.stringify({grant_type:'client_credentials', client_id:creds.clientId, client_secret:creds.clientSecret, scope:creds.scope});
15
+ const res = await axios.post('https://api.pax8.com/auth/connect/token', data, {headers:{'Content-Type':'application/x-www-form-urlencoded'}});
16
+ return res.data.access_token;
17
+ }
18
+ async execute(this:IExecuteFunctions){
19
+ const op=this.getNodeParameter('operation',0) as string;
20
+ const [method,path]=op.split(':');
21
+ const creds=await this.getCredentials('pax8OAuth2Api');
22
+ const token=await this.getAccessToken(creds);
23
+ const url='https://api.pax8.com'+path;
24
+ const res=await axios({method,url,headers:{Authorization:`Bearer ${token }`}});
25
+ return [this.helpers.returnJsonArray(res.data)];
26
+ }
27
+ }
@@ -0,0 +1,27 @@
1
+
2
+ import axios from 'axios';
3
+ import qs from 'qs';
4
+ import { IExecuteFunctions } from 'n8n-workflow';
5
+ import { INodeType, INodeTypeDescription } from 'n8n-workflow';
6
+ export class Pax8ProvisioningSimulations implements INodeType {
7
+ description: INodeTypeDescription = {
8
+ displayName:'Pax8 Provisioning Simulations', name:'pax8ProvisioningSimulations', group:['transform'], version:1,
9
+ description:'Pax8 Provisioning Simulations', defaults:{name:'Pax8 Provisioning Simulations'}, inputs:['main'], outputs:['main'],
10
+ credentials:[{name:'pax8OAuth2Api', required:true}],
11
+ properties:[{displayName:'Operation', name:'operation', type:'options', options:[{"name": "POST /provision-simulations/order-events", "value": "post:/provision-simulations/order-events"}], default:''}]
12
+ };
13
+ async getAccessToken(creds:any){
14
+ const data = qs.stringify({grant_type:'client_credentials', client_id:creds.clientId, client_secret:creds.clientSecret, scope:creds.scope});
15
+ const res = await axios.post('https://api.pax8.com/auth/connect/token', data, {headers:{'Content-Type':'application/x-www-form-urlencoded'}});
16
+ return res.data.access_token;
17
+ }
18
+ async execute(this:IExecuteFunctions){
19
+ const op=this.getNodeParameter('operation',0) as string;
20
+ const [method,path]=op.split(':');
21
+ const creds=await this.getCredentials('pax8OAuth2Api');
22
+ const token=await this.getAccessToken(creds);
23
+ const url='https://api.pax8.com'+path;
24
+ const res=await axios({method,url,headers:{Authorization:`Bearer ${token }`}});
25
+ return [this.helpers.returnJsonArray(res.data)];
26
+ }
27
+ }
@@ -0,0 +1,27 @@
1
+
2
+ import axios from 'axios';
3
+ import qs from 'qs';
4
+ import { IExecuteFunctions } from 'n8n-workflow';
5
+ import { INodeType, INodeTypeDescription } from 'n8n-workflow';
6
+ export class Pax8Quoteaccesslist implements INodeType {
7
+ description: INodeTypeDescription = {
8
+ displayName:'Pax8 Quote access list', name:'pax8Quoteaccesslist', group:['transform'], version:1,
9
+ description:'Pax8 Quote access list', defaults:{name:'Pax8 Quote access list'}, inputs:['main'], outputs:['main'],
10
+ credentials:[{name:'pax8OAuth2Api', required:true}],
11
+ properties:[{displayName:'Operation', name:'operation', type:'options', options:[{"name": "GET /v2/quotes/{quoteId}/access-list", "value": "get:/v2/quotes/{quoteId}/access-list"}, {"name": "POST /v2/quotes/{quoteId}/access-list", "value": "post:/v2/quotes/{quoteId}/access-list"}, {"name": "DELETE /v2/quotes/{quoteId}/access-list/{accessListEntryId}", "value": "delete:/v2/quotes/{quoteId}/access-list/{accessListEntryId}"}], default:''}]
12
+ };
13
+ async getAccessToken(creds:any){
14
+ const data = qs.stringify({grant_type:'client_credentials', client_id:creds.clientId, client_secret:creds.clientSecret, scope:creds.scope});
15
+ const res = await axios.post('https://api.pax8.com/auth/connect/token', data, {headers:{'Content-Type':'application/x-www-form-urlencoded'}});
16
+ return res.data.access_token;
17
+ }
18
+ async execute(this:IExecuteFunctions){
19
+ const op=this.getNodeParameter('operation',0) as string;
20
+ const [method,path]=op.split(':');
21
+ const creds=await this.getCredentials('pax8OAuth2Api');
22
+ const token=await this.getAccessToken(creds);
23
+ const url='https://api.pax8.com'+path;
24
+ const res=await axios({method,url,headers:{Authorization:`Bearer ${token }`}});
25
+ return [this.helpers.returnJsonArray(res.data)];
26
+ }
27
+ }
@@ -0,0 +1,27 @@
1
+
2
+ import axios from 'axios';
3
+ import qs from 'qs';
4
+ import { IExecuteFunctions } from 'n8n-workflow';
5
+ import { INodeType, INodeTypeDescription } from 'n8n-workflow';
6
+ export class Pax8Quoteattachments implements INodeType {
7
+ description: INodeTypeDescription = {
8
+ displayName:'Pax8 Quote attachments', name:'pax8Quoteattachments', group:['transform'], version:1,
9
+ description:'Pax8 Quote attachments', defaults:{name:'Pax8 Quote attachments'}, inputs:['main'], outputs:['main'],
10
+ credentials:[{name:'pax8OAuth2Api', required:true}],
11
+ properties:[{displayName:'Operation', name:'operation', type:'options', options:[{"name": "GET /v2/quotes/{quoteId}/attachments", "value": "get:/v2/quotes/{quoteId}/attachments"}, {"name": "POST /v2/quotes/{quoteId}/attachments", "value": "post:/v2/quotes/{quoteId}/attachments"}, {"name": "PUT /v2/quotes/{quoteId}/attachments", "value": "put:/v2/quotes/{quoteId}/attachments"}, {"name": "POST /v2/quotes/{quoteId}/attachments/shared", "value": "post:/v2/quotes/{quoteId}/attachments/shared"}, {"name": "DELETE /v2/quotes/{quoteId}/attachments/{attachmentId}", "value": "delete:/v2/quotes/{quoteId}/attachments/{attachmentId}"}, {"name": "GET /v2/quotes/{quoteId}/attachments/{attachmentId}", "value": "get:/v2/quotes/{quoteId}/attachments/{attachmentId}"}], default:''}]
12
+ };
13
+ async getAccessToken(creds:any){
14
+ const data = qs.stringify({grant_type:'client_credentials', client_id:creds.clientId, client_secret:creds.clientSecret, scope:creds.scope});
15
+ const res = await axios.post('https://api.pax8.com/auth/connect/token', data, {headers:{'Content-Type':'application/x-www-form-urlencoded'}});
16
+ return res.data.access_token;
17
+ }
18
+ async execute(this:IExecuteFunctions){
19
+ const op=this.getNodeParameter('operation',0) as string;
20
+ const [method,path]=op.split(':');
21
+ const creds=await this.getCredentials('pax8OAuth2Api');
22
+ const token=await this.getAccessToken(creds);
23
+ const url='https://api.pax8.com'+path;
24
+ const res=await axios({method,url,headers:{Authorization:`Bearer ${token }`}});
25
+ return [this.helpers.returnJsonArray(res.data)];
26
+ }
27
+ }