mezon-js 2.7.25 → 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
  //
@@ -620,6 +622,15 @@ export interface ApiLinkSteamRequest {
620
622
  sync?: boolean;
621
623
  }
622
624
 
625
+ export interface ApiNotifiReactMessage {
626
+ //
627
+ channel_id?: string;
628
+ //
629
+ id?: string;
630
+ //
631
+ user_id?: string;
632
+ }
633
+
623
634
  /** */
624
635
  export interface ApiMessageAttachment {
625
636
  //
@@ -708,6 +719,12 @@ export interface ApiNotification {
708
719
  subject?: string;
709
720
  }
710
721
 
722
+ /** */
723
+ export interface ApiNotificationChannel {
724
+ //
725
+ channel_id?: string;
726
+ }
727
+
711
728
  /** */
712
729
  export interface ApiNotificationChannelCategoySetting {
713
730
  //
@@ -4120,6 +4137,108 @@ return Promise.race([
4120
4137
  ]);
4121
4138
  }
4122
4139
 
4140
+ /** */
4141
+ deleteNotiReactMessage(bearerToken: string,
4142
+ channelId?:string,
4143
+ options: any = {}): Promise<any> {
4144
+
4145
+ const urlPath = "/v2/notifireactmessage/delete";
4146
+ const queryParams = new Map<string, any>();
4147
+ queryParams.set("channel_id", channelId);
4148
+
4149
+ let bodyJson : string = "";
4150
+
4151
+ const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
4152
+ const fetchOptions = buildFetchOptions("DELETE", options, bodyJson);
4153
+ if (bearerToken) {
4154
+ fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
4155
+ }
4156
+
4157
+ return Promise.race([
4158
+ fetch(fullUrl, fetchOptions).then((response) => {
4159
+ if (response.status == 204) {
4160
+ return response;
4161
+ } else if (response.status >= 200 && response.status < 300) {
4162
+ return response.json();
4163
+ } else {
4164
+ throw response;
4165
+ }
4166
+ }),
4167
+ new Promise((_, reject) =>
4168
+ setTimeout(reject, this.timeoutMs, "Request timed out.")
4169
+ ),
4170
+ ]);
4171
+ }
4172
+
4173
+ /** */
4174
+ getNotificationReactMessage(bearerToken: string,
4175
+ channelId?:string,
4176
+ options: any = {}): Promise<ApiNotifiReactMessage> {
4177
+
4178
+ const urlPath = "/v2/notifireactmessage/get";
4179
+ const queryParams = new Map<string, any>();
4180
+ queryParams.set("channel_id", channelId);
4181
+
4182
+ let bodyJson : string = "";
4183
+
4184
+ const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
4185
+ const fetchOptions = buildFetchOptions("GET", options, bodyJson);
4186
+ if (bearerToken) {
4187
+ fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
4188
+ }
4189
+
4190
+ return Promise.race([
4191
+ fetch(fullUrl, fetchOptions).then((response) => {
4192
+ if (response.status == 204) {
4193
+ return response;
4194
+ } else if (response.status >= 200 && response.status < 300) {
4195
+ return response.json();
4196
+ } else {
4197
+ throw response;
4198
+ }
4199
+ }),
4200
+ new Promise((_, reject) =>
4201
+ setTimeout(reject, this.timeoutMs, "Request timed out.")
4202
+ ),
4203
+ ]);
4204
+ }
4205
+
4206
+ /** */
4207
+ setNotificationReactMessage(bearerToken: string,
4208
+ body:ApiNotificationChannel,
4209
+ options: any = {}): Promise<any> {
4210
+
4211
+ if (body === null || body === undefined) {
4212
+ throw new Error("'body' is a required parameter but is null or undefined.");
4213
+ }
4214
+ const urlPath = "/v2/notifireactmessage/set";
4215
+ const queryParams = new Map<string, any>();
4216
+
4217
+ let bodyJson : string = "";
4218
+ bodyJson = JSON.stringify(body || {});
4219
+
4220
+ const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
4221
+ const fetchOptions = buildFetchOptions("POST", options, bodyJson);
4222
+ if (bearerToken) {
4223
+ fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
4224
+ }
4225
+
4226
+ return Promise.race([
4227
+ fetch(fullUrl, fetchOptions).then((response) => {
4228
+ if (response.status == 204) {
4229
+ return response;
4230
+ } else if (response.status >= 200 && response.status < 300) {
4231
+ return response.json();
4232
+ } else {
4233
+ throw response;
4234
+ }
4235
+ }),
4236
+ new Promise((_, reject) =>
4237
+ setTimeout(reject, this.timeoutMs, "Request timed out.")
4238
+ ),
4239
+ ]);
4240
+ }
4241
+
4123
4242
  /** Get permission list */
4124
4243
  getListPermission(bearerToken: string,
4125
4244
  options: any = {}): Promise<ApiPermissionList> {
package/client.ts CHANGED
@@ -84,6 +84,7 @@ import {
84
84
  ApiSetDefaultNotificationRequest,
85
85
  ApiNotificationUserChannel,
86
86
  ApiSetNotificationRequest,
87
+ ApiNotifiReactMessage,
87
88
  } from "./api.gen";
88
89
 
89
90
  import { Session } from "./session";
@@ -2053,6 +2054,41 @@ async deleteNotificationChannel(session: Session, channel_id: string): Promise<b
2053
2054
  return response !== undefined;
2054
2055
  });
