@aurigma/ng-design-atoms-api-client 2.11.1 → 2.14.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 +162 -75
- 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/lib/design-atoms-api-client.js +75 -1
- package/fesm2015/aurigma-ng-design-atoms-api-client.js +74 -0
- package/fesm2015/aurigma-ng-design-atoms-api-client.js.map +1 -1
- package/lib/design-atoms-api-client.d.ts +16 -0
- package/package.json +1 -1
|
@@ -2535,6 +2535,80 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2535
2535
|
}
|
|
2536
2536
|
return of(null);
|
|
2537
2537
|
}
|
|
2538
|
+
/**
|
|
2539
|
+
* Flatten items
|
|
2540
|
+
* @param tenantId (optional) Tenant identifier
|
|
2541
|
+
* @param body (optional) Items to flatten
|
|
2542
|
+
* @return Success
|
|
2543
|
+
*/
|
|
2544
|
+
flattenItems(tenantId, body) {
|
|
2545
|
+
let url_ = this.baseUrl + "/api/atoms/v1/flatten?";
|
|
2546
|
+
if (tenantId === null)
|
|
2547
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
2548
|
+
else if (tenantId !== undefined)
|
|
2549
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2550
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
2551
|
+
const content_ = JSON.stringify(body);
|
|
2552
|
+
let options_ = {
|
|
2553
|
+
body: content_,
|
|
2554
|
+
observe: "response",
|
|
2555
|
+
responseType: "blob",
|
|
2556
|
+
headers: new HttpHeaders({
|
|
2557
|
+
"Content-Type": "application/json",
|
|
2558
|
+
"Accept": "application/json"
|
|
2559
|
+
})
|
|
2560
|
+
};
|
|
2561
|
+
return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
|
|
2562
|
+
return this.http.request("post", url_, transformedOptions_);
|
|
2563
|
+
})).pipe(mergeMap((response_) => {
|
|
2564
|
+
return this.transformResult(url_, response_, (r) => this.processFlattenItems(r));
|
|
2565
|
+
})).pipe(catchError((response_) => {
|
|
2566
|
+
if (response_ instanceof HttpResponseBase) {
|
|
2567
|
+
try {
|
|
2568
|
+
return this.transformResult(url_, response_, (r) => this.processFlattenItems(r));
|
|
2569
|
+
}
|
|
2570
|
+
catch (e) {
|
|
2571
|
+
return throwError(e);
|
|
2572
|
+
}
|
|
2573
|
+
}
|
|
2574
|
+
else
|
|
2575
|
+
return throwError(response_);
|
|
2576
|
+
}));
|
|
2577
|
+
}
|
|
2578
|
+
processFlattenItems(response) {
|
|
2579
|
+
const status = response.status;
|
|
2580
|
+
const responseBlob = response instanceof HttpResponse ? response.body :
|
|
2581
|
+
response.error instanceof Blob ? response.error : undefined;
|
|
2582
|
+
let _headers = {};
|
|
2583
|
+
if (response.headers) {
|
|
2584
|
+
for (let key of response.headers.keys()) {
|
|
2585
|
+
_headers[key] = response.headers.get(key);
|
|
2586
|
+
}
|
|
2587
|
+
}
|
|
2588
|
+
if (status === 200) {
|
|
2589
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2590
|
+
let result200 = null;
|
|
2591
|
+
result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
2592
|
+
return of(result200);
|
|
2593
|
+
}));
|
|
2594
|
+
}
|
|
2595
|
+
else if (status === 401) {
|
|
2596
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2597
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
2598
|
+
}));
|
|
2599
|
+
}
|
|
2600
|
+
else if (status === 403) {
|
|
2601
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2602
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
2603
|
+
}));
|
|
2604
|
+
}
|
|
2605
|
+
else if (status !== 200 && status !== 204) {
|
|
2606
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2607
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
2608
|
+
}));
|
|
2609
|
+
}
|
|
2610
|
+
return of(null);
|
|
2611
|
+
}
|
|
2538
2612
|
/**
|
|
2539
2613
|
* Creates product item
|
|
2540
2614
|
* @param itemType (optional) Desired item type
|