mezon-js 2.12.79 → 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 +50 -16
- package/client.ts +24 -16
- package/dist/api.gen.d.ts +10 -8
- package/dist/client.d.ts +3 -2
- package/dist/mezon-js.cjs.js +40 -13
- package/dist/mezon-js.esm.mjs +40 -13
- package/package.json +1 -1
package/api.gen.ts
CHANGED
|
@@ -374,8 +374,6 @@ 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;
|
|
379
377
|
}
|
|
380
378
|
|
|
381
379
|
/** Send a app token to the server. Used with authenticate/link/unlink. */
|
|
@@ -402,7 +400,7 @@ export interface ApiAccountEmail {
|
|
|
402
400
|
|
|
403
401
|
/** Send a Mezon token to the server. Used with authenticate/link/unlink. */
|
|
404
402
|
export interface ApiAccountMezon {
|
|
405
|
-
//The
|
|
403
|
+
//The phone number
|
|
406
404
|
token?: string;
|
|
407
405
|
//Extra information that will be bundled in the session token.
|
|
408
406
|
vars?: Record<string, string>;
|
|
@@ -2642,8 +2640,6 @@ export interface ApiUploadAttachmentRequest {
|
|
|
2642
2640
|
export interface ApiUser {
|
|
2643
2641
|
//
|
|
2644
2642
|
about_me?: string;
|
|
2645
|
-
//The Apple Sign In ID in the user's account.
|
|
2646
|
-
apple_id?: string;
|
|
2647
2643
|
//A URL for an avatar image.
|
|
2648
2644
|
avatar_url?: string;
|
|
2649
2645
|
//
|
|
@@ -2654,12 +2650,6 @@ export interface ApiUser {
|
|
|
2654
2650
|
display_name?: string;
|
|
2655
2651
|
//Number of related edges to this user.
|
|
2656
2652
|
edge_count?: number;
|
|
2657
|
-
//The Facebook id in the user's account.
|
|
2658
|
-
facebook_id?: string;
|
|
2659
|
-
//The Apple Game Center in of the user's account.
|
|
2660
|
-
gamecenter_id?: string;
|
|
2661
|
-
//The Google id in the user's account.
|
|
2662
|
-
google_id?: string;
|
|
2663
2653
|
//The id of the user's account.
|
|
2664
2654
|
id?: string;
|
|
2665
2655
|
//
|
|
@@ -2674,18 +2664,16 @@ export interface ApiUser {
|
|
|
2674
2664
|
metadata?: string;
|
|
2675
2665
|
//Indicates whether the user is currently online.
|
|
2676
2666
|
online?: boolean;
|
|
2677
|
-
//The Steam id in the user's account.
|
|
2678
|
-
steam_id?: string;
|
|
2679
2667
|
//The timezone set by the user.
|
|
2680
2668
|
timezone?: string;
|
|
2681
2669
|
//The UNIX time (for gRPC clients) or ISO string (for REST clients) when the user was last updated.
|
|
2682
2670
|
update_time?: string;
|
|
2683
2671
|
//The username of the user's account.
|
|
2684
2672
|
username?: string;
|
|
2673
|
+
// mezon_id
|
|
2674
|
+
mezon_id?: string;
|
|
2685
2675
|
// list nick name
|
|
2686
2676
|
list_nick_names?: Array<string>;
|
|
2687
|
-
// MMN address
|
|
2688
|
-
wallet_address?: string
|
|
2689
2677
|
}
|
|
2690
2678
|
|
|
2691
2679
|
/** */
|
|
@@ -3333,6 +3321,16 @@ export interface ApiIsFollowerRequest {
|
|
|
3333
3321
|
follow_id?: string;
|
|
3334
3322
|
}
|
|
3335
3323
|
|
|
3324
|
+
/** */
|
|
3325
|
+
export interface ApiLinkAccountConfirmRequest {
|
|
3326
|
+
//
|
|
3327
|
+
otp_code?: string;
|
|
3328
|
+
//
|
|
3329
|
+
req_id?: string;
|
|
3330
|
+
//
|
|
3331
|
+
status?: number;
|
|
3332
|
+
}
|
|
3333
|
+
|
|
3336
3334
|
/** */
|
|
3337
3335
|
export interface ApiIsFollowerResponse {
|
|
3338
3336
|
//
|
|
@@ -3737,7 +3735,7 @@ export class MezonApi {
|
|
|
3737
3735
|
/** Add a mezon ID to the social profiles on the current user's account. */
|
|
3738
3736
|
linkMezon(bearerToken: string,
|
|
3739
3737
|
body:ApiAccountMezon,
|
|
3740
|
-
options: any = {}): Promise<
|
|
3738
|
+
options: any = {}): Promise<ApiLinkAccountConfirmRequest> {
|
|
3741
3739
|
|
|
3742
3740
|
if (body === null || body === undefined) {
|
|
3743
3741
|
throw new Error("'body' is a required parameter but is null or undefined.");
|
|
@@ -3770,6 +3768,42 @@ export class MezonApi {
|
|
|
3770
3768
|
]);
|
|
3771
3769
|
}
|
|
3772
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
|
+
|
|
3773
3807
|
/** Authenticate a user with an email+password against the server. */
|
|
3774
3808
|
registrationEmail(
|
|
3775
3809
|
bearerToken: string,
|
package/client.ts
CHANGED
|
@@ -173,6 +173,7 @@ import {
|
|
|
173
173
|
ApiTransferOwnershipRequest,
|
|
174
174
|
ApiMeetParticipantRequest,
|
|
175
175
|
ApiStoreWalletKeyRequest,
|
|
176
|
+
ApiLinkAccountConfirmRequest,
|
|
176
177
|
} from "./api.gen";
|
|
177
178
|
|
|
178
179
|
import { Session } from "./session";
|
|
@@ -1170,14 +1171,10 @@ export class Client {
|
|
|
1170
1171
|
create_time: u.create_time,
|
|
1171
1172
|
display_name: u.display_name,
|
|
1172
1173
|
edge_count: u.edge_count ? Number(u.edge_count) : 0,
|
|
1173
|
-
facebook_id: u.facebook_id,
|
|
1174
|
-
gamecenter_id: u.gamecenter_id,
|
|
1175
|
-
google_id: u.google_id,
|
|
1176
1174
|
id: u.id,
|
|
1177
1175
|
lang_tag: u.lang_tag,
|
|
1178
1176
|
location: u.location,
|
|
1179
1177
|
online: u.online,
|
|
1180
|
-
steam_id: u.steam_id,
|
|
1181
1178
|
timezone: u.timezone,
|
|
1182
1179
|
update_time: u.update_time,
|
|
1183
1180
|
username: u.username,
|
|
@@ -1519,15 +1516,11 @@ export class Client {
|
|
|
1519
1516
|
create_time: gu.user!.create_time,
|
|
1520
1517
|
display_name: gu.user!.display_name,
|
|
1521
1518
|
edge_count: gu.user!.edge_count ? Number(gu.user!.edge_count) : 0,
|
|
1522
|
-
facebook_id: gu.user!.facebook_id,
|
|
1523
|
-
gamecenter_id: gu.user!.gamecenter_id,
|
|
1524
|
-
google_id: gu.user!.google_id,
|
|
1525
1519
|
id: gu.user!.id,
|
|
1526
1520
|
lang_tag: gu.user!.lang_tag,
|
|
1527
1521
|
location: gu.user!.location,
|
|
1528
1522
|
online: gu.user!.online,
|
|
1529
1523
|
is_mobile: gu.user?.is_mobile,
|
|
1530
|
-
steam_id: gu.user!.steam_id,
|
|
1531
1524
|
timezone: gu.user!.timezone,
|
|
1532
1525
|
update_time: gu.user!.update_time,
|
|
1533
1526
|
username: gu.user!.username,
|
|
@@ -1805,11 +1798,30 @@ export class Client {
|
|
|
1805
1798
|
});
|
|
1806
1799
|
}
|
|
1807
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
|
+
|
|
1808
1820
|
/** Add a custom ID to the social profiles on the current user's account. */
|
|
1809
1821
|
async linkMezon(
|
|
1810
1822
|
session: Session,
|
|
1811
1823
|
request: ApiAccountMezon
|
|
1812
|
-
): Promise<
|
|
1824
|
+
): Promise<ApiLinkAccountConfirmRequest> {
|
|
1813
1825
|
if (
|
|
1814
1826
|
this.autoRefreshSession &&
|
|
1815
1827
|
session.refresh_token &&
|
|
@@ -1820,8 +1832,8 @@ export class Client {
|
|
|
1820
1832
|
|
|
1821
1833
|
return this.apiClient
|
|
1822
1834
|
.linkMezon(session.token, request)
|
|
1823
|
-
.then((response:
|
|
1824
|
-
return response
|
|
1835
|
+
.then((response: ApiLinkAccountConfirmRequest) => {
|
|
1836
|
+
return Promise.resolve(response);
|
|
1825
1837
|
});
|
|
1826
1838
|
}
|
|
1827
1839
|
|
|
@@ -1878,15 +1890,11 @@ export class Client {
|
|
|
1878
1890
|
avatar_url: f.user!.avatar_url,
|
|
1879
1891
|
create_time: f.user!.create_time,
|
|
1880
1892
|
display_name: f.user!.display_name,
|
|
1881
|
-
edge_count: f.user!.edge_count ? Number(f.user!.edge_count) : 0,
|
|
1882
|
-
facebook_id: f.user!.facebook_id,
|
|
1883
|
-
gamecenter_id: f.user!.gamecenter_id,
|
|
1884
|
-
google_id: f.user!.google_id,
|
|
1893
|
+
edge_count: f.user!.edge_count ? Number(f.user!.edge_count) : 0,
|
|
1885
1894
|
id: f.user!.id,
|
|
1886
1895
|
lang_tag: f.user!.lang_tag,
|
|
1887
1896
|
location: f.user!.location,
|
|
1888
1897
|
online: f.user!.online,
|
|
1889
|
-
steam_id: f.user!.steam_id,
|
|
1890
1898
|
timezone: f.user!.timezone,
|
|
1891
1899
|
update_time: f.user!.update_time,
|
|
1892
1900
|
username: f.user!.username,
|
package/dist/api.gen.d.ts
CHANGED
|
@@ -213,7 +213,6 @@ export interface ApiAccount {
|
|
|
213
213
|
user?: ApiUser;
|
|
214
214
|
verify_time?: string;
|
|
215
215
|
wallet?: number;
|
|
216
|
-
mmn_encrypt_private_key: string;
|
|
217
216
|
}
|
|
218
217
|
/** Send a app token to the server. Used with authenticate/link/unlink. */
|
|
219
218
|
export interface ApiAccountApp {
|
|
@@ -1512,15 +1511,11 @@ export interface ApiUploadAttachmentRequest {
|
|
|
1512
1511
|
/** A user in the server. */
|
|
1513
1512
|
export interface ApiUser {
|
|
1514
1513
|
about_me?: string;
|
|
1515
|
-
apple_id?: string;
|
|
1516
1514
|
avatar_url?: string;
|
|
1517
1515
|
dob?: string;
|
|
1518
1516
|
create_time?: string;
|
|
1519
1517
|
display_name?: string;
|
|
1520
1518
|
edge_count?: number;
|
|
1521
|
-
facebook_id?: string;
|
|
1522
|
-
gamecenter_id?: string;
|
|
1523
|
-
google_id?: string;
|
|
1524
1519
|
id?: string;
|
|
1525
1520
|
is_mobile?: boolean;
|
|
1526
1521
|
join_time?: string;
|
|
@@ -1528,12 +1523,11 @@ export interface ApiUser {
|
|
|
1528
1523
|
location?: string;
|
|
1529
1524
|
metadata?: string;
|
|
1530
1525
|
online?: boolean;
|
|
1531
|
-
steam_id?: string;
|
|
1532
1526
|
timezone?: string;
|
|
1533
1527
|
update_time?: string;
|
|
1534
1528
|
username?: string;
|
|
1529
|
+
mezon_id?: string;
|
|
1535
1530
|
list_nick_names?: Array<string>;
|
|
1536
|
-
wallet_address?: string;
|
|
1537
1531
|
}
|
|
1538
1532
|
/** */
|
|
1539
1533
|
export interface ApiUserActivity {
|
|
@@ -1909,6 +1903,12 @@ export interface ApiIsFollowerRequest {
|
|
|
1909
1903
|
follow_id?: string;
|
|
1910
1904
|
}
|
|
1911
1905
|
/** */
|
|
1906
|
+
export interface ApiLinkAccountConfirmRequest {
|
|
1907
|
+
otp_code?: string;
|
|
1908
|
+
req_id?: string;
|
|
1909
|
+
status?: number;
|
|
1910
|
+
}
|
|
1911
|
+
/** */
|
|
1912
1912
|
export interface ApiIsFollowerResponse {
|
|
1913
1913
|
is_follower?: boolean;
|
|
1914
1914
|
follow_id?: string;
|
|
@@ -1945,7 +1945,9 @@ export declare class MezonApi {
|
|
|
1945
1945
|
/** Add an email+password to the social profiles on the current user's account. */
|
|
1946
1946
|
linkEmail(bearerToken: string, body: ApiAccountEmail, options?: any): Promise<any>;
|
|
1947
1947
|
/** Add a mezon ID to the social profiles on the current user's account. */
|
|
1948
|
-
linkMezon(bearerToken: string, body: ApiAccountMezon, options?: any): Promise<
|
|
1948
|
+
linkMezon(bearerToken: string, body: ApiAccountMezon, options?: any): Promise<ApiLinkAccountConfirmRequest>;
|
|
1949
|
+
/** */
|
|
1950
|
+
confirmLinkMezonOTP(bearerToken: string, body: ApiLinkAccountConfirmRequest, options?: any): Promise<any>;
|
|
1949
1951
|
/** Authenticate a user with an email+password against the server. */
|
|
1950
1952
|
registrationEmail(bearerToken: string, body: ApiRegistrationEmailRequest, options?: any): Promise<ApiSession>;
|
|
1951
1953
|
/** Refresh a user's session using a refresh token retrieved from a previous authentication request. */
|
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, ApiStoreWalletKeyRequest } 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<
|
|
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. */
|
package/dist/mezon-js.cjs.js
CHANGED
|
@@ -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) {
|
|
@@ -8600,14 +8629,10 @@ var Client = class {
|
|
|
8600
8629
|
create_time: u.create_time,
|
|
8601
8630
|
display_name: u.display_name,
|
|
8602
8631
|
edge_count: u.edge_count ? Number(u.edge_count) : 0,
|
|
8603
|
-
facebook_id: u.facebook_id,
|
|
8604
|
-
gamecenter_id: u.gamecenter_id,
|
|
8605
|
-
google_id: u.google_id,
|
|
8606
8632
|
id: u.id,
|
|
8607
8633
|
lang_tag: u.lang_tag,
|
|
8608
8634
|
location: u.location,
|
|
8609
8635
|
online: u.online,
|
|
8610
|
-
steam_id: u.steam_id,
|
|
8611
8636
|
timezone: u.timezone,
|
|
8612
8637
|
update_time: u.update_time,
|
|
8613
8638
|
username: u.username,
|
|
@@ -8855,15 +8880,11 @@ var Client = class {
|
|
|
8855
8880
|
create_time: gu.user.create_time,
|
|
8856
8881
|
display_name: gu.user.display_name,
|
|
8857
8882
|
edge_count: gu.user.edge_count ? Number(gu.user.edge_count) : 0,
|
|
8858
|
-
facebook_id: gu.user.facebook_id,
|
|
8859
|
-
gamecenter_id: gu.user.gamecenter_id,
|
|
8860
|
-
google_id: gu.user.google_id,
|
|
8861
8883
|
id: gu.user.id,
|
|
8862
8884
|
lang_tag: gu.user.lang_tag,
|
|
8863
8885
|
location: gu.user.location,
|
|
8864
8886
|
online: gu.user.online,
|
|
8865
8887
|
is_mobile: (_a = gu.user) == null ? void 0 : _a.is_mobile,
|
|
8866
|
-
steam_id: gu.user.steam_id,
|
|
8867
8888
|
timezone: gu.user.timezone,
|
|
8868
8889
|
update_time: gu.user.update_time,
|
|
8869
8890
|
username: gu.user.username,
|
|
@@ -9028,6 +9049,16 @@ var Client = class {
|
|
|
9028
9049
|
});
|
|
9029
9050
|
});
|
|
9030
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
|
+
}
|
|
9031
9062
|
/** Add a custom ID to the social profiles on the current user's account. */
|
|
9032
9063
|
linkMezon(session, request) {
|
|
9033
9064
|
return __async(this, null, function* () {
|
|
@@ -9035,7 +9066,7 @@ var Client = class {
|
|
|
9035
9066
|
yield this.sessionRefresh(session);
|
|
9036
9067
|
}
|
|
9037
9068
|
return this.apiClient.linkMezon(session.token, request).then((response) => {
|
|
9038
|
-
return response
|
|
9069
|
+
return Promise.resolve(response);
|
|
9039
9070
|
});
|
|
9040
9071
|
});
|
|
9041
9072
|
}
|
|
@@ -9072,14 +9103,10 @@ var Client = class {
|
|
|
9072
9103
|
create_time: f.user.create_time,
|
|
9073
9104
|
display_name: f.user.display_name,
|
|
9074
9105
|
edge_count: f.user.edge_count ? Number(f.user.edge_count) : 0,
|
|
9075
|
-
facebook_id: f.user.facebook_id,
|
|
9076
|
-
gamecenter_id: f.user.gamecenter_id,
|
|
9077
|
-
google_id: f.user.google_id,
|
|
9078
9106
|
id: f.user.id,
|
|
9079
9107
|
lang_tag: f.user.lang_tag,
|
|
9080
9108
|
location: f.user.location,
|
|
9081
9109
|
online: f.user.online,
|
|
9082
|
-
steam_id: f.user.steam_id,
|
|
9083
9110
|
timezone: f.user.timezone,
|
|
9084
9111
|
update_time: f.user.update_time,
|
|
9085
9112
|
username: f.user.username,
|
package/dist/mezon-js.esm.mjs
CHANGED
|
@@ -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) {
|
|
@@ -8566,14 +8595,10 @@ var Client = class {
|
|
|
8566
8595
|
create_time: u.create_time,
|
|
8567
8596
|
display_name: u.display_name,
|
|
8568
8597
|
edge_count: u.edge_count ? Number(u.edge_count) : 0,
|
|
8569
|
-
facebook_id: u.facebook_id,
|
|
8570
|
-
gamecenter_id: u.gamecenter_id,
|
|
8571
|
-
google_id: u.google_id,
|
|
8572
8598
|
id: u.id,
|
|
8573
8599
|
lang_tag: u.lang_tag,
|
|
8574
8600
|
location: u.location,
|
|
8575
8601
|
online: u.online,
|
|
8576
|
-
steam_id: u.steam_id,
|
|
8577
8602
|
timezone: u.timezone,
|
|
8578
8603
|
update_time: u.update_time,
|
|
8579
8604
|
username: u.username,
|
|
@@ -8821,15 +8846,11 @@ var Client = class {
|
|
|
8821
8846
|
create_time: gu.user.create_time,
|
|
8822
8847
|
display_name: gu.user.display_name,
|
|
8823
8848
|
edge_count: gu.user.edge_count ? Number(gu.user.edge_count) : 0,
|
|
8824
|
-
facebook_id: gu.user.facebook_id,
|
|
8825
|
-
gamecenter_id: gu.user.gamecenter_id,
|
|
8826
|
-
google_id: gu.user.google_id,
|
|
8827
8849
|
id: gu.user.id,
|
|
8828
8850
|
lang_tag: gu.user.lang_tag,
|
|
8829
8851
|
location: gu.user.location,
|
|
8830
8852
|
online: gu.user.online,
|
|
8831
8853
|
is_mobile: (_a = gu.user) == null ? void 0 : _a.is_mobile,
|
|
8832
|
-
steam_id: gu.user.steam_id,
|
|
8833
8854
|
timezone: gu.user.timezone,
|
|
8834
8855
|
update_time: gu.user.update_time,
|
|
8835
8856
|
username: gu.user.username,
|
|
@@ -8994,6 +9015,16 @@ var Client = class {
|
|
|
8994
9015
|
});
|
|
8995
9016
|
});
|
|
8996
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
|
+
}
|
|
8997
9028
|
/** Add a custom ID to the social profiles on the current user's account. */
|
|
8998
9029
|
linkMezon(session, request) {
|
|
8999
9030
|
return __async(this, null, function* () {
|
|
@@ -9001,7 +9032,7 @@ var Client = class {
|
|
|
9001
9032
|
yield this.sessionRefresh(session);
|
|
9002
9033
|
}
|
|
9003
9034
|
return this.apiClient.linkMezon(session.token, request).then((response) => {
|
|
9004
|
-
return response
|
|
9035
|
+
return Promise.resolve(response);
|
|
9005
9036
|
});
|
|
9006
9037
|
});
|
|
9007
9038
|
}
|
|
@@ -9038,14 +9069,10 @@ var Client = class {
|
|
|
9038
9069
|
create_time: f.user.create_time,
|
|
9039
9070
|
display_name: f.user.display_name,
|
|
9040
9071
|
edge_count: f.user.edge_count ? Number(f.user.edge_count) : 0,
|
|
9041
|
-
facebook_id: f.user.facebook_id,
|
|
9042
|
-
gamecenter_id: f.user.gamecenter_id,
|
|
9043
|
-
google_id: f.user.google_id,
|
|
9044
9072
|
id: f.user.id,
|
|
9045
9073
|
lang_tag: f.user.lang_tag,
|
|
9046
9074
|
location: f.user.location,
|
|
9047
9075
|
online: f.user.online,
|
|
9048
|
-
steam_id: f.user.steam_id,
|
|
9049
9076
|
timezone: f.user.timezone,
|
|
9050
9077
|
update_time: f.user.update_time,
|
|
9051
9078
|
username: f.user.username,
|