@aurigma/ng-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.
@@ -32,4 +32,4 @@ BackOfficeModule.decorators = [
32
32
  exports: []
33
33
  },] }
34
34
  ];
35
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYmFja29mZmljZS5tb2R1bGUuanMiLCJzb3VyY2VSb290IjoiL2hvbWUvYXVyaWdtYS9hZ2VudHMvQ0NIMDEvX3dvcmsvMi9zL0JhY2tlbmQvc3JjL0JhY2tPZmZpY2UuV2ViLlB1YmxpY0FwaS5UeXBlU2NyaXB0QXBpQ2xpZW50L0FuZ3VsYXIvYXBpLWNsaWVudC9iYWNrb2ZmaWNlLWNsaWVudC9wcm9qZWN0cy9jbGllbnQvc3JjLyIsInNvdXJjZXMiOlsibGliL2JhY2tvZmZpY2UubW9kdWxlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBc0IsUUFBUSxFQUFDLE1BQU0sZUFBZSxDQUFDO0FBQzVELE9BQU8sS0FBSyxtQkFBbUIsTUFBTSx5QkFBeUIsQ0FBQztBQUUvRCxXQUFXO0FBQ1gsTUFBTSxVQUFVLDRCQUE0QixDQUFDLEtBQWEsRUFBRSxNQUFjLEVBQUUsU0FBaUIsUUFBUTtJQUNuRyxNQUFNLE9BQU8sR0FBRyxJQUFJLG1CQUFtQixDQUFDLHNCQUFzQixFQUFFLENBQUM7SUFDakUsT0FBTyxDQUFDLE1BQU0sR0FBRyxNQUFNLENBQUM7SUFDeEIsT0FBTyxDQUFDLE1BQU0sR0FBRyxNQUFNLENBQUM7SUFDeEIsT0FBTyxDQUFDLHFCQUFxQixDQUFDLEtBQUssQ0FBQyxDQUFDO0lBQ3JDLE9BQU8sT0FBTyxDQUFDO0FBQ2pCLENBQUM7QUFRRCxNQUFNLE9BQU8sZ0JBQW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mljZU1vZHVsZSB7XG4gIHN0YXRpYyBmb3JSb290KHRva2VuOiBzdHJpbmcsIGFwaVVybDogc3RyaW5nLCBhcGlLZXk6IHN0cmluZyA9ICdBcGlLZXknKTogTW9kdWxlV2l0aFByb3ZpZGVyczxCYWNrT2ZmaWNlTW9kdWxlPiB7XG4gICAgcmV0dXJuIHtcbiAgICAgIG5nTW9kdWxlOiBCYWNrT2ZmaWNlTW9kdWxlLFxuICAgICAgcHJvdmlkZXJzOiBbXG4gICAgICAgIHtcbiAgICAgICAgICBwcm92aWRlOiBCYWNrT2ZmaWNlQXBpQ2xpZW50LkFQSV9CQVNFX1VSTCxcbiAgICAgICAgICB1c2VWYWx1ZTogYXBpVXJsXG4gICAgICAgIH0sXG4gICAgICAgIHtcbiAgICAgICAgICBwcm92aWRlOiBCYWNrT2ZmaWNlQXBpQ2xpZW50LkFwaUNsaWVudENvbmZpZ3VyYXRpb24sXG4gICAgICAgICAgdXNlRmFjdG9yeTogQ3JlYXRlQXBpQ2xpZW50Q29uZmlndXJhdGlvbi5iaW5kKHRoaXMsIHRva2VuICwgYXBpVXJsLCBhcGlLZXkpXG4gICAgICAgIH0sXG4gICAgICBdXG4gICAgfTtcbiAgfVxufVxuIl19
@@ -3,4 +3,4 @@
3
3
  */
4
4
  export * from './lib/backoffice.module';
5
5
  export * from './lib/backoffice-api-client';
