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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -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,99 @@ 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) {
536
+ const status = response.status;
537
+ let _headers = {};
538
+ if (response.headers && typeof response.headers === "object") {
539
+ for (let k in response.headers) {
540
+ if (response.headers.hasOwnProperty(k)) {
541
+ _headers[k] = response.headers[k];
542
+ }
543
+ }
544
+ }
545
+ if (status === 200) {
546
+ const _responseText = response.data;
547
+ let result200 = null;
548
+ let resultData200 = _responseText;
549
+ result200 = JSON.parse(resultData200);
550
+ return Promise.resolve(result200);
551
+ }
552
+ else if (status === 404) {
553
+ const _responseText = response.data;
554
+ let result404 = null;
555
+ let resultData404 = _responseText;
556
+ result404 = JSON.parse(resultData404);
557
+ return throwException("Not Found", status, _responseText, _headers, result404);
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
+ }
566
+ else if (status === 401) {
567
+ const _responseText = response.data;
568
+ return throwException("Unauthorized", status, _responseText, _headers);
569
+ }
570
+ else if (status === 403) {
571
+ const _responseText = response.data;
572
+ return throwException("Forbidden", status, _responseText, _headers);
573
+ }
574
+ else if (status !== 200 && status !== 204) {
575
+ const _responseText = response.data;
576
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
577
+ }
578
+ return Promise.resolve(null);
579
+ }
580
+ /**
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.
586
+ * @param tenantId (optional) Tenant identifier.
587
+ * @return Success
588
+ */
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) + "&";
600
+ if (tenantId !== undefined && tenantId !== null)
601
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
602
+ url_ = url_.replace(/[?&]$/, "");
603
+ let options_ = {
604
+ method: "GET",
605
+ url: url_,
606
+ headers: {
607
+ "Accept": "application/json"
608
+ },
609
+ cancelToken
610
+ };
611
+ return this.transformOptions(options_).then(transformedOptions_ => {
612
+ return this.instance.request(transformedOptions_);
613
+ }).catch((_error) => {
614
+ if (isAxiosError(_error) && _error.response) {
615
+ return _error.response;
616
+ }
617
+ else {
618
+ throw _error;
619
+ }
620
+ }).then((_response) => {
621
+ return this.transformResult(url_, _response, (_response) => this.processGetPersonalizationWorkflow(_response));
622
+ });
623
+ }
624
+ processGetPersonalizationWorkflow(response) {
532
625
  const status = response.status;
533
626
  let _headers = {};
534
627
  if (response.headers && typeof response.headers === "object") {
@@ -552,6 +645,2339 @@ class ProductReferencesApiClient extends ApiClientBase {
552
645
  result404 = JSON.parse(resultData404);
553
646
  return throwException("Not Found", status, _responseText, _headers, result404);
554
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
+ }
655
+ else if (status === 401) {
656
+ const _responseText = response.data;
657
+ return throwException("Unauthorized", status, _responseText, _headers);
658
+ }
659
+ else if (status === 403) {
660
+ const _responseText = response.data;
661
+ return throwException("Forbidden", status, _responseText, _headers);
662
+ }
663
+ else if (status !== 200 && status !== 204) {
664
+ const _responseText = response.data;
665
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
666
+ }
667
+ return Promise.resolve(null);
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
+ }
680
+ /**
681
+ * Returns all storefront product references relevant to the specified query parameters.
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"}.
695
+ * @param tenantId (optional) Tenant identifier.
696
+ * @return Success
697
+ */
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?";
700
+ if (storefrontId === undefined || storefrontId === null)
701
+ throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
702
+ else
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) + "&";
726
+ if (tenantId !== undefined && tenantId !== null)
727
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
728
+ url_ = url_.replace(/[?&]$/, "");
729
+ let options_ = {
730
+ method: "GET",
731
+ url: url_,
732
+ headers: {
733
+ "Accept": "application/json"
734
+ },
735
+ cancelToken
736
+ };
737
+ return this.transformOptions(options_).then(transformedOptions_ => {
738
+ return this.instance.request(transformedOptions_);
739
+ }).catch((_error) => {
740
+ if (isAxiosError(_error) && _error.response) {
741
+ return _error.response;
742
+ }
743
+ else {
744
+ throw _error;
745
+ }
746
+ }).then((_response) => {
747
+ return this.transformResult(url_, _response, (_response) => this.processGetAll(_response));
748
+ });
749
+ }
750
+ processGetAll(response) {
751
+ const status = response.status;
752
+ let _headers = {};
753
+ if (response.headers && typeof response.headers === "object") {
754
+ for (let k in response.headers) {
755
+ if (response.headers.hasOwnProperty(k)) {
756
+ _headers[k] = response.headers[k];
757
+ }
758
+ }
759
+ }
760
+ if (status === 200) {
761
+ const _responseText = response.data;
762
+ let result200 = null;
763
+ let resultData200 = _responseText;
764
+ result200 = JSON.parse(resultData200);
765
+ return Promise.resolve(result200);
766
+ }
767
+ else if (status === 409) {
768
+ const _responseText = response.data;
769
+ let result409 = null;
770
+ let resultData409 = _responseText;
771
+ result409 = JSON.parse(resultData409);
772
+ return throwException("Conflict", status, _responseText, _headers, result409);
773
+ }
774
+ else if (status === 401) {
775
+ const _responseText = response.data;
776
+ return throwException("Unauthorized", status, _responseText, _headers);
777
+ }
778
+ else if (status === 403) {
779
+ const _responseText = response.data;
780
+ return throwException("Forbidden", status, _responseText, _headers);
781
+ }
782
+ else if (status !== 200 && status !== 204) {
783
+ const _responseText = response.data;
784
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
785
+ }
786
+ return Promise.resolve(null);
787
+ }
788
+ /**
789
+ * Creates a new storefront product reference.
790
+ * @param storefrontId Storefront identifier.
791
+ * @param tenantId (optional) Tenant identifier.
792
+ * @param body (optional) Create operation parameters.
793
+ * @return Success
794
+ */
795
+ create(storefrontId, tenantId, body, cancelToken) {
796
+ let url_ = this.baseUrl + "/api/storefront/v1/product-references?";
797
+ if (storefrontId === undefined || storefrontId === null)
798
+ throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
799
+ else
800
+ url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
801
+ if (tenantId !== undefined && tenantId !== null)
802
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
803
+ url_ = url_.replace(/[?&]$/, "");
804
+ const content_ = JSON.stringify(body);
805
+ let options_ = {
806
+ data: content_,
807
+ method: "POST",
808
+ url: url_,
809
+ headers: {
810
+ "Content-Type": "application/json",
811
+ "Accept": "application/json"
812
+ },
813
+ cancelToken
814
+ };
815
+ return this.transformOptions(options_).then(transformedOptions_ => {
816
+ return this.instance.request(transformedOptions_);
817
+ }).catch((_error) => {
818
+ if (isAxiosError(_error) && _error.response) {
819
+ return _error.response;
820
+ }
821
+ else {
822
+ throw _error;
823
+ }
824
+ }).then((_response) => {
825
+ return this.transformResult(url_, _response, (_response) => this.processCreate(_response));
826
+ });
827
+ }
828
+ processCreate(response) {
829
+ const status = response.status;
830
+ let _headers = {};
831
+ if (response.headers && typeof response.headers === "object") {
832
+ for (let k in response.headers) {
833
+ if (response.headers.hasOwnProperty(k)) {
834
+ _headers[k] = response.headers[k];
835
+ }
836
+ }
837
+ }
838
+ if (status === 201) {
839
+ const _responseText = response.data;
840
+ let result201 = null;
841
+ let resultData201 = _responseText;
842
+ result201 = JSON.parse(resultData201);
843
+ return Promise.resolve(result201);
844
+ }
845
+ else if (status === 404) {
846
+ const _responseText = response.data;
847
+ let result404 = null;
848
+ let resultData404 = _responseText;
849
+ result404 = JSON.parse(resultData404);
850
+ return throwException("Not Found", status, _responseText, _headers, result404);
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
+ }
859
+ else if (status === 401) {
860
+ const _responseText = response.data;
861
+ return throwException("Unauthorized", status, _responseText, _headers);
862
+ }
863
+ else if (status === 403) {
864
+ const _responseText = response.data;
865
+ return throwException("Forbidden", status, _responseText, _headers);
866
+ }
867
+ else if (status !== 200 && status !== 204) {
868
+ const _responseText = response.data;
869
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
870
+ }
871
+ return Promise.resolve(null);
872
+ }
873
+ /**
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"}.
888
+ * @param tenantId (optional) Tenant identifier.
889
+ * @return Success
890
+ */
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
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) + "&";
919
+ if (tenantId !== undefined && tenantId !== null)
920
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
921
+ url_ = url_.replace(/[?&]$/, "");
922
+ let options_ = {
923
+ method: "GET",
924
+ url: url_,
925
+ headers: {
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
+ }
555
2981
  else if (status === 401) {
556
2982
  const _responseText = response.data;
557
2983
  return throwException("Unauthorized", status, _responseText, _headers);
@@ -567,29 +2993,57 @@ class ProductReferencesApiClient extends ApiClientBase {
567
2993
  return Promise.resolve(null);
568
2994
  }
569
2995
  /**
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.
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.
573
3009
  * @param tenantId (optional) Tenant identifier.
574
3010
  * @return Success
575
3011
  */
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) + "&";
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) + "&";
585
3039
  if (tenantId !== undefined && tenantId !== null)
