@aurigma/axios-design-atoms-api-client 2.46.1 → 2.50.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 +182 -9
- package/dist/cjs/design-atoms-api-client.js +396 -3
- package/dist/cjs/design-atoms-api-client.js.map +1 -1
- package/dist/esm/design-atoms-api-client.d.ts +182 -9
- package/dist/esm/design-atoms-api-client.js +395 -2
- package/dist/esm/design-atoms-api-client.js.map +1 -1
- package/package.json +1 -1
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
//----------------------
|
|
9
9
|
// ReSharper disable InconsistentNaming
|
|
10
10
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
-
exports.ApiException = exports.ProductProofInterpolationMode = exports.ProductProofFormat = exports.ProductPreviewFormat = exports.ItemSourceType = exports.ItemType = exports.PlaceholderItemContentType = exports.ProductPatchType = exports.DesignElementType = exports.ImagePreviewFormat = exports.ColorSpace = exports.DesignAtomsViewerApiClient = exports.DesignAtomsServiceApiClient = exports.DesignAtomsMockups3dApiClient = exports.DesignAtomsImagesApiClient = exports.DesignAtomsCompatibilityApiClient = exports.BuildInfoApiClient = exports.ApiClientBase = exports.ApiClientConfiguration = void 0;
|
|
11
|
+
exports.ApiException = exports.ProductProofInterpolationMode = exports.ProductProofFormat = exports.ProductPreviewFormat = exports.ItemSourceType = exports.ItemType = exports.PlaceholderItemContentType = exports.ProductPatchType = exports.DesignElementType = exports.ImagePreviewFitMode = exports.ImagePreviewFormat = exports.ColorSpace = exports.DesignAtomsViewerApiClient = exports.DesignAtomsServiceApiClient = exports.DesignAtomsMockups3dApiClient = exports.DesignAtomsImagesApiClient = exports.DesignAtomsCompatibilityApiClient = exports.BuildInfoApiClient = exports.ApiClientBase = exports.ApiClientConfiguration = void 0;
|
|
12
12
|
const axios_1 = require("axios");
|
|
13
13
|
class ApiClientConfiguration {
|
|
14
14
|
apiUrl;
|
|
@@ -63,7 +63,7 @@ class BuildInfoApiClient extends ApiClientBase {
|
|
|
63
63
|
this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : this.getBaseUrl("");
|
|
64
64
|
}
|
|
65
65
|
/**
|
|
66
|
-
*
|
|
66
|
+
* Get assembly build info.
|
|
67
67
|
* @return Success
|
|
68
68
|
*/
|
|
69
69
|
headInfo(cancelToken) {
|
|
@@ -116,7 +116,7 @@ class BuildInfoApiClient extends ApiClientBase {
|
|
|
116
116
|
return Promise.resolve(null);
|
|
117
117
|
}
|
|
118
118
|
/**
|
|
119
|
-
*
|
|
119
|
+
* Get assembly build info.
|
|
120
120
|
* @return Success
|
|
121
121
|
*/
|
|
122
122
|
getInfo(cancelToken) {
|
|
@@ -2090,6 +2090,81 @@ class DesignAtomsImagesApiClient extends ApiClientBase {
|
|
|
2090
2090
|
}
|
|
2091
2091
|
return Promise.resolve(null);
|
|
2092
2092
|
}
|
|
2093
|
+
/**
|
|
2094
|
+
* Renders a web image preview with the specified parameters and saves rendering result as resource.
|
|
2095
|
+
* @param tenantId (optional) Tenant identifier
|
|
2096
|
+
* @param body (optional) Render model with preview parameters.
|
|
2097
|
+
* @return Success
|
|
2098
|
+
*/
|
|
2099
|
+
renderImagePreviewToResource(tenantId, body, cancelToken) {
|
|
2100
|
+
let url_ = this.baseUrl + "/api/atoms/v1/images/render-image-preview/to-resource?";
|
|
2101
|
+
if (tenantId === null)
|
|
2102
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
2103
|
+
else if (tenantId !== undefined)
|
|
2104
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2105
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
2106
|
+
const content_ = JSON.stringify(body);
|
|
2107
|
+
let options_ = {
|
|
2108
|
+
data: content_,
|
|
2109
|
+
method: "POST",
|
|
2110
|
+
url: url_,
|
|
2111
|
+
headers: {
|
|
2112
|
+
"Content-Type": "application/json",
|
|
2113
|
+
"Accept": "application/json"
|
|
2114
|
+
},
|
|
2115
|
+
cancelToken
|
|
2116
|
+
};
|
|
2117
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
2118
|
+
return this.instance.request(transformedOptions_);
|
|
2119
|
+
}).catch((_error) => {
|
|
2120
|
+
if (isAxiosError(_error) && _error.response) {
|
|
2121
|
+
return _error.response;
|
|
2122
|
+
}
|
|
2123
|
+
else {
|
|
2124
|
+
throw _error;
|
|
2125
|
+
}
|
|
2126
|
+
}).then((_response) => {
|
|
2127
|
+
return this.transformResult(url_, _response, (_response) => this.processRenderImagePreviewToResource(_response));
|
|
2128
|
+
});
|
|
2129
|
+
}
|
|
2130
|
+
processRenderImagePreviewToResource(response) {
|
|
2131
|
+
const status = response.status;
|
|
2132
|
+
let _headers = {};
|
|
2133
|
+
if (response.headers && typeof response.headers === "object") {
|
|
2134
|
+
for (let k in response.headers) {
|
|
2135
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
2136
|
+
_headers[k] = response.headers[k];
|
|
2137
|
+
}
|
|
2138
|
+
}
|
|
2139
|
+
}
|
|
2140
|
+
if (status === 200) {
|
|
2141
|
+
const _responseText = response.data;
|
|
2142
|
+
let result200 = null;
|
|
2143
|
+
let resultData200 = _responseText;
|
|
2144
|
+
result200 = JSON.parse(resultData200);
|
|
2145
|
+
return Promise.resolve(result200);
|
|
2146
|
+
}
|
|
2147
|
+
else if (status === 401) {
|
|
2148
|
+
const _responseText = response.data;
|
|
2149
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
2150
|
+
}
|
|
2151
|
+
else if (status === 403) {
|
|
2152
|
+
const _responseText = response.data;
|
|
2153
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
2154
|
+
}
|
|
2155
|
+
else if (status === 500) {
|
|
2156
|
+
const _responseText = response.data;
|
|
2157
|
+
let result500 = null;
|
|
2158
|
+
let resultData500 = _responseText;
|
|
2159
|
+
result500 = JSON.parse(resultData500);
|
|
2160
|
+
return throwException("Internal server error", status, _responseText, _headers, result500);
|
|
2161
|
+
}
|
|
2162
|
+
else if (status !== 200 && status !== 204) {
|
|
2163
|
+
const _responseText = response.data;
|
|
2164
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
2165
|
+
}
|
|
2166
|
+
return Promise.resolve(null);
|
|
2167
|
+
}
|
|
2093
2168
|
}
|
|
2094
2169
|
exports.DesignAtomsImagesApiClient = DesignAtomsImagesApiClient;
|
|
2095
2170
|
class DesignAtomsMockups3dApiClient extends ApiClientBase {
|
|
@@ -2929,6 +3004,91 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2929
3004
|
}
|
|
2930
3005
|
return Promise.resolve(null);
|
|
2931
3006
|
}
|
|
3007
|
+
/**
|
|
3008
|
+
* Returns design parameters stored in product model.
|
|
3009
|
+
* @param id Design identifier.
|
|
3010
|
+
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
3011
|
+
* @param tenantId (optional) Tenant identifier
|
|
3012
|
+
* @return Success
|
|
3013
|
+
*/
|
|
3014
|
+
getDesignParameters(id, privateStorageOwner, tenantId, cancelToken) {
|
|
3015
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/parameters?";
|
|
3016
|
+
if (id === undefined || id === null)
|
|
3017
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
3018
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
3019
|
+
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
3020
|
+
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
3021
|
+
if (tenantId === null)
|
|
3022
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
3023
|
+
else if (tenantId !== undefined)
|
|
3024
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
3025
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
3026
|
+
let options_ = {
|
|
3027
|
+
method: "GET",
|
|
3028
|
+
url: url_,
|
|
3029
|
+
headers: {
|
|
3030
|
+
"Accept": "application/json"
|
|
3031
|
+
},
|
|
3032
|
+
cancelToken
|
|
3033
|
+
};
|
|
3034
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
3035
|
+
return this.instance.request(transformedOptions_);
|
|
3036
|
+
}).catch((_error) => {
|
|
3037
|
+
if (isAxiosError(_error) && _error.response) {
|
|
3038
|
+
return _error.response;
|
|
3039
|
+
}
|
|
3040
|
+
else {
|
|
3041
|
+
throw _error;
|
|
3042
|
+
}
|
|
3043
|
+
}).then((_response) => {
|
|
3044
|
+
return this.transformResult(url_, _response, (_response) => this.processGetDesignParameters(_response));
|
|
3045
|
+
});
|
|
3046
|
+
}
|
|
3047
|
+
processGetDesignParameters(response) {
|
|
3048
|
+
const status = response.status;
|
|
3049
|
+
let _headers = {};
|
|
3050
|
+
if (response.headers && typeof response.headers === "object") {
|
|
3051
|
+
for (let k in response.headers) {
|
|
3052
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
3053
|
+
_headers[k] = response.headers[k];
|
|
3054
|
+
}
|
|
3055
|
+
}
|
|
3056
|
+
}
|
|
3057
|
+
if (status === 200) {
|
|
3058
|
+
const _responseText = response.data;
|
|
3059
|
+
let result200 = null;
|
|
3060
|
+
let resultData200 = _responseText;
|
|
3061
|
+
result200 = JSON.parse(resultData200);
|
|
3062
|
+
return Promise.resolve(result200);
|
|
3063
|
+
}
|
|
3064
|
+
else if (status === 404) {
|
|
3065
|
+
const _responseText = response.data;
|
|
3066
|
+
let result404 = null;
|
|
3067
|
+
let resultData404 = _responseText;
|
|
3068
|
+
result404 = JSON.parse(resultData404);
|
|
3069
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
3070
|
+
}
|
|
3071
|
+
else if (status === 401) {
|
|
3072
|
+
const _responseText = response.data;
|
|
3073
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
3074
|
+
}
|
|
3075
|
+
else if (status === 403) {
|
|
3076
|
+
const _responseText = response.data;
|
|
3077
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
3078
|
+
}
|
|
3079
|
+
else if (status === 500) {
|
|
3080
|
+
const _responseText = response.data;
|
|
3081
|
+
let result500 = null;
|
|
3082
|
+
let resultData500 = _responseText;
|
|
3083
|
+
result500 = JSON.parse(resultData500);
|
|
3084
|
+
return throwException("Internal server error", status, _responseText, _headers, result500);
|
|
3085
|
+
}
|
|
3086
|
+
else if (status !== 200 && status !== 204) {
|
|
3087
|
+
const _responseText = response.data;
|
|
3088
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
3089
|
+
}
|
|
3090
|
+
return Promise.resolve(null);
|
|
3091
|
+
}
|
|
2932
3092
|
/**
|
|
2933
3093
|
* Loads data schema from design file taken from storage
|
|
2934
3094
|
* @param id Design identifier
|
|
@@ -3643,6 +3803,81 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3643
3803
|
}
|
|
3644
3804
|
return Promise.resolve(null);
|
|
3645
3805
|
}
|
|
3806
|
+
/**
|
|
3807
|
+
* Extracts product item image.
|
|
3808
|
+
* @param tenantId (optional) Tenant identifier
|
|
3809
|
+
* @param body (optional) Extraction parameters.
|
|
3810
|
+
* @return Success
|
|
3811
|
+
*/
|
|
3812
|
+
extractItemImage(tenantId, body, cancelToken) {
|
|
3813
|
+
let url_ = this.baseUrl + "/api/atoms/v1/itemExtractor?";
|
|
3814
|
+
if (tenantId === null)
|
|
3815
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
3816
|
+
else if (tenantId !== undefined)
|
|
3817
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
3818
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
3819
|
+
const content_ = JSON.stringify(body);
|
|
3820
|
+
let options_ = {
|
|
3821
|
+
data: content_,
|
|
3822
|
+
responseType: "blob",
|
|
3823
|
+
method: "POST",
|
|
3824
|
+
url: url_,
|
|
3825
|
+
headers: {
|
|
3826
|
+
"Content-Type": "application/json",
|
|
3827
|
+
"Accept": "application/octet-stream"
|
|
3828
|
+
},
|
|
3829
|
+
cancelToken
|
|
3830
|
+
};
|
|
3831
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
3832
|
+
return this.instance.request(transformedOptions_);
|
|
3833
|
+
}).catch((_error) => {
|
|
3834
|
+
if (isAxiosError(_error) && _error.response) {
|
|
3835
|
+
return _error.response;
|
|
3836
|
+
}
|
|
3837
|
+
else {
|
|
3838
|
+
throw _error;
|
|
3839
|
+
}
|
|
3840
|
+
}).then((_response) => {
|
|
3841
|
+
return this.transformResult(url_, _response, (_response) => this.processExtractItemImage(_response));
|
|
3842
|
+
});
|
|
3843
|
+
}
|
|
3844
|
+
processExtractItemImage(response) {
|
|
3845
|
+
const status = response.status;
|
|
3846
|
+
let _headers = {};
|
|
3847
|
+
if (response.headers && typeof response.headers === "object") {
|
|
3848
|
+
for (let k in response.headers) {
|
|
3849
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
3850
|
+
_headers[k] = response.headers[k];
|
|
3851
|
+
}
|
|
3852
|
+
}
|
|
3853
|
+
}
|
|
3854
|
+
if (status === 200 || status === 206) {
|
|
3855
|
+
const contentDisposition = response.headers ? response.headers["content-disposition"] : undefined;
|
|
3856
|
+
const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
|
|
3857
|
+
const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
|
|
3858
|
+
return Promise.resolve({ fileName: fileName, status: status, data: new Blob([response.data]), headers: _headers });
|
|
3859
|
+
}
|
|
3860
|
+
else if (status === 401) {
|
|
3861
|
+
const _responseText = response.data;
|
|
3862
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
3863
|
+
}
|
|
3864
|
+
else if (status === 403) {
|
|
3865
|
+
const _responseText = response.data;
|
|
3866
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
3867
|
+
}
|
|
3868
|
+
else if (status === 500) {
|
|
3869
|
+
const _responseText = response.data;
|
|
3870
|
+
let result500 = null;
|
|
3871
|
+
let resultData500 = _responseText;
|
|
3872
|
+
result500 = JSON.parse(resultData500);
|
|
3873
|
+
return throwException("Internal server error", status, _responseText, _headers, result500);
|
|
3874
|
+
}
|
|
3875
|
+
else if (status !== 200 && status !== 204) {
|
|
3876
|
+
const _responseText = response.data;
|
|
3877
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
3878
|
+
}
|
|
3879
|
+
return Promise.resolve(null);
|
|
3880
|
+
}
|
|
3646
3881
|
/**
|
|
3647
3882
|
* Creates a private design from a public design.
|
|
3648
3883
|
* @param designId (optional) Public design ID.
|
|
@@ -3872,6 +4107,81 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3872
4107
|
}
|
|
3873
4108
|
return Promise.resolve(null);
|
|
3874
4109
|
}
|
|
4110
|
+
/**
|
|
4111
|
+
* Renders a design preview with the specified parameters and saves rendering result as resource.
|
|
4112
|
+
* @param tenantId (optional) Tenant identifier
|
|
4113
|
+
* @param body (optional) Render model with preview parameters.
|
|
4114
|
+
* @return Success
|
|
4115
|
+
*/
|
|
4116
|
+
renderDesignPreviewToResource(tenantId, body, cancelToken) {
|
|
4117
|
+
let url_ = this.baseUrl + "/api/atoms/v1/render-design-preview/to-resource?";
|
|
4118
|
+
if (tenantId === null)
|
|
4119
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
4120
|
+
else if (tenantId !== undefined)
|
|
4121
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
4122
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
4123
|
+
const content_ = JSON.stringify(body);
|
|
4124
|
+
let options_ = {
|
|
4125
|
+
data: content_,
|
|
4126
|
+
method: "POST",
|
|
4127
|
+
url: url_,
|
|
4128
|
+
headers: {
|
|
4129
|
+
"Content-Type": "application/json",
|
|
4130
|
+
"Accept": "application/json"
|
|
4131
|
+
},
|
|
4132
|
+
cancelToken
|
|
4133
|
+
};
|
|
4134
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
4135
|
+
return this.instance.request(transformedOptions_);
|
|
4136
|
+
}).catch((_error) => {
|
|
4137
|
+
if (isAxiosError(_error) && _error.response) {
|
|
4138
|
+
return _error.response;
|
|
4139
|
+
}
|
|
4140
|
+
else {
|
|
4141
|
+
throw _error;
|
|
4142
|
+
}
|
|
4143
|
+
}).then((_response) => {
|
|
4144
|
+
return this.transformResult(url_, _response, (_response) => this.processRenderDesignPreviewToResource(_response));
|
|
4145
|
+
});
|
|
4146
|
+
}
|
|
4147
|
+
processRenderDesignPreviewToResource(response) {
|
|
4148
|
+
const status = response.status;
|
|
4149
|
+
let _headers = {};
|
|
4150
|
+
if (response.headers && typeof response.headers === "object") {
|
|
4151
|
+
for (let k in response.headers) {
|
|
4152
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
4153
|
+
_headers[k] = response.headers[k];
|
|
4154
|
+
}
|
|
4155
|
+
}
|
|
4156
|
+
}
|
|
4157
|
+
if (status === 200) {
|
|
4158
|
+
const _responseText = response.data;
|
|
4159
|
+
let result200 = null;
|
|
4160
|
+
let resultData200 = _responseText;
|
|
4161
|
+
result200 = JSON.parse(resultData200);
|
|
4162
|
+
return Promise.resolve(result200);
|
|
4163
|
+
}
|
|
4164
|
+
else if (status === 401) {
|
|
4165
|
+
const _responseText = response.data;
|
|
4166
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
4167
|
+
}
|
|
4168
|
+
else if (status === 403) {
|
|
4169
|
+
const _responseText = response.data;
|
|
4170
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
4171
|
+
}
|
|
4172
|
+
else if (status === 500) {
|
|
4173
|
+
const _responseText = response.data;
|
|
4174
|
+
let result500 = null;
|
|
4175
|
+
let resultData500 = _responseText;
|
|
4176
|
+
result500 = JSON.parse(resultData500);
|
|
4177
|
+
return throwException("Internal server error", status, _responseText, _headers, result500);
|
|
4178
|
+
}
|
|
4179
|
+
else if (status !== 200 && status !== 204) {
|
|
4180
|
+
const _responseText = response.data;
|
|
4181
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
4182
|
+
}
|
|
4183
|
+
return Promise.resolve(null);
|
|
4184
|
+
}
|
|
3875
4185
|
/**
|
|
3876
4186
|
* Renders a design proof with the specified parameters.
|
|
3877
4187
|
* @param attachment (optional) If set to 'true', file will be provided as an attachment with unique filename supplied
|
|
@@ -3951,6 +4261,81 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3951
4261
|
}
|
|
3952
4262
|
return Promise.resolve(null);
|
|
3953
4263
|
}
|
|
4264
|
+
/**
|
|
4265
|
+
* Renders a design proof with the specified parameters and saves rendering result as resource.
|
|
4266
|
+
* @param tenantId (optional) Tenant identifier
|
|
4267
|
+
* @param body (optional) Render model with preview parameters.
|
|
4268
|
+
* @return Success
|
|
4269
|
+
*/
|
|
4270
|
+
renderDesignProofToResource(tenantId, body, cancelToken) {
|
|
4271
|
+
let url_ = this.baseUrl + "/api/atoms/v1/render-design-proof/to-resource?";
|
|
4272
|
+
if (tenantId === null)
|
|
4273
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
4274
|
+
else if (tenantId !== undefined)
|
|
4275
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
4276
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
4277
|
+
const content_ = JSON.stringify(body);
|
|
4278
|
+
let options_ = {
|
|
4279
|
+
data: content_,
|
|
4280
|
+
method: "POST",
|
|
4281
|
+
url: url_,
|
|
4282
|
+
headers: {
|
|
4283
|
+
"Content-Type": "application/json",
|
|
4284
|
+
"Accept": "application/json"
|
|
4285
|
+
},
|
|
4286
|
+
cancelToken
|
|
4287
|
+
};
|
|
4288
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
4289
|
+
return this.instance.request(transformedOptions_);
|
|
4290
|
+
}).catch((_error) => {
|
|
4291
|
+
if (isAxiosError(_error) && _error.response) {
|
|
4292
|
+
return _error.response;
|
|
4293
|
+
}
|
|
4294
|
+
else {
|
|
4295
|
+
throw _error;
|
|
4296
|
+
}
|
|
4297
|
+
}).then((_response) => {
|
|
4298
|
+
return this.transformResult(url_, _response, (_response) => this.processRenderDesignProofToResource(_response));
|
|
4299
|
+
});
|
|
4300
|
+
}
|
|
4301
|
+
processRenderDesignProofToResource(response) {
|
|
4302
|
+
const status = response.status;
|
|
4303
|
+
let _headers = {};
|
|
4304
|
+
if (response.headers && typeof response.headers === "object") {
|
|
4305
|
+
for (let k in response.headers) {
|
|
4306
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
4307
|
+
_headers[k] = response.headers[k];
|
|
4308
|
+
}
|
|
4309
|
+
}
|
|
4310
|
+
}
|
|
4311
|
+
if (status === 200) {
|
|
4312
|
+
const _responseText = response.data;
|
|
4313
|
+
let result200 = null;
|
|
4314
|
+
let resultData200 = _responseText;
|
|
4315
|
+
result200 = JSON.parse(resultData200);
|
|
4316
|
+
return Promise.resolve(result200);
|
|
4317
|
+
}
|
|
4318
|
+
else if (status === 401) {
|
|
4319
|
+
const _responseText = response.data;
|
|
4320
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
4321
|
+
}
|
|
4322
|
+
else if (status === 403) {
|
|
4323
|
+
const _responseText = response.data;
|
|
4324
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
4325
|
+
}
|
|
4326
|
+
else if (status === 500) {
|
|
4327
|
+
const _responseText = response.data;
|
|
4328
|
+
let result500 = null;
|
|
4329
|
+
let resultData500 = _responseText;
|
|
4330
|
+
result500 = JSON.parse(resultData500);
|
|
4331
|
+
return throwException("Internal server error", status, _responseText, _headers, result500);
|
|
4332
|
+
}
|
|
4333
|
+
else if (status !== 200 && status !== 204) {
|
|
4334
|
+
const _responseText = response.data;
|
|
4335
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
4336
|
+
}
|
|
4337
|
+
return Promise.resolve(null);
|
|
4338
|
+
}
|
|
3954
4339
|
/**
|
|
3955
4340
|
* Render product proof image with specified parameters.
|
|
3956
4341
|
* @param attachment (optional) If set to 'true', file will be provided as an attachment with unique filename supplied (default value is 'false').
|
|
@@ -6019,6 +6404,14 @@ var ImagePreviewFormat;
|
|
|
6019
6404
|
ImagePreviewFormat["Jpeg"] = "Jpeg";
|
|
6020
6405
|
ImagePreviewFormat["Png"] = "Png";
|
|
6021
6406
|
})(ImagePreviewFormat = exports.ImagePreviewFormat || (exports.ImagePreviewFormat = {}));
|
|
6407
|
+
/** Image preview fit mode. */
|
|
6408
|
+
var ImagePreviewFitMode;
|
|
6409
|
+
(function (ImagePreviewFitMode) {
|
|
6410
|
+
ImagePreviewFitMode["Fit"] = "Fit";
|
|
6411
|
+
ImagePreviewFitMode["Shrink"] = "Shrink";
|
|
6412
|
+
ImagePreviewFitMode["Resize"] = "Resize";
|
|
6413
|
+
ImagePreviewFitMode["Fill"] = "Fill";
|
|
6414
|
+
})(ImagePreviewFitMode = exports.ImagePreviewFitMode || (exports.ImagePreviewFitMode = {}));
|
|
6022
6415
|
var DesignElementType;
|
|
6023
6416
|
(function (DesignElementType) {
|
|
6024
6417
|
DesignElementType["Product"] = "Product";
|