n8n-nodes-ivendnext-package 1.1.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 (34) hide show
  1. package/LICENSE.md +19 -0
  2. package/README.md +48 -0
  3. package/dist/credentials/iVendNextApi.credentials.d.ts +9 -0
  4. package/dist/credentials/iVendNextApi.credentials.js +155 -0
  5. package/dist/credentials/iVendNextApi.credentials.js.map +1 -0
  6. package/dist/nodes/iVendNext/DocumentDescription.d.ts +2 -0
  7. package/dist/nodes/iVendNext/DocumentDescription.js +226 -0
  8. package/dist/nodes/iVendNext/DocumentDescription.js.map +1 -0
  9. package/dist/nodes/iVendNext/GenericFunctions.d.ts +3 -0
  10. package/dist/nodes/iVendNext/GenericFunctions.js +92 -0
  11. package/dist/nodes/iVendNext/GenericFunctions.js.map +1 -0
  12. package/dist/nodes/iVendNext/__schema__/v1.0.0/document/create.json +33 -0
  13. package/dist/nodes/iVendNext/__schema__/v1.0.0/document/get.json +30 -0
  14. package/dist/nodes/iVendNext/__schema__/v1.0.0/document/getAll.json +9 -0
  15. package/dist/nodes/iVendNext/descriptions/all-descriptions.json +215517 -0
  16. package/dist/nodes/iVendNext/helper.d.ts +11 -0
  17. package/dist/nodes/iVendNext/helper.js +345 -0
  18. package/dist/nodes/iVendNext/helper.js.map +1 -0
  19. package/dist/nodes/iVendNext/iVendNext.node.d.ts +15 -0
  20. package/dist/nodes/iVendNext/iVendNext.node.js +320 -0
  21. package/dist/nodes/iVendNext/iVendNext.node.js.map +1 -0
  22. package/dist/nodes/iVendNext/iVendNext.node.json +18 -0
  23. package/dist/nodes/iVendNext/iVendNextTrigger.node.d.ts +17 -0
  24. package/dist/nodes/iVendNext/iVendNextTrigger.node.js +204 -0
  25. package/dist/nodes/iVendNext/iVendNextTrigger.node.js.map +1 -0
  26. package/dist/nodes/iVendNext/iVendNextTrigger.node.json +18 -0
  27. package/dist/nodes/iVendNext/ivendnext.svg +7 -0
  28. package/dist/nodes/iVendNext/utils.d.ts +17 -0
  29. package/dist/nodes/iVendNext/utils.js +236 -0
  30. package/dist/nodes/iVendNext/utils.js.map +1 -0
  31. package/dist/package.json +62 -0
  32. package/dist/tsconfig.tsbuildinfo +1 -0
  33. package/index.js +0 -0
  34. package/package.json +62 -0
