n8n-nodes-dandh 0.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.
package/README.md ADDED
@@ -0,0 +1,51 @@
1
+ # n8n-nodes-dandh
2
+
3
+ n8n community node for D&H Business Community APIs.
4
+
5
+ ## Included credentials
6
+
7
+ - `D&H API` (`dandhApi`)
8
+ - `Base URL` (default `https://test.api.dandh.com`)
9
+ - OAuth2 Client Credentials (`clientId`, `clientSecret`)
10
+ - Token URL default: `https://test.auth.dandh.com/api/oauth/token`
11
+ - Production cutover: update `Base URL` and `Access Token URL`; endpoint paths do not change
12
+
13
+ ## Included node
14
+
15
+ - `D&H Business Community` (`dandhBusinessCommunity`)
16
+ - Resources:
17
+ - `Item`
18
+ - `Carrier`
19
+ - `Order`
20
+
21
+ ## Implemented operations
22
+
23
+ ### Item
24
+
25
+ - Catalog Get Items (`/catalog/v1/customers/{accountNumber}/items`)
26
+ - Get Availability (`/customerOrderManagement/v2/customers/{accountNumber}/items/{itemId}/availability`)
27
+ - Get Availability (Bulk) (`/customerOrderManagement/v2/customers/{accountNumber}/items/availability/bulk`)
28
+ - Get Price (`/customerOrderManagement/v2/customers/{accountNumber}/items/{itemId}/price`)
29
+ - Get Price (Bulk) (`/customerOrderManagement/v2/customers/{accountNumber}/items/price/bulk`)
30
+ - Get Price and Availability (`/customerOrderManagement/v2/customers/{accountNumber}/items/{itemId}/priceAndAvailability`)
31
+ - Get Price and Availability (Bulk) (`/customerOrderManagement/v2/customers/{accountNumber}/items/priceAndAvailability/bulk`)
32
+ - List Items (`/customerOrderManagement/v2/customers/{accountNumber}/items`)
33
+ - Get Item (`/customerOrderManagement/v2/customers/{accountNumber}/items/{itemId}`)
34
+
35
+ ### Carrier
36
+
37
+ - Get Carriers (`/customerOrderManagement/v2/customers/{accountNumber}/carriers`)
38
+
39
+ ### Order
40
+
41
+ - Get Sales Order Tracking (`/customerOrderManagement/v2/customers/{accountNumber}/salesOrders/{id}/tracking`)
42
+ - List Sales Order Tracking (`/customerOrderManagement/v2/customers/{accountNumber}/salesOrders/tracking`)
43
+ - Create Sales Order (`/customerOrderManagement/v2/customers/{accountNumber}/salesOrders`)
44
+ - Supports `JSON` mode and `Fields` mode for common order inputs
45
+
46
+ ## Build
47
+
48
+ ```bash
49
+ npm install
50
+ npm run build
51
+ ```
@@ -0,0 +1,8 @@
1
+ import type { ICredentialType, INodeProperties } from 'n8n-workflow';
2
+ export declare class DandhApi implements ICredentialType {
3
+ name: string;
4
+ extends: string[];
5
+ displayName: string;
6
+ documentationUrl: string;
7
+ properties: INodeProperties[];
8
+ }
@@ -0,0 +1,72 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DandhApi = void 0;
4
+ class DandhApi {
5
+ constructor() {
6
+ this.name = 'dandhApi';
7
+ this.extends = ['oAuth2Api'];
8
+ this.displayName = 'D&H API';
9
+ this.documentationUrl = 'https://test.api.dandh.com';
10
+ this.properties = [
11
+ {
12
+ displayName: 'Grant Type',
13
+ name: 'grantType',
14
+ type: 'hidden',
15
+ default: 'clientCredentials',
16
+ },
17
+ {
18
+ displayName: 'Authorization URL',
19
+ name: 'authUrl',
20
+ type: 'hidden',
21
+ default: 'https://test.auth.dandh.com/api/oauth/authorize',
22
+ },
23
+ {
24
+ displayName: 'Access Token URL',
25
+ name: 'accessTokenUrl',
26
+ type: 'string',
27
+ default: 'https://test.auth.dandh.com/api/oauth/token',
28
+ required: true,
29
+ description: 'OAuth2 token endpoint (use test or production auth host as provided by D&H)',
30
+ },
31
+ {
32
+ displayName: 'Authentication',
33
+ name: 'authentication',
34
+ type: 'options',
35
+ options: [
36
+ {
37
+ name: 'Body',
38
+ value: 'body',
39
+ },
40
+ {
41
+ name: 'Header',
42
+ value: 'header',
43
+ },
44
+ ],
45
+ default: 'body',
46
+ description: 'How client credentials are sent to the token endpoint',
47
+ },
48
+ {
49
+ displayName: 'Scope',
50
+ name: 'scope',
51
+ type: 'string',
52
+ default: 'resource.READ',
53
+ description: 'Space-separated scopes to request',
54
+ },
55
+ {
56
+ displayName: 'Auth URI Query Parameters',
57
+ name: 'authQueryParameters',
58
+ type: 'hidden',
59
+ default: '',
60
+ },
61
+ {
62
+ displayName: 'Base URL',
63
+ name: 'baseUrl',
64
+ type: 'string',
65
+ default: 'https://test.api.dandh.com',
66
+ description: 'Base URL for D&H APIs (swap to production host when provided)',
67
+ },
68
+ ];
69
+ }
70
+ }
71
+ exports.DandhApi = DandhApi;
72
+ //# sourceMappingURL=DandhApi.credentials.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DandhApi.credentials.js","sourceRoot":"","sources":["../../credentials/DandhApi.credentials.ts"],"names":[],"mappings":";;;AAEA,MAAa,QAAQ;IAArB;QACC,SAAI,GAAG,UAAU,CAAC;QAClB,YAAO,GAAG,CAAC,WAAW,CAAC,CAAC;QACxB,gBAAW,GAAG,SAAS,CAAC;QACxB,qBAAgB,GAAG,4BAA4B,CAAC;QAEhD,eAAU,GAAsB;YAC/B;gBACC,WAAW,EAAE,YAAY;gBACzB,IAAI,EAAE,WAAW;gBACjB,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,mBAAmB;aAC5B;YACD;gBACC,WAAW,EAAE,mBAAmB;gBAChC,IAAI,EAAE,SAAS;gBACf,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,iDAAiD;aAC1D;YACD;gBACC,WAAW,EAAE,kBAAkB;gBAC/B,IAAI,EAAE,gBAAgB;gBACtB,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,6CAA6C;gBACtD,QAAQ,EAAE,IAAI;gBACd,WAAW,EAAE,6EAA6E;aAC1F;YACD;gBACC,WAAW,EAAE,gBAAgB;gBAC7B,IAAI,EAAE,gBAAgB;gBACtB,IAAI,EAAE,SAAS;gBACf,OAAO,EAAE;oBACR;wBACC,IAAI,EAAE,MAAM;wBACZ,KAAK,EAAE,MAAM;qBACb;oBACD;wBACC,IAAI,EAAE,QAAQ;wBACd,KAAK,EAAE,QAAQ;qBACf;iBACD;gBACD,OAAO,EAAE,MAAM;gBACf,WAAW,EAAE,uDAAuD;aACpE;YACD;gBACC,WAAW,EAAE,OAAO;gBACpB,IAAI,EAAE,OAAO;gBACb,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,eAAe;gBACxB,WAAW,EAAE,mCAAmC;aAChD;YACD;gBACC,WAAW,EAAE,2BAA2B;gBACxC,IAAI,EAAE,qBAAqB;gBAC3B,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,EAAE;aACX;YACD;gBACC,WAAW,EAAE,UAAU;gBACvB,IAAI,EAAE,SAAS;gBACf,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,4BAA4B;gBACrC,WAAW,EAAE,+DAA+D;aAC5E;SACD,CAAC;IACH,CAAC;CAAA;AAjED,4BAiEC"}
@@ -0,0 +1,2 @@
1
+ export * from './credentials/DandhApi.credentials';
2
+ export * from './nodes/DandhBusinessCommunity/DandhBusinessCommunity.node';
package/dist/index.js ADDED
@@ -0,0 +1,19 @@
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./credentials/DandhApi.credentials"), exports);
18
+ __exportStar(require("./nodes/DandhBusinessCommunity/DandhBusinessCommunity.node"), exports);
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qEAAmD;AACnD,6FAA2E"}
@@ -0,0 +1,5 @@
1
+ import type { IExecuteFunctions, INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow';
2
+ export declare class DandhBusinessCommunity implements INodeType {
3
+ description: INodeTypeDescription;
4
+ execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
5
+ }