@aurigma/axios-design-atoms-api-client 2.34.1 → 2.35.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 +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;
|
|
@@ -3549,6 +3549,101 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
|
|
|
3549
3549
|
}
|
|
3550
3550
|
return Promise.resolve(null);
|
|
3551
3551
|
}
|
|
3552
|
+
/**
|
|
3553
|
+
* Loads product (design model) from resource file taken from storage
|
|
3554
|
+
* @param id Resource identifier
|
|
3555
|
+
* @param privateStorage (optional) If set to 'true' resource will be taken from private storage
|
|
3556
|
+
* @param privateStorageOwner (optional) Private storage owner identifier
|
|
3557
|
+
* @param tenantId (optional) Tenant identifier
|
|
3558
|
+
* @return Success
|
|
3559
|
+
*/
|
|
3560
|
+
loadProductFromResource(id, privateStorage, privateStorageOwner, tenantId, cancelToken) {
|
|
3561
|
+
let url_ = this.baseUrl + "/api/atoms/v1/resources/{id}/as-design/model?";
|
|
3562
|
+
if (id === undefined || id === null)
|
|
3563
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
3564
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
3565
|
+
if (privateStorage !== undefined && privateStorage !== null)
|
|
3566
|
+
url_ += "privateStorage=" + encodeURIComponent("" + privateStorage) + "&";
|
|
3567
|
+
if (privateStorageOwner !== undefined && privateStorageOwner !== null)
|
|
3568
|
+
url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
|
|
3569
|
+
if (tenantId === null)
|
|
3570
|
+
throw new Error("The parameter 'tenantId' cannot be null.");
|
|
3571
|
+
else if (tenantId !== undefined)
|
|
3572
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
3573
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
3574
|
+
let options_ = {
|
|
3575
|
+
method: "GET",
|
|
3576
|
+
url: url_,
|
|
3577
|
+
headers: {
|
|
3578
|
+
"Accept": "application/json"
|
|
3579
|
+
},
|
|
3580
|
+
cancelToken
|
|
3581
|
+
};
|
|
3582
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
3583
|
+
return this.instance.request(transformedOptions_);
|
|
3584
|
+
}).catch((_error) => {
|
|
3585
|
+
if (isAxiosError(_error) && _error.response) {
|
|
3586
|
+
return _error.response;
|
|
3587
|
+
}
|
|
3588
|
+
else {
|
|
3589
|
+
throw _error;
|
|
3590
|
+
}
|
|
3591
|
+
}).then((_response) => {
|
|
3592
|
+
return this.transformResult(url_, _response, (_response) => this.processLoadProductFromResource(_response));
|
|
3593
|
+
});
|
|
3594
|
+
}
|
|
3595
|
+
processLoadProductFromResource(response) {
|
|
3596
|
+
const status = response.status;
|
|
3597
|
+
let _headers = {};
|
|
3598
|
+
if (response.headers && typeof response.headers === "object") {
|
|
3599
|
+
for (let k in response.headers) {
|
|
3600
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
3601
|
+
_headers[k] = response.headers[k];
|
|
3602
|
+
}
|
|
3603
|
+
}
|
|
3604
|
+
}
|
|
3605
|
+
if (status === 200) {
|
|
3606
|
+
const _responseText = response.data;
|
|
3607
|
+
let result200 = null;
|
|
3608
|
+
let resultData200 = _responseText;
|
|
3609
|
+
result200 = JSON.parse(resultData200);
|
|
3610
|
+
return Promise.resolve(result200);
|
|
3611
|
+
}
|
|
3612
|
+
else if (status === 404) {
|
|
3613
|
+
const _responseText = response.data;
|
|
3614
|
+
let result404 = null;
|
|
3615
|
+
let resultData404 = _responseText;
|
|
3616
|
+
result404 = JSON.parse(resultData404);
|
|
3617
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
3618
|
+
}
|
|
3619
|
+
else if (status === 422) {
|
|
3620
|
+
const _responseText = response.data;
|
|
3621
|
+
let result422 = null;
|
|
3622
|
+
let resultData422 = _responseText;
|
|
3623
|
+
result422 = JSON.parse(resultData422);
|
|
3624
|
+
return throwException("Client Error", status, _responseText, _headers, result422);
|
|
3625
|
+
}
|
|
3626
|
+
else if (status === 401) {
|
|
3627
|
+
const _responseText = response.data;
|
|
3628
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
3629
|
+
}
|
|
3630
|
+
else if (status === 403) {
|
|
3631
|
+
const _responseText = response.data;
|
|
3632
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
3633
|
+
}
|
|
3634
|
+
else if (status === 500) {
|
|
3635
|
+
const _responseText = response.data;
|
|
3636
|
+
let result500 = null;
|
|
3637
|
+
let resultData500 = _responseText;
|
|
3638
|
+
result500 = JSON.parse(resultData500);
|
|
3639
|
+
return throwException("Internal server error", status, _responseText, _headers, result500);
|
|
3640
|
+
}
|
|
3641
|
+
else if (status !== 200 && status !== 204) {
|
|
3642
|
+
const _responseText = response.data;
|
|
3643
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
3644
|
+
}
|
|
3645
|
+
return Promise.resolve(null);
|
|
3646
|
+
}
|
|
3552
3647
|
}
|
|
3553
3648
|
export class DesignAtomsViewerApiClient extends ApiClientBase {
|
|
3554
3649
|
instance;
|
|
@@ -5239,14 +5334,14 @@ export class DesignAtomsViewerApiClient extends ApiClientBase {
|
|
|
5239
5334
|
return Promise.resolve(null);
|
|
5240
5335
|
}
|
|
5241
5336
|
}
|
|
5242
|
-
/**
|
|
5243
|
-
export var
|
|
5244
|
-
(function (
|
|
5245
|
-
|
|
5246
|
-
|
|
5247
|
-
|
|
5248
|
-
|
|
5249
|
-
})(
|
|
5337
|
+
/** Image preview file format. */
|
|
5338
|
+
export var ImagePreviewFormat;
|
|
5339
|
+
(function (ImagePreviewFormat) {
|
|
5340
|
+
ImagePreviewFormat["Jpeg"] = "Jpeg";
|
|
5341
|
+
ImagePreviewFormat["Png"] = "Png";
|
|
5342
|
+
ImagePreviewFormat["Tiff"] = "Tiff";
|
|
5343
|
+
ImagePreviewFormat["Pdf"] = "Pdf";
|
|
5344
|
+
})(ImagePreviewFormat || (ImagePreviewFormat = {}));
|
|
5250
5345
|
export var DesignElementType;
|
|
5251
5346
|
(function (DesignElementType) {
|
|
5252
5347
|
DesignElementType["Product"] = "Product";
|
|
@@ -5282,6 +5377,14 @@ export var ItemSourceType;
|
|
|
5282
5377
|
ItemSourceType["ImageStorage"] = "ImageStorage";
|
|
5283
5378
|
ItemSourceType["PrivateImageStorage"] = "PrivateImageStorage";
|
|
5284
5379
|
})(ItemSourceType || (ItemSourceType = {}));
|
|
5380
|
+
/** Product preview file format. */
|
|
5381
|
+
export var ProductPreviewFormat;
|
|
5382
|
+
(function (ProductPreviewFormat) {
|
|
5383
|
+
ProductPreviewFormat["Jpeg"] = "Jpeg";
|
|
5384
|
+
ProductPreviewFormat["Png"] = "Png";
|
|
5385
|
+
ProductPreviewFormat["Tiff"] = "Tiff";
|
|
5386
|
+
ProductPreviewFormat["Pdf"] = "Pdf";
|
|
5387
|
+
})(ProductPreviewFormat || (ProductPreviewFormat = {}));
|
|
5285
5388
|
export var ProductProofFormat;
|
|
5286
5389
|
(function (ProductProofFormat) {
|
|
5287
5390
|
ProductProofFormat["Jpeg"] = "Jpeg";
|