2055
2056
  }
2057
+
2058
+ /** */
2059
+ async setNotificationReactMessage(session: Session, channel_id: string): Promise<boolean> {
2060
+ if (this.autoRefreshSession && session.refresh_token &&
2061
+ session.isexpired((Date.now() + this.expiredTimespanMs)/1000)) {
2062
+ await this.sessionRefresh(session);
2063
+ }
2064
+
2065
+ return this.apiClient.setNotificationReactMessage(session.token, {channel_id}).then((response: any) => {
2066
+ return response !== undefined;
2067
+ });
2068
+ }
2069
+
2070
+ /** */
2071
+ async getNotificationReactMessage(session: Session, channelId: string): Promise<ApiNotifiReactMessage> {
2072
+ if (this.autoRefreshSession && session.refresh_token &&
2073
+ session.isexpired((Date.now() + this.expiredTimespanMs)/1000)) {
2074
+ await this.sessionRefresh(session);
2075
+ }
2076
+
2077
+ return this.apiClient.getNotificationReactMessage(session.token, channelId).then((response: ApiNotifiReactMessage) => {
2078
+ return Promise.resolve(response);
2079
+ });
2080
+ }
2081
+ //** */
2082
+ async deleteNotiReactMessage(session: Session, channel_id: string): Promise<boolean> {
2083
+ if (this.autoRefreshSession && session.refresh_token &&
2084
+ session.isexpired((Date.now() + this.expiredTimespanMs)/1000)) {
2085
+ await this.sessionRefresh(session);
2086
+ }
2087
+
2088
+ return this.apiClient.deleteNotiReactMessage(session.token, channel_id).then((response: any) => {
2089
+ return response !== undefined;
2090
+ });
2091
+ }
2056
2092
  };
2057
2093
 
2058
2094
 
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
  }
@@ -355,6 +356,11 @@ export interface ApiLinkSteamRequest {
355
356
  account?: ApiAccountSteam;
356
357
  sync?: boolean;
357
358
  }
359
+ export interface ApiNotifiReactMessage {
360
+ channel_id?: string;
361
+ id?: string;
362
+ user_id?: string;
363
+ }
358
364
  /** */