586
3040
  url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
587
3041
  url_ = url_.replace(/[?&]$/, "");
588
3042
  let options_ = {
589
- method: "DELETE",
3043
+ method: "GET",
590
3044
  url: url_,
591
3045
  headers: {
592
- "Accept": "text/plain"
3046
+ "Accept": "application/json"
593
3047
  },
594
3048
  cancelToken
595
3049
  };
@@ -603,10 +3057,10 @@ class ProductReferencesApiClient extends ApiClientBase {
603
3057
  throw _error;
604
3058
  }
605
3059
  }).then((_response) => {
606
- return this.transformResult(url_, _response, (_response) => this.processDelete(_response));
3060
+ return this.transformResult(url_, _response, (_response) => this.processGetProductVariantDocuments(_response));
607
3061
  });
608
3062
  }
609
- processDelete(response) {
3063
+ processGetProductVariantDocuments(response) {
610
3064
  const status = response.status;
611
3065
  let _headers = {};
612
3066
  if (response.headers && typeof response.headers === "object") {
@@ -630,6 +3084,13 @@ class ProductReferencesApiClient extends ApiClientBase {
630
3084
  result404 = JSON.parse(resultData404);
631
3085
  return throwException("Not Found", status, _responseText, _headers, result404);
632
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
+ }
633
3094
  else if (status === 401) {
634
3095
  const _responseText = response.data;
635
3096
  return throwException("Unauthorized", status, _responseText, _headers);
@@ -645,30 +3106,26 @@ class ProductReferencesApiClient extends ApiClientBase {
645
3106
  return Promise.resolve(null);
646
3107
  }
647
3108
  /**
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.
650
- * @param storefrontId Storefront identifier.
3109
+ * Updates product variant resources.
3110
+ * @param id Product identifier.
3111
+ * @param productVersionId (optional) Product version identifier.
651
3112
  * @param tenantId (optional) Tenant identifier.
652
3113
  * @return Success
653
3114
  */
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));
659
- if (storefrontId === undefined || storefrontId === null)
660
- throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
661
- else
662
- url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
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) + "&";
663
3122
  if (tenantId !== undefined && tenantId !== null)
664
3123
  url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
665
3124
  url_ = url_.replace(/[?&]$/, "");
666
3125
  let options_ = {
667
- method: "GET",
3126
+ method: "POST",
668
3127
  url: url_,
669
- headers: {
670
- "Accept": "text/plain"
671
- },
3128
+ headers: {},
672
3129
  cancelToken
673
3130
  };
674
3131
  return this.transformOptions(options_).then(transformedOptions_ => {
@@ -681,10 +3138,10 @@ class ProductReferencesApiClient extends ApiClientBase {
681
3138
  throw _error;
682
3139
  }
683
3140
  }).then((_response) => {
684
- return this.transformResult(url_, _response, (_response) => this.processGetProductSpecification(_response));
3141
+ return this.transformResult(url_, _response, (_response) => this.processUpdateProductVariantResources(_response));
685
3142
  });
686
3143
  }
