mezon-js 2.9.13 → 2.9.15
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 +369 -0
- package/client.ts +195 -6
- package/dist/api.gen.d.ts +58 -0
- package/dist/client.d.ts +12 -3
- package/dist/mezon-js.cjs.js +341 -4
- package/dist/mezon-js.esm.mjs +341 -4
- package/dist/socket.d.ts +16 -4
- package/package.json +1 -1
- package/socket.ts +25 -5
package/dist/api.gen.d.ts
CHANGED
@@ -230,6 +230,10 @@ export interface ApiAllUsersAddChannelResponse {
|
|
230
230
|
limit?: number;
|
231
231
|
user_ids?: Array<string>;
|
232
232
|
}
|
233
|
+
/** */
|
234
|
+
export interface ApiAllUserClans {
|
235
|
+
users?: Array<ApiUser>;
|
236
|
+
}
|
233
237
|
/** App information. */
|
234
238
|
export interface ApiApp {
|
235
239
|
about?: string;
|
@@ -318,6 +322,7 @@ export interface ApiChannelDescription {
|
|
318
322
|
channel_label?: string;
|
319
323
|
channel_private?: number;
|
320
324
|
clan_id?: string;
|
325
|
+
clan_name?: string;
|
321
326
|
count_mess_unread?: number;
|
322
327
|
create_time_seconds?: number;
|
323
328
|
creator_id?: string;
|
@@ -623,6 +628,21 @@ export interface ApiGiveCoffeeEvent {
|
|
623
628
|
sender_id?: string;
|
624
629
|
token_count?: number;
|
625
630
|
}
|
631
|
+
/** */
|
632
|
+
export interface ApiHashtagDm {
|
633
|
+
channel_id?: string;
|
634
|
+
channel_label?: string;
|
635
|
+
channel_private?: number;
|
636
|
+
clan_id?: string;
|
637
|
+
clan_name?: string;
|
638
|
+
meeting_code?: string;
|
639
|
+
parrent_id?: string;
|
640
|
+
type?: number;
|
641
|
+
}
|
642
|
+
/** */
|
643
|
+
export interface ApiHashtagDmList {
|
644
|
+
hashtag_dm?: Array<ApiHashtagDm>;
|
645
|
+
}
|
626
646
|
/** Add link invite users to. */
|
627
647
|
export interface ApiInviteUserRes {
|
628
648
|
channel_id?: string;
|
@@ -761,6 +781,18 @@ export interface ApiNotification {
|
|
761
781
|
export interface ApiNotificationChannel {
|
762
782
|
channel_id?: string;
|
763
783
|
}
|
784
|
+
/** */
|
785
|
+
export interface ApiNotificationChannelCategorySetting {
|
786
|
+
action?: number;
|
787
|
+
channel_category_label?: string;
|
788
|
+
channel_category_title?: string;
|
789
|
+
id?: string;
|
790
|
+
notification_setting_type?: number;
|
791
|
+
}
|
792
|
+
/** */
|
793
|
+
export interface ApiNotificationChannelCategorySettingList {
|
794
|
+
notification_channel_category_settings_list?: Array<ApiNotificationChannelCategorySetting>;
|
795
|
+
}
|
764
796
|
/** A collection of zero or more notifications. */
|
765
797
|
export interface ApiNotificationList {
|
766
798
|
cacheable_cursor?: string;
|
@@ -886,6 +918,14 @@ export interface ApiRoleList {
|
|
886
918
|
roles?: Array<ApiRole>;
|
887
919
|
}
|
888
920
|
/** */
|
921
|
+
export interface ApiRoleListEventResponse {
|
922
|
+
clan_id?: string;
|
923
|
+
cursor?: string;
|
924
|
+
limit?: string;
|
925
|
+
roles?: ApiRoleList;
|
926
|
+
state?: string;
|
927
|
+
}
|
928
|
+
/** */
|
889
929
|
export interface ApiRoleUserList {
|
890
930
|
cursor?: string;
|
891
931
|
role_users?: Array<RoleUserListRoleUser>;
|
@@ -1324,16 +1364,30 @@ export declare class MezonApi {
|
|
1324
1364
|
importFacebookFriends(bearerToken: string, account: ApiAccountFacebook, reset?: boolean, options?: any): Promise<any>;
|
1325
1365
|
/** Import Steam friends and add them to a user's account. */
|
1326
1366
|
importSteamFriends(bearerToken: string, account: ApiAccountSteam, reset?: boolean, options?: any): Promise<any>;
|
1367
|
+
/** List GetChannelCategoryNotiSettingsList */
|
1368
|
+
getChannelCategoryNotiSettingsList(bearerToken: string, clanId?: string, options?: any): Promise<ApiNotificationChannelCategorySettingList>;
|
1327
1369
|
/** */
|
1328
1370
|
getUserProfileOnClan(bearerToken: string, clanId: string, options?: any): Promise<ApiClanProfile>;
|
1371
|
+
/** List GetNotificationChannel */
|
1372
|
+
getNotificationCategory(bearerToken: string, categoryId?: string, options?: any): Promise<ApiNotificationUserChannel>;
|
1373
|
+
/** List GetNotificationChannel */
|
1374
|
+
getNotificationChannel(bearerToken: string, channelId?: string, options?: any): Promise<ApiNotificationUserChannel>;
|
1375
|
+
/** List GetNotificationClan */
|
1376
|
+
getNotificationClan(bearerToken: string, clanId?: string, options?: any): Promise<ApiNotificationSetting>;
|
1377
|
+
/** List GetNotificationReactMessage */
|
1378
|
+
getNotificationReactMessage(bearerToken: string, channelId?: string, options?: any): Promise<ApiNotifiReactMessage>;
|
1329
1379
|
/** Give a coffee */
|
1330
1380
|
giveMeACoffee(bearerToken: string, body: ApiGiveCoffeeEvent, options?: any): Promise<any>;
|
1381
|
+
/** List HashtagDMList */
|
1382
|
+
hashtagDMList(bearerToken: string, userId?: Array<string>, limit?: number, options?: any): Promise<ApiHashtagDmList>;
|
1331
1383
|
/** Add users to a channel. */
|
1332
1384
|
createLinkInviteUser(bearerToken: string, body: ApiLinkInviteUserRequest, options?: any): Promise<ApiLinkInviteUser>;
|
1333
1385
|
/** Add users to a channel. */
|
1334
1386
|
getLinkInvite(bearerToken: string, inviteId: string, options?: any): Promise<ApiInviteUserRes>;
|
1335
1387
|
/** Add users to a channel. */
|
1336
1388
|
inviteUser(bearerToken: string, inviteId: string, options?: any): Promise<ApiInviteUserRes>;
|
1389
|
+
/** List HashtagDMList */
|
1390
|
+
listChannelByUserId(bearerToken: string, options?: any): Promise<ApiChannelDescList>;
|
1337
1391
|
/** set mute notification user channel. */
|
1338
1392
|
setMuteNotificationCategory(bearerToken: string, body: ApiSetMuteNotificationRequest, options?: any): Promise<any>;
|
1339
1393
|
/** set mute notification user channel. */
|
@@ -1374,6 +1428,8 @@ export declare class MezonApi {
|
|
1374
1428
|
changeChannelCategory(bearerToken: string, newCategoryId: string, body: MezonChangeChannelCategoryBody, options?: any): Promise<any>;
|
1375
1429
|
/** Update a role when Delete a role by ID. */
|
1376
1430
|
deleteRoleChannelDesc(bearerToken: string, body: ApiDeleteRoleRequest, options?: any): Promise<any>;
|
1431
|
+
/** ListRoles */
|
1432
|
+
listRoles(bearerToken: string, clanId?: string, limit?: string, state?: string, cursor?: string, options?: any): Promise<ApiRoleListEventResponse>;
|
1377
1433
|
/** Create a new role for clan. */
|
1378
1434
|
createRole(bearerToken: string, body: ApiCreateRoleRequest, options?: any): Promise<ApiRole>;
|
1379
1435
|
/** Update a role when Delete a role by ID. */
|
@@ -1430,6 +1486,8 @@ export declare class MezonApi {
|
|
1430
1486
|
getUsers(bearerToken: string, ids?: Array<string>, usernames?: Array<string>, facebookIds?: Array<string>, options?: any): Promise<ApiUsers>;
|
1431
1487
|
/** */
|
1432
1488
|
updateUser(bearerToken: string, body: ApiUpdateUsersRequest, options?: any): Promise<any>;
|
1489
|
+
/** ListUserClansByUserId */
|
1490
|
+
listUserClansByUserId(bearerToken: string, options?: any): Promise<ApiAllUserClans>;
|
1433
1491
|
/** create webhook */
|
1434
1492
|
generateWebhook(bearerToken: string, body: ApiWebhookCreateRequest, options?: any): Promise<any>;
|
1435
1493
|
/** update webhook name by id */
|
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, 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, MezonUpdateAppBody, ApiSystemMessagesList, ApiSystemMessage, ApiSystemMessageRequest, MezonUpdateSystemMessageBody, ApiUpdateCategoryOrderRequest, ApiGiveCoffeeEvent, ApiListStreamingChannelsResponse, ApiStreamingChannelUserList, ApiRegisterStreamingChannelRequest, ApiRoleList, ApiListChannelAppsResponse,
|
16
|
+
import { ApiAccount, ApiAccountCustom, ApiAccountDevice, ApiAccountEmail, ApiAccountFacebook, ApiAccountFacebookInstantGame, ApiAccountGoogle, ApiAccountGameCenter, ApiAccountSteam, ApiChannelDescList, ApiChannelDescription, ApiCreateChannelDescRequest, ApiDeleteRoleRequest, ApiClanDescList, ApiCreateClanDescRequest, ApiClanDesc, ApiCategoryDesc, ApiCategoryDescList, 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, MezonUpdateAppBody, ApiSystemMessagesList, ApiSystemMessage, ApiSystemMessageRequest, MezonUpdateSystemMessageBody, ApiUpdateCategoryOrderRequest, ApiGiveCoffeeEvent, ApiListStreamingChannelsResponse, ApiStreamingChannelUserList, ApiRegisterStreamingChannelRequest, ApiRoleList, ApiListChannelAppsResponse, ApiNotificationChannelCategorySettingList, ApiNotificationUserChannel, ApiNotificationSetting, ApiNotifiReactMessage, ApiHashtagDmList, ApiEmojiListedResponse, ApiStickerListedResponse, ApiAllUsersAddChannelResponse, ApiRoleListEventResponse, ApiAllUserClans } from "./api.gen";
|
17
17
|
import { Session } from "./session";
|
18
18
|
import { Socket } from "./socket";
|
19
19
|
import { WebSocketAdapter } from "./web_socket_adapter";
|
@@ -560,7 +560,16 @@ export declare class Client {
|
|
560
560
|
registerStreamingChannel(session: Session, request: ApiRegisterStreamingChannelRequest): Promise<boolean>;
|
561
561
|
/** List a channel's users. */
|
562
562
|
listChannelApps(session: Session, clanId: string): Promise<ApiListChannelAppsResponse>;
|
563
|
-
|
564
|
-
|
563
|
+
getChannelCategoryNotiSettingsList(session: Session, clanId: string): Promise<ApiNotificationChannelCategorySettingList>;
|
564
|
+
getNotificationCategory(session: Session, categoryId: string): Promise<ApiNotificationUserChannel>;
|
565
|
+
getNotificationChannel(session: Session, channelId: string): Promise<ApiNotificationUserChannel>;
|
566
|
+
getNotificationClan(session: Session, clanId: string): Promise<ApiNotificationSetting>;
|
567
|
+
getNotificationReactMessage(session: Session, channelId: string): Promise<ApiNotifiReactMessage>;
|
568
|
+
hashtagDMList(session: Session, userId: Array<string>, limit: number): Promise<ApiHashtagDmList>;
|
569
|
+
listChannelByUserId(session: Session): Promise<ApiChannelDescList>;
|
565
570
|
listUsersAddChannelByChannelId(session: Session, channel_id: string, limit: number): Promise<ApiAllUsersAddChannelResponse>;
|
571
|
+
getListEmojisByUserId(session: Session): Promise<ApiEmojiListedResponse>;
|
572
|
+
getListStickersByUserId(session: Session): Promise<ApiStickerListedResponse>;
|
573
|
+
listUserClansByUserId(session: Session): Promise<ApiAllUserClans>;
|
574
|
+
listRoles(session: Session, clanId?: string, limit?: string, state?: string, cursor?: string): Promise<ApiRoleListEventResponse>;
|
566
575
|
}
|
package/dist/mezon-js.cjs.js
CHANGED
@@ -3257,6 +3257,32 @@ var MezonApi = class {
|
|
3257
3257
|
)
|
3258
3258
|
]);
|
3259
3259
|
}
|
3260
|
+
/** List GetChannelCategoryNotiSettingsList */
|
3261
|
+
getChannelCategoryNotiSettingsList(bearerToken, clanId, options = {}) {
|
3262
|
+
const urlPath = "/v2/getChannelCategoryNotiSettingsList";
|
3263
|
+
const queryParams = /* @__PURE__ */ new Map();
|
3264
|
+
queryParams.set("clan_id", clanId);
|
3265
|
+
let bodyJson = "";
|
3266
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
3267
|
+
const fetchOptions = buildFetchOptions("GET", options, bodyJson);
|
3268
|
+
if (bearerToken) {
|
3269
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
3270
|
+
}
|
3271
|
+
return Promise.race([
|
3272
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
3273
|
+
if (response.status == 204) {
|
3274
|
+
return response;
|
3275
|
+
} else if (response.status >= 200 && response.status < 300) {
|
3276
|
+
return response.json();
|
3277
|
+
} else {
|
3278
|
+
throw response;
|
3279
|
+
}
|
3280
|
+
}),
|
3281
|
+
new Promise(
|
3282
|
+
(_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
|
3283
|
+
)
|
3284
|
+
]);
|
3285
|
+
}
|
3260
3286
|
/** */
|
3261
3287
|
getUserProfileOnClan(bearerToken, clanId, options = {}) {
|
3262
3288
|
if (clanId === null || clanId === void 0) {
|
@@ -3285,6 +3311,110 @@ var MezonApi = class {
|
|
3285
3311
|
)
|
3286
3312
|
]);
|
3287
3313
|
}
|
3314
|
+
/** List GetNotificationChannel */
|
3315
|
+
getNotificationCategory(bearerToken, categoryId, options = {}) {
|
3316
|
+
const urlPath = "/v2/getnotificationcategory";
|
3317
|
+
const queryParams = /* @__PURE__ */ new Map();
|
3318
|
+
queryParams.set("category_id", categoryId);
|
3319
|
+
let bodyJson = "";
|
3320
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
3321
|
+
const fetchOptions = buildFetchOptions("GET", options, bodyJson);
|
3322
|
+
if (bearerToken) {
|
3323
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
3324
|
+
}
|
3325
|
+
return Promise.race([
|
3326
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
3327
|
+
if (response.status == 204) {
|
3328
|
+
return response;
|
3329
|
+
} else if (response.status >= 200 && response.status < 300) {
|
3330
|
+
return response.json();
|
3331
|
+
} else {
|
3332
|
+
throw response;
|
3333
|
+
}
|
3334
|
+
}),
|
3335
|
+
new Promise(
|
3336
|
+
(_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
|
3337
|
+
)
|
3338
|
+
]);
|
3339
|
+
}
|
3340
|
+
/** List GetNotificationChannel */
|
3341
|
+
getNotificationChannel(bearerToken, channelId, options = {}) {
|
3342
|
+
const urlPath = "/v2/getnotificationchannel";
|
3343
|
+
const queryParams = /* @__PURE__ */ new Map();
|
3344
|
+
queryParams.set("channel_id", channelId);
|
3345
|
+
let bodyJson = "";
|
3346
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
3347
|
+
const fetchOptions = buildFetchOptions("GET", options, bodyJson);
|
3348
|
+
if (bearerToken) {
|
3349
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
3350
|
+
}
|
3351
|
+
return Promise.race([
|
3352
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
3353
|
+
if (response.status == 204) {
|
3354
|
+
return response;
|
3355
|
+
} else if (response.status >= 200 && response.status < 300) {
|
3356
|
+
return response.json();
|
3357
|
+
} else {
|
3358
|
+
throw response;
|
3359
|
+
}
|
3360
|
+
}),
|
3361
|
+
new Promise(
|
3362
|
+
(_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
|
3363
|
+
)
|
3364
|
+
]);
|
3365
|
+
}
|
3366
|
+
/** List GetNotificationClan */
|
3367
|
+
getNotificationClan(bearerToken, clanId, options = {}) {
|
3368
|
+
const urlPath = "/v2/getnotificationclan";
|
3369
|
+
const queryParams = /* @__PURE__ */ new Map();
|
3370
|
+
queryParams.set("clan_id", clanId);
|
3371
|
+
let bodyJson = "";
|
3372
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
3373
|
+
const fetchOptions = buildFetchOptions("GET", options, bodyJson);
|
3374
|
+
if (bearerToken) {
|
3375
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
3376
|
+
}
|
3377
|
+
return Promise.race([
|
3378
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
3379
|
+
if (response.status == 204) {
|
3380
|
+
return response;
|
3381
|
+
} else if (response.status >= 200 && response.status < 300) {
|
3382
|
+
return response.json();
|
3383
|
+
} else {
|
3384
|
+
throw response;
|
3385
|
+
}
|
3386
|
+
}),
|
3387
|
+
new Promise(
|
3388
|
+
(_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
|
3389
|
+
)
|
3390
|
+
]);
|
3391
|
+
}
|
3392
|
+
/** List GetNotificationReactMessage */
|
3393
|
+
getNotificationReactMessage(bearerToken, channelId, options = {}) {
|
3394
|
+
const urlPath = "/v2/getnotificationreactmessage";
|
3395
|
+
const queryParams = /* @__PURE__ */ new Map();
|
3396
|
+
queryParams.set("channel_id", channelId);
|
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
|
+
}
|
3288
3418
|
/** Give a coffee */
|
3289
3419
|
giveMeACoffee(bearerToken, body, options = {}) {
|
3290
3420
|
if (body === null || body === void 0) {
|
@@ -3314,6 +3444,33 @@ var MezonApi = class {
|
|
3314
3444
|
)
|
3315
3445
|
]);
|
3316
3446
|
}
|
3447
|
+
/** List HashtagDMList */
|
3448
|
+
hashtagDMList(bearerToken, userId, limit, options = {}) {
|
3449
|
+
const urlPath = "/v2/hashtagdmlist";
|
3450
|
+
const queryParams = /* @__PURE__ */ new Map();
|
3451
|
+
queryParams.set("user_id", userId);
|
3452
|
+
queryParams.set("limit", limit);
|
3453
|
+
let bodyJson = "";
|
3454
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
3455
|
+
const fetchOptions = buildFetchOptions("GET", options, bodyJson);
|
3456
|
+
if (bearerToken) {
|
3457
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
3458
|
+
}
|
3459
|
+
return Promise.race([
|
3460
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
3461
|
+
if (response.status == 204) {
|
3462
|
+
return response;
|
3463
|
+
} else if (response.status >= 200 && response.status < 300) {
|
3464
|
+
return response.json();
|
3465
|
+
} else {
|
3466
|
+
throw response;
|
3467
|
+
}
|
3468
|
+
}),
|
3469
|
+
new Promise(
|
3470
|
+
(_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
|
3471
|
+
)
|
3472
|
+
]);
|
3473
|
+
}
|
3317
3474
|
/** Add users to a channel. */
|
3318
3475
|
createLinkInviteUser(bearerToken, body, options = {}) {
|
3319
3476
|
if (body === null || body === void 0) {
|
@@ -3399,6 +3556,31 @@ var MezonApi = class {
|
|
3399
3556
|
)
|
3400
3557
|
]);
|
3401
3558
|
}
|
3559
|
+
/** List HashtagDMList */
|
3560
|
+
listChannelByUserId(bearerToken, options = {}) {
|
3561
|
+
const urlPath = "/v2/listchannelbyuserid";
|
3562
|
+
const queryParams = /* @__PURE__ */ new Map();
|
3563
|
+
let bodyJson = "";
|
3564
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
3565
|
+
const fetchOptions = buildFetchOptions("GET", options, bodyJson);
|
3566
|
+
if (bearerToken) {
|
3567
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
3568
|
+
}
|
3569
|
+
return Promise.race([
|
3570
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
3571
|
+
if (response.status == 204) {
|
3572
|
+
return response;
|
3573
|
+
} else if (response.status >= 200 && response.status < 300) {
|
3574
|
+
return response.json();
|
3575
|
+
} else {
|
3576
|
+
throw response;
|
3577
|
+
}
|
3578
|
+
}),
|
3579
|
+
new Promise(
|
3580
|
+
(_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
|
3581
|
+
)
|
3582
|
+
]);
|
3583
|
+
}
|
3402
3584
|
/** set mute notification user channel. */
|
3403
3585
|
setMuteNotificationCategory(bearerToken, body, options = {}) {
|
3404
3586
|
if (body === null || body === void 0) {
|
@@ -3959,6 +4141,35 @@ var MezonApi = class {
|
|
3959
4141
|
)
|
3960
4142
|
]);
|
3961
4143
|
}
|
4144
|
+
/** ListRoles */
|
4145
|
+
listRoles(bearerToken, clanId, limit, state, cursor, options = {}) {
|
4146
|
+
const urlPath = "/v2/roles";
|
4147
|
+
const queryParams = /* @__PURE__ */ new Map();
|
4148
|
+
queryParams.set("clan_id", clanId);
|
4149
|
+
queryParams.set("limit", limit);
|
4150
|
+
queryParams.set("state", state);
|
4151
|
+
queryParams.set("cursor", cursor);
|
4152
|
+
let bodyJson = "";
|
4153
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
4154
|
+
const fetchOptions = buildFetchOptions("GET", options, bodyJson);
|
4155
|
+
if (bearerToken) {
|
4156
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
4157
|
+
}
|
4158
|
+
return Promise.race([
|
4159
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
4160
|
+
if (response.status == 204) {
|
4161
|
+
return response;
|
4162
|
+
} else if (response.status >= 200 && response.status < 300) {
|
4163
|
+
return response.json();
|
4164
|
+
} else {
|
4165
|
+
throw response;
|
4166
|
+
}
|
4167
|
+
}),
|
4168
|
+
new Promise(
|
4169
|
+
(_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
|
4170
|
+
)
|
4171
|
+
]);
|
4172
|
+
}
|
3962
4173
|
/** Create a new role for clan. */
|
3963
4174
|
createRole(bearerToken, body, options = {}) {
|
3964
4175
|
if (body === null || body === void 0) {
|
@@ -4789,6 +5000,31 @@ var MezonApi = class {
|
|
4789
5000
|
)
|
4790
5001
|
]);
|
4791
5002
|
}
|
5003
|
+
/** ListUserClansByUserId */
|
5004
|
+
listUserClansByUserId(bearerToken, options = {}) {
|
5005
|
+
const urlPath = "/v2/users/clans";
|
5006
|
+
const queryParams = /* @__PURE__ */ new Map();
|
5007
|
+
let bodyJson = "";
|
5008
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
5009
|
+
const fetchOptions = buildFetchOptions("GET", options, bodyJson);
|
5010
|
+
if (bearerToken) {
|
5011
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
5012
|
+
}
|
5013
|
+
return Promise.race([
|
5014
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
5015
|
+
if (response.status == 204) {
|
5016
|
+
return response;
|
5017
|
+
} else if (response.status >= 200 && response.status < 300) {
|
5018
|
+
return response.json();
|
5019
|
+
} else {
|
5020
|
+
throw response;
|
5021
|
+
}
|
5022
|
+
}),
|
5023
|
+
new Promise(
|
5024
|
+
(_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
|
5025
|
+
)
|
5026
|
+
]);
|
5027
|
+
}
|
4792
5028
|
/** create webhook */
|
4793
5029
|
generateWebhook(bearerToken, body, options = {}) {
|
4794
5030
|
if (body === null || body === void 0) {
|
@@ -5240,6 +5476,8 @@ var _DefaultSocket = class _DefaultSocket {
|
|
5240
5476
|
this.onstreamingchanneljoined(message.streaming_joined_event);
|
5241
5477
|
} else if (message.streaming_leaved_event) {
|
5242
5478
|
this.onstreamingchannelleaved(message.streaming_leaved_event);
|
5479
|
+
} else if (message.set_permission_channel_event) {
|
5480
|
+
this.onsetpermissionchannel(message.set_permission_channel_event);
|
5243
5481
|
} else {
|
5244
5482
|
if (this.verbose && window && window.console) {
|
5245
5483
|
console.log("Unrecognized message received: %o", message);
|
@@ -5492,6 +5730,11 @@ var _DefaultSocket = class _DefaultSocket {
|
|
5492
5730
|
console.log(streaming_leaved_event);
|
5493
5731
|
}
|
5494
5732
|
}
|
5733
|
+
onsetpermissionchannel(set_permission_channel_event) {
|
5734
|
+
if (this.verbose && window && window.console) {
|
5735
|
+
console.log(set_permission_channel_event);
|
5736
|
+
}
|
5737
|
+
}
|
5495
5738
|
send(message, sendTimeout = _DefaultSocket.DefaultSendTimeoutMs) {
|
5496
5739
|
const untypedMessage = message;
|
5497
5740
|
return new Promise((resolve, reject) => {
|
@@ -7665,22 +7908,72 @@ var Client = class {
|
|
7665
7908
|
});
|
7666
7909
|
});
|
7667
7910
|
}
|
7668
|
-
|
7911
|
+
getChannelCategoryNotiSettingsList(session, clanId) {
|
7669
7912
|
return __async(this, null, function* () {
|
7670
7913
|
if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
|
7671
7914
|
yield this.sessionRefresh(session);
|
7672
7915
|
}
|
7673
|
-
return this.apiClient.
|
7916
|
+
return this.apiClient.getChannelCategoryNotiSettingsList(session.token, clanId).then((response) => {
|
7674
7917
|
return Promise.resolve(response);
|
7675
7918
|
});
|
7676
7919
|
});
|
7677
7920
|
}
|
7678
|
-
|
7921
|
+
getNotificationCategory(session, categoryId) {
|
7679
7922
|
return __async(this, null, function* () {
|
7680
7923
|
if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
|
7681
7924
|
yield this.sessionRefresh(session);
|
7682
7925
|
}
|
7683
|
-
return this.apiClient.
|
7926
|
+
return this.apiClient.getNotificationCategory(session.token, categoryId).then((response) => {
|
7927
|
+
return Promise.resolve(response);
|
7928
|
+
});
|
7929
|
+
});
|
7930
|
+
}
|
7931
|
+
getNotificationChannel(session, channelId) {
|
7932
|
+
return __async(this, null, function* () {
|
7933
|
+
if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
|
7934
|
+
yield this.sessionRefresh(session);
|
7935
|
+
}
|
7936
|
+
return this.apiClient.getNotificationChannel(session.token, channelId).then((response) => {
|
7937
|
+
return Promise.resolve(response);
|
7938
|
+
});
|
7939
|
+
});
|
7940
|
+
}
|
7941
|
+
getNotificationClan(session, clanId) {
|
7942
|
+
return __async(this, null, function* () {
|
7943
|
+
if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
|
7944
|
+
yield this.sessionRefresh(session);
|
7945
|
+
}
|
7946
|
+
return this.apiClient.getNotificationClan(session.token, clanId).then((response) => {
|
7947
|
+
return Promise.resolve(response);
|
7948
|
+
});
|
7949
|
+
});
|
7950
|
+
}
|
7951
|
+
getNotificationReactMessage(session, channelId) {
|
7952
|
+
return __async(this, null, function* () {
|
7953
|
+
if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
|
7954
|
+
yield this.sessionRefresh(session);
|
7955
|
+
}
|
7956
|
+
return this.apiClient.getNotificationReactMessage(session.token, channelId).then((response) => {
|
7957
|
+
return Promise.resolve(response);
|
7958
|
+
});
|
7959
|
+
});
|
7960
|
+
}
|
7961
|
+
hashtagDMList(session, userId, limit) {
|
7962
|
+
return __async(this, null, function* () {
|
7963
|
+
if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
|
7964
|
+
yield this.sessionRefresh(session);
|
7965
|
+
}
|
7966
|
+
return this.apiClient.hashtagDMList(session.token, userId, limit).then((response) => {
|
7967
|
+
return Promise.resolve(response);
|
7968
|
+
});
|
7969
|
+
});
|
7970
|
+
}
|
7971
|
+
listChannelByUserId(session) {
|
7972
|
+
return __async(this, null, function* () {
|
7973
|
+
if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
|
7974
|
+
yield this.sessionRefresh(session);
|
7975
|
+
}
|
7976
|
+
return this.apiClient.listChannelByUserId(session.token).then((response) => {
|
7684
7977
|
return Promise.resolve(response);
|
7685
7978
|
});
|
7686
7979
|
});
|
@@ -7695,4 +7988,48 @@ var Client = class {
|
|
7695
7988
|
});
|
7696
7989
|
});
|
7697
7990
|
}
|
7991
|
+
getListEmojisByUserId(session) {
|
7992
|
+
return __async(this, null, function* () {
|
7993
|
+
if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
|
7994
|
+
yield this.sessionRefresh(session);
|
7995
|
+
}
|
7996
|
+
return this.apiClient.getListEmojisByUserId(session.token).then((response) => {
|
7997
|
+
return Promise.resolve(response);
|
7998
|
+
});
|
7999
|
+
});
|
8000
|
+
}
|
8001
|
+
getListStickersByUserId(session) {
|
8002
|
+
return __async(this, null, function* () {
|
8003
|
+
if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
|
8004
|
+
yield this.sessionRefresh(session);
|
8005
|
+
}
|
8006
|
+
return this.apiClient.getListStickersByUserId(session.token).then((response) => {
|
8007
|
+
return Promise.resolve(response);
|
8008
|
+
});
|
8009
|
+
});
|
8010
|
+
}
|
8011
|
+
listUserClansByUserId(session) {
|
8012
|
+
return __async(this, null, function* () {
|
8013
|
+
if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
|
8014
|
+
yield this.sessionRefresh(session);
|
8015
|
+
}
|
8016
|
+
return this.apiClient.listUserClansByUserId(session.token).then((response) => {
|
8017
|
+
return Promise.resolve(response);
|
8018
|
+
});
|
8019
|
+
});
|
8020
|
+
}
|
8021
|
+
listRoles(session, clanId, limit, state, cursor) {
|
8022
|
+
return __async(this, null, function* () {
|
8023
|
+
if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
|
8024
|
+
yield this.sessionRefresh(session);
|
8025
|
+
}
|
8026
|
+
return this.apiClient.listRoles(session.token, clanId, limit, state, cursor).then((response) => {
|
8027
|
+
var result = {
|
8028
|
+
clan_id: clanId,
|
8029
|
+
roles: response.roles
|
8030
|
+
};
|
8031
|
+
return Promise.resolve(result);
|
8032
|
+
});
|
8033
|
+
});
|
8034
|
+
}
|
7698
8035
|
};
|