6
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljLWFwaS5qcyIsInNvdXJjZVJvb3QiOiIvaG9tZS9hdXJpZ21hL2FnZW50cy9DQ0gwMS9fd29yay8yL3MvQmFja2VuZC9zcmMvQmFja09mZmljZS5XZWIuUHVibGljQXBpLlR5cGVTY3JpcHRBcGlDbGllbnQvQW5ndWxhci9hcGktY2xpZW50L2JhY2tvZmZpY2UtY2xpZW50L3Byb2plY3RzL2NsaWVudC9zcmMvIiwic291cmNlcyI6WyJwdWJsaWMtYXBpLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBRUgsY0FBYyx5QkFBeUIsQ0FBQztBQUN4QyxjQUFjLDZCQUE2QixDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLypcbiAqIFB1YmxpYyBBUEkgU3VyZmFjZSBvZiBjbGllbnRcbiAqL1xuXG5leHBvcnQgKiBmcm9tICcuL2xpYi9iYWNrb2ZmaWNlLm1vZHVsZSc7XG5leHBvcnQgKiBmcm9tICcuL2xpYi9iYWNrb2ZmaWNlLWFwaS1jbGllbnQnO1xuIl19
6
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljLWFwaS5qcyIsInNvdXJjZVJvb3QiOiIvaG9tZS9hdXJpZ21hL2FnZW50cy9DQ0gwMi9fd29yay8xL3MvQmFja2VuZC9zcmMvQmFja09mZmljZS5XZWIuUHVibGljQXBpLlR5cGVTY3JpcHRBcGlDbGllbnQvQW5ndWxhci9hcGktY2xpZW50L2JhY2tvZmZpY2UtY2xpZW50L3Byb2plY3RzL2NsaWVudC9zcmMvIiwic291cmNlcyI6WyJwdWJsaWMtYXBpLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBRUgsY0FBYyx5QkFBeUIsQ0FBQztBQUN4QyxjQUFjLDZCQUE2QixDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLypcbiAqIFB1YmxpYyBBUEkgU3VyZmFjZSBvZiBjbGllbnRcbiAqL1xuXG5leHBvcnQgKiBmcm9tICcuL2xpYi9iYWNrb2ZmaWNlLm1vZHVsZSc7XG5leHBvcnQgKiBmcm9tICcuL2xpYi9iYWNrb2ZmaWNlLWFwaS1jbGllbnQnO1xuIl19
@@ -1005,6 +1005,96 @@ class ProductsManagementApiClient extends ApiClientBase {
1005
1005
  }
1006
1006
  return of(null);
1007
1007
  }
