mezon-js 2.8.36 → 2.8.37

Sign up to get free protection for your applications and to get access to all the features.
@@ -3248,32 +3248,6 @@ var MezonApi = class {
3248
3248
  )
3249
3249
  ]);
3250
3250
  }
3251
- /** notification selected */
3252
- getNotificationChannelSetting(bearerToken, channelId, options = {}) {
3253
- const urlPath = "/v2/notificationchannel/get";
3254
- const queryParams = /* @__PURE__ */ new Map();
3255
- queryParams.set("channel_id", channelId);
3256
- let bodyJson = "";
3257
- const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
3258
- const fetchOptions = buildFetchOptions("GET", options, bodyJson);
3259
- if (bearerToken) {
3260
- fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
3261
- }
3262
- return Promise.race([
3263
- fetch(fullUrl, fetchOptions).then((response) => {
3264
- if (response.status == 204) {
3265
- return response;
3266
- } else if (response.status >= 200 && response.status < 300) {
3267
- return response.json();
3268
- } else {
3269
- throw response;
3270
- }
3271
- }),
3272
- new Promise(
3273
- (_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
3274
- )
3275
- ]);
3276
- }
3277
3251
  /** set notification user channel. */
3278
3252
  setNotificationChannelSetting(bearerToken, body, options = {}) {
3279
3253
  if (body === null || body === void 0) {
@@ -3387,32 +3361,6 @@ var MezonApi = class {
3387
3361
  )
3388
3362
  ]);
3389
3363
  }
3390
- /** notification selected */
3391
- getNotificationCategorySetting(bearerToken, categoryId, options = {}) {
3392
- const urlPath = "/v2/notificationusercategory/get";
3393
- const queryParams = /* @__PURE__ */ new Map();
3394
- queryParams.set("category_id", categoryId);
3395
- let bodyJson = "";
3396
- const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
3397
- const fetchOptions = buildFetchOptions("GET", options, bodyJson);
3398
- if (bearerToken) {
3399
- fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
3400
- }
3401
- return Promise.race([
3402
- fetch(fullUrl, fetchOptions).then((response) => {
3403
- if (response.status == 204) {
3404
- return response;
3405
- } else if (response.status >= 200 && response.status < 300) {
3406
- return response.json();
3407
- } else {
3408
- throw response;
3409
- }
3410
- }),
3411
- new Promise(
3412
- (_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
3413
- )
3414
- ]);
3415
- }
3416
3364
  /** */
3417
3365
  deleteNotificationChannel(bearerToken, channelId, options = {}) {
3418
3366
  const urlPath = "/v2/notificationuserchannel/delete";
@@ -3439,32 +3387,6 @@ var MezonApi = class {
3439
3387
  )
3440
3388
  ]);
3441
3389
  }
3442
- /** notification selected */
3443
- getNotificationClanSetting(bearerToken, clanId, options = {}) {
3444
- const urlPath = "/v2/notificationuserclan/get";
3445
- const queryParams = /* @__PURE__ */ new Map();
3446
- queryParams.set("clan_id", clanId);
3447
- let bodyJson = "";
3448
- const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
3449
- const fetchOptions = buildFetchOptions("GET", options, bodyJson);
3450
- if (bearerToken) {
3451
- fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
3452
- }
3453
- return Promise.race([
3454
- fetch(fullUrl, fetchOptions).then((response) => {
3455
- if (response.status == 204) {
3456
- return response;
3457
- } else if (response.status >= 200 && response.status < 300) {
3458
- return response.json();
3459
- } else {
3460
- throw response;
3461
- }
3462
- }),
3463
- new Promise(
3464
- (_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
3465
- )
3466
- ]);
3467
- }
3468
3390
  /** notification category, channel selected */
3469
3391
  getChannelCategoryNotiSettingsList(bearerToken, clanId, options = {}) {
3470
3392
  const urlPath = "/v2/notifichannelcategory/get";
@@ -3518,32 +3440,6 @@ var MezonApi = class {
3518
3440
  ]);
3519
3441
  }
3520
3442
  /** */
