@aurigma/axios-design-atoms-api-client 2.23.1 → 2.26.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 +97 -15
- package/dist/cjs/design-atoms-api-client.js +222 -11
- package/dist/cjs/design-atoms-api-client.js.map +1 -1
- package/dist/esm/design-atoms-api-client.d.ts +97 -15
- package/dist/esm/design-atoms-api-client.js +221 -10
- package/dist/esm/design-atoms-api-client.js.map +1 -1
- package/package.json +1 -1
|
@@ -405,7 +405,7 @@ export interface IDesignAtomsServiceApiClient {
|
|
|
405
405
|
* @param body (optional) Design variable values
|
|
406
406
|
* @return Success
|
|
407
407
|
*/
|
|
408
|
-
setVariables(id: string | null, privateStorage?: boolean | null | undefined, privateStorageOwner?: string | null | undefined, tenantId?: number | undefined, body?: VariablesModel | null | undefined): Promise<
|
|
408
|
+
setVariables(id: string | null, privateStorage?: boolean | null | undefined, privateStorageOwner?: string | null | undefined, tenantId?: number | undefined, body?: VariablesModel | null | undefined): Promise<void>;
|
|
409
409
|
/**
|
|
410
410
|
* Loads variable data printing information from design file taken from storage
|
|
411
411
|
* @param id Design identifier
|
|
@@ -435,9 +435,9 @@ export interface IDesignAtomsServiceApiClient {
|
|
|
435
435
|
*/
|
|
436
436
|
deleteVdpData(id: string | null, privateStorage?: boolean | null | undefined, privateStorageOwner?: string | null | undefined, tenantId?: number | undefined): Promise<void>;
|
|
437
437
|
/**
|
|
438
|
-
* Flatten items
|
|
438
|
+
* Flatten items.
|
|
439
439
|
* @param tenantId (optional) Tenant identifier
|
|
440
|
-
* @param body (optional) Items to flatten
|
|
440
|
+
* @param body (optional) Items to flatten.
|
|
441
441
|
* @return Success
|
|
442
442
|
*/
|
|
443
443
|
flattenItems(tenantId?: number | undefined, body?: any[] | null | undefined): Promise<any>;
|
|
@@ -452,11 +452,37 @@ export interface IDesignAtomsServiceApiClient {
|
|
|
452
452
|
* @return Success
|
|
453
453
|
*/
|
|
454
454
|
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>;
|
|
455
|
+
/**
|
|
456
|
+
* Creates a private design from a public design.
|
|
457
|
+
* @param designId (optional) Public design ID.
|
|
458
|
+
* @param privateDesignId (optional) Private design ID.
|
|
459
|
+
* @param privateStorageOwner (optional) Private storage owner ID.
|
|
460
|
+
* @param tenantId (optional) Tenant identifier
|
|
461
|
+
* @return Success
|
|
462
|
+
*/
|
|
463
|
+
createPrivateDesignFromDesign(designId?: string | null | undefined, privateDesignId?: string | null | undefined, privateStorageOwner?: string | null | undefined, tenantId?: number | undefined): Promise<void>;
|
|
464
|
+
/**
|
|
465
|
+
* Creates a private design from a public resource.
|
|
466
|
+
* @param resourceId (optional) Resource ID.
|
|
467
|
+
* @param privateDesignId (optional) Private design ID.
|
|
468
|
+
* @param privateStorageOwner (optional) Private storage owner ID.
|
|
469
|
+
* @param tenantId (optional) Tenant identifier
|
|
470
|
+
* @return Success
|
|
471
|
+
*/
|
|
472
|
+
createPrivateDesignFromResource(resourceId?: string | null | undefined, privateDesignId?: string | null | undefined, privateStorageOwner?: string | null | undefined, tenantId?: number | undefined): Promise<void>;
|
|
473
|
+
/**
|
|
474
|
+
* Renders a design with the specified parameters.
|
|
475
|
+
* @param attachment (optional) If set to 'true', file will be provided as an attachment with unique filename supplied (default value is 'false').
|
|
476
|
+
* @param tenantId (optional) Tenant identifier
|
|
477
|
+
* @param body (optional) Render model with preview parameters.
|
|
478
|
+
* @return Success
|
|
479
|
+
*/
|
|
480
|
+
renderDesign(attachment?: boolean | null | undefined, tenantId?: number | undefined, body?: RenderDesignModel | null | undefined): Promise<FileResponse>;
|
|
455
481
|
/**
|
|
456
482
|
* Render product proof image with specified parameters.
|
|
457
|
-
* @param attachment (optional) If set to 'true', file will be provided as an attachment with unique filename supplied (default value is 'false')
|
|
483
|
+
* @param attachment (optional) If set to 'true', file will be provided as an attachment with unique filename supplied (default value is 'false').
|
|
458
484
|
* @param tenantId (optional) Tenant identifier
|
|
459
|
-
* @param body (optional) Preview parameters
|
|
485
|
+
* @param body (optional) Preview parameters.
|
|
460
486
|
* @return Success
|
|
461
487
|
*/
|
|
462
488
|
renderProduct(attachment?: boolean | null | undefined, tenantId?: number | undefined, body?: RenderProductModel | null | undefined): Promise<FileResponse>;
|
|
@@ -547,8 +573,8 @@ export declare class DesignAtomsServiceApiClient extends ApiClientBase implement
|
|
|
547
573
|
* @param body (optional) Design variable values
|
|
548
574
|
* @return Success
|
|
549
575
|
*/
|
|
550
|
-
setVariables(id: string | null, privateStorage?: boolean | null | undefined, privateStorageOwner?: string | null | undefined, tenantId?: number | undefined, body?: VariablesModel | null | undefined, cancelToken?: CancelToken | undefined): Promise<
|
|
551
|
-
protected processSetVariables(response: AxiosResponse): Promise<
|
|
576
|
+
setVariables(id: string | null, privateStorage?: boolean | null | undefined, privateStorageOwner?: string | null | undefined, tenantId?: number | undefined, body?: VariablesModel | null | undefined, cancelToken?: CancelToken | undefined): Promise<void>;
|
|
577
|
+
protected processSetVariables(response: AxiosResponse): Promise<void>;
|
|
552
578
|
/**
|
|
553
579
|
* Loads variable data printing information from design file taken from storage
|
|
554
580
|
* @param id Design identifier
|
|
@@ -581,9 +607,9 @@ export declare class DesignAtomsServiceApiClient extends ApiClientBase implement
|
|
|
581
607
|
deleteVdpData(id: string | null, privateStorage?: boolean | null | undefined, privateStorageOwner?: string | null | undefined, tenantId?: number | undefined, cancelToken?: CancelToken | undefined): Promise<void>;
|
|
582
608
|
protected processDeleteVdpData(response: AxiosResponse): Promise<void>;
|
|
583
609
|
/**
|
|
584
|
-
* Flatten items
|
|
610
|
+
* Flatten items.
|
|
585
611
|
* @param tenantId (optional) Tenant identifier
|
|
586
|
-
* @param body (optional) Items to flatten
|
|
612
|
+
* @param body (optional) Items to flatten.
|
|
587
613
|
* @return Success
|
|
588
614
|
*/
|
|
589
615
|
flattenItems(tenantId?: number | undefined, body?: any[] | null | undefined, cancelToken?: CancelToken | undefined): Promise<any>;
|
|
@@ -600,11 +626,40 @@ export declare class DesignAtomsServiceApiClient extends ApiClientBase implement
|
|
|
600
626
|
*/
|
|
601
627
|
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>;
|
|
602
628
|
protected processCreateItem(response: AxiosResponse): Promise<any>;
|
|
629
|
+
/**
|
|
630
|
+
* Creates a private design from a public design.
|
|
631
|
+
* @param designId (optional) Public design ID.
|
|
632
|
+
* @param privateDesignId (optional) Private design ID.
|
|
633
|
+
* @param privateStorageOwner (optional) Private storage owner ID.
|
|
634
|
+
* @param tenantId (optional) Tenant identifier
|
|
635
|
+
* @return Success
|
|
636
|
+
*/
|
|
637
|
+
createPrivateDesignFromDesign(designId?: string | null | undefined, privateDesignId?: string | null | undefined, privateStorageOwner?: string | null | undefined, tenantId?: number | undefined, cancelToken?: CancelToken | undefined): Promise<void>;
|
|
638
|
+
protected processCreatePrivateDesignFromDesign(response: AxiosResponse): Promise<void>;
|
|
639
|
+
/**
|
|
640
|
+
* Creates a private design from a public resource.
|
|
641
|
+
* @param resourceId (optional) Resource ID.
|
|
642
|
+
* @param privateDesignId (optional) Private design ID.
|
|
643
|
+
* @param privateStorageOwner (optional) Private storage owner ID.
|
|
644
|
+
* @param tenantId (optional) Tenant identifier
|
|
645
|
+
* @return Success
|
|
646
|
+
*/
|
|
647
|
+
createPrivateDesignFromResource(resourceId?: string | null | undefined, privateDesignId?: string | null | undefined, privateStorageOwner?: string | null | undefined, tenantId?: number | undefined, cancelToken?: CancelToken | undefined): Promise<void>;
|
|
648
|
+
protected processCreatePrivateDesignFromResource(response: AxiosResponse): Promise<void>;
|
|
649
|
+
/**
|
|
650
|
+
* Renders a design with the specified parameters.
|
|
651
|
+
* @param attachment (optional) If set to 'true', file will be provided as an attachment with unique filename supplied (default value is 'false').
|
|
652
|
+
* @param tenantId (optional) Tenant identifier
|
|
653
|
+
* @param body (optional) Render model with preview parameters.
|
|
654
|
+
* @return Success
|
|
655
|
+
*/
|
|
656
|
+
renderDesign(attachment?: boolean | null | undefined, tenantId?: number | undefined, body?: RenderDesignModel | null | undefined, cancelToken?: CancelToken | undefined): Promise<FileResponse>;
|
|
657
|
+
protected processRenderDesign(response: AxiosResponse): Promise<FileResponse>;
|
|
603
658
|
/**
|
|
604
659
|
* Render product proof image with specified parameters.
|
|
605
|
-
* @param attachment (optional) If set to 'true', file will be provided as an attachment with unique filename supplied (default value is 'false')
|
|
660
|
+
* @param attachment (optional) If set to 'true', file will be provided as an attachment with unique filename supplied (default value is 'false').
|
|
606
661
|
* @param tenantId (optional) Tenant identifier
|
|
607
|
-
* @param body (optional) Preview parameters
|
|
662
|
+
* @param body (optional) Preview parameters.
|
|
608
663
|
* @return Success
|
|
609
664
|
*/
|
|
610
665
|
renderProduct(attachment?: boolean | null | undefined, tenantId?: number | undefined, body?: RenderProductModel | null | undefined, cancelToken?: CancelToken | undefined): Promise<FileResponse>;
|
|
@@ -1060,13 +1115,13 @@ export declare enum ProductPatchType {
|
|
|
1060
1115
|
Undefined = "Undefined",
|
|
1061
1116
|
ReplaceImageItemFile = "ReplaceImageItemFile"
|
|
1062
1117
|
}
|
|
1063
|
-
/** Variable information */
|
|
1118
|
+
/** Variable information. */
|
|
1064
1119
|
export interface VariableInfo {
|
|
1065
|
-
/** Variable name */
|
|
1120
|
+
/** Variable name. */
|
|
1066
1121
|
name?: string | null;
|
|
1067
|
-
/** Variable value */
|
|
1122
|
+
/** Variable value. */
|
|
1068
1123
|
value?: string | null;
|
|
1069
|
-
/** Variable type */
|
|
1124
|
+
/** Variable type. */
|
|
1070
1125
|
type?: string | null;
|
|
1071
1126
|
}
|
|
1072
1127
|
/** Variables information */
|
|
@@ -1093,6 +1148,33 @@ export declare enum ItemSourceType {
|
|
|
1093
1148
|
ImageStorage = "ImageStorage",
|
|
1094
1149
|
PrivateImageStorage = "PrivateImageStorage"
|
|
1095
1150
|
}
|
|
1151
|
+
/** Product preview file format. */
|
|
1152
|
+
export declare enum ProductPreviewFormat {
|
|
1153
|
+
Jpeg = "Jpeg",
|
|
1154
|
+
Png = "Png",
|
|
1155
|
+
Tiff = "Tiff",
|
|
1156
|
+
Pdf = "Pdf"
|
|
1157
|
+
}
|
|
1158
|
+
export interface ProductPreviewRenderingConfig {
|
|
1159
|
+
surfaceIndex?: number | null;
|
|
1160
|
+
width?: number;
|
|
1161
|
+
height?: number;
|
|
1162
|
+
fileFormat?: ProductPreviewFormat | null;
|
|
1163
|
+
}
|
|
1164
|
+
export interface RenderDesignModel {
|
|
1165
|
+
/** Design ID.
|
|
1166
|
+
Used to get design file from public or private storage. */
|
|
1167
|
+
designId?: string | null;
|
|
1168
|
+
/** Mockup ID.
|
|
1169
|
+
Used to get mockup file from public storage. */
|
|
1170
|
+
mockupId?: string | null;
|
|
1171
|
+
/** ID of the design owner. */
|
|
1172
|
+
ownerId?: string | null;
|
|
1173
|
+
/** Rendering configuration for getting a preview of design. */
|
|
1174
|
+
renderingConfig?: ProductPreviewRenderingConfig | null;
|
|
1175
|
+
/** Variable (user) data of design. */
|
|
1176
|
+
variableData?: VariableInfo[] | null;
|
|
1177
|
+
}
|
|
1096
1178
|
export declare enum ProductProofFormat {
|
|
1097
1179
|
Jpeg = "Jpeg",
|
|
1098
1180
|
Png = "Png",
|
|
@@ -2174,7 +2174,6 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2174
2174
|
url: url_,
|
|
2175
2175
|
headers: {
|
|
2176
2176
|
"Content-Type": "application/json",
|
|
2177
|
-
"Accept": "application/json"
|
|
2178
2177
|
},
|
|
2179
2178
|
cancelToken
|
|
2180
2179
|
};
|
|
@@ -2203,10 +2202,7 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2203
2202
|
}
|
|
2204
2203
|
if (status === 200) {
|
|
2205
2204
|
const _responseText = response.data;
|
|
2206
|
-
|
|
2207
|
-
let resultData200 = _responseText;
|
|
2208
|
-
result200 = JSON.parse(resultData200);
|
|
2209
|
-
return Promise.resolve(result200);
|
|
2205
|
+
return Promise.resolve(null);
|
|
2210
2206
|
}
|
|
2211
2207
|
else if (status === 404) {
|
|
2212
2208
|
const _responseText = response.data;
|
|
@@ -2482,9 +2478,9 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2482
2478
|
return Promise.resolve(null);
|
|
2483
2479
|
}
|
|
2484
2480
|
/**
|
|
2485
|
-
* Flatten items
|
|
2481
|
+
* Flatten items.
|
|
2486
2482
|
* @param tenantId (optional) Tenant identifier
|
|
2487
|
-
* @param body (optional) Items to flatten
|
|
2483
|
+
* @param body (optional) Items to flatten.
|
|
2488
2484
|
* @return Success
|
|
2489
2485
|
*/
|
|
2490
2486
|
flattenItems(tenantId, body, cancelToken) {
|
|
@@ -2637,11 +2633,218 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2637
2633
|
}
|
|
2638
2634
|
return Promise.resolve(null);
|
|
2639
2635
|
}
|
|
2636
|
+
/**
|
|
2637
|
+
* Creates a private design from a public design.
|
|
2638
|
+
* @param designId (optional) Public design ID.
|
|
2639
|
+
* @param privateDesignId (optional) Private design ID.
|
|
2640
|
+
* @param privateStorageOwner (optional) Private storage owner ID.
|
|
2641
|
+
* @param tenantId (optional) Tenant identifier
|
|
2642
|
+
* @return Success
|
|
2643
|
+
*/
|
|
2644
|
+
createPrivateDesignFromDesign(designId, privateDesignId, privateStorageOwner, tenantId, cancelToken) {
|
|
2645
|
+
let url_ = this.baseUrl + "/api/atoms/v1/private-designs/from-design?";
|
|
2646
|
+
if (designId !== undefined && designId !== null)
|
|
2647
|
+
url_ += "designId=" + encodeURIComponent("" + designId) + "&";
|
|
2648
|
+
if (privateDesignId !== undefined && privateDesignId !== null)
|
|
2649
|
+
url_ += "privateDesignId=" + encodeURIComponent("" + privateDesignId) + "&";
|
|
2650
|
+
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
2651
|
+
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
2652
|
+
if (tenantId === null)
|
|
2653
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
2654
|
+
else if (tenantId !== undefined)
|
|
2655
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2656
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
2657
|
+
let options_ = {
|
|
2658
|
+
method: "POST",
|
|
2659
|
+
url: url_,
|
|
2660
|
+
headers: {},
|
|
2661
|
+
cancelToken
|
|
2662
|
+
};
|
|
2663
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
2664
|
+
return this.instance.request(transformedOptions_);
|
|
2665
|
+
}).catch((_error) => {
|
|
2666
|
+
if (isAxiosError(_error) && _error.response) {
|
|
2667
|
+
return _error.response;
|
|
2668
|
+
}
|
|
2669
|
+
else {
|
|
2670
|
+
throw _error;
|
|
2671
|
+
}
|
|
2672
|
+
}).then((_response) => {
|
|
2673
|
+
return this.transformResult(url_, _response, (_response) => this.processCreatePrivateDesignFromDesign(_response));
|
|
2674
|
+
});
|
|
2675
|
+
}
|
|
2676
|
+
processCreatePrivateDesignFromDesign(response) {
|
|
2677
|
+
const status = response.status;
|
|
2678
|
+
let _headers = {};
|
|
2679
|
+
if (response.headers && typeof response.headers === "object") {
|
|
2680
|
+
for (let k in response.headers) {
|
|
2681
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
2682
|
+
_headers[k] = response.headers[k];
|
|
2683
|
+
}
|
|
2684
|
+
}
|
|
2685
|
+
}
|
|
2686
|
+
if (status === 201) {
|
|
2687
|
+
const _responseText = response.data;
|
|
2688
|
+
return Promise.resolve(null);
|
|
2689
|
+
}
|
|
2690
|
+
else if (status === 401) {
|
|
2691
|
+
const _responseText = response.data;
|
|
2692
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
2693
|
+
}
|
|
2694
|
+
else if (status === 403) {
|
|
2695
|
+
const _responseText = response.data;
|
|
2696
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
2697
|
+
}
|
|
2698
|
+
else if (status !== 200 && status !== 204) {
|
|
2699
|
+
const _responseText = response.data;
|
|
2700
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
2701
|
+
}
|
|
2702
|
+
return Promise.resolve(null);
|
|
2703
|
+
}
|
|
2704
|
+
/**
|
|
2705
|
+
* Creates a private design from a public resource.
|
|
2706
|
+
* @param resourceId (optional) Resource ID.
|
|
2707
|
+
* @param privateDesignId (optional) Private design ID.
|
|
2708
|
+
* @param privateStorageOwner (optional) Private storage owner ID.
|
|
2709
|
+
* @param tenantId (optional) Tenant identifier
|
|
2710
|
+
* @return Success
|
|
2711
|
+
*/
|
|
2712
|
+
createPrivateDesignFromResource(resourceId, privateDesignId, privateStorageOwner, tenantId, cancelToken) {
|
|
2713
|
+
let url_ = this.baseUrl + "/api/atoms/v1/private-designs/from-resource?";
|
|
2714
|
+
if (resourceId !== undefined && resourceId !== null)
|
|
2715
|
+
url_ += "resourceId=" + encodeURIComponent("" + resourceId) + "&";
|
|
2716
|
+
if (privateDesignId !== undefined && privateDesignId !== null)
|
|
2717
|
+
url_ += "privateDesignId=" + encodeURIComponent("" + privateDesignId) + "&";
|
|
2718
|
+
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
2719
|
+
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
2720
|
+
if (tenantId === null)
|
|
2721
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
2722
|
+
else if (tenantId !== undefined)
|
|
2723
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2724
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
2725
|
+
let options_ = {
|
|
2726
|
+
method: "POST",
|
|
2727
|
+
url: url_,
|
|
2728
|
+
headers: {},
|
|
2729
|
+
cancelToken
|
|
2730
|
+
};
|
|
2731
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
2732
|
+
return this.instance.request(transformedOptions_);
|
|
2733
|
+
}).catch((_error) => {
|
|
2734
|
+
if (isAxiosError(_error) && _error.response) {
|
|
2735
|
+
return _error.response;
|
|
2736
|
+
}
|
|
2737
|
+
else {
|
|
2738
|
+
throw _error;
|
|
2739
|
+
}
|
|
2740
|
+
}).then((_response) => {
|
|
2741
|
+
return this.transformResult(url_, _response, (_response) => this.processCreatePrivateDesignFromResource(_response));
|
|
2742
|
+
});
|
|
2743
|
+
}
|
|
2744
|
+
processCreatePrivateDesignFromResource(response) {
|
|
2745
|
+
const status = response.status;
|
|
2746
|
+
let _headers = {};
|
|
2747
|
+
if (response.headers && typeof response.headers === "object") {
|
|
2748
|
+
for (let k in response.headers) {
|
|
2749
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
2750
|
+
_headers[k] = response.headers[k];
|
|
2751
|
+
}
|
|
2752
|
+
}
|
|
2753
|
+
}
|
|
2754
|
+
if (status === 201) {
|
|
2755
|
+
const _responseText = response.data;
|
|
2756
|
+
return Promise.resolve(null);
|
|
2757
|
+
}
|
|
2758
|
+
else if (status === 401) {
|
|
2759
|
+
const _responseText = response.data;
|
|
2760
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
2761
|
+
}
|
|
2762
|
+
else if (status === 403) {
|
|
2763
|
+
const _responseText = response.data;
|
|
2764
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
2765
|
+
}
|
|
2766
|
+
else if (status !== 200 && status !== 204) {
|
|
2767
|
+
const _responseText = response.data;
|
|
2768
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
2769
|
+
}
|
|
2770
|
+
return Promise.resolve(null);
|
|
2771
|
+
}
|
|
2772
|
+
/**
|
|
2773
|
+
* Renders a design with the specified parameters.
|
|
2774
|
+
* @param attachment (optional) If set to 'true', file will be provided as an attachment with unique filename supplied (default value is 'false').
|
|
2775
|
+
* @param tenantId (optional) Tenant identifier
|
|
2776
|
+
* @param body (optional) Render model with preview parameters.
|
|
2777
|
+
* @return Success
|
|
2778
|
+
*/
|
|
2779
|
+
renderDesign(attachment, tenantId, body, cancelToken) {
|
|
2780
|
+
let url_ = this.baseUrl + "/api/atoms/v1/render-design-preview?";
|
|
2781
|
+
if (attachment !== undefined && attachment !== null)
|
|
2782
|
+
url_ += "attachment=" + encodeURIComponent("" + attachment) + "&";
|
|
2783
|
+
if (tenantId === null)
|
|
2784
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
2785
|
+
else if (tenantId !== undefined)
|
|
2786
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2787
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
2788
|
+
const content_ = JSON.stringify(body);
|
|
2789
|
+
let options_ = {
|
|
2790
|
+
data: content_,
|
|
2791
|
+
responseType: "blob",
|
|
2792
|
+
method: "POST",
|
|
2793
|
+
url: url_,
|
|
2794
|
+
headers: {
|
|
2795
|
+
"Content-Type": "application/json",
|
|
2796
|
+
"Accept": "application/octet-stream"
|
|
2797
|
+
},
|
|
2798
|
+
cancelToken
|
|
2799
|
+
};
|
|
2800
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
2801
|
+
return this.instance.request(transformedOptions_);
|
|
2802
|
+
}).catch((_error) => {
|
|
2803
|
+
if (isAxiosError(_error) && _error.response) {
|
|
2804
|
+
return _error.response;
|
|
2805
|
+
}
|
|
2806
|
+
else {
|
|
2807
|
+
throw _error;
|
|
2808
|
+
}
|
|
2809
|
+
}).then((_response) => {
|
|
2810
|
+
return this.transformResult(url_, _response, (_response) => this.processRenderDesign(_response));
|
|
2811
|
+
});
|
|
2812
|
+
}
|
|
2813
|
+
processRenderDesign(response) {
|
|
2814
|
+
const status = response.status;
|
|
2815
|
+
let _headers = {};
|
|
2816
|
+
if (response.headers && typeof response.headers === "object") {
|
|
2817
|
+
for (let k in response.headers) {
|
|
2818
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
2819
|
+
_headers[k] = response.headers[k];
|
|
2820
|
+
}
|
|
2821
|
+
}
|
|
2822
|
+
}
|
|
2823
|
+
if (status === 200 || status === 206) {
|
|
2824
|
+
const contentDisposition = response.headers ? response.headers["content-disposition"] : undefined;
|
|
2825
|
+
const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
|
|
2826
|
+
const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
|
|
2827
|
+
return Promise.resolve({ fileName: fileName, status: status, data: new Blob([response.data]), headers: _headers });
|
|
2828
|
+
}
|
|
2829
|
+
else if (status === 401) {
|
|
2830
|
+
const _responseText = response.data;
|
|
2831
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
2832
|
+
}
|
|
2833
|
+
else if (status === 403) {
|
|
2834
|
+
const _responseText = response.data;
|
|
2835
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
2836
|
+
}
|
|
2837
|
+
else if (status !== 200 && status !== 204) {
|
|
2838
|
+
const _responseText = response.data;
|
|
2839
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
2840
|
+
}
|
|
2841
|
+
return Promise.resolve(null);
|
|
2842
|
+
}
|
|
2640
2843
|
/**
|
|
2641
2844
|
* Render product proof image with specified parameters.
|
|
2642
|
-
* @param attachment (optional) If set to 'true', file will be provided as an attachment with unique filename supplied (default value is 'false')
|
|
2845
|
+
* @param attachment (optional) If set to 'true', file will be provided as an attachment with unique filename supplied (default value is 'false').
|
|
2643
2846
|
* @param tenantId (optional) Tenant identifier
|
|
2644
|
-
* @param body (optional) Preview parameters
|
|
2847
|
+
* @param body (optional) Preview parameters.
|
|
2645
2848
|
* @return Success
|
|
2646
2849
|
*/
|
|
2647
2850
|
renderProduct(attachment, tenantId, body, cancelToken) {
|
|
@@ -2661,7 +2864,7 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2661
2864
|
url: url_,
|
|
2662
2865
|
headers: {
|
|
2663
2866
|
"Content-Type": "application/json",
|
|
2664
|
-
"Accept": "application/
|
|
2867
|
+
"Accept": "application/octet-stream"
|
|
2665
2868
|
},
|
|
2666
2869
|
cancelToken
|
|
2667
2870
|
};
|
|
@@ -4195,6 +4398,14 @@ export var ItemSourceType;
|
|
|
4195
4398
|
ItemSourceType["ImageStorage"] = "ImageStorage";
|
|
4196
4399
|
ItemSourceType["PrivateImageStorage"] = "PrivateImageStorage";
|
|
4197
4400
|
})(ItemSourceType || (ItemSourceType = {}));
|
|
4401
|
+
/** Product preview file format. */
|
|
4402
|
+
export var ProductPreviewFormat;
|
|
4403
|
+
(function (ProductPreviewFormat) {
|
|
4404
|
+
ProductPreviewFormat["Jpeg"] = "Jpeg";
|
|
4405
|
+
ProductPreviewFormat["Png"] = "Png";
|
|
4406
|
+
ProductPreviewFormat["Tiff"] = "Tiff";
|
|
4407
|
+
ProductPreviewFormat["Pdf"] = "Pdf";
|
|
4408
|
+
})(ProductPreviewFormat || (ProductPreviewFormat = {}));
|
|
4198
4409
|
export var ProductProofFormat;
|
|
4199
4410
|
(function (ProductProofFormat) {
|
|
4200
4411
|
ProductProofFormat["Jpeg"] = "Jpeg";
|