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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8,7 +8,7 @@
8
8
  //----------------------
9
9
  // ReSharper disable InconsistentNaming
10
10
  Object.defineProperty(exports, "__esModule", { value: true });
11
- exports.ApiException = exports.StorefrontType = exports.OrderDataItemValueType = exports.RenderHiResScenarioOutputFlipMode = exports.RenderHiResScenarioOutputColorSpace = exports.RenderHiResScenarioOutputFormat = exports.ProjectItemResourceType = exports.ProjectProcessingStatus = exports.DatePeriod = exports.WorkflowType = exports.TenantInfoApiClient = exports.StorefrontUsersApiClient = exports.StorefrontsApiClient = exports.ProjectsApiClient = exports.ProductSpecificationsApiClient = exports.ProductReferencesApiClient = exports.ProcessingPipelinesApiClient = exports.BuildInfoApiClient = exports.ApiClientBase = exports.ApiClientConfiguration = void 0;
11
+ exports.ApiException = exports.StorefrontType = exports.OrderDataItemValueType = exports.RenderHiResScenarioOutputRotateMode = exports.RenderHiResScenarioOutputFlipMode = exports.RenderHiResScenarioOutputColorSpace = exports.RenderHiResScenarioOutputFormat = exports.ProjectItemResourceType = exports.ProjectProcessingStatus = exports.DatePeriod = exports.SurfaceUsageType = exports.ProductVariantMockupType = exports.ProductVariantResourceType = exports.ProductReferenceType = exports.WorkflowType = exports.AppearanceDataType = exports.ConflictType = exports.OptionType = exports.TenantInfoApiClient = exports.StorefrontUsersApiClient = exports.StorefrontsApiClient = exports.ProjectsApiClient = exports.ProductSpecificationsApiClient = exports.ProductsApiClient = exports.ProductReferencesApiClient = exports.ProductLinksApiClient = exports.ProcessingPipelinesApiClient = exports.BuildInfoApiClient = exports.ApiClientBase = exports.ApiClientConfiguration = void 0;
12
12
  const axios_1 = require("axios");
13
13
  class ApiClientConfiguration {
14
14
  apiUrl;
@@ -119,7 +119,7 @@ class BuildInfoApiClient extends ApiClientBase {
119
119
  method: "GET",
120
120
  url: url_,
121
121
  headers: {
122
- "Accept": "text/plain"
122
+ "Accept": "application/json"
123
123
  },
124
124
  cancelToken
125
125
  };
@@ -193,7 +193,7 @@ class ProcessingPipelinesApiClient extends ApiClientBase {
193
193
  method: "GET",
194
194
  url: url_,
195
195
  headers: {
196
- "Accept": "text/plain"
196
+ "Accept": "application/json"
197
197
  },
198
198
  cancelToken
199
199
  };
@@ -259,7 +259,7 @@ class ProcessingPipelinesApiClient extends ApiClientBase {
259
259
  method: "GET",
260
260
  url: url_,
261
261
  headers: {
262
- "Accept": "text/plain"
262
+ "Accept": "application/json"
263
263
  },
264
264
  cancelToken
265
265
  };
@@ -316,7 +316,7 @@ class ProcessingPipelinesApiClient extends ApiClientBase {
316
316
  }
317
317
  }
318
318
  exports.ProcessingPipelinesApiClient = ProcessingPipelinesApiClient;
