@deliverart/sdk-js-customer 0.0.5 → 1.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 (36) hide show
  1. package/package.json +12 -26
  2. package/.changeset/config.json +0 -11
  3. package/.github/workflows/workflow.yml +0 -47
  4. package/.prettierrc +0 -7
  5. package/CHANGELOG.md +0 -61
  6. package/README.md +0 -3
  7. package/dist/index.cjs +0 -768
  8. package/dist/index.d.cts +0 -4485
  9. package/dist/index.d.ts +0 -4485
  10. package/dist/index.js +0 -688
  11. package/eslint.config.js +0 -41
  12. package/src/index.ts +0 -3
  13. package/src/models.ts +0 -102
  14. package/src/requests/customer-addresses/CreateCustomerAddress.ts +0 -36
  15. package/src/requests/customer-addresses/DeleteCustomerAddress.ts +0 -27
  16. package/src/requests/customer-addresses/GetCustomerAddressDetails.ts +0 -33
  17. package/src/requests/customer-addresses/GetCustomerAddresses.ts +0 -57
  18. package/src/requests/customer-addresses/GetCustomerAddressesForCustomer.ts +0 -55
  19. package/src/requests/customer-addresses/UpdateCustomerAddress.ts +0 -39
  20. package/src/requests/customer-addresses/index.ts +0 -6
  21. package/src/requests/customer-business-profiles/CreateCustomerBusinessProfile.ts +0 -39
  22. package/src/requests/customer-business-profiles/DeleteCustomerBusinessProfile.ts +0 -27
  23. package/src/requests/customer-business-profiles/GetCustomerBusinessProfileDetails.ts +0 -33
  24. package/src/requests/customer-business-profiles/GetCustomerBusinessProfiles.ts +0 -67
  25. package/src/requests/customer-business-profiles/GetCustomerBusinessProfilesForCustomer.ts +0 -61
  26. package/src/requests/customer-business-profiles/UpdateCustomerBusinessProfile.ts +0 -42
  27. package/src/requests/customer-business-profiles/index.ts +0 -6
  28. package/src/requests/customers/CreateCustomer.ts +0 -32
  29. package/src/requests/customers/DeleteCustomer.ts +0 -27
  30. package/src/requests/customers/GetCustomerDetails.ts +0 -30
  31. package/src/requests/customers/GetCustomers.ts +0 -72
  32. package/src/requests/customers/UpdateCustomer.ts +0 -35
  33. package/src/requests/customers/index.ts +0 -5
  34. package/src/requests/index.ts +0 -3
  35. package/src/types.ts +0 -90
  36. package/tsconfig.json +0 -15
