mezon-js 2.8.49 → 2.8.52
Sign up to get free protection for your applications and to get access to all the features.
- package/api.gen.ts +5 -3
- package/client.ts +14 -1
- package/dist/api.gen.d.ts +3 -2
- package/dist/client.d.ts +4 -2
- package/dist/mezon-js.cjs.js +12 -1
- package/dist/mezon-js.esm.mjs +12 -1
- package/dist/socket.d.ts +1 -1
- package/package.json +1 -1
- package/socket.ts +2 -2
package/api.gen.ts
CHANGED
@@ -44,6 +44,8 @@ export interface MezonChangeChannelCategoryBody {
|
|
44
44
|
|
45
45
|
/** Update app information. */
|
46
46
|
export interface MezonUpdateAppBody {
|
47
|
+
//about the app.
|
48
|
+
about?: string;
|
47
49
|
//Avatar URL.
|
48
50
|
applogo?: string;
|
49
51
|
//Username.
|
@@ -311,7 +313,7 @@ export interface ApiAccountGameCenter {
|
|
311
313
|
//The verification signature data generated.
|
312
314
|
signature?: string;
|
313
315
|
//Time since UNIX epoch when the signature was created.
|
314
|
-
timestamp_seconds?:
|
316
|
+
timestamp_seconds?: number;
|
315
317
|
//Extra information that will be bundled in the session token.
|
316
318
|
vars?: Record<string, string>;
|
317
319
|
}
|
@@ -559,7 +561,7 @@ export interface ApiChannelMessageHeader {
|
|
559
561
|
//
|
560
562
|
sender_id?: string;
|
561
563
|
//
|
562
|
-
|
564
|
+
timestamp_seconds?: number;
|
563
565
|
}
|
564
566
|
|
565
567
|
/** A list of channel messages, usually a result of a list operation. */
|
@@ -3114,7 +3116,7 @@ export class MezonApi {
|
|
3114
3116
|
bodyJson = JSON.stringify(body || {});
|
3115
3117
|
|
3116
3118
|
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
3117
|
-
const fetchOptions = buildFetchOptions("
|
3119
|
+
const fetchOptions = buildFetchOptions("PUT", options, bodyJson);
|
3118
3120
|
if (bearerToken) {
|
3119
3121
|
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
3120
3122
|
}
|
package/client.ts
CHANGED
@@ -97,6 +97,7 @@ import {
|
|
97
97
|
ApiAppList,
|
98
98
|
ApiApp,
|
99
99
|
MezonUpdateRoleDeleteBody,
|
100
|
+
MezonUpdateAppBody,
|
100
101
|
} from "./api.gen";
|
101
102
|
|
102
103
|
import { Session } from "./session";
|
@@ -616,7 +617,7 @@ export class Client {
|
|
616
617
|
publicKeyUrl: string,
|
617
618
|
salt: string,
|
618
619
|
signature: string,
|
619
|
-
timestamp:
|
620
|
+
timestamp: number,
|
620
621
|
username?: string,
|
621
622
|
create?: boolean,
|
622
623
|
vars?: Record<string, string>,
|
@@ -1855,6 +1856,18 @@ export class Client {
|
|
1855
1856
|
});
|
1856
1857
|
}
|
1857
1858
|
|
1859
|
+
/** Update fields in a given event. */
|
1860
|
+
async updateApp(session: Session, roleId: string, request: MezonUpdateAppBody): Promise<boolean> {
|
1861
|
+
if (this.autoRefreshSession && session.refresh_token &&
|
1862
|
+
session.isexpired((Date.now() + this.expiredTimespanMs)/1000)) {
|
1863
|
+
await this.sessionRefresh(session);
|
1864
|
+
}
|
1865
|
+
|
1866
|
+
return this.apiClient.updateApp(session.token, roleId, request).then((response: any) => {
|
1867
|
+
return response !== undefined;
|
1868
|
+
});
|
1869
|
+
}
|
1870
|
+
|
1858
1871
|
/** Update fields in a given clan profile. */
|
1859
1872
|
async createLinkInviteUser(session: Session, request: ApiLinkInviteUserRequest): Promise<ApiLinkInviteUser> {
|
1860
1873
|
if (this.autoRefreshSession && session.refresh_token &&
|
package/dist/api.gen.d.ts
CHANGED
@@ -22,6 +22,7 @@ export interface MezonChangeChannelCategoryBody {
|
|
22
22
|
}
|
23
23
|
/** Update app information. */
|
24
24
|
export interface MezonUpdateAppBody {
|
25
|
+
about?: string;
|
25
26
|
applogo?: string;
|
26
27
|
appname?: string;
|
27
28
|
metadata?: string;
|
@@ -180,7 +181,7 @@ export interface ApiAccountGameCenter {
|
|
180
181
|
public_key_url?: string;
|
181
182
|
salt?: string;
|
182
183
|
signature?: string;
|
183
|
-
timestamp_seconds?:
|
184
|
+
timestamp_seconds?: number;
|
184
185
|
vars?: Record<string, string>;
|
185
186
|
}
|
186
187
|
/** Send a Google token to the server. Used with authenticate/link/unlink. */
|
@@ -318,7 +319,7 @@ export interface ApiChannelMessageHeader {
|
|
318
319
|
reaction?: string;
|
319
320
|
referece?: string;
|
320
321
|
sender_id?: string;
|
321
|
-
|
322
|
+
timestamp_seconds?: number;
|
322
323
|
}
|
323
324
|
/** A list of channel messages, usually a result of a list operation. */
|
324
325
|
export interface ApiChannelMessageList {
|
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, ApiRoleList, 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, MezonUpdateRoleDeleteBody } from "./api.gen";
|
16
|
+
import { ApiAccount, ApiAccountCustom, ApiAccountDevice, ApiAccountEmail, ApiAccountFacebook, ApiAccountFacebookInstantGame, ApiAccountGoogle, ApiAccountGameCenter, ApiAccountSteam, ApiChannelDescList, ApiChannelDescription, ApiCreateChannelDescRequest, ApiDeleteRoleRequest, ApiClanDescList, ApiCreateClanDescRequest, ApiClanDesc, ApiCategoryDesc, ApiCategoryDescList, ApiRoleList, 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, MezonUpdateRoleDeleteBody, MezonUpdateAppBody } from "./api.gen";
|
17
17
|
import { Session } from "./session";
|
18
18
|
import { Socket } from "./socket";
|
19
19
|
import { WebSocketAdapter } from "./web_socket_adapter";
|
@@ -343,7 +343,7 @@ export declare class Client {
|
|
343
343
|
/** Authenticate a user with Google against the server. */
|
344
344
|
authenticateGoogle(token: string, create?: boolean, username?: string, vars?: Record<string, string>, options?: any): Promise<Session>;
|
345
345
|
/** Authenticate a user with GameCenter against the server. */
|
346
|
-
authenticateGameCenter(bundleId: string, playerId: string, publicKeyUrl: string, salt: string, signature: string, timestamp:
|
346
|
+
authenticateGameCenter(bundleId: string, playerId: string, publicKeyUrl: string, salt: string, signature: string, timestamp: number, username?: string, create?: boolean, vars?: Record<string, string>, options?: any): Promise<Session>;
|
347
347
|
/** Authenticate a user with Steam against the server. */
|
348
348
|
authenticateSteam(token: string, create?: boolean, username?: string, sync?: boolean, vars?: Record<string, string>): Promise<Session>;
|
349
349
|
/** Block one or more users by ID or username. */
|
@@ -493,6 +493,8 @@ export declare class Client {
|
|
493
493
|
updateRole(session: Session, roleId: string, request: ApiUpdateRoleRequest): Promise<boolean>;
|
494
494
|
/** Update fields in a given event. */
|
495
495
|
updateEvent(session: Session, roleId: string, request: ApiUpdateEventRequest): Promise<boolean>;
|
496
|
+
/** Update fields in a given event. */
|
497
|
+
updateApp(session: Session, roleId: string, request: MezonUpdateAppBody): Promise<boolean>;
|
496
498
|
/** Update fields in a given clan profile. */
|
497
499
|
createLinkInviteUser(session: Session, request: ApiLinkInviteUserRequest): Promise<ApiLinkInviteUser>;
|
498
500
|
/** Get link invite user */
|
package/dist/mezon-js.cjs.js
CHANGED
@@ -1777,7 +1777,7 @@ var MezonApi = class {
|
|
1777
1777
|
let bodyJson = "";
|
1778
1778
|
bodyJson = JSON.stringify(body || {});
|
1779
1779
|
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
1780
|
-
const fetchOptions = buildFetchOptions("
|
1780
|
+
const fetchOptions = buildFetchOptions("PUT", options, bodyJson);
|
1781
1781
|
if (bearerToken) {
|
1782
1782
|
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
1783
1783
|
}
|
@@ -6465,6 +6465,17 @@ var Client = class {
|
|
6465
6465
|
});
|
6466
6466
|
});
|
6467
6467
|
}
|
6468
|
+
/** Update fields in a given event. */
|
6469
|
+
updateApp(session, roleId, request) {
|
6470
|
+
return __async(this, null, function* () {
|
6471
|
+
if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
|
6472
|
+
yield this.sessionRefresh(session);
|
6473
|
+
}
|
6474
|
+
return this.apiClient.updateApp(session.token, roleId, request).then((response) => {
|
6475
|
+
return response !== void 0;
|
6476
|
+
});
|
6477
|
+
});
|
6478
|
+
}
|
6468
6479
|
/** Update fields in a given clan profile. */
|
6469
6480
|
createLinkInviteUser(session, request) {
|
6470
6481
|
return __async(this, null, function* () {
|
package/dist/mezon-js.esm.mjs
CHANGED
@@ -1748,7 +1748,7 @@ var MezonApi = class {
|
|
1748
1748
|
let bodyJson = "";
|
1749
1749
|
bodyJson = JSON.stringify(body || {});
|
1750
1750
|
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
1751
|
-
const fetchOptions = buildFetchOptions("
|
1751
|
+
const fetchOptions = buildFetchOptions("PUT", options, bodyJson);
|
1752
1752
|
if (bearerToken) {
|
1753
1753
|
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
1754
1754
|
}
|
@@ -6436,6 +6436,17 @@ var Client = class {
|
|
6436
6436
|
});
|
6437
6437
|
});
|
6438
6438
|
}
|
6439
|
+
/** Update fields in a given event. */
|
6440
|
+
updateApp(session, roleId, request) {
|
6441
|
+
return __async(this, null, function* () {
|
6442
|
+
if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
|
6443
|
+
yield this.sessionRefresh(session);
|
6444
|
+
}
|
6445
|
+
return this.apiClient.updateApp(session.token, roleId, request).then((response) => {
|
6446
|
+
return response !== void 0;
|
6447
|
+
});
|
6448
|
+
});
|
6449
|
+
}
|
6439
6450
|
/** Update fields in a given clan profile. */
|
6440
6451
|
createLinkInviteUser(session, request) {
|
6441
6452
|
return __async(this, null, function* () {
|
package/dist/socket.d.ts
CHANGED
package/package.json
CHANGED