@aurigma/axios-design-atoms-api-client 2.74.1 → 2.76.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.
@@ -617,6 +617,33 @@ export declare class DesignAtomsImagesApiClient extends ApiClientBase implements
617
617
  renderImagePreviewToResource(tenantId?: number | undefined, body?: RenderImagePreviewToResourceModel | undefined, cancelToken?: CancelToken | undefined): Promise<ResourceInfoDto>;
618
618
  protected processRenderImagePreviewToResource(response: AxiosResponse): Promise<ResourceInfoDto>;
619
619
  }
620
+ export interface IDesignAtomsMockups2dApiClient {
621
+ /**
622
+ * Renders a mockup preview with the specified parameters.
623
+ * @param attachment (optional) If set to 'true', file will be provided as an attachment with unique filename supplied
624
+ (default value is 'false').
625
+ * @param tenantId (optional) Tenant ID.
626
+ * @param body (optional) Render model with preview parameters.
627
+ * @return Success
628
+ */
629
+ renderMockupPreview(attachment?: boolean | null | undefined, tenantId?: number | undefined, body?: RenderMockupPreviewModel | undefined): Promise<FileResponse>;
630
+ }
631
+ export declare class DesignAtomsMockups2dApiClient extends ApiClientBase implements IDesignAtomsMockups2dApiClient {
632
+ private instance;
633
+ private baseUrl;
634
+ protected jsonParseReviver: ((key: string, value: any) => any) | undefined;
635
+ constructor(configuration: ApiClientConfiguration, baseUrl?: string, instance?: AxiosInstance);
636
+ /**
637
+ * Renders a mockup preview with the specified parameters.
638
+ * @param attachment (optional) If set to 'true', file will be provided as an attachment with unique filename supplied
639
+ (default value is 'false').
640
+ * @param tenantId (optional) Tenant ID.
641
+ * @param body (optional) Render model with preview parameters.
642
+ * @return Success
643
+ */
644
+ renderMockupPreview(attachment?: boolean | null | undefined, tenantId?: number | undefined, body?: RenderMockupPreviewModel | undefined, cancelToken?: CancelToken | undefined): Promise<FileResponse>;
645
+ protected processRenderMockupPreview(response: AxiosResponse): Promise<FileResponse>;
646
+ }
620
647
  export interface IDesignAtomsMockups3dApiClient {
621
648
  /**
622
649
  * Returns a 3D-Mockup attributes.
@@ -1797,11 +1824,11 @@ export interface IDesignAtomsServiceApiClient {
1797
1824
  * @param resourceId (optional) Resource identifier.
1798
1825
  * @param privateDesignId (optional) Private design identifier.
1799
1826
  * @param privateStorageOwner (optional) Private storage owner identifier.
1800
- * @param tenantIdQuery (optional) Tenant identifier.
1827
+ * @param tenantId (optional) Tenant ID.
1801
1828
  * @return Created
1802
1829
  * @deprecated
1803
1830
  */
1804
- createPrivateDesignFromResource(resourceId?: string | null | undefined, privateDesignId?: string | null | undefined, privateStorageOwner?: string | null | undefined, tenantIdQuery?: number | undefined): Promise<void>;
1831
+ createPrivateDesignFromResource(resourceId?: string | null | undefined, privateDesignId?: string | null | undefined, privateStorageOwner?: string | null | undefined, tenantId?: number | undefined): Promise<void>;
1805
1832
  }
1806
1833
  export declare class DesignAtomsServiceApiClient extends ApiClientBase implements IDesignAtomsServiceApiClient {
1807
1834
  private instance;
@@ -2069,11 +2096,11 @@ export declare class DesignAtomsServiceApiClient extends ApiClientBase implement
2069
2096
  * @param resourceId (optional) Resource identifier.
2070
2097
  * @param privateDesignId (optional) Private design identifier.
2071
2098
  * @param privateStorageOwner (optional) Private storage owner identifier.
2072
- * @param tenantIdQuery (optional) Tenant identifier.
2099
+ * @param tenantId (optional) Tenant ID.
2073
2100
  * @return Created
2074
2101
  * @deprecated
2075
2102
  */
2076
- createPrivateDesignFromResource(resourceId?: string | null | undefined, privateDesignId?: string | null | undefined, privateStorageOwner?: string | null | undefined, tenantIdQuery?: number | undefined, cancelToken?: CancelToken | undefined): Promise<void>;
2103
+ createPrivateDesignFromResource(resourceId?: string | null | undefined, privateDesignId?: string | null | undefined, privateStorageOwner?: string | null | undefined, tenantId?: number | undefined, cancelToken?: CancelToken | undefined): Promise<void>;
2077
2104
  protected processCreatePrivateDesignFromResource(response: AxiosResponse): Promise<void>;
2078
2105
  }
2079
2106
  export interface IDesignAtomsViewerApiClient {
@@ -2956,6 +2983,35 @@ export interface Mockup3dAttributesDto {
2956
2983
  [key: string]: string;
2957
2984
  } | null;
2958
2985
  }
