@deliverart/sdk-js-image 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 +141 -0
- package/dist/index.cjs +281 -0
- package/dist/index.d.cts +461 -0
- package/dist/index.d.ts +461 -0
- package/dist/index.js +231 -0
- package/package.json +33 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,461 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { AbstractApiRequest } from '@deliverart/sdk-js-core';
|
|
3
|
+
import * as _deliverart_sdk_js_global_types from '@deliverart/sdk-js-global-types';
|
|
4
|
+
|
|
5
|
+
declare const imageSchema: z.ZodObject<{
|
|
6
|
+
id: z.ZodString;
|
|
7
|
+
variant: z.ZodNullable<z.ZodString>;
|
|
8
|
+
contentUrl: z.ZodURL;
|
|
9
|
+
filePath: z.ZodString;
|
|
10
|
+
tags: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
11
|
+
createdAt: z.ZodString;
|
|
12
|
+
updatedAt: z.ZodString;
|
|
13
|
+
variants: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
14
|
+
id: z.ZodString;
|
|
15
|
+
variant: z.ZodNullable<z.ZodString>;
|
|
16
|
+
contentUrl: z.ZodURL;
|
|
17
|
+
filePath: z.ZodString;
|
|
18
|
+
tags: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
19
|
+
createdAt: z.ZodString;
|
|
20
|
+
updatedAt: z.ZodString;
|
|
21
|
+
}, z.core.$strip>>>;
|
|
22
|
+
}, z.core.$strip>;
|
|
23
|
+
type Image = z.infer<typeof imageSchema>;
|
|
24
|
+
declare const imagesQuerySchema: z.ZodObject<{
|
|
25
|
+
page: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
26
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
27
|
+
'tags.match': z.ZodOptional<z.ZodEnum<{
|
|
28
|
+
all: "all";
|
|
29
|
+
any: "any";
|
|
30
|
+
}>>;
|
|
31
|
+
'exists[original]': z.ZodOptional<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodBoolean>>;
|
|
32
|
+
}, z.core.$strip>;
|
|
33
|
+
type ImagesQueryParams = z.infer<typeof imagesQuerySchema>;
|
|
34
|
+
|
|
35
|
+
declare const deleteImageInputSchema: z.ZodUndefined;
|
|
36
|
+
declare const deleteImageResponseSchema: z.ZodUnion<readonly [z.ZodVoid, z.ZodUndefined, z.ZodNull]>;
|
|
37
|
+
declare class DeleteImage extends AbstractApiRequest<typeof deleteImageInputSchema, typeof deleteImageResponseSchema> {
|
|
38
|
+
readonly method = "DELETE";
|
|
39
|
+
readonly contentType = "application/json";
|
|
40
|
+
readonly accept = "application/json";
|
|
41
|
+
readonly inputSchema: z.ZodUndefined;
|
|
42
|
+
readonly outputSchema: z.ZodUnion<readonly [z.ZodVoid, z.ZodUndefined, z.ZodNull]>;
|
|
43
|
+
readonly querySchema: undefined;
|
|
44
|
+
readonly headersSchema: undefined;
|
|
45
|
+
private readonly imageId;
|
|
46
|
+
constructor(imageId: string);
|
|
47
|
+
getPath(): string;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
declare const getImageDetailsInputSchema: z.ZodUndefined;
|
|
51
|
+
type GetImageDetailsInput = z.input<typeof getImageDetailsInputSchema>;
|
|
52
|
+
declare const getImageDetailsResponseSchema: z.ZodObject<{
|
|
53
|
+
id: z.ZodString;
|
|
54
|
+
variant: z.ZodNullable<z.ZodString>;
|
|
55
|
+
contentUrl: z.ZodURL;
|
|
56
|
+
filePath: z.ZodString;
|
|
57
|
+
tags: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
58
|
+
createdAt: z.ZodString;
|
|
59
|
+
updatedAt: z.ZodString;
|
|
60
|
+
variants: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
61
|
+
id: z.ZodString;
|
|
62
|
+
variant: z.ZodNullable<z.ZodString>;
|
|
63
|
+
contentUrl: z.ZodURL;
|
|
64
|
+
filePath: z.ZodString;
|
|
65
|
+
tags: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
66
|
+
createdAt: z.ZodString;
|
|
67
|
+
updatedAt: z.ZodString;
|
|
68
|
+
}, z.core.$strip>>>;
|
|
69
|
+
}, z.core.$strip>;
|
|
70
|
+
type GetImageDetailsResponse = z.infer<typeof getImageDetailsResponseSchema>;
|
|
71
|
+
declare class GetImageDetails extends AbstractApiRequest<typeof getImageDetailsInputSchema, typeof getImageDetailsResponseSchema> {
|
|
72
|
+
readonly method = "GET";
|
|
73
|
+
readonly contentType = "application/json";
|
|
74
|
+
readonly accept = "application/json";
|
|
75
|
+
readonly inputSchema: z.ZodUndefined;
|
|
76
|
+
readonly outputSchema: z.ZodObject<{
|
|
77
|
+
id: z.ZodString;
|
|
78
|
+
variant: z.ZodNullable<z.ZodString>;
|
|
79
|
+
contentUrl: z.ZodURL;
|
|
80
|
+
filePath: z.ZodString;
|
|
81
|
+
tags: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
82
|
+
createdAt: z.ZodString;
|
|
83
|
+
updatedAt: z.ZodString;
|
|
84
|
+
variants: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
85
|
+
id: z.ZodString;
|
|
86
|
+
variant: z.ZodNullable<z.ZodString>;
|
|
87
|
+
contentUrl: z.ZodURL;
|
|
88
|
+
filePath: z.ZodString;
|
|
89
|
+
tags: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
90
|
+
createdAt: z.ZodString;
|
|
91
|
+
updatedAt: z.ZodString;
|
|
92
|
+
}, z.core.$strip>>>;
|
|
93
|
+
}, z.core.$strip>;
|
|
94
|
+
readonly querySchema: undefined;
|
|
95
|
+
readonly headersSchema: undefined;
|
|
96
|
+
private readonly imageId;
|
|
97
|
+
constructor(imageId: string);
|
|
98
|
+
getPath(): string;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
declare const getImagesQuerySchema: z.ZodObject<{
|
|
102
|
+
page: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
103
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
104
|
+
'tags.match': z.ZodOptional<z.ZodEnum<{
|
|
105
|
+
all: "all";
|
|
106
|
+
any: "any";
|
|
107
|
+
}>>;
|
|
108
|
+
'exists[original]': z.ZodOptional<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodBoolean>>;
|
|
109
|
+
}, z.core.$strip>;
|
|
110
|
+
type GetImagesQueryParams = z.infer<typeof getImagesQuerySchema>;
|
|
111
|
+
declare const getImagesInputSchema: z.ZodUndefined;
|
|
112
|
+
type GetImagesInput = z.infer<typeof getImagesInputSchema>;
|
|
113
|
+
declare const getImagesResponseSchema: z.ZodObject<{
|
|
114
|
+
data: z.ZodArray<z.ZodObject<{
|
|
115
|
+
id: z.ZodString;
|
|
116
|
+
variant: z.ZodNullable<z.ZodString>;
|
|
117
|
+
contentUrl: z.ZodURL;
|
|
118
|
+
filePath: z.ZodString;
|
|
119
|
+
tags: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
120
|
+
createdAt: z.ZodString;
|
|
121
|
+
updatedAt: z.ZodString;
|
|
122
|
+
variants: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
123
|
+
id: z.ZodString;
|
|
124
|
+
variant: z.ZodNullable<z.ZodString>;
|
|
125
|
+
contentUrl: z.ZodURL;
|
|
126
|
+
filePath: z.ZodString;
|
|
127
|
+
tags: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
128
|
+
createdAt: z.ZodString;
|
|
129
|
+
updatedAt: z.ZodString;
|
|
130
|
+
}, z.core.$strip>>>;
|
|
131
|
+
}, z.core.$strip>>;
|
|
132
|
+
pagination: z.ZodObject<{
|
|
133
|
+
from: z.ZodCoercedNumber<unknown>;
|
|
134
|
+
to: z.ZodCoercedNumber<unknown>;
|
|
135
|
+
itemsPerPage: z.ZodCoercedNumber<unknown>;
|
|
136
|
+
totalItems: z.ZodCoercedNumber<unknown>;
|
|
137
|
+
currentPage: z.ZodCoercedNumber<unknown>;
|
|
138
|
+
lastPage: z.ZodCoercedNumber<unknown>;
|
|
139
|
+
}, z.core.$strip>;
|
|
140
|
+
}, z.core.$strip>;
|
|
141
|
+
type GetImagesResponse = z.infer<typeof getImagesResponseSchema>;
|
|
142
|
+
declare class GetImages extends AbstractApiRequest<typeof getImagesInputSchema, typeof getImagesResponseSchema, GetImagesQueryParams> {
|
|
143
|
+
readonly method: "GET";
|
|
144
|
+
readonly contentType: "application/json";
|
|
145
|
+
readonly accept: "application/json";
|
|
146
|
+
readonly inputSchema: z.ZodUndefined;
|
|
147
|
+
readonly outputSchema: z.ZodObject<{
|
|
148
|
+
data: z.ZodArray<z.ZodObject<{
|
|
149
|
+
id: z.ZodString;
|
|
150
|
+
variant: z.ZodNullable<z.ZodString>;
|
|
151
|
+
contentUrl: z.ZodURL;
|
|
152
|
+
filePath: z.ZodString;
|
|
153
|
+
tags: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
154
|
+
createdAt: z.ZodString;
|
|
155
|
+
updatedAt: z.ZodString;
|
|
156
|
+
variants: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
157
|
+
id: z.ZodString;
|
|
158
|
+
variant: z.ZodNullable<z.ZodString>;
|
|
159
|
+
contentUrl: z.ZodURL;
|
|
160
|
+
filePath: z.ZodString;
|
|
161
|
+
tags: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
162
|
+
createdAt: z.ZodString;
|
|
163
|
+
updatedAt: z.ZodString;
|
|
164
|
+
}, z.core.$strip>>>;
|
|
165
|
+
}, z.core.$strip>>;
|
|
166
|
+
pagination: z.ZodObject<{
|
|
167
|
+
from: z.ZodCoercedNumber<unknown>;
|
|
168
|
+
to: z.ZodCoercedNumber<unknown>;
|
|
169
|
+
itemsPerPage: z.ZodCoercedNumber<unknown>;
|
|
170
|
+
totalItems: z.ZodCoercedNumber<unknown>;
|
|
171
|
+
currentPage: z.ZodCoercedNumber<unknown>;
|
|
172
|
+
lastPage: z.ZodCoercedNumber<unknown>;
|
|
173
|
+
}, z.core.$strip>;
|
|
174
|
+
}, z.core.$strip>;
|
|
175
|
+
readonly querySchema: z.ZodObject<{
|
|
176
|
+
page: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
177
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
178
|
+
'tags.match': z.ZodOptional<z.ZodEnum<{
|
|
179
|
+
all: "all";
|
|
180
|
+
any: "any";
|
|
181
|
+
}>>;
|
|
182
|
+
'exists[original]': z.ZodOptional<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodBoolean>>;
|
|
183
|
+
}, z.core.$strip>;
|
|
184
|
+
readonly headersSchema: undefined;
|
|
185
|
+
readonly listItemSchema: z.ZodObject<{
|
|
186
|
+
id: z.ZodString;
|
|
187
|
+
variant: z.ZodNullable<z.ZodString>;
|
|
188
|
+
contentUrl: z.ZodURL;
|
|
189
|
+
filePath: z.ZodString;
|
|
190
|
+
tags: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
191
|
+
createdAt: z.ZodString;
|
|
192
|
+
updatedAt: z.ZodString;
|
|
193
|
+
variants: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
194
|
+
id: z.ZodString;
|
|
195
|
+
variant: z.ZodNullable<z.ZodString>;
|
|
196
|
+
contentUrl: z.ZodURL;
|
|
197
|
+
filePath: z.ZodString;
|
|
198
|
+
tags: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
199
|
+
createdAt: z.ZodString;
|
|
200
|
+
updatedAt: z.ZodString;
|
|
201
|
+
}, z.core.$strip>>>;
|
|
202
|
+
}, z.core.$strip>;
|
|
203
|
+
readonly paginationDefaultEnabled = true;
|
|
204
|
+
constructor(options?: {
|
|
205
|
+
query?: GetImagesQueryParams;
|
|
206
|
+
});
|
|
207
|
+
getPath(): string;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
declare const getImagesFromPointOfSaleQuerySchema: z.ZodObject<{
|
|
211
|
+
page: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
212
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
213
|
+
'tags.match': z.ZodOptional<z.ZodEnum<{
|
|
214
|
+
all: "all";
|
|
215
|
+
any: "any";
|
|
216
|
+
}>>;
|
|
217
|
+
'exists[original]': z.ZodOptional<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodBoolean>>;
|
|
218
|
+
}, z.core.$strip>;
|
|
219
|
+
type GetImagesFromPointOfSaleQueryParams = z.infer<typeof getImagesFromPointOfSaleQuerySchema>;
|
|
220
|
+
declare const getImagesFromPointOfSaleInputSchema: z.ZodUndefined;
|
|
221
|
+
type GetImagesFromPointOfSaleInput = z.infer<typeof getImagesFromPointOfSaleInputSchema>;
|
|
222
|
+
declare const getImagesFromPointOfSaleResponseSchema: z.ZodObject<{
|
|
223
|
+
data: z.ZodArray<z.ZodObject<{
|
|
224
|
+
id: z.ZodString;
|
|
225
|
+
variant: z.ZodNullable<z.ZodString>;
|
|
226
|
+
contentUrl: z.ZodURL;
|
|
227
|
+
filePath: z.ZodString;
|
|
228
|
+
tags: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
229
|
+
createdAt: z.ZodString;
|
|
230
|
+
updatedAt: z.ZodString;
|
|
231
|
+
variants: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
232
|
+
id: z.ZodString;
|
|
233
|
+
variant: z.ZodNullable<z.ZodString>;
|
|
234
|
+
contentUrl: z.ZodURL;
|
|
235
|
+
filePath: z.ZodString;
|
|
236
|
+
tags: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
237
|
+
createdAt: z.ZodString;
|
|
238
|
+
updatedAt: z.ZodString;
|
|
239
|
+
}, z.core.$strip>>>;
|
|
240
|
+
}, z.core.$strip>>;
|
|
241
|
+
pagination: z.ZodObject<{
|
|
242
|
+
from: z.ZodCoercedNumber<unknown>;
|
|
243
|
+
to: z.ZodCoercedNumber<unknown>;
|
|
244
|
+
itemsPerPage: z.ZodCoercedNumber<unknown>;
|
|
245
|
+
totalItems: z.ZodCoercedNumber<unknown>;
|
|
246
|
+
currentPage: z.ZodCoercedNumber<unknown>;
|
|
247
|
+
lastPage: z.ZodCoercedNumber<unknown>;
|
|
248
|
+
}, z.core.$strip>;
|
|
249
|
+
}, z.core.$strip>;
|
|
250
|
+
type GetImagesFromPointOfSaleResponse = z.infer<typeof getImagesFromPointOfSaleResponseSchema>;
|
|
251
|
+
declare class GetImagesFromPointOfSale extends AbstractApiRequest<typeof getImagesFromPointOfSaleInputSchema, typeof getImagesFromPointOfSaleResponseSchema, GetImagesFromPointOfSaleQueryParams> {
|
|
252
|
+
readonly method: "GET";
|
|
253
|
+
readonly contentType: "application/json";
|
|
254
|
+
readonly accept: "application/json";
|
|
255
|
+
readonly inputSchema: z.ZodUndefined;
|
|
256
|
+
readonly outputSchema: z.ZodObject<{
|
|
257
|
+
data: z.ZodArray<z.ZodObject<{
|
|
258
|
+
id: z.ZodString;
|
|
259
|
+
variant: z.ZodNullable<z.ZodString>;
|
|
260
|
+
contentUrl: z.ZodURL;
|
|
261
|
+
filePath: z.ZodString;
|
|
262
|
+
tags: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
263
|
+
createdAt: z.ZodString;
|
|
264
|
+
updatedAt: z.ZodString;
|
|
265
|
+
variants: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
266
|
+
id: z.ZodString;
|
|
267
|
+
variant: z.ZodNullable<z.ZodString>;
|
|
268
|
+
contentUrl: z.ZodURL;
|
|
269
|
+
filePath: z.ZodString;
|
|
270
|
+
tags: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
271
|
+
createdAt: z.ZodString;
|
|
272
|
+
updatedAt: z.ZodString;
|
|
273
|
+
}, z.core.$strip>>>;
|
|
274
|
+
}, z.core.$strip>>;
|
|
275
|
+
pagination: z.ZodObject<{
|
|
276
|
+
from: z.ZodCoercedNumber<unknown>;
|
|
277
|
+
to: z.ZodCoercedNumber<unknown>;
|
|
278
|
+
itemsPerPage: z.ZodCoercedNumber<unknown>;
|
|
279
|
+
totalItems: z.ZodCoercedNumber<unknown>;
|
|
280
|
+
currentPage: z.ZodCoercedNumber<unknown>;
|
|
281
|
+
lastPage: z.ZodCoercedNumber<unknown>;
|
|
282
|
+
}, z.core.$strip>;
|
|
283
|
+
}, z.core.$strip>;
|
|
284
|
+
readonly querySchema: z.ZodObject<{
|
|
285
|
+
page: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
286
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
287
|
+
'tags.match': z.ZodOptional<z.ZodEnum<{
|
|
288
|
+
all: "all";
|
|
289
|
+
any: "any";
|
|
290
|
+
}>>;
|
|
291
|
+
'exists[original]': z.ZodOptional<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodBoolean>>;
|
|
292
|
+
}, z.core.$strip>;
|
|
293
|
+
readonly headersSchema: undefined;
|
|
294
|
+
readonly listItemSchema: z.ZodObject<{
|
|
295
|
+
id: z.ZodString;
|
|
296
|
+
variant: z.ZodNullable<z.ZodString>;
|
|
297
|
+
contentUrl: z.ZodURL;
|
|
298
|
+
filePath: z.ZodString;
|
|
299
|
+
tags: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
300
|
+
createdAt: z.ZodString;
|
|
301
|
+
updatedAt: z.ZodString;
|
|
302
|
+
variants: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
303
|
+
id: z.ZodString;
|
|
304
|
+
variant: z.ZodNullable<z.ZodString>;
|
|
305
|
+
contentUrl: z.ZodURL;
|
|
306
|
+
filePath: z.ZodString;
|
|
307
|
+
tags: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
308
|
+
createdAt: z.ZodString;
|
|
309
|
+
updatedAt: z.ZodString;
|
|
310
|
+
}, z.core.$strip>>>;
|
|
311
|
+
}, z.core.$strip>;
|
|
312
|
+
readonly paginationDefaultEnabled = true;
|
|
313
|
+
private readonly pointOfSaleId;
|
|
314
|
+
constructor(pointOfSaleId: string, options?: {
|
|
315
|
+
query?: GetImagesFromPointOfSaleQueryParams;
|
|
316
|
+
});
|
|
317
|
+
getPath(): string;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
declare const getImageTagsFromPointOfSaleInputSchema: z.ZodUndefined;
|
|
321
|
+
type GetImageTagsFromPointOfSaleInput = z.infer<typeof getImageTagsFromPointOfSaleInputSchema>;
|
|
322
|
+
declare const getImageTagsFromPointOfSaleResponseSchema: z.ZodArray<z.ZodString>;
|
|
323
|
+
type GetImageTagsFromPointOfSaleResponse = z.infer<typeof getImageTagsFromPointOfSaleResponseSchema>;
|
|
324
|
+
declare class GetImageTagsFromPointOfSale extends AbstractApiRequest<typeof getImageTagsFromPointOfSaleInputSchema, typeof getImageTagsFromPointOfSaleResponseSchema> {
|
|
325
|
+
readonly method = "GET";
|
|
326
|
+
readonly contentType = "application/json";
|
|
327
|
+
readonly accept = "application/json";
|
|
328
|
+
readonly inputSchema: z.ZodUndefined;
|
|
329
|
+
readonly outputSchema: z.ZodArray<z.ZodString>;
|
|
330
|
+
readonly querySchema: undefined;
|
|
331
|
+
readonly headersSchema: undefined;
|
|
332
|
+
private readonly pointOfSaleId;
|
|
333
|
+
constructor(pointOfSaleId: string);
|
|
334
|
+
getPath(): string;
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
declare const updateImageInputSchema: z.ZodObject<{
|
|
338
|
+
tags: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString>>>;
|
|
339
|
+
}, z.core.$strip>;
|
|
340
|
+
type UpdateImageInput = z.input<typeof updateImageInputSchema>;
|
|
341
|
+
declare const updateImageResponseSchema: z.ZodObject<{
|
|
342
|
+
id: z.ZodString;
|
|
343
|
+
variant: z.ZodNullable<z.ZodString>;
|
|
344
|
+
contentUrl: z.ZodURL;
|
|
345
|
+
filePath: z.ZodString;
|
|
346
|
+
tags: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
347
|
+
createdAt: z.ZodString;
|
|
348
|
+
updatedAt: z.ZodString;
|
|
349
|
+
variants: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
350
|
+
id: z.ZodString;
|
|
351
|
+
variant: z.ZodNullable<z.ZodString>;
|
|
352
|
+
contentUrl: z.ZodURL;
|
|
353
|
+
filePath: z.ZodString;
|
|
354
|
+
tags: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
355
|
+
createdAt: z.ZodString;
|
|
356
|
+
updatedAt: z.ZodString;
|
|
357
|
+
}, z.core.$strip>>>;
|
|
358
|
+
}, z.core.$strip>;
|
|
359
|
+
type UpdateImageResponse = z.infer<typeof updateImageResponseSchema>;
|
|
360
|
+
declare class UpdateImage extends AbstractApiRequest<typeof updateImageInputSchema, typeof updateImageResponseSchema> {
|
|
361
|
+
readonly method = "PATCH";
|
|
362
|
+
readonly contentType = "application/merge-patch+json";
|
|
363
|
+
readonly accept = "application/json";
|
|
364
|
+
readonly inputSchema: z.ZodObject<{
|
|
365
|
+
tags: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString>>>;
|
|
366
|
+
}, z.core.$strip>;
|
|
367
|
+
readonly outputSchema: z.ZodObject<{
|
|
368
|
+
id: z.ZodString;
|
|
369
|
+
variant: z.ZodNullable<z.ZodString>;
|
|
370
|
+
contentUrl: z.ZodURL;
|
|
371
|
+
filePath: z.ZodString;
|
|
372
|
+
tags: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
373
|
+
createdAt: z.ZodString;
|
|
374
|
+
updatedAt: z.ZodString;
|
|
375
|
+
variants: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
376
|
+
id: z.ZodString;
|
|
377
|
+
variant: z.ZodNullable<z.ZodString>;
|
|
378
|
+
contentUrl: z.ZodURL;
|
|
379
|
+
filePath: z.ZodString;
|
|
380
|
+
tags: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
381
|
+
createdAt: z.ZodString;
|
|
382
|
+
updatedAt: z.ZodString;
|
|
383
|
+
}, z.core.$strip>>>;
|
|
384
|
+
}, z.core.$strip>;
|
|
385
|
+
readonly querySchema: undefined;
|
|
386
|
+
readonly headersSchema: undefined;
|
|
387
|
+
private readonly imageId;
|
|
388
|
+
constructor(imageId: string, input: UpdateImageInput);
|
|
389
|
+
getPath(): string;
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
declare const uploadImageInputSchema: z.ZodCustom<FormData, FormData>;
|
|
393
|
+
type UploadImageInput = z.input<typeof uploadImageInputSchema>;
|
|
394
|
+
declare const uploadImageResponseSchema: z.ZodObject<{
|
|
395
|
+
id: z.ZodString;
|
|
396
|
+
variant: z.ZodNullable<z.ZodString>;
|
|
397
|
+
contentUrl: z.ZodURL;
|
|
398
|
+
filePath: z.ZodString;
|
|
399
|
+
tags: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
400
|
+
createdAt: z.ZodString;
|
|
401
|
+
updatedAt: z.ZodString;
|
|
402
|
+
variants: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
403
|
+
id: z.ZodString;
|
|
404
|
+
variant: z.ZodNullable<z.ZodString>;
|
|
405
|
+
contentUrl: z.ZodURL;
|
|
406
|
+
filePath: z.ZodString;
|
|
407
|
+
tags: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
408
|
+
createdAt: z.ZodString;
|
|
409
|
+
updatedAt: z.ZodString;
|
|
410
|
+
}, z.core.$strip>>>;
|
|
411
|
+
}, z.core.$strip>;
|
|
412
|
+
type UploadImageResponse = z.infer<typeof uploadImageResponseSchema>;
|
|
413
|
+
/**
|
|
414
|
+
* Upload a new image to a Point of Sale
|
|
415
|
+
* Uses multipart/form-data to send the file
|
|
416
|
+
*
|
|
417
|
+
* @example
|
|
418
|
+
* const formData = new FormData();
|
|
419
|
+
* formData.append('file', file);
|
|
420
|
+
* formData.append('pointOfSale', '/point_of_sales/xxx-xxx-xxx');
|
|
421
|
+
* formData.append('tags[]', 'tag1');
|
|
422
|
+
* formData.append('tags[]', 'tag2');
|
|
423
|
+
*
|
|
424
|
+
* const response = await sdk.call(new UploadImage(formData));
|
|
425
|
+
*/
|
|
426
|
+
declare class UploadImage extends AbstractApiRequest<typeof uploadImageInputSchema, typeof uploadImageResponseSchema> {
|
|
427
|
+
readonly method = "POST";
|
|
428
|
+
readonly contentType = "multipart/form-data";
|
|
429
|
+
readonly accept = "application/json";
|
|
430
|
+
readonly inputSchema: z.ZodCustom<FormData, FormData>;
|
|
431
|
+
readonly outputSchema: z.ZodObject<{
|
|
432
|
+
id: z.ZodString;
|
|
433
|
+
variant: z.ZodNullable<z.ZodString>;
|
|
434
|
+
contentUrl: z.ZodURL;
|
|
435
|
+
filePath: z.ZodString;
|
|
436
|
+
tags: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
437
|
+
createdAt: z.ZodString;
|
|
438
|
+
updatedAt: z.ZodString;
|
|
439
|
+
variants: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
440
|
+
id: z.ZodString;
|
|
441
|
+
variant: z.ZodNullable<z.ZodString>;
|
|
442
|
+
contentUrl: z.ZodURL;
|
|
443
|
+
filePath: z.ZodString;
|
|
444
|
+
tags: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
445
|
+
createdAt: z.ZodString;
|
|
446
|
+
updatedAt: z.ZodString;
|
|
447
|
+
}, z.core.$strip>>>;
|
|
448
|
+
}, z.core.$strip>;
|
|
449
|
+
readonly querySchema: undefined;
|
|
450
|
+
readonly headersSchema: undefined;
|
|
451
|
+
constructor(input: FormData);
|
|
452
|
+
getPath(): string;
|
|
453
|
+
}
|
|
454
|
+
declare function createImageUploadFormData(pointOfSaleId: string, file: File, tags?: string[]): FormData;
|
|
455
|
+
|
|
456
|
+
declare const imageIriSchema: z.ZodType<_deliverart_sdk_js_global_types.IriObject<"/images/:id">, unknown, z.core.$ZodTypeInternals<_deliverart_sdk_js_global_types.IriObject<"/images/:id">, unknown>>;
|
|
457
|
+
type imageIri = z.infer<typeof imageIriSchema>;
|
|
458
|
+
declare const imageNullableIriSchema: z.ZodType<_deliverart_sdk_js_global_types.IriObject<"/images/:id"> | null, unknown, z.core.$ZodTypeInternals<_deliverart_sdk_js_global_types.IriObject<"/images/:id"> | null, unknown>>;
|
|
459
|
+
type imageNullableIri = z.infer<typeof imageNullableIriSchema>;
|
|
460
|
+
|
|
461
|
+
export { DeleteImage, GetImageDetails, type GetImageDetailsInput, type GetImageDetailsResponse, GetImageTagsFromPointOfSale, type GetImageTagsFromPointOfSaleInput, type GetImageTagsFromPointOfSaleResponse, GetImages, GetImagesFromPointOfSale, type GetImagesFromPointOfSaleInput, type GetImagesFromPointOfSaleQueryParams, type GetImagesFromPointOfSaleResponse, type GetImagesInput, type GetImagesQueryParams, type GetImagesResponse, type Image, type ImagesQueryParams, UpdateImage, type UpdateImageInput, type UpdateImageResponse, UploadImage, type UploadImageInput, type UploadImageResponse, createImageUploadFormData, deleteImageInputSchema, deleteImageResponseSchema, getImageDetailsInputSchema, getImageDetailsResponseSchema, getImageTagsFromPointOfSaleInputSchema, getImageTagsFromPointOfSaleResponseSchema, getImagesFromPointOfSaleInputSchema, getImagesFromPointOfSaleQuerySchema, getImagesFromPointOfSaleResponseSchema, getImagesInputSchema, getImagesQuerySchema, getImagesResponseSchema, type imageIri, imageIriSchema, type imageNullableIri, imageNullableIriSchema, imageSchema, imagesQuerySchema, updateImageInputSchema, updateImageResponseSchema, uploadImageInputSchema, uploadImageResponseSchema };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
// src/models.ts
|
|
2
|
+
import {
|
|
3
|
+
arrayContainsMatchSchema,
|
|
4
|
+
booleanSchema,
|
|
5
|
+
datetimeSchema
|
|
6
|
+
} from "@deliverart/sdk-js-global-types";
|
|
7
|
+
import { z } from "zod";
|
|
8
|
+
var baseImageSchema = z.object({
|
|
9
|
+
id: z.string(),
|
|
10
|
+
variant: z.string().nullable(),
|
|
11
|
+
contentUrl: z.url(),
|
|
12
|
+
filePath: z.string(),
|
|
13
|
+
tags: z.array(z.string()).default([]),
|
|
14
|
+
createdAt: datetimeSchema,
|
|
15
|
+
updatedAt: datetimeSchema
|
|
16
|
+
});
|
|
17
|
+
var imageSchema = baseImageSchema.extend({
|
|
18
|
+
variants: z.array(baseImageSchema).default([])
|
|
19
|
+
});
|
|
20
|
+
var imagesQuerySchema = z.object({
|
|
21
|
+
page: z.coerce.number().optional(),
|
|
22
|
+
tags: z.array(z.string()).optional(),
|
|
23
|
+
"tags.match": arrayContainsMatchSchema.optional(),
|
|
24
|
+
"exists[original]": booleanSchema.optional()
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
// src/requests/DeleteImage.ts
|
|
28
|
+
import { AbstractApiRequest } from "@deliverart/sdk-js-core";
|
|
29
|
+
import { emptyResponseSchema } from "@deliverart/sdk-js-global-types";
|
|
30
|
+
import { z as z2 } from "zod";
|
|
31
|
+
var deleteImageInputSchema = z2.undefined();
|
|
32
|
+
var deleteImageResponseSchema = emptyResponseSchema;
|
|
33
|
+
var DeleteImage = class extends AbstractApiRequest {
|
|
34
|
+
constructor(imageId) {
|
|
35
|
+
super(void 0);
|
|
36
|
+
this.method = "DELETE";
|
|
37
|
+
this.contentType = "application/json";
|
|
38
|
+
this.accept = "application/json";
|
|
39
|
+
this.inputSchema = deleteImageInputSchema;
|
|
40
|
+
this.outputSchema = deleteImageResponseSchema;
|
|
41
|
+
this.querySchema = void 0;
|
|
42
|
+
this.headersSchema = void 0;
|
|
43
|
+
this.imageId = imageId;
|
|
44
|
+
}
|
|
45
|
+
getPath() {
|
|
46
|
+
return `/images/${this.imageId}`;
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
// src/requests/GetImageDetails.ts
|
|
51
|
+
import { AbstractApiRequest as AbstractApiRequest2 } from "@deliverart/sdk-js-core";
|
|
52
|
+
import { z as z3 } from "zod";
|
|
53
|
+
var getImageDetailsInputSchema = z3.undefined();
|
|
54
|
+
var getImageDetailsResponseSchema = imageSchema;
|
|
55
|
+
var GetImageDetails = class extends AbstractApiRequest2 {
|
|
56
|
+
constructor(imageId) {
|
|
57
|
+
super(void 0);
|
|
58
|
+
this.method = "GET";
|
|
59
|
+
this.contentType = "application/json";
|
|
60
|
+
this.accept = "application/json";
|
|
61
|
+
this.inputSchema = getImageDetailsInputSchema;
|
|
62
|
+
this.outputSchema = getImageDetailsResponseSchema;
|
|
63
|
+
this.querySchema = void 0;
|
|
64
|
+
this.headersSchema = void 0;
|
|
65
|
+
this.imageId = imageId;
|
|
66
|
+
}
|
|
67
|
+
getPath() {
|
|
68
|
+
return `/images/${this.imageId}`;
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
// src/requests/GetImages.ts
|
|
73
|
+
import { AbstractApiRequest as AbstractApiRequest3 } from "@deliverart/sdk-js-core";
|
|
74
|
+
import { createPaginatedSchema } from "@deliverart/sdk-js-global-types";
|
|
75
|
+
import { z as z4 } from "zod";
|
|
76
|
+
var getImagesQuerySchema = imagesQuerySchema;
|
|
77
|
+
var getImagesInputSchema = z4.undefined();
|
|
78
|
+
var getImagesResponseSchema = createPaginatedSchema(imageSchema);
|
|
79
|
+
var GetImages = class extends AbstractApiRequest3 {
|
|
80
|
+
constructor(options) {
|
|
81
|
+
super(void 0, options);
|
|
82
|
+
this.method = "GET";
|
|
83
|
+
this.contentType = "application/json";
|
|
84
|
+
this.accept = "application/json";
|
|
85
|
+
this.inputSchema = getImagesInputSchema;
|
|
86
|
+
this.outputSchema = getImagesResponseSchema;
|
|
87
|
+
this.querySchema = getImagesQuerySchema;
|
|
88
|
+
this.headersSchema = void 0;
|
|
89
|
+
this.listItemSchema = imageSchema;
|
|
90
|
+
this.paginationDefaultEnabled = true;
|
|
91
|
+
}
|
|
92
|
+
getPath() {
|
|
93
|
+
return "/images";
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
// src/requests/GetImagesFromPointOfSale.ts
|
|
98
|
+
import { AbstractApiRequest as AbstractApiRequest4 } from "@deliverart/sdk-js-core";
|
|
99
|
+
import { createPaginatedSchema as createPaginatedSchema2 } from "@deliverart/sdk-js-global-types";
|
|
100
|
+
import { z as z5 } from "zod";
|
|
101
|
+
var getImagesFromPointOfSaleQuerySchema = imagesQuerySchema;
|
|
102
|
+
var getImagesFromPointOfSaleInputSchema = z5.undefined();
|
|
103
|
+
var getImagesFromPointOfSaleResponseSchema = createPaginatedSchema2(imageSchema);
|
|
104
|
+
var GetImagesFromPointOfSale = class extends AbstractApiRequest4 {
|
|
105
|
+
constructor(pointOfSaleId, options) {
|
|
106
|
+
super(void 0, options);
|
|
107
|
+
this.method = "GET";
|
|
108
|
+
this.contentType = "application/json";
|
|
109
|
+
this.accept = "application/json";
|
|
110
|
+
this.inputSchema = getImagesFromPointOfSaleInputSchema;
|
|
111
|
+
this.outputSchema = getImagesFromPointOfSaleResponseSchema;
|
|
112
|
+
this.querySchema = getImagesFromPointOfSaleQuerySchema;
|
|
113
|
+
this.headersSchema = void 0;
|
|
114
|
+
this.listItemSchema = imageSchema;
|
|
115
|
+
this.paginationDefaultEnabled = true;
|
|
116
|
+
this.pointOfSaleId = pointOfSaleId;
|
|
117
|
+
}
|
|
118
|
+
getPath() {
|
|
119
|
+
return `/point_of_sales/${this.pointOfSaleId}/images`;
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
// src/requests/GetImageTagsFromPointOfSale.ts
|
|
124
|
+
import { AbstractApiRequest as AbstractApiRequest5 } from "@deliverart/sdk-js-core";
|
|
125
|
+
import { z as z6 } from "zod";
|
|
126
|
+
var getImageTagsFromPointOfSaleInputSchema = z6.undefined();
|
|
127
|
+
var getImageTagsFromPointOfSaleResponseSchema = z6.array(z6.string());
|
|
128
|
+
var GetImageTagsFromPointOfSale = class extends AbstractApiRequest5 {
|
|
129
|
+
constructor(pointOfSaleId) {
|
|
130
|
+
super(void 0);
|
|
131
|
+
this.method = "GET";
|
|
132
|
+
this.contentType = "application/json";
|
|
133
|
+
this.accept = "application/json";
|
|
134
|
+
this.inputSchema = getImageTagsFromPointOfSaleInputSchema;
|
|
135
|
+
this.outputSchema = getImageTagsFromPointOfSaleResponseSchema;
|
|
136
|
+
this.querySchema = void 0;
|
|
137
|
+
this.headersSchema = void 0;
|
|
138
|
+
this.pointOfSaleId = pointOfSaleId;
|
|
139
|
+
}
|
|
140
|
+
getPath() {
|
|
141
|
+
return `/point_of_sales/${this.pointOfSaleId}/images/tags`;
|
|
142
|
+
}
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
// src/requests/UpdateImage.ts
|
|
146
|
+
import { AbstractApiRequest as AbstractApiRequest6 } from "@deliverart/sdk-js-core";
|
|
147
|
+
var updateImageInputSchema = imageSchema.pick({
|
|
148
|
+
tags: true
|
|
149
|
+
}).partial();
|
|
150
|
+
var updateImageResponseSchema = imageSchema;
|
|
151
|
+
var UpdateImage = class extends AbstractApiRequest6 {
|
|
152
|
+
constructor(imageId, input) {
|
|
153
|
+
super(input);
|
|
154
|
+
this.method = "PATCH";
|
|
155
|
+
this.contentType = "application/merge-patch+json";
|
|
156
|
+
this.accept = "application/json";
|
|
157
|
+
this.inputSchema = updateImageInputSchema;
|
|
158
|
+
this.outputSchema = updateImageResponseSchema;
|
|
159
|
+
this.querySchema = void 0;
|
|
160
|
+
this.headersSchema = void 0;
|
|
161
|
+
this.imageId = imageId;
|
|
162
|
+
}
|
|
163
|
+
getPath() {
|
|
164
|
+
return `/images/${this.imageId}`;
|
|
165
|
+
}
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
// src/requests/UploadImage.ts
|
|
169
|
+
import { AbstractApiRequest as AbstractApiRequest7 } from "@deliverart/sdk-js-core";
|
|
170
|
+
import { z as z7 } from "zod";
|
|
171
|
+
var uploadImageInputSchema = z7.instanceof(FormData);
|
|
172
|
+
var uploadImageResponseSchema = imageSchema;
|
|
173
|
+
var UploadImage = class extends AbstractApiRequest7 {
|
|
174
|
+
constructor(input) {
|
|
175
|
+
super(input);
|
|
176
|
+
this.method = "POST";
|
|
177
|
+
this.contentType = "multipart/form-data";
|
|
178
|
+
this.accept = "application/json";
|
|
179
|
+
this.inputSchema = uploadImageInputSchema;
|
|
180
|
+
this.outputSchema = uploadImageResponseSchema;
|
|
181
|
+
this.querySchema = void 0;
|
|
182
|
+
this.headersSchema = void 0;
|
|
183
|
+
}
|
|
184
|
+
getPath() {
|
|
185
|
+
return `/images`;
|
|
186
|
+
}
|
|
187
|
+
};
|
|
188
|
+
function createImageUploadFormData(pointOfSaleId, file, tags) {
|
|
189
|
+
const formData = new FormData();
|
|
190
|
+
formData.append("file", file);
|
|
191
|
+
formData.append("pointOfSale", `/point_of_sales/${pointOfSaleId}`);
|
|
192
|
+
if (tags && tags.length > 0) {
|
|
193
|
+
formData.append("tags", tags.join(","));
|
|
194
|
+
}
|
|
195
|
+
return formData;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
// src/types.ts
|
|
199
|
+
import { iriNullableSchema, iriSchema } from "@deliverart/sdk-js-global-types";
|
|
200
|
+
var imageIriSchema = iriSchema("/images/:id");
|
|
201
|
+
var imageNullableIriSchema = iriNullableSchema("/images/:id");
|
|
202
|
+
export {
|
|
203
|
+
DeleteImage,
|
|
204
|
+
GetImageDetails,
|
|
205
|
+
GetImageTagsFromPointOfSale,
|
|
206
|
+
GetImages,
|
|
207
|
+
GetImagesFromPointOfSale,
|
|
208
|
+
UpdateImage,
|
|
209
|
+
UploadImage,
|
|
210
|
+
createImageUploadFormData,
|
|
211
|
+
deleteImageInputSchema,
|
|
212
|
+
deleteImageResponseSchema,
|
|
213
|
+
getImageDetailsInputSchema,
|
|
214
|
+
getImageDetailsResponseSchema,
|
|
215
|
+
getImageTagsFromPointOfSaleInputSchema,
|
|
216
|
+
getImageTagsFromPointOfSaleResponseSchema,
|
|
217
|
+
getImagesFromPointOfSaleInputSchema,
|
|
218
|
+
getImagesFromPointOfSaleQuerySchema,
|
|
219
|
+
getImagesFromPointOfSaleResponseSchema,
|
|
220
|
+
getImagesInputSchema,
|
|
221
|
+
getImagesQuerySchema,
|
|
222
|
+
getImagesResponseSchema,
|
|
223
|
+
imageIriSchema,
|
|
224
|
+
imageNullableIriSchema,
|
|
225
|
+
imageSchema,
|
|
226
|
+
imagesQuerySchema,
|
|
227
|
+
updateImageInputSchema,
|
|
228
|
+
updateImageResponseSchema,
|
|
229
|
+
uploadImageInputSchema,
|
|
230
|
+
uploadImageResponseSchema
|
|
231
|
+
};
|