package/dist/index.cjs DELETED
@@ -1,768 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
-
20
- // src/index.ts
21
- var index_exports = {};
22
- __export(index_exports, {
23
- CreateCustomer: () => CreateCustomer,
24
- CreateCustomerAddress: () => CreateCustomerAddress,
25
- CreateCustomerBusinessProfile: () => CreateCustomerBusinessProfile,
26
- DeleteCustomer: () => DeleteCustomer,
27
- DeleteCustomerAddress: () => DeleteCustomerAddress,
28
- DeleteCustomerBusinessProfile: () => DeleteCustomerBusinessProfile,
29
- GetCustomerAddressDetails: () => GetCustomerAddressDetails,
30
- GetCustomerAddresses: () => GetCustomerAddresses,
31
- GetCustomerAddressesForCustomer: () => GetCustomerAddressesForCustomer,
32
- GetCustomerBusinessProfileDetails: () => GetCustomerBusinessProfileDetails,
33
- GetCustomerBusinessProfiles: () => GetCustomerBusinessProfiles,
34
- GetCustomerBusinessProfilesForCustomer: () => GetCustomerBusinessProfilesForCustomer,
35
- GetCustomerDetails: () => GetCustomerDetails,
36
- GetCustomers: () => GetCustomers,
37
- UpdateCustomer: () => UpdateCustomer,
38
- UpdateCustomerAddress: () => UpdateCustomerAddress,
39
- UpdateCustomerBusinessProfile: () => UpdateCustomerBusinessProfile,
40
- createCustomerAddressInputSchema: () => createCustomerAddressInputSchema,
41
- createCustomerAddressResponseSchema: () => createCustomerAddressResponseSchema,
42
- createCustomerBusinessProfileInputSchema: () => createCustomerBusinessProfileInputSchema,
43
- createCustomerBusinessProfileResponseSchema: () => createCustomerBusinessProfileResponseSchema,
44
- createCustomerInputSchema: () => createCustomerInputSchema,
45
- createCustomerResponseSchema: () => createCustomerResponseSchema,
46
- customerAddressDetailsSchema: () => customerAddressDetailsSchema,
47
- customerAddressNullablePathSchema: () => customerAddressNullablePathSchema,
48
- customerAddressPathSchema: () => customerAddressPathSchema,
49
- customerAddressSchema: () => customerAddressSchema,
50
- customerBusinessProfileDetailsSchema: () => customerBusinessProfileDetailsSchema,
51
- customerBusinessProfileNullablePathSchema: () => customerBusinessProfileNullablePathSchema,
52
- customerBusinessProfilePathSchema: () => customerBusinessProfilePathSchema,
53
- customerBusinessProfileSchema: () => customerBusinessProfileSchema,
54
- customerDetailsSchema: () => customerDetailsSchema,
55
- customerNullablePathSchema: () => customerNullablePathSchema,
56
- customerPathSchema: () => customerPathSchema,
57
- customerSchema: () => customerSchema,
58
- deleteCustomerAddressInputSchema: () => deleteCustomerAddressInputSchema,
59
- deleteCustomerAddressResponseSchema: () => deleteCustomerAddressResponseSchema,
60
- deleteCustomerBusinessProfileInputSchema: () => deleteCustomerBusinessProfileInputSchema,
61
- deleteCustomerBusinessProfileResponseSchema: () => deleteCustomerBusinessProfileResponseSchema,
62
- deleteCustomerInputSchema: () => deleteCustomerInputSchema,
63
- deleteCustomerResponseSchema: () => deleteCustomerResponseSchema,
64
- getCustomerAddressDetailsInputSchema: () => getCustomerAddressDetailsInputSchema,
65
- getCustomerAddressDetailsResponseSchema: () => getCustomerAddressDetailsResponseSchema,
66
- getCustomerAddressesForCustomerInputSchema: () => getCustomerAddressesForCustomerInputSchema,
67
- getCustomerAddressesForCustomerQuerySchema: () => getCustomerAddressesForCustomerQuerySchema,
68
- getCustomerAddressesForCustomerResponseSchema: () => getCustomerAddressesForCustomerResponseSchema,
69
- getCustomerAddressesInputSchema: () => getCustomerAddressesInputSchema,
70
- getCustomerAddressesQuerySchema: () => getCustomerAddressesQuerySchema,
71
- getCustomerAddressesResponseSchema: () => getCustomerAddressesResponseSchema,
72
- getCustomerBusinessProfileDetailsInputSchema: () => getCustomerBusinessProfileDetailsInputSchema,
73
- getCustomerBusinessProfileDetailsResponseSchema: () => getCustomerBusinessProfileDetailsResponseSchema,
74
- getCustomerBusinessProfilesForCustomerInputSchema: () => getCustomerBusinessProfilesForCustomerInputSchema,
75
- getCustomerBusinessProfilesForCustomerQuerySchema: () => getCustomerBusinessProfilesForCustomerQuerySchema,
76
- getCustomerBusinessProfilesForCustomerResponseSchema: () => getCustomerBusinessProfilesForCustomerResponseSchema,
77
- getCustomerBusinessProfilesInputSchema: () => getCustomerBusinessProfilesInputSchema,
78
- getCustomerBusinessProfilesQuerySchema: () => getCustomerBusinessProfilesQuerySchema,
79
- getCustomerBusinessProfilesResponseSchema: () => getCustomerBusinessProfilesResponseSchema,
80
- getCustomerDetailsInputSchema: () => getCustomerDetailsInputSchema,
81
- getCustomerDetailsResponseSchema: () => getCustomerDetailsResponseSchema,
82
- getCustomersInputSchema: () => getCustomersInputSchema,
83
- getCustomersQuerySchema: () => getCustomersQuerySchema,
84
- getCustomersResponseSchema: () => getCustomersResponseSchema,
85
- updateCustomerAddressInputSchema: () => updateCustomerAddressInputSchema,
86
- updateCustomerAddressResponseSchema: () => updateCustomerAddressResponseSchema,
87
- updateCustomerBusinessProfileInputSchema: () => updateCustomerBusinessProfileInputSchema,
88
- updateCustomerBusinessProfileResponseSchema: () => updateCustomerBusinessProfileResponseSchema,
89
- updateCustomerInputSchema: () => updateCustomerInputSchema,
90
- updateCustomerResponseSchema: () => updateCustomerResponseSchema,
91
- writableCreateCustomerAddressSchema: () => writableCreateCustomerAddressSchema,
92
- writableCreateCustomerBusinessProfileSchema: () => writableCreateCustomerBusinessProfileSchema,
93
- writableCreateCustomerSchema: () => writableCreateCustomerSchema,
94
- writableCustomerAddressSchema: () => writableCustomerAddressSchema,
95
- writableCustomerBusinessProfileSchema: () => writableCustomerBusinessProfileSchema,
96
- writableCustomerSchema: () => writableCustomerSchema
97
- });
98
- module.exports = __toCommonJS(index_exports);
99
-
100
- // src/models.ts
101
- var import_sdk_js_global_types = require("@deliverart/sdk-js-global-types");
102
- var import_sdk_js_point_of_sale = require("@deliverart/sdk-js-point-of-sale");
103
- var import_sdk_js_user = require("@deliverart/sdk-js-user");
104
- var import_zod2 = require("zod");
105
-
106
- // src/types.ts
107
- var import_zod = require("zod");
108
- var customerPathSchema = import_zod.z.string().refine(
109
- (val) => /^\/customers\/[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/.test(
110
- val
111
- ),
112
- {
113
- message: "Invalid customer path format"
114
- }
115
- );
116
- var customerNullablePathSchema = import_zod.z.string().nullable().refine(
117
- (val) => {
118
- if (!val) return true;
119
- return /^\/customers\/[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/.test(
120
- val
121
- );
122
- },
123
- {
124
- message: "Invalid customer path format"
125
- }
126
- );
127
- var customerAddressPathSchema = import_zod.z.string().refine(
128
- (val) => /^\/customers\/addresses\/[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/.test(
129
- val
130
- ),
131
- {
132
- message: "Invalid customerAddress path format"
133
- }
134
- );
135
- var customerAddressNullablePathSchema = import_zod.z.string().nullable().refine(
136
- (val) => {
137
- if (!val) return true;
138
- return /^\/customers\/addresses\/[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/.test(
139
- val
140
- );
141
- },
142
- {
143
- message: "Invalid customerAddress path format"
144
- }
145
- );
146
- var customerBusinessProfilePathSchema = import_zod.z.string().refine(
147
- (val) => /^\/customers\/business_profiles\/[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/.test(
148
- val
149
- ),
150
- {
151
- message: "Invalid customerBusinessProfile path format"
152
- }
153
- );
154
- var customerBusinessProfileNullablePathSchema = import_zod.z.string().nullable().refine(
155
- (val) => {
156
- if (!val) return true;
157
- return /^\/customers\/business_profiles\/[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/.test(
158
- val
159
- );
160
- },
161
- {
162
- message: "Invalid customerBusinessProfile path format"
163
- }
164
- );
165
-
166
- // src/models.ts
167
- var customerSchema = import_zod2.z.object({
168
- id: import_zod2.z.string(),
169
- firstName: import_zod2.z.string().nullable(),
170
- lastName: import_zod2.z.string().nullable(),
171
- email: import_zod2.z.string().email().nullable(),
172
- phoneNumber: import_zod2.z.string().nullable(),
173
- hasBusinessProfiles: import_zod2.z.boolean(),
174
- hasAddresses: import_zod2.z.boolean(),
175
- ordersPlaced: import_zod2.z.number(),
176
- totalSpent: import_zod2.z.string(),
177
- createdAt: import_sdk_js_global_types.datetimeSchema,
178
- updatedAt: import_sdk_js_global_types.datetimeSchema
179
- });
180
- var customerDetailsSchema = customerSchema.extend({
181
- pointOfSale: import_sdk_js_point_of_sale.pointOfSaleNullablePathSchema,
182
- owner: import_sdk_js_user.userNullablePathSchema,
183
- addresses: import_zod2.z.array(customerAddressPathSchema),
184
- businessProfiles: import_zod2.z.array(customerBusinessProfilePathSchema)
185
- });
186
- var writableCreateCustomerSchema = customerDetailsSchema.pick({
187
- pointOfSale: true,
188
- firstName: true,
189
- lastName: true,
190
- email: true,
191
- phoneNumber: true
192
- });
193
- var writableCustomerSchema = writableCreateCustomerSchema.omit({
194
- pointOfSale: true
195
- });
196
- var customerAddressSchema = import_zod2.z.object({
197
- id: import_zod2.z.string(),
198
- address: import_sdk_js_global_types.addressSchema,
199
- location: import_sdk_js_global_types.locationSchema,
200
- createdAt: import_sdk_js_global_types.datetimeSchema,
201
- updatedAt: import_sdk_js_global_types.datetimeSchema
202
- });
203
- var customerAddressDetailsSchema = customerAddressSchema.extend({
204
- customer: customerPathSchema
205
- });
206
- var writableCreateCustomerAddressSchema = customerAddressDetailsSchema.pick({
207
- customer: true,
208
- address: true
209
- });
210
- var writableCustomerAddressSchema = writableCreateCustomerAddressSchema.omit({
211
- customer: true
212
- });
213
- var customerBusinessProfileSchema = import_zod2.z.object({
214
- id: import_zod2.z.string(),
215
- businessName: import_zod2.z.string(),
216
- vat: import_zod2.z.string(),
217
- taxCode: import_zod2.z.string(),
218
- billingAddress: import_sdk_js_global_types.addressSchema,
219
- billingData: import_sdk_js_global_types.billingDataSchema,
220
- createdAt: import_sdk_js_global_types.datetimeSchema,
221
- updatedAt: import_sdk_js_global_types.datetimeSchema
222
- });
223
- var customerBusinessProfileDetailsSchema = customerBusinessProfileSchema.extend({
224
- customer: customerPathSchema
225
- });
226
- var writableCreateCustomerBusinessProfileSchema = customerBusinessProfileDetailsSchema.pick({
227
- customer: true,
228
- businessName: true,
229
- vat: true,
230
- taxCode: true,
231
- billingAddress: true,
232
- billingData: true
233
- });
234
- var writableCustomerBusinessProfileSchema = writableCreateCustomerBusinessProfileSchema.omit({
235
- customer: true
236
- });
237
-
238
- // src/requests/customer-addresses/CreateCustomerAddress.ts
239
- var import_sdk_js_core = require("@deliverart/sdk-js-core");
240
- var createCustomerAddressInputSchema = writableCreateCustomerAddressSchema.required();
241
- var createCustomerAddressResponseSchema = customerAddressDetailsSchema;
242
- var CreateCustomerAddress = class extends import_sdk_js_core.AbstractApiRequest {
243
- method = "POST";
244
- contentType = "application/json";
245
- accept = "application/json";
246
- inputSchema = createCustomerAddressInputSchema;
247
- outputSchema = createCustomerAddressResponseSchema;
248
- querySchema = void 0;
249
- headersSchema = void 0;
250
- constructor(input) {
251
- super(input);
252
- }
253
- getPath() {
254
- return "/customers/addresses";
255
- }
256
- };
257
-
258
- // src/requests/customer-addresses/DeleteCustomerAddress.ts
259
- var import_sdk_js_core2 = require("@deliverart/sdk-js-core");
260
- var import_zod3 = require("zod");
261
- var deleteCustomerAddressInputSchema = import_zod3.z.undefined();
262
- var deleteCustomerAddressResponseSchema = import_zod3.z.undefined();
263
- var DeleteCustomerAddress = class extends import_sdk_js_core2.AbstractApiRequest {
264
- method = "DELETE";
265
- contentType = "application/json";
266
- accept = "application/json";
267
- inputSchema = deleteCustomerAddressInputSchema;
268
- outputSchema = deleteCustomerAddressResponseSchema;
269
- querySchema = void 0;
270
- headersSchema = void 0;
271
- customerAddressId;
272
- constructor(customerAddressId) {
273
- super();
274
- this.customerAddressId = customerAddressId;
275
- }
276
- getPath() {
277
- return `/customers/addresses/${this.customerAddressId}`;
278
- }
279
- };
280
-
281
- // src/requests/customer-addresses/GetCustomerAddressDetails.ts
282
- var import_sdk_js_core3 = require("@deliverart/sdk-js-core");
283
- var import_zod4 = require("zod");
284
- var getCustomerAddressDetailsInputSchema = import_zod4.z.undefined();
285
- var getCustomerAddressDetailsResponseSchema = customerAddressDetailsSchema;
286
- var GetCustomerAddressDetails = class extends import_sdk_js_core3.AbstractApiRequest {
287
- method = "GET";
288
- contentType = "application/json";
289
- accept = "application/json";
290
- inputSchema = getCustomerAddressDetailsInputSchema;
291
- outputSchema = getCustomerAddressDetailsResponseSchema;
292
- querySchema = void 0;
293
- headersSchema = void 0;
294
- customerAddressId;
295
- constructor(customerAddressId) {
296
- super();
297
- this.customerAddressId = customerAddressId;
298
- }
299
- getPath() {
300
- return `/customers/addresses/${this.customerAddressId}`;
301
- }
302
- };
303
-
304
- // src/requests/customer-addresses/GetCustomerAddresses.ts
305
- var import_sdk_js_core4 = require("@deliverart/sdk-js-core");
306
- var import_sdk_js_global_types2 = require("@deliverart/sdk-js-global-types");
307
- var import_zod5 = require("zod");
308
- var getCustomerAddressesQuerySchema = import_zod5.z.object({
309
- "order[createdAt]": import_sdk_js_global_types2.sortDirSchema.optional(),
310
- "order[updatedAt]": import_sdk_js_global_types2.sortDirSchema.optional(),
311
- page: import_zod5.z.coerce.number().optional()
312
- }).merge(import_sdk_js_global_types2.timestampsFilterSchema);
313
- var getCustomerAddressesResponseSchema = (0, import_sdk_js_global_types2.createPaginatedSchema)(customerAddressSchema);
314
- var getCustomerAddressesInputSchema = import_zod5.z.undefined();
315
- var GetCustomerAddresses = class extends import_sdk_js_core4.AbstractApiRequest {
316
- method = "GET";
317
- contentType = "application/json";
318
- accept = "application/json";
319
- inputSchema = getCustomerAddressesInputSchema;
320
- outputSchema = getCustomerAddressesResponseSchema;
321
- querySchema = getCustomerAddressesQuerySchema;
322
- headersSchema = void 0;
323
- constructor(options) {
324
- super(void 0, options);
325
- }
326
- getPath() {
327
- return "/customers/addresses";
328
- }
329
- parseResponse(data, rawResponse) {
330
- const customerAddresses = import_zod5.z.array(customerAddressSchema).parse(data);
331
- return this.validateOutput({
332
- data: customerAddresses,
333
- pagination: (0, import_sdk_js_global_types2.responseToPagination)(rawResponse)
334
- });
335
- }
336
- };
337
-
338
- // src/requests/customer-addresses/GetCustomerAddressesForCustomer.ts
339
- var import_sdk_js_core5 = require("@deliverart/sdk-js-core");
340
- var import_sdk_js_global_types3 = require("@deliverart/sdk-js-global-types");
341
- var import_zod6 = require("zod");
342
- var getCustomerAddressesForCustomerQuerySchema = import_zod6.z.object({
343
- "order[createdAt]": import_sdk_js_global_types3.sortDirSchema.optional(),
344
- "order[updatedAt]": import_sdk_js_global_types3.sortDirSchema.optional()
345
- }).merge(import_sdk_js_global_types3.timestampsFilterSchema);
346
- var getCustomerAddressesForCustomerResponseSchema = import_zod6.z.array(customerAddressSchema);
347
- var getCustomerAddressesForCustomerInputSchema = import_zod6.z.undefined();
348
- var GetCustomerAddressesForCustomer = class extends import_sdk_js_core5.AbstractApiRequest {
349
- method = "GET";
350
- contentType = "application/json";
351
- accept = "application/json";
352
- inputSchema = getCustomerAddressesForCustomerInputSchema;
353
- outputSchema = getCustomerAddressesForCustomerResponseSchema;
354
- querySchema = getCustomerAddressesForCustomerQuerySchema;
355
- headersSchema = void 0;
356
- customerId;
357
- constructor(customerId, options) {
358
- super(void 0, options);
359
- this.customerId = customerId;
360
- }
361
- getPath() {
362
- return `/customers/${this.customerId}/addresses`;
363
- }
364
- parseResponse(data) {
365
- return import_zod6.z.array(customerAddressSchema).parse(data);
366
- }
367
- };
368
-
369
- // src/requests/customer-addresses/UpdateCustomerAddress.ts
370
- var import_sdk_js_core6 = require("@deliverart/sdk-js-core");
371
- var updateCustomerAddressInputSchema = writableCustomerAddressSchema.partial();
372
- var updateCustomerAddressResponseSchema = customerAddressDetailsSchema;
373
- var UpdateCustomerAddress = class extends import_sdk_js_core6.AbstractApiRequest {
374
- method = "PATCH";
375
- contentType = "application/merge-patch+json";
376
- accept = "application/json";
377
- inputSchema = updateCustomerAddressInputSchema;
378
- outputSchema = updateCustomerAddressResponseSchema;
379
- querySchema = void 0;
380
- headersSchema = void 0;
381
- customerId;
382
- constructor(customerId, input) {
383
- super(input);
384
- this.customerId = customerId;
385
- }
386
- getPath() {
387
- return `/customers/addresses/${this.customerId}`;
388
- }
389
- };
390
-
391
- // src/requests/customer-business-profiles/CreateCustomerBusinessProfile.ts
392
- var import_sdk_js_core7 = require("@deliverart/sdk-js-core");
393
- var createCustomerBusinessProfileInputSchema = writableCreateCustomerBusinessProfileSchema.required();
394
- var createCustomerBusinessProfileResponseSchema = customerBusinessProfileDetailsSchema;
395
- var CreateCustomerBusinessProfile = class extends import_sdk_js_core7.AbstractApiRequest {
396
- method = "POST";
397
- contentType = "application/json";
398
- accept = "application/json";
399
- inputSchema = createCustomerBusinessProfileInputSchema;
400
- outputSchema = createCustomerBusinessProfileResponseSchema;
401
- querySchema = void 0;
402
- headersSchema = void 0;
403
- constructor(input) {
404
- super(input);
405
- }
406
- getPath() {
407
- return "/customers/business_profiles";
408
- }
409
- };
410
-
411
- // src/requests/customer-business-profiles/DeleteCustomerBusinessProfile.ts
412
- var import_sdk_js_core8 = require("@deliverart/sdk-js-core");
413
- var import_zod7 = require("zod");
414
- var deleteCustomerBusinessProfileInputSchema = import_zod7.z.undefined();
415
- var deleteCustomerBusinessProfileResponseSchema = import_zod7.z.undefined();
416
- var DeleteCustomerBusinessProfile = class extends import_sdk_js_core8.AbstractApiRequest {
417
- method = "DELETE";
418
- contentType = "application/json";
419
- accept = "application/json";
420
- inputSchema = deleteCustomerBusinessProfileInputSchema;
421
- outputSchema = deleteCustomerBusinessProfileResponseSchema;
422
- querySchema = void 0;
423
- headersSchema = void 0;
424
- customerBusinessProfileId;
425
- constructor(customerBusinessProfileId) {
426
- super();
427
- this.customerBusinessProfileId = customerBusinessProfileId;
428
- }
429
- getPath() {
430
- return `/customers/business_profiles/${this.customerBusinessProfileId}`;
431
- }
432
- };
433
-
434
- // src/requests/customer-business-profiles/GetCustomerBusinessProfileDetails.ts
435
- var import_sdk_js_core9 = require("@deliverart/sdk-js-core");
436
- var import_zod8 = require("zod");
437
- var getCustomerBusinessProfileDetailsInputSchema = import_zod8.z.undefined();
438
- var getCustomerBusinessProfileDetailsResponseSchema = customerBusinessProfileDetailsSchema;
439
- var GetCustomerBusinessProfileDetails = class extends import_sdk_js_core9.AbstractApiRequest {
440
- method = "GET";
441
- contentType = "application/json";
442
- accept = "application/json";
443
- inputSchema = getCustomerBusinessProfileDetailsInputSchema;
444
- outputSchema = getCustomerBusinessProfileDetailsResponseSchema;
445
- querySchema = void 0;
446
- headersSchema = void 0;
447
- customerBusinessProfileId;
448
- constructor(customerBusinessProfileId) {
449
- super();
450
- this.customerBusinessProfileId = customerBusinessProfileId;
451
- }
452
- getPath() {
453
- return `/customers/business_profiles/${this.customerBusinessProfileId}`;
454
- }
455
- };
456
-
457
- // src/requests/customer-business-profiles/GetCustomerBusinessProfiles.ts
458
- var import_sdk_js_core10 = require("@deliverart/sdk-js-core");
459
- var import_sdk_js_global_types4 = require("@deliverart/sdk-js-global-types");
460
- var import_zod9 = require("zod");
461
- var getCustomerBusinessProfilesQuerySchema = import_zod9.z.object({
462
- "order[businessName]": import_sdk_js_global_types4.sortDirSchema.optional(),
463
- "order[createdAt]": import_sdk_js_global_types4.sortDirSchema.optional(),
464
- "order[updatedAt]": import_sdk_js_global_types4.sortDirSchema.optional(),
465
- businessName: import_zod9.z.string().optional(),
466
- vat: import_zod9.z.string().optional(),
467
- taxCode: import_zod9.z.string().optional(),
468
- page: import_zod9.z.coerce.number().optional()
469
- }).merge(import_sdk_js_global_types4.timestampsFilterSchema);
470
- var getCustomerBusinessProfilesResponseSchema = (0, import_sdk_js_global_types4.createPaginatedSchema)(
471
- customerBusinessProfileSchema
472
- );
473
- var getCustomerBusinessProfilesInputSchema = import_zod9.z.undefined();
474
- var GetCustomerBusinessProfiles = class extends import_sdk_js_core10.AbstractApiRequest {
475
- method = "GET";
476
- contentType = "application/json";
477
- accept = "application/json";
478
- inputSchema = getCustomerBusinessProfilesInputSchema;
479
- outputSchema = getCustomerBusinessProfilesResponseSchema;
480
- querySchema = getCustomerBusinessProfilesQuerySchema;
481
- headersSchema = void 0;
482
- constructor(options) {
483
- super(void 0, options);
484
- }
485
- getPath() {
486
- return "/customers/business_profiles";
487
- }
488
- parseResponse(data, rawResponse) {
489
- const customerBusinessProfiles = import_zod9.z.array(customerBusinessProfileSchema).parse(data);
490
- return this.validateOutput({
491
- data: customerBusinessProfiles,
492
- pagination: (0, import_sdk_js_global_types4.responseToPagination)(rawResponse)
493
- });
494
- }
495
- };
496
-
497
- // src/requests/customer-business-profiles/GetCustomerBusinessProfilesForCustomer.ts
498
- var import_sdk_js_core11 = require("@deliverart/sdk-js-core");
499
- var import_sdk_js_global_types5 = require("@deliverart/sdk-js-global-types");
500
- var import_zod10 = require("zod");
501
- var getCustomerBusinessProfilesForCustomerQuerySchema = import_zod10.z.object({
502
- "order[businessName]": import_sdk_js_global_types5.sortDirSchema.optional(),
503
- "order[createdAt]": import_sdk_js_global_types5.sortDirSchema.optional(),
504
- "order[updatedAt]": import_sdk_js_global_types5.sortDirSchema.optional(),
505
- businessName: import_zod10.z.string().optional(),
506
- vat: import_zod10.z.string().optional(),
507
- taxCode: import_zod10.z.string().optional()
508
- }).merge(import_sdk_js_global_types5.timestampsFilterSchema);
509
- var getCustomerBusinessProfilesForCustomerResponseSchema = import_zod10.z.array(
510
- customerBusinessProfileSchema
511
- );
512
- var getCustomerBusinessProfilesForCustomerInputSchema = import_zod10.z.undefined();
513
- var GetCustomerBusinessProfilesForCustomer = class extends import_sdk_js_core11.AbstractApiRequest {
514
- method = "GET";
515
- contentType = "application/json";
516
- accept = "application/json";
517
- inputSchema = getCustomerBusinessProfilesForCustomerInputSchema;
518
- outputSchema = getCustomerBusinessProfilesForCustomerResponseSchema;
519
- querySchema = getCustomerBusinessProfilesForCustomerQuerySchema;
520
- headersSchema = void 0;
521
- customerId;
522
- constructor(customerId, options) {
523
- super(void 0, options);
524
- this.customerId = customerId;
525
- }
526
- getPath() {
527
- return `/customers/${this.customerId}/business_profiles`;
528
- }
529
- parseResponse(data) {
530
- return import_zod10.z.array(customerBusinessProfileSchema).parse(data);
531
- }
532
- };
533
-
534
- // src/requests/customer-business-profiles/UpdateCustomerBusinessProfile.ts
535
- var import_sdk_js_core12 = require("@deliverart/sdk-js-core");
536
- var updateCustomerBusinessProfileInputSchema = writableCustomerBusinessProfileSchema.partial();
537
- var updateCustomerBusinessProfileResponseSchema = customerBusinessProfileDetailsSchema;
538
- var UpdateCustomerBusinessProfile = class extends import_sdk_js_core12.AbstractApiRequest {
539
- method = "PATCH";
540
- contentType = "application/merge-patch+json";
541
- accept = "application/json";
542
- inputSchema = updateCustomerBusinessProfileInputSchema;
543
- outputSchema = updateCustomerBusinessProfileResponseSchema;
544
- querySchema = void 0;
545
- headersSchema = void 0;
546
- customerId;
547
- constructor(customerId, input) {
548
- super(input);
549
- this.customerId = customerId;
550
- }
551
- getPath() {
552
- return `/customers/business_profiles/${this.customerId}`;
553
- }
554
- };
555
-
556
- // src/requests/customers/CreateCustomer.ts
557
- var import_sdk_js_core13 = require("@deliverart/sdk-js-core");
558
- var createCustomerInputSchema = writableCreateCustomerSchema.required();
559
- var createCustomerResponseSchema = customerDetailsSchema;
560
- var CreateCustomer = class extends import_sdk_js_core13.AbstractApiRequest {
561
- method = "POST";
562
- contentType = "application/json";
563
- accept = "application/json";
564
- inputSchema = createCustomerInputSchema;
565
- outputSchema = createCustomerResponseSchema;
566
- querySchema = void 0;
567
- headersSchema = void 0;
568
- constructor(input) {
569
- super(input);
570
- }
571
- getPath() {
572
- return "/customers";
573
- }
574
- };
575
-
576
- // src/requests/customers/DeleteCustomer.ts
577
- var import_sdk_js_core14 = require("@deliverart/sdk-js-core");
578
- var import_zod11 = require("zod");
579
- var deleteCustomerInputSchema = import_zod11.z.undefined();
580
- var deleteCustomerResponseSchema = import_zod11.z.undefined();
581
- var DeleteCustomer = class extends import_sdk_js_core14.AbstractApiRequest {
582
- method = "DELETE";
583
- contentType = "application/json";
584
- accept = "application/json";
585
- inputSchema = deleteCustomerInputSchema;
586
- outputSchema = deleteCustomerResponseSchema;
587
- querySchema = void 0;
588
- headersSchema = void 0;
589
- customerId;
590
- constructor(customerId) {
591
- super();
592
- this.customerId = customerId;
593
- }
594
- getPath() {
595
- return `/customers/${this.customerId}`;
596
- }
597
- };
598
-
599
- // src/requests/customers/GetCustomerDetails.ts
600
- var import_sdk_js_core15 = require("@deliverart/sdk-js-core");
601
- var import_zod12 = require("zod");
602
- var getCustomerDetailsInputSchema = import_zod12.z.undefined();
603
- var getCustomerDetailsResponseSchema = customerDetailsSchema;
604
- var GetCustomerDetails = class extends import_sdk_js_core15.AbstractApiRequest {
605
- method = "GET";
606
- contentType = "application/json";
607
- accept = "application/json";
608
- inputSchema = getCustomerDetailsInputSchema;
609
- outputSchema = getCustomerDetailsResponseSchema;
610
- querySchema = void 0;
611
- headersSchema = void 0;
612
- customerId;
613
- constructor(customerId) {
614
- super();
615
- this.customerId = customerId;
616
- }
617
- getPath() {
618
- return `/customers/${this.customerId}`;
619
- }
620
- };
621
-
622
- // src/requests/customers/GetCustomers.ts
623
- var import_sdk_js_core16 = require("@deliverart/sdk-js-core");
624
- var import_sdk_js_global_types6 = require("@deliverart/sdk-js-global-types");
625
- var import_zod13 = require("zod");
626
- var getCustomersQuerySchema = import_zod13.z.object({
627
- firstName: import_zod13.z.string().optional(),
628
- lastName: import_zod13.z.string().optional(),
629
- email: import_zod13.z.string().optional(),
630
- phoneNumber: import_zod13.z.string().optional(),
631
- hasBusinessProfiles: import_zod13.z.coerce.boolean().optional(),
632
- hasAddresses: import_zod13.z.coerce.boolean().optional(),
633
- "ordersPlaced[between]": import_zod13.z.coerce.number().optional(),
634
- "ordersPlaced[gt]": import_zod13.z.coerce.number().optional(),
635
- "ordersPlaced[gte]": import_zod13.z.coerce.number().optional(),
636
- "ordersPlaced[lt]": import_zod13.z.coerce.number().optional(),
637
- "ordersPlaced[lte]": import_zod13.z.coerce.number().optional(),
638
- "totalSpent[between]": import_zod13.z.coerce.number().optional(),
639
- "totalSpent[gt]": import_zod13.z.coerce.string().optional(),
640
- "totalSpent[gte]": import_zod13.z.coerce.string().optional(),
641
- "totalSpent[lt]": import_zod13.z.coerce.string().optional(),
642
- "totalSpent[lte]": import_zod13.z.coerce.string().optional(),
643
- "order[firstName]": import_sdk_js_global_types6.sortDirSchema.optional(),
644
- "order[lastName]": import_sdk_js_global_types6.sortDirSchema.optional(),
645
- "order[createdAt]": import_sdk_js_global_types6.sortDirSchema.optional(),
646
- "order[updatedAt]": import_sdk_js_global_types6.sortDirSchema.optional(),
647
- page: import_zod13.z.coerce.number().optional()
648
- }).merge(import_sdk_js_global_types6.timestampsFilterSchema);
649
- var getCustomersResponseSchema = (0, import_sdk_js_global_types6.createPaginatedSchema)(customerSchema);
650
- var getCustomersInputSchema = import_zod13.z.undefined();
651
- var GetCustomers = class extends import_sdk_js_core16.AbstractApiRequest {
652
- method = "GET";
653
- contentType = "application/json";
654
- accept = "application/json";
655
- inputSchema = getCustomersInputSchema;
656
- outputSchema = getCustomersResponseSchema;
657
- querySchema = getCustomersQuerySchema;
658
- headersSchema = void 0;
659
- constructor(options) {
660
- super(void 0, options);
661
- }
662
- getPath() {
663
- return "/customers";
664
- }
665
- parseResponse(data, rawResponse) {
666
- const customers = import_zod13.z.array(customerSchema).parse(data);
667
- return this.validateOutput({ data: customers, pagination: (0, import_sdk_js_global_types6.responseToPagination)(rawResponse) });
668
- }
669
- };
670
-
671
- // src/requests/customers/UpdateCustomer.ts
672
- var import_sdk_js_core17 = require("@deliverart/sdk-js-core");
673
- var updateCustomerInputSchema = writableCustomerSchema.partial();
674
- var updateCustomerResponseSchema = customerDetailsSchema;
675
- var UpdateCustomer = class extends import_sdk_js_core17.AbstractApiRequest {
676
- method = "PATCH";
677
- contentType = "application/merge-patch+json";
678
- accept = "application/json";
679
- inputSchema = updateCustomerInputSchema;
680
- outputSchema = updateCustomerResponseSchema;
681
- querySchema = void 0;
682
- headersSchema = void 0;
683
- customerId;
684
- constructor(customerId, input) {
685
- super(input);
686
- this.customerId = customerId;
687
- }
688
- getPath() {
689
- return `/customers/${this.customerId}`;
690
- }
691
- };
692
- // Annotate the CommonJS export names for ESM import in node:
693
- 0 && (module.exports = {
694
- CreateCustomer,
695
- CreateCustomerAddress,
696
- CreateCustomerBusinessProfile,
697
- DeleteCustomer,
698
- DeleteCustomerAddress,
699
- DeleteCustomerBusinessProfile,
700
- GetCustomerAddressDetails,
701
- GetCustomerAddresses,
702
- GetCustomerAddressesForCustomer,
703
- GetCustomerBusinessProfileDetails,
704
- GetCustomerBusinessProfiles,
705
- GetCustomerBusinessProfilesForCustomer,
706
- GetCustomerDetails,
707
- GetCustomers,
708
- UpdateCustomer,
709
- UpdateCustomerAddress,
710
- UpdateCustomerBusinessProfile,
711
- createCustomerAddressInputSchema,
712
- createCustomerAddressResponseSchema,
713
- createCustomerBusinessProfileInputSchema,
714
- createCustomerBusinessProfileResponseSchema,
715
- createCustomerInputSchema,
716
- createCustomerResponseSchema,
717
- customerAddressDetailsSchema,
718
- customerAddressNullablePathSchema,
719
- customerAddressPathSchema,
720
- customerAddressSchema,
721
- customerBusinessProfileDetailsSchema,
722
- customerBusinessProfileNullablePathSchema,
723
- customerBusinessProfilePathSchema,
724
- customerBusinessProfileSchema,
725
- customerDetailsSchema,
726
- customerNullablePathSchema,
727
- customerPathSchema,
728
- customerSchema,
729
- deleteCustomerAddressInputSchema,
730
- deleteCustomerAddressResponseSchema,
731
- deleteCustomerBusinessProfileInputSchema,
732
- deleteCustomerBusinessProfileResponseSchema,
733
- deleteCustomerInputSchema,
734
- deleteCustomerResponseSchema,
735
- getCustomerAddressDetailsInputSchema,
736
- getCustomerAddressDetailsResponseSchema,
737
- getCustomerAddressesForCustomerInputSchema,
738
- getCustomerAddressesForCustomerQuerySchema,
739
- getCustomerAddressesForCustomerResponseSchema,
740
- getCustomerAddressesInputSchema,
741
- getCustomerAddressesQuerySchema,
742
- getCustomerAddressesResponseSchema,
743
- getCustomerBusinessProfileDetailsInputSchema,
744
- getCustomerBusinessProfileDetailsResponseSchema,
745
- getCustomerBusinessProfilesForCustomerInputSchema,
746
- getCustomerBusinessProfilesForCustomerQuerySchema,
747
- getCustomerBusinessProfilesForCustomerResponseSchema,
748
- getCustomerBusinessProfilesInputSchema,
749
- getCustomerBusinessProfilesQuerySchema,
750
- getCustomerBusinessProfilesResponseSchema,
751
- getCustomerDetailsInputSchema,
752
- getCustomerDetailsResponseSchema,
753
- getCustomersInputSchema,
754
- getCustomersQuerySchema,
755
- getCustomersResponseSchema,
756
- updateCustomerAddressInputSchema,
757
- updateCustomerAddressResponseSchema,
758
- updateCustomerBusinessProfileInputSchema,
759
- updateCustomerBusinessProfileResponseSchema,
760
- updateCustomerInputSchema,
761
- updateCustomerResponseSchema,
762
- writableCreateCustomerAddressSchema,
763
- writableCreateCustomerBusinessProfileSchema,
764
- writableCreateCustomerSchema,
765
- writableCustomerAddressSchema,
766
- writableCustomerBusinessProfileSchema,
767
- writableCustomerSchema
768
- });