@aurigma/axios-storefront-api-client 2.39.1 → 2.40.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.
- package/dist/cjs/storefront-api-client.d.ts +130 -26
- package/dist/cjs/storefront-api-client.js +346 -35
- package/dist/cjs/storefront-api-client.js.map +1 -1
- package/dist/esm/storefront-api-client.d.ts +130 -26
- package/dist/esm/storefront-api-client.js +344 -34
- package/dist/esm/storefront-api-client.js.map +1 -1
- package/package.json +1 -1
|
@@ -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.TenantInfoApiClient = exports.StorefrontUsersApiClient = exports.StorefrontsApiClient = exports.ProjectsApiClient = exports.ProductSpecificationsApiClient = exports.ProductReferencesApiClient = exports.BuildInfoApiClient = exports.ApiClientBase = exports.ApiClientConfiguration = void 0;
|
|
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;
|
|
12
12
|
const axios_1 = require("axios");
|
|
13
13
|
class ApiClientConfiguration {
|
|
14
14
|
apiUrl;
|
|
@@ -161,6 +161,161 @@ class BuildInfoApiClient extends ApiClientBase {
|
|
|
161
161
|
}
|
|
162
162
|
}
|
|
163
163
|
exports.BuildInfoApiClient = BuildInfoApiClient;
|
|
164
|
+
class ProcessingPipelinesApiClient extends ApiClientBase {
|
|
165
|
+
instance;
|
|
166
|
+
baseUrl;
|
|
167
|
+
jsonParseReviver = undefined;
|
|
168
|
+
constructor(configuration, baseUrl, instance) {
|
|
169
|
+
super(configuration);
|
|
170
|
+
this.instance = instance ? instance : axios_1.create();
|
|
171
|
+
this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : this.getBaseUrl("");
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Returns all processing pipelines relevant to the specified query parameters.
|
|
175
|
+
* @param skip (optional) Defines page start offset from beginning of sorted result list.
|
|
176
|
+
* @param take (optional) Defines page length (how many consequent items of sorted result list should be taken).
|
|
177
|
+
* @param search (optional) Search string for partial by processing pipeline name.
|
|
178
|
+
* @param tenantId (optional) Tenant identifier.
|
|
179
|
+
* @return Success
|
|
180
|
+
*/
|
|
181
|
+
getAll(skip, take, search, tenantId, cancelToken) {
|
|
182
|
+
let url_ = this.baseUrl + "/api/storefront/v1/processing-pipelines?";
|
|
183
|
+
if (skip !== undefined && skip !== null)
|
|
184
|
+
url_ += "skip=" + encodeURIComponent("" + skip) + "&";
|
|
185
|
+
if (take !== undefined && take !== null)
|
|
186
|
+
url_ += "take=" + encodeURIComponent("" + take) + "&";
|
|
187
|
+
if (search !== undefined && search !== null)
|
|
188
|
+
url_ += "search=" + encodeURIComponent("" + search) + "&";
|
|
189
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
190
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
191
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
192
|
+
let options_ = {
|
|
193
|
+
method: "GET",
|
|
194
|
+
url: url_,
|
|
195
|
+
headers: {
|
|
196
|
+
"Accept": "text/plain"
|
|
197
|
+
},
|
|
198
|
+
cancelToken
|
|
199
|
+
};
|
|
200
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
201
|
+
return this.instance.request(transformedOptions_);
|
|
202
|
+
}).catch((_error) => {
|
|
203
|
+
if (isAxiosError(_error) && _error.response) {
|
|
204
|
+
return _error.response;
|
|
205
|
+
}
|
|
206
|
+
else {
|
|
207
|
+
throw _error;
|
|
208
|
+
}
|
|
209
|
+
}).then((_response) => {
|
|
210
|
+
return this.transformResult(url_, _response, (_response) => this.processGetAll(_response));
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
processGetAll(response) {
|
|
214
|
+
const status = response.status;
|
|
215
|
+
let _headers = {};
|
|
216
|
+
if (response.headers && typeof response.headers === "object") {
|
|
217
|
+
for (let k in response.headers) {
|
|
218
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
219
|
+
_headers[k] = response.headers[k];
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
if (status === 200) {
|
|
224
|
+
const _responseText = response.data;
|
|
225
|
+
let result200 = null;
|
|
226
|
+
let resultData200 = _responseText;
|
|
227
|
+
result200 = JSON.parse(resultData200);
|
|
228
|
+
return Promise.resolve(result200);
|
|
229
|
+
}
|
|
230
|
+
else if (status === 401) {
|
|
231
|
+
const _responseText = response.data;
|
|
232
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
233
|
+
}
|
|
234
|
+
else if (status === 403) {
|
|
235
|
+
const _responseText = response.data;
|
|
236
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
237
|
+
}
|
|
238
|
+
else if (status !== 200 && status !== 204) {
|
|
239
|
+
const _responseText = response.data;
|
|
240
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
241
|
+
}
|
|
242
|
+
return Promise.resolve(null);
|
|
243
|
+
}
|
|
244
|
+
/**
|
|
245
|
+
* Returns a processing pipeline.
|
|
246
|
+
* @param id Processing pipeline identifier..
|
|
247
|
+
* @param tenantId (optional) Tenant identifier.
|
|
248
|
+
* @return Success
|
|
249
|
+
*/
|
|
250
|
+
get(id, tenantId, cancelToken) {
|
|
251
|
+
let url_ = this.baseUrl + "/api/storefront/v1/processing-pipelines/{id}?";
|
|
252
|
+
if (id === undefined || id === null)
|
|
253
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
254
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
255
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
256
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
257
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
258
|
+
let options_ = {
|
|
259
|
+
method: "GET",
|
|
260
|
+
url: url_,
|
|
261
|
+
headers: {
|
|
262
|
+
"Accept": "text/plain"
|
|
263
|
+
},
|
|
264
|
+
cancelToken
|
|
265
|
+
};
|
|
266
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
267
|
+
return this.instance.request(transformedOptions_);
|
|
268
|
+
}).catch((_error) => {
|
|
269
|
+
if (isAxiosError(_error) && _error.response) {
|
|
270
|
+
return _error.response;
|
|
271
|
+
}
|
|
272
|
+
else {
|
|
273
|
+
throw _error;
|
|
274
|
+
}
|
|
275
|
+
}).then((_response) => {
|
|
276
|
+
return this.transformResult(url_, _response, (_response) => this.processGet(_response));
|
|
277
|
+
});
|
|
278
|
+
}
|
|
279
|
+
processGet(response) {
|
|
280
|
+
const status = response.status;
|
|
281
|
+
let _headers = {};
|
|
282
|
+
if (response.headers && typeof response.headers === "object") {
|
|
283
|
+
for (let k in response.headers) {
|
|
284
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
285
|
+
_headers[k] = response.headers[k];
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
if (status === 200) {
|
|
290
|
+
const _responseText = response.data;
|
|
291
|
+
let result200 = null;
|
|
292
|
+
let resultData200 = _responseText;
|
|
293
|
+
result200 = JSON.parse(resultData200);
|
|
294
|
+
return Promise.resolve(result200);
|
|
295
|
+
}
|
|
296
|
+
else if (status === 404) {
|
|
297
|
+
const _responseText = response.data;
|
|
298
|
+
let result404 = null;
|
|
299
|
+
let resultData404 = _responseText;
|
|
300
|
+
result404 = JSON.parse(resultData404);
|
|
301
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
302
|
+
}
|
|
303
|
+
else if (status === 401) {
|
|
304
|
+
const _responseText = response.data;
|
|
305
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
306
|
+
}
|
|
307
|
+
else if (status === 403) {
|
|
308
|
+
const _responseText = response.data;
|
|
309
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
310
|
+
}
|
|
311
|
+
else if (status !== 200 && status !== 204) {
|
|
312
|
+
const _responseText = response.data;
|
|
313
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
314
|
+
}
|
|
315
|
+
return Promise.resolve(null);
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
exports.ProcessingPipelinesApiClient = ProcessingPipelinesApiClient;
|
|
164
319
|
class ProductReferencesApiClient extends ApiClientBase {
|
|
165
320
|
instance;
|
|
166
321
|
baseUrl;
|
|
@@ -568,21 +723,37 @@ class ProductReferencesApiClient extends ApiClientBase {
|
|
|
568
723
|
return Promise.resolve(null);
|
|
569
724
|
}
|
|
570
725
|
/**
|
|
571
|
-
* Returns a product
|
|
572
|
-
* @param reference Product reference - external reference to Customer's Canvas product specification, e.g online store product identifier.
|
|
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.
|
|
573
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.
|
|
574
733
|
* @param tenantId (optional) Tenant identifier.
|
|
575
734
|
* @return Success
|
|
576
735
|
*/
|
|
577
|
-
|
|
578
|
-
let url_ = this.baseUrl + "/api/storefront/v1/product-references/{reference}/product-
|
|
736
|
+
getProductCostDetails(reference, sku, storefrontId, storefrontUserId, currencyCode, quantity, tenantId, cancelToken) {
|
|
737
|
+
let url_ = this.baseUrl + "/api/storefront/v1/product-references/{reference}/product-cost-details?";
|
|
579
738
|
if (reference === undefined || reference === null)
|
|
580
739
|
throw new Error("The parameter 'reference' must be defined.");
|
|
581
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) + "&";
|
|
582
745
|
if (storefrontId === undefined || storefrontId === null)
|
|
583
746
|
throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
|
|
584
747
|
else
|
|
585
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) + "&";
|
|
586
757
|
if (tenantId !== undefined && tenantId !== null)
|
|
587
758
|
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
588
759
|
url_ = url_.replace(/[?&]$/, "");
|
|
@@ -604,10 +775,10 @@ class ProductReferencesApiClient extends ApiClientBase {
|
|
|
604
775
|
throw _error;
|
|
605
776
|
}
|
|
606
777
|
}).then((_response) => {
|
|
607
|
-
return this.transformResult(url_, _response, (_response) => this.
|
|
778
|
+
return this.transformResult(url_, _response, (_response) => this.processGetProductCostDetails(_response));
|
|
608
779
|
});
|
|
609
780
|
}
|
|
610
|
-
|
|
781
|
+
processGetProductCostDetails(response) {
|
|
611
782
|
const status = response.status;
|
|
612
783
|
let _headers = {};
|
|
613
784
|
if (response.headers && typeof response.headers === "object") {
|
|
@@ -621,14 +792,14 @@ class ProductReferencesApiClient extends ApiClientBase {
|
|
|
621
792
|
const _responseText = response.data;
|
|
622
793
|
let result200 = null;
|
|
623
794
|
let resultData200 = _responseText;
|
|
624
|
-
result200 = resultData200;
|
|
795
|
+
result200 = JSON.parse(resultData200);
|
|
625
796
|
return Promise.resolve(result200);
|
|
626
797
|
}
|
|
627
798
|
else if (status === 404) {
|
|
628
799
|
const _responseText = response.data;
|
|
629
800
|
let result404 = null;
|
|
630
801
|
let resultData404 = _responseText;
|
|
631
|
-
result404 = resultData404;
|
|
802
|
+
result404 = JSON.parse(resultData404);
|
|
632
803
|
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
633
804
|
}
|
|
634
805
|
else if (status === 401) {
|
|
@@ -646,37 +817,97 @@ class ProductReferencesApiClient extends ApiClientBase {
|
|
|
646
817
|
return Promise.resolve(null);
|
|
647
818
|
}
|
|
648
819
|
/**
|
|
649
|
-
* Returns a product
|
|
650
|
-
* @param reference Product reference - external reference to Customer's Canvas product
|
|
651
|
-
* @param
|
|
652
|
-
* @param storefrontId Storefront identifier.
|
|
653
|
-
* @param storefrontUserId (optional) Storefront user identifier.
|
|
654
|
-
* @param currencyCode (optional) Product cost currency code.
|
|
655
|
-
* @param quantity (optional) Product quantity.
|
|
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.
|
|
656
823
|
* @param tenantId (optional) Tenant identifier.
|
|
657
824
|
* @return Success
|
|
658
825
|
*/
|
|
659
|
-
|
|
660
|
-
let url_ = this.baseUrl + "/api/storefront/v1/product-references/{reference}/
|
|
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) + "&";
|
|
835
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
836
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
837
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
838
|
+
let options_ = {
|
|
839
|
+
method: "GET",
|
|
840
|
+
url: url_,
|
|
841
|
+
headers: {
|
|
842
|
+
"Accept": "text/plain"
|
|
843
|
+
},
|
|
844
|
+
cancelToken
|
|
845
|
+
};
|
|
846
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
847
|
+
return this.instance.request(transformedOptions_);
|
|
848
|
+
}).catch((_error) => {
|
|
849
|
+
if (isAxiosError(_error) && _error.response) {
|
|
850
|
+
return _error.response;
|
|
851
|
+
}
|
|
852
|
+
else {
|
|
853
|
+
throw _error;
|
|
854
|
+
}
|
|
855
|
+
}).then((_response) => {
|
|
856
|
+
return this.transformResult(url_, _response, (_response) => this.processGetPersonalizationWorkflow(_response));
|
|
857
|
+
});
|
|
858
|
+
}
|
|
859
|
+
processGetPersonalizationWorkflow(response) {
|
|
860
|
+
const status = response.status;
|
|
861
|
+
let _headers = {};
|
|
862
|
+
if (response.headers && typeof response.headers === "object") {
|
|
863
|
+
for (let k in response.headers) {
|
|
864
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
865
|
+
_headers[k] = response.headers[k];
|
|
866
|
+
}
|
|
867
|
+
}
|
|
868
|
+
}
|
|
869
|
+
if (status === 200) {
|
|
870
|
+
const _responseText = response.data;
|
|
871
|
+
let result200 = null;
|
|
872
|
+
let resultData200 = _responseText;
|
|
873
|
+
result200 = JSON.parse(resultData200);
|
|
874
|
+
return Promise.resolve(result200);
|
|
875
|
+
}
|
|
876
|
+
else if (status === 404) {
|
|
877
|
+
const _responseText = response.data;
|
|
878
|
+
let result404 = null;
|
|
879
|
+
let resultData404 = _responseText;
|
|
880
|
+
result404 = JSON.parse(resultData404);
|
|
881
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
882
|
+
}
|
|
883
|
+
else if (status === 401) {
|
|
884
|
+
const _responseText = response.data;
|
|
885
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
886
|
+
}
|
|
887
|
+
else if (status === 403) {
|
|
888
|
+
const _responseText = response.data;
|
|
889
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
890
|
+
}
|
|
891
|
+
else if (status !== 200 && status !== 204) {
|
|
892
|
+
const _responseText = response.data;
|
|
893
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
894
|
+
}
|
|
895
|
+
return Promise.resolve(null);
|
|
896
|
+
}
|
|
897
|
+
/**
|
|
898
|
+
* @param tenantId (optional)
|
|
899
|
+
* @return Success
|
|
900
|
+
* @deprecated
|
|
901
|
+
*/
|
|
902
|
+
getProductConfig(reference, storefrontId, tenantId, cancelToken) {
|
|
903
|
+
let url_ = this.baseUrl + "/api/storefront/v1/product-references/{reference}/product-config?";
|
|
661
904
|
if (reference === undefined || reference === null)
|
|
662
905
|
throw new Error("The parameter 'reference' must be defined.");
|
|
663
906
|
url_ = url_.replace("{reference}", encodeURIComponent("" + reference));
|
|
664
|
-
if (sku === undefined || sku === null)
|
|
665
|
-
throw new Error("The parameter 'sku' must be defined and cannot be null.");
|
|
666
|
-
else
|
|
667
|
-
url_ += "sku=" + encodeURIComponent("" + sku) + "&";
|
|
668
907
|
if (storefrontId === undefined || storefrontId === null)
|
|
669
908
|
throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
|
|
670
909
|
else
|
|
671
910
|
url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
|
|
672
|
-
if (storefrontUserId !== undefined && storefrontUserId !== null)
|
|
673
|
-
url_ += "storefrontUserId=" + encodeURIComponent("" + storefrontUserId) + "&";
|
|
674
|
-
if (currencyCode !== undefined && currencyCode !== null)
|
|
675
|
-
url_ += "currencyCode=" + encodeURIComponent("" + currencyCode) + "&";
|
|
676
|
-
if (quantity === null)
|
|
677
|
-
throw new Error("The parameter 'quantity' cannot be null.");
|
|
678
|
-
else if (quantity !== undefined)
|
|
679
|
-
url_ += "quantity=" + encodeURIComponent("" + quantity) + "&";
|
|
680
911
|
if (tenantId !== undefined && tenantId !== null)
|
|
681
912
|
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
682
913
|
url_ = url_.replace(/[?&]$/, "");
|
|
@@ -698,10 +929,10 @@ class ProductReferencesApiClient extends ApiClientBase {
|
|
|
698
929
|
throw _error;
|
|
699
930
|
}
|
|
700
931
|
}).then((_response) => {
|
|
701
|
-
return this.transformResult(url_, _response, (_response) => this.
|
|
932
|
+
return this.transformResult(url_, _response, (_response) => this.processGetProductConfig(_response));
|
|
702
933
|
});
|
|
703
934
|
}
|
|
704
|
-
|
|
935
|
+
processGetProductConfig(response) {
|
|
705
936
|
const status = response.status;
|
|
706
937
|
let _headers = {};
|
|
707
938
|
if (response.headers && typeof response.headers === "object") {
|
|
@@ -715,14 +946,14 @@ class ProductReferencesApiClient extends ApiClientBase {
|
|
|
715
946
|
const _responseText = response.data;
|
|
716
947
|
let result200 = null;
|
|
717
948
|
let resultData200 = _responseText;
|
|
718
|
-
result200 =
|
|
949
|
+
result200 = resultData200;
|
|
719
950
|
return Promise.resolve(result200);
|
|
720
951
|
}
|
|
721
952
|
else if (status === 404) {
|
|
722
953
|
const _responseText = response.data;
|
|
723
954
|
let result404 = null;
|
|
724
955
|
let resultData404 = _responseText;
|
|
725
|
-
result404 =
|
|
956
|
+
result404 = resultData404;
|
|
726
957
|
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
727
958
|
}
|
|
728
959
|
else if (status === 401) {
|
|
@@ -898,11 +1129,83 @@ class ProductSpecificationsApiClient extends ApiClientBase {
|
|
|
898
1129
|
return Promise.resolve(null);
|
|
899
1130
|
}
|
|
900
1131
|
/**
|
|
901
|
-
* Returns a product
|
|
1132
|
+
* Returns a product personalization workflow description by product specification identifier.
|
|
902
1133
|
* @param id Product specification identifier.
|
|
903
1134
|
* @param tenantId (optional) Tenant identifier.
|
|
904
1135
|
* @return Success
|
|
905
1136
|
*/
|
|
1137
|
+
getPersonalizationWorkflow(id, tenantId, cancelToken) {
|
|
1138
|
+
let url_ = this.baseUrl + "/api/storefront/v1/product-specifications/{id}/personalization-workflow?";
|
|
1139
|
+
if (id === undefined || id === null)
|
|
1140
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
1141
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
1142
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
1143
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
1144
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
1145
|
+
let options_ = {
|
|
1146
|
+
method: "GET",
|
|
1147
|
+
url: url_,
|
|
1148
|
+
headers: {
|
|
1149
|
+
"Accept": "text/plain"
|
|
1150
|
+
},
|
|
1151
|
+
cancelToken
|
|
1152
|
+
};
|
|
1153
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
1154
|
+
return this.instance.request(transformedOptions_);
|
|
1155
|
+
}).catch((_error) => {
|
|
1156
|
+
if (isAxiosError(_error) && _error.response) {
|
|
1157
|
+
return _error.response;
|
|
1158
|
+
}
|
|
1159
|
+
else {
|
|
1160
|
+
throw _error;
|
|
1161
|
+
}
|
|
1162
|
+
}).then((_response) => {
|
|
1163
|
+
return this.transformResult(url_, _response, (_response) => this.processGetPersonalizationWorkflow(_response));
|
|
1164
|
+
});
|
|
1165
|
+
}
|
|
1166
|
+
processGetPersonalizationWorkflow(response) {
|
|
1167
|
+
const status = response.status;
|
|
1168
|
+
let _headers = {};
|
|
1169
|
+
if (response.headers && typeof response.headers === "object") {
|
|
1170
|
+
for (let k in response.headers) {
|
|
1171
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
1172
|
+
_headers[k] = response.headers[k];
|
|
1173
|
+
}
|
|
1174
|
+
}
|
|
1175
|
+
}
|
|
1176
|
+
if (status === 200) {
|
|
1177
|
+
const _responseText = response.data;
|
|
1178
|
+
let result200 = null;
|
|
1179
|
+
let resultData200 = _responseText;
|
|
1180
|
+
result200 = JSON.parse(resultData200);
|
|
1181
|
+
return Promise.resolve(result200);
|
|
1182
|
+
}
|
|
1183
|
+
else if (status === 404) {
|
|
1184
|
+
const _responseText = response.data;
|
|
1185
|
+
let result404 = null;
|
|
1186
|
+
let resultData404 = _responseText;
|
|
1187
|
+
result404 = JSON.parse(resultData404);
|
|
1188
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
1189
|
+
}
|
|
1190
|
+
else if (status === 401) {
|
|
1191
|
+
const _responseText = response.data;
|
|
1192
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
1193
|
+
}
|
|
1194
|
+
else if (status === 403) {
|
|
1195
|
+
const _responseText = response.data;
|
|
1196
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
1197
|
+
}
|
|
1198
|
+
else if (status !== 200 && status !== 204) {
|
|
1199
|
+
const _responseText = response.data;
|
|
1200
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
1201
|
+
}
|
|
1202
|
+
return Promise.resolve(null);
|
|
1203
|
+
}
|
|
1204
|
+
/**
|
|
1205
|
+
* @param tenantId (optional)
|
|
1206
|
+
* @return Success
|
|
1207
|
+
* @deprecated
|
|
1208
|
+
*/
|
|
906
1209
|
getConfiguration(id, tenantId, cancelToken) {
|
|
907
1210
|
let url_ = this.baseUrl + "/api/storefront/v1/product-specifications/{id}/config?";
|
|
908
1211
|
if (id === undefined || id === null)
|
|
@@ -3358,6 +3661,14 @@ class TenantInfoApiClient extends ApiClientBase {
|
|
|
3358
3661
|
}
|
|
3359
3662
|
}
|
|
3360
3663
|
exports.TenantInfoApiClient = TenantInfoApiClient;
|
|
3664
|
+
/** Type of editor that should be configured by workflow. */
|
|
3665
|
+
var WorkflowType;
|
|
3666
|
+
(function (WorkflowType) {
|
|
3667
|
+
WorkflowType["UIFramework"] = "UIFramework";
|
|
3668
|
+
WorkflowType["SimpleEditor"] = "SimpleEditor";
|
|
3669
|
+
WorkflowType["DesignEditor"] = "DesignEditor";
|
|
3670
|
+
WorkflowType["HandyEditor"] = "HandyEditor";
|
|
3671
|
+
})(WorkflowType = exports.WorkflowType || (exports.WorkflowType = {}));
|
|
3361
3672
|
/** Defines all available date period filter values for queries. */
|
|
3362
3673
|
var DatePeriod;
|
|
3363
3674
|
(function (DatePeriod) {
|