@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
@@ -3078,6 +3078,98 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
3078
3078
  }
3079
3079
  return Promise.resolve(null);
3080
3080
  }
3081
+ /**
3082
+ * Loads toggle set from design file taken from storage.
3083
+ * @param id Design identifier.
3084
+ * @param privateStorageOwner (optional) Private storage owner identifier.
3085
+ * @param tenantId (optional) Tenant identifier
3086
+ * @return Success
3087
+ */
3088
+ loadToggleSet(id, privateStorageOwner, tenantId, cancelToken) {
3089
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/toggle-set?";
3090
+ if (id === undefined || id === null)
3091
+ throw new Error("The parameter 'id' must be defined.");
3092
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
3093
+ if (privateStorageOwner !== undefined && privateStorageOwner !== null)
3094
+ url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
3095
+ if (tenantId === null)
3096
+ throw new Error("The parameter 'tenantId' cannot be null.");
3097
+ else if (tenantId !== undefined)
3098
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
3099
+ url_ = url_.replace(/[?&]$/, "");
3100
+ let options_ = {
3101
+ responseType: "blob",
3102
+ method: "GET",
3103
+ url: url_,
3104
+ headers: {
3105
+ "Accept": "application/octet-stream"
3106
+ },
3107
+ cancelToken
3108
+ };
3109
+ return this.transformOptions(options_).then(transformedOptions_ => {
3110
+ return this.instance.request(transformedOptions_);
3111
+ }).catch((_error) => {
3112
+ if (isAxiosError(_error) && _error.response) {
3113
+ return _error.response;
3114
+ }
3115
+ else {
3116
+ throw _error;
3117
+ }
3118
+ }).then((_response) => {
3119
+ return this.transformResult(url_, _response, (_response) => this.processLoadToggleSet(_response));
3120
+ });
3121
+ }
3122
+ processLoadToggleSet(response) {
3123
+ const status = response.status;
3124
+ let _headers = {};
3125
+ if (response.headers && typeof response.headers === "object") {
3126
+ for (let k in response.headers) {
3127
+ if (response.headers.hasOwnProperty(k)) {
3128
+ _headers[k] = response.headers[k];
3129
+ }
3130
+ }
3131
+ }
3132
+ if (status === 200 || status === 206) {
3133
+ const contentDisposition = response.headers ? response.headers["content-disposition"] : undefined;
3134
+ const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
3135
+ const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
3136
+ return Promise.resolve({ fileName: fileName, status: status, data: new Blob([response.data]), headers: _headers });
3137
+ }
3138
+ else if (status === 404) {
3139
+ const _responseText = response.data;
3140
+ let result404 = null;
3141
+ let resultData404 = _responseText;
3142
+ result404 = JSON.parse(resultData404);
3143
+ return throwException("Not Found", status, _responseText, _headers, result404);
3144
+ }
3145
+ else if (status === 409) {
3146
+ const _responseText = response.data;
3147
+ let result409 = null;
3148
+ let resultData409 = _responseText;
3149
+ result409 = JSON.parse(resultData409);
3150
+ return throwException("Conflict", status, _responseText, _headers, result409);
3151
+ }
3152
+ else if (status === 401) {
3153
+ const _responseText = response.data;
3154
+ return throwException("Unauthorized", status, _responseText, _headers);
3155
+ }
3156
+ else if (status === 403) {
3157
+ const _responseText = response.data;
3158
+ return throwException("Forbidden", status, _responseText, _headers);
3159
+ }
3160
+ else if (status === 500) {
3161
+ const _responseText = response.data;
3162
+ let result500 = null;
3163
+ let resultData500 = _responseText;
3164
+ result500 = JSON.parse(resultData500);
3165
+ return throwException("Internal server error", status, _responseText, _headers, result500);
3166
+ }
3167
+ else if (status !== 200 && status !== 204) {
3168
+ const _responseText = response.data;
3169
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
3170
+ }
3171
+ return Promise.resolve(null);
3172
+ }
3081
3173
  /**
3082
3174
  * Gets variable items information for design file taken from storage
3083
3175
  * @param id Design identifier