@deliverart/sdk-js-customer 0.0.5 → 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.
- package/CHANGELOG.md +6 -0
- package/dist/index.cjs +156 -202
- package/dist/index.d.cts +352 -250
- package/dist/index.d.ts +352 -250
- package/dist/index.js +139 -186
- package/package.json +5 -5
- package/src/models.ts +40 -11
- package/src/requests/customer-addresses/CreateCustomerAddress.ts +6 -10
- package/src/requests/customer-addresses/DeleteCustomerAddress.ts +5 -2
- package/src/requests/customer-addresses/GetCustomerAddressDetails.ts +7 -4
- package/src/requests/customer-addresses/GetCustomerAddresses.ts +5 -4
- package/src/requests/customer-addresses/GetCustomerAddressesForCustomer.ts +7 -4
- package/src/requests/customer-addresses/UpdateCustomerAddress.ts +5 -9
- package/src/requests/customer-business-profiles/CreateCustomerBusinessProfile.ts +6 -5
- package/src/requests/customer-business-profiles/DeleteCustomerBusinessProfile.ts +5 -2
- package/src/requests/customer-business-profiles/GetCustomerBusinessProfileDetails.ts +10 -5
- package/src/requests/customer-business-profiles/GetCustomerBusinessProfiles.ts +7 -4
- package/src/requests/customer-business-profiles/GetCustomerBusinessProfilesForCustomer.ts +7 -4
- package/src/requests/customer-business-profiles/UpdateCustomerBusinessProfile.ts +6 -5
- package/src/requests/customers/CreateCustomer.ts +5 -5
- package/src/requests/customers/DeleteCustomer.ts +5 -2
- package/src/requests/customers/GetCustomerDetails.ts +8 -4
- package/src/requests/customers/GetCustomers.ts +7 -32
- package/src/requests/customers/UpdateCustomer.ts +5 -5
- package/src/types.ts +16 -82
package/CHANGELOG.md
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -44,17 +44,18 @@ __export(index_exports, {
|
|
|
44
44
|
createCustomerInputSchema: () => createCustomerInputSchema,
|
|
45
45
|
createCustomerResponseSchema: () => createCustomerResponseSchema,
|
|
46
46
|
customerAddressDetailsSchema: () => customerAddressDetailsSchema,
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
customerAddressIriSchema: () => customerAddressIriSchema,
|
|
48
|
+
customerAddressNullableIriSchema: () => customerAddressNullableIriSchema,
|
|
49
49
|
customerAddressSchema: () => customerAddressSchema,
|
|
50
50
|
customerBusinessProfileDetailsSchema: () => customerBusinessProfileDetailsSchema,
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
customerBusinessProfileIriSchema: () => customerBusinessProfileIriSchema,
|
|
52
|
+
customerBusinessProfileNullableIriSchema: () => customerBusinessProfileNullableIriSchema,
|
|
53
53
|
customerBusinessProfileSchema: () => customerBusinessProfileSchema,
|
|
54
54
|
customerDetailsSchema: () => customerDetailsSchema,
|
|
55
|
-
|
|
56
|
-
|
|
55
|
+
customerIriSchema: () => customerIriSchema,
|
|
56
|
+
customerNullableIriSchema: () => customerNullableIriSchema,
|
|
57
57
|
customerSchema: () => customerSchema,
|
|
58
|
+
customersQuerySchema: () => customersQuerySchema,
|
|
58
59
|
deleteCustomerAddressInputSchema: () => deleteCustomerAddressInputSchema,
|
|
59
60
|
deleteCustomerAddressResponseSchema: () => deleteCustomerAddressResponseSchema,
|
|
60
61
|
deleteCustomerBusinessProfileInputSchema: () => deleteCustomerBusinessProfileInputSchema,
|
|
@@ -98,90 +99,41 @@ __export(index_exports, {
|
|
|
98
99
|
module.exports = __toCommonJS(index_exports);
|
|
99
100
|
|
|
100
101
|
// src/models.ts
|
|
101
|
-
var
|
|
102
|
+
var import_sdk_js_global_types2 = require("@deliverart/sdk-js-global-types");
|
|
102
103
|
var import_sdk_js_point_of_sale = require("@deliverart/sdk-js-point-of-sale");
|
|
103
104
|
var import_sdk_js_user = require("@deliverart/sdk-js-user");
|
|
104
|
-
var
|
|
105
|
+
var import_zod = require("zod");
|
|
105
106
|
|
|
106
107
|
// src/types.ts
|
|
107
|
-
var
|
|
108
|
-
var
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
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
|
-
}
|
|
108
|
+
var import_sdk_js_global_types = require("@deliverart/sdk-js-global-types");
|
|
109
|
+
var customerIriSchema = (0, import_sdk_js_global_types.iriSchema)("/customers/:id");
|
|
110
|
+
var customerNullableIriSchema = (0, import_sdk_js_global_types.iriNullableSchema)("/customers/:id");
|
|
111
|
+
var customerAddressIriSchema = (0, import_sdk_js_global_types.iriSchema)("/customers/address/:id");
|
|
112
|
+
var customerAddressNullableIriSchema = (0, import_sdk_js_global_types.iriNullableSchema)("/customers/address/:id");
|
|
113
|
+
var customerBusinessProfileIriSchema = (0, import_sdk_js_global_types.iriSchema)("/customers/business_profiles/:id");
|
|
114
|
+
var customerBusinessProfileNullableIriSchema = (0, import_sdk_js_global_types.iriNullableSchema)(
|
|
115
|
+
"/customers/business_profiles/:id"
|
|
164
116
|
);
|
|
165
117
|
|
|
166
118
|
// src/models.ts
|
|
167
|
-
var customerSchema =
|
|
168
|
-
id:
|
|
169
|
-
firstName:
|
|
170
|
-
lastName:
|
|
171
|
-
email:
|
|
172
|
-
phoneNumber:
|
|
173
|
-
hasBusinessProfiles:
|
|
174
|
-
hasAddresses:
|
|
175
|
-
ordersPlaced:
|
|
176
|
-
totalSpent:
|
|
177
|
-
createdAt:
|
|
178
|
-
updatedAt:
|
|
119
|
+
var customerSchema = import_zod.z.object({
|
|
120
|
+
id: import_zod.z.string(),
|
|
121
|
+
firstName: import_zod.z.string().nullable(),
|
|
122
|
+
lastName: import_zod.z.string().nullable(),
|
|
123
|
+
email: import_zod.z.string().email().nullable(),
|
|
124
|
+
phoneNumber: import_zod.z.string().nullable(),
|
|
125
|
+
hasBusinessProfiles: import_zod.z.boolean(),
|
|
126
|
+
hasAddresses: import_zod.z.boolean(),
|
|
127
|
+
ordersPlaced: import_zod.z.number(),
|
|
128
|
+
totalSpent: import_zod.z.string(),
|
|
129
|
+
createdAt: import_sdk_js_global_types2.datetimeSchema,
|
|
130
|
+
updatedAt: import_sdk_js_global_types2.datetimeSchema
|
|
179
131
|
});
|
|
180
132
|
var customerDetailsSchema = customerSchema.extend({
|
|
181
|
-
pointOfSale: import_sdk_js_point_of_sale.
|
|
182
|
-
owner: import_sdk_js_user.
|
|
183
|
-
addresses:
|
|
184
|
-
businessProfiles:
|
|
133
|
+
pointOfSale: import_sdk_js_point_of_sale.pointOfSaleNullableIriSchema,
|
|
134
|
+
owner: import_sdk_js_user.userNullableIriSchema,
|
|
135
|
+
addresses: import_zod.z.array(customerAddressIriSchema),
|
|
136
|
+
businessProfiles: import_zod.z.array(customerBusinessProfileIriSchema)
|
|
185
137
|
});
|
|
186
138
|
var writableCreateCustomerSchema = customerDetailsSchema.pick({
|
|
187
139
|
pointOfSale: true,
|
|
@@ -193,15 +145,15 @@ var writableCreateCustomerSchema = customerDetailsSchema.pick({
|
|
|
193
145
|
var writableCustomerSchema = writableCreateCustomerSchema.omit({
|
|
194
146
|
pointOfSale: true
|
|
195
147
|
});
|
|
196
|
-
var customerAddressSchema =
|
|
197
|
-
id:
|
|
198
|
-
address:
|
|
199
|
-
location:
|
|
200
|
-
createdAt:
|
|
201
|
-
updatedAt:
|
|
148
|
+
var customerAddressSchema = import_zod.z.object({
|
|
149
|
+
id: import_zod.z.string(),
|
|
150
|
+
address: import_sdk_js_global_types2.addressSchema,
|
|
151
|
+
location: import_sdk_js_global_types2.locationSchema,
|
|
152
|
+
createdAt: import_sdk_js_global_types2.datetimeSchema,
|
|
153
|
+
updatedAt: import_sdk_js_global_types2.datetimeSchema
|
|
202
154
|
});
|
|
203
155
|
var customerAddressDetailsSchema = customerAddressSchema.extend({
|
|
204
|
-
customer:
|
|
156
|
+
customer: customerIriSchema
|
|
205
157
|
});
|
|
206
158
|
var writableCreateCustomerAddressSchema = customerAddressDetailsSchema.pick({
|
|
207
159
|
customer: true,
|
|
@@ -210,18 +162,18 @@ var writableCreateCustomerAddressSchema = customerAddressDetailsSchema.pick({
|
|
|
210
162
|
var writableCustomerAddressSchema = writableCreateCustomerAddressSchema.omit({
|
|
211
163
|
customer: true
|
|
212
164
|
});
|
|
213
|
-
var customerBusinessProfileSchema =
|
|
214
|
-
id:
|
|
215
|
-
businessName:
|
|
216
|
-
vat:
|
|
217
|
-
taxCode:
|
|
218
|
-
billingAddress:
|
|
219
|
-
billingData:
|
|
220
|
-
createdAt:
|
|
221
|
-
updatedAt:
|
|
165
|
+
var customerBusinessProfileSchema = import_zod.z.object({
|
|
166
|
+
id: import_zod.z.string(),
|
|
167
|
+
businessName: import_zod.z.string(),
|
|
168
|
+
vat: import_zod.z.string(),
|
|
169
|
+
taxCode: import_zod.z.string(),
|
|
170
|
+
billingAddress: import_sdk_js_global_types2.addressSchema,
|
|
171
|
+
billingData: import_sdk_js_global_types2.billingDataSchema,
|
|
172
|
+
createdAt: import_sdk_js_global_types2.datetimeSchema,
|
|
173
|
+
updatedAt: import_sdk_js_global_types2.datetimeSchema
|
|
222
174
|
});
|
|
223
175
|
var customerBusinessProfileDetailsSchema = customerBusinessProfileSchema.extend({
|
|
224
|
-
customer:
|
|
176
|
+
customer: customerIriSchema
|
|
225
177
|
});
|
|
226
178
|
var writableCreateCustomerBusinessProfileSchema = customerBusinessProfileDetailsSchema.pick({
|
|
227
179
|
customer: true,
|
|
@@ -234,6 +186,29 @@ var writableCreateCustomerBusinessProfileSchema = customerBusinessProfileDetails
|
|
|
234
186
|
var writableCustomerBusinessProfileSchema = writableCreateCustomerBusinessProfileSchema.omit({
|
|
235
187
|
customer: true
|
|
236
188
|
});
|
|
189
|
+
var customersQuerySchema = import_zod.z.object({
|
|
190
|
+
firstName: import_zod.z.string().optional(),
|
|
191
|
+
lastName: import_zod.z.string().optional(),
|
|
192
|
+
email: import_zod.z.string().optional(),
|
|
193
|
+
phoneNumber: import_zod.z.string().optional(),
|
|
194
|
+
hasBusinessProfiles: import_zod.z.coerce.boolean().optional(),
|
|
195
|
+
hasAddresses: import_zod.z.coerce.boolean().optional(),
|
|
196
|
+
"ordersPlaced[between]": import_zod.z.coerce.number().optional(),
|
|
197
|
+
"ordersPlaced[gt]": import_zod.z.coerce.number().optional(),
|
|
198
|
+
"ordersPlaced[gte]": import_zod.z.coerce.number().optional(),
|
|
199
|
+
"ordersPlaced[lt]": import_zod.z.coerce.number().optional(),
|
|
200
|
+
"ordersPlaced[lte]": import_zod.z.coerce.number().optional(),
|
|
201
|
+
"totalSpent[between]": import_zod.z.coerce.number().optional(),
|
|
202
|
+
"totalSpent[gt]": import_zod.z.coerce.string().optional(),
|
|
203
|
+
"totalSpent[gte]": import_zod.z.coerce.string().optional(),
|
|
204
|
+
"totalSpent[lt]": import_zod.z.coerce.string().optional(),
|
|
205
|
+
"totalSpent[lte]": import_zod.z.coerce.string().optional(),
|
|
206
|
+
"order[firstName]": import_sdk_js_global_types2.sortDirSchema.optional(),
|
|
207
|
+
"order[lastName]": import_sdk_js_global_types2.sortDirSchema.optional(),
|
|
208
|
+
"order[createdAt]": import_sdk_js_global_types2.sortDirSchema.optional(),
|
|
209
|
+
"order[updatedAt]": import_sdk_js_global_types2.sortDirSchema.optional(),
|
|
210
|
+
page: import_zod.z.coerce.number().optional()
|
|
211
|
+
}).merge(import_sdk_js_global_types2.timestampsFilterSchema);
|
|
237
212
|
|
|
238
213
|
// src/requests/customer-addresses/CreateCustomerAddress.ts
|
|
239
214
|
var import_sdk_js_core = require("@deliverart/sdk-js-core");
|
|
@@ -257,9 +232,9 @@ var CreateCustomerAddress = class extends import_sdk_js_core.AbstractApiRequest
|
|
|
257
232
|
|
|
258
233
|
// src/requests/customer-addresses/DeleteCustomerAddress.ts
|
|
259
234
|
var import_sdk_js_core2 = require("@deliverart/sdk-js-core");
|
|
260
|
-
var
|
|
261
|
-
var deleteCustomerAddressInputSchema =
|
|
262
|
-
var deleteCustomerAddressResponseSchema =
|
|
235
|
+
var import_zod2 = require("zod");
|
|
236
|
+
var deleteCustomerAddressInputSchema = import_zod2.z.undefined();
|
|
237
|
+
var deleteCustomerAddressResponseSchema = import_zod2.z.undefined();
|
|
263
238
|
var DeleteCustomerAddress = class extends import_sdk_js_core2.AbstractApiRequest {
|
|
264
239
|
method = "DELETE";
|
|
265
240
|
contentType = "application/json";
|
|
@@ -270,7 +245,7 @@ var DeleteCustomerAddress = class extends import_sdk_js_core2.AbstractApiRequest
|
|
|
270
245
|
headersSchema = void 0;
|
|
271
246
|
customerAddressId;
|
|
272
247
|
constructor(customerAddressId) {
|
|
273
|
-
super();
|
|
248
|
+
super(void 0);
|
|
274
249
|
this.customerAddressId = customerAddressId;
|
|
275
250
|
}
|
|
276
251
|
getPath() {
|
|
@@ -280,8 +255,8 @@ var DeleteCustomerAddress = class extends import_sdk_js_core2.AbstractApiRequest
|
|
|
280
255
|
|
|
281
256
|
// src/requests/customer-addresses/GetCustomerAddressDetails.ts
|
|
282
257
|
var import_sdk_js_core3 = require("@deliverart/sdk-js-core");
|
|
283
|
-
var
|
|
284
|
-
var getCustomerAddressDetailsInputSchema =
|
|
258
|
+
var import_zod3 = require("zod");
|
|
259
|
+
var getCustomerAddressDetailsInputSchema = import_zod3.z.undefined();
|
|
285
260
|
var getCustomerAddressDetailsResponseSchema = customerAddressDetailsSchema;
|
|
286
261
|
var GetCustomerAddressDetails = class extends import_sdk_js_core3.AbstractApiRequest {
|
|
287
262
|
method = "GET";
|
|
@@ -293,7 +268,7 @@ var GetCustomerAddressDetails = class extends import_sdk_js_core3.AbstractApiReq
|
|
|
293
268
|
headersSchema = void 0;
|
|
294
269
|
customerAddressId;
|
|
295
270
|
constructor(customerAddressId) {
|
|
296
|
-
super();
|
|
271
|
+
super(void 0);
|
|
297
272
|
this.customerAddressId = customerAddressId;
|
|
298
273
|
}
|
|
299
274
|
getPath() {
|
|
@@ -303,15 +278,15 @@ var GetCustomerAddressDetails = class extends import_sdk_js_core3.AbstractApiReq
|
|
|
303
278
|
|
|
304
279
|
// src/requests/customer-addresses/GetCustomerAddresses.ts
|
|
305
280
|
var import_sdk_js_core4 = require("@deliverart/sdk-js-core");
|
|
306
|
-
var
|
|
307
|
-
var
|
|
308
|
-
var getCustomerAddressesQuerySchema =
|
|
309
|
-
"order[createdAt]":
|
|
310
|
-
"order[updatedAt]":
|
|
311
|
-
page:
|
|
312
|
-
}).merge(
|
|
313
|
-
var
|
|
314
|
-
var
|
|
281
|
+
var import_sdk_js_global_types3 = require("@deliverart/sdk-js-global-types");
|
|
282
|
+
var import_zod4 = require("zod");
|
|
283
|
+
var getCustomerAddressesQuerySchema = import_zod4.z.object({
|
|
284
|
+
"order[createdAt]": import_sdk_js_global_types3.sortDirSchema.optional(),
|
|
285
|
+
"order[updatedAt]": import_sdk_js_global_types3.sortDirSchema.optional(),
|
|
286
|
+
page: import_zod4.z.coerce.number().optional()
|
|
287
|
+
}).merge(import_sdk_js_global_types3.timestampsFilterSchema);
|
|
288
|
+
var getCustomerAddressesInputSchema = import_zod4.z.undefined();
|
|
289
|
+
var getCustomerAddressesResponseSchema = (0, import_sdk_js_global_types3.createPaginatedSchema)(customerAddressSchema);
|
|
315
290
|
var GetCustomerAddresses = class extends import_sdk_js_core4.AbstractApiRequest {
|
|
316
291
|
method = "GET";
|
|
317
292
|
contentType = "application/json";
|
|
@@ -327,24 +302,24 @@ var GetCustomerAddresses = class extends import_sdk_js_core4.AbstractApiRequest
|
|
|
327
302
|
return "/customers/addresses";
|
|
328
303
|
}
|
|
329
304
|
parseResponse(data, rawResponse) {
|
|
330
|
-
const customerAddresses =
|
|
305
|
+
const customerAddresses = import_zod4.z.array(customerAddressSchema).parse(data);
|
|
331
306
|
return this.validateOutput({
|
|
332
307
|
data: customerAddresses,
|
|
333
|
-
pagination: (0,
|
|
308
|
+
pagination: (0, import_sdk_js_global_types3.responseToPagination)(rawResponse)
|
|
334
309
|
});
|
|
335
310
|
}
|
|
336
311
|
};
|
|
337
312
|
|
|
338
313
|
// src/requests/customer-addresses/GetCustomerAddressesForCustomer.ts
|
|
339
314
|
var import_sdk_js_core5 = require("@deliverart/sdk-js-core");
|
|
340
|
-
var
|
|
341
|
-
var
|
|
342
|
-
var getCustomerAddressesForCustomerQuerySchema =
|
|
343
|
-
"order[createdAt]":
|
|
344
|
-
"order[updatedAt]":
|
|
345
|
-
}).merge(
|
|
346
|
-
var
|
|
347
|
-
var
|
|
315
|
+
var import_sdk_js_global_types4 = require("@deliverart/sdk-js-global-types");
|
|
316
|
+
var import_zod5 = require("zod");
|
|
317
|
+
var getCustomerAddressesForCustomerQuerySchema = import_zod5.z.object({
|
|
318
|
+
"order[createdAt]": import_sdk_js_global_types4.sortDirSchema.optional(),
|
|
319
|
+
"order[updatedAt]": import_sdk_js_global_types4.sortDirSchema.optional()
|
|
320
|
+
}).merge(import_sdk_js_global_types4.timestampsFilterSchema);
|
|
321
|
+
var getCustomerAddressesForCustomerInputSchema = import_zod5.z.undefined();
|
|
322
|
+
var getCustomerAddressesForCustomerResponseSchema = import_zod5.z.array(customerAddressSchema);
|
|
348
323
|
var GetCustomerAddressesForCustomer = class extends import_sdk_js_core5.AbstractApiRequest {
|
|
349
324
|
method = "GET";
|
|
350
325
|
contentType = "application/json";
|
|
@@ -362,7 +337,7 @@ var GetCustomerAddressesForCustomer = class extends import_sdk_js_core5.Abstract
|
|
|
362
337
|
return `/customers/${this.customerId}/addresses`;
|
|
363
338
|
}
|
|
364
339
|
parseResponse(data) {
|
|
365
|
-
return
|
|
340
|
+
return import_zod5.z.array(customerAddressSchema).parse(data);
|
|
366
341
|
}
|
|
367
342
|
};
|
|
368
343
|
|
|
@@ -410,9 +385,9 @@ var CreateCustomerBusinessProfile = class extends import_sdk_js_core7.AbstractAp
|
|
|
410
385
|
|
|
411
386
|
// src/requests/customer-business-profiles/DeleteCustomerBusinessProfile.ts
|
|
412
387
|
var import_sdk_js_core8 = require("@deliverart/sdk-js-core");
|
|
413
|
-
var
|
|
414
|
-
var deleteCustomerBusinessProfileInputSchema =
|
|
415
|
-
var deleteCustomerBusinessProfileResponseSchema =
|
|
388
|
+
var import_zod6 = require("zod");
|
|
389
|
+
var deleteCustomerBusinessProfileInputSchema = import_zod6.z.undefined();
|
|
390
|
+
var deleteCustomerBusinessProfileResponseSchema = import_zod6.z.undefined();
|
|
416
391
|
var DeleteCustomerBusinessProfile = class extends import_sdk_js_core8.AbstractApiRequest {
|
|
417
392
|
method = "DELETE";
|
|
418
393
|
contentType = "application/json";
|
|
@@ -423,7 +398,7 @@ var DeleteCustomerBusinessProfile = class extends import_sdk_js_core8.AbstractAp
|
|
|
423
398
|
headersSchema = void 0;
|
|
424
399
|
customerBusinessProfileId;
|
|
425
400
|
constructor(customerBusinessProfileId) {
|
|
426
|
-
super();
|
|
401
|
+
super(void 0);
|
|
427
402
|
this.customerBusinessProfileId = customerBusinessProfileId;
|
|
428
403
|
}
|
|
429
404
|
getPath() {
|
|
@@ -433,8 +408,8 @@ var DeleteCustomerBusinessProfile = class extends import_sdk_js_core8.AbstractAp
|
|
|
433
408
|
|
|
434
409
|
// src/requests/customer-business-profiles/GetCustomerBusinessProfileDetails.ts
|
|
435
410
|
var import_sdk_js_core9 = require("@deliverart/sdk-js-core");
|
|
436
|
-
var
|
|
437
|
-
var getCustomerBusinessProfileDetailsInputSchema =
|
|
411
|
+
var import_zod7 = require("zod");
|
|
412
|
+
var getCustomerBusinessProfileDetailsInputSchema = import_zod7.z.undefined();
|
|
438
413
|
var getCustomerBusinessProfileDetailsResponseSchema = customerBusinessProfileDetailsSchema;
|
|
439
414
|
var GetCustomerBusinessProfileDetails = class extends import_sdk_js_core9.AbstractApiRequest {
|
|
440
415
|
method = "GET";
|
|
@@ -446,7 +421,7 @@ var GetCustomerBusinessProfileDetails = class extends import_sdk_js_core9.Abstra
|
|
|
446
421
|
headersSchema = void 0;
|
|
447
422
|
customerBusinessProfileId;
|
|
448
423
|
constructor(customerBusinessProfileId) {
|
|
449
|
-
super();
|
|
424
|
+
super(void 0);
|
|
450
425
|
this.customerBusinessProfileId = customerBusinessProfileId;
|
|
451
426
|
}
|
|
452
427
|
getPath() {
|
|
@@ -456,21 +431,21 @@ var GetCustomerBusinessProfileDetails = class extends import_sdk_js_core9.Abstra
|
|
|
456
431
|
|
|
457
432
|
// src/requests/customer-business-profiles/GetCustomerBusinessProfiles.ts
|
|
458
433
|
var import_sdk_js_core10 = require("@deliverart/sdk-js-core");
|
|
459
|
-
var
|
|
460
|
-
var
|
|
461
|
-
var getCustomerBusinessProfilesQuerySchema =
|
|
462
|
-
"order[businessName]":
|
|
463
|
-
"order[createdAt]":
|
|
464
|
-
"order[updatedAt]":
|
|
465
|
-
businessName:
|
|
466
|
-
vat:
|
|
467
|
-
taxCode:
|
|
468
|
-
page:
|
|
469
|
-
}).merge(
|
|
470
|
-
var
|
|
434
|
+
var import_sdk_js_global_types5 = require("@deliverart/sdk-js-global-types");
|
|
435
|
+
var import_zod8 = require("zod");
|
|
436
|
+
var getCustomerBusinessProfilesQuerySchema = import_zod8.z.object({
|
|
437
|
+
"order[businessName]": import_sdk_js_global_types5.sortDirSchema.optional(),
|
|
438
|
+
"order[createdAt]": import_sdk_js_global_types5.sortDirSchema.optional(),
|
|
439
|
+
"order[updatedAt]": import_sdk_js_global_types5.sortDirSchema.optional(),
|
|
440
|
+
businessName: import_zod8.z.string().optional(),
|
|
441
|
+
vat: import_zod8.z.string().optional(),
|
|
442
|
+
taxCode: import_zod8.z.string().optional(),
|
|
443
|
+
page: import_zod8.z.coerce.number().optional()
|
|
444
|
+
}).merge(import_sdk_js_global_types5.timestampsFilterSchema);
|
|
445
|
+
var getCustomerBusinessProfilesInputSchema = import_zod8.z.undefined();
|
|
446
|
+
var getCustomerBusinessProfilesResponseSchema = (0, import_sdk_js_global_types5.createPaginatedSchema)(
|
|
471
447
|
customerBusinessProfileSchema
|
|
472
448
|
);
|
|
473
|
-
var getCustomerBusinessProfilesInputSchema = import_zod9.z.undefined();
|
|
474
449
|
var GetCustomerBusinessProfiles = class extends import_sdk_js_core10.AbstractApiRequest {
|
|
475
450
|
method = "GET";
|
|
476
451
|
contentType = "application/json";
|
|
@@ -486,30 +461,30 @@ var GetCustomerBusinessProfiles = class extends import_sdk_js_core10.AbstractApi
|
|
|
486
461
|
return "/customers/business_profiles";
|
|
487
462
|
}
|
|
488
463
|
parseResponse(data, rawResponse) {
|
|
489
|
-
const customerBusinessProfiles =
|
|
464
|
+
const customerBusinessProfiles = import_zod8.z.array(customerBusinessProfileSchema).parse(data);
|
|
490
465
|
return this.validateOutput({
|
|
491
466
|
data: customerBusinessProfiles,
|
|
492
|
-
pagination: (0,
|
|
467
|
+
pagination: (0, import_sdk_js_global_types5.responseToPagination)(rawResponse)
|
|
493
468
|
});
|
|
494
469
|
}
|
|
495
470
|
};
|
|
496
471
|
|
|
497
472
|
// src/requests/customer-business-profiles/GetCustomerBusinessProfilesForCustomer.ts
|
|
498
473
|
var import_sdk_js_core11 = require("@deliverart/sdk-js-core");
|
|
499
|
-
var
|
|
500
|
-
var
|
|
501
|
-
var getCustomerBusinessProfilesForCustomerQuerySchema =
|
|
502
|
-
"order[businessName]":
|
|
503
|
-
"order[createdAt]":
|
|
504
|
-
"order[updatedAt]":
|
|
505
|
-
businessName:
|
|
506
|
-
vat:
|
|
507
|
-
taxCode:
|
|
508
|
-
}).merge(
|
|
509
|
-
var
|
|
474
|
+
var import_sdk_js_global_types6 = require("@deliverart/sdk-js-global-types");
|
|
475
|
+
var import_zod9 = require("zod");
|
|
476
|
+
var getCustomerBusinessProfilesForCustomerQuerySchema = import_zod9.z.object({
|
|
477
|
+
"order[businessName]": import_sdk_js_global_types6.sortDirSchema.optional(),
|
|
478
|
+
"order[createdAt]": import_sdk_js_global_types6.sortDirSchema.optional(),
|
|
479
|
+
"order[updatedAt]": import_sdk_js_global_types6.sortDirSchema.optional(),
|
|
480
|
+
businessName: import_zod9.z.string().optional(),
|
|
481
|
+
vat: import_zod9.z.string().optional(),
|
|
482
|
+
taxCode: import_zod9.z.string().optional()
|
|
483
|
+
}).merge(import_sdk_js_global_types6.timestampsFilterSchema);
|
|
484
|
+
var getCustomerBusinessProfilesForCustomerInputSchema = import_zod9.z.undefined();
|
|
485
|
+
var getCustomerBusinessProfilesForCustomerResponseSchema = import_zod9.z.array(
|
|
510
486
|
customerBusinessProfileSchema
|
|
511
487
|
);
|
|
512
|
-
var getCustomerBusinessProfilesForCustomerInputSchema = import_zod10.z.undefined();
|
|
513
488
|
var GetCustomerBusinessProfilesForCustomer = class extends import_sdk_js_core11.AbstractApiRequest {
|
|
514
489
|
method = "GET";
|
|
515
490
|
contentType = "application/json";
|
|
@@ -527,7 +502,7 @@ var GetCustomerBusinessProfilesForCustomer = class extends import_sdk_js_core11.
|
|
|
527
502
|
return `/customers/${this.customerId}/business_profiles`;
|
|
528
503
|
}
|
|
529
504
|
parseResponse(data) {
|
|
530
|
-
return
|
|
505
|
+
return import_zod9.z.array(customerBusinessProfileSchema).parse(data);
|
|
531
506
|
}
|
|
532
507
|
};
|
|
533
508
|
|
|
@@ -575,9 +550,9 @@ var CreateCustomer = class extends import_sdk_js_core13.AbstractApiRequest {
|
|
|
575
550
|
|
|
576
551
|
// src/requests/customers/DeleteCustomer.ts
|
|
577
552
|
var import_sdk_js_core14 = require("@deliverart/sdk-js-core");
|
|
578
|
-
var
|
|
579
|
-
var deleteCustomerInputSchema =
|
|
580
|
-
var deleteCustomerResponseSchema =
|
|
553
|
+
var import_zod10 = require("zod");
|
|
554
|
+
var deleteCustomerInputSchema = import_zod10.z.undefined();
|
|
555
|
+
var deleteCustomerResponseSchema = import_zod10.z.undefined();
|
|
581
556
|
var DeleteCustomer = class extends import_sdk_js_core14.AbstractApiRequest {
|
|
582
557
|
method = "DELETE";
|
|
583
558
|
contentType = "application/json";
|
|
@@ -588,7 +563,7 @@ var DeleteCustomer = class extends import_sdk_js_core14.AbstractApiRequest {
|
|
|
588
563
|
headersSchema = void 0;
|
|
589
564
|
customerId;
|
|
590
565
|
constructor(customerId) {
|
|
591
|
-
super();
|
|
566
|
+
super(void 0);
|
|
592
567
|
this.customerId = customerId;
|
|
593
568
|
}
|
|
594
569
|
getPath() {
|
|
@@ -598,8 +573,8 @@ var DeleteCustomer = class extends import_sdk_js_core14.AbstractApiRequest {
|
|
|
598
573
|
|
|
599
574
|
// src/requests/customers/GetCustomerDetails.ts
|
|
600
575
|
var import_sdk_js_core15 = require("@deliverart/sdk-js-core");
|
|
601
|
-
var
|
|
602
|
-
var getCustomerDetailsInputSchema =
|
|
576
|
+
var import_zod11 = require("zod");
|
|
577
|
+
var getCustomerDetailsInputSchema = import_zod11.z.undefined();
|
|
603
578
|
var getCustomerDetailsResponseSchema = customerDetailsSchema;
|
|
604
579
|
var GetCustomerDetails = class extends import_sdk_js_core15.AbstractApiRequest {
|
|
605
580
|
method = "GET";
|
|
@@ -611,7 +586,7 @@ var GetCustomerDetails = class extends import_sdk_js_core15.AbstractApiRequest {
|
|
|
611
586
|
headersSchema = void 0;
|
|
612
587
|
customerId;
|
|
613
588
|
constructor(customerId) {
|
|
614
|
-
super();
|
|
589
|
+
super(void 0);
|
|
615
590
|
this.customerId = customerId;
|
|
616
591
|
}
|
|
617
592
|
getPath() {
|
|
@@ -621,33 +596,11 @@ var GetCustomerDetails = class extends import_sdk_js_core15.AbstractApiRequest {
|
|
|
621
596
|
|
|
622
597
|
// src/requests/customers/GetCustomers.ts
|
|
623
598
|
var import_sdk_js_core16 = require("@deliverart/sdk-js-core");
|
|
624
|
-
var
|
|
625
|
-
var
|
|
626
|
-
var getCustomersQuerySchema =
|
|
627
|
-
|
|
628
|
-
|
|
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();
|
|
599
|
+
var import_sdk_js_global_types7 = require("@deliverart/sdk-js-global-types");
|
|
600
|
+
var import_zod12 = require("zod");
|
|
601
|
+
var getCustomersQuerySchema = customersQuerySchema;
|
|
602
|
+
var getCustomersInputSchema = import_zod12.z.undefined();
|
|
603
|
+
var getCustomersResponseSchema = (0, import_sdk_js_global_types7.createPaginatedSchema)(customerSchema);
|
|
651
604
|
var GetCustomers = class extends import_sdk_js_core16.AbstractApiRequest {
|
|
652
605
|
method = "GET";
|
|
653
606
|
contentType = "application/json";
|
|
@@ -663,8 +616,8 @@ var GetCustomers = class extends import_sdk_js_core16.AbstractApiRequest {
|
|
|
663
616
|
return "/customers";
|
|
664
617
|
}
|
|
665
618
|
parseResponse(data, rawResponse) {
|
|
666
|
-
const customers =
|
|
667
|
-
return this.validateOutput({ data: customers, pagination: (0,
|
|
619
|
+
const customers = import_zod12.z.array(customerSchema).parse(data);
|
|
620
|
+
return this.validateOutput({ data: customers, pagination: (0, import_sdk_js_global_types7.responseToPagination)(rawResponse) });
|
|
668
621
|
}
|
|
669
622
|
};
|
|
670
623
|
|
|
@@ -715,17 +668,18 @@ var UpdateCustomer = class extends import_sdk_js_core17.AbstractApiRequest {
|
|
|
715
668
|
createCustomerInputSchema,
|
|
716
669
|
createCustomerResponseSchema,
|
|
717
670
|
customerAddressDetailsSchema,
|
|
718
|
-
|
|
719
|
-
|
|
671
|
+
customerAddressIriSchema,
|
|
672
|
+
customerAddressNullableIriSchema,
|
|
720
673
|
customerAddressSchema,
|
|
721
674
|
customerBusinessProfileDetailsSchema,
|
|
722
|
-
|
|
723
|
-
|
|
675
|
+
customerBusinessProfileIriSchema,
|
|
676
|
+
customerBusinessProfileNullableIriSchema,
|
|
724
677
|
customerBusinessProfileSchema,
|
|
725
678
|
customerDetailsSchema,
|
|
726
|
-
|
|
727
|
-
|
|
679
|
+
customerIriSchema,
|
|
680
|
+
customerNullableIriSchema,
|
|
728
681
|
customerSchema,
|
|
682
|
+
customersQuerySchema,
|
|
729
683
|
deleteCustomerAddressInputSchema,
|
|
730
684
|
deleteCustomerAddressResponseSchema,
|
|
731
685
|
deleteCustomerBusinessProfileInputSchema,
|