mezon-js 2.9.61 → 2.9.63
Sign up to get free protection for your applications and to get access to all the features.
- package/client.ts +9 -2
- package/dist/client.d.ts +1 -1
- package/dist/mezon-js.cjs.js +9 -2
- package/dist/mezon-js.esm.mjs +9 -2
- package/dist/socket.d.ts +10 -0
- package/package.json +1 -1
- package/socket.ts +23 -4
package/client.ts
CHANGED
@@ -4360,7 +4360,14 @@ export class Client {
|
|
4360
4360
|
});
|
4361
4361
|
}
|
4362
4362
|
|
4363
|
-
async listAuditLog(
|
4363
|
+
async listAuditLog(
|
4364
|
+
session: Session,
|
4365
|
+
actionLog?:string,
|
4366
|
+
userId?:string,
|
4367
|
+
clanId?:string,
|
4368
|
+
page?:number,
|
4369
|
+
pageSize?:number,
|
4370
|
+
) : Promise<MezonapiListAuditLog> {
|
4364
4371
|
if (
|
4365
4372
|
this.autoRefreshSession &&
|
4366
4373
|
session.refresh_token &&
|
@@ -4370,7 +4377,7 @@ export class Client {
|
|
4370
4377
|
}
|
4371
4378
|
|
4372
4379
|
return this.apiClient
|
4373
|
-
.listAuditLog(session.token)
|
4380
|
+
.listAuditLog(session.token, actionLog, userId, clanId, page, pageSize)
|
4374
4381
|
.then((response: MezonapiListAuditLog) => {
|
4375
4382
|
return response;
|
4376
4383
|
});
|
package/dist/client.d.ts
CHANGED
@@ -602,5 +602,5 @@ export declare class Client {
|
|
602
602
|
getPubKeys(session: Session, userIds: Array<string>): Promise<ApiGetPubKeysResponse>;
|
603
603
|
pushPubKey(session: Session, PK: ApiPubKey): Promise<ApiGetPubKeysResponse>;
|
604
604
|
getKeyServer(session: Session): Promise<ApiGetKeyServerResp>;
|
605
|
-
listAuditLog(session: Session): Promise<MezonapiListAuditLog>;
|
605
|
+
listAuditLog(session: Session, actionLog?: string, userId?: string, clanId?: string, page?: number, pageSize?: number): Promise<MezonapiListAuditLog>;
|
606
606
|
}
|
package/dist/mezon-js.cjs.js
CHANGED
@@ -6555,6 +6555,8 @@ var _DefaultSocket = class _DefaultSocket {
|
|
6555
6555
|
this.onpermissionchanged(message.permission_changed_event);
|
6556
6556
|
} else if (message.token_sent_event) {
|
6557
6557
|
this.ontokensent(message.token_sent_event);
|
6558
|
+
} else if (message.message_button_clicked) {
|
6559
|
+
this.handleMessageButtonClick(message.message_button_clicked);
|
6558
6560
|
} else {
|
6559
6561
|
if (this.verbose && window && window.console) {
|
6560
6562
|
console.log("Unrecognized message received: %o", message);
|
@@ -6827,6 +6829,11 @@ var _DefaultSocket = class _DefaultSocket {
|
|
6827
6829
|
console.log(tokenSentEvent);
|
6828
6830
|
}
|
6829
6831
|
}
|
6832
|
+
handleMessageButtonClick(messageButtonClicked) {
|
6833
|
+
if (this.verbose && window && window.console) {
|
6834
|
+
console.log(messageButtonClicked);
|
6835
|
+
}
|
6836
|
+
}
|
6830
6837
|
send(message, sendTimeout = _DefaultSocket.DefaultSendTimeoutMs) {
|
6831
6838
|
const untypedMessage = message;
|
6832
6839
|
return new Promise((resolve, reject) => {
|
@@ -9340,12 +9347,12 @@ var Client = class {
|
|
9340
9347
|
});
|
9341
9348
|
});
|
9342
9349
|
}
|
9343
|
-
listAuditLog(session) {
|
9350
|
+
listAuditLog(session, actionLog, userId, clanId, page, pageSize) {
|
9344
9351
|
return __async(this, null, function* () {
|
9345
9352
|
if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
|
9346
9353
|
yield this.sessionRefresh(session);
|
9347
9354
|
}
|
9348
|
-
return this.apiClient.listAuditLog(session.token).then((response) => {
|
9355
|
+
return this.apiClient.listAuditLog(session.token, actionLog, userId, clanId, page, pageSize).then((response) => {
|
9349
9356
|
return response;
|
9350
9357
|
});
|
9351
9358
|
});
|
package/dist/mezon-js.esm.mjs
CHANGED
@@ -6526,6 +6526,8 @@ var _DefaultSocket = class _DefaultSocket {
|
|
6526
6526
|
this.onpermissionchanged(message.permission_changed_event);
|
6527
6527
|
} else if (message.token_sent_event) {
|
6528
6528
|
this.ontokensent(message.token_sent_event);
|
6529
|
+
} else if (message.message_button_clicked) {
|
6530
|
+
this.handleMessageButtonClick(message.message_button_clicked);
|
6529
6531
|
} else {
|
6530
6532
|
if (this.verbose && window && window.console) {
|
6531
6533
|
console.log("Unrecognized message received: %o", message);
|
@@ -6798,6 +6800,11 @@ var _DefaultSocket = class _DefaultSocket {
|
|
6798
6800
|
console.log(tokenSentEvent);
|
6799
6801
|
}
|
6800
6802
|
}
|
6803
|
+
handleMessageButtonClick(messageButtonClicked) {
|
6804
|
+
if (this.verbose && window && window.console) {
|
6805
|
+
console.log(messageButtonClicked);
|
6806
|
+
}
|
6807
|
+
}
|
6801
6808
|
send(message, sendTimeout = _DefaultSocket.DefaultSendTimeoutMs) {
|
6802
6809
|
const untypedMessage = message;
|
6803
6810
|
return new Promise((resolve, reject) => {
|
@@ -9311,12 +9318,12 @@ var Client = class {
|
|
9311
9318
|
});
|
9312
9319
|
});
|
9313
9320
|
}
|
9314
|
-
listAuditLog(session) {
|
9321
|
+
listAuditLog(session, actionLog, userId, clanId, page, pageSize) {
|
9315
9322
|
return __async(this, null, function* () {
|
9316
9323
|
if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
|
9317
9324
|
yield this.sessionRefresh(session);
|
9318
9325
|
}
|
9319
|
-
return this.apiClient.listAuditLog(session.token).then((response) => {
|
9326
|
+
return this.apiClient.listAuditLog(session.token, actionLog, userId, clanId, page, pageSize).then((response) => {
|
9320
9327
|
return response;
|
9321
9328
|
});
|
9322
9329
|
});
|
package/dist/socket.d.ts
CHANGED
@@ -578,6 +578,13 @@ export interface TokenSentEvent {
|
|
578
578
|
receiver_id: string;
|
579
579
|
amount: number;
|
580
580
|
}
|
581
|
+
export interface MessageButtonClicked {
|
582
|
+
message_id: string;
|
583
|
+
channel_id: string;
|
584
|
+
button_id: string;
|
585
|
+
sender_id: string;
|
586
|
+
user_id: string;
|
587
|
+
}
|
581
588
|
/** A socket connection to Mezon server. */
|
582
589
|
export interface Socket {
|
583
590
|
/** Connection is Open */
|
@@ -680,6 +687,7 @@ export interface Socket {
|
|
680
687
|
setHeartbeatTimeoutMs(ms: number): void;
|
681
688
|
getHeartbeatTimeoutMs(): number;
|
682
689
|
checkDuplicateName(name: string, condition_id: string, type: number): Promise<CheckNameExistedEvent>;
|
690
|
+
handleMessageButtonClick: (message_button_clicked: MessageButtonClicked) => void;
|
683
691
|
oneventcreated: (clan_event_created: ApiCreateEventRequest) => void;
|
684
692
|
oncoffeegiven: (give_coffee_event: ApiGiveCoffeeEvent) => void;
|
685
693
|
oneventemoji: (event_emoji: EventEmoji) => void;
|
@@ -690,6 +698,7 @@ export interface Socket {
|
|
690
698
|
onstreamingchannelleaved: (streaming_leaved_event: StreamingLeavedEvent) => void;
|
691
699
|
onpermissionset: (permission_set_event: PermissionSet) => void;
|
692
700
|
onpermissionchanged: (permission_changed_event: PermissionChangedEvent) => void;
|
701
|
+
ontokensent: (token: TokenSentEvent) => void;
|
693
702
|
}
|
694
703
|
/** Reports an error received from a socket message. */
|
695
704
|
export interface SocketError {
|
@@ -763,6 +772,7 @@ export declare class DefaultSocket implements Socket {
|
|
763
772
|
onpermissionset(permission_set_event: PermissionSet): void;
|
764
773
|
onpermissionchanged(permission_changed_event: PermissionChangedEvent): void;
|
765
774
|
ontokensent(tokenSentEvent: TokenSentEvent): void;
|
775
|
+
handleMessageButtonClick(messageButtonClicked: MessageButtonClicked): void;
|
766
776
|
send(message: ChannelJoin | ChannelLeave | ChannelMessageSend | ChannelMessageUpdate | CustomStatusEvent | ChannelMessageRemove | MessageTypingEvent | LastSeenMessageEvent | Rpc | StatusFollow | StatusUnfollow | StatusUpdate | Ping, sendTimeout?: number): Promise<any>;
|
767
777
|
followUsers(userIds: string[]): Promise<Status>;
|
768
778
|
joinClanChat(clan_id: string): Promise<ClanJoin>;
|
package/package.json
CHANGED
package/socket.ts
CHANGED
@@ -14,10 +14,10 @@
|
|
14
14
|
* limitations under the License.
|
15
15
|
*/
|
16
16
|
|
17
|
-
import { ApiChannelMessageHeader, ApiCreateEventRequest, ApiGiveCoffeeEvent, ApiMessageAttachment, ApiMessageMention, ApiMessageReaction, ApiMessageRef, ApiNotification, ApiPermissionUpdate, ApiRole, ApiRpc} from "./api.gen";
|
18
|
-
import {Session} from "./session";
|
19
|
-
import {ChannelMessage, Notification} from "./client";
|
20
|
-
import {WebSocketAdapter, WebSocketAdapterText} from "./web_socket_adapter"
|
17
|
+
import { ApiChannelMessageHeader, ApiCreateEventRequest, ApiGiveCoffeeEvent, ApiMessageAttachment, ApiMessageMention, ApiMessageReaction, ApiMessageRef, ApiNotification, ApiPermissionUpdate, ApiRole, ApiRpc } from "./api.gen";
|
18
|
+
import { Session } from "./session";
|
19
|
+
import { ChannelMessage, Notification } from "./client";
|
20
|
+
import { WebSocketAdapter, WebSocketAdapterText } from "./web_socket_adapter";
|
21
21
|
|
22
22
|
/** Stores function references for resolve/reject with a DOM Promise. */
|
23
23
|
interface PromiseExecutor {
|
@@ -809,6 +809,13 @@ export interface TokenSentEvent {
|
|
809
809
|
// amount of token
|
810
810
|
amount: number;
|
811
811
|
}
|
812
|
+
export interface MessageButtonClicked {
|
813
|
+
message_id: string;
|
814
|
+
channel_id: string;
|
815
|
+
button_id : string;
|
816
|
+
sender_id : string;
|
817
|
+
user_id : string;
|
818
|
+
}
|
812
819
|
|
813
820
|
/** A socket connection to Mezon server. */
|
814
821
|
export interface Socket {
|
@@ -985,6 +992,8 @@ export interface Socket {
|
|
985
992
|
|
986
993
|
checkDuplicateName(name: string, condition_id: string, type: number): Promise<CheckNameExistedEvent>;
|
987
994
|
|
995
|
+
handleMessageButtonClick: (message_button_clicked: MessageButtonClicked) => void;
|
996
|
+
|
988
997
|
oneventcreated: (clan_event_created: ApiCreateEventRequest) => void;
|
989
998
|
|
990
999
|
oncoffeegiven: (give_coffee_event: ApiGiveCoffeeEvent) => void;
|
@@ -1004,6 +1013,8 @@ export interface Socket {
|
|
1004
1013
|
onpermissionset: (permission_set_event: PermissionSet) => void;
|
1005
1014
|
|
1006
1015
|
onpermissionchanged: (permission_changed_event: PermissionChangedEvent) => void;
|
1016
|
+
|
1017
|
+
ontokensent: (token: TokenSentEvent) => void;
|
1007
1018
|
}
|
1008
1019
|
|
1009
1020
|
/** Reports an error received from a socket message. */
|
@@ -1209,6 +1220,8 @@ export class DefaultSocket implements Socket {
|
|
1209
1220
|
this.onpermissionchanged(<PermissionChangedEvent>message.permission_changed_event);
|
1210
1221
|
} else if (message.token_sent_event) {
|
1211
1222
|
this.ontokensent(<TokenSentEvent>message.token_sent_event);
|
1223
|
+
} else if (message.message_button_clicked){
|
1224
|
+
this.handleMessageButtonClick(<MessageButtonClicked>message.message_button_clicked)
|
1212
1225
|
} else {
|
1213
1226
|
if (this.verbose && window && window.console) {
|
1214
1227
|
console.log("Unrecognized message received: %o", message);
|
@@ -1535,6 +1548,12 @@ export class DefaultSocket implements Socket {
|
|
1535
1548
|
}
|
1536
1549
|
}
|
1537
1550
|
|
1551
|
+
handleMessageButtonClick(messageButtonClicked: MessageButtonClicked) {
|
1552
|
+
if (this.verbose && window && window.console) {
|
1553
|
+
console.log(messageButtonClicked);
|
1554
|
+
}
|
1555
|
+
}
|
1556
|
+
|
1538
1557
|
send(message: ChannelJoin | ChannelLeave | ChannelMessageSend | ChannelMessageUpdate | CustomStatusEvent |
|
1539
1558
|
ChannelMessageRemove | MessageTypingEvent | LastSeenMessageEvent | Rpc | StatusFollow | StatusUnfollow | StatusUpdate | Ping, sendTimeout = DefaultSocket.DefaultSendTimeoutMs): Promise<any> {
|
1540
1559
|
const untypedMessage = message as any;
|