@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
|
@@ -1386,84 +1386,6 @@ class ProjectsApiClient extends ApiClientBase {
|
|
|
1386
1386
|
}
|
|
1387
1387
|
return Promise.resolve(null);
|
|
1388
1388
|
}
|
|
1389
|
-
/**
|
|
1390
|
-
* Creates a new project.
|
|
1391
|
-
* @param storefrontId Storefront identifier.
|
|
1392
|
-
* @param tenantId (optional) Tenant identifier.
|
|
1393
|
-
* @param body (optional) Create operation parameters.
|
|
1394
|
-
* @return Success
|
|
1395
|
-
*/
|
|
1396
|
-
create(storefrontId, tenantId, body, cancelToken) {
|
|
1397
|
-
let url_ = this.baseUrl + "/api/storefront/v1/projects?";
|
|
1398
|
-
if (storefrontId === undefined || storefrontId === null)
|
|
1399
|
-
throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
|
|
1400
|
-
else
|
|
1401
|
-
url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
|
|
1402
|
-
if (tenantId !== undefined && tenantId !== null)
|
|
1403
|
-
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
1404
|
-
url_ = url_.replace(/[?&]$/, "");
|
|
1405
|
-
const content_ = JSON.stringify(body);
|
|
1406
|
-
let options_ = {
|
|
1407
|
-
data: content_,
|
|
1408
|
-
method: "POST",
|
|
1409
|
-
url: url_,
|
|
1410
|
-
headers: {
|
|
1411
|
-
"Content-Type": "application/json-patch+json",
|
|
1412
|
-
"Accept": "text/plain"
|
|
1413
|
-
},
|
|
1414
|
-
cancelToken
|
|
1415
|
-
};
|
|
1416
|
-
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
1417
|
-
return this.instance.request(transformedOptions_);
|
|
1418
|
-
}).catch((_error) => {
|
|
1419
|
-
if (isAxiosError(_error) && _error.response) {
|
|
1420
|
-
return _error.response;
|
|
1421
|
-
}
|
|
1422
|
-
else {
|
|
1423
|
-
throw _error;
|
|
1424
|
-
}
|
|
1425
|
-
}).then((_response) => {
|
|
1426
|
-
return this.transformResult(url_, _response, (_response) => this.processCreate(_response));
|
|
1427
|
-
});
|
|
1428
|
-
}
|
|
1429
|
-
processCreate(response) {
|
|
1430
|
-
const status = response.status;
|
|
1431
|
-
let _headers = {};
|
|
1432
|
-
if (response.headers && typeof response.headers === "object") {
|
|
1433
|
-
for (let k in response.headers) {
|
|
1434
|
-
if (response.headers.hasOwnProperty(k)) {
|
|
1435
|
-
_headers[k] = response.headers[k];
|
|
1436
|
-
}
|
|
1437
|
-
}
|
|
1438
|
-
}
|
|
1439
|
-
if (status === 201) {
|
|
1440
|
-
const _responseText = response.data;
|
|
1441
|
-
let result201 = null;
|
|
1442
|
-
let resultData201 = _responseText;
|
|
1443
|
-
result201 = JSON.parse(resultData201);
|
|
1444
|
-
return Promise.resolve(result201);
|
|
1445
|
-
}
|
|
1446
|
-
else if (status === 409) {
|
|
1447
|
-
const _responseText = response.data;
|
|
1448
|
-
let result409 = null;
|
|
1449
|
-
let resultData409 = _responseText;
|
|
1450
|
-
result409 = JSON.parse(resultData409);
|
|
1451
|
-
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
1452
|
-
}
|
|
1453
|
-
else if (status === 401) {
|
|
1454
|
-
const _responseText = response.data;
|
|
1455
|
-
return throwException("Unauthorized", status, _responseText, _headers);
|
|
1456
|
-
}
|
|
1457
|
-
else if (status === 403) {
|
|
1458
|
-
const _responseText = response.data;
|
|
1459
|
-
return throwException("Forbidden", status, _responseText, _headers);
|
|
1460
|
-
}
|
|
1461
|
-
else if (status !== 200 && status !== 204) {
|
|
1462
|
-
const _responseText = response.data;
|
|
1463
|
-
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
1464
|
-
}
|
|
1465
|
-
return Promise.resolve(null);
|
|
1466
|
-
}
|
|
1467
1389
|
/**
|
|
1468
1390
|
* Returns a project by identifier.
|
|
1469
1391
|
* @param id Project identifier.
|
|
@@ -1751,6 +1673,176 @@ class ProjectsApiClient extends ApiClientBase {
|
|
|
1751
1673
|
}
|
|
1752
1674
|
return Promise.resolve(null);
|
|
1753
1675
|
}
|
|
1676
|
+
/**
|
|
1677
|
+
* Creates a new project with single item.
|
|
1678
|
+
* @param storefrontId Storefront identifier.
|
|
1679
|
+
* @param tenantId (optional) Tenant identifier.
|
|
1680
|
+
* @param body (optional) Create operation parameters.
|
|
1681
|
+
* @return Success
|
|
1682
|
+
*/
|
|
1683
|
+
createWithSingleItem(storefrontId, tenantId, body, cancelToken) {
|
|
1684
|
+
let url_ = this.baseUrl + "/api/storefront/v1/projects/with-single-item?";
|
|
1685
|
+
if (storefrontId === undefined || storefrontId === null)
|
|
1686
|
+
throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
|
|
1687
|
+
else
|
|
1688
|
+
url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
|
|
1689
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
1690
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
1691
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
1692
|
+
const content_ = JSON.stringify(body);
|
|
1693
|
+
let options_ = {
|
|
1694
|
+
data: content_,
|
|
1695
|
+
method: "POST",
|
|
1696
|
+
url: url_,
|
|
1697
|
+
headers: {
|
|
1698
|
+
"Content-Type": "application/json-patch+json",
|
|
1699
|
+
"Accept": "text/plain"
|
|
1700
|
+
},
|
|
1701
|
+
cancelToken
|
|
1702
|
+
};
|
|
1703
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
1704
|
+
return this.instance.request(transformedOptions_);
|
|
1705
|
+
}).catch((_error) => {
|
|
1706
|
+
if (isAxiosError(_error) && _error.response) {
|
|
1707
|
+
return _error.response;
|
|
1708
|
+
}
|
|
1709
|
+
else {
|
|
1710
|
+
throw _error;
|
|
1711
|
+
}
|
|
1712
|
+
}).then((_response) => {
|
|
1713
|
+
return this.transformResult(url_, _response, (_response) => this.processCreateWithSingleItem(_response));
|
|
1714
|
+
});
|
|
1715
|
+
}
|
|
1716
|
+
processCreateWithSingleItem(response) {
|
|
1717
|
+
const status = response.status;
|
|
1718
|
+
let _headers = {};
|
|
1719
|
+
if (response.headers && typeof response.headers === "object") {
|
|
1720
|
+
for (let k in response.headers) {
|
|
1721
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
1722
|
+
_headers[k] = response.headers[k];
|
|
1723
|
+
}
|
|
1724
|
+
}
|
|
1725
|
+
}
|
|
1726
|
+
if (status === 201) {
|
|
1727
|
+
const _responseText = response.data;
|
|
1728
|
+
let result201 = null;
|
|
1729
|
+
let resultData201 = _responseText;
|
|
1730
|
+
result201 = JSON.parse(resultData201);
|
|
1731
|
+
return Promise.resolve(result201);
|
|
1732
|
+
}
|
|
1733
|
+
else if (status === 400) {
|
|
1734
|
+
const _responseText = response.data;
|
|
1735
|
+
let result400 = null;
|
|
1736
|
+
let resultData400 = _responseText;
|
|
1737
|
+
result400 = JSON.parse(resultData400);
|
|
1738
|
+
return throwException("Bad Request", status, _responseText, _headers, result400);
|
|
1739
|
+
}
|
|
1740
|
+
else if (status === 409) {
|
|
1741
|
+
const _responseText = response.data;
|
|
1742
|
+
let result409 = null;
|
|
1743
|
+
let resultData409 = _responseText;
|
|
1744
|
+
result409 = JSON.parse(resultData409);
|
|
1745
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
1746
|
+
}
|
|
1747
|
+
else if (status === 401) {
|
|
1748
|
+
const _responseText = response.data;
|
|
1749
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
1750
|
+
}
|
|
1751
|
+
else if (status === 403) {
|
|
1752
|
+
const _responseText = response.data;
|
|
1753
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
1754
|
+
}
|
|
1755
|
+
else if (status !== 200 && status !== 204) {
|
|
1756
|
+
const _responseText = response.data;
|
|
1757
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
1758
|
+
}
|
|
1759
|
+
return Promise.resolve(null);
|
|
1760
|
+
}
|
|
1761
|
+
/**
|
|
1762
|
+
* Creates a new project with multiple items.
|
|
1763
|
+
* @param storefrontId Storefront identifier.
|
|
1764
|
+
* @param tenantId (optional) Tenant identifier.
|
|
1765
|
+
* @param body (optional) Create operation parameters.
|
|
1766
|
+
* @return Success
|
|
1767
|
+
*/
|
|
1768
|
+
createWithMultipleItems(storefrontId, tenantId, body, cancelToken) {
|
|
1769
|
+
let url_ = this.baseUrl + "/api/storefront/v1/projects/with-multiple-items?";
|
|
1770
|
+
if (storefrontId === undefined || storefrontId === null)
|
|
1771
|
+
throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
|
|
1772
|
+
else
|
|
1773
|
+
url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
|
|
1774
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
1775
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
1776
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
1777
|
+
const content_ = JSON.stringify(body);
|
|
1778
|
+
let options_ = {
|
|
1779
|
+
data: content_,
|
|
1780
|
+
method: "POST",
|
|
1781
|
+
url: url_,
|
|
1782
|
+
headers: {
|
|
1783
|
+
"Content-Type": "application/json-patch+json",
|
|
1784
|
+
"Accept": "text/plain"
|
|
1785
|
+
},
|
|
1786
|
+
cancelToken
|
|
1787
|
+
};
|
|
1788
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
1789
|
+
return this.instance.request(transformedOptions_);
|
|
1790
|
+
}).catch((_error) => {
|
|
1791
|
+
if (isAxiosError(_error) && _error.response) {
|
|
1792
|
+
return _error.response;
|
|
1793
|
+
}
|
|
1794
|
+
else {
|
|
1795
|
+
throw _error;
|
|
1796
|
+
}
|
|
1797
|
+
}).then((_response) => {
|
|
1798
|
+
return this.transformResult(url_, _response, (_response) => this.processCreateWithMultipleItems(_response));
|
|
1799
|
+
});
|
|
1800
|
+
}
|
|
1801
|
+
processCreateWithMultipleItems(response) {
|
|
1802
|
+
const status = response.status;
|
|
1803
|
+
let _headers = {};
|
|
1804
|
+
if (response.headers && typeof response.headers === "object") {
|
|
1805
|
+
for (let k in response.headers) {
|
|
1806
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
1807
|
+
_headers[k] = response.headers[k];
|
|
1808
|
+
}
|
|
1809
|
+
}
|
|
1810
|
+
}
|
|
1811
|
+
if (status === 201) {
|
|
1812
|
+
const _responseText = response.data;
|
|
1813
|
+
let result201 = null;
|
|
1814
|
+
let resultData201 = _responseText;
|
|
1815
|
+
result201 = JSON.parse(resultData201);
|
|
1816
|
+
return Promise.resolve(result201);
|
|
1817
|
+
}
|
|
1818
|
+
else if (status === 400) {
|
|
1819
|
+
const _responseText = response.data;
|
|
1820
|
+
let result400 = null;
|
|
1821
|
+
let resultData400 = _responseText;
|
|
1822
|
+
result400 = JSON.parse(resultData400);
|
|
1823
|
+
return throwException("Bad Request", status, _responseText, _headers, result400);
|
|
1824
|
+
}
|
|
1825
|
+
else if (status === 409) {
|
|
1826
|
+
const _responseText = response.data;
|
|
1827
|
+
let result409 = null;
|
|
1828
|
+
let resultData409 = _responseText;
|
|
1829
|
+
result409 = JSON.parse(resultData409);
|
|
1830
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
1831
|
+
}
|
|
1832
|
+
else if (status === 401) {
|
|
1833
|
+
const _responseText = response.data;
|
|
1834
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
1835
|
+
}
|
|
1836
|
+
else if (status === 403) {
|
|
1837
|
+
const _responseText = response.data;
|
|
1838
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
1839
|
+
}
|
|
1840
|
+
else if (status !== 200 && status !== 204) {
|
|
1841
|
+
const _responseText = response.data;
|
|
1842
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
1843
|
+
}
|
|
1844
|
+
return Promise.resolve(null);
|
|
1845
|
+
}
|
|
1754
1846
|
/**
|
|
1755
1847
|
* Creates a new project by 'Render HiRes' scenario.
|
|
1756
1848
|
* @param storefrontId Storefront identifier.
|
|
@@ -1808,6 +1900,13 @@ class ProjectsApiClient extends ApiClientBase {
|
|
|
1808
1900
|
result201 = JSON.parse(resultData201);
|
|
1809
1901
|
return Promise.resolve(result201);
|
|
1810
1902
|
}
|
|
1903
|
+
else if (status === 400) {
|
|
1904
|
+
const _responseText = response.data;
|
|
1905
|
+
let result400 = null;
|
|
1906
|
+
let resultData400 = _responseText;
|
|
1907
|
+
result400 = JSON.parse(resultData400);
|
|
1908
|
+
return throwException("Bad Request", status, _responseText, _headers, result400);
|
|
1909
|
+
}
|
|
1811
1910
|
else if (status === 409) {
|
|
1812
1911
|
const _responseText = response.data;
|
|
1813
1912
|
let result409 = null;
|
|
@@ -1886,6 +1985,13 @@ class ProjectsApiClient extends ApiClientBase {
|
|
|
1886
1985
|
result201 = JSON.parse(resultData201);
|
|
1887
1986
|
return Promise.resolve(result201);
|
|
1888
1987
|
}
|
|
1988
|
+
else if (status === 400) {
|
|
1989
|
+
const _responseText = response.data;
|
|
1990
|
+
let result400 = null;
|
|
1991
|
+
let resultData400 = _responseText;
|
|
1992
|
+
result400 = JSON.parse(resultData400);
|
|
1993
|
+
return throwException("Bad Request", status, _responseText, _headers, result400);
|
|
1994
|
+
}
|
|
1889
1995
|
else if (status === 409) {
|
|
1890
1996
|
const _responseText = response.data;
|
|
1891
1997
|
let result409 = null;
|
|
@@ -2460,14 +2566,17 @@ class ProjectsApiClient extends ApiClientBase {
|
|
|
2460
2566
|
/**
|
|
2461
2567
|
* Returns a project processing results.
|
|
2462
2568
|
* @param id Project identifier.
|
|
2569
|
+
* @param itemId (optional) Project item identifier.
|
|
2463
2570
|
* @param tenantId (optional) Tenant identifier.
|
|
2464
2571
|
* @return Success
|
|
2465
2572
|
*/
|
|
2466
|
-
getProjectProcessingResults(id, tenantId, cancelToken) {
|
|
2573
|
+
getProjectProcessingResults(id, itemId, tenantId, cancelToken) {
|
|
2467
2574
|
let url_ = this.baseUrl + "/api/storefront/v1/projects/{id}/processing-results?";
|
|
2468
2575
|
if (id === undefined || id === null)
|
|
2469
2576
|
throw new Error("The parameter 'id' must be defined.");
|
|
2470
2577
|
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
2578
|
+
if (itemId !== undefined && itemId !== null)
|
|
2579
|
+
url_ += "itemId=" + encodeURIComponent("" + itemId) + "&";
|
|
2471
2580
|
if (tenantId !== undefined && tenantId !== null)
|
|
2472
2581
|
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2473
2582
|
url_ = url_.replace(/[?&]$/, "");
|
|
@@ -2533,14 +2642,17 @@ class ProjectsApiClient extends ApiClientBase {
|
|
|
2533
2642
|
/**
|
|
2534
2643
|
* Resumes project processing.
|
|
2535
2644
|
* @param id Project identifier.
|
|
2645
|
+
* @param itemId (optional) Project item identifier. If value is set, only specified item processing will be resumed.
|
|
2536
2646
|
* @param tenantId (optional) Tenant identifier.
|
|
2537
2647
|
* @return Success
|
|
2538
2648
|
*/
|
|
2539
|
-
resumeProjectProcessing(id, tenantId, cancelToken) {
|
|
2649
|
+
resumeProjectProcessing(id, itemId, tenantId, cancelToken) {
|
|
2540
2650
|
let url_ = this.baseUrl + "/api/storefront/v1/projects/{id}/resume-processing?";
|
|
2541
2651
|
if (id === undefined || id === null)
|
|
2542
2652
|
throw new Error("The parameter 'id' must be defined.");
|
|
2543
2653
|
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
2654
|
+
if (itemId !== undefined && itemId !== null)
|
|
2655
|
+
url_ += "itemId=" + encodeURIComponent("" + itemId) + "&";
|
|
2544
2656
|
if (tenantId !== undefined && tenantId !== null)
|
|
2545
2657
|
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2546
2658
|
url_ = url_.replace(/[?&]$/, "");
|
|
@@ -2601,14 +2713,17 @@ class ProjectsApiClient extends ApiClientBase {
|
|
|
2601
2713
|
/**
|
|
2602
2714
|
* Restarts a project processing routine.
|
|
2603
2715
|
* @param id Project identifier.
|
|
2716
|
+
* @param itemId (optional) Project item identifier. If value is set, only specified item processing will be restarted.
|
|
2604
2717
|
* @param tenantId (optional) Tenant identifier.
|
|
2605
2718
|
* @return Success
|
|
2606
2719
|
*/
|
|
2607
|
-
restartProjectProcessing(id, tenantId, cancelToken) {
|
|
2720
|
+
restartProjectProcessing(id, itemId, tenantId, cancelToken) {
|
|
2608
2721
|
let url_ = this.baseUrl + "/api/storefront/v1/projects/{id}/restart-processing?";
|
|
2609
2722
|
if (id === undefined || id === null)
|
|
2610
2723
|
throw new Error("The parameter 'id' must be defined.");
|
|
2611
2724
|
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
2725
|
+
if (itemId !== undefined && itemId !== null)
|
|
2726
|
+
url_ += "itemId=" + encodeURIComponent("" + itemId) + "&";
|
|
2612
2727
|
if (tenantId !== undefined && tenantId !== null)
|
|
2613
2728
|
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2614
2729
|
url_ = url_.replace(/[?&]$/, "");
|
|
@@ -2742,15 +2857,18 @@ class ProjectsApiClient extends ApiClientBase {
|
|
|
2742
2857
|
/**
|
|
2743
2858
|
* Attachs the specified data to the project's order in ecommerce system.
|
|
2744
2859
|
* @param id Project identifier.
|
|
2860
|
+
* @param itemId (optional)
|
|
2745
2861
|
* @param tenantId (optional) Tenant identifier.
|
|
2746
2862
|
* @param body (optional) A list of data items, which should be attached to project's order.
|
|
2747
2863
|
* @return Success
|
|
2748
2864
|
*/
|
|
2749
|
-
attachDataToProjectOrder(id, tenantId, body, cancelToken) {
|
|
2865
|
+
attachDataToProjectOrder(id, itemId, tenantId, body, cancelToken) {
|
|
2750
2866
|
let url_ = this.baseUrl + "/api/storefront/v1/projects/{id}/order-data?";
|
|
2751
2867
|
if (id === undefined || id === null)
|
|
2752
2868
|
throw new Error("The parameter 'id' must be defined.");
|
|
2753
2869
|
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
2870
|
+
if (itemId !== undefined && itemId !== null)
|
|
2871
|
+
url_ += "itemId=" + encodeURIComponent("" + itemId) + "&";
|
|
2754
2872
|
if (tenantId !== undefined && tenantId !== null)
|
|
2755
2873
|
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2756
2874
|
url_ = url_.replace(/[?&]$/, "");
|