@aurigma/axios-design-atoms-api-client 2.63.1 → 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 +297 -28
- package/dist/cjs/design-atoms-api-client.js +1242 -389
- package/dist/cjs/design-atoms-api-client.js.map +1 -1
- package/dist/esm/design-atoms-api-client.d.ts +297 -28
- package/dist/esm/design-atoms-api-client.js +1240 -387
- package/dist/esm/design-atoms-api-client.js.map +1 -1
- package/package.json +1 -1
|
@@ -2017,7 +2017,7 @@ export class DesignAtomsImagesApiClient extends ApiClientBase {
|
|
|
2017
2017
|
this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : this.getBaseUrl("");
|
|
2018
2018
|
}
|
|
2019
2019
|
/**
|
|
2020
|
-
* Renders a
|
|
2020
|
+
* Renders a preview of an image with the specified parameters.
|
|
2021
2021
|
* @param attachment (optional) If set to 'true', file will be provided as an attachment with unique filename supplied
|
|
2022
2022
|
(default value is 'false').
|
|
2023
2023
|
* @param tenantId (optional) Tenant identifier
|
|
@@ -2089,13 +2089,295 @@ export class DesignAtomsImagesApiClient extends ApiClientBase {
|
|
|
2089
2089
|
return Promise.resolve(null);
|
|
2090
2090
|
}
|
|
2091
2091
|
/**
|
|
2092
|
-
* Renders a
|
|
2092
|
+
* Renders a preview of an uploaded image with the specified parameters.
|
|
2093
|
+
* @param attachment (optional) If set to 'true', file will be provided as an attachment with unique filename supplied
|
|
2094
|
+
(default value is 'false').
|
|
2095
|
+
* @param tenantId (optional) Tenant identifier
|
|
2096
|
+
* @param sourceFile (optional)
|
|
2097
|
+
* @param mockupOwnerId (optional)
|
|
2098
|
+
* @param mockupId (optional)
|
|
2099
|
+
* @param width (optional)
|
|
2100
|
+
* @param height (optional)
|
|
2101
|
+
* @param fileFormat (optional)
|
|
2102
|
+
* @param fitMode (optional)
|
|
2103
|
+
* @return Success
|
|
2104
|
+
*/
|
|
2105
|
+
renderImagePreviewFromFile(attachment, tenantId, sourceFile, mockupOwnerId, mockupId, width, height, fileFormat, fitMode, cancelToken) {
|
|
2106
|
+
let url_ = this.baseUrl + "/api/atoms/v1/images/render-preview/from-file?";
|
|
2107
|
+
if (attachment !== undefined && attachment !== null)
|
|
2108
|
+
url_ += "attachment=" + encodeURIComponent("" + attachment) + "&";
|
|
2109
|
+
if (tenantId === null)
|
|
2110
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
2111
|
+
else if (tenantId !== undefined)
|
|
2112
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2113
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
2114
|
+
const content_ = new FormData();
|
|
2115
|
+
if (sourceFile !== null && sourceFile !== undefined)
|
|
2116
|
+
content_.append("sourceFile", sourceFile.data, sourceFile.fileName ? sourceFile.fileName : "sourceFile");
|
|
2117
|
+
if (mockupOwnerId !== null && mockupOwnerId !== undefined)
|
|
2118
|
+
content_.append("mockupOwnerId", mockupOwnerId.toString());
|
|
2119
|
+
if (mockupId !== null && mockupId !== undefined)
|
|
2120
|
+
content_.append("mockupId", mockupId.toString());
|
|
2121
|
+
if (width !== null && width !== undefined)
|
|
2122
|
+
content_.append("width", width.toString());
|
|
2123
|
+
if (height !== null && height !== undefined)
|
|
2124
|
+
content_.append("height", height.toString());
|
|
2125
|
+
if (fileFormat !== null && fileFormat !== undefined)
|
|
2126
|
+
content_.append("fileFormat", fileFormat.toString());
|
|
2127
|
+
if (fitMode !== null && fitMode !== undefined)
|
|
2128
|
+
content_.append("fitMode", fitMode.toString());
|
|
2129
|
+
let options_ = {
|
|
2130
|
+
data: content_,
|
|
2131
|
+
responseType: "blob",
|
|
2132
|
+
method: "POST",
|
|
2133
|
+
url: url_,
|
|
2134
|
+
headers: {
|
|
2135
|
+
"Accept": "application/octet-stream"
|
|
2136
|
+
},
|
|
2137
|
+
cancelToken
|
|
2138
|
+
};
|
|
2139
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
2140
|
+
return this.instance.request(transformedOptions_);
|
|
2141
|
+
}).catch((_error) => {
|
|
2142
|
+
if (isAxiosError(_error) && _error.response) {
|
|
2143
|
+
return _error.response;
|
|
2144
|
+
}
|
|
2145
|
+
else {
|
|
2146
|
+
throw _error;
|
|
2147
|
+
}
|
|
2148
|
+
}).then((_response) => {
|
|
2149
|
+
return this.transformResult(url_, _response, (_response) => this.processRenderImagePreviewFromFile(_response));
|
|
2150
|
+
});
|
|
2151
|
+
}
|
|
2152
|
+
processRenderImagePreviewFromFile(response) {
|
|
2153
|
+
const status = response.status;
|
|
2154
|
+
let _headers = {};
|
|
2155
|
+
if (response.headers && typeof response.headers === "object") {
|
|
2156
|
+
for (let k in response.headers) {
|
|
2157
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
2158
|
+
_headers[k] = response.headers[k];
|
|
2159
|
+
}
|
|
2160
|
+
}
|
|
2161
|
+
}
|
|
2162
|
+
if (status === 200 || status === 206) {
|
|
2163
|
+
const contentDisposition = response.headers ? response.headers["content-disposition"] : undefined;
|
|
2164
|
+
const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
|
|
2165
|
+
const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
|
|
2166
|
+
return Promise.resolve({ fileName: fileName, status: status, data: new Blob([response.data]), headers: _headers });
|
|
2167
|
+
}
|
|
2168
|
+
else if (status === 401) {
|
|
2169
|
+
const _responseText = response.data;
|
|
2170
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
2171
|
+
}
|
|
2172
|
+
else if (status === 403) {
|
|
2173
|
+
const _responseText = response.data;
|
|
2174
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
2175
|
+
}
|
|
2176
|
+
else if (status !== 200 && status !== 204) {
|
|
2177
|
+
const _responseText = response.data;
|
|
2178
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
2179
|
+
}
|
|
2180
|
+
return Promise.resolve(null);
|
|
2181
|
+
}
|
|
2182
|
+
/**
|
|
2183
|
+
* Renders a preview of an uploaded image with the specified parameters and saves rendering result as resource.
|
|
2184
|
+
* @param tenantId (optional) Tenant identifier
|
|
2185
|
+
* @param resourceOwnerId (optional)
|
|
2186
|
+
* @param resourceNamespace (optional)
|
|
2187
|
+
* @param resourceName (optional)
|
|
2188
|
+
* @param resourceSourceId (optional)
|
|
2189
|
+
* @param resourceType (optional)
|
|
2190
|
+
* @param anonymousAccess (optional)
|
|
2191
|
+
* @param overwriteExistingResource (optional)
|
|
2192
|
+
* @param sourceFile (optional)
|
|
2193
|
+
* @param mockupOwnerId (optional)
|
|
2194
|
+
* @param mockupId (optional)
|
|
2195
|
+
* @param width (optional)
|
|
2196
|
+
* @param height (optional)
|
|
2197
|
+
* @param fileFormat (optional)
|
|
2198
|
+
* @param fitMode (optional)
|
|
2199
|
+
* @return Success
|
|
2200
|
+
*/
|
|
2201
|
+
renderImagePreviewFromFileToResource(tenantId, resourceOwnerId, resourceNamespace, resourceName, resourceSourceId, resourceType, anonymousAccess, overwriteExistingResource, sourceFile, mockupOwnerId, mockupId, width, height, fileFormat, fitMode, cancelToken) {
|
|
2202
|
+
let url_ = this.baseUrl + "/api/atoms/v1/images/render-preview/from-file/to-resource?";
|
|
2203
|
+
if (tenantId === null)
|
|
2204
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
2205
|
+
else if (tenantId !== undefined)
|
|
2206
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2207
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
2208
|
+
const content_ = new FormData();
|
|
2209
|
+
if (resourceOwnerId !== null && resourceOwnerId !== undefined)
|
|
2210
|
+
content_.append("resourceOwnerId", resourceOwnerId.toString());
|
|
2211
|
+
if (resourceNamespace !== null && resourceNamespace !== undefined)
|
|
2212
|
+
content_.append("resourceNamespace", resourceNamespace.toString());
|
|
2213
|
+
if (resourceName !== null && resourceName !== undefined)
|
|
2214
|
+
content_.append("resourceName", resourceName.toString());
|
|
2215
|
+
if (resourceSourceId !== null && resourceSourceId !== undefined)
|
|
2216
|
+
content_.append("resourceSourceId", resourceSourceId.toString());
|
|
2217
|
+
if (resourceType !== null && resourceType !== undefined)
|
|
2218
|
+
content_.append("resourceType", resourceType.toString());
|
|
2219
|
+
if (anonymousAccess === null || anonymousAccess === undefined)
|
|
2220
|
+
throw new Error("The parameter 'anonymousAccess' cannot be null.");
|
|
2221
|
+
else
|
|
2222
|
+
content_.append("anonymousAccess", anonymousAccess.toString());
|
|
2223
|
+
if (overwriteExistingResource === null || overwriteExistingResource === undefined)
|
|
2224
|
+
throw new Error("The parameter 'overwriteExistingResource' cannot be null.");
|
|
2225
|
+
else
|
|
2226
|
+
content_.append("overwriteExistingResource", overwriteExistingResource.toString());
|
|
2227
|
+
if (sourceFile !== null && sourceFile !== undefined)
|
|
2228
|
+
content_.append("sourceFile", sourceFile.data, sourceFile.fileName ? sourceFile.fileName : "sourceFile");
|
|
2229
|
+
if (mockupOwnerId !== null && mockupOwnerId !== undefined)
|
|
2230
|
+
content_.append("mockupOwnerId", mockupOwnerId.toString());
|
|
2231
|
+
if (mockupId !== null && mockupId !== undefined)
|
|
2232
|
+
content_.append("mockupId", mockupId.toString());
|
|
2233
|
+
if (width !== null && width !== undefined)
|
|
2234
|
+
content_.append("width", width.toString());
|
|
2235
|
+
if (height !== null && height !== undefined)
|
|
2236
|
+
content_.append("height", height.toString());
|
|
2237
|
+
if (fileFormat !== null && fileFormat !== undefined)
|
|
2238
|
+
content_.append("fileFormat", fileFormat.toString());
|
|
2239
|
+
if (fitMode !== null && fitMode !== undefined)
|
|
2240
|
+
content_.append("fitMode", fitMode.toString());
|
|
2241
|
+
let options_ = {
|
|
2242
|
+
data: content_,
|
|
2243
|
+
method: "POST",
|
|
2244
|
+
url: url_,
|
|
2245
|
+
headers: {
|
|
2246
|
+
"Accept": "application/json"
|
|
2247
|
+
},
|
|
2248
|
+
cancelToken
|
|
2249
|
+
};
|
|
2250
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
2251
|
+
return this.instance.request(transformedOptions_);
|
|
2252
|
+
}).catch((_error) => {
|
|
2253
|
+
if (isAxiosError(_error) && _error.response) {
|
|
2254
|
+
return _error.response;
|
|
2255
|
+
}
|
|
2256
|
+
else {
|
|
2257
|
+
throw _error;
|
|
2258
|
+
}
|
|
2259
|
+
}).then((_response) => {
|
|
2260
|
+
return this.transformResult(url_, _response, (_response) => this.processRenderImagePreviewFromFileToResource(_response));
|
|
2261
|
+
});
|
|
2262
|
+
}
|
|
2263
|
+
processRenderImagePreviewFromFileToResource(response) {
|
|
2264
|
+
const status = response.status;
|
|
2265
|
+
let _headers = {};
|
|
2266
|
+
if (response.headers && typeof response.headers === "object") {
|
|
2267
|
+
for (let k in response.headers) {
|
|
2268
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
2269
|
+
_headers[k] = response.headers[k];
|
|
2270
|
+
}
|
|
2271
|
+
}
|
|
2272
|
+
}
|
|
2273
|
+
if (status === 200) {
|
|
2274
|
+
const _responseText = response.data;
|
|
2275
|
+
let result200 = null;
|
|
2276
|
+
let resultData200 = _responseText;
|
|
2277
|
+
result200 = JSON.parse(resultData200);
|
|
2278
|
+
return Promise.resolve(result200);
|
|
2279
|
+
}
|
|
2280
|
+
else if (status === 409) {
|
|
2281
|
+
const _responseText = response.data;
|
|
2282
|
+
let result409 = null;
|
|
2283
|
+
let resultData409 = _responseText;
|
|
2284
|
+
result409 = JSON.parse(resultData409);
|
|
2285
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
2286
|
+
}
|
|
2287
|
+
else if (status === 401) {
|
|
2288
|
+
const _responseText = response.data;
|
|
2289
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
2290
|
+
}
|
|
2291
|
+
else if (status === 403) {
|
|
2292
|
+
const _responseText = response.data;
|
|
2293
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
2294
|
+
}
|
|
2295
|
+
else if (status !== 200 && status !== 204) {
|
|
2296
|
+
const _responseText = response.data;
|
|
2297
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
2298
|
+
}
|
|
2299
|
+
return Promise.resolve(null);
|
|
2300
|
+
}
|
|
2301
|
+
/**
|
|
2302
|
+
* Renders a preview of a web image with the specified parameters.
|
|
2303
|
+
* @param attachment (optional) If set to 'true', file will be provided as an attachment with unique filename supplied
|
|
2304
|
+
(default value is 'false').
|
|
2093
2305
|
* @param tenantId (optional) Tenant identifier
|
|
2094
2306
|
* @param body (optional) Render model with preview parameters.
|
|
2095
2307
|
* @return Success
|
|
2096
2308
|
*/
|
|
2097
|
-
|
|
2098
|
-
let url_ = this.baseUrl + "/api/atoms/v1/images/render-preview/
|
|
2309
|
+
renderImagePreviewFromUrl(attachment, tenantId, body, cancelToken) {
|
|
2310
|
+
let url_ = this.baseUrl + "/api/atoms/v1/images/render-preview/from-url?";
|
|
2311
|
+
if (attachment !== undefined && attachment !== null)
|
|
2312
|
+
url_ += "attachment=" + encodeURIComponent("" + attachment) + "&";
|
|
2313
|
+
if (tenantId === null)
|
|
2314
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
2315
|
+
else if (tenantId !== undefined)
|
|
2316
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2317
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
2318
|
+
const content_ = JSON.stringify(body);
|
|
2319
|
+
let options_ = {
|
|
2320
|
+
data: content_,
|
|
2321
|
+
responseType: "blob",
|
|
2322
|
+
method: "POST",
|
|
2323
|
+
url: url_,
|
|
2324
|
+
headers: {
|
|
2325
|
+
"Content-Type": "application/json",
|
|
2326
|
+
"Accept": "application/octet-stream"
|
|
2327
|
+
},
|
|
2328
|
+
cancelToken
|
|
2329
|
+
};
|
|
2330
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
2331
|
+
return this.instance.request(transformedOptions_);
|
|
2332
|
+
}).catch((_error) => {
|
|
2333
|
+
if (isAxiosError(_error) && _error.response) {
|
|
2334
|
+
return _error.response;
|
|
2335
|
+
}
|
|
2336
|
+
else {
|
|
2337
|
+
throw _error;
|
|
2338
|
+
}
|
|
2339
|
+
}).then((_response) => {
|
|
2340
|
+
return this.transformResult(url_, _response, (_response) => this.processRenderImagePreviewFromUrl(_response));
|
|
2341
|
+
});
|
|
2342
|
+
}
|
|
2343
|
+
processRenderImagePreviewFromUrl(response) {
|
|
2344
|
+
const status = response.status;
|
|
2345
|
+
let _headers = {};
|
|
2346
|
+
if (response.headers && typeof response.headers === "object") {
|
|
2347
|
+
for (let k in response.headers) {
|
|
2348
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
2349
|
+
_headers[k] = response.headers[k];
|
|
2350
|
+
}
|
|
2351
|
+
}
|
|
2352
|
+
}
|
|
2353
|
+
if (status === 200 || status === 206) {
|
|
2354
|
+
const contentDisposition = response.headers ? response.headers["content-disposition"] : undefined;
|
|
2355
|
+
const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
|
|
2356
|
+
const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
|
|
2357
|
+
return Promise.resolve({ fileName: fileName, status: status, data: new Blob([response.data]), headers: _headers });
|
|
2358
|
+
}
|
|
2359
|
+
else if (status === 401) {
|
|
2360
|
+
const _responseText = response.data;
|
|
2361
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
2362
|
+
}
|
|
2363
|
+
else if (status === 403) {
|
|
2364
|
+
const _responseText = response.data;
|
|
2365
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
2366
|
+
}
|
|
2367
|
+
else if (status !== 200 && status !== 204) {
|
|
2368
|
+
const _responseText = response.data;
|
|
2369
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
2370
|
+
}
|
|
2371
|
+
return Promise.resolve(null);
|
|
2372
|
+
}
|
|
2373
|
+
/**
|
|
2374
|
+
* Renders a preview of a web image with the specified parameters and saves rendering result as resource.
|
|
2375
|
+
* @param tenantId (optional) Tenant identifier
|
|
2376
|
+
* @param body (optional) Render model with preview parameters.
|
|
2377
|
+
* @return Success
|
|
2378
|
+
*/
|
|
2379
|
+
renderImagePreviewFromUrlToResource(tenantId, body, cancelToken) {
|
|
2380
|
+
let url_ = this.baseUrl + "/api/atoms/v1/images/render-preview/from-url/to-resource?";
|
|
2099
2381
|
if (tenantId === null)
|
|
2100
2382
|
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
2101
2383
|
else if (tenantId !== undefined)
|
|
@@ -2122,10 +2404,10 @@ export class DesignAtomsImagesApiClient extends ApiClientBase {
|
|
|
2122
2404
|
throw _error;
|
|
2123
2405
|
}
|
|
2124
2406
|
}).then((_response) => {
|
|
2125
|
-
return this.transformResult(url_, _response, (_response) => this.
|
|
2407
|
+
return this.transformResult(url_, _response, (_response) => this.processRenderImagePreviewFromUrlToResource(_response));
|
|
2126
2408
|
});
|
|
2127
2409
|
}
|
|
2128
|
-
|
|
2410
|
+
processRenderImagePreviewFromUrlToResource(response) {
|
|
2129
2411
|
const status = response.status;
|
|
2130
2412
|
let _headers = {};
|
|
2131
2413
|
if (response.headers && typeof response.headers === "object") {
|
|
@@ -2142,6 +2424,13 @@ export class DesignAtomsImagesApiClient extends ApiClientBase {
|
|
|
2142
2424
|
result200 = JSON.parse(resultData200);
|
|
2143
2425
|
return Promise.resolve(result200);
|
|
2144
2426
|
}
|
|
2427
|
+
else if (status === 409) {
|
|
2428
|
+
const _responseText = response.data;
|
|
2429
|
+
let result409 = null;
|
|
2430
|
+
let resultData409 = _responseText;
|
|
2431
|
+
result409 = JSON.parse(resultData409);
|
|
2432
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
2433
|
+
}
|
|
2145
2434
|
else if (status === 401) {
|
|
2146
2435
|
const _responseText = response.data;
|
|
2147
2436
|
return throwException("Unauthorized", status, _responseText, _headers);
|
|
@@ -2156,30 +2445,529 @@ export class DesignAtomsImagesApiClient extends ApiClientBase {
|
|
|
2156
2445
|
}
|
|
2157
2446
|
return Promise.resolve(null);
|
|
2158
2447
|
}
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
this.
|
|
2167
|
-
|
|
2448
|
+
/**
|
|
2449
|
+
* Renders a preview of an image with the specified parameters and saves rendering result as resource.
|
|
2450
|
+
* @param tenantId (optional) Tenant identifier
|
|
2451
|
+
* @param body (optional) Render model with preview parameters.
|
|
2452
|
+
* @return Success
|
|
2453
|
+
*/
|
|
2454
|
+
renderImagePreviewToResource(tenantId, body, cancelToken) {
|
|
2455
|
+
let url_ = this.baseUrl + "/api/atoms/v1/images/render-preview/to-resource?";
|
|
2456
|
+
if (tenantId === null)
|
|
2457
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
2458
|
+
else if (tenantId !== undefined)
|
|
2459
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2460
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
2461
|
+
const content_ = JSON.stringify(body);
|
|
2462
|
+
let options_ = {
|
|
2463
|
+
data: content_,
|
|
2464
|
+
method: "POST",
|
|
2465
|
+
url: url_,
|
|
2466
|
+
headers: {
|
|
2467
|
+
"Content-Type": "application/json",
|
|
2468
|
+
"Accept": "application/json"
|
|
2469
|
+
},
|
|
2470
|
+
cancelToken
|
|
2471
|
+
};
|
|
2472
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
2473
|
+
return this.instance.request(transformedOptions_);
|
|
2474
|
+
}).catch((_error) => {
|
|
2475
|
+
if (isAxiosError(_error) && _error.response) {
|
|
2476
|
+
return _error.response;
|
|
2477
|
+
}
|
|
2478
|
+
else {
|
|
2479
|
+
throw _error;
|
|
2480
|
+
}
|
|
2481
|
+
}).then((_response) => {
|
|
2482
|
+
return this.transformResult(url_, _response, (_response) => this.processRenderImagePreviewToResource(_response));
|
|
2483
|
+
});
|
|
2484
|
+
}
|
|
2485
|
+
processRenderImagePreviewToResource(response) {
|
|
2486
|
+
const status = response.status;
|
|
2487
|
+
let _headers = {};
|
|
2488
|
+
if (response.headers && typeof response.headers === "object") {
|
|
2489
|
+
for (let k in response.headers) {
|
|
2490
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
2491
|
+
_headers[k] = response.headers[k];
|
|
2492
|
+
}
|
|
2493
|
+
}
|
|
2494
|
+
}
|
|
2495
|
+
if (status === 200) {
|
|
2496
|
+
const _responseText = response.data;
|
|
2497
|
+
let result200 = null;
|
|
2498
|
+
let resultData200 = _responseText;
|
|
2499
|
+
result200 = JSON.parse(resultData200);
|
|
2500
|
+
return Promise.resolve(result200);
|
|
2501
|
+
}
|
|
2502
|
+
else if (status === 409) {
|
|
2503
|
+
const _responseText = response.data;
|
|
2504
|
+
let result409 = null;
|
|
2505
|
+
let resultData409 = _responseText;
|
|
2506
|
+
result409 = JSON.parse(resultData409);
|
|
2507
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
2508
|
+
}
|
|
2509
|
+
else if (status === 401) {
|
|
2510
|
+
const _responseText = response.data;
|
|
2511
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
2512
|
+
}
|
|
2513
|
+
else if (status === 403) {
|
|
2514
|
+
const _responseText = response.data;
|
|
2515
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
2516
|
+
}
|
|
2517
|
+
else if (status !== 200 && status !== 204) {
|
|
2518
|
+
const _responseText = response.data;
|
|
2519
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
2520
|
+
}
|
|
2521
|
+
return Promise.resolve(null);
|
|
2522
|
+
}
|
|
2523
|
+
}
|
|
2524
|
+
export class DesignAtomsMockups3dApiClient extends ApiClientBase {
|
|
2525
|
+
instance;
|
|
2526
|
+
baseUrl;
|
|
2527
|
+
jsonParseReviver = undefined;
|
|
2528
|
+
constructor(configuration, baseUrl, instance) {
|
|
2529
|
+
super(configuration);
|
|
2530
|
+
this.instance = instance ? instance : axios.create();
|
|
2531
|
+
this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : this.getBaseUrl("");
|
|
2532
|
+
}
|
|
2533
|
+
/**
|
|
2534
|
+
* Returns a 3D-Mockup attributes.
|
|
2535
|
+
* @param id 3D-Mockup identifier.
|
|
2536
|
+
* @param ownerId (optional) Private mockup owner identifier.
|
|
2537
|
+
* @param tenantId (optional) Tenant identifier
|
|
2538
|
+
* @return Success
|
|
2539
|
+
*/
|
|
2540
|
+
getAttributes(id, ownerId, tenantId, cancelToken) {
|
|
2541
|
+
let url_ = this.baseUrl + "/api/atoms/v1/mockups-3d/{id}/attributes?";
|
|
2542
|
+
if (id === undefined || id === null)
|
|
2543
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
2544
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
2545
|
+
if (ownerId !== undefined && ownerId !== null)
|
|
2546
|
+
url_ += "ownerId=" + encodeURIComponent("" + ownerId) + "&";
|
|
2547
|
+
if (tenantId === null)
|
|
2548
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
2549
|
+
else if (tenantId !== undefined)
|
|
2550
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2551
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
2552
|
+
let options_ = {
|
|
2553
|
+
method: "GET",
|
|
2554
|
+
url: url_,
|
|
2555
|
+
headers: {
|
|
2556
|
+
"Accept": "application/json"
|
|
2557
|
+
},
|
|
2558
|
+
cancelToken
|
|
2559
|
+
};
|
|
2560
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
2561
|
+
return this.instance.request(transformedOptions_);
|
|
2562
|
+
}).catch((_error) => {
|
|
2563
|
+
if (isAxiosError(_error) && _error.response) {
|
|
2564
|
+
return _error.response;
|
|
2565
|
+
}
|
|
2566
|
+
else {
|
|
2567
|
+
throw _error;
|
|
2568
|
+
}
|
|
2569
|
+
}).then((_response) => {
|
|
2570
|
+
return this.transformResult(url_, _response, (_response) => this.processGetAttributes(_response));
|
|
2571
|
+
});
|
|
2572
|
+
}
|
|
2573
|
+
processGetAttributes(response) {
|
|
2574
|
+
const status = response.status;
|
|
2575
|
+
let _headers = {};
|
|
2576
|
+
if (response.headers && typeof response.headers === "object") {
|
|
2577
|
+
for (let k in response.headers) {
|
|
2578
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
2579
|
+
_headers[k] = response.headers[k];
|
|
2580
|
+
}
|
|
2581
|
+
}
|
|
2582
|
+
}
|
|
2583
|
+
if (status === 200) {
|
|
2584
|
+
const _responseText = response.data;
|
|
2585
|
+
let result200 = null;
|
|
2586
|
+
let resultData200 = _responseText;
|
|
2587
|
+
result200 = JSON.parse(resultData200);
|
|
2588
|
+
return Promise.resolve(result200);
|
|
2589
|
+
}
|
|
2590
|
+
else if (status === 404) {
|
|
2591
|
+
const _responseText = response.data;
|
|
2592
|
+
let result404 = null;
|
|
2593
|
+
let resultData404 = _responseText;
|
|
2594
|
+
result404 = JSON.parse(resultData404);
|
|
2595
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
2596
|
+
}
|
|
2597
|
+
else if (status === 422) {
|
|
2598
|
+
const _responseText = response.data;
|
|
2599
|
+
let result422 = null;
|
|
2600
|
+
let resultData422 = _responseText;
|
|
2601
|
+
result422 = JSON.parse(resultData422);
|
|
2602
|
+
return throwException("Client Error", status, _responseText, _headers, result422);
|
|
2603
|
+
}
|
|
2604
|
+
else if (status === 401) {
|
|
2605
|
+
const _responseText = response.data;
|
|
2606
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
2607
|
+
}
|
|
2608
|
+
else if (status === 403) {
|
|
2609
|
+
const _responseText = response.data;
|
|
2610
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
2611
|
+
}
|
|
2612
|
+
else if (status !== 200 && status !== 204) {
|
|
2613
|
+
const _responseText = response.data;
|
|
2614
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
2615
|
+
}
|
|
2616
|
+
return Promise.resolve(null);
|
|
2617
|
+
}
|
|
2618
|
+
/**
|
|
2619
|
+
* Returns a 3D-Mockup content as protobuf binary stream.
|
|
2620
|
+
* @param id 3D-Mockup identifier.
|
|
2621
|
+
* @param ownerId (optional) Private mockup owner identifier.
|
|
2622
|
+
* @param tenantId (optional) Tenant identifier
|
|
2623
|
+
* @return Success
|
|
2624
|
+
*/
|
|
2625
|
+
getContentAsProtobuf(id, ownerId, tenantId, cancelToken) {
|
|
2626
|
+
let url_ = this.baseUrl + "/api/atoms/v1/mockups-3d/{id}/content/as-protobuf?";
|
|
2627
|
+
if (id === undefined || id === null)
|
|
2628
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
2629
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
2630
|
+
if (ownerId !== undefined && ownerId !== null)
|
|
2631
|
+
url_ += "ownerId=" + encodeURIComponent("" + ownerId) + "&";
|
|
2632
|
+
if (tenantId === null)
|
|
2633
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
2634
|
+
else if (tenantId !== undefined)
|
|
2635
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2636
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
2637
|
+
let options_ = {
|
|
2638
|
+
responseType: "blob",
|
|
2639
|
+
method: "GET",
|
|
2640
|
+
url: url_,
|
|
2641
|
+
headers: {
|
|
2642
|
+
"Accept": "application/json"
|
|
2643
|
+
},
|
|
2644
|
+
cancelToken
|
|
2645
|
+
};
|
|
2646
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
2647
|
+
return this.instance.request(transformedOptions_);
|
|
2648
|
+
}).catch((_error) => {
|
|
2649
|
+
if (isAxiosError(_error) && _error.response) {
|
|
2650
|
+
return _error.response;
|
|
2651
|
+
}
|
|
2652
|
+
else {
|
|
2653
|
+
throw _error;
|
|
2654
|
+
}
|
|
2655
|
+
}).then((_response) => {
|
|
2656
|
+
return this.transformResult(url_, _response, (_response) => this.processGetContentAsProtobuf(_response));
|
|
2657
|
+
});
|
|
2658
|
+
}
|
|
2659
|
+
processGetContentAsProtobuf(response) {
|
|
2660
|
+
const status = response.status;
|
|
2661
|
+
let _headers = {};
|
|
2662
|
+
if (response.headers && typeof response.headers === "object") {
|
|
2663
|
+
for (let k in response.headers) {
|
|
2664
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
2665
|
+
_headers[k] = response.headers[k];
|
|
2666
|
+
}
|
|
2667
|
+
}
|
|
2668
|
+
}
|
|
2669
|
+
if (status === 200 || status === 206) {
|
|
2670
|
+
const contentDisposition = response.headers ? response.headers["content-disposition"] : undefined;
|
|
2671
|
+
const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
|
|
2672
|
+
const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
|
|
2673
|
+
return Promise.resolve({ fileName: fileName, status: status, data: new Blob([response.data]), headers: _headers });
|
|
2674
|
+
}
|
|
2675
|
+
else if (status === 404) {
|
|
2676
|
+
const _responseText = response.data;
|
|
2677
|
+
let result404 = null;
|
|
2678
|
+
let resultData404 = _responseText;
|
|
2679
|
+
result404 = JSON.parse(resultData404);
|
|
2680
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
2681
|
+
}
|
|
2682
|
+
else if (status === 422) {
|
|
2683
|
+
const _responseText = response.data;
|
|
2684
|
+
let result422 = null;
|
|
2685
|
+
let resultData422 = _responseText;
|
|
2686
|
+
result422 = JSON.parse(resultData422);
|
|
2687
|
+
return throwException("Client Error", status, _responseText, _headers, result422);
|
|
2688
|
+
}
|
|
2689
|
+
else if (status === 401) {
|
|
2690
|
+
const _responseText = response.data;
|
|
2691
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
2692
|
+
}
|
|
2693
|
+
else if (status === 403) {
|
|
2694
|
+
const _responseText = response.data;
|
|
2695
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
2696
|
+
}
|
|
2697
|
+
else if (status !== 200 && status !== 204) {
|
|
2698
|
+
const _responseText = response.data;
|
|
2699
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
2700
|
+
}
|
|
2701
|
+
return Promise.resolve(null);
|
|
2702
|
+
}
|
|
2703
|
+
/**
|
|
2704
|
+
* Returns a 3D-Mockup geometry as binary stream.
|
|
2705
|
+
* @param id 3D-Mockup identifier.
|
|
2706
|
+
* @param ownerId (optional) Private mockup owner identifier.
|
|
2707
|
+
* @param tenantId (optional) Tenant identifier
|
|
2708
|
+
* @return Success
|
|
2709
|
+
*/
|
|
2710
|
+
getGeometryFile(id, ownerId, tenantId, cancelToken) {
|
|
2711
|
+
let url_ = this.baseUrl + "/api/atoms/v1/mockups-3d/{id}/geometry/file?";
|
|
2712
|
+
if (id === undefined || id === null)
|
|
2713
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
2714
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
2715
|
+
if (ownerId !== undefined && ownerId !== null)
|
|
2716
|
+
url_ += "ownerId=" + encodeURIComponent("" + ownerId) + "&";
|
|
2717
|
+
if (tenantId === null)
|
|
2718
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
2719
|
+
else if (tenantId !== undefined)
|
|
2720
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2721
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
2722
|
+
let options_ = {
|
|
2723
|
+
responseType: "blob",
|
|
2724
|
+
method: "GET",
|
|
2725
|
+
url: url_,
|
|
2726
|
+
headers: {
|
|
2727
|
+
"Accept": "application/json"
|
|
2728
|
+
},
|
|
2729
|
+
cancelToken
|
|
2730
|
+
};
|
|
2731
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
2732
|
+
return this.instance.request(transformedOptions_);
|
|
2733
|
+
}).catch((_error) => {
|
|
2734
|
+
if (isAxiosError(_error) && _error.response) {
|
|
2735
|
+
return _error.response;
|
|
2736
|
+
}
|
|
2737
|
+
else {
|
|
2738
|
+
throw _error;
|
|
2739
|
+
}
|
|
2740
|
+
}).then((_response) => {
|
|
2741
|
+
return this.transformResult(url_, _response, (_response) => this.processGetGeometryFile(_response));
|
|
2742
|
+
});
|
|
2743
|
+
}
|
|
2744
|
+
processGetGeometryFile(response) {
|
|
2745
|
+
const status = response.status;
|
|
2746
|
+
let _headers = {};
|
|
2747
|
+
if (response.headers && typeof response.headers === "object") {
|
|
2748
|
+
for (let k in response.headers) {
|
|
2749
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
2750
|
+
_headers[k] = response.headers[k];
|
|
2751
|
+
}
|
|
2752
|
+
}
|
|
2753
|
+
}
|
|
2754
|
+
if (status === 200 || status === 206) {
|
|
2755
|
+
const contentDisposition = response.headers ? response.headers["content-disposition"] : undefined;
|
|
2756
|
+
const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
|
|
2757
|
+
const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
|
|
2758
|
+
return Promise.resolve({ fileName: fileName, status: status, data: new Blob([response.data]), headers: _headers });
|
|
2759
|
+
}
|
|
2760
|
+
else if (status === 404) {
|
|
2761
|
+
const _responseText = response.data;
|
|
2762
|
+
let result404 = null;
|
|
2763
|
+
let resultData404 = _responseText;
|
|
2764
|
+
result404 = JSON.parse(resultData404);
|
|
2765
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
2766
|
+
}
|
|
2767
|
+
else if (status === 422) {
|
|
2768
|
+
const _responseText = response.data;
|
|
2769
|
+
let result422 = null;
|
|
2770
|
+
let resultData422 = _responseText;
|
|
2771
|
+
result422 = JSON.parse(resultData422);
|
|
2772
|
+
return throwException("Client Error", status, _responseText, _headers, result422);
|
|
2773
|
+
}
|
|
2774
|
+
else if (status === 401) {
|
|
2775
|
+
const _responseText = response.data;
|
|
2776
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
2777
|
+
}
|
|
2778
|
+
else if (status === 403) {
|
|
2779
|
+
const _responseText = response.data;
|
|
2780
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
2781
|
+
}
|
|
2782
|
+
else if (status !== 200 && status !== 204) {
|
|
2783
|
+
const _responseText = response.data;
|
|
2784
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
2785
|
+
}
|
|
2786
|
+
return Promise.resolve(null);
|
|
2787
|
+
}
|
|
2788
|
+
}
|
|
2789
|
+
export class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
2790
|
+
instance;
|
|
2791
|
+
baseUrl;
|
|
2792
|
+
jsonParseReviver = undefined;
|
|
2793
|
+
constructor(configuration, baseUrl, instance) {
|
|
2794
|
+
super(configuration);
|
|
2795
|
+
this.instance = instance ? instance : axios.create();
|
|
2796
|
+
this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : this.getBaseUrl("");
|
|
2797
|
+
}
|
|
2798
|
+
/**
|
|
2799
|
+
* Creates new design file with specified parameters and saves it in storage.
|
|
2800
|
+
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
2801
|
+
* @param tenantId (optional) Tenant identifier
|
|
2802
|
+
* @param body (optional) Design creation parameters.
|
|
2803
|
+
* @return Created
|
|
2804
|
+
*/
|
|
2805
|
+
createDesign(privateStorageOwner, tenantId, body, cancelToken) {
|
|
2806
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs?";
|
|
2807
|
+
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
2808
|
+
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
2809
|
+
if (tenantId === null)
|
|
2810
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
2811
|
+
else if (tenantId !== undefined)
|
|
2812
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2813
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
2814
|
+
const content_ = JSON.stringify(body);
|
|
2815
|
+
let options_ = {
|
|
2816
|
+
data: content_,
|
|
2817
|
+
method: "POST",
|
|
2818
|
+
url: url_,
|
|
2819
|
+
headers: {
|
|
2820
|
+
"Content-Type": "application/json",
|
|
2821
|
+
"Accept": "application/json"
|
|
2822
|
+
},
|
|
2823
|
+
cancelToken
|
|
2824
|
+
};
|
|
2825
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
2826
|
+
return this.instance.request(transformedOptions_);
|
|
2827
|
+
}).catch((_error) => {
|
|
2828
|
+
if (isAxiosError(_error) && _error.response) {
|
|
2829
|
+
return _error.response;
|
|
2830
|
+
}
|
|
2831
|
+
else {
|
|
2832
|
+
throw _error;
|
|
2833
|
+
}
|
|
2834
|
+
}).then((_response) => {
|
|
2835
|
+
return this.transformResult(url_, _response, (_response) => this.processCreateDesign(_response));
|
|
2836
|
+
});
|
|
2837
|
+
}
|
|
2838
|
+
processCreateDesign(response) {
|
|
2839
|
+
const status = response.status;
|
|
2840
|
+
let _headers = {};
|
|
2841
|
+
if (response.headers && typeof response.headers === "object") {
|
|
2842
|
+
for (let k in response.headers) {
|
|
2843
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
2844
|
+
_headers[k] = response.headers[k];
|
|
2845
|
+
}
|
|
2846
|
+
}
|
|
2847
|
+
}
|
|
2848
|
+
if (status === 201) {
|
|
2849
|
+
const _responseText = response.data;
|
|
2850
|
+
let result201 = null;
|
|
2851
|
+
let resultData201 = _responseText;
|
|
2852
|
+
result201 = JSON.parse(resultData201);
|
|
2853
|
+
return Promise.resolve(result201);
|
|
2854
|
+
}
|
|
2855
|
+
else if (status === 401) {
|
|
2856
|
+
const _responseText = response.data;
|
|
2857
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
2858
|
+
}
|
|
2859
|
+
else if (status === 403) {
|
|
2860
|
+
const _responseText = response.data;
|
|
2861
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
2862
|
+
}
|
|
2863
|
+
else if (status !== 200 && status !== 204) {
|
|
2864
|
+
const _responseText = response.data;
|
|
2865
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
2866
|
+
}
|
|
2867
|
+
return Promise.resolve(null);
|
|
2868
|
+
}
|
|
2869
|
+
/**
|
|
2870
|
+
* Returns content of the background.
|
|
2871
|
+
* @param id Design identifier.
|
|
2872
|
+
* @param surfaceIndex (optional) Surface index.
|
|
2873
|
+
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
2874
|
+
* @param tenantId (optional) Tenant identifier
|
|
2875
|
+
* @return Success
|
|
2876
|
+
*/
|
|
2877
|
+
extractBackground(id, surfaceIndex, privateStorageOwner, tenantId, cancelToken) {
|
|
2878
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/background?";
|
|
2879
|
+
if (id === undefined || id === null)
|
|
2880
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
2881
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
2882
|
+
if (surfaceIndex !== undefined && surfaceIndex !== null)
|
|
2883
|
+
url_ += "surfaceIndex=" + encodeURIComponent("" + surfaceIndex) + "&";
|
|
2884
|
+
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
2885
|
+
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
2886
|
+
if (tenantId === null)
|
|
2887
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
2888
|
+
else if (tenantId !== undefined)
|
|
2889
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2890
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
2891
|
+
let options_ = {
|
|
2892
|
+
responseType: "blob",
|
|
2893
|
+
method: "GET",
|
|
2894
|
+
url: url_,
|
|
2895
|
+
headers: {
|
|
2896
|
+
"Accept": "application/octet-stream"
|
|
2897
|
+
},
|
|
2898
|
+
cancelToken
|
|
2899
|
+
};
|
|
2900
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
2901
|
+
return this.instance.request(transformedOptions_);
|
|
2902
|
+
}).catch((_error) => {
|
|
2903
|
+
if (isAxiosError(_error) && _error.response) {
|
|
2904
|
+
return _error.response;
|
|
2905
|
+
}
|
|
2906
|
+
else {
|
|
2907
|
+
throw _error;
|
|
2908
|
+
}
|
|
2909
|
+
}).then((_response) => {
|
|
2910
|
+
return this.transformResult(url_, _response, (_response) => this.processExtractBackground(_response));
|
|
2911
|
+
});
|
|
2912
|
+
}
|
|
2913
|
+
processExtractBackground(response) {
|
|
2914
|
+
const status = response.status;
|
|
2915
|
+
let _headers = {};
|
|
2916
|
+
if (response.headers && typeof response.headers === "object") {
|
|
2917
|
+
for (let k in response.headers) {
|
|
2918
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
2919
|
+
_headers[k] = response.headers[k];
|
|
2920
|
+
}
|
|
2921
|
+
}
|
|
2922
|
+
}
|
|
2923
|
+
if (status === 200 || status === 206) {
|
|
2924
|
+
const contentDisposition = response.headers ? response.headers["content-disposition"] : undefined;
|
|
2925
|
+
const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
|
|
2926
|
+
const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
|
|
2927
|
+
return Promise.resolve({ fileName: fileName, status: status, data: new Blob([response.data]), headers: _headers });
|
|
2928
|
+
}
|
|
2929
|
+
else if (status === 404) {
|
|
2930
|
+
const _responseText = response.data;
|
|
2931
|
+
let result404 = null;
|
|
2932
|
+
let resultData404 = _responseText;
|
|
2933
|
+
result404 = JSON.parse(resultData404);
|
|
2934
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
2935
|
+
}
|
|
2936
|
+
else if (status === 422) {
|
|
2937
|
+
const _responseText = response.data;
|
|
2938
|
+
let result422 = null;
|
|
2939
|
+
let resultData422 = _responseText;
|
|
2940
|
+
result422 = JSON.parse(resultData422);
|
|
2941
|
+
return throwException("Client Error", status, _responseText, _headers, result422);
|
|
2942
|
+
}
|
|
2943
|
+
else if (status === 401) {
|
|
2944
|
+
const _responseText = response.data;
|
|
2945
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
2946
|
+
}
|
|
2947
|
+
else if (status === 403) {
|
|
2948
|
+
const _responseText = response.data;
|
|
2949
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
2950
|
+
}
|
|
2951
|
+
else if (status !== 200 && status !== 204) {
|
|
2952
|
+
const _responseText = response.data;
|
|
2953
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
2954
|
+
}
|
|
2955
|
+
return Promise.resolve(null);
|
|
2168
2956
|
}
|
|
2169
2957
|
/**
|
|
2170
|
-
*
|
|
2171
|
-
* @param id
|
|
2172
|
-
* @param
|
|
2958
|
+
* Loads product (design model) from design file taken from storage.
|
|
2959
|
+
* @param id Design identifier.
|
|
2960
|
+
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
2173
2961
|
* @param tenantId (optional) Tenant identifier
|
|
2174
2962
|
* @return Success
|
|
2175
2963
|
*/
|
|
2176
|
-
|
|
2177
|
-
let url_ = this.baseUrl + "/api/atoms/v1/
|
|
2964
|
+
loadProduct(id, privateStorageOwner, tenantId, cancelToken) {
|
|
2965
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/model?";
|
|
2178
2966
|
if (id === undefined || id === null)
|
|
2179
2967
|
throw new Error("The parameter 'id' must be defined.");
|
|
2180
2968
|
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
2181
|
-
if (
|
|
2182
|
-
url_ += "
|
|
2969
|
+
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
2970
|
+
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
2183
2971
|
if (tenantId === null)
|
|
2184
2972
|
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
2185
2973
|
else if (tenantId !== undefined)
|
|
@@ -2203,10 +2991,10 @@ export class DesignAtomsMockups3dApiClient extends ApiClientBase {
|
|
|
2203
2991
|
throw _error;
|
|
2204
2992
|
}
|
|
2205
2993
|
}).then((_response) => {
|
|
2206
|
-
return this.transformResult(url_, _response, (_response) => this.
|
|
2994
|
+
return this.transformResult(url_, _response, (_response) => this.processLoadProduct(_response));
|
|
2207
2995
|
});
|
|
2208
2996
|
}
|
|
2209
|
-
|
|
2997
|
+
processLoadProduct(response) {
|
|
2210
2998
|
const status = response.status;
|
|
2211
2999
|
let _headers = {};
|
|
2212
3000
|
if (response.headers && typeof response.headers === "object") {
|
|
@@ -2230,13 +3018,6 @@ export class DesignAtomsMockups3dApiClient extends ApiClientBase {
|
|
|
2230
3018
|
result404 = JSON.parse(resultData404);
|
|
2231
3019
|
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
2232
3020
|
}
|
|
2233
|
-
else if (status === 422) {
|
|
2234
|
-
const _responseText = response.data;
|
|
2235
|
-
let result422 = null;
|
|
2236
|
-
let resultData422 = _responseText;
|
|
2237
|
-
result422 = JSON.parse(resultData422);
|
|
2238
|
-
return throwException("Client Error", status, _responseText, _headers, result422);
|
|
2239
|
-
}
|
|
2240
3021
|
else if (status === 401) {
|
|
2241
3022
|
const _responseText = response.data;
|
|
2242
3023
|
return throwException("Unauthorized", status, _responseText, _headers);
|
|
@@ -2252,30 +3033,32 @@ export class DesignAtomsMockups3dApiClient extends ApiClientBase {
|
|
|
2252
3033
|
return Promise.resolve(null);
|
|
2253
3034
|
}
|
|
2254
3035
|
/**
|
|
2255
|
-
*
|
|
2256
|
-
* @param id
|
|
2257
|
-
* @param
|
|
3036
|
+
* Saves product (design model) to design file and updates design in storage.
|
|
3037
|
+
* @param id Design identifier.
|
|
3038
|
+
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
2258
3039
|
* @param tenantId (optional) Tenant identifier
|
|
3040
|
+
* @param body (optional) Serialized product description.
|
|
2259
3041
|
* @return Success
|
|
2260
3042
|
*/
|
|
2261
|
-
|
|
2262
|
-
let url_ = this.baseUrl + "/api/atoms/v1/
|
|
3043
|
+
saveProduct(id, privateStorageOwner, tenantId, body, cancelToken) {
|
|
3044
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/model?";
|
|
2263
3045
|
if (id === undefined || id === null)
|
|
2264
3046
|
throw new Error("The parameter 'id' must be defined.");
|
|
2265
3047
|
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
2266
|
-
if (
|
|
2267
|
-
url_ += "
|
|
3048
|
+
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
3049
|
+
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
2268
3050
|
if (tenantId === null)
|
|
2269
3051
|
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
2270
3052
|
else if (tenantId !== undefined)
|
|
2271
3053
|
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2272
3054
|
url_ = url_.replace(/[?&]$/, "");
|
|
3055
|
+
const content_ = JSON.stringify(body);
|
|
2273
3056
|
let options_ = {
|
|
2274
|
-
|
|
2275
|
-
method: "
|
|
3057
|
+
data: content_,
|
|
3058
|
+
method: "PUT",
|
|
2276
3059
|
url: url_,
|
|
2277
3060
|
headers: {
|
|
2278
|
-
"
|
|
3061
|
+
"Content-Type": "application/json",
|
|
2279
3062
|
},
|
|
2280
3063
|
cancelToken
|
|
2281
3064
|
};
|
|
@@ -2289,10 +3072,10 @@ export class DesignAtomsMockups3dApiClient extends ApiClientBase {
|
|
|
2289
3072
|
throw _error;
|
|
2290
3073
|
}
|
|
2291
3074
|
}).then((_response) => {
|
|
2292
|
-
return this.transformResult(url_, _response, (_response) => this.
|
|
3075
|
+
return this.transformResult(url_, _response, (_response) => this.processSaveProduct(_response));
|
|
2293
3076
|
});
|
|
2294
3077
|
}
|
|
2295
|
-
|
|
3078
|
+
processSaveProduct(response) {
|
|
2296
3079
|
const status = response.status;
|
|
2297
3080
|
let _headers = {};
|
|
2298
3081
|
if (response.headers && typeof response.headers === "object") {
|
|
@@ -2302,11 +3085,9 @@ export class DesignAtomsMockups3dApiClient extends ApiClientBase {
|
|
|
2302
3085
|
}
|
|
2303
3086
|
}
|
|
2304
3087
|
}
|
|
2305
|
-
if (status === 200
|
|
2306
|
-
const
|
|
2307
|
-
|
|
2308
|
-
const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
|
|
2309
|
-
return Promise.resolve({ fileName: fileName, status: status, data: new Blob([response.data]), headers: _headers });
|
|
3088
|
+
if (status === 200) {
|
|
3089
|
+
const _responseText = response.data;
|
|
3090
|
+
return Promise.resolve(null);
|
|
2310
3091
|
}
|
|
2311
3092
|
else if (status === 404) {
|
|
2312
3093
|
const _responseText = response.data;
|
|
@@ -2315,13 +3096,6 @@ export class DesignAtomsMockups3dApiClient extends ApiClientBase {
|
|
|
2315
3096
|
result404 = JSON.parse(resultData404);
|
|
2316
3097
|
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
2317
3098
|
}
|
|
2318
|
-
else if (status === 422) {
|
|
2319
|
-
const _responseText = response.data;
|
|
2320
|
-
let result422 = null;
|
|
2321
|
-
let resultData422 = _responseText;
|
|
2322
|
-
result422 = JSON.parse(resultData422);
|
|
2323
|
-
return throwException("Client Error", status, _responseText, _headers, result422);
|
|
2324
|
-
}
|
|
2325
3099
|
else if (status === 401) {
|
|
2326
3100
|
const _responseText = response.data;
|
|
2327
3101
|
return throwException("Unauthorized", status, _responseText, _headers);
|
|
@@ -2337,31 +3111,52 @@ export class DesignAtomsMockups3dApiClient extends ApiClientBase {
|
|
|
2337
3111
|
return Promise.resolve(null);
|
|
2338
3112
|
}
|
|
2339
3113
|
/**
|
|
2340
|
-
*
|
|
2341
|
-
* @param id
|
|
2342
|
-
* @param
|
|
3114
|
+
* Patches product (design model) in design file.
|
|
3115
|
+
* @param id Design identifier.
|
|
3116
|
+
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
2343
3117
|
* @param tenantId (optional) Tenant identifier
|
|
3118
|
+
* @param patchType (optional)
|
|
3119
|
+
* @param replaceImageItemFileInfo_itemName (optional)
|
|
3120
|
+
* @param replaceImageItemFileInfo_sourceFile (optional)
|
|
3121
|
+
* @param replacePlaceholderItemContentInfo_placeholderItemName (optional)
|
|
3122
|
+
* @param replacePlaceholderItemContentInfo_newContentType (optional)
|
|
3123
|
+
* @param replacePlaceholderItemContentInfo_sourceFile (optional)
|
|
2344
3124
|
* @return Success
|
|
2345
3125
|
*/
|
|
2346
|
-
|
|
2347
|
-
let url_ = this.baseUrl + "/api/atoms/v1/
|
|
3126
|
+
patchProduct(id, privateStorageOwner, tenantId, patchType, replaceImageItemFileInfo_itemName, replaceImageItemFileInfo_sourceFile, replacePlaceholderItemContentInfo_placeholderItemName, replacePlaceholderItemContentInfo_newContentType, replacePlaceholderItemContentInfo_sourceFile, cancelToken) {
|
|
3127
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/model?";
|
|
2348
3128
|
if (id === undefined || id === null)
|
|
2349
3129
|
throw new Error("The parameter 'id' must be defined.");
|
|
2350
3130
|
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
2351
|
-
if (
|
|
2352
|
-
url_ += "
|
|
3131
|
+
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
3132
|
+
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
2353
3133
|
if (tenantId === null)
|
|
2354
3134
|
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
2355
3135
|
else if (tenantId !== undefined)
|
|
2356
3136
|
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2357
3137
|
url_ = url_.replace(/[?&]$/, "");
|
|
3138
|
+
const content_ = new FormData();
|
|
3139
|
+
if (patchType === null || patchType === undefined)
|
|
3140
|
+
throw new Error("The parameter 'patchType' cannot be null.");
|
|
3141
|
+
else
|
|
3142
|
+
content_.append("patchType", patchType.toString());
|
|
3143
|
+
if (replaceImageItemFileInfo_itemName !== null && replaceImageItemFileInfo_itemName !== undefined)
|
|
3144
|
+
content_.append("replaceImageItemFileInfo.itemName", replaceImageItemFileInfo_itemName.toString());
|
|
3145
|
+
if (replaceImageItemFileInfo_sourceFile !== null && replaceImageItemFileInfo_sourceFile !== undefined)
|
|
3146
|
+
content_.append("replaceImageItemFileInfo.sourceFile", replaceImageItemFileInfo_sourceFile.data, replaceImageItemFileInfo_sourceFile.fileName ? replaceImageItemFileInfo_sourceFile.fileName : "replaceImageItemFileInfo.sourceFile");
|
|
3147
|
+
if (replacePlaceholderItemContentInfo_placeholderItemName !== null && replacePlaceholderItemContentInfo_placeholderItemName !== undefined)
|
|
3148
|
+
content_.append("replacePlaceholderItemContentInfo.placeholderItemName", replacePlaceholderItemContentInfo_placeholderItemName.toString());
|
|
3149
|
+
if (replacePlaceholderItemContentInfo_newContentType === null || replacePlaceholderItemContentInfo_newContentType === undefined)
|
|
3150
|
+
throw new Error("The parameter 'replacePlaceholderItemContentInfo_newContentType' cannot be null.");
|
|
3151
|
+
else
|
|
3152
|
+
content_.append("replacePlaceholderItemContentInfo.newContentType", replacePlaceholderItemContentInfo_newContentType.toString());
|
|
3153
|
+
if (replacePlaceholderItemContentInfo_sourceFile !== null && replacePlaceholderItemContentInfo_sourceFile !== undefined)
|
|
3154
|
+
content_.append("replacePlaceholderItemContentInfo.sourceFile", replacePlaceholderItemContentInfo_sourceFile.data, replacePlaceholderItemContentInfo_sourceFile.fileName ? replacePlaceholderItemContentInfo_sourceFile.fileName : "replacePlaceholderItemContentInfo.sourceFile");
|
|
2358
3155
|
let options_ = {
|
|
2359
|
-
|
|
2360
|
-
method: "
|
|
3156
|
+
data: content_,
|
|
3157
|
+
method: "PATCH",
|
|
2361
3158
|
url: url_,
|
|
2362
|
-
headers: {
|
|
2363
|
-
"Accept": "application/json"
|
|
2364
|
-
},
|
|
3159
|
+
headers: {},
|
|
2365
3160
|
cancelToken
|
|
2366
3161
|
};
|
|
2367
3162
|
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
@@ -2374,10 +3169,10 @@ export class DesignAtomsMockups3dApiClient extends ApiClientBase {
|
|
|
2374
3169
|
throw _error;
|
|
2375
3170
|
}
|
|
2376
3171
|
}).then((_response) => {
|
|
2377
|
-
return this.transformResult(url_, _response, (_response) => this.
|
|
3172
|
+
return this.transformResult(url_, _response, (_response) => this.processPatchProduct(_response));
|
|
2378
3173
|
});
|
|
2379
3174
|
}
|
|
2380
|
-
|
|
3175
|
+
processPatchProduct(response) {
|
|
2381
3176
|
const status = response.status;
|
|
2382
3177
|
let _headers = {};
|
|
2383
3178
|
if (response.headers && typeof response.headers === "object") {
|
|
@@ -2387,11 +3182,9 @@ export class DesignAtomsMockups3dApiClient extends ApiClientBase {
|
|
|
2387
3182
|
}
|
|
2388
3183
|
}
|
|
2389
3184
|
}
|
|
2390
|
-
if (status === 200
|
|
2391
|
-
const
|
|
2392
|
-
|
|
2393
|
-
const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
|
|
2394
|
-
return Promise.resolve({ fileName: fileName, status: status, data: new Blob([response.data]), headers: _headers });
|
|
3185
|
+
if (status === 200) {
|
|
3186
|
+
const _responseText = response.data;
|
|
3187
|
+
return Promise.resolve(null);
|
|
2395
3188
|
}
|
|
2396
3189
|
else if (status === 404) {
|
|
2397
3190
|
const _responseText = response.data;
|
|
@@ -2400,13 +3193,6 @@ export class DesignAtomsMockups3dApiClient extends ApiClientBase {
|
|
|
2400
3193
|
result404 = JSON.parse(resultData404);
|
|
2401
3194
|
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
2402
3195
|
}
|
|
2403
|
-
else if (status === 422) {
|
|
2404
|
-
const _responseText = response.data;
|
|
2405
|
-
let result422 = null;
|
|
2406
|
-
let resultData422 = _responseText;
|
|
2407
|
-
result422 = JSON.parse(resultData422);
|
|
2408
|
-
return throwException("Client Error", status, _responseText, _headers, result422);
|
|
2409
|
-
}
|
|
2410
3196
|
else if (status === 401) {
|
|
2411
3197
|
const _responseText = response.data;
|
|
2412
3198
|
return throwException("Unauthorized", status, _responseText, _headers);
|
|
@@ -2421,25 +3207,18 @@ export class DesignAtomsMockups3dApiClient extends ApiClientBase {
|
|
|
2421
3207
|
}
|
|
2422
3208
|
return Promise.resolve(null);
|
|
2423
3209
|
}
|
|
2424
|
-
}
|
|
2425
|
-
export class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
2426
|
-
instance;
|
|
2427
|
-
baseUrl;
|
|
2428
|
-
jsonParseReviver = undefined;
|
|
2429
|
-
constructor(configuration, baseUrl, instance) {
|
|
2430
|
-
super(configuration);
|
|
2431
|
-
this.instance = instance ? instance : axios.create();
|
|
2432
|
-
this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : this.getBaseUrl("");
|
|
2433
|
-
}
|
|
2434
3210
|
/**
|
|
2435
|
-
*
|
|
3211
|
+
* Returns design parameters stored in product model.
|
|
3212
|
+
* @param id Design identifier.
|
|
2436
3213
|
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
2437
3214
|
* @param tenantId (optional) Tenant identifier
|
|
2438
|
-
* @
|
|
2439
|
-
* @return Created
|
|
3215
|
+
* @return Success
|
|
2440
3216
|
*/
|
|
2441
|
-
|
|
2442
|
-
let url_ = this.baseUrl + "/api/atoms/v1/designs?";
|
|
3217
|
+
getDesignParameters(id, privateStorageOwner, tenantId, cancelToken) {
|
|
3218
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/parameters?";
|
|
3219
|
+
if (id === undefined || id === null)
|
|
3220
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
3221
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
2443
3222
|
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
2444
3223
|
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
2445
3224
|
if (tenantId === null)
|
|
@@ -2447,13 +3226,10 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2447
3226
|
else if (tenantId !== undefined)
|
|
2448
3227
|
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2449
3228
|
url_ = url_.replace(/[?&]$/, "");
|
|
2450
|
-
const content_ = JSON.stringify(body);
|
|
2451
3229
|
let options_ = {
|
|
2452
|
-
|
|
2453
|
-
method: "POST",
|
|
3230
|
+
method: "GET",
|
|
2454
3231
|
url: url_,
|
|
2455
3232
|
headers: {
|
|
2456
|
-
"Content-Type": "application/json",
|
|
2457
3233
|
"Accept": "application/json"
|
|
2458
3234
|
},
|
|
2459
3235
|
cancelToken
|
|
@@ -2468,10 +3244,10 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2468
3244
|
throw _error;
|
|
2469
3245
|
}
|
|
2470
3246
|
}).then((_response) => {
|
|
2471
|
-
return this.transformResult(url_, _response, (_response) => this.
|
|
3247
|
+
return this.transformResult(url_, _response, (_response) => this.processGetDesignParameters(_response));
|
|
2472
3248
|
});
|
|
2473
3249
|
}
|
|
2474
|
-
|
|
3250
|
+
processGetDesignParameters(response) {
|
|
2475
3251
|
const status = response.status;
|
|
2476
3252
|
let _headers = {};
|
|
2477
3253
|
if (response.headers && typeof response.headers === "object") {
|
|
@@ -2481,12 +3257,19 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2481
3257
|
}
|
|
2482
3258
|
}
|
|
2483
3259
|
}
|
|
2484
|
-
if (status ===
|
|
3260
|
+
if (status === 200) {
|
|
2485
3261
|
const _responseText = response.data;
|
|
2486
|
-
let
|
|
2487
|
-
let
|
|
2488
|
-
|
|
2489
|
-
return Promise.resolve(
|
|
3262
|
+
let result200 = null;
|
|
3263
|
+
let resultData200 = _responseText;
|
|
3264
|
+
result200 = JSON.parse(resultData200);
|
|
3265
|
+
return Promise.resolve(result200);
|
|
3266
|
+
}
|
|
3267
|
+
else if (status === 404) {
|
|
3268
|
+
const _responseText = response.data;
|
|
3269
|
+
let result404 = null;
|
|
3270
|
+
let resultData404 = _responseText;
|
|
3271
|
+
result404 = JSON.parse(resultData404);
|
|
3272
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
2490
3273
|
}
|
|
2491
3274
|
else if (status === 401) {
|
|
2492
3275
|
const _responseText = response.data;
|
|
@@ -2503,20 +3286,17 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2503
3286
|
return Promise.resolve(null);
|
|
2504
3287
|
}
|
|
2505
3288
|
/**
|
|
2506
|
-
*
|
|
3289
|
+
* Loads data schema from design file taken from storage.
|
|
2507
3290
|
* @param id Design identifier.
|
|
2508
|
-
* @param surfaceIndex (optional) Surface index.
|
|
2509
3291
|
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
2510
3292
|
* @param tenantId (optional) Tenant identifier
|
|
2511
3293
|
* @return Success
|
|
2512
3294
|
*/
|
|
2513
|
-
|
|
2514
|
-
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/
|
|
3295
|
+
loadDataSchema(id, privateStorageOwner, tenantId, cancelToken) {
|
|
3296
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/schema?";
|
|
2515
3297
|
if (id === undefined || id === null)
|
|
2516
3298
|
throw new Error("The parameter 'id' must be defined.");
|
|
2517
3299
|
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
2518
|
-
if (surfaceIndex !== undefined && surfaceIndex !== null)
|
|
2519
|
-
url_ += "surfaceIndex=" + encodeURIComponent("" + surfaceIndex) + "&";
|
|
2520
3300
|
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
2521
3301
|
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
2522
3302
|
if (tenantId === null)
|
|
@@ -2543,10 +3323,10 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2543
3323
|
throw _error;
|
|
2544
3324
|
}
|
|
2545
3325
|
}).then((_response) => {
|
|
2546
|
-
return this.transformResult(url_, _response, (_response) => this.
|
|
3326
|
+
return this.transformResult(url_, _response, (_response) => this.processLoadDataSchema(_response));
|
|
2547
3327
|
});
|
|
2548
3328
|
}
|
|
2549
|
-
|
|
3329
|
+
processLoadDataSchema(response) {
|
|
2550
3330
|
const status = response.status;
|
|
2551
3331
|
let _headers = {};
|
|
2552
3332
|
if (response.headers && typeof response.headers === "object") {
|
|
@@ -2569,12 +3349,12 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2569
3349
|
result404 = JSON.parse(resultData404);
|
|
2570
3350
|
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
2571
3351
|
}
|
|
2572
|
-
else if (status ===
|
|
3352
|
+
else if (status === 409) {
|
|
2573
3353
|
const _responseText = response.data;
|
|
2574
|
-
let
|
|
2575
|
-
let
|
|
2576
|
-
|
|
2577
|
-
return throwException("
|
|
3354
|
+
let result409 = null;
|
|
3355
|
+
let resultData409 = _responseText;
|
|
3356
|
+
result409 = JSON.parse(resultData409);
|
|
3357
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
2578
3358
|
}
|
|
2579
3359
|
else if (status === 401) {
|
|
2580
3360
|
const _responseText = response.data;
|
|
@@ -2591,14 +3371,14 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2591
3371
|
return Promise.resolve(null);
|
|
2592
3372
|
}
|
|
2593
3373
|
/**
|
|
2594
|
-
* Loads
|
|
3374
|
+
* Loads a toggle set from design file taken from storage.
|
|
2595
3375
|
* @param id Design identifier.
|
|
2596
3376
|
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
2597
3377
|
* @param tenantId (optional) Tenant identifier
|
|
2598
3378
|
* @return Success
|
|
2599
3379
|
*/
|
|
2600
|
-
|
|
2601
|
-
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/
|
|
3380
|
+
loadToggleSet(id, privateStorageOwner, tenantId, cancelToken) {
|
|
3381
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/toggle-set?";
|
|
2602
3382
|
if (id === undefined || id === null)
|
|
2603
3383
|
throw new Error("The parameter 'id' must be defined.");
|
|
2604
3384
|
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
@@ -2610,10 +3390,11 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2610
3390
|
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2611
3391
|
url_ = url_.replace(/[?&]$/, "");
|
|
2612
3392
|
let options_ = {
|
|
3393
|
+
responseType: "blob",
|
|
2613
3394
|
method: "GET",
|
|
2614
3395
|
url: url_,
|
|
2615
3396
|
headers: {
|
|
2616
|
-
"Accept": "application/
|
|
3397
|
+
"Accept": "application/octet-stream"
|
|
2617
3398
|
},
|
|
2618
3399
|
cancelToken
|
|
2619
3400
|
};
|
|
@@ -2627,10 +3408,10 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2627
3408
|
throw _error;
|
|
2628
3409
|
}
|
|
2629
3410
|
}).then((_response) => {
|
|
2630
|
-
return this.transformResult(url_, _response, (_response) => this.
|
|
3411
|
+
return this.transformResult(url_, _response, (_response) => this.processLoadToggleSet(_response));
|
|
2631
3412
|
});
|
|
2632
3413
|
}
|
|
2633
|
-
|
|
3414
|
+
processLoadToggleSet(response) {
|
|
2634
3415
|
const status = response.status;
|
|
2635
3416
|
let _headers = {};
|
|
2636
3417
|
if (response.headers && typeof response.headers === "object") {
|
|
@@ -2640,12 +3421,11 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2640
3421
|
}
|
|
2641
3422
|
}
|
|
2642
3423
|
}
|
|
2643
|
-
if (status === 200) {
|
|
2644
|
-
const
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
return Promise.resolve(result200);
|
|
3424
|
+
if (status === 200 || status === 206) {
|
|
3425
|
+
const contentDisposition = response.headers ? response.headers["content-disposition"] : undefined;
|
|
3426
|
+
const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
|
|
3427
|
+
const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
|
|
3428
|
+
return Promise.resolve({ fileName: fileName, status: status, data: new Blob([response.data]), headers: _headers });
|
|
2649
3429
|
}
|
|
2650
3430
|
else if (status === 404) {
|
|
2651
3431
|
const _responseText = response.data;
|
|
@@ -2654,6 +3434,13 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2654
3434
|
result404 = JSON.parse(resultData404);
|
|
2655
3435
|
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
2656
3436
|
}
|
|
3437
|
+
else if (status === 409) {
|
|
3438
|
+
const _responseText = response.data;
|
|
3439
|
+
let result409 = null;
|
|
3440
|
+
let resultData409 = _responseText;
|
|
3441
|
+
result409 = JSON.parse(resultData409);
|
|
3442
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
3443
|
+
}
|
|
2657
3444
|
else if (status === 401) {
|
|
2658
3445
|
const _responseText = response.data;
|
|
2659
3446
|
return throwException("Unauthorized", status, _responseText, _headers);
|
|
@@ -2669,15 +3456,14 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2669
3456
|
return Promise.resolve(null);
|
|
2670
3457
|
}
|
|
2671
3458
|
/**
|
|
2672
|
-
*
|
|
3459
|
+
* Gets variable items information for design file taken from storage.
|
|
2673
3460
|
* @param id Design identifier.
|
|
2674
3461
|
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
2675
3462
|
* @param tenantId (optional) Tenant identifier
|
|
2676
|
-
* @param body (optional) Serialized product description.
|
|
2677
3463
|
* @return Success
|
|
2678
3464
|
*/
|
|
2679
|
-
|
|
2680
|
-
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/
|
|
3465
|
+
getVariables(id, privateStorageOwner, tenantId, cancelToken) {
|
|
3466
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/variables?";
|
|
2681
3467
|
if (id === undefined || id === null)
|
|
2682
3468
|
throw new Error("The parameter 'id' must be defined.");
|
|
2683
3469
|
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
@@ -2688,13 +3474,11 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2688
3474
|
else if (tenantId !== undefined)
|
|
2689
3475
|
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2690
3476
|
url_ = url_.replace(/[?&]$/, "");
|
|
2691
|
-
const content_ = JSON.stringify(body);
|
|
2692
3477
|
let options_ = {
|
|
2693
|
-
|
|
2694
|
-
method: "PUT",
|
|
3478
|
+
method: "GET",
|
|
2695
3479
|
url: url_,
|
|
2696
3480
|
headers: {
|
|
2697
|
-
"
|
|
3481
|
+
"Accept": "application/json"
|
|
2698
3482
|
},
|
|
2699
3483
|
cancelToken
|
|
2700
3484
|
};
|
|
@@ -2708,10 +3492,10 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2708
3492
|
throw _error;
|
|
2709
3493
|
}
|
|
2710
3494
|
}).then((_response) => {
|
|
2711
|
-
return this.transformResult(url_, _response, (_response) => this.
|
|
3495
|
+
return this.transformResult(url_, _response, (_response) => this.processGetVariables(_response));
|
|
2712
3496
|
});
|
|
2713
3497
|
}
|
|
2714
|
-
|
|
3498
|
+
processGetVariables(response) {
|
|
2715
3499
|
const status = response.status;
|
|
2716
3500
|
let _headers = {};
|
|
2717
3501
|
if (response.headers && typeof response.headers === "object") {
|
|
@@ -2723,7 +3507,10 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2723
3507
|
}
|
|
2724
3508
|
if (status === 200) {
|
|
2725
3509
|
const _responseText = response.data;
|
|
2726
|
-
|
|
3510
|
+
let result200 = null;
|
|
3511
|
+
let resultData200 = _responseText;
|
|
3512
|
+
result200 = JSON.parse(resultData200);
|
|
3513
|
+
return Promise.resolve(result200);
|
|
2727
3514
|
}
|
|
2728
3515
|
else if (status === 404) {
|
|
2729
3516
|
const _responseText = response.data;
|
|
@@ -2747,20 +3534,15 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2747
3534
|
return Promise.resolve(null);
|
|
2748
3535
|
}
|
|
2749
3536
|
/**
|
|
2750
|
-
*
|
|
3537
|
+
* Sets variable items values for design file taken from storage.
|
|
2751
3538
|
* @param id Design identifier.
|
|
2752
3539
|
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
2753
3540
|
* @param tenantId (optional) Tenant identifier
|
|
2754
|
-
* @param
|
|
2755
|
-
* @param replaceImageItemFileInfo_itemName (optional)
|
|
2756
|
-
* @param replaceImageItemFileInfo_sourceFile (optional)
|
|
2757
|
-
* @param replacePlaceholderItemContentInfo_placeholderItemName (optional)
|
|
2758
|
-
* @param replacePlaceholderItemContentInfo_newContentType (optional)
|
|
2759
|
-
* @param replacePlaceholderItemContentInfo_sourceFile (optional)
|
|
3541
|
+
* @param body (optional) Design variable values.
|
|
2760
3542
|
* @return Success
|
|
2761
3543
|
*/
|
|
2762
|
-
|
|
2763
|
-
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/
|
|
3544
|
+
setVariables(id, privateStorageOwner, tenantId, body, cancelToken) {
|
|
3545
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/variables?";
|
|
2764
3546
|
if (id === undefined || id === null)
|
|
2765
3547
|
throw new Error("The parameter 'id' must be defined.");
|
|
2766
3548
|
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
@@ -2771,28 +3553,14 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2771
3553
|
else if (tenantId !== undefined)
|
|
2772
3554
|
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2773
3555
|
url_ = url_.replace(/[?&]$/, "");
|
|
2774
|
-
const content_ =
|
|
2775
|
-
if (patchType === null || patchType === undefined)
|
|
2776
|
-
throw new Error("The parameter 'patchType' cannot be null.");
|
|
2777
|
-
else
|
|
2778
|
-
content_.append("patchType", patchType.toString());
|
|
2779
|
-
if (replaceImageItemFileInfo_itemName !== null && replaceImageItemFileInfo_itemName !== undefined)
|
|
2780
|
-
content_.append("replaceImageItemFileInfo.itemName", replaceImageItemFileInfo_itemName.toString());
|
|
2781
|
-
if (replaceImageItemFileInfo_sourceFile !== null && replaceImageItemFileInfo_sourceFile !== undefined)
|
|
2782
|
-
content_.append("replaceImageItemFileInfo.sourceFile", replaceImageItemFileInfo_sourceFile.data, replaceImageItemFileInfo_sourceFile.fileName ? replaceImageItemFileInfo_sourceFile.fileName : "replaceImageItemFileInfo.sourceFile");
|
|
2783
|
-
if (replacePlaceholderItemContentInfo_placeholderItemName !== null && replacePlaceholderItemContentInfo_placeholderItemName !== undefined)
|
|
2784
|
-
content_.append("replacePlaceholderItemContentInfo.placeholderItemName", replacePlaceholderItemContentInfo_placeholderItemName.toString());
|
|
2785
|
-
if (replacePlaceholderItemContentInfo_newContentType === null || replacePlaceholderItemContentInfo_newContentType === undefined)
|
|
2786
|
-
throw new Error("The parameter 'replacePlaceholderItemContentInfo_newContentType' cannot be null.");
|
|
2787
|
-
else
|
|
2788
|
-
content_.append("replacePlaceholderItemContentInfo.newContentType", replacePlaceholderItemContentInfo_newContentType.toString());
|
|
2789
|
-
if (replacePlaceholderItemContentInfo_sourceFile !== null && replacePlaceholderItemContentInfo_sourceFile !== undefined)
|
|
2790
|
-
content_.append("replacePlaceholderItemContentInfo.sourceFile", replacePlaceholderItemContentInfo_sourceFile.data, replacePlaceholderItemContentInfo_sourceFile.fileName ? replacePlaceholderItemContentInfo_sourceFile.fileName : "replacePlaceholderItemContentInfo.sourceFile");
|
|
3556
|
+
const content_ = JSON.stringify(body);
|
|
2791
3557
|
let options_ = {
|
|
2792
3558
|
data: content_,
|
|
2793
|
-
method: "
|
|
3559
|
+
method: "PUT",
|
|
2794
3560
|
url: url_,
|
|
2795
|
-
headers: {
|
|
3561
|
+
headers: {
|
|
3562
|
+
"Content-Type": "application/json",
|
|
3563
|
+
},
|
|
2796
3564
|
cancelToken
|
|
2797
3565
|
};
|
|
2798
3566
|
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
@@ -2805,10 +3573,10 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2805
3573
|
throw _error;
|
|
2806
3574
|
}
|
|
2807
3575
|
}).then((_response) => {
|
|
2808
|
-
return this.transformResult(url_, _response, (_response) => this.
|
|
3576
|
+
return this.transformResult(url_, _response, (_response) => this.processSetVariables(_response));
|
|
2809
3577
|
});
|
|
2810
3578
|
}
|
|
2811
|
-
|
|
3579
|
+
processSetVariables(response) {
|
|
2812
3580
|
const status = response.status;
|
|
2813
3581
|
let _headers = {};
|
|
2814
3582
|
if (response.headers && typeof response.headers === "object") {
|
|
@@ -2829,6 +3597,13 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2829
3597
|
result404 = JSON.parse(resultData404);
|
|
2830
3598
|
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
2831
3599
|
}
|
|
3600
|
+
else if (status === 409) {
|
|
3601
|
+
const _responseText = response.data;
|
|
3602
|
+
let result409 = null;
|
|
3603
|
+
let resultData409 = _responseText;
|
|
3604
|
+
result409 = JSON.parse(resultData409);
|
|
3605
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
3606
|
+
}
|
|
2832
3607
|
else if (status === 401) {
|
|
2833
3608
|
const _responseText = response.data;
|
|
2834
3609
|
return throwException("Unauthorized", status, _responseText, _headers);
|
|
@@ -2844,14 +3619,14 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2844
3619
|
return Promise.resolve(null);
|
|
2845
3620
|
}
|
|
2846
3621
|
/**
|
|
2847
|
-
*
|
|
3622
|
+
* Loads variable data printing information from design file taken from storage.
|
|
2848
3623
|
* @param id Design identifier.
|
|
2849
3624
|
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
2850
3625
|
* @param tenantId (optional) Tenant identifier
|
|
2851
3626
|
* @return Success
|
|
2852
3627
|
*/
|
|
2853
|
-
|
|
2854
|
-
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/
|
|
3628
|
+
loadVdpData(id, privateStorageOwner, tenantId, cancelToken) {
|
|
3629
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/vdp-data?";
|
|
2855
3630
|
if (id === undefined || id === null)
|
|
2856
3631
|
throw new Error("The parameter 'id' must be defined.");
|
|
2857
3632
|
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
@@ -2880,10 +3655,10 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2880
3655
|
throw _error;
|
|
2881
3656
|
}
|
|
2882
3657
|
}).then((_response) => {
|
|
2883
|
-
return this.transformResult(url_, _response, (_response) => this.
|
|
3658
|
+
return this.transformResult(url_, _response, (_response) => this.processLoadVdpData(_response));
|
|
2884
3659
|
});
|
|
2885
3660
|
}
|
|
2886
|
-
|
|
3661
|
+
processLoadVdpData(response) {
|
|
2887
3662
|
const status = response.status;
|
|
2888
3663
|
let _headers = {};
|
|
2889
3664
|
if (response.headers && typeof response.headers === "object") {
|
|
@@ -2907,6 +3682,13 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2907
3682
|
result404 = JSON.parse(resultData404);
|
|
2908
3683
|
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
2909
3684
|
}
|
|
3685
|
+
else if (status === 409) {
|
|
3686
|
+
const _responseText = response.data;
|
|
3687
|
+
let result409 = null;
|
|
3688
|
+
let resultData409 = _responseText;
|
|
3689
|
+
result409 = JSON.parse(resultData409);
|
|
3690
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
3691
|
+
}
|
|
2910
3692
|
else if (status === 401) {
|
|
2911
3693
|
const _responseText = response.data;
|
|
2912
3694
|
return throwException("Unauthorized", status, _responseText, _headers);
|
|
@@ -2922,14 +3704,15 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2922
3704
|
return Promise.resolve(null);
|
|
2923
3705
|
}
|
|
2924
3706
|
/**
|
|
2925
|
-
*
|
|
3707
|
+
* Saves variable data printing information to design file and updates design in storage.
|
|
2926
3708
|
* @param id Design identifier.
|
|
2927
3709
|
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
2928
3710
|
* @param tenantId (optional) Tenant identifier
|
|
3711
|
+
* @param body (optional) Serialized vdp data.
|
|
2929
3712
|
* @return Success
|
|
2930
3713
|
*/
|
|
2931
|
-
|
|
2932
|
-
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/
|
|
3714
|
+
saveVdpData(id, privateStorageOwner, tenantId, body, cancelToken) {
|
|
3715
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/vdp-data?";
|
|
2933
3716
|
if (id === undefined || id === null)
|
|
2934
3717
|
throw new Error("The parameter 'id' must be defined.");
|
|
2935
3718
|
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
@@ -2940,12 +3723,13 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2940
3723
|
else if (tenantId !== undefined)
|
|
2941
3724
|
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2942
3725
|
url_ = url_.replace(/[?&]$/, "");
|
|
3726
|
+
const content_ = JSON.stringify(body);
|
|
2943
3727
|
let options_ = {
|
|
2944
|
-
|
|
2945
|
-
method: "
|
|
3728
|
+
data: content_,
|
|
3729
|
+
method: "PUT",
|
|
2946
3730
|
url: url_,
|
|
2947
3731
|
headers: {
|
|
2948
|
-
"
|
|
3732
|
+
"Content-Type": "application/json",
|
|
2949
3733
|
},
|
|
2950
3734
|
cancelToken
|
|
2951
3735
|
};
|
|
@@ -2959,10 +3743,10 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2959
3743
|
throw _error;
|
|
2960
3744
|
}
|
|
2961
3745
|
}).then((_response) => {
|
|
2962
|
-
return this.transformResult(url_, _response, (_response) => this.
|
|
3746
|
+
return this.transformResult(url_, _response, (_response) => this.processSaveVdpData(_response));
|
|
2963
3747
|
});
|
|
2964
3748
|
}
|
|
2965
|
-
|
|
3749
|
+
processSaveVdpData(response) {
|
|
2966
3750
|
const status = response.status;
|
|
2967
3751
|
let _headers = {};
|
|
2968
3752
|
if (response.headers && typeof response.headers === "object") {
|
|
@@ -2972,11 +3756,9 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2972
3756
|
}
|
|
2973
3757
|
}
|
|
2974
3758
|
}
|
|
2975
|
-
if (status === 200
|
|
2976
|
-
const
|
|
2977
|
-
|
|
2978
|
-
const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
|
|
2979
|
-
return Promise.resolve({ fileName: fileName, status: status, data: new Blob([response.data]), headers: _headers });
|
|
3759
|
+
if (status === 200) {
|
|
3760
|
+
const _responseText = response.data;
|
|
3761
|
+
return Promise.resolve(null);
|
|
2980
3762
|
}
|
|
2981
3763
|
else if (status === 404) {
|
|
2982
3764
|
const _responseText = response.data;
|
|
@@ -2985,13 +3767,6 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2985
3767
|
result404 = JSON.parse(resultData404);
|
|
2986
3768
|
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
2987
3769
|
}
|
|
2988
|
-
else if (status === 409) {
|
|
2989
|
-
const _responseText = response.data;
|
|
2990
|
-
let result409 = null;
|
|
2991
|
-
let resultData409 = _responseText;
|
|
2992
|
-
result409 = JSON.parse(resultData409);
|
|
2993
|
-
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
2994
|
-
}
|
|
2995
3770
|
else if (status === 401) {
|
|
2996
3771
|
const _responseText = response.data;
|
|
2997
3772
|
return throwException("Unauthorized", status, _responseText, _headers);
|
|
@@ -3007,14 +3782,14 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3007
3782
|
return Promise.resolve(null);
|
|
3008
3783
|
}
|
|
3009
3784
|
/**
|
|
3010
|
-
*
|
|
3785
|
+
* Deletes variable data printing information from design file and updates design in storage.
|
|
3011
3786
|
* @param id Design identifier.
|
|
3012
3787
|
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
3013
3788
|
* @param tenantId (optional) Tenant identifier
|
|
3014
3789
|
* @return Success
|
|
3015
3790
|
*/
|
|
3016
|
-
|
|
3017
|
-
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/
|
|
3791
|
+
deleteVdpData(id, privateStorageOwner, tenantId, cancelToken) {
|
|
3792
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/vdp-data?";
|
|
3018
3793
|
if (id === undefined || id === null)
|
|
3019
3794
|
throw new Error("The parameter 'id' must be defined.");
|
|
3020
3795
|
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
@@ -3026,12 +3801,9 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3026
3801
|
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
3027
3802
|
url_ = url_.replace(/[?&]$/, "");
|
|
3028
3803
|
let options_ = {
|
|
3029
|
-
|
|
3030
|
-
method: "GET",
|
|
3804
|
+
method: "DELETE",
|
|
3031
3805
|
url: url_,
|
|
3032
|
-
headers: {
|
|
3033
|
-
"Accept": "application/octet-stream"
|
|
3034
|
-
},
|
|
3806
|
+
headers: {},
|
|
3035
3807
|
cancelToken
|
|
3036
3808
|
};
|
|
3037
3809
|
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
@@ -3044,10 +3816,10 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3044
3816
|
throw _error;
|
|
3045
3817
|
}
|
|
3046
3818
|
}).then((_response) => {
|
|
3047
|
-
return this.transformResult(url_, _response, (_response) => this.
|
|
3819
|
+
return this.transformResult(url_, _response, (_response) => this.processDeleteVdpData(_response));
|
|
3048
3820
|
});
|
|
3049
3821
|
}
|
|
3050
|
-
|
|
3822
|
+
processDeleteVdpData(response) {
|
|
3051
3823
|
const status = response.status;
|
|
3052
3824
|
let _headers = {};
|
|
3053
3825
|
if (response.headers && typeof response.headers === "object") {
|
|
@@ -3057,18 +3829,9 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3057
3829
|
}
|
|
3058
3830
|
}
|
|
3059
3831
|
}
|
|
3060
|
-
if (status === 200
|
|
3061
|
-
const contentDisposition = response.headers ? response.headers["content-disposition"] : undefined;
|
|
3062
|
-
const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
|
|
3063
|
-
const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
|
|
3064
|
-
return Promise.resolve({ fileName: fileName, status: status, data: new Blob([response.data]), headers: _headers });
|
|
3065
|
-
}
|
|
3066
|
-
else if (status === 404) {
|
|
3832
|
+
if (status === 200) {
|
|
3067
3833
|
const _responseText = response.data;
|
|
3068
|
-
|
|
3069
|
-
let resultData404 = _responseText;
|
|
3070
|
-
result404 = JSON.parse(resultData404);
|
|
3071
|
-
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
3834
|
+
return Promise.resolve(null);
|
|
3072
3835
|
}
|
|
3073
3836
|
else if (status === 409) {
|
|
3074
3837
|
const _responseText = response.data;
|
|
@@ -3092,14 +3855,14 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3092
3855
|
return Promise.resolve(null);
|
|
3093
3856
|
}
|
|
3094
3857
|
/**
|
|
3095
|
-
*
|
|
3096
|
-
* @param id
|
|
3858
|
+
* Loads product (design model) from resource file taken from storage.
|
|
3859
|
+
* @param id Resource identifier.
|
|
3097
3860
|
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
3098
3861
|
* @param tenantId (optional) Tenant identifier
|
|
3099
3862
|
* @return Success
|
|
3100
3863
|
*/
|
|
3101
|
-
|
|
3102
|
-
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/
|
|
3864
|
+
loadProductFromResource(id, privateStorageOwner, tenantId, cancelToken) {
|
|
3865
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/from-resource/{id}/model?";
|
|
3103
3866
|
if (id === undefined || id === null)
|
|
3104
3867
|
throw new Error("The parameter 'id' must be defined.");
|
|
3105
3868
|
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
@@ -3128,10 +3891,10 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3128
3891
|
throw _error;
|
|
3129
3892
|
}
|
|
3130
3893
|
}).then((_response) => {
|
|
3131
|
-
return this.transformResult(url_, _response, (_response) => this.
|
|
3894
|
+
return this.transformResult(url_, _response, (_response) => this.processLoadProductFromResource(_response));
|
|
3132
3895
|
});
|
|
3133
3896
|
}
|
|
3134
|
-
|
|
3897
|
+
processLoadProductFromResource(response) {
|
|
3135
3898
|
const status = response.status;
|
|
3136
3899
|
let _headers = {};
|
|
3137
3900
|
if (response.headers && typeof response.headers === "object") {
|
|
@@ -3155,6 +3918,13 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3155
3918
|
result404 = JSON.parse(resultData404);
|
|
3156
3919
|
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
3157
3920
|
}
|
|
3921
|
+
else if (status === 422) {
|
|
3922
|
+
const _responseText = response.data;
|
|
3923
|
+
let result422 = null;
|
|
3924
|
+
let resultData422 = _responseText;
|
|
3925
|
+
result422 = JSON.parse(resultData422);
|
|
3926
|
+
return throwException("Client Error", status, _responseText, _headers, result422);
|
|
3927
|
+
}
|
|
3158
3928
|
else if (status === 401) {
|
|
3159
3929
|
const _responseText = response.data;
|
|
3160
3930
|
return throwException("Unauthorized", status, _responseText, _headers);
|
|
@@ -3170,20 +3940,13 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3170
3940
|
return Promise.resolve(null);
|
|
3171
3941
|
}
|
|
3172
3942
|
/**
|
|
3173
|
-
*
|
|
3174
|
-
* @param id Design identifier.
|
|
3175
|
-
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
3943
|
+
* Converts colors.
|
|
3176
3944
|
* @param tenantId (optional) Tenant identifier
|
|
3177
|
-
* @param body (optional)
|
|
3945
|
+
* @param body (optional) Convert colors operation parameters.
|
|
3178
3946
|
* @return Success
|
|
3179
3947
|
*/
|
|
3180
|
-
|
|
3181
|
-
let url_ = this.baseUrl + "/api/atoms/v1/designs/
|
|
3182
|
-
if (id === undefined || id === null)
|
|
3183
|
-
throw new Error("The parameter 'id' must be defined.");
|
|
3184
|
-
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
3185
|
-
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
3186
|
-
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
3948
|
+
convertColors(tenantId, body, cancelToken) {
|
|
3949
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/model/convert-colors?";
|
|
3187
3950
|
if (tenantId === null)
|
|
3188
3951
|
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
3189
3952
|
else if (tenantId !== undefined)
|
|
@@ -3192,10 +3955,11 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3192
3955
|
const content_ = JSON.stringify(body);
|
|
3193
3956
|
let options_ = {
|
|
3194
3957
|
data: content_,
|
|
3195
|
-
method: "
|
|
3958
|
+
method: "POST",
|
|
3196
3959
|
url: url_,
|
|
3197
3960
|
headers: {
|
|
3198
3961
|
"Content-Type": "application/json",
|
|
3962
|
+
"Accept": "application/json"
|
|
3199
3963
|
},
|
|
3200
3964
|
cancelToken
|
|
3201
3965
|
};
|
|
@@ -3209,10 +3973,10 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3209
3973
|
throw _error;
|
|
3210
3974
|
}
|
|
3211
3975
|
}).then((_response) => {
|
|
3212
|
-
return this.transformResult(url_, _response, (_response) => this.
|
|
3976
|
+
return this.transformResult(url_, _response, (_response) => this.processConvertColors(_response));
|
|
3213
3977
|
});
|
|
3214
3978
|
}
|
|
3215
|
-
|
|
3979
|
+
processConvertColors(response) {
|
|
3216
3980
|
const status = response.status;
|
|
3217
3981
|
let _headers = {};
|
|
3218
3982
|
if (response.headers && typeof response.headers === "object") {
|
|
@@ -3224,7 +3988,10 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3224
3988
|
}
|
|
3225
3989
|
if (status === 200) {
|
|
3226
3990
|
const _responseText = response.data;
|
|
3227
|
-
|
|
3991
|
+
let result200 = null;
|
|
3992
|
+
let resultData200 = _responseText;
|
|
3993
|
+
result200 = JSON.parse(resultData200);
|
|
3994
|
+
return Promise.resolve(result200);
|
|
3228
3995
|
}
|
|
3229
3996
|
else if (status === 404) {
|
|
3230
3997
|
const _responseText = response.data;
|
|
@@ -3233,13 +4000,6 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3233
4000
|
result404 = JSON.parse(resultData404);
|
|
3234
4001
|
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
3235
4002
|
}
|
|
3236
|
-
else if (status === 409) {
|
|
3237
|
-
const _responseText = response.data;
|
|
3238
|
-
let result409 = null;
|
|
3239
|
-
let resultData409 = _responseText;
|
|
3240
|
-
result409 = JSON.parse(resultData409);
|
|
3241
|
-
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
3242
|
-
}
|
|
3243
4003
|
else if (status === 401) {
|
|
3244
4004
|
const _responseText = response.data;
|
|
3245
4005
|
return throwException("Unauthorized", status, _responseText, _headers);
|
|
@@ -3255,29 +4015,27 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3255
4015
|
return Promise.resolve(null);
|
|
3256
4016
|
}
|
|
3257
4017
|
/**
|
|
3258
|
-
*
|
|
3259
|
-
* @param id Design identifier.
|
|
3260
|
-
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
4018
|
+
* Extracts product item image.
|
|
3261
4019
|
* @param tenantId (optional) Tenant identifier
|
|
4020
|
+
* @param body (optional) Extraction parameters.
|
|
3262
4021
|
* @return Success
|
|
3263
4022
|
*/
|
|
3264
|
-
|
|
3265
|
-
let url_ = this.baseUrl + "/api/atoms/v1/designs/
|
|
3266
|
-
if (id === undefined || id === null)
|
|
3267
|
-
throw new Error("The parameter 'id' must be defined.");
|
|
3268
|
-
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
3269
|
-
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
3270
|
-
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
4023
|
+
extractItemImage(tenantId, body, cancelToken) {
|
|
4024
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/model/items/extract-image?";
|
|
3271
4025
|
if (tenantId === null)
|
|
3272
4026
|
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
3273
4027
|
else if (tenantId !== undefined)
|
|
3274
4028
|
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
3275
4029
|
url_ = url_.replace(/[?&]$/, "");
|
|
4030
|
+
const content_ = JSON.stringify(body);
|
|
3276
4031
|
let options_ = {
|
|
3277
|
-
|
|
4032
|
+
data: content_,
|
|
4033
|
+
responseType: "blob",
|
|
4034
|
+
method: "POST",
|
|
3278
4035
|
url: url_,
|
|
3279
4036
|
headers: {
|
|
3280
|
-
"
|
|
4037
|
+
"Content-Type": "application/json",
|
|
4038
|
+
"Accept": "application/octet-stream"
|
|
3281
4039
|
},
|
|
3282
4040
|
cancelToken
|
|
3283
4041
|
};
|
|
@@ -3291,10 +4049,10 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3291
4049
|
throw _error;
|
|
3292
4050
|
}
|
|
3293
4051
|
}).then((_response) => {
|
|
3294
|
-
return this.transformResult(url_, _response, (_response) => this.
|
|
4052
|
+
return this.transformResult(url_, _response, (_response) => this.processExtractItemImage(_response));
|
|
3295
4053
|
});
|
|
3296
4054
|
}
|
|
3297
|
-
|
|
4055
|
+
processExtractItemImage(response) {
|
|
3298
4056
|
const status = response.status;
|
|
3299
4057
|
let _headers = {};
|
|
3300
4058
|
if (response.headers && typeof response.headers === "object") {
|
|
@@ -3304,26 +4062,11 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3304
4062
|
}
|
|
3305
4063
|
}
|
|
3306
4064
|
}
|
|
3307
|
-
if (status === 200) {
|
|
3308
|
-
const
|
|
3309
|
-
|
|
3310
|
-
|
|
3311
|
-
|
|
3312
|
-
return Promise.resolve(result200);
|
|
3313
|
-
}
|
|
3314
|
-
else if (status === 404) {
|
|
3315
|
-
const _responseText = response.data;
|
|
3316
|
-
let result404 = null;
|
|
3317
|
-
let resultData404 = _responseText;
|
|
3318
|
-
result404 = JSON.parse(resultData404);
|
|
3319
|
-
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
3320
|
-
}
|
|
3321
|
-
else if (status === 409) {
|
|
3322
|
-
const _responseText = response.data;
|
|
3323
|
-
let result409 = null;
|
|
3324
|
-
let resultData409 = _responseText;
|
|
3325
|
-
result409 = JSON.parse(resultData409);
|
|
3326
|
-
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
4065
|
+
if (status === 200 || status === 206) {
|
|
4066
|
+
const contentDisposition = response.headers ? response.headers["content-disposition"] : undefined;
|
|
4067
|
+
const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
|
|
4068
|
+
const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
|
|
4069
|
+
return Promise.resolve({ fileName: fileName, status: status, data: new Blob([response.data]), headers: _headers });
|
|
3327
4070
|
}
|
|
3328
4071
|
else if (status === 401) {
|
|
3329
4072
|
const _responseText = response.data;
|
|
@@ -3340,20 +4083,13 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3340
4083
|
return Promise.resolve(null);
|
|
3341
4084
|
}
|
|
3342
4085
|
/**
|
|
3343
|
-
*
|
|
3344
|
-
* @param id Design identifier.
|
|
3345
|
-
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
4086
|
+
* Flatten items.
|
|
3346
4087
|
* @param tenantId (optional) Tenant identifier
|
|
3347
|
-
* @param body (optional)
|
|
4088
|
+
* @param body (optional) Items to flatten.
|
|
3348
4089
|
* @return Success
|
|
3349
4090
|
*/
|
|
3350
|
-
|
|
3351
|
-
let url_ = this.baseUrl + "/api/atoms/v1/designs/
|
|
3352
|
-
if (id === undefined || id === null)
|
|
3353
|
-
throw new Error("The parameter 'id' must be defined.");
|
|
3354
|
-
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
3355
|
-
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
3356
|
-
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
4091
|
+
flattenItems(tenantId, body, cancelToken) {
|
|
4092
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/model/items/flatten?";
|
|
3357
4093
|
if (tenantId === null)
|
|
3358
4094
|
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
3359
4095
|
else if (tenantId !== undefined)
|
|
@@ -3362,10 +4098,11 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3362
4098
|
const content_ = JSON.stringify(body);
|
|
3363
4099
|
let options_ = {
|
|
3364
4100
|
data: content_,
|
|
3365
|
-
method: "
|
|
4101
|
+
method: "POST",
|
|
3366
4102
|
url: url_,
|
|
3367
4103
|
headers: {
|
|
3368
4104
|
"Content-Type": "application/json",
|
|
4105
|
+
"Accept": "application/json"
|
|
3369
4106
|
},
|
|
3370
4107
|
cancelToken
|
|
3371
4108
|
};
|
|
@@ -3379,10 +4116,10 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3379
4116
|
throw _error;
|
|
3380
4117
|
}
|
|
3381
4118
|
}).then((_response) => {
|
|
3382
|
-
return this.transformResult(url_, _response, (_response) => this.
|
|
4119
|
+
return this.transformResult(url_, _response, (_response) => this.processFlattenItems(_response));
|
|
3383
4120
|
});
|
|
3384
4121
|
}
|
|
3385
|
-
|
|
4122
|
+
processFlattenItems(response) {
|
|
3386
4123
|
const status = response.status;
|
|
3387
4124
|
let _headers = {};
|
|
3388
4125
|
if (response.headers && typeof response.headers === "object") {
|
|
@@ -3394,14 +4131,10 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3394
4131
|
}
|
|
3395
4132
|
if (status === 200) {
|
|
3396
4133
|
const _responseText = response.data;
|
|
3397
|
-
|
|
3398
|
-
|
|
3399
|
-
|
|
3400
|
-
|
|
3401
|
-
let result404 = null;
|
|
3402
|
-
let resultData404 = _responseText;
|
|
3403
|
-
result404 = JSON.parse(resultData404);
|
|
3404
|
-
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
4134
|
+
let result200 = null;
|
|
4135
|
+
let resultData200 = _responseText;
|
|
4136
|
+
result200 = JSON.parse(resultData200);
|
|
4137
|
+
return Promise.resolve(result200);
|
|
3405
4138
|
}
|
|
3406
4139
|
else if (status === 401) {
|
|
3407
4140
|
const _responseText = response.data;
|
|
@@ -3418,28 +4151,31 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3418
4151
|
return Promise.resolve(null);
|
|
3419
4152
|
}
|
|
3420
4153
|
/**
|
|
3421
|
-
*
|
|
3422
|
-
* @param
|
|
3423
|
-
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
4154
|
+
* Creates product item from input image file.
|
|
4155
|
+
* @param itemType (optional) Desired item type.
|
|
3424
4156
|
* @param tenantId (optional) Tenant identifier
|
|
4157
|
+
* @param sourceFile (optional)
|
|
3425
4158
|
* @return Success
|
|
3426
4159
|
*/
|
|
3427
|
-
|
|
3428
|
-
let url_ = this.baseUrl + "/api/atoms/v1/designs/
|
|
3429
|
-
if (
|
|
3430
|
-
|
|
3431
|
-
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
3432
|
-
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
3433
|
-
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
4160
|
+
createItemFromFile(itemType, tenantId, sourceFile, cancelToken) {
|
|
4161
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/model/items/from-file?";
|
|
4162
|
+
if (itemType !== undefined && itemType !== null)
|
|
4163
|
+
url_ += "itemType=" + encodeURIComponent("" + itemType) + "&";
|
|
3434
4164
|
if (tenantId === null)
|
|
3435
4165
|
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
3436
4166
|
else if (tenantId !== undefined)
|
|
3437
4167
|
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
3438
4168
|
url_ = url_.replace(/[?&]$/, "");
|
|
4169
|
+
const content_ = new FormData();
|
|
4170
|
+
if (sourceFile !== null && sourceFile !== undefined)
|
|
4171
|
+
content_.append("sourceFile", sourceFile.data, sourceFile.fileName ? sourceFile.fileName : "sourceFile");
|
|
3439
4172
|
let options_ = {
|
|
3440
|
-
|
|
4173
|
+
data: content_,
|
|
4174
|
+
method: "POST",
|
|
3441
4175
|
url: url_,
|
|
3442
|
-
headers: {
|
|
4176
|
+
headers: {
|
|
4177
|
+
"Accept": "application/json"
|
|
4178
|
+
},
|
|
3443
4179
|
cancelToken
|
|
3444
4180
|
};
|
|
3445
4181
|
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
@@ -3452,10 +4188,10 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3452
4188
|
throw _error;
|
|
3453
4189
|
}
|
|
3454
4190
|
}).then((_response) => {
|
|
3455
|
-
return this.transformResult(url_, _response, (_response) => this.
|
|
4191
|
+
return this.transformResult(url_, _response, (_response) => this.processCreateItemFromFile(_response));
|
|
3456
4192
|
});
|
|
3457
4193
|
}
|
|
3458
|
-
|
|
4194
|
+
processCreateItemFromFile(response) {
|
|
3459
4195
|
const status = response.status;
|
|
3460
4196
|
let _headers = {};
|
|
3461
4197
|
if (response.headers && typeof response.headers === "object") {
|
|
@@ -3467,14 +4203,17 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3467
4203
|
}
|
|
3468
4204
|
if (status === 200) {
|
|
3469
4205
|
const _responseText = response.data;
|
|
3470
|
-
|
|
4206
|
+
let result200 = null;
|
|
4207
|
+
let resultData200 = _responseText;
|
|
4208
|
+
result200 = JSON.parse(resultData200);
|
|
4209
|
+
return Promise.resolve(result200);
|
|
3471
4210
|
}
|
|
3472
|
-
else if (status ===
|
|
4211
|
+
else if (status === 404) {
|
|
3473
4212
|
const _responseText = response.data;
|
|
3474
|
-
let
|
|
3475
|
-
let
|
|
3476
|
-
|
|
3477
|
-
return throwException("
|
|
4213
|
+
let result404 = null;
|
|
4214
|
+
let resultData404 = _responseText;
|
|
4215
|
+
result404 = JSON.parse(resultData404);
|
|
4216
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
3478
4217
|
}
|
|
3479
4218
|
else if (status === 401) {
|
|
3480
4219
|
const _responseText = response.data;
|
|
@@ -3491,26 +4230,27 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3491
4230
|
return Promise.resolve(null);
|
|
3492
4231
|
}
|
|
3493
4232
|
/**
|
|
3494
|
-
*
|
|
3495
|
-
* @param
|
|
3496
|
-
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
4233
|
+
* Creates multiple product items from input image files.
|
|
4234
|
+
* @param itemType (optional) Desired items type.
|
|
3497
4235
|
* @param tenantId (optional) Tenant identifier
|
|
4236
|
+
* @param sourceFiles (optional)
|
|
3498
4237
|
* @return Success
|
|
3499
4238
|
*/
|
|
3500
|
-
|
|
3501
|
-
let url_ = this.baseUrl + "/api/atoms/v1/designs/from-
|
|
3502
|
-
if (
|
|
3503
|
-
|
|
3504
|
-
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
3505
|
-
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
3506
|
-
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
4239
|
+
batchCreateItemsFromFile(itemType, tenantId, sourceFiles, cancelToken) {
|
|
4240
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/model/items/from-file/batch-create?";
|
|
4241
|
+
if (itemType !== undefined && itemType !== null)
|
|
4242
|
+
url_ += "itemType=" + encodeURIComponent("" + itemType) + "&";
|
|
3507
4243
|
if (tenantId === null)
|
|
3508
4244
|
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
3509
4245
|
else if (tenantId !== undefined)
|
|
3510
4246
|
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
3511
4247
|
url_ = url_.replace(/[?&]$/, "");
|
|
4248
|
+
const content_ = new FormData();
|
|
4249
|
+
if (sourceFiles !== null && sourceFiles !== undefined)
|
|
4250
|
+
sourceFiles.forEach(item_ => content_.append("sourceFiles", item_.data, item_.fileName ? item_.fileName : "sourceFiles"));
|
|
3512
4251
|
let options_ = {
|
|
3513
|
-
|
|
4252
|
+
data: content_,
|
|
4253
|
+
method: "POST",
|
|
3514
4254
|
url: url_,
|
|
3515
4255
|
headers: {
|
|
3516
4256
|
"Accept": "application/json"
|
|
@@ -3527,10 +4267,10 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3527
4267
|
throw _error;
|
|
3528
4268
|
}
|
|
3529
4269
|
}).then((_response) => {
|
|
3530
|
-
return this.transformResult(url_, _response, (_response) => this.
|
|
4270
|
+
return this.transformResult(url_, _response, (_response) => this.processBatchCreateItemsFromFile(_response));
|
|
3531
4271
|
});
|
|
3532
4272
|
}
|
|
3533
|
-
|
|
4273
|
+
processBatchCreateItemsFromFile(response) {
|
|
3534
4274
|
const status = response.status;
|
|
3535
4275
|
let _headers = {};
|
|
3536
4276
|
if (response.headers && typeof response.headers === "object") {
|
|
@@ -3554,13 +4294,6 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3554
4294
|
result404 = JSON.parse(resultData404);
|
|
3555
4295
|
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
3556
4296
|
}
|
|
3557
|
-
else if (status === 422) {
|
|
3558
|
-
const _responseText = response.data;
|
|
3559
|
-
let result422 = null;
|
|
3560
|
-
let resultData422 = _responseText;
|
|
3561
|
-
result422 = JSON.parse(resultData422);
|
|
3562
|
-
return throwException("Client Error", status, _responseText, _headers, result422);
|
|
3563
|
-
}
|
|
3564
4297
|
else if (status === 401) {
|
|
3565
4298
|
const _responseText = response.data;
|
|
3566
4299
|
return throwException("Unauthorized", status, _responseText, _headers);
|
|
@@ -3576,13 +4309,16 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3576
4309
|
return Promise.resolve(null);
|
|
3577
4310
|
}
|
|
3578
4311
|
/**
|
|
3579
|
-
*
|
|
4312
|
+
* Creates product item from image in storage.
|
|
4313
|
+
* @param itemType (optional) Desired item type.
|
|
3580
4314
|
* @param tenantId (optional) Tenant identifier
|
|
3581
|
-
* @param body (optional)
|
|
4315
|
+
* @param body (optional) Operation parameters.
|
|
3582
4316
|
* @return Success
|
|
3583
4317
|
*/
|
|
3584
|
-
|
|
3585
|
-
let url_ = this.baseUrl + "/api/atoms/v1/designs/model/
|
|
4318
|
+
createItemFromStorage(itemType, tenantId, body, cancelToken) {
|
|
4319
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/model/items/from-storage?";
|
|
4320
|
+
if (itemType !== undefined && itemType !== null)
|
|
4321
|
+
url_ += "itemType=" + encodeURIComponent("" + itemType) + "&";
|
|
3586
4322
|
if (tenantId === null)
|
|
3587
4323
|
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
3588
4324
|
else if (tenantId !== undefined)
|
|
@@ -3609,10 +4345,10 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3609
4345
|
throw _error;
|
|
3610
4346
|
}
|
|
3611
4347
|
}).then((_response) => {
|
|
3612
|
-
return this.transformResult(url_, _response, (_response) => this.
|
|
4348
|
+
return this.transformResult(url_, _response, (_response) => this.processCreateItemFromStorage(_response));
|
|
3613
4349
|
});
|
|
3614
4350
|
}
|
|
3615
|
-
|
|
4351
|
+
processCreateItemFromStorage(response) {
|
|
3616
4352
|
const status = response.status;
|
|
3617
4353
|
let _headers = {};
|
|
3618
4354
|
if (response.headers && typeof response.headers === "object") {
|
|
@@ -3651,17 +4387,14 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3651
4387
|
return Promise.resolve(null);
|
|
3652
4388
|
}
|
|
3653
4389
|
/**
|
|
3654
|
-
* Creates product
|
|
3655
|
-
* @param itemType (optional) Desired
|
|
4390
|
+
* Creates multiple product items from images in storage.
|
|
4391
|
+
* @param itemType (optional) Desired items type.
|
|
3656
4392
|
* @param tenantId (optional) Tenant identifier
|
|
3657
|
-
* @param
|
|
3658
|
-
* @param sourceId (optional)
|
|
3659
|
-
* @param sourceOwnerId (optional)
|
|
3660
|
-
* @param sourceFile (optional)
|
|
4393
|
+
* @param body (optional) Create items operation parameters.
|
|
3661
4394
|
* @return Success
|
|
3662
4395
|
*/
|
|
3663
|
-
|
|
3664
|
-
let url_ = this.baseUrl + "/api/atoms/v1/designs/model/items?";
|
|
4396
|
+
batchCreateItemsFromStorage(itemType, tenantId, body, cancelToken) {
|
|
4397
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/model/items/from-storage/batch-create?";
|
|
3665
4398
|
if (itemType !== undefined && itemType !== null)
|
|
3666
4399
|
url_ += "itemType=" + encodeURIComponent("" + itemType) + "&";
|
|
3667
4400
|
if (tenantId === null)
|
|
@@ -3669,20 +4402,13 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3669
4402
|
else if (tenantId !== undefined)
|
|
3670
4403
|
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
3671
4404
|
url_ = url_.replace(/[?&]$/, "");
|
|
3672
|
-
const content_ =
|
|
3673
|
-
if (sourceType !== null && sourceType !== undefined)
|
|
3674
|
-
content_.append("sourceType", sourceType.toString());
|
|
3675
|
-
if (sourceId !== null && sourceId !== undefined)
|
|
3676
|
-
content_.append("sourceId", sourceId.toString());
|
|
3677
|
-
if (sourceOwnerId !== null && sourceOwnerId !== undefined)
|
|
3678
|
-
content_.append("sourceOwnerId", sourceOwnerId.toString());
|
|
3679
|
-
if (sourceFile !== null && sourceFile !== undefined)
|
|
3680
|
-
content_.append("sourceFile", sourceFile.data, sourceFile.fileName ? sourceFile.fileName : "sourceFile");
|
|
4405
|
+
const content_ = JSON.stringify(body);
|
|
3681
4406
|
let options_ = {
|
|
3682
4407
|
data: content_,
|
|
3683
4408
|
method: "POST",
|
|
3684
4409
|
url: url_,
|
|
3685
4410
|
headers: {
|
|
4411
|
+
"Content-Type": "application/json",
|
|
3686
4412
|
"Accept": "application/json"
|
|
3687
4413
|
},
|
|
3688
4414
|
cancelToken
|
|
@@ -3697,10 +4423,10 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3697
4423
|
throw _error;
|
|
3698
4424
|
}
|
|
3699
4425
|
}).then((_response) => {
|
|
3700
|
-
return this.transformResult(url_, _response, (_response) => this.
|
|
4426
|
+
return this.transformResult(url_, _response, (_response) => this.processBatchCreateItemsFromStorage(_response));
|
|
3701
4427
|
});
|
|
3702
4428
|
}
|
|
3703
|
-
|
|
4429
|
+
processBatchCreateItemsFromStorage(response) {
|
|
3704
4430
|
const status = response.status;
|
|
3705
4431
|
let _headers = {};
|
|
3706
4432
|
if (response.headers && typeof response.headers === "object") {
|
|
@@ -3739,13 +4465,16 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3739
4465
|
return Promise.resolve(null);
|
|
3740
4466
|
}
|
|
3741
4467
|
/**
|
|
3742
|
-
*
|
|
4468
|
+
* Creates product item from remote web image provided by URL.
|
|
4469
|
+
* @param itemType (optional) Desired item type.
|
|
3743
4470
|
* @param tenantId (optional) Tenant identifier
|
|
3744
|
-
* @param body (optional)
|
|
4471
|
+
* @param body (optional) Operation parameters.
|
|
3745
4472
|
* @return Success
|
|
3746
4473
|
*/
|
|
3747
|
-
|
|
3748
|
-
let url_ = this.baseUrl + "/api/atoms/v1/designs/model/items/
|
|
4474
|
+
createItemFromUrl(itemType, tenantId, body, cancelToken) {
|
|
4475
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/model/items/from-url?";
|
|
4476
|
+
if (itemType !== undefined && itemType !== null)
|
|
4477
|
+
url_ += "itemType=" + encodeURIComponent("" + itemType) + "&";
|
|
3749
4478
|
if (tenantId === null)
|
|
3750
4479
|
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
3751
4480
|
else if (tenantId !== undefined)
|
|
@@ -3754,12 +4483,11 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3754
4483
|
const content_ = JSON.stringify(body);
|
|
3755
4484
|
let options_ = {
|
|
3756
4485
|
data: content_,
|
|
3757
|
-
responseType: "blob",
|
|
3758
4486
|
method: "POST",
|
|
3759
4487
|
url: url_,
|
|
3760
4488
|
headers: {
|
|
3761
4489
|
"Content-Type": "application/json",
|
|
3762
|
-
"Accept": "application/
|
|
4490
|
+
"Accept": "application/json"
|
|
3763
4491
|
},
|
|
3764
4492
|
cancelToken
|
|
3765
4493
|
};
|
|
@@ -3773,10 +4501,10 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3773
4501
|
throw _error;
|
|
3774
4502
|
}
|
|
3775
4503
|
}).then((_response) => {
|
|
3776
|
-
return this.transformResult(url_, _response, (_response) => this.
|
|
4504
|
+
return this.transformResult(url_, _response, (_response) => this.processCreateItemFromUrl(_response));
|
|
3777
4505
|
});
|
|
3778
4506
|
}
|
|
3779
|
-
|
|
4507
|
+
processCreateItemFromUrl(response) {
|
|
3780
4508
|
const status = response.status;
|
|
3781
4509
|
let _headers = {};
|
|
3782
4510
|
if (response.headers && typeof response.headers === "object") {
|
|
@@ -3786,11 +4514,19 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3786
4514
|
}
|
|
3787
4515
|
}
|
|
3788
4516
|
}
|
|
3789
|
-
if (status === 200
|
|
3790
|
-
const
|
|
3791
|
-
|
|
3792
|
-
|
|
3793
|
-
|
|
4517
|
+
if (status === 200) {
|
|
4518
|
+
const _responseText = response.data;
|
|
4519
|
+
let result200 = null;
|
|
4520
|
+
let resultData200 = _responseText;
|
|
4521
|
+
result200 = JSON.parse(resultData200);
|
|
4522
|
+
return Promise.resolve(result200);
|
|
4523
|
+
}
|
|
4524
|
+
else if (status === 404) {
|
|
4525
|
+
const _responseText = response.data;
|
|
4526
|
+
let result404 = null;
|
|
4527
|
+
let resultData404 = _responseText;
|
|
4528
|
+
result404 = JSON.parse(resultData404);
|
|
4529
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
3794
4530
|
}
|
|
3795
4531
|
else if (status === 401) {
|
|
3796
4532
|
const _responseText = response.data;
|
|
@@ -3807,13 +4543,16 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3807
4543
|
return Promise.resolve(null);
|
|
3808
4544
|
}
|
|
3809
4545
|
/**
|
|
3810
|
-
*
|
|
4546
|
+
* Creates multiple product items from remote web images provided by URLs list.
|
|
4547
|
+
* @param itemType (optional) Desired items type.
|
|
3811
4548
|
* @param tenantId (optional) Tenant identifier
|
|
3812
|
-
* @param body (optional)
|
|
4549
|
+
* @param body (optional) Operation parameters.
|
|
3813
4550
|
* @return Success
|
|
3814
4551
|
*/
|
|
3815
|
-
|
|
3816
|
-
let url_ = this.baseUrl + "/api/atoms/v1/designs/model/items/
|
|
4552
|
+
batchCreateItemsFromUrl(itemType, tenantId, body, cancelToken) {
|
|
4553
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/model/items/from-url/batch-create?";
|
|
4554
|
+
if (itemType !== undefined && itemType !== null)
|
|
4555
|
+
url_ += "itemType=" + encodeURIComponent("" + itemType) + "&";
|
|
3817
4556
|
if (tenantId === null)
|
|
3818
4557
|
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
3819
4558
|
else if (tenantId !== undefined)
|
|
@@ -3840,10 +4579,10 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3840
4579
|
throw _error;
|
|
3841
4580
|
}
|
|
3842
4581
|
}).then((_response) => {
|
|
3843
|
-
return this.transformResult(url_, _response, (_response) => this.
|
|
4582
|
+
return this.transformResult(url_, _response, (_response) => this.processBatchCreateItemsFromUrl(_response));
|
|
3844
4583
|
});
|
|
3845
4584
|
}
|
|
3846
|
-
|
|
4585
|
+
processBatchCreateItemsFromUrl(response) {
|
|
3847
4586
|
const status = response.status;
|
|
3848
4587
|
let _headers = {};
|
|
3849
4588
|
if (response.headers && typeof response.headers === "object") {
|
|
@@ -3860,6 +4599,13 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3860
4599
|
result200 = JSON.parse(resultData200);
|
|
3861
4600
|
return Promise.resolve(result200);
|
|
3862
4601
|
}
|
|
4602
|
+
else if (status === 404) {
|
|
4603
|
+
const _responseText = response.data;
|
|
4604
|
+
let result404 = null;
|
|
4605
|
+
let resultData404 = _responseText;
|
|
4606
|
+
result404 = JSON.parse(resultData404);
|
|
4607
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
4608
|
+
}
|
|
3863
4609
|
else if (status === 401) {
|
|
3864
4610
|
const _responseText = response.data;
|
|
3865
4611
|
return throwException("Unauthorized", status, _responseText, _headers);
|
|
@@ -4072,6 +4818,13 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
4072
4818
|
result200 = JSON.parse(resultData200);
|
|
4073
4819
|
return Promise.resolve(result200);
|
|
4074
4820
|
}
|
|
4821
|
+
else if (status === 409) {
|
|
4822
|
+
const _responseText = response.data;
|
|
4823
|
+
let result409 = null;
|
|
4824
|
+
let resultData409 = _responseText;
|
|
4825
|
+
result409 = JSON.parse(resultData409);
|
|
4826
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
4827
|
+
}
|
|
4075
4828
|
else if (status === 401) {
|
|
4076
4829
|
const _responseText = response.data;
|
|
4077
4830
|
return throwException("Unauthorized", status, _responseText, _headers);
|
|
@@ -4212,6 +4965,105 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
4212
4965
|
result200 = JSON.parse(resultData200);
|
|
4213
4966
|
return Promise.resolve(result200);
|
|
4214
4967
|
}
|
|
4968
|
+
else if (status === 409) {
|
|
4969
|
+
const _responseText = response.data;
|
|
4970
|
+
let result409 = null;
|
|
4971
|
+
let resultData409 = _responseText;
|
|
4972
|
+
result409 = JSON.parse(resultData409);
|
|
4973
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
4974
|
+
}
|
|
4975
|
+
else if (status === 401) {
|
|
4976
|
+
const _responseText = response.data;
|
|
4977
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
4978
|
+
}
|
|
4979
|
+
else if (status === 403) {
|
|
4980
|
+
const _responseText = response.data;
|
|
4981
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
4982
|
+
}
|
|
4983
|
+
else if (status !== 200 && status !== 204) {
|
|
4984
|
+
const _responseText = response.data;
|
|
4985
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
4986
|
+
}
|
|
4987
|
+
return Promise.resolve(null);
|
|
4988
|
+
}
|
|
4989
|
+
/**
|
|
4990
|
+
* Creates product item.
|
|
4991
|
+
* @param itemType (optional) Desired item type.
|
|
4992
|
+
* @param tenantId (optional) Tenant identifier
|
|
4993
|
+
* @param sourceType (optional)
|
|
4994
|
+
* @param sourceId (optional)
|
|
4995
|
+
* @param sourceOwnerId (optional)
|
|
4996
|
+
* @param url (optional)
|
|
4997
|
+
* @param sourceFile (optional)
|
|
4998
|
+
* @return Success
|
|
4999
|
+
* @deprecated
|
|
5000
|
+
*/
|
|
5001
|
+
createItem(itemType, tenantId, sourceType, sourceId, sourceOwnerId, url, sourceFile, cancelToken) {
|
|
5002
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/model/items?";
|
|
5003
|
+
if (itemType !== undefined && itemType !== null)
|
|
5004
|
+
url_ += "itemType=" + encodeURIComponent("" + itemType) + "&";
|
|
5005
|
+
if (tenantId === null)
|
|
5006
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
5007
|
+
else if (tenantId !== undefined)
|
|
5008
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
5009
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
5010
|
+
const content_ = new FormData();
|
|
5011
|
+
if (sourceType !== null && sourceType !== undefined)
|
|
5012
|
+
content_.append("sourceType", sourceType.toString());
|
|
5013
|
+
if (sourceId !== null && sourceId !== undefined)
|
|
5014
|
+
content_.append("sourceId", sourceId.toString());
|
|
5015
|
+
if (sourceOwnerId !== null && sourceOwnerId !== undefined)
|
|
5016
|
+
content_.append("sourceOwnerId", sourceOwnerId.toString());
|
|
5017
|
+
if (url !== null && url !== undefined)
|
|
5018
|
+
content_.append("url", url.toString());
|
|
5019
|
+
if (sourceFile !== null && sourceFile !== undefined)
|
|
5020
|
+
content_.append("sourceFile", sourceFile.data, sourceFile.fileName ? sourceFile.fileName : "sourceFile");
|
|
5021
|
+
let options_ = {
|
|
5022
|
+
data: content_,
|
|
5023
|
+
method: "POST",
|
|
5024
|
+
url: url_,
|
|
5025
|
+
headers: {
|
|
5026
|
+
"Accept": "application/json"
|
|
5027
|
+
},
|
|
5028
|
+
cancelToken
|
|
5029
|
+
};
|
|
5030
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
5031
|
+
return this.instance.request(transformedOptions_);
|
|
5032
|
+
}).catch((_error) => {
|
|
5033
|
+
if (isAxiosError(_error) && _error.response) {
|
|
5034
|
+
return _error.response;
|
|
5035
|
+
}
|
|
5036
|
+
else {
|
|
5037
|
+
throw _error;
|
|
5038
|
+
}
|
|
5039
|
+
}).then((_response) => {
|
|
5040
|
+
return this.transformResult(url_, _response, (_response) => this.processCreateItem(_response));
|
|
5041
|
+
});
|
|
5042
|
+
}
|
|
5043
|
+
processCreateItem(response) {
|
|
5044
|
+
const status = response.status;
|
|
5045
|
+
let _headers = {};
|
|
5046
|
+
if (response.headers && typeof response.headers === "object") {
|
|
5047
|
+
for (let k in response.headers) {
|
|
5048
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
5049
|
+
_headers[k] = response.headers[k];
|
|
5050
|
+
}
|
|
5051
|
+
}
|
|
5052
|
+
}
|
|
5053
|
+
if (status === 200) {
|
|
5054
|
+
const _responseText = response.data;
|
|
5055
|
+
let result200 = null;
|
|
5056
|
+
let resultData200 = _responseText;
|
|
5057
|
+
result200 = JSON.parse(resultData200);
|
|
5058
|
+
return Promise.resolve(result200);
|
|
5059
|
+
}
|
|
5060
|
+
else if (status === 404) {
|
|
5061
|
+
const _responseText = response.data;
|
|
5062
|
+
let result404 = null;
|
|
5063
|
+
let resultData404 = _responseText;
|
|
5064
|
+
result404 = JSON.parse(resultData404);
|
|
5065
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
5066
|
+
}
|
|
4215
5067
|
else if (status === 401) {
|
|
4216
5068
|
const _responseText = response.data;
|
|
4217
5069
|
return throwException("Unauthorized", status, _responseText, _headers);
|
|
@@ -6298,6 +7150,7 @@ export var ItemSourceType;
|
|
|
6298
7150
|
ItemSourceType["File"] = "File";
|
|
6299
7151
|
ItemSourceType["ImageStorage"] = "ImageStorage";
|
|
6300
7152
|
ItemSourceType["PrivateImageStorage"] = "PrivateImageStorage";
|
|
7153
|
+
ItemSourceType["Url"] = "Url";
|
|
6301
7154
|
})(ItemSourceType || (ItemSourceType = {}));
|
|
6302
7155
|
export var ItemType;
|
|
6303
7156
|
(function (ItemType) {
|