@aurigma/axios-design-atoms-api-client 2.64.1 → 2.65.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/design-atoms-api-client.d.ts +717 -184
- package/dist/cjs/design-atoms-api-client.js +2439 -393
- package/dist/cjs/design-atoms-api-client.js.map +1 -1
- package/dist/esm/design-atoms-api-client.d.ts +717 -184
- package/dist/esm/design-atoms-api-client.js +2436 -392
- package/dist/esm/design-atoms-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.ProductProofInterpolationMode = exports.ProductProofFormat = exports.ProductPreviewFormat = exports.ProductPatchType = exports.PlaceholderItemContentType = exports.ItemType = exports.ItemSourceType = exports.ImagePreviewFormat = exports.ImagePreviewFitMode = exports.DesignElementType = exports.DesignAtomsViewerApiClient = exports.DesignAtomsServiceApiClient = exports.DesignAtomsMockups3dApiClient = exports.DesignAtomsImagesApiClient = exports.DesignAtomsCompatibilityApiClient = exports.BuildInfoApiClient = exports.ApiClientBase = exports.ApiClientConfiguration = void 0;
|
|
11
|
+
exports.ApiException = exports.ProductProofInterpolationMode = exports.ProductProofFormat = exports.ProductPreviewFormat = exports.ProductPatchType = exports.PlaceholderItemContentType = exports.ItemType = exports.ItemSourceType = exports.ImagePreviewFormat = exports.ImagePreviewFitMode = exports.DesignElementType = exports.DesignAtomsViewerApiClient = exports.DesignAtomsServiceApiClient = exports.DesignAtomsPrintProductItemsApiClient = exports.DesignAtomsPrintProductApiClient = exports.DesignAtomsMockups3dApiClient = exports.DesignAtomsImagesApiClient = exports.DesignAtomsCompatibilityApiClient = exports.BuildInfoApiClient = exports.ApiClientBase = exports.ApiClientConfiguration = void 0;
|
|
12
12
|
const axios_1 = require("axios");
|
|
13
13
|
class ApiClientConfiguration {
|
|
14
14
|
apiUrl;
|
|
@@ -2602,12 +2602,12 @@ class DesignAtomsMockups3dApiClient extends ApiClientBase {
|
|
|
2602
2602
|
result404 = JSON.parse(resultData404);
|
|
2603
2603
|
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
2604
2604
|
}
|
|
2605
|
-
else if (status ===
|
|
2605
|
+
else if (status === 409) {
|
|
2606
2606
|
const _responseText = response.data;
|
|
2607
|
-
let
|
|
2608
|
-
let
|
|
2609
|
-
|
|
2610
|
-
return throwException("
|
|
2607
|
+
let result409 = null;
|
|
2608
|
+
let resultData409 = _responseText;
|
|
2609
|
+
result409 = JSON.parse(resultData409);
|
|
2610
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
2611
2611
|
}
|
|
2612
2612
|
else if (status === 401) {
|
|
2613
2613
|
const _responseText = response.data;
|
|
@@ -2687,12 +2687,12 @@ class DesignAtomsMockups3dApiClient extends ApiClientBase {
|
|
|
2687
2687
|
result404 = JSON.parse(resultData404);
|
|
2688
2688
|
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
2689
2689
|
}
|
|
2690
|
-
else if (status ===
|
|
2690
|
+
else if (status === 409) {
|
|
2691
2691
|
const _responseText = response.data;
|
|
2692
|
-
let
|
|
2693
|
-
let
|
|
2694
|
-
|
|
2695
|
-
return throwException("
|
|
2692
|
+
let result409 = null;
|
|
2693
|
+
let resultData409 = _responseText;
|
|
2694
|
+
result409 = JSON.parse(resultData409);
|
|
2695
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
2696
2696
|
}
|
|
2697
2697
|
else if (status === 401) {
|
|
2698
2698
|
const _responseText = response.data;
|
|
@@ -2772,12 +2772,12 @@ class DesignAtomsMockups3dApiClient extends ApiClientBase {
|
|
|
2772
2772
|
result404 = JSON.parse(resultData404);
|
|
2773
2773
|
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
2774
2774
|
}
|
|
2775
|
-
else if (status ===
|
|
2775
|
+
else if (status === 409) {
|
|
2776
2776
|
const _responseText = response.data;
|
|
2777
|
-
let
|
|
2778
|
-
let
|
|
2779
|
-
|
|
2780
|
-
return throwException("
|
|
2777
|
+
let result409 = null;
|
|
2778
|
+
let resultData409 = _responseText;
|
|
2779
|
+
result409 = JSON.parse(resultData409);
|
|
2780
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
2781
2781
|
}
|
|
2782
2782
|
else if (status === 401) {
|
|
2783
2783
|
const _responseText = response.data;
|
|
@@ -2795,7 +2795,7 @@ class DesignAtomsMockups3dApiClient extends ApiClientBase {
|
|
|
2795
2795
|
}
|
|
2796
2796
|
}
|
|
2797
2797
|
exports.DesignAtomsMockups3dApiClient = DesignAtomsMockups3dApiClient;
|
|
2798
|
-
class
|
|
2798
|
+
class DesignAtomsPrintProductApiClient extends ApiClientBase {
|
|
2799
2799
|
instance;
|
|
2800
2800
|
baseUrl;
|
|
2801
2801
|
jsonParseReviver = undefined;
|
|
@@ -2805,14 +2805,23 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2805
2805
|
this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : this.getBaseUrl("");
|
|
2806
2806
|
}
|
|
2807
2807
|
/**
|
|
2808
|
-
*
|
|
2808
|
+
* Patches a print-product of the specified design file.
|
|
2809
|
+
* @param id Design identifier.
|
|
2809
2810
|
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
2810
2811
|
* @param tenantId (optional) Tenant identifier
|
|
2811
|
-
* @param
|
|
2812
|
-
* @
|
|
2812
|
+
* @param patchType (optional)
|
|
2813
|
+
* @param replaceImageItemFileInfo_itemName (optional)
|
|
2814
|
+
* @param replaceImageItemFileInfo_sourceFile (optional)
|
|
2815
|
+
* @param replacePlaceholderItemContentInfo_placeholderItemName (optional)
|
|
2816
|
+
* @param replacePlaceholderItemContentInfo_newContentType (optional)
|
|
2817
|
+
* @param replacePlaceholderItemContentInfo_sourceFile (optional)
|
|
2818
|
+
* @return No Content
|
|
2813
2819
|
*/
|
|
2814
|
-
|
|
2815
|
-
let url_ = this.baseUrl + "/api/atoms/v1/designs?";
|
|
2820
|
+
patchDesignProduct(id, privateStorageOwner, tenantId, patchType, replaceImageItemFileInfo_itemName, replaceImageItemFileInfo_sourceFile, replacePlaceholderItemContentInfo_placeholderItemName, replacePlaceholderItemContentInfo_newContentType, replacePlaceholderItemContentInfo_sourceFile, cancelToken) {
|
|
2821
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/print-product?";
|
|
2822
|
+
if (id === undefined || id === null)
|
|
2823
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
2824
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
2816
2825
|
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
2817
2826
|
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
2818
2827
|
if (tenantId === null)
|
|
@@ -2820,15 +2829,28 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2820
2829
|
else if (tenantId !== undefined)
|
|
2821
2830
|
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2822
2831
|
url_ = url_.replace(/[?&]$/, "");
|
|
2823
|
-
const content_ =
|
|
2832
|
+
const content_ = new FormData();
|
|
2833
|
+
if (patchType === null || patchType === undefined)
|
|
2834
|
+
throw new Error("The parameter 'patchType' cannot be null.");
|
|
2835
|
+
else
|
|
2836
|
+
content_.append("patchType", patchType.toString());
|
|
2837
|
+
if (replaceImageItemFileInfo_itemName !== null && replaceImageItemFileInfo_itemName !== undefined)
|
|
2838
|
+
content_.append("replaceImageItemFileInfo.itemName", replaceImageItemFileInfo_itemName.toString());
|
|
2839
|
+
if (replaceImageItemFileInfo_sourceFile !== null && replaceImageItemFileInfo_sourceFile !== undefined)
|
|
2840
|
+
content_.append("replaceImageItemFileInfo.sourceFile", replaceImageItemFileInfo_sourceFile.data, replaceImageItemFileInfo_sourceFile.fileName ? replaceImageItemFileInfo_sourceFile.fileName : "replaceImageItemFileInfo.sourceFile");
|
|
2841
|
+
if (replacePlaceholderItemContentInfo_placeholderItemName !== null && replacePlaceholderItemContentInfo_placeholderItemName !== undefined)
|
|
2842
|
+
content_.append("replacePlaceholderItemContentInfo.placeholderItemName", replacePlaceholderItemContentInfo_placeholderItemName.toString());
|
|
2843
|
+
if (replacePlaceholderItemContentInfo_newContentType === null || replacePlaceholderItemContentInfo_newContentType === undefined)
|
|
2844
|
+
throw new Error("The parameter 'replacePlaceholderItemContentInfo_newContentType' cannot be null.");
|
|
2845
|
+
else
|
|
2846
|
+
content_.append("replacePlaceholderItemContentInfo.newContentType", replacePlaceholderItemContentInfo_newContentType.toString());
|
|
2847
|
+
if (replacePlaceholderItemContentInfo_sourceFile !== null && replacePlaceholderItemContentInfo_sourceFile !== undefined)
|
|
2848
|
+
content_.append("replacePlaceholderItemContentInfo.sourceFile", replacePlaceholderItemContentInfo_sourceFile.data, replacePlaceholderItemContentInfo_sourceFile.fileName ? replacePlaceholderItemContentInfo_sourceFile.fileName : "replacePlaceholderItemContentInfo.sourceFile");
|
|
2824
2849
|
let options_ = {
|
|
2825
2850
|
data: content_,
|
|
2826
|
-
method: "
|
|
2851
|
+
method: "PATCH",
|
|
2827
2852
|
url: url_,
|
|
2828
|
-
headers: {
|
|
2829
|
-
"Content-Type": "application/json",
|
|
2830
|
-
"Accept": "application/json"
|
|
2831
|
-
},
|
|
2853
|
+
headers: {},
|
|
2832
2854
|
cancelToken
|
|
2833
2855
|
};
|
|
2834
2856
|
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
@@ -2841,10 +2863,10 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2841
2863
|
throw _error;
|
|
2842
2864
|
}
|
|
2843
2865
|
}).then((_response) => {
|
|
2844
|
-
return this.transformResult(url_, _response, (_response) => this.
|
|
2866
|
+
return this.transformResult(url_, _response, (_response) => this.processPatchDesignProduct(_response));
|
|
2845
2867
|
});
|
|
2846
2868
|
}
|
|
2847
|
-
|
|
2869
|
+
processPatchDesignProduct(response) {
|
|
2848
2870
|
const status = response.status;
|
|
2849
2871
|
let _headers = {};
|
|
2850
2872
|
if (response.headers && typeof response.headers === "object") {
|
|
@@ -2854,12 +2876,16 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2854
2876
|
}
|
|
2855
2877
|
}
|
|
2856
2878
|
}
|
|
2857
|
-
if (status ===
|
|
2879
|
+
if (status === 204) {
|
|
2858
2880
|
const _responseText = response.data;
|
|
2859
|
-
|
|
2860
|
-
|
|
2861
|
-
|
|
2862
|
-
|
|
2881
|
+
return Promise.resolve(null);
|
|
2882
|
+
}
|
|
2883
|
+
else if (status === 404) {
|
|
2884
|
+
const _responseText = response.data;
|
|
2885
|
+
let result404 = null;
|
|
2886
|
+
let resultData404 = _responseText;
|
|
2887
|
+
result404 = JSON.parse(resultData404);
|
|
2888
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
2863
2889
|
}
|
|
2864
2890
|
else if (status === 401) {
|
|
2865
2891
|
const _responseText = response.data;
|
|
@@ -2876,20 +2902,17 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2876
2902
|
return Promise.resolve(null);
|
|
2877
2903
|
}
|
|
2878
2904
|
/**
|
|
2879
|
-
* Returns
|
|
2905
|
+
* Returns a print-product of the specified design file as a json-serialized model.
|
|
2880
2906
|
* @param id Design identifier.
|
|
2881
|
-
* @param surfaceIndex (optional) Surface index.
|
|
2882
2907
|
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
2883
2908
|
* @param tenantId (optional) Tenant identifier
|
|
2884
2909
|
* @return Success
|
|
2885
2910
|
*/
|
|
2886
|
-
|
|
2887
|
-
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/
|
|
2911
|
+
getDesignProductModel(id, privateStorageOwner, tenantId, cancelToken) {
|
|
2912
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/print-product/model?";
|
|
2888
2913
|
if (id === undefined || id === null)
|
|
2889
2914
|
throw new Error("The parameter 'id' must be defined.");
|
|
2890
2915
|
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
2891
|
-
if (surfaceIndex !== undefined && surfaceIndex !== null)
|
|
2892
|
-
url_ += "surfaceIndex=" + encodeURIComponent("" + surfaceIndex) + "&";
|
|
2893
2916
|
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
2894
2917
|
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
2895
2918
|
if (tenantId === null)
|
|
@@ -2898,11 +2921,10 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2898
2921
|
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2899
2922
|
url_ = url_.replace(/[?&]$/, "");
|
|
2900
2923
|
let options_ = {
|
|
2901
|
-
responseType: "blob",
|
|
2902
2924
|
method: "GET",
|
|
2903
2925
|
url: url_,
|
|
2904
2926
|
headers: {
|
|
2905
|
-
"Accept": "application/
|
|
2927
|
+
"Accept": "application/json"
|
|
2906
2928
|
},
|
|
2907
2929
|
cancelToken
|
|
2908
2930
|
};
|
|
@@ -2916,10 +2938,10 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2916
2938
|
throw _error;
|
|
2917
2939
|
}
|
|
2918
2940
|
}).then((_response) => {
|
|
2919
|
-
return this.transformResult(url_, _response, (_response) => this.
|
|
2941
|
+
return this.transformResult(url_, _response, (_response) => this.processGetDesignProductModel(_response));
|
|
2920
2942
|
});
|
|
2921
2943
|
}
|
|
2922
|
-
|
|
2944
|
+
processGetDesignProductModel(response) {
|
|
2923
2945
|
const status = response.status;
|
|
2924
2946
|
let _headers = {};
|
|
2925
2947
|
if (response.headers && typeof response.headers === "object") {
|
|
@@ -2929,11 +2951,12 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2929
2951
|
}
|
|
2930
2952
|
}
|
|
2931
2953
|
}
|
|
2932
|
-
if (status === 200
|
|
2933
|
-
const
|
|
2934
|
-
|
|
2935
|
-
|
|
2936
|
-
|
|
2954
|
+
if (status === 200) {
|
|
2955
|
+
const _responseText = response.data;
|
|
2956
|
+
let result200 = null;
|
|
2957
|
+
let resultData200 = _responseText;
|
|
2958
|
+
result200 = JSON.parse(resultData200);
|
|
2959
|
+
return Promise.resolve(result200);
|
|
2937
2960
|
}
|
|
2938
2961
|
else if (status === 404) {
|
|
2939
2962
|
const _responseText = response.data;
|
|
@@ -2942,13 +2965,6 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2942
2965
|
result404 = JSON.parse(resultData404);
|
|
2943
2966
|
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
2944
2967
|
}
|
|
2945
|
-
else if (status === 422) {
|
|
2946
|
-
const _responseText = response.data;
|
|
2947
|
-
let result422 = null;
|
|
2948
|
-
let resultData422 = _responseText;
|
|
2949
|
-
result422 = JSON.parse(resultData422);
|
|
2950
|
-
return throwException("Client Error", status, _responseText, _headers, result422);
|
|
2951
|
-
}
|
|
2952
2968
|
else if (status === 401) {
|
|
2953
2969
|
const _responseText = response.data;
|
|
2954
2970
|
return throwException("Unauthorized", status, _responseText, _headers);
|
|
@@ -2964,14 +2980,15 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2964
2980
|
return Promise.resolve(null);
|
|
2965
2981
|
}
|
|
2966
2982
|
/**
|
|
2967
|
-
*
|
|
2983
|
+
* Saves a print-product provided as a json-serialized model to the specified design file.
|
|
2968
2984
|
* @param id Design identifier.
|
|
2969
2985
|
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
2970
2986
|
* @param tenantId (optional) Tenant identifier
|
|
2971
|
-
* @
|
|
2987
|
+
* @param body (optional) Serialized print-product description.
|
|
2988
|
+
* @return No Content
|
|
2972
2989
|
*/
|
|
2973
|
-
|
|
2974
|
-
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/model?";
|
|
2990
|
+
updateDesignProductModel(id, privateStorageOwner, tenantId, body, cancelToken) {
|
|
2991
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/print-product/model?";
|
|
2975
2992
|
if (id === undefined || id === null)
|
|
2976
2993
|
throw new Error("The parameter 'id' must be defined.");
|
|
2977
2994
|
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
@@ -2982,11 +2999,13 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2982
2999
|
else if (tenantId !== undefined)
|
|
2983
3000
|
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2984
3001
|
url_ = url_.replace(/[?&]$/, "");
|
|
3002
|
+
const content_ = JSON.stringify(body);
|
|
2985
3003
|
let options_ = {
|
|
2986
|
-
|
|
3004
|
+
data: content_,
|
|
3005
|
+
method: "PUT",
|
|
2987
3006
|
url: url_,
|
|
2988
3007
|
headers: {
|
|
2989
|
-
"
|
|
3008
|
+
"Content-Type": "application/json",
|
|
2990
3009
|
},
|
|
2991
3010
|
cancelToken
|
|
2992
3011
|
};
|
|
@@ -3000,10 +3019,10 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3000
3019
|
throw _error;
|
|
3001
3020
|
}
|
|
3002
3021
|
}).then((_response) => {
|
|
3003
|
-
return this.transformResult(url_, _response, (_response) => this.
|
|
3022
|
+
return this.transformResult(url_, _response, (_response) => this.processUpdateDesignProductModel(_response));
|
|
3004
3023
|
});
|
|
3005
3024
|
}
|
|
3006
|
-
|
|
3025
|
+
processUpdateDesignProductModel(response) {
|
|
3007
3026
|
const status = response.status;
|
|
3008
3027
|
let _headers = {};
|
|
3009
3028
|
if (response.headers && typeof response.headers === "object") {
|
|
@@ -3013,12 +3032,9 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3013
3032
|
}
|
|
3014
3033
|
}
|
|
3015
3034
|
}
|
|
3016
|
-
if (status ===
|
|
3035
|
+
if (status === 204) {
|
|
3017
3036
|
const _responseText = response.data;
|
|
3018
|
-
|
|
3019
|
-
let resultData200 = _responseText;
|
|
3020
|
-
result200 = JSON.parse(resultData200);
|
|
3021
|
-
return Promise.resolve(result200);
|
|
3037
|
+
return Promise.resolve(null);
|
|
3022
3038
|
}
|
|
3023
3039
|
else if (status === 404) {
|
|
3024
3040
|
const _responseText = response.data;
|
|
@@ -3042,18 +3058,20 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3042
3058
|
return Promise.resolve(null);
|
|
3043
3059
|
}
|
|
3044
3060
|
/**
|
|
3045
|
-
*
|
|
3061
|
+
* Returns a list of print-area descriptions of the specified design file.
|
|
3046
3062
|
* @param id Design identifier.
|
|
3063
|
+
* @param surfaceId (optional)
|
|
3047
3064
|
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
3048
3065
|
* @param tenantId (optional) Tenant identifier
|
|
3049
|
-
* @param body (optional) Serialized product description.
|
|
3050
3066
|
* @return Success
|
|
3051
3067
|
*/
|
|
3052
|
-
|
|
3053
|
-
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/
|
|
3068
|
+
getDesignPrintAreas(id, surfaceId, privateStorageOwner, tenantId, cancelToken) {
|
|
3069
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/print-product/print-areas?";
|
|
3054
3070
|
if (id === undefined || id === null)
|
|
3055
3071
|
throw new Error("The parameter 'id' must be defined.");
|
|
3056
3072
|
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
3073
|
+
if (surfaceId !== undefined && surfaceId !== null)
|
|
3074
|
+
url_ += "surfaceId=" + encodeURIComponent("" + surfaceId) + "&";
|
|
3057
3075
|
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
3058
3076
|
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
3059
3077
|
if (tenantId === null)
|
|
@@ -3061,13 +3079,11 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3061
3079
|
else if (tenantId !== undefined)
|
|
3062
3080
|
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
3063
3081
|
url_ = url_.replace(/[?&]$/, "");
|
|
3064
|
-
const content_ = JSON.stringify(body);
|
|
3065
3082
|
let options_ = {
|
|
3066
|
-
|
|
3067
|
-
method: "PUT",
|
|
3083
|
+
method: "GET",
|
|
3068
3084
|
url: url_,
|
|
3069
3085
|
headers: {
|
|
3070
|
-
"
|
|
3086
|
+
"Accept": "application/json"
|
|
3071
3087
|
},
|
|
3072
3088
|
cancelToken
|
|
3073
3089
|
};
|
|
@@ -3081,10 +3097,10 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3081
3097
|
throw _error;
|
|
3082
3098
|
}
|
|
3083
3099
|
}).then((_response) => {
|
|
3084
|
-
return this.transformResult(url_, _response, (_response) => this.
|
|
3100
|
+
return this.transformResult(url_, _response, (_response) => this.processGetDesignPrintAreas(_response));
|
|
3085
3101
|
});
|
|
3086
3102
|
}
|
|
3087
|
-
|
|
3103
|
+
processGetDesignPrintAreas(response) {
|
|
3088
3104
|
const status = response.status;
|
|
3089
3105
|
let _headers = {};
|
|
3090
3106
|
if (response.headers && typeof response.headers === "object") {
|
|
@@ -3096,7 +3112,10 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3096
3112
|
}
|
|
3097
3113
|
if (status === 200) {
|
|
3098
3114
|
const _responseText = response.data;
|
|
3099
|
-
|
|
3115
|
+
let result200 = null;
|
|
3116
|
+
let resultData200 = _responseText;
|
|
3117
|
+
result200 = JSON.parse(resultData200);
|
|
3118
|
+
return Promise.resolve(result200);
|
|
3100
3119
|
}
|
|
3101
3120
|
else if (status === 404) {
|
|
3102
3121
|
const _responseText = response.data;
|
|
@@ -3120,23 +3139,21 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3120
3139
|
return Promise.resolve(null);
|
|
3121
3140
|
}
|
|
3122
3141
|
/**
|
|
3123
|
-
*
|
|
3142
|
+
* Deletes a specified print-area in an existing design file.
|
|
3124
3143
|
* @param id Design identifier.
|
|
3144
|
+
* @param printAreaId Design print-area identifier.
|
|
3125
3145
|
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
3126
3146
|
* @param tenantId (optional) Tenant identifier
|
|
3127
|
-
* @
|
|
3128
|
-
* @param replaceImageItemFileInfo_itemName (optional)
|
|
3129
|
-
* @param replaceImageItemFileInfo_sourceFile (optional)
|
|
3130
|
-
* @param replacePlaceholderItemContentInfo_placeholderItemName (optional)
|
|
3131
|
-
* @param replacePlaceholderItemContentInfo_newContentType (optional)
|
|
3132
|
-
* @param replacePlaceholderItemContentInfo_sourceFile (optional)
|
|
3133
|
-
* @return Success
|
|
3147
|
+
* @return No Content
|
|
3134
3148
|
*/
|
|
3135
|
-
|
|
3136
|
-
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/
|
|
3149
|
+
deleteDesignPrintArea(id, printAreaId, privateStorageOwner, tenantId, cancelToken) {
|
|
3150
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/print-product/print-areas/{printAreaId}?";
|
|
3137
3151
|
if (id === undefined || id === null)
|
|
3138
3152
|
throw new Error("The parameter 'id' must be defined.");
|
|
3139
3153
|
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
3154
|
+
if (printAreaId === undefined || printAreaId === null)
|
|
3155
|
+
throw new Error("The parameter 'printAreaId' must be defined.");
|
|
3156
|
+
url_ = url_.replace("{printAreaId}", encodeURIComponent("" + printAreaId));
|
|
3140
3157
|
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
3141
3158
|
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
3142
3159
|
if (tenantId === null)
|
|
@@ -3144,26 +3161,8 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3144
3161
|
else if (tenantId !== undefined)
|
|
3145
3162
|
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
3146
3163
|
url_ = url_.replace(/[?&]$/, "");
|
|
3147
|
-
const content_ = new FormData();
|
|
3148
|
-
if (patchType === null || patchType === undefined)
|
|
3149
|
-
throw new Error("The parameter 'patchType' cannot be null.");
|
|
3150
|
-
else
|
|
3151
|
-
content_.append("patchType", patchType.toString());
|
|
3152
|
-
if (replaceImageItemFileInfo_itemName !== null && replaceImageItemFileInfo_itemName !== undefined)
|
|
3153
|
-
content_.append("replaceImageItemFileInfo.itemName", replaceImageItemFileInfo_itemName.toString());
|
|
3154
|
-
if (replaceImageItemFileInfo_sourceFile !== null && replaceImageItemFileInfo_sourceFile !== undefined)
|
|
3155
|
-
content_.append("replaceImageItemFileInfo.sourceFile", replaceImageItemFileInfo_sourceFile.data, replaceImageItemFileInfo_sourceFile.fileName ? replaceImageItemFileInfo_sourceFile.fileName : "replaceImageItemFileInfo.sourceFile");
|
|
3156
|
-
if (replacePlaceholderItemContentInfo_placeholderItemName !== null && replacePlaceholderItemContentInfo_placeholderItemName !== undefined)
|
|
3157
|
-
content_.append("replacePlaceholderItemContentInfo.placeholderItemName", replacePlaceholderItemContentInfo_placeholderItemName.toString());
|
|
3158
|
-
if (replacePlaceholderItemContentInfo_newContentType === null || replacePlaceholderItemContentInfo_newContentType === undefined)
|
|
3159
|
-
throw new Error("The parameter 'replacePlaceholderItemContentInfo_newContentType' cannot be null.");
|
|
3160
|
-
else
|
|
3161
|
-
content_.append("replacePlaceholderItemContentInfo.newContentType", replacePlaceholderItemContentInfo_newContentType.toString());
|
|
3162
|
-
if (replacePlaceholderItemContentInfo_sourceFile !== null && replacePlaceholderItemContentInfo_sourceFile !== undefined)
|
|
3163
|
-
content_.append("replacePlaceholderItemContentInfo.sourceFile", replacePlaceholderItemContentInfo_sourceFile.data, replacePlaceholderItemContentInfo_sourceFile.fileName ? replacePlaceholderItemContentInfo_sourceFile.fileName : "replacePlaceholderItemContentInfo.sourceFile");
|
|
3164
3164
|
let options_ = {
|
|
3165
|
-
|
|
3166
|
-
method: "PATCH",
|
|
3165
|
+
method: "DELETE",
|
|
3167
3166
|
url: url_,
|
|
3168
3167
|
headers: {},
|
|
3169
3168
|
cancelToken
|
|
@@ -3178,10 +3177,10 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3178
3177
|
throw _error;
|
|
3179
3178
|
}
|
|
3180
3179
|
}).then((_response) => {
|
|
3181
|
-
return this.transformResult(url_, _response, (_response) => this.
|
|
3180
|
+
return this.transformResult(url_, _response, (_response) => this.processDeleteDesignPrintArea(_response));
|
|
3182
3181
|
});
|
|
3183
3182
|
}
|
|
3184
|
-
|
|
3183
|
+
processDeleteDesignPrintArea(response) {
|
|
3185
3184
|
const status = response.status;
|
|
3186
3185
|
let _headers = {};
|
|
3187
3186
|
if (response.headers && typeof response.headers === "object") {
|
|
@@ -3191,7 +3190,7 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3191
3190
|
}
|
|
3192
3191
|
}
|
|
3193
3192
|
}
|
|
3194
|
-
if (status ===
|
|
3193
|
+
if (status === 204) {
|
|
3195
3194
|
const _responseText = response.data;
|
|
3196
3195
|
return Promise.resolve(null);
|
|
3197
3196
|
}
|
|
@@ -3202,6 +3201,13 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3202
3201
|
result404 = JSON.parse(resultData404);
|
|
3203
3202
|
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
3204
3203
|
}
|
|
3204
|
+
else if (status === 409) {
|
|
3205
|
+
const _responseText = response.data;
|
|
3206
|
+
let result409 = null;
|
|
3207
|
+
let resultData409 = _responseText;
|
|
3208
|
+
result409 = JSON.parse(resultData409);
|
|
3209
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
3210
|
+
}
|
|
3205
3211
|
else if (status === 401) {
|
|
3206
3212
|
const _responseText = response.data;
|
|
3207
3213
|
return throwException("Unauthorized", status, _responseText, _headers);
|
|
@@ -3217,17 +3223,21 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3217
3223
|
return Promise.resolve(null);
|
|
3218
3224
|
}
|
|
3219
3225
|
/**
|
|
3220
|
-
* Returns design
|
|
3226
|
+
* Returns a print-area of the specified design file as a json-serialized model.
|
|
3221
3227
|
* @param id Design identifier.
|
|
3228
|
+
* @param printAreaId Design print-area identifier.
|
|
3222
3229
|
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
3223
3230
|
* @param tenantId (optional) Tenant identifier
|
|
3224
3231
|
* @return Success
|
|
3225
3232
|
*/
|
|
3226
|
-
|
|
3227
|
-
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/
|
|
3233
|
+
getDesignPrintAreaModel(id, printAreaId, privateStorageOwner, tenantId, cancelToken) {
|
|
3234
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/print-product/print-areas/{printAreaId}/model?";
|
|
3228
3235
|
if (id === undefined || id === null)
|
|
3229
3236
|
throw new Error("The parameter 'id' must be defined.");
|
|
3230
3237
|
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
3238
|
+
if (printAreaId === undefined || printAreaId === null)
|
|
3239
|
+
throw new Error("The parameter 'printAreaId' must be defined.");
|
|
3240
|
+
url_ = url_.replace("{printAreaId}", encodeURIComponent("" + printAreaId));
|
|
3231
3241
|
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
3232
3242
|
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
3233
3243
|
if (tenantId === null)
|
|
@@ -3253,10 +3263,10 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3253
3263
|
throw _error;
|
|
3254
3264
|
}
|
|
3255
3265
|
}).then((_response) => {
|
|
3256
|
-
return this.transformResult(url_, _response, (_response) => this.
|
|
3266
|
+
return this.transformResult(url_, _response, (_response) => this.processGetDesignPrintAreaModel(_response));
|
|
3257
3267
|
});
|
|
3258
3268
|
}
|
|
3259
|
-
|
|
3269
|
+
processGetDesignPrintAreaModel(response) {
|
|
3260
3270
|
const status = response.status;
|
|
3261
3271
|
let _headers = {};
|
|
3262
3272
|
if (response.headers && typeof response.headers === "object") {
|
|
@@ -3280,6 +3290,13 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3280
3290
|
result404 = JSON.parse(resultData404);
|
|
3281
3291
|
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
3282
3292
|
}
|
|
3293
|
+
else if (status === 409) {
|
|
3294
|
+
const _responseText = response.data;
|
|
3295
|
+
let result409 = null;
|
|
3296
|
+
let resultData409 = _responseText;
|
|
3297
|
+
result409 = JSON.parse(resultData409);
|
|
3298
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
3299
|
+
}
|
|
3283
3300
|
else if (status === 401) {
|
|
3284
3301
|
const _responseText = response.data;
|
|
3285
3302
|
return throwException("Unauthorized", status, _responseText, _headers);
|
|
@@ -3295,17 +3312,22 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3295
3312
|
return Promise.resolve(null);
|
|
3296
3313
|
}
|
|
3297
3314
|
/**
|
|
3298
|
-
*
|
|
3315
|
+
* Updates a specified print-area in an existing design file with the data provided as a json-serialized print-area model.
|
|
3299
3316
|
* @param id Design identifier.
|
|
3317
|
+
* @param printAreaId Design print-area identifier.
|
|
3300
3318
|
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
3301
3319
|
* @param tenantId (optional) Tenant identifier
|
|
3320
|
+
* @param body (optional) Updated print-area model.
|
|
3302
3321
|
* @return Success
|
|
3303
3322
|
*/
|
|
3304
|
-
|
|
3305
|
-
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/
|
|
3323
|
+
updateDesignPrintAreaModel(id, printAreaId, privateStorageOwner, tenantId, body, cancelToken) {
|
|
3324
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/print-product/print-areas/{printAreaId}/model?";
|
|
3306
3325
|
if (id === undefined || id === null)
|
|
3307
3326
|
throw new Error("The parameter 'id' must be defined.");
|
|
3308
3327
|
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
3328
|
+
if (printAreaId === undefined || printAreaId === null)
|
|
3329
|
+
throw new Error("The parameter 'printAreaId' must be defined.");
|
|
3330
|
+
url_ = url_.replace("{printAreaId}", encodeURIComponent("" + printAreaId));
|
|
3309
3331
|
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
3310
3332
|
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
3311
3333
|
if (tenantId === null)
|
|
@@ -3313,12 +3335,14 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3313
3335
|
else if (tenantId !== undefined)
|
|
3314
3336
|
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
3315
3337
|
url_ = url_.replace(/[?&]$/, "");
|
|
3338
|
+
const content_ = JSON.stringify(body);
|
|
3316
3339
|
let options_ = {
|
|
3317
|
-
|
|
3318
|
-
method: "
|
|
3340
|
+
data: content_,
|
|
3341
|
+
method: "PUT",
|
|
3319
3342
|
url: url_,
|
|
3320
3343
|
headers: {
|
|
3321
|
-
"
|
|
3344
|
+
"Content-Type": "application/json",
|
|
3345
|
+
"Accept": "application/json"
|
|
3322
3346
|
},
|
|
3323
3347
|
cancelToken
|
|
3324
3348
|
};
|
|
@@ -3332,10 +3356,10 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3332
3356
|
throw _error;
|
|
3333
3357
|
}
|
|
3334
3358
|
}).then((_response) => {
|
|
3335
|
-
return this.transformResult(url_, _response, (_response) => this.
|
|
3359
|
+
return this.transformResult(url_, _response, (_response) => this.processUpdateDesignPrintAreaModel(_response));
|
|
3336
3360
|
});
|
|
3337
3361
|
}
|
|
3338
|
-
|
|
3362
|
+
processUpdateDesignPrintAreaModel(response) {
|
|
3339
3363
|
const status = response.status;
|
|
3340
3364
|
let _headers = {};
|
|
3341
3365
|
if (response.headers && typeof response.headers === "object") {
|
|
@@ -3345,11 +3369,19 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3345
3369
|
}
|
|
3346
3370
|
}
|
|
3347
3371
|
}
|
|
3348
|
-
if (status === 200
|
|
3349
|
-
const
|
|
3350
|
-
|
|
3351
|
-
|
|
3352
|
-
|
|
3372
|
+
if (status === 200) {
|
|
3373
|
+
const _responseText = response.data;
|
|
3374
|
+
let result200 = null;
|
|
3375
|
+
let resultData200 = _responseText;
|
|
3376
|
+
result200 = JSON.parse(resultData200);
|
|
3377
|
+
return Promise.resolve(result200);
|
|
3378
|
+
}
|
|
3379
|
+
else if (status === 400) {
|
|
3380
|
+
const _responseText = response.data;
|
|
3381
|
+
let result400 = null;
|
|
3382
|
+
let resultData400 = _responseText;
|
|
3383
|
+
result400 = JSON.parse(resultData400);
|
|
3384
|
+
return throwException("Bad Request", status, _responseText, _headers, result400);
|
|
3353
3385
|
}
|
|
3354
3386
|
else if (status === 404) {
|
|
3355
3387
|
const _responseText = response.data;
|
|
@@ -3380,17 +3412,22 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3380
3412
|
return Promise.resolve(null);
|
|
3381
3413
|
}
|
|
3382
3414
|
/**
|
|
3383
|
-
*
|
|
3415
|
+
* Inserts a new print-area provided as a json-serialized model at the specified position in an existing design file.
|
|
3416
|
+
Print-area identifier will be reset by auto-generated value to prevent identifiers collisions.
|
|
3384
3417
|
* @param id Design identifier.
|
|
3418
|
+
* @param surfaceId (optional) Parent surface identifier.
|
|
3385
3419
|
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
3386
3420
|
* @param tenantId (optional) Tenant identifier
|
|
3421
|
+
* @param body (optional) New print-area model.
|
|
3387
3422
|
* @return Success
|
|
3388
3423
|
*/
|
|
3389
|
-
|
|
3390
|
-
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/
|
|
3424
|
+
addDesignPrintAreaModel(id, surfaceId, privateStorageOwner, tenantId, body, cancelToken) {
|
|
3425
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/print-product/print-areas/model?";
|
|
3391
3426
|
if (id === undefined || id === null)
|
|
3392
3427
|
throw new Error("The parameter 'id' must be defined.");
|
|
3393
3428
|
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
3429
|
+
if (surfaceId !== undefined && surfaceId !== null)
|
|
3430
|
+
url_ += "surfaceId=" + encodeURIComponent("" + surfaceId) + "&";
|
|
3394
3431
|
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
3395
3432
|
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
3396
3433
|
if (tenantId === null)
|
|
@@ -3398,12 +3435,14 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3398
3435
|
else if (tenantId !== undefined)
|
|
3399
3436
|
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
3400
3437
|
url_ = url_.replace(/[?&]$/, "");
|
|
3438
|
+
const content_ = JSON.stringify(body);
|
|
3401
3439
|
let options_ = {
|
|
3402
|
-
|
|
3403
|
-
method: "
|
|
3440
|
+
data: content_,
|
|
3441
|
+
method: "POST",
|
|
3404
3442
|
url: url_,
|
|
3405
3443
|
headers: {
|
|
3406
|
-
"
|
|
3444
|
+
"Content-Type": "application/json",
|
|
3445
|
+
"Accept": "application/json"
|
|
3407
3446
|
},
|
|
3408
3447
|
cancelToken
|
|
3409
3448
|
};
|
|
@@ -3417,10 +3456,10 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3417
3456
|
throw _error;
|
|
3418
3457
|
}
|
|
3419
3458
|
}).then((_response) => {
|
|
3420
|
-
return this.transformResult(url_, _response, (_response) => this.
|
|
3459
|
+
return this.transformResult(url_, _response, (_response) => this.processAddDesignPrintAreaModel(_response));
|
|
3421
3460
|
});
|
|
3422
3461
|
}
|
|
3423
|
-
|
|
3462
|
+
processAddDesignPrintAreaModel(response) {
|
|
3424
3463
|
const status = response.status;
|
|
3425
3464
|
let _headers = {};
|
|
3426
3465
|
if (response.headers && typeof response.headers === "object") {
|
|
@@ -3430,11 +3469,19 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3430
3469
|
}
|
|
3431
3470
|
}
|
|
3432
3471
|
}
|
|
3433
|
-
if (status === 200
|
|
3434
|
-
const
|
|
3435
|
-
|
|
3436
|
-
|
|
3437
|
-
|
|
3472
|
+
if (status === 200) {
|
|
3473
|
+
const _responseText = response.data;
|
|
3474
|
+
let result200 = null;
|
|
3475
|
+
let resultData200 = _responseText;
|
|
3476
|
+
result200 = JSON.parse(resultData200);
|
|
3477
|
+
return Promise.resolve(result200);
|
|
3478
|
+
}
|
|
3479
|
+
else if (status === 400) {
|
|
3480
|
+
const _responseText = response.data;
|
|
3481
|
+
let result400 = null;
|
|
3482
|
+
let resultData400 = _responseText;
|
|
3483
|
+
result400 = JSON.parse(resultData400);
|
|
3484
|
+
return throwException("Bad Request", status, _responseText, _headers, result400);
|
|
3438
3485
|
}
|
|
3439
3486
|
else if (status === 404) {
|
|
3440
3487
|
const _responseText = response.data;
|
|
@@ -3443,13 +3490,6 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3443
3490
|
result404 = JSON.parse(resultData404);
|
|
3444
3491
|
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
3445
3492
|
}
|
|
3446
|
-
else if (status === 409) {
|
|
3447
|
-
const _responseText = response.data;
|
|
3448
|
-
let result409 = null;
|
|
3449
|
-
let resultData409 = _responseText;
|
|
3450
|
-
result409 = JSON.parse(resultData409);
|
|
3451
|
-
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
3452
|
-
}
|
|
3453
3493
|
else if (status === 401) {
|
|
3454
3494
|
const _responseText = response.data;
|
|
3455
3495
|
return throwException("Unauthorized", status, _responseText, _headers);
|
|
@@ -3465,14 +3505,14 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3465
3505
|
return Promise.resolve(null);
|
|
3466
3506
|
}
|
|
3467
3507
|
/**
|
|
3468
|
-
*
|
|
3508
|
+
* Returns a list of print-product surfaces descriptions of the specified design file.
|
|
3469
3509
|
* @param id Design identifier.
|
|
3470
3510
|
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
3471
3511
|
* @param tenantId (optional) Tenant identifier
|
|
3472
3512
|
* @return Success
|
|
3473
3513
|
*/
|
|
3474
|
-
|
|
3475
|
-
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/
|
|
3514
|
+
getDesignSurfaces(id, privateStorageOwner, tenantId, cancelToken) {
|
|
3515
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/print-product/surfaces?";
|
|
3476
3516
|
if (id === undefined || id === null)
|
|
3477
3517
|
throw new Error("The parameter 'id' must be defined.");
|
|
3478
3518
|
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
@@ -3501,10 +3541,10 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3501
3541
|
throw _error;
|
|
3502
3542
|
}
|
|
3503
3543
|
}).then((_response) => {
|
|
3504
|
-
return this.transformResult(url_, _response, (_response) => this.
|
|
3544
|
+
return this.transformResult(url_, _response, (_response) => this.processGetDesignSurfaces(_response));
|
|
3505
3545
|
});
|
|
3506
3546
|
}
|
|
3507
|
-
|
|
3547
|
+
processGetDesignSurfaces(response) {
|
|
3508
3548
|
const status = response.status;
|
|
3509
3549
|
let _headers = {};
|
|
3510
3550
|
if (response.headers && typeof response.headers === "object") {
|
|
@@ -3543,18 +3583,21 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3543
3583
|
return Promise.resolve(null);
|
|
3544
3584
|
}
|
|
3545
3585
|
/**
|
|
3546
|
-
*
|
|
3586
|
+
* Deletes a specified print-product surface in an existing design file.
|
|
3547
3587
|
* @param id Design identifier.
|
|
3588
|
+
* @param surfaceId Surface identifier.
|
|
3548
3589
|
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
3549
3590
|
* @param tenantId (optional) Tenant identifier
|
|
3550
|
-
* @
|
|
3551
|
-
* @return Success
|
|
3591
|
+
* @return No Content
|
|
3552
3592
|
*/
|
|
3553
|
-
|
|
3554
|
-
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/
|
|
3593
|
+
deleteDesignSurface(id, surfaceId, privateStorageOwner, tenantId, cancelToken) {
|
|
3594
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/print-product/surfaces/{surfaceId}?";
|
|
3555
3595
|
if (id === undefined || id === null)
|
|
3556
3596
|
throw new Error("The parameter 'id' must be defined.");
|
|
3557
3597
|
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
3598
|
+
if (surfaceId === undefined || surfaceId === null)
|
|
3599
|
+
throw new Error("The parameter 'surfaceId' must be defined.");
|
|
3600
|
+
url_ = url_.replace("{surfaceId}", encodeURIComponent("" + surfaceId));
|
|
3558
3601
|
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
3559
3602
|
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
3560
3603
|
if (tenantId === null)
|
|
@@ -3562,14 +3605,10 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3562
3605
|
else if (tenantId !== undefined)
|
|
3563
3606
|
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
3564
3607
|
url_ = url_.replace(/[?&]$/, "");
|
|
3565
|
-
const content_ = JSON.stringify(body);
|
|
3566
3608
|
let options_ = {
|
|
3567
|
-
|
|
3568
|
-
method: "PUT",
|
|
3609
|
+
method: "DELETE",
|
|
3569
3610
|
url: url_,
|
|
3570
|
-
headers: {
|
|
3571
|
-
"Content-Type": "application/json",
|
|
3572
|
-
},
|
|
3611
|
+
headers: {},
|
|
3573
3612
|
cancelToken
|
|
3574
3613
|
};
|
|
3575
3614
|
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
@@ -3582,10 +3621,10 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3582
3621
|
throw _error;
|
|
3583
3622
|
}
|
|
3584
3623
|
}).then((_response) => {
|
|
3585
|
-
return this.transformResult(url_, _response, (_response) => this.
|
|
3624
|
+
return this.transformResult(url_, _response, (_response) => this.processDeleteDesignSurface(_response));
|
|
3586
3625
|
});
|
|
3587
3626
|
}
|
|
3588
|
-
|
|
3627
|
+
processDeleteDesignSurface(response) {
|
|
3589
3628
|
const status = response.status;
|
|
3590
3629
|
let _headers = {};
|
|
3591
3630
|
if (response.headers && typeof response.headers === "object") {
|
|
@@ -3595,7 +3634,7 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3595
3634
|
}
|
|
3596
3635
|
}
|
|
3597
3636
|
}
|
|
3598
|
-
if (status ===
|
|
3637
|
+
if (status === 204) {
|
|
3599
3638
|
const _responseText = response.data;
|
|
3600
3639
|
return Promise.resolve(null);
|
|
3601
3640
|
}
|
|
@@ -3628,17 +3667,21 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3628
3667
|
return Promise.resolve(null);
|
|
3629
3668
|
}
|
|
3630
3669
|
/**
|
|
3631
|
-
*
|
|
3670
|
+
* Returns a down-mockup description of the specified surface in an existing design file.
|
|
3632
3671
|
* @param id Design identifier.
|
|
3672
|
+
* @param surfaceId Design surface identifier.
|
|
3633
3673
|
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
3634
3674
|
* @param tenantId (optional) Tenant identifier
|
|
3635
3675
|
* @return Success
|
|
3636
3676
|
*/
|
|
3637
|
-
|
|
3638
|
-
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/
|
|
3677
|
+
getDesignSurfaceDownMockup(id, surfaceId, privateStorageOwner, tenantId, cancelToken) {
|
|
3678
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/print-product/surfaces/{surfaceId}/mockup-down?";
|
|
3639
3679
|
if (id === undefined || id === null)
|
|
3640
3680
|
throw new Error("The parameter 'id' must be defined.");
|
|
3641
3681
|
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
3682
|
+
if (surfaceId === undefined || surfaceId === null)
|
|
3683
|
+
throw new Error("The parameter 'surfaceId' must be defined.");
|
|
3684
|
+
url_ = url_.replace("{surfaceId}", encodeURIComponent("" + surfaceId));
|
|
3642
3685
|
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
3643
3686
|
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
3644
3687
|
if (tenantId === null)
|
|
@@ -3664,10 +3707,10 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3664
3707
|
throw _error;
|
|
3665
3708
|
}
|
|
3666
3709
|
}).then((_response) => {
|
|
3667
|
-
return this.transformResult(url_, _response, (_response) => this.
|
|
3710
|
+
return this.transformResult(url_, _response, (_response) => this.processGetDesignSurfaceDownMockup(_response));
|
|
3668
3711
|
});
|
|
3669
3712
|
}
|
|
3670
|
-
|
|
3713
|
+
processGetDesignSurfaceDownMockup(response) {
|
|
3671
3714
|
const status = response.status;
|
|
3672
3715
|
let _headers = {};
|
|
3673
3716
|
if (response.headers && typeof response.headers === "object") {
|
|
@@ -3684,6 +3727,13 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3684
3727
|
result200 = JSON.parse(resultData200);
|
|
3685
3728
|
return Promise.resolve(result200);
|
|
3686
3729
|
}
|
|
3730
|
+
else if (status === 400) {
|
|
3731
|
+
const _responseText = response.data;
|
|
3732
|
+
let result400 = null;
|
|
3733
|
+
let resultData400 = _responseText;
|
|
3734
|
+
result400 = JSON.parse(resultData400);
|
|
3735
|
+
return throwException("Bad Request", status, _responseText, _headers, result400);
|
|
3736
|
+
}
|
|
3687
3737
|
else if (status === 404) {
|
|
3688
3738
|
const _responseText = response.data;
|
|
3689
3739
|
let result404 = null;
|
|
@@ -3713,18 +3763,24 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3713
3763
|
return Promise.resolve(null);
|
|
3714
3764
|
}
|
|
3715
3765
|
/**
|
|
3716
|
-
*
|
|
3766
|
+
* Updates a content file of down-mockup for the specified surface in an existing design file.
|
|
3717
3767
|
* @param id Design identifier.
|
|
3768
|
+
* @param surfaceId Design surface identifier.
|
|
3718
3769
|
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
3719
3770
|
* @param tenantId (optional) Tenant identifier
|
|
3720
|
-
* @param
|
|
3771
|
+
* @param position_top (optional)
|
|
3772
|
+
* @param position_left (optional)
|
|
3773
|
+
* @param sourceFile (optional)
|
|
3721
3774
|
* @return Success
|
|
3722
3775
|
*/
|
|
3723
|
-
|
|
3724
|
-
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/
|
|
3776
|
+
updateDesignSurfaceDownMockup(id, surfaceId, privateStorageOwner, tenantId, position_top, position_left, sourceFile, cancelToken) {
|
|
3777
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/print-product/surfaces/{surfaceId}/mockup-down?";
|
|
3725
3778
|
if (id === undefined || id === null)
|
|
3726
3779
|
throw new Error("The parameter 'id' must be defined.");
|
|
3727
3780
|
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
3781
|
+
if (surfaceId === undefined || surfaceId === null)
|
|
3782
|
+
throw new Error("The parameter 'surfaceId' must be defined.");
|
|
3783
|
+
url_ = url_.replace("{surfaceId}", encodeURIComponent("" + surfaceId));
|
|
3728
3784
|
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
3729
3785
|
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
3730
3786
|
if (tenantId === null)
|
|
@@ -3732,13 +3788,23 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3732
3788
|
else if (tenantId !== undefined)
|
|
3733
3789
|
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
3734
3790
|
url_ = url_.replace(/[?&]$/, "");
|
|
3735
|
-
const content_ =
|
|
3791
|
+
const content_ = new FormData();
|
|
3792
|
+
if (position_top === null || position_top === undefined)
|
|
3793
|
+
throw new Error("The parameter 'position_top' cannot be null.");
|
|
3794
|
+
else
|
|
3795
|
+
content_.append("position.top", position_top.toString());
|
|
3796
|
+
if (position_left === null || position_left === undefined)
|
|
3797
|
+
throw new Error("The parameter 'position_left' cannot be null.");
|
|
3798
|
+
else
|
|
3799
|
+
content_.append("position.left", position_left.toString());
|
|
3800
|
+
if (sourceFile !== null && sourceFile !== undefined)
|
|
3801
|
+
content_.append("sourceFile", sourceFile.data, sourceFile.fileName ? sourceFile.fileName : "sourceFile");
|
|
3736
3802
|
let options_ = {
|
|
3737
3803
|
data: content_,
|
|
3738
|
-
method: "
|
|
3804
|
+
method: "PATCH",
|
|
3739
3805
|
url: url_,
|
|
3740
3806
|
headers: {
|
|
3741
|
-
"
|
|
3807
|
+
"Accept": "application/json"
|
|
3742
3808
|
},
|
|
3743
3809
|
cancelToken
|
|
3744
3810
|
};
|
|
@@ -3752,10 +3818,10 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3752
3818
|
throw _error;
|
|
3753
3819
|
}
|
|
3754
3820
|
}).then((_response) => {
|
|
3755
|
-
return this.transformResult(url_, _response, (_response) => this.
|
|
3821
|
+
return this.transformResult(url_, _response, (_response) => this.processUpdateDesignSurfaceDownMockup(_response));
|
|
3756
3822
|
});
|
|
3757
3823
|
}
|
|
3758
|
-
|
|
3824
|
+
processUpdateDesignSurfaceDownMockup(response) {
|
|
3759
3825
|
const status = response.status;
|
|
3760
3826
|
let _headers = {};
|
|
3761
3827
|
if (response.headers && typeof response.headers === "object") {
|
|
@@ -3767,7 +3833,17 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3767
3833
|
}
|
|
3768
3834
|
if (status === 200) {
|
|
3769
3835
|
const _responseText = response.data;
|
|
3770
|
-
|
|
3836
|
+
let result200 = null;
|
|
3837
|
+
let resultData200 = _responseText;
|
|
3838
|
+
result200 = JSON.parse(resultData200);
|
|
3839
|
+
return Promise.resolve(result200);
|
|
3840
|
+
}
|
|
3841
|
+
else if (status === 400) {
|
|
3842
|
+
const _responseText = response.data;
|
|
3843
|
+
let result400 = null;
|
|
3844
|
+
let resultData400 = _responseText;
|
|
3845
|
+
result400 = JSON.parse(resultData400);
|
|
3846
|
+
return throwException("Bad Request", status, _responseText, _headers, result400);
|
|
3771
3847
|
}
|
|
3772
3848
|
else if (status === 404) {
|
|
3773
3849
|
const _responseText = response.data;
|
|
@@ -3776,6 +3852,13 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3776
3852
|
result404 = JSON.parse(resultData404);
|
|
3777
3853
|
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
3778
3854
|
}
|
|
3855
|
+
else if (status === 409) {
|
|
3856
|
+
const _responseText = response.data;
|
|
3857
|
+
let result409 = null;
|
|
3858
|
+
let resultData409 = _responseText;
|
|
3859
|
+
result409 = JSON.parse(resultData409);
|
|
3860
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
3861
|
+
}
|
|
3779
3862
|
else if (status === 401) {
|
|
3780
3863
|
const _responseText = response.data;
|
|
3781
3864
|
return throwException("Unauthorized", status, _responseText, _headers);
|
|
@@ -3791,17 +3874,21 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3791
3874
|
return Promise.resolve(null);
|
|
3792
3875
|
}
|
|
3793
3876
|
/**
|
|
3794
|
-
*
|
|
3877
|
+
* Returns a content file for down-mockup of the specified surface in an existing design file.
|
|
3795
3878
|
* @param id Design identifier.
|
|
3879
|
+
* @param surfaceId Design surface identifier.
|
|
3796
3880
|
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
3797
3881
|
* @param tenantId (optional) Tenant identifier
|
|
3798
3882
|
* @return Success
|
|
3799
3883
|
*/
|
|
3800
|
-
|
|
3801
|
-
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/
|
|
3884
|
+
getDesignSurfaceDownMockupContent(id, surfaceId, privateStorageOwner, tenantId, cancelToken) {
|
|
3885
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/print-product/surfaces/{surfaceId}/mockup-down/file?";
|
|
3802
3886
|
if (id === undefined || id === null)
|
|
3803
3887
|
throw new Error("The parameter 'id' must be defined.");
|
|
3804
3888
|
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
3889
|
+
if (surfaceId === undefined || surfaceId === null)
|
|
3890
|
+
throw new Error("The parameter 'surfaceId' must be defined.");
|
|
3891
|
+
url_ = url_.replace("{surfaceId}", encodeURIComponent("" + surfaceId));
|
|
3805
3892
|
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
3806
3893
|
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
3807
3894
|
if (tenantId === null)
|
|
@@ -3810,9 +3897,12 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3810
3897
|
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
3811
3898
|
url_ = url_.replace(/[?&]$/, "");
|
|
3812
3899
|
let options_ = {
|
|
3813
|
-
|
|
3900
|
+
responseType: "blob",
|
|
3901
|
+
method: "GET",
|
|
3814
3902
|
url: url_,
|
|
3815
|
-
headers: {
|
|
3903
|
+
headers: {
|
|
3904
|
+
"Accept": "application/json"
|
|
3905
|
+
},
|
|
3816
3906
|
cancelToken
|
|
3817
3907
|
};
|
|
3818
3908
|
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
@@ -3825,10 +3915,10 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3825
3915
|
throw _error;
|
|
3826
3916
|
}
|
|
3827
3917
|
}).then((_response) => {
|
|
3828
|
-
return this.transformResult(url_, _response, (_response) => this.
|
|
3918
|
+
return this.transformResult(url_, _response, (_response) => this.processGetDesignSurfaceDownMockupContent(_response));
|
|
3829
3919
|
});
|
|
3830
3920
|
}
|
|
3831
|
-
|
|
3921
|
+
processGetDesignSurfaceDownMockupContent(response) {
|
|
3832
3922
|
const status = response.status;
|
|
3833
3923
|
let _headers = {};
|
|
3834
3924
|
if (response.headers && typeof response.headers === "object") {
|
|
@@ -3838,9 +3928,25 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3838
3928
|
}
|
|
3839
3929
|
}
|
|
3840
3930
|
}
|
|
3841
|
-
if (status === 200) {
|
|
3931
|
+
if (status === 200 || status === 206) {
|
|
3932
|
+
const contentDisposition = response.headers ? response.headers["content-disposition"] : undefined;
|
|
3933
|
+
const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
|
|
3934
|
+
const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
|
|
3935
|
+
return Promise.resolve({ fileName: fileName, status: status, data: new Blob([response.data]), headers: _headers });
|
|
3936
|
+
}
|
|
3937
|
+
else if (status === 400) {
|
|
3842
3938
|
const _responseText = response.data;
|
|
3843
|
-
|
|
3939
|
+
let result400 = null;
|
|
3940
|
+
let resultData400 = _responseText;
|
|
3941
|
+
result400 = JSON.parse(resultData400);
|
|
3942
|
+
return throwException("Bad Request", status, _responseText, _headers, result400);
|
|
3943
|
+
}
|
|
3944
|
+
else if (status === 404) {
|
|
3945
|
+
const _responseText = response.data;
|
|
3946
|
+
let result404 = null;
|
|
3947
|
+
let resultData404 = _responseText;
|
|
3948
|
+
result404 = JSON.parse(resultData404);
|
|
3949
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
3844
3950
|
}
|
|
3845
3951
|
else if (status === 409) {
|
|
3846
3952
|
const _responseText = response.data;
|
|
@@ -3864,17 +3970,21 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3864
3970
|
return Promise.resolve(null);
|
|
3865
3971
|
}
|
|
3866
3972
|
/**
|
|
3867
|
-
*
|
|
3868
|
-
* @param id
|
|
3973
|
+
* Returns an up-mockup description of the specified surface in an existing design file.
|
|
3974
|
+
* @param id Design identifier.
|
|
3975
|
+
* @param surfaceId Design surface identifier.
|
|
3869
3976
|
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
3870
3977
|
* @param tenantId (optional) Tenant identifier
|
|
3871
3978
|
* @return Success
|
|
3872
3979
|
*/
|
|
3873
|
-
|
|
3874
|
-
let url_ = this.baseUrl + "/api/atoms/v1/designs/
|
|
3980
|
+
getDesignSurfaceUpMockup(id, surfaceId, privateStorageOwner, tenantId, cancelToken) {
|
|
3981
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/print-product/surfaces/{surfaceId}/mockup-up?";
|
|
3875
3982
|
if (id === undefined || id === null)
|
|
3876
3983
|
throw new Error("The parameter 'id' must be defined.");
|
|
3877
3984
|
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
3985
|
+
if (surfaceId === undefined || surfaceId === null)
|
|
3986
|
+
throw new Error("The parameter 'surfaceId' must be defined.");
|
|
3987
|
+
url_ = url_.replace("{surfaceId}", encodeURIComponent("" + surfaceId));
|
|
3878
3988
|
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
3879
3989
|
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
3880
3990
|
if (tenantId === null)
|
|
@@ -3900,10 +4010,10 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3900
4010
|
throw _error;
|
|
3901
4011
|
}
|
|
3902
4012
|
}).then((_response) => {
|
|
3903
|
-
return this.transformResult(url_, _response, (_response) => this.
|
|
4013
|
+
return this.transformResult(url_, _response, (_response) => this.processGetDesignSurfaceUpMockup(_response));
|
|
3904
4014
|
});
|
|
3905
4015
|
}
|
|
3906
|
-
|
|
4016
|
+
processGetDesignSurfaceUpMockup(response) {
|
|
3907
4017
|
const status = response.status;
|
|
3908
4018
|
let _headers = {};
|
|
3909
4019
|
if (response.headers && typeof response.headers === "object") {
|
|
@@ -3920,6 +4030,13 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3920
4030
|
result200 = JSON.parse(resultData200);
|
|
3921
4031
|
return Promise.resolve(result200);
|
|
3922
4032
|
}
|
|
4033
|
+
else if (status === 400) {
|
|
4034
|
+
const _responseText = response.data;
|
|
4035
|
+
let result400 = null;
|
|
4036
|
+
let resultData400 = _responseText;
|
|
4037
|
+
result400 = JSON.parse(resultData400);
|
|
4038
|
+
return throwException("Bad Request", status, _responseText, _headers, result400);
|
|
4039
|
+
}
|
|
3923
4040
|
else if (status === 404) {
|
|
3924
4041
|
const _responseText = response.data;
|
|
3925
4042
|
let result404 = null;
|
|
@@ -3927,12 +4044,12 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3927
4044
|
result404 = JSON.parse(resultData404);
|
|
3928
4045
|
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
3929
4046
|
}
|
|
3930
|
-
else if (status ===
|
|
4047
|
+
else if (status === 409) {
|
|
3931
4048
|
const _responseText = response.data;
|
|
3932
|
-
let
|
|
3933
|
-
let
|
|
3934
|
-
|
|
3935
|
-
return throwException("
|
|
4049
|
+
let result409 = null;
|
|
4050
|
+
let resultData409 = _responseText;
|
|
4051
|
+
result409 = JSON.parse(resultData409);
|
|
4052
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
3936
4053
|
}
|
|
3937
4054
|
else if (status === 401) {
|
|
3938
4055
|
const _responseText = response.data;
|
|
@@ -3949,25 +4066,47 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3949
4066
|
return Promise.resolve(null);
|
|
3950
4067
|
}
|
|
3951
4068
|
/**
|
|
3952
|
-
*
|
|
4069
|
+
* Updates a content file of up-mockup for the specified surface in an existing design.
|
|
4070
|
+
* @param id Design identifier.
|
|
4071
|
+
* @param surfaceId Design surface identifier.
|
|
4072
|
+
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
3953
4073
|
* @param tenantId (optional) Tenant identifier
|
|
3954
|
-
* @param
|
|
4074
|
+
* @param position_top (optional)
|
|
4075
|
+
* @param position_left (optional)
|
|
4076
|
+
* @param sourceFile (optional)
|
|
3955
4077
|
* @return Success
|
|
3956
4078
|
*/
|
|
3957
|
-
|
|
3958
|
-
let url_ = this.baseUrl + "/api/atoms/v1/designs/
|
|
4079
|
+
updateDesignSurfaceUpMockup(id, surfaceId, privateStorageOwner, tenantId, position_top, position_left, sourceFile, cancelToken) {
|
|
4080
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/print-product/surfaces/{surfaceId}/mockup-up?";
|
|
4081
|
+
if (id === undefined || id === null)
|
|
4082
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
4083
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
4084
|
+
if (surfaceId === undefined || surfaceId === null)
|
|
4085
|
+
throw new Error("The parameter 'surfaceId' must be defined.");
|
|
4086
|
+
url_ = url_.replace("{surfaceId}", encodeURIComponent("" + surfaceId));
|
|
4087
|
+
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
4088
|
+
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
3959
4089
|
if (tenantId === null)
|
|
3960
4090
|
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
3961
4091
|
else if (tenantId !== undefined)
|
|
3962
4092
|
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
3963
4093
|
url_ = url_.replace(/[?&]$/, "");
|
|
3964
|
-
const content_ =
|
|
4094
|
+
const content_ = new FormData();
|
|
4095
|
+
if (position_top === null || position_top === undefined)
|
|
4096
|
+
throw new Error("The parameter 'position_top' cannot be null.");
|
|
4097
|
+
else
|
|
4098
|
+
content_.append("position.top", position_top.toString());
|
|
4099
|
+
if (position_left === null || position_left === undefined)
|
|
4100
|
+
throw new Error("The parameter 'position_left' cannot be null.");
|
|
4101
|
+
else
|
|
4102
|
+
content_.append("position.left", position_left.toString());
|
|
4103
|
+
if (sourceFile !== null && sourceFile !== undefined)
|
|
4104
|
+
content_.append("sourceFile", sourceFile.data, sourceFile.fileName ? sourceFile.fileName : "sourceFile");
|
|
3965
4105
|
let options_ = {
|
|
3966
4106
|
data: content_,
|
|
3967
|
-
method: "
|
|
4107
|
+
method: "PATCH",
|
|
3968
4108
|
url: url_,
|
|
3969
4109
|
headers: {
|
|
3970
|
-
"Content-Type": "application/json",
|
|
3971
4110
|
"Accept": "application/json"
|
|
3972
4111
|
},
|
|
3973
4112
|
cancelToken
|
|
@@ -3982,10 +4121,10 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3982
4121
|
throw _error;
|
|
3983
4122
|
}
|
|
3984
4123
|
}).then((_response) => {
|
|
3985
|
-
return this.transformResult(url_, _response, (_response) => this.
|
|
4124
|
+
return this.transformResult(url_, _response, (_response) => this.processUpdateDesignSurfaceUpMockup(_response));
|
|
3986
4125
|
});
|
|
3987
4126
|
}
|
|
3988
|
-
|
|
4127
|
+
processUpdateDesignSurfaceUpMockup(response) {
|
|
3989
4128
|
const status = response.status;
|
|
3990
4129
|
let _headers = {};
|
|
3991
4130
|
if (response.headers && typeof response.headers === "object") {
|
|
@@ -4002,6 +4141,13 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
4002
4141
|
result200 = JSON.parse(resultData200);
|
|
4003
4142
|
return Promise.resolve(result200);
|
|
4004
4143
|
}
|
|
4144
|
+
else if (status === 400) {
|
|
4145
|
+
const _responseText = response.data;
|
|
4146
|
+
let result400 = null;
|
|
4147
|
+
let resultData400 = _responseText;
|
|
4148
|
+
result400 = JSON.parse(resultData400);
|
|
4149
|
+
return throwException("Bad Request", status, _responseText, _headers, result400);
|
|
4150
|
+
}
|
|
4005
4151
|
else if (status === 404) {
|
|
4006
4152
|
const _responseText = response.data;
|
|
4007
4153
|
let result404 = null;
|
|
@@ -4009,6 +4155,13 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
4009
4155
|
result404 = JSON.parse(resultData404);
|
|
4010
4156
|
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
4011
4157
|
}
|
|
4158
|
+
else if (status === 409) {
|
|
4159
|
+
const _responseText = response.data;
|
|
4160
|
+
let result409 = null;
|
|
4161
|
+
let resultData409 = _responseText;
|
|
4162
|
+
result409 = JSON.parse(resultData409);
|
|
4163
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
4164
|
+
}
|
|
4012
4165
|
else if (status === 401) {
|
|
4013
4166
|
const _responseText = response.data;
|
|
4014
4167
|
return throwException("Unauthorized", status, _responseText, _headers);
|
|
@@ -4024,27 +4177,34 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
4024
4177
|
return Promise.resolve(null);
|
|
4025
4178
|
}
|
|
4026
4179
|
/**
|
|
4027
|
-
*
|
|
4180
|
+
* Returns a content file for up-mockup of the specified surface in an existing design file.
|
|
4181
|
+
* @param id Design identifier.
|
|
4182
|
+
* @param surfaceId Design surface identifier.
|
|
4183
|
+
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
4028
4184
|
* @param tenantId (optional) Tenant identifier
|
|
4029
|
-
* @param body (optional) Extraction parameters.
|
|
4030
4185
|
* @return Success
|
|
4031
4186
|
*/
|
|
4032
|
-
|
|
4033
|
-
let url_ = this.baseUrl + "/api/atoms/v1/designs/
|
|
4187
|
+
getDesignSurfaceUpMockupContent(id, surfaceId, privateStorageOwner, tenantId, cancelToken) {
|
|
4188
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/print-product/surfaces/{surfaceId}/mockup-up/file?";
|
|
4189
|
+
if (id === undefined || id === null)
|
|
4190
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
4191
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
4192
|
+
if (surfaceId === undefined || surfaceId === null)
|
|
4193
|
+
throw new Error("The parameter 'surfaceId' must be defined.");
|
|
4194
|
+
url_ = url_.replace("{surfaceId}", encodeURIComponent("" + surfaceId));
|
|
4195
|
+
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
4196
|
+
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
4034
4197
|
if (tenantId === null)
|
|
4035
4198
|
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
4036
4199
|
else if (tenantId !== undefined)
|
|
4037
4200
|
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
4038
4201
|
url_ = url_.replace(/[?&]$/, "");
|
|
4039
|
-
const content_ = JSON.stringify(body);
|
|
4040
4202
|
let options_ = {
|
|
4041
|
-
data: content_,
|
|
4042
4203
|
responseType: "blob",
|
|
4043
|
-
method: "
|
|
4204
|
+
method: "GET",
|
|
4044
4205
|
url: url_,
|
|
4045
4206
|
headers: {
|
|
4046
|
-
"
|
|
4047
|
-
"Accept": "application/octet-stream"
|
|
4207
|
+
"Accept": "application/json"
|
|
4048
4208
|
},
|
|
4049
4209
|
cancelToken
|
|
4050
4210
|
};
|
|
@@ -4058,10 +4218,10 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
4058
4218
|
throw _error;
|
|
4059
4219
|
}
|
|
4060
4220
|
}).then((_response) => {
|
|
4061
|
-
return this.transformResult(url_, _response, (_response) => this.
|
|
4221
|
+
return this.transformResult(url_, _response, (_response) => this.processGetDesignSurfaceUpMockupContent(_response));
|
|
4062
4222
|
});
|
|
4063
4223
|
}
|
|
4064
|
-
|
|
4224
|
+
processGetDesignSurfaceUpMockupContent(response) {
|
|
4065
4225
|
const status = response.status;
|
|
4066
4226
|
let _headers = {};
|
|
4067
4227
|
if (response.headers && typeof response.headers === "object") {
|
|
@@ -4077,6 +4237,31 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
4077
4237
|
const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
|
|
4078
4238
|
return Promise.resolve({ fileName: fileName, status: status, data: new Blob([response.data]), headers: _headers });
|
|
4079
4239
|
}
|
|
4240
|
+
else if (status === 204) {
|
|
4241
|
+
const _responseText = response.data;
|
|
4242
|
+
return throwException("No Content", status, _responseText, _headers);
|
|
4243
|
+
}
|
|
4244
|
+
else if (status === 400) {
|
|
4245
|
+
const _responseText = response.data;
|
|
4246
|
+
let result400 = null;
|
|
4247
|
+
let resultData400 = _responseText;
|
|
4248
|
+
result400 = JSON.parse(resultData400);
|
|
4249
|
+
return throwException("Bad Request", status, _responseText, _headers, result400);
|
|
4250
|
+
}
|
|
4251
|
+
else if (status === 404) {
|
|
4252
|
+
const _responseText = response.data;
|
|
4253
|
+
let result404 = null;
|
|
4254
|
+
let resultData404 = _responseText;
|
|
4255
|
+
result404 = JSON.parse(resultData404);
|
|
4256
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
4257
|
+
}
|
|
4258
|
+
else if (status === 409) {
|
|
4259
|
+
const _responseText = response.data;
|
|
4260
|
+
let result409 = null;
|
|
4261
|
+
let resultData409 = _responseText;
|
|
4262
|
+
result409 = JSON.parse(resultData409);
|
|
4263
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
4264
|
+
}
|
|
4080
4265
|
else if (status === 401) {
|
|
4081
4266
|
const _responseText = response.data;
|
|
4082
4267
|
return throwException("Unauthorized", status, _responseText, _headers);
|
|
@@ -4092,25 +4277,32 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
4092
4277
|
return Promise.resolve(null);
|
|
4093
4278
|
}
|
|
4094
4279
|
/**
|
|
4095
|
-
*
|
|
4280
|
+
* Returns a print-product surface of the specified design file as a json-serialized model.
|
|
4281
|
+
* @param id Design identifier.
|
|
4282
|
+
* @param surfaceId Surface identifier.
|
|
4283
|
+
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
4096
4284
|
* @param tenantId (optional) Tenant identifier
|
|
4097
|
-
* @param body (optional) Items to flatten.
|
|
4098
4285
|
* @return Success
|
|
4099
4286
|
*/
|
|
4100
|
-
|
|
4101
|
-
let url_ = this.baseUrl + "/api/atoms/v1/designs/
|
|
4287
|
+
getDesignSurfaceModel(id, surfaceId, privateStorageOwner, tenantId, cancelToken) {
|
|
4288
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/print-product/surfaces/{surfaceId}/model?";
|
|
4289
|
+
if (id === undefined || id === null)
|
|
4290
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
4291
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
4292
|
+
if (surfaceId === undefined || surfaceId === null)
|
|
4293
|
+
throw new Error("The parameter 'surfaceId' must be defined.");
|
|
4294
|
+
url_ = url_.replace("{surfaceId}", encodeURIComponent("" + surfaceId));
|
|
4295
|
+
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
4296
|
+
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
4102
4297
|
if (tenantId === null)
|
|
4103
4298
|
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
4104
4299
|
else if (tenantId !== undefined)
|
|
4105
4300
|
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
4106
4301
|
url_ = url_.replace(/[?&]$/, "");
|
|
4107
|
-
const content_ = JSON.stringify(body);
|
|
4108
4302
|
let options_ = {
|
|
4109
|
-
|
|
4110
|
-
method: "POST",
|
|
4303
|
+
method: "GET",
|
|
4111
4304
|
url: url_,
|
|
4112
4305
|
headers: {
|
|
4113
|
-
"Content-Type": "application/json",
|
|
4114
4306
|
"Accept": "application/json"
|
|
4115
4307
|
},
|
|
4116
4308
|
cancelToken
|
|
@@ -4125,10 +4317,10 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
4125
4317
|
throw _error;
|
|
4126
4318
|
}
|
|
4127
4319
|
}).then((_response) => {
|
|
4128
|
-
return this.transformResult(url_, _response, (_response) => this.
|
|
4320
|
+
return this.transformResult(url_, _response, (_response) => this.processGetDesignSurfaceModel(_response));
|
|
4129
4321
|
});
|
|
4130
4322
|
}
|
|
4131
|
-
|
|
4323
|
+
processGetDesignSurfaceModel(response) {
|
|
4132
4324
|
const status = response.status;
|
|
4133
4325
|
let _headers = {};
|
|
4134
4326
|
if (response.headers && typeof response.headers === "object") {
|
|
@@ -4145,6 +4337,20 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
4145
4337
|
result200 = JSON.parse(resultData200);
|
|
4146
4338
|
return Promise.resolve(result200);
|
|
4147
4339
|
}
|
|
4340
|
+
else if (status === 404) {
|
|
4341
|
+
const _responseText = response.data;
|
|
4342
|
+
let result404 = null;
|
|
4343
|
+
let resultData404 = _responseText;
|
|
4344
|
+
result404 = JSON.parse(resultData404);
|
|
4345
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
4346
|
+
}
|
|
4347
|
+
else if (status === 409) {
|
|
4348
|
+
const _responseText = response.data;
|
|
4349
|
+
let result409 = null;
|
|
4350
|
+
let resultData409 = _responseText;
|
|
4351
|
+
result409 = JSON.parse(resultData409);
|
|
4352
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
4353
|
+
}
|
|
4148
4354
|
else if (status === 401) {
|
|
4149
4355
|
const _responseText = response.data;
|
|
4150
4356
|
return throwException("Unauthorized", status, _responseText, _headers);
|
|
@@ -4160,29 +4366,37 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
4160
4366
|
return Promise.resolve(null);
|
|
4161
4367
|
}
|
|
4162
4368
|
/**
|
|
4163
|
-
*
|
|
4164
|
-
|
|
4369
|
+
* Replaces a specified print-product surface in an existing design file with the data provided as a json-serialized surface model.
|
|
4370
|
+
All identifiers of a replaced surface (including surface identifier) will be reset by auto-generated values to prevent identifiers collisions.
|
|
4371
|
+
* @param id Design identifier.
|
|
4372
|
+
* @param surfaceId Design surface identifier.
|
|
4373
|
+
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
4165
4374
|
* @param tenantId (optional) Tenant identifier
|
|
4166
|
-
* @param
|
|
4375
|
+
* @param body (optional) Updated surface model.
|
|
4167
4376
|
* @return Success
|
|
4168
4377
|
*/
|
|
4169
|
-
|
|
4170
|
-
let url_ = this.baseUrl + "/api/atoms/v1/designs/
|
|
4171
|
-
if (
|
|
4172
|
-
|
|
4378
|
+
replaceDesignSurfaceModel(id, surfaceId, privateStorageOwner, tenantId, body, cancelToken) {
|
|
4379
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/print-product/surfaces/{surfaceId}/model?";
|
|
4380
|
+
if (id === undefined || id === null)
|
|
4381
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
4382
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
4383
|
+
if (surfaceId === undefined || surfaceId === null)
|
|
4384
|
+
throw new Error("The parameter 'surfaceId' must be defined.");
|
|
4385
|
+
url_ = url_.replace("{surfaceId}", encodeURIComponent("" + surfaceId));
|
|
4386
|
+
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
4387
|
+
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
4173
4388
|
if (tenantId === null)
|
|
4174
4389
|
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
4175
4390
|
else if (tenantId !== undefined)
|
|
4176
4391
|
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
4177
4392
|
url_ = url_.replace(/[?&]$/, "");
|
|
4178
|
-
const content_ =
|
|
4179
|
-
if (sourceFile !== null && sourceFile !== undefined)
|
|
4180
|
-
content_.append("sourceFile", sourceFile.data, sourceFile.fileName ? sourceFile.fileName : "sourceFile");
|
|
4393
|
+
const content_ = JSON.stringify(body);
|
|
4181
4394
|
let options_ = {
|
|
4182
4395
|
data: content_,
|
|
4183
|
-
method: "
|
|
4396
|
+
method: "PUT",
|
|
4184
4397
|
url: url_,
|
|
4185
4398
|
headers: {
|
|
4399
|
+
"Content-Type": "application/json",
|
|
4186
4400
|
"Accept": "application/json"
|
|
4187
4401
|
},
|
|
4188
4402
|
cancelToken
|
|
@@ -4197,10 +4411,10 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
4197
4411
|
throw _error;
|
|
4198
4412
|
}
|
|
4199
4413
|
}).then((_response) => {
|
|
4200
|
-
return this.transformResult(url_, _response, (_response) => this.
|
|
4414
|
+
return this.transformResult(url_, _response, (_response) => this.processReplaceDesignSurfaceModel(_response));
|
|
4201
4415
|
});
|
|
4202
4416
|
}
|
|
4203
|
-
|
|
4417
|
+
processReplaceDesignSurfaceModel(response) {
|
|
4204
4418
|
const status = response.status;
|
|
4205
4419
|
let _headers = {};
|
|
4206
4420
|
if (response.headers && typeof response.headers === "object") {
|
|
@@ -4217,6 +4431,13 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
4217
4431
|
result200 = JSON.parse(resultData200);
|
|
4218
4432
|
return Promise.resolve(result200);
|
|
4219
4433
|
}
|
|
4434
|
+
else if (status === 400) {
|
|
4435
|
+
const _responseText = response.data;
|
|
4436
|
+
let result400 = null;
|
|
4437
|
+
let resultData400 = _responseText;
|
|
4438
|
+
result400 = JSON.parse(resultData400);
|
|
4439
|
+
return throwException("Bad Request", status, _responseText, _headers, result400);
|
|
4440
|
+
}
|
|
4220
4441
|
else if (status === 404) {
|
|
4221
4442
|
const _responseText = response.data;
|
|
4222
4443
|
let result404 = null;
|
|
@@ -4224,6 +4445,13 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
4224
4445
|
result404 = JSON.parse(resultData404);
|
|
4225
4446
|
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
4226
4447
|
}
|
|
4448
|
+
else if (status === 409) {
|
|
4449
|
+
const _responseText = response.data;
|
|
4450
|
+
let result409 = null;
|
|
4451
|
+
let resultData409 = _responseText;
|
|
4452
|
+
result409 = JSON.parse(resultData409);
|
|
4453
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
4454
|
+
}
|
|
4227
4455
|
else if (status === 401) {
|
|
4228
4456
|
const _responseText = response.data;
|
|
4229
4457
|
return throwException("Unauthorized", status, _responseText, _headers);
|
|
@@ -4239,29 +4467,38 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
4239
4467
|
return Promise.resolve(null);
|
|
4240
4468
|
}
|
|
4241
4469
|
/**
|
|
4242
|
-
*
|
|
4243
|
-
|
|
4470
|
+
* Inserts a new surface provided as a json-serialized model at the specified position in an existing design file.
|
|
4471
|
+
All identifiers of a replaced surface (including surface identifier) will be reset by auto-generated values to prevent identifiers collisions.
|
|
4472
|
+
* @param id Design identifier.
|
|
4473
|
+
* @param surfaceIndex (optional) New surface index.
|
|
4474
|
+
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
4244
4475
|
* @param tenantId (optional) Tenant identifier
|
|
4245
|
-
* @param
|
|
4476
|
+
* @param body (optional) New surface model.
|
|
4246
4477
|
* @return Success
|
|
4247
4478
|
*/
|
|
4248
|
-
|
|
4249
|
-
let url_ = this.baseUrl + "/api/atoms/v1/designs/
|
|
4250
|
-
if (
|
|
4251
|
-
|
|
4479
|
+
addDesignSurfaceModel(id, surfaceIndex, privateStorageOwner, tenantId, body, cancelToken) {
|
|
4480
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/print-product/surfaces/model?";
|
|
4481
|
+
if (id === undefined || id === null)
|
|
4482
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
4483
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
4484
|
+
if (surfaceIndex === null)
|
|
4485
|
+
throw new Error("The parameter 'surfaceIndex' cannot be null.");
|
|
4486
|
+
else if (surfaceIndex !== undefined)
|
|
4487
|
+
url_ += "surfaceIndex=" + encodeURIComponent("" + surfaceIndex) + "&";
|
|
4488
|
+
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
4489
|
+
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
4252
4490
|
if (tenantId === null)
|
|
4253
4491
|
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
4254
4492
|
else if (tenantId !== undefined)
|
|
4255
4493
|
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
4256
4494
|
url_ = url_.replace(/[?&]$/, "");
|
|
4257
|
-
const content_ =
|
|
4258
|
-
if (sourceFiles !== null && sourceFiles !== undefined)
|
|
4259
|
-
sourceFiles.forEach(item_ => content_.append("sourceFiles", item_.data, item_.fileName ? item_.fileName : "sourceFiles"));
|
|
4495
|
+
const content_ = JSON.stringify(body);
|
|
4260
4496
|
let options_ = {
|
|
4261
4497
|
data: content_,
|
|
4262
4498
|
method: "POST",
|
|
4263
4499
|
url: url_,
|
|
4264
4500
|
headers: {
|
|
4501
|
+
"Content-Type": "application/json",
|
|
4265
4502
|
"Accept": "application/json"
|
|
4266
4503
|
},
|
|
4267
4504
|
cancelToken
|
|
@@ -4276,10 +4513,10 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
4276
4513
|
throw _error;
|
|
4277
4514
|
}
|
|
4278
4515
|
}).then((_response) => {
|
|
4279
|
-
return this.transformResult(url_, _response, (_response) => this.
|
|
4516
|
+
return this.transformResult(url_, _response, (_response) => this.processAddDesignSurfaceModel(_response));
|
|
4280
4517
|
});
|
|
4281
4518
|
}
|
|
4282
|
-
|
|
4519
|
+
processAddDesignSurfaceModel(response) {
|
|
4283
4520
|
const status = response.status;
|
|
4284
4521
|
let _headers = {};
|
|
4285
4522
|
if (response.headers && typeof response.headers === "object") {
|
|
@@ -4296,6 +4533,13 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
4296
4533
|
result200 = JSON.parse(resultData200);
|
|
4297
4534
|
return Promise.resolve(result200);
|
|
4298
4535
|
}
|
|
4536
|
+
else if (status === 400) {
|
|
4537
|
+
const _responseText = response.data;
|
|
4538
|
+
let result400 = null;
|
|
4539
|
+
let resultData400 = _responseText;
|
|
4540
|
+
result400 = JSON.parse(resultData400);
|
|
4541
|
+
return throwException("Bad Request", status, _responseText, _headers, result400);
|
|
4542
|
+
}
|
|
4299
4543
|
else if (status === 404) {
|
|
4300
4544
|
const _responseText = response.data;
|
|
4301
4545
|
let result404 = null;
|
|
@@ -4317,17 +4561,25 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
4317
4561
|
}
|
|
4318
4562
|
return Promise.resolve(null);
|
|
4319
4563
|
}
|
|
4564
|
+
}
|
|
4565
|
+
exports.DesignAtomsPrintProductApiClient = DesignAtomsPrintProductApiClient;
|
|
4566
|
+
class DesignAtomsPrintProductItemsApiClient extends ApiClientBase {
|
|
4567
|
+
instance;
|
|
4568
|
+
baseUrl;
|
|
4569
|
+
jsonParseReviver = undefined;
|
|
4570
|
+
constructor(configuration, baseUrl, instance) {
|
|
4571
|
+
super(configuration);
|
|
4572
|
+
this.instance = instance ? instance : axios_1.create();
|
|
4573
|
+
this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : this.getBaseUrl("");
|
|
4574
|
+
}
|
|
4320
4575
|
/**
|
|
4321
|
-
*
|
|
4322
|
-
* @param itemType (optional) Desired item type.
|
|
4576
|
+
* Extracts print-product item image.
|
|
4323
4577
|
* @param tenantId (optional) Tenant identifier
|
|
4324
|
-
* @param body (optional)
|
|
4578
|
+
* @param body (optional) Extraction parameters.
|
|
4325
4579
|
* @return Success
|
|
4326
4580
|
*/
|
|
4327
|
-
|
|
4328
|
-
let url_ = this.baseUrl + "/api/atoms/v1/designs/
|
|
4329
|
-
if (itemType !== undefined && itemType !== null)
|
|
4330
|
-
url_ += "itemType=" + encodeURIComponent("" + itemType) + "&";
|
|
4581
|
+
extractItemImage(tenantId, body, cancelToken) {
|
|
4582
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/print-product/items/extract-image?";
|
|
4331
4583
|
if (tenantId === null)
|
|
4332
4584
|
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
4333
4585
|
else if (tenantId !== undefined)
|
|
@@ -4336,11 +4588,12 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
4336
4588
|
const content_ = JSON.stringify(body);
|
|
4337
4589
|
let options_ = {
|
|
4338
4590
|
data: content_,
|
|
4591
|
+
responseType: "blob",
|
|
4339
4592
|
method: "POST",
|
|
4340
4593
|
url: url_,
|
|
4341
4594
|
headers: {
|
|
4342
4595
|
"Content-Type": "application/json",
|
|
4343
|
-
"Accept": "application/
|
|
4596
|
+
"Accept": "application/octet-stream"
|
|
4344
4597
|
},
|
|
4345
4598
|
cancelToken
|
|
4346
4599
|
};
|
|
@@ -4354,10 +4607,10 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
4354
4607
|
throw _error;
|
|
4355
4608
|
}
|
|
4356
4609
|
}).then((_response) => {
|
|
4357
|
-
return this.transformResult(url_, _response, (_response) => this.
|
|
4610
|
+
return this.transformResult(url_, _response, (_response) => this.processExtractItemImage(_response));
|
|
4358
4611
|
});
|
|
4359
4612
|
}
|
|
4360
|
-
|
|
4613
|
+
processExtractItemImage(response) {
|
|
4361
4614
|
const status = response.status;
|
|
4362
4615
|
let _headers = {};
|
|
4363
4616
|
if (response.headers && typeof response.headers === "object") {
|
|
@@ -4367,21 +4620,13 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
4367
4620
|
}
|
|
4368
4621
|
}
|
|
4369
4622
|
}
|
|
4370
|
-
if (status === 200) {
|
|
4371
|
-
const
|
|
4372
|
-
|
|
4373
|
-
|
|
4374
|
-
|
|
4375
|
-
|
|
4376
|
-
|
|
4377
|
-
else if (status === 404) {
|
|
4378
|
-
const _responseText = response.data;
|
|
4379
|
-
let result404 = null;
|
|
4380
|
-
let resultData404 = _responseText;
|
|
4381
|
-
result404 = JSON.parse(resultData404);
|
|
4382
|
-
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
4383
|
-
}
|
|
4384
|
-
else if (status === 401) {
|
|
4623
|
+
if (status === 200 || status === 206) {
|
|
4624
|
+
const contentDisposition = response.headers ? response.headers["content-disposition"] : undefined;
|
|
4625
|
+
const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
|
|
4626
|
+
const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
|
|
4627
|
+
return Promise.resolve({ fileName: fileName, status: status, data: new Blob([response.data]), headers: _headers });
|
|
4628
|
+
}
|
|
4629
|
+
else if (status === 401) {
|
|
4385
4630
|
const _responseText = response.data;
|
|
4386
4631
|
return throwException("Unauthorized", status, _responseText, _headers);
|
|
4387
4632
|
}
|
|
@@ -4396,16 +4641,13 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
4396
4641
|
return Promise.resolve(null);
|
|
4397
4642
|
}
|
|
4398
4643
|
/**
|
|
4399
|
-
*
|
|
4400
|
-
* @param itemType (optional) Desired items type.
|
|
4644
|
+
* Flattens print-product items.
|
|
4401
4645
|
* @param tenantId (optional) Tenant identifier
|
|
4402
|
-
* @param body (optional)
|
|
4646
|
+
* @param body (optional) List of print-product items to flatten.
|
|
4403
4647
|
* @return Success
|
|
4404
4648
|
*/
|
|
4405
|
-
|
|
4406
|
-
let url_ = this.baseUrl + "/api/atoms/v1/designs/
|
|
4407
|
-
if (itemType !== undefined && itemType !== null)
|
|
4408
|
-
url_ += "itemType=" + encodeURIComponent("" + itemType) + "&";
|
|
4649
|
+
flattenItems(tenantId, body, cancelToken) {
|
|
4650
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/print-product/items/flatten?";
|
|
4409
4651
|
if (tenantId === null)
|
|
4410
4652
|
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
4411
4653
|
else if (tenantId !== undefined)
|
|
@@ -4432,10 +4674,10 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
4432
4674
|
throw _error;
|
|
4433
4675
|
}
|
|
4434
4676
|
}).then((_response) => {
|
|
4435
|
-
return this.transformResult(url_, _response, (_response) => this.
|
|
4677
|
+
return this.transformResult(url_, _response, (_response) => this.processFlattenItems(_response));
|
|
4436
4678
|
});
|
|
4437
4679
|
}
|
|
4438
|
-
|
|
4680
|
+
processFlattenItems(response) {
|
|
4439
4681
|
const status = response.status;
|
|
4440
4682
|
let _headers = {};
|
|
4441
4683
|
if (response.headers && typeof response.headers === "object") {
|
|
@@ -4452,13 +4694,6 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
4452
4694
|
result200 = JSON.parse(resultData200);
|
|
4453
4695
|
return Promise.resolve(result200);
|
|
4454
4696
|
}
|
|
4455
|
-
else if (status === 404) {
|
|
4456
|
-
const _responseText = response.data;
|
|
4457
|
-
let result404 = null;
|
|
4458
|
-
let resultData404 = _responseText;
|
|
4459
|
-
result404 = JSON.parse(resultData404);
|
|
4460
|
-
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
4461
|
-
}
|
|
4462
4697
|
else if (status === 401) {
|
|
4463
4698
|
const _responseText = response.data;
|
|
4464
4699
|
return throwException("Unauthorized", status, _responseText, _headers);
|
|
@@ -4474,14 +4709,14 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
4474
4709
|
return Promise.resolve(null);
|
|
4475
4710
|
}
|
|
4476
4711
|
/**
|
|
4477
|
-
* Creates product item from
|
|
4712
|
+
* Creates print-product item from input image file.
|
|
4478
4713
|
* @param itemType (optional) Desired item type.
|
|
4479
4714
|
* @param tenantId (optional) Tenant identifier
|
|
4480
|
-
* @param
|
|
4715
|
+
* @param sourceFile (optional)
|
|
4481
4716
|
* @return Success
|
|
4482
4717
|
*/
|
|
4483
|
-
|
|
4484
|
-
let url_ = this.baseUrl + "/api/atoms/v1/designs/
|
|
4718
|
+
createItemFromFile(itemType, tenantId, sourceFile, cancelToken) {
|
|
4719
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/print-product/items/from-file?";
|
|
4485
4720
|
if (itemType !== undefined && itemType !== null)
|
|
4486
4721
|
url_ += "itemType=" + encodeURIComponent("" + itemType) + "&";
|
|
4487
4722
|
if (tenantId === null)
|
|
@@ -4489,13 +4724,14 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
4489
4724
|
else if (tenantId !== undefined)
|
|
4490
4725
|
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
4491
4726
|
url_ = url_.replace(/[?&]$/, "");
|
|
4492
|
-
const content_ =
|
|
4727
|
+
const content_ = new FormData();
|
|
4728
|
+
if (sourceFile !== null && sourceFile !== undefined)
|
|
4729
|
+
content_.append("sourceFile", sourceFile.data, sourceFile.fileName ? sourceFile.fileName : "sourceFile");
|
|
4493
4730
|
let options_ = {
|
|
4494
4731
|
data: content_,
|
|
4495
4732
|
method: "POST",
|
|
4496
4733
|
url: url_,
|
|
4497
4734
|
headers: {
|
|
4498
|
-
"Content-Type": "application/json",
|
|
4499
4735
|
"Accept": "application/json"
|
|
4500
4736
|
},
|
|
4501
4737
|
cancelToken
|
|
@@ -4510,10 +4746,10 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
4510
4746
|
throw _error;
|
|
4511
4747
|
}
|
|
4512
4748
|
}).then((_response) => {
|
|
4513
|
-
return this.transformResult(url_, _response, (_response) => this.
|
|
4749
|
+
return this.transformResult(url_, _response, (_response) => this.processCreateItemFromFile(_response));
|
|
4514
4750
|
});
|
|
4515
4751
|
}
|
|
4516
|
-
|
|
4752
|
+
processCreateItemFromFile(response) {
|
|
4517
4753
|
const status = response.status;
|
|
4518
4754
|
let _headers = {};
|
|
4519
4755
|
if (response.headers && typeof response.headers === "object") {
|
|
@@ -4537,6 +4773,13 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
4537
4773
|
result404 = JSON.parse(resultData404);
|
|
4538
4774
|
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
4539
4775
|
}
|
|
4776
|
+
else if (status === 409) {
|
|
4777
|
+
const _responseText = response.data;
|
|
4778
|
+
let result409 = null;
|
|
4779
|
+
let resultData409 = _responseText;
|
|
4780
|
+
result409 = JSON.parse(resultData409);
|
|
4781
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
4782
|
+
}
|
|
4540
4783
|
else if (status === 401) {
|
|
4541
4784
|
const _responseText = response.data;
|
|
4542
4785
|
return throwException("Unauthorized", status, _responseText, _headers);
|
|
@@ -4552,14 +4795,14 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
4552
4795
|
return Promise.resolve(null);
|
|
4553
4796
|
}
|
|
4554
4797
|
/**
|
|
4555
|
-
* Creates multiple product items from
|
|
4556
|
-
* @param itemType (optional) Desired items type.
|
|
4798
|
+
* Creates multiple print-product items from input image files.
|
|
4799
|
+
* @param itemType (optional) Desired print-product items type.
|
|
4557
4800
|
* @param tenantId (optional) Tenant identifier
|
|
4558
|
-
* @param
|
|
4801
|
+
* @param sourceFiles (optional)
|
|
4559
4802
|
* @return Success
|
|
4560
4803
|
*/
|
|
4561
|
-
|
|
4562
|
-
let url_ = this.baseUrl + "/api/atoms/v1/designs/
|
|
4804
|
+
batchCreateItemsFromFile(itemType, tenantId, sourceFiles, cancelToken) {
|
|
4805
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/print-product/items/from-file/batch-create?";
|
|
4563
4806
|
if (itemType !== undefined && itemType !== null)
|
|
4564
4807
|
url_ += "itemType=" + encodeURIComponent("" + itemType) + "&";
|
|
4565
4808
|
if (tenantId === null)
|
|
@@ -4567,13 +4810,14 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
4567
4810
|
else if (tenantId !== undefined)
|
|
4568
4811
|
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
4569
4812
|
url_ = url_.replace(/[?&]$/, "");
|
|
4570
|
-
const content_ =
|
|
4813
|
+
const content_ = new FormData();
|
|
4814
|
+
if (sourceFiles !== null && sourceFiles !== undefined)
|
|
4815
|
+
sourceFiles.forEach(item_ => content_.append("sourceFiles", item_.data, item_.fileName ? item_.fileName : "sourceFiles"));
|
|
4571
4816
|
let options_ = {
|
|
4572
4817
|
data: content_,
|
|
4573
4818
|
method: "POST",
|
|
4574
4819
|
url: url_,
|
|
4575
4820
|
headers: {
|
|
4576
|
-
"Content-Type": "application/json",
|
|
4577
4821
|
"Accept": "application/json"
|
|
4578
4822
|
},
|
|
4579
4823
|
cancelToken
|
|
@@ -4588,10 +4832,10 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
4588
4832
|
throw _error;
|
|
4589
4833
|
}
|
|
4590
4834
|
}).then((_response) => {
|
|
4591
|
-
return this.transformResult(url_, _response, (_response) => this.
|
|
4835
|
+
return this.transformResult(url_, _response, (_response) => this.processBatchCreateItemsFromFile(_response));
|
|
4592
4836
|
});
|
|
4593
4837
|
}
|
|
4594
|
-
|
|
4838
|
+
processBatchCreateItemsFromFile(response) {
|
|
4595
4839
|
const status = response.status;
|
|
4596
4840
|
let _headers = {};
|
|
4597
4841
|
if (response.headers && typeof response.headers === "object") {
|
|
@@ -4615,6 +4859,13 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
4615
4859
|
result404 = JSON.parse(resultData404);
|
|
4616
4860
|
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
4617
4861
|
}
|
|
4862
|
+
else if (status === 409) {
|
|
4863
|
+
const _responseText = response.data;
|
|
4864
|
+
let result409 = null;
|
|
4865
|
+
let resultData409 = _responseText;
|
|
4866
|
+
result409 = JSON.parse(resultData409);
|
|
4867
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
4868
|
+
}
|
|
4618
4869
|
else if (status === 401) {
|
|
4619
4870
|
const _responseText = response.data;
|
|
4620
4871
|
return throwException("Unauthorized", status, _responseText, _headers);
|
|
@@ -4630,17 +4881,16 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
4630
4881
|
return Promise.resolve(null);
|
|
4631
4882
|
}
|
|
4632
4883
|
/**
|
|
4633
|
-
*
|
|
4634
|
-
* @param
|
|
4635
|
-
(default value is 'false').
|
|
4884
|
+
* Creates print-product item from image file taken from storage.
|
|
4885
|
+
* @param itemType (optional) Desired item type.
|
|
4636
4886
|
* @param tenantId (optional) Tenant identifier
|
|
4637
|
-
* @param body (optional)
|
|
4887
|
+
* @param body (optional) Operation parameters.
|
|
4638
4888
|
* @return Success
|
|
4639
4889
|
*/
|
|
4640
|
-
|
|
4641
|
-
let url_ = this.baseUrl + "/api/atoms/v1/designs/
|
|
4642
|
-
if (
|
|
4643
|
-
url_ += "
|
|
4890
|
+
createItemFromStorage(itemType, tenantId, body, cancelToken) {
|
|
4891
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/print-product/items/from-storage?";
|
|
4892
|
+
if (itemType !== undefined && itemType !== null)
|
|
4893
|
+
url_ += "itemType=" + encodeURIComponent("" + itemType) + "&";
|
|
4644
4894
|
if (tenantId === null)
|
|
4645
4895
|
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
4646
4896
|
else if (tenantId !== undefined)
|
|
@@ -4649,12 +4899,11 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
4649
4899
|
const content_ = JSON.stringify(body);
|
|
4650
4900
|
let options_ = {
|
|
4651
4901
|
data: content_,
|
|
4652
|
-
responseType: "blob",
|
|
4653
4902
|
method: "POST",
|
|
4654
4903
|
url: url_,
|
|
4655
4904
|
headers: {
|
|
4656
4905
|
"Content-Type": "application/json",
|
|
4657
|
-
"Accept": "application/
|
|
4906
|
+
"Accept": "application/json"
|
|
4658
4907
|
},
|
|
4659
4908
|
cancelToken
|
|
4660
4909
|
};
|
|
@@ -4668,10 +4917,10 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
4668
4917
|
throw _error;
|
|
4669
4918
|
}
|
|
4670
4919
|
}).then((_response) => {
|
|
4671
|
-
return this.transformResult(url_, _response, (_response) => this.
|
|
4920
|
+
return this.transformResult(url_, _response, (_response) => this.processCreateItemFromStorage(_response));
|
|
4672
4921
|
});
|
|
4673
4922
|
}
|
|
4674
|
-
|
|
4923
|
+
processCreateItemFromStorage(response) {
|
|
4675
4924
|
const status = response.status;
|
|
4676
4925
|
let _headers = {};
|
|
4677
4926
|
if (response.headers && typeof response.headers === "object") {
|
|
@@ -4681,11 +4930,26 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
4681
4930
|
}
|
|
4682
4931
|
}
|
|
4683
4932
|
}
|
|
4684
|
-
if (status === 200
|
|
4685
|
-
const
|
|
4686
|
-
|
|
4687
|
-
|
|
4688
|
-
|
|
4933
|
+
if (status === 200) {
|
|
4934
|
+
const _responseText = response.data;
|
|
4935
|
+
let result200 = null;
|
|
4936
|
+
let resultData200 = _responseText;
|
|
4937
|
+
result200 = JSON.parse(resultData200);
|
|
4938
|
+
return Promise.resolve(result200);
|
|
4939
|
+
}
|
|
4940
|
+
else if (status === 404) {
|
|
4941
|
+
const _responseText = response.data;
|
|
4942
|
+
let result404 = null;
|
|
4943
|
+
let resultData404 = _responseText;
|
|
4944
|
+
result404 = JSON.parse(resultData404);
|
|
4945
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
4946
|
+
}
|
|
4947
|
+
else if (status === 409) {
|
|
4948
|
+
const _responseText = response.data;
|
|
4949
|
+
let result409 = null;
|
|
4950
|
+
let resultData409 = _responseText;
|
|
4951
|
+
result409 = JSON.parse(resultData409);
|
|
4952
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
4689
4953
|
}
|
|
4690
4954
|
else if (status === 401) {
|
|
4691
4955
|
const _responseText = response.data;
|
|
@@ -4702,17 +4966,16 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
4702
4966
|
return Promise.resolve(null);
|
|
4703
4967
|
}
|
|
4704
4968
|
/**
|
|
4705
|
-
*
|
|
4706
|
-
* @param
|
|
4707
|
-
(default value is 'false').
|
|
4969
|
+
* Creates multiple print-product items from the specified image files in storage.
|
|
4970
|
+
* @param itemType (optional) Desired items type.
|
|
4708
4971
|
* @param tenantId (optional) Tenant identifier
|
|
4709
|
-
* @param body (optional)
|
|
4972
|
+
* @param body (optional) Operation parameters.
|
|
4710
4973
|
* @return Success
|
|
4711
4974
|
*/
|
|
4712
|
-
|
|
4713
|
-
let url_ = this.baseUrl + "/api/atoms/v1/designs/
|
|
4714
|
-
if (
|
|
4715
|
-
url_ += "
|
|
4975
|
+
batchCreateItemsFromStorage(itemType, tenantId, body, cancelToken) {
|
|
4976
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/print-product/items/from-storage/batch-create?";
|
|
4977
|
+
if (itemType !== undefined && itemType !== null)
|
|
4978
|
+
url_ += "itemType=" + encodeURIComponent("" + itemType) + "&";
|
|
4716
4979
|
if (tenantId === null)
|
|
4717
4980
|
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
4718
4981
|
else if (tenantId !== undefined)
|
|
@@ -4721,12 +4984,11 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
4721
4984
|
const content_ = JSON.stringify(body);
|
|
4722
4985
|
let options_ = {
|
|
4723
4986
|
data: content_,
|
|
4724
|
-
responseType: "blob",
|
|
4725
4987
|
method: "POST",
|
|
4726
4988
|
url: url_,
|
|
4727
4989
|
headers: {
|
|
4728
4990
|
"Content-Type": "application/json",
|
|
4729
|
-
"Accept": "application/
|
|
4991
|
+
"Accept": "application/json"
|
|
4730
4992
|
},
|
|
4731
4993
|
cancelToken
|
|
4732
4994
|
};
|
|
@@ -4740,10 +5002,10 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
4740
5002
|
throw _error;
|
|
4741
5003
|
}
|
|
4742
5004
|
}).then((_response) => {
|
|
4743
|
-
return this.transformResult(url_, _response, (_response) => this.
|
|
5005
|
+
return this.transformResult(url_, _response, (_response) => this.processBatchCreateItemsFromStorage(_response));
|
|
4744
5006
|
});
|
|
4745
5007
|
}
|
|
4746
|
-
|
|
5008
|
+
processBatchCreateItemsFromStorage(response) {
|
|
4747
5009
|
const status = response.status;
|
|
4748
5010
|
let _headers = {};
|
|
4749
5011
|
if (response.headers && typeof response.headers === "object") {
|
|
@@ -4753,11 +5015,26 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
4753
5015
|
}
|
|
4754
5016
|
}
|
|
4755
5017
|
}
|
|
4756
|
-
if (status === 200
|
|
4757
|
-
const
|
|
4758
|
-
|
|
4759
|
-
|
|
4760
|
-
|
|
5018
|
+
if (status === 200) {
|
|
5019
|
+
const _responseText = response.data;
|
|
5020
|
+
let result200 = null;
|
|
5021
|
+
let resultData200 = _responseText;
|
|
5022
|
+
result200 = JSON.parse(resultData200);
|
|
5023
|
+
return Promise.resolve(result200);
|
|
5024
|
+
}
|
|
5025
|
+
else if (status === 404) {
|
|
5026
|
+
const _responseText = response.data;
|
|
5027
|
+
let result404 = null;
|
|
5028
|
+
let resultData404 = _responseText;
|
|
5029
|
+
result404 = JSON.parse(resultData404);
|
|
5030
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
5031
|
+
}
|
|
5032
|
+
else if (status === 409) {
|
|
5033
|
+
const _responseText = response.data;
|
|
5034
|
+
let result409 = null;
|
|
5035
|
+
let resultData409 = _responseText;
|
|
5036
|
+
result409 = JSON.parse(resultData409);
|
|
5037
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
4761
5038
|
}
|
|
4762
5039
|
else if (status === 401) {
|
|
4763
5040
|
const _responseText = response.data;
|
|
@@ -4774,13 +5051,16 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
4774
5051
|
return Promise.resolve(null);
|
|
4775
5052
|
}
|
|
4776
5053
|
/**
|
|
4777
|
-
*
|
|
5054
|
+
* Creates print-product item from remote web image provided by URL.
|
|
5055
|
+
* @param itemType (optional) Desired item type.
|
|
4778
5056
|
* @param tenantId (optional) Tenant identifier
|
|
4779
|
-
* @param body (optional)
|
|
5057
|
+
* @param body (optional) Operation parameters.
|
|
4780
5058
|
* @return Success
|
|
4781
5059
|
*/
|
|
4782
|
-
|
|
4783
|
-
let url_ = this.baseUrl + "/api/atoms/v1/designs/
|
|
5060
|
+
createItemFromUrl(itemType, tenantId, body, cancelToken) {
|
|
5061
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/print-product/items/from-url?";
|
|
5062
|
+
if (itemType !== undefined && itemType !== null)
|
|
5063
|
+
url_ += "itemType=" + encodeURIComponent("" + itemType) + "&";
|
|
4784
5064
|
if (tenantId === null)
|
|
4785
5065
|
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
4786
5066
|
else if (tenantId !== undefined)
|
|
@@ -4807,10 +5087,10 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
4807
5087
|
throw _error;
|
|
4808
5088
|
}
|
|
4809
5089
|
}).then((_response) => {
|
|
4810
|
-
return this.transformResult(url_, _response, (_response) => this.
|
|
5090
|
+
return this.transformResult(url_, _response, (_response) => this.processCreateItemFromUrl(_response));
|
|
4811
5091
|
});
|
|
4812
5092
|
}
|
|
4813
|
-
|
|
5093
|
+
processCreateItemFromUrl(response) {
|
|
4814
5094
|
const status = response.status;
|
|
4815
5095
|
let _headers = {};
|
|
4816
5096
|
if (response.headers && typeof response.headers === "object") {
|
|
@@ -4827,6 +5107,13 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
4827
5107
|
result200 = JSON.parse(resultData200);
|
|
4828
5108
|
return Promise.resolve(result200);
|
|
4829
5109
|
}
|
|
5110
|
+
else if (status === 404) {
|
|
5111
|
+
const _responseText = response.data;
|
|
5112
|
+
let result404 = null;
|
|
5113
|
+
let resultData404 = _responseText;
|
|
5114
|
+
result404 = JSON.parse(resultData404);
|
|
5115
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
5116
|
+
}
|
|
4830
5117
|
else if (status === 409) {
|
|
4831
5118
|
const _responseText = response.data;
|
|
4832
5119
|
let result409 = null;
|
|
@@ -4849,17 +5136,16 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
4849
5136
|
return Promise.resolve(null);
|
|
4850
5137
|
}
|
|
4851
5138
|
/**
|
|
4852
|
-
*
|
|
4853
|
-
* @param
|
|
4854
|
-
(default value is 'false').
|
|
5139
|
+
* Creates multiple print-product items from remote web images provided by URLs list.
|
|
5140
|
+
* @param itemType (optional) Desired items type.
|
|
4855
5141
|
* @param tenantId (optional) Tenant identifier
|
|
4856
|
-
* @param body (optional)
|
|
5142
|
+
* @param body (optional) Operation parameters.
|
|
4857
5143
|
* @return Success
|
|
4858
5144
|
*/
|
|
4859
|
-
|
|
4860
|
-
let url_ = this.baseUrl + "/api/atoms/v1/designs/
|
|
4861
|
-
if (
|
|
4862
|
-
url_ += "
|
|
5145
|
+
batchCreateItemsFromUrl(itemType, tenantId, body, cancelToken) {
|
|
5146
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/print-product/items/from-url/batch-create?";
|
|
5147
|
+
if (itemType !== undefined && itemType !== null)
|
|
5148
|
+
url_ += "itemType=" + encodeURIComponent("" + itemType) + "&";
|
|
4863
5149
|
if (tenantId === null)
|
|
4864
5150
|
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
4865
5151
|
else if (tenantId !== undefined)
|
|
@@ -4868,12 +5154,11 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
4868
5154
|
const content_ = JSON.stringify(body);
|
|
4869
5155
|
let options_ = {
|
|
4870
5156
|
data: content_,
|
|
4871
|
-
responseType: "blob",
|
|
4872
5157
|
method: "POST",
|
|
4873
5158
|
url: url_,
|
|
4874
5159
|
headers: {
|
|
4875
5160
|
"Content-Type": "application/json",
|
|
4876
|
-
"Accept": "application/
|
|
5161
|
+
"Accept": "application/json"
|
|
4877
5162
|
},
|
|
4878
5163
|
cancelToken
|
|
4879
5164
|
};
|
|
@@ -4887,10 +5172,10 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
4887
5172
|
throw _error;
|
|
4888
5173
|
}
|
|
4889
5174
|
}).then((_response) => {
|
|
4890
|
-
return this.transformResult(url_, _response, (_response) => this.
|
|
5175
|
+
return this.transformResult(url_, _response, (_response) => this.processBatchCreateItemsFromUrl(_response));
|
|
4891
5176
|
});
|
|
4892
5177
|
}
|
|
4893
|
-
|
|
5178
|
+
processBatchCreateItemsFromUrl(response) {
|
|
4894
5179
|
const status = response.status;
|
|
4895
5180
|
let _headers = {};
|
|
4896
5181
|
if (response.headers && typeof response.headers === "object") {
|
|
@@ -4900,11 +5185,26 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
4900
5185
|
}
|
|
4901
5186
|
}
|
|
4902
5187
|
}
|
|
4903
|
-
if (status === 200
|
|
4904
|
-
const
|
|
4905
|
-
|
|
4906
|
-
|
|
4907
|
-
|
|
5188
|
+
if (status === 200) {
|
|
5189
|
+
const _responseText = response.data;
|
|
5190
|
+
let result200 = null;
|
|
5191
|
+
let resultData200 = _responseText;
|
|
5192
|
+
result200 = JSON.parse(resultData200);
|
|
5193
|
+
return Promise.resolve(result200);
|
|
5194
|
+
}
|
|
5195
|
+
else if (status === 404) {
|
|
5196
|
+
const _responseText = response.data;
|
|
5197
|
+
let result404 = null;
|
|
5198
|
+
let resultData404 = _responseText;
|
|
5199
|
+
result404 = JSON.parse(resultData404);
|
|
5200
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
5201
|
+
}
|
|
5202
|
+
else if (status === 409) {
|
|
5203
|
+
const _responseText = response.data;
|
|
5204
|
+
let result409 = null;
|
|
5205
|
+
let resultData409 = _responseText;
|
|
5206
|
+
result409 = JSON.parse(resultData409);
|
|
5207
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
4908
5208
|
}
|
|
4909
5209
|
else if (status === 401) {
|
|
4910
5210
|
const _responseText = response.data;
|
|
@@ -4920,14 +5220,28 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
4920
5220
|
}
|
|
4921
5221
|
return Promise.resolve(null);
|
|
4922
5222
|
}
|
|
5223
|
+
}
|
|
5224
|
+
exports.DesignAtomsPrintProductItemsApiClient = DesignAtomsPrintProductItemsApiClient;
|
|
5225
|
+
class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
5226
|
+
instance;
|
|
5227
|
+
baseUrl;
|
|
5228
|
+
jsonParseReviver = undefined;
|
|
5229
|
+
constructor(configuration, baseUrl, instance) {
|
|
5230
|
+
super(configuration);
|
|
5231
|
+
this.instance = instance ? instance : axios_1.create();
|
|
5232
|
+
this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : this.getBaseUrl("");
|
|
5233
|
+
}
|
|
4923
5234
|
/**
|
|
4924
|
-
*
|
|
5235
|
+
* Creates new design file with specified parameters and saves it in storage.
|
|
5236
|
+
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
4925
5237
|
* @param tenantId (optional) Tenant identifier
|
|
4926
|
-
* @param body (optional)
|
|
4927
|
-
* @return
|
|
5238
|
+
* @param body (optional) Design creation parameters.
|
|
5239
|
+
* @return Created
|
|
4928
5240
|
*/
|
|
4929
|
-
|
|
4930
|
-
let url_ = this.baseUrl + "/api/atoms/v1/designs
|
|
5241
|
+
createDesign(privateStorageOwner, tenantId, body, cancelToken) {
|
|
5242
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs?";
|
|
5243
|
+
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
5244
|
+
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
4931
5245
|
if (tenantId === null)
|
|
4932
5246
|
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
4933
5247
|
else if (tenantId !== undefined)
|
|
@@ -4954,10 +5268,10 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
4954
5268
|
throw _error;
|
|
4955
5269
|
}
|
|
4956
5270
|
}).then((_response) => {
|
|
4957
|
-
return this.transformResult(url_, _response, (_response) => this.
|
|
5271
|
+
return this.transformResult(url_, _response, (_response) => this.processCreateDesign(_response));
|
|
4958
5272
|
});
|
|
4959
5273
|
}
|
|
4960
|
-
|
|
5274
|
+
processCreateDesign(response) {
|
|
4961
5275
|
const status = response.status;
|
|
4962
5276
|
let _headers = {};
|
|
4963
5277
|
if (response.headers && typeof response.headers === "object") {
|
|
@@ -4967,19 +5281,1613 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
4967
5281
|
}
|
|
4968
5282
|
}
|
|
4969
5283
|
}
|
|
4970
|
-
if (status ===
|
|
5284
|
+
if (status === 201) {
|
|
4971
5285
|
const _responseText = response.data;
|
|
4972
|
-
let
|
|
4973
|
-
let
|
|
4974
|
-
|
|
4975
|
-
return Promise.resolve(
|
|
5286
|
+
let result201 = null;
|
|
5287
|
+
let resultData201 = _responseText;
|
|
5288
|
+
result201 = JSON.parse(resultData201);
|
|
5289
|
+
return Promise.resolve(result201);
|
|
5290
|
+
}
|
|
5291
|
+
else if (status === 401) {
|
|
5292
|
+
const _responseText = response.data;
|
|
5293
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
5294
|
+
}
|
|
5295
|
+
else if (status === 403) {
|
|
5296
|
+
const _responseText = response.data;
|
|
5297
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
5298
|
+
}
|
|
5299
|
+
else if (status !== 200 && status !== 204) {
|
|
5300
|
+
const _responseText = response.data;
|
|
5301
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
5302
|
+
}
|
|
5303
|
+
return Promise.resolve(null);
|
|
5304
|
+
}
|
|
5305
|
+
/**
|
|
5306
|
+
* Returns image content of the background.
|
|
5307
|
+
* @param id Design identifier.
|
|
5308
|
+
* @param surfaceIndex (optional) Surface index.
|
|
5309
|
+
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
5310
|
+
* @param tenantId (optional) Tenant identifier
|
|
5311
|
+
* @return Success
|
|
5312
|
+
*/
|
|
5313
|
+
extractBackground(id, surfaceIndex, privateStorageOwner, tenantId, cancelToken) {
|
|
5314
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/background?";
|
|
5315
|
+
if (id === undefined || id === null)
|
|
5316
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
5317
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
5318
|
+
if (surfaceIndex !== undefined && surfaceIndex !== null)
|
|
5319
|
+
url_ += "surfaceIndex=" + encodeURIComponent("" + surfaceIndex) + "&";
|
|
5320
|
+
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
5321
|
+
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
5322
|
+
if (tenantId === null)
|
|
5323
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
5324
|
+
else if (tenantId !== undefined)
|
|
5325
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
5326
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
5327
|
+
let options_ = {
|
|
5328
|
+
responseType: "blob",
|
|
5329
|
+
method: "GET",
|
|
5330
|
+
url: url_,
|
|
5331
|
+
headers: {
|
|
5332
|
+
"Accept": "application/octet-stream"
|
|
5333
|
+
},
|
|
5334
|
+
cancelToken
|
|
5335
|
+
};
|
|
5336
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
5337
|
+
return this.instance.request(transformedOptions_);
|
|
5338
|
+
}).catch((_error) => {
|
|
5339
|
+
if (isAxiosError(_error) && _error.response) {
|
|
5340
|
+
return _error.response;
|
|
5341
|
+
}
|
|
5342
|
+
else {
|
|
5343
|
+
throw _error;
|
|
5344
|
+
}
|
|
5345
|
+
}).then((_response) => {
|
|
5346
|
+
return this.transformResult(url_, _response, (_response) => this.processExtractBackground(_response));
|
|
5347
|
+
});
|
|
5348
|
+
}
|
|
5349
|
+
processExtractBackground(response) {
|
|
5350
|
+
const status = response.status;
|
|
5351
|
+
let _headers = {};
|
|
5352
|
+
if (response.headers && typeof response.headers === "object") {
|
|
5353
|
+
for (let k in response.headers) {
|
|
5354
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
5355
|
+
_headers[k] = response.headers[k];
|
|
5356
|
+
}
|
|
5357
|
+
}
|
|
5358
|
+
}
|
|
5359
|
+
if (status === 200 || status === 206) {
|
|
5360
|
+
const contentDisposition = response.headers ? response.headers["content-disposition"] : undefined;
|
|
5361
|
+
const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
|
|
5362
|
+
const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
|
|
5363
|
+
return Promise.resolve({ fileName: fileName, status: status, data: new Blob([response.data]), headers: _headers });
|
|
5364
|
+
}
|
|
5365
|
+
else if (status === 404) {
|
|
5366
|
+
const _responseText = response.data;
|
|
5367
|
+
let result404 = null;
|
|
5368
|
+
let resultData404 = _responseText;
|
|
5369
|
+
result404 = JSON.parse(resultData404);
|
|
5370
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
5371
|
+
}
|
|
5372
|
+
else if (status === 409) {
|
|
5373
|
+
const _responseText = response.data;
|
|
5374
|
+
let result409 = null;
|
|
5375
|
+
let resultData409 = _responseText;
|
|
5376
|
+
result409 = JSON.parse(resultData409);
|
|
5377
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
5378
|
+
}
|
|
5379
|
+
else if (status === 401) {
|
|
5380
|
+
const _responseText = response.data;
|
|
5381
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
5382
|
+
}
|
|
5383
|
+
else if (status === 403) {
|
|
5384
|
+
const _responseText = response.data;
|
|
5385
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
5386
|
+
}
|
|
5387
|
+
else if (status !== 200 && status !== 204) {
|
|
5388
|
+
const _responseText = response.data;
|
|
5389
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
5390
|
+
}
|
|
5391
|
+
return Promise.resolve(null);
|
|
5392
|
+
}
|
|
5393
|
+
/**
|
|
5394
|
+
* Sets specified editor-mockups for selected design surfaces.
|
|
5395
|
+
* @param id Design identifier.
|
|
5396
|
+
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
5397
|
+
* @param tenantId (optional) Tenant identifier
|
|
5398
|
+
* @param body (optional) Operation parameters.
|
|
5399
|
+
* @return No Content
|
|
5400
|
+
*/
|
|
5401
|
+
setEditorMockups(id, privateStorageOwner, tenantId, body, cancelToken) {
|
|
5402
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/editor-mockups?";
|
|
5403
|
+
if (id === undefined || id === null)
|
|
5404
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
5405
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
5406
|
+
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
5407
|
+
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
5408
|
+
if (tenantId === null)
|
|
5409
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
5410
|
+
else if (tenantId !== undefined)
|
|
5411
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
5412
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
5413
|
+
const content_ = JSON.stringify(body);
|
|
5414
|
+
let options_ = {
|
|
5415
|
+
data: content_,
|
|
5416
|
+
method: "PUT",
|
|
5417
|
+
url: url_,
|
|
5418
|
+
headers: {
|
|
5419
|
+
"Content-Type": "application/json",
|
|
5420
|
+
},
|
|
5421
|
+
cancelToken
|
|
5422
|
+
};
|
|
5423
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
5424
|
+
return this.instance.request(transformedOptions_);
|
|
5425
|
+
}).catch((_error) => {
|
|
5426
|
+
if (isAxiosError(_error) && _error.response) {
|
|
5427
|
+
return _error.response;
|
|
5428
|
+
}
|
|
5429
|
+
else {
|
|
5430
|
+
throw _error;
|
|
5431
|
+
}
|
|
5432
|
+
}).then((_response) => {
|
|
5433
|
+
return this.transformResult(url_, _response, (_response) => this.processSetEditorMockups(_response));
|
|
5434
|
+
});
|
|
5435
|
+
}
|
|
5436
|
+
processSetEditorMockups(response) {
|
|
5437
|
+
const status = response.status;
|
|
5438
|
+
let _headers = {};
|
|
5439
|
+
if (response.headers && typeof response.headers === "object") {
|
|
5440
|
+
for (let k in response.headers) {
|
|
5441
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
5442
|
+
_headers[k] = response.headers[k];
|
|
5443
|
+
}
|
|
5444
|
+
}
|
|
5445
|
+
}
|
|
5446
|
+
if (status === 204) {
|
|
5447
|
+
const _responseText = response.data;
|
|
5448
|
+
return Promise.resolve(null);
|
|
5449
|
+
}
|
|
5450
|
+
else if (status === 400) {
|
|
5451
|
+
const _responseText = response.data;
|
|
5452
|
+
let result400 = null;
|
|
5453
|
+
let resultData400 = _responseText;
|
|
5454
|
+
result400 = JSON.parse(resultData400);
|
|
5455
|
+
return throwException("Bad Request", status, _responseText, _headers, result400);
|
|
5456
|
+
}
|
|
5457
|
+
else if (status === 404) {
|
|
5458
|
+
const _responseText = response.data;
|
|
5459
|
+
let result404 = null;
|
|
5460
|
+
let resultData404 = _responseText;
|
|
5461
|
+
result404 = JSON.parse(resultData404);
|
|
5462
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
5463
|
+
}
|
|
5464
|
+
else if (status === 401) {
|
|
5465
|
+
const _responseText = response.data;
|
|
5466
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
5467
|
+
}
|
|
5468
|
+
else if (status === 403) {
|
|
5469
|
+
const _responseText = response.data;
|
|
5470
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
5471
|
+
}
|
|
5472
|
+
else if (status !== 200 && status !== 204) {
|
|
5473
|
+
const _responseText = response.data;
|
|
5474
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
5475
|
+
}
|
|
5476
|
+
return Promise.resolve(null);
|
|
5477
|
+
}
|
|
5478
|
+
/**
|
|
5479
|
+
* Returns design parameters stored in product model.
|
|
5480
|
+
* @param id Design identifier.
|
|
5481
|
+
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
5482
|
+
* @param tenantId (optional) Tenant identifier
|
|
5483
|
+
* @return Success
|
|
5484
|
+
*/
|
|
5485
|
+
getDesignParameters(id, privateStorageOwner, tenantId, cancelToken) {
|
|
5486
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/parameters?";
|
|
5487
|
+
if (id === undefined || id === null)
|
|
5488
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
5489
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
5490
|
+
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
5491
|
+
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
5492
|
+
if (tenantId === null)
|
|
5493
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
5494
|
+
else if (tenantId !== undefined)
|
|
5495
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
5496
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
5497
|
+
let options_ = {
|
|
5498
|
+
method: "GET",
|
|
5499
|
+
url: url_,
|
|
5500
|
+
headers: {
|
|
5501
|
+
"Accept": "application/json"
|
|
5502
|
+
},
|
|
5503
|
+
cancelToken
|
|
5504
|
+
};
|
|
5505
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
5506
|
+
return this.instance.request(transformedOptions_);
|
|
5507
|
+
}).catch((_error) => {
|
|
5508
|
+
if (isAxiosError(_error) && _error.response) {
|
|
5509
|
+
return _error.response;
|
|
5510
|
+
}
|
|
5511
|
+
else {
|
|
5512
|
+
throw _error;
|
|
5513
|
+
}
|
|
5514
|
+
}).then((_response) => {
|
|
5515
|
+
return this.transformResult(url_, _response, (_response) => this.processGetDesignParameters(_response));
|
|
5516
|
+
});
|
|
5517
|
+
}
|
|
5518
|
+
processGetDesignParameters(response) {
|
|
5519
|
+
const status = response.status;
|
|
5520
|
+
let _headers = {};
|
|
5521
|
+
if (response.headers && typeof response.headers === "object") {
|
|
5522
|
+
for (let k in response.headers) {
|
|
5523
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
5524
|
+
_headers[k] = response.headers[k];
|
|
5525
|
+
}
|
|
5526
|
+
}
|
|
5527
|
+
}
|
|
5528
|
+
if (status === 200) {
|
|
5529
|
+
const _responseText = response.data;
|
|
5530
|
+
let result200 = null;
|
|
5531
|
+
let resultData200 = _responseText;
|
|
5532
|
+
result200 = JSON.parse(resultData200);
|
|
5533
|
+
return Promise.resolve(result200);
|
|
5534
|
+
}
|
|
5535
|
+
else if (status === 404) {
|
|
5536
|
+
const _responseText = response.data;
|
|
5537
|
+
let result404 = null;
|
|
5538
|
+
let resultData404 = _responseText;
|
|
5539
|
+
result404 = JSON.parse(resultData404);
|
|
5540
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
5541
|
+
}
|
|
5542
|
+
else if (status === 401) {
|
|
5543
|
+
const _responseText = response.data;
|
|
5544
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
5545
|
+
}
|
|
5546
|
+
else if (status === 403) {
|
|
5547
|
+
const _responseText = response.data;
|
|
5548
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
5549
|
+
}
|
|
5550
|
+
else if (status !== 200 && status !== 204) {
|
|
5551
|
+
const _responseText = response.data;
|
|
5552
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
5553
|
+
}
|
|
5554
|
+
return Promise.resolve(null);
|
|
5555
|
+
}
|
|
5556
|
+
/**
|
|
5557
|
+
* Loads a data schema from design file taken from storage.
|
|
5558
|
+
* @param id Design identifier.
|
|
5559
|
+
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
5560
|
+
* @param tenantId (optional) Tenant identifier
|
|
5561
|
+
* @return Success
|
|
5562
|
+
*/
|
|
5563
|
+
loadDataSchema(id, privateStorageOwner, tenantId, cancelToken) {
|
|
5564
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/schema?";
|
|
5565
|
+
if (id === undefined || id === null)
|
|
5566
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
5567
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
5568
|
+
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
5569
|
+
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
5570
|
+
if (tenantId === null)
|
|
5571
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
5572
|
+
else if (tenantId !== undefined)
|
|
5573
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
5574
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
5575
|
+
let options_ = {
|
|
5576
|
+
responseType: "blob",
|
|
5577
|
+
method: "GET",
|
|
5578
|
+
url: url_,
|
|
5579
|
+
headers: {
|
|
5580
|
+
"Accept": "application/octet-stream"
|
|
5581
|
+
},
|
|
5582
|
+
cancelToken
|
|
5583
|
+
};
|
|
5584
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
5585
|
+
return this.instance.request(transformedOptions_);
|
|
5586
|
+
}).catch((_error) => {
|
|
5587
|
+
if (isAxiosError(_error) && _error.response) {
|
|
5588
|
+
return _error.response;
|
|
5589
|
+
}
|
|
5590
|
+
else {
|
|
5591
|
+
throw _error;
|
|
5592
|
+
}
|
|
5593
|
+
}).then((_response) => {
|
|
5594
|
+
return this.transformResult(url_, _response, (_response) => this.processLoadDataSchema(_response));
|
|
5595
|
+
});
|
|
5596
|
+
}
|
|
5597
|
+
processLoadDataSchema(response) {
|
|
5598
|
+
const status = response.status;
|
|
5599
|
+
let _headers = {};
|
|
5600
|
+
if (response.headers && typeof response.headers === "object") {
|
|
5601
|
+
for (let k in response.headers) {
|
|
5602
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
5603
|
+
_headers[k] = response.headers[k];
|
|
5604
|
+
}
|
|
5605
|
+
}
|
|
5606
|
+
}
|
|
5607
|
+
if (status === 200 || status === 206) {
|
|
5608
|
+
const contentDisposition = response.headers ? response.headers["content-disposition"] : undefined;
|
|
5609
|
+
const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
|
|
5610
|
+
const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
|
|
5611
|
+
return Promise.resolve({ fileName: fileName, status: status, data: new Blob([response.data]), headers: _headers });
|
|
5612
|
+
}
|
|
5613
|
+
else if (status === 404) {
|
|
5614
|
+
const _responseText = response.data;
|
|
5615
|
+
let result404 = null;
|
|
5616
|
+
let resultData404 = _responseText;
|
|
5617
|
+
result404 = JSON.parse(resultData404);
|
|
5618
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
5619
|
+
}
|
|
5620
|
+
else if (status === 409) {
|
|
5621
|
+
const _responseText = response.data;
|
|
5622
|
+
let result409 = null;
|
|
5623
|
+
let resultData409 = _responseText;
|
|
5624
|
+
result409 = JSON.parse(resultData409);
|
|
5625
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
5626
|
+
}
|
|
5627
|
+
else if (status === 401) {
|
|
5628
|
+
const _responseText = response.data;
|
|
5629
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
5630
|
+
}
|
|
5631
|
+
else if (status === 403) {
|
|
5632
|
+
const _responseText = response.data;
|
|
5633
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
5634
|
+
}
|
|
5635
|
+
else if (status !== 200 && status !== 204) {
|
|
5636
|
+
const _responseText = response.data;
|
|
5637
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
5638
|
+
}
|
|
5639
|
+
return Promise.resolve(null);
|
|
5640
|
+
}
|
|
5641
|
+
/**
|
|
5642
|
+
* Loads a toggle set from design file taken from storage.
|
|
5643
|
+
* @param id Design identifier.
|
|
5644
|
+
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
5645
|
+
* @param tenantId (optional) Tenant identifier
|
|
5646
|
+
* @return Success
|
|
5647
|
+
*/
|
|
5648
|
+
loadToggleSet(id, privateStorageOwner, tenantId, cancelToken) {
|
|
5649
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/toggle-set?";
|
|
5650
|
+
if (id === undefined || id === null)
|
|
5651
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
5652
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
5653
|
+
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
5654
|
+
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
5655
|
+
if (tenantId === null)
|
|
5656
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
5657
|
+
else if (tenantId !== undefined)
|
|
5658
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
5659
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
5660
|
+
let options_ = {
|
|
5661
|
+
responseType: "blob",
|
|
5662
|
+
method: "GET",
|
|
5663
|
+
url: url_,
|
|
5664
|
+
headers: {
|
|
5665
|
+
"Accept": "application/octet-stream"
|
|
5666
|
+
},
|
|
5667
|
+
cancelToken
|
|
5668
|
+
};
|
|
5669
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
5670
|
+
return this.instance.request(transformedOptions_);
|
|
5671
|
+
}).catch((_error) => {
|
|
5672
|
+
if (isAxiosError(_error) && _error.response) {
|
|
5673
|
+
return _error.response;
|
|
5674
|
+
}
|
|
5675
|
+
else {
|
|
5676
|
+
throw _error;
|
|
5677
|
+
}
|
|
5678
|
+
}).then((_response) => {
|
|
5679
|
+
return this.transformResult(url_, _response, (_response) => this.processLoadToggleSet(_response));
|
|
5680
|
+
});
|
|
5681
|
+
}
|
|
5682
|
+
processLoadToggleSet(response) {
|
|
5683
|
+
const status = response.status;
|
|
5684
|
+
let _headers = {};
|
|
5685
|
+
if (response.headers && typeof response.headers === "object") {
|
|
5686
|
+
for (let k in response.headers) {
|
|
5687
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
5688
|
+
_headers[k] = response.headers[k];
|
|
5689
|
+
}
|
|
5690
|
+
}
|
|
5691
|
+
}
|
|
5692
|
+
if (status === 200 || status === 206) {
|
|
5693
|
+
const contentDisposition = response.headers ? response.headers["content-disposition"] : undefined;
|
|
5694
|
+
const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
|
|
5695
|
+
const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
|
|
5696
|
+
return Promise.resolve({ fileName: fileName, status: status, data: new Blob([response.data]), headers: _headers });
|
|
5697
|
+
}
|
|
5698
|
+
else if (status === 404) {
|
|
5699
|
+
const _responseText = response.data;
|
|
5700
|
+
let result404 = null;
|
|
5701
|
+
let resultData404 = _responseText;
|
|
5702
|
+
result404 = JSON.parse(resultData404);
|
|
5703
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
5704
|
+
}
|
|
5705
|
+
else if (status === 409) {
|
|
5706
|
+
const _responseText = response.data;
|
|
5707
|
+
let result409 = null;
|
|
5708
|
+
let resultData409 = _responseText;
|
|
5709
|
+
result409 = JSON.parse(resultData409);
|
|
5710
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
5711
|
+
}
|
|
5712
|
+
else if (status === 401) {
|
|
5713
|
+
const _responseText = response.data;
|
|
5714
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
5715
|
+
}
|
|
5716
|
+
else if (status === 403) {
|
|
5717
|
+
const _responseText = response.data;
|
|
5718
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
5719
|
+
}
|
|
5720
|
+
else if (status !== 200 && status !== 204) {
|
|
5721
|
+
const _responseText = response.data;
|
|
5722
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
5723
|
+
}
|
|
5724
|
+
return Promise.resolve(null);
|
|
5725
|
+
}
|
|
5726
|
+
/**
|
|
5727
|
+
* Returns variable items information for design file taken from storage.
|
|
5728
|
+
* @param id Design identifier.
|
|
5729
|
+
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
5730
|
+
* @param tenantId (optional) Tenant identifier
|
|
5731
|
+
* @return Success
|
|
5732
|
+
*/
|
|
5733
|
+
getVariables(id, privateStorageOwner, tenantId, cancelToken) {
|
|
5734
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/variables?";
|
|
5735
|
+
if (id === undefined || id === null)
|
|
5736
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
5737
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
5738
|
+
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
5739
|
+
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
5740
|
+
if (tenantId === null)
|
|
5741
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
5742
|
+
else if (tenantId !== undefined)
|
|
5743
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
5744
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
5745
|
+
let options_ = {
|
|
5746
|
+
method: "GET",
|
|
5747
|
+
url: url_,
|
|
5748
|
+
headers: {
|
|
5749
|
+
"Accept": "application/json"
|
|
5750
|
+
},
|
|
5751
|
+
cancelToken
|
|
5752
|
+
};
|
|
5753
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
5754
|
+
return this.instance.request(transformedOptions_);
|
|
5755
|
+
}).catch((_error) => {
|
|
5756
|
+
if (isAxiosError(_error) && _error.response) {
|
|
5757
|
+
return _error.response;
|
|
5758
|
+
}
|
|
5759
|
+
else {
|
|
5760
|
+
throw _error;
|
|
5761
|
+
}
|
|
5762
|
+
}).then((_response) => {
|
|
5763
|
+
return this.transformResult(url_, _response, (_response) => this.processGetVariables(_response));
|
|
5764
|
+
});
|
|
5765
|
+
}
|
|
5766
|
+
processGetVariables(response) {
|
|
5767
|
+
const status = response.status;
|
|
5768
|
+
let _headers = {};
|
|
5769
|
+
if (response.headers && typeof response.headers === "object") {
|
|
5770
|
+
for (let k in response.headers) {
|
|
5771
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
5772
|
+
_headers[k] = response.headers[k];
|
|
5773
|
+
}
|
|
5774
|
+
}
|
|
5775
|
+
}
|
|
5776
|
+
if (status === 200) {
|
|
5777
|
+
const _responseText = response.data;
|
|
5778
|
+
let result200 = null;
|
|
5779
|
+
let resultData200 = _responseText;
|
|
5780
|
+
result200 = JSON.parse(resultData200);
|
|
5781
|
+
return Promise.resolve(result200);
|
|
5782
|
+
}
|
|
5783
|
+
else if (status === 404) {
|
|
5784
|
+
const _responseText = response.data;
|
|
5785
|
+
let result404 = null;
|
|
5786
|
+
let resultData404 = _responseText;
|
|
5787
|
+
result404 = JSON.parse(resultData404);
|
|
5788
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
5789
|
+
}
|
|
5790
|
+
else if (status === 401) {
|
|
5791
|
+
const _responseText = response.data;
|
|
5792
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
5793
|
+
}
|
|
5794
|
+
else if (status === 403) {
|
|
5795
|
+
const _responseText = response.data;
|
|
5796
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
5797
|
+
}
|
|
5798
|
+
else if (status !== 200 && status !== 204) {
|
|
5799
|
+
const _responseText = response.data;
|
|
5800
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
5801
|
+
}
|
|
5802
|
+
return Promise.resolve(null);
|
|
5803
|
+
}
|
|
5804
|
+
/**
|
|
5805
|
+
* Saves variable items values for design file taken from storage.
|
|
5806
|
+
* @param id Design identifier.
|
|
5807
|
+
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
5808
|
+
* @param tenantId (optional) Tenant identifier
|
|
5809
|
+
* @param body (optional) Design variable values.
|
|
5810
|
+
* @return Success
|
|
5811
|
+
*/
|
|
5812
|
+
setVariables(id, privateStorageOwner, tenantId, body, cancelToken) {
|
|
5813
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/variables?";
|
|
5814
|
+
if (id === undefined || id === null)
|
|
5815
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
5816
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
5817
|
+
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
5818
|
+
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
5819
|
+
if (tenantId === null)
|
|
5820
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
5821
|
+
else if (tenantId !== undefined)
|
|
5822
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
5823
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
5824
|
+
const content_ = JSON.stringify(body);
|
|
5825
|
+
let options_ = {
|
|
5826
|
+
data: content_,
|
|
5827
|
+
method: "PUT",
|
|
5828
|
+
url: url_,
|
|
5829
|
+
headers: {
|
|
5830
|
+
"Content-Type": "application/json",
|
|
5831
|
+
},
|
|
5832
|
+
cancelToken
|
|
5833
|
+
};
|
|
5834
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
5835
|
+
return this.instance.request(transformedOptions_);
|
|
5836
|
+
}).catch((_error) => {
|
|
5837
|
+
if (isAxiosError(_error) && _error.response) {
|
|
5838
|
+
return _error.response;
|
|
5839
|
+
}
|
|
5840
|
+
else {
|
|
5841
|
+
throw _error;
|
|
5842
|
+
}
|
|
5843
|
+
}).then((_response) => {
|
|
5844
|
+
return this.transformResult(url_, _response, (_response) => this.processSetVariables(_response));
|
|
5845
|
+
});
|
|
5846
|
+
}
|
|
5847
|
+
processSetVariables(response) {
|
|
5848
|
+
const status = response.status;
|
|
5849
|
+
let _headers = {};
|
|
5850
|
+
if (response.headers && typeof response.headers === "object") {
|
|
5851
|
+
for (let k in response.headers) {
|
|
5852
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
5853
|
+
_headers[k] = response.headers[k];
|
|
5854
|
+
}
|
|
5855
|
+
}
|
|
5856
|
+
}
|
|
5857
|
+
if (status === 200) {
|
|
5858
|
+
const _responseText = response.data;
|
|
5859
|
+
return Promise.resolve(null);
|
|
5860
|
+
}
|
|
5861
|
+
else if (status === 404) {
|
|
5862
|
+
const _responseText = response.data;
|
|
5863
|
+
let result404 = null;
|
|
5864
|
+
let resultData404 = _responseText;
|
|
5865
|
+
result404 = JSON.parse(resultData404);
|
|
5866
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
5867
|
+
}
|
|
5868
|
+
else if (status === 409) {
|
|
5869
|
+
const _responseText = response.data;
|
|
5870
|
+
let result409 = null;
|
|
5871
|
+
let resultData409 = _responseText;
|
|
5872
|
+
result409 = JSON.parse(resultData409);
|
|
5873
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
5874
|
+
}
|
|
5875
|
+
else if (status === 401) {
|
|
5876
|
+
const _responseText = response.data;
|
|
5877
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
5878
|
+
}
|
|
5879
|
+
else if (status === 403) {
|
|
5880
|
+
const _responseText = response.data;
|
|
5881
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
5882
|
+
}
|
|
5883
|
+
else if (status !== 200 && status !== 204) {
|
|
5884
|
+
const _responseText = response.data;
|
|
5885
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
5886
|
+
}
|
|
5887
|
+
return Promise.resolve(null);
|
|
5888
|
+
}
|
|
5889
|
+
/**
|
|
5890
|
+
* Loads variable data printing information from design file taken from storage.
|
|
5891
|
+
* @param id Design identifier.
|
|
5892
|
+
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
5893
|
+
* @param tenantId (optional) Tenant identifier
|
|
5894
|
+
* @return Success
|
|
5895
|
+
*/
|
|
5896
|
+
loadVdpData(id, privateStorageOwner, tenantId, cancelToken) {
|
|
5897
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/vdp-data?";
|
|
5898
|
+
if (id === undefined || id === null)
|
|
5899
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
5900
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
5901
|
+
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
5902
|
+
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
5903
|
+
if (tenantId === null)
|
|
5904
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
5905
|
+
else if (tenantId !== undefined)
|
|
5906
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
5907
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
5908
|
+
let options_ = {
|
|
5909
|
+
method: "GET",
|
|
5910
|
+
url: url_,
|
|
5911
|
+
headers: {
|
|
5912
|
+
"Accept": "application/json"
|
|
5913
|
+
},
|
|
5914
|
+
cancelToken
|
|
5915
|
+
};
|
|
5916
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
5917
|
+
return this.instance.request(transformedOptions_);
|
|
5918
|
+
}).catch((_error) => {
|
|
5919
|
+
if (isAxiosError(_error) && _error.response) {
|
|
5920
|
+
return _error.response;
|
|
5921
|
+
}
|
|
5922
|
+
else {
|
|
5923
|
+
throw _error;
|
|
5924
|
+
}
|
|
5925
|
+
}).then((_response) => {
|
|
5926
|
+
return this.transformResult(url_, _response, (_response) => this.processLoadVdpData(_response));
|
|
5927
|
+
});
|
|
5928
|
+
}
|
|
5929
|
+
processLoadVdpData(response) {
|
|
5930
|
+
const status = response.status;
|
|
5931
|
+
let _headers = {};
|
|
5932
|
+
if (response.headers && typeof response.headers === "object") {
|
|
5933
|
+
for (let k in response.headers) {
|
|
5934
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
5935
|
+
_headers[k] = response.headers[k];
|
|
5936
|
+
}
|
|
5937
|
+
}
|
|
5938
|
+
}
|
|
5939
|
+
if (status === 200) {
|
|
5940
|
+
const _responseText = response.data;
|
|
5941
|
+
let result200 = null;
|
|
5942
|
+
let resultData200 = _responseText;
|
|
5943
|
+
result200 = JSON.parse(resultData200);
|
|
5944
|
+
return Promise.resolve(result200);
|
|
5945
|
+
}
|
|
5946
|
+
else if (status === 404) {
|
|
5947
|
+
const _responseText = response.data;
|
|
5948
|
+
let result404 = null;
|
|
5949
|
+
let resultData404 = _responseText;
|
|
5950
|
+
result404 = JSON.parse(resultData404);
|
|
5951
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
5952
|
+
}
|
|
5953
|
+
else if (status === 409) {
|
|
5954
|
+
const _responseText = response.data;
|
|
5955
|
+
let result409 = null;
|
|
5956
|
+
let resultData409 = _responseText;
|
|
5957
|
+
result409 = JSON.parse(resultData409);
|
|
5958
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
5959
|
+
}
|
|
5960
|
+
else if (status === 401) {
|
|
5961
|
+
const _responseText = response.data;
|
|
5962
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
5963
|
+
}
|
|
5964
|
+
else if (status === 403) {
|
|
5965
|
+
const _responseText = response.data;
|
|
5966
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
5967
|
+
}
|
|
5968
|
+
else if (status !== 200 && status !== 204) {
|
|
5969
|
+
const _responseText = response.data;
|
|
5970
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
5971
|
+
}
|
|
5972
|
+
return Promise.resolve(null);
|
|
5973
|
+
}
|
|
5974
|
+
/**
|
|
5975
|
+
* Saves variable data printing information to design file and updates design in storage.
|
|
5976
|
+
* @param id Design identifier.
|
|
5977
|
+
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
5978
|
+
* @param tenantId (optional) Tenant identifier
|
|
5979
|
+
* @param body (optional) Serialized vdp data.
|
|
5980
|
+
* @return Success
|
|
5981
|
+
*/
|
|
5982
|
+
saveVdpData(id, privateStorageOwner, tenantId, body, cancelToken) {
|
|
5983
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/vdp-data?";
|
|
5984
|
+
if (id === undefined || id === null)
|
|
5985
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
5986
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
5987
|
+
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
5988
|
+
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
5989
|
+
if (tenantId === null)
|
|
5990
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
5991
|
+
else if (tenantId !== undefined)
|
|
5992
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
5993
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
5994
|
+
const content_ = JSON.stringify(body);
|
|
5995
|
+
let options_ = {
|
|
5996
|
+
data: content_,
|
|
5997
|
+
method: "PUT",
|
|
5998
|
+
url: url_,
|
|
5999
|
+
headers: {
|
|
6000
|
+
"Content-Type": "application/json",
|
|
6001
|
+
},
|
|
6002
|
+
cancelToken
|
|
6003
|
+
};
|
|
6004
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
6005
|
+
return this.instance.request(transformedOptions_);
|
|
6006
|
+
}).catch((_error) => {
|
|
6007
|
+
if (isAxiosError(_error) && _error.response) {
|
|
6008
|
+
return _error.response;
|
|
6009
|
+
}
|
|
6010
|
+
else {
|
|
6011
|
+
throw _error;
|
|
6012
|
+
}
|
|
6013
|
+
}).then((_response) => {
|
|
6014
|
+
return this.transformResult(url_, _response, (_response) => this.processSaveVdpData(_response));
|
|
6015
|
+
});
|
|
6016
|
+
}
|
|
6017
|
+
processSaveVdpData(response) {
|
|
6018
|
+
const status = response.status;
|
|
6019
|
+
let _headers = {};
|
|
6020
|
+
if (response.headers && typeof response.headers === "object") {
|
|
6021
|
+
for (let k in response.headers) {
|
|
6022
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
6023
|
+
_headers[k] = response.headers[k];
|
|
6024
|
+
}
|
|
6025
|
+
}
|
|
6026
|
+
}
|
|
6027
|
+
if (status === 200) {
|
|
6028
|
+
const _responseText = response.data;
|
|
6029
|
+
return Promise.resolve(null);
|
|
6030
|
+
}
|
|
6031
|
+
else if (status === 404) {
|
|
6032
|
+
const _responseText = response.data;
|
|
6033
|
+
let result404 = null;
|
|
6034
|
+
let resultData404 = _responseText;
|
|
6035
|
+
result404 = JSON.parse(resultData404);
|
|
6036
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
6037
|
+
}
|
|
6038
|
+
else if (status === 401) {
|
|
6039
|
+
const _responseText = response.data;
|
|
6040
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
6041
|
+
}
|
|
6042
|
+
else if (status === 403) {
|
|
6043
|
+
const _responseText = response.data;
|
|
6044
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
6045
|
+
}
|
|
6046
|
+
else if (status !== 200 && status !== 204) {
|
|
6047
|
+
const _responseText = response.data;
|
|
6048
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
6049
|
+
}
|
|
6050
|
+
return Promise.resolve(null);
|
|
6051
|
+
}
|
|
6052
|
+
/**
|
|
6053
|
+
* Deletes variable data printing information from design file and updates design file in storage.
|
|
6054
|
+
* @param id Design identifier.
|
|
6055
|
+
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
6056
|
+
* @param tenantId (optional) Tenant identifier
|
|
6057
|
+
* @return Success
|
|
6058
|
+
*/
|
|
6059
|
+
deleteVdpData(id, privateStorageOwner, tenantId, cancelToken) {
|
|
6060
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/vdp-data?";
|
|
6061
|
+
if (id === undefined || id === null)
|
|
6062
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
6063
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
6064
|
+
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
6065
|
+
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
6066
|
+
if (tenantId === null)
|
|
6067
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
6068
|
+
else if (tenantId !== undefined)
|
|
6069
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
6070
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
6071
|
+
let options_ = {
|
|
6072
|
+
method: "DELETE",
|
|
6073
|
+
url: url_,
|
|
6074
|
+
headers: {},
|
|
6075
|
+
cancelToken
|
|
6076
|
+
};
|
|
6077
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
6078
|
+
return this.instance.request(transformedOptions_);
|
|
6079
|
+
}).catch((_error) => {
|
|
6080
|
+
if (isAxiosError(_error) && _error.response) {
|
|
6081
|
+
return _error.response;
|
|
6082
|
+
}
|
|
6083
|
+
else {
|
|
6084
|
+
throw _error;
|
|
6085
|
+
}
|
|
6086
|
+
}).then((_response) => {
|
|
6087
|
+
return this.transformResult(url_, _response, (_response) => this.processDeleteVdpData(_response));
|
|
6088
|
+
});
|
|
6089
|
+
}
|
|
6090
|
+
processDeleteVdpData(response) {
|
|
6091
|
+
const status = response.status;
|
|
6092
|
+
let _headers = {};
|
|
6093
|
+
if (response.headers && typeof response.headers === "object") {
|
|
6094
|
+
for (let k in response.headers) {
|
|
6095
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
6096
|
+
_headers[k] = response.headers[k];
|
|
6097
|
+
}
|
|
6098
|
+
}
|
|
6099
|
+
}
|
|
6100
|
+
if (status === 200) {
|
|
6101
|
+
const _responseText = response.data;
|
|
6102
|
+
return Promise.resolve(null);
|
|
6103
|
+
}
|
|
6104
|
+
else if (status === 409) {
|
|
6105
|
+
const _responseText = response.data;
|
|
6106
|
+
let result409 = null;
|
|
6107
|
+
let resultData409 = _responseText;
|
|
6108
|
+
result409 = JSON.parse(resultData409);
|
|
6109
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
6110
|
+
}
|
|
6111
|
+
else if (status === 401) {
|
|
6112
|
+
const _responseText = response.data;
|
|
6113
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
6114
|
+
}
|
|
6115
|
+
else if (status === 403) {
|
|
6116
|
+
const _responseText = response.data;
|
|
6117
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
6118
|
+
}
|
|
6119
|
+
else if (status !== 200 && status !== 204) {
|
|
6120
|
+
const _responseText = response.data;
|
|
6121
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
6122
|
+
}
|
|
6123
|
+
return Promise.resolve(null);
|
|
6124
|
+
}
|
|
6125
|
+
/**
|
|
6126
|
+
* Converts colors for print-product item manipulations.
|
|
6127
|
+
* @param tenantId (optional) Tenant identifier
|
|
6128
|
+
* @param body (optional) Convert colors operation parameters.
|
|
6129
|
+
* @return Success
|
|
6130
|
+
*/
|
|
6131
|
+
convertColors(tenantId, body, cancelToken) {
|
|
6132
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/print-product/convert-colors?";
|
|
6133
|
+
if (tenantId === null)
|
|
6134
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
6135
|
+
else if (tenantId !== undefined)
|
|
6136
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
6137
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
6138
|
+
const content_ = JSON.stringify(body);
|
|
6139
|
+
let options_ = {
|
|
6140
|
+
data: content_,
|
|
6141
|
+
method: "POST",
|
|
6142
|
+
url: url_,
|
|
6143
|
+
headers: {
|
|
6144
|
+
"Content-Type": "application/json",
|
|
6145
|
+
"Accept": "application/json"
|
|
6146
|
+
},
|
|
6147
|
+
cancelToken
|
|
6148
|
+
};
|
|
6149
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
6150
|
+
return this.instance.request(transformedOptions_);
|
|
6151
|
+
}).catch((_error) => {
|
|
6152
|
+
if (isAxiosError(_error) && _error.response) {
|
|
6153
|
+
return _error.response;
|
|
6154
|
+
}
|
|
6155
|
+
else {
|
|
6156
|
+
throw _error;
|
|
6157
|
+
}
|
|
6158
|
+
}).then((_response) => {
|
|
6159
|
+
return this.transformResult(url_, _response, (_response) => this.processConvertColors(_response));
|
|
6160
|
+
});
|
|
6161
|
+
}
|
|
6162
|
+
processConvertColors(response) {
|
|
6163
|
+
const status = response.status;
|
|
6164
|
+
let _headers = {};
|
|
6165
|
+
if (response.headers && typeof response.headers === "object") {
|
|
6166
|
+
for (let k in response.headers) {
|
|
6167
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
6168
|
+
_headers[k] = response.headers[k];
|
|
6169
|
+
}
|
|
6170
|
+
}
|
|
6171
|
+
}
|
|
6172
|
+
if (status === 200) {
|
|
6173
|
+
const _responseText = response.data;
|
|
6174
|
+
let result200 = null;
|
|
6175
|
+
let resultData200 = _responseText;
|
|
6176
|
+
result200 = JSON.parse(resultData200);
|
|
6177
|
+
return Promise.resolve(result200);
|
|
6178
|
+
}
|
|
6179
|
+
else if (status === 404) {
|
|
6180
|
+
const _responseText = response.data;
|
|
6181
|
+
let result404 = null;
|
|
6182
|
+
let resultData404 = _responseText;
|
|
6183
|
+
result404 = JSON.parse(resultData404);
|
|
6184
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
6185
|
+
}
|
|
6186
|
+
else if (status === 401) {
|
|
6187
|
+
const _responseText = response.data;
|
|
6188
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
6189
|
+
}
|
|
6190
|
+
else if (status === 403) {
|
|
6191
|
+
const _responseText = response.data;
|
|
6192
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
6193
|
+
}
|
|
6194
|
+
else if (status !== 200 && status !== 204) {
|
|
6195
|
+
const _responseText = response.data;
|
|
6196
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
6197
|
+
}
|
|
6198
|
+
return Promise.resolve(null);
|
|
6199
|
+
}
|
|
6200
|
+
/**
|
|
6201
|
+
* Loads print-product from resource file taken from storage.
|
|
6202
|
+
* @param id (optional) Resource identifier.
|
|
6203
|
+
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
6204
|
+
* @param tenantId (optional) Tenant identifier
|
|
6205
|
+
* @return Success
|
|
6206
|
+
*/
|
|
6207
|
+
loadProductFromResource(id, privateStorageOwner, tenantId, cancelToken) {
|
|
6208
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/print-product/from-resource/model?";
|
|
6209
|
+
if (id !== undefined && id !== null)
|
|
6210
|
+
url_ += "id=" + encodeURIComponent("" + id) + "&";
|
|
6211
|
+
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
6212
|
+
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
6213
|
+
if (tenantId === null)
|
|
6214
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
6215
|
+
else if (tenantId !== undefined)
|
|
6216
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
6217
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
6218
|
+
let options_ = {
|
|
6219
|
+
method: "GET",
|
|
6220
|
+
url: url_,
|
|
6221
|
+
headers: {
|
|
6222
|
+
"Accept": "application/json"
|
|
6223
|
+
},
|
|
6224
|
+
cancelToken
|
|
6225
|
+
};
|
|
6226
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
6227
|
+
return this.instance.request(transformedOptions_);
|
|
6228
|
+
}).catch((_error) => {
|
|
6229
|
+
if (isAxiosError(_error) && _error.response) {
|
|
6230
|
+
return _error.response;
|
|
6231
|
+
}
|
|
6232
|
+
else {
|
|
6233
|
+
throw _error;
|
|
6234
|
+
}
|
|
6235
|
+
}).then((_response) => {
|
|
6236
|
+
return this.transformResult(url_, _response, (_response) => this.processLoadProductFromResource(_response));
|
|
6237
|
+
});
|
|
6238
|
+
}
|
|
6239
|
+
processLoadProductFromResource(response) {
|
|
6240
|
+
const status = response.status;
|
|
6241
|
+
let _headers = {};
|
|
6242
|
+
if (response.headers && typeof response.headers === "object") {
|
|
6243
|
+
for (let k in response.headers) {
|
|
6244
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
6245
|
+
_headers[k] = response.headers[k];
|
|
6246
|
+
}
|
|
6247
|
+
}
|
|
6248
|
+
}
|
|
6249
|
+
if (status === 200) {
|
|
6250
|
+
const _responseText = response.data;
|
|
6251
|
+
let result200 = null;
|
|
6252
|
+
let resultData200 = _responseText;
|
|
6253
|
+
result200 = JSON.parse(resultData200);
|
|
6254
|
+
return Promise.resolve(result200);
|
|
6255
|
+
}
|
|
6256
|
+
else if (status === 404) {
|
|
6257
|
+
const _responseText = response.data;
|
|
6258
|
+
let result404 = null;
|
|
6259
|
+
let resultData404 = _responseText;
|
|
6260
|
+
result404 = JSON.parse(resultData404);
|
|
6261
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
6262
|
+
}
|
|
6263
|
+
else if (status === 409) {
|
|
6264
|
+
const _responseText = response.data;
|
|
6265
|
+
let result409 = null;
|
|
6266
|
+
let resultData409 = _responseText;
|
|
6267
|
+
result409 = JSON.parse(resultData409);
|
|
6268
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
6269
|
+
}
|
|
6270
|
+
else if (status === 401) {
|
|
6271
|
+
const _responseText = response.data;
|
|
6272
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
6273
|
+
}
|
|
6274
|
+
else if (status === 403) {
|
|
6275
|
+
const _responseText = response.data;
|
|
6276
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
6277
|
+
}
|
|
6278
|
+
else if (status !== 200 && status !== 204) {
|
|
6279
|
+
const _responseText = response.data;
|
|
6280
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
6281
|
+
}
|
|
6282
|
+
return Promise.resolve(null);
|
|
6283
|
+
}
|
|
6284
|
+
/**
|
|
6285
|
+
* Renders a product proof image with specified parameters.
|
|
6286
|
+
* @param attachment (optional) If set to 'true', file will be provided as an attachment with unique filename supplied
|
|
6287
|
+
(default value is 'false').
|
|
6288
|
+
* @param tenantId (optional) Tenant identifier
|
|
6289
|
+
* @param body (optional) Preview parameters.
|
|
6290
|
+
* @return Success
|
|
6291
|
+
*/
|
|
6292
|
+
renderProduct(attachment, tenantId, body, cancelToken) {
|
|
6293
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/print-product/render-proof?";
|
|
6294
|
+
if (attachment !== undefined && attachment !== null)
|
|
6295
|
+
url_ += "attachment=" + encodeURIComponent("" + attachment) + "&";
|
|
6296
|
+
if (tenantId === null)
|
|
6297
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
6298
|
+
else if (tenantId !== undefined)
|
|
6299
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
6300
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
6301
|
+
const content_ = JSON.stringify(body);
|
|
6302
|
+
let options_ = {
|
|
6303
|
+
data: content_,
|
|
6304
|
+
responseType: "blob",
|
|
6305
|
+
method: "POST",
|
|
6306
|
+
url: url_,
|
|
6307
|
+
headers: {
|
|
6308
|
+
"Content-Type": "application/json",
|
|
6309
|
+
"Accept": "application/octet-stream"
|
|
6310
|
+
},
|
|
6311
|
+
cancelToken
|
|
6312
|
+
};
|
|
6313
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
6314
|
+
return this.instance.request(transformedOptions_);
|
|
6315
|
+
}).catch((_error) => {
|
|
6316
|
+
if (isAxiosError(_error) && _error.response) {
|
|
6317
|
+
return _error.response;
|
|
6318
|
+
}
|
|
6319
|
+
else {
|
|
6320
|
+
throw _error;
|
|
6321
|
+
}
|
|
6322
|
+
}).then((_response) => {
|
|
6323
|
+
return this.transformResult(url_, _response, (_response) => this.processRenderProduct(_response));
|
|
6324
|
+
});
|
|
6325
|
+
}
|
|
6326
|
+
processRenderProduct(response) {
|
|
6327
|
+
const status = response.status;
|
|
6328
|
+
let _headers = {};
|
|
6329
|
+
if (response.headers && typeof response.headers === "object") {
|
|
6330
|
+
for (let k in response.headers) {
|
|
6331
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
6332
|
+
_headers[k] = response.headers[k];
|
|
6333
|
+
}
|
|
6334
|
+
}
|
|
6335
|
+
}
|
|
6336
|
+
if (status === 200 || status === 206) {
|
|
6337
|
+
const contentDisposition = response.headers ? response.headers["content-disposition"] : undefined;
|
|
6338
|
+
const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
|
|
6339
|
+
const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
|
|
6340
|
+
return Promise.resolve({ fileName: fileName, status: status, data: new Blob([response.data]), headers: _headers });
|
|
6341
|
+
}
|
|
6342
|
+
else if (status === 401) {
|
|
6343
|
+
const _responseText = response.data;
|
|
6344
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
6345
|
+
}
|
|
6346
|
+
else if (status === 403) {
|
|
6347
|
+
const _responseText = response.data;
|
|
6348
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
6349
|
+
}
|
|
6350
|
+
else if (status !== 200 && status !== 204) {
|
|
6351
|
+
const _responseText = response.data;
|
|
6352
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
6353
|
+
}
|
|
6354
|
+
return Promise.resolve(null);
|
|
6355
|
+
}
|
|
6356
|
+
/**
|
|
6357
|
+
* Renders a design preview with the specified parameters.
|
|
6358
|
+
* @param attachment (optional) If set to 'true', file will be provided as an attachment with unique filename supplied
|
|
6359
|
+
(default value is 'false').
|
|
6360
|
+
* @param tenantId (optional) Tenant identifier
|
|
6361
|
+
* @param body (optional) Render model with preview parameters.
|
|
6362
|
+
* @return Success
|
|
6363
|
+
*/
|
|
6364
|
+
renderDesignPreview(attachment, tenantId, body, cancelToken) {
|
|
6365
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/render-preview?";
|
|
6366
|
+
if (attachment !== undefined && attachment !== null)
|
|
6367
|
+
url_ += "attachment=" + encodeURIComponent("" + attachment) + "&";
|
|
6368
|
+
if (tenantId === null)
|
|
6369
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
6370
|
+
else if (tenantId !== undefined)
|
|
6371
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
6372
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
6373
|
+
const content_ = JSON.stringify(body);
|
|
6374
|
+
let options_ = {
|
|
6375
|
+
data: content_,
|
|
6376
|
+
responseType: "blob",
|
|
6377
|
+
method: "POST",
|
|
6378
|
+
url: url_,
|
|
6379
|
+
headers: {
|
|
6380
|
+
"Content-Type": "application/json",
|
|
6381
|
+
"Accept": "application/octet-stream"
|
|
6382
|
+
},
|
|
6383
|
+
cancelToken
|
|
6384
|
+
};
|
|
6385
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
6386
|
+
return this.instance.request(transformedOptions_);
|
|
6387
|
+
}).catch((_error) => {
|
|
6388
|
+
if (isAxiosError(_error) && _error.response) {
|
|
6389
|
+
return _error.response;
|
|
6390
|
+
}
|
|
6391
|
+
else {
|
|
6392
|
+
throw _error;
|
|
6393
|
+
}
|
|
6394
|
+
}).then((_response) => {
|
|
6395
|
+
return this.transformResult(url_, _response, (_response) => this.processRenderDesignPreview(_response));
|
|
6396
|
+
});
|
|
6397
|
+
}
|
|
6398
|
+
processRenderDesignPreview(response) {
|
|
6399
|
+
const status = response.status;
|
|
6400
|
+
let _headers = {};
|
|
6401
|
+
if (response.headers && typeof response.headers === "object") {
|
|
6402
|
+
for (let k in response.headers) {
|
|
6403
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
6404
|
+
_headers[k] = response.headers[k];
|
|
6405
|
+
}
|
|
6406
|
+
}
|
|
6407
|
+
}
|
|
6408
|
+
if (status === 200 || status === 206) {
|
|
6409
|
+
const contentDisposition = response.headers ? response.headers["content-disposition"] : undefined;
|
|
6410
|
+
const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
|
|
6411
|
+
const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
|
|
6412
|
+
return Promise.resolve({ fileName: fileName, status: status, data: new Blob([response.data]), headers: _headers });
|
|
6413
|
+
}
|
|
6414
|
+
else if (status === 401) {
|
|
6415
|
+
const _responseText = response.data;
|
|
6416
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
6417
|
+
}
|
|
6418
|
+
else if (status === 403) {
|
|
6419
|
+
const _responseText = response.data;
|
|
6420
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
6421
|
+
}
|
|
6422
|
+
else if (status !== 200 && status !== 204) {
|
|
6423
|
+
const _responseText = response.data;
|
|
6424
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
6425
|
+
}
|
|
6426
|
+
return Promise.resolve(null);
|
|
6427
|
+
}
|
|
6428
|
+
/**
|
|
6429
|
+
* Renders a design preview with the specified parameters and saves rendering result as resource.
|
|
6430
|
+
* @param tenantId (optional) Tenant identifier
|
|
6431
|
+
* @param body (optional) Render model with preview parameters.
|
|
6432
|
+
* @return Success
|
|
6433
|
+
*/
|
|
6434
|
+
renderDesignPreviewToResource(tenantId, body, cancelToken) {
|
|
6435
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/render-preview/to-resource?";
|
|
6436
|
+
if (tenantId === null)
|
|
6437
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
6438
|
+
else if (tenantId !== undefined)
|
|
6439
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
6440
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
6441
|
+
const content_ = JSON.stringify(body);
|
|
6442
|
+
let options_ = {
|
|
6443
|
+
data: content_,
|
|
6444
|
+
method: "POST",
|
|
6445
|
+
url: url_,
|
|
6446
|
+
headers: {
|
|
6447
|
+
"Content-Type": "application/json",
|
|
6448
|
+
"Accept": "application/json"
|
|
6449
|
+
},
|
|
6450
|
+
cancelToken
|
|
6451
|
+
};
|
|
6452
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
6453
|
+
return this.instance.request(transformedOptions_);
|
|
6454
|
+
}).catch((_error) => {
|
|
6455
|
+
if (isAxiosError(_error) && _error.response) {
|
|
6456
|
+
return _error.response;
|
|
6457
|
+
}
|
|
6458
|
+
else {
|
|
6459
|
+
throw _error;
|
|
6460
|
+
}
|
|
6461
|
+
}).then((_response) => {
|
|
6462
|
+
return this.transformResult(url_, _response, (_response) => this.processRenderDesignPreviewToResource(_response));
|
|
6463
|
+
});
|
|
6464
|
+
}
|
|
6465
|
+
processRenderDesignPreviewToResource(response) {
|
|
6466
|
+
const status = response.status;
|
|
6467
|
+
let _headers = {};
|
|
6468
|
+
if (response.headers && typeof response.headers === "object") {
|
|
6469
|
+
for (let k in response.headers) {
|
|
6470
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
6471
|
+
_headers[k] = response.headers[k];
|
|
6472
|
+
}
|
|
6473
|
+
}
|
|
6474
|
+
}
|
|
6475
|
+
if (status === 200) {
|
|
6476
|
+
const _responseText = response.data;
|
|
6477
|
+
let result200 = null;
|
|
6478
|
+
let resultData200 = _responseText;
|
|
6479
|
+
result200 = JSON.parse(resultData200);
|
|
6480
|
+
return Promise.resolve(result200);
|
|
6481
|
+
}
|
|
6482
|
+
else if (status === 409) {
|
|
6483
|
+
const _responseText = response.data;
|
|
6484
|
+
let result409 = null;
|
|
6485
|
+
let resultData409 = _responseText;
|
|
6486
|
+
result409 = JSON.parse(resultData409);
|
|
6487
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
6488
|
+
}
|
|
6489
|
+
else if (status === 401) {
|
|
6490
|
+
const _responseText = response.data;
|
|
6491
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
6492
|
+
}
|
|
6493
|
+
else if (status === 403) {
|
|
6494
|
+
const _responseText = response.data;
|
|
6495
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
6496
|
+
}
|
|
6497
|
+
else if (status !== 200 && status !== 204) {
|
|
6498
|
+
const _responseText = response.data;
|
|
6499
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
6500
|
+
}
|
|
6501
|
+
return Promise.resolve(null);
|
|
6502
|
+
}
|
|
6503
|
+
/**
|
|
6504
|
+
* Renders a design proof with the specified parameters.
|
|
6505
|
+
* @param attachment (optional) If set to 'true', file will be provided as an attachment with unique filename supplied
|
|
6506
|
+
(default value is 'false').
|
|
6507
|
+
* @param tenantId (optional) Tenant identifier
|
|
6508
|
+
* @param body (optional) Render model with proof parameters.
|
|
6509
|
+
* @return Success
|
|
6510
|
+
*/
|
|
6511
|
+
renderDesignProof(attachment, tenantId, body, cancelToken) {
|
|
6512
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/render-proof?";
|
|
6513
|
+
if (attachment !== undefined && attachment !== null)
|
|
6514
|
+
url_ += "attachment=" + encodeURIComponent("" + attachment) + "&";
|
|
6515
|
+
if (tenantId === null)
|
|
6516
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
6517
|
+
else if (tenantId !== undefined)
|
|
6518
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
6519
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
6520
|
+
const content_ = JSON.stringify(body);
|
|
6521
|
+
let options_ = {
|
|
6522
|
+
data: content_,
|
|
6523
|
+
responseType: "blob",
|
|
6524
|
+
method: "POST",
|
|
6525
|
+
url: url_,
|
|
6526
|
+
headers: {
|
|
6527
|
+
"Content-Type": "application/json",
|
|
6528
|
+
"Accept": "application/octet-stream"
|
|
6529
|
+
},
|
|
6530
|
+
cancelToken
|
|
6531
|
+
};
|
|
6532
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
6533
|
+
return this.instance.request(transformedOptions_);
|
|
6534
|
+
}).catch((_error) => {
|
|
6535
|
+
if (isAxiosError(_error) && _error.response) {
|
|
6536
|
+
return _error.response;
|
|
6537
|
+
}
|
|
6538
|
+
else {
|
|
6539
|
+
throw _error;
|
|
6540
|
+
}
|
|
6541
|
+
}).then((_response) => {
|
|
6542
|
+
return this.transformResult(url_, _response, (_response) => this.processRenderDesignProof(_response));
|
|
6543
|
+
});
|
|
6544
|
+
}
|
|
6545
|
+
processRenderDesignProof(response) {
|
|
6546
|
+
const status = response.status;
|
|
6547
|
+
let _headers = {};
|
|
6548
|
+
if (response.headers && typeof response.headers === "object") {
|
|
6549
|
+
for (let k in response.headers) {
|
|
6550
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
6551
|
+
_headers[k] = response.headers[k];
|
|
6552
|
+
}
|
|
6553
|
+
}
|
|
6554
|
+
}
|
|
6555
|
+
if (status === 200 || status === 206) {
|
|
6556
|
+
const contentDisposition = response.headers ? response.headers["content-disposition"] : undefined;
|
|
6557
|
+
const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
|
|
6558
|
+
const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
|
|
6559
|
+
return Promise.resolve({ fileName: fileName, status: status, data: new Blob([response.data]), headers: _headers });
|
|
6560
|
+
}
|
|
6561
|
+
else if (status === 401) {
|
|
6562
|
+
const _responseText = response.data;
|
|
6563
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
6564
|
+
}
|
|
6565
|
+
else if (status === 403) {
|
|
6566
|
+
const _responseText = response.data;
|
|
6567
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
6568
|
+
}
|
|
6569
|
+
else if (status !== 200 && status !== 204) {
|
|
6570
|
+
const _responseText = response.data;
|
|
6571
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
6572
|
+
}
|
|
6573
|
+
return Promise.resolve(null);
|
|
6574
|
+
}
|
|
6575
|
+
/**
|
|
6576
|
+
* Renders a design proof with the specified parameters and saves rendering result as resource.
|
|
6577
|
+
* @param tenantId (optional) Tenant identifier
|
|
6578
|
+
* @param body (optional) Render model with preview parameters.
|
|
6579
|
+
* @return Success
|
|
6580
|
+
*/
|
|
6581
|
+
renderDesignProofToResource(tenantId, body, cancelToken) {
|
|
6582
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/render-proof/to-resource?";
|
|
6583
|
+
if (tenantId === null)
|
|
6584
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
6585
|
+
else if (tenantId !== undefined)
|
|
6586
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
6587
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
6588
|
+
const content_ = JSON.stringify(body);
|
|
6589
|
+
let options_ = {
|
|
6590
|
+
data: content_,
|
|
6591
|
+
method: "POST",
|
|
6592
|
+
url: url_,
|
|
6593
|
+
headers: {
|
|
6594
|
+
"Content-Type": "application/json",
|
|
6595
|
+
"Accept": "application/json"
|
|
6596
|
+
},
|
|
6597
|
+
cancelToken
|
|
6598
|
+
};
|
|
6599
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
6600
|
+
return this.instance.request(transformedOptions_);
|
|
6601
|
+
}).catch((_error) => {
|
|
6602
|
+
if (isAxiosError(_error) && _error.response) {
|
|
6603
|
+
return _error.response;
|
|
6604
|
+
}
|
|
6605
|
+
else {
|
|
6606
|
+
throw _error;
|
|
6607
|
+
}
|
|
6608
|
+
}).then((_response) => {
|
|
6609
|
+
return this.transformResult(url_, _response, (_response) => this.processRenderDesignProofToResource(_response));
|
|
6610
|
+
});
|
|
6611
|
+
}
|
|
6612
|
+
processRenderDesignProofToResource(response) {
|
|
6613
|
+
const status = response.status;
|
|
6614
|
+
let _headers = {};
|
|
6615
|
+
if (response.headers && typeof response.headers === "object") {
|
|
6616
|
+
for (let k in response.headers) {
|
|
6617
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
6618
|
+
_headers[k] = response.headers[k];
|
|
6619
|
+
}
|
|
6620
|
+
}
|
|
6621
|
+
}
|
|
6622
|
+
if (status === 200) {
|
|
6623
|
+
const _responseText = response.data;
|
|
6624
|
+
let result200 = null;
|
|
6625
|
+
let resultData200 = _responseText;
|
|
6626
|
+
result200 = JSON.parse(resultData200);
|
|
6627
|
+
return Promise.resolve(result200);
|
|
6628
|
+
}
|
|
6629
|
+
else if (status === 409) {
|
|
6630
|
+
const _responseText = response.data;
|
|
6631
|
+
let result409 = null;
|
|
6632
|
+
let resultData409 = _responseText;
|
|
6633
|
+
result409 = JSON.parse(resultData409);
|
|
6634
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
6635
|
+
}
|
|
6636
|
+
else if (status === 401) {
|
|
6637
|
+
const _responseText = response.data;
|
|
6638
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
6639
|
+
}
|
|
6640
|
+
else if (status === 403) {
|
|
6641
|
+
const _responseText = response.data;
|
|
6642
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
6643
|
+
}
|
|
6644
|
+
else if (status !== 200 && status !== 204) {
|
|
6645
|
+
const _responseText = response.data;
|
|
6646
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
6647
|
+
}
|
|
6648
|
+
return Promise.resolve(null);
|
|
6649
|
+
}
|
|
6650
|
+
/**
|
|
6651
|
+
* Loads print-product from design file taken from storage.
|
|
6652
|
+
* @param id Design identifier.
|
|
6653
|
+
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
6654
|
+
* @param tenantId (optional) Tenant identifier
|
|
6655
|
+
* @return Success
|
|
6656
|
+
* @deprecated
|
|
6657
|
+
*/
|
|
6658
|
+
loadProduct(id, privateStorageOwner, tenantId, cancelToken) {
|
|
6659
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/model?";
|
|
6660
|
+
if (id === undefined || id === null)
|
|
6661
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
6662
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
6663
|
+
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
6664
|
+
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
6665
|
+
if (tenantId === null)
|
|
6666
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
6667
|
+
else if (tenantId !== undefined)
|
|
6668
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
6669
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
6670
|
+
let options_ = {
|
|
6671
|
+
method: "GET",
|
|
6672
|
+
url: url_,
|
|
6673
|
+
headers: {
|
|
6674
|
+
"Accept": "application/json"
|
|
6675
|
+
},
|
|
6676
|
+
cancelToken
|
|
6677
|
+
};
|
|
6678
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
6679
|
+
return this.instance.request(transformedOptions_);
|
|
6680
|
+
}).catch((_error) => {
|
|
6681
|
+
if (isAxiosError(_error) && _error.response) {
|
|
6682
|
+
return _error.response;
|
|
6683
|
+
}
|
|
6684
|
+
else {
|
|
6685
|
+
throw _error;
|
|
6686
|
+
}
|
|
6687
|
+
}).then((_response) => {
|
|
6688
|
+
return this.transformResult(url_, _response, (_response) => this.processLoadProduct(_response));
|
|
6689
|
+
});
|
|
6690
|
+
}
|
|
6691
|
+
processLoadProduct(response) {
|
|
6692
|
+
const status = response.status;
|
|
6693
|
+
let _headers = {};
|
|
6694
|
+
if (response.headers && typeof response.headers === "object") {
|
|
6695
|
+
for (let k in response.headers) {
|
|
6696
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
6697
|
+
_headers[k] = response.headers[k];
|
|
6698
|
+
}
|
|
6699
|
+
}
|
|
6700
|
+
}
|
|
6701
|
+
if (status === 200) {
|
|
6702
|
+
const _responseText = response.data;
|
|
6703
|
+
let result200 = null;
|
|
6704
|
+
let resultData200 = _responseText;
|
|
6705
|
+
result200 = JSON.parse(resultData200);
|
|
6706
|
+
return Promise.resolve(result200);
|
|
6707
|
+
}
|
|
6708
|
+
else if (status === 404) {
|
|
6709
|
+
const _responseText = response.data;
|
|
6710
|
+
let result404 = null;
|
|
6711
|
+
let resultData404 = _responseText;
|
|
6712
|
+
result404 = JSON.parse(resultData404);
|
|
6713
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
6714
|
+
}
|
|
6715
|
+
else if (status === 401) {
|
|
6716
|
+
const _responseText = response.data;
|
|
6717
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
6718
|
+
}
|
|
6719
|
+
else if (status === 403) {
|
|
6720
|
+
const _responseText = response.data;
|
|
6721
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
6722
|
+
}
|
|
6723
|
+
else if (status !== 200 && status !== 204) {
|
|
6724
|
+
const _responseText = response.data;
|
|
6725
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
6726
|
+
}
|
|
6727
|
+
return Promise.resolve(null);
|
|
6728
|
+
}
|
|
6729
|
+
/**
|
|
6730
|
+
* Saves print-product to design file and updates design file in storage.
|
|
6731
|
+
* @param id Design identifier.
|
|
6732
|
+
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
6733
|
+
* @param tenantId (optional) Tenant identifier
|
|
6734
|
+
* @param body (optional) Serialized product description.
|
|
6735
|
+
* @return Success
|
|
6736
|
+
* @deprecated
|
|
6737
|
+
*/
|
|
6738
|
+
saveProduct(id, privateStorageOwner, tenantId, body, cancelToken) {
|
|
6739
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/model?";
|
|
6740
|
+
if (id === undefined || id === null)
|
|
6741
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
6742
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
6743
|
+
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
6744
|
+
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
6745
|
+
if (tenantId === null)
|
|
6746
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
6747
|
+
else if (tenantId !== undefined)
|
|
6748
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
6749
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
6750
|
+
const content_ = JSON.stringify(body);
|
|
6751
|
+
let options_ = {
|
|
6752
|
+
data: content_,
|
|
6753
|
+
method: "PUT",
|
|
6754
|
+
url: url_,
|
|
6755
|
+
headers: {
|
|
6756
|
+
"Content-Type": "application/json",
|
|
6757
|
+
},
|
|
6758
|
+
cancelToken
|
|
6759
|
+
};
|
|
6760
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
6761
|
+
return this.instance.request(transformedOptions_);
|
|
6762
|
+
}).catch((_error) => {
|
|
6763
|
+
if (isAxiosError(_error) && _error.response) {
|
|
6764
|
+
return _error.response;
|
|
6765
|
+
}
|
|
6766
|
+
else {
|
|
6767
|
+
throw _error;
|
|
6768
|
+
}
|
|
6769
|
+
}).then((_response) => {
|
|
6770
|
+
return this.transformResult(url_, _response, (_response) => this.processSaveProduct(_response));
|
|
6771
|
+
});
|
|
6772
|
+
}
|
|
6773
|
+
processSaveProduct(response) {
|
|
6774
|
+
const status = response.status;
|
|
6775
|
+
let _headers = {};
|
|
6776
|
+
if (response.headers && typeof response.headers === "object") {
|
|
6777
|
+
for (let k in response.headers) {
|
|
6778
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
6779
|
+
_headers[k] = response.headers[k];
|
|
6780
|
+
}
|
|
6781
|
+
}
|
|
4976
6782
|
}
|
|
4977
|
-
|
|
6783
|
+
if (status === 200) {
|
|
4978
6784
|
const _responseText = response.data;
|
|
4979
|
-
|
|
4980
|
-
|
|
4981
|
-
|
|
4982
|
-
|
|
6785
|
+
return Promise.resolve(null);
|
|
6786
|
+
}
|
|
6787
|
+
else if (status === 404) {
|
|
6788
|
+
const _responseText = response.data;
|
|
6789
|
+
let result404 = null;
|
|
6790
|
+
let resultData404 = _responseText;
|
|
6791
|
+
result404 = JSON.parse(resultData404);
|
|
6792
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
6793
|
+
}
|
|
6794
|
+
else if (status === 401) {
|
|
6795
|
+
const _responseText = response.data;
|
|
6796
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
6797
|
+
}
|
|
6798
|
+
else if (status === 403) {
|
|
6799
|
+
const _responseText = response.data;
|
|
6800
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
6801
|
+
}
|
|
6802
|
+
else if (status !== 200 && status !== 204) {
|
|
6803
|
+
const _responseText = response.data;
|
|
6804
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
6805
|
+
}
|
|
6806
|
+
return Promise.resolve(null);
|
|
6807
|
+
}
|
|
6808
|
+
/**
|
|
6809
|
+
* Patches print-product in design file.
|
|
6810
|
+
* @param id Design identifier.
|
|
6811
|
+
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
6812
|
+
* @param tenantId (optional) Tenant identifier
|
|
6813
|
+
* @param patchType (optional)
|
|
6814
|
+
* @param replaceImageItemFileInfo_itemName (optional)
|
|
6815
|
+
* @param replaceImageItemFileInfo_sourceFile (optional)
|
|
6816
|
+
* @param replacePlaceholderItemContentInfo_placeholderItemName (optional)
|
|
6817
|
+
* @param replacePlaceholderItemContentInfo_newContentType (optional)
|
|
6818
|
+
* @param replacePlaceholderItemContentInfo_sourceFile (optional)
|
|
6819
|
+
* @return Success
|
|
6820
|
+
* @deprecated
|
|
6821
|
+
*/
|
|
6822
|
+
patchProduct(id, privateStorageOwner, tenantId, patchType, replaceImageItemFileInfo_itemName, replaceImageItemFileInfo_sourceFile, replacePlaceholderItemContentInfo_placeholderItemName, replacePlaceholderItemContentInfo_newContentType, replacePlaceholderItemContentInfo_sourceFile, cancelToken) {
|
|
6823
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/model?";
|
|
6824
|
+
if (id === undefined || id === null)
|
|
6825
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
6826
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
6827
|
+
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
6828
|
+
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
6829
|
+
if (tenantId === null)
|
|
6830
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
6831
|
+
else if (tenantId !== undefined)
|
|
6832
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
6833
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
6834
|
+
const content_ = new FormData();
|
|
6835
|
+
if (patchType === null || patchType === undefined)
|
|
6836
|
+
throw new Error("The parameter 'patchType' cannot be null.");
|
|
6837
|
+
else
|
|
6838
|
+
content_.append("patchType", patchType.toString());
|
|
6839
|
+
if (replaceImageItemFileInfo_itemName !== null && replaceImageItemFileInfo_itemName !== undefined)
|
|
6840
|
+
content_.append("replaceImageItemFileInfo.itemName", replaceImageItemFileInfo_itemName.toString());
|
|
6841
|
+
if (replaceImageItemFileInfo_sourceFile !== null && replaceImageItemFileInfo_sourceFile !== undefined)
|
|
6842
|
+
content_.append("replaceImageItemFileInfo.sourceFile", replaceImageItemFileInfo_sourceFile.data, replaceImageItemFileInfo_sourceFile.fileName ? replaceImageItemFileInfo_sourceFile.fileName : "replaceImageItemFileInfo.sourceFile");
|
|
6843
|
+
if (replacePlaceholderItemContentInfo_placeholderItemName !== null && replacePlaceholderItemContentInfo_placeholderItemName !== undefined)
|
|
6844
|
+
content_.append("replacePlaceholderItemContentInfo.placeholderItemName", replacePlaceholderItemContentInfo_placeholderItemName.toString());
|
|
6845
|
+
if (replacePlaceholderItemContentInfo_newContentType === null || replacePlaceholderItemContentInfo_newContentType === undefined)
|
|
6846
|
+
throw new Error("The parameter 'replacePlaceholderItemContentInfo_newContentType' cannot be null.");
|
|
6847
|
+
else
|
|
6848
|
+
content_.append("replacePlaceholderItemContentInfo.newContentType", replacePlaceholderItemContentInfo_newContentType.toString());
|
|
6849
|
+
if (replacePlaceholderItemContentInfo_sourceFile !== null && replacePlaceholderItemContentInfo_sourceFile !== undefined)
|
|
6850
|
+
content_.append("replacePlaceholderItemContentInfo.sourceFile", replacePlaceholderItemContentInfo_sourceFile.data, replacePlaceholderItemContentInfo_sourceFile.fileName ? replacePlaceholderItemContentInfo_sourceFile.fileName : "replacePlaceholderItemContentInfo.sourceFile");
|
|
6851
|
+
let options_ = {
|
|
6852
|
+
data: content_,
|
|
6853
|
+
method: "PATCH",
|
|
6854
|
+
url: url_,
|
|
6855
|
+
headers: {},
|
|
6856
|
+
cancelToken
|
|
6857
|
+
};
|
|
6858
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
6859
|
+
return this.instance.request(transformedOptions_);
|
|
6860
|
+
}).catch((_error) => {
|
|
6861
|
+
if (isAxiosError(_error) && _error.response) {
|
|
6862
|
+
return _error.response;
|
|
6863
|
+
}
|
|
6864
|
+
else {
|
|
6865
|
+
throw _error;
|
|
6866
|
+
}
|
|
6867
|
+
}).then((_response) => {
|
|
6868
|
+
return this.transformResult(url_, _response, (_response) => this.processPatchProduct(_response));
|
|
6869
|
+
});
|
|
6870
|
+
}
|
|
6871
|
+
processPatchProduct(response) {
|
|
6872
|
+
const status = response.status;
|
|
6873
|
+
let _headers = {};
|
|
6874
|
+
if (response.headers && typeof response.headers === "object") {
|
|
6875
|
+
for (let k in response.headers) {
|
|
6876
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
6877
|
+
_headers[k] = response.headers[k];
|
|
6878
|
+
}
|
|
6879
|
+
}
|
|
6880
|
+
}
|
|
6881
|
+
if (status === 200) {
|
|
6882
|
+
const _responseText = response.data;
|
|
6883
|
+
return Promise.resolve(null);
|
|
6884
|
+
}
|
|
6885
|
+
else if (status === 404) {
|
|
6886
|
+
const _responseText = response.data;
|
|
6887
|
+
let result404 = null;
|
|
6888
|
+
let resultData404 = _responseText;
|
|
6889
|
+
result404 = JSON.parse(resultData404);
|
|
6890
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
4983
6891
|
}
|
|
4984
6892
|
else if (status === 401) {
|
|
4985
6893
|
const _responseText = response.data;
|
|
@@ -4996,7 +6904,7 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
4996
6904
|
return Promise.resolve(null);
|
|
4997
6905
|
}
|
|
4998
6906
|
/**
|
|
4999
|
-
* Creates product item.
|
|
6907
|
+
* Creates print-product item.
|
|
5000
6908
|
* @param itemType (optional) Desired item type.
|
|
5001
6909
|
* @param tenantId (optional) Tenant identifier
|
|
5002
6910
|
* @param sourceType (optional)
|
|
@@ -5087,6 +6995,144 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
5087
6995
|
}
|
|
5088
6996
|
return Promise.resolve(null);
|
|
5089
6997
|
}
|
|
6998
|
+
/**
|
|
6999
|
+
* Extracts print-product item image.
|
|
7000
|
+
* @param tenantId (optional) Tenant identifier
|
|
7001
|
+
* @param body (optional) Extraction parameters.
|
|
7002
|
+
* @return Success
|
|
7003
|
+
* @deprecated
|
|
7004
|
+
*/
|
|
7005
|
+
extractItemImage(tenantId, body, cancelToken) {
|
|
7006
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/model/items/extract-image?";
|
|
7007
|
+
if (tenantId === null)
|
|
7008
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
7009
|
+
else if (tenantId !== undefined)
|
|
7010
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
7011
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
7012
|
+
const content_ = JSON.stringify(body);
|
|
7013
|
+
let options_ = {
|
|
7014
|
+
data: content_,
|
|
7015
|
+
responseType: "blob",
|
|
7016
|
+
method: "POST",
|
|
7017
|
+
url: url_,
|
|
7018
|
+
headers: {
|
|
7019
|
+
"Content-Type": "application/json",
|
|
7020
|
+
"Accept": "application/octet-stream"
|
|
7021
|
+
},
|
|
7022
|
+
cancelToken
|
|
7023
|
+
};
|
|
7024
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
7025
|
+
return this.instance.request(transformedOptions_);
|
|
7026
|
+
}).catch((_error) => {
|
|
7027
|
+
if (isAxiosError(_error) && _error.response) {
|
|
7028
|
+
return _error.response;
|
|
7029
|
+
}
|
|
7030
|
+
else {
|
|
7031
|
+
throw _error;
|
|
7032
|
+
}
|
|
7033
|
+
}).then((_response) => {
|
|
7034
|
+
return this.transformResult(url_, _response, (_response) => this.processExtractItemImage(_response));
|
|
7035
|
+
});
|
|
7036
|
+
}
|
|
7037
|
+
processExtractItemImage(response) {
|
|
7038
|
+
const status = response.status;
|
|
7039
|
+
let _headers = {};
|
|
7040
|
+
if (response.headers && typeof response.headers === "object") {
|
|
7041
|
+
for (let k in response.headers) {
|
|
7042
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
7043
|
+
_headers[k] = response.headers[k];
|
|
7044
|
+
}
|
|
7045
|
+
}
|
|
7046
|
+
}
|
|
7047
|
+
if (status === 200 || status === 206) {
|
|
7048
|
+
const contentDisposition = response.headers ? response.headers["content-disposition"] : undefined;
|
|
7049
|
+
const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
|
|
7050
|
+
const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
|
|
7051
|
+
return Promise.resolve({ fileName: fileName, status: status, data: new Blob([response.data]), headers: _headers });
|
|
7052
|
+
}
|
|
7053
|
+
else if (status === 401) {
|
|
7054
|
+
const _responseText = response.data;
|
|
7055
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
7056
|
+
}
|
|
7057
|
+
else if (status === 403) {
|
|
7058
|
+
const _responseText = response.data;
|
|
7059
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
7060
|
+
}
|
|
7061
|
+
else if (status !== 200 && status !== 204) {
|
|
7062
|
+
const _responseText = response.data;
|
|
7063
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
7064
|
+
}
|
|
7065
|
+
return Promise.resolve(null);
|
|
7066
|
+
}
|
|
7067
|
+
/**
|
|
7068
|
+
* Flattens print-product items.
|
|
7069
|
+
* @param tenantId (optional) Tenant identifier
|
|
7070
|
+
* @param body (optional) Items to flatten.
|
|
7071
|
+
* @return Success
|
|
7072
|
+
* @deprecated
|
|
7073
|
+
*/
|
|
7074
|
+
flattenItems(tenantId, body, cancelToken) {
|
|
7075
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/model/items/flatten?";
|
|
7076
|
+
if (tenantId === null)
|
|
7077
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
7078
|
+
else if (tenantId !== undefined)
|
|
7079
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
7080
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
7081
|
+
const content_ = JSON.stringify(body);
|
|
7082
|
+
let options_ = {
|
|
7083
|
+
data: content_,
|
|
7084
|
+
method: "POST",
|
|
7085
|
+
url: url_,
|
|
7086
|
+
headers: {
|
|
7087
|
+
"Content-Type": "application/json",
|
|
7088
|
+
"Accept": "application/json"
|
|
7089
|
+
},
|
|
7090
|
+
cancelToken
|
|
7091
|
+
};
|
|
7092
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
7093
|
+
return this.instance.request(transformedOptions_);
|
|
7094
|
+
}).catch((_error) => {
|
|
7095
|
+
if (isAxiosError(_error) && _error.response) {
|
|
7096
|
+
return _error.response;
|
|
7097
|
+
}
|
|
7098
|
+
else {
|
|
7099
|
+
throw _error;
|
|
7100
|
+
}
|
|
7101
|
+
}).then((_response) => {
|
|
7102
|
+
return this.transformResult(url_, _response, (_response) => this.processFlattenItems(_response));
|
|
7103
|
+
});
|
|
7104
|
+
}
|
|
7105
|
+
processFlattenItems(response) {
|
|
7106
|
+
const status = response.status;
|
|
7107
|
+
let _headers = {};
|
|
7108
|
+
if (response.headers && typeof response.headers === "object") {
|
|
7109
|
+
for (let k in response.headers) {
|
|
7110
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
7111
|
+
_headers[k] = response.headers[k];
|
|
7112
|
+
}
|
|
7113
|
+
}
|
|
7114
|
+
}
|
|
7115
|
+
if (status === 200) {
|
|
7116
|
+
const _responseText = response.data;
|
|
7117
|
+
let result200 = null;
|
|
7118
|
+
let resultData200 = _responseText;
|
|
7119
|
+
result200 = JSON.parse(resultData200);
|
|
7120
|
+
return Promise.resolve(result200);
|
|
7121
|
+
}
|
|
7122
|
+
else if (status === 401) {
|
|
7123
|
+
const _responseText = response.data;
|
|
7124
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
7125
|
+
}
|
|
7126
|
+
else if (status === 403) {
|
|
7127
|
+
const _responseText = response.data;
|
|
7128
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
7129
|
+
}
|
|
7130
|
+
else if (status !== 200 && status !== 204) {
|
|
7131
|
+
const _responseText = response.data;
|
|
7132
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
7133
|
+
}
|
|
7134
|
+
return Promise.resolve(null);
|
|
7135
|
+
}
|
|
5090
7136
|
/**
|
|
5091
7137
|
* Creates a private design from a public design.
|
|
5092
7138
|
* @param designId (optional) Public design identifier.
|