@aurigma/ng-design-atoms-api-client 2.48.1 → 2.51.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 +571 -196
- 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 +324 -1
- 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 +323 -0
- package/fesm2015/aurigma-ng-design-atoms-api-client.js.map +1 -1
- package/lib/design-atoms-api-client.d.ts +124 -0
- 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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGVzaWduLWF0b21zLWFwaS5tb2R1bGUuanMiLCJzb3VyY2VSb290IjoiL2hvbWUvYXVyaWdtYS9hZ2VudHMvQ0NIMDIvX3dvcmsvOC9zL0F1cmlnbWEuRGVzaWduQXRvbXNBcGkuVHlwZVNjcmlwdEFwaUNsaWVudC9Bbmd1bGFyL2FwaS1jbGllbnQvcHJvamVjdHMvY2xpZW50L3NyYy8iLCJzb3VyY2VzIjpbImxpYi9kZXNpZ24tYXRvbXMtYXBpLm1vZHVsZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQXNCLFFBQVEsRUFBQyxNQUFNLGVBQWUsQ0FBQztBQUM1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pZ25BdG9tc0FwaUNsaWVudC5BUElfQkFTRV9VUkwsXG4gICAgICAgICAgdXNlVmFsdWU6IGFwaVVybFxuICAgICAgICB9LFxuICAgICAgICB7XG4gICAgICAgICAgcHJvdmlkZTogRGVzaWduQXRvbXNBcGlDbGllbnQuQXBpQ2xpZW50Q29uZmlndXJhdGlvbixcbiAgICAgICAgICB1c2VGYWN0b3J5OiBDcmVhdGVBcGlDbGllbnRDb25maWd1cmF0aW9uLmJpbmQodGhpcywgdG9rZW4gLCBhcGlVcmwsIGFwaUtleSlcbiAgICAgICAgfSxcbiAgICAgIF1cbiAgICB9O1xuICB9XG59XG4iXX0=
|
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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljLWFwaS5qcyIsInNvdXJjZVJvb3QiOiIvaG9tZS9hdXJpZ21hL2FnZW50cy9DQ0gwMi9fd29yay84L3MvQXVyaWdtYS5EZXNpZ25BdG9tc0FwaS5UeXBlU2NyaXB0QXBpQ2xpZW50L0FuZ3VsYXIvYXBpLWNsaWVudC9wcm9qZWN0cy9jbGllbnQvc3JjLyIsInNvdXJjZXMiOlsicHVibGljLWFwaS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7R0FFRztBQUVILGNBQWMsK0JBQStCLENBQUM7QUFDOUMsY0FBYywrQkFBK0IsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbIi8qXG4gKiBQdWJsaWMgQVBJIFN1cmZhY2Ugb2YgY2xpZW50XG4gKi9cblxuZXhwb3J0ICogZnJvbSAnLi9saWIvZGVzaWduLWF0b21zLWFwaS5tb2R1bGUnO1xuZXhwb3J0ICogZnJvbSAnLi9saWIvZGVzaWduLWF0b21zLWFwaS1jbGllbnQnO1xuIl19
|
|
@@ -2210,6 +2210,87 @@ class DesignAtomsImagesApiClient extends ApiClientBase {
|
|
|
2210
2210
|
}
|
|
2211
2211
|
return of(null);
|
|
2212
2212
|
}
|
|
2213
|
+
/**
|
|
2214
|
+
* Renders a web image preview with the specified parameters and saves rendering result as resource.
|
|
2215
|
+
* @param tenantId (optional) Tenant identifier
|
|
2216
|
+
* @param body (optional) Render model with preview parameters.
|
|
2217
|
+
* @return Success
|
|
2218
|
+
*/
|
|
2219
|
+
renderImagePreviewToResource(tenantId, body) {
|
|
2220
|
+
let url_ = this.baseUrl + "/api/atoms/v1/images/render-image-preview/to-resource?";
|
|
2221
|
+
if (tenantId === null)
|
|
2222
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
2223
|
+
else if (tenantId !== undefined)
|
|
2224
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2225
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
2226
|
+
const content_ = JSON.stringify(body);
|
|
2227
|
+
let options_ = {
|
|
2228
|
+
body: content_,
|
|
2229
|
+
observe: "response",
|
|
2230
|
+
responseType: "blob",
|
|
2231
|
+
headers: new HttpHeaders({
|
|
2232
|
+
"Content-Type": "application/json",
|
|
2233
|
+
"Accept": "application/json"
|
|
2234
|
+
})
|
|
2235
|
+
};
|
|
2236
|
+
return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
|
|
2237
|
+
return this.http.request("post", url_, transformedOptions_);
|
|
2238
|
+
})).pipe(mergeMap((response_) => {
|
|
2239
|
+
return this.transformResult(url_, response_, (r) => this.processRenderImagePreviewToResource(r));
|
|
2240
|
+
})).pipe(catchError((response_) => {
|
|
2241
|
+
if (response_ instanceof HttpResponseBase) {
|
|
2242
|
+
try {
|
|
2243
|
+
return this.transformResult(url_, response_, (r) => this.processRenderImagePreviewToResource(r));
|
|
2244
|
+
}
|
|
2245
|
+
catch (e) {
|
|
2246
|
+
return throwError(e);
|
|
2247
|
+
}
|
|
2248
|
+
}
|
|
2249
|
+
else
|
|
2250
|
+
return throwError(response_);
|
|
2251
|
+
}));
|
|
2252
|
+
}
|
|
2253
|
+
processRenderImagePreviewToResource(response) {
|
|
2254
|
+
const status = response.status;
|
|
2255
|
+
const responseBlob = response instanceof HttpResponse ? response.body :
|
|
2256
|
+
response.error instanceof Blob ? response.error : undefined;
|
|
2257
|
+
let _headers = {};
|
|
2258
|
+
if (response.headers) {
|
|
2259
|
+
for (let key of response.headers.keys()) {
|
|
2260
|
+
_headers[key] = response.headers.get(key);
|
|
2261
|
+
}
|
|
2262
|
+
}
|
|
2263
|
+
if (status === 200) {
|
|
2264
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2265
|
+
let result200 = null;
|
|
2266
|
+
result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
2267
|
+
return of(result200);
|
|
2268
|
+
}));
|
|
2269
|
+
}
|
|
2270
|
+
else if (status === 401) {
|
|
2271
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2272
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
2273
|
+
}));
|
|
2274
|
+
}
|
|
2275
|
+
else if (status === 403) {
|
|
2276
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2277
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
2278
|
+
}));
|
|
2279
|
+
}
|
|
2280
|
+
else if (status === 500) {
|
|
2281
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2282
|
+
let result500 = null;
|
|
2283
|
+
result500 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
2284
|
+
return throwException("Internal server error", status, _responseText, _headers, result500);
|
|
2285
|
+
}));
|
|
2286
|
+
}
|
|
2287
|
+
else if (status !== 200 && status !== 204) {
|
|
2288
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2289
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
2290
|
+
}));
|
|
2291
|
+
}
|
|
2292
|
+
return of(null);
|
|
2293
|
+
}
|
|
2213
2294
|
}
|
|
2214
2295
|
DesignAtomsImagesApiClient.ɵprov = ɵɵdefineInjectable({ factory: function DesignAtomsImagesApiClient_Factory() { return new DesignAtomsImagesApiClient(ɵɵinject(ApiClientConfiguration), ɵɵinject(HttpClient), ɵɵinject(API_BASE_URL, 8)); }, token: DesignAtomsImagesApiClient, providedIn: "root" });
|
|
2215
2296
|
DesignAtomsImagesApiClient.decorators = [
|
|
@@ -3973,6 +4054,86 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3973
4054
|
}
|
|
3974
4055
|
return of(null);
|
|
3975
4056
|
}
|
|
4057
|
+
/**
|
|
4058
|
+
* Extracts product item image.
|
|
4059
|
+
* @param tenantId (optional) Tenant identifier
|
|
4060
|
+
* @param body (optional) Extraction parameters.
|
|
4061
|
+
* @return Success
|
|
4062
|
+
*/
|
|
4063
|
+
extractItemImage(tenantId, body) {
|
|
4064
|
+
let url_ = this.baseUrl + "/api/atoms/v1/itemExtractor?";
|
|
4065
|
+
if (tenantId === null)
|
|
4066
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
4067
|
+
else if (tenantId !== undefined)
|
|
4068
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
4069
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
4070
|
+
const content_ = JSON.stringify(body);
|
|
4071
|
+
let options_ = {
|
|
4072
|
+
body: content_,
|
|
4073
|
+
observe: "response",
|
|
4074
|
+
responseType: "blob",
|
|
4075
|
+
headers: new HttpHeaders({
|
|
4076
|
+
"Content-Type": "application/json",
|
|
4077
|
+
"Accept": "application/octet-stream"
|
|
4078
|
+
})
|
|
4079
|
+
};
|
|
4080
|
+
return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
|
|
4081
|
+
return this.http.request("post", url_, transformedOptions_);
|
|
4082
|
+
})).pipe(mergeMap((response_) => {
|
|
4083
|
+
return this.transformResult(url_, response_, (r) => this.processExtractItemImage(r));
|
|
4084
|
+
})).pipe(catchError((response_) => {
|
|
4085
|
+
if (response_ instanceof HttpResponseBase) {
|
|
4086
|
+
try {
|
|
4087
|
+
return this.transformResult(url_, response_, (r) => this.processExtractItemImage(r));
|
|
4088
|
+
}
|
|
4089
|
+
catch (e) {
|
|
4090
|
+
return throwError(e);
|
|
4091
|
+
}
|
|
4092
|
+
}
|
|
4093
|
+
else
|
|
4094
|
+
return throwError(response_);
|
|
4095
|
+
}));
|
|
4096
|
+
}
|
|
4097
|
+
processExtractItemImage(response) {
|
|
4098
|
+
const status = response.status;
|
|
4099
|
+
const responseBlob = response instanceof HttpResponse ? response.body :
|
|
4100
|
+
response.error instanceof Blob ? response.error : undefined;
|
|
4101
|
+
let _headers = {};
|
|
4102
|
+
if (response.headers) {
|
|
4103
|
+
for (let key of response.headers.keys()) {
|
|
4104
|
+
_headers[key] = response.headers.get(key);
|
|
4105
|
+
}
|
|
4106
|
+
}
|
|
4107
|
+
if (status === 200 || status === 206) {
|
|
4108
|
+
const contentDisposition = response.headers ? response.headers.get("content-disposition") : undefined;
|
|
4109
|
+
const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
|
|
4110
|
+
const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
|
|
4111
|
+
return of({ fileName: fileName, data: responseBlob, status: status, headers: _headers });
|
|
4112
|
+
}
|
|
4113
|
+
else if (status === 401) {
|
|
4114
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
4115
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
4116
|
+
}));
|
|
4117
|
+
}
|
|
4118
|
+
else if (status === 403) {
|
|
4119
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
4120
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
4121
|
+
}));
|
|
4122
|
+
}
|
|
4123
|
+
else if (status === 500) {
|
|
4124
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
4125
|
+
let result500 = null;
|
|
4126
|
+
result500 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
4127
|
+
return throwException("Internal server error", status, _responseText, _headers, result500);
|
|
4128
|
+
}));
|
|
4129
|
+
}
|
|
4130
|
+
else if (status !== 200 && status !== 204) {
|
|
4131
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
4132
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
4133
|
+
}));
|
|
4134
|
+
}
|
|
4135
|
+
return of(null);
|
|
4136
|
+
}
|
|
3976
4137
|
/**
|
|
3977
4138
|
* Creates a private design from a public design.
|
|
3978
4139
|
* @param designId (optional) Public design ID.
|
|
@@ -4221,6 +4382,87 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
4221
4382
|
}
|
|
4222
4383
|
return of(null);
|
|
4223
4384
|
}
|
|
4385
|
+
/**
|
|
4386
|
+
* Renders a design preview with the specified parameters and saves rendering result as resource.
|
|
4387
|
+
* @param tenantId (optional) Tenant identifier
|
|
4388
|
+
* @param body (optional) Render model with preview parameters.
|
|
4389
|
+
* @return Success
|
|
4390
|
+
*/
|
|
4391
|
+
renderDesignPreviewToResource(tenantId, body) {
|
|
4392
|
+
let url_ = this.baseUrl + "/api/atoms/v1/render-design-preview/to-resource?";
|
|
4393
|
+
if (tenantId === null)
|
|
4394
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
4395
|
+
else if (tenantId !== undefined)
|
|
4396
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
4397
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
4398
|
+
const content_ = JSON.stringify(body);
|
|
4399
|
+
let options_ = {
|
|
4400
|
+
body: content_,
|
|
4401
|
+
observe: "response",
|
|
4402
|
+
responseType: "blob",
|
|
4403
|
+
headers: new HttpHeaders({
|
|
4404
|
+
"Content-Type": "application/json",
|
|
4405
|
+
"Accept": "application/json"
|
|
4406
|
+
})
|
|
4407
|
+
};
|
|
4408
|
+
return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
|
|
4409
|
+
return this.http.request("post", url_, transformedOptions_);
|
|
4410
|
+
})).pipe(mergeMap((response_) => {
|
|
4411
|
+
return this.transformResult(url_, response_, (r) => this.processRenderDesignPreviewToResource(r));
|
|
4412
|
+
})).pipe(catchError((response_) => {
|
|
4413
|
+
if (response_ instanceof HttpResponseBase) {
|
|
4414
|
+
try {
|
|
4415
|
+
return this.transformResult(url_, response_, (r) => this.processRenderDesignPreviewToResource(r));
|
|
4416
|
+
}
|
|
4417
|
+
catch (e) {
|
|
4418
|
+
return throwError(e);
|
|
4419
|
+
}
|
|
4420
|
+
}
|
|
4421
|
+
else
|
|
4422
|
+
return throwError(response_);
|
|
4423
|
+
}));
|
|
4424
|
+
}
|
|
4425
|
+
processRenderDesignPreviewToResource(response) {
|
|
4426
|
+
const status = response.status;
|
|
4427
|
+
const responseBlob = response instanceof HttpResponse ? response.body :
|
|
4428
|
+
response.error instanceof Blob ? response.error : undefined;
|
|
4429
|
+
let _headers = {};
|
|
4430
|
+
if (response.headers) {
|
|
4431
|
+
for (let key of response.headers.keys()) {
|
|
4432
|
+
_headers[key] = response.headers.get(key);
|
|
4433
|
+
}
|
|
4434
|
+
}
|
|
4435
|
+
if (status === 200) {
|
|
4436
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
4437
|
+
let result200 = null;
|
|
4438
|
+
result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
4439
|
+
return of(result200);
|
|
4440
|
+
}));
|
|
4441
|
+
}
|
|
4442
|
+
else if (status === 401) {
|
|
4443
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
4444
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
4445
|
+
}));
|
|
4446
|
+
}
|
|
4447
|
+
else if (status === 403) {
|
|
4448
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
4449
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
4450
|
+
}));
|
|
4451
|
+
}
|
|
4452
|
+
else if (status === 500) {
|
|
4453
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
4454
|
+
let result500 = null;
|
|
4455
|
+
result500 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
4456
|
+
return throwException("Internal server error", status, _responseText, _headers, result500);
|
|
4457
|
+
}));
|
|
4458
|
+
}
|
|
4459
|
+
else if (status !== 200 && status !== 204) {
|
|
4460
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
4461
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
4462
|
+
}));
|
|
4463
|
+
}
|
|
4464
|
+
return of(null);
|
|
4465
|
+
}
|
|
4224
4466
|
/**
|
|
4225
4467
|
* Renders a design proof with the specified parameters.
|
|
4226
4468
|
* @param attachment (optional) If set to 'true', file will be provided as an attachment with unique filename supplied
|
|
@@ -4305,6 +4547,87 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
4305
4547
|
}
|
|
4306
4548
|
return of(null);
|
|
4307
4549
|
}
|
|
4550
|
+
/**
|
|
4551
|
+
* Renders a design proof with the specified parameters and saves rendering result as resource.
|
|
4552
|
+
* @param tenantId (optional) Tenant identifier
|
|
4553
|
+
* @param body (optional) Render model with preview parameters.
|
|
4554
|
+
* @return Success
|
|
4555
|
+
*/
|
|
4556
|
+
renderDesignProofToResource(tenantId, body) {
|
|
4557
|
+
let url_ = this.baseUrl + "/api/atoms/v1/render-design-proof/to-resource?";
|
|
4558
|
+
if (tenantId === null)
|
|
4559
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
4560
|
+
else if (tenantId !== undefined)
|
|
4561
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
4562
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
4563
|
+
const content_ = JSON.stringify(body);
|
|
4564
|
+
let options_ = {
|
|
4565
|
+
body: content_,
|
|
4566
|
+
observe: "response",
|
|
4567
|
+
responseType: "blob",
|
|
4568
|
+
headers: new HttpHeaders({
|
|
4569
|
+
"Content-Type": "application/json",
|
|
4570
|
+
"Accept": "application/json"
|
|
4571
|
+
})
|
|
4572
|
+
};
|
|
4573
|
+
return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
|
|
4574
|
+
return this.http.request("post", url_, transformedOptions_);
|
|
4575
|
+
})).pipe(mergeMap((response_) => {
|
|
4576
|
+
return this.transformResult(url_, response_, (r) => this.processRenderDesignProofToResource(r));
|
|
4577
|
+
})).pipe(catchError((response_) => {
|
|
4578
|
+
if (response_ instanceof HttpResponseBase) {
|
|
4579
|
+
try {
|
|
4580
|
+
return this.transformResult(url_, response_, (r) => this.processRenderDesignProofToResource(r));
|
|
4581
|
+
}
|
|
4582
|
+
catch (e) {
|
|
4583
|
+
return throwError(e);
|
|
4584
|
+
}
|
|
4585
|
+
}
|
|
4586
|
+
else
|
|
4587
|
+
return throwError(response_);
|
|
4588
|
+
}));
|
|
4589
|
+
}
|
|
4590
|
+
processRenderDesignProofToResource(response) {
|
|
4591
|
+
const status = response.status;
|
|
4592
|
+
const responseBlob = response instanceof HttpResponse ? response.body :
|
|
4593
|
+
response.error instanceof Blob ? response.error : undefined;
|
|
4594
|
+
let _headers = {};
|
|
4595
|
+
if (response.headers) {
|
|
4596
|
+
for (let key of response.headers.keys()) {
|
|
4597
|
+
_headers[key] = response.headers.get(key);
|
|
4598
|
+
}
|
|
4599
|
+
}
|
|
4600
|
+
if (status === 200) {
|
|
4601
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
4602
|
+
let result200 = null;
|
|
4603
|
+
result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
4604
|
+
return of(result200);
|
|
4605
|
+
}));
|
|
4606
|
+
}
|
|
4607
|
+
else if (status === 401) {
|
|
4608
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
4609
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
4610
|
+
}));
|
|
4611
|
+
}
|
|
4612
|
+
else if (status === 403) {
|
|
4613
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
4614
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
4615
|
+
}));
|
|
4616
|
+
}
|
|
4617
|
+
else if (status === 500) {
|
|
4618
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
4619
|
+
let result500 = null;
|
|
4620
|
+
result500 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
4621
|
+
return throwException("Internal server error", status, _responseText, _headers, result500);
|
|
4622
|
+
}));
|
|
4623
|
+
}
|
|
4624
|
+
else if (status !== 200 && status !== 204) {
|
|
4625
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
4626
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
4627
|
+
}));
|
|
4628
|
+
}
|
|
4629
|
+
return of(null);
|
|
4630
|
+
}
|
|
4308
4631
|
/**
|
|
4309
4632
|
* Render product proof image with specified parameters.
|
|
4310
4633
|
* @param attachment (optional) If set to 'true', file will be provided as an attachment with unique filename supplied (default value is 'false').
|