@deliverart/sdk-js-sales-mode 0.0.1
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/.changeset/config.json +11 -0
- package/.github/workflows/workflow.yml +47 -0
- package/.prettierrc +7 -0
- package/CHANGELOG.md +19 -0
- package/README.md +3 -0
- package/dist/index.cjs +227 -0
- package/dist/index.d.cts +464 -0
- package/dist/index.d.ts +464 -0
- package/dist/index.js +184 -0
- package/eslint.config.js +41 -0
- package/package.json +47 -0
- package/src/index.ts +3 -0
- package/src/models.ts +23 -0
- package/src/requests/CreateSalesMode.ts +32 -0
- package/src/requests/DeleteSalesMode.ts +27 -0
- package/src/requests/GetSalesModeDetails.ts +30 -0
- package/src/requests/GetSalesModes.ts +56 -0
- package/src/requests/UpdateSalesMode.ts +35 -0
- package/src/requests/index.ts +5 -0
- package/src/types.ts +22 -0
- package/tsconfig.json +15 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,464 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { AbstractApiRequest } from '@deliverart/sdk-js-core';
|
|
3
|
+
import { Paginated } from '@deliverart/sdk-js-global-types';
|
|
4
|
+
import { AxiosResponse } from 'axios';
|
|
5
|
+
|
|
6
|
+
declare const salesModeSchema: z.ZodObject<{
|
|
7
|
+
id: z.ZodString;
|
|
8
|
+
pointOfSale: z.ZodEffects<z.ZodString, string, string>;
|
|
9
|
+
name: z.ZodString;
|
|
10
|
+
createdAt: z.ZodEffects<z.ZodString, string, string>;
|
|
11
|
+
updatedAt: z.ZodEffects<z.ZodString, string, string>;
|
|
12
|
+
}, "strip", z.ZodTypeAny, {
|
|
13
|
+
id: string;
|
|
14
|
+
pointOfSale: string;
|
|
15
|
+
name: string;
|
|
16
|
+
createdAt: string;
|
|
17
|
+
updatedAt: string;
|
|
18
|
+
}, {
|
|
19
|
+
id: string;
|
|
20
|
+
pointOfSale: string;
|
|
21
|
+
name: string;
|
|
22
|
+
createdAt: string;
|
|
23
|
+
updatedAt: string;
|
|
24
|
+
}>;
|
|
25
|
+
type SalesMode = z.infer<typeof salesModeSchema>;
|
|
26
|
+
declare const writableSalesModeSchema: z.ZodObject<Pick<{
|
|
27
|
+
id: z.ZodString;
|
|
28
|
+
pointOfSale: z.ZodEffects<z.ZodString, string, string>;
|
|
29
|
+
name: z.ZodString;
|
|
30
|
+
createdAt: z.ZodEffects<z.ZodString, string, string>;
|
|
31
|
+
updatedAt: z.ZodEffects<z.ZodString, string, string>;
|
|
32
|
+
}, "name">, "strip", z.ZodTypeAny, {
|
|
33
|
+
name: string;
|
|
34
|
+
}, {
|
|
35
|
+
name: string;
|
|
36
|
+
}>;
|
|
37
|
+
type WritableSalesMode = z.infer<typeof writableSalesModeSchema>;
|
|
38
|
+
declare const writableCreateSalesModeSchema: z.ZodObject<Pick<{
|
|
39
|
+
id: z.ZodString;
|
|
40
|
+
pointOfSale: z.ZodEffects<z.ZodString, string, string>;
|
|
41
|
+
name: z.ZodString;
|
|
42
|
+
createdAt: z.ZodEffects<z.ZodString, string, string>;
|
|
43
|
+
updatedAt: z.ZodEffects<z.ZodString, string, string>;
|
|
44
|
+
}, "pointOfSale" | "name">, "strip", z.ZodTypeAny, {
|
|
45
|
+
pointOfSale: string;
|
|
46
|
+
name: string;
|
|
47
|
+
}, {
|
|
48
|
+
pointOfSale: string;
|
|
49
|
+
name: string;
|
|
50
|
+
}>;
|
|
51
|
+
type WritableCreateSalesMode = z.infer<typeof writableCreateSalesModeSchema>;
|
|
52
|
+
|
|
53
|
+
declare const createSalesModeInputSchema: z.ZodObject<{
|
|
54
|
+
pointOfSale: z.ZodEffects<z.ZodString, string, string>;
|
|
55
|
+
name: z.ZodString;
|
|
56
|
+
}, "strip", z.ZodTypeAny, {
|
|
57
|
+
pointOfSale: string;
|
|
58
|
+
name: string;
|
|
59
|
+
}, {
|
|
60
|
+
pointOfSale: string;
|
|
61
|
+
name: string;
|
|
62
|
+
}>;
|
|
63
|
+
type CreateSalesModeInput = z.infer<typeof createSalesModeInputSchema>;
|
|
64
|
+
declare const createSalesModeResponseSchema: z.ZodObject<{
|
|
65
|
+
id: z.ZodString;
|
|
66
|
+
pointOfSale: z.ZodEffects<z.ZodString, string, string>;
|
|
67
|
+
name: z.ZodString;
|
|
68
|
+
createdAt: z.ZodEffects<z.ZodString, string, string>;
|
|
69
|
+
updatedAt: z.ZodEffects<z.ZodString, string, string>;
|
|
70
|
+
}, "strip", z.ZodTypeAny, {
|
|
71
|
+
id: string;
|
|
72
|
+
pointOfSale: string;
|
|
73
|
+
name: string;
|
|
74
|
+
createdAt: string;
|
|
75
|
+
updatedAt: string;
|
|
76
|
+
}, {
|
|
77
|
+
id: string;
|
|
78
|
+
pointOfSale: string;
|
|
79
|
+
name: string;
|
|
80
|
+
createdAt: string;
|
|
81
|
+
updatedAt: string;
|
|
82
|
+
}>;
|
|
83
|
+
type CreateSalesModeResponse = SalesMode;
|
|
84
|
+
declare class CreateSalesMode extends AbstractApiRequest<CreateSalesModeInput, CreateSalesModeResponse> {
|
|
85
|
+
readonly method = "POST";
|
|
86
|
+
readonly contentType = "application/json";
|
|
87
|
+
readonly accept = "application/json";
|
|
88
|
+
readonly inputSchema: z.ZodObject<{
|
|
89
|
+
pointOfSale: z.ZodEffects<z.ZodString, string, string>;
|
|
90
|
+
name: z.ZodString;
|
|
91
|
+
}, "strip", z.ZodTypeAny, {
|
|
92
|
+
pointOfSale: string;
|
|
93
|
+
name: string;
|
|
94
|
+
}, {
|
|
95
|
+
pointOfSale: string;
|
|
96
|
+
name: string;
|
|
97
|
+
}>;
|
|
98
|
+
readonly outputSchema: z.ZodObject<{
|
|
99
|
+
id: z.ZodString;
|
|
100
|
+
pointOfSale: z.ZodEffects<z.ZodString, string, string>;
|
|
101
|
+
name: z.ZodString;
|
|
102
|
+
createdAt: z.ZodEffects<z.ZodString, string, string>;
|
|
103
|
+
updatedAt: z.ZodEffects<z.ZodString, string, string>;
|
|
104
|
+
}, "strip", z.ZodTypeAny, {
|
|
105
|
+
id: string;
|
|
106
|
+
pointOfSale: string;
|
|
107
|
+
name: string;
|
|
108
|
+
createdAt: string;
|
|
109
|
+
updatedAt: string;
|
|
110
|
+
}, {
|
|
111
|
+
id: string;
|
|
112
|
+
pointOfSale: string;
|
|
113
|
+
name: string;
|
|
114
|
+
createdAt: string;
|
|
115
|
+
updatedAt: string;
|
|
116
|
+
}>;
|
|
117
|
+
readonly querySchema: undefined;
|
|
118
|
+
readonly headersSchema: undefined;
|
|
119
|
+
constructor(input: CreateSalesModeInput);
|
|
120
|
+
getPath(): string;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
declare const deleteSalesModeInputSchema: z.ZodUndefined;
|
|
124
|
+
declare const deleteSalesModeResponseSchema: z.ZodUndefined;
|
|
125
|
+
declare class DeleteSalesMode extends AbstractApiRequest<void, void> {
|
|
126
|
+
readonly method = "DELETE";
|
|
127
|
+
readonly contentType = "application/json";
|
|
128
|
+
readonly accept = "application/json";
|
|
129
|
+
readonly inputSchema: z.ZodUndefined;
|
|
130
|
+
readonly outputSchema: z.ZodUndefined;
|
|
131
|
+
readonly querySchema: undefined;
|
|
132
|
+
readonly headersSchema: undefined;
|
|
133
|
+
private readonly salesModeId;
|
|
134
|
+
constructor(salesModeId: string);
|
|
135
|
+
getPath(): string;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
declare const getSalesModeDetailsInputSchema: z.ZodUndefined;
|
|
139
|
+
declare const getSalesModeDetailsResponseSchema: z.ZodObject<{
|
|
140
|
+
id: z.ZodString;
|
|
141
|
+
pointOfSale: z.ZodEffects<z.ZodString, string, string>;
|
|
142
|
+
name: z.ZodString;
|
|
143
|
+
createdAt: z.ZodEffects<z.ZodString, string, string>;
|
|
144
|
+
updatedAt: z.ZodEffects<z.ZodString, string, string>;
|
|
145
|
+
}, "strip", z.ZodTypeAny, {
|
|
146
|
+
id: string;
|
|
147
|
+
pointOfSale: string;
|
|
148
|
+
name: string;
|
|
149
|
+
createdAt: string;
|
|
150
|
+
updatedAt: string;
|
|
151
|
+
}, {
|
|
152
|
+
id: string;
|
|
153
|
+
pointOfSale: string;
|
|
154
|
+
name: string;
|
|
155
|
+
createdAt: string;
|
|
156
|
+
updatedAt: string;
|
|
157
|
+
}>;
|
|
158
|
+
type GetSalesModeDetailsResponse = SalesMode;
|
|
159
|
+
declare class GetSalesModeDetails extends AbstractApiRequest<void, GetSalesModeDetailsResponse> {
|
|
160
|
+
readonly method = "GET";
|
|
161
|
+
readonly contentType = "application/json";
|
|
162
|
+
readonly accept = "application/json";
|
|
163
|
+
readonly inputSchema: z.ZodUndefined;
|
|
164
|
+
readonly outputSchema: z.ZodObject<{
|
|
165
|
+
id: z.ZodString;
|
|
166
|
+
pointOfSale: z.ZodEffects<z.ZodString, string, string>;
|
|
167
|
+
name: z.ZodString;
|
|
168
|
+
createdAt: z.ZodEffects<z.ZodString, string, string>;
|
|
169
|
+
updatedAt: z.ZodEffects<z.ZodString, string, string>;
|
|
170
|
+
}, "strip", z.ZodTypeAny, {
|
|
171
|
+
id: string;
|
|
172
|
+
pointOfSale: string;
|
|
173
|
+
name: string;
|
|
174
|
+
createdAt: string;
|
|
175
|
+
updatedAt: string;
|
|
176
|
+
}, {
|
|
177
|
+
id: string;
|
|
178
|
+
pointOfSale: string;
|
|
179
|
+
name: string;
|
|
180
|
+
createdAt: string;
|
|
181
|
+
updatedAt: string;
|
|
182
|
+
}>;
|
|
183
|
+
readonly querySchema: undefined;
|
|
184
|
+
readonly headersSchema: undefined;
|
|
185
|
+
private readonly salesModeId;
|
|
186
|
+
constructor(salesModeId: string);
|
|
187
|
+
getPath(): string;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
declare const getSalesModesQuerySchema: z.ZodObject<{
|
|
191
|
+
name: z.ZodOptional<z.ZodString>;
|
|
192
|
+
'order[name]': z.ZodOptional<z.ZodEnum<["asc", "desc"]>>;
|
|
193
|
+
'order[createdAt]': z.ZodOptional<z.ZodEnum<["asc", "desc"]>>;
|
|
194
|
+
'order[updatedAt]': z.ZodOptional<z.ZodEnum<["asc", "desc"]>>;
|
|
195
|
+
page: z.ZodOptional<z.ZodNumber>;
|
|
196
|
+
}, "strip", z.ZodTypeAny, {
|
|
197
|
+
name?: string | undefined;
|
|
198
|
+
'order[name]'?: "asc" | "desc" | undefined;
|
|
199
|
+
'order[createdAt]'?: "asc" | "desc" | undefined;
|
|
200
|
+
'order[updatedAt]'?: "asc" | "desc" | undefined;
|
|
201
|
+
page?: number | undefined;
|
|
202
|
+
}, {
|
|
203
|
+
name?: string | undefined;
|
|
204
|
+
'order[name]'?: "asc" | "desc" | undefined;
|
|
205
|
+
'order[createdAt]'?: "asc" | "desc" | undefined;
|
|
206
|
+
'order[updatedAt]'?: "asc" | "desc" | undefined;
|
|
207
|
+
page?: number | undefined;
|
|
208
|
+
}>;
|
|
209
|
+
type GetSalesModesQueryParams = z.infer<typeof getSalesModesQuerySchema>;
|
|
210
|
+
declare const getSalesModesResponseSchema: z.ZodObject<{
|
|
211
|
+
data: z.ZodArray<z.ZodObject<{
|
|
212
|
+
id: z.ZodString;
|
|
213
|
+
pointOfSale: z.ZodEffects<z.ZodString, string, string>;
|
|
214
|
+
name: z.ZodString;
|
|
215
|
+
createdAt: z.ZodEffects<z.ZodString, string, string>;
|
|
216
|
+
updatedAt: z.ZodEffects<z.ZodString, string, string>;
|
|
217
|
+
}, "strip", z.ZodTypeAny, {
|
|
218
|
+
id: string;
|
|
219
|
+
pointOfSale: string;
|
|
220
|
+
name: string;
|
|
221
|
+
createdAt: string;
|
|
222
|
+
updatedAt: string;
|
|
223
|
+
}, {
|
|
224
|
+
id: string;
|
|
225
|
+
pointOfSale: string;
|
|
226
|
+
name: string;
|
|
227
|
+
createdAt: string;
|
|
228
|
+
updatedAt: string;
|
|
229
|
+
}>, "many">;
|
|
230
|
+
pagination: z.ZodObject<{
|
|
231
|
+
from: z.ZodNumber;
|
|
232
|
+
to: z.ZodNumber;
|
|
233
|
+
itemsPerPage: z.ZodNumber;
|
|
234
|
+
totalItems: z.ZodNumber;
|
|
235
|
+
currentPage: z.ZodNumber;
|
|
236
|
+
lastPage: z.ZodNumber;
|
|
237
|
+
}, "strip", z.ZodTypeAny, {
|
|
238
|
+
from: number;
|
|
239
|
+
to: number;
|
|
240
|
+
itemsPerPage: number;
|
|
241
|
+
totalItems: number;
|
|
242
|
+
currentPage: number;
|
|
243
|
+
lastPage: number;
|
|
244
|
+
}, {
|
|
245
|
+
from: number;
|
|
246
|
+
to: number;
|
|
247
|
+
itemsPerPage: number;
|
|
248
|
+
totalItems: number;
|
|
249
|
+
currentPage: number;
|
|
250
|
+
lastPage: number;
|
|
251
|
+
}>;
|
|
252
|
+
}, "strip", z.ZodTypeAny, {
|
|
253
|
+
data: {
|
|
254
|
+
id: string;
|
|
255
|
+
pointOfSale: string;
|
|
256
|
+
name: string;
|
|
257
|
+
createdAt: string;
|
|
258
|
+
updatedAt: string;
|
|
259
|
+
}[];
|
|
260
|
+
pagination: {
|
|
261
|
+
from: number;
|
|
262
|
+
to: number;
|
|
263
|
+
itemsPerPage: number;
|
|
264
|
+
totalItems: number;
|
|
265
|
+
currentPage: number;
|
|
266
|
+
lastPage: number;
|
|
267
|
+
};
|
|
268
|
+
}, {
|
|
269
|
+
data: {
|
|
270
|
+
id: string;
|
|
271
|
+
pointOfSale: string;
|
|
272
|
+
name: string;
|
|
273
|
+
createdAt: string;
|
|
274
|
+
updatedAt: string;
|
|
275
|
+
}[];
|
|
276
|
+
pagination: {
|
|
277
|
+
from: number;
|
|
278
|
+
to: number;
|
|
279
|
+
itemsPerPage: number;
|
|
280
|
+
totalItems: number;
|
|
281
|
+
currentPage: number;
|
|
282
|
+
lastPage: number;
|
|
283
|
+
};
|
|
284
|
+
}>;
|
|
285
|
+
type GetSalesModesResponse = z.infer<typeof getSalesModesResponseSchema>;
|
|
286
|
+
declare const getSalesModesInputSchema: z.ZodUndefined;
|
|
287
|
+
declare class GetSalesModes extends AbstractApiRequest<void, GetSalesModesResponse, GetSalesModesQueryParams> {
|
|
288
|
+
readonly method = "GET";
|
|
289
|
+
readonly contentType = "application/json";
|
|
290
|
+
readonly accept = "application/json";
|
|
291
|
+
readonly inputSchema: z.ZodUndefined;
|
|
292
|
+
readonly outputSchema: z.ZodObject<{
|
|
293
|
+
data: z.ZodArray<z.ZodObject<{
|
|
294
|
+
id: z.ZodString;
|
|
295
|
+
pointOfSale: z.ZodEffects<z.ZodString, string, string>;
|
|
296
|
+
name: z.ZodString;
|
|
297
|
+
createdAt: z.ZodEffects<z.ZodString, string, string>;
|
|
298
|
+
updatedAt: z.ZodEffects<z.ZodString, string, string>;
|
|
299
|
+
}, "strip", z.ZodTypeAny, {
|
|
300
|
+
id: string;
|
|
301
|
+
pointOfSale: string;
|
|
302
|
+
name: string;
|
|
303
|
+
createdAt: string;
|
|
304
|
+
updatedAt: string;
|
|
305
|
+
}, {
|
|
306
|
+
id: string;
|
|
307
|
+
pointOfSale: string;
|
|
308
|
+
name: string;
|
|
309
|
+
createdAt: string;
|
|
310
|
+
updatedAt: string;
|
|
311
|
+
}>, "many">;
|
|
312
|
+
pagination: z.ZodObject<{
|
|
313
|
+
from: z.ZodNumber;
|
|
314
|
+
to: z.ZodNumber;
|
|
315
|
+
itemsPerPage: z.ZodNumber;
|
|
316
|
+
totalItems: z.ZodNumber;
|
|
317
|
+
currentPage: z.ZodNumber;
|
|
318
|
+
lastPage: z.ZodNumber;
|
|
319
|
+
}, "strip", z.ZodTypeAny, {
|
|
320
|
+
from: number;
|
|
321
|
+
to: number;
|
|
322
|
+
itemsPerPage: number;
|
|
323
|
+
totalItems: number;
|
|
324
|
+
currentPage: number;
|
|
325
|
+
lastPage: number;
|
|
326
|
+
}, {
|
|
327
|
+
from: number;
|
|
328
|
+
to: number;
|
|
329
|
+
itemsPerPage: number;
|
|
330
|
+
totalItems: number;
|
|
331
|
+
currentPage: number;
|
|
332
|
+
lastPage: number;
|
|
333
|
+
}>;
|
|
334
|
+
}, "strip", z.ZodTypeAny, {
|
|
335
|
+
data: {
|
|
336
|
+
id: string;
|
|
337
|
+
pointOfSale: string;
|
|
338
|
+
name: string;
|
|
339
|
+
createdAt: string;
|
|
340
|
+
updatedAt: string;
|
|
341
|
+
}[];
|
|
342
|
+
pagination: {
|
|
343
|
+
from: number;
|
|
344
|
+
to: number;
|
|
345
|
+
itemsPerPage: number;
|
|
346
|
+
totalItems: number;
|
|
347
|
+
currentPage: number;
|
|
348
|
+
lastPage: number;
|
|
349
|
+
};
|
|
350
|
+
}, {
|
|
351
|
+
data: {
|
|
352
|
+
id: string;
|
|
353
|
+
pointOfSale: string;
|
|
354
|
+
name: string;
|
|
355
|
+
createdAt: string;
|
|
356
|
+
updatedAt: string;
|
|
357
|
+
}[];
|
|
358
|
+
pagination: {
|
|
359
|
+
from: number;
|
|
360
|
+
to: number;
|
|
361
|
+
itemsPerPage: number;
|
|
362
|
+
totalItems: number;
|
|
363
|
+
currentPage: number;
|
|
364
|
+
lastPage: number;
|
|
365
|
+
};
|
|
366
|
+
}>;
|
|
367
|
+
readonly querySchema: z.ZodObject<{
|
|
368
|
+
name: z.ZodOptional<z.ZodString>;
|
|
369
|
+
'order[name]': z.ZodOptional<z.ZodEnum<["asc", "desc"]>>;
|
|
370
|
+
'order[createdAt]': z.ZodOptional<z.ZodEnum<["asc", "desc"]>>;
|
|
371
|
+
'order[updatedAt]': z.ZodOptional<z.ZodEnum<["asc", "desc"]>>;
|
|
372
|
+
page: z.ZodOptional<z.ZodNumber>;
|
|
373
|
+
}, "strip", z.ZodTypeAny, {
|
|
374
|
+
name?: string | undefined;
|
|
375
|
+
'order[name]'?: "asc" | "desc" | undefined;
|
|
376
|
+
'order[createdAt]'?: "asc" | "desc" | undefined;
|
|
377
|
+
'order[updatedAt]'?: "asc" | "desc" | undefined;
|
|
378
|
+
page?: number | undefined;
|
|
379
|
+
}, {
|
|
380
|
+
name?: string | undefined;
|
|
381
|
+
'order[name]'?: "asc" | "desc" | undefined;
|
|
382
|
+
'order[createdAt]'?: "asc" | "desc" | undefined;
|
|
383
|
+
'order[updatedAt]'?: "asc" | "desc" | undefined;
|
|
384
|
+
page?: number | undefined;
|
|
385
|
+
}>;
|
|
386
|
+
readonly headersSchema: undefined;
|
|
387
|
+
constructor(options?: {
|
|
388
|
+
query?: GetSalesModesQueryParams;
|
|
389
|
+
});
|
|
390
|
+
getPath(): string;
|
|
391
|
+
parseResponse(data: unknown, rawResponse: AxiosResponse): Paginated<SalesMode>;
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
declare const updateSalesModeInputSchema: z.ZodObject<{
|
|
395
|
+
name: z.ZodOptional<z.ZodString>;
|
|
396
|
+
}, "strip", z.ZodTypeAny, {
|
|
397
|
+
name?: string | undefined;
|
|
398
|
+
}, {
|
|
399
|
+
name?: string | undefined;
|
|
400
|
+
}>;
|
|
401
|
+
type UpdateSalesModeInput = z.infer<typeof updateSalesModeInputSchema>;
|
|
402
|
+
declare const updateSalesModeResponseSchema: z.ZodObject<{
|
|
403
|
+
id: z.ZodString;
|
|
404
|
+
pointOfSale: z.ZodEffects<z.ZodString, string, string>;
|
|
405
|
+
name: z.ZodString;
|
|
406
|
+
createdAt: z.ZodEffects<z.ZodString, string, string>;
|
|
407
|
+
updatedAt: z.ZodEffects<z.ZodString, string, string>;
|
|
408
|
+
}, "strip", z.ZodTypeAny, {
|
|
409
|
+
id: string;
|
|
410
|
+
pointOfSale: string;
|
|
411
|
+
name: string;
|
|
412
|
+
createdAt: string;
|
|
413
|
+
updatedAt: string;
|
|
414
|
+
}, {
|
|
415
|
+
id: string;
|
|
416
|
+
pointOfSale: string;
|
|
417
|
+
name: string;
|
|
418
|
+
createdAt: string;
|
|
419
|
+
updatedAt: string;
|
|
420
|
+
}>;
|
|
421
|
+
type UpdateSalesModeResponse = SalesMode;
|
|
422
|
+
declare class UpdateSalesMode extends AbstractApiRequest<UpdateSalesModeInput, UpdateSalesModeResponse> {
|
|
423
|
+
readonly method = "PATCH";
|
|
424
|
+
readonly contentType = "application/merge-patch+json";
|
|
425
|
+
readonly accept = "application/json";
|
|
426
|
+
readonly inputSchema: z.ZodObject<{
|
|
427
|
+
name: z.ZodOptional<z.ZodString>;
|
|
428
|
+
}, "strip", z.ZodTypeAny, {
|
|
429
|
+
name?: string | undefined;
|
|
430
|
+
}, {
|
|
431
|
+
name?: string | undefined;
|
|
432
|
+
}>;
|
|
433
|
+
readonly outputSchema: z.ZodObject<{
|
|
434
|
+
id: z.ZodString;
|
|
435
|
+
pointOfSale: z.ZodEffects<z.ZodString, string, string>;
|
|
436
|
+
name: z.ZodString;
|
|
437
|
+
createdAt: z.ZodEffects<z.ZodString, string, string>;
|
|
438
|
+
updatedAt: z.ZodEffects<z.ZodString, string, string>;
|
|
439
|
+
}, "strip", z.ZodTypeAny, {
|
|
440
|
+
id: string;
|
|
441
|
+
pointOfSale: string;
|
|
442
|
+
name: string;
|
|
443
|
+
createdAt: string;
|
|
444
|
+
updatedAt: string;
|
|
445
|
+
}, {
|
|
446
|
+
id: string;
|
|
447
|
+
pointOfSale: string;
|
|
448
|
+
name: string;
|
|
449
|
+
createdAt: string;
|
|
450
|
+
updatedAt: string;
|
|
451
|
+
}>;
|
|
452
|
+
readonly querySchema: undefined;
|
|
453
|
+
readonly headersSchema: undefined;
|
|
454
|
+
private readonly salesModeId;
|
|
455
|
+
constructor(salesModeId: string, input: UpdateSalesModeInput);
|
|
456
|
+
getPath(): string;
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
declare const salesModePathSchema: z.ZodEffects<z.ZodString, string, string>;
|
|
460
|
+
type SalesModePath = z.infer<typeof salesModePathSchema>;
|
|
461
|
+
declare const salesModeNullablePathSchema: z.ZodEffects<z.ZodNullable<z.ZodString>, string | null, string | null>;
|
|
462
|
+
type SalesModeNullablePath = z.infer<typeof salesModeNullablePathSchema>;
|
|
463
|
+
|
|
464
|
+
export { CreateSalesMode, type CreateSalesModeInput, type CreateSalesModeResponse, DeleteSalesMode, GetSalesModeDetails, type GetSalesModeDetailsResponse, GetSalesModes, type GetSalesModesQueryParams, type GetSalesModesResponse, type SalesMode, type SalesModeNullablePath, type SalesModePath, UpdateSalesMode, type UpdateSalesModeInput, type UpdateSalesModeResponse, type WritableCreateSalesMode, type WritableSalesMode, createSalesModeInputSchema, createSalesModeResponseSchema, deleteSalesModeInputSchema, deleteSalesModeResponseSchema, getSalesModeDetailsInputSchema, getSalesModeDetailsResponseSchema, getSalesModesInputSchema, getSalesModesQuerySchema, getSalesModesResponseSchema, salesModeNullablePathSchema, salesModePathSchema, salesModeSchema, updateSalesModeInputSchema, updateSalesModeResponseSchema, writableCreateSalesModeSchema, writableSalesModeSchema };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
// src/models.ts
|
|
2
|
+
import { datetimeSchema } from "@deliverart/sdk-js-global-types";
|
|
3
|
+
import { pointOfSalePathSchema } from "@deliverart/sdk-js-point-of-sale";
|
|
4
|
+
import { z } from "zod";
|
|
5
|
+
var salesModeSchema = z.object({
|
|
6
|
+
id: z.string(),
|
|
7
|
+
pointOfSale: pointOfSalePathSchema,
|
|
8
|
+
name: z.string(),
|
|
9
|
+
createdAt: datetimeSchema,
|
|
10
|
+
updatedAt: datetimeSchema
|
|
11
|
+
});
|
|
12
|
+
var writableSalesModeSchema = salesModeSchema.pick({
|
|
13
|
+
name: true
|
|
14
|
+
});
|
|
15
|
+
var writableCreateSalesModeSchema = salesModeSchema.pick({
|
|
16
|
+
pointOfSale: true,
|
|
17
|
+
name: true
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
// src/requests/CreateSalesMode.ts
|
|
21
|
+
import { AbstractApiRequest } from "@deliverart/sdk-js-core";
|
|
22
|
+
var createSalesModeInputSchema = writableCreateSalesModeSchema.required();
|
|
23
|
+
var createSalesModeResponseSchema = salesModeSchema;
|
|
24
|
+
var CreateSalesMode = class extends AbstractApiRequest {
|
|
25
|
+
method = "POST";
|
|
26
|
+
contentType = "application/json";
|
|
27
|
+
accept = "application/json";
|
|
28
|
+
inputSchema = createSalesModeInputSchema;
|
|
29
|
+
outputSchema = createSalesModeResponseSchema;
|
|
30
|
+
querySchema = void 0;
|
|
31
|
+
headersSchema = void 0;
|
|
32
|
+
constructor(input) {
|
|
33
|
+
super(input);
|
|
34
|
+
}
|
|
35
|
+
getPath() {
|
|
36
|
+
return "/sales_modes";
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
// src/requests/DeleteSalesMode.ts
|
|
41
|
+
import { AbstractApiRequest as AbstractApiRequest2 } from "@deliverart/sdk-js-core";
|
|
42
|
+
import { z as z2 } from "zod";
|
|
43
|
+
var deleteSalesModeInputSchema = z2.undefined();
|
|
44
|
+
var deleteSalesModeResponseSchema = z2.undefined();
|
|
45
|
+
var DeleteSalesMode = class extends AbstractApiRequest2 {
|
|
46
|
+
method = "DELETE";
|
|
47
|
+
contentType = "application/json";
|
|
48
|
+
accept = "application/json";
|
|
49
|
+
inputSchema = deleteSalesModeInputSchema;
|
|
50
|
+
outputSchema = deleteSalesModeResponseSchema;
|
|
51
|
+
querySchema = void 0;
|
|
52
|
+
headersSchema = void 0;
|
|
53
|
+
salesModeId;
|
|
54
|
+
constructor(salesModeId) {
|
|
55
|
+
super();
|
|
56
|
+
this.salesModeId = salesModeId;
|
|
57
|
+
}
|
|
58
|
+
getPath() {
|
|
59
|
+
return `/sales_modes/${this.salesModeId}`;
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
// src/requests/GetSalesModeDetails.ts
|
|
64
|
+
import { AbstractApiRequest as AbstractApiRequest3 } from "@deliverart/sdk-js-core";
|
|
65
|
+
import { z as z3 } from "zod";
|
|
66
|
+
var getSalesModeDetailsInputSchema = z3.undefined();
|
|
67
|
+
var getSalesModeDetailsResponseSchema = salesModeSchema;
|
|
68
|
+
var GetSalesModeDetails = class extends AbstractApiRequest3 {
|
|
69
|
+
method = "GET";
|
|
70
|
+
contentType = "application/json";
|
|
71
|
+
accept = "application/json";
|
|
72
|
+
inputSchema = getSalesModeDetailsInputSchema;
|
|
73
|
+
outputSchema = getSalesModeDetailsResponseSchema;
|
|
74
|
+
querySchema = void 0;
|
|
75
|
+
headersSchema = void 0;
|
|
76
|
+
salesModeId;
|
|
77
|
+
constructor(salesModeId) {
|
|
78
|
+
super();
|
|
79
|
+
this.salesModeId = salesModeId;
|
|
80
|
+
}
|
|
81
|
+
getPath() {
|
|
82
|
+
return `/sales_modes/${this.salesModeId}`;
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
// src/requests/GetSalesModes.ts
|
|
87
|
+
import { AbstractApiRequest as AbstractApiRequest4 } from "@deliverart/sdk-js-core";
|
|
88
|
+
import {
|
|
89
|
+
createPaginatedSchema,
|
|
90
|
+
responseToPagination,
|
|
91
|
+
sortDirSchema
|
|
92
|
+
} from "@deliverart/sdk-js-global-types";
|
|
93
|
+
import { z as z4 } from "zod";
|
|
94
|
+
var getSalesModesQuerySchema = z4.object({
|
|
95
|
+
name: z4.string().optional(),
|
|
96
|
+
"order[name]": sortDirSchema.optional(),
|
|
97
|
+
"order[createdAt]": sortDirSchema.optional(),
|
|
98
|
+
"order[updatedAt]": sortDirSchema.optional(),
|
|
99
|
+
page: z4.coerce.number().optional()
|
|
100
|
+
});
|
|
101
|
+
var getSalesModesResponseSchema = createPaginatedSchema(salesModeSchema);
|
|
102
|
+
var getSalesModesInputSchema = z4.undefined();
|
|
103
|
+
var GetSalesModes = class extends AbstractApiRequest4 {
|
|
104
|
+
method = "GET";
|
|
105
|
+
contentType = "application/json";
|
|
106
|
+
accept = "application/json";
|
|
107
|
+
inputSchema = getSalesModesInputSchema;
|
|
108
|
+
outputSchema = getSalesModesResponseSchema;
|
|
109
|
+
querySchema = getSalesModesQuerySchema;
|
|
110
|
+
headersSchema = void 0;
|
|
111
|
+
constructor(options) {
|
|
112
|
+
super(void 0, options);
|
|
113
|
+
}
|
|
114
|
+
getPath() {
|
|
115
|
+
return "/sales_modes";
|
|
116
|
+
}
|
|
117
|
+
parseResponse(data, rawResponse) {
|
|
118
|
+
const salesModes = z4.array(salesModeSchema).parse(data);
|
|
119
|
+
return this.validateOutput({
|
|
120
|
+
data: salesModes,
|
|
121
|
+
pagination: responseToPagination(rawResponse)
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
// src/requests/UpdateSalesMode.ts
|
|
127
|
+
import { AbstractApiRequest as AbstractApiRequest5 } from "@deliverart/sdk-js-core";
|
|
128
|
+
var updateSalesModeInputSchema = writableSalesModeSchema.partial();
|
|
129
|
+
var updateSalesModeResponseSchema = salesModeSchema;
|
|
130
|
+
var UpdateSalesMode = class extends AbstractApiRequest5 {
|
|
131
|
+
method = "PATCH";
|
|
132
|
+
contentType = "application/merge-patch+json";
|
|
133
|
+
accept = "application/json";
|
|
134
|
+
inputSchema = updateSalesModeInputSchema;
|
|
135
|
+
outputSchema = updateSalesModeResponseSchema;
|
|
136
|
+
querySchema = void 0;
|
|
137
|
+
headersSchema = void 0;
|
|
138
|
+
salesModeId;
|
|
139
|
+
constructor(salesModeId, input) {
|
|
140
|
+
super(input);
|
|
141
|
+
this.salesModeId = salesModeId;
|
|
142
|
+
}
|
|
143
|
+
getPath() {
|
|
144
|
+
return `/sales_modes/${this.salesModeId}`;
|
|
145
|
+
}
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
// src/types.ts
|
|
149
|
+
import { z as z5 } from "zod";
|
|
150
|
+
var salesModePathSchema = z5.string().refine((val) => /^\/sales_modes\/[a-z_]+\/[0-9a-fA-F-]{36}$/.test(val), {
|
|
151
|
+
message: "Invalid sales mode path format"
|
|
152
|
+
});
|
|
153
|
+
var salesModeNullablePathSchema = z5.string().nullable().refine(
|
|
154
|
+
(val) => {
|
|
155
|
+
if (!val) return true;
|
|
156
|
+
return /^\/sales_modes\/[a-z_]+\/[0-9a-fA-F-]{36}$/.test(val);
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
message: "Invalid sales mode path format"
|
|
160
|
+
}
|
|
161
|
+
);
|
|
162
|
+
export {
|
|
163
|
+
CreateSalesMode,
|
|
164
|
+
DeleteSalesMode,
|
|
165
|
+
GetSalesModeDetails,
|
|
166
|
+
GetSalesModes,
|
|
167
|
+
UpdateSalesMode,
|
|
168
|
+
createSalesModeInputSchema,
|
|
169
|
+
createSalesModeResponseSchema,
|
|
170
|
+
deleteSalesModeInputSchema,
|
|
171
|
+
deleteSalesModeResponseSchema,
|
|
172
|
+
getSalesModeDetailsInputSchema,
|
|
173
|
+
getSalesModeDetailsResponseSchema,
|
|
174
|
+
getSalesModesInputSchema,
|
|
175
|
+
getSalesModesQuerySchema,
|
|
176
|
+
getSalesModesResponseSchema,
|
|
177
|
+
salesModeNullablePathSchema,
|
|
178
|
+
salesModePathSchema,
|
|
179
|
+
salesModeSchema,
|
|
180
|
+
updateSalesModeInputSchema,
|
|
181
|
+
updateSalesModeResponseSchema,
|
|
182
|
+
writableCreateSalesModeSchema,
|
|
183
|
+
writableSalesModeSchema
|
|
184
|
+
};
|
package/eslint.config.js
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
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']
|