3521
- getNotificationReactMessage(bearerToken, channelId, options = {}) {
3522
- const urlPath = "/v2/notifireactmessage/get";
3523
- const queryParams = /* @__PURE__ */ new Map();
3524
- queryParams.set("channel_id", channelId);
3525
- let bodyJson = "";
3526
- const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
3527
- const fetchOptions = buildFetchOptions("GET", options, bodyJson);
3528
- if (bearerToken) {
3529
- fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
3530
- }
3531
- return Promise.race([
3532
- fetch(fullUrl, fetchOptions).then((response) => {
3533
- if (response.status == 204) {
3534
- return response;
3535
- } else if (response.status >= 200 && response.status < 300) {
3536
- return response.json();
3537
- } else {
3538
- throw response;
3539
- }
3540
- }),
3541
- new Promise(
3542
- (_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
3543
- )
3544
- ]);
3545
- }
3546
- /** */
3547
3443
  setNotificationReactMessage(bearerToken, body, options = {}) {
3548
3444
  if (body === null || body === void 0) {
3549
3445
  throw new Error("'body' is a required parameter but is null or undefined.");
@@ -6596,17 +6492,6 @@ var Client = class {
6596
6492
  });
6597
6493
  });
6598
6494
  }
6599
- /** get default notification clan */
6600
- getNotificationClanSetting(session, clanId) {
6601
- return __async(this, null, function* () {
6602
- if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
6603
- yield this.sessionRefresh(session);
6604
- }
6605
- return this.apiClient.getNotificationClanSetting(session.token, clanId, {}).then((response) => {
6606
- return Promise.resolve(response);
6607
- });
6608
- });
6609
- }
6610
6495
  /** Set notification channel*/
6611
6496
  setNotificationChannel(session, request) {
6612
6497
  return __async(this, null, function* () {
@@ -6640,17 +6525,6 @@ var Client = class {
6640
6525
  });
6641
6526
  });
6642
6527
  }
6643
- /** get default notification clan */
6644
- getNotificationChannel(session, channelId) {
6645
- return __async(this, null, function* () {
6646
- if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
6647
- yield this.sessionRefresh(session);
6648
- }
6649
- return this.apiClient.getNotificationChannelSetting(session.token, channelId, {}).then((response) => {
6650
- return Promise.resolve(response);
6651
- });
6652
- });
6653
- }
6654
6528
  /** Set default notification category*/
6655
6529
  setNotificationCategory(session, request) {
6656
6530
  return __async(this, null, function* () {
@@ -6662,17 +6536,6 @@ var Client = class {
6662
6536
  });
6663
6537
  });
6664
6538
  }
6665
- /** get default notification category */
6666
- getNotificationCategory(session, category_id) {
6667
- return __async(this, null, function* () {
6668
- if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
6669
- yield this.sessionRefresh(session);
6670
- }
6671
- return this.apiClient.getNotificationCategorySetting(session.token, category_id, {}).then((response) => {
6672
- return Promise.resolve(response);
6673
- });
6674
- });
6675
- }
6676
6539
  deleteNotificationCategory(session, category_id) {
6677
6540
  return __async(this, null, function* () {
6678
6541
  if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
@@ -6714,17 +6577,6 @@ var Client = class {
6714
6577
  });
6715
6578
  });
6716
6579
  }
6717
- /** */
6718
- getNotificationReactMessage(session, channelId) {
6719
- return __async(this, null, function* () {
6720
- if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
6721
- yield this.sessionRefresh(session);
6722
- }
6723
- return this.apiClient.getNotificationReactMessage(session.token, channelId).then((response) => {
6724
- return Promise.resolve(response);
6725
- });
6726
- });
6727
- }
6728
6580
  //** */
6729
6581
  deleteNotiReactMessage(session, channel_id) {
6730
6582
  return __async(this, null, function* () {
@@ -6943,7 +6795,17 @@ var Client = class {
6943
6795
  });
6944
6796
  });
6945
6797
  }
6946
- ListApp(session) {
6798
+ getApp(session, id) {
6799
+ return __async(this, null, function* () {
6800
+ if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
6801
+ yield this.sessionRefresh(session);
6802
+ }
6803
+ return this.apiClient.getApp(session.token, id).then((response) => {
6804
+ return Promise.resolve(response);
6805
+ });
6806
+ });
6807
+ }
6808
+ listApp(session) {
6947
6809
  return __async(this, null, function* () {
6948
6810
  if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
6949
6811
  yield this.sessionRefresh(session);
@@ -3219,32 +3219,6 @@ var MezonApi = class {
3219
3219
  )
3220
3220
  ]);
3221
3221
  }
