@aurigma/axios-design-atoms-api-client 2.33.1 → 2.34.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/design-atoms-api-client.d.ts +20 -0
- package/dist/cjs/design-atoms-api-client.js +122 -0
- package/dist/cjs/design-atoms-api-client.js.map +1 -1
- package/dist/esm/design-atoms-api-client.d.ts +20 -0
- package/dist/esm/design-atoms-api-client.js +122 -0
- package/dist/esm/design-atoms-api-client.js.map +1 -1
- package/package.json +1 -1
|
@@ -58,6 +58,10 @@ export interface IDesignAtomsCompatibilityApiClient {
|
|
|
58
58
|
* @return Success
|
|
59
59
|
*/
|
|
60
60
|
getCssFont(tenantId: number, fontKey?: string | null | undefined): Promise<FileResponse>;
|
|
61
|
+
/**
|
|
62
|
+
* @return Success
|
|
63
|
+
*/
|
|
64
|
+
getFallbackFonts(tenantId: number): Promise<FileResponse>;
|
|
61
65
|
/**
|
|
62
66
|
* @param body (optional)
|
|
63
67
|
* @return Success
|
|
@@ -195,6 +199,11 @@ export declare class DesignAtomsCompatibilityApiClient extends ApiClientBase imp
|
|
|
195
199
|
*/
|
|
196
200
|
getCssFont(tenantId: number, fontKey?: string | null | undefined, cancelToken?: CancelToken | undefined): Promise<FileResponse>;
|
|
197
201
|
protected processGetCssFont(response: AxiosResponse): Promise<FileResponse>;
|
|
202
|
+
/**
|
|
203
|
+
* @return Success
|
|
204
|
+
*/
|
|
205
|
+
getFallbackFonts(tenantId: number, cancelToken?: CancelToken | undefined): Promise<FileResponse>;
|
|
206
|
+
protected processGetFallbackFonts(response: AxiosResponse): Promise<FileResponse>;
|
|
198
207
|
/**
|
|
199
208
|
* @param body (optional)
|
|
200
209
|
* @return Success
|
|
@@ -756,6 +765,11 @@ export interface IDesignAtomsViewerApiClient {
|
|
|
756
765
|
* @return Success
|
|
757
766
|
*/
|
|
758
767
|
getCssFont(fontKey?: string | null | undefined, tenantId?: number | undefined): Promise<FileResponse>;
|
|
768
|
+
/**
|
|
769
|
+
* @param tenantId (optional) Tenant identifier
|
|
770
|
+
* @return Success
|
|
771
|
+
*/
|
|
772
|
+
getFallbackFonts(tenantId?: number | undefined): Promise<FileResponse>;
|
|
759
773
|
/**
|
|
760
774
|
* @param tenantId (optional) Tenant identifier
|
|
761
775
|
* @param body (optional)
|
|
@@ -916,6 +930,12 @@ export declare class DesignAtomsViewerApiClient extends ApiClientBase implements
|
|
|
916
930
|
*/
|
|
917
931
|
getCssFont(fontKey?: string | null | undefined, tenantId?: number | undefined, cancelToken?: CancelToken | undefined): Promise<FileResponse>;
|
|
918
932
|
protected processGetCssFont(response: AxiosResponse): Promise<FileResponse>;
|
|
933
|
+
/**
|
|
934
|
+
* @param tenantId (optional) Tenant identifier
|
|
935
|
+
* @return Success
|
|
936
|
+
*/
|
|
937
|
+
getFallbackFonts(tenantId?: number | undefined, cancelToken?: CancelToken | undefined): Promise<FileResponse>;
|
|
938
|
+
protected processGetFallbackFonts(response: AxiosResponse): Promise<FileResponse>;
|
|
919
939
|
/**
|
|
920
940
|
* @param tenantId (optional) Tenant identifier
|
|
921
941
|
* @param body (optional)
|
|
@@ -382,6 +382,66 @@ export class DesignAtomsCompatibilityApiClient extends ApiClientBase {
|
|
|
382
382
|
}
|
|
383
383
|
return Promise.resolve(null);
|
|
384
384
|
}
|
|
385
|
+
/**
|
|
386
|
+
* @return Success
|
|
387
|
+
*/
|
|
388
|
+
getFallbackFonts(tenantId, cancelToken) {
|
|
389
|
+
let url_ = this.baseUrl + "/api/atoms/v1/tenants/{tenantId}/api/ccviewer/GetFallbackFonts";
|
|
390
|
+
if (tenantId === undefined || tenantId === null)
|
|
391
|
+
throw new Error("The parameter 'tenantId' must be defined.");
|
|
392
|
+
url_ = url_.replace("{tenantId}", encodeURIComponent("" + tenantId));
|
|
393
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
394
|
+
let options_ = {
|
|
395
|
+
responseType: "blob",
|
|
396
|
+
method: "GET",
|
|
397
|
+
url: url_,
|
|
398
|
+
headers: {
|
|
399
|
+
"Accept": "application/json"
|
|
400
|
+
},
|
|
401
|
+
cancelToken
|
|
402
|
+
};
|
|
403
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
404
|
+
return this.instance.request(transformedOptions_);
|
|
405
|
+
}).catch((_error) => {
|
|
406
|
+
if (isAxiosError(_error) && _error.response) {
|
|
407
|
+
return _error.response;
|
|
408
|
+
}
|
|
409
|
+
else {
|
|
410
|
+
throw _error;
|
|
411
|
+
}
|
|
412
|
+
}).then((_response) => {
|
|
413
|
+
return this.transformResult(url_, _response, (_response) => this.processGetFallbackFonts(_response));
|
|
414
|
+
});
|
|
415
|
+
}
|
|
416
|
+
processGetFallbackFonts(response) {
|
|
417
|
+
const status = response.status;
|
|
418
|
+
let _headers = {};
|
|
419
|
+
if (response.headers && typeof response.headers === "object") {
|
|
420
|
+
for (let k in response.headers) {
|
|
421
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
422
|
+
_headers[k] = response.headers[k];
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
if (status === 200 || status === 206) {
|
|
427
|
+
const contentDisposition = response.headers ? response.headers["content-disposition"] : undefined;
|
|
428
|
+
const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
|
|
429
|
+
const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
|
|
430
|
+
return Promise.resolve({ fileName: fileName, status: status, data: new Blob([response.data]), headers: _headers });
|
|
431
|
+
}
|
|
432
|
+
else if (status === 500) {
|
|
433
|
+
const _responseText = response.data;
|
|
434
|
+
let result500 = null;
|
|
435
|
+
let resultData500 = _responseText;
|
|
436
|
+
result500 = JSON.parse(resultData500);
|
|
437
|
+
return throwException("Internal server error", status, _responseText, _headers, result500);
|
|
438
|
+
}
|
|
439
|
+
else if (status !== 200 && status !== 204) {
|
|
440
|
+
const _responseText = response.data;
|
|
441
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
442
|
+
}
|
|
443
|
+
return Promise.resolve(null);
|
|
444
|
+
}
|
|
385
445
|
/**
|
|
386
446
|
* @param body (optional)
|
|
387
447
|
* @return Success
|
|
@@ -3709,6 +3769,68 @@ export class DesignAtomsViewerApiClient extends ApiClientBase {
|
|
|
3709
3769
|
}
|
|
3710
3770
|
return Promise.resolve(null);
|
|
3711
3771
|
}
|
|
3772
|
+
/**
|
|
3773
|
+
* @param tenantId (optional) Tenant identifier
|
|
3774
|
+
* @return Success
|
|
3775
|
+
*/
|
|
3776
|
+
getFallbackFonts(tenantId, cancelToken) {
|
|
3777
|
+
let url_ = this.baseUrl + "/api/atoms/v1/ccviewer/GetFallbackFonts?";
|
|
3778
|
+
if (tenantId === null)
|
|
3779
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
3780
|
+
else if (tenantId !== undefined)
|
|
3781
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
3782
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
3783
|
+
let options_ = {
|
|
3784
|
+
responseType: "blob",
|
|
3785
|
+
method: "GET",
|
|
3786
|
+
url: url_,
|
|
3787
|
+
headers: {
|
|
3788
|
+
"Accept": "application/json"
|
|
3789
|
+
},
|
|
3790
|
+
cancelToken
|
|
3791
|
+
};
|
|
3792
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
3793
|
+
return this.instance.request(transformedOptions_);
|
|
3794
|
+
}).catch((_error) => {
|
|
3795
|
+
if (isAxiosError(_error) && _error.response) {
|
|
3796
|
+
return _error.response;
|
|
3797
|
+
}
|
|
3798
|
+
else {
|
|
3799
|
+
throw _error;
|
|
3800
|
+
}
|
|
3801
|
+
}).then((_response) => {
|
|
3802
|
+
return this.transformResult(url_, _response, (_response) => this.processGetFallbackFonts(_response));
|
|
3803
|
+
});
|
|
3804
|
+
}
|
|
3805
|
+
processGetFallbackFonts(response) {
|
|
3806
|
+
const status = response.status;
|
|
3807
|
+
let _headers = {};
|
|
3808
|
+
if (response.headers && typeof response.headers === "object") {
|
|
3809
|
+
for (let k in response.headers) {
|
|
3810
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
3811
|
+
_headers[k] = response.headers[k];
|
|
3812
|
+
}
|
|
3813
|
+
}
|
|
3814
|
+
}
|
|
3815
|
+
if (status === 200 || status === 206) {
|
|
3816
|
+
const contentDisposition = response.headers ? response.headers["content-disposition"] : undefined;
|
|
3817
|
+
const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
|
|
3818
|
+
const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
|
|
3819
|
+
return Promise.resolve({ fileName: fileName, status: status, data: new Blob([response.data]), headers: _headers });
|
|
3820
|
+
}
|
|
3821
|
+
else if (status === 500) {
|
|
3822
|
+
const _responseText = response.data;
|
|
3823
|
+
let result500 = null;
|
|
3824
|
+
let resultData500 = _responseText;
|
|
3825
|
+
result500 = JSON.parse(resultData500);
|
|
3826
|
+
return throwException("Internal server error", status, _responseText, _headers, result500);
|
|
3827
|
+
}
|
|
3828
|
+
else if (status !== 200 && status !== 204) {
|
|
3829
|
+
const _responseText = response.data;
|
|
3830
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
3831
|
+
}
|
|
3832
|
+
return Promise.resolve(null);
|
|
3833
|
+
}
|
|
3712
3834
|
/**
|
|
3713
3835
|
* @param tenantId (optional) Tenant identifier
|
|
3714
3836
|
* @param body (optional)
|