@chariow/n8n-nodes-chariow 0.0.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 (82) hide show
  1. package/LICENSE.md +21 -0
  2. package/README.md +236 -0
  3. package/dist/credentials/ChariowApi.credentials.d.ts +13 -0
  4. package/dist/credentials/ChariowApi.credentials.js +44 -0
  5. package/dist/icons/chariow.svg +27 -0
  6. package/dist/nodes/Chariow/Chariow.node.d.ts +5 -0
  7. package/dist/nodes/Chariow/Chariow.node.js +168 -0
  8. package/dist/nodes/Chariow/Chariow.node.json +18 -0
  9. package/dist/nodes/Chariow/ChariowTrigger.node.d.ts +12 -0
  10. package/dist/nodes/Chariow/ChariowTrigger.node.js +212 -0
  11. package/dist/nodes/Chariow/ChariowTrigger.node.json +18 -0
  12. package/dist/nodes/Chariow/resources/affiliate/get.d.ts +3 -0
  13. package/dist/nodes/Chariow/resources/affiliate/get.js +26 -0
  14. package/dist/nodes/Chariow/resources/affiliate/index.d.ts +6 -0
  15. package/dist/nodes/Chariow/resources/affiliate/index.js +69 -0
  16. package/dist/nodes/Chariow/resources/affiliate/sendInvitations.d.ts +3 -0
  17. package/dist/nodes/Chariow/resources/affiliate/sendInvitations.js +38 -0
  18. package/dist/nodes/Chariow/resources/checkout/create.d.ts +3 -0
  19. package/dist/nodes/Chariow/resources/checkout/create.js +356 -0
  20. package/dist/nodes/Chariow/resources/checkout/index.d.ts +5 -0
  21. package/dist/nodes/Chariow/resources/checkout/index.js +61 -0
  22. package/dist/nodes/Chariow/resources/customer/get.d.ts +3 -0
  23. package/dist/nodes/Chariow/resources/customer/get.js +26 -0
  24. package/dist/nodes/Chariow/resources/customer/getAll.d.ts +3 -0
  25. package/dist/nodes/Chariow/resources/customer/getAll.js +87 -0
  26. package/dist/nodes/Chariow/resources/customer/index.d.ts +6 -0
  27. package/dist/nodes/Chariow/resources/customer/index.js +69 -0
  28. package/dist/nodes/Chariow/resources/discount/get.d.ts +3 -0
  29. package/dist/nodes/Chariow/resources/discount/get.js +26 -0
  30. package/dist/nodes/Chariow/resources/discount/getAll.d.ts +3 -0
  31. package/dist/nodes/Chariow/resources/discount/getAll.js +99 -0
  32. package/dist/nodes/Chariow/resources/discount/index.d.ts +6 -0
  33. package/dist/nodes/Chariow/resources/discount/index.js +69 -0
  34. package/dist/nodes/Chariow/resources/index.d.ts +10 -0
  35. package/dist/nodes/Chariow/resources/index.js +54 -0
  36. package/dist/nodes/Chariow/resources/licence/activate.d.ts +3 -0
  37. package/dist/nodes/Chariow/resources/licence/activate.js +53 -0
  38. package/dist/nodes/Chariow/resources/licence/get.d.ts +3 -0
  39. package/dist/nodes/Chariow/resources/licence/get.js +26 -0
  40. package/dist/nodes/Chariow/resources/licence/getActivations.d.ts +3 -0
  41. package/dist/nodes/Chariow/resources/licence/getActivations.js +63 -0
  42. package/dist/nodes/Chariow/resources/licence/getAll.d.ts +3 -0
  43. package/dist/nodes/Chariow/resources/licence/getAll.js +92 -0
  44. package/dist/nodes/Chariow/resources/licence/index.d.ts +9 -0
  45. package/dist/nodes/Chariow/resources/licence/index.js +99 -0
  46. package/dist/nodes/Chariow/resources/licence/revoke.d.ts +3 -0
  47. package/dist/nodes/Chariow/resources/licence/revoke.js +53 -0
  48. package/dist/nodes/Chariow/resources/product/get.d.ts +3 -0
  49. package/dist/nodes/Chariow/resources/product/get.js +26 -0
  50. package/dist/nodes/Chariow/resources/product/getAll.d.ts +3 -0
  51. package/dist/nodes/Chariow/resources/product/getAll.js +107 -0
  52. package/dist/nodes/Chariow/resources/product/index.d.ts +6 -0
  53. package/dist/nodes/Chariow/resources/product/index.js +69 -0
  54. package/dist/nodes/Chariow/resources/pulse/get.d.ts +3 -0
  55. package/dist/nodes/Chariow/resources/pulse/get.js +27 -0
  56. package/dist/nodes/Chariow/resources/pulse/getAll.d.ts +3 -0
  57. package/dist/nodes/Chariow/resources/pulse/getAll.js +71 -0
  58. package/dist/nodes/Chariow/resources/pulse/index.d.ts +6 -0
  59. package/dist/nodes/Chariow/resources/pulse/index.js +69 -0
  60. package/dist/nodes/Chariow/resources/sale/get.d.ts +3 -0
  61. package/dist/nodes/Chariow/resources/sale/get.js +26 -0
  62. package/dist/nodes/Chariow/resources/sale/getAll.d.ts +3 -0
  63. package/dist/nodes/Chariow/resources/sale/getAll.js +110 -0
  64. package/dist/nodes/Chariow/resources/sale/index.d.ts +6 -0
  65. package/dist/nodes/Chariow/resources/sale/index.js +69 -0
  66. package/dist/nodes/Chariow/resources/store/getInfo.d.ts +3 -0
  67. package/dist/nodes/Chariow/resources/store/getInfo.js +10 -0
  68. package/dist/nodes/Chariow/resources/store/index.d.ts +5 -0
  69. package/dist/nodes/Chariow/resources/store/index.js +61 -0
  70. package/dist/nodes/Chariow/shared/constants.d.ts +24 -0
  71. package/dist/nodes/Chariow/shared/constants.js +27 -0
  72. package/dist/nodes/Chariow/shared/descriptions.d.ts +4 -0
  73. package/dist/nodes/Chariow/shared/descriptions.js +33 -0
  74. package/dist/nodes/Chariow/shared/index.d.ts +4 -0
  75. package/dist/nodes/Chariow/shared/index.js +20 -0
  76. package/dist/nodes/Chariow/shared/transport.d.ts +3 -0
  77. package/dist/nodes/Chariow/shared/transport.js +74 -0
  78. package/dist/nodes/Chariow/shared/utils.d.ts +3 -0
  79. package/dist/nodes/Chariow/shared/utils.js +26 -0
  80. package/dist/package.json +77 -0
  81. package/dist/tsconfig.tsbuildinfo +1 -0
  82. package/package.json +69 -0
