mezon-js 2.9.12 → 2.9.14

Sign up to get free protection for your applications and to get access to all the features.
@@ -2215,6 +2215,33 @@ var MezonApi = class {
2215
2215
  )
2216
2216
  ]);
2217
2217
  }
2218
+ /** list user add channel by channel ids */
2219
+ listUsersAddChannelByChannelId(bearerToken, channelId, limit, options = {}) {
2220
+ const urlPath = "/v2/channeldesc/users/add";
2221
+ const queryParams = /* @__PURE__ */ new Map();
2222
+ queryParams.set("channel_id", channelId);
2223
+ queryParams.set("limit", limit);
2224
+ let bodyJson = "";
2225
+ const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
2226
+ const fetchOptions = buildFetchOptions("GET", options, bodyJson);
2227
+ if (bearerToken) {
2228
+ fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
2229
+ }
2230
+ return Promise.race([
2231
+ fetch(fullUrl, fetchOptions).then((response) => {
2232
+ if (response.status == 204) {
2233
+ return response;
2234
+ } else if (response.status >= 200 && response.status < 300) {
2235
+ return response.json();
2236
+ } else {
2237
+ throw response;
2238
+ }
2239
+ }),
2240
+ new Promise(
2241
+ (_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
2242
+ )
2243
+ ]);
2244
+ }
2218
2245
  /** Delete a channel by ID. */
2219
2246
  deleteChannelDesc(bearerToken, channelId, options = {}) {
2220
2247
  if (channelId === null || channelId === void 0) {
@@ -2833,6 +2860,31 @@ var MezonApi = class {
2833
2860
  )
2834
2861
  ]);
2835
2862
  }
2863
+ /** get list emoji by user id */
2864
+ getListEmojisByUserId(bearerToken, options = {}) {
2865
+ const urlPath = "/v2/emojis";
2866
+ const queryParams = /* @__PURE__ */ new Map();
2867
+ let bodyJson = "";
2868
+ const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
2869
+ const fetchOptions = buildFetchOptions("GET", options, bodyJson);
2870
+ if (bearerToken) {
2871
+ fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
2872
+ }
2873
+ return Promise.race([
2874
+ fetch(fullUrl, fetchOptions).then((response) => {
2875
+ if (response.status == 204) {
2876
+ return response;
2877
+ } else if (response.status >= 200 && response.status < 300) {
2878
+ return response.json();
2879
+ } else {
2880
+ throw response;
2881
+ }
2882
+ }),
2883
+ new Promise(
2884
+ (_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
2885
+ )
2886
+ ]);
2887
+ }
2836
2888
  /** Search message from elasticsearch service. */
2837
2889
  searchMessage(bearerToken, body, options = {}) {
2838
2890
  if (body === null || body === void 0) {
@@ -3205,6 +3257,32 @@ var MezonApi = class {
3205
3257
  )
3206
3258
  ]);
3207
3259
  }
3260
+ /** List GetChannelCategoryNotiSettingsList */
3261
+ getChannelCategoryNotiSettingsList(bearerToken, clanId, options = {}) {
3262
+ const urlPath = "/v2/getChannelCategoryNotiSettingsList";
3263
+ const queryParams = /* @__PURE__ */ new Map();
3264
+ queryParams.set("clan_id", clanId);
3265
+ let bodyJson = "";
3266
+ const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
3267
+ const fetchOptions = buildFetchOptions("GET", options, bodyJson);
3268
+ if (bearerToken) {
3269
+ fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
3270
+ }
3271
+ return Promise.race([
3272
+ fetch(fullUrl, fetchOptions).then((response) => {
3273
+ if (response.status == 204) {
3274
+ return response;
3275
+ } else if (response.status >= 200 && response.status < 300) {
3276
+ return response.json();
3277
+ } else {
3278
+ throw response;
3279
+ }
3280
+ }),
3281
+ new Promise(
3282
+ (_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
3283
+ )
3284
+ ]);
3285
+ }
3208
3286
  /** */
3209
3287
  getUserProfileOnClan(bearerToken, clanId, options = {}) {
3210
3288
  if (clanId === null || clanId === void 0) {
@@ -3233,6 +3311,110 @@ var MezonApi = class {
3233
3311
  )
3234
3312
  ]);
3235
3313
  }
