@aurigma/axios-storefront-api-client 2.52.2 → 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,242 @@ 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.
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
+ * @param tenantId (optional) Tenant identifier.
489
+ * @return Success
490
+ */
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) + "&";
504
+ if (tenantId !== undefined && tenantId !== null)
505
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
506
+ url_ = url_.replace(/[?&]$/, "");
507
+ let options_ = {
508
+ method: "GET",
509
+ url: url_,
510
+ headers: {
511
+ "Accept": "application/json"
512
+ },
513
+ cancelToken
514
+ };
515
+ return this.transformOptions(options_).then(transformedOptions_ => {
516
+ return this.instance.request(transformedOptions_);
517
+ }).catch((_error) => {
518
+ if (isAxiosError(_error) && _error.response) {
519
+ return _error.response;
520
+ }
521
+ else {
522
+ throw _error;
523
+ }
524
+ }).then((_response) => {
525
+ return this.transformResult(url_, _response, (_response) => this.processGetProductSummary(_response));
526
+ });
527
+ }
528
+ processGetProductSummary(response) {
529
+ const status = response.status;
530
+ let _headers = {};
531
+ if (response.headers && typeof response.headers === "object") {
532
+ for (let k in response.headers) {
533
+ if (response.headers.hasOwnProperty(k)) {
534
+ _headers[k] = response.headers[k];
535
+ }
536
+ }
537
+ }
538
+ if (status === 200) {
539
+ const _responseText = response.data;
540
+ let result200 = null;
541
+ let resultData200 = _responseText;
542
+ result200 = JSON.parse(resultData200);
543
+ return Promise.resolve(result200);
544
+ }
545
+ else if (status === 404) {
546
+ const _responseText = response.data;
547
+ let result404 = null;
548
+ let resultData404 = _responseText;
549
+ result404 = JSON.parse(resultData404);
550
+ return throwException("Not Found", status, _responseText, _headers, result404);
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
+ }
559
+ else if (status === 401) {
560
+ const _responseText = response.data;
561
+ return throwException("Unauthorized", status, _responseText, _headers);
562
+ }
563
+ else if (status === 403) {
564
+ const _responseText = response.data;
565
+ return throwException("Forbidden", status, _responseText, _headers);
566
+ }
567
+ else if (status !== 200 && status !== 204) {
568
+ const _responseText = response.data;
569
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
570
+ }
571
+ return Promise.resolve(null);
572
+ }
573
+ /**
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.
579
+ * @param tenantId (optional) Tenant identifier.
580
+ * @return Success
581
+ */
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) + "&";
593
+ if (tenantId !== undefined && tenantId !== null)
594
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
595
+ url_ = url_.replace(/[?&]$/, "");
596
+ let options_ = {
597
+ method: "GET",
598
+ url: url_,
599
+ headers: {
600
+ "Accept": "application/json"
601
+ },
602
+ cancelToken
603
+ };
604
+ return this.transformOptions(options_).then(transformedOptions_ => {
605
+ return this.instance.request(transformedOptions_);
606
+ }).catch((_error) => {
607
+ if (isAxiosError(_error) && _error.response) {
608
+ return _error.response;
609
+ }
610
+ else {
611
+ throw _error;
612
+ }
613
+ }).then((_response) => {
614
+ return this.transformResult(url_, _response, (_response) => this.processGetPersonalizationWorkflow(_response));
615
+ });
616
+ }
617
+ processGetPersonalizationWorkflow(response) {
618
+ const status = response.status;
619
+ let _headers = {};
620
+ if (response.headers && typeof response.headers === "object") {
621
+ for (let k in response.headers) {
622
+ if (response.headers.hasOwnProperty(k)) {
623
+ _headers[k] = response.headers[k];
624
+ }
625
+ }
626
+ }
627
+ if (status === 200) {
628
+ const _responseText = response.data;
629
+ let result200 = null;
630
+ let resultData200 = _responseText;
631
+ result200 = JSON.parse(resultData200);
632
+ return Promise.resolve(result200);
633
+ }
634
+ else if (status === 404) {
635
+ const _responseText = response.data;
636
+ let result404 = null;
637
+ let resultData404 = _responseText;
638
+ result404 = JSON.parse(resultData404);
639
+ return throwException("Not Found", status, _responseText, _headers, result404);
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
+ }
648
+ else if (status === 401) {
649
+ const _responseText = response.data;
650
+ return throwException("Unauthorized", status, _responseText, _headers);
651
+ }
652
+ else if (status === 403) {
653
+ const _responseText = response.data;
654
+ return throwException("Forbidden", status, _responseText, _headers);
655
+ }
656
+ else if (status !== 200 && status !== 204) {
657
+ const _responseText = response.data;
658
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
659
+ }
660
+ return Promise.resolve(null);
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
+ }
672
+ /**
673
+ * Returns all storefront product references relevant to the specified query parameters.
487
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"}.
488
687
  * @param tenantId (optional) Tenant identifier.
489
688
  * @return Success
490
689
  */
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));
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?";
496
692
  if (storefrontId === undefined || storefrontId === null)
