@aurigma/axios-backoffice-api-client 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/LICENSE.md +9 -0
- package/README.md +96 -0
- package/dist/cjs/backoffice-api-client.d.ts +1903 -0
- package/dist/cjs/backoffice-api-client.js +3883 -0
- package/dist/cjs/backoffice-api-client.js.map +1 -0
- package/dist/esm/backoffice-api-client.d.ts +1903 -0
- package/dist/esm/backoffice-api-client.js +3880 -0
- package/dist/esm/backoffice-api-client.js.map +1 -0
- package/package.json +46 -0
|
@@ -0,0 +1,3880 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
//----------------------
|
|
4
|
+
// <auto-generated>
|
|
5
|
+
// Generated using the NSwag toolchain v13.15.5.0 (NJsonSchema v10.6.6.0 (Newtonsoft.Json v11.0.0.0)) (http://NSwag.org)
|
|
6
|
+
// </auto-generated>
|
|
7
|
+
//----------------------
|
|
8
|
+
// ReSharper disable InconsistentNaming
|
|
9
|
+
import axios from 'axios';
|
|
10
|
+
export var BackOfficeApiClient;
|
|
11
|
+
(function (BackOfficeApiClient) {
|
|
12
|
+
class ApiClientConfiguration {
|
|
13
|
+
apiUrl;
|
|
14
|
+
apiKey = '';
|
|
15
|
+
authorizationToken = null;
|
|
16
|
+
async getAuthorizationToken() { return this.authorizationToken; }
|
|
17
|
+
;
|
|
18
|
+
setAuthorizationToken(token) { this.authorizationToken = token; }
|
|
19
|
+
;
|
|
20
|
+
}
|
|
21
|
+
BackOfficeApiClient.ApiClientConfiguration = ApiClientConfiguration;
|
|
22
|
+
class ApiClientBase {
|
|
23
|
+
configuration;
|
|
24
|
+
constructor(configuration) {
|
|
25
|
+
this.configuration = configuration;
|
|
26
|
+
}
|
|
27
|
+
async transformOptions(options) {
|
|
28
|
+
const token = await this.configuration.getAuthorizationToken();
|
|
29
|
+
if (token != null) {
|
|
30
|
+
options.headers = { ...options.headers, authorization: ' Bearer ' + token };
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
options.headers = { ...options.headers, 'X-API-Key': this.configuration.apiKey };
|
|
34
|
+
}
|
|
35
|
+
options = { ...options, transformResponse: (res) => res };
|
|
36
|
+
if (!options.responseType) {
|
|
37
|
+
options.responseType = 'json';
|
|
38
|
+
}
|
|
39
|
+
if (options.responseType == 'blob') {
|
|
40
|
+
options.responseType = 'arraybuffer';
|
|
41
|
+
}
|
|
42
|
+
return options;
|
|
43
|
+
}
|
|
44
|
+
getBaseUrl(defultUrl) {
|
|
45
|
+
return this.configuration.apiUrl;
|
|
46
|
+
}
|
|
47
|
+
transformResult(url, res, cb) {
|
|
48
|
+
return cb(res);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
BackOfficeApiClient.ApiClientBase = ApiClientBase;
|
|
52
|
+
class BuildInfoApiClient extends ApiClientBase {
|
|
53
|
+
instance;
|
|
54
|
+
baseUrl;
|
|
55
|
+
jsonParseReviver = undefined;
|
|
56
|
+
constructor(configuration, baseUrl, instance) {
|
|
57
|
+
super(configuration);
|
|
58
|
+
this.instance = instance ? instance : axios.create();
|
|
59
|
+
this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : this.getBaseUrl("");
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Returns assembly build info.
|
|
63
|
+
* @return Success
|
|
64
|
+
*/
|
|
65
|
+
headInfo(cancelToken) {
|
|
66
|
+
let url_ = this.baseUrl + "/api/backoffice/v1/info";
|
|
67
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
68
|
+
let options_ = {
|
|
69
|
+
method: "HEAD",
|
|
70
|
+
url: url_,
|
|
71
|
+
headers: {},
|
|
72
|
+
cancelToken
|
|
73
|
+
};
|
|
74
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
75
|
+
return this.instance.request(transformedOptions_);
|
|
76
|
+
}).catch((_error) => {
|
|
77
|
+
if (isAxiosError(_error) && _error.response) {
|
|
78
|
+
return _error.response;
|
|
79
|
+
}
|
|
80
|
+
else {
|
|
81
|
+
throw _error;
|
|
82
|
+
}
|
|
83
|
+
}).then((_response) => {
|
|
84
|
+
return this.transformResult(url_, _response, (_response) => this.processHeadInfo(_response));
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
processHeadInfo(response) {
|
|
88
|
+
const status = response.status;
|
|
89
|
+
let _headers = {};
|
|
90
|
+
if (response.headers && typeof response.headers === "object") {
|
|
91
|
+
for (let k in response.headers) {
|
|
92
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
93
|
+
_headers[k] = response.headers[k];
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
if (status === 200) {
|
|
98
|
+
const _responseText = response.data;
|
|
99
|
+
return Promise.resolve(null);
|
|
100
|
+
}
|
|
101
|
+
else if (status !== 200 && status !== 204) {
|
|
102
|
+
const _responseText = response.data;
|
|
103
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
104
|
+
}
|
|
105
|
+
return Promise.resolve(null);
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Returns assembly build info.
|
|
109
|
+
* @return Success
|
|
110
|
+
*/
|
|
111
|
+
getInfo(cancelToken) {
|
|
112
|
+
let url_ = this.baseUrl + "/api/backoffice/v1/info";
|
|
113
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
114
|
+
let options_ = {
|
|
115
|
+
method: "GET",
|
|
116
|
+
url: url_,
|
|
117
|
+
headers: {
|
|
118
|
+
"Accept": "application/json"
|
|
119
|
+
},
|
|
120
|
+
cancelToken
|
|
121
|
+
};
|
|
122
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
123
|
+
return this.instance.request(transformedOptions_);
|
|
124
|
+
}).catch((_error) => {
|
|
125
|
+
if (isAxiosError(_error) && _error.response) {
|
|
126
|
+
return _error.response;
|
|
127
|
+
}
|
|
128
|
+
else {
|
|
129
|
+
throw _error;
|
|
130
|
+
}
|
|
131
|
+
}).then((_response) => {
|
|
132
|
+
return this.transformResult(url_, _response, (_response) => this.processGetInfo(_response));
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
processGetInfo(response) {
|
|
136
|
+
const status = response.status;
|
|
137
|
+
let _headers = {};
|
|
138
|
+
if (response.headers && typeof response.headers === "object") {
|
|
139
|
+
for (let k in response.headers) {
|
|
140
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
141
|
+
_headers[k] = response.headers[k];
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
if (status === 200) {
|
|
146
|
+
const _responseText = response.data;
|
|
147
|
+
let result200 = null;
|
|
148
|
+
let resultData200 = _responseText;
|
|
149
|
+
result200 = JSON.parse(resultData200);
|
|
150
|
+
return Promise.resolve(result200);
|
|
151
|
+
}
|
|
152
|
+
else if (status !== 200 && status !== 204) {
|
|
153
|
+
const _responseText = response.data;
|
|
154
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
155
|
+
}
|
|
156
|
+
return Promise.resolve(null);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
BackOfficeApiClient.BuildInfoApiClient = BuildInfoApiClient;
|
|
160
|
+
class ProductReferencesManagementApiClient extends ApiClientBase {
|
|
161
|
+
instance;
|
|
162
|
+
baseUrl;
|
|
163
|
+
jsonParseReviver = undefined;
|
|
164
|
+
constructor(configuration, baseUrl, instance) {
|
|
165
|
+
super(configuration);
|
|
166
|
+
this.instance = instance ? instance : axios.create();
|
|
167
|
+
this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : this.getBaseUrl("");
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* Returns all storefront product references relevant to the specified query parameters.
|
|
171
|
+
* @param storefrontId Storefront identifier.
|
|
172
|
+
* @param productReference (optional) Product reference filter.
|
|
173
|
+
Product reference is an external reference to Customer's Canvas product, e.g online store product identifier.
|
|
174
|
+
* @param productSpecificationId (optional) Customer's Canvas product specification filter.
|
|
175
|
+
* @param productId (optional) Customer's Canvas product filter.
|
|
176
|
+
* @param productLinkId (optional) Customer's Canvas product link filter.
|
|
177
|
+
* @param skip (optional) Defines page start offset from beginning of sorted result list.
|
|
178
|
+
* @param take (optional) Defines page length (how many consequent items of sorted result list should be taken).
|
|
179
|
+
* @param sorting (optional) Defines sorting order of result list e.g.: "Title ASC, LastModified DESC".
|
|
180
|
+
* @param search (optional) Search string for partial match.
|
|
181
|
+
* @param sku (optional) SKU filter.
|
|
182
|
+
* @param tags (optional) List of tags that product should have.
|
|
183
|
+
* @param customFields (optional) Serialized custom fields dictionary filter. For example: {"public":"true","name":"my item"}.
|
|
184
|
+
* @param tenantId (optional) Tenant identifier.
|
|
185
|
+
* @return Success
|
|
186
|
+
*/
|
|
187
|
+
getAll(storefrontId, productReference, productSpecificationId, productId, productLinkId, skip, take, sorting, search, sku, tags, customFields, tenantId, cancelToken) {
|
|
188
|
+
let url_ = this.baseUrl + "/api/backoffice/v1/product-references?";
|
|
189
|
+
if (storefrontId === undefined || storefrontId === null)
|
|
190
|
+
throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
|
|
191
|
+
else
|
|
192
|
+
url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
|
|
193
|
+
if (productReference !== undefined && productReference !== null)
|
|
194
|
+
url_ += "productReference=" + encodeURIComponent("" + productReference) + "&";
|
|
195
|
+
if (productSpecificationId !== undefined && productSpecificationId !== null)
|
|
196
|
+
url_ += "productSpecificationId=" + encodeURIComponent("" + productSpecificationId) + "&";
|
|
197
|
+
if (productId !== undefined && productId !== null)
|
|
198
|
+
url_ += "productId=" + encodeURIComponent("" + productId) + "&";
|
|
199
|
+
if (productLinkId !== undefined && productLinkId !== null)
|
|
200
|
+
url_ += "productLinkId=" + encodeURIComponent("" + productLinkId) + "&";
|
|
201
|
+
if (skip !== undefined && skip !== null)
|
|
202
|
+
url_ += "skip=" + encodeURIComponent("" + skip) + "&";
|
|
203
|
+
if (take !== undefined && take !== null)
|
|
204
|
+
url_ += "take=" + encodeURIComponent("" + take) + "&";
|
|
205
|
+
if (sorting !== undefined && sorting !== null)
|
|
206
|
+
url_ += "sorting=" + encodeURIComponent("" + sorting) + "&";
|
|
207
|
+
if (search !== undefined && search !== null)
|
|
208
|
+
url_ += "search=" + encodeURIComponent("" + search) + "&";
|
|
209
|
+
if (sku !== undefined && sku !== null)
|
|
210
|
+
url_ += "sku=" + encodeURIComponent("" + sku) + "&";
|
|
211
|
+
if (tags !== undefined && tags !== null)
|
|
212
|
+
tags && tags.forEach(item => { url_ += "tags=" + encodeURIComponent("" + item) + "&"; });
|
|
213
|
+
if (customFields !== undefined && customFields !== null)
|
|
214
|
+
url_ += "customFields=" + encodeURIComponent("" + customFields) + "&";
|
|
215
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
216
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
217
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
218
|
+
let options_ = {
|
|
219
|
+
method: "GET",
|
|
220
|
+
url: url_,
|
|
221
|
+
headers: {
|
|
222
|
+
"Accept": "application/json"
|
|
223
|
+
},
|
|
224
|
+
cancelToken
|
|
225
|
+
};
|
|
226
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
227
|
+
return this.instance.request(transformedOptions_);
|
|
228
|
+
}).catch((_error) => {
|
|
229
|
+
if (isAxiosError(_error) && _error.response) {
|
|
230
|
+
return _error.response;
|
|
231
|
+
}
|
|
232
|
+
else {
|
|
233
|
+
throw _error;
|
|
234
|
+
}
|
|
235
|
+
}).then((_response) => {
|
|
236
|
+
return this.transformResult(url_, _response, (_response) => this.processGetAll(_response));
|
|
237
|
+
});
|
|
238
|
+
}
|
|
239
|
+
processGetAll(response) {
|
|
240
|
+
const status = response.status;
|
|
241
|
+
let _headers = {};
|
|
242
|
+
if (response.headers && typeof response.headers === "object") {
|
|
243
|
+
for (let k in response.headers) {
|
|
244
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
245
|
+
_headers[k] = response.headers[k];
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
if (status === 200) {
|
|
250
|
+
const _responseText = response.data;
|
|
251
|
+
let result200 = null;
|
|
252
|
+
let resultData200 = _responseText;
|
|
253
|
+
result200 = JSON.parse(resultData200);
|
|
254
|
+
return Promise.resolve(result200);
|
|
255
|
+
}
|
|
256
|
+
else if (status === 409) {
|
|
257
|
+
const _responseText = response.data;
|
|
258
|
+
let result409 = null;
|
|
259
|
+
let resultData409 = _responseText;
|
|
260
|
+
result409 = JSON.parse(resultData409);
|
|
261
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
262
|
+
}
|
|
263
|
+
else if (status === 401) {
|
|
264
|
+
const _responseText = response.data;
|
|
265
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
266
|
+
}
|
|
267
|
+
else if (status === 403) {
|
|
268
|
+
const _responseText = response.data;
|
|
269
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
270
|
+
}
|
|
271
|
+
else if (status !== 200 && status !== 204) {
|
|
272
|
+
const _responseText = response.data;
|
|
273
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
274
|
+
}
|
|
275
|
+
return Promise.resolve(null);
|
|
276
|
+
}
|
|
277
|
+
/**
|
|
278
|
+
* Creates a new storefront product reference.
|
|
279
|
+
* @param storefrontId Storefront identifier.
|
|
280
|
+
* @param tenantId (optional) Tenant identifier.
|
|
281
|
+
* @param body (optional) Create operation parameters.
|
|
282
|
+
* @return Success
|
|
283
|
+
*/
|
|
284
|
+
create(storefrontId, tenantId, body, cancelToken) {
|
|
285
|
+
let url_ = this.baseUrl + "/api/backoffice/v1/product-references?";
|
|
286
|
+
if (storefrontId === undefined || storefrontId === null)
|
|
287
|
+
throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
|
|
288
|
+
else
|
|
289
|
+
url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
|
|
290
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
291
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
292
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
293
|
+
const content_ = JSON.stringify(body);
|
|
294
|
+
let options_ = {
|
|
295
|
+
data: content_,
|
|
296
|
+
method: "POST",
|
|
297
|
+
url: url_,
|
|
298
|
+
headers: {
|
|
299
|
+
"Content-Type": "application/json",
|
|
300
|
+
"Accept": "application/json"
|
|
301
|
+
},
|
|
302
|
+
cancelToken
|
|
303
|
+
};
|
|
304
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
305
|
+
return this.instance.request(transformedOptions_);
|
|
306
|
+
}).catch((_error) => {
|
|
307
|
+
if (isAxiosError(_error) && _error.response) {
|
|
308
|
+
return _error.response;
|
|
309
|
+
}
|
|
310
|
+
else {
|
|
311
|
+
throw _error;
|
|
312
|
+
}
|
|
313
|
+
}).then((_response) => {
|
|
314
|
+
return this.transformResult(url_, _response, (_response) => this.processCreate(_response));
|
|
315
|
+
});
|
|
316
|
+
}
|
|
317
|
+
processCreate(response) {
|
|
318
|
+
const status = response.status;
|
|
319
|
+
let _headers = {};
|
|
320
|
+
if (response.headers && typeof response.headers === "object") {
|
|
321
|
+
for (let k in response.headers) {
|
|
322
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
323
|
+
_headers[k] = response.headers[k];
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
if (status === 201) {
|
|
328
|
+
const _responseText = response.data;
|
|
329
|
+
let result201 = null;
|
|
330
|
+
let resultData201 = _responseText;
|
|
331
|
+
result201 = JSON.parse(resultData201);
|
|
332
|
+
return Promise.resolve(result201);
|
|
333
|
+
}
|
|
334
|
+
else if (status === 404) {
|
|
335
|
+
const _responseText = response.data;
|
|
336
|
+
let result404 = null;
|
|
337
|
+
let resultData404 = _responseText;
|
|
338
|
+
result404 = JSON.parse(resultData404);
|
|
339
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
340
|
+
}
|
|
341
|
+
else if (status === 409) {
|
|
342
|
+
const _responseText = response.data;
|
|
343
|
+
let result409 = null;
|
|
344
|
+
let resultData409 = _responseText;
|
|
345
|
+
result409 = JSON.parse(resultData409);
|
|
346
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
347
|
+
}
|
|
348
|
+
else if (status === 401) {
|
|
349
|
+
const _responseText = response.data;
|
|
350
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
351
|
+
}
|
|
352
|
+
else if (status === 403) {
|
|
353
|
+
const _responseText = response.data;
|
|
354
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
355
|
+
}
|
|
356
|
+
else if (status !== 200 && status !== 204) {
|
|
357
|
+
const _responseText = response.data;
|
|
358
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
359
|
+
}
|
|
360
|
+
return Promise.resolve(null);
|
|
361
|
+
}
|
|
362
|
+
/**
|
|
363
|
+
* Returns a storefront product reference.
|
|
364
|
+
* @param reference An external reference to Customer's Canvas product, e.g online store product identifier.
|
|
365
|
+
* @param storefrontId Storefront identifier.
|
|
366
|
+
* @param tenantId (optional) Tenant identifier.
|
|
367
|
+
* @return Success
|
|
368
|
+
*/
|
|
369
|
+
get(reference, storefrontId, tenantId, cancelToken) {
|
|
370
|
+
let url_ = this.baseUrl + "/api/backoffice/v1/product-references/{reference}?";
|
|
371
|
+
if (reference === undefined || reference === null)
|
|
372
|
+
throw new Error("The parameter 'reference' must be defined.");
|
|
373
|
+
url_ = url_.replace("{reference}", encodeURIComponent("" + reference));
|
|
374
|
+
if (storefrontId === undefined || storefrontId === null)
|
|
375
|
+
throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
|
|
376
|
+
else
|
|
377
|
+
url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
|
|
378
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
379
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
380
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
381
|
+
let options_ = {
|
|
382
|
+
method: "GET",
|
|
383
|
+
url: url_,
|
|
384
|
+
headers: {
|
|
385
|
+
"Accept": "application/json"
|
|
386
|
+
},
|
|
387
|
+
cancelToken
|
|
388
|
+
};
|
|
389
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
390
|
+
return this.instance.request(transformedOptions_);
|
|
391
|
+
}).catch((_error) => {
|
|
392
|
+
if (isAxiosError(_error) && _error.response) {
|
|
393
|
+
return _error.response;
|
|
394
|
+
}
|
|
395
|
+
else {
|
|
396
|
+
throw _error;
|
|
397
|
+
}
|
|
398
|
+
}).then((_response) => {
|
|
399
|
+
return this.transformResult(url_, _response, (_response) => this.processGet(_response));
|
|
400
|
+
});
|
|
401
|
+
}
|
|
402
|
+
processGet(response) {
|
|
403
|
+
const status = response.status;
|
|
404
|
+
let _headers = {};
|
|
405
|
+
if (response.headers && typeof response.headers === "object") {
|
|
406
|
+
for (let k in response.headers) {
|
|
407
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
408
|
+
_headers[k] = response.headers[k];
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
if (status === 200) {
|
|
413
|
+
const _responseText = response.data;
|
|
414
|
+
let result200 = null;
|
|
415
|
+
let resultData200 = _responseText;
|
|
416
|
+
result200 = JSON.parse(resultData200);
|
|
417
|
+
return Promise.resolve(result200);
|
|
418
|
+
}
|
|
419
|
+
else if (status === 409) {
|
|
420
|
+
const _responseText = response.data;
|
|
421
|
+
let result409 = null;
|
|
422
|
+
let resultData409 = _responseText;
|
|
423
|
+
result409 = JSON.parse(resultData409);
|
|
424
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
425
|
+
}
|
|
426
|
+
else if (status === 404) {
|
|
427
|
+
const _responseText = response.data;
|
|
428
|
+
let result404 = null;
|
|
429
|
+
let resultData404 = _responseText;
|
|
430
|
+
result404 = JSON.parse(resultData404);
|
|
431
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
432
|
+
}
|
|
433
|
+
else if (status === 401) {
|
|
434
|
+
const _responseText = response.data;
|
|
435
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
436
|
+
}
|
|
437
|
+
else if (status === 403) {
|
|
438
|
+
const _responseText = response.data;
|
|
439
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
440
|
+
}
|
|
441
|
+
else if (status !== 200 && status !== 204) {
|
|
442
|
+
const _responseText = response.data;
|
|
443
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
444
|
+
}
|
|
445
|
+
return Promise.resolve(null);
|
|
446
|
+
}
|
|
447
|
+
/**
|
|
448
|
+
* Deletes the storefront product reference.
|
|
449
|
+
* @param reference Product reference - external reference to Customer's Canvas product specification, e.g online store product identifier.
|
|
450
|
+
* @param storefrontId Storefront identifier.
|
|
451
|
+
* @param tenantId (optional) Tenant identifier.
|
|
452
|
+
* @return Success
|
|
453
|
+
*/
|
|
454
|
+
delete(reference, storefrontId, tenantId, cancelToken) {
|
|
455
|
+
let url_ = this.baseUrl + "/api/backoffice/v1/product-references/{reference}?";
|
|
456
|
+
if (reference === undefined || reference === null)
|
|
457
|
+
throw new Error("The parameter 'reference' must be defined.");
|
|
458
|
+
url_ = url_.replace("{reference}", encodeURIComponent("" + reference));
|
|
459
|
+
if (storefrontId === undefined || storefrontId === null)
|
|
460
|
+
throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
|
|
461
|
+
else
|
|
462
|
+
url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
|
|
463
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
464
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
465
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
466
|
+
let options_ = {
|
|
467
|
+
method: "DELETE",
|
|
468
|
+
url: url_,
|
|
469
|
+
headers: {
|
|
470
|
+
"Accept": "application/json"
|
|
471
|
+
},
|
|
472
|
+
cancelToken
|
|
473
|
+
};
|
|
474
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
475
|
+
return this.instance.request(transformedOptions_);
|
|
476
|
+
}).catch((_error) => {
|
|
477
|
+
if (isAxiosError(_error) && _error.response) {
|
|
478
|
+
return _error.response;
|
|
479
|
+
}
|
|
480
|
+
else {
|
|
481
|
+
throw _error;
|
|
482
|
+
}
|
|
483
|
+
}).then((_response) => {
|
|
484
|
+
return this.transformResult(url_, _response, (_response) => this.processDelete(_response));
|
|
485
|
+
});
|
|
486
|
+
}
|
|
487
|
+
processDelete(response) {
|
|
488
|
+
const status = response.status;
|
|
489
|
+
let _headers = {};
|
|
490
|
+
if (response.headers && typeof response.headers === "object") {
|
|
491
|
+
for (let k in response.headers) {
|
|
492
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
493
|
+
_headers[k] = response.headers[k];
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
if (status === 200) {
|
|
498
|
+
const _responseText = response.data;
|
|
499
|
+
let result200 = null;
|
|
500
|
+
let resultData200 = _responseText;
|
|
501
|
+
result200 = JSON.parse(resultData200);
|
|
502
|
+
return Promise.resolve(result200);
|
|
503
|
+
}
|
|
504
|
+
else if (status === 404) {
|
|
505
|
+
const _responseText = response.data;
|
|
506
|
+
let result404 = null;
|
|
507
|
+
let resultData404 = _responseText;
|
|
508
|
+
result404 = JSON.parse(resultData404);
|
|
509
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
510
|
+
}
|
|
511
|
+
else if (status === 409) {
|
|
512
|
+
const _responseText = response.data;
|
|
513
|
+
let result409 = null;
|
|
514
|
+
let resultData409 = _responseText;
|
|
515
|
+
result409 = JSON.parse(resultData409);
|
|
516
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
517
|
+
}
|
|
518
|
+
else if (status === 401) {
|
|
519
|
+
const _responseText = response.data;
|
|
520
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
521
|
+
}
|
|
522
|
+
else if (status === 403) {
|
|
523
|
+
const _responseText = response.data;
|
|
524
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
525
|
+
}
|
|
526
|
+
else if (status !== 200 && status !== 204) {
|
|
527
|
+
const _responseText = response.data;
|
|
528
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
529
|
+
}
|
|
530
|
+
return Promise.resolve(null);
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
BackOfficeApiClient.ProductReferencesManagementApiClient = ProductReferencesManagementApiClient;
|
|
534
|
+
class ProductsManagementApiClient extends ApiClientBase {
|
|
535
|
+
instance;
|
|
536
|
+
baseUrl;
|
|
537
|
+
jsonParseReviver = undefined;
|
|
538
|
+
constructor(configuration, baseUrl, instance) {
|
|
539
|
+
super(configuration);
|
|
540
|
+
this.instance = instance ? instance : axios.create();
|
|
541
|
+
this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : this.getBaseUrl("");
|
|
542
|
+
}
|
|
543
|
+
/**
|
|
544
|
+
* Returns all products, relevant to the specified query parameters.
|
|
545
|
+
* @param skip (optional) Defines page start offset from beginning of sorted result list.
|
|
546
|
+
* @param take (optional) Defines page length (how many consequent items of sorted result list should be taken).
|
|
547
|
+
* @param sorting (optional) Defines sorting order of result list e.g.: "Title ASC, LastModified DESC".
|
|
548
|
+
* @param search (optional) Search string for partial match.
|
|
549
|
+
* @param sku (optional) SKU of linked ecommerce product.
|
|
550
|
+
* @param tags (optional) List of tags that product should have.
|
|
551
|
+
* @param customFields (optional) Serialized custom fields dictionary filter. For example: {"public":"true","name":"my item"}.
|
|
552
|
+
* @param tenantId (optional) Tenant identifier.
|
|
553
|
+
* @return Success
|
|
554
|
+
*/
|
|
555
|
+
getAllProducts(skip, take, sorting, search, sku, tags, customFields, tenantId, cancelToken) {
|
|
556
|
+
let url_ = this.baseUrl + "/api/backoffice/v1/products?";
|
|
557
|
+
if (skip !== undefined && skip !== null)
|
|
558
|
+
url_ += "skip=" + encodeURIComponent("" + skip) + "&";
|
|
559
|
+
if (take !== undefined && take !== null)
|
|
560
|
+
url_ += "take=" + encodeURIComponent("" + take) + "&";
|
|
561
|
+
if (sorting !== undefined && sorting !== null)
|
|
562
|
+
url_ += "sorting=" + encodeURIComponent("" + sorting) + "&";
|
|
563
|
+
if (search !== undefined && search !== null)
|
|
564
|
+
url_ += "search=" + encodeURIComponent("" + search) + "&";
|
|
565
|
+
if (sku !== undefined && sku !== null)
|
|
566
|
+
url_ += "sku=" + encodeURIComponent("" + sku) + "&";
|
|
567
|
+
if (tags !== undefined && tags !== null)
|
|
568
|
+
tags && tags.forEach(item => { url_ += "tags=" + encodeURIComponent("" + item) + "&"; });
|
|
569
|
+
if (customFields !== undefined && customFields !== null)
|
|
570
|
+
url_ += "customFields=" + encodeURIComponent("" + customFields) + "&";
|
|
571
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
572
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
573
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
574
|
+
let options_ = {
|
|
575
|
+
method: "GET",
|
|
576
|
+
url: url_,
|
|
577
|
+
headers: {
|
|
578
|
+
"Accept": "application/json"
|
|
579
|
+
},
|
|
580
|
+
cancelToken
|
|
581
|
+
};
|
|
582
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
583
|
+
return this.instance.request(transformedOptions_);
|
|
584
|
+
}).catch((_error) => {
|
|
585
|
+
if (isAxiosError(_error) && _error.response) {
|
|
586
|
+
return _error.response;
|
|
587
|
+
}
|
|
588
|
+
else {
|
|
589
|
+
throw _error;
|
|
590
|
+
}
|
|
591
|
+
}).then((_response) => {
|
|
592
|
+
return this.transformResult(url_, _response, (_response) => this.processGetAllProducts(_response));
|
|
593
|
+
});
|
|
594
|
+
}
|
|
595
|
+
processGetAllProducts(response) {
|
|
596
|
+
const status = response.status;
|
|
597
|
+
let _headers = {};
|
|
598
|
+
if (response.headers && typeof response.headers === "object") {
|
|
599
|
+
for (let k in response.headers) {
|
|
600
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
601
|
+
_headers[k] = response.headers[k];
|
|
602
|
+
}
|
|
603
|
+
}
|
|
604
|
+
}
|
|
605
|
+
if (status === 200) {
|
|
606
|
+
const _responseText = response.data;
|
|
607
|
+
let result200 = null;
|
|
608
|
+
let resultData200 = _responseText;
|
|
609
|
+
result200 = JSON.parse(resultData200);
|
|
610
|
+
return Promise.resolve(result200);
|
|
611
|
+
}
|
|
612
|
+
else if (status === 401) {
|
|
613
|
+
const _responseText = response.data;
|
|
614
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
615
|
+
}
|
|
616
|
+
else if (status === 403) {
|
|
617
|
+
const _responseText = response.data;
|
|
618
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
619
|
+
}
|
|
620
|
+
else if (status !== 200 && status !== 204) {
|
|
621
|
+
const _responseText = response.data;
|
|
622
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
623
|
+
}
|
|
624
|
+
return Promise.resolve(null);
|
|
625
|
+
}
|
|
626
|
+
/**
|
|
627
|
+
* Creates a new product and returns its description.
|
|
628
|
+
* @param tenantId (optional) Tenant identifier.
|
|
629
|
+
* @param body (optional)
|
|
630
|
+
* @return Success
|
|
631
|
+
*/
|
|
632
|
+
createProduct(tenantId, body, cancelToken) {
|
|
633
|
+
let url_ = this.baseUrl + "/api/backoffice/v1/products?";
|
|
634
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
635
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
636
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
637
|
+
const content_ = JSON.stringify(body);
|
|
638
|
+
let options_ = {
|
|
639
|
+
data: content_,
|
|
640
|
+
method: "POST",
|
|
641
|
+
url: url_,
|
|
642
|
+
headers: {
|
|
643
|
+
"Content-Type": "application/json",
|
|
644
|
+
"Accept": "application/json"
|
|
645
|
+
},
|
|
646
|
+
cancelToken
|
|
647
|
+
};
|
|
648
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
649
|
+
return this.instance.request(transformedOptions_);
|
|
650
|
+
}).catch((_error) => {
|
|
651
|
+
if (isAxiosError(_error) && _error.response) {
|
|
652
|
+
return _error.response;
|
|
653
|
+
}
|
|
654
|
+
else {
|
|
655
|
+
throw _error;
|
|
656
|
+
}
|
|
657
|
+
}).then((_response) => {
|
|
658
|
+
return this.transformResult(url_, _response, (_response) => this.processCreateProduct(_response));
|
|
659
|
+
});
|
|
660
|
+
}
|
|
661
|
+
processCreateProduct(response) {
|
|
662
|
+
const status = response.status;
|
|
663
|
+
let _headers = {};
|
|
664
|
+
if (response.headers && typeof response.headers === "object") {
|
|
665
|
+
for (let k in response.headers) {
|
|
666
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
667
|
+
_headers[k] = response.headers[k];
|
|
668
|
+
}
|
|
669
|
+
}
|
|
670
|
+
}
|
|
671
|
+
if (status === 200) {
|
|
672
|
+
const _responseText = response.data;
|
|
673
|
+
let result200 = null;
|
|
674
|
+
let resultData200 = _responseText;
|
|
675
|
+
result200 = JSON.parse(resultData200);
|
|
676
|
+
return Promise.resolve(result200);
|
|
677
|
+
}
|
|
678
|
+
else if (status === 401) {
|
|
679
|
+
const _responseText = response.data;
|
|
680
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
681
|
+
}
|
|
682
|
+
else if (status === 403) {
|
|
683
|
+
const _responseText = response.data;
|
|
684
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
685
|
+
}
|
|
686
|
+
else if (status !== 200 && status !== 204) {
|
|
687
|
+
const _responseText = response.data;
|
|
688
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
689
|
+
}
|
|
690
|
+
return Promise.resolve(null);
|
|
691
|
+
}
|
|
692
|
+
/**
|
|
693
|
+
* Returns a product by its identifier.
|
|
694
|
+
* @param id Product identifier.
|
|
695
|
+
* @param productVersionId (optional) Product version identifier.
|
|
696
|
+
* @param tenantId (optional) Tenant identifier.
|
|
697
|
+
* @return Success
|
|
698
|
+
*/
|
|
699
|
+
getProduct(id, productVersionId, tenantId, cancelToken) {
|
|
700
|
+
let url_ = this.baseUrl + "/api/backoffice/v1/products/{id}?";
|
|
701
|
+
if (id === undefined || id === null)
|
|
702
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
703
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
704
|
+
if (productVersionId !== undefined && productVersionId !== null)
|
|
705
|
+
url_ += "productVersionId=" + encodeURIComponent("" + productVersionId) + "&";
|
|
706
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
707
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
708
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
709
|
+
let options_ = {
|
|
710
|
+
method: "GET",
|
|
711
|
+
url: url_,
|
|
712
|
+
headers: {
|
|
713
|
+
"Accept": "application/json"
|
|
714
|
+
},
|
|
715
|
+
cancelToken
|
|
716
|
+
};
|
|
717
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
718
|
+
return this.instance.request(transformedOptions_);
|
|
719
|
+
}).catch((_error) => {
|
|
720
|
+
if (isAxiosError(_error) && _error.response) {
|
|
721
|
+
return _error.response;
|
|
722
|
+
}
|
|
723
|
+
else {
|
|
724
|
+
throw _error;
|
|
725
|
+
}
|
|
726
|
+
}).then((_response) => {
|
|
727
|
+
return this.transformResult(url_, _response, (_response) => this.processGetProduct(_response));
|
|
728
|
+
});
|
|
729
|
+
}
|
|
730
|
+
processGetProduct(response) {
|
|
731
|
+
const status = response.status;
|
|
732
|
+
let _headers = {};
|
|
733
|
+
if (response.headers && typeof response.headers === "object") {
|
|
734
|
+
for (let k in response.headers) {
|
|
735
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
736
|
+
_headers[k] = response.headers[k];
|
|
737
|
+
}
|
|
738
|
+
}
|
|
739
|
+
}
|
|
740
|
+
if (status === 200) {
|
|
741
|
+
const _responseText = response.data;
|
|
742
|
+
let result200 = null;
|
|
743
|
+
let resultData200 = _responseText;
|
|
744
|
+
result200 = JSON.parse(resultData200);
|
|
745
|
+
return Promise.resolve(result200);
|
|
746
|
+
}
|
|
747
|
+
else if (status === 404) {
|
|
748
|
+
const _responseText = response.data;
|
|
749
|
+
let result404 = null;
|
|
750
|
+
let resultData404 = _responseText;
|
|
751
|
+
result404 = JSON.parse(resultData404);
|
|
752
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
753
|
+
}
|
|
754
|
+
else if (status === 409) {
|
|
755
|
+
const _responseText = response.data;
|
|
756
|
+
let result409 = null;
|
|
757
|
+
let resultData409 = _responseText;
|
|
758
|
+
result409 = JSON.parse(resultData409);
|
|
759
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
760
|
+
}
|
|
761
|
+
else if (status === 401) {
|
|
762
|
+
const _responseText = response.data;
|
|
763
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
764
|
+
}
|
|
765
|
+
else if (status === 403) {
|
|
766
|
+
const _responseText = response.data;
|
|
767
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
768
|
+
}
|
|
769
|
+
else if (status !== 200 && status !== 204) {
|
|
770
|
+
const _responseText = response.data;
|
|
771
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
772
|
+
}
|
|
773
|
+
return Promise.resolve(null);
|
|
774
|
+
}
|
|
775
|
+
/**
|
|
776
|
+
* Deletes a product by its identifier.
|
|
777
|
+
* @param id Product identifier.
|
|
778
|
+
* @param tenantId (optional) Tenant identifier.
|
|
779
|
+
* @return Success
|
|
780
|
+
*/
|
|
781
|
+
deleteProduct(id, tenantId, cancelToken) {
|
|
782
|
+
let url_ = this.baseUrl + "/api/backoffice/v1/products/{id}?";
|
|
783
|
+
if (id === undefined || id === null)
|
|
784
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
785
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
786
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
787
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
788
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
789
|
+
let options_ = {
|
|
790
|
+
method: "DELETE",
|
|
791
|
+
url: url_,
|
|
792
|
+
headers: {},
|
|
793
|
+
cancelToken
|
|
794
|
+
};
|
|
795
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
796
|
+
return this.instance.request(transformedOptions_);
|
|
797
|
+
}).catch((_error) => {
|
|
798
|
+
if (isAxiosError(_error) && _error.response) {
|
|
799
|
+
return _error.response;
|
|
800
|
+
}
|
|
801
|
+
else {
|
|
802
|
+
throw _error;
|
|
803
|
+
}
|
|
804
|
+
}).then((_response) => {
|
|
805
|
+
return this.transformResult(url_, _response, (_response) => this.processDeleteProduct(_response));
|
|
806
|
+
});
|
|
807
|
+
}
|
|
808
|
+
processDeleteProduct(response) {
|
|
809
|
+
const status = response.status;
|
|
810
|
+
let _headers = {};
|
|
811
|
+
if (response.headers && typeof response.headers === "object") {
|
|
812
|
+
for (let k in response.headers) {
|
|
813
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
814
|
+
_headers[k] = response.headers[k];
|
|
815
|
+
}
|
|
816
|
+
}
|
|
817
|
+
}
|
|
818
|
+
if (status === 200) {
|
|
819
|
+
const _responseText = response.data;
|
|
820
|
+
return Promise.resolve(null);
|
|
821
|
+
}
|
|
822
|
+
else if (status === 404) {
|
|
823
|
+
const _responseText = response.data;
|
|
824
|
+
let result404 = null;
|
|
825
|
+
let resultData404 = _responseText;
|
|
826
|
+
result404 = JSON.parse(resultData404);
|
|
827
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
828
|
+
}
|
|
829
|
+
else if (status === 409) {
|
|
830
|
+
const _responseText = response.data;
|
|
831
|
+
let result409 = null;
|
|
832
|
+
let resultData409 = _responseText;
|
|
833
|
+
result409 = JSON.parse(resultData409);
|
|
834
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
835
|
+
}
|
|
836
|
+
else if (status === 401) {
|
|
837
|
+
const _responseText = response.data;
|
|
838
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
839
|
+
}
|
|
840
|
+
else if (status === 403) {
|
|
841
|
+
const _responseText = response.data;
|
|
842
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
843
|
+
}
|
|
844
|
+
else if (status !== 200 && status !== 204) {
|
|
845
|
+
const _responseText = response.data;
|
|
846
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
847
|
+
}
|
|
848
|
+
return Promise.resolve(null);
|
|
849
|
+
}
|
|
850
|
+
/**
|
|
851
|
+
* Returns a list of product options.
|
|
852
|
+
* @param id Product identifier.
|
|
853
|
+
* @param productVersionId (optional) Product version identifier.
|
|
854
|
+
* @param tenantId (optional) Tenant identifier.
|
|
855
|
+
* @return Success
|
|
856
|
+
*/
|
|
857
|
+
getProductOptions(id, productVersionId, tenantId, cancelToken) {
|
|
858
|
+
let url_ = this.baseUrl + "/api/backoffice/v1/products/{id}/options?";
|
|
859
|
+
if (id === undefined || id === null)
|
|
860
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
861
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
862
|
+
if (productVersionId !== undefined && productVersionId !== null)
|
|
863
|
+
url_ += "productVersionId=" + encodeURIComponent("" + productVersionId) + "&";
|
|
864
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
865
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
866
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
867
|
+
let options_ = {
|
|
868
|
+
method: "GET",
|
|
869
|
+
url: url_,
|
|
870
|
+
headers: {
|
|
871
|
+
"Accept": "application/json"
|
|
872
|
+
},
|
|
873
|
+
cancelToken
|
|
874
|
+
};
|
|
875
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
876
|
+
return this.instance.request(transformedOptions_);
|
|
877
|
+
}).catch((_error) => {
|
|
878
|
+
if (isAxiosError(_error) && _error.response) {
|
|
879
|
+
return _error.response;
|
|
880
|
+
}
|
|
881
|
+
else {
|
|
882
|
+
throw _error;
|
|
883
|
+
}
|
|
884
|
+
}).then((_response) => {
|
|
885
|
+
return this.transformResult(url_, _response, (_response) => this.processGetProductOptions(_response));
|
|
886
|
+
});
|
|
887
|
+
}
|
|
888
|
+
processGetProductOptions(response) {
|
|
889
|
+
const status = response.status;
|
|
890
|
+
let _headers = {};
|
|
891
|
+
if (response.headers && typeof response.headers === "object") {
|
|
892
|
+
for (let k in response.headers) {
|
|
893
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
894
|
+
_headers[k] = response.headers[k];
|
|
895
|
+
}
|
|
896
|
+
}
|
|
897
|
+
}
|
|
898
|
+
if (status === 200) {
|
|
899
|
+
const _responseText = response.data;
|
|
900
|
+
let result200 = null;
|
|
901
|
+
let resultData200 = _responseText;
|
|
902
|
+
result200 = JSON.parse(resultData200);
|
|
903
|
+
return Promise.resolve(result200);
|
|
904
|
+
}
|
|
905
|
+
else if (status === 404) {
|
|
906
|
+
const _responseText = response.data;
|
|
907
|
+
let result404 = null;
|
|
908
|
+
let resultData404 = _responseText;
|
|
909
|
+
result404 = JSON.parse(resultData404);
|
|
910
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
911
|
+
}
|
|
912
|
+
else if (status === 409) {
|
|
913
|
+
const _responseText = response.data;
|
|
914
|
+
let result409 = null;
|
|
915
|
+
let resultData409 = _responseText;
|
|
916
|
+
result409 = JSON.parse(resultData409);
|
|
917
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
918
|
+
}
|
|
919
|
+
else if (status === 401) {
|
|
920
|
+
const _responseText = response.data;
|
|
921
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
922
|
+
}
|
|
923
|
+
else if (status === 403) {
|
|
924
|
+
const _responseText = response.data;
|
|
925
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
926
|
+
}
|
|
927
|
+
else if (status !== 200 && status !== 204) {
|
|
928
|
+
const _responseText = response.data;
|
|
929
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
930
|
+
}
|
|
931
|
+
return Promise.resolve(null);
|
|
932
|
+
}
|
|
933
|
+
/**
|
|
934
|
+
* Returns a list of product variants.
|
|
935
|
+
* @param id Product identifier.
|
|
936
|
+
* @param productVersionId (optional) Product version identifier.
|
|
937
|
+
* @param skip (optional) Defines page start offset from beginning of sorted result list.
|
|
938
|
+
* @param take (optional) Defines page length (how many consequent items of sorted result list should be taken).
|
|
939
|
+
* @param options (optional) Defines options filter e.g.: "{ "opt1_id": "opt1_val1_id, opt1_val2_id", "opt2_id": "opt2_val1_id" }".
|
|
940
|
+
* @param productFilterId (optional) Defines special filter based on product filter with specified identifier.
|
|
941
|
+
* @param takeAvailableOnly (optional) Defines special filter for available product variants.
|
|
942
|
+
* @param sku (optional) SKU of linked ecommerce product.
|
|
943
|
+
* @param tenantId (optional) Tenant identifier.
|
|
944
|
+
* @return Success
|
|
945
|
+
*/
|
|
946
|
+
getProductVariants(id, productVersionId, skip, take, options, productFilterId, takeAvailableOnly, sku, tenantId, cancelToken) {
|
|
947
|
+
let url_ = this.baseUrl + "/api/backoffice/v1/products/{id}/variants?";
|
|
948
|
+
if (id === undefined || id === null)
|
|
949
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
950
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
951
|
+
if (productVersionId !== undefined && productVersionId !== null)
|
|
952
|
+
url_ += "productVersionId=" + encodeURIComponent("" + productVersionId) + "&";
|
|
953
|
+
if (skip !== undefined && skip !== null)
|
|
954
|
+
url_ += "skip=" + encodeURIComponent("" + skip) + "&";
|
|
955
|
+
if (take !== undefined && take !== null)
|
|
956
|
+
url_ += "take=" + encodeURIComponent("" + take) + "&";
|
|
957
|
+
if (options !== undefined && options !== null)
|
|
958
|
+
url_ += "options=" + encodeURIComponent("" + options) + "&";
|
|
959
|
+
if (productFilterId !== undefined && productFilterId !== null)
|
|
960
|
+
url_ += "productFilterId=" + encodeURIComponent("" + productFilterId) + "&";
|
|
961
|
+
if (takeAvailableOnly !== undefined && takeAvailableOnly !== null)
|
|
962
|
+
url_ += "takeAvailableOnly=" + encodeURIComponent("" + takeAvailableOnly) + "&";
|
|
963
|
+
if (sku !== undefined && sku !== null)
|
|
964
|
+
url_ += "sku=" + encodeURIComponent("" + sku) + "&";
|
|
965
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
966
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
967
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
968
|
+
let options_ = {
|
|
969
|
+
method: "GET",
|
|
970
|
+
url: url_,
|
|
971
|
+
headers: {
|
|
972
|
+
"Accept": "application/json"
|
|
973
|
+
},
|
|
974
|
+
cancelToken
|
|
975
|
+
};
|
|
976
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
977
|
+
return this.instance.request(transformedOptions_);
|
|
978
|
+
}).catch((_error) => {
|
|
979
|
+
if (isAxiosError(_error) && _error.response) {
|
|
980
|
+
return _error.response;
|
|
981
|
+
}
|
|
982
|
+
else {
|
|
983
|
+
throw _error;
|
|
984
|
+
}
|
|
985
|
+
}).then((_response) => {
|
|
986
|
+
return this.transformResult(url_, _response, (_response) => this.processGetProductVariants(_response));
|
|
987
|
+
});
|
|
988
|
+
}
|
|
989
|
+
processGetProductVariants(response) {
|
|
990
|
+
const status = response.status;
|
|
991
|
+
let _headers = {};
|
|
992
|
+
if (response.headers && typeof response.headers === "object") {
|
|
993
|
+
for (let k in response.headers) {
|
|
994
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
995
|
+
_headers[k] = response.headers[k];
|
|
996
|
+
}
|
|
997
|
+
}
|
|
998
|
+
}
|
|
999
|
+
if (status === 200) {
|
|
1000
|
+
const _responseText = response.data;
|
|
1001
|
+
let result200 = null;
|
|
1002
|
+
let resultData200 = _responseText;
|
|
1003
|
+
result200 = JSON.parse(resultData200);
|
|
1004
|
+
return Promise.resolve(result200);
|
|
1005
|
+
}
|
|
1006
|
+
else if (status === 404) {
|
|
1007
|
+
const _responseText = response.data;
|
|
1008
|
+
let result404 = null;
|
|
1009
|
+
let resultData404 = _responseText;
|
|
1010
|
+
result404 = JSON.parse(resultData404);
|
|
1011
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
1012
|
+
}
|
|
1013
|
+
else if (status === 409) {
|
|
1014
|
+
const _responseText = response.data;
|
|
1015
|
+
let result409 = null;
|
|
1016
|
+
let resultData409 = _responseText;
|
|
1017
|
+
result409 = JSON.parse(resultData409);
|
|
1018
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
1019
|
+
}
|
|
1020
|
+
else if (status === 401) {
|
|
1021
|
+
const _responseText = response.data;
|
|
1022
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
1023
|
+
}
|
|
1024
|
+
else if (status === 403) {
|
|
1025
|
+
const _responseText = response.data;
|
|
1026
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
1027
|
+
}
|
|
1028
|
+
else if (status !== 200 && status !== 204) {
|
|
1029
|
+
const _responseText = response.data;
|
|
1030
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
1031
|
+
}
|
|
1032
|
+
return Promise.resolve(null);
|
|
1033
|
+
}
|
|
1034
|
+
/**
|
|
1035
|
+
* Returns a product variant.
|
|
1036
|
+
* @param id Product identifier.
|
|
1037
|
+
* @param productVariantId Product variant identifier.
|
|
1038
|
+
* @param productVersionId (optional) Product version identifier.
|
|
1039
|
+
* @param tenantId (optional) Tenant identifier.
|
|
1040
|
+
* @return Success
|
|
1041
|
+
*/
|
|
1042
|
+
getProductVariant(id, productVariantId, productVersionId, tenantId, cancelToken) {
|
|
1043
|
+
let url_ = this.baseUrl + "/api/backoffice/v1/products/{id}/variants/{productVariantId}?";
|
|
1044
|
+
if (id === undefined || id === null)
|
|
1045
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
1046
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
1047
|
+
if (productVariantId === undefined || productVariantId === null)
|
|
1048
|
+
throw new Error("The parameter 'productVariantId' must be defined.");
|
|
1049
|
+
url_ = url_.replace("{productVariantId}", encodeURIComponent("" + productVariantId));
|
|
1050
|
+
if (productVersionId !== undefined && productVersionId !== null)
|
|
1051
|
+
url_ += "productVersionId=" + encodeURIComponent("" + productVersionId) + "&";
|
|
1052
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
1053
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
1054
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
1055
|
+
let options_ = {
|
|
1056
|
+
method: "GET",
|
|
1057
|
+
url: url_,
|
|
1058
|
+
headers: {
|
|
1059
|
+
"Accept": "application/json"
|
|
1060
|
+
},
|
|
1061
|
+
cancelToken
|
|
1062
|
+
};
|
|
1063
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
1064
|
+
return this.instance.request(transformedOptions_);
|
|
1065
|
+
}).catch((_error) => {
|
|
1066
|
+
if (isAxiosError(_error) && _error.response) {
|
|
1067
|
+
return _error.response;
|
|
1068
|
+
}
|
|
1069
|
+
else {
|
|
1070
|
+
throw _error;
|
|
1071
|
+
}
|
|
1072
|
+
}).then((_response) => {
|
|
1073
|
+
return this.transformResult(url_, _response, (_response) => this.processGetProductVariant(_response));
|
|
1074
|
+
});
|
|
1075
|
+
}
|
|
1076
|
+
processGetProductVariant(response) {
|
|
1077
|
+
const status = response.status;
|
|
1078
|
+
let _headers = {};
|
|
1079
|
+
if (response.headers && typeof response.headers === "object") {
|
|
1080
|
+
for (let k in response.headers) {
|
|
1081
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
1082
|
+
_headers[k] = response.headers[k];
|
|
1083
|
+
}
|
|
1084
|
+
}
|
|
1085
|
+
}
|
|
1086
|
+
if (status === 200) {
|
|
1087
|
+
const _responseText = response.data;
|
|
1088
|
+
let result200 = null;
|
|
1089
|
+
let resultData200 = _responseText;
|
|
1090
|
+
result200 = JSON.parse(resultData200);
|
|
1091
|
+
return Promise.resolve(result200);
|
|
1092
|
+
}
|
|
1093
|
+
else if (status === 404) {
|
|
1094
|
+
const _responseText = response.data;
|
|
1095
|
+
let result404 = null;
|
|
1096
|
+
let resultData404 = _responseText;
|
|
1097
|
+
result404 = JSON.parse(resultData404);
|
|
1098
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
1099
|
+
}
|
|
1100
|
+
else if (status === 409) {
|
|
1101
|
+
const _responseText = response.data;
|
|
1102
|
+
let result409 = null;
|
|
1103
|
+
let resultData409 = _responseText;
|
|
1104
|
+
result409 = JSON.parse(resultData409);
|
|
1105
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
1106
|
+
}
|
|
1107
|
+
else if (status === 401) {
|
|
1108
|
+
const _responseText = response.data;
|
|
1109
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
1110
|
+
}
|
|
1111
|
+
else if (status === 403) {
|
|
1112
|
+
const _responseText = response.data;
|
|
1113
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
1114
|
+
}
|
|
1115
|
+
else if (status !== 200 && status !== 204) {
|
|
1116
|
+
const _responseText = response.data;
|
|
1117
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
1118
|
+
}
|
|
1119
|
+
return Promise.resolve(null);
|
|
1120
|
+
}
|
|
1121
|
+
/**
|
|
1122
|
+
* Returns a list of product variant designs.
|
|
1123
|
+
* @param id Product identifier.
|
|
1124
|
+
* @param productVersionId (optional) Product version identifier.
|
|
1125
|
+
* @param productVariantId (optional) Product variant identifier.
|
|
1126
|
+
* @param search (optional) Search string for design name partial match.
|
|
1127
|
+
* @param designCustomFields (optional) Custom attributes dictionary filter for designs. For example: {"public":"true","name":"my item"}
|
|
1128
|
+
* @param designPath (optional) Path filter for designs. Subfolders included by default.
|
|
1129
|
+
* @param skip (optional) Defines page start offset from beginning of sorted result list.
|
|
1130
|
+
* @param take (optional) Defines page length (how many consequent items of sorted result list should be taken).
|
|
1131
|
+
* @param options (optional) Defines options filter e.g.: "{ "opt1_id": "opt1_val1_id, opt1_val2_id", "opt2_id": "opt2_val1_id" }".
|
|
1132
|
+
* @param productFilterId (optional) Defines special filter based on product filter with specified identifier.
|
|
1133
|
+
* @param takeAvailableOnly (optional) Defines special filter for available product variants.
|
|
1134
|
+
* @param sku (optional) SKU of linked ecommerce product.
|
|
1135
|
+
* @param tenantId (optional) Tenant identifier.
|
|
1136
|
+
* @return Success
|
|
1137
|
+
*/
|
|
1138
|
+
getProductVariantDesigns(id, productVersionId, productVariantId, search, designCustomFields, designPath, skip, take, options, productFilterId, takeAvailableOnly, sku, tenantId, cancelToken) {
|
|
1139
|
+
let url_ = this.baseUrl + "/api/backoffice/v1/products/{id}/variant-designs?";
|
|
1140
|
+
if (id === undefined || id === null)
|
|
1141
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
1142
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
1143
|
+
if (productVersionId !== undefined && productVersionId !== null)
|
|
1144
|
+
url_ += "productVersionId=" + encodeURIComponent("" + productVersionId) + "&";
|
|
1145
|
+
if (productVariantId !== undefined && productVariantId !== null)
|
|
1146
|
+
url_ += "productVariantId=" + encodeURIComponent("" + productVariantId) + "&";
|
|
1147
|
+
if (search !== undefined && search !== null)
|
|
1148
|
+
url_ += "search=" + encodeURIComponent("" + search) + "&";
|
|
1149
|
+
if (designCustomFields !== undefined && designCustomFields !== null)
|
|
1150
|
+
url_ += "designCustomFields=" + encodeURIComponent("" + designCustomFields) + "&";
|
|
1151
|
+
if (designPath !== undefined && designPath !== null)
|
|
1152
|
+
url_ += "designPath=" + encodeURIComponent("" + designPath) + "&";
|
|
1153
|
+
if (skip !== undefined && skip !== null)
|
|
1154
|
+
url_ += "skip=" + encodeURIComponent("" + skip) + "&";
|
|
1155
|
+
if (take !== undefined && take !== null)
|
|
1156
|
+
url_ += "take=" + encodeURIComponent("" + take) + "&";
|
|
1157
|
+
if (options !== undefined && options !== null)
|
|
1158
|
+
url_ += "options=" + encodeURIComponent("" + options) + "&";
|
|
1159
|
+
if (productFilterId !== undefined && productFilterId !== null)
|
|
1160
|
+
url_ += "productFilterId=" + encodeURIComponent("" + productFilterId) + "&";
|
|
1161
|
+
if (takeAvailableOnly !== undefined && takeAvailableOnly !== null)
|
|
1162
|
+
url_ += "takeAvailableOnly=" + encodeURIComponent("" + takeAvailableOnly) + "&";
|
|
1163
|
+
if (sku !== undefined && sku !== null)
|
|
1164
|
+
url_ += "sku=" + encodeURIComponent("" + sku) + "&";
|
|
1165
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
1166
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
1167
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
1168
|
+
let options_ = {
|
|
1169
|
+
method: "GET",
|
|
1170
|
+
url: url_,
|
|
1171
|
+
headers: {
|
|
1172
|
+
"Accept": "application/json"
|
|
1173
|
+
},
|
|
1174
|
+
cancelToken
|
|
1175
|
+
};
|
|
1176
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
1177
|
+
return this.instance.request(transformedOptions_);
|
|
1178
|
+
}).catch((_error) => {
|
|
1179
|
+
if (isAxiosError(_error) && _error.response) {
|
|
1180
|
+
return _error.response;
|
|
1181
|
+
}
|
|
1182
|
+
else {
|
|
1183
|
+
throw _error;
|
|
1184
|
+
}
|
|
1185
|
+
}).then((_response) => {
|
|
1186
|
+
return this.transformResult(url_, _response, (_response) => this.processGetProductVariantDesigns(_response));
|
|
1187
|
+
});
|
|
1188
|
+
}
|
|
1189
|
+
processGetProductVariantDesigns(response) {
|
|
1190
|
+
const status = response.status;
|
|
1191
|
+
let _headers = {};
|
|
1192
|
+
if (response.headers && typeof response.headers === "object") {
|
|
1193
|
+
for (let k in response.headers) {
|
|
1194
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
1195
|
+
_headers[k] = response.headers[k];
|
|
1196
|
+
}
|
|
1197
|
+
}
|
|
1198
|
+
}
|
|
1199
|
+
if (status === 200) {
|
|
1200
|
+
const _responseText = response.data;
|
|
1201
|
+
let result200 = null;
|
|
1202
|
+
let resultData200 = _responseText;
|
|
1203
|
+
result200 = JSON.parse(resultData200);
|
|
1204
|
+
return Promise.resolve(result200);
|
|
1205
|
+
}
|
|
1206
|
+
else if (status === 404) {
|
|
1207
|
+
const _responseText = response.data;
|
|
1208
|
+
let result404 = null;
|
|
1209
|
+
let resultData404 = _responseText;
|
|
1210
|
+
result404 = JSON.parse(resultData404);
|
|
1211
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
1212
|
+
}
|
|
1213
|
+
else if (status === 409) {
|
|
1214
|
+
const _responseText = response.data;
|
|
1215
|
+
let result409 = null;
|
|
1216
|
+
let resultData409 = _responseText;
|
|
1217
|
+
result409 = JSON.parse(resultData409);
|
|
1218
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
1219
|
+
}
|
|
1220
|
+
else if (status === 401) {
|
|
1221
|
+
const _responseText = response.data;
|
|
1222
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
1223
|
+
}
|
|
1224
|
+
else if (status === 403) {
|
|
1225
|
+
const _responseText = response.data;
|
|
1226
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
1227
|
+
}
|
|
1228
|
+
else if (status !== 200 && status !== 204) {
|
|
1229
|
+
const _responseText = response.data;
|
|
1230
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
1231
|
+
}
|
|
1232
|
+
return Promise.resolve(null);
|
|
1233
|
+
}
|
|
1234
|
+
/**
|
|
1235
|
+
* Returns a list of product variant mockups.
|
|
1236
|
+
* @param id Product identifier.
|
|
1237
|
+
* @param productVersionId (optional) Product version identifier.
|
|
1238
|
+
* @param productVariantId (optional) Product variant identifier.
|
|
1239
|
+
* @param search (optional) Search string for design name partial match.
|
|
1240
|
+
* @param mockupCustomFields (optional) Custom attributes dictionary filter for mockups. For example: {"public":"true","name":"my item"}
|
|
1241
|
+
* @param mockupPath (optional) Path filter for mockups. Subfolders included by default.
|
|
1242
|
+
* @param skip (optional) Defines page start offset from beginning of sorted result list.
|
|
1243
|
+
* @param take (optional) Defines page length (how many consequent items of sorted result list should be taken).
|
|
1244
|
+
* @param options (optional) Defines options filter e.g.: "{ "opt1_id": "opt1_val1_id, opt1_val2_id", "opt2_id": "opt2_val1_id" }".
|
|
1245
|
+
* @param productFilterId (optional) Defines special filter based on product filter with specified identifier.
|
|
1246
|
+
* @param takeAvailableOnly (optional) Defines special filter for available product variants.
|
|
1247
|
+
* @param sku (optional) SKU of linked ecommerce product.
|
|
1248
|
+
* @param tenantId (optional) Tenant identifier.
|
|
1249
|
+
* @return Success
|
|
1250
|
+
*/
|
|
1251
|
+
getProductVariantMockups(id, productVersionId, productVariantId, search, mockupCustomFields, mockupPath, skip, take, options, productFilterId, takeAvailableOnly, sku, tenantId, cancelToken) {
|
|
1252
|
+
let url_ = this.baseUrl + "/api/backoffice/v1/products/{id}/variant-mockups?";
|
|
1253
|
+
if (id === undefined || id === null)
|
|
1254
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
1255
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
1256
|
+
if (productVersionId !== undefined && productVersionId !== null)
|
|
1257
|
+
url_ += "productVersionId=" + encodeURIComponent("" + productVersionId) + "&";
|
|
1258
|
+
if (productVariantId !== undefined && productVariantId !== null)
|
|
1259
|
+
url_ += "productVariantId=" + encodeURIComponent("" + productVariantId) + "&";
|
|
1260
|
+
if (search !== undefined && search !== null)
|
|
1261
|
+
url_ += "search=" + encodeURIComponent("" + search) + "&";
|
|
1262
|
+
if (mockupCustomFields !== undefined && mockupCustomFields !== null)
|
|
1263
|
+
url_ += "mockupCustomFields=" + encodeURIComponent("" + mockupCustomFields) + "&";
|
|
1264
|
+
if (mockupPath !== undefined && mockupPath !== null)
|
|
1265
|
+
url_ += "mockupPath=" + encodeURIComponent("" + mockupPath) + "&";
|
|
1266
|
+
if (skip !== undefined && skip !== null)
|
|
1267
|
+
url_ += "skip=" + encodeURIComponent("" + skip) + "&";
|
|
1268
|
+
if (take !== undefined && take !== null)
|
|
1269
|
+
url_ += "take=" + encodeURIComponent("" + take) + "&";
|
|
1270
|
+
if (options !== undefined && options !== null)
|
|
1271
|
+
url_ += "options=" + encodeURIComponent("" + options) + "&";
|
|
1272
|
+
if (productFilterId !== undefined && productFilterId !== null)
|
|
1273
|
+
url_ += "productFilterId=" + encodeURIComponent("" + productFilterId) + "&";
|
|
1274
|
+
if (takeAvailableOnly !== undefined && takeAvailableOnly !== null)
|
|
1275
|
+
url_ += "takeAvailableOnly=" + encodeURIComponent("" + takeAvailableOnly) + "&";
|
|
1276
|
+
if (sku !== undefined && sku !== null)
|
|
1277
|
+
url_ += "sku=" + encodeURIComponent("" + sku) + "&";
|
|
1278
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
1279
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
1280
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
1281
|
+
let options_ = {
|
|
1282
|
+
method: "GET",
|
|
1283
|
+
url: url_,
|
|
1284
|
+
headers: {
|
|
1285
|
+
"Accept": "application/json"
|
|
1286
|
+
},
|
|
1287
|
+
cancelToken
|
|
1288
|
+
};
|
|
1289
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
1290
|
+
return this.instance.request(transformedOptions_);
|
|
1291
|
+
}).catch((_error) => {
|
|
1292
|
+
if (isAxiosError(_error) && _error.response) {
|
|
1293
|
+
return _error.response;
|
|
1294
|
+
}
|
|
1295
|
+
else {
|
|
1296
|
+
throw _error;
|
|
1297
|
+
}
|
|
1298
|
+
}).then((_response) => {
|
|
1299
|
+
return this.transformResult(url_, _response, (_response) => this.processGetProductVariantMockups(_response));
|
|
1300
|
+
});
|
|
1301
|
+
}
|
|
1302
|
+
processGetProductVariantMockups(response) {
|
|
1303
|
+
const status = response.status;
|
|
1304
|
+
let _headers = {};
|
|
1305
|
+
if (response.headers && typeof response.headers === "object") {
|
|
1306
|
+
for (let k in response.headers) {
|
|
1307
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
1308
|
+
_headers[k] = response.headers[k];
|
|
1309
|
+
}
|
|
1310
|
+
}
|
|
1311
|
+
}
|
|
1312
|
+
if (status === 200) {
|
|
1313
|
+
const _responseText = response.data;
|
|
1314
|
+
let result200 = null;
|
|
1315
|
+
let resultData200 = _responseText;
|
|
1316
|
+
result200 = JSON.parse(resultData200);
|
|
1317
|
+
return Promise.resolve(result200);
|
|
1318
|
+
}
|
|
1319
|
+
else if (status === 404) {
|
|
1320
|
+
const _responseText = response.data;
|
|
1321
|
+
let result404 = null;
|
|
1322
|
+
let resultData404 = _responseText;
|
|
1323
|
+
result404 = JSON.parse(resultData404);
|
|
1324
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
1325
|
+
}
|
|
1326
|
+
else if (status === 409) {
|
|
1327
|
+
const _responseText = response.data;
|
|
1328
|
+
let result409 = null;
|
|
1329
|
+
let resultData409 = _responseText;
|
|
1330
|
+
result409 = JSON.parse(resultData409);
|
|
1331
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
1332
|
+
}
|
|
1333
|
+
else if (status === 401) {
|
|
1334
|
+
const _responseText = response.data;
|
|
1335
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
1336
|
+
}
|
|
1337
|
+
else if (status === 403) {
|
|
1338
|
+
const _responseText = response.data;
|
|
1339
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
1340
|
+
}
|
|
1341
|
+
else if (status !== 200 && status !== 204) {
|
|
1342
|
+
const _responseText = response.data;
|
|
1343
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
1344
|
+
}
|
|
1345
|
+
return Promise.resolve(null);
|
|
1346
|
+
}
|
|
1347
|
+
/**
|
|
1348
|
+
* Returns a list of product variant documents.
|
|
1349
|
+
* @param id Product identifier.
|
|
1350
|
+
* @param productVersionId (optional) Product version identifier.
|
|
1351
|
+
* @param productVariantId (optional) Product variant identifier.
|
|
1352
|
+
* @param search (optional) Search string for document name partial match.
|
|
1353
|
+
* @param documentCustomFields (optional) Custom attributes dictionary filter for documents. For example: {"public":"true","name":"my item"}
|
|
1354
|
+
* @param documentPath (optional) Path filter for documents. Subfolders included by default.
|
|
1355
|
+
* @param skip (optional) Defines page start offset from beginning of sorted result list.
|
|
1356
|
+
* @param take (optional) Defines page length (how many consequent items of sorted result list should be taken).
|
|
1357
|
+
* @param options (optional) Defines options filter e.g.: "{ "opt1_id": "opt1_val1_id, opt1_val2_id", "opt2_id": "opt2_val1_id" }".
|
|
1358
|
+
* @param productFilterId (optional) Defines special filter based on product filter with specified identifier.
|
|
1359
|
+
* @param takeAvailableOnly (optional) Defines special filter for available product variants.
|
|
1360
|
+
* @param sku (optional) SKU of linked ecommerce product.
|
|
1361
|
+
* @param tenantId (optional) Tenant identifier.
|
|
1362
|
+
* @return Success
|
|
1363
|
+
*/
|
|
1364
|
+
getProductVariantDocuments(id, productVersionId, productVariantId, search, documentCustomFields, documentPath, skip, take, options, productFilterId, takeAvailableOnly, sku, tenantId, cancelToken) {
|
|
1365
|
+
let url_ = this.baseUrl + "/api/backoffice/v1/products/{id}/variant-documents?";
|
|
1366
|
+
if (id === undefined || id === null)
|
|
1367
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
1368
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
1369
|
+
if (productVersionId !== undefined && productVersionId !== null)
|
|
1370
|
+
url_ += "productVersionId=" + encodeURIComponent("" + productVersionId) + "&";
|
|
1371
|
+
if (productVariantId !== undefined && productVariantId !== null)
|
|
1372
|
+
url_ += "productVariantId=" + encodeURIComponent("" + productVariantId) + "&";
|
|
1373
|
+
if (search !== undefined && search !== null)
|
|
1374
|
+
url_ += "search=" + encodeURIComponent("" + search) + "&";
|
|
1375
|
+
if (documentCustomFields !== undefined && documentCustomFields !== null)
|
|
1376
|
+
url_ += "documentCustomFields=" + encodeURIComponent("" + documentCustomFields) + "&";
|
|
1377
|
+
if (documentPath !== undefined && documentPath !== null)
|
|
1378
|
+
url_ += "documentPath=" + encodeURIComponent("" + documentPath) + "&";
|
|
1379
|
+
if (skip !== undefined && skip !== null)
|
|
1380
|
+
url_ += "skip=" + encodeURIComponent("" + skip) + "&";
|
|
1381
|
+
if (take !== undefined && take !== null)
|
|
1382
|
+
url_ += "take=" + encodeURIComponent("" + take) + "&";
|
|
1383
|
+
if (options !== undefined && options !== null)
|
|
1384
|
+
url_ += "options=" + encodeURIComponent("" + options) + "&";
|
|
1385
|
+
if (productFilterId !== undefined && productFilterId !== null)
|
|
1386
|
+
url_ += "productFilterId=" + encodeURIComponent("" + productFilterId) + "&";
|
|
1387
|
+
if (takeAvailableOnly !== undefined && takeAvailableOnly !== null)
|
|
1388
|
+
url_ += "takeAvailableOnly=" + encodeURIComponent("" + takeAvailableOnly) + "&";
|
|
1389
|
+
if (sku !== undefined && sku !== null)
|
|
1390
|
+
url_ += "sku=" + encodeURIComponent("" + sku) + "&";
|
|
1391
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
1392
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
1393
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
1394
|
+
let options_ = {
|
|
1395
|
+
method: "GET",
|
|
1396
|
+
url: url_,
|
|
1397
|
+
headers: {
|
|
1398
|
+
"Accept": "application/json"
|
|
1399
|
+
},
|
|
1400
|
+
cancelToken
|
|
1401
|
+
};
|
|
1402
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
1403
|
+
return this.instance.request(transformedOptions_);
|
|
1404
|
+
}).catch((_error) => {
|
|
1405
|
+
if (isAxiosError(_error) && _error.response) {
|
|
1406
|
+
return _error.response;
|
|
1407
|
+
}
|
|
1408
|
+
else {
|
|
1409
|
+
throw _error;
|
|
1410
|
+
}
|
|
1411
|
+
}).then((_response) => {
|
|
1412
|
+
return this.transformResult(url_, _response, (_response) => this.processGetProductVariantDocuments(_response));
|
|
1413
|
+
});
|
|
1414
|
+
}
|
|
1415
|
+
processGetProductVariantDocuments(response) {
|
|
1416
|
+
const status = response.status;
|
|
1417
|
+
let _headers = {};
|
|
1418
|
+
if (response.headers && typeof response.headers === "object") {
|
|
1419
|
+
for (let k in response.headers) {
|
|
1420
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
1421
|
+
_headers[k] = response.headers[k];
|
|
1422
|
+
}
|
|
1423
|
+
}
|
|
1424
|
+
}
|
|
1425
|
+
if (status === 200) {
|
|
1426
|
+
const _responseText = response.data;
|
|
1427
|
+
let result200 = null;
|
|
1428
|
+
let resultData200 = _responseText;
|
|
1429
|
+
result200 = JSON.parse(resultData200);
|
|
1430
|
+
return Promise.resolve(result200);
|
|
1431
|
+
}
|
|
1432
|
+
else if (status === 404) {
|
|
1433
|
+
const _responseText = response.data;
|
|
1434
|
+
let result404 = null;
|
|
1435
|
+
let resultData404 = _responseText;
|
|
1436
|
+
result404 = JSON.parse(resultData404);
|
|
1437
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
1438
|
+
}
|
|
1439
|
+
else if (status === 409) {
|
|
1440
|
+
const _responseText = response.data;
|
|
1441
|
+
let result409 = null;
|
|
1442
|
+
let resultData409 = _responseText;
|
|
1443
|
+
result409 = JSON.parse(resultData409);
|
|
1444
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
1445
|
+
}
|
|
1446
|
+
else if (status === 401) {
|
|
1447
|
+
const _responseText = response.data;
|
|
1448
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
1449
|
+
}
|
|
1450
|
+
else if (status === 403) {
|
|
1451
|
+
const _responseText = response.data;
|
|
1452
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
1453
|
+
}
|
|
1454
|
+
else if (status !== 200 && status !== 204) {
|
|
1455
|
+
const _responseText = response.data;
|
|
1456
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
1457
|
+
}
|
|
1458
|
+
return Promise.resolve(null);
|
|
1459
|
+
}
|
|
1460
|
+
/**
|
|
1461
|
+
* Set product variants price. Variants identifiers will be changed.
|
|
1462
|
+
* @param id Product identifier.
|
|
1463
|
+
* @param productVersionId (optional) Product version identifier.
|
|
1464
|
+
* @param tenantId (optional) Tenant identifier.
|
|
1465
|
+
* @param body (optional) Set product variants price operation parameters.
|
|
1466
|
+
* @return Success
|
|
1467
|
+
*/
|
|
1468
|
+
setProductVariantPrice(id, productVersionId, tenantId, body, cancelToken) {
|
|
1469
|
+
let url_ = this.baseUrl + "/api/backoffice/v1/products/{id}/set-variant-price?";
|
|
1470
|
+
if (id === undefined || id === null)
|
|
1471
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
1472
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
1473
|
+
if (productVersionId !== undefined && productVersionId !== null)
|
|
1474
|
+
url_ += "productVersionId=" + encodeURIComponent("" + productVersionId) + "&";
|
|
1475
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
1476
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
1477
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
1478
|
+
const content_ = JSON.stringify(body);
|
|
1479
|
+
let options_ = {
|
|
1480
|
+
data: content_,
|
|
1481
|
+
method: "POST",
|
|
1482
|
+
url: url_,
|
|
1483
|
+
headers: {
|
|
1484
|
+
"Content-Type": "application/json",
|
|
1485
|
+
},
|
|
1486
|
+
cancelToken
|
|
1487
|
+
};
|
|
1488
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
1489
|
+
return this.instance.request(transformedOptions_);
|
|
1490
|
+
}).catch((_error) => {
|
|
1491
|
+
if (isAxiosError(_error) && _error.response) {
|
|
1492
|
+
return _error.response;
|
|
1493
|
+
}
|
|
1494
|
+
else {
|
|
1495
|
+
throw _error;
|
|
1496
|
+
}
|
|
1497
|
+
}).then((_response) => {
|
|
1498
|
+
return this.transformResult(url_, _response, (_response) => this.processSetProductVariantPrice(_response));
|
|
1499
|
+
});
|
|
1500
|
+
}
|
|
1501
|
+
processSetProductVariantPrice(response) {
|
|
1502
|
+
const status = response.status;
|
|
1503
|
+
let _headers = {};
|
|
1504
|
+
if (response.headers && typeof response.headers === "object") {
|
|
1505
|
+
for (let k in response.headers) {
|
|
1506
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
1507
|
+
_headers[k] = response.headers[k];
|
|
1508
|
+
}
|
|
1509
|
+
}
|
|
1510
|
+
}
|
|
1511
|
+
if (status === 200) {
|
|
1512
|
+
const _responseText = response.data;
|
|
1513
|
+
return Promise.resolve(null);
|
|
1514
|
+
}
|
|
1515
|
+
else if (status === 404) {
|
|
1516
|
+
const _responseText = response.data;
|
|
1517
|
+
let result404 = null;
|
|
1518
|
+
let resultData404 = _responseText;
|
|
1519
|
+
result404 = JSON.parse(resultData404);
|
|
1520
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
1521
|
+
}
|
|
1522
|
+
else if (status === 409) {
|
|
1523
|
+
const _responseText = response.data;
|
|
1524
|
+
let result409 = null;
|
|
1525
|
+
let resultData409 = _responseText;
|
|
1526
|
+
result409 = JSON.parse(resultData409);
|
|
1527
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
1528
|
+
}
|
|
1529
|
+
else if (status === 401) {
|
|
1530
|
+
const _responseText = response.data;
|
|
1531
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
1532
|
+
}
|
|
1533
|
+
else if (status === 403) {
|
|
1534
|
+
const _responseText = response.data;
|
|
1535
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
1536
|
+
}
|
|
1537
|
+
else if (status !== 200 && status !== 204) {
|
|
1538
|
+
const _responseText = response.data;
|
|
1539
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
1540
|
+
}
|
|
1541
|
+
return Promise.resolve(null);
|
|
1542
|
+
}
|
|
1543
|
+
/**
|
|
1544
|
+
* Set product variants availability. Variants identifiers will be changed.
|
|
1545
|
+
* @param id Product identifier.
|
|
1546
|
+
* @param productVersionId (optional) Product version identifier.
|
|
1547
|
+
* @param tenantId (optional) Tenant identifier.
|
|
1548
|
+
* @param body (optional) Set product variants availability operation parameters.
|
|
1549
|
+
* @return Success
|
|
1550
|
+
*/
|
|
1551
|
+
setProductVariantAvailability(id, productVersionId, tenantId, body, cancelToken) {
|
|
1552
|
+
let url_ = this.baseUrl + "/api/backoffice/v1/products/{id}/set-variant-availability?";
|
|
1553
|
+
if (id === undefined || id === null)
|
|
1554
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
1555
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
1556
|
+
if (productVersionId !== undefined && productVersionId !== null)
|
|
1557
|
+
url_ += "productVersionId=" + encodeURIComponent("" + productVersionId) + "&";
|
|
1558
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
1559
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
1560
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
1561
|
+
const content_ = JSON.stringify(body);
|
|
1562
|
+
let options_ = {
|
|
1563
|
+
data: content_,
|
|
1564
|
+
method: "POST",
|
|
1565
|
+
url: url_,
|
|
1566
|
+
headers: {
|
|
1567
|
+
"Content-Type": "application/json",
|
|
1568
|
+
},
|
|
1569
|
+
cancelToken
|
|
1570
|
+
};
|
|
1571
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
1572
|
+
return this.instance.request(transformedOptions_);
|
|
1573
|
+
}).catch((_error) => {
|
|
1574
|
+
if (isAxiosError(_error) && _error.response) {
|
|
1575
|
+
return _error.response;
|
|
1576
|
+
}
|
|
1577
|
+
else {
|
|
1578
|
+
throw _error;
|
|
1579
|
+
}
|
|
1580
|
+
}).then((_response) => {
|
|
1581
|
+
return this.transformResult(url_, _response, (_response) => this.processSetProductVariantAvailability(_response));
|
|
1582
|
+
});
|
|
1583
|
+
}
|
|
1584
|
+
processSetProductVariantAvailability(response) {
|
|
1585
|
+
const status = response.status;
|
|
1586
|
+
let _headers = {};
|
|
1587
|
+
if (response.headers && typeof response.headers === "object") {
|
|
1588
|
+
for (let k in response.headers) {
|
|
1589
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
1590
|
+
_headers[k] = response.headers[k];
|
|
1591
|
+
}
|
|
1592
|
+
}
|
|
1593
|
+
}
|
|
1594
|
+
if (status === 200) {
|
|
1595
|
+
const _responseText = response.data;
|
|
1596
|
+
return Promise.resolve(null);
|
|
1597
|
+
}
|
|
1598
|
+
else if (status === 404) {
|
|
1599
|
+
const _responseText = response.data;
|
|
1600
|
+
let result404 = null;
|
|
1601
|
+
let resultData404 = _responseText;
|
|
1602
|
+
result404 = JSON.parse(resultData404);
|
|
1603
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
1604
|
+
}
|
|
1605
|
+
else if (status === 409) {
|
|
1606
|
+
const _responseText = response.data;
|
|
1607
|
+
let result409 = null;
|
|
1608
|
+
let resultData409 = _responseText;
|
|
1609
|
+
result409 = JSON.parse(resultData409);
|
|
1610
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
1611
|
+
}
|
|
1612
|
+
else if (status === 401) {
|
|
1613
|
+
const _responseText = response.data;
|
|
1614
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
1615
|
+
}
|
|
1616
|
+
else if (status === 403) {
|
|
1617
|
+
const _responseText = response.data;
|
|
1618
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
1619
|
+
}
|
|
1620
|
+
else if (status !== 200 && status !== 204) {
|
|
1621
|
+
const _responseText = response.data;
|
|
1622
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
1623
|
+
}
|
|
1624
|
+
return Promise.resolve(null);
|
|
1625
|
+
}
|
|
1626
|
+
/**
|
|
1627
|
+
* Set product variants SKU. Variants identifiers will be changed.
|
|
1628
|
+
* @param id Product identifier.
|
|
1629
|
+
* @param productVersionId (optional) Product version identifier.
|
|
1630
|
+
* @param tenantId (optional) Tenant identifier.
|
|
1631
|
+
* @param body (optional) Set product variants SKU operation parameters.
|
|
1632
|
+
* @return Success
|
|
1633
|
+
*/
|
|
1634
|
+
setProductVariantSku(id, productVersionId, tenantId, body, cancelToken) {
|
|
1635
|
+
let url_ = this.baseUrl + "/api/backoffice/v1/products/{id}/set-variant-sku?";
|
|
1636
|
+
if (id === undefined || id === null)
|
|
1637
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
1638
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
1639
|
+
if (productVersionId !== undefined && productVersionId !== null)
|
|
1640
|
+
url_ += "productVersionId=" + encodeURIComponent("" + productVersionId) + "&";
|
|
1641
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
1642
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
1643
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
1644
|
+
const content_ = JSON.stringify(body);
|
|
1645
|
+
let options_ = {
|
|
1646
|
+
data: content_,
|
|
1647
|
+
method: "POST",
|
|
1648
|
+
url: url_,
|
|
1649
|
+
headers: {
|
|
1650
|
+
"Content-Type": "application/json",
|
|
1651
|
+
},
|
|
1652
|
+
cancelToken
|
|
1653
|
+
};
|
|
1654
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
1655
|
+
return this.instance.request(transformedOptions_);
|
|
1656
|
+
}).catch((_error) => {
|
|
1657
|
+
if (isAxiosError(_error) && _error.response) {
|
|
1658
|
+
return _error.response;
|
|
1659
|
+
}
|
|
1660
|
+
else {
|
|
1661
|
+
throw _error;
|
|
1662
|
+
}
|
|
1663
|
+
}).then((_response) => {
|
|
1664
|
+
return this.transformResult(url_, _response, (_response) => this.processSetProductVariantSku(_response));
|
|
1665
|
+
});
|
|
1666
|
+
}
|
|
1667
|
+
processSetProductVariantSku(response) {
|
|
1668
|
+
const status = response.status;
|
|
1669
|
+
let _headers = {};
|
|
1670
|
+
if (response.headers && typeof response.headers === "object") {
|
|
1671
|
+
for (let k in response.headers) {
|
|
1672
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
1673
|
+
_headers[k] = response.headers[k];
|
|
1674
|
+
}
|
|
1675
|
+
}
|
|
1676
|
+
}
|
|
1677
|
+
if (status === 200) {
|
|
1678
|
+
const _responseText = response.data;
|
|
1679
|
+
return Promise.resolve(null);
|
|
1680
|
+
}
|
|
1681
|
+
else if (status === 404) {
|
|
1682
|
+
const _responseText = response.data;
|
|
1683
|
+
let result404 = null;
|
|
1684
|
+
let resultData404 = _responseText;
|
|
1685
|
+
result404 = JSON.parse(resultData404);
|
|
1686
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
1687
|
+
}
|
|
1688
|
+
else if (status === 409) {
|
|
1689
|
+
const _responseText = response.data;
|
|
1690
|
+
let result409 = null;
|
|
1691
|
+
let resultData409 = _responseText;
|
|
1692
|
+
result409 = JSON.parse(resultData409);
|
|
1693
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
1694
|
+
}
|
|
1695
|
+
else if (status === 401) {
|
|
1696
|
+
const _responseText = response.data;
|
|
1697
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
1698
|
+
}
|
|
1699
|
+
else if (status === 403) {
|
|
1700
|
+
const _responseText = response.data;
|
|
1701
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
1702
|
+
}
|
|
1703
|
+
else if (status !== 200 && status !== 204) {
|
|
1704
|
+
const _responseText = response.data;
|
|
1705
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
1706
|
+
}
|
|
1707
|
+
return Promise.resolve(null);
|
|
1708
|
+
}
|
|
1709
|
+
/**
|
|
1710
|
+
* Imports products from a specific CSV file and returns a list of imported products descriptions.
|
|
1711
|
+
* @param tenantId (optional) Tenant identifier.
|
|
1712
|
+
* @param file (optional)
|
|
1713
|
+
* @return Success
|
|
1714
|
+
*/
|
|
1715
|
+
importProducts(tenantId, file, cancelToken) {
|
|
1716
|
+
let url_ = this.baseUrl + "/api/backoffice/v1/products/import?";
|
|
1717
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
1718
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
1719
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
1720
|
+
const content_ = new FormData();
|
|
1721
|
+
if (file !== null && file !== undefined)
|
|
1722
|
+
content_.append("file", file.data, file.fileName ? file.fileName : "file");
|
|
1723
|
+
let options_ = {
|
|
1724
|
+
data: content_,
|
|
1725
|
+
method: "POST",
|
|
1726
|
+
url: url_,
|
|
1727
|
+
headers: {
|
|
1728
|
+
"Accept": "application/json"
|
|
1729
|
+
},
|
|
1730
|
+
cancelToken
|
|
1731
|
+
};
|
|
1732
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
1733
|
+
return this.instance.request(transformedOptions_);
|
|
1734
|
+
}).catch((_error) => {
|
|
1735
|
+
if (isAxiosError(_error) && _error.response) {
|
|
1736
|
+
return _error.response;
|
|
1737
|
+
}
|
|
1738
|
+
else {
|
|
1739
|
+
throw _error;
|
|
1740
|
+
}
|
|
1741
|
+
}).then((_response) => {
|
|
1742
|
+
return this.transformResult(url_, _response, (_response) => this.processImportProducts(_response));
|
|
1743
|
+
});
|
|
1744
|
+
}
|
|
1745
|
+
processImportProducts(response) {
|
|
1746
|
+
const status = response.status;
|
|
1747
|
+
let _headers = {};
|
|
1748
|
+
if (response.headers && typeof response.headers === "object") {
|
|
1749
|
+
for (let k in response.headers) {
|
|
1750
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
1751
|
+
_headers[k] = response.headers[k];
|
|
1752
|
+
}
|
|
1753
|
+
}
|
|
1754
|
+
}
|
|
1755
|
+
if (status === 200) {
|
|
1756
|
+
const _responseText = response.data;
|
|
1757
|
+
let result200 = null;
|
|
1758
|
+
let resultData200 = _responseText;
|
|
1759
|
+
result200 = JSON.parse(resultData200);
|
|
1760
|
+
return Promise.resolve(result200);
|
|
1761
|
+
}
|
|
1762
|
+
else if (status === 400) {
|
|
1763
|
+
const _responseText = response.data;
|
|
1764
|
+
let result400 = null;
|
|
1765
|
+
let resultData400 = _responseText;
|
|
1766
|
+
result400 = JSON.parse(resultData400);
|
|
1767
|
+
return throwException("Bad Request", status, _responseText, _headers, result400);
|
|
1768
|
+
}
|
|
1769
|
+
else if (status === 409) {
|
|
1770
|
+
const _responseText = response.data;
|
|
1771
|
+
let result409 = null;
|
|
1772
|
+
let resultData409 = _responseText;
|
|
1773
|
+
result409 = JSON.parse(resultData409);
|
|
1774
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
1775
|
+
}
|
|
1776
|
+
else if (status === 401) {
|
|
1777
|
+
const _responseText = response.data;
|
|
1778
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
1779
|
+
}
|
|
1780
|
+
else if (status === 403) {
|
|
1781
|
+
const _responseText = response.data;
|
|
1782
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
1783
|
+
}
|
|
1784
|
+
else if (status !== 200 && status !== 204) {
|
|
1785
|
+
const _responseText = response.data;
|
|
1786
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
1787
|
+
}
|
|
1788
|
+
return Promise.resolve(null);
|
|
1789
|
+
}
|
|
1790
|
+
/**
|
|
1791
|
+
* Creates new designs connections for a specified product.
|
|
1792
|
+
* @param id Product identifier.
|
|
1793
|
+
* @param tenantId (optional) Tenant identifier.
|
|
1794
|
+
* @param body (optional) Product designs connections creation parameters.
|
|
1795
|
+
* @return Success
|
|
1796
|
+
*/
|
|
1797
|
+
createDesignsConnections(id, tenantId, body, cancelToken) {
|
|
1798
|
+
let url_ = this.baseUrl + "/api/backoffice/v1/products/{id}/design-connections?";
|
|
1799
|
+
if (id === undefined || id === null)
|
|
1800
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
1801
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
1802
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
1803
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
1804
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
1805
|
+
const content_ = JSON.stringify(body);
|
|
1806
|
+
let options_ = {
|
|
1807
|
+
data: content_,
|
|
1808
|
+
method: "POST",
|
|
1809
|
+
url: url_,
|
|
1810
|
+
headers: {
|
|
1811
|
+
"Content-Type": "application/json",
|
|
1812
|
+
},
|
|
1813
|
+
cancelToken
|
|
1814
|
+
};
|
|
1815
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
1816
|
+
return this.instance.request(transformedOptions_);
|
|
1817
|
+
}).catch((_error) => {
|
|
1818
|
+
if (isAxiosError(_error) && _error.response) {
|
|
1819
|
+
return _error.response;
|
|
1820
|
+
}
|
|
1821
|
+
else {
|
|
1822
|
+
throw _error;
|
|
1823
|
+
}
|
|
1824
|
+
}).then((_response) => {
|
|
1825
|
+
return this.transformResult(url_, _response, (_response) => this.processCreateDesignsConnections(_response));
|
|
1826
|
+
});
|
|
1827
|
+
}
|
|
1828
|
+
processCreateDesignsConnections(response) {
|
|
1829
|
+
const status = response.status;
|
|
1830
|
+
let _headers = {};
|
|
1831
|
+
if (response.headers && typeof response.headers === "object") {
|
|
1832
|
+
for (let k in response.headers) {
|
|
1833
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
1834
|
+
_headers[k] = response.headers[k];
|
|
1835
|
+
}
|
|
1836
|
+
}
|
|
1837
|
+
}
|
|
1838
|
+
if (status === 200) {
|
|
1839
|
+
const _responseText = response.data;
|
|
1840
|
+
return Promise.resolve(null);
|
|
1841
|
+
}
|
|
1842
|
+
else if (status === 404) {
|
|
1843
|
+
const _responseText = response.data;
|
|
1844
|
+
let result404 = null;
|
|
1845
|
+
let resultData404 = _responseText;
|
|
1846
|
+
result404 = JSON.parse(resultData404);
|
|
1847
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
1848
|
+
}
|
|
1849
|
+
else if (status === 409) {
|
|
1850
|
+
const _responseText = response.data;
|
|
1851
|
+
let result409 = null;
|
|
1852
|
+
let resultData409 = _responseText;
|
|
1853
|
+
result409 = JSON.parse(resultData409);
|
|
1854
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
1855
|
+
}
|
|
1856
|
+
else if (status === 401) {
|
|
1857
|
+
const _responseText = response.data;
|
|
1858
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
1859
|
+
}
|
|
1860
|
+
else if (status === 403) {
|
|
1861
|
+
const _responseText = response.data;
|
|
1862
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
1863
|
+
}
|
|
1864
|
+
else if (status !== 200 && status !== 204) {
|
|
1865
|
+
const _responseText = response.data;
|
|
1866
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
1867
|
+
}
|
|
1868
|
+
return Promise.resolve(null);
|
|
1869
|
+
}
|
|
1870
|
+
/**
|
|
1871
|
+
* Removes designs connections for a specified product.
|
|
1872
|
+
* @param id Product identifier.
|
|
1873
|
+
* @param tenantId (optional) Tenant identifier.
|
|
1874
|
+
* @param body (optional) Product designs connections creation parameters.
|
|
1875
|
+
* @return Success
|
|
1876
|
+
*/
|
|
1877
|
+
removeDesignsConnections(id, tenantId, body, cancelToken) {
|
|
1878
|
+
let url_ = this.baseUrl + "/api/backoffice/v1/products/{id}/design-connections?";
|
|
1879
|
+
if (id === undefined || id === null)
|
|
1880
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
1881
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
1882
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
1883
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
1884
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
1885
|
+
const content_ = JSON.stringify(body);
|
|
1886
|
+
let options_ = {
|
|
1887
|
+
data: content_,
|
|
1888
|
+
method: "DELETE",
|
|
1889
|
+
url: url_,
|
|
1890
|
+
headers: {
|
|
1891
|
+
"Content-Type": "application/json",
|
|
1892
|
+
},
|
|
1893
|
+
cancelToken
|
|
1894
|
+
};
|
|
1895
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
1896
|
+
return this.instance.request(transformedOptions_);
|
|
1897
|
+
}).catch((_error) => {
|
|
1898
|
+
if (isAxiosError(_error) && _error.response) {
|
|
1899
|
+
return _error.response;
|
|
1900
|
+
}
|
|
1901
|
+
else {
|
|
1902
|
+
throw _error;
|
|
1903
|
+
}
|
|
1904
|
+
}).then((_response) => {
|
|
1905
|
+
return this.transformResult(url_, _response, (_response) => this.processRemoveDesignsConnections(_response));
|
|
1906
|
+
});
|
|
1907
|
+
}
|
|
1908
|
+
processRemoveDesignsConnections(response) {
|
|
1909
|
+
const status = response.status;
|
|
1910
|
+
let _headers = {};
|
|
1911
|
+
if (response.headers && typeof response.headers === "object") {
|
|
1912
|
+
for (let k in response.headers) {
|
|
1913
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
1914
|
+
_headers[k] = response.headers[k];
|
|
1915
|
+
}
|
|
1916
|
+
}
|
|
1917
|
+
}
|
|
1918
|
+
if (status === 200) {
|
|
1919
|
+
const _responseText = response.data;
|
|
1920
|
+
return Promise.resolve(null);
|
|
1921
|
+
}
|
|
1922
|
+
else if (status === 404) {
|
|
1923
|
+
const _responseText = response.data;
|
|
1924
|
+
let result404 = null;
|
|
1925
|
+
let resultData404 = _responseText;
|
|
1926
|
+
result404 = JSON.parse(resultData404);
|
|
1927
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
1928
|
+
}
|
|
1929
|
+
else if (status === 409) {
|
|
1930
|
+
const _responseText = response.data;
|
|
1931
|
+
let result409 = null;
|
|
1932
|
+
let resultData409 = _responseText;
|
|
1933
|
+
result409 = JSON.parse(resultData409);
|
|
1934
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
1935
|
+
}
|
|
1936
|
+
else if (status === 401) {
|
|
1937
|
+
const _responseText = response.data;
|
|
1938
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
1939
|
+
}
|
|
1940
|
+
else if (status === 403) {
|
|
1941
|
+
const _responseText = response.data;
|
|
1942
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
1943
|
+
}
|
|
1944
|
+
else if (status !== 200 && status !== 204) {
|
|
1945
|
+
const _responseText = response.data;
|
|
1946
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
1947
|
+
}
|
|
1948
|
+
return Promise.resolve(null);
|
|
1949
|
+
}
|
|
1950
|
+
/**
|
|
1951
|
+
* Creates new mockups connections for a specified product.
|
|
1952
|
+
* @param id Product identifier.
|
|
1953
|
+
* @param tenantId (optional) Tenant identifier.
|
|
1954
|
+
* @param body (optional) Product mockups connections creation parameters.
|
|
1955
|
+
* @return Success
|
|
1956
|
+
*/
|
|
1957
|
+
createMockupsConnections(id, tenantId, body, cancelToken) {
|
|
1958
|
+
let url_ = this.baseUrl + "/api/backoffice/v1/products/{id}/mockup-connections?";
|
|
1959
|
+
if (id === undefined || id === null)
|
|
1960
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
1961
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
1962
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
1963
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
1964
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
1965
|
+
const content_ = JSON.stringify(body);
|
|
1966
|
+
let options_ = {
|
|
1967
|
+
data: content_,
|
|
1968
|
+
method: "POST",
|
|
1969
|
+
url: url_,
|
|
1970
|
+
headers: {
|
|
1971
|
+
"Content-Type": "application/json",
|
|
1972
|
+
},
|
|
1973
|
+
cancelToken
|
|
1974
|
+
};
|
|
1975
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
1976
|
+
return this.instance.request(transformedOptions_);
|
|
1977
|
+
}).catch((_error) => {
|
|
1978
|
+
if (isAxiosError(_error) && _error.response) {
|
|
1979
|
+
return _error.response;
|
|
1980
|
+
}
|
|
1981
|
+
else {
|
|
1982
|
+
throw _error;
|
|
1983
|
+
}
|
|
1984
|
+
}).then((_response) => {
|
|
1985
|
+
return this.transformResult(url_, _response, (_response) => this.processCreateMockupsConnections(_response));
|
|
1986
|
+
});
|
|
1987
|
+
}
|
|
1988
|
+
processCreateMockupsConnections(response) {
|
|
1989
|
+
const status = response.status;
|
|
1990
|
+
let _headers = {};
|
|
1991
|
+
if (response.headers && typeof response.headers === "object") {
|
|
1992
|
+
for (let k in response.headers) {
|
|
1993
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
1994
|
+
_headers[k] = response.headers[k];
|
|
1995
|
+
}
|
|
1996
|
+
}
|
|
1997
|
+
}
|
|
1998
|
+
if (status === 200) {
|
|
1999
|
+
const _responseText = response.data;
|
|
2000
|
+
return Promise.resolve(null);
|
|
2001
|
+
}
|
|
2002
|
+
else if (status === 404) {
|
|
2003
|
+
const _responseText = response.data;
|
|
2004
|
+
let result404 = null;
|
|
2005
|
+
let resultData404 = _responseText;
|
|
2006
|
+
result404 = JSON.parse(resultData404);
|
|
2007
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
2008
|
+
}
|
|
2009
|
+
else if (status === 409) {
|
|
2010
|
+
const _responseText = response.data;
|
|
2011
|
+
let result409 = null;
|
|
2012
|
+
let resultData409 = _responseText;
|
|
2013
|
+
result409 = JSON.parse(resultData409);
|
|
2014
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
2015
|
+
}
|
|
2016
|
+
else if (status === 401) {
|
|
2017
|
+
const _responseText = response.data;
|
|
2018
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
2019
|
+
}
|
|
2020
|
+
else if (status === 403) {
|
|
2021
|
+
const _responseText = response.data;
|
|
2022
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
2023
|
+
}
|
|
2024
|
+
else if (status !== 200 && status !== 204) {
|
|
2025
|
+
const _responseText = response.data;
|
|
2026
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
2027
|
+
}
|
|
2028
|
+
return Promise.resolve(null);
|
|
2029
|
+
}
|
|
2030
|
+
/**
|
|
2031
|
+
* Removes mockups connections for a specified product.
|
|
2032
|
+
* @param id Product identifier.
|
|
2033
|
+
* @param tenantId (optional) Tenant identifier.
|
|
2034
|
+
* @param body (optional) Product mockups connections creation parameters.
|
|
2035
|
+
* @return Success
|
|
2036
|
+
*/
|
|
2037
|
+
removeMockupsConnections(id, tenantId, body, cancelToken) {
|
|
2038
|
+
let url_ = this.baseUrl + "/api/backoffice/v1/products/{id}/mockup-connections?";
|
|
2039
|
+
if (id === undefined || id === null)
|
|
2040
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
2041
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
2042
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
2043
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2044
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
2045
|
+
const content_ = JSON.stringify(body);
|
|
2046
|
+
let options_ = {
|
|
2047
|
+
data: content_,
|
|
2048
|
+
method: "DELETE",
|
|
2049
|
+
url: url_,
|
|
2050
|
+
headers: {
|
|
2051
|
+
"Content-Type": "application/json",
|
|
2052
|
+
},
|
|
2053
|
+
cancelToken
|
|
2054
|
+
};
|
|
2055
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
2056
|
+
return this.instance.request(transformedOptions_);
|
|
2057
|
+
}).catch((_error) => {
|
|
2058
|
+
if (isAxiosError(_error) && _error.response) {
|
|
2059
|
+
return _error.response;
|
|
2060
|
+
}
|
|
2061
|
+
else {
|
|
2062
|
+
throw _error;
|
|
2063
|
+
}
|
|
2064
|
+
}).then((_response) => {
|
|
2065
|
+
return this.transformResult(url_, _response, (_response) => this.processRemoveMockupsConnections(_response));
|
|
2066
|
+
});
|
|
2067
|
+
}
|
|
2068
|
+
processRemoveMockupsConnections(response) {
|
|
2069
|
+
const status = response.status;
|
|
2070
|
+
let _headers = {};
|
|
2071
|
+
if (response.headers && typeof response.headers === "object") {
|
|
2072
|
+
for (let k in response.headers) {
|
|
2073
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
2074
|
+
_headers[k] = response.headers[k];
|
|
2075
|
+
}
|
|
2076
|
+
}
|
|
2077
|
+
}
|
|
2078
|
+
if (status === 200) {
|
|
2079
|
+
const _responseText = response.data;
|
|
2080
|
+
return Promise.resolve(null);
|
|
2081
|
+
}
|
|
2082
|
+
else if (status === 404) {
|
|
2083
|
+
const _responseText = response.data;
|
|
2084
|
+
let result404 = null;
|
|
2085
|
+
let resultData404 = _responseText;
|
|
2086
|
+
result404 = JSON.parse(resultData404);
|
|
2087
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
2088
|
+
}
|
|
2089
|
+
else if (status === 409) {
|
|
2090
|
+
const _responseText = response.data;
|
|
2091
|
+
let result409 = null;
|
|
2092
|
+
let resultData409 = _responseText;
|
|
2093
|
+
result409 = JSON.parse(resultData409);
|
|
2094
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
2095
|
+
}
|
|
2096
|
+
else if (status === 401) {
|
|
2097
|
+
const _responseText = response.data;
|
|
2098
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
2099
|
+
}
|
|
2100
|
+
else if (status === 403) {
|
|
2101
|
+
const _responseText = response.data;
|
|
2102
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
2103
|
+
}
|
|
2104
|
+
else if (status !== 200 && status !== 204) {
|
|
2105
|
+
const _responseText = response.data;
|
|
2106
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
2107
|
+
}
|
|
2108
|
+
return Promise.resolve(null);
|
|
2109
|
+
}
|
|
2110
|
+
/**
|
|
2111
|
+
* Creates new documents connections for a specified product.
|
|
2112
|
+
* @param id Product identifier.
|
|
2113
|
+
* @param tenantId (optional) Tenant identifier.
|
|
2114
|
+
* @param body (optional) Product documents connections creation parameters.
|
|
2115
|
+
* @return Success
|
|
2116
|
+
*/
|
|
2117
|
+
createDocumentsConnections(id, tenantId, body, cancelToken) {
|
|
2118
|
+
let url_ = this.baseUrl + "/api/backoffice/v1/products/{id}/document-connections?";
|
|
2119
|
+
if (id === undefined || id === null)
|
|
2120
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
2121
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
2122
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
2123
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2124
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
2125
|
+
const content_ = JSON.stringify(body);
|
|
2126
|
+
let options_ = {
|
|
2127
|
+
data: content_,
|
|
2128
|
+
method: "POST",
|
|
2129
|
+
url: url_,
|
|
2130
|
+
headers: {
|
|
2131
|
+
"Content-Type": "application/json",
|
|
2132
|
+
},
|
|
2133
|
+
cancelToken
|
|
2134
|
+
};
|
|
2135
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
2136
|
+
return this.instance.request(transformedOptions_);
|
|
2137
|
+
}).catch((_error) => {
|
|
2138
|
+
if (isAxiosError(_error) && _error.response) {
|
|
2139
|
+
return _error.response;
|
|
2140
|
+
}
|
|
2141
|
+
else {
|
|
2142
|
+
throw _error;
|
|
2143
|
+
}
|
|
2144
|
+
}).then((_response) => {
|
|
2145
|
+
return this.transformResult(url_, _response, (_response) => this.processCreateDocumentsConnections(_response));
|
|
2146
|
+
});
|
|
2147
|
+
}
|
|
2148
|
+
processCreateDocumentsConnections(response) {
|
|
2149
|
+
const status = response.status;
|
|
2150
|
+
let _headers = {};
|
|
2151
|
+
if (response.headers && typeof response.headers === "object") {
|
|
2152
|
+
for (let k in response.headers) {
|
|
2153
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
2154
|
+
_headers[k] = response.headers[k];
|
|
2155
|
+
}
|
|
2156
|
+
}
|
|
2157
|
+
}
|
|
2158
|
+
if (status === 200) {
|
|
2159
|
+
const _responseText = response.data;
|
|
2160
|
+
return Promise.resolve(null);
|
|
2161
|
+
}
|
|
2162
|
+
else if (status === 404) {
|
|
2163
|
+
const _responseText = response.data;
|
|
2164
|
+
let result404 = null;
|
|
2165
|
+
let resultData404 = _responseText;
|
|
2166
|
+
result404 = JSON.parse(resultData404);
|
|
2167
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
2168
|
+
}
|
|
2169
|
+
else if (status === 409) {
|
|
2170
|
+
const _responseText = response.data;
|
|
2171
|
+
let result409 = null;
|
|
2172
|
+
let resultData409 = _responseText;
|
|
2173
|
+
result409 = JSON.parse(resultData409);
|
|
2174
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
2175
|
+
}
|
|
2176
|
+
else if (status === 401) {
|
|
2177
|
+
const _responseText = response.data;
|
|
2178
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
2179
|
+
}
|
|
2180
|
+
else if (status === 403) {
|
|
2181
|
+
const _responseText = response.data;
|
|
2182
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
2183
|
+
}
|
|
2184
|
+
else if (status !== 200 && status !== 204) {
|
|
2185
|
+
const _responseText = response.data;
|
|
2186
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
2187
|
+
}
|
|
2188
|
+
return Promise.resolve(null);
|
|
2189
|
+
}
|
|
2190
|
+
/**
|
|
2191
|
+
* Removes documents connections for a specified product.
|
|
2192
|
+
* @param id Product identifier.
|
|
2193
|
+
* @param tenantId (optional) Tenant identifier.
|
|
2194
|
+
* @param body (optional) Product documents connections creation parameters.
|
|
2195
|
+
* @return Success
|
|
2196
|
+
*/
|
|
2197
|
+
removeDocumentsConnections(id, tenantId, body, cancelToken) {
|
|
2198
|
+
let url_ = this.baseUrl + "/api/backoffice/v1/products/{id}/document-connections?";
|
|
2199
|
+
if (id === undefined || id === null)
|
|
2200
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
2201
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
2202
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
2203
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2204
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
2205
|
+
const content_ = JSON.stringify(body);
|
|
2206
|
+
let options_ = {
|
|
2207
|
+
data: content_,
|
|
2208
|
+
method: "DELETE",
|
|
2209
|
+
url: url_,
|
|
2210
|
+
headers: {
|
|
2211
|
+
"Content-Type": "application/json",
|
|
2212
|
+
},
|
|
2213
|
+
cancelToken
|
|
2214
|
+
};
|
|
2215
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
2216
|
+
return this.instance.request(transformedOptions_);
|
|
2217
|
+
}).catch((_error) => {
|
|
2218
|
+
if (isAxiosError(_error) && _error.response) {
|
|
2219
|
+
return _error.response;
|
|
2220
|
+
}
|
|
2221
|
+
else {
|
|
2222
|
+
throw _error;
|
|
2223
|
+
}
|
|
2224
|
+
}).then((_response) => {
|
|
2225
|
+
return this.transformResult(url_, _response, (_response) => this.processRemoveDocumentsConnections(_response));
|
|
2226
|
+
});
|
|
2227
|
+
}
|
|
2228
|
+
processRemoveDocumentsConnections(response) {
|
|
2229
|
+
const status = response.status;
|
|
2230
|
+
let _headers = {};
|
|
2231
|
+
if (response.headers && typeof response.headers === "object") {
|
|
2232
|
+
for (let k in response.headers) {
|
|
2233
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
2234
|
+
_headers[k] = response.headers[k];
|
|
2235
|
+
}
|
|
2236
|
+
}
|
|
2237
|
+
}
|
|
2238
|
+
if (status === 200) {
|
|
2239
|
+
const _responseText = response.data;
|
|
2240
|
+
return Promise.resolve(null);
|
|
2241
|
+
}
|
|
2242
|
+
else if (status === 404) {
|
|
2243
|
+
const _responseText = response.data;
|
|
2244
|
+
let result404 = null;
|
|
2245
|
+
let resultData404 = _responseText;
|
|
2246
|
+
result404 = JSON.parse(resultData404);
|
|
2247
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
2248
|
+
}
|
|
2249
|
+
else if (status === 409) {
|
|
2250
|
+
const _responseText = response.data;
|
|
2251
|
+
let result409 = null;
|
|
2252
|
+
let resultData409 = _responseText;
|
|
2253
|
+
result409 = JSON.parse(resultData409);
|
|
2254
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
2255
|
+
}
|
|
2256
|
+
else if (status === 401) {
|
|
2257
|
+
const _responseText = response.data;
|
|
2258
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
2259
|
+
}
|
|
2260
|
+
else if (status === 403) {
|
|
2261
|
+
const _responseText = response.data;
|
|
2262
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
2263
|
+
}
|
|
2264
|
+
else if (status !== 200 && status !== 204) {
|
|
2265
|
+
const _responseText = response.data;
|
|
2266
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
2267
|
+
}
|
|
2268
|
+
return Promise.resolve(null);
|
|
2269
|
+
}
|
|
2270
|
+
/**
|
|
2271
|
+
* Returns all available product personalization workflows.
|
|
2272
|
+
* @param skip (optional) Defines page start offset from beginning of sorted result list.
|
|
2273
|
+
* @param take (optional) Defines page length (how many consequent items of sorted result list should be taken).
|
|
2274
|
+
* @param search (optional) Search string for partial by personalization workflow name.
|
|
2275
|
+
* @param tenantId (optional) Tenant identifier.
|
|
2276
|
+
* @return Success
|
|
2277
|
+
*/
|
|
2278
|
+
getAvailablePersonalizationWorkflows(skip, take, search, tenantId, cancelToken) {
|
|
2279
|
+
let url_ = this.baseUrl + "/api/backoffice/v1/products/available-workflows?";
|
|
2280
|
+
if (skip !== undefined && skip !== null)
|
|
2281
|
+
url_ += "skip=" + encodeURIComponent("" + skip) + "&";
|
|
2282
|
+
if (take !== undefined && take !== null)
|
|
2283
|
+
url_ += "take=" + encodeURIComponent("" + take) + "&";
|
|
2284
|
+
if (search !== undefined && search !== null)
|
|
2285
|
+
url_ += "search=" + encodeURIComponent("" + search) + "&";
|
|
2286
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
2287
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2288
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
2289
|
+
let options_ = {
|
|
2290
|
+
method: "GET",
|
|
2291
|
+
url: url_,
|
|
2292
|
+
headers: {
|
|
2293
|
+
"Accept": "application/json"
|
|
2294
|
+
},
|
|
2295
|
+
cancelToken
|
|
2296
|
+
};
|
|
2297
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
2298
|
+
return this.instance.request(transformedOptions_);
|
|
2299
|
+
}).catch((_error) => {
|
|
2300
|
+
if (isAxiosError(_error) && _error.response) {
|
|
2301
|
+
return _error.response;
|
|
2302
|
+
}
|
|
2303
|
+
else {
|
|
2304
|
+
throw _error;
|
|
2305
|
+
}
|
|
2306
|
+
}).then((_response) => {
|
|
2307
|
+
return this.transformResult(url_, _response, (_response) => this.processGetAvailablePersonalizationWorkflows(_response));
|
|
2308
|
+
});
|
|
2309
|
+
}
|
|
2310
|
+
processGetAvailablePersonalizationWorkflows(response) {
|
|
2311
|
+
const status = response.status;
|
|
2312
|
+
let _headers = {};
|
|
2313
|
+
if (response.headers && typeof response.headers === "object") {
|
|
2314
|
+
for (let k in response.headers) {
|
|
2315
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
2316
|
+
_headers[k] = response.headers[k];
|
|
2317
|
+
}
|
|
2318
|
+
}
|
|
2319
|
+
}
|
|
2320
|
+
if (status === 200) {
|
|
2321
|
+
const _responseText = response.data;
|
|
2322
|
+
let result200 = null;
|
|
2323
|
+
let resultData200 = _responseText;
|
|
2324
|
+
result200 = JSON.parse(resultData200);
|
|
2325
|
+
return Promise.resolve(result200);
|
|
2326
|
+
}
|
|
2327
|
+
else if (status === 401) {
|
|
2328
|
+
const _responseText = response.data;
|
|
2329
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
2330
|
+
}
|
|
2331
|
+
else if (status === 403) {
|
|
2332
|
+
const _responseText = response.data;
|
|
2333
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
2334
|
+
}
|
|
2335
|
+
else if (status !== 200 && status !== 204) {
|
|
2336
|
+
const _responseText = response.data;
|
|
2337
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
2338
|
+
}
|
|
2339
|
+
return Promise.resolve(null);
|
|
2340
|
+
}
|
|
2341
|
+
/**
|
|
2342
|
+
* Returns all available product processing pipelines.
|
|
2343
|
+
* @param skip (optional) Defines page start offset from beginning of sorted result list.
|
|
2344
|
+
* @param take (optional) Defines page length (how many consequent items of sorted result list should be taken).
|
|
2345
|
+
* @param search (optional) Search string for partial by processing pipeline name.
|
|
2346
|
+
* @param tenantId (optional) Tenant identifier.
|
|
2347
|
+
* @return Success
|
|
2348
|
+
*/
|
|
2349
|
+
getAvailableProcessingPipelines(skip, take, search, tenantId, cancelToken) {
|
|
2350
|
+
let url_ = this.baseUrl + "/api/backoffice/v1/products/available-pipelines?";
|
|
2351
|
+
if (skip !== undefined && skip !== null)
|
|
2352
|
+
url_ += "skip=" + encodeURIComponent("" + skip) + "&";
|
|
2353
|
+
if (take !== undefined && take !== null)
|
|
2354
|
+
url_ += "take=" + encodeURIComponent("" + take) + "&";
|
|
2355
|
+
if (search !== undefined && search !== null)
|
|
2356
|
+
url_ += "search=" + encodeURIComponent("" + search) + "&";
|
|
2357
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
2358
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2359
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
2360
|
+
let options_ = {
|
|
2361
|
+
method: "GET",
|
|
2362
|
+
url: url_,
|
|
2363
|
+
headers: {
|
|
2364
|
+
"Accept": "application/json"
|
|
2365
|
+
},
|
|
2366
|
+
cancelToken
|
|
2367
|
+
};
|
|
2368
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
2369
|
+
return this.instance.request(transformedOptions_);
|
|
2370
|
+
}).catch((_error) => {
|
|
2371
|
+
if (isAxiosError(_error) && _error.response) {
|
|
2372
|
+
return _error.response;
|
|
2373
|
+
}
|
|
2374
|
+
else {
|
|
2375
|
+
throw _error;
|
|
2376
|
+
}
|
|
2377
|
+
}).then((_response) => {
|
|
2378
|
+
return this.transformResult(url_, _response, (_response) => this.processGetAvailableProcessingPipelines(_response));
|
|
2379
|
+
});
|
|
2380
|
+
}
|
|
2381
|
+
processGetAvailableProcessingPipelines(response) {
|
|
2382
|
+
const status = response.status;
|
|
2383
|
+
let _headers = {};
|
|
2384
|
+
if (response.headers && typeof response.headers === "object") {
|
|
2385
|
+
for (let k in response.headers) {
|
|
2386
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
2387
|
+
_headers[k] = response.headers[k];
|
|
2388
|
+
}
|
|
2389
|
+
}
|
|
2390
|
+
}
|
|
2391
|
+
if (status === 200) {
|
|
2392
|
+
const _responseText = response.data;
|
|
2393
|
+
let result200 = null;
|
|
2394
|
+
let resultData200 = _responseText;
|
|
2395
|
+
result200 = JSON.parse(resultData200);
|
|
2396
|
+
return Promise.resolve(result200);
|
|
2397
|
+
}
|
|
2398
|
+
else if (status === 401) {
|
|
2399
|
+
const _responseText = response.data;
|
|
2400
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
2401
|
+
}
|
|
2402
|
+
else if (status === 403) {
|
|
2403
|
+
const _responseText = response.data;
|
|
2404
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
2405
|
+
}
|
|
2406
|
+
else if (status !== 200 && status !== 204) {
|
|
2407
|
+
const _responseText = response.data;
|
|
2408
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
2409
|
+
}
|
|
2410
|
+
return Promise.resolve(null);
|
|
2411
|
+
}
|
|
2412
|
+
}
|
|
2413
|
+
BackOfficeApiClient.ProductsManagementApiClient = ProductsManagementApiClient;
|
|
2414
|
+
class StorefrontsManagementApiClient extends ApiClientBase {
|
|
2415
|
+
instance;
|
|
2416
|
+
baseUrl;
|
|
2417
|
+
jsonParseReviver = undefined;
|
|
2418
|
+
constructor(configuration, baseUrl, instance) {
|
|
2419
|
+
super(configuration);
|
|
2420
|
+
this.instance = instance ? instance : axios.create();
|
|
2421
|
+
this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : this.getBaseUrl("");
|
|
2422
|
+
}
|
|
2423
|
+
/**
|
|
2424
|
+
* Returns all storefronts, relevant to the specified query parameters.
|
|
2425
|
+
* @param types (optional) Storefront type filter.
|
|
2426
|
+
* @param skip (optional) Defines page start offset from beginning of sorted result list.
|
|
2427
|
+
* @param take (optional) Defines page length (how many consequent items of sorted result list should be taken).
|
|
2428
|
+
* @param sorting (optional) Defines sorting order of result list e.g.: "Title ASC, LastModified DESC".
|
|
2429
|
+
* @param search (optional) Search string for partial match.
|
|
2430
|
+
* @param tenantId (optional) Tenant identifier.
|
|
2431
|
+
* @return Success
|
|
2432
|
+
*/
|
|
2433
|
+
getAll(types, skip, take, sorting, search, tenantId, cancelToken) {
|
|
2434
|
+
let url_ = this.baseUrl + "/api/backoffice/v1/storefronts?";
|
|
2435
|
+
if (types !== undefined && types !== null)
|
|
2436
|
+
types && types.forEach(item => { url_ += "types=" + encodeURIComponent("" + item) + "&"; });
|
|
2437
|
+
if (skip !== undefined && skip !== null)
|
|
2438
|
+
url_ += "skip=" + encodeURIComponent("" + skip) + "&";
|
|
2439
|
+
if (take !== undefined && take !== null)
|
|
2440
|
+
url_ += "take=" + encodeURIComponent("" + take) + "&";
|
|
2441
|
+
if (sorting !== undefined && sorting !== null)
|
|
2442
|
+
url_ += "sorting=" + encodeURIComponent("" + sorting) + "&";
|
|
2443
|
+
if (search !== undefined && search !== null)
|
|
2444
|
+
url_ += "search=" + encodeURIComponent("" + search) + "&";
|
|
2445
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
2446
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2447
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
2448
|
+
let options_ = {
|
|
2449
|
+
method: "GET",
|
|
2450
|
+
url: url_,
|
|
2451
|
+
headers: {
|
|
2452
|
+
"Accept": "application/json"
|
|
2453
|
+
},
|
|
2454
|
+
cancelToken
|
|
2455
|
+
};
|
|
2456
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
2457
|
+
return this.instance.request(transformedOptions_);
|
|
2458
|
+
}).catch((_error) => {
|
|
2459
|
+
if (isAxiosError(_error) && _error.response) {
|
|
2460
|
+
return _error.response;
|
|
2461
|
+
}
|
|
2462
|
+
else {
|
|
2463
|
+
throw _error;
|
|
2464
|
+
}
|
|
2465
|
+
}).then((_response) => {
|
|
2466
|
+
return this.transformResult(url_, _response, (_response) => this.processGetAll(_response));
|
|
2467
|
+
});
|
|
2468
|
+
}
|
|
2469
|
+
processGetAll(response) {
|
|
2470
|
+
const status = response.status;
|
|
2471
|
+
let _headers = {};
|
|
2472
|
+
if (response.headers && typeof response.headers === "object") {
|
|
2473
|
+
for (let k in response.headers) {
|
|
2474
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
2475
|
+
_headers[k] = response.headers[k];
|
|
2476
|
+
}
|
|
2477
|
+
}
|
|
2478
|
+
}
|
|
2479
|
+
if (status === 200) {
|
|
2480
|
+
const _responseText = response.data;
|
|
2481
|
+
let result200 = null;
|
|
2482
|
+
let resultData200 = _responseText;
|
|
2483
|
+
result200 = JSON.parse(resultData200);
|
|
2484
|
+
return Promise.resolve(result200);
|
|
2485
|
+
}
|
|
2486
|
+
else if (status === 401) {
|
|
2487
|
+
const _responseText = response.data;
|
|
2488
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
2489
|
+
}
|
|
2490
|
+
else if (status === 403) {
|
|
2491
|
+
const _responseText = response.data;
|
|
2492
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
2493
|
+
}
|
|
2494
|
+
else if (status !== 200 && status !== 204) {
|
|
2495
|
+
const _responseText = response.data;
|
|
2496
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
2497
|
+
}
|
|
2498
|
+
return Promise.resolve(null);
|
|
2499
|
+
}
|
|
2500
|
+
/**
|
|
2501
|
+
* Returns a storefront by identifier.
|
|
2502
|
+
* @param id Storefront identifier.
|
|
2503
|
+
* @param tenantId (optional) Tenant identifier.
|
|
2504
|
+
* @return Success
|
|
2505
|
+
*/
|
|
2506
|
+
get(id, tenantId, cancelToken) {
|
|
2507
|
+
let url_ = this.baseUrl + "/api/backoffice/v1/storefronts/{id}?";
|
|
2508
|
+
if (id === undefined || id === null)
|
|
2509
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
2510
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
2511
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
2512
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2513
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
2514
|
+
let options_ = {
|
|
2515
|
+
method: "GET",
|
|
2516
|
+
url: url_,
|
|
2517
|
+
headers: {
|
|
2518
|
+
"Accept": "application/json"
|
|
2519
|
+
},
|
|
2520
|
+
cancelToken
|
|
2521
|
+
};
|
|
2522
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
2523
|
+
return this.instance.request(transformedOptions_);
|
|
2524
|
+
}).catch((_error) => {
|
|
2525
|
+
if (isAxiosError(_error) && _error.response) {
|
|
2526
|
+
return _error.response;
|
|
2527
|
+
}
|
|
2528
|
+
else {
|
|
2529
|
+
throw _error;
|
|
2530
|
+
}
|
|
2531
|
+
}).then((_response) => {
|
|
2532
|
+
return this.transformResult(url_, _response, (_response) => this.processGet(_response));
|
|
2533
|
+
});
|
|
2534
|
+
}
|
|
2535
|
+
processGet(response) {
|
|
2536
|
+
const status = response.status;
|
|
2537
|
+
let _headers = {};
|
|
2538
|
+
if (response.headers && typeof response.headers === "object") {
|
|
2539
|
+
for (let k in response.headers) {
|
|
2540
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
2541
|
+
_headers[k] = response.headers[k];
|
|
2542
|
+
}
|
|
2543
|
+
}
|
|
2544
|
+
}
|
|
2545
|
+
if (status === 200) {
|
|
2546
|
+
const _responseText = response.data;
|
|
2547
|
+
let result200 = null;
|
|
2548
|
+
let resultData200 = _responseText;
|
|
2549
|
+
result200 = JSON.parse(resultData200);
|
|
2550
|
+
return Promise.resolve(result200);
|
|
2551
|
+
}
|
|
2552
|
+
else if (status === 404) {
|
|
2553
|
+
const _responseText = response.data;
|
|
2554
|
+
let result404 = null;
|
|
2555
|
+
let resultData404 = _responseText;
|
|
2556
|
+
result404 = JSON.parse(resultData404);
|
|
2557
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
2558
|
+
}
|
|
2559
|
+
else if (status === 401) {
|
|
2560
|
+
const _responseText = response.data;
|
|
2561
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
2562
|
+
}
|
|
2563
|
+
else if (status === 403) {
|
|
2564
|
+
const _responseText = response.data;
|
|
2565
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
2566
|
+
}
|
|
2567
|
+
else if (status !== 200 && status !== 204) {
|
|
2568
|
+
const _responseText = response.data;
|
|
2569
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
2570
|
+
}
|
|
2571
|
+
return Promise.resolve(null);
|
|
2572
|
+
}
|
|
2573
|
+
/**
|
|
2574
|
+
* Deletes an existing storefront by its identifier.
|
|
2575
|
+
* @param id Storefront identifier.
|
|
2576
|
+
* @param tenantId (optional) Tenant identifier.
|
|
2577
|
+
* @return Success
|
|
2578
|
+
*/
|
|
2579
|
+
delete(id, tenantId, cancelToken) {
|
|
2580
|
+
let url_ = this.baseUrl + "/api/backoffice/v1/storefronts/{id}?";
|
|
2581
|
+
if (id === undefined || id === null)
|
|
2582
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
2583
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
2584
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
2585
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2586
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
2587
|
+
let options_ = {
|
|
2588
|
+
method: "DELETE",
|
|
2589
|
+
url: url_,
|
|
2590
|
+
headers: {
|
|
2591
|
+
"Accept": "application/json"
|
|
2592
|
+
},
|
|
2593
|
+
cancelToken
|
|
2594
|
+
};
|
|
2595
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
2596
|
+
return this.instance.request(transformedOptions_);
|
|
2597
|
+
}).catch((_error) => {
|
|
2598
|
+
if (isAxiosError(_error) && _error.response) {
|
|
2599
|
+
return _error.response;
|
|
2600
|
+
}
|
|
2601
|
+
else {
|
|
2602
|
+
throw _error;
|
|
2603
|
+
}
|
|
2604
|
+
}).then((_response) => {
|
|
2605
|
+
return this.transformResult(url_, _response, (_response) => this.processDelete(_response));
|
|
2606
|
+
});
|
|
2607
|
+
}
|
|
2608
|
+
processDelete(response) {
|
|
2609
|
+
const status = response.status;
|
|
2610
|
+
let _headers = {};
|
|
2611
|
+
if (response.headers && typeof response.headers === "object") {
|
|
2612
|
+
for (let k in response.headers) {
|
|
2613
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
2614
|
+
_headers[k] = response.headers[k];
|
|
2615
|
+
}
|
|
2616
|
+
}
|
|
2617
|
+
}
|
|
2618
|
+
if (status === 200) {
|
|
2619
|
+
const _responseText = response.data;
|
|
2620
|
+
let result200 = null;
|
|
2621
|
+
let resultData200 = _responseText;
|
|
2622
|
+
result200 = JSON.parse(resultData200);
|
|
2623
|
+
return Promise.resolve(result200);
|
|
2624
|
+
}
|
|
2625
|
+
else if (status === 404) {
|
|
2626
|
+
const _responseText = response.data;
|
|
2627
|
+
let result404 = null;
|
|
2628
|
+
let resultData404 = _responseText;
|
|
2629
|
+
result404 = JSON.parse(resultData404);
|
|
2630
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
2631
|
+
}
|
|
2632
|
+
else if (status === 401) {
|
|
2633
|
+
const _responseText = response.data;
|
|
2634
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
2635
|
+
}
|
|
2636
|
+
else if (status === 403) {
|
|
2637
|
+
const _responseText = response.data;
|
|
2638
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
2639
|
+
}
|
|
2640
|
+
else if (status !== 200 && status !== 204) {
|
|
2641
|
+
const _responseText = response.data;
|
|
2642
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
2643
|
+
}
|
|
2644
|
+
return Promise.resolve(null);
|
|
2645
|
+
}
|
|
2646
|
+
/**
|
|
2647
|
+
* Creates new custom storefront.
|
|
2648
|
+
* @param tenantId (optional) Tenant identifier.
|
|
2649
|
+
* @param body (optional) Custom storefront creation model.
|
|
2650
|
+
* @return Success
|
|
2651
|
+
*/
|
|
2652
|
+
createCustomStorefront(tenantId, body, cancelToken) {
|
|
2653
|
+
let url_ = this.baseUrl + "/api/backoffice/v1/storefronts/custom?";
|
|
2654
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
2655
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2656
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
2657
|
+
const content_ = JSON.stringify(body);
|
|
2658
|
+
let options_ = {
|
|
2659
|
+
data: content_,
|
|
2660
|
+
method: "POST",
|
|
2661
|
+
url: url_,
|
|
2662
|
+
headers: {
|
|
2663
|
+
"Content-Type": "application/json",
|
|
2664
|
+
"Accept": "application/json"
|
|
2665
|
+
},
|
|
2666
|
+
cancelToken
|
|
2667
|
+
};
|
|
2668
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
2669
|
+
return this.instance.request(transformedOptions_);
|
|
2670
|
+
}).catch((_error) => {
|
|
2671
|
+
if (isAxiosError(_error) && _error.response) {
|
|
2672
|
+
return _error.response;
|
|
2673
|
+
}
|
|
2674
|
+
else {
|
|
2675
|
+
throw _error;
|
|
2676
|
+
}
|
|
2677
|
+
}).then((_response) => {
|
|
2678
|
+
return this.transformResult(url_, _response, (_response) => this.processCreateCustomStorefront(_response));
|
|
2679
|
+
});
|
|
2680
|
+
}
|
|
2681
|
+
processCreateCustomStorefront(response) {
|
|
2682
|
+
const status = response.status;
|
|
2683
|
+
let _headers = {};
|
|
2684
|
+
if (response.headers && typeof response.headers === "object") {
|
|
2685
|
+
for (let k in response.headers) {
|
|
2686
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
2687
|
+
_headers[k] = response.headers[k];
|
|
2688
|
+
}
|
|
2689
|
+
}
|
|
2690
|
+
}
|
|
2691
|
+
if (status === 200) {
|
|
2692
|
+
const _responseText = response.data;
|
|
2693
|
+
let result200 = null;
|
|
2694
|
+
let resultData200 = _responseText;
|
|
2695
|
+
result200 = JSON.parse(resultData200);
|
|
2696
|
+
return Promise.resolve(result200);
|
|
2697
|
+
}
|
|
2698
|
+
else if (status === 400) {
|
|
2699
|
+
const _responseText = response.data;
|
|
2700
|
+
let result400 = null;
|
|
2701
|
+
let resultData400 = _responseText;
|
|
2702
|
+
result400 = JSON.parse(resultData400);
|
|
2703
|
+
return throwException("Bad Request", status, _responseText, _headers, result400);
|
|
2704
|
+
}
|
|
2705
|
+
else if (status === 409) {
|
|
2706
|
+
const _responseText = response.data;
|
|
2707
|
+
let result409 = null;
|
|
2708
|
+
let resultData409 = _responseText;
|
|
2709
|
+
result409 = JSON.parse(resultData409);
|
|
2710
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
2711
|
+
}
|
|
2712
|
+
else if (status === 401) {
|
|
2713
|
+
const _responseText = response.data;
|
|
2714
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
2715
|
+
}
|
|
2716
|
+
else if (status === 403) {
|
|
2717
|
+
const _responseText = response.data;
|
|
2718
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
2719
|
+
}
|
|
2720
|
+
else if (status !== 200 && status !== 204) {
|
|
2721
|
+
const _responseText = response.data;
|
|
2722
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
2723
|
+
}
|
|
2724
|
+
return Promise.resolve(null);
|
|
2725
|
+
}
|
|
2726
|
+
/**
|
|
2727
|
+
* Returns extended information about custom storefront.
|
|
2728
|
+
* @param id Storefront identifier.
|
|
2729
|
+
* @param tenantId (optional) Tenant identifier.
|
|
2730
|
+
* @return Success
|
|
2731
|
+
*/
|
|
2732
|
+
getCustomStorefront(id, tenantId, cancelToken) {
|
|
2733
|
+
let url_ = this.baseUrl + "/api/backoffice/v1/storefronts/custom/{id}?";
|
|
2734
|
+
if (id === undefined || id === null)
|
|
2735
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
2736
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
2737
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
2738
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2739
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
2740
|
+
let options_ = {
|
|
2741
|
+
method: "GET",
|
|
2742
|
+
url: url_,
|
|
2743
|
+
headers: {
|
|
2744
|
+
"Accept": "application/json"
|
|
2745
|
+
},
|
|
2746
|
+
cancelToken
|
|
2747
|
+
};
|
|
2748
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
2749
|
+
return this.instance.request(transformedOptions_);
|
|
2750
|
+
}).catch((_error) => {
|
|
2751
|
+
if (isAxiosError(_error) && _error.response) {
|
|
2752
|
+
return _error.response;
|
|
2753
|
+
}
|
|
2754
|
+
else {
|
|
2755
|
+
throw _error;
|
|
2756
|
+
}
|
|
2757
|
+
}).then((_response) => {
|
|
2758
|
+
return this.transformResult(url_, _response, (_response) => this.processGetCustomStorefront(_response));
|
|
2759
|
+
});
|
|
2760
|
+
}
|
|
2761
|
+
processGetCustomStorefront(response) {
|
|
2762
|
+
const status = response.status;
|
|
2763
|
+
let _headers = {};
|
|
2764
|
+
if (response.headers && typeof response.headers === "object") {
|
|
2765
|
+
for (let k in response.headers) {
|
|
2766
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
2767
|
+
_headers[k] = response.headers[k];
|
|
2768
|
+
}
|
|
2769
|
+
}
|
|
2770
|
+
}
|
|
2771
|
+
if (status === 200) {
|
|
2772
|
+
const _responseText = response.data;
|
|
2773
|
+
let result200 = null;
|
|
2774
|
+
let resultData200 = _responseText;
|
|
2775
|
+
result200 = JSON.parse(resultData200);
|
|
2776
|
+
return Promise.resolve(result200);
|
|
2777
|
+
}
|
|
2778
|
+
else if (status === 404) {
|
|
2779
|
+
const _responseText = response.data;
|
|
2780
|
+
let result404 = null;
|
|
2781
|
+
let resultData404 = _responseText;
|
|
2782
|
+
result404 = JSON.parse(resultData404);
|
|
2783
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
2784
|
+
}
|
|
2785
|
+
else if (status === 401) {
|
|
2786
|
+
const _responseText = response.data;
|
|
2787
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
2788
|
+
}
|
|
2789
|
+
else if (status === 403) {
|
|
2790
|
+
const _responseText = response.data;
|
|
2791
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
2792
|
+
}
|
|
2793
|
+
else if (status !== 200 && status !== 204) {
|
|
2794
|
+
const _responseText = response.data;
|
|
2795
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
2796
|
+
}
|
|
2797
|
+
return Promise.resolve(null);
|
|
2798
|
+
}
|
|
2799
|
+
/**
|
|
2800
|
+
* Creates new NopCommerce storefront.
|
|
2801
|
+
* @param tenantId (optional) Tenant identifier.
|
|
2802
|
+
* @param body (optional) NopCommerce storefront creation model.
|
|
2803
|
+
* @return Success
|
|
2804
|
+
*/
|
|
2805
|
+
createNopCommerceStorefront(tenantId, body, cancelToken) {
|
|
2806
|
+
let url_ = this.baseUrl + "/api/backoffice/v1/storefronts/nopcommerce?";
|
|
2807
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
2808
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2809
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
2810
|
+
const content_ = JSON.stringify(body);
|
|
2811
|
+
let options_ = {
|
|
2812
|
+
data: content_,
|
|
2813
|
+
method: "POST",
|
|
2814
|
+
url: url_,
|
|
2815
|
+
headers: {
|
|
2816
|
+
"Content-Type": "application/json",
|
|
2817
|
+
"Accept": "application/json"
|
|
2818
|
+
},
|
|
2819
|
+
cancelToken
|
|
2820
|
+
};
|
|
2821
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
2822
|
+
return this.instance.request(transformedOptions_);
|
|
2823
|
+
}).catch((_error) => {
|
|
2824
|
+
if (isAxiosError(_error) && _error.response) {
|
|
2825
|
+
return _error.response;
|
|
2826
|
+
}
|
|
2827
|
+
else {
|
|
2828
|
+
throw _error;
|
|
2829
|
+
}
|
|
2830
|
+
}).then((_response) => {
|
|
2831
|
+
return this.transformResult(url_, _response, (_response) => this.processCreateNopCommerceStorefront(_response));
|
|
2832
|
+
});
|
|
2833
|
+
}
|
|
2834
|
+
processCreateNopCommerceStorefront(response) {
|
|
2835
|
+
const status = response.status;
|
|
2836
|
+
let _headers = {};
|
|
2837
|
+
if (response.headers && typeof response.headers === "object") {
|
|
2838
|
+
for (let k in response.headers) {
|
|
2839
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
2840
|
+
_headers[k] = response.headers[k];
|
|
2841
|
+
}
|
|
2842
|
+
}
|
|
2843
|
+
}
|
|
2844
|
+
if (status === 200) {
|
|
2845
|
+
const _responseText = response.data;
|
|
2846
|
+
let result200 = null;
|
|
2847
|
+
let resultData200 = _responseText;
|
|
2848
|
+
result200 = JSON.parse(resultData200);
|
|
2849
|
+
return Promise.resolve(result200);
|
|
2850
|
+
}
|
|
2851
|
+
else if (status === 400) {
|
|
2852
|
+
const _responseText = response.data;
|
|
2853
|
+
let result400 = null;
|
|
2854
|
+
let resultData400 = _responseText;
|
|
2855
|
+
result400 = JSON.parse(resultData400);
|
|
2856
|
+
return throwException("Bad Request", status, _responseText, _headers, result400);
|
|
2857
|
+
}
|
|
2858
|
+
else if (status === 409) {
|
|
2859
|
+
const _responseText = response.data;
|
|
2860
|
+
let result409 = null;
|
|
2861
|
+
let resultData409 = _responseText;
|
|
2862
|
+
result409 = JSON.parse(resultData409);
|
|
2863
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
2864
|
+
}
|
|
2865
|
+
else if (status === 401) {
|
|
2866
|
+
const _responseText = response.data;
|
|
2867
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
2868
|
+
}
|
|
2869
|
+
else if (status === 403) {
|
|
2870
|
+
const _responseText = response.data;
|
|
2871
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
2872
|
+
}
|
|
2873
|
+
else if (status !== 200 && status !== 204) {
|
|
2874
|
+
const _responseText = response.data;
|
|
2875
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
2876
|
+
}
|
|
2877
|
+
return Promise.resolve(null);
|
|
2878
|
+
}
|
|
2879
|
+
/**
|
|
2880
|
+
* Returns extended information about NopCommerce storefront.
|
|
2881
|
+
* @param id Storefront identifier.
|
|
2882
|
+
* @param tenantId (optional) Tenant identifier.
|
|
2883
|
+
* @return Success
|
|
2884
|
+
*/
|
|
2885
|
+
getNopCommerceStorefront(id, tenantId, cancelToken) {
|
|
2886
|
+
let url_ = this.baseUrl + "/api/backoffice/v1/storefronts/nopcommerce/{id}?";
|
|
2887
|
+
if (id === undefined || id === null)
|
|
2888
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
2889
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
2890
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
2891
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2892
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
2893
|
+
let options_ = {
|
|
2894
|
+
method: "GET",
|
|
2895
|
+
url: url_,
|
|
2896
|
+
headers: {
|
|
2897
|
+
"Accept": "application/json"
|
|
2898
|
+
},
|
|
2899
|
+
cancelToken
|
|
2900
|
+
};
|
|
2901
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
2902
|
+
return this.instance.request(transformedOptions_);
|
|
2903
|
+
}).catch((_error) => {
|
|
2904
|
+
if (isAxiosError(_error) && _error.response) {
|
|
2905
|
+
return _error.response;
|
|
2906
|
+
}
|
|
2907
|
+
else {
|
|
2908
|
+
throw _error;
|
|
2909
|
+
}
|
|
2910
|
+
}).then((_response) => {
|
|
2911
|
+
return this.transformResult(url_, _response, (_response) => this.processGetNopCommerceStorefront(_response));
|
|
2912
|
+
});
|
|
2913
|
+
}
|
|
2914
|
+
processGetNopCommerceStorefront(response) {
|
|
2915
|
+
const status = response.status;
|
|
2916
|
+
let _headers = {};
|
|
2917
|
+
if (response.headers && typeof response.headers === "object") {
|
|
2918
|
+
for (let k in response.headers) {
|
|
2919
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
2920
|
+
_headers[k] = response.headers[k];
|
|
2921
|
+
}
|
|
2922
|
+
}
|
|
2923
|
+
}
|
|
2924
|
+
if (status === 200) {
|
|
2925
|
+
const _responseText = response.data;
|
|
2926
|
+
let result200 = null;
|
|
2927
|
+
let resultData200 = _responseText;
|
|
2928
|
+
result200 = JSON.parse(resultData200);
|
|
2929
|
+
return Promise.resolve(result200);
|
|
2930
|
+
}
|
|
2931
|
+
else if (status === 404) {
|
|
2932
|
+
const _responseText = response.data;
|
|
2933
|
+
let result404 = null;
|
|
2934
|
+
let resultData404 = _responseText;
|
|
2935
|
+
result404 = JSON.parse(resultData404);
|
|
2936
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
2937
|
+
}
|
|
2938
|
+
else if (status === 401) {
|
|
2939
|
+
const _responseText = response.data;
|
|
2940
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
2941
|
+
}
|
|
2942
|
+
else if (status === 403) {
|
|
2943
|
+
const _responseText = response.data;
|
|
2944
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
2945
|
+
}
|
|
2946
|
+
else if (status !== 200 && status !== 204) {
|
|
2947
|
+
const _responseText = response.data;
|
|
2948
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
2949
|
+
}
|
|
2950
|
+
return Promise.resolve(null);
|
|
2951
|
+
}
|
|
2952
|
+
/**
|
|
2953
|
+
* Creates new WooCommerce storefront.
|
|
2954
|
+
* @param tenantId (optional) Tenant identifier.
|
|
2955
|
+
* @param body (optional) WooCommerce storefront creation model.
|
|
2956
|
+
* @return Success
|
|
2957
|
+
*/
|
|
2958
|
+
createWooCommerceStorefront(tenantId, body, cancelToken) {
|
|
2959
|
+
let url_ = this.baseUrl + "/api/backoffice/v1/storefronts/woocommerce?";
|
|
2960
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
2961
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2962
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
2963
|
+
const content_ = JSON.stringify(body);
|
|
2964
|
+
let options_ = {
|
|
2965
|
+
data: content_,
|
|
2966
|
+
method: "POST",
|
|
2967
|
+
url: url_,
|
|
2968
|
+
headers: {
|
|
2969
|
+
"Content-Type": "application/json",
|
|
2970
|
+
"Accept": "application/json"
|
|
2971
|
+
},
|
|
2972
|
+
cancelToken
|
|
2973
|
+
};
|
|
2974
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
2975
|
+
return this.instance.request(transformedOptions_);
|
|
2976
|
+
}).catch((_error) => {
|
|
2977
|
+
if (isAxiosError(_error) && _error.response) {
|
|
2978
|
+
return _error.response;
|
|
2979
|
+
}
|
|
2980
|
+
else {
|
|
2981
|
+
throw _error;
|
|
2982
|
+
}
|
|
2983
|
+
}).then((_response) => {
|
|
2984
|
+
return this.transformResult(url_, _response, (_response) => this.processCreateWooCommerceStorefront(_response));
|
|
2985
|
+
});
|
|
2986
|
+
}
|
|
2987
|
+
processCreateWooCommerceStorefront(response) {
|
|
2988
|
+
const status = response.status;
|
|
2989
|
+
let _headers = {};
|
|
2990
|
+
if (response.headers && typeof response.headers === "object") {
|
|
2991
|
+
for (let k in response.headers) {
|
|
2992
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
2993
|
+
_headers[k] = response.headers[k];
|
|
2994
|
+
}
|
|
2995
|
+
}
|
|
2996
|
+
}
|
|
2997
|
+
if (status === 200) {
|
|
2998
|
+
const _responseText = response.data;
|
|
2999
|
+
let result200 = null;
|
|
3000
|
+
let resultData200 = _responseText;
|
|
3001
|
+
result200 = JSON.parse(resultData200);
|
|
3002
|
+
return Promise.resolve(result200);
|
|
3003
|
+
}
|
|
3004
|
+
else if (status === 400) {
|
|
3005
|
+
const _responseText = response.data;
|
|
3006
|
+
let result400 = null;
|
|
3007
|
+
let resultData400 = _responseText;
|
|
3008
|
+
result400 = JSON.parse(resultData400);
|
|
3009
|
+
return throwException("Bad Request", status, _responseText, _headers, result400);
|
|
3010
|
+
}
|
|
3011
|
+
else if (status === 409) {
|
|
3012
|
+
const _responseText = response.data;
|
|
3013
|
+
let result409 = null;
|
|
3014
|
+
let resultData409 = _responseText;
|
|
3015
|
+
result409 = JSON.parse(resultData409);
|
|
3016
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
3017
|
+
}
|
|
3018
|
+
else if (status === 401) {
|
|
3019
|
+
const _responseText = response.data;
|
|
3020
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
3021
|
+
}
|
|
3022
|
+
else if (status === 403) {
|
|
3023
|
+
const _responseText = response.data;
|
|
3024
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
3025
|
+
}
|
|
3026
|
+
else if (status !== 200 && status !== 204) {
|
|
3027
|
+
const _responseText = response.data;
|
|
3028
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
3029
|
+
}
|
|
3030
|
+
return Promise.resolve(null);
|
|
3031
|
+
}
|
|
3032
|
+
/**
|
|
3033
|
+
* Returns extended information about WooCommerce storefront.
|
|
3034
|
+
* @param id Storefront identifier.
|
|
3035
|
+
* @param tenantId (optional) Tenant identifier.
|
|
3036
|
+
* @return Success
|
|
3037
|
+
*/
|
|
3038
|
+
getWooCommerceStorefront(id, tenantId, cancelToken) {
|
|
3039
|
+
let url_ = this.baseUrl + "/api/backoffice/v1/storefronts/woocommerce/{id}?";
|
|
3040
|
+
if (id === undefined || id === null)
|
|
3041
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
3042
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
3043
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
3044
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
3045
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
3046
|
+
let options_ = {
|
|
3047
|
+
method: "GET",
|
|
3048
|
+
url: url_,
|
|
3049
|
+
headers: {
|
|
3050
|
+
"Accept": "application/json"
|
|
3051
|
+
},
|
|
3052
|
+
cancelToken
|
|
3053
|
+
};
|
|
3054
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
3055
|
+
return this.instance.request(transformedOptions_);
|
|
3056
|
+
}).catch((_error) => {
|
|
3057
|
+
if (isAxiosError(_error) && _error.response) {
|
|
3058
|
+
return _error.response;
|
|
3059
|
+
}
|
|
3060
|
+
else {
|
|
3061
|
+
throw _error;
|
|
3062
|
+
}
|
|
3063
|
+
}).then((_response) => {
|
|
3064
|
+
return this.transformResult(url_, _response, (_response) => this.processGetWooCommerceStorefront(_response));
|
|
3065
|
+
});
|
|
3066
|
+
}
|
|
3067
|
+
processGetWooCommerceStorefront(response) {
|
|
3068
|
+
const status = response.status;
|
|
3069
|
+
let _headers = {};
|
|
3070
|
+
if (response.headers && typeof response.headers === "object") {
|
|
3071
|
+
for (let k in response.headers) {
|
|
3072
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
3073
|
+
_headers[k] = response.headers[k];
|
|
3074
|
+
}
|
|
3075
|
+
}
|
|
3076
|
+
}
|
|
3077
|
+
if (status === 200) {
|
|
3078
|
+
const _responseText = response.data;
|
|
3079
|
+
let result200 = null;
|
|
3080
|
+
let resultData200 = _responseText;
|
|
3081
|
+
result200 = JSON.parse(resultData200);
|
|
3082
|
+
return Promise.resolve(result200);
|
|
3083
|
+
}
|
|
3084
|
+
else if (status === 404) {
|
|
3085
|
+
const _responseText = response.data;
|
|
3086
|
+
let result404 = null;
|
|
3087
|
+
let resultData404 = _responseText;
|
|
3088
|
+
result404 = JSON.parse(resultData404);
|
|
3089
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
3090
|
+
}
|
|
3091
|
+
else if (status === 401) {
|
|
3092
|
+
const _responseText = response.data;
|
|
3093
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
3094
|
+
}
|
|
3095
|
+
else if (status === 403) {
|
|
3096
|
+
const _responseText = response.data;
|
|
3097
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
3098
|
+
}
|
|
3099
|
+
else if (status !== 200 && status !== 204) {
|
|
3100
|
+
const _responseText = response.data;
|
|
3101
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
3102
|
+
}
|
|
3103
|
+
return Promise.resolve(null);
|
|
3104
|
+
}
|
|
3105
|
+
/**
|
|
3106
|
+
* Creates new Magento storefront.
|
|
3107
|
+
* @param tenantId (optional) Tenant identifier.
|
|
3108
|
+
* @param body (optional) Magento storefront creation model.
|
|
3109
|
+
* @return Success
|
|
3110
|
+
*/
|
|
3111
|
+
createMagentoStorefront(tenantId, body, cancelToken) {
|
|
3112
|
+
let url_ = this.baseUrl + "/api/backoffice/v1/storefronts/magento?";
|
|
3113
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
3114
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
3115
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
3116
|
+
const content_ = JSON.stringify(body);
|
|
3117
|
+
let options_ = {
|
|
3118
|
+
data: content_,
|
|
3119
|
+
method: "POST",
|
|
3120
|
+
url: url_,
|
|
3121
|
+
headers: {
|
|
3122
|
+
"Content-Type": "application/json",
|
|
3123
|
+
"Accept": "application/json"
|
|
3124
|
+
},
|
|
3125
|
+
cancelToken
|
|
3126
|
+
};
|
|
3127
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
3128
|
+
return this.instance.request(transformedOptions_);
|
|
3129
|
+
}).catch((_error) => {
|
|
3130
|
+
if (isAxiosError(_error) && _error.response) {
|
|
3131
|
+
return _error.response;
|
|
3132
|
+
}
|
|
3133
|
+
else {
|
|
3134
|
+
throw _error;
|
|
3135
|
+
}
|
|
3136
|
+
}).then((_response) => {
|
|
3137
|
+
return this.transformResult(url_, _response, (_response) => this.processCreateMagentoStorefront(_response));
|
|
3138
|
+
});
|
|
3139
|
+
}
|
|
3140
|
+
processCreateMagentoStorefront(response) {
|
|
3141
|
+
const status = response.status;
|
|
3142
|
+
let _headers = {};
|
|
3143
|
+
if (response.headers && typeof response.headers === "object") {
|
|
3144
|
+
for (let k in response.headers) {
|
|
3145
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
3146
|
+
_headers[k] = response.headers[k];
|
|
3147
|
+
}
|
|
3148
|
+
}
|
|
3149
|
+
}
|
|
3150
|
+
if (status === 200) {
|
|
3151
|
+
const _responseText = response.data;
|
|
3152
|
+
let result200 = null;
|
|
3153
|
+
let resultData200 = _responseText;
|
|
3154
|
+
result200 = JSON.parse(resultData200);
|
|
3155
|
+
return Promise.resolve(result200);
|
|
3156
|
+
}
|
|
3157
|
+
else if (status === 400) {
|
|
3158
|
+
const _responseText = response.data;
|
|
3159
|
+
let result400 = null;
|
|
3160
|
+
let resultData400 = _responseText;
|
|
3161
|
+
result400 = JSON.parse(resultData400);
|
|
3162
|
+
return throwException("Bad Request", status, _responseText, _headers, result400);
|
|
3163
|
+
}
|
|
3164
|
+
else if (status === 409) {
|
|
3165
|
+
const _responseText = response.data;
|
|
3166
|
+
let result409 = null;
|
|
3167
|
+
let resultData409 = _responseText;
|
|
3168
|
+
result409 = JSON.parse(resultData409);
|
|
3169
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
3170
|
+
}
|
|
3171
|
+
else if (status === 401) {
|
|
3172
|
+
const _responseText = response.data;
|
|
3173
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
3174
|
+
}
|
|
3175
|
+
else if (status === 403) {
|
|
3176
|
+
const _responseText = response.data;
|
|
3177
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
3178
|
+
}
|
|
3179
|
+
else if (status !== 200 && status !== 204) {
|
|
3180
|
+
const _responseText = response.data;
|
|
3181
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
3182
|
+
}
|
|
3183
|
+
return Promise.resolve(null);
|
|
3184
|
+
}
|
|
3185
|
+
/**
|
|
3186
|
+
* Returns extended information about Magento storefront.
|
|
3187
|
+
* @param id Storefront identifier.
|
|
3188
|
+
* @param tenantId (optional) Tenant identifier.
|
|
3189
|
+
* @return Success
|
|
3190
|
+
*/
|
|
3191
|
+
getMagentoStorefront(id, tenantId, cancelToken) {
|
|
3192
|
+
let url_ = this.baseUrl + "/api/backoffice/v1/storefronts/magento/{id}?";
|
|
3193
|
+
if (id === undefined || id === null)
|
|
3194
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
3195
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
3196
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
3197
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
3198
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
3199
|
+
let options_ = {
|
|
3200
|
+
method: "GET",
|
|
3201
|
+
url: url_,
|
|
3202
|
+
headers: {
|
|
3203
|
+
"Accept": "application/json"
|
|
3204
|
+
},
|
|
3205
|
+
cancelToken
|
|
3206
|
+
};
|
|
3207
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
3208
|
+
return this.instance.request(transformedOptions_);
|
|
3209
|
+
}).catch((_error) => {
|
|
3210
|
+
if (isAxiosError(_error) && _error.response) {
|
|
3211
|
+
return _error.response;
|
|
3212
|
+
}
|
|
3213
|
+
else {
|
|
3214
|
+
throw _error;
|
|
3215
|
+
}
|
|
3216
|
+
}).then((_response) => {
|
|
3217
|
+
return this.transformResult(url_, _response, (_response) => this.processGetMagentoStorefront(_response));
|
|
3218
|
+
});
|
|
3219
|
+
}
|
|
3220
|
+
processGetMagentoStorefront(response) {
|
|
3221
|
+
const status = response.status;
|
|
3222
|
+
let _headers = {};
|
|
3223
|
+
if (response.headers && typeof response.headers === "object") {
|
|
3224
|
+
for (let k in response.headers) {
|
|
3225
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
3226
|
+
_headers[k] = response.headers[k];
|
|
3227
|
+
}
|
|
3228
|
+
}
|
|
3229
|
+
}
|
|
3230
|
+
if (status === 200) {
|
|
3231
|
+
const _responseText = response.data;
|
|
3232
|
+
let result200 = null;
|
|
3233
|
+
let resultData200 = _responseText;
|
|
3234
|
+
result200 = JSON.parse(resultData200);
|
|
3235
|
+
return Promise.resolve(result200);
|
|
3236
|
+
}
|
|
3237
|
+
else if (status === 404) {
|
|
3238
|
+
const _responseText = response.data;
|
|
3239
|
+
let result404 = null;
|
|
3240
|
+
let resultData404 = _responseText;
|
|
3241
|
+
result404 = JSON.parse(resultData404);
|
|
3242
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
3243
|
+
}
|
|
3244
|
+
else if (status === 401) {
|
|
3245
|
+
const _responseText = response.data;
|
|
3246
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
3247
|
+
}
|
|
3248
|
+
else if (status === 403) {
|
|
3249
|
+
const _responseText = response.data;
|
|
3250
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
3251
|
+
}
|
|
3252
|
+
else if (status !== 200 && status !== 204) {
|
|
3253
|
+
const _responseText = response.data;
|
|
3254
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
3255
|
+
}
|
|
3256
|
+
return Promise.resolve(null);
|
|
3257
|
+
}
|
|
3258
|
+
/**
|
|
3259
|
+
* Creates new BigCommerce storefront.
|
|
3260
|
+
* @param tenantId (optional) Tenant identifier.
|
|
3261
|
+
* @param body (optional) BigCommerce storefront creation model.
|
|
3262
|
+
* @return Success
|
|
3263
|
+
*/
|
|
3264
|
+
createBigCommerceStorefront(tenantId, body, cancelToken) {
|
|
3265
|
+
let url_ = this.baseUrl + "/api/backoffice/v1/storefronts/bigcommerce?";
|
|
3266
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
3267
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
3268
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
3269
|
+
const content_ = JSON.stringify(body);
|
|
3270
|
+
let options_ = {
|
|
3271
|
+
data: content_,
|
|
3272
|
+
method: "POST",
|
|
3273
|
+
url: url_,
|
|
3274
|
+
headers: {
|
|
3275
|
+
"Content-Type": "application/json",
|
|
3276
|
+
"Accept": "application/json"
|
|
3277
|
+
},
|
|
3278
|
+
cancelToken
|
|
3279
|
+
};
|
|
3280
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
3281
|
+
return this.instance.request(transformedOptions_);
|
|
3282
|
+
}).catch((_error) => {
|
|
3283
|
+
if (isAxiosError(_error) && _error.response) {
|
|
3284
|
+
return _error.response;
|
|
3285
|
+
}
|
|
3286
|
+
else {
|
|
3287
|
+
throw _error;
|
|
3288
|
+
}
|
|
3289
|
+
}).then((_response) => {
|
|
3290
|
+
return this.transformResult(url_, _response, (_response) => this.processCreateBigCommerceStorefront(_response));
|
|
3291
|
+
});
|
|
3292
|
+
}
|
|
3293
|
+
processCreateBigCommerceStorefront(response) {
|
|
3294
|
+
const status = response.status;
|
|
3295
|
+
let _headers = {};
|
|
3296
|
+
if (response.headers && typeof response.headers === "object") {
|
|
3297
|
+
for (let k in response.headers) {
|
|
3298
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
3299
|
+
_headers[k] = response.headers[k];
|
|
3300
|
+
}
|
|
3301
|
+
}
|
|
3302
|
+
}
|
|
3303
|
+
if (status === 200) {
|
|
3304
|
+
const _responseText = response.data;
|
|
3305
|
+
let result200 = null;
|
|
3306
|
+
let resultData200 = _responseText;
|
|
3307
|
+
result200 = JSON.parse(resultData200);
|
|
3308
|
+
return Promise.resolve(result200);
|
|
3309
|
+
}
|
|
3310
|
+
else if (status === 400) {
|
|
3311
|
+
const _responseText = response.data;
|
|
3312
|
+
let result400 = null;
|
|
3313
|
+
let resultData400 = _responseText;
|
|
3314
|
+
result400 = JSON.parse(resultData400);
|
|
3315
|
+
return throwException("Bad Request", status, _responseText, _headers, result400);
|
|
3316
|
+
}
|
|
3317
|
+
else if (status === 409) {
|
|
3318
|
+
const _responseText = response.data;
|
|
3319
|
+
let result409 = null;
|
|
3320
|
+
let resultData409 = _responseText;
|
|
3321
|
+
result409 = JSON.parse(resultData409);
|
|
3322
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
3323
|
+
}
|
|
3324
|
+
else if (status === 401) {
|
|
3325
|
+
const _responseText = response.data;
|
|
3326
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
3327
|
+
}
|
|
3328
|
+
else if (status === 403) {
|
|
3329
|
+
const _responseText = response.data;
|
|
3330
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
3331
|
+
}
|
|
3332
|
+
else if (status !== 200 && status !== 204) {
|
|
3333
|
+
const _responseText = response.data;
|
|
3334
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
3335
|
+
}
|
|
3336
|
+
return Promise.resolve(null);
|
|
3337
|
+
}
|
|
3338
|
+
/**
|
|
3339
|
+
* Returns extended information about BigCommerce storefront.
|
|
3340
|
+
* @param id Storefront identifier.
|
|
3341
|
+
* @param tenantId (optional) Tenant identifier.
|
|
3342
|
+
* @return Success
|
|
3343
|
+
*/
|
|
3344
|
+
getBigCommerceStorefront(id, tenantId, cancelToken) {
|
|
3345
|
+
let url_ = this.baseUrl + "/api/backoffice/v1/storefronts/bigcommerce/{id}?";
|
|
3346
|
+
if (id === undefined || id === null)
|
|
3347
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
3348
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
3349
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
3350
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
3351
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
3352
|
+
let options_ = {
|
|
3353
|
+
method: "GET",
|
|
3354
|
+
url: url_,
|
|
3355
|
+
headers: {
|
|
3356
|
+
"Accept": "application/json"
|
|
3357
|
+
},
|
|
3358
|
+
cancelToken
|
|
3359
|
+
};
|
|
3360
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
3361
|
+
return this.instance.request(transformedOptions_);
|
|
3362
|
+
}).catch((_error) => {
|
|
3363
|
+
if (isAxiosError(_error) && _error.response) {
|
|
3364
|
+
return _error.response;
|
|
3365
|
+
}
|
|
3366
|
+
else {
|
|
3367
|
+
throw _error;
|
|
3368
|
+
}
|
|
3369
|
+
}).then((_response) => {
|
|
3370
|
+
return this.transformResult(url_, _response, (_response) => this.processGetBigCommerceStorefront(_response));
|
|
3371
|
+
});
|
|
3372
|
+
}
|
|
3373
|
+
processGetBigCommerceStorefront(response) {
|
|
3374
|
+
const status = response.status;
|
|
3375
|
+
let _headers = {};
|
|
3376
|
+
if (response.headers && typeof response.headers === "object") {
|
|
3377
|
+
for (let k in response.headers) {
|
|
3378
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
3379
|
+
_headers[k] = response.headers[k];
|
|
3380
|
+
}
|
|
3381
|
+
}
|
|
3382
|
+
}
|
|
3383
|
+
if (status === 200) {
|
|
3384
|
+
const _responseText = response.data;
|
|
3385
|
+
let result200 = null;
|
|
3386
|
+
let resultData200 = _responseText;
|
|
3387
|
+
result200 = JSON.parse(resultData200);
|
|
3388
|
+
return Promise.resolve(result200);
|
|
3389
|
+
}
|
|
3390
|
+
else if (status === 404) {
|
|
3391
|
+
const _responseText = response.data;
|
|
3392
|
+
let result404 = null;
|
|
3393
|
+
let resultData404 = _responseText;
|
|
3394
|
+
result404 = JSON.parse(resultData404);
|
|
3395
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
3396
|
+
}
|
|
3397
|
+
else if (status === 401) {
|
|
3398
|
+
const _responseText = response.data;
|
|
3399
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
3400
|
+
}
|
|
3401
|
+
else if (status === 403) {
|
|
3402
|
+
const _responseText = response.data;
|
|
3403
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
3404
|
+
}
|
|
3405
|
+
else if (status !== 200 && status !== 204) {
|
|
3406
|
+
const _responseText = response.data;
|
|
3407
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
3408
|
+
}
|
|
3409
|
+
return Promise.resolve(null);
|
|
3410
|
+
}
|
|
3411
|
+
}
|
|
3412
|
+
BackOfficeApiClient.StorefrontsManagementApiClient = StorefrontsManagementApiClient;
|
|
3413
|
+
class UsersManagementApiClient extends ApiClientBase {
|
|
3414
|
+
instance;
|
|
3415
|
+
baseUrl;
|
|
3416
|
+
jsonParseReviver = undefined;
|
|
3417
|
+
constructor(configuration, baseUrl, instance) {
|
|
3418
|
+
super(configuration);
|
|
3419
|
+
this.instance = instance ? instance : axios.create();
|
|
3420
|
+
this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : this.getBaseUrl("");
|
|
3421
|
+
}
|
|
3422
|
+
/**
|
|
3423
|
+
* Returns a tenant users list.
|
|
3424
|
+
* @param tenantId (optional) Tenant identifier.
|
|
3425
|
+
* @return Success
|
|
3426
|
+
*/
|
|
3427
|
+
getAll(tenantId, cancelToken) {
|
|
3428
|
+
let url_ = this.baseUrl + "/api/backoffice/v1/users?";
|
|
3429
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
3430
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
3431
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
3432
|
+
let options_ = {
|
|
3433
|
+
method: "GET",
|
|
3434
|
+
url: url_,
|
|
3435
|
+
headers: {
|
|
3436
|
+
"Accept": "application/json"
|
|
3437
|
+
},
|
|
3438
|
+
cancelToken
|
|
3439
|
+
};
|
|
3440
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
3441
|
+
return this.instance.request(transformedOptions_);
|
|
3442
|
+
}).catch((_error) => {
|
|
3443
|
+
if (isAxiosError(_error) && _error.response) {
|
|
3444
|
+
return _error.response;
|
|
3445
|
+
}
|
|
3446
|
+
else {
|
|
3447
|
+
throw _error;
|
|
3448
|
+
}
|
|
3449
|
+
}).then((_response) => {
|
|
3450
|
+
return this.transformResult(url_, _response, (_response) => this.processGetAll(_response));
|
|
3451
|
+
});
|
|
3452
|
+
}
|
|
3453
|
+
processGetAll(response) {
|
|
3454
|
+
const status = response.status;
|
|
3455
|
+
let _headers = {};
|
|
3456
|
+
if (response.headers && typeof response.headers === "object") {
|
|
3457
|
+
for (let k in response.headers) {
|
|
3458
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
3459
|
+
_headers[k] = response.headers[k];
|
|
3460
|
+
}
|
|
3461
|
+
}
|
|
3462
|
+
}
|
|
3463
|
+
if (status === 200) {
|
|
3464
|
+
const _responseText = response.data;
|
|
3465
|
+
let result200 = null;
|
|
3466
|
+
let resultData200 = _responseText;
|
|
3467
|
+
result200 = JSON.parse(resultData200);
|
|
3468
|
+
return Promise.resolve(result200);
|
|
3469
|
+
}
|
|
3470
|
+
else if (status === 401) {
|
|
3471
|
+
const _responseText = response.data;
|
|
3472
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
3473
|
+
}
|
|
3474
|
+
else if (status === 403) {
|
|
3475
|
+
const _responseText = response.data;
|
|
3476
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
3477
|
+
}
|
|
3478
|
+
else if (status !== 200 && status !== 204) {
|
|
3479
|
+
const _responseText = response.data;
|
|
3480
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
3481
|
+
}
|
|
3482
|
+
return Promise.resolve(null);
|
|
3483
|
+
}
|
|
3484
|
+
/**
|
|
3485
|
+
* Creates a new tenant user.
|
|
3486
|
+
* @param tenantId (optional) Tenant identifier.
|
|
3487
|
+
* @param body (optional) User creation model.
|
|
3488
|
+
* @return Success
|
|
3489
|
+
*/
|
|
3490
|
+
create(tenantId, body, cancelToken) {
|
|
3491
|
+
let url_ = this.baseUrl + "/api/backoffice/v1/users?";
|
|
3492
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
3493
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
3494
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
3495
|
+
const content_ = JSON.stringify(body);
|
|
3496
|
+
let options_ = {
|
|
3497
|
+
data: content_,
|
|
3498
|
+
method: "POST",
|
|
3499
|
+
url: url_,
|
|
3500
|
+
headers: {
|
|
3501
|
+
"Content-Type": "application/json",
|
|
3502
|
+
"Accept": "application/json"
|
|
3503
|
+
},
|
|
3504
|
+
cancelToken
|
|
3505
|
+
};
|
|
3506
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
3507
|
+
return this.instance.request(transformedOptions_);
|
|
3508
|
+
}).catch((_error) => {
|
|
3509
|
+
if (isAxiosError(_error) && _error.response) {
|
|
3510
|
+
return _error.response;
|
|
3511
|
+
}
|
|
3512
|
+
else {
|
|
3513
|
+
throw _error;
|
|
3514
|
+
}
|
|
3515
|
+
}).then((_response) => {
|
|
3516
|
+
return this.transformResult(url_, _response, (_response) => this.processCreate(_response));
|
|
3517
|
+
});
|
|
3518
|
+
}
|
|
3519
|
+
processCreate(response) {
|
|
3520
|
+
const status = response.status;
|
|
3521
|
+
let _headers = {};
|
|
3522
|
+
if (response.headers && typeof response.headers === "object") {
|
|
3523
|
+
for (let k in response.headers) {
|
|
3524
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
3525
|
+
_headers[k] = response.headers[k];
|
|
3526
|
+
}
|
|
3527
|
+
}
|
|
3528
|
+
}
|
|
3529
|
+
if (status === 200) {
|
|
3530
|
+
const _responseText = response.data;
|
|
3531
|
+
let result200 = null;
|
|
3532
|
+
let resultData200 = _responseText;
|
|
3533
|
+
result200 = JSON.parse(resultData200);
|
|
3534
|
+
return Promise.resolve(result200);
|
|
3535
|
+
}
|
|
3536
|
+
else if (status === 409) {
|
|
3537
|
+
const _responseText = response.data;
|
|
3538
|
+
let result409 = null;
|
|
3539
|
+
let resultData409 = _responseText;
|
|
3540
|
+
result409 = JSON.parse(resultData409);
|
|
3541
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
3542
|
+
}
|
|
3543
|
+
else if (status === 401) {
|
|
3544
|
+
const _responseText = response.data;
|
|
3545
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
3546
|
+
}
|
|
3547
|
+
else if (status === 403) {
|
|
3548
|
+
const _responseText = response.data;
|
|
3549
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
3550
|
+
}
|
|
3551
|
+
else if (status !== 200 && status !== 204) {
|
|
3552
|
+
const _responseText = response.data;
|
|
3553
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
3554
|
+
}
|
|
3555
|
+
return Promise.resolve(null);
|
|
3556
|
+
}
|
|
3557
|
+
/**
|
|
3558
|
+
* Returns a tenant user by user identifier.
|
|
3559
|
+
* @param id User identifier.
|
|
3560
|
+
* @param tenantId (optional) Tenant identifier.
|
|
3561
|
+
* @return Success
|
|
3562
|
+
*/
|
|
3563
|
+
get(id, tenantId, cancelToken) {
|
|
3564
|
+
let url_ = this.baseUrl + "/api/backoffice/v1/users/{id}?";
|
|
3565
|
+
if (id === undefined || id === null)
|
|
3566
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
3567
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
3568
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
3569
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
3570
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
3571
|
+
let options_ = {
|
|
3572
|
+
method: "GET",
|
|
3573
|
+
url: url_,
|
|
3574
|
+
headers: {
|
|
3575
|
+
"Accept": "application/json"
|
|
3576
|
+
},
|
|
3577
|
+
cancelToken
|
|
3578
|
+
};
|
|
3579
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
3580
|
+
return this.instance.request(transformedOptions_);
|
|
3581
|
+
}).catch((_error) => {
|
|
3582
|
+
if (isAxiosError(_error) && _error.response) {
|
|
3583
|
+
return _error.response;
|
|
3584
|
+
}
|
|
3585
|
+
else {
|
|
3586
|
+
throw _error;
|
|
3587
|
+
}
|
|
3588
|
+
}).then((_response) => {
|
|
3589
|
+
return this.transformResult(url_, _response, (_response) => this.processGet(_response));
|
|
3590
|
+
});
|
|
3591
|
+
}
|
|
3592
|
+
processGet(response) {
|
|
3593
|
+
const status = response.status;
|
|
3594
|
+
let _headers = {};
|
|
3595
|
+
if (response.headers && typeof response.headers === "object") {
|
|
3596
|
+
for (let k in response.headers) {
|
|
3597
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
3598
|
+
_headers[k] = response.headers[k];
|
|
3599
|
+
}
|
|
3600
|
+
}
|
|
3601
|
+
}
|
|
3602
|
+
if (status === 200) {
|
|
3603
|
+
const _responseText = response.data;
|
|
3604
|
+
let result200 = null;
|
|
3605
|
+
let resultData200 = _responseText;
|
|
3606
|
+
result200 = JSON.parse(resultData200);
|
|
3607
|
+
return Promise.resolve(result200);
|
|
3608
|
+
}
|
|
3609
|
+
else if (status === 404) {
|
|
3610
|
+
const _responseText = response.data;
|
|
3611
|
+
let result404 = null;
|
|
3612
|
+
let resultData404 = _responseText;
|
|
3613
|
+
result404 = JSON.parse(resultData404);
|
|
3614
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
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
|
+
* Deletes an existing tenant user.
|
|
3632
|
+
* @param id User identifier.
|
|
3633
|
+
* @param tenantId (optional) Tenant identifier.
|
|
3634
|
+
* @return Success
|
|
3635
|
+
*/
|
|
3636
|
+
delete(id, tenantId, cancelToken) {
|
|
3637
|
+
let url_ = this.baseUrl + "/api/backoffice/v1/users/{id}?";
|
|
3638
|
+
if (id === undefined || id === null)
|
|
3639
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
3640
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
3641
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
3642
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
3643
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
3644
|
+
let options_ = {
|
|
3645
|
+
method: "DELETE",
|
|
3646
|
+
url: url_,
|
|
3647
|
+
headers: {},
|
|
3648
|
+
cancelToken
|
|
3649
|
+
};
|
|
3650
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
3651
|
+
return this.instance.request(transformedOptions_);
|
|
3652
|
+
}).catch((_error) => {
|
|
3653
|
+
if (isAxiosError(_error) && _error.response) {
|
|
3654
|
+
return _error.response;
|
|
3655
|
+
}
|
|
3656
|
+
else {
|
|
3657
|
+
throw _error;
|
|
3658
|
+
}
|
|
3659
|
+
}).then((_response) => {
|
|
3660
|
+
return this.transformResult(url_, _response, (_response) => this.processDelete(_response));
|
|
3661
|
+
});
|
|
3662
|
+
}
|
|
3663
|
+
processDelete(response) {
|
|
3664
|
+
const status = response.status;
|
|
3665
|
+
let _headers = {};
|
|
3666
|
+
if (response.headers && typeof response.headers === "object") {
|
|
3667
|
+
for (let k in response.headers) {
|
|
3668
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
3669
|
+
_headers[k] = response.headers[k];
|
|
3670
|
+
}
|
|
3671
|
+
}
|
|
3672
|
+
}
|
|
3673
|
+
if (status === 200) {
|
|
3674
|
+
const _responseText = response.data;
|
|
3675
|
+
return Promise.resolve(null);
|
|
3676
|
+
}
|
|
3677
|
+
else if (status === 401) {
|
|
3678
|
+
const _responseText = response.data;
|
|
3679
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
3680
|
+
}
|
|
3681
|
+
else if (status === 403) {
|
|
3682
|
+
const _responseText = response.data;
|
|
3683
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
3684
|
+
}
|
|
3685
|
+
else if (status !== 200 && status !== 204) {
|
|
3686
|
+
const _responseText = response.data;
|
|
3687
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
3688
|
+
}
|
|
3689
|
+
return Promise.resolve(null);
|
|
3690
|
+
}
|
|
3691
|
+
/**
|
|
3692
|
+
* Returns all tenant user roles, relevant to the specified query parameters.
|
|
3693
|
+
* @param search (optional) Search string for partial match.
|
|
3694
|
+
* @param skip (optional) Defines page start offset from beginning of sorted result list.
|
|
3695
|
+
* @param take (optional) Defines page length (how many consequent items of sorted result list should be taken).
|
|
3696
|
+
* @param sorting (optional) Defines sorting order of result list e.g.: "Title ASC, LastModified DESC".
|
|
3697
|
+
* @param tenantId (optional) Tenant identifier.
|
|
3698
|
+
* @return Success
|
|
3699
|
+
*/
|
|
3700
|
+
getAllRoles(search, skip, take, sorting, tenantId, cancelToken) {
|
|
3701
|
+
let url_ = this.baseUrl + "/api/backoffice/v1/users/roles?";
|
|
3702
|
+
if (search !== undefined && search !== null)
|
|
3703
|
+
url_ += "search=" + encodeURIComponent("" + search) + "&";
|
|
3704
|
+
if (skip !== undefined && skip !== null)
|
|
3705
|
+
url_ += "skip=" + encodeURIComponent("" + skip) + "&";
|
|
3706
|
+
if (take !== undefined && take !== null)
|
|
3707
|
+
url_ += "take=" + encodeURIComponent("" + take) + "&";
|
|
3708
|
+
if (sorting !== undefined && sorting !== null)
|
|
3709
|
+
url_ += "sorting=" + encodeURIComponent("" + sorting) + "&";
|
|
3710
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
3711
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
3712
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
3713
|
+
let options_ = {
|
|
3714
|
+
method: "GET",
|
|
3715
|
+
url: url_,
|
|
3716
|
+
headers: {
|
|
3717
|
+
"Accept": "application/json"
|
|
3718
|
+
},
|
|
3719
|
+
cancelToken
|
|
3720
|
+
};
|
|
3721
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
3722
|
+
return this.instance.request(transformedOptions_);
|
|
3723
|
+
}).catch((_error) => {
|
|
3724
|
+
if (isAxiosError(_error) && _error.response) {
|
|
3725
|
+
return _error.response;
|
|
3726
|
+
}
|
|
3727
|
+
else {
|
|
3728
|
+
throw _error;
|
|
3729
|
+
}
|
|
3730
|
+
}).then((_response) => {
|
|
3731
|
+
return this.transformResult(url_, _response, (_response) => this.processGetAllRoles(_response));
|
|
3732
|
+
});
|
|
3733
|
+
}
|
|
3734
|
+
processGetAllRoles(response) {
|
|
3735
|
+
const status = response.status;
|
|
3736
|
+
let _headers = {};
|
|
3737
|
+
if (response.headers && typeof response.headers === "object") {
|
|
3738
|
+
for (let k in response.headers) {
|
|
3739
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
3740
|
+
_headers[k] = response.headers[k];
|
|
3741
|
+
}
|
|
3742
|
+
}
|
|
3743
|
+
}
|
|
3744
|
+
if (status === 200) {
|
|
3745
|
+
const _responseText = response.data;
|
|
3746
|
+
let result200 = null;
|
|
3747
|
+
let resultData200 = _responseText;
|
|
3748
|
+
result200 = JSON.parse(resultData200);
|
|
3749
|
+
return Promise.resolve(result200);
|
|
3750
|
+
}
|
|
3751
|
+
else if (status === 401) {
|
|
3752
|
+
const _responseText = response.data;
|
|
3753
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
3754
|
+
}
|
|
3755
|
+
else if (status === 403) {
|
|
3756
|
+
const _responseText = response.data;
|
|
3757
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
3758
|
+
}
|
|
3759
|
+
else if (status !== 200 && status !== 204) {
|
|
3760
|
+
const _responseText = response.data;
|
|
3761
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
3762
|
+
}
|
|
3763
|
+
return Promise.resolve(null);
|
|
3764
|
+
}
|
|
3765
|
+
}
|
|
3766
|
+
BackOfficeApiClient.UsersManagementApiClient = UsersManagementApiClient;
|
|
3767
|
+
/** Available product reference target types. */
|
|
3768
|
+
let ProductReferenceType;
|
|
3769
|
+
(function (ProductReferenceType) {
|
|
3770
|
+
ProductReferenceType["ProductSpecification"] = "ProductSpecification";
|
|
3771
|
+
ProductReferenceType["Product"] = "Product";
|
|
3772
|
+
ProductReferenceType["ProductLink"] = "ProductLink";
|
|
3773
|
+
})(ProductReferenceType = BackOfficeApiClient.ProductReferenceType || (BackOfficeApiClient.ProductReferenceType = {}));
|
|
3774
|
+
/** Conflict types. */
|
|
3775
|
+
let ConflictType;
|
|
3776
|
+
(function (ConflictType) {
|
|
3777
|
+
ConflictType["NameConflict"] = "NameConflict";
|
|
3778
|
+
ConflictType["FolderOverwriteConflict"] = "FolderOverwriteConflict";
|
|
3779
|
+
ConflictType["IdConflict"] = "IdConflict";
|
|
3780
|
+
ConflictType["GeneralConflict"] = "GeneralConflict";
|
|
3781
|
+
})(ConflictType = BackOfficeApiClient.ConflictType || (BackOfficeApiClient.ConflictType = {}));
|
|
3782
|
+
/** Available option types. */
|
|
3783
|
+
let OptionType;
|
|
3784
|
+
(function (OptionType) {
|
|
3785
|
+
OptionType["Simple"] = "Simple";
|
|
3786
|
+
OptionType["Size"] = "Size";
|
|
3787
|
+
OptionType["PageCount"] = "PageCount";
|
|
3788
|
+
})(OptionType = BackOfficeApiClient.OptionType || (BackOfficeApiClient.OptionType = {}));
|
|
3789
|
+
/** Available appearance types. */
|
|
3790
|
+
let AppearanceDataType;
|
|
3791
|
+
(function (AppearanceDataType) {
|
|
3792
|
+
AppearanceDataType["Radio"] = "Radio";
|
|
3793
|
+
AppearanceDataType["Dropdown"] = "Dropdown";
|
|
3794
|
+
AppearanceDataType["Chips"] = "Chips";
|
|
3795
|
+
AppearanceDataType["ColorGrid"] = "ColorGrid";
|
|
3796
|
+
AppearanceDataType["ColorList"] = "ColorList";
|
|
3797
|
+
AppearanceDataType["ImageGrid"] = "ImageGrid";
|
|
3798
|
+
AppearanceDataType["ImageList"] = "ImageList";
|
|
3799
|
+
})(AppearanceDataType = BackOfficeApiClient.AppearanceDataType || (BackOfficeApiClient.AppearanceDataType = {}));
|
|
3800
|
+
/** Available product variant resource types. */
|
|
3801
|
+
let ProductVariantResourceType;
|
|
3802
|
+
(function (ProductVariantResourceType) {
|
|
3803
|
+
ProductVariantResourceType["Preview"] = "Preview";
|
|
3804
|
+
ProductVariantResourceType["EditorModel"] = "EditorModel";
|
|
3805
|
+
ProductVariantResourceType["Custom"] = "Custom";
|
|
3806
|
+
})(ProductVariantResourceType = BackOfficeApiClient.ProductVariantResourceType || (BackOfficeApiClient.ProductVariantResourceType = {}));
|
|
3807
|
+
/** Available mockup types. */
|
|
3808
|
+
let ProductVariantMockupType;
|
|
3809
|
+
(function (ProductVariantMockupType) {
|
|
3810
|
+
ProductVariantMockupType["Thumbnail"] = "Thumbnail";
|
|
3811
|
+
ProductVariantMockupType["Editor"] = "Editor";
|
|
3812
|
+
ProductVariantMockupType["Preview"] = "Preview";
|
|
3813
|
+
})(ProductVariantMockupType = BackOfficeApiClient.ProductVariantMockupType || (BackOfficeApiClient.ProductVariantMockupType = {}));
|
|
3814
|
+
/** Available surface usage types. */
|
|
3815
|
+
let SurfaceUsageType;
|
|
3816
|
+
(function (SurfaceUsageType) {
|
|
3817
|
+
SurfaceUsageType["Individual"] = "Individual";
|
|
3818
|
+
SurfaceUsageType["Custom"] = "Custom";
|
|
3819
|
+
SurfaceUsageType["All"] = "All";
|
|
3820
|
+
})(SurfaceUsageType = BackOfficeApiClient.SurfaceUsageType || (BackOfficeApiClient.SurfaceUsageType = {}));
|
|
3821
|
+
/** Product mockup type. */
|
|
3822
|
+
let ProductMockupType;
|
|
3823
|
+
(function (ProductMockupType) {
|
|
3824
|
+
ProductMockupType["Thumbnail"] = "Thumbnail";
|
|
3825
|
+
ProductMockupType["Editor"] = "Editor";
|
|
3826
|
+
ProductMockupType["Preview"] = "Preview";
|
|
3827
|
+
})(ProductMockupType = BackOfficeApiClient.ProductMockupType || (BackOfficeApiClient.ProductMockupType = {}));
|
|
3828
|
+
/** Type of editor that should be configured by workflow. */
|
|
3829
|
+
let WorkflowType;
|
|
3830
|
+
(function (WorkflowType) {
|
|
3831
|
+
WorkflowType["UIFramework"] = "UIFramework";
|
|
3832
|
+
WorkflowType["SimpleEditor"] = "SimpleEditor";
|
|
3833
|
+
WorkflowType["DesignEditor"] = "DesignEditor";
|
|
3834
|
+
WorkflowType["WorkflowElements"] = "WorkflowElements";
|
|
3835
|
+
})(WorkflowType = BackOfficeApiClient.WorkflowType || (BackOfficeApiClient.WorkflowType = {}));
|
|
3836
|
+
/** Storefront types. */
|
|
3837
|
+
let StorefrontType;
|
|
3838
|
+
(function (StorefrontType) {
|
|
3839
|
+
StorefrontType["Custom"] = "Custom";
|
|
3840
|
+
StorefrontType["ShopifyLegacy"] = "ShopifyLegacy";
|
|
3841
|
+
StorefrontType["DocketManager"] = "DocketManager";
|
|
3842
|
+
StorefrontType["CustomSaml"] = "CustomSaml";
|
|
3843
|
+
StorefrontType["NopCommerce"] = "NopCommerce";
|
|
3844
|
+
StorefrontType["WooCommerce"] = "WooCommerce";
|
|
3845
|
+
StorefrontType["Magento"] = "Magento";
|
|
3846
|
+
StorefrontType["BigCommerce"] = "BigCommerce";
|
|
3847
|
+
StorefrontType["Shopify"] = "Shopify";
|
|
3848
|
+
StorefrontType["ShopifyCustom"] = "ShopifyCustom";
|
|
3849
|
+
})(StorefrontType = BackOfficeApiClient.StorefrontType || (BackOfficeApiClient.StorefrontType = {}));
|
|
3850
|
+
class ApiException extends Error {
|
|
3851
|
+
message;
|
|
3852
|
+
status;
|
|
3853
|
+
response;
|
|
3854
|
+
headers;
|
|
3855
|
+
result;
|
|
3856
|
+
constructor(message, status, response, headers, result) {
|
|
3857
|
+
super();
|
|
3858
|
+
this.message = message;
|
|
3859
|
+
this.status = status;
|
|
3860
|
+
this.response = response;
|
|
3861
|
+
this.headers = headers;
|
|
3862
|
+
this.result = result;
|
|
3863
|
+
}
|
|
3864
|
+
isApiException = true;
|
|
3865
|
+
static isApiException(obj) {
|
|
3866
|
+
return obj.isApiException === true;
|
|
3867
|
+
}
|
|
3868
|
+
}
|
|
3869
|
+
BackOfficeApiClient.ApiException = ApiException;
|
|
3870
|
+
function throwException(message, status, response, headers, result) {
|
|
3871
|
+
if (result !== null && result !== undefined)
|
|
3872
|
+
throw result;
|
|
3873
|
+
else
|
|
3874
|
+
throw new ApiException(message, status, response, headers, null);
|
|
3875
|
+
}
|
|
3876
|
+
function isAxiosError(obj) {
|
|
3877
|
+
return obj && obj.isAxiosError === true;
|
|
3878
|
+
}
|
|
3879
|
+
})(BackOfficeApiClient || (BackOfficeApiClient = {}));
|
|
3880
|
+
//# sourceMappingURL=backoffice-api-client.js.map
|