@aurigma/axios-design-atoms-api-client 2.59.1 → 2.61.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.
@@ -565,6 +565,14 @@ export interface IDesignAtomsServiceApiClient {
565
565
  * @return Success
566
566
  */
567
567
  loadDataSchema(id: string | null, privateStorageOwner?: string | null | undefined, tenantId?: number | undefined): Promise<FileResponse>;
568
+ /**
569
+ * Loads toggle set from design file taken from storage.
570
+ * @param id Design identifier.
571
+ * @param privateStorageOwner (optional) Private storage owner identifier.
572
+ * @param tenantId (optional) Tenant identifier
573
+ * @return Success
574
+ */
575
+ loadToggleSet(id: string | null, privateStorageOwner?: string | null | undefined, tenantId?: number | undefined): Promise<FileResponse>;
568
576
  /**
569
577
  * Gets variable items information for design file taken from storage
570
578
  * @param id Design identifier
@@ -784,6 +792,15 @@ export declare class DesignAtomsServiceApiClient extends ApiClientBase implement
784
792
  */
785
793
  loadDataSchema(id: string | null, privateStorageOwner?: string | null | undefined, tenantId?: number | undefined, cancelToken?: CancelToken | undefined): Promise<FileResponse>;
786
794
  protected processLoadDataSchema(response: AxiosResponse): Promise<FileResponse>;
795
+ /**
796
+ * Loads toggle set from design file taken from storage.
797
+ * @param id Design identifier.
798
+ * @param privateStorageOwner (optional) Private storage owner identifier.
799
+ * @param tenantId (optional) Tenant identifier
800
+ * @return Success
801
+ */
802
+ loadToggleSet(id: string | null, privateStorageOwner?: string | null | undefined, tenantId?: number | undefined, cancelToken?: CancelToken | undefined): Promise<FileResponse>;
803
+ protected processLoadToggleSet(response: AxiosResponse): Promise<FileResponse>;
787
804
  /**
788
805
  * Gets variable items information for design file taken from storage
789
806
  * @param id Design identifier
@@ -3087,6 +3087,98 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
3087
3087
  }
3088
3088
  return Promise.resolve(null);
3089
3089
  }
3090
+ /**
3091
+ * Loads toggle set from design file taken from storage.
3092
+ * @param id Design identifier.
3093
+ * @param privateStorageOwner (optional) Private storage owner identifier.
3094
+ * @param tenantId (optional) Tenant identifier
3095
+ * @return Success
3096
+ */
3097
+ loadToggleSet(id, privateStorageOwner, tenantId, cancelToken) {
3098
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/toggle-set?";
3099
+ if (id === undefined || id === null)
3100
+ throw new Error("The parameter 'id' must be defined.");
3101
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
3102
+ if (privateStorageOwner !== undefined && privateStorageOwner !== null)
3103
+ url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
3104
+ if (tenantId === null)
3105
+ throw new Error("The parameter 'tenantId' cannot be null.");
3106
+ else if (tenantId !== undefined)
3107
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
3108
+ url_ = url_.replace(/[?&]$/, "");
3109
+ let options_ = {
3110
+ responseType: "blob",
3111
+ method: "GET",
3112
+ url: url_,
3113
+ headers: {
3114
+ "Accept": "application/octet-stream"
3115
+ },
3116
+ cancelToken
3117
+ };
3118
+ return this.transformOptions(options_).then(transformedOptions_ => {
3119
+ return this.instance.request(transformedOptions_);
3120
+ }).catch((_error) => {
3121
+ if (isAxiosError(_error) && _error.response) {
3122
+ return _error.response;
3123
+ }
3124
+ else {
3125
+ throw _error;
3126
+ }
3127
+ }).then((_response) => {
3128
+ return this.transformResult(url_, _response, (_response) => this.processLoadToggleSet(_response));
3129
+ });
3130
+ }
3131
+ processLoadToggleSet(response) {
3132
+ const status = response.status;
3133
+ let _headers = {};
3134
+ if (response.headers && typeof response.headers === "object") {
3135
+ for (let k in response.headers) {
3136
+ if (response.headers.hasOwnProperty(k)) {
3137
+ _headers[k] = response.headers[k];
3138
+ }
3139
+ }
3140
+ }
3141
+ if (status === 200 || status === 206) {
3142
+ const contentDisposition = response.headers ? response.headers["content-disposition"] : undefined;
3143
+ const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
3144
+ const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
3145
+ return Promise.resolve({ fileName: fileName, status: status, data: new Blob([response.data]), headers: _headers });
3146
+ }
3147
+ else if (status === 404) {
3148
+ const _responseText = response.data;
3149
+ let result404 = null;
3150
+ let resultData404 = _responseText;
3151
+ result404 = JSON.parse(resultData404);
3152
+ return throwException("Not Found", status, _responseText, _headers, result404);
3153
+ }
3154
+ else if (status === 409) {
3155
+ const _responseText = response.data;
3156
+ let result409 = null;
3157
+ let resultData409 = _responseText;
3158
+ result409 = JSON.parse(resultData409);
3159
+ return throwException("Conflict", status, _responseText, _headers, result409);
3160
+ }
3161
+ else if (status === 401) {
3162
+ const _responseText = response.data;
3163
+ return throwException("Unauthorized", status, _responseText, _headers);
3164
+ }
3165
+ else if (status === 403) {
3166
+ const _responseText = response.data;
3167
+ return throwException("Forbidden", status, _responseText, _headers);
3168
+ }
3169
+ else if (status === 500) {
3170
+ const _responseText = response.data;
3171
+ let result500 = null;
3172
+ let resultData500 = _responseText;
3173
+ result500 = JSON.parse(resultData500);
3174
+ return throwException("Internal server error", status, _responseText, _headers, result500);
3175
+ }
3176
+ else if (status !== 200 && status !== 204) {
3177
+ const _responseText = response.data;
3178
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
3179
+ }
3180
+ return Promise.resolve(null);
3181
+ }
3090
3182
  /**
3091
3183
  * Gets variable items information for design file taken from storage
3092
3184
  * @param id Design identifier