497
693
  throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
498
694
  else
499
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) + "&";
500
718
  if (tenantId !== undefined && tenantId !== null)
501
719
  url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
502
720
  url_ = url_.replace(/[?&]$/, "");
@@ -504,7 +722,7 @@ export class ProductReferencesApiClient extends ApiClientBase {
504
722
  method: "GET",
505
723
  url: url_,
506
724
  headers: {
507
- "Accept": "text/plain"
725
+ "Accept": "application/json"
508
726
  },
509
727
  cancelToken
510
728
  };
@@ -518,10 +736,2209 @@ export class ProductReferencesApiClient extends ApiClientBase {
518
736
  throw _error;
519
737
  }
520
738
  }).then((_response) => {
521
- return this.transformResult(url_, _response, (_response) => this.processGet(_response));
739
+ return this.transformResult(url_, _response, (_response) => this.processGetAll(_response));
522
740
  });
523
741
  }
524
- processGet(response) {
742
+ processGetAll(response) {
743
+ const status = response.status;
744
+ let _headers = {};
745
+ if (response.headers && typeof response.headers === "object") {
746
+ for (let k in response.headers) {
747
+ if (response.headers.hasOwnProperty(k)) {
748
+ _headers[k] = response.headers[k];
749
+ }
750
+ }
751
+ }
752
+ if (status === 200) {
753
+ const _responseText = response.data;
754
+ let result200 = null;
755
+ let resultData200 = _responseText;
756
+ result200 = JSON.parse(resultData200);
757
+ return Promise.resolve(result200);
758
+ }
759
+ else if (status === 409) {
760
+ const _responseText = response.data;
761
+ let result409 = null;
762
+ let resultData409 = _responseText;
763
+ result409 = JSON.parse(resultData409);
764
+ return throwException("Conflict", status, _responseText, _headers, result409);
765
+ }
766
+ else if (status === 401) {
767
+ const _responseText = response.data;
768
+ return throwException("Unauthorized", status, _responseText, _headers);
769
+ }
770
+ else if (status === 403) {
771
+ const _responseText = response.data;
772
+ return throwException("Forbidden", status, _responseText, _headers);
773
+ }
774
+ else if (status !== 200 && status !== 204) {
775
+ const _responseText = response.data;
776
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
777
+ }
778
+ return Promise.resolve(null);
779
+ }
780
+ /**
781
+ * Creates a new storefront product reference.
782
+ * @param storefrontId Storefront identifier.
783
+ * @param tenantId (optional) Tenant identifier.
784
+ * @param body (optional) Create operation parameters.
785
+ * @return Success
786
+ */
787
+ create(storefrontId, tenantId, body, cancelToken) {
788
+ let url_ = this.baseUrl + "/api/storefront/v1/product-references?";
789
+ if (storefrontId === undefined || storefrontId === null)
790
+ throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
791
+ else
792
+ url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
793
+ if (tenantId !== undefined && tenantId !== null)
794
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
795
+ url_ = url_.replace(/[?&]$/, "");
796
+ const content_ = JSON.stringify(body);
797
+ let options_ = {
798
+ data: content_,
799
+ method: "POST",
800
+ url: url_,
801
+ headers: {
802
+ "Content-Type": "application/json",
803
+ "Accept": "application/json"
804
+ },
805
+ cancelToken
806
+ };
807
+ return this.transformOptions(options_).then(transformedOptions_ => {
808
+ return this.instance.request(transformedOptions_);
809
+ }).catch((_error) => {
810
+ if (isAxiosError(_error) && _error.response) {
811
+ return _error.response;
812
+ }
813
+ else {
814
+ throw _error;
815
+ }
816
+ }).then((_response) => {
817
+ return this.transformResult(url_, _response, (_response) => this.processCreate(_response));
818
+ });
819
+ }
820
+ processCreate(response) {
821
+ const status = response.status;
822
+ let _headers = {};
823
+ if (response.headers && typeof response.headers === "object") {
824
+ for (let k in response.headers) {
825
+ if (response.headers.hasOwnProperty(k)) {
826
+ _headers[k] = response.headers[k];
827
+ }
828
+ }
829
+ }
830
+ if (status === 201) {
831
+ const _responseText = response.data;
832
+ let result201 = null;
833
+ let resultData201 = _responseText;
834
+ result201 = JSON.parse(resultData201);
835
+ return Promise.resolve(result201);
836
+ }
837
+ else if (status === 404) {
838
+ const _responseText = response.data;
839
+ let result404 = null;
840
+ let resultData404 = _responseText;
841
+ result404 = JSON.parse(resultData404);
842
+ return throwException("Not Found", status, _responseText, _headers, result404);
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
+ }
851
+ else if (status === 401) {
852
+ const _responseText = response.data;
853
+ return throwException("Unauthorized", status, _responseText, _headers);
854
+ }
855
+ else if (status === 403) {
856
+ const _responseText = response.data;
857
+ return throwException("Forbidden", status, _responseText, _headers);
858
+ }
859
+ else if (status !== 200 && status !== 204) {
860
+ const _responseText = response.data;
861
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
862
+ }
863
+ return Promise.resolve(null);
864
+ }
865
+ /**
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"}.
880
+ * @param tenantId (optional) Tenant identifier.
881
+ * @return Success
882
+ */
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
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) + "&";
911
+ if (tenantId !== undefined && tenantId !== null)
912
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
913
+ url_ = url_.replace(/[?&]$/, "");
914
+ let options_ = {
915
+ method: "GET",
916
+ url: url_,
917
+ headers: {
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) {
525
2942
  const status = response.status;
526
2943
  let _headers = {};
527
2944
  if (response.headers && typeof response.headers === "object") {
@@ -545,6 +2962,13 @@ export class ProductReferencesApiClient extends ApiClientBase {
545
2962
  result404 = JSON.parse(resultData404);
546
2963
  return throwException("Not Found", status, _responseText, _headers, result404);
547
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
+ }
548
2972
  else if (status === 401) {
549
2973
  const _responseText = response.data;
550
2974
  return throwException("Unauthorized", status, _responseText, _headers);
@@ -560,29 +2984,57 @@ export class ProductReferencesApiClient extends ApiClientBase {
560
2984
  return Promise.resolve(null);
561
2985
  }
562
2986
  /**
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.
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.
566
3000
  * @param tenantId (optional) Tenant identifier.
567
3001
  * @return Success
568
3002
  */
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) + "&";
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) + "&";
578
3030
  if (tenantId !== undefined && tenantId !== null)
579
3031
  url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
580
3032
  url_ = url_.replace(/[?&]$/, "");
581
3033
  let options_ = {
582
- method: "DELETE",
3034
+ method: "GET",
583
3035
  url: url_,
584
3036
  headers: {
585
- "Accept": "text/plain"
3037
+ "Accept": "application/json"
586
3038
  },
587
3039
  cancelToken
588
3040
  };
@@ -596,10 +3048,10 @@ export class ProductReferencesApiClient extends ApiClientBase {
596
3048
  throw _error;
597
3049
  }
598
3050
  }).then((_response) => {
599
- return this.transformResult(url_, _response, (_response) => this.processDelete(_response));
3051
+ return this.transformResult(url_, _response, (_response) => this.processGetProductVariantDocuments(_response));
600
3052
  });