319
- class ProductReferencesApiClient extends ApiClientBase {
319
+ class ProductLinksApiClient extends ApiClientBase {
320
320
  instance;
321
321
  baseUrl;
322
322
  jsonParseReviver = undefined;
@@ -326,10 +326,7 @@ class ProductReferencesApiClient extends ApiClientBase {
326
326
  this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : this.getBaseUrl("");
327
327
  }
328
328
  /**
329
- * Returns all storefront product references relevant to the specified query parameters.
330
- * @param storefrontId Storefront identifier.
331
- * @param productReference (optional) Product reference filter. Product reference is an external reference to Customer's Canvas product specification, e.g online store product identifier.
332
- * @param productSpecificationId (optional) Cusomer's Canvas product specification filter.
329
+ * Returns all product links, relevant to the specified query parameters.
333
330
  * @param skip (optional) Defines page start offset from beginning of sorted result list.
334
331
  * @param take (optional) Defines page length (how many consequent items of sorted result list should be taken).
335
332
  * @param sorting (optional) Defines sorting order of result list e.g.: "Title ASC, LastModified DESC".
@@ -337,16 +334,8 @@ class ProductReferencesApiClient extends ApiClientBase {
337
334
  * @param tenantId (optional) Tenant identifier.
338
335
  * @return Success
339
336
  */
340
- getAll(storefrontId, productReference, productSpecificationId, skip, take, sorting, search, tenantId, cancelToken) {
341
- let url_ = this.baseUrl + "/api/storefront/v1/product-references?";
342
- if (storefrontId === undefined || storefrontId === null)
343
- throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
344
- else
345
- url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
346
- if (productReference !== undefined && productReference !== null)
347
- url_ += "productReference=" + encodeURIComponent("" + productReference) + "&";
348
- if (productSpecificationId !== undefined && productSpecificationId !== null)
349
- url_ += "productSpecificationId=" + encodeURIComponent("" + productSpecificationId) + "&";
337
+ getAllProductLinks(skip, take, sorting, search, tenantId, cancelToken) {
338
+ let url_ = this.baseUrl + "/api/storefront/v1/product-links?";
350
339
  if (skip !== undefined && skip !== null)
351
340
  url_ += "skip=" + encodeURIComponent("" + skip) + "&";
352
341
  if (take !== undefined && take !== null)
@@ -362,7 +351,7 @@ class ProductReferencesApiClient extends ApiClientBase {
362
351
  method: "GET",
363
352
  url: url_,
364
353
  headers: {
365
- "Accept": "text/plain"
354
+ "Accept": "application/json"
366
355
  },
367
356
  cancelToken
368
357
  };
@@ -376,10 +365,10 @@ class ProductReferencesApiClient extends ApiClientBase {
376
365
  throw _error;
377
366
  }
378
367
  }).then((_response) => {
379
- return this.transformResult(url_, _response, (_response) => this.processGetAll(_response));
368
+ return this.transformResult(url_, _response, (_response) => this.processGetAllProductLinks(_response));
380
369
  });
381
370
  }
382
- processGetAll(response) {
371
+ processGetAllProductLinks(response) {
383
372
  const status = response.status;
384
373
  let _headers = {};
385
374
  if (response.headers && typeof response.headers === "object") {
@@ -411,29 +400,30 @@ class ProductReferencesApiClient extends ApiClientBase {
411
400
  return Promise.resolve(null);
412
401
  }
413
402
  /**
414
- * Creates a new storefront product reference.
415
- * @param storefrontId Storefront identifier.
403
+ * Returns a product link by its identifier.
404
+ * @param id Product identifier.
405
+ * @param productLinkVersionId (optional) Product link version identifier. Optional
406
+ * @param productVersionId (optional) Product version identifier which represents linked product version. Optional
416
407
  * @param tenantId (optional) Tenant identifier.
417
- * @param body (optional) Create operation parameters.
418
408
  * @return Success
419
409
  */
420
- create(storefrontId, tenantId, body, cancelToken) {
421
- let url_ = this.baseUrl + "/api/storefront/v1/product-references?";
422
- if (storefrontId === undefined || storefrontId === null)
423
- throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
424
- else
425
- url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
410
+ getProductLink(id, productLinkVersionId, productVersionId, tenantId, cancelToken) {
411
+ let url_ = this.baseUrl + "/api/storefront/v1/product-links/{id}?";
412
+ if (id === undefined || id === null)
413
+ throw new Error("The parameter 'id' must be defined.");
414
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
415
+ if (productLinkVersionId !== undefined && productLinkVersionId !== null)
416
+ url_ += "productLinkVersionId=" + encodeURIComponent("" + productLinkVersionId) + "&";
417
+ if (productVersionId !== undefined && productVersionId !== null)
418
+ url_ += "productVersionId=" + encodeURIComponent("" + productVersionId) + "&";
426
419
  if (tenantId !== undefined && tenantId !== null)
427
420
  url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
428
421
  url_ = url_.replace(/[?&]$/, "");
429
- const content_ = JSON.stringify(body);
430
422
  let options_ = {
431
- data: content_,
432
- method: "POST",
423
+ method: "GET",
433
424
  url: url_,
434
425
  headers: {
435
- "Content-Type": "application/json-patch+json",
436
- "Accept": "text/plain"
426
+ "Accept": "application/json"
437
427
  },
438
428
  cancelToken
439
429
  };
@@ -447,10 +437,10 @@ class ProductReferencesApiClient extends ApiClientBase {
447
437
  throw _error;
448
438
  }
449
439
  }).then((_response) => {
450
- return this.transformResult(url_, _response, (_response) => this.processCreate(_response));
440
+ return this.transformResult(url_, _response, (_response) => this.processGetProductLink(_response));
451
441
  });
452
442
  }
453
- processCreate(response) {
443
+ processGetProductLink(response) {
454
444
  const status = response.status;
455
445
  let _headers = {};
456
446
  if (response.headers && typeof response.headers === "object") {
@@ -460,12 +450,12 @@ class ProductReferencesApiClient extends ApiClientBase {
460
450
  }
461
451
  }
462
452
  }
463
- if (status === 201) {
453
+ if (status === 200) {
464
454
  const _responseText = response.data;
465
- let result201 = null;
466
- let resultData201 = _responseText;
467
- result201 = JSON.parse(resultData201);
468
- return Promise.resolve(result201);
455
+ let result200 = null;
456
+ let resultData200 = _responseText;
457
+ result200 = JSON.parse(resultData200);
458
+ return Promise.resolve(result200);
469
459
  }
470
460
  else if (status === 404) {
471
461
  const _responseText = response.data;
@@ -474,6 +464,13 @@ class ProductReferencesApiClient extends ApiClientBase {
474
464
  result404 = JSON.parse(resultData404);
475
465
  return throwException("Not Found", status, _responseText, _headers, result404);
476
466
  }
467
+ else if (status === 409) {
468
+ const _responseText = response.data;
469
+ let result409 = null;
470
+ let resultData409 = _responseText;
471
+ result409 = JSON.parse(resultData409);
472
+ return throwException("Conflict", status, _responseText, _headers, result409);
473
+ }
477
474
  else if (status === 401) {
478
475
  const _responseText = response.data;
479
476
  return throwException("Unauthorized", status, _responseText, _headers);
@@ -489,21 +486,28 @@ class ProductReferencesApiClient extends ApiClientBase {
489
486
  return Promise.resolve(null);
490
487
  }
491
488
  /**
492
- * Returns a storefront product reference.
493
- * @param reference Product reference - external reference to Customer's Canvas product specification, e.g online store product identifier.
494
- * @param storefrontId Storefront identifier.
489
+ * Returns a product link summary by product link identifier.
490
+ * @param id Product link identifier.
491
+ * @param productLinkVersionId (optional) Product link version identifier.
492
+ * @param productVersionId (optional) Product link identifier.
493
+ * @param productVariantId (optional) Product variant identifier.
494
+ * @param sku (optional) Product variant SKU.
495
495
  * @param tenantId (optional) Tenant identifier.
496
496
  * @return Success
497
497
  */
498
- get(reference, storefrontId, tenantId, cancelToken) {
499
- let url_ = this.baseUrl + "/api/storefront/v1/product-references/{reference}?";
500
- if (reference === undefined || reference === null)
501
- throw new Error("The parameter 'reference' must be defined.");
502
- url_ = url_.replace("{reference}", encodeURIComponent("" + reference));
503
- if (storefrontId === undefined || storefrontId === null)
504
- throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
505
- else
506
- url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
498
+ getProductSummary(id, productLinkVersionId, productVersionId, productVariantId, sku, tenantId, cancelToken) {
499
+ let url_ = this.baseUrl + "/api/storefront/v1/product-links/{id}/summary?";
500
+ if (id === undefined || id === null)
501
+ throw new Error("The parameter 'id' must be defined.");
502
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
503
+ if (productLinkVersionId !== undefined && productLinkVersionId !== null)
504
+ url_ += "productLinkVersionId=" + encodeURIComponent("" + productLinkVersionId) + "&";
505
+ if (productVersionId !== undefined && productVersionId !== null)
506
+ url_ += "productVersionId=" + encodeURIComponent("" + productVersionId) + "&";
507
+ if (productVariantId !== undefined && productVariantId !== null)
508
+ url_ += "productVariantId=" + encodeURIComponent("" + productVariantId) + "&";
509
+ if (sku !== undefined && sku !== null)
510
+ url_ += "sku=" + encodeURIComponent("" + sku) + "&";
507
511
  if (tenantId !== undefined && tenantId !== null)
508
512
  url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
509
513
  url_ = url_.replace(/[?&]$/, "");
@@ -511,7 +515,7 @@ class ProductReferencesApiClient extends ApiClientBase {
511
515
  method: "GET",
512
516
  url: url_,
513
517
  headers: {
514
- "Accept": "text/plain"
518
+ "Accept": "application/json"
515
519
  },
516
520
  cancelToken
517
521
  };
@@ -525,10 +529,10 @@ class ProductReferencesApiClient extends ApiClientBase {
525
529
  throw _error;
526
530
  }
527
531
  }).then((_response) => {
528
- return this.transformResult(url_, _response, (_response) => this.processGet(_response));
532
+ return this.transformResult(url_, _response, (_response) => this.processGetProductSummary(_response));
529
533
  });
530
534
  }
531
- processGet(response) {
535
+ processGetProductSummary(response) {
532
536
  const status = response.status;
533
537
  let _headers = {};
534
538
  if (response.headers && typeof response.headers === "object") {
@@ -552,6 +556,13 @@ class ProductReferencesApiClient extends ApiClientBase {
552
556
  result404 = JSON.parse(resultData404);
553
557
  return throwException("Not Found", status, _responseText, _headers, result404);
554
558
  }
559
+ else if (status === 409) {
560
+ const _responseText = response.data;
561
+ let result409 = null;
562
+ let resultData409 = _responseText;
563
+ result409 = JSON.parse(resultData409);
564
+ return throwException("Conflict", status, _responseText, _headers, result409);
565
+ }
555
566
  else if (status === 401) {
556
567
  const _responseText = response.data;
557
568
  return throwException("Unauthorized", status, _responseText, _headers);
@@ -567,29 +578,33 @@ class ProductReferencesApiClient extends ApiClientBase {
567
578
  return Promise.resolve(null);
568
579
  }
569
580
  /**
570
- * Deletes the storefront product reference.
571
- * @param reference Product reference - external reference to Customer's Canvas product specification, e.g online store product identifier.
572
- * @param storefrontId Storefront identifier.
581
+ * Returns a product link personalization workflow description by product link identifier.
582
+ * @param id Product link identifier.
583
+ * @param productLinkVersionId (optional) Product link version identifier.
584
+ * @param productVersionId (optional) Product version identifier.
585
+ * @param productFilterId (optional) Product filter identifier.
573
586
  * @param tenantId (optional) Tenant identifier.
574
587
  * @return Success
575
588
  */
576
- delete(reference, storefrontId, tenantId, cancelToken) {
577
- let url_ = this.baseUrl + "/api/storefront/v1/product-references/{reference}?";
578
- if (reference === undefined || reference === null)
579
- throw new Error("The parameter 'reference' must be defined.");
580
- url_ = url_.replace("{reference}", encodeURIComponent("" + reference));
581
- if (storefrontId === undefined || storefrontId === null)
582
- throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
583
- else
584
- url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
589
+ getPersonalizationWorkflow(id, productLinkVersionId, productVersionId, productFilterId, tenantId, cancelToken) {
590
+ let url_ = this.baseUrl + "/api/storefront/v1/product-links/{id}/personalization-workflow?";
591
+ if (id === undefined || id === null)
592
+ throw new Error("The parameter 'id' must be defined.");
593
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
594
+ if (productLinkVersionId !== undefined && productLinkVersionId !== null)
595
+ url_ += "productLinkVersionId=" + encodeURIComponent("" + productLinkVersionId) + "&";
596
+ if (productVersionId !== undefined && productVersionId !== null)
597
+ url_ += "productVersionId=" + encodeURIComponent("" + productVersionId) + "&";
598
+ if (productFilterId !== undefined && productFilterId !== null)
599
+ url_ += "productFilterId=" + encodeURIComponent("" + productFilterId) + "&";
585
600
  if (tenantId !== undefined && tenantId !== null)
586
601
  url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
587
602
  url_ = url_.replace(/[?&]$/, "");
588
603
  let options_ = {
589
- method: "DELETE",
604
+ method: "GET",
590
605
  url: url_,
591
606
  headers: {
592
- "Accept": "text/plain"
607
+ "Accept": "application/json"
593
608
  },
594
609
  cancelToken
595
610
  };
@@ -603,10 +618,10 @@ class ProductReferencesApiClient extends ApiClientBase {
603
618
  throw _error;
604
619
  }
605
620
  }).then((_response) => {
606
- return this.transformResult(url_, _response, (_response) => this.processDelete(_response));
621
+ return this.transformResult(url_, _response, (_response) => this.processGetPersonalizationWorkflow(_response));
607
622
  });
608
623
  }
609
- processDelete(response) {
624
+ processGetPersonalizationWorkflow(response) {
610
625
  const status = response.status;
611
626
  let _headers = {};
612
627
  if (response.headers && typeof response.headers === "object") {
@@ -630,6 +645,13 @@ class ProductReferencesApiClient extends ApiClientBase {
630
645
  result404 = JSON.parse(resultData404);
631
646
  return throwException("Not Found", status, _responseText, _headers, result404);
632
647
  }
648
+ else if (status === 409) {
649
+ const _responseText = response.data;
650
+ let result409 = null;
651
+ let resultData409 = _responseText;
652
+ result409 = JSON.parse(resultData409);
653
+ return throwException("Conflict", status, _responseText, _headers, result409);
654
+ }
633
655
  else if (status === 401) {
634
656
  const _responseText = response.data;
635
657
  return throwException("Unauthorized", status, _responseText, _headers);
@@ -644,22 +666,63 @@ class ProductReferencesApiClient extends ApiClientBase {
644
666
  }
645
667
  return Promise.resolve(null);
646
668
  }
669
+ }
670
+ exports.ProductLinksApiClient = ProductLinksApiClient;
671
+ class ProductReferencesApiClient extends ApiClientBase {
672
+ instance;
673
+ baseUrl;
674
+ jsonParseReviver = undefined;
675
+ constructor(configuration, baseUrl, instance) {
676
+ super(configuration);
677
+ this.instance = instance ? instance : axios_1.create();
678
+ this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : this.getBaseUrl("");
679
+ }
647
680
  /**
648
- * Returns a product specification by the storefront product reference.
649
- * @param reference Product reference - external reference to Customer's Canvas product specification, e.g online store product identifier.
681
+ * Returns all storefront product references relevant to the specified query parameters.
650
682
  * @param storefrontId Storefront identifier.
683
+ * @param productReference (optional) Product reference filter.
684
+ Product reference is an external reference to Customer's Canvas product, e.g online store product identifier.
685
+ * @param productSpecificationId (optional) Customer's Canvas product specification filter.
686
+ * @param productId (optional) Customer's Canvas product filter.
687
+ * @param productLinkId (optional) Customer's Canvas product link filter.
688
+ * @param skip (optional) Defines page start offset from beginning of sorted result list.
689
+ * @param take (optional) Defines page length (how many consequent items of sorted result list should be taken).
690
+ * @param sorting (optional) Defines sorting order of result list e.g.: "Title ASC, LastModified DESC".
691
+ * @param search (optional) Search string for partial match.
692
+ * @param sku (optional) SKU filter.
693
+ * @param tags (optional) List of tags that product should have.
694
+ * @param customFields (optional) Serialized custom fields dictionary filter. For example: {"public":"true","name":"my item"}.
651
695
  * @param tenantId (optional) Tenant identifier.
652
696
  * @return Success
653
697
  */
654
- getProductSpecification(reference, storefrontId, tenantId, cancelToken) {
655
- let url_ = this.baseUrl + "/api/storefront/v1/product-references/{reference}/product-specification?";
656
- if (reference === undefined || reference === null)
657
- throw new Error("The parameter 'reference' must be defined.");
658
- url_ = url_.replace("{reference}", encodeURIComponent("" + reference));
698
+ getAll(storefrontId, productReference, productSpecificationId, productId, productLinkId, skip, take, sorting, search, sku, tags, customFields, tenantId, cancelToken) {
699
+ let url_ = this.baseUrl + "/api/storefront/v1/product-references?";
659
700
  if (storefrontId === undefined || storefrontId === null)
660
701
  throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
661
702
  else
662
703
  url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
704
+ if (productReference !== undefined && productReference !== null)
705
+ url_ += "productReference=" + encodeURIComponent("" + productReference) + "&";
706
+ if (productSpecificationId !== undefined && productSpecificationId !== null)
707
+ url_ += "productSpecificationId=" + encodeURIComponent("" + productSpecificationId) + "&";
708
+ if (productId !== undefined && productId !== null)
709
+ url_ += "productId=" + encodeURIComponent("" + productId) + "&";
710
+ if (productLinkId !== undefined && productLinkId !== null)
711
+ url_ += "productLinkId=" + encodeURIComponent("" + productLinkId) + "&";
712
+ if (skip !== undefined && skip !== null)
713
+ url_ += "skip=" + encodeURIComponent("" + skip) + "&";
714
+ if (take !== undefined && take !== null)
715
+ url_ += "take=" + encodeURIComponent("" + take) + "&";
716
+ if (sorting !== undefined && sorting !== null)
717
+ url_ += "sorting=" + encodeURIComponent("" + sorting) + "&";
718
+ if (search !== undefined && search !== null)
719
+ url_ += "search=" + encodeURIComponent("" + search) + "&";
720
+ if (sku !== undefined && sku !== null)
721
+ url_ += "sku=" + encodeURIComponent("" + sku) + "&";
722
+ if (tags !== undefined && tags !== null)
723
+ tags && tags.forEach(item => { url_ += "tags=" + encodeURIComponent("" + item) + "&"; });
724
+ if (customFields !== undefined && customFields !== null)
725
+ url_ += "customFields=" + encodeURIComponent("" + customFields) + "&";
663
726
  if (tenantId !== undefined && tenantId !== null)
664
727
  url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
665
728
  url_ = url_.replace(/[?&]$/, "");
@@ -667,7 +730,7 @@ class ProductReferencesApiClient extends ApiClientBase {
667
730
  method: "GET",
668
731
  url: url_,
669
732
  headers: {
670
- "Accept": "text/plain"
733
+ "Accept": "application/json"
671
734
  },
672
735
  cancelToken
673
736
  };
@@ -681,10 +744,10 @@ class ProductReferencesApiClient extends ApiClientBase {
681
744
  throw _error;
682
745
  }
683
746
  }).then((_response) => {
684
- return this.transformResult(url_, _response, (_response) => this.processGetProductSpecification(_response));
747
+ return this.transformResult(url_, _response, (_response) => this.processGetAll(_response));
685
748
  });
686
749
  }
687
- processGetProductSpecification(response) {
750
+ processGetAll(response) {
688
751
  const status = response.status;
689
752
  let _headers = {};
690
753
  if (response.headers && typeof response.headers === "object") {
@@ -701,12 +764,12 @@ class ProductReferencesApiClient extends ApiClientBase {
701
764
  result200 = JSON.parse(resultData200);
702
765
  return Promise.resolve(result200);
703
766
  }
704
- else if (status === 404) {
767
+ else if (status === 409) {
705
768
  const _responseText = response.data;
706
- let result404 = null;
707
- let resultData404 = _responseText;
708
- result404 = JSON.parse(resultData404);
709
- return throwException("Not Found", status, _responseText, _headers, result404);
769
+ let result409 = null;
770
+ let resultData409 = _responseText;
771
+ result409 = JSON.parse(resultData409);
772
+ return throwException("Conflict", status, _responseText, _headers, result409);
710
773
  }
711
774
  else if (status === 401) {
712
775
  const _responseText = response.data;
@@ -723,45 +786,29 @@ class ProductReferencesApiClient extends ApiClientBase {
723
786
  return Promise.resolve(null);
724
787
  }
725
788
  /**
726
- * Returns a product cost details from ecommerce system.
727
- * @param reference Product reference - external reference to Customer's Canvas product product specification, e.g online store product identifier.
728
- * @param sku Product SKU.
789
+ * Creates a new storefront product reference.
729
790
  * @param storefrontId Storefront identifier.
730
- * @param storefrontUserId (optional) Storefront user identifier.
731
- * @param currencyCode (optional) Product cost currency code.
732
- * @param quantity (optional) Product quantity.
733
791
  * @param tenantId (optional) Tenant identifier.
792
+ * @param body (optional) Create operation parameters.
734
793
  * @return Success
735
794
  */
736
- getProductCostDetails(reference, sku, storefrontId, storefrontUserId, currencyCode, quantity, tenantId, cancelToken) {
737
- let url_ = this.baseUrl + "/api/storefront/v1/product-references/{reference}/product-cost-details?";
738
- if (reference === undefined || reference === null)
739
- throw new Error("The parameter 'reference' must be defined.");
740
- url_ = url_.replace("{reference}", encodeURIComponent("" + reference));
741
- if (sku === undefined || sku === null)
742
- throw new Error("The parameter 'sku' must be defined and cannot be null.");
743
- else
744
- url_ += "sku=" + encodeURIComponent("" + sku) + "&";
795
+ create(storefrontId, tenantId, body, cancelToken) {
796
+ let url_ = this.baseUrl + "/api/storefront/v1/product-references?";
745
797
  if (storefrontId === undefined || storefrontId === null)
746
798
  throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
747
799
  else
748
800
  url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
749
- if (storefrontUserId !== undefined && storefrontUserId !== null)
750
- url_ += "storefrontUserId=" + encodeURIComponent("" + storefrontUserId) + "&";
751
- if (currencyCode !== undefined && currencyCode !== null)
752
- url_ += "currencyCode=" + encodeURIComponent("" + currencyCode) + "&";
753
- if (quantity === null)
754
- throw new Error("The parameter 'quantity' cannot be null.");
755
- else if (quantity !== undefined)
756
- url_ += "quantity=" + encodeURIComponent("" + quantity) + "&";
757
801
  if (tenantId !== undefined && tenantId !== null)
758
802
  url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
759
803
  url_ = url_.replace(/[?&]$/, "");
804
+ const content_ = JSON.stringify(body);
760
805
  let options_ = {
761
- method: "GET",
806
+ data: content_,
807
+ method: "POST",
762
808
  url: url_,
763
809
  headers: {
764
- "Accept": "text/plain"
810
+ "Content-Type": "application/json",
811
+ "Accept": "application/json"
765
812
  },
766
813
  cancelToken
767
814
  };
@@ -775,10 +822,10 @@ class ProductReferencesApiClient extends ApiClientBase {
775
822
  throw _error;
776
823
  }
777
824
  }).then((_response) => {
778
- return this.transformResult(url_, _response, (_response) => this.processGetProductCostDetails(_response));
825
+ return this.transformResult(url_, _response, (_response) => this.processCreate(_response));
779
826
  });
780
827
  }
781
- processGetProductCostDetails(response) {
828
+ processCreate(response) {
782
829
  const status = response.status;
783
830
  let _headers = {};
784
831
  if (response.headers && typeof response.headers === "object") {
@@ -788,12 +835,12 @@ class ProductReferencesApiClient extends ApiClientBase {
788
835
  }
789
836
  }
790
837
  }
791
- if (status === 200) {
838
+ if (status === 201) {
792
839
  const _responseText = response.data;
793
- let result200 = null;
794
- let resultData200 = _responseText;
795
- result200 = JSON.parse(resultData200);
796
- return Promise.resolve(result200);
840
+ let result201 = null;
841
+ let resultData201 = _responseText;
842
+ result201 = JSON.parse(resultData201);
843
+ return Promise.resolve(result201);
797
844
  }
798
845
  else if (status === 404) {
799
846
  const _responseText = response.data;
@@ -802,6 +849,13 @@ class ProductReferencesApiClient extends ApiClientBase {
802
849
  result404 = JSON.parse(resultData404);
803
850
  return throwException("Not Found", status, _responseText, _headers, result404);
804
851
  }
852
+ else if (status === 409) {
853
+ const _responseText = response.data;
854
+ let result409 = null;
855
+ let resultData409 = _responseText;
856
+ result409 = JSON.parse(resultData409);
857
+ return throwException("Conflict", status, _responseText, _headers, result409);
858
+ }
805
859
  else if (status === 401) {
806
860
  const _responseText = response.data;
807
861
  return throwException("Unauthorized", status, _responseText, _headers);
@@ -817,21 +871,51 @@ class ProductReferencesApiClient extends ApiClientBase {
817
871
  return Promise.resolve(null);
818
872
  }
819
873
  /**
820
- * Returns a product personalization workflow description by product specification identifier.
821
- * @param reference Product reference - external reference to Customer's Canvas product specification, e.g online store product identifier.
822
- * @param storefrontId (optional) Storefront identifier.
874
+ * Returns a list of product specifications associated with storefront product references relevant to the specified query parameters.
875
+ * @param storefrontId Storefront identifier.
876
+ * @param productReference (optional) Product reference filter.
877
+ Product reference is an external reference to Customer's Canvas product, e.g online store product identifier.
878
+ * @param productSpecificationId (optional) Customer's Canvas product specification filter.
879
+ * @param productId (optional) Customer's Canvas product filter.
880
+ * @param productLinkId (optional) Customer's Canvas product link filter.
881
+ * @param skip (optional) Defines page start offset from beginning of sorted result list.
882
+ * @param take (optional) Defines page length (how many consequent items of sorted result list should be taken).
883
+ * @param sorting (optional) Defines sorting order of result list e.g.: "Title ASC, LastModified DESC".
884
+ * @param search (optional) Search string for partial match.
885
+ * @param sku (optional) SKU filter.
886
+ * @param tags (optional) List of tags that product should have.
887
+ * @param customFields (optional) Serialized custom fields dictionary filter. For example: {"public":"true","name":"my item"}.
823
888
  * @param tenantId (optional) Tenant identifier.
824
889
  * @return Success
825
890
  */
826
- getPersonalizationWorkflow(reference, storefrontId, tenantId, cancelToken) {
827
- let url_ = this.baseUrl + "/api/storefront/v1/product-references/{reference}/personalization-workflow?";
828
- if (reference === undefined || reference === null)
829
- throw new Error("The parameter 'reference' must be defined.");
830
- url_ = url_.replace("{reference}", encodeURIComponent("" + reference));
831
- if (storefrontId === null)
832
- throw new Error("The parameter 'storefrontId' cannot be null.");
833
- else if (storefrontId !== undefined)
891
+ getAllProductSpecifications(storefrontId, productReference, productSpecificationId, productId, productLinkId, skip, take, sorting, search, sku, tags, customFields, tenantId, cancelToken) {
892
+ let url_ = this.baseUrl + "/api/storefront/v1/product-references/product-specifications?";
893
+ if (storefrontId === undefined || storefrontId === null)
894
+ throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
895
+ else
834
896
  url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
897
+ if (productReference !== undefined && productReference !== null)
898
+ url_ += "productReference=" + encodeURIComponent("" + productReference) + "&";
899
+ if (productSpecificationId !== undefined && productSpecificationId !== null)
900
+ url_ += "productSpecificationId=" + encodeURIComponent("" + productSpecificationId) + "&";
901
+ if (productId !== undefined && productId !== null)
902
+ url_ += "productId=" + encodeURIComponent("" + productId) + "&";
903
+ if (productLinkId !== undefined && productLinkId !== null)
904
+ url_ += "productLinkId=" + encodeURIComponent("" + productLinkId) + "&";
905
+ if (skip !== undefined && skip !== null)
906
+ url_ += "skip=" + encodeURIComponent("" + skip) + "&";
907
+ if (take !== undefined && take !== null)
908
+ url_ += "take=" + encodeURIComponent("" + take) + "&";
909
+ if (sorting !== undefined && sorting !== null)
910
+ url_ += "sorting=" + encodeURIComponent("" + sorting) + "&";
911
+ if (search !== undefined && search !== null)
912
+ url_ += "search=" + encodeURIComponent("" + search) + "&";
913
+ if (sku !== undefined && sku !== null)
914
+ url_ += "sku=" + encodeURIComponent("" + sku) + "&";
915
+ if (tags !== undefined && tags !== null)
916
+ tags && tags.forEach(item => { url_ += "tags=" + encodeURIComponent("" + item) + "&"; });
917
+ if (customFields !== undefined && customFields !== null)
918
+ url_ += "customFields=" + encodeURIComponent("" + customFields) + "&";
835
919
  if (tenantId !== undefined && tenantId !== null)
836
920
  url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
837
921
  url_ = url_.replace(/[?&]$/, "");
@@ -839,7 +923,2127 @@ class ProductReferencesApiClient extends ApiClientBase {
839
923
  method: "GET",
840
924
  url: url_,
841
925
  headers: {
842
- "Accept": "text/plain"
926
+ "Accept": "application/json"
927
+ },
928
+ cancelToken
929
+ };
930
+ return this.transformOptions(options_).then(transformedOptions_ => {
931
+ return this.instance.request(transformedOptions_);
932
+ }).catch((_error) => {
933
+ if (isAxiosError(_error) && _error.response) {
934
+ return _error.response;
935
+ }
936
+ else {
937
+ throw _error;
938
+ }
939
+ }).then((_response) => {
940
+ return this.transformResult(url_, _response, (_response) => this.processGetAllProductSpecifications(_response));
941
+ });
942
+ }
943
+ processGetAllProductSpecifications(response) {
944
+ const status = response.status;
945
+ let _headers = {};
946
+ if (response.headers && typeof response.headers === "object") {
947
+ for (let k in response.headers) {
948
+ if (response.headers.hasOwnProperty(k)) {
949
+ _headers[k] = response.headers[k];
950
+ }
951
+ }
952
+ }
953
+ if (status === 200) {
954
+ const _responseText = response.data;
955
+ let result200 = null;
956
+ let resultData200 = _responseText;
957
+ result200 = JSON.parse(resultData200);
958
+ return Promise.resolve(result200);
959
+ }
960
+ else if (status === 409) {
961
+ const _responseText = response.data;
962
+ let result409 = null;
963
+ let resultData409 = _responseText;
964
+ result409 = JSON.parse(resultData409);
965
+ return throwException("Conflict", status, _responseText, _headers, result409);
966
+ }
967
+ else if (status === 401) {
968
+ const _responseText = response.data;
969
+ return throwException("Unauthorized", status, _responseText, _headers);
970
+ }
971
+ else if (status === 403) {
972
+ const _responseText = response.data;
973
+ return throwException("Forbidden", status, _responseText, _headers);
974
+ }
975
+ else if (status !== 200 && status !== 204) {
976
+ const _responseText = response.data;
977
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
978
+ }
979
+ return Promise.resolve(null);
980
+ }
981
+ /**
982
+ * Returns a list of products associated with storefront product references relevant to the specified query parameters.
983
+ * @param storefrontId Storefront identifier.
984
+ * @param productReference (optional) Product reference filter.
985
+ Product reference is an external reference to Customer's Canvas product, e.g online store product identifier.
986
+ * @param productSpecificationId (optional) Customer's Canvas product specification filter.
987
+ * @param productId (optional) Customer's Canvas product filter.
988
+ * @param productLinkId (optional) Customer's Canvas product link filter.
989
+ * @param skip (optional) Defines page start offset from beginning of sorted result list.
990
+ * @param take (optional) Defines page length (how many consequent items of sorted result list should be taken).
991
+ * @param sorting (optional) Defines sorting order of result list e.g.: "Title ASC, LastModified DESC".
992
+ * @param search (optional) Search string for partial match.
993
+ * @param sku (optional) SKU filter.
994
+ * @param tags (optional) List of tags that product should have.
995
+ * @param customFields (optional) Serialized custom fields dictionary filter. For example: {"public":"true","name":"my item"}.
996
+ * @param tenantId (optional) Tenant identifier.
997
+ * @return Success
998
+ */
999
+ getAllProducts(storefrontId, productReference, productSpecificationId, productId, productLinkId, skip, take, sorting, search, sku, tags, customFields, tenantId, cancelToken) {
1000
+ let url_ = this.baseUrl + "/api/storefront/v1/product-references/products?";
1001
+ if (storefrontId === undefined || storefrontId === null)
1002
+ throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
1003
+ else
1004
+ url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
1005
+ if (productReference !== undefined && productReference !== null)
1006
+ url_ += "productReference=" + encodeURIComponent("" + productReference) + "&";
1007
+ if (productSpecificationId !== undefined && productSpecificationId !== null)
1008
+ url_ += "productSpecificationId=" + encodeURIComponent("" + productSpecificationId) + "&";
1009
+ if (productId !== undefined && productId !== null)
1010
+ url_ += "productId=" + encodeURIComponent("" + productId) + "&";
1011
+ if (productLinkId !== undefined && productLinkId !== null)
1012
+ url_ += "productLinkId=" + encodeURIComponent("" + productLinkId) + "&";
1013
+ if (skip !== undefined && skip !== null)
1014
+ url_ += "skip=" + encodeURIComponent("" + skip) + "&";
1015
+ if (take !== undefined && take !== null)
1016
+ url_ += "take=" + encodeURIComponent("" + take) + "&";
1017
+ if (sorting !== undefined && sorting !== null)
1018
+ url_ += "sorting=" + encodeURIComponent("" + sorting) + "&";
1019
+ if (search !== undefined && search !== null)
1020
+ url_ += "search=" + encodeURIComponent("" + search) + "&";
1021
+ if (sku !== undefined && sku !== null)
1022
+ url_ += "sku=" + encodeURIComponent("" + sku) + "&";
1023
+ if (tags !== undefined && tags !== null)
1024
+ tags && tags.forEach(item => { url_ += "tags=" + encodeURIComponent("" + item) + "&"; });
1025
+ if (customFields !== undefined && customFields !== null)
1026
+ url_ += "customFields=" + encodeURIComponent("" + customFields) + "&";
1027
+ if (tenantId !== undefined && tenantId !== null)
1028
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
1029
+ url_ = url_.replace(/[?&]$/, "");
1030
+ let options_ = {
1031
+ method: "GET",
1032
+ url: url_,
1033
+ headers: {
1034
+ "Accept": "application/json"
1035
+ },
1036
+ cancelToken
1037
+ };
1038
+ return this.transformOptions(options_).then(transformedOptions_ => {
1039
+ return this.instance.request(transformedOptions_);
1040
+ }).catch((_error) => {
1041
+ if (isAxiosError(_error) && _error.response) {
1042
+ return _error.response;
1043
+ }
1044
+ else {
1045
+ throw _error;
1046
+ }
1047
+ }).then((_response) => {
1048
+ return this.transformResult(url_, _response, (_response) => this.processGetAllProducts(_response));
1049
+ });
1050
+ }
1051
+ processGetAllProducts(response) {
1052
+ const status = response.status;
1053
+ let _headers = {};
1054
+ if (response.headers && typeof response.headers === "object") {
1055
+ for (let k in response.headers) {
1056
+ if (response.headers.hasOwnProperty(k)) {
1057
+ _headers[k] = response.headers[k];
1058
+ }
1059
+ }
1060
+ }
1061
+ if (status === 200) {
1062
+ const _responseText = response.data;
1063
+ let result200 = null;
1064
+ let resultData200 = _responseText;
1065
+ result200 = JSON.parse(resultData200);
1066
+ return Promise.resolve(result200);
1067
+ }
1068
+ else if (status === 409) {
1069
+ const _responseText = response.data;
1070
+ let result409 = null;
1071
+ let resultData409 = _responseText;
1072
+ result409 = JSON.parse(resultData409);
1073
+ return throwException("Conflict", status, _responseText, _headers, result409);
1074
+ }
1075
+ else if (status === 401) {
1076
+ const _responseText = response.data;
1077
+ return throwException("Unauthorized", status, _responseText, _headers);
1078
+ }
1079
+ else if (status === 403) {
1080
+ const _responseText = response.data;
1081
+ return throwException("Forbidden", status, _responseText, _headers);
1082
+ }
1083
+ else if (status !== 200 && status !== 204) {
1084
+ const _responseText = response.data;
1085
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
1086
+ }
1087
+ return Promise.resolve(null);
1088
+ }
1089
+ /**
1090
+ * Returns a list of product links associated with storefront product references relevant to the specified query parameters.
1091
+ * @param storefrontId Storefront identifier.
1092
+ * @param productReference (optional) Product reference filter.
1093
+ Product reference is an external reference to Customer's Canvas product, e.g online store product identifier.
1094
+ * @param productSpecificationId (optional) Customer's Canvas product specification filter.
1095
+ * @param productId (optional) Customer's Canvas product filter.
1096
+ * @param productLinkId (optional) Customer's Canvas product link filter.
1097
+ * @param skip (optional) Defines page start offset from beginning of sorted result list.
1098
+ * @param take (optional) Defines page length (how many consequent items of sorted result list should be taken).
1099
+ * @param sorting (optional) Defines sorting order of result list e.g.: "Title ASC, LastModified DESC".
1100
+ * @param search (optional) Search string for partial match.
1101
+ * @param sku (optional) SKU filter.
1102
+ * @param tags (optional) List of tags that product should have.
1103
+ * @param customFields (optional) Serialized custom fields dictionary filter. For example: {"public":"true","name":"my item"}.
1104
+ * @param tenantId (optional) Tenant identifier.
1105
+ * @return Success
1106
+ */
1107
+ getAllProductLinks(storefrontId, productReference, productSpecificationId, productId, productLinkId, skip, take, sorting, search, sku, tags, customFields, tenantId, cancelToken) {
1108
+ let url_ = this.baseUrl + "/api/storefront/v1/product-references/product-links?";
1109
+ if (storefrontId === undefined || storefrontId === null)
1110
+ throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
1111
+ else
1112
+ url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
1113
+ if (productReference !== undefined && productReference !== null)
1114
+ url_ += "productReference=" + encodeURIComponent("" + productReference) + "&";
1115
+ if (productSpecificationId !== undefined && productSpecificationId !== null)
1116
+ url_ += "productSpecificationId=" + encodeURIComponent("" + productSpecificationId) + "&";
1117
+ if (productId !== undefined && productId !== null)
1118
+ url_ += "productId=" + encodeURIComponent("" + productId) + "&";
1119
+ if (productLinkId !== undefined && productLinkId !== null)
1120
+ url_ += "productLinkId=" + encodeURIComponent("" + productLinkId) + "&";
1121
+ if (skip !== undefined && skip !== null)
1122
+ url_ += "skip=" + encodeURIComponent("" + skip) + "&";
1123
+ if (take !== undefined && take !== null)
1124
+ url_ += "take=" + encodeURIComponent("" + take) + "&";
1125
+ if (sorting !== undefined && sorting !== null)
1126
+ url_ += "sorting=" + encodeURIComponent("" + sorting) + "&";
1127
+ if (search !== undefined && search !== null)
1128
+ url_ += "search=" + encodeURIComponent("" + search) + "&";
1129
+ if (sku !== undefined && sku !== null)
1130
+ url_ += "sku=" + encodeURIComponent("" + sku) + "&";
1131
+ if (tags !== undefined && tags !== null)
1132
+ tags && tags.forEach(item => { url_ += "tags=" + encodeURIComponent("" + item) + "&"; });
1133
+ if (customFields !== undefined && customFields !== null)
1134
+ url_ += "customFields=" + encodeURIComponent("" + customFields) + "&";
1135
+ if (tenantId !== undefined && tenantId !== null)
1136
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
1137
+ url_ = url_.replace(/[?&]$/, "");
1138
+ let options_ = {
1139
+ method: "GET",
1140
+ url: url_,
1141
+ headers: {
1142
+ "Accept": "application/json"
1143
+ },
1144
+ cancelToken
1145
+ };
1146
+ return this.transformOptions(options_).then(transformedOptions_ => {
1147
+ return this.instance.request(transformedOptions_);
1148
+ }).catch((_error) => {
1149
+ if (isAxiosError(_error) && _error.response) {
1150
+ return _error.response;
1151
+ }
1152
+ else {
1153
+ throw _error;
1154
+ }
1155
+ }).then((_response) => {
1156
+ return this.transformResult(url_, _response, (_response) => this.processGetAllProductLinks(_response));
1157
+ });
1158
+ }
1159
+ processGetAllProductLinks(response) {
1160
+ const status = response.status;
1161
+ let _headers = {};
1162
+ if (response.headers && typeof response.headers === "object") {
1163
+ for (let k in response.headers) {
1164
+ if (response.headers.hasOwnProperty(k)) {
1165
+ _headers[k] = response.headers[k];
1166
+ }
1167
+ }
1168
+ }
1169
+ if (status === 200) {
1170
+ const _responseText = response.data;
1171
+ let result200 = null;
1172
+ let resultData200 = _responseText;
1173
+ result200 = JSON.parse(resultData200);
1174
+ return Promise.resolve(result200);
1175
+ }
1176
+ else if (status === 409) {
1177
+ const _responseText = response.data;
1178
+ let result409 = null;
1179
+ let resultData409 = _responseText;
1180
+ result409 = JSON.parse(resultData409);
1181
+ return throwException("Conflict", status, _responseText, _headers, result409);
1182
+ }
1183
+ else if (status === 401) {
1184
+ const _responseText = response.data;
1185
+ return throwException("Unauthorized", status, _responseText, _headers);
1186
+ }
1187
+ else if (status === 403) {
1188
+ const _responseText = response.data;
1189
+ return throwException("Forbidden", status, _responseText, _headers);
1190
+ }
1191
+ else if (status !== 200 && status !== 204) {
1192
+ const _responseText = response.data;
1193
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
1194
+ }
1195
+ return Promise.resolve(null);
1196
+ }
1197
+ /**
1198
+ * Returns a storefront product reference.
1199
+ * @param reference An external reference to Customer's Canvas product, e.g online store product identifier.
1200
+ * @param storefrontId Storefront identifier.
1201
+ * @param tenantId (optional) Tenant identifier.
1202
+ * @return Success
1203
+ */
1204
+ get(reference, storefrontId, tenantId, cancelToken) {
1205
+ let url_ = this.baseUrl + "/api/storefront/v1/product-references/{reference}?";
1206
+ if (reference === undefined || reference === null)
1207
+ throw new Error("The parameter 'reference' must be defined.");
1208
+ url_ = url_.replace("{reference}", encodeURIComponent("" + reference));
1209
+ if (storefrontId === undefined || storefrontId === null)
1210
+ throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
1211
+ else
1212
+ url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
1213
+ if (tenantId !== undefined && tenantId !== null)
1214
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
1215
+ url_ = url_.replace(/[?&]$/, "");
1216
+ let options_ = {
1217
+ method: "GET",
1218
+ url: url_,
1219
+ headers: {
1220
+ "Accept": "application/json"
1221
+ },
1222
+ cancelToken
1223
+ };
1224
+ return this.transformOptions(options_).then(transformedOptions_ => {
1225
+ return this.instance.request(transformedOptions_);
1226
+ }).catch((_error) => {
1227
+ if (isAxiosError(_error) && _error.response) {
1228
+ return _error.response;
1229
+ }
1230
+ else {
1231
+ throw _error;
1232
+ }
1233
+ }).then((_response) => {
1234
+ return this.transformResult(url_, _response, (_response) => this.processGet(_response));
1235
+ });
1236
+ }
1237
+ processGet(response) {
1238
+ const status = response.status;
1239
+ let _headers = {};
1240
+ if (response.headers && typeof response.headers === "object") {
1241
+ for (let k in response.headers) {
1242
+ if (response.headers.hasOwnProperty(k)) {
1243
+ _headers[k] = response.headers[k];
1244
+ }
1245
+ }
1246
+ }
1247
+ if (status === 200) {
1248
+ const _responseText = response.data;
1249
+ let result200 = null;
1250
+ let resultData200 = _responseText;
1251
+ result200 = JSON.parse(resultData200);
1252
+ return Promise.resolve(result200);
1253
+ }
1254
+ else if (status === 409) {
1255
+ const _responseText = response.data;
1256
+ let result409 = null;
1257
+ let resultData409 = _responseText;
1258
+ result409 = JSON.parse(resultData409);
1259
+ return throwException("Conflict", status, _responseText, _headers, result409);
1260
+ }
1261
+ else if (status === 404) {
1262
+ const _responseText = response.data;
1263
+ let result404 = null;
1264
+ let resultData404 = _responseText;
1265
+ result404 = JSON.parse(resultData404);
1266
+ return throwException("Not Found", status, _responseText, _headers, result404);
1267
+ }
1268
+ else if (status === 401) {
1269
+ const _responseText = response.data;
1270
+ return throwException("Unauthorized", status, _responseText, _headers);
1271
+ }
1272
+ else if (status === 403) {
1273
+ const _responseText = response.data;
1274
+ return throwException("Forbidden", status, _responseText, _headers);
1275
+ }
1276
+ else if (status !== 200 && status !== 204) {
1277
+ const _responseText = response.data;
1278
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
1279
+ }
1280
+ return Promise.resolve(null);
1281
+ }
1282
+ /**
1283
+ * Deletes the storefront product reference.
1284
+ * @param reference Product reference - external reference to Customer's Canvas product specification, e.g online store product identifier.
1285
+ * @param storefrontId Storefront identifier.
1286
+ * @param tenantId (optional) Tenant identifier.
1287
+ * @return Success
1288
+ */
1289
+ delete(reference, storefrontId, tenantId, cancelToken) {
1290
+ let url_ = this.baseUrl + "/api/storefront/v1/product-references/{reference}?";
1291
+ if (reference === undefined || reference === null)
1292
+ throw new Error("The parameter 'reference' must be defined.");
1293
+ url_ = url_.replace("{reference}", encodeURIComponent("" + reference));
1294
+ if (storefrontId === undefined || storefrontId === null)
1295
+ throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
1296
+ else
1297
+ url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
1298
+ if (tenantId !== undefined && tenantId !== null)
1299
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
1300
+ url_ = url_.replace(/[?&]$/, "");
1301
+ let options_ = {
1302
+ method: "DELETE",
1303
+ url: url_,
1304
+ headers: {
1305
+ "Accept": "application/json"
1306
+ },
1307
+ cancelToken
1308
+ };
1309
+ return this.transformOptions(options_).then(transformedOptions_ => {
1310
+ return this.instance.request(transformedOptions_);
1311
+ }).catch((_error) => {
1312
+ if (isAxiosError(_error) && _error.response) {
1313
+ return _error.response;
1314
+ }
1315
+ else {
1316
+ throw _error;
1317
+ }
1318
+ }).then((_response) => {
1319
+ return this.transformResult(url_, _response, (_response) => this.processDelete(_response));
1320
+ });
1321
+ }
1322
+ processDelete(response) {
1323
+ const status = response.status;
1324
+ let _headers = {};
1325
+ if (response.headers && typeof response.headers === "object") {
1326
+ for (let k in response.headers) {
1327
+ if (response.headers.hasOwnProperty(k)) {
1328
+ _headers[k] = response.headers[k];
1329
+ }
1330
+ }
1331
+ }
1332
+ if (status === 200) {
1333
+ const _responseText = response.data;
1334
+ let result200 = null;
1335
+ let resultData200 = _responseText;
1336
+ result200 = JSON.parse(resultData200);
1337
+ return Promise.resolve(result200);
1338
+ }
1339
+ else if (status === 404) {
1340
+ const _responseText = response.data;
1341
+ let result404 = null;
1342
+ let resultData404 = _responseText;
1343
+ result404 = JSON.parse(resultData404);
1344
+ return throwException("Not Found", status, _responseText, _headers, result404);
1345
+ }
1346
+ else if (status === 409) {
1347
+ const _responseText = response.data;
1348
+ let result409 = null;
1349
+ let resultData409 = _responseText;
1350
+ result409 = JSON.parse(resultData409);
1351
+ return throwException("Conflict", status, _responseText, _headers, result409);
1352
+ }
1353
+ else if (status === 401) {
1354
+ const _responseText = response.data;
1355
+ return throwException("Unauthorized", status, _responseText, _headers);
1356
+ }
1357
+ else if (status === 403) {
1358
+ const _responseText = response.data;
1359
+ return throwException("Forbidden", status, _responseText, _headers);
1360
+ }
1361
+ else if (status !== 200 && status !== 204) {
1362
+ const _responseText = response.data;
1363
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
1364
+ }
1365
+ return Promise.resolve(null);
1366
+ }
1367
+ /**
1368
+ * Returns a product specification by the storefront product reference.
1369
+ * @param reference Product reference - external reference to Customer's Canvas product, e.g online store product identifier.
1370
+ * @param storefrontId Storefront identifier.
1371
+ * @param tenantId (optional) Tenant identifier.
1372
+ * @return Success
1373
+ */
1374
+ getProductSpecification(reference, storefrontId, tenantId, cancelToken) {
1375
+ let url_ = this.baseUrl + "/api/storefront/v1/product-references/{reference}/product-specification?";
1376
+ if (reference === undefined || reference === null)
1377
+ throw new Error("The parameter 'reference' must be defined.");
1378
+ url_ = url_.replace("{reference}", encodeURIComponent("" + reference));
1379
+ if (storefrontId === undefined || storefrontId === null)
1380
+ throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
1381
+ else
1382
+ url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
1383
+ if (tenantId !== undefined && tenantId !== null)
1384
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
1385
+ url_ = url_.replace(/[?&]$/, "");
1386
+ let options_ = {
1387
+ method: "GET",
1388
+ url: url_,
1389
+ headers: {
1390
+ "Accept": "application/json"
1391
+ },
1392
+ cancelToken
1393
+ };
1394
+ return this.transformOptions(options_).then(transformedOptions_ => {
1395
+ return this.instance.request(transformedOptions_);
1396
+ }).catch((_error) => {
1397
+ if (isAxiosError(_error) && _error.response) {
1398
+ return _error.response;
1399
+ }
1400
+ else {
1401
+ throw _error;
1402
+ }
1403
+ }).then((_response) => {
1404
+ return this.transformResult(url_, _response, (_response) => this.processGetProductSpecification(_response));
1405
+ });
1406
+ }
1407
+ processGetProductSpecification(response) {
1408
+ const status = response.status;
1409
+ let _headers = {};
1410
+ if (response.headers && typeof response.headers === "object") {
1411
+ for (let k in response.headers) {
1412
+ if (response.headers.hasOwnProperty(k)) {
1413
+ _headers[k] = response.headers[k];
1414
+ }
1415
+ }
1416
+ }
1417
+ if (status === 200) {
1418
+ const _responseText = response.data;
1419
+ let result200 = null;
1420
+ let resultData200 = _responseText;
1421
+ result200 = JSON.parse(resultData200);
1422
+ return Promise.resolve(result200);
1423
+ }
1424
+ else if (status === 404) {
1425
+ const _responseText = response.data;
1426
+ let result404 = null;
1427
+ let resultData404 = _responseText;
1428
+ result404 = JSON.parse(resultData404);
1429
+ return throwException("Not Found", status, _responseText, _headers, result404);
1430
+ }
1431
+ else if (status === 409) {
1432
+ const _responseText = response.data;
1433
+ let result409 = null;
1434
+ let resultData409 = _responseText;
1435
+ result409 = JSON.parse(resultData409);
1436
+ return throwException("Conflict", status, _responseText, _headers, result409);
1437
+ }
1438
+ else if (status === 401) {
1439
+ const _responseText = response.data;
1440
+ return throwException("Unauthorized", status, _responseText, _headers);
1441
+ }
1442
+ else if (status === 403) {
1443
+ const _responseText = response.data;
1444
+ return throwException("Forbidden", status, _responseText, _headers);
1445
+ }
1446
+ else if (status !== 200 && status !== 204) {
1447
+ const _responseText = response.data;
1448
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
1449
+ }
1450
+ return Promise.resolve(null);
1451
+ }
1452
+ /**
1453
+ * Returns a product by storefront product reference.
1454
+ * @param reference An external reference to Customer's Canvas product, e.g online store product identifier.
1455
+ * @param storefrontId Storefront identifier.
1456
+ * @param tenantId (optional) Tenant identifier.
1457
+ * @return Success
1458
+ */
1459
+ getProduct(reference, storefrontId, tenantId, cancelToken) {
1460
+ let url_ = this.baseUrl + "/api/storefront/v1/product-references/{reference}/product?";
1461
+ if (reference === undefined || reference === null)
1462
+ throw new Error("The parameter 'reference' must be defined.");
1463
+ url_ = url_.replace("{reference}", encodeURIComponent("" + reference));
1464
+ if (storefrontId === undefined || storefrontId === null)
1465
+ throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
1466
+ else
1467
+ url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
1468
+ if (tenantId !== undefined && tenantId !== null)
1469
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
1470
+ url_ = url_.replace(/[?&]$/, "");
1471
+ let options_ = {
1472
+ method: "GET",
1473
+ url: url_,
1474
+ headers: {
1475
+ "Accept": "application/json"
1476
+ },
1477
+ cancelToken
1478
+ };
1479
+ return this.transformOptions(options_).then(transformedOptions_ => {
1480
+ return this.instance.request(transformedOptions_);
1481
+ }).catch((_error) => {
1482
+ if (isAxiosError(_error) && _error.response) {
1483
+ return _error.response;
1484
+ }
1485
+ else {
1486
+ throw _error;
1487
+ }
1488
+ }).then((_response) => {
1489
+ return this.transformResult(url_, _response, (_response) => this.processGetProduct(_response));
1490
+ });
1491
+ }
1492
+ processGetProduct(response) {
1493
+ const status = response.status;
1494
+ let _headers = {};
1495
+ if (response.headers && typeof response.headers === "object") {
1496
+ for (let k in response.headers) {
1497
+ if (response.headers.hasOwnProperty(k)) {
1498
+ _headers[k] = response.headers[k];
1499
+ }
1500
+ }
1501
+ }
1502
+ if (status === 200) {
1503
+ const _responseText = response.data;
1504
+ let result200 = null;
1505
+ let resultData200 = _responseText;
1506
+ result200 = JSON.parse(resultData200);
1507
+ return Promise.resolve(result200);
1508
+ }
1509
+ else if (status === 404) {
1510
+ const _responseText = response.data;
1511
+ let result404 = null;
1512
+ let resultData404 = _responseText;
1513
+ result404 = JSON.parse(resultData404);
1514
+ return throwException("Not Found", status, _responseText, _headers, result404);
1515
+ }
1516
+ else if (status === 409) {
1517
+ const _responseText = response.data;
1518
+ let result409 = null;
1519
+ let resultData409 = _responseText;
1520
+ result409 = JSON.parse(resultData409);
1521
+ return throwException("Conflict", status, _responseText, _headers, result409);
1522
+ }
1523
+ else if (status === 401) {
1524
+ const _responseText = response.data;
1525
+ return throwException("Unauthorized", status, _responseText, _headers);
1526
+ }
1527
+ else if (status === 403) {
1528
+ const _responseText = response.data;
1529
+ return throwException("Forbidden", status, _responseText, _headers);
1530
+ }
1531
+ else if (status !== 200 && status !== 204) {
1532
+ const _responseText = response.data;
1533
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
1534
+ }
1535
+ return Promise.resolve(null);
1536
+ }
1537
+ /**
1538
+ * Returns a product summary by storefront product reference.
1539
+ * @param reference An external reference to Customer's Canvas product, e.g online store product identifier.
1540
+ * @param storefrontId Storefront identifier.
1541
+ * @param productVariantId (optional) Product variant identifier.
1542
+ * @param sku (optional) Product variant SKU.
1543
+ * @param tenantId (optional) Tenant identifier.
1544
+ * @return Success
1545
+ */
1546
+ getProductSummary(reference, storefrontId, productVariantId, sku, tenantId, cancelToken) {
1547
+ let url_ = this.baseUrl + "/api/storefront/v1/product-references/{reference}/product-summary?";
1548
+ if (reference === undefined || reference === null)
1549
+ throw new Error("The parameter 'reference' must be defined.");
1550
+ url_ = url_.replace("{reference}", encodeURIComponent("" + reference));
1551
+ if (storefrontId === undefined || storefrontId === null)
1552
+ throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
1553
+ else
1554
+ url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
1555
+ if (productVariantId !== undefined && productVariantId !== null)
1556
+ url_ += "productVariantId=" + encodeURIComponent("" + productVariantId) + "&";
1557
+ if (sku !== undefined && sku !== null)
1558
+ url_ += "sku=" + encodeURIComponent("" + sku) + "&";
1559
+ if (tenantId !== undefined && tenantId !== null)
1560
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
1561
+ url_ = url_.replace(/[?&]$/, "");
1562
+ let options_ = {
1563
+ method: "GET",
1564
+ url: url_,
1565
+ headers: {
1566
+ "Accept": "application/json"
1567
+ },
1568
+ cancelToken
1569
+ };
1570
+ return this.transformOptions(options_).then(transformedOptions_ => {
1571
+ return this.instance.request(transformedOptions_);
1572
+ }).catch((_error) => {
1573
+ if (isAxiosError(_error) && _error.response) {
1574
+ return _error.response;
1575
+ }
1576
+ else {
1577
+ throw _error;
1578
+ }
1579
+ }).then((_response) => {
1580
+ return this.transformResult(url_, _response, (_response) => this.processGetProductSummary(_response));
1581
+ });
1582
+ }
1583
+ processGetProductSummary(response) {
1584
+ const status = response.status;
1585
+ let _headers = {};
1586
+ if (response.headers && typeof response.headers === "object") {
1587
+ for (let k in response.headers) {
1588
+ if (response.headers.hasOwnProperty(k)) {
1589
+ _headers[k] = response.headers[k];
1590
+ }
1591
+ }
1592
+ }
1593
+ if (status === 200) {
1594
+ const _responseText = response.data;
1595
+ let result200 = null;
1596
+ let resultData200 = _responseText;
1597
+ result200 = JSON.parse(resultData200);
1598
+ return Promise.resolve(result200);
1599
+ }
1600
+ else if (status === 404) {
1601
+ const _responseText = response.data;
1602
+ let result404 = null;
1603
+ let resultData404 = _responseText;
1604
+ result404 = JSON.parse(resultData404);
1605
+ return throwException("Not Found", status, _responseText, _headers, result404);
1606
+ }
1607
+ else if (status === 409) {
1608
+ const _responseText = response.data;
1609
+ let result409 = null;
1610
+ let resultData409 = _responseText;
1611
+ result409 = JSON.parse(resultData409);
1612
+ return throwException("Conflict", status, _responseText, _headers, result409);
1613
+ }
1614
+ else if (status === 401) {
1615
+ const _responseText = response.data;
1616
+ return throwException("Unauthorized", status, _responseText, _headers);
1617
+ }
1618
+ else if (status === 403) {
1619
+ const _responseText = response.data;
1620
+ return throwException("Forbidden", status, _responseText, _headers);
1621
+ }
1622
+ else if (status !== 200 && status !== 204) {
1623
+ const _responseText = response.data;
1624
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
1625
+ }
1626
+ return Promise.resolve(null);
1627
+ }
1628
+ /**
1629
+ * Returns a product link by storefront product reference.
1630
+ * @param reference An external reference to Customer's Canvas product, e.g online store product identifier.
1631
+ * @param storefrontId Storefront identifier.
1632
+ * @param tenantId (optional) Tenant identifier.
1633
+ * @return Success
1634
+ */
1635
+ getProductLink(reference, storefrontId, tenantId, cancelToken) {
1636
+ let url_ = this.baseUrl + "/api/storefront/v1/product-references/{reference}/product-link?";
1637
+ if (reference === undefined || reference === null)
1638
+ throw new Error("The parameter 'reference' must be defined.");
1639
+ url_ = url_.replace("{reference}", encodeURIComponent("" + reference));
1640
+ if (storefrontId === undefined || storefrontId === null)
1641
+ throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
1642
+ else
1643
+ url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
1644
+ if (tenantId !== undefined && tenantId !== null)
1645
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
1646
+ url_ = url_.replace(/[?&]$/, "");
1647
+ let options_ = {
1648
+ method: "GET",
1649
+ url: url_,
1650
+ headers: {
1651
+ "Accept": "application/json"
1652
+ },
1653
+ cancelToken
1654
+ };
1655
+ return this.transformOptions(options_).then(transformedOptions_ => {
1656
+ return this.instance.request(transformedOptions_);
1657
+ }).catch((_error) => {
1658
+ if (isAxiosError(_error) && _error.response) {
1659
+ return _error.response;
1660
+ }
1661
+ else {
1662
+ throw _error;
1663
+ }
1664
+ }).then((_response) => {
1665
+ return this.transformResult(url_, _response, (_response) => this.processGetProductLink(_response));
1666
+ });
1667
+ }
1668
+ processGetProductLink(response) {
1669
+ const status = response.status;
1670
+ let _headers = {};
1671
+ if (response.headers && typeof response.headers === "object") {
1672
+ for (let k in response.headers) {
1673
+ if (response.headers.hasOwnProperty(k)) {
1674
+ _headers[k] = response.headers[k];
1675
+ }
1676
+ }
1677
+ }
1678
+ if (status === 200) {
1679
+ const _responseText = response.data;
1680
+ let result200 = null;
1681
+ let resultData200 = _responseText;
1682
+ result200 = JSON.parse(resultData200);
1683
+ return Promise.resolve(result200);
1684
+ }
1685
+ else if (status === 404) {
1686
+ const _responseText = response.data;
1687
+ let result404 = null;
1688
+ let resultData404 = _responseText;
1689
+ result404 = JSON.parse(resultData404);
1690
+ return throwException("Not Found", status, _responseText, _headers, result404);
1691
+ }
1692
+ else if (status === 409) {
1693
+ const _responseText = response.data;
1694
+ let result409 = null;
1695
+ let resultData409 = _responseText;
1696
+ result409 = JSON.parse(resultData409);
1697
+ return throwException("Conflict", status, _responseText, _headers, result409);
1698
+ }
1699
+ else if (status === 401) {
1700
+ const _responseText = response.data;
1701
+ return throwException("Unauthorized", status, _responseText, _headers);
1702
+ }
1703
+ else if (status === 403) {
1704
+ const _responseText = response.data;
1705
+ return throwException("Forbidden", status, _responseText, _headers);
1706
+ }
1707
+ else if (status !== 200 && status !== 204) {
1708
+ const _responseText = response.data;
1709
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
1710
+ }
1711
+ return Promise.resolve(null);
1712
+ }
1713
+ /**
1714
+ * Returns a product cost details from ecommerce system.
1715
+ * @param reference An external reference to Customer's Canvas product, e.g online store product identifier.
1716
+ * @param sku Product SKU.
1717
+ * @param storefrontId Storefront identifier.
1718
+ * @param storefrontUserId (optional) Storefront user identifier.
1719
+ * @param currencyCode (optional) Product cost currency code.
1720
+ * @param quantity (optional) Product quantity.
1721
+ * @param tenantId (optional) Tenant identifier.
1722
+ * @return Success
1723
+ */
1724
+ getProductCostDetails(reference, sku, storefrontId, storefrontUserId, currencyCode, quantity, tenantId, cancelToken) {
1725
+ let url_ = this.baseUrl + "/api/storefront/v1/product-references/{reference}/product-cost-details?";
1726
+ if (reference === undefined || reference === null)
1727
+ throw new Error("The parameter 'reference' must be defined.");
1728
+ url_ = url_.replace("{reference}", encodeURIComponent("" + reference));
1729
+ if (sku === undefined || sku === null)
1730
+ throw new Error("The parameter 'sku' must be defined and cannot be null.");
1731
+ else
1732
+ url_ += "sku=" + encodeURIComponent("" + sku) + "&";
1733
+ if (storefrontId === undefined || storefrontId === null)
1734
+ throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
1735
+ else
1736
+ url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
1737
+ if (storefrontUserId !== undefined && storefrontUserId !== null)
1738
+ url_ += "storefrontUserId=" + encodeURIComponent("" + storefrontUserId) + "&";
1739
+ if (currencyCode !== undefined && currencyCode !== null)
1740
+ url_ += "currencyCode=" + encodeURIComponent("" + currencyCode) + "&";
1741
+ if (quantity === null)
1742
+ throw new Error("The parameter 'quantity' cannot be null.");
1743
+ else if (quantity !== undefined)
1744
+ url_ += "quantity=" + encodeURIComponent("" + quantity) + "&";
1745
+ if (tenantId !== undefined && tenantId !== null)
1746
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
1747
+ url_ = url_.replace(/[?&]$/, "");
1748
+ let options_ = {
1749
+ method: "GET",
1750
+ url: url_,
1751
+ headers: {
1752
+ "Accept": "application/json"
1753
+ },
1754
+ cancelToken
1755
+ };
1756
+ return this.transformOptions(options_).then(transformedOptions_ => {
1757
+ return this.instance.request(transformedOptions_);
1758
+ }).catch((_error) => {
1759
+ if (isAxiosError(_error) && _error.response) {
1760
+ return _error.response;
1761
+ }
1762
+ else {
1763
+ throw _error;
1764
+ }
1765
+ }).then((_response) => {
1766
+ return this.transformResult(url_, _response, (_response) => this.processGetProductCostDetails(_response));
1767
+ });
1768
+ }
1769
+ processGetProductCostDetails(response) {
1770
+ const status = response.status;
1771
+ let _headers = {};
1772
+ if (response.headers && typeof response.headers === "object") {
1773
+ for (let k in response.headers) {
1774
+ if (response.headers.hasOwnProperty(k)) {
1775
+ _headers[k] = response.headers[k];
1776
+ }
1777
+ }
1778
+ }
1779
+ if (status === 200) {
1780
+ const _responseText = response.data;
1781
+ let result200 = null;
1782
+ let resultData200 = _responseText;
1783
+ result200 = JSON.parse(resultData200);
1784
+ return Promise.resolve(result200);
1785
+ }
1786
+ else if (status === 404) {
1787
+ const _responseText = response.data;
1788
+ let result404 = null;
1789
+ let resultData404 = _responseText;
1790
+ result404 = JSON.parse(resultData404);
1791
+ return throwException("Not Found", status, _responseText, _headers, result404);
1792
+ }
1793
+ else if (status === 409) {
1794
+ const _responseText = response.data;
1795
+ let result409 = null;
1796
+ let resultData409 = _responseText;
1797
+ result409 = JSON.parse(resultData409);
1798
+ return throwException("Conflict", status, _responseText, _headers, result409);
1799
+ }
1800
+ else if (status === 401) {
1801
+ const _responseText = response.data;
1802
+ return throwException("Unauthorized", status, _responseText, _headers);
1803
+ }
1804
+ else if (status === 403) {
1805
+ const _responseText = response.data;
1806
+ return throwException("Forbidden", status, _responseText, _headers);
1807
+ }
1808
+ else if (status !== 200 && status !== 204) {
1809
+ const _responseText = response.data;
1810
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
1811
+ }
1812
+ return Promise.resolve(null);
1813
+ }
1814
+ /**
1815
+ * Returns a product personalization workflow.
1816
+ * @param reference An external reference to Customer's Canvas product, e.g online store product identifier.
1817
+ * @param storefrontId (optional) Storefront identifier.
1818
+ * @param tenantId (optional) Tenant identifier.
1819
+ * @return Success
1820
+ */
1821
+ getPersonalizationWorkflow(reference, storefrontId, tenantId, cancelToken) {
1822
+ let url_ = this.baseUrl + "/api/storefront/v1/product-references/{reference}/personalization-workflow?";
1823
+ if (reference === undefined || reference === null)
1824
+ throw new Error("The parameter 'reference' must be defined.");
1825
+ url_ = url_.replace("{reference}", encodeURIComponent("" + reference));
1826
+ if (storefrontId === null)
1827
+ throw new Error("The parameter 'storefrontId' cannot be null.");
1828
+ else if (storefrontId !== undefined)
1829
+ url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
1830
+ if (tenantId !== undefined && tenantId !== null)
1831
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
1832
+ url_ = url_.replace(/[?&]$/, "");
1833
+ let options_ = {
1834
+ method: "GET",
1835
+ url: url_,
1836
+ headers: {
1837
+ "Accept": "application/json"
1838
+ },
1839
+ cancelToken
1840
+ };
1841
+ return this.transformOptions(options_).then(transformedOptions_ => {
1842
+ return this.instance.request(transformedOptions_);
1843
+ }).catch((_error) => {
1844
+ if (isAxiosError(_error) && _error.response) {
1845
+ return _error.response;
1846
+ }
1847
+ else {
1848
+ throw _error;
1849
+ }
1850
+ }).then((_response) => {
1851
+ return this.transformResult(url_, _response, (_response) => this.processGetPersonalizationWorkflow(_response));
1852
+ });
1853
+ }
1854
+ processGetPersonalizationWorkflow(response) {
1855
+ const status = response.status;
1856
+ let _headers = {};
1857
+ if (response.headers && typeof response.headers === "object") {
1858
+ for (let k in response.headers) {
1859
+ if (response.headers.hasOwnProperty(k)) {
1860
+ _headers[k] = response.headers[k];
1861
+ }
1862
+ }
1863
+ }
1864
+ if (status === 200) {
1865
+ const _responseText = response.data;
1866
+ let result200 = null;
1867
+ let resultData200 = _responseText;
1868
+ result200 = JSON.parse(resultData200);
1869
+ return Promise.resolve(result200);
1870
+ }
1871
+ else if (status === 404) {
1872
+ const _responseText = response.data;
1873
+ let result404 = null;
1874
+ let resultData404 = _responseText;
1875
+ result404 = JSON.parse(resultData404);
1876
+ return throwException("Not Found", status, _responseText, _headers, result404);
1877
+ }
1878
+ else if (status === 409) {
1879
+ const _responseText = response.data;
1880
+ let result409 = null;
1881
+ let resultData409 = _responseText;
1882
+ result409 = JSON.parse(resultData409);
1883
+ return throwException("Conflict", status, _responseText, _headers, result409);
1884
+ }
1885
+ else if (status === 401) {
1886
+ const _responseText = response.data;
1887
+ return throwException("Unauthorized", status, _responseText, _headers);
1888
+ }
1889
+ else if (status === 403) {
1890
+ const _responseText = response.data;
1891
+ return throwException("Forbidden", status, _responseText, _headers);
1892
+ }
1893
+ else if (status !== 200 && status !== 204) {
1894
+ const _responseText = response.data;
1895
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
1896
+ }
1897
+ return Promise.resolve(null);
1898
+ }
1899
+ /**
1900
+ * Returns a product personalization workflow configuration by storefront product reference.
1901
+ * @param reference An external reference to Customer's Canvas product, e.g online store product identifier.
1902
+ * @param storefrontId Storefront identifier.
1903
+ * @param tenantId (optional) Tenant identifier.
1904
+ * @return Success
1905
+ * @deprecated
1906
+ */
1907
+ getProductConfig(reference, storefrontId, tenantId, cancelToken) {
1908
+ let url_ = this.baseUrl + "/api/storefront/v1/product-references/{reference}/product-config?";
1909
+ if (reference === undefined || reference === null)
1910
+ throw new Error("The parameter 'reference' must be defined.");
1911
+ url_ = url_.replace("{reference}", encodeURIComponent("" + reference));
1912
+ if (storefrontId === undefined || storefrontId === null)
1913
+ throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
1914
+ else
1915
+ url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
1916
+ if (tenantId !== undefined && tenantId !== null)
1917
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
1918
+ url_ = url_.replace(/[?&]$/, "");
1919
+ let options_ = {
1920
+ method: "GET",
1921
+ url: url_,
1922
+ headers: {
1923
+ "Accept": "text/plain"
1924
+ },
1925
+ cancelToken
1926
+ };
1927
+ return this.transformOptions(options_).then(transformedOptions_ => {
1928
+ return this.instance.request(transformedOptions_);
1929
+ }).catch((_error) => {
1930
+ if (isAxiosError(_error) && _error.response) {
1931
+ return _error.response;
1932
+ }
1933
+ else {
1934
+ throw _error;
1935
+ }
1936
+ }).then((_response) => {
1937
+ return this.transformResult(url_, _response, (_response) => this.processGetProductConfig(_response));
1938
+ });
1939
+ }
1940
+ processGetProductConfig(response) {
1941
+ const status = response.status;
1942
+ let _headers = {};
1943
+ if (response.headers && typeof response.headers === "object") {
1944
+ for (let k in response.headers) {
1945
+ if (response.headers.hasOwnProperty(k)) {
1946
+ _headers[k] = response.headers[k];
1947
+ }
1948
+ }
1949
+ }
1950
+ if (status === 200) {
1951
+ const _responseText = response.data;
1952
+ let result200 = null;
1953
+ let resultData200 = _responseText;
1954
+ result200 = resultData200;
1955
+ return Promise.resolve(result200);
1956
+ }
1957
+ else if (status === 404) {
1958
+ const _responseText = response.data;
1959
+ let result404 = null;
1960
+ let resultData404 = _responseText;
1961
+ result404 = JSON.parse(resultData404);
1962
+ return throwException("Not Found", status, _responseText, _headers, result404);
1963
+ }
1964
+ else if (status === 409) {
1965
+ const _responseText = response.data;
1966
+ let result409 = null;
1967
+ let resultData409 = _responseText;
1968
+ result409 = JSON.parse(resultData409);
1969
+ return throwException("Conflict", status, _responseText, _headers, result409);
1970
+ }
1971
+ else if (status === 401) {
1972
+ const _responseText = response.data;
1973
+ return throwException("Unauthorized", status, _responseText, _headers);
1974
+ }
1975
+ else if (status === 403) {
1976
+ const _responseText = response.data;
1977
+ return throwException("Forbidden", status, _responseText, _headers);
1978
+ }
1979
+ else if (status !== 200 && status !== 204) {
1980
+ const _responseText = response.data;
1981
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
1982
+ }
1983
+ return Promise.resolve(null);
1984
+ }
1985
+ }
1986
+ exports.ProductReferencesApiClient = ProductReferencesApiClient;
1987
+ class ProductsApiClient extends ApiClientBase {
1988
+ instance;
1989
+ baseUrl;
1990
+ jsonParseReviver = undefined;
1991
+ constructor(configuration, baseUrl, instance) {
1992
+ super(configuration);
1993
+ this.instance = instance ? instance : axios_1.create();
1994
+ this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : this.getBaseUrl("");
1995
+ }
1996
+ /**
1997
+ * Returns all products, relevant to the specified query parameters.
1998
+ * @param skip (optional) Defines page start offset from beginning of sorted result list.
1999
+ * @param take (optional) Defines page length (how many consequent items of sorted result list should be taken).
2000
+ * @param sorting (optional) Defines sorting order of result list e.g.: "Title ASC, LastModified DESC".
2001
+ * @param search (optional) Search string for partial match.
2002
+ * @param sku (optional) SKU of linked ecommerce product.
2003
+ * @param tags (optional) List of tags that product should have.
2004
+ * @param customFields (optional) Serialized custom fields dictionary filter. For example: {"public":"true","name":"my item"}.
2005
+ * @param tenantId (optional) Tenant identifier.
2006
+ * @return Success
2007
+ */
2008
+ getAllProducts(skip, take, sorting, search, sku, tags, customFields, tenantId, cancelToken) {
2009
+ let url_ = this.baseUrl + "/api/storefront/v1/products?";
2010
+ if (skip !== undefined && skip !== null)
2011
+ url_ += "skip=" + encodeURIComponent("" + skip) + "&";
2012
+ if (take !== undefined && take !== null)
2013
+ url_ += "take=" + encodeURIComponent("" + take) + "&";
2014
+ if (sorting !== undefined && sorting !== null)
2015
+ url_ += "sorting=" + encodeURIComponent("" + sorting) + "&";
2016
+ if (search !== undefined && search !== null)
2017
+ url_ += "search=" + encodeURIComponent("" + search) + "&";
2018
+ if (sku !== undefined && sku !== null)
2019
+ url_ += "sku=" + encodeURIComponent("" + sku) + "&";
2020
+ if (tags !== undefined && tags !== null)
2021
+ tags && tags.forEach(item => { url_ += "tags=" + encodeURIComponent("" + item) + "&"; });
2022
+ if (customFields !== undefined && customFields !== null)
2023
+ url_ += "customFields=" + encodeURIComponent("" + customFields) + "&";
2024
+ if (tenantId !== undefined && tenantId !== null)
2025
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
2026
+ url_ = url_.replace(/[?&]$/, "");
2027
+ let options_ = {
2028
+ method: "GET",
2029
+ url: url_,
2030
+ headers: {
2031
+ "Accept": "application/json"
2032
+ },
2033
+ cancelToken
2034
+ };
2035
+ return this.transformOptions(options_).then(transformedOptions_ => {
2036
+ return this.instance.request(transformedOptions_);
2037
+ }).catch((_error) => {
2038
+ if (isAxiosError(_error) && _error.response) {
2039
+ return _error.response;
2040
+ }
2041
+ else {
2042
+ throw _error;
2043
+ }
2044
+ }).then((_response) => {
2045
+ return this.transformResult(url_, _response, (_response) => this.processGetAllProducts(_response));
2046
+ });
2047
+ }
2048
+ processGetAllProducts(response) {
2049
+ const status = response.status;
2050
+ let _headers = {};
2051
+ if (response.headers && typeof response.headers === "object") {
2052
+ for (let k in response.headers) {
2053
+ if (response.headers.hasOwnProperty(k)) {
2054
+ _headers[k] = response.headers[k];
2055
+ }
2056
+ }
2057
+ }
2058
+ if (status === 200) {
2059
+ const _responseText = response.data;
2060
+ let result200 = null;
2061
+ let resultData200 = _responseText;
2062
+ result200 = JSON.parse(resultData200);
2063
+ return Promise.resolve(result200);
2064
+ }
2065
+ else if (status === 401) {
2066
+ const _responseText = response.data;
2067
+ return throwException("Unauthorized", status, _responseText, _headers);
2068
+ }
2069
+ else if (status === 403) {
2070
+ const _responseText = response.data;
2071
+ return throwException("Forbidden", status, _responseText, _headers);
2072
+ }
2073
+ else if (status !== 200 && status !== 204) {
2074
+ const _responseText = response.data;
2075
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
2076
+ }
2077
+ return Promise.resolve(null);
2078
+ }
2079
+ /**
2080
+ * Returns a product by identifier.
2081
+ * @param id Product identifier.
2082
+ * @param productVersionId (optional) Product version identifier.
2083
+ * @param tenantId (optional) Tenant identifier.
2084
+ * @return Success
2085
+ */
2086
+ getProduct(id, productVersionId, tenantId, cancelToken) {
2087
+ let url_ = this.baseUrl + "/api/storefront/v1/products/{id}?";
2088
+ if (id === undefined || id === null)
2089
+ throw new Error("The parameter 'id' must be defined.");
2090
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
2091
+ if (productVersionId !== undefined && productVersionId !== null)
2092
+ url_ += "productVersionId=" + encodeURIComponent("" + productVersionId) + "&";
2093
+ if (tenantId !== undefined && tenantId !== null)
2094
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
2095
+ url_ = url_.replace(/[?&]$/, "");
2096
+ let options_ = {
2097
+ method: "GET",
2098
+ url: url_,
2099
+ headers: {
2100
+ "Accept": "application/json"
2101
+ },
2102
+ cancelToken
2103
+ };
2104
+ return this.transformOptions(options_).then(transformedOptions_ => {
2105
+ return this.instance.request(transformedOptions_);
2106
+ }).catch((_error) => {
2107
+ if (isAxiosError(_error) && _error.response) {
2108
+ return _error.response;
2109
+ }
2110
+ else {
2111
+ throw _error;
2112
+ }
2113
+ }).then((_response) => {
2114
+ return this.transformResult(url_, _response, (_response) => this.processGetProduct(_response));
2115
+ });
2116
+ }
2117
+ processGetProduct(response) {
2118
+ const status = response.status;
2119
+ let _headers = {};
2120
+ if (response.headers && typeof response.headers === "object") {
2121
+ for (let k in response.headers) {
2122
+ if (response.headers.hasOwnProperty(k)) {
2123
+ _headers[k] = response.headers[k];
2124
+ }
2125
+ }
2126
+ }
2127
+ if (status === 200) {
2128
+ const _responseText = response.data;
2129
+ let result200 = null;
2130
+ let resultData200 = _responseText;
2131
+ result200 = JSON.parse(resultData200);
2132
+ return Promise.resolve(result200);
2133
+ }
2134
+ else if (status === 404) {
2135
+ const _responseText = response.data;
2136
+ let result404 = null;
2137
+ let resultData404 = _responseText;
2138
+ result404 = JSON.parse(resultData404);
2139
+ return throwException("Not Found", status, _responseText, _headers, result404);
2140
+ }
2141
+ else if (status === 409) {
2142
+ const _responseText = response.data;
2143
+ let result409 = null;
2144
+ let resultData409 = _responseText;
2145
+ result409 = JSON.parse(resultData409);
2146
+ return throwException("Conflict", status, _responseText, _headers, result409);
2147
+ }
2148
+ else if (status === 401) {
2149
+ const _responseText = response.data;
2150
+ return throwException("Unauthorized", status, _responseText, _headers);
2151
+ }
2152
+ else if (status === 403) {
2153
+ const _responseText = response.data;
2154
+ return throwException("Forbidden", status, _responseText, _headers);
2155
+ }
2156
+ else if (status !== 200 && status !== 204) {
2157
+ const _responseText = response.data;
2158
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
2159
+ }
2160
+ return Promise.resolve(null);
2161
+ }
2162
+ /**
2163
+ * Returns a product summary by product identifier.
2164
+ * @param id Product identifier.
2165
+ * @param productVersionId (optional) Product version identifier.
2166
+ * @param productLinkId (optional) Product link identifier.
2167
+ * @param productVariantId (optional) Product variant identifier.
2168
+ * @param sku (optional) Product variant SKU.
2169
+ * @param tenantId (optional) Tenant identifier.
2170
+ * @return Success
2171
+ */
2172
+ getProductSummary(id, productVersionId, productLinkId, productVariantId, sku, tenantId, cancelToken) {
2173
+ let url_ = this.baseUrl + "/api/storefront/v1/products/{id}/summary?";
2174
+ if (id === undefined || id === null)
2175
+ throw new Error("The parameter 'id' must be defined.");
2176
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
2177
+ if (productVersionId !== undefined && productVersionId !== null)
2178
+ url_ += "productVersionId=" + encodeURIComponent("" + productVersionId) + "&";
2179
+ if (productLinkId !== undefined && productLinkId !== null)
2180
+ url_ += "productLinkId=" + encodeURIComponent("" + productLinkId) + "&";
2181
+ if (productVariantId !== undefined && productVariantId !== null)
2182
+ url_ += "productVariantId=" + encodeURIComponent("" + productVariantId) + "&";
2183
+ if (sku !== undefined && sku !== null)
2184
+ url_ += "sku=" + encodeURIComponent("" + sku) + "&";
2185
+ if (tenantId !== undefined && tenantId !== null)
2186
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
2187
+ url_ = url_.replace(/[?&]$/, "");
2188
+ let options_ = {
2189
+ method: "GET",
2190
+ url: url_,
2191
+ headers: {
2192
+ "Accept": "application/json"
2193
+ },
2194
+ cancelToken
2195
+ };
2196
+ return this.transformOptions(options_).then(transformedOptions_ => {
2197
+ return this.instance.request(transformedOptions_);
2198
+ }).catch((_error) => {
2199
+ if (isAxiosError(_error) && _error.response) {
2200
+ return _error.response;
2201
+ }
2202
+ else {
2203
+ throw _error;
2204
+ }
2205
+ }).then((_response) => {
2206
+ return this.transformResult(url_, _response, (_response) => this.processGetProductSummary(_response));
2207
+ });
2208
+ }
2209
+ processGetProductSummary(response) {
2210
+ const status = response.status;
2211
+ let _headers = {};
2212
+ if (response.headers && typeof response.headers === "object") {
2213
+ for (let k in response.headers) {
2214
+ if (response.headers.hasOwnProperty(k)) {
2215
+ _headers[k] = response.headers[k];
2216
+ }
2217
+ }
2218
+ }
2219
+ if (status === 200) {
2220
+ const _responseText = response.data;
2221
+ let result200 = null;
2222
+ let resultData200 = _responseText;
2223
+ result200 = JSON.parse(resultData200);
2224
+ return Promise.resolve(result200);
2225
+ }
2226
+ else if (status === 404) {
2227
+ const _responseText = response.data;
2228
+ let result404 = null;
2229
+ let resultData404 = _responseText;
2230
+ result404 = JSON.parse(resultData404);
2231
+ return throwException("Not Found", status, _responseText, _headers, result404);
2232
+ }
2233
+ else if (status === 409) {
2234
+ const _responseText = response.data;
2235
+ let result409 = null;
2236
+ let resultData409 = _responseText;
2237
+ result409 = JSON.parse(resultData409);
2238
+ return throwException("Conflict", status, _responseText, _headers, result409);
2239
+ }
2240
+ else if (status === 401) {
2241
+ const _responseText = response.data;
2242
+ return throwException("Unauthorized", status, _responseText, _headers);
2243
+ }
2244
+ else if (status === 403) {
2245
+ const _responseText = response.data;
2246
+ return throwException("Forbidden", status, _responseText, _headers);
2247
+ }
2248
+ else if (status !== 200 && status !== 204) {
2249
+ const _responseText = response.data;
2250
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
2251
+ }
2252
+ return Promise.resolve(null);
2253
+ }
2254
+ /**
2255
+ * Returns a list of product options.
2256
+ * @param id Product identifier.
2257
+ * @param productVersionId (optional) Product version identifier.
2258
+ * @param tenantId (optional) Tenant identifier.
2259
+ * @return Success
2260
+ */
2261
+ getProductOptions(id, productVersionId, tenantId, cancelToken) {
2262
+ let url_ = this.baseUrl + "/api/storefront/v1/products/{id}/options?";
2263
+ if (id === undefined || id === null)
2264
+ throw new Error("The parameter 'id' must be defined.");
2265
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
2266
+ if (productVersionId !== undefined && productVersionId !== null)
2267
+ url_ += "productVersionId=" + encodeURIComponent("" + productVersionId) + "&";
2268
+ if (tenantId !== undefined && tenantId !== null)
2269
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
2270
+ url_ = url_.replace(/[?&]$/, "");
2271
+ let options_ = {
2272
+ method: "GET",
2273
+ url: url_,
2274
+ headers: {
2275
+ "Accept": "application/json"
2276
+ },
2277
+ cancelToken
2278
+ };
2279
+ return this.transformOptions(options_).then(transformedOptions_ => {
2280
+ return this.instance.request(transformedOptions_);
2281
+ }).catch((_error) => {
2282
+ if (isAxiosError(_error) && _error.response) {
2283
+ return _error.response;
2284
+ }
2285
+ else {
2286
+ throw _error;
2287
+ }
2288
+ }).then((_response) => {
2289
+ return this.transformResult(url_, _response, (_response) => this.processGetProductOptions(_response));
2290
+ });
2291
+ }
2292
+ processGetProductOptions(response) {
2293
+ const status = response.status;
2294
+ let _headers = {};
2295
+ if (response.headers && typeof response.headers === "object") {
2296
+ for (let k in response.headers) {
2297
+ if (response.headers.hasOwnProperty(k)) {
2298
+ _headers[k] = response.headers[k];
2299
+ }
2300
+ }
2301
+ }
2302
+ if (status === 200) {
2303
+ const _responseText = response.data;
2304
+ let result200 = null;
2305
+ let resultData200 = _responseText;
2306
+ result200 = JSON.parse(resultData200);
2307
+ return Promise.resolve(result200);
2308
+ }
2309
+ else if (status === 404) {
2310
+ const _responseText = response.data;
2311
+ let result404 = null;
2312
+ let resultData404 = _responseText;
2313
+ result404 = JSON.parse(resultData404);
2314
+ return throwException("Not Found", status, _responseText, _headers, result404);
2315
+ }
2316
+ else if (status === 409) {
2317
+ const _responseText = response.data;
2318
+ let result409 = null;
2319
+ let resultData409 = _responseText;
2320
+ result409 = JSON.parse(resultData409);
2321
+ return throwException("Conflict", status, _responseText, _headers, result409);
2322
+ }
2323
+ else if (status === 401) {
2324
+ const _responseText = response.data;
2325
+ return throwException("Unauthorized", status, _responseText, _headers);
2326
+ }
2327
+ else if (status === 403) {
2328
+ const _responseText = response.data;
2329
+ return throwException("Forbidden", status, _responseText, _headers);
2330
+ }
2331
+ else if (status !== 200 && status !== 204) {
2332
+ const _responseText = response.data;
2333
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
2334
+ }
2335
+ return Promise.resolve(null);
2336
+ }
2337
+ /**
2338
+ * Returns a list of product options for all products.
2339
+ * @param tenantId (optional) Tenant identifier.
2340
+ * @return Success
2341
+ */
2342
+ getAllProductOptions(tenantId, cancelToken) {
2343
+ let url_ = this.baseUrl + "/api/storefront/v1/products/options?";
2344
+ if (tenantId !== undefined && tenantId !== null)
2345
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
2346
+ url_ = url_.replace(/[?&]$/, "");
2347
+ let options_ = {
2348
+ method: "GET",
2349
+ url: url_,
2350
+ headers: {
2351
+ "Accept": "application/json"
2352
+ },
2353
+ cancelToken
2354
+ };
2355
+ return this.transformOptions(options_).then(transformedOptions_ => {
2356
+ return this.instance.request(transformedOptions_);
2357
+ }).catch((_error) => {
2358
+ if (isAxiosError(_error) && _error.response) {
2359
+ return _error.response;
2360
+ }
2361
+ else {
2362
+ throw _error;
2363
+ }
2364
+ }).then((_response) => {
2365
+ return this.transformResult(url_, _response, (_response) => this.processGetAllProductOptions(_response));
2366
+ });
2367
+ }
2368
+ processGetAllProductOptions(response) {
2369
+ const status = response.status;
2370
+ let _headers = {};
2371
+ if (response.headers && typeof response.headers === "object") {
2372
+ for (let k in response.headers) {
2373
+ if (response.headers.hasOwnProperty(k)) {
2374
+ _headers[k] = response.headers[k];
2375
+ }
2376
+ }
2377
+ }
2378
+ if (status === 200) {
2379
+ const _responseText = response.data;
2380
+ let result200 = null;
2381
+ let resultData200 = _responseText;
2382
+ result200 = JSON.parse(resultData200);
2383
+ return Promise.resolve(result200);
2384
+ }
2385
+ else if (status === 401) {
2386
+ const _responseText = response.data;
2387
+ return throwException("Unauthorized", status, _responseText, _headers);
2388
+ }
2389
+ else if (status === 403) {
2390
+ const _responseText = response.data;
2391
+ return throwException("Forbidden", status, _responseText, _headers);
2392
+ }
2393
+ else if (status !== 200 && status !== 204) {
2394
+ const _responseText = response.data;
2395
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
2396
+ }
2397
+ return Promise.resolve(null);
2398
+ }
2399
+ /**
2400
+ * Returns a list of product links.
2401
+ * @param id Product identifier.
2402
+ * @param productVersionId (optional)
2403
+ * @param skip (optional) Defines page start offset from beginning of sorted result list.
2404
+ * @param take (optional) Defines page length (how many consequent items of sorted result list should be taken).
2405
+ * @param sorting (optional) Defines sorting order of result list e.g.: "Title ASC, LastModified DESC".
2406
+ * @param search (optional) Search string for partial match.
2407
+ * @param tenantId (optional) Tenant identifier.
2408
+ * @return Success
2409
+ */
2410
+ getProductLinks(id, productVersionId, skip, take, sorting, search, tenantId, cancelToken) {
2411
+ let url_ = this.baseUrl + "/api/storefront/v1/products/{id}/links?";
2412
+ if (id === undefined || id === null)
2413
+ throw new Error("The parameter 'id' must be defined.");
2414
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
2415
+ if (productVersionId !== undefined && productVersionId !== null)
2416
+ url_ += "productVersionId=" + encodeURIComponent("" + productVersionId) + "&";
2417
+ if (skip !== undefined && skip !== null)
2418
+ url_ += "skip=" + encodeURIComponent("" + skip) + "&";
2419
+ if (take !== undefined && take !== null)
2420
+ url_ += "take=" + encodeURIComponent("" + take) + "&";
2421
+ if (sorting !== undefined && sorting !== null)
2422
+ url_ += "sorting=" + encodeURIComponent("" + sorting) + "&";
2423
+ if (search !== undefined && search !== null)
2424
+ url_ += "search=" + encodeURIComponent("" + search) + "&";
2425
+ if (tenantId !== undefined && tenantId !== null)
2426
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
2427
+ url_ = url_.replace(/[?&]$/, "");
2428
+ let options_ = {
2429
+ method: "GET",
2430
+ url: url_,
2431
+ headers: {
2432
+ "Accept": "application/json"
2433
+ },
2434
+ cancelToken
2435
+ };
2436
+ return this.transformOptions(options_).then(transformedOptions_ => {
2437
+ return this.instance.request(transformedOptions_);
2438
+ }).catch((_error) => {
2439
+ if (isAxiosError(_error) && _error.response) {
2440
+ return _error.response;
2441
+ }
2442
+ else {
2443
+ throw _error;
2444
+ }
2445
+ }).then((_response) => {
2446
+ return this.transformResult(url_, _response, (_response) => this.processGetProductLinks(_response));
2447
+ });
2448
+ }
2449
+ processGetProductLinks(response) {
2450
+ const status = response.status;
2451
+ let _headers = {};
2452
+ if (response.headers && typeof response.headers === "object") {
2453
+ for (let k in response.headers) {
2454
+ if (response.headers.hasOwnProperty(k)) {
2455
+ _headers[k] = response.headers[k];
2456
+ }
2457
+ }
2458
+ }
2459
+ if (status === 200) {
2460
+ const _responseText = response.data;
2461
+ let result200 = null;
2462
+ let resultData200 = _responseText;
2463
+ result200 = JSON.parse(resultData200);
2464
+ return Promise.resolve(result200);
2465
+ }
2466
+ else if (status === 404) {
2467
+ const _responseText = response.data;
2468
+ let result404 = null;
2469
+ let resultData404 = _responseText;
2470
+ result404 = JSON.parse(resultData404);
2471
+ return throwException("Not Found", status, _responseText, _headers, result404);
2472
+ }
2473
+ else if (status === 409) {
2474
+ const _responseText = response.data;
2475
+ let result409 = null;
2476
+ let resultData409 = _responseText;
2477
+ result409 = JSON.parse(resultData409);
2478
+ return throwException("Conflict", status, _responseText, _headers, result409);
2479
+ }
2480
+ else if (status === 401) {
2481
+ const _responseText = response.data;
2482
+ return throwException("Unauthorized", status, _responseText, _headers);
2483
+ }
2484
+ else if (status === 403) {
2485
+ const _responseText = response.data;
2486
+ return throwException("Forbidden", status, _responseText, _headers);
2487
+ }
2488
+ else if (status !== 200 && status !== 204) {
2489
+ const _responseText = response.data;
2490
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
2491
+ }
2492
+ return Promise.resolve(null);
2493
+ }
2494
+ /**
2495
+ * Returns a product link.
2496
+ * @param id Product identifier.
2497
+ * @param productLinkId Product link identifier.
2498
+ * @param productVersionId (optional)
2499
+ * @param tenantId (optional) Tenant identifier.
2500
+ * @return Success
2501
+ */
2502
+ getProductLink(id, productLinkId, productVersionId, tenantId, cancelToken) {
2503
+ let url_ = this.baseUrl + "/api/storefront/v1/products/{id}/links/{productLinkId}?";
2504
+ if (id === undefined || id === null)
2505
+ throw new Error("The parameter 'id' must be defined.");
2506
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
2507
+ if (productLinkId === undefined || productLinkId === null)
2508
+ throw new Error("The parameter 'productLinkId' must be defined.");
2509
+ url_ = url_.replace("{productLinkId}", encodeURIComponent("" + productLinkId));
2510
+ if (productVersionId !== undefined && productVersionId !== null)
2511
+ url_ += "productVersionId=" + encodeURIComponent("" + productVersionId) + "&";
2512
+ if (tenantId !== undefined && tenantId !== null)
2513
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
2514
+ url_ = url_.replace(/[?&]$/, "");
2515
+ let options_ = {
2516
+ method: "GET",
2517
+ url: url_,
2518
+ headers: {
2519
+ "Accept": "application/json"
2520
+ },
2521
+ cancelToken
2522
+ };
2523
+ return this.transformOptions(options_).then(transformedOptions_ => {
2524
+ return this.instance.request(transformedOptions_);
2525
+ }).catch((_error) => {
2526
+ if (isAxiosError(_error) && _error.response) {
2527
+ return _error.response;
2528
+ }
2529
+ else {
2530
+ throw _error;
2531
+ }
2532
+ }).then((_response) => {
2533
+ return this.transformResult(url_, _response, (_response) => this.processGetProductLink(_response));
2534
+ });
2535
+ }
2536
+ processGetProductLink(response) {
2537
+ const status = response.status;
2538
+ let _headers = {};
2539
+ if (response.headers && typeof response.headers === "object") {
2540
+ for (let k in response.headers) {
2541
+ if (response.headers.hasOwnProperty(k)) {
2542
+ _headers[k] = response.headers[k];
2543
+ }
2544
+ }
2545
+ }
2546
+ if (status === 200) {
2547
+ const _responseText = response.data;
2548
+ let result200 = null;
2549
+ let resultData200 = _responseText;
2550
+ result200 = JSON.parse(resultData200);
2551
+ return Promise.resolve(result200);
2552
+ }
2553
+ else if (status === 404) {
2554
+ const _responseText = response.data;
2555
+ let result404 = null;
2556
+ let resultData404 = _responseText;
2557
+ result404 = JSON.parse(resultData404);
2558
+ return throwException("Not Found", status, _responseText, _headers, result404);
2559
+ }
2560
+ else if (status === 409) {
2561
+ const _responseText = response.data;
2562
+ let result409 = null;
2563
+ let resultData409 = _responseText;
2564
+ result409 = JSON.parse(resultData409);
2565
+ return throwException("Conflict", status, _responseText, _headers, result409);
2566
+ }
2567
+ else if (status === 401) {
2568
+ const _responseText = response.data;
2569
+ return throwException("Unauthorized", status, _responseText, _headers);
2570
+ }
2571
+ else if (status === 403) {
2572
+ const _responseText = response.data;
2573
+ return throwException("Forbidden", status, _responseText, _headers);
2574
+ }
2575
+ else if (status !== 200 && status !== 204) {
2576
+ const _responseText = response.data;
2577
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
2578
+ }
2579
+ return Promise.resolve(null);
2580
+ }
2581
+ /**
2582
+ * Returns a list of product variants.
2583
+ * @param id Product identifier.
2584
+ * @param productVersionId (optional) Product version identifier.
2585
+ * @param skip (optional) Defines page start offset from beginning of sorted result list.
2586
+ * @param take (optional) Defines page length (how many consequent items of sorted result list should be taken).
2587
+ * @param options (optional) Defines options filter e.g.: "{ "opt1_id": "opt1_val1_id, opt1_val2_id", "opt2_id": "opt2_val1_id" }".
2588
+ * @param productFilterId (optional) Defines special filter based on product filter with specified identifier.
2589
+ * @param takeAvailableOnly (optional) Defines special filter for available product variants.
2590
+ * @param sku (optional) SKU of linked ecommerce product.
2591
+ * @param tenantId (optional) Tenant identifier.
2592
+ * @return Success
2593
+ */
2594
+ getProductVariants(id, productVersionId, skip, take, options, productFilterId, takeAvailableOnly, sku, tenantId, cancelToken) {
2595
+ let url_ = this.baseUrl + "/api/storefront/v1/products/{id}/variants?";
2596
+ if (id === undefined || id === null)
2597
+ throw new Error("The parameter 'id' must be defined.");
2598
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
2599
+ if (productVersionId !== undefined && productVersionId !== null)
2600
+ url_ += "productVersionId=" + encodeURIComponent("" + productVersionId) + "&";
2601
+ if (skip !== undefined && skip !== null)
2602
+ url_ += "skip=" + encodeURIComponent("" + skip) + "&";
2603
+ if (take !== undefined && take !== null)
2604
+ url_ += "take=" + encodeURIComponent("" + take) + "&";
2605
+ if (options !== undefined && options !== null)
2606
+ url_ += "options=" + encodeURIComponent("" + options) + "&";
2607
+ if (productFilterId !== undefined && productFilterId !== null)
2608
+ url_ += "productFilterId=" + encodeURIComponent("" + productFilterId) + "&";
2609
+ if (takeAvailableOnly !== undefined && takeAvailableOnly !== null)
2610
+ url_ += "takeAvailableOnly=" + encodeURIComponent("" + takeAvailableOnly) + "&";
2611
+ if (sku !== undefined && sku !== null)
2612
+ url_ += "sku=" + encodeURIComponent("" + sku) + "&";
2613
+ if (tenantId !== undefined && tenantId !== null)
2614
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
2615
+ url_ = url_.replace(/[?&]$/, "");
2616
+ let options_ = {
2617
+ method: "GET",
2618
+ url: url_,
2619
+ headers: {
2620
+ "Accept": "application/json"
2621
+ },
2622
+ cancelToken
2623
+ };
2624
+ return this.transformOptions(options_).then(transformedOptions_ => {
2625
+ return this.instance.request(transformedOptions_);
2626
+ }).catch((_error) => {
2627
+ if (isAxiosError(_error) && _error.response) {
2628
+ return _error.response;
2629
+ }
2630
+ else {
2631
+ throw _error;
2632
+ }
2633
+ }).then((_response) => {
2634
+ return this.transformResult(url_, _response, (_response) => this.processGetProductVariants(_response));
2635
+ });
2636
+ }
2637
+ processGetProductVariants(response) {
2638
+ const status = response.status;
2639
+ let _headers = {};
2640
+ if (response.headers && typeof response.headers === "object") {
2641
+ for (let k in response.headers) {
2642
+ if (response.headers.hasOwnProperty(k)) {
2643
+ _headers[k] = response.headers[k];
2644
+ }
2645
+ }
2646
+ }
2647
+ if (status === 200) {
2648
+ const _responseText = response.data;
2649
+ let result200 = null;
2650
+ let resultData200 = _responseText;
2651
+ result200 = JSON.parse(resultData200);
2652
+ return Promise.resolve(result200);
2653
+ }
2654
+ else if (status === 404) {
2655
+ const _responseText = response.data;
2656
+ let result404 = null;
2657
+ let resultData404 = _responseText;
2658
+ result404 = JSON.parse(resultData404);
2659
+ return throwException("Not Found", status, _responseText, _headers, result404);
2660
+ }
2661
+ else if (status === 409) {
2662
+ const _responseText = response.data;
2663
+ let result409 = null;
2664
+ let resultData409 = _responseText;
2665
+ result409 = JSON.parse(resultData409);
2666
+ return throwException("Conflict", status, _responseText, _headers, result409);
2667
+ }
2668
+ else if (status === 401) {
2669
+ const _responseText = response.data;
2670
+ return throwException("Unauthorized", status, _responseText, _headers);
2671
+ }
2672
+ else if (status === 403) {
2673
+ const _responseText = response.data;
2674
+ return throwException("Forbidden", status, _responseText, _headers);
2675
+ }
2676
+ else if (status !== 200 && status !== 204) {
2677
+ const _responseText = response.data;
2678
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
2679
+ }
2680
+ return Promise.resolve(null);
2681
+ }
2682
+ /**
2683
+ * Returns a product variant.
2684
+ * @param id Product identifier.
2685
+ * @param productVariantId Product variant identifier.
2686
+ * @param productVersionId (optional) Product version identifier.
2687
+ * @param tenantId (optional) Tenant identifier.
2688
+ * @return Success
2689
+ */
2690
+ getProductVariant(id, productVariantId, productVersionId, tenantId, cancelToken) {
2691
+ let url_ = this.baseUrl + "/api/storefront/v1/products/{id}/variants/{productVariantId}?";
2692
+ if (id === undefined || id === null)
2693
+ throw new Error("The parameter 'id' must be defined.");
2694
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
2695
+ if (productVariantId === undefined || productVariantId === null)
2696
+ throw new Error("The parameter 'productVariantId' must be defined.");
2697
+ url_ = url_.replace("{productVariantId}", encodeURIComponent("" + productVariantId));
2698
+ if (productVersionId !== undefined && productVersionId !== null)
2699
+ url_ += "productVersionId=" + encodeURIComponent("" + productVersionId) + "&";
2700
+ if (tenantId !== undefined && tenantId !== null)
2701
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
2702
+ url_ = url_.replace(/[?&]$/, "");
2703
+ let options_ = {
2704
+ method: "GET",
2705
+ url: url_,
2706
+ headers: {
2707
+ "Accept": "application/json"
2708
+ },
2709
+ cancelToken
2710
+ };
2711
+ return this.transformOptions(options_).then(transformedOptions_ => {
2712
+ return this.instance.request(transformedOptions_);
2713
+ }).catch((_error) => {
2714
+ if (isAxiosError(_error) && _error.response) {
2715
+ return _error.response;
2716
+ }
2717
+ else {
2718
+ throw _error;
2719
+ }
2720
+ }).then((_response) => {
2721
+ return this.transformResult(url_, _response, (_response) => this.processGetProductVariant(_response));
2722
+ });
2723
+ }
2724
+ processGetProductVariant(response) {
2725
+ const status = response.status;
2726
+ let _headers = {};
2727
+ if (response.headers && typeof response.headers === "object") {
2728
+ for (let k in response.headers) {
2729
+ if (response.headers.hasOwnProperty(k)) {
2730
+ _headers[k] = response.headers[k];
2731
+ }
2732
+ }
2733
+ }
2734
+ if (status === 200) {
2735
+ const _responseText = response.data;
2736
+ let result200 = null;
2737
+ let resultData200 = _responseText;
2738
+ result200 = JSON.parse(resultData200);
2739
+ return Promise.resolve(result200);
2740
+ }
2741
+ else if (status === 404) {
2742
+ const _responseText = response.data;
2743
+ let result404 = null;
2744
+ let resultData404 = _responseText;
2745
+ result404 = JSON.parse(resultData404);
2746
+ return throwException("Not Found", status, _responseText, _headers, result404);
2747
+ }
2748
+ else if (status === 409) {
2749
+ const _responseText = response.data;
2750
+ let result409 = null;
2751
+ let resultData409 = _responseText;
2752
+ result409 = JSON.parse(resultData409);
2753
+ return throwException("Conflict", status, _responseText, _headers, result409);
2754
+ }
2755
+ else if (status === 401) {
2756
+ const _responseText = response.data;
2757
+ return throwException("Unauthorized", status, _responseText, _headers);
2758
+ }
2759
+ else if (status === 403) {
2760
+ const _responseText = response.data;
2761
+ return throwException("Forbidden", status, _responseText, _headers);
2762
+ }
2763
+ else if (status !== 200 && status !== 204) {
2764
+ const _responseText = response.data;
2765
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
2766
+ }
2767
+ return Promise.resolve(null);
2768
+ }
2769
+ /**
2770
+ * Returns a list of product variant designs.
2771
+ * @param id Product identifier.
2772
+ * @param productVersionId (optional) Product version identifier.
2773
+ * @param productVariantId (optional) Product variant identifier.
2774
+ * @param search (optional) Search string for design name partial match.
2775
+ * @param designCustomFields (optional) Custom attributes dictionary filter for designs. For example: {"public":"true","name":"my item"}
2776
+ * @param designPath (optional) Path filter for designs. Subfolders included by default.
2777
+ * @param skip (optional) Defines page start offset from beginning of sorted result list.
2778
+ * @param take (optional) Defines page length (how many consequent items of sorted result list should be taken).
2779
+ * @param options (optional) Defines options filter e.g.: "{ "opt1_id": "opt1_val1_id, opt1_val2_id", "opt2_id": "opt2_val1_id" }".
2780
+ * @param productFilterId (optional) Defines special filter based on product filter with specified identifier.
2781
+ * @param takeAvailableOnly (optional) Defines special filter for available product variants.
2782
+ * @param sku (optional) SKU of linked ecommerce product.
2783
+ * @param tenantId (optional) Tenant identifier.
2784
+ * @return Success
2785
+ */
2786
+ getProductVariantDesigns(id, productVersionId, productVariantId, search, designCustomFields, designPath, skip, take, options, productFilterId, takeAvailableOnly, sku, tenantId, cancelToken) {
2787
+ let url_ = this.baseUrl + "/api/storefront/v1/products/{id}/variant-designs?";
2788
+ if (id === undefined || id === null)
2789
+ throw new Error("The parameter 'id' must be defined.");
2790
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
2791
+ if (productVersionId !== undefined && productVersionId !== null)
2792
+ url_ += "productVersionId=" + encodeURIComponent("" + productVersionId) + "&";
2793
+ if (productVariantId !== undefined && productVariantId !== null)
2794
+ url_ += "productVariantId=" + encodeURIComponent("" + productVariantId) + "&";
2795
+ if (search !== undefined && search !== null)
2796
+ url_ += "search=" + encodeURIComponent("" + search) + "&";
2797
+ if (designCustomFields !== undefined && designCustomFields !== null)
2798
+ url_ += "designCustomFields=" + encodeURIComponent("" + designCustomFields) + "&";
2799
+ if (designPath !== undefined && designPath !== null)
2800
+ url_ += "designPath=" + encodeURIComponent("" + designPath) + "&";
2801
+ if (skip !== undefined && skip !== null)
2802
+ url_ += "skip=" + encodeURIComponent("" + skip) + "&";
2803
+ if (take !== undefined && take !== null)
2804
+ url_ += "take=" + encodeURIComponent("" + take) + "&";
2805
+ if (options !== undefined && options !== null)
2806
+ url_ += "options=" + encodeURIComponent("" + options) + "&";
2807
+ if (productFilterId !== undefined && productFilterId !== null)
2808
+ url_ += "productFilterId=" + encodeURIComponent("" + productFilterId) + "&";
2809
+ if (takeAvailableOnly !== undefined && takeAvailableOnly !== null)
2810
+ url_ += "takeAvailableOnly=" + encodeURIComponent("" + takeAvailableOnly) + "&";
2811
+ if (sku !== undefined && sku !== null)
2812
+ url_ += "sku=" + encodeURIComponent("" + sku) + "&";
2813
+ if (tenantId !== undefined && tenantId !== null)
2814
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
2815
+ url_ = url_.replace(/[?&]$/, "");
2816
+ let options_ = {
2817
+ method: "GET",
2818
+ url: url_,
2819
+ headers: {
2820
+ "Accept": "application/json"
2821
+ },
2822
+ cancelToken
2823
+ };
2824
+ return this.transformOptions(options_).then(transformedOptions_ => {
2825
+ return this.instance.request(transformedOptions_);
2826
+ }).catch((_error) => {
2827
+ if (isAxiosError(_error) && _error.response) {
2828
+ return _error.response;
2829
+ }
2830
+ else {
2831
+ throw _error;
2832
+ }
2833
+ }).then((_response) => {
2834
+ return this.transformResult(url_, _response, (_response) => this.processGetProductVariantDesigns(_response));
2835
+ });
2836
+ }
2837
+ processGetProductVariantDesigns(response) {
2838
+ const status = response.status;
2839
+ let _headers = {};
2840
+ if (response.headers && typeof response.headers === "object") {
2841
+ for (let k in response.headers) {
2842
+ if (response.headers.hasOwnProperty(k)) {
2843
+ _headers[k] = response.headers[k];
2844
+ }
2845
+ }
2846
+ }
2847
+ if (status === 200) {
2848
+ const _responseText = response.data;
2849
+ let result200 = null;
2850
+ let resultData200 = _responseText;
2851
+ result200 = JSON.parse(resultData200);
2852
+ return Promise.resolve(result200);
2853
+ }
2854
+ else if (status === 404) {
2855
+ const _responseText = response.data;
2856
+ let result404 = null;
2857
+ let resultData404 = _responseText;
2858
+ result404 = JSON.parse(resultData404);
2859
+ return throwException("Not Found", status, _responseText, _headers, result404);
2860
+ }
2861
+ else if (status === 409) {
2862
+ const _responseText = response.data;
2863
+ let result409 = null;
2864
+ let resultData409 = _responseText;
2865
+ result409 = JSON.parse(resultData409);
2866
+ return throwException("Conflict", status, _responseText, _headers, result409);
2867
+ }
2868
+ else if (status === 401) {
2869
+ const _responseText = response.data;
2870
+ return throwException("Unauthorized", status, _responseText, _headers);
2871
+ }
2872
+ else if (status === 403) {
2873
+ const _responseText = response.data;
2874
+ return throwException("Forbidden", status, _responseText, _headers);
2875
+ }
2876
+ else if (status !== 200 && status !== 204) {
2877
+ const _responseText = response.data;
2878
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
2879
+ }
2880
+ return Promise.resolve(null);
2881
+ }
2882
+ /**
2883
+ * Returns a list of product variant mockups.
2884
+ * @param id Product identifier.
2885
+ * @param productVersionId (optional) Product version identifier.
2886
+ * @param productVariantId (optional) Product variant identifier.
2887
+ * @param search (optional) Search string for design name partial match.
2888
+ * @param mockupCustomFields (optional) Custom attributes dictionary filter for mockups. For example: {"public":"true","name":"my item"}
2889
+ * @param mockupPath (optional) Path filter for mockups. Subfolders included by default.
2890
+ * @param skip (optional) Defines page start offset from beginning of sorted result list.
2891
+ * @param take (optional) Defines page length (how many consequent items of sorted result list should be taken).
2892
+ * @param options (optional) Defines options filter e.g.: "{ "opt1_id": "opt1_val1_id, opt1_val2_id", "opt2_id": "opt2_val1_id" }".
2893
+ * @param productFilterId (optional) Defines special filter based on product filter with specified identifier.
2894
+ * @param takeAvailableOnly (optional) Defines special filter for available product variants.
2895
+ * @param sku (optional) SKU of linked ecommerce product.
2896
+ * @param tenantId (optional) Tenant identifier.
2897
+ * @return Success
2898
+ */
2899
+ getProductVariantMockups(id, productVersionId, productVariantId, search, mockupCustomFields, mockupPath, skip, take, options, productFilterId, takeAvailableOnly, sku, tenantId, cancelToken) {
2900
+ let url_ = this.baseUrl + "/api/storefront/v1/products/{id}/variant-mockups?";
2901
+ if (id === undefined || id === null)
2902
+ throw new Error("The parameter 'id' must be defined.");
2903
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
2904
+ if (productVersionId !== undefined && productVersionId !== null)
2905
+ url_ += "productVersionId=" + encodeURIComponent("" + productVersionId) + "&";
2906
+ if (productVariantId !== undefined && productVariantId !== null)
2907
+ url_ += "productVariantId=" + encodeURIComponent("" + productVariantId) + "&";
2908
+ if (search !== undefined && search !== null)
2909
+ url_ += "search=" + encodeURIComponent("" + search) + "&";
2910
+ if (mockupCustomFields !== undefined && mockupCustomFields !== null)
2911
+ url_ += "mockupCustomFields=" + encodeURIComponent("" + mockupCustomFields) + "&";
2912
+ if (mockupPath !== undefined && mockupPath !== null)
2913
+ url_ += "mockupPath=" + encodeURIComponent("" + mockupPath) + "&";
2914
+ if (skip !== undefined && skip !== null)
2915
+ url_ += "skip=" + encodeURIComponent("" + skip) + "&";
2916
+ if (take !== undefined && take !== null)
2917
+ url_ += "take=" + encodeURIComponent("" + take) + "&";
2918
+ if (options !== undefined && options !== null)
2919
+ url_ += "options=" + encodeURIComponent("" + options) + "&";
2920
+ if (productFilterId !== undefined && productFilterId !== null)
2921
+ url_ += "productFilterId=" + encodeURIComponent("" + productFilterId) + "&";
2922
+ if (takeAvailableOnly !== undefined && takeAvailableOnly !== null)
2923
+ url_ += "takeAvailableOnly=" + encodeURIComponent("" + takeAvailableOnly) + "&";
2924
+ if (sku !== undefined && sku !== null)
2925
+ url_ += "sku=" + encodeURIComponent("" + sku) + "&";
2926
+ if (tenantId !== undefined && tenantId !== null)
2927
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
2928
+ url_ = url_.replace(/[?&]$/, "");
2929
+ let options_ = {
2930
+ method: "GET",
2931
+ url: url_,
2932
+ headers: {
2933
+ "Accept": "application/json"
2934
+ },
2935
+ cancelToken
2936
+ };
2937
+ return this.transformOptions(options_).then(transformedOptions_ => {
2938
+ return this.instance.request(transformedOptions_);
2939
+ }).catch((_error) => {
2940
+ if (isAxiosError(_error) && _error.response) {
2941
+ return _error.response;
2942
+ }
2943
+ else {
2944
+ throw _error;
2945
+ }
2946
+ }).then((_response) => {
2947
+ return this.transformResult(url_, _response, (_response) => this.processGetProductVariantMockups(_response));
2948
+ });
2949
+ }
2950
+ processGetProductVariantMockups(response) {
2951
+ const status = response.status;
2952
+ let _headers = {};
2953
+ if (response.headers && typeof response.headers === "object") {
2954
+ for (let k in response.headers) {
2955
+ if (response.headers.hasOwnProperty(k)) {
2956
+ _headers[k] = response.headers[k];
2957
+ }
2958
+ }
2959
+ }
2960
+ if (status === 200) {
2961
+ const _responseText = response.data;
2962
+ let result200 = null;
2963
+ let resultData200 = _responseText;
2964
+ result200 = JSON.parse(resultData200);
2965
+ return Promise.resolve(result200);
2966
+ }
2967
+ else if (status === 404) {
2968
+ const _responseText = response.data;
2969
+ let result404 = null;
2970
+ let resultData404 = _responseText;
2971
+ result404 = JSON.parse(resultData404);
2972
+ return throwException("Not Found", status, _responseText, _headers, result404);
2973
+ }
2974
+ else if (status === 409) {
2975
+ const _responseText = response.data;
2976
+ let result409 = null;
2977
+ let resultData409 = _responseText;
2978
+ result409 = JSON.parse(resultData409);
2979
+ return throwException("Conflict", status, _responseText, _headers, result409);
2980
+ }
2981
+ else if (status === 401) {
2982
+ const _responseText = response.data;
2983
+ return throwException("Unauthorized", status, _responseText, _headers);
2984
+ }
2985
+ else if (status === 403) {
2986
+ const _responseText = response.data;
2987
+ return throwException("Forbidden", status, _responseText, _headers);
2988
+ }
2989
+ else if (status !== 200 && status !== 204) {
2990
+ const _responseText = response.data;
2991
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
2992
+ }
2993
+ return Promise.resolve(null);
2994
+ }
2995
+ /**
2996
+ * Returns a list of product variant documents.
2997
+ * @param id Product identifier.
2998
+ * @param productVersionId (optional) Product version identifier.
2999
+ * @param productVariantId (optional) Product variant identifier.
3000
+ * @param search (optional) Search string for document name partial match.
3001
+ * @param documentCustomFields (optional) Custom attributes dictionary filter for documents. For example: {"public":"true","name":"my item"}
3002
+ * @param documentPath (optional) Path filter for documents. Subfolders included by default.
3003
+ * @param skip (optional) Defines page start offset from beginning of sorted result list.
3004
+ * @param take (optional) Defines page length (how many consequent items of sorted result list should be taken).
3005
+ * @param options (optional) Defines options filter e.g.: "{ "opt1_id": "opt1_val1_id, opt1_val2_id", "opt2_id": "opt2_val1_id" }".
3006
+ * @param productFilterId (optional) Defines special filter based on product filter with specified identifier.
3007
+ * @param takeAvailableOnly (optional) Defines special filter for available product variants.
3008
+ * @param sku (optional) SKU of linked ecommerce product.
3009
+ * @param tenantId (optional) Tenant identifier.
3010
+ * @return Success
3011
+ */
3012
+ getProductVariantDocuments(id, productVersionId, productVariantId, search, documentCustomFields, documentPath, skip, take, options, productFilterId, takeAvailableOnly, sku, tenantId, cancelToken) {
3013
+ let url_ = this.baseUrl + "/api/storefront/v1/products/{id}/variant-documents?";
3014
+ if (id === undefined || id === null)
3015
+ throw new Error("The parameter 'id' must be defined.");
3016
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
3017
+ if (productVersionId !== undefined && productVersionId !== null)
3018
+ url_ += "productVersionId=" + encodeURIComponent("" + productVersionId) + "&";
3019
+ if (productVariantId !== undefined && productVariantId !== null)
3020
+ url_ += "productVariantId=" + encodeURIComponent("" + productVariantId) + "&";
3021
+ if (search !== undefined && search !== null)
3022
+ url_ += "search=" + encodeURIComponent("" + search) + "&";
3023
+ if (documentCustomFields !== undefined && documentCustomFields !== null)
3024
+ url_ += "documentCustomFields=" + encodeURIComponent("" + documentCustomFields) + "&";
3025
+ if (documentPath !== undefined && documentPath !== null)
3026
+ url_ += "documentPath=" + encodeURIComponent("" + documentPath) + "&";
3027
+ if (skip !== undefined && skip !== null)
3028
+ url_ += "skip=" + encodeURIComponent("" + skip) + "&";
3029
+ if (take !== undefined && take !== null)
3030
+ url_ += "take=" + encodeURIComponent("" + take) + "&";
3031
+ if (options !== undefined && options !== null)
3032
+ url_ += "options=" + encodeURIComponent("" + options) + "&";
3033
+ if (productFilterId !== undefined && productFilterId !== null)
3034
+ url_ += "productFilterId=" + encodeURIComponent("" + productFilterId) + "&";
3035
+ if (takeAvailableOnly !== undefined && takeAvailableOnly !== null)
3036
+ url_ += "takeAvailableOnly=" + encodeURIComponent("" + takeAvailableOnly) + "&";
3037
+ if (sku !== undefined && sku !== null)
3038
+ url_ += "sku=" + encodeURIComponent("" + sku) + "&";
3039
+ if (tenantId !== undefined && tenantId !== null)
3040
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
3041
+ url_ = url_.replace(/[?&]$/, "");
3042
+ let options_ = {
3043
+ method: "GET",
3044
+ url: url_,
3045
+ headers: {
3046
+ "Accept": "application/json"
843
3047
  },
844
3048
  cancelToken
845
3049
  };
@@ -853,10 +3057,10 @@ class ProductReferencesApiClient extends ApiClientBase {
853
3057
  throw _error;
854
3058
  }
855
3059
  }).then((_response) => {
856
- return this.transformResult(url_, _response, (_response) => this.processGetPersonalizationWorkflow(_response));
3060
+ return this.transformResult(url_, _response, (_response) => this.processGetProductVariantDocuments(_response));
857
3061
  });
858
3062
  }
859
- processGetPersonalizationWorkflow(response) {
3063
+ processGetProductVariantDocuments(response) {
860
3064
  const status = response.status;
861
3065
  let _headers = {};
862
3066
  if (response.headers && typeof response.headers === "object") {
@@ -880,6 +3084,13 @@ class ProductReferencesApiClient extends ApiClientBase {
880
3084
  result404 = JSON.parse(resultData404);
881
3085
  return throwException("Not Found", status, _responseText, _headers, result404);
882
3086
  }
3087
+ else if (status === 409) {
3088
+ const _responseText = response.data;
3089
+ let result409 = null;
3090
+ let resultData409 = _responseText;
3091
+ result409 = JSON.parse(resultData409);
3092
+ return throwException("Conflict", status, _responseText, _headers, result409);
3093
+ }
883
3094
  else if (status === 401) {
884
3095
  const _responseText = response.data;
885
3096
  return throwException("Unauthorized", status, _responseText, _headers);
@@ -895,22 +3106,251 @@ class ProductReferencesApiClient extends ApiClientBase {
895
3106
  return Promise.resolve(null);
896
3107
  }
897
3108
  /**
898
- * Returns a product personalization workflow configuration by storefront product reference.
899
- * @param reference Product reference - external reference to Customer's Canvas product specification, e.g online store product identifier.
900
- * @param storefrontId Storefront identifier.
3109
+ * Updates product variant resources.
3110
+ * @param id Product identifier.
3111
+ * @param productVersionId (optional) Product version identifier.
3112
+ * @param tenantId (optional) Tenant identifier.
3113
+ * @return Success
3114
+ */
3115
+ updateProductVariantResources(id, productVersionId, tenantId, cancelToken) {
3116
+ let url_ = this.baseUrl + "/api/storefront/v1/products/{id}/update-variant-resources?";
3117
+ if (id === undefined || id === null)
3118
+ throw new Error("The parameter 'id' must be defined.");
3119
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
3120
+ if (productVersionId !== undefined && productVersionId !== null)
3121
+ url_ += "productVersionId=" + encodeURIComponent("" + productVersionId) + "&";
3122
+ if (tenantId !== undefined && tenantId !== null)
3123
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
3124
+ url_ = url_.replace(/[?&]$/, "");
3125
+ let options_ = {
3126
+ method: "POST",
3127
+ url: url_,
3128
+ headers: {},
3129
+ cancelToken
3130
+ };
3131
+ return this.transformOptions(options_).then(transformedOptions_ => {
3132
+ return this.instance.request(transformedOptions_);
3133
+ }).catch((_error) => {
3134
+ if (isAxiosError(_error) && _error.response) {
3135
+ return _error.response;
3136
+ }
3137
+ else {
3138
+ throw _error;
3139
+ }
3140
+ }).then((_response) => {
3141
+ return this.transformResult(url_, _response, (_response) => this.processUpdateProductVariantResources(_response));
3142
+ });
3143
+ }
3144
+ processUpdateProductVariantResources(response) {
3145
+ const status = response.status;
3146
+ let _headers = {};
3147
+ if (response.headers && typeof response.headers === "object") {
3148
+ for (let k in response.headers) {
3149
+ if (response.headers.hasOwnProperty(k)) {
3150
+ _headers[k] = response.headers[k];
3151
+ }
3152
+ }
3153
+ }
3154
+ if (status === 200) {
3155
+ const _responseText = response.data;
3156
+ return Promise.resolve(null);
3157
+ }
3158
+ else if (status === 404) {
3159
+ const _responseText = response.data;
3160
+ let result404 = null;
3161
+ let resultData404 = _responseText;
3162
+ result404 = JSON.parse(resultData404);
3163
+ return throwException("Not Found", status, _responseText, _headers, result404);
3164
+ }
3165
+ else if (status === 409) {
3166
+ const _responseText = response.data;
3167
+ let result409 = null;
3168
+ let resultData409 = _responseText;
3169
+ result409 = JSON.parse(resultData409);
3170
+ return throwException("Conflict", status, _responseText, _headers, result409);
3171
+ }
3172
+ else if (status === 401) {
3173
+ const _responseText = response.data;
3174
+ return throwException("Unauthorized", status, _responseText, _headers);
3175
+ }
3176
+ else if (status === 403) {
3177
+ const _responseText = response.data;
3178
+ return throwException("Forbidden", status, _responseText, _headers);
3179
+ }
3180
+ else if (status !== 200 && status !== 204) {
3181
+ const _responseText = response.data;
3182
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
3183
+ }
3184
+ return Promise.resolve(null);
3185
+ }
3186
+ /**
3187
+ * Set product variant price.
3188
+ * @param id Product identifier.
3189
+ * @param productVersionId (optional) Product version identifier.
3190
+ * @param tenantId (optional) Tenant identifier.
3191
+ * @param body (optional) Set product variant price operation parameters.
3192
+ * @return Success
3193
+ */
3194
+ setProductVariantPrice(id, productVersionId, tenantId, body, cancelToken) {
3195
+ let url_ = this.baseUrl + "/api/storefront/v1/products/{id}/set-variant-price?";
3196
+ if (id === undefined || id === null)
3197
+ throw new Error("The parameter 'id' must be defined.");
3198
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
3199
+ if (productVersionId !== undefined && productVersionId !== null)
3200
+ url_ += "productVersionId=" + encodeURIComponent("" + productVersionId) + "&";
3201
+ if (tenantId !== undefined && tenantId !== null)
3202
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
3203
+ url_ = url_.replace(/[?&]$/, "");
3204
+ const content_ = JSON.stringify(body);
3205
+ let options_ = {
3206
+ data: content_,
3207
+ method: "POST",
3208
+ url: url_,
3209
+ headers: {
3210
+ "Content-Type": "application/json",
3211
+ },
3212
+ cancelToken
3213
+ };
3214
+ return this.transformOptions(options_).then(transformedOptions_ => {
3215
+ return this.instance.request(transformedOptions_);
3216
+ }).catch((_error) => {
3217
+ if (isAxiosError(_error) && _error.response) {
3218
+ return _error.response;
3219
+ }
3220
+ else {
3221
+ throw _error;
3222
+ }
3223
+ }).then((_response) => {
3224
+ return this.transformResult(url_, _response, (_response) => this.processSetProductVariantPrice(_response));
3225
+ });
3226
+ }
3227
+ processSetProductVariantPrice(response) {
3228
+ const status = response.status;
3229
+ let _headers = {};
3230
+ if (response.headers && typeof response.headers === "object") {
3231
+ for (let k in response.headers) {
3232
+ if (response.headers.hasOwnProperty(k)) {
3233
+ _headers[k] = response.headers[k];
3234
+ }
3235
+ }
3236
+ }
3237
+ if (status === 200) {
3238
+ const _responseText = response.data;
3239
+ return Promise.resolve(null);
3240
+ }
3241
+ else if (status === 404) {
3242
+ const _responseText = response.data;
3243
+ let result404 = null;
3244
+ let resultData404 = _responseText;
3245
+ result404 = JSON.parse(resultData404);
3246
+ return throwException("Not Found", status, _responseText, _headers, result404);
3247
+ }
3248
+ else if (status === 409) {
3249
+ const _responseText = response.data;
3250
+ let result409 = null;
3251
+ let resultData409 = _responseText;
3252
+ result409 = JSON.parse(resultData409);
3253
+ return throwException("Conflict", status, _responseText, _headers, result409);
3254
+ }
3255
+ else if (status === 401) {
3256
+ const _responseText = response.data;
3257
+ return throwException("Unauthorized", status, _responseText, _headers);
3258
+ }
3259
+ else if (status === 403) {
3260
+ const _responseText = response.data;
3261
+ return throwException("Forbidden", status, _responseText, _headers);
3262
+ }
3263
+ else if (status !== 200 && status !== 204) {
3264
+ const _responseText = response.data;
3265
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
3266
+ }
3267
+ return Promise.resolve(null);
3268
+ }
3269
+ /**
3270
+ * Returns a list of all available product tags.
3271
+ * @param search (optional) Search string for partial match.
3272
+ * @param tenantId (optional) Tenant identifier.
3273
+ * @return Success
3274
+ */
3275
+ getAvailableProductTags(search, tenantId, cancelToken) {
3276
+ let url_ = this.baseUrl + "/api/storefront/v1/products/available-tags?";
3277
+ if (search !== undefined && search !== null)
3278
+ url_ += "search=" + encodeURIComponent("" + search) + "&";
3279
+ if (tenantId !== undefined && tenantId !== null)
3280
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
3281
+ url_ = url_.replace(/[?&]$/, "");
3282
+ let options_ = {
3283
+ method: "GET",
3284
+ url: url_,
3285
+ headers: {
3286
+ "Accept": "application/json"
3287
+ },
3288
+ cancelToken
3289
+ };
3290
+ return this.transformOptions(options_).then(transformedOptions_ => {
3291
+ return this.instance.request(transformedOptions_);
3292
+ }).catch((_error) => {
3293
+ if (isAxiosError(_error) && _error.response) {
3294
+ return _error.response;
3295
+ }
3296
+ else {
3297
+ throw _error;
3298
+ }
3299
+ }).then((_response) => {
3300
+ return this.transformResult(url_, _response, (_response) => this.processGetAvailableProductTags(_response));
3301
+ });
3302
+ }
3303
+ processGetAvailableProductTags(response) {
3304
+ const status = response.status;
3305
+ let _headers = {};
3306
+ if (response.headers && typeof response.headers === "object") {
3307
+ for (let k in response.headers) {
3308
+ if (response.headers.hasOwnProperty(k)) {
3309
+ _headers[k] = response.headers[k];
3310
+ }
3311
+ }
3312
+ }
3313
+ if (status === 200) {
3314
+ const _responseText = response.data;
3315
+ let result200 = null;
3316
+ let resultData200 = _responseText;
3317
+ result200 = JSON.parse(resultData200);
3318
+ return Promise.resolve(result200);
3319
+ }
3320
+ else if (status === 401) {
3321
+ const _responseText = response.data;
3322
+ return throwException("Unauthorized", status, _responseText, _headers);
3323
+ }
3324
+ else if (status === 403) {
3325
+ const _responseText = response.data;
3326
+ return throwException("Forbidden", status, _responseText, _headers);
3327
+ }
3328
+ else if (status !== 200 && status !== 204) {
3329
+ const _responseText = response.data;
3330
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
3331
+ }
3332
+ return Promise.resolve(null);
3333
+ }
3334
+ /**
3335
+ * Returns a product personalization workflow description by product identifier.
3336
+ * @param id Product identifier.
3337
+ * @param productVersionId (optional) Product version identifier.
3338
+ * @param productLinkId (optional) Product link identifier.
3339
+ * @param productFilterId (optional) Product filter identifier.
901
3340
  * @param tenantId (optional) Tenant identifier.
902
3341
  * @return Success
903
- * @deprecated
904
3342
  */
905
- getProductConfig(reference, storefrontId, tenantId, cancelToken) {
906
- let url_ = this.baseUrl + "/api/storefront/v1/product-references/{reference}/product-config?";
907
- if (reference === undefined || reference === null)
908
- throw new Error("The parameter 'reference' must be defined.");
909
- url_ = url_.replace("{reference}", encodeURIComponent("" + reference));
910
- if (storefrontId === undefined || storefrontId === null)
911
- throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
912
- else
913
- url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
3343
+ getPersonalizationWorkflow(id, productVersionId, productLinkId, productFilterId, tenantId, cancelToken) {
3344
+ let url_ = this.baseUrl + "/api/storefront/v1/products/{id}/personalization-workflow?";
3345
+ if (id === undefined || id === null)
3346
+ throw new Error("The parameter 'id' must be defined.");
3347
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
3348
+ if (productVersionId !== undefined && productVersionId !== null)
3349
+ url_ += "productVersionId=" + encodeURIComponent("" + productVersionId) + "&";
3350
+ if (productLinkId !== undefined && productLinkId !== null)
3351
+ url_ += "productLinkId=" + encodeURIComponent("" + productLinkId) + "&";
3352
+ if (productFilterId !== undefined && productFilterId !== null)
3353
+ url_ += "productFilterId=" + encodeURIComponent("" + productFilterId) + "&";
914
3354
  if (tenantId !== undefined && tenantId !== null)
915
3355
  url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
916
3356
  url_ = url_.replace(/[?&]$/, "");
@@ -918,7 +3358,7 @@ class ProductReferencesApiClient extends ApiClientBase {
918
3358
  method: "GET",
919
3359
  url: url_,
920
3360
  headers: {
921
- "Accept": "text/plain"
3361
+ "Accept": "application/json"
922
3362
  },
923
3363
  cancelToken
924
3364
  };
@@ -932,10 +3372,10 @@ class ProductReferencesApiClient extends ApiClientBase {
932
3372
  throw _error;
933
3373
  }
934
3374
  }).then((_response) => {
935
- return this.transformResult(url_, _response, (_response) => this.processGetProductConfig(_response));
3375
+ return this.transformResult(url_, _response, (_response) => this.processGetPersonalizationWorkflow(_response));
936
3376
  });
937
3377
  }
938
- processGetProductConfig(response) {
3378
+ processGetPersonalizationWorkflow(response) {
939
3379
  const status = response.status;
940
3380
  let _headers = {};
941
3381
  if (response.headers && typeof response.headers === "object") {
@@ -949,16 +3389,23 @@ class ProductReferencesApiClient extends ApiClientBase {
949
3389
  const _responseText = response.data;
950
3390
  let result200 = null;
951
3391
  let resultData200 = _responseText;
952
- result200 = resultData200;
3392
+ result200 = JSON.parse(resultData200);
953
3393
  return Promise.resolve(result200);
954
3394
  }
955
3395
  else if (status === 404) {
956
3396
  const _responseText = response.data;
957
3397
  let result404 = null;
958
3398
  let resultData404 = _responseText;
959
- result404 = resultData404;
3399
+ result404 = JSON.parse(resultData404);
960
3400
  return throwException("Not Found", status, _responseText, _headers, result404);
961
3401
  }
3402
+ else if (status === 409) {
3403
+ const _responseText = response.data;
3404
+ let result409 = null;
3405
+ let resultData409 = _responseText;
3406
+ result409 = JSON.parse(resultData409);
3407
+ return throwException("Conflict", status, _responseText, _headers, result409);
3408
+ }
962
3409
  else if (status === 401) {
963
3410
  const _responseText = response.data;
964
3411
  return throwException("Unauthorized", status, _responseText, _headers);
@@ -974,7 +3421,7 @@ class ProductReferencesApiClient extends ApiClientBase {
974
3421
  return Promise.resolve(null);
975
3422
  }
976
3423
  }
977
- exports.ProductReferencesApiClient = ProductReferencesApiClient;
3424
+ exports.ProductsApiClient = ProductsApiClient;
978
3425
  class ProductSpecificationsApiClient extends ApiClientBase {
979
3426
  instance;
980
3427
  baseUrl;
@@ -1010,7 +3457,7 @@ class ProductSpecificationsApiClient extends ApiClientBase {
1010
3457
  method: "GET",
1011
3458
  url: url_,
1012
3459
  headers: {
1013
- "Accept": "text/plain"
3460
+ "Accept": "application/json"
1014
3461
  },
1015
3462
  cancelToken
1016
3463
  };
@@ -1076,7 +3523,7 @@ class ProductSpecificationsApiClient extends ApiClientBase {
1076
3523
  method: "GET",
1077
3524
  url: url_,
1078
3525
  headers: {
1079
- "Accept": "text/plain"
3526
+ "Accept": "application/json"
1080
3527
  },
1081
3528
  cancelToken
1082
3529
  };
@@ -1149,7 +3596,7 @@ class ProductSpecificationsApiClient extends ApiClientBase {
1149
3596
  method: "GET",
1150
3597
  url: url_,
1151
3598
  headers: {
1152
- "Accept": "text/plain"
3599
+ "Accept": "application/json"
1153
3600
  },
1154
3601
  cancelToken
1155
3602
  };
@@ -1261,7 +3708,7 @@ class ProductSpecificationsApiClient extends ApiClientBase {
1261
3708
  const _responseText = response.data;
1262
3709
  let result404 = null;
1263
3710
  let resultData404 = _responseText;
1264
- result404 = resultData404;
3711
+ result404 = JSON.parse(resultData404);
1265
3712
  return throwException("Not Found", status, _responseText, _headers, result404);
1266
3713
  }
1267
3714
  else if (status === 401) {
@@ -1301,11 +3748,12 @@ class ProjectsApiClient extends ApiClientBase {
1301
3748
  * @param search (optional) Search string for partial match.
1302
3749
  * @param orderId (optional) Identifier of corresponding order.
1303
3750
  * @param processingStatus (optional) Project processing status filter.
3751
+ * @param includeObsolete (optional) Indicates if obsolete projects prepared to be removed should be included to result.
1304
3752
  * @param storefrontId (optional) Storefront identifier.
1305
3753
  * @param tenantId (optional) Tenant identifier.
1306
3754
  * @return Success
1307
3755
  */
1308
- getAll(ownerId, productReference, status, datePeriod, skip, take, sorting, search, orderId, processingStatus, storefrontId, tenantId, cancelToken) {
3756
+ getAll(ownerId, productReference, status, datePeriod, skip, take, sorting, search, orderId, processingStatus, includeObsolete, storefrontId, tenantId, cancelToken) {
1309
3757
  let url_ = this.baseUrl + "/api/storefront/v1/projects?";
1310
3758
  if (ownerId !== undefined && ownerId !== null)
1311
3759
  url_ += "ownerId=" + encodeURIComponent("" + ownerId) + "&";
@@ -1329,6 +3777,10 @@ class ProjectsApiClient extends ApiClientBase {
1329
3777
  url_ += "orderId=" + encodeURIComponent("" + orderId) + "&";
1330
3778
  if (processingStatus !== undefined && processingStatus !== null)
1331
3779
  url_ += "processingStatus=" + encodeURIComponent("" + processingStatus) + "&";
3780
+ if (includeObsolete === null)
3781
+ throw new Error("The parameter 'includeObsolete' cannot be null.");
3782
+ else if (includeObsolete !== undefined)
3783
+ url_ += "includeObsolete=" + encodeURIComponent("" + includeObsolete) + "&";
1332
3784
  if (storefrontId !== undefined && storefrontId !== null)
1333
3785
  url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
1334
3786
  if (tenantId !== undefined && tenantId !== null)
@@ -1338,7 +3790,7 @@ class ProjectsApiClient extends ApiClientBase {
1338
3790
  method: "GET",
1339
3791
  url: url_,
1340
3792
  headers: {
1341
- "Accept": "text/plain"
3793
+ "Accept": "application/json"
1342
3794
  },
1343
3795
  cancelToken
1344
3796
  };
@@ -1404,7 +3856,7 @@ class ProjectsApiClient extends ApiClientBase {
1404
3856
  method: "GET",
1405
3857
  url: url_,
1406
3858
  headers: {
1407
- "Accept": "text/plain"
3859
+ "Accept": "application/json"
1408
3860
  },
1409
3861
  cancelToken
1410
3862
  };
@@ -1445,6 +3897,13 @@ class ProjectsApiClient extends ApiClientBase {
1445
3897
  result404 = JSON.parse(resultData404);
1446
3898
  return throwException("Not Found", status, _responseText, _headers, result404);
1447
3899
  }
3900
+ else if (status === 409) {
3901
+ const _responseText = response.data;
3902
+ let result409 = null;
3903
+ let resultData409 = _responseText;
3904
+ result409 = JSON.parse(resultData409);
3905
+ return throwException("Conflict", status, _responseText, _headers, result409);
3906
+ }
1448
3907
  else if (status === 401) {
1449
3908
  const _responseText = response.data;
1450
3909
  return throwException("Unauthorized", status, _responseText, _headers);
@@ -1513,6 +3972,13 @@ class ProjectsApiClient extends ApiClientBase {
1513
3972
  result404 = JSON.parse(resultData404);
1514
3973
  return throwException("Not Found", status, _responseText, _headers, result404);
1515
3974
  }
3975
+ else if (status === 409) {
3976
+ const _responseText = response.data;
3977
+ let result409 = null;
3978
+ let resultData409 = _responseText;
3979
+ result409 = JSON.parse(resultData409);
3980
+ return throwException("Conflict", status, _responseText, _headers, result409);
3981
+ }
1516
3982
  else if (status === 401) {
1517
3983
  const _responseText = response.data;
1518
3984
  return throwException("Unauthorized", status, _responseText, _headers);
@@ -1546,7 +4012,7 @@ class ProjectsApiClient extends ApiClientBase {
1546
4012
  method: "GET",
1547
4013
  url: url_,
1548
4014
  headers: {
1549
- "Accept": "text/plain"
4015
+ "Accept": "application/octet-stream"
1550
4016
  },
1551
4017
  cancelToken
1552
4018
  };
@@ -1586,6 +4052,13 @@ class ProjectsApiClient extends ApiClientBase {
1586
4052
  result404 = JSON.parse(resultData404);
1587
4053
  return throwException("Not Found", status, _responseText, _headers, result404);
1588
4054
  }
4055
+ else if (status === 409) {
4056
+ const _responseText = response.data;
4057
+ let result409 = null;
4058
+ let resultData409 = _responseText;
4059
+ result409 = JSON.parse(resultData409);
4060
+ return throwException("Conflict", status, _responseText, _headers, result409);
4061
+ }
1589
4062
  else if (status === 401) {
1590
4063
  const _responseText = response.data;
1591
4064
  return throwException("Unauthorized", status, _responseText, _headers);
@@ -1656,9 +4129,16 @@ class ProjectsApiClient extends ApiClientBase {
1656
4129
  const _responseText = response.data;
1657
4130
  let result404 = null;
1658
4131
  let resultData404 = _responseText;
1659
- result404 = resultData404;
4132
+ result404 = JSON.parse(resultData404);
1660
4133
  return throwException("Not Found", status, _responseText, _headers, result404);
1661
4134
  }
4135
+ else if (status === 409) {
4136
+ const _responseText = response.data;
4137
+ let result409 = null;
4138
+ let resultData409 = _responseText;
4139
+ result409 = JSON.parse(resultData409);
4140
+ return throwException("Conflict", status, _responseText, _headers, result409);
4141
+ }
1662
4142
  else if (status === 401) {
1663
4143
  const _responseText = response.data;
1664
4144
  return throwException("Unauthorized", status, _responseText, _headers);
@@ -1695,8 +4175,8 @@ class ProjectsApiClient extends ApiClientBase {
1695
4175
  method: "POST",
1696
4176
  url: url_,
1697
4177
  headers: {
1698
- "Content-Type": "application/json-patch+json",
1699
- "Accept": "text/plain"
4178
+ "Content-Type": "application/json",
4179
+ "Accept": "application/json"
1700
4180
  },
1701
4181
  cancelToken
1702
4182
  };
@@ -1780,8 +4260,8 @@ class ProjectsApiClient extends ApiClientBase {
1780
4260
  method: "POST",
1781
4261
  url: url_,
1782
4262
  headers: {
1783
- "Content-Type": "application/json-patch+json",
1784
- "Accept": "text/plain"
4263
+ "Content-Type": "application/json",
4264
+ "Accept": "application/json"
1785
4265
  },
1786
4266
  cancelToken
1787
4267
  };
@@ -1865,8 +4345,8 @@ class ProjectsApiClient extends ApiClientBase {
1865
4345
  method: "POST",
1866
4346
  url: url_,
1867
4347
  headers: {
1868
- "Content-Type": "application/json-patch+json",
1869
- "Accept": "text/plain"
4348
+ "Content-Type": "application/json",
4349
+ "Accept": "application/json"
1870
4350
  },
1871
4351
  cancelToken
1872
4352
  };
@@ -1950,8 +4430,8 @@ class ProjectsApiClient extends ApiClientBase {
1950
4430
  method: "POST",
1951
4431
  url: url_,
1952
4432
  headers: {
1953
- "Content-Type": "application/json-patch+json",
1954
- "Accept": "text/plain"
4433
+ "Content-Type": "application/json",
4434
+ "Accept": "application/json"
1955
4435
  },
1956
4436
  cancelToken
1957
4437
  };
@@ -2031,7 +4511,7 @@ class ProjectsApiClient extends ApiClientBase {
2031
4511
  method: "GET",
2032
4512
  url: url_,
2033
4513
  headers: {
2034
- "Accept": "text/plain"
4514
+ "Accept": "application/json"
2035
4515
  },
2036
4516
  cancelToken
2037
4517
  };
@@ -2122,7 +4602,7 @@ class ProjectsApiClient extends ApiClientBase {
2122
4602
  method: "POST",
2123
4603
  url: url_,
2124
4604
  headers: {
2125
- "Accept": "text/plain"
4605
+ "Accept": "application/json"
2126
4606
  },
2127
4607
  cancelToken
2128
4608
  };
@@ -2213,7 +4693,7 @@ class ProjectsApiClient extends ApiClientBase {
2213
4693
  method: "POST",
2214
4694
  url: url_,
2215
4695
  headers: {
2216
- "Accept": "text/plain"
4696
+ "Accept": "application/json"
2217
4697
  },
2218
4698
  cancelToken
2219
4699
  };
@@ -2261,6 +4741,80 @@ class ProjectsApiClient extends ApiClientBase {
2261
4741
  result404 = JSON.parse(resultData404);
2262
4742
  return throwException("Not Found", status, _responseText, _headers, result404);
2263
4743
  }
4744
+ else if (status === 409) {
4745
+ const _responseText = response.data;
4746
+ let result409 = null;
4747
+ let resultData409 = _responseText;
4748
+ result409 = JSON.parse(resultData409);
4749
+ return throwException("Conflict", status, _responseText, _headers, result409);
4750
+ }
4751
+ else if (status === 401) {
4752
+ const _responseText = response.data;
4753
+ return throwException("Unauthorized", status, _responseText, _headers);
4754
+ }
4755
+ else if (status === 403) {
4756
+ const _responseText = response.data;
4757
+ return throwException("Forbidden", status, _responseText, _headers);
4758
+ }
4759
+ else if (status !== 200 && status !== 204) {
4760
+ const _responseText = response.data;
4761
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
4762
+ }
4763
+ return Promise.resolve(null);
4764
+ }
4765
+ /**
4766
+ * Deletes specified projects.
4767
+ These projects will be hide from projects list immediately, but complete projects data cleaning will take some additional time.
4768
+ * @param tenantId (optional) Tenant identifier.
4769
+ * @param body (optional) Operation parameters.
4770
+ * @return Success
4771
+ */
4772
+ batchDelete(tenantId, body, cancelToken) {
4773
+ let url_ = this.baseUrl + "/api/storefront/v1/projects/batch-delete?";
4774
+ if (tenantId !== undefined && tenantId !== null)
4775
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
4776
+ url_ = url_.replace(/[?&]$/, "");
4777
+ const content_ = JSON.stringify(body);
4778
+ let options_ = {
4779
+ data: content_,
4780
+ method: "DELETE",
4781
+ url: url_,
4782
+ headers: {
4783
+ "Content-Type": "application/json",
4784
+ "Accept": "application/json"
4785
+ },
4786
+ cancelToken
4787
+ };
4788
+ return this.transformOptions(options_).then(transformedOptions_ => {
4789
+ return this.instance.request(transformedOptions_);
4790
+ }).catch((_error) => {
4791
+ if (isAxiosError(_error) && _error.response) {
4792
+ return _error.response;
4793
+ }
4794
+ else {
4795
+ throw _error;
4796
+ }
4797
+ }).then((_response) => {
4798
+ return this.transformResult(url_, _response, (_response) => this.processBatchDelete(_response));
4799
+ });
4800
+ }
4801
+ processBatchDelete(response) {
4802
+ const status = response.status;
4803
+ let _headers = {};
4804
+ if (response.headers && typeof response.headers === "object") {
4805
+ for (let k in response.headers) {
4806
+ if (response.headers.hasOwnProperty(k)) {
4807
+ _headers[k] = response.headers[k];
4808
+ }
4809
+ }
4810
+ }
4811
+ if (status === 200) {
4812
+ const _responseText = response.data;
4813
+ let result200 = null;
4814
+ let resultData200 = _responseText;
4815
+ result200 = JSON.parse(resultData200);
4816
+ return Promise.resolve(result200);
4817
+ }
2264
4818
  else if (status === 401) {
2265
4819
  const _responseText = response.data;
2266
4820
  return throwException("Unauthorized", status, _responseText, _headers);
@@ -2289,7 +4843,7 @@ class ProjectsApiClient extends ApiClientBase {
2289
4843
  method: "GET",
2290
4844
  url: url_,
2291
4845
  headers: {
2292
- "Accept": "text/plain"
4846
+ "Accept": "application/json"
2293
4847
  },
2294
4848
  cancelToken
2295
4849
  };
@@ -2351,7 +4905,7 @@ class ProjectsApiClient extends ApiClientBase {
2351
4905
  method: "GET",
2352
4906
  url: url_,
2353
4907
  headers: {
2354
- "Accept": "text/plain"
4908
+ "Accept": "application/json"
2355
4909
  },
2356
4910
  cancelToken
2357
4911
  };
@@ -2428,7 +4982,7 @@ class ProjectsApiClient extends ApiClientBase {
2428
4982
  method: "GET",
2429
4983
  url: url_,
2430
4984
  headers: {
2431
- "Accept": "text/plain"
4985
+ "Accept": "application/json"
2432
4986
  },
2433
4987
  cancelToken
2434
4988
  };
@@ -2462,6 +5016,13 @@ class ProjectsApiClient extends ApiClientBase {
2462
5016
  result200 = JSON.parse(resultData200);
2463
5017
  return Promise.resolve(result200);
2464
5018
  }
5019
+ else if (status === 409) {
5020
+ const _responseText = response.data;
5021
+ let result409 = null;
5022
+ let resultData409 = _responseText;
5023
+ result409 = JSON.parse(resultData409);
5024
+ return throwException("Conflict", status, _responseText, _headers, result409);
5025
+ }
2465
5026
  else if (status === 401) {
2466
5027
  const _responseText = response.data;
2467
5028
  return throwException("Unauthorized", status, _responseText, _headers);
@@ -2549,6 +5110,13 @@ class ProjectsApiClient extends ApiClientBase {
2549
5110
  result404 = JSON.parse(resultData404);
2550
5111
  return throwException("Not Found", status, _responseText, _headers, result404);
2551
5112
  }
5113
+ else if (status === 409) {
5114
+ const _responseText = response.data;
5115
+ let result409 = null;
5116
+ let resultData409 = _responseText;
5117
+ result409 = JSON.parse(resultData409);
5118
+ return throwException("Conflict", status, _responseText, _headers, result409);
5119
+ }
2552
5120
  else if (status === 401) {
2553
5121
  const _responseText = response.data;
2554
5122
  return throwException("Unauthorized", status, _responseText, _headers);
@@ -2584,7 +5152,7 @@ class ProjectsApiClient extends ApiClientBase {
2584
5152
  method: "GET",
2585
5153
  url: url_,
2586
5154
  headers: {
2587
- "Accept": "text/plain"
5155
+ "Accept": "application/json"
2588
5156
  },
2589
5157
  cancelToken
2590
5158
  };
@@ -2625,6 +5193,13 @@ class ProjectsApiClient extends ApiClientBase {
2625
5193
  result404 = JSON.parse(resultData404);
2626
5194
  return throwException("Not Found", status, _responseText, _headers, result404);
2627
5195
  }
5196
+ else if (status === 409) {
5197
+ const _responseText = response.data;
5198
+ let result409 = null;
5199
+ let resultData409 = _responseText;
5200
+ result409 = JSON.parse(resultData409);
5201
+ return throwException("Conflict", status, _responseText, _headers, result409);
5202
+ }
2628
5203
  else if (status === 401) {
2629
5204
  const _responseText = response.data;
2630
5205
  return throwException("Unauthorized", status, _responseText, _headers);
@@ -2696,6 +5271,13 @@ class ProjectsApiClient extends ApiClientBase {
2696
5271
  result404 = JSON.parse(resultData404);
2697
5272
  return throwException("Not Found", status, _responseText, _headers, result404);
2698
5273
  }
5274
+ else if (status === 409) {
5275
+ const _responseText = response.data;
5276
+ let result409 = null;
5277
+ let resultData409 = _responseText;
5278
+ result409 = JSON.parse(resultData409);
5279
+ return throwException("Conflict", status, _responseText, _headers, result409);
5280
+ }
2699
5281
  else if (status === 401) {
2700
5282
  const _responseText = response.data;
2701
5283
  return throwException("Unauthorized", status, _responseText, _headers);
@@ -2767,6 +5349,13 @@ class ProjectsApiClient extends ApiClientBase {
2767
5349
  result404 = JSON.parse(resultData404);
2768
5350
  return throwException("Not Found", status, _responseText, _headers, result404);
2769
5351
  }
5352
+ else if (status === 409) {
5353
+ const _responseText = response.data;
5354
+ let result409 = null;
5355
+ let resultData409 = _responseText;
5356
+ result409 = JSON.parse(resultData409);
5357
+ return throwException("Conflict", status, _responseText, _headers, result409);
5358
+ }
2770
5359
  else if (status === 401) {
2771
5360
  const _responseText = response.data;
2772
5361
  return throwException("Unauthorized", status, _responseText, _headers);
@@ -2840,6 +5429,13 @@ class ProjectsApiClient extends ApiClientBase {
2840
5429
  result404 = JSON.parse(resultData404);
2841
5430
  return throwException("Not Found", status, _responseText, _headers, result404);
2842
5431
  }
5432
+ else if (status === 409) {
5433
+ const _responseText = response.data;
5434
+ let result409 = null;
5435
+ let resultData409 = _responseText;
5436
+ result409 = JSON.parse(resultData409);
5437
+ return throwException("Conflict", status, _responseText, _headers, result409);
5438
+ }
2843
5439
  else if (status === 401) {
2844
5440
  const _responseText = response.data;
2845
5441
  return throwException("Unauthorized", status, _responseText, _headers);
@@ -2857,7 +5453,7 @@ class ProjectsApiClient extends ApiClientBase {
2857
5453
  /**
2858
5454
  * Attachs the specified data to the project's order in ecommerce system.
2859
5455
  * @param id Project identifier.
2860
- * @param itemId (optional)
5456
+ * @param itemId (optional) Project item identifier.
2861
5457
  * @param tenantId (optional) Tenant identifier.
2862
5458
  * @param body (optional) A list of data items, which should be attached to project's order.
2863
5459
  * @return Success
@@ -2878,7 +5474,7 @@ class ProjectsApiClient extends ApiClientBase {
2878
5474
  method: "POST",
2879
5475
  url: url_,
2880
5476
  headers: {
2881
- "Content-Type": "application/json-patch+json",
5477
+ "Content-Type": "application/json",
2882
5478
  },
2883
5479
  cancelToken
2884
5480
  };
@@ -2916,6 +5512,13 @@ class ProjectsApiClient extends ApiClientBase {
2916
5512
  result404 = JSON.parse(resultData404);
2917
5513
  return throwException("Not Found", status, _responseText, _headers, result404);
2918
5514
  }
5515
+ else if (status === 409) {
5516
+ const _responseText = response.data;
5517
+ let result409 = null;
5518
+ let resultData409 = _responseText;
5519
+ result409 = JSON.parse(resultData409);
5520
+ return throwException("Conflict", status, _responseText, _headers, result409);
5521
+ }
2919
5522
  else if (status === 401) {
2920
5523
  const _responseText = response.data;
2921
5524
  return throwException("Unauthorized", status, _responseText, _headers);
@@ -2970,7 +5573,7 @@ class StorefrontsApiClient extends ApiClientBase {
2970
5573
  method: "GET",
2971
5574
  url: url_,
2972
5575
  headers: {
2973
- "Accept": "text/plain"
5576
+ "Accept": "application/json"
2974
5577
  },
2975
5578
  cancelToken
2976
5579
  };
@@ -3036,7 +5639,7 @@ class StorefrontsApiClient extends ApiClientBase {
3036
5639
  method: "GET",
3037
5640
  url: url_,
3038
5641
  headers: {
3039
- "Accept": "text/plain"
5642
+ "Accept": "application/json"
3040
5643
  },
3041
5644
  cancelToken
3042
5645
  };
@@ -3077,6 +5680,13 @@ class StorefrontsApiClient extends ApiClientBase {
3077
5680
  result404 = JSON.parse(resultData404);
3078
5681
  return throwException("Not Found", status, _responseText, _headers, result404);
3079
5682
  }
5683
+ else if (status === 409) {
5684
+ const _responseText = response.data;
5685
+ let result409 = null;
5686
+ let resultData409 = _responseText;
5687
+ result409 = JSON.parse(resultData409);
5688
+ return throwException("Conflict", status, _responseText, _headers, result409);
5689
+ }
3080
5690
  else if (status === 401) {
3081
5691
  const _responseText = response.data;
3082
5692
  return throwException("Unauthorized", status, _responseText, _headers);
@@ -3136,7 +5746,7 @@ class StorefrontUsersApiClient extends ApiClientBase {
3136
5746
  method: "GET",
3137
5747
  url: url_,
3138
5748
  headers: {
3139
- "Accept": "text/plain"
5749
+ "Accept": "application/json"
3140
5750
  },
3141
5751
  cancelToken
3142
5752
  };
@@ -3170,6 +5780,13 @@ class StorefrontUsersApiClient extends ApiClientBase {
3170
5780
  result200 = JSON.parse(resultData200);
3171
5781
  return Promise.resolve(result200);
3172
5782
  }
5783
+ else if (status === 409) {
5784
+ const _responseText = response.data;
5785
+ let result409 = null;
5786
+ let resultData409 = _responseText;
5787
+ result409 = JSON.parse(resultData409);
5788
+ return throwException("Conflict", status, _responseText, _headers, result409);
5789
+ }
3173
5790
  else if (status === 401) {
3174
5791
  const _responseText = response.data;
3175
5792
  return throwException("Unauthorized", status, _responseText, _headers);
@@ -3206,8 +5823,8 @@ class StorefrontUsersApiClient extends ApiClientBase {
3206
5823
  method: "POST",
3207
5824
  url: url_,
3208
5825
  headers: {
3209
- "Content-Type": "application/json-patch+json",
3210
- "Accept": "text/plain"
5826
+ "Content-Type": "application/json",
5827
+ "Accept": "application/json"
3211
5828
  },
3212
5829
  cancelToken
3213
5830
  };
@@ -3285,7 +5902,7 @@ class StorefrontUsersApiClient extends ApiClientBase {
3285
5902
  method: "GET",
3286
5903
  url: url_,
3287
5904
  headers: {
3288
- "Accept": "text/plain"
5905
+ "Accept": "application/json"
3289
5906
  },
3290
5907
  cancelToken
3291
5908
  };
@@ -3326,6 +5943,13 @@ class StorefrontUsersApiClient extends ApiClientBase {
3326
5943
  result404 = JSON.parse(resultData404);
3327
5944
  return throwException("Not Found", status, _responseText, _headers, result404);
3328
5945
  }
5946
+ else if (status === 409) {
5947
+ const _responseText = response.data;
5948
+ let result409 = null;
5949
+ let resultData409 = _responseText;
5950
+ result409 = JSON.parse(resultData409);
5951
+ return throwException("Conflict", status, _responseText, _headers, result409);
5952
+ }
3329
5953
  else if (status === 401) {
3330
5954
  const _responseText = response.data;
3331
5955
  return throwException("Unauthorized", status, _responseText, _headers);
@@ -3362,8 +5986,8 @@ class StorefrontUsersApiClient extends ApiClientBase {
3362
5986
  method: "POST",
3363
5987
  url: url_,
3364
5988
  headers: {
3365
- "Content-Type": "application/json-patch+json",
3366
- "Accept": "text/plain"
5989
+ "Content-Type": "application/json",
5990
+ "Accept": "application/json"
3367
5991
  },
3368
5992
  cancelToken
3369
5993
  };
@@ -3440,7 +6064,7 @@ class StorefrontUsersApiClient extends ApiClientBase {
3440
6064
  method: "POST",
3441
6065
  url: url_,
3442
6066
  headers: {
3443
- "Content-Type": "application/json-patch+json",
6067
+ "Content-Type": "application/json",
3444
6068
  },
3445
6069
  cancelToken
3446
6070
  };
@@ -3561,14 +6185,14 @@ class StorefrontUsersApiClient extends ApiClientBase {
3561
6185
  const _responseText = response.data;
3562
6186
  let result404 = null;
3563
6187
  let resultData404 = _responseText;
3564
- result404 = resultData404;
6188
+ result404 = JSON.parse(resultData404);
3565
6189
  return throwException("Not Found", status, _responseText, _headers, result404);
3566
6190
  }
3567
6191
  else if (status === 409) {
3568
6192
  const _responseText = response.data;
3569
6193
  let result409 = null;
3570
6194
  let resultData409 = _responseText;
3571
- result409 = resultData409;
6195
+ result409 = JSON.parse(resultData409);
3572
6196
  return throwException("Conflict", status, _responseText, _headers, result409);
3573
6197
  }
3574
6198
  else if (status === 401) {
@@ -3610,7 +6234,7 @@ class TenantInfoApiClient extends ApiClientBase {
3610
6234
  method: "GET",
3611
6235
  url: url_,
3612
6236
  headers: {
3613
- "Accept": "text/plain"
6237
+ "Accept": "application/json"
3614
6238
  },
3615
6239
  cancelToken
3616
6240
  };
@@ -3672,7 +6296,7 @@ class TenantInfoApiClient extends ApiClientBase {
3672
6296
  method: "GET",
3673
6297
  url: url_,
3674
6298
  headers: {
3675
- "Accept": "text/plain"
6299
+ "Accept": "application/json"
3676
6300
  },
3677
6301
  cancelToken
3678
6302
  };
@@ -3734,7 +6358,7 @@ class TenantInfoApiClient extends ApiClientBase {
3734
6358
  method: "GET",
3735
6359
  url: url_,
3736
6360
  headers: {
3737
- "Accept": "text/plain"
6361
+ "Accept": "application/json"
3738
6362
  },
3739
6363
  cancelToken
3740
6364
  };
@@ -3796,7 +6420,7 @@ class TenantInfoApiClient extends ApiClientBase {
3796
6420
  method: "GET",
3797
6421
  url: url_,
3798
6422
  headers: {
3799
- "Accept": "text/plain"
6423
+ "Accept": "application/json"
3800
6424
  },
3801
6425
  cancelToken
3802
6426
  };
@@ -3846,6 +6470,32 @@ class TenantInfoApiClient extends ApiClientBase {
3846
6470
  }
3847
6471
  }
3848
6472
  exports.TenantInfoApiClient = TenantInfoApiClient;
6473
+ /** Available option types. */
6474
+ var OptionType;
6475
+ (function (OptionType) {
6476
+ OptionType["Simple"] = "Simple";
6477
+ OptionType["Size"] = "Size";
6478
+ OptionType["PageCount"] = "PageCount";
6479
+ })(OptionType = exports.OptionType || (exports.OptionType = {}));
6480
+ /** Conflict types. */
6481
+ var ConflictType;
6482
+ (function (ConflictType) {
6483
+ ConflictType["NameConflict"] = "NameConflict";
6484
+ ConflictType["FolderOverwriteConflict"] = "FolderOverwriteConflict";
6485
+ ConflictType["IdConflict"] = "IdConflict";
6486
+ ConflictType["GeneralConflict"] = "GeneralConflict";
6487
+ })(ConflictType = exports.ConflictType || (exports.ConflictType = {}));
6488
+ /** Available appearance types. */
6489
+ var AppearanceDataType;
6490
+ (function (AppearanceDataType) {
6491
+ AppearanceDataType["Radio"] = "Radio";
6492
+ AppearanceDataType["Dropdown"] = "Dropdown";
6493
+ AppearanceDataType["Chips"] = "Chips";
6494
+ AppearanceDataType["ColorGrid"] = "ColorGrid";
6495
+ AppearanceDataType["ColorList"] = "ColorList";
6496
+ AppearanceDataType["ImageGrid"] = "ImageGrid";
6497
+ AppearanceDataType["ImageList"] = "ImageList";
6498
+ })(AppearanceDataType = exports.AppearanceDataType || (exports.AppearanceDataType = {}));
3849
6499
  /** Type of editor that should be configured by workflow. */
3850
6500
  var WorkflowType;
3851
6501
  (function (WorkflowType) {
@@ -3854,6 +6504,34 @@ var WorkflowType;
3854
6504
  WorkflowType["DesignEditor"] = "DesignEditor";
3855
6505
  WorkflowType["WorkflowElements"] = "WorkflowElements";
3856
6506
  })(WorkflowType = exports.WorkflowType || (exports.WorkflowType = {}));
6507
+ /** Available product reference target types. */
6508
+ var ProductReferenceType;
6509
+ (function (ProductReferenceType) {
6510
+ ProductReferenceType["ProductSpecification"] = "ProductSpecification";
6511
+ ProductReferenceType["Product"] = "Product";
6512
+ ProductReferenceType["ProductLink"] = "ProductLink";
6513
+ })(ProductReferenceType = exports.ProductReferenceType || (exports.ProductReferenceType = {}));
6514
+ /** Available product variant resource types. */
6515
+ var ProductVariantResourceType;
6516
+ (function (ProductVariantResourceType) {
6517
+ ProductVariantResourceType["Preview"] = "Preview";
6518
+ ProductVariantResourceType["EditorModel"] = "EditorModel";
6519
+ ProductVariantResourceType["Custom"] = "Custom";
6520
+ })(ProductVariantResourceType = exports.ProductVariantResourceType || (exports.ProductVariantResourceType = {}));
6521
+ /** Available mockup types. */
6522
+ var ProductVariantMockupType;
6523
+ (function (ProductVariantMockupType) {
6524
+ ProductVariantMockupType["Thumbnail"] = "Thumbnail";
6525
+ ProductVariantMockupType["Editor"] = "Editor";
6526
+ ProductVariantMockupType["Preview"] = "Preview";
6527
+ })(ProductVariantMockupType = exports.ProductVariantMockupType || (exports.ProductVariantMockupType = {}));
6528
+ /** Available surface usage types. */
6529
+ var SurfaceUsageType;
6530
+ (function (SurfaceUsageType) {
6531
+ SurfaceUsageType["Individual"] = "Individual";
6532
+ SurfaceUsageType["Custom"] = "Custom";
6533
+ SurfaceUsageType["All"] = "All";
6534
+ })(SurfaceUsageType = exports.SurfaceUsageType || (exports.SurfaceUsageType = {}));
3857
6535
  /** Defines all available date period filter values for queries. */
3858
6536
  var DatePeriod;
3859
6537
  (function (DatePeriod) {
@@ -3898,6 +6576,14 @@ var RenderHiResScenarioOutputFlipMode;
3898
6576
  RenderHiResScenarioOutputFlipMode["Vertical"] = "Vertical";
3899
6577
  RenderHiResScenarioOutputFlipMode["Both"] = "Both";
3900
6578
  })(RenderHiResScenarioOutputFlipMode = exports.RenderHiResScenarioOutputFlipMode || (exports.RenderHiResScenarioOutputFlipMode = {}));
6579
+ var RenderHiResScenarioOutputRotateMode;
6580
+ (function (RenderHiResScenarioOutputRotateMode) {
6581
+ RenderHiResScenarioOutputRotateMode["None"] = "None";
6582
+ RenderHiResScenarioOutputRotateMode["Rotate90"] = "Rotate90";
6583
+ RenderHiResScenarioOutputRotateMode["Rotate180"] = "Rotate180";
6584
+ RenderHiResScenarioOutputRotateMode["Rotate270"] = "Rotate270";
6585
+ RenderHiResScenarioOutputRotateMode["Auto"] = "Auto";
6586
+ })(RenderHiResScenarioOutputRotateMode = exports.RenderHiResScenarioOutputRotateMode || (exports.RenderHiResScenarioOutputRotateMode = {}));
3901
6587
  /** Available value types for order data item. */
3902
6588
  var OrderDataItemValueType;
3903
6589
  (function (OrderDataItemValueType) {