mezon-js 2.8.43 → 2.8.46
Sign up to get free protection for your applications and to get access to all the features.
- package/api/api.ts +19515 -19515
- package/api.gen.ts +46 -52
- package/client.ts +14 -14
- package/dist/api.gen.d.ts +8 -16
- package/dist/client.d.ts +4 -3
- package/dist/mezon-js.cjs.js +50 -39
- package/dist/mezon-js.esm.mjs +50 -39
- package/dist/socket.d.ts +12 -0
- package/google/protobuf/timestamp.ts +220 -220
- package/google/protobuf/wrappers.ts +626 -626
- package/package.json +2 -1
- package/rtapi/realtime.ts +6670 -6670
- package/socket.ts +25 -0
- package/dist/api1.gen.d.ts +0 -1096
package/api.gen.ts
CHANGED
@@ -147,6 +147,8 @@ export interface MezonUpdateEventBody {
|
|
147
147
|
//
|
148
148
|
channel_id?: string;
|
149
149
|
//
|
150
|
+
clan_id?: string;
|
151
|
+
//
|
150
152
|
description?: string;
|
151
153
|
//
|
152
154
|
end_time?: string;
|
@@ -752,6 +754,8 @@ export interface ApiUpdateEventRequest {
|
|
752
754
|
start_time?: string;
|
753
755
|
//
|
754
756
|
title?: string;
|
757
|
+
//
|
758
|
+
clan_id?: string;
|
755
759
|
}
|
756
760
|
|
757
761
|
/** Create a role within clan. */
|
@@ -784,6 +788,8 @@ export interface ApiDeleteChannelDescRequest {
|
|
784
788
|
|
785
789
|
/** */
|
786
790
|
export interface ApiDeleteEventRequest {
|
791
|
+
//
|
792
|
+
clan_id?: string;
|
787
793
|
//The id of a event.
|
788
794
|
event_id?: string;
|
789
795
|
}
|
@@ -1105,24 +1111,6 @@ export interface ApiNotificationChannel {
|
|
1105
1111
|
channel_id?: string;
|
1106
1112
|
}
|
1107
1113
|
|
1108
|
-
/** */
|
1109
|
-
export interface ApiNotificationChannelCategoySetting {
|
1110
|
-
//
|
1111
|
-
channel_category_label?: string;
|
1112
|
-
//
|
1113
|
-
channel_category_title?: string;
|
1114
|
-
//
|
1115
|
-
id?: string;
|
1116
|
-
//
|
1117
|
-
notification_setting_type?: number;
|
1118
|
-
}
|
1119
|
-
|
1120
|
-
/** */
|
1121
|
-
export interface ApiNotificationChannelCategoySettingsList {
|
1122
|
-
//
|
1123
|
-
noti_channel_categoy_setting?: Array<ApiNotificationChannelCategoySetting>;
|
1124
|
-
}
|
1125
|
-
|
1126
1114
|
/** A collection of zero or more notifications. */
|
1127
1115
|
export interface ApiNotificationList {
|
1128
1116
|
//Use this cursor to paginate notifications. Cache this to catch up to new notifications.
|
@@ -1410,7 +1398,7 @@ export interface ApiSetMuteNotificationRequest {
|
|
1410
1398
|
//
|
1411
1399
|
active?: number;
|
1412
1400
|
//
|
1413
|
-
|
1401
|
+
id?: string;
|
1414
1402
|
//
|
1415
1403
|
notification_type?: number;
|
1416
1404
|
}
|
@@ -4518,6 +4506,7 @@ export class MezonApi {
|
|
4518
4506
|
/** Delete a event by ID. */
|
4519
4507
|
deleteEvent(bearerToken: string,
|
4520
4508
|
eventId:string,
|
4509
|
+
clanId?:string,
|
4521
4510
|
options: any = {}): Promise<any> {
|
4522
4511
|
|
4523
4512
|
if (eventId === null || eventId === undefined) {
|
@@ -4526,6 +4515,7 @@ export class MezonApi {
|
|
4526
4515
|
const urlPath = "/v2/eventmanagement/{eventId}"
|
4527
4516
|
.replace("{eventId}", encodeURIComponent(String(eventId)));
|
4528
4517
|
const queryParams = new Map<string, any>();
|
4518
|
+
queryParams.set("clan_id", clanId);
|
4529
4519
|
|
4530
4520
|
let bodyJson : string = "";
|
4531
4521
|
|
@@ -4554,7 +4544,7 @@ export class MezonApi {
|
|
4554
4544
|
/** Update fields in a given event. */
|
4555
4545
|
updateEvent(bearerToken: string,
|
4556
4546
|
eventId:string,
|
4557
|
-
body:
|
4547
|
+
body:MezonUpdateEventBody,
|
4558
4548
|
options: any = {}): Promise<any> {
|
4559
4549
|
|
4560
4550
|
if (eventId === null || eventId === undefined) {
|
@@ -4954,6 +4944,42 @@ export class MezonApi {
|
|
4954
4944
|
]);
|
4955
4945
|
}
|
4956
4946
|
|
4947
|
+
/** set mute notification user channel. */
|
4948
|
+
setMuteNotificationCategory(bearerToken: string,
|
4949
|
+
body:ApiSetMuteNotificationRequest,
|
4950
|
+
options: any = {}): Promise<any> {
|
4951
|
+
|
4952
|
+
if (body === null || body === undefined) {
|
4953
|
+
throw new Error("'body' is a required parameter but is null or undefined.");
|
4954
|
+
}
|
4955
|
+
const urlPath = "/v2/mutenotificationcategory/set";
|
4956
|
+
const queryParams = new Map<string, any>();
|
4957
|
+
|
4958
|
+
let bodyJson : string = "";
|
4959
|
+
bodyJson = JSON.stringify(body || {});
|
4960
|
+
|
4961
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
4962
|
+
const fetchOptions = buildFetchOptions("POST", options, bodyJson);
|
4963
|
+
if (bearerToken) {
|
4964
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
4965
|
+
}
|
4966
|
+
|
4967
|
+
return Promise.race([
|
4968
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
4969
|
+
if (response.status == 204) {
|
4970
|
+
return response;
|
4971
|
+
} else if (response.status >= 200 && response.status < 300) {
|
4972
|
+
return response.json();
|
4973
|
+
} else {
|
4974
|
+
throw response;
|
4975
|
+
}
|
4976
|
+
}),
|
4977
|
+
new Promise((_, reject) =>
|
4978
|
+
setTimeout(reject, this.timeoutMs, "Request timed out.")
|
4979
|
+
),
|
4980
|
+
]);
|
4981
|
+
}
|
4982
|
+
|
4957
4983
|
/** set mute notification user channel. */
|
4958
4984
|
setMuteNotificationChannel(bearerToken: string,
|
4959
4985
|
body:ApiSetMuteNotificationRequest,
|
@@ -5234,38 +5260,6 @@ export class MezonApi {
|
|
5234
5260
|
]);
|
5235
5261
|
}
|
5236
5262
|
|
5237
|
-
/** notification category, channel selected */
|
5238
|
-
getChannelCategoryNotiSettingsList(bearerToken: string,
|
5239
|
-
clanId?:string,
|
5240
|
-
options: any = {}): Promise<ApiNotificationChannelCategoySettingsList> {
|
5241
|
-
|
5242
|
-
const urlPath = "/v2/notifichannelcategory/get";
|
5243
|
-
const queryParams = new Map<string, any>();
|
5244
|
-
queryParams.set("clan_id", clanId);
|
5245
|
-
|
5246
|
-
let bodyJson : string = "";
|
5247
|
-
|
5248
|
-
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
5249
|
-
const fetchOptions = buildFetchOptions("GET", options, bodyJson);
|
5250
|
-
if (bearerToken) {
|
5251
|
-
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
5252
|
-
}
|
5253
|
-
|
5254
|
-
return Promise.race([
|
5255
|
-
fetch(fullUrl, fetchOptions).then((response) => {
|
5256
|
-
if (response.status == 204) {
|
5257
|
-
return response;
|
5258
|
-
} else if (response.status >= 200 && response.status < 300) {
|
5259
|
-
return response.json();
|
5260
|
-
} else {
|
5261
|
-
throw response;
|
5262
|
-
}
|
5263
|
-
}),
|
5264
|
-
new Promise((_, reject) =>
|
5265
|
-
setTimeout(reject, this.timeoutMs, "Request timed out.")
|
5266
|
-
),
|
5267
|
-
]);
|
5268
|
-
}
|
5269
5263
|
/** */
|
5270
5264
|
deleteNotiReactMessage(bearerToken: string,
|
5271
5265
|
channelId?:string,
|
package/client.ts
CHANGED
@@ -73,7 +73,6 @@ import {
|
|
73
73
|
ApiEventManagement,
|
74
74
|
ApiEventList,
|
75
75
|
ApiDeleteEventRequest,
|
76
|
-
ApiNotificationChannelCategoySettingsList,
|
77
76
|
ApiSetDefaultNotificationRequest,
|
78
77
|
ApiSetNotificationRequest,
|
79
78
|
ApiSetMuteNotificationRequest,
|
@@ -847,13 +846,13 @@ export class Client {
|
|
847
846
|
}
|
848
847
|
|
849
848
|
/** Delete a event by ID. */
|
850
|
-
async deleteEvent(session: Session,
|
849
|
+
async deleteEvent(session: Session, eventId: string, clanId: string): Promise<boolean> {
|
851
850
|
if (this.autoRefreshSession && session.refresh_token &&
|
852
851
|
session.isexpired((Date.now() + this.expiredTimespanMs)/1000)) {
|
853
852
|
await this.sessionRefresh(session);
|
854
853
|
}
|
855
854
|
|
856
|
-
return this.apiClient.deleteEvent(session.token,
|
855
|
+
return this.apiClient.deleteEvent(session.token, eventId, clanId).then((response: any) => {
|
857
856
|
return response !== undefined;
|
858
857
|
});
|
859
858
|
}
|
@@ -1932,6 +1931,18 @@ async setNotificationChannel(session: Session, request: ApiSetNotificationReques
|
|
1932
1931
|
});
|
1933
1932
|
}
|
1934
1933
|
|
1934
|
+
/** Set notification category*/
|
1935
|
+
async setMuteNotificationCategory(session: Session, request: ApiSetMuteNotificationRequest): Promise<boolean> {
|
1936
|
+
if (this.autoRefreshSession && session.refresh_token &&
|
1937
|
+
session.isexpired((Date.now() + this.expiredTimespanMs)/1000)) {
|
1938
|
+
await this.sessionRefresh(session);
|
1939
|
+
}
|
1940
|
+
|
1941
|
+
return this.apiClient.setMuteNotificationCategory(session.token, request).then((response: any) => {
|
1942
|
+
return response !== undefined;
|
1943
|
+
});
|
1944
|
+
}
|
1945
|
+
|
1935
1946
|
/** Set notification channel*/
|
1936
1947
|
async setMuteNotificationChannel(session: Session, request: ApiSetMuteNotificationRequest): Promise<boolean> {
|
1937
1948
|
if (this.autoRefreshSession && session.refresh_token &&
|
@@ -1979,17 +1990,6 @@ async deleteNotificationCategory(session: Session, category_id: string): Promise
|
|
1979
1990
|
});
|
1980
1991
|
}
|
1981
1992
|
|
1982
|
-
async getChannelCategoryNotiSettingsList(session: Session, clan_id: string): Promise<ApiNotificationChannelCategoySettingsList> {
|
1983
|
-
if (this.autoRefreshSession && session.refresh_token &&
|
1984
|
-
session.isexpired((Date.now() + this.expiredTimespanMs)/1000)) {
|
1985
|
-
await this.sessionRefresh(session);
|
1986
|
-
}
|
1987
|
-
|
1988
|
-
return this.apiClient.getChannelCategoryNotiSettingsList(session.token, clan_id).then((response: ApiNotificationChannelCategoySettingsList) => {
|
1989
|
-
return Promise.resolve(response);
|
1990
|
-
});
|
1991
|
-
}
|
1992
|
-
|
1993
1993
|
async deleteNotificationChannel(session: Session, channel_id: string): Promise<boolean> {
|
1994
1994
|
if (this.autoRefreshSession && session.refresh_token &&
|
1995
1995
|
session.isexpired((Date.now() + this.expiredTimespanMs)/1000)) {
|
package/dist/api.gen.d.ts
CHANGED
@@ -84,6 +84,7 @@ export interface MezonUpdateClanStickerByIdBody {
|
|
84
84
|
export interface MezonUpdateEventBody {
|
85
85
|
address?: string;
|
86
86
|
channel_id?: string;
|
87
|
+
clan_id?: string;
|
87
88
|
description?: string;
|
88
89
|
end_time?: string;
|
89
90
|
logo?: string;
|
@@ -430,6 +431,7 @@ export interface ApiUpdateEventRequest {
|
|
430
431
|
logo?: string;
|
431
432
|
start_time?: string;
|
432
433
|
title?: string;
|
434
|
+
clan_id?: string;
|
433
435
|
}
|
434
436
|
/** Create a role within clan. */
|
435
437
|
export interface ApiCreateRoleRequest {
|
@@ -449,6 +451,7 @@ export interface ApiDeleteChannelDescRequest {
|
|
449
451
|
}
|
450
452
|
/** */
|
451
453
|
export interface ApiDeleteEventRequest {
|
454
|
+
clan_id?: string;
|
452
455
|
event_id?: string;
|
453
456
|
}
|
454
457
|
/** Delete a role the user has access to. */
|
@@ -639,17 +642,6 @@ export interface ApiNotification {
|
|
639
642
|
export interface ApiNotificationChannel {
|
640
643
|
channel_id?: string;
|
641
644
|
}
|
642
|
-
/** */
|
643
|
-
export interface ApiNotificationChannelCategoySetting {
|
644
|
-
channel_category_label?: string;
|
645
|
-
channel_category_title?: string;
|
646
|
-
id?: string;
|
647
|
-
notification_setting_type?: number;
|
648
|
-
}
|
649
|
-
/** */
|
650
|
-
export interface ApiNotificationChannelCategoySettingsList {
|
651
|
-
noti_channel_categoy_setting?: Array<ApiNotificationChannelCategoySetting>;
|
652
|
-
}
|
653
645
|
/** A collection of zero or more notifications. */
|
654
646
|
export interface ApiNotificationList {
|
655
647
|
cacheable_cursor?: string;
|
@@ -817,7 +809,7 @@ export interface ApiSetDefaultNotificationRequest {
|
|
817
809
|
/** */
|
818
810
|
export interface ApiSetMuteNotificationRequest {
|
819
811
|
active?: number;
|
820
|
-
|
812
|
+
id?: string;
|
821
813
|
notification_type?: number;
|
822
814
|
}
|
823
815
|
/** */
|
@@ -1137,9 +1129,9 @@ export declare class MezonApi {
|
|
1137
1129
|
/** Update fields in a given event. */
|
1138
1130
|
updateEventUser(bearerToken: string, body: ApiDeleteEventRequest, options?: any): Promise<any>;
|
1139
1131
|
/** Delete a event by ID. */
|
1140
|
-
deleteEvent(bearerToken: string, eventId: string, options?: any): Promise<any>;
|
1132
|
+
deleteEvent(bearerToken: string, eventId: string, clanId?: string, options?: any): Promise<any>;
|
1141
1133
|
/** Update fields in a given event. */
|
1142
|
-
updateEvent(bearerToken: string, eventId: string, body:
|
1134
|
+
updateEvent(bearerToken: string, eventId: string, body: MezonUpdateEventBody, options?: any): Promise<any>;
|
1143
1135
|
/** Delete one or more users by ID or username. */
|
1144
1136
|
deleteFriends(bearerToken: string, ids?: Array<string>, usernames?: Array<string>, options?: any): Promise<any>;
|
1145
1137
|
/** List all friends for the current user. */
|
@@ -1161,6 +1153,8 @@ export declare class MezonApi {
|
|
1161
1153
|
/** Add users to a channel. */
|
1162
1154
|
inviteUser(bearerToken: string, inviteId: string, options?: any): Promise<ApiInviteUserRes>;
|
1163
1155
|
/** set mute notification user channel. */
|
1156
|
+
setMuteNotificationCategory(bearerToken: string, body: ApiSetMuteNotificationRequest, options?: any): Promise<any>;
|
1157
|
+
/** set mute notification user channel. */
|
1164
1158
|
setMuteNotificationChannel(bearerToken: string, body: ApiSetMuteNotificationRequest, options?: any): Promise<any>;
|
1165
1159
|
/** Delete one or more notifications for the current user. */
|
1166
1160
|
deleteNotifications(bearerToken: string, ids?: Array<string>, options?: any): Promise<any>;
|
@@ -1176,8 +1170,6 @@ export declare class MezonApi {
|
|
1176
1170
|
deleteNotificationCategorySetting(bearerToken: string, categoryId?: string, options?: any): Promise<any>;
|
1177
1171
|
/** */
|
1178
1172
|
deleteNotificationChannel(bearerToken: string, channelId?: string, options?: any): Promise<any>;
|
1179
|
-
/** notification category, channel selected */
|
1180
|
-
getChannelCategoryNotiSettingsList(bearerToken: string, clanId?: string, options?: any): Promise<ApiNotificationChannelCategoySettingsList>;
|
1181
1173
|
/** */
|
1182
1174
|
deleteNotiReactMessage(bearerToken: string, channelId?: string, options?: any): Promise<any>;
|
1183
1175
|
/** */
|
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,
|
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";
|
17
17
|
import { Session } from "./session";
|
18
18
|
import { Socket } from "./socket";
|
19
19
|
import { WebSocketAdapter } from "./web_socket_adapter";
|
@@ -379,7 +379,7 @@ export declare class Client {
|
|
379
379
|
/** Delete a role by ID. */
|
380
380
|
deleteRole(session: Session, roleId: string): Promise<boolean>;
|
381
381
|
/** Delete a event by ID. */
|
382
|
-
deleteEvent(session: Session,
|
382
|
+
deleteEvent(session: Session, eventId: string, clanId: string): Promise<boolean>;
|
383
383
|
/** update user a event by ID. */
|
384
384
|
updateEventUser(session: Session, request: ApiDeleteEventRequest): Promise<boolean>;
|
385
385
|
/** Submit an event for processing in the server's registered runtime custom events handler. */
|
@@ -505,6 +505,8 @@ export declare class Client {
|
|
505
505
|
setNotificationClan(session: Session, request: ApiSetDefaultNotificationRequest): Promise<boolean>;
|
506
506
|
/** Set notification channel*/
|
507
507
|
setNotificationChannel(session: Session, request: ApiSetNotificationRequest): Promise<boolean>;
|
508
|
+
/** Set notification category*/
|
509
|
+
setMuteNotificationCategory(session: Session, request: ApiSetMuteNotificationRequest): Promise<boolean>;
|
508
510
|
/** Set notification channel*/
|
509
511
|
setMuteNotificationChannel(session: Session, request: ApiSetMuteNotificationRequest): Promise<boolean>;
|
510
512
|
/** update channel private*/
|
@@ -512,7 +514,6 @@ export declare class Client {
|
|
512
514
|
/** Set default notification category*/
|
513
515
|
setNotificationCategory(session: Session, request: ApiSetDefaultNotificationRequest): Promise<boolean>;
|
514
516
|
deleteNotificationCategory(session: Session, category_id: string): Promise<boolean>;
|
515
|
-
getChannelCategoryNotiSettingsList(session: Session, clan_id: string): Promise<ApiNotificationChannelCategoySettingsList>;
|
516
517
|
deleteNotificationChannel(session: Session, channel_id: string): Promise<boolean>;
|
517
518
|
/** */
|
518
519
|
setNotificationReactMessage(session: Session, channel_id: string): Promise<boolean>;
|
package/dist/mezon-js.cjs.js
CHANGED
@@ -2855,12 +2855,13 @@ var MezonApi = class {
|
|
2855
2855
|
]);
|
2856
2856
|
}
|
2857
2857
|
/** Delete a event by ID. */
|
2858
|
-
deleteEvent(bearerToken, eventId, options = {}) {
|
2858
|
+
deleteEvent(bearerToken, eventId, clanId, options = {}) {
|
2859
2859
|
if (eventId === null || eventId === void 0) {
|
2860
2860
|
throw new Error("'eventId' is a required parameter but is null or undefined.");
|
2861
2861
|
}
|
2862
2862
|
const urlPath = "/v2/eventmanagement/{eventId}".replace("{eventId}", encodeURIComponent(String(eventId)));
|
2863
2863
|
const queryParams = /* @__PURE__ */ new Map();
|
2864
|
+
queryParams.set("clan_id", clanId);
|
2864
2865
|
let bodyJson = "";
|
2865
2866
|
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
2866
2867
|
const fetchOptions = buildFetchOptions("DELETE", options, bodyJson);
|
@@ -3197,6 +3198,35 @@ var MezonApi = class {
|
|
3197
3198
|
]);
|
3198
3199
|
}
|
3199
3200
|
/** set mute notification user channel. */
|
3201
|
+
setMuteNotificationCategory(bearerToken, body, options = {}) {
|
3202
|
+
if (body === null || body === void 0) {
|
3203
|
+
throw new Error("'body' is a required parameter but is null or undefined.");
|
3204
|
+
}
|
3205
|
+
const urlPath = "/v2/mutenotificationcategory/set";
|
3206
|
+
const queryParams = /* @__PURE__ */ new Map();
|
3207
|
+
let bodyJson = "";
|
3208
|
+
bodyJson = JSON.stringify(body || {});
|
3209
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
3210
|
+
const fetchOptions = buildFetchOptions("POST", options, bodyJson);
|
3211
|
+
if (bearerToken) {
|
3212
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
3213
|
+
}
|
3214
|
+
return Promise.race([
|
3215
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
3216
|
+
if (response.status == 204) {
|
3217
|
+
return response;
|
3218
|
+
} else if (response.status >= 200 && response.status < 300) {
|
3219
|
+
return response.json();
|
3220
|
+
} else {
|
3221
|
+
throw response;
|
3222
|
+
}
|
3223
|
+
}),
|
3224
|
+
new Promise(
|
3225
|
+
(_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
|
3226
|
+
)
|
3227
|
+
]);
|
3228
|
+
}
|
3229
|
+
/** set mute notification user channel. */
|
3200
3230
|
setMuteNotificationChannel(bearerToken, body, options = {}) {
|
3201
3231
|
if (body === null || body === void 0) {
|
3202
3232
|
throw new Error("'body' is a required parameter but is null or undefined.");
|
@@ -3418,32 +3448,6 @@ var MezonApi = class {
|
|
3418
3448
|
)
|
3419
3449
|
]);
|
3420
3450
|
}
|
3421
|
-
/** notification category, channel selected */
|
3422
|
-
getChannelCategoryNotiSettingsList(bearerToken, clanId, options = {}) {
|
3423
|
-
const urlPath = "/v2/notifichannelcategory/get";
|
3424
|
-
const queryParams = /* @__PURE__ */ new Map();
|
3425
|
-
queryParams.set("clan_id", clanId);
|
3426
|
-
let bodyJson = "";
|
3427
|
-
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
3428
|
-
const fetchOptions = buildFetchOptions("GET", options, bodyJson);
|
3429
|
-
if (bearerToken) {
|
3430
|
-
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
3431
|
-
}
|
3432
|
-
return Promise.race([
|
3433
|
-
fetch(fullUrl, fetchOptions).then((response) => {
|
3434
|
-
if (response.status == 204) {
|
3435
|
-
return response;
|
3436
|
-
} else if (response.status >= 200 && response.status < 300) {
|
3437
|
-
return response.json();
|
3438
|
-
} else {
|
3439
|
-
throw response;
|
3440
|
-
}
|
3441
|
-
}),
|
3442
|
-
new Promise(
|
3443
|
-
(_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
|
3444
|
-
)
|
3445
|
-
]);
|
3446
|
-
}
|
3447
3451
|
/** */
|
3448
3452
|
deleteNotiReactMessage(bearerToken, channelId, options = {}) {
|
3449
3453
|
const urlPath = "/v2/notifireactmessage/delete";
|
@@ -5137,6 +5141,12 @@ var _DefaultSocket = class _DefaultSocket {
|
|
5137
5141
|
return response.notifi_react_message_event;
|
5138
5142
|
});
|
5139
5143
|
}
|
5144
|
+
getNotificationChannelCategorySetting(clan_id) {
|
5145
|
+
return __async(this, null, function* () {
|
5146
|
+
const response = yield this.send({ notification_channel_category_setting_event: { clan_id } });
|
5147
|
+
return response.notification_channel_category_setting_event;
|
5148
|
+
});
|
5149
|
+
}
|
5140
5150
|
pingPong() {
|
5141
5151
|
return __async(this, null, function* () {
|
5142
5152
|
if (!this.adapter.isOpen()) {
|
@@ -5527,12 +5537,12 @@ var Client = class {
|
|
5527
5537
|
});
|
5528
5538
|
}
|
5529
5539
|
/** Delete a event by ID. */
|
5530
|
-
deleteEvent(session,
|
5540
|
+
deleteEvent(session, eventId, clanId) {
|
5531
5541
|
return __async(this, null, function* () {
|
5532
5542
|
if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
|
5533
5543
|
yield this.sessionRefresh(session);
|
5534
5544
|
}
|
5535
|
-
return this.apiClient.deleteEvent(session.token,
|
5545
|
+
return this.apiClient.deleteEvent(session.token, eventId, clanId).then((response) => {
|
5536
5546
|
return response !== void 0;
|
5537
5547
|
});
|
5538
5548
|
});
|
@@ -6514,6 +6524,17 @@ var Client = class {
|
|
6514
6524
|
});
|
6515
6525
|
});
|
6516
6526
|
}
|
6527
|
+
/** Set notification category*/
|
6528
|
+
setMuteNotificationCategory(session, request) {
|
6529
|
+
return __async(this, null, function* () {
|
6530
|
+
if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
|
6531
|
+
yield this.sessionRefresh(session);
|
6532
|
+
}
|
6533
|
+
return this.apiClient.setMuteNotificationCategory(session.token, request).then((response) => {
|
6534
|
+
return response !== void 0;
|
6535
|
+
});
|
6536
|
+
});
|
6537
|
+
}
|
6517
6538
|
/** Set notification channel*/
|
6518
6539
|
setMuteNotificationChannel(session, request) {
|
6519
6540
|
return __async(this, null, function* () {
|
@@ -6557,16 +6578,6 @@ var Client = class {
|
|
6557
6578
|
});
|
6558
6579
|
});
|
6559
6580
|
}
|
6560
|
-
getChannelCategoryNotiSettingsList(session, clan_id) {
|
6561
|
-
return __async(this, null, function* () {
|
6562
|
-
if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
|
6563
|
-
yield this.sessionRefresh(session);
|
6564
|
-
}
|
6565
|
-
return this.apiClient.getChannelCategoryNotiSettingsList(session.token, clan_id).then((response) => {
|
6566
|
-
return Promise.resolve(response);
|
6567
|
-
});
|
6568
|
-
});
|
6569
|
-
}
|
6570
6581
|
deleteNotificationChannel(session, channel_id) {
|
6571
6582
|
return __async(this, null, function* () {
|
6572
6583
|
if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
|
package/dist/mezon-js.esm.mjs
CHANGED
@@ -2826,12 +2826,13 @@ var MezonApi = class {
|
|
2826
2826
|
]);
|
2827
2827
|
}
|
2828
2828
|
/** Delete a event by ID. */
|
2829
|
-
deleteEvent(bearerToken, eventId, options = {}) {
|
2829
|
+
deleteEvent(bearerToken, eventId, clanId, options = {}) {
|
2830
2830
|
if (eventId === null || eventId === void 0) {
|
2831
2831
|
throw new Error("'eventId' is a required parameter but is null or undefined.");
|
2832
2832
|
}
|
2833
2833
|
const urlPath = "/v2/eventmanagement/{eventId}".replace("{eventId}", encodeURIComponent(String(eventId)));
|
2834
2834
|
const queryParams = /* @__PURE__ */ new Map();
|
2835
|
+
queryParams.set("clan_id", clanId);
|
2835
2836
|
let bodyJson = "";
|
2836
2837
|
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
2837
2838
|
const fetchOptions = buildFetchOptions("DELETE", options, bodyJson);
|
@@ -3168,6 +3169,35 @@ var MezonApi = class {
|
|
3168
3169
|
]);
|
3169
3170
|
}
|
3170
3171
|
/** set mute notification user channel. */
|
3172
|
+
setMuteNotificationCategory(bearerToken, body, options = {}) {
|
3173
|
+
if (body === null || body === void 0) {
|
3174
|
+
throw new Error("'body' is a required parameter but is null or undefined.");
|
3175
|
+
}
|
3176
|
+
const urlPath = "/v2/mutenotificationcategory/set";
|
3177
|
+
const queryParams = /* @__PURE__ */ new Map();
|
3178
|
+
let bodyJson = "";
|
3179
|
+
bodyJson = JSON.stringify(body || {});
|
3180
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
3181
|
+
const fetchOptions = buildFetchOptions("POST", options, bodyJson);
|
3182
|
+
if (bearerToken) {
|
3183
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
3184
|
+
}
|
3185
|
+
return Promise.race([
|
3186
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
3187
|
+
if (response.status == 204) {
|
3188
|
+
return response;
|
3189
|
+
} else if (response.status >= 200 && response.status < 300) {
|
3190
|
+
return response.json();
|
3191
|
+
} else {
|
3192
|
+
throw response;
|
3193
|
+
}
|
3194
|
+
}),
|
3195
|
+
new Promise(
|
3196
|
+
(_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
|
3197
|
+
)
|
3198
|
+
]);
|
3199
|
+
}
|
3200
|
+
/** set mute notification user channel. */
|
3171
3201
|
setMuteNotificationChannel(bearerToken, body, options = {}) {
|
3172
3202
|
if (body === null || body === void 0) {
|
3173
3203
|
throw new Error("'body' is a required parameter but is null or undefined.");
|
@@ -3389,32 +3419,6 @@ var MezonApi = class {
|
|
3389
3419
|
)
|
3390
3420
|
]);
|
3391
3421
|
}
|
3392
|
-
/** notification category, channel selected */
|
3393
|
-
getChannelCategoryNotiSettingsList(bearerToken, clanId, options = {}) {
|
3394
|
-
const urlPath = "/v2/notifichannelcategory/get";
|
3395
|
-
const queryParams = /* @__PURE__ */ new Map();
|
3396
|
-
queryParams.set("clan_id", clanId);
|
3397
|
-
let bodyJson = "";
|
3398
|
-
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
3399
|
-
const fetchOptions = buildFetchOptions("GET", options, bodyJson);
|
3400
|
-
if (bearerToken) {
|
3401
|
-
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
3402
|
-
}
|
3403
|
-
return Promise.race([
|
3404
|
-
fetch(fullUrl, fetchOptions).then((response) => {
|
3405
|
-
if (response.status == 204) {
|
3406
|
-
return response;
|
3407
|
-
} else if (response.status >= 200 && response.status < 300) {
|
3408
|
-
return response.json();
|
3409
|
-
} else {
|
3410
|
-
throw response;
|
3411
|
-
}
|
3412
|
-
}),
|
3413
|
-
new Promise(
|
3414
|
-
(_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
|
3415
|
-
)
|
3416
|
-
]);
|
3417
|
-
}
|
3418
3422
|
/** */
|
3419
3423
|
deleteNotiReactMessage(bearerToken, channelId, options = {}) {
|
3420
3424
|
const urlPath = "/v2/notifireactmessage/delete";
|
@@ -5108,6 +5112,12 @@ var _DefaultSocket = class _DefaultSocket {
|
|
5108
5112
|
return response.notifi_react_message_event;
|
5109
5113
|
});
|
5110
5114
|
}
|
5115
|
+
getNotificationChannelCategorySetting(clan_id) {
|
5116
|
+
return __async(this, null, function* () {
|
5117
|
+
const response = yield this.send({ notification_channel_category_setting_event: { clan_id } });
|
5118
|
+
return response.notification_channel_category_setting_event;
|
5119
|
+
});
|
5120
|
+
}
|
5111
5121
|
pingPong() {
|
5112
5122
|
return __async(this, null, function* () {
|
5113
5123
|
if (!this.adapter.isOpen()) {
|
@@ -5498,12 +5508,12 @@ var Client = class {
|
|
5498
5508
|
});
|
5499
5509
|
}
|
5500
5510
|
/** Delete a event by ID. */
|
5501
|
-
deleteEvent(session,
|
5511
|
+
deleteEvent(session, eventId, clanId) {
|
5502
5512
|
return __async(this, null, function* () {
|
5503
5513
|
if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
|
5504
5514
|
yield this.sessionRefresh(session);
|
5505
5515
|
}
|
5506
|
-
return this.apiClient.deleteEvent(session.token,
|
5516
|
+
return this.apiClient.deleteEvent(session.token, eventId, clanId).then((response) => {
|
5507
5517
|
return response !== void 0;
|
5508
5518
|
});
|
5509
5519
|
});
|
@@ -6485,6 +6495,17 @@ var Client = class {
|
|
6485
6495
|
});
|
6486
6496
|
});
|
6487
6497
|
}
|
6498
|
+
/** Set notification category*/
|
6499
|
+
setMuteNotificationCategory(session, request) {
|
6500
|
+
return __async(this, null, function* () {
|
6501
|
+
if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
|
6502
|
+
yield this.sessionRefresh(session);
|
6503
|
+
}
|
6504
|
+
return this.apiClient.setMuteNotificationCategory(session.token, request).then((response) => {
|
6505
|
+
return response !== void 0;
|
6506
|
+
});
|
6507
|
+
});
|
6508
|
+
}
|
6488
6509
|
/** Set notification channel*/
|
6489
6510
|
setMuteNotificationChannel(session, request) {
|
6490
6511
|
return __async(this, null, function* () {
|
@@ -6528,16 +6549,6 @@ var Client = class {
|
|
6528
6549
|
});
|
6529
6550
|
});
|
6530
6551
|
}
|
6531
|
-
getChannelCategoryNotiSettingsList(session, clan_id) {
|
6532
|
-
return __async(this, null, function* () {
|
6533
|
-
if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
|
6534
|
-
yield this.sessionRefresh(session);
|
6535
|
-
}
|
6536
|
-
return this.apiClient.getChannelCategoryNotiSettingsList(session.token, clan_id).then((response) => {
|
6537
|
-
return Promise.resolve(response);
|
6538
|
-
});
|
6539
|
-
});
|
6540
|
-
}
|
6541
6552
|
deleteNotificationChannel(session, channel_id) {
|
6542
6553
|
return __async(this, null, function* () {
|
6543
6554
|
if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
|
package/dist/socket.d.ts
CHANGED
@@ -451,6 +451,16 @@ export interface NotifiReactMessage {
|
|
451
451
|
user_id?: string;
|
452
452
|
channel_id_req?: string;
|
453
453
|
}
|
454
|
+
export interface NotificationChannelCategorySetting {
|
455
|
+
id: string;
|
456
|
+
channel_category_label: string;
|
457
|
+
notification_setting_type: number;
|
458
|
+
channel_category_title: string;
|
459
|
+
}
|
460
|
+
export interface NotificationChannelCategorySettingEvent {
|
461
|
+
clan_id?: string;
|
462
|
+
notification_channel_category_settings_list?: NotificationChannelCategorySetting[];
|
463
|
+
}
|
454
464
|
/** A socket connection to Mezon server. */
|
455
465
|
export interface Socket {
|
456
466
|
/** Connection is Open */
|
@@ -552,6 +562,7 @@ export interface Socket {
|
|
552
562
|
getNotificationClanSetting(clan_id: string): Promise<NotificationClanSettingEvent>;
|
553
563
|
getNotificationReactMessage(channel_id_req: string): Promise<NotifiReactMessageEvent>;
|
554
564
|
GetPermissionByRoleIdChannelId(role_id: string, channel_id: string): Promise<PermissionRoleChannelListEvent>;
|
565
|
+
getNotificationChannelCategorySetting(clan_id: string): Promise<NotificationChannelCategorySettingEvent>;
|
555
566
|
}
|
556
567
|
/** Reports an error received from a socket message. */
|
557
568
|
export interface SocketError {
|
@@ -637,6 +648,7 @@ export declare class DefaultSocket implements Socket {
|
|
637
648
|
getNotificationCategorySetting(category_id: string): Promise<NotificationCategorySettingEvent>;
|
638
649
|
getNotificationClanSetting(clan_id: string): Promise<NotificationClanSettingEvent>;
|
639
650
|
getNotificationReactMessage(channel_id: string): Promise<NotifiReactMessageEvent>;
|
651
|
+
getNotificationChannelCategorySetting(clan_id: string): Promise<NotificationChannelCategorySettingEvent>;
|
640
652
|
private pingPong;
|
641
653
|
}
|
642
654
|
export {};
|