601
3053
  }
602
- processDelete(response) {
3054
+ processGetProductVariantDocuments(response) {
603
3055
  const status = response.status;
604
3056
  let _headers = {};
605
3057
  if (response.headers && typeof response.headers === "object") {
@@ -623,6 +3075,13 @@ export class ProductReferencesApiClient extends ApiClientBase {
623
3075
  result404 = JSON.parse(resultData404);
624
3076
  return throwException("Not Found", status, _responseText, _headers, result404);
625
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
+ }
626
3085
  else if (status === 401) {
627
3086
  const _responseText = response.data;
628
3087
  return throwException("Unauthorized", status, _responseText, _headers);
@@ -638,30 +3097,26 @@ export class ProductReferencesApiClient extends ApiClientBase {
638
3097
  return Promise.resolve(null);
639
3098
  }
640
3099
  /**
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.
643
- * @param storefrontId Storefront identifier.
3100
+ * Updates product variant resources.
3101
+ * @param id Product identifier.
3102
+ * @param productVersionId (optional) Product version identifier.
644
3103
  * @param tenantId (optional) Tenant identifier.
645
3104
  * @return Success
646
3105
  */
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));
652
- if (storefrontId === undefined || storefrontId === null)
653
- throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
654
- else
655
- url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
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) + "&";
656
3113
  if (tenantId !== undefined && tenantId !== null)
657
3114
  url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
658
3115
  url_ = url_.replace(/[?&]$/, "");
659
3116
  let options_ = {
660
- method: "GET",
3117
+ method: "POST",
661
3118
  url: url_,
662
- headers: {
663
- "Accept": "text/plain"
664
- },
3119
+ headers: {},
665
3120
  cancelToken
666
3121
  };
667
3122
  return this.transformOptions(options_).then(transformedOptions_ => {
@@ -674,10 +3129,10 @@ export class ProductReferencesApiClient extends ApiClientBase {
674
3129
  throw _error;
675
3130
  }
676
3131
  }).then((_response) => {
677
- return this.transformResult(url_, _response, (_response) => this.processGetProductSpecification(_response));
3132
+ return this.transformResult(url_, _response, (_response) => this.processUpdateProductVariantResources(_response));
678
3133
  });
679
3134
  }
