mezon-js 2.9.13 → 2.9.15
Sign up to get free protection for your applications and to get access to all the features.
- package/api.gen.ts +369 -0
- package/client.ts +195 -6
- package/dist/api.gen.d.ts +58 -0
- package/dist/client.d.ts +12 -3
- package/dist/mezon-js.cjs.js +341 -4
- package/dist/mezon-js.esm.mjs +341 -4
- package/dist/socket.d.ts +16 -4
- package/package.json +1 -1
- package/socket.ts +25 -5
package/dist/mezon-js.esm.mjs
CHANGED
@@ -3228,6 +3228,32 @@ var MezonApi = class {
|
|
3228
3228
|
)
|
3229
3229
|
]);
|
3230
3230
|
}
|
3231
|
+
/** List GetChannelCategoryNotiSettingsList */
|
3232
|
+
getChannelCategoryNotiSettingsList(bearerToken, clanId, options = {}) {
|
3233
|
+
const urlPath = "/v2/getChannelCategoryNotiSettingsList";
|
3234
|
+
const queryParams = /* @__PURE__ */ new Map();
|
3235
|
+
queryParams.set("clan_id", clanId);
|
3236
|
+
let bodyJson = "";
|
3237
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
3238
|
+
const fetchOptions = buildFetchOptions("GET", options, bodyJson);
|
3239
|
+
if (bearerToken) {
|
3240
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
3241
|
+
}
|
3242
|
+
return Promise.race([
|
3243
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
3244
|
+
if (response.status == 204) {
|
3245
|
+
return response;
|
3246
|
+
} else if (response.status >= 200 && response.status < 300) {
|
3247
|
+
return response.json();
|
3248
|
+
} else {
|
3249
|
+
throw response;
|
3250
|
+
}
|
3251
|
+
}),
|
3252
|
+
new Promise(
|
3253
|
+
(_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
|
3254
|
+
)
|
3255
|
+
]);
|
3256
|
+
}
|
3231
3257
|
/** */
|
3232
3258
|
getUserProfileOnClan(bearerToken, clanId, options = {}) {
|
3233
3259
|
if (clanId === null || clanId === void 0) {
|
@@ -3256,6 +3282,110 @@ var MezonApi = class {
|
|
3256
3282
|
)
|
3257
3283
|
]);
|
3258
3284
|
}
|
3285
|
+
/** List GetNotificationChannel */
|
3286
|
+
getNotificationCategory(bearerToken, categoryId, options = {}) {
|
3287
|
+
const urlPath = "/v2/getnotificationcategory";
|
3288
|
+
const queryParams = /* @__PURE__ */ new Map();
|
3289
|
+
queryParams.set("category_id", categoryId);
|
3290
|
+
let bodyJson = "";
|
3291
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
3292
|
+
const fetchOptions = buildFetchOptions("GET", options, bodyJson);
|
3293
|
+
if (bearerToken) {
|
3294
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
3295
|
+
}
|
3296
|
+
return Promise.race([
|
3297
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
3298
|
+
if (response.status == 204) {
|
3299
|
+
return response;
|
3300
|
+
} else if (response.status >= 200 && response.status < 300) {
|
3301
|
+
return response.json();
|
3302
|
+
} else {
|
3303
|
+
throw response;
|
3304
|
+
}
|
3305
|
+
}),
|
3306
|
+
new Promise(
|
3307
|
+
(_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
|
3308
|
+
)
|
3309
|
+
]);
|
3310
|
+
}
|
3311
|
+
/** List GetNotificationChannel */
|
3312
|
+
getNotificationChannel(bearerToken, channelId, options = {}) {
|
3313
|
+
const urlPath = "/v2/getnotificationchannel";
|
3314
|
+
const queryParams = /* @__PURE__ */ new Map();
|
3315
|
+
queryParams.set("channel_id", channelId);
|
3316
|
+
let bodyJson = "";
|
3317
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
3318
|
+
const fetchOptions = buildFetchOptions("GET", options, bodyJson);
|
3319
|
+
if (bearerToken) {
|
3320
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
3321
|
+
}
|
3322
|
+
return Promise.race([
|
3323
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
3324
|
+
if (response.status == 204) {
|
3325
|
+
return response;
|
3326
|
+
} else if (response.status >= 200 && response.status < 300) {
|
3327
|
+
return response.json();
|
3328
|
+
} else {
|
3329
|
+
throw response;
|
3330
|
+
}
|
3331
|
+
}),
|
3332
|
+
new Promise(
|
3333
|
+
(_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
|
3334
|
+
)
|
3335
|
+
]);
|
3336
|
+
}
|
3337
|
+
/** List GetNotificationClan */
|
3338
|
+
getNotificationClan(bearerToken, clanId, options = {}) {
|
3339
|
+
const urlPath = "/v2/getnotificationclan";
|
3340
|
+
const queryParams = /* @__PURE__ */ new Map();
|
3341
|
+
queryParams.set("clan_id", clanId);
|
3342
|
+
let bodyJson = "";
|
3343
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
3344
|
+
const fetchOptions = buildFetchOptions("GET", options, bodyJson);
|
3345
|
+
if (bearerToken) {
|
3346
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
3347
|
+
}
|
3348
|
+
return Promise.race([
|
3349
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
3350
|
+
if (response.status == 204) {
|
3351
|
+
return response;
|
3352
|
+
} else if (response.status >= 200 && response.status < 300) {
|
3353
|
+
return response.json();
|
3354
|
+
} else {
|
3355
|
+
throw response;
|
3356
|
+
}
|
3357
|
+
}),
|
3358
|
+
new Promise(
|
3359
|
+
(_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
|
3360
|
+
)
|
3361
|
+
]);
|
3362
|
+
}
|
3363
|
+
/** List GetNotificationReactMessage */
|
3364
|
+
getNotificationReactMessage(bearerToken, channelId, options = {}) {
|
3365
|
+
const urlPath = "/v2/getnotificationreactmessage";
|
3366
|
+
const queryParams = /* @__PURE__ */ new Map();
|
3367
|
+
queryParams.set("channel_id", channelId);
|
3368
|
+
let bodyJson = "";
|
3369
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
3370
|
+
const fetchOptions = buildFetchOptions("GET", options, bodyJson);
|
3371
|
+
if (bearerToken) {
|
3372
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
3373
|
+
}
|
3374
|
+
return Promise.race([
|
3375
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
3376
|
+
if (response.status == 204) {
|
3377
|
+
return response;
|
3378
|
+
} else if (response.status >= 200 && response.status < 300) {
|
3379
|
+
return response.json();
|
3380
|
+
} else {
|
3381
|
+
throw response;
|
3382
|
+
}
|
3383
|
+
}),
|
3384
|
+
new Promise(
|
3385
|
+
(_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
|
3386
|
+
)
|
3387
|
+
]);
|
3388
|
+
}
|
3259
3389
|
/** Give a coffee */
|
3260
3390
|
giveMeACoffee(bearerToken, body, options = {}) {
|
3261
3391
|
if (body === null || body === void 0) {
|
@@ -3285,6 +3415,33 @@ var MezonApi = class {
|
|
3285
3415
|
)
|
3286
3416
|
]);
|
3287
3417
|
}
|
3418
|
+
/** List HashtagDMList */
|
3419
|
+
hashtagDMList(bearerToken, userId, limit, options = {}) {
|
3420
|
+
const urlPath = "/v2/hashtagdmlist";
|
3421
|
+
const queryParams = /* @__PURE__ */ new Map();
|
3422
|
+
queryParams.set("user_id", userId);
|
3423
|
+
queryParams.set("limit", limit);
|
3424
|
+
let bodyJson = "";
|
3425
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
3426
|
+
const fetchOptions = buildFetchOptions("GET", options, bodyJson);
|
3427
|
+
if (bearerToken) {
|
3428
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
3429
|
+
}
|
3430
|
+
return Promise.race([
|
3431
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
3432
|
+
if (response.status == 204) {
|
3433
|
+
return response;
|
3434
|
+
} else if (response.status >= 200 && response.status < 300) {
|
3435
|
+
return response.json();
|
3436
|
+
} else {
|
3437
|
+
throw response;
|
3438
|
+
}
|
3439
|
+
}),
|
3440
|
+
new Promise(
|
3441
|
+
(_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
|
3442
|
+
)
|
3443
|
+
]);
|
3444
|
+
}
|
3288
3445
|
/** Add users to a channel. */
|
3289
3446
|
createLinkInviteUser(bearerToken, body, options = {}) {
|
3290
3447
|
if (body === null || body === void 0) {
|
@@ -3370,6 +3527,31 @@ var MezonApi = class {
|
|
3370
3527
|
)
|
3371
3528
|
]);
|
3372
3529
|
}
|
3530
|
+
/** List HashtagDMList */
|
3531
|
+
listChannelByUserId(bearerToken, options = {}) {
|
3532
|
+
const urlPath = "/v2/listchannelbyuserid";
|
3533
|
+
const queryParams = /* @__PURE__ */ new Map();
|
3534
|
+
let bodyJson = "";
|
3535
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
3536
|
+
const fetchOptions = buildFetchOptions("GET", options, bodyJson);
|
3537
|
+
if (bearerToken) {
|
3538
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
3539
|
+
}
|
3540
|
+
return Promise.race([
|
3541
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
3542
|
+
if (response.status == 204) {
|
3543
|
+
return response;
|
3544
|
+
} else if (response.status >= 200 && response.status < 300) {
|
3545
|
+
return response.json();
|
3546
|
+
} else {
|
3547
|
+
throw response;
|
3548
|
+
}
|
3549
|
+
}),
|
3550
|
+
new Promise(
|
3551
|
+
(_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
|
3552
|
+
)
|
3553
|
+
]);
|
3554
|
+
}
|
3373
3555
|
/** set mute notification user channel. */
|
3374
3556
|
setMuteNotificationCategory(bearerToken, body, options = {}) {
|
3375
3557
|
if (body === null || body === void 0) {
|
@@ -3930,6 +4112,35 @@ var MezonApi = class {
|
|
3930
4112
|
)
|
3931
4113
|
]);
|
3932
4114
|
}
|
4115
|
+
/** ListRoles */
|
4116
|
+
listRoles(bearerToken, clanId, limit, state, cursor, options = {}) {
|
4117
|
+
const urlPath = "/v2/roles";
|
4118
|
+
const queryParams = /* @__PURE__ */ new Map();
|
4119
|
+
queryParams.set("clan_id", clanId);
|
4120
|
+
queryParams.set("limit", limit);
|
4121
|
+
queryParams.set("state", state);
|
4122
|
+
queryParams.set("cursor", cursor);
|
4123
|
+
let bodyJson = "";
|
4124
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
4125
|
+
const fetchOptions = buildFetchOptions("GET", options, bodyJson);
|
4126
|
+
if (bearerToken) {
|
4127
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
4128
|
+
}
|
4129
|
+
return Promise.race([
|
4130
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
4131
|
+
if (response.status == 204) {
|
4132
|
+
return response;
|
4133
|
+
} else if (response.status >= 200 && response.status < 300) {
|
4134
|
+
return response.json();
|
4135
|
+
} else {
|
4136
|
+
throw response;
|
4137
|
+
}
|
4138
|
+
}),
|
4139
|
+
new Promise(
|
4140
|
+
(_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
|
4141
|
+
)
|
4142
|
+
]);
|
4143
|
+
}
|
3933
4144
|
/** Create a new role for clan. */
|
3934
4145
|
createRole(bearerToken, body, options = {}) {
|
3935
4146
|
if (body === null || body === void 0) {
|
@@ -4760,6 +4971,31 @@ var MezonApi = class {
|
|
4760
4971
|
)
|
4761
4972
|
]);
|
4762
4973
|
}
|
4974
|
+
/** ListUserClansByUserId */
|
4975
|
+
listUserClansByUserId(bearerToken, options = {}) {
|
4976
|
+
const urlPath = "/v2/users/clans";
|
4977
|
+
const queryParams = /* @__PURE__ */ new Map();
|
4978
|
+
let bodyJson = "";
|
4979
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
4980
|
+
const fetchOptions = buildFetchOptions("GET", options, bodyJson);
|
4981
|
+
if (bearerToken) {
|
4982
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
4983
|
+
}
|
4984
|
+
return Promise.race([
|
4985
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
4986
|
+
if (response.status == 204) {
|
4987
|
+
return response;
|
4988
|
+
} else if (response.status >= 200 && response.status < 300) {
|
4989
|
+
return response.json();
|
4990
|
+
} else {
|
4991
|
+
throw response;
|
4992
|
+
}
|
4993
|
+
}),
|
4994
|
+
new Promise(
|
4995
|
+
(_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
|
4996
|
+
)
|
4997
|
+
]);
|
4998
|
+
}
|
4763
4999
|
/** create webhook */
|
4764
5000
|
generateWebhook(bearerToken, body, options = {}) {
|
4765
5001
|
if (body === null || body === void 0) {
|
@@ -5211,6 +5447,8 @@ var _DefaultSocket = class _DefaultSocket {
|
|
5211
5447
|
this.onstreamingchanneljoined(message.streaming_joined_event);
|
5212
5448
|
} else if (message.streaming_leaved_event) {
|
5213
5449
|
this.onstreamingchannelleaved(message.streaming_leaved_event);
|
5450
|
+
} else if (message.set_permission_channel_event) {
|
5451
|
+
this.onsetpermissionchannel(message.set_permission_channel_event);
|
5214
5452
|
} else {
|
5215
5453
|
if (this.verbose && window && window.console) {
|
5216
5454
|
console.log("Unrecognized message received: %o", message);
|
@@ -5463,6 +5701,11 @@ var _DefaultSocket = class _DefaultSocket {
|
|
5463
5701
|
console.log(streaming_leaved_event);
|
5464
5702
|
}
|
5465
5703
|
}
|
5704
|
+
onsetpermissionchannel(set_permission_channel_event) {
|
5705
|
+
if (this.verbose && window && window.console) {
|
5706
|
+
console.log(set_permission_channel_event);
|
5707
|
+
}
|
5708
|
+
}
|
5466
5709
|
send(message, sendTimeout = _DefaultSocket.DefaultSendTimeoutMs) {
|
5467
5710
|
const untypedMessage = message;
|
5468
5711
|
return new Promise((resolve, reject) => {
|
@@ -7636,22 +7879,72 @@ var Client = class {
|
|
7636
7879
|
});
|
7637
7880
|
});
|
7638
7881
|
}
|
7639
|
-
|
7882
|
+
getChannelCategoryNotiSettingsList(session, clanId) {
|
7640
7883
|
return __async(this, null, function* () {
|
7641
7884
|
if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
|
7642
7885
|
yield this.sessionRefresh(session);
|
7643
7886
|
}
|
7644
|
-
return this.apiClient.
|
7887
|
+
return this.apiClient.getChannelCategoryNotiSettingsList(session.token, clanId).then((response) => {
|
7645
7888
|
return Promise.resolve(response);
|
7646
7889
|
});
|
7647
7890
|
});
|
7648
7891
|
}
|
7649
|
-
|
7892
|
+
getNotificationCategory(session, categoryId) {
|
7650
7893
|
return __async(this, null, function* () {
|
7651
7894
|
if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
|
7652
7895
|
yield this.sessionRefresh(session);
|
7653
7896
|
}
|
7654
|
-
return this.apiClient.
|
7897
|
+
return this.apiClient.getNotificationCategory(session.token, categoryId).then((response) => {
|
7898
|
+
return Promise.resolve(response);
|
7899
|
+
});
|
7900
|
+
});
|
7901
|
+
}
|
7902
|
+
getNotificationChannel(session, channelId) {
|
7903
|
+
return __async(this, null, function* () {
|
7904
|
+
if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
|
7905
|
+
yield this.sessionRefresh(session);
|
7906
|
+
}
|
7907
|
+
return this.apiClient.getNotificationChannel(session.token, channelId).then((response) => {
|
7908
|
+
return Promise.resolve(response);
|
7909
|
+
});
|
7910
|
+
});
|
7911
|
+
}
|
7912
|
+
getNotificationClan(session, clanId) {
|
7913
|
+
return __async(this, null, function* () {
|
7914
|
+
if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
|
7915
|
+
yield this.sessionRefresh(session);
|
7916
|
+
}
|
7917
|
+
return this.apiClient.getNotificationClan(session.token, clanId).then((response) => {
|
7918
|
+
return Promise.resolve(response);
|
7919
|
+
});
|
7920
|
+
});
|
7921
|
+
}
|
7922
|
+
getNotificationReactMessage(session, channelId) {
|
7923
|
+
return __async(this, null, function* () {
|
7924
|
+
if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
|
7925
|
+
yield this.sessionRefresh(session);
|
7926
|
+
}
|
7927
|
+
return this.apiClient.getNotificationReactMessage(session.token, channelId).then((response) => {
|
7928
|
+
return Promise.resolve(response);
|
7929
|
+
});
|
7930
|
+
});
|
7931
|
+
}
|
7932
|
+
hashtagDMList(session, userId, limit) {
|
7933
|
+
return __async(this, null, function* () {
|
7934
|
+
if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
|
7935
|
+
yield this.sessionRefresh(session);
|
7936
|
+
}
|
7937
|
+
return this.apiClient.hashtagDMList(session.token, userId, limit).then((response) => {
|
7938
|
+
return Promise.resolve(response);
|
7939
|
+
});
|
7940
|
+
});
|
7941
|
+
}
|
7942
|
+
listChannelByUserId(session) {
|
7943
|
+
return __async(this, null, function* () {
|
7944
|
+
if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
|
7945
|
+
yield this.sessionRefresh(session);
|
7946
|
+
}
|
7947
|
+
return this.apiClient.listChannelByUserId(session.token).then((response) => {
|
7655
7948
|
return Promise.resolve(response);
|
7656
7949
|
});
|
7657
7950
|
});
|
@@ -7666,6 +7959,50 @@ var Client = class {
|
|
7666
7959
|
});
|
7667
7960
|
});
|
7668
7961
|
}
|
7962
|
+
getListEmojisByUserId(session) {
|
7963
|
+
return __async(this, null, function* () {
|
7964
|
+
if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
|
7965
|
+
yield this.sessionRefresh(session);
|
7966
|
+
}
|
7967
|
+
return this.apiClient.getListEmojisByUserId(session.token).then((response) => {
|
7968
|
+
return Promise.resolve(response);
|
7969
|
+
});
|
7970
|
+
});
|
7971
|
+
}
|
7972
|
+
getListStickersByUserId(session) {
|
7973
|
+
return __async(this, null, function* () {
|
7974
|
+
if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
|
7975
|
+
yield this.sessionRefresh(session);
|
7976
|
+
}
|
7977
|
+
return this.apiClient.getListStickersByUserId(session.token).then((response) => {
|
7978
|
+
return Promise.resolve(response);
|
7979
|
+
});
|
7980
|
+
});
|
7981
|
+
}
|
7982
|
+
listUserClansByUserId(session) {
|
7983
|
+
return __async(this, null, function* () {
|
7984
|
+
if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
|
7985
|
+
yield this.sessionRefresh(session);
|
7986
|
+
}
|
7987
|
+
return this.apiClient.listUserClansByUserId(session.token).then((response) => {
|
7988
|
+
return Promise.resolve(response);
|
7989
|
+
});
|
7990
|
+
});
|
7991
|
+
}
|
7992
|
+
listRoles(session, clanId, limit, state, cursor) {
|
7993
|
+
return __async(this, null, function* () {
|
7994
|
+
if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
|
7995
|
+
yield this.sessionRefresh(session);
|
7996
|
+
}
|
7997
|
+
return this.apiClient.listRoles(session.token, clanId, limit, state, cursor).then((response) => {
|
7998
|
+
var result = {
|
7999
|
+
clan_id: clanId,
|
8000
|
+
roles: response.roles
|
8001
|
+
};
|
8002
|
+
return Promise.resolve(result);
|
8003
|
+
});
|
8004
|
+
});
|
8005
|
+
}
|
7669
8006
|
};
|
7670
8007
|
export {
|
7671
8008
|
ChannelStreamMode,
|
package/dist/socket.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 { ApiChannelMessageHeader, ApiCreateEventRequest, ApiGiveCoffeeEvent, ApiMessageAttachment, ApiMessageMention, ApiMessageReaction, ApiMessageRef, ApiPermissionList, ApiRole, ApiRoleList, ApiRpc, ApiUser } from "./api.gen";
|
16
|
+
import { ApiChannelDescList, ApiChannelMessageHeader, ApiCreateEventRequest, ApiGiveCoffeeEvent, ApiHashtagDmList, ApiMessageAttachment, ApiMessageMention, ApiMessageReaction, ApiMessageRef, ApiNotificationChannelCategorySettingList, ApiPermissionList, ApiPermissionUpdate, ApiRole, ApiRoleList, ApiRpc, ApiUser } from "./api.gen";
|
17
17
|
import { Session } from "./session";
|
18
18
|
import { ChannelMessage, Notification } from "./client";
|
19
19
|
import { WebSocketAdapter } from "./web_socket_adapter";
|
@@ -497,7 +497,7 @@ export interface ClanEmoji {
|
|
497
497
|
}
|
498
498
|
/** */
|
499
499
|
export interface ChannelDescListEvent {
|
500
|
-
channeldesc?:
|
500
|
+
channeldesc?: ApiChannelDescList;
|
501
501
|
}
|
502
502
|
/** */
|
503
503
|
export interface AllUserClans {
|
@@ -518,7 +518,7 @@ export interface ChannelDescription {
|
|
518
518
|
export interface HashtagDmListEvent {
|
519
519
|
user_id?: Array<string>;
|
520
520
|
limit?: number;
|
521
|
-
hashtag_dm?:
|
521
|
+
hashtag_dm?: ApiHashtagDmList;
|
522
522
|
}
|
523
523
|
export interface HashtagDm {
|
524
524
|
channel_id?: string;
|
@@ -570,7 +570,7 @@ export interface NotificationChannelCategorySetting {
|
|
570
570
|
}
|
571
571
|
export interface NotificationChannelCategorySettingEvent {
|
572
572
|
clan_id?: string;
|
573
|
-
notification_channel_category_settings_list?:
|
573
|
+
notification_channel_category_settings_list?: ApiNotificationChannelCategorySettingList;
|
574
574
|
}
|
575
575
|
export interface UserEmojiUsage {
|
576
576
|
user_id: string;
|
@@ -644,6 +644,16 @@ export interface StreamingEndedEvent {
|
|
644
644
|
/** channel id */
|
645
645
|
channel_id: string;
|
646
646
|
}
|
647
|
+
export interface SetPermissionChannelEvent {
|
648
|
+
/** Role ID */
|
649
|
+
role_id: string;
|
650
|
+
/** User ID */
|
651
|
+
user_id: string;
|
652
|
+
/** Channel ID */
|
653
|
+
channel_id: string;
|
654
|
+
/** List permission update */
|
655
|
+
permission_updates: ApiPermissionUpdate[];
|
656
|
+
}
|
647
657
|
/** A socket connection to Mezon server. */
|
648
658
|
export interface Socket {
|
649
659
|
/** Connection is Open */
|
@@ -765,6 +775,7 @@ export interface Socket {
|
|
765
775
|
onstreamingchannelended: (streaming_ended_event: StreamingEndedEvent) => void;
|
766
776
|
onstreamingchanneljoined: (streaming_joined_event: StreamingJoinedEvent) => void;
|
767
777
|
onstreamingchannelleaved: (streaming_leaved_event: StreamingLeavedEvent) => void;
|
778
|
+
onsetpermissionchannel: (set_permission_channel_event: SetPermissionChannelEvent) => void;
|
768
779
|
}
|
769
780
|
/** Reports an error received from a socket message. */
|
770
781
|
export interface SocketError {
|
@@ -834,6 +845,7 @@ export declare class DefaultSocket implements Socket {
|
|
834
845
|
onstreamingchannelended(streaming_ended_event: StreamingEndedEvent): void;
|
835
846
|
onstreamingchanneljoined(streaming_joined_event: StreamingJoinedEvent): void;
|
836
847
|
onstreamingchannelleaved(streaming_leaved_event: StreamingLeavedEvent): void;
|
848
|
+
onsetpermissionchannel(set_permission_channel_event: SetPermissionChannelEvent): void;
|
837
849
|
send(message: ChannelJoin | ChannelLeave | ChannelMessageSend | ChannelMessageUpdate | CustomStatusEvent | ChannelMessageRemove | MessageTypingEvent | LastSeenMessageEvent | Rpc | StatusFollow | StatusUnfollow | StatusUpdate | Ping, sendTimeout?: number): Promise<any>;
|
838
850
|
followUsers(userIds: string[]): Promise<Status>;
|
839
851
|
joinClanChat(clan_id: string): Promise<ClanJoin>;
|
package/package.json
CHANGED
package/socket.ts
CHANGED
@@ -14,7 +14,7 @@
|
|
14
14
|
* limitations under the License.
|
15
15
|
*/
|
16
16
|
|
17
|
-
import { ApiChannelMessageHeader, ApiCreateEventRequest, ApiGiveCoffeeEvent, ApiMessageAttachment, ApiMessageMention, ApiMessageReaction, ApiMessageRef, ApiNotification, ApiPermissionList, ApiRole, ApiRoleList, ApiRpc, ApiUser} from "./api.gen";
|
17
|
+
import { ApiChannelDescList, ApiChannelMessageHeader, ApiCreateEventRequest, ApiGiveCoffeeEvent, ApiHashtagDmList, ApiMessageAttachment, ApiMessageMention, ApiMessageReaction, ApiMessageRef, ApiNotification, ApiNotificationChannelCategorySettingList, ApiPermissionList, ApiPermissionUpdate, ApiRole, ApiRoleList, ApiRpc, ApiUser} from "./api.gen";
|
18
18
|
import {Session} from "./session";
|
19
19
|
import {ChannelMessage, Notification} from "./client";
|
20
20
|
import {WebSocketAdapter, WebSocketAdapterText} from "./web_socket_adapter"
|
@@ -724,7 +724,7 @@ export interface ClanEmoji {
|
|
724
724
|
/** */
|
725
725
|
export interface ChannelDescListEvent {
|
726
726
|
//
|
727
|
-
channeldesc?:
|
727
|
+
channeldesc?: ApiChannelDescList;
|
728
728
|
}
|
729
729
|
|
730
730
|
/** */
|
@@ -762,7 +762,7 @@ export interface HashtagDmListEvent {
|
|
762
762
|
// Max number of records to return. Between 1 and 100.
|
763
763
|
limit?: number;
|
764
764
|
// A list of channel.
|
765
|
-
hashtag_dm?:
|
765
|
+
hashtag_dm?: ApiHashtagDmList;
|
766
766
|
}
|
767
767
|
|
768
768
|
// hashtagDM
|
@@ -855,7 +855,7 @@ export interface NotificationChannelCategorySetting {
|
|
855
855
|
|
856
856
|
export interface NotificationChannelCategorySettingEvent {
|
857
857
|
clan_id? : string;
|
858
|
-
notification_channel_category_settings_list?:
|
858
|
+
notification_channel_category_settings_list?: ApiNotificationChannelCategorySettingList
|
859
859
|
}
|
860
860
|
|
861
861
|
export interface UserEmojiUsage {
|
@@ -938,6 +938,17 @@ export interface StreamingEndedEvent {
|
|
938
938
|
channel_id: string;
|
939
939
|
}
|
940
940
|
|
941
|
+
export interface SetPermissionChannelEvent {
|
942
|
+
/** Role ID */
|
943
|
+
role_id: string;
|
944
|
+
/** User ID */
|
945
|
+
user_id: string;
|
946
|
+
/** Channel ID */
|
947
|
+
channel_id: string;
|
948
|
+
/** List permission update */
|
949
|
+
permission_updates: ApiPermissionUpdate[];
|
950
|
+
}
|
951
|
+
|
941
952
|
/** A socket connection to Mezon server. */
|
942
953
|
export interface Socket {
|
943
954
|
/** Connection is Open */
|
@@ -1151,6 +1162,7 @@ export interface Socket {
|
|
1151
1162
|
|
1152
1163
|
onstreamingchannelleaved: (streaming_leaved_event: StreamingLeavedEvent) => void;
|
1153
1164
|
|
1165
|
+
onsetpermissionchannel: (set_permission_channel_event: SetPermissionChannelEvent) => void;
|
1154
1166
|
}
|
1155
1167
|
|
1156
1168
|
/** Reports an error received from a socket message. */
|
@@ -1346,7 +1358,9 @@ export class DefaultSocket implements Socket {
|
|
1346
1358
|
this.onstreamingchanneljoined(<StreamingJoinedEvent>message.streaming_joined_event);
|
1347
1359
|
} else if(message.streaming_leaved_event){
|
1348
1360
|
this.onstreamingchannelleaved(<StreamingLeavedEvent>message.streaming_leaved_event);
|
1349
|
-
} else {
|
1361
|
+
} else if(message.set_permission_channel_event){
|
1362
|
+
this.onsetpermissionchannel(<SetPermissionChannelEvent>message.set_permission_channel_event);
|
1363
|
+
}else {
|
1350
1364
|
if (this.verbose && window && window.console) {
|
1351
1365
|
console.log("Unrecognized message received: %o", message);
|
1352
1366
|
}
|
@@ -1648,6 +1662,12 @@ export class DefaultSocket implements Socket {
|
|
1648
1662
|
}
|
1649
1663
|
}
|
1650
1664
|
|
1665
|
+
onsetpermissionchannel(set_permission_channel_event: SetPermissionChannelEvent){
|
1666
|
+
if (this.verbose && window && window.console) {
|
1667
|
+
console.log(set_permission_channel_event);
|
1668
|
+
}
|
1669
|
+
}
|
1670
|
+
|
1651
1671
|
send(message: ChannelJoin | ChannelLeave | ChannelMessageSend | ChannelMessageUpdate | CustomStatusEvent |
|
1652
1672
|
ChannelMessageRemove | MessageTypingEvent | LastSeenMessageEvent | Rpc | StatusFollow | StatusUnfollow | StatusUpdate | Ping, sendTimeout = DefaultSocket.DefaultSendTimeoutMs): Promise<any> {
|
1653
1673
|
const untypedMessage = message as any;
|