@skriptfabrik/n8n-nodes-fulfillmenttools 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (26) hide show
  1. package/README.md +63 -0
  2. package/package.json +40 -0
  3. package/src/credentials/FulfillmenttoolsApi.credentials.d.ts +13 -0
  4. package/src/credentials/FulfillmenttoolsApi.credentials.js +126 -0
  5. package/src/credentials/FulfillmenttoolsApi.credentials.js.map +1 -0
  6. package/src/nodes/Fulfillmenttools/Fulfillmenttools.node.d.ts +5 -0
  7. package/src/nodes/Fulfillmenttools/Fulfillmenttools.node.js +174 -0
  8. package/src/nodes/Fulfillmenttools/Fulfillmenttools.node.js.map +1 -0
  9. package/src/nodes/Fulfillmenttools/Fulfillmenttools.node.json +18 -0
  10. package/src/nodes/Fulfillmenttools/FulfillmenttoolsTrigger.node.d.ts +12 -0
  11. package/src/nodes/Fulfillmenttools/FulfillmenttoolsTrigger.node.js +330 -0
  12. package/src/nodes/Fulfillmenttools/FulfillmenttoolsTrigger.node.js.map +1 -0
  13. package/src/nodes/Fulfillmenttools/FulfillmenttoolsTrigger.node.json +18 -0
  14. package/src/nodes/Fulfillmenttools/GenericFunctions.d.ts +3 -0
  15. package/src/nodes/Fulfillmenttools/GenericFunctions.js +91 -0
  16. package/src/nodes/Fulfillmenttools/GenericFunctions.js.map +1 -0
  17. package/src/nodes/Fulfillmenttools/descriptions/FacilityCarrierDescription.d.ts +3 -0
  18. package/src/nodes/Fulfillmenttools/descriptions/FacilityCarrierDescription.js +322 -0
  19. package/src/nodes/Fulfillmenttools/descriptions/FacilityCarrierDescription.js.map +1 -0
  20. package/src/nodes/Fulfillmenttools/descriptions/FacilityDescription.d.ts +3 -0
  21. package/src/nodes/Fulfillmenttools/descriptions/FacilityDescription.js +610 -0
  22. package/src/nodes/Fulfillmenttools/descriptions/FacilityDescription.js.map +1 -0
  23. package/src/nodes/Fulfillmenttools/descriptions/OrderDescription.d.ts +3 -0
  24. package/src/nodes/Fulfillmenttools/descriptions/OrderDescription.js +328 -0
  25. package/src/nodes/Fulfillmenttools/descriptions/OrderDescription.js.map +1 -0
  26. package/src/nodes/Fulfillmenttools/icons/fulfillmenttools.svg +3 -0