package/LICENSE.md ADDED
@@ -0,0 +1,19 @@
1
+ Copyright 2022 n8n
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
4
+ this software and associated documentation files (the "Software"), to deal in
5
+ the Software without restriction, including without limitation the rights to
6
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
7
+ of the Software, and to permit persons to whom the Software is furnished to do
8
+ so, subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included in all
11
+ copies or substantial portions of the Software.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,48 @@
1
+ ![Banner image](https://user-images.githubusercontent.com/10284570/173569848-c624317f-42b1-45a6-ab09-f0ea3c247648.png)
2
+
3
+ # n8n-nodes-starter
4
+
5
+ This repo contains example nodes to help you get started building your own custom integrations for [n8n](https://n8n.io). It includes the node linter and other dependencies.
6
+
7
+ To make your custom node available to the community, you must create it as an npm package, and [submit it to the npm registry](https://docs.npmjs.com/packages-and-modules/contributing-packages-to-the-registry).
8
+
9
+ If you would like your node to be available on n8n cloud you can also [submit your node for verification](https://docs.n8n.io/integrations/creating-nodes/deploy/submit-community-nodes/).
10
+
11
+ ## Prerequisites
12
+
13
+ You need the following installed on your development machine:
14
+
15
+ * [git](https://git-scm.com/downloads)
16
+ * Node.js and npm. Minimum version Node 20. You can find instructions on how to install both using nvm (Node Version Manager) for Linux, Mac, and WSL [here](https://github.com/nvm-sh/nvm). For Windows users, refer to Microsoft's guide to [Install NodeJS on Windows](https://docs.microsoft.com/en-us/windows/dev-environment/javascript/nodejs-on-windows).
17
+ * Install n8n with:
18
+ ```
19
+ npm install n8n -g
20
+ ```
21
+ * Recommended: follow n8n's guide to [set up your development environment](https://docs.n8n.io/integrations/creating-nodes/build/node-development-environment/).
22
+
23
+ ## Using this starter
24
+
25
+ These are the basic steps for working with the starter. For detailed guidance on creating and publishing nodes, refer to the [documentation](https://docs.n8n.io/integrations/creating-nodes/).
26
+
27
+ 1. [Generate a new repository](https://github.com/n8n-io/n8n-nodes-starter/generate) from this template repository.
28
+ 2. Clone your new repo:
29
+ ```
30
+ git clone https://github.com/<your organization>/<your-repo-name>.git
31
+ ```
32
+ 3. Run `npm i` to install dependencies.
33
+ 4. Open the project in your editor.
34
+ 5. Browse the examples in `/nodes` and `/credentials`. Modify the examples, or replace them with your own nodes.
35
+ 6. Update the `package.json` to match your details.
36
+ 7. Run `npm run lint` to check for errors or `npm run lintfix` to automatically fix errors when possible.
37
+ 8. Test your node locally. Refer to [Run your node locally](https://docs.n8n.io/integrations/creating-nodes/test/run-node-locally/) for guidance.
38
+ 9. Replace this README with documentation for your node. Use the [README_TEMPLATE](README_TEMPLATE.md) to get started.
39
+ 10. Update the LICENSE file to use your details.
40
+ 11. [Publish](https://docs.npmjs.com/packages-and-modules/contributing-packages-to-the-registry) your package to npm.
41
+
42
+ ## More information
43
+
44
+ Refer to our [documentation on creating nodes](https://docs.n8n.io/integrations/creating-nodes/) for detailed information on building your own nodes.
45
+
46
+ ## License
47
+
48
+ [MIT](https://github.com/n8n-io/n8n-nodes-starter/blob/master/LICENSE.md)
@@ -0,0 +1,9 @@
1
+ import type { IAuthenticateGeneric, ICredentialTestRequest, ICredentialType, INodeProperties } from 'n8n-workflow';
2
+ export declare class iVendNextApi implements ICredentialType {
3
+ name: string;
4
+ displayName: string;
5
+ documentationUrl: string;
6
+ properties: INodeProperties[];
7
+ authenticate: IAuthenticateGeneric;
8
+ test: ICredentialTestRequest;
9
+ }
@@ -0,0 +1,155 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.iVendNextApi = void 0;
37
+ const packageJson = __importStar(require("../package.json"));
38
+ class iVendNextApi {
39
+ constructor() {
40
+ this.name = 'iVendNextApi';
41
+ this.displayName = 'iVendNext API';
42
+ this.documentationUrl = 'http://docs.ivendnext.com';
43
+ this.properties = [
44
+ {
45
+ displayName: 'API Key',
46
+ name: 'apiKey',
47
+ type: 'string',
48
+ typeOptions: { password: true },
49
+ default: '',
50
+ },
51
+ {
52
+ displayName: 'API Secret',
53
+ name: 'apiSecret',
54
+ type: 'string',
55
+ typeOptions: { password: true },
56
+ default: '',
57
+ },
58
+ {
59
+ displayName: 'Environment',
60
+ name: 'environment',
61
+ type: 'options',
62
+ default: 'selfHosted',
63
+ options: [
64
+ {
65
+ name: 'Self-Hosted',
66
+ value: 'selfHosted',
67
+ },
68
+ ],
69
+ },
70
+ {
71
+ displayName: 'Subdomain',
72
+ name: 'subdomain',
73
+ type: 'string',
74
+ default: '',
75
+ placeholder: 'n8n',
76
+ description: 'Subdomain of cloud-hosted ERPNext instance. For example, "n8n" is the subdomain in: <code>https://n8n.erpnext.com</code>',
77
+ displayOptions: {
78
+ show: {
79
+ environment: ['cloudHosted'],
80
+ },
81
+ },
82
+ },
83
+ {
84
+ displayName: 'Domain',
85
+ name: 'domain',
86
+ type: 'options',
87
+ default: 'ivendnext.in',
88
+ options: [
89
+ {
90
+ name: 'ivendnext.in',
91
+ value: 'ivendnext.in',
92
+ },
93
+ {
94
+ name: 'frappe.cloud',
95
+ value: 'frappe.cloud',
96
+ },
97
+ ],
98
+ description: 'Domain for your cloud hosted ERPNext instance.',
99
+ displayOptions: {
100
+ show: {
101
+ environment: ['cloudHosted'],
102
+ },
103
+ },
104
+ },
105
+ {
106
+ displayName: 'Domain',
107
+ name: 'domain',
108
+ type: 'string',
109
+ default: '',
110
+ placeholder: 'https://www.mydomain.com',
111
+ description: 'Fully qualified domain name of self-hosted ERPNext instance',
112
+ displayOptions: {
113
+ show: {
114
+ environment: ['selfHosted'],
115
+ },
116
+ },
117
+ },
118
+ {
119
+ displayName: 'Ignore SSL Issues (Insecure)',
120
+ name: 'allowUnauthorizedCerts',
121
+ type: 'boolean',
122
+ description: 'Whether to connect even if SSL certificate validation is not possible',
123
+ default: false,
124
+ },
125
+ ];
126
+ this.authenticate = {
127
+ type: 'generic',
128
+ properties: {
129
+ headers: {
130
+ Authorization: '=token {{$credentials.apiKey}}:{{$credentials.apiSecret}}',
131
+ 'X-IVEND-N8N-SOURCE': `n8n-v${(packageJson === null || packageJson === void 0 ? void 0 : packageJson.version) || '-next-n'}`,
132
+ },
133
+ },
134
+ };
135
+ this.test = {
136
+ request: {
137
+ baseURL: '={{$credentials.environment === "cloudHosted" ? "https://" + $credentials.subdomain + "." + $credentials.domain : $credentials.domain}}',
138
+ url: '/api/method/frappe.auth.get_logged_user',
139
+ skipSslCertificateValidation: '={{ $credentials.allowUnauthorizedCerts }}',
140
+ },
141
+ rules: [
142
+ {
143
+ type: 'responseSuccessBody',
144
+ properties: {
145
+ key: 'message',
146
+ value: undefined,
147
+ message: 'Unable to authenticate, Check the credentials and the url',
148
+ },
149
+ },
150
+ ],
151
+ };
152
+ }
153
+ }
154
+ exports.iVendNextApi = iVendNextApi;
155
+ //# sourceMappingURL=iVendNextApi.credentials.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"iVendNextApi.credentials.js","sourceRoot":"","sources":["../../credentials/iVendNextApi.credentials.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,6DAA+C;AAE/C,MAAa,YAAY;IAAzB;QACC,SAAI,GAAG,cAAc,CAAC;QAEtB,gBAAW,GAAG,eAAe,CAAC;QAE9B,qBAAgB,GAAG,2BAA2B,CAAC;QAE/C,eAAU,GAAsB;YAC/B;gBACC,WAAW,EAAE,SAAS;gBACtB,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;gBAC/B,OAAO,EAAE,EAAE;aACX;YACD;gBACC,WAAW,EAAE,YAAY;gBACzB,IAAI,EAAE,WAAW;gBACjB,IAA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;gBAC9B,IAAI,EAAE,SAAS;gBACf,WAAW,EAAE,uEAAuE;gBACpF,OAAO,EAAE,KAAK;aACd;SACD,CAAC;QAEF,iBAAY,GAAyB;YACpC,IAAI,EAAE,SAAS;YACf,UAAU,EAAE;gBACX,OAAO,EAAE;oBACR,aAAa,EAAE,2DAA2D;oBAC1E,oBAAoB,EAAE,QAAQ,CAAC,WAAmB,aAAnB,WAAW,uBAAX,WAAW,CAAU,OAAO,KAAI,SAAS,EAAE;iBAC1E;aACD;SACD,CAAC;QAEF,SAAI,GAA2B;YAC9B,OAAO,EAAE;gBACR,OAAO,EACN,yIAAyI;gBAC1I,GAAG,EAAE,yCAAyC;gBAC9C,4BAA4B,EAAE,4CAA4C;aAC1E;YACD,KAAK,EAAE;gBACN;oBACC,IAAI,EAAE,qBAAqB;oBAC3B,UAAU,EAAE;wBACX,GAAG,EAAE,SAAS;wBACd,KAAK,EAAE,SAAS;wBAChB,OAAO,EAAE,2DAA2D;qBACpE;iBACD;aACD;SACD,CAAC;IACH,CAAC;CAAA;AA5HD,oCA4HC"}
@@ -0,0 +1,2 @@
1
+ import { INodeProperties } from 'n8n-workflow';
2
+ export declare const documentMetaField: INodeProperties[];
@@ -0,0 +1,226 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.documentMetaField = void 0;
4
+ exports.documentMetaField = [
5
+ {
6
+ displayName: 'Fields (Fallback Mode)',
7
+ name: 'fieldsUi',
8
+ type: 'resourceMapper',
9
+ noDataExpression: true,
10
+ default: { mapping: {}, schema: [] },
11
+ description: 'Set document fields. Required fields shown first. Only used when DocType is not in pre-generated list.',
12
+ displayOptions: {
13
+ show: {
14
+ operation: ['create', 'update'],
15
+ },
16
+ },
17
+ typeOptions: {
18
+ loadOptionsDependsOn: ['docType', 'operation'],
19
+ resourceMapper: {
20
+ resourceMapperMethod: 'getAllFields',
21
+ mode: 'add',
22
+ fieldWords: { singular: 'field', plural: 'fields' },
23
+ addAllFields: false,
24
+ multiKeyMatch: false,
25
+ },
26
+ },
27
+ },
28
+ {
29
+ displayName: 'Document Name',
30
+ name: 'fallbackDocumentName',
31
+ type: 'string',
32
+ default: '',
33
+ required: false,
34
+ description: 'Document name for Get, Update, and Delete operations when using fallback fields',
35
+ displayOptions: {
36
+ show: {
37
+ operation: ['get', 'delete'],
38
+ },
39
+ },
40
+ },
41
+ {
42
+ displayName: 'Meta Fields',
43
+ name: 'fallbackFields',
44
+ type: 'fixedCollection',
45
+ placeholder: 'Add Field',
46
+ default: {},
47
+ displayOptions: {
48
+ hide: {
49
+ operation: ['delete', 'get', 'getAll'],
50
+ },
51
+ },
52
+ description: 'Manually add meta fields as needed',
53
+ typeOptions: {
54
+ multipleValues: true,
55
+ },
56
+ options: [
57
+ {
58
+ displayName: 'Field',
59
+ name: 'field',
60
+ values: [
61
+ {
62
+ displayName: 'Field Name',
63
+ name: 'name',
64
+ type: 'string',
65
+ default: '',
66
+ description: 'The exact field name as defined in ERPNext',
67
+ },
68
+ {
69
+ displayName: 'Value',
70
+ name: 'value',
71
+ type: 'string',
72
+ default: '',
73
+ description: 'Value to set for this field (use n8n expressions for numbers, JSON, etc.)',
74
+ },
75
+ ],
76
+ },
77
+ ],
78
+ },
79
+ {
80
+ displayName: 'Return All',
81
+ name: 'returnAll',
82
+ type: 'boolean',
83
+ default: false,
84
+ description: 'Whether to return all results or only up to a given limit',
85
+ displayOptions: {
86
+ show: {
87
+ resource: ['document'],
88
+ operation: ['getAll'],
89
+ },
90
+ },
91
+ },
92
+ {
93
+ displayName: 'Limit',
94
+ name: 'limit',
95
+ type: 'number',
96
+ typeOptions: {
97
+ minValue: 1,
98
+ },
99
+ default: 10,
100
+ description: 'Max number of results to return',
101
+ displayOptions: {
102
+ show: {
103
+ resource: ['document'],
104
+ operation: ['getAll'],
105
+ returnAll: [false],
106
+ },
107
+ },
108
+ },
109
+ {
110
+ displayName: 'Options',
111
+ name: 'options',
112
+ type: 'collection',
113
+ placeholder: 'Add Field',
114
+ default: {},
115
+ displayOptions: {
116
+ show: {
117
+ resource: ['document'],
118
+ operation: ['getAll'],
119
+ },
120
+ },
121
+ options: [
122
+ {
123
+ displayName: 'Field Names or IDs',
124
+ name: 'filterfields',
125
+ type: 'multiOptions',
126
+ typeOptions: {
127
+ loadOptionsMethod: 'getDocFilters',
128
+ loadOptionsDependsOn: ['docType'],
129
+ },
130
+ default: [],
131
+ description: 'Comma-separated list of fields to return. Choose from the list, or specify IDs using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
132
+ placeholder: 'name,country',
133
+ },
134
+ {
135
+ displayName: 'Filters',
136
+ name: 'filters',
137
+ type: 'fixedCollection',
138
+ default: {},
139
+ placeholder: 'Add Filter',
140
+ description: 'Custom Properties',
141
+ typeOptions: {
142
+ multipleValues: true,
143
+ },
144
+ options: [
145
+ {
146
+ displayName: 'Property',
147
+ name: 'customProperty',
148
+ values: [
149
+ {
150
+ displayName: 'Field Name or ID',
151
+ name: 'field',
152
+ type: 'options',
153
+ description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>',
154
+ typeOptions: {
155
+ loadOptionsMethod: 'getDocFields',
156
+ loadOptionsDependsOn: ['docType'],
157
+ },
158
+ default: '',
159
+ },
160
+ {
161
+ displayName: 'Operator',
162
+ name: 'operator',
163
+ type: 'options',
164
+ default: 'is',
165
+ options: [
166
+ {
167
+ name: '!=',
168
+ value: 'isNot',
169
+ },
170
+ {
171
+ name: '>=',
172
+ value: 'equalsGreater',
173
+ },
174
+ {
175
+ name: '<=',
176
+ value: 'equalsLess',
177
+ },
178
+ {
179
+ name: '=',
180
+ value: 'is',
181
+ },
182
+ {
183
+ name: '>',
184
+ value: 'greater',
185
+ },
186
+ {
187
+ name: '<',
188
+ value: 'less',
189
+ },
190
+ {
191
+ name: 'Like',
192
+ value: 'like',
193
+ },
194
+ {
195
+ name: 'Not Like',
196
+ value: 'notLike',
197
+ },
198
+ {
199
+ name: 'In',
200
+ value: 'in',
201
+ },
202
+ {
203
+ name: 'Not In',
204
+ value: 'notIn',
205
+ },
206
+ {
207
+ name: 'Child Of',
208
+ value: 'childOf',
209
+ },
210
+ ],
211
+ },
212
+ {
213
+ displayName: 'Value',
214
+ name: 'value',
215
+ type: 'string',
216
+ default: '',
217
+ description: 'Value of the operator condition',
218
+ },
219
+ ],
220
+ },
221
+ ],
222
+ },
223
+ ],
224
+ },
225
+ ];
226
+ //# sourceMappingURL=DocumentDescription.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DocumentDescription.js","sourceRoot":"","sources":["../../../nodes/iVendNext/DocumentDescription.ts"],"names":[],"mappings":";;;AAGa,QAAA,iBAAiB,GAAsB;IAEnD;QACC,WAAW,EAAE,wBAAwB;QACrC,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,gBAAgB;QACtB,gBAAgB,EAAE,IAAI;QACtB,OAAO,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE;QACpC,WAAW,EACV,wGAAwG;QACzG,cAAc,EAAE;YACf,IAAI,EAAE;gBACL,SAAS,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC;aAC/B;SACD;QACD,WAAW,EAAE;YACZ,oBAAoB,EAAE,CAAC,SAAS,EAAE,WAAW,CAAC;YAC9C,cAAc,EAAE;gBACf,oBAAoB,EAAE,cAAc;gBACpC,IAAI,EAAE,KAAK;gBACX,UAAU,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE;gBACnD,YAAY,EAAE,KAAK;gBACnB,aAAa,EAAE,KAAK;aACpB;SACD;KACD;IACD;QACC,WAAW,EAAE,eAAe;QAC5B,IAAI,EAAE,sBAAsB;QAC5B,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,EAAE;QACX,QAAQ,EAAE,KAAK;QACf,WAAW,EAAE,iFAAiF;QAC9F,cAAc,EAAE;YACf,IAAI,EAAE;gBACL,SAAS,EAAE,CAAC,KAAK,EAA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O,EAAE,IAAI;gCACb,OAAO,EAAE;oCACR;wCACC,IAAI,EAAE,IAAI;wCACV,KAAK,EAAE,OAAO;qCACd;oCACD;wCACC,IAAI,EAAE,IAAI;wCACV,KAAK,EAAE,eAAe;qCACtB;oCACD;wCACC,IAAI,EAAE,IAAI;wCACV,KAAK,EAAE,YAAY;qCACnB;oCACD;wCACC,IAAI,EAAE,GAAG;wCACT,KAAK,EAAE,IAAI;qCACX;oCACD;wCACC,IAAI,EAAE,GAAG;wCACT,KAAK,EAAE,SAAS;qCAChB;oCACD;wCACC,IAAI,EAAE,GAAG;wCACT,KAAK,EAAE,MAAM;qCACb;oCACD;wCACC,IAAI,EAAE,MAAM;wCACZ,KAAK,EAAE,MAAM;qCACb;oCACD;wCACC,IAAI,EAAE,UAAU;wCAChB,KAAK,EAAE,SAAS;qCAChB;oCACD;wCACC,IAAI,EAAE,IAAI;wCACV,KAAK,EAAE,IAAI;qCACX;oCACD;wCACC,IAAI,EAAE,QAAQ;wCACd,KAAK,EAAE,OAAO;qCACd;oCACD;wCACC,IAAI,EAAE,UAAU;wCAChB,KAAK,EAAE,SAAS;qCAChB;iCACD;6BACD;4BACD;gCACC,WAAW,EAAE,OAAO;gCACpB,IAAI,EAAE,OAAO;gCACb,IAAI,EAAE,QAAQ;gCACd,OAAO,EAAE,EAAE;gCACX,WAAW,EAAE,iCAAiC;6BAC9C;yBACD;qBACD;iBACD;aACD;SACD;KACD;CACD,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { IExecuteFunctions, ILoadOptionsFunctions, IDataObject, IHookFunctions, IWebhookFunctions, IHttpRequestMethods } from 'n8n-workflow';
2
+ export declare function erpNextApiRequest(this: IExecuteFunctions | IWebhookFunctions | IHookFunctions | ILoadOptionsFunctions, method: IHttpRequestMethods, resource: string, body?: IDataObject, query?: IDataObject, uri?: string, option?: IDataObject): Promise<any>;
3
+ export declare function erpNextApiRequestAllItems(this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions, propertyName: string, method: IHttpRequestMethods, resource: string, body: IDataObject, query?: IDataObject): Promise<any[]>;
@@ -0,0 +1,92 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.erpNextApiRequest = erpNextApiRequest;
37
+ exports.erpNextApiRequestAllItems = erpNextApiRequestAllItems;
38
+ const n8n_workflow_1 = require("n8n-workflow");
39
+ const packageJson = __importStar(require("../../package.json"));
40
+ const getBaseUrl = ({ environment, domain, subdomain }) => environment === 'cloudHosted' ? `https://${subdomain}.${domain}` : domain;
41
+ async function erpNextApiRequest(method, resource, body = {}, query = {}, uri, option = {}) {
42
+ const credentials = await this.getCredentials('iVendNextApi');
43
+ const baseUrl = getBaseUrl(credentials);
44
+ let options = {
45
+ headers: {
46
+ Accept: 'application/json',
47
+ 'Content-Type': 'application/json',
48
+ 'X-IVEND-N8N-SOURCE': `n8n-v${(packageJson === null || packageJson === void 0 ? void 0 : packageJson.version) || '-next-n'}`,
49
+ 'User-Agent': 'n8n',
50
+ },
51
+ method,
52
+ body,
53
+ qs: query,
54
+ uri: uri || `${baseUrl}${resource}`,
55
+ json: true,
56
+ rejectUnauthorized: !credentials.allowUnauthorizedCerts,
57
+ };
58
+ options = Object.assign({}, options, option);
59
+ if (!Object.keys(options.body).length) {
60
+ delete options.body;
61
+ }
62
+ if (!Object.keys(options.qs).length) {
63
+ delete options.qs;
64
+ }
65
+ try {
66
+ return await this.helpers.requestWithAuthentication.call(this, 'iVendNextApi', options);
67
+ }
68
+ catch (error) {
69
+ if (error.statusCode === 403) {
70
+ throw new n8n_workflow_1.NodeApiError(this.getNode(), { message: 'DocType unavailable.' });
71
+ }
72
+ if (error.statusCode === 307) {
73
+ throw new n8n_workflow_1.NodeApiError(this.getNode(), {
74
+ message: 'Please ensure the subdomain is correct.',
75
+ });
76
+ }
77
+ throw error;
78
+ }
79
+ }
80
+ async function erpNextApiRequestAllItems(propertyName, method, resource, body, query = {}) {
81
+ const returnData = [];
82
+ let responseData;
83
+ query.limit_start = 0;
84
+ query.limit_page_length = 1000;
85
+ do {
86
+ responseData = await erpNextApiRequest.call(this, method, resource, body, query);
87
+ returnData.push.apply(returnData, responseData[propertyName]);
88
+ query.limit_start += query.limit_page_length - 1;
89
+ } while (responseData.data && responseData.data.length > 0);
90
+ return returnData;
91
+ }
92
+ //# sourceMappingURL=GenericFunctions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GenericFunctions.js","sourceRoot":"","sources":["../../../nodes/iVendNext/GenericFunctions.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkBA,8CAkDC;AAED,8DAqBC;AAlFD,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CAAC;AACnB,CAAC"}
@@ -0,0 +1,33 @@
1
+ {
2
+ "type": "object",
3
+ "properties": {
4
+ "creation": {
5
+ "type": "string"
6
+ },
7
+ "disabled": {
8
+ "type": "integer"
9
+ },
10
+ "docstatus": {
11
+ "type": "integer"
12
+ },
13
+ "doctype": {
14
+ "type": "string"
15
+ },
16
+ "idx": {
17
+ "type": "integer"
18
+ },
19
+ "modified": {
20
+ "type": "string"
21
+ },
22
+ "modified_by": {
23
+ "type": "string"
24
+ },
25
+ "naming_series": {
26
+ "type": "string"
27
+ },
28
+ "owner": {
29
+ "type": "string"
30
+ }
31
+ },
32
+ "version": 1
33
+ }
@@ -0,0 +1,30 @@
1
+ {
2
+ "type": "object",
3
+ "properties": {
4
+ "creation": {
5
+ "type": "string"
6
+ },
7
+ "docstatus": {
8
+ "type": "integer"
9
+ },
10
+ "doctype": {
11
+ "type": "string"
12
+ },
13
+ "idx": {
14
+ "type": "integer"
15
+ },
16
+ "modified": {
17
+ "type": "string"
18
+ },
19
+ "modified_by": {
20
+ "type": "string"
21
+ },
22
+ "name": {
23
+ "type": "string"
24
+ },
25
+ "owner": {
26
+ "type": "string"
27
+ }
28
+ },
29
+ "version": 1
30
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "type": "object",
3
+ "properties": {
4
+ "name": {
5
+ "type": "string"
6
+ }
7
+ },
8
+ "version": 1
9
+ }