@aurigma/axios-design-atoms-api-client 2.34.1 → 2.34.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.
- package/dist/cjs/design-atoms-api-client.d.ts +29 -3
- package/dist/cjs/design-atoms-api-client.js +112 -9
- package/dist/cjs/design-atoms-api-client.js.map +1 -1
- package/dist/esm/design-atoms-api-client.d.ts +29 -3
- package/dist/esm/design-atoms-api-client.js +111 -8
- package/dist/esm/design-atoms-api-client.js.map +1 -1
- package/package.json +1 -1
|
@@ -544,6 +544,15 @@ export interface IDesignAtomsServiceApiClient {
|
|
|
544
544
|
* @return Success
|
|
545
545
|
*/
|
|
546
546
|
renderProduct(attachment?: boolean | null | undefined, tenantId?: number | undefined, body?: RenderProductModel | null | undefined): Promise<FileResponse>;
|
|
547
|
+
/**
|
|
548
|
+
* Loads product (design model) from resource file taken from storage
|
|
549
|
+
* @param id Resource identifier
|
|
550
|
+
* @param privateStorage (optional) If set to 'true' resource will be taken from private storage
|
|
551
|
+
* @param privateStorageOwner (optional) Private storage owner identifier
|
|
552
|
+
* @param tenantId (optional) Tenant identifier
|
|
553
|
+
* @return Success
|
|
554
|
+
*/
|
|
555
|
+
loadProductFromResource(id: string | null, privateStorage?: boolean | null | undefined, privateStorageOwner?: string | null | undefined, tenantId?: number | undefined): Promise<any>;
|
|
547
556
|
}
|
|
548
557
|
export declare class DesignAtomsServiceApiClient extends ApiClientBase implements IDesignAtomsServiceApiClient {
|
|
549
558
|
private instance;
|
|
@@ -746,6 +755,16 @@ export declare class DesignAtomsServiceApiClient extends ApiClientBase implement
|
|
|
746
755
|
*/
|
|
747
756
|
renderProduct(attachment?: boolean | null | undefined, tenantId?: number | undefined, body?: RenderProductModel | null | undefined, cancelToken?: CancelToken | undefined): Promise<FileResponse>;
|
|
748
757
|
protected processRenderProduct(response: AxiosResponse): Promise<FileResponse>;
|
|
758
|
+
/**
|
|
759
|
+
* Loads product (design model) from resource file taken from storage
|
|
760
|
+
* @param id Resource identifier
|
|
761
|
+
* @param privateStorage (optional) If set to 'true' resource will be taken from private storage
|
|
762
|
+
* @param privateStorageOwner (optional) Private storage owner identifier
|
|
763
|
+
* @param tenantId (optional) Tenant identifier
|
|
764
|
+
* @return Success
|
|
765
|
+
*/
|
|
766
|
+
loadProductFromResource(id: string | null, privateStorage?: boolean | null | undefined, privateStorageOwner?: string | null | undefined, tenantId?: number | undefined, cancelToken?: CancelToken | undefined): Promise<any>;
|
|
767
|
+
protected processLoadProductFromResource(response: AxiosResponse): Promise<any>;
|
|
749
768
|
}
|
|
750
769
|
export interface IDesignAtomsViewerApiClient {
|
|
751
770
|
/**
|
|
@@ -1175,8 +1194,8 @@ export interface UpdateImageHandlerRequest {
|
|
|
1175
1194
|
itemHandlerData?: string | null;
|
|
1176
1195
|
itemData?: any | null;
|
|
1177
1196
|
}
|
|
1178
|
-
/**
|
|
1179
|
-
export declare enum
|
|
1197
|
+
/** Image preview file format. */
|
|
1198
|
+
export declare enum ImagePreviewFormat {
|
|
1180
1199
|
Jpeg = "Jpeg",
|
|
1181
1200
|
Png = "Png",
|
|
1182
1201
|
Tiff = "Tiff",
|
|
@@ -1190,7 +1209,7 @@ export interface RenderImagePreviewModel {
|
|
|
1190
1209
|
/** Width of preview image. */
|
|
1191
1210
|
width?: number;
|
|
1192
1211
|
/** Output image format. PNG by default. */
|
|
1193
|
-
fileFormat?:
|
|
1212
|
+
fileFormat?: ImagePreviewFormat | null;
|
|
1194
1213
|
}
|
|
1195
1214
|
/** Convert colors operation parameters */
|
|
1196
1215
|
export interface ConvertColorsModel {
|
|
@@ -1283,6 +1302,13 @@ export declare enum ItemSourceType {
|
|
|
1283
1302
|
ImageStorage = "ImageStorage",
|
|
1284
1303
|
PrivateImageStorage = "PrivateImageStorage"
|
|
1285
1304
|
}
|
|
1305
|
+
/** Product preview file format. */
|
|
1306
|
+
export declare enum ProductPreviewFormat {
|
|
1307
|
+
Jpeg = "Jpeg",
|
|
1308
|
+
Png = "Png",
|
|
1309
|
+
Tiff = "Tiff",
|
|
1310
|
+
Pdf = "Pdf"
|
|
1311
|
+
}
|
|
1286
1312
|
export interface ProductPreviewRenderingConfig {
|
|
1287
1313
|
surfaceIndex?: number | null;
|
|
1288
1314
|
width?: number;
|
|
@@ -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.PlaceholderItemContentType = exports.ProductPatchType = exports.DesignElementType = exports.
|
|
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;
|
|
12
12
|
const axios_1 = require("axios");
|
|
13
13
|
class ApiClientConfiguration {
|
|
14
14
|
apiUrl;
|
|
@@ -3557,6 +3557,101 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3557
3557
|
}
|
|
3558
3558
|
return Promise.resolve(null);
|
|
3559
3559
|
}
|
|
3560
|
+
/**
|
|
3561
|
+
* Loads product (design model) from resource file taken from storage
|
|
3562
|
+
* @param id Resource identifier
|
|
3563
|
+
* @param privateStorage (optional) If set to 'true' resource will be taken from private storage
|
|
3564
|
+
* @param privateStorageOwner (optional) Private storage owner identifier
|
|
3565
|
+
* @param tenantId (optional) Tenant identifier
|
|
3566
|
+
* @return Success
|
|
3567
|
+
*/
|
|
3568
|
+
loadProductFromResource(id, privateStorage, privateStorageOwner, tenantId, cancelToken) {
|
|
3569
|
+
let url_ = this.baseUrl + "/api/atoms/v1/resources/{id}/as-design/model?";
|
|
3570
|
+
if (id === undefined || id === null)
|
|
3571
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
3572
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
3573
|
+
if (privateStorage !== undefined && privateStorage !== null)
|
|
3574
|
+
url_ += "privateStorage=" + encodeURIComponent("" + privateStorage) + "&";
|
|
3575
|
+
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
3576
|
+
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
3577
|
+
if (tenantId === null)
|
|
3578
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
3579
|
+
else if (tenantId !== undefined)
|
|
3580
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
3581
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
3582
|
+
let options_ = {
|
|
3583
|
+
method: "GET",
|
|
3584
|
+
url: url_,
|
|
3585
|
+
headers: {
|
|
3586
|
+
"Accept": "application/json"
|
|
3587
|
+
},
|
|
3588
|
+
cancelToken
|
|
3589
|
+
};
|
|
3590
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
3591
|
+
return this.instance.request(transformedOptions_);
|
|
3592
|
+
}).catch((_error) => {
|
|
3593
|
+
if (isAxiosError(_error) && _error.response) {
|
|
3594
|
+
return _error.response;
|
|
3595
|
+
}
|
|
3596
|
+
else {
|
|
3597
|
+
throw _error;
|
|
3598
|
+
}
|
|
3599
|
+
}).then((_response) => {
|
|
3600
|
+
return this.transformResult(url_, _response, (_response) => this.processLoadProductFromResource(_response));
|
|
3601
|
+
});
|
|
3602
|
+
}
|
|
3603
|
+
processLoadProductFromResource(response) {
|
|
3604
|
+
const status = response.status;
|
|
3605
|
+
let _headers = {};
|
|
3606
|
+
if (response.headers && typeof response.headers === "object") {
|
|
3607
|
+
for (let k in response.headers) {
|
|
3608
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
3609
|
+
_headers[k] = response.headers[k];
|
|
3610
|
+
}
|
|
3611
|
+
}
|
|
3612
|
+
}
|
|
3613
|
+
if (status === 200) {
|
|
3614
|
+
const _responseText = response.data;
|
|
3615
|
+
let result200 = null;
|
|
3616
|
+
let resultData200 = _responseText;
|
|
3617
|
+
result200 = JSON.parse(resultData200);
|
|
3618
|
+
return Promise.resolve(result200);
|
|
3619
|
+
}
|
|
3620
|
+
else if (status === 404) {
|
|
3621
|
+
const _responseText = response.data;
|
|
3622
|
+
let result404 = null;
|
|
3623
|
+
let resultData404 = _responseText;
|
|
3624
|
+
result404 = JSON.parse(resultData404);
|
|
3625
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
3626
|
+
}
|
|
3627
|
+
else if (status === 422) {
|
|
3628
|
+
const _responseText = response.data;
|
|
3629
|
+
let result422 = null;
|
|
3630
|
+
let resultData422 = _responseText;
|
|
3631
|
+
result422 = JSON.parse(resultData422);
|
|
3632
|
+
return throwException("Client Error", status, _responseText, _headers, result422);
|
|
3633
|
+
}
|
|
3634
|
+
else if (status === 401) {
|
|
3635
|
+
const _responseText = response.data;
|
|
3636
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
3637
|
+
}
|
|
3638
|
+
else if (status === 403) {
|
|
3639
|
+
const _responseText = response.data;
|
|
3640
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
3641
|
+
}
|
|
3642
|
+
else if (status === 500) {
|
|
3643
|
+
const _responseText = response.data;
|
|
3644
|
+
let result500 = null;
|
|
3645
|
+
let resultData500 = _responseText;
|
|
3646
|
+
result500 = JSON.parse(resultData500);
|
|
3647
|
+
return throwException("Internal server error", status, _responseText, _headers, result500);
|
|
3648
|
+
}
|
|
3649
|
+
else if (status !== 200 && status !== 204) {
|
|
3650
|
+
const _responseText = response.data;
|
|
3651
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
3652
|
+
}
|
|
3653
|
+
return Promise.resolve(null);
|
|
3654
|
+
}
|
|
3560
3655
|
}
|
|
3561
3656
|
exports.DesignAtomsServiceApiClient = DesignAtomsServiceApiClient;
|
|
3562
3657
|
class DesignAtomsViewerApiClient extends ApiClientBase {
|
|
@@ -5249,14 +5344,14 @@ class DesignAtomsViewerApiClient extends ApiClientBase {
|
|
|
5249
5344
|
}
|
|
5250
5345
|
}
|
|
5251
5346
|
exports.DesignAtomsViewerApiClient = DesignAtomsViewerApiClient;
|
|
5252
|
-
/**
|
|
5253
|
-
var
|
|
5254
|
-
(function (
|
|
5255
|
-
|
|
5256
|
-
|
|
5257
|
-
|
|
5258
|
-
|
|
5259
|
-
})(
|
|
5347
|
+
/** Image preview file format. */
|
|
5348
|
+
var ImagePreviewFormat;
|
|
5349
|
+
(function (ImagePreviewFormat) {
|
|
5350
|
+
ImagePreviewFormat["Jpeg"] = "Jpeg";
|
|
5351
|
+
ImagePreviewFormat["Png"] = "Png";
|
|
5352
|
+
ImagePreviewFormat["Tiff"] = "Tiff";
|
|
5353
|
+
ImagePreviewFormat["Pdf"] = "Pdf";
|
|
5354
|
+
})(ImagePreviewFormat = exports.ImagePreviewFormat || (exports.ImagePreviewFormat = {}));
|
|
5260
5355
|
var DesignElementType;
|
|
5261
5356
|
(function (DesignElementType) {
|
|
5262
5357
|
DesignElementType["Product"] = "Product";
|
|
@@ -5292,6 +5387,14 @@ var ItemSourceType;
|
|
|
5292
5387
|
ItemSourceType["ImageStorage"] = "ImageStorage";
|
|
5293
5388
|
ItemSourceType["PrivateImageStorage"] = "PrivateImageStorage";
|
|
5294
5389
|
})(ItemSourceType = exports.ItemSourceType || (exports.ItemSourceType = {}));
|
|
5390
|
+
/** Product preview file format. */
|
|
5391
|
+
var ProductPreviewFormat;
|
|
5392
|
+
(function (ProductPreviewFormat) {
|
|
5393
|
+
ProductPreviewFormat["Jpeg"] = "Jpeg";
|
|
5394
|
+
ProductPreviewFormat["Png"] = "Png";
|
|
5395
|
+
ProductPreviewFormat["Tiff"] = "Tiff";
|
|
5396
|
+
ProductPreviewFormat["Pdf"] = "Pdf";
|
|
5397
|
+
})(ProductPreviewFormat = exports.ProductPreviewFormat || (exports.ProductPreviewFormat = {}));
|
|
5295
5398
|
var ProductProofFormat;
|
|
5296
5399
|
(function (ProductProofFormat) {
|
|
5297
5400
|
ProductProofFormat["Jpeg"] = "Jpeg";
|