@deliverart/sdk-js-image 2.4.19 → 2.4.20
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/dist/index.cjs +68 -4
- package/dist/index.d.cts +82 -1
- package/dist/index.d.ts +82 -1
- package/dist/index.js +60 -3
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
|
@@ -22,13 +22,18 @@ var index_exports = {};
|
|
|
22
22
|
__export(index_exports, {
|
|
23
23
|
DeleteImage: () => DeleteImage,
|
|
24
24
|
GetImageDetails: () => GetImageDetails,
|
|
25
|
+
GetImageTagsFromPointOfSale: () => GetImageTagsFromPointOfSale,
|
|
25
26
|
GetImages: () => GetImages,
|
|
26
27
|
GetImagesFromPointOfSale: () => GetImagesFromPointOfSale,
|
|
27
28
|
UpdateImage: () => UpdateImage,
|
|
29
|
+
UploadImage: () => UploadImage,
|
|
30
|
+
createImageUploadFormData: () => createImageUploadFormData,
|
|
28
31
|
deleteImageInputSchema: () => deleteImageInputSchema,
|
|
29
32
|
deleteImageResponseSchema: () => deleteImageResponseSchema,
|
|
30
33
|
getImageDetailsInputSchema: () => getImageDetailsInputSchema,
|
|
31
34
|
getImageDetailsResponseSchema: () => getImageDetailsResponseSchema,
|
|
35
|
+
getImageTagsFromPointOfSaleInputSchema: () => getImageTagsFromPointOfSaleInputSchema,
|
|
36
|
+
getImageTagsFromPointOfSaleResponseSchema: () => getImageTagsFromPointOfSaleResponseSchema,
|
|
32
37
|
getImagesFromPointOfSaleInputSchema: () => getImagesFromPointOfSaleInputSchema,
|
|
33
38
|
getImagesFromPointOfSaleQuerySchema: () => getImagesFromPointOfSaleQuerySchema,
|
|
34
39
|
getImagesFromPointOfSaleResponseSchema: () => getImagesFromPointOfSaleResponseSchema,
|
|
@@ -40,7 +45,9 @@ __export(index_exports, {
|
|
|
40
45
|
imageSchema: () => imageSchema,
|
|
41
46
|
imagesQuerySchema: () => imagesQuerySchema,
|
|
42
47
|
updateImageInputSchema: () => updateImageInputSchema,
|
|
43
|
-
updateImageResponseSchema: () => updateImageResponseSchema
|
|
48
|
+
updateImageResponseSchema: () => updateImageResponseSchema,
|
|
49
|
+
uploadImageInputSchema: () => uploadImageInputSchema,
|
|
50
|
+
uploadImageResponseSchema: () => uploadImageResponseSchema
|
|
44
51
|
});
|
|
45
52
|
module.exports = __toCommonJS(index_exports);
|
|
46
53
|
|
|
@@ -11312,13 +11319,34 @@ var GetImagesFromPointOfSale = class extends import_sdk_js_core4.AbstractApiRequ
|
|
|
11312
11319
|
}
|
|
11313
11320
|
};
|
|
11314
11321
|
|
|
11315
|
-
// src/requests/
|
|
11322
|
+
// src/requests/GetImageTagsFromPointOfSale.ts
|
|
11316
11323
|
var import_sdk_js_core5 = require("@deliverart/sdk-js-core");
|
|
11324
|
+
var getImageTagsFromPointOfSaleInputSchema = external_exports.undefined();
|
|
11325
|
+
var getImageTagsFromPointOfSaleResponseSchema = external_exports.array(external_exports.string());
|
|
11326
|
+
var GetImageTagsFromPointOfSale = class extends import_sdk_js_core5.AbstractApiRequest {
|
|
11327
|
+
constructor(pointOfSaleId) {
|
|
11328
|
+
super(void 0);
|
|
11329
|
+
this.method = "GET";
|
|
11330
|
+
this.contentType = "application/json";
|
|
11331
|
+
this.accept = "application/json";
|
|
11332
|
+
this.inputSchema = getImageTagsFromPointOfSaleInputSchema;
|
|
11333
|
+
this.outputSchema = getImageTagsFromPointOfSaleResponseSchema;
|
|
11334
|
+
this.querySchema = void 0;
|
|
11335
|
+
this.headersSchema = void 0;
|
|
11336
|
+
this.pointOfSaleId = pointOfSaleId;
|
|
11337
|
+
}
|
|
11338
|
+
getPath() {
|
|
11339
|
+
return `/point_of_sales/${this.pointOfSaleId}/images/tags`;
|
|
11340
|
+
}
|
|
11341
|
+
};
|
|
11342
|
+
|
|
11343
|
+
// src/requests/UpdateImage.ts
|
|
11344
|
+
var import_sdk_js_core6 = require("@deliverart/sdk-js-core");
|
|
11317
11345
|
var updateImageInputSchema = imageSchema.pick({
|
|
11318
11346
|
tags: true
|
|
11319
11347
|
}).partial();
|
|
11320
11348
|
var updateImageResponseSchema = imageSchema;
|
|
11321
|
-
var UpdateImage = class extends
|
|
11349
|
+
var UpdateImage = class extends import_sdk_js_core6.AbstractApiRequest {
|
|
11322
11350
|
constructor(imageId, input) {
|
|
11323
11351
|
super(input);
|
|
11324
11352
|
this.method = "PATCH";
|
|
@@ -11335,6 +11363,35 @@ var UpdateImage = class extends import_sdk_js_core5.AbstractApiRequest {
|
|
|
11335
11363
|
}
|
|
11336
11364
|
};
|
|
11337
11365
|
|
|
11366
|
+
// src/requests/UploadImage.ts
|
|
11367
|
+
var import_sdk_js_core7 = require("@deliverart/sdk-js-core");
|
|
11368
|
+
var uploadImageInputSchema = external_exports.instanceof(FormData);
|
|
11369
|
+
var uploadImageResponseSchema = imageSchema;
|
|
11370
|
+
var UploadImage = class extends import_sdk_js_core7.AbstractApiRequest {
|
|
11371
|
+
constructor(input) {
|
|
11372
|
+
super(input);
|
|
11373
|
+
this.method = "POST";
|
|
11374
|
+
this.contentType = "multipart/form-data";
|
|
11375
|
+
this.accept = "application/json";
|
|
11376
|
+
this.inputSchema = uploadImageInputSchema;
|
|
11377
|
+
this.outputSchema = uploadImageResponseSchema;
|
|
11378
|
+
this.querySchema = void 0;
|
|
11379
|
+
this.headersSchema = void 0;
|
|
11380
|
+
}
|
|
11381
|
+
getPath() {
|
|
11382
|
+
return `/images`;
|
|
11383
|
+
}
|
|
11384
|
+
};
|
|
11385
|
+
function createImageUploadFormData(pointOfSaleId, file2, tags) {
|
|
11386
|
+
const formData = new FormData();
|
|
11387
|
+
formData.append("file", file2);
|
|
11388
|
+
formData.append("pointOfSale", `/point_of_sales/${pointOfSaleId}`);
|
|
11389
|
+
if (tags && tags.length > 0) {
|
|
11390
|
+
formData.append("tags", tags.join(","));
|
|
11391
|
+
}
|
|
11392
|
+
return formData;
|
|
11393
|
+
}
|
|
11394
|
+
|
|
11338
11395
|
// src/types.ts
|
|
11339
11396
|
var import_sdk_js_global_types5 = require("@deliverart/sdk-js-global-types");
|
|
11340
11397
|
var imageIriSchema = (0, import_sdk_js_global_types5.iriSchema)("/images/:id");
|
|
@@ -11343,13 +11400,18 @@ var imageNullableIriSchema = (0, import_sdk_js_global_types5.iriNullableSchema)(
|
|
|
11343
11400
|
0 && (module.exports = {
|
|
11344
11401
|
DeleteImage,
|
|
11345
11402
|
GetImageDetails,
|
|
11403
|
+
GetImageTagsFromPointOfSale,
|
|
11346
11404
|
GetImages,
|
|
11347
11405
|
GetImagesFromPointOfSale,
|
|
11348
11406
|
UpdateImage,
|
|
11407
|
+
UploadImage,
|
|
11408
|
+
createImageUploadFormData,
|
|
11349
11409
|
deleteImageInputSchema,
|
|
11350
11410
|
deleteImageResponseSchema,
|
|
11351
11411
|
getImageDetailsInputSchema,
|
|
11352
11412
|
getImageDetailsResponseSchema,
|
|
11413
|
+
getImageTagsFromPointOfSaleInputSchema,
|
|
11414
|
+
getImageTagsFromPointOfSaleResponseSchema,
|
|
11353
11415
|
getImagesFromPointOfSaleInputSchema,
|
|
11354
11416
|
getImagesFromPointOfSaleQuerySchema,
|
|
11355
11417
|
getImagesFromPointOfSaleResponseSchema,
|
|
@@ -11361,5 +11423,7 @@ var imageNullableIriSchema = (0, import_sdk_js_global_types5.iriNullableSchema)(
|
|
|
11361
11423
|
imageSchema,
|
|
11362
11424
|
imagesQuerySchema,
|
|
11363
11425
|
updateImageInputSchema,
|
|
11364
|
-
updateImageResponseSchema
|
|
11426
|
+
updateImageResponseSchema,
|
|
11427
|
+
uploadImageInputSchema,
|
|
11428
|
+
uploadImageResponseSchema
|
|
11365
11429
|
});
|
package/dist/index.d.cts
CHANGED
|
@@ -282,6 +282,23 @@ declare class GetImagesFromPointOfSale extends AbstractApiRequest<typeof getImag
|
|
|
282
282
|
parseResponse(data: unknown, rawResponse: Response): Paginated<Image>;
|
|
283
283
|
}
|
|
284
284
|
|
|
285
|
+
declare const getImageTagsFromPointOfSaleInputSchema: z.ZodUndefined;
|
|
286
|
+
type GetImageTagsFromPointOfSaleInput = z.infer<typeof getImageTagsFromPointOfSaleInputSchema>;
|
|
287
|
+
declare const getImageTagsFromPointOfSaleResponseSchema: z.ZodArray<z.ZodString>;
|
|
288
|
+
type GetImageTagsFromPointOfSaleResponse = z.infer<typeof getImageTagsFromPointOfSaleResponseSchema>;
|
|
289
|
+
declare class GetImageTagsFromPointOfSale extends AbstractApiRequest<typeof getImageTagsFromPointOfSaleInputSchema, typeof getImageTagsFromPointOfSaleResponseSchema> {
|
|
290
|
+
readonly method = "GET";
|
|
291
|
+
readonly contentType = "application/json";
|
|
292
|
+
readonly accept = "application/json";
|
|
293
|
+
readonly inputSchema: z.ZodUndefined;
|
|
294
|
+
readonly outputSchema: z.ZodArray<z.ZodString>;
|
|
295
|
+
readonly querySchema: undefined;
|
|
296
|
+
readonly headersSchema: undefined;
|
|
297
|
+
private readonly pointOfSaleId;
|
|
298
|
+
constructor(pointOfSaleId: string);
|
|
299
|
+
getPath(): string;
|
|
300
|
+
}
|
|
301
|
+
|
|
285
302
|
declare const updateImageInputSchema: z.ZodObject<{
|
|
286
303
|
tags: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString>>>;
|
|
287
304
|
}, z.core.$strip>;
|
|
@@ -337,9 +354,73 @@ declare class UpdateImage extends AbstractApiRequest<typeof updateImageInputSche
|
|
|
337
354
|
getPath(): string;
|
|
338
355
|
}
|
|
339
356
|
|
|
357
|
+
declare const uploadImageInputSchema: z.ZodCustom<FormData, FormData>;
|
|
358
|
+
type UploadImageInput = z.input<typeof uploadImageInputSchema>;
|
|
359
|
+
declare const uploadImageResponseSchema: z.ZodObject<{
|
|
360
|
+
id: z.ZodString;
|
|
361
|
+
variant: z.ZodNullable<z.ZodString>;
|
|
362
|
+
contentUrl: z.ZodURL;
|
|
363
|
+
filePath: z.ZodString;
|
|
364
|
+
tags: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
365
|
+
createdAt: z.ZodString;
|
|
366
|
+
updatedAt: z.ZodString;
|
|
367
|
+
variants: z.ZodDefault<z.ZodArray<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
|
+
}, z.core.$strip>>>;
|
|
376
|
+
}, z.core.$strip>;
|
|
377
|
+
type UploadImageResponse = z.infer<typeof uploadImageResponseSchema>;
|
|
378
|
+
/**
|
|
379
|
+
* Upload a new image to a Point of Sale
|
|
380
|
+
* Uses multipart/form-data to send the file
|
|
381
|
+
*
|
|
382
|
+
* @example
|
|
383
|
+
* const formData = new FormData();
|
|
384
|
+
* formData.append('file', file);
|
|
385
|
+
* formData.append('pointOfSale', '/point_of_sales/xxx-xxx-xxx');
|
|
386
|
+
* formData.append('tags[]', 'tag1');
|
|
387
|
+
* formData.append('tags[]', 'tag2');
|
|
388
|
+
*
|
|
389
|
+
* const response = await sdk.call(new UploadImage(formData));
|
|
390
|
+
*/
|
|
391
|
+
declare class UploadImage extends AbstractApiRequest<typeof uploadImageInputSchema, typeof uploadImageResponseSchema> {
|
|
392
|
+
readonly method = "POST";
|
|
393
|
+
readonly contentType = "multipart/form-data";
|
|
394
|
+
readonly accept = "application/json";
|
|
395
|
+
readonly inputSchema: z.ZodCustom<FormData, FormData>;
|
|
396
|
+
readonly outputSchema: z.ZodObject<{
|
|
397
|
+
id: z.ZodString;
|
|
398
|
+
variant: z.ZodNullable<z.ZodString>;
|
|
399
|
+
contentUrl: z.ZodURL;
|
|
400
|
+
filePath: z.ZodString;
|
|
401
|
+
tags: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
402
|
+
createdAt: z.ZodString;
|
|
403
|
+
updatedAt: z.ZodString;
|
|
404
|
+
variants: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
405
|
+
id: z.ZodString;
|
|
406
|
+
variant: z.ZodNullable<z.ZodString>;
|
|
407
|
+
contentUrl: z.ZodURL;
|
|
408
|
+
filePath: z.ZodString;
|
|
409
|
+
tags: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
410
|
+
createdAt: z.ZodString;
|
|
411
|
+
updatedAt: z.ZodString;
|
|
412
|
+
}, z.core.$strip>>>;
|
|
413
|
+
}, z.core.$strip>;
|
|
414
|
+
readonly querySchema: undefined;
|
|
415
|
+
readonly headersSchema: undefined;
|
|
416
|
+
constructor(input: FormData);
|
|
417
|
+
getPath(): string;
|
|
418
|
+
}
|
|
419
|
+
declare function createImageUploadFormData(pointOfSaleId: string, file: File, tags?: string[]): FormData;
|
|
420
|
+
|
|
340
421
|
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>>;
|
|
341
422
|
type imageIri = z.infer<typeof imageIriSchema>;
|
|
342
423
|
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>>;
|
|
343
424
|
type imageNullableIri = z.infer<typeof imageNullableIriSchema>;
|
|
344
425
|
|
|
345
|
-
export { DeleteImage, GetImageDetails, type GetImageDetailsInput, type GetImageDetailsResponse, GetImages, GetImagesFromPointOfSale, type GetImagesFromPointOfSaleInput, type GetImagesFromPointOfSaleQueryParams, type GetImagesFromPointOfSaleResponse, type GetImagesInput, type GetImagesQueryParams, type GetImagesResponse, type Image, type ImagesQueryParams, UpdateImage, type UpdateImageInput, type UpdateImageResponse, deleteImageInputSchema, deleteImageResponseSchema, getImageDetailsInputSchema, getImageDetailsResponseSchema, getImagesFromPointOfSaleInputSchema, getImagesFromPointOfSaleQuerySchema, getImagesFromPointOfSaleResponseSchema, getImagesInputSchema, getImagesQuerySchema, getImagesResponseSchema, type imageIri, imageIriSchema, type imageNullableIri, imageNullableIriSchema, imageSchema, imagesQuerySchema, updateImageInputSchema, updateImageResponseSchema };
|
|
426
|
+
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.d.ts
CHANGED
|
@@ -282,6 +282,23 @@ declare class GetImagesFromPointOfSale extends AbstractApiRequest<typeof getImag
|
|
|
282
282
|
parseResponse(data: unknown, rawResponse: Response): Paginated<Image>;
|
|
283
283
|
}
|
|
284
284
|
|
|
285
|
+
declare const getImageTagsFromPointOfSaleInputSchema: z.ZodUndefined;
|
|
286
|
+
type GetImageTagsFromPointOfSaleInput = z.infer<typeof getImageTagsFromPointOfSaleInputSchema>;
|
|
287
|
+
declare const getImageTagsFromPointOfSaleResponseSchema: z.ZodArray<z.ZodString>;
|
|
288
|
+
type GetImageTagsFromPointOfSaleResponse = z.infer<typeof getImageTagsFromPointOfSaleResponseSchema>;
|
|
289
|
+
declare class GetImageTagsFromPointOfSale extends AbstractApiRequest<typeof getImageTagsFromPointOfSaleInputSchema, typeof getImageTagsFromPointOfSaleResponseSchema> {
|
|
290
|
+
readonly method = "GET";
|
|
291
|
+
readonly contentType = "application/json";
|
|
292
|
+
readonly accept = "application/json";
|
|
293
|
+
readonly inputSchema: z.ZodUndefined;
|
|
294
|
+
readonly outputSchema: z.ZodArray<z.ZodString>;
|
|
295
|
+
readonly querySchema: undefined;
|
|
296
|
+
readonly headersSchema: undefined;
|
|
297
|
+
private readonly pointOfSaleId;
|
|
298
|
+
constructor(pointOfSaleId: string);
|
|
299
|
+
getPath(): string;
|
|
300
|
+
}
|
|
301
|
+
|
|
285
302
|
declare const updateImageInputSchema: z.ZodObject<{
|
|
286
303
|
tags: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString>>>;
|
|
287
304
|
}, z.core.$strip>;
|
|
@@ -337,9 +354,73 @@ declare class UpdateImage extends AbstractApiRequest<typeof updateImageInputSche
|
|
|
337
354
|
getPath(): string;
|
|
338
355
|
}
|
|
339
356
|
|
|
357
|
+
declare const uploadImageInputSchema: z.ZodCustom<FormData, FormData>;
|
|
358
|
+
type UploadImageInput = z.input<typeof uploadImageInputSchema>;
|
|
359
|
+
declare const uploadImageResponseSchema: z.ZodObject<{
|
|
360
|
+
id: z.ZodString;
|
|
361
|
+
variant: z.ZodNullable<z.ZodString>;
|
|
362
|
+
contentUrl: z.ZodURL;
|
|
363
|
+
filePath: z.ZodString;
|
|
364
|
+
tags: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
365
|
+
createdAt: z.ZodString;
|
|
366
|
+
updatedAt: z.ZodString;
|
|
367
|
+
variants: z.ZodDefault<z.ZodArray<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
|
+
}, z.core.$strip>>>;
|
|
376
|
+
}, z.core.$strip>;
|
|
377
|
+
type UploadImageResponse = z.infer<typeof uploadImageResponseSchema>;
|
|
378
|
+
/**
|
|
379
|
+
* Upload a new image to a Point of Sale
|
|
380
|
+
* Uses multipart/form-data to send the file
|
|
381
|
+
*
|
|
382
|
+
* @example
|
|
383
|
+
* const formData = new FormData();
|
|
384
|
+
* formData.append('file', file);
|
|
385
|
+
* formData.append('pointOfSale', '/point_of_sales/xxx-xxx-xxx');
|
|
386
|
+
* formData.append('tags[]', 'tag1');
|
|
387
|
+
* formData.append('tags[]', 'tag2');
|
|
388
|
+
*
|
|
389
|
+
* const response = await sdk.call(new UploadImage(formData));
|
|
390
|
+
*/
|
|
391
|
+
declare class UploadImage extends AbstractApiRequest<typeof uploadImageInputSchema, typeof uploadImageResponseSchema> {
|
|
392
|
+
readonly method = "POST";
|
|
393
|
+
readonly contentType = "multipart/form-data";
|
|
394
|
+
readonly accept = "application/json";
|
|
395
|
+
readonly inputSchema: z.ZodCustom<FormData, FormData>;
|
|
396
|
+
readonly outputSchema: z.ZodObject<{
|
|
397
|
+
id: z.ZodString;
|
|
398
|
+
variant: z.ZodNullable<z.ZodString>;
|
|
399
|
+
contentUrl: z.ZodURL;
|
|
400
|
+
filePath: z.ZodString;
|
|
401
|
+
tags: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
402
|
+
createdAt: z.ZodString;
|
|
403
|
+
updatedAt: z.ZodString;
|
|
404
|
+
variants: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
405
|
+
id: z.ZodString;
|
|
406
|
+
variant: z.ZodNullable<z.ZodString>;
|
|
407
|
+
contentUrl: z.ZodURL;
|
|
408
|
+
filePath: z.ZodString;
|
|
409
|
+
tags: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
410
|
+
createdAt: z.ZodString;
|
|
411
|
+
updatedAt: z.ZodString;
|
|
412
|
+
}, z.core.$strip>>>;
|
|
413
|
+
}, z.core.$strip>;
|
|
414
|
+
readonly querySchema: undefined;
|
|
415
|
+
readonly headersSchema: undefined;
|
|
416
|
+
constructor(input: FormData);
|
|
417
|
+
getPath(): string;
|
|
418
|
+
}
|
|
419
|
+
declare function createImageUploadFormData(pointOfSaleId: string, file: File, tags?: string[]): FormData;
|
|
420
|
+
|
|
340
421
|
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>>;
|
|
341
422
|
type imageIri = z.infer<typeof imageIriSchema>;
|
|
342
423
|
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>>;
|
|
343
424
|
type imageNullableIri = z.infer<typeof imageNullableIriSchema>;
|
|
344
425
|
|
|
345
|
-
export { DeleteImage, GetImageDetails, type GetImageDetailsInput, type GetImageDetailsResponse, GetImages, GetImagesFromPointOfSale, type GetImagesFromPointOfSaleInput, type GetImagesFromPointOfSaleQueryParams, type GetImagesFromPointOfSaleResponse, type GetImagesInput, type GetImagesQueryParams, type GetImagesResponse, type Image, type ImagesQueryParams, UpdateImage, type UpdateImageInput, type UpdateImageResponse, deleteImageInputSchema, deleteImageResponseSchema, getImageDetailsInputSchema, getImageDetailsResponseSchema, getImagesFromPointOfSaleInputSchema, getImagesFromPointOfSaleQuerySchema, getImagesFromPointOfSaleResponseSchema, getImagesInputSchema, getImagesQuerySchema, getImagesResponseSchema, type imageIri, imageIriSchema, type imageNullableIri, imageNullableIriSchema, imageSchema, imagesQuerySchema, updateImageInputSchema, updateImageResponseSchema };
|
|
426
|
+
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
CHANGED
|
@@ -11278,13 +11278,34 @@ var GetImagesFromPointOfSale = class extends AbstractApiRequest4 {
|
|
|
11278
11278
|
}
|
|
11279
11279
|
};
|
|
11280
11280
|
|
|
11281
|
-
// src/requests/
|
|
11281
|
+
// src/requests/GetImageTagsFromPointOfSale.ts
|
|
11282
11282
|
import { AbstractApiRequest as AbstractApiRequest5 } from "@deliverart/sdk-js-core";
|
|
11283
|
+
var getImageTagsFromPointOfSaleInputSchema = external_exports.undefined();
|
|
11284
|
+
var getImageTagsFromPointOfSaleResponseSchema = external_exports.array(external_exports.string());
|
|
11285
|
+
var GetImageTagsFromPointOfSale = class extends AbstractApiRequest5 {
|
|
11286
|
+
constructor(pointOfSaleId) {
|
|
11287
|
+
super(void 0);
|
|
11288
|
+
this.method = "GET";
|
|
11289
|
+
this.contentType = "application/json";
|
|
11290
|
+
this.accept = "application/json";
|
|
11291
|
+
this.inputSchema = getImageTagsFromPointOfSaleInputSchema;
|
|
11292
|
+
this.outputSchema = getImageTagsFromPointOfSaleResponseSchema;
|
|
11293
|
+
this.querySchema = void 0;
|
|
11294
|
+
this.headersSchema = void 0;
|
|
11295
|
+
this.pointOfSaleId = pointOfSaleId;
|
|
11296
|
+
}
|
|
11297
|
+
getPath() {
|
|
11298
|
+
return `/point_of_sales/${this.pointOfSaleId}/images/tags`;
|
|
11299
|
+
}
|
|
11300
|
+
};
|
|
11301
|
+
|
|
11302
|
+
// src/requests/UpdateImage.ts
|
|
11303
|
+
import { AbstractApiRequest as AbstractApiRequest6 } from "@deliverart/sdk-js-core";
|
|
11283
11304
|
var updateImageInputSchema = imageSchema.pick({
|
|
11284
11305
|
tags: true
|
|
11285
11306
|
}).partial();
|
|
11286
11307
|
var updateImageResponseSchema = imageSchema;
|
|
11287
|
-
var UpdateImage = class extends
|
|
11308
|
+
var UpdateImage = class extends AbstractApiRequest6 {
|
|
11288
11309
|
constructor(imageId, input) {
|
|
11289
11310
|
super(input);
|
|
11290
11311
|
this.method = "PATCH";
|
|
@@ -11301,6 +11322,35 @@ var UpdateImage = class extends AbstractApiRequest5 {
|
|
|
11301
11322
|
}
|
|
11302
11323
|
};
|
|
11303
11324
|
|
|
11325
|
+
// src/requests/UploadImage.ts
|
|
11326
|
+
import { AbstractApiRequest as AbstractApiRequest7 } from "@deliverart/sdk-js-core";
|
|
11327
|
+
var uploadImageInputSchema = external_exports.instanceof(FormData);
|
|
11328
|
+
var uploadImageResponseSchema = imageSchema;
|
|
11329
|
+
var UploadImage = class extends AbstractApiRequest7 {
|
|
11330
|
+
constructor(input) {
|
|
11331
|
+
super(input);
|
|
11332
|
+
this.method = "POST";
|
|
11333
|
+
this.contentType = "multipart/form-data";
|
|
11334
|
+
this.accept = "application/json";
|
|
11335
|
+
this.inputSchema = uploadImageInputSchema;
|
|
11336
|
+
this.outputSchema = uploadImageResponseSchema;
|
|
11337
|
+
this.querySchema = void 0;
|
|
11338
|
+
this.headersSchema = void 0;
|
|
11339
|
+
}
|
|
11340
|
+
getPath() {
|
|
11341
|
+
return `/images`;
|
|
11342
|
+
}
|
|
11343
|
+
};
|
|
11344
|
+
function createImageUploadFormData(pointOfSaleId, file2, tags) {
|
|
11345
|
+
const formData = new FormData();
|
|
11346
|
+
formData.append("file", file2);
|
|
11347
|
+
formData.append("pointOfSale", `/point_of_sales/${pointOfSaleId}`);
|
|
11348
|
+
if (tags && tags.length > 0) {
|
|
11349
|
+
formData.append("tags", tags.join(","));
|
|
11350
|
+
}
|
|
11351
|
+
return formData;
|
|
11352
|
+
}
|
|
11353
|
+
|
|
11304
11354
|
// src/types.ts
|
|
11305
11355
|
import { iriNullableSchema, iriSchema } from "@deliverart/sdk-js-global-types";
|
|
11306
11356
|
var imageIriSchema = iriSchema("/images/:id");
|
|
@@ -11308,13 +11358,18 @@ var imageNullableIriSchema = iriNullableSchema("/images/:id");
|
|
|
11308
11358
|
export {
|
|
11309
11359
|
DeleteImage,
|
|
11310
11360
|
GetImageDetails,
|
|
11361
|
+
GetImageTagsFromPointOfSale,
|
|
11311
11362
|
GetImages,
|
|
11312
11363
|
GetImagesFromPointOfSale,
|
|
11313
11364
|
UpdateImage,
|
|
11365
|
+
UploadImage,
|
|
11366
|
+
createImageUploadFormData,
|
|
11314
11367
|
deleteImageInputSchema,
|
|
11315
11368
|
deleteImageResponseSchema,
|
|
11316
11369
|
getImageDetailsInputSchema,
|
|
11317
11370
|
getImageDetailsResponseSchema,
|
|
11371
|
+
getImageTagsFromPointOfSaleInputSchema,
|
|
11372
|
+
getImageTagsFromPointOfSaleResponseSchema,
|
|
11318
11373
|
getImagesFromPointOfSaleInputSchema,
|
|
11319
11374
|
getImagesFromPointOfSaleQuerySchema,
|
|
11320
11375
|
getImagesFromPointOfSaleResponseSchema,
|
|
@@ -11326,5 +11381,7 @@ export {
|
|
|
11326
11381
|
imageSchema,
|
|
11327
11382
|
imagesQuerySchema,
|
|
11328
11383
|
updateImageInputSchema,
|
|
11329
|
-
updateImageResponseSchema
|
|
11384
|
+
updateImageResponseSchema,
|
|
11385
|
+
uploadImageInputSchema,
|
|
11386
|
+
uploadImageResponseSchema
|
|
11330
11387
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deliverart/sdk-js-image",
|
|
3
3
|
"description": "Deliverart JavaScript SDK for Image Management",
|
|
4
|
-
"version": "2.4.
|
|
4
|
+
"version": "2.4.20",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
@@ -18,9 +18,9 @@
|
|
|
18
18
|
"dist"
|
|
19
19
|
],
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@deliverart/sdk-js-core": "2.4.
|
|
22
|
-
"@deliverart/sdk-js-
|
|
23
|
-
"@deliverart/sdk-js-
|
|
21
|
+
"@deliverart/sdk-js-core": "2.4.20",
|
|
22
|
+
"@deliverart/sdk-js-global-types": "2.4.20",
|
|
23
|
+
"@deliverart/sdk-js-point-of-sale": "2.4.20"
|
|
24
24
|
},
|
|
25
25
|
"publishConfig": {
|
|
26
26
|
"access": "public"
|