680
- processGetProductSpecification(response) {
3135
+ processUpdateProductVariantResources(response) {
681
3136
  const status = response.status;
682
3137
  let _headers = {};
683
3138
  if (response.headers && typeof response.headers === "object") {
@@ -689,10 +3144,7 @@ export class ProductReferencesApiClient extends ApiClientBase {
689
3144
  }
690
3145
  if (status === 200) {
691
3146
  const _responseText = response.data;
692
- let result200 = null;
693
- let resultData200 = _responseText;
694
- result200 = JSON.parse(resultData200);
695
- return Promise.resolve(result200);
3147
+ return Promise.resolve(null);
696
3148
  }
697
3149
  else if (status === 404) {
698
3150
  const _responseText = response.data;
@@ -701,6 +3153,13 @@ export class ProductReferencesApiClient extends ApiClientBase {
701
3153
  result404 = JSON.parse(resultData404);
702
3154
  return throwException("Not Found", status, _responseText, _headers, result404);
703
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
+ }
704
3163
  else if (status === 401) {
705
3164
  const _responseText = response.data;
706
3165
  return throwException("Unauthorized", status, _responseText, _headers);
@@ -716,45 +3175,30 @@ export class ProductReferencesApiClient extends ApiClientBase {
716
3175
  return Promise.resolve(null);
717
3176
  }
718
3177
  /**
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.
722
- * @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.
3178
+ * Set product variant price.
3179
+ * @param id Product identifier.
3180
+ * @param productVersionId (optional) Product version identifier.
726
3181
  * @param tenantId (optional) Tenant identifier.
3182
+ * @param body (optional) Set product variant price operation parameters.
727
3183
  * @return Success
728
3184
  */
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) + "&";
738
- if (storefrontId === undefined || storefrontId === null)
739
- throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
740
- else
741
- 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) + "&";
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) + "&";
750
3192
  if (tenantId !== undefined && tenantId !== null)
751
3193
  url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
752
3194
  url_ = url_.replace(/[?&]$/, "");
3195
+ const content_ = JSON.stringify(body);
753
3196
  let options_ = {
754
- method: "GET",
3197
+ data: content_,
3198
+ method: "POST",
755
3199
  url: url_,
756
3200
  headers: {
757
- "Accept": "text/plain"
3201
+ "Content-Type": "application/json",
758
3202
  },
759
3203
  cancelToken
760
3204
  };
@@ -768,10 +3212,10 @@ export class ProductReferencesApiClient extends ApiClientBase {
768
3212
  throw _error;
769
3213
  }
770
3214
  }).then((_response) => {
771
- return this.transformResult(url_, _response, (_response) => this.processGetProductCostDetails(_response));
3215
+ return this.transformResult(url_, _response, (_response) => this.processSetProductVariantPrice(_response));
772
3216
  });
773
3217
  }
