@deliverart/sdk-js-customer 0.0.0-dev-20260721002647
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/README.md +302 -0
- package/dist/index.cjs +767 -0
- package/dist/index.d.cts +1780 -0
- package/dist/index.d.ts +1780 -0
- package/dist/index.js +675 -0
- package/package.json +35 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,675 @@
|
|
|
1
|
+
// src/models.ts
|
|
2
|
+
import {
|
|
3
|
+
addressSchema,
|
|
4
|
+
billingDataSchema,
|
|
5
|
+
booleanSchema,
|
|
6
|
+
datetimeSchema,
|
|
7
|
+
locationSchema,
|
|
8
|
+
sortDirSchema,
|
|
9
|
+
timestampsFilterSchema
|
|
10
|
+
} from "@deliverart/sdk-js-global-types";
|
|
11
|
+
import { pointOfSaleNullableIriSchema } from "@deliverart/sdk-js-point-of-sale";
|
|
12
|
+
import { userNullableIriSchema } from "@deliverart/sdk-js-user";
|
|
13
|
+
import { z } from "zod";
|
|
14
|
+
|
|
15
|
+
// src/types.ts
|
|
16
|
+
import { iriNullableSchema, iriSchema } from "@deliverart/sdk-js-global-types";
|
|
17
|
+
var customerIriSchema = iriSchema("/customers/:id");
|
|
18
|
+
var customerNullableIriSchema = iriNullableSchema("/customers/:id");
|
|
19
|
+
var customerAddressIriSchema = iriSchema("/customers/address/:id");
|
|
20
|
+
var customerAddressNullableIriSchema = iriNullableSchema("/customers/address/:id");
|
|
21
|
+
var customerBusinessProfileIriSchema = iriSchema("/customers/business_profiles/:id");
|
|
22
|
+
var customerBusinessProfileNullableIriSchema = iriNullableSchema(
|
|
23
|
+
"/customers/business_profiles/:id"
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
// src/models.ts
|
|
27
|
+
var customerReadEmailSchema = z.preprocess(
|
|
28
|
+
(value) => typeof value === "string" && value.trim() === "" ? null : value,
|
|
29
|
+
z.string().nullable()
|
|
30
|
+
);
|
|
31
|
+
var customerWriteEmailSchema = z.email().nullable();
|
|
32
|
+
var customerSchema = z.object({
|
|
33
|
+
id: z.string(),
|
|
34
|
+
firstName: z.string().nullable(),
|
|
35
|
+
lastName: z.string().nullable(),
|
|
36
|
+
email: customerReadEmailSchema,
|
|
37
|
+
phoneNumber: z.string().nullable(),
|
|
38
|
+
hasBusinessProfiles: z.boolean(),
|
|
39
|
+
hasAddresses: z.boolean(),
|
|
40
|
+
ordersPlaced: z.coerce.number(),
|
|
41
|
+
totalSpent: z.string(),
|
|
42
|
+
createdAt: datetimeSchema,
|
|
43
|
+
updatedAt: datetimeSchema
|
|
44
|
+
});
|
|
45
|
+
var customerDetailsSchema = customerSchema.extend({
|
|
46
|
+
pointOfSale: pointOfSaleNullableIriSchema,
|
|
47
|
+
owner: userNullableIriSchema,
|
|
48
|
+
addresses: z.array(customerAddressIriSchema),
|
|
49
|
+
businessProfiles: z.array(customerBusinessProfileIriSchema)
|
|
50
|
+
});
|
|
51
|
+
var writableCreateCustomerSchema = z.object({
|
|
52
|
+
pointOfSale: pointOfSaleNullableIriSchema,
|
|
53
|
+
firstName: z.string().nullable(),
|
|
54
|
+
lastName: z.string().nullable(),
|
|
55
|
+
email: customerWriteEmailSchema,
|
|
56
|
+
phoneNumber: z.string().nullable()
|
|
57
|
+
});
|
|
58
|
+
var writableCustomerSchema = writableCreateCustomerSchema.omit({
|
|
59
|
+
pointOfSale: true
|
|
60
|
+
});
|
|
61
|
+
var customerAddressSchema = z.object({
|
|
62
|
+
id: z.string(),
|
|
63
|
+
address: addressSchema,
|
|
64
|
+
location: locationSchema,
|
|
65
|
+
createdAt: datetimeSchema,
|
|
66
|
+
updatedAt: datetimeSchema
|
|
67
|
+
});
|
|
68
|
+
var customerAddressDetailsSchema = customerAddressSchema.extend({
|
|
69
|
+
customer: customerIriSchema
|
|
70
|
+
});
|
|
71
|
+
var writableCreateCustomerAddressSchema = customerAddressDetailsSchema.pick({
|
|
72
|
+
customer: true,
|
|
73
|
+
address: true
|
|
74
|
+
});
|
|
75
|
+
var writableCustomerAddressSchema = writableCreateCustomerAddressSchema.omit({
|
|
76
|
+
customer: true
|
|
77
|
+
});
|
|
78
|
+
var customerBusinessProfileSchema = z.object({
|
|
79
|
+
id: z.string(),
|
|
80
|
+
businessName: z.string(),
|
|
81
|
+
vat: z.string(),
|
|
82
|
+
taxCode: z.string(),
|
|
83
|
+
billingAddress: addressSchema,
|
|
84
|
+
billingData: billingDataSchema,
|
|
85
|
+
createdAt: datetimeSchema,
|
|
86
|
+
updatedAt: datetimeSchema
|
|
87
|
+
});
|
|
88
|
+
var customerBusinessProfileDetailsSchema = customerBusinessProfileSchema.extend({
|
|
89
|
+
customer: customerIriSchema
|
|
90
|
+
});
|
|
91
|
+
var writableCreateCustomerBusinessProfileSchema = customerBusinessProfileDetailsSchema.pick({
|
|
92
|
+
customer: true,
|
|
93
|
+
businessName: true,
|
|
94
|
+
vat: true,
|
|
95
|
+
taxCode: true,
|
|
96
|
+
billingAddress: true,
|
|
97
|
+
billingData: true
|
|
98
|
+
});
|
|
99
|
+
var writableCustomerBusinessProfileSchema = writableCreateCustomerBusinessProfileSchema.omit({
|
|
100
|
+
customer: true
|
|
101
|
+
});
|
|
102
|
+
var customersQuerySchema = z.object({
|
|
103
|
+
firstName: z.string().optional(),
|
|
104
|
+
lastName: z.string().optional(),
|
|
105
|
+
email: z.string().optional(),
|
|
106
|
+
phoneNumber: z.string().optional(),
|
|
107
|
+
hasBusinessProfiles: booleanSchema.optional(),
|
|
108
|
+
hasAddresses: booleanSchema.optional(),
|
|
109
|
+
"ordersPlaced[between]": z.coerce.number().optional(),
|
|
110
|
+
"ordersPlaced[gt]": z.coerce.number().optional(),
|
|
111
|
+
"ordersPlaced[gte]": z.coerce.number().optional(),
|
|
112
|
+
"ordersPlaced[lt]": z.coerce.number().optional(),
|
|
113
|
+
"ordersPlaced[lte]": z.coerce.number().optional(),
|
|
114
|
+
"totalSpent[between]": z.coerce.number().optional(),
|
|
115
|
+
"totalSpent[gt]": z.coerce.string().optional(),
|
|
116
|
+
"totalSpent[gte]": z.coerce.string().optional(),
|
|
117
|
+
"totalSpent[lt]": z.coerce.string().optional(),
|
|
118
|
+
"totalSpent[lte]": z.coerce.string().optional(),
|
|
119
|
+
"order[firstName]": sortDirSchema.optional(),
|
|
120
|
+
"order[lastName]": sortDirSchema.optional(),
|
|
121
|
+
"order[createdAt]": sortDirSchema.optional(),
|
|
122
|
+
"order[updatedAt]": sortDirSchema.optional(),
|
|
123
|
+
page: z.coerce.number().optional()
|
|
124
|
+
}).extend(timestampsFilterSchema.shape);
|
|
125
|
+
|
|
126
|
+
// src/requests/customer-addresses/CreateCustomerAddress.ts
|
|
127
|
+
import { AbstractApiRequest } from "@deliverart/sdk-js-core";
|
|
128
|
+
var createCustomerAddressInputSchema = writableCreateCustomerAddressSchema.required();
|
|
129
|
+
var createCustomerAddressResponseSchema = customerAddressDetailsSchema;
|
|
130
|
+
var CreateCustomerAddress = class extends AbstractApiRequest {
|
|
131
|
+
constructor(input) {
|
|
132
|
+
super(input);
|
|
133
|
+
this.method = "POST";
|
|
134
|
+
this.contentType = "application/json";
|
|
135
|
+
this.accept = "application/json";
|
|
136
|
+
this.inputSchema = createCustomerAddressInputSchema;
|
|
137
|
+
this.outputSchema = createCustomerAddressResponseSchema;
|
|
138
|
+
this.querySchema = void 0;
|
|
139
|
+
this.headersSchema = void 0;
|
|
140
|
+
}
|
|
141
|
+
getPath() {
|
|
142
|
+
return "/customers/addresses";
|
|
143
|
+
}
|
|
144
|
+
};
|
|
145
|
+
|
|
146
|
+
// src/requests/customer-addresses/DeleteCustomerAddress.ts
|
|
147
|
+
import { AbstractApiRequest as AbstractApiRequest2 } from "@deliverart/sdk-js-core";
|
|
148
|
+
import { emptyResponseSchema } from "@deliverart/sdk-js-global-types";
|
|
149
|
+
import { z as z2 } from "zod";
|
|
150
|
+
var deleteCustomerAddressInputSchema = z2.undefined();
|
|
151
|
+
var deleteCustomerAddressResponseSchema = emptyResponseSchema;
|
|
152
|
+
var DeleteCustomerAddress = class extends AbstractApiRequest2 {
|
|
153
|
+
constructor(customerAddressId) {
|
|
154
|
+
super(void 0);
|
|
155
|
+
this.method = "DELETE";
|
|
156
|
+
this.contentType = "application/json";
|
|
157
|
+
this.accept = "application/json";
|
|
158
|
+
this.inputSchema = deleteCustomerAddressInputSchema;
|
|
159
|
+
this.outputSchema = deleteCustomerAddressResponseSchema;
|
|
160
|
+
this.querySchema = void 0;
|
|
161
|
+
this.headersSchema = void 0;
|
|
162
|
+
this.customerAddressId = customerAddressId;
|
|
163
|
+
}
|
|
164
|
+
getPath() {
|
|
165
|
+
return `/customers/addresses/${this.customerAddressId}`;
|
|
166
|
+
}
|
|
167
|
+
};
|
|
168
|
+
|
|
169
|
+
// src/requests/customer-addresses/GetCustomerAddressDetails.ts
|
|
170
|
+
import { AbstractApiRequest as AbstractApiRequest3 } from "@deliverart/sdk-js-core";
|
|
171
|
+
import { z as z3 } from "zod";
|
|
172
|
+
var getCustomerAddressDetailsInputSchema = z3.undefined();
|
|
173
|
+
var getCustomerAddressDetailsResponseSchema = customerAddressDetailsSchema;
|
|
174
|
+
var GetCustomerAddressDetails = class extends AbstractApiRequest3 {
|
|
175
|
+
constructor(customerAddressId) {
|
|
176
|
+
super(void 0);
|
|
177
|
+
this.method = "GET";
|
|
178
|
+
this.contentType = "application/json";
|
|
179
|
+
this.accept = "application/json";
|
|
180
|
+
this.inputSchema = getCustomerAddressDetailsInputSchema;
|
|
181
|
+
this.outputSchema = getCustomerAddressDetailsResponseSchema;
|
|
182
|
+
this.querySchema = void 0;
|
|
183
|
+
this.headersSchema = void 0;
|
|
184
|
+
this.customerAddressId = customerAddressId;
|
|
185
|
+
}
|
|
186
|
+
getPath() {
|
|
187
|
+
return `/customers/addresses/${this.customerAddressId}`;
|
|
188
|
+
}
|
|
189
|
+
};
|
|
190
|
+
|
|
191
|
+
// src/requests/customer-addresses/GetCustomerAddresses.ts
|
|
192
|
+
import { AbstractApiRequest as AbstractApiRequest4 } from "@deliverart/sdk-js-core";
|
|
193
|
+
import {
|
|
194
|
+
createPaginatedSchema,
|
|
195
|
+
sortDirSchema as sortDirSchema2,
|
|
196
|
+
timestampsFilterSchema as timestampsFilterSchema2
|
|
197
|
+
} from "@deliverart/sdk-js-global-types";
|
|
198
|
+
import { z as z4 } from "zod";
|
|
199
|
+
var getCustomerAddressesQuerySchema = z4.object({
|
|
200
|
+
"order[createdAt]": sortDirSchema2.optional(),
|
|
201
|
+
"order[updatedAt]": sortDirSchema2.optional(),
|
|
202
|
+
page: z4.coerce.number().optional()
|
|
203
|
+
}).extend(timestampsFilterSchema2.shape);
|
|
204
|
+
var getCustomerAddressesInputSchema = z4.undefined();
|
|
205
|
+
var getCustomerAddressesResponseSchema = createPaginatedSchema(customerAddressSchema);
|
|
206
|
+
var GetCustomerAddresses = class extends AbstractApiRequest4 {
|
|
207
|
+
constructor(options) {
|
|
208
|
+
super(void 0, options);
|
|
209
|
+
this.method = "GET";
|
|
210
|
+
this.contentType = "application/json";
|
|
211
|
+
this.accept = "application/json";
|
|
212
|
+
this.inputSchema = getCustomerAddressesInputSchema;
|
|
213
|
+
this.outputSchema = getCustomerAddressesResponseSchema;
|
|
214
|
+
this.querySchema = getCustomerAddressesQuerySchema;
|
|
215
|
+
this.headersSchema = void 0;
|
|
216
|
+
this.listItemSchema = customerAddressSchema;
|
|
217
|
+
this.paginationDefaultEnabled = true;
|
|
218
|
+
}
|
|
219
|
+
getPath() {
|
|
220
|
+
return "/customers/addresses";
|
|
221
|
+
}
|
|
222
|
+
};
|
|
223
|
+
|
|
224
|
+
// src/requests/customer-addresses/GetCustomerAddressesForCustomer.ts
|
|
225
|
+
import { AbstractApiRequest as AbstractApiRequest5 } from "@deliverart/sdk-js-core";
|
|
226
|
+
import { sortDirSchema as sortDirSchema3, timestampsFilterSchema as timestampsFilterSchema3 } from "@deliverart/sdk-js-global-types";
|
|
227
|
+
import { z as z5 } from "zod";
|
|
228
|
+
var getCustomerAddressesForCustomerQuerySchema = z5.object({
|
|
229
|
+
"order[createdAt]": sortDirSchema3.optional(),
|
|
230
|
+
"order[updatedAt]": sortDirSchema3.optional()
|
|
231
|
+
}).extend(timestampsFilterSchema3.shape);
|
|
232
|
+
var getCustomerAddressesForCustomerInputSchema = z5.undefined();
|
|
233
|
+
var getCustomerAddressesForCustomerResponseSchema = z5.array(customerAddressSchema);
|
|
234
|
+
var GetCustomerAddressesForCustomer = class extends AbstractApiRequest5 {
|
|
235
|
+
constructor(customerId, options) {
|
|
236
|
+
super(void 0, options);
|
|
237
|
+
this.method = "GET";
|
|
238
|
+
this.contentType = "application/json";
|
|
239
|
+
this.accept = "application/json";
|
|
240
|
+
this.inputSchema = getCustomerAddressesForCustomerInputSchema;
|
|
241
|
+
this.outputSchema = getCustomerAddressesForCustomerResponseSchema;
|
|
242
|
+
this.querySchema = getCustomerAddressesForCustomerQuerySchema;
|
|
243
|
+
this.headersSchema = void 0;
|
|
244
|
+
this.listItemSchema = customerAddressSchema;
|
|
245
|
+
this.paginationDefaultEnabled = false;
|
|
246
|
+
this.customerId = customerId;
|
|
247
|
+
}
|
|
248
|
+
getPath() {
|
|
249
|
+
return `/customers/${this.customerId}/addresses`;
|
|
250
|
+
}
|
|
251
|
+
};
|
|
252
|
+
|
|
253
|
+
// src/requests/customer-addresses/UpdateCustomerAddress.ts
|
|
254
|
+
import { AbstractApiRequest as AbstractApiRequest6 } from "@deliverart/sdk-js-core";
|
|
255
|
+
var updateCustomerAddressInputSchema = writableCustomerAddressSchema.partial();
|
|
256
|
+
var updateCustomerAddressResponseSchema = customerAddressDetailsSchema;
|
|
257
|
+
var UpdateCustomerAddress = class extends AbstractApiRequest6 {
|
|
258
|
+
constructor(customerId, input) {
|
|
259
|
+
super(input);
|
|
260
|
+
this.method = "PATCH";
|
|
261
|
+
this.contentType = "application/merge-patch+json";
|
|
262
|
+
this.accept = "application/json";
|
|
263
|
+
this.inputSchema = updateCustomerAddressInputSchema;
|
|
264
|
+
this.outputSchema = updateCustomerAddressResponseSchema;
|
|
265
|
+
this.querySchema = void 0;
|
|
266
|
+
this.headersSchema = void 0;
|
|
267
|
+
this.customerId = customerId;
|
|
268
|
+
}
|
|
269
|
+
getPath() {
|
|
270
|
+
return `/customers/addresses/${this.customerId}`;
|
|
271
|
+
}
|
|
272
|
+
};
|
|
273
|
+
|
|
274
|
+
// src/requests/customer-business-profiles/CreateCustomerBusinessProfile.ts
|
|
275
|
+
import { AbstractApiRequest as AbstractApiRequest7 } from "@deliverart/sdk-js-core";
|
|
276
|
+
var createCustomerBusinessProfileInputSchema = writableCreateCustomerBusinessProfileSchema.required();
|
|
277
|
+
var createCustomerBusinessProfileResponseSchema = customerBusinessProfileDetailsSchema;
|
|
278
|
+
var CreateCustomerBusinessProfile = class extends AbstractApiRequest7 {
|
|
279
|
+
constructor(input) {
|
|
280
|
+
super(input);
|
|
281
|
+
this.method = "POST";
|
|
282
|
+
this.contentType = "application/json";
|
|
283
|
+
this.accept = "application/json";
|
|
284
|
+
this.inputSchema = createCustomerBusinessProfileInputSchema;
|
|
285
|
+
this.outputSchema = createCustomerBusinessProfileResponseSchema;
|
|
286
|
+
this.querySchema = void 0;
|
|
287
|
+
this.headersSchema = void 0;
|
|
288
|
+
}
|
|
289
|
+
getPath() {
|
|
290
|
+
return "/customers/business_profiles";
|
|
291
|
+
}
|
|
292
|
+
};
|
|
293
|
+
|
|
294
|
+
// src/requests/customer-business-profiles/DeleteCustomerBusinessProfile.ts
|
|
295
|
+
import { AbstractApiRequest as AbstractApiRequest8 } from "@deliverart/sdk-js-core";
|
|
296
|
+
import { emptyResponseSchema as emptyResponseSchema2 } from "@deliverart/sdk-js-global-types";
|
|
297
|
+
import { z as z6 } from "zod";
|
|
298
|
+
var deleteCustomerBusinessProfileInputSchema = z6.undefined();
|
|
299
|
+
var deleteCustomerBusinessProfileResponseSchema = emptyResponseSchema2;
|
|
300
|
+
var DeleteCustomerBusinessProfile = class extends AbstractApiRequest8 {
|
|
301
|
+
constructor(customerBusinessProfileId) {
|
|
302
|
+
super(void 0);
|
|
303
|
+
this.method = "DELETE";
|
|
304
|
+
this.contentType = "application/json";
|
|
305
|
+
this.accept = "application/json";
|
|
306
|
+
this.inputSchema = deleteCustomerBusinessProfileInputSchema;
|
|
307
|
+
this.outputSchema = deleteCustomerBusinessProfileResponseSchema;
|
|
308
|
+
this.querySchema = void 0;
|
|
309
|
+
this.headersSchema = void 0;
|
|
310
|
+
this.customerBusinessProfileId = customerBusinessProfileId;
|
|
311
|
+
}
|
|
312
|
+
getPath() {
|
|
313
|
+
return `/customers/business_profiles/${this.customerBusinessProfileId}`;
|
|
314
|
+
}
|
|
315
|
+
};
|
|
316
|
+
|
|
317
|
+
// src/requests/customer-business-profiles/GetCustomerBusinessProfileDetails.ts
|
|
318
|
+
import { AbstractApiRequest as AbstractApiRequest9 } from "@deliverart/sdk-js-core";
|
|
319
|
+
import { z as z7 } from "zod";
|
|
320
|
+
var getCustomerBusinessProfileDetailsInputSchema = z7.undefined();
|
|
321
|
+
var getCustomerBusinessProfileDetailsResponseSchema = customerBusinessProfileDetailsSchema;
|
|
322
|
+
var GetCustomerBusinessProfileDetails = class extends AbstractApiRequest9 {
|
|
323
|
+
constructor(customerBusinessProfileId) {
|
|
324
|
+
super(void 0);
|
|
325
|
+
this.method = "GET";
|
|
326
|
+
this.contentType = "application/json";
|
|
327
|
+
this.accept = "application/json";
|
|
328
|
+
this.inputSchema = getCustomerBusinessProfileDetailsInputSchema;
|
|
329
|
+
this.outputSchema = getCustomerBusinessProfileDetailsResponseSchema;
|
|
330
|
+
this.querySchema = void 0;
|
|
331
|
+
this.headersSchema = void 0;
|
|
332
|
+
this.customerBusinessProfileId = customerBusinessProfileId;
|
|
333
|
+
}
|
|
334
|
+
getPath() {
|
|
335
|
+
return `/customers/business_profiles/${this.customerBusinessProfileId}`;
|
|
336
|
+
}
|
|
337
|
+
};
|
|
338
|
+
|
|
339
|
+
// src/requests/customer-business-profiles/GetCustomerBusinessProfiles.ts
|
|
340
|
+
import { AbstractApiRequest as AbstractApiRequest10 } from "@deliverart/sdk-js-core";
|
|
341
|
+
import {
|
|
342
|
+
createPaginatedSchema as createPaginatedSchema2,
|
|
343
|
+
sortDirSchema as sortDirSchema4,
|
|
344
|
+
timestampsFilterSchema as timestampsFilterSchema4
|
|
345
|
+
} from "@deliverart/sdk-js-global-types";
|
|
346
|
+
import { z as z8 } from "zod";
|
|
347
|
+
var getCustomerBusinessProfilesQuerySchema = z8.object({
|
|
348
|
+
"order[businessName]": sortDirSchema4.optional(),
|
|
349
|
+
"order[createdAt]": sortDirSchema4.optional(),
|
|
350
|
+
"order[updatedAt]": sortDirSchema4.optional(),
|
|
351
|
+
businessName: z8.string().optional(),
|
|
352
|
+
vat: z8.string().optional(),
|
|
353
|
+
taxCode: z8.string().optional(),
|
|
354
|
+
page: z8.coerce.number().optional()
|
|
355
|
+
}).extend(timestampsFilterSchema4.shape);
|
|
356
|
+
var getCustomerBusinessProfilesInputSchema = z8.undefined();
|
|
357
|
+
var getCustomerBusinessProfilesResponseSchema = createPaginatedSchema2(
|
|
358
|
+
customerBusinessProfileSchema
|
|
359
|
+
);
|
|
360
|
+
var GetCustomerBusinessProfiles = class extends AbstractApiRequest10 {
|
|
361
|
+
constructor(options) {
|
|
362
|
+
super(void 0, options);
|
|
363
|
+
this.method = "GET";
|
|
364
|
+
this.contentType = "application/json";
|
|
365
|
+
this.accept = "application/json";
|
|
366
|
+
this.inputSchema = getCustomerBusinessProfilesInputSchema;
|
|
367
|
+
this.outputSchema = getCustomerBusinessProfilesResponseSchema;
|
|
368
|
+
this.querySchema = getCustomerBusinessProfilesQuerySchema;
|
|
369
|
+
this.headersSchema = void 0;
|
|
370
|
+
this.listItemSchema = customerBusinessProfileSchema;
|
|
371
|
+
this.paginationDefaultEnabled = true;
|
|
372
|
+
}
|
|
373
|
+
getPath() {
|
|
374
|
+
return "/customers/business_profiles";
|
|
375
|
+
}
|
|
376
|
+
};
|
|
377
|
+
|
|
378
|
+
// src/requests/customer-business-profiles/GetCustomerBusinessProfilesForCustomer.ts
|
|
379
|
+
import { AbstractApiRequest as AbstractApiRequest11 } from "@deliverart/sdk-js-core";
|
|
380
|
+
import { sortDirSchema as sortDirSchema5, timestampsFilterSchema as timestampsFilterSchema5 } from "@deliverart/sdk-js-global-types";
|
|
381
|
+
import { z as z9 } from "zod";
|
|
382
|
+
var getCustomerBusinessProfilesForCustomerQuerySchema = z9.object({
|
|
383
|
+
"order[businessName]": sortDirSchema5.optional(),
|
|
384
|
+
"order[createdAt]": sortDirSchema5.optional(),
|
|
385
|
+
"order[updatedAt]": sortDirSchema5.optional(),
|
|
386
|
+
businessName: z9.string().optional(),
|
|
387
|
+
vat: z9.string().optional(),
|
|
388
|
+
taxCode: z9.string().optional()
|
|
389
|
+
}).extend(timestampsFilterSchema5.shape);
|
|
390
|
+
var getCustomerBusinessProfilesForCustomerInputSchema = z9.undefined();
|
|
391
|
+
var getCustomerBusinessProfilesForCustomerResponseSchema = z9.array(
|
|
392
|
+
customerBusinessProfileSchema
|
|
393
|
+
);
|
|
394
|
+
var GetCustomerBusinessProfilesForCustomer = class extends AbstractApiRequest11 {
|
|
395
|
+
constructor(customerId, options) {
|
|
396
|
+
super(void 0, options);
|
|
397
|
+
this.method = "GET";
|
|
398
|
+
this.contentType = "application/json";
|
|
399
|
+
this.accept = "application/json";
|
|
400
|
+
this.inputSchema = getCustomerBusinessProfilesForCustomerInputSchema;
|
|
401
|
+
this.outputSchema = getCustomerBusinessProfilesForCustomerResponseSchema;
|
|
402
|
+
this.querySchema = getCustomerBusinessProfilesForCustomerQuerySchema;
|
|
403
|
+
this.headersSchema = void 0;
|
|
404
|
+
this.listItemSchema = customerBusinessProfileSchema;
|
|
405
|
+
this.paginationDefaultEnabled = false;
|
|
406
|
+
this.customerId = customerId;
|
|
407
|
+
}
|
|
408
|
+
getPath() {
|
|
409
|
+
return `/customers/${this.customerId}/business_profiles`;
|
|
410
|
+
}
|
|
411
|
+
};
|
|
412
|
+
|
|
413
|
+
// src/requests/customer-business-profiles/UpdateCustomerBusinessProfile.ts
|
|
414
|
+
import { AbstractApiRequest as AbstractApiRequest12 } from "@deliverart/sdk-js-core";
|
|
415
|
+
var updateCustomerBusinessProfileInputSchema = writableCustomerBusinessProfileSchema.partial();
|
|
416
|
+
var updateCustomerBusinessProfileResponseSchema = customerBusinessProfileDetailsSchema;
|
|
417
|
+
var UpdateCustomerBusinessProfile = class extends AbstractApiRequest12 {
|
|
418
|
+
constructor(customerId, input) {
|
|
419
|
+
super(input);
|
|
420
|
+
this.method = "PATCH";
|
|
421
|
+
this.contentType = "application/merge-patch+json";
|
|
422
|
+
this.accept = "application/json";
|
|
423
|
+
this.inputSchema = updateCustomerBusinessProfileInputSchema;
|
|
424
|
+
this.outputSchema = updateCustomerBusinessProfileResponseSchema;
|
|
425
|
+
this.querySchema = void 0;
|
|
426
|
+
this.headersSchema = void 0;
|
|
427
|
+
this.customerId = customerId;
|
|
428
|
+
}
|
|
429
|
+
getPath() {
|
|
430
|
+
return `/customers/business_profiles/${this.customerId}`;
|
|
431
|
+
}
|
|
432
|
+
};
|
|
433
|
+
|
|
434
|
+
// src/requests/customers/CreateCustomer.ts
|
|
435
|
+
import { AbstractApiRequest as AbstractApiRequest13 } from "@deliverart/sdk-js-core";
|
|
436
|
+
var createCustomerInputSchema = writableCreateCustomerSchema.required();
|
|
437
|
+
var createCustomerResponseSchema = customerDetailsSchema;
|
|
438
|
+
var CreateCustomer = class extends AbstractApiRequest13 {
|
|
439
|
+
constructor(input) {
|
|
440
|
+
super(input);
|
|
441
|
+
this.method = "POST";
|
|
442
|
+
this.contentType = "application/json";
|
|
443
|
+
this.accept = "application/json";
|
|
444
|
+
this.inputSchema = createCustomerInputSchema;
|
|
445
|
+
this.outputSchema = createCustomerResponseSchema;
|
|
446
|
+
this.querySchema = void 0;
|
|
447
|
+
this.headersSchema = void 0;
|
|
448
|
+
}
|
|
449
|
+
getPath() {
|
|
450
|
+
return "/customers";
|
|
451
|
+
}
|
|
452
|
+
};
|
|
453
|
+
|
|
454
|
+
// src/requests/customers/CreateCustomerFromCurrentUser.ts
|
|
455
|
+
import { AbstractApiRequest as AbstractApiRequest14 } from "@deliverart/sdk-js-core";
|
|
456
|
+
var createCustomerFromCurrentUserInputSchema = writableCreateCustomerSchema.required();
|
|
457
|
+
var createCustomerFromCurrentUserResponseSchema = customerDetailsSchema;
|
|
458
|
+
var CreateCustomerFromCurrentUser = class extends AbstractApiRequest14 {
|
|
459
|
+
constructor(input) {
|
|
460
|
+
super(input);
|
|
461
|
+
this.method = "POST";
|
|
462
|
+
this.contentType = "application/json";
|
|
463
|
+
this.accept = "application/json";
|
|
464
|
+
this.inputSchema = createCustomerFromCurrentUserInputSchema;
|
|
465
|
+
this.outputSchema = createCustomerFromCurrentUserResponseSchema;
|
|
466
|
+
this.querySchema = void 0;
|
|
467
|
+
this.headersSchema = void 0;
|
|
468
|
+
}
|
|
469
|
+
getPath() {
|
|
470
|
+
return "/customers/from/me";
|
|
471
|
+
}
|
|
472
|
+
};
|
|
473
|
+
|
|
474
|
+
// src/requests/customers/DeleteCustomer.ts
|
|
475
|
+
import { AbstractApiRequest as AbstractApiRequest15 } from "@deliverart/sdk-js-core";
|
|
476
|
+
import { emptyResponseSchema as emptyResponseSchema3 } from "@deliverart/sdk-js-global-types";
|
|
477
|
+
import { z as z10 } from "zod";
|
|
478
|
+
var deleteCustomerInputSchema = z10.undefined();
|
|
479
|
+
var deleteCustomerResponseSchema = emptyResponseSchema3;
|
|
480
|
+
var DeleteCustomer = class extends AbstractApiRequest15 {
|
|
481
|
+
constructor(customerId) {
|
|
482
|
+
super(void 0);
|
|
483
|
+
this.method = "DELETE";
|
|
484
|
+
this.contentType = "application/json";
|
|
485
|
+
this.accept = "application/json";
|
|
486
|
+
this.inputSchema = deleteCustomerInputSchema;
|
|
487
|
+
this.outputSchema = deleteCustomerResponseSchema;
|
|
488
|
+
this.querySchema = void 0;
|
|
489
|
+
this.headersSchema = void 0;
|
|
490
|
+
this.customerId = customerId;
|
|
491
|
+
}
|
|
492
|
+
getPath() {
|
|
493
|
+
return `/customers/${this.customerId}`;
|
|
494
|
+
}
|
|
495
|
+
};
|
|
496
|
+
|
|
497
|
+
// src/requests/customers/GetCustomerDetails.ts
|
|
498
|
+
import { AbstractApiRequest as AbstractApiRequest16 } from "@deliverart/sdk-js-core";
|
|
499
|
+
import { z as z11 } from "zod";
|
|
500
|
+
var getCustomerDetailsInputSchema = z11.undefined();
|
|
501
|
+
var getCustomerDetailsResponseSchema = customerDetailsSchema;
|
|
502
|
+
var GetCustomerDetails = class extends AbstractApiRequest16 {
|
|
503
|
+
constructor(customerId) {
|
|
504
|
+
super(void 0);
|
|
505
|
+
this.method = "GET";
|
|
506
|
+
this.contentType = "application/json";
|
|
507
|
+
this.accept = "application/json";
|
|
508
|
+
this.inputSchema = getCustomerDetailsInputSchema;
|
|
509
|
+
this.outputSchema = getCustomerDetailsResponseSchema;
|
|
510
|
+
this.querySchema = void 0;
|
|
511
|
+
this.headersSchema = void 0;
|
|
512
|
+
this.customerId = customerId;
|
|
513
|
+
}
|
|
514
|
+
getPath() {
|
|
515
|
+
return `/customers/${this.customerId}`;
|
|
516
|
+
}
|
|
517
|
+
};
|
|
518
|
+
|
|
519
|
+
// src/requests/customers/GetCustomers.ts
|
|
520
|
+
import { AbstractApiRequest as AbstractApiRequest17 } from "@deliverart/sdk-js-core";
|
|
521
|
+
import { createPaginatedSchema as createPaginatedSchema3 } from "@deliverart/sdk-js-global-types";
|
|
522
|
+
import { z as z12 } from "zod";
|
|
523
|
+
var getCustomersQuerySchema = customersQuerySchema;
|
|
524
|
+
var getCustomersInputSchema = z12.undefined();
|
|
525
|
+
var getCustomersResponseSchema = createPaginatedSchema3(customerSchema);
|
|
526
|
+
var GetCustomers = class extends AbstractApiRequest17 {
|
|
527
|
+
constructor(options) {
|
|
528
|
+
super(void 0, options);
|
|
529
|
+
this.method = "GET";
|
|
530
|
+
this.contentType = "application/json";
|
|
531
|
+
this.accept = "application/json";
|
|
532
|
+
this.inputSchema = getCustomersInputSchema;
|
|
533
|
+
this.outputSchema = getCustomersResponseSchema;
|
|
534
|
+
this.querySchema = getCustomersQuerySchema;
|
|
535
|
+
this.headersSchema = void 0;
|
|
536
|
+
// Declare list behavior
|
|
537
|
+
this.listItemSchema = customerSchema;
|
|
538
|
+
this.paginationDefaultEnabled = true;
|
|
539
|
+
}
|
|
540
|
+
getPath() {
|
|
541
|
+
return "/customers";
|
|
542
|
+
}
|
|
543
|
+
};
|
|
544
|
+
|
|
545
|
+
// src/requests/customers/GetCustomersFromPointOfSale.ts
|
|
546
|
+
import { AbstractApiRequest as AbstractApiRequest18 } from "@deliverart/sdk-js-core";
|
|
547
|
+
import { createPaginatedSchema as createPaginatedSchema4 } from "@deliverart/sdk-js-global-types";
|
|
548
|
+
import { z as z13 } from "zod";
|
|
549
|
+
var getCustomersFromPointOfSaleQuerySchema = customersQuerySchema;
|
|
550
|
+
var getCustomersFromPointOfSaleInputSchema = z13.undefined();
|
|
551
|
+
var getCustomersFromPointOfSaleResponseSchema = createPaginatedSchema4(customerSchema);
|
|
552
|
+
var GetCustomersFromPointOfSale = class extends AbstractApiRequest18 {
|
|
553
|
+
constructor(pointOfSaleId, options) {
|
|
554
|
+
super(void 0, options);
|
|
555
|
+
this.method = "GET";
|
|
556
|
+
this.contentType = "application/json";
|
|
557
|
+
this.accept = "application/json";
|
|
558
|
+
this.inputSchema = getCustomersFromPointOfSaleInputSchema;
|
|
559
|
+
this.outputSchema = getCustomersFromPointOfSaleResponseSchema;
|
|
560
|
+
this.querySchema = getCustomersFromPointOfSaleQuerySchema;
|
|
561
|
+
this.headersSchema = void 0;
|
|
562
|
+
// Declare list behavior
|
|
563
|
+
this.listItemSchema = customerSchema;
|
|
564
|
+
this.paginationDefaultEnabled = true;
|
|
565
|
+
this.pointOfSaleId = pointOfSaleId;
|
|
566
|
+
}
|
|
567
|
+
getPath() {
|
|
568
|
+
return `/point_of_sales/${this.pointOfSaleId}/customers`;
|
|
569
|
+
}
|
|
570
|
+
};
|
|
571
|
+
|
|
572
|
+
// src/requests/customers/UpdateCustomer.ts
|
|
573
|
+
import { AbstractApiRequest as AbstractApiRequest19 } from "@deliverart/sdk-js-core";
|
|
574
|
+
var updateCustomerInputSchema = writableCustomerSchema.partial();
|
|
575
|
+
var updateCustomerResponseSchema = customerDetailsSchema;
|
|
576
|
+
var UpdateCustomer = class extends AbstractApiRequest19 {
|
|
577
|
+
constructor(customerId, input) {
|
|
578
|
+
super(input);
|
|
579
|
+
this.method = "PATCH";
|
|
580
|
+
this.contentType = "application/merge-patch+json";
|
|
581
|
+
this.accept = "application/json";
|
|
582
|
+
this.inputSchema = updateCustomerInputSchema;
|
|
583
|
+
this.outputSchema = updateCustomerResponseSchema;
|
|
584
|
+
this.querySchema = void 0;
|
|
585
|
+
this.headersSchema = void 0;
|
|
586
|
+
this.customerId = customerId;
|
|
587
|
+
}
|
|
588
|
+
getPath() {
|
|
589
|
+
return `/customers/${this.customerId}`;
|
|
590
|
+
}
|
|
591
|
+
};
|
|
592
|
+
export {
|
|
593
|
+
CreateCustomer,
|
|
594
|
+
CreateCustomerAddress,
|
|
595
|
+
CreateCustomerBusinessProfile,
|
|
596
|
+
CreateCustomerFromCurrentUser,
|
|
597
|
+
DeleteCustomer,
|
|
598
|
+
DeleteCustomerAddress,
|
|
599
|
+
DeleteCustomerBusinessProfile,
|
|
600
|
+
GetCustomerAddressDetails,
|
|
601
|
+
GetCustomerAddresses,
|
|
602
|
+
GetCustomerAddressesForCustomer,
|
|
603
|
+
GetCustomerBusinessProfileDetails,
|
|
604
|
+
GetCustomerBusinessProfiles,
|
|
605
|
+
GetCustomerBusinessProfilesForCustomer,
|
|
606
|
+
GetCustomerDetails,
|
|
607
|
+
GetCustomers,
|
|
608
|
+
GetCustomersFromPointOfSale,
|
|
609
|
+
UpdateCustomer,
|
|
610
|
+
UpdateCustomerAddress,
|
|
611
|
+
UpdateCustomerBusinessProfile,
|
|
612
|
+
createCustomerAddressInputSchema,
|
|
613
|
+
createCustomerAddressResponseSchema,
|
|
614
|
+
createCustomerBusinessProfileInputSchema,
|
|
615
|
+
createCustomerBusinessProfileResponseSchema,
|
|
616
|
+
createCustomerFromCurrentUserInputSchema,
|
|
617
|
+
createCustomerFromCurrentUserResponseSchema,
|
|
618
|
+
createCustomerInputSchema,
|
|
619
|
+
createCustomerResponseSchema,
|
|
620
|
+
customerAddressDetailsSchema,
|
|
621
|
+
customerAddressIriSchema,
|
|
622
|
+
customerAddressNullableIriSchema,
|
|
623
|
+
customerAddressSchema,
|
|
624
|
+
customerBusinessProfileDetailsSchema,
|
|
625
|
+
customerBusinessProfileIriSchema,
|
|
626
|
+
customerBusinessProfileNullableIriSchema,
|
|
627
|
+
customerBusinessProfileSchema,
|
|
628
|
+
customerDetailsSchema,
|
|
629
|
+
customerIriSchema,
|
|
630
|
+
customerNullableIriSchema,
|
|
631
|
+
customerSchema,
|
|
632
|
+
customersQuerySchema,
|
|
633
|
+
deleteCustomerAddressInputSchema,
|
|
634
|
+
deleteCustomerAddressResponseSchema,
|
|
635
|
+
deleteCustomerBusinessProfileInputSchema,
|
|
636
|
+
deleteCustomerBusinessProfileResponseSchema,
|
|
637
|
+
deleteCustomerInputSchema,
|
|
638
|
+
deleteCustomerResponseSchema,
|
|
639
|
+
getCustomerAddressDetailsInputSchema,
|
|
640
|
+
getCustomerAddressDetailsResponseSchema,
|
|
641
|
+
getCustomerAddressesForCustomerInputSchema,
|
|
642
|
+
getCustomerAddressesForCustomerQuerySchema,
|
|
643
|
+
getCustomerAddressesForCustomerResponseSchema,
|
|
644
|
+
getCustomerAddressesInputSchema,
|
|
645
|
+
getCustomerAddressesQuerySchema,
|
|
646
|
+
getCustomerAddressesResponseSchema,
|
|
647
|
+
getCustomerBusinessProfileDetailsInputSchema,
|
|
648
|
+
getCustomerBusinessProfileDetailsResponseSchema,
|
|
649
|
+
getCustomerBusinessProfilesForCustomerInputSchema,
|
|
650
|
+
getCustomerBusinessProfilesForCustomerQuerySchema,
|
|
651
|
+
getCustomerBusinessProfilesForCustomerResponseSchema,
|
|
652
|
+
getCustomerBusinessProfilesInputSchema,
|
|
653
|
+
getCustomerBusinessProfilesQuerySchema,
|
|
654
|
+
getCustomerBusinessProfilesResponseSchema,
|
|
655
|
+
getCustomerDetailsInputSchema,
|
|
656
|
+
getCustomerDetailsResponseSchema,
|
|
657
|
+
getCustomersFromPointOfSaleInputSchema,
|
|
658
|
+
getCustomersFromPointOfSaleQuerySchema,
|
|
659
|
+
getCustomersFromPointOfSaleResponseSchema,
|
|
660
|
+
getCustomersInputSchema,
|
|
661
|
+
getCustomersQuerySchema,
|
|
662
|
+
getCustomersResponseSchema,
|
|
663
|
+
updateCustomerAddressInputSchema,
|
|
664
|
+
updateCustomerAddressResponseSchema,
|
|
665
|
+
updateCustomerBusinessProfileInputSchema,
|
|
666
|
+
updateCustomerBusinessProfileResponseSchema,
|
|
667
|
+
updateCustomerInputSchema,
|
|
668
|
+
updateCustomerResponseSchema,
|
|
669
|
+
writableCreateCustomerAddressSchema,
|
|
670
|
+
writableCreateCustomerBusinessProfileSchema,
|
|
671
|
+
writableCreateCustomerSchema,
|
|
672
|
+
writableCustomerAddressSchema,
|
|
673
|
+
writableCustomerBusinessProfileSchema,
|
|
674
|
+
writableCustomerSchema
|
|
675
|
+
};
|