1008
+ /**
1009
+ * Set product options and returns updated options list.
1010
+ * @param id Product identifier.
1011
+ * @param tenantId (optional) Tenant identifier.
1012
+ * @param body (optional)
1013
+ * @return Success
1014
+ */
1015
+ setProductOptions(id, tenantId, body) {
1016
+ let url_ = this.baseUrl + "/api/backoffice/v1/products/{id}/options?";
1017
+ if (id === undefined || id === null)
1018
+ throw new Error("The parameter 'id' must be defined.");
1019
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
1020
+ if (tenantId !== undefined && tenantId !== null)
1021
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
1022
+ url_ = url_.replace(/[?&]$/, "");
1023
+ const content_ = JSON.stringify(body);
1024
+ let options_ = {
1025
+ body: content_,
1026
+ observe: "response",
1027
+ responseType: "blob",
1028
+ headers: new HttpHeaders({
1029
+ "Content-Type": "application/json",
1030
+ "Accept": "application/json"
1031
+ })
1032
+ };
1033
+ return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
1034
+ return this.http.request("put", url_, transformedOptions_);
1035
+ })).pipe(mergeMap((response_) => {
1036
+ return this.transformResult(url_, response_, (r) => this.processSetProductOptions(r));
1037
+ })).pipe(catchError((response_) => {
1038
+ if (response_ instanceof HttpResponseBase) {
1039
+ try {
1040
+ return this.transformResult(url_, response_, (r) => this.processSetProductOptions(r));
1041
+ }
1042
+ catch (e) {
1043
+ return throwError(e);
1044
+ }
1045
+ }
1046
+ else
1047
+ return throwError(response_);
1048
+ }));
1049
+ }
1050
+ processSetProductOptions(response) {
1051
+ const status = response.status;
1052
+ const responseBlob = response instanceof HttpResponse ? response.body :
1053
+ response.error instanceof Blob ? response.error : undefined;
1054
+ let _headers = {};
1055
+ if (response.headers) {
1056
+ for (let key of response.headers.keys()) {
1057
+ _headers[key] = response.headers.get(key);
1058
+ }
1059
+ }
1060
+ if (status === 200) {
1061
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
1062
+ let result200 = null;
1063
+ result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
1064
+ return of(result200);
1065
+ }));
1066
+ }
1067
+ else if (status === 404) {
1068
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
1069
+ let result404 = null;
1070
+ result404 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
1071
+ return throwException("Not Found", status, _responseText, _headers, result404);
1072
+ }));
1073
+ }
1074
+ else if (status === 409) {
1075
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
1076
+ let result409 = null;
1077
+ result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
1078
+ return throwException("Conflict", status, _responseText, _headers, result409);
1079
+ }));
1080
+ }
1081
+ else if (status === 401) {
1082
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
1083
+ return throwException("Unauthorized", status, _responseText, _headers);
1084
+ }));
1085
+ }
1086
+ else if (status === 403) {
1087
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
1088
+ return throwException("Forbidden", status, _responseText, _headers);
1089
+ }));
1090
+ }
1091
+ else if (status !== 200 && status !== 204) {
1092
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
1093
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
1094
+ }));
1095
+ }
1096
+ return of(null);
1097
+ }
1008
1098
  /**
1009
1099
  * Returns a list of product variants.
1010
1100
  * @param id Product identifier.
@@ -1205,6 +1295,173 @@ class ProductsManagementApiClient extends ApiClientBase {
1205
1295
  }
1206
1296
  return of(null);
1207
1297
  }
1298
+ /**
1299
+ * Updates product variant resources.
1300
+ * @param id Product identifier.
1301
+ * @param productVersionId (optional) Product version identifier.
1302
+ * @param tenantId (optional) Tenant identifier.
1303
+ * @return Success
1304
+ */
1305
+ updateProductVariantResources(id, productVersionId, tenantId) {
1306
+ let url_ = this.baseUrl + "/api/backoffice/v1/products/{id}/update-variant-resources?";
1307
+ if (id === undefined || id === null)
1308
+ throw new Error("The parameter 'id' must be defined.");
1309
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
1310
+ if (productVersionId !== undefined && productVersionId !== null)
1311
+ url_ += "productVersionId=" + encodeURIComponent("" + productVersionId) + "&";
1312
+ if (tenantId !== undefined && tenantId !== null)
1313
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
1314
+ url_ = url_.replace(/[?&]$/, "");
1315
+ let options_ = {
1316
+ observe: "response",
1317
+ responseType: "blob",
1318
+ headers: new HttpHeaders({})
1319
+ };
1320
+ return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
1321
+ return this.http.request("post", url_, transformedOptions_);
1322
+ })).pipe(mergeMap((response_) => {
1323
+ return this.transformResult(url_, response_, (r) => this.processUpdateProductVariantResources(r));
1324
+ })).pipe(catchError((response_) => {
1325
+ if (response_ instanceof HttpResponseBase) {
1326
+ try {
1327
+ return this.transformResult(url_, response_, (r) => this.processUpdateProductVariantResources(r));
1328
+ }
1329
+ catch (e) {
1330
+ return throwError(e);
1331
+ }
1332
+ }
1333
+ else
1334
+ return throwError(response_);
1335
+ }));
1336
+ }
1337
+ processUpdateProductVariantResources(response) {
1338
+ const status = response.status;
1339
+ const responseBlob = response instanceof HttpResponse ? response.body :
1340
+ response.error instanceof Blob ? response.error : undefined;
1341
+ let _headers = {};
1342
+ if (response.headers) {
1343
+ for (let key of response.headers.keys()) {
1344
+ _headers[key] = response.headers.get(key);
1345
+ }
1346
+ }
1347
+ if (status === 200) {
1348
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
1349
+ return of(null);
1350
+ }));
1351
+ }
1352
+ else if (status === 404) {
1353
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
1354
+ let result404 = null;
1355
+ result404 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
1356
+ return throwException("Not Found", status, _responseText, _headers, result404);
1357
+ }));
1358
+ }
1359
+ else if (status === 409) {
1360
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
1361
+ let result409 = null;
1362
+ result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
1363
+ return throwException("Conflict", status, _responseText, _headers, result409);
1364
+ }));
1365
+ }
1366
+ else if (status === 401) {
1367
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
1368
+ return throwException("Unauthorized", status, _responseText, _headers);
1369
+ }));
1370
+ }
1371
+ else if (status === 403) {
1372
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
1373
+ return throwException("Forbidden", status, _responseText, _headers);
1374
+ }));
1375
+ }
1376
+ else if (status !== 200 && status !== 204) {
1377
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
1378
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
1379
+ }));
1380
+ }
1381
+ return of(null);
1382
+ }
1383
+ /**
1384
+ * Validates product variant resources.
1385
+ * @param id Product identifier.
1386
+ * @param tenantId (optional) Tenant identifier.
1387
+ * @return Success
1388
+ */
1389
+ validateProductVariantResources(id, tenantId) {
1390
+ let url_ = this.baseUrl + "/api/backoffice/v1/products/{id}/validate-variant-resources?";
1391
+ if (id === undefined || id === null)
1392
+ throw new Error("The parameter 'id' must be defined.");
1393
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
1394
+ if (tenantId !== undefined && tenantId !== null)
1395
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
1396
+ url_ = url_.replace(/[?&]$/, "");
1397
+ let options_ = {
1398
+ observe: "response",
1399
+ responseType: "blob",
1400
+ headers: new HttpHeaders({})
1401
+ };
1402
+ return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
1403
+ return this.http.request("post", url_, transformedOptions_);
1404
+ })).pipe(mergeMap((response_) => {
1405
+ return this.transformResult(url_, response_, (r) => this.processValidateProductVariantResources(r));
1406
+ })).pipe(catchError((response_) => {
1407
+ if (response_ instanceof HttpResponseBase) {
1408
+ try {
1409
+ return this.transformResult(url_, response_, (r) => this.processValidateProductVariantResources(r));
1410
+ }
1411
+ catch (e) {
1412
+ return throwError(e);
1413
+ }
1414
+ }
1415
+ else
1416
+ return throwError(response_);
1417
+ }));
1418
+ }
1419
+ processValidateProductVariantResources(response) {
1420
+ const status = response.status;
1421
+ const responseBlob = response instanceof HttpResponse ? response.body :
1422
+ response.error instanceof Blob ? response.error : undefined;
1423
+ let _headers = {};
1424
+ if (response.headers) {
1425
+ for (let key of response.headers.keys()) {
1426
+ _headers[key] = response.headers.get(key);
1427
+ }
1428
+ }
1429
+ if (status === 200) {
1430
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
1431
+ return of(null);
1432
+ }));
1433
+ }
1434
+ else if (status === 404) {
1435
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
1436
+ let result404 = null;
1437
+ result404 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
1438
+ return throwException("Not Found", status, _responseText, _headers, result404);
1439
+ }));
1440
+ }
1441
+ else if (status === 409) {
1442
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
1443
+ let result409 = null;
1444
+ result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
1445
+ return throwException("Conflict", status, _responseText, _headers, result409);
1446
+ }));
1447
+ }
1448
+ else if (status === 401) {
1449
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
1450
+ return throwException("Unauthorized", status, _responseText, _headers);
1451
+ }));
1452
+ }
1453
+ else if (status === 403) {
1454
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
1455
+ return throwException("Forbidden", status, _responseText, _headers);
1456
+ }));
1457
+ }
1458
+ else if (status !== 200 && status !== 204) {
1459
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
1460
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
1461
+ }));
1462
+ }
1463
+ return of(null);
1464
+ }
1208
1465
  /**
1209
1466
  * Returns a list of product variant designs.
1210
1467
  * @param id Product identifier.
@@ -1656,6 +1913,100 @@ class ProductsManagementApiClient extends ApiClientBase {
1656
1913
  }
1657
1914
  return of(null);
1658
1915
  }
1916
+ /**
1917
+ * Set product variants weight. Variants identifiers will be changed.
1918
+ * @param id Product identifier.
1919
+ * @param tenantId (optional) Tenant identifier.
1920
+ * @param body (optional) Set product variants weight operation parameters.
1921
+ * @return Success
1922
+ */
1923
+ setProductVariantWeight(id, tenantId, body) {
1924
+ let url_ = this.baseUrl + "/api/backoffice/v1/products/{id}/set-variant-weight?";
1925
+ if (id === undefined || id === null)
1926
+ throw new Error("The parameter 'id' must be defined.");
1927
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
1928
+ if (tenantId !== undefined && tenantId !== null)
1929
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
1930
+ url_ = url_.replace(/[?&]$/, "");
1931
+ const content_ = JSON.stringify(body);
1932
+ let options_ = {
1933
+ body: content_,
1934
+ observe: "response",
1935
+ responseType: "blob",
1936
+ headers: new HttpHeaders({
1937
+ "Content-Type": "application/json",
1938
+ })
1939
+ };
1940
+ return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
1941
+ return this.http.request("post", url_, transformedOptions_);
1942
+ })).pipe(mergeMap((response_) => {
1943
+ return this.transformResult(url_, response_, (r) => this.processSetProductVariantWeight(r));
1944
+ })).pipe(catchError((response_) => {
1945
+ if (response_ instanceof HttpResponseBase) {
1946
+ try {
1947
+ return this.transformResult(url_, response_, (r) => this.processSetProductVariantWeight(r));
1948
+ }
1949
+ catch (e) {
1950
+ return throwError(e);
1951
+ }
1952
+ }
1953
+ else
1954
+ return throwError(response_);
1955
+ }));
1956
+ }
1957
+ processSetProductVariantWeight(response) {
1958
+ const status = response.status;
1959
+ const responseBlob = response instanceof HttpResponse ? response.body :
1960
+ response.error instanceof Blob ? response.error : undefined;
1961
+ let _headers = {};
1962
+ if (response.headers) {
1963
+ for (let key of response.headers.keys()) {
1964
+ _headers[key] = response.headers.get(key);
1965
+ }
1966
+ }
1967
+ if (status === 200) {
1968
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
1969
+ return of(null);
1970
+ }));
1971
+ }
1972
+ else if (status === 400) {
1973
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
1974
+ let result400 = null;
1975
+ result400 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
1976
+ return throwException("Bad Request", status, _responseText, _headers, result400);
1977
+ }));
1978
+ }
1979
+ else if (status === 404) {
1980
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
1981
+ let result404 = null;
1982
+ result404 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
1983
+ return throwException("Not Found", status, _responseText, _headers, result404);
1984
+ }));
1985
+ }
1986
+ else if (status === 409) {
1987
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
1988
+ let result409 = null;
1989
+ result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
1990
+ return throwException("Conflict", status, _responseText, _headers, result409);
1991
+ }));
1992
+ }
1993
+ else if (status === 401) {
1994
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
1995
+ return throwException("Unauthorized", status, _responseText, _headers);
1996
+ }));
1997
+ }
1998
+ else if (status === 403) {
1999
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
2000
+ return throwException("Forbidden", status, _responseText, _headers);
2001
+ }));
2002
+ }
2003
+ else if (status !== 200 && status !== 204) {
2004
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
2005
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
2006
+ }));
2007
+ }
2008
+ return of(null);
2009
+ }
1659
2010
  /**
1660
2011
  * Set product variants availability. Variants identifiers will be changed.
1661
2012
  * @param id Product identifier.