@aurigma/ng-design-atoms-api-client 2.22.1 → 2.26.7
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 +564 -192
- 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 +336 -10
- 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 +336 -10
- package/fesm2015/aurigma-ng-design-atoms-api-client.js.map +1 -1
- package/lib/design-atoms-api-client.d.ts +130 -15
- package/package.json +1 -1
|
@@ -32,4 +32,4 @@ DesignAtomsApiModule.decorators = [
|
|
|
32
32
|
exports: []
|
|
33
33
|
},] }
|
|
34
34
|
];
|
|
35
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
35
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGVzaWduLWF0b21zLWFwaS5tb2R1bGUuanMiLCJzb3VyY2VSb290IjoiL2hvbWUvYXVyaWdtYS9hZ2VudHMvMDEvX3dvcmsvNTQvcy9BdXJpZ21hLkRlc2lnbkF0b21zQXBpLlR5cGVTY3JpcHRBcGlDbGllbnQvQW5ndWxhci9hcGktY2xpZW50L3Byb2plY3RzL2NsaWVudC9zcmMvIiwic291cmNlcyI6WyJsaWIvZGVzaWduLWF0b21zLWFwaS5tb2R1bGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFzQixRQUFRLEVBQUMsTUFBTSxlQUFlLENBQUM7QUFDNUQsT0FBTyxLQUF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VVJMLFxuICAgICAgICAgIHVzZVZhbHVlOiBhcGlVcmxcbiAgICAgICAgfSxcbiAgICAgICAge1xuICAgICAgICAgIHByb3ZpZGU6IERlc2lnbkF0b21zQXBpQ2xpZW50LkFwaUNsaWVudENvbmZpZ3VyYXRpb24sXG4gICAgICAgICAgdXNlRmFjdG9yeTogQ3JlYXRlQXBpQ2xpZW50Q29uZmlndXJhdGlvbi5iaW5kKHRoaXMsIHRva2VuICwgYXBpVXJsLCBhcGlLZXkpXG4gICAgICAgIH0sXG4gICAgICBdXG4gICAgfTtcbiAgfVxufVxuIl19
|
package/esm2015/public-api.js
CHANGED
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export * from './lib/design-atoms-api.module';
|
|
5
5
|
export * from './lib/design-atoms-api-client';
|
|
6
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
6
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljLWFwaS5qcyIsInNvdXJjZVJvb3QiOiIvaG9tZS9hdXJpZ21hL2FnZW50cy8wMS9fd29yay81NC9zL0F1cmlnbWEuRGVzaWduQXRvbXNBcGkuVHlwZVNjcmlwdEFwaUNsaWVudC9Bbmd1bGFyL2FwaS1jbGllbnQvcHJvamVjdHMvY2xpZW50L3NyYy8iLCJzb3VyY2VzIjpbInB1YmxpYy1hcGkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7O0dBRUc7QUFFSCxjQUFjLCtCQUErQixDQUFDO0FBQzlDLGNBQWMsK0JBQStCLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyIvKlxuICogUHVibGljIEFQSSBTdXJmYWNlIG9mIGNsaWVudFxuICovXG5cbmV4cG9ydCAqIGZyb20gJy4vbGliL2Rlc2lnbi1hdG9tcy1hcGkubW9kdWxlJztcbmV4cG9ydCAqIGZyb20gJy4vbGliL2Rlc2lnbi1hdG9tcy1hcGktY2xpZW50JztcbiJdfQ==
|
|
@@ -1853,6 +1853,92 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
1853
1853
|
}
|
|
1854
1854
|
return of(null);
|
|
1855
1855
|
}
|
|
1856
|
+
/**
|
|
1857
|
+
* Returns content of the background.
|
|
1858
|
+
* @param id Design identifier.
|
|
1859
|
+
* @param surfaceIndex (optional) Surface index.
|
|
1860
|
+
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
1861
|
+
* @param tenantId (optional) Tenant identifier
|
|
1862
|
+
* @return Success
|
|
1863
|
+
*/
|
|
1864
|
+
extractBackground(id, surfaceIndex, privateStorageOwner, tenantId) {
|
|
1865
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/background?";
|
|
1866
|
+
if (id === undefined || id === null)
|
|
1867
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
1868
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
1869
|
+
if (surfaceIndex !== undefined && surfaceIndex !== null)
|
|
1870
|
+
url_ += "surfaceIndex=" + encodeURIComponent("" + surfaceIndex) + "&";
|
|
1871
|
+
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
1872
|
+
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
1873
|
+
if (tenantId === null)
|
|
1874
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
1875
|
+
else if (tenantId !== undefined)
|
|
1876
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
1877
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
1878
|
+
let options_ = {
|
|
1879
|
+
observe: "response",
|
|
1880
|
+
responseType: "blob",
|
|
1881
|
+
headers: new HttpHeaders({
|
|
1882
|
+
"Accept": "application/octet-stream"
|
|
1883
|
+
})
|
|
1884
|
+
};
|
|
1885
|
+
return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
|
|
1886
|
+
return this.http.request("get", url_, transformedOptions_);
|
|
1887
|
+
})).pipe(mergeMap((response_) => {
|
|
1888
|
+
return this.transformResult(url_, response_, (r) => this.processExtractBackground(r));
|
|
1889
|
+
})).pipe(catchError((response_) => {
|
|
1890
|
+
if (response_ instanceof HttpResponseBase) {
|
|
1891
|
+
try {
|
|
1892
|
+
return this.transformResult(url_, response_, (r) => this.processExtractBackground(r));
|
|
1893
|
+
}
|
|
1894
|
+
catch (e) {
|
|
1895
|
+
return throwError(e);
|
|
1896
|
+
}
|
|
1897
|
+
}
|
|
1898
|
+
else
|
|
1899
|
+
return throwError(response_);
|
|
1900
|
+
}));
|
|
1901
|
+
}
|
|
1902
|
+
processExtractBackground(response) {
|
|
1903
|
+
const status = response.status;
|
|
1904
|
+
const responseBlob = response instanceof HttpResponse ? response.body :
|
|
1905
|
+
response.error instanceof Blob ? response.error : undefined;
|
|
1906
|
+
let _headers = {};
|
|
1907
|
+
if (response.headers) {
|
|
1908
|
+
for (let key of response.headers.keys()) {
|
|
1909
|
+
_headers[key] = response.headers.get(key);
|
|
1910
|
+
}
|
|
1911
|
+
}
|
|
1912
|
+
if (status === 200 || status === 206) {
|
|
1913
|
+
const contentDisposition = response.headers ? response.headers.get("content-disposition") : undefined;
|
|
1914
|
+
const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
|
|
1915
|
+
const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
|
|
1916
|
+
return of({ fileName: fileName, data: responseBlob, status: status, headers: _headers });
|
|
1917
|
+
}
|
|
1918
|
+
else if (status === 404) {
|
|
1919
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
1920
|
+
let result404 = null;
|
|
1921
|
+
result404 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
1922
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
1923
|
+
}));
|
|
1924
|
+
}
|
|
1925
|
+
else if (status === 401) {
|
|
1926
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
1927
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
1928
|
+
}));
|
|
1929
|
+
}
|
|
1930
|
+
else if (status === 403) {
|
|
1931
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
1932
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
1933
|
+
}));
|
|
1934
|
+
}
|
|
1935
|
+
else if (status !== 200 && status !== 204) {
|
|
1936
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
1937
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
1938
|
+
}));
|
|
1939
|
+
}
|
|
1940
|
+
return of(null);
|
|
1941
|
+
}
|
|
1856
1942
|
/**
|
|
1857
1943
|
* Loads product (design model) from design file taken from storage
|
|
1858
1944
|
* @param id Design identifier
|
|
@@ -2334,7 +2420,6 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2334
2420
|
responseType: "blob",
|
|
2335
2421
|
headers: new HttpHeaders({
|
|
2336
2422
|
"Content-Type": "application/json",
|
|
2337
|
-
"Accept": "application/json"
|
|
2338
2423
|
})
|
|
2339
2424
|
};
|
|
2340
2425
|
return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
|
|
@@ -2366,9 +2451,7 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2366
2451
|
}
|
|
2367
2452
|
if (status === 200) {
|
|
2368
2453
|
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2369
|
-
|
|
2370
|
-
result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
2371
|
-
return of(result200);
|
|
2454
|
+
return of(null);
|
|
2372
2455
|
}));
|
|
2373
2456
|
}
|
|
2374
2457
|
else if (status === 404) {
|
|
@@ -2668,9 +2751,9 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2668
2751
|
return of(null);
|
|
2669
2752
|
}
|
|
2670
2753
|
/**
|
|
2671
|
-
* Flatten items
|
|
2754
|
+
* Flatten items.
|
|
2672
2755
|
* @param tenantId (optional) Tenant identifier
|
|
2673
|
-
* @param body (optional) Items to flatten
|
|
2756
|
+
* @param body (optional) Items to flatten.
|
|
2674
2757
|
* @return Success
|
|
2675
2758
|
*/
|
|
2676
2759
|
flattenItems(tenantId, body) {
|
|
@@ -2835,11 +2918,237 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2835
2918
|
}
|
|
2836
2919
|
return of(null);
|
|
2837
2920
|
}
|
|
2921
|
+
/**
|
|
2922
|
+
* Creates a private design from a public design.
|
|
2923
|
+
* @param designId (optional) Public design ID.
|
|
2924
|
+
* @param privateDesignId (optional) Private design ID.
|
|
2925
|
+
* @param privateStorageOwner (optional) Private storage owner ID.
|
|
2926
|
+
* @param tenantId (optional) Tenant identifier
|
|
2927
|
+
* @return Success
|
|
2928
|
+
*/
|
|
2929
|
+
createPrivateDesignFromDesign(designId, privateDesignId, privateStorageOwner, tenantId) {
|
|
2930
|
+
let url_ = this.baseUrl + "/api/atoms/v1/private-designs/from-design?";
|
|
2931
|
+
if (designId !== undefined && designId !== null)
|
|
2932
|
+
url_ += "designId=" + encodeURIComponent("" + designId) + "&";
|
|
2933
|
+
if (privateDesignId !== undefined && privateDesignId !== null)
|
|
2934
|
+
url_ += "privateDesignId=" + encodeURIComponent("" + privateDesignId) + "&";
|
|
2935
|
+
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
2936
|
+
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
2937
|
+
if (tenantId === null)
|
|
2938
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
2939
|
+
else if (tenantId !== undefined)
|
|
2940
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2941
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
2942
|
+
let options_ = {
|
|
2943
|
+
observe: "response",
|
|
2944
|
+
responseType: "blob",
|
|
2945
|
+
headers: new HttpHeaders({})
|
|
2946
|
+
};
|
|
2947
|
+
return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
|
|
2948
|
+
return this.http.request("post", url_, transformedOptions_);
|
|
2949
|
+
})).pipe(mergeMap((response_) => {
|
|
2950
|
+
return this.transformResult(url_, response_, (r) => this.processCreatePrivateDesignFromDesign(r));
|
|
2951
|
+
})).pipe(catchError((response_) => {
|
|
2952
|
+
if (response_ instanceof HttpResponseBase) {
|
|
2953
|
+
try {
|
|
2954
|
+
return this.transformResult(url_, response_, (r) => this.processCreatePrivateDesignFromDesign(r));
|
|
2955
|
+
}
|
|
2956
|
+
catch (e) {
|
|
2957
|
+
return throwError(e);
|
|
2958
|
+
}
|
|
2959
|
+
}
|
|
2960
|
+
else
|
|
2961
|
+
return throwError(response_);
|
|
2962
|
+
}));
|
|
2963
|
+
}
|
|
2964
|
+
processCreatePrivateDesignFromDesign(response) {
|
|
2965
|
+
const status = response.status;
|
|
2966
|
+
const responseBlob = response instanceof HttpResponse ? response.body :
|
|
2967
|
+
response.error instanceof Blob ? response.error : undefined;
|
|
2968
|
+
let _headers = {};
|
|
2969
|
+
if (response.headers) {
|
|
2970
|
+
for (let key of response.headers.keys()) {
|
|
2971
|
+
_headers[key] = response.headers.get(key);
|
|
2972
|
+
}
|
|
2973
|
+
}
|
|
2974
|
+
if (status === 201) {
|
|
2975
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2976
|
+
return of(null);
|
|
2977
|
+
}));
|
|
2978
|
+
}
|
|
2979
|
+
else if (status === 401) {
|
|
2980
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2981
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
2982
|
+
}));
|
|
2983
|
+
}
|
|
2984
|
+
else if (status === 403) {
|
|
2985
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2986
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
2987
|
+
}));
|
|
2988
|
+
}
|
|
2989
|
+
else if (status !== 200 && status !== 204) {
|
|
2990
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2991
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
2992
|
+
}));
|
|
2993
|
+
}
|
|
2994
|
+
return of(null);
|
|
2995
|
+
}
|
|
2996
|
+
/**
|
|
2997
|
+
* Creates a private design from a public resource.
|
|
2998
|
+
* @param resourceId (optional) Resource ID.
|
|
2999
|
+
* @param privateDesignId (optional) Private design ID.
|
|
3000
|
+
* @param privateStorageOwner (optional) Private storage owner ID.
|
|
3001
|
+
* @param tenantId (optional) Tenant identifier
|
|
3002
|
+
* @return Success
|
|
3003
|
+
*/
|
|
3004
|
+
createPrivateDesignFromResource(resourceId, privateDesignId, privateStorageOwner, tenantId) {
|
|
3005
|
+
let url_ = this.baseUrl + "/api/atoms/v1/private-designs/from-resource?";
|
|
3006
|
+
if (resourceId !== undefined && resourceId !== null)
|
|
3007
|
+
url_ += "resourceId=" + encodeURIComponent("" + resourceId) + "&";
|
|
3008
|
+
if (privateDesignId !== undefined && privateDesignId !== null)
|
|
3009
|
+
url_ += "privateDesignId=" + encodeURIComponent("" + privateDesignId) + "&";
|
|
3010
|
+
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
3011
|
+
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
3012
|
+
if (tenantId === null)
|
|
3013
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
3014
|
+
else if (tenantId !== undefined)
|
|
3015
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
3016
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
3017
|
+
let options_ = {
|
|
3018
|
+
observe: "response",
|
|
3019
|
+
responseType: "blob",
|
|
3020
|
+
headers: new HttpHeaders({})
|
|
3021
|
+
};
|
|
3022
|
+
return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
|
|
3023
|
+
return this.http.request("post", url_, transformedOptions_);
|
|
3024
|
+
})).pipe(mergeMap((response_) => {
|
|
3025
|
+
return this.transformResult(url_, response_, (r) => this.processCreatePrivateDesignFromResource(r));
|
|
3026
|
+
})).pipe(catchError((response_) => {
|
|
3027
|
+
if (response_ instanceof HttpResponseBase) {
|
|
3028
|
+
try {
|
|
3029
|
+
return this.transformResult(url_, response_, (r) => this.processCreatePrivateDesignFromResource(r));
|
|
3030
|
+
}
|
|
3031
|
+
catch (e) {
|
|
3032
|
+
return throwError(e);
|
|
3033
|
+
}
|
|
3034
|
+
}
|
|
3035
|
+
else
|
|
3036
|
+
return throwError(response_);
|
|
3037
|
+
}));
|
|
3038
|
+
}
|
|
3039
|
+
processCreatePrivateDesignFromResource(response) {
|
|
3040
|
+
const status = response.status;
|
|
3041
|
+
const responseBlob = response instanceof HttpResponse ? response.body :
|
|
3042
|
+
response.error instanceof Blob ? response.error : undefined;
|
|
3043
|
+
let _headers = {};
|
|
3044
|
+
if (response.headers) {
|
|
3045
|
+
for (let key of response.headers.keys()) {
|
|
3046
|
+
_headers[key] = response.headers.get(key);
|
|
3047
|
+
}
|
|
3048
|
+
}
|
|
3049
|
+
if (status === 201) {
|
|
3050
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
3051
|
+
return of(null);
|
|
3052
|
+
}));
|
|
3053
|
+
}
|
|
3054
|
+
else if (status === 401) {
|
|
3055
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
3056
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
3057
|
+
}));
|
|
3058
|
+
}
|
|
3059
|
+
else if (status === 403) {
|
|
3060
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
3061
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
3062
|
+
}));
|
|
3063
|
+
}
|
|
3064
|
+
else if (status !== 200 && status !== 204) {
|
|
3065
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
3066
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
3067
|
+
}));
|
|
3068
|
+
}
|
|
3069
|
+
return of(null);
|
|
3070
|
+
}
|
|
3071
|
+
/**
|
|
3072
|
+
* Renders a design with the specified parameters.
|
|
3073
|
+
* @param attachment (optional) If set to 'true', file will be provided as an attachment with unique filename supplied (default value is 'false').
|
|
3074
|
+
* @param tenantId (optional) Tenant identifier
|
|
3075
|
+
* @param body (optional) Render model with preview parameters.
|
|
3076
|
+
* @return Success
|
|
3077
|
+
*/
|
|
3078
|
+
renderDesign(attachment, tenantId, body) {
|
|
3079
|
+
let url_ = this.baseUrl + "/api/atoms/v1/render-design-preview?";
|
|
3080
|
+
if (attachment !== undefined && attachment !== null)
|
|
3081
|
+
url_ += "attachment=" + encodeURIComponent("" + attachment) + "&";
|
|
3082
|
+
if (tenantId === null)
|
|
3083
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
3084
|
+
else if (tenantId !== undefined)
|
|
3085
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
3086
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
3087
|
+
const content_ = JSON.stringify(body);
|
|
3088
|
+
let options_ = {
|
|
3089
|
+
body: content_,
|
|
3090
|
+
observe: "response",
|
|
3091
|
+
responseType: "blob",
|
|
3092
|
+
headers: new HttpHeaders({
|
|
3093
|
+
"Content-Type": "application/json",
|
|
3094
|
+
"Accept": "application/octet-stream"
|
|
3095
|
+
})
|
|
3096
|
+
};
|
|
3097
|
+
return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
|
|
3098
|
+
return this.http.request("post", url_, transformedOptions_);
|
|
3099
|
+
})).pipe(mergeMap((response_) => {
|
|
3100
|
+
return this.transformResult(url_, response_, (r) => this.processRenderDesign(r));
|
|
3101
|
+
})).pipe(catchError((response_) => {
|
|
3102
|
+
if (response_ instanceof HttpResponseBase) {
|
|
3103
|
+
try {
|
|
3104
|
+
return this.transformResult(url_, response_, (r) => this.processRenderDesign(r));
|
|
3105
|
+
}
|
|
3106
|
+
catch (e) {
|
|
3107
|
+
return throwError(e);
|
|
3108
|
+
}
|
|
3109
|
+
}
|
|
3110
|
+
else
|
|
3111
|
+
return throwError(response_);
|
|
3112
|
+
}));
|
|
3113
|
+
}
|
|
3114
|
+
processRenderDesign(response) {
|
|
3115
|
+
const status = response.status;
|
|
3116
|
+
const responseBlob = response instanceof HttpResponse ? response.body :
|
|
3117
|
+
response.error instanceof Blob ? response.error : undefined;
|
|
3118
|
+
let _headers = {};
|
|
3119
|
+
if (response.headers) {
|
|
3120
|
+
for (let key of response.headers.keys()) {
|
|
3121
|
+
_headers[key] = response.headers.get(key);
|
|
3122
|
+
}
|
|
3123
|
+
}
|
|
3124
|
+
if (status === 200 || status === 206) {
|
|
3125
|
+
const contentDisposition = response.headers ? response.headers.get("content-disposition") : undefined;
|
|
3126
|
+
const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
|
|
3127
|
+
const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
|
|
3128
|
+
return of({ fileName: fileName, data: responseBlob, status: status, headers: _headers });
|
|
3129
|
+
}
|
|
3130
|
+
else if (status === 401) {
|
|
3131
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
3132
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
3133
|
+
}));
|
|
3134
|
+
}
|
|
3135
|
+
else if (status === 403) {
|
|
3136
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
3137
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
3138
|
+
}));
|
|
3139
|
+
}
|
|
3140
|
+
else if (status !== 200 && status !== 204) {
|
|
3141
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
3142
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
3143
|
+
}));
|
|
3144
|
+
}
|
|
3145
|
+
return of(null);
|
|
3146
|
+
}
|
|
2838
3147
|
/**
|
|
2839
3148
|
* Render product proof image with specified parameters.
|
|
2840
|
-
* @param attachment (optional) If set to 'true', file will be provided as an attachment with unique filename supplied (default value is 'false')
|
|
3149
|
+
* @param attachment (optional) If set to 'true', file will be provided as an attachment with unique filename supplied (default value is 'false').
|
|
2841
3150
|
* @param tenantId (optional) Tenant identifier
|
|
2842
|
-
* @param body (optional) Preview parameters
|
|
3151
|
+
* @param body (optional) Preview parameters.
|
|
2843
3152
|
* @return Success
|
|
2844
3153
|
*/
|
|
2845
3154
|
renderProduct(attachment, tenantId, body) {
|
|
@@ -2858,7 +3167,7 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2858
3167
|
responseType: "blob",
|
|
2859
3168
|
headers: new HttpHeaders({
|
|
2860
3169
|
"Content-Type": "application/json",
|
|
2861
|
-
"Accept": "application/
|
|
3170
|
+
"Accept": "application/octet-stream"
|
|
2862
3171
|
})
|
|
2863
3172
|
};
|
|
2864
3173
|
return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
|
|
@@ -4487,6 +4796,15 @@ DesignAtomsViewerApiClient.ctorParameters = () => [
|
|
|
4487
4796
|
{ type: HttpClient, decorators: [{ type: Inject, args: [HttpClient,] }] },
|
|
4488
4797
|
{ type: String, decorators: [{ type: Optional }, { type: Inject, args: [API_BASE_URL,] }] }
|
|
4489
4798
|
];
|
|
4799
|
+
var DesignElementType;
|
|
4800
|
+
(function (DesignElementType) {
|
|
4801
|
+
DesignElementType["Product"] = "Product";
|
|
4802
|
+
DesignElementType["Design"] = "Design";
|
|
4803
|
+
DesignElementType["Surface"] = "Surface";
|
|
4804
|
+
DesignElementType["Container"] = "Container";
|
|
4805
|
+
DesignElementType["PrintArea"] = "PrintArea";
|
|
4806
|
+
DesignElementType["Item"] = "Item";
|
|
4807
|
+
})(DesignElementType || (DesignElementType = {}));
|
|
4490
4808
|
/** Available patch type */
|
|
4491
4809
|
var ProductPatchType;
|
|
4492
4810
|
(function (ProductPatchType) {
|
|
@@ -4507,6 +4825,14 @@ var ItemSourceType;
|
|
|
4507
4825
|
ItemSourceType["ImageStorage"] = "ImageStorage";
|
|
4508
4826
|
ItemSourceType["PrivateImageStorage"] = "PrivateImageStorage";
|
|
4509
4827
|
})(ItemSourceType || (ItemSourceType = {}));
|
|
4828
|
+
/** Product preview file format. */
|
|
4829
|
+
var ProductPreviewFormat;
|
|
4830
|
+
(function (ProductPreviewFormat) {
|
|
4831
|
+
ProductPreviewFormat["Jpeg"] = "Jpeg";
|
|
4832
|
+
ProductPreviewFormat["Png"] = "Png";
|
|
4833
|
+
ProductPreviewFormat["Tiff"] = "Tiff";
|
|
4834
|
+
ProductPreviewFormat["Pdf"] = "Pdf";
|
|
4835
|
+
})(ProductPreviewFormat || (ProductPreviewFormat = {}));
|
|
4510
4836
|
var ProductProofFormat;
|
|
4511
4837
|
(function (ProductProofFormat) {
|
|
4512
4838
|
ProductProofFormat["Jpeg"] = "Jpeg";
|
|
@@ -4606,5 +4932,5 @@ DesignAtomsApiModule.decorators = [
|
|
|
4606
4932
|
* Generated bundle index. Do not edit.
|
|
4607
4933
|
*/
|
|
4608
4934
|
|
|
4609
|
-
export { API_BASE_URL, ApiClientBase, ApiClientConfiguration, ApiException, BuildInfoApiClient, CreateApiClientConfiguration, DesignAtomsApiModule, DesignAtomsCompatibilityApiClient, DesignAtomsServiceApiClient, DesignAtomsViewerApiClient, ItemSourceType, ItemType, ProductPatchType, ProductProofFormat, ProductProofInterpolationMode };
|
|
4935
|
+
export { API_BASE_URL, ApiClientBase, ApiClientConfiguration, ApiException, BuildInfoApiClient, CreateApiClientConfiguration, DesignAtomsApiModule, DesignAtomsCompatibilityApiClient, DesignAtomsServiceApiClient, DesignAtomsViewerApiClient, DesignElementType, ItemSourceType, ItemType, ProductPatchType, ProductPreviewFormat, ProductProofFormat, ProductProofInterpolationMode };
|
|
4610
4936
|
//# sourceMappingURL=aurigma-ng-design-atoms-api-client.js.map
|