@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
|
@@ -2024,7 +2024,7 @@ class DesignAtomsImagesApiClient extends ApiClientBase {
|
|
|
2024
2024
|
this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : this.getBaseUrl("");
|
|
2025
2025
|
}
|
|
2026
2026
|
/**
|
|
2027
|
-
* Renders a
|
|
2027
|
+
* Renders a preview of an image with the specified parameters.
|
|
2028
2028
|
* @param attachment (optional) If set to 'true', file will be provided as an attachment with unique filename supplied
|
|
2029
2029
|
(default value is 'false').
|
|
2030
2030
|
* @param tenantId (optional) Tenant identifier
|
|
@@ -2096,13 +2096,295 @@ class DesignAtomsImagesApiClient extends ApiClientBase {
|
|
|
2096
2096
|
return Promise.resolve(null);
|
|
2097
2097
|
}
|
|
2098
2098
|
/**
|
|
2099
|
-
* Renders a
|
|
2099
|
+
* Renders a preview of an uploaded image with the specified parameters.
|
|
2100
|
+
* @param attachment (optional) If set to 'true', file will be provided as an attachment with unique filename supplied
|
|
2101
|
+
(default value is 'false').
|
|
2102
|
+
* @param tenantId (optional) Tenant identifier
|
|
2103
|
+
* @param sourceFile (optional)
|
|
2104
|
+
* @param mockupOwnerId (optional)
|
|
2105
|
+
* @param mockupId (optional)
|
|
2106
|
+
* @param width (optional)
|
|
2107
|
+
* @param height (optional)
|
|
2108
|
+
* @param fileFormat (optional)
|
|
2109
|
+
* @param fitMode (optional)
|
|
2110
|
+
* @return Success
|
|
2111
|
+
*/
|
|
2112
|
+
renderImagePreviewFromFile(attachment, tenantId, sourceFile, mockupOwnerId, mockupId, width, height, fileFormat, fitMode, cancelToken) {
|
|
2113
|
+
let url_ = this.baseUrl + "/api/atoms/v1/images/render-preview/from-file?";
|
|
2114
|
+
if (attachment !== undefined && attachment !== null)
|
|
2115
|
+
url_ += "attachment=" + encodeURIComponent("" + attachment) + "&";
|
|
2116
|
+
if (tenantId === null)
|
|
2117
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
2118
|
+
else if (tenantId !== undefined)
|
|
2119
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2120
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
2121
|
+
const content_ = new FormData();
|
|
2122
|
+
if (sourceFile !== null && sourceFile !== undefined)
|
|
2123
|
+
content_.append("sourceFile", sourceFile.data, sourceFile.fileName ? sourceFile.fileName : "sourceFile");
|
|
2124
|
+
if (mockupOwnerId !== null && mockupOwnerId !== undefined)
|
|
2125
|
+
content_.append("mockupOwnerId", mockupOwnerId.toString());
|
|
2126
|
+
if (mockupId !== null && mockupId !== undefined)
|
|
2127
|
+
content_.append("mockupId", mockupId.toString());
|
|
2128
|
+
if (width !== null && width !== undefined)
|
|
2129
|
+
content_.append("width", width.toString());
|
|
2130
|
+
if (height !== null && height !== undefined)
|
|
2131
|
+
content_.append("height", height.toString());
|
|
2132
|
+
if (fileFormat !== null && fileFormat !== undefined)
|
|
2133
|
+
content_.append("fileFormat", fileFormat.toString());
|
|
2134
|
+
if (fitMode !== null && fitMode !== undefined)
|
|
2135
|
+
content_.append("fitMode", fitMode.toString());
|
|
2136
|
+
let options_ = {
|
|
2137
|
+
data: content_,
|
|
2138
|
+
responseType: "blob",
|
|
2139
|
+
method: "POST",
|
|
2140
|
+
url: url_,
|
|
2141
|
+
headers: {
|
|
2142
|
+
"Accept": "application/octet-stream"
|
|
2143
|
+
},
|
|
2144
|
+
cancelToken
|
|
2145
|
+
};
|
|
2146
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
2147
|
+
return this.instance.request(transformedOptions_);
|
|
2148
|
+
}).catch((_error) => {
|
|
2149
|
+
if (isAxiosError(_error) && _error.response) {
|
|
2150
|
+
return _error.response;
|
|
2151
|
+
}
|
|
2152
|
+
else {
|
|
2153
|
+
throw _error;
|
|
2154
|
+
}
|
|
2155
|
+
}).then((_response) => {
|
|
2156
|
+
return this.transformResult(url_, _response, (_response) => this.processRenderImagePreviewFromFile(_response));
|
|
2157
|
+
});
|
|
2158
|
+
}
|
|
2159
|
+
processRenderImagePreviewFromFile(response) {
|
|
2160
|
+
const status = response.status;
|
|
2161
|
+
let _headers = {};
|
|
2162
|
+
if (response.headers && typeof response.headers === "object") {
|
|
2163
|
+
for (let k in response.headers) {
|
|
2164
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
2165
|
+
_headers[k] = response.headers[k];
|
|
2166
|
+
}
|
|
2167
|
+
}
|
|
2168
|
+
}
|
|
2169
|
+
if (status === 200 || status === 206) {
|
|
2170
|
+
const contentDisposition = response.headers ? response.headers["content-disposition"] : undefined;
|
|
2171
|
+
const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
|
|
2172
|
+
const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
|
|
2173
|
+
return Promise.resolve({ fileName: fileName, status: status, data: new Blob([response.data]), headers: _headers });
|
|
2174
|
+
}
|
|
2175
|
+
else if (status === 401) {
|
|
2176
|
+
const _responseText = response.data;
|
|
2177
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
2178
|
+
}
|
|
2179
|
+
else if (status === 403) {
|
|
2180
|
+
const _responseText = response.data;
|
|
2181
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
2182
|
+
}
|
|
2183
|
+
else if (status !== 200 && status !== 204) {
|
|
2184
|
+
const _responseText = response.data;
|
|
2185
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
2186
|
+
}
|
|
2187
|
+
return Promise.resolve(null);
|
|
2188
|
+
}
|
|
2189
|
+
/**
|
|
2190
|
+
* Renders a preview of an uploaded image with the specified parameters and saves rendering result as resource.
|
|
2191
|
+
* @param tenantId (optional) Tenant identifier
|
|
2192
|
+
* @param resourceOwnerId (optional)
|
|
2193
|
+
* @param resourceNamespace (optional)
|
|
2194
|
+
* @param resourceName (optional)
|
|
2195
|
+
* @param resourceSourceId (optional)
|
|
2196
|
+
* @param resourceType (optional)
|
|
2197
|
+
* @param anonymousAccess (optional)
|
|
2198
|
+
* @param overwriteExistingResource (optional)
|
|
2199
|
+
* @param sourceFile (optional)
|
|
2200
|
+
* @param mockupOwnerId (optional)
|
|
2201
|
+
* @param mockupId (optional)
|
|
2202
|
+
* @param width (optional)
|
|
2203
|
+
* @param height (optional)
|
|
2204
|
+
* @param fileFormat (optional)
|
|
2205
|
+
* @param fitMode (optional)
|
|
2206
|
+
* @return Success
|
|
2207
|
+
*/
|
|
2208
|
+
renderImagePreviewFromFileToResource(tenantId, resourceOwnerId, resourceNamespace, resourceName, resourceSourceId, resourceType, anonymousAccess, overwriteExistingResource, sourceFile, mockupOwnerId, mockupId, width, height, fileFormat, fitMode, cancelToken) {
|
|
2209
|
+
let url_ = this.baseUrl + "/api/atoms/v1/images/render-preview/from-file/to-resource?";
|
|
2210
|
+
if (tenantId === null)
|
|
2211
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
2212
|
+
else if (tenantId !== undefined)
|
|
2213
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2214
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
2215
|
+
const content_ = new FormData();
|
|
2216
|
+
if (resourceOwnerId !== null && resourceOwnerId !== undefined)
|
|
2217
|
+
content_.append("resourceOwnerId", resourceOwnerId.toString());
|
|
2218
|
+
if (resourceNamespace !== null && resourceNamespace !== undefined)
|
|
2219
|
+
content_.append("resourceNamespace", resourceNamespace.toString());
|
|
2220
|
+
if (resourceName !== null && resourceName !== undefined)
|
|
2221
|
+
content_.append("resourceName", resourceName.toString());
|
|
2222
|
+
if (resourceSourceId !== null && resourceSourceId !== undefined)
|
|
2223
|
+
content_.append("resourceSourceId", resourceSourceId.toString());
|
|
2224
|
+
if (resourceType !== null && resourceType !== undefined)
|
|
2225
|
+
content_.append("resourceType", resourceType.toString());
|
|
2226
|
+
if (anonymousAccess === null || anonymousAccess === undefined)
|
|
2227
|
+
throw new Error("The parameter 'anonymousAccess' cannot be null.");
|
|
2228
|
+
else
|
|
2229
|
+
content_.append("anonymousAccess", anonymousAccess.toString());
|
|
2230
|
+
if (overwriteExistingResource === null || overwriteExistingResource === undefined)
|
|
2231
|
+
throw new Error("The parameter 'overwriteExistingResource' cannot be null.");
|
|
2232
|
+
else
|
|
2233
|
+
content_.append("overwriteExistingResource", overwriteExistingResource.toString());
|
|
2234
|
+
if (sourceFile !== null && sourceFile !== undefined)
|
|
2235
|
+
content_.append("sourceFile", sourceFile.data, sourceFile.fileName ? sourceFile.fileName : "sourceFile");
|
|
2236
|
+
if (mockupOwnerId !== null && mockupOwnerId !== undefined)
|
|
2237
|
+
content_.append("mockupOwnerId", mockupOwnerId.toString());
|
|
2238
|
+
if (mockupId !== null && mockupId !== undefined)
|
|
2239
|
+
content_.append("mockupId", mockupId.toString());
|
|
2240
|
+
if (width !== null && width !== undefined)
|
|
2241
|
+
content_.append("width", width.toString());
|
|
2242
|
+
if (height !== null && height !== undefined)
|
|
2243
|
+
content_.append("height", height.toString());
|
|
2244
|
+
if (fileFormat !== null && fileFormat !== undefined)
|
|
2245
|
+
content_.append("fileFormat", fileFormat.toString());
|
|
2246
|
+
if (fitMode !== null && fitMode !== undefined)
|
|
2247
|
+
content_.append("fitMode", fitMode.toString());
|
|
2248
|
+
let options_ = {
|
|
2249
|
+
data: content_,
|
|
2250
|
+
method: "POST",
|
|
2251
|
+
url: url_,
|
|
2252
|
+
headers: {
|
|
2253
|
+
"Accept": "application/json"
|
|
2254
|
+
},
|
|
2255
|
+
cancelToken
|
|
2256
|
+
};
|
|
2257
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
2258
|
+
return this.instance.request(transformedOptions_);
|
|
2259
|
+
}).catch((_error) => {
|
|
2260
|
+
if (isAxiosError(_error) && _error.response) {
|
|
2261
|
+
return _error.response;
|
|
2262
|
+
}
|
|
2263
|
+
else {
|
|
2264
|
+
throw _error;
|
|
2265
|
+
}
|
|
2266
|
+
}).then((_response) => {
|
|
2267
|
+
return this.transformResult(url_, _response, (_response) => this.processRenderImagePreviewFromFileToResource(_response));
|
|
2268
|
+
});
|
|
2269
|
+
}
|
|
2270
|
+
processRenderImagePreviewFromFileToResource(response) {
|
|
2271
|
+
const status = response.status;
|
|
2272
|
+
let _headers = {};
|
|
2273
|
+
if (response.headers && typeof response.headers === "object") {
|
|
2274
|
+
for (let k in response.headers) {
|
|
2275
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
2276
|
+
_headers[k] = response.headers[k];
|
|
2277
|
+
}
|
|
2278
|
+
}
|
|
2279
|
+
}
|
|
2280
|
+
if (status === 200) {
|
|
2281
|
+
const _responseText = response.data;
|
|
2282
|
+
let result200 = null;
|
|
2283
|
+
let resultData200 = _responseText;
|
|
2284
|
+
result200 = JSON.parse(resultData200);
|
|
2285
|
+
return Promise.resolve(result200);
|
|
2286
|
+
}
|
|
2287
|
+
else if (status === 409) {
|
|
2288
|
+
const _responseText = response.data;
|
|
2289
|
+
let result409 = null;
|
|
2290
|
+
let resultData409 = _responseText;
|
|
2291
|
+
result409 = JSON.parse(resultData409);
|
|
2292
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
2293
|
+
}
|
|
2294
|
+
else if (status === 401) {
|
|
2295
|
+
const _responseText = response.data;
|
|
2296
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
2297
|
+
}
|
|
2298
|
+
else if (status === 403) {
|
|
2299
|
+
const _responseText = response.data;
|
|
2300
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
2301
|
+
}
|
|
2302
|
+
else if (status !== 200 && status !== 204) {
|
|
2303
|
+
const _responseText = response.data;
|
|
2304
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
2305
|
+
}
|
|
2306
|
+
return Promise.resolve(null);
|
|
2307
|
+
}
|
|
2308
|
+
/**
|
|
2309
|
+
* Renders a preview of a web image with the specified parameters.
|
|
2310
|
+
* @param attachment (optional) If set to 'true', file will be provided as an attachment with unique filename supplied
|
|
2311
|
+
(default value is 'false').
|
|
2100
2312
|
* @param tenantId (optional) Tenant identifier
|
|
2101
2313
|
* @param body (optional) Render model with preview parameters.
|
|
2102
2314
|
* @return Success
|
|
2103
2315
|
*/
|
|
2104
|
-
|
|
2105
|
-
let url_ = this.baseUrl + "/api/atoms/v1/images/render-preview/
|
|
2316
|
+
renderImagePreviewFromUrl(attachment, tenantId, body, cancelToken) {
|
|
2317
|
+
let url_ = this.baseUrl + "/api/atoms/v1/images/render-preview/from-url?";
|
|
2318
|
+
if (attachment !== undefined && attachment !== null)
|
|
2319
|
+
url_ += "attachment=" + encodeURIComponent("" + attachment) + "&";
|
|
2320
|
+
if (tenantId === null)
|
|
2321
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
2322
|
+
else if (tenantId !== undefined)
|
|
2323
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2324
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
2325
|
+
const content_ = JSON.stringify(body);
|
|
2326
|
+
let options_ = {
|
|
2327
|
+
data: content_,
|
|
2328
|
+
responseType: "blob",
|
|
2329
|
+
method: "POST",
|
|
2330
|
+
url: url_,
|
|
2331
|
+
headers: {
|
|
2332
|
+
"Content-Type": "application/json",
|
|
2333
|
+
"Accept": "application/octet-stream"
|
|
2334
|
+
},
|
|
2335
|
+
cancelToken
|
|
2336
|
+
};
|
|
2337
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
2338
|
+
return this.instance.request(transformedOptions_);
|
|
2339
|
+
}).catch((_error) => {
|
|
2340
|
+
if (isAxiosError(_error) && _error.response) {
|
|
2341
|
+
return _error.response;
|
|
2342
|
+
}
|
|
2343
|
+
else {
|
|
2344
|
+
throw _error;
|
|
2345
|
+
}
|
|
2346
|
+
}).then((_response) => {
|
|
2347
|
+
return this.transformResult(url_, _response, (_response) => this.processRenderImagePreviewFromUrl(_response));
|
|
2348
|
+
});
|
|
2349
|
+
}
|
|
2350
|
+
processRenderImagePreviewFromUrl(response) {
|
|
2351
|
+
const status = response.status;
|
|
2352
|
+
let _headers = {};
|
|
2353
|
+
if (response.headers && typeof response.headers === "object") {
|
|
2354
|
+
for (let k in response.headers) {
|
|
2355
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
2356
|
+
_headers[k] = response.headers[k];
|
|
2357
|
+
}
|
|
2358
|
+
}
|
|
2359
|
+
}
|
|
2360
|
+
if (status === 200 || status === 206) {
|
|
2361
|
+
const contentDisposition = response.headers ? response.headers["content-disposition"] : undefined;
|
|
2362
|
+
const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
|
|
2363
|
+
const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
|
|
2364
|
+
return Promise.resolve({ fileName: fileName, status: status, data: new Blob([response.data]), headers: _headers });
|
|
2365
|
+
}
|
|
2366
|
+
else if (status === 401) {
|
|
2367
|
+
const _responseText = response.data;
|
|
2368
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
2369
|
+
}
|
|
2370
|
+
else if (status === 403) {
|
|
2371
|
+
const _responseText = response.data;
|
|
2372
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
2373
|
+
}
|
|
2374
|
+
else if (status !== 200 && status !== 204) {
|
|
2375
|
+
const _responseText = response.data;
|
|
2376
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
2377
|
+
}
|
|
2378
|
+
return Promise.resolve(null);
|
|
2379
|
+
}
|
|
2380
|
+
/**
|
|
2381
|
+
* Renders a preview of a web image with the specified parameters and saves rendering result as resource.
|
|
2382
|
+
* @param tenantId (optional) Tenant identifier
|
|
2383
|
+
* @param body (optional) Render model with preview parameters.
|
|
2384
|
+
* @return Success
|
|
2385
|
+
*/
|
|
2386
|
+
renderImagePreviewFromUrlToResource(tenantId, body, cancelToken) {
|
|
2387
|
+
let url_ = this.baseUrl + "/api/atoms/v1/images/render-preview/from-url/to-resource?";
|
|
2106
2388
|
if (tenantId === null)
|
|
2107
2389
|
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
2108
2390
|
else if (tenantId !== undefined)
|
|
@@ -2129,10 +2411,10 @@ class DesignAtomsImagesApiClient extends ApiClientBase {
|
|
|
2129
2411
|
throw _error;
|
|
2130
2412
|
}
|
|
2131
2413
|
}).then((_response) => {
|
|
2132
|
-
return this.transformResult(url_, _response, (_response) => this.
|
|
2414
|
+
return this.transformResult(url_, _response, (_response) => this.processRenderImagePreviewFromUrlToResource(_response));
|
|
2133
2415
|
});
|
|
2134
2416
|
}
|
|
2135
|
-
|
|
2417
|
+
processRenderImagePreviewFromUrlToResource(response) {
|
|
2136
2418
|
const status = response.status;
|
|
2137
2419
|
let _headers = {};
|
|
2138
2420
|
if (response.headers && typeof response.headers === "object") {
|
|
@@ -2149,6 +2431,13 @@ class DesignAtomsImagesApiClient extends ApiClientBase {
|
|
|
2149
2431
|
result200 = JSON.parse(resultData200);
|
|
2150
2432
|
return Promise.resolve(result200);
|
|
2151
2433
|
}
|
|
2434
|
+
else if (status === 409) {
|
|
2435
|
+
const _responseText = response.data;
|
|
2436
|
+
let result409 = null;
|
|
2437
|
+
let resultData409 = _responseText;
|
|
2438
|
+
result409 = JSON.parse(resultData409);
|
|
2439
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
2440
|
+
}
|
|
2152
2441
|
else if (status === 401) {
|
|
2153
2442
|
const _responseText = response.data;
|
|
2154
2443
|
return throwException("Unauthorized", status, _responseText, _headers);
|
|
@@ -2163,31 +2452,531 @@ class DesignAtomsImagesApiClient extends ApiClientBase {
|
|
|
2163
2452
|
}
|
|
2164
2453
|
return Promise.resolve(null);
|
|
2165
2454
|
}
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2455
|
+
/**
|
|
2456
|
+
* Renders a preview of an image with the specified parameters and saves rendering result as resource.
|
|
2457
|
+
* @param tenantId (optional) Tenant identifier
|
|
2458
|
+
* @param body (optional) Render model with preview parameters.
|
|
2459
|
+
* @return Success
|
|
2460
|
+
*/
|
|
2461
|
+
renderImagePreviewToResource(tenantId, body, cancelToken) {
|
|
2462
|
+
let url_ = this.baseUrl + "/api/atoms/v1/images/render-preview/to-resource?";
|
|
2463
|
+
if (tenantId === null)
|
|
2464
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
2465
|
+
else if (tenantId !== undefined)
|
|
2466
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2467
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
2468
|
+
const content_ = JSON.stringify(body);
|
|
2469
|
+
let options_ = {
|
|
2470
|
+
data: content_,
|
|
2471
|
+
method: "POST",
|
|
2472
|
+
url: url_,
|
|
2473
|
+
headers: {
|
|
2474
|
+
"Content-Type": "application/json",
|
|
2475
|
+
"Accept": "application/json"
|
|
2476
|
+
},
|
|
2477
|
+
cancelToken
|
|
2478
|
+
};
|
|
2479
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
2480
|
+
return this.instance.request(transformedOptions_);
|
|
2481
|
+
}).catch((_error) => {
|
|
2482
|
+
if (isAxiosError(_error) && _error.response) {
|
|
2483
|
+
return _error.response;
|
|
2484
|
+
}
|
|
2485
|
+
else {
|
|
2486
|
+
throw _error;
|
|
2487
|
+
}
|
|
2488
|
+
}).then((_response) => {
|
|
2489
|
+
return this.transformResult(url_, _response, (_response) => this.processRenderImagePreviewToResource(_response));
|
|
2490
|
+
});
|
|
2491
|
+
}
|
|
2492
|
+
processRenderImagePreviewToResource(response) {
|
|
2493
|
+
const status = response.status;
|
|
2494
|
+
let _headers = {};
|
|
2495
|
+
if (response.headers && typeof response.headers === "object") {
|
|
2496
|
+
for (let k in response.headers) {
|
|
2497
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
2498
|
+
_headers[k] = response.headers[k];
|
|
2499
|
+
}
|
|
2500
|
+
}
|
|
2501
|
+
}
|
|
2502
|
+
if (status === 200) {
|
|
2503
|
+
const _responseText = response.data;
|
|
2504
|
+
let result200 = null;
|
|
2505
|
+
let resultData200 = _responseText;
|
|
2506
|
+
result200 = JSON.parse(resultData200);
|
|
2507
|
+
return Promise.resolve(result200);
|
|
2508
|
+
}
|
|
2509
|
+
else if (status === 409) {
|
|
2510
|
+
const _responseText = response.data;
|
|
2511
|
+
let result409 = null;
|
|
2512
|
+
let resultData409 = _responseText;
|
|
2513
|
+
result409 = JSON.parse(resultData409);
|
|
2514
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
2515
|
+
}
|
|
2516
|
+
else if (status === 401) {
|
|
2517
|
+
const _responseText = response.data;
|
|
2518
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
2519
|
+
}
|
|
2520
|
+
else if (status === 403) {
|
|
2521
|
+
const _responseText = response.data;
|
|
2522
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
2523
|
+
}
|
|
2524
|
+
else if (status !== 200 && status !== 204) {
|
|
2525
|
+
const _responseText = response.data;
|
|
2526
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
2527
|
+
}
|
|
2528
|
+
return Promise.resolve(null);
|
|
2529
|
+
}
|
|
2530
|
+
}
|
|
2531
|
+
exports.DesignAtomsImagesApiClient = DesignAtomsImagesApiClient;
|
|
2532
|
+
class DesignAtomsMockups3dApiClient extends ApiClientBase {
|
|
2533
|
+
instance;
|
|
2534
|
+
baseUrl;
|
|
2535
|
+
jsonParseReviver = undefined;
|
|
2536
|
+
constructor(configuration, baseUrl, instance) {
|
|
2537
|
+
super(configuration);
|
|
2538
|
+
this.instance = instance ? instance : axios_1.create();
|
|
2539
|
+
this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : this.getBaseUrl("");
|
|
2540
|
+
}
|
|
2541
|
+
/**
|
|
2542
|
+
* Returns a 3D-Mockup attributes.
|
|
2543
|
+
* @param id 3D-Mockup identifier.
|
|
2544
|
+
* @param ownerId (optional) Private mockup owner identifier.
|
|
2545
|
+
* @param tenantId (optional) Tenant identifier
|
|
2546
|
+
* @return Success
|
|
2547
|
+
*/
|
|
2548
|
+
getAttributes(id, ownerId, tenantId, cancelToken) {
|
|
2549
|
+
let url_ = this.baseUrl + "/api/atoms/v1/mockups-3d/{id}/attributes?";
|
|
2550
|
+
if (id === undefined || id === null)
|
|
2551
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
2552
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
2553
|
+
if (ownerId !== undefined && ownerId !== null)
|
|
2554
|
+
url_ += "ownerId=" + encodeURIComponent("" + ownerId) + "&";
|
|
2555
|
+
if (tenantId === null)
|
|
2556
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
2557
|
+
else if (tenantId !== undefined)
|
|
2558
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2559
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
2560
|
+
let options_ = {
|
|
2561
|
+
method: "GET",
|
|
2562
|
+
url: url_,
|
|
2563
|
+
headers: {
|
|
2564
|
+
"Accept": "application/json"
|
|
2565
|
+
},
|
|
2566
|
+
cancelToken
|
|
2567
|
+
};
|
|
2568
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
2569
|
+
return this.instance.request(transformedOptions_);
|
|
2570
|
+
}).catch((_error) => {
|
|
2571
|
+
if (isAxiosError(_error) && _error.response) {
|
|
2572
|
+
return _error.response;
|
|
2573
|
+
}
|
|
2574
|
+
else {
|
|
2575
|
+
throw _error;
|
|
2576
|
+
}
|
|
2577
|
+
}).then((_response) => {
|
|
2578
|
+
return this.transformResult(url_, _response, (_response) => this.processGetAttributes(_response));
|
|
2579
|
+
});
|
|
2580
|
+
}
|
|
2581
|
+
processGetAttributes(response) {
|
|
2582
|
+
const status = response.status;
|
|
2583
|
+
let _headers = {};
|
|
2584
|
+
if (response.headers && typeof response.headers === "object") {
|
|
2585
|
+
for (let k in response.headers) {
|
|
2586
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
2587
|
+
_headers[k] = response.headers[k];
|
|
2588
|
+
}
|
|
2589
|
+
}
|
|
2590
|
+
}
|
|
2591
|
+
if (status === 200) {
|
|
2592
|
+
const _responseText = response.data;
|
|
2593
|
+
let result200 = null;
|
|
2594
|
+
let resultData200 = _responseText;
|
|
2595
|
+
result200 = JSON.parse(resultData200);
|
|
2596
|
+
return Promise.resolve(result200);
|
|
2597
|
+
}
|
|
2598
|
+
else if (status === 404) {
|
|
2599
|
+
const _responseText = response.data;
|
|
2600
|
+
let result404 = null;
|
|
2601
|
+
let resultData404 = _responseText;
|
|
2602
|
+
result404 = JSON.parse(resultData404);
|
|
2603
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
2604
|
+
}
|
|
2605
|
+
else if (status === 422) {
|
|
2606
|
+
const _responseText = response.data;
|
|
2607
|
+
let result422 = null;
|
|
2608
|
+
let resultData422 = _responseText;
|
|
2609
|
+
result422 = JSON.parse(resultData422);
|
|
2610
|
+
return throwException("Client Error", status, _responseText, _headers, result422);
|
|
2611
|
+
}
|
|
2612
|
+
else if (status === 401) {
|
|
2613
|
+
const _responseText = response.data;
|
|
2614
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
2615
|
+
}
|
|
2616
|
+
else if (status === 403) {
|
|
2617
|
+
const _responseText = response.data;
|
|
2618
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
2619
|
+
}
|
|
2620
|
+
else if (status !== 200 && status !== 204) {
|
|
2621
|
+
const _responseText = response.data;
|
|
2622
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
2623
|
+
}
|
|
2624
|
+
return Promise.resolve(null);
|
|
2625
|
+
}
|
|
2626
|
+
/**
|
|
2627
|
+
* Returns a 3D-Mockup content as protobuf binary stream.
|
|
2628
|
+
* @param id 3D-Mockup identifier.
|
|
2629
|
+
* @param ownerId (optional) Private mockup owner identifier.
|
|
2630
|
+
* @param tenantId (optional) Tenant identifier
|
|
2631
|
+
* @return Success
|
|
2632
|
+
*/
|
|
2633
|
+
getContentAsProtobuf(id, ownerId, tenantId, cancelToken) {
|
|
2634
|
+
let url_ = this.baseUrl + "/api/atoms/v1/mockups-3d/{id}/content/as-protobuf?";
|
|
2635
|
+
if (id === undefined || id === null)
|
|
2636
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
2637
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
2638
|
+
if (ownerId !== undefined && ownerId !== null)
|
|
2639
|
+
url_ += "ownerId=" + encodeURIComponent("" + ownerId) + "&";
|
|
2640
|
+
if (tenantId === null)
|
|
2641
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
2642
|
+
else if (tenantId !== undefined)
|
|
2643
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2644
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
2645
|
+
let options_ = {
|
|
2646
|
+
responseType: "blob",
|
|
2647
|
+
method: "GET",
|
|
2648
|
+
url: url_,
|
|
2649
|
+
headers: {
|
|
2650
|
+
"Accept": "application/json"
|
|
2651
|
+
},
|
|
2652
|
+
cancelToken
|
|
2653
|
+
};
|
|
2654
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
2655
|
+
return this.instance.request(transformedOptions_);
|
|
2656
|
+
}).catch((_error) => {
|
|
2657
|
+
if (isAxiosError(_error) && _error.response) {
|
|
2658
|
+
return _error.response;
|
|
2659
|
+
}
|
|
2660
|
+
else {
|
|
2661
|
+
throw _error;
|
|
2662
|
+
}
|
|
2663
|
+
}).then((_response) => {
|
|
2664
|
+
return this.transformResult(url_, _response, (_response) => this.processGetContentAsProtobuf(_response));
|
|
2665
|
+
});
|
|
2666
|
+
}
|
|
2667
|
+
processGetContentAsProtobuf(response) {
|
|
2668
|
+
const status = response.status;
|
|
2669
|
+
let _headers = {};
|
|
2670
|
+
if (response.headers && typeof response.headers === "object") {
|
|
2671
|
+
for (let k in response.headers) {
|
|
2672
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
2673
|
+
_headers[k] = response.headers[k];
|
|
2674
|
+
}
|
|
2675
|
+
}
|
|
2676
|
+
}
|
|
2677
|
+
if (status === 200 || status === 206) {
|
|
2678
|
+
const contentDisposition = response.headers ? response.headers["content-disposition"] : undefined;
|
|
2679
|
+
const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
|
|
2680
|
+
const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
|
|
2681
|
+
return Promise.resolve({ fileName: fileName, status: status, data: new Blob([response.data]), headers: _headers });
|
|
2682
|
+
}
|
|
2683
|
+
else if (status === 404) {
|
|
2684
|
+
const _responseText = response.data;
|
|
2685
|
+
let result404 = null;
|
|
2686
|
+
let resultData404 = _responseText;
|
|
2687
|
+
result404 = JSON.parse(resultData404);
|
|
2688
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
2689
|
+
}
|
|
2690
|
+
else if (status === 422) {
|
|
2691
|
+
const _responseText = response.data;
|
|
2692
|
+
let result422 = null;
|
|
2693
|
+
let resultData422 = _responseText;
|
|
2694
|
+
result422 = JSON.parse(resultData422);
|
|
2695
|
+
return throwException("Client Error", status, _responseText, _headers, result422);
|
|
2696
|
+
}
|
|
2697
|
+
else if (status === 401) {
|
|
2698
|
+
const _responseText = response.data;
|
|
2699
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
2700
|
+
}
|
|
2701
|
+
else if (status === 403) {
|
|
2702
|
+
const _responseText = response.data;
|
|
2703
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
2704
|
+
}
|
|
2705
|
+
else if (status !== 200 && status !== 204) {
|
|
2706
|
+
const _responseText = response.data;
|
|
2707
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
2708
|
+
}
|
|
2709
|
+
return Promise.resolve(null);
|
|
2710
|
+
}
|
|
2711
|
+
/**
|
|
2712
|
+
* Returns a 3D-Mockup geometry as binary stream.
|
|
2713
|
+
* @param id 3D-Mockup identifier.
|
|
2714
|
+
* @param ownerId (optional) Private mockup owner identifier.
|
|
2715
|
+
* @param tenantId (optional) Tenant identifier
|
|
2716
|
+
* @return Success
|
|
2717
|
+
*/
|
|
2718
|
+
getGeometryFile(id, ownerId, tenantId, cancelToken) {
|
|
2719
|
+
let url_ = this.baseUrl + "/api/atoms/v1/mockups-3d/{id}/geometry/file?";
|
|
2720
|
+
if (id === undefined || id === null)
|
|
2721
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
2722
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
2723
|
+
if (ownerId !== undefined && ownerId !== null)
|
|
2724
|
+
url_ += "ownerId=" + encodeURIComponent("" + ownerId) + "&";
|
|
2725
|
+
if (tenantId === null)
|
|
2726
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
2727
|
+
else if (tenantId !== undefined)
|
|
2728
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2729
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
2730
|
+
let options_ = {
|
|
2731
|
+
responseType: "blob",
|
|
2732
|
+
method: "GET",
|
|
2733
|
+
url: url_,
|
|
2734
|
+
headers: {
|
|
2735
|
+
"Accept": "application/json"
|
|
2736
|
+
},
|
|
2737
|
+
cancelToken
|
|
2738
|
+
};
|
|
2739
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
2740
|
+
return this.instance.request(transformedOptions_);
|
|
2741
|
+
}).catch((_error) => {
|
|
2742
|
+
if (isAxiosError(_error) && _error.response) {
|
|
2743
|
+
return _error.response;
|
|
2744
|
+
}
|
|
2745
|
+
else {
|
|
2746
|
+
throw _error;
|
|
2747
|
+
}
|
|
2748
|
+
}).then((_response) => {
|
|
2749
|
+
return this.transformResult(url_, _response, (_response) => this.processGetGeometryFile(_response));
|
|
2750
|
+
});
|
|
2751
|
+
}
|
|
2752
|
+
processGetGeometryFile(response) {
|
|
2753
|
+
const status = response.status;
|
|
2754
|
+
let _headers = {};
|
|
2755
|
+
if (response.headers && typeof response.headers === "object") {
|
|
2756
|
+
for (let k in response.headers) {
|
|
2757
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
2758
|
+
_headers[k] = response.headers[k];
|
|
2759
|
+
}
|
|
2760
|
+
}
|
|
2761
|
+
}
|
|
2762
|
+
if (status === 200 || status === 206) {
|
|
2763
|
+
const contentDisposition = response.headers ? response.headers["content-disposition"] : undefined;
|
|
2764
|
+
const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
|
|
2765
|
+
const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
|
|
2766
|
+
return Promise.resolve({ fileName: fileName, status: status, data: new Blob([response.data]), headers: _headers });
|
|
2767
|
+
}
|
|
2768
|
+
else if (status === 404) {
|
|
2769
|
+
const _responseText = response.data;
|
|
2770
|
+
let result404 = null;
|
|
2771
|
+
let resultData404 = _responseText;
|
|
2772
|
+
result404 = JSON.parse(resultData404);
|
|
2773
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
2774
|
+
}
|
|
2775
|
+
else if (status === 422) {
|
|
2776
|
+
const _responseText = response.data;
|
|
2777
|
+
let result422 = null;
|
|
2778
|
+
let resultData422 = _responseText;
|
|
2779
|
+
result422 = JSON.parse(resultData422);
|
|
2780
|
+
return throwException("Client Error", status, _responseText, _headers, result422);
|
|
2781
|
+
}
|
|
2782
|
+
else if (status === 401) {
|
|
2783
|
+
const _responseText = response.data;
|
|
2784
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
2785
|
+
}
|
|
2786
|
+
else if (status === 403) {
|
|
2787
|
+
const _responseText = response.data;
|
|
2788
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
2789
|
+
}
|
|
2790
|
+
else if (status !== 200 && status !== 204) {
|
|
2791
|
+
const _responseText = response.data;
|
|
2792
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
2793
|
+
}
|
|
2794
|
+
return Promise.resolve(null);
|
|
2795
|
+
}
|
|
2796
|
+
}
|
|
2797
|
+
exports.DesignAtomsMockups3dApiClient = DesignAtomsMockups3dApiClient;
|
|
2798
|
+
class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
2799
|
+
instance;
|
|
2800
|
+
baseUrl;
|
|
2801
|
+
jsonParseReviver = undefined;
|
|
2802
|
+
constructor(configuration, baseUrl, instance) {
|
|
2803
|
+
super(configuration);
|
|
2804
|
+
this.instance = instance ? instance : axios_1.create();
|
|
2805
|
+
this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : this.getBaseUrl("");
|
|
2806
|
+
}
|
|
2807
|
+
/**
|
|
2808
|
+
* Creates new design file with specified parameters and saves it in storage.
|
|
2809
|
+
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
2810
|
+
* @param tenantId (optional) Tenant identifier
|
|
2811
|
+
* @param body (optional) Design creation parameters.
|
|
2812
|
+
* @return Created
|
|
2813
|
+
*/
|
|
2814
|
+
createDesign(privateStorageOwner, tenantId, body, cancelToken) {
|
|
2815
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs?";
|
|
2816
|
+
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
2817
|
+
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
2818
|
+
if (tenantId === null)
|
|
2819
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
2820
|
+
else if (tenantId !== undefined)
|
|
2821
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2822
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
2823
|
+
const content_ = JSON.stringify(body);
|
|
2824
|
+
let options_ = {
|
|
2825
|
+
data: content_,
|
|
2826
|
+
method: "POST",
|
|
2827
|
+
url: url_,
|
|
2828
|
+
headers: {
|
|
2829
|
+
"Content-Type": "application/json",
|
|
2830
|
+
"Accept": "application/json"
|
|
2831
|
+
},
|
|
2832
|
+
cancelToken
|
|
2833
|
+
};
|
|
2834
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
2835
|
+
return this.instance.request(transformedOptions_);
|
|
2836
|
+
}).catch((_error) => {
|
|
2837
|
+
if (isAxiosError(_error) && _error.response) {
|
|
2838
|
+
return _error.response;
|
|
2839
|
+
}
|
|
2840
|
+
else {
|
|
2841
|
+
throw _error;
|
|
2842
|
+
}
|
|
2843
|
+
}).then((_response) => {
|
|
2844
|
+
return this.transformResult(url_, _response, (_response) => this.processCreateDesign(_response));
|
|
2845
|
+
});
|
|
2846
|
+
}
|
|
2847
|
+
processCreateDesign(response) {
|
|
2848
|
+
const status = response.status;
|
|
2849
|
+
let _headers = {};
|
|
2850
|
+
if (response.headers && typeof response.headers === "object") {
|
|
2851
|
+
for (let k in response.headers) {
|
|
2852
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
2853
|
+
_headers[k] = response.headers[k];
|
|
2854
|
+
}
|
|
2855
|
+
}
|
|
2856
|
+
}
|
|
2857
|
+
if (status === 201) {
|
|
2858
|
+
const _responseText = response.data;
|
|
2859
|
+
let result201 = null;
|
|
2860
|
+
let resultData201 = _responseText;
|
|
2861
|
+
result201 = JSON.parse(resultData201);
|
|
2862
|
+
return Promise.resolve(result201);
|
|
2863
|
+
}
|
|
2864
|
+
else if (status === 401) {
|
|
2865
|
+
const _responseText = response.data;
|
|
2866
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
2867
|
+
}
|
|
2868
|
+
else if (status === 403) {
|
|
2869
|
+
const _responseText = response.data;
|
|
2870
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
2871
|
+
}
|
|
2872
|
+
else if (status !== 200 && status !== 204) {
|
|
2873
|
+
const _responseText = response.data;
|
|
2874
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
2875
|
+
}
|
|
2876
|
+
return Promise.resolve(null);
|
|
2877
|
+
}
|
|
2878
|
+
/**
|
|
2879
|
+
* Returns content of the background.
|
|
2880
|
+
* @param id Design identifier.
|
|
2881
|
+
* @param surfaceIndex (optional) Surface index.
|
|
2882
|
+
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
2883
|
+
* @param tenantId (optional) Tenant identifier
|
|
2884
|
+
* @return Success
|
|
2885
|
+
*/
|
|
2886
|
+
extractBackground(id, surfaceIndex, privateStorageOwner, tenantId, cancelToken) {
|
|
2887
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/background?";
|
|
2888
|
+
if (id === undefined || id === null)
|
|
2889
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
2890
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
2891
|
+
if (surfaceIndex !== undefined && surfaceIndex !== null)
|
|
2892
|
+
url_ += "surfaceIndex=" + encodeURIComponent("" + surfaceIndex) + "&";
|
|
2893
|
+
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
2894
|
+
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
2895
|
+
if (tenantId === null)
|
|
2896
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
2897
|
+
else if (tenantId !== undefined)
|
|
2898
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2899
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
2900
|
+
let options_ = {
|
|
2901
|
+
responseType: "blob",
|
|
2902
|
+
method: "GET",
|
|
2903
|
+
url: url_,
|
|
2904
|
+
headers: {
|
|
2905
|
+
"Accept": "application/octet-stream"
|
|
2906
|
+
},
|
|
2907
|
+
cancelToken
|
|
2908
|
+
};
|
|
2909
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
2910
|
+
return this.instance.request(transformedOptions_);
|
|
2911
|
+
}).catch((_error) => {
|
|
2912
|
+
if (isAxiosError(_error) && _error.response) {
|
|
2913
|
+
return _error.response;
|
|
2914
|
+
}
|
|
2915
|
+
else {
|
|
2916
|
+
throw _error;
|
|
2917
|
+
}
|
|
2918
|
+
}).then((_response) => {
|
|
2919
|
+
return this.transformResult(url_, _response, (_response) => this.processExtractBackground(_response));
|
|
2920
|
+
});
|
|
2921
|
+
}
|
|
2922
|
+
processExtractBackground(response) {
|
|
2923
|
+
const status = response.status;
|
|
2924
|
+
let _headers = {};
|
|
2925
|
+
if (response.headers && typeof response.headers === "object") {
|
|
2926
|
+
for (let k in response.headers) {
|
|
2927
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
2928
|
+
_headers[k] = response.headers[k];
|
|
2929
|
+
}
|
|
2930
|
+
}
|
|
2931
|
+
}
|
|
2932
|
+
if (status === 200 || status === 206) {
|
|
2933
|
+
const contentDisposition = response.headers ? response.headers["content-disposition"] : undefined;
|
|
2934
|
+
const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
|
|
2935
|
+
const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
|
|
2936
|
+
return Promise.resolve({ fileName: fileName, status: status, data: new Blob([response.data]), headers: _headers });
|
|
2937
|
+
}
|
|
2938
|
+
else if (status === 404) {
|
|
2939
|
+
const _responseText = response.data;
|
|
2940
|
+
let result404 = null;
|
|
2941
|
+
let resultData404 = _responseText;
|
|
2942
|
+
result404 = JSON.parse(resultData404);
|
|
2943
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
2944
|
+
}
|
|
2945
|
+
else if (status === 422) {
|
|
2946
|
+
const _responseText = response.data;
|
|
2947
|
+
let result422 = null;
|
|
2948
|
+
let resultData422 = _responseText;
|
|
2949
|
+
result422 = JSON.parse(resultData422);
|
|
2950
|
+
return throwException("Client Error", status, _responseText, _headers, result422);
|
|
2951
|
+
}
|
|
2952
|
+
else if (status === 401) {
|
|
2953
|
+
const _responseText = response.data;
|
|
2954
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
2955
|
+
}
|
|
2956
|
+
else if (status === 403) {
|
|
2957
|
+
const _responseText = response.data;
|
|
2958
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
2959
|
+
}
|
|
2960
|
+
else if (status !== 200 && status !== 204) {
|
|
2961
|
+
const _responseText = response.data;
|
|
2962
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
2963
|
+
}
|
|
2964
|
+
return Promise.resolve(null);
|
|
2176
2965
|
}
|
|
2177
2966
|
/**
|
|
2178
|
-
*
|
|
2179
|
-
* @param id
|
|
2180
|
-
* @param
|
|
2967
|
+
* Loads product (design model) from design file taken from storage.
|
|
2968
|
+
* @param id Design identifier.
|
|
2969
|
+
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
2181
2970
|
* @param tenantId (optional) Tenant identifier
|
|
2182
2971
|
* @return Success
|
|
2183
2972
|
*/
|
|
2184
|
-
|
|
2185
|
-
let url_ = this.baseUrl + "/api/atoms/v1/
|
|
2973
|
+
loadProduct(id, privateStorageOwner, tenantId, cancelToken) {
|
|
2974
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/model?";
|
|
2186
2975
|
if (id === undefined || id === null)
|
|
2187
2976
|
throw new Error("The parameter 'id' must be defined.");
|
|
2188
2977
|
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
2189
|
-
if (
|
|
2190
|
-
url_ += "
|
|
2978
|
+
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
2979
|
+
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
2191
2980
|
if (tenantId === null)
|
|
2192
2981
|
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
2193
2982
|
else if (tenantId !== undefined)
|
|
@@ -2211,10 +3000,10 @@ class DesignAtomsMockups3dApiClient extends ApiClientBase {
|
|
|
2211
3000
|
throw _error;
|
|
2212
3001
|
}
|
|
2213
3002
|
}).then((_response) => {
|
|
2214
|
-
return this.transformResult(url_, _response, (_response) => this.
|
|
3003
|
+
return this.transformResult(url_, _response, (_response) => this.processLoadProduct(_response));
|
|
2215
3004
|
});
|
|
2216
3005
|
}
|
|
2217
|
-
|
|
3006
|
+
processLoadProduct(response) {
|
|
2218
3007
|
const status = response.status;
|
|
2219
3008
|
let _headers = {};
|
|
2220
3009
|
if (response.headers && typeof response.headers === "object") {
|
|
@@ -2238,13 +3027,6 @@ class DesignAtomsMockups3dApiClient extends ApiClientBase {
|
|
|
2238
3027
|
result404 = JSON.parse(resultData404);
|
|
2239
3028
|
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
2240
3029
|
}
|
|
2241
|
-
else if (status === 422) {
|
|
2242
|
-
const _responseText = response.data;
|
|
2243
|
-
let result422 = null;
|
|
2244
|
-
let resultData422 = _responseText;
|
|
2245
|
-
result422 = JSON.parse(resultData422);
|
|
2246
|
-
return throwException("Client Error", status, _responseText, _headers, result422);
|
|
2247
|
-
}
|
|
2248
3030
|
else if (status === 401) {
|
|
2249
3031
|
const _responseText = response.data;
|
|
2250
3032
|
return throwException("Unauthorized", status, _responseText, _headers);
|
|
@@ -2260,30 +3042,32 @@ class DesignAtomsMockups3dApiClient extends ApiClientBase {
|
|
|
2260
3042
|
return Promise.resolve(null);
|
|
2261
3043
|
}
|
|
2262
3044
|
/**
|
|
2263
|
-
*
|
|
2264
|
-
* @param id
|
|
2265
|
-
* @param
|
|
3045
|
+
* Saves product (design model) to design file and updates design in storage.
|
|
3046
|
+
* @param id Design identifier.
|
|
3047
|
+
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
2266
3048
|
* @param tenantId (optional) Tenant identifier
|
|
3049
|
+
* @param body (optional) Serialized product description.
|
|
2267
3050
|
* @return Success
|
|
2268
3051
|
*/
|
|
2269
|
-
|
|
2270
|
-
let url_ = this.baseUrl + "/api/atoms/v1/
|
|
3052
|
+
saveProduct(id, privateStorageOwner, tenantId, body, cancelToken) {
|
|
3053
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/model?";
|
|
2271
3054
|
if (id === undefined || id === null)
|
|
2272
3055
|
throw new Error("The parameter 'id' must be defined.");
|
|
2273
3056
|
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
2274
|
-
if (
|
|
2275
|
-
url_ += "
|
|
3057
|
+
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
3058
|
+
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
2276
3059
|
if (tenantId === null)
|
|
2277
3060
|
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
2278
3061
|
else if (tenantId !== undefined)
|
|
2279
3062
|
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2280
3063
|
url_ = url_.replace(/[?&]$/, "");
|
|
3064
|
+
const content_ = JSON.stringify(body);
|
|
2281
3065
|
let options_ = {
|
|
2282
|
-
|
|
2283
|
-
method: "
|
|
3066
|
+
data: content_,
|
|
3067
|
+
method: "PUT",
|
|
2284
3068
|
url: url_,
|
|
2285
3069
|
headers: {
|
|
2286
|
-
"
|
|
3070
|
+
"Content-Type": "application/json",
|
|
2287
3071
|
},
|
|
2288
3072
|
cancelToken
|
|
2289
3073
|
};
|
|
@@ -2297,10 +3081,10 @@ class DesignAtomsMockups3dApiClient extends ApiClientBase {
|
|
|
2297
3081
|
throw _error;
|
|
2298
3082
|
}
|
|
2299
3083
|
}).then((_response) => {
|
|
2300
|
-
return this.transformResult(url_, _response, (_response) => this.
|
|
3084
|
+
return this.transformResult(url_, _response, (_response) => this.processSaveProduct(_response));
|
|
2301
3085
|
});
|
|
2302
3086
|
}
|
|
2303
|
-
|
|
3087
|
+
processSaveProduct(response) {
|
|
2304
3088
|
const status = response.status;
|
|
2305
3089
|
let _headers = {};
|
|
2306
3090
|
if (response.headers && typeof response.headers === "object") {
|
|
@@ -2310,11 +3094,9 @@ class DesignAtomsMockups3dApiClient extends ApiClientBase {
|
|
|
2310
3094
|
}
|
|
2311
3095
|
}
|
|
2312
3096
|
}
|
|
2313
|
-
if (status === 200
|
|
2314
|
-
const
|
|
2315
|
-
|
|
2316
|
-
const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
|
|
2317
|
-
return Promise.resolve({ fileName: fileName, status: status, data: new Blob([response.data]), headers: _headers });
|
|
3097
|
+
if (status === 200) {
|
|
3098
|
+
const _responseText = response.data;
|
|
3099
|
+
return Promise.resolve(null);
|
|
2318
3100
|
}
|
|
2319
3101
|
else if (status === 404) {
|
|
2320
3102
|
const _responseText = response.data;
|
|
@@ -2323,13 +3105,6 @@ class DesignAtomsMockups3dApiClient extends ApiClientBase {
|
|
|
2323
3105
|
result404 = JSON.parse(resultData404);
|
|
2324
3106
|
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
2325
3107
|
}
|
|
2326
|
-
else if (status === 422) {
|
|
2327
|
-
const _responseText = response.data;
|
|
2328
|
-
let result422 = null;
|
|
2329
|
-
let resultData422 = _responseText;
|
|
2330
|
-
result422 = JSON.parse(resultData422);
|
|
2331
|
-
return throwException("Client Error", status, _responseText, _headers, result422);
|
|
2332
|
-
}
|
|
2333
3108
|
else if (status === 401) {
|
|
2334
3109
|
const _responseText = response.data;
|
|
2335
3110
|
return throwException("Unauthorized", status, _responseText, _headers);
|
|
@@ -2345,31 +3120,52 @@ class DesignAtomsMockups3dApiClient extends ApiClientBase {
|
|
|
2345
3120
|
return Promise.resolve(null);
|
|
2346
3121
|
}
|
|
2347
3122
|
/**
|
|
2348
|
-
*
|
|
2349
|
-
* @param id
|
|
2350
|
-
* @param
|
|
3123
|
+
* Patches product (design model) in design file.
|
|
3124
|
+
* @param id Design identifier.
|
|
3125
|
+
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
2351
3126
|
* @param tenantId (optional) Tenant identifier
|
|
3127
|
+
* @param patchType (optional)
|
|
3128
|
+
* @param replaceImageItemFileInfo_itemName (optional)
|
|
3129
|
+
* @param replaceImageItemFileInfo_sourceFile (optional)
|
|
3130
|
+
* @param replacePlaceholderItemContentInfo_placeholderItemName (optional)
|
|
3131
|
+
* @param replacePlaceholderItemContentInfo_newContentType (optional)
|
|
3132
|
+
* @param replacePlaceholderItemContentInfo_sourceFile (optional)
|
|
2352
3133
|
* @return Success
|
|
2353
3134
|
*/
|
|
2354
|
-
|
|
2355
|
-
let url_ = this.baseUrl + "/api/atoms/v1/
|
|
3135
|
+
patchProduct(id, privateStorageOwner, tenantId, patchType, replaceImageItemFileInfo_itemName, replaceImageItemFileInfo_sourceFile, replacePlaceholderItemContentInfo_placeholderItemName, replacePlaceholderItemContentInfo_newContentType, replacePlaceholderItemContentInfo_sourceFile, cancelToken) {
|
|
3136
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/model?";
|
|
2356
3137
|
if (id === undefined || id === null)
|
|
2357
3138
|
throw new Error("The parameter 'id' must be defined.");
|
|
2358
3139
|
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
2359
|
-
if (
|
|
2360
|
-
url_ += "
|
|
3140
|
+
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
3141
|
+
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
2361
3142
|
if (tenantId === null)
|
|
2362
3143
|
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
2363
3144
|
else if (tenantId !== undefined)
|
|
2364
3145
|
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2365
3146
|
url_ = url_.replace(/[?&]$/, "");
|
|
3147
|
+
const content_ = new FormData();
|
|
3148
|
+
if (patchType === null || patchType === undefined)
|
|
3149
|
+
throw new Error("The parameter 'patchType' cannot be null.");
|
|
3150
|
+
else
|
|
3151
|
+
content_.append("patchType", patchType.toString());
|
|
3152
|
+
if (replaceImageItemFileInfo_itemName !== null && replaceImageItemFileInfo_itemName !== undefined)
|
|
3153
|
+
content_.append("replaceImageItemFileInfo.itemName", replaceImageItemFileInfo_itemName.toString());
|
|
3154
|
+
if (replaceImageItemFileInfo_sourceFile !== null && replaceImageItemFileInfo_sourceFile !== undefined)
|
|
3155
|
+
content_.append("replaceImageItemFileInfo.sourceFile", replaceImageItemFileInfo_sourceFile.data, replaceImageItemFileInfo_sourceFile.fileName ? replaceImageItemFileInfo_sourceFile.fileName : "replaceImageItemFileInfo.sourceFile");
|
|
3156
|
+
if (replacePlaceholderItemContentInfo_placeholderItemName !== null && replacePlaceholderItemContentInfo_placeholderItemName !== undefined)
|
|
3157
|
+
content_.append("replacePlaceholderItemContentInfo.placeholderItemName", replacePlaceholderItemContentInfo_placeholderItemName.toString());
|
|
3158
|
+
if (replacePlaceholderItemContentInfo_newContentType === null || replacePlaceholderItemContentInfo_newContentType === undefined)
|
|
3159
|
+
throw new Error("The parameter 'replacePlaceholderItemContentInfo_newContentType' cannot be null.");
|
|
3160
|
+
else
|
|
3161
|
+
content_.append("replacePlaceholderItemContentInfo.newContentType", replacePlaceholderItemContentInfo_newContentType.toString());
|
|
3162
|
+
if (replacePlaceholderItemContentInfo_sourceFile !== null && replacePlaceholderItemContentInfo_sourceFile !== undefined)
|
|
3163
|
+
content_.append("replacePlaceholderItemContentInfo.sourceFile", replacePlaceholderItemContentInfo_sourceFile.data, replacePlaceholderItemContentInfo_sourceFile.fileName ? replacePlaceholderItemContentInfo_sourceFile.fileName : "replacePlaceholderItemContentInfo.sourceFile");
|
|
2366
3164
|
let options_ = {
|
|
2367
|
-
|
|
2368
|
-
method: "
|
|
3165
|
+
data: content_,
|
|
3166
|
+
method: "PATCH",
|
|
2369
3167
|
url: url_,
|
|
2370
|
-
headers: {
|
|
2371
|
-
"Accept": "application/json"
|
|
2372
|
-
},
|
|
3168
|
+
headers: {},
|
|
2373
3169
|
cancelToken
|
|
2374
3170
|
};
|
|
2375
3171
|
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
@@ -2382,10 +3178,10 @@ class DesignAtomsMockups3dApiClient extends ApiClientBase {
|
|
|
2382
3178
|
throw _error;
|
|
2383
3179
|
}
|
|
2384
3180
|
}).then((_response) => {
|
|
2385
|
-
return this.transformResult(url_, _response, (_response) => this.
|
|
3181
|
+
return this.transformResult(url_, _response, (_response) => this.processPatchProduct(_response));
|
|
2386
3182
|
});
|
|
2387
3183
|
}
|
|
2388
|
-
|
|
3184
|
+
processPatchProduct(response) {
|
|
2389
3185
|
const status = response.status;
|
|
2390
3186
|
let _headers = {};
|
|
2391
3187
|
if (response.headers && typeof response.headers === "object") {
|
|
@@ -2395,11 +3191,9 @@ class DesignAtomsMockups3dApiClient extends ApiClientBase {
|
|
|
2395
3191
|
}
|
|
2396
3192
|
}
|
|
2397
3193
|
}
|
|
2398
|
-
if (status === 200
|
|
2399
|
-
const
|
|
2400
|
-
|
|
2401
|
-
const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
|
|
2402
|
-
return Promise.resolve({ fileName: fileName, status: status, data: new Blob([response.data]), headers: _headers });
|
|
3194
|
+
if (status === 200) {
|
|
3195
|
+
const _responseText = response.data;
|
|
3196
|
+
return Promise.resolve(null);
|
|
2403
3197
|
}
|
|
2404
3198
|
else if (status === 404) {
|
|
2405
3199
|
const _responseText = response.data;
|
|
@@ -2408,13 +3202,6 @@ class DesignAtomsMockups3dApiClient extends ApiClientBase {
|
|
|
2408
3202
|
result404 = JSON.parse(resultData404);
|
|
2409
3203
|
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
2410
3204
|
}
|
|
2411
|
-
else if (status === 422) {
|
|
2412
|
-
const _responseText = response.data;
|
|
2413
|
-
let result422 = null;
|
|
2414
|
-
let resultData422 = _responseText;
|
|
2415
|
-
result422 = JSON.parse(resultData422);
|
|
2416
|
-
return throwException("Client Error", status, _responseText, _headers, result422);
|
|
2417
|
-
}
|
|
2418
3205
|
else if (status === 401) {
|
|
2419
3206
|
const _responseText = response.data;
|
|
2420
3207
|
return throwException("Unauthorized", status, _responseText, _headers);
|
|
@@ -2429,26 +3216,18 @@ class DesignAtomsMockups3dApiClient extends ApiClientBase {
|
|
|
2429
3216
|
}
|
|
2430
3217
|
return Promise.resolve(null);
|
|
2431
3218
|
}
|
|
2432
|
-
}
|
|
2433
|
-
exports.DesignAtomsMockups3dApiClient = DesignAtomsMockups3dApiClient;
|
|
2434
|
-
class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
2435
|
-
instance;
|
|
2436
|
-
baseUrl;
|
|
2437
|
-
jsonParseReviver = undefined;
|
|
2438
|
-
constructor(configuration, baseUrl, instance) {
|
|
2439
|
-
super(configuration);
|
|
2440
|
-
this.instance = instance ? instance : axios_1.create();
|
|
2441
|
-
this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : this.getBaseUrl("");
|
|
2442
|
-
}
|
|
2443
3219
|
/**
|
|
2444
|
-
*
|
|
3220
|
+
* Returns design parameters stored in product model.
|
|
3221
|
+
* @param id Design identifier.
|
|
2445
3222
|
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
2446
3223
|
* @param tenantId (optional) Tenant identifier
|
|
2447
|
-
* @
|
|
2448
|
-
* @return Created
|
|
3224
|
+
* @return Success
|
|
2449
3225
|
*/
|
|
2450
|
-
|
|
2451
|
-
let url_ = this.baseUrl + "/api/atoms/v1/designs?";
|
|
3226
|
+
getDesignParameters(id, privateStorageOwner, tenantId, cancelToken) {
|
|
3227
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/parameters?";
|
|
3228
|
+
if (id === undefined || id === null)
|
|
3229
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
3230
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
2452
3231
|
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
2453
3232
|
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
2454
3233
|
if (tenantId === null)
|
|
@@ -2456,13 +3235,10 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2456
3235
|
else if (tenantId !== undefined)
|
|
2457
3236
|
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2458
3237
|
url_ = url_.replace(/[?&]$/, "");
|
|
2459
|
-
const content_ = JSON.stringify(body);
|
|
2460
3238
|
let options_ = {
|
|
2461
|
-
|
|
2462
|
-
method: "POST",
|
|
3239
|
+
method: "GET",
|
|
2463
3240
|
url: url_,
|
|
2464
3241
|
headers: {
|
|
2465
|
-
"Content-Type": "application/json",
|
|
2466
3242
|
"Accept": "application/json"
|
|
2467
3243
|
},
|
|
2468
3244
|
cancelToken
|
|
@@ -2477,10 +3253,10 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2477
3253
|
throw _error;
|
|
2478
3254
|
}
|
|
2479
3255
|
}).then((_response) => {
|
|
2480
|
-
return this.transformResult(url_, _response, (_response) => this.
|
|
3256
|
+
return this.transformResult(url_, _response, (_response) => this.processGetDesignParameters(_response));
|
|
2481
3257
|
});
|
|
2482
3258
|
}
|
|
2483
|
-
|
|
3259
|
+
processGetDesignParameters(response) {
|
|
2484
3260
|
const status = response.status;
|
|
2485
3261
|
let _headers = {};
|
|
2486
3262
|
if (response.headers && typeof response.headers === "object") {
|
|
@@ -2490,12 +3266,19 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2490
3266
|
}
|
|
2491
3267
|
}
|
|
2492
3268
|
}
|
|
2493
|
-
if (status ===
|
|
3269
|
+
if (status === 200) {
|
|
2494
3270
|
const _responseText = response.data;
|
|
2495
|
-
let
|
|
2496
|
-
let
|
|
2497
|
-
|
|
2498
|
-
return Promise.resolve(
|
|
3271
|
+
let result200 = null;
|
|
3272
|
+
let resultData200 = _responseText;
|
|
3273
|
+
result200 = JSON.parse(resultData200);
|
|
3274
|
+
return Promise.resolve(result200);
|
|
3275
|
+
}
|
|
3276
|
+
else if (status === 404) {
|
|
3277
|
+
const _responseText = response.data;
|
|
3278
|
+
let result404 = null;
|
|
3279
|
+
let resultData404 = _responseText;
|
|
3280
|
+
result404 = JSON.parse(resultData404);
|
|
3281
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
2499
3282
|
}
|
|
2500
3283
|
else if (status === 401) {
|
|
2501
3284
|
const _responseText = response.data;
|
|
@@ -2512,20 +3295,17 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2512
3295
|
return Promise.resolve(null);
|
|
2513
3296
|
}
|
|
2514
3297
|
/**
|
|
2515
|
-
*
|
|
3298
|
+
* Loads data schema from design file taken from storage.
|
|
2516
3299
|
* @param id Design identifier.
|
|
2517
|
-
* @param surfaceIndex (optional) Surface index.
|
|
2518
3300
|
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
2519
3301
|
* @param tenantId (optional) Tenant identifier
|
|
2520
3302
|
* @return Success
|
|
2521
3303
|
*/
|
|
2522
|
-
|
|
2523
|
-
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/
|
|
3304
|
+
loadDataSchema(id, privateStorageOwner, tenantId, cancelToken) {
|
|
3305
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/schema?";
|
|
2524
3306
|
if (id === undefined || id === null)
|
|
2525
3307
|
throw new Error("The parameter 'id' must be defined.");
|
|
2526
3308
|
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
2527
|
-
if (surfaceIndex !== undefined && surfaceIndex !== null)
|
|
2528
|
-
url_ += "surfaceIndex=" + encodeURIComponent("" + surfaceIndex) + "&";
|
|
2529
3309
|
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
2530
3310
|
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
2531
3311
|
if (tenantId === null)
|
|
@@ -2552,10 +3332,10 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2552
3332
|
throw _error;
|
|
2553
3333
|
}
|
|
2554
3334
|
}).then((_response) => {
|
|
2555
|
-
return this.transformResult(url_, _response, (_response) => this.
|
|
3335
|
+
return this.transformResult(url_, _response, (_response) => this.processLoadDataSchema(_response));
|
|
2556
3336
|
});
|
|
2557
3337
|
}
|
|
2558
|
-
|
|
3338
|
+
processLoadDataSchema(response) {
|
|
2559
3339
|
const status = response.status;
|
|
2560
3340
|
let _headers = {};
|
|
2561
3341
|
if (response.headers && typeof response.headers === "object") {
|
|
@@ -2578,12 +3358,12 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2578
3358
|
result404 = JSON.parse(resultData404);
|
|
2579
3359
|
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
2580
3360
|
}
|
|
2581
|
-
else if (status ===
|
|
3361
|
+
else if (status === 409) {
|
|
2582
3362
|
const _responseText = response.data;
|
|
2583
|
-
let
|
|
2584
|
-
let
|
|
2585
|
-
|
|
2586
|
-
return throwException("
|
|
3363
|
+
let result409 = null;
|
|
3364
|
+
let resultData409 = _responseText;
|
|
3365
|
+
result409 = JSON.parse(resultData409);
|
|
3366
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
2587
3367
|
}
|
|
2588
3368
|
else if (status === 401) {
|
|
2589
3369
|
const _responseText = response.data;
|
|
@@ -2600,14 +3380,14 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2600
3380
|
return Promise.resolve(null);
|
|
2601
3381
|
}
|
|
2602
3382
|
/**
|
|
2603
|
-
* Loads
|
|
3383
|
+
* Loads a toggle set from design file taken from storage.
|
|
2604
3384
|
* @param id Design identifier.
|
|
2605
3385
|
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
2606
3386
|
* @param tenantId (optional) Tenant identifier
|
|
2607
3387
|
* @return Success
|
|
2608
3388
|
*/
|
|
2609
|
-
|
|
2610
|
-
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/
|
|
3389
|
+
loadToggleSet(id, privateStorageOwner, tenantId, cancelToken) {
|
|
3390
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/toggle-set?";
|
|
2611
3391
|
if (id === undefined || id === null)
|
|
2612
3392
|
throw new Error("The parameter 'id' must be defined.");
|
|
2613
3393
|
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
@@ -2619,10 +3399,11 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2619
3399
|
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2620
3400
|
url_ = url_.replace(/[?&]$/, "");
|
|
2621
3401
|
let options_ = {
|
|
3402
|
+
responseType: "blob",
|
|
2622
3403
|
method: "GET",
|
|
2623
3404
|
url: url_,
|
|
2624
3405
|
headers: {
|
|
2625
|
-
"Accept": "application/
|
|
3406
|
+
"Accept": "application/octet-stream"
|
|
2626
3407
|
},
|
|
2627
3408
|
cancelToken
|
|
2628
3409
|
};
|
|
@@ -2636,10 +3417,10 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2636
3417
|
throw _error;
|
|
2637
3418
|
}
|
|
2638
3419
|
}).then((_response) => {
|
|
2639
|
-
return this.transformResult(url_, _response, (_response) => this.
|
|
3420
|
+
return this.transformResult(url_, _response, (_response) => this.processLoadToggleSet(_response));
|
|
2640
3421
|
});
|
|
2641
3422
|
}
|
|
2642
|
-
|
|
3423
|
+
processLoadToggleSet(response) {
|
|
2643
3424
|
const status = response.status;
|
|
2644
3425
|
let _headers = {};
|
|
2645
3426
|
if (response.headers && typeof response.headers === "object") {
|
|
@@ -2649,12 +3430,11 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2649
3430
|
}
|
|
2650
3431
|
}
|
|
2651
3432
|
}
|
|
2652
|
-
if (status === 200) {
|
|
2653
|
-
const
|
|
2654
|
-
|
|
2655
|
-
|
|
2656
|
-
|
|
2657
|
-
return Promise.resolve(result200);
|
|
3433
|
+
if (status === 200 || status === 206) {
|
|
3434
|
+
const contentDisposition = response.headers ? response.headers["content-disposition"] : undefined;
|
|
3435
|
+
const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
|
|
3436
|
+
const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
|
|
3437
|
+
return Promise.resolve({ fileName: fileName, status: status, data: new Blob([response.data]), headers: _headers });
|
|
2658
3438
|
}
|
|
2659
3439
|
else if (status === 404) {
|
|
2660
3440
|
const _responseText = response.data;
|
|
@@ -2663,6 +3443,13 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2663
3443
|
result404 = JSON.parse(resultData404);
|
|
2664
3444
|
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
2665
3445
|
}
|
|
3446
|
+
else if (status === 409) {
|
|
3447
|
+
const _responseText = response.data;
|
|
3448
|
+
let result409 = null;
|
|
3449
|
+
let resultData409 = _responseText;
|
|
3450
|
+
result409 = JSON.parse(resultData409);
|
|
3451
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
3452
|
+
}
|
|
2666
3453
|
else if (status === 401) {
|
|
2667
3454
|
const _responseText = response.data;
|
|
2668
3455
|
return throwException("Unauthorized", status, _responseText, _headers);
|
|
@@ -2678,15 +3465,14 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2678
3465
|
return Promise.resolve(null);
|
|
2679
3466
|
}
|
|
2680
3467
|
/**
|
|
2681
|
-
*
|
|
3468
|
+
* Gets variable items information for design file taken from storage.
|
|
2682
3469
|
* @param id Design identifier.
|
|
2683
3470
|
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
2684
3471
|
* @param tenantId (optional) Tenant identifier
|
|
2685
|
-
* @param body (optional) Serialized product description.
|
|
2686
3472
|
* @return Success
|
|
2687
3473
|
*/
|
|
2688
|
-
|
|
2689
|
-
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/
|
|
3474
|
+
getVariables(id, privateStorageOwner, tenantId, cancelToken) {
|
|
3475
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/variables?";
|
|
2690
3476
|
if (id === undefined || id === null)
|
|
2691
3477
|
throw new Error("The parameter 'id' must be defined.");
|
|
2692
3478
|
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
@@ -2697,13 +3483,11 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2697
3483
|
else if (tenantId !== undefined)
|
|
2698
3484
|
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2699
3485
|
url_ = url_.replace(/[?&]$/, "");
|
|
2700
|
-
const content_ = JSON.stringify(body);
|
|
2701
3486
|
let options_ = {
|
|
2702
|
-
|
|
2703
|
-
method: "PUT",
|
|
3487
|
+
method: "GET",
|
|
2704
3488
|
url: url_,
|
|
2705
3489
|
headers: {
|
|
2706
|
-
"
|
|
3490
|
+
"Accept": "application/json"
|
|
2707
3491
|
},
|
|
2708
3492
|
cancelToken
|
|
2709
3493
|
};
|
|
@@ -2717,10 +3501,10 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2717
3501
|
throw _error;
|
|
2718
3502
|
}
|
|
2719
3503
|
}).then((_response) => {
|
|
2720
|
-
return this.transformResult(url_, _response, (_response) => this.
|
|
3504
|
+
return this.transformResult(url_, _response, (_response) => this.processGetVariables(_response));
|
|
2721
3505
|
});
|
|
2722
3506
|
}
|
|
2723
|
-
|
|
3507
|
+
processGetVariables(response) {
|
|
2724
3508
|
const status = response.status;
|
|
2725
3509
|
let _headers = {};
|
|
2726
3510
|
if (response.headers && typeof response.headers === "object") {
|
|
@@ -2732,7 +3516,10 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2732
3516
|
}
|
|
2733
3517
|
if (status === 200) {
|
|
2734
3518
|
const _responseText = response.data;
|
|
2735
|
-
|
|
3519
|
+
let result200 = null;
|
|
3520
|
+
let resultData200 = _responseText;
|
|
3521
|
+
result200 = JSON.parse(resultData200);
|
|
3522
|
+
return Promise.resolve(result200);
|
|
2736
3523
|
}
|
|
2737
3524
|
else if (status === 404) {
|
|
2738
3525
|
const _responseText = response.data;
|
|
@@ -2756,20 +3543,15 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2756
3543
|
return Promise.resolve(null);
|
|
2757
3544
|
}
|
|
2758
3545
|
/**
|
|
2759
|
-
*
|
|
3546
|
+
* Sets variable items values for design file taken from storage.
|
|
2760
3547
|
* @param id Design identifier.
|
|
2761
3548
|
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
2762
3549
|
* @param tenantId (optional) Tenant identifier
|
|
2763
|
-
* @param
|
|
2764
|
-
* @param replaceImageItemFileInfo_itemName (optional)
|
|
2765
|
-
* @param replaceImageItemFileInfo_sourceFile (optional)
|
|
2766
|
-
* @param replacePlaceholderItemContentInfo_placeholderItemName (optional)
|
|
2767
|
-
* @param replacePlaceholderItemContentInfo_newContentType (optional)
|
|
2768
|
-
* @param replacePlaceholderItemContentInfo_sourceFile (optional)
|
|
3550
|
+
* @param body (optional) Design variable values.
|
|
2769
3551
|
* @return Success
|
|
2770
3552
|
*/
|
|
2771
|
-
|
|
2772
|
-
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/
|
|
3553
|
+
setVariables(id, privateStorageOwner, tenantId, body, cancelToken) {
|
|
3554
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/variables?";
|
|
2773
3555
|
if (id === undefined || id === null)
|
|
2774
3556
|
throw new Error("The parameter 'id' must be defined.");
|
|
2775
3557
|
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
@@ -2780,28 +3562,14 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2780
3562
|
else if (tenantId !== undefined)
|
|
2781
3563
|
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2782
3564
|
url_ = url_.replace(/[?&]$/, "");
|
|
2783
|
-
const content_ =
|
|
2784
|
-
if (patchType === null || patchType === undefined)
|
|
2785
|
-
throw new Error("The parameter 'patchType' cannot be null.");
|
|
2786
|
-
else
|
|
2787
|
-
content_.append("patchType", patchType.toString());
|
|
2788
|
-
if (replaceImageItemFileInfo_itemName !== null && replaceImageItemFileInfo_itemName !== undefined)
|
|
2789
|
-
content_.append("replaceImageItemFileInfo.itemName", replaceImageItemFileInfo_itemName.toString());
|
|
2790
|
-
if (replaceImageItemFileInfo_sourceFile !== null && replaceImageItemFileInfo_sourceFile !== undefined)
|
|
2791
|
-
content_.append("replaceImageItemFileInfo.sourceFile", replaceImageItemFileInfo_sourceFile.data, replaceImageItemFileInfo_sourceFile.fileName ? replaceImageItemFileInfo_sourceFile.fileName : "replaceImageItemFileInfo.sourceFile");
|
|
2792
|
-
if (replacePlaceholderItemContentInfo_placeholderItemName !== null && replacePlaceholderItemContentInfo_placeholderItemName !== undefined)
|
|
2793
|
-
content_.append("replacePlaceholderItemContentInfo.placeholderItemName", replacePlaceholderItemContentInfo_placeholderItemName.toString());
|
|
2794
|
-
if (replacePlaceholderItemContentInfo_newContentType === null || replacePlaceholderItemContentInfo_newContentType === undefined)
|
|
2795
|
-
throw new Error("The parameter 'replacePlaceholderItemContentInfo_newContentType' cannot be null.");
|
|
2796
|
-
else
|
|
2797
|
-
content_.append("replacePlaceholderItemContentInfo.newContentType", replacePlaceholderItemContentInfo_newContentType.toString());
|
|
2798
|
-
if (replacePlaceholderItemContentInfo_sourceFile !== null && replacePlaceholderItemContentInfo_sourceFile !== undefined)
|
|
2799
|
-
content_.append("replacePlaceholderItemContentInfo.sourceFile", replacePlaceholderItemContentInfo_sourceFile.data, replacePlaceholderItemContentInfo_sourceFile.fileName ? replacePlaceholderItemContentInfo_sourceFile.fileName : "replacePlaceholderItemContentInfo.sourceFile");
|
|
3565
|
+
const content_ = JSON.stringify(body);
|
|
2800
3566
|
let options_ = {
|
|
2801
3567
|
data: content_,
|
|
2802
|
-
method: "
|
|
3568
|
+
method: "PUT",
|
|
2803
3569
|
url: url_,
|
|
2804
|
-
headers: {
|
|
3570
|
+
headers: {
|
|
3571
|
+
"Content-Type": "application/json",
|
|
3572
|
+
},
|
|
2805
3573
|
cancelToken
|
|
2806
3574
|
};
|
|
2807
3575
|
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
@@ -2814,10 +3582,10 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2814
3582
|
throw _error;
|
|
2815
3583
|
}
|
|
2816
3584
|
}).then((_response) => {
|
|
2817
|
-
return this.transformResult(url_, _response, (_response) => this.
|
|
3585
|
+
return this.transformResult(url_, _response, (_response) => this.processSetVariables(_response));
|
|
2818
3586
|
});
|
|
2819
3587
|
}
|
|
2820
|
-
|
|
3588
|
+
processSetVariables(response) {
|
|
2821
3589
|
const status = response.status;
|
|
2822
3590
|
let _headers = {};
|
|
2823
3591
|
if (response.headers && typeof response.headers === "object") {
|
|
@@ -2838,6 +3606,13 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2838
3606
|
result404 = JSON.parse(resultData404);
|
|
2839
3607
|
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
2840
3608
|
}
|
|
3609
|
+
else if (status === 409) {
|
|
3610
|
+
const _responseText = response.data;
|
|
3611
|
+
let result409 = null;
|
|
3612
|
+
let resultData409 = _responseText;
|
|
3613
|
+
result409 = JSON.parse(resultData409);
|
|
3614
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
3615
|
+
}
|
|
2841
3616
|
else if (status === 401) {
|
|
2842
3617
|
const _responseText = response.data;
|
|
2843
3618
|
return throwException("Unauthorized", status, _responseText, _headers);
|
|
@@ -2853,14 +3628,14 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2853
3628
|
return Promise.resolve(null);
|
|
2854
3629
|
}
|
|
2855
3630
|
/**
|
|
2856
|
-
*
|
|
3631
|
+
* Loads variable data printing information from design file taken from storage.
|
|
2857
3632
|
* @param id Design identifier.
|
|
2858
3633
|
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
2859
3634
|
* @param tenantId (optional) Tenant identifier
|
|
2860
3635
|
* @return Success
|
|
2861
3636
|
*/
|
|
2862
|
-
|
|
2863
|
-
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/
|
|
3637
|
+
loadVdpData(id, privateStorageOwner, tenantId, cancelToken) {
|
|
3638
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/vdp-data?";
|
|
2864
3639
|
if (id === undefined || id === null)
|
|
2865
3640
|
throw new Error("The parameter 'id' must be defined.");
|
|
2866
3641
|
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
@@ -2889,10 +3664,10 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2889
3664
|
throw _error;
|
|
2890
3665
|
}
|
|
2891
3666
|
}).then((_response) => {
|
|
2892
|
-
return this.transformResult(url_, _response, (_response) => this.
|
|
3667
|
+
return this.transformResult(url_, _response, (_response) => this.processLoadVdpData(_response));
|
|
2893
3668
|
});
|
|
2894
3669
|
}
|
|
2895
|
-
|
|
3670
|
+
processLoadVdpData(response) {
|
|
2896
3671
|
const status = response.status;
|
|
2897
3672
|
let _headers = {};
|
|
2898
3673
|
if (response.headers && typeof response.headers === "object") {
|
|
@@ -2916,6 +3691,13 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2916
3691
|
result404 = JSON.parse(resultData404);
|
|
2917
3692
|
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
2918
3693
|
}
|
|
3694
|
+
else if (status === 409) {
|
|
3695
|
+
const _responseText = response.data;
|
|
3696
|
+
let result409 = null;
|
|
3697
|
+
let resultData409 = _responseText;
|
|
3698
|
+
result409 = JSON.parse(resultData409);
|
|
3699
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
3700
|
+
}
|
|
2919
3701
|
else if (status === 401) {
|
|
2920
3702
|
const _responseText = response.data;
|
|
2921
3703
|
return throwException("Unauthorized", status, _responseText, _headers);
|
|
@@ -2931,14 +3713,15 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2931
3713
|
return Promise.resolve(null);
|
|
2932
3714
|
}
|
|
2933
3715
|
/**
|
|
2934
|
-
*
|
|
3716
|
+
* Saves variable data printing information to design file and updates design in storage.
|
|
2935
3717
|
* @param id Design identifier.
|
|
2936
3718
|
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
2937
3719
|
* @param tenantId (optional) Tenant identifier
|
|
3720
|
+
* @param body (optional) Serialized vdp data.
|
|
2938
3721
|
* @return Success
|
|
2939
3722
|
*/
|
|
2940
|
-
|
|
2941
|
-
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/
|
|
3723
|
+
saveVdpData(id, privateStorageOwner, tenantId, body, cancelToken) {
|
|
3724
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/vdp-data?";
|
|
2942
3725
|
if (id === undefined || id === null)
|
|
2943
3726
|
throw new Error("The parameter 'id' must be defined.");
|
|
2944
3727
|
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
@@ -2949,12 +3732,13 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2949
3732
|
else if (tenantId !== undefined)
|
|
2950
3733
|
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2951
3734
|
url_ = url_.replace(/[?&]$/, "");
|
|
3735
|
+
const content_ = JSON.stringify(body);
|
|
2952
3736
|
let options_ = {
|
|
2953
|
-
|
|
2954
|
-
method: "
|
|
3737
|
+
data: content_,
|
|
3738
|
+
method: "PUT",
|
|
2955
3739
|
url: url_,
|
|
2956
3740
|
headers: {
|
|
2957
|
-
"
|
|
3741
|
+
"Content-Type": "application/json",
|
|
2958
3742
|
},
|
|
2959
3743
|
cancelToken
|
|
2960
3744
|
};
|
|
@@ -2968,10 +3752,10 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2968
3752
|
throw _error;
|
|
2969
3753
|
}
|
|
2970
3754
|
}).then((_response) => {
|
|
2971
|
-
return this.transformResult(url_, _response, (_response) => this.
|
|
3755
|
+
return this.transformResult(url_, _response, (_response) => this.processSaveVdpData(_response));
|
|
2972
3756
|
});
|
|
2973
3757
|
}
|
|
2974
|
-
|
|
3758
|
+
processSaveVdpData(response) {
|
|
2975
3759
|
const status = response.status;
|
|
2976
3760
|
let _headers = {};
|
|
2977
3761
|
if (response.headers && typeof response.headers === "object") {
|
|
@@ -2981,11 +3765,9 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2981
3765
|
}
|
|
2982
3766
|
}
|
|
2983
3767
|
}
|
|
2984
|
-
if (status === 200
|
|
2985
|
-
const
|
|
2986
|
-
|
|
2987
|
-
const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
|
|
2988
|
-
return Promise.resolve({ fileName: fileName, status: status, data: new Blob([response.data]), headers: _headers });
|
|
3768
|
+
if (status === 200) {
|
|
3769
|
+
const _responseText = response.data;
|
|
3770
|
+
return Promise.resolve(null);
|
|
2989
3771
|
}
|
|
2990
3772
|
else if (status === 404) {
|
|
2991
3773
|
const _responseText = response.data;
|
|
@@ -2994,13 +3776,6 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2994
3776
|
result404 = JSON.parse(resultData404);
|
|
2995
3777
|
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
2996
3778
|
}
|
|
2997
|
-
else if (status === 409) {
|
|
2998
|
-
const _responseText = response.data;
|
|
2999
|
-
let result409 = null;
|
|
3000
|
-
let resultData409 = _responseText;
|
|
3001
|
-
result409 = JSON.parse(resultData409);
|
|
3002
|
-
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
3003
|
-
}
|
|
3004
3779
|
else if (status === 401) {
|
|
3005
3780
|
const _responseText = response.data;
|
|
3006
3781
|
return throwException("Unauthorized", status, _responseText, _headers);
|
|
@@ -3016,14 +3791,14 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3016
3791
|
return Promise.resolve(null);
|
|
3017
3792
|
}
|
|
3018
3793
|
/**
|
|
3019
|
-
*
|
|
3794
|
+
* Deletes variable data printing information from design file and updates design in storage.
|
|
3020
3795
|
* @param id Design identifier.
|
|
3021
3796
|
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
3022
3797
|
* @param tenantId (optional) Tenant identifier
|
|
3023
3798
|
* @return Success
|
|
3024
3799
|
*/
|
|
3025
|
-
|
|
3026
|
-
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/
|
|
3800
|
+
deleteVdpData(id, privateStorageOwner, tenantId, cancelToken) {
|
|
3801
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/vdp-data?";
|
|
3027
3802
|
if (id === undefined || id === null)
|
|
3028
3803
|
throw new Error("The parameter 'id' must be defined.");
|
|
3029
3804
|
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
@@ -3035,12 +3810,9 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3035
3810
|
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
3036
3811
|
url_ = url_.replace(/[?&]$/, "");
|
|
3037
3812
|
let options_ = {
|
|
3038
|
-
|
|
3039
|
-
method: "GET",
|
|
3813
|
+
method: "DELETE",
|
|
3040
3814
|
url: url_,
|
|
3041
|
-
headers: {
|
|
3042
|
-
"Accept": "application/octet-stream"
|
|
3043
|
-
},
|
|
3815
|
+
headers: {},
|
|
3044
3816
|
cancelToken
|
|
3045
3817
|
};
|
|
3046
3818
|
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
@@ -3053,10 +3825,10 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3053
3825
|
throw _error;
|
|
3054
3826
|
}
|
|
3055
3827
|
}).then((_response) => {
|
|
3056
|
-
return this.transformResult(url_, _response, (_response) => this.
|
|
3828
|
+
return this.transformResult(url_, _response, (_response) => this.processDeleteVdpData(_response));
|
|
3057
3829
|
});
|
|
3058
3830
|
}
|
|
3059
|
-
|
|
3831
|
+
processDeleteVdpData(response) {
|
|
3060
3832
|
const status = response.status;
|
|
3061
3833
|
let _headers = {};
|
|
3062
3834
|
if (response.headers && typeof response.headers === "object") {
|
|
@@ -3066,18 +3838,9 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3066
3838
|
}
|
|
3067
3839
|
}
|
|
3068
3840
|
}
|
|
3069
|
-
if (status === 200
|
|
3070
|
-
const contentDisposition = response.headers ? response.headers["content-disposition"] : undefined;
|
|
3071
|
-
const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
|
|
3072
|
-
const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
|
|
3073
|
-
return Promise.resolve({ fileName: fileName, status: status, data: new Blob([response.data]), headers: _headers });
|
|
3074
|
-
}
|
|
3075
|
-
else if (status === 404) {
|
|
3841
|
+
if (status === 200) {
|
|
3076
3842
|
const _responseText = response.data;
|
|
3077
|
-
|
|
3078
|
-
let resultData404 = _responseText;
|
|
3079
|
-
result404 = JSON.parse(resultData404);
|
|
3080
|
-
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
3843
|
+
return Promise.resolve(null);
|
|
3081
3844
|
}
|
|
3082
3845
|
else if (status === 409) {
|
|
3083
3846
|
const _responseText = response.data;
|
|
@@ -3101,14 +3864,14 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3101
3864
|
return Promise.resolve(null);
|
|
3102
3865
|
}
|
|
3103
3866
|
/**
|
|
3104
|
-
*
|
|
3105
|
-
* @param id
|
|
3867
|
+
* Loads product (design model) from resource file taken from storage.
|
|
3868
|
+
* @param id Resource identifier.
|
|
3106
3869
|
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
3107
3870
|
* @param tenantId (optional) Tenant identifier
|
|
3108
3871
|
* @return Success
|
|
3109
3872
|
*/
|
|
3110
|
-
|
|
3111
|
-
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/
|
|
3873
|
+
loadProductFromResource(id, privateStorageOwner, tenantId, cancelToken) {
|
|
3874
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/from-resource/{id}/model?";
|
|
3112
3875
|
if (id === undefined || id === null)
|
|
3113
3876
|
throw new Error("The parameter 'id' must be defined.");
|
|
3114
3877
|
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
@@ -3137,10 +3900,10 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3137
3900
|
throw _error;
|
|
3138
3901
|
}
|
|
3139
3902
|
}).then((_response) => {
|
|
3140
|
-
return this.transformResult(url_, _response, (_response) => this.
|
|
3903
|
+
return this.transformResult(url_, _response, (_response) => this.processLoadProductFromResource(_response));
|
|
3141
3904
|
});
|
|
3142
3905
|
}
|
|
3143
|
-
|
|
3906
|
+
processLoadProductFromResource(response) {
|
|
3144
3907
|
const status = response.status;
|
|
3145
3908
|
let _headers = {};
|
|
3146
3909
|
if (response.headers && typeof response.headers === "object") {
|
|
@@ -3164,6 +3927,13 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3164
3927
|
result404 = JSON.parse(resultData404);
|
|
3165
3928
|
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
3166
3929
|
}
|
|
3930
|
+
else if (status === 422) {
|
|
3931
|
+
const _responseText = response.data;
|
|
3932
|
+
let result422 = null;
|
|
3933
|
+
let resultData422 = _responseText;
|
|
3934
|
+
result422 = JSON.parse(resultData422);
|
|
3935
|
+
return throwException("Client Error", status, _responseText, _headers, result422);
|
|
3936
|
+
}
|
|
3167
3937
|
else if (status === 401) {
|
|
3168
3938
|
const _responseText = response.data;
|
|
3169
3939
|
return throwException("Unauthorized", status, _responseText, _headers);
|
|
@@ -3179,20 +3949,13 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3179
3949
|
return Promise.resolve(null);
|
|
3180
3950
|
}
|
|
3181
3951
|
/**
|
|
3182
|
-
*
|
|
3183
|
-
* @param id Design identifier.
|
|
3184
|
-
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
3952
|
+
* Converts colors.
|
|
3185
3953
|
* @param tenantId (optional) Tenant identifier
|
|
3186
|
-
* @param body (optional)
|
|
3954
|
+
* @param body (optional) Convert colors operation parameters.
|
|
3187
3955
|
* @return Success
|
|
3188
3956
|
*/
|
|
3189
|
-
|
|
3190
|
-
let url_ = this.baseUrl + "/api/atoms/v1/designs/
|
|
3191
|
-
if (id === undefined || id === null)
|
|
3192
|
-
throw new Error("The parameter 'id' must be defined.");
|
|
3193
|
-
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
3194
|
-
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
3195
|
-
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
3957
|
+
convertColors(tenantId, body, cancelToken) {
|
|
3958
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/model/convert-colors?";
|
|
3196
3959
|
if (tenantId === null)
|
|
3197
3960
|
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
3198
3961
|
else if (tenantId !== undefined)
|
|
@@ -3201,10 +3964,11 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3201
3964
|
const content_ = JSON.stringify(body);
|
|
3202
3965
|
let options_ = {
|
|
3203
3966
|
data: content_,
|
|
3204
|
-
method: "
|
|
3967
|
+
method: "POST",
|
|
3205
3968
|
url: url_,
|
|
3206
3969
|
headers: {
|
|
3207
3970
|
"Content-Type": "application/json",
|
|
3971
|
+
"Accept": "application/json"
|
|
3208
3972
|
},
|
|
3209
3973
|
cancelToken
|
|
3210
3974
|
};
|
|
@@ -3218,10 +3982,10 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3218
3982
|
throw _error;
|
|
3219
3983
|
}
|
|
3220
3984
|
}).then((_response) => {
|
|
3221
|
-
return this.transformResult(url_, _response, (_response) => this.
|
|
3985
|
+
return this.transformResult(url_, _response, (_response) => this.processConvertColors(_response));
|
|
3222
3986
|
});
|
|
3223
3987
|
}
|
|
3224
|
-
|
|
3988
|
+
processConvertColors(response) {
|
|
3225
3989
|
const status = response.status;
|
|
3226
3990
|
let _headers = {};
|
|
3227
3991
|
if (response.headers && typeof response.headers === "object") {
|
|
@@ -3233,7 +3997,10 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3233
3997
|
}
|
|
3234
3998
|
if (status === 200) {
|
|
3235
3999
|
const _responseText = response.data;
|
|
3236
|
-
|
|
4000
|
+
let result200 = null;
|
|
4001
|
+
let resultData200 = _responseText;
|
|
4002
|
+
result200 = JSON.parse(resultData200);
|
|
4003
|
+
return Promise.resolve(result200);
|
|
3237
4004
|
}
|
|
3238
4005
|
else if (status === 404) {
|
|
3239
4006
|
const _responseText = response.data;
|
|
@@ -3242,13 +4009,6 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3242
4009
|
result404 = JSON.parse(resultData404);
|
|
3243
4010
|
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
3244
4011
|
}
|
|
3245
|
-
else if (status === 409) {
|
|
3246
|
-
const _responseText = response.data;
|
|
3247
|
-
let result409 = null;
|
|
3248
|
-
let resultData409 = _responseText;
|
|
3249
|
-
result409 = JSON.parse(resultData409);
|
|
3250
|
-
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
3251
|
-
}
|
|
3252
4012
|
else if (status === 401) {
|
|
3253
4013
|
const _responseText = response.data;
|
|
3254
4014
|
return throwException("Unauthorized", status, _responseText, _headers);
|
|
@@ -3264,29 +4024,27 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3264
4024
|
return Promise.resolve(null);
|
|
3265
4025
|
}
|
|
3266
4026
|
/**
|
|
3267
|
-
*
|
|
3268
|
-
* @param id Design identifier.
|
|
3269
|
-
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
4027
|
+
* Extracts product item image.
|
|
3270
4028
|
* @param tenantId (optional) Tenant identifier
|
|
4029
|
+
* @param body (optional) Extraction parameters.
|
|
3271
4030
|
* @return Success
|
|
3272
4031
|
*/
|
|
3273
|
-
|
|
3274
|
-
let url_ = this.baseUrl + "/api/atoms/v1/designs/
|
|
3275
|
-
if (id === undefined || id === null)
|
|
3276
|
-
throw new Error("The parameter 'id' must be defined.");
|
|
3277
|
-
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
3278
|
-
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
3279
|
-
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
4032
|
+
extractItemImage(tenantId, body, cancelToken) {
|
|
4033
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/model/items/extract-image?";
|
|
3280
4034
|
if (tenantId === null)
|
|
3281
4035
|
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
3282
4036
|
else if (tenantId !== undefined)
|
|
3283
4037
|
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
3284
4038
|
url_ = url_.replace(/[?&]$/, "");
|
|
4039
|
+
const content_ = JSON.stringify(body);
|
|
3285
4040
|
let options_ = {
|
|
3286
|
-
|
|
4041
|
+
data: content_,
|
|
4042
|
+
responseType: "blob",
|
|
4043
|
+
method: "POST",
|
|
3287
4044
|
url: url_,
|
|
3288
4045
|
headers: {
|
|
3289
|
-
"
|
|
4046
|
+
"Content-Type": "application/json",
|
|
4047
|
+
"Accept": "application/octet-stream"
|
|
3290
4048
|
},
|
|
3291
4049
|
cancelToken
|
|
3292
4050
|
};
|
|
@@ -3300,10 +4058,10 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3300
4058
|
throw _error;
|
|
3301
4059
|
}
|
|
3302
4060
|
}).then((_response) => {
|
|
3303
|
-
return this.transformResult(url_, _response, (_response) => this.
|
|
4061
|
+
return this.transformResult(url_, _response, (_response) => this.processExtractItemImage(_response));
|
|
3304
4062
|
});
|
|
3305
4063
|
}
|
|
3306
|
-
|
|
4064
|
+
processExtractItemImage(response) {
|
|
3307
4065
|
const status = response.status;
|
|
3308
4066
|
let _headers = {};
|
|
3309
4067
|
if (response.headers && typeof response.headers === "object") {
|
|
@@ -3313,26 +4071,11 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3313
4071
|
}
|
|
3314
4072
|
}
|
|
3315
4073
|
}
|
|
3316
|
-
if (status === 200) {
|
|
3317
|
-
const
|
|
3318
|
-
|
|
3319
|
-
|
|
3320
|
-
|
|
3321
|
-
return Promise.resolve(result200);
|
|
3322
|
-
}
|
|
3323
|
-
else if (status === 404) {
|
|
3324
|
-
const _responseText = response.data;
|
|
3325
|
-
let result404 = null;
|
|
3326
|
-
let resultData404 = _responseText;
|
|
3327
|
-
result404 = JSON.parse(resultData404);
|
|
3328
|
-
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
3329
|
-
}
|
|
3330
|
-
else if (status === 409) {
|
|
3331
|
-
const _responseText = response.data;
|
|
3332
|
-
let result409 = null;
|
|
3333
|
-
let resultData409 = _responseText;
|
|
3334
|
-
result409 = JSON.parse(resultData409);
|
|
3335
|
-
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
4074
|
+
if (status === 200 || status === 206) {
|
|
4075
|
+
const contentDisposition = response.headers ? response.headers["content-disposition"] : undefined;
|
|
4076
|
+
const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
|
|
4077
|
+
const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
|
|
4078
|
+
return Promise.resolve({ fileName: fileName, status: status, data: new Blob([response.data]), headers: _headers });
|
|
3336
4079
|
}
|
|
3337
4080
|
else if (status === 401) {
|
|
3338
4081
|
const _responseText = response.data;
|
|
@@ -3349,20 +4092,13 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3349
4092
|
return Promise.resolve(null);
|
|
3350
4093
|
}
|
|
3351
4094
|
/**
|
|
3352
|
-
*
|
|
3353
|
-
* @param id Design identifier.
|
|
3354
|
-
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
4095
|
+
* Flatten items.
|
|
3355
4096
|
* @param tenantId (optional) Tenant identifier
|
|
3356
|
-
* @param body (optional)
|
|
4097
|
+
* @param body (optional) Items to flatten.
|
|
3357
4098
|
* @return Success
|
|
3358
4099
|
*/
|
|
3359
|
-
|
|
3360
|
-
let url_ = this.baseUrl + "/api/atoms/v1/designs/
|
|
3361
|
-
if (id === undefined || id === null)
|
|
3362
|
-
throw new Error("The parameter 'id' must be defined.");
|
|
3363
|
-
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
3364
|
-
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
3365
|
-
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
4100
|
+
flattenItems(tenantId, body, cancelToken) {
|
|
4101
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/model/items/flatten?";
|
|
3366
4102
|
if (tenantId === null)
|
|
3367
4103
|
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
3368
4104
|
else if (tenantId !== undefined)
|
|
@@ -3371,10 +4107,11 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3371
4107
|
const content_ = JSON.stringify(body);
|
|
3372
4108
|
let options_ = {
|
|
3373
4109
|
data: content_,
|
|
3374
|
-
method: "
|
|
4110
|
+
method: "POST",
|
|
3375
4111
|
url: url_,
|
|
3376
4112
|
headers: {
|
|
3377
4113
|
"Content-Type": "application/json",
|
|
4114
|
+
"Accept": "application/json"
|
|
3378
4115
|
},
|
|
3379
4116
|
cancelToken
|
|
3380
4117
|
};
|
|
@@ -3388,10 +4125,10 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3388
4125
|
throw _error;
|
|
3389
4126
|
}
|
|
3390
4127
|
}).then((_response) => {
|
|
3391
|
-
return this.transformResult(url_, _response, (_response) => this.
|
|
4128
|
+
return this.transformResult(url_, _response, (_response) => this.processFlattenItems(_response));
|
|
3392
4129
|
});
|
|
3393
4130
|
}
|
|
3394
|
-
|
|
4131
|
+
processFlattenItems(response) {
|
|
3395
4132
|
const status = response.status;
|
|
3396
4133
|
let _headers = {};
|
|
3397
4134
|
if (response.headers && typeof response.headers === "object") {
|
|
@@ -3403,14 +4140,10 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3403
4140
|
}
|
|
3404
4141
|
if (status === 200) {
|
|
3405
4142
|
const _responseText = response.data;
|
|
3406
|
-
|
|
3407
|
-
|
|
3408
|
-
|
|
3409
|
-
|
|
3410
|
-
let result404 = null;
|
|
3411
|
-
let resultData404 = _responseText;
|
|
3412
|
-
result404 = JSON.parse(resultData404);
|
|
3413
|
-
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
4143
|
+
let result200 = null;
|
|
4144
|
+
let resultData200 = _responseText;
|
|
4145
|
+
result200 = JSON.parse(resultData200);
|
|
4146
|
+
return Promise.resolve(result200);
|
|
3414
4147
|
}
|
|
3415
4148
|
else if (status === 401) {
|
|
3416
4149
|
const _responseText = response.data;
|
|
@@ -3427,28 +4160,31 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3427
4160
|
return Promise.resolve(null);
|
|
3428
4161
|
}
|
|
3429
4162
|
/**
|
|
3430
|
-
*
|
|
3431
|
-
* @param
|
|
3432
|
-
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
4163
|
+
* Creates product item from input image file.
|
|
4164
|
+
* @param itemType (optional) Desired item type.
|
|
3433
4165
|
* @param tenantId (optional) Tenant identifier
|
|
4166
|
+
* @param sourceFile (optional)
|
|
3434
4167
|
* @return Success
|
|
3435
4168
|
*/
|
|
3436
|
-
|
|
3437
|
-
let url_ = this.baseUrl + "/api/atoms/v1/designs/
|
|
3438
|
-
if (
|
|
3439
|
-
|
|
3440
|
-
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
3441
|
-
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
3442
|
-
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
4169
|
+
createItemFromFile(itemType, tenantId, sourceFile, cancelToken) {
|
|
4170
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/model/items/from-file?";
|
|
4171
|
+
if (itemType !== undefined && itemType !== null)
|
|
4172
|
+
url_ += "itemType=" + encodeURIComponent("" + itemType) + "&";
|
|
3443
4173
|
if (tenantId === null)
|
|
3444
4174
|
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
3445
4175
|
else if (tenantId !== undefined)
|
|
3446
4176
|
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
3447
4177
|
url_ = url_.replace(/[?&]$/, "");
|
|
4178
|
+
const content_ = new FormData();
|
|
4179
|
+
if (sourceFile !== null && sourceFile !== undefined)
|
|
4180
|
+
content_.append("sourceFile", sourceFile.data, sourceFile.fileName ? sourceFile.fileName : "sourceFile");
|
|
3448
4181
|
let options_ = {
|
|
3449
|
-
|
|
4182
|
+
data: content_,
|
|
4183
|
+
method: "POST",
|
|
3450
4184
|
url: url_,
|
|
3451
|
-
headers: {
|
|
4185
|
+
headers: {
|
|
4186
|
+
"Accept": "application/json"
|
|
4187
|
+
},
|
|
3452
4188
|
cancelToken
|
|
3453
4189
|
};
|
|
3454
4190
|
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
@@ -3461,10 +4197,10 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3461
4197
|
throw _error;
|
|
3462
4198
|
}
|
|
3463
4199
|
}).then((_response) => {
|
|
3464
|
-
return this.transformResult(url_, _response, (_response) => this.
|
|
4200
|
+
return this.transformResult(url_, _response, (_response) => this.processCreateItemFromFile(_response));
|
|
3465
4201
|
});
|
|
3466
4202
|
}
|
|
3467
|
-
|
|
4203
|
+
processCreateItemFromFile(response) {
|
|
3468
4204
|
const status = response.status;
|
|
3469
4205
|
let _headers = {};
|
|
3470
4206
|
if (response.headers && typeof response.headers === "object") {
|
|
@@ -3476,14 +4212,17 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3476
4212
|
}
|
|
3477
4213
|
if (status === 200) {
|
|
3478
4214
|
const _responseText = response.data;
|
|
3479
|
-
|
|
4215
|
+
let result200 = null;
|
|
4216
|
+
let resultData200 = _responseText;
|
|
4217
|
+
result200 = JSON.parse(resultData200);
|
|
4218
|
+
return Promise.resolve(result200);
|
|
3480
4219
|
}
|
|
3481
|
-
else if (status ===
|
|
4220
|
+
else if (status === 404) {
|
|
3482
4221
|
const _responseText = response.data;
|
|
3483
|
-
let
|
|
3484
|
-
let
|
|
3485
|
-
|
|
3486
|
-
return throwException("
|
|
4222
|
+
let result404 = null;
|
|
4223
|
+
let resultData404 = _responseText;
|
|
4224
|
+
result404 = JSON.parse(resultData404);
|
|
4225
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
3487
4226
|
}
|
|
3488
4227
|
else if (status === 401) {
|
|
3489
4228
|
const _responseText = response.data;
|
|
@@ -3500,26 +4239,27 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3500
4239
|
return Promise.resolve(null);
|
|
3501
4240
|
}
|
|
3502
4241
|
/**
|
|
3503
|
-
*
|
|
3504
|
-
* @param
|
|
3505
|
-
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
4242
|
+
* Creates multiple product items from input image files.
|
|
4243
|
+
* @param itemType (optional) Desired items type.
|
|
3506
4244
|
* @param tenantId (optional) Tenant identifier
|
|
4245
|
+
* @param sourceFiles (optional)
|
|
3507
4246
|
* @return Success
|
|
3508
4247
|
*/
|
|
3509
|
-
|
|
3510
|
-
let url_ = this.baseUrl + "/api/atoms/v1/designs/from-
|
|
3511
|
-
if (
|
|
3512
|
-
|
|
3513
|
-
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
3514
|
-
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
3515
|
-
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
4248
|
+
batchCreateItemsFromFile(itemType, tenantId, sourceFiles, cancelToken) {
|
|
4249
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/model/items/from-file/batch-create?";
|
|
4250
|
+
if (itemType !== undefined && itemType !== null)
|
|
4251
|
+
url_ += "itemType=" + encodeURIComponent("" + itemType) + "&";
|
|
3516
4252
|
if (tenantId === null)
|
|
3517
4253
|
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
3518
4254
|
else if (tenantId !== undefined)
|
|
3519
4255
|
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
3520
4256
|
url_ = url_.replace(/[?&]$/, "");
|
|
4257
|
+
const content_ = new FormData();
|
|
4258
|
+
if (sourceFiles !== null && sourceFiles !== undefined)
|
|
4259
|
+
sourceFiles.forEach(item_ => content_.append("sourceFiles", item_.data, item_.fileName ? item_.fileName : "sourceFiles"));
|
|
3521
4260
|
let options_ = {
|
|
3522
|
-
|
|
4261
|
+
data: content_,
|
|
4262
|
+
method: "POST",
|
|
3523
4263
|
url: url_,
|
|
3524
4264
|
headers: {
|
|
3525
4265
|
"Accept": "application/json"
|
|
@@ -3536,10 +4276,10 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3536
4276
|
throw _error;
|
|
3537
4277
|
}
|
|
3538
4278
|
}).then((_response) => {
|
|
3539
|
-
return this.transformResult(url_, _response, (_response) => this.
|
|
4279
|
+
return this.transformResult(url_, _response, (_response) => this.processBatchCreateItemsFromFile(_response));
|
|
3540
4280
|
});
|
|
3541
4281
|
}
|
|
3542
|
-
|
|
4282
|
+
processBatchCreateItemsFromFile(response) {
|
|
3543
4283
|
const status = response.status;
|
|
3544
4284
|
let _headers = {};
|
|
3545
4285
|
if (response.headers && typeof response.headers === "object") {
|
|
@@ -3563,13 +4303,6 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3563
4303
|
result404 = JSON.parse(resultData404);
|
|
3564
4304
|
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
3565
4305
|
}
|
|
3566
|
-
else if (status === 422) {
|
|
3567
|
-
const _responseText = response.data;
|
|
3568
|
-
let result422 = null;
|
|
3569
|
-
let resultData422 = _responseText;
|
|
3570
|
-
result422 = JSON.parse(resultData422);
|
|
3571
|
-
return throwException("Client Error", status, _responseText, _headers, result422);
|
|
3572
|
-
}
|
|
3573
4306
|
else if (status === 401) {
|
|
3574
4307
|
const _responseText = response.data;
|
|
3575
4308
|
return throwException("Unauthorized", status, _responseText, _headers);
|
|
@@ -3585,13 +4318,16 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3585
4318
|
return Promise.resolve(null);
|
|
3586
4319
|
}
|
|
3587
4320
|
/**
|
|
3588
|
-
*
|
|
4321
|
+
* Creates product item from image in storage.
|
|
4322
|
+
* @param itemType (optional) Desired item type.
|
|
3589
4323
|
* @param tenantId (optional) Tenant identifier
|
|
3590
|
-
* @param body (optional)
|
|
4324
|
+
* @param body (optional) Operation parameters.
|
|
3591
4325
|
* @return Success
|
|
3592
4326
|
*/
|
|
3593
|
-
|
|
3594
|
-
let url_ = this.baseUrl + "/api/atoms/v1/designs/model/
|
|
4327
|
+
createItemFromStorage(itemType, tenantId, body, cancelToken) {
|
|
4328
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/model/items/from-storage?";
|
|
4329
|
+
if (itemType !== undefined && itemType !== null)
|
|
4330
|
+
url_ += "itemType=" + encodeURIComponent("" + itemType) + "&";
|
|
3595
4331
|
if (tenantId === null)
|
|
3596
4332
|
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
3597
4333
|
else if (tenantId !== undefined)
|
|
@@ -3618,10 +4354,10 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3618
4354
|
throw _error;
|
|
3619
4355
|
}
|
|
3620
4356
|
}).then((_response) => {
|
|
3621
|
-
return this.transformResult(url_, _response, (_response) => this.
|
|
4357
|
+
return this.transformResult(url_, _response, (_response) => this.processCreateItemFromStorage(_response));
|
|
3622
4358
|
});
|
|
3623
4359
|
}
|
|
3624
|
-
|
|
4360
|
+
processCreateItemFromStorage(response) {
|
|
3625
4361
|
const status = response.status;
|
|
3626
4362
|
let _headers = {};
|
|
3627
4363
|
if (response.headers && typeof response.headers === "object") {
|
|
@@ -3660,17 +4396,14 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3660
4396
|
return Promise.resolve(null);
|
|
3661
4397
|
}
|
|
3662
4398
|
/**
|
|
3663
|
-
* Creates product
|
|
3664
|
-
* @param itemType (optional) Desired
|
|
4399
|
+
* Creates multiple product items from images in storage.
|
|
4400
|
+
* @param itemType (optional) Desired items type.
|
|
3665
4401
|
* @param tenantId (optional) Tenant identifier
|
|
3666
|
-
* @param
|
|
3667
|
-
* @param sourceId (optional)
|
|
3668
|
-
* @param sourceOwnerId (optional)
|
|
3669
|
-
* @param sourceFile (optional)
|
|
4402
|
+
* @param body (optional) Create items operation parameters.
|
|
3670
4403
|
* @return Success
|
|
3671
4404
|
*/
|
|
3672
|
-
|
|
3673
|
-
let url_ = this.baseUrl + "/api/atoms/v1/designs/model/items?";
|
|
4405
|
+
batchCreateItemsFromStorage(itemType, tenantId, body, cancelToken) {
|
|
4406
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/model/items/from-storage/batch-create?";
|
|
3674
4407
|
if (itemType !== undefined && itemType !== null)
|
|
3675
4408
|
url_ += "itemType=" + encodeURIComponent("" + itemType) + "&";
|
|
3676
4409
|
if (tenantId === null)
|
|
@@ -3678,20 +4411,13 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3678
4411
|
else if (tenantId !== undefined)
|
|
3679
4412
|
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
3680
4413
|
url_ = url_.replace(/[?&]$/, "");
|
|
3681
|
-
const content_ =
|
|
3682
|
-
if (sourceType !== null && sourceType !== undefined)
|
|
3683
|
-
content_.append("sourceType", sourceType.toString());
|
|
3684
|
-
if (sourceId !== null && sourceId !== undefined)
|
|
3685
|
-
content_.append("sourceId", sourceId.toString());
|
|
3686
|
-
if (sourceOwnerId !== null && sourceOwnerId !== undefined)
|
|
3687
|
-
content_.append("sourceOwnerId", sourceOwnerId.toString());
|
|
3688
|
-
if (sourceFile !== null && sourceFile !== undefined)
|
|
3689
|
-
content_.append("sourceFile", sourceFile.data, sourceFile.fileName ? sourceFile.fileName : "sourceFile");
|
|
4414
|
+
const content_ = JSON.stringify(body);
|
|
3690
4415
|
let options_ = {
|
|
3691
4416
|
data: content_,
|
|
3692
4417
|
method: "POST",
|
|
3693
4418
|
url: url_,
|
|
3694
4419
|
headers: {
|
|
4420
|
+
"Content-Type": "application/json",
|
|
3695
4421
|
"Accept": "application/json"
|
|
3696
4422
|
},
|
|
3697
4423
|
cancelToken
|
|
@@ -3706,10 +4432,10 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3706
4432
|
throw _error;
|
|
3707
4433
|
}
|
|
3708
4434
|
}).then((_response) => {
|
|
3709
|
-
return this.transformResult(url_, _response, (_response) => this.
|
|
4435
|
+
return this.transformResult(url_, _response, (_response) => this.processBatchCreateItemsFromStorage(_response));
|
|
3710
4436
|
});
|
|
3711
4437
|
}
|
|
3712
|
-
|
|
4438
|
+
processBatchCreateItemsFromStorage(response) {
|
|
3713
4439
|
const status = response.status;
|
|
3714
4440
|
let _headers = {};
|
|
3715
4441
|
if (response.headers && typeof response.headers === "object") {
|
|
@@ -3748,13 +4474,16 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3748
4474
|
return Promise.resolve(null);
|
|
3749
4475
|
}
|
|
3750
4476
|
/**
|
|
3751
|
-
*
|
|
4477
|
+
* Creates product item from remote web image provided by URL.
|
|
4478
|
+
* @param itemType (optional) Desired item type.
|
|
3752
4479
|
* @param tenantId (optional) Tenant identifier
|
|
3753
|
-
* @param body (optional)
|
|
4480
|
+
* @param body (optional) Operation parameters.
|
|
3754
4481
|
* @return Success
|
|
3755
4482
|
*/
|
|
3756
|
-
|
|
3757
|
-
let url_ = this.baseUrl + "/api/atoms/v1/designs/model/items/
|
|
4483
|
+
createItemFromUrl(itemType, tenantId, body, cancelToken) {
|
|
4484
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/model/items/from-url?";
|
|
4485
|
+
if (itemType !== undefined && itemType !== null)
|
|
4486
|
+
url_ += "itemType=" + encodeURIComponent("" + itemType) + "&";
|
|
3758
4487
|
if (tenantId === null)
|
|
3759
4488
|
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
3760
4489
|
else if (tenantId !== undefined)
|
|
@@ -3763,12 +4492,11 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3763
4492
|
const content_ = JSON.stringify(body);
|
|
3764
4493
|
let options_ = {
|
|
3765
4494
|
data: content_,
|
|
3766
|
-
responseType: "blob",
|
|
3767
4495
|
method: "POST",
|
|
3768
4496
|
url: url_,
|
|
3769
4497
|
headers: {
|
|
3770
4498
|
"Content-Type": "application/json",
|
|
3771
|
-
"Accept": "application/
|
|
4499
|
+
"Accept": "application/json"
|
|
3772
4500
|
},
|
|
3773
4501
|
cancelToken
|
|
3774
4502
|
};
|
|
@@ -3782,10 +4510,10 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3782
4510
|
throw _error;
|
|
3783
4511
|
}
|
|
3784
4512
|
}).then((_response) => {
|
|
3785
|
-
return this.transformResult(url_, _response, (_response) => this.
|
|
4513
|
+
return this.transformResult(url_, _response, (_response) => this.processCreateItemFromUrl(_response));
|
|
3786
4514
|
});
|
|
3787
4515
|
}
|
|
3788
|
-
|
|
4516
|
+
processCreateItemFromUrl(response) {
|
|
3789
4517
|
const status = response.status;
|
|
3790
4518
|
let _headers = {};
|
|
3791
4519
|
if (response.headers && typeof response.headers === "object") {
|
|
@@ -3795,11 +4523,19 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3795
4523
|
}
|
|
3796
4524
|
}
|
|
3797
4525
|
}
|
|
3798
|
-
if (status === 200
|
|
3799
|
-
const
|
|
3800
|
-
|
|
3801
|
-
|
|
3802
|
-
|
|
4526
|
+
if (status === 200) {
|
|
4527
|
+
const _responseText = response.data;
|
|
4528
|
+
let result200 = null;
|
|
4529
|
+
let resultData200 = _responseText;
|
|
4530
|
+
result200 = JSON.parse(resultData200);
|
|
4531
|
+
return Promise.resolve(result200);
|
|
4532
|
+
}
|
|
4533
|
+
else if (status === 404) {
|
|
4534
|
+
const _responseText = response.data;
|
|
4535
|
+
let result404 = null;
|
|
4536
|
+
let resultData404 = _responseText;
|
|
4537
|
+
result404 = JSON.parse(resultData404);
|
|
4538
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
3803
4539
|
}
|
|
3804
4540
|
else if (status === 401) {
|
|
3805
4541
|
const _responseText = response.data;
|
|
@@ -3816,13 +4552,16 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3816
4552
|
return Promise.resolve(null);
|
|
3817
4553
|
}
|
|
3818
4554
|
/**
|
|
3819
|
-
*
|
|
4555
|
+
* Creates multiple product items from remote web images provided by URLs list.
|
|
4556
|
+
* @param itemType (optional) Desired items type.
|
|
3820
4557
|
* @param tenantId (optional) Tenant identifier
|
|
3821
|
-
* @param body (optional)
|
|
4558
|
+
* @param body (optional) Operation parameters.
|
|
3822
4559
|
* @return Success
|
|
3823
4560
|
*/
|
|
3824
|
-
|
|
3825
|
-
let url_ = this.baseUrl + "/api/atoms/v1/designs/model/items/
|
|
4561
|
+
batchCreateItemsFromUrl(itemType, tenantId, body, cancelToken) {
|
|
4562
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/model/items/from-url/batch-create?";
|
|
4563
|
+
if (itemType !== undefined && itemType !== null)
|
|
4564
|
+
url_ += "itemType=" + encodeURIComponent("" + itemType) + "&";
|
|
3826
4565
|
if (tenantId === null)
|
|
3827
4566
|
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
3828
4567
|
else if (tenantId !== undefined)
|
|
@@ -3849,10 +4588,10 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3849
4588
|
throw _error;
|
|
3850
4589
|
}
|
|
3851
4590
|
}).then((_response) => {
|
|
3852
|
-
return this.transformResult(url_, _response, (_response) => this.
|
|
4591
|
+
return this.transformResult(url_, _response, (_response) => this.processBatchCreateItemsFromUrl(_response));
|
|
3853
4592
|
});
|
|
3854
4593
|
}
|
|
3855
|
-
|
|
4594
|
+
processBatchCreateItemsFromUrl(response) {
|
|
3856
4595
|
const status = response.status;
|
|
3857
4596
|
let _headers = {};
|
|
3858
4597
|
if (response.headers && typeof response.headers === "object") {
|
|
@@ -3869,6 +4608,13 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3869
4608
|
result200 = JSON.parse(resultData200);
|
|
3870
4609
|
return Promise.resolve(result200);
|
|
3871
4610
|
}
|
|
4611
|
+
else if (status === 404) {
|
|
4612
|
+
const _responseText = response.data;
|
|
4613
|
+
let result404 = null;
|
|
4614
|
+
let resultData404 = _responseText;
|
|
4615
|
+
result404 = JSON.parse(resultData404);
|
|
4616
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
4617
|
+
}
|
|
3872
4618
|
else if (status === 401) {
|
|
3873
4619
|
const _responseText = response.data;
|
|
3874
4620
|
return throwException("Unauthorized", status, _responseText, _headers);
|
|
@@ -4081,6 +4827,13 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
4081
4827
|
result200 = JSON.parse(resultData200);
|
|
4082
4828
|
return Promise.resolve(result200);
|
|
4083
4829
|
}
|
|
4830
|
+
else if (status === 409) {
|
|
4831
|
+
const _responseText = response.data;
|
|
4832
|
+
let result409 = null;
|
|
4833
|
+
let resultData409 = _responseText;
|
|
4834
|
+
result409 = JSON.parse(resultData409);
|
|
4835
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
4836
|
+
}
|
|
4084
4837
|
else if (status === 401) {
|
|
4085
4838
|
const _responseText = response.data;
|
|
4086
4839
|
return throwException("Unauthorized", status, _responseText, _headers);
|
|
@@ -4221,6 +4974,105 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
4221
4974
|
result200 = JSON.parse(resultData200);
|
|
4222
4975
|
return Promise.resolve(result200);
|
|
4223
4976
|
}
|
|
4977
|
+
else if (status === 409) {
|
|
4978
|
+
const _responseText = response.data;
|
|
4979
|
+
let result409 = null;
|
|
4980
|
+
let resultData409 = _responseText;
|
|
4981
|
+
result409 = JSON.parse(resultData409);
|
|
4982
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
4983
|
+
}
|
|
4984
|
+
else if (status === 401) {
|
|
4985
|
+
const _responseText = response.data;
|
|
4986
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
4987
|
+
}
|
|
4988
|
+
else if (status === 403) {
|
|
4989
|
+
const _responseText = response.data;
|
|
4990
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
4991
|
+
}
|
|
4992
|
+
else if (status !== 200 && status !== 204) {
|
|
4993
|
+
const _responseText = response.data;
|
|
4994
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
4995
|
+
}
|
|
4996
|
+
return Promise.resolve(null);
|
|
4997
|
+
}
|
|
4998
|
+
/**
|
|
4999
|
+
* Creates product item.
|
|
5000
|
+
* @param itemType (optional) Desired item type.
|
|
5001
|
+
* @param tenantId (optional) Tenant identifier
|
|
5002
|
+
* @param sourceType (optional)
|
|
5003
|
+
* @param sourceId (optional)
|
|
5004
|
+
* @param sourceOwnerId (optional)
|
|
5005
|
+
* @param url (optional)
|
|
5006
|
+
* @param sourceFile (optional)
|
|
5007
|
+
* @return Success
|
|
5008
|
+
* @deprecated
|
|
5009
|
+
*/
|
|
5010
|
+
createItem(itemType, tenantId, sourceType, sourceId, sourceOwnerId, url, sourceFile, cancelToken) {
|
|
5011
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/model/items?";
|
|
5012
|
+
if (itemType !== undefined && itemType !== null)
|
|
5013
|
+
url_ += "itemType=" + encodeURIComponent("" + itemType) + "&";
|
|
5014
|
+
if (tenantId === null)
|
|
5015
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
5016
|
+
else if (tenantId !== undefined)
|
|
5017
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
5018
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
5019
|
+
const content_ = new FormData();
|
|
5020
|
+
if (sourceType !== null && sourceType !== undefined)
|
|
5021
|
+
content_.append("sourceType", sourceType.toString());
|
|
5022
|
+
if (sourceId !== null && sourceId !== undefined)
|
|
5023
|
+
content_.append("sourceId", sourceId.toString());
|
|
5024
|
+
if (sourceOwnerId !== null && sourceOwnerId !== undefined)
|
|
5025
|
+
content_.append("sourceOwnerId", sourceOwnerId.toString());
|
|
5026
|
+
if (url !== null && url !== undefined)
|
|
5027
|
+
content_.append("url", url.toString());
|
|
5028
|
+
if (sourceFile !== null && sourceFile !== undefined)
|
|
5029
|
+
content_.append("sourceFile", sourceFile.data, sourceFile.fileName ? sourceFile.fileName : "sourceFile");
|
|
5030
|
+
let options_ = {
|
|
5031
|
+
data: content_,
|
|
5032
|
+
method: "POST",
|
|
5033
|
+
url: url_,
|
|
5034
|
+
headers: {
|
|
5035
|
+
"Accept": "application/json"
|
|
5036
|
+
},
|
|
5037
|
+
cancelToken
|
|
5038
|
+
};
|
|
5039
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
5040
|
+
return this.instance.request(transformedOptions_);
|
|
5041
|
+
}).catch((_error) => {
|
|
5042
|
+
if (isAxiosError(_error) && _error.response) {
|
|
5043
|
+
return _error.response;
|
|
5044
|
+
}
|
|
5045
|
+
else {
|
|
5046
|
+
throw _error;
|
|
5047
|
+
}
|
|
5048
|
+
}).then((_response) => {
|
|
5049
|
+
return this.transformResult(url_, _response, (_response) => this.processCreateItem(_response));
|
|
5050
|
+
});
|
|
5051
|
+
}
|
|
5052
|
+
processCreateItem(response) {
|
|
5053
|
+
const status = response.status;
|
|
5054
|
+
let _headers = {};
|
|
5055
|
+
if (response.headers && typeof response.headers === "object") {
|
|
5056
|
+
for (let k in response.headers) {
|
|
5057
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
5058
|
+
_headers[k] = response.headers[k];
|
|
5059
|
+
}
|
|
5060
|
+
}
|
|
5061
|
+
}
|
|
5062
|
+
if (status === 200) {
|
|
5063
|
+
const _responseText = response.data;
|
|
5064
|
+
let result200 = null;
|
|
5065
|
+
let resultData200 = _responseText;
|
|
5066
|
+
result200 = JSON.parse(resultData200);
|
|
5067
|
+
return Promise.resolve(result200);
|
|
5068
|
+
}
|
|
5069
|
+
else if (status === 404) {
|
|
5070
|
+
const _responseText = response.data;
|
|
5071
|
+
let result404 = null;
|
|
5072
|
+
let resultData404 = _responseText;
|
|
5073
|
+
result404 = JSON.parse(resultData404);
|
|
5074
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
5075
|
+
}
|
|
4224
5076
|
else if (status === 401) {
|
|
4225
5077
|
const _responseText = response.data;
|
|
4226
5078
|
return throwException("Unauthorized", status, _responseText, _headers);
|
|
@@ -6309,6 +7161,7 @@ var ItemSourceType;
|
|
|
6309
7161
|
ItemSourceType["File"] = "File";
|
|
6310
7162
|
ItemSourceType["ImageStorage"] = "ImageStorage";
|
|
6311
7163
|
ItemSourceType["PrivateImageStorage"] = "PrivateImageStorage";
|
|
7164
|
+
ItemSourceType["Url"] = "Url";
|
|
6312
7165
|
})(ItemSourceType = exports.ItemSourceType || (exports.ItemSourceType = {}));
|
|
6313
7166
|
var ItemType;
|
|
6314
7167
|
(function (ItemType) {
|