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