@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",
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
//----------------------
|
|
9
9
|
// ReSharper disable InconsistentNaming
|
|
10
10
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
-
exports.ApiException = exports.ProductProofInterpolationMode = exports.ProductProofFormat = exports.ItemSourceType = exports.ItemType = exports.ProductPatchType = exports.DesignAtomsViewerApiClient = exports.DesignAtomsServiceApiClient = exports.DesignAtomsCompatibilityApiClient = exports.BuildInfoApiClient = exports.ApiClientBase = exports.ApiClientConfiguration = void 0;
|
|
11
|
+
exports.ApiException = exports.ProductProofInterpolationMode = exports.ProductProofFormat = exports.ProductPreviewFormat = exports.ItemSourceType = exports.ItemType = exports.ProductPatchType = exports.DesignElementType = exports.DesignAtomsViewerApiClient = exports.DesignAtomsServiceApiClient = exports.DesignAtomsCompatibilityApiClient = exports.BuildInfoApiClient = exports.ApiClientBase = exports.ApiClientConfiguration = void 0;
|
|
12
12
|
const axios_1 = require("axios");
|
|
13
13
|
class ApiClientConfiguration {
|
|
14
14
|
apiUrl;
|
|
@@ -1731,6 +1731,87 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
1731
1731
|
}
|
|
1732
1732
|
return Promise.resolve(null);
|
|
1733
1733
|
}
|
|
1734
|
+
/**
|
|
1735
|
+
* Returns content of the background.
|
|
1736
|
+
* @param id Design identifier.
|
|
1737
|
+
* @param surfaceIndex (optional) Surface index.
|
|
1738
|
+
* @param privateStorageOwner (optional) Private storage owner identifier.
|
|
1739
|
+
* @param tenantId (optional) Tenant identifier
|
|
1740
|
+
* @return Success
|
|
1741
|
+
*/
|
|
1742
|
+
extractBackground(id, surfaceIndex, privateStorageOwner, tenantId, cancelToken) {
|
|
1743
|
+
let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/background?";
|
|
1744
|
+
if (id === undefined || id === null)
|
|
1745
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
1746
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
1747
|
+
if (surfaceIndex !== undefined && surfaceIndex !== null)
|
|
1748
|
+
url_ += "surfaceIndex=" + encodeURIComponent("" + surfaceIndex) + "&";
|
|
1749
|
+
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
1750
|
+
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
1751
|
+
if (tenantId === null)
|
|
1752
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
1753
|
+
else if (tenantId !== undefined)
|
|
1754
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
1755
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
1756
|
+
let options_ = {
|
|
1757
|
+
responseType: "blob",
|
|
1758
|
+
method: "GET",
|
|
1759
|
+
url: url_,
|
|
1760
|
+
headers: {
|
|
1761
|
+
"Accept": "application/octet-stream"
|
|
1762
|
+
},
|
|
1763
|
+
cancelToken
|
|
1764
|
+
};
|
|
1765
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
1766
|
+
return this.instance.request(transformedOptions_);
|
|
1767
|
+
}).catch((_error) => {
|
|
1768
|
+
if (isAxiosError(_error) && _error.response) {
|
|
1769
|
+
return _error.response;
|
|
1770
|
+
}
|
|
1771
|
+
else {
|
|
1772
|
+
throw _error;
|
|
1773
|
+
}
|
|
1774
|
+
}).then((_response) => {
|
|
1775
|
+
return this.transformResult(url_, _response, (_response) => this.processExtractBackground(_response));
|
|
1776
|
+
});
|
|
1777
|
+
}
|
|
1778
|
+
processExtractBackground(response) {
|
|
1779
|
+
const status = response.status;
|
|
1780
|
+
let _headers = {};
|
|
1781
|
+
if (response.headers && typeof response.headers === "object") {
|
|
1782
|
+
for (let k in response.headers) {
|
|
1783
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
1784
|
+
_headers[k] = response.headers[k];
|
|
1785
|
+
}
|
|
1786
|
+
}
|
|
1787
|
+
}
|
|
1788
|
+
if (status === 200 || status === 206) {
|
|
1789
|
+
const contentDisposition = response.headers ? response.headers["content-disposition"] : undefined;
|
|
1790
|
+
const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
|
|
1791
|
+
const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
|
|
1792
|
+
return Promise.resolve({ fileName: fileName, status: status, data: new Blob([response.data]), headers: _headers });
|
|
1793
|
+
}
|
|
1794
|
+
else if (status === 404) {
|
|
1795
|
+
const _responseText = response.data;
|
|
1796
|
+
let result404 = null;
|
|
1797
|
+
let resultData404 = _responseText;
|
|
1798
|
+
result404 = JSON.parse(resultData404);
|
|
1799
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
1800
|
+
}
|
|
1801
|
+
else if (status === 401) {
|
|
1802
|
+
const _responseText = response.data;
|
|
1803
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
1804
|
+
}
|
|
1805
|
+
else if (status === 403) {
|
|
1806
|
+
const _responseText = response.data;
|
|
1807
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
1808
|
+
}
|
|
1809
|
+
else if (status !== 200 && status !== 204) {
|
|
1810
|
+
const _responseText = response.data;
|
|
1811
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
1812
|
+
}
|
|
1813
|
+
return Promise.resolve(null);
|
|
1814
|
+
}
|
|
1734
1815
|
/**
|
|
1735
1816
|
* Loads product (design model) from design file taken from storage
|
|
1736
1817
|
* @param id Design identifier
|
|
@@ -2181,7 +2262,6 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2181
2262
|
url: url_,
|
|
2182
2263
|
headers: {
|
|
2183
2264
|
"Content-Type": "application/json",
|
|
2184
|
-
"Accept": "application/json"
|
|
2185
2265
|
},
|
|
2186
2266
|
cancelToken
|
|
2187
2267
|
};
|
|
@@ -2210,10 +2290,7 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2210
2290
|
}
|
|
2211
2291
|
if (status === 200) {
|
|
2212
2292
|
const _responseText = response.data;
|
|
2213
|
-
|
|
2214
|
-
let resultData200 = _responseText;
|
|
2215
|
-
result200 = JSON.parse(resultData200);
|
|
2216
|
-
return Promise.resolve(result200);
|
|
2293
|
+
return Promise.resolve(null);
|
|
2217
2294
|
}
|
|
2218
2295
|
else if (status === 404) {
|
|
2219
2296
|
const _responseText = response.data;
|
|
@@ -2489,9 +2566,9 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2489
2566
|
return Promise.resolve(null);
|
|
2490
2567
|
}
|
|
2491
2568
|
/**
|
|
2492
|
-
* Flatten items
|
|
2569
|
+
* Flatten items.
|
|
2493
2570
|
* @param tenantId (optional) Tenant identifier
|
|
2494
|
-
* @param body (optional) Items to flatten
|
|
2571
|
+
* @param body (optional) Items to flatten.
|
|
2495
2572
|
* @return Success
|
|
2496
2573
|
*/
|
|
2497
2574
|
flattenItems(tenantId, body, cancelToken) {
|
|
@@ -2644,11 +2721,218 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2644
2721
|
}
|
|
2645
2722
|
return Promise.resolve(null);
|
|
2646
2723
|
}
|
|
2724
|
+
/**
|
|
2725
|
+
* Creates a private design from a public design.
|
|
2726
|
+
* @param designId (optional) Public design ID.
|
|
2727
|
+
* @param privateDesignId (optional) Private design ID.
|
|
2728
|
+
* @param privateStorageOwner (optional) Private storage owner ID.
|
|
2729
|
+
* @param tenantId (optional) Tenant identifier
|
|
2730
|
+
* @return Success
|
|
2731
|
+
*/
|
|
2732
|
+
createPrivateDesignFromDesign(designId, privateDesignId, privateStorageOwner, tenantId, cancelToken) {
|
|
2733
|
+
let url_ = this.baseUrl + "/api/atoms/v1/private-designs/from-design?";
|
|
2734
|
+
if (designId !== undefined && designId !== null)
|
|
2735
|
+
url_ += "designId=" + encodeURIComponent("" + designId) + "&";
|
|
2736
|
+
if (privateDesignId !== undefined && privateDesignId !== null)
|
|
2737
|
+
url_ += "privateDesignId=" + encodeURIComponent("" + privateDesignId) + "&";
|
|
2738
|
+
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
2739
|
+
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
2740
|
+
if (tenantId === null)
|
|
2741
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
2742
|
+
else if (tenantId !== undefined)
|
|
2743
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2744
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
2745
|
+
let options_ = {
|
|
2746
|
+
method: "POST",
|
|
2747
|
+
url: url_,
|
|
2748
|
+
headers: {},
|
|
2749
|
+
cancelToken
|
|
2750
|
+
};
|
|
2751
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
2752
|
+
return this.instance.request(transformedOptions_);
|
|
2753
|
+
}).catch((_error) => {
|
|
2754
|
+
if (isAxiosError(_error) && _error.response) {
|
|
2755
|
+
return _error.response;
|
|
2756
|
+
}
|
|
2757
|
+
else {
|
|
2758
|
+
throw _error;
|
|
2759
|
+
}
|
|
2760
|
+
}).then((_response) => {
|
|
2761
|
+
return this.transformResult(url_, _response, (_response) => this.processCreatePrivateDesignFromDesign(_response));
|
|
2762
|
+
});
|
|
2763
|
+
}
|
|
2764
|
+
processCreatePrivateDesignFromDesign(response) {
|
|
2765
|
+
const status = response.status;
|
|
2766
|
+
let _headers = {};
|
|
2767
|
+
if (response.headers && typeof response.headers === "object") {
|
|
2768
|
+
for (let k in response.headers) {
|
|
2769
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
2770
|
+
_headers[k] = response.headers[k];
|
|
2771
|
+
}
|
|
2772
|
+
}
|
|
2773
|
+
}
|
|
2774
|
+
if (status === 201) {
|
|
2775
|
+
const _responseText = response.data;
|
|
2776
|
+
return Promise.resolve(null);
|
|
2777
|
+
}
|
|
2778
|
+
else if (status === 401) {
|
|
2779
|
+
const _responseText = response.data;
|
|
2780
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
2781
|
+
}
|
|
2782
|
+
else if (status === 403) {
|
|
2783
|
+
const _responseText = response.data;
|
|
2784
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
2785
|
+
}
|
|
2786
|
+
else if (status !== 200 && status !== 204) {
|
|
2787
|
+
const _responseText = response.data;
|
|
2788
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
2789
|
+
}
|
|
2790
|
+
return Promise.resolve(null);
|
|
2791
|
+
}
|
|
2792
|
+
/**
|
|
2793
|
+
* Creates a private design from a public resource.
|
|
2794
|
+
* @param resourceId (optional) Resource ID.
|
|
2795
|
+
* @param privateDesignId (optional) Private design ID.
|
|
2796
|
+
* @param privateStorageOwner (optional) Private storage owner ID.
|
|
2797
|
+
* @param tenantId (optional) Tenant identifier
|
|
2798
|
+
* @return Success
|
|
2799
|
+
*/
|
|
2800
|
+
createPrivateDesignFromResource(resourceId, privateDesignId, privateStorageOwner, tenantId, cancelToken) {
|
|
2801
|
+
let url_ = this.baseUrl + "/api/atoms/v1/private-designs/from-resource?";
|
|
2802
|
+
if (resourceId !== undefined && resourceId !== null)
|
|
2803
|
+
url_ += "resourceId=" + encodeURIComponent("" + resourceId) + "&";
|
|
2804
|
+
if (privateDesignId !== undefined && privateDesignId !== null)
|
|
2805
|
+
url_ += "privateDesignId=" + encodeURIComponent("" + privateDesignId) + "&";
|
|
2806
|
+
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
2807
|
+
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
2808
|
+
if (tenantId === null)
|
|
2809
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
2810
|
+
else if (tenantId !== undefined)
|
|
2811
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2812
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
2813
|
+
let options_ = {
|
|
2814
|
+
method: "POST",
|
|
2815
|
+
url: url_,
|
|
2816
|
+
headers: {},
|
|
2817
|
+
cancelToken
|
|
2818
|
+
};
|
|
2819
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
2820
|
+
return this.instance.request(transformedOptions_);
|
|
2821
|
+
}).catch((_error) => {
|
|
2822
|
+
if (isAxiosError(_error) && _error.response) {
|
|
2823
|
+
return _error.response;
|
|
2824
|
+
}
|
|
2825
|
+
else {
|
|
2826
|
+
throw _error;
|
|
2827
|
+
}
|
|
2828
|
+
}).then((_response) => {
|
|
2829
|
+
return this.transformResult(url_, _response, (_response) => this.processCreatePrivateDesignFromResource(_response));
|
|
2830
|
+
});
|
|
2831
|
+
}
|
|
2832
|
+
processCreatePrivateDesignFromResource(response) {
|
|
2833
|
+
const status = response.status;
|
|
2834
|
+
let _headers = {};
|
|
2835
|
+
if (response.headers && typeof response.headers === "object") {
|
|
2836
|
+
for (let k in response.headers) {
|
|
2837
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
2838
|
+
_headers[k] = response.headers[k];
|
|
2839
|
+
}
|
|
2840
|
+
}
|
|
2841
|
+
}
|
|
2842
|
+
if (status === 201) {
|
|
2843
|
+
const _responseText = response.data;
|
|
2844
|
+
return Promise.resolve(null);
|
|
2845
|
+
}
|
|
2846
|
+
else if (status === 401) {
|
|
2847
|
+
const _responseText = response.data;
|
|
2848
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
2849
|
+
}
|
|
2850
|
+
else if (status === 403) {
|
|
2851
|
+
const _responseText = response.data;
|
|
2852
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
2853
|
+
}
|
|
2854
|
+
else if (status !== 200 && status !== 204) {
|
|
2855
|
+
const _responseText = response.data;
|
|
2856
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
2857
|
+
}
|
|
2858
|
+
return Promise.resolve(null);
|
|
2859
|
+
}
|
|
2860
|
+
/**
|
|
2861
|
+
* Renders a design with the specified parameters.
|
|
2862
|
+
* @param attachment (optional) If set to 'true', file will be provided as an attachment with unique filename supplied (default value is 'false').
|
|
2863
|
+
* @param tenantId (optional) Tenant identifier
|
|
2864
|
+
* @param body (optional) Render model with preview parameters.
|
|
2865
|
+
* @return Success
|
|
2866
|
+
*/
|
|
2867
|
+
renderDesign(attachment, tenantId, body, cancelToken) {
|
|
2868
|
+
let url_ = this.baseUrl + "/api/atoms/v1/render-design-preview?";
|
|
2869
|
+
if (attachment !== undefined && attachment !== null)
|
|
2870
|
+
url_ += "attachment=" + encodeURIComponent("" + attachment) + "&";
|
|
2871
|
+
if (tenantId === null)
|
|
2872
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
2873
|
+
else if (tenantId !== undefined)
|
|
2874
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2875
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
2876
|
+
const content_ = JSON.stringify(body);
|
|
2877
|
+
let options_ = {
|
|
2878
|
+
data: content_,
|
|
2879
|
+
responseType: "blob",
|
|
2880
|
+
method: "POST",
|
|
2881
|
+
url: url_,
|
|
2882
|
+
headers: {
|
|
2883
|
+
"Content-Type": "application/json",
|
|
2884
|
+
"Accept": "application/octet-stream"
|
|
2885
|
+
},
|
|
2886
|
+
cancelToken
|
|
2887
|
+
};
|
|
2888
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
2889
|
+
return this.instance.request(transformedOptions_);
|
|
2890
|
+
}).catch((_error) => {
|
|
2891
|
+
if (isAxiosError(_error) && _error.response) {
|
|
2892
|
+
return _error.response;
|
|
2893
|
+
}
|
|
2894
|
+
else {
|
|
2895
|
+
throw _error;
|
|
2896
|
+
}
|
|
2897
|
+
}).then((_response) => {
|
|
2898
|
+
return this.transformResult(url_, _response, (_response) => this.processRenderDesign(_response));
|
|
2899
|
+
});
|
|
2900
|
+
}
|
|
2901
|
+
processRenderDesign(response) {
|
|
2902
|
+
const status = response.status;
|
|
2903
|
+
let _headers = {};
|
|
2904
|
+
if (response.headers && typeof response.headers === "object") {
|
|
2905
|
+
for (let k in response.headers) {
|
|
2906
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
2907
|
+
_headers[k] = response.headers[k];
|
|
2908
|
+
}
|
|
2909
|
+
}
|
|
2910
|
+
}
|
|
2911
|
+
if (status === 200 || status === 206) {
|
|
2912
|
+
const contentDisposition = response.headers ? response.headers["content-disposition"] : undefined;
|
|
2913
|
+
const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
|
|
2914
|
+
const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
|
|
2915
|
+
return Promise.resolve({ fileName: fileName, status: status, data: new Blob([response.data]), headers: _headers });
|
|
2916
|
+
}
|
|
2917
|
+
else if (status === 401) {
|
|
2918
|
+
const _responseText = response.data;
|
|
2919
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
2920
|
+
}
|
|
2921
|
+
else if (status === 403) {
|
|
2922
|
+
const _responseText = response.data;
|
|
2923
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
2924
|
+
}
|
|
2925
|
+
else if (status !== 200 && status !== 204) {
|
|
2926
|
+
const _responseText = response.data;
|
|
2927
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
2928
|
+
}
|
|
2929
|
+
return Promise.resolve(null);
|
|
2930
|
+
}
|
|
2647
2931
|
/**
|
|
2648
2932
|
* Render product proof image with specified parameters.
|
|
2649
|
-
* @param attachment (optional) If set to 'true', file will be provided as an attachment with unique filename supplied (default value is 'false')
|
|
2933
|
+
* @param attachment (optional) If set to 'true', file will be provided as an attachment with unique filename supplied (default value is 'false').
|
|
2650
2934
|
* @param tenantId (optional) Tenant identifier
|
|
2651
|
-
* @param body (optional) Preview parameters
|
|
2935
|
+
* @param body (optional) Preview parameters.
|
|
2652
2936
|
* @return Success
|
|
2653
2937
|
*/
|
|
2654
2938
|
renderProduct(attachment, tenantId, body, cancelToken) {
|
|
@@ -2668,7 +2952,7 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
2668
2952
|
url: url_,
|
|
2669
2953
|
headers: {
|
|
2670
2954
|
"Content-Type": "application/json",
|
|
2671
|
-
"Accept": "application/
|
|
2955
|
+
"Accept": "application/octet-stream"
|
|
2672
2956
|
},
|
|
2673
2957
|
cancelToken
|
|
2674
2958
|
};
|
|
@@ -4184,6 +4468,15 @@ class DesignAtomsViewerApiClient extends ApiClientBase {
|
|
|
4184
4468
|
}
|
|
4185
4469
|
}
|
|
4186
4470
|
exports.DesignAtomsViewerApiClient = DesignAtomsViewerApiClient;
|
|
4471
|
+
var DesignElementType;
|
|
4472
|
+
(function (DesignElementType) {
|
|
4473
|
+
DesignElementType["Product"] = "Product";
|
|
4474
|
+
DesignElementType["Design"] = "Design";
|
|
4475
|
+
DesignElementType["Surface"] = "Surface";
|
|
4476
|
+
DesignElementType["Container"] = "Container";
|
|
4477
|
+
DesignElementType["PrintArea"] = "PrintArea";
|
|
4478
|
+
DesignElementType["Item"] = "Item";
|
|
4479
|
+
})(DesignElementType = exports.DesignElementType || (exports.DesignElementType = {}));
|
|
4187
4480
|
/** Available patch type */
|
|
4188
4481
|
var ProductPatchType;
|
|
4189
4482
|
(function (ProductPatchType) {
|
|
@@ -4204,6 +4497,14 @@ var ItemSourceType;
|
|
|
4204
4497
|
ItemSourceType["ImageStorage"] = "ImageStorage";
|
|
4205
4498
|
ItemSourceType["PrivateImageStorage"] = "PrivateImageStorage";
|
|
4206
4499
|
})(ItemSourceType = exports.ItemSourceType || (exports.ItemSourceType = {}));
|
|
4500
|
+
/** Product preview file format. */
|
|
4501
|
+
var ProductPreviewFormat;
|
|
4502
|
+
(function (ProductPreviewFormat) {
|
|
4503
|
+
ProductPreviewFormat["Jpeg"] = "Jpeg";
|
|
4504
|
+
ProductPreviewFormat["Png"] = "Png";
|
|
4505
|
+
ProductPreviewFormat["Tiff"] = "Tiff";
|
|
4506
|
+
ProductPreviewFormat["Pdf"] = "Pdf";
|
|
4507
|
+
})(ProductPreviewFormat = exports.ProductPreviewFormat || (exports.ProductPreviewFormat = {}));
|
|
4207
4508
|
var ProductProofFormat;
|
|
4208
4509
|
(function (ProductProofFormat) {
|
|
4209
4510
|
ProductProofFormat["Jpeg"] = "Jpeg";
|