mezon-js 2.9.58 → 2.9.61
Sign up to get free protection for your applications and to get access to all the features.
- 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 +252 -8
- package/dist/mezon-js.esm.mjs +252 -8
- package/dist/socket.d.ts +16 -6
- package/package.json +1 -1
- package/socket.ts +47 -20
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
|
}
|