@oxog/authkeeper 1.3.1 → 1.4.0
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/CHANGELOG.md +16 -0
- package/README.md +80 -2
- package/dist/auth-source-BaZ_-Fu7.d.cts +24 -0
- package/dist/auth-source-Cm0R6C6I.d.ts +24 -0
- package/dist/chunk-62XK5QLP.cjs +19 -0
- package/dist/chunk-62XK5QLP.cjs.map +1 -0
- package/dist/chunk-CYCWWUCJ.js +17 -0
- package/dist/chunk-CYCWWUCJ.js.map +1 -0
- package/dist/{chunk-NZPSW4M7.cjs → chunk-EXV2RG6T.cjs} +14 -27
- package/dist/chunk-EXV2RG6T.cjs.map +1 -0
- package/dist/{chunk-XUTTHBMF.js → chunk-KE7V52DI.js} +4 -16
- package/dist/chunk-KE7V52DI.js.map +1 -0
- package/dist/chunk-KLT44YR2.cjs +69 -0
- package/dist/chunk-KLT44YR2.cjs.map +1 -0
- package/dist/chunk-SUGFPZ6O.js +66 -0
- package/dist/chunk-SUGFPZ6O.js.map +1 -0
- package/dist/index-BF4j_buH.d.ts +488 -0
- package/dist/index-CuvfPscu.d.cts +488 -0
- package/dist/index.cjs +69 -54
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +9 -3
- package/dist/index.d.ts +9 -3
- package/dist/index.js +21 -5
- package/dist/index.js.map +1 -1
- package/dist/plugins/index.cjs +15 -14
- package/dist/plugins/index.d.cts +2 -1
- package/dist/plugins/index.d.ts +2 -1
- package/dist/plugins/index.js +2 -1
- package/dist/react/index.cjs +40 -3
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.d.cts +42 -5
- package/dist/react/index.d.ts +42 -5
- package/dist/react/index.js +38 -3
- package/dist/react/index.js.map +1 -1
- package/dist/svelte/index.cjs +37 -3
- package/dist/svelte/index.cjs.map +1 -1
- package/dist/svelte/index.d.cts +23 -5
- package/dist/svelte/index.d.ts +23 -5
- package/dist/svelte/index.js +37 -3
- package/dist/svelte/index.js.map +1 -1
- package/dist/types-Bmo8S8O4.d.cts +421 -0
- package/dist/types-Bmo8S8O4.d.ts +421 -0
- package/dist/vue/index.cjs +46 -3
- package/dist/vue/index.cjs.map +1 -1
- package/dist/vue/index.d.cts +45 -5
- package/dist/vue/index.d.ts +45 -5
- package/dist/vue/index.js +43 -3
- package/dist/vue/index.js.map +1 -1
- package/package.json +10 -5
- package/dist/chunk-NZPSW4M7.cjs.map +0 -1
- package/dist/chunk-XUTTHBMF.js.map +0 -1
- package/dist/index-BakvZ2rC.d.cts +0 -906
- package/dist/index-BakvZ2rC.d.ts +0 -906
|
@@ -1,906 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* AuthKeeper Type Definitions
|
|
3
|
-
*
|
|
4
|
-
* Complete type system for the AuthKeeper library.
|
|
5
|
-
* All interfaces and types are exported for use by consumers.
|
|
6
|
-
*/
|
|
7
|
-
/**
|
|
8
|
-
* Token set returned from authentication/refresh operations
|
|
9
|
-
*/
|
|
10
|
-
interface TokenSet {
|
|
11
|
-
/** JWT access token */
|
|
12
|
-
accessToken: string;
|
|
13
|
-
/** Optional refresh token for obtaining new access tokens */
|
|
14
|
-
refreshToken?: string;
|
|
15
|
-
/** Token expiration in seconds from now */
|
|
16
|
-
expiresIn?: number;
|
|
17
|
-
/** Token expiration as Unix timestamp (seconds) */
|
|
18
|
-
expiresAt?: number;
|
|
19
|
-
/** Token type (default: 'Bearer') */
|
|
20
|
-
tokenType?: string;
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Standard JWT payload with common claims
|
|
24
|
-
*/
|
|
25
|
-
interface TokenPayload {
|
|
26
|
-
/** Subject - usually the user ID */
|
|
27
|
-
sub?: string;
|
|
28
|
-
/** Issuer - who created the token */
|
|
29
|
-
iss?: string;
|
|
30
|
-
/** Audience - who the token is intended for */
|
|
31
|
-
aud?: string | string[];
|
|
32
|
-
/** Expiration time (Unix timestamp in seconds) */
|
|
33
|
-
exp?: number;
|
|
34
|
-
/** Not before time (Unix timestamp in seconds) */
|
|
35
|
-
nbf?: number;
|
|
36
|
-
/** Issued at time (Unix timestamp in seconds) */
|
|
37
|
-
iat?: number;
|
|
38
|
-
/** JWT ID - unique identifier */
|
|
39
|
-
jti?: string;
|
|
40
|
-
/** User email address */
|
|
41
|
-
email?: string;
|
|
42
|
-
/** User display name */
|
|
43
|
-
name?: string;
|
|
44
|
-
/** User roles */
|
|
45
|
-
roles?: string[];
|
|
46
|
-
/** User permissions */
|
|
47
|
-
permissions?: string[];
|
|
48
|
-
/** OAuth2 scope */
|
|
49
|
-
scope?: string;
|
|
50
|
-
[key: string]: unknown;
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* JWT header information
|
|
54
|
-
*/
|
|
55
|
-
interface TokenHeader {
|
|
56
|
-
/** Algorithm used to sign the token */
|
|
57
|
-
alg: string;
|
|
58
|
-
/** Token type (usually 'JWT') */
|
|
59
|
-
typ?: string;
|
|
60
|
-
/** Key ID used to sign the token */
|
|
61
|
-
kid?: string;
|
|
62
|
-
[key: string]: unknown;
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* Complete token information including decoded parts
|
|
66
|
-
*/
|
|
67
|
-
interface TokenInfo {
|
|
68
|
-
/** Raw JWT string */
|
|
69
|
-
raw: string;
|
|
70
|
-
/** Decoded payload */
|
|
71
|
-
payload: TokenPayload;
|
|
72
|
-
/** Decoded header */
|
|
73
|
-
header: TokenHeader;
|
|
74
|
-
/** When the token expires (null if no expiry) */
|
|
75
|
-
expiresAt: Date | null;
|
|
76
|
-
/** Whether the token is expired */
|
|
77
|
-
isExpired: boolean;
|
|
78
|
-
/** Time until expiry in milliseconds (null if no expiry) */
|
|
79
|
-
expiresIn: number | null;
|
|
80
|
-
}
|
|
81
|
-
/**
|
|
82
|
-
* Stored token data with metadata
|
|
83
|
-
*/
|
|
84
|
-
interface StoredTokens {
|
|
85
|
-
/** Access token */
|
|
86
|
-
accessToken: string;
|
|
87
|
-
/** Refresh token (null if not available) */
|
|
88
|
-
refreshToken: string | null;
|
|
89
|
-
/** Token type (e.g., 'Bearer') */
|
|
90
|
-
tokenType: string;
|
|
91
|
-
/** Expiration timestamp in milliseconds (null if no expiry) */
|
|
92
|
-
expiresAt: number | null;
|
|
93
|
-
/** When tokens were set (timestamp in milliseconds) */
|
|
94
|
-
setAt: number;
|
|
95
|
-
/** Number of times tokens have been refreshed */
|
|
96
|
-
refreshCount: number;
|
|
97
|
-
}
|
|
98
|
-
/**
|
|
99
|
-
* Error codes for authentication errors
|
|
100
|
-
*/
|
|
101
|
-
type AuthErrorCode = 'TOKEN_EXPIRED' | 'TOKEN_INVALID' | 'TOKEN_DECODE_FAILED' | 'REFRESH_FAILED' | 'REFRESH_TOKEN_MISSING' | 'STORAGE_ERROR' | 'NETWORK_ERROR' | 'UNAUTHORIZED' | 'FORBIDDEN' | 'OAUTH_ERROR' | 'PKCE_ERROR' | 'CALLBACK_ERROR' | 'CONFIG_ERROR';
|
|
102
|
-
/**
|
|
103
|
-
* Options for creating an AuthError
|
|
104
|
-
*/
|
|
105
|
-
interface AuthErrorOptions {
|
|
106
|
-
/** Additional context about the error */
|
|
107
|
-
context?: Record<string, unknown>;
|
|
108
|
-
/** Original error that caused this error */
|
|
109
|
-
cause?: Error;
|
|
110
|
-
}
|
|
111
|
-
/**
|
|
112
|
-
* Custom error class for authentication errors
|
|
113
|
-
*/
|
|
114
|
-
declare class AuthError extends Error {
|
|
115
|
-
/** Error code identifying the type of error */
|
|
116
|
-
code: AuthErrorCode;
|
|
117
|
-
/** Additional context about the error */
|
|
118
|
-
context?: Record<string, unknown>;
|
|
119
|
-
/** Original error that caused this error */
|
|
120
|
-
cause?: Error;
|
|
121
|
-
constructor(code: AuthErrorCode, message: string, options?: AuthErrorOptions);
|
|
122
|
-
}
|
|
123
|
-
/**
|
|
124
|
-
* All possible event types
|
|
125
|
-
*/
|
|
126
|
-
type EventType = 'login' | 'logout' | 'refresh' | 'expired' | 'error' | 'storage-change' | 'tab-sync';
|
|
127
|
-
/**
|
|
128
|
-
* Login event - fired when user logs in
|
|
129
|
-
*/
|
|
130
|
-
interface LoginEvent {
|
|
131
|
-
type: 'login';
|
|
132
|
-
tokens: TokenSet;
|
|
133
|
-
timestamp: number;
|
|
134
|
-
}
|
|
135
|
-
/**
|
|
136
|
-
* Logout event - fired when user logs out
|
|
137
|
-
*/
|
|
138
|
-
interface LogoutEvent {
|
|
139
|
-
type: 'logout';
|
|
140
|
-
reason: 'manual' | 'expired' | 'error' | 'tab-sync';
|
|
141
|
-
timestamp: number;
|
|
142
|
-
}
|
|
143
|
-
/**
|
|
144
|
-
* Refresh event - fired when tokens are refreshed
|
|
145
|
-
*/
|
|
146
|
-
interface RefreshEvent {
|
|
147
|
-
type: 'refresh';
|
|
148
|
-
tokens: TokenSet;
|
|
149
|
-
previousExpiresAt: Date | null;
|
|
150
|
-
newExpiresAt: Date | null;
|
|
151
|
-
timestamp: number;
|
|
152
|
-
}
|
|
153
|
-
/**
|
|
154
|
-
* Expired event - fired when token expires
|
|
155
|
-
*/
|
|
156
|
-
interface ExpiredEvent {
|
|
157
|
-
type: 'expired';
|
|
158
|
-
expiredAt: Date;
|
|
159
|
-
timestamp: number;
|
|
160
|
-
}
|
|
161
|
-
/**
|
|
162
|
-
* Error event - fired when an error occurs
|
|
163
|
-
*/
|
|
164
|
-
interface ErrorEvent {
|
|
165
|
-
type: 'error';
|
|
166
|
-
error: AuthError;
|
|
167
|
-
context: 'refresh' | 'storage' | 'decode' | 'network' | 'plugin';
|
|
168
|
-
timestamp: number;
|
|
169
|
-
}
|
|
170
|
-
/**
|
|
171
|
-
* Storage change event - fired when storage changes
|
|
172
|
-
*/
|
|
173
|
-
interface StorageChangeEvent {
|
|
174
|
-
type: 'storage-change';
|
|
175
|
-
key: string;
|
|
176
|
-
oldValue: string | null;
|
|
177
|
-
newValue: string | null;
|
|
178
|
-
timestamp: number;
|
|
179
|
-
}
|
|
180
|
-
/**
|
|
181
|
-
* Tab sync event - fired when syncing across tabs
|
|
182
|
-
*/
|
|
183
|
-
interface TabSyncEvent {
|
|
184
|
-
type: 'tab-sync';
|
|
185
|
-
action: 'login' | 'logout' | 'refresh';
|
|
186
|
-
sourceTabId: string;
|
|
187
|
-
timestamp: number;
|
|
188
|
-
}
|
|
189
|
-
/**
|
|
190
|
-
* Union of all event types
|
|
191
|
-
*/
|
|
192
|
-
type AuthEvent = LoginEvent | LogoutEvent | RefreshEvent | ExpiredEvent | ErrorEvent | StorageChangeEvent | TabSyncEvent;
|
|
193
|
-
/**
|
|
194
|
-
* Event handler function type
|
|
195
|
-
*/
|
|
196
|
-
type EventHandler<E extends EventType> = (event: Extract<AuthEvent, {
|
|
197
|
-
type: E;
|
|
198
|
-
}>) => void;
|
|
199
|
-
/**
|
|
200
|
-
* Unsubscribe function returned from event handlers
|
|
201
|
-
*/
|
|
202
|
-
type Unsubscribe = () => void;
|
|
203
|
-
/**
|
|
204
|
-
* Storage adapter interface for token persistence
|
|
205
|
-
*/
|
|
206
|
-
interface StorageAdapter {
|
|
207
|
-
/** Get value by key */
|
|
208
|
-
get(key: string): string | null;
|
|
209
|
-
/** Set value by key */
|
|
210
|
-
set(key: string, value: string): void;
|
|
211
|
-
/** Remove value by key */
|
|
212
|
-
remove(key: string): void;
|
|
213
|
-
/** Clear all values */
|
|
214
|
-
clear(): void;
|
|
215
|
-
}
|
|
216
|
-
/**
|
|
217
|
-
* Built-in storage types
|
|
218
|
-
*/
|
|
219
|
-
type StorageType = 'memory' | 'localStorage' | 'sessionStorage' | 'cookie';
|
|
220
|
-
/**
|
|
221
|
-
* Plugin interface for extending AuthKeeper
|
|
222
|
-
*/
|
|
223
|
-
interface Plugin {
|
|
224
|
-
/** Unique plugin name */
|
|
225
|
-
name: string;
|
|
226
|
-
/** Plugin version */
|
|
227
|
-
version: string;
|
|
228
|
-
/** Plugin type */
|
|
229
|
-
type: 'core' | 'optional';
|
|
230
|
-
/** Install plugin and return API */
|
|
231
|
-
install(kernel: AuthKeeper): any;
|
|
232
|
-
/** Uninstall plugin and cleanup */
|
|
233
|
-
uninstall?(): void | Promise<void>;
|
|
234
|
-
/** Reserved lifecycle hooks; not invoked by the kernel yet */
|
|
235
|
-
hooks?: {
|
|
236
|
-
/** Called before tokens are set */
|
|
237
|
-
beforeSetTokens?: (tokens: TokenSet) => TokenSet | false;
|
|
238
|
-
/** Called after tokens are set */
|
|
239
|
-
afterSetTokens?: (tokens: TokenSet) => void;
|
|
240
|
-
/** Called before refresh */
|
|
241
|
-
beforeRefresh?: () => boolean;
|
|
242
|
-
/** Called after refresh */
|
|
243
|
-
afterRefresh?: (tokens: TokenSet) => void;
|
|
244
|
-
/** Called before logout */
|
|
245
|
-
beforeLogout?: () => boolean;
|
|
246
|
-
/** Called after logout */
|
|
247
|
-
afterLogout?: () => void;
|
|
248
|
-
/** Called when token expires */
|
|
249
|
-
onExpired?: () => void;
|
|
250
|
-
/** Called on error */
|
|
251
|
-
onError?: (error: AuthError) => void;
|
|
252
|
-
/** Called before request */
|
|
253
|
-
beforeRequest?: (request: Request) => Request;
|
|
254
|
-
/** Called after response */
|
|
255
|
-
afterResponse?: (response: Response) => Response;
|
|
256
|
-
};
|
|
257
|
-
/** Plugin API exposed to consumers */
|
|
258
|
-
api?: Record<string, unknown>;
|
|
259
|
-
}
|
|
260
|
-
/**
|
|
261
|
-
* Plugin information
|
|
262
|
-
*/
|
|
263
|
-
interface PluginInfo {
|
|
264
|
-
name: string;
|
|
265
|
-
version: string;
|
|
266
|
-
type: 'core' | 'optional';
|
|
267
|
-
enabled: boolean;
|
|
268
|
-
}
|
|
269
|
-
/**
|
|
270
|
-
* Refresh token function type
|
|
271
|
-
*/
|
|
272
|
-
type RefreshTokenFn = (refreshToken: string) => Promise<TokenSet>;
|
|
273
|
-
/**
|
|
274
|
-
* Kernel configuration options
|
|
275
|
-
*/
|
|
276
|
-
interface KernelOptions {
|
|
277
|
-
/**
|
|
278
|
-
* Where tokens are persisted (default: 'memory', i.e. not persisted).
|
|
279
|
-
* 'localStorage' / 'sessionStorage' / 'cookie' fall back to memory where
|
|
280
|
-
* unavailable. Persistent storage is readable by any script on the page.
|
|
281
|
-
*/
|
|
282
|
-
storage?: StorageType | StorageAdapter;
|
|
283
|
-
/** Function to refresh tokens */
|
|
284
|
-
refreshToken: RefreshTokenFn;
|
|
285
|
-
/** Enable automatic token refresh (default: true) */
|
|
286
|
-
autoRefresh?: boolean;
|
|
287
|
-
/** Seconds before expiry to refresh (default: 60) */
|
|
288
|
-
refreshThreshold?: number;
|
|
289
|
-
/**
|
|
290
|
-
* Reserved for multi-tab sync; not implemented yet (currently a no-op).
|
|
291
|
-
* `getOptions().syncTabs` always reports `false`.
|
|
292
|
-
*/
|
|
293
|
-
syncTabs?: boolean;
|
|
294
|
-
/** Error handler */
|
|
295
|
-
onError?: (error: AuthError) => void;
|
|
296
|
-
/** Additional plugins to install */
|
|
297
|
-
plugins?: Plugin[];
|
|
298
|
-
}
|
|
299
|
-
/**
|
|
300
|
-
* Logout options
|
|
301
|
-
*/
|
|
302
|
-
interface LogoutOptions {
|
|
303
|
-
/** Reserved for multi-tab logout; not implemented yet (currently a no-op) */
|
|
304
|
-
allTabs?: boolean;
|
|
305
|
-
/** Redirect URL after logout */
|
|
306
|
-
redirect?: string;
|
|
307
|
-
}
|
|
308
|
-
/**
|
|
309
|
-
* Authenticated fetch function
|
|
310
|
-
*/
|
|
311
|
-
type AuthFetch = (input: RequestInfo | URL, init?: RequestInit) => Promise<Response>;
|
|
312
|
-
/**
|
|
313
|
-
* Fetch interceptor options
|
|
314
|
-
*/
|
|
315
|
-
interface FetchInterceptorOptions {
|
|
316
|
-
/** Header name for auth token (default: 'Authorization') */
|
|
317
|
-
headerName?: string;
|
|
318
|
-
/** Header prefix (default: 'Bearer ') */
|
|
319
|
-
headerPrefix?: string;
|
|
320
|
-
/** Only include auth header for these URLs */
|
|
321
|
-
includeUrls?: (string | RegExp)[];
|
|
322
|
-
/** Exclude auth header for these URLs */
|
|
323
|
-
excludeUrls?: (string | RegExp)[];
|
|
324
|
-
/** Callback on 401 response */
|
|
325
|
-
onUnauthorized?: (response: Response) => void;
|
|
326
|
-
/** Retry on 401 after refresh (default: true) */
|
|
327
|
-
retry401?: boolean;
|
|
328
|
-
/** Max retries (default: 1) */
|
|
329
|
-
maxRetries?: number;
|
|
330
|
-
}
|
|
331
|
-
/**
|
|
332
|
-
* OAuth2 login options
|
|
333
|
-
*/
|
|
334
|
-
interface LoginOptions {
|
|
335
|
-
/** OAuth2 scope */
|
|
336
|
-
scope?: string;
|
|
337
|
-
/** OAuth2 state parameter */
|
|
338
|
-
state?: string;
|
|
339
|
-
/** OAuth2 prompt parameter */
|
|
340
|
-
prompt?: 'none' | 'login' | 'consent' | 'select_account';
|
|
341
|
-
/** Login hint (email, etc.) */
|
|
342
|
-
loginHint?: string;
|
|
343
|
-
/** Additional OAuth2 parameters */
|
|
344
|
-
extraParams?: Record<string, string>;
|
|
345
|
-
}
|
|
346
|
-
/**
|
|
347
|
-
* User info from OIDC userinfo endpoint
|
|
348
|
-
*/
|
|
349
|
-
interface UserInfo {
|
|
350
|
-
sub: string;
|
|
351
|
-
email?: string;
|
|
352
|
-
name?: string;
|
|
353
|
-
picture?: string;
|
|
354
|
-
[key: string]: unknown;
|
|
355
|
-
}
|
|
356
|
-
/**
|
|
357
|
-
* Main AuthKeeper interface - the kernel
|
|
358
|
-
*/
|
|
359
|
-
interface AuthKeeper {
|
|
360
|
-
/** Set authentication tokens */
|
|
361
|
-
setTokens(tokens: TokenSet): void;
|
|
362
|
-
/** Get access token */
|
|
363
|
-
getAccessToken(): string | null;
|
|
364
|
-
/** Get refresh token */
|
|
365
|
-
getRefreshToken(): string | null;
|
|
366
|
-
/** Clear all tokens */
|
|
367
|
-
clearTokens(): void;
|
|
368
|
-
/** Check if user is authenticated */
|
|
369
|
-
isAuthenticated(): boolean;
|
|
370
|
-
/** Check if token is expired */
|
|
371
|
-
isExpired(): boolean;
|
|
372
|
-
/** Get token expiration date */
|
|
373
|
-
getExpiresAt(): Date | null;
|
|
374
|
-
/** Get time until expiry in milliseconds */
|
|
375
|
-
getTimeUntilExpiry(): number | null;
|
|
376
|
-
/** Decode token payload */
|
|
377
|
-
decode<T = TokenPayload>(): T | null;
|
|
378
|
-
/** Get specific claim from token */
|
|
379
|
-
getClaim<K extends keyof TokenPayload>(key: K): TokenPayload[K] | undefined;
|
|
380
|
-
/** Get multiple claims from token */
|
|
381
|
-
getClaims<K extends keyof TokenPayload>(keys: K[]): Pick<TokenPayload, K>;
|
|
382
|
-
/** Manually refresh tokens */
|
|
383
|
-
refresh(): Promise<TokenSet>;
|
|
384
|
-
/** Schedule automatic refresh */
|
|
385
|
-
scheduleRefresh(): void;
|
|
386
|
-
/** Cancel scheduled refresh */
|
|
387
|
-
cancelScheduledRefresh(): void;
|
|
388
|
-
/** Logout user */
|
|
389
|
-
logout(options?: LogoutOptions): void;
|
|
390
|
-
/** Create authenticated fetch function */
|
|
391
|
-
createFetch(options?: FetchInterceptorOptions): AuthFetch;
|
|
392
|
-
/** Wrap global fetch with auth */
|
|
393
|
-
wrapFetch(fetch: typeof globalThis.fetch): void;
|
|
394
|
-
/**
|
|
395
|
-
* Register and install a plugin. Rejects if installation fails; the failure
|
|
396
|
-
* is also emitted as an 'error' event with context 'plugin'.
|
|
397
|
-
*/
|
|
398
|
-
register(plugin: Plugin): Promise<void>;
|
|
399
|
-
/** Unregister a plugin */
|
|
400
|
-
unregister(pluginName: string): Promise<void>;
|
|
401
|
-
/** Get plugin by name */
|
|
402
|
-
getPlugin<P extends Plugin>(name: string): P | undefined;
|
|
403
|
-
/** List all plugins */
|
|
404
|
-
listPlugins(): PluginInfo[];
|
|
405
|
-
/** Emit an event */
|
|
406
|
-
emit(event: AuthEvent): void;
|
|
407
|
-
/** Subscribe to events */
|
|
408
|
-
on<E extends EventType>(eventType: E, handler: EventHandler<E>): Unsubscribe;
|
|
409
|
-
/** Unsubscribe from events */
|
|
410
|
-
off<E extends EventType>(eventType: E, handler: EventHandler<E>): void;
|
|
411
|
-
/** Initialize kernel */
|
|
412
|
-
init(): Promise<void>;
|
|
413
|
-
/** Destroy kernel and cleanup */
|
|
414
|
-
destroy(): void;
|
|
415
|
-
/** Update configuration */
|
|
416
|
-
configure(options: Partial<KernelOptions>): void;
|
|
417
|
-
/** Get current configuration */
|
|
418
|
-
getOptions(): KernelOptions;
|
|
419
|
-
}
|
|
420
|
-
|
|
421
|
-
/**
|
|
422
|
-
* Token Store Plugin
|
|
423
|
-
*
|
|
424
|
-
* Core plugin for token state management.
|
|
425
|
-
* Stores tokens in memory with metadata (setAt, refreshCount).
|
|
426
|
-
*/
|
|
427
|
-
|
|
428
|
-
/**
|
|
429
|
-
* Token Store API
|
|
430
|
-
*/
|
|
431
|
-
interface TokenStoreAPI {
|
|
432
|
-
set(tokens: TokenSet): void;
|
|
433
|
-
get(): StoredTokens | null;
|
|
434
|
-
clear(): void;
|
|
435
|
-
getAccessToken(): string | null;
|
|
436
|
-
getRefreshToken(): string | null;
|
|
437
|
-
getTokenType(): string;
|
|
438
|
-
getExpiresAt(): Date | null;
|
|
439
|
-
getExpiresIn(): number | null;
|
|
440
|
-
isExpired(): boolean;
|
|
441
|
-
getSetAt(): Date | null;
|
|
442
|
-
getRefreshCount(): number;
|
|
443
|
-
}
|
|
444
|
-
/**
|
|
445
|
-
* Token Store Plugin Options
|
|
446
|
-
*/
|
|
447
|
-
interface TokenStoreOptions {
|
|
448
|
-
/** Reject access tokens that are not structurally valid JWTs (default: false) */
|
|
449
|
-
validateOnSet?: boolean;
|
|
450
|
-
/**
|
|
451
|
-
* Persist tokens in this adapter (default: none, tokens live only in memory).
|
|
452
|
-
* Tokens are restored from it when the plugin is installed.
|
|
453
|
-
*/
|
|
454
|
-
storage?: StorageAdapter;
|
|
455
|
-
/** Key used in `storage` (default: 'tokens') */
|
|
456
|
-
storageKey?: string;
|
|
457
|
-
onSet?: (tokens: StoredTokens) => void;
|
|
458
|
-
onClear?: () => void;
|
|
459
|
-
}
|
|
460
|
-
/**
|
|
461
|
-
* TokenStorePlugin class
|
|
462
|
-
*/
|
|
463
|
-
declare class TokenStorePlugin implements Plugin {
|
|
464
|
-
name: string;
|
|
465
|
-
version: string;
|
|
466
|
-
type: "core";
|
|
467
|
-
private tokens;
|
|
468
|
-
private options;
|
|
469
|
-
private kernel;
|
|
470
|
-
constructor(options?: TokenStoreOptions);
|
|
471
|
-
install(kernel: AuthKeeper): TokenStoreAPI;
|
|
472
|
-
/**
|
|
473
|
-
* Set tokens
|
|
474
|
-
*/
|
|
475
|
-
private set;
|
|
476
|
-
/**
|
|
477
|
-
* Get tokens
|
|
478
|
-
*/
|
|
479
|
-
private get;
|
|
480
|
-
/**
|
|
481
|
-
* Clear tokens
|
|
482
|
-
*/
|
|
483
|
-
private clear;
|
|
484
|
-
/**
|
|
485
|
-
* Uninstall plugin
|
|
486
|
-
*
|
|
487
|
-
* Drops the in-memory copy only: destroying an instance (e.g. on component
|
|
488
|
-
* unmount) must not log the user out of the persisted session.
|
|
489
|
-
*/
|
|
490
|
-
uninstall(): void;
|
|
491
|
-
private get storageKey();
|
|
492
|
-
/**
|
|
493
|
-
* Write tokens to the storage adapter (null removes them).
|
|
494
|
-
* Failures (quota exceeded, storage disabled, ...) are reported as an
|
|
495
|
-
* 'error' event with context 'storage' instead of breaking setTokens().
|
|
496
|
-
*/
|
|
497
|
-
private persist;
|
|
498
|
-
/**
|
|
499
|
-
* Load tokens from the storage adapter. Corrupt or malformed entries are
|
|
500
|
-
* removed rather than trusted.
|
|
501
|
-
*/
|
|
502
|
-
private restore;
|
|
503
|
-
private reportStorageError;
|
|
504
|
-
}
|
|
505
|
-
/**
|
|
506
|
-
* Create token-store plugin
|
|
507
|
-
*/
|
|
508
|
-
declare function createTokenStorePlugin(options?: TokenStoreOptions): TokenStorePlugin;
|
|
509
|
-
|
|
510
|
-
/**
|
|
511
|
-
* Token Decoder Plugin
|
|
512
|
-
*
|
|
513
|
-
* Core plugin for JWT token decoding.
|
|
514
|
-
* Does NOT validate signatures (client-side doesn't need to).
|
|
515
|
-
*/
|
|
516
|
-
|
|
517
|
-
/**
|
|
518
|
-
* Token Decoder API
|
|
519
|
-
*/
|
|
520
|
-
interface TokenDecoderAPI {
|
|
521
|
-
decode<T = TokenPayload>(token?: string): T | null;
|
|
522
|
-
getHeader(token?: string): TokenHeader | null;
|
|
523
|
-
getClaim<K extends keyof TokenPayload>(key: K, token?: string): TokenPayload[K] | undefined;
|
|
524
|
-
getClaims<K extends keyof TokenPayload>(keys: K[], token?: string): Pick<TokenPayload, K>;
|
|
525
|
-
getExpiry(token?: string): Date | null;
|
|
526
|
-
isExpired(token?: string): boolean;
|
|
527
|
-
getTokenInfo(token?: string): TokenInfo | null;
|
|
528
|
-
}
|
|
529
|
-
/**
|
|
530
|
-
* TokenDecoderPlugin class
|
|
531
|
-
*/
|
|
532
|
-
declare class TokenDecoderPlugin implements Plugin {
|
|
533
|
-
name: string;
|
|
534
|
-
version: string;
|
|
535
|
-
type: "core";
|
|
536
|
-
private kernel;
|
|
537
|
-
install(kernel: AuthKeeper): TokenDecoderAPI;
|
|
538
|
-
/**
|
|
539
|
-
* Decode token payload
|
|
540
|
-
*/
|
|
541
|
-
private decode;
|
|
542
|
-
/**
|
|
543
|
-
* Decode token header
|
|
544
|
-
*/
|
|
545
|
-
private getHeader;
|
|
546
|
-
/**
|
|
547
|
-
* Get specific claim from token
|
|
548
|
-
*/
|
|
549
|
-
private getClaimFromToken;
|
|
550
|
-
/**
|
|
551
|
-
* Get multiple claims from token
|
|
552
|
-
*/
|
|
553
|
-
private getClaimsFromToken;
|
|
554
|
-
/**
|
|
555
|
-
* Get token expiry
|
|
556
|
-
*/
|
|
557
|
-
private getExpiry;
|
|
558
|
-
/**
|
|
559
|
-
* Check if token is expired
|
|
560
|
-
*/
|
|
561
|
-
private isExpiredToken;
|
|
562
|
-
/**
|
|
563
|
-
* Get complete token information
|
|
564
|
-
*/
|
|
565
|
-
private getTokenInfo;
|
|
566
|
-
uninstall(): void;
|
|
567
|
-
}
|
|
568
|
-
/**
|
|
569
|
-
* Create token-decoder plugin
|
|
570
|
-
*/
|
|
571
|
-
declare function createTokenDecoderPlugin(): TokenDecoderPlugin;
|
|
572
|
-
|
|
573
|
-
/**
|
|
574
|
-
* Refresh Engine Plugin
|
|
575
|
-
*
|
|
576
|
-
* Core plugin for automatic token refresh with queue management.
|
|
577
|
-
* - Queues concurrent refresh requests
|
|
578
|
-
* - Schedules refresh before expiry
|
|
579
|
-
* - Retries with exponential backoff
|
|
580
|
-
*/
|
|
581
|
-
|
|
582
|
-
/**
|
|
583
|
-
* Refresh Engine API
|
|
584
|
-
*/
|
|
585
|
-
interface RefreshEngineAPI {
|
|
586
|
-
refresh(): Promise<TokenSet>;
|
|
587
|
-
scheduleRefresh(): void;
|
|
588
|
-
cancelScheduledRefresh(): void;
|
|
589
|
-
isRefreshing(): boolean;
|
|
590
|
-
/** True only while a refresh result is being stored via kernel.setTokens() */
|
|
591
|
-
isApplyingRefresh?(): boolean;
|
|
592
|
-
getNextRefreshAt(): Date | null;
|
|
593
|
-
setRefreshFn(fn: RefreshTokenFn): void;
|
|
594
|
-
setThreshold(seconds: number): void;
|
|
595
|
-
}
|
|
596
|
-
/**
|
|
597
|
-
* Refresh Engine Options
|
|
598
|
-
*/
|
|
599
|
-
interface RefreshEngineOptions {
|
|
600
|
-
refreshFn: RefreshTokenFn;
|
|
601
|
-
threshold?: number;
|
|
602
|
-
maxRetries?: number;
|
|
603
|
-
retryDelay?: number;
|
|
604
|
-
onRefreshStart?: () => void;
|
|
605
|
-
onRefreshSuccess?: (tokens: TokenSet) => void;
|
|
606
|
-
onRefreshError?: (error: Error) => void;
|
|
607
|
-
}
|
|
608
|
-
/**
|
|
609
|
-
* RefreshEnginePlugin class
|
|
610
|
-
*/
|
|
611
|
-
declare class RefreshEnginePlugin implements Plugin {
|
|
612
|
-
name: string;
|
|
613
|
-
version: string;
|
|
614
|
-
type: "core";
|
|
615
|
-
private kernel;
|
|
616
|
-
private refreshFn;
|
|
617
|
-
private isRefreshingFlag;
|
|
618
|
-
private applyingRefresh;
|
|
619
|
-
private refreshPromise;
|
|
620
|
-
/** Refresh token of the session the in-flight refresh belongs to */
|
|
621
|
-
private refreshPromiseToken;
|
|
622
|
-
/** Pending retry backoff waits (ended early on session change / uninstall) */
|
|
623
|
-
private backoffs;
|
|
624
|
-
private uninstalled;
|
|
625
|
-
private scheduledRefreshTimeout;
|
|
626
|
-
private threshold;
|
|
627
|
-
private maxRetries;
|
|
628
|
-
private retryDelay;
|
|
629
|
-
private options;
|
|
630
|
-
constructor(options: RefreshEngineOptions);
|
|
631
|
-
install(kernel: AuthKeeper): RefreshEngineAPI;
|
|
632
|
-
/**
|
|
633
|
-
* Refresh tokens
|
|
634
|
-
*
|
|
635
|
-
* Queues concurrent requests - only one refresh executes at a time.
|
|
636
|
-
*/
|
|
637
|
-
private refresh;
|
|
638
|
-
/** Wait before a retry; endBackoffs() cuts the wait short */
|
|
639
|
-
private waitBackoff;
|
|
640
|
-
private endBackoffs;
|
|
641
|
-
/**
|
|
642
|
-
* Execute token refresh with retry logic
|
|
643
|
-
*/
|
|
644
|
-
private executeRefresh;
|
|
645
|
-
/**
|
|
646
|
-
* Schedule automatic refresh
|
|
647
|
-
*
|
|
648
|
-
* Schedules refresh before token expires (threshold seconds before).
|
|
649
|
-
*/
|
|
650
|
-
private scheduleRefresh;
|
|
651
|
-
/**
|
|
652
|
-
* Whether the kernel has automatic refresh enabled (default: true)
|
|
653
|
-
*/
|
|
654
|
-
private isAutoRefreshEnabled;
|
|
655
|
-
/**
|
|
656
|
-
* Cancel scheduled refresh
|
|
657
|
-
*/
|
|
658
|
-
private cancelScheduledRefresh;
|
|
659
|
-
/**
|
|
660
|
-
* Get next scheduled refresh time
|
|
661
|
-
*/
|
|
662
|
-
private getNextRefreshAt;
|
|
663
|
-
/**
|
|
664
|
-
* Uninstall plugin
|
|
665
|
-
*/
|
|
666
|
-
uninstall(): void;
|
|
667
|
-
}
|
|
668
|
-
/**
|
|
669
|
-
* Create refresh-engine plugin
|
|
670
|
-
*/
|
|
671
|
-
declare function createRefreshEnginePlugin(options: RefreshEngineOptions): RefreshEnginePlugin;
|
|
672
|
-
|
|
673
|
-
/**
|
|
674
|
-
* Memory Storage Plugin
|
|
675
|
-
*
|
|
676
|
-
* Core plugin for in-memory token storage.
|
|
677
|
-
* - Most secure (not accessible via XSS)
|
|
678
|
-
* - Lost on page refresh
|
|
679
|
-
* - Not shared across tabs
|
|
680
|
-
*/
|
|
681
|
-
|
|
682
|
-
/**
|
|
683
|
-
* Memory Storage Options
|
|
684
|
-
*/
|
|
685
|
-
interface MemoryStorageOptions {
|
|
686
|
-
prefix?: string;
|
|
687
|
-
}
|
|
688
|
-
/**
|
|
689
|
-
* Memory Storage Adapter
|
|
690
|
-
*
|
|
691
|
-
* Stores data in a Map (in memory).
|
|
692
|
-
* Data is lost on page refresh.
|
|
693
|
-
*/
|
|
694
|
-
declare class MemoryStorageAdapter implements StorageAdapter {
|
|
695
|
-
private store;
|
|
696
|
-
private prefix;
|
|
697
|
-
constructor(options?: MemoryStorageOptions);
|
|
698
|
-
/**
|
|
699
|
-
* Get value by key
|
|
700
|
-
*/
|
|
701
|
-
get(key: string): string | null;
|
|
702
|
-
/**
|
|
703
|
-
* Set value by key
|
|
704
|
-
*/
|
|
705
|
-
set(key: string, value: string): void;
|
|
706
|
-
/**
|
|
707
|
-
* Remove value by key
|
|
708
|
-
*/
|
|
709
|
-
remove(key: string): void;
|
|
710
|
-
/**
|
|
711
|
-
* Clear all values
|
|
712
|
-
*/
|
|
713
|
-
clear(): void;
|
|
714
|
-
}
|
|
715
|
-
/**
|
|
716
|
-
* Create memory storage adapter
|
|
717
|
-
*/
|
|
718
|
-
declare function createMemoryStorage(options?: MemoryStorageOptions): MemoryStorageAdapter;
|
|
719
|
-
|
|
720
|
-
/**
|
|
721
|
-
* Cookie utilities
|
|
722
|
-
*
|
|
723
|
-
* Helper functions for parsing and serializing cookies.
|
|
724
|
-
*/
|
|
725
|
-
/**
|
|
726
|
-
* Cookie attributes for serialization
|
|
727
|
-
*/
|
|
728
|
-
interface CookieAttributes {
|
|
729
|
-
/** Path where cookie is valid (default: '/') */
|
|
730
|
-
path?: string;
|
|
731
|
-
/** Domain where cookie is valid */
|
|
732
|
-
domain?: string;
|
|
733
|
-
/** Max age in seconds */
|
|
734
|
-
maxAge?: number;
|
|
735
|
-
/** Expiration date */
|
|
736
|
-
expires?: Date;
|
|
737
|
-
/** Secure flag (HTTPS only) */
|
|
738
|
-
secure?: boolean;
|
|
739
|
-
/** SameSite attribute */
|
|
740
|
-
sameSite?: 'strict' | 'lax' | 'none';
|
|
741
|
-
/** HttpOnly flag (not accessible via JavaScript) */
|
|
742
|
-
httpOnly?: boolean;
|
|
743
|
-
}
|
|
744
|
-
/**
|
|
745
|
-
* Parse document.cookie string into key-value pairs
|
|
746
|
-
*
|
|
747
|
-
* @param cookieString - Cookie string from document.cookie
|
|
748
|
-
* @returns Object with cookie key-value pairs
|
|
749
|
-
*/
|
|
750
|
-
declare function parseCookies(cookieString: string): Record<string, string>;
|
|
751
|
-
/**
|
|
752
|
-
* Get cookie value by name
|
|
753
|
-
*
|
|
754
|
-
* @param name - Cookie name
|
|
755
|
-
* @returns Cookie value or null if not found
|
|
756
|
-
*/
|
|
757
|
-
declare function getCookie(name: string): string | null;
|
|
758
|
-
/**
|
|
759
|
-
* Serialize cookie with attributes to Set-Cookie format
|
|
760
|
-
*
|
|
761
|
-
* @param name - Cookie name
|
|
762
|
-
* @param value - Cookie value
|
|
763
|
-
* @param attributes - Cookie attributes
|
|
764
|
-
* @returns Set-Cookie header value
|
|
765
|
-
*/
|
|
766
|
-
declare function serializeCookie(name: string, value: string, attributes?: CookieAttributes): string;
|
|
767
|
-
/**
|
|
768
|
-
* Set cookie in document
|
|
769
|
-
*
|
|
770
|
-
* @param name - Cookie name
|
|
771
|
-
* @param value - Cookie value
|
|
772
|
-
* @param attributes - Cookie attributes
|
|
773
|
-
*/
|
|
774
|
-
declare function setCookie(name: string, value: string, attributes?: CookieAttributes): void;
|
|
775
|
-
/**
|
|
776
|
-
* Delete cookie by name
|
|
777
|
-
*
|
|
778
|
-
* @param name - Cookie name
|
|
779
|
-
* @param attributes - Cookie attributes (path and domain should match original)
|
|
780
|
-
*/
|
|
781
|
-
declare function deleteCookie(name: string, attributes?: Omit<CookieAttributes, 'maxAge' | 'expires'>): void;
|
|
782
|
-
|
|
783
|
-
/**
|
|
784
|
-
* Browser Storage Adapters
|
|
785
|
-
*
|
|
786
|
-
* StorageAdapter implementations backed by Web Storage (localStorage /
|
|
787
|
-
* sessionStorage) and document.cookie.
|
|
788
|
-
*
|
|
789
|
-
* Security note: anything stored here is readable by any script running on
|
|
790
|
-
* the page (XSS). In-memory storage (the default) is the safest choice; use
|
|
791
|
-
* these only when tokens must survive a page reload.
|
|
792
|
-
*/
|
|
793
|
-
|
|
794
|
-
/**
|
|
795
|
-
* Web Storage adapter options
|
|
796
|
-
*/
|
|
797
|
-
interface WebStorageOptions {
|
|
798
|
-
/** Key prefix (default: 'authkeeper:') */
|
|
799
|
-
prefix?: string;
|
|
800
|
-
}
|
|
801
|
-
/**
|
|
802
|
-
* StorageAdapter backed by a Web Storage object (localStorage / sessionStorage)
|
|
803
|
-
*/
|
|
804
|
-
declare class WebStorageAdapter implements StorageAdapter {
|
|
805
|
-
private storage;
|
|
806
|
-
private prefix;
|
|
807
|
-
constructor(storage: Storage, options?: WebStorageOptions);
|
|
808
|
-
get(key: string): string | null;
|
|
809
|
-
set(key: string, value: string): void;
|
|
810
|
-
remove(key: string): void;
|
|
811
|
-
clear(): void;
|
|
812
|
-
}
|
|
813
|
-
/**
|
|
814
|
-
* Cookie adapter options
|
|
815
|
-
*/
|
|
816
|
-
interface CookieStorageOptions {
|
|
817
|
-
/** Cookie name prefix (default: 'authkeeper_') */
|
|
818
|
-
prefix?: string;
|
|
819
|
-
/**
|
|
820
|
-
* Cookie attributes. Defaults: `path: '/'`, `secure: true`,
|
|
821
|
-
* `sameSite: 'strict'`. HttpOnly cannot be set from JavaScript.
|
|
822
|
-
*/
|
|
823
|
-
attributes?: Omit<CookieAttributes, 'httpOnly'>;
|
|
824
|
-
}
|
|
825
|
-
/**
|
|
826
|
-
* StorageAdapter backed by document.cookie
|
|
827
|
-
*/
|
|
828
|
-
declare class CookieStorageAdapter implements StorageAdapter {
|
|
829
|
-
private prefix;
|
|
830
|
-
private attributes;
|
|
831
|
-
private keys;
|
|
832
|
-
constructor(options?: CookieStorageOptions);
|
|
833
|
-
get(key: string): string | null;
|
|
834
|
-
set(key: string, value: string): void;
|
|
835
|
-
remove(key: string): void;
|
|
836
|
-
clear(): void;
|
|
837
|
-
}
|
|
838
|
-
/**
|
|
839
|
-
* Resolve the `storage` kernel option to a StorageAdapter.
|
|
840
|
-
*
|
|
841
|
-
* - `undefined` / `'memory'`: no persistence (returns `undefined`); tokens
|
|
842
|
-
* live only in the token store's memory.
|
|
843
|
-
* - `'localStorage'` / `'sessionStorage'`: Web Storage, falling back to an
|
|
844
|
-
* in-memory adapter where it is unavailable (SSR, privacy mode).
|
|
845
|
-
* - `'cookie'`: document.cookie, falling back to memory outside browsers.
|
|
846
|
-
* - a StorageAdapter object: used as-is.
|
|
847
|
-
*
|
|
848
|
-
* @throws {AuthError} CONFIG_ERROR for an unknown storage type
|
|
849
|
-
*/
|
|
850
|
-
declare function resolveStorage(storage: StorageType | StorageAdapter | undefined): StorageAdapter | undefined;
|
|
851
|
-
|
|
852
|
-
/**
|
|
853
|
-
* Fetch Interceptor Plugin
|
|
854
|
-
*
|
|
855
|
-
* Core plugin for fetch() wrapper with auth header injection and 401 retry.
|
|
856
|
-
* - Injects Authorization header
|
|
857
|
-
* - URL filtering (include/exclude)
|
|
858
|
-
* - 401 retry after token refresh
|
|
859
|
-
*/
|
|
860
|
-
|
|
861
|
-
/**
|
|
862
|
-
* Fetch Interceptor API
|
|
863
|
-
*/
|
|
864
|
-
interface FetchInterceptorAPI {
|
|
865
|
-
createFetch(options?: FetchInterceptorOptions): AuthFetch;
|
|
866
|
-
wrapFetch(fetch: typeof globalThis.fetch): void;
|
|
867
|
-
unwrapFetch(): void;
|
|
868
|
-
}
|
|
869
|
-
/**
|
|
870
|
-
* FetchInterceptorPlugin class
|
|
871
|
-
*/
|
|
872
|
-
declare class FetchInterceptorPlugin implements Plugin {
|
|
873
|
-
name: string;
|
|
874
|
-
version: string;
|
|
875
|
-
type: "core";
|
|
876
|
-
private kernel;
|
|
877
|
-
private originalFetch;
|
|
878
|
-
/**
|
|
879
|
-
* The fetch implementation used to perform requests.
|
|
880
|
-
*
|
|
881
|
-
* While the global fetch is wrapped, this is the original (unwrapped)
|
|
882
|
-
* fetch; calling `globalThis.fetch` from inside the wrapper would recurse
|
|
883
|
-
* into the wrapper itself.
|
|
884
|
-
*/
|
|
885
|
-
private baseFetch;
|
|
886
|
-
install(kernel: AuthKeeper): FetchInterceptorAPI;
|
|
887
|
-
/**
|
|
888
|
-
* Create authenticated fetch function
|
|
889
|
-
*/
|
|
890
|
-
private createFetch;
|
|
891
|
-
/**
|
|
892
|
-
* Wrap global fetch with auth
|
|
893
|
-
*/
|
|
894
|
-
private wrapFetch;
|
|
895
|
-
/**
|
|
896
|
-
* Restore original fetch
|
|
897
|
-
*/
|
|
898
|
-
private unwrapFetch;
|
|
899
|
-
uninstall(): void;
|
|
900
|
-
}
|
|
901
|
-
/**
|
|
902
|
-
* Create fetch-interceptor plugin
|
|
903
|
-
*/
|
|
904
|
-
declare function createFetchInterceptorPlugin(): FetchInterceptorPlugin;
|
|
905
|
-
|
|
906
|
-
export { deleteCookie as $, type AuthKeeper as A, type TabSyncEvent as B, type CookieAttributes as C, type TokenDecoderAPI as D, type EventType as E, type FetchInterceptorOptions as F, TokenDecoderPlugin as G, type TokenInfo as H, type TokenStoreAPI as I, type TokenStoreOptions as J, type KernelOptions as K, type LogoutOptions as L, MemoryStorageAdapter as M, TokenStorePlugin as N, type UserInfo as O, type Plugin as P, type WebStorageOptions as Q, type RefreshEngineAPI as R, type StorageAdapter as S, type TokenSet as T, type Unsubscribe as U, createFetchInterceptorPlugin as V, WebStorageAdapter as W, createMemoryStorage as X, createRefreshEnginePlugin as Y, createTokenDecoderPlugin as Z, createTokenStorePlugin as _, type EventHandler as a, getCookie as a0, parseCookies as a1, serializeCookie as a2, setCookie as a3, resolveStorage as a4, type AuthEvent as b, type PluginInfo as c, type TokenPayload as d, type AuthFetch as e, type TokenHeader as f, AuthError as g, type AuthErrorCode as h, type AuthErrorOptions as i, CookieStorageAdapter as j, type CookieStorageOptions as k, type ErrorEvent as l, type ExpiredEvent as m, type FetchInterceptorAPI as n, FetchInterceptorPlugin as o, type LoginEvent as p, type LoginOptions as q, type LogoutEvent as r, type MemoryStorageOptions as s, type RefreshEngineOptions as t, RefreshEnginePlugin as u, type RefreshEvent as v, type RefreshTokenFn as w, type StorageChangeEvent as x, type StorageType as y, type StoredTokens as z };
|