mezon-js 2.12.78 → 2.12.79

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
@@ -374,6 +374,8 @@ export interface ApiAccount {
374
374
  verify_time?: string;
375
375
  //The user's wallet data.
376
376
  wallet?: number;
377
+ // MMN information
378
+ mmn_encrypt_private_key: string;
377
379
  }
378
380
 
379
381
  /** Send a app token to the server. Used with authenticate/link/unlink. */
@@ -2569,6 +2571,8 @@ export interface ApiUpdateAccountRequest {
2569
2571
  timezone?: string;
2570
2572
  //The username of the user's account.
2571
2573
  username?: string;
2574
+ //The email of the user's account.
2575
+ email?: string;
2572
2576
  }
2573
2577
 
2574
2578
  /** */
@@ -2680,6 +2684,8 @@ export interface ApiUser {
2680
2684
  username?: string;
2681
2685
  // list nick name
2682
2686
  list_nick_names?: Array<string>;
2687
+ // MMN address
2688
+ wallet_address?: string
2683
2689
  }
2684
2690
 
2685
2691
  /** */
@@ -2800,6 +2806,14 @@ export interface ApiVoiceChannelUserList {
2800
2806
  voice_channel_users?: Array<ApiVoiceChannelUser>;
2801
2807
  }
2802
2808
 
2809
+ /** */
2810
+ export interface ApiStoreWalletKeyRequest {
2811
+ //
2812
+ address?: string;
2813
+ //
2814
+ enc_privkey?: string;
2815
+ }
2816
+
2803
2817
  /** */
2804
2818
  export interface ApiWalletLedger {
2805
2819
  //
@@ -9549,6 +9563,42 @@ export class MezonApi {
9549
9563
  ]);
9550
9564
  }
9551
9565
 
9566
+ /** Store wallet key */
9567
+ storeWalletKey(bearerToken: string,
9568
+ body:ApiStoreWalletKeyRequest,
9569
+ options: any = {}): Promise<any> {
9570
+
9571
+ if (body === null || body === undefined) {
9572
+ throw new Error("'body' is a required parameter but is null or undefined.");
9573
+ }
9574
+ const urlPath = "/v2/wallet/key";
9575
+ const queryParams = new Map<string, any>();
9576
+
9577
+ let bodyJson : string = "";
9578
+ bodyJson = JSON.stringify(body || {});
9579
+
9580
+ const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
9581
+ const fetchOptions = buildFetchOptions("POST", options, bodyJson);
9582
+ if (bearerToken) {
9583
+ fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
9584
+ }
9585
+
9586
+ return Promise.race([
9587
+ fetch(fullUrl, fetchOptions).then((response) => {
9588
+ if (response.status == 204) {
9589
+ return response;
9590
+ } else if (response.status >= 200 && response.status < 300) {
9591
+ return response.json();
9592
+ } else {
9593
+ throw response;
9594
+ }
9595
+ }),
9596
+ new Promise((_, reject) =>
9597
+ setTimeout(reject, this.timeoutMs, "Request timed out.")
9598
+ ),
9599
+ ]);
9600
+ }
9601
+
9552
9602
  /** Get user status */
9553
9603
  listWalletLedger(bearerToken: string,
9554
9604
  limit?:number,
package/client.ts CHANGED
@@ -172,6 +172,7 @@ import {
172
172
  ApiIsFollowerRequest,
173
173
  ApiTransferOwnershipRequest,
174
174
  ApiMeetParticipantRequest,
175
+ ApiStoreWalletKeyRequest,
175
176
  } from "./api.gen";
176
177
 
177
178
  import { Session } from "./session";
@@ -4899,4 +4900,21 @@ export class Client {
4899
4900
  });
4900
4901
  }
4901
4902
 
