mezon-light-sdk 1.0.3 → 1.0.4
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/README.md +258 -258
- package/package.json +43 -22
- package/dist/api.gen.d.ts +0 -150
- package/dist/api.gen.js +0 -149
- package/dist/client.d.ts +0 -137
- package/dist/client.js +0 -267
- package/dist/constants.d.ts +0 -16
- package/dist/constants.js +0 -19
- package/dist/google/protobuf/struct.d.ts +0 -201
- package/dist/google/protobuf/struct.js +0 -449
- package/dist/google/protobuf/wrappers.d.ts +0 -238
- package/dist/google/protobuf/wrappers.js +0 -506
- package/dist/index.d.ts +0 -5
- package/dist/index.js +0 -20
- package/dist/proto/api.d.ts +0 -24188
- package/dist/proto/api.js +0 -33287
- package/dist/proto/realtime.d.ts +0 -36125
- package/dist/proto/realtime.js +0 -13947
- package/dist/session.d.ts +0 -63
- package/dist/session.js +0 -92
- package/dist/socket.d.ts +0 -135
- package/dist/socket.gen.d.ts +0 -136
- package/dist/socket.gen.js +0 -327
- package/dist/socket.js +0 -249
- package/dist/types.d.ts +0 -44
- package/dist/types.js +0 -2
- package/dist/utils.d.ts +0 -3
- package/dist/utils.js +0 -110
- package/dist/web_socket_adapter_pb.d.ts +0 -69
- package/dist/web_socket_adapter_pb.js +0 -111
package/dist/api.gen.d.ts
DELETED
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
/** A message sent on a channel. */
|
|
2
|
-
export interface ChannelMessage {
|
|
3
|
-
id: string;
|
|
4
|
-
avatar?: string;
|
|
5
|
-
channel_id: string;
|
|
6
|
-
channel_label: string;
|
|
7
|
-
clan_id?: string;
|
|
8
|
-
code: number;
|
|
9
|
-
content: string;
|
|
10
|
-
attachments?: Array<ApiMessageAttachment>;
|
|
11
|
-
referenced_message?: string[];
|
|
12
|
-
persistent?: boolean;
|
|
13
|
-
sender_id: string;
|
|
14
|
-
update_time?: string;
|
|
15
|
-
clan_logo?: string;
|
|
16
|
-
category_name?: string;
|
|
17
|
-
username?: string;
|
|
18
|
-
clan_nick?: string;
|
|
19
|
-
clan_avatar?: string;
|
|
20
|
-
display_name?: string;
|
|
21
|
-
create_time_seconds?: number;
|
|
22
|
-
update_time_seconds?: number;
|
|
23
|
-
mode?: number;
|
|
24
|
-
message_id?: string;
|
|
25
|
-
hide_editted?: boolean;
|
|
26
|
-
is_public?: boolean;
|
|
27
|
-
topic_id?: string;
|
|
28
|
-
}
|
|
29
|
-
/** */
|
|
30
|
-
export interface ApiMessageAttachment {
|
|
31
|
-
filename?: string;
|
|
32
|
-
filetype?: string;
|
|
33
|
-
height?: number;
|
|
34
|
-
size?: number;
|
|
35
|
-
url?: string;
|
|
36
|
-
width?: number;
|
|
37
|
-
thumbnail?: string;
|
|
38
|
-
channel_id?: string;
|
|
39
|
-
mode?: number;
|
|
40
|
-
channel_label?: string;
|
|
41
|
-
message_id?: string;
|
|
42
|
-
sender_id?: string;
|
|
43
|
-
duration?: number;
|
|
44
|
-
create_time_seconds?: number;
|
|
45
|
-
}
|
|
46
|
-
/** Authenticate against the server with a refresh token. */
|
|
47
|
-
export interface ApiSessionRefreshRequest {
|
|
48
|
-
is_remember?: boolean;
|
|
49
|
-
token?: string;
|
|
50
|
-
vars?: Record<string, string>;
|
|
51
|
-
}
|
|
52
|
-
/** A user's session used to authenticate messages. */
|
|
53
|
-
export interface ApiSession {
|
|
54
|
-
created?: boolean;
|
|
55
|
-
refresh_token?: string;
|
|
56
|
-
token?: string;
|
|
57
|
-
is_remember?: boolean;
|
|
58
|
-
api_url?: string;
|
|
59
|
-
id_token?: string;
|
|
60
|
-
}
|
|
61
|
-
/** */
|
|
62
|
-
export interface ApiChannelDescription {
|
|
63
|
-
active?: number;
|
|
64
|
-
age_restricted?: number;
|
|
65
|
-
category_id?: string;
|
|
66
|
-
category_name?: string;
|
|
67
|
-
channel_id?: string;
|
|
68
|
-
channel_label?: string;
|
|
69
|
-
channel_private?: number;
|
|
70
|
-
clan_id?: string;
|
|
71
|
-
clan_name?: string;
|
|
72
|
-
count_mess_unread?: number;
|
|
73
|
-
create_time_seconds?: number;
|
|
74
|
-
creator_id?: string;
|
|
75
|
-
creator_name?: string;
|
|
76
|
-
e2ee?: number;
|
|
77
|
-
is_mute?: boolean;
|
|
78
|
-
last_pin_message?: string;
|
|
79
|
-
last_seen_message?: ApiChannelMessageHeader;
|
|
80
|
-
last_sent_message?: ApiChannelMessageHeader;
|
|
81
|
-
meeting_code?: string;
|
|
82
|
-
channel_avatar?: string;
|
|
83
|
-
parent_id?: string;
|
|
84
|
-
type?: number;
|
|
85
|
-
update_time_seconds?: number;
|
|
86
|
-
app_id?: string;
|
|
87
|
-
topic?: string;
|
|
88
|
-
user_ids?: Array<string>;
|
|
89
|
-
usernames?: Array<string>;
|
|
90
|
-
display_names?: Array<string>;
|
|
91
|
-
onlines?: Array<boolean>;
|
|
92
|
-
avatars?: Array<string>;
|
|
93
|
-
member_count?: number;
|
|
94
|
-
}
|
|
95
|
-
/** */
|
|
96
|
-
export interface ApiChannelMessageHeader {
|
|
97
|
-
attachment?: Uint8Array;
|
|
98
|
-
content?: string;
|
|
99
|
-
id?: string;
|
|
100
|
-
mention?: Uint8Array;
|
|
101
|
-
reaction?: Uint8Array;
|
|
102
|
-
reference?: Uint8Array;
|
|
103
|
-
repliers?: Array<string>;
|
|
104
|
-
sender_id?: string;
|
|
105
|
-
timestamp_seconds?: number;
|
|
106
|
-
}
|
|
107
|
-
/** Create a channel within clan. */
|
|
108
|
-
export interface ApiCreateChannelDescRequest {
|
|
109
|
-
app_id?: string;
|
|
110
|
-
category_id?: string;
|
|
111
|
-
channel_id?: string;
|
|
112
|
-
channel_label?: string;
|
|
113
|
-
channel_private?: number;
|
|
114
|
-
clan_id?: string;
|
|
115
|
-
parent_id?: string;
|
|
116
|
-
type?: number;
|
|
117
|
-
user_ids?: Array<string>;
|
|
118
|
-
}
|
|
119
|
-
export interface ApiAuthenticationIdToken {
|
|
120
|
-
/** ID token from identity provider */
|
|
121
|
-
id_token: string;
|
|
122
|
-
/** User ID associated with the token. */
|
|
123
|
-
user_id: string;
|
|
124
|
-
/** Username associated with the token. */
|
|
125
|
-
username: string;
|
|
126
|
-
}
|
|
127
|
-
export interface AuthenticationIdTokenResponse {
|
|
128
|
-
/** Authentication token */
|
|
129
|
-
token: string;
|
|
130
|
-
/** Refresh token for session renewal */
|
|
131
|
-
refresh_token: string;
|
|
132
|
-
/** API URL for the authenticated user */
|
|
133
|
-
api_url: string;
|
|
134
|
-
/** User ID of the authenticated user */
|
|
135
|
-
user_id: string;
|
|
136
|
-
}
|
|
137
|
-
export declare class MezonApi {
|
|
138
|
-
readonly serverKey: string;
|
|
139
|
-
readonly timeoutMs: number;
|
|
140
|
-
basePath: string;
|
|
141
|
-
constructor(serverKey: string, timeoutMs: number, basePath: string);
|
|
142
|
-
setBasePath(basePath: string): void;
|
|
143
|
-
/** Create a new channel with the current user as the owner. */
|
|
144
|
-
authenticateIdToken(basicAuthUsername: string, basicAuthPassword: string, body: ApiAuthenticationIdToken, options?: any): Promise<AuthenticationIdTokenResponse>;
|
|
145
|
-
/** Refresh a user's session using a refresh token retrieved from a previous authentication request. */
|
|
146
|
-
sessionRefresh(basicAuthUsername: string, basicAuthPassword: string, body: ApiSessionRefreshRequest, options?: any): Promise<ApiSession>;
|
|
147
|
-
/** Create a new channel with the current user as the owner. */
|
|
148
|
-
createChannelDesc(bearerToken: string, body: ApiCreateChannelDescRequest, options?: any): Promise<ApiChannelDescription>;
|
|
149
|
-
buildFullUrl(basePath: string, fragment: string, queryParams: Map<string, any>): string;
|
|
150
|
-
}
|
package/dist/api.gen.js
DELETED
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// tslint:disable
|
|
3
|
-
/* Code generated by openapi-gen/main.go. DO NOT EDIT. */
|
|
4
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
5
|
-
if (k2 === undefined) k2 = k;
|
|
6
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
7
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
8
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
9
|
-
}
|
|
10
|
-
Object.defineProperty(o, k2, desc);
|
|
11
|
-
}) : (function(o, m, k, k2) {
|
|
12
|
-
if (k2 === undefined) k2 = k;
|
|
13
|
-
o[k2] = m[k];
|
|
14
|
-
}));
|
|
15
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
16
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
17
|
-
}) : function(o, v) {
|
|
18
|
-
o["default"] = v;
|
|
19
|
-
});
|
|
20
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
21
|
-
if (mod && mod.__esModule) return mod;
|
|
22
|
-
var result = {};
|
|
23
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
24
|
-
__setModuleDefault(result, mod);
|
|
25
|
-
return result;
|
|
26
|
-
};
|
|
27
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
-
exports.MezonApi = void 0;
|
|
29
|
-
const utils_1 = require("./utils");
|
|
30
|
-
const tsproto = __importStar(require("./proto/api"));
|
|
31
|
-
const js_base64_1 = require("js-base64");
|
|
32
|
-
class MezonApi {
|
|
33
|
-
constructor(serverKey, timeoutMs, basePath) {
|
|
34
|
-
this.serverKey = serverKey;
|
|
35
|
-
this.timeoutMs = timeoutMs;
|
|
36
|
-
this.basePath = basePath;
|
|
37
|
-
}
|
|
38
|
-
setBasePath(basePath) {
|
|
39
|
-
this.basePath = basePath;
|
|
40
|
-
}
|
|
41
|
-
/** Create a new channel with the current user as the owner. */
|
|
42
|
-
authenticateIdToken(basicAuthUsername, basicAuthPassword, body, options = {}) {
|
|
43
|
-
if (body === null || body === undefined) {
|
|
44
|
-
throw new Error("'body' is a required parameter but is null or undefined.");
|
|
45
|
-
}
|
|
46
|
-
const urlPath = "/v2/account/authenticate/idtoken";
|
|
47
|
-
const queryParams = new Map();
|
|
48
|
-
let bodyJson = "";
|
|
49
|
-
bodyJson = JSON.stringify(body || {});
|
|
50
|
-
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
|
51
|
-
const fetchOptions = (0, utils_1.buildFetchOptions)("POST", options, bodyJson);
|
|
52
|
-
if (basicAuthUsername) {
|
|
53
|
-
fetchOptions.headers["Authorization"] = "Basic " + (0, js_base64_1.encode)(basicAuthUsername + ":" + basicAuthPassword);
|
|
54
|
-
}
|
|
55
|
-
return Promise.race([
|
|
56
|
-
fetch(fullUrl, fetchOptions).then((response) => {
|
|
57
|
-
if (response.status == 204) {
|
|
58
|
-
return response;
|
|
59
|
-
}
|
|
60
|
-
else if (response.status >= 200 && response.status < 300) {
|
|
61
|
-
return response.json();
|
|
62
|
-
}
|
|
63
|
-
else {
|
|
64
|
-
throw response;
|
|
65
|
-
}
|
|
66
|
-
}),
|
|
67
|
-
new Promise((_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")),
|
|
68
|
-
]);
|
|
69
|
-
}
|
|
70
|
-
/** Refresh a user's session using a refresh token retrieved from a previous authentication request. */
|
|
71
|
-
sessionRefresh(basicAuthUsername, basicAuthPassword, body, options = {}) {
|
|
72
|
-
if (body === null || body === undefined) {
|
|
73
|
-
throw new Error("'body' is a required parameter but is null or undefined.");
|
|
74
|
-
}
|
|
75
|
-
const urlPath = "/mezon.api.Mezon/SessionRefresh";
|
|
76
|
-
const queryParams = new Map();
|
|
77
|
-
const bodyWriter = tsproto.SessionRefreshRequest.encode(tsproto.SessionRefreshRequest.fromPartial(body));
|
|
78
|
-
const encodedBody = bodyWriter.finish();
|
|
79
|
-
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
|
80
|
-
const fetchOptions = (0, utils_1.buildFetchOptions)("POST", options, "");
|
|
81
|
-
fetchOptions.body = encodedBody;
|
|
82
|
-
if (basicAuthUsername) {
|
|
83
|
-
fetchOptions.headers["Authorization"] = "Basic " + (0, js_base64_1.encode)(basicAuthUsername + ":" + basicAuthPassword);
|
|
84
|
-
}
|
|
85
|
-
return Promise.race([
|
|
86
|
-
fetch(fullUrl, fetchOptions).then(async (response) => {
|
|
87
|
-
if (response.status == 204) {
|
|
88
|
-
return {};
|
|
89
|
-
}
|
|
90
|
-
else if (response.status >= 200 && response.status < 300) {
|
|
91
|
-
const buffer = await response.arrayBuffer();
|
|
92
|
-
return tsproto.Session.decode(new Uint8Array(buffer));
|
|
93
|
-
}
|
|
94
|
-
else {
|
|
95
|
-
throw response;
|
|
96
|
-
}
|
|
97
|
-
}),
|
|
98
|
-
new Promise((_, reject) => setTimeout(() => reject(new Error("Request timed out.")), this.timeoutMs)),
|
|
99
|
-
]);
|
|
100
|
-
}
|
|
101
|
-
/** Create a new channel with the current user as the owner. */
|
|
102
|
-
createChannelDesc(bearerToken, body, options = {}) {
|
|
103
|
-
if (body === null || body === undefined) {
|
|
104
|
-
throw new Error("'body' is a required parameter but is null or undefined.");
|
|
105
|
-
}
|
|
106
|
-
const urlPath = "/mezon.api.Mezon/CreateChannelDesc";
|
|
107
|
-
const queryParams = new Map();
|
|
108
|
-
const bodyWriter = tsproto.CreateChannelDescRequest.encode(tsproto.CreateChannelDescRequest.fromPartial(body));
|
|
109
|
-
const encodedBody = bodyWriter.finish();
|
|
110
|
-
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
|
111
|
-
const fetchOptions = (0, utils_1.buildFetchOptions)("POST", options, "");
|
|
112
|
-
fetchOptions.body = encodedBody;
|
|
113
|
-
if (bearerToken) {
|
|
114
|
-
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
|
115
|
-
}
|
|
116
|
-
return Promise.race([
|
|
117
|
-
fetch(fullUrl, fetchOptions).then(async (response) => {
|
|
118
|
-
if (response.status == 204) {
|
|
119
|
-
return {};
|
|
120
|
-
}
|
|
121
|
-
else if (response.status >= 200 && response.status < 300) {
|
|
122
|
-
const buffer = await response.arrayBuffer();
|
|
123
|
-
return tsproto.ChannelDescription.decode(new Uint8Array(buffer));
|
|
124
|
-
}
|
|
125
|
-
else {
|
|
126
|
-
throw response;
|
|
127
|
-
}
|
|
128
|
-
}),
|
|
129
|
-
new Promise((_, reject) => setTimeout(() => reject(new Error("Request timed out.")), this.timeoutMs)),
|
|
130
|
-
]);
|
|
131
|
-
}
|
|
132
|
-
buildFullUrl(basePath, fragment, queryParams) {
|
|
133
|
-
let fullPath = basePath + fragment + "?";
|
|
134
|
-
for (let [k, v] of queryParams) {
|
|
135
|
-
if (v instanceof Array) {
|
|
136
|
-
fullPath += v.reduce((prev, curr) => {
|
|
137
|
-
return prev + encodeURIComponent(k) + "=" + encodeURIComponent(curr) + "&";
|
|
138
|
-
}, "");
|
|
139
|
-
}
|
|
140
|
-
else {
|
|
141
|
-
if (v != null) {
|
|
142
|
-
fullPath += encodeURIComponent(k) + "=" + encodeURIComponent(v) + "&";
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
return fullPath;
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
exports.MezonApi = MezonApi;
|
package/dist/client.d.ts
DELETED
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
import { Session } from "./session";
|
|
2
|
-
import { ApiSession, MezonApi } from "./api.gen";
|
|
3
|
-
import { ClientInitConfig, AuthenticateConfig } from "./types";
|
|
4
|
-
import { ApiChannelDescription } from "./api.gen";
|
|
5
|
-
import { WebSocketAdapter } from "./web_socket_adapter_pb";
|
|
6
|
-
import { Socket } from "./socket.gen";
|
|
7
|
-
/**
|
|
8
|
-
* Error thrown when authentication fails.
|
|
9
|
-
*/
|
|
10
|
-
export declare class AuthenticationError extends Error {
|
|
11
|
-
readonly statusCode?: number | undefined;
|
|
12
|
-
constructor(message?: string, statusCode?: number | undefined);
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Error thrown when session-related operations fail.
|
|
16
|
-
*/
|
|
17
|
-
export declare class SessionError extends Error {
|
|
18
|
-
constructor(message?: string);
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* LightClient provides a simplified interface for Mezon authentication and channel management.
|
|
22
|
-
*
|
|
23
|
-
* @example
|
|
24
|
-
* ```typescript
|
|
25
|
-
* // Initialize from existing tokens
|
|
26
|
-
* const client = LightClient.initClient({
|
|
27
|
-
* token: 'your-token',
|
|
28
|
-
* refresh_token: 'your-refresh-token',
|
|
29
|
-
* api_url: 'https://api.mezon.ai',
|
|
30
|
-
* user_id: 'user-123'
|
|
31
|
-
* });
|
|
32
|
-
*
|
|
33
|
-
* // Or authenticate with ID token
|
|
34
|
-
* const client = await LightClient.authenticate({
|
|
35
|
-
* id_token: 'id-token-from-provider',
|
|
36
|
-
* user_id: 'user-123',
|
|
37
|
-
* username: 'johndoe'
|
|
38
|
-
* });
|
|
39
|
-
* ```
|
|
40
|
-
*/
|
|
41
|
-
export declare class LightClient {
|
|
42
|
-
private readonly _session;
|
|
43
|
-
private readonly _client;
|
|
44
|
-
private readonly _userId;
|
|
45
|
-
/** Promise that resolves when the refresh token operation completes */
|
|
46
|
-
private refreshTokenPromise;
|
|
47
|
-
private constructor();
|
|
48
|
-
/**
|
|
49
|
-
* Gets the current user ID.
|
|
50
|
-
*/
|
|
51
|
-
get userId(): string;
|
|
52
|
-
/**
|
|
53
|
-
* Gets the underlying Mezon session.
|
|
54
|
-
*/
|
|
55
|
-
get session(): Session;
|
|
56
|
-
/**
|
|
57
|
-
* Gets the underlying Mezon client.
|
|
58
|
-
*/
|
|
59
|
-
get client(): MezonApi;
|
|
60
|
-
/**
|
|
61
|
-
* Initializes a LightClient from existing session tokens.
|
|
62
|
-
* Use this when you have stored tokens from a previous authentication.
|
|
63
|
-
*
|
|
64
|
-
* @param config - Configuration containing tokens and connection details
|
|
65
|
-
* @returns A new LightClient instance
|
|
66
|
-
* @throws {SessionError} If required fields are missing
|
|
67
|
-
*/
|
|
68
|
-
static initClient(config: ClientInitConfig): LightClient;
|
|
69
|
-
/**
|
|
70
|
-
* Authenticates a user with an ID token from an identity provider.
|
|
71
|
-
*
|
|
72
|
-
* @param config - Authentication configuration
|
|
73
|
-
* @returns A promise that resolves to a new LightClient instance
|
|
74
|
-
* @throws {AuthenticationError} If authentication fails or response is invalid
|
|
75
|
-
*/
|
|
76
|
-
static authenticate(config: AuthenticateConfig): Promise<LightClient>;
|
|
77
|
-
/**
|
|
78
|
-
* Creates a direct message channel with a single user.
|
|
79
|
-
*
|
|
80
|
-
* @param peerId - The user ID to create a DM channel with
|
|
81
|
-
* @returns A promise that resolves to the created channel descriptor
|
|
82
|
-
*/
|
|
83
|
-
createDM(peerId: string): Promise<ApiChannelDescription>;
|
|
84
|
-
/**
|
|
85
|
-
* Creates a group direct message channel with multiple users.
|
|
86
|
-
*
|
|
87
|
-
* @param userIds - Array of user IDs to include in the group DM
|
|
88
|
-
* @returns A promise that resolves to the created channel descriptor
|
|
89
|
-
*/
|
|
90
|
-
createGroupDM(userIds: string[]): Promise<ApiChannelDescription>;
|
|
91
|
-
/**
|
|
92
|
-
* Refreshes the current session using the refresh token.
|
|
93
|
-
* Call this before the session expires to maintain connectivity.
|
|
94
|
-
*
|
|
95
|
-
* @returns A promise that resolves when the session is refreshed
|
|
96
|
-
*/
|
|
97
|
-
refreshSession(): Promise<Session>;
|
|
98
|
-
/** A socket created with the client's configuration. */
|
|
99
|
-
createSocket(verbose?: boolean, adapter?: WebSocketAdapter, sendTimeoutMs?: number): Socket;
|
|
100
|
-
/**
|
|
101
|
-
* Called when a token refresh is initiated.
|
|
102
|
-
* This is a placeholder method that subclasses or instances can override
|
|
103
|
-
* to perform actions before or after the refresh logic.
|
|
104
|
-
*/
|
|
105
|
-
onRefreshSession(session: ApiSession): void;
|
|
106
|
-
/**
|
|
107
|
-
* Checks if the current session token has expired.
|
|
108
|
-
*
|
|
109
|
-
* @returns True if the session is expired, false otherwise
|
|
110
|
-
*/
|
|
111
|
-
isSessionExpired(): boolean;
|
|
112
|
-
/**
|
|
113
|
-
* Checks if the refresh token has expired.
|
|
114
|
-
* If this returns true, the user needs to re-authenticate.
|
|
115
|
-
*
|
|
116
|
-
* @returns True if the refresh token is expired, false otherwise
|
|
117
|
-
*/
|
|
118
|
-
isRefreshSessionExpired(): boolean;
|
|
119
|
-
/**
|
|
120
|
-
* Gets the authentication token for external use.
|
|
121
|
-
*/
|
|
122
|
-
getToken(): string;
|
|
123
|
-
/**
|
|
124
|
-
* Gets the refresh token for storage.
|
|
125
|
-
*/
|
|
126
|
-
getRefreshToken(): string;
|
|
127
|
-
/**
|
|
128
|
-
* Gets the current session.
|
|
129
|
-
*/
|
|
130
|
-
getSession(): Session;
|
|
131
|
-
/**
|
|
132
|
-
* Exports session data for storage and later restoration.
|
|
133
|
-
*
|
|
134
|
-
* @returns Object containing all data needed to restore the session
|
|
135
|
-
*/
|
|
136
|
-
exportSession(): ClientInitConfig;
|
|
137
|
-
}
|