@aurigma/axios-design-atoms-api-client 2.39.5 → 2.41.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.
@@ -53,6 +53,16 @@ export interface IDesignAtomsCompatibilityApiClient {
53
53
  * @return Success
54
54
  */
55
55
  fonts(tenantId: number, psName: string | null): Promise<FileResponse>;
56
+ /**
57
+ * @param body (optional)
58
+ * @return Success
59
+ */
60
+ getColorPreview(tenantId: number, body?: GetColorPreviewRequest | null | undefined): Promise<any>;
61
+ /**
62
+ * @param body (optional)
63
+ * @return Success
64
+ */
65
+ getColorPreviews(tenantId: number, body?: GetColorPreviewsRequest | null | undefined): Promise<GetColorPreviewsResponse>;
56
66
  /**
57
67
  * @param fontKey (optional)
58
68
  * @return Success
@@ -193,6 +203,18 @@ export declare class DesignAtomsCompatibilityApiClient extends ApiClientBase imp
193
203
  */
194
204
  fonts(tenantId: number, psName: string | null, cancelToken?: CancelToken | undefined): Promise<FileResponse>;
195
205
  protected processFonts(response: AxiosResponse): Promise<FileResponse>;
206
+ /**
207
+ * @param body (optional)
208
+ * @return Success
209
+ */
210
+ getColorPreview(tenantId: number, body?: GetColorPreviewRequest | null | undefined, cancelToken?: CancelToken | undefined): Promise<any>;
211
+ protected processGetColorPreview(response: AxiosResponse): Promise<any>;
212
+ /**
213
+ * @param body (optional)
214
+ * @return Success
215
+ */
216
+ getColorPreviews(tenantId: number, body?: GetColorPreviewsRequest | null | undefined, cancelToken?: CancelToken | undefined): Promise<GetColorPreviewsResponse>;
217
+ protected processGetColorPreviews(response: AxiosResponse): Promise<GetColorPreviewsResponse>;
196
218
  /**
197
219
  * @param fontKey (optional)
198
220
  * @return Success
@@ -816,6 +838,18 @@ export interface IDesignAtomsViewerApiClient {
816
838
  * @return Success
817
839
  */
818
840
  fonts(psName: string | null, tenantId?: number | undefined): Promise<FileResponse>;
841
+ /**
842
+ * @param tenantId (optional) Tenant identifier
843
+ * @param body (optional)
844
+ * @return Success
845
+ */
846
+ getColorPreview(tenantId?: number | undefined, body?: GetColorPreviewRequest | null | undefined): Promise<any>;
847
+ /**
848
+ * @param tenantId (optional) Tenant identifier
849
+ * @param body (optional)
850
+ * @return Success
851
+ */
852
+ getColorPreviews(tenantId?: number | undefined, body?: GetColorPreviewsRequest | null | undefined): Promise<GetColorPreviewsResponse>;
819
853
  /**
820
854
  * @param fontKey (optional)
821
855
  * @param tenantId (optional) Tenant identifier
@@ -980,6 +1014,20 @@ export declare class DesignAtomsViewerApiClient extends ApiClientBase implements
980
1014
  */
981
1015
  fonts(psName: string | null, tenantId?: number | undefined, cancelToken?: CancelToken | undefined): Promise<FileResponse>;
982
1016
  protected processFonts(response: AxiosResponse): Promise<FileResponse>;
1017
+ /**
1018
+ * @param tenantId (optional) Tenant identifier
1019
+ * @param body (optional)
1020
+ * @return Success
1021
+ */
1022
+ getColorPreview(tenantId?: number | undefined, body?: GetColorPreviewRequest | null | undefined, cancelToken?: CancelToken | undefined): Promise<any>;
1023
+ protected processGetColorPreview(response: AxiosResponse): Promise<any>;
1024
+ /**
1025
+ * @param tenantId (optional) Tenant identifier
1026
+ * @param body (optional)
1027
+ * @return Success
1028
+ */
1029
+ getColorPreviews(tenantId?: number | undefined, body?: GetColorPreviewsRequest | null | undefined, cancelToken?: CancelToken | undefined): Promise<GetColorPreviewsResponse>;
1030
+ protected processGetColorPreviews(response: AxiosResponse): Promise<GetColorPreviewsResponse>;
983
1031
  /**
984
1032
  * @param fontKey (optional)
985
1033
  * @param tenantId (optional) Tenant identifier
@@ -1171,6 +1219,30 @@ export interface FontsMethodData {
1171
1219
  advancedMode?: boolean;
1172
1220
  baseUrl?: string | null;
1173
1221
  }
1222
+ export interface GetColorPreviewRequest {
1223
+ colorData?: any | null;
1224
+ }
1225
+ export interface GetColorPreviewsRequest {
1226
+ colorData?: any | null;
1227
+ }
1228
+ export declare enum ColorSpace {
1229
+ Rgb = "Rgb",
1230
+ Cmyk = "Cmyk",
1231
+ Grayscale = "Grayscale",
1232
+ Lab = "Lab",
1233
+ Spot = "Spot"
1234
+ }
1235
+ export interface RgbColor {
1236
+ readonly colorSpace?: ColorSpace;
1237
+ r?: number;
1238
+ g?: number;
1239
+ b?: number;
1240
+ alpha?: number;
1241
+ profile?: string | null;
1242
+ }
1243
+ export interface GetColorPreviewsResponse {
1244
+ previews?: RgbColor[] | null;
1245
+ }
1174
1246
  export interface GetImageSizeRequest {
1175
1247
  imageId?: string | null;
1176
1248
  pageIndex?: 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.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;
11
+ exports.ApiException = exports.ProductProofInterpolationMode = exports.ProductProofFormat = exports.ProductPreviewFormat = exports.ItemSourceType = exports.ItemType = exports.PlaceholderItemContentType = exports.ProductPatchType = exports.DesignElementType = exports.ImagePreviewFormat = exports.ColorSpace = 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;
@@ -318,6 +318,134 @@ class DesignAtomsCompatibilityApiClient extends ApiClientBase {
318
318
  }
319
319
  return Promise.resolve(null);
320
320
  }
321
+ /**
322
+ * @param body (optional)
323
+ * @return Success
324
+ */
325
+ getColorPreview(tenantId, body, cancelToken) {
326
+ let url_ = this.baseUrl + "/api/atoms/v1/tenants/{tenantId}/api/ccviewer/GetColorPreview";
327
+ if (tenantId === undefined || tenantId === null)
328
+ throw new Error("The parameter 'tenantId' must be defined.");
329
+ url_ = url_.replace("{tenantId}", encodeURIComponent("" + tenantId));
330
+ url_ = url_.replace(/[?&]$/, "");
331
+ const content_ = JSON.stringify(body);
332
+ let options_ = {
333
+ data: content_,
334
+ method: "POST",
335
+ url: url_,
336
+ headers: {
337
+ "Content-Type": "application/json",
338
+ "Accept": "application/json"
339
+ },
340
+ cancelToken
341
+ };
342
+ return this.transformOptions(options_).then(transformedOptions_ => {
343
+ return this.instance.request(transformedOptions_);
344
+ }).catch((_error) => {
345
+ if (isAxiosError(_error) && _error.response) {
346
+ return _error.response;
347
+ }
348
+ else {
349
+ throw _error;
350
+ }
351
+ }).then((_response) => {
352
+ return this.transformResult(url_, _response, (_response) => this.processGetColorPreview(_response));
353
+ });
354
+ }
355
+ processGetColorPreview(response) {
356
+ const status = response.status;
357
+ let _headers = {};
358
+ if (response.headers && typeof response.headers === "object") {
359
+ for (let k in response.headers) {
360
+ if (response.headers.hasOwnProperty(k)) {
361
+ _headers[k] = response.headers[k];
362
+ }
363
+ }
364
+ }
365
+ if (status === 200) {
366
+ const _responseText = response.data;
367
+ let result200 = null;
368
+ let resultData200 = _responseText;
369
+ result200 = JSON.parse(resultData200);
370
+ return Promise.resolve(result200);
371
+ }
372
+ else if (status === 500) {
373
+ const _responseText = response.data;
374
+ let result500 = null;
375
+ let resultData500 = _responseText;
376
+ result500 = JSON.parse(resultData500);
377
+ return throwException("Internal server error", status, _responseText, _headers, result500);
378
+ }
379
+ else if (status !== 200 && status !== 204) {
380
+ const _responseText = response.data;
381
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
382
+ }
383
+ return Promise.resolve(null);
384
+ }
385
+ /**
386
+ * @param body (optional)
387
+ * @return Success
388
+ */
389
+ getColorPreviews(tenantId, body, cancelToken) {
390
+ let url_ = this.baseUrl + "/api/atoms/v1/tenants/{tenantId}/api/ccviewer/GetColorPreviews";
391
+ if (tenantId === undefined || tenantId === null)
392
+ throw new Error("The parameter 'tenantId' must be defined.");
393
+ url_ = url_.replace("{tenantId}", encodeURIComponent("" + tenantId));
394
+ url_ = url_.replace(/[?&]$/, "");
395
+ const content_ = JSON.stringify(body);
396
+ let options_ = {
397
+ data: content_,
398
+ method: "POST",
399
+ url: url_,
400
+ headers: {
401
+ "Content-Type": "application/json",
402
+ "Accept": "application/json"
403
+ },
404
+ cancelToken
405
+ };
406
+ return this.transformOptions(options_).then(transformedOptions_ => {
407
+ return this.instance.request(transformedOptions_);
408
+ }).catch((_error) => {
409
+ if (isAxiosError(_error) && _error.response) {
410
+ return _error.response;
411
+ }
412
+ else {
413
+ throw _error;
414
+ }
415
+ }).then((_response) => {
416
+ return this.transformResult(url_, _response, (_response) => this.processGetColorPreviews(_response));
417
+ });
418
+ }
419
+ processGetColorPreviews(response) {
420
+ const status = response.status;
421
+ let _headers = {};
422
+ if (response.headers && typeof response.headers === "object") {
423
+ for (let k in response.headers) {
424
+ if (response.headers.hasOwnProperty(k)) {
425
+ _headers[k] = response.headers[k];
426
+ }
427
+ }
428
+ }
429
+ if (status === 200) {
430
+ const _responseText = response.data;
431
+ let result200 = null;
432
+ let resultData200 = _responseText;
433
+ result200 = JSON.parse(resultData200);
434
+ return Promise.resolve(result200);
435
+ }
436
+ else if (status === 500) {
437
+ const _responseText = response.data;
438
+ let result500 = null;
439
+ let resultData500 = _responseText;
440
+ result500 = JSON.parse(resultData500);
441
+ return throwException("Internal server error", status, _responseText, _headers, result500);
442
+ }
443
+ else if (status !== 200 && status !== 204) {
444
+ const _responseText = response.data;
445
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
446
+ }
447
+ return Promise.resolve(null);
448
+ }
321
449
  /**
322
450
  * @param fontKey (optional)
323
451
  * @return Success
@@ -3990,6 +4118,138 @@ class DesignAtomsViewerApiClient extends ApiClientBase {
3990
4118
  }
3991
4119
  return Promise.resolve(null);
3992
4120
  }
4121
+ /**
4122
+ * @param tenantId (optional) Tenant identifier
4123
+ * @param body (optional)
4124
+ * @return Success
4125
+ */
4126
+ getColorPreview(tenantId, body, cancelToken) {
4127
+ let url_ = this.baseUrl + "/api/atoms/v1/ccviewer/GetColorPreview?";
4128
+ if (tenantId === null)
4129
+ throw new Error("The parameter 'tenantId' cannot be null.");
4130
+ else if (tenantId !== undefined)
4131
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
4132
+ url_ = url_.replace(/[?&]$/, "");
4133
+ const content_ = JSON.stringify(body);
4134
+ let options_ = {
4135
+ data: content_,
4136
+ method: "POST",
4137
+ url: url_,
4138
+ headers: {
4139
+ "Content-Type": "application/json",
4140
+ "Accept": "application/json"
4141
+ },
4142
+ cancelToken
4143
+ };
4144
+ return this.transformOptions(options_).then(transformedOptions_ => {
4145
+ return this.instance.request(transformedOptions_);
4146
+ }).catch((_error) => {
4147
+ if (isAxiosError(_error) && _error.response) {
4148
+ return _error.response;
4149
+ }
4150
+ else {
4151
+ throw _error;
4152
+ }
4153
+ }).then((_response) => {
4154
+ return this.transformResult(url_, _response, (_response) => this.processGetColorPreview(_response));
4155
+ });
4156
+ }
4157
+ processGetColorPreview(response) {
4158
+ const status = response.status;
4159
+ let _headers = {};
4160
+ if (response.headers && typeof response.headers === "object") {
4161
+ for (let k in response.headers) {
4162
+ if (response.headers.hasOwnProperty(k)) {
4163
+ _headers[k] = response.headers[k];
4164
+ }
4165
+ }
4166
+ }
4167
+ if (status === 200) {
4168
+ const _responseText = response.data;
4169
+ let result200 = null;
4170
+ let resultData200 = _responseText;
4171
+ result200 = JSON.parse(resultData200);
4172
+ return Promise.resolve(result200);
4173
+ }
4174
+ else if (status === 500) {
4175
+ const _responseText = response.data;
4176
+ let result500 = null;
4177
+ let resultData500 = _responseText;
4178
+ result500 = JSON.parse(resultData500);
4179
+ return throwException("Internal server error", status, _responseText, _headers, result500);
4180
+ }
4181
+ else if (status !== 200 && status !== 204) {
4182
+ const _responseText = response.data;
4183
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
4184
+ }
4185
+ return Promise.resolve(null);
4186
+ }
4187
+ /**
4188
+ * @param tenantId (optional) Tenant identifier
4189
+ * @param body (optional)
4190
+ * @return Success
4191
+ */
4192
+ getColorPreviews(tenantId, body, cancelToken) {
4193
+ let url_ = this.baseUrl + "/api/atoms/v1/ccviewer/GetColorPreviews?";
4194
+ if (tenantId === null)
4195
+ throw new Error("The parameter 'tenantId' cannot be null.");
4196
+ else if (tenantId !== undefined)
4197
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
4198
+ url_ = url_.replace(/[?&]$/, "");
4199
+ const content_ = JSON.stringify(body);
4200
+ let options_ = {
4201
+ data: content_,
4202
+ method: "POST",
4203
+ url: url_,
4204
+ headers: {
4205
+ "Content-Type": "application/json",
4206
+ "Accept": "application/json"
4207
+ },
4208
+ cancelToken
4209
+ };
4210
+ return this.transformOptions(options_).then(transformedOptions_ => {
4211
+ return this.instance.request(transformedOptions_);
4212
+ }).catch((_error) => {
4213
+ if (isAxiosError(_error) && _error.response) {
4214
+ return _error.response;
4215
+ }
4216
+ else {
4217
+ throw _error;
4218
+ }
4219
+ }).then((_response) => {
4220
+ return this.transformResult(url_, _response, (_response) => this.processGetColorPreviews(_response));
4221
+ });
4222
+ }
4223
+ processGetColorPreviews(response) {
4224
+ const status = response.status;
4225
+ let _headers = {};
4226
+ if (response.headers && typeof response.headers === "object") {
4227
+ for (let k in response.headers) {
4228
+ if (response.headers.hasOwnProperty(k)) {
4229
+ _headers[k] = response.headers[k];
4230
+ }
4231
+ }
4232
+ }
4233
+ if (status === 200) {
4234
+ const _responseText = response.data;
4235
+ let result200 = null;
4236
+ let resultData200 = _responseText;
4237
+ result200 = JSON.parse(resultData200);
4238
+ return Promise.resolve(result200);
4239
+ }
4240
+ else if (status === 500) {
4241
+ const _responseText = response.data;
4242
+ let result500 = null;
4243
+ let resultData500 = _responseText;
4244
+ result500 = JSON.parse(resultData500);
4245
+ return throwException("Internal server error", status, _responseText, _headers, result500);
4246
+ }
4247
+ else if (status !== 200 && status !== 204) {
4248
+ const _responseText = response.data;
4249
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
4250
+ }
4251
+ return Promise.resolve(null);
4252
+ }
3993
4253
  /**
3994
4254
  * @param fontKey (optional)
3995
4255
  * @param tenantId (optional) Tenant identifier
@@ -5533,6 +5793,14 @@ class DesignAtomsViewerApiClient extends ApiClientBase {
5533
5793
  }
5534
5794
  }
5535
5795
  exports.DesignAtomsViewerApiClient = DesignAtomsViewerApiClient;
5796
+ var ColorSpace;
5797
+ (function (ColorSpace) {
5798
+ ColorSpace["Rgb"] = "Rgb";
5799
+ ColorSpace["Cmyk"] = "Cmyk";
5800
+ ColorSpace["Grayscale"] = "Grayscale";
5801
+ ColorSpace["Lab"] = "Lab";
5802
+ ColorSpace["Spot"] = "Spot";
5803
+ })(ColorSpace = exports.ColorSpace || (exports.ColorSpace = {}));
5536
5804
  /** Image preview file format. */
5537
5805
  var ImagePreviewFormat;
5538
5806
  (function (ImagePreviewFormat) {