3222
- /** notification selected */
3223
- getNotificationChannelSetting(bearerToken, channelId, options = {}) {
3224
- const urlPath = "/v2/notificationchannel/get";
3225
- const queryParams = /* @__PURE__ */ new Map();
3226
- queryParams.set("channel_id", channelId);
3227
- let bodyJson = "";
3228
- const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
3229
- const fetchOptions = buildFetchOptions("GET", options, bodyJson);
3230
- if (bearerToken) {
3231
- fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
3232
- }
3233
- return Promise.race([
3234
- fetch(fullUrl, fetchOptions).then((response) => {
3235
- if (response.status == 204) {
3236
- return response;
3237
- } else if (response.status >= 200 && response.status < 300) {
3238
- return response.json();
3239
- } else {
3240
- throw response;
3241
- }
3242
- }),
3243
- new Promise(
3244
- (_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
3245
- )
3246
- ]);
3247
- }
3248
3222
  /** set notification user channel. */
3249
3223
  setNotificationChannelSetting(bearerToken, body, options = {}) {
3250
3224
  if (body === null || body === void 0) {
@@ -3358,32 +3332,6 @@ var MezonApi = class {
3358
3332
  )
3359
3333
  ]);
3360
3334
  }
3361
- /** notification selected */
3362
- getNotificationCategorySetting(bearerToken, categoryId, options = {}) {
3363
- const urlPath = "/v2/notificationusercategory/get";
3364
- const queryParams = /* @__PURE__ */ new Map();
3365
- queryParams.set("category_id", categoryId);
3366
- let bodyJson = "";
3367
- const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
3368
- const fetchOptions = buildFetchOptions("GET", options, bodyJson);
3369
- if (bearerToken) {
3370
- fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
3371
- }
3372
- return Promise.race([
3373
- fetch(fullUrl, fetchOptions).then((response) => {
3374
- if (response.status == 204) {
3375
- return response;
3376
- } else if (response.status >= 200 && response.status < 300) {
3377
- return response.json();
3378
- } else {
3379
- throw response;
3380
- }
3381
- }),
3382
- new Promise(
3383
- (_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
3384
- )
3385
- ]);
3386
- }
3387
3335
  /** */
3388
3336
  deleteNotificationChannel(bearerToken, channelId, options = {}) {
3389
3337
  const urlPath = "/v2/notificationuserchannel/delete";
@@ -3410,32 +3358,6 @@ var MezonApi = class {
3410
3358
  )
3411
3359
  ]);
3412
3360
  }
3413
- /** notification selected */
3414
- getNotificationClanSetting(bearerToken, clanId, options = {}) {
3415
- const urlPath = "/v2/notificationuserclan/get";
3416
- const queryParams = /* @__PURE__ */ new Map();
3417
- queryParams.set("clan_id", clanId);
3418
- let bodyJson = "";
3419
- const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
3420
- const fetchOptions = buildFetchOptions("GET", options, bodyJson);
3421
- if (bearerToken) {
3422
- fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
3423
- }
3424
- return Promise.race([
3425
- fetch(fullUrl, fetchOptions).then((response) => {
3426
- if (response.status == 204) {
3427
- return response;
3428
- } else if (response.status >= 200 && response.status < 300) {
3429
- return response.json();
3430
- } else {
3431
- throw response;
3432
- }
3433
- }),
3434
- new Promise(
3435
- (_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
3436
- )
3437
- ]);
3438
- }
3439
3361
  /** notification category, channel selected */
3440
3362
  getChannelCategoryNotiSettingsList(bearerToken, clanId, options = {}) {
3441
3363
  const urlPath = "/v2/notifichannelcategory/get";
@@ -3489,32 +3411,6 @@ var MezonApi = class {
3489
3411
  ]);
3490
3412
  }
3491
3413
  /** */
3492
- getNotificationReactMessage(bearerToken, channelId, options = {}) {
3493
- const urlPath = "/v2/notifireactmessage/get";
3494
- const queryParams = /* @__PURE__ */ new Map();
3495
- queryParams.set("channel_id", channelId);
3496
- let bodyJson = "";
3497
- const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
3498
- const fetchOptions = buildFetchOptions("GET", options, bodyJson);
3499
- if (bearerToken) {
3500
- fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
3501
- }
3502
- return Promise.race([
3503
- fetch(fullUrl, fetchOptions).then((response) => {
3504
- if (response.status == 204) {
3505
- return response;
3506
- } else if (response.status >= 200 && response.status < 300) {
3507
- return response.json();
3508
- } else {
3509
- throw response;
3510
- }
3511
- }),
3512
- new Promise(
3513
- (_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
3514
- )
3515
- ]);
3516
- }
3517
- /** */
3518
3414
  setNotificationReactMessage(bearerToken, body, options = {}) {
3519
3415
  if (body === null || body === void 0) {
3520
3416
  throw new Error("'body' is a required parameter but is null or undefined.");
@@ -6567,17 +6463,6 @@ var Client = class {
6567
6463
  });
6568
6464
  });
