@aurigma/axios-backoffice-api-client 2.62.12 → 2.65.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/backoffice-api-client.d.ts +324 -2
- package/dist/cjs/backoffice-api-client.js +1037 -1
- package/dist/cjs/backoffice-api-client.js.map +1 -1
- package/dist/esm/backoffice-api-client.d.ts +324 -2
- package/dist/esm/backoffice-api-client.js +1037 -1
- package/dist/esm/backoffice-api-client.js.map +1 -1
- package/package.json +1 -1
|
@@ -1207,6 +1207,159 @@ export var BackOfficeApiClient;
|
|
|
1207
1207
|
}
|
|
1208
1208
|
return Promise.resolve(null);
|
|
1209
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
|
+
}
|
|
1210
1363
|
/**
|
|
1211
1364
|
* Returns a list of product variant designs.
|
|
1212
1365
|
* @param id Product identifier.
|
|
@@ -1633,6 +1786,93 @@ export var BackOfficeApiClient;
|
|
|
1633
1786
|
}
|
|
1634
1787
|
return Promise.resolve(null);
|
|
1635
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
|
+
}
|
|
1636
1876
|
/**
|
|
1637
1877
|
* Set product variants availability. Variants identifiers will be changed.
|
|
1638
1878
|
* @param id Product identifier.
|
|
@@ -2602,6 +2842,793 @@ export var BackOfficeApiClient;
|
|
|
2602
2842
|
}
|
|
2603
2843
|
}
|
|
2604
2844
|
BackOfficeApiClient.ProductsManagementApiClient = ProductsManagementApiClient;
|
|
2845
|
+
class ProjectStatusesManagementApiClient extends ApiClientBase {
|
|
2846
|
+
instance;
|
|
2847
|
+
baseUrl;
|
|
2848
|
+
jsonParseReviver = undefined;
|
|
2849
|
+
constructor(configuration, baseUrl, instance) {
|
|
2850
|
+
super(configuration);
|
|
2851
|
+
this.instance = instance ? instance : axios.create();
|
|
2852
|
+
this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : this.getBaseUrl("");
|
|
2853
|
+
}
|
|
2854
|
+
/**
|
|
2855
|
+
* Returns a list of all existing project statuses.
|
|
2856
|
+
* @param tenantId (optional) Tenant identifier.
|
|
2857
|
+
* @return Success
|
|
2858
|
+
*/
|
|
2859
|
+
getAll(tenantId, cancelToken) {
|
|
2860
|
+
let url_ = this.baseUrl + "/api/backoffice/v1/projects-statuses?";
|
|
2861
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
2862
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2863
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
2864
|
+
let options_ = {
|
|
2865
|
+
method: "GET",
|
|
2866
|
+
url: url_,
|
|
2867
|
+
headers: {
|
|
2868
|
+
"Accept": "application/json"
|
|
2869
|
+
},
|
|
2870
|
+
cancelToken
|
|
2871
|
+
};
|
|
2872
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
2873
|
+
return this.instance.request(transformedOptions_);
|
|
2874
|
+
}).catch((_error) => {
|
|
2875
|
+
if (isAxiosError(_error) && _error.response) {
|
|
2876
|
+
return _error.response;
|
|
2877
|
+
}
|
|
2878
|
+
else {
|
|
2879
|
+
throw _error;
|
|
2880
|
+
}
|
|
2881
|
+
}).then((_response) => {
|
|
2882
|
+
return this.transformResult(url_, _response, (_response) => this.processGetAll(_response));
|
|
2883
|
+
});
|
|
2884
|
+
}
|
|
2885
|
+
processGetAll(response) {
|
|
2886
|
+
const status = response.status;
|
|
2887
|
+
let _headers = {};
|
|
2888
|
+
if (response.headers && typeof response.headers === "object") {
|
|
2889
|
+
for (let k in response.headers) {
|
|
2890
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
2891
|
+
_headers[k] = response.headers[k];
|
|
2892
|
+
}
|
|
2893
|
+
}
|
|
2894
|
+
}
|
|
2895
|
+
if (status === 200) {
|
|
2896
|
+
const _responseText = response.data;
|
|
2897
|
+
let result200 = null;
|
|
2898
|
+
let resultData200 = _responseText;
|
|
2899
|
+
result200 = JSON.parse(resultData200);
|
|
2900
|
+
return Promise.resolve(result200);
|
|
2901
|
+
}
|
|
2902
|
+
else if (status === 401) {
|
|
2903
|
+
const _responseText = response.data;
|
|
2904
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
2905
|
+
}
|
|
2906
|
+
else if (status === 403) {
|
|
2907
|
+
const _responseText = response.data;
|
|
2908
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
2909
|
+
}
|
|
2910
|
+
else if (status !== 200 && status !== 204) {
|
|
2911
|
+
const _responseText = response.data;
|
|
2912
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
2913
|
+
}
|
|
2914
|
+
return Promise.resolve(null);
|
|
2915
|
+
}
|
|
2916
|
+
/**
|
|
2917
|
+
* Creates a new project status and returns its description.
|
|
2918
|
+
* @param tenantId (optional) Tenant identifier.
|
|
2919
|
+
* @param body (optional) Status creation parameters.
|
|
2920
|
+
* @return Success
|
|
2921
|
+
*/
|
|
2922
|
+
create(tenantId, body, cancelToken) {
|
|
2923
|
+
let url_ = this.baseUrl + "/api/backoffice/v1/projects-statuses?";
|
|
2924
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
2925
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2926
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
2927
|
+
const content_ = JSON.stringify(body);
|
|
2928
|
+
let options_ = {
|
|
2929
|
+
data: content_,
|
|
2930
|
+
method: "POST",
|
|
2931
|
+
url: url_,
|
|
2932
|
+
headers: {
|
|
2933
|
+
"Content-Type": "application/json",
|
|
2934
|
+
"Accept": "application/json"
|
|
2935
|
+
},
|
|
2936
|
+
cancelToken
|
|
2937
|
+
};
|
|
2938
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
2939
|
+
return this.instance.request(transformedOptions_);
|
|
2940
|
+
}).catch((_error) => {
|
|
2941
|
+
if (isAxiosError(_error) && _error.response) {
|
|
2942
|
+
return _error.response;
|
|
2943
|
+
}
|
|
2944
|
+
else {
|
|
2945
|
+
throw _error;
|
|
2946
|
+
}
|
|
2947
|
+
}).then((_response) => {
|
|
2948
|
+
return this.transformResult(url_, _response, (_response) => this.processCreate(_response));
|
|
2949
|
+
});
|
|
2950
|
+
}
|
|
2951
|
+
processCreate(response) {
|
|
2952
|
+
const status = response.status;
|
|
2953
|
+
let _headers = {};
|
|
2954
|
+
if (response.headers && typeof response.headers === "object") {
|
|
2955
|
+
for (let k in response.headers) {
|
|
2956
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
2957
|
+
_headers[k] = response.headers[k];
|
|
2958
|
+
}
|
|
2959
|
+
}
|
|
2960
|
+
}
|
|
2961
|
+
if (status === 201) {
|
|
2962
|
+
const _responseText = response.data;
|
|
2963
|
+
let result201 = null;
|
|
2964
|
+
let resultData201 = _responseText;
|
|
2965
|
+
result201 = JSON.parse(resultData201);
|
|
2966
|
+
return Promise.resolve(result201);
|
|
2967
|
+
}
|
|
2968
|
+
else if (status === 400) {
|
|
2969
|
+
const _responseText = response.data;
|
|
2970
|
+
let result400 = null;
|
|
2971
|
+
let resultData400 = _responseText;
|
|
2972
|
+
result400 = JSON.parse(resultData400);
|
|
2973
|
+
return throwException("Bad Request", status, _responseText, _headers, result400);
|
|
2974
|
+
}
|
|
2975
|
+
else if (status === 409) {
|
|
2976
|
+
const _responseText = response.data;
|
|
2977
|
+
let result409 = null;
|
|
2978
|
+
let resultData409 = _responseText;
|
|
2979
|
+
result409 = JSON.parse(resultData409);
|
|
2980
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
2981
|
+
}
|
|
2982
|
+
else if (status === 401) {
|
|
2983
|
+
const _responseText = response.data;
|
|
2984
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
2985
|
+
}
|
|
2986
|
+
else if (status === 403) {
|
|
2987
|
+
const _responseText = response.data;
|
|
2988
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
2989
|
+
}
|
|
2990
|
+
else if (status !== 200 && status !== 204) {
|
|
2991
|
+
const _responseText = response.data;
|
|
2992
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
2993
|
+
}
|
|
2994
|
+
return Promise.resolve(null);
|
|
2995
|
+
}
|
|
2996
|
+
/**
|
|
2997
|
+
* Returns a project status by its identifier.
|
|
2998
|
+
* @param id Status identifier.
|
|
2999
|
+
* @param tenantId (optional) Tenant identifier.
|
|
3000
|
+
* @return Success
|
|
3001
|
+
*/
|
|
3002
|
+
get(id, tenantId, cancelToken) {
|
|
3003
|
+
let url_ = this.baseUrl + "/api/backoffice/v1/projects-statuses/{id}?";
|
|
3004
|
+
if (id === undefined || id === null)
|
|
3005
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
3006
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
3007
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
3008
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
3009
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
3010
|
+
let options_ = {
|
|
3011
|
+
method: "GET",
|
|
3012
|
+
url: url_,
|
|
3013
|
+
headers: {
|
|
3014
|
+
"Accept": "application/json"
|
|
3015
|
+
},
|
|
3016
|
+
cancelToken
|
|
3017
|
+
};
|
|
3018
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
3019
|
+
return this.instance.request(transformedOptions_);
|
|
3020
|
+
}).catch((_error) => {
|
|
3021
|
+
if (isAxiosError(_error) && _error.response) {
|
|
3022
|
+
return _error.response;
|
|
3023
|
+
}
|
|
3024
|
+
else {
|
|
3025
|
+
throw _error;
|
|
3026
|
+
}
|
|
3027
|
+
}).then((_response) => {
|
|
3028
|
+
return this.transformResult(url_, _response, (_response) => this.processGet(_response));
|
|
3029
|
+
});
|
|
3030
|
+
}
|
|
3031
|
+
processGet(response) {
|
|
3032
|
+
const status = response.status;
|
|
3033
|
+
let _headers = {};
|
|
3034
|
+
if (response.headers && typeof response.headers === "object") {
|
|
3035
|
+
for (let k in response.headers) {
|
|
3036
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
3037
|
+
_headers[k] = response.headers[k];
|
|
3038
|
+
}
|
|
3039
|
+
}
|
|
3040
|
+
}
|
|
3041
|
+
if (status === 200) {
|
|
3042
|
+
const _responseText = response.data;
|
|
3043
|
+
let result200 = null;
|
|
3044
|
+
let resultData200 = _responseText;
|
|
3045
|
+
result200 = JSON.parse(resultData200);
|
|
3046
|
+
return Promise.resolve(result200);
|
|
3047
|
+
}
|
|
3048
|
+
else if (status === 404) {
|
|
3049
|
+
const _responseText = response.data;
|
|
3050
|
+
let result404 = null;
|
|
3051
|
+
let resultData404 = _responseText;
|
|
3052
|
+
result404 = JSON.parse(resultData404);
|
|
3053
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
3054
|
+
}
|
|
3055
|
+
else if (status === 401) {
|
|
3056
|
+
const _responseText = response.data;
|
|
3057
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
3058
|
+
}
|
|
3059
|
+
else if (status === 403) {
|
|
3060
|
+
const _responseText = response.data;
|
|
3061
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
3062
|
+
}
|
|
3063
|
+
else if (status !== 200 && status !== 204) {
|
|
3064
|
+
const _responseText = response.data;
|
|
3065
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
3066
|
+
}
|
|
3067
|
+
return Promise.resolve(null);
|
|
3068
|
+
}
|
|
3069
|
+
/**
|
|
3070
|
+
* Updates an existing project status and returns its description.
|
|
3071
|
+
* @param id Status identifier.
|
|
3072
|
+
* @param tenantId (optional) Tenant identifier.
|
|
3073
|
+
* @param body (optional) Status update parameters.
|
|
3074
|
+
* @return Success
|
|
3075
|
+
*/
|
|
3076
|
+
update(id, tenantId, body, cancelToken) {
|
|
3077
|
+
let url_ = this.baseUrl + "/api/backoffice/v1/projects-statuses/{id}?";
|
|
3078
|
+
if (id === undefined || id === null)
|
|
3079
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
3080
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
3081
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
3082
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
3083
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
3084
|
+
const content_ = JSON.stringify(body);
|
|
3085
|
+
let options_ = {
|
|
3086
|
+
data: content_,
|
|
3087
|
+
method: "PUT",
|
|
3088
|
+
url: url_,
|
|
3089
|
+
headers: {
|
|
3090
|
+
"Content-Type": "application/json",
|
|
3091
|
+
"Accept": "application/json"
|
|
3092
|
+
},
|
|
3093
|
+
cancelToken
|
|
3094
|
+
};
|
|
3095
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
3096
|
+
return this.instance.request(transformedOptions_);
|
|
3097
|
+
}).catch((_error) => {
|
|
3098
|
+
if (isAxiosError(_error) && _error.response) {
|
|
3099
|
+
return _error.response;
|
|
3100
|
+
}
|
|
3101
|
+
else {
|
|
3102
|
+
throw _error;
|
|
3103
|
+
}
|
|
3104
|
+
}).then((_response) => {
|
|
3105
|
+
return this.transformResult(url_, _response, (_response) => this.processUpdate(_response));
|
|
3106
|
+
});
|
|
3107
|
+
}
|
|
3108
|
+
processUpdate(response) {
|
|
3109
|
+
const status = response.status;
|
|
3110
|
+
let _headers = {};
|
|
3111
|
+
if (response.headers && typeof response.headers === "object") {
|
|
3112
|
+
for (let k in response.headers) {
|
|
3113
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
3114
|
+
_headers[k] = response.headers[k];
|
|
3115
|
+
}
|
|
3116
|
+
}
|
|
3117
|
+
}
|
|
3118
|
+
if (status === 200) {
|
|
3119
|
+
const _responseText = response.data;
|
|
3120
|
+
let result200 = null;
|
|
3121
|
+
let resultData200 = _responseText;
|
|
3122
|
+
result200 = JSON.parse(resultData200);
|
|
3123
|
+
return Promise.resolve(result200);
|
|
3124
|
+
}
|
|
3125
|
+
else if (status === 400) {
|
|
3126
|
+
const _responseText = response.data;
|
|
3127
|
+
let result400 = null;
|
|
3128
|
+
let resultData400 = _responseText;
|
|
3129
|
+
result400 = JSON.parse(resultData400);
|
|
3130
|
+
return throwException("Bad Request", status, _responseText, _headers, result400);
|
|
3131
|
+
}
|
|
3132
|
+
else if (status === 404) {
|
|
3133
|
+
const _responseText = response.data;
|
|
3134
|
+
let result404 = null;
|
|
3135
|
+
let resultData404 = _responseText;
|
|
3136
|
+
result404 = JSON.parse(resultData404);
|
|
3137
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
3138
|
+
}
|
|
3139
|
+
else if (status === 409) {
|
|
3140
|
+
const _responseText = response.data;
|
|
3141
|
+
let result409 = null;
|
|
3142
|
+
let resultData409 = _responseText;
|
|
3143
|
+
result409 = JSON.parse(resultData409);
|
|
3144
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
3145
|
+
}
|
|
3146
|
+
else if (status === 401) {
|
|
3147
|
+
const _responseText = response.data;
|
|
3148
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
3149
|
+
}
|
|
3150
|
+
else if (status === 403) {
|
|
3151
|
+
const _responseText = response.data;
|
|
3152
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
3153
|
+
}
|
|
3154
|
+
else if (status !== 200 && status !== 204) {
|
|
3155
|
+
const _responseText = response.data;
|
|
3156
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
3157
|
+
}
|
|
3158
|
+
return Promise.resolve(null);
|
|
3159
|
+
}
|
|
3160
|
+
/**
|
|
3161
|
+
* Deletes an existing project status and returns its description.
|
|
3162
|
+
* @param id Status identifier.
|
|
3163
|
+
* @param tenantId (optional) Tenant identifier.
|
|
3164
|
+
* @return Success
|
|
3165
|
+
*/
|
|
3166
|
+
delete(id, tenantId, cancelToken) {
|
|
3167
|
+
let url_ = this.baseUrl + "/api/backoffice/v1/projects-statuses/{id}?";
|
|
3168
|
+
if (id === undefined || id === null)
|
|
3169
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
3170
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
3171
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
3172
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
3173
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
3174
|
+
let options_ = {
|
|
3175
|
+
method: "DELETE",
|
|
3176
|
+
url: url_,
|
|
3177
|
+
headers: {
|
|
3178
|
+
"Accept": "application/json"
|
|
3179
|
+
},
|
|
3180
|
+
cancelToken
|
|
3181
|
+
};
|
|
3182
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
3183
|
+
return this.instance.request(transformedOptions_);
|
|
3184
|
+
}).catch((_error) => {
|
|
3185
|
+
if (isAxiosError(_error) && _error.response) {
|
|
3186
|
+
return _error.response;
|
|
3187
|
+
}
|
|
3188
|
+
else {
|
|
3189
|
+
throw _error;
|
|
3190
|
+
}
|
|
3191
|
+
}).then((_response) => {
|
|
3192
|
+
return this.transformResult(url_, _response, (_response) => this.processDelete(_response));
|
|
3193
|
+
});
|
|
3194
|
+
}
|
|
3195
|
+
processDelete(response) {
|
|
3196
|
+
const status = response.status;
|
|
3197
|
+
let _headers = {};
|
|
3198
|
+
if (response.headers && typeof response.headers === "object") {
|
|
3199
|
+
for (let k in response.headers) {
|
|
3200
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
3201
|
+
_headers[k] = response.headers[k];
|
|
3202
|
+
}
|
|
3203
|
+
}
|
|
3204
|
+
}
|
|
3205
|
+
if (status === 200) {
|
|
3206
|
+
const _responseText = response.data;
|
|
3207
|
+
let result200 = null;
|
|
3208
|
+
let resultData200 = _responseText;
|
|
3209
|
+
result200 = JSON.parse(resultData200);
|
|
3210
|
+
return Promise.resolve(result200);
|
|
3211
|
+
}
|
|
3212
|
+
else if (status === 404) {
|
|
3213
|
+
const _responseText = response.data;
|
|
3214
|
+
let result404 = null;
|
|
3215
|
+
let resultData404 = _responseText;
|
|
3216
|
+
result404 = JSON.parse(resultData404);
|
|
3217
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
3218
|
+
}
|
|
3219
|
+
else if (status === 409) {
|
|
3220
|
+
const _responseText = response.data;
|
|
3221
|
+
let result409 = null;
|
|
3222
|
+
let resultData409 = _responseText;
|
|
3223
|
+
result409 = JSON.parse(resultData409);
|
|
3224
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
3225
|
+
}
|
|
3226
|
+
else if (status === 401) {
|
|
3227
|
+
const _responseText = response.data;
|
|
3228
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
3229
|
+
}
|
|
3230
|
+
else if (status === 403) {
|
|
3231
|
+
const _responseText = response.data;
|
|
3232
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
3233
|
+
}
|
|
3234
|
+
else if (status !== 200 && status !== 204) {
|
|
3235
|
+
const _responseText = response.data;
|
|
3236
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
3237
|
+
}
|
|
3238
|
+
return Promise.resolve(null);
|
|
3239
|
+
}
|
|
3240
|
+
}
|
|
3241
|
+
BackOfficeApiClient.ProjectStatusesManagementApiClient = ProjectStatusesManagementApiClient;
|
|
3242
|
+
class ProjectStatusTransitionsManagementApiClient extends ApiClientBase {
|
|
3243
|
+
instance;
|
|
3244
|
+
baseUrl;
|
|
3245
|
+
jsonParseReviver = undefined;
|
|
3246
|
+
constructor(configuration, baseUrl, instance) {
|
|
3247
|
+
super(configuration);
|
|
3248
|
+
this.instance = instance ? instance : axios.create();
|
|
3249
|
+
this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : this.getBaseUrl("");
|
|
3250
|
+
}
|
|
3251
|
+
/**
|
|
3252
|
+
* Returns a list of all existing project status transitions.
|
|
3253
|
+
* @param tenantId (optional) Tenant identifier.
|
|
3254
|
+
* @return Success
|
|
3255
|
+
*/
|
|
3256
|
+
getAll(tenantId, cancelToken) {
|
|
3257
|
+
let url_ = this.baseUrl + "/api/backoffice/v1/projects-transitions?";
|
|
3258
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
3259
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
3260
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
3261
|
+
let options_ = {
|
|
3262
|
+
method: "GET",
|
|
3263
|
+
url: url_,
|
|
3264
|
+
headers: {
|
|
3265
|
+
"Accept": "application/json"
|
|
3266
|
+
},
|
|
3267
|
+
cancelToken
|
|
3268
|
+
};
|
|
3269
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
3270
|
+
return this.instance.request(transformedOptions_);
|
|
3271
|
+
}).catch((_error) => {
|
|
3272
|
+
if (isAxiosError(_error) && _error.response) {
|
|
3273
|
+
return _error.response;
|
|
3274
|
+
}
|
|
3275
|
+
else {
|
|
3276
|
+
throw _error;
|
|
3277
|
+
}
|
|
3278
|
+
}).then((_response) => {
|
|
3279
|
+
return this.transformResult(url_, _response, (_response) => this.processGetAll(_response));
|
|
3280
|
+
});
|
|
3281
|
+
}
|
|
3282
|
+
processGetAll(response) {
|
|
3283
|
+
const status = response.status;
|
|
3284
|
+
let _headers = {};
|
|
3285
|
+
if (response.headers && typeof response.headers === "object") {
|
|
3286
|
+
for (let k in response.headers) {
|
|
3287
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
3288
|
+
_headers[k] = response.headers[k];
|
|
3289
|
+
}
|
|
3290
|
+
}
|
|
3291
|
+
}
|
|
3292
|
+
if (status === 200) {
|
|
3293
|
+
const _responseText = response.data;
|
|
3294
|
+
let result200 = null;
|
|
3295
|
+
let resultData200 = _responseText;
|
|
3296
|
+
result200 = JSON.parse(resultData200);
|
|
3297
|
+
return Promise.resolve(result200);
|
|
3298
|
+
}
|
|
3299
|
+
else if (status === 401) {
|
|
3300
|
+
const _responseText = response.data;
|
|
3301
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
3302
|
+
}
|
|
3303
|
+
else if (status === 403) {
|
|
3304
|
+
const _responseText = response.data;
|
|
3305
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
3306
|
+
}
|
|
3307
|
+
else if (status !== 200 && status !== 204) {
|
|
3308
|
+
const _responseText = response.data;
|
|
3309
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
3310
|
+
}
|
|
3311
|
+
return Promise.resolve(null);
|
|
3312
|
+
}
|
|
3313
|
+
/**
|
|
3314
|
+
* Returns a project status transition by its identifier.
|
|
3315
|
+
* @param id Status transition identifier.
|
|
3316
|
+
* @param tenantId (optional) Tenant identifier.
|
|
3317
|
+
* @return Success
|
|
3318
|
+
*/
|
|
3319
|
+
get(id, tenantId, cancelToken) {
|
|
3320
|
+
let url_ = this.baseUrl + "/api/backoffice/v1/projects-transitions/{id}?";
|
|
3321
|
+
if (id === undefined || id === null)
|
|
3322
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
3323
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
3324
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
3325
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
3326
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
3327
|
+
let options_ = {
|
|
3328
|
+
method: "GET",
|
|
3329
|
+
url: url_,
|
|
3330
|
+
headers: {
|
|
3331
|
+
"Accept": "application/json"
|
|
3332
|
+
},
|
|
3333
|
+
cancelToken
|
|
3334
|
+
};
|
|
3335
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
3336
|
+
return this.instance.request(transformedOptions_);
|
|
3337
|
+
}).catch((_error) => {
|
|
3338
|
+
if (isAxiosError(_error) && _error.response) {
|
|
3339
|
+
return _error.response;
|
|
3340
|
+
}
|
|
3341
|
+
else {
|
|
3342
|
+
throw _error;
|
|
3343
|
+
}
|
|
3344
|
+
}).then((_response) => {
|
|
3345
|
+
return this.transformResult(url_, _response, (_response) => this.processGet(_response));
|
|
3346
|
+
});
|
|
3347
|
+
}
|
|
3348
|
+
processGet(response) {
|
|
3349
|
+
const status = response.status;
|
|
3350
|
+
let _headers = {};
|
|
3351
|
+
if (response.headers && typeof response.headers === "object") {
|
|
3352
|
+
for (let k in response.headers) {
|
|
3353
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
3354
|
+
_headers[k] = response.headers[k];
|
|
3355
|
+
}
|
|
3356
|
+
}
|
|
3357
|
+
}
|
|
3358
|
+
if (status === 200) {
|
|
3359
|
+
const _responseText = response.data;
|
|
3360
|
+
let result200 = null;
|
|
3361
|
+
let resultData200 = _responseText;
|
|
3362
|
+
result200 = JSON.parse(resultData200);
|
|
3363
|
+
return Promise.resolve(result200);
|
|
3364
|
+
}
|
|
3365
|
+
else if (status === 404) {
|
|
3366
|
+
const _responseText = response.data;
|
|
3367
|
+
let result404 = null;
|
|
3368
|
+
let resultData404 = _responseText;
|
|
3369
|
+
result404 = JSON.parse(resultData404);
|
|
3370
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
3371
|
+
}
|
|
3372
|
+
else if (status === 401) {
|
|
3373
|
+
const _responseText = response.data;
|
|
3374
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
3375
|
+
}
|
|
3376
|
+
else if (status === 403) {
|
|
3377
|
+
const _responseText = response.data;
|
|
3378
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
3379
|
+
}
|
|
3380
|
+
else if (status !== 200 && status !== 204) {
|
|
3381
|
+
const _responseText = response.data;
|
|
3382
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
3383
|
+
}
|
|
3384
|
+
return Promise.resolve(null);
|
|
3385
|
+
}
|
|
3386
|
+
/**
|
|
3387
|
+
* Updates an existing project status transition and returns its description.
|
|
3388
|
+
* @param id Status transition identifier.
|
|
3389
|
+
* @param tenantId (optional) Tenant identifier.
|
|
3390
|
+
* @param body (optional) Status transition update parameters.
|
|
3391
|
+
* @return Success
|
|
3392
|
+
*/
|
|
3393
|
+
update(id, tenantId, body, cancelToken) {
|
|
3394
|
+
let url_ = this.baseUrl + "/api/backoffice/v1/projects-transitions/{id}?";
|
|
3395
|
+
if (id === undefined || id === null)
|
|
3396
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
3397
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
3398
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
3399
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
3400
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
3401
|
+
const content_ = JSON.stringify(body);
|
|
3402
|
+
let options_ = {
|
|
3403
|
+
data: content_,
|
|
3404
|
+
method: "PUT",
|
|
3405
|
+
url: url_,
|
|
3406
|
+
headers: {
|
|
3407
|
+
"Content-Type": "application/json",
|
|
3408
|
+
"Accept": "application/json"
|
|
3409
|
+
},
|
|
3410
|
+
cancelToken
|
|
3411
|
+
};
|
|
3412
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
3413
|
+
return this.instance.request(transformedOptions_);
|
|
3414
|
+
}).catch((_error) => {
|
|
3415
|
+
if (isAxiosError(_error) && _error.response) {
|
|
3416
|
+
return _error.response;
|
|
3417
|
+
}
|
|
3418
|
+
else {
|
|
3419
|
+
throw _error;
|
|
3420
|
+
}
|
|
3421
|
+
}).then((_response) => {
|
|
3422
|
+
return this.transformResult(url_, _response, (_response) => this.processUpdate(_response));
|
|
3423
|
+
});
|
|
3424
|
+
}
|
|
3425
|
+
processUpdate(response) {
|
|
3426
|
+
const status = response.status;
|
|
3427
|
+
let _headers = {};
|
|
3428
|
+
if (response.headers && typeof response.headers === "object") {
|
|
3429
|
+
for (let k in response.headers) {
|
|
3430
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
3431
|
+
_headers[k] = response.headers[k];
|
|
3432
|
+
}
|
|
3433
|
+
}
|
|
3434
|
+
}
|
|
3435
|
+
if (status === 200) {
|
|
3436
|
+
const _responseText = response.data;
|
|
3437
|
+
let result200 = null;
|
|
3438
|
+
let resultData200 = _responseText;
|
|
3439
|
+
result200 = JSON.parse(resultData200);
|
|
3440
|
+
return Promise.resolve(result200);
|
|
3441
|
+
}
|
|
3442
|
+
else if (status === 400) {
|
|
3443
|
+
const _responseText = response.data;
|
|
3444
|
+
let result400 = null;
|
|
3445
|
+
let resultData400 = _responseText;
|
|
3446
|
+
result400 = JSON.parse(resultData400);
|
|
3447
|
+
return throwException("Bad Request", status, _responseText, _headers, result400);
|
|
3448
|
+
}
|
|
3449
|
+
else if (status === 404) {
|
|
3450
|
+
const _responseText = response.data;
|
|
3451
|
+
let result404 = null;
|
|
3452
|
+
let resultData404 = _responseText;
|
|
3453
|
+
result404 = JSON.parse(resultData404);
|
|
3454
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
3455
|
+
}
|
|
3456
|
+
else if (status === 409) {
|
|
3457
|
+
const _responseText = response.data;
|
|
3458
|
+
let result409 = null;
|
|
3459
|
+
let resultData409 = _responseText;
|
|
3460
|
+
result409 = JSON.parse(resultData409);
|
|
3461
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
3462
|
+
}
|
|
3463
|
+
else if (status === 401) {
|
|
3464
|
+
const _responseText = response.data;
|
|
3465
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
3466
|
+
}
|
|
3467
|
+
else if (status === 403) {
|
|
3468
|
+
const _responseText = response.data;
|
|
3469
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
3470
|
+
}
|
|
3471
|
+
else if (status !== 200 && status !== 204) {
|
|
3472
|
+
const _responseText = response.data;
|
|
3473
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
3474
|
+
}
|
|
3475
|
+
return Promise.resolve(null);
|
|
3476
|
+
}
|
|
3477
|
+
/**
|
|
3478
|
+
* Deletes an existing project status transition and returns its description.
|
|
3479
|
+
* @param id Status transition identifier.
|
|
3480
|
+
* @param tenantId (optional) Tenant identifier.
|
|
3481
|
+
* @return Success
|
|
3482
|
+
*/
|
|
3483
|
+
delete(id, tenantId, cancelToken) {
|
|
3484
|
+
let url_ = this.baseUrl + "/api/backoffice/v1/projects-transitions/{id}?";
|
|
3485
|
+
if (id === undefined || id === null)
|
|
3486
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
3487
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
3488
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
3489
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
3490
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
3491
|
+
let options_ = {
|
|
3492
|
+
method: "DELETE",
|
|
3493
|
+
url: url_,
|
|
3494
|
+
headers: {
|
|
3495
|
+
"Accept": "application/json"
|
|
3496
|
+
},
|
|
3497
|
+
cancelToken
|
|
3498
|
+
};
|
|
3499
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
3500
|
+
return this.instance.request(transformedOptions_);
|
|
3501
|
+
}).catch((_error) => {
|
|
3502
|
+
if (isAxiosError(_error) && _error.response) {
|
|
3503
|
+
return _error.response;
|
|
3504
|
+
}
|
|
3505
|
+
else {
|
|
3506
|
+
throw _error;
|
|
3507
|
+
}
|
|
3508
|
+
}).then((_response) => {
|
|
3509
|
+
return this.transformResult(url_, _response, (_response) => this.processDelete(_response));
|
|
3510
|
+
});
|
|
3511
|
+
}
|
|
3512
|
+
processDelete(response) {
|
|
3513
|
+
const status = response.status;
|
|
3514
|
+
let _headers = {};
|
|
3515
|
+
if (response.headers && typeof response.headers === "object") {
|
|
3516
|
+
for (let k in response.headers) {
|
|
3517
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
3518
|
+
_headers[k] = response.headers[k];
|
|
3519
|
+
}
|
|
3520
|
+
}
|
|
3521
|
+
}
|
|
3522
|
+
if (status === 200) {
|
|
3523
|
+
const _responseText = response.data;
|
|
3524
|
+
let result200 = null;
|
|
3525
|
+
let resultData200 = _responseText;
|
|
3526
|
+
result200 = JSON.parse(resultData200);
|
|
3527
|
+
return Promise.resolve(result200);
|
|
3528
|
+
}
|
|
3529
|
+
else if (status === 404) {
|
|
3530
|
+
const _responseText = response.data;
|
|
3531
|
+
let result404 = null;
|
|
3532
|
+
let resultData404 = _responseText;
|
|
3533
|
+
result404 = JSON.parse(resultData404);
|
|
3534
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
3535
|
+
}
|
|
3536
|
+
else if (status === 401) {
|
|
3537
|
+
const _responseText = response.data;
|
|
3538
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
3539
|
+
}
|
|
3540
|
+
else if (status === 403) {
|
|
3541
|
+
const _responseText = response.data;
|
|
3542
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
3543
|
+
}
|
|
3544
|
+
else if (status !== 200 && status !== 204) {
|
|
3545
|
+
const _responseText = response.data;
|
|
3546
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
3547
|
+
}
|
|
3548
|
+
return Promise.resolve(null);
|
|
3549
|
+
}
|
|
3550
|
+
/**
|
|
3551
|
+
* Creates a new project status transition and returns its description.
|
|
3552
|
+
* @param tenantId (optional) Tenant identifier.
|
|
3553
|
+
* @param body (optional) Status transition creation parameters.
|
|
3554
|
+
* @return Success
|
|
3555
|
+
*/
|
|
3556
|
+
create(tenantId, body, cancelToken) {
|
|
3557
|
+
let url_ = this.baseUrl + "/api/backoffice/v1/projects-transitions/transitions?";
|
|
3558
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
3559
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
3560
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
3561
|
+
const content_ = JSON.stringify(body);
|
|
3562
|
+
let options_ = {
|
|
3563
|
+
data: content_,
|
|
3564
|
+
method: "POST",
|
|
3565
|
+
url: url_,
|
|
3566
|
+
headers: {
|
|
3567
|
+
"Content-Type": "application/json",
|
|
3568
|
+
"Accept": "application/json"
|
|
3569
|
+
},
|
|
3570
|
+
cancelToken
|
|
3571
|
+
};
|
|
3572
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
3573
|
+
return this.instance.request(transformedOptions_);
|
|
3574
|
+
}).catch((_error) => {
|
|
3575
|
+
if (isAxiosError(_error) && _error.response) {
|
|
3576
|
+
return _error.response;
|
|
3577
|
+
}
|
|
3578
|
+
else {
|
|
3579
|
+
throw _error;
|
|
3580
|
+
}
|
|
3581
|
+
}).then((_response) => {
|
|
3582
|
+
return this.transformResult(url_, _response, (_response) => this.processCreate(_response));
|
|
3583
|
+
});
|
|
3584
|
+
}
|
|
3585
|
+
processCreate(response) {
|
|
3586
|
+
const status = response.status;
|
|
3587
|
+
let _headers = {};
|
|
3588
|
+
if (response.headers && typeof response.headers === "object") {
|
|
3589
|
+
for (let k in response.headers) {
|
|
3590
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
3591
|
+
_headers[k] = response.headers[k];
|
|
3592
|
+
}
|
|
3593
|
+
}
|
|
3594
|
+
}
|
|
3595
|
+
if (status === 201) {
|
|
3596
|
+
const _responseText = response.data;
|
|
3597
|
+
let result201 = null;
|
|
3598
|
+
let resultData201 = _responseText;
|
|
3599
|
+
result201 = JSON.parse(resultData201);
|
|
3600
|
+
return Promise.resolve(result201);
|
|
3601
|
+
}
|
|
3602
|
+
else if (status === 400) {
|
|
3603
|
+
const _responseText = response.data;
|
|
3604
|
+
let result400 = null;
|
|
3605
|
+
let resultData400 = _responseText;
|
|
3606
|
+
result400 = JSON.parse(resultData400);
|
|
3607
|
+
return throwException("Bad Request", status, _responseText, _headers, result400);
|
|
3608
|
+
}
|
|
3609
|
+
else if (status === 409) {
|
|
3610
|
+
const _responseText = response.data;
|
|
3611
|
+
let result409 = null;
|
|
3612
|
+
let resultData409 = _responseText;
|
|
3613
|
+
result409 = JSON.parse(resultData409);
|
|
3614
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
3615
|
+
}
|
|
3616
|
+
else if (status === 401) {
|
|
3617
|
+
const _responseText = response.data;
|
|
3618
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
3619
|
+
}
|
|
3620
|
+
else if (status === 403) {
|
|
3621
|
+
const _responseText = response.data;
|
|
3622
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
3623
|
+
}
|
|
3624
|
+
else if (status !== 200 && status !== 204) {
|
|
3625
|
+
const _responseText = response.data;
|
|
3626
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
3627
|
+
}
|
|
3628
|
+
return Promise.resolve(null);
|
|
3629
|
+
}
|
|
3630
|
+
}
|
|
3631
|
+
BackOfficeApiClient.ProjectStatusTransitionsManagementApiClient = ProjectStatusTransitionsManagementApiClient;
|
|
2605
3632
|
class StorefrontsManagementApiClient extends ApiClientBase {
|
|
2606
3633
|
instance;
|
|
2607
3634
|
baseUrl;
|
|
@@ -2618,10 +3645,11 @@ export var BackOfficeApiClient;
|
|
|
2618
3645
|
* @param take (optional) Defines page length (how many consequent items of sorted result list should be taken).
|
|
2619
3646
|
* @param sorting (optional) Defines sorting order of result list e.g.: "Title ASC, LastModified DESC".
|
|
2620
3647
|
* @param search (optional) Search string for partial match.
|
|
3648
|
+
* @param status (optional) Storefront status.
|
|
2621
3649
|
* @param tenantId (optional) Tenant identifier.
|
|
2622
3650
|
* @return Success
|
|
2623
3651
|
*/
|
|
2624
|
-
getAll(types, skip, take, sorting, search, tenantId, cancelToken) {
|
|
3652
|
+
getAll(types, skip, take, sorting, search, status, tenantId, cancelToken) {
|
|
2625
3653
|
let url_ = this.baseUrl + "/api/backoffice/v1/storefronts?";
|
|
2626
3654
|
if (types !== undefined && types !== null)
|
|
2627
3655
|
types && types.forEach(item => { url_ += "types=" + encodeURIComponent("" + item) + "&"; });
|
|
@@ -2633,6 +3661,8 @@ export var BackOfficeApiClient;
|
|
|
2633
3661
|
url_ += "sorting=" + encodeURIComponent("" + sorting) + "&";
|
|
2634
3662
|
if (search !== undefined && search !== null)
|
|
2635
3663
|
url_ += "search=" + encodeURIComponent("" + search) + "&";
|
|
3664
|
+
if (status !== undefined && status !== null)
|
|
3665
|
+
url_ += "status=" + encodeURIComponent("" + status) + "&";
|
|
2636
3666
|
if (tenantId !== undefined && tenantId !== null)
|
|
2637
3667
|
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2638
3668
|
url_ = url_.replace(/[?&]$/, "");
|
|
@@ -4039,6 +5069,12 @@ export var BackOfficeApiClient;
|
|
|
4039
5069
|
StorefrontType["Shopify"] = "Shopify";
|
|
4040
5070
|
StorefrontType["ShopifyCustom"] = "ShopifyCustom";
|
|
4041
5071
|
})(StorefrontType = BackOfficeApiClient.StorefrontType || (BackOfficeApiClient.StorefrontType = {}));
|
|
5072
|
+
/** Storefront status. */
|
|
5073
|
+
let StorefrontStatus;
|
|
5074
|
+
(function (StorefrontStatus) {
|
|
5075
|
+
StorefrontStatus["Dev"] = "Dev";
|
|
5076
|
+
StorefrontStatus["Prod"] = "Prod";
|
|
5077
|
+
})(StorefrontStatus = BackOfficeApiClient.StorefrontStatus || (BackOfficeApiClient.StorefrontStatus = {}));
|
|
4042
5078
|
class ApiException extends Error {
|
|
4043
5079
|
message;
|
|
4044
5080
|
status;
|