mezon-js 2.12.78 → 2.12.80

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
@@ -400,7 +400,7 @@ export interface ApiAccountEmail {
400
400
 
401
401
  /** Send a Mezon token to the server. Used with authenticate/link/unlink. */
402
402
  export interface ApiAccountMezon {
403
- //The OAuth token received from Google to access their profile API.
403
+ //The phone number
404
404
  token?: string;
405
405
  //Extra information that will be bundled in the session token.
406
406
  vars?: Record<string, string>;
@@ -2569,6 +2569,8 @@ export interface ApiUpdateAccountRequest {
2569
2569
  timezone?: string;
2570
2570
  //The username of the user's account.
2571
2571
  username?: string;
2572
+ //The email of the user's account.
2573
+ email?: string;
2572
2574
  }
2573
2575
 
2574
2576
  /** */
@@ -2638,8 +2640,6 @@ export interface ApiUploadAttachmentRequest {
2638
2640
  export interface ApiUser {
2639
2641
  //
2640
2642
  about_me?: string;
2641
- //The Apple Sign In ID in the user's account.
2642
- apple_id?: string;
2643
2643
  //A URL for an avatar image.
2644
2644
  avatar_url?: string;
2645
2645
  //
@@ -2650,12 +2650,6 @@ export interface ApiUser {
2650
2650
  display_name?: string;
2651
2651
  //Number of related edges to this user.
2652
2652
  edge_count?: number;
2653
- //The Facebook id in the user's account.
2654
- facebook_id?: string;
2655
- //The Apple Game Center in of the user's account.
2656
- gamecenter_id?: string;
2657
- //The Google id in the user's account.
2658
- google_id?: string;
2659
2653
  //The id of the user's account.
2660
2654
  id?: string;
2661
2655
  //
@@ -2670,14 +2664,14 @@ export interface ApiUser {
2670
2664
  metadata?: string;
2671
2665
  //Indicates whether the user is currently online.
2672
2666
  online?: boolean;
2673
- //The Steam id in the user's account.
2674
- steam_id?: string;
2675
2667
  //The timezone set by the user.
2676
2668
  timezone?: string;
2677
2669
  //The UNIX time (for gRPC clients) or ISO string (for REST clients) when the user was last updated.
2678
2670
  update_time?: string;
2679
2671
  //The username of the user's account.
2680
2672
  username?: string;
2673
+ // mezon_id
2674
+ mezon_id?: string;
2681
2675
  // list nick name
2682
2676
  list_nick_names?: Array<string>;
2683
2677
  }
@@ -2800,6 +2794,14 @@ export interface ApiVoiceChannelUserList {
2800
2794
  voice_channel_users?: Array<ApiVoiceChannelUser>;
2801
2795
  }
2802
2796
 
2797
+ /** */
2798
+ export interface ApiStoreWalletKeyRequest {
2799
+ //
2800
+ address?: string;
2801
+ //
2802
+ enc_privkey?: string;
2803
+ }
2804
+
2803
2805
  /** */
2804
2806
  export interface ApiWalletLedger {
2805
2807
  //
@@ -3319,6 +3321,16 @@ export interface ApiIsFollowerRequest {
3319
3321
  follow_id?: string;
3320
3322
  }
3321
3323
 
3324
+ /** */
3325
+ export interface ApiLinkAccountConfirmRequest {
3326
+ //
3327
+ otp_code?: string;
3328
+ //
3329
+ req_id?: string;
3330
+ //
3331
+ status?: number;
3332
+ }
3333
+
3322
3334
  /** */
3323
3335
  export interface ApiIsFollowerResponse {
3324
3336
  //
@@ -3723,7 +3735,7 @@ export class MezonApi {
3723
3735
  /** Add a mezon ID to the social profiles on the current user's account. */
3724
3736
  linkMezon(bearerToken: string,
3725
3737
  body:ApiAccountMezon,
3726
- options: any = {}): Promise<any> {
3738
+ options: any = {}): Promise<ApiLinkAccountConfirmRequest> {
3727
3739
 
3728
3740
  if (body === null || body === undefined) {
3729
3741
  throw new Error("'body' is a required parameter but is null or undefined.");
@@ -3756,6 +3768,42 @@ export class MezonApi {
3756
3768
  ]);
3757
3769
  }
3758
3770
 
3771
+ /** */
3772
+ confirmLinkMezonOTP(bearerToken: string,
3773
+ body:ApiLinkAccountConfirmRequest,
3774
+ options: any = {}): Promise<any> {
3775
+
3776
+ if (body === null || body === undefined) {
3777
+ throw new Error("'body' is a required parameter but is null or undefined.");
3778
+ }
3779
+ const urlPath = "/v2/account/link/confirm";
3780
+ const queryParams = new Map<string, any>();
3781
+
3782
+ let bodyJson : string = "";
3783
+ bodyJson = JSON.stringify(body || {});
3784
+
3785
+ const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
3786
+ const fetchOptions = buildFetchOptions("POST", options, bodyJson);
3787
+ if (bearerToken) {
3788
+ fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
3789
+ }
3790
+
3791
+ return Promise.race([
3792
+ fetch(fullUrl, fetchOptions).then((response) => {
3793
+ if (response.status == 204) {
3794
+ return response;
3795
+ } else if (response.status >= 200 && response.status < 300) {
3796
+ return response.json();
3797
+ } else {
3798
+ throw response;
3799
+ }
3800
+ }),
3801
+ new Promise((_, reject) =>
3802
+ setTimeout(reject, this.timeoutMs, "Request timed out.")
3803
+ ),
3804
+ ]);
3805
+ }
3806
+
3759
3807
  /** Authenticate a user with an email+password against the server. */
3760
3808
  registrationEmail(
3761
3809
  bearerToken: string,
@@ -9549,6 +9597,42 @@ export class MezonApi {
9549
9597
  ]);
9550
9598
  }
9551
9599
 
9600
+ /** Store wallet key */
9601
+ storeWalletKey(bearerToken: string,
9602
+ body:ApiStoreWalletKeyRequest,
9603
+ options: any = {}): Promise<any> {
9604
+
9605
+ if (body === null || body === undefined) {
9606
+ throw new Error("'body' is a required parameter but is null or undefined.");
9607
+ }
9608
+ const urlPath = "/v2/wallet/key";
9609
+ const queryParams = new Map<string, any>();
9610
+
9611
+ let bodyJson : string = "";
9612
+ bodyJson = JSON.stringify(body || {});
9613
+
9614
+ const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
9615
+ const fetchOptions = buildFetchOptions("POST", options, bodyJson);
9616
+ if (bearerToken) {
9617
+ fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
9618
+ }
9619
+
9620
+ return Promise.race([
9621
+ fetch(fullUrl, fetchOptions).then((response) => {
9622
+ if (response.status == 204) {
9623
+ return response;
9624
+ } else if (response.status >= 200 && response.status < 300) {
9625
+ return response.json();
9626
+ } else {
9627
+ throw response;
9628
+ }
9629
+ }),
9630
+ new Promise((_, reject) =>
9631
+ setTimeout(reject, this.timeoutMs, "Request timed out.")
9632
+ ),
9633
+ ]);
9634
+ }
9635
+
9552
9636
  /** Get user status */
9553
9637
  listWalletLedger(bearerToken: string,
9554
9638
  limit?:number,
package/client.ts CHANGED
@@ -172,6 +172,8 @@ import {
172
172
  ApiIsFollowerRequest,
173
173
  ApiTransferOwnershipRequest,
174
174
  ApiMeetParticipantRequest,
175
+ ApiStoreWalletKeyRequest,
176
+ ApiLinkAccountConfirmRequest,
175
177
  } from "./api.gen";
176
178
 
177
179
  import { Session } from "./session";
@@ -1169,14 +1171,10 @@ export class Client {
1169
1171
  create_time: u.create_time,
1170
1172
  display_name: u.display_name,
1171
1173
  edge_count: u.edge_count ? Number(u.edge_count) : 0,
1172
- facebook_id: u.facebook_id,
1173
- gamecenter_id: u.gamecenter_id,
1174
- google_id: u.google_id,
1175
1174
  id: u.id,
1176
1175
  lang_tag: u.lang_tag,
1177
1176
  location: u.location,
1178
1177
  online: u.online,
1179
- steam_id: u.steam_id,
1180
1178
  timezone: u.timezone,
1181
1179
  update_time: u.update_time,
1182
1180
  username: u.username,
@@ -1518,15 +1516,11 @@ export class Client {
1518
1516
  create_time: gu.user!.create_time,
1519
1517
  display_name: gu.user!.display_name,
1520
1518
  edge_count: gu.user!.edge_count ? Number(gu.user!.edge_count) : 0,
1521
- facebook_id: gu.user!.facebook_id,
1522
- gamecenter_id: gu.user!.gamecenter_id,
1523
- google_id: gu.user!.google_id,
1524
1519
  id: gu.user!.id,
1525
1520
  lang_tag: gu.user!.lang_tag,
1526
1521
  location: gu.user!.location,
1527
1522
  online: gu.user!.online,
1528
1523
  is_mobile: gu.user?.is_mobile,
1529
- steam_id: gu.user!.steam_id,
1530
1524
  timezone: gu.user!.timezone,
1531
1525
  update_time: gu.user!.update_time,
1532
1526
  username: gu.user!.username,
@@ -1804,11 +1798,30 @@ export class Client {
1804
1798
  });
1805
1799
  }
1806
1800
 
1801
+ async confirmLinkMezonOTP(
1802
+ session: Session,
1803
+ request: ApiLinkAccountConfirmRequest,
1804
+ ): Promise<any> {
1805
+ if (
1806
+ this.autoRefreshSession &&
1807
+ session.refresh_token &&
1808
+ session.isexpired(Date.now() / 1000)
1809
+ ) {
1810
+ await this.sessionRefresh(session);
1811
+ }
1812
+
1813
+ return this.apiClient
1814
+ .confirmLinkMezonOTP(session.token, request)
1815
+ .then((response: any) => {
1816
+ return response !== undefined;
1817
+ });
1818
+ }
1819
+
1807
1820
  /** Add a custom ID to the social profiles on the current user's account. */
1808
1821
  async linkMezon(
1809
1822
  session: Session,
1810
1823
  request: ApiAccountMezon
1811
- ): Promise<boolean> {
1824
+ ): Promise<ApiLinkAccountConfirmRequest> {
1812
1825
  if (
1813
1826
  this.autoRefreshSession &&
1814
1827
  session.refresh_token &&
@@ -1819,8 +1832,8 @@ export class Client {
1819
1832
 
1820
1833
  return this.apiClient
1821
1834
  .linkMezon(session.token, request)
1822
- .then((response: any) => {
1823
- return response !== undefined;
1835
+ .then((response: ApiLinkAccountConfirmRequest) => {
1836
+ return Promise.resolve(response);
1824
1837
  });
1825
1838
  }
1826
1839
 
@@ -1877,15 +1890,11 @@ export class Client {
1877
1890
  avatar_url: f.user!.avatar_url,
1878
1891
  create_time: f.user!.create_time,
1879
1892
  display_name: f.user!.display_name,
1880
- edge_count: f.user!.edge_count ? Number(f.user!.edge_count) : 0,
1881
- facebook_id: f.user!.facebook_id,
1882
- gamecenter_id: f.user!.gamecenter_id,
1883
- google_id: f.user!.google_id,
1893
+ edge_count: f.user!.edge_count ? Number(f.user!.edge_count) : 0,
1884
1894
  id: f.user!.id,
1885
1895
  lang_tag: f.user!.lang_tag,
1886
1896
  location: f.user!.location,
1887
1897
  online: f.user!.online,
1888
- steam_id: f.user!.steam_id,
1889
1898
  timezone: f.user!.timezone,
1890
1899
  update_time: f.user!.update_time,
1891
1900
  username: f.user!.username,
@@ -4899,4 +4908,21 @@ export class Client {
4899
4908
  });
4900
4909
  }
4901
4910
 
4911
+ async createMmnWallet(session: Session,
4912
+ req: ApiStoreWalletKeyRequest): Promise<any> {
4913
+ if (
4914
+ this.autoRefreshSession &&
4915
+ session.refresh_token &&
4916
+ session.isexpired(Date.now() / 1000)
4917
+ ) {
4918
+ await this.sessionRefresh(session);
4919
+ }
4920
+
4921
+ return this.apiClient
4922
+ .storeWalletKey(session.token, req)
4923
+ .then((response: any) => {
4924
+ return response !== undefined;
4925
+ });
4926
+ }
4927
+
4902
4928
  }
package/dist/api.gen.d.ts CHANGED
@@ -1468,6 +1468,7 @@ export interface ApiUpdateAccountRequest {
1468
1468
  splash_screen?: string;
1469
1469
  timezone?: string;
1470
1470
  username?: string;
1471
+ email?: string;
1471
1472
  }
1472
1473
  /** */
1473
1474
  export interface ApiUpdateCategoryDescRequest {
@@ -1510,15 +1511,11 @@ export interface ApiUploadAttachmentRequest {
1510
1511
  /** A user in the server. */
1511
1512
  export interface ApiUser {
1512
1513
  about_me?: string;
1513
- apple_id?: string;
1514
1514
  avatar_url?: string;
1515
1515
  dob?: string;
1516
1516
  create_time?: string;
1517
1517
  display_name?: string;
1518
1518
  edge_count?: number;
1519
- facebook_id?: string;
1520
- gamecenter_id?: string;
1521
- google_id?: string;
1522
1519
  id?: string;
1523
1520
  is_mobile?: boolean;
1524
1521
  join_time?: string;
@@ -1526,10 +1523,10 @@ export interface ApiUser {
1526
1523
  location?: string;
1527
1524
  metadata?: string;
1528
1525
  online?: boolean;
1529
- steam_id?: string;
1530
1526
  timezone?: string;
1531
1527
  update_time?: string;
1532
1528
  username?: string;
1529
+ mezon_id?: string;
1533
1530
  list_nick_names?: Array<string>;
1534
1531
  }
1535
1532
  /** */
@@ -1602,6 +1599,11 @@ export interface ApiVoiceChannelUserList {
1602
1599
  voice_channel_users?: Array<ApiVoiceChannelUser>;
1603
1600
  }
1604
1601
  /** */
1602
+ export interface ApiStoreWalletKeyRequest {
1603
+ address?: string;
1604
+ enc_privkey?: string;
1605
+ }
1606
+ /** */
1605
1607
  export interface ApiWalletLedger {
1606
1608
  create_time?: string;
1607
1609
  id?: string;
@@ -1901,6 +1903,12 @@ export interface ApiIsFollowerRequest {
1901
1903
  follow_id?: string;
1902
1904
  }
1903
1905
  /** */
1906
+ export interface ApiLinkAccountConfirmRequest {
1907
+ otp_code?: string;
1908
+ req_id?: string;
1909
+ status?: number;
1910
+ }
1911
+ /** */
1904
1912
  export interface ApiIsFollowerResponse {
1905
1913
  is_follower?: boolean;
1906
1914
  follow_id?: string;
@@ -1937,7 +1945,9 @@ export declare class MezonApi {
1937
1945
  /** Add an email+password to the social profiles on the current user's account. */
1938
1946
  linkEmail(bearerToken: string, body: ApiAccountEmail, options?: any): Promise<any>;
1939
1947
  /** Add a mezon ID to the social profiles on the current user's account. */
1940
- linkMezon(bearerToken: string, body: ApiAccountMezon, options?: any): Promise<any>;
1948
+ linkMezon(bearerToken: string, body: ApiAccountMezon, options?: any): Promise<ApiLinkAccountConfirmRequest>;
1949
+ /** */
1950
+ confirmLinkMezonOTP(bearerToken: string, body: ApiLinkAccountConfirmRequest, options?: any): Promise<any>;
1941
1951
  /** Authenticate a user with an email+password against the server. */
1942
1952
  registrationEmail(bearerToken: string, body: ApiRegistrationEmailRequest, options?: any): Promise<ApiSession>;
1943
1953
  /** Refresh a user's session using a refresh token retrieved from a previous authentication request. */
@@ -2228,6 +2238,8 @@ export declare class MezonApi {
2228
2238
  updateUserStatus(bearerToken: string, body: ApiUserStatusUpdate, options?: any): Promise<any>;
2229
2239
  /** list transaction detail */
2230
2240
  listTransactionDetail(bearerToken: string, transId: string, options?: any): Promise<ApiTransactionDetail>;
2241
+ /** Store wallet key */
2242
+ storeWalletKey(bearerToken: string, body: ApiStoreWalletKeyRequest, options?: any): Promise<any>;
2231
2243
  /** Get user status */
2232
2244
  listWalletLedger(bearerToken: string, limit?: number, filter?: number, transactionId?: string, page?: number, options?: any): Promise<ApiWalletLedgerList>;
2233
2245
  /** create webhook */
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, ApiAccountMezon, ApiAccountEmail, ApiChannelDescList, ApiChannelDescription, ApiCreateChannelDescRequest, ApiDeleteRoleRequest, ApiClanDescList, ApiCreateClanDescRequest, ApiClanDesc, ApiCategoryDesc, ApiCategoryDescList, ApiPermissionList, ApiRoleUserList, ApiRole, ApiCreateRoleRequest, ApiAddRoleChannelDescRequest, ApiCreateCategoryDescRequest, ApiUpdateCategoryDescRequest, ApiEvent, ApiNotificationList, ApiUpdateAccountRequest, ApiSession, ApiClanProfile, ApiChannelUserList, ApiClanUserList, ApiLinkInviteUserRequest, ApiLinkInviteUser, ApiInviteUserRes, ApiUploadAttachmentRequest, ApiUploadAttachment, ApiMessageReaction, ApiMessageMention, ApiMessageAttachment, ApiMessageRef, ApiChannelMessageHeader, ApiVoiceChannelUserList, ApiChannelAttachmentList, ApiCreateEventRequest, ApiEventManagement, ApiEventList, ApiDeleteEventRequest, ApiSetDefaultNotificationRequest, ApiSetNotificationRequest, ApiSetMuteNotificationRequest, ApiSearchMessageRequest, ApiSearchMessageResponse, ApiPinMessageRequest, ApiPinMessagesList, ApiDeleteChannelDescRequest, ApiChangeChannelPrivateRequest, ApiClanEmojiCreateRequest, MezonUpdateClanEmojiByIdBody, ApiWebhookCreateRequest, ApiWebhookListResponse, MezonUpdateWebhookByIdBody, ApiWebhookGenerateResponse, ApiCheckDuplicateClanNameResponse, ApiClanStickerAddRequest, MezonUpdateClanStickerByIdBody, MezonChangeChannelCategoryBody, ApiUpdateRoleChannelRequest, ApiAddAppRequest, ApiAppList, ApiApp, MezonUpdateAppBody, ApiSystemMessagesList, ApiSystemMessage, ApiSystemMessageRequest, MezonUpdateSystemMessageBody, ApiUpdateCategoryOrderRequest, ApiGiveCoffeeEvent, ApiListStreamingChannelsResponse, ApiStreamingChannelUserList, ApiRegisterStreamingChannelRequest, ApiRoleList, ApiListChannelAppsResponse, ApiNotificationChannelCategorySettingList, ApiNotificationUserChannel, ApiNotificationSetting, ApiNotifiReactMessage, ApiHashtagDmList, ApiEmojiListedResponse, ApiStickerListedResponse, ApiAllUsersAddChannelResponse, ApiRoleListEventResponse, ApiAllUserClans, ApiUserPermissionInChannelListResponse, ApiPermissionRoleChannelListEventResponse, ApiMarkAsReadRequest, ApiChannelCanvasListResponse, ApiEditChannelCanvasRequest, ApiChannelSettingListResponse, ApiAddFavoriteChannelResponse, ApiRegistFcmDeviceTokenResponse, ApiListUserActivity, ApiCreateActivityRequest, ApiLoginIDResponse, ApiLoginRequest, ApiConfirmLoginRequest, ApiUserActivity, ApiChanEncryptionMethod, ApiGetPubKeysResponse, ApiPubKey, ApiGetKeyServerResp, MezonapiListAuditLog, ApiTokenSentEvent, MezonDeleteWebhookByIdBody, ApiListOnboardingResponse, ApiCreateOnboardingRequest, MezonUpdateOnboardingBody, ApiOnboardingItem, ApiGenerateClanWebhookRequest, ApiGenerateClanWebhookResponse, ApiListClanWebhookResponse, MezonUpdateClanWebhookByIdBody, MezonUpdateClanDescBody, ApiUserStatusUpdate, ApiUserStatus, ApiListOnboardingStepResponse, MezonUpdateOnboardingStepByClanIdBody, ApiWalletLedgerList, ApiSdTopicList, ApiSdTopicRequest, ApiSdTopic, MezonUpdateEventBody, ApiTransactionDetail, MezonapiCreateRoomChannelApps, ApiGenerateMeetTokenRequest, ApiGenerateMeetTokenResponse, ApiMezonOauthClientList, ApiMezonOauthClient, ApiCreateHashChannelAppsResponse, ApiEmojiRecentList, ApiUserEventRequest, ApiUpdateRoleOrderRequest, ApiGenerateMezonMeetResponse, ApiGenerateMeetTokenExternalResponse, ApiUpdateClanOrderRequest, ApiMessage2InboxRequest, ApiListClanDiscover, ApiClanDiscoverRequest, ApiQuickMenuAccessList, ApiQuickMenuAccessRequest, ApiUnlockedItemRequest, ApiForSaleItemList, ApiUnlockedItemResponse, ApiIsFollowerResponse, ApiIsFollowerRequest, ApiTransferOwnershipRequest, ApiMeetParticipantRequest } from "./api.gen";
16
+ import { ApiAccount, ApiAccountMezon, ApiAccountEmail, ApiChannelDescList, ApiChannelDescription, ApiCreateChannelDescRequest, ApiDeleteRoleRequest, ApiClanDescList, ApiCreateClanDescRequest, ApiClanDesc, ApiCategoryDesc, ApiCategoryDescList, ApiPermissionList, ApiRoleUserList, ApiRole, ApiCreateRoleRequest, ApiAddRoleChannelDescRequest, ApiCreateCategoryDescRequest, ApiUpdateCategoryDescRequest, ApiEvent, ApiNotificationList, ApiUpdateAccountRequest, ApiSession, ApiClanProfile, ApiChannelUserList, ApiClanUserList, ApiLinkInviteUserRequest, ApiLinkInviteUser, ApiInviteUserRes, ApiUploadAttachmentRequest, ApiUploadAttachment, ApiMessageReaction, ApiMessageMention, ApiMessageAttachment, ApiMessageRef, ApiChannelMessageHeader, ApiVoiceChannelUserList, ApiChannelAttachmentList, ApiCreateEventRequest, ApiEventManagement, ApiEventList, ApiDeleteEventRequest, ApiSetDefaultNotificationRequest, ApiSetNotificationRequest, ApiSetMuteNotificationRequest, ApiSearchMessageRequest, ApiSearchMessageResponse, ApiPinMessageRequest, ApiPinMessagesList, ApiDeleteChannelDescRequest, ApiChangeChannelPrivateRequest, ApiClanEmojiCreateRequest, MezonUpdateClanEmojiByIdBody, ApiWebhookCreateRequest, ApiWebhookListResponse, MezonUpdateWebhookByIdBody, ApiWebhookGenerateResponse, ApiCheckDuplicateClanNameResponse, ApiClanStickerAddRequest, MezonUpdateClanStickerByIdBody, MezonChangeChannelCategoryBody, ApiUpdateRoleChannelRequest, ApiAddAppRequest, ApiAppList, ApiApp, MezonUpdateAppBody, ApiSystemMessagesList, ApiSystemMessage, ApiSystemMessageRequest, MezonUpdateSystemMessageBody, ApiUpdateCategoryOrderRequest, ApiGiveCoffeeEvent, ApiListStreamingChannelsResponse, ApiStreamingChannelUserList, ApiRegisterStreamingChannelRequest, ApiRoleList, ApiListChannelAppsResponse, ApiNotificationChannelCategorySettingList, ApiNotificationUserChannel, ApiNotificationSetting, ApiNotifiReactMessage, ApiHashtagDmList, ApiEmojiListedResponse, ApiStickerListedResponse, ApiAllUsersAddChannelResponse, ApiRoleListEventResponse, ApiAllUserClans, ApiUserPermissionInChannelListResponse, ApiPermissionRoleChannelListEventResponse, ApiMarkAsReadRequest, ApiChannelCanvasListResponse, ApiEditChannelCanvasRequest, ApiChannelSettingListResponse, ApiAddFavoriteChannelResponse, ApiRegistFcmDeviceTokenResponse, ApiListUserActivity, ApiCreateActivityRequest, ApiLoginIDResponse, ApiLoginRequest, ApiConfirmLoginRequest, ApiUserActivity, ApiChanEncryptionMethod, ApiGetPubKeysResponse, ApiPubKey, ApiGetKeyServerResp, MezonapiListAuditLog, ApiTokenSentEvent, MezonDeleteWebhookByIdBody, ApiListOnboardingResponse, ApiCreateOnboardingRequest, MezonUpdateOnboardingBody, ApiOnboardingItem, ApiGenerateClanWebhookRequest, ApiGenerateClanWebhookResponse, ApiListClanWebhookResponse, MezonUpdateClanWebhookByIdBody, MezonUpdateClanDescBody, ApiUserStatusUpdate, ApiUserStatus, ApiListOnboardingStepResponse, MezonUpdateOnboardingStepByClanIdBody, ApiWalletLedgerList, ApiSdTopicList, ApiSdTopicRequest, ApiSdTopic, MezonUpdateEventBody, ApiTransactionDetail, MezonapiCreateRoomChannelApps, ApiGenerateMeetTokenRequest, ApiGenerateMeetTokenResponse, ApiMezonOauthClientList, ApiMezonOauthClient, ApiCreateHashChannelAppsResponse, ApiEmojiRecentList, ApiUserEventRequest, ApiUpdateRoleOrderRequest, ApiGenerateMezonMeetResponse, ApiGenerateMeetTokenExternalResponse, ApiUpdateClanOrderRequest, ApiMessage2InboxRequest, ApiListClanDiscover, ApiClanDiscoverRequest, ApiQuickMenuAccessList, ApiQuickMenuAccessRequest, ApiUnlockedItemRequest, ApiForSaleItemList, ApiUnlockedItemResponse, ApiIsFollowerResponse, ApiIsFollowerRequest, ApiTransferOwnershipRequest, ApiMeetParticipantRequest, ApiStoreWalletKeyRequest, ApiLinkAccountConfirmRequest } from "./api.gen";
17
17
  import { Session } from "./session";
18
18
  import { Socket } from "./socket";
19
19
  import { WebSocketAdapter } from "./web_socket_adapter";
@@ -430,8 +430,9 @@ export declare class Client {
430
430
  getUserProfileOnClan(session: Session, clanId: string): Promise<ApiClanProfile>;
431
431
  closeDirectMess(session: Session, request: ApiDeleteChannelDescRequest): Promise<boolean>;
432
432
  openDirectMess(session: Session, request: ApiDeleteChannelDescRequest): Promise<boolean>;
433
+ confirmLinkMezonOTP(session: Session, request: ApiLinkAccountConfirmRequest): Promise<any>;
433
434
  /** Add a custom ID to the social profiles on the current user's account. */
434
- linkMezon(session: Session, request: ApiAccountMezon): Promise<boolean>;
435
+ linkMezon(session: Session, request: ApiAccountMezon): Promise<ApiLinkAccountConfirmRequest>;
435
436
  /** Add an email+password to the social profiles on the current user's account. */
436
437
  linkEmail(session: Session, request: ApiAccountEmail): Promise<boolean>;
437
438
  /** List all friends for the current user. */
@@ -621,4 +622,5 @@ export declare class Client {
621
622
  listForSaleItems(session: Session, page?: number): Promise<ApiForSaleItemList>;
622
623
  isFollower(session: Session, req: ApiIsFollowerRequest): Promise<ApiIsFollowerResponse>;
623
624
  transferOwnership(session: Session, req: ApiTransferOwnershipRequest): Promise<any>;
625
+ createMmnWallet(session: Session, req: ApiStoreWalletKeyRequest): Promise<any>;
624
626
  }
@@ -1055,6 +1055,35 @@ var MezonApi = class {
1055
1055
  )
1056
1056
  ]);
1057
1057
  }
1058
+ /** */
1059
+ confirmLinkMezonOTP(bearerToken, body, options = {}) {
1060
+ if (body === null || body === void 0) {
1061
+ throw new Error("'body' is a required parameter but is null or undefined.");
1062
+ }
1063
+ const urlPath = "/v2/account/link/confirm";
1064
+ const queryParams = /* @__PURE__ */ new Map();
1065
+ let bodyJson = "";
1066
+ bodyJson = JSON.stringify(body || {});
1067
+ const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
1068
+ const fetchOptions = buildFetchOptions("POST", options, bodyJson);
1069
+ if (bearerToken) {
1070
+ fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
1071
+ }
1072
+ return Promise.race([
1073
+ fetch(fullUrl, fetchOptions).then((response) => {
1074
+ if (response.status == 204) {
1075
+ return response;
1076
+ } else if (response.status >= 200 && response.status < 300) {
1077
+ return response.json();
1078
+ } else {
1079
+ throw response;
1080
+ }
1081
+ }),
1082
+ new Promise(
1083
+ (_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
1084
+ )
1085
+ ]);
1086
+ }
1058
1087
  /** Authenticate a user with an email+password against the server. */
1059
1088
  registrationEmail(bearerToken, body, options = {}) {
1060
1089
  if (body === null || body === void 0) {
@@ -5578,6 +5607,35 @@ var MezonApi = class {
5578
5607
  )
5579
5608
  ]);
5580
5609
  }
5610
+ /** Store wallet key */
5611
+ storeWalletKey(bearerToken, body, options = {}) {
5612
+ if (body === null || body === void 0) {
5613
+ throw new Error("'body' is a required parameter but is null or undefined.");
5614
+ }
5615
+ const urlPath = "/v2/wallet/key";
5616
+ const queryParams = /* @__PURE__ */ new Map();
5617
+ let bodyJson = "";
5618
+ bodyJson = JSON.stringify(body || {});
5619
+ const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
5620
+ const fetchOptions = buildFetchOptions("POST", options, bodyJson);
5621
+ if (bearerToken) {
5622
+ fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
5623
+ }
5624
+ return Promise.race([
5625
+ fetch(fullUrl, fetchOptions).then((response) => {
5626
+ if (response.status == 204) {
5627
+ return response;
5628
+ } else if (response.status >= 200 && response.status < 300) {
5629
+ return response.json();
5630
+ } else {
5631
+ throw response;
5632
+ }
5633
+ }),
5634
+ new Promise(
5635
+ (_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
5636
+ )
5637
+ ]);
5638
+ }
5581
5639
  /** Get user status */
5582
5640
  listWalletLedger(bearerToken, limit, filter, transactionId, page, options = {}) {
5583
5641
  const urlPath = "/v2/walletledger";
@@ -8571,14 +8629,10 @@ var Client = class {
8571
8629
  create_time: u.create_time,
8572
8630
  display_name: u.display_name,
8573
8631
  edge_count: u.edge_count ? Number(u.edge_count) : 0,
8574
- facebook_id: u.facebook_id,
8575
- gamecenter_id: u.gamecenter_id,
8576
- google_id: u.google_id,
8577
8632
  id: u.id,
8578
8633
  lang_tag: u.lang_tag,
8579
8634
  location: u.location,
8580
8635
  online: u.online,
8581
- steam_id: u.steam_id,
8582
8636
  timezone: u.timezone,
8583
8637
  update_time: u.update_time,
8584
8638
  username: u.username,
@@ -8826,15 +8880,11 @@ var Client = class {
8826
8880
  create_time: gu.user.create_time,
8827
8881
  display_name: gu.user.display_name,
8828
8882
  edge_count: gu.user.edge_count ? Number(gu.user.edge_count) : 0,
8829
- facebook_id: gu.user.facebook_id,
8830
- gamecenter_id: gu.user.gamecenter_id,
8831
- google_id: gu.user.google_id,
8832
8883
  id: gu.user.id,
8833
8884
  lang_tag: gu.user.lang_tag,
8834
8885
  location: gu.user.location,
8835
8886
  online: gu.user.online,
8836
8887
  is_mobile: (_a = gu.user) == null ? void 0 : _a.is_mobile,
8837
- steam_id: gu.user.steam_id,
8838
8888
  timezone: gu.user.timezone,
8839
8889
  update_time: gu.user.update_time,
8840
8890
  username: gu.user.username,
@@ -8999,6 +9049,16 @@ var Client = class {
8999
9049
  });
9000
9050
  });
9001
9051
  }
9052
+ confirmLinkMezonOTP(session, request) {
9053
+ return __async(this, null, function* () {
9054
+ if (this.autoRefreshSession && session.refresh_token && session.isexpired(Date.now() / 1e3)) {
9055
+ yield this.sessionRefresh(session);
9056
+ }
9057
+ return this.apiClient.confirmLinkMezonOTP(session.token, request).then((response) => {
9058
+ return response !== void 0;
9059
+ });
9060
+ });
9061
+ }
9002
9062
  /** Add a custom ID to the social profiles on the current user's account. */
9003
9063
  linkMezon(session, request) {
9004
9064
  return __async(this, null, function* () {
@@ -9006,7 +9066,7 @@ var Client = class {
9006
9066
  yield this.sessionRefresh(session);
9007
9067
  }
9008
9068
  return this.apiClient.linkMezon(session.token, request).then((response) => {
9009
- return response !== void 0;
9069
+ return Promise.resolve(response);
9010
9070
  });
9011
9071
  });
9012
9072
  }
@@ -9043,14 +9103,10 @@ var Client = class {
9043
9103
  create_time: f.user.create_time,
9044
9104
  display_name: f.user.display_name,
9045
9105
  edge_count: f.user.edge_count ? Number(f.user.edge_count) : 0,
9046
- facebook_id: f.user.facebook_id,
9047
- gamecenter_id: f.user.gamecenter_id,
9048
- google_id: f.user.google_id,
9049
9106
  id: f.user.id,
9050
9107
  lang_tag: f.user.lang_tag,
9051
9108
  location: f.user.location,
9052
9109
  online: f.user.online,
9053
- steam_id: f.user.steam_id,
9054
9110
  timezone: f.user.timezone,
9055
9111
  update_time: f.user.update_time,
9056
9112
  username: f.user.username,
@@ -10758,4 +10814,14 @@ var Client = class {
10758
10814
  });
10759
10815
  });
10760
10816
  }
10817
+ createMmnWallet(session, req) {
10818
+ return __async(this, null, function* () {
10819
+ if (this.autoRefreshSession && session.refresh_token && session.isexpired(Date.now() / 1e3)) {
10820
+ yield this.sessionRefresh(session);
10821
+ }
10822
+ return this.apiClient.storeWalletKey(session.token, req).then((response) => {
10823
+ return response !== void 0;
10824
+ });
10825
+ });
10826
+ }
10761
10827
  };
@@ -1021,6 +1021,35 @@ var MezonApi = class {
1021
1021
  )
1022
1022
  ]);
1023
1023
  }
1024
+ /** */
1025
+ confirmLinkMezonOTP(bearerToken, body, options = {}) {
1026
+ if (body === null || body === void 0) {
1027
+ throw new Error("'body' is a required parameter but is null or undefined.");
1028
+ }
1029
+ const urlPath = "/v2/account/link/confirm";
1030
+ const queryParams = /* @__PURE__ */ new Map();
1031
+ let bodyJson = "";
1032
+ bodyJson = JSON.stringify(body || {});
1033
+ const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
1034
+ const fetchOptions = buildFetchOptions("POST", options, bodyJson);
1035
+ if (bearerToken) {
1036
+ fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
1037
+ }
1038
+ return Promise.race([
1039
+ fetch(fullUrl, fetchOptions).then((response) => {
1040
+ if (response.status == 204) {
1041
+ return response;
1042
+ } else if (response.status >= 200 && response.status < 300) {
1043
+ return response.json();
1044
+ } else {
1045
+ throw response;
1046
+ }
1047
+ }),
1048
+ new Promise(
1049
+ (_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
1050
+ )
1051
+ ]);
1052
+ }
1024
1053
  /** Authenticate a user with an email+password against the server. */
1025
1054
  registrationEmail(bearerToken, body, options = {}) {
1026
1055
  if (body === null || body === void 0) {
@@ -5544,6 +5573,35 @@ var MezonApi = class {
5544
5573
  )
5545
5574
  ]);
5546
5575
  }
5576
+ /** Store wallet key */
5577
+ storeWalletKey(bearerToken, body, options = {}) {
5578
+ if (body === null || body === void 0) {
5579
+ throw new Error("'body' is a required parameter but is null or undefined.");
5580
+ }
5581
+ const urlPath = "/v2/wallet/key";
5582
+ const queryParams = /* @__PURE__ */ new Map();
5583
+ let bodyJson = "";
5584
+ bodyJson = JSON.stringify(body || {});
5585
+ const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
5586
+ const fetchOptions = buildFetchOptions("POST", options, bodyJson);
5587
+ if (bearerToken) {
5588
+ fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
5589
+ }
5590
+ return Promise.race([
5591
+ fetch(fullUrl, fetchOptions).then((response) => {
5592
+ if (response.status == 204) {
5593
+ return response;
5594
+ } else if (response.status >= 200 && response.status < 300) {
5595
+ return response.json();
5596
+ } else {
5597
+ throw response;
5598
+ }
5599
+ }),
5600
+ new Promise(
5601
+ (_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
5602
+ )
5603
+ ]);
5604
+ }
5547
5605
  /** Get user status */
5548
5606
  listWalletLedger(bearerToken, limit, filter, transactionId, page, options = {}) {
5549
5607
  const urlPath = "/v2/walletledger";
@@ -8537,14 +8595,10 @@ var Client = class {
8537
8595
  create_time: u.create_time,
8538
8596
  display_name: u.display_name,
8539
8597
  edge_count: u.edge_count ? Number(u.edge_count) : 0,
8540
- facebook_id: u.facebook_id,
8541
- gamecenter_id: u.gamecenter_id,
8542
- google_id: u.google_id,
8543
8598
  id: u.id,
8544
8599
  lang_tag: u.lang_tag,
8545
8600
  location: u.location,
8546
8601
  online: u.online,
8547
- steam_id: u.steam_id,
8548
8602
  timezone: u.timezone,
8549
8603
  update_time: u.update_time,
8550
8604
  username: u.username,
@@ -8792,15 +8846,11 @@ var Client = class {
8792
8846
  create_time: gu.user.create_time,
8793
8847
  display_name: gu.user.display_name,
8794
8848
  edge_count: gu.user.edge_count ? Number(gu.user.edge_count) : 0,
8795
- facebook_id: gu.user.facebook_id,
8796
- gamecenter_id: gu.user.gamecenter_id,
8797
- google_id: gu.user.google_id,
8798
8849
  id: gu.user.id,
8799
8850
  lang_tag: gu.user.lang_tag,
8800
8851
  location: gu.user.location,
8801
8852
  online: gu.user.online,
8802
8853
  is_mobile: (_a = gu.user) == null ? void 0 : _a.is_mobile,
8803
- steam_id: gu.user.steam_id,
8804
8854
  timezone: gu.user.timezone,
8805
8855
  update_time: gu.user.update_time,
8806
8856
  username: gu.user.username,
@@ -8965,6 +9015,16 @@ var Client = class {
8965
9015
  });
8966
9016
  });
8967
9017
  }
9018
+ confirmLinkMezonOTP(session, request) {
9019
+ return __async(this, null, function* () {
9020
+ if (this.autoRefreshSession && session.refresh_token && session.isexpired(Date.now() / 1e3)) {
9021
+ yield this.sessionRefresh(session);
9022
+ }
9023
+ return this.apiClient.confirmLinkMezonOTP(session.token, request).then((response) => {
9024
+ return response !== void 0;
9025
+ });
9026
+ });
9027
+ }
8968
9028
  /** Add a custom ID to the social profiles on the current user's account. */
8969
9029
  linkMezon(session, request) {
8970
9030
  return __async(this, null, function* () {
@@ -8972,7 +9032,7 @@ var Client = class {
8972
9032
  yield this.sessionRefresh(session);
8973
9033
  }
8974
9034
  return this.apiClient.linkMezon(session.token, request).then((response) => {
8975
- return response !== void 0;
9035
+ return Promise.resolve(response);
8976
9036
  });
8977
9037
  });
8978
9038
  }
@@ -9009,14 +9069,10 @@ var Client = class {
9009
9069
  create_time: f.user.create_time,
9010
9070
  display_name: f.user.display_name,
9011
9071
  edge_count: f.user.edge_count ? Number(f.user.edge_count) : 0,
9012
- facebook_id: f.user.facebook_id,
9013
- gamecenter_id: f.user.gamecenter_id,
9014
- google_id: f.user.google_id,
9015
9072
  id: f.user.id,
9016
9073
  lang_tag: f.user.lang_tag,
9017
9074
  location: f.user.location,
9018
9075
  online: f.user.online,
9019
- steam_id: f.user.steam_id,
9020
9076
  timezone: f.user.timezone,
9021
9077
  update_time: f.user.update_time,
9022
9078
  username: f.user.username,
@@ -10724,6 +10780,16 @@ var Client = class {
10724
10780
  });
10725
10781
  });
10726
10782
  }
10783
+ createMmnWallet(session, req) {
10784
+ return __async(this, null, function* () {
10785
+ if (this.autoRefreshSession && session.refresh_token && session.isexpired(Date.now() / 1e3)) {
10786
+ yield this.sessionRefresh(session);
10787
+ }
10788
+ return this.apiClient.storeWalletKey(session.token, req).then((response) => {
10789
+ return response !== void 0;
10790
+ });
10791
+ });
10792
+ }
10727
10793
  };
10728
10794
  export {
10729
10795
  ChannelStreamMode,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mezon-js",
3
- "version": "2.12.78",
3
+ "version": "2.12.80",
4
4
  "scripts": {
5
5
  "build": "npx tsc && npx rollup -c --bundleConfigAsCjs && node build.mjs"
6
6
  },