774
- processGetProductCostDetails(response) {
3218
+ processSetProductVariantPrice(response) {
775
3219
  const status = response.status;
776
3220
  let _headers = {};
777
3221
  if (response.headers && typeof response.headers === "object") {
@@ -783,10 +3227,7 @@ export class ProductReferencesApiClient extends ApiClientBase {
783
3227
  }
784
3228
  if (status === 200) {
785
3229
  const _responseText = response.data;
786
- let result200 = null;
787
- let resultData200 = _responseText;
788
- result200 = JSON.parse(resultData200);
789
- return Promise.resolve(result200);
3230
+ return Promise.resolve(null);
790
3231
  }
791
3232
  else if (status === 404) {
792
3233
  const _responseText = response.data;
@@ -795,6 +3236,13 @@ export class ProductReferencesApiClient extends ApiClientBase {
795
3236
  result404 = JSON.parse(resultData404);
796
3237
  return throwException("Not Found", status, _responseText, _headers, result404);
797
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
+ }
798
3246
  else if (status === 401) {
799
3247
  const _responseText = response.data;
800
3248
  return throwException("Unauthorized", status, _responseText, _headers);
@@ -810,21 +3258,15 @@ export class ProductReferencesApiClient extends ApiClientBase {
810
3258
  return Promise.resolve(null);
811
3259
  }
812
3260
  /**
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.
3261
+ * Returns a list of all available product tags.
3262
+ * @param search (optional) Search string for partial match.
816
3263
  * @param tenantId (optional) Tenant identifier.
817
3264
  * @return Success
818
3265
  */
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)
827
- url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
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) + "&";
828
3270
  if (tenantId !== undefined && tenantId !== null)
829
3271
  url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
830
3272
  url_ = url_.replace(/[?&]$/, "");
@@ -832,7 +3274,7 @@ export class ProductReferencesApiClient extends ApiClientBase {
832
3274
  method: "GET",
833
3275
  url: url_,
834
3276
  headers: {
835
- "Accept": "text/plain"
3277
+ "Accept": "application/json"
836
3278
  },
837
3279
  cancelToken
838
3280
  };
@@ -846,10 +3288,10 @@ export class ProductReferencesApiClient extends ApiClientBase {
846
3288
  throw _error;
847
3289
  }
848
3290
  }).then((_response) => {
849
- return this.transformResult(url_, _response, (_response) => this.processGetPersonalizationWorkflow(_response));
3291
+ return this.transformResult(url_, _response, (_response) => this.processGetAvailableProductTags(_response));
850
3292
  });
851
3293
  }
