mezon-js 2.9.24 → 2.9.27
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 +91 -8
- package/client.ts +40 -1
- package/dist/api.gen.d.ts +21 -1
- package/dist/client.d.ts +1 -0
- package/dist/mezon-js.cjs.js +59 -1
- package/dist/mezon-js.esm.mjs +59 -1
- package/package.json +1 -1
package/api.gen.ts
CHANGED
|
@@ -653,7 +653,7 @@ export interface ApiChannelMessage {
|
|
|
653
653
|
// channel mode
|
|
654
654
|
mode?: number;
|
|
655
655
|
// hide editted
|
|
656
|
-
|
|
656
|
+
hide_editted?: boolean;
|
|
657
657
|
}
|
|
658
658
|
|
|
659
659
|
/** */
|
|
@@ -686,6 +686,38 @@ export interface ApiChannelMessageList {
|
|
|
686
686
|
messages?: Array<ApiChannelMessage>;
|
|
687
687
|
}
|
|
688
688
|
|
|
689
|
+
/** */
|
|
690
|
+
export interface ApiChannelSettingItem {
|
|
691
|
+
//
|
|
692
|
+
active?: number;
|
|
693
|
+
//
|
|
694
|
+
category_id?: string;
|
|
695
|
+
//
|
|
696
|
+
channel_label?: string;
|
|
697
|
+
//
|
|
698
|
+
channel_private?: number;
|
|
699
|
+
//
|
|
700
|
+
channel_type?: number;
|
|
701
|
+
//
|
|
702
|
+
creator_id?: string;
|
|
703
|
+
//
|
|
704
|
+
id?: string;
|
|
705
|
+
//
|
|
706
|
+
meeting_code?: string;
|
|
707
|
+
//
|
|
708
|
+
parent_id?: string;
|
|
709
|
+
//
|
|
710
|
+
user_ids?: Array<string>;
|
|
711
|
+
}
|
|
712
|
+
|
|
713
|
+
/** */
|
|
714
|
+
export interface ApiChannelSettingListResponse {
|
|
715
|
+
//
|
|
716
|
+
channel_setting_list?: Array<ApiChannelSettingItem>;
|
|
717
|
+
//
|
|
718
|
+
clan_id?: string;
|
|
719
|
+
}
|
|
720
|
+
|
|
689
721
|
/** A list of users belonging to a channel, along with their role. */
|
|
690
722
|
export interface ApiChannelUserList {
|
|
691
723
|
//
|
|
@@ -4340,6 +4372,58 @@ export class MezonApi {
|
|
|
4340
4372
|
]);
|
|
4341
4373
|
}
|
|
4342
4374
|
|
|
4375
|
+
/** List channel setting */
|
|
4376
|
+
listChannelSetting(bearerToken: string,
|
|
4377
|
+
clanId:string,
|
|
4378
|
+
parentId?:string,
|
|
4379
|
+
categoryId?:string,
|
|
4380
|
+
privateChannel?:number,
|
|
4381
|
+
active?:number,
|
|
4382
|
+
status?:number,
|
|
4383
|
+
type?:number,
|
|
4384
|
+
limit?:number,
|
|
4385
|
+
page?:number,
|
|
4386
|
+
options: any = {}): Promise<ApiChannelSettingListResponse> {
|
|
4387
|
+
|
|
4388
|
+
if (clanId === null || clanId === undefined) {
|
|
4389
|
+
throw new Error("'clanId' is a required parameter but is null or undefined.");
|
|
4390
|
+
}
|
|
4391
|
+
const urlPath = "/v2/channelsetting/{clanId}"
|
|
4392
|
+
.replace("{clanId}", encodeURIComponent(String(clanId)));
|
|
4393
|
+
const queryParams = new Map<string, any>();
|
|
4394
|
+
queryParams.set("parent_id", parentId);
|
|
4395
|
+
queryParams.set("category_id", categoryId);
|
|
4396
|
+
queryParams.set("private_channel", privateChannel);
|
|
4397
|
+
queryParams.set("active", active);
|
|
4398
|
+
queryParams.set("status", status);
|
|
4399
|
+
queryParams.set("type", type);
|
|
4400
|
+
queryParams.set("limit", limit);
|
|
4401
|
+
queryParams.set("page", page);
|
|
4402
|
+
|
|
4403
|
+
let bodyJson : string = "";
|
|
4404
|
+
|
|
4405
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
|
4406
|
+
const fetchOptions = buildFetchOptions("GET", options, bodyJson);
|
|
4407
|
+
if (bearerToken) {
|
|
4408
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
|
4409
|
+
}
|
|
4410
|
+
|
|
4411
|
+
return Promise.race([
|
|
4412
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
|
4413
|
+
if (response.status == 204) {
|
|
4414
|
+
return response;
|
|
4415
|
+
} else if (response.status >= 200 && response.status < 300) {
|
|
4416
|
+
return response.json();
|
|
4417
|
+
} else {
|
|
4418
|
+
throw response;
|
|
4419
|
+
}
|
|
4420
|
+
}),
|
|
4421
|
+
new Promise((_, reject) =>
|
|
4422
|
+
setTimeout(reject, this.timeoutMs, "Request timed out.")
|
|
4423
|
+
),
|
|
4424
|
+
]);
|
|
4425
|
+
}
|
|
4426
|
+
|
|
4343
4427
|
/** List all users that are part of a channel. */
|
|
4344
4428
|
listChannelVoiceUsers(
|
|
4345
4429
|
bearerToken: string,
|
|
@@ -8188,18 +8272,17 @@ export class MezonApi {
|
|
|
8188
8272
|
}
|
|
8189
8273
|
|
|
8190
8274
|
/** ListUserPermissionInChannel */
|
|
8191
|
-
listUserPermissionInChannel(
|
|
8192
|
-
|
|
8193
|
-
|
|
8194
|
-
|
|
8195
|
-
|
|
8196
|
-
): Promise<ApiUserPermissionInChannelListResponse> {
|
|
8275
|
+
listUserPermissionInChannel(bearerToken: string,
|
|
8276
|
+
clanId?:string,
|
|
8277
|
+
channelId?:string,
|
|
8278
|
+
options: any = {}): Promise<ApiUserPermissionInChannelListResponse> {
|
|
8279
|
+
|
|
8197
8280
|
const urlPath = "/v2/users/clans/channels";
|
|
8198
8281
|
const queryParams = new Map<string, any>();
|
|
8199
8282
|
queryParams.set("clan_id", clanId);
|
|
8200
8283
|
queryParams.set("channel_id", channelId);
|
|
8201
8284
|
|
|
8202
|
-
let bodyJson: string = "";
|
|
8285
|
+
let bodyJson : string = "";
|
|
8203
8286
|
|
|
8204
8287
|
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
|
8205
8288
|
const fetchOptions = buildFetchOptions("GET", options, bodyJson);
|
package/client.ts
CHANGED
|
@@ -1429,6 +1429,7 @@ export class Client {
|
|
|
1429
1429
|
clan_id: m.clan_id,
|
|
1430
1430
|
create_time_seconds: m.create_time_seconds,
|
|
1431
1431
|
update_time_seconds: m.update_time_seconds,
|
|
1432
|
+
hide_editted: m.hide_editted,
|
|
1432
1433
|
});
|
|
1433
1434
|
});
|
|
1434
1435
|
return Promise.resolve(result);
|
|
@@ -3001,7 +3002,7 @@ export class Client {
|
|
|
3001
3002
|
session: Session,
|
|
3002
3003
|
messageId: string,
|
|
3003
3004
|
channelId: string,
|
|
3004
|
-
clanId: string
|
|
3005
|
+
clanId: string
|
|
3005
3006
|
): Promise<ApiPinMessagesList> {
|
|
3006
3007
|
if (
|
|
3007
3008
|
this.autoRefreshSession &&
|
|
@@ -3919,4 +3920,42 @@ export class Client {
|
|
|
3919
3920
|
return Promise.resolve(response);
|
|
3920
3921
|
});
|
|
3921
3922
|
}
|
|
3923
|
+
|
|
3924
|
+
async getChannelSettingInClan(
|
|
3925
|
+
session: Session,
|
|
3926
|
+
clanId: string,
|
|
3927
|
+
parentId?: string,
|
|
3928
|
+
categoryId?: string,
|
|
3929
|
+
privateChannel?: number,
|
|
3930
|
+
active?: number,
|
|
3931
|
+
status?: number,
|
|
3932
|
+
type?: number,
|
|
3933
|
+
limit?: number,
|
|
3934
|
+
page?: number
|
|
3935
|
+
): Promise<any> {
|
|
3936
|
+
if (
|
|
3937
|
+
this.autoRefreshSession &&
|
|
3938
|
+
session.refresh_token &&
|
|
3939
|
+
session.isexpired((Date.now() + this.expiredTimespanMs) / 1000)
|
|
3940
|
+
) {
|
|
3941
|
+
await this.sessionRefresh(session);
|
|
3942
|
+
}
|
|
3943
|
+
|
|
3944
|
+
return this.apiClient
|
|
3945
|
+
.listChannelSetting(
|
|
3946
|
+
session.token,
|
|
3947
|
+
clanId,
|
|
3948
|
+
parentId,
|
|
3949
|
+
categoryId,
|
|
3950
|
+
privateChannel,
|
|
3951
|
+
active,
|
|
3952
|
+
status,
|
|
3953
|
+
type,
|
|
3954
|
+
limit,
|
|
3955
|
+
page
|
|
3956
|
+
)
|
|
3957
|
+
.then((response: any) => {
|
|
3958
|
+
return Promise.resolve(response);
|
|
3959
|
+
});
|
|
3960
|
+
}
|
|
3922
3961
|
}
|
package/dist/api.gen.d.ts
CHANGED
|
@@ -376,7 +376,7 @@ export interface ApiChannelMessage {
|
|
|
376
376
|
update_time_seconds?: number;
|
|
377
377
|
username?: string;
|
|
378
378
|
mode?: number;
|
|
379
|
-
|
|
379
|
+
hide_editted?: boolean;
|
|
380
380
|
}
|
|
381
381
|
/** */
|
|
382
382
|
export interface ApiChannelMessageHeader {
|
|
@@ -395,6 +395,24 @@ export interface ApiChannelMessageList {
|
|
|
395
395
|
last_sent_message?: ApiChannelMessageHeader;
|
|
396
396
|
messages?: Array<ApiChannelMessage>;
|
|
397
397
|
}
|
|
398
|
+
/** */
|
|
399
|
+
export interface ApiChannelSettingItem {
|
|
400
|
+
active?: number;
|
|
401
|
+
category_id?: string;
|
|
402
|
+
channel_label?: string;
|
|
403
|
+
channel_private?: number;
|
|
404
|
+
channel_type?: number;
|
|
405
|
+
creator_id?: string;
|
|
406
|
+
id?: string;
|
|
407
|
+
meeting_code?: string;
|
|
408
|
+
parent_id?: string;
|
|
409
|
+
user_ids?: Array<string>;
|
|
410
|
+
}
|
|
411
|
+
/** */
|
|
412
|
+
export interface ApiChannelSettingListResponse {
|
|
413
|
+
channel_setting_list?: Array<ApiChannelSettingItem>;
|
|
414
|
+
clan_id?: string;
|
|
415
|
+
}
|
|
398
416
|
/** A list of users belonging to a channel, along with their role. */
|
|
399
417
|
export interface ApiChannelUserList {
|
|
400
418
|
channel_id?: string;
|
|
@@ -1332,6 +1350,8 @@ export declare class MezonApi {
|
|
|
1332
1350
|
deleteChannelDesc(bearerToken: string, channelId: string, options?: any): Promise<any>;
|
|
1333
1351
|
/** Update fields in a given channel. */
|
|
1334
1352
|
updateChannelDesc(bearerToken: string, channelId: string, body: {}, options?: any): Promise<any>;
|
|
1353
|
+
/** List channel setting */
|
|
1354
|
+
listChannelSetting(bearerToken: string, clanId: string, parentId?: string, categoryId?: string, privateChannel?: number, active?: number, status?: number, type?: number, limit?: number, page?: number, options?: any): Promise<ApiChannelSettingListResponse>;
|
|
1335
1355
|
/** List all users that are part of a channel. */
|
|
1336
1356
|
listChannelVoiceUsers(bearerToken: string, clanId?: string, channelId?: string, channelType?: number, limit?: number, state?: number, cursor?: string, options?: any): Promise<ApiVoiceChannelUserList>;
|
|
1337
1357
|
/** List clans */
|
package/dist/client.d.ts
CHANGED
|
@@ -577,4 +577,5 @@ export declare class Client {
|
|
|
577
577
|
listUserPermissionInChannel(session: Session, clanId?: string, channelId?: string): Promise<ApiUserPermissionInChannelListResponse>;
|
|
578
578
|
getPermissionByRoleIdChannelId(session: Session, roleId?: string, channelId?: string, userId?: string): Promise<ApiPermissionRoleChannelListEventResponse>;
|
|
579
579
|
markAsRead(session: Session, request: ApiMarkAsReadRequest): Promise<any>;
|
|
580
|
+
getChannelSettingInClan(session: Session, clanId: string, parentId?: string, categoryId?: string, privateChannel?: number, active?: number, status?: number, type?: number, limit?: number, page?: number): Promise<any>;
|
|
580
581
|
}
|
package/dist/mezon-js.cjs.js
CHANGED
|
@@ -2436,6 +2436,42 @@ var MezonApi = class {
|
|
|
2436
2436
|
)
|
|
2437
2437
|
]);
|
|
2438
2438
|
}
|
|
2439
|
+
/** List channel setting */
|
|
2440
|
+
listChannelSetting(bearerToken, clanId, parentId, categoryId, privateChannel, active, status, type, limit, page, options = {}) {
|
|
2441
|
+
if (clanId === null || clanId === void 0) {
|
|
2442
|
+
throw new Error("'clanId' is a required parameter but is null or undefined.");
|
|
2443
|
+
}
|
|
2444
|
+
const urlPath = "/v2/channelsetting/{clanId}".replace("{clanId}", encodeURIComponent(String(clanId)));
|
|
2445
|
+
const queryParams = /* @__PURE__ */ new Map();
|
|
2446
|
+
queryParams.set("parent_id", parentId);
|
|
2447
|
+
queryParams.set("category_id", categoryId);
|
|
2448
|
+
queryParams.set("private_channel", privateChannel);
|
|
2449
|
+
queryParams.set("active", active);
|
|
2450
|
+
queryParams.set("status", status);
|
|
2451
|
+
queryParams.set("type", type);
|
|
2452
|
+
queryParams.set("limit", limit);
|
|
2453
|
+
queryParams.set("page", page);
|
|
2454
|
+
let bodyJson = "";
|
|
2455
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
|
2456
|
+
const fetchOptions = buildFetchOptions("GET", options, bodyJson);
|
|
2457
|
+
if (bearerToken) {
|
|
2458
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
|
2459
|
+
}
|
|
2460
|
+
return Promise.race([
|
|
2461
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
|
2462
|
+
if (response.status == 204) {
|
|
2463
|
+
return response;
|
|
2464
|
+
} else if (response.status >= 200 && response.status < 300) {
|
|
2465
|
+
return response.json();
|
|
2466
|
+
} else {
|
|
2467
|
+
throw response;
|
|
2468
|
+
}
|
|
2469
|
+
}),
|
|
2470
|
+
new Promise(
|
|
2471
|
+
(_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
|
|
2472
|
+
)
|
|
2473
|
+
]);
|
|
2474
|
+
}
|
|
2439
2475
|
/** List all users that are part of a channel. */
|
|
2440
2476
|
listChannelVoiceUsers(bearerToken, clanId, channelId, channelType, limit, state, cursor, options = {}) {
|
|
2441
2477
|
const urlPath = "/v2/channelvoice";
|
|
@@ -7014,7 +7050,8 @@ var Client = class {
|
|
|
7014
7050
|
references,
|
|
7015
7051
|
clan_id: m.clan_id,
|
|
7016
7052
|
create_time_seconds: m.create_time_seconds,
|
|
7017
|
-
update_time_seconds: m.update_time_seconds
|
|
7053
|
+
update_time_seconds: m.update_time_seconds,
|
|
7054
|
+
hide_editted: m.hide_editted
|
|
7018
7055
|
});
|
|
7019
7056
|
});
|
|
7020
7057
|
return Promise.resolve(result);
|
|
@@ -8473,4 +8510,25 @@ var Client = class {
|
|
|
8473
8510
|
});
|
|
8474
8511
|
});
|
|
8475
8512
|
}
|
|
8513
|
+
getChannelSettingInClan(session, clanId, parentId, categoryId, privateChannel, active, status, type, limit, page) {
|
|
8514
|
+
return __async(this, null, function* () {
|
|
8515
|
+
if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
|
|
8516
|
+
yield this.sessionRefresh(session);
|
|
8517
|
+
}
|
|
8518
|
+
return this.apiClient.listChannelSetting(
|
|
8519
|
+
session.token,
|
|
8520
|
+
clanId,
|
|
8521
|
+
parentId,
|
|
8522
|
+
categoryId,
|
|
8523
|
+
privateChannel,
|
|
8524
|
+
active,
|
|
8525
|
+
status,
|
|
8526
|
+
type,
|
|
8527
|
+
limit,
|
|
8528
|
+
page
|
|
8529
|
+
).then((response) => {
|
|
8530
|
+
return Promise.resolve(response);
|
|
8531
|
+
});
|
|
8532
|
+
});
|
|
8533
|
+
}
|
|
8476
8534
|
};
|
package/dist/mezon-js.esm.mjs
CHANGED
|
@@ -2407,6 +2407,42 @@ var MezonApi = class {
|
|
|
2407
2407
|
)
|
|
2408
2408
|
]);
|
|
2409
2409
|
}
|
|
2410
|
+
/** List channel setting */
|
|
2411
|
+
listChannelSetting(bearerToken, clanId, parentId, categoryId, privateChannel, active, status, type, limit, page, options = {}) {
|
|
2412
|
+
if (clanId === null || clanId === void 0) {
|
|
2413
|
+
throw new Error("'clanId' is a required parameter but is null or undefined.");
|
|
2414
|
+
}
|
|
2415
|
+
const urlPath = "/v2/channelsetting/{clanId}".replace("{clanId}", encodeURIComponent(String(clanId)));
|
|
2416
|
+
const queryParams = /* @__PURE__ */ new Map();
|
|
2417
|
+
queryParams.set("parent_id", parentId);
|
|
2418
|
+
queryParams.set("category_id", categoryId);
|
|
2419
|
+
queryParams.set("private_channel", privateChannel);
|
|
2420
|
+
queryParams.set("active", active);
|
|
2421
|
+
queryParams.set("status", status);
|
|
2422
|
+
queryParams.set("type", type);
|
|
2423
|
+
queryParams.set("limit", limit);
|
|
2424
|
+
queryParams.set("page", page);
|
|
2425
|
+
let bodyJson = "";
|
|
2426
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
|
2427
|
+
const fetchOptions = buildFetchOptions("GET", options, bodyJson);
|
|
2428
|
+
if (bearerToken) {
|
|
2429
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
|
2430
|
+
}
|
|
2431
|
+
return Promise.race([
|
|
2432
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
|
2433
|
+
if (response.status == 204) {
|
|
2434
|
+
return response;
|
|
2435
|
+
} else if (response.status >= 200 && response.status < 300) {
|
|
2436
|
+
return response.json();
|
|
2437
|
+
} else {
|
|
2438
|
+
throw response;
|
|
2439
|
+
}
|
|
2440
|
+
}),
|
|
2441
|
+
new Promise(
|
|
2442
|
+
(_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
|
|
2443
|
+
)
|
|
2444
|
+
]);
|
|
2445
|
+
}
|
|
2410
2446
|
/** List all users that are part of a channel. */
|
|
2411
2447
|
listChannelVoiceUsers(bearerToken, clanId, channelId, channelType, limit, state, cursor, options = {}) {
|
|
2412
2448
|
const urlPath = "/v2/channelvoice";
|
|
@@ -6985,7 +7021,8 @@ var Client = class {
|
|
|
6985
7021
|
references,
|
|
6986
7022
|
clan_id: m.clan_id,
|
|
6987
7023
|
create_time_seconds: m.create_time_seconds,
|
|
6988
|
-
update_time_seconds: m.update_time_seconds
|
|
7024
|
+
update_time_seconds: m.update_time_seconds,
|
|
7025
|
+
hide_editted: m.hide_editted
|
|
6989
7026
|
});
|
|
6990
7027
|
});
|
|
6991
7028
|
return Promise.resolve(result);
|
|
@@ -8444,6 +8481,27 @@ var Client = class {
|
|
|
8444
8481
|
});
|
|
8445
8482
|
});
|
|
8446
8483
|
}
|
|
8484
|
+
getChannelSettingInClan(session, clanId, parentId, categoryId, privateChannel, active, status, type, limit, page) {
|
|
8485
|
+
return __async(this, null, function* () {
|
|
8486
|
+
if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
|
|
8487
|
+
yield this.sessionRefresh(session);
|
|
8488
|
+
}
|
|
8489
|
+
return this.apiClient.listChannelSetting(
|
|
8490
|
+
session.token,
|
|
8491
|
+
clanId,
|
|
8492
|
+
parentId,
|
|
8493
|
+
categoryId,
|
|
8494
|
+
privateChannel,
|
|
8495
|
+
active,
|
|
8496
|
+
status,
|
|
8497
|
+
type,
|
|
8498
|
+
limit,
|
|
8499
|
+
page
|
|
8500
|
+
).then((response) => {
|
|
8501
|
+
return Promise.resolve(response);
|
|
8502
|
+
});
|
|
8503
|
+
});
|
|
8504
|
+
}
|
|
8447
8505
|
};
|
|
8448
8506
|
export {
|
|
8449
8507
|
ChannelStreamMode,
|