mezon-js 2.11.7 → 2.11.8
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 +2 -1
- package/client.ts +2 -1
- package/dist/api.gen.d.ts +1 -1
- package/dist/client.d.ts +1 -1
- package/dist/mezon-js.cjs.js +11 -3
- package/dist/mezon-js.esm.mjs +11 -3
- package/dist/socket.d.ts +8 -0
- package/package.json +1 -1
- package/socket.ts +16 -0
package/api.gen.ts
CHANGED
@@ -11234,13 +11234,14 @@ export class MezonApi {
|
|
11234
11234
|
/** Create mezon OAuth client */
|
11235
11235
|
getMezonOauthClient(bearerToken: string,
|
11236
11236
|
clientId?:string,
|
11237
|
+
clientName?:string,
|
11237
11238
|
options: any = {}
|
11238
11239
|
): Promise<ApiMezonOauthClient> {
|
11239
11240
|
|
11240
11241
|
const urlPath = "/v2/mznoauthclient";
|
11241
11242
|
const queryParams = new Map<string, any>();
|
11242
11243
|
queryParams.set("client_id", clientId);
|
11243
|
-
|
11244
|
+
queryParams.set("client_name", clientName);
|
11244
11245
|
let bodyJson : string = "";
|
11245
11246
|
|
11246
11247
|
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
package/client.ts
CHANGED
@@ -4981,6 +4981,7 @@ export class Client {
|
|
4981
4981
|
async getMezonOauthClient(
|
4982
4982
|
session: Session,
|
4983
4983
|
clientId?:string,
|
4984
|
+
clientName?:string,
|
4984
4985
|
): Promise<ApiMezonOauthClient> {
|
4985
4986
|
if (
|
4986
4987
|
this.autoRefreshSession &&
|
@@ -4991,7 +4992,7 @@ export class Client {
|
|
4991
4992
|
}
|
4992
4993
|
|
4993
4994
|
return this.apiClient
|
4994
|
-
.getMezonOauthClient(session.token, clientId)
|
4995
|
+
.getMezonOauthClient(session.token, clientId, clientName)
|
4995
4996
|
.then((response: ApiMezonOauthClient) => {
|
4996
4997
|
return Promise.resolve(response);
|
4997
4998
|
});
|
package/dist/api.gen.d.ts
CHANGED
@@ -2182,7 +2182,7 @@ export declare class MezonApi {
|
|
2182
2182
|
/** Handle participant meet state */
|
2183
2183
|
handleParticipantMeetState(bearerToken: string, body: ApiHandleParticipantMeetStateRequest, options?: any): Promise<any>;
|
2184
2184
|
/** Create mezon OAuth client */
|
2185
|
-
getMezonOauthClient(bearerToken: string, clientId?: string, options?: any): Promise<ApiMezonOauthClient>;
|
2185
|
+
getMezonOauthClient(bearerToken: string, clientId?: string, clientName?: string, options?: any): Promise<ApiMezonOauthClient>;
|
2186
2186
|
/** update mezon OAuth */
|
2187
2187
|
updateMezonOauthClient(bearerToken: string, body: ApiMezonOauthClient, options?: any): Promise<ApiMezonOauthClient>;
|
2188
2188
|
/** */
|
package/dist/client.d.ts
CHANGED
@@ -645,7 +645,7 @@ export declare class Client {
|
|
645
645
|
/** Handle participant meet state */
|
646
646
|
handleParticipantMeetState(session: Session, body: ApiHandleParticipantMeetStateRequest): Promise<any>;
|
647
647
|
listMezonOauthClient(session: Session): Promise<ApiMezonOauthClientList>;
|
648
|
-
getMezonOauthClient(session: Session, clientId?: string): Promise<ApiMezonOauthClient>;
|
648
|
+
getMezonOauthClient(session: Session, clientId?: string, clientName?: string): Promise<ApiMezonOauthClient>;
|
649
649
|
updateMezonOauthClient(session: Session, body: ApiMezonOauthClient): Promise<ApiMezonOauthClient>;
|
650
650
|
searchThread(session: Session, clanId?: string, channelId?: string, label?: string): Promise<ApiChannelDescList>;
|
651
651
|
generateHashChannelApps(session: Session, appId?: string): Promise<ApiCreateHashChannelAppsResponse>;
|
package/dist/mezon-js.cjs.js
CHANGED
@@ -7093,10 +7093,11 @@ var MezonApi = class {
|
|
7093
7093
|
]);
|
7094
7094
|
}
|
7095
7095
|
/** Create mezon OAuth client */
|
7096
|
-
getMezonOauthClient(bearerToken, clientId, options = {}) {
|
7096
|
+
getMezonOauthClient(bearerToken, clientId, clientName, options = {}) {
|
7097
7097
|
const urlPath = "/v2/mznoauthclient";
|
7098
7098
|
const queryParams = /* @__PURE__ */ new Map();
|
7099
7099
|
queryParams.set("client_id", clientId);
|
7100
|
+
queryParams.set("client_name", clientName);
|
7100
7101
|
let bodyJson = "";
|
7101
7102
|
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
7102
7103
|
const fetchOptions = buildFetchOptions("GET", options, bodyJson);
|
@@ -7585,6 +7586,8 @@ var _DefaultSocket = class _DefaultSocket {
|
|
7585
7586
|
this.onuserstatusevent(message.user_status_event);
|
7586
7587
|
} else if (message.join_channel_app_data) {
|
7587
7588
|
this.onJoinChannelAppEvent(message.join_channel_app_data);
|
7589
|
+
} else if (message.unpin_message_event) {
|
7590
|
+
this.onUnpinMessageEvent(message.unpin_message_event);
|
7588
7591
|
} else {
|
7589
7592
|
if (this.verbose && window && window.console) {
|
7590
7593
|
console.log("Unrecognized message received: %o", message);
|
@@ -7927,6 +7930,11 @@ var _DefaultSocket = class _DefaultSocket {
|
|
7927
7930
|
console.log(join_channel_app_data);
|
7928
7931
|
}
|
7929
7932
|
}
|
7933
|
+
onUnpinMessageEvent(unpin_message_event) {
|
7934
|
+
if (this.verbose && window && window.console) {
|
7935
|
+
console.log(unpin_message_event);
|
7936
|
+
}
|
7937
|
+
}
|
7930
7938
|
send(message, sendTimeout = _DefaultSocket.DefaultSendTimeoutMs) {
|
7931
7939
|
const untypedMessage = message;
|
7932
7940
|
return new Promise((resolve, reject) => {
|
@@ -10954,12 +10962,12 @@ var Client = class {
|
|
10954
10962
|
});
|
10955
10963
|
});
|
10956
10964
|
}
|
10957
|
-
getMezonOauthClient(session, clientId) {
|
10965
|
+
getMezonOauthClient(session, clientId, clientName) {
|
10958
10966
|
return __async(this, null, function* () {
|
10959
10967
|
if (this.autoRefreshSession && session.refresh_token && session.isexpired(Date.now() / 1e3)) {
|
10960
10968
|
yield this.sessionRefresh(session);
|
10961
10969
|
}
|
10962
|
-
return this.apiClient.getMezonOauthClient(session.token, clientId).then((response) => {
|
10970
|
+
return this.apiClient.getMezonOauthClient(session.token, clientId, clientName).then((response) => {
|
10963
10971
|
return Promise.resolve(response);
|
10964
10972
|
});
|
10965
10973
|
});
|
package/dist/mezon-js.esm.mjs
CHANGED
@@ -7059,10 +7059,11 @@ var MezonApi = class {
|
|
7059
7059
|
]);
|
7060
7060
|
}
|
7061
7061
|
/** Create mezon OAuth client */
|
7062
|
-
getMezonOauthClient(bearerToken, clientId, options = {}) {
|
7062
|
+
getMezonOauthClient(bearerToken, clientId, clientName, options = {}) {
|
7063
7063
|
const urlPath = "/v2/mznoauthclient";
|
7064
7064
|
const queryParams = /* @__PURE__ */ new Map();
|
7065
7065
|
queryParams.set("client_id", clientId);
|
7066
|
+
queryParams.set("client_name", clientName);
|
7066
7067
|
let bodyJson = "";
|
7067
7068
|
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
7068
7069
|
const fetchOptions = buildFetchOptions("GET", options, bodyJson);
|
@@ -7551,6 +7552,8 @@ var _DefaultSocket = class _DefaultSocket {
|
|
7551
7552
|
this.onuserstatusevent(message.user_status_event);
|
7552
7553
|
} else if (message.join_channel_app_data) {
|
7553
7554
|
this.onJoinChannelAppEvent(message.join_channel_app_data);
|
7555
|
+
} else if (message.unpin_message_event) {
|
7556
|
+
this.onUnpinMessageEvent(message.unpin_message_event);
|
7554
7557
|
} else {
|
7555
7558
|
if (this.verbose && window && window.console) {
|
7556
7559
|
console.log("Unrecognized message received: %o", message);
|
@@ -7893,6 +7896,11 @@ var _DefaultSocket = class _DefaultSocket {
|
|
7893
7896
|
console.log(join_channel_app_data);
|
7894
7897
|
}
|
7895
7898
|
}
|
7899
|
+
onUnpinMessageEvent(unpin_message_event) {
|
7900
|
+
if (this.verbose && window && window.console) {
|
7901
|
+
console.log(unpin_message_event);
|
7902
|
+
}
|
7903
|
+
}
|
7896
7904
|
send(message, sendTimeout = _DefaultSocket.DefaultSendTimeoutMs) {
|
7897
7905
|
const untypedMessage = message;
|
7898
7906
|
return new Promise((resolve, reject) => {
|
@@ -10920,12 +10928,12 @@ var Client = class {
|
|
10920
10928
|
});
|
10921
10929
|
});
|
10922
10930
|
}
|
10923
|
-
getMezonOauthClient(session, clientId) {
|
10931
|
+
getMezonOauthClient(session, clientId, clientName) {
|
10924
10932
|
return __async(this, null, function* () {
|
10925
10933
|
if (this.autoRefreshSession && session.refresh_token && session.isexpired(Date.now() / 1e3)) {
|
10926
10934
|
yield this.sessionRefresh(session);
|
10927
10935
|
}
|
10928
|
-
return this.apiClient.getMezonOauthClient(session.token, clientId).then((response) => {
|
10936
|
+
return this.apiClient.getMezonOauthClient(session.token, clientId, clientName).then((response) => {
|
10929
10937
|
return Promise.resolve(response);
|
10930
10938
|
});
|
10931
10939
|
});
|
package/dist/socket.d.ts
CHANGED
@@ -312,6 +312,12 @@ export interface CustomStatusEvent {
|
|
312
312
|
/** no clear */
|
313
313
|
no_clear: boolean;
|
314
314
|
}
|
315
|
+
export interface UnpinMessageEvent {
|
316
|
+
id: string;
|
317
|
+
message_id: string;
|
318
|
+
channel_id: string;
|
319
|
+
clan_id: string;
|
320
|
+
}
|
315
321
|
export interface ChannelUpdatedEvent {
|
316
322
|
clan_id: string;
|
317
323
|
category_id: string;
|
@@ -843,6 +849,7 @@ export interface Socket {
|
|
843
849
|
onchannelappevent: (event: ChannelAppEvent) => void;
|
844
850
|
onuserstatusevent: (user_status_event: UserStatusEvent) => void;
|
845
851
|
onJoinChannelAppEvent: (join_channel_app_data: JoinChannelAppData) => void;
|
852
|
+
onUnpinMessageEvent: (unpin_message_event: UnpinMessageEvent) => void;
|
846
853
|
}
|
847
854
|
/** Reports an error received from a socket message. */
|
848
855
|
export interface SocketError {
|
@@ -930,6 +937,7 @@ export declare class DefaultSocket implements Socket {
|
|
930
937
|
onchannelappevent(event: ChannelAppEvent): void;
|
931
938
|
onuserstatusevent(user_status_event: UserStatusEvent): void;
|
932
939
|
onJoinChannelAppEvent(join_channel_app_data: JoinChannelAppData): void;
|
940
|
+
onUnpinMessageEvent(unpin_message_event: UnpinMessageEvent): void;
|
933
941
|
send(message: ChannelJoin | ChannelLeave | ChannelMessageSend | ChannelMessageUpdate | CustomStatusEvent | ChannelMessageRemove | MessageTypingEvent | LastSeenMessageEvent | Rpc | StatusFollow | StatusUnfollow | StatusUpdate | Ping | WebrtcSignalingFwd | IncomingCallPush | MessageButtonClicked | DropdownBoxSelected | ChannelAppEvent, sendTimeout?: number): Promise<any>;
|
934
942
|
followUsers(userIds: string[]): Promise<Status>;
|
935
943
|
joinClanChat(clan_id: string): Promise<ClanJoin>;
|
package/package.json
CHANGED
package/socket.ts
CHANGED
@@ -454,6 +454,13 @@ export interface CustomStatusEvent {
|
|
454
454
|
no_clear: boolean;
|
455
455
|
}
|
456
456
|
|
457
|
+
export interface UnpinMessageEvent {
|
458
|
+
id: string;
|
459
|
+
message_id: string;
|
460
|
+
channel_id: string;
|
461
|
+
clan_id: string;
|
462
|
+
}
|
463
|
+
|
457
464
|
export interface ChannelUpdatedEvent {
|
458
465
|
// clan id
|
459
466
|
clan_id: string;
|
@@ -1388,6 +1395,7 @@ export interface Socket {
|
|
1388
1395
|
|
1389
1396
|
onJoinChannelAppEvent: (join_channel_app_data: JoinChannelAppData) => void;
|
1390
1397
|
|
1398
|
+
onUnpinMessageEvent: (unpin_message_event: UnpinMessageEvent)=> void;
|
1391
1399
|
}
|
1392
1400
|
|
1393
1401
|
/** Reports an error received from a socket message. */
|
@@ -1671,6 +1679,8 @@ export class DefaultSocket implements Socket {
|
|
1671
1679
|
this.onuserstatusevent(<UserStatusEvent>message.user_status_event);
|
1672
1680
|
} else if (message.join_channel_app_data) {
|
1673
1681
|
this.onJoinChannelAppEvent(<JoinChannelAppData>message.join_channel_app_data);
|
1682
|
+
} else if (message.unpin_message_event) {
|
1683
|
+
this.onUnpinMessageEvent(<UnpinMessageEvent>message.unpin_message_event);
|
1674
1684
|
} else {
|
1675
1685
|
if (this.verbose && window && window.console) {
|
1676
1686
|
console.log("Unrecognized message received: %o", message);
|
@@ -2080,6 +2090,12 @@ export class DefaultSocket implements Socket {
|
|
2080
2090
|
}
|
2081
2091
|
}
|
2082
2092
|
|
2093
|
+
onUnpinMessageEvent(unpin_message_event: UnpinMessageEvent) {
|
2094
|
+
if (this.verbose && window && window.console) {
|
2095
|
+
console.log(unpin_message_event);
|
2096
|
+
}
|
2097
|
+
}
|
2098
|
+
|
2083
2099
|
send(
|
2084
2100
|
message:
|
2085
2101
|
| ChannelJoin
|