mezon-js 2.7.55 → 2.7.57
Sign up to get free protection for your applications and to get access to all the features.
- package/api.gen.ts +48 -1
- package/client.ts +15 -2
- package/dist/api.gen.d.ts +13 -1
- package/dist/client.d.ts +4 -2
- package/dist/mezon-js.cjs.js +39 -3
- package/dist/mezon-js.esm.mjs +39 -3
- package/package.json +1 -1
package/api.gen.ts
CHANGED
@@ -364,6 +364,22 @@ export interface ApiClanDescProfile {
|
|
364
364
|
profile_theme?: string;
|
365
365
|
}
|
366
366
|
|
367
|
+
/** */
|
368
|
+
export interface ApiClanEmoji {
|
369
|
+
//
|
370
|
+
category?: string;
|
371
|
+
//
|
372
|
+
shortname?: string;
|
373
|
+
//
|
374
|
+
src?: string;
|
375
|
+
}
|
376
|
+
|
377
|
+
/** */
|
378
|
+
export interface ApiClanEmojiList {
|
379
|
+
//
|
380
|
+
emoji_list?: Array<ApiClanEmoji>;
|
381
|
+
}
|
382
|
+
|
367
383
|
/** Get clan profile. */
|
368
384
|
export interface ApiClanProfile {
|
369
385
|
//
|
@@ -3455,6 +3471,37 @@ export class MezonApi {
|
|
3455
3471
|
]);
|
3456
3472
|
}
|
3457
3473
|
|
3474
|
+
/** Get permission list */
|
3475
|
+
listClanEmoji(bearerToken: string,
|
3476
|
+
options: any = {}): Promise<ApiClanEmojiList> {
|
3477
|
+
|
3478
|
+
const urlPath = "/v2/emoji";
|
3479
|
+
const queryParams = new Map<string, any>();
|
3480
|
+
|
3481
|
+
let bodyJson : string = "";
|
3482
|
+
|
3483
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
3484
|
+
const fetchOptions = buildFetchOptions("GET", options, bodyJson);
|
3485
|
+
if (bearerToken) {
|
3486
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
3487
|
+
}
|
3488
|
+
|
3489
|
+
return Promise.race([
|
3490
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
3491
|
+
if (response.status == 204) {
|
3492
|
+
return response;
|
3493
|
+
} else if (response.status >= 200 && response.status < 300) {
|
3494
|
+
return response.json();
|
3495
|
+
} else {
|
3496
|
+
throw response;
|
3497
|
+
}
|
3498
|
+
}),
|
3499
|
+
new Promise((_, reject) =>
|
3500
|
+
setTimeout(reject, this.timeoutMs, "Request timed out.")
|
3501
|
+
),
|
3502
|
+
]);
|
3503
|
+
}
|
3504
|
+
|
3458
3505
|
/** Search message from elasticsearch service. */
|
3459
3506
|
searchMessage(bearerToken: string,
|
3460
3507
|
body:ApiSearchMessageRequest,
|
@@ -4615,7 +4662,7 @@ export class MezonApi {
|
|
4615
4662
|
}
|
4616
4663
|
|
4617
4664
|
/** */
|
4618
|
-
|
4665
|
+
getPermissionOfUserInTheClan(bearerToken: string,
|
4619
4666
|
clanId:string,
|
4620
4667
|
options: any = {}): Promise<ApiPermissionList> {
|
4621
4668
|
|
package/client.ts
CHANGED
@@ -94,6 +94,7 @@ import {
|
|
94
94
|
ApiWebhookResponse,
|
95
95
|
ApiDeleteChannelDescRequest,
|
96
96
|
ApiChangeChannelPrivateRequest,
|
97
|
+
ApiClanEmojiList
|
97
98
|
} from "./api.gen";
|
98
99
|
|
99
100
|
import { Session } from "./session";
|
@@ -1962,13 +1963,13 @@ export class Client {
|
|
1962
1963
|
}
|
1963
1964
|
|
1964
1965
|
/** Get permission of user in the clan */
|
1965
|
-
async
|
1966
|
+
async getPermissionOfUserInTheClan(session: Session, clanId:string): Promise<ApiPermissionList> {
|
1966
1967
|
if (this.autoRefreshSession && session.refresh_token &&
|
1967
1968
|
session.isexpired((Date.now() + this.expiredTimespanMs)/1000)) {
|
1968
1969
|
await this.sessionRefresh(session);
|
1969
1970
|
}
|
1970
1971
|
|
1971
|
-
return this.apiClient.
|
1972
|
+
return this.apiClient.getPermissionOfUserInTheClan(session.token, clanId).then((response: ApiPermissionList) => {
|
1972
1973
|
return Promise.resolve(response);
|
1973
1974
|
|
1974
1975
|
});
|
@@ -2219,6 +2220,18 @@ async deletePinMessage(session: Session, message_id: string): Promise<boolean> {
|
|
2219
2220
|
});
|
2220
2221
|
}
|
2221
2222
|
|
2223
|
+
/** List clan emoji. */
|
2224
|
+
async listClanEmoji(session: Session): Promise<ApiClanEmojiList> {
|
2225
|
+
if (this.autoRefreshSession && session.refresh_token &&
|
2226
|
+
session.isexpired((Date.now() + this.expiredTimespanMs)/1000)) {
|
2227
|
+
await this.sessionRefresh(session);
|
2228
|
+
}
|
2229
|
+
|
2230
|
+
return this.apiClient.listClanEmoji(session.token).then((response: ApiClanEmojiList) => {
|
2231
|
+
return Promise.resolve(response);
|
2232
|
+
});
|
2233
|
+
}
|
2234
|
+
|
2222
2235
|
};
|
2223
2236
|
|
2224
2237
|
|
package/dist/api.gen.d.ts
CHANGED
@@ -207,6 +207,16 @@ export interface ApiClanDescProfile {
|
|
207
207
|
profile_banner?: string;
|
208
208
|
profile_theme?: string;
|
209
209
|
}
|
210
|
+
/** */
|
211
|
+
export interface ApiClanEmoji {
|
212
|
+
category?: string;
|
213
|
+
shortname?: string;
|
214
|
+
src?: string;
|
215
|
+
}
|
216
|
+
/** */
|
217
|
+
export interface ApiClanEmojiList {
|
218
|
+
emoji_list?: Array<ApiClanEmoji>;
|
219
|
+
}
|
210
220
|
/** Get clan profile. */
|
211
221
|
export interface ApiClanProfile {
|
212
222
|
avartar?: string;
|
@@ -868,6 +878,8 @@ export declare class MezonApi {
|
|
868
878
|
closeDirectMess(bearerToken: string, body: ApiDeleteChannelDescRequest, options?: any): Promise<any>;
|
869
879
|
/** open direct message. */
|
870
880
|
openDirectMess(bearerToken: string, body: ApiDeleteChannelDescRequest, options?: any): Promise<any>;
|
881
|
+
/** Get permission list */
|
882
|
+
listClanEmoji(bearerToken: string, options?: any): Promise<ApiClanEmojiList>;
|
871
883
|
/** Search message from elasticsearch service. */
|
872
884
|
searchMessage(bearerToken: string, body: ApiSearchMessageRequest, options?: any): Promise<ApiSearchMessageResponse>;
|
873
885
|
/** Submit an event for processing in the server's registered runtime custom events handler. */
|
@@ -935,7 +947,7 @@ export declare class MezonApi {
|
|
935
947
|
/** Get permission list */
|
936
948
|
getListPermission(bearerToken: string, options?: any): Promise<ApiPermissionList>;
|
937
949
|
/** */
|
938
|
-
|
950
|
+
getPermissionOfUserInTheClan(bearerToken: string, clanId: string, options?: any): Promise<ApiPermissionList>;
|
939
951
|
/** */
|
940
952
|
deletePinMessage(bearerToken: string, messageId?: string, options?: any): Promise<any>;
|
941
953
|
/** */
|
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, ApiDeleteStorageObjectsRequest, ApiEvent, ApiReadStorageObjectsRequest, ApiStorageObjectAcks, 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, ApiNotificationSetting, ApiSetDefaultNotificationRequest, ApiNotificationUserChannel, ApiSetNotificationRequest, ApiNotifiReactMessage, ApiSetMuteNotificationRequest, ApiSearchMessageRequest, ApiSearchMessageResponse, ApiPinMessageRequest, ApiPinMessagesList, ApiCreateWebhookRequest, ApiWebhookResponse, ApiDeleteChannelDescRequest, ApiChangeChannelPrivateRequest } from "./api.gen";
|
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, ApiDeleteStorageObjectsRequest, ApiEvent, ApiReadStorageObjectsRequest, ApiStorageObjectAcks, 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, ApiNotificationSetting, ApiSetDefaultNotificationRequest, ApiNotificationUserChannel, ApiSetNotificationRequest, ApiNotifiReactMessage, ApiSetMuteNotificationRequest, ApiSearchMessageRequest, ApiSearchMessageResponse, ApiPinMessageRequest, ApiPinMessagesList, ApiCreateWebhookRequest, ApiWebhookResponse, ApiDeleteChannelDescRequest, ApiChangeChannelPrivateRequest, ApiClanEmojiList } from "./api.gen";
|
17
17
|
import { Session } from "./session";
|
18
18
|
import { Socket } from "./socket";
|
19
19
|
import { WebSocketAdapter } from "./web_socket_adapter";
|
@@ -542,7 +542,7 @@ export declare class Client {
|
|
542
542
|
/** Get link invite user */
|
543
543
|
getLinkInvite(session: Session, inviteId: string): Promise<ApiInviteUserRes>;
|
544
544
|
/** Get permission of user in the clan */
|
545
|
-
|
545
|
+
getPermissionOfUserInTheClan(session: Session, clanId: string): Promise<ApiPermissionList>;
|
546
546
|
/** invite user */
|
547
547
|
inviteUser(session: Session, inviteId: string): Promise<ApiInviteUserRes>;
|
548
548
|
/** Write storage objects. */
|
@@ -577,4 +577,6 @@ export declare class Client {
|
|
577
577
|
createPinMessage(session: Session, request: ApiPinMessageRequest): Promise<boolean>;
|
578
578
|
getPinMessagesList(session: Session, channelId: string): Promise<ApiPinMessagesList>;
|
579
579
|
deletePinMessage(session: Session, message_id: string): Promise<boolean>;
|
580
|
+
/** List clan emoji. */
|
581
|
+
listClanEmoji(session: Session): Promise<ApiClanEmojiList>;
|
580
582
|
}
|
package/dist/mezon-js.cjs.js
CHANGED
@@ -2332,6 +2332,31 @@ var MezonApi = class {
|
|
2332
2332
|
)
|
2333
2333
|
]);
|
2334
2334
|
}
|
2335
|
+
/** Get permission list */
|
2336
|
+
listClanEmoji(bearerToken, options = {}) {
|
2337
|
+
const urlPath = "/v2/emoji";
|
2338
|
+
const queryParams = /* @__PURE__ */ new Map();
|
2339
|
+
let bodyJson = "";
|
2340
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
2341
|
+
const fetchOptions = buildFetchOptions("GET", options, bodyJson);
|
2342
|
+
if (bearerToken) {
|
2343
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
2344
|
+
}
|
2345
|
+
return Promise.race([
|
2346
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
2347
|
+
if (response.status == 204) {
|
2348
|
+
return response;
|
2349
|
+
} else if (response.status >= 200 && response.status < 300) {
|
2350
|
+
return response.json();
|
2351
|
+
} else {
|
2352
|
+
throw response;
|
2353
|
+
}
|
2354
|
+
}),
|
2355
|
+
new Promise(
|
2356
|
+
(_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
|
2357
|
+
)
|
2358
|
+
]);
|
2359
|
+
}
|
2335
2360
|
/** Search message from elasticsearch service. */
|
2336
2361
|
searchMessage(bearerToken, body, options = {}) {
|
2337
2362
|
if (body === null || body === void 0) {
|
@@ -3248,7 +3273,7 @@ var MezonApi = class {
|
|
3248
3273
|
]);
|
3249
3274
|
}
|
3250
3275
|
/** */
|
3251
|
-
|
3276
|
+
getPermissionOfUserInTheClan(bearerToken, clanId, options = {}) {
|
3252
3277
|
if (clanId === null || clanId === void 0) {
|
3253
3278
|
throw new Error("'clanId' is a required parameter but is null or undefined.");
|
3254
3279
|
}
|
@@ -6005,12 +6030,12 @@ var Client = class {
|
|
6005
6030
|
});
|
6006
6031
|
}
|
6007
6032
|
/** Get permission of user in the clan */
|
6008
|
-
|
6033
|
+
getPermissionOfUserInTheClan(session, clanId) {
|
6009
6034
|
return __async(this, null, function* () {
|
6010
6035
|
if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
|
6011
6036
|
yield this.sessionRefresh(session);
|
6012
6037
|
}
|
6013
|
-
return this.apiClient.
|
6038
|
+
return this.apiClient.getPermissionOfUserInTheClan(session.token, clanId).then((response) => {
|
6014
6039
|
return Promise.resolve(response);
|
6015
6040
|
});
|
6016
6041
|
});
|
@@ -6240,4 +6265,15 @@ var Client = class {
|
|
6240
6265
|
});
|
6241
6266
|
});
|
6242
6267
|
}
|
6268
|
+
/** List clan emoji. */
|
6269
|
+
listClanEmoji(session) {
|
6270
|
+
return __async(this, null, function* () {
|
6271
|
+
if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
|
6272
|
+
yield this.sessionRefresh(session);
|
6273
|
+
}
|
6274
|
+
return this.apiClient.listClanEmoji(session.token).then((response) => {
|
6275
|
+
return Promise.resolve(response);
|
6276
|
+
});
|
6277
|
+
});
|
6278
|
+
}
|
6243
6279
|
};
|
package/dist/mezon-js.esm.mjs
CHANGED
@@ -2303,6 +2303,31 @@ var MezonApi = class {
|
|
2303
2303
|
)
|
2304
2304
|
]);
|
2305
2305
|
}
|
2306
|
+
/** Get permission list */
|
2307
|
+
listClanEmoji(bearerToken, options = {}) {
|
2308
|
+
const urlPath = "/v2/emoji";
|
2309
|
+
const queryParams = /* @__PURE__ */ new Map();
|
2310
|
+
let bodyJson = "";
|
2311
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
2312
|
+
const fetchOptions = buildFetchOptions("GET", options, bodyJson);
|
2313
|
+
if (bearerToken) {
|
2314
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
2315
|
+
}
|
2316
|
+
return Promise.race([
|
2317
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
2318
|
+
if (response.status == 204) {
|
2319
|
+
return response;
|
2320
|
+
} else if (response.status >= 200 && response.status < 300) {
|
2321
|
+
return response.json();
|
2322
|
+
} else {
|
2323
|
+
throw response;
|
2324
|
+
}
|
2325
|
+
}),
|
2326
|
+
new Promise(
|
2327
|
+
(_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
|
2328
|
+
)
|
2329
|
+
]);
|
2330
|
+
}
|
2306
2331
|
/** Search message from elasticsearch service. */
|
2307
2332
|
searchMessage(bearerToken, body, options = {}) {
|
2308
2333
|
if (body === null || body === void 0) {
|
@@ -3219,7 +3244,7 @@ var MezonApi = class {
|
|
3219
3244
|
]);
|
3220
3245
|
}
|
3221
3246
|
/** */
|
3222
|
-
|
3247
|
+
getPermissionOfUserInTheClan(bearerToken, clanId, options = {}) {
|
3223
3248
|
if (clanId === null || clanId === void 0) {
|
3224
3249
|
throw new Error("'clanId' is a required parameter but is null or undefined.");
|
3225
3250
|
}
|
@@ -5976,12 +6001,12 @@ var Client = class {
|
|
5976
6001
|
});
|
5977
6002
|
}
|
5978
6003
|
/** Get permission of user in the clan */
|
5979
|
-
|
6004
|
+
getPermissionOfUserInTheClan(session, clanId) {
|
5980
6005
|
return __async(this, null, function* () {
|
5981
6006
|
if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
|
5982
6007
|
yield this.sessionRefresh(session);
|
5983
6008
|
}
|
5984
|
-
return this.apiClient.
|
6009
|
+
return this.apiClient.getPermissionOfUserInTheClan(session.token, clanId).then((response) => {
|
5985
6010
|
return Promise.resolve(response);
|
5986
6011
|
});
|
5987
6012
|
});
|
@@ -6211,6 +6236,17 @@ var Client = class {
|
|
6211
6236
|
});
|
6212
6237
|
});
|
6213
6238
|
}
|
6239
|
+
/** List clan emoji. */
|
6240
|
+
listClanEmoji(session) {
|
6241
|
+
return __async(this, null, function* () {
|
6242
|
+
if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
|
6243
|
+
yield this.sessionRefresh(session);
|
6244
|
+
}
|
6245
|
+
return this.apiClient.listClanEmoji(session.token).then((response) => {
|
6246
|
+
return Promise.resolve(response);
|
6247
|
+
});
|
6248
|
+
});
|
6249
|
+
}
|
6214
6250
|
};
|
6215
6251
|
export {
|
6216
6252
|
ChannelStreamMode,
|