@aurigma/axios-design-atoms-api-client 2.22.1 → 2.26.7
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 +130 -15
- package/dist/cjs/design-atoms-api-client.js +312 -11
- package/dist/cjs/design-atoms-api-client.js.map +1 -1
- package/dist/esm/design-atoms-api-client.d.ts +130 -15
- package/dist/esm/design-atoms-api-client.js +311 -10
- package/dist/esm/design-atoms-api-client.js.map +1 -1
- package/package.json +1 -1
|
@@ -347,6 +347,15 @@ export interface IDesignAtomsServiceApiClient {
|
|
|
347
347
|
* @return Success
|
|
348
348
|
*/
|
|
349
349
|
createDesign(privateStorage?: boolean | null | undefined, privateStorageOwner?: string | null | undefined, tenantId?: number | undefined, body?: CreateDesignModel | null | undefined): Promise<DesignInfo>;
|
|
350
|
+
/**
|
|
351
|
+
* Returns content of the background.
|
|
352
|
+
* @param id Design identifier.
|
|
353
|
+
* @param surfaceIndex (optional) Surface index.
|
|
354
|
+
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
355
|
+
* @param tenantId (optional) Tenant identifier
|
|
356
|
+
* @return Success
|
|
357
|
+
*/
|
|
358
|
+
extractBackground(id: string | null, surfaceIndex?: number | null | undefined, privateStorageOwner?: string | null | undefined, tenantId?: number | undefined): Promise<FileResponse>;
|
|
350
359
|
/**
|
|
351
360
|
* Loads product (design model) from design file taken from storage
|
|
352
361
|
* @param id Design identifier
|
|
@@ -405,7 +414,7 @@ export interface IDesignAtomsServiceApiClient {
|
|
|
405
414
|
* @param body (optional) Design variable values
|
|
406
415
|
* @return Success
|
|
407
416
|
*/
|
|
408
|
-
setVariables(id: string | null, privateStorage?: boolean | null | undefined, privateStorageOwner?: string | null | undefined, tenantId?: number | undefined, body?: VariablesModel | null | undefined): Promise<
|
|
417
|
+
setVariables(id: string | null, privateStorage?: boolean | null | undefined, privateStorageOwner?: string | null | undefined, tenantId?: number | undefined, body?: VariablesModel | null | undefined): Promise<void>;
|
|
409
418
|
/**
|
|
410
419
|
* Loads variable data printing information from design file taken from storage
|
|
411
420
|
* @param id Design identifier
|
|
@@ -435,9 +444,9 @@ export interface IDesignAtomsServiceApiClient {
|
|
|
435
444
|
*/
|
|
436
445
|
deleteVdpData(id: string | null, privateStorage?: boolean | null | undefined, privateStorageOwner?: string | null | undefined, tenantId?: number | undefined): Promise<void>;
|
|
437
446
|
/**
|
|
438
|
-
* Flatten items
|
|
447
|
+
* Flatten items.
|
|
439
448
|
* @param tenantId (optional) Tenant identifier
|
|
440
|
-
* @param body (optional) Items to flatten
|
|
449
|
+
* @param body (optional) Items to flatten.
|
|
441
450
|
* @return Success
|
|
442
451
|
*/
|
|
443
452
|
flattenItems(tenantId?: number | undefined, body?: any[] | null | undefined): Promise<any>;
|
|
@@ -452,11 +461,37 @@ export interface IDesignAtomsServiceApiClient {
|
|
|
452
461
|
* @return Success
|
|
453
462
|
*/
|
|
454
463
|
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>;
|
|
464
|
+
/**
|
|
465
|
+
* Creates a private design from a public design.
|
|
466
|
+
* @param designId (optional) Public design 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
|
+
createPrivateDesignFromDesign(designId?: string | null | undefined, privateDesignId?: string | null | undefined, privateStorageOwner?: string | null | undefined, tenantId?: number | undefined): Promise<void>;
|
|
473
|
+
/**
|
|
474
|
+
* Creates a private design from a public resource.
|
|
475
|
+
* @param resourceId (optional) Resource ID.
|
|
476
|
+
* @param privateDesignId (optional) Private design ID.
|
|
477
|
+
* @param privateStorageOwner (optional) Private storage owner ID.
|
|
478
|
+
* @param tenantId (optional) Tenant identifier
|
|
479
|
+
* @return Success
|
|
480
|
+
*/
|
|
481
|
+
createPrivateDesignFromResource(resourceId?: string | null | undefined, privateDesignId?: string | null | undefined, privateStorageOwner?: string | null | undefined, tenantId?: number | undefined): Promise<void>;
|
|
482
|
+
/**
|
|
483
|
+
* Renders a design with the specified parameters.
|
|
484
|
+
* @param attachment (optional) If set to 'true', file will be provided as an attachment with unique filename supplied (default value is 'false').
|
|
485
|
+
* @param tenantId (optional) Tenant identifier
|
|
486
|
+
* @param body (optional) Render model with preview parameters.
|
|
487
|
+
* @return Success
|
|
488
|
+
*/
|
|
489
|
+
renderDesign(attachment?: boolean | null | undefined, tenantId?: number | undefined, body?: RenderDesignModel | null | undefined): Promise<FileResponse>;
|
|
455
490
|
/**
|
|
456
491
|
* 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')
|
|
492
|
+
* @param attachment (optional) If set to 'true', file will be provided as an attachment with unique filename supplied (default value is 'false').
|
|
458
493
|
* @param tenantId (optional) Tenant identifier
|
|
459
|
-
* @param body (optional) Preview parameters
|
|
494
|
+
* @param body (optional) Preview parameters.
|
|
460
495
|
* @return Success
|
|
461
496
|
*/
|
|
462
497
|
renderProduct(attachment?: boolean | null | undefined, tenantId?: number | undefined, body?: RenderProductModel | null | undefined): Promise<FileResponse>;
|
|
@@ -484,6 +519,16 @@ export declare class DesignAtomsServiceApiClient extends ApiClientBase implement
|
|
|
484
519
|
*/
|
|
485
520
|
createDesign(privateStorage?: boolean | null | undefined, privateStorageOwner?: string | null | undefined, tenantId?: number | undefined, body?: CreateDesignModel | null | undefined, cancelToken?: CancelToken | undefined): Promise<DesignInfo>;
|
|
486
521
|
protected processCreateDesign(response: AxiosResponse): Promise<DesignInfo>;
|
|
522
|
+
/**
|
|
523
|
+
* Returns content of the background.
|
|
524
|
+
* @param id Design identifier.
|
|
525
|
+
* @param surfaceIndex (optional) Surface index.
|
|
526
|
+
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
527
|
+
* @param tenantId (optional) Tenant identifier
|
|
528
|
+
* @return Success
|
|
529
|
+
*/
|
|
530
|
+
extractBackground(id: string | null, surfaceIndex?: number | null | undefined, privateStorageOwner?: string | null | undefined, tenantId?: number | undefined, cancelToken?: CancelToken | undefined): Promise<FileResponse>;
|
|
531
|
+
protected processExtractBackground(response: AxiosResponse): Promise<FileResponse>;
|
|
487
532
|
/**
|
|
488
533
|
* Loads product (design model) from design file taken from storage
|
|
489
534
|
* @param id Design identifier
|
|
@@ -547,8 +592,8 @@ export declare class DesignAtomsServiceApiClient extends ApiClientBase implement
|
|
|
547
592
|
* @param body (optional) Design variable values
|
|
548
593
|
* @return Success
|
|
549
594
|
*/
|
|
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<
|
|
595
|
+
setVariables(id: string | null, privateStorage?: boolean | null | undefined, privateStorageOwner?: string | null | undefined, tenantId?: number | undefined, body?: VariablesModel | null | undefined, cancelToken?: CancelToken | undefined): Promise<void>;
|
|
596
|
+
protected processSetVariables(response: AxiosResponse): Promise<void>;
|
|
552
597
|
/**
|
|
553
598
|
* Loads variable data printing information from design file taken from storage
|
|
554
599
|
* @param id Design identifier
|
|
@@ -581,9 +626,9 @@ export declare class DesignAtomsServiceApiClient extends ApiClientBase implement
|
|
|
581
626
|
deleteVdpData(id: string | null, privateStorage?: boolean | null | undefined, privateStorageOwner?: string | null | undefined, tenantId?: number | undefined, cancelToken?: CancelToken | undefined): Promise<void>;
|
|
582
627
|
protected processDeleteVdpData(response: AxiosResponse): Promise<void>;
|
|
583
628
|
/**
|
|
584
|
-
* Flatten items
|
|
629
|
+
* Flatten items.
|
|
585
630
|
* @param tenantId (optional) Tenant identifier
|
|
586
|
-
* @param body (optional) Items to flatten
|
|
631
|
+
* @param body (optional) Items to flatten.
|
|
587
632
|
* @return Success
|
|
588
633
|
*/
|
|
589
634
|
flattenItems(tenantId?: number | undefined, body?: any[] | null | undefined, cancelToken?: CancelToken | undefined): Promise<any>;
|
|
@@ -600,11 +645,40 @@ export declare class DesignAtomsServiceApiClient extends ApiClientBase implement
|
|
|
600
645
|
*/
|
|
601
646
|
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
647
|
protected processCreateItem(response: AxiosResponse): Promise<any>;
|
|
648
|
+
/**
|
|
649
|
+
* Creates a private design from a public design.
|
|
650
|
+
* @param designId (optional) Public design ID.
|
|
651
|
+
* @param privateDesignId (optional) Private design ID.
|
|
652
|
+
* @param privateStorageOwner (optional) Private storage owner ID.
|
|
653
|
+
* @param tenantId (optional) Tenant identifier
|
|
654
|
+
* @return Success
|
|
655
|
+
*/
|
|
656
|
+
createPrivateDesignFromDesign(designId?: string | null | undefined, privateDesignId?: string | null | undefined, privateStorageOwner?: string | null | undefined, tenantId?: number | undefined, cancelToken?: CancelToken | undefined): Promise<void>;
|
|
657
|
+
protected processCreatePrivateDesignFromDesign(response: AxiosResponse): Promise<void>;
|
|
658
|
+
/**
|
|
659
|
+
* Creates a private design from a public resource.
|
|
660
|
+
* @param resourceId (optional) Resource ID.
|
|
661
|
+
* @param privateDesignId (optional) Private design ID.
|
|
662
|
+
* @param privateStorageOwner (optional) Private storage owner ID.
|
|
663
|
+
* @param tenantId (optional) Tenant identifier
|
|
664
|
+
* @return Success
|
|
665
|
+
*/
|
|
666
|
+
createPrivateDesignFromResource(resourceId?: string | null | undefined, privateDesignId?: string | null | undefined, privateStorageOwner?: string | null | undefined, tenantId?: number | undefined, cancelToken?: CancelToken | undefined): Promise<void>;
|
|
667
|
+
protected processCreatePrivateDesignFromResource(response: AxiosResponse): Promise<void>;
|
|
668
|
+
/**
|
|
669
|
+
* Renders a design with the specified parameters.
|
|
670
|
+
* @param attachment (optional) If set to 'true', file will be provided as an attachment with unique filename supplied (default value is 'false').
|
|
671
|
+
* @param tenantId (optional) Tenant identifier
|
|
672
|
+
* @param body (optional) Render model with preview parameters.
|
|
673
|
+
* @return Success
|
|
674
|
+
*/
|
|
675
|
+
renderDesign(attachment?: boolean | null | undefined, tenantId?: number | undefined, body?: RenderDesignModel | null | undefined, cancelToken?: CancelToken | undefined): Promise<FileResponse>;
|
|
676
|
+
protected processRenderDesign(response: AxiosResponse): Promise<FileResponse>;
|
|
603
677
|
/**
|
|
604
678
|
* 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')
|
|
679
|
+
* @param attachment (optional) If set to 'true', file will be provided as an attachment with unique filename supplied (default value is 'false').
|
|
606
680
|
* @param tenantId (optional) Tenant identifier
|
|
607
|
-
* @param body (optional) Preview parameters
|
|
681
|
+
* @param body (optional) Preview parameters.
|
|
608
682
|
* @return Success
|
|
609
683
|
*/
|
|
610
684
|
renderProduct(attachment?: boolean | null | undefined, tenantId?: number | undefined, body?: RenderProductModel | null | undefined, cancelToken?: CancelToken | undefined): Promise<FileResponse>;
|
|
@@ -1055,18 +1129,32 @@ export interface DesignInfo {
|
|
|
1055
1129
|
name?: string | null;
|
|
1056
1130
|
private?: boolean;
|
|
1057
1131
|
}
|
|
1132
|
+
export declare enum DesignElementType {
|
|
1133
|
+
Product = "Product",
|
|
1134
|
+
Design = "Design",
|
|
1135
|
+
Surface = "Surface",
|
|
1136
|
+
Container = "Container",
|
|
1137
|
+
PrintArea = "PrintArea",
|
|
1138
|
+
Item = "Item"
|
|
1139
|
+
}
|
|
1140
|
+
export interface MissingDesignElementDto {
|
|
1141
|
+
/** Problem description. */
|
|
1142
|
+
description?: string | null;
|
|
1143
|
+
/** Missing element type. */
|
|
1144
|
+
readonly missingElementType?: DesignElementType;
|
|
1145
|
+
}
|
|
1058
1146
|
/** Available patch type */
|
|
1059
1147
|
export declare enum ProductPatchType {
|
|
1060
1148
|
Undefined = "Undefined",
|
|
1061
1149
|
ReplaceImageItemFile = "ReplaceImageItemFile"
|
|
1062
1150
|
}
|
|
1063
|
-
/** Variable information */
|
|
1151
|
+
/** Variable information. */
|
|
1064
1152
|
export interface VariableInfo {
|
|
1065
|
-
/** Variable name */
|
|
1153
|
+
/** Variable name. */
|
|
1066
1154
|
name?: string | null;
|
|
1067
|
-
/** Variable value */
|
|
1155
|
+
/** Variable value. */
|
|
1068
1156
|
value?: string | null;
|
|
1069
|
-
/** Variable type */
|
|
1157
|
+
/** Variable type. */
|
|
1070
1158
|
type?: string | null;
|
|
1071
1159
|
}
|
|
1072
1160
|
/** Variables information */
|
|
@@ -1093,6 +1181,33 @@ export declare enum ItemSourceType {
|
|
|
1093
1181
|
ImageStorage = "ImageStorage",
|
|
1094
1182
|
PrivateImageStorage = "PrivateImageStorage"
|
|
1095
1183
|
}
|
|
1184
|
+
/** Product preview file format. */
|
|
1185
|
+
export declare enum ProductPreviewFormat {
|
|
1186
|
+
Jpeg = "Jpeg",
|
|
1187
|
+
Png = "Png",
|
|
1188
|
+
Tiff = "Tiff",
|
|
1189
|
+
Pdf = "Pdf"
|
|
1190
|
+
}
|
|
1191
|
+
export interface ProductPreviewRenderingConfig {
|
|
1192
|
+
surfaceIndex?: number | null;
|
|
1193
|
+
width?: number;
|
|
1194
|
+
height?: number;
|
|
1195
|
+
fileFormat?: ProductPreviewFormat | null;
|
|
1196
|
+
}
|
|
1197
|
+
export interface RenderDesignModel {
|
|
1198
|
+
/** Design ID.
|
|
1199
|
+
Used to get design file from public or private storage. */
|
|
1200
|
+
designId?: string | null;
|
|
1201
|
+
/** Mockup ID.
|
|
1202
|
+
Used to get mockup file from public storage. */
|
|
1203
|
+
mockupId?: string | null;
|
|
1204
|
+
/** ID of the design owner. */
|
|
1205
|
+
ownerId?: string | null;
|
|
1206
|
+
/** Rendering configuration for getting a preview of design. */
|
|
1207
|
+
renderingConfig?: ProductPreviewRenderingConfig | null;
|
|
1208
|
+
/** Variable (user) data of design. */
|
|
1209
|
+
variableData?: VariableInfo[] | null;
|
|
1210
|
+
}
|
|
1096
1211
|
export declare enum ProductProofFormat {
|
|
1097
1212
|
Jpeg = "Jpeg",
|
|
1098
1213
|
Png = "Png",
|
|
@@ -1724,6 +1724,87 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
1724
1724
|
}
|
|
1725
1725
|
return Promise.resolve(null);
|
|
1726
1726
|
}
|
|
1727
|
+
/**
|
|
1728
|
+
* Returns content of the background.
|
|
1729
|
+
* @param id Design identifier.
|
|
1730
|
+
* @param surfaceIndex (optional) Surface index.
|
|
1731
|
+
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
1732
|
+
* @param tenantId (optional) Tenant identifier
|
|
1733
|
+
* @return Success
|
|
1734
|
+
*/
|
|
1735
|
+
extractBackground(id, surfaceIndex, privateStorageOwner, tenantId, cancelToken) {
|
|
1736
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/background?";
|
|
1737
|
+
if (id === undefined || id === null)
|
|
1738
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
1739
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
1740
|
+
if (surfaceIndex !== undefined && surfaceIndex !== null)
|
|
1741
|
+
url_ += "surfaceIndex=" + encodeURIComponent("" + surfaceIndex) + "&";
|
|
1742
|
+
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
1743
|
+
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
1744
|
+
if (tenantId === null)
|
|
1745
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
1746
|
+
else if (tenantId !== undefined)
|
|
1747
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
1748
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
1749
|
+
let options_ = {
|
|
1750
|
+
responseType: "blob",
|
|
1751
|
+
method: "GET",
|
|
1752
|
+
url: url_,
|
|
1753
|
+
headers: {
|
|
1754
|
+
"Accept": "application/octet-stream"
|
|
1755
|
+
},
|
|
1756
|
+
cancelToken
|
|
1757
|
+
};
|
|
1758
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
1759
|
+
return this.instance.request(transformedOptions_);
|
|
1760
|
+
}).catch((_error) => {
|
|
1761
|
+
if (isAxiosError(_error) && _error.response) {
|
|
1762
|
+
return _error.response;
|
|
1763
|
+
}
|
|
1764
|
+
else {
|
|
1765
|
+
throw _error;
|
|
1766
|
+
}
|
|
1767
|
+
}).then((_response) => {
|
|
1768
|
+
return this.transformResult(url_, _response, (_response) => this.processExtractBackground(_response));
|
|
1769
|
+
});
|
|
1770
|
+
}
|
|
1771
|
+
processExtractBackground(response) {
|
|
1772
|
+
const status = response.status;
|
|
1773
|
+
let _headers = {};
|
|
1774
|
+
if (response.headers && typeof response.headers === "object") {
|
|
1775
|
+
for (let k in response.headers) {
|
|
1776
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
1777
|
+
_headers[k] = response.headers[k];
|
|
1778
|
+
}
|
|
1779
|
+
}
|
|
1780
|
+
}
|
|
1781
|
+
if (status === 200 || status === 206) {
|
|
1782
|
+
const contentDisposition = response.headers ? response.headers["content-disposition"] : undefined;
|
|
1783
|
+
const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
|
|
1784
|
+
const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
|
|
1785
|
+
return Promise.resolve({ fileName: fileName, status: status, data: new Blob([response.data]), headers: _headers });
|
|
1786
|
+
}
|
|
1787
|
+
else if (status === 404) {
|
|
1788
|
+
const _responseText = response.data;
|
|
1789
|
+
let result404 = null;
|
|
1790
|
+
let resultData404 = _responseText;
|
|
1791
|
+
result404 = JSON.parse(resultData404);
|
|
1792
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
1793
|
+
}
|
|
1794
|
+
else if (status === 401) {
|
|
1795
|
+
const _responseText = response.data;
|
|
1796
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
1797
|
+
}
|
|
1798
|
+
else if (status === 403) {
|
|
1799
|
+
const _responseText = response.data;
|
|
1800
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
1801
|
+
}
|
|
1802
|
+
else if (status !== 200 && status !== 204) {
|
|
1803
|
+
const _responseText = response.data;
|
|
1804
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
1805
|
+
}
|
|
1806
|
+
return Promise.resolve(null);
|
|
1807
|
+
}
|
|
1727
1808
|
/**
|
|
1728
1809
|
* Loads product (design model) from design file taken from storage
|
|
1729
1810
|
* @param id Design identifier
|
|
@@ -2174,7 +2255,6 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2174
2255
|
url: url_,
|
|
2175
2256
|
headers: {
|
|
2176
2257
|
"Content-Type": "application/json",
|
|
2177
|
-
"Accept": "application/json"
|
|
2178
2258
|
},
|
|
2179
2259
|
cancelToken
|
|
2180
2260
|
};
|
|
@@ -2203,10 +2283,7 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2203
2283
|
}
|
|
2204
2284
|
if (status === 200) {
|
|
2205
2285
|
const _responseText = response.data;
|
|
2206
|
-
|
|
2207
|
-
let resultData200 = _responseText;
|
|
2208
|
-
result200 = JSON.parse(resultData200);
|
|
2209
|
-
return Promise.resolve(result200);
|
|
2286
|
+
return Promise.resolve(null);
|
|
2210
2287
|
}
|
|
2211
2288
|
else if (status === 404) {
|
|
2212
2289
|
const _responseText = response.data;
|
|
@@ -2482,9 +2559,9 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2482
2559
|
return Promise.resolve(null);
|
|
2483
2560
|
}
|
|
2484
2561
|
/**
|
|
2485
|
-
* Flatten items
|
|
2562
|
+
* Flatten items.
|
|
2486
2563
|
* @param tenantId (optional) Tenant identifier
|
|
2487
|
-
* @param body (optional) Items to flatten
|
|
2564
|
+
* @param body (optional) Items to flatten.
|
|
2488
2565
|
* @return Success
|
|
2489
2566
|
*/
|
|
2490
2567
|
flattenItems(tenantId, body, cancelToken) {
|
|
@@ -2637,11 +2714,218 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2637
2714
|
}
|
|
2638
2715
|
return Promise.resolve(null);
|
|
2639
2716
|
}
|
|
2717
|
+
/**
|
|
2718
|
+
* Creates a private design from a public design.
|
|
2719
|
+
* @param designId (optional) Public design ID.
|
|
2720
|
+
* @param privateDesignId (optional) Private design ID.
|
|
2721
|
+
* @param privateStorageOwner (optional) Private storage owner ID.
|
|
2722
|
+
* @param tenantId (optional) Tenant identifier
|
|
2723
|
+
* @return Success
|
|
2724
|
+
*/
|
|
2725
|
+
createPrivateDesignFromDesign(designId, privateDesignId, privateStorageOwner, tenantId, cancelToken) {
|
|
2726
|
+
let url_ = this.baseUrl + "/api/atoms/v1/private-designs/from-design?";
|
|
2727
|
+
if (designId !== undefined && designId !== null)
|
|
2728
|
+
url_ += "designId=" + encodeURIComponent("" + designId) + "&";
|
|
2729
|
+
if (privateDesignId !== undefined && privateDesignId !== null)
|
|
2730
|
+
url_ += "privateDesignId=" + encodeURIComponent("" + privateDesignId) + "&";
|
|
2731
|
+
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
2732
|
+
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
2733
|
+
if (tenantId === null)
|
|
2734
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
2735
|
+
else if (tenantId !== undefined)
|
|
2736
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2737
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
2738
|
+
let options_ = {
|
|
2739
|
+
method: "POST",
|
|
2740
|
+
url: url_,
|
|
2741
|
+
headers: {},
|
|
2742
|
+
cancelToken
|
|
2743
|
+
};
|
|
2744
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
2745
|
+
return this.instance.request(transformedOptions_);
|
|
2746
|
+
}).catch((_error) => {
|
|
2747
|
+
if (isAxiosError(_error) && _error.response) {
|
|
2748
|
+
return _error.response;
|
|
2749
|
+
}
|
|
2750
|
+
else {
|
|
2751
|
+
throw _error;
|
|
2752
|
+
}
|
|
2753
|
+
}).then((_response) => {
|
|
2754
|
+
return this.transformResult(url_, _response, (_response) => this.processCreatePrivateDesignFromDesign(_response));
|
|
2755
|
+
});
|
|
2756
|
+
}
|
|
2757
|
+
processCreatePrivateDesignFromDesign(response) {
|
|
2758
|
+
const status = response.status;
|
|
2759
|
+
let _headers = {};
|
|
2760
|
+
if (response.headers && typeof response.headers === "object") {
|
|
2761
|
+
for (let k in response.headers) {
|
|
2762
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
2763
|
+
_headers[k] = response.headers[k];
|
|
2764
|
+
}
|
|
2765
|
+
}
|
|
2766
|
+
}
|
|
2767
|
+
if (status === 201) {
|
|
2768
|
+
const _responseText = response.data;
|
|
2769
|
+
return Promise.resolve(null);
|
|
2770
|
+
}
|
|
2771
|
+
else if (status === 401) {
|
|
2772
|
+
const _responseText = response.data;
|
|
2773
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
2774
|
+
}
|
|
2775
|
+
else if (status === 403) {
|
|
2776
|
+
const _responseText = response.data;
|
|
2777
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
2778
|
+
}
|
|
2779
|
+
else if (status !== 200 && status !== 204) {
|
|
2780
|
+
const _responseText = response.data;
|
|
2781
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
2782
|
+
}
|
|
2783
|
+
return Promise.resolve(null);
|
|
2784
|
+
}
|
|
2785
|
+
/**
|
|
2786
|
+
* Creates a private design from a public resource.
|
|
2787
|
+
* @param resourceId (optional) Resource ID.
|
|
2788
|
+
* @param privateDesignId (optional) Private design ID.
|
|
2789
|
+
* @param privateStorageOwner (optional) Private storage owner ID.
|
|
2790
|
+
* @param tenantId (optional) Tenant identifier
|
|
2791
|
+
* @return Success
|
|
2792
|
+
*/
|
|
2793
|
+
createPrivateDesignFromResource(resourceId, privateDesignId, privateStorageOwner, tenantId, cancelToken) {
|
|
2794
|
+
let url_ = this.baseUrl + "/api/atoms/v1/private-designs/from-resource?";
|
|
2795
|
+
if (resourceId !== undefined && resourceId !== null)
|
|
2796
|
+
url_ += "resourceId=" + encodeURIComponent("" + resourceId) + "&";
|
|
2797
|
+
if (privateDesignId !== undefined && privateDesignId !== null)
|
|
2798
|
+
url_ += "privateDesignId=" + encodeURIComponent("" + privateDesignId) + "&";
|
|
2799
|
+
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
2800
|
+
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
2801
|
+
if (tenantId === null)
|
|
2802
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
2803
|
+
else if (tenantId !== undefined)
|
|
2804
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2805
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
2806
|
+
let options_ = {
|
|
2807
|
+
method: "POST",
|
|
2808
|
+
url: url_,
|
|
2809
|
+
headers: {},
|
|
2810
|
+
cancelToken
|
|
2811
|
+
};
|
|
2812
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
2813
|
+
return this.instance.request(transformedOptions_);
|
|
2814
|
+
}).catch((_error) => {
|
|
2815
|
+
if (isAxiosError(_error) && _error.response) {
|
|
2816
|
+
return _error.response;
|
|
2817
|
+
}
|
|
2818
|
+
else {
|
|
2819
|
+
throw _error;
|
|
2820
|
+
}
|
|
2821
|
+
}).then((_response) => {
|
|
2822
|
+
return this.transformResult(url_, _response, (_response) => this.processCreatePrivateDesignFromResource(_response));
|
|
2823
|
+
});
|
|
2824
|
+
}
|
|
2825
|
+
processCreatePrivateDesignFromResource(response) {
|
|
2826
|
+
const status = response.status;
|
|
2827
|
+
let _headers = {};
|
|
2828
|
+
if (response.headers && typeof response.headers === "object") {
|
|
2829
|
+
for (let k in response.headers) {
|
|
2830
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
2831
|
+
_headers[k] = response.headers[k];
|
|
2832
|
+
}
|
|
2833
|
+
}
|
|
2834
|
+
}
|
|
2835
|
+
if (status === 201) {
|
|
2836
|
+
const _responseText = response.data;
|
|
2837
|
+
return Promise.resolve(null);
|
|
2838
|
+
}
|
|
2839
|
+
else if (status === 401) {
|
|
2840
|
+
const _responseText = response.data;
|
|
2841
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
2842
|
+
}
|
|
2843
|
+
else if (status === 403) {
|
|
2844
|
+
const _responseText = response.data;
|
|
2845
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
2846
|
+
}
|
|
2847
|
+
else if (status !== 200 && status !== 204) {
|
|
2848
|
+
const _responseText = response.data;
|
|
2849
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
2850
|
+
}
|
|
2851
|
+
return Promise.resolve(null);
|
|
2852
|
+
}
|
|
2853
|
+
/**
|
|
2854
|
+
* Renders a design with the specified parameters.
|
|
2855
|
+
* @param attachment (optional) If set to 'true', file will be provided as an attachment with unique filename supplied (default value is 'false').
|
|
2856
|
+
* @param tenantId (optional) Tenant identifier
|
|
2857
|
+
* @param body (optional) Render model with preview parameters.
|
|
2858
|
+
* @return Success
|
|
2859
|
+
*/
|
|
2860
|
+
renderDesign(attachment, tenantId, body, cancelToken) {
|
|
2861
|
+
let url_ = this.baseUrl + "/api/atoms/v1/render-design-preview?";
|
|
2862
|
+
if (attachment !== undefined && attachment !== null)
|
|
2863
|
+
url_ += "attachment=" + encodeURIComponent("" + attachment) + "&";
|
|
2864
|
+
if (tenantId === null)
|
|
2865
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
2866
|
+
else if (tenantId !== undefined)
|
|
2867
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2868
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
2869
|
+
const content_ = JSON.stringify(body);
|
|
2870
|
+
let options_ = {
|
|
2871
|
+
data: content_,
|
|
2872
|
+
responseType: "blob",
|
|
2873
|
+
method: "POST",
|
|
2874
|
+
url: url_,
|
|
2875
|
+
headers: {
|
|
2876
|
+
"Content-Type": "application/json",
|
|
2877
|
+
"Accept": "application/octet-stream"
|
|
2878
|
+
},
|
|
2879
|
+
cancelToken
|
|
2880
|
+
};
|
|
2881
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
2882
|
+
return this.instance.request(transformedOptions_);
|
|
2883
|
+
}).catch((_error) => {
|
|
2884
|
+
if (isAxiosError(_error) && _error.response) {
|
|
2885
|
+
return _error.response;
|
|
2886
|
+
}
|
|
2887
|
+
else {
|
|
2888
|
+
throw _error;
|
|
2889
|
+
}
|
|
2890
|
+
}).then((_response) => {
|
|
2891
|
+
return this.transformResult(url_, _response, (_response) => this.processRenderDesign(_response));
|
|
2892
|
+
});
|
|
2893
|
+
}
|
|
2894
|
+
processRenderDesign(response) {
|
|
2895
|
+
const status = response.status;
|
|
2896
|
+
let _headers = {};
|
|
2897
|
+
if (response.headers && typeof response.headers === "object") {
|
|
2898
|
+
for (let k in response.headers) {
|
|
2899
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
2900
|
+
_headers[k] = response.headers[k];
|
|
2901
|
+
}
|
|
2902
|
+
}
|
|
2903
|
+
}
|
|
2904
|
+
if (status === 200 || status === 206) {
|
|
2905
|
+
const contentDisposition = response.headers ? response.headers["content-disposition"] : undefined;
|
|
2906
|
+
const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
|
|
2907
|
+
const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
|
|
2908
|
+
return Promise.resolve({ fileName: fileName, status: status, data: new Blob([response.data]), headers: _headers });
|
|
2909
|
+
}
|
|
2910
|
+
else if (status === 401) {
|
|
2911
|
+
const _responseText = response.data;
|
|
2912
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
2913
|
+
}
|
|
2914
|
+
else if (status === 403) {
|
|
2915
|
+
const _responseText = response.data;
|
|
2916
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
2917
|
+
}
|
|
2918
|
+
else if (status !== 200 && status !== 204) {
|
|
2919
|
+
const _responseText = response.data;
|
|
2920
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
2921
|
+
}
|
|
2922
|
+
return Promise.resolve(null);
|
|
2923
|
+
}
|
|
2640
2924
|
/**
|
|
2641
2925
|
* 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')
|
|
2926
|
+
* @param attachment (optional) If set to 'true', file will be provided as an attachment with unique filename supplied (default value is 'false').
|
|
2643
2927
|
* @param tenantId (optional) Tenant identifier
|
|
2644
|
-
* @param body (optional) Preview parameters
|
|
2928
|
+
* @param body (optional) Preview parameters.
|
|
2645
2929
|
* @return Success
|
|
2646
2930
|
*/
|
|
2647
2931
|
renderProduct(attachment, tenantId, body, cancelToken) {
|
|
@@ -2661,7 +2945,7 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2661
2945
|
url: url_,
|
|
2662
2946
|
headers: {
|
|
2663
2947
|
"Content-Type": "application/json",
|
|
2664
|
-
"Accept": "application/
|
|
2948
|
+
"Accept": "application/octet-stream"
|
|
2665
2949
|
},
|
|
2666
2950
|
cancelToken
|
|
2667
2951
|
};
|
|
@@ -4175,6 +4459,15 @@ export class DesignAtomsViewerApiClient extends ApiClientBase {
|
|
|
4175
4459
|
return Promise.resolve(null);
|
|
4176
4460
|
}
|
|
4177
4461
|
}
|
|
4462
|
+
export var DesignElementType;
|
|
4463
|
+
(function (DesignElementType) {
|
|
4464
|
+
DesignElementType["Product"] = "Product";
|
|
4465
|
+
DesignElementType["Design"] = "Design";
|
|
4466
|
+
DesignElementType["Surface"] = "Surface";
|
|
4467
|
+
DesignElementType["Container"] = "Container";
|
|
4468
|
+
DesignElementType["PrintArea"] = "PrintArea";
|
|
4469
|
+
DesignElementType["Item"] = "Item";
|
|
4470
|
+
})(DesignElementType || (DesignElementType = {}));
|
|
4178
4471
|
/** Available patch type */
|
|
4179
4472
|
export var ProductPatchType;
|
|
4180
4473
|
(function (ProductPatchType) {
|
|
@@ -4195,6 +4488,14 @@ export var ItemSourceType;
|
|
|
4195
4488
|
ItemSourceType["ImageStorage"] = "ImageStorage";
|
|
4196
4489
|
ItemSourceType["PrivateImageStorage"] = "PrivateImageStorage";
|
|
4197
4490
|
})(ItemSourceType || (ItemSourceType = {}));
|
|
4491
|
+
/** Product preview file format. */
|
|
4492
|
+
export var ProductPreviewFormat;
|
|
4493
|
+
(function (ProductPreviewFormat) {
|
|
4494
|
+
ProductPreviewFormat["Jpeg"] = "Jpeg";
|
|
4495
|
+
ProductPreviewFormat["Png"] = "Png";
|
|
4496
|
+
ProductPreviewFormat["Tiff"] = "Tiff";
|
|
4497
|
+
ProductPreviewFormat["Pdf"] = "Pdf";
|
|
4498
|
+
})(ProductPreviewFormat || (ProductPreviewFormat = {}));
|
|
4198
4499
|
export var ProductProofFormat;
|
|
4199
4500
|
(function (ProductProofFormat) {
|
|
4200
4501
|
ProductProofFormat["Jpeg"] = "Jpeg";
|