mezon-js 2.11.38 → 2.11.40
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 +12 -15
- package/client.ts +3 -3
- package/dist/api.gen.d.ts +2 -1
- package/dist/client.d.ts +1 -1
- package/dist/mezon-js.cjs.js +3 -21
- package/dist/mezon-js.esm.mjs +3 -21
- package/dist/socket.d.ts +1 -4
- package/package.json +1 -1
- package/socket.ts +1 -26
package/api.gen.ts
CHANGED
@@ -78,6 +78,8 @@ export interface MezonDeleteWebhookByIdBody {
|
|
78
78
|
export interface MezonUpdateAppBody {
|
79
79
|
//about the app.
|
80
80
|
about?: string;
|
81
|
+
//App url.
|
82
|
+
app_url?: string;
|
81
83
|
//Avatar URL.
|
82
84
|
applogo?: string;
|
83
85
|
//Username.
|
@@ -4908,33 +4910,28 @@ export class MezonApi {
|
|
4908
4910
|
}
|
4909
4911
|
|
4910
4912
|
/** Update one or more fields on a app. */
|
4911
|
-
|
4912
|
-
|
4913
|
-
|
4914
|
-
|
4915
|
-
|
4916
|
-
): Promise<any> {
|
4913
|
+
updateApp(bearerToken: string,
|
4914
|
+
id:string,
|
4915
|
+
body:MezonUpdateAppBody,
|
4916
|
+
options: any = {}): Promise<ApiApp> {
|
4917
|
+
|
4917
4918
|
if (id === null || id === undefined) {
|
4918
4919
|
throw new Error("'id' is a required parameter but is null or undefined.");
|
4919
4920
|
}
|
4920
4921
|
if (body === null || body === undefined) {
|
4921
|
-
throw new Error(
|
4922
|
-
"'body' is a required parameter but is null or undefined."
|
4923
|
-
);
|
4922
|
+
throw new Error("'body' is a required parameter but is null or undefined.");
|
4924
4923
|
}
|
4925
|
-
const urlPath = "/v2/apps/app/{id}"
|
4926
|
-
|
4927
|
-
encodeURIComponent(String(id))
|
4928
|
-
);
|
4924
|
+
const urlPath = "/v2/apps/app/{id}"
|
4925
|
+
.replace("{id}", encodeURIComponent(String(id)));
|
4929
4926
|
const queryParams = new Map<string, any>();
|
4930
4927
|
|
4931
|
-
let bodyJson: string = "";
|
4928
|
+
let bodyJson : string = "";
|
4932
4929
|
bodyJson = JSON.stringify(body || {});
|
4933
4930
|
|
4934
4931
|
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
4935
4932
|
const fetchOptions = buildFetchOptions("PUT", options, bodyJson);
|
4936
4933
|
if (bearerToken) {
|
4937
|
-
|
4934
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
4938
4935
|
}
|
4939
4936
|
|
4940
4937
|
return Promise.race([
|
package/client.ts
CHANGED
@@ -2810,7 +2810,7 @@ export class Client {
|
|
2810
2810
|
session: Session,
|
2811
2811
|
roleId: string,
|
2812
2812
|
request: MezonUpdateAppBody
|
2813
|
-
): Promise<
|
2813
|
+
): Promise<ApiApp> {
|
2814
2814
|
if (
|
2815
2815
|
this.autoRefreshSession &&
|
2816
2816
|
session.refresh_token &&
|
@@ -2821,8 +2821,8 @@ export class Client {
|
|
2821
2821
|
|
2822
2822
|
return this.apiClient
|
2823
2823
|
.updateApp(session.token, roleId, request)
|
2824
|
-
.then((response:
|
2825
|
-
return response
|
2824
|
+
.then((response: ApiApp) => {
|
2825
|
+
return Promise.resolve(response);
|
2826
2826
|
});
|
2827
2827
|
}
|
2828
2828
|
|
package/dist/api.gen.d.ts
CHANGED
@@ -43,6 +43,7 @@ export interface MezonDeleteWebhookByIdBody {
|
|
43
43
|
/** Update app information. */
|
44
44
|
export interface MezonUpdateAppBody {
|
45
45
|
about?: string;
|
46
|
+
app_url?: string;
|
46
47
|
applogo?: string;
|
47
48
|
appname?: string;
|
48
49
|
metadata?: string;
|
@@ -1931,7 +1932,7 @@ export declare class MezonApi {
|
|
1931
1932
|
/** Get detailed app information. */
|
1932
1933
|
getApp(bearerToken: string, id: string, options?: any): Promise<ApiApp>;
|
1933
1934
|
/** Update one or more fields on a app. */
|
1934
|
-
updateApp(bearerToken: string, id: string, body: MezonUpdateAppBody, options?: any): Promise<
|
1935
|
+
updateApp(bearerToken: string, id: string, body: MezonUpdateAppBody, options?: any): Promise<ApiApp>;
|
1935
1936
|
/** Ban a app. */
|
1936
1937
|
banApp(bearerToken: string, id: string, options?: any): Promise<any>;
|
1937
1938
|
/** Unban an app. */
|
package/dist/client.d.ts
CHANGED
@@ -519,7 +519,7 @@ export declare class Client {
|
|
519
519
|
/** Update fields in a given event. */
|
520
520
|
updateEvent(session: Session, roleId: string, request: MezonUpdateEventBody): Promise<boolean>;
|
521
521
|
/** Update fields in a given event. */
|
522
|
-
updateApp(session: Session, roleId: string, request: MezonUpdateAppBody): Promise<
|
522
|
+
updateApp(session: Session, roleId: string, request: MezonUpdateAppBody): Promise<ApiApp>;
|
523
523
|
/** Update fields in a given clan profile. */
|
524
524
|
createLinkInviteUser(session: Session, request: ApiLinkInviteUserRequest): Promise<ApiLinkInviteUser>;
|
525
525
|
/** Get link invite user */
|
package/dist/mezon-js.cjs.js
CHANGED
@@ -2062,14 +2062,9 @@ var MezonApi = class {
|
|
2062
2062
|
throw new Error("'id' is a required parameter but is null or undefined.");
|
2063
2063
|
}
|
2064
2064
|
if (body === null || body === void 0) {
|
2065
|
-
throw new Error(
|
2066
|
-
"'body' is a required parameter but is null or undefined."
|
2067
|
-
);
|
2065
|
+
throw new Error("'body' is a required parameter but is null or undefined.");
|
2068
2066
|
}
|
2069
|
-
const urlPath = "/v2/apps/app/{id}".replace(
|
2070
|
-
"{id}",
|
2071
|
-
encodeURIComponent(String(id))
|
2072
|
-
);
|
2067
|
+
const urlPath = "/v2/apps/app/{id}".replace("{id}", encodeURIComponent(String(id)));
|
2073
2068
|
const queryParams = /* @__PURE__ */ new Map();
|
2074
2069
|
let bodyJson = "";
|
2075
2070
|
bodyJson = JSON.stringify(body || {});
|
@@ -8392,19 +8387,6 @@ var _DefaultSocket = class _DefaultSocket {
|
|
8392
8387
|
return response.voice_joined_event;
|
8393
8388
|
});
|
8394
8389
|
}
|
8395
|
-
writeVoiceLeaved(id, clanId, voiceChannelId, voiceUserId) {
|
8396
|
-
return __async(this, null, function* () {
|
8397
|
-
const response = yield this.send({
|
8398
|
-
voice_leaved_event: {
|
8399
|
-
id,
|
8400
|
-
clan_id: clanId,
|
8401
|
-
voice_channel_id: voiceChannelId,
|
8402
|
-
voice_user_id: voiceUserId
|
8403
|
-
}
|
8404
|
-
});
|
8405
|
-
return response.voice_leaved_event;
|
8406
|
-
});
|
8407
|
-
}
|
8408
8390
|
writeCustomStatus(clan_id, status, time_reset, no_clear) {
|
8409
8391
|
return __async(this, null, function* () {
|
8410
8392
|
const response = yield this.send({
|
@@ -9982,7 +9964,7 @@ var Client = class {
|
|
9982
9964
|
yield this.sessionRefresh(session);
|
9983
9965
|
}
|
9984
9966
|
return this.apiClient.updateApp(session.token, roleId, request).then((response) => {
|
9985
|
-
return response
|
9967
|
+
return Promise.resolve(response);
|
9986
9968
|
});
|
9987
9969
|
});
|
9988
9970
|
}
|
package/dist/mezon-js.esm.mjs
CHANGED
@@ -2028,14 +2028,9 @@ var MezonApi = class {
|
|
2028
2028
|
throw new Error("'id' is a required parameter but is null or undefined.");
|
2029
2029
|
}
|
2030
2030
|
if (body === null || body === void 0) {
|
2031
|
-
throw new Error(
|
2032
|
-
"'body' is a required parameter but is null or undefined."
|
2033
|
-
);
|
2031
|
+
throw new Error("'body' is a required parameter but is null or undefined.");
|
2034
2032
|
}
|
2035
|
-
const urlPath = "/v2/apps/app/{id}".replace(
|
2036
|
-
"{id}",
|
2037
|
-
encodeURIComponent(String(id))
|
2038
|
-
);
|
2033
|
+
const urlPath = "/v2/apps/app/{id}".replace("{id}", encodeURIComponent(String(id)));
|
2039
2034
|
const queryParams = /* @__PURE__ */ new Map();
|
2040
2035
|
let bodyJson = "";
|
2041
2036
|
bodyJson = JSON.stringify(body || {});
|
@@ -8358,19 +8353,6 @@ var _DefaultSocket = class _DefaultSocket {
|
|
8358
8353
|
return response.voice_joined_event;
|
8359
8354
|
});
|
8360
8355
|
}
|
8361
|
-
writeVoiceLeaved(id, clanId, voiceChannelId, voiceUserId) {
|
8362
|
-
return __async(this, null, function* () {
|
8363
|
-
const response = yield this.send({
|
8364
|
-
voice_leaved_event: {
|
8365
|
-
id,
|
8366
|
-
clan_id: clanId,
|
8367
|
-
voice_channel_id: voiceChannelId,
|
8368
|
-
voice_user_id: voiceUserId
|
8369
|
-
}
|
8370
|
-
});
|
8371
|
-
return response.voice_leaved_event;
|
8372
|
-
});
|
8373
|
-
}
|
8374
8356
|
writeCustomStatus(clan_id, status, time_reset, no_clear) {
|
8375
8357
|
return __async(this, null, function* () {
|
8376
8358
|
const response = yield this.send({
|
@@ -9948,7 +9930,7 @@ var Client = class {
|
|
9948
9930
|
yield this.sessionRefresh(session);
|
9949
9931
|
}
|
9950
9932
|
return this.apiClient.updateApp(session.token, roleId, request).then((response) => {
|
9951
|
-
return response
|
9933
|
+
return Promise.resolve(response);
|
9952
9934
|
});
|
9953
9935
|
});
|
9954
9936
|
}
|
package/dist/socket.d.ts
CHANGED
@@ -289,7 +289,7 @@ export interface VoiceStartedEvent {
|
|
289
289
|
voice_channel_id: string;
|
290
290
|
}
|
291
291
|
export interface VoiceLeavedEvent {
|
292
|
-
|
292
|
+
ids: Array<string>;
|
293
293
|
clan_id: string;
|
294
294
|
voice_channel_id: string;
|
295
295
|
voice_user_id: string;
|
@@ -785,8 +785,6 @@ export interface Socket {
|
|
785
785
|
writeCustomStatus(clan_id: string, status: string, time_reset: number, no_clear: boolean): Promise<CustomStatusEvent>;
|
786
786
|
/** send voice joined */
|
787
787
|
writeVoiceJoined(id: string, clanId: string, clanName: string, voiceChannelId: string, voiceChannelLabel: string, participant: string, lastScreenshot: string): Promise<VoiceJoinedEvent>;
|
788
|
-
/** send voice leaved */
|
789
|
-
writeVoiceLeaved(id: string, clanId: string, voiceChannelId: string, voiceUserId: string): Promise<VoiceLeavedEvent>;
|
790
788
|
setHeartbeatTimeoutMs(ms: number): void;
|
791
789
|
getHeartbeatTimeoutMs(): number;
|
792
790
|
checkDuplicateName(name: string, condition_id: string, type: number): Promise<CheckNameExistedEvent>;
|
@@ -987,7 +985,6 @@ export declare class DefaultSocket implements Socket {
|
|
987
985
|
writeLastSeenMessage(clan_id: string, channel_id: string, mode: number, message_id: string, timestamp_seconds: number, badge_count: number): Promise<LastSeenMessageEvent>;
|
988
986
|
writeLastPinMessage(clan_id: string, channel_id: string, mode: number, is_public: boolean, message_id: string, timestamp_seconds: number, operation: number): Promise<LastPinMessageEvent>;
|
989
987
|
writeVoiceJoined(id: string, clanId: string, clanName: string, voiceChannelId: string, voiceChannelLabel: string, participant: string, lastScreenshot: string): Promise<VoiceJoinedEvent>;
|
990
|
-
writeVoiceLeaved(id: string, clanId: string, voiceChannelId: string, voiceUserId: string): Promise<VoiceLeavedEvent>;
|
991
988
|
writeCustomStatus(clan_id: string, status: string, time_reset: number, no_clear: boolean): Promise<CustomStatusEvent>;
|
992
989
|
checkDuplicateName(name: string, condition_id: string, type: number): Promise<CheckNameExistedEvent>;
|
993
990
|
forwardWebrtcSignaling(receiver_id: string, data_type: number, json_data: string, channel_id: string, caller_id: string): Promise<WebrtcSignalingFwd>;
|
package/package.json
CHANGED
package/socket.ts
CHANGED
@@ -417,7 +417,7 @@ export interface VoiceStartedEvent {
|
|
417
417
|
|
418
418
|
export interface VoiceLeavedEvent {
|
419
419
|
// event id
|
420
|
-
|
420
|
+
ids: Array<string>;
|
421
421
|
// clan id
|
422
422
|
clan_id: string;
|
423
423
|
// voice channel name
|
@@ -1218,14 +1218,6 @@ export interface Socket {
|
|
1218
1218
|
lastScreenshot: string
|
1219
1219
|
): Promise<VoiceJoinedEvent>;
|
1220
1220
|
|
1221
|
-
/** send voice leaved */
|
1222
|
-
writeVoiceLeaved(
|
1223
|
-
id: string,
|
1224
|
-
clanId: string,
|
1225
|
-
voiceChannelId: string,
|
1226
|
-
voiceUserId: string
|
1227
|
-
): Promise<VoiceLeavedEvent>;
|
1228
|
-
|
1229
1221
|
/* Set the heartbeat timeout used by the socket to detect if it has lost connectivity to the server. */
|
1230
1222
|
setHeartbeatTimeoutMs(ms: number): void;
|
1231
1223
|
|
@@ -2529,23 +2521,6 @@ export class DefaultSocket implements Socket {
|
|
2529
2521
|
return response.voice_joined_event;
|
2530
2522
|
}
|
2531
2523
|
|
2532
|
-
async writeVoiceLeaved(
|
2533
|
-
id: string,
|
2534
|
-
clanId: string,
|
2535
|
-
voiceChannelId: string,
|
2536
|
-
voiceUserId: string
|
2537
|
-
): Promise<VoiceLeavedEvent> {
|
2538
|
-
const response = await this.send({
|
2539
|
-
voice_leaved_event: {
|
2540
|
-
id: id,
|
2541
|
-
clan_id: clanId,
|
2542
|
-
voice_channel_id: voiceChannelId,
|
2543
|
-
voice_user_id: voiceUserId,
|
2544
|
-
},
|
2545
|
-
});
|
2546
|
-
return response.voice_leaved_event;
|
2547
|
-
}
|
2548
|
-
|
2549
2524
|
async writeCustomStatus(
|
2550
2525
|
clan_id: string,
|
2551
2526
|
status: string,
|