@aurigma/ng-design-atoms-api-client 2.63.1 → 2.64.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/aurigma-ng-design-atoms-api-client.metadata.json +1 -1
- package/bundles/aurigma-ng-design-atoms-api-client.umd.js +1711 -672
- package/bundles/aurigma-ng-design-atoms-api-client.umd.js.map +1 -1
- package/bundles/aurigma-ng-design-atoms-api-client.umd.min.js +1 -1
- package/bundles/aurigma-ng-design-atoms-api-client.umd.min.js.map +1 -1
- package/esm2015/aurigma-ng-design-atoms-api-client.js +1 -1
- package/esm2015/lib/design-atoms-api-client.js +1347 -436
- package/esm2015/lib/design-atoms-api.module.js +1 -1
- package/esm2015/public-api.js +1 -1
- package/fesm2015/aurigma-ng-design-atoms-api-client.js +1346 -435
- package/fesm2015/aurigma-ng-design-atoms-api-client.js.map +1 -1
- package/lib/design-atoms-api-client.d.ts +297 -28
- package/package.json +1 -1
|
@@ -2192,7 +2192,7 @@ class DesignAtomsImagesApiClient extends ApiClientBase {
|
|
|
2192
2192
|
this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : this.getBaseUrl("");
|
|
2193
2193
|
}
|
|
2194
2194
|
/**
|
|
2195
|
-
* Renders a
|
|
2195
|
+
* Renders a preview of an image with the specified parameters.
|
|
2196
2196
|
* @param attachment (optional) If set to 'true', file will be provided as an attachment with unique filename supplied
|
|
2197
2197
|
(default value is 'false').
|
|
2198
2198
|
* @param tenantId (optional) Tenant identifier
|
|
@@ -2269,13 +2269,785 @@ class DesignAtomsImagesApiClient extends ApiClientBase {
|
|
|
2269
2269
|
return of(null);
|
|
2270
2270
|
}
|
|
2271
2271
|
/**
|
|
2272
|
-
* Renders a
|
|
2272
|
+
* Renders a preview of an uploaded image with the specified parameters.
|
|
2273
|
+
* @param attachment (optional) If set to 'true', file will be provided as an attachment with unique filename supplied
|
|
2274
|
+
(default value is 'false').
|
|
2275
|
+
* @param tenantId (optional) Tenant identifier
|
|
2276
|
+
* @param sourceFile (optional)
|
|
2277
|
+
* @param mockupOwnerId (optional)
|
|
2278
|
+
* @param mockupId (optional)
|
|
2279
|
+
* @param width (optional)
|
|
2280
|
+
* @param height (optional)
|
|
2281
|
+
* @param fileFormat (optional)
|
|
2282
|
+
* @param fitMode (optional)
|
|
2283
|
+
* @return Success
|
|
2284
|
+
*/
|
|
2285
|
+
renderImagePreviewFromFile(attachment, tenantId, sourceFile, mockupOwnerId, mockupId, width, height, fileFormat, fitMode) {
|
|
2286
|
+
let url_ = this.baseUrl + "/api/atoms/v1/images/render-preview/from-file?";
|
|
2287
|
+
if (attachment !== undefined && attachment !== null)
|
|
2288
|
+
url_ += "attachment=" + encodeURIComponent("" + attachment) + "&";
|
|
2289
|
+
if (tenantId === null)
|
|
2290
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
2291
|
+
else if (tenantId !== undefined)
|
|
2292
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2293
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
2294
|
+
const content_ = new FormData();
|
|
2295
|
+
if (sourceFile !== null && sourceFile !== undefined)
|
|
2296
|
+
content_.append("sourceFile", sourceFile.data, sourceFile.fileName ? sourceFile.fileName : "sourceFile");
|
|
2297
|
+
if (mockupOwnerId !== null && mockupOwnerId !== undefined)
|
|
2298
|
+
content_.append("mockupOwnerId", mockupOwnerId.toString());
|
|
2299
|
+
if (mockupId !== null && mockupId !== undefined)
|
|
2300
|
+
content_.append("mockupId", mockupId.toString());
|
|
2301
|
+
if (width !== null && width !== undefined)
|
|
2302
|
+
content_.append("width", width.toString());
|
|
2303
|
+
if (height !== null && height !== undefined)
|
|
2304
|
+
content_.append("height", height.toString());
|
|
2305
|
+
if (fileFormat !== null && fileFormat !== undefined)
|
|
2306
|
+
content_.append("fileFormat", fileFormat.toString());
|
|
2307
|
+
if (fitMode !== null && fitMode !== undefined)
|
|
2308
|
+
content_.append("fitMode", fitMode.toString());
|
|
2309
|
+
let options_ = {
|
|
2310
|
+
body: content_,
|
|
2311
|
+
observe: "response",
|
|
2312
|
+
responseType: "blob",
|
|
2313
|
+
headers: new HttpHeaders({
|
|
2314
|
+
"Accept": "application/octet-stream"
|
|
2315
|
+
})
|
|
2316
|
+
};
|
|
2317
|
+
return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
|
|
2318
|
+
return this.http.request("post", url_, transformedOptions_);
|
|
2319
|
+
})).pipe(mergeMap((response_) => {
|
|
2320
|
+
return this.transformResult(url_, response_, (r) => this.processRenderImagePreviewFromFile(r));
|
|
2321
|
+
})).pipe(catchError((response_) => {
|
|
2322
|
+
if (response_ instanceof HttpResponseBase) {
|
|
2323
|
+
try {
|
|
2324
|
+
return this.transformResult(url_, response_, (r) => this.processRenderImagePreviewFromFile(r));
|
|
2325
|
+
}
|
|
2326
|
+
catch (e) {
|
|
2327
|
+
return throwError(e);
|
|
2328
|
+
}
|
|
2329
|
+
}
|
|
2330
|
+
else
|
|
2331
|
+
return throwError(response_);
|
|
2332
|
+
}));
|
|
2333
|
+
}
|
|
2334
|
+
processRenderImagePreviewFromFile(response) {
|
|
2335
|
+
const status = response.status;
|
|
2336
|
+
const responseBlob = response instanceof HttpResponse ? response.body :
|
|
2337
|
+
response.error instanceof Blob ? response.error : undefined;
|
|
2338
|
+
let _headers = {};
|
|
2339
|
+
if (response.headers) {
|
|
2340
|
+
for (let key of response.headers.keys()) {
|
|
2341
|
+
_headers[key] = response.headers.get(key);
|
|
2342
|
+
}
|
|
2343
|
+
}
|
|
2344
|
+
if (status === 200 || status === 206) {
|
|
2345
|
+
const contentDisposition = response.headers ? response.headers.get("content-disposition") : undefined;
|
|
2346
|
+
const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
|
|
2347
|
+
const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
|
|
2348
|
+
return of({ fileName: fileName, data: responseBlob, status: status, headers: _headers });
|
|
2349
|
+
}
|
|
2350
|
+
else if (status === 401) {
|
|
2351
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2352
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
2353
|
+
}));
|
|
2354
|
+
}
|
|
2355
|
+
else if (status === 403) {
|
|
2356
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2357
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
2358
|
+
}));
|
|
2359
|
+
}
|
|
2360
|
+
else if (status !== 200 && status !== 204) {
|
|
2361
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2362
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
2363
|
+
}));
|
|
2364
|
+
}
|
|
2365
|
+
return of(null);
|
|
2366
|
+
}
|
|
2367
|
+
/**
|
|
2368
|
+
* Renders a preview of an uploaded image with the specified parameters and saves rendering result as resource.
|
|
2369
|
+
* @param tenantId (optional) Tenant identifier
|
|
2370
|
+
* @param resourceOwnerId (optional)
|
|
2371
|
+
* @param resourceNamespace (optional)
|
|
2372
|
+
* @param resourceName (optional)
|
|
2373
|
+
* @param resourceSourceId (optional)
|
|
2374
|
+
* @param resourceType (optional)
|
|
2375
|
+
* @param anonymousAccess (optional)
|
|
2376
|
+
* @param overwriteExistingResource (optional)
|
|
2377
|
+
* @param sourceFile (optional)
|
|
2378
|
+
* @param mockupOwnerId (optional)
|
|
2379
|
+
* @param mockupId (optional)
|
|
2380
|
+
* @param width (optional)
|
|
2381
|
+
* @param height (optional)
|
|
2382
|
+
* @param fileFormat (optional)
|
|
2383
|
+
* @param fitMode (optional)
|
|
2384
|
+
* @return Success
|
|
2385
|
+
*/
|
|
2386
|
+
renderImagePreviewFromFileToResource(tenantId, resourceOwnerId, resourceNamespace, resourceName, resourceSourceId, resourceType, anonymousAccess, overwriteExistingResource, sourceFile, mockupOwnerId, mockupId, width, height, fileFormat, fitMode) {
|
|
2387
|
+
let url_ = this.baseUrl + "/api/atoms/v1/images/render-preview/from-file/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_ = new FormData();
|
|
2394
|
+
if (resourceOwnerId !== null && resourceOwnerId !== undefined)
|
|
2395
|
+
content_.append("resourceOwnerId", resourceOwnerId.toString());
|
|
2396
|
+
if (resourceNamespace !== null && resourceNamespace !== undefined)
|
|
2397
|
+
content_.append("resourceNamespace", resourceNamespace.toString());
|
|
2398
|
+
if (resourceName !== null && resourceName !== undefined)
|
|
2399
|
+
content_.append("resourceName", resourceName.toString());
|
|
2400
|
+
if (resourceSourceId !== null && resourceSourceId !== undefined)
|
|
2401
|
+
content_.append("resourceSourceId", resourceSourceId.toString());
|
|
2402
|
+
if (resourceType !== null && resourceType !== undefined)
|
|
2403
|
+
content_.append("resourceType", resourceType.toString());
|
|
2404
|
+
if (anonymousAccess === null || anonymousAccess === undefined)
|
|
2405
|
+
throw new Error("The parameter 'anonymousAccess' cannot be null.");
|
|
2406
|
+
else
|
|
2407
|
+
content_.append("anonymousAccess", anonymousAccess.toString());
|
|
2408
|
+
if (overwriteExistingResource === null || overwriteExistingResource === undefined)
|
|
2409
|
+
throw new Error("The parameter 'overwriteExistingResource' cannot be null.");
|
|
2410
|
+
else
|
|
2411
|
+
content_.append("overwriteExistingResource", overwriteExistingResource.toString());
|
|
2412
|
+
if (sourceFile !== null && sourceFile !== undefined)
|
|
2413
|
+
content_.append("sourceFile", sourceFile.data, sourceFile.fileName ? sourceFile.fileName : "sourceFile");
|
|
2414
|
+
if (mockupOwnerId !== null && mockupOwnerId !== undefined)
|
|
2415
|
+
content_.append("mockupOwnerId", mockupOwnerId.toString());
|
|
2416
|
+
if (mockupId !== null && mockupId !== undefined)
|
|
2417
|
+
content_.append("mockupId", mockupId.toString());
|
|
2418
|
+
if (width !== null && width !== undefined)
|
|
2419
|
+
content_.append("width", width.toString());
|
|
2420
|
+
if (height !== null && height !== undefined)
|
|
2421
|
+
content_.append("height", height.toString());
|
|
2422
|
+
if (fileFormat !== null && fileFormat !== undefined)
|
|
2423
|
+
content_.append("fileFormat", fileFormat.toString());
|
|
2424
|
+
if (fitMode !== null && fitMode !== undefined)
|
|
2425
|
+
content_.append("fitMode", fitMode.toString());
|
|
2426
|
+
let options_ = {
|
|
2427
|
+
body: content_,
|
|
2428
|
+
observe: "response",
|
|
2429
|
+
responseType: "blob",
|
|
2430
|
+
headers: new HttpHeaders({
|
|
2431
|
+
"Accept": "application/json"
|
|
2432
|
+
})
|
|
2433
|
+
};
|
|
2434
|
+
return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
|
|
2435
|
+
return this.http.request("post", url_, transformedOptions_);
|
|
2436
|
+
})).pipe(mergeMap((response_) => {
|
|
2437
|
+
return this.transformResult(url_, response_, (r) => this.processRenderImagePreviewFromFileToResource(r));
|
|
2438
|
+
})).pipe(catchError((response_) => {
|
|
2439
|
+
if (response_ instanceof HttpResponseBase) {
|
|
2440
|
+
try {
|
|
2441
|
+
return this.transformResult(url_, response_, (r) => this.processRenderImagePreviewFromFileToResource(r));
|
|
2442
|
+
}
|
|
2443
|
+
catch (e) {
|
|
2444
|
+
return throwError(e);
|
|
2445
|
+
}
|
|
2446
|
+
}
|
|
2447
|
+
else
|
|
2448
|
+
return throwError(response_);
|
|
2449
|
+
}));
|
|
2450
|
+
}
|
|
2451
|
+
processRenderImagePreviewFromFileToResource(response) {
|
|
2452
|
+
const status = response.status;
|
|
2453
|
+
const responseBlob = response instanceof HttpResponse ? response.body :
|
|
2454
|
+
response.error instanceof Blob ? response.error : undefined;
|
|
2455
|
+
let _headers = {};
|
|
2456
|
+
if (response.headers) {
|
|
2457
|
+
for (let key of response.headers.keys()) {
|
|
2458
|
+
_headers[key] = response.headers.get(key);
|
|
2459
|
+
}
|
|
2460
|
+
}
|
|
2461
|
+
if (status === 200) {
|
|
2462
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2463
|
+
let result200 = null;
|
|
2464
|
+
result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
2465
|
+
return of(result200);
|
|
2466
|
+
}));
|
|
2467
|
+
}
|
|
2468
|
+
else if (status === 409) {
|
|
2469
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2470
|
+
let result409 = null;
|
|
2471
|
+
result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
2472
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
2473
|
+
}));
|
|
2474
|
+
}
|
|
2475
|
+
else if (status === 401) {
|
|
2476
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2477
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
2478
|
+
}));
|
|
2479
|
+
}
|
|
2480
|
+
else if (status === 403) {
|
|
2481
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2482
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
2483
|
+
}));
|
|
2484
|
+
}
|
|
2485
|
+
else if (status !== 200 && status !== 204) {
|
|
2486
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2487
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
2488
|
+
}));
|
|
2489
|
+
}
|
|
2490
|
+
return of(null);
|
|
2491
|
+
}
|
|
2492
|
+
/**
|
|
2493
|
+
* Renders a preview of a web image with the specified parameters.
|
|
2494
|
+
* @param attachment (optional) If set to 'true', file will be provided as an attachment with unique filename supplied
|
|
2495
|
+
(default value is 'false').
|
|
2496
|
+
* @param tenantId (optional) Tenant identifier
|
|
2497
|
+
* @param body (optional) Render model with preview parameters.
|
|
2498
|
+
* @return Success
|
|
2499
|
+
*/
|
|
2500
|
+
renderImagePreviewFromUrl(attachment, tenantId, body) {
|
|
2501
|
+
let url_ = this.baseUrl + "/api/atoms/v1/images/render-preview/from-url?";
|
|
2502
|
+
if (attachment !== undefined && attachment !== null)
|
|
2503
|
+
url_ += "attachment=" + encodeURIComponent("" + attachment) + "&";
|
|
2504
|
+
if (tenantId === null)
|
|
2505
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
2506
|
+
else if (tenantId !== undefined)
|
|
2507
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2508
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
2509
|
+
const content_ = JSON.stringify(body);
|
|
2510
|
+
let options_ = {
|
|
2511
|
+
body: content_,
|
|
2512
|
+
observe: "response",
|
|
2513
|
+
responseType: "blob",
|
|
2514
|
+
headers: new HttpHeaders({
|
|
2515
|
+
"Content-Type": "application/json",
|
|
2516
|
+
"Accept": "application/octet-stream"
|
|
2517
|
+
})
|
|
2518
|
+
};
|
|
2519
|
+
return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
|
|
2520
|
+
return this.http.request("post", url_, transformedOptions_);
|
|
2521
|
+
})).pipe(mergeMap((response_) => {
|
|
2522
|
+
return this.transformResult(url_, response_, (r) => this.processRenderImagePreviewFromUrl(r));
|
|
2523
|
+
})).pipe(catchError((response_) => {
|
|
2524
|
+
if (response_ instanceof HttpResponseBase) {
|
|
2525
|
+
try {
|
|
2526
|
+
return this.transformResult(url_, response_, (r) => this.processRenderImagePreviewFromUrl(r));
|
|
2527
|
+
}
|
|
2528
|
+
catch (e) {
|
|
2529
|
+
return throwError(e);
|
|
2530
|
+
}
|
|
2531
|
+
}
|
|
2532
|
+
else
|
|
2533
|
+
return throwError(response_);
|
|
2534
|
+
}));
|
|
2535
|
+
}
|
|
2536
|
+
processRenderImagePreviewFromUrl(response) {
|
|
2537
|
+
const status = response.status;
|
|
2538
|
+
const responseBlob = response instanceof HttpResponse ? response.body :
|
|
2539
|
+
response.error instanceof Blob ? response.error : undefined;
|
|
2540
|
+
let _headers = {};
|
|
2541
|
+
if (response.headers) {
|
|
2542
|
+
for (let key of response.headers.keys()) {
|
|
2543
|
+
_headers[key] = response.headers.get(key);
|
|
2544
|
+
}
|
|
2545
|
+
}
|
|
2546
|
+
if (status === 200 || status === 206) {
|
|
2547
|
+
const contentDisposition = response.headers ? response.headers.get("content-disposition") : undefined;
|
|
2548
|
+
const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
|
|
2549
|
+
const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
|
|
2550
|
+
return of({ fileName: fileName, data: responseBlob, status: status, headers: _headers });
|
|
2551
|
+
}
|
|
2552
|
+
else if (status === 401) {
|
|
2553
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2554
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
2555
|
+
}));
|
|
2556
|
+
}
|
|
2557
|
+
else if (status === 403) {
|
|
2558
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2559
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
2560
|
+
}));
|
|
2561
|
+
}
|
|
2562
|
+
else if (status !== 200 && status !== 204) {
|
|
2563
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2564
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
2565
|
+
}));
|
|
2566
|
+
}
|
|
2567
|
+
return of(null);
|
|
2568
|
+
}
|
|
2569
|
+
/**
|
|
2570
|
+
* Renders a preview of a web image with the specified parameters and saves rendering result as resource.
|
|
2571
|
+
* @param tenantId (optional) Tenant identifier
|
|
2572
|
+
* @param body (optional) Render model with preview parameters.
|
|
2573
|
+
* @return Success
|
|
2574
|
+
*/
|
|
2575
|
+
renderImagePreviewFromUrlToResource(tenantId, body) {
|
|
2576
|
+
let url_ = this.baseUrl + "/api/atoms/v1/images/render-preview/from-url/to-resource?";
|
|
2577
|
+
if (tenantId === null)
|
|
2578
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
2579
|
+
else if (tenantId !== undefined)
|
|
2580
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2581
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
2582
|
+
const content_ = JSON.stringify(body);
|
|
2583
|
+
let options_ = {
|
|
2584
|
+
body: content_,
|
|
2585
|
+
observe: "response",
|
|
2586
|
+
responseType: "blob",
|
|
2587
|
+
headers: new HttpHeaders({
|
|
2588
|
+
"Content-Type": "application/json",
|
|
2589
|
+
"Accept": "application/json"
|
|
2590
|
+
})
|
|
2591
|
+
};
|
|
2592
|
+
return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
|
|
2593
|
+
return this.http.request("post", url_, transformedOptions_);
|
|
2594
|
+
})).pipe(mergeMap((response_) => {
|
|
2595
|
+
return this.transformResult(url_, response_, (r) => this.processRenderImagePreviewFromUrlToResource(r));
|
|
2596
|
+
})).pipe(catchError((response_) => {
|
|
2597
|
+
if (response_ instanceof HttpResponseBase) {
|
|
2598
|
+
try {
|
|
2599
|
+
return this.transformResult(url_, response_, (r) => this.processRenderImagePreviewFromUrlToResource(r));
|
|
2600
|
+
}
|
|
2601
|
+
catch (e) {
|
|
2602
|
+
return throwError(e);
|
|
2603
|
+
}
|
|
2604
|
+
}
|
|
2605
|
+
else
|
|
2606
|
+
return throwError(response_);
|
|
2607
|
+
}));
|
|
2608
|
+
}
|
|
2609
|
+
processRenderImagePreviewFromUrlToResource(response) {
|
|
2610
|
+
const status = response.status;
|
|
2611
|
+
const responseBlob = response instanceof HttpResponse ? response.body :
|
|
2612
|
+
response.error instanceof Blob ? response.error : undefined;
|
|
2613
|
+
let _headers = {};
|
|
2614
|
+
if (response.headers) {
|
|
2615
|
+
for (let key of response.headers.keys()) {
|
|
2616
|
+
_headers[key] = response.headers.get(key);
|
|
2617
|
+
}
|
|
2618
|
+
}
|
|
2619
|
+
if (status === 200) {
|
|
2620
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2621
|
+
let result200 = null;
|
|
2622
|
+
result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
2623
|
+
return of(result200);
|
|
2624
|
+
}));
|
|
2625
|
+
}
|
|
2626
|
+
else if (status === 409) {
|
|
2627
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2628
|
+
let result409 = null;
|
|
2629
|
+
result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
2630
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
2631
|
+
}));
|
|
2632
|
+
}
|
|
2633
|
+
else if (status === 401) {
|
|
2634
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2635
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
2636
|
+
}));
|
|
2637
|
+
}
|
|
2638
|
+
else if (status === 403) {
|
|
2639
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2640
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
2641
|
+
}));
|
|
2642
|
+
}
|
|
2643
|
+
else if (status !== 200 && status !== 204) {
|
|
2644
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2645
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
2646
|
+
}));
|
|
2647
|
+
}
|
|
2648
|
+
return of(null);
|
|
2649
|
+
}
|
|
2650
|
+
/**
|
|
2651
|
+
* Renders a preview of an image with the specified parameters and saves rendering result as resource.
|
|
2652
|
+
* @param tenantId (optional) Tenant identifier
|
|
2653
|
+
* @param body (optional) Render model with preview parameters.
|
|
2654
|
+
* @return Success
|
|
2655
|
+
*/
|
|
2656
|
+
renderImagePreviewToResource(tenantId, body) {
|
|
2657
|
+
let url_ = this.baseUrl + "/api/atoms/v1/images/render-preview/to-resource?";
|
|
2658
|
+
if (tenantId === null)
|
|
2659
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
2660
|
+
else if (tenantId !== undefined)
|
|
2661
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2662
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
2663
|
+
const content_ = JSON.stringify(body);
|
|
2664
|
+
let options_ = {
|
|
2665
|
+
body: content_,
|
|
2666
|
+
observe: "response",
|
|
2667
|
+
responseType: "blob",
|
|
2668
|
+
headers: new HttpHeaders({
|
|
2669
|
+
"Content-Type": "application/json",
|
|
2670
|
+
"Accept": "application/json"
|
|
2671
|
+
})
|
|
2672
|
+
};
|
|
2673
|
+
return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
|
|
2674
|
+
return this.http.request("post", url_, transformedOptions_);
|
|
2675
|
+
})).pipe(mergeMap((response_) => {
|
|
2676
|
+
return this.transformResult(url_, response_, (r) => this.processRenderImagePreviewToResource(r));
|
|
2677
|
+
})).pipe(catchError((response_) => {
|
|
2678
|
+
if (response_ instanceof HttpResponseBase) {
|
|
2679
|
+
try {
|
|
2680
|
+
return this.transformResult(url_, response_, (r) => this.processRenderImagePreviewToResource(r));
|
|
2681
|
+
}
|
|
2682
|
+
catch (e) {
|
|
2683
|
+
return throwError(e);
|
|
2684
|
+
}
|
|
2685
|
+
}
|
|
2686
|
+
else
|
|
2687
|
+
return throwError(response_);
|
|
2688
|
+
}));
|
|
2689
|
+
}
|
|
2690
|
+
processRenderImagePreviewToResource(response) {
|
|
2691
|
+
const status = response.status;
|
|
2692
|
+
const responseBlob = response instanceof HttpResponse ? response.body :
|
|
2693
|
+
response.error instanceof Blob ? response.error : undefined;
|
|
2694
|
+
let _headers = {};
|
|
2695
|
+
if (response.headers) {
|
|
2696
|
+
for (let key of response.headers.keys()) {
|
|
2697
|
+
_headers[key] = response.headers.get(key);
|
|
2698
|
+
}
|
|
2699
|
+
}
|
|
2700
|
+
if (status === 200) {
|
|
2701
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2702
|
+
let result200 = null;
|
|
2703
|
+
result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
2704
|
+
return of(result200);
|
|
2705
|
+
}));
|
|
2706
|
+
}
|
|
2707
|
+
else if (status === 409) {
|
|
2708
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2709
|
+
let result409 = null;
|
|
2710
|
+
result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
2711
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
2712
|
+
}));
|
|
2713
|
+
}
|
|
2714
|
+
else if (status === 401) {
|
|
2715
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2716
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
2717
|
+
}));
|
|
2718
|
+
}
|
|
2719
|
+
else if (status === 403) {
|
|
2720
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2721
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
2722
|
+
}));
|
|
2723
|
+
}
|
|
2724
|
+
else if (status !== 200 && status !== 204) {
|
|
2725
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2726
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
2727
|
+
}));
|
|
2728
|
+
}
|
|
2729
|
+
return of(null);
|
|
2730
|
+
}
|
|
2731
|
+
}
|
|
2732
|
+
DesignAtomsImagesApiClient.ɵprov = ɵɵdefineInjectable({ factory: function DesignAtomsImagesApiClient_Factory() { return new DesignAtomsImagesApiClient(ɵɵinject(ApiClientConfiguration), ɵɵinject(HttpClient), ɵɵinject(API_BASE_URL, 8)); }, token: DesignAtomsImagesApiClient, providedIn: "root" });
|
|
2733
|
+
DesignAtomsImagesApiClient.decorators = [
|
|
2734
|
+
{ type: Injectable, args: [{
|
|
2735
|
+
providedIn: 'root'
|
|
2736
|
+
},] }
|
|
2737
|
+
];
|
|
2738
|
+
DesignAtomsImagesApiClient.ctorParameters = () => [
|
|
2739
|
+
{ type: ApiClientConfiguration, decorators: [{ type: Inject, args: [ApiClientConfiguration,] }] },
|
|
2740
|
+
{ type: HttpClient, decorators: [{ type: Inject, args: [HttpClient,] }] },
|
|
2741
|
+
{ type: String, decorators: [{ type: Optional }, { type: Inject, args: [API_BASE_URL,] }] }
|
|
2742
|
+
];
|
|
2743
|
+
class DesignAtomsMockups3dApiClient extends ApiClientBase {
|
|
2744
|
+
constructor(configuration, http, baseUrl) {
|
|
2745
|
+
super(configuration);
|
|
2746
|
+
this.jsonParseReviver = undefined;
|
|
2747
|
+
this.http = http;
|
|
2748
|
+
this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : this.getBaseUrl("");
|
|
2749
|
+
}
|
|
2750
|
+
/**
|
|
2751
|
+
* Returns a 3D-Mockup attributes.
|
|
2752
|
+
* @param id 3D-Mockup identifier.
|
|
2753
|
+
* @param ownerId (optional) Private mockup owner identifier.
|
|
2754
|
+
* @param tenantId (optional) Tenant identifier
|
|
2755
|
+
* @return Success
|
|
2756
|
+
*/
|
|
2757
|
+
getAttributes(id, ownerId, tenantId) {
|
|
2758
|
+
let url_ = this.baseUrl + "/api/atoms/v1/mockups-3d/{id}/attributes?";
|
|
2759
|
+
if (id === undefined || id === null)
|
|
2760
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
2761
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
2762
|
+
if (ownerId !== undefined && ownerId !== null)
|
|
2763
|
+
url_ += "ownerId=" + encodeURIComponent("" + ownerId) + "&";
|
|
2764
|
+
if (tenantId === null)
|
|
2765
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
2766
|
+
else if (tenantId !== undefined)
|
|
2767
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2768
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
2769
|
+
let options_ = {
|
|
2770
|
+
observe: "response",
|
|
2771
|
+
responseType: "blob",
|
|
2772
|
+
headers: new HttpHeaders({
|
|
2773
|
+
"Accept": "application/json"
|
|
2774
|
+
})
|
|
2775
|
+
};
|
|
2776
|
+
return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
|
|
2777
|
+
return this.http.request("get", url_, transformedOptions_);
|
|
2778
|
+
})).pipe(mergeMap((response_) => {
|
|
2779
|
+
return this.transformResult(url_, response_, (r) => this.processGetAttributes(r));
|
|
2780
|
+
})).pipe(catchError((response_) => {
|
|
2781
|
+
if (response_ instanceof HttpResponseBase) {
|
|
2782
|
+
try {
|
|
2783
|
+
return this.transformResult(url_, response_, (r) => this.processGetAttributes(r));
|
|
2784
|
+
}
|
|
2785
|
+
catch (e) {
|
|
2786
|
+
return throwError(e);
|
|
2787
|
+
}
|
|
2788
|
+
}
|
|
2789
|
+
else
|
|
2790
|
+
return throwError(response_);
|
|
2791
|
+
}));
|
|
2792
|
+
}
|
|
2793
|
+
processGetAttributes(response) {
|
|
2794
|
+
const status = response.status;
|
|
2795
|
+
const responseBlob = response instanceof HttpResponse ? response.body :
|
|
2796
|
+
response.error instanceof Blob ? response.error : undefined;
|
|
2797
|
+
let _headers = {};
|
|
2798
|
+
if (response.headers) {
|
|
2799
|
+
for (let key of response.headers.keys()) {
|
|
2800
|
+
_headers[key] = response.headers.get(key);
|
|
2801
|
+
}
|
|
2802
|
+
}
|
|
2803
|
+
if (status === 200) {
|
|
2804
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2805
|
+
let result200 = null;
|
|
2806
|
+
result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
2807
|
+
return of(result200);
|
|
2808
|
+
}));
|
|
2809
|
+
}
|
|
2810
|
+
else if (status === 404) {
|
|
2811
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2812
|
+
let result404 = null;
|
|
2813
|
+
result404 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
2814
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
2815
|
+
}));
|
|
2816
|
+
}
|
|
2817
|
+
else if (status === 422) {
|
|
2818
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2819
|
+
let result422 = null;
|
|
2820
|
+
result422 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
2821
|
+
return throwException("Client Error", status, _responseText, _headers, result422);
|
|
2822
|
+
}));
|
|
2823
|
+
}
|
|
2824
|
+
else if (status === 401) {
|
|
2825
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2826
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
2827
|
+
}));
|
|
2828
|
+
}
|
|
2829
|
+
else if (status === 403) {
|
|
2830
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2831
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
2832
|
+
}));
|
|
2833
|
+
}
|
|
2834
|
+
else if (status !== 200 && status !== 204) {
|
|
2835
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2836
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
2837
|
+
}));
|
|
2838
|
+
}
|
|
2839
|
+
return of(null);
|
|
2840
|
+
}
|
|
2841
|
+
/**
|
|
2842
|
+
* Returns a 3D-Mockup content as protobuf binary stream.
|
|
2843
|
+
* @param id 3D-Mockup identifier.
|
|
2844
|
+
* @param ownerId (optional) Private mockup owner identifier.
|
|
2845
|
+
* @param tenantId (optional) Tenant identifier
|
|
2846
|
+
* @return Success
|
|
2847
|
+
*/
|
|
2848
|
+
getContentAsProtobuf(id, ownerId, tenantId) {
|
|
2849
|
+
let url_ = this.baseUrl + "/api/atoms/v1/mockups-3d/{id}/content/as-protobuf?";
|
|
2850
|
+
if (id === undefined || id === null)
|
|
2851
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
2852
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
2853
|
+
if (ownerId !== undefined && ownerId !== null)
|
|
2854
|
+
url_ += "ownerId=" + encodeURIComponent("" + ownerId) + "&";
|
|
2855
|
+
if (tenantId === null)
|
|
2856
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
2857
|
+
else if (tenantId !== undefined)
|
|
2858
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2859
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
2860
|
+
let options_ = {
|
|
2861
|
+
observe: "response",
|
|
2862
|
+
responseType: "blob",
|
|
2863
|
+
headers: new HttpHeaders({
|
|
2864
|
+
"Accept": "application/json"
|
|
2865
|
+
})
|
|
2866
|
+
};
|
|
2867
|
+
return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
|
|
2868
|
+
return this.http.request("get", url_, transformedOptions_);
|
|
2869
|
+
})).pipe(mergeMap((response_) => {
|
|
2870
|
+
return this.transformResult(url_, response_, (r) => this.processGetContentAsProtobuf(r));
|
|
2871
|
+
})).pipe(catchError((response_) => {
|
|
2872
|
+
if (response_ instanceof HttpResponseBase) {
|
|
2873
|
+
try {
|
|
2874
|
+
return this.transformResult(url_, response_, (r) => this.processGetContentAsProtobuf(r));
|
|
2875
|
+
}
|
|
2876
|
+
catch (e) {
|
|
2877
|
+
return throwError(e);
|
|
2878
|
+
}
|
|
2879
|
+
}
|
|
2880
|
+
else
|
|
2881
|
+
return throwError(response_);
|
|
2882
|
+
}));
|
|
2883
|
+
}
|
|
2884
|
+
processGetContentAsProtobuf(response) {
|
|
2885
|
+
const status = response.status;
|
|
2886
|
+
const responseBlob = response instanceof HttpResponse ? response.body :
|
|
2887
|
+
response.error instanceof Blob ? response.error : undefined;
|
|
2888
|
+
let _headers = {};
|
|
2889
|
+
if (response.headers) {
|
|
2890
|
+
for (let key of response.headers.keys()) {
|
|
2891
|
+
_headers[key] = response.headers.get(key);
|
|
2892
|
+
}
|
|
2893
|
+
}
|
|
2894
|
+
if (status === 200 || status === 206) {
|
|
2895
|
+
const contentDisposition = response.headers ? response.headers.get("content-disposition") : undefined;
|
|
2896
|
+
const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
|
|
2897
|
+
const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
|
|
2898
|
+
return of({ fileName: fileName, data: responseBlob, status: status, headers: _headers });
|
|
2899
|
+
}
|
|
2900
|
+
else if (status === 404) {
|
|
2901
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2902
|
+
let result404 = null;
|
|
2903
|
+
result404 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
2904
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
2905
|
+
}));
|
|
2906
|
+
}
|
|
2907
|
+
else if (status === 422) {
|
|
2908
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2909
|
+
let result422 = null;
|
|
2910
|
+
result422 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
2911
|
+
return throwException("Client Error", status, _responseText, _headers, result422);
|
|
2912
|
+
}));
|
|
2913
|
+
}
|
|
2914
|
+
else if (status === 401) {
|
|
2915
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2916
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
2917
|
+
}));
|
|
2918
|
+
}
|
|
2919
|
+
else if (status === 403) {
|
|
2920
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2921
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
2922
|
+
}));
|
|
2923
|
+
}
|
|
2924
|
+
else if (status !== 200 && status !== 204) {
|
|
2925
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2926
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
2927
|
+
}));
|
|
2928
|
+
}
|
|
2929
|
+
return of(null);
|
|
2930
|
+
}
|
|
2931
|
+
/**
|
|
2932
|
+
* Returns a 3D-Mockup geometry as binary stream.
|
|
2933
|
+
* @param id 3D-Mockup identifier.
|
|
2934
|
+
* @param ownerId (optional) Private mockup owner identifier.
|
|
2935
|
+
* @param tenantId (optional) Tenant identifier
|
|
2936
|
+
* @return Success
|
|
2937
|
+
*/
|
|
2938
|
+
getGeometryFile(id, ownerId, tenantId) {
|
|
2939
|
+
let url_ = this.baseUrl + "/api/atoms/v1/mockups-3d/{id}/geometry/file?";
|
|
2940
|
+
if (id === undefined || id === null)
|
|
2941
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
2942
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
2943
|
+
if (ownerId !== undefined && ownerId !== null)
|
|
2944
|
+
url_ += "ownerId=" + encodeURIComponent("" + ownerId) + "&";
|
|
2945
|
+
if (tenantId === null)
|
|
2946
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
2947
|
+
else if (tenantId !== undefined)
|
|
2948
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2949
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
2950
|
+
let options_ = {
|
|
2951
|
+
observe: "response",
|
|
2952
|
+
responseType: "blob",
|
|
2953
|
+
headers: new HttpHeaders({
|
|
2954
|
+
"Accept": "application/json"
|
|
2955
|
+
})
|
|
2956
|
+
};
|
|
2957
|
+
return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
|
|
2958
|
+
return this.http.request("get", url_, transformedOptions_);
|
|
2959
|
+
})).pipe(mergeMap((response_) => {
|
|
2960
|
+
return this.transformResult(url_, response_, (r) => this.processGetGeometryFile(r));
|
|
2961
|
+
})).pipe(catchError((response_) => {
|
|
2962
|
+
if (response_ instanceof HttpResponseBase) {
|
|
2963
|
+
try {
|
|
2964
|
+
return this.transformResult(url_, response_, (r) => this.processGetGeometryFile(r));
|
|
2965
|
+
}
|
|
2966
|
+
catch (e) {
|
|
2967
|
+
return throwError(e);
|
|
2968
|
+
}
|
|
2969
|
+
}
|
|
2970
|
+
else
|
|
2971
|
+
return throwError(response_);
|
|
2972
|
+
}));
|
|
2973
|
+
}
|
|
2974
|
+
processGetGeometryFile(response) {
|
|
2975
|
+
const status = response.status;
|
|
2976
|
+
const responseBlob = response instanceof HttpResponse ? response.body :
|
|
2977
|
+
response.error instanceof Blob ? response.error : undefined;
|
|
2978
|
+
let _headers = {};
|
|
2979
|
+
if (response.headers) {
|
|
2980
|
+
for (let key of response.headers.keys()) {
|
|
2981
|
+
_headers[key] = response.headers.get(key);
|
|
2982
|
+
}
|
|
2983
|
+
}
|
|
2984
|
+
if (status === 200 || status === 206) {
|
|
2985
|
+
const contentDisposition = response.headers ? response.headers.get("content-disposition") : undefined;
|
|
2986
|
+
const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
|
|
2987
|
+
const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
|
|
2988
|
+
return of({ fileName: fileName, data: responseBlob, status: status, headers: _headers });
|
|
2989
|
+
}
|
|
2990
|
+
else if (status === 404) {
|
|
2991
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2992
|
+
let result404 = null;
|
|
2993
|
+
result404 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
2994
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
2995
|
+
}));
|
|
2996
|
+
}
|
|
2997
|
+
else if (status === 422) {
|
|
2998
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2999
|
+
let result422 = null;
|
|
3000
|
+
result422 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
3001
|
+
return throwException("Client Error", status, _responseText, _headers, result422);
|
|
3002
|
+
}));
|
|
3003
|
+
}
|
|
3004
|
+
else if (status === 401) {
|
|
3005
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
3006
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
3007
|
+
}));
|
|
3008
|
+
}
|
|
3009
|
+
else if (status === 403) {
|
|
3010
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
3011
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
3012
|
+
}));
|
|
3013
|
+
}
|
|
3014
|
+
else if (status !== 200 && status !== 204) {
|
|
3015
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
3016
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
3017
|
+
}));
|
|
3018
|
+
}
|
|
3019
|
+
return of(null);
|
|
3020
|
+
}
|
|
3021
|
+
}
|
|
3022
|
+
DesignAtomsMockups3dApiClient.ɵprov = ɵɵdefineInjectable({ factory: function DesignAtomsMockups3dApiClient_Factory() { return new DesignAtomsMockups3dApiClient(ɵɵinject(ApiClientConfiguration), ɵɵinject(HttpClient), ɵɵinject(API_BASE_URL, 8)); }, token: DesignAtomsMockups3dApiClient, providedIn: "root" });
|
|
3023
|
+
DesignAtomsMockups3dApiClient.decorators = [
|
|
3024
|
+
{ type: Injectable, args: [{
|
|
3025
|
+
providedIn: 'root'
|
|
3026
|
+
},] }
|
|
3027
|
+
];
|
|
3028
|
+
DesignAtomsMockups3dApiClient.ctorParameters = () => [
|
|
3029
|
+
{ type: ApiClientConfiguration, decorators: [{ type: Inject, args: [ApiClientConfiguration,] }] },
|
|
3030
|
+
{ type: HttpClient, decorators: [{ type: Inject, args: [HttpClient,] }] },
|
|
3031
|
+
{ type: String, decorators: [{ type: Optional }, { type: Inject, args: [API_BASE_URL,] }] }
|
|
3032
|
+
];
|
|
3033
|
+
class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
3034
|
+
constructor(configuration, http, baseUrl) {
|
|
3035
|
+
super(configuration);
|
|
3036
|
+
this.jsonParseReviver = undefined;
|
|
3037
|
+
this.http = http;
|
|
3038
|
+
this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : this.getBaseUrl("");
|
|
3039
|
+
}
|
|
3040
|
+
/**
|
|
3041
|
+
* Creates new design file with specified parameters and saves it in storage.
|
|
3042
|
+
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
2273
3043
|
* @param tenantId (optional) Tenant identifier
|
|
2274
|
-
* @param body (optional)
|
|
2275
|
-
* @return
|
|
3044
|
+
* @param body (optional) Design creation parameters.
|
|
3045
|
+
* @return Created
|
|
2276
3046
|
*/
|
|
2277
|
-
|
|
2278
|
-
let url_ = this.baseUrl + "/api/atoms/v1/
|
|
3047
|
+
createDesign(privateStorageOwner, tenantId, body) {
|
|
3048
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs?";
|
|
3049
|
+
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
3050
|
+
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
2279
3051
|
if (tenantId === null)
|
|
2280
3052
|
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
2281
3053
|
else if (tenantId !== undefined)
|
|
@@ -2294,11 +3066,11 @@ class DesignAtomsImagesApiClient extends ApiClientBase {
|
|
|
2294
3066
|
return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
|
|
2295
3067
|
return this.http.request("post", url_, transformedOptions_);
|
|
2296
3068
|
})).pipe(mergeMap((response_) => {
|
|
2297
|
-
return this.transformResult(url_, response_, (r) => this.
|
|
3069
|
+
return this.transformResult(url_, response_, (r) => this.processCreateDesign(r));
|
|
2298
3070
|
})).pipe(catchError((response_) => {
|
|
2299
3071
|
if (response_ instanceof HttpResponseBase) {
|
|
2300
3072
|
try {
|
|
2301
|
-
return this.transformResult(url_, response_, (r) => this.
|
|
3073
|
+
return this.transformResult(url_, response_, (r) => this.processCreateDesign(r));
|
|
2302
3074
|
}
|
|
2303
3075
|
catch (e) {
|
|
2304
3076
|
return throwError(e);
|
|
@@ -2308,7 +3080,7 @@ class DesignAtomsImagesApiClient extends ApiClientBase {
|
|
|
2308
3080
|
return throwError(response_);
|
|
2309
3081
|
}));
|
|
2310
3082
|
}
|
|
2311
|
-
|
|
3083
|
+
processCreateDesign(response) {
|
|
2312
3084
|
const status = response.status;
|
|
2313
3085
|
const responseBlob = response instanceof HttpResponse ? response.body :
|
|
2314
3086
|
response.error instanceof Blob ? response.error : undefined;
|
|
@@ -2318,11 +3090,11 @@ class DesignAtomsImagesApiClient extends ApiClientBase {
|
|
|
2318
3090
|
_headers[key] = response.headers.get(key);
|
|
2319
3091
|
}
|
|
2320
3092
|
}
|
|
2321
|
-
if (status ===
|
|
3093
|
+
if (status === 201) {
|
|
2322
3094
|
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2323
|
-
let
|
|
2324
|
-
|
|
2325
|
-
return of(
|
|
3095
|
+
let result201 = null;
|
|
3096
|
+
result201 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
3097
|
+
return of(result201);
|
|
2326
3098
|
}));
|
|
2327
3099
|
}
|
|
2328
3100
|
else if (status === 401) {
|
|
@@ -2342,39 +3114,23 @@ class DesignAtomsImagesApiClient extends ApiClientBase {
|
|
|
2342
3114
|
}
|
|
2343
3115
|
return of(null);
|
|
2344
3116
|
}
|
|
2345
|
-
}
|
|
2346
|
-
DesignAtomsImagesApiClient.ɵprov = ɵɵdefineInjectable({ factory: function DesignAtomsImagesApiClient_Factory() { return new DesignAtomsImagesApiClient(ɵɵinject(ApiClientConfiguration), ɵɵinject(HttpClient), ɵɵinject(API_BASE_URL, 8)); }, token: DesignAtomsImagesApiClient, providedIn: "root" });
|
|
2347
|
-
DesignAtomsImagesApiClient.decorators = [
|
|
2348
|
-
{ type: Injectable, args: [{
|
|
2349
|
-
providedIn: 'root'
|
|
2350
|
-
},] }
|
|
2351
|
-
];
|
|
2352
|
-
DesignAtomsImagesApiClient.ctorParameters = () => [
|
|
2353
|
-
{ type: ApiClientConfiguration, decorators: [{ type: Inject, args: [ApiClientConfiguration,] }] },
|
|
2354
|
-
{ type: HttpClient, decorators: [{ type: Inject, args: [HttpClient,] }] },
|
|
2355
|
-
{ type: String, decorators: [{ type: Optional }, { type: Inject, args: [API_BASE_URL,] }] }
|
|
2356
|
-
];
|
|
2357
|
-
class DesignAtomsMockups3dApiClient extends ApiClientBase {
|
|
2358
|
-
constructor(configuration, http, baseUrl) {
|
|
2359
|
-
super(configuration);
|
|
2360
|
-
this.jsonParseReviver = undefined;
|
|
2361
|
-
this.http = http;
|
|
2362
|
-
this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : this.getBaseUrl("");
|
|
2363
|
-
}
|
|
2364
3117
|
/**
|
|
2365
|
-
* Returns
|
|
2366
|
-
* @param id
|
|
2367
|
-
* @param
|
|
3118
|
+
* Returns content of the background.
|
|
3119
|
+
* @param id Design identifier.
|
|
3120
|
+
* @param surfaceIndex (optional) Surface index.
|
|
3121
|
+
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
2368
3122
|
* @param tenantId (optional) Tenant identifier
|
|
2369
3123
|
* @return Success
|
|
2370
3124
|
*/
|
|
2371
|
-
|
|
2372
|
-
let url_ = this.baseUrl + "/api/atoms/v1/
|
|
3125
|
+
extractBackground(id, surfaceIndex, privateStorageOwner, tenantId) {
|
|
3126
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/background?";
|
|
2373
3127
|
if (id === undefined || id === null)
|
|
2374
3128
|
throw new Error("The parameter 'id' must be defined.");
|
|
2375
3129
|
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
2376
|
-
if (
|
|
2377
|
-
url_ += "
|
|
3130
|
+
if (surfaceIndex !== undefined && surfaceIndex !== null)
|
|
3131
|
+
url_ += "surfaceIndex=" + encodeURIComponent("" + surfaceIndex) + "&";
|
|
3132
|
+
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
3133
|
+
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
2378
3134
|
if (tenantId === null)
|
|
2379
3135
|
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
2380
3136
|
else if (tenantId !== undefined)
|
|
@@ -2384,17 +3140,17 @@ class DesignAtomsMockups3dApiClient extends ApiClientBase {
|
|
|
2384
3140
|
observe: "response",
|
|
2385
3141
|
responseType: "blob",
|
|
2386
3142
|
headers: new HttpHeaders({
|
|
2387
|
-
"Accept": "application/
|
|
3143
|
+
"Accept": "application/octet-stream"
|
|
2388
3144
|
})
|
|
2389
3145
|
};
|
|
2390
3146
|
return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
|
|
2391
3147
|
return this.http.request("get", url_, transformedOptions_);
|
|
2392
3148
|
})).pipe(mergeMap((response_) => {
|
|
2393
|
-
return this.transformResult(url_, response_, (r) => this.
|
|
3149
|
+
return this.transformResult(url_, response_, (r) => this.processExtractBackground(r));
|
|
2394
3150
|
})).pipe(catchError((response_) => {
|
|
2395
3151
|
if (response_ instanceof HttpResponseBase) {
|
|
2396
3152
|
try {
|
|
2397
|
-
return this.transformResult(url_, response_, (r) => this.
|
|
3153
|
+
return this.transformResult(url_, response_, (r) => this.processExtractBackground(r));
|
|
2398
3154
|
}
|
|
2399
3155
|
catch (e) {
|
|
2400
3156
|
return throwError(e);
|
|
@@ -2404,7 +3160,7 @@ class DesignAtomsMockups3dApiClient extends ApiClientBase {
|
|
|
2404
3160
|
return throwError(response_);
|
|
2405
3161
|
}));
|
|
2406
3162
|
}
|
|
2407
|
-
|
|
3163
|
+
processExtractBackground(response) {
|
|
2408
3164
|
const status = response.status;
|
|
2409
3165
|
const responseBlob = response instanceof HttpResponse ? response.body :
|
|
2410
3166
|
response.error instanceof Blob ? response.error : undefined;
|
|
@@ -2414,12 +3170,11 @@ class DesignAtomsMockups3dApiClient extends ApiClientBase {
|
|
|
2414
3170
|
_headers[key] = response.headers.get(key);
|
|
2415
3171
|
}
|
|
2416
3172
|
}
|
|
2417
|
-
if (status === 200) {
|
|
2418
|
-
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
|
|
2422
|
-
}));
|
|
3173
|
+
if (status === 200 || status === 206) {
|
|
3174
|
+
const contentDisposition = response.headers ? response.headers.get("content-disposition") : undefined;
|
|
3175
|
+
const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
|
|
3176
|
+
const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
|
|
3177
|
+
return of({ fileName: fileName, data: responseBlob, status: status, headers: _headers });
|
|
2423
3178
|
}
|
|
2424
3179
|
else if (status === 404) {
|
|
2425
3180
|
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
@@ -2453,19 +3208,19 @@ class DesignAtomsMockups3dApiClient extends ApiClientBase {
|
|
|
2453
3208
|
return of(null);
|
|
2454
3209
|
}
|
|
2455
3210
|
/**
|
|
2456
|
-
*
|
|
2457
|
-
* @param id
|
|
2458
|
-
* @param
|
|
3211
|
+
* Loads product (design model) from design file taken from storage.
|
|
3212
|
+
* @param id Design identifier.
|
|
3213
|
+
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
2459
3214
|
* @param tenantId (optional) Tenant identifier
|
|
2460
3215
|
* @return Success
|
|
2461
3216
|
*/
|
|
2462
|
-
|
|
2463
|
-
let url_ = this.baseUrl + "/api/atoms/v1/
|
|
3217
|
+
loadProduct(id, privateStorageOwner, tenantId) {
|
|
3218
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/model?";
|
|
2464
3219
|
if (id === undefined || id === null)
|
|
2465
3220
|
throw new Error("The parameter 'id' must be defined.");
|
|
2466
3221
|
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
2467
|
-
if (
|
|
2468
|
-
url_ += "
|
|
3222
|
+
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
3223
|
+
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
2469
3224
|
if (tenantId === null)
|
|
2470
3225
|
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
2471
3226
|
else if (tenantId !== undefined)
|
|
@@ -2481,11 +3236,11 @@ class DesignAtomsMockups3dApiClient extends ApiClientBase {
|
|
|
2481
3236
|
return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
|
|
2482
3237
|
return this.http.request("get", url_, transformedOptions_);
|
|
2483
3238
|
})).pipe(mergeMap((response_) => {
|
|
2484
|
-
return this.transformResult(url_, response_, (r) => this.
|
|
3239
|
+
return this.transformResult(url_, response_, (r) => this.processLoadProduct(r));
|
|
2485
3240
|
})).pipe(catchError((response_) => {
|
|
2486
3241
|
if (response_ instanceof HttpResponseBase) {
|
|
2487
3242
|
try {
|
|
2488
|
-
return this.transformResult(url_, response_, (r) => this.
|
|
3243
|
+
return this.transformResult(url_, response_, (r) => this.processLoadProduct(r));
|
|
2489
3244
|
}
|
|
2490
3245
|
catch (e) {
|
|
2491
3246
|
return throwError(e);
|
|
@@ -2495,7 +3250,7 @@ class DesignAtomsMockups3dApiClient extends ApiClientBase {
|
|
|
2495
3250
|
return throwError(response_);
|
|
2496
3251
|
}));
|
|
2497
3252
|
}
|
|
2498
|
-
|
|
3253
|
+
processLoadProduct(response) {
|
|
2499
3254
|
const status = response.status;
|
|
2500
3255
|
const responseBlob = response instanceof HttpResponse ? response.body :
|
|
2501
3256
|
response.error instanceof Blob ? response.error : undefined;
|
|
@@ -2505,11 +3260,97 @@ class DesignAtomsMockups3dApiClient extends ApiClientBase {
|
|
|
2505
3260
|
_headers[key] = response.headers.get(key);
|
|
2506
3261
|
}
|
|
2507
3262
|
}
|
|
2508
|
-
if (status === 200
|
|
2509
|
-
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
|
|
3263
|
+
if (status === 200) {
|
|
3264
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
3265
|
+
let result200 = null;
|
|
3266
|
+
result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
3267
|
+
return of(result200);
|
|
3268
|
+
}));
|
|
3269
|
+
}
|
|
3270
|
+
else if (status === 404) {
|
|
3271
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
3272
|
+
let result404 = null;
|
|
3273
|
+
result404 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
3274
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
3275
|
+
}));
|
|
3276
|
+
}
|
|
3277
|
+
else if (status === 401) {
|
|
3278
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
3279
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
3280
|
+
}));
|
|
3281
|
+
}
|
|
3282
|
+
else if (status === 403) {
|
|
3283
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
3284
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
3285
|
+
}));
|
|
3286
|
+
}
|
|
3287
|
+
else if (status !== 200 && status !== 204) {
|
|
3288
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
3289
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
3290
|
+
}));
|
|
3291
|
+
}
|
|
3292
|
+
return of(null);
|
|
3293
|
+
}
|
|
3294
|
+
/**
|
|
3295
|
+
* Saves product (design model) to design file and updates design in storage.
|
|
3296
|
+
* @param id Design identifier.
|
|
3297
|
+
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
3298
|
+
* @param tenantId (optional) Tenant identifier
|
|
3299
|
+
* @param body (optional) Serialized product description.
|
|
3300
|
+
* @return Success
|
|
3301
|
+
*/
|
|
3302
|
+
saveProduct(id, privateStorageOwner, tenantId, body) {
|
|
3303
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/model?";
|
|
3304
|
+
if (id === undefined || id === null)
|
|
3305
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
3306
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
3307
|
+
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
3308
|
+
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
3309
|
+
if (tenantId === null)
|
|
3310
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
3311
|
+
else if (tenantId !== undefined)
|
|
3312
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
3313
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
3314
|
+
const content_ = JSON.stringify(body);
|
|
3315
|
+
let options_ = {
|
|
3316
|
+
body: content_,
|
|
3317
|
+
observe: "response",
|
|
3318
|
+
responseType: "blob",
|
|
3319
|
+
headers: new HttpHeaders({
|
|
3320
|
+
"Content-Type": "application/json",
|
|
3321
|
+
})
|
|
3322
|
+
};
|
|
3323
|
+
return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
|
|
3324
|
+
return this.http.request("put", url_, transformedOptions_);
|
|
3325
|
+
})).pipe(mergeMap((response_) => {
|
|
3326
|
+
return this.transformResult(url_, response_, (r) => this.processSaveProduct(r));
|
|
3327
|
+
})).pipe(catchError((response_) => {
|
|
3328
|
+
if (response_ instanceof HttpResponseBase) {
|
|
3329
|
+
try {
|
|
3330
|
+
return this.transformResult(url_, response_, (r) => this.processSaveProduct(r));
|
|
3331
|
+
}
|
|
3332
|
+
catch (e) {
|
|
3333
|
+
return throwError(e);
|
|
3334
|
+
}
|
|
3335
|
+
}
|
|
3336
|
+
else
|
|
3337
|
+
return throwError(response_);
|
|
3338
|
+
}));
|
|
3339
|
+
}
|
|
3340
|
+
processSaveProduct(response) {
|
|
3341
|
+
const status = response.status;
|
|
3342
|
+
const responseBlob = response instanceof HttpResponse ? response.body :
|
|
3343
|
+
response.error instanceof Blob ? response.error : undefined;
|
|
3344
|
+
let _headers = {};
|
|
3345
|
+
if (response.headers) {
|
|
3346
|
+
for (let key of response.headers.keys()) {
|
|
3347
|
+
_headers[key] = response.headers.get(key);
|
|
3348
|
+
}
|
|
3349
|
+
}
|
|
3350
|
+
if (status === 200) {
|
|
3351
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
3352
|
+
return of(null);
|
|
3353
|
+
}));
|
|
2513
3354
|
}
|
|
2514
3355
|
else if (status === 404) {
|
|
2515
3356
|
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
@@ -2518,13 +3359,6 @@ class DesignAtomsMockups3dApiClient extends ApiClientBase {
|
|
|
2518
3359
|
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
2519
3360
|
}));
|
|
2520
3361
|
}
|
|
2521
|
-
else if (status === 422) {
|
|
2522
|
-
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2523
|
-
let result422 = null;
|
|
2524
|
-
result422 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
2525
|
-
return throwException("Client Error", status, _responseText, _headers, result422);
|
|
2526
|
-
}));
|
|
2527
|
-
}
|
|
2528
3362
|
else if (status === 401) {
|
|
2529
3363
|
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2530
3364
|
return throwException("Unauthorized", status, _responseText, _headers);
|
|
@@ -2543,39 +3377,61 @@ class DesignAtomsMockups3dApiClient extends ApiClientBase {
|
|
|
2543
3377
|
return of(null);
|
|
2544
3378
|
}
|
|
2545
3379
|
/**
|
|
2546
|
-
*
|
|
2547
|
-
* @param id
|
|
2548
|
-
* @param
|
|
3380
|
+
* Patches product (design model) in design file.
|
|
3381
|
+
* @param id Design identifier.
|
|
3382
|
+
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
2549
3383
|
* @param tenantId (optional) Tenant identifier
|
|
3384
|
+
* @param patchType (optional)
|
|
3385
|
+
* @param replaceImageItemFileInfo_itemName (optional)
|
|
3386
|
+
* @param replaceImageItemFileInfo_sourceFile (optional)
|
|
3387
|
+
* @param replacePlaceholderItemContentInfo_placeholderItemName (optional)
|
|
3388
|
+
* @param replacePlaceholderItemContentInfo_newContentType (optional)
|
|
3389
|
+
* @param replacePlaceholderItemContentInfo_sourceFile (optional)
|
|
2550
3390
|
* @return Success
|
|
2551
3391
|
*/
|
|
2552
|
-
|
|
2553
|
-
let url_ = this.baseUrl + "/api/atoms/v1/
|
|
3392
|
+
patchProduct(id, privateStorageOwner, tenantId, patchType, replaceImageItemFileInfo_itemName, replaceImageItemFileInfo_sourceFile, replacePlaceholderItemContentInfo_placeholderItemName, replacePlaceholderItemContentInfo_newContentType, replacePlaceholderItemContentInfo_sourceFile) {
|
|
3393
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/model?";
|
|
2554
3394
|
if (id === undefined || id === null)
|
|
2555
3395
|
throw new Error("The parameter 'id' must be defined.");
|
|
2556
3396
|
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
2557
|
-
if (
|
|
2558
|
-
url_ += "
|
|
3397
|
+
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
3398
|
+
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
2559
3399
|
if (tenantId === null)
|
|
2560
3400
|
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
2561
3401
|
else if (tenantId !== undefined)
|
|
2562
3402
|
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2563
3403
|
url_ = url_.replace(/[?&]$/, "");
|
|
3404
|
+
const content_ = new FormData();
|
|
3405
|
+
if (patchType === null || patchType === undefined)
|
|
3406
|
+
throw new Error("The parameter 'patchType' cannot be null.");
|
|
3407
|
+
else
|
|
3408
|
+
content_.append("patchType", patchType.toString());
|
|
3409
|
+
if (replaceImageItemFileInfo_itemName !== null && replaceImageItemFileInfo_itemName !== undefined)
|
|
3410
|
+
content_.append("replaceImageItemFileInfo.itemName", replaceImageItemFileInfo_itemName.toString());
|
|
3411
|
+
if (replaceImageItemFileInfo_sourceFile !== null && replaceImageItemFileInfo_sourceFile !== undefined)
|
|
3412
|
+
content_.append("replaceImageItemFileInfo.sourceFile", replaceImageItemFileInfo_sourceFile.data, replaceImageItemFileInfo_sourceFile.fileName ? replaceImageItemFileInfo_sourceFile.fileName : "replaceImageItemFileInfo.sourceFile");
|
|
3413
|
+
if (replacePlaceholderItemContentInfo_placeholderItemName !== null && replacePlaceholderItemContentInfo_placeholderItemName !== undefined)
|
|
3414
|
+
content_.append("replacePlaceholderItemContentInfo.placeholderItemName", replacePlaceholderItemContentInfo_placeholderItemName.toString());
|
|
3415
|
+
if (replacePlaceholderItemContentInfo_newContentType === null || replacePlaceholderItemContentInfo_newContentType === undefined)
|
|
3416
|
+
throw new Error("The parameter 'replacePlaceholderItemContentInfo_newContentType' cannot be null.");
|
|
3417
|
+
else
|
|
3418
|
+
content_.append("replacePlaceholderItemContentInfo.newContentType", replacePlaceholderItemContentInfo_newContentType.toString());
|
|
3419
|
+
if (replacePlaceholderItemContentInfo_sourceFile !== null && replacePlaceholderItemContentInfo_sourceFile !== undefined)
|
|
3420
|
+
content_.append("replacePlaceholderItemContentInfo.sourceFile", replacePlaceholderItemContentInfo_sourceFile.data, replacePlaceholderItemContentInfo_sourceFile.fileName ? replacePlaceholderItemContentInfo_sourceFile.fileName : "replacePlaceholderItemContentInfo.sourceFile");
|
|
2564
3421
|
let options_ = {
|
|
3422
|
+
body: content_,
|
|
2565
3423
|
observe: "response",
|
|
2566
3424
|
responseType: "blob",
|
|
2567
|
-
headers: new HttpHeaders({
|
|
2568
|
-
"Accept": "application/json"
|
|
2569
|
-
})
|
|
3425
|
+
headers: new HttpHeaders({})
|
|
2570
3426
|
};
|
|
2571
3427
|
return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
|
|
2572
|
-
return this.http.request("
|
|
3428
|
+
return this.http.request("patch", url_, transformedOptions_);
|
|
2573
3429
|
})).pipe(mergeMap((response_) => {
|
|
2574
|
-
return this.transformResult(url_, response_, (r) => this.
|
|
3430
|
+
return this.transformResult(url_, response_, (r) => this.processPatchProduct(r));
|
|
2575
3431
|
})).pipe(catchError((response_) => {
|
|
2576
3432
|
if (response_ instanceof HttpResponseBase) {
|
|
2577
3433
|
try {
|
|
2578
|
-
return this.transformResult(url_, response_, (r) => this.
|
|
3434
|
+
return this.transformResult(url_, response_, (r) => this.processPatchProduct(r));
|
|
2579
3435
|
}
|
|
2580
3436
|
catch (e) {
|
|
2581
3437
|
return throwError(e);
|
|
@@ -2585,7 +3441,7 @@ class DesignAtomsMockups3dApiClient extends ApiClientBase {
|
|
|
2585
3441
|
return throwError(response_);
|
|
2586
3442
|
}));
|
|
2587
3443
|
}
|
|
2588
|
-
|
|
3444
|
+
processPatchProduct(response) {
|
|
2589
3445
|
const status = response.status;
|
|
2590
3446
|
const responseBlob = response instanceof HttpResponse ? response.body :
|
|
2591
3447
|
response.error instanceof Blob ? response.error : undefined;
|
|
@@ -2595,11 +3451,10 @@ class DesignAtomsMockups3dApiClient extends ApiClientBase {
|
|
|
2595
3451
|
_headers[key] = response.headers.get(key);
|
|
2596
3452
|
}
|
|
2597
3453
|
}
|
|
2598
|
-
if (status === 200
|
|
2599
|
-
|
|
2600
|
-
|
|
2601
|
-
|
|
2602
|
-
return of({ fileName: fileName, data: responseBlob, status: status, headers: _headers });
|
|
3454
|
+
if (status === 200) {
|
|
3455
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
3456
|
+
return of(null);
|
|
3457
|
+
}));
|
|
2603
3458
|
}
|
|
2604
3459
|
else if (status === 404) {
|
|
2605
3460
|
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
@@ -2608,13 +3463,6 @@ class DesignAtomsMockups3dApiClient extends ApiClientBase {
|
|
|
2608
3463
|
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
2609
3464
|
}));
|
|
2610
3465
|
}
|
|
2611
|
-
else if (status === 422) {
|
|
2612
|
-
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2613
|
-
let result422 = null;
|
|
2614
|
-
result422 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
2615
|
-
return throwException("Client Error", status, _responseText, _headers, result422);
|
|
2616
|
-
}));
|
|
2617
|
-
}
|
|
2618
3466
|
else if (status === 401) {
|
|
2619
3467
|
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2620
3468
|
return throwException("Unauthorized", status, _responseText, _headers);
|
|
@@ -2632,34 +3480,18 @@ class DesignAtomsMockups3dApiClient extends ApiClientBase {
|
|
|
2632
3480
|
}
|
|
2633
3481
|
return of(null);
|
|
2634
3482
|
}
|
|
2635
|
-
}
|
|
2636
|
-
DesignAtomsMockups3dApiClient.ɵprov = ɵɵdefineInjectable({ factory: function DesignAtomsMockups3dApiClient_Factory() { return new DesignAtomsMockups3dApiClient(ɵɵinject(ApiClientConfiguration), ɵɵinject(HttpClient), ɵɵinject(API_BASE_URL, 8)); }, token: DesignAtomsMockups3dApiClient, providedIn: "root" });
|
|
2637
|
-
DesignAtomsMockups3dApiClient.decorators = [
|
|
2638
|
-
{ type: Injectable, args: [{
|
|
2639
|
-
providedIn: 'root'
|
|
2640
|
-
},] }
|
|
2641
|
-
];
|
|
2642
|
-
DesignAtomsMockups3dApiClient.ctorParameters = () => [
|
|
2643
|
-
{ type: ApiClientConfiguration, decorators: [{ type: Inject, args: [ApiClientConfiguration,] }] },
|
|
2644
|
-
{ type: HttpClient, decorators: [{ type: Inject, args: [HttpClient,] }] },
|
|
2645
|
-
{ type: String, decorators: [{ type: Optional }, { type: Inject, args: [API_BASE_URL,] }] }
|
|
2646
|
-
];
|
|
2647
|
-
class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
2648
|
-
constructor(configuration, http, baseUrl) {
|
|
2649
|
-
super(configuration);
|
|
2650
|
-
this.jsonParseReviver = undefined;
|
|
2651
|
-
this.http = http;
|
|
2652
|
-
this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : this.getBaseUrl("");
|
|
2653
|
-
}
|
|
2654
3483
|
/**
|
|
2655
|
-
*
|
|
3484
|
+
* Returns design parameters stored in product model.
|
|
3485
|
+
* @param id Design identifier.
|
|
2656
3486
|
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
2657
3487
|
* @param tenantId (optional) Tenant identifier
|
|
2658
|
-
* @
|
|
2659
|
-
* @return Created
|
|
3488
|
+
* @return Success
|
|
2660
3489
|
*/
|
|
2661
|
-
|
|
2662
|
-
let url_ = this.baseUrl + "/api/atoms/v1/designs?";
|
|
3490
|
+
getDesignParameters(id, privateStorageOwner, tenantId) {
|
|
3491
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/parameters?";
|
|
3492
|
+
if (id === undefined || id === null)
|
|
3493
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
3494
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
2663
3495
|
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
2664
3496
|
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
2665
3497
|
if (tenantId === null)
|
|
@@ -2667,24 +3499,21 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2667
3499
|
else if (tenantId !== undefined)
|
|
2668
3500
|
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2669
3501
|
url_ = url_.replace(/[?&]$/, "");
|
|
2670
|
-
const content_ = JSON.stringify(body);
|
|
2671
3502
|
let options_ = {
|
|
2672
|
-
body: content_,
|
|
2673
3503
|
observe: "response",
|
|
2674
3504
|
responseType: "blob",
|
|
2675
3505
|
headers: new HttpHeaders({
|
|
2676
|
-
"Content-Type": "application/json",
|
|
2677
3506
|
"Accept": "application/json"
|
|
2678
3507
|
})
|
|
2679
3508
|
};
|
|
2680
3509
|
return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
|
|
2681
|
-
return this.http.request("
|
|
3510
|
+
return this.http.request("get", url_, transformedOptions_);
|
|
2682
3511
|
})).pipe(mergeMap((response_) => {
|
|
2683
|
-
return this.transformResult(url_, response_, (r) => this.
|
|
3512
|
+
return this.transformResult(url_, response_, (r) => this.processGetDesignParameters(r));
|
|
2684
3513
|
})).pipe(catchError((response_) => {
|
|
2685
3514
|
if (response_ instanceof HttpResponseBase) {
|
|
2686
3515
|
try {
|
|
2687
|
-
return this.transformResult(url_, response_, (r) => this.
|
|
3516
|
+
return this.transformResult(url_, response_, (r) => this.processGetDesignParameters(r));
|
|
2688
3517
|
}
|
|
2689
3518
|
catch (e) {
|
|
2690
3519
|
return throwError(e);
|
|
@@ -2694,7 +3523,7 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2694
3523
|
return throwError(response_);
|
|
2695
3524
|
}));
|
|
2696
3525
|
}
|
|
2697
|
-
|
|
3526
|
+
processGetDesignParameters(response) {
|
|
2698
3527
|
const status = response.status;
|
|
2699
3528
|
const responseBlob = response instanceof HttpResponse ? response.body :
|
|
2700
3529
|
response.error instanceof Blob ? response.error : undefined;
|
|
@@ -2704,11 +3533,18 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2704
3533
|
_headers[key] = response.headers.get(key);
|
|
2705
3534
|
}
|
|
2706
3535
|
}
|
|
2707
|
-
if (status ===
|
|
3536
|
+
if (status === 200) {
|
|
2708
3537
|
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2709
|
-
let
|
|
2710
|
-
|
|
2711
|
-
return of(
|
|
3538
|
+
let result200 = null;
|
|
3539
|
+
result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
3540
|
+
return of(result200);
|
|
3541
|
+
}));
|
|
3542
|
+
}
|
|
3543
|
+
else if (status === 404) {
|
|
3544
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
3545
|
+
let result404 = null;
|
|
3546
|
+
result404 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
3547
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
2712
3548
|
}));
|
|
2713
3549
|
}
|
|
2714
3550
|
else if (status === 401) {
|
|
@@ -2729,20 +3565,17 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2729
3565
|
return of(null);
|
|
2730
3566
|
}
|
|
2731
3567
|
/**
|
|
2732
|
-
*
|
|
3568
|
+
* Loads data schema from design file taken from storage.
|
|
2733
3569
|
* @param id Design identifier.
|
|
2734
|
-
* @param surfaceIndex (optional) Surface index.
|
|
2735
3570
|
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
2736
3571
|
* @param tenantId (optional) Tenant identifier
|
|
2737
3572
|
* @return Success
|
|
2738
3573
|
*/
|
|
2739
|
-
|
|
2740
|
-
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/
|
|
3574
|
+
loadDataSchema(id, privateStorageOwner, tenantId) {
|
|
3575
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/schema?";
|
|
2741
3576
|
if (id === undefined || id === null)
|
|
2742
3577
|
throw new Error("The parameter 'id' must be defined.");
|
|
2743
3578
|
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
2744
|
-
if (surfaceIndex !== undefined && surfaceIndex !== null)
|
|
2745
|
-
url_ += "surfaceIndex=" + encodeURIComponent("" + surfaceIndex) + "&";
|
|
2746
3579
|
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
2747
3580
|
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
2748
3581
|
if (tenantId === null)
|
|
@@ -2760,11 +3593,11 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2760
3593
|
return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
|
|
2761
3594
|
return this.http.request("get", url_, transformedOptions_);
|
|
2762
3595
|
})).pipe(mergeMap((response_) => {
|
|
2763
|
-
return this.transformResult(url_, response_, (r) => this.
|
|
3596
|
+
return this.transformResult(url_, response_, (r) => this.processLoadDataSchema(r));
|
|
2764
3597
|
})).pipe(catchError((response_) => {
|
|
2765
3598
|
if (response_ instanceof HttpResponseBase) {
|
|
2766
3599
|
try {
|
|
2767
|
-
return this.transformResult(url_, response_, (r) => this.
|
|
3600
|
+
return this.transformResult(url_, response_, (r) => this.processLoadDataSchema(r));
|
|
2768
3601
|
}
|
|
2769
3602
|
catch (e) {
|
|
2770
3603
|
return throwError(e);
|
|
@@ -2774,7 +3607,7 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2774
3607
|
return throwError(response_);
|
|
2775
3608
|
}));
|
|
2776
3609
|
}
|
|
2777
|
-
|
|
3610
|
+
processLoadDataSchema(response) {
|
|
2778
3611
|
const status = response.status;
|
|
2779
3612
|
const responseBlob = response instanceof HttpResponse ? response.body :
|
|
2780
3613
|
response.error instanceof Blob ? response.error : undefined;
|
|
@@ -2797,11 +3630,11 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2797
3630
|
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
2798
3631
|
}));
|
|
2799
3632
|
}
|
|
2800
|
-
else if (status ===
|
|
3633
|
+
else if (status === 409) {
|
|
2801
3634
|
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2802
|
-
let
|
|
2803
|
-
|
|
2804
|
-
return throwException("
|
|
3635
|
+
let result409 = null;
|
|
3636
|
+
result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
3637
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
2805
3638
|
}));
|
|
2806
3639
|
}
|
|
2807
3640
|
else if (status === 401) {
|
|
@@ -2822,14 +3655,14 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2822
3655
|
return of(null);
|
|
2823
3656
|
}
|
|
2824
3657
|
/**
|
|
2825
|
-
* Loads
|
|
3658
|
+
* Loads a toggle set from design file taken from storage.
|
|
2826
3659
|
* @param id Design identifier.
|
|
2827
3660
|
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
2828
3661
|
* @param tenantId (optional) Tenant identifier
|
|
2829
3662
|
* @return Success
|
|
2830
3663
|
*/
|
|
2831
|
-
|
|
2832
|
-
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/
|
|
3664
|
+
loadToggleSet(id, privateStorageOwner, tenantId) {
|
|
3665
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/toggle-set?";
|
|
2833
3666
|
if (id === undefined || id === null)
|
|
2834
3667
|
throw new Error("The parameter 'id' must be defined.");
|
|
2835
3668
|
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
@@ -2844,17 +3677,17 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2844
3677
|
observe: "response",
|
|
2845
3678
|
responseType: "blob",
|
|
2846
3679
|
headers: new HttpHeaders({
|
|
2847
|
-
"Accept": "application/
|
|
3680
|
+
"Accept": "application/octet-stream"
|
|
2848
3681
|
})
|
|
2849
3682
|
};
|
|
2850
3683
|
return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
|
|
2851
3684
|
return this.http.request("get", url_, transformedOptions_);
|
|
2852
3685
|
})).pipe(mergeMap((response_) => {
|
|
2853
|
-
return this.transformResult(url_, response_, (r) => this.
|
|
3686
|
+
return this.transformResult(url_, response_, (r) => this.processLoadToggleSet(r));
|
|
2854
3687
|
})).pipe(catchError((response_) => {
|
|
2855
3688
|
if (response_ instanceof HttpResponseBase) {
|
|
2856
3689
|
try {
|
|
2857
|
-
return this.transformResult(url_, response_, (r) => this.
|
|
3690
|
+
return this.transformResult(url_, response_, (r) => this.processLoadToggleSet(r));
|
|
2858
3691
|
}
|
|
2859
3692
|
catch (e) {
|
|
2860
3693
|
return throwError(e);
|
|
@@ -2864,7 +3697,7 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2864
3697
|
return throwError(response_);
|
|
2865
3698
|
}));
|
|
2866
3699
|
}
|
|
2867
|
-
|
|
3700
|
+
processLoadToggleSet(response) {
|
|
2868
3701
|
const status = response.status;
|
|
2869
3702
|
const responseBlob = response instanceof HttpResponse ? response.body :
|
|
2870
3703
|
response.error instanceof Blob ? response.error : undefined;
|
|
@@ -2874,12 +3707,11 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2874
3707
|
_headers[key] = response.headers.get(key);
|
|
2875
3708
|
}
|
|
2876
3709
|
}
|
|
2877
|
-
if (status === 200) {
|
|
2878
|
-
|
|
2879
|
-
|
|
2880
|
-
|
|
2881
|
-
|
|
2882
|
-
}));
|
|
3710
|
+
if (status === 200 || status === 206) {
|
|
3711
|
+
const contentDisposition = response.headers ? response.headers.get("content-disposition") : undefined;
|
|
3712
|
+
const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
|
|
3713
|
+
const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
|
|
3714
|
+
return of({ fileName: fileName, data: responseBlob, status: status, headers: _headers });
|
|
2883
3715
|
}
|
|
2884
3716
|
else if (status === 404) {
|
|
2885
3717
|
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
@@ -2888,6 +3720,13 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2888
3720
|
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
2889
3721
|
}));
|
|
2890
3722
|
}
|
|
3723
|
+
else if (status === 409) {
|
|
3724
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
3725
|
+
let result409 = null;
|
|
3726
|
+
result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
3727
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
3728
|
+
}));
|
|
3729
|
+
}
|
|
2891
3730
|
else if (status === 401) {
|
|
2892
3731
|
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2893
3732
|
return throwException("Unauthorized", status, _responseText, _headers);
|
|
@@ -2906,15 +3745,14 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2906
3745
|
return of(null);
|
|
2907
3746
|
}
|
|
2908
3747
|
/**
|
|
2909
|
-
*
|
|
3748
|
+
* Gets variable items information for design file taken from storage.
|
|
2910
3749
|
* @param id Design identifier.
|
|
2911
3750
|
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
2912
3751
|
* @param tenantId (optional) Tenant identifier
|
|
2913
|
-
* @param body (optional) Serialized product description.
|
|
2914
3752
|
* @return Success
|
|
2915
3753
|
*/
|
|
2916
|
-
|
|
2917
|
-
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/
|
|
3754
|
+
getVariables(id, privateStorageOwner, tenantId) {
|
|
3755
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/variables?";
|
|
2918
3756
|
if (id === undefined || id === null)
|
|
2919
3757
|
throw new Error("The parameter 'id' must be defined.");
|
|
2920
3758
|
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
@@ -2925,23 +3763,21 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2925
3763
|
else if (tenantId !== undefined)
|
|
2926
3764
|
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2927
3765
|
url_ = url_.replace(/[?&]$/, "");
|
|
2928
|
-
const content_ = JSON.stringify(body);
|
|
2929
3766
|
let options_ = {
|
|
2930
|
-
body: content_,
|
|
2931
3767
|
observe: "response",
|
|
2932
3768
|
responseType: "blob",
|
|
2933
3769
|
headers: new HttpHeaders({
|
|
2934
|
-
"
|
|
3770
|
+
"Accept": "application/json"
|
|
2935
3771
|
})
|
|
2936
3772
|
};
|
|
2937
3773
|
return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
|
|
2938
|
-
return this.http.request("
|
|
3774
|
+
return this.http.request("get", url_, transformedOptions_);
|
|
2939
3775
|
})).pipe(mergeMap((response_) => {
|
|
2940
|
-
return this.transformResult(url_, response_, (r) => this.
|
|
3776
|
+
return this.transformResult(url_, response_, (r) => this.processGetVariables(r));
|
|
2941
3777
|
})).pipe(catchError((response_) => {
|
|
2942
3778
|
if (response_ instanceof HttpResponseBase) {
|
|
2943
3779
|
try {
|
|
2944
|
-
return this.transformResult(url_, response_, (r) => this.
|
|
3780
|
+
return this.transformResult(url_, response_, (r) => this.processGetVariables(r));
|
|
2945
3781
|
}
|
|
2946
3782
|
catch (e) {
|
|
2947
3783
|
return throwError(e);
|
|
@@ -2951,7 +3787,7 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2951
3787
|
return throwError(response_);
|
|
2952
3788
|
}));
|
|
2953
3789
|
}
|
|
2954
|
-
|
|
3790
|
+
processGetVariables(response) {
|
|
2955
3791
|
const status = response.status;
|
|
2956
3792
|
const responseBlob = response instanceof HttpResponse ? response.body :
|
|
2957
3793
|
response.error instanceof Blob ? response.error : undefined;
|
|
@@ -2963,7 +3799,9 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2963
3799
|
}
|
|
2964
3800
|
if (status === 200) {
|
|
2965
3801
|
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2966
|
-
|
|
3802
|
+
let result200 = null;
|
|
3803
|
+
result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
3804
|
+
return of(result200);
|
|
2967
3805
|
}));
|
|
2968
3806
|
}
|
|
2969
3807
|
else if (status === 404) {
|
|
@@ -2991,61 +3829,42 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2991
3829
|
return of(null);
|
|
2992
3830
|
}
|
|
2993
3831
|
/**
|
|
2994
|
-
*
|
|
3832
|
+
* Sets variable items values for design file taken from storage.
|
|
2995
3833
|
* @param id Design identifier.
|
|
2996
3834
|
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
2997
3835
|
* @param tenantId (optional) Tenant identifier
|
|
2998
|
-
* @param
|
|
2999
|
-
* @
|
|
3000
|
-
|
|
3001
|
-
|
|
3002
|
-
|
|
3003
|
-
|
|
3004
|
-
|
|
3005
|
-
|
|
3006
|
-
|
|
3007
|
-
|
|
3008
|
-
if (
|
|
3009
|
-
throw new Error("The parameter '
|
|
3010
|
-
|
|
3011
|
-
|
|
3012
|
-
|
|
3013
|
-
|
|
3014
|
-
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
3015
|
-
else if (tenantId !== undefined)
|
|
3016
|
-
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
3017
|
-
url_ = url_.replace(/[?&]$/, "");
|
|
3018
|
-
const content_ = new FormData();
|
|
3019
|
-
if (patchType === null || patchType === undefined)
|
|
3020
|
-
throw new Error("The parameter 'patchType' cannot be null.");
|
|
3021
|
-
else
|
|
3022
|
-
content_.append("patchType", patchType.toString());
|
|
3023
|
-
if (replaceImageItemFileInfo_itemName !== null && replaceImageItemFileInfo_itemName !== undefined)
|
|
3024
|
-
content_.append("replaceImageItemFileInfo.itemName", replaceImageItemFileInfo_itemName.toString());
|
|
3025
|
-
if (replaceImageItemFileInfo_sourceFile !== null && replaceImageItemFileInfo_sourceFile !== undefined)
|
|
3026
|
-
content_.append("replaceImageItemFileInfo.sourceFile", replaceImageItemFileInfo_sourceFile.data, replaceImageItemFileInfo_sourceFile.fileName ? replaceImageItemFileInfo_sourceFile.fileName : "replaceImageItemFileInfo.sourceFile");
|
|
3027
|
-
if (replacePlaceholderItemContentInfo_placeholderItemName !== null && replacePlaceholderItemContentInfo_placeholderItemName !== undefined)
|
|
3028
|
-
content_.append("replacePlaceholderItemContentInfo.placeholderItemName", replacePlaceholderItemContentInfo_placeholderItemName.toString());
|
|
3029
|
-
if (replacePlaceholderItemContentInfo_newContentType === null || replacePlaceholderItemContentInfo_newContentType === undefined)
|
|
3030
|
-
throw new Error("The parameter 'replacePlaceholderItemContentInfo_newContentType' cannot be null.");
|
|
3031
|
-
else
|
|
3032
|
-
content_.append("replacePlaceholderItemContentInfo.newContentType", replacePlaceholderItemContentInfo_newContentType.toString());
|
|
3033
|
-
if (replacePlaceholderItemContentInfo_sourceFile !== null && replacePlaceholderItemContentInfo_sourceFile !== undefined)
|
|
3034
|
-
content_.append("replacePlaceholderItemContentInfo.sourceFile", replacePlaceholderItemContentInfo_sourceFile.data, replacePlaceholderItemContentInfo_sourceFile.fileName ? replacePlaceholderItemContentInfo_sourceFile.fileName : "replacePlaceholderItemContentInfo.sourceFile");
|
|
3836
|
+
* @param body (optional) Design variable values.
|
|
3837
|
+
* @return Success
|
|
3838
|
+
*/
|
|
3839
|
+
setVariables(id, privateStorageOwner, tenantId, body) {
|
|
3840
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/variables?";
|
|
3841
|
+
if (id === undefined || id === null)
|
|
3842
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
3843
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
3844
|
+
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
3845
|
+
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
3846
|
+
if (tenantId === null)
|
|
3847
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
3848
|
+
else if (tenantId !== undefined)
|
|
3849
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
3850
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
3851
|
+
const content_ = JSON.stringify(body);
|
|
3035
3852
|
let options_ = {
|
|
3036
3853
|
body: content_,
|
|
3037
3854
|
observe: "response",
|
|
3038
3855
|
responseType: "blob",
|
|
3039
|
-
headers: new HttpHeaders({
|
|
3856
|
+
headers: new HttpHeaders({
|
|
3857
|
+
"Content-Type": "application/json",
|
|
3858
|
+
})
|
|
3040
3859
|
};
|
|
3041
3860
|
return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
|
|
3042
|
-
return this.http.request("
|
|
3861
|
+
return this.http.request("put", url_, transformedOptions_);
|
|
3043
3862
|
})).pipe(mergeMap((response_) => {
|
|
3044
|
-
return this.transformResult(url_, response_, (r) => this.
|
|
3863
|
+
return this.transformResult(url_, response_, (r) => this.processSetVariables(r));
|
|
3045
3864
|
})).pipe(catchError((response_) => {
|
|
3046
3865
|
if (response_ instanceof HttpResponseBase) {
|
|
3047
3866
|
try {
|
|
3048
|
-
return this.transformResult(url_, response_, (r) => this.
|
|
3867
|
+
return this.transformResult(url_, response_, (r) => this.processSetVariables(r));
|
|
3049
3868
|
}
|
|
3050
3869
|
catch (e) {
|
|
3051
3870
|
return throwError(e);
|
|
@@ -3055,7 +3874,7 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3055
3874
|
return throwError(response_);
|
|
3056
3875
|
}));
|
|
3057
3876
|
}
|
|
3058
|
-
|
|
3877
|
+
processSetVariables(response) {
|
|
3059
3878
|
const status = response.status;
|
|
3060
3879
|
const responseBlob = response instanceof HttpResponse ? response.body :
|
|
3061
3880
|
response.error instanceof Blob ? response.error : undefined;
|
|
@@ -3077,6 +3896,13 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3077
3896
|
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
3078
3897
|
}));
|
|
3079
3898
|
}
|
|
3899
|
+
else if (status === 409) {
|
|
3900
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
3901
|
+
let result409 = null;
|
|
3902
|
+
result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
3903
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
3904
|
+
}));
|
|
3905
|
+
}
|
|
3080
3906
|
else if (status === 401) {
|
|
3081
3907
|
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
3082
3908
|
return throwException("Unauthorized", status, _responseText, _headers);
|
|
@@ -3095,14 +3921,14 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3095
3921
|
return of(null);
|
|
3096
3922
|
}
|
|
3097
3923
|
/**
|
|
3098
|
-
*
|
|
3924
|
+
* Loads variable data printing information from design file taken from storage.
|
|
3099
3925
|
* @param id Design identifier.
|
|
3100
3926
|
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
3101
3927
|
* @param tenantId (optional) Tenant identifier
|
|
3102
3928
|
* @return Success
|
|
3103
3929
|
*/
|
|
3104
|
-
|
|
3105
|
-
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/
|
|
3930
|
+
loadVdpData(id, privateStorageOwner, tenantId) {
|
|
3931
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/vdp-data?";
|
|
3106
3932
|
if (id === undefined || id === null)
|
|
3107
3933
|
throw new Error("The parameter 'id' must be defined.");
|
|
3108
3934
|
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
@@ -3123,11 +3949,11 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3123
3949
|
return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
|
|
3124
3950
|
return this.http.request("get", url_, transformedOptions_);
|
|
3125
3951
|
})).pipe(mergeMap((response_) => {
|
|
3126
|
-
return this.transformResult(url_, response_, (r) => this.
|
|
3952
|
+
return this.transformResult(url_, response_, (r) => this.processLoadVdpData(r));
|
|
3127
3953
|
})).pipe(catchError((response_) => {
|
|
3128
3954
|
if (response_ instanceof HttpResponseBase) {
|
|
3129
3955
|
try {
|
|
3130
|
-
return this.transformResult(url_, response_, (r) => this.
|
|
3956
|
+
return this.transformResult(url_, response_, (r) => this.processLoadVdpData(r));
|
|
3131
3957
|
}
|
|
3132
3958
|
catch (e) {
|
|
3133
3959
|
return throwError(e);
|
|
@@ -3137,7 +3963,7 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3137
3963
|
return throwError(response_);
|
|
3138
3964
|
}));
|
|
3139
3965
|
}
|
|
3140
|
-
|
|
3966
|
+
processLoadVdpData(response) {
|
|
3141
3967
|
const status = response.status;
|
|
3142
3968
|
const responseBlob = response instanceof HttpResponse ? response.body :
|
|
3143
3969
|
response.error instanceof Blob ? response.error : undefined;
|
|
@@ -3161,6 +3987,13 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3161
3987
|
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
3162
3988
|
}));
|
|
3163
3989
|
}
|
|
3990
|
+
else if (status === 409) {
|
|
3991
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
3992
|
+
let result409 = null;
|
|
3993
|
+
result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
3994
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
3995
|
+
}));
|
|
3996
|
+
}
|
|
3164
3997
|
else if (status === 401) {
|
|
3165
3998
|
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
3166
3999
|
return throwException("Unauthorized", status, _responseText, _headers);
|
|
@@ -3179,14 +4012,15 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3179
4012
|
return of(null);
|
|
3180
4013
|
}
|
|
3181
4014
|
/**
|
|
3182
|
-
*
|
|
4015
|
+
* Saves variable data printing information to design file and updates design in storage.
|
|
3183
4016
|
* @param id Design identifier.
|
|
3184
4017
|
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
3185
4018
|
* @param tenantId (optional) Tenant identifier
|
|
4019
|
+
* @param body (optional) Serialized vdp data.
|
|
3186
4020
|
* @return Success
|
|
3187
4021
|
*/
|
|
3188
|
-
|
|
3189
|
-
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/
|
|
4022
|
+
saveVdpData(id, privateStorageOwner, tenantId, body) {
|
|
4023
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/vdp-data?";
|
|
3190
4024
|
if (id === undefined || id === null)
|
|
3191
4025
|
throw new Error("The parameter 'id' must be defined.");
|
|
3192
4026
|
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
@@ -3197,21 +4031,23 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3197
4031
|
else if (tenantId !== undefined)
|
|
3198
4032
|
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
3199
4033
|
url_ = url_.replace(/[?&]$/, "");
|
|
4034
|
+
const content_ = JSON.stringify(body);
|
|
3200
4035
|
let options_ = {
|
|
4036
|
+
body: content_,
|
|
3201
4037
|
observe: "response",
|
|
3202
4038
|
responseType: "blob",
|
|
3203
4039
|
headers: new HttpHeaders({
|
|
3204
|
-
"
|
|
4040
|
+
"Content-Type": "application/json",
|
|
3205
4041
|
})
|
|
3206
4042
|
};
|
|
3207
4043
|
return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
|
|
3208
|
-
return this.http.request("
|
|
4044
|
+
return this.http.request("put", url_, transformedOptions_);
|
|
3209
4045
|
})).pipe(mergeMap((response_) => {
|
|
3210
|
-
return this.transformResult(url_, response_, (r) => this.
|
|
4046
|
+
return this.transformResult(url_, response_, (r) => this.processSaveVdpData(r));
|
|
3211
4047
|
})).pipe(catchError((response_) => {
|
|
3212
4048
|
if (response_ instanceof HttpResponseBase) {
|
|
3213
4049
|
try {
|
|
3214
|
-
return this.transformResult(url_, response_, (r) => this.
|
|
4050
|
+
return this.transformResult(url_, response_, (r) => this.processSaveVdpData(r));
|
|
3215
4051
|
}
|
|
3216
4052
|
catch (e) {
|
|
3217
4053
|
return throwError(e);
|
|
@@ -3221,7 +4057,7 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3221
4057
|
return throwError(response_);
|
|
3222
4058
|
}));
|
|
3223
4059
|
}
|
|
3224
|
-
|
|
4060
|
+
processSaveVdpData(response) {
|
|
3225
4061
|
const status = response.status;
|
|
3226
4062
|
const responseBlob = response instanceof HttpResponse ? response.body :
|
|
3227
4063
|
response.error instanceof Blob ? response.error : undefined;
|
|
@@ -3231,11 +4067,10 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3231
4067
|
_headers[key] = response.headers.get(key);
|
|
3232
4068
|
}
|
|
3233
4069
|
}
|
|
3234
|
-
if (status === 200
|
|
3235
|
-
|
|
3236
|
-
|
|
3237
|
-
|
|
3238
|
-
return of({ fileName: fileName, data: responseBlob, status: status, headers: _headers });
|
|
4070
|
+
if (status === 200) {
|
|
4071
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
4072
|
+
return of(null);
|
|
4073
|
+
}));
|
|
3239
4074
|
}
|
|
3240
4075
|
else if (status === 404) {
|
|
3241
4076
|
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
@@ -3244,13 +4079,6 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3244
4079
|
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
3245
4080
|
}));
|
|
3246
4081
|
}
|
|
3247
|
-
else if (status === 409) {
|
|
3248
|
-
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
3249
|
-
let result409 = null;
|
|
3250
|
-
result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
3251
|
-
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
3252
|
-
}));
|
|
3253
|
-
}
|
|
3254
4082
|
else if (status === 401) {
|
|
3255
4083
|
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
3256
4084
|
return throwException("Unauthorized", status, _responseText, _headers);
|
|
@@ -3269,14 +4097,14 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3269
4097
|
return of(null);
|
|
3270
4098
|
}
|
|
3271
4099
|
/**
|
|
3272
|
-
*
|
|
4100
|
+
* Deletes variable data printing information from design file and updates design in storage.
|
|
3273
4101
|
* @param id Design identifier.
|
|
3274
4102
|
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
3275
4103
|
* @param tenantId (optional) Tenant identifier
|
|
3276
4104
|
* @return Success
|
|
3277
4105
|
*/
|
|
3278
|
-
|
|
3279
|
-
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/
|
|
4106
|
+
deleteVdpData(id, privateStorageOwner, tenantId) {
|
|
4107
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/vdp-data?";
|
|
3280
4108
|
if (id === undefined || id === null)
|
|
3281
4109
|
throw new Error("The parameter 'id' must be defined.");
|
|
3282
4110
|
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
@@ -3290,18 +4118,16 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3290
4118
|
let options_ = {
|
|
3291
4119
|
observe: "response",
|
|
3292
4120
|
responseType: "blob",
|
|
3293
|
-
headers: new HttpHeaders({
|
|
3294
|
-
"Accept": "application/octet-stream"
|
|
3295
|
-
})
|
|
4121
|
+
headers: new HttpHeaders({})
|
|
3296
4122
|
};
|
|
3297
4123
|
return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
|
|
3298
|
-
return this.http.request("
|
|
4124
|
+
return this.http.request("delete", url_, transformedOptions_);
|
|
3299
4125
|
})).pipe(mergeMap((response_) => {
|
|
3300
|
-
return this.transformResult(url_, response_, (r) => this.
|
|
4126
|
+
return this.transformResult(url_, response_, (r) => this.processDeleteVdpData(r));
|
|
3301
4127
|
})).pipe(catchError((response_) => {
|
|
3302
4128
|
if (response_ instanceof HttpResponseBase) {
|
|
3303
4129
|
try {
|
|
3304
|
-
return this.transformResult(url_, response_, (r) => this.
|
|
4130
|
+
return this.transformResult(url_, response_, (r) => this.processDeleteVdpData(r));
|
|
3305
4131
|
}
|
|
3306
4132
|
catch (e) {
|
|
3307
4133
|
return throwError(e);
|
|
@@ -3311,7 +4137,7 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3311
4137
|
return throwError(response_);
|
|
3312
4138
|
}));
|
|
3313
4139
|
}
|
|
3314
|
-
|
|
4140
|
+
processDeleteVdpData(response) {
|
|
3315
4141
|
const status = response.status;
|
|
3316
4142
|
const responseBlob = response instanceof HttpResponse ? response.body :
|
|
3317
4143
|
response.error instanceof Blob ? response.error : undefined;
|
|
@@ -3321,17 +4147,9 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3321
4147
|
_headers[key] = response.headers.get(key);
|
|
3322
4148
|
}
|
|
3323
4149
|
}
|
|
3324
|
-
if (status === 200
|
|
3325
|
-
const contentDisposition = response.headers ? response.headers.get("content-disposition") : undefined;
|
|
3326
|
-
const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
|
|
3327
|
-
const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
|
|
3328
|
-
return of({ fileName: fileName, data: responseBlob, status: status, headers: _headers });
|
|
3329
|
-
}
|
|
3330
|
-
else if (status === 404) {
|
|
4150
|
+
if (status === 200) {
|
|
3331
4151
|
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
3332
|
-
|
|
3333
|
-
result404 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
3334
|
-
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
4152
|
+
return of(null);
|
|
3335
4153
|
}));
|
|
3336
4154
|
}
|
|
3337
4155
|
else if (status === 409) {
|
|
@@ -3359,14 +4177,14 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3359
4177
|
return of(null);
|
|
3360
4178
|
}
|
|
3361
4179
|
/**
|
|
3362
|
-
*
|
|
3363
|
-
* @param id
|
|
4180
|
+
* Loads product (design model) from resource file taken from storage.
|
|
4181
|
+
* @param id Resource identifier.
|
|
3364
4182
|
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
3365
4183
|
* @param tenantId (optional) Tenant identifier
|
|
3366
4184
|
* @return Success
|
|
3367
4185
|
*/
|
|
3368
|
-
|
|
3369
|
-
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/
|
|
4186
|
+
loadProductFromResource(id, privateStorageOwner, tenantId) {
|
|
4187
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/from-resource/{id}/model?";
|
|
3370
4188
|
if (id === undefined || id === null)
|
|
3371
4189
|
throw new Error("The parameter 'id' must be defined.");
|
|
3372
4190
|
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
@@ -3387,11 +4205,11 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3387
4205
|
return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
|
|
3388
4206
|
return this.http.request("get", url_, transformedOptions_);
|
|
3389
4207
|
})).pipe(mergeMap((response_) => {
|
|
3390
|
-
return this.transformResult(url_, response_, (r) => this.
|
|
4208
|
+
return this.transformResult(url_, response_, (r) => this.processLoadProductFromResource(r));
|
|
3391
4209
|
})).pipe(catchError((response_) => {
|
|
3392
4210
|
if (response_ instanceof HttpResponseBase) {
|
|
3393
4211
|
try {
|
|
3394
|
-
return this.transformResult(url_, response_, (r) => this.
|
|
4212
|
+
return this.transformResult(url_, response_, (r) => this.processLoadProductFromResource(r));
|
|
3395
4213
|
}
|
|
3396
4214
|
catch (e) {
|
|
3397
4215
|
return throwError(e);
|
|
@@ -3401,7 +4219,7 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3401
4219
|
return throwError(response_);
|
|
3402
4220
|
}));
|
|
3403
4221
|
}
|
|
3404
|
-
|
|
4222
|
+
processLoadProductFromResource(response) {
|
|
3405
4223
|
const status = response.status;
|
|
3406
4224
|
const responseBlob = response instanceof HttpResponse ? response.body :
|
|
3407
4225
|
response.error instanceof Blob ? response.error : undefined;
|
|
@@ -3425,6 +4243,13 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3425
4243
|
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
3426
4244
|
}));
|
|
3427
4245
|
}
|
|
4246
|
+
else if (status === 422) {
|
|
4247
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
4248
|
+
let result422 = null;
|
|
4249
|
+
result422 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
4250
|
+
return throwException("Client Error", status, _responseText, _headers, result422);
|
|
4251
|
+
}));
|
|
4252
|
+
}
|
|
3428
4253
|
else if (status === 401) {
|
|
3429
4254
|
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
3430
4255
|
return throwException("Unauthorized", status, _responseText, _headers);
|
|
@@ -3443,20 +4268,13 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3443
4268
|
return of(null);
|
|
3444
4269
|
}
|
|
3445
4270
|
/**
|
|
3446
|
-
*
|
|
3447
|
-
* @param id Design identifier.
|
|
3448
|
-
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
4271
|
+
* Converts colors.
|
|
3449
4272
|
* @param tenantId (optional) Tenant identifier
|
|
3450
|
-
* @param body (optional)
|
|
4273
|
+
* @param body (optional) Convert colors operation parameters.
|
|
3451
4274
|
* @return Success
|
|
3452
4275
|
*/
|
|
3453
|
-
|
|
3454
|
-
let url_ = this.baseUrl + "/api/atoms/v1/designs/
|
|
3455
|
-
if (id === undefined || id === null)
|
|
3456
|
-
throw new Error("The parameter 'id' must be defined.");
|
|
3457
|
-
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
3458
|
-
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
3459
|
-
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
4276
|
+
convertColors(tenantId, body) {
|
|
4277
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/model/convert-colors?";
|
|
3460
4278
|
if (tenantId === null)
|
|
3461
4279
|
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
3462
4280
|
else if (tenantId !== undefined)
|
|
@@ -3469,16 +4287,17 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3469
4287
|
responseType: "blob",
|
|
3470
4288
|
headers: new HttpHeaders({
|
|
3471
4289
|
"Content-Type": "application/json",
|
|
4290
|
+
"Accept": "application/json"
|
|
3472
4291
|
})
|
|
3473
4292
|
};
|
|
3474
4293
|
return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
|
|
3475
|
-
return this.http.request("
|
|
4294
|
+
return this.http.request("post", url_, transformedOptions_);
|
|
3476
4295
|
})).pipe(mergeMap((response_) => {
|
|
3477
|
-
return this.transformResult(url_, response_, (r) => this.
|
|
4296
|
+
return this.transformResult(url_, response_, (r) => this.processConvertColors(r));
|
|
3478
4297
|
})).pipe(catchError((response_) => {
|
|
3479
4298
|
if (response_ instanceof HttpResponseBase) {
|
|
3480
4299
|
try {
|
|
3481
|
-
return this.transformResult(url_, response_, (r) => this.
|
|
4300
|
+
return this.transformResult(url_, response_, (r) => this.processConvertColors(r));
|
|
3482
4301
|
}
|
|
3483
4302
|
catch (e) {
|
|
3484
4303
|
return throwError(e);
|
|
@@ -3488,7 +4307,7 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3488
4307
|
return throwError(response_);
|
|
3489
4308
|
}));
|
|
3490
4309
|
}
|
|
3491
|
-
|
|
4310
|
+
processConvertColors(response) {
|
|
3492
4311
|
const status = response.status;
|
|
3493
4312
|
const responseBlob = response instanceof HttpResponse ? response.body :
|
|
3494
4313
|
response.error instanceof Blob ? response.error : undefined;
|
|
@@ -3500,7 +4319,9 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3500
4319
|
}
|
|
3501
4320
|
if (status === 200) {
|
|
3502
4321
|
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
3503
|
-
|
|
4322
|
+
let result200 = null;
|
|
4323
|
+
result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
4324
|
+
return of(result200);
|
|
3504
4325
|
}));
|
|
3505
4326
|
}
|
|
3506
4327
|
else if (status === 404) {
|
|
@@ -3510,13 +4331,6 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3510
4331
|
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
3511
4332
|
}));
|
|
3512
4333
|
}
|
|
3513
|
-
else if (status === 409) {
|
|
3514
|
-
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
3515
|
-
let result409 = null;
|
|
3516
|
-
result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
3517
|
-
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
3518
|
-
}));
|
|
3519
|
-
}
|
|
3520
4334
|
else if (status === 401) {
|
|
3521
4335
|
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
3522
4336
|
return throwException("Unauthorized", status, _responseText, _headers);
|
|
@@ -3535,39 +4349,36 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3535
4349
|
return of(null);
|
|
3536
4350
|
}
|
|
3537
4351
|
/**
|
|
3538
|
-
*
|
|
3539
|
-
* @param id Design identifier.
|
|
3540
|
-
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
4352
|
+
* Extracts product item image.
|
|
3541
4353
|
* @param tenantId (optional) Tenant identifier
|
|
4354
|
+
* @param body (optional) Extraction parameters.
|
|
3542
4355
|
* @return Success
|
|
3543
4356
|
*/
|
|
3544
|
-
|
|
3545
|
-
let url_ = this.baseUrl + "/api/atoms/v1/designs/
|
|
3546
|
-
if (id === undefined || id === null)
|
|
3547
|
-
throw new Error("The parameter 'id' must be defined.");
|
|
3548
|
-
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
3549
|
-
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
3550
|
-
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
4357
|
+
extractItemImage(tenantId, body) {
|
|
4358
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/model/items/extract-image?";
|
|
3551
4359
|
if (tenantId === null)
|
|
3552
4360
|
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
3553
4361
|
else if (tenantId !== undefined)
|
|
3554
4362
|
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
3555
4363
|
url_ = url_.replace(/[?&]$/, "");
|
|
4364
|
+
const content_ = JSON.stringify(body);
|
|
3556
4365
|
let options_ = {
|
|
4366
|
+
body: content_,
|
|
3557
4367
|
observe: "response",
|
|
3558
4368
|
responseType: "blob",
|
|
3559
4369
|
headers: new HttpHeaders({
|
|
3560
|
-
"
|
|
4370
|
+
"Content-Type": "application/json",
|
|
4371
|
+
"Accept": "application/octet-stream"
|
|
3561
4372
|
})
|
|
3562
4373
|
};
|
|
3563
4374
|
return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
|
|
3564
|
-
return this.http.request("
|
|
4375
|
+
return this.http.request("post", url_, transformedOptions_);
|
|
3565
4376
|
})).pipe(mergeMap((response_) => {
|
|
3566
|
-
return this.transformResult(url_, response_, (r) => this.
|
|
4377
|
+
return this.transformResult(url_, response_, (r) => this.processExtractItemImage(r));
|
|
3567
4378
|
})).pipe(catchError((response_) => {
|
|
3568
4379
|
if (response_ instanceof HttpResponseBase) {
|
|
3569
4380
|
try {
|
|
3570
|
-
return this.transformResult(url_, response_, (r) => this.
|
|
4381
|
+
return this.transformResult(url_, response_, (r) => this.processExtractItemImage(r));
|
|
3571
4382
|
}
|
|
3572
4383
|
catch (e) {
|
|
3573
4384
|
return throwError(e);
|
|
@@ -3577,7 +4388,7 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3577
4388
|
return throwError(response_);
|
|
3578
4389
|
}));
|
|
3579
4390
|
}
|
|
3580
|
-
|
|
4391
|
+
processExtractItemImage(response) {
|
|
3581
4392
|
const status = response.status;
|
|
3582
4393
|
const responseBlob = response instanceof HttpResponse ? response.body :
|
|
3583
4394
|
response.error instanceof Blob ? response.error : undefined;
|
|
@@ -3587,26 +4398,11 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3587
4398
|
_headers[key] = response.headers.get(key);
|
|
3588
4399
|
}
|
|
3589
4400
|
}
|
|
3590
|
-
if (status === 200) {
|
|
3591
|
-
|
|
3592
|
-
|
|
3593
|
-
|
|
3594
|
-
|
|
3595
|
-
}));
|
|
3596
|
-
}
|
|
3597
|
-
else if (status === 404) {
|
|
3598
|
-
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
3599
|
-
let result404 = null;
|
|
3600
|
-
result404 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
3601
|
-
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
3602
|
-
}));
|
|
3603
|
-
}
|
|
3604
|
-
else if (status === 409) {
|
|
3605
|
-
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
3606
|
-
let result409 = null;
|
|
3607
|
-
result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
3608
|
-
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
3609
|
-
}));
|
|
4401
|
+
if (status === 200 || status === 206) {
|
|
4402
|
+
const contentDisposition = response.headers ? response.headers.get("content-disposition") : undefined;
|
|
4403
|
+
const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
|
|
4404
|
+
const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
|
|
4405
|
+
return of({ fileName: fileName, data: responseBlob, status: status, headers: _headers });
|
|
3610
4406
|
}
|
|
3611
4407
|
else if (status === 401) {
|
|
3612
4408
|
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
@@ -3626,20 +4422,13 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3626
4422
|
return of(null);
|
|
3627
4423
|
}
|
|
3628
4424
|
/**
|
|
3629
|
-
*
|
|
3630
|
-
* @param id Design identifier.
|
|
3631
|
-
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
4425
|
+
* Flatten items.
|
|
3632
4426
|
* @param tenantId (optional) Tenant identifier
|
|
3633
|
-
* @param body (optional)
|
|
4427
|
+
* @param body (optional) Items to flatten.
|
|
3634
4428
|
* @return Success
|
|
3635
4429
|
*/
|
|
3636
|
-
|
|
3637
|
-
let url_ = this.baseUrl + "/api/atoms/v1/designs/
|
|
3638
|
-
if (id === undefined || id === null)
|
|
3639
|
-
throw new Error("The parameter 'id' must be defined.");
|
|
3640
|
-
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
3641
|
-
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
3642
|
-
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
4430
|
+
flattenItems(tenantId, body) {
|
|
4431
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/model/items/flatten?";
|
|
3643
4432
|
if (tenantId === null)
|
|
3644
4433
|
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
3645
4434
|
else if (tenantId !== undefined)
|
|
@@ -3652,16 +4441,17 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3652
4441
|
responseType: "blob",
|
|
3653
4442
|
headers: new HttpHeaders({
|
|
3654
4443
|
"Content-Type": "application/json",
|
|
4444
|
+
"Accept": "application/json"
|
|
3655
4445
|
})
|
|
3656
4446
|
};
|
|
3657
4447
|
return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
|
|
3658
|
-
return this.http.request("
|
|
4448
|
+
return this.http.request("post", url_, transformedOptions_);
|
|
3659
4449
|
})).pipe(mergeMap((response_) => {
|
|
3660
|
-
return this.transformResult(url_, response_, (r) => this.
|
|
4450
|
+
return this.transformResult(url_, response_, (r) => this.processFlattenItems(r));
|
|
3661
4451
|
})).pipe(catchError((response_) => {
|
|
3662
4452
|
if (response_ instanceof HttpResponseBase) {
|
|
3663
4453
|
try {
|
|
3664
|
-
return this.transformResult(url_, response_, (r) => this.
|
|
4454
|
+
return this.transformResult(url_, response_, (r) => this.processFlattenItems(r));
|
|
3665
4455
|
}
|
|
3666
4456
|
catch (e) {
|
|
3667
4457
|
return throwError(e);
|
|
@@ -3671,7 +4461,7 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3671
4461
|
return throwError(response_);
|
|
3672
4462
|
}));
|
|
3673
4463
|
}
|
|
3674
|
-
|
|
4464
|
+
processFlattenItems(response) {
|
|
3675
4465
|
const status = response.status;
|
|
3676
4466
|
const responseBlob = response instanceof HttpResponse ? response.body :
|
|
3677
4467
|
response.error instanceof Blob ? response.error : undefined;
|
|
@@ -3683,14 +4473,9 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3683
4473
|
}
|
|
3684
4474
|
if (status === 200) {
|
|
3685
4475
|
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
3686
|
-
|
|
3687
|
-
|
|
3688
|
-
|
|
3689
|
-
else if (status === 404) {
|
|
3690
|
-
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
3691
|
-
let result404 = null;
|
|
3692
|
-
result404 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
3693
|
-
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
4476
|
+
let result200 = null;
|
|
4477
|
+
result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
4478
|
+
return of(result200);
|
|
3694
4479
|
}));
|
|
3695
4480
|
}
|
|
3696
4481
|
else if (status === 401) {
|
|
@@ -3711,37 +4496,40 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3711
4496
|
return of(null);
|
|
3712
4497
|
}
|
|
3713
4498
|
/**
|
|
3714
|
-
*
|
|
3715
|
-
* @param
|
|
3716
|
-
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
4499
|
+
* Creates product item from input image file.
|
|
4500
|
+
* @param itemType (optional) Desired item type.
|
|
3717
4501
|
* @param tenantId (optional) Tenant identifier
|
|
4502
|
+
* @param sourceFile (optional)
|
|
3718
4503
|
* @return Success
|
|
3719
4504
|
*/
|
|
3720
|
-
|
|
3721
|
-
let url_ = this.baseUrl + "/api/atoms/v1/designs/
|
|
3722
|
-
if (
|
|
3723
|
-
|
|
3724
|
-
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
3725
|
-
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
3726
|
-
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
4505
|
+
createItemFromFile(itemType, tenantId, sourceFile) {
|
|
4506
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/model/items/from-file?";
|
|
4507
|
+
if (itemType !== undefined && itemType !== null)
|
|
4508
|
+
url_ += "itemType=" + encodeURIComponent("" + itemType) + "&";
|
|
3727
4509
|
if (tenantId === null)
|
|
3728
4510
|
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
3729
4511
|
else if (tenantId !== undefined)
|
|
3730
4512
|
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
3731
4513
|
url_ = url_.replace(/[?&]$/, "");
|
|
4514
|
+
const content_ = new FormData();
|
|
4515
|
+
if (sourceFile !== null && sourceFile !== undefined)
|
|
4516
|
+
content_.append("sourceFile", sourceFile.data, sourceFile.fileName ? sourceFile.fileName : "sourceFile");
|
|
3732
4517
|
let options_ = {
|
|
4518
|
+
body: content_,
|
|
3733
4519
|
observe: "response",
|
|
3734
4520
|
responseType: "blob",
|
|
3735
|
-
headers: new HttpHeaders({
|
|
4521
|
+
headers: new HttpHeaders({
|
|
4522
|
+
"Accept": "application/json"
|
|
4523
|
+
})
|
|
3736
4524
|
};
|
|
3737
4525
|
return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
|
|
3738
|
-
return this.http.request("
|
|
4526
|
+
return this.http.request("post", url_, transformedOptions_);
|
|
3739
4527
|
})).pipe(mergeMap((response_) => {
|
|
3740
|
-
return this.transformResult(url_, response_, (r) => this.
|
|
4528
|
+
return this.transformResult(url_, response_, (r) => this.processCreateItemFromFile(r));
|
|
3741
4529
|
})).pipe(catchError((response_) => {
|
|
3742
4530
|
if (response_ instanceof HttpResponseBase) {
|
|
3743
4531
|
try {
|
|
3744
|
-
return this.transformResult(url_, response_, (r) => this.
|
|
4532
|
+
return this.transformResult(url_, response_, (r) => this.processCreateItemFromFile(r));
|
|
3745
4533
|
}
|
|
3746
4534
|
catch (e) {
|
|
3747
4535
|
return throwError(e);
|
|
@@ -3751,7 +4539,7 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3751
4539
|
return throwError(response_);
|
|
3752
4540
|
}));
|
|
3753
4541
|
}
|
|
3754
|
-
|
|
4542
|
+
processCreateItemFromFile(response) {
|
|
3755
4543
|
const status = response.status;
|
|
3756
4544
|
const responseBlob = response instanceof HttpResponse ? response.body :
|
|
3757
4545
|
response.error instanceof Blob ? response.error : undefined;
|
|
@@ -3763,14 +4551,16 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3763
4551
|
}
|
|
3764
4552
|
if (status === 200) {
|
|
3765
4553
|
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
3766
|
-
|
|
4554
|
+
let result200 = null;
|
|
4555
|
+
result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
4556
|
+
return of(result200);
|
|
3767
4557
|
}));
|
|
3768
4558
|
}
|
|
3769
|
-
else if (status ===
|
|
4559
|
+
else if (status === 404) {
|
|
3770
4560
|
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
3771
|
-
let
|
|
3772
|
-
|
|
3773
|
-
return throwException("
|
|
4561
|
+
let result404 = null;
|
|
4562
|
+
result404 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
4563
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
3774
4564
|
}));
|
|
3775
4565
|
}
|
|
3776
4566
|
else if (status === 401) {
|
|
@@ -3791,25 +4581,26 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3791
4581
|
return of(null);
|
|
3792
4582
|
}
|
|
3793
4583
|
/**
|
|
3794
|
-
*
|
|
3795
|
-
* @param
|
|
3796
|
-
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
4584
|
+
* Creates multiple product items from input image files.
|
|
4585
|
+
* @param itemType (optional) Desired items type.
|
|
3797
4586
|
* @param tenantId (optional) Tenant identifier
|
|
4587
|
+
* @param sourceFiles (optional)
|
|
3798
4588
|
* @return Success
|
|
3799
4589
|
*/
|
|
3800
|
-
|
|
3801
|
-
let url_ = this.baseUrl + "/api/atoms/v1/designs/from-
|
|
3802
|
-
if (
|
|
3803
|
-
|
|
3804
|
-
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
3805
|
-
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
3806
|
-
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
4590
|
+
batchCreateItemsFromFile(itemType, tenantId, sourceFiles) {
|
|
4591
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/model/items/from-file/batch-create?";
|
|
4592
|
+
if (itemType !== undefined && itemType !== null)
|
|
4593
|
+
url_ += "itemType=" + encodeURIComponent("" + itemType) + "&";
|
|
3807
4594
|
if (tenantId === null)
|
|
3808
4595
|
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
3809
4596
|
else if (tenantId !== undefined)
|
|
3810
4597
|
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
3811
4598
|
url_ = url_.replace(/[?&]$/, "");
|
|
4599
|
+
const content_ = new FormData();
|
|
4600
|
+
if (sourceFiles !== null && sourceFiles !== undefined)
|
|
4601
|
+
sourceFiles.forEach(item_ => content_.append("sourceFiles", item_.data, item_.fileName ? item_.fileName : "sourceFiles"));
|
|
3812
4602
|
let options_ = {
|
|
4603
|
+
body: content_,
|
|
3813
4604
|
observe: "response",
|
|
3814
4605
|
responseType: "blob",
|
|
3815
4606
|
headers: new HttpHeaders({
|
|
@@ -3817,13 +4608,13 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3817
4608
|
})
|
|
3818
4609
|
};
|
|
3819
4610
|
return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
|
|
3820
|
-
return this.http.request("
|
|
4611
|
+
return this.http.request("post", url_, transformedOptions_);
|
|
3821
4612
|
})).pipe(mergeMap((response_) => {
|
|
3822
|
-
return this.transformResult(url_, response_, (r) => this.
|
|
4613
|
+
return this.transformResult(url_, response_, (r) => this.processBatchCreateItemsFromFile(r));
|
|
3823
4614
|
})).pipe(catchError((response_) => {
|
|
3824
4615
|
if (response_ instanceof HttpResponseBase) {
|
|
3825
4616
|
try {
|
|
3826
|
-
return this.transformResult(url_, response_, (r) => this.
|
|
4617
|
+
return this.transformResult(url_, response_, (r) => this.processBatchCreateItemsFromFile(r));
|
|
3827
4618
|
}
|
|
3828
4619
|
catch (e) {
|
|
3829
4620
|
return throwError(e);
|
|
@@ -3833,7 +4624,7 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3833
4624
|
return throwError(response_);
|
|
3834
4625
|
}));
|
|
3835
4626
|
}
|
|
3836
|
-
|
|
4627
|
+
processBatchCreateItemsFromFile(response) {
|
|
3837
4628
|
const status = response.status;
|
|
3838
4629
|
const responseBlob = response instanceof HttpResponse ? response.body :
|
|
3839
4630
|
response.error instanceof Blob ? response.error : undefined;
|
|
@@ -3857,13 +4648,6 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3857
4648
|
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
3858
4649
|
}));
|
|
3859
4650
|
}
|
|
3860
|
-
else if (status === 422) {
|
|
3861
|
-
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
3862
|
-
let result422 = null;
|
|
3863
|
-
result422 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
3864
|
-
return throwException("Client Error", status, _responseText, _headers, result422);
|
|
3865
|
-
}));
|
|
3866
|
-
}
|
|
3867
4651
|
else if (status === 401) {
|
|
3868
4652
|
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
3869
4653
|
return throwException("Unauthorized", status, _responseText, _headers);
|
|
@@ -3882,13 +4666,16 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3882
4666
|
return of(null);
|
|
3883
4667
|
}
|
|
3884
4668
|
/**
|
|
3885
|
-
*
|
|
4669
|
+
* Creates product item from image in storage.
|
|
4670
|
+
* @param itemType (optional) Desired item type.
|
|
3886
4671
|
* @param tenantId (optional) Tenant identifier
|
|
3887
|
-
* @param body (optional)
|
|
4672
|
+
* @param body (optional) Operation parameters.
|
|
3888
4673
|
* @return Success
|
|
3889
4674
|
*/
|
|
3890
|
-
|
|
3891
|
-
let url_ = this.baseUrl + "/api/atoms/v1/designs/model/
|
|
4675
|
+
createItemFromStorage(itemType, tenantId, body) {
|
|
4676
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/model/items/from-storage?";
|
|
4677
|
+
if (itemType !== undefined && itemType !== null)
|
|
4678
|
+
url_ += "itemType=" + encodeURIComponent("" + itemType) + "&";
|
|
3892
4679
|
if (tenantId === null)
|
|
3893
4680
|
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
3894
4681
|
else if (tenantId !== undefined)
|
|
@@ -3907,11 +4694,11 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3907
4694
|
return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
|
|
3908
4695
|
return this.http.request("post", url_, transformedOptions_);
|
|
3909
4696
|
})).pipe(mergeMap((response_) => {
|
|
3910
|
-
return this.transformResult(url_, response_, (r) => this.
|
|
4697
|
+
return this.transformResult(url_, response_, (r) => this.processCreateItemFromStorage(r));
|
|
3911
4698
|
})).pipe(catchError((response_) => {
|
|
3912
4699
|
if (response_ instanceof HttpResponseBase) {
|
|
3913
4700
|
try {
|
|
3914
|
-
return this.transformResult(url_, response_, (r) => this.
|
|
4701
|
+
return this.transformResult(url_, response_, (r) => this.processCreateItemFromStorage(r));
|
|
3915
4702
|
}
|
|
3916
4703
|
catch (e) {
|
|
3917
4704
|
return throwError(e);
|
|
@@ -3921,7 +4708,7 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3921
4708
|
return throwError(response_);
|
|
3922
4709
|
}));
|
|
3923
4710
|
}
|
|
3924
|
-
|
|
4711
|
+
processCreateItemFromStorage(response) {
|
|
3925
4712
|
const status = response.status;
|
|
3926
4713
|
const responseBlob = response instanceof HttpResponse ? response.body :
|
|
3927
4714
|
response.error instanceof Blob ? response.error : undefined;
|
|
@@ -3963,17 +4750,14 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3963
4750
|
return of(null);
|
|
3964
4751
|
}
|
|
3965
4752
|
/**
|
|
3966
|
-
* Creates product
|
|
3967
|
-
* @param itemType (optional) Desired
|
|
4753
|
+
* Creates multiple product items from images in storage.
|
|
4754
|
+
* @param itemType (optional) Desired items type.
|
|
3968
4755
|
* @param tenantId (optional) Tenant identifier
|
|
3969
|
-
* @param
|
|
3970
|
-
* @param sourceId (optional)
|
|
3971
|
-
* @param sourceOwnerId (optional)
|
|
3972
|
-
* @param sourceFile (optional)
|
|
4756
|
+
* @param body (optional) Create items operation parameters.
|
|
3973
4757
|
* @return Success
|
|
3974
4758
|
*/
|
|
3975
|
-
|
|
3976
|
-
let url_ = this.baseUrl + "/api/atoms/v1/designs/model/items?";
|
|
4759
|
+
batchCreateItemsFromStorage(itemType, tenantId, body) {
|
|
4760
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/model/items/from-storage/batch-create?";
|
|
3977
4761
|
if (itemType !== undefined && itemType !== null)
|
|
3978
4762
|
url_ += "itemType=" + encodeURIComponent("" + itemType) + "&";
|
|
3979
4763
|
if (tenantId === null)
|
|
@@ -3981,31 +4765,24 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3981
4765
|
else if (tenantId !== undefined)
|
|
3982
4766
|
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
3983
4767
|
url_ = url_.replace(/[?&]$/, "");
|
|
3984
|
-
const content_ =
|
|
3985
|
-
if (sourceType !== null && sourceType !== undefined)
|
|
3986
|
-
content_.append("sourceType", sourceType.toString());
|
|
3987
|
-
if (sourceId !== null && sourceId !== undefined)
|
|
3988
|
-
content_.append("sourceId", sourceId.toString());
|
|
3989
|
-
if (sourceOwnerId !== null && sourceOwnerId !== undefined)
|
|
3990
|
-
content_.append("sourceOwnerId", sourceOwnerId.toString());
|
|
3991
|
-
if (sourceFile !== null && sourceFile !== undefined)
|
|
3992
|
-
content_.append("sourceFile", sourceFile.data, sourceFile.fileName ? sourceFile.fileName : "sourceFile");
|
|
4768
|
+
const content_ = JSON.stringify(body);
|
|
3993
4769
|
let options_ = {
|
|
3994
4770
|
body: content_,
|
|
3995
4771
|
observe: "response",
|
|
3996
4772
|
responseType: "blob",
|
|
3997
4773
|
headers: new HttpHeaders({
|
|
4774
|
+
"Content-Type": "application/json",
|
|
3998
4775
|
"Accept": "application/json"
|
|
3999
4776
|
})
|
|
4000
4777
|
};
|
|
4001
4778
|
return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
|
|
4002
4779
|
return this.http.request("post", url_, transformedOptions_);
|
|
4003
4780
|
})).pipe(mergeMap((response_) => {
|
|
4004
|
-
return this.transformResult(url_, response_, (r) => this.
|
|
4781
|
+
return this.transformResult(url_, response_, (r) => this.processBatchCreateItemsFromStorage(r));
|
|
4005
4782
|
})).pipe(catchError((response_) => {
|
|
4006
4783
|
if (response_ instanceof HttpResponseBase) {
|
|
4007
4784
|
try {
|
|
4008
|
-
return this.transformResult(url_, response_, (r) => this.
|
|
4785
|
+
return this.transformResult(url_, response_, (r) => this.processBatchCreateItemsFromStorage(r));
|
|
4009
4786
|
}
|
|
4010
4787
|
catch (e) {
|
|
4011
4788
|
return throwError(e);
|
|
@@ -4015,7 +4792,7 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
4015
4792
|
return throwError(response_);
|
|
4016
4793
|
}));
|
|
4017
4794
|
}
|
|
4018
|
-
|
|
4795
|
+
processBatchCreateItemsFromStorage(response) {
|
|
4019
4796
|
const status = response.status;
|
|
4020
4797
|
const responseBlob = response instanceof HttpResponse ? response.body :
|
|
4021
4798
|
response.error instanceof Blob ? response.error : undefined;
|
|
@@ -4057,13 +4834,16 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
4057
4834
|
return of(null);
|
|
4058
4835
|
}
|
|
4059
4836
|
/**
|
|
4060
|
-
*
|
|
4837
|
+
* Creates product item from remote web image provided by URL.
|
|
4838
|
+
* @param itemType (optional) Desired item type.
|
|
4061
4839
|
* @param tenantId (optional) Tenant identifier
|
|
4062
|
-
* @param body (optional)
|
|
4840
|
+
* @param body (optional) Operation parameters.
|
|
4063
4841
|
* @return Success
|
|
4064
4842
|
*/
|
|
4065
|
-
|
|
4066
|
-
let url_ = this.baseUrl + "/api/atoms/v1/designs/model/items/
|
|
4843
|
+
createItemFromUrl(itemType, tenantId, body) {
|
|
4844
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/model/items/from-url?";
|
|
4845
|
+
if (itemType !== undefined && itemType !== null)
|
|
4846
|
+
url_ += "itemType=" + encodeURIComponent("" + itemType) + "&";
|
|
4067
4847
|
if (tenantId === null)
|
|
4068
4848
|
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
4069
4849
|
else if (tenantId !== undefined)
|
|
@@ -4076,17 +4856,17 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
4076
4856
|
responseType: "blob",
|
|
4077
4857
|
headers: new HttpHeaders({
|
|
4078
4858
|
"Content-Type": "application/json",
|
|
4079
|
-
"Accept": "application/
|
|
4859
|
+
"Accept": "application/json"
|
|
4080
4860
|
})
|
|
4081
4861
|
};
|
|
4082
4862
|
return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
|
|
4083
4863
|
return this.http.request("post", url_, transformedOptions_);
|
|
4084
4864
|
})).pipe(mergeMap((response_) => {
|
|
4085
|
-
return this.transformResult(url_, response_, (r) => this.
|
|
4865
|
+
return this.transformResult(url_, response_, (r) => this.processCreateItemFromUrl(r));
|
|
4086
4866
|
})).pipe(catchError((response_) => {
|
|
4087
4867
|
if (response_ instanceof HttpResponseBase) {
|
|
4088
4868
|
try {
|
|
4089
|
-
return this.transformResult(url_, response_, (r) => this.
|
|
4869
|
+
return this.transformResult(url_, response_, (r) => this.processCreateItemFromUrl(r));
|
|
4090
4870
|
}
|
|
4091
4871
|
catch (e) {
|
|
4092
4872
|
return throwError(e);
|
|
@@ -4096,7 +4876,7 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
4096
4876
|
return throwError(response_);
|
|
4097
4877
|
}));
|
|
4098
4878
|
}
|
|
4099
|
-
|
|
4879
|
+
processCreateItemFromUrl(response) {
|
|
4100
4880
|
const status = response.status;
|
|
4101
4881
|
const responseBlob = response instanceof HttpResponse ? response.body :
|
|
4102
4882
|
response.error instanceof Blob ? response.error : undefined;
|
|
@@ -4106,11 +4886,19 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
4106
4886
|
_headers[key] = response.headers.get(key);
|
|
4107
4887
|
}
|
|
4108
4888
|
}
|
|
4109
|
-
if (status === 200
|
|
4110
|
-
|
|
4111
|
-
|
|
4112
|
-
|
|
4113
|
-
|
|
4889
|
+
if (status === 200) {
|
|
4890
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
4891
|
+
let result200 = null;
|
|
4892
|
+
result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
4893
|
+
return of(result200);
|
|
4894
|
+
}));
|
|
4895
|
+
}
|
|
4896
|
+
else if (status === 404) {
|
|
4897
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
4898
|
+
let result404 = null;
|
|
4899
|
+
result404 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
4900
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
4901
|
+
}));
|
|
4114
4902
|
}
|
|
4115
4903
|
else if (status === 401) {
|
|
4116
4904
|
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
@@ -4130,13 +4918,16 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
4130
4918
|
return of(null);
|
|
4131
4919
|
}
|
|
4132
4920
|
/**
|
|
4133
|
-
*
|
|
4921
|
+
* Creates multiple product items from remote web images provided by URLs list.
|
|
4922
|
+
* @param itemType (optional) Desired items type.
|
|
4134
4923
|
* @param tenantId (optional) Tenant identifier
|
|
4135
|
-
* @param body (optional)
|
|
4924
|
+
* @param body (optional) Operation parameters.
|
|
4136
4925
|
* @return Success
|
|
4137
4926
|
*/
|
|
4138
|
-
|
|
4139
|
-
let url_ = this.baseUrl + "/api/atoms/v1/designs/model/items/
|
|
4927
|
+
batchCreateItemsFromUrl(itemType, tenantId, body) {
|
|
4928
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/model/items/from-url/batch-create?";
|
|
4929
|
+
if (itemType !== undefined && itemType !== null)
|
|
4930
|
+
url_ += "itemType=" + encodeURIComponent("" + itemType) + "&";
|
|
4140
4931
|
if (tenantId === null)
|
|
4141
4932
|
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
4142
4933
|
else if (tenantId !== undefined)
|
|
@@ -4155,11 +4946,11 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
4155
4946
|
return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
|
|
4156
4947
|
return this.http.request("post", url_, transformedOptions_);
|
|
4157
4948
|
})).pipe(mergeMap((response_) => {
|
|
4158
|
-
return this.transformResult(url_, response_, (r) => this.
|
|
4949
|
+
return this.transformResult(url_, response_, (r) => this.processBatchCreateItemsFromUrl(r));
|
|
4159
4950
|
})).pipe(catchError((response_) => {
|
|
4160
4951
|
if (response_ instanceof HttpResponseBase) {
|
|
4161
4952
|
try {
|
|
4162
|
-
return this.transformResult(url_, response_, (r) => this.
|
|
4953
|
+
return this.transformResult(url_, response_, (r) => this.processBatchCreateItemsFromUrl(r));
|
|
4163
4954
|
}
|
|
4164
4955
|
catch (e) {
|
|
4165
4956
|
return throwError(e);
|
|
@@ -4169,7 +4960,7 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
4169
4960
|
return throwError(response_);
|
|
4170
4961
|
}));
|
|
4171
4962
|
}
|
|
4172
|
-
|
|
4963
|
+
processBatchCreateItemsFromUrl(response) {
|
|
4173
4964
|
const status = response.status;
|
|
4174
4965
|
const responseBlob = response instanceof HttpResponse ? response.body :
|
|
4175
4966
|
response.error instanceof Blob ? response.error : undefined;
|
|
@@ -4186,6 +4977,13 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
4186
4977
|
return of(result200);
|
|
4187
4978
|
}));
|
|
4188
4979
|
}
|
|
4980
|
+
else if (status === 404) {
|
|
4981
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
4982
|
+
let result404 = null;
|
|
4983
|
+
result404 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
4984
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
4985
|
+
}));
|
|
4986
|
+
}
|
|
4189
4987
|
else if (status === 401) {
|
|
4190
4988
|
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
4191
4989
|
return throwException("Unauthorized", status, _responseText, _headers);
|
|
@@ -4414,6 +5212,13 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
4414
5212
|
return of(result200);
|
|
4415
5213
|
}));
|
|
4416
5214
|
}
|
|
5215
|
+
else if (status === 409) {
|
|
5216
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
5217
|
+
let result409 = null;
|
|
5218
|
+
result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
5219
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
5220
|
+
}));
|
|
5221
|
+
}
|
|
4417
5222
|
else if (status === 401) {
|
|
4418
5223
|
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
4419
5224
|
return throwException("Unauthorized", status, _responseText, _headers);
|
|
@@ -4565,6 +5370,111 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
4565
5370
|
return of(result200);
|
|
4566
5371
|
}));
|
|
4567
5372
|
}
|
|
5373
|
+
else if (status === 409) {
|
|
5374
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
5375
|
+
let result409 = null;
|
|
5376
|
+
result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
5377
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
5378
|
+
}));
|
|
5379
|
+
}
|
|
5380
|
+
else if (status === 401) {
|
|
5381
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
5382
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
5383
|
+
}));
|
|
5384
|
+
}
|
|
5385
|
+
else if (status === 403) {
|
|
5386
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
5387
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
5388
|
+
}));
|
|
5389
|
+
}
|
|
5390
|
+
else if (status !== 200 && status !== 204) {
|
|
5391
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
5392
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
5393
|
+
}));
|
|
5394
|
+
}
|
|
5395
|
+
return of(null);
|
|
5396
|
+
}
|
|
5397
|
+
/**
|
|
5398
|
+
* Creates product item.
|
|
5399
|
+
* @param itemType (optional) Desired item type.
|
|
5400
|
+
* @param tenantId (optional) Tenant identifier
|
|
5401
|
+
* @param sourceType (optional)
|
|
5402
|
+
* @param sourceId (optional)
|
|
5403
|
+
* @param sourceOwnerId (optional)
|
|
5404
|
+
* @param url (optional)
|
|
5405
|
+
* @param sourceFile (optional)
|
|
5406
|
+
* @return Success
|
|
5407
|
+
* @deprecated
|
|
5408
|
+
*/
|
|
5409
|
+
createItem(itemType, tenantId, sourceType, sourceId, sourceOwnerId, url, sourceFile) {
|
|
5410
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/model/items?";
|
|
5411
|
+
if (itemType !== undefined && itemType !== null)
|
|
5412
|
+
url_ += "itemType=" + encodeURIComponent("" + itemType) + "&";
|
|
5413
|
+
if (tenantId === null)
|
|
5414
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
5415
|
+
else if (tenantId !== undefined)
|
|
5416
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
5417
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
5418
|
+
const content_ = new FormData();
|
|
5419
|
+
if (sourceType !== null && sourceType !== undefined)
|
|
5420
|
+
content_.append("sourceType", sourceType.toString());
|
|
5421
|
+
if (sourceId !== null && sourceId !== undefined)
|
|
5422
|
+
content_.append("sourceId", sourceId.toString());
|
|
5423
|
+
if (sourceOwnerId !== null && sourceOwnerId !== undefined)
|
|
5424
|
+
content_.append("sourceOwnerId", sourceOwnerId.toString());
|
|
5425
|
+
if (url !== null && url !== undefined)
|
|
5426
|
+
content_.append("url", url.toString());
|
|
5427
|
+
if (sourceFile !== null && sourceFile !== undefined)
|
|
5428
|
+
content_.append("sourceFile", sourceFile.data, sourceFile.fileName ? sourceFile.fileName : "sourceFile");
|
|
5429
|
+
let options_ = {
|
|
5430
|
+
body: content_,
|
|
5431
|
+
observe: "response",
|
|
5432
|
+
responseType: "blob",
|
|
5433
|
+
headers: new HttpHeaders({
|
|
5434
|
+
"Accept": "application/json"
|
|
5435
|
+
})
|
|
5436
|
+
};
|
|
5437
|
+
return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
|
|
5438
|
+
return this.http.request("post", url_, transformedOptions_);
|
|
5439
|
+
})).pipe(mergeMap((response_) => {
|
|
5440
|
+
return this.transformResult(url_, response_, (r) => this.processCreateItem(r));
|
|
5441
|
+
})).pipe(catchError((response_) => {
|
|
5442
|
+
if (response_ instanceof HttpResponseBase) {
|
|
5443
|
+
try {
|
|
5444
|
+
return this.transformResult(url_, response_, (r) => this.processCreateItem(r));
|
|
5445
|
+
}
|
|
5446
|
+
catch (e) {
|
|
5447
|
+
return throwError(e);
|
|
5448
|
+
}
|
|
5449
|
+
}
|
|
5450
|
+
else
|
|
5451
|
+
return throwError(response_);
|
|
5452
|
+
}));
|
|
5453
|
+
}
|
|
5454
|
+
processCreateItem(response) {
|
|
5455
|
+
const status = response.status;
|
|
5456
|
+
const responseBlob = response instanceof HttpResponse ? response.body :
|
|
5457
|
+
response.error instanceof Blob ? response.error : undefined;
|
|
5458
|
+
let _headers = {};
|
|
5459
|
+
if (response.headers) {
|
|
5460
|
+
for (let key of response.headers.keys()) {
|
|
5461
|
+
_headers[key] = response.headers.get(key);
|
|
5462
|
+
}
|
|
5463
|
+
}
|
|
5464
|
+
if (status === 200) {
|
|
5465
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
5466
|
+
let result200 = null;
|
|
5467
|
+
result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
5468
|
+
return of(result200);
|
|
5469
|
+
}));
|
|
5470
|
+
}
|
|
5471
|
+
else if (status === 404) {
|
|
5472
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
5473
|
+
let result404 = null;
|
|
5474
|
+
result404 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
5475
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
5476
|
+
}));
|
|
5477
|
+
}
|
|
4568
5478
|
else if (status === 401) {
|
|
4569
5479
|
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
4570
5480
|
return throwException("Unauthorized", status, _responseText, _headers);
|
|
@@ -6841,6 +7751,7 @@ var ItemSourceType;
|
|
|
6841
7751
|
ItemSourceType["File"] = "File";
|
|
6842
7752
|
ItemSourceType["ImageStorage"] = "ImageStorage";
|
|
6843
7753
|
ItemSourceType["PrivateImageStorage"] = "PrivateImageStorage";
|
|
7754
|
+
ItemSourceType["Url"] = "Url";
|
|
6844
7755
|
})(ItemSourceType || (ItemSourceType = {}));
|
|
6845
7756
|
var ItemType;
|
|
6846
7757
|
(function (ItemType) {
|