@aurigma/axios-design-atoms-api-client 2.48.1 → 2.50.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 +124 -0
- package/dist/cjs/design-atoms-api-client.js +300 -0
- package/dist/cjs/design-atoms-api-client.js.map +1 -1
- package/dist/esm/design-atoms-api-client.d.ts +124 -0
- package/dist/esm/design-atoms-api-client.js +300 -0
- package/dist/esm/design-atoms-api-client.js.map +1 -1
- package/package.json +1 -1
|
@@ -409,6 +409,13 @@ export interface IDesignAtomsImagesApiClient {
|
|
|
409
409
|
* @return Success
|
|
410
410
|
*/
|
|
411
411
|
renderImagePreview(attachment?: boolean | null | undefined, tenantId?: number | undefined, body?: RenderImagePreviewModel | null | undefined): Promise<FileResponse>;
|
|
412
|
+
/**
|
|
413
|
+
* Renders a web image preview with the specified parameters and saves rendering result as resource.
|
|
414
|
+
* @param tenantId (optional) Tenant identifier
|
|
415
|
+
* @param body (optional) Render model with preview parameters.
|
|
416
|
+
* @return Success
|
|
417
|
+
*/
|
|
418
|
+
renderImagePreviewToResource(tenantId?: number | undefined, body?: RenderImagePreviewToResourceModel | null | undefined): Promise<ResourceInfoDto>;
|
|
412
419
|
}
|
|
413
420
|
export declare class DesignAtomsImagesApiClient extends ApiClientBase implements IDesignAtomsImagesApiClient {
|
|
414
421
|
private instance;
|
|
@@ -425,6 +432,14 @@ export declare class DesignAtomsImagesApiClient extends ApiClientBase implements
|
|
|
425
432
|
*/
|
|
426
433
|
renderImagePreview(attachment?: boolean | null | undefined, tenantId?: number | undefined, body?: RenderImagePreviewModel | null | undefined, cancelToken?: CancelToken | undefined): Promise<FileResponse>;
|
|
427
434
|
protected processRenderImagePreview(response: AxiosResponse): Promise<FileResponse>;
|
|
435
|
+
/**
|
|
436
|
+
* Renders a web image preview with the specified parameters and saves rendering result as resource.
|
|
437
|
+
* @param tenantId (optional) Tenant identifier
|
|
438
|
+
* @param body (optional) Render model with preview parameters.
|
|
439
|
+
* @return Success
|
|
440
|
+
*/
|
|
441
|
+
renderImagePreviewToResource(tenantId?: number | undefined, body?: RenderImagePreviewToResourceModel | null | undefined, cancelToken?: CancelToken | undefined): Promise<ResourceInfoDto>;
|
|
442
|
+
protected processRenderImagePreviewToResource(response: AxiosResponse): Promise<ResourceInfoDto>;
|
|
428
443
|
}
|
|
429
444
|
export interface IDesignAtomsMockups3dApiClient {
|
|
430
445
|
/**
|
|
@@ -627,6 +642,13 @@ export interface IDesignAtomsServiceApiClient {
|
|
|
627
642
|
* @return Success
|
|
628
643
|
*/
|
|
629
644
|
createItem(itemType?: ItemType | null | undefined, tenantId?: number | undefined, sourceType?: ItemSourceType | null | undefined, sourceId?: string | null | undefined, sourceOwnerId?: string | null | undefined, sourceFile?: FileParameter | null | undefined): Promise<any>;
|
|
645
|
+
/**
|
|
646
|
+
* Extracts product item image.
|
|
647
|
+
* @param tenantId (optional) Tenant identifier
|
|
648
|
+
* @param body (optional) Extraction parameters.
|
|
649
|
+
* @return Success
|
|
650
|
+
*/
|
|
651
|
+
extractItemImage(tenantId?: number | undefined, body?: ExtractItemImageModel | null | undefined): Promise<FileResponse>;
|
|
630
652
|
/**
|
|
631
653
|
* Creates a private design from a public design.
|
|
632
654
|
* @param designId (optional) Public design ID.
|
|
@@ -654,6 +676,13 @@ export interface IDesignAtomsServiceApiClient {
|
|
|
654
676
|
* @return Success
|
|
655
677
|
*/
|
|
656
678
|
renderDesignPreview(attachment?: boolean | null | undefined, tenantId?: number | undefined, body?: RenderDesignPreviewModel | null | undefined): Promise<FileResponse>;
|
|
679
|
+
/**
|
|
680
|
+
* Renders a design preview with the specified parameters and saves rendering result as resource.
|
|
681
|
+
* @param tenantId (optional) Tenant identifier
|
|
682
|
+
* @param body (optional) Render model with preview parameters.
|
|
683
|
+
* @return Success
|
|
684
|
+
*/
|
|
685
|
+
renderDesignPreviewToResource(tenantId?: number | undefined, body?: RenderDesignPreviewToResourceModel | null | undefined): Promise<ResourceInfoDto>;
|
|
657
686
|
/**
|
|
658
687
|
* Renders a design proof with the specified parameters.
|
|
659
688
|
* @param attachment (optional) If set to 'true', file will be provided as an attachment with unique filename supplied
|
|
@@ -663,6 +692,13 @@ export interface IDesignAtomsServiceApiClient {
|
|
|
663
692
|
* @return Success
|
|
664
693
|
*/
|
|
665
694
|
renderDesignProof(attachment?: boolean | null | undefined, tenantId?: number | undefined, body?: RenderDesignProofModel | null | undefined): Promise<FileResponse>;
|
|
695
|
+
/**
|
|
696
|
+
* Renders a design proof with the specified parameters and saves rendering result as resource.
|
|
697
|
+
* @param tenantId (optional) Tenant identifier
|
|
698
|
+
* @param body (optional) Render model with preview parameters.
|
|
699
|
+
* @return Success
|
|
700
|
+
*/
|
|
701
|
+
renderDesignProofToResource(tenantId?: number | undefined, body?: RenderDesignProofToResourceModel | null | undefined): Promise<ResourceInfoDto>;
|
|
666
702
|
/**
|
|
667
703
|
* Render product proof image with specified parameters.
|
|
668
704
|
* @param attachment (optional) If set to 'true', file will be provided as an attachment with unique filename supplied (default value is 'false').
|
|
@@ -842,6 +878,14 @@ export declare class DesignAtomsServiceApiClient extends ApiClientBase implement
|
|
|
842
878
|
*/
|
|
843
879
|
createItem(itemType?: ItemType | null | undefined, tenantId?: number | undefined, sourceType?: ItemSourceType | null | undefined, sourceId?: string | null | undefined, sourceOwnerId?: string | null | undefined, sourceFile?: FileParameter | null | undefined, cancelToken?: CancelToken | undefined): Promise<any>;
|
|
844
880
|
protected processCreateItem(response: AxiosResponse): Promise<any>;
|
|
881
|
+
/**
|
|
882
|
+
* Extracts product item image.
|
|
883
|
+
* @param tenantId (optional) Tenant identifier
|
|
884
|
+
* @param body (optional) Extraction parameters.
|
|
885
|
+
* @return Success
|
|
886
|
+
*/
|
|
887
|
+
extractItemImage(tenantId?: number | undefined, body?: ExtractItemImageModel | null | undefined, cancelToken?: CancelToken | undefined): Promise<FileResponse>;
|
|
888
|
+
protected processExtractItemImage(response: AxiosResponse): Promise<FileResponse>;
|
|
845
889
|
/**
|
|
846
890
|
* Creates a private design from a public design.
|
|
847
891
|
* @param designId (optional) Public design ID.
|
|
@@ -872,6 +916,14 @@ export declare class DesignAtomsServiceApiClient extends ApiClientBase implement
|
|
|
872
916
|
*/
|
|
873
917
|
renderDesignPreview(attachment?: boolean | null | undefined, tenantId?: number | undefined, body?: RenderDesignPreviewModel | null | undefined, cancelToken?: CancelToken | undefined): Promise<FileResponse>;
|
|
874
918
|
protected processRenderDesignPreview(response: AxiosResponse): Promise<FileResponse>;
|
|
919
|
+
/**
|
|
920
|
+
* Renders a design preview with the specified parameters and saves rendering result as resource.
|
|
921
|
+
* @param tenantId (optional) Tenant identifier
|
|
922
|
+
* @param body (optional) Render model with preview parameters.
|
|
923
|
+
* @return Success
|
|
924
|
+
*/
|
|
925
|
+
renderDesignPreviewToResource(tenantId?: number | undefined, body?: RenderDesignPreviewToResourceModel | null | undefined, cancelToken?: CancelToken | undefined): Promise<ResourceInfoDto>;
|
|
926
|
+
protected processRenderDesignPreviewToResource(response: AxiosResponse): Promise<ResourceInfoDto>;
|
|
875
927
|
/**
|
|
876
928
|
* Renders a design proof with the specified parameters.
|
|
877
929
|
* @param attachment (optional) If set to 'true', file will be provided as an attachment with unique filename supplied
|
|
@@ -882,6 +934,14 @@ export declare class DesignAtomsServiceApiClient extends ApiClientBase implement
|
|
|
882
934
|
*/
|
|
883
935
|
renderDesignProof(attachment?: boolean | null | undefined, tenantId?: number | undefined, body?: RenderDesignProofModel | null | undefined, cancelToken?: CancelToken | undefined): Promise<FileResponse>;
|
|
884
936
|
protected processRenderDesignProof(response: AxiosResponse): Promise<FileResponse>;
|
|
937
|
+
/**
|
|
938
|
+
* Renders a design proof with the specified parameters and saves rendering result as resource.
|
|
939
|
+
* @param tenantId (optional) Tenant identifier
|
|
940
|
+
* @param body (optional) Render model with preview parameters.
|
|
941
|
+
* @return Success
|
|
942
|
+
*/
|
|
943
|
+
renderDesignProofToResource(tenantId?: number | undefined, body?: RenderDesignProofToResourceModel | null | undefined, cancelToken?: CancelToken | undefined): Promise<ResourceInfoDto>;
|
|
944
|
+
protected processRenderDesignProofToResource(response: AxiosResponse): Promise<ResourceInfoDto>;
|
|
885
945
|
/**
|
|
886
946
|
* Render product proof image with specified parameters.
|
|
887
947
|
* @param attachment (optional) If set to 'true', file will be provided as an attachment with unique filename supplied (default value is 'false').
|
|
@@ -1467,6 +1527,36 @@ export interface RenderImagePreviewModel {
|
|
|
1467
1527
|
/** Image preview configuration. */
|
|
1468
1528
|
renderingConfig?: ImagePreviewRenderingConfig | null;
|
|
1469
1529
|
}
|
|
1530
|
+
export interface ResourceParams {
|
|
1531
|
+
ownerId?: string | null;
|
|
1532
|
+
namespace?: string | null;
|
|
1533
|
+
name?: string | null;
|
|
1534
|
+
sourceId?: string | null;
|
|
1535
|
+
type?: string | null;
|
|
1536
|
+
anonymousAccess?: boolean;
|
|
1537
|
+
}
|
|
1538
|
+
export interface RenderImagePreviewToResourceModel {
|
|
1539
|
+
/** Parameters of resource that should be created for a preview rendering result. */
|
|
1540
|
+
previewResourceParams?: ResourceParams | null;
|
|
1541
|
+
/** External image URL. */
|
|
1542
|
+
imageUrl?: string | null;
|
|
1543
|
+
/** Storage image identifier. */
|
|
1544
|
+
imageId?: string | null;
|
|
1545
|
+
/** Storage image owner identifier. */
|
|
1546
|
+
ownerId?: string | null;
|
|
1547
|
+
/** Mockup identifier. */
|
|
1548
|
+
mockupId?: string | null;
|
|
1549
|
+
/** Image preview configuration. */
|
|
1550
|
+
renderingConfig?: ImagePreviewRenderingConfig | null;
|
|
1551
|
+
}
|
|
1552
|
+
export interface ResourceInfoDto {
|
|
1553
|
+
id?: string | null;
|
|
1554
|
+
ownerId?: string | null;
|
|
1555
|
+
name?: string | null;
|
|
1556
|
+
namespace?: string | null;
|
|
1557
|
+
private?: boolean;
|
|
1558
|
+
url?: string | null;
|
|
1559
|
+
}
|
|
1470
1560
|
export interface Mockup3dAttributesDto {
|
|
1471
1561
|
data?: {
|
|
1472
1562
|
[key: string]: string;
|
|
@@ -1579,6 +1669,11 @@ export declare enum ItemSourceType {
|
|
|
1579
1669
|
ImageStorage = "ImageStorage",
|
|
1580
1670
|
PrivateImageStorage = "PrivateImageStorage"
|
|
1581
1671
|
}
|
|
1672
|
+
/** Render product parameters */
|
|
1673
|
+
export interface ExtractItemImageModel {
|
|
1674
|
+
/** Serialized item description */
|
|
1675
|
+
item: any;
|
|
1676
|
+
}
|
|
1582
1677
|
/** Product preview file format. */
|
|
1583
1678
|
export declare enum ProductPreviewFormat {
|
|
1584
1679
|
Jpeg = "Jpeg",
|
|
@@ -1604,6 +1699,22 @@ Used to get mockup file from public storage. */
|
|
|
1604
1699
|
/** Variable (user) data for design variable fields in the preview image. */
|
|
1605
1700
|
variableData?: VariableInfo[] | null;
|
|
1606
1701
|
}
|
|
1702
|
+
export interface RenderDesignPreviewToResourceModel {
|
|
1703
|
+
/** Parameters of resource that should be created for a preview rendering result. */
|
|
1704
|
+
previewResourceParams?: ResourceParams | null;
|
|
1705
|
+
/** Design ID.
|
|
1706
|
+
Used to get design file from public or private storage. */
|
|
1707
|
+
designId?: string | null;
|
|
1708
|
+
/** Mockup ID.
|
|
1709
|
+
Used to get mockup file from public storage. */
|
|
1710
|
+
mockupId?: string | null;
|
|
1711
|
+
/** ID of the design owner. */
|
|
1712
|
+
ownerId?: string | null;
|
|
1713
|
+
/** Rendering configuration for getting a preview of design. */
|
|
1714
|
+
renderingConfig?: ProductPreviewRenderingConfig | null;
|
|
1715
|
+
/** Variable (user) data for design variable fields in the preview image. */
|
|
1716
|
+
variableData?: VariableInfo[] | null;
|
|
1717
|
+
}
|
|
1607
1718
|
export declare enum ProductProofFormat {
|
|
1608
1719
|
Jpeg = "Jpeg",
|
|
1609
1720
|
Png = "Png",
|
|
@@ -1654,6 +1765,19 @@ Used to get design file from public or private storage. */
|
|
|
1654
1765
|
/** Variable (user) data for design variable fields in the proof image. */
|
|
1655
1766
|
variableData?: VariableInfo[] | null;
|
|
1656
1767
|
}
|
|
1768
|
+
export interface RenderDesignProofToResourceModel {
|
|
1769
|
+
/** Parameters of resource that should be created for a preview rendering result. */
|
|
1770
|
+
proofResourceParams?: ResourceParams | null;
|
|
1771
|
+
/** Design ID.
|
|
1772
|
+
Used to get design file from public or private storage. */
|
|
1773
|
+
designId?: string | null;
|
|
1774
|
+
/** ID of the design owner. */
|
|
1775
|
+
ownerId?: string | null;
|
|
1776
|
+
/** Rendering configuration for getting a proof image of design. */
|
|
1777
|
+
renderingConfig?: ProductProofRenderingConfig | null;
|
|
1778
|
+
/** Variable (user) data for design variable fields in the proof image. */
|
|
1779
|
+
variableData?: VariableInfo[] | null;
|
|
1780
|
+
}
|
|
1657
1781
|
/** Render product parameters */
|
|
1658
1782
|
export interface RenderProductModel {
|
|
1659
1783
|
/** Serialized product description */
|
|
@@ -2090,6 +2090,81 @@ class DesignAtomsImagesApiClient extends ApiClientBase {
|
|
|
2090
2090
|
}
|
|
2091
2091
|
return Promise.resolve(null);
|
|
2092
2092
|
}
|
|
2093
|
+
/**
|
|
2094
|
+
* Renders a web image preview with the specified parameters and saves rendering result as resource.
|
|
2095
|
+
* @param tenantId (optional) Tenant identifier
|
|
2096
|
+
* @param body (optional) Render model with preview parameters.
|
|
2097
|
+
* @return Success
|
|
2098
|
+
*/
|
|
2099
|
+
renderImagePreviewToResource(tenantId, body, cancelToken) {
|
|
2100
|
+
let url_ = this.baseUrl + "/api/atoms/v1/images/render-image-preview/to-resource?";
|
|
2101
|
+
if (tenantId === null)
|
|
2102
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
2103
|
+
else if (tenantId !== undefined)
|
|
2104
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2105
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
2106
|
+
const content_ = JSON.stringify(body);
|
|
2107
|
+
let options_ = {
|
|
2108
|
+
data: content_,
|
|
2109
|
+
method: "POST",
|
|
2110
|
+
url: url_,
|
|
2111
|
+
headers: {
|
|
2112
|
+
"Content-Type": "application/json",
|
|
2113
|
+
"Accept": "application/json"
|
|
2114
|
+
},
|
|
2115
|
+
cancelToken
|
|
2116
|
+
};
|
|
2117
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
2118
|
+
return this.instance.request(transformedOptions_);
|
|
2119
|
+
}).catch((_error) => {
|
|
2120
|
+
if (isAxiosError(_error) && _error.response) {
|
|
2121
|
+
return _error.response;
|
|
2122
|
+
}
|
|
2123
|
+
else {
|
|
2124
|
+
throw _error;
|
|
2125
|
+
}
|
|
2126
|
+
}).then((_response) => {
|
|
2127
|
+
return this.transformResult(url_, _response, (_response) => this.processRenderImagePreviewToResource(_response));
|
|
2128
|
+
});
|
|
2129
|
+
}
|
|
2130
|
+
processRenderImagePreviewToResource(response) {
|
|
2131
|
+
const status = response.status;
|
|
2132
|
+
let _headers = {};
|
|
2133
|
+
if (response.headers && typeof response.headers === "object") {
|
|
2134
|
+
for (let k in response.headers) {
|
|
2135
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
2136
|
+
_headers[k] = response.headers[k];
|
|
2137
|
+
}
|
|
2138
|
+
}
|
|
2139
|
+
}
|
|
2140
|
+
if (status === 200) {
|
|
2141
|
+
const _responseText = response.data;
|
|
2142
|
+
let result200 = null;
|
|
2143
|
+
let resultData200 = _responseText;
|
|
2144
|
+
result200 = JSON.parse(resultData200);
|
|
2145
|
+
return Promise.resolve(result200);
|
|
2146
|
+
}
|
|
2147
|
+
else if (status === 401) {
|
|
2148
|
+
const _responseText = response.data;
|
|
2149
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
2150
|
+
}
|
|
2151
|
+
else if (status === 403) {
|
|
2152
|
+
const _responseText = response.data;
|
|
2153
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
2154
|
+
}
|
|
2155
|
+
else if (status === 500) {
|
|
2156
|
+
const _responseText = response.data;
|
|
2157
|
+
let result500 = null;
|
|
2158
|
+
let resultData500 = _responseText;
|
|
2159
|
+
result500 = JSON.parse(resultData500);
|
|
2160
|
+
return throwException("Internal server error", status, _responseText, _headers, result500);
|
|
2161
|
+
}
|
|
2162
|
+
else if (status !== 200 && status !== 204) {
|
|
2163
|
+
const _responseText = response.data;
|
|
2164
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
2165
|
+
}
|
|
2166
|
+
return Promise.resolve(null);
|
|
2167
|
+
}
|
|
2093
2168
|
}
|
|
2094
2169
|
exports.DesignAtomsImagesApiClient = DesignAtomsImagesApiClient;
|
|
2095
2170
|
class DesignAtomsMockups3dApiClient extends ApiClientBase {
|
|
@@ -3728,6 +3803,81 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3728
3803
|
}
|
|
3729
3804
|
return Promise.resolve(null);
|
|
3730
3805
|
}
|
|
3806
|
+
/**
|
|
3807
|
+
* Extracts product item image.
|
|
3808
|
+
* @param tenantId (optional) Tenant identifier
|
|
3809
|
+
* @param body (optional) Extraction parameters.
|
|
3810
|
+
* @return Success
|
|
3811
|
+
*/
|
|
3812
|
+
extractItemImage(tenantId, body, cancelToken) {
|
|
3813
|
+
let url_ = this.baseUrl + "/api/atoms/v1/itemExtractor?";
|
|
3814
|
+
if (tenantId === null)
|
|
3815
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
3816
|
+
else if (tenantId !== undefined)
|
|
3817
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
3818
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
3819
|
+
const content_ = JSON.stringify(body);
|
|
3820
|
+
let options_ = {
|
|
3821
|
+
data: content_,
|
|
3822
|
+
responseType: "blob",
|
|
3823
|
+
method: "POST",
|
|
3824
|
+
url: url_,
|
|
3825
|
+
headers: {
|
|
3826
|
+
"Content-Type": "application/json",
|
|
3827
|
+
"Accept": "application/octet-stream"
|
|
3828
|
+
},
|
|
3829
|
+
cancelToken
|
|
3830
|
+
};
|
|
3831
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
3832
|
+
return this.instance.request(transformedOptions_);
|
|
3833
|
+
}).catch((_error) => {
|
|
3834
|
+
if (isAxiosError(_error) && _error.response) {
|
|
3835
|
+
return _error.response;
|
|
3836
|
+
}
|
|
3837
|
+
else {
|
|
3838
|
+
throw _error;
|
|
3839
|
+
}
|
|
3840
|
+
}).then((_response) => {
|
|
3841
|
+
return this.transformResult(url_, _response, (_response) => this.processExtractItemImage(_response));
|
|
3842
|
+
});
|
|
3843
|
+
}
|
|
3844
|
+
processExtractItemImage(response) {
|
|
3845
|
+
const status = response.status;
|
|
3846
|
+
let _headers = {};
|
|
3847
|
+
if (response.headers && typeof response.headers === "object") {
|
|
3848
|
+
for (let k in response.headers) {
|
|
3849
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
3850
|
+
_headers[k] = response.headers[k];
|
|
3851
|
+
}
|
|
3852
|
+
}
|
|
3853
|
+
}
|
|
3854
|
+
if (status === 200 || status === 206) {
|
|
3855
|
+
const contentDisposition = response.headers ? response.headers["content-disposition"] : undefined;
|
|
3856
|
+
const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
|
|
3857
|
+
const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
|
|
3858
|
+
return Promise.resolve({ fileName: fileName, status: status, data: new Blob([response.data]), headers: _headers });
|
|
3859
|
+
}
|
|
3860
|
+
else if (status === 401) {
|
|
3861
|
+
const _responseText = response.data;
|
|
3862
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
3863
|
+
}
|
|
3864
|
+
else if (status === 403) {
|
|
3865
|
+
const _responseText = response.data;
|
|
3866
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
3867
|
+
}
|
|
3868
|
+
else if (status === 500) {
|
|
3869
|
+
const _responseText = response.data;
|
|
3870
|
+
let result500 = null;
|
|
3871
|
+
let resultData500 = _responseText;
|
|
3872
|
+
result500 = JSON.parse(resultData500);
|
|
3873
|
+
return throwException("Internal server error", status, _responseText, _headers, result500);
|
|
3874
|
+
}
|
|
3875
|
+
else if (status !== 200 && status !== 204) {
|
|
3876
|
+
const _responseText = response.data;
|
|
3877
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
3878
|
+
}
|
|
3879
|
+
return Promise.resolve(null);
|
|
3880
|
+
}
|
|
3731
3881
|
/**
|
|
3732
3882
|
* Creates a private design from a public design.
|
|
3733
3883
|
* @param designId (optional) Public design ID.
|
|
@@ -3957,6 +4107,81 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3957
4107
|
}
|
|
3958
4108
|
return Promise.resolve(null);
|
|
3959
4109
|
}
|
|
4110
|
+
/**
|
|
4111
|
+
* Renders a design preview with the specified parameters and saves rendering result as resource.
|
|
4112
|
+
* @param tenantId (optional) Tenant identifier
|
|
4113
|
+
* @param body (optional) Render model with preview parameters.
|
|
4114
|
+
* @return Success
|
|
4115
|
+
*/
|
|
4116
|
+
renderDesignPreviewToResource(tenantId, body, cancelToken) {
|
|
4117
|
+
let url_ = this.baseUrl + "/api/atoms/v1/render-design-preview/to-resource?";
|
|
4118
|
+
if (tenantId === null)
|
|
4119
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
4120
|
+
else if (tenantId !== undefined)
|
|
4121
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
4122
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
4123
|
+
const content_ = JSON.stringify(body);
|
|
4124
|
+
let options_ = {
|
|
4125
|
+
data: content_,
|
|
4126
|
+
method: "POST",
|
|
4127
|
+
url: url_,
|
|
4128
|
+
headers: {
|
|
4129
|
+
"Content-Type": "application/json",
|
|
4130
|
+
"Accept": "application/json"
|
|
4131
|
+
},
|
|
4132
|
+
cancelToken
|
|
4133
|
+
};
|
|
4134
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
4135
|
+
return this.instance.request(transformedOptions_);
|
|
4136
|
+
}).catch((_error) => {
|
|
4137
|
+
if (isAxiosError(_error) && _error.response) {
|
|
4138
|
+
return _error.response;
|
|
4139
|
+
}
|
|
4140
|
+
else {
|
|
4141
|
+
throw _error;
|
|
4142
|
+
}
|
|
4143
|
+
}).then((_response) => {
|
|
4144
|
+
return this.transformResult(url_, _response, (_response) => this.processRenderDesignPreviewToResource(_response));
|
|
4145
|
+
});
|
|
4146
|
+
}
|
|
4147
|
+
processRenderDesignPreviewToResource(response) {
|
|
4148
|
+
const status = response.status;
|
|
4149
|
+
let _headers = {};
|
|
4150
|
+
if (response.headers && typeof response.headers === "object") {
|
|
4151
|
+
for (let k in response.headers) {
|
|
4152
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
4153
|
+
_headers[k] = response.headers[k];
|
|
4154
|
+
}
|
|
4155
|
+
}
|
|
4156
|
+
}
|
|
4157
|
+
if (status === 200) {
|
|
4158
|
+
const _responseText = response.data;
|
|
4159
|
+
let result200 = null;
|
|
4160
|
+
let resultData200 = _responseText;
|
|
4161
|
+
result200 = JSON.parse(resultData200);
|
|
4162
|
+
return Promise.resolve(result200);
|
|
4163
|
+
}
|
|
4164
|
+
else if (status === 401) {
|
|
4165
|
+
const _responseText = response.data;
|
|
4166
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
4167
|
+
}
|
|
4168
|
+
else if (status === 403) {
|
|
4169
|
+
const _responseText = response.data;
|
|
4170
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
4171
|
+
}
|
|
4172
|
+
else if (status === 500) {
|
|
4173
|
+
const _responseText = response.data;
|
|
4174
|
+
let result500 = null;
|
|
4175
|
+
let resultData500 = _responseText;
|
|
4176
|
+
result500 = JSON.parse(resultData500);
|
|
4177
|
+
return throwException("Internal server error", status, _responseText, _headers, result500);
|
|
4178
|
+
}
|
|
4179
|
+
else if (status !== 200 && status !== 204) {
|
|
4180
|
+
const _responseText = response.data;
|
|
4181
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
4182
|
+
}
|
|
4183
|
+
return Promise.resolve(null);
|
|
4184
|
+
}
|
|
3960
4185
|
/**
|
|
3961
4186
|
* Renders a design proof with the specified parameters.
|
|
3962
4187
|
* @param attachment (optional) If set to 'true', file will be provided as an attachment with unique filename supplied
|
|
@@ -4036,6 +4261,81 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
4036
4261
|
}
|
|
4037
4262
|
return Promise.resolve(null);
|
|
4038
4263
|
}
|
|
4264
|
+
/**
|
|
4265
|
+
* Renders a design proof with the specified parameters and saves rendering result as resource.
|
|
4266
|
+
* @param tenantId (optional) Tenant identifier
|
|
4267
|
+
* @param body (optional) Render model with preview parameters.
|
|
4268
|
+
* @return Success
|
|
4269
|
+
*/
|
|
4270
|
+
renderDesignProofToResource(tenantId, body, cancelToken) {
|
|
4271
|
+
let url_ = this.baseUrl + "/api/atoms/v1/render-design-proof/to-resource?";
|
|
4272
|
+
if (tenantId === null)
|
|
4273
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
4274
|
+
else if (tenantId !== undefined)
|
|
4275
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
4276
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
4277
|
+
const content_ = JSON.stringify(body);
|
|
4278
|
+
let options_ = {
|
|
4279
|
+
data: content_,
|
|
4280
|
+
method: "POST",
|
|
4281
|
+
url: url_,
|
|
4282
|
+
headers: {
|
|
4283
|
+
"Content-Type": "application/json",
|
|
4284
|
+
"Accept": "application/json"
|
|
4285
|
+
},
|
|
4286
|
+
cancelToken
|
|
4287
|
+
};
|
|
4288
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
4289
|
+
return this.instance.request(transformedOptions_);
|
|
4290
|
+
}).catch((_error) => {
|
|
4291
|
+
if (isAxiosError(_error) && _error.response) {
|
|
4292
|
+
return _error.response;
|
|
4293
|
+
}
|
|
4294
|
+
else {
|
|
4295
|
+
throw _error;
|
|
4296
|
+
}
|
|
4297
|
+
}).then((_response) => {
|
|
4298
|
+
return this.transformResult(url_, _response, (_response) => this.processRenderDesignProofToResource(_response));
|
|
4299
|
+
});
|
|
4300
|
+
}
|
|
4301
|
+
processRenderDesignProofToResource(response) {
|
|
4302
|
+
const status = response.status;
|
|
4303
|
+
let _headers = {};
|
|
4304
|
+
if (response.headers && typeof response.headers === "object") {
|
|
4305
|
+
for (let k in response.headers) {
|
|
4306
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
4307
|
+
_headers[k] = response.headers[k];
|
|
4308
|
+
}
|
|
4309
|
+
}
|
|
4310
|
+
}
|
|
4311
|
+
if (status === 200) {
|
|
4312
|
+
const _responseText = response.data;
|
|
4313
|
+
let result200 = null;
|
|
4314
|
+
let resultData200 = _responseText;
|
|
4315
|
+
result200 = JSON.parse(resultData200);
|
|
4316
|
+
return Promise.resolve(result200);
|
|
4317
|
+
}
|
|
4318
|
+
else if (status === 401) {
|
|
4319
|
+
const _responseText = response.data;
|
|
4320
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
4321
|
+
}
|
|
4322
|
+
else if (status === 403) {
|
|
4323
|
+
const _responseText = response.data;
|
|
4324
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
4325
|
+
}
|
|
4326
|
+
else if (status === 500) {
|
|
4327
|
+
const _responseText = response.data;
|
|
4328
|
+
let result500 = null;
|
|
4329
|
+
let resultData500 = _responseText;
|
|
4330
|
+
result500 = JSON.parse(resultData500);
|
|
4331
|
+
return throwException("Internal server error", status, _responseText, _headers, result500);
|
|
4332
|
+
}
|
|
4333
|
+
else if (status !== 200 && status !== 204) {
|
|
4334
|
+
const _responseText = response.data;
|
|
4335
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
4336
|
+
}
|
|
4337
|
+
return Promise.resolve(null);
|
|
4338
|
+
}
|
|
4039
4339
|
/**
|
|
4040
4340
|
* Render product proof image with specified parameters.
|
|
4041
4341
|
* @param attachment (optional) If set to 'true', file will be provided as an attachment with unique filename supplied (default value is 'false').
|