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