852
- processGetPersonalizationWorkflow(response) {
3294
+ processGetAvailableProductTags(response) {
853
3295
  const status = response.status;
854
3296
  let _headers = {};
855
3297
  if (response.headers && typeof response.headers === "object") {
@@ -866,13 +3308,6 @@ export class ProductReferencesApiClient extends ApiClientBase {
866
3308
  result200 = JSON.parse(resultData200);
867
3309
  return Promise.resolve(result200);
868
3310
  }
869
- else if (status === 404) {
870
- const _responseText = response.data;
871
- let result404 = null;
872
- let resultData404 = _responseText;
873
- result404 = JSON.parse(resultData404);
874
- return throwException("Not Found", status, _responseText, _headers, result404);
875
- }
876
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) {
@@ -1334,7 +3779,7 @@ export class ProjectsApiClient extends ApiClientBase {
1334
3779
  method: "GET",
1335
3780
  url: url_,
1336
3781
  headers: {
1337
- "Accept": "text/plain"
3782
+ "Accept": "application/json"
1338
3783
  },
1339
3784
  cancelToken
1340
3785
  };
@@ -1400,7 +3845,7 @@ export class ProjectsApiClient extends ApiClientBase {
1400
3845
  method: "GET",
1401
3846
  url: url_,
1402
3847
  headers: {
1403
- "Accept": "text/plain"
3848
+ "Accept": "application/json"
1404
3849
  },
1405
3850
  cancelToken
1406
3851
  };
@@ -1556,7 +4001,7 @@ export class ProjectsApiClient extends ApiClientBase {
1556
4001
  method: "GET",
1557
4002
  url: url_,
1558
4003
  headers: {
1559
- "Accept": "text/plain"
4004
+ "Accept": "application/octet-stream"
1560
4005
  },
1561
4006
  cancelToken
1562
4007
  };
@@ -1673,14 +4118,14 @@ export class ProjectsApiClient extends ApiClientBase {
1673
4118
  const _responseText = response.data;
1674
4119
  let result404 = null;
1675
4120
  let resultData404 = _responseText;
1676
- result404 = resultData404;
4121
+ result404 = JSON.parse(resultData404);
1677
4122
  return throwException("Not Found", status, _responseText, _headers, result404);
1678
4123
  }
1679
4124
  else if (status === 409) {
1680
4125
  const _responseText = response.data;
1681
4126
  let result409 = null;
1682
4127
  let resultData409 = _responseText;
1683
- result409 = resultData409;
4128
+ result409 = JSON.parse(resultData409);
1684
4129
  return throwException("Conflict", status, _responseText, _headers, result409);
1685
4130
  }
1686
4131
  else if (status === 401) {
@@ -1719,8 +4164,8 @@ export class ProjectsApiClient extends ApiClientBase {
1719
4164
  method: "POST",
1720
4165
  url: url_,
1721
4166
  headers: {
1722
- "Content-Type": "application/json-patch+json",
1723
- "Accept": "text/plain"
4167
+ "Content-Type": "application/json",
4168
+ "Accept": "application/json"
1724
4169
  },
1725
4170
  cancelToken
1726
4171
  };
@@ -1804,8 +4249,8 @@ export class ProjectsApiClient extends ApiClientBase {
1804
4249
  method: "POST",
1805
4250
  url: url_,
1806
4251
  headers: {
1807
- "Content-Type": "application/json-patch+json",
1808
- "Accept": "text/plain"
4252
+ "Content-Type": "application/json",
4253
+ "Accept": "application/json"
1809
4254
  },
1810
4255
  cancelToken
1811
4256
  };
@@ -1889,8 +4334,8 @@ export class ProjectsApiClient extends ApiClientBase {
1889
4334
  method: "POST",
1890
4335
  url: url_,
1891
4336
  headers: {
1892
- "Content-Type": "application/json-patch+json",
1893
- "Accept": "text/plain"
4337
+ "Content-Type": "application/json",
4338
+ "Accept": "application/json"
1894
4339
  },
1895
4340
  cancelToken
1896
4341
  };
@@ -1974,8 +4419,8 @@ export class ProjectsApiClient extends ApiClientBase {
1974
4419
  method: "POST",
1975
4420
  url: url_,
1976
4421
  headers: {
1977
- "Content-Type": "application/json-patch+json",
1978
- "Accept": "text/plain"
4422
+ "Content-Type": "application/json",
4423
+ "Accept": "application/json"
1979
4424
  },
1980
4425
  cancelToken
1981
4426
  };
@@ -2055,7 +4500,7 @@ export class ProjectsApiClient extends ApiClientBase {
2055
4500
  method: "GET",
2056
4501
  url: url_,
2057
4502
  headers: {
2058
- "Accept": "text/plain"
4503
+ "Accept": "application/json"
2059
4504
  },
2060
4505
  cancelToken
2061
4506
  };
@@ -2146,7 +4591,7 @@ export class ProjectsApiClient extends ApiClientBase {
2146
4591
  method: "POST",
2147
4592
  url: url_,
2148
4593
  headers: {
2149
- "Accept": "text/plain"
4594
+ "Accept": "application/json"
2150
4595
  },
2151
4596
  cancelToken
2152
4597
  };
@@ -2237,7 +4682,7 @@ export class ProjectsApiClient extends ApiClientBase {
2237
4682
  method: "POST",
2238
4683
  url: url_,
2239
4684
  headers: {
2240
- "Accept": "text/plain"
4685
+ "Accept": "application/json"
2241
4686
  },
2242
4687
  cancelToken
2243
4688
  };
@@ -2310,7 +4755,7 @@ export class ProjectsApiClient extends ApiClientBase {
2310
4755
  * Deletes specified projects.
2311
4756
  These projects will be hide from projects list immediately, but complete projects data cleaning will take some additional time.
2312
4757
  * @param tenantId (optional) Tenant identifier.
2313
- * @param body (optional)
4758
+ * @param body (optional) Operation parameters.
2314
4759
  * @return Success
2315
4760
  */
2316
4761
  batchDelete(tenantId, body, cancelToken) {
@@ -2324,8 +4769,8 @@ export class ProjectsApiClient extends ApiClientBase {
2324
4769
  method: "DELETE",
2325
4770
  url: url_,
2326
4771
  headers: {
2327
- "Content-Type": "application/json-patch+json",
2328
- "Accept": "text/plain"
4772
+ "Content-Type": "application/json",
4773
+ "Accept": "application/json"
2329
4774
  },
2330
4775
  cancelToken
2331
4776
  };
@@ -2387,7 +4832,7 @@ export class ProjectsApiClient extends ApiClientBase {
2387
4832
  method: "GET",
2388
4833
  url: url_,
2389
4834
  headers: {
2390
- "Accept": "text/plain"
4835
+ "Accept": "application/json"
2391
4836
  },
2392
4837
  cancelToken
2393
4838
  };
@@ -2449,7 +4894,7 @@ export class ProjectsApiClient extends ApiClientBase {
2449
4894
  method: "GET",
2450
4895
  url: url_,
2451
4896
  headers: {
2452
- "Accept": "text/plain"
4897
+ "Accept": "application/json"
2453
4898
  },
2454
4899
  cancelToken
2455
4900
  };
@@ -2526,7 +4971,7 @@ export class ProjectsApiClient extends ApiClientBase {
2526
4971
  method: "GET",
2527
4972
  url: url_,
2528
4973
  headers: {
2529
- "Accept": "text/plain"
4974
+ "Accept": "application/json"
2530
4975
  },
2531
4976
  cancelToken
2532
4977
  };
@@ -2696,7 +5141,7 @@ export class ProjectsApiClient extends ApiClientBase {
2696
5141
  method: "GET",
2697
5142
  url: url_,
2698
5143
  headers: {
2699
- "Accept": "text/plain"
5144
+ "Accept": "application/json"
2700
5145
  },
2701
5146
  cancelToken
2702
5147
  };
@@ -2997,7 +5442,7 @@ export class ProjectsApiClient extends ApiClientBase {
2997
5442
  /**
2998
5443
  * Attachs the specified data to the project's order in ecommerce system.
2999
5444
  * @param id Project identifier.
3000
- * @param itemId (optional)
5445
+ * @param itemId (optional) Project item identifier.
3001
5446
  * @param tenantId (optional) Tenant identifier.
3002
5447
  * @param body (optional) A list of data items, which should be attached to project's order.
3003
5448
  * @return Success
@@ -3018,7 +5463,7 @@ export class ProjectsApiClient extends ApiClientBase {
3018
5463
  method: "POST",
3019
5464
  url: url_,
3020
5465
  headers: {
3021
- "Content-Type": "application/json-patch+json",
5466
+ "Content-Type": "application/json",
3022
5467
  },
3023
5468
  cancelToken
3024
5469
  };
@@ -3116,7 +5561,7 @@ export class StorefrontsApiClient extends ApiClientBase {
3116
5561
  method: "GET",
3117
5562
  url: url_,
3118
5563
  headers: {
3119
- "Accept": "text/plain"
5564
+ "Accept": "application/json"
3120
5565
  },
3121
5566
  cancelToken
3122
5567
  };
@@ -3182,7 +5627,7 @@ export class StorefrontsApiClient extends ApiClientBase {
3182
5627
  method: "GET",
3183
5628
  url: url_,
3184
5629
  headers: {
3185
- "Accept": "text/plain"
5630
+ "Accept": "application/json"
3186
5631
  },
3187
5632
  cancelToken
3188
5633
  };
@@ -3288,7 +5733,7 @@ export class StorefrontUsersApiClient extends ApiClientBase {
3288
5733
  method: "GET",
3289
5734
  url: url_,
3290
5735
  headers: {
3291
- "Accept": "text/plain"
5736
+ "Accept": "application/json"
3292
5737
  },
3293
5738
  cancelToken
3294
5739
  };
@@ -3322,6 +5767,13 @@ export class StorefrontUsersApiClient extends ApiClientBase {
3322
5767
  result200 = JSON.parse(resultData200);
3323
5768
  return Promise.resolve(result200);
3324
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
+ }
3325
5777
  else if (status === 401) {
3326
5778
  const _responseText = response.data;
3327
5779
  return throwException("Unauthorized", status, _responseText, _headers);
@@ -3358,8 +5810,8 @@ export class StorefrontUsersApiClient extends ApiClientBase {
3358
5810
  method: "POST",
3359
5811
  url: url_,
3360
5812
  headers: {
3361
- "Content-Type": "application/json-patch+json",
3362
- "Accept": "text/plain"
5813
+ "Content-Type": "application/json",
5814
+ "Accept": "application/json"
3363
5815
  },
3364
5816
  cancelToken
3365
5817
  };
@@ -3437,7 +5889,7 @@ export class StorefrontUsersApiClient extends ApiClientBase {
3437
5889
  method: "GET",
3438
5890
  url: url_,
3439
5891
  headers: {
3440
- "Accept": "text/plain"
5892
+ "Accept": "application/json"
3441
5893
  },
3442
5894
  cancelToken
3443
5895
  };
@@ -3521,8 +5973,8 @@ export class StorefrontUsersApiClient extends ApiClientBase {
3521
5973
  method: "POST",
3522
5974
  url: url_,
3523
5975
  headers: {
3524
- "Content-Type": "application/json-patch+json",
3525
- "Accept": "text/plain"
5976
+ "Content-Type": "application/json",
5977
+ "Accept": "application/json"
3526
5978
  },
3527
5979
  cancelToken
3528
5980
  };
@@ -3599,7 +6051,7 @@ export class StorefrontUsersApiClient extends ApiClientBase {
3599
6051
  method: "POST",
3600
6052
  url: url_,
3601
6053
  headers: {
3602
- "Content-Type": "application/json-patch+json",
6054
+ "Content-Type": "application/json",
3603
6055
  },
3604
6056
  cancelToken
3605
6057
  };
@@ -3720,14 +6172,14 @@ export class StorefrontUsersApiClient extends ApiClientBase {
3720
6172
  const _responseText = response.data;
3721
6173
  let result404 = null;
3722
6174
  let resultData404 = _responseText;
3723
- result404 = resultData404;
6175
+ result404 = JSON.parse(resultData404);
3724
6176
  return throwException("Not Found", status, _responseText, _headers, result404);
3725
6177
  }
3726
6178
  else if (status === 409) {
3727
6179
  const _responseText = response.data;
3728
6180
  let result409 = null;
3729
6181
  let resultData409 = _responseText;
3730
- result409 = resultData409;
6182
+ result409 = JSON.parse(resultData409);
3731
6183
  return throwException("Conflict", status, _responseText, _headers, result409);
3732
6184
  }
3733
6185
  else if (status === 401) {
@@ -3768,7 +6220,7 @@ export class TenantInfoApiClient extends ApiClientBase {
3768
6220
  method: "GET",
3769
6221
  url: url_,
3770
6222
  headers: {
3771
- "Accept": "text/plain"
6223
+ "Accept": "application/json"
3772
6224
  },
3773
6225
  cancelToken
3774
6226
  };
@@ -3830,7 +6282,7 @@ export class TenantInfoApiClient extends ApiClientBase {
3830
6282
  method: "GET",
3831
6283
  url: url_,
3832
6284
  headers: {
3833
- "Accept": "text/plain"
6285
+ "Accept": "application/json"
3834
6286
  },
3835
6287
  cancelToken
3836
6288
  };
@@ -3892,7 +6344,7 @@ export class TenantInfoApiClient extends ApiClientBase {
3892
6344
  method: "GET",
3893
6345
  url: url_,
3894
6346
  headers: {
3895
- "Accept": "text/plain"
6347
+ "Accept": "application/json"
3896
6348
  },
3897
6349
  cancelToken
3898
6350
  };
@@ -3954,7 +6406,7 @@ export class TenantInfoApiClient extends ApiClientBase {
3954
6406
  method: "GET",
3955
6407
  url: url_,
3956
6408
  headers: {
3957
- "Accept": "text/plain"
6409
+ "Accept": "application/json"
3958
6410
  },
3959
6411
  cancelToken
3960
6412
  };
@@ -4003,6 +6455,32 @@ export class TenantInfoApiClient extends ApiClientBase {
4003
6455
  return Promise.resolve(null);
4004
6456
  }
4005
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 = {}));
4006
6484
  /** Type of editor that should be configured by workflow. */
4007
6485
  export var WorkflowType;
4008
6486
  (function (WorkflowType) {
@@ -4011,6 +6489,34 @@ export var WorkflowType;
4011
6489
  WorkflowType["DesignEditor"] = "DesignEditor";
4012
6490
  WorkflowType["WorkflowElements"] = "WorkflowElements";
4013
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 = {}));
4014
6520
  /** Defines all available date period filter values for queries. */
4015
6521
  export var DatePeriod;
4016
6522
  (function (DatePeriod) {
@@ -4055,6 +6561,14 @@ export var RenderHiResScenarioOutputFlipMode;
4055
6561
  RenderHiResScenarioOutputFlipMode["Vertical"] = "Vertical";
4056
6562
  RenderHiResScenarioOutputFlipMode["Both"] = "Both";
4057
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 = {}));
4058
6572
  /** Available value types for order data item. */
4059
6573
  export var OrderDataItemValueType;
4060
6574
  (function (OrderDataItemValueType) {