@aurigma/axios-design-atoms-api-client 2.37.1 → 2.38.4

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.
@@ -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
@@ -1899,6 +1899,194 @@ export class DesignAtomsImagesApiClient extends ApiClientBase {
1899
1899
  return Promise.resolve(null);
1900
1900
  }
1901
1901
  }
1902
+ export class DesignAtomsMockups3dApiClient extends ApiClientBase {
1903
+ instance;
1904
+ baseUrl;
1905
+ jsonParseReviver = undefined;
1906
+ constructor(configuration, baseUrl, instance) {
1907
+ super(configuration);
1908
+ this.instance = instance ? instance : axios.create();
1909
+ this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : this.getBaseUrl("");
1910
+ }
1911
+ /**
1912
+ * Returns a 3D-Mockup content as protobuf binary stream.
1913
+ * @param id 3D-Mockup identifier.
1914
+ * @param tenantId (optional) Tenant identifier
1915
+ * @return Success
1916
+ */
1917
+ getContentAsProtobuf(id, tenantId, cancelToken) {
1918
+ let url_ = this.baseUrl + "/api/atoms/v1/mockups-3d/{id}/content/as-protobuf?";
1919
+ if (id === undefined || id === null)
1920
+ throw new Error("The parameter 'id' must be defined.");
1921
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
1922
+ if (tenantId === null)
1923
+ throw new Error("The parameter 'tenantId' cannot be null.");
1924
+ else if (tenantId !== undefined)
1925
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
1926
+ url_ = url_.replace(/[?&]$/, "");
1927
+ let options_ = {
1928
+ responseType: "blob",
1929
+ method: "GET",
1930
+ url: url_,
1931
+ headers: {
1932
+ "Accept": "application/octet-stream"
1933
+ },
1934
+ cancelToken
1935
+ };
1936
+ return this.transformOptions(options_).then(transformedOptions_ => {
1937
+ return this.instance.request(transformedOptions_);
1938
+ }).catch((_error) => {
1939
+ if (isAxiosError(_error) && _error.response) {
1940
+ return _error.response;
1941
+ }
1942
+ else {
1943
+ throw _error;
1944
+ }
1945
+ }).then((_response) => {
1946
+ return this.transformResult(url_, _response, (_response) => this.processGetContentAsProtobuf(_response));
1947
+ });
1948
+ }
1949
+ processGetContentAsProtobuf(response) {
1950
+ const status = response.status;
1951
+ let _headers = {};
1952
+ if (response.headers && typeof response.headers === "object") {
1953
+ for (let k in response.headers) {
1954
+ if (response.headers.hasOwnProperty(k)) {
1955
+ _headers[k] = response.headers[k];
1956
+ }
1957
+ }
1958
+ }
1959
+ if (status === 200 || status === 206) {
1960
+ const contentDisposition = response.headers ? response.headers["content-disposition"] : undefined;
1961
+ const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
1962
+ const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
1963
+ return Promise.resolve({ fileName: fileName, status: status, data: new Blob([response.data]), headers: _headers });
1964
+ }
1965
+ else if (status === 404) {
1966
+ const _responseText = response.data;
1967
+ let result404 = null;
1968
+ let resultData404 = _responseText;
1969
+ result404 = JSON.parse(resultData404);
1970
+ return throwException("Not Found", status, _responseText, _headers, result404);
1971
+ }
1972
+ else if (status === 422) {
1973
+ const _responseText = response.data;
1974
+ let result422 = null;
1975
+ let resultData422 = _responseText;
1976
+ result422 = JSON.parse(resultData422);
1977
+ return throwException("Client Error", status, _responseText, _headers, result422);
1978
+ }
1979
+ else if (status === 401) {
1980
+ const _responseText = response.data;
1981
+ return throwException("Unauthorized", status, _responseText, _headers);
1982
+ }
1983
+ else if (status === 403) {
1984
+ const _responseText = response.data;
1985
+ return throwException("Forbidden", status, _responseText, _headers);
1986
+ }
1987
+ else if (status === 500) {
1988
+ const _responseText = response.data;
1989
+ let result500 = null;
1990
+ let resultData500 = _responseText;
1991
+ result500 = JSON.parse(resultData500);
1992
+ return throwException("Internal server error", status, _responseText, _headers, result500);
1993
+ }
1994
+ else if (status !== 200 && status !== 204) {
1995
+ const _responseText = response.data;
1996
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
1997
+ }
1998
+ return Promise.resolve(null);
1999
+ }
2000
+ /**
2001
+ * Returns a 3D-Mockup geometry as binary stream.
2002
+ * @param id 3D-Mockup identifier.
2003
+ * @param tenantId (optional) Tenant identifier
2004
+ * @return Success
2005
+ */
2006
+ getGeometryFile(id, tenantId, cancelToken) {
2007
+ let url_ = this.baseUrl + "/api/atoms/v1/mockups-3d/{id}/geometry/file?";
2008
+ if (id === undefined || id === null)
2009
+ throw new Error("The parameter 'id' must be defined.");
2010
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
2011
+ if (tenantId === null)
2012
+ throw new Error("The parameter 'tenantId' cannot be null.");
2013
+ else if (tenantId !== undefined)
2014
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
2015
+ url_ = url_.replace(/[?&]$/, "");
2016
+ let options_ = {
2017
+ responseType: "blob",
2018
+ method: "GET",
2019
+ url: url_,
2020
+ headers: {
2021
+ "Accept": "application/octet-stream"
2022
+ },
2023
+ cancelToken
2024
+ };
2025
+ return this.transformOptions(options_).then(transformedOptions_ => {
2026
+ return this.instance.request(transformedOptions_);
2027
+ }).catch((_error) => {
2028
+ if (isAxiosError(_error) && _error.response) {
2029
+ return _error.response;
2030
+ }
2031
+ else {
2032
+ throw _error;
2033
+ }
2034
+ }).then((_response) => {
2035
+ return this.transformResult(url_, _response, (_response) => this.processGetGeometryFile(_response));
2036
+ });
2037
+ }
2038
+ processGetGeometryFile(response) {
2039
+ const status = response.status;
2040
+ let _headers = {};
2041
+ if (response.headers && typeof response.headers === "object") {
2042
+ for (let k in response.headers) {
2043
+ if (response.headers.hasOwnProperty(k)) {
2044
+ _headers[k] = response.headers[k];
2045
+ }
2046
+ }
2047
+ }
2048
+ if (status === 200 || status === 206) {
2049
+ const contentDisposition = response.headers ? response.headers["content-disposition"] : undefined;
2050
+ const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
2051
+ const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
2052
+ return Promise.resolve({ fileName: fileName, status: status, data: new Blob([response.data]), headers: _headers });
2053
+ }
2054
+ else if (status === 404) {
2055
+ const _responseText = response.data;
2056
+ let result404 = null;
2057
+ let resultData404 = _responseText;
2058
+ result404 = JSON.parse(resultData404);
2059
+ return throwException("Not Found", status, _responseText, _headers, result404);
2060
+ }
2061
+ else if (status === 422) {
2062
+ const _responseText = response.data;
2063
+ let result422 = null;
2064
+ let resultData422 = _responseText;
2065
+ result422 = JSON.parse(resultData422);
2066
+ return throwException("Client Error", status, _responseText, _headers, result422);
2067
+ }
2068
+ else if (status === 401) {
2069
+ const _responseText = response.data;
2070
+ return throwException("Unauthorized", status, _responseText, _headers);
2071
+ }
2072
+ else if (status === 403) {
2073
+ const _responseText = response.data;
2074
+ return throwException("Forbidden", status, _responseText, _headers);
2075
+ }
2076
+ else if (status === 500) {
2077
+ const _responseText = response.data;
2078
+ let result500 = null;
2079
+ let resultData500 = _responseText;
2080
+ result500 = JSON.parse(resultData500);
2081
+ return throwException("Internal server error", status, _responseText, _headers, result500);
2082
+ }
2083
+ else if (status !== 200 && status !== 204) {
2084
+ const _responseText = response.data;
2085
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
2086
+ }
2087
+ return Promise.resolve(null);
2088
+ }
2089
+ }
1902
2090
  export class DesignAtomsServiceApiClient extends ApiClientBase {
1903
2091
  instance;
1904
2092
  baseUrl;