@aurigma/axios-storefront-api-client 2.46.4 → 2.49.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/storefront-api-client.d.ts +122 -40
- package/dist/cjs/storefront-api-client.js +200 -82
- package/dist/cjs/storefront-api-client.js.map +1 -1
- package/dist/esm/storefront-api-client.d.ts +122 -40
- package/dist/esm/storefront-api-client.js +200 -82
- package/dist/esm/storefront-api-client.js.map +1 -1
- package/package.json +1 -1
|
@@ -1377,84 +1377,6 @@ export class ProjectsApiClient extends ApiClientBase {
|
|
|
1377
1377
|
}
|
|
1378
1378
|
return Promise.resolve(null);
|
|
1379
1379
|
}
|
|
1380
|
-
/**
|
|
1381
|
-
* Creates a new project.
|
|
1382
|
-
* @param storefrontId Storefront identifier.
|
|
1383
|
-
* @param tenantId (optional) Tenant identifier.
|
|
1384
|
-
* @param body (optional) Create operation parameters.
|
|
1385
|
-
* @return Success
|
|
1386
|
-
*/
|
|
1387
|
-
create(storefrontId, tenantId, body, cancelToken) {
|
|
1388
|
-
let url_ = this.baseUrl + "/api/storefront/v1/projects?";
|
|
1389
|
-
if (storefrontId === undefined || storefrontId === null)
|
|
1390
|
-
throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
|
|
1391
|
-
else
|
|
1392
|
-
url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
|
|
1393
|
-
if (tenantId !== undefined && tenantId !== null)
|
|
1394
|
-
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
1395
|
-
url_ = url_.replace(/[?&]$/, "");
|
|
1396
|
-
const content_ = JSON.stringify(body);
|
|
1397
|
-
let options_ = {
|
|
1398
|
-
data: content_,
|
|
1399
|
-
method: "POST",
|
|
1400
|
-
url: url_,
|
|
1401
|
-
headers: {
|
|
1402
|
-
"Content-Type": "application/json-patch+json",
|
|
1403
|
-
"Accept": "text/plain"
|
|
1404
|
-
},
|
|
1405
|
-
cancelToken
|
|
1406
|
-
};
|
|
1407
|
-
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
1408
|
-
return this.instance.request(transformedOptions_);
|
|
1409
|
-
}).catch((_error) => {
|
|
1410
|
-
if (isAxiosError(_error) && _error.response) {
|
|
1411
|
-
return _error.response;
|
|
1412
|
-
}
|
|
1413
|
-
else {
|
|
1414
|
-
throw _error;
|
|
1415
|
-
}
|
|
1416
|
-
}).then((_response) => {
|
|
1417
|
-
return this.transformResult(url_, _response, (_response) => this.processCreate(_response));
|
|
1418
|
-
});
|
|
1419
|
-
}
|
|
1420
|
-
processCreate(response) {
|
|
1421
|
-
const status = response.status;
|
|
1422
|
-
let _headers = {};
|
|
1423
|
-
if (response.headers && typeof response.headers === "object") {
|
|
1424
|
-
for (let k in response.headers) {
|
|
1425
|
-
if (response.headers.hasOwnProperty(k)) {
|
|
1426
|
-
_headers[k] = response.headers[k];
|
|
1427
|
-
}
|
|
1428
|
-
}
|
|
1429
|
-
}
|
|
1430
|
-
if (status === 201) {
|
|
1431
|
-
const _responseText = response.data;
|
|
1432
|
-
let result201 = null;
|
|
1433
|
-
let resultData201 = _responseText;
|
|
1434
|
-
result201 = JSON.parse(resultData201);
|
|
1435
|
-
return Promise.resolve(result201);
|
|
1436
|
-
}
|
|
1437
|
-
else if (status === 409) {
|
|
1438
|
-
const _responseText = response.data;
|
|
1439
|
-
let result409 = null;
|
|
1440
|
-
let resultData409 = _responseText;
|
|
1441
|
-
result409 = JSON.parse(resultData409);
|
|
1442
|
-
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
1443
|
-
}
|
|
1444
|
-
else if (status === 401) {
|
|
1445
|
-
const _responseText = response.data;
|
|
1446
|
-
return throwException("Unauthorized", status, _responseText, _headers);
|
|
1447
|
-
}
|
|
1448
|
-
else if (status === 403) {
|
|
1449
|
-
const _responseText = response.data;
|
|
1450
|
-
return throwException("Forbidden", status, _responseText, _headers);
|
|
1451
|
-
}
|
|
1452
|
-
else if (status !== 200 && status !== 204) {
|
|
1453
|
-
const _responseText = response.data;
|
|
1454
|
-
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
1455
|
-
}
|
|
1456
|
-
return Promise.resolve(null);
|
|
1457
|
-
}
|
|
1458
1380
|
/**
|
|
1459
1381
|
* Returns a project by identifier.
|
|
1460
1382
|
* @param id Project identifier.
|
|
@@ -1742,6 +1664,176 @@ export class ProjectsApiClient extends ApiClientBase {
|
|
|
1742
1664
|
}
|
|
1743
1665
|
return Promise.resolve(null);
|
|
1744
1666
|
}
|
|
1667
|
+
/**
|
|
1668
|
+
* Creates a new project with single item.
|
|
1669
|
+
* @param storefrontId Storefront identifier.
|
|
1670
|
+
* @param tenantId (optional) Tenant identifier.
|
|
1671
|
+
* @param body (optional) Create operation parameters.
|
|
1672
|
+
* @return Success
|
|
1673
|
+
*/
|
|
1674
|
+
createWithSingleItem(storefrontId, tenantId, body, cancelToken) {
|
|
1675
|
+
let url_ = this.baseUrl + "/api/storefront/v1/projects/with-single-item?";
|
|
1676
|
+
if (storefrontId === undefined || storefrontId === null)
|
|
1677
|
+
throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
|
|
1678
|
+
else
|
|
1679
|
+
url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
|
|
1680
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
1681
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
1682
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
1683
|
+
const content_ = JSON.stringify(body);
|
|
1684
|
+
let options_ = {
|
|
1685
|
+
data: content_,
|
|
1686
|
+
method: "POST",
|
|
1687
|
+
url: url_,
|
|
1688
|
+
headers: {
|
|
1689
|
+
"Content-Type": "application/json-patch+json",
|
|
1690
|
+
"Accept": "text/plain"
|
|
1691
|
+
},
|
|
1692
|
+
cancelToken
|
|
1693
|
+
};
|
|
1694
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
1695
|
+
return this.instance.request(transformedOptions_);
|
|
1696
|
+
}).catch((_error) => {
|
|
1697
|
+
if (isAxiosError(_error) && _error.response) {
|
|
1698
|
+
return _error.response;
|
|
1699
|
+
}
|
|
1700
|
+
else {
|
|
1701
|
+
throw _error;
|
|
1702
|
+
}
|
|
1703
|
+
}).then((_response) => {
|
|
1704
|
+
return this.transformResult(url_, _response, (_response) => this.processCreateWithSingleItem(_response));
|
|
1705
|
+
});
|
|
1706
|
+
}
|
|
1707
|
+
processCreateWithSingleItem(response) {
|
|
1708
|
+
const status = response.status;
|
|
1709
|
+
let _headers = {};
|
|
1710
|
+
if (response.headers && typeof response.headers === "object") {
|
|
1711
|
+
for (let k in response.headers) {
|
|
1712
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
1713
|
+
_headers[k] = response.headers[k];
|
|
1714
|
+
}
|
|
1715
|
+
}
|
|
1716
|
+
}
|
|
1717
|
+
if (status === 201) {
|
|
1718
|
+
const _responseText = response.data;
|
|
1719
|
+
let result201 = null;
|
|
1720
|
+
let resultData201 = _responseText;
|
|
1721
|
+
result201 = JSON.parse(resultData201);
|
|
1722
|
+
return Promise.resolve(result201);
|
|
1723
|
+
}
|
|
1724
|
+
else if (status === 400) {
|
|
1725
|
+
const _responseText = response.data;
|
|
1726
|
+
let result400 = null;
|
|
1727
|
+
let resultData400 = _responseText;
|
|
1728
|
+
result400 = JSON.parse(resultData400);
|
|
1729
|
+
return throwException("Bad Request", status, _responseText, _headers, result400);
|
|
1730
|
+
}
|
|
1731
|
+
else if (status === 409) {
|
|
1732
|
+
const _responseText = response.data;
|
|
1733
|
+
let result409 = null;
|
|
1734
|
+
let resultData409 = _responseText;
|
|
1735
|
+
result409 = JSON.parse(resultData409);
|
|
1736
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
1737
|
+
}
|
|
1738
|
+
else if (status === 401) {
|
|
1739
|
+
const _responseText = response.data;
|
|
1740
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
1741
|
+
}
|
|
1742
|
+
else if (status === 403) {
|
|
1743
|
+
const _responseText = response.data;
|
|
1744
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
1745
|
+
}
|
|
1746
|
+
else if (status !== 200 && status !== 204) {
|
|
1747
|
+
const _responseText = response.data;
|
|
1748
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
1749
|
+
}
|
|
1750
|
+
return Promise.resolve(null);
|
|
1751
|
+
}
|
|
1752
|
+
/**
|
|
1753
|
+
* Creates a new project with multiple items.
|
|
1754
|
+
* @param storefrontId Storefront identifier.
|
|
1755
|
+
* @param tenantId (optional) Tenant identifier.
|
|
1756
|
+
* @param body (optional) Create operation parameters.
|
|
1757
|
+
* @return Success
|
|
1758
|
+
*/
|
|
1759
|
+
createWithMultipleItems(storefrontId, tenantId, body, cancelToken) {
|
|
1760
|
+
let url_ = this.baseUrl + "/api/storefront/v1/projects/with-multiple-items?";
|
|
1761
|
+
if (storefrontId === undefined || storefrontId === null)
|
|
1762
|
+
throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
|
|
1763
|
+
else
|
|
1764
|
+
url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
|
|
1765
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
1766
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
1767
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
1768
|
+
const content_ = JSON.stringify(body);
|
|
1769
|
+
let options_ = {
|
|
1770
|
+
data: content_,
|
|
1771
|
+
method: "POST",
|
|
1772
|
+
url: url_,
|
|
1773
|
+
headers: {
|
|
1774
|
+
"Content-Type": "application/json-patch+json",
|
|
1775
|
+
"Accept": "text/plain"
|
|
1776
|
+
},
|
|
1777
|
+
cancelToken
|
|
1778
|
+
};
|
|
1779
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
1780
|
+
return this.instance.request(transformedOptions_);
|
|
1781
|
+
}).catch((_error) => {
|
|
1782
|
+
if (isAxiosError(_error) && _error.response) {
|
|
1783
|
+
return _error.response;
|
|
1784
|
+
}
|
|
1785
|
+
else {
|
|
1786
|
+
throw _error;
|
|
1787
|
+
}
|
|
1788
|
+
}).then((_response) => {
|
|
1789
|
+
return this.transformResult(url_, _response, (_response) => this.processCreateWithMultipleItems(_response));
|
|
1790
|
+
});
|
|
1791
|
+
}
|
|
1792
|
+
processCreateWithMultipleItems(response) {
|
|
1793
|
+
const status = response.status;
|
|
1794
|
+
let _headers = {};
|
|
1795
|
+
if (response.headers && typeof response.headers === "object") {
|
|
1796
|
+
for (let k in response.headers) {
|
|
1797
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
1798
|
+
_headers[k] = response.headers[k];
|
|
1799
|
+
}
|
|
1800
|
+
}
|
|
1801
|
+
}
|
|
1802
|
+
if (status === 201) {
|
|
1803
|
+
const _responseText = response.data;
|
|
1804
|
+
let result201 = null;
|
|
1805
|
+
let resultData201 = _responseText;
|
|
1806
|
+
result201 = JSON.parse(resultData201);
|
|
1807
|
+
return Promise.resolve(result201);
|
|
1808
|
+
}
|
|
1809
|
+
else if (status === 400) {
|
|
1810
|
+
const _responseText = response.data;
|
|
1811
|
+
let result400 = null;
|
|
1812
|
+
let resultData400 = _responseText;
|
|
1813
|
+
result400 = JSON.parse(resultData400);
|
|
1814
|
+
return throwException("Bad Request", status, _responseText, _headers, result400);
|
|
1815
|
+
}
|
|
1816
|
+
else if (status === 409) {
|
|
1817
|
+
const _responseText = response.data;
|
|
1818
|
+
let result409 = null;
|
|
1819
|
+
let resultData409 = _responseText;
|
|
1820
|
+
result409 = JSON.parse(resultData409);
|
|
1821
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
1822
|
+
}
|
|
1823
|
+
else if (status === 401) {
|
|
1824
|
+
const _responseText = response.data;
|
|
1825
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
1826
|
+
}
|
|
1827
|
+
else if (status === 403) {
|
|
1828
|
+
const _responseText = response.data;
|
|
1829
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
1830
|
+
}
|
|
1831
|
+
else if (status !== 200 && status !== 204) {
|
|
1832
|
+
const _responseText = response.data;
|
|
1833
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
1834
|
+
}
|
|
1835
|
+
return Promise.resolve(null);
|
|
1836
|
+
}
|
|
1745
1837
|
/**
|
|
1746
1838
|
* Creates a new project by 'Render HiRes' scenario.
|
|
1747
1839
|
* @param storefrontId Storefront identifier.
|
|
@@ -1799,6 +1891,13 @@ export class ProjectsApiClient extends ApiClientBase {
|
|
|
1799
1891
|
result201 = JSON.parse(resultData201);
|
|
1800
1892
|
return Promise.resolve(result201);
|
|
1801
1893
|
}
|
|
1894
|
+
else if (status === 400) {
|
|
1895
|
+
const _responseText = response.data;
|
|
1896
|
+
let result400 = null;
|
|
1897
|
+
let resultData400 = _responseText;
|
|
1898
|
+
result400 = JSON.parse(resultData400);
|
|
1899
|
+
return throwException("Bad Request", status, _responseText, _headers, result400);
|
|
1900
|
+
}
|
|
1802
1901
|
else if (status === 409) {
|
|
1803
1902
|
const _responseText = response.data;
|
|
1804
1903
|
let result409 = null;
|
|
@@ -1877,6 +1976,13 @@ export class ProjectsApiClient extends ApiClientBase {
|
|
|
1877
1976
|
result201 = JSON.parse(resultData201);
|
|
1878
1977
|
return Promise.resolve(result201);
|
|
1879
1978
|
}
|
|
1979
|
+
else if (status === 400) {
|
|
1980
|
+
const _responseText = response.data;
|
|
1981
|
+
let result400 = null;
|
|
1982
|
+
let resultData400 = _responseText;
|
|
1983
|
+
result400 = JSON.parse(resultData400);
|
|
1984
|
+
return throwException("Bad Request", status, _responseText, _headers, result400);
|
|
1985
|
+
}
|
|
1880
1986
|
else if (status === 409) {
|
|
1881
1987
|
const _responseText = response.data;
|
|
1882
1988
|
let result409 = null;
|
|
@@ -2451,14 +2557,17 @@ export class ProjectsApiClient extends ApiClientBase {
|
|
|
2451
2557
|
/**
|
|
2452
2558
|
* Returns a project processing results.
|
|
2453
2559
|
* @param id Project identifier.
|
|
2560
|
+
* @param itemId (optional) Project item identifier.
|
|
2454
2561
|
* @param tenantId (optional) Tenant identifier.
|
|
2455
2562
|
* @return Success
|
|
2456
2563
|
*/
|
|
2457
|
-
getProjectProcessingResults(id, tenantId, cancelToken) {
|
|
2564
|
+
getProjectProcessingResults(id, itemId, tenantId, cancelToken) {
|
|
2458
2565
|
let url_ = this.baseUrl + "/api/storefront/v1/projects/{id}/processing-results?";
|
|
2459
2566
|
if (id === undefined || id === null)
|
|
2460
2567
|
throw new Error("The parameter 'id' must be defined.");
|
|
2461
2568
|
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
2569
|
+
if (itemId !== undefined && itemId !== null)
|
|
2570
|
+
url_ += "itemId=" + encodeURIComponent("" + itemId) + "&";
|
|
2462
2571
|
if (tenantId !== undefined && tenantId !== null)
|
|
2463
2572
|
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2464
2573
|
url_ = url_.replace(/[?&]$/, "");
|
|
@@ -2524,14 +2633,17 @@ export class ProjectsApiClient extends ApiClientBase {
|
|
|
2524
2633
|
/**
|
|
2525
2634
|
* Resumes project processing.
|
|
2526
2635
|
* @param id Project identifier.
|
|
2636
|
+
* @param itemId (optional) Project item identifier. If value is set, only specified item processing will be resumed.
|
|
2527
2637
|
* @param tenantId (optional) Tenant identifier.
|
|
2528
2638
|
* @return Success
|
|
2529
2639
|
*/
|
|
2530
|
-
resumeProjectProcessing(id, tenantId, cancelToken) {
|
|
2640
|
+
resumeProjectProcessing(id, itemId, tenantId, cancelToken) {
|
|
2531
2641
|
let url_ = this.baseUrl + "/api/storefront/v1/projects/{id}/resume-processing?";
|
|
2532
2642
|
if (id === undefined || id === null)
|
|
2533
2643
|
throw new Error("The parameter 'id' must be defined.");
|
|
2534
2644
|
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
2645
|
+
if (itemId !== undefined && itemId !== null)
|
|
2646
|
+
url_ += "itemId=" + encodeURIComponent("" + itemId) + "&";
|
|
2535
2647
|
if (tenantId !== undefined && tenantId !== null)
|
|
2536
2648
|
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2537
2649
|
url_ = url_.replace(/[?&]$/, "");
|
|
@@ -2592,14 +2704,17 @@ export class ProjectsApiClient extends ApiClientBase {
|
|
|
2592
2704
|
/**
|
|
2593
2705
|
* Restarts a project processing routine.
|
|
2594
2706
|
* @param id Project identifier.
|
|
2707
|
+
* @param itemId (optional) Project item identifier. If value is set, only specified item processing will be restarted.
|
|
2595
2708
|
* @param tenantId (optional) Tenant identifier.
|
|
2596
2709
|
* @return Success
|
|
2597
2710
|
*/
|
|
2598
|
-
restartProjectProcessing(id, tenantId, cancelToken) {
|
|
2711
|
+
restartProjectProcessing(id, itemId, tenantId, cancelToken) {
|
|
2599
2712
|
let url_ = this.baseUrl + "/api/storefront/v1/projects/{id}/restart-processing?";
|
|
2600
2713
|
if (id === undefined || id === null)
|
|
2601
2714
|
throw new Error("The parameter 'id' must be defined.");
|
|
2602
2715
|
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
2716
|
+
if (itemId !== undefined && itemId !== null)
|
|
2717
|
+
url_ += "itemId=" + encodeURIComponent("" + itemId) + "&";
|
|
2603
2718
|
if (tenantId !== undefined && tenantId !== null)
|
|
2604
2719
|
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2605
2720
|
url_ = url_.replace(/[?&]$/, "");
|
|
@@ -2733,15 +2848,18 @@ export class ProjectsApiClient extends ApiClientBase {
|
|
|
2733
2848
|
/**
|
|
2734
2849
|
* Attachs the specified data to the project's order in ecommerce system.
|
|
2735
2850
|
* @param id Project identifier.
|
|
2851
|
+
* @param itemId (optional)
|
|
2736
2852
|
* @param tenantId (optional) Tenant identifier.
|
|
2737
2853
|
* @param body (optional) A list of data items, which should be attached to project's order.
|
|
2738
2854
|
* @return Success
|
|
2739
2855
|
*/
|
|
2740
|
-
attachDataToProjectOrder(id, tenantId, body, cancelToken) {
|
|
2856
|
+
attachDataToProjectOrder(id, itemId, tenantId, body, cancelToken) {
|
|
2741
2857
|
let url_ = this.baseUrl + "/api/storefront/v1/projects/{id}/order-data?";
|
|
2742
2858
|
if (id === undefined || id === null)
|
|
2743
2859
|
throw new Error("The parameter 'id' must be defined.");
|
|
2744
2860
|
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
2861
|
+
if (itemId !== undefined && itemId !== null)
|
|
2862
|
+
url_ += "itemId=" + encodeURIComponent("" + itemId) + "&";
|
|
2745
2863
|
if (tenantId !== undefined && tenantId !== null)
|
|
2746
2864
|
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2747
2865
|
url_ = url_.replace(/[?&]$/, "");
|