2986
+ /** Mockup preview fitting mode. */
2987
+ export declare enum MockupPreviewFitMode {
2988
+ Fit = "Fit",
2989
+ Shrink = "Shrink",
2990
+ Resize = "Resize",
2991
+ Fill = "Fill"
2992
+ }
2993
+ /** Mockup preview file format. */
2994
+ export declare enum MockupPreviewFormat {
2995
+ Jpeg = "Jpeg",
2996
+ Png = "Png"
2997
+ }
2998
+ /** Settings that describe mockup preview rendering parameters. */
2999
+ export interface MockupPreviewRenderingConfig {
3000
+ /** Mockup preview width (in pixels). */
3001
+ width?: number;
3002
+ /** Mockup preview height (in pixels). */
3003
+ height?: number;
3004
+ /** Parameters of active group layers. Each group can have only one active layer.
3005
+ E.g. { "Group1: "Layer1", "Group2": "Layer2" }.
3006
+ If value is not set, all visible layers will be rendered. */
3007
+ groups?: {
3008
+ [key: string]: string;
3009
+ } | null;
3010
+ /** Mockup preview file format. */
3011
+ fileFormat?: MockupPreviewFormat | null;
3012
+ /** Mockup preview fit mode. */
3013
+ fitMode?: MockupPreviewFitMode | null;
3014
+ }
2959
3015
  export interface MultiCallRequest {
2960
3016
  items?: MultiCallRequestItem[] | null;
2961
3017
  }
@@ -3219,6 +3275,14 @@ export interface RenderImagePreviewToResourceModel {
3219
3275
  /** Image preview configuration. */
3220
3276
  renderingConfig?: ImagePreviewRenderingConfig | null;
3221
3277
  }
3278
+ export interface RenderMockupPreviewModel {
3279
+ /** Mockup identifier. */
3280
+ mockupId?: string | null;
3281
+ /** Storage image owner identifier. */
3282
+ ownerId?: string | null;
3283
+ /** Mockup preview configuration. */
3284
+ renderingConfig?: MockupPreviewRenderingConfig | null;
3285
+ }
3222
3286
  /** Render product parameters. */
3223
3287
  export interface RenderProductModel {
3224
3288
  /** Serialized product description. */
@@ -2537,6 +2537,102 @@ export class DesignAtomsImagesApiClient extends ApiClientBase {
2537
2537
  return Promise.resolve(null);
2538
2538
  }
2539
2539
  }
