@aurigma/axios-design-atoms-api-client 2.26.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 +33 -0
- package/dist/cjs/design-atoms-api-client.js +91 -1
- package/dist/cjs/design-atoms-api-client.js.map +1 -1
- package/dist/esm/design-atoms-api-client.d.ts +33 -0
- package/dist/esm/design-atoms-api-client.js +90 -0
- 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
|
|
@@ -510,6 +519,16 @@ export declare class DesignAtomsServiceApiClient extends ApiClientBase implement
|
|
|
510
519
|
*/
|
|
511
520
|
createDesign(privateStorage?: boolean | null | undefined, privateStorageOwner?: string | null | undefined, tenantId?: number | undefined, body?: CreateDesignModel | null | undefined, cancelToken?: CancelToken | undefined): Promise<DesignInfo>;
|
|
512
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>;
|
|
513
532
|
/**
|
|
514
533
|
* Loads product (design model) from design file taken from storage
|
|
515
534
|
* @param id Design identifier
|
|
@@ -1110,6 +1129,20 @@ export interface DesignInfo {
|
|
|
1110
1129
|
name?: string | null;
|
|
1111
1130
|
private?: boolean;
|
|
1112
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
|
+
}
|
|
1113
1146
|
/** Available patch type */
|
|
1114
1147
|
export declare enum ProductPatchType {
|
|
1115
1148
|
Undefined = "Undefined",
|
|
@@ -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
|
|
@@ -4378,6 +4459,15 @@ export class DesignAtomsViewerApiClient extends ApiClientBase {
|
|
|
4378
4459
|
return Promise.resolve(null);
|
|
4379
4460
|
}
|
|
4380
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 = {}));
|
|
4381
4471
|
/** Available patch type */
|
|
4382
4472
|
export var ProductPatchType;
|
|
4383
4473
|
(function (ProductPatchType) {
|