mezon-js 2.13.78 → 2.13.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/client.ts +3279 -2482
- package/dist/client.d.ts +163 -349
- package/dist/gateway.api.d.ts +33 -0
- package/dist/index.d.ts +2 -4
- package/dist/{api.gen.d.ts → mezon-js/api.gen.d.ts} +1 -0
- package/dist/mezon-js/client.d.ts +347 -0
- package/dist/mezon-js/gateway.api.d.ts +33 -0
- package/dist/mezon-js/index.d.ts +23 -0
- package/dist/mezon-js/session.d.ts +61 -0
- package/dist/mezon-js/socket.d.ts +1212 -0
- package/dist/mezon-js/types/index.d.ts +2212 -0
- package/dist/mezon-js/utils.d.ts +6 -0
- package/dist/mezon-js/web_socket_adapter.d.ts +83 -0
- package/dist/mezon-js.cjs.js +9038 -21145
- package/dist/mezon-js.esm.mjs +9038 -21145
- package/dist/mezon-js.esm.mjs.map +1 -0
- package/dist/session.d.ts +11 -11
- package/dist/socket.d.ts +385 -386
- package/dist/types/index.d.ts +2212 -0
- package/dist/utils.d.ts +2 -0
- package/dist/webrpc/index.d.ts +3 -0
- package/gateway.api.ts +577 -0
- package/index.ts +2 -5
- package/package.json +3 -2
- package/rollup.config.js +64 -30
- package/session.ts +22 -22
- package/socket.ts +921 -846
- package/types/index.ts +3883 -0
- package/utils.ts +107 -47
- package/api/api.ts +0 -39185
- package/api.gen.ts +0 -11777
- package/google/protobuf/struct.ts +0 -554
- package/google/protobuf/timestamp.ts +0 -223
- package/google/protobuf/wrappers.ts +0 -670
- /package/dist/{api → mezon-js/api}/api.d.ts +0 -0
- /package/dist/{google → mezon-js/google}/protobuf/struct.d.ts +0 -0
- /package/dist/{google → mezon-js/google}/protobuf/timestamp.d.ts +0 -0
- /package/dist/{google → mezon-js/google}/protobuf/wrappers.d.ts +0 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { ApiAccountMezon, ApiAuthenticateEmailRequest, ApiAuthenticateSMSRequest, ApiConfirmLoginRequest, ApiGenerateMeetTokenExternalResponse, ApiInviteUserRes, ApiLinkAccountConfirmRequest, ApiListClanDiscover, ApiLoginIDResponse, ApiLoginRequest, ApiSession, ApiClanDiscoverRequest } from "./types";
|
|
2
|
+
export declare class GatewayMezonApi {
|
|
3
|
+
readonly serverKey: string;
|
|
4
|
+
readonly timeoutMs: number;
|
|
5
|
+
basePath: string;
|
|
6
|
+
constructor(serverKey: string, timeoutMs: number, basePath: string);
|
|
7
|
+
setBasePath(basePath: string): void;
|
|
8
|
+
/** A healthcheck which load balancers can use to check the service. */
|
|
9
|
+
healthcheck(bearerToken: string, options?: any): Promise<any>;
|
|
10
|
+
/** Authenticate a user with Mezon against the server. */
|
|
11
|
+
authenticateMezon(basicAuthUsername: string, basicAuthPassword: string, account: ApiAccountMezon, create?: boolean, username?: string, isRemember?: boolean, options?: any): Promise<ApiSession>;
|
|
12
|
+
/** Authenticate a user with an SMS against the server. */
|
|
13
|
+
AuthenticateSMSOTPRequest(basicAuthUsername: string, basicAuthPassword: string, body: ApiAuthenticateSMSRequest, options?: any): Promise<ApiLinkAccountConfirmRequest>;
|
|
14
|
+
/** Authenticate a user with an email+password against the server. */
|
|
15
|
+
AuthenticateEmailOTPRequest(basicAuthUsername: string, basicAuthPassword: string, body: ApiAuthenticateEmailRequest, options?: any): Promise<ApiLinkAccountConfirmRequest>;
|
|
16
|
+
/** */
|
|
17
|
+
confirmAuthenticateOTP(basicAuthUsername: string, basicAuthPassword: string, body: ApiLinkAccountConfirmRequest, options?: any): Promise<ApiSession>;
|
|
18
|
+
/** Authenticate a user with an email+password against the server. */
|
|
19
|
+
authenticateEmail(basicAuthUsername: string, basicAuthPassword: string, body: ApiAuthenticateEmailRequest, options?: any): Promise<ApiSession>;
|
|
20
|
+
/** Add users to a channel. */
|
|
21
|
+
getLinkInvite(basicAuthUsername: string, basicAuthPassword: string, inviteId: string, options?: any): Promise<ApiInviteUserRes>;
|
|
22
|
+
/** */
|
|
23
|
+
createQRLogin(basicAuthUsername: string, basicAuthPassword: string, body: ApiLoginRequest, options?: any): Promise<ApiLoginIDResponse>;
|
|
24
|
+
/** */
|
|
25
|
+
checkLoginRequest(basicAuthUsername: string, basicAuthPassword: string, body: ApiConfirmLoginRequest, options?: any): Promise<ApiSession>;
|
|
26
|
+
/** */
|
|
27
|
+
confirmLogin(bearerToken: string, basePath: string, body: ApiConfirmLoginRequest, options?: any): Promise<any>;
|
|
28
|
+
/** handler external mezon meet */
|
|
29
|
+
generateMeetTokenExternal(bearerToken: string, basePath: string, token: string, displayName?: string, isGuest?: boolean, options?: any): Promise<ApiGenerateMeetTokenExternalResponse>;
|
|
30
|
+
/** Discover mezon clan. */
|
|
31
|
+
clanDiscover(basicAuthUsername: string, basicAuthPassword: string, basePath: string, body: ApiClanDiscoverRequest, options?: any): Promise<ApiListClanDiscover>;
|
|
32
|
+
buildFullUrl(basePath: string, fragment: string, queryParams: Map<string, any>): string;
|
|
33
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -19,7 +19,5 @@ export * from "./session";
|
|
|
19
19
|
export * from "./socket";
|
|
20
20
|
export * from "./web_socket_adapter";
|
|
21
21
|
export * from "./utils";
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
*/
|
|
25
|
-
export { ChannelMessage } from "./client";
|
|
22
|
+
export * from "./types";
|
|
23
|
+
export { Session } from "./session";
|
|
@@ -0,0 +1,347 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2020 The Mezon Authors
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { Session } from "./session";
|
|
17
|
+
import { Account, AccountEmail, AccountMezon, AddAppRequest, AllUsersAddChannelResponse, AllUserClans, AppList, AddFriendsResponse, AddRoleChannelDescRequest, App, BannedUserList, CategoryDesc, ChangeChannelPrivateRequest, ChannelDescription, ChannelDescList, ChannelMessageHeader, ClanDesc, ClanEmojiCreateRequest, ClanStickerAddRequest, CreateCategoryDescRequest, CreateChannelDescRequest, CreateClanDescRequest, CreateEventRequest, CreateRoleRequest, EventManagement, InviteUserRes, IsBannedResponse, IsFollowerRequest, IsFollowerResponse, LinkInviteUser, LinkInviteUserRequest, GetKeyServerResp, ListOnboardingResponse, OnboardingItem, CreateOnboardingRequest, GenerateClanWebhookRequest, GenerateClanWebhookResponse, ListClanWebhookResponse, ListOnboardingStepResponse, UserStatusUpdate, UserStatus, SdTopicList, SdTopicRequest, SdTopic, GenerateMeetTokenRequest, GenerateMeetTokenResponse, MezonOauthClient, UserEventRequest, UpdateRoleOrderRequest, GenerateMezonMeetResponse, MeetParticipantRequest, UpdateClanOrderRequest, QuickMenuAccessList, ForSaleItemList, CreateActivityRequest, ListUserActivity, UserActivity, ChanEncryptionMethod, GetPubKeysResponse, PubKey, AddFavoriteChannelResponse, ChannelSettingListResponse, ChannelCanvasListResponse, EditChannelCanvasRequest, LogedDeviceList, MarkAsReadRequest, Message2InboxRequest, PermissionRoleChannelListEventResponse, PinMessageRequest, PinMessagesList, Role, RoleList, SearchMessageRequest, SearchMessageResponse, SetDefaultNotificationRequest, SetMuteRequest, SetNotificationRequest, TransferOwnershipRequest, UpdateAccountRequest, UpdateCategoryDescRequest, UpdateEventRequest, UpdateUsernameRequest, UploadAttachment, UploadAttachmentRequest, UserPermissionInChannelListResponse, DeleteRoleRequest, EmojiListedResponse, EmojiRecentList, ListChannelAppsResponse, NotificationChannelCategorySettingList, NotificationSetting, NotificationUserChannel, RoleListEventResponse, StickerListedResponse, StreamingChannelUserList, SystemMessage, SystemMessageRequest, UpdateCategoryOrderRequest, UpdateRoleChannelRequest, WebhookCreateRequest, WebhookGenerateResponse, WebhookListResponse, QuickMenuAccess, GenerateHashChannelAppsResponse, CreateRoomChannelApps, UpdateOnboardingStepRequest, UpdateClanWebhookRequest, UpdateOnboardingRequest, ListAuditLog, ListFavoriteChannelResponse, EditChannelCanvasResponse, ChannelCanvasDetailResponse, UpdateAppRequest, UpdateClanDescRequest, WebhookUpdateRequestById, WebhookDeleteRequestById, ClanStickerUpdateByIdRequest, ChangeChannelCategoryRequest, ClanEmojiUpdateRequest, ListClanUnreadMsgIndicatorResponse, ClanDescList, CategoryDescList, EventList, LinkAccountConfirmRequest, PermissionList, RegistFcmDeviceTokenResponse, RoleUserList, ClanProfile, ClanUserList, ChannelAttachmentList, ChannelUserList, VoiceChannelUserList, NotificationList, FriendList, UpdateChannelDescRequest, UpdateClanProfileRequest, UpdateRoleRequest, DeleteChannelDescRequest } from "webrpc";
|
|
18
|
+
import { Socket } from "./socket";
|
|
19
|
+
import { WebSocketAdapter } from "./web_socket_adapter";
|
|
20
|
+
import { ChannelMessageList, ApiClanDiscoverRequest, ApiConfirmLoginRequest, ApiGenerateMeetTokenExternalResponse, ApiInviteUserRes, ApiLinkAccountConfirmRequest, ApiListClanDiscover, ApiLoginIDResponse, ApiLoginRequest } from "./types";
|
|
21
|
+
export declare enum ChannelType {
|
|
22
|
+
CHANNEL_TYPE_CHANNEL = 1,
|
|
23
|
+
CHANNEL_TYPE_GROUP = 2,
|
|
24
|
+
CHANNEL_TYPE_DM = 3,
|
|
25
|
+
CHANNEL_TYPE_FORUM = 5,
|
|
26
|
+
CHANNEL_TYPE_STREAMING = 6,
|
|
27
|
+
CHANNEL_TYPE_THREAD = 7,
|
|
28
|
+
CHANNEL_TYPE_APP = 8,
|
|
29
|
+
CHANNEL_TYPE_ANNOUNCEMENT = 9,
|
|
30
|
+
CHANNEL_TYPE_MEZON_VOICE = 10
|
|
31
|
+
}
|
|
32
|
+
export declare enum ChannelStreamMode {
|
|
33
|
+
STREAM_MODE_CHANNEL = 2,
|
|
34
|
+
STREAM_MODE_GROUP = 3,
|
|
35
|
+
STREAM_MODE_DM = 4,
|
|
36
|
+
STREAM_MODE_CLAN = 5,
|
|
37
|
+
STREAM_MODE_THREAD = 6
|
|
38
|
+
}
|
|
39
|
+
export declare enum NotificationType {
|
|
40
|
+
ALL_MESSAGE = 1,
|
|
41
|
+
MENTION_MESSAGE = 2,
|
|
42
|
+
NOTHING_MESSAGE = 3
|
|
43
|
+
}
|
|
44
|
+
export declare enum WebrtcSignalingType {
|
|
45
|
+
WEBRTC_SDP_INIT = 0,
|
|
46
|
+
WEBRTC_SDP_OFFER = 1,
|
|
47
|
+
WEBRTC_SDP_ANSWER = 2,
|
|
48
|
+
WEBRTC_ICE_CANDIDATE = 3,
|
|
49
|
+
WEBRTC_SDP_QUIT = 4,
|
|
50
|
+
WEBRTC_SDP_TIMEOUT = 5,
|
|
51
|
+
WEBRTC_SDP_NOT_AVAILABLE = 6,
|
|
52
|
+
WEBRTC_SDP_JOINED_OTHER_CALL = 7,
|
|
53
|
+
WEBRTC_SDP_STATUS_REMOTE_MEDIA = 8
|
|
54
|
+
}
|
|
55
|
+
/** A client for Mezon server. */
|
|
56
|
+
export declare class Client {
|
|
57
|
+
readonly serverkey: string;
|
|
58
|
+
readonly timeout: number;
|
|
59
|
+
readonly autoRefreshSession: boolean;
|
|
60
|
+
/** The low level API client for Mezon server. */
|
|
61
|
+
private readonly gatewayClient;
|
|
62
|
+
private grpcTransport;
|
|
63
|
+
private mezonClient;
|
|
64
|
+
/** thre refreshTokenPromise */
|
|
65
|
+
private refreshTokenPromise;
|
|
66
|
+
host: string;
|
|
67
|
+
port: string;
|
|
68
|
+
useSSL: boolean;
|
|
69
|
+
constructor(serverkey?: string, host?: string, port?: string, useSSL?: boolean, timeout?: number, autoRefreshSession?: boolean);
|
|
70
|
+
/**
|
|
71
|
+
* Called when a token refresh is initiated.
|
|
72
|
+
* This is a placeholder method that subclasses or instances can override
|
|
73
|
+
* to perform actions before or after the refresh logic.
|
|
74
|
+
*/
|
|
75
|
+
onRefreshSession(session: Session): void;
|
|
76
|
+
/** check session isexpired */
|
|
77
|
+
isexpired(session: Session): boolean;
|
|
78
|
+
/** set base path */
|
|
79
|
+
setBasePath(host: string, port: string, useSSL: boolean): void;
|
|
80
|
+
/** Authenticate a user with a custom id against the server. */
|
|
81
|
+
authenticateMezon(token: string, create?: boolean, username?: string, isRemember?: boolean, vars?: Record<string, string>, options?: any): Promise<Session>;
|
|
82
|
+
/** Authenticate a user with an email+otp against the server. */
|
|
83
|
+
authenticateSMSOTPRequest(phoneno: string, username?: string, vars?: Record<string, string>): Promise<ApiLinkAccountConfirmRequest>;
|
|
84
|
+
/** Authenticate a user with an email+otp against the server. */
|
|
85
|
+
authenticateEmailOTPRequest(email: string, username?: string, vars?: Record<string, string>): Promise<ApiLinkAccountConfirmRequest>;
|
|
86
|
+
confirmAuthenticateOTP(request: LinkAccountConfirmRequest): Promise<Session>;
|
|
87
|
+
/** Authenticate a user with an email+password against the server. */
|
|
88
|
+
authenticateEmail(email: string, password: string, username?: string, vars?: Record<string, string>): Promise<Session>;
|
|
89
|
+
/** Get link invite user */
|
|
90
|
+
getLinkInvite(inviteId: string): Promise<ApiInviteUserRes>;
|
|
91
|
+
createQRLogin(requet: ApiLoginRequest): Promise<ApiLoginIDResponse>;
|
|
92
|
+
checkLoginRequest(requet: ApiConfirmLoginRequest): Promise<Session | null>;
|
|
93
|
+
confirmLogin(session: Session, basePath: string, body: ApiConfirmLoginRequest): Promise<any>;
|
|
94
|
+
generateMeetTokenExternal(basePath: string, token: string, displayName?: string, isGuest?: boolean): Promise<ApiGenerateMeetTokenExternalResponse>;
|
|
95
|
+
/** list clan discover. */
|
|
96
|
+
listClanDiscover(basePath: string, request: ApiClanDiscoverRequest): Promise<ApiListClanDiscover>;
|
|
97
|
+
/** Add users to a channel, or accept their join requests. */
|
|
98
|
+
addChannelUsers(session: Session, channelId: string, ids?: Array<string>): Promise<boolean>;
|
|
99
|
+
/** Add friends by ID or username to a user's account. */
|
|
100
|
+
addFriends(session: Session, ids?: Array<string>, usernames?: Array<string>): Promise<AddFriendsResponse>;
|
|
101
|
+
/** Block one or more users by ID or username. */
|
|
102
|
+
blockFriends(session: Session, ids?: Array<string>, usernames?: Array<string>): Promise<boolean>;
|
|
103
|
+
/** Block one or more users by ID or username. */
|
|
104
|
+
unblockFriends(session: Session, ids?: Array<string>, usernames?: Array<string>): Promise<boolean>;
|
|
105
|
+
/** Create a new group with the current user as the creator and superadmin. */
|
|
106
|
+
uploadOauthFile(session: Session, request: UploadAttachmentRequest): Promise<UploadAttachment>;
|
|
107
|
+
/** Create a new group with the current user as the creator and superadmin. */
|
|
108
|
+
uploadAttachmentFile(session: Session, request: UploadAttachmentRequest): Promise<UploadAttachment>;
|
|
109
|
+
/** Create a channel within clan */
|
|
110
|
+
createChannelDesc(session: Session, request: CreateChannelDescRequest): Promise<ChannelDescription>;
|
|
111
|
+
/** Create a clan */
|
|
112
|
+
createClanDesc(session: Session, request: CreateClanDescRequest): Promise<ClanDesc>;
|
|
113
|
+
/** */
|
|
114
|
+
createCategoryDesc(session: Session, request: CreateCategoryDescRequest): Promise<CategoryDesc>;
|
|
115
|
+
/** Create a new role for clan. */
|
|
116
|
+
createRole(session: Session, request: CreateRoleRequest): Promise<Role>;
|
|
117
|
+
/** Create a new event for clan. */
|
|
118
|
+
createEvent(session: Session, request: CreateEventRequest): Promise<EventManagement>;
|
|
119
|
+
/** add role for channel. */
|
|
120
|
+
addRolesChannelDesc(session: Session, request: AddRoleChannelDescRequest): Promise<boolean>;
|
|
121
|
+
/** Update action role when delete role */
|
|
122
|
+
deleteRoleChannelDesc(session: Session, request: DeleteRoleRequest): Promise<boolean>;
|
|
123
|
+
deleteApp(session: Session, appId: string): Promise<boolean>;
|
|
124
|
+
/** A socket created with the client's configuration. */
|
|
125
|
+
createSocket(useSSL?: boolean, verbose?: boolean, adapter?: WebSocketAdapter, sendTimeoutMs?: number): Socket;
|
|
126
|
+
/** Delete one or more users by ID or username. */
|
|
127
|
+
deleteFriends(session: Session, ids?: Array<string>, usernames?: Array<string>): Promise<boolean>;
|
|
128
|
+
/** Delete a channel by ID. */
|
|
129
|
+
deleteChannelDesc(session: Session, clanId: string, channelId: string): Promise<boolean>;
|
|
130
|
+
/** Delete a clan desc by ID. */
|
|
131
|
+
deleteClanDesc(session: Session, clanDescId: string): Promise<boolean>;
|
|
132
|
+
/** Delete a category by ID. */
|
|
133
|
+
deleteCategoryDesc(session: Session, categoryId: string, clanId: string, categoryLabel?: string): Promise<boolean>;
|
|
134
|
+
/** Delete one or more notifications */
|
|
135
|
+
deleteNotifications(session: Session, ids?: Array<string>, category?: number): Promise<boolean>;
|
|
136
|
+
/** Delete a role by ID. */
|
|
137
|
+
deleteRole(session: Session, roleId: string, clanId: string, roleLabel?: string): Promise<boolean>;
|
|
138
|
+
/** Delete a event by ID. */
|
|
139
|
+
deleteEvent(session: Session, eventId: string, clanId: string, creatorId: string, eventLabel?: string, channelId?: string): Promise<boolean>;
|
|
140
|
+
/** Fetch the current user's account. */
|
|
141
|
+
getAccount(session: Session): Promise<Account>;
|
|
142
|
+
/** Kick a set of users from a clan. */
|
|
143
|
+
removeClanUsers(session: Session, clanId: string, ids?: Array<string>): Promise<boolean>;
|
|
144
|
+
listBannedUsers(session: Session, clanId?: string, channelId?: string): Promise<BannedUserList>;
|
|
145
|
+
/** Ban a set of users from a clan. */
|
|
146
|
+
unbanClanUsers(session: Session, clanId: string, channelId?: string, userIds?: Array<string>): Promise<boolean>;
|
|
147
|
+
/** Ban a set of users from a clan. */
|
|
148
|
+
banClanUsers(session: Session, clanId: string, channelId?: string, userIds?: Array<string>, banTime?: number): Promise<boolean>;
|
|
149
|
+
/** Kick users from a channel, or decline their join requests. */
|
|
150
|
+
removeChannelUsers(session: Session, channelId: string, ids?: Array<string>): Promise<boolean>;
|
|
151
|
+
/** List a channel's message history. */
|
|
152
|
+
listChannelMessages(session: Session, clanId: string, channelId: string, messageId?: string, direction?: number, limit?: number, topicId?: string): Promise<ChannelMessageList>;
|
|
153
|
+
/** List a channel's users. */
|
|
154
|
+
listChannelVoiceUsers(session: Session, clanId: string, channelId: string, channelType: number, state?: number, limit?: number, cursor?: string): Promise<VoiceChannelUserList>;
|
|
155
|
+
/** List a channel's users. */
|
|
156
|
+
listChannelUsers(session: Session, clanId: string, channelId: string, channelType: number, state?: number, limit?: number, cursor?: string): Promise<ChannelUserList>;
|
|
157
|
+
/** List a channel's attachment. */
|
|
158
|
+
listChannelAttachments(session: Session, clanId: string, channelId: string, fileType: string, state?: number, limit?: number, before?: number, after?: number): Promise<ChannelAttachmentList>;
|
|
159
|
+
/** List a channel's users. */
|
|
160
|
+
listClanUsers(session: Session, clanId: string): Promise<ClanUserList>;
|
|
161
|
+
listChannelDetail(session: Session, channelId: string): Promise<ChannelDescription>;
|
|
162
|
+
listChannelDescs(session: Session, limit?: number, state?: number, cursor?: string, clanId?: string, channelType?: number, isMobile?: boolean): Promise<ChannelDescList>;
|
|
163
|
+
listClanUnreadMsgIndicator(session: Session, clanId: string): Promise<ListClanUnreadMsgIndicatorResponse>;
|
|
164
|
+
listClanDescs(session: Session, limit?: number, state?: number, cursor?: string): Promise<ClanDescList>;
|
|
165
|
+
/** List categories. */
|
|
166
|
+
listCategoryDescs(session: Session, clanId: string, creatorId?: string, categoryName?: string): Promise<CategoryDescList>;
|
|
167
|
+
/** List event */
|
|
168
|
+
listEvents(session: Session, clanId?: string): Promise<EventList>;
|
|
169
|
+
/** List permission */
|
|
170
|
+
getListPermission(session: Session): Promise<PermissionList>;
|
|
171
|
+
/** List user roles */
|
|
172
|
+
listRolePermissions(session: Session, roleId: string): Promise<PermissionList>;
|
|
173
|
+
/** List user roles */
|
|
174
|
+
listRoleUsers(session: Session, roleId: string, limit?: number, cursor?: string): Promise<RoleUserList>;
|
|
175
|
+
registFCMDeviceToken(session: Session, tokenId: string, deviceId: string, platform: string, voipToken?: string): Promise<RegistFcmDeviceTokenResponse>;
|
|
176
|
+
getUserProfileOnClan(session: Session, clanId: string): Promise<ClanProfile>;
|
|
177
|
+
closeDirectMess(session: Session, request: DeleteChannelDescRequest): Promise<boolean>;
|
|
178
|
+
openDirectMess(session: Session, request: DeleteChannelDescRequest): Promise<boolean>;
|
|
179
|
+
confirmLinkMezonOTP(session: Session, request: LinkAccountConfirmRequest): Promise<void>;
|
|
180
|
+
/** Add a custom ID to the social profiles on the current user's account. */
|
|
181
|
+
linkSMS(session: Session, request: AccountMezon): Promise<ApiLinkAccountConfirmRequest>;
|
|
182
|
+
/** Add an email+password to the social profiles on the current user's account. */
|
|
183
|
+
linkEmail(session: Session, request: AccountEmail): Promise<LinkAccountConfirmRequest>;
|
|
184
|
+
/** List all friends for the current user. */
|
|
185
|
+
listFriends(session: Session, state?: number, limit?: number, cursor?: string): Promise<FriendList>;
|
|
186
|
+
/** Fetch list of notifications. */
|
|
187
|
+
listNotifications(session: Session, clanId: string, limit?: number, notificationId?: string, category?: number, direction?: number): Promise<NotificationList>;
|
|
188
|
+
/** Log out a session, invalidate a refresh token, or log out all sessions/refresh tokens for a user. */
|
|
189
|
+
sessionLogout(session: Session, token: string, refreshToken: string, deviceId: string, platform: string): Promise<boolean>;
|
|
190
|
+
/** Refresh a user's session using a refresh token retrieved from a previous authentication request. */
|
|
191
|
+
sessionRefresh(session: Session, vars?: Record<string, string>): Promise<Session>;
|
|
192
|
+
/** Remove custom ID from the social profiles on the current user's account. */
|
|
193
|
+
unlinkCustom(session: Session, request: AccountMezon): Promise<boolean>;
|
|
194
|
+
/** Remove an email+password from the social profiles on the current user's account. */
|
|
195
|
+
unlinkEmail(session: Session, request: AccountEmail): Promise<boolean>;
|
|
196
|
+
/** Update fields in the current user's account. */
|
|
197
|
+
updateUsername(session: Session, request: UpdateUsernameRequest): Promise<Session>;
|
|
198
|
+
/** Update fields in the current user's account. */
|
|
199
|
+
updateAccount(session: Session, request: UpdateAccountRequest): Promise<boolean>;
|
|
200
|
+
/** Update fields in a given channel */
|
|
201
|
+
updateChannelDesc(session: Session, channelId: string, request: UpdateChannelDescRequest): Promise<boolean>;
|
|
202
|
+
/** Update fields in a given clan. */
|
|
203
|
+
updateClanDesc(session: Session, clanId: string, request: UpdateClanDescRequest): Promise<boolean>;
|
|
204
|
+
/** Update fields in a given category. */
|
|
205
|
+
updateCategory(session: Session, clanId: string, request: UpdateCategoryDescRequest): Promise<boolean>;
|
|
206
|
+
updateUserProfileByClan(session: Session, clanId: string, request: UpdateClanProfileRequest): Promise<boolean>;
|
|
207
|
+
/** Update fields in a given role. */
|
|
208
|
+
updateRole(session: Session, roleId: string, request: UpdateRoleRequest): Promise<boolean>;
|
|
209
|
+
/** Update fields in a given event. */
|
|
210
|
+
updateEvent(session: Session, eventId: string, request: UpdateEventRequest): Promise<boolean>;
|
|
211
|
+
/** Update fields in a given event. */
|
|
212
|
+
updateApp(session: Session, roleId: string, request: UpdateAppRequest): Promise<App>;
|
|
213
|
+
/** Update fields in a given clan profile. */
|
|
214
|
+
createLinkInviteUser(session: Session, request: LinkInviteUserRequest): Promise<LinkInviteUser>;
|
|
215
|
+
/** Get permission of user in the clan */
|
|
216
|
+
GetRoleOfUserInTheClan(session: Session, clanId: string): Promise<RoleList>;
|
|
217
|
+
/** invite user */
|
|
218
|
+
inviteUser(session: Session, inviteId: string): Promise<InviteUserRes>;
|
|
219
|
+
/** Set default notification clan*/
|
|
220
|
+
setNotificationClan(session: Session, request: SetDefaultNotificationRequest): Promise<boolean>;
|
|
221
|
+
/** Set notification channel*/
|
|
222
|
+
setNotificationChannel(session: Session, request: SetNotificationRequest): Promise<boolean>;
|
|
223
|
+
/** Set notification category*/
|
|
224
|
+
setMuteCategory(session: Session, request: SetMuteRequest): Promise<boolean>;
|
|
225
|
+
/** Set notification channel*/
|
|
226
|
+
setMuteChannel(session: Session, request: SetMuteRequest): Promise<boolean>;
|
|
227
|
+
/** update channel private*/
|
|
228
|
+
updateChannelPrivate(session: Session, request: ChangeChannelPrivateRequest): Promise<boolean>;
|
|
229
|
+
/** Set default notification category*/
|
|
230
|
+
setNotificationCategory(session: Session, request: SetNotificationRequest): Promise<boolean>;
|
|
231
|
+
deleteNotificationCategory(session: Session, categoryId: string): Promise<boolean>;
|
|
232
|
+
deleteNotificationChannel(session: Session, channelId: string): Promise<boolean>;
|
|
233
|
+
/** query message in elasticsearch */
|
|
234
|
+
searchMessage(session: Session, request: SearchMessageRequest): Promise<SearchMessageResponse>;
|
|
235
|
+
/** */
|
|
236
|
+
createMessage2Inbox(session: Session, request: Message2InboxRequest): Promise<ChannelMessageHeader>;
|
|
237
|
+
/** */
|
|
238
|
+
createPinMessage(session: Session, request: PinMessageRequest): Promise<ChannelMessageHeader>;
|
|
239
|
+
pinMessagesList(session: Session, messageId: string, channelId: string, clanId: string): Promise<PinMessagesList>;
|
|
240
|
+
deletePinMessage(session: Session, id?: string, messageId?: string, channelId?: string, clanId?: string): Promise<boolean>;
|
|
241
|
+
/** create clan emoji */
|
|
242
|
+
createClanEmoji(session: Session, request: ClanEmojiCreateRequest): Promise<boolean>;
|
|
243
|
+
updateClanEmojiById(session: Session, id: string, request: ClanEmojiUpdateRequest): Promise<boolean>;
|
|
244
|
+
deleteByIdClanEmoji(session: Session, id: string, clanId: string, emojiLabel?: string): Promise<boolean>;
|
|
245
|
+
generateWebhookLink(session: Session, request: WebhookCreateRequest): Promise<WebhookGenerateResponse>;
|
|
246
|
+
listWebhookByChannelId(session: Session, channelId: string, clanId: string): Promise<WebhookListResponse>;
|
|
247
|
+
updateWebhookById(session: Session, id: string, request: WebhookUpdateRequestById): Promise<boolean>;
|
|
248
|
+
deleteWebhookById(session: Session, id: string, request: WebhookDeleteRequestById): Promise<boolean>;
|
|
249
|
+
addClanSticker(session: Session, request: ClanStickerAddRequest): Promise<boolean>;
|
|
250
|
+
deleteClanStickerById(session: Session, id: string, clanId: string, stickerLabel?: string): Promise<boolean>;
|
|
251
|
+
updateClanStickerById(session: Session, id: string, request: ClanStickerUpdateByIdRequest): Promise<boolean>;
|
|
252
|
+
changeChannelCategory(session: Session, id: string, request: ChangeChannelCategoryRequest): Promise<boolean>;
|
|
253
|
+
/** */
|
|
254
|
+
setRoleChannelPermission(session: Session, request: UpdateRoleChannelRequest): Promise<boolean>;
|
|
255
|
+
addApp(session: Session, request: AddAppRequest): Promise<App>;
|
|
256
|
+
getApp(session: Session, id: string): Promise<App>;
|
|
257
|
+
listApps(session: Session): Promise<AppList>;
|
|
258
|
+
addAppToClan(session: Session, appId: string, clanId: string): Promise<boolean>;
|
|
259
|
+
getSystemMessageByClanId(session: Session, clanId: string): Promise<SystemMessage>;
|
|
260
|
+
createSystemMessage(session: Session, request: SystemMessageRequest): Promise<any>;
|
|
261
|
+
updateSystemMessage(session: Session, clanId: string, request: SystemMessageRequest): Promise<void>;
|
|
262
|
+
deleteSystemMessage(session: Session, clanId: string): Promise<any>;
|
|
263
|
+
updateCategoryOrder(session: Session, request: UpdateCategoryOrderRequest): Promise<any>;
|
|
264
|
+
/** List a channel's users. */
|
|
265
|
+
listStreamingChannelUsers(session: Session, clanId: string, channelId: string, channelType: number, state?: number, limit?: number, cursor?: string): Promise<StreamingChannelUserList>;
|
|
266
|
+
/** List a channel's users. */
|
|
267
|
+
listChannelApps(session: Session, clanId: string): Promise<ListChannelAppsResponse>;
|
|
268
|
+
getChannelCategoryNotiSettingsList(session: Session, clanId: string): Promise<NotificationChannelCategorySettingList>;
|
|
269
|
+
getNotificationCategory(session: Session, categoryId: string): Promise<NotificationUserChannel>;
|
|
270
|
+
getNotificationChannel(session: Session, channelId: string): Promise<NotificationUserChannel>;
|
|
271
|
+
getNotificationClan(session: Session, clanId: string): Promise<NotificationSetting>;
|
|
272
|
+
listChannelByUserId(session: Session): Promise<ChannelDescList>;
|
|
273
|
+
listChannelUsersUC(session: Session, channelId: string, limit: number): Promise<AllUsersAddChannelResponse>;
|
|
274
|
+
getListEmojisByUserId(session: Session): Promise<EmojiListedResponse>;
|
|
275
|
+
emojiRecentList(session: Session): Promise<EmojiRecentList>;
|
|
276
|
+
getListStickersByUserId(session: Session): Promise<StickerListedResponse>;
|
|
277
|
+
listUserClansByUserId(session: Session): Promise<AllUserClans>;
|
|
278
|
+
listRoles(session: Session, clanId?: string, limit?: number, state?: number, cursor?: string): Promise<RoleListEventResponse>;
|
|
279
|
+
listUserPermissionInChannel(session: Session, clanId?: string, channelId?: string): Promise<UserPermissionInChannelListResponse>;
|
|
280
|
+
getPermissionByRoleIdChannelId(session: Session, roleId?: string, channelId?: string, userId?: string): Promise<PermissionRoleChannelListEventResponse>;
|
|
281
|
+
markAsRead(session: Session, request: MarkAsReadRequest): Promise<any>;
|
|
282
|
+
/** List Threads. */
|
|
283
|
+
listThreadDescs(session: Session, channelId: string, limit?: number, state?: number, clanId?: string, threadId?: string, page?: number): Promise<ChannelDescList>;
|
|
284
|
+
leaveThread(session: Session, clanId: string, channelId: string): Promise<any>;
|
|
285
|
+
getChannelSettingInClan(session: Session, clanId: string, parentId?: string, categoryId?: string, privateChannel?: number, active?: number, status?: number, type?: number, limit?: number, page?: number, channelLabel?: string): Promise<ChannelSettingListResponse>;
|
|
286
|
+
getChannelCanvasList(session: Session, channelId: string, clanId?: string, limit?: number, page?: number): Promise<ChannelCanvasListResponse>;
|
|
287
|
+
getChannelCanvasDetail(session: Session, id: string, clanId?: string, channelId?: string): Promise<ChannelCanvasDetailResponse>;
|
|
288
|
+
editChannelCanvases(session: Session, request: EditChannelCanvasRequest): Promise<EditChannelCanvasResponse>;
|
|
289
|
+
deleteChannelCanvas(session: Session, canvasId: string, clanId?: string, channelId?: string): Promise<any>;
|
|
290
|
+
addFavoriteChannel(session: Session, channelId: string, clanId: string): Promise<AddFavoriteChannelResponse>;
|
|
291
|
+
removeFavoriteChannel(session: Session, clanId: string, channelId: string): Promise<any>;
|
|
292
|
+
getListFavoriteChannel(session: Session, clanId: string): Promise<ListFavoriteChannelResponse>;
|
|
293
|
+
/** List activity */
|
|
294
|
+
listActivity(session: Session): Promise<ListUserActivity>;
|
|
295
|
+
createActiviy(session: Session, request: CreateActivityRequest): Promise<UserActivity>;
|
|
296
|
+
getChanEncryptionMethod(session: Session, channelId: string): Promise<ChanEncryptionMethod>;
|
|
297
|
+
setChanEncryptionMethod(session: Session, channelId: string, method: string): Promise<void>;
|
|
298
|
+
getPubKeys(session: Session, userIds: Array<string>): Promise<GetPubKeysResponse>;
|
|
299
|
+
pushPubKey(session: Session, PK: PubKey): Promise<void>;
|
|
300
|
+
getKeyServer(session: Session): Promise<GetKeyServerResp>;
|
|
301
|
+
listAuditLog(session: Session, actionLog?: string, userId?: string, clanId?: string, dateLog?: string): Promise<ListAuditLog>;
|
|
302
|
+
listOnboarding(session: Session, clanId?: string, guideType?: number, limit?: number, page?: number): Promise<ListOnboardingResponse>;
|
|
303
|
+
getOnboardingDetail(session: Session, id: string, clanId?: string): Promise<OnboardingItem>;
|
|
304
|
+
createOnboarding(session: Session, request: CreateOnboardingRequest): Promise<ListOnboardingResponse>;
|
|
305
|
+
updateOnboarding(session: Session, id: string, request: UpdateOnboardingRequest): Promise<boolean>;
|
|
306
|
+
deleteOnboarding(session: Session, id: string, clanId?: string): Promise<any>;
|
|
307
|
+
generateClanWebhook(session: Session, request: GenerateClanWebhookRequest): Promise<GenerateClanWebhookResponse>;
|
|
308
|
+
listClanWebhook(session: Session, clanId: string): Promise<ListClanWebhookResponse>;
|
|
309
|
+
deleteClanWebhookById(session: Session, id: string, clanId: string): Promise<boolean>;
|
|
310
|
+
updateClanWebhookById(session: Session, id: string, request: UpdateClanWebhookRequest): Promise<boolean>;
|
|
311
|
+
listOnboardingStep(session: Session, clanId?: string, limit?: number, page?: number): Promise<ListOnboardingStepResponse>;
|
|
312
|
+
updateOnboardingStepByClanId(session: Session, clanId: string, request: UpdateOnboardingStepRequest): Promise<boolean>;
|
|
313
|
+
updateUserStatus(session: Session, request: UserStatusUpdate): Promise<boolean>;
|
|
314
|
+
getUserStatus(session: Session): Promise<UserStatus>;
|
|
315
|
+
listSdTopic(session: Session, clanId?: string, limit?: number): Promise<SdTopicList>;
|
|
316
|
+
createSdTopic(session: Session, request: SdTopicRequest): Promise<SdTopic>;
|
|
317
|
+
getTopicDetail(session: Session, topicId?: string): Promise<SdTopic>;
|
|
318
|
+
createRoomChannelApps(session: Session, body: CreateRoomChannelApps): Promise<CreateRoomChannelApps>;
|
|
319
|
+
/** Generate Meet Token */
|
|
320
|
+
generateMeetToken(session: Session, body: GenerateMeetTokenRequest): Promise<GenerateMeetTokenResponse>;
|
|
321
|
+
getMezonOauthClient(session: Session, clientId?: string, clientName?: string): Promise<MezonOauthClient>;
|
|
322
|
+
updateMezonOauthClient(session: Session, body: MezonOauthClient): Promise<MezonOauthClient>;
|
|
323
|
+
searchThread(session: Session, clanId?: string, channelId?: string, label?: string): Promise<ChannelDescList>;
|
|
324
|
+
generateHashChannelApps(session: Session, appId?: string): Promise<GenerateHashChannelAppsResponse>;
|
|
325
|
+
registrationPassword(session: Session, email?: string, password?: string, oldPassword?: string): Promise<Session>;
|
|
326
|
+
/** Add user event */
|
|
327
|
+
addUserEvent(session: Session, request: UserEventRequest): Promise<any>;
|
|
328
|
+
/** Delete user event */
|
|
329
|
+
deleteUserEvent(session: Session, clanId?: string, eventId?: string): Promise<any>;
|
|
330
|
+
updateRoleOrder(session: Session, request: UpdateRoleOrderRequest): Promise<any>;
|
|
331
|
+
deleteAccount(session: Session): Promise<any>;
|
|
332
|
+
createExternalMezonMeet(session: Session): Promise<GenerateMezonMeetResponse>;
|
|
333
|
+
removeMezonMeetParticipant(session: Session, request: MeetParticipantRequest): Promise<any>;
|
|
334
|
+
muteMezonMeetParticipant(session: Session, request: MeetParticipantRequest): Promise<any>;
|
|
335
|
+
/** Update clan order to view. */
|
|
336
|
+
updateClanOrder(session: Session, request: UpdateClanOrderRequest): Promise<boolean>;
|
|
337
|
+
listQuickMenuAccess(session: Session, botId: string, channelId: string, menuType: number): Promise<QuickMenuAccessList>;
|
|
338
|
+
deleteQuickMenuAccess(session: Session, id: string, clanId: string): Promise<any>;
|
|
339
|
+
addQuickMenuAccess(session: Session, request: QuickMenuAccess): Promise<any>;
|
|
340
|
+
updateQuickMenuAccess(session: Session, request: QuickMenuAccess): Promise<any>;
|
|
341
|
+
listForSaleItems(session: Session, page?: number): Promise<ForSaleItemList>;
|
|
342
|
+
isFollower(session: Session, req: IsFollowerRequest): Promise<IsFollowerResponse>;
|
|
343
|
+
transferOwnership(session: Session, req: TransferOwnershipRequest): Promise<any>;
|
|
344
|
+
isBanned(session: Session, channelId: string): Promise<IsBannedResponse>;
|
|
345
|
+
reportMessageAbuse(session: Session, messageId?: string, abuseType?: string): Promise<any>;
|
|
346
|
+
listLogedDevice(session: Session): Promise<LogedDeviceList>;
|
|
347
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { ApiAccountMezon, ApiAuthenticateEmailRequest, ApiAuthenticateSMSRequest, ApiConfirmLoginRequest, ApiGenerateMeetTokenExternalResponse, ApiInviteUserRes, ApiLinkAccountConfirmRequest, ApiListClanDiscover, ApiLoginIDResponse, ApiLoginRequest, ApiSession, ApiClanDiscoverRequest } from "./types";
|
|
2
|
+
export declare class GatewayMezonApi {
|
|
3
|
+
readonly serverKey: string;
|
|
4
|
+
readonly timeoutMs: number;
|
|
5
|
+
basePath: string;
|
|
6
|
+
constructor(serverKey: string, timeoutMs: number, basePath: string);
|
|
7
|
+
setBasePath(basePath: string): void;
|
|
8
|
+
/** A healthcheck which load balancers can use to check the service. */
|
|
9
|
+
healthcheck(bearerToken: string, options?: any): Promise<any>;
|
|
10
|
+
/** Authenticate a user with Mezon against the server. */
|
|
11
|
+
authenticateMezon(basicAuthUsername: string, basicAuthPassword: string, account: ApiAccountMezon, create?: boolean, username?: string, isRemember?: boolean, options?: any): Promise<ApiSession>;
|
|
12
|
+
/** Authenticate a user with an SMS against the server. */
|
|
13
|
+
AuthenticateSMSOTPRequest(basicAuthUsername: string, basicAuthPassword: string, body: ApiAuthenticateSMSRequest, options?: any): Promise<ApiLinkAccountConfirmRequest>;
|
|
14
|
+
/** Authenticate a user with an email+password against the server. */
|
|
15
|
+
AuthenticateEmailOTPRequest(basicAuthUsername: string, basicAuthPassword: string, body: ApiAuthenticateEmailRequest, options?: any): Promise<ApiLinkAccountConfirmRequest>;
|
|
16
|
+
/** */
|
|
17
|
+
confirmAuthenticateOTP(basicAuthUsername: string, basicAuthPassword: string, body: ApiLinkAccountConfirmRequest, options?: any): Promise<ApiSession>;
|
|
18
|
+
/** Authenticate a user with an email+password against the server. */
|
|
19
|
+
authenticateEmail(basicAuthUsername: string, basicAuthPassword: string, body: ApiAuthenticateEmailRequest, options?: any): Promise<ApiSession>;
|
|
20
|
+
/** Add users to a channel. */
|
|
21
|
+
getLinkInvite(basicAuthUsername: string, basicAuthPassword: string, inviteId: string, options?: any): Promise<ApiInviteUserRes>;
|
|
22
|
+
/** */
|
|
23
|
+
createQRLogin(basicAuthUsername: string, basicAuthPassword: string, body: ApiLoginRequest, options?: any): Promise<ApiLoginIDResponse>;
|
|
24
|
+
/** */
|
|
25
|
+
checkLoginRequest(basicAuthUsername: string, basicAuthPassword: string, body: ApiConfirmLoginRequest, options?: any): Promise<ApiSession>;
|
|
26
|
+
/** */
|
|
27
|
+
confirmLogin(bearerToken: string, basePath: string, body: ApiConfirmLoginRequest, options?: any): Promise<any>;
|
|
28
|
+
/** handler external mezon meet */
|
|
29
|
+
generateMeetTokenExternal(bearerToken: string, basePath: string, token: string, displayName?: string, isGuest?: boolean, options?: any): Promise<ApiGenerateMeetTokenExternalResponse>;
|
|
30
|
+
/** Discover mezon clan. */
|
|
31
|
+
clanDiscover(basicAuthUsername: string, basicAuthPassword: string, basePath: string, body: ApiClanDiscoverRequest, options?: any): Promise<ApiListClanDiscover>;
|
|
32
|
+
buildFullUrl(basePath: string, fragment: string, queryParams: Map<string, any>): string;
|
|
33
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2020 The Mezon Authors
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import "whatwg-fetch";
|
|
17
|
+
export * from "./client";
|
|
18
|
+
export * from "./session";
|
|
19
|
+
export * from "./socket";
|
|
20
|
+
export * from "./web_socket_adapter";
|
|
21
|
+
export * from "./utils";
|
|
22
|
+
export * from "./types";
|
|
23
|
+
export { Session } from "./session";
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2022 The Mezon Authors
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
/** A session authenticated for a user with Mezon server. */
|
|
17
|
+
export interface ISession {
|
|
18
|
+
/** Claims */
|
|
19
|
+
/** The authorization token used to construct this session. */
|
|
20
|
+
token: string;
|
|
21
|
+
/** If the user account for this session was just created. */
|
|
22
|
+
created: boolean;
|
|
23
|
+
/** The UNIX timestamp when this session was created. */
|
|
24
|
+
readonly createdAt: number;
|
|
25
|
+
/** The UNIX timestamp when this session will expire. */
|
|
26
|
+
expires_at?: number;
|
|
27
|
+
/** The UNIX timestamp when the refresh token will expire. */
|
|
28
|
+
refresh_expires_at?: number;
|
|
29
|
+
/** Refresh token that can be used for session token renewal. */
|
|
30
|
+
refreshToken: string;
|
|
31
|
+
/** The username of the user who owns this session. */
|
|
32
|
+
username?: string;
|
|
33
|
+
/** The ID of the user who owns this session. */
|
|
34
|
+
userId?: string;
|
|
35
|
+
/** Any custom properties associated with this session. */
|
|
36
|
+
vars?: object;
|
|
37
|
+
/** Validate token */
|
|
38
|
+
/** If the session has expired. */
|
|
39
|
+
isexpired(currenttime: number): boolean;
|
|
40
|
+
/** If the refresh token has expired. */
|
|
41
|
+
isrefreshexpired(currenttime: number): boolean;
|
|
42
|
+
}
|
|
43
|
+
export declare class Session implements ISession {
|
|
44
|
+
readonly created: boolean;
|
|
45
|
+
readonly apiUrl: string;
|
|
46
|
+
readonly idToken: string;
|
|
47
|
+
token: string;
|
|
48
|
+
readonly createdAt: number;
|
|
49
|
+
expires_at?: number;
|
|
50
|
+
refresh_expires_at?: number;
|
|
51
|
+
refreshToken: string;
|
|
52
|
+
username?: string;
|
|
53
|
+
userId?: string;
|
|
54
|
+
vars?: object;
|
|
55
|
+
isRemember?: boolean;
|
|
56
|
+
constructor(token: string, refreshToken: string, created: boolean, apiUrl: string, idToken: string, isRemember: boolean);
|
|
57
|
+
isexpired(currenttime: number): boolean;
|
|
58
|
+
isrefreshexpired(currenttime: number): boolean;
|
|
59
|
+
update(token: string, refreshToken: string, isRemember: boolean): void;
|
|
60
|
+
static restore(token: string, refreshToken: string, apiUrl: string, isRemember: boolean): Session;
|
|
61
|
+
}
|