mezon-js 2.7.26 → 2.7.27

Sign up to get free protection for your applications and to get access to all the features.
package/api.gen.ts CHANGED
@@ -234,6 +234,8 @@ export interface ApiChannelDescription {
234
234
  meeting_uri?: string;
235
235
  //The parrent channel this message belongs to.
236
236
  parrent_id?: string;
237
+ //
238
+ status?: number;
237
239
  //The channel type.
238
240
  type?: number;
239
241
  //
package/dist/api.gen.d.ts CHANGED
@@ -134,6 +134,7 @@ export interface ApiChannelDescription {
134
134
  meeting_code?: string;
135
135
  meeting_uri?: string;
136
136
  parrent_id?: string;
137
+ status?: number;
137
138
  type?: number;
138
139
  user_id?: Array<string>;
139
140
  }
@@ -3013,6 +3013,87 @@ var MezonApi = class {
3013
3013
  )
3014
3014
  ]);
3015
3015
  }
3016
+ /** */
3017
+ deleteNotiReactMessage(bearerToken, channelId, options = {}) {
3018
+ const urlPath = "/v2/notifireactmessage/delete";
3019
+ const queryParams = /* @__PURE__ */ new Map();
3020
+ queryParams.set("channel_id", channelId);
3021
+ let bodyJson = "";
3022
+ const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
3023
+ const fetchOptions = buildFetchOptions("DELETE", options, bodyJson);
3024
+ if (bearerToken) {
3025
+ fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
3026
+ }
3027
+ return Promise.race([
3028
+ fetch(fullUrl, fetchOptions).then((response) => {
3029
+ if (response.status == 204) {
3030
+ return response;
3031
+ } else if (response.status >= 200 && response.status < 300) {
3032
+ return response.json();
3033
+ } else {
3034
+ throw response;
3035
+ }
3036
+ }),
3037
+ new Promise(
3038
+ (_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
3039
+ )
3040
+ ]);
3041
+ }
3042
+ /** */
3043
+ getNotificationReactMessage(bearerToken, channelId, options = {}) {
3044
+ const urlPath = "/v2/notifireactmessage/get";
3045
+ const queryParams = /* @__PURE__ */ new Map();
3046
+ queryParams.set("channel_id", channelId);
3047
+ let bodyJson = "";
3048
+ const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
3049
+ const fetchOptions = buildFetchOptions("GET", options, bodyJson);
3050
+ if (bearerToken) {
3051
+ fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
3052
+ }
3053
+ return Promise.race([
3054
+ fetch(fullUrl, fetchOptions).then((response) => {
3055
+ if (response.status == 204) {
3056
+ return response;
3057
+ } else if (response.status >= 200 && response.status < 300) {
3058
+ return response.json();
3059
+ } else {
3060
+ throw response;
3061
+ }
3062
+ }),
3063
+ new Promise(
3064
+ (_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
3065
+ )
3066
+ ]);
3067
+ }
3068
+ /** */
3069
+ setNotificationReactMessage(bearerToken, body, options = {}) {
3070
+ if (body === null || body === void 0) {
3071
+ throw new Error("'body' is a required parameter but is null or undefined.");
3072
+ }
3073
+ const urlPath = "/v2/notifireactmessage/set";
3074
+ const queryParams = /* @__PURE__ */ new Map();
3075
+ let bodyJson = "";
3076
+ bodyJson = JSON.stringify(body || {});
3077
+ const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
3078
+ const fetchOptions = buildFetchOptions("POST", options, bodyJson);
3079
+ if (bearerToken) {
3080
+ fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
3081
+ }
3082
+ return Promise.race([
3083
+ fetch(fullUrl, fetchOptions).then((response) => {
3084
+ if (response.status == 204) {
3085
+ return response;
3086
+ } else if (response.status >= 200 && response.status < 300) {
3087
+ return response.json();
3088
+ } else {
3089
+ throw response;
3090
+ }
3091
+ }),
3092
+ new Promise(
3093
+ (_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
3094
+ )
3095
+ ]);
3096
+ }
3016
3097
  /** Get permission list */
3017
3098
  getListPermission(bearerToken, options = {}) {
3018
3099
  const urlPath = "/v2/permissions";
@@ -5824,4 +5905,37 @@ var Client = class {
5824
5905
  });
5825
5906
  });
5826
5907
  }
5908
+ /** */
5909
+ setNotificationReactMessage(session, channel_id) {
5910
+ return __async(this, null, function* () {
5911
+ if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
5912
+ yield this.sessionRefresh(session);
5913
+ }
5914
+ return this.apiClient.setNotificationReactMessage(session.token, { channel_id }).then((response) => {
5915
+ return response !== void 0;
5916
+ });
5917
+ });
5918
+ }
5919
+ /** */
5920
+ getNotificationReactMessage(session, channelId) {
5921
+ return __async(this, null, function* () {
5922
+ if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
5923
+ yield this.sessionRefresh(session);
5924
+ }
5925
+ return this.apiClient.getNotificationReactMessage(session.token, channelId).then((response) => {
5926
+ return Promise.resolve(response);
5927
+ });
5928
+ });
5929
+ }
5930
+ //** */
5931
+ deleteNotiReactMessage(session, channel_id) {
5932
+ return __async(this, null, function* () {
5933
+ if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
5934
+ yield this.sessionRefresh(session);
5935
+ }
5936
+ return this.apiClient.deleteNotiReactMessage(session.token, channel_id).then((response) => {
5937
+ return response !== void 0;
5938
+ });
5939
+ });
5940
+ }
5827
5941
  };