359
365
  export interface ApiMessageAttachment {
360
366
  filename?: string;
@@ -406,6 +412,10 @@ export interface ApiNotification {
406
412
  subject?: string;
407
413
  }
408
414
  /** */
415
+ export interface ApiNotificationChannel {
416
+ channel_id?: string;
417
+ }
418
+ /** */
409
419
  export interface ApiNotificationChannelCategoySetting {
410
420
  channel_category_label?: string;
411
421
  channel_category_title?: string;
@@ -811,6 +821,12 @@ export declare class MezonApi {
811
821
  getNotificationClanSetting(bearerToken: string, clanId?: string, options?: any): Promise<ApiNotificationSetting>;
812
822
  /** notification category, channel selected */
813
823
  getChannelCategoryNotiSettingsList(bearerToken: string, clanId?: string, options?: any): Promise<ApiNotificationChannelCategoySettingsList>;
824
+ /** */
825
+ deleteNotiReactMessage(bearerToken: string, channelId?: string, options?: any): Promise<any>;
826
+ /** */
827
+ getNotificationReactMessage(bearerToken: string, channelId?: string, options?: any): Promise<ApiNotifiReactMessage>;
828
+ /** */
829
+ setNotificationReactMessage(bearerToken: string, body: ApiNotificationChannel, options?: any): Promise<any>;
814
830
  /** Get permission list */
815
831
  getListPermission(bearerToken: string, options?: any): Promise<ApiPermissionList>;
816
832
  /** */
package/dist/client.d.ts CHANGED
@@ -13,7 +13,7 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import { ApiAccount, ApiAccountCustom, ApiAccountDevice, ApiAccountEmail, ApiAccountFacebook, ApiAccountFacebookInstantGame, ApiAccountGoogle, ApiAccountGameCenter, ApiAccountSteam, ApiChannelDescList, ApiChannelDescription, ApiCreateChannelDescRequest, ApiDeleteRoleRequest, ApiClanDescList, ApiCreateClanDescRequest, ApiClanDesc, ApiCategoryDesc, ApiCategoryDescList, ApiRoleList, ApiPermissionList, ApiRoleUserList, ApiRole, ApiCreateRoleRequest, ApiAddRoleChannelDescRequest, ApiCreateCategoryDescRequest, ApiUpdateCategoryDescRequest, ApiDeleteStorageObjectsRequest, ApiEvent, ApiReadStorageObjectsRequest, ApiStorageObjectAcks, ApiUpdateAccountRequest, ApiAccountApple, ApiLinkSteamRequest, ApiClanDescProfile, ApiClanProfile, ApiChannelUserList, ApiClanUserList, ApiLinkInviteUserRequest, ApiUpdateEventRequest, ApiLinkInviteUser, ApiInviteUserRes, ApiUploadAttachmentRequest, ApiUploadAttachment, ApiMessageReaction, ApiMessageMention, ApiMessageAttachment, ApiMessageRef, ApiChannelMessageHeader, ApiVoiceChannelUserList, ApiChannelAttachmentList, ApiCreateEventRequest, ApiEventManagement, ApiEventList, ApiDeleteEventRequest, ApiNotificationChannelCategoySettingsList, ApiNotificationSetting, ApiSetDefaultNotificationRequest, ApiNotificationUserChannel, ApiSetNotificationRequest } from "./api.gen";
16
+ import { ApiAccount, ApiAccountCustom, ApiAccountDevice, ApiAccountEmail, ApiAccountFacebook, ApiAccountFacebookInstantGame, ApiAccountGoogle, ApiAccountGameCenter, ApiAccountSteam, ApiChannelDescList, ApiChannelDescription, ApiCreateChannelDescRequest, ApiDeleteRoleRequest, ApiClanDescList, ApiCreateClanDescRequest, ApiClanDesc, ApiCategoryDesc, ApiCategoryDescList, ApiRoleList, ApiPermissionList, ApiRoleUserList, ApiRole, ApiCreateRoleRequest, ApiAddRoleChannelDescRequest, ApiCreateCategoryDescRequest, ApiUpdateCategoryDescRequest, ApiDeleteStorageObjectsRequest, ApiEvent, ApiReadStorageObjectsRequest, ApiStorageObjectAcks, ApiUpdateAccountRequest, ApiAccountApple, ApiLinkSteamRequest, ApiClanDescProfile, ApiClanProfile, ApiChannelUserList, ApiClanUserList, ApiLinkInviteUserRequest, ApiUpdateEventRequest, ApiLinkInviteUser, ApiInviteUserRes, ApiUploadAttachmentRequest, ApiUploadAttachment, ApiMessageReaction, ApiMessageMention, ApiMessageAttachment, ApiMessageRef, ApiChannelMessageHeader, ApiVoiceChannelUserList, ApiChannelAttachmentList, ApiCreateEventRequest, ApiEventManagement, ApiEventList, ApiDeleteEventRequest, ApiNotificationChannelCategoySettingsList, ApiNotificationSetting, ApiSetDefaultNotificationRequest, ApiNotificationUserChannel, ApiSetNotificationRequest, ApiNotifiReactMessage } from "./api.gen";
17
17
  import { Session } from "./session";
18
18
  import { Socket } from "./socket";
19
19
  import { WebSocketAdapter } from "./web_socket_adapter";
@@ -556,4 +556,9 @@ export declare class Client {
556
556
  deleteNotificationCategory(session: Session, category_id: string): Promise<boolean>;
557
557
  getChannelCategoryNotiSettingsList(session: Session, clan_id: string): Promise<ApiNotificationChannelCategoySettingsList>;
558
558
  deleteNotificationChannel(session: Session, channel_id: string): Promise<boolean>;
559
+ /** */
560
+ setNotificationReactMessage(session: Session, channel_id: string): Promise<boolean>;
561
+ /** */
562
+ getNotificationReactMessage(session: Session, channelId: string): Promise<ApiNotifiReactMessage>;
563
+ deleteNotiReactMessage(session: Session, channel_id: string): Promise<boolean>;
559
564
  }
@@ -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
  };