@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",
|
|
@@ -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.ProductPreviewFormat = 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
|
|
@@ -4387,6 +4468,15 @@ class DesignAtomsViewerApiClient extends ApiClientBase {
|
|
|
4387
4468
|
}
|
|
4388
4469
|
}
|
|
4389
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 = {}));
|
|
4390
4480
|
/** Available patch type */
|
|
4391
4481
|
var ProductPatchType;
|
|
4392
4482
|
(function (ProductPatchType) {
|