@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. */
@@ -935,6 +935,90 @@ export var BackOfficeApiClient;
935
935
  }
936
936
  return Promise.resolve(null);
937
937
  }
938
+ /**
939
+ * Set product options and returns updated options list.
940
+ * @param id Product identifier.
941
+ * @param tenantId (optional) Tenant identifier.
942
+ * @param body (optional)
943
+ * @return Success
944
+ */
945
+ setProductOptions(id, tenantId, body, cancelToken) {
946
+ let url_ = this.baseUrl + "/api/backoffice/v1/products/{id}/options?";
947
+ if (id === undefined || id === null)
948
+ throw new Error("The parameter 'id' must be defined.");
949
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
950
+ if (tenantId !== undefined && tenantId !== null)
951
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
952
+ url_ = url_.replace(/[?&]$/, "");
953
+ const content_ = JSON.stringify(body);
954
+ let options_ = {
955
+ data: content_,
956
+ method: "PUT",
957
+ url: url_,
958
+ headers: {
959
+ "Content-Type": "application/json",
960
+ "Accept": "application/json"
961
+ },
962
+ cancelToken
963
+ };
964
+ return this.transformOptions(options_).then(transformedOptions_ => {
965
+ return this.instance.request(transformedOptions_);
966
+ }).catch((_error) => {
967
+ if (isAxiosError(_error) && _error.response) {
968
+ return _error.response;
969
+ }
970
+ else {
971
+ throw _error;
972
+ }
973
+ }).then((_response) => {
974
+ return this.transformResult(url_, _response, (_response) => this.processSetProductOptions(_response));
975
+ });
976
+ }
977
+ processSetProductOptions(response) {
978
+ const status = response.status;
979
+ let _headers = {};
980
+ if (response.headers && typeof response.headers === "object") {
981
+ for (let k in response.headers) {
982
+ if (response.headers.hasOwnProperty(k)) {
983
+ _headers[k] = response.headers[k];
984
+ }
985
+ }
986
+ }
987
+ if (status === 200) {
988
+ const _responseText = response.data;
989
+ let result200 = null;
990
+ let resultData200 = _responseText;
991
+ result200 = JSON.parse(resultData200);
992
+ return Promise.resolve(result200);
993
+ }
994
+ else if (status === 404) {
995
+ const _responseText = response.data;
996
+ let result404 = null;
997
+ let resultData404 = _responseText;
998
+ result404 = JSON.parse(resultData404);
999
+ return throwException("Not Found", status, _responseText, _headers, result404);
1000
+ }
1001
+ else if (status === 409) {
1002
+ const _responseText = response.data;
1003
+ let result409 = null;
1004
+ let resultData409 = _responseText;
1005
+ result409 = JSON.parse(resultData409);
1006
+ return throwException("Conflict", status, _responseText, _headers, result409);
1007
+ }
1008
+ else if (status === 401) {
1009
+ const _responseText = response.data;
1010
+ return throwException("Unauthorized", status, _responseText, _headers);
1011
+ }
1012
+ else if (status === 403) {
1013
+ const _responseText = response.data;
1014
+ return throwException("Forbidden", status, _responseText, _headers);
1015
+ }
1016
+ else if (status !== 200 && status !== 204) {
1017
+ const _responseText = response.data;
1018
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
1019
+ }
1020
+ return Promise.resolve(null);
1021
+ }
938
1022
  /**
939
1023
  * Returns a list of product variants.
940
1024
  * @param id Product identifier.
@@ -1123,6 +1207,159 @@ export var BackOfficeApiClient;
1123
1207
  }
1124
1208
  return Promise.resolve(null);
1125
1209
  }
1210
+ /**
1211
+ * Updates product variant resources.
1212
+ * @param id Product identifier.
1213
+ * @param productVersionId (optional) Product version identifier.
1214
+ * @param tenantId (optional) Tenant identifier.
1215
+ * @return Success
1216
+ */
1217
+ updateProductVariantResources(id, productVersionId, tenantId, cancelToken) {
1218
+ let url_ = this.baseUrl + "/api/backoffice/v1/products/{id}/update-variant-resources?";
1219
+ if (id === undefined || id === null)
1220
+ throw new Error("The parameter 'id' must be defined.");
1221
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
1222
+ if (productVersionId !== undefined && productVersionId !== null)
1223
+ url_ += "productVersionId=" + encodeURIComponent("" + productVersionId) + "&";
1224
+ if (tenantId !== undefined && tenantId !== null)
1225
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
1226
+ url_ = url_.replace(/[?&]$/, "");
1227
+ let options_ = {
1228
+ method: "POST",
1229
+ url: url_,
1230
+ headers: {},
1231
+ cancelToken
1232
+ };
1233
+ return this.transformOptions(options_).then(transformedOptions_ => {
1234
+ return this.instance.request(transformedOptions_);
1235
+ }).catch((_error) => {
1236
+ if (isAxiosError(_error) && _error.response) {
1237
+ return _error.response;
1238
+ }
1239
+ else {
1240
+ throw _error;
1241
+ }
1242
+ }).then((_response) => {
1243
+ return this.transformResult(url_, _response, (_response) => this.processUpdateProductVariantResources(_response));
1244
+ });
1245
+ }
1246
+ processUpdateProductVariantResources(response) {
1247
+ const status = response.status;
1248
+ let _headers = {};
1249
+ if (response.headers && typeof response.headers === "object") {
1250
+ for (let k in response.headers) {
1251
+ if (response.headers.hasOwnProperty(k)) {
1252
+ _headers[k] = response.headers[k];
1253
+ }
1254
+ }
1255
+ }
1256
+ if (status === 200) {
1257
+ const _responseText = response.data;
1258
+ return Promise.resolve(null);
1259
+ }
1260
+ else if (status === 404) {
1261
+ const _responseText = response.data;
1262
+ let result404 = null;
1263
+ let resultData404 = _responseText;
1264
+ result404 = JSON.parse(resultData404);
1265
+ return throwException("Not Found", status, _responseText, _headers, result404);
1266
+ }
1267
+ else if (status === 409) {
1268
+ const _responseText = response.data;
1269
+ let result409 = null;
1270
+ let resultData409 = _responseText;
1271
+ result409 = JSON.parse(resultData409);
1272
+ return throwException("Conflict", status, _responseText, _headers, result409);
1273
+ }
1274
+ else if (status === 401) {
1275
+ const _responseText = response.data;
1276
+ return throwException("Unauthorized", status, _responseText, _headers);
1277
+ }
1278
+ else if (status === 403) {
1279
+ const _responseText = response.data;
1280
+ return throwException("Forbidden", status, _responseText, _headers);
1281
+ }
1282
+ else if (status !== 200 && status !== 204) {
1283
+ const _responseText = response.data;
1284
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
1285
+ }
1286
+ return Promise.resolve(null);
1287
+ }
1288
+ /**
1289
+ * Validates product variant resources.
1290
+ * @param id Product identifier.
1291
+ * @param tenantId (optional) Tenant identifier.
1292
+ * @return Success
1293
+ */
1294
+ validateProductVariantResources(id, tenantId, cancelToken) {
1295
+ let url_ = this.baseUrl + "/api/backoffice/v1/products/{id}/validate-variant-resources?";
1296
+ if (id === undefined || id === null)
1297
+ throw new Error("The parameter 'id' must be defined.");
1298
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
1299
+ if (tenantId !== undefined && tenantId !== null)
1300
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
1301
+ url_ = url_.replace(/[?&]$/, "");
1302
+ let options_ = {
1303
+ method: "POST",
1304
+ url: url_,
1305
+ headers: {},
1306
+ cancelToken
1307
+ };
1308
+ return this.transformOptions(options_).then(transformedOptions_ => {
1309
+ return this.instance.request(transformedOptions_);
1310
+ }).catch((_error) => {
1311
+ if (isAxiosError(_error) && _error.response) {
1312
+ return _error.response;
1313
+ }
1314
+ else {
1315
+ throw _error;
1316
+ }
1317
+ }).then((_response) => {
1318
+ return this.transformResult(url_, _response, (_response) => this.processValidateProductVariantResources(_response));
1319
+ });
1320
+ }
1321
+ processValidateProductVariantResources(response) {
1322
+ const status = response.status;
1323
+ let _headers = {};
1324
+ if (response.headers && typeof response.headers === "object") {
1325
+ for (let k in response.headers) {
1326
+ if (response.headers.hasOwnProperty(k)) {
1327
+ _headers[k] = response.headers[k];
1328
+ }
1329
+ }
1330
+ }
1331
+ if (status === 200) {
1332
+ const _responseText = response.data;
1333
+ return Promise.resolve(null);
1334
+ }
1335
+ else if (status === 404) {
1336
+ const _responseText = response.data;
1337
+ let result404 = null;
1338
+ let resultData404 = _responseText;
1339
+ result404 = JSON.parse(resultData404);
1340
+ return throwException("Not Found", status, _responseText, _headers, result404);
1341
+ }
1342
+ else if (status === 409) {
1343
+ const _responseText = response.data;
1344
+ let result409 = null;
1345
+ let resultData409 = _responseText;
1346
+ result409 = JSON.parse(resultData409);
1347
+ return throwException("Conflict", status, _responseText, _headers, result409);
1348
+ }
1349
+ else if (status === 401) {
1350
+ const _responseText = response.data;
1351
+ return throwException("Unauthorized", status, _responseText, _headers);
1352
+ }
1353
+ else if (status === 403) {
1354
+ const _responseText = response.data;
1355
+ return throwException("Forbidden", status, _responseText, _headers);
1356
+ }
1357
+ else if (status !== 200 && status !== 204) {
1358
+ const _responseText = response.data;
1359
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
1360
+ }
1361
+ return Promise.resolve(null);
1362
+ }
1126
1363
  /**
1127
1364
  * Returns a list of product variant designs.
1128
1365
  * @param id Product identifier.
@@ -1549,6 +1786,93 @@ export var BackOfficeApiClient;
1549
1786
  }
1550
1787
  return Promise.resolve(null);
1551
1788
  }
1789
+ /**
1790
+ * Set product variants weight. Variants identifiers will be changed.
1791
+ * @param id Product identifier.
1792
+ * @param tenantId (optional) Tenant identifier.
1793
+ * @param body (optional) Set product variants weight operation parameters.
1794
+ * @return Success
1795
+ */
1796
+ setProductVariantWeight(id, tenantId, body, cancelToken) {
1797
+ let url_ = this.baseUrl + "/api/backoffice/v1/products/{id}/set-variant-weight?";
1798
+ if (id === undefined || id === null)
1799
+ throw new Error("The parameter 'id' must be defined.");
1800
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
1801
+ if (tenantId !== undefined && tenantId !== null)
1802
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
1803
+ url_ = url_.replace(/[?&]$/, "");
1804
+ const content_ = JSON.stringify(body);
1805
+ let options_ = {
1806
+ data: content_,
1807
+ method: "POST",
1808
+ url: url_,
1809
+ headers: {
1810
+ "Content-Type": "application/json",
1811
+ },
1812
+ cancelToken
1813
+ };
1814
+ return this.transformOptions(options_).then(transformedOptions_ => {
1815
+ return this.instance.request(transformedOptions_);
1816
+ }).catch((_error) => {
1817
+ if (isAxiosError(_error) && _error.response) {
1818
+ return _error.response;
1819
+ }
1820
+ else {
1821
+ throw _error;
1822
+ }
1823
+ }).then((_response) => {
1824
+ return this.transformResult(url_, _response, (_response) => this.processSetProductVariantWeight(_response));
1825
+ });
1826
+ }
1827
+ processSetProductVariantWeight(response) {
1828
+ const status = response.status;
1829
+ let _headers = {};
1830
+ if (response.headers && typeof response.headers === "object") {
1831
+ for (let k in response.headers) {
1832
+ if (response.headers.hasOwnProperty(k)) {
1833
+ _headers[k] = response.headers[k];
1834
+ }
1835
+ }
1836
+ }
1837
+ if (status === 200) {
1838
+ const _responseText = response.data;
1839
+ return Promise.resolve(null);
1840
+ }
1841
+ else if (status === 400) {
1842
+ const _responseText = response.data;
1843
+ let result400 = null;
1844
+ let resultData400 = _responseText;
1845
+ result400 = JSON.parse(resultData400);
1846
+ return throwException("Bad Request", status, _responseText, _headers, result400);
1847
+ }
1848
+ else if (status === 404) {
1849
+ const _responseText = response.data;
1850
+ let result404 = null;
1851
+ let resultData404 = _responseText;
1852
+ result404 = JSON.parse(resultData404);
1853
+ return throwException("Not Found", status, _responseText, _headers, result404);
1854
+ }
1855
+ else if (status === 409) {
1856
+ const _responseText = response.data;
1857
+ let result409 = null;
1858
+ let resultData409 = _responseText;
1859
+ result409 = JSON.parse(resultData409);
1860
+ return throwException("Conflict", status, _responseText, _headers, result409);
1861
+ }
1862
+ else if (status === 401) {
1863
+ const _responseText = response.data;
1864
+ return throwException("Unauthorized", status, _responseText, _headers);
1865
+ }
1866
+ else if (status === 403) {
1867
+ const _responseText = response.data;
1868
+ return throwException("Forbidden", status, _responseText, _headers);
1869
+ }
1870
+ else if (status !== 200 && status !== 204) {
1871
+ const _responseText = response.data;
1872
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
1873
+ }
1874
+ return Promise.resolve(null);
1875
+ }
1552
1876
  /**
1553
1877
  * Set product variants availability. Variants identifiers will be changed.
1554
1878
  * @param id Product identifier.