687
- processGetProductSpecification(response) {
3144
+ processUpdateProductVariantResources(response) {
688
3145
  const status = response.status;
689
3146
  let _headers = {};
690
3147
  if (response.headers && typeof response.headers === "object") {
@@ -696,10 +3153,7 @@ class ProductReferencesApiClient extends ApiClientBase {
696
3153
  }
697
3154
  if (status === 200) {
698
3155
  const _responseText = response.data;
699
- let result200 = null;
700
- let resultData200 = _responseText;
701
- result200 = JSON.parse(resultData200);
702
- return Promise.resolve(result200);
3156
+ return Promise.resolve(null);
703
3157
  }
704
3158
  else if (status === 404) {
705
3159
  const _responseText = response.data;
@@ -708,6 +3162,13 @@ class ProductReferencesApiClient extends ApiClientBase {
708
3162
  result404 = JSON.parse(resultData404);
709
3163
  return throwException("Not Found", status, _responseText, _headers, result404);
710
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
+ }
711
3172
  else if (status === 401) {
712
3173
  const _responseText = response.data;
713
3174
  return throwException("Unauthorized", status, _responseText, _headers);
@@ -723,45 +3184,30 @@ class ProductReferencesApiClient extends ApiClientBase {
723
3184
  return Promise.resolve(null);
724
3185
  }
725
3186
  /**
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.
729
- * @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.
3187
+ * Set product variant price.
3188
+ * @param id Product identifier.
3189
+ * @param productVersionId (optional) Product version identifier.
733
3190
  * @param tenantId (optional) Tenant identifier.
3191
+ * @param body (optional) Set product variant price operation parameters.
734
3192
  * @return Success
735
3193
  */
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) + "&";
745
- if (storefrontId === undefined || storefrontId === null)
746
- throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
747
- else
748
- 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) + "&";
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) + "&";
757
3201
  if (tenantId !== undefined && tenantId !== null)
758
3202
  url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
759
3203
  url_ = url_.replace(/[?&]$/, "");
3204
+ const content_ = JSON.stringify(body);
760
3205
  let options_ = {
761
- method: "GET",
3206
+ data: content_,
3207
+ method: "POST",
762
3208
  url: url_,
763
3209
  headers: {
764
- "Accept": "text/plain"
3210
+ "Content-Type": "application/json",
765
3211
  },
766
3212
  cancelToken
767
3213
  };
@@ -775,10 +3221,10 @@ class ProductReferencesApiClient extends ApiClientBase {
775
3221
  throw _error;
776
3222
  }
777
3223
  }).then((_response) => {
778
- return this.transformResult(url_, _response, (_response) => this.processGetProductCostDetails(_response));
3224
+ return this.transformResult(url_, _response, (_response) => this.processSetProductVariantPrice(_response));
779
3225
  });
