mezon-js 2.9.35 → 2.9.37
Sign up to get free protection for your applications and to get access to all the features.
- package/api.gen.ts +8 -5
- package/client.ts +19 -0
- package/dist/api.gen.d.ts +3 -1
- package/dist/client.d.ts +1 -0
- package/dist/mezon-js.cjs.js +11 -1
- package/dist/mezon-js.esm.mjs +11 -1
- package/package.json +1 -1
package/api.gen.ts
CHANGED
@@ -789,10 +789,14 @@ export interface ApiChannelSettingItem {
|
|
789
789
|
|
790
790
|
/** */
|
791
791
|
export interface ApiChannelSettingListResponse {
|
792
|
+
//
|
793
|
+
channel_count?: number;
|
792
794
|
//
|
793
795
|
channel_setting_list?: Array<ApiChannelSettingItem>;
|
794
796
|
//
|
795
797
|
clan_id?: string;
|
798
|
+
//
|
799
|
+
thread_count?: number;
|
796
800
|
}
|
797
801
|
|
798
802
|
/** A list of users belonging to a channel, along with their role. */
|
@@ -4105,11 +4109,10 @@ export class MezonApi {
|
|
4105
4109
|
}
|
4106
4110
|
|
4107
4111
|
/** Leave a channel the user is a member of. */
|
4108
|
-
|
4109
|
-
|
4110
|
-
|
4111
|
-
|
4112
|
-
): Promise<any> {
|
4112
|
+
leaveThread(bearerToken: string,
|
4113
|
+
channelId:string,
|
4114
|
+
options: any = {}): Promise<any> {
|
4115
|
+
|
4113
4116
|
if (channelId === null || channelId === undefined) {
|
4114
4117
|
throw new Error(
|
4115
4118
|
"'channelId' is a required parameter but is null or undefined."
|
package/client.ts
CHANGED
@@ -3963,6 +3963,25 @@ export class Client {
|
|
3963
3963
|
});
|
3964
3964
|
}
|
3965
3965
|
|
3966
|
+
async leaveThread(
|
3967
|
+
session: Session,
|
3968
|
+
channelId: string
|
3969
|
+
) : Promise<any> {
|
3970
|
+
if (
|
3971
|
+
this.autoRefreshSession &&
|
3972
|
+
session.refresh_token &&
|
3973
|
+
session.isexpired((Date.now() + this.expiredTimespanMs) / 1000)
|
3974
|
+
) {
|
3975
|
+
await this.sessionRefresh(session);
|
3976
|
+
}
|
3977
|
+
|
3978
|
+
return this.apiClient
|
3979
|
+
.leaveThread(session.token, channelId)
|
3980
|
+
.then((response: any) => {
|
3981
|
+
return Promise.resolve(response);
|
3982
|
+
});
|
3983
|
+
}
|
3984
|
+
|
3966
3985
|
async getChannelSettingInClan(
|
3967
3986
|
session: Session,
|
3968
3987
|
clanId: string,
|
package/dist/api.gen.d.ts
CHANGED
@@ -455,8 +455,10 @@ export interface ApiChannelSettingItem {
|
|
455
455
|
}
|
456
456
|
/** */
|
457
457
|
export interface ApiChannelSettingListResponse {
|
458
|
+
channel_count?: number;
|
458
459
|
channel_setting_list?: Array<ApiChannelSettingItem>;
|
459
460
|
clan_id?: string;
|
461
|
+
thread_count?: number;
|
460
462
|
}
|
461
463
|
/** A list of users belonging to a channel, along with their role. */
|
462
464
|
export interface ApiChannelUserList {
|
@@ -1378,7 +1380,7 @@ export declare class MezonApi {
|
|
1378
1380
|
/** List all attachment that are part of a channel. */
|
1379
1381
|
listChannelAttachment(bearerToken: string, channelId: string, clanId?: string, fileType?: string, limit?: number, state?: number, cursor?: string, options?: any): Promise<ApiChannelAttachmentList>;
|
1380
1382
|
/** Leave a channel the user is a member of. */
|
1381
|
-
|
1383
|
+
leaveThread(bearerToken: string, channelId: string, options?: any): Promise<any>;
|
1382
1384
|
/** Kick a set of users from a channel. */
|
1383
1385
|
removeChannelUsers(bearerToken: string, channelId: string, userIds?: Array<string>, options?: any): Promise<any>;
|
1384
1386
|
/** List all users that are part of a channel. */
|
package/dist/client.d.ts
CHANGED
@@ -579,6 +579,7 @@ export declare class Client {
|
|
579
579
|
markAsRead(session: Session, request: ApiMarkAsReadRequest): Promise<any>;
|
580
580
|
/** List Threads. */
|
581
581
|
listThreadDescs(session: Session, channelId: string, limit?: number, state?: number, clanId?: string, threadId?: string): Promise<ApiChannelDescList>;
|
582
|
+
leaveThread(session: Session, channelId: string): Promise<any>;
|
582
583
|
getChannelSettingInClan(session: Session, clanId: string, parentId?: string, categoryId?: string, privateChannel?: number, active?: number, status?: number, type?: number, limit?: number, page?: number): Promise<any>;
|
583
584
|
getChannelCanvasList(session: Session, channelId: string, clanId?: string, limit?: number, page?: number): Promise<any>;
|
584
585
|
getChannelCanvasDetail(session: Session, id: string, clanId?: string, channelId?: string): Promise<any>;
|
package/dist/mezon-js.cjs.js
CHANGED
@@ -2172,7 +2172,7 @@ var MezonApi = class {
|
|
2172
2172
|
]);
|
2173
2173
|
}
|
2174
2174
|
/** Leave a channel the user is a member of. */
|
2175
|
-
|
2175
|
+
leaveThread(bearerToken, channelId, options = {}) {
|
2176
2176
|
if (channelId === null || channelId === void 0) {
|
2177
2177
|
throw new Error(
|
2178
2178
|
"'channelId' is a required parameter but is null or undefined."
|
@@ -8655,6 +8655,16 @@ var Client = class {
|
|
8655
8655
|
});
|
8656
8656
|
});
|
8657
8657
|
}
|
8658
|
+
leaveThread(session, channelId) {
|
8659
|
+
return __async(this, null, function* () {
|
8660
|
+
if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
|
8661
|
+
yield this.sessionRefresh(session);
|
8662
|
+
}
|
8663
|
+
return this.apiClient.leaveThread(session.token, channelId).then((response) => {
|
8664
|
+
return Promise.resolve(response);
|
8665
|
+
});
|
8666
|
+
});
|
8667
|
+
}
|
8658
8668
|
getChannelSettingInClan(session, clanId, parentId, categoryId, privateChannel, active, status, type, limit, page) {
|
8659
8669
|
return __async(this, null, function* () {
|
8660
8670
|
if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
|
package/dist/mezon-js.esm.mjs
CHANGED
@@ -2143,7 +2143,7 @@ var MezonApi = class {
|
|
2143
2143
|
]);
|
2144
2144
|
}
|
2145
2145
|
/** Leave a channel the user is a member of. */
|
2146
|
-
|
2146
|
+
leaveThread(bearerToken, channelId, options = {}) {
|
2147
2147
|
if (channelId === null || channelId === void 0) {
|
2148
2148
|
throw new Error(
|
2149
2149
|
"'channelId' is a required parameter but is null or undefined."
|
@@ -8626,6 +8626,16 @@ var Client = class {
|
|
8626
8626
|
});
|
8627
8627
|
});
|
8628
8628
|
}
|
8629
|
+
leaveThread(session, channelId) {
|
8630
|
+
return __async(this, null, function* () {
|
8631
|
+
if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
|
8632
|
+
yield this.sessionRefresh(session);
|
8633
|
+
}
|
8634
|
+
return this.apiClient.leaveThread(session.token, channelId).then((response) => {
|
8635
|
+
return Promise.resolve(response);
|
8636
|
+
});
|
8637
|
+
});
|
8638
|
+
}
|
8629
8639
|
getChannelSettingInClan(session, clanId, parentId, categoryId, privateChannel, active, status, type, limit, page) {
|
8630
8640
|
return __async(this, null, function* () {
|
8631
8641
|
if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
|