@aurigma/axios-backoffice-api-client 2.57.1 → 2.59.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/dist/cjs/backoffice-api-client.d.ts +31 -8
- package/dist/cjs/backoffice-api-client.js +112 -1
- package/dist/cjs/backoffice-api-client.js.map +1 -1
- package/dist/esm/backoffice-api-client.d.ts +31 -8
- package/dist/esm/backoffice-api-client.js +112 -1
- package/dist/esm/backoffice-api-client.js.map +1 -1
- package/package.json +1 -1
|
@@ -159,7 +159,7 @@ export declare module BackOfficeApiClient {
|
|
|
159
159
|
/**
|
|
160
160
|
* Creates a new product and returns its description.
|
|
161
161
|
* @param tenantId (optional) Tenant identifier.
|
|
162
|
-
* @param body (optional)
|
|
162
|
+
* @param body (optional) Product creation parameters.
|
|
163
163
|
* @return Success
|
|
164
164
|
*/
|
|
165
165
|
createProduct(tenantId?: number | null | undefined, body?: CreateProductDto | null | undefined): Promise<ProductDto>;
|
|
@@ -342,6 +342,15 @@ export declare module BackOfficeApiClient {
|
|
|
342
342
|
* @return Success
|
|
343
343
|
*/
|
|
344
344
|
removeDocumentsConnections(id: number, tenantId?: number | null | undefined, body?: RemoveProductDocumentConnectionsDto | null | undefined): Promise<void>;
|
|
345
|
+
/**
|
|
346
|
+
* Set a thumbnail image for an existing product.
|
|
347
|
+
* @param id Product identifier.
|
|
348
|
+
* @param productVersionId (optional)
|
|
349
|
+
* @param tenantId (optional) Tenant identifier.
|
|
350
|
+
* @param file (optional)
|
|
351
|
+
* @return Success
|
|
352
|
+
*/
|
|
353
|
+
setProductImage(id: number, productVersionId?: number | null | undefined, tenantId?: number | null | undefined, file?: FileParameter | null | undefined): Promise<void>;
|
|
345
354
|
/**
|
|
346
355
|
* Returns all available product personalization workflows.
|
|
347
356
|
* @param skip (optional) Defines page start offset from beginning of sorted result list.
|
|
@@ -383,7 +392,7 @@ export declare module BackOfficeApiClient {
|
|
|
383
392
|
/**
|
|
384
393
|
* Creates a new product and returns its description.
|
|
385
394
|
* @param tenantId (optional) Tenant identifier.
|
|
386
|
-
* @param body (optional)
|
|
395
|
+
* @param body (optional) Product creation parameters.
|
|
387
396
|
* @return Success
|
|
388
397
|
*/
|
|
389
398
|
createProduct(tenantId?: number | null | undefined, body?: CreateProductDto | null | undefined, cancelToken?: CancelToken | undefined): Promise<ProductDto>;
|
|
@@ -585,6 +594,16 @@ export declare module BackOfficeApiClient {
|
|
|
585
594
|
*/
|
|
586
595
|
removeDocumentsConnections(id: number, tenantId?: number | null | undefined, body?: RemoveProductDocumentConnectionsDto | null | undefined, cancelToken?: CancelToken | undefined): Promise<void>;
|
|
587
596
|
protected processRemoveDocumentsConnections(response: AxiosResponse): Promise<void>;
|
|
597
|
+
/**
|
|
598
|
+
* Set a thumbnail image for an existing product.
|
|
599
|
+
* @param id Product identifier.
|
|
600
|
+
* @param productVersionId (optional)
|
|
601
|
+
* @param tenantId (optional) Tenant identifier.
|
|
602
|
+
* @param file (optional)
|
|
603
|
+
* @return Success
|
|
604
|
+
*/
|
|
605
|
+
setProductImage(id: number, productVersionId?: number | null | undefined, tenantId?: number | null | undefined, file?: FileParameter | null | undefined, cancelToken?: CancelToken | undefined): Promise<void>;
|
|
606
|
+
protected processSetProductImage(response: AxiosResponse): Promise<void>;
|
|
588
607
|
/**
|
|
589
608
|
* Returns all available product personalization workflows.
|
|
590
609
|
* @param skip (optional) Defines page start offset from beginning of sorted result list.
|
|
@@ -1066,7 +1085,7 @@ export declare module BackOfficeApiClient {
|
|
|
1066
1085
|
/** Product option creation operation parameters. */
|
|
1067
1086
|
interface CreateProductOptionDto {
|
|
1068
1087
|
/** Option title. */
|
|
1069
|
-
title
|
|
1088
|
+
title: string;
|
|
1070
1089
|
/** Option traits. */
|
|
1071
1090
|
traits?: string[] | null;
|
|
1072
1091
|
/** Product option values. */
|
|
@@ -1081,7 +1100,7 @@ export declare module BackOfficeApiClient {
|
|
|
1081
1100
|
/** Product option creation operation parameters. */
|
|
1082
1101
|
interface CreateProductDto {
|
|
1083
1102
|
/** Product name. */
|
|
1084
|
-
name
|
|
1103
|
+
name: string;
|
|
1085
1104
|
/** Product description. */
|
|
1086
1105
|
description?: string | null;
|
|
1087
1106
|
/** Personalization workflow identifier. */
|
|
@@ -1144,6 +1163,8 @@ export declare module BackOfficeApiClient {
|
|
|
1144
1163
|
isDefault?: boolean;
|
|
1145
1164
|
/** Product option value identifying tag. */
|
|
1146
1165
|
tag?: string | null;
|
|
1166
|
+
/** Product option value UID. */
|
|
1167
|
+
uid?: string | null;
|
|
1147
1168
|
/** Product option value description for 'Simple' option type. */
|
|
1148
1169
|
simpleOptionValue?: SimpleOptionValue | null;
|
|
1149
1170
|
/** Product option value description. */
|
|
@@ -1173,6 +1194,8 @@ export declare module BackOfficeApiClient {
|
|
|
1173
1194
|
sortIndex?: number;
|
|
1174
1195
|
/** Product option identifying tag. */
|
|
1175
1196
|
tag?: string | null;
|
|
1197
|
+
/** Product option UID. */
|
|
1198
|
+
uid?: string | null;
|
|
1176
1199
|
/** Specifies if the option is used for design binding. */
|
|
1177
1200
|
useForDesignBinding?: boolean;
|
|
1178
1201
|
/** Specifies if the option is used for mockup binding. */
|
|
@@ -1436,10 +1459,10 @@ export declare module BackOfficeApiClient {
|
|
|
1436
1459
|
}
|
|
1437
1460
|
/** Product asset connection options description. */
|
|
1438
1461
|
interface ProductAssetConnectionOptionsDto {
|
|
1439
|
-
/** Product option
|
|
1440
|
-
|
|
1441
|
-
/** Product option values
|
|
1442
|
-
|
|
1462
|
+
/** Product option UID. */
|
|
1463
|
+
optionUID?: string | null;
|
|
1464
|
+
/** Product option values UIDs. */
|
|
1465
|
+
optionValueUIDs?: string[] | null;
|
|
1443
1466
|
}
|
|
1444
1467
|
/** Product design connection description. */
|
|
1445
1468
|
interface ProductDesignConnectionDto {
|
|
@@ -626,7 +626,7 @@ export var BackOfficeApiClient;
|
|
|
626
626
|
/**
|
|
627
627
|
* Creates a new product and returns its description.
|
|
628
628
|
* @param tenantId (optional) Tenant identifier.
|
|
629
|
-
* @param body (optional)
|
|
629
|
+
* @param body (optional) Product creation parameters.
|
|
630
630
|
* @return Success
|
|
631
631
|
*/
|
|
632
632
|
createProduct(tenantId, body, cancelToken) {
|
|
@@ -1509,6 +1509,13 @@ export var BackOfficeApiClient;
|
|
|
1509
1509
|
const _responseText = response.data;
|
|
1510
1510
|
return Promise.resolve(null);
|
|
1511
1511
|
}
|
|
1512
|
+
else if (status === 400) {
|
|
1513
|
+
const _responseText = response.data;
|
|
1514
|
+
let result400 = null;
|
|
1515
|
+
let resultData400 = _responseText;
|
|
1516
|
+
result400 = JSON.parse(resultData400);
|
|
1517
|
+
return throwException("Bad Request", status, _responseText, _headers, result400);
|
|
1518
|
+
}
|
|
1512
1519
|
else if (status === 404) {
|
|
1513
1520
|
const _responseText = response.data;
|
|
1514
1521
|
let result404 = null;
|
|
@@ -1589,6 +1596,13 @@ export var BackOfficeApiClient;
|
|
|
1589
1596
|
const _responseText = response.data;
|
|
1590
1597
|
return Promise.resolve(null);
|
|
1591
1598
|
}
|
|
1599
|
+
else if (status === 400) {
|
|
1600
|
+
const _responseText = response.data;
|
|
1601
|
+
let result400 = null;
|
|
1602
|
+
let resultData400 = _responseText;
|
|
1603
|
+
result400 = JSON.parse(resultData400);
|
|
1604
|
+
return throwException("Bad Request", status, _responseText, _headers, result400);
|
|
1605
|
+
}
|
|
1592
1606
|
else if (status === 404) {
|
|
1593
1607
|
const _responseText = response.data;
|
|
1594
1608
|
let result404 = null;
|
|
@@ -1669,6 +1683,13 @@ export var BackOfficeApiClient;
|
|
|
1669
1683
|
const _responseText = response.data;
|
|
1670
1684
|
return Promise.resolve(null);
|
|
1671
1685
|
}
|
|
1686
|
+
else if (status === 400) {
|
|
1687
|
+
const _responseText = response.data;
|
|
1688
|
+
let result400 = null;
|
|
1689
|
+
let resultData400 = _responseText;
|
|
1690
|
+
result400 = JSON.parse(resultData400);
|
|
1691
|
+
return throwException("Bad Request", status, _responseText, _headers, result400);
|
|
1692
|
+
}
|
|
1672
1693
|
else if (status === 404) {
|
|
1673
1694
|
const _responseText = response.data;
|
|
1674
1695
|
let result404 = null;
|
|
@@ -2258,6 +2279,96 @@ export var BackOfficeApiClient;
|
|
|
2258
2279
|
}
|
|
2259
2280
|
return Promise.resolve(null);
|
|
2260
2281
|
}
|
|
2282
|
+
/**
|
|
2283
|
+
* Set a thumbnail image for an existing product.
|
|
2284
|
+
* @param id Product identifier.
|
|
2285
|
+
* @param productVersionId (optional)
|
|
2286
|
+
* @param tenantId (optional) Tenant identifier.
|
|
2287
|
+
* @param file (optional)
|
|
2288
|
+
* @return Success
|
|
2289
|
+
*/
|
|
2290
|
+
setProductImage(id, productVersionId, tenantId, file, cancelToken) {
|
|
2291
|
+
let url_ = this.baseUrl + "/api/backoffice/v1/products/{id}/set-image?";
|
|
2292
|
+
if (id === undefined || id === null)
|
|
2293
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
2294
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
2295
|
+
if (productVersionId !== undefined && productVersionId !== null)
|
|
2296
|
+
url_ += "productVersionId=" + encodeURIComponent("" + productVersionId) + "&";
|
|
2297
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
2298
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2299
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
2300
|
+
const content_ = new FormData();
|
|
2301
|
+
if (file !== null && file !== undefined)
|
|
2302
|
+
content_.append("file", file.data, file.fileName ? file.fileName : "file");
|
|
2303
|
+
let options_ = {
|
|
2304
|
+
data: content_,
|
|
2305
|
+
method: "POST",
|
|
2306
|
+
url: url_,
|
|
2307
|
+
headers: {},
|
|
2308
|
+
cancelToken
|
|
2309
|
+
};
|
|
2310
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
2311
|
+
return this.instance.request(transformedOptions_);
|
|
2312
|
+
}).catch((_error) => {
|
|
2313
|
+
if (isAxiosError(_error) && _error.response) {
|
|
2314
|
+
return _error.response;
|
|
2315
|
+
}
|
|
2316
|
+
else {
|
|
2317
|
+
throw _error;
|
|
2318
|
+
}
|
|
2319
|
+
}).then((_response) => {
|
|
2320
|
+
return this.transformResult(url_, _response, (_response) => this.processSetProductImage(_response));
|
|
2321
|
+
});
|
|
2322
|
+
}
|
|
2323
|
+
processSetProductImage(response) {
|
|
2324
|
+
const status = response.status;
|
|
2325
|
+
let _headers = {};
|
|
2326
|
+
if (response.headers && typeof response.headers === "object") {
|
|
2327
|
+
for (let k in response.headers) {
|
|
2328
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
2329
|
+
_headers[k] = response.headers[k];
|
|
2330
|
+
}
|
|
2331
|
+
}
|
|
2332
|
+
}
|
|
2333
|
+
if (status === 200) {
|
|
2334
|
+
const _responseText = response.data;
|
|
2335
|
+
return Promise.resolve(null);
|
|
2336
|
+
}
|
|
2337
|
+
else if (status === 400) {
|
|
2338
|
+
const _responseText = response.data;
|
|
2339
|
+
let result400 = null;
|
|
2340
|
+
let resultData400 = _responseText;
|
|
2341
|
+
result400 = JSON.parse(resultData400);
|
|
2342
|
+
return throwException("Bad Request", status, _responseText, _headers, result400);
|
|
2343
|
+
}
|
|
2344
|
+
else if (status === 404) {
|
|
2345
|
+
const _responseText = response.data;
|
|
2346
|
+
let result404 = null;
|
|
2347
|
+
let resultData404 = _responseText;
|
|
2348
|
+
result404 = JSON.parse(resultData404);
|
|
2349
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
2350
|
+
}
|
|
2351
|
+
else if (status === 409) {
|
|
2352
|
+
const _responseText = response.data;
|
|
2353
|
+
let result409 = null;
|
|
2354
|
+
let resultData409 = _responseText;
|
|
2355
|
+
result409 = JSON.parse(resultData409);
|
|
2356
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
2357
|
+
}
|
|
2358
|
+
else if (status === 401) {
|
|
2359
|
+
const _responseText = response.data;
|
|
2360
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
2361
|
+
}
|
|
2362
|
+
else if (status === 403) {
|
|
2363
|
+
const _responseText = response.data;
|
|
2364
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
2365
|
+
}
|
|
2366
|
+
else if (status !== 200 && status !== 204) {
|
|
2367
|
+
const _responseText = response.data;
|
|
2368
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
2369
|
+
}
|
|
2370
|
+
return Promise.resolve(null);
|
|
2371
|
+
}
|
|
2261
2372
|
/**
|
|
2262
2373
|
* Returns all available product personalization workflows.
|
|
2263
2374
|
* @param skip (optional) Defines page start offset from beginning of sorted result list.
|