780
3226
  }
781
- processGetProductCostDetails(response) {
3227
+ processSetProductVariantPrice(response) {
782
3228
  const status = response.status;
783
3229
  let _headers = {};
784
3230
  if (response.headers && typeof response.headers === "object") {
@@ -790,10 +3236,7 @@ class ProductReferencesApiClient extends ApiClientBase {
790
3236
  }
791
3237
  if (status === 200) {
792
3238
  const _responseText = response.data;
793
- let result200 = null;
794
- let resultData200 = _responseText;
795
- result200 = JSON.parse(resultData200);
796
- return Promise.resolve(result200);
3239
+ return Promise.resolve(null);
797
3240
  }
798
3241
  else if (status === 404) {
799
3242
  const _responseText = response.data;
@@ -802,6 +3245,13 @@ class ProductReferencesApiClient extends ApiClientBase {
802
3245
  result404 = JSON.parse(resultData404);
803
3246
  return throwException("Not Found", status, _responseText, _headers, result404);
804
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
+ }
805
3255
  else if (status === 401) {
806
3256
  const _responseText = response.data;
807
3257
  return throwException("Unauthorized", status, _responseText, _headers);
@@ -817,21 +3267,15 @@ class ProductReferencesApiClient extends ApiClientBase {
817
3267
  return Promise.resolve(null);
818
3268
  }
819
3269
  /**
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.
3270
+ * Returns a list of all available product tags.
3271
+ * @param search (optional) Search string for partial match.
823
3272
  * @param tenantId (optional) Tenant identifier.
824
3273
  * @return Success
825
3274
  */
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)
834
- url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
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) + "&";
835
3279
  if (tenantId !== undefined && tenantId !== null)
836
3280
  url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
837
3281
  url_ = url_.replace(/[?&]$/, "");
@@ -839,7 +3283,7 @@ class ProductReferencesApiClient extends ApiClientBase {
839
3283
  method: "GET",
840
3284
  url: url_,
841
3285
  headers: {
842
- "Accept": "text/plain"
3286
+ "Accept": "application/json"
843
3287
  },
844
3288
  cancelToken
845
3289
  };
@@ -853,10 +3297,10 @@ class ProductReferencesApiClient extends ApiClientBase {
853
3297
  throw _error;
854
3298
  }
855
3299
  }).then((_response) => {
856
- return this.transformResult(url_, _response, (_response) => this.processGetPersonalizationWorkflow(_response));
3300
+ return this.transformResult(url_, _response, (_response) => this.processGetAvailableProductTags(_response));
857
3301
  });
858
3302
  }
