@aurigma/axios-design-atoms-api-client 2.44.1 → 2.48.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.
@@ -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.ColorSpace = 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.ImagePreviewFitMode = 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;
@@ -63,7 +63,7 @@ class BuildInfoApiClient extends ApiClientBase {
63
63
  this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : this.getBaseUrl("");
64
64
  }
65
65
  /**
66
- * Gets assembly build info
66
+ * Get assembly build info.
67
67
  * @return Success
68
68
  */
69
69
  headInfo(cancelToken) {
@@ -116,7 +116,7 @@ class BuildInfoApiClient extends ApiClientBase {
116
116
  return Promise.resolve(null);
117
117
  }
118
118
  /**
119
- * Gets assembly build info
119
+ * Get assembly build info.
120
120
  * @return Success
121
121
  */
122
122
  getInfo(cancelToken) {
@@ -785,9 +785,11 @@ class DesignAtomsCompatibilityApiClient extends ApiClientBase {
785
785
  * @param alphaMask (optional)
786
786
  * @param page (optional)
787
787
  * @param colorizeColor (optional)
788
+ * @param rw (optional)
789
+ * @param rh (optional)
788
790
  * @return Success
789
791
  */
790
- img(tenantId, f, w, h, cmyk, rgb, grayscale, target, sq, effect, kp, color, obm, oo, alphaMask, page, colorizeColor, cancelToken) {
792
+ img(tenantId, f, w, h, cmyk, rgb, grayscale, target, sq, effect, kp, color, obm, oo, alphaMask, page, colorizeColor, rw, rh, cancelToken) {
791
793
  let url_ = this.baseUrl + "/api/atoms/v1/tenants/{tenantId}/api/ccviewer/img?";
792
794
  if (tenantId === undefined || tenantId === null)
793
795
  throw new Error("The parameter 'tenantId' must be defined.");
@@ -824,6 +826,10 @@ class DesignAtomsCompatibilityApiClient extends ApiClientBase {
824
826
  url_ += "page=" + encodeURIComponent("" + page) + "&";
825
827
  if (colorizeColor !== undefined && colorizeColor !== null)
826
828
  url_ += "colorizeColor=" + encodeURIComponent("" + colorizeColor) + "&";
829
+ if (rw !== undefined && rw !== null)
830
+ url_ += "rw=" + encodeURIComponent("" + rw) + "&";
831
+ if (rh !== undefined && rh !== null)
832
+ url_ += "rh=" + encodeURIComponent("" + rh) + "&";
827
833
  url_ = url_.replace(/[?&]$/, "");
828
834
  let options_ = {
829
835
  responseType: "blob",
@@ -1093,15 +1099,66 @@ class DesignAtomsCompatibilityApiClient extends ApiClientBase {
1093
1099
  }
1094
1100
  /**
1095
1101
  * @param f (optional)
1102
+ * @param w (optional)
1103
+ * @param h (optional)
1104
+ * @param cmyk (optional)
1105
+ * @param rgb (optional)
1106
+ * @param grayscale (optional)
1107
+ * @param target (optional)
1108
+ * @param sq (optional)
1109
+ * @param effect (optional)
1110
+ * @param kp (optional)
1111
+ * @param color (optional)
1112
+ * @param obm (optional)
1113
+ * @param oo (optional)
1114
+ * @param alphaMask (optional)
1115
+ * @param page (optional)
1116
+ * @param colorizeColor (optional)
1117
+ * @param rw (optional)
1118
+ * @param rh (optional)
1096
1119
  * @return Success
1097
1120
  */
1098
- svg(tenantId, f, cancelToken) {
1121
+ svg(tenantId, f, w, h, cmyk, rgb, grayscale, target, sq, effect, kp, color, obm, oo, alphaMask, page, colorizeColor, rw, rh, cancelToken) {
1099
1122
  let url_ = this.baseUrl + "/api/atoms/v1/tenants/{tenantId}/api/ccviewer/svg?";
1100
1123
  if (tenantId === undefined || tenantId === null)
1101
1124
  throw new Error("The parameter 'tenantId' must be defined.");
1102
1125
  url_ = url_.replace("{tenantId}", encodeURIComponent("" + tenantId));
1103
1126
  if (f !== undefined && f !== null)
1104
1127
  url_ += "f=" + encodeURIComponent("" + f) + "&";
1128
+ if (w !== undefined && w !== null)
1129
+ url_ += "w=" + encodeURIComponent("" + w) + "&";
1130
+ if (h !== undefined && h !== null)
1131
+ url_ += "h=" + encodeURIComponent("" + h) + "&";
1132
+ if (cmyk !== undefined && cmyk !== null)
1133
+ url_ += "cmyk=" + encodeURIComponent("" + cmyk) + "&";
1134
+ if (rgb !== undefined && rgb !== null)
1135
+ url_ += "rgb=" + encodeURIComponent("" + rgb) + "&";
1136
+ if (grayscale !== undefined && grayscale !== null)
1137
+ url_ += "grayscale=" + encodeURIComponent("" + grayscale) + "&";
1138
+ if (target !== undefined && target !== null)
1139
+ url_ += "target=" + encodeURIComponent("" + target) + "&";
1140
+ if (sq !== undefined && sq !== null)
1141
+ url_ += "sq=" + encodeURIComponent("" + sq) + "&";
1142
+ if (effect !== undefined && effect !== null)
1143
+ url_ += "effect=" + encodeURIComponent("" + effect) + "&";
1144
+ if (kp !== undefined && kp !== null)
1145
+ url_ += "kp=" + encodeURIComponent("" + kp) + "&";
1146
+ if (color !== undefined && color !== null)
1147
+ url_ += "color=" + encodeURIComponent("" + color) + "&";
1148
+ if (obm !== undefined && obm !== null)
1149
+ url_ += "obm=" + encodeURIComponent("" + obm) + "&";
1150
+ if (oo !== undefined && oo !== null)
1151
+ url_ += "oo=" + encodeURIComponent("" + oo) + "&";
1152
+ if (alphaMask !== undefined && alphaMask !== null)
1153
+ url_ += "alphaMask=" + encodeURIComponent("" + alphaMask) + "&";
1154
+ if (page !== undefined && page !== null)
1155
+ url_ += "page=" + encodeURIComponent("" + page) + "&";
1156
+ if (colorizeColor !== undefined && colorizeColor !== null)
1157
+ url_ += "colorizeColor=" + encodeURIComponent("" + colorizeColor) + "&";
1158
+ if (rw !== undefined && rw !== null)
1159
+ url_ += "rw=" + encodeURIComponent("" + rw) + "&";
1160
+ if (rh !== undefined && rh !== null)
1161
+ url_ += "rh=" + encodeURIComponent("" + rh) + "&";
1105
1162
  url_ = url_.replace(/[?&]$/, "");
1106
1163
  let options_ = {
1107
1164
  responseType: "blob",
@@ -2872,6 +2929,91 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
2872
2929
  }
2873
2930
  return Promise.resolve(null);
2874
2931
  }
2932
+ /**
2933
+ * Returns design parameters stored in product model.
2934
+ * @param id Design identifier.
2935
+ * @param privateStorageOwner (optional) Private storage owner identifier.
2936
+ * @param tenantId (optional) Tenant identifier
2937
+ * @return Success
2938
+ */
2939
+ getDesignParameters(id, privateStorageOwner, tenantId, cancelToken) {
2940
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/parameters?";
2941
+ if (id === undefined || id === null)
2942
+ throw new Error("The parameter 'id' must be defined.");
2943
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
2944
+ if (privateStorageOwner !== undefined && privateStorageOwner !== null)
2945
+ url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
2946
+ if (tenantId === null)
2947
+ throw new Error("The parameter 'tenantId' cannot be null.");
2948
+ else if (tenantId !== undefined)
2949
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
2950
+ url_ = url_.replace(/[?&]$/, "");
2951
+ let options_ = {
2952
+ method: "GET",
2953
+ url: url_,
2954
+ headers: {
2955
+ "Accept": "application/json"
2956
+ },
2957
+ cancelToken
2958
+ };
2959
+ return this.transformOptions(options_).then(transformedOptions_ => {
2960
+ return this.instance.request(transformedOptions_);
2961
+ }).catch((_error) => {
2962
+ if (isAxiosError(_error) && _error.response) {
2963
+ return _error.response;
2964
+ }
2965
+ else {
2966
+ throw _error;
2967
+ }
2968
+ }).then((_response) => {
2969
+ return this.transformResult(url_, _response, (_response) => this.processGetDesignParameters(_response));
2970
+ });
2971
+ }
2972
+ processGetDesignParameters(response) {
2973
+ const status = response.status;
2974
+ let _headers = {};
2975
+ if (response.headers && typeof response.headers === "object") {
2976
+ for (let k in response.headers) {
2977
+ if (response.headers.hasOwnProperty(k)) {
2978
+ _headers[k] = response.headers[k];
2979
+ }
2980
+ }
2981
+ }
2982
+ if (status === 200) {
2983
+ const _responseText = response.data;
2984
+ let result200 = null;
2985
+ let resultData200 = _responseText;
2986
+ result200 = JSON.parse(resultData200);
2987
+ return Promise.resolve(result200);
2988
+ }
2989
+ else if (status === 404) {
2990
+ const _responseText = response.data;
2991
+ let result404 = null;
2992
+ let resultData404 = _responseText;
2993
+ result404 = JSON.parse(resultData404);
2994
+ return throwException("Not Found", status, _responseText, _headers, result404);
2995
+ }
2996
+ else if (status === 401) {
2997
+ const _responseText = response.data;
2998
+ return throwException("Unauthorized", status, _responseText, _headers);
2999
+ }
3000
+ else if (status === 403) {
3001
+ const _responseText = response.data;
3002
+ return throwException("Forbidden", status, _responseText, _headers);
3003
+ }
3004
+ else if (status === 500) {
3005
+ const _responseText = response.data;
3006
+ let result500 = null;
3007
+ let resultData500 = _responseText;
3008
+ result500 = JSON.parse(resultData500);
3009
+ return throwException("Internal server error", status, _responseText, _headers, result500);
3010
+ }
3011
+ else if (status !== 200 && status !== 204) {
3012
+ const _responseText = response.data;
3013
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
3014
+ }
3015
+ return Promise.resolve(null);
3016
+ }
2875
3017
  /**
2876
3018
  * Loads data schema from design file taken from storage
2877
3019
  * @param id Design identifier
@@ -4697,10 +4839,12 @@ class DesignAtomsViewerApiClient extends ApiClientBase {
4697
4839
  * @param alphaMask (optional)
4698
4840
  * @param page (optional)
4699
4841
  * @param colorizeColor (optional)
4842
+ * @param rw (optional)
4843
+ * @param rh (optional)
4700
4844
  * @param tenantId (optional) Tenant identifier
4701
4845
  * @return Success
4702
4846
  */
4703
- img(f, w, h, cmyk, rgb, grayscale, target, sq, effect, kp, color, obm, oo, alphaMask, page, colorizeColor, tenantId, cancelToken) {
4847
+ img(f, w, h, cmyk, rgb, grayscale, target, sq, effect, kp, color, obm, oo, alphaMask, page, colorizeColor, rw, rh, tenantId, cancelToken) {
4704
4848
  let url_ = this.baseUrl + "/api/atoms/v1/ccviewer/img?";
4705
4849
  if (f !== undefined && f !== null)
4706
4850
  url_ += "f=" + encodeURIComponent("" + f) + "&";
@@ -4734,6 +4878,10 @@ class DesignAtomsViewerApiClient extends ApiClientBase {
4734
4878
  url_ += "page=" + encodeURIComponent("" + page) + "&";
4735
4879
  if (colorizeColor !== undefined && colorizeColor !== null)
4736
4880
  url_ += "colorizeColor=" + encodeURIComponent("" + colorizeColor) + "&";
4881
+ if (rw !== undefined && rw !== null)
4882
+ url_ += "rw=" + encodeURIComponent("" + rw) + "&";
4883
+ if (rh !== undefined && rh !== null)
4884
+ url_ += "rh=" + encodeURIComponent("" + rh) + "&";
4737
4885
  if (tenantId === null)
4738
4886
  throw new Error("The parameter 'tenantId' cannot be null.");
4739
4887
  else if (tenantId !== undefined)
@@ -5013,13 +5161,64 @@ class DesignAtomsViewerApiClient extends ApiClientBase {
5013
5161
  }
5014
5162
  /**
5015
5163
  * @param f (optional)
5164
+ * @param w (optional)
5165
+ * @param h (optional)
5166
+ * @param cmyk (optional)
5167
+ * @param rgb (optional)
5168
+ * @param grayscale (optional)
5169
+ * @param target (optional)
5170
+ * @param sq (optional)
5171
+ * @param effect (optional)
5172
+ * @param kp (optional)
5173
+ * @param color (optional)
5174
+ * @param obm (optional)
5175
+ * @param oo (optional)
5176
+ * @param alphaMask (optional)
5177
+ * @param page (optional)
5178
+ * @param colorizeColor (optional)
5179
+ * @param rw (optional)
5180
+ * @param rh (optional)
5016
5181
  * @param tenantId (optional) Tenant identifier
5017
5182
  * @return Success
5018
5183
  */
5019
- svg(f, tenantId, cancelToken) {
5184
+ svg(f, w, h, cmyk, rgb, grayscale, target, sq, effect, kp, color, obm, oo, alphaMask, page, colorizeColor, rw, rh, tenantId, cancelToken) {
5020
5185
  let url_ = this.baseUrl + "/api/atoms/v1/ccviewer/svg?";
5021
5186
  if (f !== undefined && f !== null)
5022
5187
  url_ += "f=" + encodeURIComponent("" + f) + "&";
5188
+ if (w !== undefined && w !== null)
5189
+ url_ += "w=" + encodeURIComponent("" + w) + "&";
5190
+ if (h !== undefined && h !== null)
5191
+ url_ += "h=" + encodeURIComponent("" + h) + "&";
5192
+ if (cmyk !== undefined && cmyk !== null)
5193
+ url_ += "cmyk=" + encodeURIComponent("" + cmyk) + "&";
5194
+ if (rgb !== undefined && rgb !== null)
5195
+ url_ += "rgb=" + encodeURIComponent("" + rgb) + "&";
5196
+ if (grayscale !== undefined && grayscale !== null)
5197
+ url_ += "grayscale=" + encodeURIComponent("" + grayscale) + "&";
5198
+ if (target !== undefined && target !== null)
5199
+ url_ += "target=" + encodeURIComponent("" + target) + "&";
5200
+ if (sq !== undefined && sq !== null)
5201
+ url_ += "sq=" + encodeURIComponent("" + sq) + "&";
5202
+ if (effect !== undefined && effect !== null)
5203
+ url_ += "effect=" + encodeURIComponent("" + effect) + "&";
5204
+ if (kp !== undefined && kp !== null)
5205
+ url_ += "kp=" + encodeURIComponent("" + kp) + "&";
5206
+ if (color !== undefined && color !== null)
5207
+ url_ += "color=" + encodeURIComponent("" + color) + "&";
5208
+ if (obm !== undefined && obm !== null)
5209
+ url_ += "obm=" + encodeURIComponent("" + obm) + "&";
5210
+ if (oo !== undefined && oo !== null)
5211
+ url_ += "oo=" + encodeURIComponent("" + oo) + "&";
5212
+ if (alphaMask !== undefined && alphaMask !== null)
5213
+ url_ += "alphaMask=" + encodeURIComponent("" + alphaMask) + "&";
5214
+ if (page !== undefined && page !== null)
5215
+ url_ += "page=" + encodeURIComponent("" + page) + "&";
5216
+ if (colorizeColor !== undefined && colorizeColor !== null)
5217
+ url_ += "colorizeColor=" + encodeURIComponent("" + colorizeColor) + "&";
5218
+ if (rw !== undefined && rw !== null)
5219
+ url_ += "rw=" + encodeURIComponent("" + rw) + "&";
5220
+ if (rh !== undefined && rh !== null)
5221
+ url_ += "rh=" + encodeURIComponent("" + rh) + "&";
5023
5222
  if (tenantId === null)
5024
5223
  throw new Error("The parameter 'tenantId' cannot be null.");
5025
5224
  else if (tenantId !== undefined)
@@ -5904,9 +6103,15 @@ var ImagePreviewFormat;
5904
6103
  (function (ImagePreviewFormat) {
5905
6104
  ImagePreviewFormat["Jpeg"] = "Jpeg";
5906
6105
  ImagePreviewFormat["Png"] = "Png";
5907
- ImagePreviewFormat["Tiff"] = "Tiff";
5908
- ImagePreviewFormat["Pdf"] = "Pdf";
5909
6106
  })(ImagePreviewFormat = exports.ImagePreviewFormat || (exports.ImagePreviewFormat = {}));
6107
+ /** Image preview fit mode. */
6108
+ var ImagePreviewFitMode;
6109
+ (function (ImagePreviewFitMode) {
6110
+ ImagePreviewFitMode["Fit"] = "Fit";
6111
+ ImagePreviewFitMode["Shrink"] = "Shrink";
6112
+ ImagePreviewFitMode["Resize"] = "Resize";
6113
+ ImagePreviewFitMode["Fill"] = "Fill";
6114
+ })(ImagePreviewFitMode = exports.ImagePreviewFitMode || (exports.ImagePreviewFitMode = {}));
5910
6115
  var DesignElementType;
5911
6116
  (function (DesignElementType) {
5912
6117
  DesignElementType["Product"] = "Product";
@@ -5947,8 +6152,6 @@ var ProductPreviewFormat;
5947
6152
  (function (ProductPreviewFormat) {
5948
6153
  ProductPreviewFormat["Jpeg"] = "Jpeg";
5949
6154
  ProductPreviewFormat["Png"] = "Png";
5950
- ProductPreviewFormat["Tiff"] = "Tiff";
5951
- ProductPreviewFormat["Pdf"] = "Pdf";
5952
6155
  })(ProductPreviewFormat = exports.ProductPreviewFormat || (exports.ProductPreviewFormat = {}));
5953
6156
  var ProductProofFormat;
5954
6157
  (function (ProductProofFormat) {