@@ -0,0 +1,356 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.description = void 0;
4
+ exports.execute = execute;
5
+ const shared_1 = require("../../shared");
6
+ exports.description = [
7
+ {
8
+ displayName: 'Product ID',
9
+ name: 'productId',
10
+ type: 'string',
11
+ required: true,
12
+ default: '',
13
+ displayOptions: {
14
+ show: {
15
+ resource: ['checkout'],
16
+ operation: ['create'],
17
+ },
18
+ },
19
+ description: 'The product ID or slug to purchase (e.g., prd_abc123xyz or premium-course)',
20
+ },
21
+ {
22
+ displayName: 'Email',
23
+ name: 'email',
24
+ type: 'string',
25
+ placeholder: 'name@email.com',
26
+ required: true,
27
+ default: '',
28
+ displayOptions: {
29
+ show: {
30
+ resource: ['checkout'],
31
+ operation: ['create'],
32
+ },
33
+ },
34
+ description: 'Customer email address (max 255 characters)',
35
+ },
36
+ {
37
+ displayName: 'First Name',
38
+ name: 'firstName',
39
+ type: 'string',
40
+ required: true,
41
+ default: '',
42
+ displayOptions: {
43
+ show: {
44
+ resource: ['checkout'],
45
+ operation: ['create'],
46
+ },
47
+ },
48
+ description: 'Customer first name (max 50 characters)',
49
+ },
50
+ {
51
+ displayName: 'Last Name',
52
+ name: 'lastName',
53
+ type: 'string',
54
+ required: true,
55
+ default: '',
56
+ displayOptions: {
57
+ show: {
58
+ resource: ['checkout'],
59
+ operation: ['create'],
60
+ },
61
+ },
62
+ description: 'Customer last name (max 50 characters)',
63
+ },
64
+ {
65
+ displayName: 'Phone Number',
66
+ name: 'phoneNumber',
67
+ type: 'string',
68
+ required: true,
69
+ default: '',
70
+ displayOptions: {
71
+ show: {
72
+ resource: ['checkout'],
73
+ operation: ['create'],
74
+ },
75
+ },
76
+ description: 'Phone number (numeric only)',
77
+ },
78
+ {
79
+ displayName: 'Phone Country Code',
80
+ name: 'phoneCountryCode',
81
+ type: 'string',
82
+ required: true,
83
+ default: '',
84
+ displayOptions: {
85
+ show: {
86
+ resource: ['checkout'],
87
+ operation: ['create'],
88
+ },
89
+ },
90
+ placeholder: 'US',
91
+ description: 'ISO country code for phone number (e.g., US, FR, GB)',
92
+ },
93
+ {
94
+ displayName: 'Additional Fields',
95
+ name: 'additionalFields',
96
+ type: 'collection',
97
+ placeholder: 'Add Field',
98
+ default: {},
99
+ displayOptions: {
100
+ show: {
101
+ resource: ['checkout'],
102
+ operation: ['create'],
103
+ },
104
+ },
105
+ options: [
106
+ {
107
+ displayName: 'Affiliate Code',
108
+ name: 'affiliateCode',
109
+ type: 'string',
110
+ default: '',
111
+ description: 'Affiliate tracking code for commissions (max 50 characters)',
112
+ },
113
+ {
114
+ displayName: 'Campaign ID',
115
+ name: 'campaignId',
116
+ type: 'string',
117
+ default: '',
118
+ description: 'Campaign ID or tracking code for analytics',
119
+ },
120
+ {
121
+ displayName: 'Custom Fields',
122
+ name: 'customFields',
123
+ type: 'fixedCollection',
124
+ typeOptions: {
125
+ multipleValues: true,
126
+ },
127
+ default: {},
128
+ description: 'Custom field values matching product configuration',
129
+ options: [
130
+ {
131
+ name: 'field',
132
+ displayName: 'Field',
133
+ values: [
134
+ {
135
+ displayName: 'Key',
136
+ name: 'key',
137
+ type: 'string',
138
+ default: '',
139
+ description: 'The key of the custom field',
140
+ },
141
+ {
142
+ displayName: 'Value',
143
+ name: 'value',
144
+ type: 'string',
145
+ default: '',
146
+ description: 'The value of the custom field',
147
+ },
148
+ ],
149
+ },
150
+ ],
151
+ },
152
+ {
153
+ displayName: 'Custom Metadata',
154
+ name: 'customMetadata',
155
+ type: 'fixedCollection',
156
+ typeOptions: {
157
+ multipleValues: true,
158
+ },
159
+ default: {},
160
+ description: 'Custom key-value metadata to store with the sale (max 10 keys, 255 chars per value). Included in Pulse webhook payloads.',
161
+ options: [
162
+ {
163
+ name: 'metadata',
164
+ displayName: 'Metadata',
165
+ values: [
166
+ {
167
+ displayName: 'Key',
168
+ name: 'key',
169
+ type: 'string',
170
+ default: '',
171
+ description: 'The metadata key',
172
+ },
173
+ {
174
+ displayName: 'Value',
175
+ name: 'value',
176
+ type: 'string',
177
+ default: '',
178
+ description: 'The metadata value (max 255 characters)',
179
+ },
180
+ ],
181
+ },
182
+ ],
183
+ },
184
+ {
185
+ displayName: 'Discount Code',
186
+ name: 'discountCode',
187
+ type: 'string',
188
+ default: '',
189
+ description: 'Discount code to apply (max 100 characters)',
190
+ },
191
+ {
192
+ displayName: 'Payment Amount',
193
+ name: 'paymentAmount',
194
+ type: 'number',
195
+ default: 0,
196
+ description: 'Custom payment amount for pay-what-you-want products',
197
+ },
198
+ {
199
+ displayName: 'Payment Currency',
200
+ name: 'paymentCurrency',
201
+ type: 'string',
202
+ default: '',
203
+ placeholder: 'USD',
204
+ description: 'ISO 4217 currency code (defaults to store currency)',
205
+ },
206
+ {
207
+ displayName: 'Price Variant ID',
208
+ name: 'priceVariantId',
209
+ type: 'string',
210
+ default: '',
211
+ description: 'Price variant ID to use for this checkout (max 100 characters)',
212
+ },
213
+ {
214
+ displayName: 'Redirect URL',
215
+ name: 'redirectUrl',
216
+ type: 'string',
217
+ default: '',
218
+ description: 'Custom URL to redirect customers after payment completion (max 2048 characters)',
219
+ },
220
+ ],
221
+ },
222
+ {
223
+ displayName: 'Shipping Address',
224
+ name: 'shippingAddress',
225
+ type: 'collection',
226
+ placeholder: 'Add Shipping Field',
227
+ default: {},
228
+ displayOptions: {
229
+ show: {
230
+ resource: ['checkout'],
231
+ operation: ['create'],
232
+ },
233
+ },
234
+ description: 'Required when product has shipping enabled',
235
+ options: [
236
+ {
237
+ displayName: 'Address',
238
+ name: 'address',
239
+ type: 'string',
240
+ default: '',
241
+ description: 'Street address (max 255 characters)',
242
+ },
243
+ {
244
+ displayName: 'City',
245
+ name: 'city',
246
+ type: 'string',
247
+ default: '',
248
+ description: 'City name (max 100 characters)',
249
+ },
250
+ {
251
+ displayName: 'Country',
252
+ name: 'country',
253
+ type: 'string',
254
+ default: '',
255
+ placeholder: 'US',
256
+ description: 'ISO 3166-1 alpha-2 country code (e.g., US, FR, GB)',
257
+ },
258
+ {
259
+ displayName: 'State',
260
+ name: 'state',
261
+ type: 'string',
262
+ default: '',
263
+ description: 'State or region (max 100 characters)',
264
+ },
265
+ {
266
+ displayName: 'ZIP Code',
267
+ name: 'zip',
268
+ type: 'string',
269
+ default: '',
270
+ description: 'Postal/ZIP code (max 20 characters)',
271
+ },
272
+ ],
273
+ },
274
+ ];
275
+ async function execute(i) {
276
+ const productId = this.getNodeParameter('productId', i);
277
+ const email = this.getNodeParameter('email', i);
278
+ const firstName = this.getNodeParameter('firstName', i);
279
+ const lastName = this.getNodeParameter('lastName', i);
280
+ const phoneNumber = this.getNodeParameter('phoneNumber', i);
281
+ const phoneCountryCode = this.getNodeParameter('phoneCountryCode', i);
282
+ const additionalFields = this.getNodeParameter('additionalFields', i);
283
+ const shippingAddress = this.getNodeParameter('shippingAddress', i);
284
+ const body = {
285
+ product_id: productId,
286
+ email,
287
+ first_name: firstName,
288
+ last_name: lastName,
289
+ phone: {
290
+ number: phoneNumber,
291
+ country_code: phoneCountryCode,
292
+ },
293
+ };
294
+ if (additionalFields.discountCode) {
295
+ body.discount_code = additionalFields.discountCode;
296
+ }
297
+ if (additionalFields.campaignId) {
298
+ body.campaign_id = additionalFields.campaignId;
299
+ }
300
+ if (additionalFields.paymentCurrency) {
301
+ body.payment_currency = additionalFields.paymentCurrency;
302
+ }
303
+ if (additionalFields.redirectUrl) {
304
+ body.redirect_url = additionalFields.redirectUrl;
305
+ }
306
+ if (additionalFields.affiliateCode) {
307
+ body.affiliate_code = additionalFields.affiliateCode;
308
+ }
309
+ if (additionalFields.priceVariantId) {
310
+ body.price_variant_id = additionalFields.priceVariantId;
311
+ }
312
+ if (additionalFields.paymentAmount) {
313
+ body.payment_amount = additionalFields.paymentAmount;
314
+ }
315
+ const customFieldsData = additionalFields.customFields;
316
+ if (customFieldsData === null || customFieldsData === void 0 ? void 0 : customFieldsData.field) {
317
+ const customFields = {};
318
+ const fields = customFieldsData.field;
319
+ for (const field of fields) {
320
+ customFields[field.key] = field.value;
321
+ }
322
+ body.custom_fields = customFields;
323
+ }
324
+ const customMetadataData = additionalFields.customMetadata;
325
+ if (customMetadataData === null || customMetadataData === void 0 ? void 0 : customMetadataData.metadata) {
326
+ const customMetadata = {};
327
+ const metadataItems = customMetadataData.metadata;
328
+ for (const item of metadataItems) {
329
+ customMetadata[item.key] = item.value;
330
+ }
331
+ body.custom_metadata = customMetadata;
332
+ }
333
+ if (shippingAddress && Object.keys(shippingAddress).length > 0) {
334
+ const shipping = {};
335
+ if (shippingAddress.address) {
336
+ shipping.address = shippingAddress.address;
337
+ }
338
+ if (shippingAddress.city) {
339
+ shipping.city = shippingAddress.city;
340
+ }
341
+ if (shippingAddress.state) {
342
+ shipping.state = shippingAddress.state;
343
+ }
344
+ if (shippingAddress.country) {
345
+ shipping.country = shippingAddress.country;
346
+ }
347
+ if (shippingAddress.zip) {
348
+ shipping.zip = shippingAddress.zip;
349
+ }
350
+ if (Object.keys(shipping).length > 0) {
351
+ body.shipping = shipping;
352
+ }
353
+ }
354
+ const response = await shared_1.chariowApiRequest.call(this, 'POST', shared_1.ENDPOINTS.CHECKOUT, body);
355
+ return (0, shared_1.extractData)(response);
356
+ }
@@ -0,0 +1,5 @@
1
+ import type { INodeProperties } from 'n8n-workflow';
2
+ import * as create from './create';
3
+ export declare const operations: INodeProperties[];
4
+ export declare const fields: INodeProperties[];
5
+ export { create };
@@ -0,0 +1,61 @@
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.create = exports.fields = exports.operations = void 0;
37
+ const create = __importStar(require("./create"));
38
+ exports.create = create;
39
+ exports.operations = [
40
+ {
41
+ displayName: 'Operation',
42
+ name: 'operation',
43
+ type: 'options',
44
+ noDataExpression: true,
45
+ displayOptions: {
46
+ show: {
47
+ resource: ['checkout'],
48
+ },
49
+ },
50
+ options: [
51
+ {
52
+ name: 'Create',
53
+ value: 'create',
54
+ description: 'Create a new checkout session',
55
+ action: 'Create a checkout',
56
+ },
57
+ ],
58
+ default: 'create',
59
+ },
60
+ ];
61
+ exports.fields = [...create.description];
@@ -0,0 +1,3 @@
1
+ import type { IExecuteFunctions, IDataObject, INodeProperties } from 'n8n-workflow';
2
+ export declare const description: INodeProperties[];
3
+ export declare function execute(this: IExecuteFunctions, i: number): Promise<IDataObject>;
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.description = void 0;
4
+ exports.execute = execute;
5
+ const shared_1 = require("../../shared");
6
+ exports.description = [
7
+ {
8
+ displayName: 'Customer ID',
9
+ name: 'customerId',
10
+ type: 'string',
11
+ required: true,
12
+ default: '',
13
+ displayOptions: {
14
+ show: {
15
+ resource: ['customer'],
16
+ operation: ['get'],
17
+ },
18
+ },
19
+ description: 'The ID of the customer to retrieve (e.g., cus_abc123xyz)',
20
+ },
21
+ ];
22
+ async function execute(i) {
23
+ const customerId = this.getNodeParameter('customerId', i);
24
+ const response = await shared_1.chariowApiRequest.call(this, 'GET', shared_1.ENDPOINTS.CUSTOMER(customerId));
25
+ return (0, shared_1.extractData)(response);
26
+ }
@@ -0,0 +1,3 @@
1
+ import type { IExecuteFunctions, IDataObject, INodeProperties } from 'n8n-workflow';
2
+ export declare const description: INodeProperties[];
3
+ export declare function execute(this: IExecuteFunctions, i: number): Promise<IDataObject[]>;
@@ -0,0 +1,87 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.description = void 0;
4
+ exports.execute = execute;
5
+ const shared_1 = require("../../shared");
6
+ exports.description = [
7
+ {
8
+ displayName: 'Return All',
9
+ name: 'returnAll',
10
+ type: 'boolean',
11
+ default: false,
12
+ displayOptions: {
13
+ show: {
14
+ resource: ['customer'],
15
+ operation: ['getAll'],
16
+ },
17
+ },
18
+ description: 'Whether to return all results or only up to a given limit',
19
+ },
20
+ {
21
+ displayName: 'Limit',
22
+ name: 'limit',
23
+ type: 'number',
24
+ default: 50,
25
+ typeOptions: {
26
+ minValue: 1,
27
+ maxValue: 100,
28
+ },
29
+ displayOptions: {
30
+ show: {
31
+ resource: ['customer'],
32
+ operation: ['getAll'],
33
+ returnAll: [false],
34
+ },
35
+ },
36
+ description: 'Max number of results to return',
37
+ },
38
+ {
39
+ displayName: 'Filters',
40
+ name: 'filters',
41
+ type: 'collection',
42
+ placeholder: 'Add Filter',
43
+ default: {},
44
+ displayOptions: {
45
+ show: {
46
+ resource: ['customer'],
47
+ operation: ['getAll'],
48
+ },
49
+ },
50
+ options: [
51
+ {
52
+ displayName: 'End Date',
53
+ name: 'end_date',
54
+ type: 'string',
55
+ default: '',
56
+ placeholder: '2025-12-31',
57
+ description: 'Filter customers created before this date (YYYY-MM-DD format)',
58
+ },
59
+ {
60
+ displayName: 'Search',
61
+ name: 'search',
62
+ type: 'string',
63
+ default: '',
64
+ description: 'Search customers by first name, last name, email, or phone',
65
+ },
66
+ {
67
+ displayName: 'Start Date',
68
+ name: 'start_date',
69
+ type: 'string',
70
+ default: '',
71
+ placeholder: '2025-01-01',
72
+ description: 'Filter customers created after this date (YYYY-MM-DD format)',
73
+ },
74
+ ],
75
+ },
76
+ ];
77
+ async function execute(i) {
78
+ const returnAll = this.getNodeParameter('returnAll', i);
79
+ const filters = this.getNodeParameter('filters', i);
80
+ const limit = this.getNodeParameter('limit', i, 50);
81
+ const query = (0, shared_1.buildListQuery)(limit, returnAll, filters);
82
+ if (returnAll) {
83
+ return shared_1.chariowApiRequestAllItems.call(this, 'GET', shared_1.ENDPOINTS.CUSTOMERS, {}, query);
84
+ }
85
+ const response = await shared_1.chariowApiRequest.call(this, 'GET', shared_1.ENDPOINTS.CUSTOMERS, {}, query);
86
+ return (0, shared_1.extractData)(response);
87
+ }
@@ -0,0 +1,6 @@
1
+ import type { INodeProperties } from 'n8n-workflow';
2
+ import * as get from './get';
3
+ import * as getAll from './getAll';
4
+ export declare const operations: INodeProperties[];
5
+ export declare const fields: INodeProperties[];
6
+ export { get, getAll };
@@ -0,0 +1,69 @@
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.getAll = exports.get = exports.fields = exports.operations = void 0;
37
+ const get = __importStar(require("./get"));
38
+ exports.get = get;
39
+ const getAll = __importStar(require("./getAll"));
40
+ exports.getAll = getAll;
41
+ exports.operations = [
42
+ {
43
+ displayName: 'Operation',
44
+ name: 'operation',
45
+ type: 'options',
46
+ noDataExpression: true,
47
+ displayOptions: {
48
+ show: {
49
+ resource: ['customer'],
50
+ },
51
+ },
52
+ options: [
53
+ {
54
+ name: 'Get',
55
+ value: 'get',
56
+ description: 'Get a customer by ID',
57
+ action: 'Get a customer',
58
+ },
59
+ {
60
+ name: 'Get Many',
61
+ value: 'getAll',
62
+ description: 'Get many customers',
63
+ action: 'Get many customers',
64
+ },
65
+ ],
66
+ default: 'get',
67
+ },
68
+ ];
69
+ exports.fields = [...get.description, ...getAll.description];
@@ -0,0 +1,3 @@
1
+ import type { IExecuteFunctions, IDataObject, INodeProperties } from 'n8n-workflow';
2
+ export declare const description: INodeProperties[];
3
+ export declare function execute(this: IExecuteFunctions, i: number): Promise<IDataObject>;
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.description = void 0;
4
+ exports.execute = execute;
5
+ const shared_1 = require("../../shared");
6
+ exports.description = [
7
+ {
8
+ displayName: 'Discount ID',
9
+ name: 'discountId',
10
+ type: 'string',
11
+ required: true,
12
+ default: '',
13
+ displayOptions: {
14
+ show: {
15
+ resource: ['discount'],
16
+ operation: ['get'],
17
+ },
18
+ },
19
+ description: 'The ID of the discount to retrieve (e.g., dis_abc123xyz)',
20
+ },
21
+ ];
22
+ async function execute(i) {
23
+ const discountId = this.getNodeParameter('discountId', i);
24
+ const response = await shared_1.chariowApiRequest.call(this, 'GET', shared_1.ENDPOINTS.DISCOUNT(discountId));
25
+ return (0, shared_1.extractData)(response);
26
+ }
@@ -0,0 +1,3 @@
1
+ import type { IExecuteFunctions, IDataObject, INodeProperties } from 'n8n-workflow';
2
+ export declare const description: INodeProperties[];
3
+ export declare function execute(this: IExecuteFunctions, i: number): Promise<IDataObject[]>;