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