@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 */
|
|
@@ -2083,6 +2083,81 @@ export class DesignAtomsImagesApiClient extends ApiClientBase {
|
|
|
2083
2083
|
}
|
|
2084
2084
|
return Promise.resolve(null);
|
|
2085
2085
|
}
|
|
2086
|
+
/**
|
|
2087
|
+
* Renders a web image preview with the specified parameters and saves rendering result as resource.
|
|
2088
|
+
* @param tenantId (optional) Tenant identifier
|
|
2089
|
+
* @param body (optional) Render model with preview parameters.
|
|
2090
|
+
* @return Success
|
|
2091
|
+
*/
|
|
2092
|
+
renderImagePreviewToResource(tenantId, body, cancelToken) {
|
|
2093
|
+
let url_ = this.baseUrl + "/api/atoms/v1/images/render-image-preview/to-resource?";
|
|
2094
|
+
if (tenantId === null)
|
|
2095
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
2096
|
+
else if (tenantId !== undefined)
|
|
2097
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2098
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
2099
|
+
const content_ = JSON.stringify(body);
|
|
2100
|
+
let options_ = {
|
|
2101
|
+
data: content_,
|
|
2102
|
+
method: "POST",
|
|
2103
|
+
url: url_,
|
|
2104
|
+
headers: {
|
|
2105
|
+
"Content-Type": "application/json",
|
|
2106
|
+
"Accept": "application/json"
|
|
2107
|
+
},
|
|
2108
|
+
cancelToken
|
|
2109
|
+
};
|
|
2110
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
2111
|
+
return this.instance.request(transformedOptions_);
|
|
2112
|
+
}).catch((_error) => {
|
|
2113
|
+
if (isAxiosError(_error) && _error.response) {
|
|
2114
|
+
return _error.response;
|
|
2115
|
+
}
|
|
2116
|
+
else {
|
|
2117
|
+
throw _error;
|
|
2118
|
+
}
|
|
2119
|
+
}).then((_response) => {
|
|
2120
|
+
return this.transformResult(url_, _response, (_response) => this.processRenderImagePreviewToResource(_response));
|
|
2121
|
+
});
|
|
2122
|
+
}
|
|
2123
|
+
processRenderImagePreviewToResource(response) {
|
|
2124
|
+
const status = response.status;
|
|
2125
|
+
let _headers = {};
|
|
2126
|
+
if (response.headers && typeof response.headers === "object") {
|
|
2127
|
+
for (let k in response.headers) {
|
|
2128
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
2129
|
+
_headers[k] = response.headers[k];
|
|
2130
|
+
}
|
|
2131
|
+
}
|
|
2132
|
+
}
|
|
2133
|
+
if (status === 200) {
|
|
2134
|
+
const _responseText = response.data;
|
|
2135
|
+
let result200 = null;
|
|
2136
|
+
let resultData200 = _responseText;
|
|
2137
|
+
result200 = JSON.parse(resultData200);
|
|
2138
|
+
return Promise.resolve(result200);
|
|
2139
|
+
}
|
|
2140
|
+
else if (status === 401) {
|
|
2141
|
+
const _responseText = response.data;
|
|
2142
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
2143
|
+
}
|
|
2144
|
+
else if (status === 403) {
|
|
2145
|
+
const _responseText = response.data;
|
|
2146
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
2147
|
+
}
|
|
2148
|
+
else if (status === 500) {
|
|
2149
|
+
const _responseText = response.data;
|
|
2150
|
+
let result500 = null;
|
|
2151
|
+
let resultData500 = _responseText;
|
|
2152
|
+
result500 = JSON.parse(resultData500);
|
|
2153
|
+
return throwException("Internal server error", status, _responseText, _headers, result500);
|
|
2154
|
+
}
|
|
2155
|
+
else if (status !== 200 && status !== 204) {
|
|
2156
|
+
const _responseText = response.data;
|
|
2157
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
2158
|
+
}
|
|
2159
|
+
return Promise.resolve(null);
|
|
2160
|
+
}
|
|
2086
2161
|
}
|
|
2087
2162
|
export class DesignAtomsMockups3dApiClient extends ApiClientBase {
|
|
2088
2163
|
instance;
|
|
@@ -3719,6 +3794,81 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3719
3794
|
}
|
|
3720
3795
|
return Promise.resolve(null);
|
|
3721
3796
|
}
|
|
3797
|
+
/**
|
|
3798
|
+
* Extracts product item image.
|
|
3799
|
+
* @param tenantId (optional) Tenant identifier
|
|
3800
|
+
* @param body (optional) Extraction parameters.
|
|
3801
|
+
* @return Success
|
|
3802
|
+
*/
|
|
3803
|
+
extractItemImage(tenantId, body, cancelToken) {
|
|
3804
|
+
let url_ = this.baseUrl + "/api/atoms/v1/itemExtractor?";
|
|
3805
|
+
if (tenantId === null)
|
|
3806
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
3807
|
+
else if (tenantId !== undefined)
|
|
3808
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
3809
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
3810
|
+
const content_ = JSON.stringify(body);
|
|
3811
|
+
let options_ = {
|
|
3812
|
+
data: content_,
|
|
3813
|
+
responseType: "blob",
|
|
3814
|
+
method: "POST",
|
|
3815
|
+
url: url_,
|
|
3816
|
+
headers: {
|
|
3817
|
+
"Content-Type": "application/json",
|
|
3818
|
+
"Accept": "application/octet-stream"
|
|
3819
|
+
},
|
|
3820
|
+
cancelToken
|
|
3821
|
+
};
|
|
3822
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
3823
|
+
return this.instance.request(transformedOptions_);
|
|
3824
|
+
}).catch((_error) => {
|
|
3825
|
+
if (isAxiosError(_error) && _error.response) {
|
|
3826
|
+
return _error.response;
|
|
3827
|
+
}
|
|
3828
|
+
else {
|
|
3829
|
+
throw _error;
|
|
3830
|
+
}
|
|
3831
|
+
}).then((_response) => {
|
|
3832
|
+
return this.transformResult(url_, _response, (_response) => this.processExtractItemImage(_response));
|
|
3833
|
+
});
|
|
3834
|
+
}
|
|
3835
|
+
processExtractItemImage(response) {
|
|
3836
|
+
const status = response.status;
|
|
3837
|
+
let _headers = {};
|
|
3838
|
+
if (response.headers && typeof response.headers === "object") {
|
|
3839
|
+
for (let k in response.headers) {
|
|
3840
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
3841
|
+
_headers[k] = response.headers[k];
|
|
3842
|
+
}
|
|
3843
|
+
}
|
|
3844
|
+
}
|
|
3845
|
+
if (status === 200 || status === 206) {
|
|
3846
|
+
const contentDisposition = response.headers ? response.headers["content-disposition"] : undefined;
|
|
3847
|
+
const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
|
|
3848
|
+
const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
|
|
3849
|
+
return Promise.resolve({ fileName: fileName, status: status, data: new Blob([response.data]), headers: _headers });
|
|
3850
|
+
}
|
|
3851
|
+
else if (status === 401) {
|
|
3852
|
+
const _responseText = response.data;
|
|
3853
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
3854
|
+
}
|
|
3855
|
+
else if (status === 403) {
|
|
3856
|
+
const _responseText = response.data;
|
|
3857
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
3858
|
+
}
|
|
3859
|
+
else if (status === 500) {
|
|
3860
|
+
const _responseText = response.data;
|
|
3861
|
+
let result500 = null;
|
|
3862
|
+
let resultData500 = _responseText;
|
|
3863
|
+
result500 = JSON.parse(resultData500);
|
|
3864
|
+
return throwException("Internal server error", status, _responseText, _headers, result500);
|
|
3865
|
+
}
|
|
3866
|
+
else if (status !== 200 && status !== 204) {
|
|
3867
|
+
const _responseText = response.data;
|
|
3868
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
3869
|
+
}
|
|
3870
|
+
return Promise.resolve(null);
|
|
3871
|
+
}
|
|
3722
3872
|
/**
|
|
3723
3873
|
* Creates a private design from a public design.
|
|
3724
3874
|
* @param designId (optional) Public design ID.
|
|
@@ -3948,6 +4098,81 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3948
4098
|
}
|
|
3949
4099
|
return Promise.resolve(null);
|
|
3950
4100
|
}
|
|
4101
|
+
/**
|
|
4102
|
+
* Renders a design preview with the specified parameters and saves rendering result as resource.
|
|
4103
|
+
* @param tenantId (optional) Tenant identifier
|
|
4104
|
+
* @param body (optional) Render model with preview parameters.
|
|
4105
|
+
* @return Success
|
|
4106
|
+
*/
|
|
4107
|
+
renderDesignPreviewToResource(tenantId, body, cancelToken) {
|
|
4108
|
+
let url_ = this.baseUrl + "/api/atoms/v1/render-design-preview/to-resource?";
|
|
4109
|
+
if (tenantId === null)
|
|
4110
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
4111
|
+
else if (tenantId !== undefined)
|
|
4112
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
4113
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
4114
|
+
const content_ = JSON.stringify(body);
|
|
4115
|
+
let options_ = {
|
|
4116
|
+
data: content_,
|
|
4117
|
+
method: "POST",
|
|
4118
|
+
url: url_,
|
|
4119
|
+
headers: {
|
|
4120
|
+
"Content-Type": "application/json",
|
|
4121
|
+
"Accept": "application/json"
|
|
4122
|
+
},
|
|
4123
|
+
cancelToken
|
|
4124
|
+
};
|
|
4125
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
4126
|
+
return this.instance.request(transformedOptions_);
|
|
4127
|
+
}).catch((_error) => {
|
|
4128
|
+
if (isAxiosError(_error) && _error.response) {
|
|
4129
|
+
return _error.response;
|
|
4130
|
+
}
|
|
4131
|
+
else {
|
|
4132
|
+
throw _error;
|
|
4133
|
+
}
|
|
4134
|
+
}).then((_response) => {
|
|
4135
|
+
return this.transformResult(url_, _response, (_response) => this.processRenderDesignPreviewToResource(_response));
|
|
4136
|
+
});
|
|
4137
|
+
}
|
|
4138
|
+
processRenderDesignPreviewToResource(response) {
|
|
4139
|
+
const status = response.status;
|
|
4140
|
+
let _headers = {};
|
|
4141
|
+
if (response.headers && typeof response.headers === "object") {
|
|
4142
|
+
for (let k in response.headers) {
|
|
4143
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
4144
|
+
_headers[k] = response.headers[k];
|
|
4145
|
+
}
|
|
4146
|
+
}
|
|
4147
|
+
}
|
|
4148
|
+
if (status === 200) {
|
|
4149
|
+
const _responseText = response.data;
|
|
4150
|
+
let result200 = null;
|
|
4151
|
+
let resultData200 = _responseText;
|
|
4152
|
+
result200 = JSON.parse(resultData200);
|
|
4153
|
+
return Promise.resolve(result200);
|
|
4154
|
+
}
|
|
4155
|
+
else if (status === 401) {
|
|
4156
|
+
const _responseText = response.data;
|
|
4157
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
4158
|
+
}
|
|
4159
|
+
else if (status === 403) {
|
|
4160
|
+
const _responseText = response.data;
|
|
4161
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
4162
|
+
}
|
|
4163
|
+
else if (status === 500) {
|
|
4164
|
+
const _responseText = response.data;
|
|
4165
|
+
let result500 = null;
|
|
4166
|
+
let resultData500 = _responseText;
|
|
4167
|
+
result500 = JSON.parse(resultData500);
|
|
4168
|
+
return throwException("Internal server error", status, _responseText, _headers, result500);
|
|
4169
|
+
}
|
|
4170
|
+
else if (status !== 200 && status !== 204) {
|
|
4171
|
+
const _responseText = response.data;
|
|
4172
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
4173
|
+
}
|
|
4174
|
+
return Promise.resolve(null);
|
|
4175
|
+
}
|
|
3951
4176
|
/**
|
|
3952
4177
|
* Renders a design proof with the specified parameters.
|
|
3953
4178
|
* @param attachment (optional) If set to 'true', file will be provided as an attachment with unique filename supplied
|
|
@@ -4027,6 +4252,81 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
4027
4252
|
}
|
|
4028
4253
|
return Promise.resolve(null);
|
|
4029
4254
|
}
|
|
4255
|
+
/**
|
|
4256
|
+
* Renders a design proof with the specified parameters and saves rendering result as resource.
|
|
4257
|
+
* @param tenantId (optional) Tenant identifier
|
|
4258
|
+
* @param body (optional) Render model with preview parameters.
|
|
4259
|
+
* @return Success
|
|
4260
|
+
*/
|
|
4261
|
+
renderDesignProofToResource(tenantId, body, cancelToken) {
|
|
4262
|
+
let url_ = this.baseUrl + "/api/atoms/v1/render-design-proof/to-resource?";
|
|
4263
|
+
if (tenantId === null)
|
|
4264
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
4265
|
+
else if (tenantId !== undefined)
|
|
4266
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
4267
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
4268
|
+
const content_ = JSON.stringify(body);
|
|
4269
|
+
let options_ = {
|
|
4270
|
+
data: content_,
|
|
4271
|
+
method: "POST",
|
|
4272
|
+
url: url_,
|
|
4273
|
+
headers: {
|
|
4274
|
+
"Content-Type": "application/json",
|
|
4275
|
+
"Accept": "application/json"
|
|
4276
|
+
},
|
|
4277
|
+
cancelToken
|
|
4278
|
+
};
|
|
4279
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
4280
|
+
return this.instance.request(transformedOptions_);
|
|
4281
|
+
}).catch((_error) => {
|
|
4282
|
+
if (isAxiosError(_error) && _error.response) {
|
|
4283
|
+
return _error.response;
|
|
4284
|
+
}
|
|
4285
|
+
else {
|
|
4286
|
+
throw _error;
|
|
4287
|
+
}
|
|
4288
|
+
}).then((_response) => {
|
|
4289
|
+
return this.transformResult(url_, _response, (_response) => this.processRenderDesignProofToResource(_response));
|
|
4290
|
+
});
|
|
4291
|
+
}
|
|
4292
|
+
processRenderDesignProofToResource(response) {
|
|
4293
|
+
const status = response.status;
|
|
4294
|
+
let _headers = {};
|
|
4295
|
+
if (response.headers && typeof response.headers === "object") {
|
|
4296
|
+
for (let k in response.headers) {
|
|
4297
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
4298
|
+
_headers[k] = response.headers[k];
|
|
4299
|
+
}
|
|
4300
|
+
}
|
|
4301
|
+
}
|
|
4302
|
+
if (status === 200) {
|
|
4303
|
+
const _responseText = response.data;
|
|
4304
|
+
let result200 = null;
|
|
4305
|
+
let resultData200 = _responseText;
|
|
4306
|
+
result200 = JSON.parse(resultData200);
|
|
4307
|
+
return Promise.resolve(result200);
|
|
4308
|
+
}
|
|
4309
|
+
else if (status === 401) {
|
|
4310
|
+
const _responseText = response.data;
|
|
4311
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
4312
|
+
}
|
|
4313
|
+
else if (status === 403) {
|
|
4314
|
+
const _responseText = response.data;
|
|
4315
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
4316
|
+
}
|
|
4317
|
+
else if (status === 500) {
|
|
4318
|
+
const _responseText = response.data;
|
|
4319
|
+
let result500 = null;
|
|
4320
|
+
let resultData500 = _responseText;
|
|
4321
|
+
result500 = JSON.parse(resultData500);
|
|
4322
|
+
return throwException("Internal server error", status, _responseText, _headers, result500);
|
|
4323
|
+
}
|
|
4324
|
+
else if (status !== 200 && status !== 204) {
|
|
4325
|
+
const _responseText = response.data;
|
|
4326
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
4327
|
+
}
|
|
4328
|
+
return Promise.resolve(null);
|
|
4329
|
+
}
|
|
4030
4330
|
/**
|
|
4031
4331
|
* Render product proof image with specified parameters.
|
|
4032
4332
|
* @param attachment (optional) If set to 'true', file will be provided as an attachment with unique filename supplied (default value is 'false').
|