mezon-js 2.10.21 → 2.10.22

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.
package/api.gen.ts CHANGED
@@ -206,7 +206,7 @@ export interface MezonUpdateEventBody {
206
206
  channel_id?: string;
207
207
  //
208
208
  clan_id?: string;
209
- //
209
+ //
210
210
  creator_id?: string;
211
211
  //
212
212
  description?: string;
@@ -1179,7 +1179,7 @@ export interface ApiDeleteChannelDescRequest {
1179
1179
  export interface ApiDeleteEventRequest {
1180
1180
  //
1181
1181
  clan_id?: string;
1182
- //
1182
+ //
1183
1183
  creator_id?: string;
1184
1184
  //The id of a event.
1185
1185
  event_id?: string;
@@ -4923,7 +4923,7 @@ export class MezonApi {
4923
4923
  messageId?: string,
4924
4924
  direction?: number,
4925
4925
  limit?: number,
4926
- topicId?:string,
4926
+ topicId?: string,
4927
4927
  options: any = {}
4928
4928
  ): Promise<ApiChannelMessageList> {
4929
4929
  if (channelId === null || channelId === undefined) {
@@ -5368,22 +5368,23 @@ export class MezonApi {
5368
5368
  }
5369
5369
 
5370
5370
  /** list user add channel by channel ids */
5371
- listChannelUsersUC(bearerToken: string,
5372
- channelId?:string,
5373
- limit?:number,
5374
- options: any = {}): Promise<ApiAllUsersAddChannelResponse> {
5375
-
5371
+ listChannelUsersUC(
5372
+ bearerToken: string,
5373
+ channelId?: string,
5374
+ limit?: number,
5375
+ options: any = {}
5376
+ ): Promise<ApiAllUsersAddChannelResponse> {
5376
5377
  const urlPath = "/v2/channeldesc/users";
5377
5378
  const queryParams = new Map<string, any>();
5378
5379
  queryParams.set("channel_id", channelId);
5379
5380
  queryParams.set("limit", limit);
5380
5381
 
5381
- let bodyJson : string = "";
5382
+ let bodyJson: string = "";
5382
5383
 
5383
5384
  const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
5384
5385
  const fetchOptions = buildFetchOptions("GET", options, bodyJson);
5385
5386
  if (bearerToken) {
5386
- fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
5387
+ fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
5387
5388
  }
5388
5389
 
5389
5390
  return Promise.race([
@@ -5400,7 +5401,7 @@ export class MezonApi {
5400
5401
  setTimeout(reject, this.timeoutMs, "Request timed out.")
5401
5402
  ),
5402
5403
  ]);
5403
- }
5404
+ }
5404
5405
 
5405
5406
  /** Delete a channel by ID. */
5406
5407
  deleteChannelDesc(
@@ -6563,12 +6564,13 @@ export class MezonApi {
6563
6564
  }
6564
6565
 
6565
6566
  /** Delete a event by ID. */
6566
- deleteEvent(bearerToken: string,
6567
- eventId:string,
6568
- clanId?:string,
6569
- creatorId?:string,
6570
- options: any = {}): Promise<any> {
6571
-
6567
+ deleteEvent(
6568
+ bearerToken: string,
6569
+ eventId: string,
6570
+ clanId?: string,
6571
+ creatorId?: string,
6572
+ options: any = {}
6573
+ ): Promise<any> {
6572
6574
  if (eventId === null || eventId === undefined) {
6573
6575
  throw new Error(
6574
6576
  "'eventId' is a required parameter but is null or undefined."
@@ -6580,7 +6582,7 @@ export class MezonApi {
6580
6582
  );
6581
6583
  const queryParams = new Map<string, any>();
6582
6584
  queryParams.set("clan_id", clanId);
6583
- queryParams.set("creator_id", creatorId);
6585
+ queryParams.set("creator_id", creatorId);
6584
6586
 
6585
6587
  let bodyJson: string = "";
6586
6588
 
@@ -7505,45 +7507,46 @@ queryParams.set("creator_id", creatorId);
7505
7507
  }
7506
7508
 
7507
7509
  /** Fetch list of notifications. */
7508
- listNotifications(bearerToken: string,
7509
- limit?:number,
7510
- clanId?:string,
7511
- notificationId?:string,
7512
- code?:number,
7513
- direction?:number,
7514
- options: any = {}): Promise<ApiNotificationList> {
7515
-
7516
- const urlPath = "/v2/notification";
7517
- const queryParams = new Map<string, any>();
7518
- queryParams.set("limit", limit);
7519
- queryParams.set("clan_id", clanId);
7520
- queryParams.set("notification_id", notificationId);
7521
- queryParams.set("code", code);
7522
- queryParams.set("direction", direction);
7523
-
7524
- let bodyJson : string = "";
7525
-
7526
- const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
7527
- const fetchOptions = buildFetchOptions("GET", options, bodyJson);
7528
- if (bearerToken) {
7529
- fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
7530
- }
7531
-
7532
- return Promise.race([
7533
- fetch(fullUrl, fetchOptions).then((response) => {
7534
- if (response.status == 204) {
7535
- return response;
7536
- } else if (response.status >= 200 && response.status < 300) {
7537
- return response.json();
7538
- } else {
7539
- throw response;
7540
- }
7541
- }),
7542
- new Promise((_, reject) =>
7543
- setTimeout(reject, this.timeoutMs, "Request timed out.")
7544
- ),
7545
- ]);
7546
- }
7510
+ listNotifications(
7511
+ bearerToken: string,
7512
+ limit?: number,
7513
+ clanId?: string,
7514
+ notificationId?: string,
7515
+ code?: number,
7516
+ direction?: number,
7517
+ options: any = {}
7518
+ ): Promise<ApiNotificationList> {
7519
+ const urlPath = "/v2/notification";
7520
+ const queryParams = new Map<string, any>();
7521
+ queryParams.set("limit", limit);
7522
+ queryParams.set("clan_id", clanId);
7523
+ queryParams.set("notification_id", notificationId);
7524
+ queryParams.set("code", code);
7525
+ queryParams.set("direction", direction);
7526
+
7527
+ let bodyJson: string = "";
7528
+
7529
+ const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
7530
+ const fetchOptions = buildFetchOptions("GET", options, bodyJson);
7531
+ if (bearerToken) {
7532
+ fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
7533
+ }
7534
+
7535
+ return Promise.race([
7536
+ fetch(fullUrl, fetchOptions).then((response) => {
7537
+ if (response.status == 204) {
7538
+ return response;
7539
+ } else if (response.status >= 200 && response.status < 300) {
7540
+ return response.json();
7541
+ } else {
7542
+ throw response;
7543
+ }
7544
+ }),
7545
+ new Promise((_, reject) =>
7546
+ setTimeout(reject, this.timeoutMs, "Request timed out.")
7547
+ ),
7548
+ ]);
7549
+ }
7547
7550
 
7548
7551
  /** set notification user channel. */
7549
7552
  setNotificationChannelSetting(
package/client.ts CHANGED
@@ -56,7 +56,6 @@ import {
56
56
  ApiChannelUserList,
57
57
  ApiClanUserList,
58
58
  ApiLinkInviteUserRequest,
59
- ApiUpdateEventRequest,
60
59
  ApiLinkInviteUser,
61
60
  ApiInviteUserRes,
62
61
  ApiUploadAttachmentRequest,
@@ -158,6 +157,7 @@ import {
158
157
  ApiSdTopicRequest,
159
158
  ApiSdTopic,
160
159
  ApiPTTChannelUserList,
160
+ MezonUpdateEventBody,
161
161
  } from "./api.gen";
162
162
 
163
163
  import { Session } from "./session";
@@ -201,7 +201,7 @@ export enum WebrtcSignalingType {
201
201
  WEBRTC_SDP_OFFER = 1,
202
202
  WEBRTC_SDP_ANSWER = 2,
203
203
  WEBRTC_ICE_CANDIDATE = 3,
204
- WEBRTC_SDP_QUIT = 4
204
+ WEBRTC_SDP_QUIT = 4,
205
205
  }
206
206
 
207
207
  /** Response for an RPC function executed on the server. */
@@ -1201,7 +1201,8 @@ export class Client {
1201
1201
  async deleteEvent(
1202
1202
  session: Session,
1203
1203
  eventId: string,
1204
- clanId: string
1204
+ clanId: string,
1205
+ creatorId: string
1205
1206
  ): Promise<boolean> {
1206
1207
  if (
1207
1208
  this.autoRefreshSession &&
@@ -1212,7 +1213,7 @@ export class Client {
1212
1213
  }
1213
1214
 
1214
1215
  return this.apiClient
1215
- .deleteEvent(session.token, eventId, clanId)
1216
+ .deleteEvent(session.token, eventId, clanId, creatorId)
1216
1217
  .then((response: any) => {
1217
1218
  return response !== undefined;
1218
1219
  });
@@ -1409,7 +1410,7 @@ export class Client {
1409
1410
  messageId?: string,
1410
1411
  direction?: number,
1411
1412
  limit?: number,
1412
- topicId?:string
1413
+ topicId?: string
1413
1414
  ): Promise<ChannelMessageList> {
1414
1415
  if (
1415
1416
  this.autoRefreshSession &&
@@ -2231,9 +2232,9 @@ export class Client {
2231
2232
  session: Session,
2232
2233
  clanId: string,
2233
2234
  limit?: number,
2234
- notificationId?:string,
2235
- code?:number,
2236
- direction?:number,
2235
+ notificationId?: string,
2236
+ code?: number,
2237
+ direction?: number
2237
2238
  ): Promise<NotificationList> {
2238
2239
  if (
2239
2240
  this.autoRefreshSession &&
@@ -2244,7 +2245,14 @@ export class Client {
2244
2245
  }
2245
2246
 
2246
2247
  return this.apiClient
2247
- .listNotifications(session.token, limit, clanId, notificationId, code, direction)
2248
+ .listNotifications(
2249
+ session.token,
2250
+ limit,
2251
+ clanId,
2252
+ notificationId,
2253
+ code,
2254
+ direction
2255
+ )
2248
2256
  .then((response: ApiNotificationList) => {
2249
2257
  var result: NotificationList = {
2250
2258
  cacheable_cursor: response.cacheable_cursor,
@@ -2710,7 +2718,7 @@ export class Client {
2710
2718
  async updateEvent(
2711
2719
  session: Session,
2712
2720
  roleId: string,
2713
- request: ApiUpdateEventRequest
2721
+ request: MezonUpdateEventBody
2714
2722
  ): Promise<boolean> {
2715
2723
  if (
2716
2724
  this.autoRefreshSession &&
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, ApiPermissionList, ApiRoleUserList, ApiRole, ApiCreateRoleRequest, ApiAddRoleChannelDescRequest, ApiCreateCategoryDescRequest, ApiUpdateCategoryDescRequest, ApiEvent, ApiUpdateAccountRequest, ApiAccountApple, ApiLinkSteamRequest, ApiClanDescProfile, ApiClanProfile, ApiChannelUserList, ApiClanUserList, ApiLinkInviteUserRequest, ApiUpdateEventRequest, ApiLinkInviteUser, ApiInviteUserRes, ApiUploadAttachmentRequest, ApiUploadAttachment, ApiMessageReaction, ApiMessageMention, ApiMessageAttachment, ApiMessageRef, ApiChannelMessageHeader, ApiVoiceChannelUserList, ApiChannelAttachmentList, ApiCreateEventRequest, ApiEventManagement, ApiEventList, ApiDeleteEventRequest, ApiSetDefaultNotificationRequest, ApiSetNotificationRequest, ApiSetMuteNotificationRequest, ApiSearchMessageRequest, ApiSearchMessageResponse, ApiPinMessageRequest, ApiPinMessagesList, ApiDeleteChannelDescRequest, ApiChangeChannelPrivateRequest, ApiClanEmojiCreateRequest, MezonUpdateClanEmojiByIdBody, ApiWebhookCreateRequest, ApiWebhookListResponse, MezonUpdateWebhookByIdBody, ApiWebhookGenerateResponse, ApiCheckDuplicateClanNameResponse, ApiClanStickerAddRequest, MezonUpdateClanStickerByIdBody, MezonChangeChannelCategoryBody, ApiUpdateRoleChannelRequest, ApiAddAppRequest, ApiAppList, ApiApp, MezonUpdateAppBody, ApiSystemMessagesList, ApiSystemMessage, ApiSystemMessageRequest, MezonUpdateSystemMessageBody, ApiUpdateCategoryOrderRequest, ApiGiveCoffeeEvent, ApiListStreamingChannelsResponse, ApiStreamingChannelUserList, ApiRegisterStreamingChannelRequest, ApiRoleList, ApiListChannelAppsResponse, ApiNotificationChannelCategorySettingList, ApiNotificationUserChannel, ApiNotificationSetting, ApiNotifiReactMessage, ApiHashtagDmList, ApiEmojiListedResponse, ApiStickerListedResponse, ApiAllUsersAddChannelResponse, ApiRoleListEventResponse, ApiAllUserClans, ApiUserPermissionInChannelListResponse, ApiPermissionRoleChannelListEventResponse, ApiMarkAsReadRequest, ApiEditChannelCanvasRequest, ApiChannelSettingListResponse, ApiAddFavoriteChannelResponse, ApiRegistFcmDeviceTokenResponse, ApiListUserActivity, ApiCreateActivityRequest, ApiLoginIDResponse, ApiLoginRequest, ApiConfirmLoginRequest, ApiUserActivity, ApiChanEncryptionMethod, ApiGetPubKeysResponse, ApiPubKey, ApiGetKeyServerResp, MezonapiListAuditLog, ApiTokenSentEvent, MezonDeleteWebhookByIdBody, ApiWithdrawTokenRequest, ApiListOnboardingResponse, ApiCreateOnboardingRequest, MezonUpdateOnboardingBody, ApiOnboardingItem, ApiGenerateClanWebhookRequest, ApiGenerateClanWebhookResponse, ApiListClanWebhookResponse, MezonUpdateClanWebhookByIdBody, MezonUpdateClanDescBody, ApiUserStatusUpdate, ApiUserStatus, ApiListOnboardingStepResponse, MezonUpdateOnboardingStepByClanIdBody, ApiWalletLedgerList, ApiSdTopicList, ApiSdTopicRequest, ApiSdTopic, ApiPTTChannelUserList } from "./api.gen";
16
+ import { ApiAccount, ApiAccountCustom, ApiAccountDevice, ApiAccountEmail, ApiAccountFacebook, ApiAccountFacebookInstantGame, ApiAccountGoogle, ApiAccountGameCenter, ApiAccountSteam, ApiChannelDescList, ApiChannelDescription, ApiCreateChannelDescRequest, ApiDeleteRoleRequest, ApiClanDescList, ApiCreateClanDescRequest, ApiClanDesc, ApiCategoryDesc, ApiCategoryDescList, ApiPermissionList, ApiRoleUserList, ApiRole, ApiCreateRoleRequest, ApiAddRoleChannelDescRequest, ApiCreateCategoryDescRequest, ApiUpdateCategoryDescRequest, ApiEvent, ApiUpdateAccountRequest, ApiAccountApple, ApiLinkSteamRequest, ApiClanDescProfile, ApiClanProfile, ApiChannelUserList, ApiClanUserList, ApiLinkInviteUserRequest, ApiLinkInviteUser, ApiInviteUserRes, ApiUploadAttachmentRequest, ApiUploadAttachment, ApiMessageReaction, ApiMessageMention, ApiMessageAttachment, ApiMessageRef, ApiChannelMessageHeader, ApiVoiceChannelUserList, ApiChannelAttachmentList, ApiCreateEventRequest, ApiEventManagement, ApiEventList, ApiDeleteEventRequest, ApiSetDefaultNotificationRequest, ApiSetNotificationRequest, ApiSetMuteNotificationRequest, ApiSearchMessageRequest, ApiSearchMessageResponse, ApiPinMessageRequest, ApiPinMessagesList, ApiDeleteChannelDescRequest, ApiChangeChannelPrivateRequest, ApiClanEmojiCreateRequest, MezonUpdateClanEmojiByIdBody, ApiWebhookCreateRequest, ApiWebhookListResponse, MezonUpdateWebhookByIdBody, ApiWebhookGenerateResponse, ApiCheckDuplicateClanNameResponse, ApiClanStickerAddRequest, MezonUpdateClanStickerByIdBody, MezonChangeChannelCategoryBody, ApiUpdateRoleChannelRequest, ApiAddAppRequest, ApiAppList, ApiApp, MezonUpdateAppBody, ApiSystemMessagesList, ApiSystemMessage, ApiSystemMessageRequest, MezonUpdateSystemMessageBody, ApiUpdateCategoryOrderRequest, ApiGiveCoffeeEvent, ApiListStreamingChannelsResponse, ApiStreamingChannelUserList, ApiRegisterStreamingChannelRequest, ApiRoleList, ApiListChannelAppsResponse, ApiNotificationChannelCategorySettingList, ApiNotificationUserChannel, ApiNotificationSetting, ApiNotifiReactMessage, ApiHashtagDmList, ApiEmojiListedResponse, ApiStickerListedResponse, ApiAllUsersAddChannelResponse, ApiRoleListEventResponse, ApiAllUserClans, ApiUserPermissionInChannelListResponse, ApiPermissionRoleChannelListEventResponse, ApiMarkAsReadRequest, ApiEditChannelCanvasRequest, ApiChannelSettingListResponse, ApiAddFavoriteChannelResponse, ApiRegistFcmDeviceTokenResponse, ApiListUserActivity, ApiCreateActivityRequest, ApiLoginIDResponse, ApiLoginRequest, ApiConfirmLoginRequest, ApiUserActivity, ApiChanEncryptionMethod, ApiGetPubKeysResponse, ApiPubKey, ApiGetKeyServerResp, MezonapiListAuditLog, ApiTokenSentEvent, MezonDeleteWebhookByIdBody, ApiWithdrawTokenRequest, ApiListOnboardingResponse, ApiCreateOnboardingRequest, MezonUpdateOnboardingBody, ApiOnboardingItem, ApiGenerateClanWebhookRequest, ApiGenerateClanWebhookResponse, ApiListClanWebhookResponse, MezonUpdateClanWebhookByIdBody, MezonUpdateClanDescBody, ApiUserStatusUpdate, ApiUserStatus, ApiListOnboardingStepResponse, MezonUpdateOnboardingStepByClanIdBody, ApiWalletLedgerList, ApiSdTopicList, ApiSdTopicRequest, ApiSdTopic, ApiPTTChannelUserList, MezonUpdateEventBody } from "./api.gen";
17
17
  import { Session } from "./session";
18
18
  import { Socket } from "./socket";
19
19
  import { WebSocketAdapter } from "./web_socket_adapter";
@@ -400,7 +400,7 @@ export declare class Client {
400
400
  /** Delete a role by ID. */
401
401
  deleteRole(session: Session, roleId: string, clanId: string): Promise<boolean>;
402
402
  /** Delete a event by ID. */
403
- deleteEvent(session: Session, eventId: string, clanId: string): Promise<boolean>;
403
+ deleteEvent(session: Session, eventId: string, clanId: string, creatorId: string): Promise<boolean>;
404
404
  /** update user a event by ID. */
405
405
  updateEventUser(session: Session, request: ApiDeleteEventRequest): Promise<boolean>;
406
406
  /** Submit an event for processing in the server's registered runtime custom events handler. */
@@ -509,7 +509,7 @@ export declare class Client {
509
509
  /** Update fields in a given role. */
510
510
  updateRole(session: Session, roleId: string, request: ApiUpdateRoleRequest): Promise<boolean>;
511
511
  /** Update fields in a given event. */
512
- updateEvent(session: Session, roleId: string, request: ApiUpdateEventRequest): Promise<boolean>;
512
+ updateEvent(session: Session, roleId: string, request: MezonUpdateEventBody): Promise<boolean>;
513
513
  /** Update fields in a given event. */
514
514
  updateApp(session: Session, roleId: string, request: MezonUpdateAppBody): Promise<boolean>;
515
515
  /** Update fields in a given clan profile. */
@@ -8448,12 +8448,12 @@ var Client = class {
8448
8448
  });
8449
8449
  }
8450
8450
  /** Delete a event by ID. */
8451
- deleteEvent(session, eventId, clanId) {
8451
+ deleteEvent(session, eventId, clanId, creatorId) {
8452
8452
  return __async(this, null, function* () {
8453
8453
  if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
8454
8454
  yield this.sessionRefresh(session);
8455
8455
  }
8456
- return this.apiClient.deleteEvent(session.token, eventId, clanId).then((response) => {
8456
+ return this.apiClient.deleteEvent(session.token, eventId, clanId, creatorId).then((response) => {
8457
8457
  return response !== void 0;
8458
8458
  });
8459
8459
  });
@@ -9112,7 +9112,14 @@ var Client = class {
9112
9112
  if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
9113
9113
  yield this.sessionRefresh(session);
9114
9114
  }
9115
- return this.apiClient.listNotifications(session.token, limit, clanId, notificationId, code, direction).then((response) => {
9115
+ return this.apiClient.listNotifications(
9116
+ session.token,
9117
+ limit,
9118
+ clanId,
9119
+ notificationId,
9120
+ code,
9121
+ direction
9122
+ ).then((response) => {
9116
9123
  var result = {
9117
9124
  cacheable_cursor: response.cacheable_cursor,
9118
9125
  notifications: []
@@ -8414,12 +8414,12 @@ var Client = class {
8414
8414
  });
8415
8415
  }
8416
8416
  /** Delete a event by ID. */
8417
- deleteEvent(session, eventId, clanId) {
8417
+ deleteEvent(session, eventId, clanId, creatorId) {
8418
8418
  return __async(this, null, function* () {
8419
8419
  if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
8420
8420
  yield this.sessionRefresh(session);
8421
8421
  }
8422
- return this.apiClient.deleteEvent(session.token, eventId, clanId).then((response) => {
8422
+ return this.apiClient.deleteEvent(session.token, eventId, clanId, creatorId).then((response) => {
8423
8423
  return response !== void 0;
8424
8424
  });
8425
8425
  });
@@ -9078,7 +9078,14 @@ var Client = class {
9078
9078
  if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
9079
9079
  yield this.sessionRefresh(session);
9080
9080
  }
9081
- return this.apiClient.listNotifications(session.token, limit, clanId, notificationId, code, direction).then((response) => {
9081
+ return this.apiClient.listNotifications(
9082
+ session.token,
9083
+ limit,
9084
+ clanId,
9085
+ notificationId,
9086
+ code,
9087
+ direction
9088
+ ).then((response) => {
9082
9089
  var result = {
9083
9090
  cacheable_cursor: response.cacheable_cursor,
9084
9091
  notifications: []
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mezon-js",
3
3
 
4
- "version": "2.10.21",
4
+ "version": "2.10.22",
5
5
 
6
6
  "scripts": {
7
7
  "build": "npx tsc && npx rollup -c --bundleConfigAsCjs && node build.mjs"