mezon-js 2.9.60 → 2.9.61
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 +310 -0
- package/client.ts +109 -0
- package/dist/api.gen.d.ts +68 -0
- package/dist/client.d.ts +7 -1
- package/dist/mezon-js.cjs.js +231 -0
- package/dist/mezon-js.esm.mjs +231 -0
- package/package.json +1 -1
package/api.gen.ts
CHANGED
|
@@ -36,6 +36,14 @@ export interface ClanUserListClanUser {
|
|
|
36
36
|
user?: ApiUser;
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
+
/** */
|
|
40
|
+
export interface GetPubKeysResponseUserPubKey {
|
|
41
|
+
//
|
|
42
|
+
PK?: ApiPubKey;
|
|
43
|
+
//
|
|
44
|
+
user_id?: string;
|
|
45
|
+
}
|
|
46
|
+
|
|
39
47
|
/** */
|
|
40
48
|
export interface CountClanBadgeResponseBadge {
|
|
41
49
|
//
|
|
@@ -50,6 +58,23 @@ export interface MezonChangeChannelCategoryBody {
|
|
|
50
58
|
channel_id?: string;
|
|
51
59
|
}
|
|
52
60
|
|
|
61
|
+
|
|
62
|
+
/** */
|
|
63
|
+
export interface MezonChangeChannelCategoryBody {
|
|
64
|
+
//
|
|
65
|
+
channel_id?: string;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/** */
|
|
69
|
+
export interface MezonDeleteWebhookByIdBody {
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/** */
|
|
73
|
+
export interface MezonSetChanEncryptionMethodBody {
|
|
74
|
+
//
|
|
75
|
+
method?: string;
|
|
76
|
+
}
|
|
77
|
+
|
|
53
78
|
/** */
|
|
54
79
|
export interface MezonDeleteWebhookByIdBody {}
|
|
55
80
|
|
|
@@ -455,6 +480,26 @@ export interface ApiAppList {
|
|
|
455
480
|
total_count?: number;
|
|
456
481
|
}
|
|
457
482
|
|
|
483
|
+
/** */
|
|
484
|
+
export interface ApiAuditLog {
|
|
485
|
+
//
|
|
486
|
+
action_log?: string;
|
|
487
|
+
//
|
|
488
|
+
clan_id?: string;
|
|
489
|
+
//
|
|
490
|
+
details?: string;
|
|
491
|
+
//
|
|
492
|
+
entity_id?: string;
|
|
493
|
+
//
|
|
494
|
+
entity_name?: string;
|
|
495
|
+
//
|
|
496
|
+
id?: string;
|
|
497
|
+
//
|
|
498
|
+
time_log?: string;
|
|
499
|
+
//
|
|
500
|
+
user_id?: string;
|
|
501
|
+
}
|
|
502
|
+
|
|
458
503
|
/** Authenticate against the server with a device ID. */
|
|
459
504
|
export interface ApiAuthenticateRequest {
|
|
460
505
|
//The App account details.
|
|
@@ -489,6 +534,14 @@ export interface ApiCategoryOrderUpdate {
|
|
|
489
534
|
order?: number;
|
|
490
535
|
}
|
|
491
536
|
|
|
537
|
+
/** */
|
|
538
|
+
export interface ApiChanEncryptionMethod {
|
|
539
|
+
//
|
|
540
|
+
channel_id?: string;
|
|
541
|
+
//
|
|
542
|
+
method?: string;
|
|
543
|
+
}
|
|
544
|
+
|
|
492
545
|
export interface ApiListChannelAppsResponse {
|
|
493
546
|
//
|
|
494
547
|
channel_apps?: Array<ApiChannelAppResponse>;
|
|
@@ -1237,6 +1290,18 @@ export interface ApiFriendList {
|
|
|
1237
1290
|
friends?: Array<ApiFriend>;
|
|
1238
1291
|
}
|
|
1239
1292
|
|
|
1293
|
+
/** */
|
|
1294
|
+
export interface ApiGetKeyServerResp {
|
|
1295
|
+
//
|
|
1296
|
+
url?: string;
|
|
1297
|
+
}
|
|
1298
|
+
|
|
1299
|
+
/** */
|
|
1300
|
+
export interface ApiGetPubKeysResponse {
|
|
1301
|
+
//
|
|
1302
|
+
pub_keys?: Array<GetPubKeysResponseUserPubKey>;
|
|
1303
|
+
}
|
|
1304
|
+
|
|
1240
1305
|
/** */
|
|
1241
1306
|
export interface ApiGiveCoffeeEvent {
|
|
1242
1307
|
//
|
|
@@ -1726,6 +1791,20 @@ export interface ApiPinMessagesList {
|
|
|
1726
1791
|
pin_messages_list?: Array<ApiPinMessage>;
|
|
1727
1792
|
}
|
|
1728
1793
|
|
|
1794
|
+
/** */
|
|
1795
|
+
export interface ApiPubKey {
|
|
1796
|
+
//
|
|
1797
|
+
encr?: string;
|
|
1798
|
+
//
|
|
1799
|
+
sign?: string;
|
|
1800
|
+
}
|
|
1801
|
+
|
|
1802
|
+
/** */
|
|
1803
|
+
export interface ApiPushPubKeyRequest {
|
|
1804
|
+
//
|
|
1805
|
+
PK?: ApiPubKey;
|
|
1806
|
+
}
|
|
1807
|
+
|
|
1729
1808
|
/** */
|
|
1730
1809
|
export interface ApiRegistFcmDeviceTokenResponse {
|
|
1731
1810
|
//
|
|
@@ -2306,6 +2385,18 @@ export interface MezonapiEvent {
|
|
|
2306
2385
|
timestamp?: string;
|
|
2307
2386
|
}
|
|
2308
2387
|
|
|
2388
|
+
/** */
|
|
2389
|
+
export interface MezonapiListAuditLog {
|
|
2390
|
+
//
|
|
2391
|
+
logs?: Array<ApiAuditLog>;
|
|
2392
|
+
//
|
|
2393
|
+
page?: number;
|
|
2394
|
+
//
|
|
2395
|
+
page_size?: number;
|
|
2396
|
+
//
|
|
2397
|
+
total_count?: number;
|
|
2398
|
+
}
|
|
2399
|
+
|
|
2309
2400
|
/** */
|
|
2310
2401
|
export interface ProtobufAny {
|
|
2311
2402
|
//
|
|
@@ -4139,6 +4230,46 @@ export class MezonApi {
|
|
|
4139
4230
|
]);
|
|
4140
4231
|
}
|
|
4141
4232
|
|
|
4233
|
+
/** */
|
|
4234
|
+
listAuditLog(bearerToken: string,
|
|
4235
|
+
actionLog?:string,
|
|
4236
|
+
userId?:string,
|
|
4237
|
+
clanId?:string,
|
|
4238
|
+
page?:number,
|
|
4239
|
+
pageSize?:number,
|
|
4240
|
+
options: any = {}): Promise<MezonapiListAuditLog> {
|
|
4241
|
+
|
|
4242
|
+
const urlPath = "/v2/audit_log";
|
|
4243
|
+
const queryParams = new Map<string, any>();
|
|
4244
|
+
queryParams.set("action_log", actionLog);
|
|
4245
|
+
queryParams.set("user_id", userId);
|
|
4246
|
+
queryParams.set("clan_id", clanId);
|
|
4247
|
+
queryParams.set("page", page);
|
|
4248
|
+
queryParams.set("page_size", pageSize);
|
|
4249
|
+
|
|
4250
|
+
let bodyJson : string = "";
|
|
4251
|
+
|
|
4252
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
|
4253
|
+
const fetchOptions = buildFetchOptions("GET", options, bodyJson);
|
|
4254
|
+
if (bearerToken) {
|
|
4255
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
|
4256
|
+
}
|
|
4257
|
+
|
|
4258
|
+
return Promise.race([
|
|
4259
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
|
4260
|
+
if (response.status == 204) {
|
|
4261
|
+
return response;
|
|
4262
|
+
} else if (response.status >= 200 && response.status < 300) {
|
|
4263
|
+
return response.json();
|
|
4264
|
+
} else {
|
|
4265
|
+
throw response;
|
|
4266
|
+
}
|
|
4267
|
+
}),
|
|
4268
|
+
new Promise((_, reject) =>
|
|
4269
|
+
setTimeout(reject, this.timeoutMs, "Request timed out.")
|
|
4270
|
+
),
|
|
4271
|
+
]);
|
|
4272
|
+
}
|
|
4142
4273
|
/** */
|
|
4143
4274
|
updateCategoryOrder(bearerToken: string,
|
|
4144
4275
|
body:ApiUpdateCategoryOrderRequest,
|
|
@@ -4553,6 +4684,85 @@ export class MezonApi {
|
|
|
4553
4684
|
]);
|
|
4554
4685
|
}
|
|
4555
4686
|
|
|
4687
|
+
/** get channel encryption method */
|
|
4688
|
+
getChanEncryptionMethod(bearerToken: string,
|
|
4689
|
+
channelId:string,
|
|
4690
|
+
method?:string,
|
|
4691
|
+
options: any = {}): Promise<ApiChanEncryptionMethod> {
|
|
4692
|
+
|
|
4693
|
+
if (channelId === null || channelId === undefined) {
|
|
4694
|
+
throw new Error("'channelId' is a required parameter but is null or undefined.");
|
|
4695
|
+
}
|
|
4696
|
+
const urlPath = "/v2/channel/{channelId}/encrypt_method"
|
|
4697
|
+
.replace("{channelId}", encodeURIComponent(String(channelId)));
|
|
4698
|
+
const queryParams = new Map<string, any>();
|
|
4699
|
+
queryParams.set("method", method);
|
|
4700
|
+
|
|
4701
|
+
let bodyJson : string = "";
|
|
4702
|
+
|
|
4703
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
|
4704
|
+
const fetchOptions = buildFetchOptions("GET", options, bodyJson);
|
|
4705
|
+
if (bearerToken) {
|
|
4706
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
|
4707
|
+
}
|
|
4708
|
+
|
|
4709
|
+
return Promise.race([
|
|
4710
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
|
4711
|
+
if (response.status == 204) {
|
|
4712
|
+
return response;
|
|
4713
|
+
} else if (response.status >= 200 && response.status < 300) {
|
|
4714
|
+
return response.json();
|
|
4715
|
+
} else {
|
|
4716
|
+
throw response;
|
|
4717
|
+
}
|
|
4718
|
+
}),
|
|
4719
|
+
new Promise((_, reject) =>
|
|
4720
|
+
setTimeout(reject, this.timeoutMs, "Request timed out.")
|
|
4721
|
+
),
|
|
4722
|
+
]);
|
|
4723
|
+
}
|
|
4724
|
+
|
|
4725
|
+
/** store channel encryption method */
|
|
4726
|
+
setChanEncryptionMethod(bearerToken: string,
|
|
4727
|
+
channelId:string,
|
|
4728
|
+
body:MezonSetChanEncryptionMethodBody,
|
|
4729
|
+
options: any = {}): Promise<any> {
|
|
4730
|
+
|
|
4731
|
+
if (channelId === null || channelId === undefined) {
|
|
4732
|
+
throw new Error("'channelId' is a required parameter but is null or undefined.");
|
|
4733
|
+
}
|
|
4734
|
+
if (body === null || body === undefined) {
|
|
4735
|
+
throw new Error("'body' is a required parameter but is null or undefined.");
|
|
4736
|
+
}
|
|
4737
|
+
const urlPath = "/v2/channel/{channelId}/encrypt_method"
|
|
4738
|
+
.replace("{channelId}", encodeURIComponent(String(channelId)));
|
|
4739
|
+
const queryParams = new Map<string, any>();
|
|
4740
|
+
|
|
4741
|
+
let bodyJson : string = "";
|
|
4742
|
+
bodyJson = JSON.stringify(body || {});
|
|
4743
|
+
|
|
4744
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
|
4745
|
+
const fetchOptions = buildFetchOptions("POST", options, bodyJson);
|
|
4746
|
+
if (bearerToken) {
|
|
4747
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
|
4748
|
+
}
|
|
4749
|
+
|
|
4750
|
+
return Promise.race([
|
|
4751
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
|
4752
|
+
if (response.status == 204) {
|
|
4753
|
+
return response;
|
|
4754
|
+
} else if (response.status >= 200 && response.status < 300) {
|
|
4755
|
+
return response.json();
|
|
4756
|
+
} else {
|
|
4757
|
+
throw response;
|
|
4758
|
+
}
|
|
4759
|
+
}),
|
|
4760
|
+
new Promise((_, reject) =>
|
|
4761
|
+
setTimeout(reject, this.timeoutMs, "Request timed out.")
|
|
4762
|
+
),
|
|
4763
|
+
]);
|
|
4764
|
+
}
|
|
4765
|
+
|
|
4556
4766
|
/** Leave a channel the user is a member of. */
|
|
4557
4767
|
leaveThread(bearerToken: string,
|
|
4558
4768
|
channelId:string,
|
|
@@ -6527,6 +6737,37 @@ export class MezonApi {
|
|
|
6527
6737
|
]);
|
|
6528
6738
|
}
|
|
6529
6739
|
|
|
6740
|
+
/** get key server */
|
|
6741
|
+
getKeyServer(bearerToken: string,
|
|
6742
|
+
options: any = {}): Promise<ApiGetKeyServerResp> {
|
|
6743
|
+
|
|
6744
|
+
const urlPath = "/v2/e2ee/key_server";
|
|
6745
|
+
const queryParams = new Map<string, any>();
|
|
6746
|
+
|
|
6747
|
+
let bodyJson : string = "";
|
|
6748
|
+
|
|
6749
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
|
6750
|
+
const fetchOptions = buildFetchOptions("GET", options, bodyJson);
|
|
6751
|
+
if (bearerToken) {
|
|
6752
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
|
6753
|
+
}
|
|
6754
|
+
|
|
6755
|
+
return Promise.race([
|
|
6756
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
|
6757
|
+
if (response.status == 204) {
|
|
6758
|
+
return response;
|
|
6759
|
+
} else if (response.status >= 200 && response.status < 300) {
|
|
6760
|
+
return response.json();
|
|
6761
|
+
} else {
|
|
6762
|
+
throw response;
|
|
6763
|
+
}
|
|
6764
|
+
}),
|
|
6765
|
+
new Promise((_, reject) =>
|
|
6766
|
+
setTimeout(reject, this.timeoutMs, "Request timed out.")
|
|
6767
|
+
),
|
|
6768
|
+
]);
|
|
6769
|
+
}
|
|
6770
|
+
|
|
6530
6771
|
/** List HashtagDMList */
|
|
6531
6772
|
hashtagDMList(
|
|
6532
6773
|
bearerToken: string,
|
|
@@ -7415,6 +7656,75 @@ export class MezonApi {
|
|
|
7415
7656
|
]);
|
|
7416
7657
|
}
|
|
7417
7658
|
|
|
7659
|
+
/** get pubkey */
|
|
7660
|
+
getPubKeys(bearerToken: string,
|
|
7661
|
+
userIds?:Array<string>,
|
|
7662
|
+
options: any = {}): Promise<ApiGetPubKeysResponse> {
|
|
7663
|
+
|
|
7664
|
+
const urlPath = "/v2/pubkey";
|
|
7665
|
+
const queryParams = new Map<string, any>();
|
|
7666
|
+
queryParams.set("user_ids", userIds);
|
|
7667
|
+
|
|
7668
|
+
let bodyJson : string = "";
|
|
7669
|
+
|
|
7670
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
|
7671
|
+
const fetchOptions = buildFetchOptions("GET", options, bodyJson);
|
|
7672
|
+
if (bearerToken) {
|
|
7673
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
|
7674
|
+
}
|
|
7675
|
+
|
|
7676
|
+
return Promise.race([
|
|
7677
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
|
7678
|
+
if (response.status == 204) {
|
|
7679
|
+
return response;
|
|
7680
|
+
} else if (response.status >= 200 && response.status < 300) {
|
|
7681
|
+
return response.json();
|
|
7682
|
+
} else {
|
|
7683
|
+
throw response;
|
|
7684
|
+
}
|
|
7685
|
+
}),
|
|
7686
|
+
new Promise((_, reject) =>
|
|
7687
|
+
setTimeout(reject, this.timeoutMs, "Request timed out.")
|
|
7688
|
+
),
|
|
7689
|
+
]);
|
|
7690
|
+
}
|
|
7691
|
+
|
|
7692
|
+
/** store pubkey for e2ee */
|
|
7693
|
+
pushPubKey(bearerToken: string,
|
|
7694
|
+
body:ApiPushPubKeyRequest,
|
|
7695
|
+
options: any = {}): Promise<any> {
|
|
7696
|
+
|
|
7697
|
+
if (body === null || body === undefined) {
|
|
7698
|
+
throw new Error("'body' is a required parameter but is null or undefined.");
|
|
7699
|
+
}
|
|
7700
|
+
const urlPath = "/v2/pubkey/push";
|
|
7701
|
+
const queryParams = new Map<string, any>();
|
|
7702
|
+
|
|
7703
|
+
let bodyJson : string = "";
|
|
7704
|
+
bodyJson = JSON.stringify(body || {});
|
|
7705
|
+
|
|
7706
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
|
7707
|
+
const fetchOptions = buildFetchOptions("POST", options, bodyJson);
|
|
7708
|
+
if (bearerToken) {
|
|
7709
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
|
7710
|
+
}
|
|
7711
|
+
|
|
7712
|
+
return Promise.race([
|
|
7713
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
|
7714
|
+
if (response.status == 204) {
|
|
7715
|
+
return response;
|
|
7716
|
+
} else if (response.status >= 200 && response.status < 300) {
|
|
7717
|
+
return response.json();
|
|
7718
|
+
} else {
|
|
7719
|
+
throw response;
|
|
7720
|
+
}
|
|
7721
|
+
}),
|
|
7722
|
+
new Promise((_, reject) =>
|
|
7723
|
+
setTimeout(reject, this.timeoutMs, "Request timed out.")
|
|
7724
|
+
),
|
|
7725
|
+
]);
|
|
7726
|
+
}
|
|
7727
|
+
|
|
7418
7728
|
/** */
|
|
7419
7729
|
addRolesChannelDesc(
|
|
7420
7730
|
bearerToken: string,
|
package/client.ts
CHANGED
|
@@ -132,6 +132,11 @@ import {
|
|
|
132
132
|
ApiLoginRequest,
|
|
133
133
|
ApiConfirmLoginRequest,
|
|
134
134
|
ApiUserActivity,
|
|
135
|
+
ApiChanEncryptionMethod,
|
|
136
|
+
ApiGetPubKeysResponse,
|
|
137
|
+
ApiPubKey,
|
|
138
|
+
ApiGetKeyServerResp,
|
|
139
|
+
MezonapiListAuditLog,
|
|
135
140
|
} from "./api.gen";
|
|
136
141
|
|
|
137
142
|
import { Session } from "./session";
|
|
@@ -4266,4 +4271,108 @@ export class Client {
|
|
|
4266
4271
|
return response;
|
|
4267
4272
|
});
|
|
4268
4273
|
}
|
|
4274
|
+
|
|
4275
|
+
async getChanEncryptionMethod(session: Session,
|
|
4276
|
+
channelId: string
|
|
4277
|
+
) : Promise<ApiChanEncryptionMethod> {
|
|
4278
|
+
if (
|
|
4279
|
+
this.autoRefreshSession &&
|
|
4280
|
+
session.refresh_token &&
|
|
4281
|
+
session.isexpired((Date.now() + this.expiredTimespanMs) / 1000)
|
|
4282
|
+
) {
|
|
4283
|
+
await this.sessionRefresh(session);
|
|
4284
|
+
}
|
|
4285
|
+
|
|
4286
|
+
return this.apiClient
|
|
4287
|
+
.getChanEncryptionMethod(session.token, channelId)
|
|
4288
|
+
.then((response: ApiChanEncryptionMethod) => {
|
|
4289
|
+
return response;
|
|
4290
|
+
});
|
|
4291
|
+
}
|
|
4292
|
+
|
|
4293
|
+
async setChanEncryptionMethod(session: Session,
|
|
4294
|
+
channelId: string,
|
|
4295
|
+
method: string) : Promise<any> {
|
|
4296
|
+
if (
|
|
4297
|
+
this.autoRefreshSession &&
|
|
4298
|
+
session.refresh_token &&
|
|
4299
|
+
session.isexpired((Date.now() + this.expiredTimespanMs) / 1000)
|
|
4300
|
+
) {
|
|
4301
|
+
await this.sessionRefresh(session);
|
|
4302
|
+
}
|
|
4303
|
+
|
|
4304
|
+
return this.apiClient
|
|
4305
|
+
.setChanEncryptionMethod(session.token, channelId, { method: method })
|
|
4306
|
+
.then((response: any) => {
|
|
4307
|
+
return response;
|
|
4308
|
+
});
|
|
4309
|
+
}
|
|
4310
|
+
|
|
4311
|
+
async getPubKeys(session: Session,
|
|
4312
|
+
userIds: Array<string>
|
|
4313
|
+
) : Promise<ApiGetPubKeysResponse> {
|
|
4314
|
+
if (
|
|
4315
|
+
this.autoRefreshSession &&
|
|
4316
|
+
session.refresh_token &&
|
|
4317
|
+
session.isexpired((Date.now() + this.expiredTimespanMs) / 1000)
|
|
4318
|
+
) {
|
|
4319
|
+
await this.sessionRefresh(session);
|
|
4320
|
+
}
|
|
4321
|
+
|
|
4322
|
+
return this.apiClient
|
|
4323
|
+
.getPubKeys(session.token, userIds)
|
|
4324
|
+
.then((response: ApiGetPubKeysResponse) => {
|
|
4325
|
+
return response;
|
|
4326
|
+
});
|
|
4327
|
+
}
|
|
4328
|
+
|
|
4329
|
+
async pushPubKey(session: Session,
|
|
4330
|
+
PK: ApiPubKey
|
|
4331
|
+
) : Promise<ApiGetPubKeysResponse> {
|
|
4332
|
+
if (
|
|
4333
|
+
this.autoRefreshSession &&
|
|
4334
|
+
session.refresh_token &&
|
|
4335
|
+
session.isexpired((Date.now() + this.expiredTimespanMs) / 1000)
|
|
4336
|
+
) {
|
|
4337
|
+
await this.sessionRefresh(session);
|
|
4338
|
+
}
|
|
4339
|
+
|
|
4340
|
+
return this.apiClient
|
|
4341
|
+
.pushPubKey(session.token, { PK: PK })
|
|
4342
|
+
.then((response: ApiGetPubKeysResponse) => {
|
|
4343
|
+
return response;
|
|
4344
|
+
});
|
|
4345
|
+
}
|
|
4346
|
+
|
|
4347
|
+
async getKeyServer(session: Session) : Promise<ApiGetKeyServerResp> {
|
|
4348
|
+
if (
|
|
4349
|
+
this.autoRefreshSession &&
|
|
4350
|
+
session.refresh_token &&
|
|
4351
|
+
session.isexpired((Date.now() + this.expiredTimespanMs) / 1000)
|
|
4352
|
+
) {
|
|
4353
|
+
await this.sessionRefresh(session);
|
|
4354
|
+
}
|
|
4355
|
+
|
|
4356
|
+
return this.apiClient
|
|
4357
|
+
.getKeyServer(session.token)
|
|
4358
|
+
.then((response: ApiGetKeyServerResp) => {
|
|
4359
|
+
return response;
|
|
4360
|
+
});
|
|
4361
|
+
}
|
|
4362
|
+
|
|
4363
|
+
async listAuditLog(session: Session) : Promise<MezonapiListAuditLog> {
|
|
4364
|
+
if (
|
|
4365
|
+
this.autoRefreshSession &&
|
|
4366
|
+
session.refresh_token &&
|
|
4367
|
+
session.isexpired((Date.now() + this.expiredTimespanMs) / 1000)
|
|
4368
|
+
) {
|
|
4369
|
+
await this.sessionRefresh(session);
|
|
4370
|
+
}
|
|
4371
|
+
|
|
4372
|
+
return this.apiClient
|
|
4373
|
+
.listAuditLog(session.token)
|
|
4374
|
+
.then((response: MezonapiListAuditLog) => {
|
|
4375
|
+
return response;
|
|
4376
|
+
});
|
|
4377
|
+
}
|
|
4269
4378
|
}
|
package/dist/api.gen.d.ts
CHANGED
|
@@ -17,6 +17,11 @@ export interface ClanUserListClanUser {
|
|
|
17
17
|
user?: ApiUser;
|
|
18
18
|
}
|
|
19
19
|
/** */
|
|
20
|
+
export interface GetPubKeysResponseUserPubKey {
|
|
21
|
+
PK?: ApiPubKey;
|
|
22
|
+
user_id?: string;
|
|
23
|
+
}
|
|
24
|
+
/** */
|
|
20
25
|
export interface CountClanBadgeResponseBadge {
|
|
21
26
|
clan_id?: string;
|
|
22
27
|
count?: number;
|
|
@@ -26,6 +31,17 @@ export interface MezonChangeChannelCategoryBody {
|
|
|
26
31
|
channel_id?: string;
|
|
27
32
|
}
|
|
28
33
|
/** */
|
|
34
|
+
export interface MezonChangeChannelCategoryBody {
|
|
35
|
+
channel_id?: string;
|
|
36
|
+
}
|
|
37
|
+
/** */
|
|
38
|
+
export interface MezonDeleteWebhookByIdBody {
|
|
39
|
+
}
|
|
40
|
+
/** */
|
|
41
|
+
export interface MezonSetChanEncryptionMethodBody {
|
|
42
|
+
method?: string;
|
|
43
|
+
}
|
|
44
|
+
/** */
|
|
29
45
|
export interface MezonDeleteWebhookByIdBody {
|
|
30
46
|
}
|
|
31
47
|
/** Update app information. */
|
|
@@ -268,6 +284,17 @@ export interface ApiAppList {
|
|
|
268
284
|
next_cursor?: string;
|
|
269
285
|
total_count?: number;
|
|
270
286
|
}
|
|
287
|
+
/** */
|
|
288
|
+
export interface ApiAuditLog {
|
|
289
|
+
action_log?: string;
|
|
290
|
+
clan_id?: string;
|
|
291
|
+
details?: string;
|
|
292
|
+
entity_id?: string;
|
|
293
|
+
entity_name?: string;
|
|
294
|
+
id?: string;
|
|
295
|
+
time_log?: string;
|
|
296
|
+
user_id?: string;
|
|
297
|
+
}
|
|
271
298
|
/** Authenticate against the server with a device ID. */
|
|
272
299
|
export interface ApiAuthenticateRequest {
|
|
273
300
|
account?: ApiAccountApp;
|
|
@@ -289,6 +316,11 @@ export interface ApiCategoryOrderUpdate {
|
|
|
289
316
|
category_id?: string;
|
|
290
317
|
order?: number;
|
|
291
318
|
}
|
|
319
|
+
/** */
|
|
320
|
+
export interface ApiChanEncryptionMethod {
|
|
321
|
+
channel_id?: string;
|
|
322
|
+
method?: string;
|
|
323
|
+
}
|
|
292
324
|
export interface ApiListChannelAppsResponse {
|
|
293
325
|
channel_apps?: Array<ApiChannelAppResponse>;
|
|
294
326
|
}
|
|
@@ -715,6 +747,14 @@ export interface ApiFriendList {
|
|
|
715
747
|
friends?: Array<ApiFriend>;
|
|
716
748
|
}
|
|
717
749
|
/** */
|
|
750
|
+
export interface ApiGetKeyServerResp {
|
|
751
|
+
url?: string;
|
|
752
|
+
}
|
|
753
|
+
/** */
|
|
754
|
+
export interface ApiGetPubKeysResponse {
|
|
755
|
+
pub_keys?: Array<GetPubKeysResponseUserPubKey>;
|
|
756
|
+
}
|
|
757
|
+
/** */
|
|
718
758
|
export interface ApiGiveCoffeeEvent {
|
|
719
759
|
channel_id?: string;
|
|
720
760
|
clan_id?: string;
|
|
@@ -1005,6 +1045,15 @@ export interface ApiPinMessagesList {
|
|
|
1005
1045
|
pin_messages_list?: Array<ApiPinMessage>;
|
|
1006
1046
|
}
|
|
1007
1047
|
/** */
|
|
1048
|
+
export interface ApiPubKey {
|
|
1049
|
+
encr?: string;
|
|
1050
|
+
sign?: string;
|
|
1051
|
+
}
|
|
1052
|
+
/** */
|
|
1053
|
+
export interface ApiPushPubKeyRequest {
|
|
1054
|
+
PK?: ApiPubKey;
|
|
1055
|
+
}
|
|
1056
|
+
/** */
|
|
1008
1057
|
export interface ApiRegistFcmDeviceTokenResponse {
|
|
1009
1058
|
device_id?: string;
|
|
1010
1059
|
platform?: string;
|
|
@@ -1341,6 +1390,13 @@ export interface MezonapiEvent {
|
|
|
1341
1390
|
timestamp?: string;
|
|
1342
1391
|
}
|
|
1343
1392
|
/** */
|
|
1393
|
+
export interface MezonapiListAuditLog {
|
|
1394
|
+
logs?: Array<ApiAuditLog>;
|
|
1395
|
+
page?: number;
|
|
1396
|
+
page_size?: number;
|
|
1397
|
+
total_count?: number;
|
|
1398
|
+
}
|
|
1399
|
+
/** */
|
|
1344
1400
|
export interface ProtobufAny {
|
|
1345
1401
|
type_url?: string;
|
|
1346
1402
|
value?: string;
|
|
@@ -1449,6 +1505,8 @@ export declare class MezonApi {
|
|
|
1449
1505
|
/** Unban an app. */
|
|
1450
1506
|
unbanApp(bearerToken: string, id: string, options?: any): Promise<any>;
|
|
1451
1507
|
/** */
|
|
1508
|
+
listAuditLog(bearerToken: string, actionLog?: string, userId?: string, clanId?: string, page?: number, pageSize?: number, options?: any): Promise<MezonapiListAuditLog>;
|
|
1509
|
+
/** */
|
|
1452
1510
|
updateCategoryOrder(bearerToken: string, body: ApiUpdateCategoryOrderRequest, options?: any): Promise<any>;
|
|
1453
1511
|
/** */
|
|
1454
1512
|
listCategoryDescs(bearerToken: string, clanId: string, creatorId?: string, categoryName?: string, categoryId?: string, categoryOrder?: number, options?: any): Promise<ApiCategoryDescList>;
|
|
@@ -1468,6 +1526,10 @@ export declare class MezonApi {
|
|
|
1468
1526
|
addChannelUsers(bearerToken: string, channelId: string, userIds?: Array<string>, options?: any): Promise<any>;
|
|
1469
1527
|
/** List all attachment that are part of a channel. */
|
|
1470
1528
|
listChannelAttachment(bearerToken: string, channelId: string, clanId?: string, fileType?: string, limit?: number, state?: number, cursor?: string, options?: any): Promise<ApiChannelAttachmentList>;
|
|
1529
|
+
/** get channel encryption method */
|
|
1530
|
+
getChanEncryptionMethod(bearerToken: string, channelId: string, method?: string, options?: any): Promise<ApiChanEncryptionMethod>;
|
|
1531
|
+
/** store channel encryption method */
|
|
1532
|
+
setChanEncryptionMethod(bearerToken: string, channelId: string, body: MezonSetChanEncryptionMethodBody, options?: any): Promise<any>;
|
|
1471
1533
|
/** Leave a channel the user is a member of. */
|
|
1472
1534
|
leaveThread(bearerToken: string, channelId: string, options?: any): Promise<any>;
|
|
1473
1535
|
/** Kick a set of users from a channel. */
|
|
@@ -1566,6 +1628,8 @@ export declare class MezonApi {
|
|
|
1566
1628
|
getNotificationReactMessage(bearerToken: string, channelId?: string, options?: any): Promise<ApiNotifiReactMessage>;
|
|
1567
1629
|
/** Give a coffee */
|
|
1568
1630
|
giveMeACoffee(bearerToken: string, body: ApiGiveCoffeeEvent, options?: any): Promise<any>;
|
|
1631
|
+
/** get key server */
|
|
1632
|
+
getKeyServer(bearerToken: string, options?: any): Promise<ApiGetKeyServerResp>;
|
|
1569
1633
|
/** List HashtagDMList */
|
|
1570
1634
|
hashtagDMList(bearerToken: string, userId?: Array<string>, limit?: number, options?: any): Promise<ApiHashtagDmList>;
|
|
1571
1635
|
/** Add users to a channel. */
|
|
@@ -1614,6 +1678,10 @@ export declare class MezonApi {
|
|
|
1614
1678
|
getPinMessagesList(bearerToken: string, messageId?: string, channelId?: string, clanId?: string, options?: any): Promise<ApiPinMessagesList>;
|
|
1615
1679
|
/** set notification user channel. */
|
|
1616
1680
|
createPinMessage(bearerToken: string, body: ApiPinMessageRequest, options?: any): Promise<ApiChannelMessageHeader>;
|
|
1681
|
+
/** get pubkey */
|
|
1682
|
+
getPubKeys(bearerToken: string, userIds?: Array<string>, options?: any): Promise<ApiGetPubKeysResponse>;
|
|
1683
|
+
/** store pubkey for e2ee */
|
|
1684
|
+
pushPubKey(bearerToken: string, body: ApiPushPubKeyRequest, options?: any): Promise<any>;
|
|
1617
1685
|
/** */
|
|
1618
1686
|
addRolesChannelDesc(bearerToken: string, body: ApiAddRoleChannelDescRequest, options?: any): Promise<any>;
|
|
1619
1687
|
/** update the category of a channel */
|
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, ApiNotificationChannelCategorySettingList, ApiNotificationUserChannel, ApiNotificationSetting, ApiNotifiReactMessage, ApiHashtagDmList, ApiEmojiListedResponse, ApiStickerListedResponse, ApiAllUsersAddChannelResponse, ApiRoleListEventResponse, ApiAllUserClans, ApiUserPermissionInChannelListResponse, ApiPermissionRoleChannelListEventResponse, ApiMarkAsReadRequest, ApiEditChannelCanvasRequest, ApiChannelSettingListResponse, ApiAddFavoriteChannelResponse, ApiRegistFcmDeviceTokenResponse, ApiListUserActivity, ApiCreateActivityRequest, ApiLoginIDResponse, ApiLoginRequest, ApiConfirmLoginRequest, ApiUserActivity } from "./api.gen";
|
|
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, ApiUserPermissionInChannelListResponse, ApiPermissionRoleChannelListEventResponse, ApiMarkAsReadRequest, ApiEditChannelCanvasRequest, ApiChannelSettingListResponse, ApiAddFavoriteChannelResponse, ApiRegistFcmDeviceTokenResponse, ApiListUserActivity, ApiCreateActivityRequest, ApiLoginIDResponse, ApiLoginRequest, ApiConfirmLoginRequest, ApiUserActivity, ApiChanEncryptionMethod, ApiGetPubKeysResponse, ApiPubKey, ApiGetKeyServerResp, MezonapiListAuditLog } from "./api.gen";
|
|
17
17
|
import { Session } from "./session";
|
|
18
18
|
import { Socket } from "./socket";
|
|
19
19
|
import { WebSocketAdapter } from "./web_socket_adapter";
|
|
@@ -597,4 +597,10 @@ export declare class Client {
|
|
|
597
597
|
createQRLogin(requet: ApiLoginRequest): Promise<ApiLoginIDResponse>;
|
|
598
598
|
checkLoginRequest(requet: ApiConfirmLoginRequest): Promise<Session | null>;
|
|
599
599
|
confirmLogin(session: Session, body: ApiConfirmLoginRequest): Promise<any>;
|
|
600
|
+
getChanEncryptionMethod(session: Session, channelId: string): Promise<ApiChanEncryptionMethod>;
|
|
601
|
+
setChanEncryptionMethod(session: Session, channelId: string, method: string): Promise<any>;
|
|
602
|
+
getPubKeys(session: Session, userIds: Array<string>): Promise<ApiGetPubKeysResponse>;
|
|
603
|
+
pushPubKey(session: Session, PK: ApiPubKey): Promise<ApiGetPubKeysResponse>;
|
|
604
|
+
getKeyServer(session: Session): Promise<ApiGetKeyServerResp>;
|
|
605
|
+
listAuditLog(session: Session): Promise<MezonapiListAuditLog>;
|
|
600
606
|
}
|
package/dist/mezon-js.cjs.js
CHANGED
|
@@ -2110,6 +2110,36 @@ var MezonApi = class {
|
|
|
2110
2110
|
]);
|
|
2111
2111
|
}
|
|
2112
2112
|
/** */
|
|
2113
|
+
listAuditLog(bearerToken, actionLog, userId, clanId, page, pageSize, options = {}) {
|
|
2114
|
+
const urlPath = "/v2/audit_log";
|
|
2115
|
+
const queryParams = /* @__PURE__ */ new Map();
|
|
2116
|
+
queryParams.set("action_log", actionLog);
|
|
2117
|
+
queryParams.set("user_id", userId);
|
|
2118
|
+
queryParams.set("clan_id", clanId);
|
|
2119
|
+
queryParams.set("page", page);
|
|
2120
|
+
queryParams.set("page_size", pageSize);
|
|
2121
|
+
let bodyJson = "";
|
|
2122
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
|
2123
|
+
const fetchOptions = buildFetchOptions("GET", options, bodyJson);
|
|
2124
|
+
if (bearerToken) {
|
|
2125
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
|
2126
|
+
}
|
|
2127
|
+
return Promise.race([
|
|
2128
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
|
2129
|
+
if (response.status == 204) {
|
|
2130
|
+
return response;
|
|
2131
|
+
} else if (response.status >= 200 && response.status < 300) {
|
|
2132
|
+
return response.json();
|
|
2133
|
+
} else {
|
|
2134
|
+
throw response;
|
|
2135
|
+
}
|
|
2136
|
+
}),
|
|
2137
|
+
new Promise(
|
|
2138
|
+
(_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
|
|
2139
|
+
)
|
|
2140
|
+
]);
|
|
2141
|
+
}
|
|
2142
|
+
/** */
|
|
2113
2143
|
updateCategoryOrder(bearerToken, body, options = {}) {
|
|
2114
2144
|
if (body === null || body === void 0) {
|
|
2115
2145
|
throw new Error(
|
|
@@ -2428,6 +2458,67 @@ var MezonApi = class {
|
|
|
2428
2458
|
)
|
|
2429
2459
|
]);
|
|
2430
2460
|
}
|
|
2461
|
+
/** get channel encryption method */
|
|
2462
|
+
getChanEncryptionMethod(bearerToken, channelId, method, options = {}) {
|
|
2463
|
+
if (channelId === null || channelId === void 0) {
|
|
2464
|
+
throw new Error("'channelId' is a required parameter but is null or undefined.");
|
|
2465
|
+
}
|
|
2466
|
+
const urlPath = "/v2/channel/{channelId}/encrypt_method".replace("{channelId}", encodeURIComponent(String(channelId)));
|
|
2467
|
+
const queryParams = /* @__PURE__ */ new Map();
|
|
2468
|
+
queryParams.set("method", method);
|
|
2469
|
+
let bodyJson = "";
|
|
2470
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
|
2471
|
+
const fetchOptions = buildFetchOptions("GET", options, bodyJson);
|
|
2472
|
+
if (bearerToken) {
|
|
2473
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
|
2474
|
+
}
|
|
2475
|
+
return Promise.race([
|
|
2476
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
|
2477
|
+
if (response.status == 204) {
|
|
2478
|
+
return response;
|
|
2479
|
+
} else if (response.status >= 200 && response.status < 300) {
|
|
2480
|
+
return response.json();
|
|
2481
|
+
} else {
|
|
2482
|
+
throw response;
|
|
2483
|
+
}
|
|
2484
|
+
}),
|
|
2485
|
+
new Promise(
|
|
2486
|
+
(_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
|
|
2487
|
+
)
|
|
2488
|
+
]);
|
|
2489
|
+
}
|
|
2490
|
+
/** store channel encryption method */
|
|
2491
|
+
setChanEncryptionMethod(bearerToken, channelId, body, options = {}) {
|
|
2492
|
+
if (channelId === null || channelId === void 0) {
|
|
2493
|
+
throw new Error("'channelId' is a required parameter but is null or undefined.");
|
|
2494
|
+
}
|
|
2495
|
+
if (body === null || body === void 0) {
|
|
2496
|
+
throw new Error("'body' is a required parameter but is null or undefined.");
|
|
2497
|
+
}
|
|
2498
|
+
const urlPath = "/v2/channel/{channelId}/encrypt_method".replace("{channelId}", encodeURIComponent(String(channelId)));
|
|
2499
|
+
const queryParams = /* @__PURE__ */ new Map();
|
|
2500
|
+
let bodyJson = "";
|
|
2501
|
+
bodyJson = JSON.stringify(body || {});
|
|
2502
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
|
2503
|
+
const fetchOptions = buildFetchOptions("POST", options, bodyJson);
|
|
2504
|
+
if (bearerToken) {
|
|
2505
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
|
2506
|
+
}
|
|
2507
|
+
return Promise.race([
|
|
2508
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
|
2509
|
+
if (response.status == 204) {
|
|
2510
|
+
return response;
|
|
2511
|
+
} else if (response.status >= 200 && response.status < 300) {
|
|
2512
|
+
return response.json();
|
|
2513
|
+
} else {
|
|
2514
|
+
throw response;
|
|
2515
|
+
}
|
|
2516
|
+
}),
|
|
2517
|
+
new Promise(
|
|
2518
|
+
(_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
|
|
2519
|
+
)
|
|
2520
|
+
]);
|
|
2521
|
+
}
|
|
2431
2522
|
/** Leave a channel the user is a member of. */
|
|
2432
2523
|
leaveThread(bearerToken, channelId, options = {}) {
|
|
2433
2524
|
if (channelId === null || channelId === void 0) {
|
|
@@ -3969,6 +4060,31 @@ var MezonApi = class {
|
|
|
3969
4060
|
)
|
|
3970
4061
|
]);
|
|
3971
4062
|
}
|
|
4063
|
+
/** get key server */
|
|
4064
|
+
getKeyServer(bearerToken, options = {}) {
|
|
4065
|
+
const urlPath = "/v2/e2ee/key_server";
|
|
4066
|
+
const queryParams = /* @__PURE__ */ new Map();
|
|
4067
|
+
let bodyJson = "";
|
|
4068
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
|
4069
|
+
const fetchOptions = buildFetchOptions("GET", options, bodyJson);
|
|
4070
|
+
if (bearerToken) {
|
|
4071
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
|
4072
|
+
}
|
|
4073
|
+
return Promise.race([
|
|
4074
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
|
4075
|
+
if (response.status == 204) {
|
|
4076
|
+
return response;
|
|
4077
|
+
} else if (response.status >= 200 && response.status < 300) {
|
|
4078
|
+
return response.json();
|
|
4079
|
+
} else {
|
|
4080
|
+
throw response;
|
|
4081
|
+
}
|
|
4082
|
+
}),
|
|
4083
|
+
new Promise(
|
|
4084
|
+
(_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
|
|
4085
|
+
)
|
|
4086
|
+
]);
|
|
4087
|
+
}
|
|
3972
4088
|
/** List HashtagDMList */
|
|
3973
4089
|
hashtagDMList(bearerToken, userId, limit, options = {}) {
|
|
3974
4090
|
const urlPath = "/v2/hashtagdmlist";
|
|
@@ -4663,6 +4779,61 @@ var MezonApi = class {
|
|
|
4663
4779
|
)
|
|
4664
4780
|
]);
|
|
4665
4781
|
}
|
|
4782
|
+
/** get pubkey */
|
|
4783
|
+
getPubKeys(bearerToken, userIds, options = {}) {
|
|
4784
|
+
const urlPath = "/v2/pubkey";
|
|
4785
|
+
const queryParams = /* @__PURE__ */ new Map();
|
|
4786
|
+
queryParams.set("user_ids", userIds);
|
|
4787
|
+
let bodyJson = "";
|
|
4788
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
|
4789
|
+
const fetchOptions = buildFetchOptions("GET", options, bodyJson);
|
|
4790
|
+
if (bearerToken) {
|
|
4791
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
|
4792
|
+
}
|
|
4793
|
+
return Promise.race([
|
|
4794
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
|
4795
|
+
if (response.status == 204) {
|
|
4796
|
+
return response;
|
|
4797
|
+
} else if (response.status >= 200 && response.status < 300) {
|
|
4798
|
+
return response.json();
|
|
4799
|
+
} else {
|
|
4800
|
+
throw response;
|
|
4801
|
+
}
|
|
4802
|
+
}),
|
|
4803
|
+
new Promise(
|
|
4804
|
+
(_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
|
|
4805
|
+
)
|
|
4806
|
+
]);
|
|
4807
|
+
}
|
|
4808
|
+
/** store pubkey for e2ee */
|
|
4809
|
+
pushPubKey(bearerToken, body, options = {}) {
|
|
4810
|
+
if (body === null || body === void 0) {
|
|
4811
|
+
throw new Error("'body' is a required parameter but is null or undefined.");
|
|
4812
|
+
}
|
|
4813
|
+
const urlPath = "/v2/pubkey/push";
|
|
4814
|
+
const queryParams = /* @__PURE__ */ new Map();
|
|
4815
|
+
let bodyJson = "";
|
|
4816
|
+
bodyJson = JSON.stringify(body || {});
|
|
4817
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
|
4818
|
+
const fetchOptions = buildFetchOptions("POST", options, bodyJson);
|
|
4819
|
+
if (bearerToken) {
|
|
4820
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
|
4821
|
+
}
|
|
4822
|
+
return Promise.race([
|
|
4823
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
|
4824
|
+
if (response.status == 204) {
|
|
4825
|
+
return response;
|
|
4826
|
+
} else if (response.status >= 200 && response.status < 300) {
|
|
4827
|
+
return response.json();
|
|
4828
|
+
} else {
|
|
4829
|
+
throw response;
|
|
4830
|
+
}
|
|
4831
|
+
}),
|
|
4832
|
+
new Promise(
|
|
4833
|
+
(_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
|
|
4834
|
+
)
|
|
4835
|
+
]);
|
|
4836
|
+
}
|
|
4666
4837
|
/** */
|
|
4667
4838
|
addRolesChannelDesc(bearerToken, body, options = {}) {
|
|
4668
4839
|
if (body === null || body === void 0) {
|
|
@@ -9119,4 +9290,64 @@ var Client = class {
|
|
|
9119
9290
|
});
|
|
9120
9291
|
});
|
|
9121
9292
|
}
|
|
9293
|
+
getChanEncryptionMethod(session, channelId) {
|
|
9294
|
+
return __async(this, null, function* () {
|
|
9295
|
+
if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
|
|
9296
|
+
yield this.sessionRefresh(session);
|
|
9297
|
+
}
|
|
9298
|
+
return this.apiClient.getChanEncryptionMethod(session.token, channelId).then((response) => {
|
|
9299
|
+
return response;
|
|
9300
|
+
});
|
|
9301
|
+
});
|
|
9302
|
+
}
|
|
9303
|
+
setChanEncryptionMethod(session, channelId, method) {
|
|
9304
|
+
return __async(this, null, function* () {
|
|
9305
|
+
if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
|
|
9306
|
+
yield this.sessionRefresh(session);
|
|
9307
|
+
}
|
|
9308
|
+
return this.apiClient.setChanEncryptionMethod(session.token, channelId, { method }).then((response) => {
|
|
9309
|
+
return response;
|
|
9310
|
+
});
|
|
9311
|
+
});
|
|
9312
|
+
}
|
|
9313
|
+
getPubKeys(session, userIds) {
|
|
9314
|
+
return __async(this, null, function* () {
|
|
9315
|
+
if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
|
|
9316
|
+
yield this.sessionRefresh(session);
|
|
9317
|
+
}
|
|
9318
|
+
return this.apiClient.getPubKeys(session.token, userIds).then((response) => {
|
|
9319
|
+
return response;
|
|
9320
|
+
});
|
|
9321
|
+
});
|
|
9322
|
+
}
|
|
9323
|
+
pushPubKey(session, PK) {
|
|
9324
|
+
return __async(this, null, function* () {
|
|
9325
|
+
if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
|
|
9326
|
+
yield this.sessionRefresh(session);
|
|
9327
|
+
}
|
|
9328
|
+
return this.apiClient.pushPubKey(session.token, { PK }).then((response) => {
|
|
9329
|
+
return response;
|
|
9330
|
+
});
|
|
9331
|
+
});
|
|
9332
|
+
}
|
|
9333
|
+
getKeyServer(session) {
|
|
9334
|
+
return __async(this, null, function* () {
|
|
9335
|
+
if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
|
|
9336
|
+
yield this.sessionRefresh(session);
|
|
9337
|
+
}
|
|
9338
|
+
return this.apiClient.getKeyServer(session.token).then((response) => {
|
|
9339
|
+
return response;
|
|
9340
|
+
});
|
|
9341
|
+
});
|
|
9342
|
+
}
|
|
9343
|
+
listAuditLog(session) {
|
|
9344
|
+
return __async(this, null, function* () {
|
|
9345
|
+
if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
|
|
9346
|
+
yield this.sessionRefresh(session);
|
|
9347
|
+
}
|
|
9348
|
+
return this.apiClient.listAuditLog(session.token).then((response) => {
|
|
9349
|
+
return response;
|
|
9350
|
+
});
|
|
9351
|
+
});
|
|
9352
|
+
}
|
|
9122
9353
|
};
|
package/dist/mezon-js.esm.mjs
CHANGED
|
@@ -2081,6 +2081,36 @@ var MezonApi = class {
|
|
|
2081
2081
|
]);
|
|
2082
2082
|
}
|
|
2083
2083
|
/** */
|
|
2084
|
+
listAuditLog(bearerToken, actionLog, userId, clanId, page, pageSize, options = {}) {
|
|
2085
|
+
const urlPath = "/v2/audit_log";
|
|
2086
|
+
const queryParams = /* @__PURE__ */ new Map();
|
|
2087
|
+
queryParams.set("action_log", actionLog);
|
|
2088
|
+
queryParams.set("user_id", userId);
|
|
2089
|
+
queryParams.set("clan_id", clanId);
|
|
2090
|
+
queryParams.set("page", page);
|
|
2091
|
+
queryParams.set("page_size", pageSize);
|
|
2092
|
+
let bodyJson = "";
|
|
2093
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
|
2094
|
+
const fetchOptions = buildFetchOptions("GET", options, bodyJson);
|
|
2095
|
+
if (bearerToken) {
|
|
2096
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
|
2097
|
+
}
|
|
2098
|
+
return Promise.race([
|
|
2099
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
|
2100
|
+
if (response.status == 204) {
|
|
2101
|
+
return response;
|
|
2102
|
+
} else if (response.status >= 200 && response.status < 300) {
|
|
2103
|
+
return response.json();
|
|
2104
|
+
} else {
|
|
2105
|
+
throw response;
|
|
2106
|
+
}
|
|
2107
|
+
}),
|
|
2108
|
+
new Promise(
|
|
2109
|
+
(_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
|
|
2110
|
+
)
|
|
2111
|
+
]);
|
|
2112
|
+
}
|
|
2113
|
+
/** */
|
|
2084
2114
|
updateCategoryOrder(bearerToken, body, options = {}) {
|
|
2085
2115
|
if (body === null || body === void 0) {
|
|
2086
2116
|
throw new Error(
|
|
@@ -2399,6 +2429,67 @@ var MezonApi = class {
|
|
|
2399
2429
|
)
|
|
2400
2430
|
]);
|
|
2401
2431
|
}
|
|
2432
|
+
/** get channel encryption method */
|
|
2433
|
+
getChanEncryptionMethod(bearerToken, channelId, method, options = {}) {
|
|
2434
|
+
if (channelId === null || channelId === void 0) {
|
|
2435
|
+
throw new Error("'channelId' is a required parameter but is null or undefined.");
|
|
2436
|
+
}
|
|
2437
|
+
const urlPath = "/v2/channel/{channelId}/encrypt_method".replace("{channelId}", encodeURIComponent(String(channelId)));
|
|
2438
|
+
const queryParams = /* @__PURE__ */ new Map();
|
|
2439
|
+
queryParams.set("method", method);
|
|
2440
|
+
let bodyJson = "";
|
|
2441
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
|
2442
|
+
const fetchOptions = buildFetchOptions("GET", options, bodyJson);
|
|
2443
|
+
if (bearerToken) {
|
|
2444
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
|
2445
|
+
}
|
|
2446
|
+
return Promise.race([
|
|
2447
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
|
2448
|
+
if (response.status == 204) {
|
|
2449
|
+
return response;
|
|
2450
|
+
} else if (response.status >= 200 && response.status < 300) {
|
|
2451
|
+
return response.json();
|
|
2452
|
+
} else {
|
|
2453
|
+
throw response;
|
|
2454
|
+
}
|
|
2455
|
+
}),
|
|
2456
|
+
new Promise(
|
|
2457
|
+
(_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
|
|
2458
|
+
)
|
|
2459
|
+
]);
|
|
2460
|
+
}
|
|
2461
|
+
/** store channel encryption method */
|
|
2462
|
+
setChanEncryptionMethod(bearerToken, channelId, body, options = {}) {
|
|
2463
|
+
if (channelId === null || channelId === void 0) {
|
|
2464
|
+
throw new Error("'channelId' is a required parameter but is null or undefined.");
|
|
2465
|
+
}
|
|
2466
|
+
if (body === null || body === void 0) {
|
|
2467
|
+
throw new Error("'body' is a required parameter but is null or undefined.");
|
|
2468
|
+
}
|
|
2469
|
+
const urlPath = "/v2/channel/{channelId}/encrypt_method".replace("{channelId}", encodeURIComponent(String(channelId)));
|
|
2470
|
+
const queryParams = /* @__PURE__ */ new Map();
|
|
2471
|
+
let bodyJson = "";
|
|
2472
|
+
bodyJson = JSON.stringify(body || {});
|
|
2473
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
|
2474
|
+
const fetchOptions = buildFetchOptions("POST", options, bodyJson);
|
|
2475
|
+
if (bearerToken) {
|
|
2476
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
|
2477
|
+
}
|
|
2478
|
+
return Promise.race([
|
|
2479
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
|
2480
|
+
if (response.status == 204) {
|
|
2481
|
+
return response;
|
|
2482
|
+
} else if (response.status >= 200 && response.status < 300) {
|
|
2483
|
+
return response.json();
|
|
2484
|
+
} else {
|
|
2485
|
+
throw response;
|
|
2486
|
+
}
|
|
2487
|
+
}),
|
|
2488
|
+
new Promise(
|
|
2489
|
+
(_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
|
|
2490
|
+
)
|
|
2491
|
+
]);
|
|
2492
|
+
}
|
|
2402
2493
|
/** Leave a channel the user is a member of. */
|
|
2403
2494
|
leaveThread(bearerToken, channelId, options = {}) {
|
|
2404
2495
|
if (channelId === null || channelId === void 0) {
|
|
@@ -3940,6 +4031,31 @@ var MezonApi = class {
|
|
|
3940
4031
|
)
|
|
3941
4032
|
]);
|
|
3942
4033
|
}
|
|
4034
|
+
/** get key server */
|
|
4035
|
+
getKeyServer(bearerToken, options = {}) {
|
|
4036
|
+
const urlPath = "/v2/e2ee/key_server";
|
|
4037
|
+
const queryParams = /* @__PURE__ */ new Map();
|
|
4038
|
+
let bodyJson = "";
|
|
4039
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
|
4040
|
+
const fetchOptions = buildFetchOptions("GET", options, bodyJson);
|
|
4041
|
+
if (bearerToken) {
|
|
4042
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
|
4043
|
+
}
|
|
4044
|
+
return Promise.race([
|
|
4045
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
|
4046
|
+
if (response.status == 204) {
|
|
4047
|
+
return response;
|
|
4048
|
+
} else if (response.status >= 200 && response.status < 300) {
|
|
4049
|
+
return response.json();
|
|
4050
|
+
} else {
|
|
4051
|
+
throw response;
|
|
4052
|
+
}
|
|
4053
|
+
}),
|
|
4054
|
+
new Promise(
|
|
4055
|
+
(_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
|
|
4056
|
+
)
|
|
4057
|
+
]);
|
|
4058
|
+
}
|
|
3943
4059
|
/** List HashtagDMList */
|
|
3944
4060
|
hashtagDMList(bearerToken, userId, limit, options = {}) {
|
|
3945
4061
|
const urlPath = "/v2/hashtagdmlist";
|
|
@@ -4634,6 +4750,61 @@ var MezonApi = class {
|
|
|
4634
4750
|
)
|
|
4635
4751
|
]);
|
|
4636
4752
|
}
|
|
4753
|
+
/** get pubkey */
|
|
4754
|
+
getPubKeys(bearerToken, userIds, options = {}) {
|
|
4755
|
+
const urlPath = "/v2/pubkey";
|
|
4756
|
+
const queryParams = /* @__PURE__ */ new Map();
|
|
4757
|
+
queryParams.set("user_ids", userIds);
|
|
4758
|
+
let bodyJson = "";
|
|
4759
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
|
4760
|
+
const fetchOptions = buildFetchOptions("GET", options, bodyJson);
|
|
4761
|
+
if (bearerToken) {
|
|
4762
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
|
4763
|
+
}
|
|
4764
|
+
return Promise.race([
|
|
4765
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
|
4766
|
+
if (response.status == 204) {
|
|
4767
|
+
return response;
|
|
4768
|
+
} else if (response.status >= 200 && response.status < 300) {
|
|
4769
|
+
return response.json();
|
|
4770
|
+
} else {
|
|
4771
|
+
throw response;
|
|
4772
|
+
}
|
|
4773
|
+
}),
|
|
4774
|
+
new Promise(
|
|
4775
|
+
(_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
|
|
4776
|
+
)
|
|
4777
|
+
]);
|
|
4778
|
+
}
|
|
4779
|
+
/** store pubkey for e2ee */
|
|
4780
|
+
pushPubKey(bearerToken, body, options = {}) {
|
|
4781
|
+
if (body === null || body === void 0) {
|
|
4782
|
+
throw new Error("'body' is a required parameter but is null or undefined.");
|
|
4783
|
+
}
|
|
4784
|
+
const urlPath = "/v2/pubkey/push";
|
|
4785
|
+
const queryParams = /* @__PURE__ */ new Map();
|
|
4786
|
+
let bodyJson = "";
|
|
4787
|
+
bodyJson = JSON.stringify(body || {});
|
|
4788
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
|
4789
|
+
const fetchOptions = buildFetchOptions("POST", options, bodyJson);
|
|
4790
|
+
if (bearerToken) {
|
|
4791
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
|
4792
|
+
}
|
|
4793
|
+
return Promise.race([
|
|
4794
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
|
4795
|
+
if (response.status == 204) {
|
|
4796
|
+
return response;
|
|
4797
|
+
} else if (response.status >= 200 && response.status < 300) {
|
|
4798
|
+
return response.json();
|
|
4799
|
+
} else {
|
|
4800
|
+
throw response;
|
|
4801
|
+
}
|
|
4802
|
+
}),
|
|
4803
|
+
new Promise(
|
|
4804
|
+
(_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
|
|
4805
|
+
)
|
|
4806
|
+
]);
|
|
4807
|
+
}
|
|
4637
4808
|
/** */
|
|
4638
4809
|
addRolesChannelDesc(bearerToken, body, options = {}) {
|
|
4639
4810
|
if (body === null || body === void 0) {
|
|
@@ -9090,6 +9261,66 @@ var Client = class {
|
|
|
9090
9261
|
});
|
|
9091
9262
|
});
|
|
9092
9263
|
}
|
|
9264
|
+
getChanEncryptionMethod(session, channelId) {
|
|
9265
|
+
return __async(this, null, function* () {
|
|
9266
|
+
if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
|
|
9267
|
+
yield this.sessionRefresh(session);
|
|
9268
|
+
}
|
|
9269
|
+
return this.apiClient.getChanEncryptionMethod(session.token, channelId).then((response) => {
|
|
9270
|
+
return response;
|
|
9271
|
+
});
|
|
9272
|
+
});
|
|
9273
|
+
}
|
|
9274
|
+
setChanEncryptionMethod(session, channelId, method) {
|
|
9275
|
+
return __async(this, null, function* () {
|
|
9276
|
+
if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
|
|
9277
|
+
yield this.sessionRefresh(session);
|
|
9278
|
+
}
|
|
9279
|
+
return this.apiClient.setChanEncryptionMethod(session.token, channelId, { method }).then((response) => {
|
|
9280
|
+
return response;
|
|
9281
|
+
});
|
|
9282
|
+
});
|
|
9283
|
+
}
|
|
9284
|
+
getPubKeys(session, userIds) {
|
|
9285
|
+
return __async(this, null, function* () {
|
|
9286
|
+
if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
|
|
9287
|
+
yield this.sessionRefresh(session);
|
|
9288
|
+
}
|
|
9289
|
+
return this.apiClient.getPubKeys(session.token, userIds).then((response) => {
|
|
9290
|
+
return response;
|
|
9291
|
+
});
|
|
9292
|
+
});
|
|
9293
|
+
}
|
|
9294
|
+
pushPubKey(session, PK) {
|
|
9295
|
+
return __async(this, null, function* () {
|
|
9296
|
+
if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
|
|
9297
|
+
yield this.sessionRefresh(session);
|
|
9298
|
+
}
|
|
9299
|
+
return this.apiClient.pushPubKey(session.token, { PK }).then((response) => {
|
|
9300
|
+
return response;
|
|
9301
|
+
});
|
|
9302
|
+
});
|
|
9303
|
+
}
|
|
9304
|
+
getKeyServer(session) {
|
|
9305
|
+
return __async(this, null, function* () {
|
|
9306
|
+
if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
|
|
9307
|
+
yield this.sessionRefresh(session);
|
|
9308
|
+
}
|
|
9309
|
+
return this.apiClient.getKeyServer(session.token).then((response) => {
|
|
9310
|
+
return response;
|
|
9311
|
+
});
|
|
9312
|
+
});
|
|
9313
|
+
}
|
|
9314
|
+
listAuditLog(session) {
|
|
9315
|
+
return __async(this, null, function* () {
|
|
9316
|
+
if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
|
|
9317
|
+
yield this.sessionRefresh(session);
|
|
9318
|
+
}
|
|
9319
|
+
return this.apiClient.listAuditLog(session.token).then((response) => {
|
|
9320
|
+
return response;
|
|
9321
|
+
});
|
|
9322
|
+
});
|
|
9323
|
+
}
|
|
9093
9324
|
};
|
|
9094
9325
|
export {
|
|
9095
9326
|
ChannelStreamMode,
|