isa-auth 0.0.0-stage → 0.2.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/.agents/skills/isa-auth-guide/SKILL.md +154 -0
- package/LICENSE +21 -0
- package/README.md +295 -2
- package/dist/index.d.mts +1838 -0
- package/dist/index.d.ts +1838 -0
- package/dist/index.js +4449 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +4446 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +74 -4
- package/skills/isa-auth-guide/SKILL.md +167 -0
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,1838 @@
|
|
|
1
|
+
type AuthButtonType = 'rect' | 'rounded' | 'circle' | 'link' | 'brand';
|
|
2
|
+
type ButtonProviderType = 'default' | 'google' | 'apple' | 'kakao' | 'line' | 'naver' | 'facebook' | 'meta' | 'twitter' | 'wechat' | 'web3' | 'github' | 'discord' | 'world' | 'passkey';
|
|
3
|
+
interface LoginButtonConfig {
|
|
4
|
+
id: string;
|
|
5
|
+
style?: Partial<CSSStyleDeclaration>;
|
|
6
|
+
text?: string;
|
|
7
|
+
icon?: string;
|
|
8
|
+
fullWidth?: boolean;
|
|
9
|
+
}
|
|
10
|
+
interface LoginButtonProps {
|
|
11
|
+
type: AuthButtonType;
|
|
12
|
+
provider: ButtonProviderType;
|
|
13
|
+
action: Function;
|
|
14
|
+
config: LoginButtonConfig;
|
|
15
|
+
}
|
|
16
|
+
declare class LoginButton {
|
|
17
|
+
readonly type: AuthButtonType;
|
|
18
|
+
readonly provider: ButtonProviderType;
|
|
19
|
+
readonly action: Function;
|
|
20
|
+
readonly config: LoginButtonConfig;
|
|
21
|
+
constructor(props: LoginButtonProps);
|
|
22
|
+
private getDefaultText;
|
|
23
|
+
private getDefaultStyle;
|
|
24
|
+
private mergeStyles;
|
|
25
|
+
getButtonClass(): string;
|
|
26
|
+
toJSON(): {
|
|
27
|
+
id: string;
|
|
28
|
+
type: AuthButtonType;
|
|
29
|
+
provider: ButtonProviderType;
|
|
30
|
+
icon: string;
|
|
31
|
+
text: string;
|
|
32
|
+
style: Partial<CSSStyleDeclaration>;
|
|
33
|
+
fullWidth: boolean;
|
|
34
|
+
className: string;
|
|
35
|
+
onClick: Function;
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
interface AuthProvider$1 {
|
|
40
|
+
init(): Promise<void>;
|
|
41
|
+
signIn(): void;
|
|
42
|
+
signOut(): void;
|
|
43
|
+
getAccessToken(): Promise<string | null>;
|
|
44
|
+
getUserInfo(): Promise<any>;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
declare global {
|
|
48
|
+
interface Window {
|
|
49
|
+
google?: any;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
declare class GoogleAuthProvider implements AuthProvider$1 {
|
|
53
|
+
private clientId;
|
|
54
|
+
private callback;
|
|
55
|
+
constructor({ clientId, callback, }: {
|
|
56
|
+
clientId: string;
|
|
57
|
+
callback: (token: string) => string | Promise<string>;
|
|
58
|
+
});
|
|
59
|
+
loadGoogleSdk(): Promise<void>;
|
|
60
|
+
init(): Promise<void>;
|
|
61
|
+
signIn(): void;
|
|
62
|
+
signOut(): void;
|
|
63
|
+
getAccessToken(): Promise<any>;
|
|
64
|
+
getUserInfo(): Promise<any>;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
declare global {
|
|
68
|
+
interface Window {
|
|
69
|
+
AppleID?: any;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
interface AppleAuthOptions {
|
|
73
|
+
clientId: string;
|
|
74
|
+
redirectURI?: string;
|
|
75
|
+
scope?: string;
|
|
76
|
+
state?: string;
|
|
77
|
+
nonce?: string;
|
|
78
|
+
usePopup?: boolean;
|
|
79
|
+
onSuccess?: (response: any) => void;
|
|
80
|
+
onFail?: (error: any) => void;
|
|
81
|
+
}
|
|
82
|
+
declare class AppleAuthProvider implements AuthProvider$1 {
|
|
83
|
+
private clientId;
|
|
84
|
+
private redirectURI;
|
|
85
|
+
private scope;
|
|
86
|
+
private state?;
|
|
87
|
+
private nonce?;
|
|
88
|
+
private usePopup;
|
|
89
|
+
private onSuccess?;
|
|
90
|
+
private onFail?;
|
|
91
|
+
private idToken;
|
|
92
|
+
private userInfo;
|
|
93
|
+
constructor(options: AppleAuthOptions);
|
|
94
|
+
loadAppleSdk(): Promise<void>;
|
|
95
|
+
init(): Promise<void>;
|
|
96
|
+
signIn(): Promise<void>;
|
|
97
|
+
signOut(): void;
|
|
98
|
+
getAccessToken(): Promise<string | null>;
|
|
99
|
+
getUserInfo(): Promise<any>;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
declare global {
|
|
103
|
+
interface Window {
|
|
104
|
+
FB?: any;
|
|
105
|
+
fbAsyncInit?: () => void;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
interface MetaAuthOptions {
|
|
109
|
+
appId: string;
|
|
110
|
+
version?: string;
|
|
111
|
+
redirectUri?: string;
|
|
112
|
+
scope?: string;
|
|
113
|
+
isPopup?: boolean;
|
|
114
|
+
onSuccess?: (response: any) => void;
|
|
115
|
+
onFail?: (error: any) => void;
|
|
116
|
+
}
|
|
117
|
+
declare class MetaAuthProvider implements AuthProvider$1 {
|
|
118
|
+
private appId;
|
|
119
|
+
private version;
|
|
120
|
+
private redirectUri?;
|
|
121
|
+
private scope;
|
|
122
|
+
private isPopup;
|
|
123
|
+
private onSuccess?;
|
|
124
|
+
private onFail?;
|
|
125
|
+
private accessToken;
|
|
126
|
+
private userInfo;
|
|
127
|
+
constructor(options: MetaAuthOptions);
|
|
128
|
+
loadFacebookSdk(): Promise<void>;
|
|
129
|
+
init(): Promise<void>;
|
|
130
|
+
signIn(): void;
|
|
131
|
+
signOut(): void;
|
|
132
|
+
getAccessToken(): Promise<string | null>;
|
|
133
|
+
getUserInfo(): Promise<any>;
|
|
134
|
+
setToken(token: string): void;
|
|
135
|
+
setUser(user: any): void;
|
|
136
|
+
}
|
|
137
|
+
declare const FacebookAuthProvider: typeof MetaAuthProvider;
|
|
138
|
+
|
|
139
|
+
declare global {
|
|
140
|
+
interface Window {
|
|
141
|
+
Kakao?: any;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
interface KakaoAuthOptions {
|
|
145
|
+
javascriptKey: string;
|
|
146
|
+
redirectUri?: string;
|
|
147
|
+
scope?: string;
|
|
148
|
+
onSuccess?: (authObj: any) => void;
|
|
149
|
+
onFail?: (error: any) => void;
|
|
150
|
+
}
|
|
151
|
+
declare class KakaoAuthProvider implements AuthProvider$1 {
|
|
152
|
+
private javascriptKey;
|
|
153
|
+
private redirectUri?;
|
|
154
|
+
private scope?;
|
|
155
|
+
private onSuccess?;
|
|
156
|
+
private onFail?;
|
|
157
|
+
constructor(options: KakaoAuthOptions);
|
|
158
|
+
loadKakaoSdk(): Promise<void>;
|
|
159
|
+
init(): Promise<void>;
|
|
160
|
+
signIn(): void;
|
|
161
|
+
signOut(): void;
|
|
162
|
+
getAccessToken(): Promise<string | null>;
|
|
163
|
+
getUserInfo(): Promise<any>;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
declare global {
|
|
167
|
+
interface Window {
|
|
168
|
+
naver?: any;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
interface NaverAuthOptions {
|
|
172
|
+
clientId: string;
|
|
173
|
+
callbackUrl: string;
|
|
174
|
+
isPopup?: boolean;
|
|
175
|
+
loginButtonId?: string;
|
|
176
|
+
callbackHandle?: (status: boolean) => void;
|
|
177
|
+
}
|
|
178
|
+
declare class NaverAuthProvider implements AuthProvider$1 {
|
|
179
|
+
private clientId;
|
|
180
|
+
private callbackUrl;
|
|
181
|
+
private isPopup;
|
|
182
|
+
private loginButtonId;
|
|
183
|
+
private callbackHandle?;
|
|
184
|
+
private naverLoginInstance;
|
|
185
|
+
constructor(options: NaverAuthOptions);
|
|
186
|
+
loadNaverSdk(): Promise<void>;
|
|
187
|
+
init(): Promise<void>;
|
|
188
|
+
signIn(): void;
|
|
189
|
+
signOut(): void;
|
|
190
|
+
getAccessToken(): Promise<string | null>;
|
|
191
|
+
getUserInfo(): Promise<any>;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
interface LineAuthOptions {
|
|
195
|
+
clientId: string;
|
|
196
|
+
callbackUrl?: string;
|
|
197
|
+
scope?: string;
|
|
198
|
+
state?: string;
|
|
199
|
+
nonce?: string;
|
|
200
|
+
isPopup?: boolean;
|
|
201
|
+
botPrompt?: 'normal' | 'aggressive';
|
|
202
|
+
onSuccess?: (response: any) => void;
|
|
203
|
+
onFail?: (error: any) => void;
|
|
204
|
+
}
|
|
205
|
+
declare class LineAuthProvider implements AuthProvider$1 {
|
|
206
|
+
private clientId;
|
|
207
|
+
private callbackUrl;
|
|
208
|
+
private scope;
|
|
209
|
+
private state?;
|
|
210
|
+
private nonce?;
|
|
211
|
+
private isPopup;
|
|
212
|
+
private botPrompt?;
|
|
213
|
+
private onSuccess?;
|
|
214
|
+
private onFail?;
|
|
215
|
+
private accessToken;
|
|
216
|
+
private userInfo;
|
|
217
|
+
constructor(options: LineAuthOptions);
|
|
218
|
+
init(): Promise<void>;
|
|
219
|
+
buildLoginUrl(): string;
|
|
220
|
+
signIn(): Promise<void>;
|
|
221
|
+
signOut(): void;
|
|
222
|
+
getAccessToken(): Promise<string | null>;
|
|
223
|
+
getUserInfo(): Promise<any>;
|
|
224
|
+
setToken(token: string): void;
|
|
225
|
+
setUser(user: any): void;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
declare const socialProviders: {
|
|
229
|
+
google: typeof GoogleAuthProvider;
|
|
230
|
+
apple: typeof AppleAuthProvider;
|
|
231
|
+
meta: typeof MetaAuthProvider;
|
|
232
|
+
facebook: typeof MetaAuthProvider;
|
|
233
|
+
kakao: typeof KakaoAuthProvider;
|
|
234
|
+
naver: typeof NaverAuthProvider;
|
|
235
|
+
line: typeof LineAuthProvider;
|
|
236
|
+
};
|
|
237
|
+
|
|
238
|
+
interface GithubAuthOptions {
|
|
239
|
+
clientId: string;
|
|
240
|
+
redirectUri?: string;
|
|
241
|
+
scope?: string;
|
|
242
|
+
isPopup?: boolean;
|
|
243
|
+
state?: string;
|
|
244
|
+
usePkce?: boolean;
|
|
245
|
+
onSuccess?: (response: any) => void;
|
|
246
|
+
onFail?: (error: any) => void;
|
|
247
|
+
}
|
|
248
|
+
declare class GithubAuthProvider implements AuthProvider$1 {
|
|
249
|
+
private clientId;
|
|
250
|
+
private redirectUri;
|
|
251
|
+
private scope;
|
|
252
|
+
private isPopup;
|
|
253
|
+
private state?;
|
|
254
|
+
private usePkce;
|
|
255
|
+
private onSuccess?;
|
|
256
|
+
private onFail?;
|
|
257
|
+
private codeVerifier?;
|
|
258
|
+
private accessToken;
|
|
259
|
+
private userInfo;
|
|
260
|
+
constructor(options: GithubAuthOptions);
|
|
261
|
+
init(): Promise<void>;
|
|
262
|
+
buildLoginUrl(): Promise<string>;
|
|
263
|
+
signIn(): Promise<void>;
|
|
264
|
+
signOut(): void;
|
|
265
|
+
getAccessToken(): Promise<string | null>;
|
|
266
|
+
getUserInfo(): Promise<any>;
|
|
267
|
+
setToken(token: string): void;
|
|
268
|
+
setUser(user: any): void;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
interface DiscordAuthOptions {
|
|
272
|
+
clientId: string;
|
|
273
|
+
redirectUri?: string;
|
|
274
|
+
scope?: string;
|
|
275
|
+
isPopup?: boolean;
|
|
276
|
+
state?: string;
|
|
277
|
+
usePkce?: boolean;
|
|
278
|
+
prompt?: 'consent' | 'none';
|
|
279
|
+
onSuccess?: (response: any) => void;
|
|
280
|
+
onFail?: (error: any) => void;
|
|
281
|
+
}
|
|
282
|
+
declare class DiscordAuthProvider implements AuthProvider$1 {
|
|
283
|
+
private clientId;
|
|
284
|
+
private redirectUri;
|
|
285
|
+
private scope;
|
|
286
|
+
private isPopup;
|
|
287
|
+
private state?;
|
|
288
|
+
private usePkce;
|
|
289
|
+
private prompt?;
|
|
290
|
+
private onSuccess?;
|
|
291
|
+
private onFail?;
|
|
292
|
+
private codeVerifier?;
|
|
293
|
+
private accessToken;
|
|
294
|
+
private userInfo;
|
|
295
|
+
constructor(options: DiscordAuthOptions);
|
|
296
|
+
init(): Promise<void>;
|
|
297
|
+
buildLoginUrl(): Promise<string>;
|
|
298
|
+
signIn(): Promise<void>;
|
|
299
|
+
signOut(): void;
|
|
300
|
+
getAccessToken(): Promise<string | null>;
|
|
301
|
+
getUserInfo(): Promise<any>;
|
|
302
|
+
setToken(token: string): void;
|
|
303
|
+
setUser(user: any): void;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
declare const developerProviders: {
|
|
307
|
+
github: typeof GithubAuthProvider;
|
|
308
|
+
discord: typeof DiscordAuthProvider;
|
|
309
|
+
};
|
|
310
|
+
|
|
311
|
+
/**
|
|
312
|
+
* Web3 Authentication Provider (SIWE - EIP-4361 Sign-In with Ethereum)
|
|
313
|
+
*/
|
|
314
|
+
|
|
315
|
+
declare global {
|
|
316
|
+
interface Window {
|
|
317
|
+
ethereum?: any;
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
interface Web3AuthOptions {
|
|
321
|
+
domain?: string;
|
|
322
|
+
statement?: string;
|
|
323
|
+
chainId?: number;
|
|
324
|
+
onSuccess?: (result: Web3AuthResult) => void;
|
|
325
|
+
onFail?: (error: any) => void;
|
|
326
|
+
nonceGenerator?: () => Promise<string> | string;
|
|
327
|
+
}
|
|
328
|
+
interface Web3AuthResult {
|
|
329
|
+
address: string;
|
|
330
|
+
signature: string;
|
|
331
|
+
message: string;
|
|
332
|
+
chainId: number;
|
|
333
|
+
}
|
|
334
|
+
declare class Web3AuthProvider implements AuthProvider$1 {
|
|
335
|
+
private domain;
|
|
336
|
+
private statement?;
|
|
337
|
+
private chainId;
|
|
338
|
+
private onSuccess?;
|
|
339
|
+
private onFail?;
|
|
340
|
+
private nonceGenerator?;
|
|
341
|
+
private connectedAddress;
|
|
342
|
+
private lastSignature;
|
|
343
|
+
constructor(options?: Web3AuthOptions);
|
|
344
|
+
init(): Promise<void>;
|
|
345
|
+
signIn(): Promise<void>;
|
|
346
|
+
signOut(): void;
|
|
347
|
+
getAccessToken(): Promise<string | null>;
|
|
348
|
+
getUserInfo(): Promise<any>;
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
declare const web3Providers: {
|
|
352
|
+
web3: typeof Web3AuthProvider;
|
|
353
|
+
};
|
|
354
|
+
|
|
355
|
+
/**
|
|
356
|
+
* World ID Authentication & Verification Provider (World Network / Worldcoin Orb)
|
|
357
|
+
* Supports Proof of Personhood (PoP) with Orb and Device verification levels.
|
|
358
|
+
*/
|
|
359
|
+
|
|
360
|
+
type WorldVerificationLevel = 'orb' | 'device';
|
|
361
|
+
interface WorldAuthOptions {
|
|
362
|
+
appId: string;
|
|
363
|
+
action: string;
|
|
364
|
+
actionDescription?: string;
|
|
365
|
+
verificationLevel?: WorldVerificationLevel;
|
|
366
|
+
signal?: string;
|
|
367
|
+
bridgeUrl?: string;
|
|
368
|
+
onSuccess?: (result: WorldIDProofResult) => void;
|
|
369
|
+
onFail?: (error: any) => void;
|
|
370
|
+
mockProof?: boolean;
|
|
371
|
+
}
|
|
372
|
+
interface WorldIDProofResult {
|
|
373
|
+
merkle_root: string;
|
|
374
|
+
nullifier_hash: string;
|
|
375
|
+
proof: string;
|
|
376
|
+
verification_level: WorldVerificationLevel;
|
|
377
|
+
credential_type?: string;
|
|
378
|
+
action: string;
|
|
379
|
+
signal?: string;
|
|
380
|
+
}
|
|
381
|
+
declare class WorldAuthProvider implements AuthProvider$1 {
|
|
382
|
+
private appId;
|
|
383
|
+
private action;
|
|
384
|
+
private actionDescription?;
|
|
385
|
+
private verificationLevel;
|
|
386
|
+
private signal?;
|
|
387
|
+
private onSuccess?;
|
|
388
|
+
private onFail?;
|
|
389
|
+
private mockProof;
|
|
390
|
+
private lastProof;
|
|
391
|
+
constructor(options: WorldAuthOptions);
|
|
392
|
+
init(): Promise<void>;
|
|
393
|
+
/**
|
|
394
|
+
* Triggers World ID verification via Orb or Device.
|
|
395
|
+
* In browser environment, launches IDKit modal or resolves with mock proof if configured.
|
|
396
|
+
*/
|
|
397
|
+
signIn(): Promise<void>;
|
|
398
|
+
private promptWorldAppModal;
|
|
399
|
+
signOut(): void;
|
|
400
|
+
getAccessToken(): Promise<string | null>;
|
|
401
|
+
getUserInfo(): Promise<any>;
|
|
402
|
+
getProof(): WorldIDProofResult | null;
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
/**
|
|
406
|
+
* Passkey / WebAuthn (FIDO2) Authentication Provider
|
|
407
|
+
* Biometric authentication via Face ID, Touch ID, Windows Hello, and Hardware Keys.
|
|
408
|
+
*/
|
|
409
|
+
|
|
410
|
+
interface PasskeyAuthOptions {
|
|
411
|
+
rpName?: string;
|
|
412
|
+
rpId?: string;
|
|
413
|
+
challengeGenerator?: () => Promise<Uint8Array | string> | Uint8Array | string;
|
|
414
|
+
userName?: string;
|
|
415
|
+
userDisplayName?: string;
|
|
416
|
+
userId?: string;
|
|
417
|
+
onSuccess?: (assertion: PasskeyAssertionResult) => void;
|
|
418
|
+
onFail?: (error: any) => void;
|
|
419
|
+
}
|
|
420
|
+
interface PasskeyAssertionResult {
|
|
421
|
+
id: string;
|
|
422
|
+
rawId: string;
|
|
423
|
+
type: 'public-key';
|
|
424
|
+
response: {
|
|
425
|
+
clientDataJSON: string;
|
|
426
|
+
authenticatorData: string;
|
|
427
|
+
signature: string;
|
|
428
|
+
userHandle?: string;
|
|
429
|
+
};
|
|
430
|
+
}
|
|
431
|
+
declare class PasskeyAuthProvider implements AuthProvider$1 {
|
|
432
|
+
private rpName;
|
|
433
|
+
private rpId?;
|
|
434
|
+
private challengeGenerator?;
|
|
435
|
+
private userName?;
|
|
436
|
+
private userDisplayName?;
|
|
437
|
+
private userId?;
|
|
438
|
+
private onSuccess?;
|
|
439
|
+
private onFail?;
|
|
440
|
+
private lastAssertion;
|
|
441
|
+
constructor(options?: PasskeyAuthOptions);
|
|
442
|
+
init(): Promise<void>;
|
|
443
|
+
/**
|
|
444
|
+
* Helper to register a new Passkey credential
|
|
445
|
+
*/
|
|
446
|
+
registerCredential(options?: {
|
|
447
|
+
challenge?: Uint8Array;
|
|
448
|
+
userName?: string;
|
|
449
|
+
userId?: string;
|
|
450
|
+
}): Promise<any>;
|
|
451
|
+
/**
|
|
452
|
+
* Performs Passkey authentication (navigator.credentials.get)
|
|
453
|
+
*/
|
|
454
|
+
signIn(): Promise<void>;
|
|
455
|
+
signOut(): void;
|
|
456
|
+
getAccessToken(): Promise<string | null>;
|
|
457
|
+
getUserInfo(): Promise<any>;
|
|
458
|
+
getAssertion(): PasskeyAssertionResult | null;
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
/**
|
|
462
|
+
* OAuth 2.0 PKCE (Proof Key for Code Exchange) utilities
|
|
463
|
+
* Compatible with modern browser Web Crypto API.
|
|
464
|
+
*/
|
|
465
|
+
/**
|
|
466
|
+
* Generates a cryptographically random code verifier string (43~128 chars).
|
|
467
|
+
*/
|
|
468
|
+
declare function generateCodeVerifier(length?: number): string;
|
|
469
|
+
/**
|
|
470
|
+
* Calculates SHA-256 hash of verifier and encodes it as base64url.
|
|
471
|
+
*/
|
|
472
|
+
declare function generateCodeChallenge(verifier: string): Promise<string>;
|
|
473
|
+
interface BuildAuthorizeUrlOptions {
|
|
474
|
+
authorizeUrl: string;
|
|
475
|
+
clientId: string;
|
|
476
|
+
redirectUri: string;
|
|
477
|
+
responseType?: string;
|
|
478
|
+
scope?: string;
|
|
479
|
+
state?: string;
|
|
480
|
+
codeChallenge?: string;
|
|
481
|
+
codeChallengeMethod?: 'S256' | 'plain';
|
|
482
|
+
extraParams?: Record<string, string>;
|
|
483
|
+
}
|
|
484
|
+
/**
|
|
485
|
+
* Builds an OAuth 2.0 authorization URL
|
|
486
|
+
*/
|
|
487
|
+
declare function buildAuthorizeUrl(options: BuildAuthorizeUrlOptions): string;
|
|
488
|
+
/**
|
|
489
|
+
* Parses query params from OAuth redirect callback URL
|
|
490
|
+
*/
|
|
491
|
+
declare function parseOAuthCallback(urlOrSearch?: string): {
|
|
492
|
+
code?: string;
|
|
493
|
+
state?: string;
|
|
494
|
+
error?: string;
|
|
495
|
+
error_description?: string;
|
|
496
|
+
token?: string;
|
|
497
|
+
};
|
|
498
|
+
|
|
499
|
+
declare const identityProviders: {
|
|
500
|
+
world: typeof WorldAuthProvider;
|
|
501
|
+
passkey: typeof PasskeyAuthProvider;
|
|
502
|
+
};
|
|
503
|
+
|
|
504
|
+
type ProviderCategory = 'social' | 'developer' | 'web3' | 'identity';
|
|
505
|
+
/**
|
|
506
|
+
* Unified Flat Providers Map
|
|
507
|
+
*/
|
|
508
|
+
declare const providers: {
|
|
509
|
+
google: typeof GoogleAuthProvider;
|
|
510
|
+
apple: typeof AppleAuthProvider;
|
|
511
|
+
meta: typeof MetaAuthProvider;
|
|
512
|
+
facebook: typeof MetaAuthProvider;
|
|
513
|
+
kakao: typeof KakaoAuthProvider;
|
|
514
|
+
naver: typeof NaverAuthProvider;
|
|
515
|
+
line: typeof LineAuthProvider;
|
|
516
|
+
github: typeof GithubAuthProvider;
|
|
517
|
+
discord: typeof DiscordAuthProvider;
|
|
518
|
+
web3: typeof Web3AuthProvider;
|
|
519
|
+
world: typeof WorldAuthProvider;
|
|
520
|
+
passkey: typeof PasskeyAuthProvider;
|
|
521
|
+
none: null;
|
|
522
|
+
};
|
|
523
|
+
type ProviderType = keyof typeof providers;
|
|
524
|
+
/**
|
|
525
|
+
* Returns the category of a provider
|
|
526
|
+
*/
|
|
527
|
+
declare const getProviderCategory: (provider: ProviderType) => ProviderCategory | null;
|
|
528
|
+
/**
|
|
529
|
+
* Returns all providers belonging to a specific category
|
|
530
|
+
*/
|
|
531
|
+
declare const getProvidersByCategory: (category: ProviderCategory) => {};
|
|
532
|
+
|
|
533
|
+
declare class AuthBaseService {
|
|
534
|
+
constructor();
|
|
535
|
+
initStore(prevState?: boolean): void;
|
|
536
|
+
getAuthState(): boolean;
|
|
537
|
+
isAuthenticated(): boolean;
|
|
538
|
+
setAuthState(value: boolean): void;
|
|
539
|
+
getAuthInfo<T = any>(): T | null;
|
|
540
|
+
setAuthInfo(value: any): void;
|
|
541
|
+
updateAuthInfo<T = any>(partial: Partial<T>): T;
|
|
542
|
+
watchAuthState(callback: (auth: boolean) => void): () => void;
|
|
543
|
+
watchAuthInfo<T = any>(callback: (info: T | null) => void): () => void;
|
|
544
|
+
clearAuthState(): void;
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
/**
|
|
548
|
+
* Browser-friendly JWT utilities (No Node.js dependencies)
|
|
549
|
+
* Fully compatible with Web Crypto API and modern browsers.
|
|
550
|
+
*/
|
|
551
|
+
interface JwtHeader {
|
|
552
|
+
alg: string;
|
|
553
|
+
typ?: string;
|
|
554
|
+
kid?: string;
|
|
555
|
+
[key: string]: any;
|
|
556
|
+
}
|
|
557
|
+
interface JwtPayload {
|
|
558
|
+
iss?: string;
|
|
559
|
+
sub?: string;
|
|
560
|
+
aud?: string | string[];
|
|
561
|
+
exp?: number;
|
|
562
|
+
nbf?: number;
|
|
563
|
+
iat?: number;
|
|
564
|
+
jti?: string;
|
|
565
|
+
roles?: string[];
|
|
566
|
+
permissions?: string[];
|
|
567
|
+
[key: string]: any;
|
|
568
|
+
}
|
|
569
|
+
interface DecodedToken<T = JwtPayload> {
|
|
570
|
+
header: JwtHeader;
|
|
571
|
+
payload: T;
|
|
572
|
+
signature: string;
|
|
573
|
+
}
|
|
574
|
+
/**
|
|
575
|
+
* Parses a JWT token into header, payload, and signature without verifying.
|
|
576
|
+
*/
|
|
577
|
+
declare function decodeToken<T = JwtPayload>(token: string): DecodedToken<T> | null;
|
|
578
|
+
/**
|
|
579
|
+
* Checks if a JWT token is expired.
|
|
580
|
+
* @param token JWT string
|
|
581
|
+
* @param clockToleranceSeconds optional clock skew tolerance in seconds (default: 0)
|
|
582
|
+
*/
|
|
583
|
+
declare function isExpiredToken(token: string, clockToleranceSeconds?: number): boolean;
|
|
584
|
+
/**
|
|
585
|
+
* Returns the expiration remaining time in milliseconds.
|
|
586
|
+
* Returns 0 if already expired or invalid.
|
|
587
|
+
*/
|
|
588
|
+
declare function getTokenTimeRemaining(token: string): number;
|
|
589
|
+
/**
|
|
590
|
+
* Extracts payload object from JWT token.
|
|
591
|
+
*/
|
|
592
|
+
declare function getTokenPayload<T = JwtPayload>(token: string): T | null;
|
|
593
|
+
/**
|
|
594
|
+
* Extracts bearer token string from HTTP Authorization header.
|
|
595
|
+
* Example: 'Bearer eyJhbGciOi...' -> 'eyJhbGciOi...'
|
|
596
|
+
*/
|
|
597
|
+
declare function getTokenFromHeader(header: string): string | null;
|
|
598
|
+
|
|
599
|
+
/**
|
|
600
|
+
* Role-Based Access Control (RBAC) and Permission Guards
|
|
601
|
+
* Supports wildcards, role hierarchy, custom predicates, and lifecycle callbacks.
|
|
602
|
+
*/
|
|
603
|
+
type MatchMode = 'any' | 'all';
|
|
604
|
+
type GuardFailureReason = 'UNAUTHENTICATED' | 'INSUFFICIENT_ROLES' | 'INSUFFICIENT_PERMISSIONS' | 'CUSTOM_VALIDATION_FAILED';
|
|
605
|
+
interface GuardResult {
|
|
606
|
+
allowed: boolean;
|
|
607
|
+
reason?: GuardFailureReason;
|
|
608
|
+
message?: string;
|
|
609
|
+
missingRoles?: string[];
|
|
610
|
+
missingPermissions?: string[];
|
|
611
|
+
}
|
|
612
|
+
interface AuthContext {
|
|
613
|
+
isAuthenticated: boolean;
|
|
614
|
+
roles?: string[];
|
|
615
|
+
permissions?: string[];
|
|
616
|
+
user?: any;
|
|
617
|
+
[key: string]: any;
|
|
618
|
+
}
|
|
619
|
+
type RoleHierarchyMap = Record<string, string[]>;
|
|
620
|
+
interface AuthGuardOptions {
|
|
621
|
+
/**
|
|
622
|
+
* Whether authentication is strictly required
|
|
623
|
+
* @default true
|
|
624
|
+
*/
|
|
625
|
+
requireAuth?: boolean;
|
|
626
|
+
/**
|
|
627
|
+
* Allowed roles (e.g. ['ADMIN', 'MANAGER'])
|
|
628
|
+
*/
|
|
629
|
+
roles?: string | string[];
|
|
630
|
+
/**
|
|
631
|
+
* Role match strategy ('any' = match at least one, 'all' = match all)
|
|
632
|
+
* @default 'any'
|
|
633
|
+
*/
|
|
634
|
+
roleMatch?: MatchMode;
|
|
635
|
+
/**
|
|
636
|
+
* Optional role hierarchy mapping (e.g. { ADMIN: ['MANAGER', 'USER'] })
|
|
637
|
+
*/
|
|
638
|
+
roleHierarchy?: RoleHierarchyMap;
|
|
639
|
+
/**
|
|
640
|
+
* Required permissions (e.g. ['read:users', 'write:*'])
|
|
641
|
+
*/
|
|
642
|
+
permissions?: string | string[];
|
|
643
|
+
/**
|
|
644
|
+
* Permission match strategy ('any' = match at least one, 'all' = match all)
|
|
645
|
+
* @default 'all'
|
|
646
|
+
*/
|
|
647
|
+
permissionMatch?: MatchMode;
|
|
648
|
+
/**
|
|
649
|
+
* Custom validation predicate for attribute-based or contextual checks (ABAC)
|
|
650
|
+
*/
|
|
651
|
+
validate?: (context: AuthContext) => boolean | Promise<boolean>;
|
|
652
|
+
/**
|
|
653
|
+
* Target resource or route identifier for telemetry/logging
|
|
654
|
+
*/
|
|
655
|
+
target?: string;
|
|
656
|
+
/**
|
|
657
|
+
* Callback when authentication check fails (not logged in)
|
|
658
|
+
*/
|
|
659
|
+
onUnauthenticated?: (context: AuthContext) => void | Promise<void>;
|
|
660
|
+
/**
|
|
661
|
+
* Callback when authorization check fails (insufficient roles/permissions/validation)
|
|
662
|
+
*/
|
|
663
|
+
onUnauthorized?: (reason: string, context: AuthContext, result?: GuardResult) => void | Promise<void>;
|
|
664
|
+
/**
|
|
665
|
+
* Callback specifically when roles or permissions are missing (403 Forbidden scenario)
|
|
666
|
+
*/
|
|
667
|
+
onForbidden?: (missing: {
|
|
668
|
+
roles?: string[];
|
|
669
|
+
permissions?: string[];
|
|
670
|
+
}, context: AuthContext) => void | Promise<void>;
|
|
671
|
+
/**
|
|
672
|
+
* Callback when authorization check succeeds
|
|
673
|
+
*/
|
|
674
|
+
onSuccess?: (context: AuthContext) => void | Promise<void>;
|
|
675
|
+
/**
|
|
676
|
+
* Global evaluation callback triggered on every guard check
|
|
677
|
+
*/
|
|
678
|
+
onEvaluate?: (result: GuardResult, context: AuthContext) => void | Promise<void>;
|
|
679
|
+
}
|
|
680
|
+
/**
|
|
681
|
+
* Resolves all inherited roles given a user's direct roles and a hierarchy map.
|
|
682
|
+
*/
|
|
683
|
+
declare function resolveInheritedRoles(userRoles?: string[], hierarchy?: RoleHierarchyMap): string[];
|
|
684
|
+
/**
|
|
685
|
+
* Checks if a user permission satisfies a required permission pattern.
|
|
686
|
+
* Supports wildcards:
|
|
687
|
+
* - '*' matches everything (superuser)
|
|
688
|
+
* - 'users:*' matches 'users:read', 'users:create'
|
|
689
|
+
* - '*:read' matches 'posts:read', 'users:read'
|
|
690
|
+
*/
|
|
691
|
+
declare function matchPermissionRule(pattern: string, userPerm: string): boolean;
|
|
692
|
+
/**
|
|
693
|
+
* Checks if user has required role(s).
|
|
694
|
+
*/
|
|
695
|
+
declare function checkRole(required: string | string[], userRoles?: string[], matchAll?: boolean, hierarchy?: RoleHierarchyMap): boolean;
|
|
696
|
+
/**
|
|
697
|
+
* Checks if user has required permission(s), supporting wildcards.
|
|
698
|
+
*/
|
|
699
|
+
declare function checkPermission(required: string | string[], userPermissions?: string[], matchAll?: boolean): boolean;
|
|
700
|
+
/**
|
|
701
|
+
* Evaluates guard rules against context and returns detailed GuardResult.
|
|
702
|
+
*/
|
|
703
|
+
declare function evaluateGuard(options: AuthGuardOptions, context: AuthContext): Promise<GuardResult>;
|
|
704
|
+
/**
|
|
705
|
+
* Creates a reusable route/navigation guard with callbacks and detailed evaluation.
|
|
706
|
+
*/
|
|
707
|
+
declare function createAuthGuard(options: AuthGuardOptions): (context: AuthContext) => Promise<boolean>;
|
|
708
|
+
/**
|
|
709
|
+
* Router / Navigation Guard Helper
|
|
710
|
+
* Compatible with Vue Router, React Router loader, SvelteKit, etc.
|
|
711
|
+
*/
|
|
712
|
+
declare function createNavigationGuard(options: AuthGuardOptions & {
|
|
713
|
+
getContext: () => AuthContext | Promise<AuthContext>;
|
|
714
|
+
redirectToOnUnauthenticated?: string;
|
|
715
|
+
redirectToOnUnauthorized?: string;
|
|
716
|
+
onRedirect?: (url: string) => void;
|
|
717
|
+
}): () => Promise<{
|
|
718
|
+
allowed: boolean;
|
|
719
|
+
redirect?: string;
|
|
720
|
+
}>;
|
|
721
|
+
|
|
722
|
+
interface AutoRefreshOptions {
|
|
723
|
+
/**
|
|
724
|
+
* Seconds before actual expiration to trigger refresh
|
|
725
|
+
* @default 60
|
|
726
|
+
*/
|
|
727
|
+
leadTimeSeconds?: number;
|
|
728
|
+
/**
|
|
729
|
+
* Whether to trigger refresh immediately if token is missing or already expired
|
|
730
|
+
* @default true
|
|
731
|
+
*/
|
|
732
|
+
immediateIfExpired?: boolean;
|
|
733
|
+
/**
|
|
734
|
+
* Callback when auto refresh succeeds
|
|
735
|
+
*/
|
|
736
|
+
onSuccess?: (newToken: string) => void;
|
|
737
|
+
/**
|
|
738
|
+
* Callback when auto refresh fails
|
|
739
|
+
*/
|
|
740
|
+
onError?: (error: any) => void;
|
|
741
|
+
}
|
|
742
|
+
declare class JwtService extends AuthBaseService {
|
|
743
|
+
private inFlightRefreshPromise;
|
|
744
|
+
private autoRefreshTimer;
|
|
745
|
+
private autoRefreshFn;
|
|
746
|
+
private autoRefreshOptions;
|
|
747
|
+
constructor(secretKey?: string);
|
|
748
|
+
private validatePersistedSession;
|
|
749
|
+
configureJwt(secretKey: string): void;
|
|
750
|
+
getAccessToken(): string | null;
|
|
751
|
+
setAccessToken(value: string | null): void;
|
|
752
|
+
getRefreshToken(): string | null;
|
|
753
|
+
setRefreshToken(token: string | null): void;
|
|
754
|
+
isValidAccessToken(): boolean;
|
|
755
|
+
isExpiredAccessToken(): boolean;
|
|
756
|
+
getTimeRemaining(): number;
|
|
757
|
+
getAccessTokenPayload<T = JwtPayload>(): T | null;
|
|
758
|
+
setAccessTokenFromHeader(header: string): void;
|
|
759
|
+
hasRole(role: string | string[], matchAll?: boolean, hierarchy?: RoleHierarchyMap): boolean;
|
|
760
|
+
hasPermission(permission: string | string[], matchAll?: boolean): boolean;
|
|
761
|
+
can(permission: string | string[], matchAll?: boolean): boolean;
|
|
762
|
+
is(role: string | string[], matchAll?: boolean, hierarchy?: RoleHierarchyMap): boolean;
|
|
763
|
+
/**
|
|
764
|
+
* Refreshes access token with in-flight deduplication (Mutex)
|
|
765
|
+
*/
|
|
766
|
+
refreshToken(refreshTokenFn: () => Promise<string>): Promise<string | null>;
|
|
767
|
+
/**
|
|
768
|
+
* Starts automatic background token refresh prior to expiration
|
|
769
|
+
*/
|
|
770
|
+
startAutoRefresh(refreshFn: () => Promise<string>, options?: AutoRefreshOptions): void;
|
|
771
|
+
/**
|
|
772
|
+
* Stops automatic token refresh scheduler
|
|
773
|
+
*/
|
|
774
|
+
stopAutoRefresh(): void;
|
|
775
|
+
private scheduleNextAutoRefresh;
|
|
776
|
+
clearAuthState(): void;
|
|
777
|
+
}
|
|
778
|
+
|
|
779
|
+
/**
|
|
780
|
+
* Token Exchange Adapter
|
|
781
|
+
* Standardized interface and HTTP implementation for exchanging OAuth codes,
|
|
782
|
+
* World ID proofs, Passkey assertions, and Web3 signatures with backend APIs.
|
|
783
|
+
*/
|
|
784
|
+
interface TokenExchangeResult {
|
|
785
|
+
accessToken: string;
|
|
786
|
+
refreshToken?: string;
|
|
787
|
+
expiresIn?: number;
|
|
788
|
+
tokenType?: string;
|
|
789
|
+
user?: any;
|
|
790
|
+
raw?: any;
|
|
791
|
+
}
|
|
792
|
+
interface TokenExchangeAdapter {
|
|
793
|
+
exchangeOAuthCode(provider: string, code: string, options?: {
|
|
794
|
+
redirectUri?: string;
|
|
795
|
+
state?: string;
|
|
796
|
+
codeVerifier?: string;
|
|
797
|
+
}): Promise<TokenExchangeResult>;
|
|
798
|
+
exchangeWorldProof?(proofResult: any, options?: {
|
|
799
|
+
action?: string;
|
|
800
|
+
signal?: string;
|
|
801
|
+
}): Promise<TokenExchangeResult>;
|
|
802
|
+
exchangePasskeyAssertion?(assertion: any, options?: {
|
|
803
|
+
challenge?: string;
|
|
804
|
+
}): Promise<TokenExchangeResult>;
|
|
805
|
+
exchangeWeb3Signature?(signatureResult: {
|
|
806
|
+
address: string;
|
|
807
|
+
signature: string;
|
|
808
|
+
message: string;
|
|
809
|
+
chainId: number;
|
|
810
|
+
}): Promise<TokenExchangeResult>;
|
|
811
|
+
}
|
|
812
|
+
interface HttpTokenExchangeOptions {
|
|
813
|
+
tokenEndpoint: string;
|
|
814
|
+
headers?: Record<string, string>;
|
|
815
|
+
credentials?: RequestCredentials;
|
|
816
|
+
customBodyFormatter?: (type: string, payload: any) => any;
|
|
817
|
+
fetchFn?: typeof fetch;
|
|
818
|
+
}
|
|
819
|
+
/**
|
|
820
|
+
* Standard HTTP-based Token Exchange Adapter
|
|
821
|
+
*/
|
|
822
|
+
declare class HttpTokenExchangeAdapter implements TokenExchangeAdapter {
|
|
823
|
+
private endpoint;
|
|
824
|
+
private headers;
|
|
825
|
+
private credentials;
|
|
826
|
+
private customBodyFormatter?;
|
|
827
|
+
private fetchFn;
|
|
828
|
+
constructor(options: HttpTokenExchangeOptions);
|
|
829
|
+
private postExchange;
|
|
830
|
+
exchangeOAuthCode(provider: string, code: string, options?: {
|
|
831
|
+
redirectUri?: string;
|
|
832
|
+
state?: string;
|
|
833
|
+
codeVerifier?: string;
|
|
834
|
+
}): Promise<TokenExchangeResult>;
|
|
835
|
+
exchangeWorldProof(proofResult: any, options?: {
|
|
836
|
+
action?: string;
|
|
837
|
+
signal?: string;
|
|
838
|
+
}): Promise<TokenExchangeResult>;
|
|
839
|
+
exchangePasskeyAssertion(assertion: any, options?: {
|
|
840
|
+
challenge?: string;
|
|
841
|
+
}): Promise<TokenExchangeResult>;
|
|
842
|
+
exchangeWeb3Signature(signatureResult: {
|
|
843
|
+
address: string;
|
|
844
|
+
signature: string;
|
|
845
|
+
message: string;
|
|
846
|
+
chainId: number;
|
|
847
|
+
}): Promise<TokenExchangeResult>;
|
|
848
|
+
}
|
|
849
|
+
|
|
850
|
+
declare const AuthService: {
|
|
851
|
+
base: typeof AuthBaseService;
|
|
852
|
+
jwt: typeof JwtService;
|
|
853
|
+
};
|
|
854
|
+
type AuthServiceType = keyof typeof AuthService;
|
|
855
|
+
|
|
856
|
+
declare function addAuthEventListener(callback: (detail: any) => void, target?: EventTarget): () => void;
|
|
857
|
+
declare function removeAuthEventListener(callback: (detail: any) => void, target?: EventTarget): void;
|
|
858
|
+
declare function dispatchAuthEvent(eventNameOrDetail: string | any, detailOrTarget?: any, optionalTarget?: EventTarget): void;
|
|
859
|
+
|
|
860
|
+
type CoreProviderType = Exclude<ProviderType | AuthServiceType, 'none'>;
|
|
861
|
+
|
|
862
|
+
/**
|
|
863
|
+
* Authentication & Authorization Lifecycle Event & Hook System
|
|
864
|
+
*/
|
|
865
|
+
type AuthLifecycleEvent = 'signIn' | 'signOut' | 'tokenExpired' | 'tokenRefreshed' | 'error' | 'unauthorized' | 'accessDenied' | 'roleChanged' | 'permissionChanged';
|
|
866
|
+
type LifecycleListener<T = any> = (data?: T) => void | Promise<void>;
|
|
867
|
+
interface UnauthorizedEventData {
|
|
868
|
+
reason: string;
|
|
869
|
+
result?: any;
|
|
870
|
+
context?: any;
|
|
871
|
+
timestamp?: number;
|
|
872
|
+
}
|
|
873
|
+
interface AccessDeniedEventData {
|
|
874
|
+
reason: string;
|
|
875
|
+
result?: any;
|
|
876
|
+
context?: any;
|
|
877
|
+
target?: string;
|
|
878
|
+
timestamp?: number;
|
|
879
|
+
}
|
|
880
|
+
interface RoleChangedEventData {
|
|
881
|
+
roles: string[];
|
|
882
|
+
previousRoles?: string[];
|
|
883
|
+
}
|
|
884
|
+
interface PermissionChangedEventData {
|
|
885
|
+
permissions: string[];
|
|
886
|
+
previousPermissions?: string[];
|
|
887
|
+
}
|
|
888
|
+
declare class AuthLifecycleManager {
|
|
889
|
+
private listeners;
|
|
890
|
+
on(event: AuthLifecycleEvent, listener: LifecycleListener): () => void;
|
|
891
|
+
onSignIn(listener: LifecycleListener<{
|
|
892
|
+
user?: any;
|
|
893
|
+
token?: string;
|
|
894
|
+
}>): () => void;
|
|
895
|
+
onSignOut(listener: LifecycleListener<void>): () => void;
|
|
896
|
+
onTokenExpired(listener: LifecycleListener<void>): () => void;
|
|
897
|
+
onTokenRefreshed(listener: LifecycleListener<{
|
|
898
|
+
token: string;
|
|
899
|
+
}>): () => void;
|
|
900
|
+
onError(listener: LifecycleListener<{
|
|
901
|
+
error: any;
|
|
902
|
+
phase?: string;
|
|
903
|
+
}>): () => void;
|
|
904
|
+
/**
|
|
905
|
+
* Called when authentication or authorization check fails
|
|
906
|
+
*/
|
|
907
|
+
onUnauthorized(listener: LifecycleListener<UnauthorizedEventData>): () => void;
|
|
908
|
+
/**
|
|
909
|
+
* Called when access to a resource/route is denied by an auth guard
|
|
910
|
+
*/
|
|
911
|
+
onAccessDenied(listener: LifecycleListener<AccessDeniedEventData>): () => void;
|
|
912
|
+
/**
|
|
913
|
+
* Called when the active user's roles change
|
|
914
|
+
*/
|
|
915
|
+
onRoleChanged(listener: LifecycleListener<RoleChangedEventData>): () => void;
|
|
916
|
+
/**
|
|
917
|
+
* Called when the active user's permissions change
|
|
918
|
+
*/
|
|
919
|
+
onPermissionChanged(listener: LifecycleListener<PermissionChangedEventData>): () => void;
|
|
920
|
+
emit(event: AuthLifecycleEvent, data?: any): Promise<void>;
|
|
921
|
+
clear(): void;
|
|
922
|
+
}
|
|
923
|
+
|
|
924
|
+
/**
|
|
925
|
+
* HTTP Client utilities with automatic Authorization header injection and 401 retry
|
|
926
|
+
* Supports both Fetch API (createAuthFetch) and Axios (applyAuthInterceptor / createAuthAxios)
|
|
927
|
+
*/
|
|
928
|
+
interface AuthClientInterface {
|
|
929
|
+
getAccessToken(): string | null;
|
|
930
|
+
refreshToken?(refreshFn?: () => Promise<string>): Promise<string | null>;
|
|
931
|
+
clearAuthState?(): void;
|
|
932
|
+
}
|
|
933
|
+
interface AuthHttpOptions {
|
|
934
|
+
authClient: AuthClientInterface;
|
|
935
|
+
refreshFn?: () => Promise<string>;
|
|
936
|
+
baseUrl?: string;
|
|
937
|
+
onUnauthorized?: () => void;
|
|
938
|
+
headerName?: string;
|
|
939
|
+
tokenPrefix?: string;
|
|
940
|
+
withCredentials?: boolean;
|
|
941
|
+
beforeRequest?: (config: any) => any | Promise<any>;
|
|
942
|
+
afterResponse?: (response: any) => any | Promise<any>;
|
|
943
|
+
}
|
|
944
|
+
interface AuthFetchOptions extends AuthHttpOptions {
|
|
945
|
+
customFetch?: typeof fetch;
|
|
946
|
+
}
|
|
947
|
+
/**
|
|
948
|
+
* Creates an authenticated fetch wrapper that injects Bearer token and automatically retries upon 401.
|
|
949
|
+
*/
|
|
950
|
+
declare function createAuthFetch(options: AuthFetchOptions): (input: RequestInfo | URL, init?: RequestInit) => Promise<Response>;
|
|
951
|
+
/**
|
|
952
|
+
* Applies authorization interceptor and automatic 401 token refresh retry to an Axios instance.
|
|
953
|
+
*/
|
|
954
|
+
declare function applyAuthInterceptor(axiosInstance: any, options: AuthHttpOptions): {
|
|
955
|
+
eject: () => void;
|
|
956
|
+
};
|
|
957
|
+
/**
|
|
958
|
+
* Helper to create or wrap an Axios instance with auth interceptors.
|
|
959
|
+
*/
|
|
960
|
+
declare function createAuthAxios(axiosModuleOrInstance: any, options: AuthHttpOptions): any;
|
|
961
|
+
|
|
962
|
+
type Selector<T, R> = (state: T) => R;
|
|
963
|
+
type EqualityFn<T> = (a: T, b: T) => boolean;
|
|
964
|
+
/**
|
|
965
|
+
* 상태 객체의 특정 슬라이스나 계산값만 구독하는 셀렉터 구독자
|
|
966
|
+
*/
|
|
967
|
+
declare function subscribeSelector<T = any, R = any>(id: string, selector: Selector<T, R>, listener: (slice: R, prevSlice?: R) => void, equalityFn?: EqualityFn<R>): () => void;
|
|
968
|
+
/**
|
|
969
|
+
* 여러 상태 변경을 하나의 틱으로 묶어주는 배치 함수
|
|
970
|
+
*/
|
|
971
|
+
declare function batch(fn: () => void): void;
|
|
972
|
+
|
|
973
|
+
/**
|
|
974
|
+
* Storage adapter interface and implementations for persistence
|
|
975
|
+
*/
|
|
976
|
+
interface StorageAdapter {
|
|
977
|
+
getItem(key: string): string | null;
|
|
978
|
+
setItem(key: string, value: string): void;
|
|
979
|
+
removeItem(key: string): void;
|
|
980
|
+
clear?(): void;
|
|
981
|
+
keys?(): string[];
|
|
982
|
+
}
|
|
983
|
+
declare class MemoryStorageAdapter implements StorageAdapter {
|
|
984
|
+
private cache;
|
|
985
|
+
getItem(key: string): string | null;
|
|
986
|
+
setItem(key: string, value: string): void;
|
|
987
|
+
removeItem(key: string): void;
|
|
988
|
+
clear(): void;
|
|
989
|
+
keys(): string[];
|
|
990
|
+
}
|
|
991
|
+
/**
|
|
992
|
+
* @deprecated ⚠️ SECURITY WARNING:
|
|
993
|
+
* Storing authentication tokens in LocalStorage exposes the application to XSS (Cross-Site Scripting) token theft.
|
|
994
|
+
* DO NOT USE FOR PRODUCTION!
|
|
995
|
+
* For development/prototyping, use 'dev_insecure_localStorage'.
|
|
996
|
+
* For production, use 'memory' (with silent refresh) or 'cookie' (BFF HttpOnly mode).
|
|
997
|
+
*/
|
|
998
|
+
declare class LocalStorageAdapter implements StorageAdapter {
|
|
999
|
+
getItem(key: string): string | null;
|
|
1000
|
+
setItem(key: string, value: string): void;
|
|
1001
|
+
removeItem(key: string): void;
|
|
1002
|
+
clear(): void;
|
|
1003
|
+
keys(): string[];
|
|
1004
|
+
}
|
|
1005
|
+
declare class SessionStorageAdapter implements StorageAdapter {
|
|
1006
|
+
getItem(key: string): string | null;
|
|
1007
|
+
setItem(key: string, value: string): void;
|
|
1008
|
+
removeItem(key: string): void;
|
|
1009
|
+
clear(): void;
|
|
1010
|
+
keys(): string[];
|
|
1011
|
+
}
|
|
1012
|
+
/**
|
|
1013
|
+
* Cookie / Hybrid Session Storage Adapter
|
|
1014
|
+
* Designed for BFF / Server-Side HttpOnly cookie setups.
|
|
1015
|
+
* Does NOT persist raw JWT/tokens to local storage (relies on browser cookie jar and withCredentials).
|
|
1016
|
+
* Only non-sensitive session metadata (user profile, roles) may optionally be cached in memory.
|
|
1017
|
+
*/
|
|
1018
|
+
declare class CookieSessionStorageAdapter implements StorageAdapter {
|
|
1019
|
+
private memoryCache;
|
|
1020
|
+
private persistUserInfo;
|
|
1021
|
+
constructor(options?: {
|
|
1022
|
+
persistUserInfo?: boolean;
|
|
1023
|
+
});
|
|
1024
|
+
getItem(key: string): string | null;
|
|
1025
|
+
setItem(key: string, value: string): void;
|
|
1026
|
+
removeItem(key: string): void;
|
|
1027
|
+
clear(): void;
|
|
1028
|
+
keys(): string[];
|
|
1029
|
+
}
|
|
1030
|
+
|
|
1031
|
+
type StorageType = 'memory' | 'cookie' | 'hybrid' | 'sessionStorage' | 'dev_insecure_localStorage' | 'insecure_localStorage' | 'localStorage';
|
|
1032
|
+
interface StorageConfig {
|
|
1033
|
+
type?: StorageType | StorageAdapter;
|
|
1034
|
+
prefix?: string;
|
|
1035
|
+
persistUserInfo?: boolean;
|
|
1036
|
+
}
|
|
1037
|
+
declare function configureStorage(config: StorageType | StorageAdapter | StorageConfig): void;
|
|
1038
|
+
declare function getStorageAdapter(): StorageAdapter;
|
|
1039
|
+
declare function getAuthState(): boolean;
|
|
1040
|
+
declare function getAccessToken(): string | null;
|
|
1041
|
+
declare function getRefreshToken(): string | null;
|
|
1042
|
+
declare function setRefreshToken(value: string | null): void;
|
|
1043
|
+
declare function getAuthInfo<T = any>(): T | null;
|
|
1044
|
+
/**
|
|
1045
|
+
* Partially updates authInfo (shallow merge)
|
|
1046
|
+
*/
|
|
1047
|
+
declare function updateAuthInfo<T = any>(partial: Partial<T>): T & Partial<T>;
|
|
1048
|
+
/**
|
|
1049
|
+
* Clears entire authentication session atomically
|
|
1050
|
+
*/
|
|
1051
|
+
declare function clearStoreSession(): void;
|
|
1052
|
+
|
|
1053
|
+
interface AuthCoreProps {
|
|
1054
|
+
providerType?: CoreProviderType;
|
|
1055
|
+
secret?: string;
|
|
1056
|
+
storage?: StorageType;
|
|
1057
|
+
storagePrefix?: string;
|
|
1058
|
+
}
|
|
1059
|
+
declare class AuthCore {
|
|
1060
|
+
private provider;
|
|
1061
|
+
private button;
|
|
1062
|
+
private serviceInstance;
|
|
1063
|
+
lifecycle: AuthLifecycleManager;
|
|
1064
|
+
constructor({ providerType, secret, storage, storagePrefix, }?: AuthCoreProps);
|
|
1065
|
+
getService(): AuthBaseService | JwtService;
|
|
1066
|
+
getProvider(): typeof GoogleAuthProvider | typeof AppleAuthProvider | typeof MetaAuthProvider | typeof KakaoAuthProvider | typeof NaverAuthProvider | typeof LineAuthProvider | typeof GithubAuthProvider | typeof DiscordAuthProvider | typeof Web3AuthProvider | typeof WorldAuthProvider | typeof PasskeyAuthProvider | null;
|
|
1067
|
+
getButton(): LoginButton | null;
|
|
1068
|
+
getContext(): AuthContext;
|
|
1069
|
+
updateAuthInfo<T = any>(partial: Partial<T>): T;
|
|
1070
|
+
startAutoRefresh(refreshFn: () => Promise<string>, options?: AutoRefreshOptions): void;
|
|
1071
|
+
stopAutoRefresh(): void;
|
|
1072
|
+
evaluateGuard(options: AuthGuardOptions, customContext?: Partial<AuthContext>): Promise<GuardResult>;
|
|
1073
|
+
createGuard(options: AuthGuardOptions): Promise<boolean>;
|
|
1074
|
+
hasRole(role: string | string[], matchAll?: boolean): boolean;
|
|
1075
|
+
hasPermission(permission: string | string[], matchAll?: boolean): boolean;
|
|
1076
|
+
createFetch(options?: Partial<AuthFetchOptions>): (input: RequestInfo | URL, init?: RequestInit) => Promise<Response>;
|
|
1077
|
+
applyAxiosInterceptor(axiosInstance: any, options?: Partial<AuthHttpOptions>): {
|
|
1078
|
+
eject: () => void;
|
|
1079
|
+
};
|
|
1080
|
+
createAxios(axiosModuleOrInstance: any, options?: Partial<AuthHttpOptions>): any;
|
|
1081
|
+
createTokenExchange(tokenEndpoint: string, options?: Omit<HttpTokenExchangeOptions, 'tokenEndpoint'>): HttpTokenExchangeAdapter;
|
|
1082
|
+
getWebComponentAPI(): {
|
|
1083
|
+
addAuthEventListener: typeof addAuthEventListener;
|
|
1084
|
+
removeAuthEventListener: typeof removeAuthEventListener;
|
|
1085
|
+
dispatchAuthEvent: typeof dispatchAuthEvent;
|
|
1086
|
+
watchAuthState: ((callback: (auth: boolean) => void) => () => void) | ((callback: (auth: boolean) => void) => () => void);
|
|
1087
|
+
};
|
|
1088
|
+
}
|
|
1089
|
+
|
|
1090
|
+
interface IAuthService {
|
|
1091
|
+
initStore(prevState?: boolean): void;
|
|
1092
|
+
getAuthState(): boolean;
|
|
1093
|
+
setAuthState(value: boolean): void;
|
|
1094
|
+
getAuthInfo<T = any>(): T | null;
|
|
1095
|
+
setAuthInfo(value: any): void;
|
|
1096
|
+
watchAuthState(callback: (auth: boolean) => void): void | (() => void);
|
|
1097
|
+
clearAuthState(): void;
|
|
1098
|
+
getAccessToken?(): string | null;
|
|
1099
|
+
setAccessToken?(value: string): void;
|
|
1100
|
+
isExpiredAccessToken?(): boolean;
|
|
1101
|
+
getAccessTokenPayload?(): any;
|
|
1102
|
+
setAccessTokenFromHeader?(header: string): void;
|
|
1103
|
+
refreshToken?(refreshTokenFn: () => Promise<string>): Promise<string | null>;
|
|
1104
|
+
hasRole?(role: string): boolean;
|
|
1105
|
+
hasPermission?(permission: string): boolean;
|
|
1106
|
+
}
|
|
1107
|
+
interface IAuthProvider {
|
|
1108
|
+
init(): Promise<void>;
|
|
1109
|
+
signIn(): void | Promise<void>;
|
|
1110
|
+
signOut(): void;
|
|
1111
|
+
getAccessToken(): Promise<string | null> | string | null;
|
|
1112
|
+
getUserInfo(): Promise<any>;
|
|
1113
|
+
}
|
|
1114
|
+
interface ILoginButton {
|
|
1115
|
+
getButtonClass(): string;
|
|
1116
|
+
toJSON(): {
|
|
1117
|
+
id: string;
|
|
1118
|
+
type: string;
|
|
1119
|
+
provider: string;
|
|
1120
|
+
icon: string;
|
|
1121
|
+
text: string;
|
|
1122
|
+
style: Partial<CSSStyleDeclaration>;
|
|
1123
|
+
fullWidth: boolean;
|
|
1124
|
+
className: string;
|
|
1125
|
+
onClick: Function;
|
|
1126
|
+
};
|
|
1127
|
+
}
|
|
1128
|
+
declare class AuthProvider<S extends IAuthService = IAuthService, P extends IAuthProvider | null = IAuthProvider | null, B extends ILoginButton | null = ILoginButton | null> {
|
|
1129
|
+
private service;
|
|
1130
|
+
private provider;
|
|
1131
|
+
private button;
|
|
1132
|
+
constructor(service: S, provider: P, button: B);
|
|
1133
|
+
init(): Promise<void>;
|
|
1134
|
+
getButton(): {
|
|
1135
|
+
className: string;
|
|
1136
|
+
onClick: () => Promise<void>;
|
|
1137
|
+
id: string;
|
|
1138
|
+
type: string;
|
|
1139
|
+
provider: string;
|
|
1140
|
+
icon: string;
|
|
1141
|
+
text: string;
|
|
1142
|
+
style: Partial<CSSStyleDeclaration>;
|
|
1143
|
+
fullWidth: boolean;
|
|
1144
|
+
};
|
|
1145
|
+
onClick(): Promise<void>;
|
|
1146
|
+
signIn(): Promise<void>;
|
|
1147
|
+
signOut(): void;
|
|
1148
|
+
refresh(refreshTokenFn: () => Promise<string>): Promise<string | null>;
|
|
1149
|
+
restore(): void;
|
|
1150
|
+
getUserInfo(): Promise<any>;
|
|
1151
|
+
getAccessToken(): string | null;
|
|
1152
|
+
getAuthState(): boolean;
|
|
1153
|
+
watchAuthState(callback: (auth: boolean) => void): void | (() => void);
|
|
1154
|
+
hasRole(role: string): boolean;
|
|
1155
|
+
hasPermission(permission: string): boolean;
|
|
1156
|
+
}
|
|
1157
|
+
|
|
1158
|
+
/**
|
|
1159
|
+
* Framework-agnostic renderers for ISA-AUTH buttons
|
|
1160
|
+
* Supports Vanilla JS, React, Vue, Angular, and Web Components
|
|
1161
|
+
*/
|
|
1162
|
+
interface ButtonRenderInfo {
|
|
1163
|
+
onClick: () => void;
|
|
1164
|
+
label?: string;
|
|
1165
|
+
className?: string;
|
|
1166
|
+
icon?: string;
|
|
1167
|
+
style?: Partial<CSSStyleDeclaration>;
|
|
1168
|
+
}
|
|
1169
|
+
/**
|
|
1170
|
+
* Creates and returns a native HTMLButtonElement
|
|
1171
|
+
*/
|
|
1172
|
+
declare function renderByJs(info: ButtonRenderInfo): HTMLButtonElement;
|
|
1173
|
+
/**
|
|
1174
|
+
* React createElement wrapper
|
|
1175
|
+
*/
|
|
1176
|
+
declare function renderByReact(info: ButtonRenderInfo): any;
|
|
1177
|
+
/**
|
|
1178
|
+
* Vue 3 / 2 Component definition object
|
|
1179
|
+
*/
|
|
1180
|
+
declare function renderByVue(info: ButtonRenderInfo): {
|
|
1181
|
+
name: string;
|
|
1182
|
+
props: {
|
|
1183
|
+
label: {
|
|
1184
|
+
type: StringConstructor;
|
|
1185
|
+
default: string;
|
|
1186
|
+
};
|
|
1187
|
+
};
|
|
1188
|
+
emits: string[];
|
|
1189
|
+
template: string;
|
|
1190
|
+
data(): {
|
|
1191
|
+
className: string;
|
|
1192
|
+
icon: string;
|
|
1193
|
+
buttonStyle: {
|
|
1194
|
+
accentColor?: string;
|
|
1195
|
+
alignContent?: string;
|
|
1196
|
+
alignItems: string;
|
|
1197
|
+
alignSelf?: string;
|
|
1198
|
+
alignmentBaseline?: string;
|
|
1199
|
+
all?: string;
|
|
1200
|
+
animation?: string;
|
|
1201
|
+
animationComposition?: string;
|
|
1202
|
+
animationDelay?: string;
|
|
1203
|
+
animationDirection?: string;
|
|
1204
|
+
animationDuration?: string;
|
|
1205
|
+
animationFillMode?: string;
|
|
1206
|
+
animationIterationCount?: string;
|
|
1207
|
+
animationName?: string;
|
|
1208
|
+
animationPlayState?: string;
|
|
1209
|
+
animationTimingFunction?: string;
|
|
1210
|
+
appearance?: string;
|
|
1211
|
+
aspectRatio?: string;
|
|
1212
|
+
backdropFilter?: string;
|
|
1213
|
+
backfaceVisibility?: string;
|
|
1214
|
+
background?: string;
|
|
1215
|
+
backgroundAttachment?: string;
|
|
1216
|
+
backgroundBlendMode?: string;
|
|
1217
|
+
backgroundClip?: string;
|
|
1218
|
+
backgroundColor?: string;
|
|
1219
|
+
backgroundImage?: string;
|
|
1220
|
+
backgroundOrigin?: string;
|
|
1221
|
+
backgroundPosition?: string;
|
|
1222
|
+
backgroundPositionX?: string;
|
|
1223
|
+
backgroundPositionY?: string;
|
|
1224
|
+
backgroundRepeat?: string;
|
|
1225
|
+
backgroundSize?: string;
|
|
1226
|
+
baselineShift?: string;
|
|
1227
|
+
baselineSource?: string;
|
|
1228
|
+
blockSize?: string;
|
|
1229
|
+
border?: string;
|
|
1230
|
+
borderBlock?: string;
|
|
1231
|
+
borderBlockColor?: string;
|
|
1232
|
+
borderBlockEnd?: string;
|
|
1233
|
+
borderBlockEndColor?: string;
|
|
1234
|
+
borderBlockEndStyle?: string;
|
|
1235
|
+
borderBlockEndWidth?: string;
|
|
1236
|
+
borderBlockStart?: string;
|
|
1237
|
+
borderBlockStartColor?: string;
|
|
1238
|
+
borderBlockStartStyle?: string;
|
|
1239
|
+
borderBlockStartWidth?: string;
|
|
1240
|
+
borderBlockStyle?: string;
|
|
1241
|
+
borderBlockWidth?: string;
|
|
1242
|
+
borderBottom?: string;
|
|
1243
|
+
borderBottomColor?: string;
|
|
1244
|
+
borderBottomLeftRadius?: string;
|
|
1245
|
+
borderBottomRightRadius?: string;
|
|
1246
|
+
borderBottomStyle?: string;
|
|
1247
|
+
borderBottomWidth?: string;
|
|
1248
|
+
borderCollapse?: string;
|
|
1249
|
+
borderColor?: string;
|
|
1250
|
+
borderEndEndRadius?: string;
|
|
1251
|
+
borderEndStartRadius?: string;
|
|
1252
|
+
borderImage?: string;
|
|
1253
|
+
borderImageOutset?: string;
|
|
1254
|
+
borderImageRepeat?: string;
|
|
1255
|
+
borderImageSlice?: string;
|
|
1256
|
+
borderImageSource?: string;
|
|
1257
|
+
borderImageWidth?: string;
|
|
1258
|
+
borderInline?: string;
|
|
1259
|
+
borderInlineColor?: string;
|
|
1260
|
+
borderInlineEnd?: string;
|
|
1261
|
+
borderInlineEndColor?: string;
|
|
1262
|
+
borderInlineEndStyle?: string;
|
|
1263
|
+
borderInlineEndWidth?: string;
|
|
1264
|
+
borderInlineStart?: string;
|
|
1265
|
+
borderInlineStartColor?: string;
|
|
1266
|
+
borderInlineStartStyle?: string;
|
|
1267
|
+
borderInlineStartWidth?: string;
|
|
1268
|
+
borderInlineStyle?: string;
|
|
1269
|
+
borderInlineWidth?: string;
|
|
1270
|
+
borderLeft?: string;
|
|
1271
|
+
borderLeftColor?: string;
|
|
1272
|
+
borderLeftStyle?: string;
|
|
1273
|
+
borderLeftWidth?: string;
|
|
1274
|
+
borderRadius?: string;
|
|
1275
|
+
borderRight?: string;
|
|
1276
|
+
borderRightColor?: string;
|
|
1277
|
+
borderRightStyle?: string;
|
|
1278
|
+
borderRightWidth?: string;
|
|
1279
|
+
borderSpacing?: string;
|
|
1280
|
+
borderStartEndRadius?: string;
|
|
1281
|
+
borderStartStartRadius?: string;
|
|
1282
|
+
borderStyle?: string;
|
|
1283
|
+
borderTop?: string;
|
|
1284
|
+
borderTopColor?: string;
|
|
1285
|
+
borderTopLeftRadius?: string;
|
|
1286
|
+
borderTopRightRadius?: string;
|
|
1287
|
+
borderTopStyle?: string;
|
|
1288
|
+
borderTopWidth?: string;
|
|
1289
|
+
borderWidth?: string;
|
|
1290
|
+
bottom?: string;
|
|
1291
|
+
boxDecorationBreak?: string;
|
|
1292
|
+
boxShadow?: string;
|
|
1293
|
+
boxSizing?: string;
|
|
1294
|
+
breakAfter?: string;
|
|
1295
|
+
breakBefore?: string;
|
|
1296
|
+
breakInside?: string;
|
|
1297
|
+
captionSide?: string;
|
|
1298
|
+
caretColor?: string;
|
|
1299
|
+
clear?: string;
|
|
1300
|
+
clip?: string;
|
|
1301
|
+
clipPath?: string;
|
|
1302
|
+
clipRule?: string;
|
|
1303
|
+
color?: string;
|
|
1304
|
+
colorInterpolation?: string;
|
|
1305
|
+
colorInterpolationFilters?: string;
|
|
1306
|
+
colorScheme?: string;
|
|
1307
|
+
columnCount?: string;
|
|
1308
|
+
columnFill?: string;
|
|
1309
|
+
columnGap?: string;
|
|
1310
|
+
columnRule?: string;
|
|
1311
|
+
columnRuleColor?: string;
|
|
1312
|
+
columnRuleStyle?: string;
|
|
1313
|
+
columnRuleWidth?: string;
|
|
1314
|
+
columnSpan?: string;
|
|
1315
|
+
columnWidth?: string;
|
|
1316
|
+
columns?: string;
|
|
1317
|
+
contain?: string;
|
|
1318
|
+
containIntrinsicBlockSize?: string;
|
|
1319
|
+
containIntrinsicHeight?: string;
|
|
1320
|
+
containIntrinsicInlineSize?: string;
|
|
1321
|
+
containIntrinsicSize?: string;
|
|
1322
|
+
containIntrinsicWidth?: string;
|
|
1323
|
+
container?: string;
|
|
1324
|
+
containerName?: string;
|
|
1325
|
+
containerType?: string;
|
|
1326
|
+
content?: string;
|
|
1327
|
+
contentVisibility?: string;
|
|
1328
|
+
counterIncrement?: string;
|
|
1329
|
+
counterReset?: string;
|
|
1330
|
+
counterSet?: string;
|
|
1331
|
+
cssFloat?: string;
|
|
1332
|
+
cssText?: string;
|
|
1333
|
+
cursor: string;
|
|
1334
|
+
cx?: string;
|
|
1335
|
+
cy?: string;
|
|
1336
|
+
d?: string;
|
|
1337
|
+
direction?: string;
|
|
1338
|
+
display: string;
|
|
1339
|
+
dominantBaseline?: string;
|
|
1340
|
+
emptyCells?: string;
|
|
1341
|
+
fill?: string;
|
|
1342
|
+
fillOpacity?: string;
|
|
1343
|
+
fillRule?: string;
|
|
1344
|
+
filter?: string;
|
|
1345
|
+
flex?: string;
|
|
1346
|
+
flexBasis?: string;
|
|
1347
|
+
flexDirection?: string;
|
|
1348
|
+
flexFlow?: string;
|
|
1349
|
+
flexGrow?: string;
|
|
1350
|
+
flexShrink?: string;
|
|
1351
|
+
flexWrap?: string;
|
|
1352
|
+
float?: string;
|
|
1353
|
+
floodColor?: string;
|
|
1354
|
+
floodOpacity?: string;
|
|
1355
|
+
font?: string;
|
|
1356
|
+
fontFamily?: string;
|
|
1357
|
+
fontFeatureSettings?: string;
|
|
1358
|
+
fontKerning?: string;
|
|
1359
|
+
fontOpticalSizing?: string;
|
|
1360
|
+
fontPalette?: string;
|
|
1361
|
+
fontSize?: string;
|
|
1362
|
+
fontSizeAdjust?: string;
|
|
1363
|
+
fontStretch?: string;
|
|
1364
|
+
fontStyle?: string;
|
|
1365
|
+
fontSynthesis?: string;
|
|
1366
|
+
fontSynthesisSmallCaps?: string;
|
|
1367
|
+
fontSynthesisStyle?: string;
|
|
1368
|
+
fontSynthesisWeight?: string;
|
|
1369
|
+
fontVariant?: string;
|
|
1370
|
+
fontVariantAlternates?: string;
|
|
1371
|
+
fontVariantCaps?: string;
|
|
1372
|
+
fontVariantEastAsian?: string;
|
|
1373
|
+
fontVariantLigatures?: string;
|
|
1374
|
+
fontVariantNumeric?: string;
|
|
1375
|
+
fontVariantPosition?: string;
|
|
1376
|
+
fontVariationSettings?: string;
|
|
1377
|
+
fontWeight?: string;
|
|
1378
|
+
forcedColorAdjust?: string;
|
|
1379
|
+
gap: string;
|
|
1380
|
+
grid?: string;
|
|
1381
|
+
gridArea?: string;
|
|
1382
|
+
gridAutoColumns?: string;
|
|
1383
|
+
gridAutoFlow?: string;
|
|
1384
|
+
gridAutoRows?: string;
|
|
1385
|
+
gridColumn?: string;
|
|
1386
|
+
gridColumnEnd?: string;
|
|
1387
|
+
gridColumnGap?: string;
|
|
1388
|
+
gridColumnStart?: string;
|
|
1389
|
+
gridGap?: string;
|
|
1390
|
+
gridRow?: string;
|
|
1391
|
+
gridRowEnd?: string;
|
|
1392
|
+
gridRowGap?: string;
|
|
1393
|
+
gridRowStart?: string;
|
|
1394
|
+
gridTemplate?: string;
|
|
1395
|
+
gridTemplateAreas?: string;
|
|
1396
|
+
gridTemplateColumns?: string;
|
|
1397
|
+
gridTemplateRows?: string;
|
|
1398
|
+
height?: string;
|
|
1399
|
+
hyphenateCharacter?: string;
|
|
1400
|
+
hyphens?: string;
|
|
1401
|
+
imageOrientation?: string;
|
|
1402
|
+
imageRendering?: string;
|
|
1403
|
+
inlineSize?: string;
|
|
1404
|
+
inset?: string;
|
|
1405
|
+
insetBlock?: string;
|
|
1406
|
+
insetBlockEnd?: string;
|
|
1407
|
+
insetBlockStart?: string;
|
|
1408
|
+
insetInline?: string;
|
|
1409
|
+
insetInlineEnd?: string;
|
|
1410
|
+
insetInlineStart?: string;
|
|
1411
|
+
isolation?: string;
|
|
1412
|
+
justifyContent: string;
|
|
1413
|
+
justifyItems?: string;
|
|
1414
|
+
justifySelf?: string;
|
|
1415
|
+
left?: string;
|
|
1416
|
+
length?: number;
|
|
1417
|
+
letterSpacing?: string;
|
|
1418
|
+
lightingColor?: string;
|
|
1419
|
+
lineBreak?: string;
|
|
1420
|
+
lineHeight?: string;
|
|
1421
|
+
listStyle?: string;
|
|
1422
|
+
listStyleImage?: string;
|
|
1423
|
+
listStylePosition?: string;
|
|
1424
|
+
listStyleType?: string;
|
|
1425
|
+
margin?: string;
|
|
1426
|
+
marginBlock?: string;
|
|
1427
|
+
marginBlockEnd?: string;
|
|
1428
|
+
marginBlockStart?: string;
|
|
1429
|
+
marginBottom?: string;
|
|
1430
|
+
marginInline?: string;
|
|
1431
|
+
marginInlineEnd?: string;
|
|
1432
|
+
marginInlineStart?: string;
|
|
1433
|
+
marginLeft?: string;
|
|
1434
|
+
marginRight?: string;
|
|
1435
|
+
marginTop?: string;
|
|
1436
|
+
marker?: string;
|
|
1437
|
+
markerEnd?: string;
|
|
1438
|
+
markerMid?: string;
|
|
1439
|
+
markerStart?: string;
|
|
1440
|
+
mask?: string;
|
|
1441
|
+
maskClip?: string;
|
|
1442
|
+
maskComposite?: string;
|
|
1443
|
+
maskImage?: string;
|
|
1444
|
+
maskMode?: string;
|
|
1445
|
+
maskOrigin?: string;
|
|
1446
|
+
maskPosition?: string;
|
|
1447
|
+
maskRepeat?: string;
|
|
1448
|
+
maskSize?: string;
|
|
1449
|
+
maskType?: string;
|
|
1450
|
+
mathDepth?: string;
|
|
1451
|
+
mathStyle?: string;
|
|
1452
|
+
maxBlockSize?: string;
|
|
1453
|
+
maxHeight?: string;
|
|
1454
|
+
maxInlineSize?: string;
|
|
1455
|
+
maxWidth?: string;
|
|
1456
|
+
minBlockSize?: string;
|
|
1457
|
+
minHeight?: string;
|
|
1458
|
+
minInlineSize?: string;
|
|
1459
|
+
minWidth?: string;
|
|
1460
|
+
mixBlendMode?: string;
|
|
1461
|
+
objectFit?: string;
|
|
1462
|
+
objectPosition?: string;
|
|
1463
|
+
offset?: string;
|
|
1464
|
+
offsetAnchor?: string;
|
|
1465
|
+
offsetDistance?: string;
|
|
1466
|
+
offsetPath?: string;
|
|
1467
|
+
offsetPosition?: string;
|
|
1468
|
+
offsetRotate?: string;
|
|
1469
|
+
opacity?: string;
|
|
1470
|
+
order?: string;
|
|
1471
|
+
orphans?: string;
|
|
1472
|
+
outline?: string;
|
|
1473
|
+
outlineColor?: string;
|
|
1474
|
+
outlineOffset?: string;
|
|
1475
|
+
outlineStyle?: string;
|
|
1476
|
+
outlineWidth?: string;
|
|
1477
|
+
overflow?: string;
|
|
1478
|
+
overflowAnchor?: string;
|
|
1479
|
+
overflowClipMargin?: string;
|
|
1480
|
+
overflowWrap?: string;
|
|
1481
|
+
overflowX?: string;
|
|
1482
|
+
overflowY?: string;
|
|
1483
|
+
overscrollBehavior?: string;
|
|
1484
|
+
overscrollBehaviorBlock?: string;
|
|
1485
|
+
overscrollBehaviorInline?: string;
|
|
1486
|
+
overscrollBehaviorX?: string;
|
|
1487
|
+
overscrollBehaviorY?: string;
|
|
1488
|
+
padding?: string;
|
|
1489
|
+
paddingBlock?: string;
|
|
1490
|
+
paddingBlockEnd?: string;
|
|
1491
|
+
paddingBlockStart?: string;
|
|
1492
|
+
paddingBottom?: string;
|
|
1493
|
+
paddingInline?: string;
|
|
1494
|
+
paddingInlineEnd?: string;
|
|
1495
|
+
paddingInlineStart?: string;
|
|
1496
|
+
paddingLeft?: string;
|
|
1497
|
+
paddingRight?: string;
|
|
1498
|
+
paddingTop?: string;
|
|
1499
|
+
page?: string;
|
|
1500
|
+
pageBreakAfter?: string;
|
|
1501
|
+
pageBreakBefore?: string;
|
|
1502
|
+
pageBreakInside?: string;
|
|
1503
|
+
paintOrder?: string;
|
|
1504
|
+
parentRule?: CSSRule | null;
|
|
1505
|
+
perspective?: string;
|
|
1506
|
+
perspectiveOrigin?: string;
|
|
1507
|
+
placeContent?: string;
|
|
1508
|
+
placeItems?: string;
|
|
1509
|
+
placeSelf?: string;
|
|
1510
|
+
pointerEvents?: string;
|
|
1511
|
+
position?: string;
|
|
1512
|
+
printColorAdjust?: string;
|
|
1513
|
+
quotes?: string;
|
|
1514
|
+
r?: string;
|
|
1515
|
+
resize?: string;
|
|
1516
|
+
right?: string;
|
|
1517
|
+
rotate?: string;
|
|
1518
|
+
rowGap?: string;
|
|
1519
|
+
rubyAlign?: string;
|
|
1520
|
+
rubyPosition?: string;
|
|
1521
|
+
rx?: string;
|
|
1522
|
+
ry?: string;
|
|
1523
|
+
scale?: string;
|
|
1524
|
+
scrollBehavior?: string;
|
|
1525
|
+
scrollMargin?: string;
|
|
1526
|
+
scrollMarginBlock?: string;
|
|
1527
|
+
scrollMarginBlockEnd?: string;
|
|
1528
|
+
scrollMarginBlockStart?: string;
|
|
1529
|
+
scrollMarginBottom?: string;
|
|
1530
|
+
scrollMarginInline?: string;
|
|
1531
|
+
scrollMarginInlineEnd?: string;
|
|
1532
|
+
scrollMarginInlineStart?: string;
|
|
1533
|
+
scrollMarginLeft?: string;
|
|
1534
|
+
scrollMarginRight?: string;
|
|
1535
|
+
scrollMarginTop?: string;
|
|
1536
|
+
scrollPadding?: string;
|
|
1537
|
+
scrollPaddingBlock?: string;
|
|
1538
|
+
scrollPaddingBlockEnd?: string;
|
|
1539
|
+
scrollPaddingBlockStart?: string;
|
|
1540
|
+
scrollPaddingBottom?: string;
|
|
1541
|
+
scrollPaddingInline?: string;
|
|
1542
|
+
scrollPaddingInlineEnd?: string;
|
|
1543
|
+
scrollPaddingInlineStart?: string;
|
|
1544
|
+
scrollPaddingLeft?: string;
|
|
1545
|
+
scrollPaddingRight?: string;
|
|
1546
|
+
scrollPaddingTop?: string;
|
|
1547
|
+
scrollSnapAlign?: string;
|
|
1548
|
+
scrollSnapStop?: string;
|
|
1549
|
+
scrollSnapType?: string;
|
|
1550
|
+
scrollbarColor?: string;
|
|
1551
|
+
scrollbarGutter?: string;
|
|
1552
|
+
scrollbarWidth?: string;
|
|
1553
|
+
shapeImageThreshold?: string;
|
|
1554
|
+
shapeMargin?: string;
|
|
1555
|
+
shapeOutside?: string;
|
|
1556
|
+
shapeRendering?: string;
|
|
1557
|
+
stopColor?: string;
|
|
1558
|
+
stopOpacity?: string;
|
|
1559
|
+
stroke?: string;
|
|
1560
|
+
strokeDasharray?: string;
|
|
1561
|
+
strokeDashoffset?: string;
|
|
1562
|
+
strokeLinecap?: string;
|
|
1563
|
+
strokeLinejoin?: string;
|
|
1564
|
+
strokeMiterlimit?: string;
|
|
1565
|
+
strokeOpacity?: string;
|
|
1566
|
+
strokeWidth?: string;
|
|
1567
|
+
tabSize?: string;
|
|
1568
|
+
tableLayout?: string;
|
|
1569
|
+
textAlign?: string;
|
|
1570
|
+
textAlignLast?: string;
|
|
1571
|
+
textAnchor?: string;
|
|
1572
|
+
textBox?: string;
|
|
1573
|
+
textBoxEdge?: string;
|
|
1574
|
+
textBoxTrim?: string;
|
|
1575
|
+
textCombineUpright?: string;
|
|
1576
|
+
textDecoration?: string;
|
|
1577
|
+
textDecorationColor?: string;
|
|
1578
|
+
textDecorationLine?: string;
|
|
1579
|
+
textDecorationSkipInk?: string;
|
|
1580
|
+
textDecorationStyle?: string;
|
|
1581
|
+
textDecorationThickness?: string;
|
|
1582
|
+
textEmphasis?: string;
|
|
1583
|
+
textEmphasisColor?: string;
|
|
1584
|
+
textEmphasisPosition?: string;
|
|
1585
|
+
textEmphasisStyle?: string;
|
|
1586
|
+
textIndent?: string;
|
|
1587
|
+
textOrientation?: string;
|
|
1588
|
+
textOverflow?: string;
|
|
1589
|
+
textRendering?: string;
|
|
1590
|
+
textShadow?: string;
|
|
1591
|
+
textTransform?: string;
|
|
1592
|
+
textUnderlineOffset?: string;
|
|
1593
|
+
textUnderlinePosition?: string;
|
|
1594
|
+
textWrap?: string;
|
|
1595
|
+
textWrapMode?: string;
|
|
1596
|
+
textWrapStyle?: string;
|
|
1597
|
+
top?: string;
|
|
1598
|
+
touchAction?: string;
|
|
1599
|
+
transform?: string;
|
|
1600
|
+
transformBox?: string;
|
|
1601
|
+
transformOrigin?: string;
|
|
1602
|
+
transformStyle?: string;
|
|
1603
|
+
transition?: string;
|
|
1604
|
+
transitionBehavior?: string;
|
|
1605
|
+
transitionDelay?: string;
|
|
1606
|
+
transitionDuration?: string;
|
|
1607
|
+
transitionProperty?: string;
|
|
1608
|
+
transitionTimingFunction?: string;
|
|
1609
|
+
translate?: string;
|
|
1610
|
+
unicodeBidi?: string;
|
|
1611
|
+
userSelect?: string;
|
|
1612
|
+
vectorEffect?: string;
|
|
1613
|
+
verticalAlign?: string;
|
|
1614
|
+
viewTransitionClass?: string;
|
|
1615
|
+
viewTransitionName?: string;
|
|
1616
|
+
visibility?: string;
|
|
1617
|
+
webkitAlignContent?: string;
|
|
1618
|
+
webkitAlignItems?: string;
|
|
1619
|
+
webkitAlignSelf?: string;
|
|
1620
|
+
webkitAnimation?: string;
|
|
1621
|
+
webkitAnimationDelay?: string;
|
|
1622
|
+
webkitAnimationDirection?: string;
|
|
1623
|
+
webkitAnimationDuration?: string;
|
|
1624
|
+
webkitAnimationFillMode?: string;
|
|
1625
|
+
webkitAnimationIterationCount?: string;
|
|
1626
|
+
webkitAnimationName?: string;
|
|
1627
|
+
webkitAnimationPlayState?: string;
|
|
1628
|
+
webkitAnimationTimingFunction?: string;
|
|
1629
|
+
webkitAppearance?: string;
|
|
1630
|
+
webkitBackfaceVisibility?: string;
|
|
1631
|
+
webkitBackgroundClip?: string;
|
|
1632
|
+
webkitBackgroundOrigin?: string;
|
|
1633
|
+
webkitBackgroundSize?: string;
|
|
1634
|
+
webkitBorderBottomLeftRadius?: string;
|
|
1635
|
+
webkitBorderBottomRightRadius?: string;
|
|
1636
|
+
webkitBorderRadius?: string;
|
|
1637
|
+
webkitBorderTopLeftRadius?: string;
|
|
1638
|
+
webkitBorderTopRightRadius?: string;
|
|
1639
|
+
webkitBoxAlign?: string;
|
|
1640
|
+
webkitBoxFlex?: string;
|
|
1641
|
+
webkitBoxOrdinalGroup?: string;
|
|
1642
|
+
webkitBoxOrient?: string;
|
|
1643
|
+
webkitBoxPack?: string;
|
|
1644
|
+
webkitBoxShadow?: string;
|
|
1645
|
+
webkitBoxSizing?: string;
|
|
1646
|
+
webkitFilter?: string;
|
|
1647
|
+
webkitFlex?: string;
|
|
1648
|
+
webkitFlexBasis?: string;
|
|
1649
|
+
webkitFlexDirection?: string;
|
|
1650
|
+
webkitFlexFlow?: string;
|
|
1651
|
+
webkitFlexGrow?: string;
|
|
1652
|
+
webkitFlexShrink?: string;
|
|
1653
|
+
webkitFlexWrap?: string;
|
|
1654
|
+
webkitJustifyContent?: string;
|
|
1655
|
+
webkitLineClamp?: string;
|
|
1656
|
+
webkitMask?: string;
|
|
1657
|
+
webkitMaskBoxImage?: string;
|
|
1658
|
+
webkitMaskBoxImageOutset?: string;
|
|
1659
|
+
webkitMaskBoxImageRepeat?: string;
|
|
1660
|
+
webkitMaskBoxImageSlice?: string;
|
|
1661
|
+
webkitMaskBoxImageSource?: string;
|
|
1662
|
+
webkitMaskBoxImageWidth?: string;
|
|
1663
|
+
webkitMaskClip?: string;
|
|
1664
|
+
webkitMaskComposite?: string;
|
|
1665
|
+
webkitMaskImage?: string;
|
|
1666
|
+
webkitMaskOrigin?: string;
|
|
1667
|
+
webkitMaskPosition?: string;
|
|
1668
|
+
webkitMaskRepeat?: string;
|
|
1669
|
+
webkitMaskSize?: string;
|
|
1670
|
+
webkitOrder?: string;
|
|
1671
|
+
webkitPerspective?: string;
|
|
1672
|
+
webkitPerspectiveOrigin?: string;
|
|
1673
|
+
webkitTextFillColor?: string;
|
|
1674
|
+
webkitTextSizeAdjust?: string;
|
|
1675
|
+
webkitTextStroke?: string;
|
|
1676
|
+
webkitTextStrokeColor?: string;
|
|
1677
|
+
webkitTextStrokeWidth?: string;
|
|
1678
|
+
webkitTransform?: string;
|
|
1679
|
+
webkitTransformOrigin?: string;
|
|
1680
|
+
webkitTransformStyle?: string;
|
|
1681
|
+
webkitTransition?: string;
|
|
1682
|
+
webkitTransitionDelay?: string;
|
|
1683
|
+
webkitTransitionDuration?: string;
|
|
1684
|
+
webkitTransitionProperty?: string;
|
|
1685
|
+
webkitTransitionTimingFunction?: string;
|
|
1686
|
+
webkitUserSelect?: string;
|
|
1687
|
+
whiteSpace?: string;
|
|
1688
|
+
whiteSpaceCollapse?: string;
|
|
1689
|
+
widows?: string;
|
|
1690
|
+
width?: string;
|
|
1691
|
+
willChange?: string;
|
|
1692
|
+
wordBreak?: string;
|
|
1693
|
+
wordSpacing?: string;
|
|
1694
|
+
wordWrap?: string;
|
|
1695
|
+
writingMode?: string;
|
|
1696
|
+
x?: string;
|
|
1697
|
+
y?: string;
|
|
1698
|
+
zIndex?: string;
|
|
1699
|
+
zoom?: string;
|
|
1700
|
+
getPropertyPriority?: (property: string) => string;
|
|
1701
|
+
getPropertyValue?: (property: string) => string;
|
|
1702
|
+
item?: (index: number) => string;
|
|
1703
|
+
removeProperty?: (property: string) => string;
|
|
1704
|
+
setProperty?: (property: string, value: string | null, priority?: string) => void;
|
|
1705
|
+
[Symbol.iterator]?: () => ArrayIterator<string>;
|
|
1706
|
+
};
|
|
1707
|
+
};
|
|
1708
|
+
methods: {
|
|
1709
|
+
handleClick(): void;
|
|
1710
|
+
};
|
|
1711
|
+
};
|
|
1712
|
+
/**
|
|
1713
|
+
* Registers custom Web Component <isa-auth-button>
|
|
1714
|
+
*/
|
|
1715
|
+
declare function registerWebComponent(): void;
|
|
1716
|
+
|
|
1717
|
+
type index_ButtonRenderInfo = ButtonRenderInfo;
|
|
1718
|
+
declare const index_registerWebComponent: typeof registerWebComponent;
|
|
1719
|
+
declare const index_renderByJs: typeof renderByJs;
|
|
1720
|
+
declare const index_renderByReact: typeof renderByReact;
|
|
1721
|
+
declare const index_renderByVue: typeof renderByVue;
|
|
1722
|
+
declare namespace index {
|
|
1723
|
+
export { type index_ButtonRenderInfo as ButtonRenderInfo, index_registerWebComponent as registerWebComponent, index_renderByJs as renderByJs, index_renderByReact as renderByReact, index_renderByVue as renderByVue };
|
|
1724
|
+
}
|
|
1725
|
+
|
|
1726
|
+
interface IsaAuthConfig {
|
|
1727
|
+
provider?: CoreProviderType;
|
|
1728
|
+
secret?: string;
|
|
1729
|
+
clientId?: string;
|
|
1730
|
+
callbackUrl?: string;
|
|
1731
|
+
scope?: string;
|
|
1732
|
+
storage?: StorageType;
|
|
1733
|
+
storagePrefix?: string;
|
|
1734
|
+
extraOptions?: Record<string, any>;
|
|
1735
|
+
}
|
|
1736
|
+
/**
|
|
1737
|
+
* Main unified entry point for ISA-AUTH
|
|
1738
|
+
*/
|
|
1739
|
+
declare class IsaAuth {
|
|
1740
|
+
core: AuthCore;
|
|
1741
|
+
providerInstance: any;
|
|
1742
|
+
authProvider: AuthProvider;
|
|
1743
|
+
providerType: CoreProviderType;
|
|
1744
|
+
constructor(config?: IsaAuthConfig);
|
|
1745
|
+
isAuthenticated(): boolean;
|
|
1746
|
+
getAccessToken(): string | null;
|
|
1747
|
+
getUserInfo(): Promise<any>;
|
|
1748
|
+
getContext(): AuthContext;
|
|
1749
|
+
/**
|
|
1750
|
+
* Returns current provider category ('social' | 'developer' | 'web3' | 'identity' | null)
|
|
1751
|
+
*/
|
|
1752
|
+
getCategory(): ProviderCategory | null;
|
|
1753
|
+
setAccessToken(token: string): void;
|
|
1754
|
+
getRefreshToken(): string | null;
|
|
1755
|
+
setRefreshToken(token: string): void;
|
|
1756
|
+
updateAuthInfo<T = any>(partial: Partial<T>): T;
|
|
1757
|
+
signIn(): Promise<void>;
|
|
1758
|
+
signOut(): void;
|
|
1759
|
+
refresh(refreshFn: () => Promise<string>): Promise<string>;
|
|
1760
|
+
/**
|
|
1761
|
+
* Starts automatic background token refresh prior to expiration
|
|
1762
|
+
*/
|
|
1763
|
+
startAutoRefresh(refreshFn: () => Promise<string>, options?: any): void;
|
|
1764
|
+
/**
|
|
1765
|
+
* Stops automatic background token refresh
|
|
1766
|
+
*/
|
|
1767
|
+
stopAutoRefresh(): void;
|
|
1768
|
+
getButton(): {
|
|
1769
|
+
className: string;
|
|
1770
|
+
onClick: () => Promise<void>;
|
|
1771
|
+
id: string;
|
|
1772
|
+
type: string;
|
|
1773
|
+
provider: string;
|
|
1774
|
+
icon: string;
|
|
1775
|
+
text: string;
|
|
1776
|
+
style: Partial<CSSStyleDeclaration>;
|
|
1777
|
+
fullWidth: boolean;
|
|
1778
|
+
};
|
|
1779
|
+
renderButton(container?: HTMLElement | null): HTMLButtonElement | null;
|
|
1780
|
+
hasRole(role: string): boolean;
|
|
1781
|
+
hasPermission(permission: string): boolean;
|
|
1782
|
+
/**
|
|
1783
|
+
* Check permission with wildcard matching support
|
|
1784
|
+
* E.g. isaAuth.can('users:read') or isaAuth.can(['users:read', 'users:write'])
|
|
1785
|
+
*/
|
|
1786
|
+
can(permission: string | string[], matchAll?: boolean): boolean;
|
|
1787
|
+
/**
|
|
1788
|
+
* Check role with optional matchAll option
|
|
1789
|
+
*/
|
|
1790
|
+
is(role: string | string[], matchAll?: boolean): boolean;
|
|
1791
|
+
/**
|
|
1792
|
+
* Evaluates guard and returns detailed GuardResult
|
|
1793
|
+
*/
|
|
1794
|
+
evaluateGuard(options: AuthGuardOptions, customContext?: Partial<AuthContext>): Promise<GuardResult>;
|
|
1795
|
+
/**
|
|
1796
|
+
* Instant boolean guard check (backwards compatible)
|
|
1797
|
+
*/
|
|
1798
|
+
createGuard(options: AuthGuardOptions): Promise<boolean>;
|
|
1799
|
+
/**
|
|
1800
|
+
* Creates a reusable router navigation guard
|
|
1801
|
+
*/
|
|
1802
|
+
createNavigationGuard(options: AuthGuardOptions & {
|
|
1803
|
+
redirectToOnUnauthenticated?: string;
|
|
1804
|
+
redirectToOnUnauthorized?: string;
|
|
1805
|
+
onRedirect?: (url: string) => void;
|
|
1806
|
+
}): () => Promise<{
|
|
1807
|
+
allowed: boolean;
|
|
1808
|
+
redirect?: string;
|
|
1809
|
+
}>;
|
|
1810
|
+
onSignIn(listener: LifecycleListener<{
|
|
1811
|
+
user?: any;
|
|
1812
|
+
token?: string;
|
|
1813
|
+
}>): () => void;
|
|
1814
|
+
onSignOut(listener: LifecycleListener<void>): () => void;
|
|
1815
|
+
onTokenExpired(listener: LifecycleListener<void>): () => void;
|
|
1816
|
+
onUnauthorized(listener: LifecycleListener<{
|
|
1817
|
+
reason: string;
|
|
1818
|
+
result?: GuardResult;
|
|
1819
|
+
context?: AuthContext;
|
|
1820
|
+
}>): () => void;
|
|
1821
|
+
onAccessDenied(listener: LifecycleListener<{
|
|
1822
|
+
reason: string;
|
|
1823
|
+
result?: GuardResult;
|
|
1824
|
+
context?: AuthContext;
|
|
1825
|
+
target?: string;
|
|
1826
|
+
}>): () => void;
|
|
1827
|
+
onRoleChanged(listener: Parameters<AuthLifecycleManager['onRoleChanged']>[0]): () => void;
|
|
1828
|
+
onPermissionChanged(listener: Parameters<AuthLifecycleManager['onPermissionChanged']>[0]): () => void;
|
|
1829
|
+
createFetch(options?: Partial<AuthFetchOptions>): (input: RequestInfo | URL, init?: RequestInit) => Promise<Response>;
|
|
1830
|
+
applyAxiosInterceptor(axiosInstance: any, options?: Partial<AuthHttpOptions>): {
|
|
1831
|
+
eject: () => void;
|
|
1832
|
+
};
|
|
1833
|
+
createAxios(axiosModuleOrInstance: any, options?: Partial<AuthHttpOptions>): any;
|
|
1834
|
+
createTokenExchange(tokenEndpoint: string, options?: any): HttpTokenExchangeAdapter;
|
|
1835
|
+
subscribe(callback: (isAuthenticated: boolean) => void): void | (() => void);
|
|
1836
|
+
}
|
|
1837
|
+
|
|
1838
|
+
export { AppleAuthProvider, AuthBaseService, type AuthContext, AuthCore, type AuthFetchOptions, type AuthGuardOptions, type AuthHttpOptions, AuthProvider, type AutoRefreshOptions, CookieSessionStorageAdapter, DiscordAuthProvider, FacebookAuthProvider, GithubAuthProvider, GoogleAuthProvider, type GuardFailureReason, type GuardResult, HttpTokenExchangeAdapter, IsaAuth, type IsaAuthConfig, JwtService, KakaoAuthProvider, LineAuthProvider, LocalStorageAdapter, type MatchMode, MemoryStorageAdapter, MetaAuthProvider, NaverAuthProvider, type PasskeyAssertionResult, PasskeyAuthProvider, type ProviderCategory, type RoleHierarchyMap, SessionStorageAdapter, type StorageConfig, type StorageType, type TokenExchangeAdapter, type TokenExchangeResult, Web3AuthProvider, WorldAuthProvider, type WorldIDProofResult, type WorldVerificationLevel, applyAuthInterceptor, batch, buildAuthorizeUrl, checkPermission, checkRole, clearStoreSession, configureStorage, createAuthAxios, createAuthFetch, createAuthGuard, createNavigationGuard, decodeToken, IsaAuth as default, developerProviders, evaluateGuard, generateCodeChallenge, generateCodeVerifier, getAccessToken, getAuthInfo, getAuthState, getProviderCategory, getProvidersByCategory, getRefreshToken, getStorageAdapter, getTokenFromHeader, getTokenPayload, getTokenTimeRemaining, identityProviders, isExpiredToken, matchPermissionRule, parseOAuthCallback, index as renderers, resolveInheritedRoles, setRefreshToken, socialProviders, subscribeSelector, updateAuthInfo, web3Providers };
|