@aurigma/axios-design-atoms-api-client 2.62.6 → 2.64.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 +367 -98
- package/dist/cjs/design-atoms-api-client.js +1345 -710
- package/dist/cjs/design-atoms-api-client.js.map +1 -1
- package/dist/esm/design-atoms-api-client.d.ts +367 -98
- package/dist/esm/design-atoms-api-client.js +1347 -712
- package/dist/esm/design-atoms-api-client.js.map +1 -1
- package/package.json +1 -1
|
@@ -445,9 +445,7 @@ class DesignAtomsCompatibilityApiClient extends ApiClientBase {
|
|
|
445
445
|
if (tenantId === undefined || tenantId === null)
|
|
446
446
|
throw new Error("The parameter 'tenantId' must be defined.");
|
|
447
447
|
url_ = url_.replace("{tenantId}", encodeURIComponent("" + tenantId));
|
|
448
|
-
if (fontKey
|
|
449
|
-
throw new Error("The parameter 'fontKey' cannot be null.");
|
|
450
|
-
else if (fontKey !== undefined)
|
|
448
|
+
if (fontKey !== undefined && fontKey !== null)
|
|
451
449
|
url_ += "fontKey=" + encodeURIComponent("" + fontKey) + "&";
|
|
452
450
|
url_ = url_.replace(/[?&]$/, "");
|
|
453
451
|
let options_ = {
|
|
@@ -791,77 +789,41 @@ class DesignAtomsCompatibilityApiClient extends ApiClientBase {
|
|
|
791
789
|
if (tenantId === undefined || tenantId === null)
|
|
792
790
|
throw new Error("The parameter 'tenantId' must be defined.");
|
|
793
791
|
url_ = url_.replace("{tenantId}", encodeURIComponent("" + tenantId));
|
|
794
|
-
if (f
|
|
795
|
-
throw new Error("The parameter 'f' cannot be null.");
|
|
796
|
-
else if (f !== undefined)
|
|
792
|
+
if (f !== undefined && f !== null)
|
|
797
793
|
url_ += "f=" + encodeURIComponent("" + f) + "&";
|
|
798
|
-
if (w
|
|
799
|
-
throw new Error("The parameter 'w' cannot be null.");
|
|
800
|
-
else if (w !== undefined)
|
|
794
|
+
if (w !== undefined && w !== null)
|
|
801
795
|
url_ += "w=" + encodeURIComponent("" + w) + "&";
|
|
802
|
-
if (h
|
|
803
|
-
throw new Error("The parameter 'h' cannot be null.");
|
|
804
|
-
else if (h !== undefined)
|
|
796
|
+
if (h !== undefined && h !== null)
|
|
805
797
|
url_ += "h=" + encodeURIComponent("" + h) + "&";
|
|
806
|
-
if (cmyk
|
|
807
|
-
throw new Error("The parameter 'cmyk' cannot be null.");
|
|
808
|
-
else if (cmyk !== undefined)
|
|
798
|
+
if (cmyk !== undefined && cmyk !== null)
|
|
809
799
|
url_ += "cmyk=" + encodeURIComponent("" + cmyk) + "&";
|
|
810
|
-
if (rgb
|
|
811
|
-
throw new Error("The parameter 'rgb' cannot be null.");
|
|
812
|
-
else if (rgb !== undefined)
|
|
800
|
+
if (rgb !== undefined && rgb !== null)
|
|
813
801
|
url_ += "rgb=" + encodeURIComponent("" + rgb) + "&";
|
|
814
|
-
if (grayscale
|
|
815
|
-
throw new Error("The parameter 'grayscale' cannot be null.");
|
|
816
|
-
else if (grayscale !== undefined)
|
|
802
|
+
if (grayscale !== undefined && grayscale !== null)
|
|
817
803
|
url_ += "grayscale=" + encodeURIComponent("" + grayscale) + "&";
|
|
818
|
-
if (target
|
|
819
|
-
throw new Error("The parameter 'target' cannot be null.");
|
|
820
|
-
else if (target !== undefined)
|
|
804
|
+
if (target !== undefined && target !== null)
|
|
821
805
|
url_ += "target=" + encodeURIComponent("" + target) + "&";
|
|
822
|
-
if (sq
|
|
823
|
-
throw new Error("The parameter 'sq' cannot be null.");
|
|
824
|
-
else if (sq !== undefined)
|
|
806
|
+
if (sq !== undefined && sq !== null)
|
|
825
807
|
url_ += "sq=" + encodeURIComponent("" + sq) + "&";
|
|
826
|
-
if (effect
|
|
827
|
-
throw new Error("The parameter 'effect' cannot be null.");
|
|
828
|
-
else if (effect !== undefined)
|
|
808
|
+
if (effect !== undefined && effect !== null)
|
|
829
809
|
url_ += "effect=" + encodeURIComponent("" + effect) + "&";
|
|
830
|
-
if (kp
|
|
831
|
-
throw new Error("The parameter 'kp' cannot be null.");
|
|
832
|
-
else if (kp !== undefined)
|
|
810
|
+
if (kp !== undefined && kp !== null)
|
|
833
811
|
url_ += "kp=" + encodeURIComponent("" + kp) + "&";
|
|
834
|
-
if (color
|
|
835
|
-
throw new Error("The parameter 'color' cannot be null.");
|
|
836
|
-
else if (color !== undefined)
|
|
812
|
+
if (color !== undefined && color !== null)
|
|
837
813
|
url_ += "color=" + encodeURIComponent("" + color) + "&";
|
|
838
|
-
if (obm
|
|
839
|
-
throw new Error("The parameter 'obm' cannot be null.");
|
|
840
|
-
else if (obm !== undefined)
|
|
814
|
+
if (obm !== undefined && obm !== null)
|
|
841
815
|
url_ += "obm=" + encodeURIComponent("" + obm) + "&";
|
|
842
|
-
if (oo
|
|
843
|
-
throw new Error("The parameter 'oo' cannot be null.");
|
|
844
|
-
else if (oo !== undefined)
|
|
816
|
+
if (oo !== undefined && oo !== null)
|
|
845
817
|
url_ += "oo=" + encodeURIComponent("" + oo) + "&";
|
|
846
|
-
if (alphaMask
|
|
847
|
-
throw new Error("The parameter 'alphaMask' cannot be null.");
|
|
848
|
-
else if (alphaMask !== undefined)
|
|
818
|
+
if (alphaMask !== undefined && alphaMask !== null)
|
|
849
819
|
url_ += "alphaMask=" + encodeURIComponent("" + alphaMask) + "&";
|
|
850
|
-
if (page
|
|
851
|
-
throw new Error("The parameter 'page' cannot be null.");
|
|
852
|
-
else if (page !== undefined)
|
|
820
|
+
if (page !== undefined && page !== null)
|
|
853
821
|
url_ += "page=" + encodeURIComponent("" + page) + "&";
|
|
854
|
-
if (colorizeColor
|
|
855
|
-
throw new Error("The parameter 'colorizeColor' cannot be null.");
|
|
856
|
-
else if (colorizeColor !== undefined)
|
|
822
|
+
if (colorizeColor !== undefined && colorizeColor !== null)
|
|
857
823
|
url_ += "colorizeColor=" + encodeURIComponent("" + colorizeColor) + "&";
|
|
858
|
-
if (rw
|
|
859
|
-
throw new Error("The parameter 'rw' cannot be null.");
|
|
860
|
-
else if (rw !== undefined)
|
|
824
|
+
if (rw !== undefined && rw !== null)
|
|
861
825
|
url_ += "rw=" + encodeURIComponent("" + rw) + "&";
|
|
862
|
-
if (rh
|
|
863
|
-
throw new Error("The parameter 'rh' cannot be null.");
|
|
864
|
-
else if (rh !== undefined)
|
|
826
|
+
if (rh !== undefined && rh !== null)
|
|
865
827
|
url_ += "rh=" + encodeURIComponent("" + rh) + "&";
|
|
866
828
|
url_ = url_.replace(/[?&]$/, "");
|
|
867
829
|
let options_ = {
|
|
@@ -997,9 +959,7 @@ class DesignAtomsCompatibilityApiClient extends ApiClientBase {
|
|
|
997
959
|
if (tenantId === undefined || tenantId === null)
|
|
998
960
|
throw new Error("The parameter 'tenantId' must be defined.");
|
|
999
961
|
url_ = url_.replace("{tenantId}", encodeURIComponent("" + tenantId));
|
|
1000
|
-
if (f
|
|
1001
|
-
throw new Error("The parameter 'f' cannot be null.");
|
|
1002
|
-
else if (f !== undefined)
|
|
962
|
+
if (f !== undefined && f !== null)
|
|
1003
963
|
url_ += "f=" + encodeURIComponent("" + f) + "&";
|
|
1004
964
|
url_ = url_.replace(/[?&]$/, "");
|
|
1005
965
|
let options_ = {
|
|
@@ -1074,9 +1034,7 @@ class DesignAtomsCompatibilityApiClient extends ApiClientBase {
|
|
|
1074
1034
|
if (tenantId === undefined || tenantId === null)
|
|
1075
1035
|
throw new Error("The parameter 'tenantId' must be defined.");
|
|
1076
1036
|
url_ = url_.replace("{tenantId}", encodeURIComponent("" + tenantId));
|
|
1077
|
-
if (image
|
|
1078
|
-
throw new Error("The parameter 'image' cannot be null.");
|
|
1079
|
-
else if (image !== undefined)
|
|
1037
|
+
if (image !== undefined && image !== null)
|
|
1080
1038
|
url_ += "image=" + encodeURIComponent("" + image) + "&";
|
|
1081
1039
|
url_ = url_.replace(/[?&]$/, "");
|
|
1082
1040
|
let options_ = {
|
|
@@ -1164,77 +1122,41 @@ class DesignAtomsCompatibilityApiClient extends ApiClientBase {
|
|
|
1164
1122
|
if (tenantId === undefined || tenantId === null)
|
|
1165
1123
|
throw new Error("The parameter 'tenantId' must be defined.");
|
|
1166
1124
|
url_ = url_.replace("{tenantId}", encodeURIComponent("" + tenantId));
|
|
1167
|
-
if (f
|
|
1168
|
-
throw new Error("The parameter 'f' cannot be null.");
|
|
1169
|
-
else if (f !== undefined)
|
|
1125
|
+
if (f !== undefined && f !== null)
|
|
1170
1126
|
url_ += "f=" + encodeURIComponent("" + f) + "&";
|
|
1171
|
-
if (w
|
|
1172
|
-
throw new Error("The parameter 'w' cannot be null.");
|
|
1173
|
-
else if (w !== undefined)
|
|
1127
|
+
if (w !== undefined && w !== null)
|
|
1174
1128
|
url_ += "w=" + encodeURIComponent("" + w) + "&";
|
|
1175
|
-
if (h
|
|
1176
|
-
throw new Error("The parameter 'h' cannot be null.");
|
|
1177
|
-
else if (h !== undefined)
|
|
1129
|
+
if (h !== undefined && h !== null)
|
|
1178
1130
|
url_ += "h=" + encodeURIComponent("" + h) + "&";
|
|
1179
|
-
if (cmyk
|
|
1180
|
-
throw new Error("The parameter 'cmyk' cannot be null.");
|
|
1181
|
-
else if (cmyk !== undefined)
|
|
1131
|
+
if (cmyk !== undefined && cmyk !== null)
|
|
1182
1132
|
url_ += "cmyk=" + encodeURIComponent("" + cmyk) + "&";
|
|
1183
|
-
if (rgb
|
|
1184
|
-
throw new Error("The parameter 'rgb' cannot be null.");
|
|
1185
|
-
else if (rgb !== undefined)
|
|
1133
|
+
if (rgb !== undefined && rgb !== null)
|
|
1186
1134
|
url_ += "rgb=" + encodeURIComponent("" + rgb) + "&";
|
|
1187
|
-
if (grayscale
|
|
1188
|
-
throw new Error("The parameter 'grayscale' cannot be null.");
|
|
1189
|
-
else if (grayscale !== undefined)
|
|
1135
|
+
if (grayscale !== undefined && grayscale !== null)
|
|
1190
1136
|
url_ += "grayscale=" + encodeURIComponent("" + grayscale) + "&";
|
|
1191
|
-
if (target
|
|
1192
|
-
throw new Error("The parameter 'target' cannot be null.");
|
|
1193
|
-
else if (target !== undefined)
|
|
1137
|
+
if (target !== undefined && target !== null)
|
|
1194
1138
|
url_ += "target=" + encodeURIComponent("" + target) + "&";
|
|
1195
|
-
if (sq
|
|
1196
|
-
throw new Error("The parameter 'sq' cannot be null.");
|
|
1197
|
-
else if (sq !== undefined)
|
|
1139
|
+
if (sq !== undefined && sq !== null)
|
|
1198
1140
|
url_ += "sq=" + encodeURIComponent("" + sq) + "&";
|
|
1199
|
-
if (effect
|
|
1200
|
-
throw new Error("The parameter 'effect' cannot be null.");
|
|
1201
|
-
else if (effect !== undefined)
|
|
1141
|
+
if (effect !== undefined && effect !== null)
|
|
1202
1142
|
url_ += "effect=" + encodeURIComponent("" + effect) + "&";
|
|
1203
|
-
if (kp
|
|
1204
|
-
throw new Error("The parameter 'kp' cannot be null.");
|
|
1205
|
-
else if (kp !== undefined)
|
|
1143
|
+
if (kp !== undefined && kp !== null)
|
|
1206
1144
|
url_ += "kp=" + encodeURIComponent("" + kp) + "&";
|
|
1207
|
-
if (color
|
|
1208
|
-
throw new Error("The parameter 'color' cannot be null.");
|
|
1209
|
-
else if (color !== undefined)
|
|
1145
|
+
if (color !== undefined && color !== null)
|
|
1210
1146
|
url_ += "color=" + encodeURIComponent("" + color) + "&";
|
|
1211
|
-
if (obm
|
|
1212
|
-
throw new Error("The parameter 'obm' cannot be null.");
|
|
1213
|
-
else if (obm !== undefined)
|
|
1147
|
+
if (obm !== undefined && obm !== null)
|
|
1214
1148
|
url_ += "obm=" + encodeURIComponent("" + obm) + "&";
|
|
1215
|
-
if (oo
|
|
1216
|
-
throw new Error("The parameter 'oo' cannot be null.");
|
|
1217
|
-
else if (oo !== undefined)
|
|
1149
|
+
if (oo !== undefined && oo !== null)
|
|
1218
1150
|
url_ += "oo=" + encodeURIComponent("" + oo) + "&";
|
|
1219
|
-
if (alphaMask
|
|
1220
|
-
throw new Error("The parameter 'alphaMask' cannot be null.");
|
|
1221
|
-
else if (alphaMask !== undefined)
|
|
1151
|
+
if (alphaMask !== undefined && alphaMask !== null)
|
|
1222
1152
|
url_ += "alphaMask=" + encodeURIComponent("" + alphaMask) + "&";
|
|
1223
|
-
if (page
|
|
1224
|
-
throw new Error("The parameter 'page' cannot be null.");
|
|
1225
|
-
else if (page !== undefined)
|
|
1153
|
+
if (page !== undefined && page !== null)
|
|
1226
1154
|
url_ += "page=" + encodeURIComponent("" + page) + "&";
|
|
1227
|
-
if (colorizeColor
|
|
1228
|
-
throw new Error("The parameter 'colorizeColor' cannot be null.");
|
|
1229
|
-
else if (colorizeColor !== undefined)
|
|
1155
|
+
if (colorizeColor !== undefined && colorizeColor !== null)
|
|
1230
1156
|
url_ += "colorizeColor=" + encodeURIComponent("" + colorizeColor) + "&";
|
|
1231
|
-
if (rw
|
|
1232
|
-
throw new Error("The parameter 'rw' cannot be null.");
|
|
1233
|
-
else if (rw !== undefined)
|
|
1157
|
+
if (rw !== undefined && rw !== null)
|
|
1234
1158
|
url_ += "rw=" + encodeURIComponent("" + rw) + "&";
|
|
1235
|
-
if (rh
|
|
1236
|
-
throw new Error("The parameter 'rh' cannot be null.");
|
|
1237
|
-
else if (rh !== undefined)
|
|
1159
|
+
if (rh !== undefined && rh !== null)
|
|
1238
1160
|
url_ += "rh=" + encodeURIComponent("" + rh) + "&";
|
|
1239
1161
|
url_ = url_.replace(/[?&]$/, "");
|
|
1240
1162
|
let options_ = {
|
|
@@ -1309,9 +1231,7 @@ class DesignAtomsCompatibilityApiClient extends ApiClientBase {
|
|
|
1309
1231
|
if (tenantId === undefined || tenantId === null)
|
|
1310
1232
|
throw new Error("The parameter 'tenantId' must be defined.");
|
|
1311
1233
|
url_ = url_.replace("{tenantId}", encodeURIComponent("" + tenantId));
|
|
1312
|
-
if (f
|
|
1313
|
-
throw new Error("The parameter 'f' cannot be null.");
|
|
1314
|
-
else if (f !== undefined)
|
|
1234
|
+
if (f !== undefined && f !== null)
|
|
1315
1235
|
url_ += "f=" + encodeURIComponent("" + f) + "&";
|
|
1316
1236
|
url_ = url_.replace(/[?&]$/, "");
|
|
1317
1237
|
let options_ = {
|
|
@@ -2104,7 +2024,7 @@ class DesignAtomsImagesApiClient extends ApiClientBase {
|
|
|
2104
2024
|
this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : this.getBaseUrl("");
|
|
2105
2025
|
}
|
|
2106
2026
|
/**
|
|
2107
|
-
* Renders a
|
|
2027
|
+
* Renders a preview of an image with the specified parameters.
|
|
2108
2028
|
* @param attachment (optional) If set to 'true', file will be provided as an attachment with unique filename supplied
|
|
2109
2029
|
(default value is 'false').
|
|
2110
2030
|
* @param tenantId (optional) Tenant identifier
|
|
@@ -2113,9 +2033,7 @@ class DesignAtomsImagesApiClient extends ApiClientBase {
|
|
|
2113
2033
|
*/
|
|
2114
2034
|
renderImagePreview(attachment, tenantId, body, cancelToken) {
|
|
2115
2035
|
let url_ = this.baseUrl + "/api/atoms/v1/images/render-preview?";
|
|
2116
|
-
if (attachment
|
|
2117
|
-
throw new Error("The parameter 'attachment' cannot be null.");
|
|
2118
|
-
else if (attachment !== undefined)
|
|
2036
|
+
if (attachment !== undefined && attachment !== null)
|
|
2119
2037
|
url_ += "attachment=" + encodeURIComponent("" + attachment) + "&";
|
|
2120
2038
|
if (tenantId === null)
|
|
2121
2039
|
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
@@ -2178,13 +2096,295 @@ class DesignAtomsImagesApiClient extends ApiClientBase {
|
|
|
2178
2096
|
return Promise.resolve(null);
|
|
2179
2097
|
}
|
|
2180
2098
|
/**
|
|
2181
|
-
* Renders a
|
|
2099
|
+
* Renders a preview of an uploaded image with the specified parameters.
|
|
2100
|
+
* @param attachment (optional) If set to 'true', file will be provided as an attachment with unique filename supplied
|
|
2101
|
+
(default value is 'false').
|
|
2102
|
+
* @param tenantId (optional) Tenant identifier
|
|
2103
|
+
* @param sourceFile (optional)
|
|
2104
|
+
* @param mockupOwnerId (optional)
|
|
2105
|
+
* @param mockupId (optional)
|
|
2106
|
+
* @param width (optional)
|
|
2107
|
+
* @param height (optional)
|
|
2108
|
+
* @param fileFormat (optional)
|
|
2109
|
+
* @param fitMode (optional)
|
|
2110
|
+
* @return Success
|
|
2111
|
+
*/
|
|
2112
|
+
renderImagePreviewFromFile(attachment, tenantId, sourceFile, mockupOwnerId, mockupId, width, height, fileFormat, fitMode, cancelToken) {
|
|
2113
|
+
let url_ = this.baseUrl + "/api/atoms/v1/images/render-preview/from-file?";
|
|
2114
|
+
if (attachment !== undefined && attachment !== null)
|
|
2115
|
+
url_ += "attachment=" + encodeURIComponent("" + attachment) + "&";
|
|
2116
|
+
if (tenantId === null)
|
|
2117
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
2118
|
+
else if (tenantId !== undefined)
|
|
2119
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2120
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
2121
|
+
const content_ = new FormData();
|
|
2122
|
+
if (sourceFile !== null && sourceFile !== undefined)
|
|
2123
|
+
content_.append("sourceFile", sourceFile.data, sourceFile.fileName ? sourceFile.fileName : "sourceFile");
|
|
2124
|
+
if (mockupOwnerId !== null && mockupOwnerId !== undefined)
|
|
2125
|
+
content_.append("mockupOwnerId", mockupOwnerId.toString());
|
|
2126
|
+
if (mockupId !== null && mockupId !== undefined)
|
|
2127
|
+
content_.append("mockupId", mockupId.toString());
|
|
2128
|
+
if (width !== null && width !== undefined)
|
|
2129
|
+
content_.append("width", width.toString());
|
|
2130
|
+
if (height !== null && height !== undefined)
|
|
2131
|
+
content_.append("height", height.toString());
|
|
2132
|
+
if (fileFormat !== null && fileFormat !== undefined)
|
|
2133
|
+
content_.append("fileFormat", fileFormat.toString());
|
|
2134
|
+
if (fitMode !== null && fitMode !== undefined)
|
|
2135
|
+
content_.append("fitMode", fitMode.toString());
|
|
2136
|
+
let options_ = {
|
|
2137
|
+
data: content_,
|
|
2138
|
+
responseType: "blob",
|
|
2139
|
+
method: "POST",
|
|
2140
|
+
url: url_,
|
|
2141
|
+
headers: {
|
|
2142
|
+
"Accept": "application/octet-stream"
|
|
2143
|
+
},
|
|
2144
|
+
cancelToken
|
|
2145
|
+
};
|
|
2146
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
2147
|
+
return this.instance.request(transformedOptions_);
|
|
2148
|
+
}).catch((_error) => {
|
|
2149
|
+
if (isAxiosError(_error) && _error.response) {
|
|
2150
|
+
return _error.response;
|
|
2151
|
+
}
|
|
2152
|
+
else {
|
|
2153
|
+
throw _error;
|
|
2154
|
+
}
|
|
2155
|
+
}).then((_response) => {
|
|
2156
|
+
return this.transformResult(url_, _response, (_response) => this.processRenderImagePreviewFromFile(_response));
|
|
2157
|
+
});
|
|
2158
|
+
}
|
|
2159
|
+
processRenderImagePreviewFromFile(response) {
|
|
2160
|
+
const status = response.status;
|
|
2161
|
+
let _headers = {};
|
|
2162
|
+
if (response.headers && typeof response.headers === "object") {
|
|
2163
|
+
for (let k in response.headers) {
|
|
2164
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
2165
|
+
_headers[k] = response.headers[k];
|
|
2166
|
+
}
|
|
2167
|
+
}
|
|
2168
|
+
}
|
|
2169
|
+
if (status === 200 || status === 206) {
|
|
2170
|
+
const contentDisposition = response.headers ? response.headers["content-disposition"] : undefined;
|
|
2171
|
+
const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
|
|
2172
|
+
const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
|
|
2173
|
+
return Promise.resolve({ fileName: fileName, status: status, data: new Blob([response.data]), headers: _headers });
|
|
2174
|
+
}
|
|
2175
|
+
else if (status === 401) {
|
|
2176
|
+
const _responseText = response.data;
|
|
2177
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
2178
|
+
}
|
|
2179
|
+
else if (status === 403) {
|
|
2180
|
+
const _responseText = response.data;
|
|
2181
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
2182
|
+
}
|
|
2183
|
+
else if (status !== 200 && status !== 204) {
|
|
2184
|
+
const _responseText = response.data;
|
|
2185
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
2186
|
+
}
|
|
2187
|
+
return Promise.resolve(null);
|
|
2188
|
+
}
|
|
2189
|
+
/**
|
|
2190
|
+
* Renders a preview of an uploaded image with the specified parameters and saves rendering result as resource.
|
|
2191
|
+
* @param tenantId (optional) Tenant identifier
|
|
2192
|
+
* @param resourceOwnerId (optional)
|
|
2193
|
+
* @param resourceNamespace (optional)
|
|
2194
|
+
* @param resourceName (optional)
|
|
2195
|
+
* @param resourceSourceId (optional)
|
|
2196
|
+
* @param resourceType (optional)
|
|
2197
|
+
* @param anonymousAccess (optional)
|
|
2198
|
+
* @param overwriteExistingResource (optional)
|
|
2199
|
+
* @param sourceFile (optional)
|
|
2200
|
+
* @param mockupOwnerId (optional)
|
|
2201
|
+
* @param mockupId (optional)
|
|
2202
|
+
* @param width (optional)
|
|
2203
|
+
* @param height (optional)
|
|
2204
|
+
* @param fileFormat (optional)
|
|
2205
|
+
* @param fitMode (optional)
|
|
2206
|
+
* @return Success
|
|
2207
|
+
*/
|
|
2208
|
+
renderImagePreviewFromFileToResource(tenantId, resourceOwnerId, resourceNamespace, resourceName, resourceSourceId, resourceType, anonymousAccess, overwriteExistingResource, sourceFile, mockupOwnerId, mockupId, width, height, fileFormat, fitMode, cancelToken) {
|
|
2209
|
+
let url_ = this.baseUrl + "/api/atoms/v1/images/render-preview/from-file/to-resource?";
|
|
2210
|
+
if (tenantId === null)
|
|
2211
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
2212
|
+
else if (tenantId !== undefined)
|
|
2213
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2214
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
2215
|
+
const content_ = new FormData();
|
|
2216
|
+
if (resourceOwnerId !== null && resourceOwnerId !== undefined)
|
|
2217
|
+
content_.append("resourceOwnerId", resourceOwnerId.toString());
|
|
2218
|
+
if (resourceNamespace !== null && resourceNamespace !== undefined)
|
|
2219
|
+
content_.append("resourceNamespace", resourceNamespace.toString());
|
|
2220
|
+
if (resourceName !== null && resourceName !== undefined)
|
|
2221
|
+
content_.append("resourceName", resourceName.toString());
|
|
2222
|
+
if (resourceSourceId !== null && resourceSourceId !== undefined)
|
|
2223
|
+
content_.append("resourceSourceId", resourceSourceId.toString());
|
|
2224
|
+
if (resourceType !== null && resourceType !== undefined)
|
|
2225
|
+
content_.append("resourceType", resourceType.toString());
|
|
2226
|
+
if (anonymousAccess === null || anonymousAccess === undefined)
|
|
2227
|
+
throw new Error("The parameter 'anonymousAccess' cannot be null.");
|
|
2228
|
+
else
|
|
2229
|
+
content_.append("anonymousAccess", anonymousAccess.toString());
|
|
2230
|
+
if (overwriteExistingResource === null || overwriteExistingResource === undefined)
|
|
2231
|
+
throw new Error("The parameter 'overwriteExistingResource' cannot be null.");
|
|
2232
|
+
else
|
|
2233
|
+
content_.append("overwriteExistingResource", overwriteExistingResource.toString());
|
|
2234
|
+
if (sourceFile !== null && sourceFile !== undefined)
|
|
2235
|
+
content_.append("sourceFile", sourceFile.data, sourceFile.fileName ? sourceFile.fileName : "sourceFile");
|
|
2236
|
+
if (mockupOwnerId !== null && mockupOwnerId !== undefined)
|
|
2237
|
+
content_.append("mockupOwnerId", mockupOwnerId.toString());
|
|
2238
|
+
if (mockupId !== null && mockupId !== undefined)
|
|
2239
|
+
content_.append("mockupId", mockupId.toString());
|
|
2240
|
+
if (width !== null && width !== undefined)
|
|
2241
|
+
content_.append("width", width.toString());
|
|
2242
|
+
if (height !== null && height !== undefined)
|
|
2243
|
+
content_.append("height", height.toString());
|
|
2244
|
+
if (fileFormat !== null && fileFormat !== undefined)
|
|
2245
|
+
content_.append("fileFormat", fileFormat.toString());
|
|
2246
|
+
if (fitMode !== null && fitMode !== undefined)
|
|
2247
|
+
content_.append("fitMode", fitMode.toString());
|
|
2248
|
+
let options_ = {
|
|
2249
|
+
data: content_,
|
|
2250
|
+
method: "POST",
|
|
2251
|
+
url: url_,
|
|
2252
|
+
headers: {
|
|
2253
|
+
"Accept": "application/json"
|
|
2254
|
+
},
|
|
2255
|
+
cancelToken
|
|
2256
|
+
};
|
|
2257
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
2258
|
+
return this.instance.request(transformedOptions_);
|
|
2259
|
+
}).catch((_error) => {
|
|
2260
|
+
if (isAxiosError(_error) && _error.response) {
|
|
2261
|
+
return _error.response;
|
|
2262
|
+
}
|
|
2263
|
+
else {
|
|
2264
|
+
throw _error;
|
|
2265
|
+
}
|
|
2266
|
+
}).then((_response) => {
|
|
2267
|
+
return this.transformResult(url_, _response, (_response) => this.processRenderImagePreviewFromFileToResource(_response));
|
|
2268
|
+
});
|
|
2269
|
+
}
|
|
2270
|
+
processRenderImagePreviewFromFileToResource(response) {
|
|
2271
|
+
const status = response.status;
|
|
2272
|
+
let _headers = {};
|
|
2273
|
+
if (response.headers && typeof response.headers === "object") {
|
|
2274
|
+
for (let k in response.headers) {
|
|
2275
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
2276
|
+
_headers[k] = response.headers[k];
|
|
2277
|
+
}
|
|
2278
|
+
}
|
|
2279
|
+
}
|
|
2280
|
+
if (status === 200) {
|
|
2281
|
+
const _responseText = response.data;
|
|
2282
|
+
let result200 = null;
|
|
2283
|
+
let resultData200 = _responseText;
|
|
2284
|
+
result200 = JSON.parse(resultData200);
|
|
2285
|
+
return Promise.resolve(result200);
|
|
2286
|
+
}
|
|
2287
|
+
else if (status === 409) {
|
|
2288
|
+
const _responseText = response.data;
|
|
2289
|
+
let result409 = null;
|
|
2290
|
+
let resultData409 = _responseText;
|
|
2291
|
+
result409 = JSON.parse(resultData409);
|
|
2292
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
2293
|
+
}
|
|
2294
|
+
else if (status === 401) {
|
|
2295
|
+
const _responseText = response.data;
|
|
2296
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
2297
|
+
}
|
|
2298
|
+
else if (status === 403) {
|
|
2299
|
+
const _responseText = response.data;
|
|
2300
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
2301
|
+
}
|
|
2302
|
+
else if (status !== 200 && status !== 204) {
|
|
2303
|
+
const _responseText = response.data;
|
|
2304
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
2305
|
+
}
|
|
2306
|
+
return Promise.resolve(null);
|
|
2307
|
+
}
|
|
2308
|
+
/**
|
|
2309
|
+
* Renders a preview of a web image with the specified parameters.
|
|
2310
|
+
* @param attachment (optional) If set to 'true', file will be provided as an attachment with unique filename supplied
|
|
2311
|
+
(default value is 'false').
|
|
2182
2312
|
* @param tenantId (optional) Tenant identifier
|
|
2183
2313
|
* @param body (optional) Render model with preview parameters.
|
|
2184
2314
|
* @return Success
|
|
2185
2315
|
*/
|
|
2186
|
-
|
|
2187
|
-
let url_ = this.baseUrl + "/api/atoms/v1/images/render-preview/
|
|
2316
|
+
renderImagePreviewFromUrl(attachment, tenantId, body, cancelToken) {
|
|
2317
|
+
let url_ = this.baseUrl + "/api/atoms/v1/images/render-preview/from-url?";
|
|
2318
|
+
if (attachment !== undefined && attachment !== null)
|
|
2319
|
+
url_ += "attachment=" + encodeURIComponent("" + attachment) + "&";
|
|
2320
|
+
if (tenantId === null)
|
|
2321
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
2322
|
+
else if (tenantId !== undefined)
|
|
2323
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2324
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
2325
|
+
const content_ = JSON.stringify(body);
|
|
2326
|
+
let options_ = {
|
|
2327
|
+
data: content_,
|
|
2328
|
+
responseType: "blob",
|
|
2329
|
+
method: "POST",
|
|
2330
|
+
url: url_,
|
|
2331
|
+
headers: {
|
|
2332
|
+
"Content-Type": "application/json",
|
|
2333
|
+
"Accept": "application/octet-stream"
|
|
2334
|
+
},
|
|
2335
|
+
cancelToken
|
|
2336
|
+
};
|
|
2337
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
2338
|
+
return this.instance.request(transformedOptions_);
|
|
2339
|
+
}).catch((_error) => {
|
|
2340
|
+
if (isAxiosError(_error) && _error.response) {
|
|
2341
|
+
return _error.response;
|
|
2342
|
+
}
|
|
2343
|
+
else {
|
|
2344
|
+
throw _error;
|
|
2345
|
+
}
|
|
2346
|
+
}).then((_response) => {
|
|
2347
|
+
return this.transformResult(url_, _response, (_response) => this.processRenderImagePreviewFromUrl(_response));
|
|
2348
|
+
});
|
|
2349
|
+
}
|
|
2350
|
+
processRenderImagePreviewFromUrl(response) {
|
|
2351
|
+
const status = response.status;
|
|
2352
|
+
let _headers = {};
|
|
2353
|
+
if (response.headers && typeof response.headers === "object") {
|
|
2354
|
+
for (let k in response.headers) {
|
|
2355
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
2356
|
+
_headers[k] = response.headers[k];
|
|
2357
|
+
}
|
|
2358
|
+
}
|
|
2359
|
+
}
|
|
2360
|
+
if (status === 200 || status === 206) {
|
|
2361
|
+
const contentDisposition = response.headers ? response.headers["content-disposition"] : undefined;
|
|
2362
|
+
const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
|
|
2363
|
+
const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
|
|
2364
|
+
return Promise.resolve({ fileName: fileName, status: status, data: new Blob([response.data]), headers: _headers });
|
|
2365
|
+
}
|
|
2366
|
+
else if (status === 401) {
|
|
2367
|
+
const _responseText = response.data;
|
|
2368
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
2369
|
+
}
|
|
2370
|
+
else if (status === 403) {
|
|
2371
|
+
const _responseText = response.data;
|
|
2372
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
2373
|
+
}
|
|
2374
|
+
else if (status !== 200 && status !== 204) {
|
|
2375
|
+
const _responseText = response.data;
|
|
2376
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
2377
|
+
}
|
|
2378
|
+
return Promise.resolve(null);
|
|
2379
|
+
}
|
|
2380
|
+
/**
|
|
2381
|
+
* Renders a preview of a web image with the specified parameters and saves rendering result as resource.
|
|
2382
|
+
* @param tenantId (optional) Tenant identifier
|
|
2383
|
+
* @param body (optional) Render model with preview parameters.
|
|
2384
|
+
* @return Success
|
|
2385
|
+
*/
|
|
2386
|
+
renderImagePreviewFromUrlToResource(tenantId, body, cancelToken) {
|
|
2387
|
+
let url_ = this.baseUrl + "/api/atoms/v1/images/render-preview/from-url/to-resource?";
|
|
2188
2388
|
if (tenantId === null)
|
|
2189
2389
|
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
2190
2390
|
else if (tenantId !== undefined)
|
|
@@ -2211,10 +2411,10 @@ class DesignAtomsImagesApiClient extends ApiClientBase {
|
|
|
2211
2411
|
throw _error;
|
|
2212
2412
|
}
|
|
2213
2413
|
}).then((_response) => {
|
|
2214
|
-
return this.transformResult(url_, _response, (_response) => this.
|
|
2414
|
+
return this.transformResult(url_, _response, (_response) => this.processRenderImagePreviewFromUrlToResource(_response));
|
|
2215
2415
|
});
|
|
2216
2416
|
}
|
|
2217
|
-
|
|
2417
|
+
processRenderImagePreviewFromUrlToResource(response) {
|
|
2218
2418
|
const status = response.status;
|
|
2219
2419
|
let _headers = {};
|
|
2220
2420
|
if (response.headers && typeof response.headers === "object") {
|
|
@@ -2231,6 +2431,524 @@ class DesignAtomsImagesApiClient extends ApiClientBase {
|
|
|
2231
2431
|
result200 = JSON.parse(resultData200);
|
|
2232
2432
|
return Promise.resolve(result200);
|
|
2233
2433
|
}
|
|
2434
|
+
else if (status === 409) {
|
|
2435
|
+
const _responseText = response.data;
|
|
2436
|
+
let result409 = null;
|
|
2437
|
+
let resultData409 = _responseText;
|
|
2438
|
+
result409 = JSON.parse(resultData409);
|
|
2439
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
2440
|
+
}
|
|
2441
|
+
else if (status === 401) {
|
|
2442
|
+
const _responseText = response.data;
|
|
2443
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
2444
|
+
}
|
|
2445
|
+
else if (status === 403) {
|
|
2446
|
+
const _responseText = response.data;
|
|
2447
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
2448
|
+
}
|
|
2449
|
+
else if (status !== 200 && status !== 204) {
|
|
2450
|
+
const _responseText = response.data;
|
|
2451
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
2452
|
+
}
|
|
2453
|
+
return Promise.resolve(null);
|
|
2454
|
+
}
|
|
2455
|
+
/**
|
|
2456
|
+
* Renders a preview of an image with the specified parameters and saves rendering result as resource.
|
|
2457
|
+
* @param tenantId (optional) Tenant identifier
|
|
2458
|
+
* @param body (optional) Render model with preview parameters.
|
|
2459
|
+
* @return Success
|
|
2460
|
+
*/
|
|
2461
|
+
renderImagePreviewToResource(tenantId, body, cancelToken) {
|
|
2462
|
+
let url_ = this.baseUrl + "/api/atoms/v1/images/render-preview/to-resource?";
|
|
2463
|
+
if (tenantId === null)
|
|
2464
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
2465
|
+
else if (tenantId !== undefined)
|
|
2466
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2467
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
2468
|
+
const content_ = JSON.stringify(body);
|
|
2469
|
+
let options_ = {
|
|
2470
|
+
data: content_,
|
|
2471
|
+
method: "POST",
|
|
2472
|
+
url: url_,
|
|
2473
|
+
headers: {
|
|
2474
|
+
"Content-Type": "application/json",
|
|
2475
|
+
"Accept": "application/json"
|
|
2476
|
+
},
|
|
2477
|
+
cancelToken
|
|
2478
|
+
};
|
|
2479
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
2480
|
+
return this.instance.request(transformedOptions_);
|
|
2481
|
+
}).catch((_error) => {
|
|
2482
|
+
if (isAxiosError(_error) && _error.response) {
|
|
2483
|
+
return _error.response;
|
|
2484
|
+
}
|
|
2485
|
+
else {
|
|
2486
|
+
throw _error;
|
|
2487
|
+
}
|
|
2488
|
+
}).then((_response) => {
|
|
2489
|
+
return this.transformResult(url_, _response, (_response) => this.processRenderImagePreviewToResource(_response));
|
|
2490
|
+
});
|
|
2491
|
+
}
|
|
2492
|
+
processRenderImagePreviewToResource(response) {
|
|
2493
|
+
const status = response.status;
|
|
2494
|
+
let _headers = {};
|
|
2495
|
+
if (response.headers && typeof response.headers === "object") {
|
|
2496
|
+
for (let k in response.headers) {
|
|
2497
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
2498
|
+
_headers[k] = response.headers[k];
|
|
2499
|
+
}
|
|
2500
|
+
}
|
|
2501
|
+
}
|
|
2502
|
+
if (status === 200) {
|
|
2503
|
+
const _responseText = response.data;
|
|
2504
|
+
let result200 = null;
|
|
2505
|
+
let resultData200 = _responseText;
|
|
2506
|
+
result200 = JSON.parse(resultData200);
|
|
2507
|
+
return Promise.resolve(result200);
|
|
2508
|
+
}
|
|
2509
|
+
else if (status === 409) {
|
|
2510
|
+
const _responseText = response.data;
|
|
2511
|
+
let result409 = null;
|
|
2512
|
+
let resultData409 = _responseText;
|
|
2513
|
+
result409 = JSON.parse(resultData409);
|
|
2514
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
2515
|
+
}
|
|
2516
|
+
else if (status === 401) {
|
|
2517
|
+
const _responseText = response.data;
|
|
2518
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
2519
|
+
}
|
|
2520
|
+
else if (status === 403) {
|
|
2521
|
+
const _responseText = response.data;
|
|
2522
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
2523
|
+
}
|
|
2524
|
+
else if (status !== 200 && status !== 204) {
|
|
2525
|
+
const _responseText = response.data;
|
|
2526
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
2527
|
+
}
|
|
2528
|
+
return Promise.resolve(null);
|
|
2529
|
+
}
|
|
2530
|
+
}
|
|
2531
|
+
exports.DesignAtomsImagesApiClient = DesignAtomsImagesApiClient;
|
|
2532
|
+
class DesignAtomsMockups3dApiClient extends ApiClientBase {
|
|
2533
|
+
instance;
|
|
2534
|
+
baseUrl;
|
|
2535
|
+
jsonParseReviver = undefined;
|
|
2536
|
+
constructor(configuration, baseUrl, instance) {
|
|
2537
|
+
super(configuration);
|
|
2538
|
+
this.instance = instance ? instance : axios_1.create();
|
|
2539
|
+
this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : this.getBaseUrl("");
|
|
2540
|
+
}
|
|
2541
|
+
/**
|
|
2542
|
+
* Returns a 3D-Mockup attributes.
|
|
2543
|
+
* @param id 3D-Mockup identifier.
|
|
2544
|
+
* @param ownerId (optional) Private mockup owner identifier.
|
|
2545
|
+
* @param tenantId (optional) Tenant identifier
|
|
2546
|
+
* @return Success
|
|
2547
|
+
*/
|
|
2548
|
+
getAttributes(id, ownerId, tenantId, cancelToken) {
|
|
2549
|
+
let url_ = this.baseUrl + "/api/atoms/v1/mockups-3d/{id}/attributes?";
|
|
2550
|
+
if (id === undefined || id === null)
|
|
2551
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
2552
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
2553
|
+
if (ownerId !== undefined && ownerId !== null)
|
|
2554
|
+
url_ += "ownerId=" + encodeURIComponent("" + ownerId) + "&";
|
|
2555
|
+
if (tenantId === null)
|
|
2556
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
2557
|
+
else if (tenantId !== undefined)
|
|
2558
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2559
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
2560
|
+
let options_ = {
|
|
2561
|
+
method: "GET",
|
|
2562
|
+
url: url_,
|
|
2563
|
+
headers: {
|
|
2564
|
+
"Accept": "application/json"
|
|
2565
|
+
},
|
|
2566
|
+
cancelToken
|
|
2567
|
+
};
|
|
2568
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
2569
|
+
return this.instance.request(transformedOptions_);
|
|
2570
|
+
}).catch((_error) => {
|
|
2571
|
+
if (isAxiosError(_error) && _error.response) {
|
|
2572
|
+
return _error.response;
|
|
2573
|
+
}
|
|
2574
|
+
else {
|
|
2575
|
+
throw _error;
|
|
2576
|
+
}
|
|
2577
|
+
}).then((_response) => {
|
|
2578
|
+
return this.transformResult(url_, _response, (_response) => this.processGetAttributes(_response));
|
|
2579
|
+
});
|
|
2580
|
+
}
|
|
2581
|
+
processGetAttributes(response) {
|
|
2582
|
+
const status = response.status;
|
|
2583
|
+
let _headers = {};
|
|
2584
|
+
if (response.headers && typeof response.headers === "object") {
|
|
2585
|
+
for (let k in response.headers) {
|
|
2586
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
2587
|
+
_headers[k] = response.headers[k];
|
|
2588
|
+
}
|
|
2589
|
+
}
|
|
2590
|
+
}
|
|
2591
|
+
if (status === 200) {
|
|
2592
|
+
const _responseText = response.data;
|
|
2593
|
+
let result200 = null;
|
|
2594
|
+
let resultData200 = _responseText;
|
|
2595
|
+
result200 = JSON.parse(resultData200);
|
|
2596
|
+
return Promise.resolve(result200);
|
|
2597
|
+
}
|
|
2598
|
+
else if (status === 404) {
|
|
2599
|
+
const _responseText = response.data;
|
|
2600
|
+
let result404 = null;
|
|
2601
|
+
let resultData404 = _responseText;
|
|
2602
|
+
result404 = JSON.parse(resultData404);
|
|
2603
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
2604
|
+
}
|
|
2605
|
+
else if (status === 422) {
|
|
2606
|
+
const _responseText = response.data;
|
|
2607
|
+
let result422 = null;
|
|
2608
|
+
let resultData422 = _responseText;
|
|
2609
|
+
result422 = JSON.parse(resultData422);
|
|
2610
|
+
return throwException("Client Error", status, _responseText, _headers, result422);
|
|
2611
|
+
}
|
|
2612
|
+
else if (status === 401) {
|
|
2613
|
+
const _responseText = response.data;
|
|
2614
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
2615
|
+
}
|
|
2616
|
+
else if (status === 403) {
|
|
2617
|
+
const _responseText = response.data;
|
|
2618
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
2619
|
+
}
|
|
2620
|
+
else if (status !== 200 && status !== 204) {
|
|
2621
|
+
const _responseText = response.data;
|
|
2622
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
2623
|
+
}
|
|
2624
|
+
return Promise.resolve(null);
|
|
2625
|
+
}
|
|
2626
|
+
/**
|
|
2627
|
+
* Returns a 3D-Mockup content as protobuf binary stream.
|
|
2628
|
+
* @param id 3D-Mockup identifier.
|
|
2629
|
+
* @param ownerId (optional) Private mockup owner identifier.
|
|
2630
|
+
* @param tenantId (optional) Tenant identifier
|
|
2631
|
+
* @return Success
|
|
2632
|
+
*/
|
|
2633
|
+
getContentAsProtobuf(id, ownerId, tenantId, cancelToken) {
|
|
2634
|
+
let url_ = this.baseUrl + "/api/atoms/v1/mockups-3d/{id}/content/as-protobuf?";
|
|
2635
|
+
if (id === undefined || id === null)
|
|
2636
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
2637
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
2638
|
+
if (ownerId !== undefined && ownerId !== null)
|
|
2639
|
+
url_ += "ownerId=" + encodeURIComponent("" + ownerId) + "&";
|
|
2640
|
+
if (tenantId === null)
|
|
2641
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
2642
|
+
else if (tenantId !== undefined)
|
|
2643
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2644
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
2645
|
+
let options_ = {
|
|
2646
|
+
responseType: "blob",
|
|
2647
|
+
method: "GET",
|
|
2648
|
+
url: url_,
|
|
2649
|
+
headers: {
|
|
2650
|
+
"Accept": "application/json"
|
|
2651
|
+
},
|
|
2652
|
+
cancelToken
|
|
2653
|
+
};
|
|
2654
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
2655
|
+
return this.instance.request(transformedOptions_);
|
|
2656
|
+
}).catch((_error) => {
|
|
2657
|
+
if (isAxiosError(_error) && _error.response) {
|
|
2658
|
+
return _error.response;
|
|
2659
|
+
}
|
|
2660
|
+
else {
|
|
2661
|
+
throw _error;
|
|
2662
|
+
}
|
|
2663
|
+
}).then((_response) => {
|
|
2664
|
+
return this.transformResult(url_, _response, (_response) => this.processGetContentAsProtobuf(_response));
|
|
2665
|
+
});
|
|
2666
|
+
}
|
|
2667
|
+
processGetContentAsProtobuf(response) {
|
|
2668
|
+
const status = response.status;
|
|
2669
|
+
let _headers = {};
|
|
2670
|
+
if (response.headers && typeof response.headers === "object") {
|
|
2671
|
+
for (let k in response.headers) {
|
|
2672
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
2673
|
+
_headers[k] = response.headers[k];
|
|
2674
|
+
}
|
|
2675
|
+
}
|
|
2676
|
+
}
|
|
2677
|
+
if (status === 200 || status === 206) {
|
|
2678
|
+
const contentDisposition = response.headers ? response.headers["content-disposition"] : undefined;
|
|
2679
|
+
const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
|
|
2680
|
+
const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
|
|
2681
|
+
return Promise.resolve({ fileName: fileName, status: status, data: new Blob([response.data]), headers: _headers });
|
|
2682
|
+
}
|
|
2683
|
+
else if (status === 404) {
|
|
2684
|
+
const _responseText = response.data;
|
|
2685
|
+
let result404 = null;
|
|
2686
|
+
let resultData404 = _responseText;
|
|
2687
|
+
result404 = JSON.parse(resultData404);
|
|
2688
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
2689
|
+
}
|
|
2690
|
+
else if (status === 422) {
|
|
2691
|
+
const _responseText = response.data;
|
|
2692
|
+
let result422 = null;
|
|
2693
|
+
let resultData422 = _responseText;
|
|
2694
|
+
result422 = JSON.parse(resultData422);
|
|
2695
|
+
return throwException("Client Error", status, _responseText, _headers, result422);
|
|
2696
|
+
}
|
|
2697
|
+
else if (status === 401) {
|
|
2698
|
+
const _responseText = response.data;
|
|
2699
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
2700
|
+
}
|
|
2701
|
+
else if (status === 403) {
|
|
2702
|
+
const _responseText = response.data;
|
|
2703
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
2704
|
+
}
|
|
2705
|
+
else if (status !== 200 && status !== 204) {
|
|
2706
|
+
const _responseText = response.data;
|
|
2707
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
2708
|
+
}
|
|
2709
|
+
return Promise.resolve(null);
|
|
2710
|
+
}
|
|
2711
|
+
/**
|
|
2712
|
+
* Returns a 3D-Mockup geometry as binary stream.
|
|
2713
|
+
* @param id 3D-Mockup identifier.
|
|
2714
|
+
* @param ownerId (optional) Private mockup owner identifier.
|
|
2715
|
+
* @param tenantId (optional) Tenant identifier
|
|
2716
|
+
* @return Success
|
|
2717
|
+
*/
|
|
2718
|
+
getGeometryFile(id, ownerId, tenantId, cancelToken) {
|
|
2719
|
+
let url_ = this.baseUrl + "/api/atoms/v1/mockups-3d/{id}/geometry/file?";
|
|
2720
|
+
if (id === undefined || id === null)
|
|
2721
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
2722
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
2723
|
+
if (ownerId !== undefined && ownerId !== null)
|
|
2724
|
+
url_ += "ownerId=" + encodeURIComponent("" + ownerId) + "&";
|
|
2725
|
+
if (tenantId === null)
|
|
2726
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
2727
|
+
else if (tenantId !== undefined)
|
|
2728
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2729
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
2730
|
+
let options_ = {
|
|
2731
|
+
responseType: "blob",
|
|
2732
|
+
method: "GET",
|
|
2733
|
+
url: url_,
|
|
2734
|
+
headers: {
|
|
2735
|
+
"Accept": "application/json"
|
|
2736
|
+
},
|
|
2737
|
+
cancelToken
|
|
2738
|
+
};
|
|
2739
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
2740
|
+
return this.instance.request(transformedOptions_);
|
|
2741
|
+
}).catch((_error) => {
|
|
2742
|
+
if (isAxiosError(_error) && _error.response) {
|
|
2743
|
+
return _error.response;
|
|
2744
|
+
}
|
|
2745
|
+
else {
|
|
2746
|
+
throw _error;
|
|
2747
|
+
}
|
|
2748
|
+
}).then((_response) => {
|
|
2749
|
+
return this.transformResult(url_, _response, (_response) => this.processGetGeometryFile(_response));
|
|
2750
|
+
});
|
|
2751
|
+
}
|
|
2752
|
+
processGetGeometryFile(response) {
|
|
2753
|
+
const status = response.status;
|
|
2754
|
+
let _headers = {};
|
|
2755
|
+
if (response.headers && typeof response.headers === "object") {
|
|
2756
|
+
for (let k in response.headers) {
|
|
2757
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
2758
|
+
_headers[k] = response.headers[k];
|
|
2759
|
+
}
|
|
2760
|
+
}
|
|
2761
|
+
}
|
|
2762
|
+
if (status === 200 || status === 206) {
|
|
2763
|
+
const contentDisposition = response.headers ? response.headers["content-disposition"] : undefined;
|
|
2764
|
+
const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
|
|
2765
|
+
const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
|
|
2766
|
+
return Promise.resolve({ fileName: fileName, status: status, data: new Blob([response.data]), headers: _headers });
|
|
2767
|
+
}
|
|
2768
|
+
else if (status === 404) {
|
|
2769
|
+
const _responseText = response.data;
|
|
2770
|
+
let result404 = null;
|
|
2771
|
+
let resultData404 = _responseText;
|
|
2772
|
+
result404 = JSON.parse(resultData404);
|
|
2773
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
2774
|
+
}
|
|
2775
|
+
else if (status === 422) {
|
|
2776
|
+
const _responseText = response.data;
|
|
2777
|
+
let result422 = null;
|
|
2778
|
+
let resultData422 = _responseText;
|
|
2779
|
+
result422 = JSON.parse(resultData422);
|
|
2780
|
+
return throwException("Client Error", status, _responseText, _headers, result422);
|
|
2781
|
+
}
|
|
2782
|
+
else if (status === 401) {
|
|
2783
|
+
const _responseText = response.data;
|
|
2784
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
2785
|
+
}
|
|
2786
|
+
else if (status === 403) {
|
|
2787
|
+
const _responseText = response.data;
|
|
2788
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
2789
|
+
}
|
|
2790
|
+
else if (status !== 200 && status !== 204) {
|
|
2791
|
+
const _responseText = response.data;
|
|
2792
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
2793
|
+
}
|
|
2794
|
+
return Promise.resolve(null);
|
|
2795
|
+
}
|
|
2796
|
+
}
|
|
2797
|
+
exports.DesignAtomsMockups3dApiClient = DesignAtomsMockups3dApiClient;
|
|
2798
|
+
class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
2799
|
+
instance;
|
|
2800
|
+
baseUrl;
|
|
2801
|
+
jsonParseReviver = undefined;
|
|
2802
|
+
constructor(configuration, baseUrl, instance) {
|
|
2803
|
+
super(configuration);
|
|
2804
|
+
this.instance = instance ? instance : axios_1.create();
|
|
2805
|
+
this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : this.getBaseUrl("");
|
|
2806
|
+
}
|
|
2807
|
+
/**
|
|
2808
|
+
* Creates new design file with specified parameters and saves it in storage.
|
|
2809
|
+
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
2810
|
+
* @param tenantId (optional) Tenant identifier
|
|
2811
|
+
* @param body (optional) Design creation parameters.
|
|
2812
|
+
* @return Created
|
|
2813
|
+
*/
|
|
2814
|
+
createDesign(privateStorageOwner, tenantId, body, cancelToken) {
|
|
2815
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs?";
|
|
2816
|
+
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
2817
|
+
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
2818
|
+
if (tenantId === null)
|
|
2819
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
2820
|
+
else if (tenantId !== undefined)
|
|
2821
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2822
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
2823
|
+
const content_ = JSON.stringify(body);
|
|
2824
|
+
let options_ = {
|
|
2825
|
+
data: content_,
|
|
2826
|
+
method: "POST",
|
|
2827
|
+
url: url_,
|
|
2828
|
+
headers: {
|
|
2829
|
+
"Content-Type": "application/json",
|
|
2830
|
+
"Accept": "application/json"
|
|
2831
|
+
},
|
|
2832
|
+
cancelToken
|
|
2833
|
+
};
|
|
2834
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
2835
|
+
return this.instance.request(transformedOptions_);
|
|
2836
|
+
}).catch((_error) => {
|
|
2837
|
+
if (isAxiosError(_error) && _error.response) {
|
|
2838
|
+
return _error.response;
|
|
2839
|
+
}
|
|
2840
|
+
else {
|
|
2841
|
+
throw _error;
|
|
2842
|
+
}
|
|
2843
|
+
}).then((_response) => {
|
|
2844
|
+
return this.transformResult(url_, _response, (_response) => this.processCreateDesign(_response));
|
|
2845
|
+
});
|
|
2846
|
+
}
|
|
2847
|
+
processCreateDesign(response) {
|
|
2848
|
+
const status = response.status;
|
|
2849
|
+
let _headers = {};
|
|
2850
|
+
if (response.headers && typeof response.headers === "object") {
|
|
2851
|
+
for (let k in response.headers) {
|
|
2852
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
2853
|
+
_headers[k] = response.headers[k];
|
|
2854
|
+
}
|
|
2855
|
+
}
|
|
2856
|
+
}
|
|
2857
|
+
if (status === 201) {
|
|
2858
|
+
const _responseText = response.data;
|
|
2859
|
+
let result201 = null;
|
|
2860
|
+
let resultData201 = _responseText;
|
|
2861
|
+
result201 = JSON.parse(resultData201);
|
|
2862
|
+
return Promise.resolve(result201);
|
|
2863
|
+
}
|
|
2864
|
+
else if (status === 401) {
|
|
2865
|
+
const _responseText = response.data;
|
|
2866
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
2867
|
+
}
|
|
2868
|
+
else if (status === 403) {
|
|
2869
|
+
const _responseText = response.data;
|
|
2870
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
2871
|
+
}
|
|
2872
|
+
else if (status !== 200 && status !== 204) {
|
|
2873
|
+
const _responseText = response.data;
|
|
2874
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
2875
|
+
}
|
|
2876
|
+
return Promise.resolve(null);
|
|
2877
|
+
}
|
|
2878
|
+
/**
|
|
2879
|
+
* Returns content of the background.
|
|
2880
|
+
* @param id Design identifier.
|
|
2881
|
+
* @param surfaceIndex (optional) Surface index.
|
|
2882
|
+
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
2883
|
+
* @param tenantId (optional) Tenant identifier
|
|
2884
|
+
* @return Success
|
|
2885
|
+
*/
|
|
2886
|
+
extractBackground(id, surfaceIndex, privateStorageOwner, tenantId, cancelToken) {
|
|
2887
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/background?";
|
|
2888
|
+
if (id === undefined || id === null)
|
|
2889
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
2890
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
2891
|
+
if (surfaceIndex !== undefined && surfaceIndex !== null)
|
|
2892
|
+
url_ += "surfaceIndex=" + encodeURIComponent("" + surfaceIndex) + "&";
|
|
2893
|
+
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
2894
|
+
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
2895
|
+
if (tenantId === null)
|
|
2896
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
2897
|
+
else if (tenantId !== undefined)
|
|
2898
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2899
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
2900
|
+
let options_ = {
|
|
2901
|
+
responseType: "blob",
|
|
2902
|
+
method: "GET",
|
|
2903
|
+
url: url_,
|
|
2904
|
+
headers: {
|
|
2905
|
+
"Accept": "application/octet-stream"
|
|
2906
|
+
},
|
|
2907
|
+
cancelToken
|
|
2908
|
+
};
|
|
2909
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
2910
|
+
return this.instance.request(transformedOptions_);
|
|
2911
|
+
}).catch((_error) => {
|
|
2912
|
+
if (isAxiosError(_error) && _error.response) {
|
|
2913
|
+
return _error.response;
|
|
2914
|
+
}
|
|
2915
|
+
else {
|
|
2916
|
+
throw _error;
|
|
2917
|
+
}
|
|
2918
|
+
}).then((_response) => {
|
|
2919
|
+
return this.transformResult(url_, _response, (_response) => this.processExtractBackground(_response));
|
|
2920
|
+
});
|
|
2921
|
+
}
|
|
2922
|
+
processExtractBackground(response) {
|
|
2923
|
+
const status = response.status;
|
|
2924
|
+
let _headers = {};
|
|
2925
|
+
if (response.headers && typeof response.headers === "object") {
|
|
2926
|
+
for (let k in response.headers) {
|
|
2927
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
2928
|
+
_headers[k] = response.headers[k];
|
|
2929
|
+
}
|
|
2930
|
+
}
|
|
2931
|
+
}
|
|
2932
|
+
if (status === 200 || status === 206) {
|
|
2933
|
+
const contentDisposition = response.headers ? response.headers["content-disposition"] : undefined;
|
|
2934
|
+
const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
|
|
2935
|
+
const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
|
|
2936
|
+
return Promise.resolve({ fileName: fileName, status: status, data: new Blob([response.data]), headers: _headers });
|
|
2937
|
+
}
|
|
2938
|
+
else if (status === 404) {
|
|
2939
|
+
const _responseText = response.data;
|
|
2940
|
+
let result404 = null;
|
|
2941
|
+
let resultData404 = _responseText;
|
|
2942
|
+
result404 = JSON.parse(resultData404);
|
|
2943
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
2944
|
+
}
|
|
2945
|
+
else if (status === 422) {
|
|
2946
|
+
const _responseText = response.data;
|
|
2947
|
+
let result422 = null;
|
|
2948
|
+
let resultData422 = _responseText;
|
|
2949
|
+
result422 = JSON.parse(resultData422);
|
|
2950
|
+
return throwException("Client Error", status, _responseText, _headers, result422);
|
|
2951
|
+
}
|
|
2234
2952
|
else if (status === 401) {
|
|
2235
2953
|
const _responseText = response.data;
|
|
2236
2954
|
return throwException("Unauthorized", status, _responseText, _headers);
|
|
@@ -2245,33 +2963,20 @@ class DesignAtomsImagesApiClient extends ApiClientBase {
|
|
|
2245
2963
|
}
|
|
2246
2964
|
return Promise.resolve(null);
|
|
2247
2965
|
}
|
|
2248
|
-
}
|
|
2249
|
-
exports.DesignAtomsImagesApiClient = DesignAtomsImagesApiClient;
|
|
2250
|
-
class DesignAtomsMockups3dApiClient extends ApiClientBase {
|
|
2251
|
-
instance;
|
|
2252
|
-
baseUrl;
|
|
2253
|
-
jsonParseReviver = undefined;
|
|
2254
|
-
constructor(configuration, baseUrl, instance) {
|
|
2255
|
-
super(configuration);
|
|
2256
|
-
this.instance = instance ? instance : axios_1.create();
|
|
2257
|
-
this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : this.getBaseUrl("");
|
|
2258
|
-
}
|
|
2259
2966
|
/**
|
|
2260
|
-
*
|
|
2261
|
-
* @param id
|
|
2262
|
-
* @param
|
|
2967
|
+
* Loads product (design model) from design file taken from storage.
|
|
2968
|
+
* @param id Design identifier.
|
|
2969
|
+
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
2263
2970
|
* @param tenantId (optional) Tenant identifier
|
|
2264
2971
|
* @return Success
|
|
2265
2972
|
*/
|
|
2266
|
-
|
|
2267
|
-
let url_ = this.baseUrl + "/api/atoms/v1/
|
|
2973
|
+
loadProduct(id, privateStorageOwner, tenantId, cancelToken) {
|
|
2974
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/model?";
|
|
2268
2975
|
if (id === undefined || id === null)
|
|
2269
2976
|
throw new Error("The parameter 'id' must be defined.");
|
|
2270
2977
|
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
2271
|
-
if (
|
|
2272
|
-
|
|
2273
|
-
else if (ownerId !== undefined)
|
|
2274
|
-
url_ += "ownerId=" + encodeURIComponent("" + ownerId) + "&";
|
|
2978
|
+
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
2979
|
+
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
2275
2980
|
if (tenantId === null)
|
|
2276
2981
|
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
2277
2982
|
else if (tenantId !== undefined)
|
|
@@ -2295,10 +3000,10 @@ class DesignAtomsMockups3dApiClient extends ApiClientBase {
|
|
|
2295
3000
|
throw _error;
|
|
2296
3001
|
}
|
|
2297
3002
|
}).then((_response) => {
|
|
2298
|
-
return this.transformResult(url_, _response, (_response) => this.
|
|
3003
|
+
return this.transformResult(url_, _response, (_response) => this.processLoadProduct(_response));
|
|
2299
3004
|
});
|
|
2300
3005
|
}
|
|
2301
|
-
|
|
3006
|
+
processLoadProduct(response) {
|
|
2302
3007
|
const status = response.status;
|
|
2303
3008
|
let _headers = {};
|
|
2304
3009
|
if (response.headers && typeof response.headers === "object") {
|
|
@@ -2322,13 +3027,6 @@ class DesignAtomsMockups3dApiClient extends ApiClientBase {
|
|
|
2322
3027
|
result404 = JSON.parse(resultData404);
|
|
2323
3028
|
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
2324
3029
|
}
|
|
2325
|
-
else if (status === 422) {
|
|
2326
|
-
const _responseText = response.data;
|
|
2327
|
-
let result422 = null;
|
|
2328
|
-
let resultData422 = _responseText;
|
|
2329
|
-
result422 = JSON.parse(resultData422);
|
|
2330
|
-
return throwException("Client Error", status, _responseText, _headers, result422);
|
|
2331
|
-
}
|
|
2332
3030
|
else if (status === 401) {
|
|
2333
3031
|
const _responseText = response.data;
|
|
2334
3032
|
return throwException("Unauthorized", status, _responseText, _headers);
|
|
@@ -2344,32 +3042,32 @@ class DesignAtomsMockups3dApiClient extends ApiClientBase {
|
|
|
2344
3042
|
return Promise.resolve(null);
|
|
2345
3043
|
}
|
|
2346
3044
|
/**
|
|
2347
|
-
*
|
|
2348
|
-
* @param id
|
|
2349
|
-
* @param
|
|
3045
|
+
* Saves product (design model) to design file and updates design in storage.
|
|
3046
|
+
* @param id Design identifier.
|
|
3047
|
+
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
2350
3048
|
* @param tenantId (optional) Tenant identifier
|
|
3049
|
+
* @param body (optional) Serialized product description.
|
|
2351
3050
|
* @return Success
|
|
2352
3051
|
*/
|
|
2353
|
-
|
|
2354
|
-
let url_ = this.baseUrl + "/api/atoms/v1/
|
|
3052
|
+
saveProduct(id, privateStorageOwner, tenantId, body, cancelToken) {
|
|
3053
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/model?";
|
|
2355
3054
|
if (id === undefined || id === null)
|
|
2356
3055
|
throw new Error("The parameter 'id' must be defined.");
|
|
2357
3056
|
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
2358
|
-
if (
|
|
2359
|
-
|
|
2360
|
-
else if (ownerId !== undefined)
|
|
2361
|
-
url_ += "ownerId=" + encodeURIComponent("" + ownerId) + "&";
|
|
3057
|
+
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
3058
|
+
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
2362
3059
|
if (tenantId === null)
|
|
2363
3060
|
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
2364
3061
|
else if (tenantId !== undefined)
|
|
2365
3062
|
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2366
3063
|
url_ = url_.replace(/[?&]$/, "");
|
|
3064
|
+
const content_ = JSON.stringify(body);
|
|
2367
3065
|
let options_ = {
|
|
2368
|
-
|
|
2369
|
-
method: "
|
|
3066
|
+
data: content_,
|
|
3067
|
+
method: "PUT",
|
|
2370
3068
|
url: url_,
|
|
2371
3069
|
headers: {
|
|
2372
|
-
"
|
|
3070
|
+
"Content-Type": "application/json",
|
|
2373
3071
|
},
|
|
2374
3072
|
cancelToken
|
|
2375
3073
|
};
|
|
@@ -2383,10 +3081,10 @@ class DesignAtomsMockups3dApiClient extends ApiClientBase {
|
|
|
2383
3081
|
throw _error;
|
|
2384
3082
|
}
|
|
2385
3083
|
}).then((_response) => {
|
|
2386
|
-
return this.transformResult(url_, _response, (_response) => this.
|
|
3084
|
+
return this.transformResult(url_, _response, (_response) => this.processSaveProduct(_response));
|
|
2387
3085
|
});
|
|
2388
3086
|
}
|
|
2389
|
-
|
|
3087
|
+
processSaveProduct(response) {
|
|
2390
3088
|
const status = response.status;
|
|
2391
3089
|
let _headers = {};
|
|
2392
3090
|
if (response.headers && typeof response.headers === "object") {
|
|
@@ -2396,11 +3094,9 @@ class DesignAtomsMockups3dApiClient extends ApiClientBase {
|
|
|
2396
3094
|
}
|
|
2397
3095
|
}
|
|
2398
3096
|
}
|
|
2399
|
-
if (status === 200
|
|
2400
|
-
const
|
|
2401
|
-
|
|
2402
|
-
const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
|
|
2403
|
-
return Promise.resolve({ fileName: fileName, status: status, data: new Blob([response.data]), headers: _headers });
|
|
3097
|
+
if (status === 200) {
|
|
3098
|
+
const _responseText = response.data;
|
|
3099
|
+
return Promise.resolve(null);
|
|
2404
3100
|
}
|
|
2405
3101
|
else if (status === 404) {
|
|
2406
3102
|
const _responseText = response.data;
|
|
@@ -2409,13 +3105,6 @@ class DesignAtomsMockups3dApiClient extends ApiClientBase {
|
|
|
2409
3105
|
result404 = JSON.parse(resultData404);
|
|
2410
3106
|
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
2411
3107
|
}
|
|
2412
|
-
else if (status === 422) {
|
|
2413
|
-
const _responseText = response.data;
|
|
2414
|
-
let result422 = null;
|
|
2415
|
-
let resultData422 = _responseText;
|
|
2416
|
-
result422 = JSON.parse(resultData422);
|
|
2417
|
-
return throwException("Client Error", status, _responseText, _headers, result422);
|
|
2418
|
-
}
|
|
2419
3108
|
else if (status === 401) {
|
|
2420
3109
|
const _responseText = response.data;
|
|
2421
3110
|
return throwException("Unauthorized", status, _responseText, _headers);
|
|
@@ -2431,33 +3120,52 @@ class DesignAtomsMockups3dApiClient extends ApiClientBase {
|
|
|
2431
3120
|
return Promise.resolve(null);
|
|
2432
3121
|
}
|
|
2433
3122
|
/**
|
|
2434
|
-
*
|
|
2435
|
-
* @param id
|
|
2436
|
-
* @param
|
|
3123
|
+
* Patches product (design model) in design file.
|
|
3124
|
+
* @param id Design identifier.
|
|
3125
|
+
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
2437
3126
|
* @param tenantId (optional) Tenant identifier
|
|
3127
|
+
* @param patchType (optional)
|
|
3128
|
+
* @param replaceImageItemFileInfo_itemName (optional)
|
|
3129
|
+
* @param replaceImageItemFileInfo_sourceFile (optional)
|
|
3130
|
+
* @param replacePlaceholderItemContentInfo_placeholderItemName (optional)
|
|
3131
|
+
* @param replacePlaceholderItemContentInfo_newContentType (optional)
|
|
3132
|
+
* @param replacePlaceholderItemContentInfo_sourceFile (optional)
|
|
2438
3133
|
* @return Success
|
|
2439
3134
|
*/
|
|
2440
|
-
|
|
2441
|
-
let url_ = this.baseUrl + "/api/atoms/v1/
|
|
3135
|
+
patchProduct(id, privateStorageOwner, tenantId, patchType, replaceImageItemFileInfo_itemName, replaceImageItemFileInfo_sourceFile, replacePlaceholderItemContentInfo_placeholderItemName, replacePlaceholderItemContentInfo_newContentType, replacePlaceholderItemContentInfo_sourceFile, cancelToken) {
|
|
3136
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/model?";
|
|
2442
3137
|
if (id === undefined || id === null)
|
|
2443
3138
|
throw new Error("The parameter 'id' must be defined.");
|
|
2444
3139
|
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
2445
|
-
if (
|
|
2446
|
-
|
|
2447
|
-
else if (ownerId !== undefined)
|
|
2448
|
-
url_ += "ownerId=" + encodeURIComponent("" + ownerId) + "&";
|
|
3140
|
+
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
3141
|
+
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
2449
3142
|
if (tenantId === null)
|
|
2450
3143
|
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
2451
3144
|
else if (tenantId !== undefined)
|
|
2452
3145
|
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2453
3146
|
url_ = url_.replace(/[?&]$/, "");
|
|
3147
|
+
const content_ = new FormData();
|
|
3148
|
+
if (patchType === null || patchType === undefined)
|
|
3149
|
+
throw new Error("The parameter 'patchType' cannot be null.");
|
|
3150
|
+
else
|
|
3151
|
+
content_.append("patchType", patchType.toString());
|
|
3152
|
+
if (replaceImageItemFileInfo_itemName !== null && replaceImageItemFileInfo_itemName !== undefined)
|
|
3153
|
+
content_.append("replaceImageItemFileInfo.itemName", replaceImageItemFileInfo_itemName.toString());
|
|
3154
|
+
if (replaceImageItemFileInfo_sourceFile !== null && replaceImageItemFileInfo_sourceFile !== undefined)
|
|
3155
|
+
content_.append("replaceImageItemFileInfo.sourceFile", replaceImageItemFileInfo_sourceFile.data, replaceImageItemFileInfo_sourceFile.fileName ? replaceImageItemFileInfo_sourceFile.fileName : "replaceImageItemFileInfo.sourceFile");
|
|
3156
|
+
if (replacePlaceholderItemContentInfo_placeholderItemName !== null && replacePlaceholderItemContentInfo_placeholderItemName !== undefined)
|
|
3157
|
+
content_.append("replacePlaceholderItemContentInfo.placeholderItemName", replacePlaceholderItemContentInfo_placeholderItemName.toString());
|
|
3158
|
+
if (replacePlaceholderItemContentInfo_newContentType === null || replacePlaceholderItemContentInfo_newContentType === undefined)
|
|
3159
|
+
throw new Error("The parameter 'replacePlaceholderItemContentInfo_newContentType' cannot be null.");
|
|
3160
|
+
else
|
|
3161
|
+
content_.append("replacePlaceholderItemContentInfo.newContentType", replacePlaceholderItemContentInfo_newContentType.toString());
|
|
3162
|
+
if (replacePlaceholderItemContentInfo_sourceFile !== null && replacePlaceholderItemContentInfo_sourceFile !== undefined)
|
|
3163
|
+
content_.append("replacePlaceholderItemContentInfo.sourceFile", replacePlaceholderItemContentInfo_sourceFile.data, replacePlaceholderItemContentInfo_sourceFile.fileName ? replacePlaceholderItemContentInfo_sourceFile.fileName : "replacePlaceholderItemContentInfo.sourceFile");
|
|
2454
3164
|
let options_ = {
|
|
2455
|
-
|
|
2456
|
-
method: "
|
|
3165
|
+
data: content_,
|
|
3166
|
+
method: "PATCH",
|
|
2457
3167
|
url: url_,
|
|
2458
|
-
headers: {
|
|
2459
|
-
"Accept": "application/json"
|
|
2460
|
-
},
|
|
3168
|
+
headers: {},
|
|
2461
3169
|
cancelToken
|
|
2462
3170
|
};
|
|
2463
3171
|
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
@@ -2470,10 +3178,10 @@ class DesignAtomsMockups3dApiClient extends ApiClientBase {
|
|
|
2470
3178
|
throw _error;
|
|
2471
3179
|
}
|
|
2472
3180
|
}).then((_response) => {
|
|
2473
|
-
return this.transformResult(url_, _response, (_response) => this.
|
|
3181
|
+
return this.transformResult(url_, _response, (_response) => this.processPatchProduct(_response));
|
|
2474
3182
|
});
|
|
2475
3183
|
}
|
|
2476
|
-
|
|
3184
|
+
processPatchProduct(response) {
|
|
2477
3185
|
const status = response.status;
|
|
2478
3186
|
let _headers = {};
|
|
2479
3187
|
if (response.headers && typeof response.headers === "object") {
|
|
@@ -2483,11 +3191,9 @@ class DesignAtomsMockups3dApiClient extends ApiClientBase {
|
|
|
2483
3191
|
}
|
|
2484
3192
|
}
|
|
2485
3193
|
}
|
|
2486
|
-
if (status === 200
|
|
2487
|
-
const
|
|
2488
|
-
|
|
2489
|
-
const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
|
|
2490
|
-
return Promise.resolve({ fileName: fileName, status: status, data: new Blob([response.data]), headers: _headers });
|
|
3194
|
+
if (status === 200) {
|
|
3195
|
+
const _responseText = response.data;
|
|
3196
|
+
return Promise.resolve(null);
|
|
2491
3197
|
}
|
|
2492
3198
|
else if (status === 404) {
|
|
2493
3199
|
const _responseText = response.data;
|
|
@@ -2496,13 +3202,6 @@ class DesignAtomsMockups3dApiClient extends ApiClientBase {
|
|
|
2496
3202
|
result404 = JSON.parse(resultData404);
|
|
2497
3203
|
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
2498
3204
|
}
|
|
2499
|
-
else if (status === 422) {
|
|
2500
|
-
const _responseText = response.data;
|
|
2501
|
-
let result422 = null;
|
|
2502
|
-
let resultData422 = _responseText;
|
|
2503
|
-
result422 = JSON.parse(resultData422);
|
|
2504
|
-
return throwException("Client Error", status, _responseText, _headers, result422);
|
|
2505
|
-
}
|
|
2506
3205
|
else if (status === 401) {
|
|
2507
3206
|
const _responseText = response.data;
|
|
2508
3207
|
return throwException("Unauthorized", status, _responseText, _headers);
|
|
@@ -2517,42 +3216,29 @@ class DesignAtomsMockups3dApiClient extends ApiClientBase {
|
|
|
2517
3216
|
}
|
|
2518
3217
|
return Promise.resolve(null);
|
|
2519
3218
|
}
|
|
2520
|
-
}
|
|
2521
|
-
exports.DesignAtomsMockups3dApiClient = DesignAtomsMockups3dApiClient;
|
|
2522
|
-
class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
2523
|
-
instance;
|
|
2524
|
-
baseUrl;
|
|
2525
|
-
jsonParseReviver = undefined;
|
|
2526
|
-
constructor(configuration, baseUrl, instance) {
|
|
2527
|
-
super(configuration);
|
|
2528
|
-
this.instance = instance ? instance : axios_1.create();
|
|
2529
|
-
this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : this.getBaseUrl("");
|
|
2530
|
-
}
|
|
2531
3219
|
/**
|
|
2532
|
-
*
|
|
3220
|
+
* Returns design parameters stored in product model.
|
|
3221
|
+
* @param id Design identifier.
|
|
2533
3222
|
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
2534
3223
|
* @param tenantId (optional) Tenant identifier
|
|
2535
|
-
* @
|
|
2536
|
-
* @return Created
|
|
3224
|
+
* @return Success
|
|
2537
3225
|
*/
|
|
2538
|
-
|
|
2539
|
-
let url_ = this.baseUrl + "/api/atoms/v1/designs?";
|
|
2540
|
-
if (
|
|
2541
|
-
throw new Error("The parameter '
|
|
2542
|
-
|
|
3226
|
+
getDesignParameters(id, privateStorageOwner, tenantId, cancelToken) {
|
|
3227
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/parameters?";
|
|
3228
|
+
if (id === undefined || id === null)
|
|
3229
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
3230
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
3231
|
+
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
2543
3232
|
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
2544
3233
|
if (tenantId === null)
|
|
2545
3234
|
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
2546
3235
|
else if (tenantId !== undefined)
|
|
2547
3236
|
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2548
3237
|
url_ = url_.replace(/[?&]$/, "");
|
|
2549
|
-
const content_ = JSON.stringify(body);
|
|
2550
3238
|
let options_ = {
|
|
2551
|
-
|
|
2552
|
-
method: "POST",
|
|
3239
|
+
method: "GET",
|
|
2553
3240
|
url: url_,
|
|
2554
3241
|
headers: {
|
|
2555
|
-
"Content-Type": "application/json",
|
|
2556
3242
|
"Accept": "application/json"
|
|
2557
3243
|
},
|
|
2558
3244
|
cancelToken
|
|
@@ -2567,10 +3253,10 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2567
3253
|
throw _error;
|
|
2568
3254
|
}
|
|
2569
3255
|
}).then((_response) => {
|
|
2570
|
-
return this.transformResult(url_, _response, (_response) => this.
|
|
3256
|
+
return this.transformResult(url_, _response, (_response) => this.processGetDesignParameters(_response));
|
|
2571
3257
|
});
|
|
2572
3258
|
}
|
|
2573
|
-
|
|
3259
|
+
processGetDesignParameters(response) {
|
|
2574
3260
|
const status = response.status;
|
|
2575
3261
|
let _headers = {};
|
|
2576
3262
|
if (response.headers && typeof response.headers === "object") {
|
|
@@ -2580,12 +3266,19 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2580
3266
|
}
|
|
2581
3267
|
}
|
|
2582
3268
|
}
|
|
2583
|
-
if (status ===
|
|
3269
|
+
if (status === 200) {
|
|
2584
3270
|
const _responseText = response.data;
|
|
2585
|
-
let
|
|
2586
|
-
let
|
|
2587
|
-
|
|
2588
|
-
return Promise.resolve(
|
|
3271
|
+
let result200 = null;
|
|
3272
|
+
let resultData200 = _responseText;
|
|
3273
|
+
result200 = JSON.parse(resultData200);
|
|
3274
|
+
return Promise.resolve(result200);
|
|
3275
|
+
}
|
|
3276
|
+
else if (status === 404) {
|
|
3277
|
+
const _responseText = response.data;
|
|
3278
|
+
let result404 = null;
|
|
3279
|
+
let resultData404 = _responseText;
|
|
3280
|
+
result404 = JSON.parse(resultData404);
|
|
3281
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
2589
3282
|
}
|
|
2590
3283
|
else if (status === 401) {
|
|
2591
3284
|
const _responseText = response.data;
|
|
@@ -2602,25 +3295,18 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2602
3295
|
return Promise.resolve(null);
|
|
2603
3296
|
}
|
|
2604
3297
|
/**
|
|
2605
|
-
*
|
|
3298
|
+
* Loads data schema from design file taken from storage.
|
|
2606
3299
|
* @param id Design identifier.
|
|
2607
|
-
* @param surfaceIndex (optional) Surface index.
|
|
2608
3300
|
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
2609
3301
|
* @param tenantId (optional) Tenant identifier
|
|
2610
3302
|
* @return Success
|
|
2611
3303
|
*/
|
|
2612
|
-
|
|
2613
|
-
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/
|
|
3304
|
+
loadDataSchema(id, privateStorageOwner, tenantId, cancelToken) {
|
|
3305
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/schema?";
|
|
2614
3306
|
if (id === undefined || id === null)
|
|
2615
3307
|
throw new Error("The parameter 'id' must be defined.");
|
|
2616
3308
|
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
2617
|
-
if (
|
|
2618
|
-
throw new Error("The parameter 'surfaceIndex' cannot be null.");
|
|
2619
|
-
else if (surfaceIndex !== undefined)
|
|
2620
|
-
url_ += "surfaceIndex=" + encodeURIComponent("" + surfaceIndex) + "&";
|
|
2621
|
-
if (privateStorageOwner === null)
|
|
2622
|
-
throw new Error("The parameter 'privateStorageOwner' cannot be null.");
|
|
2623
|
-
else if (privateStorageOwner !== undefined)
|
|
3309
|
+
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
2624
3310
|
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
2625
3311
|
if (tenantId === null)
|
|
2626
3312
|
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
@@ -2646,10 +3332,10 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2646
3332
|
throw _error;
|
|
2647
3333
|
}
|
|
2648
3334
|
}).then((_response) => {
|
|
2649
|
-
return this.transformResult(url_, _response, (_response) => this.
|
|
3335
|
+
return this.transformResult(url_, _response, (_response) => this.processLoadDataSchema(_response));
|
|
2650
3336
|
});
|
|
2651
3337
|
}
|
|
2652
|
-
|
|
3338
|
+
processLoadDataSchema(response) {
|
|
2653
3339
|
const status = response.status;
|
|
2654
3340
|
let _headers = {};
|
|
2655
3341
|
if (response.headers && typeof response.headers === "object") {
|
|
@@ -2672,12 +3358,12 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2672
3358
|
result404 = JSON.parse(resultData404);
|
|
2673
3359
|
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
2674
3360
|
}
|
|
2675
|
-
else if (status ===
|
|
3361
|
+
else if (status === 409) {
|
|
2676
3362
|
const _responseText = response.data;
|
|
2677
|
-
let
|
|
2678
|
-
let
|
|
2679
|
-
|
|
2680
|
-
return throwException("
|
|
3363
|
+
let result409 = null;
|
|
3364
|
+
let resultData409 = _responseText;
|
|
3365
|
+
result409 = JSON.parse(resultData409);
|
|
3366
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
2681
3367
|
}
|
|
2682
3368
|
else if (status === 401) {
|
|
2683
3369
|
const _responseText = response.data;
|
|
@@ -2694,20 +3380,18 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2694
3380
|
return Promise.resolve(null);
|
|
2695
3381
|
}
|
|
2696
3382
|
/**
|
|
2697
|
-
* Loads
|
|
3383
|
+
* Loads a toggle set from design file taken from storage.
|
|
2698
3384
|
* @param id Design identifier.
|
|
2699
3385
|
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
2700
3386
|
* @param tenantId (optional) Tenant identifier
|
|
2701
3387
|
* @return Success
|
|
2702
3388
|
*/
|
|
2703
|
-
|
|
2704
|
-
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/
|
|
3389
|
+
loadToggleSet(id, privateStorageOwner, tenantId, cancelToken) {
|
|
3390
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/toggle-set?";
|
|
2705
3391
|
if (id === undefined || id === null)
|
|
2706
3392
|
throw new Error("The parameter 'id' must be defined.");
|
|
2707
3393
|
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
2708
|
-
if (privateStorageOwner
|
|
2709
|
-
throw new Error("The parameter 'privateStorageOwner' cannot be null.");
|
|
2710
|
-
else if (privateStorageOwner !== undefined)
|
|
3394
|
+
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
2711
3395
|
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
2712
3396
|
if (tenantId === null)
|
|
2713
3397
|
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
@@ -2715,10 +3399,11 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2715
3399
|
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2716
3400
|
url_ = url_.replace(/[?&]$/, "");
|
|
2717
3401
|
let options_ = {
|
|
3402
|
+
responseType: "blob",
|
|
2718
3403
|
method: "GET",
|
|
2719
3404
|
url: url_,
|
|
2720
3405
|
headers: {
|
|
2721
|
-
"Accept": "application/
|
|
3406
|
+
"Accept": "application/octet-stream"
|
|
2722
3407
|
},
|
|
2723
3408
|
cancelToken
|
|
2724
3409
|
};
|
|
@@ -2732,10 +3417,10 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2732
3417
|
throw _error;
|
|
2733
3418
|
}
|
|
2734
3419
|
}).then((_response) => {
|
|
2735
|
-
return this.transformResult(url_, _response, (_response) => this.
|
|
3420
|
+
return this.transformResult(url_, _response, (_response) => this.processLoadToggleSet(_response));
|
|
2736
3421
|
});
|
|
2737
3422
|
}
|
|
2738
|
-
|
|
3423
|
+
processLoadToggleSet(response) {
|
|
2739
3424
|
const status = response.status;
|
|
2740
3425
|
let _headers = {};
|
|
2741
3426
|
if (response.headers && typeof response.headers === "object") {
|
|
@@ -2745,12 +3430,11 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2745
3430
|
}
|
|
2746
3431
|
}
|
|
2747
3432
|
}
|
|
2748
|
-
if (status === 200) {
|
|
2749
|
-
const
|
|
2750
|
-
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
return Promise.resolve(result200);
|
|
3433
|
+
if (status === 200 || status === 206) {
|
|
3434
|
+
const contentDisposition = response.headers ? response.headers["content-disposition"] : undefined;
|
|
3435
|
+
const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
|
|
3436
|
+
const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
|
|
3437
|
+
return Promise.resolve({ fileName: fileName, status: status, data: new Blob([response.data]), headers: _headers });
|
|
2754
3438
|
}
|
|
2755
3439
|
else if (status === 404) {
|
|
2756
3440
|
const _responseText = response.data;
|
|
@@ -2759,6 +3443,13 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2759
3443
|
result404 = JSON.parse(resultData404);
|
|
2760
3444
|
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
2761
3445
|
}
|
|
3446
|
+
else if (status === 409) {
|
|
3447
|
+
const _responseText = response.data;
|
|
3448
|
+
let result409 = null;
|
|
3449
|
+
let resultData409 = _responseText;
|
|
3450
|
+
result409 = JSON.parse(resultData409);
|
|
3451
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
3452
|
+
}
|
|
2762
3453
|
else if (status === 401) {
|
|
2763
3454
|
const _responseText = response.data;
|
|
2764
3455
|
return throwException("Unauthorized", status, _responseText, _headers);
|
|
@@ -2774,34 +3465,29 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2774
3465
|
return Promise.resolve(null);
|
|
2775
3466
|
}
|
|
2776
3467
|
/**
|
|
2777
|
-
*
|
|
3468
|
+
* Gets variable items information for design file taken from storage.
|
|
2778
3469
|
* @param id Design identifier.
|
|
2779
3470
|
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
2780
3471
|
* @param tenantId (optional) Tenant identifier
|
|
2781
|
-
* @param body (optional) Serialized product description.
|
|
2782
3472
|
* @return Success
|
|
2783
3473
|
*/
|
|
2784
|
-
|
|
2785
|
-
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/
|
|
3474
|
+
getVariables(id, privateStorageOwner, tenantId, cancelToken) {
|
|
3475
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/variables?";
|
|
2786
3476
|
if (id === undefined || id === null)
|
|
2787
3477
|
throw new Error("The parameter 'id' must be defined.");
|
|
2788
3478
|
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
2789
|
-
if (privateStorageOwner
|
|
2790
|
-
throw new Error("The parameter 'privateStorageOwner' cannot be null.");
|
|
2791
|
-
else if (privateStorageOwner !== undefined)
|
|
3479
|
+
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
2792
3480
|
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
2793
3481
|
if (tenantId === null)
|
|
2794
3482
|
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
2795
3483
|
else if (tenantId !== undefined)
|
|
2796
3484
|
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2797
3485
|
url_ = url_.replace(/[?&]$/, "");
|
|
2798
|
-
|
|
2799
|
-
|
|
2800
|
-
data: content_,
|
|
2801
|
-
method: "PUT",
|
|
3486
|
+
let options_ = {
|
|
3487
|
+
method: "GET",
|
|
2802
3488
|
url: url_,
|
|
2803
3489
|
headers: {
|
|
2804
|
-
"
|
|
3490
|
+
"Accept": "application/json"
|
|
2805
3491
|
},
|
|
2806
3492
|
cancelToken
|
|
2807
3493
|
};
|
|
@@ -2815,10 +3501,10 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2815
3501
|
throw _error;
|
|
2816
3502
|
}
|
|
2817
3503
|
}).then((_response) => {
|
|
2818
|
-
return this.transformResult(url_, _response, (_response) => this.
|
|
3504
|
+
return this.transformResult(url_, _response, (_response) => this.processGetVariables(_response));
|
|
2819
3505
|
});
|
|
2820
3506
|
}
|
|
2821
|
-
|
|
3507
|
+
processGetVariables(response) {
|
|
2822
3508
|
const status = response.status;
|
|
2823
3509
|
let _headers = {};
|
|
2824
3510
|
if (response.headers && typeof response.headers === "object") {
|
|
@@ -2830,7 +3516,10 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2830
3516
|
}
|
|
2831
3517
|
if (status === 200) {
|
|
2832
3518
|
const _responseText = response.data;
|
|
2833
|
-
|
|
3519
|
+
let result200 = null;
|
|
3520
|
+
let resultData200 = _responseText;
|
|
3521
|
+
result200 = JSON.parse(resultData200);
|
|
3522
|
+
return Promise.resolve(result200);
|
|
2834
3523
|
}
|
|
2835
3524
|
else if (status === 404) {
|
|
2836
3525
|
const _responseText = response.data;
|
|
@@ -2854,54 +3543,33 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2854
3543
|
return Promise.resolve(null);
|
|
2855
3544
|
}
|
|
2856
3545
|
/**
|
|
2857
|
-
*
|
|
3546
|
+
* Sets variable items values for design file taken from storage.
|
|
2858
3547
|
* @param id Design identifier.
|
|
2859
3548
|
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
2860
3549
|
* @param tenantId (optional) Tenant identifier
|
|
2861
|
-
* @param
|
|
2862
|
-
* @param replaceImageItemFileInfo_itemName (optional)
|
|
2863
|
-
* @param replaceImageItemFileInfo_sourceFile (optional)
|
|
2864
|
-
* @param replacePlaceholderItemContentInfo_placeholderItemName (optional)
|
|
2865
|
-
* @param replacePlaceholderItemContentInfo_newContentType (optional)
|
|
2866
|
-
* @param replacePlaceholderItemContentInfo_sourceFile (optional)
|
|
3550
|
+
* @param body (optional) Design variable values.
|
|
2867
3551
|
* @return Success
|
|
2868
3552
|
*/
|
|
2869
|
-
|
|
2870
|
-
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/
|
|
3553
|
+
setVariables(id, privateStorageOwner, tenantId, body, cancelToken) {
|
|
3554
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/variables?";
|
|
2871
3555
|
if (id === undefined || id === null)
|
|
2872
3556
|
throw new Error("The parameter 'id' must be defined.");
|
|
2873
3557
|
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
2874
|
-
if (privateStorageOwner
|
|
2875
|
-
throw new Error("The parameter 'privateStorageOwner' cannot be null.");
|
|
2876
|
-
else if (privateStorageOwner !== undefined)
|
|
3558
|
+
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
2877
3559
|
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
2878
3560
|
if (tenantId === null)
|
|
2879
3561
|
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
2880
3562
|
else if (tenantId !== undefined)
|
|
2881
3563
|
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2882
3564
|
url_ = url_.replace(/[?&]$/, "");
|
|
2883
|
-
const content_ =
|
|
2884
|
-
if (patchType === null || patchType === undefined)
|
|
2885
|
-
throw new Error("The parameter 'patchType' cannot be null.");
|
|
2886
|
-
else
|
|
2887
|
-
content_.append("patchType", patchType.toString());
|
|
2888
|
-
if (replaceImageItemFileInfo_itemName !== null && replaceImageItemFileInfo_itemName !== undefined)
|
|
2889
|
-
content_.append("replaceImageItemFileInfo.itemName", replaceImageItemFileInfo_itemName.toString());
|
|
2890
|
-
if (replaceImageItemFileInfo_sourceFile !== null && replaceImageItemFileInfo_sourceFile !== undefined)
|
|
2891
|
-
content_.append("replaceImageItemFileInfo.sourceFile", replaceImageItemFileInfo_sourceFile.data, replaceImageItemFileInfo_sourceFile.fileName ? replaceImageItemFileInfo_sourceFile.fileName : "replaceImageItemFileInfo.sourceFile");
|
|
2892
|
-
if (replacePlaceholderItemContentInfo_placeholderItemName !== null && replacePlaceholderItemContentInfo_placeholderItemName !== undefined)
|
|
2893
|
-
content_.append("replacePlaceholderItemContentInfo.placeholderItemName", replacePlaceholderItemContentInfo_placeholderItemName.toString());
|
|
2894
|
-
if (replacePlaceholderItemContentInfo_newContentType === null || replacePlaceholderItemContentInfo_newContentType === undefined)
|
|
2895
|
-
throw new Error("The parameter 'replacePlaceholderItemContentInfo_newContentType' cannot be null.");
|
|
2896
|
-
else
|
|
2897
|
-
content_.append("replacePlaceholderItemContentInfo.newContentType", replacePlaceholderItemContentInfo_newContentType.toString());
|
|
2898
|
-
if (replacePlaceholderItemContentInfo_sourceFile !== null && replacePlaceholderItemContentInfo_sourceFile !== undefined)
|
|
2899
|
-
content_.append("replacePlaceholderItemContentInfo.sourceFile", replacePlaceholderItemContentInfo_sourceFile.data, replacePlaceholderItemContentInfo_sourceFile.fileName ? replacePlaceholderItemContentInfo_sourceFile.fileName : "replacePlaceholderItemContentInfo.sourceFile");
|
|
3565
|
+
const content_ = JSON.stringify(body);
|
|
2900
3566
|
let options_ = {
|
|
2901
3567
|
data: content_,
|
|
2902
|
-
method: "
|
|
3568
|
+
method: "PUT",
|
|
2903
3569
|
url: url_,
|
|
2904
|
-
headers: {
|
|
3570
|
+
headers: {
|
|
3571
|
+
"Content-Type": "application/json",
|
|
3572
|
+
},
|
|
2905
3573
|
cancelToken
|
|
2906
3574
|
};
|
|
2907
3575
|
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
@@ -2914,10 +3582,10 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2914
3582
|
throw _error;
|
|
2915
3583
|
}
|
|
2916
3584
|
}).then((_response) => {
|
|
2917
|
-
return this.transformResult(url_, _response, (_response) => this.
|
|
3585
|
+
return this.transformResult(url_, _response, (_response) => this.processSetVariables(_response));
|
|
2918
3586
|
});
|
|
2919
3587
|
}
|
|
2920
|
-
|
|
3588
|
+
processSetVariables(response) {
|
|
2921
3589
|
const status = response.status;
|
|
2922
3590
|
let _headers = {};
|
|
2923
3591
|
if (response.headers && typeof response.headers === "object") {
|
|
@@ -2938,6 +3606,13 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2938
3606
|
result404 = JSON.parse(resultData404);
|
|
2939
3607
|
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
2940
3608
|
}
|
|
3609
|
+
else if (status === 409) {
|
|
3610
|
+
const _responseText = response.data;
|
|
3611
|
+
let result409 = null;
|
|
3612
|
+
let resultData409 = _responseText;
|
|
3613
|
+
result409 = JSON.parse(resultData409);
|
|
3614
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
3615
|
+
}
|
|
2941
3616
|
else if (status === 401) {
|
|
2942
3617
|
const _responseText = response.data;
|
|
2943
3618
|
return throwException("Unauthorized", status, _responseText, _headers);
|
|
@@ -2953,20 +3628,18 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2953
3628
|
return Promise.resolve(null);
|
|
2954
3629
|
}
|
|
2955
3630
|
/**
|
|
2956
|
-
*
|
|
3631
|
+
* Loads variable data printing information from design file taken from storage.
|
|
2957
3632
|
* @param id Design identifier.
|
|
2958
3633
|
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
2959
3634
|
* @param tenantId (optional) Tenant identifier
|
|
2960
3635
|
* @return Success
|
|
2961
3636
|
*/
|
|
2962
|
-
|
|
2963
|
-
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/
|
|
3637
|
+
loadVdpData(id, privateStorageOwner, tenantId, cancelToken) {
|
|
3638
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/vdp-data?";
|
|
2964
3639
|
if (id === undefined || id === null)
|
|
2965
3640
|
throw new Error("The parameter 'id' must be defined.");
|
|
2966
3641
|
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
2967
|
-
if (privateStorageOwner
|
|
2968
|
-
throw new Error("The parameter 'privateStorageOwner' cannot be null.");
|
|
2969
|
-
else if (privateStorageOwner !== undefined)
|
|
3642
|
+
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
2970
3643
|
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
2971
3644
|
if (tenantId === null)
|
|
2972
3645
|
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
@@ -2991,10 +3664,10 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2991
3664
|
throw _error;
|
|
2992
3665
|
}
|
|
2993
3666
|
}).then((_response) => {
|
|
2994
|
-
return this.transformResult(url_, _response, (_response) => this.
|
|
3667
|
+
return this.transformResult(url_, _response, (_response) => this.processLoadVdpData(_response));
|
|
2995
3668
|
});
|
|
2996
3669
|
}
|
|
2997
|
-
|
|
3670
|
+
processLoadVdpData(response) {
|
|
2998
3671
|
const status = response.status;
|
|
2999
3672
|
let _headers = {};
|
|
3000
3673
|
if (response.headers && typeof response.headers === "object") {
|
|
@@ -3018,6 +3691,13 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3018
3691
|
result404 = JSON.parse(resultData404);
|
|
3019
3692
|
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
3020
3693
|
}
|
|
3694
|
+
else if (status === 409) {
|
|
3695
|
+
const _responseText = response.data;
|
|
3696
|
+
let result409 = null;
|
|
3697
|
+
let resultData409 = _responseText;
|
|
3698
|
+
result409 = JSON.parse(resultData409);
|
|
3699
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
3700
|
+
}
|
|
3021
3701
|
else if (status === 401) {
|
|
3022
3702
|
const _responseText = response.data;
|
|
3023
3703
|
return throwException("Unauthorized", status, _responseText, _headers);
|
|
@@ -3033,32 +3713,32 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3033
3713
|
return Promise.resolve(null);
|
|
3034
3714
|
}
|
|
3035
3715
|
/**
|
|
3036
|
-
*
|
|
3716
|
+
* Saves variable data printing information to design file and updates design in storage.
|
|
3037
3717
|
* @param id Design identifier.
|
|
3038
3718
|
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
3039
3719
|
* @param tenantId (optional) Tenant identifier
|
|
3720
|
+
* @param body (optional) Serialized vdp data.
|
|
3040
3721
|
* @return Success
|
|
3041
3722
|
*/
|
|
3042
|
-
|
|
3043
|
-
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/
|
|
3723
|
+
saveVdpData(id, privateStorageOwner, tenantId, body, cancelToken) {
|
|
3724
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/vdp-data?";
|
|
3044
3725
|
if (id === undefined || id === null)
|
|
3045
3726
|
throw new Error("The parameter 'id' must be defined.");
|
|
3046
3727
|
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
3047
|
-
if (privateStorageOwner
|
|
3048
|
-
throw new Error("The parameter 'privateStorageOwner' cannot be null.");
|
|
3049
|
-
else if (privateStorageOwner !== undefined)
|
|
3728
|
+
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
3050
3729
|
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
3051
3730
|
if (tenantId === null)
|
|
3052
3731
|
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
3053
3732
|
else if (tenantId !== undefined)
|
|
3054
3733
|
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
3055
3734
|
url_ = url_.replace(/[?&]$/, "");
|
|
3735
|
+
const content_ = JSON.stringify(body);
|
|
3056
3736
|
let options_ = {
|
|
3057
|
-
|
|
3058
|
-
method: "
|
|
3737
|
+
data: content_,
|
|
3738
|
+
method: "PUT",
|
|
3059
3739
|
url: url_,
|
|
3060
3740
|
headers: {
|
|
3061
|
-
"
|
|
3741
|
+
"Content-Type": "application/json",
|
|
3062
3742
|
},
|
|
3063
3743
|
cancelToken
|
|
3064
3744
|
};
|
|
@@ -3072,10 +3752,10 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3072
3752
|
throw _error;
|
|
3073
3753
|
}
|
|
3074
3754
|
}).then((_response) => {
|
|
3075
|
-
return this.transformResult(url_, _response, (_response) => this.
|
|
3755
|
+
return this.transformResult(url_, _response, (_response) => this.processSaveVdpData(_response));
|
|
3076
3756
|
});
|
|
3077
3757
|
}
|
|
3078
|
-
|
|
3758
|
+
processSaveVdpData(response) {
|
|
3079
3759
|
const status = response.status;
|
|
3080
3760
|
let _headers = {};
|
|
3081
3761
|
if (response.headers && typeof response.headers === "object") {
|
|
@@ -3085,11 +3765,9 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3085
3765
|
}
|
|
3086
3766
|
}
|
|
3087
3767
|
}
|
|
3088
|
-
if (status === 200
|
|
3089
|
-
const
|
|
3090
|
-
|
|
3091
|
-
const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
|
|
3092
|
-
return Promise.resolve({ fileName: fileName, status: status, data: new Blob([response.data]), headers: _headers });
|
|
3768
|
+
if (status === 200) {
|
|
3769
|
+
const _responseText = response.data;
|
|
3770
|
+
return Promise.resolve(null);
|
|
3093
3771
|
}
|
|
3094
3772
|
else if (status === 404) {
|
|
3095
3773
|
const _responseText = response.data;
|
|
@@ -3098,13 +3776,6 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3098
3776
|
result404 = JSON.parse(resultData404);
|
|
3099
3777
|
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
3100
3778
|
}
|
|
3101
|
-
else if (status === 409) {
|
|
3102
|
-
const _responseText = response.data;
|
|
3103
|
-
let result409 = null;
|
|
3104
|
-
let resultData409 = _responseText;
|
|
3105
|
-
result409 = JSON.parse(resultData409);
|
|
3106
|
-
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
3107
|
-
}
|
|
3108
3779
|
else if (status === 401) {
|
|
3109
3780
|
const _responseText = response.data;
|
|
3110
3781
|
return throwException("Unauthorized", status, _responseText, _headers);
|
|
@@ -3120,20 +3791,18 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3120
3791
|
return Promise.resolve(null);
|
|
3121
3792
|
}
|
|
3122
3793
|
/**
|
|
3123
|
-
*
|
|
3794
|
+
* Deletes variable data printing information from design file and updates design in storage.
|
|
3124
3795
|
* @param id Design identifier.
|
|
3125
3796
|
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
3126
3797
|
* @param tenantId (optional) Tenant identifier
|
|
3127
3798
|
* @return Success
|
|
3128
3799
|
*/
|
|
3129
|
-
|
|
3130
|
-
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/
|
|
3800
|
+
deleteVdpData(id, privateStorageOwner, tenantId, cancelToken) {
|
|
3801
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/vdp-data?";
|
|
3131
3802
|
if (id === undefined || id === null)
|
|
3132
3803
|
throw new Error("The parameter 'id' must be defined.");
|
|
3133
3804
|
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
3134
|
-
if (privateStorageOwner
|
|
3135
|
-
throw new Error("The parameter 'privateStorageOwner' cannot be null.");
|
|
3136
|
-
else if (privateStorageOwner !== undefined)
|
|
3805
|
+
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
3137
3806
|
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
3138
3807
|
if (tenantId === null)
|
|
3139
3808
|
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
@@ -3141,12 +3810,9 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3141
3810
|
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
3142
3811
|
url_ = url_.replace(/[?&]$/, "");
|
|
3143
3812
|
let options_ = {
|
|
3144
|
-
|
|
3145
|
-
method: "GET",
|
|
3813
|
+
method: "DELETE",
|
|
3146
3814
|
url: url_,
|
|
3147
|
-
headers: {
|
|
3148
|
-
"Accept": "application/octet-stream"
|
|
3149
|
-
},
|
|
3815
|
+
headers: {},
|
|
3150
3816
|
cancelToken
|
|
3151
3817
|
};
|
|
3152
3818
|
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
@@ -3159,10 +3825,10 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3159
3825
|
throw _error;
|
|
3160
3826
|
}
|
|
3161
3827
|
}).then((_response) => {
|
|
3162
|
-
return this.transformResult(url_, _response, (_response) => this.
|
|
3828
|
+
return this.transformResult(url_, _response, (_response) => this.processDeleteVdpData(_response));
|
|
3163
3829
|
});
|
|
3164
3830
|
}
|
|
3165
|
-
|
|
3831
|
+
processDeleteVdpData(response) {
|
|
3166
3832
|
const status = response.status;
|
|
3167
3833
|
let _headers = {};
|
|
3168
3834
|
if (response.headers && typeof response.headers === "object") {
|
|
@@ -3172,18 +3838,9 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3172
3838
|
}
|
|
3173
3839
|
}
|
|
3174
3840
|
}
|
|
3175
|
-
if (status === 200
|
|
3176
|
-
const contentDisposition = response.headers ? response.headers["content-disposition"] : undefined;
|
|
3177
|
-
const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
|
|
3178
|
-
const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
|
|
3179
|
-
return Promise.resolve({ fileName: fileName, status: status, data: new Blob([response.data]), headers: _headers });
|
|
3180
|
-
}
|
|
3181
|
-
else if (status === 404) {
|
|
3841
|
+
if (status === 200) {
|
|
3182
3842
|
const _responseText = response.data;
|
|
3183
|
-
|
|
3184
|
-
let resultData404 = _responseText;
|
|
3185
|
-
result404 = JSON.parse(resultData404);
|
|
3186
|
-
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
3843
|
+
return Promise.resolve(null);
|
|
3187
3844
|
}
|
|
3188
3845
|
else if (status === 409) {
|
|
3189
3846
|
const _responseText = response.data;
|
|
@@ -3207,20 +3864,18 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3207
3864
|
return Promise.resolve(null);
|
|
3208
3865
|
}
|
|
3209
3866
|
/**
|
|
3210
|
-
*
|
|
3211
|
-
* @param id
|
|
3867
|
+
* Loads product (design model) from resource file taken from storage.
|
|
3868
|
+
* @param id Resource identifier.
|
|
3212
3869
|
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
3213
3870
|
* @param tenantId (optional) Tenant identifier
|
|
3214
3871
|
* @return Success
|
|
3215
3872
|
*/
|
|
3216
|
-
|
|
3217
|
-
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/
|
|
3873
|
+
loadProductFromResource(id, privateStorageOwner, tenantId, cancelToken) {
|
|
3874
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/from-resource/{id}/model?";
|
|
3218
3875
|
if (id === undefined || id === null)
|
|
3219
3876
|
throw new Error("The parameter 'id' must be defined.");
|
|
3220
3877
|
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
3221
|
-
if (privateStorageOwner
|
|
3222
|
-
throw new Error("The parameter 'privateStorageOwner' cannot be null.");
|
|
3223
|
-
else if (privateStorageOwner !== undefined)
|
|
3878
|
+
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
3224
3879
|
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
3225
3880
|
if (tenantId === null)
|
|
3226
3881
|
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
@@ -3245,10 +3900,10 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3245
3900
|
throw _error;
|
|
3246
3901
|
}
|
|
3247
3902
|
}).then((_response) => {
|
|
3248
|
-
return this.transformResult(url_, _response, (_response) => this.
|
|
3903
|
+
return this.transformResult(url_, _response, (_response) => this.processLoadProductFromResource(_response));
|
|
3249
3904
|
});
|
|
3250
3905
|
}
|
|
3251
|
-
|
|
3906
|
+
processLoadProductFromResource(response) {
|
|
3252
3907
|
const status = response.status;
|
|
3253
3908
|
let _headers = {};
|
|
3254
3909
|
if (response.headers && typeof response.headers === "object") {
|
|
@@ -3272,6 +3927,13 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3272
3927
|
result404 = JSON.parse(resultData404);
|
|
3273
3928
|
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
3274
3929
|
}
|
|
3930
|
+
else if (status === 422) {
|
|
3931
|
+
const _responseText = response.data;
|
|
3932
|
+
let result422 = null;
|
|
3933
|
+
let resultData422 = _responseText;
|
|
3934
|
+
result422 = JSON.parse(resultData422);
|
|
3935
|
+
return throwException("Client Error", status, _responseText, _headers, result422);
|
|
3936
|
+
}
|
|
3275
3937
|
else if (status === 401) {
|
|
3276
3938
|
const _responseText = response.data;
|
|
3277
3939
|
return throwException("Unauthorized", status, _responseText, _headers);
|
|
@@ -3287,22 +3949,13 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3287
3949
|
return Promise.resolve(null);
|
|
3288
3950
|
}
|
|
3289
3951
|
/**
|
|
3290
|
-
*
|
|
3291
|
-
* @param id Design identifier.
|
|
3292
|
-
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
3952
|
+
* Converts colors.
|
|
3293
3953
|
* @param tenantId (optional) Tenant identifier
|
|
3294
|
-
* @param body (optional)
|
|
3954
|
+
* @param body (optional) Convert colors operation parameters.
|
|
3295
3955
|
* @return Success
|
|
3296
3956
|
*/
|
|
3297
|
-
|
|
3298
|
-
let url_ = this.baseUrl + "/api/atoms/v1/designs/
|
|
3299
|
-
if (id === undefined || id === null)
|
|
3300
|
-
throw new Error("The parameter 'id' must be defined.");
|
|
3301
|
-
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
3302
|
-
if (privateStorageOwner === null)
|
|
3303
|
-
throw new Error("The parameter 'privateStorageOwner' cannot be null.");
|
|
3304
|
-
else if (privateStorageOwner !== undefined)
|
|
3305
|
-
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
3957
|
+
convertColors(tenantId, body, cancelToken) {
|
|
3958
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/model/convert-colors?";
|
|
3306
3959
|
if (tenantId === null)
|
|
3307
3960
|
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
3308
3961
|
else if (tenantId !== undefined)
|
|
@@ -3311,10 +3964,11 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3311
3964
|
const content_ = JSON.stringify(body);
|
|
3312
3965
|
let options_ = {
|
|
3313
3966
|
data: content_,
|
|
3314
|
-
method: "
|
|
3967
|
+
method: "POST",
|
|
3315
3968
|
url: url_,
|
|
3316
3969
|
headers: {
|
|
3317
3970
|
"Content-Type": "application/json",
|
|
3971
|
+
"Accept": "application/json"
|
|
3318
3972
|
},
|
|
3319
3973
|
cancelToken
|
|
3320
3974
|
};
|
|
@@ -3328,10 +3982,10 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3328
3982
|
throw _error;
|
|
3329
3983
|
}
|
|
3330
3984
|
}).then((_response) => {
|
|
3331
|
-
return this.transformResult(url_, _response, (_response) => this.
|
|
3985
|
+
return this.transformResult(url_, _response, (_response) => this.processConvertColors(_response));
|
|
3332
3986
|
});
|
|
3333
3987
|
}
|
|
3334
|
-
|
|
3988
|
+
processConvertColors(response) {
|
|
3335
3989
|
const status = response.status;
|
|
3336
3990
|
let _headers = {};
|
|
3337
3991
|
if (response.headers && typeof response.headers === "object") {
|
|
@@ -3343,7 +3997,10 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3343
3997
|
}
|
|
3344
3998
|
if (status === 200) {
|
|
3345
3999
|
const _responseText = response.data;
|
|
3346
|
-
|
|
4000
|
+
let result200 = null;
|
|
4001
|
+
let resultData200 = _responseText;
|
|
4002
|
+
result200 = JSON.parse(resultData200);
|
|
4003
|
+
return Promise.resolve(result200);
|
|
3347
4004
|
}
|
|
3348
4005
|
else if (status === 404) {
|
|
3349
4006
|
const _responseText = response.data;
|
|
@@ -3352,13 +4009,6 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3352
4009
|
result404 = JSON.parse(resultData404);
|
|
3353
4010
|
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
3354
4011
|
}
|
|
3355
|
-
else if (status === 409) {
|
|
3356
|
-
const _responseText = response.data;
|
|
3357
|
-
let result409 = null;
|
|
3358
|
-
let resultData409 = _responseText;
|
|
3359
|
-
result409 = JSON.parse(resultData409);
|
|
3360
|
-
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
3361
|
-
}
|
|
3362
4012
|
else if (status === 401) {
|
|
3363
4013
|
const _responseText = response.data;
|
|
3364
4014
|
return throwException("Unauthorized", status, _responseText, _headers);
|
|
@@ -3374,31 +4024,27 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3374
4024
|
return Promise.resolve(null);
|
|
3375
4025
|
}
|
|
3376
4026
|
/**
|
|
3377
|
-
*
|
|
3378
|
-
* @param id Design identifier.
|
|
3379
|
-
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
4027
|
+
* Extracts product item image.
|
|
3380
4028
|
* @param tenantId (optional) Tenant identifier
|
|
4029
|
+
* @param body (optional) Extraction parameters.
|
|
3381
4030
|
* @return Success
|
|
3382
4031
|
*/
|
|
3383
|
-
|
|
3384
|
-
let url_ = this.baseUrl + "/api/atoms/v1/designs/
|
|
3385
|
-
if (id === undefined || id === null)
|
|
3386
|
-
throw new Error("The parameter 'id' must be defined.");
|
|
3387
|
-
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
3388
|
-
if (privateStorageOwner === null)
|
|
3389
|
-
throw new Error("The parameter 'privateStorageOwner' cannot be null.");
|
|
3390
|
-
else if (privateStorageOwner !== undefined)
|
|
3391
|
-
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
4032
|
+
extractItemImage(tenantId, body, cancelToken) {
|
|
4033
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/model/items/extract-image?";
|
|
3392
4034
|
if (tenantId === null)
|
|
3393
4035
|
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
3394
4036
|
else if (tenantId !== undefined)
|
|
3395
4037
|
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
3396
4038
|
url_ = url_.replace(/[?&]$/, "");
|
|
4039
|
+
const content_ = JSON.stringify(body);
|
|
3397
4040
|
let options_ = {
|
|
3398
|
-
|
|
4041
|
+
data: content_,
|
|
4042
|
+
responseType: "blob",
|
|
4043
|
+
method: "POST",
|
|
3399
4044
|
url: url_,
|
|
3400
4045
|
headers: {
|
|
3401
|
-
"
|
|
4046
|
+
"Content-Type": "application/json",
|
|
4047
|
+
"Accept": "application/octet-stream"
|
|
3402
4048
|
},
|
|
3403
4049
|
cancelToken
|
|
3404
4050
|
};
|
|
@@ -3412,10 +4058,10 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3412
4058
|
throw _error;
|
|
3413
4059
|
}
|
|
3414
4060
|
}).then((_response) => {
|
|
3415
|
-
return this.transformResult(url_, _response, (_response) => this.
|
|
4061
|
+
return this.transformResult(url_, _response, (_response) => this.processExtractItemImage(_response));
|
|
3416
4062
|
});
|
|
3417
4063
|
}
|
|
3418
|
-
|
|
4064
|
+
processExtractItemImage(response) {
|
|
3419
4065
|
const status = response.status;
|
|
3420
4066
|
let _headers = {};
|
|
3421
4067
|
if (response.headers && typeof response.headers === "object") {
|
|
@@ -3425,26 +4071,11 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3425
4071
|
}
|
|
3426
4072
|
}
|
|
3427
4073
|
}
|
|
3428
|
-
if (status === 200) {
|
|
3429
|
-
const
|
|
3430
|
-
|
|
3431
|
-
|
|
3432
|
-
|
|
3433
|
-
return Promise.resolve(result200);
|
|
3434
|
-
}
|
|
3435
|
-
else if (status === 404) {
|
|
3436
|
-
const _responseText = response.data;
|
|
3437
|
-
let result404 = null;
|
|
3438
|
-
let resultData404 = _responseText;
|
|
3439
|
-
result404 = JSON.parse(resultData404);
|
|
3440
|
-
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
3441
|
-
}
|
|
3442
|
-
else if (status === 409) {
|
|
3443
|
-
const _responseText = response.data;
|
|
3444
|
-
let result409 = null;
|
|
3445
|
-
let resultData409 = _responseText;
|
|
3446
|
-
result409 = JSON.parse(resultData409);
|
|
3447
|
-
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
4074
|
+
if (status === 200 || status === 206) {
|
|
4075
|
+
const contentDisposition = response.headers ? response.headers["content-disposition"] : undefined;
|
|
4076
|
+
const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
|
|
4077
|
+
const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
|
|
4078
|
+
return Promise.resolve({ fileName: fileName, status: status, data: new Blob([response.data]), headers: _headers });
|
|
3448
4079
|
}
|
|
3449
4080
|
else if (status === 401) {
|
|
3450
4081
|
const _responseText = response.data;
|
|
@@ -3461,22 +4092,13 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3461
4092
|
return Promise.resolve(null);
|
|
3462
4093
|
}
|
|
3463
4094
|
/**
|
|
3464
|
-
*
|
|
3465
|
-
* @param id Design identifier.
|
|
3466
|
-
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
4095
|
+
* Flatten items.
|
|
3467
4096
|
* @param tenantId (optional) Tenant identifier
|
|
3468
|
-
* @param body (optional)
|
|
4097
|
+
* @param body (optional) Items to flatten.
|
|
3469
4098
|
* @return Success
|
|
3470
|
-
*/
|
|
3471
|
-
|
|
3472
|
-
let url_ = this.baseUrl + "/api/atoms/v1/designs/
|
|
3473
|
-
if (id === undefined || id === null)
|
|
3474
|
-
throw new Error("The parameter 'id' must be defined.");
|
|
3475
|
-
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
3476
|
-
if (privateStorageOwner === null)
|
|
3477
|
-
throw new Error("The parameter 'privateStorageOwner' cannot be null.");
|
|
3478
|
-
else if (privateStorageOwner !== undefined)
|
|
3479
|
-
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
4099
|
+
*/
|
|
4100
|
+
flattenItems(tenantId, body, cancelToken) {
|
|
4101
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/model/items/flatten?";
|
|
3480
4102
|
if (tenantId === null)
|
|
3481
4103
|
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
3482
4104
|
else if (tenantId !== undefined)
|
|
@@ -3485,10 +4107,11 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3485
4107
|
const content_ = JSON.stringify(body);
|
|
3486
4108
|
let options_ = {
|
|
3487
4109
|
data: content_,
|
|
3488
|
-
method: "
|
|
4110
|
+
method: "POST",
|
|
3489
4111
|
url: url_,
|
|
3490
4112
|
headers: {
|
|
3491
4113
|
"Content-Type": "application/json",
|
|
4114
|
+
"Accept": "application/json"
|
|
3492
4115
|
},
|
|
3493
4116
|
cancelToken
|
|
3494
4117
|
};
|
|
@@ -3502,10 +4125,10 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3502
4125
|
throw _error;
|
|
3503
4126
|
}
|
|
3504
4127
|
}).then((_response) => {
|
|
3505
|
-
return this.transformResult(url_, _response, (_response) => this.
|
|
4128
|
+
return this.transformResult(url_, _response, (_response) => this.processFlattenItems(_response));
|
|
3506
4129
|
});
|
|
3507
4130
|
}
|
|
3508
|
-
|
|
4131
|
+
processFlattenItems(response) {
|
|
3509
4132
|
const status = response.status;
|
|
3510
4133
|
let _headers = {};
|
|
3511
4134
|
if (response.headers && typeof response.headers === "object") {
|
|
@@ -3517,14 +4140,10 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3517
4140
|
}
|
|
3518
4141
|
if (status === 200) {
|
|
3519
4142
|
const _responseText = response.data;
|
|
3520
|
-
|
|
3521
|
-
|
|
3522
|
-
|
|
3523
|
-
|
|
3524
|
-
let result404 = null;
|
|
3525
|
-
let resultData404 = _responseText;
|
|
3526
|
-
result404 = JSON.parse(resultData404);
|
|
3527
|
-
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
4143
|
+
let result200 = null;
|
|
4144
|
+
let resultData200 = _responseText;
|
|
4145
|
+
result200 = JSON.parse(resultData200);
|
|
4146
|
+
return Promise.resolve(result200);
|
|
3528
4147
|
}
|
|
3529
4148
|
else if (status === 401) {
|
|
3530
4149
|
const _responseText = response.data;
|
|
@@ -3541,30 +4160,31 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3541
4160
|
return Promise.resolve(null);
|
|
3542
4161
|
}
|
|
3543
4162
|
/**
|
|
3544
|
-
*
|
|
3545
|
-
* @param
|
|
3546
|
-
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
4163
|
+
* Creates product item from input image file.
|
|
4164
|
+
* @param itemType (optional) Desired item type.
|
|
3547
4165
|
* @param tenantId (optional) Tenant identifier
|
|
4166
|
+
* @param sourceFile (optional)
|
|
3548
4167
|
* @return Success
|
|
3549
4168
|
*/
|
|
3550
|
-
|
|
3551
|
-
let url_ = this.baseUrl + "/api/atoms/v1/designs/
|
|
3552
|
-
if (
|
|
3553
|
-
|
|
3554
|
-
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
3555
|
-
if (privateStorageOwner === null)
|
|
3556
|
-
throw new Error("The parameter 'privateStorageOwner' cannot be null.");
|
|
3557
|
-
else if (privateStorageOwner !== undefined)
|
|
3558
|
-
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
4169
|
+
createItemFromFile(itemType, tenantId, sourceFile, cancelToken) {
|
|
4170
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/model/items/from-file?";
|
|
4171
|
+
if (itemType !== undefined && itemType !== null)
|
|
4172
|
+
url_ += "itemType=" + encodeURIComponent("" + itemType) + "&";
|
|
3559
4173
|
if (tenantId === null)
|
|
3560
4174
|
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
3561
4175
|
else if (tenantId !== undefined)
|
|
3562
4176
|
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
3563
4177
|
url_ = url_.replace(/[?&]$/, "");
|
|
4178
|
+
const content_ = new FormData();
|
|
4179
|
+
if (sourceFile !== null && sourceFile !== undefined)
|
|
4180
|
+
content_.append("sourceFile", sourceFile.data, sourceFile.fileName ? sourceFile.fileName : "sourceFile");
|
|
3564
4181
|
let options_ = {
|
|
3565
|
-
|
|
4182
|
+
data: content_,
|
|
4183
|
+
method: "POST",
|
|
3566
4184
|
url: url_,
|
|
3567
|
-
headers: {
|
|
4185
|
+
headers: {
|
|
4186
|
+
"Accept": "application/json"
|
|
4187
|
+
},
|
|
3568
4188
|
cancelToken
|
|
3569
4189
|
};
|
|
3570
4190
|
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
@@ -3577,10 +4197,10 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3577
4197
|
throw _error;
|
|
3578
4198
|
}
|
|
3579
4199
|
}).then((_response) => {
|
|
3580
|
-
return this.transformResult(url_, _response, (_response) => this.
|
|
4200
|
+
return this.transformResult(url_, _response, (_response) => this.processCreateItemFromFile(_response));
|
|
3581
4201
|
});
|
|
3582
4202
|
}
|
|
3583
|
-
|
|
4203
|
+
processCreateItemFromFile(response) {
|
|
3584
4204
|
const status = response.status;
|
|
3585
4205
|
let _headers = {};
|
|
3586
4206
|
if (response.headers && typeof response.headers === "object") {
|
|
@@ -3592,14 +4212,17 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3592
4212
|
}
|
|
3593
4213
|
if (status === 200) {
|
|
3594
4214
|
const _responseText = response.data;
|
|
3595
|
-
|
|
4215
|
+
let result200 = null;
|
|
4216
|
+
let resultData200 = _responseText;
|
|
4217
|
+
result200 = JSON.parse(resultData200);
|
|
4218
|
+
return Promise.resolve(result200);
|
|
3596
4219
|
}
|
|
3597
|
-
else if (status ===
|
|
4220
|
+
else if (status === 404) {
|
|
3598
4221
|
const _responseText = response.data;
|
|
3599
|
-
let
|
|
3600
|
-
let
|
|
3601
|
-
|
|
3602
|
-
return throwException("
|
|
4222
|
+
let result404 = null;
|
|
4223
|
+
let resultData404 = _responseText;
|
|
4224
|
+
result404 = JSON.parse(resultData404);
|
|
4225
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
3603
4226
|
}
|
|
3604
4227
|
else if (status === 401) {
|
|
3605
4228
|
const _responseText = response.data;
|
|
@@ -3616,28 +4239,27 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3616
4239
|
return Promise.resolve(null);
|
|
3617
4240
|
}
|
|
3618
4241
|
/**
|
|
3619
|
-
*
|
|
3620
|
-
* @param
|
|
3621
|
-
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
4242
|
+
* Creates multiple product items from input image files.
|
|
4243
|
+
* @param itemType (optional) Desired items type.
|
|
3622
4244
|
* @param tenantId (optional) Tenant identifier
|
|
4245
|
+
* @param sourceFiles (optional)
|
|
3623
4246
|
* @return Success
|
|
3624
4247
|
*/
|
|
3625
|
-
|
|
3626
|
-
let url_ = this.baseUrl + "/api/atoms/v1/designs/from-
|
|
3627
|
-
if (
|
|
3628
|
-
|
|
3629
|
-
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
3630
|
-
if (privateStorageOwner === null)
|
|
3631
|
-
throw new Error("The parameter 'privateStorageOwner' cannot be null.");
|
|
3632
|
-
else if (privateStorageOwner !== undefined)
|
|
3633
|
-
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
4248
|
+
batchCreateItemsFromFile(itemType, tenantId, sourceFiles, cancelToken) {
|
|
4249
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/model/items/from-file/batch-create?";
|
|
4250
|
+
if (itemType !== undefined && itemType !== null)
|
|
4251
|
+
url_ += "itemType=" + encodeURIComponent("" + itemType) + "&";
|
|
3634
4252
|
if (tenantId === null)
|
|
3635
4253
|
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
3636
4254
|
else if (tenantId !== undefined)
|
|
3637
4255
|
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
3638
4256
|
url_ = url_.replace(/[?&]$/, "");
|
|
4257
|
+
const content_ = new FormData();
|
|
4258
|
+
if (sourceFiles !== null && sourceFiles !== undefined)
|
|
4259
|
+
sourceFiles.forEach(item_ => content_.append("sourceFiles", item_.data, item_.fileName ? item_.fileName : "sourceFiles"));
|
|
3639
4260
|
let options_ = {
|
|
3640
|
-
|
|
4261
|
+
data: content_,
|
|
4262
|
+
method: "POST",
|
|
3641
4263
|
url: url_,
|
|
3642
4264
|
headers: {
|
|
3643
4265
|
"Accept": "application/json"
|
|
@@ -3654,10 +4276,10 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3654
4276
|
throw _error;
|
|
3655
4277
|
}
|
|
3656
4278
|
}).then((_response) => {
|
|
3657
|
-
return this.transformResult(url_, _response, (_response) => this.
|
|
4279
|
+
return this.transformResult(url_, _response, (_response) => this.processBatchCreateItemsFromFile(_response));
|
|
3658
4280
|
});
|
|
3659
4281
|
}
|
|
3660
|
-
|
|
4282
|
+
processBatchCreateItemsFromFile(response) {
|
|
3661
4283
|
const status = response.status;
|
|
3662
4284
|
let _headers = {};
|
|
3663
4285
|
if (response.headers && typeof response.headers === "object") {
|
|
@@ -3681,13 +4303,6 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3681
4303
|
result404 = JSON.parse(resultData404);
|
|
3682
4304
|
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
3683
4305
|
}
|
|
3684
|
-
else if (status === 422) {
|
|
3685
|
-
const _responseText = response.data;
|
|
3686
|
-
let result422 = null;
|
|
3687
|
-
let resultData422 = _responseText;
|
|
3688
|
-
result422 = JSON.parse(resultData422);
|
|
3689
|
-
return throwException("Client Error", status, _responseText, _headers, result422);
|
|
3690
|
-
}
|
|
3691
4306
|
else if (status === 401) {
|
|
3692
4307
|
const _responseText = response.data;
|
|
3693
4308
|
return throwException("Unauthorized", status, _responseText, _headers);
|
|
@@ -3703,13 +4318,16 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3703
4318
|
return Promise.resolve(null);
|
|
3704
4319
|
}
|
|
3705
4320
|
/**
|
|
3706
|
-
*
|
|
4321
|
+
* Creates product item from image in storage.
|
|
4322
|
+
* @param itemType (optional) Desired item type.
|
|
3707
4323
|
* @param tenantId (optional) Tenant identifier
|
|
3708
|
-
* @param body (optional)
|
|
4324
|
+
* @param body (optional) Operation parameters.
|
|
3709
4325
|
* @return Success
|
|
3710
4326
|
*/
|
|
3711
|
-
|
|
3712
|
-
let url_ = this.baseUrl + "/api/atoms/v1/designs/model/
|
|
4327
|
+
createItemFromStorage(itemType, tenantId, body, cancelToken) {
|
|
4328
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/model/items/from-storage?";
|
|
4329
|
+
if (itemType !== undefined && itemType !== null)
|
|
4330
|
+
url_ += "itemType=" + encodeURIComponent("" + itemType) + "&";
|
|
3713
4331
|
if (tenantId === null)
|
|
3714
4332
|
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
3715
4333
|
else if (tenantId !== undefined)
|
|
@@ -3736,10 +4354,10 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3736
4354
|
throw _error;
|
|
3737
4355
|
}
|
|
3738
4356
|
}).then((_response) => {
|
|
3739
|
-
return this.transformResult(url_, _response, (_response) => this.
|
|
4357
|
+
return this.transformResult(url_, _response, (_response) => this.processCreateItemFromStorage(_response));
|
|
3740
4358
|
});
|
|
3741
4359
|
}
|
|
3742
|
-
|
|
4360
|
+
processCreateItemFromStorage(response) {
|
|
3743
4361
|
const status = response.status;
|
|
3744
4362
|
let _headers = {};
|
|
3745
4363
|
if (response.headers && typeof response.headers === "object") {
|
|
@@ -3778,40 +4396,28 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3778
4396
|
return Promise.resolve(null);
|
|
3779
4397
|
}
|
|
3780
4398
|
/**
|
|
3781
|
-
* Creates product
|
|
3782
|
-
* @param itemType (optional) Desired
|
|
4399
|
+
* Creates multiple product items from images in storage.
|
|
4400
|
+
* @param itemType (optional) Desired items type.
|
|
3783
4401
|
* @param tenantId (optional) Tenant identifier
|
|
3784
|
-
* @param
|
|
3785
|
-
* @param sourceId (optional)
|
|
3786
|
-
* @param sourceOwnerId (optional)
|
|
3787
|
-
* @param sourceFile (optional)
|
|
4402
|
+
* @param body (optional) Create items operation parameters.
|
|
3788
4403
|
* @return Success
|
|
3789
4404
|
*/
|
|
3790
|
-
|
|
3791
|
-
let url_ = this.baseUrl + "/api/atoms/v1/designs/model/items?";
|
|
3792
|
-
if (itemType
|
|
3793
|
-
throw new Error("The parameter 'itemType' cannot be null.");
|
|
3794
|
-
else if (itemType !== undefined)
|
|
4405
|
+
batchCreateItemsFromStorage(itemType, tenantId, body, cancelToken) {
|
|
4406
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/model/items/from-storage/batch-create?";
|
|
4407
|
+
if (itemType !== undefined && itemType !== null)
|
|
3795
4408
|
url_ += "itemType=" + encodeURIComponent("" + itemType) + "&";
|
|
3796
4409
|
if (tenantId === null)
|
|
3797
4410
|
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
3798
4411
|
else if (tenantId !== undefined)
|
|
3799
4412
|
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
3800
4413
|
url_ = url_.replace(/[?&]$/, "");
|
|
3801
|
-
const content_ =
|
|
3802
|
-
if (sourceType !== null && sourceType !== undefined)
|
|
3803
|
-
content_.append("sourceType", sourceType.toString());
|
|
3804
|
-
if (sourceId !== null && sourceId !== undefined)
|
|
3805
|
-
content_.append("sourceId", sourceId.toString());
|
|
3806
|
-
if (sourceOwnerId !== null && sourceOwnerId !== undefined)
|
|
3807
|
-
content_.append("sourceOwnerId", sourceOwnerId.toString());
|
|
3808
|
-
if (sourceFile !== null && sourceFile !== undefined)
|
|
3809
|
-
content_.append("sourceFile", sourceFile.data, sourceFile.fileName ? sourceFile.fileName : "sourceFile");
|
|
4414
|
+
const content_ = JSON.stringify(body);
|
|
3810
4415
|
let options_ = {
|
|
3811
4416
|
data: content_,
|
|
3812
4417
|
method: "POST",
|
|
3813
4418
|
url: url_,
|
|
3814
4419
|
headers: {
|
|
4420
|
+
"Content-Type": "application/json",
|
|
3815
4421
|
"Accept": "application/json"
|
|
3816
4422
|
},
|
|
3817
4423
|
cancelToken
|
|
@@ -3826,10 +4432,10 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3826
4432
|
throw _error;
|
|
3827
4433
|
}
|
|
3828
4434
|
}).then((_response) => {
|
|
3829
|
-
return this.transformResult(url_, _response, (_response) => this.
|
|
4435
|
+
return this.transformResult(url_, _response, (_response) => this.processBatchCreateItemsFromStorage(_response));
|
|
3830
4436
|
});
|
|
3831
4437
|
}
|
|
3832
|
-
|
|
4438
|
+
processBatchCreateItemsFromStorage(response) {
|
|
3833
4439
|
const status = response.status;
|
|
3834
4440
|
let _headers = {};
|
|
3835
4441
|
if (response.headers && typeof response.headers === "object") {
|
|
@@ -3868,13 +4474,16 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3868
4474
|
return Promise.resolve(null);
|
|
3869
4475
|
}
|
|
3870
4476
|
/**
|
|
3871
|
-
*
|
|
4477
|
+
* Creates product item from remote web image provided by URL.
|
|
4478
|
+
* @param itemType (optional) Desired item type.
|
|
3872
4479
|
* @param tenantId (optional) Tenant identifier
|
|
3873
|
-
* @param body (optional)
|
|
4480
|
+
* @param body (optional) Operation parameters.
|
|
3874
4481
|
* @return Success
|
|
3875
4482
|
*/
|
|
3876
|
-
|
|
3877
|
-
let url_ = this.baseUrl + "/api/atoms/v1/designs/model/items/
|
|
4483
|
+
createItemFromUrl(itemType, tenantId, body, cancelToken) {
|
|
4484
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/model/items/from-url?";
|
|
4485
|
+
if (itemType !== undefined && itemType !== null)
|
|
4486
|
+
url_ += "itemType=" + encodeURIComponent("" + itemType) + "&";
|
|
3878
4487
|
if (tenantId === null)
|
|
3879
4488
|
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
3880
4489
|
else if (tenantId !== undefined)
|
|
@@ -3883,12 +4492,11 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3883
4492
|
const content_ = JSON.stringify(body);
|
|
3884
4493
|
let options_ = {
|
|
3885
4494
|
data: content_,
|
|
3886
|
-
responseType: "blob",
|
|
3887
4495
|
method: "POST",
|
|
3888
4496
|
url: url_,
|
|
3889
4497
|
headers: {
|
|
3890
4498
|
"Content-Type": "application/json",
|
|
3891
|
-
"Accept": "application/
|
|
4499
|
+
"Accept": "application/json"
|
|
3892
4500
|
},
|
|
3893
4501
|
cancelToken
|
|
3894
4502
|
};
|
|
@@ -3902,10 +4510,10 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3902
4510
|
throw _error;
|
|
3903
4511
|
}
|
|
3904
4512
|
}).then((_response) => {
|
|
3905
|
-
return this.transformResult(url_, _response, (_response) => this.
|
|
4513
|
+
return this.transformResult(url_, _response, (_response) => this.processCreateItemFromUrl(_response));
|
|
3906
4514
|
});
|
|
3907
4515
|
}
|
|
3908
|
-
|
|
4516
|
+
processCreateItemFromUrl(response) {
|
|
3909
4517
|
const status = response.status;
|
|
3910
4518
|
let _headers = {};
|
|
3911
4519
|
if (response.headers && typeof response.headers === "object") {
|
|
@@ -3915,11 +4523,19 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3915
4523
|
}
|
|
3916
4524
|
}
|
|
3917
4525
|
}
|
|
3918
|
-
if (status === 200
|
|
3919
|
-
const
|
|
3920
|
-
|
|
3921
|
-
|
|
3922
|
-
|
|
4526
|
+
if (status === 200) {
|
|
4527
|
+
const _responseText = response.data;
|
|
4528
|
+
let result200 = null;
|
|
4529
|
+
let resultData200 = _responseText;
|
|
4530
|
+
result200 = JSON.parse(resultData200);
|
|
4531
|
+
return Promise.resolve(result200);
|
|
4532
|
+
}
|
|
4533
|
+
else if (status === 404) {
|
|
4534
|
+
const _responseText = response.data;
|
|
4535
|
+
let result404 = null;
|
|
4536
|
+
let resultData404 = _responseText;
|
|
4537
|
+
result404 = JSON.parse(resultData404);
|
|
4538
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
3923
4539
|
}
|
|
3924
4540
|
else if (status === 401) {
|
|
3925
4541
|
const _responseText = response.data;
|
|
@@ -3936,13 +4552,16 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3936
4552
|
return Promise.resolve(null);
|
|
3937
4553
|
}
|
|
3938
4554
|
/**
|
|
3939
|
-
*
|
|
4555
|
+
* Creates multiple product items from remote web images provided by URLs list.
|
|
4556
|
+
* @param itemType (optional) Desired items type.
|
|
3940
4557
|
* @param tenantId (optional) Tenant identifier
|
|
3941
|
-
* @param body (optional)
|
|
4558
|
+
* @param body (optional) Operation parameters.
|
|
3942
4559
|
* @return Success
|
|
3943
4560
|
*/
|
|
3944
|
-
|
|
3945
|
-
let url_ = this.baseUrl + "/api/atoms/v1/designs/model/items/
|
|
4561
|
+
batchCreateItemsFromUrl(itemType, tenantId, body, cancelToken) {
|
|
4562
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/model/items/from-url/batch-create?";
|
|
4563
|
+
if (itemType !== undefined && itemType !== null)
|
|
4564
|
+
url_ += "itemType=" + encodeURIComponent("" + itemType) + "&";
|
|
3946
4565
|
if (tenantId === null)
|
|
3947
4566
|
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
3948
4567
|
else if (tenantId !== undefined)
|
|
@@ -3969,10 +4588,10 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3969
4588
|
throw _error;
|
|
3970
4589
|
}
|
|
3971
4590
|
}).then((_response) => {
|
|
3972
|
-
return this.transformResult(url_, _response, (_response) => this.
|
|
4591
|
+
return this.transformResult(url_, _response, (_response) => this.processBatchCreateItemsFromUrl(_response));
|
|
3973
4592
|
});
|
|
3974
4593
|
}
|
|
3975
|
-
|
|
4594
|
+
processBatchCreateItemsFromUrl(response) {
|
|
3976
4595
|
const status = response.status;
|
|
3977
4596
|
let _headers = {};
|
|
3978
4597
|
if (response.headers && typeof response.headers === "object") {
|
|
@@ -3989,6 +4608,13 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3989
4608
|
result200 = JSON.parse(resultData200);
|
|
3990
4609
|
return Promise.resolve(result200);
|
|
3991
4610
|
}
|
|
4611
|
+
else if (status === 404) {
|
|
4612
|
+
const _responseText = response.data;
|
|
4613
|
+
let result404 = null;
|
|
4614
|
+
let resultData404 = _responseText;
|
|
4615
|
+
result404 = JSON.parse(resultData404);
|
|
4616
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
4617
|
+
}
|
|
3992
4618
|
else if (status === 401) {
|
|
3993
4619
|
const _responseText = response.data;
|
|
3994
4620
|
return throwException("Unauthorized", status, _responseText, _headers);
|
|
@@ -4013,9 +4639,7 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
4013
4639
|
*/
|
|
4014
4640
|
renderProduct(attachment, tenantId, body, cancelToken) {
|
|
4015
4641
|
let url_ = this.baseUrl + "/api/atoms/v1/designs/model/render-proof?";
|
|
4016
|
-
if (attachment
|
|
4017
|
-
throw new Error("The parameter 'attachment' cannot be null.");
|
|
4018
|
-
else if (attachment !== undefined)
|
|
4642
|
+
if (attachment !== undefined && attachment !== null)
|
|
4019
4643
|
url_ += "attachment=" + encodeURIComponent("" + attachment) + "&";
|
|
4020
4644
|
if (tenantId === null)
|
|
4021
4645
|
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
@@ -4087,9 +4711,7 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
4087
4711
|
*/
|
|
4088
4712
|
renderDesignPreview(attachment, tenantId, body, cancelToken) {
|
|
4089
4713
|
let url_ = this.baseUrl + "/api/atoms/v1/designs/render-preview?";
|
|
4090
|
-
if (attachment
|
|
4091
|
-
throw new Error("The parameter 'attachment' cannot be null.");
|
|
4092
|
-
else if (attachment !== undefined)
|
|
4714
|
+
if (attachment !== undefined && attachment !== null)
|
|
4093
4715
|
url_ += "attachment=" + encodeURIComponent("" + attachment) + "&";
|
|
4094
4716
|
if (tenantId === null)
|
|
4095
4717
|
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
@@ -4205,6 +4827,13 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
4205
4827
|
result200 = JSON.parse(resultData200);
|
|
4206
4828
|
return Promise.resolve(result200);
|
|
4207
4829
|
}
|
|
4830
|
+
else if (status === 409) {
|
|
4831
|
+
const _responseText = response.data;
|
|
4832
|
+
let result409 = null;
|
|
4833
|
+
let resultData409 = _responseText;
|
|
4834
|
+
result409 = JSON.parse(resultData409);
|
|
4835
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
4836
|
+
}
|
|
4208
4837
|
else if (status === 401) {
|
|
4209
4838
|
const _responseText = response.data;
|
|
4210
4839
|
return throwException("Unauthorized", status, _responseText, _headers);
|
|
@@ -4229,9 +4858,7 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
4229
4858
|
*/
|
|
4230
4859
|
renderDesignProof(attachment, tenantId, body, cancelToken) {
|
|
4231
4860
|
let url_ = this.baseUrl + "/api/atoms/v1/designs/render-proof?";
|
|
4232
|
-
if (attachment
|
|
4233
|
-
throw new Error("The parameter 'attachment' cannot be null.");
|
|
4234
|
-
else if (attachment !== undefined)
|
|
4861
|
+
if (attachment !== undefined && attachment !== null)
|
|
4235
4862
|
url_ += "attachment=" + encodeURIComponent("" + attachment) + "&";
|
|
4236
4863
|
if (tenantId === null)
|
|
4237
4864
|
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
@@ -4347,6 +4974,105 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
4347
4974
|
result200 = JSON.parse(resultData200);
|
|
4348
4975
|
return Promise.resolve(result200);
|
|
4349
4976
|
}
|
|
4977
|
+
else if (status === 409) {
|
|
4978
|
+
const _responseText = response.data;
|
|
4979
|
+
let result409 = null;
|
|
4980
|
+
let resultData409 = _responseText;
|
|
4981
|
+
result409 = JSON.parse(resultData409);
|
|
4982
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
4983
|
+
}
|
|
4984
|
+
else if (status === 401) {
|
|
4985
|
+
const _responseText = response.data;
|
|
4986
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
4987
|
+
}
|
|
4988
|
+
else if (status === 403) {
|
|
4989
|
+
const _responseText = response.data;
|
|
4990
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
4991
|
+
}
|
|
4992
|
+
else if (status !== 200 && status !== 204) {
|
|
4993
|
+
const _responseText = response.data;
|
|
4994
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
4995
|
+
}
|
|
4996
|
+
return Promise.resolve(null);
|
|
4997
|
+
}
|
|
4998
|
+
/**
|
|
4999
|
+
* Creates product item.
|
|
5000
|
+
* @param itemType (optional) Desired item type.
|
|
5001
|
+
* @param tenantId (optional) Tenant identifier
|
|
5002
|
+
* @param sourceType (optional)
|
|
5003
|
+
* @param sourceId (optional)
|
|
5004
|
+
* @param sourceOwnerId (optional)
|
|
5005
|
+
* @param url (optional)
|
|
5006
|
+
* @param sourceFile (optional)
|
|
5007
|
+
* @return Success
|
|
5008
|
+
* @deprecated
|
|
5009
|
+
*/
|
|
5010
|
+
createItem(itemType, tenantId, sourceType, sourceId, sourceOwnerId, url, sourceFile, cancelToken) {
|
|
5011
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/model/items?";
|
|
5012
|
+
if (itemType !== undefined && itemType !== null)
|
|
5013
|
+
url_ += "itemType=" + encodeURIComponent("" + itemType) + "&";
|
|
5014
|
+
if (tenantId === null)
|
|
5015
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
5016
|
+
else if (tenantId !== undefined)
|
|
5017
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
5018
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
5019
|
+
const content_ = new FormData();
|
|
5020
|
+
if (sourceType !== null && sourceType !== undefined)
|
|
5021
|
+
content_.append("sourceType", sourceType.toString());
|
|
5022
|
+
if (sourceId !== null && sourceId !== undefined)
|
|
5023
|
+
content_.append("sourceId", sourceId.toString());
|
|
5024
|
+
if (sourceOwnerId !== null && sourceOwnerId !== undefined)
|
|
5025
|
+
content_.append("sourceOwnerId", sourceOwnerId.toString());
|
|
5026
|
+
if (url !== null && url !== undefined)
|
|
5027
|
+
content_.append("url", url.toString());
|
|
5028
|
+
if (sourceFile !== null && sourceFile !== undefined)
|
|
5029
|
+
content_.append("sourceFile", sourceFile.data, sourceFile.fileName ? sourceFile.fileName : "sourceFile");
|
|
5030
|
+
let options_ = {
|
|
5031
|
+
data: content_,
|
|
5032
|
+
method: "POST",
|
|
5033
|
+
url: url_,
|
|
5034
|
+
headers: {
|
|
5035
|
+
"Accept": "application/json"
|
|
5036
|
+
},
|
|
5037
|
+
cancelToken
|
|
5038
|
+
};
|
|
5039
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
5040
|
+
return this.instance.request(transformedOptions_);
|
|
5041
|
+
}).catch((_error) => {
|
|
5042
|
+
if (isAxiosError(_error) && _error.response) {
|
|
5043
|
+
return _error.response;
|
|
5044
|
+
}
|
|
5045
|
+
else {
|
|
5046
|
+
throw _error;
|
|
5047
|
+
}
|
|
5048
|
+
}).then((_response) => {
|
|
5049
|
+
return this.transformResult(url_, _response, (_response) => this.processCreateItem(_response));
|
|
5050
|
+
});
|
|
5051
|
+
}
|
|
5052
|
+
processCreateItem(response) {
|
|
5053
|
+
const status = response.status;
|
|
5054
|
+
let _headers = {};
|
|
5055
|
+
if (response.headers && typeof response.headers === "object") {
|
|
5056
|
+
for (let k in response.headers) {
|
|
5057
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
5058
|
+
_headers[k] = response.headers[k];
|
|
5059
|
+
}
|
|
5060
|
+
}
|
|
5061
|
+
}
|
|
5062
|
+
if (status === 200) {
|
|
5063
|
+
const _responseText = response.data;
|
|
5064
|
+
let result200 = null;
|
|
5065
|
+
let resultData200 = _responseText;
|
|
5066
|
+
result200 = JSON.parse(resultData200);
|
|
5067
|
+
return Promise.resolve(result200);
|
|
5068
|
+
}
|
|
5069
|
+
else if (status === 404) {
|
|
5070
|
+
const _responseText = response.data;
|
|
5071
|
+
let result404 = null;
|
|
5072
|
+
let resultData404 = _responseText;
|
|
5073
|
+
result404 = JSON.parse(resultData404);
|
|
5074
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
5075
|
+
}
|
|
4350
5076
|
else if (status === 401) {
|
|
4351
5077
|
const _responseText = response.data;
|
|
4352
5078
|
return throwException("Unauthorized", status, _responseText, _headers);
|
|
@@ -4372,17 +5098,11 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
4372
5098
|
*/
|
|
4373
5099
|
createPrivateDesignFromDesign(designId, privateDesignId, privateStorageOwner, tenantId, cancelToken) {
|
|
4374
5100
|
let url_ = this.baseUrl + "/api/atoms/v1/private-designs/from-design?";
|
|
4375
|
-
if (designId
|
|
4376
|
-
throw new Error("The parameter 'designId' cannot be null.");
|
|
4377
|
-
else if (designId !== undefined)
|
|
5101
|
+
if (designId !== undefined && designId !== null)
|
|
4378
5102
|
url_ += "designId=" + encodeURIComponent("" + designId) + "&";
|
|
4379
|
-
if (privateDesignId
|
|
4380
|
-
throw new Error("The parameter 'privateDesignId' cannot be null.");
|
|
4381
|
-
else if (privateDesignId !== undefined)
|
|
5103
|
+
if (privateDesignId !== undefined && privateDesignId !== null)
|
|
4382
5104
|
url_ += "privateDesignId=" + encodeURIComponent("" + privateDesignId) + "&";
|
|
4383
|
-
if (privateStorageOwner
|
|
4384
|
-
throw new Error("The parameter 'privateStorageOwner' cannot be null.");
|
|
4385
|
-
else if (privateStorageOwner !== undefined)
|
|
5105
|
+
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
4386
5106
|
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
4387
5107
|
if (tenantId === null)
|
|
4388
5108
|
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
@@ -4447,17 +5167,11 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
4447
5167
|
*/
|
|
4448
5168
|
createPrivateDesignFromResource(resourceId, privateDesignId, privateStorageOwner, tenantId, cancelToken) {
|
|
4449
5169
|
let url_ = this.baseUrl + "/api/atoms/v1/private-designs/from-resource?";
|
|
4450
|
-
if (resourceId
|
|
4451
|
-
throw new Error("The parameter 'resourceId' cannot be null.");
|
|
4452
|
-
else if (resourceId !== undefined)
|
|
5170
|
+
if (resourceId !== undefined && resourceId !== null)
|
|
4453
5171
|
url_ += "resourceId=" + encodeURIComponent("" + resourceId) + "&";
|
|
4454
|
-
if (privateDesignId
|
|
4455
|
-
throw new Error("The parameter 'privateDesignId' cannot be null.");
|
|
4456
|
-
else if (privateDesignId !== undefined)
|
|
5172
|
+
if (privateDesignId !== undefined && privateDesignId !== null)
|
|
4457
5173
|
url_ += "privateDesignId=" + encodeURIComponent("" + privateDesignId) + "&";
|
|
4458
|
-
if (privateStorageOwner
|
|
4459
|
-
throw new Error("The parameter 'privateStorageOwner' cannot be null.");
|
|
4460
|
-
else if (privateStorageOwner !== undefined)
|
|
5174
|
+
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
4461
5175
|
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
4462
5176
|
if (tenantId === null)
|
|
4463
5177
|
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
@@ -4803,9 +5517,7 @@ class DesignAtomsViewerApiClient extends ApiClientBase {
|
|
|
4803
5517
|
*/
|
|
4804
5518
|
getCssFont(fontKey, tenantId, cancelToken) {
|
|
4805
5519
|
let url_ = this.baseUrl + "/api/atoms/v1/ccviewer/GetCssFont?";
|
|
4806
|
-
if (fontKey
|
|
4807
|
-
throw new Error("The parameter 'fontKey' cannot be null.");
|
|
4808
|
-
else if (fontKey !== undefined)
|
|
5520
|
+
if (fontKey !== undefined && fontKey !== null)
|
|
4809
5521
|
url_ += "fontKey=" + encodeURIComponent("" + fontKey) + "&";
|
|
4810
5522
|
if (tenantId === null)
|
|
4811
5523
|
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
@@ -5159,77 +5871,41 @@ class DesignAtomsViewerApiClient extends ApiClientBase {
|
|
|
5159
5871
|
*/
|
|
5160
5872
|
img(f, w, h, cmyk, rgb, grayscale, target, sq, effect, kp, color, obm, oo, alphaMask, page, colorizeColor, rw, rh, tenantId, cancelToken) {
|
|
5161
5873
|
let url_ = this.baseUrl + "/api/atoms/v1/ccviewer/img?";
|
|
5162
|
-
if (f
|
|
5163
|
-
throw new Error("The parameter 'f' cannot be null.");
|
|
5164
|
-
else if (f !== undefined)
|
|
5874
|
+
if (f !== undefined && f !== null)
|
|
5165
5875
|
url_ += "f=" + encodeURIComponent("" + f) + "&";
|
|
5166
|
-
if (w
|
|
5167
|
-
throw new Error("The parameter 'w' cannot be null.");
|
|
5168
|
-
else if (w !== undefined)
|
|
5876
|
+
if (w !== undefined && w !== null)
|
|
5169
5877
|
url_ += "w=" + encodeURIComponent("" + w) + "&";
|
|
5170
|
-
if (h
|
|
5171
|
-
throw new Error("The parameter 'h' cannot be null.");
|
|
5172
|
-
else if (h !== undefined)
|
|
5878
|
+
if (h !== undefined && h !== null)
|
|
5173
5879
|
url_ += "h=" + encodeURIComponent("" + h) + "&";
|
|
5174
|
-
if (cmyk
|
|
5175
|
-
throw new Error("The parameter 'cmyk' cannot be null.");
|
|
5176
|
-
else if (cmyk !== undefined)
|
|
5880
|
+
if (cmyk !== undefined && cmyk !== null)
|
|
5177
5881
|
url_ += "cmyk=" + encodeURIComponent("" + cmyk) + "&";
|
|
5178
|
-
if (rgb
|
|
5179
|
-
throw new Error("The parameter 'rgb' cannot be null.");
|
|
5180
|
-
else if (rgb !== undefined)
|
|
5882
|
+
if (rgb !== undefined && rgb !== null)
|
|
5181
5883
|
url_ += "rgb=" + encodeURIComponent("" + rgb) + "&";
|
|
5182
|
-
if (grayscale
|
|
5183
|
-
throw new Error("The parameter 'grayscale' cannot be null.");
|
|
5184
|
-
else if (grayscale !== undefined)
|
|
5884
|
+
if (grayscale !== undefined && grayscale !== null)
|
|
5185
5885
|
url_ += "grayscale=" + encodeURIComponent("" + grayscale) + "&";
|
|
5186
|
-
if (target
|
|
5187
|
-
throw new Error("The parameter 'target' cannot be null.");
|
|
5188
|
-
else if (target !== undefined)
|
|
5886
|
+
if (target !== undefined && target !== null)
|
|
5189
5887
|
url_ += "target=" + encodeURIComponent("" + target) + "&";
|
|
5190
|
-
if (sq
|
|
5191
|
-
throw new Error("The parameter 'sq' cannot be null.");
|
|
5192
|
-
else if (sq !== undefined)
|
|
5888
|
+
if (sq !== undefined && sq !== null)
|
|
5193
5889
|
url_ += "sq=" + encodeURIComponent("" + sq) + "&";
|
|
5194
|
-
if (effect
|
|
5195
|
-
throw new Error("The parameter 'effect' cannot be null.");
|
|
5196
|
-
else if (effect !== undefined)
|
|
5890
|
+
if (effect !== undefined && effect !== null)
|
|
5197
5891
|
url_ += "effect=" + encodeURIComponent("" + effect) + "&";
|
|
5198
|
-
if (kp
|
|
5199
|
-
throw new Error("The parameter 'kp' cannot be null.");
|
|
5200
|
-
else if (kp !== undefined)
|
|
5892
|
+
if (kp !== undefined && kp !== null)
|
|
5201
5893
|
url_ += "kp=" + encodeURIComponent("" + kp) + "&";
|
|
5202
|
-
if (color
|
|
5203
|
-
throw new Error("The parameter 'color' cannot be null.");
|
|
5204
|
-
else if (color !== undefined)
|
|
5894
|
+
if (color !== undefined && color !== null)
|
|
5205
5895
|
url_ += "color=" + encodeURIComponent("" + color) + "&";
|
|
5206
|
-
if (obm
|
|
5207
|
-
throw new Error("The parameter 'obm' cannot be null.");
|
|
5208
|
-
else if (obm !== undefined)
|
|
5896
|
+
if (obm !== undefined && obm !== null)
|
|
5209
5897
|
url_ += "obm=" + encodeURIComponent("" + obm) + "&";
|
|
5210
|
-
if (oo
|
|
5211
|
-
throw new Error("The parameter 'oo' cannot be null.");
|
|
5212
|
-
else if (oo !== undefined)
|
|
5898
|
+
if (oo !== undefined && oo !== null)
|
|
5213
5899
|
url_ += "oo=" + encodeURIComponent("" + oo) + "&";
|
|
5214
|
-
if (alphaMask
|
|
5215
|
-
throw new Error("The parameter 'alphaMask' cannot be null.");
|
|
5216
|
-
else if (alphaMask !== undefined)
|
|
5900
|
+
if (alphaMask !== undefined && alphaMask !== null)
|
|
5217
5901
|
url_ += "alphaMask=" + encodeURIComponent("" + alphaMask) + "&";
|
|
5218
|
-
if (page
|
|
5219
|
-
throw new Error("The parameter 'page' cannot be null.");
|
|
5220
|
-
else if (page !== undefined)
|
|
5902
|
+
if (page !== undefined && page !== null)
|
|
5221
5903
|
url_ += "page=" + encodeURIComponent("" + page) + "&";
|
|
5222
|
-
if (colorizeColor
|
|
5223
|
-
throw new Error("The parameter 'colorizeColor' cannot be null.");
|
|
5224
|
-
else if (colorizeColor !== undefined)
|
|
5904
|
+
if (colorizeColor !== undefined && colorizeColor !== null)
|
|
5225
5905
|
url_ += "colorizeColor=" + encodeURIComponent("" + colorizeColor) + "&";
|
|
5226
|
-
if (rw
|
|
5227
|
-
throw new Error("The parameter 'rw' cannot be null.");
|
|
5228
|
-
else if (rw !== undefined)
|
|
5906
|
+
if (rw !== undefined && rw !== null)
|
|
5229
5907
|
url_ += "rw=" + encodeURIComponent("" + rw) + "&";
|
|
5230
|
-
if (rh
|
|
5231
|
-
throw new Error("The parameter 'rh' cannot be null.");
|
|
5232
|
-
else if (rh !== undefined)
|
|
5908
|
+
if (rh !== undefined && rh !== null)
|
|
5233
5909
|
url_ += "rh=" + encodeURIComponent("" + rh) + "&";
|
|
5234
5910
|
if (tenantId === null)
|
|
5235
5911
|
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
@@ -5369,9 +6045,7 @@ class DesignAtomsViewerApiClient extends ApiClientBase {
|
|
|
5369
6045
|
*/
|
|
5370
6046
|
pth(f, tenantId, cancelToken) {
|
|
5371
6047
|
let url_ = this.baseUrl + "/api/atoms/v1/ccviewer/pth?";
|
|
5372
|
-
if (f
|
|
5373
|
-
throw new Error("The parameter 'f' cannot be null.");
|
|
5374
|
-
else if (f !== undefined)
|
|
6048
|
+
if (f !== undefined && f !== null)
|
|
5375
6049
|
url_ += "f=" + encodeURIComponent("" + f) + "&";
|
|
5376
6050
|
if (tenantId === null)
|
|
5377
6051
|
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
@@ -5448,9 +6122,7 @@ class DesignAtomsViewerApiClient extends ApiClientBase {
|
|
|
5448
6122
|
*/
|
|
5449
6123
|
resource(image, tenantId, cancelToken) {
|
|
5450
6124
|
let url_ = this.baseUrl + "/api/atoms/v1/ccviewer/resource?";
|
|
5451
|
-
if (image
|
|
5452
|
-
throw new Error("The parameter 'image' cannot be null.");
|
|
5453
|
-
else if (image !== undefined)
|
|
6125
|
+
if (image !== undefined && image !== null)
|
|
5454
6126
|
url_ += "image=" + encodeURIComponent("" + image) + "&";
|
|
5455
6127
|
if (tenantId === null)
|
|
5456
6128
|
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
@@ -5540,77 +6212,41 @@ class DesignAtomsViewerApiClient extends ApiClientBase {
|
|
|
5540
6212
|
*/
|
|
5541
6213
|
svg(f, w, h, cmyk, rgb, grayscale, target, sq, effect, kp, color, obm, oo, alphaMask, page, colorizeColor, rw, rh, tenantId, cancelToken) {
|
|
5542
6214
|
let url_ = this.baseUrl + "/api/atoms/v1/ccviewer/svg?";
|
|
5543
|
-
if (f
|
|
5544
|
-
throw new Error("The parameter 'f' cannot be null.");
|
|
5545
|
-
else if (f !== undefined)
|
|
6215
|
+
if (f !== undefined && f !== null)
|
|
5546
6216
|
url_ += "f=" + encodeURIComponent("" + f) + "&";
|
|
5547
|
-
if (w
|
|
5548
|
-
throw new Error("The parameter 'w' cannot be null.");
|
|
5549
|
-
else if (w !== undefined)
|
|
6217
|
+
if (w !== undefined && w !== null)
|
|
5550
6218
|
url_ += "w=" + encodeURIComponent("" + w) + "&";
|
|
5551
|
-
if (h
|
|
5552
|
-
throw new Error("The parameter 'h' cannot be null.");
|
|
5553
|
-
else if (h !== undefined)
|
|
6219
|
+
if (h !== undefined && h !== null)
|
|
5554
6220
|
url_ += "h=" + encodeURIComponent("" + h) + "&";
|
|
5555
|
-
if (cmyk
|
|
5556
|
-
throw new Error("The parameter 'cmyk' cannot be null.");
|
|
5557
|
-
else if (cmyk !== undefined)
|
|
6221
|
+
if (cmyk !== undefined && cmyk !== null)
|
|
5558
6222
|
url_ += "cmyk=" + encodeURIComponent("" + cmyk) + "&";
|
|
5559
|
-
if (rgb
|
|
5560
|
-
throw new Error("The parameter 'rgb' cannot be null.");
|
|
5561
|
-
else if (rgb !== undefined)
|
|
6223
|
+
if (rgb !== undefined && rgb !== null)
|
|
5562
6224
|
url_ += "rgb=" + encodeURIComponent("" + rgb) + "&";
|
|
5563
|
-
if (grayscale
|
|
5564
|
-
throw new Error("The parameter 'grayscale' cannot be null.");
|
|
5565
|
-
else if (grayscale !== undefined)
|
|
6225
|
+
if (grayscale !== undefined && grayscale !== null)
|
|
5566
6226
|
url_ += "grayscale=" + encodeURIComponent("" + grayscale) + "&";
|
|
5567
|
-
if (target
|
|
5568
|
-
throw new Error("The parameter 'target' cannot be null.");
|
|
5569
|
-
else if (target !== undefined)
|
|
6227
|
+
if (target !== undefined && target !== null)
|
|
5570
6228
|
url_ += "target=" + encodeURIComponent("" + target) + "&";
|
|
5571
|
-
if (sq
|
|
5572
|
-
throw new Error("The parameter 'sq' cannot be null.");
|
|
5573
|
-
else if (sq !== undefined)
|
|
6229
|
+
if (sq !== undefined && sq !== null)
|
|
5574
6230
|
url_ += "sq=" + encodeURIComponent("" + sq) + "&";
|
|
5575
|
-
if (effect
|
|
5576
|
-
throw new Error("The parameter 'effect' cannot be null.");
|
|
5577
|
-
else if (effect !== undefined)
|
|
6231
|
+
if (effect !== undefined && effect !== null)
|
|
5578
6232
|
url_ += "effect=" + encodeURIComponent("" + effect) + "&";
|
|
5579
|
-
if (kp
|
|
5580
|
-
throw new Error("The parameter 'kp' cannot be null.");
|
|
5581
|
-
else if (kp !== undefined)
|
|
6233
|
+
if (kp !== undefined && kp !== null)
|
|
5582
6234
|
url_ += "kp=" + encodeURIComponent("" + kp) + "&";
|
|
5583
|
-
if (color
|
|
5584
|
-
throw new Error("The parameter 'color' cannot be null.");
|
|
5585
|
-
else if (color !== undefined)
|
|
6235
|
+
if (color !== undefined && color !== null)
|
|
5586
6236
|
url_ += "color=" + encodeURIComponent("" + color) + "&";
|
|
5587
|
-
if (obm
|
|
5588
|
-
throw new Error("The parameter 'obm' cannot be null.");
|
|
5589
|
-
else if (obm !== undefined)
|
|
6237
|
+
if (obm !== undefined && obm !== null)
|
|
5590
6238
|
url_ += "obm=" + encodeURIComponent("" + obm) + "&";
|
|
5591
|
-
if (oo
|
|
5592
|
-
throw new Error("The parameter 'oo' cannot be null.");
|
|
5593
|
-
else if (oo !== undefined)
|
|
6239
|
+
if (oo !== undefined && oo !== null)
|
|
5594
6240
|
url_ += "oo=" + encodeURIComponent("" + oo) + "&";
|
|
5595
|
-
if (alphaMask
|
|
5596
|
-
throw new Error("The parameter 'alphaMask' cannot be null.");
|
|
5597
|
-
else if (alphaMask !== undefined)
|
|
6241
|
+
if (alphaMask !== undefined && alphaMask !== null)
|
|
5598
6242
|
url_ += "alphaMask=" + encodeURIComponent("" + alphaMask) + "&";
|
|
5599
|
-
if (page
|
|
5600
|
-
throw new Error("The parameter 'page' cannot be null.");
|
|
5601
|
-
else if (page !== undefined)
|
|
6243
|
+
if (page !== undefined && page !== null)
|
|
5602
6244
|
url_ += "page=" + encodeURIComponent("" + page) + "&";
|
|
5603
|
-
if (colorizeColor
|
|
5604
|
-
throw new Error("The parameter 'colorizeColor' cannot be null.");
|
|
5605
|
-
else if (colorizeColor !== undefined)
|
|
6245
|
+
if (colorizeColor !== undefined && colorizeColor !== null)
|
|
5606
6246
|
url_ += "colorizeColor=" + encodeURIComponent("" + colorizeColor) + "&";
|
|
5607
|
-
if (rw
|
|
5608
|
-
throw new Error("The parameter 'rw' cannot be null.");
|
|
5609
|
-
else if (rw !== undefined)
|
|
6247
|
+
if (rw !== undefined && rw !== null)
|
|
5610
6248
|
url_ += "rw=" + encodeURIComponent("" + rw) + "&";
|
|
5611
|
-
if (rh
|
|
5612
|
-
throw new Error("The parameter 'rh' cannot be null.");
|
|
5613
|
-
else if (rh !== undefined)
|
|
6249
|
+
if (rh !== undefined && rh !== null)
|
|
5614
6250
|
url_ += "rh=" + encodeURIComponent("" + rh) + "&";
|
|
5615
6251
|
if (tenantId === null)
|
|
5616
6252
|
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
@@ -5687,9 +6323,7 @@ class DesignAtomsViewerApiClient extends ApiClientBase {
|
|
|
5687
6323
|
*/
|
|
5688
6324
|
txt(f, tenantId, cancelToken) {
|
|
5689
6325
|
let url_ = this.baseUrl + "/api/atoms/v1/ccviewer/txt?";
|
|
5690
|
-
if (f
|
|
5691
|
-
throw new Error("The parameter 'f' cannot be null.");
|
|
5692
|
-
else if (f !== undefined)
|
|
6326
|
+
if (f !== undefined && f !== null)
|
|
5693
6327
|
url_ += "f=" + encodeURIComponent("" + f) + "&";
|
|
5694
6328
|
if (tenantId === null)
|
|
5695
6329
|
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
@@ -6527,6 +7161,7 @@ var ItemSourceType;
|
|
|
6527
7161
|
ItemSourceType["File"] = "File";
|
|
6528
7162
|
ItemSourceType["ImageStorage"] = "ImageStorage";
|
|
6529
7163
|
ItemSourceType["PrivateImageStorage"] = "PrivateImageStorage";
|
|
7164
|
+
ItemSourceType["Url"] = "Url";
|
|
6530
7165
|
})(ItemSourceType = exports.ItemSourceType || (exports.ItemSourceType = {}));
|
|
6531
7166
|
var ItemType;
|
|
6532
7167
|
(function (ItemType) {
|