@aurigma/axios-backoffice-api-client 2.62.12 → 2.63.14
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 +63 -0
- package/dist/cjs/backoffice-api-client.js +240 -0
- package/dist/cjs/backoffice-api-client.js.map +1 -1
- package/dist/esm/backoffice-api-client.d.ts +63 -0
- package/dist/esm/backoffice-api-client.js +240 -0
- package/dist/esm/backoffice-api-client.js.map +1 -1
- package/package.json +1 -1
|
@@ -219,6 +219,21 @@ export declare module BackOfficeApiClient {
|
|
|
219
219
|
* @return Success
|
|
220
220
|
*/
|
|
221
221
|
getProductVariant(id: number, productVariantId: number, productVersionId?: number | null | undefined, tenantId?: number | null | undefined): Promise<ProductVariantDto>;
|
|
222
|
+
/**
|
|
223
|
+
* Updates product variant resources.
|
|
224
|
+
* @param id Product identifier.
|
|
225
|
+
* @param productVersionId (optional) Product version identifier.
|
|
226
|
+
* @param tenantId (optional) Tenant identifier.
|
|
227
|
+
* @return Success
|
|
228
|
+
*/
|
|
229
|
+
updateProductVariantResources(id: number, productVersionId?: number | null | undefined, tenantId?: number | null | undefined): Promise<void>;
|
|
230
|
+
/**
|
|
231
|
+
* Validates product variant resources.
|
|
232
|
+
* @param id Product identifier.
|
|
233
|
+
* @param tenantId (optional) Tenant identifier.
|
|
234
|
+
* @return Success
|
|
235
|
+
*/
|
|
236
|
+
validateProductVariantResources(id: number, tenantId?: number | null | undefined): Promise<void>;
|
|
222
237
|
/**
|
|
223
238
|
* Returns a list of product variant designs.
|
|
224
239
|
* @param id Product identifier.
|
|
@@ -281,6 +296,14 @@ export declare module BackOfficeApiClient {
|
|
|
281
296
|
* @return Success
|
|
282
297
|
*/
|
|
283
298
|
setProductVariantPrice(id: number, tenantId?: number | null | undefined, body?: SetProductVariantPriceDto | null | undefined): Promise<void>;
|
|
299
|
+
/**
|
|
300
|
+
* Set product variants weight. Variants identifiers will be changed.
|
|
301
|
+
* @param id Product identifier.
|
|
302
|
+
* @param tenantId (optional) Tenant identifier.
|
|
303
|
+
* @param body (optional) Set product variants weight operation parameters.
|
|
304
|
+
* @return Success
|
|
305
|
+
*/
|
|
306
|
+
setProductVariantWeight(id: number, tenantId?: number | null | undefined, body?: SetProductVariantWeightDto | null | undefined): Promise<void>;
|
|
284
307
|
/**
|
|
285
308
|
* Set product variants availability. Variants identifiers will be changed.
|
|
286
309
|
* @param id Product identifier.
|
|
@@ -467,6 +490,23 @@ export declare module BackOfficeApiClient {
|
|
|
467
490
|
*/
|
|
468
491
|
getProductVariant(id: number, productVariantId: number, productVersionId?: number | null | undefined, tenantId?: number | null | undefined, cancelToken?: CancelToken | undefined): Promise<ProductVariantDto>;
|
|
469
492
|
protected processGetProductVariant(response: AxiosResponse): Promise<ProductVariantDto>;
|
|
493
|
+
/**
|
|
494
|
+
* Updates product variant resources.
|
|
495
|
+
* @param id Product identifier.
|
|
496
|
+
* @param productVersionId (optional) Product version identifier.
|
|
497
|
+
* @param tenantId (optional) Tenant identifier.
|
|
498
|
+
* @return Success
|
|
499
|
+
*/
|
|
500
|
+
updateProductVariantResources(id: number, productVersionId?: number | null | undefined, tenantId?: number | null | undefined, cancelToken?: CancelToken | undefined): Promise<void>;
|
|
501
|
+
protected processUpdateProductVariantResources(response: AxiosResponse): Promise<void>;
|
|
502
|
+
/**
|
|
503
|
+
* Validates product variant resources.
|
|
504
|
+
* @param id Product identifier.
|
|
505
|
+
* @param tenantId (optional) Tenant identifier.
|
|
506
|
+
* @return Success
|
|
507
|
+
*/
|
|
508
|
+
validateProductVariantResources(id: number, tenantId?: number | null | undefined, cancelToken?: CancelToken | undefined): Promise<void>;
|
|
509
|
+
protected processValidateProductVariantResources(response: AxiosResponse): Promise<void>;
|
|
470
510
|
/**
|
|
471
511
|
* Returns a list of product variant designs.
|
|
472
512
|
* @param id Product identifier.
|
|
@@ -533,6 +573,15 @@ export declare module BackOfficeApiClient {
|
|
|
533
573
|
*/
|
|
534
574
|
setProductVariantPrice(id: number, tenantId?: number | null | undefined, body?: SetProductVariantPriceDto | null | undefined, cancelToken?: CancelToken | undefined): Promise<void>;
|
|
535
575
|
protected processSetProductVariantPrice(response: AxiosResponse): Promise<void>;
|
|
576
|
+
/**
|
|
577
|
+
* Set product variants weight. Variants identifiers will be changed.
|
|
578
|
+
* @param id Product identifier.
|
|
579
|
+
* @param tenantId (optional) Tenant identifier.
|
|
580
|
+
* @param body (optional) Set product variants weight operation parameters.
|
|
581
|
+
* @return Success
|
|
582
|
+
*/
|
|
583
|
+
setProductVariantWeight(id: number, tenantId?: number | null | undefined, body?: SetProductVariantWeightDto | null | undefined, cancelToken?: CancelToken | undefined): Promise<void>;
|
|
584
|
+
protected processSetProductVariantWeight(response: AxiosResponse): Promise<void>;
|
|
536
585
|
/**
|
|
537
586
|
* Set product variants availability. Variants identifiers will be changed.
|
|
538
587
|
* @param id Product identifier.
|
|
@@ -1318,6 +1367,8 @@ export declare module BackOfficeApiClient {
|
|
|
1318
1367
|
isAvailable?: boolean;
|
|
1319
1368
|
/** Product variant price. */
|
|
1320
1369
|
price?: number | null;
|
|
1370
|
+
/** Product variant weight. */
|
|
1371
|
+
weight?: number | null;
|
|
1321
1372
|
/** Product variant sort index. */
|
|
1322
1373
|
sortIndex?: number;
|
|
1323
1374
|
/** Product variant identifier (usually SKU) in storefront / online store. */
|
|
@@ -1500,6 +1551,18 @@ export declare module BackOfficeApiClient {
|
|
|
1500
1551
|
/** List of product variants grouped by price value. */
|
|
1501
1552
|
items?: ProductVariantPriceDto[] | null;
|
|
1502
1553
|
}
|
|
1554
|
+
/** Parameters for setting product variants weight. */
|
|
1555
|
+
interface ProductVariantWeightDto {
|
|
1556
|
+
/** Weight. */
|
|
1557
|
+
weight?: number | null;
|
|
1558
|
+
/** UIDs of variants for price setting. */
|
|
1559
|
+
variantUIDs?: string[] | null;
|
|
1560
|
+
}
|
|
1561
|
+
/** Product variants weight setting operation parameters. */
|
|
1562
|
+
interface SetProductVariantWeightDto {
|
|
1563
|
+
/** List of product variants grouped by weight value. */
|
|
1564
|
+
items?: ProductVariantWeightDto[] | null;
|
|
1565
|
+
}
|
|
1503
1566
|
/** Parameters for setting product variants availability. */
|
|
1504
1567
|
interface ProductVariantAvailabilityDto {
|
|
1505
1568
|
/** Availability. */
|
|
@@ -1210,6 +1210,159 @@ var BackOfficeApiClient;
|
|
|
1210
1210
|
}
|
|
1211
1211
|
return Promise.resolve(null);
|
|
1212
1212
|
}
|
|
1213
|
+
/**
|
|
1214
|
+
* Updates product variant resources.
|
|
1215
|
+
* @param id Product identifier.
|
|
1216
|
+
* @param productVersionId (optional) Product version identifier.
|
|
1217
|
+
* @param tenantId (optional) Tenant identifier.
|
|
1218
|
+
* @return Success
|
|
1219
|
+
*/
|
|
1220
|
+
updateProductVariantResources(id, productVersionId, tenantId, cancelToken) {
|
|
1221
|
+
let url_ = this.baseUrl + "/api/backoffice/v1/products/{id}/update-variant-resources?";
|
|
1222
|
+
if (id === undefined || id === null)
|
|
1223
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
1224
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
1225
|
+
if (productVersionId !== undefined && productVersionId !== null)
|
|
1226
|
+
url_ += "productVersionId=" + encodeURIComponent("" + productVersionId) + "&";
|
|
1227
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
1228
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
1229
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
1230
|
+
let options_ = {
|
|
1231
|
+
method: "POST",
|
|
1232
|
+
url: url_,
|
|
1233
|
+
headers: {},
|
|
1234
|
+
cancelToken
|
|
1235
|
+
};
|
|
1236
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
1237
|
+
return this.instance.request(transformedOptions_);
|
|
1238
|
+
}).catch((_error) => {
|
|
1239
|
+
if (isAxiosError(_error) && _error.response) {
|
|
1240
|
+
return _error.response;
|
|
1241
|
+
}
|
|
1242
|
+
else {
|
|
1243
|
+
throw _error;
|
|
1244
|
+
}
|
|
1245
|
+
}).then((_response) => {
|
|
1246
|
+
return this.transformResult(url_, _response, (_response) => this.processUpdateProductVariantResources(_response));
|
|
1247
|
+
});
|
|
1248
|
+
}
|
|
1249
|
+
processUpdateProductVariantResources(response) {
|
|
1250
|
+
const status = response.status;
|
|
1251
|
+
let _headers = {};
|
|
1252
|
+
if (response.headers && typeof response.headers === "object") {
|
|
1253
|
+
for (let k in response.headers) {
|
|
1254
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
1255
|
+
_headers[k] = response.headers[k];
|
|
1256
|
+
}
|
|
1257
|
+
}
|
|
1258
|
+
}
|
|
1259
|
+
if (status === 200) {
|
|
1260
|
+
const _responseText = response.data;
|
|
1261
|
+
return Promise.resolve(null);
|
|
1262
|
+
}
|
|
1263
|
+
else if (status === 404) {
|
|
1264
|
+
const _responseText = response.data;
|
|
1265
|
+
let result404 = null;
|
|
1266
|
+
let resultData404 = _responseText;
|
|
1267
|
+
result404 = JSON.parse(resultData404);
|
|
1268
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
1269
|
+
}
|
|
1270
|
+
else if (status === 409) {
|
|
1271
|
+
const _responseText = response.data;
|
|
1272
|
+
let result409 = null;
|
|
1273
|
+
let resultData409 = _responseText;
|
|
1274
|
+
result409 = JSON.parse(resultData409);
|
|
1275
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
1276
|
+
}
|
|
1277
|
+
else if (status === 401) {
|
|
1278
|
+
const _responseText = response.data;
|
|
1279
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
1280
|
+
}
|
|
1281
|
+
else if (status === 403) {
|
|
1282
|
+
const _responseText = response.data;
|
|
1283
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
1284
|
+
}
|
|
1285
|
+
else if (status !== 200 && status !== 204) {
|
|
1286
|
+
const _responseText = response.data;
|
|
1287
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
1288
|
+
}
|
|
1289
|
+
return Promise.resolve(null);
|
|
1290
|
+
}
|
|
1291
|
+
/**
|
|
1292
|
+
* Validates product variant resources.
|
|
1293
|
+
* @param id Product identifier.
|
|
1294
|
+
* @param tenantId (optional) Tenant identifier.
|
|
1295
|
+
* @return Success
|
|
1296
|
+
*/
|
|
1297
|
+
validateProductVariantResources(id, tenantId, cancelToken) {
|
|
1298
|
+
let url_ = this.baseUrl + "/api/backoffice/v1/products/{id}/validate-variant-resources?";
|
|
1299
|
+
if (id === undefined || id === null)
|
|
1300
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
1301
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
1302
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
1303
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
1304
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
1305
|
+
let options_ = {
|
|
1306
|
+
method: "POST",
|
|
1307
|
+
url: url_,
|
|
1308
|
+
headers: {},
|
|
1309
|
+
cancelToken
|
|
1310
|
+
};
|
|
1311
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
1312
|
+
return this.instance.request(transformedOptions_);
|
|
1313
|
+
}).catch((_error) => {
|
|
1314
|
+
if (isAxiosError(_error) && _error.response) {
|
|
1315
|
+
return _error.response;
|
|
1316
|
+
}
|
|
1317
|
+
else {
|
|
1318
|
+
throw _error;
|
|
1319
|
+
}
|
|
1320
|
+
}).then((_response) => {
|
|
1321
|
+
return this.transformResult(url_, _response, (_response) => this.processValidateProductVariantResources(_response));
|
|
1322
|
+
});
|
|
1323
|
+
}
|
|
1324
|
+
processValidateProductVariantResources(response) {
|
|
1325
|
+
const status = response.status;
|
|
1326
|
+
let _headers = {};
|
|
1327
|
+
if (response.headers && typeof response.headers === "object") {
|
|
1328
|
+
for (let k in response.headers) {
|
|
1329
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
1330
|
+
_headers[k] = response.headers[k];
|
|
1331
|
+
}
|
|
1332
|
+
}
|
|
1333
|
+
}
|
|
1334
|
+
if (status === 200) {
|
|
1335
|
+
const _responseText = response.data;
|
|
1336
|
+
return Promise.resolve(null);
|
|
1337
|
+
}
|
|
1338
|
+
else if (status === 404) {
|
|
1339
|
+
const _responseText = response.data;
|
|
1340
|
+
let result404 = null;
|
|
1341
|
+
let resultData404 = _responseText;
|
|
1342
|
+
result404 = JSON.parse(resultData404);
|
|
1343
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
1344
|
+
}
|
|
1345
|
+
else if (status === 409) {
|
|
1346
|
+
const _responseText = response.data;
|
|
1347
|
+
let result409 = null;
|
|
1348
|
+
let resultData409 = _responseText;
|
|
1349
|
+
result409 = JSON.parse(resultData409);
|
|
1350
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
1351
|
+
}
|
|
1352
|
+
else if (status === 401) {
|
|
1353
|
+
const _responseText = response.data;
|
|
1354
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
1355
|
+
}
|
|
1356
|
+
else if (status === 403) {
|
|
1357
|
+
const _responseText = response.data;
|
|
1358
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
1359
|
+
}
|
|
1360
|
+
else if (status !== 200 && status !== 204) {
|
|
1361
|
+
const _responseText = response.data;
|
|
1362
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
1363
|
+
}
|
|
1364
|
+
return Promise.resolve(null);
|
|
1365
|
+
}
|
|
1213
1366
|
/**
|
|
1214
1367
|
* Returns a list of product variant designs.
|
|
1215
1368
|
* @param id Product identifier.
|
|
@@ -1636,6 +1789,93 @@ var BackOfficeApiClient;
|
|
|
1636
1789
|
}
|
|
1637
1790
|
return Promise.resolve(null);
|
|
1638
1791
|
}
|
|
1792
|
+
/**
|
|
1793
|
+
* Set product variants weight. Variants identifiers will be changed.
|
|
1794
|
+
* @param id Product identifier.
|
|
1795
|
+
* @param tenantId (optional) Tenant identifier.
|
|
1796
|
+
* @param body (optional) Set product variants weight operation parameters.
|
|
1797
|
+
* @return Success
|
|
1798
|
+
*/
|
|
1799
|
+
setProductVariantWeight(id, tenantId, body, cancelToken) {
|
|
1800
|
+
let url_ = this.baseUrl + "/api/backoffice/v1/products/{id}/set-variant-weight?";
|
|
1801
|
+
if (id === undefined || id === null)
|
|
1802
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
1803
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
1804
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
1805
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
1806
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
1807
|
+
const content_ = JSON.stringify(body);
|
|
1808
|
+
let options_ = {
|
|
1809
|
+
data: content_,
|
|
1810
|
+
method: "POST",
|
|
1811
|
+
url: url_,
|
|
1812
|
+
headers: {
|
|
1813
|
+
"Content-Type": "application/json",
|
|
1814
|
+
},
|
|
1815
|
+
cancelToken
|
|
1816
|
+
};
|
|
1817
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
1818
|
+
return this.instance.request(transformedOptions_);
|
|
1819
|
+
}).catch((_error) => {
|
|
1820
|
+
if (isAxiosError(_error) && _error.response) {
|
|
1821
|
+
return _error.response;
|
|
1822
|
+
}
|
|
1823
|
+
else {
|
|
1824
|
+
throw _error;
|
|
1825
|
+
}
|
|
1826
|
+
}).then((_response) => {
|
|
1827
|
+
return this.transformResult(url_, _response, (_response) => this.processSetProductVariantWeight(_response));
|
|
1828
|
+
});
|
|
1829
|
+
}
|
|
1830
|
+
processSetProductVariantWeight(response) {
|
|
1831
|
+
const status = response.status;
|
|
1832
|
+
let _headers = {};
|
|
1833
|
+
if (response.headers && typeof response.headers === "object") {
|
|
1834
|
+
for (let k in response.headers) {
|
|
1835
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
1836
|
+
_headers[k] = response.headers[k];
|
|
1837
|
+
}
|
|
1838
|
+
}
|
|
1839
|
+
}
|
|
1840
|
+
if (status === 200) {
|
|
1841
|
+
const _responseText = response.data;
|
|
1842
|
+
return Promise.resolve(null);
|
|
1843
|
+
}
|
|
1844
|
+
else if (status === 400) {
|
|
1845
|
+
const _responseText = response.data;
|
|
1846
|
+
let result400 = null;
|
|
1847
|
+
let resultData400 = _responseText;
|
|
1848
|
+
result400 = JSON.parse(resultData400);
|
|
1849
|
+
return throwException("Bad Request", status, _responseText, _headers, result400);
|
|
1850
|
+
}
|
|
1851
|
+
else if (status === 404) {
|
|
1852
|
+
const _responseText = response.data;
|
|
1853
|
+
let result404 = null;
|
|
1854
|
+
let resultData404 = _responseText;
|
|
1855
|
+
result404 = JSON.parse(resultData404);
|
|
1856
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
1857
|
+
}
|
|
1858
|
+
else if (status === 409) {
|
|
1859
|
+
const _responseText = response.data;
|
|
1860
|
+
let result409 = null;
|
|
1861
|
+
let resultData409 = _responseText;
|
|
1862
|
+
result409 = JSON.parse(resultData409);
|
|
1863
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
1864
|
+
}
|
|
1865
|
+
else if (status === 401) {
|
|
1866
|
+
const _responseText = response.data;
|
|
1867
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
1868
|
+
}
|
|
1869
|
+
else if (status === 403) {
|
|
1870
|
+
const _responseText = response.data;
|
|
1871
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
1872
|
+
}
|
|
1873
|
+
else if (status !== 200 && status !== 204) {
|
|
1874
|
+
const _responseText = response.data;
|
|
1875
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
1876
|
+
}
|
|
1877
|
+
return Promise.resolve(null);
|
|
1878
|
+
}
|
|
1639
1879
|
/**
|
|
1640
1880
|
* Set product variants availability. Variants identifiers will be changed.
|
|
1641
1881
|
* @param id Product identifier.
|