4903
+ async createMmnWallet(session: Session,
4904
+ req: ApiStoreWalletKeyRequest): Promise<any> {
4905
+ if (
4906
+ this.autoRefreshSession &&
4907
+ session.refresh_token &&
4908
+ session.isexpired(Date.now() / 1000)
4909
+ ) {
4910
+ await this.sessionRefresh(session);
4911
+ }
4912
+
4913
+ return this.apiClient
4914
+ .storeWalletKey(session.token, req)
4915
+ .then((response: any) => {
4916
+ return response !== undefined;
4917
+ });
4918
+ }
4919
+
4902
4920
  }
package/dist/api.gen.d.ts CHANGED
@@ -213,6 +213,7 @@ export interface ApiAccount {
213
213
  user?: ApiUser;
214
214
  verify_time?: string;
215
215
  wallet?: number;
216
+ mmn_encrypt_private_key: string;
216
217
  }
217
218
  /** Send a app token to the server. Used with authenticate/link/unlink. */
218
219
  export interface ApiAccountApp {
@@ -1468,6 +1469,7 @@ export interface ApiUpdateAccountRequest {
1468
1469
  splash_screen?: string;
1469
1470
  timezone?: string;
1470
1471
  username?: string;
1472
+ email?: string;
1471
1473
  }
1472
1474
  /** */
1473
1475
  export interface ApiUpdateCategoryDescRequest {
@@ -1531,6 +1533,7 @@ export interface ApiUser {
1531
1533
  update_time?: string;
1532
1534
  username?: string;
1533
1535
  list_nick_names?: Array<string>;
1536
+ wallet_address?: string;
1534
1537
  }
1535
1538
  /** */
1536
1539
  export interface ApiUserActivity {
@@ -1602,6 +1605,11 @@ export interface ApiVoiceChannelUserList {
1602
1605
  voice_channel_users?: Array<ApiVoiceChannelUser>;
1603
1606
  }
1604
1607
  /** */
1608
+ export interface ApiStoreWalletKeyRequest {
1609
+ address?: string;
1610
+ enc_privkey?: string;
1611
+ }
1612
+ /** */
1605
1613
  export interface ApiWalletLedger {
1606
1614
  create_time?: string;
1607
1615
  id?: string;
@@ -2228,6 +2236,8 @@ export declare class MezonApi {
2228
2236
  updateUserStatus(bearerToken: string, body: ApiUserStatusUpdate, options?: any): Promise<any>;
2229
2237
  /** list transaction detail */
2230
2238
  listTransactionDetail(bearerToken: string, transId: string, options?: any): Promise<ApiTransactionDetail>;
2239
+ /** Store wallet key */
2240
+ storeWalletKey(bearerToken: string, body: ApiStoreWalletKeyRequest, options?: any): Promise<any>;
2231
2241
  /** Get user status */
2232
2242
  listWalletLedger(bearerToken: string, limit?: number, filter?: number, transactionId?: string, page?: number, options?: any): Promise<ApiWalletLedgerList>;
2233
2243
  /** 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 } from "./api.gen";
17
17
  import { Session } from "./session";
18
18
  import { Socket } from "./socket";
19
19
  import { WebSocketAdapter } from "./web_socket_adapter";
@@ -621,4 +621,5 @@ export declare class Client {
621
621
  listForSaleItems(session: Session, page?: number): Promise<ApiForSaleItemList>;
622
622
  isFollower(session: Session, req: ApiIsFollowerRequest): Promise<ApiIsFollowerResponse>;
623
623
  transferOwnership(session: Session, req: ApiTransferOwnershipRequest): Promise<any>;
624
+ createMmnWallet(session: Session, req: ApiStoreWalletKeyRequest): Promise<any>;
624
625
  }
@@ -5578,6 +5578,35 @@ var MezonApi = class {
5578
5578
  )
5579
5579
  ]);
5580
5580
  }
5581
+ /** Store wallet key */
5582
+ storeWalletKey(bearerToken, body, options = {}) {
5583
+ if (body === null || body === void 0) {
5584
+ throw new Error("'body' is a required parameter but is null or undefined.");
5585
+ }
5586
+ const urlPath = "/v2/wallet/key";
5587
+ const queryParams = /* @__PURE__ */ new Map();
5588
+ let bodyJson = "";
5589
+ bodyJson = JSON.stringify(body || {});
5590
+ const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
5591
+ const fetchOptions = buildFetchOptions("POST", options, bodyJson);
5592
+ if (bearerToken) {
5593
+ fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
5594
+ }
5595
+ return Promise.race([
5596
+ fetch(fullUrl, fetchOptions).then((response) => {
5597
+ if (response.status == 204) {
5598
+ return response;
5599
+ } else if (response.status >= 200 && response.status < 300) {
5600
+ return response.json();
5601
+ } else {
5602
+ throw response;
5603
+ }
5604
+ }),
5605
+ new Promise(
5606
+ (_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
5607
+ )
5608
+ ]);
5609
+ }
5581
5610
  /** Get user status */
5582
5611
  listWalletLedger(bearerToken, limit, filter, transactionId, page, options = {}) {
5583
5612
  const urlPath = "/v2/walletledger";
@@ -10758,4 +10787,14 @@ var Client = class {
10758
10787
  });
10759
10788
  });
10760
10789
  }
10790
+ createMmnWallet(session, req) {
10791
+ return __async(this, null, function* () {
10792
+ if (this.autoRefreshSession && session.refresh_token && session.isexpired(Date.now() / 1e3)) {
10793
+ yield this.sessionRefresh(session);
10794
+ }
10795
+ return this.apiClient.storeWalletKey(session.token, req).then((response) => {
10796
+ return response !== void 0;
10797
+ });
10798
+ });
10799
+ }
10761
10800
  };
@@ -5544,6 +5544,35 @@ var MezonApi = class {
5544
5544
  )
5545
5545
  ]);