3314
+ /** List GetNotificationChannel */
3315
+ getNotificationCategory(bearerToken, categoryId, options = {}) {
3316
+ const urlPath = "/v2/getnotificationcategory";
3317
+ const queryParams = /* @__PURE__ */ new Map();
3318
+ queryParams.set("category_id", categoryId);
3319
+ let bodyJson = "";
3320
+ const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
3321
+ const fetchOptions = buildFetchOptions("GET", options, bodyJson);
3322
+ if (bearerToken) {
3323
+ fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
3324
+ }
3325
+ return Promise.race([
3326
+ fetch(fullUrl, fetchOptions).then((response) => {
3327
+ if (response.status == 204) {
3328
+ return response;
3329
+ } else if (response.status >= 200 && response.status < 300) {
3330
+ return response.json();
3331
+ } else {
3332
+ throw response;
3333
+ }
3334
+ }),
3335
+ new Promise(
3336
+ (_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
3337
+ )
3338
+ ]);
3339
+ }
3340
+ /** List GetNotificationChannel */
3341
+ getNotificationChannel(bearerToken, channelId, options = {}) {
3342
+ const urlPath = "/v2/getnotificationchannel";
3343
+ const queryParams = /* @__PURE__ */ new Map();
3344
+ queryParams.set("channel_id", channelId);
3345
+ let bodyJson = "";
3346
+ const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
3347
+ const fetchOptions = buildFetchOptions("GET", options, bodyJson);
3348
+ if (bearerToken) {
3349
+ fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
3350
+ }
3351
+ return Promise.race([
3352
+ fetch(fullUrl, fetchOptions).then((response) => {
3353
+ if (response.status == 204) {
3354
+ return response;
3355
+ } else if (response.status >= 200 && response.status < 300) {
3356
+ return response.json();
3357
+ } else {
3358
+ throw response;
3359
+ }
3360
+ }),
3361
+ new Promise(
3362
+ (_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
3363
+ )
3364
+ ]);
3365
+ }
3366
+ /** List GetNotificationClan */
3367
+ getNotificationClan(bearerToken, clanId, options = {}) {
3368
+ const urlPath = "/v2/getnotificationclan";
3369
+ const queryParams = /* @__PURE__ */ new Map();
3370
+ queryParams.set("clan_id", clanId);
3371
+ let bodyJson = "";
3372
+ const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
3373
+ const fetchOptions = buildFetchOptions("GET", options, bodyJson);
3374
+ if (bearerToken) {
3375
+ fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
3376
+ }
3377
+ return Promise.race([
3378
+ fetch(fullUrl, fetchOptions).then((response) => {
3379
+ if (response.status == 204) {
3380
+ return response;
3381
+ } else if (response.status >= 200 && response.status < 300) {
3382
+ return response.json();
3383
+ } else {
3384
+ throw response;
3385
+ }
3386
+ }),
3387
+ new Promise(
3388
+ (_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
3389
+ )
3390
+ ]);
3391
+ }
3392
+ /** List GetNotificationReactMessage */
3393
+ getNotificationReactMessage(bearerToken, channelId, options = {}) {
3394
+ const urlPath = "/v2/getnotificationreactmessage";
3395
+ const queryParams = /* @__PURE__ */ new Map();
3396
+ queryParams.set("channel_id", channelId);
3397
+ let bodyJson = "";
3398
+ const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
3399
+ const fetchOptions = buildFetchOptions("GET", options, bodyJson);
3400
+ if (bearerToken) {
3401
+ fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
3402
+ }
3403
+ return Promise.race([
3404
+ fetch(fullUrl, fetchOptions).then((response) => {
3405
+ if (response.status == 204) {
3406
+ return response;
3407
+ } else if (response.status >= 200 && response.status < 300) {
3408
+ return response.json();
3409
+ } else {
3410
+ throw response;
3411
+ }
3412
+ }),
3413
+ new Promise(
3414
+ (_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
3415
+ )
3416
+ ]);
3417
+ }
3236
3418
  /** Give a coffee */
3237
3419
  giveMeACoffee(bearerToken, body, options = {}) {
3238
3420
  if (body === null || body === void 0) {
@@ -3262,6 +3444,33 @@ var MezonApi = class {
3262
3444
  )
3263
3445
  ]);
3264
3446
  }
3447
+ /** List HashtagDMList */
3448
+ hashtagDMList(bearerToken, userId, limit, options = {}) {
3449
+ const urlPath = "/v2/hashtagdmlist";
3450
+ const queryParams = /* @__PURE__ */ new Map();
3451
+ queryParams.set("user_id", userId);
3452
+ queryParams.set("limit", limit);
3453
+ let bodyJson = "";
3454
+ const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
3455
+ const fetchOptions = buildFetchOptions("GET", options, bodyJson);
3456
+ if (bearerToken) {
3457
+ fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
3458
+ }
3459
+ return Promise.race([
3460
+ fetch(fullUrl, fetchOptions).then((response) => {
3461
+ if (response.status == 204) {
3462
+ return response;
3463
+ } else if (response.status >= 200 && response.status < 300) {
3464
+ return response.json();
3465
+ } else {
3466
+ throw response;
3467
+ }
3468
+ }),
3469
+ new Promise(
3470
+ (_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
3471
+ )
3472
+ ]);
3473
+ }
3265
3474
  /** Add users to a channel. */
3266
3475
  createLinkInviteUser(bearerToken, body, options = {}) {
3267
3476
  if (body === null || body === void 0) {
@@ -3347,6 +3556,31 @@ var MezonApi = class {
3347
3556
  )
3348
3557
  ]);
3349
3558
  }
3559
+ /** List HashtagDMList */
3560
+ listChannelByUserId(bearerToken, options = {}) {
3561
+ const urlPath = "/v2/listchannelbyuserid";
3562
+ const queryParams = /* @__PURE__ */ new Map();
3563
+ let bodyJson = "";
3564
+ const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
3565
+ const fetchOptions = buildFetchOptions("GET", options, bodyJson);
3566
+ if (bearerToken) {
3567
+ fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
3568
+ }
3569
+ return Promise.race([
3570
+ fetch(fullUrl, fetchOptions).then((response) => {
3571
+ if (response.status == 204) {
3572
+ return response;
3573
+ } else if (response.status >= 200 && response.status < 300) {
3574
+ return response.json();
3575
+ } else {
3576
+ throw response;
3577
+ }
3578
+ }),
3579
+ new Promise(
3580
+ (_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
3581
+ )
3582
+ ]);
3583
+ }
3350
3584
  /** set mute notification user channel. */
3351
3585
  setMuteNotificationCategory(bearerToken, body, options = {}) {
3352
3586
  if (body === null || body === void 0) {
@@ -3653,6 +3887,35 @@ var MezonApi = class {
3653
3887
  )
3654
3888
  ]);
3655
3889
  }
3890
+ /** Ossrs http callback. */
3891
+ streamingServerCallback(bearerToken, body, options = {}) {
3892
+ if (body === null || body === void 0) {
3893
+ throw new Error("'body' is a required parameter but is null or undefined.");
3894
+ }
3895
+ const urlPath = "/v2/ossrs/callback";
3896
+ const queryParams = /* @__PURE__ */ new Map();
3897
+ let bodyJson = "";
3898
+ bodyJson = JSON.stringify(body || {});
3899
+ const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
3900
+ const fetchOptions = buildFetchOptions("POST", options, bodyJson);
3901
+ if (bearerToken) {
3902
+ fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
3903
+ }
3904
+ return Promise.race([
3905
+ fetch(fullUrl, fetchOptions).then((response) => {
3906
+ if (response.status == 204) {
3907
+ return response;
3908
+ } else if (response.status >= 200 && response.status < 300) {
3909
+ return response.json();
3910
+ } else {
3911
+ throw response;
3912
+ }
3913
+ }),
3914
+ new Promise(
3915
+ (_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
3916
+ )
3917
+ ]);
3918
+ }
3656
3919
  /** set permission role channel. */
3657
3920
  setRoleChannelPermission(bearerToken, body, options = {}) {
3658
3921
  if (body === null || body === void 0) {
@@ -4276,6 +4539,31 @@ var MezonApi = class {
4276
4539
  )
4277
4540
  ]);
4278
4541
  }
4542
+ /** get list sticker by user id */
4543
+ getListStickersByUserId(bearerToken, options = {}) {
4544
+ const urlPath = "/v2/stickers";
4545
+ const queryParams = /* @__PURE__ */ new Map();
4546
+ let bodyJson = "";
4547
+ const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
4548
+ const fetchOptions = buildFetchOptions("GET", options, bodyJson);
4549
+ if (bearerToken) {
4550
+ fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
4551
+ }
4552
+ return Promise.race([
4553
+ fetch(fullUrl, fetchOptions).then((response) => {
4554
+ if (response.status == 204) {
4555
+ return response;
4556
+ } else if (response.status >= 200 && response.status < 300) {
4557
+ return response.json();
4558
+ } else {
4559
+ throw response;
4560
+ }
4561
+ }),
4562
+ new Promise(
4563
+ (_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
4564
+ )
4565
+ ]);
4566
+ }
4279
4567
  /** List streaming channels. */
4280
4568
  listStreamingChannels(bearerToken, clanId, options = {}) {
4281
4569
  const urlPath = "/v2/streaming-channels";
@@ -7559,4 +7847,104 @@ var Client = class {
7559
7847
  });
7560
7848
  });
7561
7849
  }
7850
+ getChannelCategoryNotiSettingsList(session, clanId) {
7851
+ return __async(this, null, function* () {
7852
+ if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
7853
+ yield this.sessionRefresh(session);
7854
+ }
7855
+ return this.apiClient.getChannelCategoryNotiSettingsList(session.token, clanId).then((response) => {
7856
+ return Promise.resolve(response);
7857
+ });
7858
+ });
7859
+ }
7860
+ getNotificationCategory(session, categoryId) {
7861
+ return __async(this, null, function* () {
7862
+ if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
7863
+ yield this.sessionRefresh(session);
7864
+ }
7865
+ return this.apiClient.getNotificationCategory(session.token, categoryId).then((response) => {
7866
+ return Promise.resolve(response);
7867
+ });
7868
+ });
7869
+ }
7870
+ getNotificationChannel(session, channelId) {
7871
+ return __async(this, null, function* () {
7872
+ if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
7873
+ yield this.sessionRefresh(session);
7874
+ }
7875
+ return this.apiClient.getNotificationChannel(session.token, channelId).then((response) => {
7876
+ return Promise.resolve(response);
7877
+ });
7878
+ });
7879
+ }
7880
+ getNotificationClan(session, clanId) {
7881
+ return __async(this, null, function* () {
7882
+ if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
7883
+ yield this.sessionRefresh(session);
7884
+ }
7885
+ return this.apiClient.getNotificationClan(session.token, clanId).then((response) => {
7886
+ return Promise.resolve(response);
7887
+ });
7888
+ });
7889
+ }
7890
+ getNotificationReactMessage(session, channelId) {
7891
+ return __async(this, null, function* () {
7892
+ if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
7893
+ yield this.sessionRefresh(session);
7894
+ }
7895
+ return this.apiClient.getNotificationReactMessage(session.token, channelId).then((response) => {
7896
+ return Promise.resolve(response);
7897
+ });
7898
+ });
7899
+ }
7900
+ hashtagDMList(session, userId, limit) {
7901
+ return __async(this, null, function* () {
7902
+ if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
7903
+ yield this.sessionRefresh(session);
7904
+ }
7905
+ return this.apiClient.hashtagDMList(session.token, userId, limit).then((response) => {
7906
+ return Promise.resolve(response);
7907
+ });
7908
+ });
7909
+ }
7910
+ listChannelByUserId(session) {
7911
+ return __async(this, null, function* () {
7912
+ if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
7913
+ yield this.sessionRefresh(session);
7914
+ }
7915
+ return this.apiClient.listChannelByUserId(session.token).then((response) => {
7916
+ return Promise.resolve(response);
7917
+ });
7918
+ });
7919
+ }
7920
+ listUsersAddChannelByChannelId(session, channel_id, limit) {
7921
+ return __async(this, null, function* () {
7922
+ if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
7923
+ yield this.sessionRefresh(session);
7924
+ }
7925
+ return this.apiClient.listUsersAddChannelByChannelId(session.token, channel_id, limit).then((response) => {
7926
+ return Promise.resolve(response);
7927
+ });
7928
+ });
7929
+ }
7930
+ getListEmojisByUserId(session) {
7931
+ return __async(this, null, function* () {
7932
+ if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
7933
+ yield this.sessionRefresh(session);
7934
+ }
7935
+ return this.apiClient.getListEmojisByUserId(session.token).then((response) => {
7936
+ return Promise.resolve(response);
7937
+ });
7938
+ });
7939
+ }
7940
+ getListStickersByUserId(session) {
7941
+ return __async(this, null, function* () {
7942
+ if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
7943
+ yield this.sessionRefresh(session);
7944
+ }
7945
+ return this.apiClient.getListStickersByUserId(session.token).then((response) => {
7946
+ return Promise.resolve(response);
7947
+ });
7948
+ });
7949
+ }
7562
7950
  };