@aurigma/axios-design-atoms-api-client 2.36.1 → 2.38.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 +38 -0
- package/dist/cjs/design-atoms-api-client.js +190 -1
- package/dist/cjs/design-atoms-api-client.js.map +1 -1
- package/dist/esm/design-atoms-api-client.d.ts +38 -0
- package/dist/esm/design-atoms-api-client.js +188 -0
- package/dist/esm/design-atoms-api-client.js.map +1 -1
- package/package.json +1 -1
|
@@ -366,6 +366,44 @@ export declare class DesignAtomsImagesApiClient extends ApiClientBase implements
|
|
|
366
366
|
renderImagePreview(attachment?: boolean | null | undefined, tenantId?: number | undefined, body?: RenderImagePreviewModel | null | undefined, cancelToken?: CancelToken | undefined): Promise<FileResponse>;
|
|
367
367
|
protected processRenderImagePreview(response: AxiosResponse): Promise<FileResponse>;
|
|
368
368
|
}
|
|
369
|
+
export interface IDesignAtomsMockups3dApiClient {
|
|
370
|
+
/**
|
|
371
|
+
* Returns a 3D-Mockup content as protobuf binary stream.
|
|
372
|
+
* @param id 3D-Mockup identifier.
|
|
373
|
+
* @param tenantId (optional) Tenant identifier
|
|
374
|
+
* @return Success
|
|
375
|
+
*/
|
|
376
|
+
getContentAsProtobuf(id: string | null, tenantId?: number | undefined): Promise<FileResponse>;
|
|
377
|
+
/**
|
|
378
|
+
* Returns a 3D-Mockup geometry as binary stream.
|
|
379
|
+
* @param id 3D-Mockup identifier.
|
|
380
|
+
* @param tenantId (optional) Tenant identifier
|
|
381
|
+
* @return Success
|
|
382
|
+
*/
|
|
383
|
+
getGeometryFile(id: string | null, tenantId?: number | undefined): Promise<FileResponse>;
|
|
384
|
+
}
|
|
385
|
+
export declare class DesignAtomsMockups3dApiClient extends ApiClientBase implements IDesignAtomsMockups3dApiClient {
|
|
386
|
+
private instance;
|
|
387
|
+
private baseUrl;
|
|
388
|
+
protected jsonParseReviver: ((key: string, value: any) => any) | undefined;
|
|
389
|
+
constructor(configuration: ApiClientConfiguration, baseUrl?: string, instance?: AxiosInstance);
|
|
390
|
+
/**
|
|
391
|
+
* Returns a 3D-Mockup content as protobuf binary stream.
|
|
392
|
+
* @param id 3D-Mockup identifier.
|
|
393
|
+
* @param tenantId (optional) Tenant identifier
|
|
394
|
+
* @return Success
|
|
395
|
+
*/
|
|
396
|
+
getContentAsProtobuf(id: string | null, tenantId?: number | undefined, cancelToken?: CancelToken | undefined): Promise<FileResponse>;
|
|
397
|
+
protected processGetContentAsProtobuf(response: AxiosResponse): Promise<FileResponse>;
|
|
398
|
+
/**
|
|
399
|
+
* Returns a 3D-Mockup geometry as binary stream.
|
|
400
|
+
* @param id 3D-Mockup identifier.
|
|
401
|
+
* @param tenantId (optional) Tenant identifier
|
|
402
|
+
* @return Success
|
|
403
|
+
*/
|
|
404
|
+
getGeometryFile(id: string | null, tenantId?: number | undefined, cancelToken?: CancelToken | undefined): Promise<FileResponse>;
|
|
405
|
+
protected processGetGeometryFile(response: AxiosResponse): Promise<FileResponse>;
|
|
406
|
+
}
|
|
369
407
|
export interface IDesignAtomsServiceApiClient {
|
|
370
408
|
/**
|
|
371
409
|
* Converts colors
|
|
@@ -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.PlaceholderItemContentType = exports.ProductPatchType = exports.DesignElementType = exports.ImagePreviewFormat = exports.DesignAtomsViewerApiClient = exports.DesignAtomsServiceApiClient = exports.DesignAtomsImagesApiClient = exports.DesignAtomsCompatibilityApiClient = exports.BuildInfoApiClient = exports.ApiClientBase = exports.ApiClientConfiguration = void 0;
|
|
11
|
+
exports.ApiException = exports.ProductProofInterpolationMode = exports.ProductProofFormat = exports.ProductPreviewFormat = exports.ItemSourceType = exports.ItemType = exports.PlaceholderItemContentType = exports.ProductPatchType = exports.DesignElementType = exports.ImagePreviewFormat = exports.DesignAtomsViewerApiClient = exports.DesignAtomsServiceApiClient = exports.DesignAtomsMockups3dApiClient = exports.DesignAtomsImagesApiClient = exports.DesignAtomsCompatibilityApiClient = exports.BuildInfoApiClient = exports.ApiClientBase = exports.ApiClientConfiguration = void 0;
|
|
12
12
|
const axios_1 = require("axios");
|
|
13
13
|
class ApiClientConfiguration {
|
|
14
14
|
apiUrl;
|
|
@@ -1907,6 +1907,195 @@ class DesignAtomsImagesApiClient extends ApiClientBase {
|
|
|
1907
1907
|
}
|
|
1908
1908
|
}
|
|
1909
1909
|
exports.DesignAtomsImagesApiClient = DesignAtomsImagesApiClient;
|
|
1910
|
+
class DesignAtomsMockups3dApiClient extends ApiClientBase {
|
|
1911
|
+
instance;
|
|
1912
|
+
baseUrl;
|
|
1913
|
+
jsonParseReviver = undefined;
|
|
1914
|
+
constructor(configuration, baseUrl, instance) {
|
|
1915
|
+
super(configuration);
|
|
1916
|
+
this.instance = instance ? instance : axios_1.create();
|
|
1917
|
+
this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : this.getBaseUrl("");
|
|
1918
|
+
}
|
|
1919
|
+
/**
|
|
1920
|
+
* Returns a 3D-Mockup content as protobuf binary stream.
|
|
1921
|
+
* @param id 3D-Mockup identifier.
|
|
1922
|
+
* @param tenantId (optional) Tenant identifier
|
|
1923
|
+
* @return Success
|
|
1924
|
+
*/
|
|
1925
|
+
getContentAsProtobuf(id, tenantId, cancelToken) {
|
|
1926
|
+
let url_ = this.baseUrl + "/api/atoms/v1/mockups-3d/{id}/content/as-protobuf?";
|
|
1927
|
+
if (id === undefined || id === null)
|
|
1928
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
1929
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
1930
|
+
if (tenantId === null)
|
|
1931
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
1932
|
+
else if (tenantId !== undefined)
|
|
1933
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
1934
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
1935
|
+
let options_ = {
|
|
1936
|
+
responseType: "blob",
|
|
1937
|
+
method: "GET",
|
|
1938
|
+
url: url_,
|
|
1939
|
+
headers: {
|
|
1940
|
+
"Accept": "application/octet-stream"
|
|
1941
|
+
},
|
|
1942
|
+
cancelToken
|
|
1943
|
+
};
|
|
1944
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
1945
|
+
return this.instance.request(transformedOptions_);
|
|
1946
|
+
}).catch((_error) => {
|
|
1947
|
+
if (isAxiosError(_error) && _error.response) {
|
|
1948
|
+
return _error.response;
|
|
1949
|
+
}
|
|
1950
|
+
else {
|
|
1951
|
+
throw _error;
|
|
1952
|
+
}
|
|
1953
|
+
}).then((_response) => {
|
|
1954
|
+
return this.transformResult(url_, _response, (_response) => this.processGetContentAsProtobuf(_response));
|
|
1955
|
+
});
|
|
1956
|
+
}
|
|
1957
|
+
processGetContentAsProtobuf(response) {
|
|
1958
|
+
const status = response.status;
|
|
1959
|
+
let _headers = {};
|
|
1960
|
+
if (response.headers && typeof response.headers === "object") {
|
|
1961
|
+
for (let k in response.headers) {
|
|
1962
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
1963
|
+
_headers[k] = response.headers[k];
|
|
1964
|
+
}
|
|
1965
|
+
}
|
|
1966
|
+
}
|
|
1967
|
+
if (status === 200 || status === 206) {
|
|
1968
|
+
const contentDisposition = response.headers ? response.headers["content-disposition"] : undefined;
|
|
1969
|
+
const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
|
|
1970
|
+
const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
|
|
1971
|
+
return Promise.resolve({ fileName: fileName, status: status, data: new Blob([response.data]), headers: _headers });
|
|
1972
|
+
}
|
|
1973
|
+
else if (status === 404) {
|
|
1974
|
+
const _responseText = response.data;
|
|
1975
|
+
let result404 = null;
|
|
1976
|
+
let resultData404 = _responseText;
|
|
1977
|
+
result404 = JSON.parse(resultData404);
|
|
1978
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
1979
|
+
}
|
|
1980
|
+
else if (status === 422) {
|
|
1981
|
+
const _responseText = response.data;
|
|
1982
|
+
let result422 = null;
|
|
1983
|
+
let resultData422 = _responseText;
|
|
1984
|
+
result422 = JSON.parse(resultData422);
|
|
1985
|
+
return throwException("Client Error", status, _responseText, _headers, result422);
|
|
1986
|
+
}
|
|
1987
|
+
else if (status === 401) {
|
|
1988
|
+
const _responseText = response.data;
|
|
1989
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
1990
|
+
}
|
|
1991
|
+
else if (status === 403) {
|
|
1992
|
+
const _responseText = response.data;
|
|
1993
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
1994
|
+
}
|
|
1995
|
+
else if (status === 500) {
|
|
1996
|
+
const _responseText = response.data;
|
|
1997
|
+
let result500 = null;
|
|
1998
|
+
let resultData500 = _responseText;
|
|
1999
|
+
result500 = JSON.parse(resultData500);
|
|
2000
|
+
return throwException("Internal server error", status, _responseText, _headers, result500);
|
|
2001
|
+
}
|
|
2002
|
+
else if (status !== 200 && status !== 204) {
|
|
2003
|
+
const _responseText = response.data;
|
|
2004
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
2005
|
+
}
|
|
2006
|
+
return Promise.resolve(null);
|
|
2007
|
+
}
|
|
2008
|
+
/**
|
|
2009
|
+
* Returns a 3D-Mockup geometry as binary stream.
|
|
2010
|
+
* @param id 3D-Mockup identifier.
|
|
2011
|
+
* @param tenantId (optional) Tenant identifier
|
|
2012
|
+
* @return Success
|
|
2013
|
+
*/
|
|
2014
|
+
getGeometryFile(id, tenantId, cancelToken) {
|
|
2015
|
+
let url_ = this.baseUrl + "/api/atoms/v1/mockups-3d/{id}/geometry/file?";
|
|
2016
|
+
if (id === undefined || id === null)
|
|
2017
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
2018
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
2019
|
+
if (tenantId === null)
|
|
2020
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
2021
|
+
else if (tenantId !== undefined)
|
|
2022
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2023
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
2024
|
+
let options_ = {
|
|
2025
|
+
responseType: "blob",
|
|
2026
|
+
method: "GET",
|
|
2027
|
+
url: url_,
|
|
2028
|
+
headers: {
|
|
2029
|
+
"Accept": "application/octet-stream"
|
|
2030
|
+
},
|
|
2031
|
+
cancelToken
|
|
2032
|
+
};
|
|
2033
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
2034
|
+
return this.instance.request(transformedOptions_);
|
|
2035
|
+
}).catch((_error) => {
|
|
2036
|
+
if (isAxiosError(_error) && _error.response) {
|
|
2037
|
+
return _error.response;
|
|
2038
|
+
}
|
|
2039
|
+
else {
|
|
2040
|
+
throw _error;
|
|
2041
|
+
}
|
|
2042
|
+
}).then((_response) => {
|
|
2043
|
+
return this.transformResult(url_, _response, (_response) => this.processGetGeometryFile(_response));
|
|
2044
|
+
});
|
|
2045
|
+
}
|
|
2046
|
+
processGetGeometryFile(response) {
|
|
2047
|
+
const status = response.status;
|
|
2048
|
+
let _headers = {};
|
|
2049
|
+
if (response.headers && typeof response.headers === "object") {
|
|
2050
|
+
for (let k in response.headers) {
|
|
2051
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
2052
|
+
_headers[k] = response.headers[k];
|
|
2053
|
+
}
|
|
2054
|
+
}
|
|
2055
|
+
}
|
|
2056
|
+
if (status === 200 || status === 206) {
|
|
2057
|
+
const contentDisposition = response.headers ? response.headers["content-disposition"] : undefined;
|
|
2058
|
+
const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
|
|
2059
|
+
const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
|
|
2060
|
+
return Promise.resolve({ fileName: fileName, status: status, data: new Blob([response.data]), headers: _headers });
|
|
2061
|
+
}
|
|
2062
|
+
else if (status === 404) {
|
|
2063
|
+
const _responseText = response.data;
|
|
2064
|
+
let result404 = null;
|
|
2065
|
+
let resultData404 = _responseText;
|
|
2066
|
+
result404 = JSON.parse(resultData404);
|
|
2067
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
2068
|
+
}
|
|
2069
|
+
else if (status === 422) {
|
|
2070
|
+
const _responseText = response.data;
|
|
2071
|
+
let result422 = null;
|
|
2072
|
+
let resultData422 = _responseText;
|
|
2073
|
+
result422 = JSON.parse(resultData422);
|
|
2074
|
+
return throwException("Client Error", status, _responseText, _headers, result422);
|
|
2075
|
+
}
|
|
2076
|
+
else if (status === 401) {
|
|
2077
|
+
const _responseText = response.data;
|
|
2078
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
2079
|
+
}
|
|
2080
|
+
else if (status === 403) {
|
|
2081
|
+
const _responseText = response.data;
|
|
2082
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
2083
|
+
}
|
|
2084
|
+
else if (status === 500) {
|
|
2085
|
+
const _responseText = response.data;
|
|
2086
|
+
let result500 = null;
|
|
2087
|
+
let resultData500 = _responseText;
|
|
2088
|
+
result500 = JSON.parse(resultData500);
|
|
2089
|
+
return throwException("Internal server error", status, _responseText, _headers, result500);
|
|
2090
|
+
}
|
|
2091
|
+
else if (status !== 200 && status !== 204) {
|
|
2092
|
+
const _responseText = response.data;
|
|
2093
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
2094
|
+
}
|
|
2095
|
+
return Promise.resolve(null);
|
|
2096
|
+
}
|
|
2097
|
+
}
|
|
2098
|
+
exports.DesignAtomsMockups3dApiClient = DesignAtomsMockups3dApiClient;
|
|
1910
2099
|
class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
1911
2100
|
instance;
|
|
1912
2101
|
baseUrl;
|