5546
5546
  }
5547
+ /** Store wallet key */
5548
+ storeWalletKey(bearerToken, body, options = {}) {
5549
+ if (body === null || body === void 0) {
5550
+ throw new Error("'body' is a required parameter but is null or undefined.");
5551
+ }
5552
+ const urlPath = "/v2/wallet/key";
5553
+ const queryParams = /* @__PURE__ */ new Map();
5554
+ let bodyJson = "";
5555
+ bodyJson = JSON.stringify(body || {});
5556
+ const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
5557
+ const fetchOptions = buildFetchOptions("POST", options, bodyJson);
5558
+ if (bearerToken) {
5559
+ fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
5560
+ }
5561
+ return Promise.race([
5562
+ fetch(fullUrl, fetchOptions).then((response) => {
5563
+ if (response.status == 204) {
5564
+ return response;
5565
+ } else if (response.status >= 200 && response.status < 300) {
5566
+ return response.json();
5567
+ } else {
5568
+ throw response;
5569
+ }
5570
+ }),
5571
+ new Promise(
5572
+ (_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
5573
+ )
5574
+ ]);
5575
+ }
5547
5576
  /** Get user status */
5548
5577
  listWalletLedger(bearerToken, limit, filter, transactionId, page, options = {}) {
5549
5578
  const urlPath = "/v2/walletledger";
@@ -10724,6 +10753,16 @@ var Client = class {
10724
10753
  });
10725
10754
  });
10726
10755
  }
10756
+ createMmnWallet(session, req) {
10757
+ return __async(this, null, function* () {
10758
+ if (this.autoRefreshSession && session.refresh_token && session.isexpired(Date.now() / 1e3)) {
10759
+ yield this.sessionRefresh(session);
10760
+ }
10761
+ return this.apiClient.storeWalletKey(session.token, req).then((response) => {
10762
+ return response !== void 0;
10763
+ });
10764
+ });
10765
+ }
10727
10766
  };
10728
10767
  export {
10729
10768
  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.79",
4
4
  "scripts": {
5
5
  "build": "npx tsc && npx rollup -c --bundleConfigAsCjs && node build.mjs"
6
6
  },