@aurigma/axios-storefront-api-client 2.2.53

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,2574 @@
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 ownerId (optional) Project owner (storefront user id) filter
912
+ * @param productReference (optional) Product reference filter
913
+ * @param status (optional) Project status filter
914
+ * @param datePeriod (optional) Project date period filter
915
+ * @param skip (optional) Defines page start offset from beginning of sorted result list
916
+ * @param take (optional) Defines page length (how much consequent items of sorted result list should be taken)
917
+ * @param sorting (optional) Defines sorting order of result list e.g.: "Title ASC, LastModified DESC"
918
+ * @param search (optional) Search string for partial match
919
+ * @param tenantId (optional) Tenant identifier
920
+ * @param userId (optional) User identifier
921
+ * @return Success
922
+ */
923
+ getAll(storefrontId, ownerId, productReference, status, datePeriod, skip, take, sorting, search, tenantId, userId, cancelToken) {
924
+ let url_ = this.baseUrl + "/api/storefront/v1/projects?";
925
+ if (storefrontId === undefined || storefrontId === null)
926
+ throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
927
+ else
928
+ url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
929
+ if (ownerId !== undefined && ownerId !== null)
930
+ url_ += "ownerId=" + encodeURIComponent("" + ownerId) + "&";
931
+ if (productReference !== undefined && productReference !== null)
932
+ url_ += "productReference=" + encodeURIComponent("" + productReference) + "&";
933
+ if (status !== undefined && status !== null)
934
+ url_ += "status=" + encodeURIComponent("" + status) + "&";
935
+ if (datePeriod === null)
936
+ throw new Error("The parameter 'datePeriod' cannot be null.");
937
+ else if (datePeriod !== undefined)
938
+ url_ += "datePeriod=" + encodeURIComponent("" + datePeriod) + "&";
939
+ if (skip !== undefined && skip !== null)
940
+ url_ += "skip=" + encodeURIComponent("" + skip) + "&";
941
+ if (take !== undefined && take !== null)
942
+ url_ += "take=" + encodeURIComponent("" + take) + "&";
943
+ if (sorting !== undefined && sorting !== null)
944
+ url_ += "sorting=" + encodeURIComponent("" + sorting) + "&";
945
+ if (search !== undefined && search !== null)
946
+ url_ += "search=" + encodeURIComponent("" + search) + "&";
947
+ if (tenantId !== undefined && tenantId !== null)
948
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
949
+ if (userId !== undefined && userId !== null)
950
+ url_ += "userId=" + encodeURIComponent("" + userId) + "&";
951
+ url_ = url_.replace(/[?&]$/, "");
952
+ let options_ = {
953
+ method: "GET",
954
+ url: url_,
955
+ headers: {
956
+ "Accept": "text/plain"
957
+ },
958
+ cancelToken
959
+ };
960
+ return this.transformOptions(options_).then(transformedOptions_ => {
961
+ return this.instance.request(transformedOptions_);
962
+ }).catch((_error) => {
963
+ if (isAxiosError(_error) && _error.response) {
964
+ return _error.response;
965
+ }
966
+ else {
967
+ throw _error;
968
+ }
969
+ }).then((_response) => {
970
+ return this.transformResult(url_, _response, (_response) => this.processGetAll(_response));
971
+ });
972
+ }
973
+ processGetAll(response) {
974
+ const status = response.status;
975
+ let _headers = {};
976
+ if (response.headers && typeof response.headers === "object") {
977
+ for (let k in response.headers) {
978
+ if (response.headers.hasOwnProperty(k)) {
979
+ _headers[k] = response.headers[k];
980
+ }
981
+ }
982
+ }
983
+ if (status === 200) {
984
+ const _responseText = response.data;
985
+ let result200 = null;
986
+ let resultData200 = _responseText;
987
+ result200 = JSON.parse(resultData200);
988
+ return result200;
989
+ }
990
+ else if (status === 401) {
991
+ const _responseText = response.data;
992
+ return throwException("Unauthorized", status, _responseText, _headers);
993
+ }
994
+ else if (status === 403) {
995
+ const _responseText = response.data;
996
+ return throwException("Forbidden", status, _responseText, _headers);
997
+ }
998
+ else if (status !== 200 && status !== 204) {
999
+ const _responseText = response.data;
1000
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
1001
+ }
1002
+ return Promise.resolve(null);
1003
+ }
1004
+ /**
1005
+ * Creates new project
1006
+ * @param storefrontId Storefront identifier
1007
+ * @param tenantId (optional) Tenant identifier
1008
+ * @param userId (optional) User identifier
1009
+ * @param body (optional) Create operation parameters
1010
+ * @return Success
1011
+ */
1012
+ create(storefrontId, tenantId, userId, body, cancelToken) {
1013
+ let url_ = this.baseUrl + "/api/storefront/v1/projects?";
1014
+ if (storefrontId === undefined || storefrontId === null)
1015
+ throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
1016
+ else
1017
+ url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
1018
+ if (tenantId !== undefined && tenantId !== null)
1019
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
1020
+ if (userId !== undefined && userId !== null)
1021
+ url_ += "userId=" + encodeURIComponent("" + userId) + "&";
1022
+ url_ = url_.replace(/[?&]$/, "");
1023
+ const content_ = JSON.stringify(body);
1024
+ let options_ = {
1025
+ data: content_,
1026
+ method: "POST",
1027
+ url: url_,
1028
+ headers: {
1029
+ "Content-Type": "application/json-patch+json",
1030
+ "Accept": "text/plain"
1031
+ },
1032
+ cancelToken
1033
+ };
1034
+ return this.transformOptions(options_).then(transformedOptions_ => {
1035
+ return this.instance.request(transformedOptions_);
1036
+ }).catch((_error) => {
1037
+ if (isAxiosError(_error) && _error.response) {
1038
+ return _error.response;
1039
+ }
1040
+ else {
1041
+ throw _error;
1042
+ }
1043
+ }).then((_response) => {
1044
+ return this.transformResult(url_, _response, (_response) => this.processCreate(_response));
1045
+ });
1046
+ }
1047
+ processCreate(response) {
1048
+ const status = response.status;
1049
+ let _headers = {};
1050
+ if (response.headers && typeof response.headers === "object") {
1051
+ for (let k in response.headers) {
1052
+ if (response.headers.hasOwnProperty(k)) {
1053
+ _headers[k] = response.headers[k];
1054
+ }
1055
+ }
1056
+ }
1057
+ if (status === 201) {
1058
+ const _responseText = response.data;
1059
+ let result201 = null;
1060
+ let resultData201 = _responseText;
1061
+ result201 = JSON.parse(resultData201);
1062
+ return result201;
1063
+ }
1064
+ else if (status === 409) {
1065
+ const _responseText = response.data;
1066
+ let result409 = null;
1067
+ let resultData409 = _responseText;
1068
+ result409 = JSON.parse(resultData409);
1069
+ return throwException("Conflict", status, _responseText, _headers, result409);
1070
+ }
1071
+ else if (status === 401) {
1072
+ const _responseText = response.data;
1073
+ return throwException("Unauthorized", status, _responseText, _headers);
1074
+ }
1075
+ else if (status === 403) {
1076
+ const _responseText = response.data;
1077
+ return throwException("Forbidden", status, _responseText, _headers);
1078
+ }
1079
+ else if (status !== 200 && status !== 204) {
1080
+ const _responseText = response.data;
1081
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
1082
+ }
1083
+ return Promise.resolve(null);
1084
+ }
1085
+ /**
1086
+ * Gets project by id
1087
+ * @param id Project identifier
1088
+ * @param tenantId (optional) Tenant identifier
1089
+ * @param userId (optional) User identifier
1090
+ * @return Success
1091
+ */
1092
+ get(id, tenantId, userId, cancelToken) {
1093
+ let url_ = this.baseUrl + "/api/storefront/v1/projects/{id}?";
1094
+ if (id === undefined || id === null)
1095
+ throw new Error("The parameter 'id' must be defined.");
1096
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
1097
+ if (tenantId !== undefined && tenantId !== null)
1098
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
1099
+ if (userId !== undefined && userId !== null)
1100
+ url_ += "userId=" + encodeURIComponent("" + userId) + "&";
1101
+ url_ = url_.replace(/[?&]$/, "");
1102
+ let options_ = {
1103
+ method: "GET",
1104
+ url: url_,
1105
+ headers: {
1106
+ "Accept": "text/plain"
1107
+ },
1108
+ cancelToken
1109
+ };
1110
+ return this.transformOptions(options_).then(transformedOptions_ => {
1111
+ return this.instance.request(transformedOptions_);
1112
+ }).catch((_error) => {
1113
+ if (isAxiosError(_error) && _error.response) {
1114
+ return _error.response;
1115
+ }
1116
+ else {
1117
+ throw _error;
1118
+ }
1119
+ }).then((_response) => {
1120
+ return this.transformResult(url_, _response, (_response) => this.processGet(_response));
1121
+ });
1122
+ }
1123
+ processGet(response) {
1124
+ const status = response.status;
1125
+ let _headers = {};
1126
+ if (response.headers && typeof response.headers === "object") {
1127
+ for (let k in response.headers) {
1128
+ if (response.headers.hasOwnProperty(k)) {
1129
+ _headers[k] = response.headers[k];
1130
+ }
1131
+ }
1132
+ }
1133
+ if (status === 200) {
1134
+ const _responseText = response.data;
1135
+ let result200 = null;
1136
+ let resultData200 = _responseText;
1137
+ result200 = JSON.parse(resultData200);
1138
+ return result200;
1139
+ }
1140
+ else if (status === 404) {
1141
+ const _responseText = response.data;
1142
+ let result404 = null;
1143
+ let resultData404 = _responseText;
1144
+ result404 = JSON.parse(resultData404);
1145
+ return throwException("Not Found", status, _responseText, _headers, result404);
1146
+ }
1147
+ else if (status === 401) {
1148
+ const _responseText = response.data;
1149
+ return throwException("Unauthorized", status, _responseText, _headers);
1150
+ }
1151
+ else if (status === 403) {
1152
+ const _responseText = response.data;
1153
+ return throwException("Forbidden", status, _responseText, _headers);
1154
+ }
1155
+ else if (status !== 200 && status !== 204) {
1156
+ const _responseText = response.data;
1157
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
1158
+ }
1159
+ return Promise.resolve(null);
1160
+ }
1161
+ /**
1162
+ * Gets available project transitions
1163
+ * @param id Project identifier
1164
+ * @param tenantId (optional) Tenant identifier
1165
+ * @param userId (optional) User identifier
1166
+ * @return Success
1167
+ */
1168
+ getAvailableTransitions(id, tenantId, userId, cancelToken) {
1169
+ let url_ = this.baseUrl + "/api/storefront/v1/projects/{id}/transitions?";
1170
+ if (id === undefined || id === null)
1171
+ throw new Error("The parameter 'id' must be defined.");
1172
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
1173
+ if (tenantId !== undefined && tenantId !== null)
1174
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
1175
+ if (userId !== undefined && userId !== null)
1176
+ url_ += "userId=" + encodeURIComponent("" + userId) + "&";
1177
+ url_ = url_.replace(/[?&]$/, "");
1178
+ let options_ = {
1179
+ method: "GET",
1180
+ url: url_,
1181
+ headers: {
1182
+ "Accept": "text/plain"
1183
+ },
1184
+ cancelToken
1185
+ };
1186
+ return this.transformOptions(options_).then(transformedOptions_ => {
1187
+ return this.instance.request(transformedOptions_);
1188
+ }).catch((_error) => {
1189
+ if (isAxiosError(_error) && _error.response) {
1190
+ return _error.response;
1191
+ }
1192
+ else {
1193
+ throw _error;
1194
+ }
1195
+ }).then((_response) => {
1196
+ return this.transformResult(url_, _response, (_response) => this.processGetAvailableTransitions(_response));
1197
+ });
1198
+ }
1199
+ processGetAvailableTransitions(response) {
1200
+ const status = response.status;
1201
+ let _headers = {};
1202
+ if (response.headers && typeof response.headers === "object") {
1203
+ for (let k in response.headers) {
1204
+ if (response.headers.hasOwnProperty(k)) {
1205
+ _headers[k] = response.headers[k];
1206
+ }
1207
+ }
1208
+ }
1209
+ if (status === 200) {
1210
+ const _responseText = response.data;
1211
+ let result200 = null;
1212
+ let resultData200 = _responseText;
1213
+ result200 = JSON.parse(resultData200);
1214
+ return result200;
1215
+ }
1216
+ else if (status === 400) {
1217
+ const _responseText = response.data;
1218
+ let result400 = null;
1219
+ let resultData400 = _responseText;
1220
+ result400 = JSON.parse(resultData400);
1221
+ return throwException("Bad Request", status, _responseText, _headers, result400);
1222
+ }
1223
+ else if (status === 404) {
1224
+ const _responseText = response.data;
1225
+ let result404 = null;
1226
+ let resultData404 = _responseText;
1227
+ result404 = JSON.parse(resultData404);
1228
+ return throwException("Not Found", status, _responseText, _headers, result404);
1229
+ }
1230
+ else if (status === 409) {
1231
+ const _responseText = response.data;
1232
+ let result409 = null;
1233
+ let resultData409 = _responseText;
1234
+ result409 = JSON.parse(resultData409);
1235
+ return throwException("Conflict", status, _responseText, _headers, result409);
1236
+ }
1237
+ else if (status === 401) {
1238
+ const _responseText = response.data;
1239
+ return throwException("Unauthorized", status, _responseText, _headers);
1240
+ }
1241
+ else if (status === 403) {
1242
+ const _responseText = response.data;
1243
+ return throwException("Forbidden", status, _responseText, _headers);
1244
+ }
1245
+ else if (status !== 200 && status !== 204) {
1246
+ const _responseText = response.data;
1247
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
1248
+ }
1249
+ return Promise.resolve(null);
1250
+ }
1251
+ /**
1252
+ * Changes project status
1253
+ * @param id Project identifier
1254
+ * @param transition Transition identifying name
1255
+ * @param tenantId (optional) Tenant identifier
1256
+ * @param userId (optional) User identifier
1257
+ * @return Success
1258
+ */
1259
+ changeStatus(id, transition, tenantId, userId, cancelToken) {
1260
+ let url_ = this.baseUrl + "/api/storefront/v1/projects/{id}/transitions/{transition}?";
1261
+ if (id === undefined || id === null)
1262
+ throw new Error("The parameter 'id' must be defined.");
1263
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
1264
+ if (transition === undefined || transition === null)
1265
+ throw new Error("The parameter 'transition' must be defined.");
1266
+ url_ = url_.replace("{transition}", encodeURIComponent("" + transition));
1267
+ if (tenantId !== undefined && tenantId !== null)
1268
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
1269
+ if (userId !== undefined && userId !== null)
1270
+ url_ += "userId=" + encodeURIComponent("" + userId) + "&";
1271
+ url_ = url_.replace(/[?&]$/, "");
1272
+ let options_ = {
1273
+ method: "POST",
1274
+ url: url_,
1275
+ headers: {
1276
+ "Accept": "text/plain"
1277
+ },
1278
+ cancelToken
1279
+ };
1280
+ return this.transformOptions(options_).then(transformedOptions_ => {
1281
+ return this.instance.request(transformedOptions_);
1282
+ }).catch((_error) => {
1283
+ if (isAxiosError(_error) && _error.response) {
1284
+ return _error.response;
1285
+ }
1286
+ else {
1287
+ throw _error;
1288
+ }
1289
+ }).then((_response) => {
1290
+ return this.transformResult(url_, _response, (_response) => this.processChangeStatus(_response));
1291
+ });
1292
+ }
1293
+ processChangeStatus(response) {
1294
+ const status = response.status;
1295
+ let _headers = {};
1296
+ if (response.headers && typeof response.headers === "object") {
1297
+ for (let k in response.headers) {
1298
+ if (response.headers.hasOwnProperty(k)) {
1299
+ _headers[k] = response.headers[k];
1300
+ }
1301
+ }
1302
+ }
1303
+ if (status === 200) {
1304
+ const _responseText = response.data;
1305
+ let result200 = null;
1306
+ let resultData200 = _responseText;
1307
+ result200 = JSON.parse(resultData200);
1308
+ return result200;
1309
+ }
1310
+ else if (status === 400) {
1311
+ const _responseText = response.data;
1312
+ let result400 = null;
1313
+ let resultData400 = _responseText;
1314
+ result400 = JSON.parse(resultData400);
1315
+ return throwException("Bad Request", status, _responseText, _headers, result400);
1316
+ }
1317
+ else if (status === 404) {
1318
+ const _responseText = response.data;
1319
+ let result404 = null;
1320
+ let resultData404 = _responseText;
1321
+ result404 = JSON.parse(resultData404);
1322
+ return throwException("Not Found", status, _responseText, _headers, result404);
1323
+ }
1324
+ else if (status === 409) {
1325
+ const _responseText = response.data;
1326
+ let result409 = null;
1327
+ let resultData409 = _responseText;
1328
+ result409 = JSON.parse(resultData409);
1329
+ return throwException("Conflict", status, _responseText, _headers, result409);
1330
+ }
1331
+ else if (status === 401) {
1332
+ const _responseText = response.data;
1333
+ return throwException("Unauthorized", status, _responseText, _headers);
1334
+ }
1335
+ else if (status === 403) {
1336
+ const _responseText = response.data;
1337
+ return throwException("Forbidden", status, _responseText, _headers);
1338
+ }
1339
+ else if (status !== 200 && status !== 204) {
1340
+ const _responseText = response.data;
1341
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
1342
+ }
1343
+ return Promise.resolve(null);
1344
+ }
1345
+ /**
1346
+ * Force changes project status
1347
+ * @param id Project identifier
1348
+ * @param status Project status code
1349
+ * @param tenantId (optional) Tenant identifier
1350
+ * @param userId (optional) User identifier
1351
+ * @return Success
1352
+ */
1353
+ forceStatus(id, status, tenantId, userId, cancelToken) {
1354
+ let url_ = this.baseUrl + "/api/storefront/v1/projects/{id}/statuses/{status}?";
1355
+ if (id === undefined || id === null)
1356
+ throw new Error("The parameter 'id' must be defined.");
1357
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
1358
+ if (status === undefined || status === null)
1359
+ throw new Error("The parameter 'status' must be defined.");
1360
+ url_ = url_.replace("{status}", encodeURIComponent("" + status));
1361
+ if (tenantId !== undefined && tenantId !== null)
1362
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
1363
+ if (userId !== undefined && userId !== null)
1364
+ url_ += "userId=" + encodeURIComponent("" + userId) + "&";
1365
+ url_ = url_.replace(/[?&]$/, "");
1366
+ let options_ = {
1367
+ method: "POST",
1368
+ url: url_,
1369
+ headers: {
1370
+ "Accept": "text/plain"
1371
+ },
1372
+ cancelToken
1373
+ };
1374
+ return this.transformOptions(options_).then(transformedOptions_ => {
1375
+ return this.instance.request(transformedOptions_);
1376
+ }).catch((_error) => {
1377
+ if (isAxiosError(_error) && _error.response) {
1378
+ return _error.response;
1379
+ }
1380
+ else {
1381
+ throw _error;
1382
+ }
1383
+ }).then((_response) => {
1384
+ return this.transformResult(url_, _response, (_response) => this.processForceStatus(_response));
1385
+ });
1386
+ }
1387
+ processForceStatus(response) {
1388
+ const status = response.status;
1389
+ let _headers = {};
1390
+ if (response.headers && typeof response.headers === "object") {
1391
+ for (let k in response.headers) {
1392
+ if (response.headers.hasOwnProperty(k)) {
1393
+ _headers[k] = response.headers[k];
1394
+ }
1395
+ }
1396
+ }
1397
+ if (status === 200) {
1398
+ const _responseText = response.data;
1399
+ let result200 = null;
1400
+ let resultData200 = _responseText;
1401
+ result200 = JSON.parse(resultData200);
1402
+ return result200;
1403
+ }
1404
+ else if (status === 400) {
1405
+ const _responseText = response.data;
1406
+ let result400 = null;
1407
+ let resultData400 = _responseText;
1408
+ result400 = JSON.parse(resultData400);
1409
+ return throwException("Bad Request", status, _responseText, _headers, result400);
1410
+ }
1411
+ else if (status === 404) {
1412
+ const _responseText = response.data;
1413
+ let result404 = null;
1414
+ let resultData404 = _responseText;
1415
+ result404 = JSON.parse(resultData404);
1416
+ return throwException("Not Found", status, _responseText, _headers, result404);
1417
+ }
1418
+ else if (status === 401) {
1419
+ const _responseText = response.data;
1420
+ return throwException("Unauthorized", status, _responseText, _headers);
1421
+ }
1422
+ else if (status === 403) {
1423
+ const _responseText = response.data;
1424
+ return throwException("Forbidden", status, _responseText, _headers);
1425
+ }
1426
+ else if (status !== 200 && status !== 204) {
1427
+ const _responseText = response.data;
1428
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
1429
+ }
1430
+ return Promise.resolve(null);
1431
+ }
1432
+ /**
1433
+ * Gets all project statuses
1434
+ * @param tenantId (optional) Tenant identifier
1435
+ * @param userId (optional) User identifier
1436
+ * @return Success
1437
+ */
1438
+ getAllStatuses(tenantId, userId, cancelToken) {
1439
+ let url_ = this.baseUrl + "/api/storefront/v1/projects/statuses?";
1440
+ if (tenantId !== undefined && tenantId !== null)
1441
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
1442
+ if (userId !== undefined && userId !== null)
1443
+ url_ += "userId=" + encodeURIComponent("" + userId) + "&";
1444
+ url_ = url_.replace(/[?&]$/, "");
1445
+ let options_ = {
1446
+ method: "GET",
1447
+ url: url_,
1448
+ headers: {
1449
+ "Accept": "text/plain"
1450
+ },
1451
+ cancelToken
1452
+ };
1453
+ return this.transformOptions(options_).then(transformedOptions_ => {
1454
+ return this.instance.request(transformedOptions_);
1455
+ }).catch((_error) => {
1456
+ if (isAxiosError(_error) && _error.response) {
1457
+ return _error.response;
1458
+ }
1459
+ else {
1460
+ throw _error;
1461
+ }
1462
+ }).then((_response) => {
1463
+ return this.transformResult(url_, _response, (_response) => this.processGetAllStatuses(_response));
1464
+ });
1465
+ }
1466
+ processGetAllStatuses(response) {
1467
+ const status = response.status;
1468
+ let _headers = {};
1469
+ if (response.headers && typeof response.headers === "object") {
1470
+ for (let k in response.headers) {
1471
+ if (response.headers.hasOwnProperty(k)) {
1472
+ _headers[k] = response.headers[k];
1473
+ }
1474
+ }
1475
+ }
1476
+ if (status === 200) {
1477
+ const _responseText = response.data;
1478
+ let result200 = null;
1479
+ let resultData200 = _responseText;
1480
+ result200 = JSON.parse(resultData200);
1481
+ return result200;
1482
+ }
1483
+ else if (status === 401) {
1484
+ const _responseText = response.data;
1485
+ return throwException("Unauthorized", status, _responseText, _headers);
1486
+ }
1487
+ else if (status === 403) {
1488
+ const _responseText = response.data;
1489
+ return throwException("Forbidden", status, _responseText, _headers);
1490
+ }
1491
+ else if (status !== 200 && status !== 204) {
1492
+ const _responseText = response.data;
1493
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
1494
+ }
1495
+ return Promise.resolve(null);
1496
+ }
1497
+ /**
1498
+ * Gets all project transitions
1499
+ * @param tenantId (optional) Tenant identifier
1500
+ * @param userId (optional) User identifier
1501
+ * @return Success
1502
+ */
1503
+ getAllTransitions(tenantId, userId, cancelToken) {
1504
+ let url_ = this.baseUrl + "/api/storefront/v1/projects/transitions?";
1505
+ if (tenantId !== undefined && tenantId !== null)
1506
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
1507
+ if (userId !== undefined && userId !== null)
1508
+ url_ += "userId=" + encodeURIComponent("" + userId) + "&";
1509
+ url_ = url_.replace(/[?&]$/, "");
1510
+ let options_ = {
1511
+ method: "GET",
1512
+ url: url_,
1513
+ headers: {
1514
+ "Accept": "text/plain"
1515
+ },
1516
+ cancelToken
1517
+ };
1518
+ return this.transformOptions(options_).then(transformedOptions_ => {
1519
+ return this.instance.request(transformedOptions_);
1520
+ }).catch((_error) => {
1521
+ if (isAxiosError(_error) && _error.response) {
1522
+ return _error.response;
1523
+ }
1524
+ else {
1525
+ throw _error;
1526
+ }
1527
+ }).then((_response) => {
1528
+ return this.transformResult(url_, _response, (_response) => this.processGetAllTransitions(_response));
1529
+ });
1530
+ }
1531
+ processGetAllTransitions(response) {
1532
+ const status = response.status;
1533
+ let _headers = {};
1534
+ if (response.headers && typeof response.headers === "object") {
1535
+ for (let k in response.headers) {
1536
+ if (response.headers.hasOwnProperty(k)) {
1537
+ _headers[k] = response.headers[k];
1538
+ }
1539
+ }
1540
+ }
1541
+ if (status === 200) {
1542
+ const _responseText = response.data;
1543
+ let result200 = null;
1544
+ let resultData200 = _responseText;
1545
+ result200 = JSON.parse(resultData200);
1546
+ return result200;
1547
+ }
1548
+ else if (status === 401) {
1549
+ const _responseText = response.data;
1550
+ return throwException("Unauthorized", status, _responseText, _headers);
1551
+ }
1552
+ else if (status === 403) {
1553
+ const _responseText = response.data;
1554
+ return throwException("Forbidden", status, _responseText, _headers);
1555
+ }
1556
+ else if (status !== 200 && status !== 204) {
1557
+ const _responseText = response.data;
1558
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
1559
+ }
1560
+ return Promise.resolve(null);
1561
+ }
1562
+ /**
1563
+ * Gets project pdf url
1564
+ * @param id Project unique identifier
1565
+ * @param designUserId User identifier
1566
+ * @param designId Design identifier
1567
+ * @param tenantId (optional) Tenant identifier
1568
+ * @param userId (optional) User identifier
1569
+ * @return Success
1570
+ */
1571
+ getProjectPdfUrl(id, designUserId, designId, tenantId, userId, cancelToken) {
1572
+ let url_ = this.baseUrl + "/api/storefront/v1/projects/{id}/project-pdf?";
1573
+ if (id === undefined || id === null)
1574
+ throw new Error("The parameter 'id' must be defined.");
1575
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
1576
+ if (designUserId === undefined || designUserId === null)
1577
+ throw new Error("The parameter 'designUserId' must be defined and cannot be null.");
1578
+ else
1579
+ url_ += "designUserId=" + encodeURIComponent("" + designUserId) + "&";
1580
+ if (designId === undefined || designId === null)
1581
+ throw new Error("The parameter 'designId' must be defined and cannot be null.");
1582
+ else
1583
+ url_ += "designId=" + encodeURIComponent("" + designId) + "&";
1584
+ if (tenantId !== undefined && tenantId !== null)
1585
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
1586
+ if (userId !== undefined && userId !== null)
1587
+ url_ += "userId=" + encodeURIComponent("" + userId) + "&";
1588
+ url_ = url_.replace(/[?&]$/, "");
1589
+ let options_ = {
1590
+ method: "GET",
1591
+ url: url_,
1592
+ headers: {
1593
+ "Accept": "text/plain"
1594
+ },
1595
+ cancelToken
1596
+ };
1597
+ return this.transformOptions(options_).then(transformedOptions_ => {
1598
+ return this.instance.request(transformedOptions_);
1599
+ }).catch((_error) => {
1600
+ if (isAxiosError(_error) && _error.response) {
1601
+ return _error.response;
1602
+ }
1603
+ else {
1604
+ throw _error;
1605
+ }
1606
+ }).then((_response) => {
1607
+ return this.transformResult(url_, _response, (_response) => this.processGetProjectPdfUrl(_response));
1608
+ });
1609
+ }
1610
+ processGetProjectPdfUrl(response) {
1611
+ const status = response.status;
1612
+ let _headers = {};
1613
+ if (response.headers && typeof response.headers === "object") {
1614
+ for (let k in response.headers) {
1615
+ if (response.headers.hasOwnProperty(k)) {
1616
+ _headers[k] = response.headers[k];
1617
+ }
1618
+ }
1619
+ }
1620
+ if (status === 200) {
1621
+ const _responseText = response.data;
1622
+ let result200 = null;
1623
+ let resultData200 = _responseText;
1624
+ result200 = JSON.parse(resultData200);
1625
+ return result200;
1626
+ }
1627
+ else if (status === 401) {
1628
+ const _responseText = response.data;
1629
+ return throwException("Unauthorized", status, _responseText, _headers);
1630
+ }
1631
+ else if (status === 403) {
1632
+ const _responseText = response.data;
1633
+ return throwException("Forbidden", status, _responseText, _headers);
1634
+ }
1635
+ else if (status !== 200 && status !== 204) {
1636
+ const _responseText = response.data;
1637
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
1638
+ }
1639
+ return Promise.resolve(null);
1640
+ }
1641
+ /**
1642
+ * Gets project pdf files in zip archive
1643
+ * @param id Project unique identifier
1644
+ * @param designUserId User identifier
1645
+ * @param designId Design identifier
1646
+ * @param attachment (optional) If set to 'true', file will be provided as an attachment with proper filename supplied (default value is 'false')
1647
+ * @param tenantId (optional) Tenant identifier
1648
+ * @param userId (optional) User identifier
1649
+ * @return Success
1650
+ */
1651
+ getProjectPdfZip(id, designUserId, designId, attachment, tenantId, userId, cancelToken) {
1652
+ let url_ = this.baseUrl + "/api/storefront/v1/projects/{id}/project-pdf-zip?";
1653
+ if (id === undefined || id === null)
1654
+ throw new Error("The parameter 'id' must be defined.");
1655
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
1656
+ if (designUserId === undefined || designUserId === null)
1657
+ throw new Error("The parameter 'designUserId' must be defined and cannot be null.");
1658
+ else
1659
+ url_ += "designUserId=" + encodeURIComponent("" + designUserId) + "&";
1660
+ if (designId === undefined || designId === null)
1661
+ throw new Error("The parameter 'designId' must be defined and cannot be null.");
1662
+ else
1663
+ url_ += "designId=" + encodeURIComponent("" + designId) + "&";
1664
+ if (attachment !== undefined && attachment !== null)
1665
+ url_ += "attachment=" + encodeURIComponent("" + attachment) + "&";
1666
+ if (tenantId !== undefined && tenantId !== null)
1667
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
1668
+ if (userId !== undefined && userId !== null)
1669
+ url_ += "userId=" + encodeURIComponent("" + userId) + "&";
1670
+ url_ = url_.replace(/[?&]$/, "");
1671
+ let options_ = {
1672
+ responseType: "blob",
1673
+ method: "GET",
1674
+ url: url_,
1675
+ headers: {
1676
+ "Accept": "application/octet-stream"
1677
+ },
1678
+ cancelToken
1679
+ };
1680
+ return this.transformOptions(options_).then(transformedOptions_ => {
1681
+ return this.instance.request(transformedOptions_);
1682
+ }).catch((_error) => {
1683
+ if (isAxiosError(_error) && _error.response) {
1684
+ return _error.response;
1685
+ }
1686
+ else {
1687
+ throw _error;
1688
+ }
1689
+ }).then((_response) => {
1690
+ return this.transformResult(url_, _response, (_response) => this.processGetProjectPdfZip(_response));
1691
+ });
1692
+ }
1693
+ processGetProjectPdfZip(response) {
1694
+ const status = response.status;
1695
+ let _headers = {};
1696
+ if (response.headers && typeof response.headers === "object") {
1697
+ for (let k in response.headers) {
1698
+ if (response.headers.hasOwnProperty(k)) {
1699
+ _headers[k] = response.headers[k];
1700
+ }
1701
+ }
1702
+ }
1703
+ if (status === 200 || status === 206) {
1704
+ const contentDisposition = response.headers ? response.headers["content-disposition"] : undefined;
1705
+ const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
1706
+ const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
1707
+ return Promise.resolve({ fileName: fileName, status: status, data: response.data, headers: _headers });
1708
+ }
1709
+ else if (status === 404) {
1710
+ const _responseText = response.data;
1711
+ let result404 = null;
1712
+ let resultData404 = _responseText;
1713
+ result404 = JSON.parse(resultData404);
1714
+ return throwException("Not Found", status, _responseText, _headers, result404);
1715
+ }
1716
+ else if (status === 401) {
1717
+ const _responseText = response.data;
1718
+ return throwException("Unauthorized", status, _responseText, _headers);
1719
+ }
1720
+ else if (status === 403) {
1721
+ const _responseText = response.data;
1722
+ return throwException("Forbidden", status, _responseText, _headers);
1723
+ }
1724
+ else if (status !== 200 && status !== 204) {
1725
+ const _responseText = response.data;
1726
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
1727
+ }
1728
+ return Promise.resolve(null);
1729
+ }
1730
+ /**
1731
+ * Gets project order data from ecommerce system
1732
+ * @param id Project identifier
1733
+ * @return Success
1734
+ */
1735
+ getProjectOrder(id, cancelToken) {
1736
+ let url_ = this.baseUrl + "/api/storefront/v1/projects/{id}/order";
1737
+ if (id === undefined || id === null)
1738
+ throw new Error("The parameter 'id' must be defined.");
1739
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
1740
+ url_ = url_.replace(/[?&]$/, "");
1741
+ let options_ = {
1742
+ method: "GET",
1743
+ url: url_,
1744
+ headers: {
1745
+ "Accept": "application/json"
1746
+ },
1747
+ cancelToken
1748
+ };
1749
+ return this.transformOptions(options_).then(transformedOptions_ => {
1750
+ return this.instance.request(transformedOptions_);
1751
+ }).catch((_error) => {
1752
+ if (isAxiosError(_error) && _error.response) {
1753
+ return _error.response;
1754
+ }
1755
+ else {
1756
+ throw _error;
1757
+ }
1758
+ }).then((_response) => {
1759
+ return this.transformResult(url_, _response, (_response) => this.processGetProjectOrder(_response));
1760
+ });
1761
+ }
1762
+ processGetProjectOrder(response) {
1763
+ const status = response.status;
1764
+ let _headers = {};
1765
+ if (response.headers && typeof response.headers === "object") {
1766
+ for (let k in response.headers) {
1767
+ if (response.headers.hasOwnProperty(k)) {
1768
+ _headers[k] = response.headers[k];
1769
+ }
1770
+ }
1771
+ }
1772
+ if (status === 200) {
1773
+ const _responseText = response.data;
1774
+ let result200 = null;
1775
+ let resultData200 = _responseText;
1776
+ result200 = JSON.parse(resultData200);
1777
+ return result200;
1778
+ }
1779
+ else if (status === 404) {
1780
+ const _responseText = response.data;
1781
+ let result404 = null;
1782
+ let resultData404 = _responseText;
1783
+ result404 = JSON.parse(resultData404);
1784
+ return throwException("Not Found", status, _responseText, _headers, result404);
1785
+ }
1786
+ else if (status === 401) {
1787
+ const _responseText = response.data;
1788
+ return throwException("Unauthorized", status, _responseText, _headers);
1789
+ }
1790
+ else if (status === 403) {
1791
+ const _responseText = response.data;
1792
+ return throwException("Forbidden", status, _responseText, _headers);
1793
+ }
1794
+ else if (status !== 200 && status !== 204) {
1795
+ const _responseText = response.data;
1796
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
1797
+ }
1798
+ return Promise.resolve(null);
1799
+ }
1800
+ }
1801
+ exports.ProjectsApiClient = ProjectsApiClient;
1802
+ class StorefrontsApiClient extends ApiClientBase {
1803
+ instance;
1804
+ baseUrl;
1805
+ jsonParseReviver = undefined;
1806
+ constructor(configuration, baseUrl, instance) {
1807
+ super(configuration);
1808
+ this.instance = instance ? instance : axios_1.default.create();
1809
+ this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : this.getBaseUrl("");
1810
+ }
1811
+ /**
1812
+ * Gets all storefronts relevant to specified query parameters
1813
+ * @param types (optional) Storefront type filter
1814
+ * @param skip (optional) Defines page start offset from beginning of sorted result list
1815
+ * @param take (optional) Defines page length (how much consequent items of sorted result list should be taken)
1816
+ * @param sorting (optional) Defines sorting order of result list e.g.: "Title ASC, LastModified DESC"
1817
+ * @param search (optional) Search string for partial match
1818
+ * @param tenantId (optional) Tenant identifier
1819
+ * @param userId (optional) User identifier
1820
+ * @return Success
1821
+ */
1822
+ getAll(types, skip, take, sorting, search, tenantId, userId, cancelToken) {
1823
+ let url_ = this.baseUrl + "/api/storefront/v1/storefronts?";
1824
+ if (types !== undefined && types !== null)
1825
+ types && types.forEach(item => { url_ += "types=" + encodeURIComponent("" + item) + "&"; });
1826
+ if (skip !== undefined && skip !== null)
1827
+ url_ += "skip=" + encodeURIComponent("" + skip) + "&";
1828
+ if (take !== undefined && take !== null)
1829
+ url_ += "take=" + encodeURIComponent("" + take) + "&";
1830
+ if (sorting !== undefined && sorting !== null)
1831
+ url_ += "sorting=" + encodeURIComponent("" + sorting) + "&";
1832
+ if (search !== undefined && search !== null)
1833
+ url_ += "search=" + encodeURIComponent("" + search) + "&";
1834
+ if (tenantId !== undefined && tenantId !== null)
1835
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
1836
+ if (userId !== undefined && userId !== null)
1837
+ url_ += "userId=" + encodeURIComponent("" + userId) + "&";
1838
+ url_ = url_.replace(/[?&]$/, "");
1839
+ let options_ = {
1840
+ method: "GET",
1841
+ url: url_,
1842
+ headers: {
1843
+ "Accept": "text/plain"
1844
+ },
1845
+ cancelToken
1846
+ };
1847
+ return this.transformOptions(options_).then(transformedOptions_ => {
1848
+ return this.instance.request(transformedOptions_);
1849
+ }).catch((_error) => {
1850
+ if (isAxiosError(_error) && _error.response) {
1851
+ return _error.response;
1852
+ }
1853
+ else {
1854
+ throw _error;
1855
+ }
1856
+ }).then((_response) => {
1857
+ return this.transformResult(url_, _response, (_response) => this.processGetAll(_response));
1858
+ });
1859
+ }
1860
+ processGetAll(response) {
1861
+ const status = response.status;
1862
+ let _headers = {};
1863
+ if (response.headers && typeof response.headers === "object") {
1864
+ for (let k in response.headers) {
1865
+ if (response.headers.hasOwnProperty(k)) {
1866
+ _headers[k] = response.headers[k];
1867
+ }
1868
+ }
1869
+ }
1870
+ if (status === 200) {
1871
+ const _responseText = response.data;
1872
+ let result200 = null;
1873
+ let resultData200 = _responseText;
1874
+ result200 = JSON.parse(resultData200);
1875
+ return result200;
1876
+ }
1877
+ else if (status === 401) {
1878
+ const _responseText = response.data;
1879
+ return throwException("Unauthorized", status, _responseText, _headers);
1880
+ }
1881
+ else if (status === 403) {
1882
+ const _responseText = response.data;
1883
+ return throwException("Forbidden", status, _responseText, _headers);
1884
+ }
1885
+ else if (status !== 200 && status !== 204) {
1886
+ const _responseText = response.data;
1887
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
1888
+ }
1889
+ return Promise.resolve(null);
1890
+ }
1891
+ /**
1892
+ * Gets storefront
1893
+ * @param id Storefront identifier
1894
+ * @param tenantId (optional) Tenant identifier
1895
+ * @param userId (optional) User identifier
1896
+ * @return Success
1897
+ */
1898
+ get(id, tenantId, userId, cancelToken) {
1899
+ let url_ = this.baseUrl + "/api/storefront/v1/storefronts/{id}?";
1900
+ if (id === undefined || id === null)
1901
+ throw new Error("The parameter 'id' must be defined.");
1902
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
1903
+ if (tenantId !== undefined && tenantId !== null)
1904
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
1905
+ if (userId !== undefined && userId !== null)
1906
+ url_ += "userId=" + encodeURIComponent("" + userId) + "&";
1907
+ url_ = url_.replace(/[?&]$/, "");
1908
+ let options_ = {
1909
+ method: "GET",
1910
+ url: url_,
1911
+ headers: {
1912
+ "Accept": "text/plain"
1913
+ },
1914
+ cancelToken
1915
+ };
1916
+ return this.transformOptions(options_).then(transformedOptions_ => {
1917
+ return this.instance.request(transformedOptions_);
1918
+ }).catch((_error) => {
1919
+ if (isAxiosError(_error) && _error.response) {
1920
+ return _error.response;
1921
+ }
1922
+ else {
1923
+ throw _error;
1924
+ }
1925
+ }).then((_response) => {
1926
+ return this.transformResult(url_, _response, (_response) => this.processGet(_response));
1927
+ });
1928
+ }
1929
+ processGet(response) {
1930
+ const status = response.status;
1931
+ let _headers = {};
1932
+ if (response.headers && typeof response.headers === "object") {
1933
+ for (let k in response.headers) {
1934
+ if (response.headers.hasOwnProperty(k)) {
1935
+ _headers[k] = response.headers[k];
1936
+ }
1937
+ }
1938
+ }
1939
+ if (status === 200) {
1940
+ const _responseText = response.data;
1941
+ let result200 = null;
1942
+ let resultData200 = _responseText;
1943
+ result200 = JSON.parse(resultData200);
1944
+ return result200;
1945
+ }
1946
+ else if (status === 404) {
1947
+ const _responseText = response.data;
1948
+ let result404 = null;
1949
+ let resultData404 = _responseText;
1950
+ result404 = JSON.parse(resultData404);
1951
+ return throwException("Not Found", status, _responseText, _headers, result404);
1952
+ }
1953
+ else if (status === 401) {
1954
+ const _responseText = response.data;
1955
+ return throwException("Unauthorized", status, _responseText, _headers);
1956
+ }
1957
+ else if (status === 403) {
1958
+ const _responseText = response.data;
1959
+ return throwException("Forbidden", status, _responseText, _headers);
1960
+ }
1961
+ else if (status !== 200 && status !== 204) {
1962
+ const _responseText = response.data;
1963
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
1964
+ }
1965
+ return Promise.resolve(null);
1966
+ }
1967
+ }
1968
+ exports.StorefrontsApiClient = StorefrontsApiClient;
1969
+ class StorefrontUsersApiClient extends ApiClientBase {
1970
+ instance;
1971
+ baseUrl;
1972
+ jsonParseReviver = undefined;
1973
+ constructor(configuration, baseUrl, instance) {
1974
+ super(configuration);
1975
+ this.instance = instance ? instance : axios_1.default.create();
1976
+ this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : this.getBaseUrl("");
1977
+ }
1978
+ /**
1979
+ * Gets all storefront users relevant to specified query parameters
1980
+ * @param storefrontId Storefront identifier
1981
+ * @param storefrontUserId (optional) Storefront user identifier
1982
+ * @param skip (optional) Defines page start offset from beginning of sorted result list
1983
+ * @param take (optional) Defines page length (how much consequent items of sorted result list should be taken)
1984
+ * @param sorting (optional) Defines sorting order of result list e.g.: "Title ASC, LastModified DESC"
1985
+ * @param search (optional) Search string for partial match
1986
+ * @param tenantId (optional) Tenant identifier
1987
+ * @param userId (optional) User identifier
1988
+ * @return Success
1989
+ */
1990
+ getAll(storefrontId, storefrontUserId, skip, take, sorting, search, tenantId, userId, cancelToken) {
1991
+ let url_ = this.baseUrl + "/api/storefront/v1/storefront-users?";
1992
+ if (storefrontId === undefined || storefrontId === null)
1993
+ throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
1994
+ else
1995
+ url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
1996
+ if (storefrontUserId !== undefined && storefrontUserId !== null)
1997
+ url_ += "storefrontUserId=" + encodeURIComponent("" + storefrontUserId) + "&";
1998
+ if (skip !== undefined && skip !== null)
1999
+ url_ += "skip=" + encodeURIComponent("" + skip) + "&";
2000
+ if (take !== undefined && take !== null)
2001
+ url_ += "take=" + encodeURIComponent("" + take) + "&";
2002
+ if (sorting !== undefined && sorting !== null)
2003
+ url_ += "sorting=" + encodeURIComponent("" + sorting) + "&";
2004
+ if (search !== undefined && search !== null)
2005
+ url_ += "search=" + encodeURIComponent("" + search) + "&";
2006
+ if (tenantId !== undefined && tenantId !== null)
2007
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
2008
+ if (userId !== undefined && userId !== null)
2009
+ url_ += "userId=" + encodeURIComponent("" + userId) + "&";
2010
+ url_ = url_.replace(/[?&]$/, "");
2011
+ let options_ = {
2012
+ method: "GET",
2013
+ url: url_,
2014
+ headers: {
2015
+ "Accept": "text/plain"
2016
+ },
2017
+ cancelToken
2018
+ };
2019
+ return this.transformOptions(options_).then(transformedOptions_ => {
2020
+ return this.instance.request(transformedOptions_);
2021
+ }).catch((_error) => {
2022
+ if (isAxiosError(_error) && _error.response) {
2023
+ return _error.response;
2024
+ }
2025
+ else {
2026
+ throw _error;
2027
+ }
2028
+ }).then((_response) => {
2029
+ return this.transformResult(url_, _response, (_response) => this.processGetAll(_response));
2030
+ });
2031
+ }
2032
+ processGetAll(response) {
2033
+ const status = response.status;
2034
+ let _headers = {};
2035
+ if (response.headers && typeof response.headers === "object") {
2036
+ for (let k in response.headers) {
2037
+ if (response.headers.hasOwnProperty(k)) {
2038
+ _headers[k] = response.headers[k];
2039
+ }
2040
+ }
2041
+ }
2042
+ if (status === 200) {
2043
+ const _responseText = response.data;
2044
+ let result200 = null;
2045
+ let resultData200 = _responseText;
2046
+ result200 = JSON.parse(resultData200);
2047
+ return result200;
2048
+ }
2049
+ else if (status === 401) {
2050
+ const _responseText = response.data;
2051
+ return throwException("Unauthorized", status, _responseText, _headers);
2052
+ }
2053
+ else if (status === 403) {
2054
+ const _responseText = response.data;
2055
+ return throwException("Forbidden", status, _responseText, _headers);
2056
+ }
2057
+ else if (status !== 200 && status !== 204) {
2058
+ const _responseText = response.data;
2059
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
2060
+ }
2061
+ return Promise.resolve(null);
2062
+ }
2063
+ /**
2064
+ * Creates new storefront user
2065
+ * @param storefrontId Storefront identifier
2066
+ * @param tenantId (optional) Tenant identifier
2067
+ * @param userId (optional) User identifier
2068
+ * @param body (optional) Create operation parameters
2069
+ * @return Success
2070
+ */
2071
+ create(storefrontId, tenantId, userId, body, cancelToken) {
2072
+ let url_ = this.baseUrl + "/api/storefront/v1/storefront-users?";
2073
+ if (storefrontId === undefined || storefrontId === null)
2074
+ throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
2075
+ else
2076
+ url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
2077
+ if (tenantId !== undefined && tenantId !== null)
2078
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
2079
+ if (userId !== undefined && userId !== null)
2080
+ url_ += "userId=" + encodeURIComponent("" + userId) + "&";
2081
+ url_ = url_.replace(/[?&]$/, "");
2082
+ const content_ = JSON.stringify(body);
2083
+ let options_ = {
2084
+ data: content_,
2085
+ method: "POST",
2086
+ url: url_,
2087
+ headers: {
2088
+ "Content-Type": "application/json-patch+json",
2089
+ "Accept": "text/plain"
2090
+ },
2091
+ cancelToken
2092
+ };
2093
+ return this.transformOptions(options_).then(transformedOptions_ => {
2094
+ return this.instance.request(transformedOptions_);
2095
+ }).catch((_error) => {
2096
+ if (isAxiosError(_error) && _error.response) {
2097
+ return _error.response;
2098
+ }
2099
+ else {
2100
+ throw _error;
2101
+ }
2102
+ }).then((_response) => {
2103
+ return this.transformResult(url_, _response, (_response) => this.processCreate(_response));
2104
+ });
2105
+ }
2106
+ processCreate(response) {
2107
+ const status = response.status;
2108
+ let _headers = {};
2109
+ if (response.headers && typeof response.headers === "object") {
2110
+ for (let k in response.headers) {
2111
+ if (response.headers.hasOwnProperty(k)) {
2112
+ _headers[k] = response.headers[k];
2113
+ }
2114
+ }
2115
+ }
2116
+ if (status === 201) {
2117
+ const _responseText = response.data;
2118
+ let result201 = null;
2119
+ let resultData201 = _responseText;
2120
+ result201 = JSON.parse(resultData201);
2121
+ return result201;
2122
+ }
2123
+ else if (status === 401) {
2124
+ const _responseText = response.data;
2125
+ return throwException("Unauthorized", status, _responseText, _headers);
2126
+ }
2127
+ else if (status === 403) {
2128
+ const _responseText = response.data;
2129
+ return throwException("Forbidden", status, _responseText, _headers);
2130
+ }
2131
+ else if (status !== 200 && status !== 204) {
2132
+ const _responseText = response.data;
2133
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
2134
+ }
2135
+ return Promise.resolve(null);
2136
+ }
2137
+ /**
2138
+ * Gets storefront user by id
2139
+ * @param id Storefront user identifier
2140
+ * @param storefrontId Storefront identifier
2141
+ * @param tenantId (optional) Tenant identifier
2142
+ * @param userId (optional) User identifier
2143
+ * @return Success
2144
+ */
2145
+ get(id, storefrontId, tenantId, userId, cancelToken) {
2146
+ let url_ = this.baseUrl + "/api/storefront/v1/storefront-users/{id}?";
2147
+ if (id === undefined || id === null)
2148
+ throw new Error("The parameter 'id' must be defined.");
2149
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
2150
+ if (storefrontId === undefined || storefrontId === null)
2151
+ throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
2152
+ else
2153
+ url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
2154
+ if (tenantId !== undefined && tenantId !== null)
2155
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
2156
+ if (userId !== undefined && userId !== null)
2157
+ url_ += "userId=" + encodeURIComponent("" + userId) + "&";
2158
+ url_ = url_.replace(/[?&]$/, "");
2159
+ let options_ = {
2160
+ method: "GET",
2161
+ url: url_,
2162
+ headers: {
2163
+ "Accept": "text/plain"
2164
+ },
2165
+ cancelToken
2166
+ };
2167
+ return this.transformOptions(options_).then(transformedOptions_ => {
2168
+ return this.instance.request(transformedOptions_);
2169
+ }).catch((_error) => {
2170
+ if (isAxiosError(_error) && _error.response) {
2171
+ return _error.response;
2172
+ }
2173
+ else {
2174
+ throw _error;
2175
+ }
2176
+ }).then((_response) => {
2177
+ return this.transformResult(url_, _response, (_response) => this.processGet(_response));
2178
+ });
2179
+ }
2180
+ processGet(response) {
2181
+ const status = response.status;
2182
+ let _headers = {};
2183
+ if (response.headers && typeof response.headers === "object") {
2184
+ for (let k in response.headers) {
2185
+ if (response.headers.hasOwnProperty(k)) {
2186
+ _headers[k] = response.headers[k];
2187
+ }
2188
+ }
2189
+ }
2190
+ if (status === 200) {
2191
+ const _responseText = response.data;
2192
+ let result200 = null;
2193
+ let resultData200 = _responseText;
2194
+ result200 = JSON.parse(resultData200);
2195
+ return result200;
2196
+ }
2197
+ else if (status === 404) {
2198
+ const _responseText = response.data;
2199
+ let result404 = null;
2200
+ let resultData404 = _responseText;
2201
+ result404 = JSON.parse(resultData404);
2202
+ return throwException("Not Found", status, _responseText, _headers, result404);
2203
+ }
2204
+ else if (status === 401) {
2205
+ const _responseText = response.data;
2206
+ return throwException("Unauthorized", status, _responseText, _headers);
2207
+ }
2208
+ else if (status === 403) {
2209
+ const _responseText = response.data;
2210
+ return throwException("Forbidden", status, _responseText, _headers);
2211
+ }
2212
+ else if (status !== 200 && status !== 204) {
2213
+ const _responseText = response.data;
2214
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
2215
+ }
2216
+ return Promise.resolve(null);
2217
+ }
2218
+ /**
2219
+ * Merges anonymous storefront user data to regular storefront user account
2220
+ * @param storefrontId Storefront identifier
2221
+ * @param tenantId (optional) Tenant identifier
2222
+ * @param userId (optional) User identifier
2223
+ * @param body (optional) Merge operation parameters
2224
+ * @return Success
2225
+ */
2226
+ mergeAnonymous(storefrontId, tenantId, userId, body, cancelToken) {
2227
+ let url_ = this.baseUrl + "/api/storefront/v1/storefront-users/merge-anonymous?";
2228
+ if (storefrontId === undefined || storefrontId === null)
2229
+ throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
2230
+ else
2231
+ url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
2232
+ if (tenantId !== undefined && tenantId !== null)
2233
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
2234
+ if (userId !== undefined && userId !== null)
2235
+ url_ += "userId=" + encodeURIComponent("" + userId) + "&";
2236
+ url_ = url_.replace(/[?&]$/, "");
2237
+ const content_ = JSON.stringify(body);
2238
+ let options_ = {
2239
+ data: content_,
2240
+ method: "POST",
2241
+ url: url_,
2242
+ headers: {
2243
+ "Content-Type": "application/json-patch+json",
2244
+ },
2245
+ cancelToken
2246
+ };
2247
+ return this.transformOptions(options_).then(transformedOptions_ => {
2248
+ return this.instance.request(transformedOptions_);
2249
+ }).catch((_error) => {
2250
+ if (isAxiosError(_error) && _error.response) {
2251
+ return _error.response;
2252
+ }
2253
+ else {
2254
+ throw _error;
2255
+ }
2256
+ }).then((_response) => {
2257
+ return this.transformResult(url_, _response, (_response) => this.processMergeAnonymous(_response));
2258
+ });
2259
+ }
2260
+ processMergeAnonymous(response) {
2261
+ const status = response.status;
2262
+ let _headers = {};
2263
+ if (response.headers && typeof response.headers === "object") {
2264
+ for (let k in response.headers) {
2265
+ if (response.headers.hasOwnProperty(k)) {
2266
+ _headers[k] = response.headers[k];
2267
+ }
2268
+ }
2269
+ }
2270
+ if (status === 200) {
2271
+ const _responseText = response.data;
2272
+ return Promise.resolve(null);
2273
+ }
2274
+ else if (status === 404) {
2275
+ const _responseText = response.data;
2276
+ let result404 = null;
2277
+ let resultData404 = _responseText;
2278
+ result404 = JSON.parse(resultData404);
2279
+ return throwException("Not Found", status, _responseText, _headers, result404);
2280
+ }
2281
+ else if (status === 409) {
2282
+ const _responseText = response.data;
2283
+ let result409 = null;
2284
+ let resultData409 = _responseText;
2285
+ result409 = JSON.parse(resultData409);
2286
+ return throwException("Conflict", status, _responseText, _headers, result409);
2287
+ }
2288
+ else if (status === 401) {
2289
+ const _responseText = response.data;
2290
+ return throwException("Unauthorized", status, _responseText, _headers);
2291
+ }
2292
+ else if (status === 403) {
2293
+ const _responseText = response.data;
2294
+ return throwException("Forbidden", status, _responseText, _headers);
2295
+ }
2296
+ else if (status !== 200 && status !== 204) {
2297
+ const _responseText = response.data;
2298
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
2299
+ }
2300
+ return Promise.resolve(null);
2301
+ }
2302
+ /**
2303
+ * Gets storefront user token
2304
+ * @param storefrontUserId Storefront user identifier
2305
+ * @param storefrontId Storefront identifier
2306
+ * @param tenantId (optional) Tenant identifier
2307
+ * @param userId (optional) User identifier
2308
+ * @return Success
2309
+ */
2310
+ getToken(storefrontUserId, storefrontId, tenantId, userId, cancelToken) {
2311
+ let url_ = this.baseUrl + "/api/storefront/v1/storefront-users/token?";
2312
+ if (storefrontUserId === undefined || storefrontUserId === null)
2313
+ throw new Error("The parameter 'storefrontUserId' must be defined and cannot be null.");
2314
+ else
2315
+ url_ += "storefrontUserId=" + encodeURIComponent("" + storefrontUserId) + "&";
2316
+ if (storefrontId === undefined || storefrontId === null)
2317
+ throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
2318
+ else
2319
+ url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
2320
+ if (tenantId !== undefined && tenantId !== null)
2321
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
2322
+ if (userId !== undefined && userId !== null)
2323
+ url_ += "userId=" + encodeURIComponent("" + userId) + "&";
2324
+ url_ = url_.replace(/[?&]$/, "");
2325
+ let options_ = {
2326
+ method: "GET",
2327
+ url: url_,
2328
+ headers: {},
2329
+ cancelToken
2330
+ };
2331
+ return this.transformOptions(options_).then(transformedOptions_ => {
2332
+ return this.instance.request(transformedOptions_);
2333
+ }).catch((_error) => {
2334
+ if (isAxiosError(_error) && _error.response) {
2335
+ return _error.response;
2336
+ }
2337
+ else {
2338
+ throw _error;
2339
+ }
2340
+ }).then((_response) => {
2341
+ return this.transformResult(url_, _response, (_response) => this.processGetToken(_response));
2342
+ });
2343
+ }
2344
+ processGetToken(response) {
2345
+ const status = response.status;
2346
+ let _headers = {};
2347
+ if (response.headers && typeof response.headers === "object") {
2348
+ for (let k in response.headers) {
2349
+ if (response.headers.hasOwnProperty(k)) {
2350
+ _headers[k] = response.headers[k];
2351
+ }
2352
+ }
2353
+ }
2354
+ if (status === 201) {
2355
+ const _responseText = response.data;
2356
+ return Promise.resolve(null);
2357
+ }
2358
+ else if (status === 404) {
2359
+ const _responseText = response.data;
2360
+ let result404 = null;
2361
+ let resultData404 = _responseText;
2362
+ result404 = JSON.parse(resultData404);
2363
+ return throwException("Not Found", status, _responseText, _headers, result404);
2364
+ }
2365
+ else if (status === 409) {
2366
+ const _responseText = response.data;
2367
+ let result409 = null;
2368
+ let resultData409 = _responseText;
2369
+ result409 = JSON.parse(resultData409);
2370
+ return throwException("Conflict", status, _responseText, _headers, result409);
2371
+ }
2372
+ else if (status === 401) {
2373
+ const _responseText = response.data;
2374
+ return throwException("Unauthorized", status, _responseText, _headers);
2375
+ }
2376
+ else if (status === 403) {
2377
+ const _responseText = response.data;
2378
+ return throwException("Forbidden", status, _responseText, _headers);
2379
+ }
2380
+ else if (status !== 200 && status !== 204) {
2381
+ const _responseText = response.data;
2382
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
2383
+ }
2384
+ return Promise.resolve(null);
2385
+ }
2386
+ }
2387
+ exports.StorefrontUsersApiClient = StorefrontUsersApiClient;
2388
+ class TenantInfoApiClient extends ApiClientBase {
2389
+ instance;
2390
+ baseUrl;
2391
+ jsonParseReviver = undefined;
2392
+ constructor(configuration, baseUrl, instance) {
2393
+ super(configuration);
2394
+ this.instance = instance ? instance : axios_1.default.create();
2395
+ this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : this.getBaseUrl("");
2396
+ }
2397
+ /**
2398
+ * Gets information about tenant applications
2399
+ * @param tenantId (optional) Tenant identifier
2400
+ * @param userId (optional) User identifier
2401
+ * @return Success
2402
+ */
2403
+ getApplicationsInfo(tenantId, userId, cancelToken) {
2404
+ let url_ = this.baseUrl + "/api/storefront/v1/tenant-info/applications?";
2405
+ if (tenantId !== undefined && tenantId !== null)
2406
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
2407
+ if (userId !== undefined && userId !== null)
2408
+ url_ += "userId=" + encodeURIComponent("" + userId) + "&";
2409
+ url_ = url_.replace(/[?&]$/, "");
2410
+ let options_ = {
2411
+ method: "GET",
2412
+ url: url_,
2413
+ headers: {
2414
+ "Accept": "text/plain"
2415
+ },
2416
+ cancelToken
2417
+ };
2418
+ return this.transformOptions(options_).then(transformedOptions_ => {
2419
+ return this.instance.request(transformedOptions_);
2420
+ }).catch((_error) => {
2421
+ if (isAxiosError(_error) && _error.response) {
2422
+ return _error.response;
2423
+ }
2424
+ else {
2425
+ throw _error;
2426
+ }
2427
+ }).then((_response) => {
2428
+ return this.transformResult(url_, _response, (_response) => this.processGetApplicationsInfo(_response));
2429
+ });
2430
+ }
2431
+ processGetApplicationsInfo(response) {
2432
+ const status = response.status;
2433
+ let _headers = {};
2434
+ if (response.headers && typeof response.headers === "object") {
2435
+ for (let k in response.headers) {
2436
+ if (response.headers.hasOwnProperty(k)) {
2437
+ _headers[k] = response.headers[k];
2438
+ }
2439
+ }
2440
+ }
2441
+ if (status === 200) {
2442
+ const _responseText = response.data;
2443
+ let result200 = null;
2444
+ let resultData200 = _responseText;
2445
+ result200 = JSON.parse(resultData200);
2446
+ return result200;
2447
+ }
2448
+ else if (status === 401) {
2449
+ const _responseText = response.data;
2450
+ return throwException("Unauthorized", status, _responseText, _headers);
2451
+ }
2452
+ else if (status === 403) {
2453
+ const _responseText = response.data;
2454
+ return throwException("Forbidden", status, _responseText, _headers);
2455
+ }
2456
+ else if (status !== 200 && status !== 204) {
2457
+ const _responseText = response.data;
2458
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
2459
+ }
2460
+ return Promise.resolve(null);
2461
+ }
2462
+ /**
2463
+ * Gets information about tenant
2464
+ * @param tenantId (optional) Tenant identifier
2465
+ * @param userId (optional) User identifier
2466
+ * @return Success
2467
+ */
2468
+ getInfo(tenantId, userId, cancelToken) {
2469
+ let url_ = this.baseUrl + "/api/storefront/v1/tenant-info?";
2470
+ if (tenantId !== undefined && tenantId !== null)
2471
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
2472
+ if (userId !== undefined && userId !== null)
2473
+ url_ += "userId=" + encodeURIComponent("" + userId) + "&";
2474
+ url_ = url_.replace(/[?&]$/, "");
2475
+ let options_ = {
2476
+ method: "GET",
2477
+ url: url_,
2478
+ headers: {
2479
+ "Accept": "text/plain"
2480
+ },
2481
+ cancelToken
2482
+ };
2483
+ return this.transformOptions(options_).then(transformedOptions_ => {
2484
+ return this.instance.request(transformedOptions_);
2485
+ }).catch((_error) => {
2486
+ if (isAxiosError(_error) && _error.response) {
2487
+ return _error.response;
2488
+ }
2489
+ else {
2490
+ throw _error;
2491
+ }
2492
+ }).then((_response) => {
2493
+ return this.transformResult(url_, _response, (_response) => this.processGetInfo(_response));
2494
+ });
2495
+ }
2496
+ processGetInfo(response) {
2497
+ const status = response.status;
2498
+ let _headers = {};
2499
+ if (response.headers && typeof response.headers === "object") {
2500
+ for (let k in response.headers) {
2501
+ if (response.headers.hasOwnProperty(k)) {
2502
+ _headers[k] = response.headers[k];
2503
+ }
2504
+ }
2505
+ }
2506
+ if (status === 200) {
2507
+ const _responseText = response.data;
2508
+ let result200 = null;
2509
+ let resultData200 = _responseText;
2510
+ result200 = JSON.parse(resultData200);
2511
+ return result200;
2512
+ }
2513
+ else if (status === 401) {
2514
+ const _responseText = response.data;
2515
+ return throwException("Unauthorized", status, _responseText, _headers);
2516
+ }
2517
+ else if (status === 403) {
2518
+ const _responseText = response.data;
2519
+ return throwException("Forbidden", status, _responseText, _headers);
2520
+ }
2521
+ else if (status !== 200 && status !== 204) {
2522
+ const _responseText = response.data;
2523
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
2524
+ }
2525
+ return Promise.resolve(null);
2526
+ }
2527
+ }
2528
+ exports.TenantInfoApiClient = TenantInfoApiClient;
2529
+ /** Available date period filter values for queries */
2530
+ var DatePeriod;
2531
+ (function (DatePeriod) {
2532
+ DatePeriod["All"] = "All";
2533
+ DatePeriod["Today"] = "Today";
2534
+ DatePeriod["Last7Days"] = "Last7Days";
2535
+ DatePeriod["Last30Days"] = "Last30Days";
2536
+ })(DatePeriod = exports.DatePeriod || (exports.DatePeriod = {}));
2537
+ /** Storefront types */
2538
+ var StorefrontType;
2539
+ (function (StorefrontType) {
2540
+ StorefrontType["Custom"] = "Custom";
2541
+ StorefrontType["Shopify"] = "Shopify";
2542
+ StorefrontType["DocketManager"] = "DocketManager";
2543
+ StorefrontType["Auth0Saml"] = "Auth0Saml";
2544
+ })(StorefrontType = exports.StorefrontType || (exports.StorefrontType = {}));
2545
+ class ApiException extends Error {
2546
+ message;
2547
+ status;
2548
+ response;
2549
+ headers;
2550
+ result;
2551
+ constructor(message, status, response, headers, result) {
2552
+ super();
2553
+ this.message = message;
2554
+ this.status = status;
2555
+ this.response = response;
2556
+ this.headers = headers;
2557
+ this.result = result;
2558
+ }
2559
+ isApiException = true;
2560
+ static isApiException(obj) {
2561
+ return obj.isApiException === true;
2562
+ }
2563
+ }
2564
+ exports.ApiException = ApiException;
2565
+ function throwException(message, status, response, headers, result) {
2566
+ if (result !== null && result !== undefined)
2567
+ throw result;
2568
+ else
2569
+ throw new ApiException(message, status, response, headers, null);
2570
+ }
2571
+ function isAxiosError(obj) {
2572
+ return obj && obj.isAxiosError === true;
2573
+ }
2574
+ //# sourceMappingURL=storefront-api-client.js.map