@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
package/README.md ADDED
@@ -0,0 +1 @@
1
+ Official n8n Pax8 Suite by HeineS
@@ -0,0 +1,6 @@
1
+ import { ICredentialType, INodeProperties } from 'n8n-workflow';
2
+ export declare class Pax8OAuth2Api implements ICredentialType {
3
+ name: string;
4
+ displayName: string;
5
+ properties: INodeProperties[];
6
+ }
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Pax8OAuth2Api = void 0;
4
+ class Pax8OAuth2Api {
5
+ constructor() {
6
+ this.name = 'pax8OAuth2Api';
7
+ this.displayName = 'Pax8 OAuth2 API';
8
+ this.properties = [
9
+ { displayName: 'Client ID', name: 'clientId', type: 'string', default: '' },
10
+ { displayName: 'Client Secret', name: 'clientSecret', type: 'string', typeOptions: { password: true }, default: '' },
11
+ { displayName: 'Scope', name: 'scope', type: 'string', default: 'pax8api' }
12
+ ];
13
+ }
14
+ }
15
+ exports.Pax8OAuth2Api = Pax8OAuth2Api;
@@ -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';
package/dist/index.js ADDED
@@ -0,0 +1,66 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
36
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
37
+ };
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.Pax8UsageSummaries = exports.Pax8Invoices = exports.Pax8Subscriptions = exports.Pax8Orders = exports.Pax8Products = exports.Pax8Contacts = exports.Pax8Companies = exports.Pax8UsageLines = exports.Pax8ProvisionDetails = exports.Pax8ProvisionRequests = exports.Pax8ProvisionAttempts = exports.Pax8ProvisionResults = exports.Pax8ProvisioningSimulations = exports.Pax8Provisioners = exports.Pax8Quotesections = exports.Pax8Quotelineitems = exports.Pax8Quoteattachments = exports.Pax8Quoteaccesslist = exports.Pax8Quotes = exports.Pax8Preferenceattachments = exports.Pax8Quotepreferences = exports.Pax8Libraryattachments = exports.Pax8WebhookLogs = exports.Pax8TopicDefinitions = exports.Pax8Webhooks = exports.Pax8AccessToken = void 0;
40
+ exports.Pax8AccessToken = __importStar(require("./nodes/Pax8AccessToken.node"));
41
+ exports.Pax8Webhooks = __importStar(require("./nodes/Pax8Webhooks.node"));
42
+ exports.Pax8TopicDefinitions = __importStar(require("./nodes/Pax8TopicDefinitions.node"));
43
+ exports.Pax8WebhookLogs = __importStar(require("./nodes/Pax8WebhookLogs.node"));
44
+ exports.Pax8Libraryattachments = __importStar(require("./nodes/Pax8Libraryattachments.node"));
45
+ exports.Pax8Quotepreferences = __importStar(require("./nodes/Pax8Quotepreferences.node"));
46
+ exports.Pax8Preferenceattachments = __importStar(require("./nodes/Pax8Preferenceattachments.node"));
47
+ exports.Pax8Quotes = __importStar(require("./nodes/Pax8Quotes.node"));
48
+ exports.Pax8Quoteaccesslist = __importStar(require("./nodes/Pax8Quoteaccesslist.node"));
49
+ exports.Pax8Quoteattachments = __importStar(require("./nodes/Pax8Quoteattachments.node"));
50
+ exports.Pax8Quotelineitems = __importStar(require("./nodes/Pax8Quotelineitems.node"));
51
+ exports.Pax8Quotesections = __importStar(require("./nodes/Pax8Quotesections.node"));
52
+ exports.Pax8Provisioners = __importStar(require("./nodes/Pax8Provisioners.node"));
53
+ exports.Pax8ProvisioningSimulations = __importStar(require("./nodes/Pax8ProvisioningSimulations.node"));
54
+ exports.Pax8ProvisionResults = __importStar(require("./nodes/Pax8ProvisionResults.node"));
55
+ exports.Pax8ProvisionAttempts = __importStar(require("./nodes/Pax8ProvisionAttempts.node"));
56
+ exports.Pax8ProvisionRequests = __importStar(require("./nodes/Pax8ProvisionRequests.node"));
57
+ exports.Pax8ProvisionDetails = __importStar(require("./nodes/Pax8ProvisionDetails.node"));
58
+ exports.Pax8UsageLines = __importStar(require("./nodes/Pax8UsageLines.node"));
59
+ exports.Pax8Companies = __importStar(require("./nodes/Pax8Companies.node"));
60
+ exports.Pax8Contacts = __importStar(require("./nodes/Pax8Contacts.node"));
61
+ exports.Pax8Products = __importStar(require("./nodes/Pax8Products.node"));
62
+ exports.Pax8Orders = __importStar(require("./nodes/Pax8Orders.node"));
63
+ exports.Pax8Subscriptions = __importStar(require("./nodes/Pax8Subscriptions.node"));
64
+ exports.Pax8Invoices = __importStar(require("./nodes/Pax8Invoices.node"));
65
+ exports.Pax8UsageSummaries = __importStar(require("./nodes/Pax8UsageSummaries.node"));
66
+ __exportStar(require("./credentials/Pax8OAuth2Api.credentials"), exports);
@@ -0,0 +1,7 @@
1
+ import { IExecuteFunctions } from 'n8n-workflow';
2
+ import { INodeType, INodeTypeDescription } from 'n8n-workflow';
3
+ export declare class Pax8AccessToken implements INodeType {
4
+ description: INodeTypeDescription;
5
+ getAccessToken(creds: any): Promise<any>;
6
+ execute(this: IExecuteFunctions): Promise<import("n8n-workflow").INodeExecutionData[][]>;
7
+ }
@@ -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.Pax8AccessToken = void 0;
7
+ const axios_1 = __importDefault(require("axios"));
8
+ const qs_1 = __importDefault(require("qs"));
9
+ class Pax8AccessToken {
10
+ constructor() {
11
+ this.description = {
12
+ displayName: 'Pax8 Access Token', name: 'pax8AccessToken', group: ['transform'], version: 1,
13
+ description: 'Pax8 Access Token', defaults: { name: 'Pax8 Access Token' }, inputs: ['main'], outputs: ['main'],
14
+ credentials: [{ name: 'pax8OAuth2Api', required: true }],
15
+ properties: [{ displayName: 'Operation', name: 'operation', type: 'options', options: [{ "name": "POST /token", "value": "post:/token" }], 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.Pax8AccessToken = Pax8AccessToken;
@@ -0,0 +1,7 @@
1
+ import { IExecuteFunctions } from 'n8n-workflow';
2
+ import { INodeType, INodeTypeDescription } from 'n8n-workflow';
3
+ export declare class Pax8Companies implements INodeType {
4
+ description: INodeTypeDescription;
5
+ getAccessToken(creds: any): Promise<any>;
6
+ execute(this: IExecuteFunctions): Promise<import("n8n-workflow").INodeExecutionData[][]>;
7
+ }
@@ -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.Pax8Companies = void 0;
7
+ const axios_1 = __importDefault(require("axios"));
8
+ const qs_1 = __importDefault(require("qs"));
9
+ class Pax8Companies {
10
+ constructor() {
11
+ this.description = {
12
+ displayName: 'Pax8 Companies', name: 'pax8Companies', group: ['transform'], version: 1,
13
+ description: 'Pax8 Companies', defaults: { name: 'Pax8 Companies' }, inputs: ['main'], outputs: ['main'],
14
+ credentials: [{ name: 'pax8OAuth2Api', required: true }],
15
+ 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: '' }]
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.Pax8Companies = Pax8Companies;
@@ -0,0 +1,7 @@
1
+ import { IExecuteFunctions } from 'n8n-workflow';
2
+ import { INodeType, INodeTypeDescription } from 'n8n-workflow';
3
+ export declare class Pax8Contacts implements INodeType {
4
+ description: INodeTypeDescription;
5
+ getAccessToken(creds: any): Promise<any>;
6
+ execute(this: IExecuteFunctions): Promise<import("n8n-workflow").INodeExecutionData[][]>;
7
+ }
@@ -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.Pax8Contacts = void 0;
7
+ const axios_1 = __importDefault(require("axios"));
8
+ const qs_1 = __importDefault(require("qs"));
9
+ class Pax8Contacts {
10
+ constructor() {
11
+ this.description = {
12
+ displayName: 'Pax8 Contacts', name: 'pax8Contacts', group: ['transform'], version: 1,
13
+ description: 'Pax8 Contacts', defaults: { name: 'Pax8 Contacts' }, inputs: ['main'], outputs: ['main'],
14
+ credentials: [{ name: 'pax8OAuth2Api', required: true }],
15
+ 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: '' }]
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.Pax8Contacts = Pax8Contacts;
@@ -0,0 +1,7 @@
1
+ import { IExecuteFunctions } from 'n8n-workflow';
2
+ import { INodeType, INodeTypeDescription } from 'n8n-workflow';
3
+ export declare class Pax8Invoices implements INodeType {
4
+ description: INodeTypeDescription;
5
+ getAccessToken(creds: any): Promise<any>;
6
+ execute(this: IExecuteFunctions): Promise<import("n8n-workflow").INodeExecutionData[][]>;
7
+ }
@@ -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.Pax8Invoices = void 0;
7
+ const axios_1 = __importDefault(require("axios"));
8
+ const qs_1 = __importDefault(require("qs"));
9
+ class Pax8Invoices {
10
+ constructor() {
11
+ this.description = {
12
+ displayName: 'Pax8 Invoices', name: 'pax8Invoices', group: ['transform'], version: 1,
13
+ description: 'Pax8 Invoices', defaults: { name: 'Pax8 Invoices' }, inputs: ['main'], outputs: ['main'],
14
+ credentials: [{ name: 'pax8OAuth2Api', required: true }],
15
+ 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: '' }]
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.Pax8Invoices = Pax8Invoices;
@@ -0,0 +1,7 @@
1
+ import { IExecuteFunctions } from 'n8n-workflow';
2
+ import { INodeType, INodeTypeDescription } from 'n8n-workflow';
3
+ export declare class Pax8Libraryattachments implements INodeType {
4
+ description: INodeTypeDescription;
5
+ getAccessToken(creds: any): Promise<any>;
6
+ execute(this: IExecuteFunctions): Promise<import("n8n-workflow").INodeExecutionData[][]>;
7
+ }
@@ -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.Pax8Libraryattachments = void 0;
7
+ const axios_1 = __importDefault(require("axios"));
8
+ const qs_1 = __importDefault(require("qs"));
9
+ class Pax8Libraryattachments {
10
+ constructor() {
11
+ this.description = {
12
+ displayName: 'Pax8 Library attachments', name: 'pax8Libraryattachments', group: ['transform'], version: 1,
13
+ description: 'Pax8 Library attachments', defaults: { name: 'Pax8 Library attachments' }, inputs: ['main'], outputs: ['main'],
14
+ credentials: [{ name: 'pax8OAuth2Api', required: true }],
15
+ 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: '' }]
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.Pax8Libraryattachments = Pax8Libraryattachments;
@@ -0,0 +1,7 @@
1
+ import { IExecuteFunctions } from 'n8n-workflow';
2
+ import { INodeType, INodeTypeDescription } from 'n8n-workflow';
3
+ export declare class Pax8Orders implements INodeType {
4
+ description: INodeTypeDescription;
5
+ getAccessToken(creds: any): Promise<any>;
6
+ execute(this: IExecuteFunctions): Promise<import("n8n-workflow").INodeExecutionData[][]>;
7
+ }
@@ -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.Pax8Orders = void 0;
7
+ const axios_1 = __importDefault(require("axios"));
8
+ const qs_1 = __importDefault(require("qs"));
9
+ class Pax8Orders {
10
+ constructor() {
11
+ this.description = {
12
+ displayName: 'Pax8 Orders', name: 'pax8Orders', group: ['transform'], version: 1,
13
+ description: 'Pax8 Orders', defaults: { name: 'Pax8 Orders' }, inputs: ['main'], outputs: ['main'],
14
+ credentials: [{ name: 'pax8OAuth2Api', required: true }],
15
+ 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: '' }]
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.Pax8Orders = Pax8Orders;
@@ -0,0 +1,7 @@
1
+ import { IExecuteFunctions } from 'n8n-workflow';
2
+ import { INodeType, INodeTypeDescription } from 'n8n-workflow';
3
+ export declare class Pax8Preferenceattachments implements INodeType {
4
+ description: INodeTypeDescription;
5
+ getAccessToken(creds: any): Promise<any>;
6
+ execute(this: IExecuteFunctions): Promise<import("n8n-workflow").INodeExecutionData[][]>;
7
+ }
@@ -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.Pax8Preferenceattachments = void 0;
7
+ const axios_1 = __importDefault(require("axios"));
8
+ const qs_1 = __importDefault(require("qs"));
9
+ class Pax8Preferenceattachments {
10
+ constructor() {
11
+ this.description = {
12
+ displayName: 'Pax8 Preference attachments', name: 'pax8Preferenceattachments', group: ['transform'], version: 1,
13
+ description: 'Pax8 Preference attachments', defaults: { name: 'Pax8 Preference attachments' }, inputs: ['main'], outputs: ['main'],
14
+ credentials: [{ name: 'pax8OAuth2Api', required: true }],
15
+ 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: '' }]
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.Pax8Preferenceattachments = Pax8Preferenceattachments;
@@ -0,0 +1,7 @@
1
+ import { IExecuteFunctions } from 'n8n-workflow';
2
+ import { INodeType, INodeTypeDescription } from 'n8n-workflow';
3
+ export declare class Pax8Products implements INodeType {
4
+ description: INodeTypeDescription;
5
+ getAccessToken(creds: any): Promise<any>;
6
+ execute(this: IExecuteFunctions): Promise<import("n8n-workflow").INodeExecutionData[][]>;
7
+ }
@@ -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.Pax8Products = void 0;
7
+ const axios_1 = __importDefault(require("axios"));
8
+ const qs_1 = __importDefault(require("qs"));
9
+ class Pax8Products {
10
+ constructor() {
11
+ this.description = {
12
+ displayName: 'Pax8 Products', name: 'pax8Products', group: ['transform'], version: 1,
13
+ description: 'Pax8 Products', defaults: { name: 'Pax8 Products' }, inputs: ['main'], outputs: ['main'],
14
+ credentials: [{ name: 'pax8OAuth2Api', required: true }],
15
+ 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: '' }]
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.Pax8Products = Pax8Products;
@@ -0,0 +1,7 @@
1
+ import { IExecuteFunctions } from 'n8n-workflow';
2
+ import { INodeType, INodeTypeDescription } from 'n8n-workflow';
3
+ export declare class Pax8ProvisionAttempts implements INodeType {
4
+ description: INodeTypeDescription;
5
+ getAccessToken(creds: any): Promise<any>;
6
+ execute(this: IExecuteFunctions): Promise<import("n8n-workflow").INodeExecutionData[][]>;
7
+ }
@@ -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.Pax8ProvisionAttempts = void 0;
7
+ const axios_1 = __importDefault(require("axios"));
8
+ const qs_1 = __importDefault(require("qs"));
9
+ class Pax8ProvisionAttempts {
10
+ constructor() {
11
+ this.description = {
12
+ displayName: 'Pax8 Provision Attempts', name: 'pax8ProvisionAttempts', group: ['transform'], version: 1,
13
+ description: 'Pax8 Provision Attempts', defaults: { name: 'Pax8 Provision Attempts' }, inputs: ['main'], outputs: ['main'],
14
+ credentials: [{ name: 'pax8OAuth2Api', required: true }],
15
+ 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: '' }]
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.Pax8ProvisionAttempts = Pax8ProvisionAttempts;
@@ -0,0 +1,7 @@
1
+ import { IExecuteFunctions } from 'n8n-workflow';
2
+ import { INodeType, INodeTypeDescription } from 'n8n-workflow';
3
+ export declare class Pax8ProvisionDetails implements INodeType {
4
+ description: INodeTypeDescription;
5
+ getAccessToken(creds: any): Promise<any>;
6
+ execute(this: IExecuteFunctions): Promise<import("n8n-workflow").INodeExecutionData[][]>;
7
+ }
@@ -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.Pax8ProvisionDetails = void 0;
7
+ const axios_1 = __importDefault(require("axios"));
8
+ const qs_1 = __importDefault(require("qs"));
9
+ class Pax8ProvisionDetails {
10
+ constructor() {
11
+ this.description = {
12
+ displayName: 'Pax8 Provision Details', name: 'pax8ProvisionDetails', group: ['transform'], version: 1,
13
+ description: 'Pax8 Provision Details', defaults: { name: 'Pax8 Provision Details' }, inputs: ['main'], outputs: ['main'],
14
+ credentials: [{ name: 'pax8OAuth2Api', required: true }],
15
+ 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: '' }]
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.Pax8ProvisionDetails = Pax8ProvisionDetails;
@@ -0,0 +1,7 @@
1
+ import { IExecuteFunctions } from 'n8n-workflow';
2
+ import { INodeType, INodeTypeDescription } from 'n8n-workflow';
3
+ export declare class Pax8ProvisionRequests implements INodeType {
4
+ description: INodeTypeDescription;
5
+ getAccessToken(creds: any): Promise<any>;
6
+ execute(this: IExecuteFunctions): Promise<import("n8n-workflow").INodeExecutionData[][]>;
7
+ }
@@ -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.Pax8ProvisionRequests = void 0;
7
+ const axios_1 = __importDefault(require("axios"));
8
+ const qs_1 = __importDefault(require("qs"));
9
+ class Pax8ProvisionRequests {
10
+ constructor() {
11
+ this.description = {
12
+ displayName: 'Pax8 Provision Requests', name: 'pax8ProvisionRequests', group: ['transform'], version: 1,
13
+ description: 'Pax8 Provision Requests', defaults: { name: 'Pax8 Provision Requests' }, inputs: ['main'], outputs: ['main'],
14
+ credentials: [{ name: 'pax8OAuth2Api', required: true }],
15
+ 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: '' }]
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.Pax8ProvisionRequests = Pax8ProvisionRequests;
@@ -0,0 +1,7 @@
1
+ import { IExecuteFunctions } from 'n8n-workflow';
2
+ import { INodeType, INodeTypeDescription } from 'n8n-workflow';
3
+ export declare class Pax8ProvisionResults implements INodeType {
4
+ description: INodeTypeDescription;
5
+ getAccessToken(creds: any): Promise<any>;
6
+ execute(this: IExecuteFunctions): Promise<import("n8n-workflow").INodeExecutionData[][]>;
7
+ }