@aurigma/axios-storefront-api-client 2.54.1 → 2.55.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 +12 -186
- package/dist/cjs/storefront-api-client.js +2 -593
- package/dist/cjs/storefront-api-client.js.map +1 -1
- package/dist/esm/storefront-api-client.d.ts +12 -186
- package/dist/esm/storefront-api-client.js +2 -593
- package/dist/esm/storefront-api-client.js.map +1 -1
- package/package.json +1 -1
|
@@ -785,91 +785,6 @@ class ProductReferencesApiClient extends ApiClientBase {
|
|
|
785
785
|
}
|
|
786
786
|
return Promise.resolve(null);
|
|
787
787
|
}
|
|
788
|
-
/**
|
|
789
|
-
* Creates a new storefront product reference.
|
|
790
|
-
* @param storefrontId Storefront identifier.
|
|
791
|
-
* @param tenantId (optional) Tenant identifier.
|
|
792
|
-
* @param body (optional) Create operation parameters.
|
|
793
|
-
* @return Success
|
|
794
|
-
*/
|
|
795
|
-
create(storefrontId, tenantId, body, cancelToken) {
|
|
796
|
-
let url_ = this.baseUrl + "/api/storefront/v1/product-references?";
|
|
797
|
-
if (storefrontId === undefined || storefrontId === null)
|
|
798
|
-
throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
|
|
799
|
-
else
|
|
800
|
-
url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
|
|
801
|
-
if (tenantId !== undefined && tenantId !== null)
|
|
802
|
-
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
803
|
-
url_ = url_.replace(/[?&]$/, "");
|
|
804
|
-
const content_ = JSON.stringify(body);
|
|
805
|
-
let options_ = {
|
|
806
|
-
data: content_,
|
|
807
|
-
method: "POST",
|
|
808
|
-
url: url_,
|
|
809
|
-
headers: {
|
|
810
|
-
"Content-Type": "application/json",
|
|
811
|
-
"Accept": "application/json"
|
|
812
|
-
},
|
|
813
|
-
cancelToken
|
|
814
|
-
};
|
|
815
|
-
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
816
|
-
return this.instance.request(transformedOptions_);
|
|
817
|
-
}).catch((_error) => {
|
|
818
|
-
if (isAxiosError(_error) && _error.response) {
|
|
819
|
-
return _error.response;
|
|
820
|
-
}
|
|
821
|
-
else {
|
|
822
|
-
throw _error;
|
|
823
|
-
}
|
|
824
|
-
}).then((_response) => {
|
|
825
|
-
return this.transformResult(url_, _response, (_response) => this.processCreate(_response));
|
|
826
|
-
});
|
|
827
|
-
}
|
|
828
|
-
processCreate(response) {
|
|
829
|
-
const status = response.status;
|
|
830
|
-
let _headers = {};
|
|
831
|
-
if (response.headers && typeof response.headers === "object") {
|
|
832
|
-
for (let k in response.headers) {
|
|
833
|
-
if (response.headers.hasOwnProperty(k)) {
|
|
834
|
-
_headers[k] = response.headers[k];
|
|
835
|
-
}
|
|
836
|
-
}
|
|
837
|
-
}
|
|
838
|
-
if (status === 201) {
|
|
839
|
-
const _responseText = response.data;
|
|
840
|
-
let result201 = null;
|
|
841
|
-
let resultData201 = _responseText;
|
|
842
|
-
result201 = JSON.parse(resultData201);
|
|
843
|
-
return Promise.resolve(result201);
|
|
844
|
-
}
|
|
845
|
-
else if (status === 404) {
|
|
846
|
-
const _responseText = response.data;
|
|
847
|
-
let result404 = null;
|
|
848
|
-
let resultData404 = _responseText;
|
|
849
|
-
result404 = JSON.parse(resultData404);
|
|
850
|
-
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
851
|
-
}
|
|
852
|
-
else if (status === 409) {
|
|
853
|
-
const _responseText = response.data;
|
|
854
|
-
let result409 = null;
|
|
855
|
-
let resultData409 = _responseText;
|
|
856
|
-
result409 = JSON.parse(resultData409);
|
|
857
|
-
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
858
|
-
}
|
|
859
|
-
else if (status === 401) {
|
|
860
|
-
const _responseText = response.data;
|
|
861
|
-
return throwException("Unauthorized", status, _responseText, _headers);
|
|
862
|
-
}
|
|
863
|
-
else if (status === 403) {
|
|
864
|
-
const _responseText = response.data;
|
|
865
|
-
return throwException("Forbidden", status, _responseText, _headers);
|
|
866
|
-
}
|
|
867
|
-
else if (status !== 200 && status !== 204) {
|
|
868
|
-
const _responseText = response.data;
|
|
869
|
-
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
870
|
-
}
|
|
871
|
-
return Promise.resolve(null);
|
|
872
|
-
}
|
|
873
788
|
/**
|
|
874
789
|
* Returns a list of product specifications associated with storefront product references relevant to the specified query parameters.
|
|
875
790
|
* @param storefrontId Storefront identifier.
|
|
@@ -1279,91 +1194,6 @@ class ProductReferencesApiClient extends ApiClientBase {
|
|
|
1279
1194
|
}
|
|
1280
1195
|
return Promise.resolve(null);
|
|
1281
1196
|
}
|
|
1282
|
-
/**
|
|
1283
|
-
* Deletes the storefront product reference.
|
|
1284
|
-
* @param reference Product reference - external reference to Customer's Canvas product specification, e.g online store product identifier.
|
|
1285
|
-
* @param storefrontId Storefront identifier.
|
|
1286
|
-
* @param tenantId (optional) Tenant identifier.
|
|
1287
|
-
* @return Success
|
|
1288
|
-
*/
|
|
1289
|
-
delete(reference, storefrontId, tenantId, cancelToken) {
|
|
1290
|
-
let url_ = this.baseUrl + "/api/storefront/v1/product-references/{reference}?";
|
|
1291
|
-
if (reference === undefined || reference === null)
|
|
1292
|
-
throw new Error("The parameter 'reference' must be defined.");
|
|
1293
|
-
url_ = url_.replace("{reference}", encodeURIComponent("" + reference));
|
|
1294
|
-
if (storefrontId === undefined || storefrontId === null)
|
|
1295
|
-
throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
|
|
1296
|
-
else
|
|
1297
|
-
url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
|
|
1298
|
-
if (tenantId !== undefined && tenantId !== null)
|
|
1299
|
-
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
1300
|
-
url_ = url_.replace(/[?&]$/, "");
|
|
1301
|
-
let options_ = {
|
|
1302
|
-
method: "DELETE",
|
|
1303
|
-
url: url_,
|
|
1304
|
-
headers: {
|
|
1305
|
-
"Accept": "application/json"
|
|
1306
|
-
},
|
|
1307
|
-
cancelToken
|
|
1308
|
-
};
|
|
1309
|
-
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
1310
|
-
return this.instance.request(transformedOptions_);
|
|
1311
|
-
}).catch((_error) => {
|
|
1312
|
-
if (isAxiosError(_error) && _error.response) {
|
|
1313
|
-
return _error.response;
|
|
1314
|
-
}
|
|
1315
|
-
else {
|
|
1316
|
-
throw _error;
|
|
1317
|
-
}
|
|
1318
|
-
}).then((_response) => {
|
|
1319
|
-
return this.transformResult(url_, _response, (_response) => this.processDelete(_response));
|
|
1320
|
-
});
|
|
1321
|
-
}
|
|
1322
|
-
processDelete(response) {
|
|
1323
|
-
const status = response.status;
|
|
1324
|
-
let _headers = {};
|
|
1325
|
-
if (response.headers && typeof response.headers === "object") {
|
|
1326
|
-
for (let k in response.headers) {
|
|
1327
|
-
if (response.headers.hasOwnProperty(k)) {
|
|
1328
|
-
_headers[k] = response.headers[k];
|
|
1329
|
-
}
|
|
1330
|
-
}
|
|
1331
|
-
}
|
|
1332
|
-
if (status === 200) {
|
|
1333
|
-
const _responseText = response.data;
|
|
1334
|
-
let result200 = null;
|
|
1335
|
-
let resultData200 = _responseText;
|
|
1336
|
-
result200 = JSON.parse(resultData200);
|
|
1337
|
-
return Promise.resolve(result200);
|
|
1338
|
-
}
|
|
1339
|
-
else if (status === 404) {
|
|
1340
|
-
const _responseText = response.data;
|
|
1341
|
-
let result404 = null;
|
|
1342
|
-
let resultData404 = _responseText;
|
|
1343
|
-
result404 = JSON.parse(resultData404);
|
|
1344
|
-
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
1345
|
-
}
|
|
1346
|
-
else if (status === 409) {
|
|
1347
|
-
const _responseText = response.data;
|
|
1348
|
-
let result409 = null;
|
|
1349
|
-
let resultData409 = _responseText;
|
|
1350
|
-
result409 = JSON.parse(resultData409);
|
|
1351
|
-
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
1352
|
-
}
|
|
1353
|
-
else if (status === 401) {
|
|
1354
|
-
const _responseText = response.data;
|
|
1355
|
-
return throwException("Unauthorized", status, _responseText, _headers);
|
|
1356
|
-
}
|
|
1357
|
-
else if (status === 403) {
|
|
1358
|
-
const _responseText = response.data;
|
|
1359
|
-
return throwException("Forbidden", status, _responseText, _headers);
|
|
1360
|
-
}
|
|
1361
|
-
else if (status !== 200 && status !== 204) {
|
|
1362
|
-
const _responseText = response.data;
|
|
1363
|
-
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
1364
|
-
}
|
|
1365
|
-
return Promise.resolve(null);
|
|
1366
|
-
}
|
|
1367
1197
|
/**
|
|
1368
1198
|
* Returns a product specification by the storefront product reference.
|
|
1369
1199
|
* @param reference Product reference - external reference to Customer's Canvas product, e.g online store product identifier.
|
|
@@ -1896,92 +1726,6 @@ class ProductReferencesApiClient extends ApiClientBase {
|
|
|
1896
1726
|
}
|
|
1897
1727
|
return Promise.resolve(null);
|
|
1898
1728
|
}
|
|
1899
|
-
/**
|
|
1900
|
-
* Returns a product personalization workflow configuration by storefront product reference.
|
|
1901
|
-
* @param reference An external reference to Customer's Canvas product, e.g online store product identifier.
|
|
1902
|
-
* @param storefrontId Storefront identifier.
|
|
1903
|
-
* @param tenantId (optional) Tenant identifier.
|
|
1904
|
-
* @return Success
|
|
1905
|
-
* @deprecated
|
|
1906
|
-
*/
|
|
1907
|
-
getProductConfig(reference, storefrontId, tenantId, cancelToken) {
|
|
1908
|
-
let url_ = this.baseUrl + "/api/storefront/v1/product-references/{reference}/product-config?";
|
|
1909
|
-
if (reference === undefined || reference === null)
|
|
1910
|
-
throw new Error("The parameter 'reference' must be defined.");
|
|
1911
|
-
url_ = url_.replace("{reference}", encodeURIComponent("" + reference));
|
|
1912
|
-
if (storefrontId === undefined || storefrontId === null)
|
|
1913
|
-
throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
|
|
1914
|
-
else
|
|
1915
|
-
url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
|
|
1916
|
-
if (tenantId !== undefined && tenantId !== null)
|
|
1917
|
-
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
1918
|
-
url_ = url_.replace(/[?&]$/, "");
|
|
1919
|
-
let options_ = {
|
|
1920
|
-
method: "GET",
|
|
1921
|
-
url: url_,
|
|
1922
|
-
headers: {
|
|
1923
|
-
"Accept": "text/plain"
|
|
1924
|
-
},
|
|
1925
|
-
cancelToken
|
|
1926
|
-
};
|
|
1927
|
-
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
1928
|
-
return this.instance.request(transformedOptions_);
|
|
1929
|
-
}).catch((_error) => {
|
|
1930
|
-
if (isAxiosError(_error) && _error.response) {
|
|
1931
|
-
return _error.response;
|
|
1932
|
-
}
|
|
1933
|
-
else {
|
|
1934
|
-
throw _error;
|
|
1935
|
-
}
|
|
1936
|
-
}).then((_response) => {
|
|
1937
|
-
return this.transformResult(url_, _response, (_response) => this.processGetProductConfig(_response));
|
|
1938
|
-
});
|
|
1939
|
-
}
|
|
1940
|
-
processGetProductConfig(response) {
|
|
1941
|
-
const status = response.status;
|
|
1942
|
-
let _headers = {};
|
|
1943
|
-
if (response.headers && typeof response.headers === "object") {
|
|
1944
|
-
for (let k in response.headers) {
|
|
1945
|
-
if (response.headers.hasOwnProperty(k)) {
|
|
1946
|
-
_headers[k] = response.headers[k];
|
|
1947
|
-
}
|
|
1948
|
-
}
|
|
1949
|
-
}
|
|
1950
|
-
if (status === 200) {
|
|
1951
|
-
const _responseText = response.data;
|
|
1952
|
-
let result200 = null;
|
|
1953
|
-
let resultData200 = _responseText;
|
|
1954
|
-
result200 = resultData200;
|
|
1955
|
-
return Promise.resolve(result200);
|
|
1956
|
-
}
|
|
1957
|
-
else if (status === 404) {
|
|
1958
|
-
const _responseText = response.data;
|
|
1959
|
-
let result404 = null;
|
|
1960
|
-
let resultData404 = _responseText;
|
|
1961
|
-
result404 = JSON.parse(resultData404);
|
|
1962
|
-
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
1963
|
-
}
|
|
1964
|
-
else if (status === 409) {
|
|
1965
|
-
const _responseText = response.data;
|
|
1966
|
-
let result409 = null;
|
|
1967
|
-
let resultData409 = _responseText;
|
|
1968
|
-
result409 = JSON.parse(resultData409);
|
|
1969
|
-
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
1970
|
-
}
|
|
1971
|
-
else if (status === 401) {
|
|
1972
|
-
const _responseText = response.data;
|
|
1973
|
-
return throwException("Unauthorized", status, _responseText, _headers);
|
|
1974
|
-
}
|
|
1975
|
-
else if (status === 403) {
|
|
1976
|
-
const _responseText = response.data;
|
|
1977
|
-
return throwException("Forbidden", status, _responseText, _headers);
|
|
1978
|
-
}
|
|
1979
|
-
else if (status !== 200 && status !== 204) {
|
|
1980
|
-
const _responseText = response.data;
|
|
1981
|
-
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
1982
|
-
}
|
|
1983
|
-
return Promise.resolve(null);
|
|
1984
|
-
}
|
|
1985
1729
|
}
|
|
1986
1730
|
exports.ProductReferencesApiClient = ProductReferencesApiClient;
|
|
1987
1731
|
class ProductsApiClient extends ApiClientBase {
|
|
@@ -3184,91 +2928,8 @@ class ProductsApiClient extends ApiClientBase {
|
|
|
3184
2928
|
return Promise.resolve(null);
|
|
3185
2929
|
}
|
|
3186
2930
|
/**
|
|
3187
|
-
*
|
|
3188
|
-
* @param
|
|
3189
|
-
* @param productVersionId (optional) Product version identifier.
|
|
3190
|
-
* @param tenantId (optional) Tenant identifier.
|
|
3191
|
-
* @param body (optional) Set product variant price operation parameters.
|
|
3192
|
-
* @return Success
|
|
3193
|
-
*/
|
|
3194
|
-
setProductVariantPrice(id, productVersionId, tenantId, body, cancelToken) {
|
|
3195
|
-
let url_ = this.baseUrl + "/api/storefront/v1/products/{id}/set-variant-price?";
|
|
3196
|
-
if (id === undefined || id === null)
|
|
3197
|
-
throw new Error("The parameter 'id' must be defined.");
|
|
3198
|
-
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
3199
|
-
if (productVersionId !== undefined && productVersionId !== null)
|
|
3200
|
-
url_ += "productVersionId=" + encodeURIComponent("" + productVersionId) + "&";
|
|
3201
|
-
if (tenantId !== undefined && tenantId !== null)
|
|
3202
|
-
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
3203
|
-
url_ = url_.replace(/[?&]$/, "");
|
|
3204
|
-
const content_ = JSON.stringify(body);
|
|
3205
|
-
let options_ = {
|
|
3206
|
-
data: content_,
|
|
3207
|
-
method: "POST",
|
|
3208
|
-
url: url_,
|
|
3209
|
-
headers: {
|
|
3210
|
-
"Content-Type": "application/json",
|
|
3211
|
-
},
|
|
3212
|
-
cancelToken
|
|
3213
|
-
};
|
|
3214
|
-
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
3215
|
-
return this.instance.request(transformedOptions_);
|
|
3216
|
-
}).catch((_error) => {
|
|
3217
|
-
if (isAxiosError(_error) && _error.response) {
|
|
3218
|
-
return _error.response;
|
|
3219
|
-
}
|
|
3220
|
-
else {
|
|
3221
|
-
throw _error;
|
|
3222
|
-
}
|
|
3223
|
-
}).then((_response) => {
|
|
3224
|
-
return this.transformResult(url_, _response, (_response) => this.processSetProductVariantPrice(_response));
|
|
3225
|
-
});
|
|
3226
|
-
}
|
|
3227
|
-
processSetProductVariantPrice(response) {
|
|
3228
|
-
const status = response.status;
|
|
3229
|
-
let _headers = {};
|
|
3230
|
-
if (response.headers && typeof response.headers === "object") {
|
|
3231
|
-
for (let k in response.headers) {
|
|
3232
|
-
if (response.headers.hasOwnProperty(k)) {
|
|
3233
|
-
_headers[k] = response.headers[k];
|
|
3234
|
-
}
|
|
3235
|
-
}
|
|
3236
|
-
}
|
|
3237
|
-
if (status === 200) {
|
|
3238
|
-
const _responseText = response.data;
|
|
3239
|
-
return Promise.resolve(null);
|
|
3240
|
-
}
|
|
3241
|
-
else if (status === 404) {
|
|
3242
|
-
const _responseText = response.data;
|
|
3243
|
-
let result404 = null;
|
|
3244
|
-
let resultData404 = _responseText;
|
|
3245
|
-
result404 = JSON.parse(resultData404);
|
|
3246
|
-
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
3247
|
-
}
|
|
3248
|
-
else if (status === 409) {
|
|
3249
|
-
const _responseText = response.data;
|
|
3250
|
-
let result409 = null;
|
|
3251
|
-
let resultData409 = _responseText;
|
|
3252
|
-
result409 = JSON.parse(resultData409);
|
|
3253
|
-
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
3254
|
-
}
|
|
3255
|
-
else if (status === 401) {
|
|
3256
|
-
const _responseText = response.data;
|
|
3257
|
-
return throwException("Unauthorized", status, _responseText, _headers);
|
|
3258
|
-
}
|
|
3259
|
-
else if (status === 403) {
|
|
3260
|
-
const _responseText = response.data;
|
|
3261
|
-
return throwException("Forbidden", status, _responseText, _headers);
|
|
3262
|
-
}
|
|
3263
|
-
else if (status !== 200 && status !== 204) {
|
|
3264
|
-
const _responseText = response.data;
|
|
3265
|
-
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
3266
|
-
}
|
|
3267
|
-
return Promise.resolve(null);
|
|
3268
|
-
}
|
|
3269
|
-
/**
|
|
3270
|
-
* Returns a list of all available product tags.
|
|
3271
|
-
* @param search (optional) Search string for partial match.
|
|
2931
|
+
* Returns a list of all available product tags.
|
|
2932
|
+
* @param search (optional) Search string for partial match.
|
|
3272
2933
|
* @param tenantId (optional) Tenant identifier.
|
|
3273
2934
|
* @return Success
|
|
3274
2935
|
*/
|
|
@@ -3651,80 +3312,6 @@ class ProductSpecificationsApiClient extends ApiClientBase {
|
|
|
3651
3312
|
}
|
|
3652
3313
|
return Promise.resolve(null);
|
|
3653
3314
|
}
|
|
3654
|
-
/**
|
|
3655
|
-
* Returns a product personalization workflow configuration by product specification identifier.
|
|
3656
|
-
* @param id Product specification identifier.
|
|
3657
|
-
* @param tenantId (optional) Tenant identifier.
|
|
3658
|
-
* @return Success
|
|
3659
|
-
* @deprecated
|
|
3660
|
-
*/
|
|
3661
|
-
getConfiguration(id, tenantId, cancelToken) {
|
|
3662
|
-
let url_ = this.baseUrl + "/api/storefront/v1/product-specifications/{id}/config?";
|
|
3663
|
-
if (id === undefined || id === null)
|
|
3664
|
-
throw new Error("The parameter 'id' must be defined.");
|
|
3665
|
-
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
3666
|
-
if (tenantId !== undefined && tenantId !== null)
|
|
3667
|
-
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
3668
|
-
url_ = url_.replace(/[?&]$/, "");
|
|
3669
|
-
let options_ = {
|
|
3670
|
-
method: "GET",
|
|
3671
|
-
url: url_,
|
|
3672
|
-
headers: {
|
|
3673
|
-
"Accept": "text/plain"
|
|
3674
|
-
},
|
|
3675
|
-
cancelToken
|
|
3676
|
-
};
|
|
3677
|
-
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
3678
|
-
return this.instance.request(transformedOptions_);
|
|
3679
|
-
}).catch((_error) => {
|
|
3680
|
-
if (isAxiosError(_error) && _error.response) {
|
|
3681
|
-
return _error.response;
|
|
3682
|
-
}
|
|
3683
|
-
else {
|
|
3684
|
-
throw _error;
|
|
3685
|
-
}
|
|
3686
|
-
}).then((_response) => {
|
|
3687
|
-
return this.transformResult(url_, _response, (_response) => this.processGetConfiguration(_response));
|
|
3688
|
-
});
|
|
3689
|
-
}
|
|
3690
|
-
processGetConfiguration(response) {
|
|
3691
|
-
const status = response.status;
|
|
3692
|
-
let _headers = {};
|
|
3693
|
-
if (response.headers && typeof response.headers === "object") {
|
|
3694
|
-
for (let k in response.headers) {
|
|
3695
|
-
if (response.headers.hasOwnProperty(k)) {
|
|
3696
|
-
_headers[k] = response.headers[k];
|
|
3697
|
-
}
|
|
3698
|
-
}
|
|
3699
|
-
}
|
|
3700
|
-
if (status === 200) {
|
|
3701
|
-
const _responseText = response.data;
|
|
3702
|
-
let result200 = null;
|
|
3703
|
-
let resultData200 = _responseText;
|
|
3704
|
-
result200 = resultData200;
|
|
3705
|
-
return Promise.resolve(result200);
|
|
3706
|
-
}
|
|
3707
|
-
else if (status === 404) {
|
|
3708
|
-
const _responseText = response.data;
|
|
3709
|
-
let result404 = null;
|
|
3710
|
-
let resultData404 = _responseText;
|
|
3711
|
-
result404 = JSON.parse(resultData404);
|
|
3712
|
-
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
3713
|
-
}
|
|
3714
|
-
else if (status === 401) {
|
|
3715
|
-
const _responseText = response.data;
|
|
3716
|
-
return throwException("Unauthorized", status, _responseText, _headers);
|
|
3717
|
-
}
|
|
3718
|
-
else if (status === 403) {
|
|
3719
|
-
const _responseText = response.data;
|
|
3720
|
-
return throwException("Forbidden", status, _responseText, _headers);
|
|
3721
|
-
}
|
|
3722
|
-
else if (status !== 200 && status !== 204) {
|
|
3723
|
-
const _responseText = response.data;
|
|
3724
|
-
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
3725
|
-
}
|
|
3726
|
-
return Promise.resolve(null);
|
|
3727
|
-
}
|
|
3728
3315
|
}
|
|
3729
3316
|
exports.ProductSpecificationsApiClient = ProductSpecificationsApiClient;
|
|
3730
3317
|
class ProjectsApiClient extends ApiClientBase {
|
|
@@ -4953,184 +4540,6 @@ class ProjectsApiClient extends ApiClientBase {
|
|
|
4953
4540
|
}
|
|
4954
4541
|
return Promise.resolve(null);
|
|
4955
4542
|
}
|
|
4956
|
-
/**
|
|
4957
|
-
* Returns an url to download project print file.
|
|
4958
|
-
* @param id Project identifier.
|
|
4959
|
-
* @param designUserId Design owner identifier.
|
|
4960
|
-
* @param designId Design identifier.
|
|
4961
|
-
* @param tenantId (optional) Tenant identifier.
|
|
4962
|
-
* @return Success
|
|
4963
|
-
* @deprecated
|
|
4964
|
-
*/
|
|
4965
|
-
getProjectPdfUrl(id, designUserId, designId, tenantId, cancelToken) {
|
|
4966
|
-
let url_ = this.baseUrl + "/api/storefront/v1/projects/{id}/project-pdf?";
|
|
4967
|
-
if (id === undefined || id === null)
|
|
4968
|
-
throw new Error("The parameter 'id' must be defined.");
|
|
4969
|
-
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
4970
|
-
if (designUserId === undefined || designUserId === null)
|
|
4971
|
-
throw new Error("The parameter 'designUserId' must be defined and cannot be null.");
|
|
4972
|
-
else
|
|
4973
|
-
url_ += "designUserId=" + encodeURIComponent("" + designUserId) + "&";
|
|
4974
|
-
if (designId === undefined || designId === null)
|
|
4975
|
-
throw new Error("The parameter 'designId' must be defined and cannot be null.");
|
|
4976
|
-
else
|
|
4977
|
-
url_ += "designId=" + encodeURIComponent("" + designId) + "&";
|
|
4978
|
-
if (tenantId !== undefined && tenantId !== null)
|
|
4979
|
-
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
4980
|
-
url_ = url_.replace(/[?&]$/, "");
|
|
4981
|
-
let options_ = {
|
|
4982
|
-
method: "GET",
|
|
4983
|
-
url: url_,
|
|
4984
|
-
headers: {
|
|
4985
|
-
"Accept": "application/json"
|
|
4986
|
-
},
|
|
4987
|
-
cancelToken
|
|
4988
|
-
};
|
|
4989
|
-
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
4990
|
-
return this.instance.request(transformedOptions_);
|
|
4991
|
-
}).catch((_error) => {
|
|
4992
|
-
if (isAxiosError(_error) && _error.response) {
|
|
4993
|
-
return _error.response;
|
|
4994
|
-
}
|
|
4995
|
-
else {
|
|
4996
|
-
throw _error;
|
|
4997
|
-
}
|
|
4998
|
-
}).then((_response) => {
|
|
4999
|
-
return this.transformResult(url_, _response, (_response) => this.processGetProjectPdfUrl(_response));
|
|
5000
|
-
});
|
|
5001
|
-
}
|
|
5002
|
-
processGetProjectPdfUrl(response) {
|
|
5003
|
-
const status = response.status;
|
|
5004
|
-
let _headers = {};
|
|
5005
|
-
if (response.headers && typeof response.headers === "object") {
|
|
5006
|
-
for (let k in response.headers) {
|
|
5007
|
-
if (response.headers.hasOwnProperty(k)) {
|
|
5008
|
-
_headers[k] = response.headers[k];
|
|
5009
|
-
}
|
|
5010
|
-
}
|
|
5011
|
-
}
|
|
5012
|
-
if (status === 200) {
|
|
5013
|
-
const _responseText = response.data;
|
|
5014
|
-
let result200 = null;
|
|
5015
|
-
let resultData200 = _responseText;
|
|
5016
|
-
result200 = JSON.parse(resultData200);
|
|
5017
|
-
return Promise.resolve(result200);
|
|
5018
|
-
}
|
|
5019
|
-
else if (status === 409) {
|
|
5020
|
-
const _responseText = response.data;
|
|
5021
|
-
let result409 = null;
|
|
5022
|
-
let resultData409 = _responseText;
|
|
5023
|
-
result409 = JSON.parse(resultData409);
|
|
5024
|
-
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
5025
|
-
}
|
|
5026
|
-
else if (status === 401) {
|
|
5027
|
-
const _responseText = response.data;
|
|
5028
|
-
return throwException("Unauthorized", status, _responseText, _headers);
|
|
5029
|
-
}
|
|
5030
|
-
else if (status === 403) {
|
|
5031
|
-
const _responseText = response.data;
|
|
5032
|
-
return throwException("Forbidden", status, _responseText, _headers);
|
|
5033
|
-
}
|
|
5034
|
-
else if (status !== 200 && status !== 204) {
|
|
5035
|
-
const _responseText = response.data;
|
|
5036
|
-
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
5037
|
-
}
|
|
5038
|
-
return Promise.resolve(null);
|
|
5039
|
-
}
|
|
5040
|
-
/**
|
|
5041
|
-
* Returns an archive file, which contains all project print files.
|
|
5042
|
-
* @param id Project identifier.
|
|
5043
|
-
* @param designUserId Design owner identifier.
|
|
5044
|
-
* @param designId Design identifier.
|
|
5045
|
-
* @param attachment (optional) If set to 'true', the requested file will be provided as an attachment with proper filename supplied (default value is 'false').
|
|
5046
|
-
* @param tenantId (optional) Tenant identifier.
|
|
5047
|
-
* @return Success
|
|
5048
|
-
* @deprecated
|
|
5049
|
-
*/
|
|
5050
|
-
getProjectPdfZip(id, designUserId, designId, attachment, tenantId, cancelToken) {
|
|
5051
|
-
let url_ = this.baseUrl + "/api/storefront/v1/projects/{id}/project-pdf-zip?";
|
|
5052
|
-
if (id === undefined || id === null)
|
|
5053
|
-
throw new Error("The parameter 'id' must be defined.");
|
|
5054
|
-
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
5055
|
-
if (designUserId === undefined || designUserId === null)
|
|
5056
|
-
throw new Error("The parameter 'designUserId' must be defined and cannot be null.");
|
|
5057
|
-
else
|
|
5058
|
-
url_ += "designUserId=" + encodeURIComponent("" + designUserId) + "&";
|
|
5059
|
-
if (designId === undefined || designId === null)
|
|
5060
|
-
throw new Error("The parameter 'designId' must be defined and cannot be null.");
|
|
5061
|
-
else
|
|
5062
|
-
url_ += "designId=" + encodeURIComponent("" + designId) + "&";
|
|
5063
|
-
if (attachment !== undefined && attachment !== null)
|
|
5064
|
-
url_ += "attachment=" + encodeURIComponent("" + attachment) + "&";
|
|
5065
|
-
if (tenantId !== undefined && tenantId !== null)
|
|
5066
|
-
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
5067
|
-
url_ = url_.replace(/[?&]$/, "");
|
|
5068
|
-
let options_ = {
|
|
5069
|
-
responseType: "blob",
|
|
5070
|
-
method: "GET",
|
|
5071
|
-
url: url_,
|
|
5072
|
-
headers: {
|
|
5073
|
-
"Accept": "application/octet-stream"
|
|
5074
|
-
},
|
|
5075
|
-
cancelToken
|
|
5076
|
-
};
|
|
5077
|
-
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
5078
|
-
return this.instance.request(transformedOptions_);
|
|
5079
|
-
}).catch((_error) => {
|
|
5080
|
-
if (isAxiosError(_error) && _error.response) {
|
|
5081
|
-
return _error.response;
|
|
5082
|
-
}
|
|
5083
|
-
else {
|
|
5084
|
-
throw _error;
|
|
5085
|
-
}
|
|
5086
|
-
}).then((_response) => {
|
|
5087
|
-
return this.transformResult(url_, _response, (_response) => this.processGetProjectPdfZip(_response));
|
|
5088
|
-
});
|
|
5089
|
-
}
|
|
5090
|
-
processGetProjectPdfZip(response) {
|
|
5091
|
-
const status = response.status;
|
|
5092
|
-
let _headers = {};
|
|
5093
|
-
if (response.headers && typeof response.headers === "object") {
|
|
5094
|
-
for (let k in response.headers) {
|
|
5095
|
-
if (response.headers.hasOwnProperty(k)) {
|
|
5096
|
-
_headers[k] = response.headers[k];
|
|
5097
|
-
}
|
|
5098
|
-
}
|
|
5099
|
-
}
|
|
5100
|
-
if (status === 200 || status === 206) {
|
|
5101
|
-
const contentDisposition = response.headers ? response.headers["content-disposition"] : undefined;
|
|
5102
|
-
const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
|
|
5103
|
-
const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
|
|
5104
|
-
return Promise.resolve({ fileName: fileName, status: status, data: new Blob([response.data]), headers: _headers });
|
|
5105
|
-
}
|
|
5106
|
-
else if (status === 404) {
|
|
5107
|
-
const _responseText = response.data;
|
|
5108
|
-
let result404 = null;
|
|
5109
|
-
let resultData404 = _responseText;
|
|
5110
|
-
result404 = JSON.parse(resultData404);
|
|
5111
|
-
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
5112
|
-
}
|
|
5113
|
-
else if (status === 409) {
|
|
5114
|
-
const _responseText = response.data;
|
|
5115
|
-
let result409 = null;
|
|
5116
|
-
let resultData409 = _responseText;
|
|
5117
|
-
result409 = JSON.parse(resultData409);
|
|
5118
|
-
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
5119
|
-
}
|
|
5120
|
-
else if (status === 401) {
|
|
5121
|
-
const _responseText = response.data;
|
|
5122
|
-
return throwException("Unauthorized", status, _responseText, _headers);
|
|
5123
|
-
}
|
|
5124
|
-
else if (status === 403) {
|
|
5125
|
-
const _responseText = response.data;
|
|
5126
|
-
return throwException("Forbidden", status, _responseText, _headers);
|
|
5127
|
-
}
|
|
5128
|
-
else if (status !== 200 && status !== 204) {
|
|
5129
|
-
const _responseText = response.data;
|
|
5130
|
-
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
5131
|
-
}
|
|
5132
|
-
return Promise.resolve(null);
|
|
5133
|
-
}
|
|
5134
4543
|
/**
|
|
5135
4544
|
* Returns a project processing results.
|
|
5136
4545
|
* @param id Project identifier.
|