@aurigma/axios-storefront-api-client 2.2.1038

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.
@@ -0,0 +1,2555 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ //----------------------
4
+ // <auto-generated>
5
+ // Generated using the NSwag toolchain v13.9.4.0 (NJsonSchema v10.3.1.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 class ApiClientConfiguration {
11
+ apiUrl;
12
+ apiKey = '';
13
+ authorizationToken = null;
14
+ async getAuthorizationToken() { return this.authorizationToken; }
15
+ ;
16
+ setAuthorizationToken(token) { this.authorizationToken = token; }
17
+ ;
18
+ }
19
+ export class ApiClientBase {
20
+ configuration;
21
+ constructor(configuration) {
22
+ this.configuration = configuration;
23
+ }
24
+ async transformOptions(options) {
25
+ const token = await this.configuration.getAuthorizationToken();
26
+ if (token != null) {
27
+ options.headers = { ...options.headers, authorization: ' bearer ' + token };
28
+ }
29
+ else {
30
+ options.headers = { ...options.headers, 'X-API-Key': this.configuration.apiKey };
31
+ }
32
+ options = { ...options, transformResponse: (res) => res, responseType: 'json' };
33
+ return options;
34
+ }
35
+ getBaseUrl(defultUrl) {
36
+ return this.configuration.apiUrl;
37
+ }
38
+ transformResult(url, res, cb) {
39
+ return cb(res);
40
+ }
41
+ }
42
+ export class BuildInfoApiClient extends ApiClientBase {
43
+ instance;
44
+ baseUrl;
45
+ jsonParseReviver = undefined;
46
+ constructor(configuration, baseUrl, instance) {
47
+ super(configuration);
48
+ this.instance = instance ? instance : axios.create();
49
+ this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : this.getBaseUrl("");
50
+ }
51
+ /**
52
+ * Gets assembly build info
53
+ * @return Success
54
+ */
55
+ headInfo(cancelToken) {
56
+ let url_ = this.baseUrl + "/api/storefront/v1/info";
57
+ url_ = url_.replace(/[?&]$/, "");
58
+ let options_ = {
59
+ method: "HEAD",
60
+ url: url_,
61
+ headers: {},
62
+ cancelToken
63
+ };
64
+ return this.transformOptions(options_).then(transformedOptions_ => {
65
+ return this.instance.request(transformedOptions_);
66
+ }).catch((_error) => {
67
+ if (isAxiosError(_error) && _error.response) {
68
+ return _error.response;
69
+ }
70
+ else {
71
+ throw _error;
72
+ }
73
+ }).then((_response) => {
74
+ return this.transformResult(url_, _response, (_response) => this.processHeadInfo(_response));
75
+ });
76
+ }
77
+ processHeadInfo(response) {
78
+ const status = response.status;
79
+ let _headers = {};
80
+ if (response.headers && typeof response.headers === "object") {
81
+ for (let k in response.headers) {
82
+ if (response.headers.hasOwnProperty(k)) {
83
+ _headers[k] = response.headers[k];
84
+ }
85
+ }
86
+ }
87
+ if (status === 200) {
88
+ const _responseText = response.data;
89
+ return Promise.resolve(null);
90
+ }
91
+ else if (status !== 200 && status !== 204) {
92
+ const _responseText = response.data;
93
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
94
+ }
95
+ return Promise.resolve(null);
96
+ }
97
+ /**
98
+ * Gets assembly build info
99
+ * @return Success
100
+ */
101
+ getInfo(cancelToken) {
102
+ let url_ = this.baseUrl + "/api/storefront/v1/info";
103
+ url_ = url_.replace(/[?&]$/, "");
104
+ let options_ = {
105
+ method: "GET",
106
+ url: url_,
107
+ headers: {
108
+ "Accept": "text/plain"
109
+ },
110
+ cancelToken
111
+ };
112
+ return this.transformOptions(options_).then(transformedOptions_ => {
113
+ return this.instance.request(transformedOptions_);
114
+ }).catch((_error) => {
115
+ if (isAxiosError(_error) && _error.response) {
116
+ return _error.response;
117
+ }
118
+ else {
119
+ throw _error;
120
+ }
121
+ }).then((_response) => {
122
+ return this.transformResult(url_, _response, (_response) => this.processGetInfo(_response));
123
+ });
124
+ }
125
+ processGetInfo(response) {
126
+ const status = response.status;
127
+ let _headers = {};
128
+ if (response.headers && typeof response.headers === "object") {
129
+ for (let k in response.headers) {
130
+ if (response.headers.hasOwnProperty(k)) {
131
+ _headers[k] = response.headers[k];
132
+ }
133
+ }
134
+ }
135
+ if (status === 200) {
136
+ const _responseText = response.data;
137
+ let result200 = null;
138
+ let resultData200 = _responseText;
139
+ result200 = JSON.parse(resultData200);
140
+ return result200;
141
+ }
142
+ else if (status !== 200 && status !== 204) {
143
+ const _responseText = response.data;
144
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
145
+ }
146
+ return Promise.resolve(null);
147
+ }
148
+ }
149
+ export class ProductReferencesApiClient extends ApiClientBase {
150
+ instance;
151
+ baseUrl;
152
+ jsonParseReviver = undefined;
153
+ constructor(configuration, baseUrl, instance) {
154
+ super(configuration);
155
+ this.instance = instance ? instance : axios.create();
156
+ this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : this.getBaseUrl("");
157
+ }
158
+ /**
159
+ * Gets all storefront product references relevant to specified query parameters
160
+ * @param storefrontId Storefront identifier
161
+ * @param productReference (optional) Product reference filter. Product reference is an external reference to Customer's Canvas product specification, e.g online store product identifier
162
+ * @param productSpecificationId (optional) Cusomer's Canvas product specification filter
163
+ * @param skip (optional) Defines page start offset from beginning of sorted result list
164
+ * @param take (optional) Defines page length (how much consequent items of sorted result list should be taken)
165
+ * @param sorting (optional) Defines sorting order of result list e.g.: "Title ASC, LastModified DESC"
166
+ * @param search (optional) Search string for partial match
167
+ * @param tenantId (optional) Tenant identifier
168
+ * @param userId (optional) User identifier
169
+ * @return Success
170
+ */
171
+ getAll(storefrontId, productReference, productSpecificationId, skip, take, sorting, search, tenantId, userId, cancelToken) {
172
+ let url_ = this.baseUrl + "/api/storefront/v1/product-references?";
173
+ if (storefrontId === undefined || storefrontId === null)
174
+ throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
175
+ else
176
+ url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
177
+ if (productReference !== undefined && productReference !== null)
178
+ url_ += "productReference=" + encodeURIComponent("" + productReference) + "&";
179
+ if (productSpecificationId !== undefined && productSpecificationId !== null)
180
+ url_ += "productSpecificationId=" + encodeURIComponent("" + productSpecificationId) + "&";
181
+ if (skip !== undefined && skip !== null)
182
+ url_ += "skip=" + encodeURIComponent("" + skip) + "&";
183
+ if (take !== undefined && take !== null)
184
+ url_ += "take=" + encodeURIComponent("" + take) + "&";
185
+ if (sorting !== undefined && sorting !== null)
186
+ url_ += "sorting=" + encodeURIComponent("" + sorting) + "&";
187
+ if (search !== undefined && search !== null)
188
+ url_ += "search=" + encodeURIComponent("" + search) + "&";
189
+ if (tenantId !== undefined && tenantId !== null)
190
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
191
+ if (userId !== undefined && userId !== null)
192
+ url_ += "userId=" + encodeURIComponent("" + userId) + "&";
193
+ url_ = url_.replace(/[?&]$/, "");
194
+ let options_ = {
195
+ method: "GET",
196
+ url: url_,
197
+ headers: {
198
+ "Accept": "text/plain"
199
+ },
200
+ cancelToken
201
+ };
202
+ return this.transformOptions(options_).then(transformedOptions_ => {
203
+ return this.instance.request(transformedOptions_);
204
+ }).catch((_error) => {
205
+ if (isAxiosError(_error) && _error.response) {
206
+ return _error.response;
207
+ }
208
+ else {
209
+ throw _error;
210
+ }
211
+ }).then((_response) => {
212
+ return this.transformResult(url_, _response, (_response) => this.processGetAll(_response));
213
+ });
214
+ }
215
+ processGetAll(response) {
216
+ const status = response.status;
217
+ let _headers = {};
218
+ if (response.headers && typeof response.headers === "object") {
219
+ for (let k in response.headers) {
220
+ if (response.headers.hasOwnProperty(k)) {
221
+ _headers[k] = response.headers[k];
222
+ }
223
+ }
224
+ }
225
+ if (status === 200) {
226
+ const _responseText = response.data;
227
+ let result200 = null;
228
+ let resultData200 = _responseText;
229
+ result200 = JSON.parse(resultData200);
230
+ return result200;
231
+ }
232
+ else if (status === 401) {
233
+ const _responseText = response.data;
234
+ return throwException("Unauthorized", status, _responseText, _headers);
235
+ }
236
+ else if (status === 403) {
237
+ const _responseText = response.data;
238
+ return throwException("Forbidden", status, _responseText, _headers);
239
+ }
240
+ else if (status !== 200 && status !== 204) {
241
+ const _responseText = response.data;
242
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
243
+ }
244
+ return Promise.resolve(null);
245
+ }
246
+ /**
247
+ * Creates new storefront product reference
248
+ * @param storefrontId Storefront identifier
249
+ * @param tenantId (optional) Tenant identifier
250
+ * @param userId (optional) User identifier
251
+ * @param body (optional) Create operation parameters
252
+ * @return Success
253
+ */
254
+ create(storefrontId, tenantId, userId, body, cancelToken) {
255
+ let url_ = this.baseUrl + "/api/storefront/v1/product-references?";
256
+ if (storefrontId === undefined || storefrontId === null)
257
+ throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
258
+ else
259
+ url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
260
+ if (tenantId !== undefined && tenantId !== null)
261
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
262
+ if (userId !== undefined && userId !== null)
263
+ url_ += "userId=" + encodeURIComponent("" + userId) + "&";
264
+ url_ = url_.replace(/[?&]$/, "");
265
+ const content_ = JSON.stringify(body);
266
+ let options_ = {
267
+ data: content_,
268
+ method: "POST",
269
+ url: url_,
270
+ headers: {
271
+ "Content-Type": "application/json-patch+json",
272
+ "Accept": "text/plain"
273
+ },
274
+ cancelToken
275
+ };
276
+ return this.transformOptions(options_).then(transformedOptions_ => {
277
+ return this.instance.request(transformedOptions_);
278
+ }).catch((_error) => {
279
+ if (isAxiosError(_error) && _error.response) {
280
+ return _error.response;
281
+ }
282
+ else {
283
+ throw _error;
284
+ }
285
+ }).then((_response) => {
286
+ return this.transformResult(url_, _response, (_response) => this.processCreate(_response));
287
+ });
288
+ }
289
+ processCreate(response) {
290
+ const status = response.status;
291
+ let _headers = {};
292
+ if (response.headers && typeof response.headers === "object") {
293
+ for (let k in response.headers) {
294
+ if (response.headers.hasOwnProperty(k)) {
295
+ _headers[k] = response.headers[k];
296
+ }
297
+ }
298
+ }
299
+ if (status === 201) {
300
+ const _responseText = response.data;
301
+ let result201 = null;
302
+ let resultData201 = _responseText;
303
+ result201 = JSON.parse(resultData201);
304
+ return result201;
305
+ }
306
+ else if (status === 404) {
307
+ const _responseText = response.data;
308
+ let result404 = null;
309
+ let resultData404 = _responseText;
310
+ result404 = JSON.parse(resultData404);
311
+ return throwException("Not Found", status, _responseText, _headers, result404);
312
+ }
313
+ else if (status === 401) {
314
+ const _responseText = response.data;
315
+ return throwException("Unauthorized", status, _responseText, _headers);
316
+ }
317
+ else if (status === 403) {
318
+ const _responseText = response.data;
319
+ return throwException("Forbidden", status, _responseText, _headers);
320
+ }
321
+ else if (status !== 200 && status !== 204) {
322
+ const _responseText = response.data;
323
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
324
+ }
325
+ return Promise.resolve(null);
326
+ }
327
+ /**
328
+ * Gets storefront product reference
329
+ * @param reference Product reference - external reference to Customer's Canvas product specification, e.g online store product identifier
330
+ * @param storefrontId Storefront identifier
331
+ * @param tenantId (optional) Tenant identifier
332
+ * @param userId (optional) User identifier
333
+ * @return Success
334
+ */
335
+ get(reference, storefrontId, tenantId, userId, cancelToken) {
336
+ let url_ = this.baseUrl + "/api/storefront/v1/product-references/{reference}?";
337
+ if (reference === undefined || reference === null)
338
+ throw new Error("The parameter 'reference' must be defined.");
339
+ url_ = url_.replace("{reference}", encodeURIComponent("" + reference));
340
+ if (storefrontId === undefined || storefrontId === null)
341
+ throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
342
+ else
343
+ url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
344
+ if (tenantId !== undefined && tenantId !== null)
345
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
346
+ if (userId !== undefined && userId !== null)
347
+ url_ += "userId=" + encodeURIComponent("" + userId) + "&";
348
+ url_ = url_.replace(/[?&]$/, "");
349
+ let options_ = {
350
+ method: "GET",
351
+ url: url_,
352
+ headers: {
353
+ "Accept": "text/plain"
354
+ },
355
+ cancelToken
356
+ };
357
+ return this.transformOptions(options_).then(transformedOptions_ => {
358
+ return this.instance.request(transformedOptions_);
359
+ }).catch((_error) => {
360
+ if (isAxiosError(_error) && _error.response) {
361
+ return _error.response;
362
+ }
363
+ else {
364
+ throw _error;
365
+ }
366
+ }).then((_response) => {
367
+ return this.transformResult(url_, _response, (_response) => this.processGet(_response));
368
+ });
369
+ }
370
+ processGet(response) {
371
+ const status = response.status;
372
+ let _headers = {};
373
+ if (response.headers && typeof response.headers === "object") {
374
+ for (let k in response.headers) {
375
+ if (response.headers.hasOwnProperty(k)) {
376
+ _headers[k] = response.headers[k];
377
+ }
378
+ }
379
+ }
380
+ if (status === 200) {
381
+ const _responseText = response.data;
382
+ let result200 = null;
383
+ let resultData200 = _responseText;
384
+ result200 = JSON.parse(resultData200);
385
+ return result200;
386
+ }
387
+ else if (status === 404) {
388
+ const _responseText = response.data;
389
+ let result404 = null;
390
+ let resultData404 = _responseText;
391
+ result404 = JSON.parse(resultData404);
392
+ return throwException("Not Found", status, _responseText, _headers, result404);
393
+ }
394
+ else if (status === 401) {
395
+ const _responseText = response.data;
396
+ return throwException("Unauthorized", status, _responseText, _headers);
397
+ }
398
+ else if (status === 403) {
399
+ const _responseText = response.data;
400
+ return throwException("Forbidden", status, _responseText, _headers);
401
+ }
402
+ else if (status !== 200 && status !== 204) {
403
+ const _responseText = response.data;
404
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
405
+ }
406
+ return Promise.resolve(null);
407
+ }
408
+ /**
409
+ * Deletes storefront product reference
410
+ * @param reference Product reference - external reference to Customer's Canvas product specification, e.g online store product identifier
411
+ * @param storefrontId Storefront identifier
412
+ * @param tenantId (optional) Tenant identifier
413
+ * @param userId (optional) User identifier
414
+ * @return Success
415
+ */
416
+ delete(reference, storefrontId, tenantId, userId, cancelToken) {
417
+ let url_ = this.baseUrl + "/api/storefront/v1/product-references/{reference}?";
418
+ if (reference === undefined || reference === null)
419
+ throw new Error("The parameter 'reference' must be defined.");
420
+ url_ = url_.replace("{reference}", encodeURIComponent("" + reference));
421
+ if (storefrontId === undefined || storefrontId === null)
422
+ throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
423
+ else
424
+ url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
425
+ if (tenantId !== undefined && tenantId !== null)
426
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
427
+ if (userId !== undefined && userId !== null)
428
+ url_ += "userId=" + encodeURIComponent("" + userId) + "&";
429
+ url_ = url_.replace(/[?&]$/, "");
430
+ let options_ = {
431
+ method: "DELETE",
432
+ url: url_,
433
+ headers: {
434
+ "Accept": "text/plain"
435
+ },
436
+ cancelToken
437
+ };
438
+ return this.transformOptions(options_).then(transformedOptions_ => {
439
+ return this.instance.request(transformedOptions_);
440
+ }).catch((_error) => {
441
+ if (isAxiosError(_error) && _error.response) {
442
+ return _error.response;
443
+ }
444
+ else {
445
+ throw _error;
446
+ }
447
+ }).then((_response) => {
448
+ return this.transformResult(url_, _response, (_response) => this.processDelete(_response));
449
+ });
450
+ }
451
+ processDelete(response) {
452
+ const status = response.status;
453
+ let _headers = {};
454
+ if (response.headers && typeof response.headers === "object") {
455
+ for (let k in response.headers) {
456
+ if (response.headers.hasOwnProperty(k)) {
457
+ _headers[k] = response.headers[k];
458
+ }
459
+ }
460
+ }
461
+ if (status === 200) {
462
+ const _responseText = response.data;
463
+ let result200 = null;
464
+ let resultData200 = _responseText;
465
+ result200 = JSON.parse(resultData200);
466
+ return result200;
467
+ }
468
+ else if (status === 404) {
469
+ const _responseText = response.data;
470
+ let result404 = null;
471
+ let resultData404 = _responseText;
472
+ result404 = JSON.parse(resultData404);
473
+ return throwException("Not Found", status, _responseText, _headers, result404);
474
+ }
475
+ else if (status === 401) {
476
+ const _responseText = response.data;
477
+ return throwException("Unauthorized", status, _responseText, _headers);
478
+ }
479
+ else if (status === 403) {
480
+ const _responseText = response.data;
481
+ return throwException("Forbidden", status, _responseText, _headers);
482
+ }
483
+ else if (status !== 200 && status !== 204) {
484
+ const _responseText = response.data;
485
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
486
+ }
487
+ return Promise.resolve(null);
488
+ }
489
+ /**
490
+ * Gets product specification by storefront product reference
491
+ * @param reference Product reference - external reference to Customer's Canvas product specification, e.g online store product identifier
492
+ * @param storefrontId Storefront identifier
493
+ * @param tenantId (optional) Tenant identifier
494
+ * @param userId (optional) User identifier
495
+ * @return Success
496
+ */
497
+ getProductSpecification(reference, storefrontId, tenantId, userId, cancelToken) {
498
+ let url_ = this.baseUrl + "/api/storefront/v1/product-references/{reference}/product-specification?";
499
+ if (reference === undefined || reference === null)
500
+ throw new Error("The parameter 'reference' must be defined.");
501
+ url_ = url_.replace("{reference}", encodeURIComponent("" + reference));
502
+ if (storefrontId === undefined || storefrontId === null)
503
+ throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
504
+ else
505
+ url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
506
+ if (tenantId !== undefined && tenantId !== null)
507
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
508
+ if (userId !== undefined && userId !== null)
509
+ url_ += "userId=" + encodeURIComponent("" + userId) + "&";
510
+ url_ = url_.replace(/[?&]$/, "");
511
+ let options_ = {
512
+ method: "GET",
513
+ url: url_,
514
+ headers: {
515
+ "Accept": "text/plain"
516
+ },
517
+ cancelToken
518
+ };
519
+ return this.transformOptions(options_).then(transformedOptions_ => {
520
+ return this.instance.request(transformedOptions_);
521
+ }).catch((_error) => {
522
+ if (isAxiosError(_error) && _error.response) {
523
+ return _error.response;
524
+ }
525
+ else {
526
+ throw _error;
527
+ }
528
+ }).then((_response) => {
529
+ return this.transformResult(url_, _response, (_response) => this.processGetProductSpecification(_response));
530
+ });
531
+ }
532
+ processGetProductSpecification(response) {
533
+ const status = response.status;
534
+ let _headers = {};
535
+ if (response.headers && typeof response.headers === "object") {
536
+ for (let k in response.headers) {
537
+ if (response.headers.hasOwnProperty(k)) {
538
+ _headers[k] = response.headers[k];
539
+ }
540
+ }
541
+ }
542
+ if (status === 200) {
543
+ const _responseText = response.data;
544
+ let result200 = null;
545
+ let resultData200 = _responseText;
546
+ result200 = JSON.parse(resultData200);
547
+ return result200;
548
+ }
549
+ else if (status === 404) {
550
+ const _responseText = response.data;
551
+ let result404 = null;
552
+ let resultData404 = _responseText;
553
+ result404 = JSON.parse(resultData404);
554
+ return throwException("Not Found", status, _responseText, _headers, result404);
555
+ }
556
+ else if (status === 401) {
557
+ const _responseText = response.data;
558
+ return throwException("Unauthorized", status, _responseText, _headers);
559
+ }
560
+ else if (status === 403) {
561
+ const _responseText = response.data;
562
+ return throwException("Forbidden", status, _responseText, _headers);
563
+ }
564
+ else if (status !== 200 && status !== 204) {
565
+ const _responseText = response.data;
566
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
567
+ }
568
+ return Promise.resolve(null);
569
+ }
570
+ /**
571
+ * Gets product configuration information by storefront product reference
572
+ * @param reference Product reference - external reference to Customer's Canvas product specification, e.g online store product identifier
573
+ * @param storefrontId Storefront identifier
574
+ * @param tenantId (optional) Tenant identifier
575
+ * @param userId (optional) User identifier
576
+ * @return Success
577
+ */
578
+ getProductConfig(reference, storefrontId, tenantId, userId, cancelToken) {
579
+ let url_ = this.baseUrl + "/api/storefront/v1/product-references/{reference}/product-config?";
580
+ if (reference === undefined || reference === null)
581
+ throw new Error("The parameter 'reference' must be defined.");
582
+ url_ = url_.replace("{reference}", encodeURIComponent("" + reference));
583
+ if (storefrontId === undefined || storefrontId === null)
584
+ throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
585
+ else
586
+ url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
587
+ if (tenantId !== undefined && tenantId !== null)
588
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
589
+ if (userId !== undefined && userId !== null)
590
+ url_ += "userId=" + encodeURIComponent("" + userId) + "&";
591
+ url_ = url_.replace(/[?&]$/, "");
592
+ let options_ = {
593
+ method: "GET",
594
+ url: url_,
595
+ headers: {
596
+ "Accept": "text/plain"
597
+ },
598
+ cancelToken
599
+ };
600
+ return this.transformOptions(options_).then(transformedOptions_ => {
601
+ return this.instance.request(transformedOptions_);
602
+ }).catch((_error) => {
603
+ if (isAxiosError(_error) && _error.response) {
604
+ return _error.response;
605
+ }
606
+ else {
607
+ throw _error;
608
+ }
609
+ }).then((_response) => {
610
+ return this.transformResult(url_, _response, (_response) => this.processGetProductConfig(_response));
611
+ });
612
+ }
613
+ processGetProductConfig(response) {
614
+ const status = response.status;
615
+ let _headers = {};
616
+ if (response.headers && typeof response.headers === "object") {
617
+ for (let k in response.headers) {
618
+ if (response.headers.hasOwnProperty(k)) {
619
+ _headers[k] = response.headers[k];
620
+ }
621
+ }
622
+ }
623
+ if (status === 200) {
624
+ const _responseText = response.data;
625
+ let result200 = null;
626
+ let resultData200 = _responseText;
627
+ result200 = JSON.parse(resultData200);
628
+ return result200;
629
+ }
630
+ else if (status === 404) {
631
+ const _responseText = response.data;
632
+ let result404 = null;
633
+ let resultData404 = _responseText;
634
+ result404 = JSON.parse(resultData404);
635
+ return throwException("Not Found", status, _responseText, _headers, result404);
636
+ }
637
+ else if (status === 401) {
638
+ const _responseText = response.data;
639
+ return throwException("Unauthorized", status, _responseText, _headers);
640
+ }
641
+ else if (status === 403) {
642
+ const _responseText = response.data;
643
+ return throwException("Forbidden", status, _responseText, _headers);
644
+ }
645
+ else if (status !== 200 && status !== 204) {
646
+ const _responseText = response.data;
647
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
648
+ }
649
+ return Promise.resolve(null);
650
+ }
651
+ }
652
+ export class ProductSpecificationsApiClient extends ApiClientBase {
653
+ instance;
654
+ baseUrl;
655
+ jsonParseReviver = undefined;
656
+ constructor(configuration, baseUrl, instance) {
657
+ super(configuration);
658
+ this.instance = instance ? instance : axios.create();
659
+ this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : this.getBaseUrl("");
660
+ }
661
+ /**
662
+ * Gets all product specifications relevant to specified query parameters
663
+ * @param skip (optional) Defines page start offset from beginning of sorted result list
664
+ * @param take (optional) Defines page length (how much consequent items of sorted result list should be taken)
665
+ * @param sorting (optional) Defines sorting order of result list e.g.: "Title ASC, LastModified DESC"
666
+ * @param search (optional) Search string for partial match
667
+ * @param tenantId (optional) Tenant identifier
668
+ * @param userId (optional) User identifier
669
+ * @return Success
670
+ */
671
+ getAll(skip, take, sorting, search, tenantId, userId, cancelToken) {
672
+ let url_ = this.baseUrl + "/api/storefront/v1/product-specifications?";
673
+ if (skip !== undefined && skip !== null)
674
+ url_ += "skip=" + encodeURIComponent("" + skip) + "&";
675
+ if (take !== undefined && take !== null)
676
+ url_ += "take=" + encodeURIComponent("" + take) + "&";
677
+ if (sorting !== undefined && sorting !== null)
678
+ url_ += "sorting=" + encodeURIComponent("" + sorting) + "&";
679
+ if (search !== undefined && search !== null)
680
+ url_ += "search=" + encodeURIComponent("" + search) + "&";
681
+ if (tenantId !== undefined && tenantId !== null)
682
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
683
+ if (userId !== undefined && userId !== null)
684
+ url_ += "userId=" + encodeURIComponent("" + userId) + "&";
685
+ url_ = url_.replace(/[?&]$/, "");
686
+ let options_ = {
687
+ method: "GET",
688
+ url: url_,
689
+ headers: {
690
+ "Accept": "text/plain"
691
+ },
692
+ cancelToken
693
+ };
694
+ return this.transformOptions(options_).then(transformedOptions_ => {
695
+ return this.instance.request(transformedOptions_);
696
+ }).catch((_error) => {
697
+ if (isAxiosError(_error) && _error.response) {
698
+ return _error.response;
699
+ }
700
+ else {
701
+ throw _error;
702
+ }
703
+ }).then((_response) => {
704
+ return this.transformResult(url_, _response, (_response) => this.processGetAll(_response));
705
+ });
706
+ }
707
+ processGetAll(response) {
708
+ const status = response.status;
709
+ let _headers = {};
710
+ if (response.headers && typeof response.headers === "object") {
711
+ for (let k in response.headers) {
712
+ if (response.headers.hasOwnProperty(k)) {
713
+ _headers[k] = response.headers[k];
714
+ }
715
+ }
716
+ }
717
+ if (status === 200) {
718
+ const _responseText = response.data;
719
+ let result200 = null;
720
+ let resultData200 = _responseText;
721
+ result200 = JSON.parse(resultData200);
722
+ return result200;
723
+ }
724
+ else if (status === 401) {
725
+ const _responseText = response.data;
726
+ return throwException("Unauthorized", status, _responseText, _headers);
727
+ }
728
+ else if (status === 403) {
729
+ const _responseText = response.data;
730
+ return throwException("Forbidden", status, _responseText, _headers);
731
+ }
732
+ else if (status !== 200 && status !== 204) {
733
+ const _responseText = response.data;
734
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
735
+ }
736
+ return Promise.resolve(null);
737
+ }
738
+ /**
739
+ * Gets product specification by id
740
+ * @param id Product specification identifier
741
+ * @param tenantId (optional) Tenant identifier
742
+ * @param userId (optional) User identifier
743
+ * @return Success
744
+ */
745
+ get(id, tenantId, userId, cancelToken) {
746
+ let url_ = this.baseUrl + "/api/storefront/v1/product-specifications/{id}?";
747
+ if (id === undefined || id === null)
748
+ throw new Error("The parameter 'id' must be defined.");
749
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
750
+ if (tenantId !== undefined && tenantId !== null)
751
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
752
+ if (userId !== undefined && userId !== null)
753
+ url_ += "userId=" + encodeURIComponent("" + userId) + "&";
754
+ url_ = url_.replace(/[?&]$/, "");
755
+ let options_ = {
756
+ method: "GET",
757
+ url: url_,
758
+ headers: {
759
+ "Accept": "text/plain"
760
+ },
761
+ cancelToken
762
+ };
763
+ return this.transformOptions(options_).then(transformedOptions_ => {
764
+ return this.instance.request(transformedOptions_);
765
+ }).catch((_error) => {
766
+ if (isAxiosError(_error) && _error.response) {
767
+ return _error.response;
768
+ }
769
+ else {
770
+ throw _error;
771
+ }
772
+ }).then((_response) => {
773
+ return this.transformResult(url_, _response, (_response) => this.processGet(_response));
774
+ });
775
+ }
776
+ processGet(response) {
777
+ const status = response.status;
778
+ let _headers = {};
779
+ if (response.headers && typeof response.headers === "object") {
780
+ for (let k in response.headers) {
781
+ if (response.headers.hasOwnProperty(k)) {
782
+ _headers[k] = response.headers[k];
783
+ }
784
+ }
785
+ }
786
+ if (status === 200) {
787
+ const _responseText = response.data;
788
+ let result200 = null;
789
+ let resultData200 = _responseText;
790
+ result200 = JSON.parse(resultData200);
791
+ return result200;
792
+ }
793
+ else if (status === 404) {
794
+ const _responseText = response.data;
795
+ let result404 = null;
796
+ let resultData404 = _responseText;
797
+ result404 = JSON.parse(resultData404);
798
+ return throwException("Not Found", status, _responseText, _headers, result404);
799
+ }
800
+ else if (status === 401) {
801
+ const _responseText = response.data;
802
+ return throwException("Unauthorized", status, _responseText, _headers);
803
+ }
804
+ else if (status === 403) {
805
+ const _responseText = response.data;
806
+ return throwException("Forbidden", status, _responseText, _headers);
807
+ }
808
+ else if (status !== 200 && status !== 204) {
809
+ const _responseText = response.data;
810
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
811
+ }
812
+ return Promise.resolve(null);
813
+ }
814
+ /**
815
+ * Gets product configuration description by product specification id
816
+ * @param id Product specification identifier
817
+ * @param tenantId (optional) Tenant identifier
818
+ * @param userId (optional) User identifier
819
+ * @return Success
820
+ */
821
+ getConfiguration(id, tenantId, userId, cancelToken) {
822
+ let url_ = this.baseUrl + "/api/storefront/v1/product-specifications/{id}/config?";
823
+ if (id === undefined || id === null)
824
+ throw new Error("The parameter 'id' must be defined.");
825
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
826
+ if (tenantId !== undefined && tenantId !== null)
827
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
828
+ if (userId !== undefined && userId !== null)
829
+ url_ += "userId=" + encodeURIComponent("" + userId) + "&";
830
+ url_ = url_.replace(/[?&]$/, "");
831
+ let options_ = {
832
+ method: "GET",
833
+ url: url_,
834
+ headers: {
835
+ "Accept": "text/plain"
836
+ },
837
+ cancelToken
838
+ };
839
+ return this.transformOptions(options_).then(transformedOptions_ => {
840
+ return this.instance.request(transformedOptions_);
841
+ }).catch((_error) => {
842
+ if (isAxiosError(_error) && _error.response) {
843
+ return _error.response;
844
+ }
845
+ else {
846
+ throw _error;
847
+ }
848
+ }).then((_response) => {
849
+ return this.transformResult(url_, _response, (_response) => this.processGetConfiguration(_response));
850
+ });
851
+ }
852
+ processGetConfiguration(response) {
853
+ const status = response.status;
854
+ let _headers = {};
855
+ if (response.headers && typeof response.headers === "object") {
856
+ for (let k in response.headers) {
857
+ if (response.headers.hasOwnProperty(k)) {
858
+ _headers[k] = response.headers[k];
859
+ }
860
+ }
861
+ }
862
+ if (status === 200) {
863
+ const _responseText = response.data;
864
+ let result200 = null;
865
+ let resultData200 = _responseText;
866
+ result200 = JSON.parse(resultData200);
867
+ return result200;
868
+ }
869
+ else if (status === 404) {
870
+ const _responseText = response.data;
871
+ let result404 = null;
872
+ let resultData404 = _responseText;
873
+ result404 = JSON.parse(resultData404);
874
+ return throwException("Not Found", status, _responseText, _headers, result404);
875
+ }
876
+ else if (status === 401) {
877
+ const _responseText = response.data;
878
+ return throwException("Unauthorized", status, _responseText, _headers);
879
+ }
880
+ else if (status === 403) {
881
+ const _responseText = response.data;
882
+ return throwException("Forbidden", status, _responseText, _headers);
883
+ }
884
+ else if (status !== 200 && status !== 204) {
885
+ const _responseText = response.data;
886
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
887
+ }
888
+ return Promise.resolve(null);
889
+ }
890
+ }
891
+ export class ProjectsApiClient extends ApiClientBase {
892
+ instance;
893
+ baseUrl;
894
+ jsonParseReviver = undefined;
895
+ constructor(configuration, baseUrl, instance) {
896
+ super(configuration);
897
+ this.instance = instance ? instance : axios.create();
898
+ this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : this.getBaseUrl("");
899
+ }
900
+ /**
901
+ * Gets all projects relevant to specified query parameters
902
+ * @param storefrontId Storefront identifier
903
+ * @param status (optional) Project status filter
904
+ * @param datePeriod (optional) Project date period filter
905
+ * @param skip (optional) Defines page start offset from beginning of sorted result list
906
+ * @param take (optional) Defines page length (how much consequent items of sorted result list should be taken)
907
+ * @param sorting (optional) Defines sorting order of result list e.g.: "Title ASC, LastModified DESC"
908
+ * @param search (optional) Search string for partial match
909
+ * @param tenantId (optional) Tenant identifier
910
+ * @param userId (optional) User identifier
911
+ * @return Success
912
+ */
913
+ getAll(storefrontId, status, datePeriod, skip, take, sorting, search, tenantId, userId, cancelToken) {
914
+ let url_ = this.baseUrl + "/api/storefront/v1/projects?";
915
+ if (storefrontId === undefined || storefrontId === null)
916
+ throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
917
+ else
918
+ url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
919
+ if (status !== undefined && status !== null)
920
+ url_ += "status=" + encodeURIComponent("" + status) + "&";
921
+ if (datePeriod === null)
922
+ throw new Error("The parameter 'datePeriod' cannot be null.");
923
+ else if (datePeriod !== undefined)
924
+ url_ += "datePeriod=" + encodeURIComponent("" + datePeriod) + "&";
925
+ if (skip !== undefined && skip !== null)
926
+ url_ += "skip=" + encodeURIComponent("" + skip) + "&";
927
+ if (take !== undefined && take !== null)
928
+ url_ += "take=" + encodeURIComponent("" + take) + "&";
929
+ if (sorting !== undefined && sorting !== null)
930
+ url_ += "sorting=" + encodeURIComponent("" + sorting) + "&";
931
+ if (search !== undefined && search !== null)
932
+ url_ += "search=" + encodeURIComponent("" + search) + "&";
933
+ if (tenantId !== undefined && tenantId !== null)
934
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
935
+ if (userId !== undefined && userId !== null)
936
+ url_ += "userId=" + encodeURIComponent("" + userId) + "&";
937
+ url_ = url_.replace(/[?&]$/, "");
938
+ let options_ = {
939
+ method: "GET",
940
+ url: url_,
941
+ headers: {
942
+ "Accept": "text/plain"
943
+ },
944
+ cancelToken
945
+ };
946
+ return this.transformOptions(options_).then(transformedOptions_ => {
947
+ return this.instance.request(transformedOptions_);
948
+ }).catch((_error) => {
949
+ if (isAxiosError(_error) && _error.response) {
950
+ return _error.response;
951
+ }
952
+ else {
953
+ throw _error;
954
+ }
955
+ }).then((_response) => {
956
+ return this.transformResult(url_, _response, (_response) => this.processGetAll(_response));
957
+ });
958
+ }
959
+ processGetAll(response) {
960
+ const status = response.status;
961
+ let _headers = {};
962
+ if (response.headers && typeof response.headers === "object") {
963
+ for (let k in response.headers) {
964
+ if (response.headers.hasOwnProperty(k)) {
965
+ _headers[k] = response.headers[k];
966
+ }
967
+ }
968
+ }
969
+ if (status === 200) {
970
+ const _responseText = response.data;
971
+ let result200 = null;
972
+ let resultData200 = _responseText;
973
+ result200 = JSON.parse(resultData200);
974
+ return result200;
975
+ }
976
+ else if (status === 401) {
977
+ const _responseText = response.data;
978
+ return throwException("Unauthorized", status, _responseText, _headers);
979
+ }
980
+ else if (status === 403) {
981
+ const _responseText = response.data;
982
+ return throwException("Forbidden", status, _responseText, _headers);
983
+ }
984
+ else if (status !== 200 && status !== 204) {
985
+ const _responseText = response.data;
986
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
987
+ }
988
+ return Promise.resolve(null);
989
+ }
990
+ /**
991
+ * Creates new project
992
+ * @param storefrontId Storefront identifier
993
+ * @param tenantId (optional) Tenant identifier
994
+ * @param userId (optional) User identifier
995
+ * @param body (optional) Create operation parameters
996
+ * @return Success
997
+ */
998
+ create(storefrontId, tenantId, userId, body, cancelToken) {
999
+ let url_ = this.baseUrl + "/api/storefront/v1/projects?";
1000
+ if (storefrontId === undefined || storefrontId === null)
1001
+ throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
1002
+ else
1003
+ url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
1004
+ if (tenantId !== undefined && tenantId !== null)
1005
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
1006
+ if (userId !== undefined && userId !== null)
1007
+ url_ += "userId=" + encodeURIComponent("" + userId) + "&";
1008
+ url_ = url_.replace(/[?&]$/, "");
1009
+ const content_ = JSON.stringify(body);
1010
+ let options_ = {
1011
+ data: content_,
1012
+ method: "POST",
1013
+ url: url_,
1014
+ headers: {
1015
+ "Content-Type": "application/json-patch+json",
1016
+ "Accept": "text/plain"
1017
+ },
1018
+ cancelToken
1019
+ };
1020
+ return this.transformOptions(options_).then(transformedOptions_ => {
1021
+ return this.instance.request(transformedOptions_);
1022
+ }).catch((_error) => {
1023
+ if (isAxiosError(_error) && _error.response) {
1024
+ return _error.response;
1025
+ }
1026
+ else {
1027
+ throw _error;
1028
+ }
1029
+ }).then((_response) => {
1030
+ return this.transformResult(url_, _response, (_response) => this.processCreate(_response));
1031
+ });
1032
+ }
1033
+ processCreate(response) {
1034
+ const status = response.status;
1035
+ let _headers = {};
1036
+ if (response.headers && typeof response.headers === "object") {
1037
+ for (let k in response.headers) {
1038
+ if (response.headers.hasOwnProperty(k)) {
1039
+ _headers[k] = response.headers[k];
1040
+ }
1041
+ }
1042
+ }
1043
+ if (status === 201) {
1044
+ const _responseText = response.data;
1045
+ let result201 = null;
1046
+ let resultData201 = _responseText;
1047
+ result201 = JSON.parse(resultData201);
1048
+ return result201;
1049
+ }
1050
+ else if (status === 409) {
1051
+ const _responseText = response.data;
1052
+ let result409 = null;
1053
+ let resultData409 = _responseText;
1054
+ result409 = JSON.parse(resultData409);
1055
+ return throwException("Conflict", status, _responseText, _headers, result409);
1056
+ }
1057
+ else if (status === 401) {
1058
+ const _responseText = response.data;
1059
+ return throwException("Unauthorized", status, _responseText, _headers);
1060
+ }
1061
+ else if (status === 403) {
1062
+ const _responseText = response.data;
1063
+ return throwException("Forbidden", status, _responseText, _headers);
1064
+ }
1065
+ else if (status !== 200 && status !== 204) {
1066
+ const _responseText = response.data;
1067
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
1068
+ }
1069
+ return Promise.resolve(null);
1070
+ }
1071
+ /**
1072
+ * Gets project by id
1073
+ * @param id Project identifier
1074
+ * @param tenantId (optional) Tenant identifier
1075
+ * @param userId (optional) User identifier
1076
+ * @return Success
1077
+ */
1078
+ get(id, tenantId, userId, cancelToken) {
1079
+ let url_ = this.baseUrl + "/api/storefront/v1/projects/{id}?";
1080
+ if (id === undefined || id === null)
1081
+ throw new Error("The parameter 'id' must be defined.");
1082
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
1083
+ if (tenantId !== undefined && tenantId !== null)
1084
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
1085
+ if (userId !== undefined && userId !== null)
1086
+ url_ += "userId=" + encodeURIComponent("" + userId) + "&";
1087
+ url_ = url_.replace(/[?&]$/, "");
1088
+ let options_ = {
1089
+ method: "GET",
1090
+ url: url_,
1091
+ headers: {
1092
+ "Accept": "text/plain"
1093
+ },
1094
+ cancelToken
1095
+ };
1096
+ return this.transformOptions(options_).then(transformedOptions_ => {
1097
+ return this.instance.request(transformedOptions_);
1098
+ }).catch((_error) => {
1099
+ if (isAxiosError(_error) && _error.response) {
1100
+ return _error.response;
1101
+ }
1102
+ else {
1103
+ throw _error;
1104
+ }
1105
+ }).then((_response) => {
1106
+ return this.transformResult(url_, _response, (_response) => this.processGet(_response));
1107
+ });
1108
+ }
1109
+ processGet(response) {
1110
+ const status = response.status;
1111
+ let _headers = {};
1112
+ if (response.headers && typeof response.headers === "object") {
1113
+ for (let k in response.headers) {
1114
+ if (response.headers.hasOwnProperty(k)) {
1115
+ _headers[k] = response.headers[k];
1116
+ }
1117
+ }
1118
+ }
1119
+ if (status === 200) {
1120
+ const _responseText = response.data;
1121
+ let result200 = null;
1122
+ let resultData200 = _responseText;
1123
+ result200 = JSON.parse(resultData200);
1124
+ return result200;
1125
+ }
1126
+ else if (status === 404) {
1127
+ const _responseText = response.data;
1128
+ let result404 = null;
1129
+ let resultData404 = _responseText;
1130
+ result404 = JSON.parse(resultData404);
1131
+ return throwException("Not Found", status, _responseText, _headers, result404);
1132
+ }
1133
+ else if (status === 401) {
1134
+ const _responseText = response.data;
1135
+ return throwException("Unauthorized", status, _responseText, _headers);
1136
+ }
1137
+ else if (status === 403) {
1138
+ const _responseText = response.data;
1139
+ return throwException("Forbidden", status, _responseText, _headers);
1140
+ }
1141
+ else if (status !== 200 && status !== 204) {
1142
+ const _responseText = response.data;
1143
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
1144
+ }
1145
+ return Promise.resolve(null);
1146
+ }
1147
+ /**
1148
+ * Gets available project transitions
1149
+ * @param id Project identifier
1150
+ * @param tenantId (optional) Tenant identifier
1151
+ * @param userId (optional) User identifier
1152
+ * @return Success
1153
+ */
1154
+ getAvailableTransitions(id, tenantId, userId, cancelToken) {
1155
+ let url_ = this.baseUrl + "/api/storefront/v1/projects/{id}/transitions?";
1156
+ if (id === undefined || id === null)
1157
+ throw new Error("The parameter 'id' must be defined.");
1158
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
1159
+ if (tenantId !== undefined && tenantId !== null)
1160
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
1161
+ if (userId !== undefined && userId !== null)
1162
+ url_ += "userId=" + encodeURIComponent("" + userId) + "&";
1163
+ url_ = url_.replace(/[?&]$/, "");
1164
+ let options_ = {
1165
+ method: "GET",
1166
+ url: url_,
1167
+ headers: {
1168
+ "Accept": "text/plain"
1169
+ },
1170
+ cancelToken
1171
+ };
1172
+ return this.transformOptions(options_).then(transformedOptions_ => {
1173
+ return this.instance.request(transformedOptions_);
1174
+ }).catch((_error) => {
1175
+ if (isAxiosError(_error) && _error.response) {
1176
+ return _error.response;
1177
+ }
1178
+ else {
1179
+ throw _error;
1180
+ }
1181
+ }).then((_response) => {
1182
+ return this.transformResult(url_, _response, (_response) => this.processGetAvailableTransitions(_response));
1183
+ });
1184
+ }
1185
+ processGetAvailableTransitions(response) {
1186
+ const status = response.status;
1187
+ let _headers = {};
1188
+ if (response.headers && typeof response.headers === "object") {
1189
+ for (let k in response.headers) {
1190
+ if (response.headers.hasOwnProperty(k)) {
1191
+ _headers[k] = response.headers[k];
1192
+ }
1193
+ }
1194
+ }
1195
+ if (status === 200) {
1196
+ const _responseText = response.data;
1197
+ let result200 = null;
1198
+ let resultData200 = _responseText;
1199
+ result200 = JSON.parse(resultData200);
1200
+ return result200;
1201
+ }
1202
+ else if (status === 400) {
1203
+ const _responseText = response.data;
1204
+ let result400 = null;
1205
+ let resultData400 = _responseText;
1206
+ result400 = JSON.parse(resultData400);
1207
+ return throwException("Bad Request", status, _responseText, _headers, result400);
1208
+ }
1209
+ else if (status === 404) {
1210
+ const _responseText = response.data;
1211
+ let result404 = null;
1212
+ let resultData404 = _responseText;
1213
+ result404 = JSON.parse(resultData404);
1214
+ return throwException("Not Found", status, _responseText, _headers, result404);
1215
+ }
1216
+ else if (status === 409) {
1217
+ const _responseText = response.data;
1218
+ let result409 = null;
1219
+ let resultData409 = _responseText;
1220
+ result409 = JSON.parse(resultData409);
1221
+ return throwException("Conflict", status, _responseText, _headers, result409);
1222
+ }
1223
+ else if (status === 401) {
1224
+ const _responseText = response.data;
1225
+ return throwException("Unauthorized", status, _responseText, _headers);
1226
+ }
1227
+ else if (status === 403) {
1228
+ const _responseText = response.data;
1229
+ return throwException("Forbidden", status, _responseText, _headers);
1230
+ }
1231
+ else if (status !== 200 && status !== 204) {
1232
+ const _responseText = response.data;
1233
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
1234
+ }
1235
+ return Promise.resolve(null);
1236
+ }
1237
+ /**
1238
+ * Changes project status
1239
+ * @param id Project identifier
1240
+ * @param transition Transition identifying name
1241
+ * @param tenantId (optional) Tenant identifier
1242
+ * @param userId (optional) User identifier
1243
+ * @return Success
1244
+ */
1245
+ changeStatus(id, transition, tenantId, userId, cancelToken) {
1246
+ let url_ = this.baseUrl + "/api/storefront/v1/projects/{id}/transitions/{transition}?";
1247
+ if (id === undefined || id === null)
1248
+ throw new Error("The parameter 'id' must be defined.");
1249
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
1250
+ if (transition === undefined || transition === null)
1251
+ throw new Error("The parameter 'transition' must be defined.");
1252
+ url_ = url_.replace("{transition}", encodeURIComponent("" + transition));
1253
+ if (tenantId !== undefined && tenantId !== null)
1254
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
1255
+ if (userId !== undefined && userId !== null)
1256
+ url_ += "userId=" + encodeURIComponent("" + userId) + "&";
1257
+ url_ = url_.replace(/[?&]$/, "");
1258
+ let options_ = {
1259
+ method: "POST",
1260
+ url: url_,
1261
+ headers: {
1262
+ "Accept": "text/plain"
1263
+ },
1264
+ cancelToken
1265
+ };
1266
+ return this.transformOptions(options_).then(transformedOptions_ => {
1267
+ return this.instance.request(transformedOptions_);
1268
+ }).catch((_error) => {
1269
+ if (isAxiosError(_error) && _error.response) {
1270
+ return _error.response;
1271
+ }
1272
+ else {
1273
+ throw _error;
1274
+ }
1275
+ }).then((_response) => {
1276
+ return this.transformResult(url_, _response, (_response) => this.processChangeStatus(_response));
1277
+ });
1278
+ }
1279
+ processChangeStatus(response) {
1280
+ const status = response.status;
1281
+ let _headers = {};
1282
+ if (response.headers && typeof response.headers === "object") {
1283
+ for (let k in response.headers) {
1284
+ if (response.headers.hasOwnProperty(k)) {
1285
+ _headers[k] = response.headers[k];
1286
+ }
1287
+ }
1288
+ }
1289
+ if (status === 200) {
1290
+ const _responseText = response.data;
1291
+ let result200 = null;
1292
+ let resultData200 = _responseText;
1293
+ result200 = JSON.parse(resultData200);
1294
+ return result200;
1295
+ }
1296
+ else if (status === 400) {
1297
+ const _responseText = response.data;
1298
+ let result400 = null;
1299
+ let resultData400 = _responseText;
1300
+ result400 = JSON.parse(resultData400);
1301
+ return throwException("Bad Request", status, _responseText, _headers, result400);
1302
+ }
1303
+ else if (status === 404) {
1304
+ const _responseText = response.data;
1305
+ let result404 = null;
1306
+ let resultData404 = _responseText;
1307
+ result404 = JSON.parse(resultData404);
1308
+ return throwException("Not Found", status, _responseText, _headers, result404);
1309
+ }
1310
+ else if (status === 409) {
1311
+ const _responseText = response.data;
1312
+ let result409 = null;
1313
+ let resultData409 = _responseText;
1314
+ result409 = JSON.parse(resultData409);
1315
+ return throwException("Conflict", status, _responseText, _headers, result409);
1316
+ }
1317
+ else if (status === 401) {
1318
+ const _responseText = response.data;
1319
+ return throwException("Unauthorized", status, _responseText, _headers);
1320
+ }
1321
+ else if (status === 403) {
1322
+ const _responseText = response.data;
1323
+ return throwException("Forbidden", status, _responseText, _headers);
1324
+ }
1325
+ else if (status !== 200 && status !== 204) {
1326
+ const _responseText = response.data;
1327
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
1328
+ }
1329
+ return Promise.resolve(null);
1330
+ }
1331
+ /**
1332
+ * Force changes project status
1333
+ * @param id Project identifier
1334
+ * @param status Project status code
1335
+ * @param tenantId (optional) Tenant identifier
1336
+ * @param userId (optional) User identifier
1337
+ * @return Success
1338
+ */
1339
+ forceStatus(id, status, tenantId, userId, cancelToken) {
1340
+ let url_ = this.baseUrl + "/api/storefront/v1/projects/{id}/statuses/{status}?";
1341
+ if (id === undefined || id === null)
1342
+ throw new Error("The parameter 'id' must be defined.");
1343
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
1344
+ if (status === undefined || status === null)
1345
+ throw new Error("The parameter 'status' must be defined.");
1346
+ url_ = url_.replace("{status}", encodeURIComponent("" + status));
1347
+ if (tenantId !== undefined && tenantId !== null)
1348
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
1349
+ if (userId !== undefined && userId !== null)
1350
+ url_ += "userId=" + encodeURIComponent("" + userId) + "&";
1351
+ url_ = url_.replace(/[?&]$/, "");
1352
+ let options_ = {
1353
+ method: "POST",
1354
+ url: url_,
1355
+ headers: {
1356
+ "Accept": "text/plain"
1357
+ },
1358
+ cancelToken
1359
+ };
1360
+ return this.transformOptions(options_).then(transformedOptions_ => {
1361
+ return this.instance.request(transformedOptions_);
1362
+ }).catch((_error) => {
1363
+ if (isAxiosError(_error) && _error.response) {
1364
+ return _error.response;
1365
+ }
1366
+ else {
1367
+ throw _error;
1368
+ }
1369
+ }).then((_response) => {
1370
+ return this.transformResult(url_, _response, (_response) => this.processForceStatus(_response));
1371
+ });
1372
+ }
1373
+ processForceStatus(response) {
1374
+ const status = response.status;
1375
+ let _headers = {};
1376
+ if (response.headers && typeof response.headers === "object") {
1377
+ for (let k in response.headers) {
1378
+ if (response.headers.hasOwnProperty(k)) {
1379
+ _headers[k] = response.headers[k];
1380
+ }
1381
+ }
1382
+ }
1383
+ if (status === 200) {
1384
+ const _responseText = response.data;
1385
+ let result200 = null;
1386
+ let resultData200 = _responseText;
1387
+ result200 = JSON.parse(resultData200);
1388
+ return result200;
1389
+ }
1390
+ else if (status === 400) {
1391
+ const _responseText = response.data;
1392
+ let result400 = null;
1393
+ let resultData400 = _responseText;
1394
+ result400 = JSON.parse(resultData400);
1395
+ return throwException("Bad Request", status, _responseText, _headers, result400);
1396
+ }
1397
+ else if (status === 404) {
1398
+ const _responseText = response.data;
1399
+ let result404 = null;
1400
+ let resultData404 = _responseText;
1401
+ result404 = JSON.parse(resultData404);
1402
+ return throwException("Not Found", status, _responseText, _headers, result404);
1403
+ }
1404
+ else if (status === 401) {
1405
+ const _responseText = response.data;
1406
+ return throwException("Unauthorized", status, _responseText, _headers);
1407
+ }
1408
+ else if (status === 403) {
1409
+ const _responseText = response.data;
1410
+ return throwException("Forbidden", status, _responseText, _headers);
1411
+ }
1412
+ else if (status !== 200 && status !== 204) {
1413
+ const _responseText = response.data;
1414
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
1415
+ }
1416
+ return Promise.resolve(null);
1417
+ }
1418
+ /**
1419
+ * Gets all project statuses
1420
+ * @param tenantId (optional) Tenant identifier
1421
+ * @param userId (optional) User identifier
1422
+ * @return Success
1423
+ */
1424
+ getAllStatuses(tenantId, userId, cancelToken) {
1425
+ let url_ = this.baseUrl + "/api/storefront/v1/projects/statuses?";
1426
+ if (tenantId !== undefined && tenantId !== null)
1427
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
1428
+ if (userId !== undefined && userId !== null)
1429
+ url_ += "userId=" + encodeURIComponent("" + userId) + "&";
1430
+ url_ = url_.replace(/[?&]$/, "");
1431
+ let options_ = {
1432
+ method: "GET",
1433
+ url: url_,
1434
+ headers: {
1435
+ "Accept": "text/plain"
1436
+ },
1437
+ cancelToken
1438
+ };
1439
+ return this.transformOptions(options_).then(transformedOptions_ => {
1440
+ return this.instance.request(transformedOptions_);
1441
+ }).catch((_error) => {
1442
+ if (isAxiosError(_error) && _error.response) {
1443
+ return _error.response;
1444
+ }
1445
+ else {
1446
+ throw _error;
1447
+ }
1448
+ }).then((_response) => {
1449
+ return this.transformResult(url_, _response, (_response) => this.processGetAllStatuses(_response));
1450
+ });
1451
+ }
1452
+ processGetAllStatuses(response) {
1453
+ const status = response.status;
1454
+ let _headers = {};
1455
+ if (response.headers && typeof response.headers === "object") {
1456
+ for (let k in response.headers) {
1457
+ if (response.headers.hasOwnProperty(k)) {
1458
+ _headers[k] = response.headers[k];
1459
+ }
1460
+ }
1461
+ }
1462
+ if (status === 200) {
1463
+ const _responseText = response.data;
1464
+ let result200 = null;
1465
+ let resultData200 = _responseText;
1466
+ result200 = JSON.parse(resultData200);
1467
+ return result200;
1468
+ }
1469
+ else if (status === 401) {
1470
+ const _responseText = response.data;
1471
+ return throwException("Unauthorized", status, _responseText, _headers);
1472
+ }
1473
+ else if (status === 403) {
1474
+ const _responseText = response.data;
1475
+ return throwException("Forbidden", status, _responseText, _headers);
1476
+ }
1477
+ else if (status !== 200 && status !== 204) {
1478
+ const _responseText = response.data;
1479
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
1480
+ }
1481
+ return Promise.resolve(null);
1482
+ }
1483
+ /**
1484
+ * Gets all project transitions
1485
+ * @param tenantId (optional) Tenant identifier
1486
+ * @param userId (optional) User identifier
1487
+ * @return Success
1488
+ */
1489
+ getAllTransitions(tenantId, userId, cancelToken) {
1490
+ let url_ = this.baseUrl + "/api/storefront/v1/projects/transitions?";
1491
+ if (tenantId !== undefined && tenantId !== null)
1492
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
1493
+ if (userId !== undefined && userId !== null)
1494
+ url_ += "userId=" + encodeURIComponent("" + userId) + "&";
1495
+ url_ = url_.replace(/[?&]$/, "");
1496
+ let options_ = {
1497
+ method: "GET",
1498
+ url: url_,
1499
+ headers: {
1500
+ "Accept": "text/plain"
1501
+ },
1502
+ cancelToken
1503
+ };
1504
+ return this.transformOptions(options_).then(transformedOptions_ => {
1505
+ return this.instance.request(transformedOptions_);
1506
+ }).catch((_error) => {
1507
+ if (isAxiosError(_error) && _error.response) {
1508
+ return _error.response;
1509
+ }
1510
+ else {
1511
+ throw _error;
1512
+ }
1513
+ }).then((_response) => {
1514
+ return this.transformResult(url_, _response, (_response) => this.processGetAllTransitions(_response));
1515
+ });
1516
+ }
1517
+ processGetAllTransitions(response) {
1518
+ const status = response.status;
1519
+ let _headers = {};
1520
+ if (response.headers && typeof response.headers === "object") {
1521
+ for (let k in response.headers) {
1522
+ if (response.headers.hasOwnProperty(k)) {
1523
+ _headers[k] = response.headers[k];
1524
+ }
1525
+ }
1526
+ }
1527
+ if (status === 200) {
1528
+ const _responseText = response.data;
1529
+ let result200 = null;
1530
+ let resultData200 = _responseText;
1531
+ result200 = JSON.parse(resultData200);
1532
+ return result200;
1533
+ }
1534
+ else if (status === 401) {
1535
+ const _responseText = response.data;
1536
+ return throwException("Unauthorized", status, _responseText, _headers);
1537
+ }
1538
+ else if (status === 403) {
1539
+ const _responseText = response.data;
1540
+ return throwException("Forbidden", status, _responseText, _headers);
1541
+ }
1542
+ else if (status !== 200 && status !== 204) {
1543
+ const _responseText = response.data;
1544
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
1545
+ }
1546
+ return Promise.resolve(null);
1547
+ }
1548
+ /**
1549
+ * Gets project pdf url
1550
+ * @param id Project unique identifier
1551
+ * @param designUserId User identifier
1552
+ * @param designId Design identifier
1553
+ * @param tenantId (optional) Tenant identifier
1554
+ * @param userId (optional) User identifier
1555
+ * @return Success
1556
+ */
1557
+ getProjectPdfUrl(id, designUserId, designId, tenantId, userId, cancelToken) {
1558
+ let url_ = this.baseUrl + "/api/storefront/v1/projects/{id}/project-pdf?";
1559
+ if (id === undefined || id === null)
1560
+ throw new Error("The parameter 'id' must be defined.");
1561
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
1562
+ if (designUserId === undefined || designUserId === null)
1563
+ throw new Error("The parameter 'designUserId' must be defined and cannot be null.");
1564
+ else
1565
+ url_ += "designUserId=" + encodeURIComponent("" + designUserId) + "&";
1566
+ if (designId === undefined || designId === null)
1567
+ throw new Error("The parameter 'designId' must be defined and cannot be null.");
1568
+ else
1569
+ url_ += "designId=" + encodeURIComponent("" + designId) + "&";
1570
+ if (tenantId !== undefined && tenantId !== null)
1571
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
1572
+ if (userId !== undefined && userId !== null)
1573
+ url_ += "userId=" + encodeURIComponent("" + userId) + "&";
1574
+ url_ = url_.replace(/[?&]$/, "");
1575
+ let options_ = {
1576
+ method: "GET",
1577
+ url: url_,
1578
+ headers: {
1579
+ "Accept": "text/plain"
1580
+ },
1581
+ cancelToken
1582
+ };
1583
+ return this.transformOptions(options_).then(transformedOptions_ => {
1584
+ return this.instance.request(transformedOptions_);
1585
+ }).catch((_error) => {
1586
+ if (isAxiosError(_error) && _error.response) {
1587
+ return _error.response;
1588
+ }
1589
+ else {
1590
+ throw _error;
1591
+ }
1592
+ }).then((_response) => {
1593
+ return this.transformResult(url_, _response, (_response) => this.processGetProjectPdfUrl(_response));
1594
+ });
1595
+ }
1596
+ processGetProjectPdfUrl(response) {
1597
+ const status = response.status;
1598
+ let _headers = {};
1599
+ if (response.headers && typeof response.headers === "object") {
1600
+ for (let k in response.headers) {
1601
+ if (response.headers.hasOwnProperty(k)) {
1602
+ _headers[k] = response.headers[k];
1603
+ }
1604
+ }
1605
+ }
1606
+ if (status === 200) {
1607
+ const _responseText = response.data;
1608
+ let result200 = null;
1609
+ let resultData200 = _responseText;
1610
+ result200 = JSON.parse(resultData200);
1611
+ return result200;
1612
+ }
1613
+ else if (status === 401) {
1614
+ const _responseText = response.data;
1615
+ return throwException("Unauthorized", status, _responseText, _headers);
1616
+ }
1617
+ else if (status === 403) {
1618
+ const _responseText = response.data;
1619
+ return throwException("Forbidden", status, _responseText, _headers);
1620
+ }
1621
+ else if (status !== 200 && status !== 204) {
1622
+ const _responseText = response.data;
1623
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
1624
+ }
1625
+ return Promise.resolve(null);
1626
+ }
1627
+ /**
1628
+ * Gets project pdf files in zip archive
1629
+ * @param id Project unique identifier
1630
+ * @param designUserId User identifier
1631
+ * @param designId Design identifier
1632
+ * @param attachment (optional) If set to 'true', file will be provided as an attachment with proper filename supplied (default value is 'false')
1633
+ * @param tenantId (optional) Tenant identifier
1634
+ * @param userId (optional) User identifier
1635
+ * @return Success
1636
+ */
1637
+ getProjectPdfZip(id, designUserId, designId, attachment, tenantId, userId, cancelToken) {
1638
+ let url_ = this.baseUrl + "/api/storefront/v1/projects/{id}/project-pdf-zip?";
1639
+ if (id === undefined || id === null)
1640
+ throw new Error("The parameter 'id' must be defined.");
1641
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
1642
+ if (designUserId === undefined || designUserId === null)
1643
+ throw new Error("The parameter 'designUserId' must be defined and cannot be null.");
1644
+ else
1645
+ url_ += "designUserId=" + encodeURIComponent("" + designUserId) + "&";
1646
+ if (designId === undefined || designId === null)
1647
+ throw new Error("The parameter 'designId' must be defined and cannot be null.");
1648
+ else
1649
+ url_ += "designId=" + encodeURIComponent("" + designId) + "&";
1650
+ if (attachment !== undefined && attachment !== null)
1651
+ url_ += "attachment=" + encodeURIComponent("" + attachment) + "&";
1652
+ if (tenantId !== undefined && tenantId !== null)
1653
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
1654
+ if (userId !== undefined && userId !== null)
1655
+ url_ += "userId=" + encodeURIComponent("" + userId) + "&";
1656
+ url_ = url_.replace(/[?&]$/, "");
1657
+ let options_ = {
1658
+ responseType: "blob",
1659
+ method: "GET",
1660
+ url: url_,
1661
+ headers: {
1662
+ "Accept": "application/octet-stream"
1663
+ },
1664
+ cancelToken
1665
+ };
1666
+ return this.transformOptions(options_).then(transformedOptions_ => {
1667
+ return this.instance.request(transformedOptions_);
1668
+ }).catch((_error) => {
1669
+ if (isAxiosError(_error) && _error.response) {
1670
+ return _error.response;
1671
+ }
1672
+ else {
1673
+ throw _error;
1674
+ }
1675
+ }).then((_response) => {
1676
+ return this.transformResult(url_, _response, (_response) => this.processGetProjectPdfZip(_response));
1677
+ });
1678
+ }
1679
+ processGetProjectPdfZip(response) {
1680
+ const status = response.status;
1681
+ let _headers = {};
1682
+ if (response.headers && typeof response.headers === "object") {
1683
+ for (let k in response.headers) {
1684
+ if (response.headers.hasOwnProperty(k)) {
1685
+ _headers[k] = response.headers[k];
1686
+ }
1687
+ }
1688
+ }
1689
+ if (status === 200 || status === 206) {
1690
+ const contentDisposition = response.headers ? response.headers["content-disposition"] : undefined;
1691
+ const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
1692
+ const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
1693
+ return Promise.resolve({ fileName: fileName, status: status, data: response.data, headers: _headers });
1694
+ }
1695
+ else if (status === 404) {
1696
+ const _responseText = response.data;
1697
+ let result404 = null;
1698
+ let resultData404 = _responseText;
1699
+ result404 = JSON.parse(resultData404);
1700
+ return throwException("Not Found", status, _responseText, _headers, result404);
1701
+ }
1702
+ else if (status === 401) {
1703
+ const _responseText = response.data;
1704
+ return throwException("Unauthorized", status, _responseText, _headers);
1705
+ }
1706
+ else if (status === 403) {
1707
+ const _responseText = response.data;
1708
+ return throwException("Forbidden", status, _responseText, _headers);
1709
+ }
1710
+ else if (status !== 200 && status !== 204) {
1711
+ const _responseText = response.data;
1712
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
1713
+ }
1714
+ return Promise.resolve(null);
1715
+ }
1716
+ /**
1717
+ * Gets project order data from ecommerce system
1718
+ * @param id Project identifier
1719
+ * @return Success
1720
+ */
1721
+ getProjectOrder(id, cancelToken) {
1722
+ let url_ = this.baseUrl + "/api/storefront/v1/projects/{id}/order";
1723
+ if (id === undefined || id === null)
1724
+ throw new Error("The parameter 'id' must be defined.");
1725
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
1726
+ url_ = url_.replace(/[?&]$/, "");
1727
+ let options_ = {
1728
+ method: "GET",
1729
+ url: url_,
1730
+ headers: {
1731
+ "Accept": "application/json"
1732
+ },
1733
+ cancelToken
1734
+ };
1735
+ return this.transformOptions(options_).then(transformedOptions_ => {
1736
+ return this.instance.request(transformedOptions_);
1737
+ }).catch((_error) => {
1738
+ if (isAxiosError(_error) && _error.response) {
1739
+ return _error.response;
1740
+ }
1741
+ else {
1742
+ throw _error;
1743
+ }
1744
+ }).then((_response) => {
1745
+ return this.transformResult(url_, _response, (_response) => this.processGetProjectOrder(_response));
1746
+ });
1747
+ }
1748
+ processGetProjectOrder(response) {
1749
+ const status = response.status;
1750
+ let _headers = {};
1751
+ if (response.headers && typeof response.headers === "object") {
1752
+ for (let k in response.headers) {
1753
+ if (response.headers.hasOwnProperty(k)) {
1754
+ _headers[k] = response.headers[k];
1755
+ }
1756
+ }
1757
+ }
1758
+ if (status === 200) {
1759
+ const _responseText = response.data;
1760
+ let result200 = null;
1761
+ let resultData200 = _responseText;
1762
+ result200 = JSON.parse(resultData200);
1763
+ return result200;
1764
+ }
1765
+ else if (status === 404) {
1766
+ const _responseText = response.data;
1767
+ let result404 = null;
1768
+ let resultData404 = _responseText;
1769
+ result404 = JSON.parse(resultData404);
1770
+ return throwException("Not Found", status, _responseText, _headers, result404);
1771
+ }
1772
+ else if (status === 401) {
1773
+ const _responseText = response.data;
1774
+ return throwException("Unauthorized", status, _responseText, _headers);
1775
+ }
1776
+ else if (status === 403) {
1777
+ const _responseText = response.data;
1778
+ return throwException("Forbidden", status, _responseText, _headers);
1779
+ }
1780
+ else if (status !== 200 && status !== 204) {
1781
+ const _responseText = response.data;
1782
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
1783
+ }
1784
+ return Promise.resolve(null);
1785
+ }
1786
+ }
1787
+ export class StorefrontsApiClient extends ApiClientBase {
1788
+ instance;
1789
+ baseUrl;
1790
+ jsonParseReviver = undefined;
1791
+ constructor(configuration, baseUrl, instance) {
1792
+ super(configuration);
1793
+ this.instance = instance ? instance : axios.create();
1794
+ this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : this.getBaseUrl("");
1795
+ }
1796
+ /**
1797
+ * Gets all storefronts relevant to specified query parameters
1798
+ * @param types (optional) Storefront type filter
1799
+ * @param skip (optional) Defines page start offset from beginning of sorted result list
1800
+ * @param take (optional) Defines page length (how much consequent items of sorted result list should be taken)
1801
+ * @param sorting (optional) Defines sorting order of result list e.g.: "Title ASC, LastModified DESC"
1802
+ * @param search (optional) Search string for partial match
1803
+ * @param tenantId (optional) Tenant identifier
1804
+ * @param userId (optional) User identifier
1805
+ * @return Success
1806
+ */
1807
+ getAll(types, skip, take, sorting, search, tenantId, userId, cancelToken) {
1808
+ let url_ = this.baseUrl + "/api/storefront/v1/storefronts?";
1809
+ if (types !== undefined && types !== null)
1810
+ types && types.forEach(item => { url_ += "types=" + encodeURIComponent("" + item) + "&"; });
1811
+ if (skip !== undefined && skip !== null)
1812
+ url_ += "skip=" + encodeURIComponent("" + skip) + "&";
1813
+ if (take !== undefined && take !== null)
1814
+ url_ += "take=" + encodeURIComponent("" + take) + "&";
1815
+ if (sorting !== undefined && sorting !== null)
1816
+ url_ += "sorting=" + encodeURIComponent("" + sorting) + "&";
1817
+ if (search !== undefined && search !== null)
1818
+ url_ += "search=" + encodeURIComponent("" + search) + "&";
1819
+ if (tenantId !== undefined && tenantId !== null)
1820
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
1821
+ if (userId !== undefined && userId !== null)
1822
+ url_ += "userId=" + encodeURIComponent("" + userId) + "&";
1823
+ url_ = url_.replace(/[?&]$/, "");
1824
+ let options_ = {
1825
+ method: "GET",
1826
+ url: url_,
1827
+ headers: {
1828
+ "Accept": "text/plain"
1829
+ },
1830
+ cancelToken
1831
+ };
1832
+ return this.transformOptions(options_).then(transformedOptions_ => {
1833
+ return this.instance.request(transformedOptions_);
1834
+ }).catch((_error) => {
1835
+ if (isAxiosError(_error) && _error.response) {
1836
+ return _error.response;
1837
+ }
1838
+ else {
1839
+ throw _error;
1840
+ }
1841
+ }).then((_response) => {
1842
+ return this.transformResult(url_, _response, (_response) => this.processGetAll(_response));
1843
+ });
1844
+ }
1845
+ processGetAll(response) {
1846
+ const status = response.status;
1847
+ let _headers = {};
1848
+ if (response.headers && typeof response.headers === "object") {
1849
+ for (let k in response.headers) {
1850
+ if (response.headers.hasOwnProperty(k)) {
1851
+ _headers[k] = response.headers[k];
1852
+ }
1853
+ }
1854
+ }
1855
+ if (status === 200) {
1856
+ const _responseText = response.data;
1857
+ let result200 = null;
1858
+ let resultData200 = _responseText;
1859
+ result200 = JSON.parse(resultData200);
1860
+ return result200;
1861
+ }
1862
+ else if (status === 401) {
1863
+ const _responseText = response.data;
1864
+ return throwException("Unauthorized", status, _responseText, _headers);
1865
+ }
1866
+ else if (status === 403) {
1867
+ const _responseText = response.data;
1868
+ return throwException("Forbidden", status, _responseText, _headers);
1869
+ }
1870
+ else if (status !== 200 && status !== 204) {
1871
+ const _responseText = response.data;
1872
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
1873
+ }
1874
+ return Promise.resolve(null);
1875
+ }
1876
+ /**
1877
+ * Gets storefront
1878
+ * @param id Storefront identifier
1879
+ * @param tenantId (optional) Tenant identifier
1880
+ * @param userId (optional) User identifier
1881
+ * @return Success
1882
+ */
1883
+ get(id, tenantId, userId, cancelToken) {
1884
+ let url_ = this.baseUrl + "/api/storefront/v1/storefronts/{id}?";
1885
+ if (id === undefined || id === null)
1886
+ throw new Error("The parameter 'id' must be defined.");
1887
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
1888
+ if (tenantId !== undefined && tenantId !== null)
1889
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
1890
+ if (userId !== undefined && userId !== null)
1891
+ url_ += "userId=" + encodeURIComponent("" + userId) + "&";
1892
+ url_ = url_.replace(/[?&]$/, "");
1893
+ let options_ = {
1894
+ method: "GET",
1895
+ url: url_,
1896
+ headers: {
1897
+ "Accept": "text/plain"
1898
+ },
1899
+ cancelToken
1900
+ };
1901
+ return this.transformOptions(options_).then(transformedOptions_ => {
1902
+ return this.instance.request(transformedOptions_);
1903
+ }).catch((_error) => {
1904
+ if (isAxiosError(_error) && _error.response) {
1905
+ return _error.response;
1906
+ }
1907
+ else {
1908
+ throw _error;
1909
+ }
1910
+ }).then((_response) => {
1911
+ return this.transformResult(url_, _response, (_response) => this.processGet(_response));
1912
+ });
1913
+ }
1914
+ processGet(response) {
1915
+ const status = response.status;
1916
+ let _headers = {};
1917
+ if (response.headers && typeof response.headers === "object") {
1918
+ for (let k in response.headers) {
1919
+ if (response.headers.hasOwnProperty(k)) {
1920
+ _headers[k] = response.headers[k];
1921
+ }
1922
+ }
1923
+ }
1924
+ if (status === 200) {
1925
+ const _responseText = response.data;
1926
+ let result200 = null;
1927
+ let resultData200 = _responseText;
1928
+ result200 = JSON.parse(resultData200);
1929
+ return result200;
1930
+ }
1931
+ else if (status === 404) {
1932
+ const _responseText = response.data;
1933
+ let result404 = null;
1934
+ let resultData404 = _responseText;
1935
+ result404 = JSON.parse(resultData404);
1936
+ return throwException("Not Found", status, _responseText, _headers, result404);
1937
+ }
1938
+ else if (status === 401) {
1939
+ const _responseText = response.data;
1940
+ return throwException("Unauthorized", status, _responseText, _headers);
1941
+ }
1942
+ else if (status === 403) {
1943
+ const _responseText = response.data;
1944
+ return throwException("Forbidden", status, _responseText, _headers);
1945
+ }
1946
+ else if (status !== 200 && status !== 204) {
1947
+ const _responseText = response.data;
1948
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
1949
+ }
1950
+ return Promise.resolve(null);
1951
+ }
1952
+ }
1953
+ export class StorefrontUsersApiClient extends ApiClientBase {
1954
+ instance;
1955
+ baseUrl;
1956
+ jsonParseReviver = undefined;
1957
+ constructor(configuration, baseUrl, instance) {
1958
+ super(configuration);
1959
+ this.instance = instance ? instance : axios.create();
1960
+ this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : this.getBaseUrl("");
1961
+ }
1962
+ /**
1963
+ * Gets all storefront users relevant to specified query parameters
1964
+ * @param storefrontId Storefront identifier
1965
+ * @param storefrontUserId (optional) Storefront user identifier
1966
+ * @param skip (optional) Defines page start offset from beginning of sorted result list
1967
+ * @param take (optional) Defines page length (how much consequent items of sorted result list should be taken)
1968
+ * @param sorting (optional) Defines sorting order of result list e.g.: "Title ASC, LastModified DESC"
1969
+ * @param search (optional) Search string for partial match
1970
+ * @param tenantId (optional) Tenant identifier
1971
+ * @param userId (optional) User identifier
1972
+ * @return Success
1973
+ */
1974
+ getAll(storefrontId, storefrontUserId, skip, take, sorting, search, tenantId, userId, cancelToken) {
1975
+ let url_ = this.baseUrl + "/api/storefront/v1/storefront-users?";
1976
+ if (storefrontId === undefined || storefrontId === null)
1977
+ throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
1978
+ else
1979
+ url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
1980
+ if (storefrontUserId !== undefined && storefrontUserId !== null)
1981
+ url_ += "storefrontUserId=" + encodeURIComponent("" + storefrontUserId) + "&";
1982
+ if (skip !== undefined && skip !== null)
1983
+ url_ += "skip=" + encodeURIComponent("" + skip) + "&";
1984
+ if (take !== undefined && take !== null)
1985
+ url_ += "take=" + encodeURIComponent("" + take) + "&";
1986
+ if (sorting !== undefined && sorting !== null)
1987
+ url_ += "sorting=" + encodeURIComponent("" + sorting) + "&";
1988
+ if (search !== undefined && search !== null)
1989
+ url_ += "search=" + encodeURIComponent("" + search) + "&";
1990
+ if (tenantId !== undefined && tenantId !== null)
1991
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
1992
+ if (userId !== undefined && userId !== null)
1993
+ url_ += "userId=" + encodeURIComponent("" + userId) + "&";
1994
+ url_ = url_.replace(/[?&]$/, "");
1995
+ let options_ = {
1996
+ method: "GET",
1997
+ url: url_,
1998
+ headers: {
1999
+ "Accept": "text/plain"
2000
+ },
2001
+ cancelToken
2002
+ };
2003
+ return this.transformOptions(options_).then(transformedOptions_ => {
2004
+ return this.instance.request(transformedOptions_);
2005
+ }).catch((_error) => {
2006
+ if (isAxiosError(_error) && _error.response) {
2007
+ return _error.response;
2008
+ }
2009
+ else {
2010
+ throw _error;
2011
+ }
2012
+ }).then((_response) => {
2013
+ return this.transformResult(url_, _response, (_response) => this.processGetAll(_response));
2014
+ });
2015
+ }
2016
+ processGetAll(response) {
2017
+ const status = response.status;
2018
+ let _headers = {};
2019
+ if (response.headers && typeof response.headers === "object") {
2020
+ for (let k in response.headers) {
2021
+ if (response.headers.hasOwnProperty(k)) {
2022
+ _headers[k] = response.headers[k];
2023
+ }
2024
+ }
2025
+ }
2026
+ if (status === 200) {
2027
+ const _responseText = response.data;
2028
+ let result200 = null;
2029
+ let resultData200 = _responseText;
2030
+ result200 = JSON.parse(resultData200);
2031
+ return result200;
2032
+ }
2033
+ else if (status === 401) {
2034
+ const _responseText = response.data;
2035
+ return throwException("Unauthorized", status, _responseText, _headers);
2036
+ }
2037
+ else if (status === 403) {
2038
+ const _responseText = response.data;
2039
+ return throwException("Forbidden", status, _responseText, _headers);
2040
+ }
2041
+ else if (status !== 200 && status !== 204) {
2042
+ const _responseText = response.data;
2043
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
2044
+ }
2045
+ return Promise.resolve(null);
2046
+ }
2047
+ /**
2048
+ * Creates new storefront user
2049
+ * @param storefrontId Storefront identifier
2050
+ * @param tenantId (optional) Tenant identifier
2051
+ * @param userId (optional) User identifier
2052
+ * @param body (optional) Create operation parameters
2053
+ * @return Success
2054
+ */
2055
+ create(storefrontId, tenantId, userId, body, cancelToken) {
2056
+ let url_ = this.baseUrl + "/api/storefront/v1/storefront-users?";
2057
+ if (storefrontId === undefined || storefrontId === null)
2058
+ throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
2059
+ else
2060
+ url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
2061
+ if (tenantId !== undefined && tenantId !== null)
2062
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
2063
+ if (userId !== undefined && userId !== null)
2064
+ url_ += "userId=" + encodeURIComponent("" + userId) + "&";
2065
+ url_ = url_.replace(/[?&]$/, "");
2066
+ const content_ = JSON.stringify(body);
2067
+ let options_ = {
2068
+ data: content_,
2069
+ method: "POST",
2070
+ url: url_,
2071
+ headers: {
2072
+ "Content-Type": "application/json-patch+json",
2073
+ "Accept": "text/plain"
2074
+ },
2075
+ cancelToken
2076
+ };
2077
+ return this.transformOptions(options_).then(transformedOptions_ => {
2078
+ return this.instance.request(transformedOptions_);
2079
+ }).catch((_error) => {
2080
+ if (isAxiosError(_error) && _error.response) {
2081
+ return _error.response;
2082
+ }
2083
+ else {
2084
+ throw _error;
2085
+ }
2086
+ }).then((_response) => {
2087
+ return this.transformResult(url_, _response, (_response) => this.processCreate(_response));
2088
+ });
2089
+ }
2090
+ processCreate(response) {
2091
+ const status = response.status;
2092
+ let _headers = {};
2093
+ if (response.headers && typeof response.headers === "object") {
2094
+ for (let k in response.headers) {
2095
+ if (response.headers.hasOwnProperty(k)) {
2096
+ _headers[k] = response.headers[k];
2097
+ }
2098
+ }
2099
+ }
2100
+ if (status === 201) {
2101
+ const _responseText = response.data;
2102
+ let result201 = null;
2103
+ let resultData201 = _responseText;
2104
+ result201 = JSON.parse(resultData201);
2105
+ return result201;
2106
+ }
2107
+ else if (status === 401) {
2108
+ const _responseText = response.data;
2109
+ return throwException("Unauthorized", status, _responseText, _headers);
2110
+ }
2111
+ else if (status === 403) {
2112
+ const _responseText = response.data;
2113
+ return throwException("Forbidden", status, _responseText, _headers);
2114
+ }
2115
+ else if (status !== 200 && status !== 204) {
2116
+ const _responseText = response.data;
2117
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
2118
+ }
2119
+ return Promise.resolve(null);
2120
+ }
2121
+ /**
2122
+ * Gets storefront user by id
2123
+ * @param id Storefront user identifier
2124
+ * @param storefrontId Storefront identifier
2125
+ * @param tenantId (optional) Tenant identifier
2126
+ * @param userId (optional) User identifier
2127
+ * @return Success
2128
+ */
2129
+ get(id, storefrontId, tenantId, userId, cancelToken) {
2130
+ let url_ = this.baseUrl + "/api/storefront/v1/storefront-users/{id}?";
2131
+ if (id === undefined || id === null)
2132
+ throw new Error("The parameter 'id' must be defined.");
2133
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
2134
+ if (storefrontId === undefined || storefrontId === null)
2135
+ throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
2136
+ else
2137
+ url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
2138
+ if (tenantId !== undefined && tenantId !== null)
2139
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
2140
+ if (userId !== undefined && userId !== null)
2141
+ url_ += "userId=" + encodeURIComponent("" + userId) + "&";
2142
+ url_ = url_.replace(/[?&]$/, "");
2143
+ let options_ = {
2144
+ method: "GET",
2145
+ url: url_,
2146
+ headers: {
2147
+ "Accept": "text/plain"
2148
+ },
2149
+ cancelToken
2150
+ };
2151
+ return this.transformOptions(options_).then(transformedOptions_ => {
2152
+ return this.instance.request(transformedOptions_);
2153
+ }).catch((_error) => {
2154
+ if (isAxiosError(_error) && _error.response) {
2155
+ return _error.response;
2156
+ }
2157
+ else {
2158
+ throw _error;
2159
+ }
2160
+ }).then((_response) => {
2161
+ return this.transformResult(url_, _response, (_response) => this.processGet(_response));
2162
+ });
2163
+ }
2164
+ processGet(response) {
2165
+ const status = response.status;
2166
+ let _headers = {};
2167
+ if (response.headers && typeof response.headers === "object") {
2168
+ for (let k in response.headers) {
2169
+ if (response.headers.hasOwnProperty(k)) {
2170
+ _headers[k] = response.headers[k];
2171
+ }
2172
+ }
2173
+ }
2174
+ if (status === 200) {
2175
+ const _responseText = response.data;
2176
+ let result200 = null;
2177
+ let resultData200 = _responseText;
2178
+ result200 = JSON.parse(resultData200);
2179
+ return result200;
2180
+ }
2181
+ else if (status === 404) {
2182
+ const _responseText = response.data;
2183
+ let result404 = null;
2184
+ let resultData404 = _responseText;
2185
+ result404 = JSON.parse(resultData404);
2186
+ return throwException("Not Found", status, _responseText, _headers, result404);
2187
+ }
2188
+ else if (status === 401) {
2189
+ const _responseText = response.data;
2190
+ return throwException("Unauthorized", status, _responseText, _headers);
2191
+ }
2192
+ else if (status === 403) {
2193
+ const _responseText = response.data;
2194
+ return throwException("Forbidden", status, _responseText, _headers);
2195
+ }
2196
+ else if (status !== 200 && status !== 204) {
2197
+ const _responseText = response.data;
2198
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
2199
+ }
2200
+ return Promise.resolve(null);
2201
+ }
2202
+ /**
2203
+ * Merges anonymous storefront user data to regular storefront user account
2204
+ * @param storefrontId Storefront identifier
2205
+ * @param tenantId (optional) Tenant identifier
2206
+ * @param userId (optional) User identifier
2207
+ * @param body (optional) Merge operation parameters
2208
+ * @return Success
2209
+ */
2210
+ mergeAnonymous(storefrontId, tenantId, userId, body, cancelToken) {
2211
+ let url_ = this.baseUrl + "/api/storefront/v1/storefront-users/merge-anonymous?";
2212
+ if (storefrontId === undefined || storefrontId === null)
2213
+ throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
2214
+ else
2215
+ url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
2216
+ if (tenantId !== undefined && tenantId !== null)
2217
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
2218
+ if (userId !== undefined && userId !== null)
2219
+ url_ += "userId=" + encodeURIComponent("" + userId) + "&";
2220
+ url_ = url_.replace(/[?&]$/, "");
2221
+ const content_ = JSON.stringify(body);
2222
+ let options_ = {
2223
+ data: content_,
2224
+ method: "POST",
2225
+ url: url_,
2226
+ headers: {
2227
+ "Content-Type": "application/json-patch+json",
2228
+ },
2229
+ cancelToken
2230
+ };
2231
+ return this.transformOptions(options_).then(transformedOptions_ => {
2232
+ return this.instance.request(transformedOptions_);
2233
+ }).catch((_error) => {
2234
+ if (isAxiosError(_error) && _error.response) {
2235
+ return _error.response;
2236
+ }
2237
+ else {
2238
+ throw _error;
2239
+ }
2240
+ }).then((_response) => {
2241
+ return this.transformResult(url_, _response, (_response) => this.processMergeAnonymous(_response));
2242
+ });
2243
+ }
2244
+ processMergeAnonymous(response) {
2245
+ const status = response.status;
2246
+ let _headers = {};
2247
+ if (response.headers && typeof response.headers === "object") {
2248
+ for (let k in response.headers) {
2249
+ if (response.headers.hasOwnProperty(k)) {
2250
+ _headers[k] = response.headers[k];
2251
+ }
2252
+ }
2253
+ }
2254
+ if (status === 200) {
2255
+ const _responseText = response.data;
2256
+ return Promise.resolve(null);
2257
+ }
2258
+ else if (status === 404) {
2259
+ const _responseText = response.data;
2260
+ let result404 = null;
2261
+ let resultData404 = _responseText;
2262
+ result404 = JSON.parse(resultData404);
2263
+ return throwException("Not Found", status, _responseText, _headers, result404);
2264
+ }
2265
+ else if (status === 409) {
2266
+ const _responseText = response.data;
2267
+ let result409 = null;
2268
+ let resultData409 = _responseText;
2269
+ result409 = JSON.parse(resultData409);
2270
+ return throwException("Conflict", status, _responseText, _headers, result409);
2271
+ }
2272
+ else if (status === 401) {
2273
+ const _responseText = response.data;
2274
+ return throwException("Unauthorized", status, _responseText, _headers);
2275
+ }
2276
+ else if (status === 403) {
2277
+ const _responseText = response.data;
2278
+ return throwException("Forbidden", status, _responseText, _headers);
2279
+ }
2280
+ else if (status !== 200 && status !== 204) {
2281
+ const _responseText = response.data;
2282
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
2283
+ }
2284
+ return Promise.resolve(null);
2285
+ }
2286
+ /**
2287
+ * Gets storefront user token
2288
+ * @param storefrontUserId Storefront user identifier
2289
+ * @param storefrontId Storefront identifier
2290
+ * @param tenantId (optional) Tenant identifier
2291
+ * @param userId (optional) User identifier
2292
+ * @return Success
2293
+ */
2294
+ getToken(storefrontUserId, storefrontId, tenantId, userId, cancelToken) {
2295
+ let url_ = this.baseUrl + "/api/storefront/v1/storefront-users/token?";
2296
+ if (storefrontUserId === undefined || storefrontUserId === null)
2297
+ throw new Error("The parameter 'storefrontUserId' must be defined and cannot be null.");
2298
+ else
2299
+ url_ += "storefrontUserId=" + encodeURIComponent("" + storefrontUserId) + "&";
2300
+ if (storefrontId === undefined || storefrontId === null)
2301
+ throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
2302
+ else
2303
+ url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
2304
+ if (tenantId !== undefined && tenantId !== null)
2305
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
2306
+ if (userId !== undefined && userId !== null)
2307
+ url_ += "userId=" + encodeURIComponent("" + userId) + "&";
2308
+ url_ = url_.replace(/[?&]$/, "");
2309
+ let options_ = {
2310
+ method: "GET",
2311
+ url: url_,
2312
+ headers: {},
2313
+ cancelToken
2314
+ };
2315
+ return this.transformOptions(options_).then(transformedOptions_ => {
2316
+ return this.instance.request(transformedOptions_);
2317
+ }).catch((_error) => {
2318
+ if (isAxiosError(_error) && _error.response) {
2319
+ return _error.response;
2320
+ }
2321
+ else {
2322
+ throw _error;
2323
+ }
2324
+ }).then((_response) => {
2325
+ return this.transformResult(url_, _response, (_response) => this.processGetToken(_response));
2326
+ });
2327
+ }
2328
+ processGetToken(response) {
2329
+ const status = response.status;
2330
+ let _headers = {};
2331
+ if (response.headers && typeof response.headers === "object") {
2332
+ for (let k in response.headers) {
2333
+ if (response.headers.hasOwnProperty(k)) {
2334
+ _headers[k] = response.headers[k];
2335
+ }
2336
+ }
2337
+ }
2338
+ if (status === 201) {
2339
+ const _responseText = response.data;
2340
+ return Promise.resolve(null);
2341
+ }
2342
+ else if (status === 404) {
2343
+ const _responseText = response.data;
2344
+ let result404 = null;
2345
+ let resultData404 = _responseText;
2346
+ result404 = JSON.parse(resultData404);
2347
+ return throwException("Not Found", status, _responseText, _headers, result404);
2348
+ }
2349
+ else if (status === 409) {
2350
+ const _responseText = response.data;
2351
+ let result409 = null;
2352
+ let resultData409 = _responseText;
2353
+ result409 = JSON.parse(resultData409);
2354
+ return throwException("Conflict", status, _responseText, _headers, result409);
2355
+ }
2356
+ else if (status === 401) {
2357
+ const _responseText = response.data;
2358
+ return throwException("Unauthorized", status, _responseText, _headers);
2359
+ }
2360
+ else if (status === 403) {
2361
+ const _responseText = response.data;
2362
+ return throwException("Forbidden", status, _responseText, _headers);
2363
+ }
2364
+ else if (status !== 200 && status !== 204) {
2365
+ const _responseText = response.data;
2366
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
2367
+ }
2368
+ return Promise.resolve(null);
2369
+ }
2370
+ }
2371
+ export class TenantInfoApiClient extends ApiClientBase {
2372
+ instance;
2373
+ baseUrl;
2374
+ jsonParseReviver = undefined;
2375
+ constructor(configuration, baseUrl, instance) {
2376
+ super(configuration);
2377
+ this.instance = instance ? instance : axios.create();
2378
+ this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : this.getBaseUrl("");
2379
+ }
2380
+ /**
2381
+ * Gets information about tenant applications
2382
+ * @param tenantId (optional) Tenant identifier
2383
+ * @param userId (optional) User identifier
2384
+ * @return Success
2385
+ */
2386
+ getApplicationsInfo(tenantId, userId, cancelToken) {
2387
+ let url_ = this.baseUrl + "/api/storefront/v1/tenant-info/applications?";
2388
+ if (tenantId !== undefined && tenantId !== null)
2389
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
2390
+ if (userId !== undefined && userId !== null)
2391
+ url_ += "userId=" + encodeURIComponent("" + userId) + "&";
2392
+ url_ = url_.replace(/[?&]$/, "");
2393
+ let options_ = {
2394
+ method: "GET",
2395
+ url: url_,
2396
+ headers: {
2397
+ "Accept": "text/plain"
2398
+ },
2399
+ cancelToken
2400
+ };
2401
+ return this.transformOptions(options_).then(transformedOptions_ => {
2402
+ return this.instance.request(transformedOptions_);
2403
+ }).catch((_error) => {
2404
+ if (isAxiosError(_error) && _error.response) {
2405
+ return _error.response;
2406
+ }
2407
+ else {
2408
+ throw _error;
2409
+ }
2410
+ }).then((_response) => {
2411
+ return this.transformResult(url_, _response, (_response) => this.processGetApplicationsInfo(_response));
2412
+ });
2413
+ }
2414
+ processGetApplicationsInfo(response) {
2415
+ const status = response.status;
2416
+ let _headers = {};
2417
+ if (response.headers && typeof response.headers === "object") {
2418
+ for (let k in response.headers) {
2419
+ if (response.headers.hasOwnProperty(k)) {
2420
+ _headers[k] = response.headers[k];
2421
+ }
2422
+ }
2423
+ }
2424
+ if (status === 200) {
2425
+ const _responseText = response.data;
2426
+ let result200 = null;
2427
+ let resultData200 = _responseText;
2428
+ result200 = JSON.parse(resultData200);
2429
+ return result200;
2430
+ }
2431
+ else if (status === 401) {
2432
+ const _responseText = response.data;
2433
+ return throwException("Unauthorized", status, _responseText, _headers);
2434
+ }
2435
+ else if (status === 403) {
2436
+ const _responseText = response.data;
2437
+ return throwException("Forbidden", status, _responseText, _headers);
2438
+ }
2439
+ else if (status !== 200 && status !== 204) {
2440
+ const _responseText = response.data;
2441
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
2442
+ }
2443
+ return Promise.resolve(null);
2444
+ }
2445
+ /**
2446
+ * Gets information about tenant
2447
+ * @param tenantId (optional) Tenant identifier
2448
+ * @param userId (optional) User identifier
2449
+ * @return Success
2450
+ */
2451
+ getInfo(tenantId, userId, cancelToken) {
2452
+ let url_ = this.baseUrl + "/api/storefront/v1/tenant-info?";
2453
+ if (tenantId !== undefined && tenantId !== null)
2454
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
2455
+ if (userId !== undefined && userId !== null)
2456
+ url_ += "userId=" + encodeURIComponent("" + userId) + "&";
2457
+ url_ = url_.replace(/[?&]$/, "");
2458
+ let options_ = {
2459
+ method: "GET",
2460
+ url: url_,
2461
+ headers: {
2462
+ "Accept": "text/plain"
2463
+ },
2464
+ cancelToken
2465
+ };
2466
+ return this.transformOptions(options_).then(transformedOptions_ => {
2467
+ return this.instance.request(transformedOptions_);
2468
+ }).catch((_error) => {
2469
+ if (isAxiosError(_error) && _error.response) {
2470
+ return _error.response;
2471
+ }
2472
+ else {
2473
+ throw _error;
2474
+ }
2475
+ }).then((_response) => {
2476
+ return this.transformResult(url_, _response, (_response) => this.processGetInfo(_response));
2477
+ });
2478
+ }
2479
+ processGetInfo(response) {
2480
+ const status = response.status;
2481
+ let _headers = {};
2482
+ if (response.headers && typeof response.headers === "object") {
2483
+ for (let k in response.headers) {
2484
+ if (response.headers.hasOwnProperty(k)) {
2485
+ _headers[k] = response.headers[k];
2486
+ }
2487
+ }
2488
+ }
2489
+ if (status === 200) {
2490
+ const _responseText = response.data;
2491
+ let result200 = null;
2492
+ let resultData200 = _responseText;
2493
+ result200 = JSON.parse(resultData200);
2494
+ return result200;
2495
+ }
2496
+ else if (status === 401) {
2497
+ const _responseText = response.data;
2498
+ return throwException("Unauthorized", status, _responseText, _headers);
2499
+ }
2500
+ else if (status === 403) {
2501
+ const _responseText = response.data;
2502
+ return throwException("Forbidden", status, _responseText, _headers);
2503
+ }
2504
+ else if (status !== 200 && status !== 204) {
2505
+ const _responseText = response.data;
2506
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
2507
+ }
2508
+ return Promise.resolve(null);
2509
+ }
2510
+ }
2511
+ /** Available date period filter values for queries */
2512
+ export var DatePeriod;
2513
+ (function (DatePeriod) {
2514
+ DatePeriod["All"] = "All";
2515
+ DatePeriod["Today"] = "Today";
2516
+ DatePeriod["Last7Days"] = "Last7Days";
2517
+ DatePeriod["Last30Days"] = "Last30Days";
2518
+ })(DatePeriod || (DatePeriod = {}));
2519
+ /** Storefront types */
2520
+ export var StorefrontType;
2521
+ (function (StorefrontType) {
2522
+ StorefrontType["Custom"] = "Custom";
2523
+ StorefrontType["Shopify"] = "Shopify";
2524
+ StorefrontType["DocketManager"] = "DocketManager";
2525
+ StorefrontType["Auth0Saml"] = "Auth0Saml";
2526
+ })(StorefrontType || (StorefrontType = {}));
2527
+ export class ApiException extends Error {
2528
+ message;
2529
+ status;
2530
+ response;
2531
+ headers;
2532
+ result;
2533
+ constructor(message, status, response, headers, result) {
2534
+ super();
2535
+ this.message = message;
2536
+ this.status = status;
2537
+ this.response = response;
2538
+ this.headers = headers;
2539
+ this.result = result;
2540
+ }
2541
+ isApiException = true;
2542
+ static isApiException(obj) {
2543
+ return obj.isApiException === true;
2544
+ }
2545
+ }
2546
+ function throwException(message, status, response, headers, result) {
2547
+ if (result !== null && result !== undefined)
2548
+ throw result;
2549
+ else
2550
+ throw new ApiException(message, status, response, headers, null);
2551
+ }
2552
+ function isAxiosError(obj) {
2553
+ return obj && obj.isAxiosError === true;
2554
+ }
2555
+ //# sourceMappingURL=storefront-api-client.js.map