@aurigma/axios-backoffice-api-client 2.60.2 → 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.
@@ -188,6 +188,14 @@ export declare module BackOfficeApiClient {
188
188
  * @return Success
189
189
  */
190
190
  getProductOptions(id: number, productVersionId?: number | null | undefined, tenantId?: number | null | undefined): Promise<PagedOfProductOptionDto>;
191
+ /**
192
+ * Set product options and returns updated options list.
193
+ * @param id Product identifier.
194
+ * @param tenantId (optional) Tenant identifier.
195
+ * @param body (optional)
196
+ * @return Success
197
+ */
198
+ setProductOptions(id: number, tenantId?: number | null | undefined, body?: SetProductOptionsDto | null | undefined): Promise<PagedOfProductOptionDto>;
191
199
  /**
192
200
  * Returns a list of product variants.
193
201
  * @param id Product identifier.
@@ -211,6 +219,21 @@ export declare module BackOfficeApiClient {
211
219
  * @return Success
212
220
  */
213
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>;
214
237
  /**
215
238
  * Returns a list of product variant designs.
216
239
  * @param id Product identifier.
@@ -273,6 +296,14 @@ export declare module BackOfficeApiClient {
273
296
  * @return Success
274
297
  */
275
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>;
276
307
  /**
277
308
  * Set product variants availability. Variants identifiers will be changed.
278
309
  * @param id Product identifier.
@@ -425,6 +456,15 @@ export declare module BackOfficeApiClient {
425
456
  */
426
457
  getProductOptions(id: number, productVersionId?: number | null | undefined, tenantId?: number | null | undefined, cancelToken?: CancelToken | undefined): Promise<PagedOfProductOptionDto>;
427
458
  protected processGetProductOptions(response: AxiosResponse): Promise<PagedOfProductOptionDto>;
459
+ /**
460
+ * Set product options and returns updated options list.
461
+ * @param id Product identifier.
462
+ * @param tenantId (optional) Tenant identifier.
463
+ * @param body (optional)
464
+ * @return Success
465
+ */
466
+ setProductOptions(id: number, tenantId?: number | null | undefined, body?: SetProductOptionsDto | null | undefined, cancelToken?: CancelToken | undefined): Promise<PagedOfProductOptionDto>;
467
+ protected processSetProductOptions(response: AxiosResponse): Promise<PagedOfProductOptionDto>;
428
468
  /**
429
469
  * Returns a list of product variants.
430
470
  * @param id Product identifier.
@@ -450,6 +490,23 @@ export declare module BackOfficeApiClient {
450
490
  */
451
491
  getProductVariant(id: number, productVariantId: number, productVersionId?: number | null | undefined, tenantId?: number | null | undefined, cancelToken?: CancelToken | undefined): Promise<ProductVariantDto>;
452
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>;
453
510
  /**
454
511
  * Returns a list of product variant designs.
455
512
  * @param id Product identifier.
@@ -516,6 +573,15 @@ export declare module BackOfficeApiClient {
516
573
  */
517
574
  setProductVariantPrice(id: number, tenantId?: number | null | undefined, body?: SetProductVariantPriceDto | null | undefined, cancelToken?: CancelToken | undefined): Promise<void>;
518
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>;
519
585
  /**
520
586
  * Set product variants availability. Variants identifiers will be changed.
521
587
  * @param id Product identifier.
@@ -1227,6 +1293,47 @@ export declare module BackOfficeApiClient {
1227
1293
  total?: number;
1228
1294
  items?: ProductOptionDto[] | null;
1229
1295
  }
1296
+ /** Product option value create or update operation parameters. */
1297
+ interface SetProductOptionValueDto {
1298
+ /** Product option value UID. */
1299
+ uid?: string | null;
1300
+ /** Product option value description. */
1301
+ description?: string | null;
1302
+ /** Product option value sort index. */
1303
+ sortIndex?: number;
1304
+ /** Indicates if product option value is used as a default value. */
1305
+ isDefault?: boolean;
1306
+ /** Product option value. */
1307
+ value?: string | null;
1308
+ /** Product option value colors. */
1309
+ colors?: string[] | null;
1310
+ }
1311
+ /** Product option create or update operation parameters. */
1312
+ interface SetProductOptionDto {
1313
+ /** Product option UID. */
1314
+ uid?: string | null;
1315
+ /** Product option title. */
1316
+ title?: string | null;
1317
+ /** Product option description. */
1318
+ description?: string | null;
1319
+ /** Product option tooltip. */
1320
+ tooltip?: string | null;
1321
+ /** Product option sort index. */
1322
+ sortIndex?: number;
1323
+ /** Specifies if the option is used for design binding. */
1324
+ useForDesignBinding?: boolean;
1325
+ /** Specifies if the option is used for mockup binding. */
1326
+ useForMockupBinding?: boolean;
1327
+ /** Specifies if the option is used for document binding. */
1328
+ useForDocumentBinding?: boolean;
1329
+ /** A list of product option values. */
1330
+ values?: SetProductOptionValueDto[] | null;
1331
+ }
1332
+ /** Product options setting operation parameters. */
1333
+ interface SetProductOptionsDto {
1334
+ /** Product options create or update parameters. */
1335
+ options?: SetProductOptionDto[] | null;
1336
+ }
1230
1337
  /** Dto class, containing information about a product variant option. */
1231
1338
  interface ProductVariantOptionDto {
1232
1339
  /** Product option identifier. */
@@ -1260,6 +1367,8 @@ export declare module BackOfficeApiClient {
1260
1367
  isAvailable?: boolean;
1261
1368
  /** Product variant price. */
1262
1369
  price?: number | null;
1370
+ /** Product variant weight. */
1371
+ weight?: number | null;
1263
1372
  /** Product variant sort index. */
1264
1373
  sortIndex?: number;
1265
1374
  /** Product variant identifier (usually SKU) in storefront / online store. */
@@ -1442,6 +1551,18 @@ export declare module BackOfficeApiClient {
1442
1551
  /** List of product variants grouped by price value. */
1443
1552
  items?: ProductVariantPriceDto[] | null;
1444
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
+ }
1445
1566
  /** Parameters for setting product variants availability. */
1446
1567
  interface ProductVariantAvailabilityDto {
1447
1568
  /** Availability. */
@@ -938,6 +938,90 @@ var BackOfficeApiClient;
938
938
  }
939
939
  return Promise.resolve(null);
940
940
  }
941
+ /**
942
+ * Set product options and returns updated options list.
943
+ * @param id Product identifier.
944
+ * @param tenantId (optional) Tenant identifier.
945
+ * @param body (optional)
946
+ * @return Success
947
+ */
948
+ setProductOptions(id, tenantId, body, cancelToken) {
949
+ let url_ = this.baseUrl + "/api/backoffice/v1/products/{id}/options?";
950
+ if (id === undefined || id === null)
951
+ throw new Error("The parameter 'id' must be defined.");
952
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
953
+ if (tenantId !== undefined && tenantId !== null)
954
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
955
+ url_ = url_.replace(/[?&]$/, "");
956
+ const content_ = JSON.stringify(body);
957
+ let options_ = {
958
+ data: content_,
959
+ method: "PUT",
960
+ url: url_,
961
+ headers: {
962
+ "Content-Type": "application/json",
963
+ "Accept": "application/json"
964
+ },
965
+ cancelToken
966
+ };
967
+ return this.transformOptions(options_).then(transformedOptions_ => {
968
+ return this.instance.request(transformedOptions_);
969
+ }).catch((_error) => {
970
+ if (isAxiosError(_error) && _error.response) {
971
+ return _error.response;
972
+ }
973
+ else {
974
+ throw _error;
975
+ }
976
+ }).then((_response) => {
977
+ return this.transformResult(url_, _response, (_response) => this.processSetProductOptions(_response));
978
+ });
979
+ }
980
+ processSetProductOptions(response) {
981
+ const status = response.status;
982
+ let _headers = {};
983
+ if (response.headers && typeof response.headers === "object") {
984
+ for (let k in response.headers) {
985
+ if (response.headers.hasOwnProperty(k)) {
986
+ _headers[k] = response.headers[k];
987
+ }
988
+ }
989
+ }
990
+ if (status === 200) {
991
+ const _responseText = response.data;
992
+ let result200 = null;
993
+ let resultData200 = _responseText;
994
+ result200 = JSON.parse(resultData200);
995
+ return Promise.resolve(result200);
996
+ }
997
+ else if (status === 404) {
998
+ const _responseText = response.data;
999
+ let result404 = null;
1000
+ let resultData404 = _responseText;
1001
+ result404 = JSON.parse(resultData404);
1002
+ return throwException("Not Found", status, _responseText, _headers, result404);
1003
+ }
1004
+ else if (status === 409) {
1005
+ const _responseText = response.data;
1006
+ let result409 = null;
1007
+ let resultData409 = _responseText;
1008
+ result409 = JSON.parse(resultData409);
1009
+ return throwException("Conflict", status, _responseText, _headers, result409);
1010
+ }
1011
+ else if (status === 401) {
1012
+ const _responseText = response.data;
1013
+ return throwException("Unauthorized", status, _responseText, _headers);
1014
+ }
1015
+ else if (status === 403) {
1016
+ const _responseText = response.data;
1017
+ return throwException("Forbidden", status, _responseText, _headers);
1018
+ }
1019
+ else if (status !== 200 && status !== 204) {
1020
+ const _responseText = response.data;
1021
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
1022
+ }
1023
+ return Promise.resolve(null);
1024
+ }
941
1025
  /**
942
1026
  * Returns a list of product variants.
943
1027
  * @param id Product identifier.
@@ -1126,6 +1210,159 @@ var BackOfficeApiClient;
1126
1210
  }
1127
1211
  return Promise.resolve(null);
1128
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
+ }
1129
1366
  /**
1130
1367
  * Returns a list of product variant designs.
1131
1368
  * @param id Product identifier.
@@ -1552,6 +1789,93 @@ var BackOfficeApiClient;
1552
1789
  }
1553
1790
  return Promise.resolve(null);
1554
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
+ }
1555
1879
  /**
1556
1880
  * Set product variants availability. Variants identifiers will be changed.
1557
1881
  * @param id Product identifier.