mezon-js 2.8.48 → 2.8.51
Sign up to get free protection for your applications and to get access to all the features.
- package/api.gen.ts +3 -1
- package/client.ts +13 -0
- package/dist/api.gen.d.ts +1 -0
- package/dist/client.d.ts +3 -1
- package/dist/mezon-js.cjs.js +12 -1
- package/dist/mezon-js.esm.mjs +12 -1
- package/dist/socket.d.ts +2 -1
- package/package.json +1 -1
- package/socket.ts +4 -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.
|
@@ -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";
|
@@ -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
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";
|
@@ -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
@@ -73,7 +73,7 @@ interface ChannelLeave {
|
|
73
73
|
}
|
74
74
|
export interface AddClanUserEvent {
|
75
75
|
clan_id: string;
|
76
|
-
|
76
|
+
user: AddUsers;
|
77
77
|
}
|
78
78
|
/** UserChannelAddedEvent */
|
79
79
|
export interface UserChannelAddedEvent {
|
@@ -91,6 +91,7 @@ export interface AddUsers {
|
|
91
91
|
export interface UserChannelRemovedEvent {
|
92
92
|
channel_id: string;
|
93
93
|
user_ids: string[];
|
94
|
+
channel_type: number;
|
94
95
|
}
|
95
96
|
export interface UserClanRemovedEvent {
|
96
97
|
clan_id: string;
|
package/package.json
CHANGED
package/socket.ts
CHANGED
@@ -91,8 +91,8 @@ interface ChannelLeave {
|
|
91
91
|
export interface AddClanUserEvent {
|
92
92
|
//the clan id
|
93
93
|
clan_id: string;
|
94
|
-
// the user
|
95
|
-
|
94
|
+
// the user
|
95
|
+
user: AddUsers;
|
96
96
|
}
|
97
97
|
|
98
98
|
/** UserChannelAddedEvent */
|
@@ -123,6 +123,8 @@ export interface UserChannelRemovedEvent {
|
|
123
123
|
channel_id: string;
|
124
124
|
// the user_id
|
125
125
|
user_ids: string[];
|
126
|
+
// the channel type
|
127
|
+
channel_type: number
|
126
128
|
}
|
127
129
|
|
128
130
|
export interface UserClanRemovedEvent {
|