mezon-js 2.10.70 → 2.10.73

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 CHANGED
@@ -2521,9 +2521,7 @@ export interface ApiWalletLedger {
2521
2521
  /** */
2522
2522
  export interface ApiWalletLedgerList {
2523
2523
  //
2524
- next_cursor?: string;
2525
- //
2526
- prev_cursor?: string;
2524
+ count?: number;
2527
2525
  //
2528
2526
  wallet_ledger?: Array<ApiWalletLedger>;
2529
2527
  }
@@ -2543,6 +2541,8 @@ export interface ApiWebhook {
2543
2541
  //
2544
2542
  id?: string;
2545
2543
  //
2544
+ status?: number;
2545
+ //
2546
2546
  update_time?: string;
2547
2547
  //
2548
2548
  url?: string;
@@ -9843,25 +9843,26 @@ export class MezonApi {
9843
9843
  }
9844
9844
 
9845
9845
  /** Get user status */
9846
- listWalletLedger(
9847
- bearerToken: string,
9848
- limit?: number,
9849
- cursor?: string,
9850
- transactionId?: string,
9851
- options: any = {}
9852
- ): Promise<ApiWalletLedgerList> {
9846
+ listWalletLedger(bearerToken: string,
9847
+ limit?:number,
9848
+ cursor?:string,
9849
+ transactionId?:string,
9850
+ page?:number,
9851
+ options: any = {}): Promise<ApiWalletLedgerList> {
9852
+
9853
9853
  const urlPath = "/v2/walletledger";
9854
9854
  const queryParams = new Map<string, any>();
9855
9855
  queryParams.set("limit", limit);
9856
9856
  queryParams.set("cursor", cursor);
9857
9857
  queryParams.set("transaction_id", transactionId);
9858
+ queryParams.set("page", page);
9858
9859
 
9859
- let bodyJson: string = "";
9860
+ let bodyJson : string = "";
9860
9861
 
9861
9862
  const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
9862
9863
  const fetchOptions = buildFetchOptions("GET", options, bodyJson);
9863
9864
  if (bearerToken) {
9864
- fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
9865
+ fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
9865
9866
  }
9866
9867
 
9867
9868
  return Promise.race([
@@ -9878,7 +9879,7 @@ export class MezonApi {
9878
9879
  setTimeout(reject, this.timeoutMs, "Request timed out.")
9879
9880
  ),
9880
9881
  ]);
9881
- }
9882
+ }
9882
9883
 
9883
9884
  /** create webhook */
9884
9885
  generateWebhook(
package/client.ts CHANGED
@@ -174,12 +174,13 @@ export enum ChannelType {
174
174
  CHANNEL_TYPE_CHANNEL = 1,
175
175
  CHANNEL_TYPE_GROUP = 2,
176
176
  CHANNEL_TYPE_DM = 3,
177
- CHANNEL_TYPE_VOICE = 4,
177
+ CHANNEL_TYPE_GMEET_VOICE = 4,
178
178
  CHANNEL_TYPE_FORUM = 5,
179
179
  CHANNEL_TYPE_STREAMING = 6,
180
180
  CHANNEL_TYPE_THREAD = 7,
181
181
  CHANNEL_TYPE_APP = 8,
182
182
  CHANNEL_TYPE_ANNOUNCEMENT = 9,
183
+ CHANNEL_TYPE_MEZON_VOICE = 10
183
184
  }
184
185
  export enum ChannelStreamMode {
185
186
  STREAM_MODE_CHANNEL = 2,
@@ -4767,7 +4768,8 @@ export class Client {
4767
4768
  session: Session,
4768
4769
  limit?: number,
4769
4770
  cursor?: string,
4770
- transactionId?: string
4771
+ transactionId?: string,
4772
+ page?: number
4771
4773
  ): Promise<ApiWalletLedgerList> {
4772
4774
  if (
4773
4775
  this.autoRefreshSession &&
@@ -4778,7 +4780,7 @@ export class Client {
4778
4780
  }
4779
4781
 
4780
4782
  return this.apiClient
4781
- .listWalletLedger(session.token, limit, cursor, transactionId)
4783
+ .listWalletLedger(session.token, limit, cursor, transactionId, page)
4782
4784
  .then((response: ApiWalletLedgerList) => {
4783
4785
  return Promise.resolve(response);
4784
4786
  });
package/dist/api.gen.d.ts CHANGED
@@ -1458,8 +1458,7 @@ export interface ApiWalletLedger {
1458
1458
  }
1459
1459
  /** */
1460
1460
  export interface ApiWalletLedgerList {
1461
- next_cursor?: string;
1462
- prev_cursor?: string;
1461
+ count?: number;
1463
1462
  wallet_ledger?: Array<ApiWalletLedger>;
1464
1463
  }
1465
1464
  /** */
@@ -1470,6 +1469,7 @@ export interface ApiWebhook {
1470
1469
  create_time?: string;
1471
1470
  creator_id?: string;
1472
1471
  id?: string;
1472
+ status?: number;
1473
1473
  update_time?: string;
1474
1474
  url?: string;
1475
1475
  webhook_name?: string;
@@ -1977,7 +1977,7 @@ export declare class MezonApi {
1977
1977
  /** Update user status */
1978
1978
  updateUserStatus(bearerToken: string, body: ApiUserStatusUpdate, options?: any): Promise<any>;
1979
1979
  /** Get user status */
1980
- listWalletLedger(bearerToken: string, limit?: number, cursor?: string, transactionId?: string, options?: any): Promise<ApiWalletLedgerList>;
1980
+ listWalletLedger(bearerToken: string, limit?: number, cursor?: string, transactionId?: string, page?: number, options?: any): Promise<ApiWalletLedgerList>;
1981
1981
  /** create webhook */
1982
1982
  generateWebhook(bearerToken: string, body: ApiWebhookCreateRequest, options?: any): Promise<any>;
1983
1983
  /** update webhook name by id */
package/dist/client.d.ts CHANGED
@@ -21,12 +21,13 @@ export declare enum ChannelType {
21
21
  CHANNEL_TYPE_CHANNEL = 1,
22
22
  CHANNEL_TYPE_GROUP = 2,
23
23
  CHANNEL_TYPE_DM = 3,
24
- CHANNEL_TYPE_VOICE = 4,
24
+ CHANNEL_TYPE_GMEET_VOICE = 4,
25
25
  CHANNEL_TYPE_FORUM = 5,
26
26
  CHANNEL_TYPE_STREAMING = 6,
27
27
  CHANNEL_TYPE_THREAD = 7,
28
28
  CHANNEL_TYPE_APP = 8,
29
- CHANNEL_TYPE_ANNOUNCEMENT = 9
29
+ CHANNEL_TYPE_ANNOUNCEMENT = 9,
30
+ CHANNEL_TYPE_MEZON_VOICE = 10
30
31
  }
31
32
  export declare enum ChannelStreamMode {
32
33
  STREAM_MODE_CHANNEL = 2,
@@ -632,7 +633,7 @@ export declare class Client {
632
633
  updateOnboardingStepByClanId(session: Session, clan_id: string, request: MezonUpdateOnboardingStepByClanIdBody): Promise<boolean>;
633
634
  updateUserStatus(session: Session, request: ApiUserStatusUpdate): Promise<boolean>;
634
635
  getUserStatus(session: Session): Promise<ApiUserStatus>;
635
- listWalletLedger(session: Session, limit?: number, cursor?: string, transactionId?: string): Promise<ApiWalletLedgerList>;
636
+ listWalletLedger(session: Session, limit?: number, cursor?: string, transactionId?: string, page?: number): Promise<ApiWalletLedgerList>;
636
637
  listSdTopic(session: Session, clanId?: string, limit?: number): Promise<ApiSdTopicList>;
637
638
  createSdTopic(session: Session, request: ApiSdTopicRequest): Promise<ApiSdTopic>;
638
639
  getTopicDetail(session: Session, topicId?: string): Promise<ApiSdTopic>;
@@ -6230,12 +6230,13 @@ var MezonApi = class {
6230
6230
  ]);
6231
6231
  }
6232
6232
  /** Get user status */
6233
- listWalletLedger(bearerToken, limit, cursor, transactionId, options = {}) {
6233
+ listWalletLedger(bearerToken, limit, cursor, transactionId, page, options = {}) {
6234
6234
  const urlPath = "/v2/walletledger";
6235
6235
  const queryParams = /* @__PURE__ */ new Map();
6236
6236
  queryParams.set("limit", limit);
6237
6237
  queryParams.set("cursor", cursor);
6238
6238
  queryParams.set("transaction_id", transactionId);
6239
+ queryParams.set("page", page);
6239
6240
  let bodyJson = "";
6240
6241
  const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
6241
6242
  const fetchOptions = buildFetchOptions("GET", options, bodyJson);
@@ -7155,6 +7156,8 @@ var _DefaultSocket = class _DefaultSocket {
7155
7156
  this.onroleevent(message.role_event);
7156
7157
  } else if (message.event_emoji) {
7157
7158
  this.oneventemoji(message.event_emoji);
7159
+ } else if (message.webhook_event) {
7160
+ this.oneventwebhook(message.webhook_event);
7158
7161
  } else if (message.channel_deleted_event) {
7159
7162
  this.onchanneldeleted(message.channel_deleted_event);
7160
7163
  } else if (message.clan_deleted_event) {
@@ -7498,6 +7501,11 @@ var _DefaultSocket = class _DefaultSocket {
7498
7501
  console.log(eventEmoji);
7499
7502
  }
7500
7503
  }
7504
+ oneventwebhook(webhook_event) {
7505
+ if (this.verbose && window && window.console) {
7506
+ console.log(webhook_event);
7507
+ }
7508
+ }
7501
7509
  onchanneldeleted(channelDeleted) {
7502
7510
  if (this.verbose && window && window.console) {
7503
7511
  console.log(channelDeleted);
@@ -8036,12 +8044,13 @@ var ChannelType = /* @__PURE__ */ ((ChannelType2) => {
8036
8044
  ChannelType2[ChannelType2["CHANNEL_TYPE_CHANNEL"] = 1] = "CHANNEL_TYPE_CHANNEL";
8037
8045
  ChannelType2[ChannelType2["CHANNEL_TYPE_GROUP"] = 2] = "CHANNEL_TYPE_GROUP";
8038
8046
  ChannelType2[ChannelType2["CHANNEL_TYPE_DM"] = 3] = "CHANNEL_TYPE_DM";
8039
- ChannelType2[ChannelType2["CHANNEL_TYPE_VOICE"] = 4] = "CHANNEL_TYPE_VOICE";
8047
+ ChannelType2[ChannelType2["CHANNEL_TYPE_GMEET_VOICE"] = 4] = "CHANNEL_TYPE_GMEET_VOICE";
8040
8048
  ChannelType2[ChannelType2["CHANNEL_TYPE_FORUM"] = 5] = "CHANNEL_TYPE_FORUM";
8041
8049
  ChannelType2[ChannelType2["CHANNEL_TYPE_STREAMING"] = 6] = "CHANNEL_TYPE_STREAMING";
8042
8050
  ChannelType2[ChannelType2["CHANNEL_TYPE_THREAD"] = 7] = "CHANNEL_TYPE_THREAD";
8043
8051
  ChannelType2[ChannelType2["CHANNEL_TYPE_APP"] = 8] = "CHANNEL_TYPE_APP";
8044
8052
  ChannelType2[ChannelType2["CHANNEL_TYPE_ANNOUNCEMENT"] = 9] = "CHANNEL_TYPE_ANNOUNCEMENT";
8053
+ ChannelType2[ChannelType2["CHANNEL_TYPE_MEZON_VOICE"] = 10] = "CHANNEL_TYPE_MEZON_VOICE";
8045
8054
  return ChannelType2;
8046
8055
  })(ChannelType || {});
8047
8056
  var ChannelStreamMode = /* @__PURE__ */ ((ChannelStreamMode2) => {
@@ -10560,12 +10569,12 @@ var Client = class {
10560
10569
  });
10561
10570
  }
10562
10571
  //**list wallet ledger */
10563
- listWalletLedger(session, limit, cursor, transactionId) {
10572
+ listWalletLedger(session, limit, cursor, transactionId, page) {
10564
10573
  return __async(this, null, function* () {
10565
10574
  if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
10566
10575
  yield this.sessionRefresh(session);
10567
10576
  }
10568
- return this.apiClient.listWalletLedger(session.token, limit, cursor, transactionId).then((response) => {
10577
+ return this.apiClient.listWalletLedger(session.token, limit, cursor, transactionId, page).then((response) => {
10569
10578
  return Promise.resolve(response);
10570
10579
  });
10571
10580
  });
@@ -6196,12 +6196,13 @@ var MezonApi = class {
6196
6196
  ]);
6197
6197
  }
6198
6198
  /** Get user status */
6199
- listWalletLedger(bearerToken, limit, cursor, transactionId, options = {}) {
6199
+ listWalletLedger(bearerToken, limit, cursor, transactionId, page, options = {}) {
6200
6200
  const urlPath = "/v2/walletledger";
6201
6201
  const queryParams = /* @__PURE__ */ new Map();
6202
6202
  queryParams.set("limit", limit);
6203
6203
  queryParams.set("cursor", cursor);
6204
6204
  queryParams.set("transaction_id", transactionId);
6205
+ queryParams.set("page", page);
6205
6206
  let bodyJson = "";
6206
6207
  const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
6207
6208
  const fetchOptions = buildFetchOptions("GET", options, bodyJson);
@@ -7121,6 +7122,8 @@ var _DefaultSocket = class _DefaultSocket {
7121
7122
  this.onroleevent(message.role_event);
7122
7123
  } else if (message.event_emoji) {
7123
7124
  this.oneventemoji(message.event_emoji);
7125
+ } else if (message.webhook_event) {
7126
+ this.oneventwebhook(message.webhook_event);
7124
7127
  } else if (message.channel_deleted_event) {
7125
7128
  this.onchanneldeleted(message.channel_deleted_event);
7126
7129
  } else if (message.clan_deleted_event) {
@@ -7464,6 +7467,11 @@ var _DefaultSocket = class _DefaultSocket {
7464
7467
  console.log(eventEmoji);
7465
7468
  }
7466
7469
  }
7470
+ oneventwebhook(webhook_event) {
7471
+ if (this.verbose && window && window.console) {
7472
+ console.log(webhook_event);
7473
+ }
7474
+ }
7467
7475
  onchanneldeleted(channelDeleted) {
7468
7476
  if (this.verbose && window && window.console) {
7469
7477
  console.log(channelDeleted);
@@ -8002,12 +8010,13 @@ var ChannelType = /* @__PURE__ */ ((ChannelType2) => {
8002
8010
  ChannelType2[ChannelType2["CHANNEL_TYPE_CHANNEL"] = 1] = "CHANNEL_TYPE_CHANNEL";
8003
8011
  ChannelType2[ChannelType2["CHANNEL_TYPE_GROUP"] = 2] = "CHANNEL_TYPE_GROUP";
8004
8012
  ChannelType2[ChannelType2["CHANNEL_TYPE_DM"] = 3] = "CHANNEL_TYPE_DM";
8005
- ChannelType2[ChannelType2["CHANNEL_TYPE_VOICE"] = 4] = "CHANNEL_TYPE_VOICE";
8013
+ ChannelType2[ChannelType2["CHANNEL_TYPE_GMEET_VOICE"] = 4] = "CHANNEL_TYPE_GMEET_VOICE";
8006
8014
  ChannelType2[ChannelType2["CHANNEL_TYPE_FORUM"] = 5] = "CHANNEL_TYPE_FORUM";
8007
8015
  ChannelType2[ChannelType2["CHANNEL_TYPE_STREAMING"] = 6] = "CHANNEL_TYPE_STREAMING";
8008
8016
  ChannelType2[ChannelType2["CHANNEL_TYPE_THREAD"] = 7] = "CHANNEL_TYPE_THREAD";
8009
8017
  ChannelType2[ChannelType2["CHANNEL_TYPE_APP"] = 8] = "CHANNEL_TYPE_APP";
8010
8018
  ChannelType2[ChannelType2["CHANNEL_TYPE_ANNOUNCEMENT"] = 9] = "CHANNEL_TYPE_ANNOUNCEMENT";
8019
+ ChannelType2[ChannelType2["CHANNEL_TYPE_MEZON_VOICE"] = 10] = "CHANNEL_TYPE_MEZON_VOICE";
8011
8020
  return ChannelType2;
8012
8021
  })(ChannelType || {});
8013
8022
  var ChannelStreamMode = /* @__PURE__ */ ((ChannelStreamMode2) => {
@@ -10526,12 +10535,12 @@ var Client = class {
10526
10535
  });
10527
10536
  }
10528
10537
  //**list wallet ledger */
10529
- listWalletLedger(session, limit, cursor, transactionId) {
10538
+ listWalletLedger(session, limit, cursor, transactionId, page) {
10530
10539
  return __async(this, null, function* () {
10531
10540
  if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
10532
10541
  yield this.sessionRefresh(session);
10533
10542
  }
10534
- return this.apiClient.listWalletLedger(session.token, limit, cursor, transactionId).then((response) => {
10543
+ return this.apiClient.listWalletLedger(session.token, limit, cursor, transactionId, page).then((response) => {
10535
10544
  return Promise.resolve(response);
10536
10545
  });
10537
10546
  });
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, ApiPermissionUpdate, ApiRole, ApiRpc, ApiTokenSentEvent, ApiUserActivity } from "./api.gen";
16
+ import { ApiChannelMessageHeader, ApiCreateEventRequest, ApiGiveCoffeeEvent, ApiMessageAttachment, ApiMessageMention, ApiMessageReaction, ApiMessageRef, ApiPermissionUpdate, ApiRole, ApiRpc, ApiTokenSentEvent, ApiUserActivity, ApiWebhook } from "./api.gen";
17
17
  import { Session } from "./session";
18
18
  import { ChannelMessage, Notification } from "./client";
19
19
  import { WebSocketAdapter } from "./web_socket_adapter";
@@ -770,6 +770,7 @@ export interface Socket {
770
770
  oneventcreated: (clan_event_created: ApiCreateEventRequest) => void;
771
771
  oncoffeegiven: (give_coffee_event: ApiGiveCoffeeEvent) => void;
772
772
  oneventemoji: (event_emoji: EventEmoji) => void;
773
+ oneventwebhook: (webhook_event: ApiWebhook) => void;
773
774
  onroleassign: (role_assign_event: RoleAssignedEvent) => void;
774
775
  onstreamingchannelstarted: (streaming_started_event: StreamingStartedEvent) => void;
775
776
  onstreamingchannelended: (streaming_ended_event: StreamingEndedEvent) => void;
@@ -834,6 +835,7 @@ export declare class DefaultSocket implements Socket {
834
835
  onchannelcreated(channelCreated: ChannelCreatedEvent): void;
835
836
  onroleevent(roleEvent: RoleEvent): void;
836
837
  oneventemoji(eventEmoji: EventEmoji): void;
838
+ oneventwebhook(webhook_event: ApiWebhook): void;
837
839
  onchanneldeleted(channelDeleted: ChannelDeletedEvent): void;
838
840
  onclandeleted(clanDeleted: ClanDeletedEvent): void;
839
841
  onstickercreated(stickerCreated: StickerCreateEvent): void;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mezon-js",
3
3
 
4
- "version": "2.10.70",
4
+ "version": "2.10.73",
5
5
 
6
6
  "scripts": {
7
7
  "build": "npx tsc && npx rollup -c --bundleConfigAsCjs && node build.mjs"
package/socket.ts CHANGED
@@ -28,6 +28,7 @@ import {
28
28
  ApiRpc,
29
29
  ApiTokenSentEvent,
30
30
  ApiUserActivity,
31
+ ApiWebhook,
31
32
  } from "./api.gen";
32
33
  import { Session } from "./session";
33
34
  import { ChannelMessage, Notification } from "./client";
@@ -1256,6 +1257,8 @@ export interface Socket {
1256
1257
 
1257
1258
  oneventemoji: (event_emoji: EventEmoji) => void;
1258
1259
 
1260
+ oneventwebhook: (webhook_event: ApiWebhook) => void;
1261
+
1259
1262
  onroleassign: (role_assign_event: RoleAssignedEvent) => void;
1260
1263
 
1261
1264
  onstreamingchannelstarted: (
@@ -1387,6 +1390,8 @@ export class DefaultSocket implements Socket {
1387
1390
  this.onroleevent(message.role_event);
1388
1391
  } else if (message.event_emoji) {
1389
1392
  this.oneventemoji(message.event_emoji);
1393
+ } else if (message.webhook_event) {
1394
+ this.oneventwebhook(message.webhook_event);
1390
1395
  } else if (message.channel_deleted_event) {
1391
1396
  this.onchanneldeleted(message.channel_deleted_event);
1392
1397
  } else if (message.clan_deleted_event) {
@@ -1761,6 +1766,12 @@ export class DefaultSocket implements Socket {
1761
1766
  }
1762
1767
  }
1763
1768
 
1769
+ oneventwebhook(webhook_event: ApiWebhook) {
1770
+ if (this.verbose && window && window.console) {
1771
+ console.log(webhook_event);
1772
+ }
1773
+ }
1774
+
1764
1775
  onchanneldeleted(channelDeleted: ChannelDeletedEvent) {
1765
1776
  if (this.verbose && window && window.console) {
1766
1777
  console.log(channelDeleted);