@aurigma/axios-design-atoms-api-client 2.63.1 → 2.65.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/design-atoms-api-client.d.ts +939 -137
- package/dist/cjs/design-atoms-api-client.js +3329 -430
- package/dist/cjs/design-atoms-api-client.js.map +1 -1
- package/dist/esm/design-atoms-api-client.d.ts +939 -137
- package/dist/esm/design-atoms-api-client.js +3324 -427
- package/dist/esm/design-atoms-api-client.js.map +1 -1
- package/package.json +1 -1
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
//----------------------
|
|
9
9
|
// ReSharper disable InconsistentNaming
|
|
10
10
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
-
exports.ApiException = exports.ProductProofInterpolationMode = exports.ProductProofFormat = exports.ProductPreviewFormat = exports.ProductPatchType = exports.PlaceholderItemContentType = exports.ItemType = exports.ItemSourceType = exports.ImagePreviewFormat = exports.ImagePreviewFitMode = exports.DesignElementType = exports.DesignAtomsViewerApiClient = exports.DesignAtomsServiceApiClient = exports.DesignAtomsMockups3dApiClient = exports.DesignAtomsImagesApiClient = exports.DesignAtomsCompatibilityApiClient = exports.BuildInfoApiClient = exports.ApiClientBase = exports.ApiClientConfiguration = void 0;
|
|
11
|
+
exports.ApiException = exports.ProductProofInterpolationMode = exports.ProductProofFormat = exports.ProductPreviewFormat = exports.ProductPatchType = exports.PlaceholderItemContentType = exports.ItemType = exports.ItemSourceType = exports.ImagePreviewFormat = exports.ImagePreviewFitMode = exports.DesignElementType = exports.DesignAtomsViewerApiClient = exports.DesignAtomsServiceApiClient = exports.DesignAtomsPrintProductItemsApiClient = exports.DesignAtomsPrintProductApiClient = exports.DesignAtomsMockups3dApiClient = exports.DesignAtomsImagesApiClient = exports.DesignAtomsCompatibilityApiClient = exports.BuildInfoApiClient = exports.ApiClientBase = exports.ApiClientConfiguration = void 0;
|
|
12
12
|
const axios_1 = require("axios");
|
|
13
13
|
class ApiClientConfiguration {
|
|
14
14
|
apiUrl;
|
|
@@ -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,2801 @@ 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').
|
|
2312
|
+
* @param tenantId (optional) Tenant identifier
|
|
2313
|
+
* @param body (optional) Render model with preview parameters.
|
|
2314
|
+
* @return Success
|
|
2315
|
+
*/
|
|
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?";
|
|
2388
|
+
if (tenantId === null)
|
|
2389
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
2390
|
+
else if (tenantId !== undefined)
|
|
2391
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2392
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
2393
|
+
const content_ = JSON.stringify(body);
|
|
2394
|
+
let options_ = {
|
|
2395
|
+
data: content_,
|
|
2396
|
+
method: "POST",
|
|
2397
|
+
url: url_,
|
|
2398
|
+
headers: {
|
|
2399
|
+
"Content-Type": "application/json",
|
|
2400
|
+
"Accept": "application/json"
|
|
2401
|
+
},
|
|
2402
|
+
cancelToken
|
|
2403
|
+
};
|
|
2404
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
2405
|
+
return this.instance.request(transformedOptions_);
|
|
2406
|
+
}).catch((_error) => {
|
|
2407
|
+
if (isAxiosError(_error) && _error.response) {
|
|
2408
|
+
return _error.response;
|
|
2409
|
+
}
|
|
2410
|
+
else {
|
|
2411
|
+
throw _error;
|
|
2412
|
+
}
|
|
2413
|
+
}).then((_response) => {
|
|
2414
|
+
return this.transformResult(url_, _response, (_response) => this.processRenderImagePreviewFromUrlToResource(_response));
|
|
2415
|
+
});
|
|
2416
|
+
}
|
|
2417
|
+
processRenderImagePreviewFromUrlToResource(response) {
|
|
2418
|
+
const status = response.status;
|
|
2419
|
+
let _headers = {};
|
|
2420
|
+
if (response.headers && typeof response.headers === "object") {
|
|
2421
|
+
for (let k in response.headers) {
|
|
2422
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
2423
|
+
_headers[k] = response.headers[k];
|
|
2424
|
+
}
|
|
2425
|
+
}
|
|
2426
|
+
}
|
|
2427
|
+
if (status === 200) {
|
|
2428
|
+
const _responseText = response.data;
|
|
2429
|
+
let result200 = null;
|
|
2430
|
+
let resultData200 = _responseText;
|
|
2431
|
+
result200 = JSON.parse(resultData200);
|
|
2432
|
+
return Promise.resolve(result200);
|
|
2433
|
+
}
|
|
2434
|
+
else if (status === 409) {
|
|
2435
|
+
const _responseText = response.data;
|
|
2436
|
+
let result409 = null;
|
|
2437
|
+
let resultData409 = _responseText;
|
|
2438
|
+
result409 = JSON.parse(resultData409);
|
|
2439
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
2440
|
+
}
|
|
2441
|
+
else if (status === 401) {
|
|
2442
|
+
const _responseText = response.data;
|
|
2443
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
2444
|
+
}
|
|
2445
|
+
else if (status === 403) {
|
|
2446
|
+
const _responseText = response.data;
|
|
2447
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
2448
|
+
}
|
|
2449
|
+
else if (status !== 200 && status !== 204) {
|
|
2450
|
+
const _responseText = response.data;
|
|
2451
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
2452
|
+
}
|
|
2453
|
+
return Promise.resolve(null);
|
|
2454
|
+
}
|
|
2455
|
+
/**
|
|
2456
|
+
* Renders a preview of an image with the specified parameters and saves rendering result as resource.
|
|
2457
|
+
* @param tenantId (optional) Tenant identifier
|
|
2458
|
+
* @param body (optional) Render model with preview parameters.
|
|
2459
|
+
* @return Success
|
|
2460
|
+
*/
|
|
2461
|
+
renderImagePreviewToResource(tenantId, body, cancelToken) {
|
|
2462
|
+
let url_ = this.baseUrl + "/api/atoms/v1/images/render-preview/to-resource?";
|
|
2463
|
+
if (tenantId === null)
|
|
2464
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
2465
|
+
else if (tenantId !== undefined)
|
|
2466
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2467
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
2468
|
+
const content_ = JSON.stringify(body);
|
|
2469
|
+
let options_ = {
|
|
2470
|
+
data: content_,
|
|
2471
|
+
method: "POST",
|
|
2472
|
+
url: url_,
|
|
2473
|
+
headers: {
|
|
2474
|
+
"Content-Type": "application/json",
|
|
2475
|
+
"Accept": "application/json"
|
|
2476
|
+
},
|
|
2477
|
+
cancelToken
|
|
2478
|
+
};
|
|
2479
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
2480
|
+
return this.instance.request(transformedOptions_);
|
|
2481
|
+
}).catch((_error) => {
|
|
2482
|
+
if (isAxiosError(_error) && _error.response) {
|
|
2483
|
+
return _error.response;
|
|
2484
|
+
}
|
|
2485
|
+
else {
|
|
2486
|
+
throw _error;
|
|
2487
|
+
}
|
|
2488
|
+
}).then((_response) => {
|
|
2489
|
+
return this.transformResult(url_, _response, (_response) => this.processRenderImagePreviewToResource(_response));
|
|
2490
|
+
});
|
|
2491
|
+
}
|
|
2492
|
+
processRenderImagePreviewToResource(response) {
|
|
2493
|
+
const status = response.status;
|
|
2494
|
+
let _headers = {};
|
|
2495
|
+
if (response.headers && typeof response.headers === "object") {
|
|
2496
|
+
for (let k in response.headers) {
|
|
2497
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
2498
|
+
_headers[k] = response.headers[k];
|
|
2499
|
+
}
|
|
2500
|
+
}
|
|
2501
|
+
}
|
|
2502
|
+
if (status === 200) {
|
|
2503
|
+
const _responseText = response.data;
|
|
2504
|
+
let result200 = null;
|
|
2505
|
+
let resultData200 = _responseText;
|
|
2506
|
+
result200 = JSON.parse(resultData200);
|
|
2507
|
+
return Promise.resolve(result200);
|
|
2508
|
+
}
|
|
2509
|
+
else if (status === 409) {
|
|
2510
|
+
const _responseText = response.data;
|
|
2511
|
+
let result409 = null;
|
|
2512
|
+
let resultData409 = _responseText;
|
|
2513
|
+
result409 = JSON.parse(resultData409);
|
|
2514
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
2515
|
+
}
|
|
2516
|
+
else if (status === 401) {
|
|
2517
|
+
const _responseText = response.data;
|
|
2518
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
2519
|
+
}
|
|
2520
|
+
else if (status === 403) {
|
|
2521
|
+
const _responseText = response.data;
|
|
2522
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
2523
|
+
}
|
|
2524
|
+
else if (status !== 200 && status !== 204) {
|
|
2525
|
+
const _responseText = response.data;
|
|
2526
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
2527
|
+
}
|
|
2528
|
+
return Promise.resolve(null);
|
|
2529
|
+
}
|
|
2530
|
+
}
|
|
2531
|
+
exports.DesignAtomsImagesApiClient = DesignAtomsImagesApiClient;
|
|
2532
|
+
class DesignAtomsMockups3dApiClient extends ApiClientBase {
|
|
2533
|
+
instance;
|
|
2534
|
+
baseUrl;
|
|
2535
|
+
jsonParseReviver = undefined;
|
|
2536
|
+
constructor(configuration, baseUrl, instance) {
|
|
2537
|
+
super(configuration);
|
|
2538
|
+
this.instance = instance ? instance : axios_1.create();
|
|
2539
|
+
this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : this.getBaseUrl("");
|
|
2540
|
+
}
|
|
2541
|
+
/**
|
|
2542
|
+
* Returns a 3D-Mockup attributes.
|
|
2543
|
+
* @param id 3D-Mockup identifier.
|
|
2544
|
+
* @param ownerId (optional) Private mockup owner identifier.
|
|
2545
|
+
* @param tenantId (optional) Tenant identifier
|
|
2546
|
+
* @return Success
|
|
2547
|
+
*/
|
|
2548
|
+
getAttributes(id, ownerId, tenantId, cancelToken) {
|
|
2549
|
+
let url_ = this.baseUrl + "/api/atoms/v1/mockups-3d/{id}/attributes?";
|
|
2550
|
+
if (id === undefined || id === null)
|
|
2551
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
2552
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
2553
|
+
if (ownerId !== undefined && ownerId !== null)
|
|
2554
|
+
url_ += "ownerId=" + encodeURIComponent("" + ownerId) + "&";
|
|
2555
|
+
if (tenantId === null)
|
|
2556
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
2557
|
+
else if (tenantId !== undefined)
|
|
2558
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2559
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
2560
|
+
let options_ = {
|
|
2561
|
+
method: "GET",
|
|
2562
|
+
url: url_,
|
|
2563
|
+
headers: {
|
|
2564
|
+
"Accept": "application/json"
|
|
2565
|
+
},
|
|
2566
|
+
cancelToken
|
|
2567
|
+
};
|
|
2568
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
2569
|
+
return this.instance.request(transformedOptions_);
|
|
2570
|
+
}).catch((_error) => {
|
|
2571
|
+
if (isAxiosError(_error) && _error.response) {
|
|
2572
|
+
return _error.response;
|
|
2573
|
+
}
|
|
2574
|
+
else {
|
|
2575
|
+
throw _error;
|
|
2576
|
+
}
|
|
2577
|
+
}).then((_response) => {
|
|
2578
|
+
return this.transformResult(url_, _response, (_response) => this.processGetAttributes(_response));
|
|
2579
|
+
});
|
|
2580
|
+
}
|
|
2581
|
+
processGetAttributes(response) {
|
|
2582
|
+
const status = response.status;
|
|
2583
|
+
let _headers = {};
|
|
2584
|
+
if (response.headers && typeof response.headers === "object") {
|
|
2585
|
+
for (let k in response.headers) {
|
|
2586
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
2587
|
+
_headers[k] = response.headers[k];
|
|
2588
|
+
}
|
|
2589
|
+
}
|
|
2590
|
+
}
|
|
2591
|
+
if (status === 200) {
|
|
2592
|
+
const _responseText = response.data;
|
|
2593
|
+
let result200 = null;
|
|
2594
|
+
let resultData200 = _responseText;
|
|
2595
|
+
result200 = JSON.parse(resultData200);
|
|
2596
|
+
return Promise.resolve(result200);
|
|
2597
|
+
}
|
|
2598
|
+
else if (status === 404) {
|
|
2599
|
+
const _responseText = response.data;
|
|
2600
|
+
let result404 = null;
|
|
2601
|
+
let resultData404 = _responseText;
|
|
2602
|
+
result404 = JSON.parse(resultData404);
|
|
2603
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
2604
|
+
}
|
|
2605
|
+
else if (status === 409) {
|
|
2606
|
+
const _responseText = response.data;
|
|
2607
|
+
let result409 = null;
|
|
2608
|
+
let resultData409 = _responseText;
|
|
2609
|
+
result409 = JSON.parse(resultData409);
|
|
2610
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
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 === 409) {
|
|
2691
|
+
const _responseText = response.data;
|
|
2692
|
+
let result409 = null;
|
|
2693
|
+
let resultData409 = _responseText;
|
|
2694
|
+
result409 = JSON.parse(resultData409);
|
|
2695
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
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 === 409) {
|
|
2776
|
+
const _responseText = response.data;
|
|
2777
|
+
let result409 = null;
|
|
2778
|
+
let resultData409 = _responseText;
|
|
2779
|
+
result409 = JSON.parse(resultData409);
|
|
2780
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
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 DesignAtomsPrintProductApiClient 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
|
+
* Patches a print-product of the specified design file.
|
|
2809
|
+
* @param id Design identifier.
|
|
2810
|
+
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
2811
|
+
* @param tenantId (optional) Tenant identifier
|
|
2812
|
+
* @param patchType (optional)
|
|
2813
|
+
* @param replaceImageItemFileInfo_itemName (optional)
|
|
2814
|
+
* @param replaceImageItemFileInfo_sourceFile (optional)
|
|
2815
|
+
* @param replacePlaceholderItemContentInfo_placeholderItemName (optional)
|
|
2816
|
+
* @param replacePlaceholderItemContentInfo_newContentType (optional)
|
|
2817
|
+
* @param replacePlaceholderItemContentInfo_sourceFile (optional)
|
|
2818
|
+
* @return No Content
|
|
2819
|
+
*/
|
|
2820
|
+
patchDesignProduct(id, privateStorageOwner, tenantId, patchType, replaceImageItemFileInfo_itemName, replaceImageItemFileInfo_sourceFile, replacePlaceholderItemContentInfo_placeholderItemName, replacePlaceholderItemContentInfo_newContentType, replacePlaceholderItemContentInfo_sourceFile, cancelToken) {
|
|
2821
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/print-product?";
|
|
2822
|
+
if (id === undefined || id === null)
|
|
2823
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
2824
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
2825
|
+
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
2826
|
+
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
2827
|
+
if (tenantId === null)
|
|
2828
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
2829
|
+
else if (tenantId !== undefined)
|
|
2830
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2831
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
2832
|
+
const content_ = new FormData();
|
|
2833
|
+
if (patchType === null || patchType === undefined)
|
|
2834
|
+
throw new Error("The parameter 'patchType' cannot be null.");
|
|
2835
|
+
else
|
|
2836
|
+
content_.append("patchType", patchType.toString());
|
|
2837
|
+
if (replaceImageItemFileInfo_itemName !== null && replaceImageItemFileInfo_itemName !== undefined)
|
|
2838
|
+
content_.append("replaceImageItemFileInfo.itemName", replaceImageItemFileInfo_itemName.toString());
|
|
2839
|
+
if (replaceImageItemFileInfo_sourceFile !== null && replaceImageItemFileInfo_sourceFile !== undefined)
|
|
2840
|
+
content_.append("replaceImageItemFileInfo.sourceFile", replaceImageItemFileInfo_sourceFile.data, replaceImageItemFileInfo_sourceFile.fileName ? replaceImageItemFileInfo_sourceFile.fileName : "replaceImageItemFileInfo.sourceFile");
|
|
2841
|
+
if (replacePlaceholderItemContentInfo_placeholderItemName !== null && replacePlaceholderItemContentInfo_placeholderItemName !== undefined)
|
|
2842
|
+
content_.append("replacePlaceholderItemContentInfo.placeholderItemName", replacePlaceholderItemContentInfo_placeholderItemName.toString());
|
|
2843
|
+
if (replacePlaceholderItemContentInfo_newContentType === null || replacePlaceholderItemContentInfo_newContentType === undefined)
|
|
2844
|
+
throw new Error("The parameter 'replacePlaceholderItemContentInfo_newContentType' cannot be null.");
|
|
2845
|
+
else
|
|
2846
|
+
content_.append("replacePlaceholderItemContentInfo.newContentType", replacePlaceholderItemContentInfo_newContentType.toString());
|
|
2847
|
+
if (replacePlaceholderItemContentInfo_sourceFile !== null && replacePlaceholderItemContentInfo_sourceFile !== undefined)
|
|
2848
|
+
content_.append("replacePlaceholderItemContentInfo.sourceFile", replacePlaceholderItemContentInfo_sourceFile.data, replacePlaceholderItemContentInfo_sourceFile.fileName ? replacePlaceholderItemContentInfo_sourceFile.fileName : "replacePlaceholderItemContentInfo.sourceFile");
|
|
2849
|
+
let options_ = {
|
|
2850
|
+
data: content_,
|
|
2851
|
+
method: "PATCH",
|
|
2852
|
+
url: url_,
|
|
2853
|
+
headers: {},
|
|
2854
|
+
cancelToken
|
|
2855
|
+
};
|
|
2856
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
2857
|
+
return this.instance.request(transformedOptions_);
|
|
2858
|
+
}).catch((_error) => {
|
|
2859
|
+
if (isAxiosError(_error) && _error.response) {
|
|
2860
|
+
return _error.response;
|
|
2861
|
+
}
|
|
2862
|
+
else {
|
|
2863
|
+
throw _error;
|
|
2864
|
+
}
|
|
2865
|
+
}).then((_response) => {
|
|
2866
|
+
return this.transformResult(url_, _response, (_response) => this.processPatchDesignProduct(_response));
|
|
2867
|
+
});
|
|
2868
|
+
}
|
|
2869
|
+
processPatchDesignProduct(response) {
|
|
2870
|
+
const status = response.status;
|
|
2871
|
+
let _headers = {};
|
|
2872
|
+
if (response.headers && typeof response.headers === "object") {
|
|
2873
|
+
for (let k in response.headers) {
|
|
2874
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
2875
|
+
_headers[k] = response.headers[k];
|
|
2876
|
+
}
|
|
2877
|
+
}
|
|
2878
|
+
}
|
|
2879
|
+
if (status === 204) {
|
|
2880
|
+
const _responseText = response.data;
|
|
2881
|
+
return Promise.resolve(null);
|
|
2882
|
+
}
|
|
2883
|
+
else if (status === 404) {
|
|
2884
|
+
const _responseText = response.data;
|
|
2885
|
+
let result404 = null;
|
|
2886
|
+
let resultData404 = _responseText;
|
|
2887
|
+
result404 = JSON.parse(resultData404);
|
|
2888
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
2889
|
+
}
|
|
2890
|
+
else if (status === 401) {
|
|
2891
|
+
const _responseText = response.data;
|
|
2892
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
2893
|
+
}
|
|
2894
|
+
else if (status === 403) {
|
|
2895
|
+
const _responseText = response.data;
|
|
2896
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
2897
|
+
}
|
|
2898
|
+
else if (status !== 200 && status !== 204) {
|
|
2899
|
+
const _responseText = response.data;
|
|
2900
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
2901
|
+
}
|
|
2902
|
+
return Promise.resolve(null);
|
|
2903
|
+
}
|
|
2904
|
+
/**
|
|
2905
|
+
* Returns a print-product of the specified design file as a json-serialized model.
|
|
2906
|
+
* @param id Design identifier.
|
|
2907
|
+
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
2908
|
+
* @param tenantId (optional) Tenant identifier
|
|
2909
|
+
* @return Success
|
|
2910
|
+
*/
|
|
2911
|
+
getDesignProductModel(id, privateStorageOwner, tenantId, cancelToken) {
|
|
2912
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/print-product/model?";
|
|
2913
|
+
if (id === undefined || id === null)
|
|
2914
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
2915
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
2916
|
+
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
2917
|
+
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
2918
|
+
if (tenantId === null)
|
|
2919
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
2920
|
+
else if (tenantId !== undefined)
|
|
2921
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2922
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
2923
|
+
let options_ = {
|
|
2924
|
+
method: "GET",
|
|
2925
|
+
url: url_,
|
|
2926
|
+
headers: {
|
|
2927
|
+
"Accept": "application/json"
|
|
2928
|
+
},
|
|
2929
|
+
cancelToken
|
|
2930
|
+
};
|
|
2931
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
2932
|
+
return this.instance.request(transformedOptions_);
|
|
2933
|
+
}).catch((_error) => {
|
|
2934
|
+
if (isAxiosError(_error) && _error.response) {
|
|
2935
|
+
return _error.response;
|
|
2936
|
+
}
|
|
2937
|
+
else {
|
|
2938
|
+
throw _error;
|
|
2939
|
+
}
|
|
2940
|
+
}).then((_response) => {
|
|
2941
|
+
return this.transformResult(url_, _response, (_response) => this.processGetDesignProductModel(_response));
|
|
2942
|
+
});
|
|
2943
|
+
}
|
|
2944
|
+
processGetDesignProductModel(response) {
|
|
2945
|
+
const status = response.status;
|
|
2946
|
+
let _headers = {};
|
|
2947
|
+
if (response.headers && typeof response.headers === "object") {
|
|
2948
|
+
for (let k in response.headers) {
|
|
2949
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
2950
|
+
_headers[k] = response.headers[k];
|
|
2951
|
+
}
|
|
2952
|
+
}
|
|
2953
|
+
}
|
|
2954
|
+
if (status === 200) {
|
|
2955
|
+
const _responseText = response.data;
|
|
2956
|
+
let result200 = null;
|
|
2957
|
+
let resultData200 = _responseText;
|
|
2958
|
+
result200 = JSON.parse(resultData200);
|
|
2959
|
+
return Promise.resolve(result200);
|
|
2960
|
+
}
|
|
2961
|
+
else if (status === 404) {
|
|
2962
|
+
const _responseText = response.data;
|
|
2963
|
+
let result404 = null;
|
|
2964
|
+
let resultData404 = _responseText;
|
|
2965
|
+
result404 = JSON.parse(resultData404);
|
|
2966
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
2967
|
+
}
|
|
2968
|
+
else if (status === 401) {
|
|
2969
|
+
const _responseText = response.data;
|
|
2970
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
2971
|
+
}
|
|
2972
|
+
else if (status === 403) {
|
|
2973
|
+
const _responseText = response.data;
|
|
2974
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
2975
|
+
}
|
|
2976
|
+
else if (status !== 200 && status !== 204) {
|
|
2977
|
+
const _responseText = response.data;
|
|
2978
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
2979
|
+
}
|
|
2980
|
+
return Promise.resolve(null);
|
|
2981
|
+
}
|
|
2982
|
+
/**
|
|
2983
|
+
* Saves a print-product provided as a json-serialized model to the specified design file.
|
|
2984
|
+
* @param id Design identifier.
|
|
2985
|
+
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
2986
|
+
* @param tenantId (optional) Tenant identifier
|
|
2987
|
+
* @param body (optional) Serialized print-product description.
|
|
2988
|
+
* @return No Content
|
|
2989
|
+
*/
|
|
2990
|
+
updateDesignProductModel(id, privateStorageOwner, tenantId, body, cancelToken) {
|
|
2991
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/print-product/model?";
|
|
2992
|
+
if (id === undefined || id === null)
|
|
2993
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
2994
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
2995
|
+
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
2996
|
+
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
2997
|
+
if (tenantId === null)
|
|
2998
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
2999
|
+
else if (tenantId !== undefined)
|
|
3000
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
3001
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
3002
|
+
const content_ = JSON.stringify(body);
|
|
3003
|
+
let options_ = {
|
|
3004
|
+
data: content_,
|
|
3005
|
+
method: "PUT",
|
|
3006
|
+
url: url_,
|
|
3007
|
+
headers: {
|
|
3008
|
+
"Content-Type": "application/json",
|
|
3009
|
+
},
|
|
3010
|
+
cancelToken
|
|
3011
|
+
};
|
|
3012
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
3013
|
+
return this.instance.request(transformedOptions_);
|
|
3014
|
+
}).catch((_error) => {
|
|
3015
|
+
if (isAxiosError(_error) && _error.response) {
|
|
3016
|
+
return _error.response;
|
|
3017
|
+
}
|
|
3018
|
+
else {
|
|
3019
|
+
throw _error;
|
|
3020
|
+
}
|
|
3021
|
+
}).then((_response) => {
|
|
3022
|
+
return this.transformResult(url_, _response, (_response) => this.processUpdateDesignProductModel(_response));
|
|
3023
|
+
});
|
|
3024
|
+
}
|
|
3025
|
+
processUpdateDesignProductModel(response) {
|
|
3026
|
+
const status = response.status;
|
|
3027
|
+
let _headers = {};
|
|
3028
|
+
if (response.headers && typeof response.headers === "object") {
|
|
3029
|
+
for (let k in response.headers) {
|
|
3030
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
3031
|
+
_headers[k] = response.headers[k];
|
|
3032
|
+
}
|
|
3033
|
+
}
|
|
3034
|
+
}
|
|
3035
|
+
if (status === 204) {
|
|
3036
|
+
const _responseText = response.data;
|
|
3037
|
+
return Promise.resolve(null);
|
|
3038
|
+
}
|
|
3039
|
+
else if (status === 404) {
|
|
3040
|
+
const _responseText = response.data;
|
|
3041
|
+
let result404 = null;
|
|
3042
|
+
let resultData404 = _responseText;
|
|
3043
|
+
result404 = JSON.parse(resultData404);
|
|
3044
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
3045
|
+
}
|
|
3046
|
+
else if (status === 401) {
|
|
3047
|
+
const _responseText = response.data;
|
|
3048
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
3049
|
+
}
|
|
3050
|
+
else if (status === 403) {
|
|
3051
|
+
const _responseText = response.data;
|
|
3052
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
3053
|
+
}
|
|
3054
|
+
else if (status !== 200 && status !== 204) {
|
|
3055
|
+
const _responseText = response.data;
|
|
3056
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
3057
|
+
}
|
|
3058
|
+
return Promise.resolve(null);
|
|
3059
|
+
}
|
|
3060
|
+
/**
|
|
3061
|
+
* Returns a list of print-area descriptions of the specified design file.
|
|
3062
|
+
* @param id Design identifier.
|
|
3063
|
+
* @param surfaceId (optional)
|
|
3064
|
+
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
3065
|
+
* @param tenantId (optional) Tenant identifier
|
|
3066
|
+
* @return Success
|
|
3067
|
+
*/
|
|
3068
|
+
getDesignPrintAreas(id, surfaceId, privateStorageOwner, tenantId, cancelToken) {
|
|
3069
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/print-product/print-areas?";
|
|
3070
|
+
if (id === undefined || id === null)
|
|
3071
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
3072
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
3073
|
+
if (surfaceId !== undefined && surfaceId !== null)
|
|
3074
|
+
url_ += "surfaceId=" + encodeURIComponent("" + surfaceId) + "&";
|
|
3075
|
+
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
3076
|
+
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
3077
|
+
if (tenantId === null)
|
|
3078
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
3079
|
+
else if (tenantId !== undefined)
|
|
3080
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
3081
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
3082
|
+
let options_ = {
|
|
3083
|
+
method: "GET",
|
|
3084
|
+
url: url_,
|
|
3085
|
+
headers: {
|
|
3086
|
+
"Accept": "application/json"
|
|
3087
|
+
},
|
|
3088
|
+
cancelToken
|
|
3089
|
+
};
|
|
3090
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
3091
|
+
return this.instance.request(transformedOptions_);
|
|
3092
|
+
}).catch((_error) => {
|
|
3093
|
+
if (isAxiosError(_error) && _error.response) {
|
|
3094
|
+
return _error.response;
|
|
3095
|
+
}
|
|
3096
|
+
else {
|
|
3097
|
+
throw _error;
|
|
3098
|
+
}
|
|
3099
|
+
}).then((_response) => {
|
|
3100
|
+
return this.transformResult(url_, _response, (_response) => this.processGetDesignPrintAreas(_response));
|
|
3101
|
+
});
|
|
3102
|
+
}
|
|
3103
|
+
processGetDesignPrintAreas(response) {
|
|
3104
|
+
const status = response.status;
|
|
3105
|
+
let _headers = {};
|
|
3106
|
+
if (response.headers && typeof response.headers === "object") {
|
|
3107
|
+
for (let k in response.headers) {
|
|
3108
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
3109
|
+
_headers[k] = response.headers[k];
|
|
3110
|
+
}
|
|
3111
|
+
}
|
|
3112
|
+
}
|
|
3113
|
+
if (status === 200) {
|
|
3114
|
+
const _responseText = response.data;
|
|
3115
|
+
let result200 = null;
|
|
3116
|
+
let resultData200 = _responseText;
|
|
3117
|
+
result200 = JSON.parse(resultData200);
|
|
3118
|
+
return Promise.resolve(result200);
|
|
3119
|
+
}
|
|
3120
|
+
else if (status === 404) {
|
|
3121
|
+
const _responseText = response.data;
|
|
3122
|
+
let result404 = null;
|
|
3123
|
+
let resultData404 = _responseText;
|
|
3124
|
+
result404 = JSON.parse(resultData404);
|
|
3125
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
3126
|
+
}
|
|
3127
|
+
else if (status === 401) {
|
|
3128
|
+
const _responseText = response.data;
|
|
3129
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
3130
|
+
}
|
|
3131
|
+
else if (status === 403) {
|
|
3132
|
+
const _responseText = response.data;
|
|
3133
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
3134
|
+
}
|
|
3135
|
+
else if (status !== 200 && status !== 204) {
|
|
3136
|
+
const _responseText = response.data;
|
|
3137
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
3138
|
+
}
|
|
3139
|
+
return Promise.resolve(null);
|
|
3140
|
+
}
|
|
3141
|
+
/**
|
|
3142
|
+
* Deletes a specified print-area in an existing design file.
|
|
3143
|
+
* @param id Design identifier.
|
|
3144
|
+
* @param printAreaId Design print-area identifier.
|
|
3145
|
+
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
3146
|
+
* @param tenantId (optional) Tenant identifier
|
|
3147
|
+
* @return No Content
|
|
3148
|
+
*/
|
|
3149
|
+
deleteDesignPrintArea(id, printAreaId, privateStorageOwner, tenantId, cancelToken) {
|
|
3150
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/print-product/print-areas/{printAreaId}?";
|
|
3151
|
+
if (id === undefined || id === null)
|
|
3152
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
3153
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
3154
|
+
if (printAreaId === undefined || printAreaId === null)
|
|
3155
|
+
throw new Error("The parameter 'printAreaId' must be defined.");
|
|
3156
|
+
url_ = url_.replace("{printAreaId}", encodeURIComponent("" + printAreaId));
|
|
3157
|
+
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
3158
|
+
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
3159
|
+
if (tenantId === null)
|
|
3160
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
3161
|
+
else if (tenantId !== undefined)
|
|
3162
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
3163
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
3164
|
+
let options_ = {
|
|
3165
|
+
method: "DELETE",
|
|
3166
|
+
url: url_,
|
|
3167
|
+
headers: {},
|
|
3168
|
+
cancelToken
|
|
3169
|
+
};
|
|
3170
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
3171
|
+
return this.instance.request(transformedOptions_);
|
|
3172
|
+
}).catch((_error) => {
|
|
3173
|
+
if (isAxiosError(_error) && _error.response) {
|
|
3174
|
+
return _error.response;
|
|
3175
|
+
}
|
|
3176
|
+
else {
|
|
3177
|
+
throw _error;
|
|
3178
|
+
}
|
|
3179
|
+
}).then((_response) => {
|
|
3180
|
+
return this.transformResult(url_, _response, (_response) => this.processDeleteDesignPrintArea(_response));
|
|
3181
|
+
});
|
|
3182
|
+
}
|
|
3183
|
+
processDeleteDesignPrintArea(response) {
|
|
3184
|
+
const status = response.status;
|
|
3185
|
+
let _headers = {};
|
|
3186
|
+
if (response.headers && typeof response.headers === "object") {
|
|
3187
|
+
for (let k in response.headers) {
|
|
3188
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
3189
|
+
_headers[k] = response.headers[k];
|
|
3190
|
+
}
|
|
3191
|
+
}
|
|
3192
|
+
}
|
|
3193
|
+
if (status === 204) {
|
|
3194
|
+
const _responseText = response.data;
|
|
3195
|
+
return Promise.resolve(null);
|
|
3196
|
+
}
|
|
3197
|
+
else if (status === 404) {
|
|
3198
|
+
const _responseText = response.data;
|
|
3199
|
+
let result404 = null;
|
|
3200
|
+
let resultData404 = _responseText;
|
|
3201
|
+
result404 = JSON.parse(resultData404);
|
|
3202
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
3203
|
+
}
|
|
3204
|
+
else if (status === 409) {
|
|
3205
|
+
const _responseText = response.data;
|
|
3206
|
+
let result409 = null;
|
|
3207
|
+
let resultData409 = _responseText;
|
|
3208
|
+
result409 = JSON.parse(resultData409);
|
|
3209
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
3210
|
+
}
|
|
3211
|
+
else if (status === 401) {
|
|
3212
|
+
const _responseText = response.data;
|
|
3213
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
3214
|
+
}
|
|
3215
|
+
else if (status === 403) {
|
|
3216
|
+
const _responseText = response.data;
|
|
3217
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
3218
|
+
}
|
|
3219
|
+
else if (status !== 200 && status !== 204) {
|
|
3220
|
+
const _responseText = response.data;
|
|
3221
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
3222
|
+
}
|
|
3223
|
+
return Promise.resolve(null);
|
|
3224
|
+
}
|
|
3225
|
+
/**
|
|
3226
|
+
* Returns a print-area of the specified design file as a json-serialized model.
|
|
3227
|
+
* @param id Design identifier.
|
|
3228
|
+
* @param printAreaId Design print-area identifier.
|
|
3229
|
+
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
3230
|
+
* @param tenantId (optional) Tenant identifier
|
|
3231
|
+
* @return Success
|
|
3232
|
+
*/
|
|
3233
|
+
getDesignPrintAreaModel(id, printAreaId, privateStorageOwner, tenantId, cancelToken) {
|
|
3234
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/print-product/print-areas/{printAreaId}/model?";
|
|
3235
|
+
if (id === undefined || id === null)
|
|
3236
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
3237
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
3238
|
+
if (printAreaId === undefined || printAreaId === null)
|
|
3239
|
+
throw new Error("The parameter 'printAreaId' must be defined.");
|
|
3240
|
+
url_ = url_.replace("{printAreaId}", encodeURIComponent("" + printAreaId));
|
|
3241
|
+
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
3242
|
+
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
3243
|
+
if (tenantId === null)
|
|
3244
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
3245
|
+
else if (tenantId !== undefined)
|
|
3246
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
3247
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
3248
|
+
let options_ = {
|
|
3249
|
+
method: "GET",
|
|
3250
|
+
url: url_,
|
|
3251
|
+
headers: {
|
|
3252
|
+
"Accept": "application/json"
|
|
3253
|
+
},
|
|
3254
|
+
cancelToken
|
|
3255
|
+
};
|
|
3256
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
3257
|
+
return this.instance.request(transformedOptions_);
|
|
3258
|
+
}).catch((_error) => {
|
|
3259
|
+
if (isAxiosError(_error) && _error.response) {
|
|
3260
|
+
return _error.response;
|
|
3261
|
+
}
|
|
3262
|
+
else {
|
|
3263
|
+
throw _error;
|
|
3264
|
+
}
|
|
3265
|
+
}).then((_response) => {
|
|
3266
|
+
return this.transformResult(url_, _response, (_response) => this.processGetDesignPrintAreaModel(_response));
|
|
3267
|
+
});
|
|
3268
|
+
}
|
|
3269
|
+
processGetDesignPrintAreaModel(response) {
|
|
3270
|
+
const status = response.status;
|
|
3271
|
+
let _headers = {};
|
|
3272
|
+
if (response.headers && typeof response.headers === "object") {
|
|
3273
|
+
for (let k in response.headers) {
|
|
3274
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
3275
|
+
_headers[k] = response.headers[k];
|
|
3276
|
+
}
|
|
3277
|
+
}
|
|
3278
|
+
}
|
|
3279
|
+
if (status === 200) {
|
|
3280
|
+
const _responseText = response.data;
|
|
3281
|
+
let result200 = null;
|
|
3282
|
+
let resultData200 = _responseText;
|
|
3283
|
+
result200 = JSON.parse(resultData200);
|
|
3284
|
+
return Promise.resolve(result200);
|
|
3285
|
+
}
|
|
3286
|
+
else if (status === 404) {
|
|
3287
|
+
const _responseText = response.data;
|
|
3288
|
+
let result404 = null;
|
|
3289
|
+
let resultData404 = _responseText;
|
|
3290
|
+
result404 = JSON.parse(resultData404);
|
|
3291
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
3292
|
+
}
|
|
3293
|
+
else if (status === 409) {
|
|
3294
|
+
const _responseText = response.data;
|
|
3295
|
+
let result409 = null;
|
|
3296
|
+
let resultData409 = _responseText;
|
|
3297
|
+
result409 = JSON.parse(resultData409);
|
|
3298
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
3299
|
+
}
|
|
3300
|
+
else if (status === 401) {
|
|
3301
|
+
const _responseText = response.data;
|
|
3302
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
3303
|
+
}
|
|
3304
|
+
else if (status === 403) {
|
|
3305
|
+
const _responseText = response.data;
|
|
3306
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
3307
|
+
}
|
|
3308
|
+
else if (status !== 200 && status !== 204) {
|
|
3309
|
+
const _responseText = response.data;
|
|
3310
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
3311
|
+
}
|
|
3312
|
+
return Promise.resolve(null);
|
|
3313
|
+
}
|
|
3314
|
+
/**
|
|
3315
|
+
* Updates a specified print-area in an existing design file with the data provided as a json-serialized print-area model.
|
|
3316
|
+
* @param id Design identifier.
|
|
3317
|
+
* @param printAreaId Design print-area identifier.
|
|
3318
|
+
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
3319
|
+
* @param tenantId (optional) Tenant identifier
|
|
3320
|
+
* @param body (optional) Updated print-area model.
|
|
3321
|
+
* @return Success
|
|
3322
|
+
*/
|
|
3323
|
+
updateDesignPrintAreaModel(id, printAreaId, privateStorageOwner, tenantId, body, cancelToken) {
|
|
3324
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/print-product/print-areas/{printAreaId}/model?";
|
|
3325
|
+
if (id === undefined || id === null)
|
|
3326
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
3327
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
3328
|
+
if (printAreaId === undefined || printAreaId === null)
|
|
3329
|
+
throw new Error("The parameter 'printAreaId' must be defined.");
|
|
3330
|
+
url_ = url_.replace("{printAreaId}", encodeURIComponent("" + printAreaId));
|
|
3331
|
+
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
3332
|
+
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
3333
|
+
if (tenantId === null)
|
|
3334
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
3335
|
+
else if (tenantId !== undefined)
|
|
3336
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
3337
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
3338
|
+
const content_ = JSON.stringify(body);
|
|
3339
|
+
let options_ = {
|
|
3340
|
+
data: content_,
|
|
3341
|
+
method: "PUT",
|
|
3342
|
+
url: url_,
|
|
3343
|
+
headers: {
|
|
3344
|
+
"Content-Type": "application/json",
|
|
3345
|
+
"Accept": "application/json"
|
|
3346
|
+
},
|
|
3347
|
+
cancelToken
|
|
3348
|
+
};
|
|
3349
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
3350
|
+
return this.instance.request(transformedOptions_);
|
|
3351
|
+
}).catch((_error) => {
|
|
3352
|
+
if (isAxiosError(_error) && _error.response) {
|
|
3353
|
+
return _error.response;
|
|
3354
|
+
}
|
|
3355
|
+
else {
|
|
3356
|
+
throw _error;
|
|
3357
|
+
}
|
|
3358
|
+
}).then((_response) => {
|
|
3359
|
+
return this.transformResult(url_, _response, (_response) => this.processUpdateDesignPrintAreaModel(_response));
|
|
3360
|
+
});
|
|
3361
|
+
}
|
|
3362
|
+
processUpdateDesignPrintAreaModel(response) {
|
|
3363
|
+
const status = response.status;
|
|
3364
|
+
let _headers = {};
|
|
3365
|
+
if (response.headers && typeof response.headers === "object") {
|
|
3366
|
+
for (let k in response.headers) {
|
|
3367
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
3368
|
+
_headers[k] = response.headers[k];
|
|
3369
|
+
}
|
|
3370
|
+
}
|
|
3371
|
+
}
|
|
3372
|
+
if (status === 200) {
|
|
3373
|
+
const _responseText = response.data;
|
|
3374
|
+
let result200 = null;
|
|
3375
|
+
let resultData200 = _responseText;
|
|
3376
|
+
result200 = JSON.parse(resultData200);
|
|
3377
|
+
return Promise.resolve(result200);
|
|
3378
|
+
}
|
|
3379
|
+
else if (status === 400) {
|
|
3380
|
+
const _responseText = response.data;
|
|
3381
|
+
let result400 = null;
|
|
3382
|
+
let resultData400 = _responseText;
|
|
3383
|
+
result400 = JSON.parse(resultData400);
|
|
3384
|
+
return throwException("Bad Request", status, _responseText, _headers, result400);
|
|
3385
|
+
}
|
|
3386
|
+
else if (status === 404) {
|
|
3387
|
+
const _responseText = response.data;
|
|
3388
|
+
let result404 = null;
|
|
3389
|
+
let resultData404 = _responseText;
|
|
3390
|
+
result404 = JSON.parse(resultData404);
|
|
3391
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
3392
|
+
}
|
|
3393
|
+
else if (status === 409) {
|
|
3394
|
+
const _responseText = response.data;
|
|
3395
|
+
let result409 = null;
|
|
3396
|
+
let resultData409 = _responseText;
|
|
3397
|
+
result409 = JSON.parse(resultData409);
|
|
3398
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
3399
|
+
}
|
|
3400
|
+
else if (status === 401) {
|
|
3401
|
+
const _responseText = response.data;
|
|
3402
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
3403
|
+
}
|
|
3404
|
+
else if (status === 403) {
|
|
3405
|
+
const _responseText = response.data;
|
|
3406
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
3407
|
+
}
|
|
3408
|
+
else if (status !== 200 && status !== 204) {
|
|
3409
|
+
const _responseText = response.data;
|
|
3410
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
3411
|
+
}
|
|
3412
|
+
return Promise.resolve(null);
|
|
3413
|
+
}
|
|
3414
|
+
/**
|
|
3415
|
+
* Inserts a new print-area provided as a json-serialized model at the specified position in an existing design file.
|
|
3416
|
+
Print-area identifier will be reset by auto-generated value to prevent identifiers collisions.
|
|
3417
|
+
* @param id Design identifier.
|
|
3418
|
+
* @param surfaceId (optional) Parent surface identifier.
|
|
3419
|
+
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
3420
|
+
* @param tenantId (optional) Tenant identifier
|
|
3421
|
+
* @param body (optional) New print-area model.
|
|
3422
|
+
* @return Success
|
|
3423
|
+
*/
|
|
3424
|
+
addDesignPrintAreaModel(id, surfaceId, privateStorageOwner, tenantId, body, cancelToken) {
|
|
3425
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/print-product/print-areas/model?";
|
|
3426
|
+
if (id === undefined || id === null)
|
|
3427
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
3428
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
3429
|
+
if (surfaceId !== undefined && surfaceId !== null)
|
|
3430
|
+
url_ += "surfaceId=" + encodeURIComponent("" + surfaceId) + "&";
|
|
3431
|
+
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
3432
|
+
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
3433
|
+
if (tenantId === null)
|
|
3434
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
3435
|
+
else if (tenantId !== undefined)
|
|
3436
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
3437
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
3438
|
+
const content_ = JSON.stringify(body);
|
|
3439
|
+
let options_ = {
|
|
3440
|
+
data: content_,
|
|
3441
|
+
method: "POST",
|
|
3442
|
+
url: url_,
|
|
3443
|
+
headers: {
|
|
3444
|
+
"Content-Type": "application/json",
|
|
3445
|
+
"Accept": "application/json"
|
|
3446
|
+
},
|
|
3447
|
+
cancelToken
|
|
3448
|
+
};
|
|
3449
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
3450
|
+
return this.instance.request(transformedOptions_);
|
|
3451
|
+
}).catch((_error) => {
|
|
3452
|
+
if (isAxiosError(_error) && _error.response) {
|
|
3453
|
+
return _error.response;
|
|
3454
|
+
}
|
|
3455
|
+
else {
|
|
3456
|
+
throw _error;
|
|
3457
|
+
}
|
|
3458
|
+
}).then((_response) => {
|
|
3459
|
+
return this.transformResult(url_, _response, (_response) => this.processAddDesignPrintAreaModel(_response));
|
|
3460
|
+
});
|
|
3461
|
+
}
|
|
3462
|
+
processAddDesignPrintAreaModel(response) {
|
|
3463
|
+
const status = response.status;
|
|
3464
|
+
let _headers = {};
|
|
3465
|
+
if (response.headers && typeof response.headers === "object") {
|
|
3466
|
+
for (let k in response.headers) {
|
|
3467
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
3468
|
+
_headers[k] = response.headers[k];
|
|
3469
|
+
}
|
|
3470
|
+
}
|
|
3471
|
+
}
|
|
3472
|
+
if (status === 200) {
|
|
3473
|
+
const _responseText = response.data;
|
|
3474
|
+
let result200 = null;
|
|
3475
|
+
let resultData200 = _responseText;
|
|
3476
|
+
result200 = JSON.parse(resultData200);
|
|
3477
|
+
return Promise.resolve(result200);
|
|
3478
|
+
}
|
|
3479
|
+
else if (status === 400) {
|
|
3480
|
+
const _responseText = response.data;
|
|
3481
|
+
let result400 = null;
|
|
3482
|
+
let resultData400 = _responseText;
|
|
3483
|
+
result400 = JSON.parse(resultData400);
|
|
3484
|
+
return throwException("Bad Request", status, _responseText, _headers, result400);
|
|
3485
|
+
}
|
|
3486
|
+
else if (status === 404) {
|
|
3487
|
+
const _responseText = response.data;
|
|
3488
|
+
let result404 = null;
|
|
3489
|
+
let resultData404 = _responseText;
|
|
3490
|
+
result404 = JSON.parse(resultData404);
|
|
3491
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
3492
|
+
}
|
|
3493
|
+
else if (status === 401) {
|
|
3494
|
+
const _responseText = response.data;
|
|
3495
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
3496
|
+
}
|
|
3497
|
+
else if (status === 403) {
|
|
3498
|
+
const _responseText = response.data;
|
|
3499
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
3500
|
+
}
|
|
3501
|
+
else if (status !== 200 && status !== 204) {
|
|
3502
|
+
const _responseText = response.data;
|
|
3503
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
3504
|
+
}
|
|
3505
|
+
return Promise.resolve(null);
|
|
3506
|
+
}
|
|
3507
|
+
/**
|
|
3508
|
+
* Returns a list of print-product surfaces descriptions of the specified design file.
|
|
3509
|
+
* @param id Design identifier.
|
|
3510
|
+
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
3511
|
+
* @param tenantId (optional) Tenant identifier
|
|
3512
|
+
* @return Success
|
|
3513
|
+
*/
|
|
3514
|
+
getDesignSurfaces(id, privateStorageOwner, tenantId, cancelToken) {
|
|
3515
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/print-product/surfaces?";
|
|
3516
|
+
if (id === undefined || id === null)
|
|
3517
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
3518
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
3519
|
+
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
3520
|
+
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
3521
|
+
if (tenantId === null)
|
|
3522
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
3523
|
+
else if (tenantId !== undefined)
|
|
3524
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
3525
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
3526
|
+
let options_ = {
|
|
3527
|
+
method: "GET",
|
|
3528
|
+
url: url_,
|
|
3529
|
+
headers: {
|
|
3530
|
+
"Accept": "application/json"
|
|
3531
|
+
},
|
|
3532
|
+
cancelToken
|
|
3533
|
+
};
|
|
3534
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
3535
|
+
return this.instance.request(transformedOptions_);
|
|
3536
|
+
}).catch((_error) => {
|
|
3537
|
+
if (isAxiosError(_error) && _error.response) {
|
|
3538
|
+
return _error.response;
|
|
3539
|
+
}
|
|
3540
|
+
else {
|
|
3541
|
+
throw _error;
|
|
3542
|
+
}
|
|
3543
|
+
}).then((_response) => {
|
|
3544
|
+
return this.transformResult(url_, _response, (_response) => this.processGetDesignSurfaces(_response));
|
|
3545
|
+
});
|
|
3546
|
+
}
|
|
3547
|
+
processGetDesignSurfaces(response) {
|
|
3548
|
+
const status = response.status;
|
|
3549
|
+
let _headers = {};
|
|
3550
|
+
if (response.headers && typeof response.headers === "object") {
|
|
3551
|
+
for (let k in response.headers) {
|
|
3552
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
3553
|
+
_headers[k] = response.headers[k];
|
|
3554
|
+
}
|
|
3555
|
+
}
|
|
3556
|
+
}
|
|
3557
|
+
if (status === 200) {
|
|
3558
|
+
const _responseText = response.data;
|
|
3559
|
+
let result200 = null;
|
|
3560
|
+
let resultData200 = _responseText;
|
|
3561
|
+
result200 = JSON.parse(resultData200);
|
|
3562
|
+
return Promise.resolve(result200);
|
|
3563
|
+
}
|
|
3564
|
+
else if (status === 404) {
|
|
3565
|
+
const _responseText = response.data;
|
|
3566
|
+
let result404 = null;
|
|
3567
|
+
let resultData404 = _responseText;
|
|
3568
|
+
result404 = JSON.parse(resultData404);
|
|
3569
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
3570
|
+
}
|
|
3571
|
+
else if (status === 401) {
|
|
3572
|
+
const _responseText = response.data;
|
|
3573
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
3574
|
+
}
|
|
3575
|
+
else if (status === 403) {
|
|
3576
|
+
const _responseText = response.data;
|
|
3577
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
3578
|
+
}
|
|
3579
|
+
else if (status !== 200 && status !== 204) {
|
|
3580
|
+
const _responseText = response.data;
|
|
3581
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
3582
|
+
}
|
|
3583
|
+
return Promise.resolve(null);
|
|
3584
|
+
}
|
|
3585
|
+
/**
|
|
3586
|
+
* Deletes a specified print-product surface in an existing design file.
|
|
3587
|
+
* @param id Design identifier.
|
|
3588
|
+
* @param surfaceId Surface identifier.
|
|
3589
|
+
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
3590
|
+
* @param tenantId (optional) Tenant identifier
|
|
3591
|
+
* @return No Content
|
|
3592
|
+
*/
|
|
3593
|
+
deleteDesignSurface(id, surfaceId, privateStorageOwner, tenantId, cancelToken) {
|
|
3594
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/print-product/surfaces/{surfaceId}?";
|
|
3595
|
+
if (id === undefined || id === null)
|
|
3596
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
3597
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
3598
|
+
if (surfaceId === undefined || surfaceId === null)
|
|
3599
|
+
throw new Error("The parameter 'surfaceId' must be defined.");
|
|
3600
|
+
url_ = url_.replace("{surfaceId}", encodeURIComponent("" + surfaceId));
|
|
3601
|
+
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
3602
|
+
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
3603
|
+
if (tenantId === null)
|
|
3604
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
3605
|
+
else if (tenantId !== undefined)
|
|
3606
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
3607
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
3608
|
+
let options_ = {
|
|
3609
|
+
method: "DELETE",
|
|
3610
|
+
url: url_,
|
|
3611
|
+
headers: {},
|
|
3612
|
+
cancelToken
|
|
3613
|
+
};
|
|
3614
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
3615
|
+
return this.instance.request(transformedOptions_);
|
|
3616
|
+
}).catch((_error) => {
|
|
3617
|
+
if (isAxiosError(_error) && _error.response) {
|
|
3618
|
+
return _error.response;
|
|
3619
|
+
}
|
|
3620
|
+
else {
|
|
3621
|
+
throw _error;
|
|
3622
|
+
}
|
|
3623
|
+
}).then((_response) => {
|
|
3624
|
+
return this.transformResult(url_, _response, (_response) => this.processDeleteDesignSurface(_response));
|
|
3625
|
+
});
|
|
3626
|
+
}
|
|
3627
|
+
processDeleteDesignSurface(response) {
|
|
3628
|
+
const status = response.status;
|
|
3629
|
+
let _headers = {};
|
|
3630
|
+
if (response.headers && typeof response.headers === "object") {
|
|
3631
|
+
for (let k in response.headers) {
|
|
3632
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
3633
|
+
_headers[k] = response.headers[k];
|
|
3634
|
+
}
|
|
3635
|
+
}
|
|
3636
|
+
}
|
|
3637
|
+
if (status === 204) {
|
|
3638
|
+
const _responseText = response.data;
|
|
3639
|
+
return Promise.resolve(null);
|
|
3640
|
+
}
|
|
3641
|
+
else if (status === 404) {
|
|
3642
|
+
const _responseText = response.data;
|
|
3643
|
+
let result404 = null;
|
|
3644
|
+
let resultData404 = _responseText;
|
|
3645
|
+
result404 = JSON.parse(resultData404);
|
|
3646
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
3647
|
+
}
|
|
3648
|
+
else if (status === 409) {
|
|
3649
|
+
const _responseText = response.data;
|
|
3650
|
+
let result409 = null;
|
|
3651
|
+
let resultData409 = _responseText;
|
|
3652
|
+
result409 = JSON.parse(resultData409);
|
|
3653
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
3654
|
+
}
|
|
3655
|
+
else if (status === 401) {
|
|
3656
|
+
const _responseText = response.data;
|
|
3657
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
3658
|
+
}
|
|
3659
|
+
else if (status === 403) {
|
|
3660
|
+
const _responseText = response.data;
|
|
3661
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
3662
|
+
}
|
|
3663
|
+
else if (status !== 200 && status !== 204) {
|
|
3664
|
+
const _responseText = response.data;
|
|
3665
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
3666
|
+
}
|
|
3667
|
+
return Promise.resolve(null);
|
|
3668
|
+
}
|
|
3669
|
+
/**
|
|
3670
|
+
* Returns a down-mockup description of the specified surface in an existing design file.
|
|
3671
|
+
* @param id Design identifier.
|
|
3672
|
+
* @param surfaceId Design surface identifier.
|
|
3673
|
+
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
3674
|
+
* @param tenantId (optional) Tenant identifier
|
|
3675
|
+
* @return Success
|
|
3676
|
+
*/
|
|
3677
|
+
getDesignSurfaceDownMockup(id, surfaceId, privateStorageOwner, tenantId, cancelToken) {
|
|
3678
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/print-product/surfaces/{surfaceId}/mockup-down?";
|
|
3679
|
+
if (id === undefined || id === null)
|
|
3680
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
3681
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
3682
|
+
if (surfaceId === undefined || surfaceId === null)
|
|
3683
|
+
throw new Error("The parameter 'surfaceId' must be defined.");
|
|
3684
|
+
url_ = url_.replace("{surfaceId}", encodeURIComponent("" + surfaceId));
|
|
3685
|
+
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
3686
|
+
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
3687
|
+
if (tenantId === null)
|
|
3688
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
3689
|
+
else if (tenantId !== undefined)
|
|
3690
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
3691
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
3692
|
+
let options_ = {
|
|
3693
|
+
method: "GET",
|
|
3694
|
+
url: url_,
|
|
3695
|
+
headers: {
|
|
3696
|
+
"Accept": "application/json"
|
|
3697
|
+
},
|
|
3698
|
+
cancelToken
|
|
3699
|
+
};
|
|
3700
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
3701
|
+
return this.instance.request(transformedOptions_);
|
|
3702
|
+
}).catch((_error) => {
|
|
3703
|
+
if (isAxiosError(_error) && _error.response) {
|
|
3704
|
+
return _error.response;
|
|
3705
|
+
}
|
|
3706
|
+
else {
|
|
3707
|
+
throw _error;
|
|
3708
|
+
}
|
|
3709
|
+
}).then((_response) => {
|
|
3710
|
+
return this.transformResult(url_, _response, (_response) => this.processGetDesignSurfaceDownMockup(_response));
|
|
3711
|
+
});
|
|
3712
|
+
}
|
|
3713
|
+
processGetDesignSurfaceDownMockup(response) {
|
|
3714
|
+
const status = response.status;
|
|
3715
|
+
let _headers = {};
|
|
3716
|
+
if (response.headers && typeof response.headers === "object") {
|
|
3717
|
+
for (let k in response.headers) {
|
|
3718
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
3719
|
+
_headers[k] = response.headers[k];
|
|
3720
|
+
}
|
|
3721
|
+
}
|
|
3722
|
+
}
|
|
3723
|
+
if (status === 200) {
|
|
3724
|
+
const _responseText = response.data;
|
|
3725
|
+
let result200 = null;
|
|
3726
|
+
let resultData200 = _responseText;
|
|
3727
|
+
result200 = JSON.parse(resultData200);
|
|
3728
|
+
return Promise.resolve(result200);
|
|
3729
|
+
}
|
|
3730
|
+
else if (status === 400) {
|
|
3731
|
+
const _responseText = response.data;
|
|
3732
|
+
let result400 = null;
|
|
3733
|
+
let resultData400 = _responseText;
|
|
3734
|
+
result400 = JSON.parse(resultData400);
|
|
3735
|
+
return throwException("Bad Request", status, _responseText, _headers, result400);
|
|
3736
|
+
}
|
|
3737
|
+
else if (status === 404) {
|
|
3738
|
+
const _responseText = response.data;
|
|
3739
|
+
let result404 = null;
|
|
3740
|
+
let resultData404 = _responseText;
|
|
3741
|
+
result404 = JSON.parse(resultData404);
|
|
3742
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
3743
|
+
}
|
|
3744
|
+
else if (status === 409) {
|
|
3745
|
+
const _responseText = response.data;
|
|
3746
|
+
let result409 = null;
|
|
3747
|
+
let resultData409 = _responseText;
|
|
3748
|
+
result409 = JSON.parse(resultData409);
|
|
3749
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
3750
|
+
}
|
|
3751
|
+
else if (status === 401) {
|
|
3752
|
+
const _responseText = response.data;
|
|
3753
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
3754
|
+
}
|
|
3755
|
+
else if (status === 403) {
|
|
3756
|
+
const _responseText = response.data;
|
|
3757
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
3758
|
+
}
|
|
3759
|
+
else if (status !== 200 && status !== 204) {
|
|
3760
|
+
const _responseText = response.data;
|
|
3761
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
3762
|
+
}
|
|
3763
|
+
return Promise.resolve(null);
|
|
3764
|
+
}
|
|
3765
|
+
/**
|
|
3766
|
+
* Updates a content file of down-mockup for the specified surface in an existing design file.
|
|
3767
|
+
* @param id Design identifier.
|
|
3768
|
+
* @param surfaceId Design surface identifier.
|
|
3769
|
+
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
3770
|
+
* @param tenantId (optional) Tenant identifier
|
|
3771
|
+
* @param position_top (optional)
|
|
3772
|
+
* @param position_left (optional)
|
|
3773
|
+
* @param sourceFile (optional)
|
|
3774
|
+
* @return Success
|
|
3775
|
+
*/
|
|
3776
|
+
updateDesignSurfaceDownMockup(id, surfaceId, privateStorageOwner, tenantId, position_top, position_left, sourceFile, cancelToken) {
|
|
3777
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/print-product/surfaces/{surfaceId}/mockup-down?";
|
|
3778
|
+
if (id === undefined || id === null)
|
|
3779
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
3780
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
3781
|
+
if (surfaceId === undefined || surfaceId === null)
|
|
3782
|
+
throw new Error("The parameter 'surfaceId' must be defined.");
|
|
3783
|
+
url_ = url_.replace("{surfaceId}", encodeURIComponent("" + surfaceId));
|
|
3784
|
+
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
3785
|
+
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
3786
|
+
if (tenantId === null)
|
|
3787
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
3788
|
+
else if (tenantId !== undefined)
|
|
3789
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
3790
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
3791
|
+
const content_ = new FormData();
|
|
3792
|
+
if (position_top === null || position_top === undefined)
|
|
3793
|
+
throw new Error("The parameter 'position_top' cannot be null.");
|
|
3794
|
+
else
|
|
3795
|
+
content_.append("position.top", position_top.toString());
|
|
3796
|
+
if (position_left === null || position_left === undefined)
|
|
3797
|
+
throw new Error("The parameter 'position_left' cannot be null.");
|
|
3798
|
+
else
|
|
3799
|
+
content_.append("position.left", position_left.toString());
|
|
3800
|
+
if (sourceFile !== null && sourceFile !== undefined)
|
|
3801
|
+
content_.append("sourceFile", sourceFile.data, sourceFile.fileName ? sourceFile.fileName : "sourceFile");
|
|
3802
|
+
let options_ = {
|
|
3803
|
+
data: content_,
|
|
3804
|
+
method: "PATCH",
|
|
3805
|
+
url: url_,
|
|
3806
|
+
headers: {
|
|
3807
|
+
"Accept": "application/json"
|
|
3808
|
+
},
|
|
3809
|
+
cancelToken
|
|
3810
|
+
};
|
|
3811
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
3812
|
+
return this.instance.request(transformedOptions_);
|
|
3813
|
+
}).catch((_error) => {
|
|
3814
|
+
if (isAxiosError(_error) && _error.response) {
|
|
3815
|
+
return _error.response;
|
|
3816
|
+
}
|
|
3817
|
+
else {
|
|
3818
|
+
throw _error;
|
|
3819
|
+
}
|
|
3820
|
+
}).then((_response) => {
|
|
3821
|
+
return this.transformResult(url_, _response, (_response) => this.processUpdateDesignSurfaceDownMockup(_response));
|
|
3822
|
+
});
|
|
3823
|
+
}
|
|
3824
|
+
processUpdateDesignSurfaceDownMockup(response) {
|
|
3825
|
+
const status = response.status;
|
|
3826
|
+
let _headers = {};
|
|
3827
|
+
if (response.headers && typeof response.headers === "object") {
|
|
3828
|
+
for (let k in response.headers) {
|
|
3829
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
3830
|
+
_headers[k] = response.headers[k];
|
|
3831
|
+
}
|
|
3832
|
+
}
|
|
3833
|
+
}
|
|
3834
|
+
if (status === 200) {
|
|
3835
|
+
const _responseText = response.data;
|
|
3836
|
+
let result200 = null;
|
|
3837
|
+
let resultData200 = _responseText;
|
|
3838
|
+
result200 = JSON.parse(resultData200);
|
|
3839
|
+
return Promise.resolve(result200);
|
|
3840
|
+
}
|
|
3841
|
+
else if (status === 400) {
|
|
3842
|
+
const _responseText = response.data;
|
|
3843
|
+
let result400 = null;
|
|
3844
|
+
let resultData400 = _responseText;
|
|
3845
|
+
result400 = JSON.parse(resultData400);
|
|
3846
|
+
return throwException("Bad Request", status, _responseText, _headers, result400);
|
|
3847
|
+
}
|
|
3848
|
+
else if (status === 404) {
|
|
3849
|
+
const _responseText = response.data;
|
|
3850
|
+
let result404 = null;
|
|
3851
|
+
let resultData404 = _responseText;
|
|
3852
|
+
result404 = JSON.parse(resultData404);
|
|
3853
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
3854
|
+
}
|
|
3855
|
+
else if (status === 409) {
|
|
3856
|
+
const _responseText = response.data;
|
|
3857
|
+
let result409 = null;
|
|
3858
|
+
let resultData409 = _responseText;
|
|
3859
|
+
result409 = JSON.parse(resultData409);
|
|
3860
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
3861
|
+
}
|
|
3862
|
+
else if (status === 401) {
|
|
3863
|
+
const _responseText = response.data;
|
|
3864
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
3865
|
+
}
|
|
3866
|
+
else if (status === 403) {
|
|
3867
|
+
const _responseText = response.data;
|
|
3868
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
3869
|
+
}
|
|
3870
|
+
else if (status !== 200 && status !== 204) {
|
|
3871
|
+
const _responseText = response.data;
|
|
3872
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
3873
|
+
}
|
|
3874
|
+
return Promise.resolve(null);
|
|
3875
|
+
}
|
|
3876
|
+
/**
|
|
3877
|
+
* Returns a content file for down-mockup of the specified surface in an existing design file.
|
|
3878
|
+
* @param id Design identifier.
|
|
3879
|
+
* @param surfaceId Design surface identifier.
|
|
3880
|
+
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
3881
|
+
* @param tenantId (optional) Tenant identifier
|
|
3882
|
+
* @return Success
|
|
3883
|
+
*/
|
|
3884
|
+
getDesignSurfaceDownMockupContent(id, surfaceId, privateStorageOwner, tenantId, cancelToken) {
|
|
3885
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/print-product/surfaces/{surfaceId}/mockup-down/file?";
|
|
3886
|
+
if (id === undefined || id === null)
|
|
3887
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
3888
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
3889
|
+
if (surfaceId === undefined || surfaceId === null)
|
|
3890
|
+
throw new Error("The parameter 'surfaceId' must be defined.");
|
|
3891
|
+
url_ = url_.replace("{surfaceId}", encodeURIComponent("" + surfaceId));
|
|
3892
|
+
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
3893
|
+
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
3894
|
+
if (tenantId === null)
|
|
3895
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
3896
|
+
else if (tenantId !== undefined)
|
|
3897
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
3898
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
3899
|
+
let options_ = {
|
|
3900
|
+
responseType: "blob",
|
|
3901
|
+
method: "GET",
|
|
3902
|
+
url: url_,
|
|
3903
|
+
headers: {
|
|
3904
|
+
"Accept": "application/json"
|
|
3905
|
+
},
|
|
3906
|
+
cancelToken
|
|
3907
|
+
};
|
|
3908
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
3909
|
+
return this.instance.request(transformedOptions_);
|
|
3910
|
+
}).catch((_error) => {
|
|
3911
|
+
if (isAxiosError(_error) && _error.response) {
|
|
3912
|
+
return _error.response;
|
|
3913
|
+
}
|
|
3914
|
+
else {
|
|
3915
|
+
throw _error;
|
|
3916
|
+
}
|
|
3917
|
+
}).then((_response) => {
|
|
3918
|
+
return this.transformResult(url_, _response, (_response) => this.processGetDesignSurfaceDownMockupContent(_response));
|
|
3919
|
+
});
|
|
3920
|
+
}
|
|
3921
|
+
processGetDesignSurfaceDownMockupContent(response) {
|
|
3922
|
+
const status = response.status;
|
|
3923
|
+
let _headers = {};
|
|
3924
|
+
if (response.headers && typeof response.headers === "object") {
|
|
3925
|
+
for (let k in response.headers) {
|
|
3926
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
3927
|
+
_headers[k] = response.headers[k];
|
|
3928
|
+
}
|
|
3929
|
+
}
|
|
3930
|
+
}
|
|
3931
|
+
if (status === 200 || status === 206) {
|
|
3932
|
+
const contentDisposition = response.headers ? response.headers["content-disposition"] : undefined;
|
|
3933
|
+
const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
|
|
3934
|
+
const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
|
|
3935
|
+
return Promise.resolve({ fileName: fileName, status: status, data: new Blob([response.data]), headers: _headers });
|
|
3936
|
+
}
|
|
3937
|
+
else if (status === 400) {
|
|
3938
|
+
const _responseText = response.data;
|
|
3939
|
+
let result400 = null;
|
|
3940
|
+
let resultData400 = _responseText;
|
|
3941
|
+
result400 = JSON.parse(resultData400);
|
|
3942
|
+
return throwException("Bad Request", status, _responseText, _headers, result400);
|
|
3943
|
+
}
|
|
3944
|
+
else if (status === 404) {
|
|
3945
|
+
const _responseText = response.data;
|
|
3946
|
+
let result404 = null;
|
|
3947
|
+
let resultData404 = _responseText;
|
|
3948
|
+
result404 = JSON.parse(resultData404);
|
|
3949
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
3950
|
+
}
|
|
3951
|
+
else if (status === 409) {
|
|
3952
|
+
const _responseText = response.data;
|
|
3953
|
+
let result409 = null;
|
|
3954
|
+
let resultData409 = _responseText;
|
|
3955
|
+
result409 = JSON.parse(resultData409);
|
|
3956
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
3957
|
+
}
|
|
3958
|
+
else if (status === 401) {
|
|
3959
|
+
const _responseText = response.data;
|
|
3960
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
3961
|
+
}
|
|
3962
|
+
else if (status === 403) {
|
|
3963
|
+
const _responseText = response.data;
|
|
3964
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
3965
|
+
}
|
|
3966
|
+
else if (status !== 200 && status !== 204) {
|
|
3967
|
+
const _responseText = response.data;
|
|
3968
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
3969
|
+
}
|
|
3970
|
+
return Promise.resolve(null);
|
|
3971
|
+
}
|
|
3972
|
+
/**
|
|
3973
|
+
* Returns an up-mockup description of the specified surface in an existing design file.
|
|
3974
|
+
* @param id Design identifier.
|
|
3975
|
+
* @param surfaceId Design surface identifier.
|
|
3976
|
+
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
3977
|
+
* @param tenantId (optional) Tenant identifier
|
|
3978
|
+
* @return Success
|
|
3979
|
+
*/
|
|
3980
|
+
getDesignSurfaceUpMockup(id, surfaceId, privateStorageOwner, tenantId, cancelToken) {
|
|
3981
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/print-product/surfaces/{surfaceId}/mockup-up?";
|
|
3982
|
+
if (id === undefined || id === null)
|
|
3983
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
3984
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
3985
|
+
if (surfaceId === undefined || surfaceId === null)
|
|
3986
|
+
throw new Error("The parameter 'surfaceId' must be defined.");
|
|
3987
|
+
url_ = url_.replace("{surfaceId}", encodeURIComponent("" + surfaceId));
|
|
3988
|
+
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
3989
|
+
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
3990
|
+
if (tenantId === null)
|
|
3991
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
3992
|
+
else if (tenantId !== undefined)
|
|
3993
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
3994
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
3995
|
+
let options_ = {
|
|
3996
|
+
method: "GET",
|
|
3997
|
+
url: url_,
|
|
3998
|
+
headers: {
|
|
3999
|
+
"Accept": "application/json"
|
|
4000
|
+
},
|
|
4001
|
+
cancelToken
|
|
4002
|
+
};
|
|
4003
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
4004
|
+
return this.instance.request(transformedOptions_);
|
|
4005
|
+
}).catch((_error) => {
|
|
4006
|
+
if (isAxiosError(_error) && _error.response) {
|
|
4007
|
+
return _error.response;
|
|
4008
|
+
}
|
|
4009
|
+
else {
|
|
4010
|
+
throw _error;
|
|
4011
|
+
}
|
|
4012
|
+
}).then((_response) => {
|
|
4013
|
+
return this.transformResult(url_, _response, (_response) => this.processGetDesignSurfaceUpMockup(_response));
|
|
4014
|
+
});
|
|
4015
|
+
}
|
|
4016
|
+
processGetDesignSurfaceUpMockup(response) {
|
|
4017
|
+
const status = response.status;
|
|
4018
|
+
let _headers = {};
|
|
4019
|
+
if (response.headers && typeof response.headers === "object") {
|
|
4020
|
+
for (let k in response.headers) {
|
|
4021
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
4022
|
+
_headers[k] = response.headers[k];
|
|
4023
|
+
}
|
|
4024
|
+
}
|
|
4025
|
+
}
|
|
4026
|
+
if (status === 200) {
|
|
4027
|
+
const _responseText = response.data;
|
|
4028
|
+
let result200 = null;
|
|
4029
|
+
let resultData200 = _responseText;
|
|
4030
|
+
result200 = JSON.parse(resultData200);
|
|
4031
|
+
return Promise.resolve(result200);
|
|
4032
|
+
}
|
|
4033
|
+
else if (status === 400) {
|
|
4034
|
+
const _responseText = response.data;
|
|
4035
|
+
let result400 = null;
|
|
4036
|
+
let resultData400 = _responseText;
|
|
4037
|
+
result400 = JSON.parse(resultData400);
|
|
4038
|
+
return throwException("Bad Request", status, _responseText, _headers, result400);
|
|
4039
|
+
}
|
|
4040
|
+
else if (status === 404) {
|
|
4041
|
+
const _responseText = response.data;
|
|
4042
|
+
let result404 = null;
|
|
4043
|
+
let resultData404 = _responseText;
|
|
4044
|
+
result404 = JSON.parse(resultData404);
|
|
4045
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
4046
|
+
}
|
|
4047
|
+
else if (status === 409) {
|
|
4048
|
+
const _responseText = response.data;
|
|
4049
|
+
let result409 = null;
|
|
4050
|
+
let resultData409 = _responseText;
|
|
4051
|
+
result409 = JSON.parse(resultData409);
|
|
4052
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
4053
|
+
}
|
|
4054
|
+
else if (status === 401) {
|
|
4055
|
+
const _responseText = response.data;
|
|
4056
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
4057
|
+
}
|
|
4058
|
+
else if (status === 403) {
|
|
4059
|
+
const _responseText = response.data;
|
|
4060
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
4061
|
+
}
|
|
4062
|
+
else if (status !== 200 && status !== 204) {
|
|
4063
|
+
const _responseText = response.data;
|
|
4064
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
4065
|
+
}
|
|
4066
|
+
return Promise.resolve(null);
|
|
4067
|
+
}
|
|
4068
|
+
/**
|
|
4069
|
+
* Updates a content file of up-mockup for the specified surface in an existing design.
|
|
4070
|
+
* @param id Design identifier.
|
|
4071
|
+
* @param surfaceId Design surface identifier.
|
|
4072
|
+
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
4073
|
+
* @param tenantId (optional) Tenant identifier
|
|
4074
|
+
* @param position_top (optional)
|
|
4075
|
+
* @param position_left (optional)
|
|
4076
|
+
* @param sourceFile (optional)
|
|
4077
|
+
* @return Success
|
|
4078
|
+
*/
|
|
4079
|
+
updateDesignSurfaceUpMockup(id, surfaceId, privateStorageOwner, tenantId, position_top, position_left, sourceFile, cancelToken) {
|
|
4080
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/print-product/surfaces/{surfaceId}/mockup-up?";
|
|
4081
|
+
if (id === undefined || id === null)
|
|
4082
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
4083
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
4084
|
+
if (surfaceId === undefined || surfaceId === null)
|
|
4085
|
+
throw new Error("The parameter 'surfaceId' must be defined.");
|
|
4086
|
+
url_ = url_.replace("{surfaceId}", encodeURIComponent("" + surfaceId));
|
|
4087
|
+
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
4088
|
+
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
4089
|
+
if (tenantId === null)
|
|
4090
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
4091
|
+
else if (tenantId !== undefined)
|
|
4092
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
4093
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
4094
|
+
const content_ = new FormData();
|
|
4095
|
+
if (position_top === null || position_top === undefined)
|
|
4096
|
+
throw new Error("The parameter 'position_top' cannot be null.");
|
|
4097
|
+
else
|
|
4098
|
+
content_.append("position.top", position_top.toString());
|
|
4099
|
+
if (position_left === null || position_left === undefined)
|
|
4100
|
+
throw new Error("The parameter 'position_left' cannot be null.");
|
|
4101
|
+
else
|
|
4102
|
+
content_.append("position.left", position_left.toString());
|
|
4103
|
+
if (sourceFile !== null && sourceFile !== undefined)
|
|
4104
|
+
content_.append("sourceFile", sourceFile.data, sourceFile.fileName ? sourceFile.fileName : "sourceFile");
|
|
4105
|
+
let options_ = {
|
|
4106
|
+
data: content_,
|
|
4107
|
+
method: "PATCH",
|
|
4108
|
+
url: url_,
|
|
4109
|
+
headers: {
|
|
4110
|
+
"Accept": "application/json"
|
|
4111
|
+
},
|
|
4112
|
+
cancelToken
|
|
4113
|
+
};
|
|
4114
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
4115
|
+
return this.instance.request(transformedOptions_);
|
|
4116
|
+
}).catch((_error) => {
|
|
4117
|
+
if (isAxiosError(_error) && _error.response) {
|
|
4118
|
+
return _error.response;
|
|
4119
|
+
}
|
|
4120
|
+
else {
|
|
4121
|
+
throw _error;
|
|
4122
|
+
}
|
|
4123
|
+
}).then((_response) => {
|
|
4124
|
+
return this.transformResult(url_, _response, (_response) => this.processUpdateDesignSurfaceUpMockup(_response));
|
|
4125
|
+
});
|
|
4126
|
+
}
|
|
4127
|
+
processUpdateDesignSurfaceUpMockup(response) {
|
|
4128
|
+
const status = response.status;
|
|
4129
|
+
let _headers = {};
|
|
4130
|
+
if (response.headers && typeof response.headers === "object") {
|
|
4131
|
+
for (let k in response.headers) {
|
|
4132
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
4133
|
+
_headers[k] = response.headers[k];
|
|
4134
|
+
}
|
|
4135
|
+
}
|
|
4136
|
+
}
|
|
4137
|
+
if (status === 200) {
|
|
4138
|
+
const _responseText = response.data;
|
|
4139
|
+
let result200 = null;
|
|
4140
|
+
let resultData200 = _responseText;
|
|
4141
|
+
result200 = JSON.parse(resultData200);
|
|
4142
|
+
return Promise.resolve(result200);
|
|
4143
|
+
}
|
|
4144
|
+
else if (status === 400) {
|
|
4145
|
+
const _responseText = response.data;
|
|
4146
|
+
let result400 = null;
|
|
4147
|
+
let resultData400 = _responseText;
|
|
4148
|
+
result400 = JSON.parse(resultData400);
|
|
4149
|
+
return throwException("Bad Request", status, _responseText, _headers, result400);
|
|
4150
|
+
}
|
|
4151
|
+
else if (status === 404) {
|
|
4152
|
+
const _responseText = response.data;
|
|
4153
|
+
let result404 = null;
|
|
4154
|
+
let resultData404 = _responseText;
|
|
4155
|
+
result404 = JSON.parse(resultData404);
|
|
4156
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
4157
|
+
}
|
|
4158
|
+
else if (status === 409) {
|
|
4159
|
+
const _responseText = response.data;
|
|
4160
|
+
let result409 = null;
|
|
4161
|
+
let resultData409 = _responseText;
|
|
4162
|
+
result409 = JSON.parse(resultData409);
|
|
4163
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
4164
|
+
}
|
|
4165
|
+
else if (status === 401) {
|
|
4166
|
+
const _responseText = response.data;
|
|
4167
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
4168
|
+
}
|
|
4169
|
+
else if (status === 403) {
|
|
4170
|
+
const _responseText = response.data;
|
|
4171
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
4172
|
+
}
|
|
4173
|
+
else if (status !== 200 && status !== 204) {
|
|
4174
|
+
const _responseText = response.data;
|
|
4175
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
4176
|
+
}
|
|
4177
|
+
return Promise.resolve(null);
|
|
4178
|
+
}
|
|
4179
|
+
/**
|
|
4180
|
+
* Returns a content file for up-mockup of the specified surface in an existing design file.
|
|
4181
|
+
* @param id Design identifier.
|
|
4182
|
+
* @param surfaceId Design surface identifier.
|
|
4183
|
+
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
4184
|
+
* @param tenantId (optional) Tenant identifier
|
|
4185
|
+
* @return Success
|
|
4186
|
+
*/
|
|
4187
|
+
getDesignSurfaceUpMockupContent(id, surfaceId, privateStorageOwner, tenantId, cancelToken) {
|
|
4188
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/print-product/surfaces/{surfaceId}/mockup-up/file?";
|
|
4189
|
+
if (id === undefined || id === null)
|
|
4190
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
4191
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
4192
|
+
if (surfaceId === undefined || surfaceId === null)
|
|
4193
|
+
throw new Error("The parameter 'surfaceId' must be defined.");
|
|
4194
|
+
url_ = url_.replace("{surfaceId}", encodeURIComponent("" + surfaceId));
|
|
4195
|
+
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
4196
|
+
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
4197
|
+
if (tenantId === null)
|
|
4198
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
4199
|
+
else if (tenantId !== undefined)
|
|
4200
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
4201
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
4202
|
+
let options_ = {
|
|
4203
|
+
responseType: "blob",
|
|
4204
|
+
method: "GET",
|
|
4205
|
+
url: url_,
|
|
4206
|
+
headers: {
|
|
4207
|
+
"Accept": "application/json"
|
|
4208
|
+
},
|
|
4209
|
+
cancelToken
|
|
4210
|
+
};
|
|
4211
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
4212
|
+
return this.instance.request(transformedOptions_);
|
|
4213
|
+
}).catch((_error) => {
|
|
4214
|
+
if (isAxiosError(_error) && _error.response) {
|
|
4215
|
+
return _error.response;
|
|
4216
|
+
}
|
|
4217
|
+
else {
|
|
4218
|
+
throw _error;
|
|
4219
|
+
}
|
|
4220
|
+
}).then((_response) => {
|
|
4221
|
+
return this.transformResult(url_, _response, (_response) => this.processGetDesignSurfaceUpMockupContent(_response));
|
|
4222
|
+
});
|
|
4223
|
+
}
|
|
4224
|
+
processGetDesignSurfaceUpMockupContent(response) {
|
|
4225
|
+
const status = response.status;
|
|
4226
|
+
let _headers = {};
|
|
4227
|
+
if (response.headers && typeof response.headers === "object") {
|
|
4228
|
+
for (let k in response.headers) {
|
|
4229
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
4230
|
+
_headers[k] = response.headers[k];
|
|
4231
|
+
}
|
|
4232
|
+
}
|
|
4233
|
+
}
|
|
4234
|
+
if (status === 200 || status === 206) {
|
|
4235
|
+
const contentDisposition = response.headers ? response.headers["content-disposition"] : undefined;
|
|
4236
|
+
const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
|
|
4237
|
+
const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
|
|
4238
|
+
return Promise.resolve({ fileName: fileName, status: status, data: new Blob([response.data]), headers: _headers });
|
|
4239
|
+
}
|
|
4240
|
+
else if (status === 204) {
|
|
4241
|
+
const _responseText = response.data;
|
|
4242
|
+
return throwException("No Content", status, _responseText, _headers);
|
|
4243
|
+
}
|
|
4244
|
+
else if (status === 400) {
|
|
4245
|
+
const _responseText = response.data;
|
|
4246
|
+
let result400 = null;
|
|
4247
|
+
let resultData400 = _responseText;
|
|
4248
|
+
result400 = JSON.parse(resultData400);
|
|
4249
|
+
return throwException("Bad Request", status, _responseText, _headers, result400);
|
|
4250
|
+
}
|
|
4251
|
+
else if (status === 404) {
|
|
4252
|
+
const _responseText = response.data;
|
|
4253
|
+
let result404 = null;
|
|
4254
|
+
let resultData404 = _responseText;
|
|
4255
|
+
result404 = JSON.parse(resultData404);
|
|
4256
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
4257
|
+
}
|
|
4258
|
+
else if (status === 409) {
|
|
4259
|
+
const _responseText = response.data;
|
|
4260
|
+
let result409 = null;
|
|
4261
|
+
let resultData409 = _responseText;
|
|
4262
|
+
result409 = JSON.parse(resultData409);
|
|
4263
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
4264
|
+
}
|
|
4265
|
+
else if (status === 401) {
|
|
4266
|
+
const _responseText = response.data;
|
|
4267
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
4268
|
+
}
|
|
4269
|
+
else if (status === 403) {
|
|
4270
|
+
const _responseText = response.data;
|
|
4271
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
4272
|
+
}
|
|
4273
|
+
else if (status !== 200 && status !== 204) {
|
|
4274
|
+
const _responseText = response.data;
|
|
4275
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
4276
|
+
}
|
|
4277
|
+
return Promise.resolve(null);
|
|
4278
|
+
}
|
|
4279
|
+
/**
|
|
4280
|
+
* Returns a print-product surface of the specified design file as a json-serialized model.
|
|
4281
|
+
* @param id Design identifier.
|
|
4282
|
+
* @param surfaceId Surface identifier.
|
|
4283
|
+
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
4284
|
+
* @param tenantId (optional) Tenant identifier
|
|
4285
|
+
* @return Success
|
|
4286
|
+
*/
|
|
4287
|
+
getDesignSurfaceModel(id, surfaceId, privateStorageOwner, tenantId, cancelToken) {
|
|
4288
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/print-product/surfaces/{surfaceId}/model?";
|
|
4289
|
+
if (id === undefined || id === null)
|
|
4290
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
4291
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
4292
|
+
if (surfaceId === undefined || surfaceId === null)
|
|
4293
|
+
throw new Error("The parameter 'surfaceId' must be defined.");
|
|
4294
|
+
url_ = url_.replace("{surfaceId}", encodeURIComponent("" + surfaceId));
|
|
4295
|
+
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
4296
|
+
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
4297
|
+
if (tenantId === null)
|
|
4298
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
4299
|
+
else if (tenantId !== undefined)
|
|
4300
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
4301
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
4302
|
+
let options_ = {
|
|
4303
|
+
method: "GET",
|
|
4304
|
+
url: url_,
|
|
4305
|
+
headers: {
|
|
4306
|
+
"Accept": "application/json"
|
|
4307
|
+
},
|
|
4308
|
+
cancelToken
|
|
4309
|
+
};
|
|
4310
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
4311
|
+
return this.instance.request(transformedOptions_);
|
|
4312
|
+
}).catch((_error) => {
|
|
4313
|
+
if (isAxiosError(_error) && _error.response) {
|
|
4314
|
+
return _error.response;
|
|
4315
|
+
}
|
|
4316
|
+
else {
|
|
4317
|
+
throw _error;
|
|
4318
|
+
}
|
|
4319
|
+
}).then((_response) => {
|
|
4320
|
+
return this.transformResult(url_, _response, (_response) => this.processGetDesignSurfaceModel(_response));
|
|
4321
|
+
});
|
|
4322
|
+
}
|
|
4323
|
+
processGetDesignSurfaceModel(response) {
|
|
4324
|
+
const status = response.status;
|
|
4325
|
+
let _headers = {};
|
|
4326
|
+
if (response.headers && typeof response.headers === "object") {
|
|
4327
|
+
for (let k in response.headers) {
|
|
4328
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
4329
|
+
_headers[k] = response.headers[k];
|
|
4330
|
+
}
|
|
4331
|
+
}
|
|
4332
|
+
}
|
|
4333
|
+
if (status === 200) {
|
|
4334
|
+
const _responseText = response.data;
|
|
4335
|
+
let result200 = null;
|
|
4336
|
+
let resultData200 = _responseText;
|
|
4337
|
+
result200 = JSON.parse(resultData200);
|
|
4338
|
+
return Promise.resolve(result200);
|
|
4339
|
+
}
|
|
4340
|
+
else if (status === 404) {
|
|
4341
|
+
const _responseText = response.data;
|
|
4342
|
+
let result404 = null;
|
|
4343
|
+
let resultData404 = _responseText;
|
|
4344
|
+
result404 = JSON.parse(resultData404);
|
|
4345
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
4346
|
+
}
|
|
4347
|
+
else if (status === 409) {
|
|
4348
|
+
const _responseText = response.data;
|
|
4349
|
+
let result409 = null;
|
|
4350
|
+
let resultData409 = _responseText;
|
|
4351
|
+
result409 = JSON.parse(resultData409);
|
|
4352
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
4353
|
+
}
|
|
4354
|
+
else if (status === 401) {
|
|
4355
|
+
const _responseText = response.data;
|
|
4356
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
4357
|
+
}
|
|
4358
|
+
else if (status === 403) {
|
|
4359
|
+
const _responseText = response.data;
|
|
4360
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
4361
|
+
}
|
|
4362
|
+
else if (status !== 200 && status !== 204) {
|
|
4363
|
+
const _responseText = response.data;
|
|
4364
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
4365
|
+
}
|
|
4366
|
+
return Promise.resolve(null);
|
|
4367
|
+
}
|
|
4368
|
+
/**
|
|
4369
|
+
* Replaces a specified print-product surface in an existing design file with the data provided as a json-serialized surface model.
|
|
4370
|
+
All identifiers of a replaced surface (including surface identifier) will be reset by auto-generated values to prevent identifiers collisions.
|
|
4371
|
+
* @param id Design identifier.
|
|
4372
|
+
* @param surfaceId Design surface identifier.
|
|
4373
|
+
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
4374
|
+
* @param tenantId (optional) Tenant identifier
|
|
4375
|
+
* @param body (optional) Updated surface model.
|
|
4376
|
+
* @return Success
|
|
4377
|
+
*/
|
|
4378
|
+
replaceDesignSurfaceModel(id, surfaceId, privateStorageOwner, tenantId, body, cancelToken) {
|
|
4379
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/print-product/surfaces/{surfaceId}/model?";
|
|
4380
|
+
if (id === undefined || id === null)
|
|
4381
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
4382
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
4383
|
+
if (surfaceId === undefined || surfaceId === null)
|
|
4384
|
+
throw new Error("The parameter 'surfaceId' must be defined.");
|
|
4385
|
+
url_ = url_.replace("{surfaceId}", encodeURIComponent("" + surfaceId));
|
|
4386
|
+
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
4387
|
+
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
4388
|
+
if (tenantId === null)
|
|
4389
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
4390
|
+
else if (tenantId !== undefined)
|
|
4391
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
4392
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
4393
|
+
const content_ = JSON.stringify(body);
|
|
4394
|
+
let options_ = {
|
|
4395
|
+
data: content_,
|
|
4396
|
+
method: "PUT",
|
|
4397
|
+
url: url_,
|
|
4398
|
+
headers: {
|
|
4399
|
+
"Content-Type": "application/json",
|
|
4400
|
+
"Accept": "application/json"
|
|
4401
|
+
},
|
|
4402
|
+
cancelToken
|
|
4403
|
+
};
|
|
4404
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
4405
|
+
return this.instance.request(transformedOptions_);
|
|
4406
|
+
}).catch((_error) => {
|
|
4407
|
+
if (isAxiosError(_error) && _error.response) {
|
|
4408
|
+
return _error.response;
|
|
4409
|
+
}
|
|
4410
|
+
else {
|
|
4411
|
+
throw _error;
|
|
4412
|
+
}
|
|
4413
|
+
}).then((_response) => {
|
|
4414
|
+
return this.transformResult(url_, _response, (_response) => this.processReplaceDesignSurfaceModel(_response));
|
|
4415
|
+
});
|
|
4416
|
+
}
|
|
4417
|
+
processReplaceDesignSurfaceModel(response) {
|
|
4418
|
+
const status = response.status;
|
|
4419
|
+
let _headers = {};
|
|
4420
|
+
if (response.headers && typeof response.headers === "object") {
|
|
4421
|
+
for (let k in response.headers) {
|
|
4422
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
4423
|
+
_headers[k] = response.headers[k];
|
|
4424
|
+
}
|
|
4425
|
+
}
|
|
4426
|
+
}
|
|
4427
|
+
if (status === 200) {
|
|
4428
|
+
const _responseText = response.data;
|
|
4429
|
+
let result200 = null;
|
|
4430
|
+
let resultData200 = _responseText;
|
|
4431
|
+
result200 = JSON.parse(resultData200);
|
|
4432
|
+
return Promise.resolve(result200);
|
|
4433
|
+
}
|
|
4434
|
+
else if (status === 400) {
|
|
4435
|
+
const _responseText = response.data;
|
|
4436
|
+
let result400 = null;
|
|
4437
|
+
let resultData400 = _responseText;
|
|
4438
|
+
result400 = JSON.parse(resultData400);
|
|
4439
|
+
return throwException("Bad Request", status, _responseText, _headers, result400);
|
|
4440
|
+
}
|
|
4441
|
+
else if (status === 404) {
|
|
4442
|
+
const _responseText = response.data;
|
|
4443
|
+
let result404 = null;
|
|
4444
|
+
let resultData404 = _responseText;
|
|
4445
|
+
result404 = JSON.parse(resultData404);
|
|
4446
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
4447
|
+
}
|
|
4448
|
+
else if (status === 409) {
|
|
4449
|
+
const _responseText = response.data;
|
|
4450
|
+
let result409 = null;
|
|
4451
|
+
let resultData409 = _responseText;
|
|
4452
|
+
result409 = JSON.parse(resultData409);
|
|
4453
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
4454
|
+
}
|
|
4455
|
+
else if (status === 401) {
|
|
4456
|
+
const _responseText = response.data;
|
|
4457
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
4458
|
+
}
|
|
4459
|
+
else if (status === 403) {
|
|
4460
|
+
const _responseText = response.data;
|
|
4461
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
4462
|
+
}
|
|
4463
|
+
else if (status !== 200 && status !== 204) {
|
|
4464
|
+
const _responseText = response.data;
|
|
4465
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
4466
|
+
}
|
|
4467
|
+
return Promise.resolve(null);
|
|
4468
|
+
}
|
|
4469
|
+
/**
|
|
4470
|
+
* Inserts a new surface provided as a json-serialized model at the specified position in an existing design file.
|
|
4471
|
+
All identifiers of a replaced surface (including surface identifier) will be reset by auto-generated values to prevent identifiers collisions.
|
|
4472
|
+
* @param id Design identifier.
|
|
4473
|
+
* @param surfaceIndex (optional) New surface index.
|
|
4474
|
+
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
4475
|
+
* @param tenantId (optional) Tenant identifier
|
|
4476
|
+
* @param body (optional) New surface model.
|
|
4477
|
+
* @return Success
|
|
4478
|
+
*/
|
|
4479
|
+
addDesignSurfaceModel(id, surfaceIndex, privateStorageOwner, tenantId, body, cancelToken) {
|
|
4480
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/print-product/surfaces/model?";
|
|
4481
|
+
if (id === undefined || id === null)
|
|
4482
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
4483
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
4484
|
+
if (surfaceIndex === null)
|
|
4485
|
+
throw new Error("The parameter 'surfaceIndex' cannot be null.");
|
|
4486
|
+
else if (surfaceIndex !== undefined)
|
|
4487
|
+
url_ += "surfaceIndex=" + encodeURIComponent("" + surfaceIndex) + "&";
|
|
4488
|
+
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
4489
|
+
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
4490
|
+
if (tenantId === null)
|
|
4491
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
4492
|
+
else if (tenantId !== undefined)
|
|
4493
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
4494
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
4495
|
+
const content_ = JSON.stringify(body);
|
|
4496
|
+
let options_ = {
|
|
4497
|
+
data: content_,
|
|
4498
|
+
method: "POST",
|
|
4499
|
+
url: url_,
|
|
4500
|
+
headers: {
|
|
4501
|
+
"Content-Type": "application/json",
|
|
4502
|
+
"Accept": "application/json"
|
|
4503
|
+
},
|
|
4504
|
+
cancelToken
|
|
4505
|
+
};
|
|
4506
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
4507
|
+
return this.instance.request(transformedOptions_);
|
|
4508
|
+
}).catch((_error) => {
|
|
4509
|
+
if (isAxiosError(_error) && _error.response) {
|
|
4510
|
+
return _error.response;
|
|
4511
|
+
}
|
|
4512
|
+
else {
|
|
4513
|
+
throw _error;
|
|
4514
|
+
}
|
|
4515
|
+
}).then((_response) => {
|
|
4516
|
+
return this.transformResult(url_, _response, (_response) => this.processAddDesignSurfaceModel(_response));
|
|
4517
|
+
});
|
|
4518
|
+
}
|
|
4519
|
+
processAddDesignSurfaceModel(response) {
|
|
4520
|
+
const status = response.status;
|
|
4521
|
+
let _headers = {};
|
|
4522
|
+
if (response.headers && typeof response.headers === "object") {
|
|
4523
|
+
for (let k in response.headers) {
|
|
4524
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
4525
|
+
_headers[k] = response.headers[k];
|
|
4526
|
+
}
|
|
4527
|
+
}
|
|
4528
|
+
}
|
|
4529
|
+
if (status === 200) {
|
|
4530
|
+
const _responseText = response.data;
|
|
4531
|
+
let result200 = null;
|
|
4532
|
+
let resultData200 = _responseText;
|
|
4533
|
+
result200 = JSON.parse(resultData200);
|
|
4534
|
+
return Promise.resolve(result200);
|
|
4535
|
+
}
|
|
4536
|
+
else if (status === 400) {
|
|
4537
|
+
const _responseText = response.data;
|
|
4538
|
+
let result400 = null;
|
|
4539
|
+
let resultData400 = _responseText;
|
|
4540
|
+
result400 = JSON.parse(resultData400);
|
|
4541
|
+
return throwException("Bad Request", status, _responseText, _headers, result400);
|
|
4542
|
+
}
|
|
4543
|
+
else if (status === 404) {
|
|
4544
|
+
const _responseText = response.data;
|
|
4545
|
+
let result404 = null;
|
|
4546
|
+
let resultData404 = _responseText;
|
|
4547
|
+
result404 = JSON.parse(resultData404);
|
|
4548
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
4549
|
+
}
|
|
4550
|
+
else if (status === 401) {
|
|
4551
|
+
const _responseText = response.data;
|
|
4552
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
4553
|
+
}
|
|
4554
|
+
else if (status === 403) {
|
|
4555
|
+
const _responseText = response.data;
|
|
4556
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
4557
|
+
}
|
|
4558
|
+
else if (status !== 200 && status !== 204) {
|
|
4559
|
+
const _responseText = response.data;
|
|
4560
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
4561
|
+
}
|
|
4562
|
+
return Promise.resolve(null);
|
|
4563
|
+
}
|
|
4564
|
+
}
|
|
4565
|
+
exports.DesignAtomsPrintProductApiClient = DesignAtomsPrintProductApiClient;
|
|
4566
|
+
class DesignAtomsPrintProductItemsApiClient extends ApiClientBase {
|
|
4567
|
+
instance;
|
|
4568
|
+
baseUrl;
|
|
4569
|
+
jsonParseReviver = undefined;
|
|
4570
|
+
constructor(configuration, baseUrl, instance) {
|
|
4571
|
+
super(configuration);
|
|
4572
|
+
this.instance = instance ? instance : axios_1.create();
|
|
4573
|
+
this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : this.getBaseUrl("");
|
|
4574
|
+
}
|
|
4575
|
+
/**
|
|
4576
|
+
* Extracts print-product item image.
|
|
4577
|
+
* @param tenantId (optional) Tenant identifier
|
|
4578
|
+
* @param body (optional) Extraction parameters.
|
|
4579
|
+
* @return Success
|
|
4580
|
+
*/
|
|
4581
|
+
extractItemImage(tenantId, body, cancelToken) {
|
|
4582
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/print-product/items/extract-image?";
|
|
4583
|
+
if (tenantId === null)
|
|
4584
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
4585
|
+
else if (tenantId !== undefined)
|
|
4586
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
4587
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
4588
|
+
const content_ = JSON.stringify(body);
|
|
4589
|
+
let options_ = {
|
|
4590
|
+
data: content_,
|
|
4591
|
+
responseType: "blob",
|
|
4592
|
+
method: "POST",
|
|
4593
|
+
url: url_,
|
|
4594
|
+
headers: {
|
|
4595
|
+
"Content-Type": "application/json",
|
|
4596
|
+
"Accept": "application/octet-stream"
|
|
4597
|
+
},
|
|
4598
|
+
cancelToken
|
|
4599
|
+
};
|
|
4600
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
4601
|
+
return this.instance.request(transformedOptions_);
|
|
4602
|
+
}).catch((_error) => {
|
|
4603
|
+
if (isAxiosError(_error) && _error.response) {
|
|
4604
|
+
return _error.response;
|
|
4605
|
+
}
|
|
4606
|
+
else {
|
|
4607
|
+
throw _error;
|
|
4608
|
+
}
|
|
4609
|
+
}).then((_response) => {
|
|
4610
|
+
return this.transformResult(url_, _response, (_response) => this.processExtractItemImage(_response));
|
|
4611
|
+
});
|
|
4612
|
+
}
|
|
4613
|
+
processExtractItemImage(response) {
|
|
4614
|
+
const status = response.status;
|
|
4615
|
+
let _headers = {};
|
|
4616
|
+
if (response.headers && typeof response.headers === "object") {
|
|
4617
|
+
for (let k in response.headers) {
|
|
4618
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
4619
|
+
_headers[k] = response.headers[k];
|
|
4620
|
+
}
|
|
4621
|
+
}
|
|
4622
|
+
}
|
|
4623
|
+
if (status === 200 || status === 206) {
|
|
4624
|
+
const contentDisposition = response.headers ? response.headers["content-disposition"] : undefined;
|
|
4625
|
+
const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
|
|
4626
|
+
const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
|
|
4627
|
+
return Promise.resolve({ fileName: fileName, status: status, data: new Blob([response.data]), headers: _headers });
|
|
4628
|
+
}
|
|
4629
|
+
else if (status === 401) {
|
|
4630
|
+
const _responseText = response.data;
|
|
4631
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
4632
|
+
}
|
|
4633
|
+
else if (status === 403) {
|
|
4634
|
+
const _responseText = response.data;
|
|
4635
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
4636
|
+
}
|
|
4637
|
+
else if (status !== 200 && status !== 204) {
|
|
4638
|
+
const _responseText = response.data;
|
|
4639
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
4640
|
+
}
|
|
4641
|
+
return Promise.resolve(null);
|
|
4642
|
+
}
|
|
4643
|
+
/**
|
|
4644
|
+
* Flattens print-product items.
|
|
4645
|
+
* @param tenantId (optional) Tenant identifier
|
|
4646
|
+
* @param body (optional) List of print-product items to flatten.
|
|
4647
|
+
* @return Success
|
|
4648
|
+
*/
|
|
4649
|
+
flattenItems(tenantId, body, cancelToken) {
|
|
4650
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/print-product/items/flatten?";
|
|
4651
|
+
if (tenantId === null)
|
|
4652
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
4653
|
+
else if (tenantId !== undefined)
|
|
4654
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
4655
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
4656
|
+
const content_ = JSON.stringify(body);
|
|
4657
|
+
let options_ = {
|
|
4658
|
+
data: content_,
|
|
4659
|
+
method: "POST",
|
|
4660
|
+
url: url_,
|
|
4661
|
+
headers: {
|
|
4662
|
+
"Content-Type": "application/json",
|
|
4663
|
+
"Accept": "application/json"
|
|
4664
|
+
},
|
|
4665
|
+
cancelToken
|
|
4666
|
+
};
|
|
4667
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
4668
|
+
return this.instance.request(transformedOptions_);
|
|
4669
|
+
}).catch((_error) => {
|
|
4670
|
+
if (isAxiosError(_error) && _error.response) {
|
|
4671
|
+
return _error.response;
|
|
4672
|
+
}
|
|
4673
|
+
else {
|
|
4674
|
+
throw _error;
|
|
4675
|
+
}
|
|
4676
|
+
}).then((_response) => {
|
|
4677
|
+
return this.transformResult(url_, _response, (_response) => this.processFlattenItems(_response));
|
|
4678
|
+
});
|
|
4679
|
+
}
|
|
4680
|
+
processFlattenItems(response) {
|
|
4681
|
+
const status = response.status;
|
|
4682
|
+
let _headers = {};
|
|
4683
|
+
if (response.headers && typeof response.headers === "object") {
|
|
4684
|
+
for (let k in response.headers) {
|
|
4685
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
4686
|
+
_headers[k] = response.headers[k];
|
|
4687
|
+
}
|
|
4688
|
+
}
|
|
4689
|
+
}
|
|
4690
|
+
if (status === 200) {
|
|
4691
|
+
const _responseText = response.data;
|
|
4692
|
+
let result200 = null;
|
|
4693
|
+
let resultData200 = _responseText;
|
|
4694
|
+
result200 = JSON.parse(resultData200);
|
|
4695
|
+
return Promise.resolve(result200);
|
|
4696
|
+
}
|
|
4697
|
+
else if (status === 401) {
|
|
4698
|
+
const _responseText = response.data;
|
|
4699
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
4700
|
+
}
|
|
4701
|
+
else if (status === 403) {
|
|
4702
|
+
const _responseText = response.data;
|
|
4703
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
4704
|
+
}
|
|
4705
|
+
else if (status !== 200 && status !== 204) {
|
|
4706
|
+
const _responseText = response.data;
|
|
4707
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
4708
|
+
}
|
|
4709
|
+
return Promise.resolve(null);
|
|
4710
|
+
}
|
|
4711
|
+
/**
|
|
4712
|
+
* Creates print-product item from input image file.
|
|
4713
|
+
* @param itemType (optional) Desired item type.
|
|
2100
4714
|
* @param tenantId (optional) Tenant identifier
|
|
2101
|
-
* @param
|
|
4715
|
+
* @param sourceFile (optional)
|
|
2102
4716
|
* @return Success
|
|
2103
4717
|
*/
|
|
2104
|
-
|
|
2105
|
-
let url_ = this.baseUrl + "/api/atoms/v1/
|
|
4718
|
+
createItemFromFile(itemType, tenantId, sourceFile, cancelToken) {
|
|
4719
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/print-product/items/from-file?";
|
|
4720
|
+
if (itemType !== undefined && itemType !== null)
|
|
4721
|
+
url_ += "itemType=" + encodeURIComponent("" + itemType) + "&";
|
|
4722
|
+
if (tenantId === null)
|
|
4723
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
4724
|
+
else if (tenantId !== undefined)
|
|
4725
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
4726
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
4727
|
+
const content_ = new FormData();
|
|
4728
|
+
if (sourceFile !== null && sourceFile !== undefined)
|
|
4729
|
+
content_.append("sourceFile", sourceFile.data, sourceFile.fileName ? sourceFile.fileName : "sourceFile");
|
|
4730
|
+
let options_ = {
|
|
4731
|
+
data: content_,
|
|
4732
|
+
method: "POST",
|
|
4733
|
+
url: url_,
|
|
4734
|
+
headers: {
|
|
4735
|
+
"Accept": "application/json"
|
|
4736
|
+
},
|
|
4737
|
+
cancelToken
|
|
4738
|
+
};
|
|
4739
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
4740
|
+
return this.instance.request(transformedOptions_);
|
|
4741
|
+
}).catch((_error) => {
|
|
4742
|
+
if (isAxiosError(_error) && _error.response) {
|
|
4743
|
+
return _error.response;
|
|
4744
|
+
}
|
|
4745
|
+
else {
|
|
4746
|
+
throw _error;
|
|
4747
|
+
}
|
|
4748
|
+
}).then((_response) => {
|
|
4749
|
+
return this.transformResult(url_, _response, (_response) => this.processCreateItemFromFile(_response));
|
|
4750
|
+
});
|
|
4751
|
+
}
|
|
4752
|
+
processCreateItemFromFile(response) {
|
|
4753
|
+
const status = response.status;
|
|
4754
|
+
let _headers = {};
|
|
4755
|
+
if (response.headers && typeof response.headers === "object") {
|
|
4756
|
+
for (let k in response.headers) {
|
|
4757
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
4758
|
+
_headers[k] = response.headers[k];
|
|
4759
|
+
}
|
|
4760
|
+
}
|
|
4761
|
+
}
|
|
4762
|
+
if (status === 200) {
|
|
4763
|
+
const _responseText = response.data;
|
|
4764
|
+
let result200 = null;
|
|
4765
|
+
let resultData200 = _responseText;
|
|
4766
|
+
result200 = JSON.parse(resultData200);
|
|
4767
|
+
return Promise.resolve(result200);
|
|
4768
|
+
}
|
|
4769
|
+
else if (status === 404) {
|
|
4770
|
+
const _responseText = response.data;
|
|
4771
|
+
let result404 = null;
|
|
4772
|
+
let resultData404 = _responseText;
|
|
4773
|
+
result404 = JSON.parse(resultData404);
|
|
4774
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
4775
|
+
}
|
|
4776
|
+
else if (status === 409) {
|
|
4777
|
+
const _responseText = response.data;
|
|
4778
|
+
let result409 = null;
|
|
4779
|
+
let resultData409 = _responseText;
|
|
4780
|
+
result409 = JSON.parse(resultData409);
|
|
4781
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
4782
|
+
}
|
|
4783
|
+
else if (status === 401) {
|
|
4784
|
+
const _responseText = response.data;
|
|
4785
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
4786
|
+
}
|
|
4787
|
+
else if (status === 403) {
|
|
4788
|
+
const _responseText = response.data;
|
|
4789
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
4790
|
+
}
|
|
4791
|
+
else if (status !== 200 && status !== 204) {
|
|
4792
|
+
const _responseText = response.data;
|
|
4793
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
4794
|
+
}
|
|
4795
|
+
return Promise.resolve(null);
|
|
4796
|
+
}
|
|
4797
|
+
/**
|
|
4798
|
+
* Creates multiple print-product items from input image files.
|
|
4799
|
+
* @param itemType (optional) Desired print-product items type.
|
|
4800
|
+
* @param tenantId (optional) Tenant identifier
|
|
4801
|
+
* @param sourceFiles (optional)
|
|
4802
|
+
* @return Success
|
|
4803
|
+
*/
|
|
4804
|
+
batchCreateItemsFromFile(itemType, tenantId, sourceFiles, cancelToken) {
|
|
4805
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/print-product/items/from-file/batch-create?";
|
|
4806
|
+
if (itemType !== undefined && itemType !== null)
|
|
4807
|
+
url_ += "itemType=" + encodeURIComponent("" + itemType) + "&";
|
|
4808
|
+
if (tenantId === null)
|
|
4809
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
4810
|
+
else if (tenantId !== undefined)
|
|
4811
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
4812
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
4813
|
+
const content_ = new FormData();
|
|
4814
|
+
if (sourceFiles !== null && sourceFiles !== undefined)
|
|
4815
|
+
sourceFiles.forEach(item_ => content_.append("sourceFiles", item_.data, item_.fileName ? item_.fileName : "sourceFiles"));
|
|
4816
|
+
let options_ = {
|
|
4817
|
+
data: content_,
|
|
4818
|
+
method: "POST",
|
|
4819
|
+
url: url_,
|
|
4820
|
+
headers: {
|
|
4821
|
+
"Accept": "application/json"
|
|
4822
|
+
},
|
|
4823
|
+
cancelToken
|
|
4824
|
+
};
|
|
4825
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
4826
|
+
return this.instance.request(transformedOptions_);
|
|
4827
|
+
}).catch((_error) => {
|
|
4828
|
+
if (isAxiosError(_error) && _error.response) {
|
|
4829
|
+
return _error.response;
|
|
4830
|
+
}
|
|
4831
|
+
else {
|
|
4832
|
+
throw _error;
|
|
4833
|
+
}
|
|
4834
|
+
}).then((_response) => {
|
|
4835
|
+
return this.transformResult(url_, _response, (_response) => this.processBatchCreateItemsFromFile(_response));
|
|
4836
|
+
});
|
|
4837
|
+
}
|
|
4838
|
+
processBatchCreateItemsFromFile(response) {
|
|
4839
|
+
const status = response.status;
|
|
4840
|
+
let _headers = {};
|
|
4841
|
+
if (response.headers && typeof response.headers === "object") {
|
|
4842
|
+
for (let k in response.headers) {
|
|
4843
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
4844
|
+
_headers[k] = response.headers[k];
|
|
4845
|
+
}
|
|
4846
|
+
}
|
|
4847
|
+
}
|
|
4848
|
+
if (status === 200) {
|
|
4849
|
+
const _responseText = response.data;
|
|
4850
|
+
let result200 = null;
|
|
4851
|
+
let resultData200 = _responseText;
|
|
4852
|
+
result200 = JSON.parse(resultData200);
|
|
4853
|
+
return Promise.resolve(result200);
|
|
4854
|
+
}
|
|
4855
|
+
else if (status === 404) {
|
|
4856
|
+
const _responseText = response.data;
|
|
4857
|
+
let result404 = null;
|
|
4858
|
+
let resultData404 = _responseText;
|
|
4859
|
+
result404 = JSON.parse(resultData404);
|
|
4860
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
4861
|
+
}
|
|
4862
|
+
else if (status === 409) {
|
|
4863
|
+
const _responseText = response.data;
|
|
4864
|
+
let result409 = null;
|
|
4865
|
+
let resultData409 = _responseText;
|
|
4866
|
+
result409 = JSON.parse(resultData409);
|
|
4867
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
4868
|
+
}
|
|
4869
|
+
else if (status === 401) {
|
|
4870
|
+
const _responseText = response.data;
|
|
4871
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
4872
|
+
}
|
|
4873
|
+
else if (status === 403) {
|
|
4874
|
+
const _responseText = response.data;
|
|
4875
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
4876
|
+
}
|
|
4877
|
+
else if (status !== 200 && status !== 204) {
|
|
4878
|
+
const _responseText = response.data;
|
|
4879
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
4880
|
+
}
|
|
4881
|
+
return Promise.resolve(null);
|
|
4882
|
+
}
|
|
4883
|
+
/**
|
|
4884
|
+
* Creates print-product item from image file taken from storage.
|
|
4885
|
+
* @param itemType (optional) Desired item type.
|
|
4886
|
+
* @param tenantId (optional) Tenant identifier
|
|
4887
|
+
* @param body (optional) Operation parameters.
|
|
4888
|
+
* @return Success
|
|
4889
|
+
*/
|
|
4890
|
+
createItemFromStorage(itemType, tenantId, body, cancelToken) {
|
|
4891
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/print-product/items/from-storage?";
|
|
4892
|
+
if (itemType !== undefined && itemType !== null)
|
|
4893
|
+
url_ += "itemType=" + encodeURIComponent("" + itemType) + "&";
|
|
2106
4894
|
if (tenantId === null)
|
|
2107
4895
|
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
2108
4896
|
else if (tenantId !== undefined)
|
|
@@ -2129,10 +4917,10 @@ class DesignAtomsImagesApiClient extends ApiClientBase {
|
|
|
2129
4917
|
throw _error;
|
|
2130
4918
|
}
|
|
2131
4919
|
}).then((_response) => {
|
|
2132
|
-
return this.transformResult(url_, _response, (_response) => this.
|
|
4920
|
+
return this.transformResult(url_, _response, (_response) => this.processCreateItemFromStorage(_response));
|
|
2133
4921
|
});
|
|
2134
4922
|
}
|
|
2135
|
-
|
|
4923
|
+
processCreateItemFromStorage(response) {
|
|
2136
4924
|
const status = response.status;
|
|
2137
4925
|
let _headers = {};
|
|
2138
4926
|
if (response.headers && typeof response.headers === "object") {
|
|
@@ -2149,6 +4937,20 @@ class DesignAtomsImagesApiClient extends ApiClientBase {
|
|
|
2149
4937
|
result200 = JSON.parse(resultData200);
|
|
2150
4938
|
return Promise.resolve(result200);
|
|
2151
4939
|
}
|
|
4940
|
+
else if (status === 404) {
|
|
4941
|
+
const _responseText = response.data;
|
|
4942
|
+
let result404 = null;
|
|
4943
|
+
let resultData404 = _responseText;
|
|
4944
|
+
result404 = JSON.parse(resultData404);
|
|
4945
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
4946
|
+
}
|
|
4947
|
+
else if (status === 409) {
|
|
4948
|
+
const _responseText = response.data;
|
|
4949
|
+
let result409 = null;
|
|
4950
|
+
let resultData409 = _responseText;
|
|
4951
|
+
result409 = JSON.parse(resultData409);
|
|
4952
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
4953
|
+
}
|
|
2152
4954
|
else if (status === 401) {
|
|
2153
4955
|
const _responseText = response.data;
|
|
2154
4956
|
return throwException("Unauthorized", status, _responseText, _headers);
|
|
@@ -2163,40 +4965,29 @@ class DesignAtomsImagesApiClient extends ApiClientBase {
|
|
|
2163
4965
|
}
|
|
2164
4966
|
return Promise.resolve(null);
|
|
2165
4967
|
}
|
|
2166
|
-
}
|
|
2167
|
-
exports.DesignAtomsImagesApiClient = DesignAtomsImagesApiClient;
|
|
2168
|
-
class DesignAtomsMockups3dApiClient extends ApiClientBase {
|
|
2169
|
-
instance;
|
|
2170
|
-
baseUrl;
|
|
2171
|
-
jsonParseReviver = undefined;
|
|
2172
|
-
constructor(configuration, baseUrl, instance) {
|
|
2173
|
-
super(configuration);
|
|
2174
|
-
this.instance = instance ? instance : axios_1.create();
|
|
2175
|
-
this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : this.getBaseUrl("");
|
|
2176
|
-
}
|
|
2177
4968
|
/**
|
|
2178
|
-
*
|
|
2179
|
-
* @param
|
|
2180
|
-
* @param ownerId (optional) Private mockup owner identifier.
|
|
4969
|
+
* Creates multiple print-product items from the specified image files in storage.
|
|
4970
|
+
* @param itemType (optional) Desired items type.
|
|
2181
4971
|
* @param tenantId (optional) Tenant identifier
|
|
4972
|
+
* @param body (optional) Operation parameters.
|
|
2182
4973
|
* @return Success
|
|
2183
4974
|
*/
|
|
2184
|
-
|
|
2185
|
-
let url_ = this.baseUrl + "/api/atoms/v1/
|
|
2186
|
-
if (
|
|
2187
|
-
|
|
2188
|
-
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
2189
|
-
if (ownerId !== undefined && ownerId !== null)
|
|
2190
|
-
url_ += "ownerId=" + encodeURIComponent("" + ownerId) + "&";
|
|
4975
|
+
batchCreateItemsFromStorage(itemType, tenantId, body, cancelToken) {
|
|
4976
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/print-product/items/from-storage/batch-create?";
|
|
4977
|
+
if (itemType !== undefined && itemType !== null)
|
|
4978
|
+
url_ += "itemType=" + encodeURIComponent("" + itemType) + "&";
|
|
2191
4979
|
if (tenantId === null)
|
|
2192
4980
|
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
2193
4981
|
else if (tenantId !== undefined)
|
|
2194
4982
|
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2195
4983
|
url_ = url_.replace(/[?&]$/, "");
|
|
4984
|
+
const content_ = JSON.stringify(body);
|
|
2196
4985
|
let options_ = {
|
|
2197
|
-
|
|
4986
|
+
data: content_,
|
|
4987
|
+
method: "POST",
|
|
2198
4988
|
url: url_,
|
|
2199
4989
|
headers: {
|
|
4990
|
+
"Content-Type": "application/json",
|
|
2200
4991
|
"Accept": "application/json"
|
|
2201
4992
|
},
|
|
2202
4993
|
cancelToken
|
|
@@ -2211,10 +5002,10 @@ class DesignAtomsMockups3dApiClient extends ApiClientBase {
|
|
|
2211
5002
|
throw _error;
|
|
2212
5003
|
}
|
|
2213
5004
|
}).then((_response) => {
|
|
2214
|
-
return this.transformResult(url_, _response, (_response) => this.
|
|
5005
|
+
return this.transformResult(url_, _response, (_response) => this.processBatchCreateItemsFromStorage(_response));
|
|
2215
5006
|
});
|
|
2216
5007
|
}
|
|
2217
|
-
|
|
5008
|
+
processBatchCreateItemsFromStorage(response) {
|
|
2218
5009
|
const status = response.status;
|
|
2219
5010
|
let _headers = {};
|
|
2220
5011
|
if (response.headers && typeof response.headers === "object") {
|
|
@@ -2238,12 +5029,12 @@ class DesignAtomsMockups3dApiClient extends ApiClientBase {
|
|
|
2238
5029
|
result404 = JSON.parse(resultData404);
|
|
2239
5030
|
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
2240
5031
|
}
|
|
2241
|
-
else if (status ===
|
|
5032
|
+
else if (status === 409) {
|
|
2242
5033
|
const _responseText = response.data;
|
|
2243
|
-
let
|
|
2244
|
-
let
|
|
2245
|
-
|
|
2246
|
-
return throwException("
|
|
5034
|
+
let result409 = null;
|
|
5035
|
+
let resultData409 = _responseText;
|
|
5036
|
+
result409 = JSON.parse(resultData409);
|
|
5037
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
2247
5038
|
}
|
|
2248
5039
|
else if (status === 401) {
|
|
2249
5040
|
const _responseText = response.data;
|
|
@@ -2260,29 +5051,28 @@ class DesignAtomsMockups3dApiClient extends ApiClientBase {
|
|
|
2260
5051
|
return Promise.resolve(null);
|
|
2261
5052
|
}
|
|
2262
5053
|
/**
|
|
2263
|
-
*
|
|
2264
|
-
* @param
|
|
2265
|
-
* @param ownerId (optional) Private mockup owner identifier.
|
|
5054
|
+
* Creates print-product item from remote web image provided by URL.
|
|
5055
|
+
* @param itemType (optional) Desired item type.
|
|
2266
5056
|
* @param tenantId (optional) Tenant identifier
|
|
5057
|
+
* @param body (optional) Operation parameters.
|
|
2267
5058
|
* @return Success
|
|
2268
5059
|
*/
|
|
2269
|
-
|
|
2270
|
-
let url_ = this.baseUrl + "/api/atoms/v1/
|
|
2271
|
-
if (
|
|
2272
|
-
|
|
2273
|
-
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
2274
|
-
if (ownerId !== undefined && ownerId !== null)
|
|
2275
|
-
url_ += "ownerId=" + encodeURIComponent("" + ownerId) + "&";
|
|
5060
|
+
createItemFromUrl(itemType, tenantId, body, cancelToken) {
|
|
5061
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/print-product/items/from-url?";
|
|
5062
|
+
if (itemType !== undefined && itemType !== null)
|
|
5063
|
+
url_ += "itemType=" + encodeURIComponent("" + itemType) + "&";
|
|
2276
5064
|
if (tenantId === null)
|
|
2277
5065
|
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
2278
5066
|
else if (tenantId !== undefined)
|
|
2279
5067
|
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2280
5068
|
url_ = url_.replace(/[?&]$/, "");
|
|
5069
|
+
const content_ = JSON.stringify(body);
|
|
2281
5070
|
let options_ = {
|
|
2282
|
-
|
|
2283
|
-
method: "
|
|
5071
|
+
data: content_,
|
|
5072
|
+
method: "POST",
|
|
2284
5073
|
url: url_,
|
|
2285
5074
|
headers: {
|
|
5075
|
+
"Content-Type": "application/json",
|
|
2286
5076
|
"Accept": "application/json"
|
|
2287
5077
|
},
|
|
2288
5078
|
cancelToken
|
|
@@ -2297,10 +5087,10 @@ class DesignAtomsMockups3dApiClient extends ApiClientBase {
|
|
|
2297
5087
|
throw _error;
|
|
2298
5088
|
}
|
|
2299
5089
|
}).then((_response) => {
|
|
2300
|
-
return this.transformResult(url_, _response, (_response) => this.
|
|
5090
|
+
return this.transformResult(url_, _response, (_response) => this.processCreateItemFromUrl(_response));
|
|
2301
5091
|
});
|
|
2302
5092
|
}
|
|
2303
|
-
|
|
5093
|
+
processCreateItemFromUrl(response) {
|
|
2304
5094
|
const status = response.status;
|
|
2305
5095
|
let _headers = {};
|
|
2306
5096
|
if (response.headers && typeof response.headers === "object") {
|
|
@@ -2310,11 +5100,12 @@ class DesignAtomsMockups3dApiClient extends ApiClientBase {
|
|
|
2310
5100
|
}
|
|
2311
5101
|
}
|
|
2312
5102
|
}
|
|
2313
|
-
if (status === 200
|
|
2314
|
-
const
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
|
|
5103
|
+
if (status === 200) {
|
|
5104
|
+
const _responseText = response.data;
|
|
5105
|
+
let result200 = null;
|
|
5106
|
+
let resultData200 = _responseText;
|
|
5107
|
+
result200 = JSON.parse(resultData200);
|
|
5108
|
+
return Promise.resolve(result200);
|
|
2318
5109
|
}
|
|
2319
5110
|
else if (status === 404) {
|
|
2320
5111
|
const _responseText = response.data;
|
|
@@ -2323,12 +5114,12 @@ class DesignAtomsMockups3dApiClient extends ApiClientBase {
|
|
|
2323
5114
|
result404 = JSON.parse(resultData404);
|
|
2324
5115
|
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
2325
5116
|
}
|
|
2326
|
-
else if (status ===
|
|
5117
|
+
else if (status === 409) {
|
|
2327
5118
|
const _responseText = response.data;
|
|
2328
|
-
let
|
|
2329
|
-
let
|
|
2330
|
-
|
|
2331
|
-
return throwException("
|
|
5119
|
+
let result409 = null;
|
|
5120
|
+
let resultData409 = _responseText;
|
|
5121
|
+
result409 = JSON.parse(resultData409);
|
|
5122
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
2332
5123
|
}
|
|
2333
5124
|
else if (status === 401) {
|
|
2334
5125
|
const _responseText = response.data;
|
|
@@ -2345,29 +5136,28 @@ class DesignAtomsMockups3dApiClient extends ApiClientBase {
|
|
|
2345
5136
|
return Promise.resolve(null);
|
|
2346
5137
|
}
|
|
2347
5138
|
/**
|
|
2348
|
-
*
|
|
2349
|
-
* @param
|
|
2350
|
-
* @param ownerId (optional) Private mockup owner identifier.
|
|
5139
|
+
* Creates multiple print-product items from remote web images provided by URLs list.
|
|
5140
|
+
* @param itemType (optional) Desired items type.
|
|
2351
5141
|
* @param tenantId (optional) Tenant identifier
|
|
5142
|
+
* @param body (optional) Operation parameters.
|
|
2352
5143
|
* @return Success
|
|
2353
5144
|
*/
|
|
2354
|
-
|
|
2355
|
-
let url_ = this.baseUrl + "/api/atoms/v1/
|
|
2356
|
-
if (
|
|
2357
|
-
|
|
2358
|
-
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
2359
|
-
if (ownerId !== undefined && ownerId !== null)
|
|
2360
|
-
url_ += "ownerId=" + encodeURIComponent("" + ownerId) + "&";
|
|
5145
|
+
batchCreateItemsFromUrl(itemType, tenantId, body, cancelToken) {
|
|
5146
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/print-product/items/from-url/batch-create?";
|
|
5147
|
+
if (itemType !== undefined && itemType !== null)
|
|
5148
|
+
url_ += "itemType=" + encodeURIComponent("" + itemType) + "&";
|
|
2361
5149
|
if (tenantId === null)
|
|
2362
5150
|
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
2363
5151
|
else if (tenantId !== undefined)
|
|
2364
5152
|
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2365
5153
|
url_ = url_.replace(/[?&]$/, "");
|
|
5154
|
+
const content_ = JSON.stringify(body);
|
|
2366
5155
|
let options_ = {
|
|
2367
|
-
|
|
2368
|
-
method: "
|
|
5156
|
+
data: content_,
|
|
5157
|
+
method: "POST",
|
|
2369
5158
|
url: url_,
|
|
2370
5159
|
headers: {
|
|
5160
|
+
"Content-Type": "application/json",
|
|
2371
5161
|
"Accept": "application/json"
|
|
2372
5162
|
},
|
|
2373
5163
|
cancelToken
|
|
@@ -2382,10 +5172,10 @@ class DesignAtomsMockups3dApiClient extends ApiClientBase {
|
|
|
2382
5172
|
throw _error;
|
|
2383
5173
|
}
|
|
2384
5174
|
}).then((_response) => {
|
|
2385
|
-
return this.transformResult(url_, _response, (_response) => this.
|
|
5175
|
+
return this.transformResult(url_, _response, (_response) => this.processBatchCreateItemsFromUrl(_response));
|
|
2386
5176
|
});
|
|
2387
5177
|
}
|
|
2388
|
-
|
|
5178
|
+
processBatchCreateItemsFromUrl(response) {
|
|
2389
5179
|
const status = response.status;
|
|
2390
5180
|
let _headers = {};
|
|
2391
5181
|
if (response.headers && typeof response.headers === "object") {
|
|
@@ -2395,11 +5185,12 @@ class DesignAtomsMockups3dApiClient extends ApiClientBase {
|
|
|
2395
5185
|
}
|
|
2396
5186
|
}
|
|
2397
5187
|
}
|
|
2398
|
-
if (status === 200
|
|
2399
|
-
const
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
5188
|
+
if (status === 200) {
|
|
5189
|
+
const _responseText = response.data;
|
|
5190
|
+
let result200 = null;
|
|
5191
|
+
let resultData200 = _responseText;
|
|
5192
|
+
result200 = JSON.parse(resultData200);
|
|
5193
|
+
return Promise.resolve(result200);
|
|
2403
5194
|
}
|
|
2404
5195
|
else if (status === 404) {
|
|
2405
5196
|
const _responseText = response.data;
|
|
@@ -2408,12 +5199,12 @@ class DesignAtomsMockups3dApiClient extends ApiClientBase {
|
|
|
2408
5199
|
result404 = JSON.parse(resultData404);
|
|
2409
5200
|
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
2410
5201
|
}
|
|
2411
|
-
else if (status ===
|
|
5202
|
+
else if (status === 409) {
|
|
2412
5203
|
const _responseText = response.data;
|
|
2413
|
-
let
|
|
2414
|
-
let
|
|
2415
|
-
|
|
2416
|
-
return throwException("
|
|
5204
|
+
let result409 = null;
|
|
5205
|
+
let resultData409 = _responseText;
|
|
5206
|
+
result409 = JSON.parse(resultData409);
|
|
5207
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
2417
5208
|
}
|
|
2418
5209
|
else if (status === 401) {
|
|
2419
5210
|
const _responseText = response.data;
|
|
@@ -2430,7 +5221,7 @@ class DesignAtomsMockups3dApiClient extends ApiClientBase {
|
|
|
2430
5221
|
return Promise.resolve(null);
|
|
2431
5222
|
}
|
|
2432
5223
|
}
|
|
2433
|
-
exports.
|
|
5224
|
+
exports.DesignAtomsPrintProductItemsApiClient = DesignAtomsPrintProductItemsApiClient;
|
|
2434
5225
|
class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
2435
5226
|
instance;
|
|
2436
5227
|
baseUrl;
|
|
@@ -2512,7 +5303,7 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2512
5303
|
return Promise.resolve(null);
|
|
2513
5304
|
}
|
|
2514
5305
|
/**
|
|
2515
|
-
* Returns content of the background.
|
|
5306
|
+
* Returns image content of the background.
|
|
2516
5307
|
* @param id Design identifier.
|
|
2517
5308
|
* @param surfaceIndex (optional) Surface index.
|
|
2518
5309
|
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
@@ -2578,12 +5369,97 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2578
5369
|
result404 = JSON.parse(resultData404);
|
|
2579
5370
|
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
2580
5371
|
}
|
|
2581
|
-
else if (status ===
|
|
5372
|
+
else if (status === 409) {
|
|
5373
|
+
const _responseText = response.data;
|
|
5374
|
+
let result409 = null;
|
|
5375
|
+
let resultData409 = _responseText;
|
|
5376
|
+
result409 = JSON.parse(resultData409);
|
|
5377
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
5378
|
+
}
|
|
5379
|
+
else if (status === 401) {
|
|
5380
|
+
const _responseText = response.data;
|
|
5381
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
5382
|
+
}
|
|
5383
|
+
else if (status === 403) {
|
|
5384
|
+
const _responseText = response.data;
|
|
5385
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
5386
|
+
}
|
|
5387
|
+
else if (status !== 200 && status !== 204) {
|
|
5388
|
+
const _responseText = response.data;
|
|
5389
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
5390
|
+
}
|
|
5391
|
+
return Promise.resolve(null);
|
|
5392
|
+
}
|
|
5393
|
+
/**
|
|
5394
|
+
* Sets specified editor-mockups for selected design surfaces.
|
|
5395
|
+
* @param id Design identifier.
|
|
5396
|
+
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
5397
|
+
* @param tenantId (optional) Tenant identifier
|
|
5398
|
+
* @param body (optional) Operation parameters.
|
|
5399
|
+
* @return No Content
|
|
5400
|
+
*/
|
|
5401
|
+
setEditorMockups(id, privateStorageOwner, tenantId, body, cancelToken) {
|
|
5402
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/editor-mockups?";
|
|
5403
|
+
if (id === undefined || id === null)
|
|
5404
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
5405
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
5406
|
+
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
5407
|
+
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
5408
|
+
if (tenantId === null)
|
|
5409
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
5410
|
+
else if (tenantId !== undefined)
|
|
5411
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
5412
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
5413
|
+
const content_ = JSON.stringify(body);
|
|
5414
|
+
let options_ = {
|
|
5415
|
+
data: content_,
|
|
5416
|
+
method: "PUT",
|
|
5417
|
+
url: url_,
|
|
5418
|
+
headers: {
|
|
5419
|
+
"Content-Type": "application/json",
|
|
5420
|
+
},
|
|
5421
|
+
cancelToken
|
|
5422
|
+
};
|
|
5423
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
5424
|
+
return this.instance.request(transformedOptions_);
|
|
5425
|
+
}).catch((_error) => {
|
|
5426
|
+
if (isAxiosError(_error) && _error.response) {
|
|
5427
|
+
return _error.response;
|
|
5428
|
+
}
|
|
5429
|
+
else {
|
|
5430
|
+
throw _error;
|
|
5431
|
+
}
|
|
5432
|
+
}).then((_response) => {
|
|
5433
|
+
return this.transformResult(url_, _response, (_response) => this.processSetEditorMockups(_response));
|
|
5434
|
+
});
|
|
5435
|
+
}
|
|
5436
|
+
processSetEditorMockups(response) {
|
|
5437
|
+
const status = response.status;
|
|
5438
|
+
let _headers = {};
|
|
5439
|
+
if (response.headers && typeof response.headers === "object") {
|
|
5440
|
+
for (let k in response.headers) {
|
|
5441
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
5442
|
+
_headers[k] = response.headers[k];
|
|
5443
|
+
}
|
|
5444
|
+
}
|
|
5445
|
+
}
|
|
5446
|
+
if (status === 204) {
|
|
5447
|
+
const _responseText = response.data;
|
|
5448
|
+
return Promise.resolve(null);
|
|
5449
|
+
}
|
|
5450
|
+
else if (status === 400) {
|
|
5451
|
+
const _responseText = response.data;
|
|
5452
|
+
let result400 = null;
|
|
5453
|
+
let resultData400 = _responseText;
|
|
5454
|
+
result400 = JSON.parse(resultData400);
|
|
5455
|
+
return throwException("Bad Request", status, _responseText, _headers, result400);
|
|
5456
|
+
}
|
|
5457
|
+
else if (status === 404) {
|
|
2582
5458
|
const _responseText = response.data;
|
|
2583
|
-
let
|
|
2584
|
-
let
|
|
2585
|
-
|
|
2586
|
-
return throwException("
|
|
5459
|
+
let result404 = null;
|
|
5460
|
+
let resultData404 = _responseText;
|
|
5461
|
+
result404 = JSON.parse(resultData404);
|
|
5462
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
2587
5463
|
}
|
|
2588
5464
|
else if (status === 401) {
|
|
2589
5465
|
const _responseText = response.data;
|
|
@@ -2600,14 +5476,14 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2600
5476
|
return Promise.resolve(null);
|
|
2601
5477
|
}
|
|
2602
5478
|
/**
|
|
2603
|
-
*
|
|
5479
|
+
* Returns design parameters stored in product model.
|
|
2604
5480
|
* @param id Design identifier.
|
|
2605
5481
|
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
2606
5482
|
* @param tenantId (optional) Tenant identifier
|
|
2607
5483
|
* @return Success
|
|
2608
5484
|
*/
|
|
2609
|
-
|
|
2610
|
-
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/
|
|
5485
|
+
getDesignParameters(id, privateStorageOwner, tenantId, cancelToken) {
|
|
5486
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/parameters?";
|
|
2611
5487
|
if (id === undefined || id === null)
|
|
2612
5488
|
throw new Error("The parameter 'id' must be defined.");
|
|
2613
5489
|
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
@@ -2636,10 +5512,10 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2636
5512
|
throw _error;
|
|
2637
5513
|
}
|
|
2638
5514
|
}).then((_response) => {
|
|
2639
|
-
return this.transformResult(url_, _response, (_response) => this.
|
|
5515
|
+
return this.transformResult(url_, _response, (_response) => this.processGetDesignParameters(_response));
|
|
2640
5516
|
});
|
|
2641
5517
|
}
|
|
2642
|
-
|
|
5518
|
+
processGetDesignParameters(response) {
|
|
2643
5519
|
const status = response.status;
|
|
2644
5520
|
let _headers = {};
|
|
2645
5521
|
if (response.headers && typeof response.headers === "object") {
|
|
@@ -2678,15 +5554,14 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2678
5554
|
return Promise.resolve(null);
|
|
2679
5555
|
}
|
|
2680
5556
|
/**
|
|
2681
|
-
*
|
|
5557
|
+
* Loads a data schema from design file taken from storage.
|
|
2682
5558
|
* @param id Design identifier.
|
|
2683
5559
|
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
2684
5560
|
* @param tenantId (optional) Tenant identifier
|
|
2685
|
-
* @param body (optional) Serialized product description.
|
|
2686
5561
|
* @return Success
|
|
2687
5562
|
*/
|
|
2688
|
-
|
|
2689
|
-
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/
|
|
5563
|
+
loadDataSchema(id, privateStorageOwner, tenantId, cancelToken) {
|
|
5564
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/schema?";
|
|
2690
5565
|
if (id === undefined || id === null)
|
|
2691
5566
|
throw new Error("The parameter 'id' must be defined.");
|
|
2692
5567
|
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
@@ -2697,13 +5572,12 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2697
5572
|
else if (tenantId !== undefined)
|
|
2698
5573
|
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2699
5574
|
url_ = url_.replace(/[?&]$/, "");
|
|
2700
|
-
const content_ = JSON.stringify(body);
|
|
2701
5575
|
let options_ = {
|
|
2702
|
-
|
|
2703
|
-
method: "
|
|
5576
|
+
responseType: "blob",
|
|
5577
|
+
method: "GET",
|
|
2704
5578
|
url: url_,
|
|
2705
5579
|
headers: {
|
|
2706
|
-
"
|
|
5580
|
+
"Accept": "application/octet-stream"
|
|
2707
5581
|
},
|
|
2708
5582
|
cancelToken
|
|
2709
5583
|
};
|
|
@@ -2717,10 +5591,10 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2717
5591
|
throw _error;
|
|
2718
5592
|
}
|
|
2719
5593
|
}).then((_response) => {
|
|
2720
|
-
return this.transformResult(url_, _response, (_response) => this.
|
|
5594
|
+
return this.transformResult(url_, _response, (_response) => this.processLoadDataSchema(_response));
|
|
2721
5595
|
});
|
|
2722
5596
|
}
|
|
2723
|
-
|
|
5597
|
+
processLoadDataSchema(response) {
|
|
2724
5598
|
const status = response.status;
|
|
2725
5599
|
let _headers = {};
|
|
2726
5600
|
if (response.headers && typeof response.headers === "object") {
|
|
@@ -2730,9 +5604,11 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2730
5604
|
}
|
|
2731
5605
|
}
|
|
2732
5606
|
}
|
|
2733
|
-
if (status === 200) {
|
|
2734
|
-
const
|
|
2735
|
-
|
|
5607
|
+
if (status === 200 || status === 206) {
|
|
5608
|
+
const contentDisposition = response.headers ? response.headers["content-disposition"] : undefined;
|
|
5609
|
+
const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
|
|
5610
|
+
const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
|
|
5611
|
+
return Promise.resolve({ fileName: fileName, status: status, data: new Blob([response.data]), headers: _headers });
|
|
2736
5612
|
}
|
|
2737
5613
|
else if (status === 404) {
|
|
2738
5614
|
const _responseText = response.data;
|
|
@@ -2741,6 +5617,13 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2741
5617
|
result404 = JSON.parse(resultData404);
|
|
2742
5618
|
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
2743
5619
|
}
|
|
5620
|
+
else if (status === 409) {
|
|
5621
|
+
const _responseText = response.data;
|
|
5622
|
+
let result409 = null;
|
|
5623
|
+
let resultData409 = _responseText;
|
|
5624
|
+
result409 = JSON.parse(resultData409);
|
|
5625
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
5626
|
+
}
|
|
2744
5627
|
else if (status === 401) {
|
|
2745
5628
|
const _responseText = response.data;
|
|
2746
5629
|
return throwException("Unauthorized", status, _responseText, _headers);
|
|
@@ -2756,20 +5639,14 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2756
5639
|
return Promise.resolve(null);
|
|
2757
5640
|
}
|
|
2758
5641
|
/**
|
|
2759
|
-
*
|
|
5642
|
+
* Loads a toggle set from design file taken from storage.
|
|
2760
5643
|
* @param id Design identifier.
|
|
2761
5644
|
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
2762
5645
|
* @param tenantId (optional) Tenant identifier
|
|
2763
|
-
* @param patchType (optional)
|
|
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)
|
|
2769
5646
|
* @return Success
|
|
2770
5647
|
*/
|
|
2771
|
-
|
|
2772
|
-
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/
|
|
5648
|
+
loadToggleSet(id, privateStorageOwner, tenantId, cancelToken) {
|
|
5649
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/toggle-set?";
|
|
2773
5650
|
if (id === undefined || id === null)
|
|
2774
5651
|
throw new Error("The parameter 'id' must be defined.");
|
|
2775
5652
|
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
@@ -2780,28 +5657,13 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2780
5657
|
else if (tenantId !== undefined)
|
|
2781
5658
|
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2782
5659
|
url_ = url_.replace(/[?&]$/, "");
|
|
2783
|
-
const content_ = new FormData();
|
|
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");
|
|
2800
5660
|
let options_ = {
|
|
2801
|
-
|
|
2802
|
-
method: "
|
|
5661
|
+
responseType: "blob",
|
|
5662
|
+
method: "GET",
|
|
2803
5663
|
url: url_,
|
|
2804
|
-
headers: {
|
|
5664
|
+
headers: {
|
|
5665
|
+
"Accept": "application/octet-stream"
|
|
5666
|
+
},
|
|
2805
5667
|
cancelToken
|
|
2806
5668
|
};
|
|
2807
5669
|
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
@@ -2814,10 +5676,10 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2814
5676
|
throw _error;
|
|
2815
5677
|
}
|
|
2816
5678
|
}).then((_response) => {
|
|
2817
|
-
return this.transformResult(url_, _response, (_response) => this.
|
|
5679
|
+
return this.transformResult(url_, _response, (_response) => this.processLoadToggleSet(_response));
|
|
2818
5680
|
});
|
|
2819
5681
|
}
|
|
2820
|
-
|
|
5682
|
+
processLoadToggleSet(response) {
|
|
2821
5683
|
const status = response.status;
|
|
2822
5684
|
let _headers = {};
|
|
2823
5685
|
if (response.headers && typeof response.headers === "object") {
|
|
@@ -2827,9 +5689,11 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2827
5689
|
}
|
|
2828
5690
|
}
|
|
2829
5691
|
}
|
|
2830
|
-
if (status === 200) {
|
|
2831
|
-
const
|
|
2832
|
-
|
|
5692
|
+
if (status === 200 || status === 206) {
|
|
5693
|
+
const contentDisposition = response.headers ? response.headers["content-disposition"] : undefined;
|
|
5694
|
+
const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
|
|
5695
|
+
const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
|
|
5696
|
+
return Promise.resolve({ fileName: fileName, status: status, data: new Blob([response.data]), headers: _headers });
|
|
2833
5697
|
}
|
|
2834
5698
|
else if (status === 404) {
|
|
2835
5699
|
const _responseText = response.data;
|
|
@@ -2838,6 +5702,13 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2838
5702
|
result404 = JSON.parse(resultData404);
|
|
2839
5703
|
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
2840
5704
|
}
|
|
5705
|
+
else if (status === 409) {
|
|
5706
|
+
const _responseText = response.data;
|
|
5707
|
+
let result409 = null;
|
|
5708
|
+
let resultData409 = _responseText;
|
|
5709
|
+
result409 = JSON.parse(resultData409);
|
|
5710
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
5711
|
+
}
|
|
2841
5712
|
else if (status === 401) {
|
|
2842
5713
|
const _responseText = response.data;
|
|
2843
5714
|
return throwException("Unauthorized", status, _responseText, _headers);
|
|
@@ -2853,14 +5724,14 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2853
5724
|
return Promise.resolve(null);
|
|
2854
5725
|
}
|
|
2855
5726
|
/**
|
|
2856
|
-
* Returns design
|
|
5727
|
+
* Returns variable items information for design file taken from storage.
|
|
2857
5728
|
* @param id Design identifier.
|
|
2858
5729
|
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
2859
5730
|
* @param tenantId (optional) Tenant identifier
|
|
2860
5731
|
* @return Success
|
|
2861
5732
|
*/
|
|
2862
|
-
|
|
2863
|
-
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/
|
|
5733
|
+
getVariables(id, privateStorageOwner, tenantId, cancelToken) {
|
|
5734
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/variables?";
|
|
2864
5735
|
if (id === undefined || id === null)
|
|
2865
5736
|
throw new Error("The parameter 'id' must be defined.");
|
|
2866
5737
|
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
@@ -2889,10 +5760,10 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2889
5760
|
throw _error;
|
|
2890
5761
|
}
|
|
2891
5762
|
}).then((_response) => {
|
|
2892
|
-
return this.transformResult(url_, _response, (_response) => this.
|
|
5763
|
+
return this.transformResult(url_, _response, (_response) => this.processGetVariables(_response));
|
|
2893
5764
|
});
|
|
2894
5765
|
}
|
|
2895
|
-
|
|
5766
|
+
processGetVariables(response) {
|
|
2896
5767
|
const status = response.status;
|
|
2897
5768
|
let _headers = {};
|
|
2898
5769
|
if (response.headers && typeof response.headers === "object") {
|
|
@@ -2931,14 +5802,15 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2931
5802
|
return Promise.resolve(null);
|
|
2932
5803
|
}
|
|
2933
5804
|
/**
|
|
2934
|
-
*
|
|
5805
|
+
* Saves variable items values for design file taken from storage.
|
|
2935
5806
|
* @param id Design identifier.
|
|
2936
5807
|
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
2937
5808
|
* @param tenantId (optional) Tenant identifier
|
|
5809
|
+
* @param body (optional) Design variable values.
|
|
2938
5810
|
* @return Success
|
|
2939
5811
|
*/
|
|
2940
|
-
|
|
2941
|
-
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/
|
|
5812
|
+
setVariables(id, privateStorageOwner, tenantId, body, cancelToken) {
|
|
5813
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/variables?";
|
|
2942
5814
|
if (id === undefined || id === null)
|
|
2943
5815
|
throw new Error("The parameter 'id' must be defined.");
|
|
2944
5816
|
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
@@ -2949,12 +5821,13 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2949
5821
|
else if (tenantId !== undefined)
|
|
2950
5822
|
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2951
5823
|
url_ = url_.replace(/[?&]$/, "");
|
|
5824
|
+
const content_ = JSON.stringify(body);
|
|
2952
5825
|
let options_ = {
|
|
2953
|
-
|
|
2954
|
-
method: "
|
|
5826
|
+
data: content_,
|
|
5827
|
+
method: "PUT",
|
|
2955
5828
|
url: url_,
|
|
2956
5829
|
headers: {
|
|
2957
|
-
"
|
|
5830
|
+
"Content-Type": "application/json",
|
|
2958
5831
|
},
|
|
2959
5832
|
cancelToken
|
|
2960
5833
|
};
|
|
@@ -2968,10 +5841,10 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2968
5841
|
throw _error;
|
|
2969
5842
|
}
|
|
2970
5843
|
}).then((_response) => {
|
|
2971
|
-
return this.transformResult(url_, _response, (_response) => this.
|
|
5844
|
+
return this.transformResult(url_, _response, (_response) => this.processSetVariables(_response));
|
|
2972
5845
|
});
|
|
2973
5846
|
}
|
|
2974
|
-
|
|
5847
|
+
processSetVariables(response) {
|
|
2975
5848
|
const status = response.status;
|
|
2976
5849
|
let _headers = {};
|
|
2977
5850
|
if (response.headers && typeof response.headers === "object") {
|
|
@@ -2981,11 +5854,9 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2981
5854
|
}
|
|
2982
5855
|
}
|
|
2983
5856
|
}
|
|
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 });
|
|
5857
|
+
if (status === 200) {
|
|
5858
|
+
const _responseText = response.data;
|
|
5859
|
+
return Promise.resolve(null);
|
|
2989
5860
|
}
|
|
2990
5861
|
else if (status === 404) {
|
|
2991
5862
|
const _responseText = response.data;
|
|
@@ -3016,14 +5887,14 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3016
5887
|
return Promise.resolve(null);
|
|
3017
5888
|
}
|
|
3018
5889
|
/**
|
|
3019
|
-
* Loads
|
|
5890
|
+
* Loads variable data printing information from design file taken from storage.
|
|
3020
5891
|
* @param id Design identifier.
|
|
3021
5892
|
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
3022
5893
|
* @param tenantId (optional) Tenant identifier
|
|
3023
5894
|
* @return Success
|
|
3024
5895
|
*/
|
|
3025
|
-
|
|
3026
|
-
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/
|
|
5896
|
+
loadVdpData(id, privateStorageOwner, tenantId, cancelToken) {
|
|
5897
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/vdp-data?";
|
|
3027
5898
|
if (id === undefined || id === null)
|
|
3028
5899
|
throw new Error("The parameter 'id' must be defined.");
|
|
3029
5900
|
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
@@ -3035,11 +5906,10 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3035
5906
|
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
3036
5907
|
url_ = url_.replace(/[?&]$/, "");
|
|
3037
5908
|
let options_ = {
|
|
3038
|
-
responseType: "blob",
|
|
3039
5909
|
method: "GET",
|
|
3040
5910
|
url: url_,
|
|
3041
5911
|
headers: {
|
|
3042
|
-
"Accept": "application/
|
|
5912
|
+
"Accept": "application/json"
|
|
3043
5913
|
},
|
|
3044
5914
|
cancelToken
|
|
3045
5915
|
};
|
|
@@ -3053,10 +5923,10 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3053
5923
|
throw _error;
|
|
3054
5924
|
}
|
|
3055
5925
|
}).then((_response) => {
|
|
3056
|
-
return this.transformResult(url_, _response, (_response) => this.
|
|
5926
|
+
return this.transformResult(url_, _response, (_response) => this.processLoadVdpData(_response));
|
|
3057
5927
|
});
|
|
3058
5928
|
}
|
|
3059
|
-
|
|
5929
|
+
processLoadVdpData(response) {
|
|
3060
5930
|
const status = response.status;
|
|
3061
5931
|
let _headers = {};
|
|
3062
5932
|
if (response.headers && typeof response.headers === "object") {
|
|
@@ -3066,11 +5936,12 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3066
5936
|
}
|
|
3067
5937
|
}
|
|
3068
5938
|
}
|
|
3069
|
-
if (status === 200
|
|
3070
|
-
const
|
|
3071
|
-
|
|
3072
|
-
|
|
3073
|
-
|
|
5939
|
+
if (status === 200) {
|
|
5940
|
+
const _responseText = response.data;
|
|
5941
|
+
let result200 = null;
|
|
5942
|
+
let resultData200 = _responseText;
|
|
5943
|
+
result200 = JSON.parse(resultData200);
|
|
5944
|
+
return Promise.resolve(result200);
|
|
3074
5945
|
}
|
|
3075
5946
|
else if (status === 404) {
|
|
3076
5947
|
const _responseText = response.data;
|
|
@@ -3101,14 +5972,15 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3101
5972
|
return Promise.resolve(null);
|
|
3102
5973
|
}
|
|
3103
5974
|
/**
|
|
3104
|
-
*
|
|
5975
|
+
* Saves variable data printing information to design file and updates design in storage.
|
|
3105
5976
|
* @param id Design identifier.
|
|
3106
5977
|
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
3107
5978
|
* @param tenantId (optional) Tenant identifier
|
|
5979
|
+
* @param body (optional) Serialized vdp data.
|
|
3108
5980
|
* @return Success
|
|
3109
5981
|
*/
|
|
3110
|
-
|
|
3111
|
-
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/
|
|
5982
|
+
saveVdpData(id, privateStorageOwner, tenantId, body, cancelToken) {
|
|
5983
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/vdp-data?";
|
|
3112
5984
|
if (id === undefined || id === null)
|
|
3113
5985
|
throw new Error("The parameter 'id' must be defined.");
|
|
3114
5986
|
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
@@ -3119,11 +5991,13 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3119
5991
|
else if (tenantId !== undefined)
|
|
3120
5992
|
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
3121
5993
|
url_ = url_.replace(/[?&]$/, "");
|
|
5994
|
+
const content_ = JSON.stringify(body);
|
|
3122
5995
|
let options_ = {
|
|
3123
|
-
|
|
5996
|
+
data: content_,
|
|
5997
|
+
method: "PUT",
|
|
3124
5998
|
url: url_,
|
|
3125
5999
|
headers: {
|
|
3126
|
-
"
|
|
6000
|
+
"Content-Type": "application/json",
|
|
3127
6001
|
},
|
|
3128
6002
|
cancelToken
|
|
3129
6003
|
};
|
|
@@ -3137,10 +6011,10 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3137
6011
|
throw _error;
|
|
3138
6012
|
}
|
|
3139
6013
|
}).then((_response) => {
|
|
3140
|
-
return this.transformResult(url_, _response, (_response) => this.
|
|
6014
|
+
return this.transformResult(url_, _response, (_response) => this.processSaveVdpData(_response));
|
|
3141
6015
|
});
|
|
3142
6016
|
}
|
|
3143
|
-
|
|
6017
|
+
processSaveVdpData(response) {
|
|
3144
6018
|
const status = response.status;
|
|
3145
6019
|
let _headers = {};
|
|
3146
6020
|
if (response.headers && typeof response.headers === "object") {
|
|
@@ -3152,10 +6026,7 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3152
6026
|
}
|
|
3153
6027
|
if (status === 200) {
|
|
3154
6028
|
const _responseText = response.data;
|
|
3155
|
-
|
|
3156
|
-
let resultData200 = _responseText;
|
|
3157
|
-
result200 = JSON.parse(resultData200);
|
|
3158
|
-
return Promise.resolve(result200);
|
|
6029
|
+
return Promise.resolve(null);
|
|
3159
6030
|
}
|
|
3160
6031
|
else if (status === 404) {
|
|
3161
6032
|
const _responseText = response.data;
|
|
@@ -3179,15 +6050,14 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3179
6050
|
return Promise.resolve(null);
|
|
3180
6051
|
}
|
|
3181
6052
|
/**
|
|
3182
|
-
*
|
|
6053
|
+
* Deletes variable data printing information from design file and updates design file in storage.
|
|
3183
6054
|
* @param id Design identifier.
|
|
3184
6055
|
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
3185
6056
|
* @param tenantId (optional) Tenant identifier
|
|
3186
|
-
* @param body (optional) Design variable values.
|
|
3187
6057
|
* @return Success
|
|
3188
6058
|
*/
|
|
3189
|
-
|
|
3190
|
-
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/
|
|
6059
|
+
deleteVdpData(id, privateStorageOwner, tenantId, cancelToken) {
|
|
6060
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/vdp-data?";
|
|
3191
6061
|
if (id === undefined || id === null)
|
|
3192
6062
|
throw new Error("The parameter 'id' must be defined.");
|
|
3193
6063
|
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
@@ -3198,14 +6068,10 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3198
6068
|
else if (tenantId !== undefined)
|
|
3199
6069
|
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
3200
6070
|
url_ = url_.replace(/[?&]$/, "");
|
|
3201
|
-
const content_ = JSON.stringify(body);
|
|
3202
6071
|
let options_ = {
|
|
3203
|
-
|
|
3204
|
-
method: "PUT",
|
|
6072
|
+
method: "DELETE",
|
|
3205
6073
|
url: url_,
|
|
3206
|
-
headers: {
|
|
3207
|
-
"Content-Type": "application/json",
|
|
3208
|
-
},
|
|
6074
|
+
headers: {},
|
|
3209
6075
|
cancelToken
|
|
3210
6076
|
};
|
|
3211
6077
|
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
@@ -3218,10 +6084,10 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3218
6084
|
throw _error;
|
|
3219
6085
|
}
|
|
3220
6086
|
}).then((_response) => {
|
|
3221
|
-
return this.transformResult(url_, _response, (_response) => this.
|
|
6087
|
+
return this.transformResult(url_, _response, (_response) => this.processDeleteVdpData(_response));
|
|
3222
6088
|
});
|
|
3223
6089
|
}
|
|
3224
|
-
|
|
6090
|
+
processDeleteVdpData(response) {
|
|
3225
6091
|
const status = response.status;
|
|
3226
6092
|
let _headers = {};
|
|
3227
6093
|
if (response.headers && typeof response.headers === "object") {
|
|
@@ -3235,13 +6101,6 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3235
6101
|
const _responseText = response.data;
|
|
3236
6102
|
return Promise.resolve(null);
|
|
3237
6103
|
}
|
|
3238
|
-
else if (status === 404) {
|
|
3239
|
-
const _responseText = response.data;
|
|
3240
|
-
let result404 = null;
|
|
3241
|
-
let resultData404 = _responseText;
|
|
3242
|
-
result404 = JSON.parse(resultData404);
|
|
3243
|
-
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
3244
|
-
}
|
|
3245
6104
|
else if (status === 409) {
|
|
3246
6105
|
const _responseText = response.data;
|
|
3247
6106
|
let result409 = null;
|
|
@@ -3264,28 +6123,25 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3264
6123
|
return Promise.resolve(null);
|
|
3265
6124
|
}
|
|
3266
6125
|
/**
|
|
3267
|
-
*
|
|
3268
|
-
* @param id Design identifier.
|
|
3269
|
-
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
6126
|
+
* Converts colors for print-product item manipulations.
|
|
3270
6127
|
* @param tenantId (optional) Tenant identifier
|
|
6128
|
+
* @param body (optional) Convert colors operation parameters.
|
|
3271
6129
|
* @return Success
|
|
3272
6130
|
*/
|
|
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) + "&";
|
|
6131
|
+
convertColors(tenantId, body, cancelToken) {
|
|
6132
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/print-product/convert-colors?";
|
|
3280
6133
|
if (tenantId === null)
|
|
3281
6134
|
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
3282
6135
|
else if (tenantId !== undefined)
|
|
3283
6136
|
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
3284
6137
|
url_ = url_.replace(/[?&]$/, "");
|
|
6138
|
+
const content_ = JSON.stringify(body);
|
|
3285
6139
|
let options_ = {
|
|
3286
|
-
|
|
6140
|
+
data: content_,
|
|
6141
|
+
method: "POST",
|
|
3287
6142
|
url: url_,
|
|
3288
6143
|
headers: {
|
|
6144
|
+
"Content-Type": "application/json",
|
|
3289
6145
|
"Accept": "application/json"
|
|
3290
6146
|
},
|
|
3291
6147
|
cancelToken
|
|
@@ -3300,10 +6156,10 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3300
6156
|
throw _error;
|
|
3301
6157
|
}
|
|
3302
6158
|
}).then((_response) => {
|
|
3303
|
-
return this.transformResult(url_, _response, (_response) => this.
|
|
6159
|
+
return this.transformResult(url_, _response, (_response) => this.processConvertColors(_response));
|
|
3304
6160
|
});
|
|
3305
6161
|
}
|
|
3306
|
-
|
|
6162
|
+
processConvertColors(response) {
|
|
3307
6163
|
const status = response.status;
|
|
3308
6164
|
let _headers = {};
|
|
3309
6165
|
if (response.headers && typeof response.headers === "object") {
|
|
@@ -3327,13 +6183,6 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3327
6183
|
result404 = JSON.parse(resultData404);
|
|
3328
6184
|
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
3329
6185
|
}
|
|
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);
|
|
3336
|
-
}
|
|
3337
6186
|
else if (status === 401) {
|
|
3338
6187
|
const _responseText = response.data;
|
|
3339
6188
|
return throwException("Unauthorized", status, _responseText, _headers);
|
|
@@ -3349,18 +6198,16 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3349
6198
|
return Promise.resolve(null);
|
|
3350
6199
|
}
|
|
3351
6200
|
/**
|
|
3352
|
-
*
|
|
3353
|
-
* @param id
|
|
6201
|
+
* Loads print-product from resource file taken from storage.
|
|
6202
|
+
* @param id (optional) Resource identifier.
|
|
3354
6203
|
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
3355
6204
|
* @param tenantId (optional) Tenant identifier
|
|
3356
|
-
* @param body (optional) Serialized vdp data.
|
|
3357
6205
|
* @return Success
|
|
3358
6206
|
*/
|
|
3359
|
-
|
|
3360
|
-
let url_ = this.baseUrl + "/api/atoms/v1/designs/
|
|
3361
|
-
if (id
|
|
3362
|
-
|
|
3363
|
-
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
6207
|
+
loadProductFromResource(id, privateStorageOwner, tenantId, cancelToken) {
|
|
6208
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/print-product/from-resource/model?";
|
|
6209
|
+
if (id !== undefined && id !== null)
|
|
6210
|
+
url_ += "id=" + encodeURIComponent("" + id) + "&";
|
|
3364
6211
|
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
3365
6212
|
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
3366
6213
|
if (tenantId === null)
|
|
@@ -3368,13 +6215,11 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3368
6215
|
else if (tenantId !== undefined)
|
|
3369
6216
|
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
3370
6217
|
url_ = url_.replace(/[?&]$/, "");
|
|
3371
|
-
const content_ = JSON.stringify(body);
|
|
3372
6218
|
let options_ = {
|
|
3373
|
-
|
|
3374
|
-
method: "PUT",
|
|
6219
|
+
method: "GET",
|
|
3375
6220
|
url: url_,
|
|
3376
6221
|
headers: {
|
|
3377
|
-
"
|
|
6222
|
+
"Accept": "application/json"
|
|
3378
6223
|
},
|
|
3379
6224
|
cancelToken
|
|
3380
6225
|
};
|
|
@@ -3388,10 +6233,10 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3388
6233
|
throw _error;
|
|
3389
6234
|
}
|
|
3390
6235
|
}).then((_response) => {
|
|
3391
|
-
return this.transformResult(url_, _response, (_response) => this.
|
|
6236
|
+
return this.transformResult(url_, _response, (_response) => this.processLoadProductFromResource(_response));
|
|
3392
6237
|
});
|
|
3393
6238
|
}
|
|
3394
|
-
|
|
6239
|
+
processLoadProductFromResource(response) {
|
|
3395
6240
|
const status = response.status;
|
|
3396
6241
|
let _headers = {};
|
|
3397
6242
|
if (response.headers && typeof response.headers === "object") {
|
|
@@ -3403,7 +6248,10 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3403
6248
|
}
|
|
3404
6249
|
if (status === 200) {
|
|
3405
6250
|
const _responseText = response.data;
|
|
3406
|
-
|
|
6251
|
+
let result200 = null;
|
|
6252
|
+
let resultData200 = _responseText;
|
|
6253
|
+
result200 = JSON.parse(resultData200);
|
|
6254
|
+
return Promise.resolve(result200);
|
|
3407
6255
|
}
|
|
3408
6256
|
else if (status === 404) {
|
|
3409
6257
|
const _responseText = response.data;
|
|
@@ -3412,6 +6260,13 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3412
6260
|
result404 = JSON.parse(resultData404);
|
|
3413
6261
|
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
3414
6262
|
}
|
|
6263
|
+
else if (status === 409) {
|
|
6264
|
+
const _responseText = response.data;
|
|
6265
|
+
let result409 = null;
|
|
6266
|
+
let resultData409 = _responseText;
|
|
6267
|
+
result409 = JSON.parse(resultData409);
|
|
6268
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
6269
|
+
}
|
|
3415
6270
|
else if (status === 401) {
|
|
3416
6271
|
const _responseText = response.data;
|
|
3417
6272
|
return throwException("Unauthorized", status, _responseText, _headers);
|
|
@@ -3427,28 +6282,32 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3427
6282
|
return Promise.resolve(null);
|
|
3428
6283
|
}
|
|
3429
6284
|
/**
|
|
3430
|
-
*
|
|
3431
|
-
* @param
|
|
3432
|
-
|
|
6285
|
+
* Renders a product proof image with specified parameters.
|
|
6286
|
+
* @param attachment (optional) If set to 'true', file will be provided as an attachment with unique filename supplied
|
|
6287
|
+
(default value is 'false').
|
|
3433
6288
|
* @param tenantId (optional) Tenant identifier
|
|
6289
|
+
* @param body (optional) Preview parameters.
|
|
3434
6290
|
* @return Success
|
|
3435
6291
|
*/
|
|
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) + "&";
|
|
6292
|
+
renderProduct(attachment, tenantId, body, cancelToken) {
|
|
6293
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/print-product/render-proof?";
|
|
6294
|
+
if (attachment !== undefined && attachment !== null)
|
|
6295
|
+
url_ += "attachment=" + encodeURIComponent("" + attachment) + "&";
|
|
3443
6296
|
if (tenantId === null)
|
|
3444
6297
|
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
3445
6298
|
else if (tenantId !== undefined)
|
|
3446
6299
|
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
3447
6300
|
url_ = url_.replace(/[?&]$/, "");
|
|
6301
|
+
const content_ = JSON.stringify(body);
|
|
3448
6302
|
let options_ = {
|
|
3449
|
-
|
|
6303
|
+
data: content_,
|
|
6304
|
+
responseType: "blob",
|
|
6305
|
+
method: "POST",
|
|
3450
6306
|
url: url_,
|
|
3451
|
-
headers: {
|
|
6307
|
+
headers: {
|
|
6308
|
+
"Content-Type": "application/json",
|
|
6309
|
+
"Accept": "application/octet-stream"
|
|
6310
|
+
},
|
|
3452
6311
|
cancelToken
|
|
3453
6312
|
};
|
|
3454
6313
|
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
@@ -3461,10 +6320,10 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3461
6320
|
throw _error;
|
|
3462
6321
|
}
|
|
3463
6322
|
}).then((_response) => {
|
|
3464
|
-
return this.transformResult(url_, _response, (_response) => this.
|
|
6323
|
+
return this.transformResult(url_, _response, (_response) => this.processRenderProduct(_response));
|
|
3465
6324
|
});
|
|
3466
6325
|
}
|
|
3467
|
-
|
|
6326
|
+
processRenderProduct(response) {
|
|
3468
6327
|
const status = response.status;
|
|
3469
6328
|
let _headers = {};
|
|
3470
6329
|
if (response.headers && typeof response.headers === "object") {
|
|
@@ -3474,16 +6333,11 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3474
6333
|
}
|
|
3475
6334
|
}
|
|
3476
6335
|
}
|
|
3477
|
-
if (status === 200) {
|
|
3478
|
-
const
|
|
3479
|
-
|
|
3480
|
-
|
|
3481
|
-
|
|
3482
|
-
const _responseText = response.data;
|
|
3483
|
-
let result409 = null;
|
|
3484
|
-
let resultData409 = _responseText;
|
|
3485
|
-
result409 = JSON.parse(resultData409);
|
|
3486
|
-
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
6336
|
+
if (status === 200 || status === 206) {
|
|
6337
|
+
const contentDisposition = response.headers ? response.headers["content-disposition"] : undefined;
|
|
6338
|
+
const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
|
|
6339
|
+
const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
|
|
6340
|
+
return Promise.resolve({ fileName: fileName, status: status, data: new Blob([response.data]), headers: _headers });
|
|
3487
6341
|
}
|
|
3488
6342
|
else if (status === 401) {
|
|
3489
6343
|
const _responseText = response.data;
|
|
@@ -3500,29 +6354,31 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3500
6354
|
return Promise.resolve(null);
|
|
3501
6355
|
}
|
|
3502
6356
|
/**
|
|
3503
|
-
*
|
|
3504
|
-
* @param
|
|
3505
|
-
|
|
6357
|
+
* Renders a design preview with the specified parameters.
|
|
6358
|
+
* @param attachment (optional) If set to 'true', file will be provided as an attachment with unique filename supplied
|
|
6359
|
+
(default value is 'false').
|
|
3506
6360
|
* @param tenantId (optional) Tenant identifier
|
|
6361
|
+
* @param body (optional) Render model with preview parameters.
|
|
3507
6362
|
* @return Success
|
|
3508
6363
|
*/
|
|
3509
|
-
|
|
3510
|
-
let url_ = this.baseUrl + "/api/atoms/v1/designs/
|
|
3511
|
-
if (
|
|
3512
|
-
|
|
3513
|
-
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
3514
|
-
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
3515
|
-
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
6364
|
+
renderDesignPreview(attachment, tenantId, body, cancelToken) {
|
|
6365
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/render-preview?";
|
|
6366
|
+
if (attachment !== undefined && attachment !== null)
|
|
6367
|
+
url_ += "attachment=" + encodeURIComponent("" + attachment) + "&";
|
|
3516
6368
|
if (tenantId === null)
|
|
3517
6369
|
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
3518
6370
|
else if (tenantId !== undefined)
|
|
3519
6371
|
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
3520
6372
|
url_ = url_.replace(/[?&]$/, "");
|
|
6373
|
+
const content_ = JSON.stringify(body);
|
|
3521
6374
|
let options_ = {
|
|
3522
|
-
|
|
6375
|
+
data: content_,
|
|
6376
|
+
responseType: "blob",
|
|
6377
|
+
method: "POST",
|
|
3523
6378
|
url: url_,
|
|
3524
6379
|
headers: {
|
|
3525
|
-
"
|
|
6380
|
+
"Content-Type": "application/json",
|
|
6381
|
+
"Accept": "application/octet-stream"
|
|
3526
6382
|
},
|
|
3527
6383
|
cancelToken
|
|
3528
6384
|
};
|
|
@@ -3536,10 +6392,10 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3536
6392
|
throw _error;
|
|
3537
6393
|
}
|
|
3538
6394
|
}).then((_response) => {
|
|
3539
|
-
return this.transformResult(url_, _response, (_response) => this.
|
|
6395
|
+
return this.transformResult(url_, _response, (_response) => this.processRenderDesignPreview(_response));
|
|
3540
6396
|
});
|
|
3541
6397
|
}
|
|
3542
|
-
|
|
6398
|
+
processRenderDesignPreview(response) {
|
|
3543
6399
|
const status = response.status;
|
|
3544
6400
|
let _headers = {};
|
|
3545
6401
|
if (response.headers && typeof response.headers === "object") {
|
|
@@ -3549,26 +6405,11 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3549
6405
|
}
|
|
3550
6406
|
}
|
|
3551
6407
|
}
|
|
3552
|
-
if (status === 200) {
|
|
3553
|
-
const
|
|
3554
|
-
|
|
3555
|
-
|
|
3556
|
-
|
|
3557
|
-
return Promise.resolve(result200);
|
|
3558
|
-
}
|
|
3559
|
-
else if (status === 404) {
|
|
3560
|
-
const _responseText = response.data;
|
|
3561
|
-
let result404 = null;
|
|
3562
|
-
let resultData404 = _responseText;
|
|
3563
|
-
result404 = JSON.parse(resultData404);
|
|
3564
|
-
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
3565
|
-
}
|
|
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);
|
|
6408
|
+
if (status === 200 || status === 206) {
|
|
6409
|
+
const contentDisposition = response.headers ? response.headers["content-disposition"] : undefined;
|
|
6410
|
+
const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
|
|
6411
|
+
const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
|
|
6412
|
+
return Promise.resolve({ fileName: fileName, status: status, data: new Blob([response.data]), headers: _headers });
|
|
3572
6413
|
}
|
|
3573
6414
|
else if (status === 401) {
|
|
3574
6415
|
const _responseText = response.data;
|
|
@@ -3585,13 +6426,13 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3585
6426
|
return Promise.resolve(null);
|
|
3586
6427
|
}
|
|
3587
6428
|
/**
|
|
3588
|
-
*
|
|
6429
|
+
* Renders a design preview with the specified parameters and saves rendering result as resource.
|
|
3589
6430
|
* @param tenantId (optional) Tenant identifier
|
|
3590
|
-
* @param body (optional)
|
|
6431
|
+
* @param body (optional) Render model with preview parameters.
|
|
3591
6432
|
* @return Success
|
|
3592
6433
|
*/
|
|
3593
|
-
|
|
3594
|
-
let url_ = this.baseUrl + "/api/atoms/v1/designs/
|
|
6434
|
+
renderDesignPreviewToResource(tenantId, body, cancelToken) {
|
|
6435
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/render-preview/to-resource?";
|
|
3595
6436
|
if (tenantId === null)
|
|
3596
6437
|
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
3597
6438
|
else if (tenantId !== undefined)
|
|
@@ -3618,10 +6459,10 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3618
6459
|
throw _error;
|
|
3619
6460
|
}
|
|
3620
6461
|
}).then((_response) => {
|
|
3621
|
-
return this.transformResult(url_, _response, (_response) => this.
|
|
6462
|
+
return this.transformResult(url_, _response, (_response) => this.processRenderDesignPreviewToResource(_response));
|
|
3622
6463
|
});
|
|
3623
6464
|
}
|
|
3624
|
-
|
|
6465
|
+
processRenderDesignPreviewToResource(response) {
|
|
3625
6466
|
const status = response.status;
|
|
3626
6467
|
let _headers = {};
|
|
3627
6468
|
if (response.headers && typeof response.headers === "object") {
|
|
@@ -3638,12 +6479,12 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3638
6479
|
result200 = JSON.parse(resultData200);
|
|
3639
6480
|
return Promise.resolve(result200);
|
|
3640
6481
|
}
|
|
3641
|
-
else if (status ===
|
|
6482
|
+
else if (status === 409) {
|
|
3642
6483
|
const _responseText = response.data;
|
|
3643
|
-
let
|
|
3644
|
-
let
|
|
3645
|
-
|
|
3646
|
-
return throwException("
|
|
6484
|
+
let result409 = null;
|
|
6485
|
+
let resultData409 = _responseText;
|
|
6486
|
+
result409 = JSON.parse(resultData409);
|
|
6487
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
3647
6488
|
}
|
|
3648
6489
|
else if (status === 401) {
|
|
3649
6490
|
const _responseText = response.data;
|
|
@@ -3660,39 +6501,31 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3660
6501
|
return Promise.resolve(null);
|
|
3661
6502
|
}
|
|
3662
6503
|
/**
|
|
3663
|
-
*
|
|
3664
|
-
* @param
|
|
6504
|
+
* Renders a design proof with the specified parameters.
|
|
6505
|
+
* @param attachment (optional) If set to 'true', file will be provided as an attachment with unique filename supplied
|
|
6506
|
+
(default value is 'false').
|
|
3665
6507
|
* @param tenantId (optional) Tenant identifier
|
|
3666
|
-
* @param
|
|
3667
|
-
* @param sourceId (optional)
|
|
3668
|
-
* @param sourceOwnerId (optional)
|
|
3669
|
-
* @param sourceFile (optional)
|
|
6508
|
+
* @param body (optional) Render model with proof parameters.
|
|
3670
6509
|
* @return Success
|
|
3671
6510
|
*/
|
|
3672
|
-
|
|
3673
|
-
let url_ = this.baseUrl + "/api/atoms/v1/designs/
|
|
3674
|
-
if (
|
|
3675
|
-
url_ += "
|
|
6511
|
+
renderDesignProof(attachment, tenantId, body, cancelToken) {
|
|
6512
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/render-proof?";
|
|
6513
|
+
if (attachment !== undefined && attachment !== null)
|
|
6514
|
+
url_ += "attachment=" + encodeURIComponent("" + attachment) + "&";
|
|
3676
6515
|
if (tenantId === null)
|
|
3677
6516
|
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
3678
6517
|
else if (tenantId !== undefined)
|
|
3679
6518
|
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
3680
6519
|
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");
|
|
6520
|
+
const content_ = JSON.stringify(body);
|
|
3690
6521
|
let options_ = {
|
|
3691
6522
|
data: content_,
|
|
6523
|
+
responseType: "blob",
|
|
3692
6524
|
method: "POST",
|
|
3693
6525
|
url: url_,
|
|
3694
6526
|
headers: {
|
|
3695
|
-
"
|
|
6527
|
+
"Content-Type": "application/json",
|
|
6528
|
+
"Accept": "application/octet-stream"
|
|
3696
6529
|
},
|
|
3697
6530
|
cancelToken
|
|
3698
6531
|
};
|
|
@@ -3706,10 +6539,10 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3706
6539
|
throw _error;
|
|
3707
6540
|
}
|
|
3708
6541
|
}).then((_response) => {
|
|
3709
|
-
return this.transformResult(url_, _response, (_response) => this.
|
|
6542
|
+
return this.transformResult(url_, _response, (_response) => this.processRenderDesignProof(_response));
|
|
3710
6543
|
});
|
|
3711
6544
|
}
|
|
3712
|
-
|
|
6545
|
+
processRenderDesignProof(response) {
|
|
3713
6546
|
const status = response.status;
|
|
3714
6547
|
let _headers = {};
|
|
3715
6548
|
if (response.headers && typeof response.headers === "object") {
|
|
@@ -3719,19 +6552,11 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3719
6552
|
}
|
|
3720
6553
|
}
|
|
3721
6554
|
}
|
|
3722
|
-
if (status === 200) {
|
|
3723
|
-
const
|
|
3724
|
-
|
|
3725
|
-
|
|
3726
|
-
|
|
3727
|
-
return Promise.resolve(result200);
|
|
3728
|
-
}
|
|
3729
|
-
else if (status === 404) {
|
|
3730
|
-
const _responseText = response.data;
|
|
3731
|
-
let result404 = null;
|
|
3732
|
-
let resultData404 = _responseText;
|
|
3733
|
-
result404 = JSON.parse(resultData404);
|
|
3734
|
-
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
6555
|
+
if (status === 200 || status === 206) {
|
|
6556
|
+
const contentDisposition = response.headers ? response.headers["content-disposition"] : undefined;
|
|
6557
|
+
const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
|
|
6558
|
+
const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
|
|
6559
|
+
return Promise.resolve({ fileName: fileName, status: status, data: new Blob([response.data]), headers: _headers });
|
|
3735
6560
|
}
|
|
3736
6561
|
else if (status === 401) {
|
|
3737
6562
|
const _responseText = response.data;
|
|
@@ -3748,13 +6573,13 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3748
6573
|
return Promise.resolve(null);
|
|
3749
6574
|
}
|
|
3750
6575
|
/**
|
|
3751
|
-
*
|
|
6576
|
+
* Renders a design proof with the specified parameters and saves rendering result as resource.
|
|
3752
6577
|
* @param tenantId (optional) Tenant identifier
|
|
3753
|
-
* @param body (optional)
|
|
6578
|
+
* @param body (optional) Render model with preview parameters.
|
|
3754
6579
|
* @return Success
|
|
3755
6580
|
*/
|
|
3756
|
-
|
|
3757
|
-
let url_ = this.baseUrl + "/api/atoms/v1/designs/
|
|
6581
|
+
renderDesignProofToResource(tenantId, body, cancelToken) {
|
|
6582
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/render-proof/to-resource?";
|
|
3758
6583
|
if (tenantId === null)
|
|
3759
6584
|
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
3760
6585
|
else if (tenantId !== undefined)
|
|
@@ -3763,12 +6588,11 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3763
6588
|
const content_ = JSON.stringify(body);
|
|
3764
6589
|
let options_ = {
|
|
3765
6590
|
data: content_,
|
|
3766
|
-
responseType: "blob",
|
|
3767
6591
|
method: "POST",
|
|
3768
6592
|
url: url_,
|
|
3769
6593
|
headers: {
|
|
3770
6594
|
"Content-Type": "application/json",
|
|
3771
|
-
"Accept": "application/
|
|
6595
|
+
"Accept": "application/json"
|
|
3772
6596
|
},
|
|
3773
6597
|
cancelToken
|
|
3774
6598
|
};
|
|
@@ -3782,10 +6606,10 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3782
6606
|
throw _error;
|
|
3783
6607
|
}
|
|
3784
6608
|
}).then((_response) => {
|
|
3785
|
-
return this.transformResult(url_, _response, (_response) => this.
|
|
6609
|
+
return this.transformResult(url_, _response, (_response) => this.processRenderDesignProofToResource(_response));
|
|
3786
6610
|
});
|
|
3787
6611
|
}
|
|
3788
|
-
|
|
6612
|
+
processRenderDesignProofToResource(response) {
|
|
3789
6613
|
const status = response.status;
|
|
3790
6614
|
let _headers = {};
|
|
3791
6615
|
if (response.headers && typeof response.headers === "object") {
|
|
@@ -3795,11 +6619,19 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3795
6619
|
}
|
|
3796
6620
|
}
|
|
3797
6621
|
}
|
|
3798
|
-
if (status === 200
|
|
3799
|
-
const
|
|
3800
|
-
|
|
3801
|
-
|
|
3802
|
-
|
|
6622
|
+
if (status === 200) {
|
|
6623
|
+
const _responseText = response.data;
|
|
6624
|
+
let result200 = null;
|
|
6625
|
+
let resultData200 = _responseText;
|
|
6626
|
+
result200 = JSON.parse(resultData200);
|
|
6627
|
+
return Promise.resolve(result200);
|
|
6628
|
+
}
|
|
6629
|
+
else if (status === 409) {
|
|
6630
|
+
const _responseText = response.data;
|
|
6631
|
+
let result409 = null;
|
|
6632
|
+
let resultData409 = _responseText;
|
|
6633
|
+
result409 = JSON.parse(resultData409);
|
|
6634
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
3803
6635
|
}
|
|
3804
6636
|
else if (status === 401) {
|
|
3805
6637
|
const _responseText = response.data;
|
|
@@ -3816,25 +6648,29 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3816
6648
|
return Promise.resolve(null);
|
|
3817
6649
|
}
|
|
3818
6650
|
/**
|
|
3819
|
-
*
|
|
6651
|
+
* Loads print-product from design file taken from storage.
|
|
6652
|
+
* @param id Design identifier.
|
|
6653
|
+
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
3820
6654
|
* @param tenantId (optional) Tenant identifier
|
|
3821
|
-
* @param body (optional) Items to flatten.
|
|
3822
6655
|
* @return Success
|
|
6656
|
+
* @deprecated
|
|
3823
6657
|
*/
|
|
3824
|
-
|
|
3825
|
-
let url_ = this.baseUrl + "/api/atoms/v1/designs/model
|
|
6658
|
+
loadProduct(id, privateStorageOwner, tenantId, cancelToken) {
|
|
6659
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/model?";
|
|
6660
|
+
if (id === undefined || id === null)
|
|
6661
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
6662
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
6663
|
+
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
6664
|
+
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
3826
6665
|
if (tenantId === null)
|
|
3827
6666
|
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
3828
6667
|
else if (tenantId !== undefined)
|
|
3829
6668
|
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
3830
6669
|
url_ = url_.replace(/[?&]$/, "");
|
|
3831
|
-
const content_ = JSON.stringify(body);
|
|
3832
6670
|
let options_ = {
|
|
3833
|
-
|
|
3834
|
-
method: "POST",
|
|
6671
|
+
method: "GET",
|
|
3835
6672
|
url: url_,
|
|
3836
6673
|
headers: {
|
|
3837
|
-
"Content-Type": "application/json",
|
|
3838
6674
|
"Accept": "application/json"
|
|
3839
6675
|
},
|
|
3840
6676
|
cancelToken
|
|
@@ -3849,10 +6685,10 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3849
6685
|
throw _error;
|
|
3850
6686
|
}
|
|
3851
6687
|
}).then((_response) => {
|
|
3852
|
-
return this.transformResult(url_, _response, (_response) => this.
|
|
6688
|
+
return this.transformResult(url_, _response, (_response) => this.processLoadProduct(_response));
|
|
3853
6689
|
});
|
|
3854
6690
|
}
|
|
3855
|
-
|
|
6691
|
+
processLoadProduct(response) {
|
|
3856
6692
|
const status = response.status;
|
|
3857
6693
|
let _headers = {};
|
|
3858
6694
|
if (response.headers && typeof response.headers === "object") {
|
|
@@ -3869,6 +6705,13 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3869
6705
|
result200 = JSON.parse(resultData200);
|
|
3870
6706
|
return Promise.resolve(result200);
|
|
3871
6707
|
}
|
|
6708
|
+
else if (status === 404) {
|
|
6709
|
+
const _responseText = response.data;
|
|
6710
|
+
let result404 = null;
|
|
6711
|
+
let resultData404 = _responseText;
|
|
6712
|
+
result404 = JSON.parse(resultData404);
|
|
6713
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
6714
|
+
}
|
|
3872
6715
|
else if (status === 401) {
|
|
3873
6716
|
const _responseText = response.data;
|
|
3874
6717
|
return throwException("Unauthorized", status, _responseText, _headers);
|
|
@@ -3884,17 +6727,21 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3884
6727
|
return Promise.resolve(null);
|
|
3885
6728
|
}
|
|
3886
6729
|
/**
|
|
3887
|
-
*
|
|
3888
|
-
* @param
|
|
3889
|
-
|
|
6730
|
+
* Saves print-product to design file and updates design file in storage.
|
|
6731
|
+
* @param id Design identifier.
|
|
6732
|
+
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
3890
6733
|
* @param tenantId (optional) Tenant identifier
|
|
3891
|
-
* @param body (optional)
|
|
6734
|
+
* @param body (optional) Serialized product description.
|
|
3892
6735
|
* @return Success
|
|
6736
|
+
* @deprecated
|
|
3893
6737
|
*/
|
|
3894
|
-
|
|
3895
|
-
let url_ = this.baseUrl + "/api/atoms/v1/designs/model
|
|
3896
|
-
if (
|
|
3897
|
-
|
|
6738
|
+
saveProduct(id, privateStorageOwner, tenantId, body, cancelToken) {
|
|
6739
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/model?";
|
|
6740
|
+
if (id === undefined || id === null)
|
|
6741
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
6742
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
6743
|
+
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
6744
|
+
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
3898
6745
|
if (tenantId === null)
|
|
3899
6746
|
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
3900
6747
|
else if (tenantId !== undefined)
|
|
@@ -3903,12 +6750,10 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3903
6750
|
const content_ = JSON.stringify(body);
|
|
3904
6751
|
let options_ = {
|
|
3905
6752
|
data: content_,
|
|
3906
|
-
|
|
3907
|
-
method: "POST",
|
|
6753
|
+
method: "PUT",
|
|
3908
6754
|
url: url_,
|
|
3909
6755
|
headers: {
|
|
3910
6756
|
"Content-Type": "application/json",
|
|
3911
|
-
"Accept": "application/octet-stream"
|
|
3912
6757
|
},
|
|
3913
6758
|
cancelToken
|
|
3914
6759
|
};
|
|
@@ -3922,10 +6767,10 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3922
6767
|
throw _error;
|
|
3923
6768
|
}
|
|
3924
6769
|
}).then((_response) => {
|
|
3925
|
-
return this.transformResult(url_, _response, (_response) => this.
|
|
6770
|
+
return this.transformResult(url_, _response, (_response) => this.processSaveProduct(_response));
|
|
3926
6771
|
});
|
|
3927
6772
|
}
|
|
3928
|
-
|
|
6773
|
+
processSaveProduct(response) {
|
|
3929
6774
|
const status = response.status;
|
|
3930
6775
|
let _headers = {};
|
|
3931
6776
|
if (response.headers && typeof response.headers === "object") {
|
|
@@ -3935,11 +6780,16 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3935
6780
|
}
|
|
3936
6781
|
}
|
|
3937
6782
|
}
|
|
3938
|
-
if (status === 200
|
|
3939
|
-
const
|
|
3940
|
-
|
|
3941
|
-
|
|
3942
|
-
|
|
6783
|
+
if (status === 200) {
|
|
6784
|
+
const _responseText = response.data;
|
|
6785
|
+
return Promise.resolve(null);
|
|
6786
|
+
}
|
|
6787
|
+
else if (status === 404) {
|
|
6788
|
+
const _responseText = response.data;
|
|
6789
|
+
let result404 = null;
|
|
6790
|
+
let resultData404 = _responseText;
|
|
6791
|
+
result404 = JSON.parse(resultData404);
|
|
6792
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
3943
6793
|
}
|
|
3944
6794
|
else if (status === 401) {
|
|
3945
6795
|
const _responseText = response.data;
|
|
@@ -3956,32 +6806,53 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3956
6806
|
return Promise.resolve(null);
|
|
3957
6807
|
}
|
|
3958
6808
|
/**
|
|
3959
|
-
*
|
|
3960
|
-
* @param
|
|
3961
|
-
|
|
6809
|
+
* Patches print-product in design file.
|
|
6810
|
+
* @param id Design identifier.
|
|
6811
|
+
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
3962
6812
|
* @param tenantId (optional) Tenant identifier
|
|
3963
|
-
* @param
|
|
6813
|
+
* @param patchType (optional)
|
|
6814
|
+
* @param replaceImageItemFileInfo_itemName (optional)
|
|
6815
|
+
* @param replaceImageItemFileInfo_sourceFile (optional)
|
|
6816
|
+
* @param replacePlaceholderItemContentInfo_placeholderItemName (optional)
|
|
6817
|
+
* @param replacePlaceholderItemContentInfo_newContentType (optional)
|
|
6818
|
+
* @param replacePlaceholderItemContentInfo_sourceFile (optional)
|
|
3964
6819
|
* @return Success
|
|
6820
|
+
* @deprecated
|
|
3965
6821
|
*/
|
|
3966
|
-
|
|
3967
|
-
let url_ = this.baseUrl + "/api/atoms/v1/designs/
|
|
3968
|
-
if (
|
|
3969
|
-
|
|
6822
|
+
patchProduct(id, privateStorageOwner, tenantId, patchType, replaceImageItemFileInfo_itemName, replaceImageItemFileInfo_sourceFile, replacePlaceholderItemContentInfo_placeholderItemName, replacePlaceholderItemContentInfo_newContentType, replacePlaceholderItemContentInfo_sourceFile, cancelToken) {
|
|
6823
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/model?";
|
|
6824
|
+
if (id === undefined || id === null)
|
|
6825
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
6826
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
6827
|
+
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
6828
|
+
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
3970
6829
|
if (tenantId === null)
|
|
3971
6830
|
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
3972
6831
|
else if (tenantId !== undefined)
|
|
3973
6832
|
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
3974
6833
|
url_ = url_.replace(/[?&]$/, "");
|
|
3975
|
-
const content_ =
|
|
6834
|
+
const content_ = new FormData();
|
|
6835
|
+
if (patchType === null || patchType === undefined)
|
|
6836
|
+
throw new Error("The parameter 'patchType' cannot be null.");
|
|
6837
|
+
else
|
|
6838
|
+
content_.append("patchType", patchType.toString());
|
|
6839
|
+
if (replaceImageItemFileInfo_itemName !== null && replaceImageItemFileInfo_itemName !== undefined)
|
|
6840
|
+
content_.append("replaceImageItemFileInfo.itemName", replaceImageItemFileInfo_itemName.toString());
|
|
6841
|
+
if (replaceImageItemFileInfo_sourceFile !== null && replaceImageItemFileInfo_sourceFile !== undefined)
|
|
6842
|
+
content_.append("replaceImageItemFileInfo.sourceFile", replaceImageItemFileInfo_sourceFile.data, replaceImageItemFileInfo_sourceFile.fileName ? replaceImageItemFileInfo_sourceFile.fileName : "replaceImageItemFileInfo.sourceFile");
|
|
6843
|
+
if (replacePlaceholderItemContentInfo_placeholderItemName !== null && replacePlaceholderItemContentInfo_placeholderItemName !== undefined)
|
|
6844
|
+
content_.append("replacePlaceholderItemContentInfo.placeholderItemName", replacePlaceholderItemContentInfo_placeholderItemName.toString());
|
|
6845
|
+
if (replacePlaceholderItemContentInfo_newContentType === null || replacePlaceholderItemContentInfo_newContentType === undefined)
|
|
6846
|
+
throw new Error("The parameter 'replacePlaceholderItemContentInfo_newContentType' cannot be null.");
|
|
6847
|
+
else
|
|
6848
|
+
content_.append("replacePlaceholderItemContentInfo.newContentType", replacePlaceholderItemContentInfo_newContentType.toString());
|
|
6849
|
+
if (replacePlaceholderItemContentInfo_sourceFile !== null && replacePlaceholderItemContentInfo_sourceFile !== undefined)
|
|
6850
|
+
content_.append("replacePlaceholderItemContentInfo.sourceFile", replacePlaceholderItemContentInfo_sourceFile.data, replacePlaceholderItemContentInfo_sourceFile.fileName ? replacePlaceholderItemContentInfo_sourceFile.fileName : "replacePlaceholderItemContentInfo.sourceFile");
|
|
3976
6851
|
let options_ = {
|
|
3977
6852
|
data: content_,
|
|
3978
|
-
|
|
3979
|
-
method: "POST",
|
|
6853
|
+
method: "PATCH",
|
|
3980
6854
|
url: url_,
|
|
3981
|
-
headers: {
|
|
3982
|
-
"Content-Type": "application/json",
|
|
3983
|
-
"Accept": "application/octet-stream"
|
|
3984
|
-
},
|
|
6855
|
+
headers: {},
|
|
3985
6856
|
cancelToken
|
|
3986
6857
|
};
|
|
3987
6858
|
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
@@ -3994,10 +6865,10 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3994
6865
|
throw _error;
|
|
3995
6866
|
}
|
|
3996
6867
|
}).then((_response) => {
|
|
3997
|
-
return this.transformResult(url_, _response, (_response) => this.
|
|
6868
|
+
return this.transformResult(url_, _response, (_response) => this.processPatchProduct(_response));
|
|
3998
6869
|
});
|
|
3999
6870
|
}
|
|
4000
|
-
|
|
6871
|
+
processPatchProduct(response) {
|
|
4001
6872
|
const status = response.status;
|
|
4002
6873
|
let _headers = {};
|
|
4003
6874
|
if (response.headers && typeof response.headers === "object") {
|
|
@@ -4007,11 +6878,16 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
4007
6878
|
}
|
|
4008
6879
|
}
|
|
4009
6880
|
}
|
|
4010
|
-
if (status === 200
|
|
4011
|
-
const
|
|
4012
|
-
|
|
4013
|
-
|
|
4014
|
-
|
|
6881
|
+
if (status === 200) {
|
|
6882
|
+
const _responseText = response.data;
|
|
6883
|
+
return Promise.resolve(null);
|
|
6884
|
+
}
|
|
6885
|
+
else if (status === 404) {
|
|
6886
|
+
const _responseText = response.data;
|
|
6887
|
+
let result404 = null;
|
|
6888
|
+
let resultData404 = _responseText;
|
|
6889
|
+
result404 = JSON.parse(resultData404);
|
|
6890
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
4015
6891
|
}
|
|
4016
6892
|
else if (status === 401) {
|
|
4017
6893
|
const _responseText = response.data;
|
|
@@ -4028,25 +6904,42 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
4028
6904
|
return Promise.resolve(null);
|
|
4029
6905
|
}
|
|
4030
6906
|
/**
|
|
4031
|
-
*
|
|
6907
|
+
* Creates print-product item.
|
|
6908
|
+
* @param itemType (optional) Desired item type.
|
|
4032
6909
|
* @param tenantId (optional) Tenant identifier
|
|
4033
|
-
* @param
|
|
6910
|
+
* @param sourceType (optional)
|
|
6911
|
+
* @param sourceId (optional)
|
|
6912
|
+
* @param sourceOwnerId (optional)
|
|
6913
|
+
* @param url (optional)
|
|
6914
|
+
* @param sourceFile (optional)
|
|
4034
6915
|
* @return Success
|
|
6916
|
+
* @deprecated
|
|
4035
6917
|
*/
|
|
4036
|
-
|
|
4037
|
-
let url_ = this.baseUrl + "/api/atoms/v1/designs/
|
|
6918
|
+
createItem(itemType, tenantId, sourceType, sourceId, sourceOwnerId, url, sourceFile, cancelToken) {
|
|
6919
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/model/items?";
|
|
6920
|
+
if (itemType !== undefined && itemType !== null)
|
|
6921
|
+
url_ += "itemType=" + encodeURIComponent("" + itemType) + "&";
|
|
4038
6922
|
if (tenantId === null)
|
|
4039
6923
|
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
4040
6924
|
else if (tenantId !== undefined)
|
|
4041
6925
|
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
4042
6926
|
url_ = url_.replace(/[?&]$/, "");
|
|
4043
|
-
const content_ =
|
|
6927
|
+
const content_ = new FormData();
|
|
6928
|
+
if (sourceType !== null && sourceType !== undefined)
|
|
6929
|
+
content_.append("sourceType", sourceType.toString());
|
|
6930
|
+
if (sourceId !== null && sourceId !== undefined)
|
|
6931
|
+
content_.append("sourceId", sourceId.toString());
|
|
6932
|
+
if (sourceOwnerId !== null && sourceOwnerId !== undefined)
|
|
6933
|
+
content_.append("sourceOwnerId", sourceOwnerId.toString());
|
|
6934
|
+
if (url !== null && url !== undefined)
|
|
6935
|
+
content_.append("url", url.toString());
|
|
6936
|
+
if (sourceFile !== null && sourceFile !== undefined)
|
|
6937
|
+
content_.append("sourceFile", sourceFile.data, sourceFile.fileName ? sourceFile.fileName : "sourceFile");
|
|
4044
6938
|
let options_ = {
|
|
4045
6939
|
data: content_,
|
|
4046
6940
|
method: "POST",
|
|
4047
6941
|
url: url_,
|
|
4048
6942
|
headers: {
|
|
4049
|
-
"Content-Type": "application/json",
|
|
4050
6943
|
"Accept": "application/json"
|
|
4051
6944
|
},
|
|
4052
6945
|
cancelToken
|
|
@@ -4061,10 +6954,10 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
4061
6954
|
throw _error;
|
|
4062
6955
|
}
|
|
4063
6956
|
}).then((_response) => {
|
|
4064
|
-
return this.transformResult(url_, _response, (_response) => this.
|
|
6957
|
+
return this.transformResult(url_, _response, (_response) => this.processCreateItem(_response));
|
|
4065
6958
|
});
|
|
4066
6959
|
}
|
|
4067
|
-
|
|
6960
|
+
processCreateItem(response) {
|
|
4068
6961
|
const status = response.status;
|
|
4069
6962
|
let _headers = {};
|
|
4070
6963
|
if (response.headers && typeof response.headers === "object") {
|
|
@@ -4081,6 +6974,13 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
4081
6974
|
result200 = JSON.parse(resultData200);
|
|
4082
6975
|
return Promise.resolve(result200);
|
|
4083
6976
|
}
|
|
6977
|
+
else if (status === 404) {
|
|
6978
|
+
const _responseText = response.data;
|
|
6979
|
+
let result404 = null;
|
|
6980
|
+
let resultData404 = _responseText;
|
|
6981
|
+
result404 = JSON.parse(resultData404);
|
|
6982
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
6983
|
+
}
|
|
4084
6984
|
else if (status === 401) {
|
|
4085
6985
|
const _responseText = response.data;
|
|
4086
6986
|
return throwException("Unauthorized", status, _responseText, _headers);
|
|
@@ -4096,17 +6996,14 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
4096
6996
|
return Promise.resolve(null);
|
|
4097
6997
|
}
|
|
4098
6998
|
/**
|
|
4099
|
-
*
|
|
4100
|
-
* @param attachment (optional) If set to 'true', file will be provided as an attachment with unique filename supplied
|
|
4101
|
-
(default value is 'false').
|
|
6999
|
+
* Extracts print-product item image.
|
|
4102
7000
|
* @param tenantId (optional) Tenant identifier
|
|
4103
|
-
* @param body (optional)
|
|
7001
|
+
* @param body (optional) Extraction parameters.
|
|
4104
7002
|
* @return Success
|
|
7003
|
+
* @deprecated
|
|
4105
7004
|
*/
|
|
4106
|
-
|
|
4107
|
-
let url_ = this.baseUrl + "/api/atoms/v1/designs/
|
|
4108
|
-
if (attachment !== undefined && attachment !== null)
|
|
4109
|
-
url_ += "attachment=" + encodeURIComponent("" + attachment) + "&";
|
|
7005
|
+
extractItemImage(tenantId, body, cancelToken) {
|
|
7006
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/model/items/extract-image?";
|
|
4110
7007
|
if (tenantId === null)
|
|
4111
7008
|
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
4112
7009
|
else if (tenantId !== undefined)
|
|
@@ -4134,10 +7031,10 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
4134
7031
|
throw _error;
|
|
4135
7032
|
}
|
|
4136
7033
|
}).then((_response) => {
|
|
4137
|
-
return this.transformResult(url_, _response, (_response) => this.
|
|
7034
|
+
return this.transformResult(url_, _response, (_response) => this.processExtractItemImage(_response));
|
|
4138
7035
|
});
|
|
4139
7036
|
}
|
|
4140
|
-
|
|
7037
|
+
processExtractItemImage(response) {
|
|
4141
7038
|
const status = response.status;
|
|
4142
7039
|
let _headers = {};
|
|
4143
7040
|
if (response.headers && typeof response.headers === "object") {
|
|
@@ -4168,13 +7065,14 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
4168
7065
|
return Promise.resolve(null);
|
|
4169
7066
|
}
|
|
4170
7067
|
/**
|
|
4171
|
-
*
|
|
7068
|
+
* Flattens print-product items.
|
|
4172
7069
|
* @param tenantId (optional) Tenant identifier
|
|
4173
|
-
* @param body (optional)
|
|
7070
|
+
* @param body (optional) Items to flatten.
|
|
4174
7071
|
* @return Success
|
|
7072
|
+
* @deprecated
|
|
4175
7073
|
*/
|
|
4176
|
-
|
|
4177
|
-
let url_ = this.baseUrl + "/api/atoms/v1/designs/
|
|
7074
|
+
flattenItems(tenantId, body, cancelToken) {
|
|
7075
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/model/items/flatten?";
|
|
4178
7076
|
if (tenantId === null)
|
|
4179
7077
|
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
4180
7078
|
else if (tenantId !== undefined)
|
|
@@ -4201,10 +7099,10 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
4201
7099
|
throw _error;
|
|
4202
7100
|
}
|
|
4203
7101
|
}).then((_response) => {
|
|
4204
|
-
return this.transformResult(url_, _response, (_response) => this.
|
|
7102
|
+
return this.transformResult(url_, _response, (_response) => this.processFlattenItems(_response));
|
|
4205
7103
|
});
|
|
4206
7104
|
}
|
|
4207
|
-
|
|
7105
|
+
processFlattenItems(response) {
|
|
4208
7106
|
const status = response.status;
|
|
4209
7107
|
let _headers = {};
|
|
4210
7108
|
if (response.headers && typeof response.headers === "object") {
|
|
@@ -6309,6 +9207,7 @@ var ItemSourceType;
|
|
|
6309
9207
|
ItemSourceType["File"] = "File";
|
|
6310
9208
|
ItemSourceType["ImageStorage"] = "ImageStorage";
|
|
6311
9209
|
ItemSourceType["PrivateImageStorage"] = "PrivateImageStorage";
|
|
9210
|
+
ItemSourceType["Url"] = "Url";
|
|
6312
9211
|
})(ItemSourceType = exports.ItemSourceType || (exports.ItemSourceType = {}));
|
|
6313
9212
|
var ItemType;
|
|
6314
9213
|
(function (ItemType) {
|