6569
6465
  }
6570
- /** get default notification clan */
6571
- getNotificationClanSetting(session, clanId) {
6572
- return __async(this, null, function* () {
6573
- if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
6574
- yield this.sessionRefresh(session);
6575
- }
6576
- return this.apiClient.getNotificationClanSetting(session.token, clanId, {}).then((response) => {
6577
- return Promise.resolve(response);
6578
- });
6579
- });
6580
- }
6581
6466
  /** Set notification channel*/
6582
6467
  setNotificationChannel(session, request) {
6583
6468
  return __async(this, null, function* () {
@@ -6611,17 +6496,6 @@ var Client = class {
6611
6496
  });
6612
6497
  });
6613
6498
  }
6614
- /** get default notification clan */
6615
- getNotificationChannel(session, channelId) {
6616
- return __async(this, null, function* () {
6617
- if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
6618
- yield this.sessionRefresh(session);
6619
- }
6620
- return this.apiClient.getNotificationChannelSetting(session.token, channelId, {}).then((response) => {
6621
- return Promise.resolve(response);
6622
- });
6623
- });
6624
- }
6625
6499
  /** Set default notification category*/
6626
6500
  setNotificationCategory(session, request) {
6627
6501
  return __async(this, null, function* () {
@@ -6633,17 +6507,6 @@ var Client = class {
6633
6507
  });
6634
6508
  });
6635
6509
  }
6636
- /** get default notification category */
6637
- getNotificationCategory(session, category_id) {
6638
- return __async(this, null, function* () {
6639
- if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
6640
- yield this.sessionRefresh(session);
6641
- }
6642
- return this.apiClient.getNotificationCategorySetting(session.token, category_id, {}).then((response) => {
6643
- return Promise.resolve(response);
6644
- });
6645
- });
6646
- }
6647
6510
  deleteNotificationCategory(session, category_id) {
6648
6511
  return __async(this, null, function* () {
6649
6512
  if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
@@ -6685,17 +6548,6 @@ var Client = class {
6685
6548
  });
6686
6549
  });
6687
6550
  }
6688
- /** */
6689
- getNotificationReactMessage(session, channelId) {
6690
- return __async(this, null, function* () {
6691
- if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
6692
- yield this.sessionRefresh(session);
6693
- }
6694
- return this.apiClient.getNotificationReactMessage(session.token, channelId).then((response) => {
6695
- return Promise.resolve(response);
6696
- });
6697
- });
6698
- }
6699
6551
  //** */
6700
6552
  deleteNotiReactMessage(session, channel_id) {
6701
6553
  return __async(this, null, function* () {
@@ -6914,7 +6766,17 @@ var Client = class {
6914
6766
  });
6915
6767
  });
6916
6768
  }
6917
- ListApp(session) {
6769
+ getApp(session, id) {
6770
+ return __async(this, null, function* () {
6771
+ if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
6772
+ yield this.sessionRefresh(session);
6773
+ }
6774
+ return this.apiClient.getApp(session.token, id).then((response) => {
6775
+ return Promise.resolve(response);
6776
+ });
6777
+ });
6778
+ }
6779
+ listApp(session) {
6918
6780
  return __async(this, null, function* () {
6919
6781
  if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
6920
6782
  yield this.sessionRefresh(session);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mezon-js",
3
- "version": "2.8.36",
3
+ "version": "2.8.37",
4
4
  "scripts": {
5
5
  "build": "npx tsc && npx rollup -c --bundleConfigAsCjs && node build.mjs"
6
6
  },
package/socket.ts CHANGED
@@ -1081,11 +1081,13 @@ export class DefaultSocket implements Socket {
1081
1081
  console.log(user);
1082
1082
  }
1083
1083
  }
1084
+
1084
1085
  onuserprofileupdate(user: UserProfileUpdatedEvent) {
1085
1086
  if (this.verbose && window && window.console) {
1086
1087
  console.log(user);
1087
1088
  }
1088
1089
  }
1090
+
1089
1091
  onuserchannelremoved(user: UserChannelRemovedEvent) {
1090
1092
  if (this.verbose && window && window.console) {
1091
1093
  console.log(user);