@aurigma/axios-storefront-api-client 2.51.1 → 2.53.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -114,7 +114,7 @@ export class BuildInfoApiClient extends ApiClientBase {
114
114
  method: "GET",
115
115
  url: url_,
116
116
  headers: {
117
- "Accept": "text/plain"
117
+ "Accept": "application/json"
118
118
  },
119
119
  cancelToken
120
120
  };
@@ -187,7 +187,7 @@ export class ProcessingPipelinesApiClient extends ApiClientBase {
187
187
  method: "GET",
188
188
  url: url_,
189
189
  headers: {
190
- "Accept": "text/plain"
190
+ "Accept": "application/json"
191
191
  },
192
192
  cancelToken
193
193
  };
@@ -253,7 +253,7 @@ export class ProcessingPipelinesApiClient extends ApiClientBase {
253
253
  method: "GET",
254
254
  url: url_,
255
255
  headers: {
256
- "Accept": "text/plain"
256
+ "Accept": "application/json"
257
257
  },
258
258
  cancelToken
259
259
  };
@@ -309,7 +309,7 @@ export class ProcessingPipelinesApiClient extends ApiClientBase {
309
309
  return Promise.resolve(null);
310
310
  }
311
311
  }
312
- export class ProductReferencesApiClient extends ApiClientBase {
312
+ export class ProductLinksApiClient extends ApiClientBase {
313
313
  instance;
314
314
  baseUrl;
315
315
  jsonParseReviver = undefined;
@@ -319,10 +319,7 @@ export class ProductReferencesApiClient extends ApiClientBase {
319
319
  this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : this.getBaseUrl("");
320
320
  }
321
321
  /**
322
- * Returns all storefront product references relevant to the specified query parameters.
323
- * @param storefrontId Storefront identifier.
324
- * @param productReference (optional) Product reference filter. Product reference is an external reference to Customer's Canvas product specification, e.g online store product identifier.
325
- * @param productSpecificationId (optional) Cusomer's Canvas product specification filter.
322
+ * Returns all product links, relevant to the specified query parameters.
326
323
  * @param skip (optional) Defines page start offset from beginning of sorted result list.
327
324
  * @param take (optional) Defines page length (how many consequent items of sorted result list should be taken).
328
325
  * @param sorting (optional) Defines sorting order of result list e.g.: "Title ASC, LastModified DESC".
@@ -330,16 +327,8 @@ export class ProductReferencesApiClient extends ApiClientBase {
330
327
  * @param tenantId (optional) Tenant identifier.
331
328
  * @return Success
332
329
  */
333
- getAll(storefrontId, productReference, productSpecificationId, skip, take, sorting, search, tenantId, cancelToken) {
334
- let url_ = this.baseUrl + "/api/storefront/v1/product-references?";
335
- if (storefrontId === undefined || storefrontId === null)
336
- throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
337
- else
338
- url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
339
- if (productReference !== undefined && productReference !== null)
340
- url_ += "productReference=" + encodeURIComponent("" + productReference) + "&";
341
- if (productSpecificationId !== undefined && productSpecificationId !== null)
342
- url_ += "productSpecificationId=" + encodeURIComponent("" + productSpecificationId) + "&";
330
+ getAllProductLinks(skip, take, sorting, search, tenantId, cancelToken) {
331
+ let url_ = this.baseUrl + "/api/storefront/v1/product-links?";
343
332
  if (skip !== undefined && skip !== null)
344
333
  url_ += "skip=" + encodeURIComponent("" + skip) + "&";
345
334
  if (take !== undefined && take !== null)
@@ -355,7 +344,7 @@ export class ProductReferencesApiClient extends ApiClientBase {
355
344
  method: "GET",
356
345
  url: url_,
357
346
  headers: {
358
- "Accept": "text/plain"
347
+ "Accept": "application/json"
359
348
  },
360
349
  cancelToken
361
350
  };
@@ -369,10 +358,10 @@ export class ProductReferencesApiClient extends ApiClientBase {
369
358
  throw _error;
370
359
  }
371
360
  }).then((_response) => {
372
- return this.transformResult(url_, _response, (_response) => this.processGetAll(_response));
361
+ return this.transformResult(url_, _response, (_response) => this.processGetAllProductLinks(_response));
373
362
  });
374
363
  }
375
- processGetAll(response) {
364
+ processGetAllProductLinks(response) {
376
365
  const status = response.status;
377
366
  let _headers = {};
378
367
  if (response.headers && typeof response.headers === "object") {
@@ -404,29 +393,30 @@ export class ProductReferencesApiClient extends ApiClientBase {
404
393
  return Promise.resolve(null);
405
394
  }
406
395
  /**
407
- * Creates a new storefront product reference.
408
- * @param storefrontId Storefront identifier.
396
+ * Returns a product link by its identifier.
397
+ * @param id Product identifier.
398
+ * @param productLinkVersionId (optional) Product link version identifier. Optional
399
+ * @param productVersionId (optional) Product version identifier which represents linked product version. Optional
409
400
  * @param tenantId (optional) Tenant identifier.
410
- * @param body (optional) Create operation parameters.
411
401
  * @return Success
412
402
  */
413
- create(storefrontId, tenantId, body, cancelToken) {
414
- let url_ = this.baseUrl + "/api/storefront/v1/product-references?";
415
- if (storefrontId === undefined || storefrontId === null)
416
- throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
417
- else
418
- url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
403
+ getProductLink(id, productLinkVersionId, productVersionId, tenantId, cancelToken) {
404
+ let url_ = this.baseUrl + "/api/storefront/v1/product-links/{id}?";
405
+ if (id === undefined || id === null)
406
+ throw new Error("The parameter 'id' must be defined.");
407
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
408
+ if (productLinkVersionId !== undefined && productLinkVersionId !== null)
409
+ url_ += "productLinkVersionId=" + encodeURIComponent("" + productLinkVersionId) + "&";
410
+ if (productVersionId !== undefined && productVersionId !== null)
411
+ url_ += "productVersionId=" + encodeURIComponent("" + productVersionId) + "&";
419
412
  if (tenantId !== undefined && tenantId !== null)
420
413
  url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
421
414
  url_ = url_.replace(/[?&]$/, "");
422
- const content_ = JSON.stringify(body);
423
415
  let options_ = {
424
- data: content_,
425
- method: "POST",
416
+ method: "GET",
426
417
  url: url_,
427
418
  headers: {
428
- "Content-Type": "application/json-patch+json",
429
- "Accept": "text/plain"
419
+ "Accept": "application/json"
430
420
  },
431
421
  cancelToken
432
422
  };
@@ -440,10 +430,10 @@ export class ProductReferencesApiClient extends ApiClientBase {
440
430
  throw _error;
441
431
  }
442
432
  }).then((_response) => {
443
- return this.transformResult(url_, _response, (_response) => this.processCreate(_response));
433
+ return this.transformResult(url_, _response, (_response) => this.processGetProductLink(_response));
444
434
  });
445
435
  }
446
- processCreate(response) {
436
+ processGetProductLink(response) {
447
437
  const status = response.status;
448
438
  let _headers = {};
449
439
  if (response.headers && typeof response.headers === "object") {
@@ -453,12 +443,12 @@ export class ProductReferencesApiClient extends ApiClientBase {
453
443
  }
454
444
  }
455
445
  }
456
- if (status === 201) {
446
+ if (status === 200) {
457
447
  const _responseText = response.data;
458
- let result201 = null;
459
- let resultData201 = _responseText;
460
- result201 = JSON.parse(resultData201);
461
- return Promise.resolve(result201);
448
+ let result200 = null;
449
+ let resultData200 = _responseText;
450
+ result200 = JSON.parse(resultData200);
451
+ return Promise.resolve(result200);
462
452
  }
463
453
  else if (status === 404) {
464
454
  const _responseText = response.data;
@@ -467,6 +457,13 @@ export class ProductReferencesApiClient extends ApiClientBase {
467
457
  result404 = JSON.parse(resultData404);
468
458
  return throwException("Not Found", status, _responseText, _headers, result404);
469
459
  }
460
+ else if (status === 409) {
461
+ const _responseText = response.data;
462
+ let result409 = null;
463
+ let resultData409 = _responseText;
464
+ result409 = JSON.parse(resultData409);
465
+ return throwException("Conflict", status, _responseText, _headers, result409);
466
+ }
470
467
  else if (status === 401) {
471
468
  const _responseText = response.data;
472
469
  return throwException("Unauthorized", status, _responseText, _headers);
@@ -482,21 +479,28 @@ export class ProductReferencesApiClient extends ApiClientBase {
482
479
  return Promise.resolve(null);
483
480
  }
484
481
  /**
485
- * Returns a storefront product reference.
486
- * @param reference Product reference - external reference to Customer's Canvas product specification, e.g online store product identifier.
487
- * @param storefrontId Storefront identifier.
482
+ * Returns a product link summary by product link identifier.
483
+ * @param id Product link identifier.
484
+ * @param productLinkVersionId (optional) Product link version identifier.
485
+ * @param productVersionId (optional) Product link identifier.
486
+ * @param productVariantId (optional) Product variant identifier.
487
+ * @param sku (optional) Product variant SKU.
488
488
  * @param tenantId (optional) Tenant identifier.
489
489
  * @return Success
490
490
  */
491
- get(reference, storefrontId, tenantId, cancelToken) {
492
- let url_ = this.baseUrl + "/api/storefront/v1/product-references/{reference}?";
493
- if (reference === undefined || reference === null)
494
- throw new Error("The parameter 'reference' must be defined.");
495
- url_ = url_.replace("{reference}", encodeURIComponent("" + reference));
496
- if (storefrontId === undefined || storefrontId === null)
497
- throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
498
- else
499
- url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
491
+ getProductSummary(id, productLinkVersionId, productVersionId, productVariantId, sku, tenantId, cancelToken) {
492
+ let url_ = this.baseUrl + "/api/storefront/v1/product-links/{id}/summary?";
493
+ if (id === undefined || id === null)
494
+ throw new Error("The parameter 'id' must be defined.");
495
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
496
+ if (productLinkVersionId !== undefined && productLinkVersionId !== null)
497
+ url_ += "productLinkVersionId=" + encodeURIComponent("" + productLinkVersionId) + "&";
498
+ if (productVersionId !== undefined && productVersionId !== null)
499
+ url_ += "productVersionId=" + encodeURIComponent("" + productVersionId) + "&";
500
+ if (productVariantId !== undefined && productVariantId !== null)
501
+ url_ += "productVariantId=" + encodeURIComponent("" + productVariantId) + "&";
502
+ if (sku !== undefined && sku !== null)
503
+ url_ += "sku=" + encodeURIComponent("" + sku) + "&";
500
504
  if (tenantId !== undefined && tenantId !== null)
501
505
  url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
502
506
  url_ = url_.replace(/[?&]$/, "");
@@ -504,7 +508,7 @@ export class ProductReferencesApiClient extends ApiClientBase {
504
508
  method: "GET",
505
509
  url: url_,
506
510
  headers: {
507
- "Accept": "text/plain"
511
+ "Accept": "application/json"
508
512
  },
509
513
  cancelToken
510
514
  };
@@ -518,10 +522,10 @@ export class ProductReferencesApiClient extends ApiClientBase {
518
522
  throw _error;
519
523
  }
520
524
  }).then((_response) => {
521
- return this.transformResult(url_, _response, (_response) => this.processGet(_response));
525
+ return this.transformResult(url_, _response, (_response) => this.processGetProductSummary(_response));
522
526
  });
523
527
  }
524
- processGet(response) {
528
+ processGetProductSummary(response) {
525
529
  const status = response.status;
526
530
  let _headers = {};
527
531
  if (response.headers && typeof response.headers === "object") {
@@ -545,6 +549,13 @@ export class ProductReferencesApiClient extends ApiClientBase {
545
549
  result404 = JSON.parse(resultData404);
546
550
  return throwException("Not Found", status, _responseText, _headers, result404);
547
551
  }
552
+ else if (status === 409) {
553
+ const _responseText = response.data;
554
+ let result409 = null;
555
+ let resultData409 = _responseText;
556
+ result409 = JSON.parse(resultData409);
557
+ return throwException("Conflict", status, _responseText, _headers, result409);
558
+ }
548
559
  else if (status === 401) {
549
560
  const _responseText = response.data;
550
561
  return throwException("Unauthorized", status, _responseText, _headers);
@@ -560,29 +571,33 @@ export class ProductReferencesApiClient extends ApiClientBase {
560
571
  return Promise.resolve(null);
561
572
  }
562
573
  /**
563
- * Deletes the storefront product reference.
564
- * @param reference Product reference - external reference to Customer's Canvas product specification, e.g online store product identifier.
565
- * @param storefrontId Storefront identifier.
574
+ * Returns a product link personalization workflow description by product link identifier.
575
+ * @param id Product link identifier.
576
+ * @param productLinkVersionId (optional) Product link version identifier.
577
+ * @param productVersionId (optional) Product version identifier.
578
+ * @param productFilterId (optional) Product filter identifier.
566
579
  * @param tenantId (optional) Tenant identifier.
567
580
  * @return Success
568
581
  */
569
- delete(reference, storefrontId, tenantId, cancelToken) {
570
- let url_ = this.baseUrl + "/api/storefront/v1/product-references/{reference}?";
571
- if (reference === undefined || reference === null)
572
- throw new Error("The parameter 'reference' must be defined.");
573
- url_ = url_.replace("{reference}", encodeURIComponent("" + reference));
574
- if (storefrontId === undefined || storefrontId === null)
575
- throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
576
- else
577
- url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
582
+ getPersonalizationWorkflow(id, productLinkVersionId, productVersionId, productFilterId, tenantId, cancelToken) {
583
+ let url_ = this.baseUrl + "/api/storefront/v1/product-links/{id}/personalization-workflow?";
584
+ if (id === undefined || id === null)
585
+ throw new Error("The parameter 'id' must be defined.");
586
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
587
+ if (productLinkVersionId !== undefined && productLinkVersionId !== null)
588
+ url_ += "productLinkVersionId=" + encodeURIComponent("" + productLinkVersionId) + "&";
589
+ if (productVersionId !== undefined && productVersionId !== null)
590
+ url_ += "productVersionId=" + encodeURIComponent("" + productVersionId) + "&";
591
+ if (productFilterId !== undefined && productFilterId !== null)
592
+ url_ += "productFilterId=" + encodeURIComponent("" + productFilterId) + "&";
578
593
  if (tenantId !== undefined && tenantId !== null)
579
594
  url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
580
595
  url_ = url_.replace(/[?&]$/, "");
581
596
  let options_ = {
582
- method: "DELETE",
597
+ method: "GET",
583
598
  url: url_,
584
599
  headers: {
585
- "Accept": "text/plain"
600
+ "Accept": "application/json"
586
601
  },
587
602
  cancelToken
588
603
  };
@@ -596,10 +611,10 @@ export class ProductReferencesApiClient extends ApiClientBase {
596
611
  throw _error;
597
612
  }
598
613
  }).then((_response) => {
599
- return this.transformResult(url_, _response, (_response) => this.processDelete(_response));
614
+ return this.transformResult(url_, _response, (_response) => this.processGetPersonalizationWorkflow(_response));
600
615
  });
601
616
  }
602
- processDelete(response) {
617
+ processGetPersonalizationWorkflow(response) {
603
618
  const status = response.status;
604
619
  let _headers = {};
605
620
  if (response.headers && typeof response.headers === "object") {
@@ -623,6 +638,13 @@ export class ProductReferencesApiClient extends ApiClientBase {
623
638
  result404 = JSON.parse(resultData404);
624
639
  return throwException("Not Found", status, _responseText, _headers, result404);
625
640
  }
641
+ else if (status === 409) {
642
+ const _responseText = response.data;
643
+ let result409 = null;
644
+ let resultData409 = _responseText;
645
+ result409 = JSON.parse(resultData409);
646
+ return throwException("Conflict", status, _responseText, _headers, result409);
647
+ }
626
648
  else if (status === 401) {
627
649
  const _responseText = response.data;
628
650
  return throwException("Unauthorized", status, _responseText, _headers);
@@ -637,22 +659,62 @@ export class ProductReferencesApiClient extends ApiClientBase {
637
659
  }
638
660
  return Promise.resolve(null);
639
661
  }
662
+ }
663
+ export class ProductReferencesApiClient extends ApiClientBase {
664
+ instance;
665
+ baseUrl;
666
+ jsonParseReviver = undefined;
667
+ constructor(configuration, baseUrl, instance) {
668
+ super(configuration);
669
+ this.instance = instance ? instance : axios.create();
670
+ this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : this.getBaseUrl("");
671
+ }
640
672
  /**
641
- * Returns a product specification by the storefront product reference.
642
- * @param reference Product reference - external reference to Customer's Canvas product specification, e.g online store product identifier.
673
+ * Returns all storefront product references relevant to the specified query parameters.
643
674
  * @param storefrontId Storefront identifier.
675
+ * @param productReference (optional) Product reference filter.
676
+ Product reference is an external reference to Customer's Canvas product, e.g online store product identifier.
677
+ * @param productSpecificationId (optional) Customer's Canvas product specification filter.
678
+ * @param productId (optional) Customer's Canvas product filter.
679
+ * @param productLinkId (optional) Customer's Canvas product link filter.
680
+ * @param skip (optional) Defines page start offset from beginning of sorted result list.
681
+ * @param take (optional) Defines page length (how many consequent items of sorted result list should be taken).
682
+ * @param sorting (optional) Defines sorting order of result list e.g.: "Title ASC, LastModified DESC".
683
+ * @param search (optional) Search string for partial match.
684
+ * @param sku (optional) SKU filter.
685
+ * @param tags (optional) List of tags that product should have.
686
+ * @param customFields (optional) Serialized custom fields dictionary filter. For example: {"public":"true","name":"my item"}.
644
687
  * @param tenantId (optional) Tenant identifier.
645
688
  * @return Success
646
689
  */
647
- getProductSpecification(reference, storefrontId, tenantId, cancelToken) {
648
- let url_ = this.baseUrl + "/api/storefront/v1/product-references/{reference}/product-specification?";
649
- if (reference === undefined || reference === null)
650
- throw new Error("The parameter 'reference' must be defined.");
651
- url_ = url_.replace("{reference}", encodeURIComponent("" + reference));
690
+ getAll(storefrontId, productReference, productSpecificationId, productId, productLinkId, skip, take, sorting, search, sku, tags, customFields, tenantId, cancelToken) {
691
+ let url_ = this.baseUrl + "/api/storefront/v1/product-references?";
652
692
  if (storefrontId === undefined || storefrontId === null)
653
693
  throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
654
694
  else
655
695
  url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
696
+ if (productReference !== undefined && productReference !== null)
697
+ url_ += "productReference=" + encodeURIComponent("" + productReference) + "&";
698
+ if (productSpecificationId !== undefined && productSpecificationId !== null)
699
+ url_ += "productSpecificationId=" + encodeURIComponent("" + productSpecificationId) + "&";
700
+ if (productId !== undefined && productId !== null)
701
+ url_ += "productId=" + encodeURIComponent("" + productId) + "&";
702
+ if (productLinkId !== undefined && productLinkId !== null)
703
+ url_ += "productLinkId=" + encodeURIComponent("" + productLinkId) + "&";
704
+ if (skip !== undefined && skip !== null)
705
+ url_ += "skip=" + encodeURIComponent("" + skip) + "&";
706
+ if (take !== undefined && take !== null)
707
+ url_ += "take=" + encodeURIComponent("" + take) + "&";
708
+ if (sorting !== undefined && sorting !== null)
709
+ url_ += "sorting=" + encodeURIComponent("" + sorting) + "&";
710
+ if (search !== undefined && search !== null)
711
+ url_ += "search=" + encodeURIComponent("" + search) + "&";
712
+ if (sku !== undefined && sku !== null)
713
+ url_ += "sku=" + encodeURIComponent("" + sku) + "&";
714
+ if (tags !== undefined && tags !== null)
715
+ tags && tags.forEach(item => { url_ += "tags=" + encodeURIComponent("" + item) + "&"; });
716
+ if (customFields !== undefined && customFields !== null)
717
+ url_ += "customFields=" + encodeURIComponent("" + customFields) + "&";
656
718
  if (tenantId !== undefined && tenantId !== null)
657
719
  url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
658
720
  url_ = url_.replace(/[?&]$/, "");
@@ -660,7 +722,7 @@ export class ProductReferencesApiClient extends ApiClientBase {
660
722
  method: "GET",
661
723
  url: url_,
662
724
  headers: {
663
- "Accept": "text/plain"
725
+ "Accept": "application/json"
664
726
  },
665
727
  cancelToken
666
728
  };
@@ -674,10 +736,10 @@ export class ProductReferencesApiClient extends ApiClientBase {
674
736
  throw _error;
675
737
  }
676
738
  }).then((_response) => {
677
- return this.transformResult(url_, _response, (_response) => this.processGetProductSpecification(_response));
739
+ return this.transformResult(url_, _response, (_response) => this.processGetAll(_response));
678
740
  });
679
741
  }
680
- processGetProductSpecification(response) {
742
+ processGetAll(response) {
681
743
  const status = response.status;
682
744
  let _headers = {};
683
745
  if (response.headers && typeof response.headers === "object") {
@@ -694,12 +756,12 @@ export class ProductReferencesApiClient extends ApiClientBase {
694
756
  result200 = JSON.parse(resultData200);
695
757
  return Promise.resolve(result200);
696
758
  }
697
- else if (status === 404) {
759
+ else if (status === 409) {
698
760
  const _responseText = response.data;
699
- let result404 = null;
700
- let resultData404 = _responseText;
701
- result404 = JSON.parse(resultData404);
702
- return throwException("Not Found", status, _responseText, _headers, result404);
761
+ let result409 = null;
762
+ let resultData409 = _responseText;
763
+ result409 = JSON.parse(resultData409);
764
+ return throwException("Conflict", status, _responseText, _headers, result409);
703
765
  }
704
766
  else if (status === 401) {
705
767
  const _responseText = response.data;
@@ -716,45 +778,29 @@ export class ProductReferencesApiClient extends ApiClientBase {
716
778
  return Promise.resolve(null);
717
779
  }
718
780
  /**
719
- * Returns a product cost details from ecommerce system.
720
- * @param reference Product reference - external reference to Customer's Canvas product product specification, e.g online store product identifier.
721
- * @param sku Product SKU.
781
+ * Creates a new storefront product reference.
722
782
  * @param storefrontId Storefront identifier.
723
- * @param storefrontUserId (optional) Storefront user identifier.
724
- * @param currencyCode (optional) Product cost currency code.
725
- * @param quantity (optional) Product quantity.
726
783
  * @param tenantId (optional) Tenant identifier.
784
+ * @param body (optional) Create operation parameters.
727
785
  * @return Success
728
786
  */
729
- getProductCostDetails(reference, sku, storefrontId, storefrontUserId, currencyCode, quantity, tenantId, cancelToken) {
730
- let url_ = this.baseUrl + "/api/storefront/v1/product-references/{reference}/product-cost-details?";
731
- if (reference === undefined || reference === null)
732
- throw new Error("The parameter 'reference' must be defined.");
733
- url_ = url_.replace("{reference}", encodeURIComponent("" + reference));
734
- if (sku === undefined || sku === null)
735
- throw new Error("The parameter 'sku' must be defined and cannot be null.");
736
- else
737
- url_ += "sku=" + encodeURIComponent("" + sku) + "&";
787
+ create(storefrontId, tenantId, body, cancelToken) {
788
+ let url_ = this.baseUrl + "/api/storefront/v1/product-references?";
738
789
  if (storefrontId === undefined || storefrontId === null)
739
790
  throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
740
791
  else
741
792
  url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
742
- if (storefrontUserId !== undefined && storefrontUserId !== null)
743
- url_ += "storefrontUserId=" + encodeURIComponent("" + storefrontUserId) + "&";
744
- if (currencyCode !== undefined && currencyCode !== null)
745
- url_ += "currencyCode=" + encodeURIComponent("" + currencyCode) + "&";
746
- if (quantity === null)
747
- throw new Error("The parameter 'quantity' cannot be null.");
748
- else if (quantity !== undefined)
749
- url_ += "quantity=" + encodeURIComponent("" + quantity) + "&";
750
793
  if (tenantId !== undefined && tenantId !== null)
751
794
  url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
752
795
  url_ = url_.replace(/[?&]$/, "");
796
+ const content_ = JSON.stringify(body);
753
797
  let options_ = {
754
- method: "GET",
798
+ data: content_,
799
+ method: "POST",
755
800
  url: url_,
756
801
  headers: {
757
- "Accept": "text/plain"
802
+ "Content-Type": "application/json",
803
+ "Accept": "application/json"
758
804
  },
759
805
  cancelToken
760
806
  };
@@ -768,10 +814,10 @@ export class ProductReferencesApiClient extends ApiClientBase {
768
814
  throw _error;
769
815
  }
770
816
  }).then((_response) => {
771
- return this.transformResult(url_, _response, (_response) => this.processGetProductCostDetails(_response));
817
+ return this.transformResult(url_, _response, (_response) => this.processCreate(_response));
772
818
  });
773
819
  }
774
- processGetProductCostDetails(response) {
820
+ processCreate(response) {
775
821
  const status = response.status;
776
822
  let _headers = {};
777
823
  if (response.headers && typeof response.headers === "object") {
@@ -781,12 +827,12 @@ export class ProductReferencesApiClient extends ApiClientBase {
781
827
  }
782
828
  }
783
829
  }
784
- if (status === 200) {
830
+ if (status === 201) {
785
831
  const _responseText = response.data;
786
- let result200 = null;
787
- let resultData200 = _responseText;
788
- result200 = JSON.parse(resultData200);
789
- return Promise.resolve(result200);
832
+ let result201 = null;
833
+ let resultData201 = _responseText;
834
+ result201 = JSON.parse(resultData201);
835
+ return Promise.resolve(result201);
790
836
  }
791
837
  else if (status === 404) {
792
838
  const _responseText = response.data;
@@ -795,6 +841,13 @@ export class ProductReferencesApiClient extends ApiClientBase {
795
841
  result404 = JSON.parse(resultData404);
796
842
  return throwException("Not Found", status, _responseText, _headers, result404);
797
843
  }
844
+ else if (status === 409) {
845
+ const _responseText = response.data;
846
+ let result409 = null;
847
+ let resultData409 = _responseText;
848
+ result409 = JSON.parse(resultData409);
849
+ return throwException("Conflict", status, _responseText, _headers, result409);
850
+ }
798
851
  else if (status === 401) {
799
852
  const _responseText = response.data;
800
853
  return throwException("Unauthorized", status, _responseText, _headers);
@@ -810,21 +863,51 @@ export class ProductReferencesApiClient extends ApiClientBase {
810
863
  return Promise.resolve(null);
811
864
  }
812
865
  /**
813
- * Returns a product personalization workflow description by product specification identifier.
814
- * @param reference Product reference - external reference to Customer's Canvas product specification, e.g online store product identifier.
815
- * @param storefrontId (optional) Storefront identifier.
866
+ * Returns a list of product specifications associated with storefront product references relevant to the specified query parameters.
867
+ * @param storefrontId Storefront identifier.
868
+ * @param productReference (optional) Product reference filter.
869
+ Product reference is an external reference to Customer's Canvas product, e.g online store product identifier.
870
+ * @param productSpecificationId (optional) Customer's Canvas product specification filter.
871
+ * @param productId (optional) Customer's Canvas product filter.
872
+ * @param productLinkId (optional) Customer's Canvas product link filter.
873
+ * @param skip (optional) Defines page start offset from beginning of sorted result list.
874
+ * @param take (optional) Defines page length (how many consequent items of sorted result list should be taken).
875
+ * @param sorting (optional) Defines sorting order of result list e.g.: "Title ASC, LastModified DESC".
876
+ * @param search (optional) Search string for partial match.
877
+ * @param sku (optional) SKU filter.
878
+ * @param tags (optional) List of tags that product should have.
879
+ * @param customFields (optional) Serialized custom fields dictionary filter. For example: {"public":"true","name":"my item"}.
816
880
  * @param tenantId (optional) Tenant identifier.
817
881
  * @return Success
818
882
  */
819
- getPersonalizationWorkflow(reference, storefrontId, tenantId, cancelToken) {
820
- let url_ = this.baseUrl + "/api/storefront/v1/product-references/{reference}/personalization-workflow?";
821
- if (reference === undefined || reference === null)
822
- throw new Error("The parameter 'reference' must be defined.");
823
- url_ = url_.replace("{reference}", encodeURIComponent("" + reference));
824
- if (storefrontId === null)
825
- throw new Error("The parameter 'storefrontId' cannot be null.");
826
- else if (storefrontId !== undefined)
883
+ getAllProductSpecifications(storefrontId, productReference, productSpecificationId, productId, productLinkId, skip, take, sorting, search, sku, tags, customFields, tenantId, cancelToken) {
884
+ let url_ = this.baseUrl + "/api/storefront/v1/product-references/product-specifications?";
885
+ if (storefrontId === undefined || storefrontId === null)
886
+ throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
887
+ else
827
888
  url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
889
+ if (productReference !== undefined && productReference !== null)
890
+ url_ += "productReference=" + encodeURIComponent("" + productReference) + "&";
891
+ if (productSpecificationId !== undefined && productSpecificationId !== null)
892
+ url_ += "productSpecificationId=" + encodeURIComponent("" + productSpecificationId) + "&";
893
+ if (productId !== undefined && productId !== null)
894
+ url_ += "productId=" + encodeURIComponent("" + productId) + "&";
895
+ if (productLinkId !== undefined && productLinkId !== null)
896
+ url_ += "productLinkId=" + encodeURIComponent("" + productLinkId) + "&";
897
+ if (skip !== undefined && skip !== null)
898
+ url_ += "skip=" + encodeURIComponent("" + skip) + "&";
899
+ if (take !== undefined && take !== null)
900
+ url_ += "take=" + encodeURIComponent("" + take) + "&";
901
+ if (sorting !== undefined && sorting !== null)
902
+ url_ += "sorting=" + encodeURIComponent("" + sorting) + "&";
903
+ if (search !== undefined && search !== null)
904
+ url_ += "search=" + encodeURIComponent("" + search) + "&";
905
+ if (sku !== undefined && sku !== null)
906
+ url_ += "sku=" + encodeURIComponent("" + sku) + "&";
907
+ if (tags !== undefined && tags !== null)
908
+ tags && tags.forEach(item => { url_ += "tags=" + encodeURIComponent("" + item) + "&"; });
909
+ if (customFields !== undefined && customFields !== null)
910
+ url_ += "customFields=" + encodeURIComponent("" + customFields) + "&";
828
911
  if (tenantId !== undefined && tenantId !== null)
829
912
  url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
830
913
  url_ = url_.replace(/[?&]$/, "");
@@ -832,7 +915,2126 @@ export class ProductReferencesApiClient extends ApiClientBase {
832
915
  method: "GET",
833
916
  url: url_,
834
917
  headers: {
835
- "Accept": "text/plain"
918
+ "Accept": "application/json"
919
+ },
920
+ cancelToken
921
+ };
922
+ return this.transformOptions(options_).then(transformedOptions_ => {
923
+ return this.instance.request(transformedOptions_);
924
+ }).catch((_error) => {
925
+ if (isAxiosError(_error) && _error.response) {
926
+ return _error.response;
927
+ }
928
+ else {
929
+ throw _error;
930
+ }
931
+ }).then((_response) => {
932
+ return this.transformResult(url_, _response, (_response) => this.processGetAllProductSpecifications(_response));
933
+ });
934
+ }
935
+ processGetAllProductSpecifications(response) {
936
+ const status = response.status;
937
+ let _headers = {};
938
+ if (response.headers && typeof response.headers === "object") {
939
+ for (let k in response.headers) {
940
+ if (response.headers.hasOwnProperty(k)) {
941
+ _headers[k] = response.headers[k];
942
+ }
943
+ }
944
+ }
945
+ if (status === 200) {
946
+ const _responseText = response.data;
947
+ let result200 = null;
948
+ let resultData200 = _responseText;
949
+ result200 = JSON.parse(resultData200);
950
+ return Promise.resolve(result200);
951
+ }
952
+ else if (status === 409) {
953
+ const _responseText = response.data;
954
+ let result409 = null;
955
+ let resultData409 = _responseText;
956
+ result409 = JSON.parse(resultData409);
957
+ return throwException("Conflict", status, _responseText, _headers, result409);
958
+ }
959
+ else if (status === 401) {
960
+ const _responseText = response.data;
961
+ return throwException("Unauthorized", status, _responseText, _headers);
962
+ }
963
+ else if (status === 403) {
964
+ const _responseText = response.data;
965
+ return throwException("Forbidden", status, _responseText, _headers);
966
+ }
967
+ else if (status !== 200 && status !== 204) {
968
+ const _responseText = response.data;
969
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
970
+ }
971
+ return Promise.resolve(null);
972
+ }
973
+ /**
974
+ * Returns a list of products associated with storefront product references relevant to the specified query parameters.
975
+ * @param storefrontId Storefront identifier.
976
+ * @param productReference (optional) Product reference filter.
977
+ Product reference is an external reference to Customer's Canvas product, e.g online store product identifier.
978
+ * @param productSpecificationId (optional) Customer's Canvas product specification filter.
979
+ * @param productId (optional) Customer's Canvas product filter.
980
+ * @param productLinkId (optional) Customer's Canvas product link filter.
981
+ * @param skip (optional) Defines page start offset from beginning of sorted result list.
982
+ * @param take (optional) Defines page length (how many consequent items of sorted result list should be taken).
983
+ * @param sorting (optional) Defines sorting order of result list e.g.: "Title ASC, LastModified DESC".
984
+ * @param search (optional) Search string for partial match.
985
+ * @param sku (optional) SKU filter.
986
+ * @param tags (optional) List of tags that product should have.
987
+ * @param customFields (optional) Serialized custom fields dictionary filter. For example: {"public":"true","name":"my item"}.
988
+ * @param tenantId (optional) Tenant identifier.
989
+ * @return Success
990
+ */
991
+ getAllProducts(storefrontId, productReference, productSpecificationId, productId, productLinkId, skip, take, sorting, search, sku, tags, customFields, tenantId, cancelToken) {
992
+ let url_ = this.baseUrl + "/api/storefront/v1/product-references/products?";
993
+ if (storefrontId === undefined || storefrontId === null)
994
+ throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
995
+ else
996
+ url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
997
+ if (productReference !== undefined && productReference !== null)
998
+ url_ += "productReference=" + encodeURIComponent("" + productReference) + "&";
999
+ if (productSpecificationId !== undefined && productSpecificationId !== null)
1000
+ url_ += "productSpecificationId=" + encodeURIComponent("" + productSpecificationId) + "&";
1001
+ if (productId !== undefined && productId !== null)
1002
+ url_ += "productId=" + encodeURIComponent("" + productId) + "&";
1003
+ if (productLinkId !== undefined && productLinkId !== null)
1004
+ url_ += "productLinkId=" + encodeURIComponent("" + productLinkId) + "&";
1005
+ if (skip !== undefined && skip !== null)
1006
+ url_ += "skip=" + encodeURIComponent("" + skip) + "&";
1007
+ if (take !== undefined && take !== null)
1008
+ url_ += "take=" + encodeURIComponent("" + take) + "&";
1009
+ if (sorting !== undefined && sorting !== null)
1010
+ url_ += "sorting=" + encodeURIComponent("" + sorting) + "&";
1011
+ if (search !== undefined && search !== null)
1012
+ url_ += "search=" + encodeURIComponent("" + search) + "&";
1013
+ if (sku !== undefined && sku !== null)
1014
+ url_ += "sku=" + encodeURIComponent("" + sku) + "&";
1015
+ if (tags !== undefined && tags !== null)
1016
+ tags && tags.forEach(item => { url_ += "tags=" + encodeURIComponent("" + item) + "&"; });
1017
+ if (customFields !== undefined && customFields !== null)
1018
+ url_ += "customFields=" + encodeURIComponent("" + customFields) + "&";
1019
+ if (tenantId !== undefined && tenantId !== null)
1020
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
1021
+ url_ = url_.replace(/[?&]$/, "");
1022
+ let options_ = {
1023
+ method: "GET",
1024
+ url: url_,
1025
+ headers: {
1026
+ "Accept": "application/json"
1027
+ },
1028
+ cancelToken
1029
+ };
1030
+ return this.transformOptions(options_).then(transformedOptions_ => {
1031
+ return this.instance.request(transformedOptions_);
1032
+ }).catch((_error) => {
1033
+ if (isAxiosError(_error) && _error.response) {
1034
+ return _error.response;
1035
+ }
1036
+ else {
1037
+ throw _error;
1038
+ }
1039
+ }).then((_response) => {
1040
+ return this.transformResult(url_, _response, (_response) => this.processGetAllProducts(_response));
1041
+ });
1042
+ }
1043
+ processGetAllProducts(response) {
1044
+ const status = response.status;
1045
+ let _headers = {};
1046
+ if (response.headers && typeof response.headers === "object") {
1047
+ for (let k in response.headers) {
1048
+ if (response.headers.hasOwnProperty(k)) {
1049
+ _headers[k] = response.headers[k];
1050
+ }
1051
+ }
1052
+ }
1053
+ if (status === 200) {
1054
+ const _responseText = response.data;
1055
+ let result200 = null;
1056
+ let resultData200 = _responseText;
1057
+ result200 = JSON.parse(resultData200);
1058
+ return Promise.resolve(result200);
1059
+ }
1060
+ else if (status === 409) {
1061
+ const _responseText = response.data;
1062
+ let result409 = null;
1063
+ let resultData409 = _responseText;
1064
+ result409 = JSON.parse(resultData409);
1065
+ return throwException("Conflict", status, _responseText, _headers, result409);
1066
+ }
1067
+ else if (status === 401) {
1068
+ const _responseText = response.data;
1069
+ return throwException("Unauthorized", status, _responseText, _headers);
1070
+ }
1071
+ else if (status === 403) {
1072
+ const _responseText = response.data;
1073
+ return throwException("Forbidden", status, _responseText, _headers);
1074
+ }
1075
+ else if (status !== 200 && status !== 204) {
1076
+ const _responseText = response.data;
1077
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
1078
+ }
1079
+ return Promise.resolve(null);
1080
+ }
1081
+ /**
1082
+ * Returns a list of product links associated with storefront product references relevant to the specified query parameters.
1083
+ * @param storefrontId Storefront identifier.
1084
+ * @param productReference (optional) Product reference filter.
1085
+ Product reference is an external reference to Customer's Canvas product, e.g online store product identifier.
1086
+ * @param productSpecificationId (optional) Customer's Canvas product specification filter.
1087
+ * @param productId (optional) Customer's Canvas product filter.
1088
+ * @param productLinkId (optional) Customer's Canvas product link filter.
1089
+ * @param skip (optional) Defines page start offset from beginning of sorted result list.
1090
+ * @param take (optional) Defines page length (how many consequent items of sorted result list should be taken).
1091
+ * @param sorting (optional) Defines sorting order of result list e.g.: "Title ASC, LastModified DESC".
1092
+ * @param search (optional) Search string for partial match.
1093
+ * @param sku (optional) SKU filter.
1094
+ * @param tags (optional) List of tags that product should have.
1095
+ * @param customFields (optional) Serialized custom fields dictionary filter. For example: {"public":"true","name":"my item"}.
1096
+ * @param tenantId (optional) Tenant identifier.
1097
+ * @return Success
1098
+ */
1099
+ getAllProductLinks(storefrontId, productReference, productSpecificationId, productId, productLinkId, skip, take, sorting, search, sku, tags, customFields, tenantId, cancelToken) {
1100
+ let url_ = this.baseUrl + "/api/storefront/v1/product-references/product-links?";
1101
+ if (storefrontId === undefined || storefrontId === null)
1102
+ throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
1103
+ else
1104
+ url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
1105
+ if (productReference !== undefined && productReference !== null)
1106
+ url_ += "productReference=" + encodeURIComponent("" + productReference) + "&";
1107
+ if (productSpecificationId !== undefined && productSpecificationId !== null)
1108
+ url_ += "productSpecificationId=" + encodeURIComponent("" + productSpecificationId) + "&";
1109
+ if (productId !== undefined && productId !== null)
1110
+ url_ += "productId=" + encodeURIComponent("" + productId) + "&";
1111
+ if (productLinkId !== undefined && productLinkId !== null)
1112
+ url_ += "productLinkId=" + encodeURIComponent("" + productLinkId) + "&";
1113
+ if (skip !== undefined && skip !== null)
1114
+ url_ += "skip=" + encodeURIComponent("" + skip) + "&";
1115
+ if (take !== undefined && take !== null)
1116
+ url_ += "take=" + encodeURIComponent("" + take) + "&";
1117
+ if (sorting !== undefined && sorting !== null)
1118
+ url_ += "sorting=" + encodeURIComponent("" + sorting) + "&";
1119
+ if (search !== undefined && search !== null)
1120
+ url_ += "search=" + encodeURIComponent("" + search) + "&";
1121
+ if (sku !== undefined && sku !== null)
1122
+ url_ += "sku=" + encodeURIComponent("" + sku) + "&";
1123
+ if (tags !== undefined && tags !== null)
1124
+ tags && tags.forEach(item => { url_ += "tags=" + encodeURIComponent("" + item) + "&"; });
1125
+ if (customFields !== undefined && customFields !== null)
1126
+ url_ += "customFields=" + encodeURIComponent("" + customFields) + "&";
1127
+ if (tenantId !== undefined && tenantId !== null)
1128
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
1129
+ url_ = url_.replace(/[?&]$/, "");
1130
+ let options_ = {
1131
+ method: "GET",
1132
+ url: url_,
1133
+ headers: {
1134
+ "Accept": "application/json"
1135
+ },
1136
+ cancelToken
1137
+ };
1138
+ return this.transformOptions(options_).then(transformedOptions_ => {
1139
+ return this.instance.request(transformedOptions_);
1140
+ }).catch((_error) => {
1141
+ if (isAxiosError(_error) && _error.response) {
1142
+ return _error.response;
1143
+ }
1144
+ else {
1145
+ throw _error;
1146
+ }
1147
+ }).then((_response) => {
1148
+ return this.transformResult(url_, _response, (_response) => this.processGetAllProductLinks(_response));
1149
+ });
1150
+ }
1151
+ processGetAllProductLinks(response) {
1152
+ const status = response.status;
1153
+ let _headers = {};
1154
+ if (response.headers && typeof response.headers === "object") {
1155
+ for (let k in response.headers) {
1156
+ if (response.headers.hasOwnProperty(k)) {
1157
+ _headers[k] = response.headers[k];
1158
+ }
1159
+ }
1160
+ }
1161
+ if (status === 200) {
1162
+ const _responseText = response.data;
1163
+ let result200 = null;
1164
+ let resultData200 = _responseText;
1165
+ result200 = JSON.parse(resultData200);
1166
+ return Promise.resolve(result200);
1167
+ }
1168
+ else if (status === 409) {
1169
+ const _responseText = response.data;
1170
+ let result409 = null;
1171
+ let resultData409 = _responseText;
1172
+ result409 = JSON.parse(resultData409);
1173
+ return throwException("Conflict", status, _responseText, _headers, result409);
1174
+ }
1175
+ else if (status === 401) {
1176
+ const _responseText = response.data;
1177
+ return throwException("Unauthorized", status, _responseText, _headers);
1178
+ }
1179
+ else if (status === 403) {
1180
+ const _responseText = response.data;
1181
+ return throwException("Forbidden", status, _responseText, _headers);
1182
+ }
1183
+ else if (status !== 200 && status !== 204) {
1184
+ const _responseText = response.data;
1185
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
1186
+ }
1187
+ return Promise.resolve(null);
1188
+ }
1189
+ /**
1190
+ * Returns a storefront product reference.
1191
+ * @param reference An external reference to Customer's Canvas product, e.g online store product identifier.
1192
+ * @param storefrontId Storefront identifier.
1193
+ * @param tenantId (optional) Tenant identifier.
1194
+ * @return Success
1195
+ */
1196
+ get(reference, storefrontId, tenantId, cancelToken) {
1197
+ let url_ = this.baseUrl + "/api/storefront/v1/product-references/{reference}?";
1198
+ if (reference === undefined || reference === null)
1199
+ throw new Error("The parameter 'reference' must be defined.");
1200
+ url_ = url_.replace("{reference}", encodeURIComponent("" + reference));
1201
+ if (storefrontId === undefined || storefrontId === null)
1202
+ throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
1203
+ else
1204
+ url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
1205
+ if (tenantId !== undefined && tenantId !== null)
1206
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
1207
+ url_ = url_.replace(/[?&]$/, "");
1208
+ let options_ = {
1209
+ method: "GET",
1210
+ url: url_,
1211
+ headers: {
1212
+ "Accept": "application/json"
1213
+ },
1214
+ cancelToken
1215
+ };
1216
+ return this.transformOptions(options_).then(transformedOptions_ => {
1217
+ return this.instance.request(transformedOptions_);
1218
+ }).catch((_error) => {
1219
+ if (isAxiosError(_error) && _error.response) {
1220
+ return _error.response;
1221
+ }
1222
+ else {
1223
+ throw _error;
1224
+ }
1225
+ }).then((_response) => {
1226
+ return this.transformResult(url_, _response, (_response) => this.processGet(_response));
1227
+ });
1228
+ }
1229
+ processGet(response) {
1230
+ const status = response.status;
1231
+ let _headers = {};
1232
+ if (response.headers && typeof response.headers === "object") {
1233
+ for (let k in response.headers) {
1234
+ if (response.headers.hasOwnProperty(k)) {
1235
+ _headers[k] = response.headers[k];
1236
+ }
1237
+ }
1238
+ }
1239
+ if (status === 200) {
1240
+ const _responseText = response.data;
1241
+ let result200 = null;
1242
+ let resultData200 = _responseText;
1243
+ result200 = JSON.parse(resultData200);
1244
+ return Promise.resolve(result200);
1245
+ }
1246
+ else if (status === 409) {
1247
+ const _responseText = response.data;
1248
+ let result409 = null;
1249
+ let resultData409 = _responseText;
1250
+ result409 = JSON.parse(resultData409);
1251
+ return throwException("Conflict", status, _responseText, _headers, result409);
1252
+ }
1253
+ else if (status === 404) {
1254
+ const _responseText = response.data;
1255
+ let result404 = null;
1256
+ let resultData404 = _responseText;
1257
+ result404 = JSON.parse(resultData404);
1258
+ return throwException("Not Found", status, _responseText, _headers, result404);
1259
+ }
1260
+ else if (status === 401) {
1261
+ const _responseText = response.data;
1262
+ return throwException("Unauthorized", status, _responseText, _headers);
1263
+ }
1264
+ else if (status === 403) {
1265
+ const _responseText = response.data;
1266
+ return throwException("Forbidden", status, _responseText, _headers);
1267
+ }
1268
+ else if (status !== 200 && status !== 204) {
1269
+ const _responseText = response.data;
1270
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
1271
+ }
1272
+ return Promise.resolve(null);
1273
+ }
1274
+ /**
1275
+ * Deletes the storefront product reference.
1276
+ * @param reference Product reference - external reference to Customer's Canvas product specification, e.g online store product identifier.
1277
+ * @param storefrontId Storefront identifier.
1278
+ * @param tenantId (optional) Tenant identifier.
1279
+ * @return Success
1280
+ */
1281
+ delete(reference, storefrontId, tenantId, cancelToken) {
1282
+ let url_ = this.baseUrl + "/api/storefront/v1/product-references/{reference}?";
1283
+ if (reference === undefined || reference === null)
1284
+ throw new Error("The parameter 'reference' must be defined.");
1285
+ url_ = url_.replace("{reference}", encodeURIComponent("" + reference));
1286
+ if (storefrontId === undefined || storefrontId === null)
1287
+ throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
1288
+ else
1289
+ url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
1290
+ if (tenantId !== undefined && tenantId !== null)
1291
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
1292
+ url_ = url_.replace(/[?&]$/, "");
1293
+ let options_ = {
1294
+ method: "DELETE",
1295
+ url: url_,
1296
+ headers: {
1297
+ "Accept": "application/json"
1298
+ },
1299
+ cancelToken
1300
+ };
1301
+ return this.transformOptions(options_).then(transformedOptions_ => {
1302
+ return this.instance.request(transformedOptions_);
1303
+ }).catch((_error) => {
1304
+ if (isAxiosError(_error) && _error.response) {
1305
+ return _error.response;
1306
+ }
1307
+ else {
1308
+ throw _error;
1309
+ }
1310
+ }).then((_response) => {
1311
+ return this.transformResult(url_, _response, (_response) => this.processDelete(_response));
1312
+ });
1313
+ }
1314
+ processDelete(response) {
1315
+ const status = response.status;
1316
+ let _headers = {};
1317
+ if (response.headers && typeof response.headers === "object") {
1318
+ for (let k in response.headers) {
1319
+ if (response.headers.hasOwnProperty(k)) {
1320
+ _headers[k] = response.headers[k];
1321
+ }
1322
+ }
1323
+ }
1324
+ if (status === 200) {
1325
+ const _responseText = response.data;
1326
+ let result200 = null;
1327
+ let resultData200 = _responseText;
1328
+ result200 = JSON.parse(resultData200);
1329
+ return Promise.resolve(result200);
1330
+ }
1331
+ else if (status === 404) {
1332
+ const _responseText = response.data;
1333
+ let result404 = null;
1334
+ let resultData404 = _responseText;
1335
+ result404 = JSON.parse(resultData404);
1336
+ return throwException("Not Found", status, _responseText, _headers, result404);
1337
+ }
1338
+ else if (status === 409) {
1339
+ const _responseText = response.data;
1340
+ let result409 = null;
1341
+ let resultData409 = _responseText;
1342
+ result409 = JSON.parse(resultData409);
1343
+ return throwException("Conflict", status, _responseText, _headers, result409);
1344
+ }
1345
+ else if (status === 401) {
1346
+ const _responseText = response.data;
1347
+ return throwException("Unauthorized", status, _responseText, _headers);
1348
+ }
1349
+ else if (status === 403) {
1350
+ const _responseText = response.data;
1351
+ return throwException("Forbidden", status, _responseText, _headers);
1352
+ }
1353
+ else if (status !== 200 && status !== 204) {
1354
+ const _responseText = response.data;
1355
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
1356
+ }
1357
+ return Promise.resolve(null);
1358
+ }
1359
+ /**
1360
+ * Returns a product specification by the storefront product reference.
1361
+ * @param reference Product reference - external reference to Customer's Canvas product, e.g online store product identifier.
1362
+ * @param storefrontId Storefront identifier.
1363
+ * @param tenantId (optional) Tenant identifier.
1364
+ * @return Success
1365
+ */
1366
+ getProductSpecification(reference, storefrontId, tenantId, cancelToken) {
1367
+ let url_ = this.baseUrl + "/api/storefront/v1/product-references/{reference}/product-specification?";
1368
+ if (reference === undefined || reference === null)
1369
+ throw new Error("The parameter 'reference' must be defined.");
1370
+ url_ = url_.replace("{reference}", encodeURIComponent("" + reference));
1371
+ if (storefrontId === undefined || storefrontId === null)
1372
+ throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
1373
+ else
1374
+ url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
1375
+ if (tenantId !== undefined && tenantId !== null)
1376
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
1377
+ url_ = url_.replace(/[?&]$/, "");
1378
+ let options_ = {
1379
+ method: "GET",
1380
+ url: url_,
1381
+ headers: {
1382
+ "Accept": "application/json"
1383
+ },
1384
+ cancelToken
1385
+ };
1386
+ return this.transformOptions(options_).then(transformedOptions_ => {
1387
+ return this.instance.request(transformedOptions_);
1388
+ }).catch((_error) => {
1389
+ if (isAxiosError(_error) && _error.response) {
1390
+ return _error.response;
1391
+ }
1392
+ else {
1393
+ throw _error;
1394
+ }
1395
+ }).then((_response) => {
1396
+ return this.transformResult(url_, _response, (_response) => this.processGetProductSpecification(_response));
1397
+ });
1398
+ }
1399
+ processGetProductSpecification(response) {
1400
+ const status = response.status;
1401
+ let _headers = {};
1402
+ if (response.headers && typeof response.headers === "object") {
1403
+ for (let k in response.headers) {
1404
+ if (response.headers.hasOwnProperty(k)) {
1405
+ _headers[k] = response.headers[k];
1406
+ }
1407
+ }
1408
+ }
1409
+ if (status === 200) {
1410
+ const _responseText = response.data;
1411
+ let result200 = null;
1412
+ let resultData200 = _responseText;
1413
+ result200 = JSON.parse(resultData200);
1414
+ return Promise.resolve(result200);
1415
+ }
1416
+ else if (status === 404) {
1417
+ const _responseText = response.data;
1418
+ let result404 = null;
1419
+ let resultData404 = _responseText;
1420
+ result404 = JSON.parse(resultData404);
1421
+ return throwException("Not Found", status, _responseText, _headers, result404);
1422
+ }
1423
+ else if (status === 409) {
1424
+ const _responseText = response.data;
1425
+ let result409 = null;
1426
+ let resultData409 = _responseText;
1427
+ result409 = JSON.parse(resultData409);
1428
+ return throwException("Conflict", status, _responseText, _headers, result409);
1429
+ }
1430
+ else if (status === 401) {
1431
+ const _responseText = response.data;
1432
+ return throwException("Unauthorized", status, _responseText, _headers);
1433
+ }
1434
+ else if (status === 403) {
1435
+ const _responseText = response.data;
1436
+ return throwException("Forbidden", status, _responseText, _headers);
1437
+ }
1438
+ else if (status !== 200 && status !== 204) {
1439
+ const _responseText = response.data;
1440
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
1441
+ }
1442
+ return Promise.resolve(null);
1443
+ }
1444
+ /**
1445
+ * Returns a product by storefront product reference.
1446
+ * @param reference An external reference to Customer's Canvas product, e.g online store product identifier.
1447
+ * @param storefrontId Storefront identifier.
1448
+ * @param tenantId (optional) Tenant identifier.
1449
+ * @return Success
1450
+ */
1451
+ getProduct(reference, storefrontId, tenantId, cancelToken) {
1452
+ let url_ = this.baseUrl + "/api/storefront/v1/product-references/{reference}/product?";
1453
+ if (reference === undefined || reference === null)
1454
+ throw new Error("The parameter 'reference' must be defined.");
1455
+ url_ = url_.replace("{reference}", encodeURIComponent("" + reference));
1456
+ if (storefrontId === undefined || storefrontId === null)
1457
+ throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
1458
+ else
1459
+ url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
1460
+ if (tenantId !== undefined && tenantId !== null)
1461
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
1462
+ url_ = url_.replace(/[?&]$/, "");
1463
+ let options_ = {
1464
+ method: "GET",
1465
+ url: url_,
1466
+ headers: {
1467
+ "Accept": "application/json"
1468
+ },
1469
+ cancelToken
1470
+ };
1471
+ return this.transformOptions(options_).then(transformedOptions_ => {
1472
+ return this.instance.request(transformedOptions_);
1473
+ }).catch((_error) => {
1474
+ if (isAxiosError(_error) && _error.response) {
1475
+ return _error.response;
1476
+ }
1477
+ else {
1478
+ throw _error;
1479
+ }
1480
+ }).then((_response) => {
1481
+ return this.transformResult(url_, _response, (_response) => this.processGetProduct(_response));
1482
+ });
1483
+ }
1484
+ processGetProduct(response) {
1485
+ const status = response.status;
1486
+ let _headers = {};
1487
+ if (response.headers && typeof response.headers === "object") {
1488
+ for (let k in response.headers) {
1489
+ if (response.headers.hasOwnProperty(k)) {
1490
+ _headers[k] = response.headers[k];
1491
+ }
1492
+ }
1493
+ }
1494
+ if (status === 200) {
1495
+ const _responseText = response.data;
1496
+ let result200 = null;
1497
+ let resultData200 = _responseText;
1498
+ result200 = JSON.parse(resultData200);
1499
+ return Promise.resolve(result200);
1500
+ }
1501
+ else if (status === 404) {
1502
+ const _responseText = response.data;
1503
+ let result404 = null;
1504
+ let resultData404 = _responseText;
1505
+ result404 = JSON.parse(resultData404);
1506
+ return throwException("Not Found", status, _responseText, _headers, result404);
1507
+ }
1508
+ else if (status === 409) {
1509
+ const _responseText = response.data;
1510
+ let result409 = null;
1511
+ let resultData409 = _responseText;
1512
+ result409 = JSON.parse(resultData409);
1513
+ return throwException("Conflict", status, _responseText, _headers, result409);
1514
+ }
1515
+ else if (status === 401) {
1516
+ const _responseText = response.data;
1517
+ return throwException("Unauthorized", status, _responseText, _headers);
1518
+ }
1519
+ else if (status === 403) {
1520
+ const _responseText = response.data;
1521
+ return throwException("Forbidden", status, _responseText, _headers);
1522
+ }
1523
+ else if (status !== 200 && status !== 204) {
1524
+ const _responseText = response.data;
1525
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
1526
+ }
1527
+ return Promise.resolve(null);
1528
+ }
1529
+ /**
1530
+ * Returns a product summary by storefront product reference.
1531
+ * @param reference An external reference to Customer's Canvas product, e.g online store product identifier.
1532
+ * @param storefrontId Storefront identifier.
1533
+ * @param productVariantId (optional) Product variant identifier.
1534
+ * @param sku (optional) Product variant SKU.
1535
+ * @param tenantId (optional) Tenant identifier.
1536
+ * @return Success
1537
+ */
1538
+ getProductSummary(reference, storefrontId, productVariantId, sku, tenantId, cancelToken) {
1539
+ let url_ = this.baseUrl + "/api/storefront/v1/product-references/{reference}/product-summary?";
1540
+ if (reference === undefined || reference === null)
1541
+ throw new Error("The parameter 'reference' must be defined.");
1542
+ url_ = url_.replace("{reference}", encodeURIComponent("" + reference));
1543
+ if (storefrontId === undefined || storefrontId === null)
1544
+ throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
1545
+ else
1546
+ url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
1547
+ if (productVariantId !== undefined && productVariantId !== null)
1548
+ url_ += "productVariantId=" + encodeURIComponent("" + productVariantId) + "&";
1549
+ if (sku !== undefined && sku !== null)
1550
+ url_ += "sku=" + encodeURIComponent("" + sku) + "&";
1551
+ if (tenantId !== undefined && tenantId !== null)
1552
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
1553
+ url_ = url_.replace(/[?&]$/, "");
1554
+ let options_ = {
1555
+ method: "GET",
1556
+ url: url_,
1557
+ headers: {
1558
+ "Accept": "application/json"
1559
+ },
1560
+ cancelToken
1561
+ };
1562
+ return this.transformOptions(options_).then(transformedOptions_ => {
1563
+ return this.instance.request(transformedOptions_);
1564
+ }).catch((_error) => {
1565
+ if (isAxiosError(_error) && _error.response) {
1566
+ return _error.response;
1567
+ }
1568
+ else {
1569
+ throw _error;
1570
+ }
1571
+ }).then((_response) => {
1572
+ return this.transformResult(url_, _response, (_response) => this.processGetProductSummary(_response));
1573
+ });
1574
+ }
1575
+ processGetProductSummary(response) {
1576
+ const status = response.status;
1577
+ let _headers = {};
1578
+ if (response.headers && typeof response.headers === "object") {
1579
+ for (let k in response.headers) {
1580
+ if (response.headers.hasOwnProperty(k)) {
1581
+ _headers[k] = response.headers[k];
1582
+ }
1583
+ }
1584
+ }
1585
+ if (status === 200) {
1586
+ const _responseText = response.data;
1587
+ let result200 = null;
1588
+ let resultData200 = _responseText;
1589
+ result200 = JSON.parse(resultData200);
1590
+ return Promise.resolve(result200);
1591
+ }
1592
+ else if (status === 404) {
1593
+ const _responseText = response.data;
1594
+ let result404 = null;
1595
+ let resultData404 = _responseText;
1596
+ result404 = JSON.parse(resultData404);
1597
+ return throwException("Not Found", status, _responseText, _headers, result404);
1598
+ }
1599
+ else if (status === 409) {
1600
+ const _responseText = response.data;
1601
+ let result409 = null;
1602
+ let resultData409 = _responseText;
1603
+ result409 = JSON.parse(resultData409);
1604
+ return throwException("Conflict", status, _responseText, _headers, result409);
1605
+ }
1606
+ else if (status === 401) {
1607
+ const _responseText = response.data;
1608
+ return throwException("Unauthorized", status, _responseText, _headers);
1609
+ }
1610
+ else if (status === 403) {
1611
+ const _responseText = response.data;
1612
+ return throwException("Forbidden", status, _responseText, _headers);
1613
+ }
1614
+ else if (status !== 200 && status !== 204) {
1615
+ const _responseText = response.data;
1616
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
1617
+ }
1618
+ return Promise.resolve(null);
1619
+ }
1620
+ /**
1621
+ * Returns a product link by storefront product reference.
1622
+ * @param reference An external reference to Customer's Canvas product, e.g online store product identifier.
1623
+ * @param storefrontId Storefront identifier.
1624
+ * @param tenantId (optional) Tenant identifier.
1625
+ * @return Success
1626
+ */
1627
+ getProductLink(reference, storefrontId, tenantId, cancelToken) {
1628
+ let url_ = this.baseUrl + "/api/storefront/v1/product-references/{reference}/product-link?";
1629
+ if (reference === undefined || reference === null)
1630
+ throw new Error("The parameter 'reference' must be defined.");
1631
+ url_ = url_.replace("{reference}", encodeURIComponent("" + reference));
1632
+ if (storefrontId === undefined || storefrontId === null)
1633
+ throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
1634
+ else
1635
+ url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
1636
+ if (tenantId !== undefined && tenantId !== null)
1637
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
1638
+ url_ = url_.replace(/[?&]$/, "");
1639
+ let options_ = {
1640
+ method: "GET",
1641
+ url: url_,
1642
+ headers: {
1643
+ "Accept": "application/json"
1644
+ },
1645
+ cancelToken
1646
+ };
1647
+ return this.transformOptions(options_).then(transformedOptions_ => {
1648
+ return this.instance.request(transformedOptions_);
1649
+ }).catch((_error) => {
1650
+ if (isAxiosError(_error) && _error.response) {
1651
+ return _error.response;
1652
+ }
1653
+ else {
1654
+ throw _error;
1655
+ }
1656
+ }).then((_response) => {
1657
+ return this.transformResult(url_, _response, (_response) => this.processGetProductLink(_response));
1658
+ });
1659
+ }
1660
+ processGetProductLink(response) {
1661
+ const status = response.status;
1662
+ let _headers = {};
1663
+ if (response.headers && typeof response.headers === "object") {
1664
+ for (let k in response.headers) {
1665
+ if (response.headers.hasOwnProperty(k)) {
1666
+ _headers[k] = response.headers[k];
1667
+ }
1668
+ }
1669
+ }
1670
+ if (status === 200) {
1671
+ const _responseText = response.data;
1672
+ let result200 = null;
1673
+ let resultData200 = _responseText;
1674
+ result200 = JSON.parse(resultData200);
1675
+ return Promise.resolve(result200);
1676
+ }
1677
+ else if (status === 404) {
1678
+ const _responseText = response.data;
1679
+ let result404 = null;
1680
+ let resultData404 = _responseText;
1681
+ result404 = JSON.parse(resultData404);
1682
+ return throwException("Not Found", status, _responseText, _headers, result404);
1683
+ }
1684
+ else if (status === 409) {
1685
+ const _responseText = response.data;
1686
+ let result409 = null;
1687
+ let resultData409 = _responseText;
1688
+ result409 = JSON.parse(resultData409);
1689
+ return throwException("Conflict", status, _responseText, _headers, result409);
1690
+ }
1691
+ else if (status === 401) {
1692
+ const _responseText = response.data;
1693
+ return throwException("Unauthorized", status, _responseText, _headers);
1694
+ }
1695
+ else if (status === 403) {
1696
+ const _responseText = response.data;
1697
+ return throwException("Forbidden", status, _responseText, _headers);
1698
+ }
1699
+ else if (status !== 200 && status !== 204) {
1700
+ const _responseText = response.data;
1701
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
1702
+ }
1703
+ return Promise.resolve(null);
1704
+ }
1705
+ /**
1706
+ * Returns a product cost details from ecommerce system.
1707
+ * @param reference An external reference to Customer's Canvas product, e.g online store product identifier.
1708
+ * @param sku Product SKU.
1709
+ * @param storefrontId Storefront identifier.
1710
+ * @param storefrontUserId (optional) Storefront user identifier.
1711
+ * @param currencyCode (optional) Product cost currency code.
1712
+ * @param quantity (optional) Product quantity.
1713
+ * @param tenantId (optional) Tenant identifier.
1714
+ * @return Success
1715
+ */
1716
+ getProductCostDetails(reference, sku, storefrontId, storefrontUserId, currencyCode, quantity, tenantId, cancelToken) {
1717
+ let url_ = this.baseUrl + "/api/storefront/v1/product-references/{reference}/product-cost-details?";
1718
+ if (reference === undefined || reference === null)
1719
+ throw new Error("The parameter 'reference' must be defined.");
1720
+ url_ = url_.replace("{reference}", encodeURIComponent("" + reference));
1721
+ if (sku === undefined || sku === null)
1722
+ throw new Error("The parameter 'sku' must be defined and cannot be null.");
1723
+ else
1724
+ url_ += "sku=" + encodeURIComponent("" + sku) + "&";
1725
+ if (storefrontId === undefined || storefrontId === null)
1726
+ throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
1727
+ else
1728
+ url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
1729
+ if (storefrontUserId !== undefined && storefrontUserId !== null)
1730
+ url_ += "storefrontUserId=" + encodeURIComponent("" + storefrontUserId) + "&";
1731
+ if (currencyCode !== undefined && currencyCode !== null)
1732
+ url_ += "currencyCode=" + encodeURIComponent("" + currencyCode) + "&";
1733
+ if (quantity === null)
1734
+ throw new Error("The parameter 'quantity' cannot be null.");
1735
+ else if (quantity !== undefined)
1736
+ url_ += "quantity=" + encodeURIComponent("" + quantity) + "&";
1737
+ if (tenantId !== undefined && tenantId !== null)
1738
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
1739
+ url_ = url_.replace(/[?&]$/, "");
1740
+ let options_ = {
1741
+ method: "GET",
1742
+ url: url_,
1743
+ headers: {
1744
+ "Accept": "application/json"
1745
+ },
1746
+ cancelToken
1747
+ };
1748
+ return this.transformOptions(options_).then(transformedOptions_ => {
1749
+ return this.instance.request(transformedOptions_);
1750
+ }).catch((_error) => {
1751
+ if (isAxiosError(_error) && _error.response) {
1752
+ return _error.response;
1753
+ }
1754
+ else {
1755
+ throw _error;
1756
+ }
1757
+ }).then((_response) => {
1758
+ return this.transformResult(url_, _response, (_response) => this.processGetProductCostDetails(_response));
1759
+ });
1760
+ }
1761
+ processGetProductCostDetails(response) {
1762
+ const status = response.status;
1763
+ let _headers = {};
1764
+ if (response.headers && typeof response.headers === "object") {
1765
+ for (let k in response.headers) {
1766
+ if (response.headers.hasOwnProperty(k)) {
1767
+ _headers[k] = response.headers[k];
1768
+ }
1769
+ }
1770
+ }
1771
+ if (status === 200) {
1772
+ const _responseText = response.data;
1773
+ let result200 = null;
1774
+ let resultData200 = _responseText;
1775
+ result200 = JSON.parse(resultData200);
1776
+ return Promise.resolve(result200);
1777
+ }
1778
+ else if (status === 404) {
1779
+ const _responseText = response.data;
1780
+ let result404 = null;
1781
+ let resultData404 = _responseText;
1782
+ result404 = JSON.parse(resultData404);
1783
+ return throwException("Not Found", status, _responseText, _headers, result404);
1784
+ }
1785
+ else if (status === 409) {
1786
+ const _responseText = response.data;
1787
+ let result409 = null;
1788
+ let resultData409 = _responseText;
1789
+ result409 = JSON.parse(resultData409);
1790
+ return throwException("Conflict", status, _responseText, _headers, result409);
1791
+ }
1792
+ else if (status === 401) {
1793
+ const _responseText = response.data;
1794
+ return throwException("Unauthorized", status, _responseText, _headers);
1795
+ }
1796
+ else if (status === 403) {
1797
+ const _responseText = response.data;
1798
+ return throwException("Forbidden", status, _responseText, _headers);
1799
+ }
1800
+ else if (status !== 200 && status !== 204) {
1801
+ const _responseText = response.data;
1802
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
1803
+ }
1804
+ return Promise.resolve(null);
1805
+ }
1806
+ /**
1807
+ * Returns a product personalization workflow.
1808
+ * @param reference An external reference to Customer's Canvas product, e.g online store product identifier.
1809
+ * @param storefrontId (optional) Storefront identifier.
1810
+ * @param tenantId (optional) Tenant identifier.
1811
+ * @return Success
1812
+ */
1813
+ getPersonalizationWorkflow(reference, storefrontId, tenantId, cancelToken) {
1814
+ let url_ = this.baseUrl + "/api/storefront/v1/product-references/{reference}/personalization-workflow?";
1815
+ if (reference === undefined || reference === null)
1816
+ throw new Error("The parameter 'reference' must be defined.");
1817
+ url_ = url_.replace("{reference}", encodeURIComponent("" + reference));
1818
+ if (storefrontId === null)
1819
+ throw new Error("The parameter 'storefrontId' cannot be null.");
1820
+ else if (storefrontId !== undefined)
1821
+ url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
1822
+ if (tenantId !== undefined && tenantId !== null)
1823
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
1824
+ url_ = url_.replace(/[?&]$/, "");
1825
+ let options_ = {
1826
+ method: "GET",
1827
+ url: url_,
1828
+ headers: {
1829
+ "Accept": "application/json"
1830
+ },
1831
+ cancelToken
1832
+ };
1833
+ return this.transformOptions(options_).then(transformedOptions_ => {
1834
+ return this.instance.request(transformedOptions_);
1835
+ }).catch((_error) => {
1836
+ if (isAxiosError(_error) && _error.response) {
1837
+ return _error.response;
1838
+ }
1839
+ else {
1840
+ throw _error;
1841
+ }
1842
+ }).then((_response) => {
1843
+ return this.transformResult(url_, _response, (_response) => this.processGetPersonalizationWorkflow(_response));
1844
+ });
1845
+ }
1846
+ processGetPersonalizationWorkflow(response) {
1847
+ const status = response.status;
1848
+ let _headers = {};
1849
+ if (response.headers && typeof response.headers === "object") {
1850
+ for (let k in response.headers) {
1851
+ if (response.headers.hasOwnProperty(k)) {
1852
+ _headers[k] = response.headers[k];
1853
+ }
1854
+ }
1855
+ }
1856
+ if (status === 200) {
1857
+ const _responseText = response.data;
1858
+ let result200 = null;
1859
+ let resultData200 = _responseText;
1860
+ result200 = JSON.parse(resultData200);
1861
+ return Promise.resolve(result200);
1862
+ }
1863
+ else if (status === 404) {
1864
+ const _responseText = response.data;
1865
+ let result404 = null;
1866
+ let resultData404 = _responseText;
1867
+ result404 = JSON.parse(resultData404);
1868
+ return throwException("Not Found", status, _responseText, _headers, result404);
1869
+ }
1870
+ else if (status === 409) {
1871
+ const _responseText = response.data;
1872
+ let result409 = null;
1873
+ let resultData409 = _responseText;
1874
+ result409 = JSON.parse(resultData409);
1875
+ return throwException("Conflict", status, _responseText, _headers, result409);
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
+ * Returns a product personalization workflow configuration by storefront product reference.
1893
+ * @param reference An external reference to Customer's Canvas product, e.g online store product identifier.
1894
+ * @param storefrontId Storefront identifier.
1895
+ * @param tenantId (optional) Tenant identifier.
1896
+ * @return Success
1897
+ * @deprecated
1898
+ */
1899
+ getProductConfig(reference, storefrontId, tenantId, cancelToken) {
1900
+ let url_ = this.baseUrl + "/api/storefront/v1/product-references/{reference}/product-config?";
1901
+ if (reference === undefined || reference === null)
1902
+ throw new Error("The parameter 'reference' must be defined.");
1903
+ url_ = url_.replace("{reference}", encodeURIComponent("" + reference));
1904
+ if (storefrontId === undefined || storefrontId === null)
1905
+ throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
1906
+ else
1907
+ url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
1908
+ if (tenantId !== undefined && tenantId !== null)
1909
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
1910
+ url_ = url_.replace(/[?&]$/, "");
1911
+ let options_ = {
1912
+ method: "GET",
1913
+ url: url_,
1914
+ headers: {
1915
+ "Accept": "text/plain"
1916
+ },
1917
+ cancelToken
1918
+ };
1919
+ return this.transformOptions(options_).then(transformedOptions_ => {
1920
+ return this.instance.request(transformedOptions_);
1921
+ }).catch((_error) => {
1922
+ if (isAxiosError(_error) && _error.response) {
1923
+ return _error.response;
1924
+ }
1925
+ else {
1926
+ throw _error;
1927
+ }
1928
+ }).then((_response) => {
1929
+ return this.transformResult(url_, _response, (_response) => this.processGetProductConfig(_response));
1930
+ });
1931
+ }
1932
+ processGetProductConfig(response) {
1933
+ const status = response.status;
1934
+ let _headers = {};
1935
+ if (response.headers && typeof response.headers === "object") {
1936
+ for (let k in response.headers) {
1937
+ if (response.headers.hasOwnProperty(k)) {
1938
+ _headers[k] = response.headers[k];
1939
+ }
1940
+ }
1941
+ }
1942
+ if (status === 200) {
1943
+ const _responseText = response.data;
1944
+ let result200 = null;
1945
+ let resultData200 = _responseText;
1946
+ result200 = resultData200;
1947
+ return Promise.resolve(result200);
1948
+ }
1949
+ else if (status === 404) {
1950
+ const _responseText = response.data;
1951
+ let result404 = null;
1952
+ let resultData404 = _responseText;
1953
+ result404 = JSON.parse(resultData404);
1954
+ return throwException("Not Found", status, _responseText, _headers, result404);
1955
+ }
1956
+ else if (status === 409) {
1957
+ const _responseText = response.data;
1958
+ let result409 = null;
1959
+ let resultData409 = _responseText;
1960
+ result409 = JSON.parse(resultData409);
1961
+ return throwException("Conflict", status, _responseText, _headers, result409);
1962
+ }
1963
+ else if (status === 401) {
1964
+ const _responseText = response.data;
1965
+ return throwException("Unauthorized", status, _responseText, _headers);
1966
+ }
1967
+ else if (status === 403) {
1968
+ const _responseText = response.data;
1969
+ return throwException("Forbidden", status, _responseText, _headers);
1970
+ }
1971
+ else if (status !== 200 && status !== 204) {
1972
+ const _responseText = response.data;
1973
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
1974
+ }
1975
+ return Promise.resolve(null);
1976
+ }
1977
+ }
1978
+ export class ProductsApiClient extends ApiClientBase {
1979
+ instance;
1980
+ baseUrl;
1981
+ jsonParseReviver = undefined;
1982
+ constructor(configuration, baseUrl, instance) {
1983
+ super(configuration);
1984
+ this.instance = instance ? instance : axios.create();
1985
+ this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : this.getBaseUrl("");
1986
+ }
1987
+ /**
1988
+ * Returns all products, relevant to the specified query parameters.
1989
+ * @param skip (optional) Defines page start offset from beginning of sorted result list.
1990
+ * @param take (optional) Defines page length (how many consequent items of sorted result list should be taken).
1991
+ * @param sorting (optional) Defines sorting order of result list e.g.: "Title ASC, LastModified DESC".
1992
+ * @param search (optional) Search string for partial match.
1993
+ * @param sku (optional) SKU of linked ecommerce product.
1994
+ * @param tags (optional) List of tags that product should have.
1995
+ * @param customFields (optional) Serialized custom fields dictionary filter. For example: {"public":"true","name":"my item"}.
1996
+ * @param tenantId (optional) Tenant identifier.
1997
+ * @return Success
1998
+ */
1999
+ getAllProducts(skip, take, sorting, search, sku, tags, customFields, tenantId, cancelToken) {
2000
+ let url_ = this.baseUrl + "/api/storefront/v1/products?";
2001
+ if (skip !== undefined && skip !== null)
2002
+ url_ += "skip=" + encodeURIComponent("" + skip) + "&";
2003
+ if (take !== undefined && take !== null)
2004
+ url_ += "take=" + encodeURIComponent("" + take) + "&";
2005
+ if (sorting !== undefined && sorting !== null)
2006
+ url_ += "sorting=" + encodeURIComponent("" + sorting) + "&";
2007
+ if (search !== undefined && search !== null)
2008
+ url_ += "search=" + encodeURIComponent("" + search) + "&";
2009
+ if (sku !== undefined && sku !== null)
2010
+ url_ += "sku=" + encodeURIComponent("" + sku) + "&";
2011
+ if (tags !== undefined && tags !== null)
2012
+ tags && tags.forEach(item => { url_ += "tags=" + encodeURIComponent("" + item) + "&"; });
2013
+ if (customFields !== undefined && customFields !== null)
2014
+ url_ += "customFields=" + encodeURIComponent("" + customFields) + "&";
2015
+ if (tenantId !== undefined && tenantId !== null)
2016
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
2017
+ url_ = url_.replace(/[?&]$/, "");
2018
+ let options_ = {
2019
+ method: "GET",
2020
+ url: url_,
2021
+ headers: {
2022
+ "Accept": "application/json"
2023
+ },
2024
+ cancelToken
2025
+ };
2026
+ return this.transformOptions(options_).then(transformedOptions_ => {
2027
+ return this.instance.request(transformedOptions_);
2028
+ }).catch((_error) => {
2029
+ if (isAxiosError(_error) && _error.response) {
2030
+ return _error.response;
2031
+ }
2032
+ else {
2033
+ throw _error;
2034
+ }
2035
+ }).then((_response) => {
2036
+ return this.transformResult(url_, _response, (_response) => this.processGetAllProducts(_response));
2037
+ });
2038
+ }
2039
+ processGetAllProducts(response) {
2040
+ const status = response.status;
2041
+ let _headers = {};
2042
+ if (response.headers && typeof response.headers === "object") {
2043
+ for (let k in response.headers) {
2044
+ if (response.headers.hasOwnProperty(k)) {
2045
+ _headers[k] = response.headers[k];
2046
+ }
2047
+ }
2048
+ }
2049
+ if (status === 200) {
2050
+ const _responseText = response.data;
2051
+ let result200 = null;
2052
+ let resultData200 = _responseText;
2053
+ result200 = JSON.parse(resultData200);
2054
+ return Promise.resolve(result200);
2055
+ }
2056
+ else if (status === 401) {
2057
+ const _responseText = response.data;
2058
+ return throwException("Unauthorized", status, _responseText, _headers);
2059
+ }
2060
+ else if (status === 403) {
2061
+ const _responseText = response.data;
2062
+ return throwException("Forbidden", status, _responseText, _headers);
2063
+ }
2064
+ else if (status !== 200 && status !== 204) {
2065
+ const _responseText = response.data;
2066
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
2067
+ }
2068
+ return Promise.resolve(null);
2069
+ }
2070
+ /**
2071
+ * Returns a product by identifier.
2072
+ * @param id Product identifier.
2073
+ * @param productVersionId (optional) Product version identifier.
2074
+ * @param tenantId (optional) Tenant identifier.
2075
+ * @return Success
2076
+ */
2077
+ getProduct(id, productVersionId, tenantId, cancelToken) {
2078
+ let url_ = this.baseUrl + "/api/storefront/v1/products/{id}?";
2079
+ if (id === undefined || id === null)
2080
+ throw new Error("The parameter 'id' must be defined.");
2081
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
2082
+ if (productVersionId !== undefined && productVersionId !== null)
2083
+ url_ += "productVersionId=" + encodeURIComponent("" + productVersionId) + "&";
2084
+ if (tenantId !== undefined && tenantId !== null)
2085
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
2086
+ url_ = url_.replace(/[?&]$/, "");
2087
+ let options_ = {
2088
+ method: "GET",
2089
+ url: url_,
2090
+ headers: {
2091
+ "Accept": "application/json"
2092
+ },
2093
+ cancelToken
2094
+ };
2095
+ return this.transformOptions(options_).then(transformedOptions_ => {
2096
+ return this.instance.request(transformedOptions_);
2097
+ }).catch((_error) => {
2098
+ if (isAxiosError(_error) && _error.response) {
2099
+ return _error.response;
2100
+ }
2101
+ else {
2102
+ throw _error;
2103
+ }
2104
+ }).then((_response) => {
2105
+ return this.transformResult(url_, _response, (_response) => this.processGetProduct(_response));
2106
+ });
2107
+ }
2108
+ processGetProduct(response) {
2109
+ const status = response.status;
2110
+ let _headers = {};
2111
+ if (response.headers && typeof response.headers === "object") {
2112
+ for (let k in response.headers) {
2113
+ if (response.headers.hasOwnProperty(k)) {
2114
+ _headers[k] = response.headers[k];
2115
+ }
2116
+ }
2117
+ }
2118
+ if (status === 200) {
2119
+ const _responseText = response.data;
2120
+ let result200 = null;
2121
+ let resultData200 = _responseText;
2122
+ result200 = JSON.parse(resultData200);
2123
+ return Promise.resolve(result200);
2124
+ }
2125
+ else if (status === 404) {
2126
+ const _responseText = response.data;
2127
+ let result404 = null;
2128
+ let resultData404 = _responseText;
2129
+ result404 = JSON.parse(resultData404);
2130
+ return throwException("Not Found", status, _responseText, _headers, result404);
2131
+ }
2132
+ else if (status === 409) {
2133
+ const _responseText = response.data;
2134
+ let result409 = null;
2135
+ let resultData409 = _responseText;
2136
+ result409 = JSON.parse(resultData409);
2137
+ return throwException("Conflict", status, _responseText, _headers, result409);
2138
+ }
2139
+ else if (status === 401) {
2140
+ const _responseText = response.data;
2141
+ return throwException("Unauthorized", status, _responseText, _headers);
2142
+ }
2143
+ else if (status === 403) {
2144
+ const _responseText = response.data;
2145
+ return throwException("Forbidden", status, _responseText, _headers);
2146
+ }
2147
+ else if (status !== 200 && status !== 204) {
2148
+ const _responseText = response.data;
2149
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
2150
+ }
2151
+ return Promise.resolve(null);
2152
+ }
2153
+ /**
2154
+ * Returns a product summary by product identifier.
2155
+ * @param id Product identifier.
2156
+ * @param productVersionId (optional) Product version identifier.
2157
+ * @param productLinkId (optional) Product link identifier.
2158
+ * @param productVariantId (optional) Product variant identifier.
2159
+ * @param sku (optional) Product variant SKU.
2160
+ * @param tenantId (optional) Tenant identifier.
2161
+ * @return Success
2162
+ */
2163
+ getProductSummary(id, productVersionId, productLinkId, productVariantId, sku, tenantId, cancelToken) {
2164
+ let url_ = this.baseUrl + "/api/storefront/v1/products/{id}/summary?";
2165
+ if (id === undefined || id === null)
2166
+ throw new Error("The parameter 'id' must be defined.");
2167
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
2168
+ if (productVersionId !== undefined && productVersionId !== null)
2169
+ url_ += "productVersionId=" + encodeURIComponent("" + productVersionId) + "&";
2170
+ if (productLinkId !== undefined && productLinkId !== null)
2171
+ url_ += "productLinkId=" + encodeURIComponent("" + productLinkId) + "&";
2172
+ if (productVariantId !== undefined && productVariantId !== null)
2173
+ url_ += "productVariantId=" + encodeURIComponent("" + productVariantId) + "&";
2174
+ if (sku !== undefined && sku !== null)
2175
+ url_ += "sku=" + encodeURIComponent("" + sku) + "&";
2176
+ if (tenantId !== undefined && tenantId !== null)
2177
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
2178
+ url_ = url_.replace(/[?&]$/, "");
2179
+ let options_ = {
2180
+ method: "GET",
2181
+ url: url_,
2182
+ headers: {
2183
+ "Accept": "application/json"
2184
+ },
2185
+ cancelToken
2186
+ };
2187
+ return this.transformOptions(options_).then(transformedOptions_ => {
2188
+ return this.instance.request(transformedOptions_);
2189
+ }).catch((_error) => {
2190
+ if (isAxiosError(_error) && _error.response) {
2191
+ return _error.response;
2192
+ }
2193
+ else {
2194
+ throw _error;
2195
+ }
2196
+ }).then((_response) => {
2197
+ return this.transformResult(url_, _response, (_response) => this.processGetProductSummary(_response));
2198
+ });
2199
+ }
2200
+ processGetProductSummary(response) {
2201
+ const status = response.status;
2202
+ let _headers = {};
2203
+ if (response.headers && typeof response.headers === "object") {
2204
+ for (let k in response.headers) {
2205
+ if (response.headers.hasOwnProperty(k)) {
2206
+ _headers[k] = response.headers[k];
2207
+ }
2208
+ }
2209
+ }
2210
+ if (status === 200) {
2211
+ const _responseText = response.data;
2212
+ let result200 = null;
2213
+ let resultData200 = _responseText;
2214
+ result200 = JSON.parse(resultData200);
2215
+ return Promise.resolve(result200);
2216
+ }
2217
+ else if (status === 404) {
2218
+ const _responseText = response.data;
2219
+ let result404 = null;
2220
+ let resultData404 = _responseText;
2221
+ result404 = JSON.parse(resultData404);
2222
+ return throwException("Not Found", status, _responseText, _headers, result404);
2223
+ }
2224
+ else if (status === 409) {
2225
+ const _responseText = response.data;
2226
+ let result409 = null;
2227
+ let resultData409 = _responseText;
2228
+ result409 = JSON.parse(resultData409);
2229
+ return throwException("Conflict", status, _responseText, _headers, result409);
2230
+ }
2231
+ else if (status === 401) {
2232
+ const _responseText = response.data;
2233
+ return throwException("Unauthorized", status, _responseText, _headers);
2234
+ }
2235
+ else if (status === 403) {
2236
+ const _responseText = response.data;
2237
+ return throwException("Forbidden", status, _responseText, _headers);
2238
+ }
2239
+ else if (status !== 200 && status !== 204) {
2240
+ const _responseText = response.data;
2241
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
2242
+ }
2243
+ return Promise.resolve(null);
2244
+ }
2245
+ /**
2246
+ * Returns a list of product options.
2247
+ * @param id Product identifier.
2248
+ * @param productVersionId (optional) Product version identifier.
2249
+ * @param tenantId (optional) Tenant identifier.
2250
+ * @return Success
2251
+ */
2252
+ getProductOptions(id, productVersionId, tenantId, cancelToken) {
2253
+ let url_ = this.baseUrl + "/api/storefront/v1/products/{id}/options?";
2254
+ if (id === undefined || id === null)
2255
+ throw new Error("The parameter 'id' must be defined.");
2256
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
2257
+ if (productVersionId !== undefined && productVersionId !== null)
2258
+ url_ += "productVersionId=" + encodeURIComponent("" + productVersionId) + "&";
2259
+ if (tenantId !== undefined && tenantId !== null)
2260
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
2261
+ url_ = url_.replace(/[?&]$/, "");
2262
+ let options_ = {
2263
+ method: "GET",
2264
+ url: url_,
2265
+ headers: {
2266
+ "Accept": "application/json"
2267
+ },
2268
+ cancelToken
2269
+ };
2270
+ return this.transformOptions(options_).then(transformedOptions_ => {
2271
+ return this.instance.request(transformedOptions_);
2272
+ }).catch((_error) => {
2273
+ if (isAxiosError(_error) && _error.response) {
2274
+ return _error.response;
2275
+ }
2276
+ else {
2277
+ throw _error;
2278
+ }
2279
+ }).then((_response) => {
2280
+ return this.transformResult(url_, _response, (_response) => this.processGetProductOptions(_response));
2281
+ });
2282
+ }
2283
+ processGetProductOptions(response) {
2284
+ const status = response.status;
2285
+ let _headers = {};
2286
+ if (response.headers && typeof response.headers === "object") {
2287
+ for (let k in response.headers) {
2288
+ if (response.headers.hasOwnProperty(k)) {
2289
+ _headers[k] = response.headers[k];
2290
+ }
2291
+ }
2292
+ }
2293
+ if (status === 200) {
2294
+ const _responseText = response.data;
2295
+ let result200 = null;
2296
+ let resultData200 = _responseText;
2297
+ result200 = JSON.parse(resultData200);
2298
+ return Promise.resolve(result200);
2299
+ }
2300
+ else if (status === 404) {
2301
+ const _responseText = response.data;
2302
+ let result404 = null;
2303
+ let resultData404 = _responseText;
2304
+ result404 = JSON.parse(resultData404);
2305
+ return throwException("Not Found", status, _responseText, _headers, result404);
2306
+ }
2307
+ else if (status === 409) {
2308
+ const _responseText = response.data;
2309
+ let result409 = null;
2310
+ let resultData409 = _responseText;
2311
+ result409 = JSON.parse(resultData409);
2312
+ return throwException("Conflict", status, _responseText, _headers, result409);
2313
+ }
2314
+ else if (status === 401) {
2315
+ const _responseText = response.data;
2316
+ return throwException("Unauthorized", status, _responseText, _headers);
2317
+ }
2318
+ else if (status === 403) {
2319
+ const _responseText = response.data;
2320
+ return throwException("Forbidden", status, _responseText, _headers);
2321
+ }
2322
+ else if (status !== 200 && status !== 204) {
2323
+ const _responseText = response.data;
2324
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
2325
+ }
2326
+ return Promise.resolve(null);
2327
+ }
2328
+ /**
2329
+ * Returns a list of product options for all products.
2330
+ * @param tenantId (optional) Tenant identifier.
2331
+ * @return Success
2332
+ */
2333
+ getAllProductOptions(tenantId, cancelToken) {
2334
+ let url_ = this.baseUrl + "/api/storefront/v1/products/options?";
2335
+ if (tenantId !== undefined && tenantId !== null)
2336
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
2337
+ url_ = url_.replace(/[?&]$/, "");
2338
+ let options_ = {
2339
+ method: "GET",
2340
+ url: url_,
2341
+ headers: {
2342
+ "Accept": "application/json"
2343
+ },
2344
+ cancelToken
2345
+ };
2346
+ return this.transformOptions(options_).then(transformedOptions_ => {
2347
+ return this.instance.request(transformedOptions_);
2348
+ }).catch((_error) => {
2349
+ if (isAxiosError(_error) && _error.response) {
2350
+ return _error.response;
2351
+ }
2352
+ else {
2353
+ throw _error;
2354
+ }
2355
+ }).then((_response) => {
2356
+ return this.transformResult(url_, _response, (_response) => this.processGetAllProductOptions(_response));
2357
+ });
2358
+ }
2359
+ processGetAllProductOptions(response) {
2360
+ const status = response.status;
2361
+ let _headers = {};
2362
+ if (response.headers && typeof response.headers === "object") {
2363
+ for (let k in response.headers) {
2364
+ if (response.headers.hasOwnProperty(k)) {
2365
+ _headers[k] = response.headers[k];
2366
+ }
2367
+ }
2368
+ }
2369
+ if (status === 200) {
2370
+ const _responseText = response.data;
2371
+ let result200 = null;
2372
+ let resultData200 = _responseText;
2373
+ result200 = JSON.parse(resultData200);
2374
+ return Promise.resolve(result200);
2375
+ }
2376
+ else if (status === 401) {
2377
+ const _responseText = response.data;
2378
+ return throwException("Unauthorized", status, _responseText, _headers);
2379
+ }
2380
+ else if (status === 403) {
2381
+ const _responseText = response.data;
2382
+ return throwException("Forbidden", status, _responseText, _headers);
2383
+ }
2384
+ else if (status !== 200 && status !== 204) {
2385
+ const _responseText = response.data;
2386
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
2387
+ }
2388
+ return Promise.resolve(null);
2389
+ }
2390
+ /**
2391
+ * Returns a list of product links.
2392
+ * @param id Product identifier.
2393
+ * @param productVersionId (optional)
2394
+ * @param skip (optional) Defines page start offset from beginning of sorted result list.
2395
+ * @param take (optional) Defines page length (how many consequent items of sorted result list should be taken).
2396
+ * @param sorting (optional) Defines sorting order of result list e.g.: "Title ASC, LastModified DESC".
2397
+ * @param search (optional) Search string for partial match.
2398
+ * @param tenantId (optional) Tenant identifier.
2399
+ * @return Success
2400
+ */
2401
+ getProductLinks(id, productVersionId, skip, take, sorting, search, tenantId, cancelToken) {
2402
+ let url_ = this.baseUrl + "/api/storefront/v1/products/{id}/links?";
2403
+ if (id === undefined || id === null)
2404
+ throw new Error("The parameter 'id' must be defined.");
2405
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
2406
+ if (productVersionId !== undefined && productVersionId !== null)
2407
+ url_ += "productVersionId=" + encodeURIComponent("" + productVersionId) + "&";
2408
+ if (skip !== undefined && skip !== null)
2409
+ url_ += "skip=" + encodeURIComponent("" + skip) + "&";
2410
+ if (take !== undefined && take !== null)
2411
+ url_ += "take=" + encodeURIComponent("" + take) + "&";
2412
+ if (sorting !== undefined && sorting !== null)
2413
+ url_ += "sorting=" + encodeURIComponent("" + sorting) + "&";
2414
+ if (search !== undefined && search !== null)
2415
+ url_ += "search=" + encodeURIComponent("" + search) + "&";
2416
+ if (tenantId !== undefined && tenantId !== null)
2417
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
2418
+ url_ = url_.replace(/[?&]$/, "");
2419
+ let options_ = {
2420
+ method: "GET",
2421
+ url: url_,
2422
+ headers: {
2423
+ "Accept": "application/json"
2424
+ },
2425
+ cancelToken
2426
+ };
2427
+ return this.transformOptions(options_).then(transformedOptions_ => {
2428
+ return this.instance.request(transformedOptions_);
2429
+ }).catch((_error) => {
2430
+ if (isAxiosError(_error) && _error.response) {
2431
+ return _error.response;
2432
+ }
2433
+ else {
2434
+ throw _error;
2435
+ }
2436
+ }).then((_response) => {
2437
+ return this.transformResult(url_, _response, (_response) => this.processGetProductLinks(_response));
2438
+ });
2439
+ }
2440
+ processGetProductLinks(response) {
2441
+ const status = response.status;
2442
+ let _headers = {};
2443
+ if (response.headers && typeof response.headers === "object") {
2444
+ for (let k in response.headers) {
2445
+ if (response.headers.hasOwnProperty(k)) {
2446
+ _headers[k] = response.headers[k];
2447
+ }
2448
+ }
2449
+ }
2450
+ if (status === 200) {
2451
+ const _responseText = response.data;
2452
+ let result200 = null;
2453
+ let resultData200 = _responseText;
2454
+ result200 = JSON.parse(resultData200);
2455
+ return Promise.resolve(result200);
2456
+ }
2457
+ else if (status === 404) {
2458
+ const _responseText = response.data;
2459
+ let result404 = null;
2460
+ let resultData404 = _responseText;
2461
+ result404 = JSON.parse(resultData404);
2462
+ return throwException("Not Found", status, _responseText, _headers, result404);
2463
+ }
2464
+ else if (status === 409) {
2465
+ const _responseText = response.data;
2466
+ let result409 = null;
2467
+ let resultData409 = _responseText;
2468
+ result409 = JSON.parse(resultData409);
2469
+ return throwException("Conflict", status, _responseText, _headers, result409);
2470
+ }
2471
+ else if (status === 401) {
2472
+ const _responseText = response.data;
2473
+ return throwException("Unauthorized", status, _responseText, _headers);
2474
+ }
2475
+ else if (status === 403) {
2476
+ const _responseText = response.data;
2477
+ return throwException("Forbidden", status, _responseText, _headers);
2478
+ }
2479
+ else if (status !== 200 && status !== 204) {
2480
+ const _responseText = response.data;
2481
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
2482
+ }
2483
+ return Promise.resolve(null);
2484
+ }
2485
+ /**
2486
+ * Returns a product link.
2487
+ * @param id Product identifier.
2488
+ * @param productLinkId Product link identifier.
2489
+ * @param productVersionId (optional)
2490
+ * @param tenantId (optional) Tenant identifier.
2491
+ * @return Success
2492
+ */
2493
+ getProductLink(id, productLinkId, productVersionId, tenantId, cancelToken) {
2494
+ let url_ = this.baseUrl + "/api/storefront/v1/products/{id}/links/{productLinkId}?";
2495
+ if (id === undefined || id === null)
2496
+ throw new Error("The parameter 'id' must be defined.");
2497
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
2498
+ if (productLinkId === undefined || productLinkId === null)
2499
+ throw new Error("The parameter 'productLinkId' must be defined.");
2500
+ url_ = url_.replace("{productLinkId}", encodeURIComponent("" + productLinkId));
2501
+ if (productVersionId !== undefined && productVersionId !== null)
2502
+ url_ += "productVersionId=" + encodeURIComponent("" + productVersionId) + "&";
2503
+ if (tenantId !== undefined && tenantId !== null)
2504
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
2505
+ url_ = url_.replace(/[?&]$/, "");
2506
+ let options_ = {
2507
+ method: "GET",
2508
+ url: url_,
2509
+ headers: {
2510
+ "Accept": "application/json"
2511
+ },
2512
+ cancelToken
2513
+ };
2514
+ return this.transformOptions(options_).then(transformedOptions_ => {
2515
+ return this.instance.request(transformedOptions_);
2516
+ }).catch((_error) => {
2517
+ if (isAxiosError(_error) && _error.response) {
2518
+ return _error.response;
2519
+ }
2520
+ else {
2521
+ throw _error;
2522
+ }
2523
+ }).then((_response) => {
2524
+ return this.transformResult(url_, _response, (_response) => this.processGetProductLink(_response));
2525
+ });
2526
+ }
2527
+ processGetProductLink(response) {
2528
+ const status = response.status;
2529
+ let _headers = {};
2530
+ if (response.headers && typeof response.headers === "object") {
2531
+ for (let k in response.headers) {
2532
+ if (response.headers.hasOwnProperty(k)) {
2533
+ _headers[k] = response.headers[k];
2534
+ }
2535
+ }
2536
+ }
2537
+ if (status === 200) {
2538
+ const _responseText = response.data;
2539
+ let result200 = null;
2540
+ let resultData200 = _responseText;
2541
+ result200 = JSON.parse(resultData200);
2542
+ return Promise.resolve(result200);
2543
+ }
2544
+ else if (status === 404) {
2545
+ const _responseText = response.data;
2546
+ let result404 = null;
2547
+ let resultData404 = _responseText;
2548
+ result404 = JSON.parse(resultData404);
2549
+ return throwException("Not Found", status, _responseText, _headers, result404);
2550
+ }
2551
+ else if (status === 409) {
2552
+ const _responseText = response.data;
2553
+ let result409 = null;
2554
+ let resultData409 = _responseText;
2555
+ result409 = JSON.parse(resultData409);
2556
+ return throwException("Conflict", status, _responseText, _headers, result409);
2557
+ }
2558
+ else if (status === 401) {
2559
+ const _responseText = response.data;
2560
+ return throwException("Unauthorized", status, _responseText, _headers);
2561
+ }
2562
+ else if (status === 403) {
2563
+ const _responseText = response.data;
2564
+ return throwException("Forbidden", status, _responseText, _headers);
2565
+ }
2566
+ else if (status !== 200 && status !== 204) {
2567
+ const _responseText = response.data;
2568
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
2569
+ }
2570
+ return Promise.resolve(null);
2571
+ }
2572
+ /**
2573
+ * Returns a list of product variants.
2574
+ * @param id Product identifier.
2575
+ * @param productVersionId (optional) Product version identifier.
2576
+ * @param skip (optional) Defines page start offset from beginning of sorted result list.
2577
+ * @param take (optional) Defines page length (how many consequent items of sorted result list should be taken).
2578
+ * @param options (optional) Defines options filter e.g.: "{ "opt1_id": "opt1_val1_id, opt1_val2_id", "opt2_id": "opt2_val1_id" }".
2579
+ * @param productFilterId (optional) Defines special filter based on product filter with specified identifier.
2580
+ * @param takeAvailableOnly (optional) Defines special filter for available product variants.
2581
+ * @param sku (optional) SKU of linked ecommerce product.
2582
+ * @param tenantId (optional) Tenant identifier.
2583
+ * @return Success
2584
+ */
2585
+ getProductVariants(id, productVersionId, skip, take, options, productFilterId, takeAvailableOnly, sku, tenantId, cancelToken) {
2586
+ let url_ = this.baseUrl + "/api/storefront/v1/products/{id}/variants?";
2587
+ if (id === undefined || id === null)
2588
+ throw new Error("The parameter 'id' must be defined.");
2589
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
2590
+ if (productVersionId !== undefined && productVersionId !== null)
2591
+ url_ += "productVersionId=" + encodeURIComponent("" + productVersionId) + "&";
2592
+ if (skip !== undefined && skip !== null)
2593
+ url_ += "skip=" + encodeURIComponent("" + skip) + "&";
2594
+ if (take !== undefined && take !== null)
2595
+ url_ += "take=" + encodeURIComponent("" + take) + "&";
2596
+ if (options !== undefined && options !== null)
2597
+ url_ += "options=" + encodeURIComponent("" + options) + "&";
2598
+ if (productFilterId !== undefined && productFilterId !== null)
2599
+ url_ += "productFilterId=" + encodeURIComponent("" + productFilterId) + "&";
2600
+ if (takeAvailableOnly !== undefined && takeAvailableOnly !== null)
2601
+ url_ += "takeAvailableOnly=" + encodeURIComponent("" + takeAvailableOnly) + "&";
2602
+ if (sku !== undefined && sku !== null)
2603
+ url_ += "sku=" + encodeURIComponent("" + sku) + "&";
2604
+ if (tenantId !== undefined && tenantId !== null)
2605
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
2606
+ url_ = url_.replace(/[?&]$/, "");
2607
+ let options_ = {
2608
+ method: "GET",
2609
+ url: url_,
2610
+ headers: {
2611
+ "Accept": "application/json"
2612
+ },
2613
+ cancelToken
2614
+ };
2615
+ return this.transformOptions(options_).then(transformedOptions_ => {
2616
+ return this.instance.request(transformedOptions_);
2617
+ }).catch((_error) => {
2618
+ if (isAxiosError(_error) && _error.response) {
2619
+ return _error.response;
2620
+ }
2621
+ else {
2622
+ throw _error;
2623
+ }
2624
+ }).then((_response) => {
2625
+ return this.transformResult(url_, _response, (_response) => this.processGetProductVariants(_response));
2626
+ });
2627
+ }
2628
+ processGetProductVariants(response) {
2629
+ const status = response.status;
2630
+ let _headers = {};
2631
+ if (response.headers && typeof response.headers === "object") {
2632
+ for (let k in response.headers) {
2633
+ if (response.headers.hasOwnProperty(k)) {
2634
+ _headers[k] = response.headers[k];
2635
+ }
2636
+ }
2637
+ }
2638
+ if (status === 200) {
2639
+ const _responseText = response.data;
2640
+ let result200 = null;
2641
+ let resultData200 = _responseText;
2642
+ result200 = JSON.parse(resultData200);
2643
+ return Promise.resolve(result200);
2644
+ }
2645
+ else if (status === 404) {
2646
+ const _responseText = response.data;
2647
+ let result404 = null;
2648
+ let resultData404 = _responseText;
2649
+ result404 = JSON.parse(resultData404);
2650
+ return throwException("Not Found", status, _responseText, _headers, result404);
2651
+ }
2652
+ else if (status === 409) {
2653
+ const _responseText = response.data;
2654
+ let result409 = null;
2655
+ let resultData409 = _responseText;
2656
+ result409 = JSON.parse(resultData409);
2657
+ return throwException("Conflict", status, _responseText, _headers, result409);
2658
+ }
2659
+ else if (status === 401) {
2660
+ const _responseText = response.data;
2661
+ return throwException("Unauthorized", status, _responseText, _headers);
2662
+ }
2663
+ else if (status === 403) {
2664
+ const _responseText = response.data;
2665
+ return throwException("Forbidden", status, _responseText, _headers);
2666
+ }
2667
+ else if (status !== 200 && status !== 204) {
2668
+ const _responseText = response.data;
2669
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
2670
+ }
2671
+ return Promise.resolve(null);
2672
+ }
2673
+ /**
2674
+ * Returns a product variant.
2675
+ * @param id Product identifier.
2676
+ * @param productVariantId Product variant identifier.
2677
+ * @param productVersionId (optional) Product version identifier.
2678
+ * @param tenantId (optional) Tenant identifier.
2679
+ * @return Success
2680
+ */
2681
+ getProductVariant(id, productVariantId, productVersionId, tenantId, cancelToken) {
2682
+ let url_ = this.baseUrl + "/api/storefront/v1/products/{id}/variants/{productVariantId}?";
2683
+ if (id === undefined || id === null)
2684
+ throw new Error("The parameter 'id' must be defined.");
2685
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
2686
+ if (productVariantId === undefined || productVariantId === null)
2687
+ throw new Error("The parameter 'productVariantId' must be defined.");
2688
+ url_ = url_.replace("{productVariantId}", encodeURIComponent("" + productVariantId));
2689
+ if (productVersionId !== undefined && productVersionId !== null)
2690
+ url_ += "productVersionId=" + encodeURIComponent("" + productVersionId) + "&";
2691
+ if (tenantId !== undefined && tenantId !== null)
2692
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
2693
+ url_ = url_.replace(/[?&]$/, "");
2694
+ let options_ = {
2695
+ method: "GET",
2696
+ url: url_,
2697
+ headers: {
2698
+ "Accept": "application/json"
2699
+ },
2700
+ cancelToken
2701
+ };
2702
+ return this.transformOptions(options_).then(transformedOptions_ => {
2703
+ return this.instance.request(transformedOptions_);
2704
+ }).catch((_error) => {
2705
+ if (isAxiosError(_error) && _error.response) {
2706
+ return _error.response;
2707
+ }
2708
+ else {
2709
+ throw _error;
2710
+ }
2711
+ }).then((_response) => {
2712
+ return this.transformResult(url_, _response, (_response) => this.processGetProductVariant(_response));
2713
+ });
2714
+ }
2715
+ processGetProductVariant(response) {
2716
+ const status = response.status;
2717
+ let _headers = {};
2718
+ if (response.headers && typeof response.headers === "object") {
2719
+ for (let k in response.headers) {
2720
+ if (response.headers.hasOwnProperty(k)) {
2721
+ _headers[k] = response.headers[k];
2722
+ }
2723
+ }
2724
+ }
2725
+ if (status === 200) {
2726
+ const _responseText = response.data;
2727
+ let result200 = null;
2728
+ let resultData200 = _responseText;
2729
+ result200 = JSON.parse(resultData200);
2730
+ return Promise.resolve(result200);
2731
+ }
2732
+ else if (status === 404) {
2733
+ const _responseText = response.data;
2734
+ let result404 = null;
2735
+ let resultData404 = _responseText;
2736
+ result404 = JSON.parse(resultData404);
2737
+ return throwException("Not Found", status, _responseText, _headers, result404);
2738
+ }
2739
+ else if (status === 409) {
2740
+ const _responseText = response.data;
2741
+ let result409 = null;
2742
+ let resultData409 = _responseText;
2743
+ result409 = JSON.parse(resultData409);
2744
+ return throwException("Conflict", status, _responseText, _headers, result409);
2745
+ }
2746
+ else if (status === 401) {
2747
+ const _responseText = response.data;
2748
+ return throwException("Unauthorized", status, _responseText, _headers);
2749
+ }
2750
+ else if (status === 403) {
2751
+ const _responseText = response.data;
2752
+ return throwException("Forbidden", status, _responseText, _headers);
2753
+ }
2754
+ else if (status !== 200 && status !== 204) {
2755
+ const _responseText = response.data;
2756
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
2757
+ }
2758
+ return Promise.resolve(null);
2759
+ }
2760
+ /**
2761
+ * Returns a list of product variant designs.
2762
+ * @param id Product identifier.
2763
+ * @param productVersionId (optional) Product version identifier.
2764
+ * @param productVariantId (optional) Product variant identifier.
2765
+ * @param search (optional) Search string for design name partial match.
2766
+ * @param designCustomFields (optional) Custom attributes dictionary filter for designs. For example: {"public":"true","name":"my item"}
2767
+ * @param designPath (optional) Path filter for designs. Subfolders included by default.
2768
+ * @param skip (optional) Defines page start offset from beginning of sorted result list.
2769
+ * @param take (optional) Defines page length (how many consequent items of sorted result list should be taken).
2770
+ * @param options (optional) Defines options filter e.g.: "{ "opt1_id": "opt1_val1_id, opt1_val2_id", "opt2_id": "opt2_val1_id" }".
2771
+ * @param productFilterId (optional) Defines special filter based on product filter with specified identifier.
2772
+ * @param takeAvailableOnly (optional) Defines special filter for available product variants.
2773
+ * @param sku (optional) SKU of linked ecommerce product.
2774
+ * @param tenantId (optional) Tenant identifier.
2775
+ * @return Success
2776
+ */
2777
+ getProductVariantDesigns(id, productVersionId, productVariantId, search, designCustomFields, designPath, skip, take, options, productFilterId, takeAvailableOnly, sku, tenantId, cancelToken) {
2778
+ let url_ = this.baseUrl + "/api/storefront/v1/products/{id}/variant-designs?";
2779
+ if (id === undefined || id === null)
2780
+ throw new Error("The parameter 'id' must be defined.");
2781
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
2782
+ if (productVersionId !== undefined && productVersionId !== null)
2783
+ url_ += "productVersionId=" + encodeURIComponent("" + productVersionId) + "&";
2784
+ if (productVariantId !== undefined && productVariantId !== null)
2785
+ url_ += "productVariantId=" + encodeURIComponent("" + productVariantId) + "&";
2786
+ if (search !== undefined && search !== null)
2787
+ url_ += "search=" + encodeURIComponent("" + search) + "&";
2788
+ if (designCustomFields !== undefined && designCustomFields !== null)
2789
+ url_ += "designCustomFields=" + encodeURIComponent("" + designCustomFields) + "&";
2790
+ if (designPath !== undefined && designPath !== null)
2791
+ url_ += "designPath=" + encodeURIComponent("" + designPath) + "&";
2792
+ if (skip !== undefined && skip !== null)
2793
+ url_ += "skip=" + encodeURIComponent("" + skip) + "&";
2794
+ if (take !== undefined && take !== null)
2795
+ url_ += "take=" + encodeURIComponent("" + take) + "&";
2796
+ if (options !== undefined && options !== null)
2797
+ url_ += "options=" + encodeURIComponent("" + options) + "&";
2798
+ if (productFilterId !== undefined && productFilterId !== null)
2799
+ url_ += "productFilterId=" + encodeURIComponent("" + productFilterId) + "&";
2800
+ if (takeAvailableOnly !== undefined && takeAvailableOnly !== null)
2801
+ url_ += "takeAvailableOnly=" + encodeURIComponent("" + takeAvailableOnly) + "&";
2802
+ if (sku !== undefined && sku !== null)
2803
+ url_ += "sku=" + encodeURIComponent("" + sku) + "&";
2804
+ if (tenantId !== undefined && tenantId !== null)
2805
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
2806
+ url_ = url_.replace(/[?&]$/, "");
2807
+ let options_ = {
2808
+ method: "GET",
2809
+ url: url_,
2810
+ headers: {
2811
+ "Accept": "application/json"
2812
+ },
2813
+ cancelToken
2814
+ };
2815
+ return this.transformOptions(options_).then(transformedOptions_ => {
2816
+ return this.instance.request(transformedOptions_);
2817
+ }).catch((_error) => {
2818
+ if (isAxiosError(_error) && _error.response) {
2819
+ return _error.response;
2820
+ }
2821
+ else {
2822
+ throw _error;
2823
+ }
2824
+ }).then((_response) => {
2825
+ return this.transformResult(url_, _response, (_response) => this.processGetProductVariantDesigns(_response));
2826
+ });
2827
+ }
2828
+ processGetProductVariantDesigns(response) {
2829
+ const status = response.status;
2830
+ let _headers = {};
2831
+ if (response.headers && typeof response.headers === "object") {
2832
+ for (let k in response.headers) {
2833
+ if (response.headers.hasOwnProperty(k)) {
2834
+ _headers[k] = response.headers[k];
2835
+ }
2836
+ }
2837
+ }
2838
+ if (status === 200) {
2839
+ const _responseText = response.data;
2840
+ let result200 = null;
2841
+ let resultData200 = _responseText;
2842
+ result200 = JSON.parse(resultData200);
2843
+ return Promise.resolve(result200);
2844
+ }
2845
+ else if (status === 404) {
2846
+ const _responseText = response.data;
2847
+ let result404 = null;
2848
+ let resultData404 = _responseText;
2849
+ result404 = JSON.parse(resultData404);
2850
+ return throwException("Not Found", status, _responseText, _headers, result404);
2851
+ }
2852
+ else if (status === 409) {
2853
+ const _responseText = response.data;
2854
+ let result409 = null;
2855
+ let resultData409 = _responseText;
2856
+ result409 = JSON.parse(resultData409);
2857
+ return throwException("Conflict", status, _responseText, _headers, result409);
2858
+ }
2859
+ else if (status === 401) {
2860
+ const _responseText = response.data;
2861
+ return throwException("Unauthorized", status, _responseText, _headers);
2862
+ }
2863
+ else if (status === 403) {
2864
+ const _responseText = response.data;
2865
+ return throwException("Forbidden", status, _responseText, _headers);
2866
+ }
2867
+ else if (status !== 200 && status !== 204) {
2868
+ const _responseText = response.data;
2869
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
2870
+ }
2871
+ return Promise.resolve(null);
2872
+ }
2873
+ /**
2874
+ * Returns a list of product variant mockups.
2875
+ * @param id Product identifier.
2876
+ * @param productVersionId (optional) Product version identifier.
2877
+ * @param productVariantId (optional) Product variant identifier.
2878
+ * @param search (optional) Search string for design name partial match.
2879
+ * @param mockupCustomFields (optional) Custom attributes dictionary filter for mockups. For example: {"public":"true","name":"my item"}
2880
+ * @param mockupPath (optional) Path filter for mockups. Subfolders included by default.
2881
+ * @param skip (optional) Defines page start offset from beginning of sorted result list.
2882
+ * @param take (optional) Defines page length (how many consequent items of sorted result list should be taken).
2883
+ * @param options (optional) Defines options filter e.g.: "{ "opt1_id": "opt1_val1_id, opt1_val2_id", "opt2_id": "opt2_val1_id" }".
2884
+ * @param productFilterId (optional) Defines special filter based on product filter with specified identifier.
2885
+ * @param takeAvailableOnly (optional) Defines special filter for available product variants.
2886
+ * @param sku (optional) SKU of linked ecommerce product.
2887
+ * @param tenantId (optional) Tenant identifier.
2888
+ * @return Success
2889
+ */
2890
+ getProductVariantMockups(id, productVersionId, productVariantId, search, mockupCustomFields, mockupPath, skip, take, options, productFilterId, takeAvailableOnly, sku, tenantId, cancelToken) {
2891
+ let url_ = this.baseUrl + "/api/storefront/v1/products/{id}/variant-mockups?";
2892
+ if (id === undefined || id === null)
2893
+ throw new Error("The parameter 'id' must be defined.");
2894
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
2895
+ if (productVersionId !== undefined && productVersionId !== null)
2896
+ url_ += "productVersionId=" + encodeURIComponent("" + productVersionId) + "&";
2897
+ if (productVariantId !== undefined && productVariantId !== null)
2898
+ url_ += "productVariantId=" + encodeURIComponent("" + productVariantId) + "&";
2899
+ if (search !== undefined && search !== null)
2900
+ url_ += "search=" + encodeURIComponent("" + search) + "&";
2901
+ if (mockupCustomFields !== undefined && mockupCustomFields !== null)
2902
+ url_ += "mockupCustomFields=" + encodeURIComponent("" + mockupCustomFields) + "&";
2903
+ if (mockupPath !== undefined && mockupPath !== null)
2904
+ url_ += "mockupPath=" + encodeURIComponent("" + mockupPath) + "&";
2905
+ if (skip !== undefined && skip !== null)
2906
+ url_ += "skip=" + encodeURIComponent("" + skip) + "&";
2907
+ if (take !== undefined && take !== null)
2908
+ url_ += "take=" + encodeURIComponent("" + take) + "&";
2909
+ if (options !== undefined && options !== null)
2910
+ url_ += "options=" + encodeURIComponent("" + options) + "&";
2911
+ if (productFilterId !== undefined && productFilterId !== null)
2912
+ url_ += "productFilterId=" + encodeURIComponent("" + productFilterId) + "&";
2913
+ if (takeAvailableOnly !== undefined && takeAvailableOnly !== null)
2914
+ url_ += "takeAvailableOnly=" + encodeURIComponent("" + takeAvailableOnly) + "&";
2915
+ if (sku !== undefined && sku !== null)
2916
+ url_ += "sku=" + encodeURIComponent("" + sku) + "&";
2917
+ if (tenantId !== undefined && tenantId !== null)
2918
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
2919
+ url_ = url_.replace(/[?&]$/, "");
2920
+ let options_ = {
2921
+ method: "GET",
2922
+ url: url_,
2923
+ headers: {
2924
+ "Accept": "application/json"
2925
+ },
2926
+ cancelToken
2927
+ };
2928
+ return this.transformOptions(options_).then(transformedOptions_ => {
2929
+ return this.instance.request(transformedOptions_);
2930
+ }).catch((_error) => {
2931
+ if (isAxiosError(_error) && _error.response) {
2932
+ return _error.response;
2933
+ }
2934
+ else {
2935
+ throw _error;
2936
+ }
2937
+ }).then((_response) => {
2938
+ return this.transformResult(url_, _response, (_response) => this.processGetProductVariantMockups(_response));
2939
+ });
2940
+ }
2941
+ processGetProductVariantMockups(response) {
2942
+ const status = response.status;
2943
+ let _headers = {};
2944
+ if (response.headers && typeof response.headers === "object") {
2945
+ for (let k in response.headers) {
2946
+ if (response.headers.hasOwnProperty(k)) {
2947
+ _headers[k] = response.headers[k];
2948
+ }
2949
+ }
2950
+ }
2951
+ if (status === 200) {
2952
+ const _responseText = response.data;
2953
+ let result200 = null;
2954
+ let resultData200 = _responseText;
2955
+ result200 = JSON.parse(resultData200);
2956
+ return Promise.resolve(result200);
2957
+ }
2958
+ else if (status === 404) {
2959
+ const _responseText = response.data;
2960
+ let result404 = null;
2961
+ let resultData404 = _responseText;
2962
+ result404 = JSON.parse(resultData404);
2963
+ return throwException("Not Found", status, _responseText, _headers, result404);
2964
+ }
2965
+ else if (status === 409) {
2966
+ const _responseText = response.data;
2967
+ let result409 = null;
2968
+ let resultData409 = _responseText;
2969
+ result409 = JSON.parse(resultData409);
2970
+ return throwException("Conflict", status, _responseText, _headers, result409);
2971
+ }
2972
+ else if (status === 401) {
2973
+ const _responseText = response.data;
2974
+ return throwException("Unauthorized", status, _responseText, _headers);
2975
+ }
2976
+ else if (status === 403) {
2977
+ const _responseText = response.data;
2978
+ return throwException("Forbidden", status, _responseText, _headers);
2979
+ }
2980
+ else if (status !== 200 && status !== 204) {
2981
+ const _responseText = response.data;
2982
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
2983
+ }
2984
+ return Promise.resolve(null);
2985
+ }
2986
+ /**
2987
+ * Returns a list of product variant documents.
2988
+ * @param id Product identifier.
2989
+ * @param productVersionId (optional) Product version identifier.
2990
+ * @param productVariantId (optional) Product variant identifier.
2991
+ * @param search (optional) Search string for document name partial match.
2992
+ * @param documentCustomFields (optional) Custom attributes dictionary filter for documents. For example: {"public":"true","name":"my item"}
2993
+ * @param documentPath (optional) Path filter for documents. Subfolders included by default.
2994
+ * @param skip (optional) Defines page start offset from beginning of sorted result list.
2995
+ * @param take (optional) Defines page length (how many consequent items of sorted result list should be taken).
2996
+ * @param options (optional) Defines options filter e.g.: "{ "opt1_id": "opt1_val1_id, opt1_val2_id", "opt2_id": "opt2_val1_id" }".
2997
+ * @param productFilterId (optional) Defines special filter based on product filter with specified identifier.
2998
+ * @param takeAvailableOnly (optional) Defines special filter for available product variants.
2999
+ * @param sku (optional) SKU of linked ecommerce product.
3000
+ * @param tenantId (optional) Tenant identifier.
3001
+ * @return Success
3002
+ */
3003
+ getProductVariantDocuments(id, productVersionId, productVariantId, search, documentCustomFields, documentPath, skip, take, options, productFilterId, takeAvailableOnly, sku, tenantId, cancelToken) {
3004
+ let url_ = this.baseUrl + "/api/storefront/v1/products/{id}/variant-documents?";
3005
+ if (id === undefined || id === null)
3006
+ throw new Error("The parameter 'id' must be defined.");
3007
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
3008
+ if (productVersionId !== undefined && productVersionId !== null)
3009
+ url_ += "productVersionId=" + encodeURIComponent("" + productVersionId) + "&";
3010
+ if (productVariantId !== undefined && productVariantId !== null)
3011
+ url_ += "productVariantId=" + encodeURIComponent("" + productVariantId) + "&";
3012
+ if (search !== undefined && search !== null)
3013
+ url_ += "search=" + encodeURIComponent("" + search) + "&";
3014
+ if (documentCustomFields !== undefined && documentCustomFields !== null)
3015
+ url_ += "documentCustomFields=" + encodeURIComponent("" + documentCustomFields) + "&";
3016
+ if (documentPath !== undefined && documentPath !== null)
3017
+ url_ += "documentPath=" + encodeURIComponent("" + documentPath) + "&";
3018
+ if (skip !== undefined && skip !== null)
3019
+ url_ += "skip=" + encodeURIComponent("" + skip) + "&";
3020
+ if (take !== undefined && take !== null)
3021
+ url_ += "take=" + encodeURIComponent("" + take) + "&";
3022
+ if (options !== undefined && options !== null)
3023
+ url_ += "options=" + encodeURIComponent("" + options) + "&";
3024
+ if (productFilterId !== undefined && productFilterId !== null)
3025
+ url_ += "productFilterId=" + encodeURIComponent("" + productFilterId) + "&";
3026
+ if (takeAvailableOnly !== undefined && takeAvailableOnly !== null)
3027
+ url_ += "takeAvailableOnly=" + encodeURIComponent("" + takeAvailableOnly) + "&";
3028
+ if (sku !== undefined && sku !== null)
3029
+ url_ += "sku=" + encodeURIComponent("" + sku) + "&";
3030
+ if (tenantId !== undefined && tenantId !== null)
3031
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
3032
+ url_ = url_.replace(/[?&]$/, "");
3033
+ let options_ = {
3034
+ method: "GET",
3035
+ url: url_,
3036
+ headers: {
3037
+ "Accept": "application/json"
836
3038
  },
837
3039
  cancelToken
838
3040
  };
@@ -846,10 +3048,10 @@ export class ProductReferencesApiClient extends ApiClientBase {
846
3048
  throw _error;
847
3049
  }
848
3050
  }).then((_response) => {
849
- return this.transformResult(url_, _response, (_response) => this.processGetPersonalizationWorkflow(_response));
3051
+ return this.transformResult(url_, _response, (_response) => this.processGetProductVariantDocuments(_response));
850
3052
  });
851
3053
  }
852
- processGetPersonalizationWorkflow(response) {
3054
+ processGetProductVariantDocuments(response) {
853
3055
  const status = response.status;
854
3056
  let _headers = {};
855
3057
  if (response.headers && typeof response.headers === "object") {
@@ -873,6 +3075,239 @@ export class ProductReferencesApiClient extends ApiClientBase {
873
3075
  result404 = JSON.parse(resultData404);
874
3076
  return throwException("Not Found", status, _responseText, _headers, result404);
875
3077
  }
3078
+ else if (status === 409) {
3079
+ const _responseText = response.data;
3080
+ let result409 = null;
3081
+ let resultData409 = _responseText;
3082
+ result409 = JSON.parse(resultData409);
3083
+ return throwException("Conflict", status, _responseText, _headers, result409);
3084
+ }
3085
+ else if (status === 401) {
3086
+ const _responseText = response.data;
3087
+ return throwException("Unauthorized", status, _responseText, _headers);
3088
+ }
3089
+ else if (status === 403) {
3090
+ const _responseText = response.data;
3091
+ return throwException("Forbidden", status, _responseText, _headers);
3092
+ }
3093
+ else if (status !== 200 && status !== 204) {
3094
+ const _responseText = response.data;
3095
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
3096
+ }
3097
+ return Promise.resolve(null);
3098
+ }
3099
+ /**
3100
+ * Updates product variant resources.
3101
+ * @param id Product identifier.
3102
+ * @param productVersionId (optional) Product version identifier.
3103
+ * @param tenantId (optional) Tenant identifier.
3104
+ * @return Success
3105
+ */
3106
+ updateProductVariantResources(id, productVersionId, tenantId, cancelToken) {
3107
+ let url_ = this.baseUrl + "/api/storefront/v1/products/{id}/update-variant-resources?";
3108
+ if (id === undefined || id === null)
3109
+ throw new Error("The parameter 'id' must be defined.");
3110
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
3111
+ if (productVersionId !== undefined && productVersionId !== null)
3112
+ url_ += "productVersionId=" + encodeURIComponent("" + productVersionId) + "&";
3113
+ if (tenantId !== undefined && tenantId !== null)
3114
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
3115
+ url_ = url_.replace(/[?&]$/, "");
3116
+ let options_ = {
3117
+ method: "POST",
3118
+ url: url_,
3119
+ headers: {},
3120
+ cancelToken
3121
+ };
3122
+ return this.transformOptions(options_).then(transformedOptions_ => {
3123
+ return this.instance.request(transformedOptions_);
3124
+ }).catch((_error) => {
3125
+ if (isAxiosError(_error) && _error.response) {
3126
+ return _error.response;
3127
+ }
3128
+ else {
3129
+ throw _error;
3130
+ }
3131
+ }).then((_response) => {
3132
+ return this.transformResult(url_, _response, (_response) => this.processUpdateProductVariantResources(_response));
3133
+ });
3134
+ }
3135
+ processUpdateProductVariantResources(response) {
3136
+ const status = response.status;
3137
+ let _headers = {};
3138
+ if (response.headers && typeof response.headers === "object") {
3139
+ for (let k in response.headers) {
3140
+ if (response.headers.hasOwnProperty(k)) {
3141
+ _headers[k] = response.headers[k];
3142
+ }
3143
+ }
3144
+ }
3145
+ if (status === 200) {
3146
+ const _responseText = response.data;
3147
+ return Promise.resolve(null);
3148
+ }
3149
+ else if (status === 404) {
3150
+ const _responseText = response.data;
3151
+ let result404 = null;
3152
+ let resultData404 = _responseText;
3153
+ result404 = JSON.parse(resultData404);
3154
+ return throwException("Not Found", status, _responseText, _headers, result404);
3155
+ }
3156
+ else if (status === 409) {
3157
+ const _responseText = response.data;
3158
+ let result409 = null;
3159
+ let resultData409 = _responseText;
3160
+ result409 = JSON.parse(resultData409);
3161
+ return throwException("Conflict", status, _responseText, _headers, result409);
3162
+ }
3163
+ else if (status === 401) {
3164
+ const _responseText = response.data;
3165
+ return throwException("Unauthorized", status, _responseText, _headers);
3166
+ }
3167
+ else if (status === 403) {
3168
+ const _responseText = response.data;
3169
+ return throwException("Forbidden", status, _responseText, _headers);
3170
+ }
3171
+ else if (status !== 200 && status !== 204) {
3172
+ const _responseText = response.data;
3173
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
3174
+ }
3175
+ return Promise.resolve(null);
3176
+ }
3177
+ /**
3178
+ * Set product variant price.
3179
+ * @param id Product identifier.
3180
+ * @param productVersionId (optional) Product version identifier.
3181
+ * @param tenantId (optional) Tenant identifier.
3182
+ * @param body (optional) Set product variant price operation parameters.
3183
+ * @return Success
3184
+ */
3185
+ setProductVariantPrice(id, productVersionId, tenantId, body, cancelToken) {
3186
+ let url_ = this.baseUrl + "/api/storefront/v1/products/{id}/set-variant-price?";
3187
+ if (id === undefined || id === null)
3188
+ throw new Error("The parameter 'id' must be defined.");
3189
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
3190
+ if (productVersionId !== undefined && productVersionId !== null)
3191
+ url_ += "productVersionId=" + encodeURIComponent("" + productVersionId) + "&";
3192
+ if (tenantId !== undefined && tenantId !== null)
3193
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
3194
+ url_ = url_.replace(/[?&]$/, "");
3195
+ const content_ = JSON.stringify(body);
3196
+ let options_ = {
3197
+ data: content_,
3198
+ method: "POST",
3199
+ url: url_,
3200
+ headers: {
3201
+ "Content-Type": "application/json",
3202
+ },
3203
+ cancelToken
3204
+ };
3205
+ return this.transformOptions(options_).then(transformedOptions_ => {
3206
+ return this.instance.request(transformedOptions_);
3207
+ }).catch((_error) => {
3208
+ if (isAxiosError(_error) && _error.response) {
3209
+ return _error.response;
3210
+ }
3211
+ else {
3212
+ throw _error;
3213
+ }
3214
+ }).then((_response) => {
3215
+ return this.transformResult(url_, _response, (_response) => this.processSetProductVariantPrice(_response));
3216
+ });
3217
+ }
3218
+ processSetProductVariantPrice(response) {
3219
+ const status = response.status;
3220
+ let _headers = {};
3221
+ if (response.headers && typeof response.headers === "object") {
3222
+ for (let k in response.headers) {
3223
+ if (response.headers.hasOwnProperty(k)) {
3224
+ _headers[k] = response.headers[k];
3225
+ }
3226
+ }
3227
+ }
3228
+ if (status === 200) {
3229
+ const _responseText = response.data;
3230
+ return Promise.resolve(null);
3231
+ }
3232
+ else if (status === 404) {
3233
+ const _responseText = response.data;
3234
+ let result404 = null;
3235
+ let resultData404 = _responseText;
3236
+ result404 = JSON.parse(resultData404);
3237
+ return throwException("Not Found", status, _responseText, _headers, result404);
3238
+ }
3239
+ else if (status === 409) {
3240
+ const _responseText = response.data;
3241
+ let result409 = null;
3242
+ let resultData409 = _responseText;
3243
+ result409 = JSON.parse(resultData409);
3244
+ return throwException("Conflict", status, _responseText, _headers, result409);
3245
+ }
3246
+ else if (status === 401) {
3247
+ const _responseText = response.data;
3248
+ return throwException("Unauthorized", status, _responseText, _headers);
3249
+ }
3250
+ else if (status === 403) {
3251
+ const _responseText = response.data;
3252
+ return throwException("Forbidden", status, _responseText, _headers);
3253
+ }
3254
+ else if (status !== 200 && status !== 204) {
3255
+ const _responseText = response.data;
3256
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
3257
+ }
3258
+ return Promise.resolve(null);
3259
+ }
3260
+ /**
3261
+ * Returns a list of all available product tags.
3262
+ * @param search (optional) Search string for partial match.
3263
+ * @param tenantId (optional) Tenant identifier.
3264
+ * @return Success
3265
+ */
3266
+ getAvailableProductTags(search, tenantId, cancelToken) {
3267
+ let url_ = this.baseUrl + "/api/storefront/v1/products/available-tags?";
3268
+ if (search !== undefined && search !== null)
3269
+ url_ += "search=" + encodeURIComponent("" + search) + "&";
3270
+ if (tenantId !== undefined && tenantId !== null)
3271
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
3272
+ url_ = url_.replace(/[?&]$/, "");
3273
+ let options_ = {
3274
+ method: "GET",
3275
+ url: url_,
3276
+ headers: {
3277
+ "Accept": "application/json"
3278
+ },
3279
+ cancelToken
3280
+ };
3281
+ return this.transformOptions(options_).then(transformedOptions_ => {
3282
+ return this.instance.request(transformedOptions_);
3283
+ }).catch((_error) => {
3284
+ if (isAxiosError(_error) && _error.response) {
3285
+ return _error.response;
3286
+ }
3287
+ else {
3288
+ throw _error;
3289
+ }
3290
+ }).then((_response) => {
3291
+ return this.transformResult(url_, _response, (_response) => this.processGetAvailableProductTags(_response));
3292
+ });
3293
+ }
3294
+ processGetAvailableProductTags(response) {
3295
+ const status = response.status;
3296
+ let _headers = {};
3297
+ if (response.headers && typeof response.headers === "object") {
3298
+ for (let k in response.headers) {
3299
+ if (response.headers.hasOwnProperty(k)) {
3300
+ _headers[k] = response.headers[k];
3301
+ }
3302
+ }
3303
+ }
3304
+ if (status === 200) {
3305
+ const _responseText = response.data;
3306
+ let result200 = null;
3307
+ let resultData200 = _responseText;
3308
+ result200 = JSON.parse(resultData200);
3309
+ return Promise.resolve(result200);
3310
+ }
876
3311
  else if (status === 401) {
877
3312
  const _responseText = response.data;
878
3313
  return throwException("Unauthorized", status, _responseText, _headers);
@@ -888,22 +3323,25 @@ export class ProductReferencesApiClient extends ApiClientBase {
888
3323
  return Promise.resolve(null);
889
3324
  }
890
3325
  /**
891
- * Returns a product personalization workflow configuration by storefront product reference.
892
- * @param reference Product reference - external reference to Customer's Canvas product specification, e.g online store product identifier.
893
- * @param storefrontId Storefront identifier.
3326
+ * Returns a product personalization workflow description by product identifier.
3327
+ * @param id Product identifier.
3328
+ * @param productVersionId (optional) Product version identifier.
3329
+ * @param productLinkId (optional) Product link identifier.
3330
+ * @param productFilterId (optional) Product filter identifier.
894
3331
  * @param tenantId (optional) Tenant identifier.
895
3332
  * @return Success
896
- * @deprecated
897
3333
  */
898
- getProductConfig(reference, storefrontId, tenantId, cancelToken) {
899
- let url_ = this.baseUrl + "/api/storefront/v1/product-references/{reference}/product-config?";
900
- if (reference === undefined || reference === null)
901
- throw new Error("The parameter 'reference' must be defined.");
902
- url_ = url_.replace("{reference}", encodeURIComponent("" + reference));
903
- if (storefrontId === undefined || storefrontId === null)
904
- throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
905
- else
906
- url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
3334
+ getPersonalizationWorkflow(id, productVersionId, productLinkId, productFilterId, tenantId, cancelToken) {
3335
+ let url_ = this.baseUrl + "/api/storefront/v1/products/{id}/personalization-workflow?";
3336
+ if (id === undefined || id === null)
3337
+ throw new Error("The parameter 'id' must be defined.");
3338
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
3339
+ if (productVersionId !== undefined && productVersionId !== null)
3340
+ url_ += "productVersionId=" + encodeURIComponent("" + productVersionId) + "&";
3341
+ if (productLinkId !== undefined && productLinkId !== null)
3342
+ url_ += "productLinkId=" + encodeURIComponent("" + productLinkId) + "&";
3343
+ if (productFilterId !== undefined && productFilterId !== null)
3344
+ url_ += "productFilterId=" + encodeURIComponent("" + productFilterId) + "&";
907
3345
  if (tenantId !== undefined && tenantId !== null)
908
3346
  url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
909
3347
  url_ = url_.replace(/[?&]$/, "");
@@ -911,7 +3349,7 @@ export class ProductReferencesApiClient extends ApiClientBase {
911
3349
  method: "GET",
912
3350
  url: url_,
913
3351
  headers: {
914
- "Accept": "text/plain"
3352
+ "Accept": "application/json"
915
3353
  },
916
3354
  cancelToken
917
3355
  };
@@ -925,10 +3363,10 @@ export class ProductReferencesApiClient extends ApiClientBase {
925
3363
  throw _error;
926
3364
  }
927
3365
  }).then((_response) => {
928
- return this.transformResult(url_, _response, (_response) => this.processGetProductConfig(_response));
3366
+ return this.transformResult(url_, _response, (_response) => this.processGetPersonalizationWorkflow(_response));
929
3367
  });
930
3368
  }
931
- processGetProductConfig(response) {
3369
+ processGetPersonalizationWorkflow(response) {
932
3370
  const status = response.status;
933
3371
  let _headers = {};
934
3372
  if (response.headers && typeof response.headers === "object") {
@@ -942,16 +3380,23 @@ export class ProductReferencesApiClient extends ApiClientBase {
942
3380
  const _responseText = response.data;
943
3381
  let result200 = null;
944
3382
  let resultData200 = _responseText;
945
- result200 = resultData200;
3383
+ result200 = JSON.parse(resultData200);
946
3384
  return Promise.resolve(result200);
947
3385
  }
948
3386
  else if (status === 404) {
949
3387
  const _responseText = response.data;
950
3388
  let result404 = null;
951
3389
  let resultData404 = _responseText;
952
- result404 = resultData404;
3390
+ result404 = JSON.parse(resultData404);
953
3391
  return throwException("Not Found", status, _responseText, _headers, result404);
954
3392
  }
3393
+ else if (status === 409) {
3394
+ const _responseText = response.data;
3395
+ let result409 = null;
3396
+ let resultData409 = _responseText;
3397
+ result409 = JSON.parse(resultData409);
3398
+ return throwException("Conflict", status, _responseText, _headers, result409);
3399
+ }
955
3400
  else if (status === 401) {
956
3401
  const _responseText = response.data;
957
3402
  return throwException("Unauthorized", status, _responseText, _headers);
@@ -1002,7 +3447,7 @@ export class ProductSpecificationsApiClient extends ApiClientBase {
1002
3447
  method: "GET",
1003
3448
  url: url_,
1004
3449
  headers: {
1005
- "Accept": "text/plain"
3450
+ "Accept": "application/json"
1006
3451
  },
1007
3452
  cancelToken
1008
3453
  };
@@ -1068,7 +3513,7 @@ export class ProductSpecificationsApiClient extends ApiClientBase {
1068
3513
  method: "GET",
1069
3514
  url: url_,
1070
3515
  headers: {
1071
- "Accept": "text/plain"
3516
+ "Accept": "application/json"
1072
3517
  },
1073
3518
  cancelToken
1074
3519
  };
@@ -1141,7 +3586,7 @@ export class ProductSpecificationsApiClient extends ApiClientBase {
1141
3586
  method: "GET",
1142
3587
  url: url_,
1143
3588
  headers: {
1144
- "Accept": "text/plain"
3589
+ "Accept": "application/json"
1145
3590
  },
1146
3591
  cancelToken
1147
3592
  };
@@ -1253,7 +3698,7 @@ export class ProductSpecificationsApiClient extends ApiClientBase {
1253
3698
  const _responseText = response.data;
1254
3699
  let result404 = null;
1255
3700
  let resultData404 = _responseText;
1256
- result404 = resultData404;
3701
+ result404 = JSON.parse(resultData404);
1257
3702
  return throwException("Not Found", status, _responseText, _headers, result404);
1258
3703
  }
1259
3704
  else if (status === 401) {
@@ -1292,11 +3737,12 @@ export class ProjectsApiClient extends ApiClientBase {
1292
3737
  * @param search (optional) Search string for partial match.
1293
3738
  * @param orderId (optional) Identifier of corresponding order.
1294
3739
  * @param processingStatus (optional) Project processing status filter.
3740
+ * @param includeObsolete (optional) Indicates if obsolete projects prepared to be removed should be included to result.
1295
3741
  * @param storefrontId (optional) Storefront identifier.
1296
3742
  * @param tenantId (optional) Tenant identifier.
1297
3743
  * @return Success
1298
3744
  */
1299
- getAll(ownerId, productReference, status, datePeriod, skip, take, sorting, search, orderId, processingStatus, storefrontId, tenantId, cancelToken) {
3745
+ getAll(ownerId, productReference, status, datePeriod, skip, take, sorting, search, orderId, processingStatus, includeObsolete, storefrontId, tenantId, cancelToken) {
1300
3746
  let url_ = this.baseUrl + "/api/storefront/v1/projects?";
1301
3747
  if (ownerId !== undefined && ownerId !== null)
1302
3748
  url_ += "ownerId=" + encodeURIComponent("" + ownerId) + "&";
@@ -1320,6 +3766,10 @@ export class ProjectsApiClient extends ApiClientBase {
1320
3766
  url_ += "orderId=" + encodeURIComponent("" + orderId) + "&";
1321
3767
  if (processingStatus !== undefined && processingStatus !== null)
1322
3768
  url_ += "processingStatus=" + encodeURIComponent("" + processingStatus) + "&";
3769
+ if (includeObsolete === null)
3770
+ throw new Error("The parameter 'includeObsolete' cannot be null.");
3771
+ else if (includeObsolete !== undefined)
3772
+ url_ += "includeObsolete=" + encodeURIComponent("" + includeObsolete) + "&";
1323
3773
  if (storefrontId !== undefined && storefrontId !== null)
1324
3774
  url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
1325
3775
  if (tenantId !== undefined && tenantId !== null)
@@ -1329,7 +3779,7 @@ export class ProjectsApiClient extends ApiClientBase {
1329
3779
  method: "GET",
1330
3780
  url: url_,
1331
3781
  headers: {
1332
- "Accept": "text/plain"
3782
+ "Accept": "application/json"
1333
3783
  },
1334
3784
  cancelToken
1335
3785
  };
@@ -1395,7 +3845,7 @@ export class ProjectsApiClient extends ApiClientBase {
1395
3845
  method: "GET",
1396
3846
  url: url_,
1397
3847
  headers: {
1398
- "Accept": "text/plain"
3848
+ "Accept": "application/json"
1399
3849
  },
1400
3850
  cancelToken
1401
3851
  };
@@ -1436,6 +3886,13 @@ export class ProjectsApiClient extends ApiClientBase {
1436
3886
  result404 = JSON.parse(resultData404);
1437
3887
  return throwException("Not Found", status, _responseText, _headers, result404);
1438
3888
  }
3889
+ else if (status === 409) {
3890
+ const _responseText = response.data;
3891
+ let result409 = null;
3892
+ let resultData409 = _responseText;
3893
+ result409 = JSON.parse(resultData409);
3894
+ return throwException("Conflict", status, _responseText, _headers, result409);
3895
+ }
1439
3896
  else if (status === 401) {
1440
3897
  const _responseText = response.data;
1441
3898
  return throwException("Unauthorized", status, _responseText, _headers);
@@ -1504,6 +3961,13 @@ export class ProjectsApiClient extends ApiClientBase {
1504
3961
  result404 = JSON.parse(resultData404);
1505
3962
  return throwException("Not Found", status, _responseText, _headers, result404);
1506
3963
  }
3964
+ else if (status === 409) {
3965
+ const _responseText = response.data;
3966
+ let result409 = null;
3967
+ let resultData409 = _responseText;
3968
+ result409 = JSON.parse(resultData409);
3969
+ return throwException("Conflict", status, _responseText, _headers, result409);
3970
+ }
1507
3971
  else if (status === 401) {
1508
3972
  const _responseText = response.data;
1509
3973
  return throwException("Unauthorized", status, _responseText, _headers);
@@ -1537,7 +4001,7 @@ export class ProjectsApiClient extends ApiClientBase {
1537
4001
  method: "GET",
1538
4002
  url: url_,
1539
4003
  headers: {
1540
- "Accept": "text/plain"
4004
+ "Accept": "application/octet-stream"
1541
4005
  },
1542
4006
  cancelToken
1543
4007
  };
@@ -1577,6 +4041,13 @@ export class ProjectsApiClient extends ApiClientBase {
1577
4041
  result404 = JSON.parse(resultData404);
1578
4042
  return throwException("Not Found", status, _responseText, _headers, result404);
1579
4043
  }
4044
+ else if (status === 409) {
4045
+ const _responseText = response.data;
4046
+ let result409 = null;
4047
+ let resultData409 = _responseText;
4048
+ result409 = JSON.parse(resultData409);
4049
+ return throwException("Conflict", status, _responseText, _headers, result409);
4050
+ }
1580
4051
  else if (status === 401) {
1581
4052
  const _responseText = response.data;
1582
4053
  return throwException("Unauthorized", status, _responseText, _headers);
@@ -1647,9 +4118,16 @@ export class ProjectsApiClient extends ApiClientBase {
1647
4118
  const _responseText = response.data;
1648
4119
  let result404 = null;
1649
4120
  let resultData404 = _responseText;
1650
- result404 = resultData404;
4121
+ result404 = JSON.parse(resultData404);
1651
4122
  return throwException("Not Found", status, _responseText, _headers, result404);
1652
4123
  }
4124
+ else if (status === 409) {
4125
+ const _responseText = response.data;
4126
+ let result409 = null;
4127
+ let resultData409 = _responseText;
4128
+ result409 = JSON.parse(resultData409);
4129
+ return throwException("Conflict", status, _responseText, _headers, result409);
4130
+ }
1653
4131
  else if (status === 401) {
1654
4132
  const _responseText = response.data;
1655
4133
  return throwException("Unauthorized", status, _responseText, _headers);
@@ -1686,8 +4164,8 @@ export class ProjectsApiClient extends ApiClientBase {
1686
4164
  method: "POST",
1687
4165
  url: url_,
1688
4166
  headers: {
1689
- "Content-Type": "application/json-patch+json",
1690
- "Accept": "text/plain"
4167
+ "Content-Type": "application/json",
4168
+ "Accept": "application/json"
1691
4169
  },
1692
4170
  cancelToken
1693
4171
  };
@@ -1771,8 +4249,8 @@ export class ProjectsApiClient extends ApiClientBase {
1771
4249
  method: "POST",
1772
4250
  url: url_,
1773
4251
  headers: {
1774
- "Content-Type": "application/json-patch+json",
1775
- "Accept": "text/plain"
4252
+ "Content-Type": "application/json",
4253
+ "Accept": "application/json"
1776
4254
  },
1777
4255
  cancelToken
1778
4256
  };
@@ -1856,8 +4334,8 @@ export class ProjectsApiClient extends ApiClientBase {
1856
4334
  method: "POST",
1857
4335
  url: url_,
1858
4336
  headers: {
1859
- "Content-Type": "application/json-patch+json",
1860
- "Accept": "text/plain"
4337
+ "Content-Type": "application/json",
4338
+ "Accept": "application/json"
1861
4339
  },
1862
4340
  cancelToken
1863
4341
  };
@@ -1941,8 +4419,8 @@ export class ProjectsApiClient extends ApiClientBase {
1941
4419
  method: "POST",
1942
4420
  url: url_,
1943
4421
  headers: {
1944
- "Content-Type": "application/json-patch+json",
1945
- "Accept": "text/plain"
4422
+ "Content-Type": "application/json",
4423
+ "Accept": "application/json"
1946
4424
  },
1947
4425
  cancelToken
1948
4426
  };
@@ -2022,7 +4500,7 @@ export class ProjectsApiClient extends ApiClientBase {
2022
4500
  method: "GET",
2023
4501
  url: url_,
2024
4502
  headers: {
2025
- "Accept": "text/plain"
4503
+ "Accept": "application/json"
2026
4504
  },
2027
4505
  cancelToken
2028
4506
  };
@@ -2113,7 +4591,7 @@ export class ProjectsApiClient extends ApiClientBase {
2113
4591
  method: "POST",
2114
4592
  url: url_,
2115
4593
  headers: {
2116
- "Accept": "text/plain"
4594
+ "Accept": "application/json"
2117
4595
  },
2118
4596
  cancelToken
2119
4597
  };
@@ -2204,7 +4682,7 @@ export class ProjectsApiClient extends ApiClientBase {
2204
4682
  method: "POST",
2205
4683
  url: url_,
2206
4684
  headers: {
2207
- "Accept": "text/plain"
4685
+ "Accept": "application/json"
2208
4686
  },
2209
4687
  cancelToken
2210
4688
  };
@@ -2252,6 +4730,80 @@ export class ProjectsApiClient extends ApiClientBase {
2252
4730
  result404 = JSON.parse(resultData404);
2253
4731
  return throwException("Not Found", status, _responseText, _headers, result404);
2254
4732
  }
4733
+ else if (status === 409) {
4734
+ const _responseText = response.data;
4735
+ let result409 = null;
4736
+ let resultData409 = _responseText;
4737
+ result409 = JSON.parse(resultData409);
4738
+ return throwException("Conflict", status, _responseText, _headers, result409);
4739
+ }
4740
+ else if (status === 401) {
4741
+ const _responseText = response.data;
4742
+ return throwException("Unauthorized", status, _responseText, _headers);
4743
+ }
4744
+ else if (status === 403) {
4745
+ const _responseText = response.data;
4746
+ return throwException("Forbidden", status, _responseText, _headers);
4747
+ }
4748
+ else if (status !== 200 && status !== 204) {
4749
+ const _responseText = response.data;
4750
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
4751
+ }
4752
+ return Promise.resolve(null);
4753
+ }
4754
+ /**
4755
+ * Deletes specified projects.
4756
+ These projects will be hide from projects list immediately, but complete projects data cleaning will take some additional time.
4757
+ * @param tenantId (optional) Tenant identifier.
4758
+ * @param body (optional) Operation parameters.
4759
+ * @return Success
4760
+ */
4761
+ batchDelete(tenantId, body, cancelToken) {
4762
+ let url_ = this.baseUrl + "/api/storefront/v1/projects/batch-delete?";
4763
+ if (tenantId !== undefined && tenantId !== null)
4764
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
4765
+ url_ = url_.replace(/[?&]$/, "");
4766
+ const content_ = JSON.stringify(body);
4767
+ let options_ = {
4768
+ data: content_,
4769
+ method: "DELETE",
4770
+ url: url_,
4771
+ headers: {
4772
+ "Content-Type": "application/json",
4773
+ "Accept": "application/json"
4774
+ },
4775
+ cancelToken
4776
+ };
4777
+ return this.transformOptions(options_).then(transformedOptions_ => {
4778
+ return this.instance.request(transformedOptions_);
4779
+ }).catch((_error) => {
4780
+ if (isAxiosError(_error) && _error.response) {
4781
+ return _error.response;
4782
+ }
4783
+ else {
4784
+ throw _error;
4785
+ }
4786
+ }).then((_response) => {
4787
+ return this.transformResult(url_, _response, (_response) => this.processBatchDelete(_response));
4788
+ });
4789
+ }
4790
+ processBatchDelete(response) {
4791
+ const status = response.status;
4792
+ let _headers = {};
4793
+ if (response.headers && typeof response.headers === "object") {
4794
+ for (let k in response.headers) {
4795
+ if (response.headers.hasOwnProperty(k)) {
4796
+ _headers[k] = response.headers[k];
4797
+ }
4798
+ }
4799
+ }
4800
+ if (status === 200) {
4801
+ const _responseText = response.data;
4802
+ let result200 = null;
4803
+ let resultData200 = _responseText;
4804
+ result200 = JSON.parse(resultData200);
4805
+ return Promise.resolve(result200);
4806
+ }
2255
4807
  else if (status === 401) {
2256
4808
  const _responseText = response.data;
2257
4809
  return throwException("Unauthorized", status, _responseText, _headers);
@@ -2280,7 +4832,7 @@ export class ProjectsApiClient extends ApiClientBase {
2280
4832
  method: "GET",
2281
4833
  url: url_,
2282
4834
  headers: {
2283
- "Accept": "text/plain"
4835
+ "Accept": "application/json"
2284
4836
  },
2285
4837
  cancelToken
2286
4838
  };
@@ -2342,7 +4894,7 @@ export class ProjectsApiClient extends ApiClientBase {
2342
4894
  method: "GET",
2343
4895
  url: url_,
2344
4896
  headers: {
2345
- "Accept": "text/plain"
4897
+ "Accept": "application/json"
2346
4898
  },
2347
4899
  cancelToken
2348
4900
  };
@@ -2419,7 +4971,7 @@ export class ProjectsApiClient extends ApiClientBase {
2419
4971
  method: "GET",
2420
4972
  url: url_,
2421
4973
  headers: {
2422
- "Accept": "text/plain"
4974
+ "Accept": "application/json"
2423
4975
  },
2424
4976
  cancelToken
2425
4977
  };
@@ -2453,6 +5005,13 @@ export class ProjectsApiClient extends ApiClientBase {
2453
5005
  result200 = JSON.parse(resultData200);
2454
5006
  return Promise.resolve(result200);
2455
5007
  }
5008
+ else if (status === 409) {
5009
+ const _responseText = response.data;
5010
+ let result409 = null;
5011
+ let resultData409 = _responseText;
5012
+ result409 = JSON.parse(resultData409);
5013
+ return throwException("Conflict", status, _responseText, _headers, result409);
5014
+ }
2456
5015
  else if (status === 401) {
2457
5016
  const _responseText = response.data;
2458
5017
  return throwException("Unauthorized", status, _responseText, _headers);
@@ -2540,6 +5099,13 @@ export class ProjectsApiClient extends ApiClientBase {
2540
5099
  result404 = JSON.parse(resultData404);
2541
5100
  return throwException("Not Found", status, _responseText, _headers, result404);
2542
5101
  }
5102
+ else if (status === 409) {
5103
+ const _responseText = response.data;
5104
+ let result409 = null;
5105
+ let resultData409 = _responseText;
5106
+ result409 = JSON.parse(resultData409);
5107
+ return throwException("Conflict", status, _responseText, _headers, result409);
5108
+ }
2543
5109
  else if (status === 401) {
2544
5110
  const _responseText = response.data;
2545
5111
  return throwException("Unauthorized", status, _responseText, _headers);
@@ -2575,7 +5141,7 @@ export class ProjectsApiClient extends ApiClientBase {
2575
5141
  method: "GET",
2576
5142
  url: url_,
2577
5143
  headers: {
2578
- "Accept": "text/plain"
5144
+ "Accept": "application/json"
2579
5145
  },
2580
5146
  cancelToken
2581
5147
  };
@@ -2616,6 +5182,13 @@ export class ProjectsApiClient extends ApiClientBase {
2616
5182
  result404 = JSON.parse(resultData404);
2617
5183
  return throwException("Not Found", status, _responseText, _headers, result404);
2618
5184
  }
5185
+ else if (status === 409) {
5186
+ const _responseText = response.data;
5187
+ let result409 = null;
5188
+ let resultData409 = _responseText;
5189
+ result409 = JSON.parse(resultData409);
5190
+ return throwException("Conflict", status, _responseText, _headers, result409);
5191
+ }
2619
5192
  else if (status === 401) {
2620
5193
  const _responseText = response.data;
2621
5194
  return throwException("Unauthorized", status, _responseText, _headers);
@@ -2687,6 +5260,13 @@ export class ProjectsApiClient extends ApiClientBase {
2687
5260
  result404 = JSON.parse(resultData404);
2688
5261
  return throwException("Not Found", status, _responseText, _headers, result404);
2689
5262
  }
5263
+ else if (status === 409) {
5264
+ const _responseText = response.data;
5265
+ let result409 = null;
5266
+ let resultData409 = _responseText;
5267
+ result409 = JSON.parse(resultData409);
5268
+ return throwException("Conflict", status, _responseText, _headers, result409);
5269
+ }
2690
5270
  else if (status === 401) {
2691
5271
  const _responseText = response.data;
2692
5272
  return throwException("Unauthorized", status, _responseText, _headers);
@@ -2758,6 +5338,13 @@ export class ProjectsApiClient extends ApiClientBase {
2758
5338
  result404 = JSON.parse(resultData404);
2759
5339
  return throwException("Not Found", status, _responseText, _headers, result404);
2760
5340
  }
5341
+ else if (status === 409) {
5342
+ const _responseText = response.data;
5343
+ let result409 = null;
5344
+ let resultData409 = _responseText;
5345
+ result409 = JSON.parse(resultData409);
5346
+ return throwException("Conflict", status, _responseText, _headers, result409);
5347
+ }
2761
5348
  else if (status === 401) {
2762
5349
  const _responseText = response.data;
2763
5350
  return throwException("Unauthorized", status, _responseText, _headers);
@@ -2831,6 +5418,13 @@ export class ProjectsApiClient extends ApiClientBase {
2831
5418
  result404 = JSON.parse(resultData404);
2832
5419
  return throwException("Not Found", status, _responseText, _headers, result404);
2833
5420
  }
5421
+ else if (status === 409) {
5422
+ const _responseText = response.data;
5423
+ let result409 = null;
5424
+ let resultData409 = _responseText;
5425
+ result409 = JSON.parse(resultData409);
5426
+ return throwException("Conflict", status, _responseText, _headers, result409);
5427
+ }
2834
5428
  else if (status === 401) {
2835
5429
  const _responseText = response.data;
2836
5430
  return throwException("Unauthorized", status, _responseText, _headers);
@@ -2848,7 +5442,7 @@ export class ProjectsApiClient extends ApiClientBase {
2848
5442
  /**
2849
5443
  * Attachs the specified data to the project's order in ecommerce system.
2850
5444
  * @param id Project identifier.
2851
- * @param itemId (optional)
5445
+ * @param itemId (optional) Project item identifier.
2852
5446
  * @param tenantId (optional) Tenant identifier.
2853
5447
  * @param body (optional) A list of data items, which should be attached to project's order.
2854
5448
  * @return Success
@@ -2869,7 +5463,7 @@ export class ProjectsApiClient extends ApiClientBase {
2869
5463
  method: "POST",
2870
5464
  url: url_,
2871
5465
  headers: {
2872
- "Content-Type": "application/json-patch+json",
5466
+ "Content-Type": "application/json",
2873
5467
  },
2874
5468
  cancelToken
2875
5469
  };
@@ -2907,6 +5501,13 @@ export class ProjectsApiClient extends ApiClientBase {
2907
5501
  result404 = JSON.parse(resultData404);
2908
5502
  return throwException("Not Found", status, _responseText, _headers, result404);
2909
5503
  }
5504
+ else if (status === 409) {
5505
+ const _responseText = response.data;
5506
+ let result409 = null;
5507
+ let resultData409 = _responseText;
5508
+ result409 = JSON.parse(resultData409);
5509
+ return throwException("Conflict", status, _responseText, _headers, result409);
5510
+ }
2910
5511
  else if (status === 401) {
2911
5512
  const _responseText = response.data;
2912
5513
  return throwException("Unauthorized", status, _responseText, _headers);
@@ -2960,7 +5561,7 @@ export class StorefrontsApiClient extends ApiClientBase {
2960
5561
  method: "GET",
2961
5562
  url: url_,
2962
5563
  headers: {
2963
- "Accept": "text/plain"
5564
+ "Accept": "application/json"
2964
5565
  },
2965
5566
  cancelToken
2966
5567
  };
@@ -3026,7 +5627,7 @@ export class StorefrontsApiClient extends ApiClientBase {
3026
5627
  method: "GET",
3027
5628
  url: url_,
3028
5629
  headers: {
3029
- "Accept": "text/plain"
5630
+ "Accept": "application/json"
3030
5631
  },
3031
5632
  cancelToken
3032
5633
  };
@@ -3067,6 +5668,13 @@ export class StorefrontsApiClient extends ApiClientBase {
3067
5668
  result404 = JSON.parse(resultData404);
3068
5669
  return throwException("Not Found", status, _responseText, _headers, result404);
3069
5670
  }
5671
+ else if (status === 409) {
5672
+ const _responseText = response.data;
5673
+ let result409 = null;
5674
+ let resultData409 = _responseText;
5675
+ result409 = JSON.parse(resultData409);
5676
+ return throwException("Conflict", status, _responseText, _headers, result409);
5677
+ }
3070
5678
  else if (status === 401) {
3071
5679
  const _responseText = response.data;
3072
5680
  return throwException("Unauthorized", status, _responseText, _headers);
@@ -3125,7 +5733,7 @@ export class StorefrontUsersApiClient extends ApiClientBase {
3125
5733
  method: "GET",
3126
5734
  url: url_,
3127
5735
  headers: {
3128
- "Accept": "text/plain"
5736
+ "Accept": "application/json"
3129
5737
  },
3130
5738
  cancelToken
3131
5739
  };
@@ -3159,6 +5767,13 @@ export class StorefrontUsersApiClient extends ApiClientBase {
3159
5767
  result200 = JSON.parse(resultData200);
3160
5768
  return Promise.resolve(result200);
3161
5769
  }
5770
+ else if (status === 409) {
5771
+ const _responseText = response.data;
5772
+ let result409 = null;
5773
+ let resultData409 = _responseText;
5774
+ result409 = JSON.parse(resultData409);
5775
+ return throwException("Conflict", status, _responseText, _headers, result409);
5776
+ }
3162
5777
  else if (status === 401) {
3163
5778
  const _responseText = response.data;
3164
5779
  return throwException("Unauthorized", status, _responseText, _headers);
@@ -3195,8 +5810,8 @@ export class StorefrontUsersApiClient extends ApiClientBase {
3195
5810
  method: "POST",
3196
5811
  url: url_,
3197
5812
  headers: {
3198
- "Content-Type": "application/json-patch+json",
3199
- "Accept": "text/plain"
5813
+ "Content-Type": "application/json",
5814
+ "Accept": "application/json"
3200
5815
  },
3201
5816
  cancelToken
3202
5817
  };
@@ -3274,7 +5889,7 @@ export class StorefrontUsersApiClient extends ApiClientBase {
3274
5889
  method: "GET",
3275
5890
  url: url_,
3276
5891
  headers: {
3277
- "Accept": "text/plain"
5892
+ "Accept": "application/json"
3278
5893
  },
3279
5894
  cancelToken
3280
5895
  };
@@ -3315,6 +5930,13 @@ export class StorefrontUsersApiClient extends ApiClientBase {
3315
5930
  result404 = JSON.parse(resultData404);
3316
5931
  return throwException("Not Found", status, _responseText, _headers, result404);
3317
5932
  }
5933
+ else if (status === 409) {
5934
+ const _responseText = response.data;
5935
+ let result409 = null;
5936
+ let resultData409 = _responseText;
5937
+ result409 = JSON.parse(resultData409);
5938
+ return throwException("Conflict", status, _responseText, _headers, result409);
5939
+ }
3318
5940
  else if (status === 401) {
3319
5941
  const _responseText = response.data;
3320
5942
  return throwException("Unauthorized", status, _responseText, _headers);
@@ -3351,8 +5973,8 @@ export class StorefrontUsersApiClient extends ApiClientBase {
3351
5973
  method: "POST",
3352
5974
  url: url_,
3353
5975
  headers: {
3354
- "Content-Type": "application/json-patch+json",
3355
- "Accept": "text/plain"
5976
+ "Content-Type": "application/json",
5977
+ "Accept": "application/json"
3356
5978
  },
3357
5979
  cancelToken
3358
5980
  };
@@ -3429,7 +6051,7 @@ export class StorefrontUsersApiClient extends ApiClientBase {
3429
6051
  method: "POST",
3430
6052
  url: url_,
3431
6053
  headers: {
3432
- "Content-Type": "application/json-patch+json",
6054
+ "Content-Type": "application/json",
3433
6055
  },
3434
6056
  cancelToken
3435
6057
  };
@@ -3550,14 +6172,14 @@ export class StorefrontUsersApiClient extends ApiClientBase {
3550
6172
  const _responseText = response.data;
3551
6173
  let result404 = null;
3552
6174
  let resultData404 = _responseText;
3553
- result404 = resultData404;
6175
+ result404 = JSON.parse(resultData404);
3554
6176
  return throwException("Not Found", status, _responseText, _headers, result404);
3555
6177
  }
3556
6178
  else if (status === 409) {
3557
6179
  const _responseText = response.data;
3558
6180
  let result409 = null;
3559
6181
  let resultData409 = _responseText;
3560
- result409 = resultData409;
6182
+ result409 = JSON.parse(resultData409);
3561
6183
  return throwException("Conflict", status, _responseText, _headers, result409);
3562
6184
  }
3563
6185
  else if (status === 401) {
@@ -3598,7 +6220,7 @@ export class TenantInfoApiClient extends ApiClientBase {
3598
6220
  method: "GET",
3599
6221
  url: url_,
3600
6222
  headers: {
3601
- "Accept": "text/plain"
6223
+ "Accept": "application/json"
3602
6224
  },
3603
6225
  cancelToken
3604
6226
  };
@@ -3660,7 +6282,7 @@ export class TenantInfoApiClient extends ApiClientBase {
3660
6282
  method: "GET",
3661
6283
  url: url_,
3662
6284
  headers: {
3663
- "Accept": "text/plain"
6285
+ "Accept": "application/json"
3664
6286
  },
3665
6287
  cancelToken
3666
6288
  };
@@ -3722,7 +6344,7 @@ export class TenantInfoApiClient extends ApiClientBase {
3722
6344
  method: "GET",
3723
6345
  url: url_,
3724
6346
  headers: {
3725
- "Accept": "text/plain"
6347
+ "Accept": "application/json"
3726
6348
  },
3727
6349
  cancelToken
3728
6350
  };
@@ -3784,7 +6406,7 @@ export class TenantInfoApiClient extends ApiClientBase {
3784
6406
  method: "GET",
3785
6407
  url: url_,
3786
6408
  headers: {
3787
- "Accept": "text/plain"
6409
+ "Accept": "application/json"
3788
6410
  },
3789
6411
  cancelToken
3790
6412
  };
@@ -3833,6 +6455,32 @@ export class TenantInfoApiClient extends ApiClientBase {
3833
6455
  return Promise.resolve(null);
3834
6456
  }
3835
6457
  }
6458
+ /** Available option types. */
6459
+ export var OptionType;
6460
+ (function (OptionType) {
6461
+ OptionType["Simple"] = "Simple";
6462
+ OptionType["Size"] = "Size";
6463
+ OptionType["PageCount"] = "PageCount";
6464
+ })(OptionType || (OptionType = {}));
6465
+ /** Conflict types. */
6466
+ export var ConflictType;
6467
+ (function (ConflictType) {
6468
+ ConflictType["NameConflict"] = "NameConflict";
6469
+ ConflictType["FolderOverwriteConflict"] = "FolderOverwriteConflict";
6470
+ ConflictType["IdConflict"] = "IdConflict";
6471
+ ConflictType["GeneralConflict"] = "GeneralConflict";
6472
+ })(ConflictType || (ConflictType = {}));
6473
+ /** Available appearance types. */
6474
+ export var AppearanceDataType;
6475
+ (function (AppearanceDataType) {
6476
+ AppearanceDataType["Radio"] = "Radio";
6477
+ AppearanceDataType["Dropdown"] = "Dropdown";
6478
+ AppearanceDataType["Chips"] = "Chips";
6479
+ AppearanceDataType["ColorGrid"] = "ColorGrid";
6480
+ AppearanceDataType["ColorList"] = "ColorList";
6481
+ AppearanceDataType["ImageGrid"] = "ImageGrid";
6482
+ AppearanceDataType["ImageList"] = "ImageList";
6483
+ })(AppearanceDataType || (AppearanceDataType = {}));
3836
6484
  /** Type of editor that should be configured by workflow. */
3837
6485
  export var WorkflowType;
3838
6486
  (function (WorkflowType) {
@@ -3841,6 +6489,34 @@ export var WorkflowType;
3841
6489
  WorkflowType["DesignEditor"] = "DesignEditor";
3842
6490
  WorkflowType["WorkflowElements"] = "WorkflowElements";
3843
6491
  })(WorkflowType || (WorkflowType = {}));
6492
+ /** Available product reference target types. */
6493
+ export var ProductReferenceType;
6494
+ (function (ProductReferenceType) {
6495
+ ProductReferenceType["ProductSpecification"] = "ProductSpecification";
6496
+ ProductReferenceType["Product"] = "Product";
6497
+ ProductReferenceType["ProductLink"] = "ProductLink";
6498
+ })(ProductReferenceType || (ProductReferenceType = {}));
6499
+ /** Available product variant resource types. */
6500
+ export var ProductVariantResourceType;
6501
+ (function (ProductVariantResourceType) {
6502
+ ProductVariantResourceType["Preview"] = "Preview";
6503
+ ProductVariantResourceType["EditorModel"] = "EditorModel";
6504
+ ProductVariantResourceType["Custom"] = "Custom";
6505
+ })(ProductVariantResourceType || (ProductVariantResourceType = {}));
6506
+ /** Available mockup types. */
6507
+ export var ProductVariantMockupType;
6508
+ (function (ProductVariantMockupType) {
6509
+ ProductVariantMockupType["Thumbnail"] = "Thumbnail";
6510
+ ProductVariantMockupType["Editor"] = "Editor";
6511
+ ProductVariantMockupType["Preview"] = "Preview";
6512
+ })(ProductVariantMockupType || (ProductVariantMockupType = {}));
6513
+ /** Available surface usage types. */
6514
+ export var SurfaceUsageType;
6515
+ (function (SurfaceUsageType) {
6516
+ SurfaceUsageType["Individual"] = "Individual";
6517
+ SurfaceUsageType["Custom"] = "Custom";
6518
+ SurfaceUsageType["All"] = "All";
6519
+ })(SurfaceUsageType || (SurfaceUsageType = {}));
3844
6520
  /** Defines all available date period filter values for queries. */
3845
6521
  export var DatePeriod;
3846
6522
  (function (DatePeriod) {
@@ -3885,6 +6561,14 @@ export var RenderHiResScenarioOutputFlipMode;
3885
6561
  RenderHiResScenarioOutputFlipMode["Vertical"] = "Vertical";
3886
6562
  RenderHiResScenarioOutputFlipMode["Both"] = "Both";
3887
6563
  })(RenderHiResScenarioOutputFlipMode || (RenderHiResScenarioOutputFlipMode = {}));
6564
+ export var RenderHiResScenarioOutputRotateMode;
6565
+ (function (RenderHiResScenarioOutputRotateMode) {
6566
+ RenderHiResScenarioOutputRotateMode["None"] = "None";
6567
+ RenderHiResScenarioOutputRotateMode["Rotate90"] = "Rotate90";
6568
+ RenderHiResScenarioOutputRotateMode["Rotate180"] = "Rotate180";
6569
+ RenderHiResScenarioOutputRotateMode["Rotate270"] = "Rotate270";
6570
+ RenderHiResScenarioOutputRotateMode["Auto"] = "Auto";
6571
+ })(RenderHiResScenarioOutputRotateMode || (RenderHiResScenarioOutputRotateMode = {}));
3888
6572
  /** Available value types for order data item. */
3889
6573
  export var OrderDataItemValueType;
3890
6574
  (function (OrderDataItemValueType) {