2540
+ export class DesignAtomsMockups2dApiClient extends ApiClientBase {
2541
+ instance;
2542
+ baseUrl;
2543
+ jsonParseReviver = undefined;
2544
+ constructor(configuration, baseUrl, instance) {
2545
+ super(configuration);
2546
+ this.instance = instance ? instance : axios.create();
2547
+ this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : this.getBaseUrl("");
2548
+ }
2549
+ /**
2550
+ * Renders a mockup preview with the specified parameters.
2551
+ * @param attachment (optional) If set to 'true', file will be provided as an attachment with unique filename supplied
2552
+ (default value is 'false').
2553
+ * @param tenantId (optional) Tenant ID.
2554
+ * @param body (optional) Render model with preview parameters.
2555
+ * @return Success
2556
+ */
2557
+ renderMockupPreview(attachment, tenantId, body, cancelToken) {
2558
+ let url_ = this.baseUrl + "/api/atoms/v1/mockups-2d/render-preview?";
2559
+ if (attachment !== undefined && attachment !== null)
2560
+ url_ += "attachment=" + encodeURIComponent("" + attachment) + "&";
2561
+ if (tenantId === null)
2562
+ throw new Error("The parameter 'tenantId' cannot be null.");
2563
+ else if (tenantId !== undefined)
2564
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
2565
+ url_ = url_.replace(/[?&]$/, "");
2566
+ const content_ = JSON.stringify(body);
2567
+ let options_ = {
2568
+ data: content_,
2569
+ responseType: "blob",
2570
+ method: "POST",
2571
+ url: url_,
2572
+ headers: {
2573
+ "Content-Type": "application/json",
2574
+ "Accept": "application/octet-stream"
2575
+ },
2576
+ cancelToken
2577
+ };
2578
+ return this.transformOptions(options_).then(transformedOptions_ => {
2579
+ return this.instance.request(transformedOptions_);
2580
+ }).catch((_error) => {
2581
+ if (isAxiosError(_error) && _error.response) {
2582
+ return _error.response;
2583
+ }
2584
+ else {
2585
+ throw _error;
2586
+ }
2587
+ }).then((_response) => {
2588
+ return this.transformResult(url_, _response, (_response) => this.processRenderMockupPreview(_response));
2589
+ });
2590
+ }
2591
+ processRenderMockupPreview(response) {
2592
+ const status = response.status;
2593
+ let _headers = {};
2594
+ if (response.headers && typeof response.headers === "object") {
2595
+ for (let k in response.headers) {
2596
+ if (response.headers.hasOwnProperty(k)) {
2597
+ _headers[k] = response.headers[k];
2598
+ }
2599
+ }
2600
+ }
2601
+ if (status === 200 || status === 206) {
2602
+ const contentDisposition = response.headers ? response.headers["content-disposition"] : undefined;
2603
+ const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
2604
+ const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
2605
+ return Promise.resolve({ fileName: fileName, status: status, data: new Blob([response.data]), headers: _headers });
2606
+ }
2607
+ else if (status === 404) {
2608
+ const _responseText = response.data;
2609
+ let result404 = null;
2610
+ let resultData404 = _responseText;
2611
+ result404 = JSON.parse(resultData404);
2612
+ return throwException("Not Found", status, _responseText, _headers, result404);
2613
+ }
2614
+ else if (status === 409) {
2615
+ const _responseText = response.data;
2616
+ let result409 = null;
2617
+ let resultData409 = _responseText;
2618
+ result409 = JSON.parse(resultData409);
2619
+ return throwException("Conflict", status, _responseText, _headers, result409);
2620
+ }
2621
+ else if (status === 401) {
2622
+ const _responseText = response.data;
2623
+ return throwException("Unauthorized", status, _responseText, _headers);
2624
+ }
2625
+ else if (status === 403) {
2626
+ const _responseText = response.data;
2627
+ return throwException("Forbidden", status, _responseText, _headers);
2628
+ }
2629
+ else if (status !== 200 && status !== 204) {
2630
+ const _responseText = response.data;
2631
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
2632
+ }
2633
+ return Promise.resolve(null);
2634
+ }
2635
+ }
2540
2636
  export class DesignAtomsMockups3dApiClient extends ApiClientBase {
2541
2637
  instance;
2542
2638
  baseUrl;
@@ -8865,11 +8961,11 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
8865
8961
  * @param resourceId (optional) Resource identifier.
8866
8962
  * @param privateDesignId (optional) Private design identifier.
8867
8963
  * @param privateStorageOwner (optional) Private storage owner identifier.
8868
- * @param tenantIdQuery (optional) Tenant identifier.
8964
+ * @param tenantId (optional) Tenant ID.
8869
8965
  * @return Created
8870
8966
  * @deprecated
8871
8967
  */
8872
- createPrivateDesignFromResource(resourceId, privateDesignId, privateStorageOwner, tenantIdQuery, cancelToken) {
8968
+ createPrivateDesignFromResource(resourceId, privateDesignId, privateStorageOwner, tenantId, cancelToken) {
8873
8969
  let url_ = this.baseUrl + "/api/atoms/v1/private-designs/from-resource?";
8874
8970
  if (resourceId !== undefined && resourceId !== null)
8875
8971
  url_ += "resourceId=" + encodeURIComponent("" + resourceId) + "&";
@@ -8877,10 +8973,10 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
8877
8973
  url_ += "privateDesignId=" + encodeURIComponent("" + privateDesignId) + "&";
8878
8974
  if (privateStorageOwner !== undefined && privateStorageOwner !== null)
8879
8975
  url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
8880
- if (tenantIdQuery === null)
8881
- throw new Error("The parameter 'tenantIdQuery' cannot be null.");
8882
- else if (tenantIdQuery !== undefined)
8883
- url_ += "tenantId=" + encodeURIComponent("" + tenantIdQuery) + "&";
8976
+ if (tenantId === null)
8977
+ throw new Error("The parameter 'tenantId' cannot be null.");
8978
+ else if (tenantId !== undefined)
8979
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
8884
8980
  url_ = url_.replace(/[?&]$/, "");
8885
8981
  let options_ = {
8886
8982
  method: "POST",
@@ -10837,6 +10933,20 @@ export var ItemType;
10837
10933
  ItemType["Clipart"] = "Clipart";
10838
10934
  ItemType["Group"] = "Group";
10839
10935
  })(ItemType || (ItemType = {}));
10936
+ /** Mockup preview fitting mode. */
10937
+ export var MockupPreviewFitMode;
10938
+ (function (MockupPreviewFitMode) {
10939
+ MockupPreviewFitMode["Fit"] = "Fit";
10940
+ MockupPreviewFitMode["Shrink"] = "Shrink";
10941
+ MockupPreviewFitMode["Resize"] = "Resize";
10942
+ MockupPreviewFitMode["Fill"] = "Fill";
10943
+ })(MockupPreviewFitMode || (MockupPreviewFitMode = {}));
10944
+ /** Mockup preview file format. */
10945
+ export var MockupPreviewFormat;
10946
+ (function (MockupPreviewFormat) {
10947
+ MockupPreviewFormat["Jpeg"] = "Jpeg";
10948
+ MockupPreviewFormat["Png"] = "Png";
10949
+ })(MockupPreviewFormat || (MockupPreviewFormat = {}));
10840
10950
  /** Placeholder item content type. */
10841
10951
  export var PlaceholderItemContentType;
10842
10952
  (function (PlaceholderItemContentType) {