mezon-js 2.8.79 → 2.8.81
Sign up to get free protection for your applications and to get access to all the features.
- package/api.gen.ts +1 -1
- package/client.ts +1 -21
- package/dist/api.gen.d.ts +1 -1
- package/dist/mezon-js.cjs.js +13 -20
- package/dist/mezon-js.esm.mjs +13 -20
- package/dist/socket.d.ts +19 -0
- package/package.json +1 -1
- package/socket.ts +31 -0
package/api.gen.ts
CHANGED
package/client.ts
CHANGED
@@ -1496,27 +1496,7 @@ export class Client {
|
|
1496
1496
|
|
1497
1497
|
response.channel_users!.forEach((gu) => {
|
1498
1498
|
result.channel_users!.push({
|
1499
|
-
|
1500
|
-
avatar_url: gu.user!.avatar_url,
|
1501
|
-
create_time: gu.user!.create_time,
|
1502
|
-
display_name: gu.user!.display_name,
|
1503
|
-
edge_count: gu.user!.edge_count ? Number(gu.user!.edge_count) : 0,
|
1504
|
-
facebook_id: gu.user!.facebook_id,
|
1505
|
-
gamecenter_id: gu.user!.gamecenter_id,
|
1506
|
-
google_id: gu.user!.google_id,
|
1507
|
-
id: gu.user!.id,
|
1508
|
-
lang_tag: gu.user!.lang_tag,
|
1509
|
-
location: gu.user!.location,
|
1510
|
-
online: gu.user!.online,
|
1511
|
-
steam_id: gu.user!.steam_id,
|
1512
|
-
timezone: gu.user!.timezone,
|
1513
|
-
update_time: gu.user!.update_time,
|
1514
|
-
username: gu.user!.username,
|
1515
|
-
about_me: gu.user?.about_me,
|
1516
|
-
metadata: gu.user!.metadata
|
1517
|
-
? JSON.parse(gu.user!.metadata!)
|
1518
|
-
: undefined,
|
1519
|
-
},
|
1499
|
+
user_id: gu.user_id,
|
1520
1500
|
role_id: gu!.role_id,
|
1521
1501
|
thread_id: gu.thread_id,
|
1522
1502
|
clan_avatar: gu.clan_avatar,
|
package/dist/api.gen.d.ts
CHANGED
package/dist/mezon-js.cjs.js
CHANGED
@@ -5291,6 +5291,18 @@ var _DefaultSocket = class _DefaultSocket {
|
|
5291
5291
|
return response.notification_channel_category_setting_event;
|
5292
5292
|
});
|
5293
5293
|
}
|
5294
|
+
addUserEmojiUsage(add_user_emoji_usage_event) {
|
5295
|
+
return __async(this, null, function* () {
|
5296
|
+
const response = yield this.send({ add_user_emoji_usage_event: { add_user_emoji_usage_event } });
|
5297
|
+
return response.add_user_emoji_usage_event;
|
5298
|
+
});
|
5299
|
+
}
|
5300
|
+
getUserEmojiUsage(clan_id) {
|
5301
|
+
return __async(this, null, function* () {
|
5302
|
+
const response = yield this.send({ get_user_emoji_usage_event: { clan_id } });
|
5303
|
+
return response.get_user_emoji_usage_event;
|
5304
|
+
});
|
5305
|
+
}
|
5294
5306
|
pingPong() {
|
5295
5307
|
return __async(this, null, function* () {
|
5296
5308
|
if (!this.adapter.isOpen()) {
|
@@ -5992,27 +6004,8 @@ var Client = class {
|
|
5992
6004
|
return Promise.resolve(result);
|
5993
6005
|
}
|
5994
6006
|
response.channel_users.forEach((gu) => {
|
5995
|
-
var _a;
|
5996
6007
|
result.channel_users.push({
|
5997
|
-
|
5998
|
-
avatar_url: gu.user.avatar_url,
|
5999
|
-
create_time: gu.user.create_time,
|
6000
|
-
display_name: gu.user.display_name,
|
6001
|
-
edge_count: gu.user.edge_count ? Number(gu.user.edge_count) : 0,
|
6002
|
-
facebook_id: gu.user.facebook_id,
|
6003
|
-
gamecenter_id: gu.user.gamecenter_id,
|
6004
|
-
google_id: gu.user.google_id,
|
6005
|
-
id: gu.user.id,
|
6006
|
-
lang_tag: gu.user.lang_tag,
|
6007
|
-
location: gu.user.location,
|
6008
|
-
online: gu.user.online,
|
6009
|
-
steam_id: gu.user.steam_id,
|
6010
|
-
timezone: gu.user.timezone,
|
6011
|
-
update_time: gu.user.update_time,
|
6012
|
-
username: gu.user.username,
|
6013
|
-
about_me: (_a = gu.user) == null ? void 0 : _a.about_me,
|
6014
|
-
metadata: gu.user.metadata ? JSON.parse(gu.user.metadata) : void 0
|
6015
|
-
},
|
6008
|
+
user_id: gu.user_id,
|
6016
6009
|
role_id: gu.role_id,
|
6017
6010
|
thread_id: gu.thread_id,
|
6018
6011
|
clan_avatar: gu.clan_avatar,
|
package/dist/mezon-js.esm.mjs
CHANGED
@@ -5262,6 +5262,18 @@ var _DefaultSocket = class _DefaultSocket {
|
|
5262
5262
|
return response.notification_channel_category_setting_event;
|
5263
5263
|
});
|
5264
5264
|
}
|
5265
|
+
addUserEmojiUsage(add_user_emoji_usage_event) {
|
5266
|
+
return __async(this, null, function* () {
|
5267
|
+
const response = yield this.send({ add_user_emoji_usage_event: { add_user_emoji_usage_event } });
|
5268
|
+
return response.add_user_emoji_usage_event;
|
5269
|
+
});
|
5270
|
+
}
|
5271
|
+
getUserEmojiUsage(clan_id) {
|
5272
|
+
return __async(this, null, function* () {
|
5273
|
+
const response = yield this.send({ get_user_emoji_usage_event: { clan_id } });
|
5274
|
+
return response.get_user_emoji_usage_event;
|
5275
|
+
});
|
5276
|
+
}
|
5265
5277
|
pingPong() {
|
5266
5278
|
return __async(this, null, function* () {
|
5267
5279
|
if (!this.adapter.isOpen()) {
|
@@ -5963,27 +5975,8 @@ var Client = class {
|
|
5963
5975
|
return Promise.resolve(result);
|
5964
5976
|
}
|
5965
5977
|
response.channel_users.forEach((gu) => {
|
5966
|
-
var _a;
|
5967
5978
|
result.channel_users.push({
|
5968
|
-
|
5969
|
-
avatar_url: gu.user.avatar_url,
|
5970
|
-
create_time: gu.user.create_time,
|
5971
|
-
display_name: gu.user.display_name,
|
5972
|
-
edge_count: gu.user.edge_count ? Number(gu.user.edge_count) : 0,
|
5973
|
-
facebook_id: gu.user.facebook_id,
|
5974
|
-
gamecenter_id: gu.user.gamecenter_id,
|
5975
|
-
google_id: gu.user.google_id,
|
5976
|
-
id: gu.user.id,
|
5977
|
-
lang_tag: gu.user.lang_tag,
|
5978
|
-
location: gu.user.location,
|
5979
|
-
online: gu.user.online,
|
5980
|
-
steam_id: gu.user.steam_id,
|
5981
|
-
timezone: gu.user.timezone,
|
5982
|
-
update_time: gu.user.update_time,
|
5983
|
-
username: gu.user.username,
|
5984
|
-
about_me: (_a = gu.user) == null ? void 0 : _a.about_me,
|
5985
|
-
metadata: gu.user.metadata ? JSON.parse(gu.user.metadata) : void 0
|
5986
|
-
},
|
5979
|
+
user_id: gu.user_id,
|
5987
5980
|
role_id: gu.role_id,
|
5988
5981
|
thread_id: gu.thread_id,
|
5989
5982
|
clan_avatar: gu.clan_avatar,
|
package/dist/socket.d.ts
CHANGED
@@ -510,6 +510,21 @@ export interface NotificationChannelCategorySettingEvent {
|
|
510
510
|
clan_id?: string;
|
511
511
|
notification_channel_category_settings_list?: NotificationChannelCategorySetting[];
|
512
512
|
}
|
513
|
+
export interface UserEmojiUsage {
|
514
|
+
user_id: string;
|
515
|
+
emoji_id: string;
|
516
|
+
clan_id: string;
|
517
|
+
create_time: string;
|
518
|
+
}
|
519
|
+
export interface AddUserEmojiUsageEvent {
|
520
|
+
emoji_id: string;
|
521
|
+
clan_id: string;
|
522
|
+
}
|
523
|
+
/** Response cho ListUserEmojiUsage */
|
524
|
+
export interface GetUserEmojiUsageEvent {
|
525
|
+
clanId: string;
|
526
|
+
user_emoji_usage: UserEmojiUsage[];
|
527
|
+
}
|
513
528
|
/** A socket connection to Mezon server. */
|
514
529
|
export interface Socket {
|
515
530
|
/** Connection is Open */
|
@@ -618,6 +633,8 @@ export interface Socket {
|
|
618
633
|
GetPermissionByRoleIdChannelId(role_id: string, channel_id: string): Promise<PermissionRoleChannelListEvent>;
|
619
634
|
getNotificationChannelCategorySetting(clan_id: string): Promise<NotificationChannelCategorySettingEvent>;
|
620
635
|
oneventcreated: (clan_event_created: ApiCreateEventRequest) => void;
|
636
|
+
addUserEmojiUsage: (add_user_emoji_usage_event: AddUserEmojiUsageEvent) => void;
|
637
|
+
getUserEmojiUsage(clan_id: string): Promise<GetUserEmojiUsageEvent>;
|
621
638
|
}
|
622
639
|
/** Reports an error received from a socket message. */
|
623
640
|
export interface SocketError {
|
@@ -707,6 +724,8 @@ export declare class DefaultSocket implements Socket {
|
|
707
724
|
getNotificationClanSetting(clan_id: string): Promise<NotificationClanSettingEvent>;
|
708
725
|
getNotificationReactMessage(channel_id: string): Promise<NotifiReactMessageEvent>;
|
709
726
|
getNotificationChannelCategorySetting(clan_id: string): Promise<NotificationChannelCategorySettingEvent>;
|
727
|
+
addUserEmojiUsage(add_user_emoji_usage_event: AddUserEmojiUsageEvent): Promise<any>;
|
728
|
+
getUserEmojiUsage(clan_id: string): Promise<GetUserEmojiUsageEvent>;
|
710
729
|
private pingPong;
|
711
730
|
}
|
712
731
|
export {};
|
package/package.json
CHANGED
package/socket.ts
CHANGED
@@ -772,6 +772,23 @@ export interface NotificationChannelCategorySettingEvent {
|
|
772
772
|
notification_channel_category_settings_list?: NotificationChannelCategorySetting[]
|
773
773
|
}
|
774
774
|
|
775
|
+
export interface UserEmojiUsage {
|
776
|
+
user_id: string;
|
777
|
+
emoji_id: string;
|
778
|
+
clan_id: string;
|
779
|
+
create_time: string;
|
780
|
+
}
|
781
|
+
|
782
|
+
export interface AddUserEmojiUsageEvent {
|
783
|
+
emoji_id: string;
|
784
|
+
clan_id: string;
|
785
|
+
}
|
786
|
+
|
787
|
+
/** Response cho ListUserEmojiUsage */
|
788
|
+
export interface GetUserEmojiUsageEvent {
|
789
|
+
clanId: string;
|
790
|
+
user_emoji_usage: UserEmojiUsage[];
|
791
|
+
}
|
775
792
|
|
776
793
|
/** A socket connection to Mezon server. */
|
777
794
|
export interface Socket {
|
@@ -955,6 +972,11 @@ export interface Socket {
|
|
955
972
|
getNotificationChannelCategorySetting(clan_id : string): Promise<NotificationChannelCategorySettingEvent>;
|
956
973
|
|
957
974
|
oneventcreated: (clan_event_created: ApiCreateEventRequest) => void;
|
975
|
+
|
976
|
+
addUserEmojiUsage: (add_user_emoji_usage_event: AddUserEmojiUsageEvent) => void;
|
977
|
+
|
978
|
+
getUserEmojiUsage(clan_id: string): Promise<GetUserEmojiUsageEvent>
|
979
|
+
|
958
980
|
}
|
959
981
|
|
960
982
|
/** Reports an error received from a socket message. */
|
@@ -1574,7 +1596,16 @@ export class DefaultSocket implements Socket {
|
|
1574
1596
|
return response.notification_channel_category_setting_event
|
1575
1597
|
}
|
1576
1598
|
|
1599
|
+
async addUserEmojiUsage(add_user_emoji_usage_event: AddUserEmojiUsageEvent) {
|
1600
|
+
const response = await this.send({add_user_emoji_usage_event: {add_user_emoji_usage_event: add_user_emoji_usage_event}})
|
1601
|
+
return response.add_user_emoji_usage_event
|
1602
|
+
}
|
1577
1603
|
|
1604
|
+
async getUserEmojiUsage(clan_id: string): Promise<GetUserEmojiUsageEvent> {
|
1605
|
+
const response = await this.send({get_user_emoji_usage_event: {clan_id: clan_id}})
|
1606
|
+
return response.get_user_emoji_usage_event
|
1607
|
+
}
|
1608
|
+
|
1578
1609
|
private async pingPong(): Promise<void> {
|
1579
1610
|
if (!this.adapter.isOpen()) {
|
1580
1611
|
return;
|