package/README.md ADDED
@@ -0,0 +1,63 @@
1
+ # @skriptfabrik/n8n-nodes-fulfillmenttools
2
+
3
+ [![NPM Version](https://img.shields.io/npm/v/@skriptfabrik/n8n-nodes-fulfillmenttools)](https://www.npmjs.com/package/@skriptfabrik/n8n-nodes-fulfillmenttools)
4
+ [![NPM Downloads](https://img.shields.io/npm/dt/@skriptfabrik/n8n-nodes-fulfillmenttools)](https://www.npmjs.com/package/@skriptfabrik/n8n-nodes-fulfillmenttools)
5
+
6
+ > [fulfillmenttools](https://fulfillmenttools.com/) community nodes for your [n8n](https://n8n.io/) workflows
7
+
8
+ This is an n8n community node and credential. It lets you consume the [fulfillmenttools](https://fulfillmenttools.com/)
9
+ API in your n8n workflows.
10
+ fulfillmenttools next Generation Order Management, Streamline your on- and offline business with our end-to-end order
11
+ lifecycle management backed by the power of 90+ years of retail experience.
12
+
13
+ [n8n](https://n8n.io/) is a [fair-code licensed](https://docs.n8n.io/reference/license/) workflow automation platform.
14
+
15
+ [Installation](#installation)
16
+ [Operations](#operations)
17
+ [Credentials](#credentials)
18
+ [Compatibility](#compatibility)
19
+ [Resources](#resources)
20
+
21
+ ## Installation
22
+
23
+ Follow the [installation guide](https://docs.n8n.io/integrations/community-nodes/installation/) in the n8n community
24
+ nodes documentation.
25
+
26
+ 1. Go to **Settings > Community Nodes**.
27
+ 2. Select **Install**.
28
+ 3. Enter `@skriptfabrik/n8n-nodes-fulfillmenttools` in **Enter npm package name**.
29
+ 4. Agree to the [risks](https://docs.n8n.io/integrations/community-nodes/risks/) of using community nodes: select
30
+ **I understand the risks of installing unverified code from a public source**.
31
+ 5. Select **Install**.
32
+
33
+ After installing the node, you can use it like any other node. n8n displays the node in search results in the **Nodes** panel.
34
+
35
+ ## Operations
36
+
37
+ It supports these operations:
38
+
39
+ - Add a new order for future fulfillment
40
+ - Retrieve a order with the given ID
41
+ - Return all orders
42
+ - Add a new facility
43
+ - Delete a favility with the given ID
44
+ - Retrieve a facility with the given ID
45
+ - Return all facilities
46
+ - Patch a facility with the given ID
47
+ - Create a connection of a configured carrier to the facility with the given ID
48
+ - Get the details for a carrier related to the facility with the given ID
49
+ - Get the available carriers for a facility
50
+ - Connect a configured carriere to the facility with the given ID
51
+
52
+ ## Credentials
53
+
54
+ The provided credential can be used to authenticate with fulfillmenttools.
55
+
56
+ ## Compatibility
57
+
58
+ Tested against n8n version 1.0+.
59
+
60
+ ## Resources
61
+
62
+ - [n8n community nodes documentation](https://docs.n8n.io/integrations/community-nodes/)
63
+ - [fulfillmenttools API](https://fulfillmenttools.github.io/api-reference-ui/)
package/package.json ADDED
@@ -0,0 +1,40 @@
1
+ {
2
+ "name": "@skriptfabrik/n8n-nodes-fulfillmenttools",
3
+ "version": "0.1.0",
4
+ "description": "fulfillmenttools nodes for n8n",
5
+ "keywords": [
6
+ "fulfillmenttools",
7
+ "n8n",
8
+ "n8n-community-node",
9
+ "n8n-community-node-package"
10
+ ],
11
+ "license": "MIT",
12
+ "homepage": "https://github.com/skriptfabrik/n8n-nodes/blob/main/nodes/fulfillmenttools/README.md",
13
+ "author": {
14
+ "name": "skriptfabrik",
15
+ "email": "info@skriptfabrik.com"
16
+ },
17
+ "repository": {
18
+ "type": "git",
19
+ "url": "git+https://github.com/skriptfabrik/n8n-nodes.git"
20
+ },
21
+ "main": "./src/index.js",
22
+ "typings": "./src/index.d.ts",
23
+ "type": "commonjs",
24
+ "n8n": {
25
+ "n8nNodesApiVersion": 1,
26
+ "credentials": [
27
+ "src/credentials/FulfillmenttoolsApi.credentials.js"
28
+ ],
29
+ "nodes": [
30
+ "src/nodes/Fulfillmenttools/Fulfillmenttools.node.js",
31
+ "src/nodes/Fulfillmenttools/FulfillmenttoolsTrigger.node.js"
32
+ ]
33
+ },
34
+ "dependencies": {
35
+ "tslib": "^2.6.2"
36
+ },
37
+ "peerDependencies": {
38
+ "n8n-workflow": "1.41.0"
39
+ }
40
+ }
@@ -0,0 +1,13 @@
1
+ import { type IAuthenticateGeneric, type ICredentialDataDecryptedObject, type ICredentialTestRequest, type ICredentialType, type IHttpRequestHelper, type INodeProperties } from 'n8n-workflow';
2
+ export declare class FulfillmenttoolsApi implements ICredentialType {
3
+ name: string;
4
+ displayName: string;
5
+ documentationUrl: string;
6
+ properties: INodeProperties[];
7
+ preAuthentication(this: IHttpRequestHelper, credentials: ICredentialDataDecryptedObject): Promise<{
8
+ idToken: string;
9
+ refreshToken: string;
10
+ }>;
11
+ authenticate: IAuthenticateGeneric;
12
+ test: ICredentialTestRequest;
13
+ }
@@ -0,0 +1,126 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FulfillmenttoolsApi = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const crypto_1 = require("crypto");
6
+ class FulfillmenttoolsApi {
7
+ constructor() {
8
+ this.name = 'fulfillmenttoolsApi';
9
+ this.displayName = 'fulfillmenttools API';
10
+ this.documentationUrl = 'https://docs.fulfillmenttools.com/api-docs/getting-started/make-your-first-api-call';
11
+ this.properties = [
12
+ {
13
+ displayName: 'Username',
14
+ name: 'username',
15
+ type: 'string',
16
+ required: true,
17
+ default: undefined,
18
+ },
19
+ {
20
+ displayName: 'Password',
21
+ name: 'password',
22
+ type: 'string',
23
+ typeOptions: {
24
+ password: true,
25
+ },
26
+ required: true,
27
+ default: undefined,
28
+ },
29
+ {
30
+ displayName: 'API Key',
31
+ name: 'apiKey',
32
+ type: 'string',
33
+ typeOptions: {
34
+ password: true,
35
+ },
36
+ required: true,
37
+ default: undefined,
38
+ },
39
+ {
40
+ displayName: 'Sub Domain',
41
+ name: 'subDomain',
42
+ type: 'string',
43
+ required: true,
44
+ default: undefined,
45
+ },
46
+ {
47
+ displayName: 'Webhook Token',
48
+ name: 'webhookToken',
49
+ type: 'string',
50
+ typeOptions: {
51
+ password: true,
52
+ },
53
+ required: true,
54
+ default: (0, crypto_1.randomBytes)(16).toString('hex'),
55
+ },
56
+ {
57
+ displayName: 'ID Token',
58
+ name: 'idToken',
59
+ type: 'hidden',
60
+ typeOptions: {
61
+ expirable: true,
62
+ },
63
+ default: undefined,
64
+ },
65
+ {
66
+ displayName: 'Refresh Token',
67
+ name: 'refreshToken',
68
+ type: 'hidden',
69
+ default: undefined,
70
+ },
71
+ ];
72
+ this.authenticate = {
73
+ type: 'generic',
74
+ properties: {
75
+ headers: {
76
+ Authorization: '=Bearer {{$credentials.idToken}}',
77
+ },
78
+ },
79
+ };
80
+ this.test = {
81
+ request: {
82
+ baseURL: '=https://{{$credentials.subDomain}}.api.fulfillmenttools.com/api',
83
+ url: '/health',
84
+ },
85
+ };
86
+ }
87
+ preAuthentication(credentials) {
88
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
89
+ if (!credentials['refreshToken']) {
90
+ const responseData = (yield this.helpers.httpRequest({
91
+ method: 'POST',
92
+ url: 'https://identitytoolkit.googleapis.com/v1/accounts:signInWithPassword',
93
+ body: {
94
+ email: `${credentials['username']}@${credentials['subDomain']}.com`,
95
+ password: credentials['password'],
96
+ returnSecureToken: true,
97
+ },
98
+ qs: {
99
+ key: credentials['apiKey'],
100
+ },
101
+ }));
102
+ return {
103
+ idToken: responseData.idToken,
104
+ refreshToken: responseData.refreshToken,
105
+ };
106
+ }
107
+ const responseData = (yield this.helpers.httpRequest({
108
+ method: 'POST',
109
+ url: 'https://securetoken.googleapis.com/v1/token',
110
+ body: {
111
+ grant_type: 'refresh_token',
112
+ refresh_token: credentials['refreshToken'],
113
+ },
114
+ qs: {
115
+ key: credentials['apiKey'],
116
+ },
117
+ }));
118
+ return {
119
+ idToken: responseData.id_token,
120
+ refreshToken: responseData.refresh_token,
121
+ };
122
+ });
123
+ }
124
+ }
125
+ exports.FulfillmenttoolsApi = FulfillmenttoolsApi;
126
+ //# sourceMappingURL=FulfillmenttoolsApi.credentials.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FulfillmenttoolsApi.credentials.js","sourceRoot":"","sources":["../../../../../nodes/fulfillmenttools/src/credentials/FulfillmenttoolsApi.credentials.ts"],"names":[],"mappings":";;;;AAAA,mCAAqC;AAqCrC,MAAa,mBAAmB;IAAhC;QACE,SAAI,GAAG,qBAAqB,CAAC;QAE7B,gBAAW,GAAG,sBAAsB,CAAC;QAErC,qBAAgB,GACd,qFAAqF,CAAC;QAExF,eAAU,GAAsB;YAC9B;gBACE,WAAW,EAAE,UAAU;gBACvB,IAAI,EAAE,UAAU;gBAChB,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,IAAI;gBACd,OAAO,EAAE,SAAS;aACnB;YACD;gBACE,WAAW,EAAE,UAAU;gBACvB,IAAI,EAAE,UAAU;gBAChB,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE;oBACX,QAAQ,EAAE,IAAI;iBACf;gBACD,QAAQ,EAAE,IAAI;gBACd,OAAO,EAAE,SAAS;aACnB;YACD;gBACE,WAAW,EAAE,SAAS;gBACtB,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE;oBACX,QAAQ,EAAE,IAAI;iBACf;gBACD,QAAQ,EAAE,IAAI;gBACd,OAAO,EAAE,SAAS;aACnB;YACD;gBACE,WAAW,EAAE,YAAY;gBACzB,IAAI,EAAE,WAAW;gBACjB,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,IAAI;gBACd,OAAO,EAAE,SAAS;aACnB;YACD;gBACE,WAAW,EAAE,eAAe;gBAC5B,IAAI,EAAE,cAAc;gBACpB,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE;oBACX,QAAQ,EAAE,IAAI;iBACf;gBACD,QAAQ,EAAE,IAAI;gBACd,OAAO,EAAE,IAAA,oBAAW,EAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC;aACzC;YACD;gBACE,WAAW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6CAA6C;gBAClD,IAAI,EAAE;oBACJ,UAAU,EAAE,eAAe;oBAC3B,aAAa,EAAE,WAAW,CAAC,cAAc,CAAC;iBAC3C;gBACD,EAAE,EAAE;oBACF,GAAG,EAAE,WAAW,CAAC,QAAQ,CAAC;iBAC3B;aACF,CAAC,CAAyB,CAAC;YAE5B,OAAO;gBACL,OAAO,EAAE,YAAY,CAAC,QAAQ;gBAC9B,YAAY,EAAE,YAAY,CAAC,aAAa;aACzC,CAAC;QACJ,CAAC;KAAA;CAkBF;AAhID,kDAgIC"}
@@ -0,0 +1,5 @@
1
+ import type { IExecuteFunctions, INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow';
2
+ export declare class Fulfillmenttools implements INodeType {
3
+ description: INodeTypeDescription;
4
+ execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
5
+ }
@@ -0,0 +1,174 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Fulfillmenttools = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const GenericFunctions_1 = require("./GenericFunctions");
6
+ const FacilityDescription_1 = require("./descriptions/FacilityDescription");
7
+ const FacilityCarrierDescription_1 = require("./descriptions/FacilityCarrierDescription");
8
+ const OrderDescription_1 = require("./descriptions/OrderDescription");
9
+ class Fulfillmenttools {
10
+ constructor() {
11
+ this.description = {
12
+ name: 'fulfillmenttools',
13
+ displayName: 'fulfillmenttools',
14
+ icon: 'file:icons/fulfillmenttools.svg',
15
+ group: ['transform'],
16
+ version: 1,
17
+ subtitle: '={{$parameter["operation"] + " " + $parameter["resource"]}}',
18
+ description: 'Consume fulfillmenttools API',
19
+ defaults: {
20
+ name: 'fulfillmenttools',
21
+ },
22
+ inputs: ['main'],
23
+ outputs: ['main'],
24
+ credentials: [
25
+ {
26
+ name: 'fulfillmenttoolsApi',
27
+ required: true,
28
+ },
29
+ ],
30
+ properties: [
31
+ {
32
+ displayName: 'Resource',
33
+ name: 'resource',
34
+ type: 'options',
35
+ noDataExpression: true,
36
+ options: [
37
+ {
38
+ name: 'Facility',
39
+ value: 'facility',
40
+ },
41
+ {
42
+ name: 'Facility Carrier',
43
+ value: 'facilityCarrier',
44
+ },
45
+ {
46
+ name: 'Order',
47
+ value: 'order',
48
+ },
49
+ ],
50
+ default: 'order',
51
+ },
52
+ ...FacilityDescription_1.facilityOperations,
53
+ ...FacilityDescription_1.facilityFields,
54
+ ...FacilityCarrierDescription_1.facilityCarrierOperations,
55
+ ...FacilityCarrierDescription_1.facilityCarrierFields,
56
+ ...OrderDescription_1.orderOperations,
57
+ ...OrderDescription_1.orderFields,
58
+ ],
59
+ };
60
+ }
61
+ execute() {
62
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
63
+ const items = this.getInputData();
64
+ const returnData = [];
65
+ let responseData = {};
66
+ const resource = this.getNodeParameter('resource', 0);
67
+ const operation = this.getNodeParameter('operation', 0);
68
+ for (let item = 0; item < items.length; item++) {
69
+ try {
70
+ if (resource === 'facility') {
71
+ if (operation === 'create') {
72
+ const body = this.getNodeParameter('facility', item);
73
+ responseData = (yield GenericFunctions_1.fulfillmenttoolsApiRequest.call(this, 'POST', '/facilities', body));
74
+ }
75
+ if (operation === 'delete') {
76
+ const facilityId = this.getNodeParameter('facilityId', item);
77
+ responseData = (yield GenericFunctions_1.fulfillmenttoolsApiRequest.call(this, 'DELETE', `/facilities/${facilityId}`));
78
+ }
79
+ if (operation === 'get') {
80
+ const facilityId = this.getNodeParameter('facilityId', item);
81
+ responseData = (yield GenericFunctions_1.fulfillmenttoolsApiRequest.call(this, 'GET', `/facilities/${facilityId}`));
82
+ }
83
+ if (operation === 'list') {
84
+ const returnAll = this.getNodeParameter('returnAll', item);
85
+ const qs = Object.assign(Object.assign({}, (returnAll
86
+ ? {}
87
+ : {
88
+ limit: this.getNodeParameter('limit', item),
89
+ startAfterId: this.getNodeParameter('startAfterId', item) || undefined,
90
+ })), { size: this.getNodeParameter('size', item), status: this.getNodeParameter('status', item) || undefined, tenantFacilityId: this.getNodeParameter('tenantFacilityId', item) || undefined, orderBy: this.getNodeParameter('orderBy', item) || undefined });
91
+ responseData = (yield GenericFunctions_1.fulfillmenttoolsApiRequestAllItems.call(this, 'facilities', 'GET', '/facilities', undefined, qs));
92
+ }
93
+ if (operation === 'patch') {
94
+ const facilityId = this.getNodeParameter('facilityId', item);
95
+ const body = this.getNodeParameter('facility', item);
96
+ responseData = (yield GenericFunctions_1.fulfillmenttoolsApiRequest.call(this, 'PATCH', `/facilities/${facilityId}`, body));
97
+ }
98
+ }
99
+ if (resource === 'facilityCarrier') {
100
+ if (operation === 'create') {
101
+ const facilityId = this.getNodeParameter('facilityId', item);
102
+ const carrierRef = this.getNodeParameter('carrierRef', item);
103
+ const body = this.getNodeParameter('facilityCarrier', item);
104
+ const qs = {
105
+ locale: this.getNodeParameter('locale', item) || undefined,
106
+ };
107
+ responseData = (yield GenericFunctions_1.fulfillmenttoolsApiRequest.call(this, 'POST', `/facilities/${facilityId}/carriers/${carrierRef}`, body, qs));
108
+ }
109
+ if (operation === 'get') {
110
+ const facilityId = this.getNodeParameter('facilityId', item);
111
+ const carrierRef = this.getNodeParameter('carrierRef', item);
112
+ const qs = {
113
+ locale: this.getNodeParameter('locale', item) || undefined,
114
+ };
115
+ responseData = (yield GenericFunctions_1.fulfillmenttoolsApiRequest.call(this, 'GET', `/facilities/${facilityId}/carriers/${carrierRef}`, undefined, qs));
116
+ }
117
+ if (operation === 'list') {
118
+ const facilityId = this.getNodeParameter('facilityId', item);
119
+ responseData = (yield GenericFunctions_1.fulfillmenttoolsApiRequestAllItems.call(this, 'carriers', 'GET', `/facilities/${facilityId}/carriers`));
120
+ }
121
+ if (operation === 'connect') {
122
+ const facilityId = this.getNodeParameter('facilityId', item);
123
+ const carrierRef = this.getNodeParameter('carrierRef', item);
124
+ const body = this.getNodeParameter('facilityCarrier', item);
125
+ const qs = {
126
+ locale: this.getNodeParameter('locale', item) || undefined,
127
+ };
128
+ responseData = (yield GenericFunctions_1.fulfillmenttoolsApiRequest.call(this, 'PUT', `/facilities/${facilityId}/carriers/${carrierRef}`, body, qs));
129
+ }
130
+ }
131
+ if (resource === 'order') {
132
+ if (operation === 'create') {
133
+ const body = this.getNodeParameter('order', item);
134
+ responseData = (yield GenericFunctions_1.fulfillmenttoolsApiRequest.call(this, 'POST', '/orders', body));
135
+ }
136
+ if (operation === 'get') {
137
+ const orderId = this.getNodeParameter('orderId', item);
138
+ responseData = (yield GenericFunctions_1.fulfillmenttoolsApiRequest.call(this, 'GET', `/orders/${orderId}`));
139
+ }
140
+ if (operation === 'list') {
141
+ const returnAll = this.getNodeParameter('returnAll', item);
142
+ const qs = Object.assign(Object.assign({}, (returnAll
143
+ ? {}
144
+ : {
145
+ limit: this.getNodeParameter('limit', item),
146
+ startAfterId: this.getNodeParameter('startAfterId', item) || undefined,
147
+ })), { size: this.getNodeParameter('size', item), tenantOrderId: this.getNodeParameter('tenantOrderId', item) || undefined });
148
+ responseData = (yield GenericFunctions_1.fulfillmenttoolsApiRequestAllItems.call(this, 'orders', 'GET', '/orders', undefined, qs));
149
+ }
150
+ }
151
+ const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item } });
152
+ returnData.push(...executionData);
153
+ }
154
+ catch (error) {
155
+ if (this.continueOnFail()) {
156
+ returnData.push({
157
+ json: {
158
+ error: error.message,
159
+ },
160
+ pairedItem: {
161
+ item,
162
+ },
163
+ });
164
+ continue;
165
+ }
166
+ throw error;
167
+ }
168
+ }
169
+ return [returnData];
170
+ });
171
+ }
172
+ }
173
+ exports.Fulfillmenttools = Fulfillmenttools;
174
+ //# sourceMappingURL=Fulfillmenttools.node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Fulfillmenttools.node.js","sourceRoot":"","sources":["../../../../../../nodes/fulfillmenttools/src/nodes/Fulfillmenttools/Fulfillmenttools.node.ts"],"names":[],"mappings":";;;;AASA,yDAG4B;AAC5B,4EAG4C;AAC5C,0FAGmD;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exVersion": "1.0",
5
+ "categories": ["Productivity"],
6
+ "resources": {
7
+ "credentialDocumentation": [
8
+ {
9
+ "url": "https://github.com/skriptfabrik/n8n-nodes/blob/main/nodes/fulfillmenttools/README.md"
10
+ }
11
+ ],
12
+ "primaryDocumentation": [
13
+ {
14
+ "url": "https://github.com/skriptfabrik/n8n-nodes/blob/main/nodes/fulfillmenttools/README.md"
15
+ }
16
+ ]
17
+ }
18
+ }
@@ -0,0 +1,12 @@
1
+ import type { IHookFunctions, INodeType, INodeTypeDescription, IWebhookFunctions, IWebhookResponseData } from 'n8n-workflow';
2
+ export declare class FulfillmenttoolsTrigger implements INodeType {
3
+ description: INodeTypeDescription;
4
+ webhookMethods: {
5
+ default: {
6
+ checkExists(this: IHookFunctions): Promise<boolean>;
7
+ create(this: IHookFunctions): Promise<boolean>;
8
+ delete(this: IHookFunctions): Promise<boolean>;
9
+ };
10
+ };
11
+ webhook(this: IWebhookFunctions): Promise<IWebhookResponseData>;
12
+ }