859
- processGetPersonalizationWorkflow(response) {
3303
+ processGetAvailableProductTags(response) {
860
3304
  const status = response.status;
861
3305
  let _headers = {};
862
3306
  if (response.headers && typeof response.headers === "object") {
@@ -873,13 +3317,6 @@ class ProductReferencesApiClient extends ApiClientBase {
873
3317
  result200 = JSON.parse(resultData200);
874
3318
  return Promise.resolve(result200);
875
3319
  }
876
- else if (status === 404) {
877
- const _responseText = response.data;
878
- let result404 = null;
879
- let resultData404 = _responseText;
880
- result404 = JSON.parse(resultData404);
881
- return throwException("Not Found", status, _responseText, _headers, result404);
882
- }
883
3320
  else if (status === 401) {
884
3321
  const _responseText = response.data;
885
3322
  return throwException("Unauthorized", status, _responseText, _headers);
@@ -895,22 +3332,25 @@ class ProductReferencesApiClient extends ApiClientBase {
895
3332
  return Promise.resolve(null);
896
3333
  }
897
3334
  /**
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.
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) {
@@ -1343,7 +3790,7 @@ class ProjectsApiClient extends ApiClientBase {
1343
3790
  method: "GET",
1344
3791
  url: url_,
1345
3792
  headers: {
1346
- "Accept": "text/plain"
3793
+ "Accept": "application/json"
1347
3794
  },
1348
3795
  cancelToken
1349
3796
  };
@@ -1409,7 +3856,7 @@ class ProjectsApiClient extends ApiClientBase {
1409
3856
  method: "GET",
1410
3857
  url: url_,
1411
3858
  headers: {
1412
- "Accept": "text/plain"
3859
+ "Accept": "application/json"
1413
3860
  },
1414
3861
  cancelToken
1415
3862
  };
@@ -1565,7 +4012,7 @@ class ProjectsApiClient extends ApiClientBase {
1565
4012
  method: "GET",
1566
4013
  url: url_,
1567
4014
  headers: {
1568
- "Accept": "text/plain"
4015
+ "Accept": "application/octet-stream"
1569
4016
  },
1570
4017
  cancelToken
1571
4018
  };
@@ -1682,14 +4129,14 @@ class ProjectsApiClient extends ApiClientBase {
1682
4129
  const _responseText = response.data;
1683
4130
  let result404 = null;
1684
4131
  let resultData404 = _responseText;
1685
- result404 = resultData404;
4132
+ result404 = JSON.parse(resultData404);
1686
4133
  return throwException("Not Found", status, _responseText, _headers, result404);
1687
4134
  }
1688
4135
  else if (status === 409) {
1689
4136
  const _responseText = response.data;
1690
4137
  let result409 = null;
1691
4138
  let resultData409 = _responseText;
1692
- result409 = resultData409;
4139
+ result409 = JSON.parse(resultData409);
1693
4140
  return throwException("Conflict", status, _responseText, _headers, result409);
1694
4141
  }
1695
4142
  else if (status === 401) {
@@ -1728,8 +4175,8 @@ class ProjectsApiClient extends ApiClientBase {
1728
4175
  method: "POST",
1729
4176
  url: url_,
1730
4177
  headers: {
1731
- "Content-Type": "application/json-patch+json",
1732
- "Accept": "text/plain"
4178
+ "Content-Type": "application/json",
4179
+ "Accept": "application/json"
1733
4180
  },
1734
4181
  cancelToken
1735
4182
  };
@@ -1813,8 +4260,8 @@ class ProjectsApiClient extends ApiClientBase {
1813
4260
  method: "POST",
1814
4261
  url: url_,
1815
4262
  headers: {
1816
- "Content-Type": "application/json-patch+json",
1817
- "Accept": "text/plain"
4263
+ "Content-Type": "application/json",
4264
+ "Accept": "application/json"
1818
4265
  },
1819
4266
  cancelToken
1820
4267
  };
@@ -1898,8 +4345,8 @@ class ProjectsApiClient extends ApiClientBase {
1898
4345
  method: "POST",
1899
4346
  url: url_,
1900
4347
  headers: {
1901
- "Content-Type": "application/json-patch+json",
1902
- "Accept": "text/plain"
4348
+ "Content-Type": "application/json",
4349
+ "Accept": "application/json"
1903
4350
  },
1904
4351
  cancelToken
1905
4352
  };
@@ -1983,8 +4430,8 @@ class ProjectsApiClient extends ApiClientBase {
1983
4430
  method: "POST",
1984
4431
  url: url_,
1985
4432
  headers: {
1986
- "Content-Type": "application/json-patch+json",
1987
- "Accept": "text/plain"
4433
+ "Content-Type": "application/json",
4434
+ "Accept": "application/json"
1988
4435
  },
1989
4436
  cancelToken
1990
4437
  };
@@ -2064,7 +4511,7 @@ class ProjectsApiClient extends ApiClientBase {
2064
4511
  method: "GET",
2065
4512
  url: url_,
2066
4513
  headers: {
2067
- "Accept": "text/plain"
4514
+ "Accept": "application/json"
2068
4515
  },
2069
4516
  cancelToken
2070
4517
  };
@@ -2155,7 +4602,7 @@ class ProjectsApiClient extends ApiClientBase {
2155
4602
  method: "POST",
2156
4603
  url: url_,
2157
4604
  headers: {
2158
- "Accept": "text/plain"
4605
+ "Accept": "application/json"
2159
4606
  },
2160
4607
  cancelToken
2161
4608
  };
@@ -2246,7 +4693,7 @@ class ProjectsApiClient extends ApiClientBase {
2246
4693
  method: "POST",
2247
4694
  url: url_,
2248
4695
  headers: {
2249
- "Accept": "text/plain"
4696
+ "Accept": "application/json"
2250
4697
  },
2251
4698
  cancelToken
2252
4699
  };
@@ -2319,7 +4766,7 @@ class ProjectsApiClient extends ApiClientBase {
2319
4766
  * Deletes specified projects.
2320
4767
  These projects will be hide from projects list immediately, but complete projects data cleaning will take some additional time.
2321
4768
  * @param tenantId (optional) Tenant identifier.
2322
- * @param body (optional)
4769
+ * @param body (optional) Operation parameters.
2323
4770
  * @return Success
2324
4771
  */
2325
4772
  batchDelete(tenantId, body, cancelToken) {
@@ -2333,8 +4780,8 @@ class ProjectsApiClient extends ApiClientBase {
2333
4780
  method: "DELETE",
2334
4781
  url: url_,
2335
4782
  headers: {
2336
- "Content-Type": "application/json-patch+json",
2337
- "Accept": "text/plain"
4783
+ "Content-Type": "application/json",
4784
+ "Accept": "application/json"
2338
4785
  },
2339
4786
  cancelToken
2340
4787
  };
@@ -2396,7 +4843,7 @@ class ProjectsApiClient extends ApiClientBase {
2396
4843
  method: "GET",
2397
4844
  url: url_,
2398
4845
  headers: {
2399
- "Accept": "text/plain"
4846
+ "Accept": "application/json"
2400
4847
  },
2401
4848
  cancelToken
2402
4849
  };
@@ -2458,7 +4905,7 @@ class ProjectsApiClient extends ApiClientBase {
2458
4905
  method: "GET",
2459
4906
  url: url_,
2460
4907
  headers: {
2461
- "Accept": "text/plain"
4908
+ "Accept": "application/json"
2462
4909
  },
2463
4910
  cancelToken
2464
4911
  };
@@ -2535,7 +4982,7 @@ class ProjectsApiClient extends ApiClientBase {
2535
4982
  method: "GET",
2536
4983
  url: url_,
2537
4984
  headers: {
2538
- "Accept": "text/plain"
4985
+ "Accept": "application/json"
2539
4986
  },
2540
4987
  cancelToken
2541
4988
  };
@@ -2705,7 +5152,7 @@ class ProjectsApiClient extends ApiClientBase {
2705
5152
  method: "GET",
2706
5153
  url: url_,
2707
5154
  headers: {
2708
- "Accept": "text/plain"
5155
+ "Accept": "application/json"
2709
5156
  },
2710
5157
  cancelToken
2711
5158
  };
@@ -3006,7 +5453,7 @@ class ProjectsApiClient extends ApiClientBase {
3006
5453
  /**
3007
5454
  * Attachs the specified data to the project's order in ecommerce system.
3008
5455
  * @param id Project identifier.
3009
- * @param itemId (optional)
5456
+ * @param itemId (optional) Project item identifier.
3010
5457
  * @param tenantId (optional) Tenant identifier.
3011
5458
  * @param body (optional) A list of data items, which should be attached to project's order.
3012
5459
  * @return Success
@@ -3027,7 +5474,7 @@ class ProjectsApiClient extends ApiClientBase {
3027
5474
  method: "POST",
3028
5475
  url: url_,
3029
5476
  headers: {
3030
- "Content-Type": "application/json-patch+json",
5477
+ "Content-Type": "application/json",
3031
5478
  },
3032
5479
  cancelToken
3033
5480
  };
@@ -3126,7 +5573,7 @@ class StorefrontsApiClient extends ApiClientBase {
3126
5573
  method: "GET",
3127
5574
  url: url_,
3128
5575
  headers: {
3129
- "Accept": "text/plain"
5576
+ "Accept": "application/json"
3130
5577
  },
3131
5578
  cancelToken
3132
5579
  };
@@ -3192,7 +5639,7 @@ class StorefrontsApiClient extends ApiClientBase {
3192
5639
  method: "GET",
3193
5640
  url: url_,
3194
5641
  headers: {
3195
- "Accept": "text/plain"
5642
+ "Accept": "application/json"
3196
5643
  },
3197
5644
  cancelToken
3198
5645
  };
@@ -3299,7 +5746,7 @@ class StorefrontUsersApiClient extends ApiClientBase {
3299
5746
  method: "GET",
3300
5747
  url: url_,
3301
5748
  headers: {
3302
- "Accept": "text/plain"
5749
+ "Accept": "application/json"
3303
5750
  },
3304
5751
  cancelToken
3305
5752
  };
@@ -3333,6 +5780,13 @@ class StorefrontUsersApiClient extends ApiClientBase {
3333
5780
  result200 = JSON.parse(resultData200);
3334
5781
  return Promise.resolve(result200);
3335
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
+ }
3336
5790
  else if (status === 401) {
3337
5791
  const _responseText = response.data;
3338
5792
  return throwException("Unauthorized", status, _responseText, _headers);
@@ -3369,8 +5823,8 @@ class StorefrontUsersApiClient extends ApiClientBase {
3369
5823
  method: "POST",
3370
5824
  url: url_,
3371
5825
  headers: {
3372
- "Content-Type": "application/json-patch+json",
3373
- "Accept": "text/plain"
5826
+ "Content-Type": "application/json",
5827
+ "Accept": "application/json"
3374
5828
  },
3375
5829
  cancelToken
3376
5830
  };
@@ -3448,7 +5902,7 @@ class StorefrontUsersApiClient extends ApiClientBase {
3448
5902
  method: "GET",
3449
5903
  url: url_,
3450
5904
  headers: {
3451
- "Accept": "text/plain"
5905
+ "Accept": "application/json"
3452
5906
  },
3453
5907
  cancelToken
3454
5908
  };
@@ -3532,8 +5986,8 @@ class StorefrontUsersApiClient extends ApiClientBase {
3532
5986
  method: "POST",
3533
5987
  url: url_,
3534
5988
  headers: {
3535
- "Content-Type": "application/json-patch+json",
3536
- "Accept": "text/plain"
5989
+ "Content-Type": "application/json",
5990
+ "Accept": "application/json"
3537
5991
  },
3538
5992
  cancelToken
3539
5993
  };
@@ -3610,7 +6064,7 @@ class StorefrontUsersApiClient extends ApiClientBase {
3610
6064
  method: "POST",
3611
6065
  url: url_,
3612
6066
  headers: {
3613
- "Content-Type": "application/json-patch+json",
6067
+ "Content-Type": "application/json",
3614
6068
  },
3615
6069
  cancelToken
3616
6070
  };
@@ -3731,14 +6185,14 @@ class StorefrontUsersApiClient extends ApiClientBase {
3731
6185
  const _responseText = response.data;
3732
6186
  let result404 = null;
3733
6187
  let resultData404 = _responseText;
3734
- result404 = resultData404;
6188
+ result404 = JSON.parse(resultData404);
3735
6189
  return throwException("Not Found", status, _responseText, _headers, result404);
3736
6190
  }
3737
6191
  else if (status === 409) {
3738
6192
  const _responseText = response.data;
3739
6193
  let result409 = null;
3740
6194
  let resultData409 = _responseText;
3741
- result409 = resultData409;
6195
+ result409 = JSON.parse(resultData409);
3742
6196
  return throwException("Conflict", status, _responseText, _headers, result409);
3743
6197
  }
3744
6198
  else if (status === 401) {
@@ -3780,7 +6234,7 @@ class TenantInfoApiClient extends ApiClientBase {
3780
6234
  method: "GET",
3781
6235
  url: url_,
3782
6236
  headers: {
3783
- "Accept": "text/plain"
6237
+ "Accept": "application/json"
3784
6238
  },
3785
6239
  cancelToken
3786
6240
  };
@@ -3842,7 +6296,7 @@ class TenantInfoApiClient extends ApiClientBase {
3842
6296
  method: "GET",
3843
6297
  url: url_,
3844
6298
  headers: {
3845
- "Accept": "text/plain"
6299
+ "Accept": "application/json"
3846
6300
  },
3847
6301
  cancelToken
3848
6302
  };
@@ -3904,7 +6358,7 @@ class TenantInfoApiClient extends ApiClientBase {
3904
6358
  method: "GET",
3905
6359
  url: url_,
3906
6360
  headers: {
3907
- "Accept": "text/plain"
6361
+ "Accept": "application/json"
3908
6362
  },
3909
6363
  cancelToken
3910
6364
  };
@@ -3966,7 +6420,7 @@ class TenantInfoApiClient extends ApiClientBase {
3966
6420
  method: "GET",
3967
6421
  url: url_,
3968
6422
  headers: {
3969
- "Accept": "text/plain"
6423
+ "Accept": "application/json"
3970
6424
  },
3971
6425
  cancelToken
3972
6426
  };
@@ -4016,6 +6470,32 @@ class TenantInfoApiClient extends ApiClientBase {
4016
6470
  }
4017
6471
  }
4018
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 = {}));
4019
6499
  /** Type of editor that should be configured by workflow. */
4020
6500
  var WorkflowType;
4021
6501
  (function (WorkflowType) {
@@ -4024,6 +6504,34 @@ var WorkflowType;
4024
6504
  WorkflowType["DesignEditor"] = "DesignEditor";
4025
6505
  WorkflowType["WorkflowElements"] = "WorkflowElements";
4026
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 = {}));
4027
6535
  /** Defines all available date period filter values for queries. */
4028
6536
  var DatePeriod;
4029
6537
  (function (DatePeriod) {
@@ -4068,6 +6576,14 @@ var RenderHiResScenarioOutputFlipMode;
4068
6576
  RenderHiResScenarioOutputFlipMode["Vertical"] = "Vertical";
4069
6577
  RenderHiResScenarioOutputFlipMode["Both"] = "Both";
4070
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 = {}));
4071
6587
  /** Available value types for order data item. */
4072
6588
  var OrderDataItemValueType;
4073
6589
  (function (OrderDataItemValueType) {