mezon-js 2.8.36 → 2.8.38
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 +59 -187
- package/client.ts +13 -103
- package/dist/api.gen.d.ts +17 -22
- package/dist/client.d.ts +3 -58
- package/dist/mezon-js.cjs.js +13 -151
- package/dist/mezon-js.esm.mjs +13 -151
- package/dist/socket.d.ts +2 -2
- package/package.json +1 -1
- package/socket.ts +5 -3
- package/dist/api1.gen.d.ts +0 -1157
package/api.gen.ts
CHANGED
|
@@ -66,31 +66,6 @@ export interface ApiAddAppRequest {
|
|
|
66
66
|
token?: string;
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
-
|
|
70
|
-
/** App information. */
|
|
71
|
-
export interface ApiApp {
|
|
72
|
-
//
|
|
73
|
-
applogo?: string;
|
|
74
|
-
//
|
|
75
|
-
appname?: string;
|
|
76
|
-
//
|
|
77
|
-
creator_id?: string;
|
|
78
|
-
//The UNIX time when the app was disabled.
|
|
79
|
-
disable_time?: string;
|
|
80
|
-
//
|
|
81
|
-
online?: boolean;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
/** A list of apps. */
|
|
85
|
-
export interface ApiAppList {
|
|
86
|
-
//A list of apps.
|
|
87
|
-
apps?: Array<ApiApp>;
|
|
88
|
-
//Next cursor.
|
|
89
|
-
next_cursor?: string;
|
|
90
|
-
//Approximate total number of apps.
|
|
91
|
-
total_count?: number;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
69
|
/**
|
|
95
70
|
* - USER_ROLE_ADMIN: All access
|
|
96
71
|
- USER_ROLE_DEVELOPER: Best for developers, also enables APIs and API explorer
|
|
@@ -359,6 +334,36 @@ export interface ApiAddRoleChannelDescRequest {
|
|
|
359
334
|
role_ids?: Array<string>;
|
|
360
335
|
}
|
|
361
336
|
|
|
337
|
+
/** App information. */
|
|
338
|
+
export interface ApiApp {
|
|
339
|
+
// app id
|
|
340
|
+
id: string;
|
|
341
|
+
//
|
|
342
|
+
applogo?: string;
|
|
343
|
+
//
|
|
344
|
+
appname?: string;
|
|
345
|
+
//
|
|
346
|
+
creator_id?: string;
|
|
347
|
+
//The UNIX time when the app was disabled.
|
|
348
|
+
disable_time?: string;
|
|
349
|
+
//
|
|
350
|
+
is_shadow?: boolean;
|
|
351
|
+
//
|
|
352
|
+
role?: number;
|
|
353
|
+
//
|
|
354
|
+
token?: string;
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
/** A list of apps. */
|
|
358
|
+
export interface ApiAppList {
|
|
359
|
+
//A list of apps.
|
|
360
|
+
apps?: Array<ApiApp>;
|
|
361
|
+
//Next cursor.
|
|
362
|
+
next_cursor?: string;
|
|
363
|
+
//Approximate total number of apps.
|
|
364
|
+
total_count?: number;
|
|
365
|
+
}
|
|
366
|
+
|
|
362
367
|
/** */
|
|
363
368
|
export interface ApiCategoryDesc {
|
|
364
369
|
//
|
|
@@ -5020,39 +5025,6 @@ export class MezonApi {
|
|
|
5020
5025
|
]);
|
|
5021
5026
|
}
|
|
5022
5027
|
|
|
5023
|
-
/** notification selected */
|
|
5024
|
-
getNotificationChannelSetting(bearerToken: string,
|
|
5025
|
-
channelId?:string,
|
|
5026
|
-
options: any = {}): Promise<ApiNotificationUserChannel> {
|
|
5027
|
-
|
|
5028
|
-
const urlPath = "/v2/notificationchannel/get";
|
|
5029
|
-
const queryParams = new Map<string, any>();
|
|
5030
|
-
queryParams.set("channel_id", channelId);
|
|
5031
|
-
|
|
5032
|
-
let bodyJson : string = "";
|
|
5033
|
-
|
|
5034
|
-
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
|
5035
|
-
const fetchOptions = buildFetchOptions("GET", options, bodyJson);
|
|
5036
|
-
if (bearerToken) {
|
|
5037
|
-
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
|
5038
|
-
}
|
|
5039
|
-
|
|
5040
|
-
return Promise.race([
|
|
5041
|
-
fetch(fullUrl, fetchOptions).then((response) => {
|
|
5042
|
-
if (response.status == 204) {
|
|
5043
|
-
return response;
|
|
5044
|
-
} else if (response.status >= 200 && response.status < 300) {
|
|
5045
|
-
return response.json();
|
|
5046
|
-
} else {
|
|
5047
|
-
throw response;
|
|
5048
|
-
}
|
|
5049
|
-
}),
|
|
5050
|
-
new Promise((_, reject) =>
|
|
5051
|
-
setTimeout(reject, this.timeoutMs, "Request timed out.")
|
|
5052
|
-
),
|
|
5053
|
-
]);
|
|
5054
|
-
}
|
|
5055
|
-
|
|
5056
5028
|
/** set notification user channel. */
|
|
5057
5029
|
setNotificationChannelSetting(bearerToken: string,
|
|
5058
5030
|
body:ApiSetNotificationRequest,
|
|
@@ -5194,39 +5166,6 @@ export class MezonApi {
|
|
|
5194
5166
|
]);
|
|
5195
5167
|
}
|
|
5196
5168
|
|
|
5197
|
-
/** notification selected */
|
|
5198
|
-
getNotificationCategorySetting(bearerToken: string,
|
|
5199
|
-
categoryId?:string,
|
|
5200
|
-
options: any = {}): Promise<ApiNotificationUserChannel> {
|
|
5201
|
-
|
|
5202
|
-
const urlPath = "/v2/notificationusercategory/get";
|
|
5203
|
-
const queryParams = new Map<string, any>();
|
|
5204
|
-
queryParams.set("category_id", categoryId);
|
|
5205
|
-
|
|
5206
|
-
let bodyJson : string = "";
|
|
5207
|
-
|
|
5208
|
-
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
|
5209
|
-
const fetchOptions = buildFetchOptions("GET", options, bodyJson);
|
|
5210
|
-
if (bearerToken) {
|
|
5211
|
-
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
|
5212
|
-
}
|
|
5213
|
-
|
|
5214
|
-
return Promise.race([
|
|
5215
|
-
fetch(fullUrl, fetchOptions).then((response) => {
|
|
5216
|
-
if (response.status == 204) {
|
|
5217
|
-
return response;
|
|
5218
|
-
} else if (response.status >= 200 && response.status < 300) {
|
|
5219
|
-
return response.json();
|
|
5220
|
-
} else {
|
|
5221
|
-
throw response;
|
|
5222
|
-
}
|
|
5223
|
-
}),
|
|
5224
|
-
new Promise((_, reject) =>
|
|
5225
|
-
setTimeout(reject, this.timeoutMs, "Request timed out.")
|
|
5226
|
-
),
|
|
5227
|
-
]);
|
|
5228
|
-
}
|
|
5229
|
-
|
|
5230
5169
|
/** */
|
|
5231
5170
|
deleteNotificationChannel(bearerToken: string,
|
|
5232
5171
|
channelId?:string,
|
|
@@ -5260,72 +5199,38 @@ export class MezonApi {
|
|
|
5260
5199
|
]);
|
|
5261
5200
|
}
|
|
5262
5201
|
|
|
5263
|
-
/** notification selected */
|
|
5264
|
-
getNotificationClanSetting(bearerToken: string,
|
|
5265
|
-
clanId?:string,
|
|
5266
|
-
options: any = {}): Promise<ApiNotificationSetting> {
|
|
5267
|
-
|
|
5268
|
-
const urlPath = "/v2/notificationuserclan/get";
|
|
5269
|
-
const queryParams = new Map<string, any>();
|
|
5270
|
-
queryParams.set("clan_id", clanId);
|
|
5271
|
-
|
|
5272
|
-
let bodyJson : string = "";
|
|
5273
|
-
|
|
5274
|
-
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
|
5275
|
-
const fetchOptions = buildFetchOptions("GET", options, bodyJson);
|
|
5276
|
-
if (bearerToken) {
|
|
5277
|
-
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
|
5278
|
-
}
|
|
5279
|
-
|
|
5280
|
-
return Promise.race([
|
|
5281
|
-
fetch(fullUrl, fetchOptions).then((response) => {
|
|
5282
|
-
if (response.status == 204) {
|
|
5283
|
-
return response;
|
|
5284
|
-
} else if (response.status >= 200 && response.status < 300) {
|
|
5285
|
-
return response.json();
|
|
5286
|
-
} else {
|
|
5287
|
-
throw response;
|
|
5288
|
-
}
|
|
5289
|
-
}),
|
|
5290
|
-
new Promise((_, reject) =>
|
|
5291
|
-
setTimeout(reject, this.timeoutMs, "Request timed out.")
|
|
5292
|
-
),
|
|
5293
|
-
]);
|
|
5294
|
-
}
|
|
5295
|
-
|
|
5296
5202
|
/** notification category, channel selected */
|
|
5297
5203
|
getChannelCategoryNotiSettingsList(bearerToken: string,
|
|
5298
|
-
|
|
5299
|
-
|
|
5300
|
-
|
|
5301
|
-
|
|
5302
|
-
|
|
5303
|
-
|
|
5304
|
-
|
|
5305
|
-
|
|
5306
|
-
|
|
5307
|
-
|
|
5308
|
-
|
|
5309
|
-
|
|
5310
|
-
|
|
5311
|
-
|
|
5312
|
-
|
|
5313
|
-
|
|
5314
|
-
|
|
5315
|
-
|
|
5316
|
-
|
|
5317
|
-
|
|
5318
|
-
|
|
5319
|
-
|
|
5320
|
-
|
|
5321
|
-
|
|
5322
|
-
|
|
5323
|
-
|
|
5324
|
-
|
|
5325
|
-
|
|
5326
|
-
|
|
5204
|
+
clanId?:string,
|
|
5205
|
+
options: any = {}): Promise<ApiNotificationChannelCategoySettingsList> {
|
|
5206
|
+
|
|
5207
|
+
const urlPath = "/v2/notifichannelcategory/get";
|
|
5208
|
+
const queryParams = new Map<string, any>();
|
|
5209
|
+
queryParams.set("clan_id", clanId);
|
|
5210
|
+
|
|
5211
|
+
let bodyJson : string = "";
|
|
5212
|
+
|
|
5213
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
|
5214
|
+
const fetchOptions = buildFetchOptions("GET", options, bodyJson);
|
|
5215
|
+
if (bearerToken) {
|
|
5216
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
|
5217
|
+
}
|
|
5218
|
+
|
|
5219
|
+
return Promise.race([
|
|
5220
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
|
5221
|
+
if (response.status == 204) {
|
|
5222
|
+
return response;
|
|
5223
|
+
} else if (response.status >= 200 && response.status < 300) {
|
|
5224
|
+
return response.json();
|
|
5225
|
+
} else {
|
|
5226
|
+
throw response;
|
|
5227
|
+
}
|
|
5228
|
+
}),
|
|
5229
|
+
new Promise((_, reject) =>
|
|
5230
|
+
setTimeout(reject, this.timeoutMs, "Request timed out.")
|
|
5231
|
+
),
|
|
5232
|
+
]);
|
|
5327
5233
|
}
|
|
5328
|
-
|
|
5329
5234
|
/** */
|
|
5330
5235
|
deleteNotiReactMessage(bearerToken: string,
|
|
5331
5236
|
channelId?:string,
|
|
@@ -5359,39 +5264,6 @@ export class MezonApi {
|
|
|
5359
5264
|
]);
|
|
5360
5265
|
}
|
|
5361
5266
|
|
|
5362
|
-
/** */
|
|
5363
|
-
getNotificationReactMessage(bearerToken: string,
|
|
5364
|
-
channelId?:string,
|
|
5365
|
-
options: any = {}): Promise<ApiNotifiReactMessage> {
|
|
5366
|
-
|
|
5367
|
-
const urlPath = "/v2/notifireactmessage/get";
|
|
5368
|
-
const queryParams = new Map<string, any>();
|
|
5369
|
-
queryParams.set("channel_id", channelId);
|
|
5370
|
-
|
|
5371
|
-
let bodyJson : string = "";
|
|
5372
|
-
|
|
5373
|
-
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
|
5374
|
-
const fetchOptions = buildFetchOptions("GET", options, bodyJson);
|
|
5375
|
-
if (bearerToken) {
|
|
5376
|
-
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
|
5377
|
-
}
|
|
5378
|
-
|
|
5379
|
-
return Promise.race([
|
|
5380
|
-
fetch(fullUrl, fetchOptions).then((response) => {
|
|
5381
|
-
if (response.status == 204) {
|
|
5382
|
-
return response;
|
|
5383
|
-
} else if (response.status >= 200 && response.status < 300) {
|
|
5384
|
-
return response.json();
|
|
5385
|
-
} else {
|
|
5386
|
-
throw response;
|
|
5387
|
-
}
|
|
5388
|
-
}),
|
|
5389
|
-
new Promise((_, reject) =>
|
|
5390
|
-
setTimeout(reject, this.timeoutMs, "Request timed out.")
|
|
5391
|
-
),
|
|
5392
|
-
]);
|
|
5393
|
-
}
|
|
5394
|
-
|
|
5395
5267
|
/** */
|
|
5396
5268
|
setNotificationReactMessage(bearerToken: string,
|
|
5397
5269
|
body:ApiNotificationChannel,
|
package/client.ts
CHANGED
|
@@ -74,11 +74,8 @@ import {
|
|
|
74
74
|
ApiEventList,
|
|
75
75
|
ApiDeleteEventRequest,
|
|
76
76
|
ApiNotificationChannelCategoySettingsList,
|
|
77
|
-
ApiNotificationSetting,
|
|
78
77
|
ApiSetDefaultNotificationRequest,
|
|
79
|
-
ApiNotificationUserChannel,
|
|
80
78
|
ApiSetNotificationRequest,
|
|
81
|
-
ApiNotifiReactMessage,
|
|
82
79
|
ApiSetMuteNotificationRequest,
|
|
83
80
|
ApiSearchMessageRequest,
|
|
84
81
|
ApiSearchMessageResponse,
|
|
@@ -100,6 +97,7 @@ import {
|
|
|
100
97
|
ApiUpdateRoleChannelRequest,
|
|
101
98
|
ApiAddAppRequest,
|
|
102
99
|
ApiAppList,
|
|
100
|
+
ApiApp,
|
|
103
101
|
} from "./api.gen";
|
|
104
102
|
|
|
105
103
|
import { Session } from "./session";
|
|
@@ -141,58 +139,6 @@ export interface RpcResponse {
|
|
|
141
139
|
payload?: object;
|
|
142
140
|
}
|
|
143
141
|
|
|
144
|
-
/** The object to store. */
|
|
145
|
-
export interface WriteStorageObject {
|
|
146
|
-
/** The collection to store the object. */
|
|
147
|
-
collection?: string;
|
|
148
|
-
/** The key for the object within the collection. */
|
|
149
|
-
key?: string;
|
|
150
|
-
/** The read access permissions for the object. */
|
|
151
|
-
permission_read?: number;
|
|
152
|
-
/** The write access permissions for the object. */
|
|
153
|
-
permission_write?: number;
|
|
154
|
-
/** The value of the object. */
|
|
155
|
-
value?: object;
|
|
156
|
-
/** The version hash of the object to check. Possible values are: ["", "*", "#hash#"]. */
|
|
157
|
-
version?: string;
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
/** An object within the storage engine. */
|
|
161
|
-
export interface StorageObject {
|
|
162
|
-
/** The collection which stores the object. */
|
|
163
|
-
collection?: string;
|
|
164
|
-
/** The UNIX time when the object was created. */
|
|
165
|
-
create_time?: string;
|
|
166
|
-
/** The key of the object within the collection. */
|
|
167
|
-
key?: string;
|
|
168
|
-
/** The read access permissions for the object. */
|
|
169
|
-
permission_read?: number;
|
|
170
|
-
/** The write access permissions for the object. */
|
|
171
|
-
permission_write?: number;
|
|
172
|
-
/** The UNIX time when the object was last updated. */
|
|
173
|
-
update_time?: string;
|
|
174
|
-
/** The user owner of the object. */
|
|
175
|
-
user_id?: string;
|
|
176
|
-
/** The value of the object. */
|
|
177
|
-
value?: object;
|
|
178
|
-
/** The version hash of the object. */
|
|
179
|
-
version?: string;
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
/** List of storage objects. */
|
|
183
|
-
export interface StorageObjectList {
|
|
184
|
-
/** The cursor associated with the query a page of results. */
|
|
185
|
-
cursor?: string;
|
|
186
|
-
/** The list of storage objects. */
|
|
187
|
-
objects: Array<StorageObject>;
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
/** Batch of storage objects. */
|
|
191
|
-
export interface StorageObjects {
|
|
192
|
-
/** The batch of storage objects. */
|
|
193
|
-
objects: Array<StorageObject>;
|
|
194
|
-
}
|
|
195
|
-
|
|
196
142
|
/** A message sent on a channel. */
|
|
197
143
|
export interface ChannelMessage {
|
|
198
144
|
//The unique ID of this message.
|
|
@@ -1970,18 +1916,6 @@ export class Client {
|
|
|
1970
1916
|
});
|
|
1971
1917
|
}
|
|
1972
1918
|
|
|
1973
|
-
/** get default notification clan */
|
|
1974
|
-
async getNotificationClanSetting(session: Session, clanId: string): Promise<ApiNotificationSetting> {
|
|
1975
|
-
if (this.autoRefreshSession && session.refresh_token &&
|
|
1976
|
-
session.isexpired((Date.now() + this.expiredTimespanMs)/1000)) {
|
|
1977
|
-
await this.sessionRefresh(session);
|
|
1978
|
-
}
|
|
1979
|
-
|
|
1980
|
-
return this.apiClient.getNotificationClanSetting(session.token, clanId, {}).then((response: ApiNotificationSetting) => {
|
|
1981
|
-
return Promise.resolve(response);
|
|
1982
|
-
});
|
|
1983
|
-
}
|
|
1984
|
-
|
|
1985
1919
|
/** Set notification channel*/
|
|
1986
1920
|
async setNotificationChannel(session: Session, request: ApiSetNotificationRequest): Promise<boolean> {
|
|
1987
1921
|
if (this.autoRefreshSession && session.refresh_token &&
|
|
@@ -2018,18 +1952,6 @@ async updateChannelPrivate(session: Session, request: ApiChangeChannelPrivateReq
|
|
|
2018
1952
|
});
|
|
2019
1953
|
}
|
|
2020
1954
|
|
|
2021
|
-
/** get default notification clan */
|
|
2022
|
-
async getNotificationChannel(session: Session, channelId: string): Promise<ApiNotificationUserChannel> {
|
|
2023
|
-
if (this.autoRefreshSession && session.refresh_token &&
|
|
2024
|
-
session.isexpired((Date.now() + this.expiredTimespanMs)/1000)) {
|
|
2025
|
-
await this.sessionRefresh(session);
|
|
2026
|
-
}
|
|
2027
|
-
|
|
2028
|
-
return this.apiClient.getNotificationChannelSetting(session.token, channelId, {}).then((response: ApiNotificationUserChannel) => {
|
|
2029
|
-
return Promise.resolve(response);
|
|
2030
|
-
});
|
|
2031
|
-
}
|
|
2032
|
-
|
|
2033
1955
|
/** Set default notification category*/
|
|
2034
1956
|
async setNotificationCategory(session: Session, request: ApiSetDefaultNotificationRequest): Promise<boolean> {
|
|
2035
1957
|
if (this.autoRefreshSession && session.refresh_token &&
|
|
@@ -2042,18 +1964,6 @@ async getNotificationChannel(session: Session, channelId: string): Promise<ApiNo
|
|
|
2042
1964
|
});
|
|
2043
1965
|
}
|
|
2044
1966
|
|
|
2045
|
-
/** get default notification category */
|
|
2046
|
-
async getNotificationCategory(session: Session, category_id: string): Promise<ApiNotificationSetting> {
|
|
2047
|
-
if (this.autoRefreshSession && session.refresh_token &&
|
|
2048
|
-
session.isexpired((Date.now() + this.expiredTimespanMs)/1000)) {
|
|
2049
|
-
await this.sessionRefresh(session);
|
|
2050
|
-
}
|
|
2051
|
-
|
|
2052
|
-
return this.apiClient.getNotificationCategorySetting(session.token, category_id, {}).then((response: ApiNotificationSetting) => {
|
|
2053
|
-
return Promise.resolve(response);
|
|
2054
|
-
});
|
|
2055
|
-
}
|
|
2056
|
-
|
|
2057
1967
|
async deleteNotificationCategory(session: Session, category_id: string): Promise<boolean> {
|
|
2058
1968
|
if (this.autoRefreshSession && session.refresh_token &&
|
|
2059
1969
|
session.isexpired((Date.now() + this.expiredTimespanMs)/1000)) {
|
|
@@ -2099,17 +2009,6 @@ async deleteNotificationChannel(session: Session, channel_id: string): Promise<b
|
|
|
2099
2009
|
});
|
|
2100
2010
|
}
|
|
2101
2011
|
|
|
2102
|
-
/** */
|
|
2103
|
-
async getNotificationReactMessage(session: Session, channelId: string): Promise<ApiNotifiReactMessage> {
|
|
2104
|
-
if (this.autoRefreshSession && session.refresh_token &&
|
|
2105
|
-
session.isexpired((Date.now() + this.expiredTimespanMs)/1000)) {
|
|
2106
|
-
await this.sessionRefresh(session);
|
|
2107
|
-
}
|
|
2108
|
-
|
|
2109
|
-
return this.apiClient.getNotificationReactMessage(session.token, channelId).then((response: ApiNotifiReactMessage) => {
|
|
2110
|
-
return Promise.resolve(response);
|
|
2111
|
-
});
|
|
2112
|
-
}
|
|
2113
2012
|
//** */
|
|
2114
2013
|
async deleteNotiReactMessage(session: Session, channel_id: string): Promise<boolean> {
|
|
2115
2014
|
if (this.autoRefreshSession && session.refresh_token &&
|
|
@@ -2348,7 +2247,18 @@ async addApp(session: Session, request: ApiAddAppRequest): Promise<boolean> {
|
|
|
2348
2247
|
});
|
|
2349
2248
|
}
|
|
2350
2249
|
|
|
2351
|
-
async
|
|
2250
|
+
async getApp(session: Session, id: string): Promise<ApiApp> {
|
|
2251
|
+
if (this.autoRefreshSession && session.refresh_token &&
|
|
2252
|
+
session.isexpired((Date.now() + this.expiredTimespanMs)/1000)) {
|
|
2253
|
+
await this.sessionRefresh(session);
|
|
2254
|
+
}
|
|
2255
|
+
|
|
2256
|
+
return this.apiClient.getApp(session.token, id).then((response: ApiApp) => {
|
|
2257
|
+
return Promise.resolve(response);
|
|
2258
|
+
});
|
|
2259
|
+
}
|
|
2260
|
+
|
|
2261
|
+
async listApp(session: Session): Promise<ApiAppList> {
|
|
2352
2262
|
if (this.autoRefreshSession && session.refresh_token &&
|
|
2353
2263
|
session.isexpired((Date.now() + this.expiredTimespanMs)/1000)) {
|
|
2354
2264
|
await this.sessionRefresh(session);
|
package/dist/api.gen.d.ts
CHANGED
|
@@ -34,20 +34,6 @@ export interface ApiAddAppRequest {
|
|
|
34
34
|
role?: ApiAppRole;
|
|
35
35
|
token?: string;
|
|
36
36
|
}
|
|
37
|
-
/** App information. */
|
|
38
|
-
export interface ApiApp {
|
|
39
|
-
applogo?: string;
|
|
40
|
-
appname?: string;
|
|
41
|
-
creator_id?: string;
|
|
42
|
-
disable_time?: string;
|
|
43
|
-
online?: boolean;
|
|
44
|
-
}
|
|
45
|
-
/** A list of apps. */
|
|
46
|
-
export interface ApiAppList {
|
|
47
|
-
apps?: Array<ApiApp>;
|
|
48
|
-
next_cursor?: string;
|
|
49
|
-
total_count?: number;
|
|
50
|
-
}
|
|
51
37
|
/**
|
|
52
38
|
* - USER_ROLE_ADMIN: All access
|
|
53
39
|
- USER_ROLE_DEVELOPER: Best for developers, also enables APIs and API explorer
|
|
@@ -209,6 +195,23 @@ export interface ApiAddRoleChannelDescRequest {
|
|
|
209
195
|
channel_id?: string;
|
|
210
196
|
role_ids?: Array<string>;
|
|
211
197
|
}
|
|
198
|
+
/** App information. */
|
|
199
|
+
export interface ApiApp {
|
|
200
|
+
id: string;
|
|
201
|
+
applogo?: string;
|
|
202
|
+
appname?: string;
|
|
203
|
+
creator_id?: string;
|
|
204
|
+
disable_time?: string;
|
|
205
|
+
is_shadow?: boolean;
|
|
206
|
+
role?: number;
|
|
207
|
+
token?: string;
|
|
208
|
+
}
|
|
209
|
+
/** A list of apps. */
|
|
210
|
+
export interface ApiAppList {
|
|
211
|
+
apps?: Array<ApiApp>;
|
|
212
|
+
next_cursor?: string;
|
|
213
|
+
total_count?: number;
|
|
214
|
+
}
|
|
212
215
|
/** */
|
|
213
216
|
export interface ApiCategoryDesc {
|
|
214
217
|
category_id?: string;
|
|
@@ -1166,8 +1169,6 @@ export declare class MezonApi {
|
|
|
1166
1169
|
deleteNotifications(bearerToken: string, ids?: Array<string>, options?: any): Promise<any>;
|
|
1167
1170
|
/** Fetch list of notifications. */
|
|
1168
1171
|
listNotifications(bearerToken: string, clanId: string, limit?: number, cacheableCursor?: string, options?: any): Promise<ApiNotificationList>;
|
|
1169
|
-
/** notification selected */
|
|
1170
|
-
getNotificationChannelSetting(bearerToken: string, channelId?: string, options?: any): Promise<ApiNotificationUserChannel>;
|
|
1171
1172
|
/** set notification user channel. */
|
|
1172
1173
|
setNotificationChannelSetting(bearerToken: string, body: ApiSetNotificationRequest, options?: any): Promise<any>;
|
|
1173
1174
|
/** set notification user channel. */
|
|
@@ -1176,19 +1177,13 @@ export declare class MezonApi {
|
|
|
1176
1177
|
setNotificationCategorySetting(bearerToken: string, body: ApiSetNotificationRequest, options?: any): Promise<any>;
|
|
1177
1178
|
/** */
|
|
1178
1179
|
deleteNotificationCategorySetting(bearerToken: string, categoryId?: string, options?: any): Promise<any>;
|
|
1179
|
-
/** notification selected */
|
|
1180
|
-
getNotificationCategorySetting(bearerToken: string, categoryId?: string, options?: any): Promise<ApiNotificationUserChannel>;
|
|
1181
1180
|
/** */
|
|
1182
1181
|
deleteNotificationChannel(bearerToken: string, channelId?: string, options?: any): Promise<any>;
|
|
1183
|
-
/** notification selected */
|
|
1184
|
-
getNotificationClanSetting(bearerToken: string, clanId?: string, options?: any): Promise<ApiNotificationSetting>;
|
|
1185
1182
|
/** notification category, channel selected */
|
|
1186
1183
|
getChannelCategoryNotiSettingsList(bearerToken: string, clanId?: string, options?: any): Promise<ApiNotificationChannelCategoySettingsList>;
|
|
1187
1184
|
/** */
|
|
1188
1185
|
deleteNotiReactMessage(bearerToken: string, channelId?: string, options?: any): Promise<any>;
|
|
1189
1186
|
/** */
|
|
1190
|
-
getNotificationReactMessage(bearerToken: string, channelId?: string, options?: any): Promise<ApiNotifiReactMessage>;
|
|
1191
|
-
/** */
|
|
1192
1187
|
setNotificationReactMessage(bearerToken: string, body: ApiNotificationChannel, options?: any): Promise<any>;
|
|
1193
1188
|
/** List permission role channel */
|
|
1194
1189
|
getListPermissionRoleChannel(bearerToken: string, roleId?: string, channelId?: string, options?: any): Promise<ApiPermissionRoleChannelList>;
|
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, ApiRoleList, 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, ApiNotificationChannelCategoySettingsList,
|
|
16
|
+
import { ApiAccount, ApiAccountCustom, ApiAccountDevice, ApiAccountEmail, ApiAccountFacebook, ApiAccountFacebookInstantGame, ApiAccountGoogle, ApiAccountGameCenter, ApiAccountSteam, ApiChannelDescList, ApiChannelDescription, ApiCreateChannelDescRequest, ApiDeleteRoleRequest, ApiClanDescList, ApiCreateClanDescRequest, ApiClanDesc, ApiCategoryDesc, ApiCategoryDescList, ApiRoleList, 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, ApiNotificationChannelCategoySettingsList, ApiSetDefaultNotificationRequest, ApiSetNotificationRequest, ApiSetMuteNotificationRequest, ApiSearchMessageRequest, ApiSearchMessageResponse, ApiPinMessageRequest, ApiPinMessagesList, ApiDeleteChannelDescRequest, ApiChangeChannelPrivateRequest, ApiClanEmojiCreateRequest, MezonUpdateClanEmojiByIdBody, ApiWebhookCreateRequest, ApiWebhookListResponse, MezonUpdateWebhookByIdBody, ApiWebhookGenerateResponse, ApiCheckDuplicateClanNameResponse, ApiClanStickerAddRequest, MezonUpdateClanStickerByIdBody, MezonChangeChannelCategoryBody, ApiPermissionRoleChannelList, ApiUpdateRoleChannelRequest, ApiAddAppRequest, ApiAppList, ApiApp } from "./api.gen";
|
|
17
17
|
import { Session } from "./session";
|
|
18
18
|
import { Socket } from "./socket";
|
|
19
19
|
import { WebSocketAdapter } from "./web_socket_adapter";
|
|
@@ -43,54 +43,6 @@ export interface RpcResponse {
|
|
|
43
43
|
/** The payload of the function which must be a JSON object. */
|
|
44
44
|
payload?: object;
|
|
45
45
|
}
|
|
46
|
-
/** The object to store. */
|
|
47
|
-
export interface WriteStorageObject {
|
|
48
|
-
/** The collection to store the object. */
|
|
49
|
-
collection?: string;
|
|
50
|
-
/** The key for the object within the collection. */
|
|
51
|
-
key?: string;
|
|
52
|
-
/** The read access permissions for the object. */
|
|
53
|
-
permission_read?: number;
|
|
54
|
-
/** The write access permissions for the object. */
|
|
55
|
-
permission_write?: number;
|
|
56
|
-
/** The value of the object. */
|
|
57
|
-
value?: object;
|
|
58
|
-
/** The version hash of the object to check. Possible values are: ["", "*", "#hash#"]. */
|
|
59
|
-
version?: string;
|
|
60
|
-
}
|
|
61
|
-
/** An object within the storage engine. */
|
|
62
|
-
export interface StorageObject {
|
|
63
|
-
/** The collection which stores the object. */
|
|
64
|
-
collection?: string;
|
|
65
|
-
/** The UNIX time when the object was created. */
|
|
66
|
-
create_time?: string;
|
|
67
|
-
/** The key of the object within the collection. */
|
|
68
|
-
key?: string;
|
|
69
|
-
/** The read access permissions for the object. */
|
|
70
|
-
permission_read?: number;
|
|
71
|
-
/** The write access permissions for the object. */
|
|
72
|
-
permission_write?: number;
|
|
73
|
-
/** The UNIX time when the object was last updated. */
|
|
74
|
-
update_time?: string;
|
|
75
|
-
/** The user owner of the object. */
|
|
76
|
-
user_id?: string;
|
|
77
|
-
/** The value of the object. */
|
|
78
|
-
value?: object;
|
|
79
|
-
/** The version hash of the object. */
|
|
80
|
-
version?: string;
|
|
81
|
-
}
|
|
82
|
-
/** List of storage objects. */
|
|
83
|
-
export interface StorageObjectList {
|
|
84
|
-
/** The cursor associated with the query a page of results. */
|
|
85
|
-
cursor?: string;
|
|
86
|
-
/** The list of storage objects. */
|
|
87
|
-
objects: Array<StorageObject>;
|
|
88
|
-
}
|
|
89
|
-
/** Batch of storage objects. */
|
|
90
|
-
export interface StorageObjects {
|
|
91
|
-
/** The batch of storage objects. */
|
|
92
|
-
objects: Array<StorageObject>;
|
|
93
|
-
}
|
|
94
46
|
/** A message sent on a channel. */
|
|
95
47
|
export interface ChannelMessage {
|
|
96
48
|
id: string;
|
|
@@ -549,27 +501,19 @@ export declare class Client {
|
|
|
549
501
|
inviteUser(session: Session, inviteId: string): Promise<ApiInviteUserRes>;
|
|
550
502
|
/** Set default notification clan*/
|
|
551
503
|
setNotificationClan(session: Session, request: ApiSetDefaultNotificationRequest): Promise<boolean>;
|
|
552
|
-
/** get default notification clan */
|
|
553
|
-
getNotificationClanSetting(session: Session, clanId: string): Promise<ApiNotificationSetting>;
|
|
554
504
|
/** Set notification channel*/
|
|
555
505
|
setNotificationChannel(session: Session, request: ApiSetNotificationRequest): Promise<boolean>;
|
|
556
506
|
/** Set notification channel*/
|
|
557
507
|
setMuteNotificationChannel(session: Session, request: ApiSetMuteNotificationRequest): Promise<boolean>;
|
|
558
508
|
/** update channel private*/
|
|
559
509
|
updateChannelPrivate(session: Session, request: ApiChangeChannelPrivateRequest): Promise<boolean>;
|
|
560
|
-
/** get default notification clan */
|
|
561
|
-
getNotificationChannel(session: Session, channelId: string): Promise<ApiNotificationUserChannel>;
|
|
562
510
|
/** Set default notification category*/
|
|
563
511
|
setNotificationCategory(session: Session, request: ApiSetDefaultNotificationRequest): Promise<boolean>;
|
|
564
|
-
/** get default notification category */
|
|
565
|
-
getNotificationCategory(session: Session, category_id: string): Promise<ApiNotificationSetting>;
|
|
566
512
|
deleteNotificationCategory(session: Session, category_id: string): Promise<boolean>;
|
|
567
513
|
getChannelCategoryNotiSettingsList(session: Session, clan_id: string): Promise<ApiNotificationChannelCategoySettingsList>;
|
|
568
514
|
deleteNotificationChannel(session: Session, channel_id: string): Promise<boolean>;
|
|
569
515
|
/** */
|
|
570
516
|
setNotificationReactMessage(session: Session, channel_id: string): Promise<boolean>;
|
|
571
|
-
/** */
|
|
572
|
-
getNotificationReactMessage(session: Session, channelId: string): Promise<ApiNotifiReactMessage>;
|
|
573
517
|
deleteNotiReactMessage(session: Session, channel_id: string): Promise<boolean>;
|
|
574
518
|
/** query message in elasticsearch */
|
|
575
519
|
searchMessage(session: Session, request: ApiSearchMessageRequest): Promise<ApiSearchMessageResponse>;
|
|
@@ -595,5 +539,6 @@ export declare class Client {
|
|
|
595
539
|
/** */
|
|
596
540
|
setRoleChannelPermission(session: Session, request: ApiUpdateRoleChannelRequest): Promise<boolean>;
|
|
597
541
|
addApp(session: Session, request: ApiAddAppRequest): Promise<boolean>;
|
|
598
|
-
|
|
542
|
+
getApp(session: Session, id: string): Promise<ApiApp>;
|
|
543
|
+
listApp(session: Session): Promise<ApiAppList>;
|
|
599
544
|
}
|