@spfn/auth 0.2.0-beta.1 → 0.2.0-beta.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +169 -168
- package/dist/{dto-81uR9gzF.d.ts → authenticate-CU6_zQaa.d.ts} +184 -169
- package/dist/config.d.ts +4 -0
- package/dist/config.js +4 -0
- package/dist/config.js.map +1 -1
- package/dist/index.d.ts +146 -119
- package/dist/index.js +24 -1
- package/dist/index.js.map +1 -1
- package/dist/nextjs/api.js +1 -1
- package/dist/nextjs/api.js.map +1 -1
- package/dist/nextjs/server.js +0 -2
- package/dist/nextjs/server.js.map +1 -1
- package/dist/server.d.ts +171 -403
- package/dist/server.js +217 -461
- package/dist/server.js.map +1 -1
- package/migrations/0000_premium_famine.sql +292 -0
- package/migrations/meta/0000_snapshot.json +1 -1
- package/migrations/meta/_journal.json +2 -2
- package/package.json +8 -11
- package/migrations/0000_mysterious_colossus.sql +0 -197
|
@@ -1,8 +1,85 @@
|
|
|
1
|
+
import * as _spfn_core_route from '@spfn/core/route';
|
|
1
2
|
import * as _sinclair_typebox from '@sinclair/typebox';
|
|
2
3
|
import { Static } from '@sinclair/typebox';
|
|
3
|
-
import * as _spfn_core_route from '@spfn/core/route';
|
|
4
4
|
import { User } from '@spfn/auth/server';
|
|
5
5
|
|
|
6
|
+
/**
|
|
7
|
+
* Role information for client/API responses
|
|
8
|
+
*/
|
|
9
|
+
interface Role {
|
|
10
|
+
id: number;
|
|
11
|
+
name: string;
|
|
12
|
+
displayName: string;
|
|
13
|
+
description: string | null;
|
|
14
|
+
isBuiltin: boolean;
|
|
15
|
+
isSystem: boolean;
|
|
16
|
+
isActive: boolean;
|
|
17
|
+
priority: number;
|
|
18
|
+
createdAt: Date;
|
|
19
|
+
updatedAt: Date;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Permission information for client/API responses
|
|
23
|
+
*/
|
|
24
|
+
interface Permission {
|
|
25
|
+
id: number;
|
|
26
|
+
name: string;
|
|
27
|
+
displayName: string;
|
|
28
|
+
description: string | null;
|
|
29
|
+
category: string | null;
|
|
30
|
+
isBuiltin: boolean;
|
|
31
|
+
isSystem: boolean;
|
|
32
|
+
isActive: boolean;
|
|
33
|
+
metadata: Record<string, any> | null;
|
|
34
|
+
createdAt: Date;
|
|
35
|
+
updatedAt: Date;
|
|
36
|
+
}
|
|
37
|
+
interface AuthSession {
|
|
38
|
+
userId: number;
|
|
39
|
+
email: string | null;
|
|
40
|
+
emailVerified: boolean;
|
|
41
|
+
phoneVerified: boolean;
|
|
42
|
+
role: Role;
|
|
43
|
+
permissions: Permission[];
|
|
44
|
+
}
|
|
45
|
+
interface ProfileInfo {
|
|
46
|
+
profileId: number;
|
|
47
|
+
displayName: string;
|
|
48
|
+
firstName: string | null;
|
|
49
|
+
lastName: string | null;
|
|
50
|
+
avatarUrl: string | null;
|
|
51
|
+
bio: string | null;
|
|
52
|
+
locale: string;
|
|
53
|
+
timezone: string;
|
|
54
|
+
website: string | null;
|
|
55
|
+
location: string | null;
|
|
56
|
+
company: string | null;
|
|
57
|
+
jobTitle: string | null;
|
|
58
|
+
metadata: Record<string, any> | null;
|
|
59
|
+
createdAt: Date;
|
|
60
|
+
updatedAt: Date;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* User Profile Response
|
|
64
|
+
*
|
|
65
|
+
* Complete user data including:
|
|
66
|
+
* - User fields at top level (userId, email, etc.)
|
|
67
|
+
* - Profile data as nested field (optional)
|
|
68
|
+
*
|
|
69
|
+
* Excludes:
|
|
70
|
+
* - Role and permissions (use auth session API)
|
|
71
|
+
*/
|
|
72
|
+
interface UserProfile {
|
|
73
|
+
userId: number;
|
|
74
|
+
email: string | null;
|
|
75
|
+
emailVerified: boolean;
|
|
76
|
+
phoneVerified: boolean;
|
|
77
|
+
lastLoginAt: Date | null;
|
|
78
|
+
createdAt: Date;
|
|
79
|
+
updatedAt: Date;
|
|
80
|
+
profile: ProfileInfo | null;
|
|
81
|
+
}
|
|
82
|
+
|
|
6
83
|
/**
|
|
7
84
|
* @spfn/auth - Shared Types
|
|
8
85
|
*
|
|
@@ -314,7 +391,94 @@ interface AuthInitOptions {
|
|
|
314
391
|
* - Users: /_auth/users/*
|
|
315
392
|
*/
|
|
316
393
|
declare const mainAuthRouter: _spfn_core_route.Router<{
|
|
317
|
-
|
|
394
|
+
checkAccountExists: _spfn_core_route.RouteDef<{
|
|
395
|
+
body: _sinclair_typebox.TUnion<[_sinclair_typebox.TObject<{
|
|
396
|
+
email: _sinclair_typebox.TString;
|
|
397
|
+
}>, _sinclair_typebox.TObject<{
|
|
398
|
+
phone: _sinclair_typebox.TString;
|
|
399
|
+
}>]>;
|
|
400
|
+
}, {}, CheckAccountExistsResult>;
|
|
401
|
+
sendVerificationCode: _spfn_core_route.RouteDef<{
|
|
402
|
+
body: _sinclair_typebox.TObject<{
|
|
403
|
+
target: _sinclair_typebox.TString;
|
|
404
|
+
targetType: _sinclair_typebox.TUnion<[_sinclair_typebox.TLiteral<"email">, _sinclair_typebox.TLiteral<"phone">]>;
|
|
405
|
+
purpose: _sinclair_typebox.TUnion<[_sinclair_typebox.TLiteral<"registration">, _sinclair_typebox.TLiteral<"login">, _sinclair_typebox.TLiteral<"password_reset">, _sinclair_typebox.TLiteral<"email_change">, _sinclair_typebox.TLiteral<"phone_change">]>;
|
|
406
|
+
}>;
|
|
407
|
+
}, {}, SendVerificationCodeResult>;
|
|
408
|
+
verifyCode: _spfn_core_route.RouteDef<{
|
|
409
|
+
body: _sinclair_typebox.TObject<{
|
|
410
|
+
target: _sinclair_typebox.TString;
|
|
411
|
+
targetType: _sinclair_typebox.TUnion<[_sinclair_typebox.TLiteral<"email">, _sinclair_typebox.TLiteral<"phone">]>;
|
|
412
|
+
code: _sinclair_typebox.TString;
|
|
413
|
+
purpose: _sinclair_typebox.TUnion<[_sinclair_typebox.TLiteral<"registration">, _sinclair_typebox.TLiteral<"login">, _sinclair_typebox.TLiteral<"password_reset">, _sinclair_typebox.TLiteral<"email_change">, _sinclair_typebox.TLiteral<"phone_change">]>;
|
|
414
|
+
}>;
|
|
415
|
+
}, {}, {
|
|
416
|
+
valid: boolean;
|
|
417
|
+
verificationToken: string;
|
|
418
|
+
}>;
|
|
419
|
+
register: _spfn_core_route.RouteDef<{
|
|
420
|
+
body: _sinclair_typebox.TObject<{
|
|
421
|
+
email: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
422
|
+
phone: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
423
|
+
verificationToken: _sinclair_typebox.TString;
|
|
424
|
+
password: _sinclair_typebox.TString;
|
|
425
|
+
}>;
|
|
426
|
+
}, {
|
|
427
|
+
body: _sinclair_typebox.TObject<{
|
|
428
|
+
publicKey: _sinclair_typebox.TString;
|
|
429
|
+
keyId: _sinclair_typebox.TString;
|
|
430
|
+
fingerprint: _sinclair_typebox.TString;
|
|
431
|
+
algorithm: _sinclair_typebox.TUnion<_sinclair_typebox.TLiteral<"ES256" | "RS256">[]>;
|
|
432
|
+
}>;
|
|
433
|
+
}, RegisterResult>;
|
|
434
|
+
login: _spfn_core_route.RouteDef<{
|
|
435
|
+
body: _sinclair_typebox.TObject<{
|
|
436
|
+
email: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
437
|
+
phone: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
438
|
+
password: _sinclair_typebox.TString;
|
|
439
|
+
}>;
|
|
440
|
+
}, {
|
|
441
|
+
body: _sinclair_typebox.TObject<{
|
|
442
|
+
publicKey: _sinclair_typebox.TString;
|
|
443
|
+
keyId: _sinclair_typebox.TString;
|
|
444
|
+
fingerprint: _sinclair_typebox.TString;
|
|
445
|
+
algorithm: _sinclair_typebox.TUnion<_sinclair_typebox.TLiteral<"ES256" | "RS256">[]>;
|
|
446
|
+
oldKeyId: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
447
|
+
}>;
|
|
448
|
+
}, LoginResult>;
|
|
449
|
+
logout: _spfn_core_route.RouteDef<{}, {}, void>;
|
|
450
|
+
rotateKey: _spfn_core_route.RouteDef<{}, {
|
|
451
|
+
body: _sinclair_typebox.TObject<{
|
|
452
|
+
publicKey: _sinclair_typebox.TString;
|
|
453
|
+
keyId: _sinclair_typebox.TString;
|
|
454
|
+
fingerprint: _sinclair_typebox.TString;
|
|
455
|
+
algorithm: _sinclair_typebox.TUnion<_sinclair_typebox.TLiteral<"ES256" | "RS256">[]>;
|
|
456
|
+
}>;
|
|
457
|
+
}, RotateKeyResult>;
|
|
458
|
+
changePassword: _spfn_core_route.RouteDef<{
|
|
459
|
+
body: _sinclair_typebox.TObject<{
|
|
460
|
+
currentPassword: _sinclair_typebox.TString;
|
|
461
|
+
newPassword: _sinclair_typebox.TString;
|
|
462
|
+
}>;
|
|
463
|
+
}, {}, void>;
|
|
464
|
+
getAuthSession: _spfn_core_route.RouteDef<{}, {}, {
|
|
465
|
+
role: {
|
|
466
|
+
id: number;
|
|
467
|
+
name: string;
|
|
468
|
+
displayName: string;
|
|
469
|
+
priority: number;
|
|
470
|
+
};
|
|
471
|
+
permissions: {
|
|
472
|
+
id: number;
|
|
473
|
+
name: string;
|
|
474
|
+
displayName: string;
|
|
475
|
+
category: "auth" | "custom" | "user" | "rbac" | "system" | undefined;
|
|
476
|
+
}[];
|
|
477
|
+
userId: number;
|
|
478
|
+
email: string | null;
|
|
479
|
+
emailVerified: boolean;
|
|
480
|
+
phoneVerified: boolean;
|
|
481
|
+
}>;
|
|
318
482
|
getInvitation: _spfn_core_route.RouteDef<{
|
|
319
483
|
params: _sinclair_typebox.TObject<{
|
|
320
484
|
token: _sinclair_typebox.TString;
|
|
@@ -414,99 +578,26 @@ declare const mainAuthRouter: _spfn_core_route.Router<{
|
|
|
414
578
|
body: _sinclair_typebox.TObject<{
|
|
415
579
|
id: _sinclair_typebox.TNumber;
|
|
416
580
|
}>;
|
|
417
|
-
}, {},
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
email: _sinclair_typebox.TString;
|
|
421
|
-
}>, _sinclair_typebox.TObject<{
|
|
422
|
-
phone: _sinclair_typebox.TString;
|
|
423
|
-
}>]>;
|
|
424
|
-
}, {}, CheckAccountExistsResult>;
|
|
425
|
-
sendVerificationCode: _spfn_core_route.RouteDef<{
|
|
426
|
-
body: _sinclair_typebox.TObject<{
|
|
427
|
-
target: _sinclair_typebox.TString;
|
|
428
|
-
targetType: _sinclair_typebox.TUnion<[_sinclair_typebox.TLiteral<"email">, _sinclair_typebox.TLiteral<"phone">]>;
|
|
429
|
-
purpose: _sinclair_typebox.TUnion<[_sinclair_typebox.TLiteral<"registration">, _sinclair_typebox.TLiteral<"login">, _sinclair_typebox.TLiteral<"password_reset">, _sinclair_typebox.TLiteral<"email_change">, _sinclair_typebox.TLiteral<"phone_change">]>;
|
|
430
|
-
}>;
|
|
431
|
-
}, {}, SendVerificationCodeResult>;
|
|
432
|
-
verifyCode: _spfn_core_route.RouteDef<{
|
|
433
|
-
body: _sinclair_typebox.TObject<{
|
|
434
|
-
target: _sinclair_typebox.TString;
|
|
435
|
-
targetType: _sinclair_typebox.TUnion<[_sinclair_typebox.TLiteral<"email">, _sinclair_typebox.TLiteral<"phone">]>;
|
|
436
|
-
code: _sinclair_typebox.TString;
|
|
437
|
-
purpose: _sinclair_typebox.TUnion<[_sinclair_typebox.TLiteral<"registration">, _sinclair_typebox.TLiteral<"login">, _sinclair_typebox.TLiteral<"password_reset">, _sinclair_typebox.TLiteral<"email_change">, _sinclair_typebox.TLiteral<"phone_change">]>;
|
|
438
|
-
}>;
|
|
439
|
-
}, {}, {
|
|
440
|
-
valid: boolean;
|
|
441
|
-
verificationToken: string;
|
|
442
|
-
}>;
|
|
443
|
-
register: _spfn_core_route.RouteDef<{
|
|
444
|
-
body: _sinclair_typebox.TObject<{
|
|
445
|
-
email: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
446
|
-
phone: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
447
|
-
verificationToken: _sinclair_typebox.TString;
|
|
448
|
-
password: _sinclair_typebox.TString;
|
|
449
|
-
}>;
|
|
450
|
-
}, {
|
|
451
|
-
body: _sinclair_typebox.TObject<{
|
|
452
|
-
publicKey: _sinclair_typebox.TString;
|
|
453
|
-
keyId: _sinclair_typebox.TString;
|
|
454
|
-
fingerprint: _sinclair_typebox.TString;
|
|
455
|
-
algorithm: _sinclair_typebox.TUnion<_sinclair_typebox.TLiteral<"ES256" | "RS256">[]>;
|
|
456
|
-
}>;
|
|
457
|
-
}, RegisterResult>;
|
|
458
|
-
login: _spfn_core_route.RouteDef<{
|
|
459
|
-
body: _sinclair_typebox.TObject<{
|
|
460
|
-
email: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
461
|
-
phone: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
462
|
-
password: _sinclair_typebox.TString;
|
|
463
|
-
}>;
|
|
464
|
-
}, {
|
|
465
|
-
body: _sinclair_typebox.TObject<{
|
|
466
|
-
publicKey: _sinclair_typebox.TString;
|
|
467
|
-
keyId: _sinclair_typebox.TString;
|
|
468
|
-
fingerprint: _sinclair_typebox.TString;
|
|
469
|
-
algorithm: _sinclair_typebox.TUnion<_sinclair_typebox.TLiteral<"ES256" | "RS256">[]>;
|
|
470
|
-
oldKeyId: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
471
|
-
}>;
|
|
472
|
-
}, LoginResult>;
|
|
473
|
-
logout: _spfn_core_route.RouteDef<{
|
|
474
|
-
body: _sinclair_typebox.TObject<{}>;
|
|
475
|
-
}, {}, Response>;
|
|
476
|
-
rotateKey: _spfn_core_route.RouteDef<{
|
|
477
|
-
body: _sinclair_typebox.TObject<{}>;
|
|
478
|
-
}, {
|
|
479
|
-
body: _sinclair_typebox.TObject<{
|
|
480
|
-
publicKey: _sinclair_typebox.TString;
|
|
481
|
-
keyId: _sinclair_typebox.TString;
|
|
482
|
-
fingerprint: _sinclair_typebox.TString;
|
|
483
|
-
algorithm: _sinclair_typebox.TUnion<_sinclair_typebox.TLiteral<"ES256" | "RS256">[]>;
|
|
484
|
-
}>;
|
|
485
|
-
}, RotateKeyResult>;
|
|
486
|
-
changePassword: _spfn_core_route.RouteDef<{
|
|
581
|
+
}, {}, void>;
|
|
582
|
+
getUserProfile: _spfn_core_route.RouteDef<{}, {}, UserProfile>;
|
|
583
|
+
updateUserProfile: _spfn_core_route.RouteDef<{
|
|
487
584
|
body: _sinclair_typebox.TObject<{
|
|
488
|
-
|
|
489
|
-
|
|
585
|
+
displayName: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
586
|
+
firstName: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
587
|
+
lastName: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
588
|
+
avatarUrl: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
589
|
+
bio: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
590
|
+
locale: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
591
|
+
timezone: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
592
|
+
dateOfBirth: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
593
|
+
gender: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
594
|
+
website: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
595
|
+
location: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
596
|
+
company: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
597
|
+
jobTitle: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
598
|
+
metadata: _sinclair_typebox.TOptional<_sinclair_typebox.TRecord<_sinclair_typebox.TString, _sinclair_typebox.TAny>>;
|
|
490
599
|
}>;
|
|
491
|
-
}, {},
|
|
492
|
-
getAuthSession: _spfn_core_route.RouteDef<{}, {}, {
|
|
493
|
-
role: {
|
|
494
|
-
id: number;
|
|
495
|
-
name: string;
|
|
496
|
-
displayName: string;
|
|
497
|
-
priority: number;
|
|
498
|
-
};
|
|
499
|
-
permissions: {
|
|
500
|
-
id: number;
|
|
501
|
-
name: string;
|
|
502
|
-
displayName: string;
|
|
503
|
-
category: "custom" | "user" | "auth" | "rbac" | "system" | undefined;
|
|
504
|
-
}[];
|
|
505
|
-
userId: number;
|
|
506
|
-
email: string | null;
|
|
507
|
-
emailVerified: boolean;
|
|
508
|
-
phoneVerified: boolean;
|
|
509
|
-
}>;
|
|
600
|
+
}, {}, ProfileInfo>;
|
|
510
601
|
}>;
|
|
511
602
|
|
|
512
603
|
interface AuthContext {
|
|
@@ -551,80 +642,4 @@ declare module 'hono' {
|
|
|
551
642
|
*/
|
|
552
643
|
declare const authenticate: _spfn_core_route.NamedMiddleware<"auth">;
|
|
553
644
|
|
|
554
|
-
/**
|
|
555
|
-
* Role information for client/API responses
|
|
556
|
-
*/
|
|
557
|
-
interface Role {
|
|
558
|
-
id: number;
|
|
559
|
-
name: string;
|
|
560
|
-
displayName: string;
|
|
561
|
-
description: string | null;
|
|
562
|
-
isBuiltin: boolean;
|
|
563
|
-
isSystem: boolean;
|
|
564
|
-
isActive: boolean;
|
|
565
|
-
priority: number;
|
|
566
|
-
createdAt: Date;
|
|
567
|
-
updatedAt: Date;
|
|
568
|
-
}
|
|
569
|
-
/**
|
|
570
|
-
* Permission information for client/API responses
|
|
571
|
-
*/
|
|
572
|
-
interface Permission {
|
|
573
|
-
id: number;
|
|
574
|
-
name: string;
|
|
575
|
-
displayName: string;
|
|
576
|
-
description: string | null;
|
|
577
|
-
category: string | null;
|
|
578
|
-
isBuiltin: boolean;
|
|
579
|
-
isSystem: boolean;
|
|
580
|
-
isActive: boolean;
|
|
581
|
-
metadata: Record<string, any> | null;
|
|
582
|
-
createdAt: Date;
|
|
583
|
-
updatedAt: Date;
|
|
584
|
-
}
|
|
585
|
-
interface AuthSession {
|
|
586
|
-
userId: number;
|
|
587
|
-
email: string | null;
|
|
588
|
-
emailVerified: boolean;
|
|
589
|
-
phoneVerified: boolean;
|
|
590
|
-
role: Role;
|
|
591
|
-
permissions: Permission[];
|
|
592
|
-
}
|
|
593
|
-
interface ProfileInfo {
|
|
594
|
-
profileId: number;
|
|
595
|
-
displayName: string;
|
|
596
|
-
firstName: string | null;
|
|
597
|
-
lastName: string | null;
|
|
598
|
-
avatarUrl: string | null;
|
|
599
|
-
bio: string | null;
|
|
600
|
-
locale: string;
|
|
601
|
-
timezone: string;
|
|
602
|
-
website: string | null;
|
|
603
|
-
location: string | null;
|
|
604
|
-
company: string | null;
|
|
605
|
-
jobTitle: string | null;
|
|
606
|
-
createdAt: Date;
|
|
607
|
-
updatedAt: Date;
|
|
608
|
-
}
|
|
609
|
-
/**
|
|
610
|
-
* User Profile Response
|
|
611
|
-
*
|
|
612
|
-
* Complete user data including:
|
|
613
|
-
* - User fields at top level (userId, email, etc.)
|
|
614
|
-
* - Profile data as nested field (optional)
|
|
615
|
-
*
|
|
616
|
-
* Excludes:
|
|
617
|
-
* - Role and permissions (use auth session API)
|
|
618
|
-
*/
|
|
619
|
-
interface UserProfile {
|
|
620
|
-
userId: number;
|
|
621
|
-
email: string | null;
|
|
622
|
-
emailVerified: boolean;
|
|
623
|
-
phoneVerified: boolean;
|
|
624
|
-
lastLoginAt: Date | null;
|
|
625
|
-
createdAt: Date;
|
|
626
|
-
updatedAt: Date;
|
|
627
|
-
profile: ProfileInfo | null;
|
|
628
|
-
}
|
|
629
|
-
|
|
630
645
|
export { VerificationPurposeSchema as $, type AuthSession as A, type ChangePasswordParams as B, type CheckAccountExistsResult as C, sendVerificationCodeService as D, verifyCodeService as E, type SendVerificationCodeParams as F, type VerifyCodeParams as G, type VerifyCodeResult as H, INVITATION_STATUSES as I, registerPublicKeyService as J, KEY_ALGORITHM as K, type LoginResult as L, rotateKeyService as M, revokeKeyService as N, type RegisterPublicKeyParams as O, type PermissionConfig as P, type RotateKeyParams as Q, type RoleConfig as R, type SendVerificationCodeResult as S, type RevokeKeyParams as T, type UserProfile as U, type VerificationTargetType as V, authenticate as W, EmailSchema as X, PhoneSchema as Y, PasswordSchema as Z, TargetTypeSchema as _, type RegisterResult as a, type RotateKeyResult as b, type ProfileInfo as c, USER_STATUSES as d, SOCIAL_PROVIDERS as e, type VerificationPurpose as f, VERIFICATION_TARGET_TYPES as g, VERIFICATION_PURPOSES as h, PERMISSION_CATEGORIES as i, type PermissionCategory as j, type AuthInitOptions as k, type KeyAlgorithmType as l, mainAuthRouter as m, type InvitationStatus as n, type UserStatus as o, type SocialProvider as p, type AuthContext as q, checkAccountExistsService as r, registerService as s, loginService as t, logoutService as u, changePasswordService as v, type CheckAccountExistsParams as w, type RegisterParams as x, type LoginParams as y, type LogoutParams as z };
|
package/dist/config.d.ts
CHANGED
|
@@ -33,6 +33,7 @@ declare const authEnvSchema: {
|
|
|
33
33
|
fallbackKeys: string[];
|
|
34
34
|
validator: _spfn_core_env.Parser<string>;
|
|
35
35
|
sensitive: boolean;
|
|
36
|
+
nextjs: boolean;
|
|
36
37
|
examples: string[];
|
|
37
38
|
type: "string";
|
|
38
39
|
} & {
|
|
@@ -42,6 +43,7 @@ declare const authEnvSchema: {
|
|
|
42
43
|
description: string;
|
|
43
44
|
default: string;
|
|
44
45
|
required: boolean;
|
|
46
|
+
nextjs: boolean;
|
|
45
47
|
examples: string[];
|
|
46
48
|
type: "string";
|
|
47
49
|
} & {
|
|
@@ -221,6 +223,7 @@ declare const env: _spfn_core_env.InferEnvType<{
|
|
|
221
223
|
fallbackKeys: string[];
|
|
222
224
|
validator: _spfn_core_env.Parser<string>;
|
|
223
225
|
sensitive: boolean;
|
|
226
|
+
nextjs: boolean;
|
|
224
227
|
examples: string[];
|
|
225
228
|
type: "string";
|
|
226
229
|
} & {
|
|
@@ -230,6 +233,7 @@ declare const env: _spfn_core_env.InferEnvType<{
|
|
|
230
233
|
description: string;
|
|
231
234
|
default: string;
|
|
232
235
|
required: boolean;
|
|
236
|
+
nextjs: boolean;
|
|
233
237
|
examples: string[];
|
|
234
238
|
type: "string";
|
|
235
239
|
} & {
|
package/dist/config.js
CHANGED
|
@@ -24,6 +24,8 @@ var authEnvSchema = defineEnvSchema({
|
|
|
24
24
|
minEntropy: 3.5
|
|
25
25
|
}),
|
|
26
26
|
sensitive: true,
|
|
27
|
+
nextjs: true,
|
|
28
|
+
// Required for Next.js RSC session validation
|
|
27
29
|
examples: [
|
|
28
30
|
"my-super-secret-session-key-at-least-32-chars-long",
|
|
29
31
|
"use-a-cryptographically-secure-random-string-here"
|
|
@@ -35,6 +37,8 @@ var authEnvSchema = defineEnvSchema({
|
|
|
35
37
|
description: "Session TTL (time to live) - supports duration strings like '7d', '12h', '45m'",
|
|
36
38
|
default: "7d",
|
|
37
39
|
required: false,
|
|
40
|
+
nextjs: true,
|
|
41
|
+
// May be needed for session validation in Next.js RSC
|
|
38
42
|
examples: ["7d", "30d", "12h", "45m", "3600"]
|
|
39
43
|
})
|
|
40
44
|
},
|
package/dist/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/config/index.ts","../src/config/schema.ts"],"sourcesContent":["/**\n * Core Package Configuration\n *\n * @example\n * ```typescript\n * import { registry } from '@spfn/core/config';\n *\n * const env = registry.validate();\n * console.log(env.DB_POOL_MAX);\n * ```\n *\n * @module config\n */\n\nimport { createEnvRegistry } from '@spfn/core/env';\nimport { authEnvSchema } from './schema';\n\nexport { authEnvSchema as envSchema } from './schema';\n\n/**\n * Environment registry\n */\nconst registry = createEnvRegistry(authEnvSchema);\nexport const env = registry.validate();","/**\n * Auth Environment Variable Schema\n *\n * Centralized schema definition for all environment variables used in @spfn/auth.\n * This provides type safety, validation, and documentation for Auth configuration.\n *\n * @module config/schema\n */\n\nimport {\n defineEnvSchema,\n envString,\n envNumber,\n createSecureSecretParser,\n createPasswordParser,\n} from '@spfn/core/env';\n\n/**\n * Auth environment variable schema\n *\n * Defines all Auth environment variables with:\n * - Type information\n * - Default values\n * - Validation rules\n * - Documentation\n *\n * @example\n * ```typescript\n * import { authEnvSchema } from '@spfn/auth/config';\n *\n * // Access schema information\n * console.log(authEnvSchema.SPFN_AUTH_SESSION_SECRET.description);\n * console.log(authEnvSchema.SPFN_AUTH_JWT_EXPIRES_IN.default);\n * ```\n */\nexport const authEnvSchema = defineEnvSchema({\n // ============================================================================\n // Session Configuration\n // ============================================================================\n SPFN_AUTH_SESSION_SECRET: {\n ...envString({\n description: 'Session encryption secret (minimum 32 characters for AES-256)',\n required: true,\n fallbackKeys: ['SESSION_SECRET'],\n validator: createSecureSecretParser({\n minLength: 32,\n minUniqueChars: 16,\n minEntropy: 3.5,\n }),\n sensitive: true,\n examples: [\n 'my-super-secret-session-key-at-least-32-chars-long',\n 'use-a-cryptographically-secure-random-string-here',\n ],\n }),\n },\n\n SPFN_AUTH_SESSION_TTL: {\n ...envString({\n description: 'Session TTL (time to live) - supports duration strings like \\'7d\\', \\'12h\\', \\'45m\\'',\n default: '7d',\n required: false,\n examples: ['7d', '30d', '12h', '45m', '3600'],\n }),\n },\n\n // ============================================================================\n // JWT Configuration\n // ============================================================================\n SPFN_AUTH_JWT_SECRET: {\n ...envString({\n description: 'JWT signing secret for server-signed tokens (legacy mode)',\n default: 'dev-secret-key-change-in-production',\n required: false,\n examples: [\n 'your-jwt-secret-key-here',\n 'use-different-from-session-secret',\n ],\n }),\n },\n\n SPFN_AUTH_JWT_EXPIRES_IN: {\n ...envString({\n description: 'JWT token expiration time (e.g., \\'7d\\', \\'24h\\', \\'1h\\')',\n default: '7d',\n required: false,\n examples: ['7d', '24h', '1h', '30m'],\n }),\n },\n\n // ============================================================================\n // Security Configuration\n // ============================================================================\n SPFN_AUTH_BCRYPT_SALT_ROUNDS: {\n ...envNumber({\n description: 'Bcrypt salt rounds (cost factor, higher = more secure but slower)',\n default: 10,\n required: false,\n examples: [10, 12, 14],\n }),\n key: 'SPFN_AUTH_BCRYPT_SALT_ROUNDS',\n },\n\n SPFN_AUTH_VERIFICATION_TOKEN_SECRET: {\n ...envString({\n description: 'Verification token secret for email verification, password reset, etc.',\n required: true,\n examples: [\n 'your-verification-token-secret',\n 'can-be-different-from-jwt-secret',\n ],\n }),\n },\n\n // ============================================================================\n // Admin Account Configuration\n // ============================================================================\n SPFN_AUTH_ADMIN_ACCOUNTS: {\n ...envString({\n description: 'JSON array of admin accounts (recommended for multiple admins)',\n required: false,\n examples: [\n '[{\"email\":\"admin@example.com\",\"password\":\"secure-pass\",\"role\":\"admin\"}]',\n '[{\"email\":\"super@example.com\",\"password\":\"pass1\",\"role\":\"superadmin\"},{\"email\":\"admin@example.com\",\"password\":\"pass2\",\"role\":\"admin\"}]',\n ],\n }),\n },\n\n SPFN_AUTH_ADMIN_EMAILS: {\n ...envString({\n description: 'Comma-separated list of admin emails (legacy CSV format)',\n required: false,\n examples: [\n 'admin@example.com,user@example.com',\n 'super@example.com,admin@example.com,user@example.com',\n ],\n }),\n },\n\n SPFN_AUTH_ADMIN_PASSWORDS: {\n ...envString({\n description: 'Comma-separated list of admin passwords (legacy CSV format)',\n required: false,\n examples: [\n 'admin-pass,user-pass',\n 'super-pass,admin-pass,user-pass',\n ],\n }),\n },\n\n SPFN_AUTH_ADMIN_ROLES: {\n ...envString({\n description: 'Comma-separated list of admin roles (legacy CSV format)',\n required: false,\n examples: [\n 'admin,user',\n 'superadmin,admin,user',\n ],\n }),\n },\n\n SPFN_AUTH_ADMIN_EMAIL: {\n ...envString({\n description: 'Single admin email (simplest format)',\n required: false,\n examples: ['admin@example.com'],\n }),\n },\n\n SPFN_AUTH_ADMIN_PASSWORD: {\n ...envString({\n description: 'Single admin password (simplest format)',\n required: false,\n validator: createPasswordParser({\n minLength: 8,\n requireUppercase: true,\n requireLowercase: true,\n requireNumber: true,\n requireSpecial: true,\n }),\n sensitive: true,\n examples: ['SecureAdmin123!'],\n }),\n },\n\n // ============================================================================\n // API Configuration\n // ============================================================================\n SPFN_API_URL: {\n ...envString({\n description: 'Base API URL for invitation links and other external-facing URLs',\n default: 'http://localhost:8790',\n required: false,\n examples: [\n 'https://api.example.com',\n 'http://localhost:8790',\n ],\n }),\n },\n\n // ============================================================================\n // AWS SNS Configuration (SMS)\n // ============================================================================\n SPFN_AUTH_AWS_REGION: {\n ...envString({\n description: 'AWS region for SNS service',\n default: 'ap-northeast-2',\n required: false,\n examples: ['ap-northeast-2', 'us-east-1', 'eu-west-1'],\n }),\n },\n\n SPFN_AUTH_AWS_SNS_ACCESS_KEY_ID: {\n ...envString({\n description: 'AWS SNS access key ID (optional, uses default credentials chain if not provided)',\n required: false,\n sensitive: true,\n examples: ['AKIAIOSFODNN7EXAMPLE'],\n }),\n },\n\n SPFN_AUTH_AWS_SNS_SECRET_ACCESS_KEY: {\n ...envString({\n description: 'AWS SNS secret access key (optional, uses default credentials chain if not provided)',\n required: false,\n sensitive: true,\n examples: ['wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY'],\n }),\n },\n\n SPFN_AUTH_AWS_SNS_SENDER_ID: {\n ...envString({\n description: 'SMS sender ID displayed to recipients (max 11 characters, alphanumeric)',\n required: false,\n examples: ['MyApp', 'YourBrand'],\n }),\n },\n\n // ============================================================================\n // AWS SES Configuration (Email)\n // ============================================================================\n SPFN_AUTH_AWS_SES_ACCESS_KEY_ID: {\n ...envString({\n description: 'AWS SES access key ID (optional, uses default credentials chain if not provided)',\n required: false,\n sensitive: true,\n examples: ['AKIAIOSFODNN7EXAMPLE'],\n }),\n },\n\n SPFN_AUTH_AWS_SES_SECRET_ACCESS_KEY: {\n ...envString({\n description: 'AWS SES secret access key (optional, uses default credentials chain if not provided)',\n required: false,\n sensitive: true,\n examples: ['wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY'],\n }),\n },\n\n SPFN_AUTH_AWS_SES_FROM_EMAIL: {\n ...envString({\n description: 'Sender email address (must be verified in AWS SES)',\n required: false,\n examples: ['noreply@example.com', 'auth@yourdomain.com'],\n }),\n },\n\n SPFN_AUTH_AWS_SES_FROM_NAME: {\n ...envString({\n description: 'Sender display name',\n required: false,\n examples: ['MyApp', 'Your Company'],\n }),\n },\n});"],"mappings":";AAcA,SAAS,yBAAyB;;;ACLlC;AAAA,EACI;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACG;AAoBA,IAAM,gBAAgB,gBAAgB;AAAA;AAAA;AAAA;AAAA,EAIzC,0BAA0B;AAAA,IACtB,GAAG,UAAU;AAAA,MACT,aAAa;AAAA,MACb,UAAU;AAAA,MACV,cAAc,CAAC,gBAAgB;AAAA,MAC/B,WAAW,yBAAyB;AAAA,QAChC,WAAW;AAAA,QACX,gBAAgB;AAAA,QAChB,YAAY;AAAA,MAChB,CAAC;AAAA,MACD,WAAW;AAAA,MACX,UAAU;AAAA,QACN;AAAA,QACA;AAAA,MACJ;AAAA,IACJ,CAAC;AAAA,EACL;AAAA,EAEA,uBAAuB;AAAA,IACnB,GAAG,UAAU;AAAA,MACT,aAAa;AAAA,MACb,SAAS;AAAA,MACT,UAAU;AAAA,MACV,UAAU,CAAC,MAAM,OAAO,OAAO,OAAO,MAAM;AAAA,IAChD,CAAC;AAAA,EACL;AAAA;AAAA;AAAA;AAAA,EAKA,sBAAsB;AAAA,IAClB,GAAG,UAAU;AAAA,MACT,aAAa;AAAA,MACb,SAAS;AAAA,MACT,UAAU;AAAA,MACV,UAAU;AAAA,QACN;AAAA,QACA;AAAA,MACJ;AAAA,IACJ,CAAC;AAAA,EACL;AAAA,EAEA,0BAA0B;AAAA,IACtB,GAAG,UAAU;AAAA,MACT,aAAa;AAAA,MACb,SAAS;AAAA,MACT,UAAU;AAAA,MACV,UAAU,CAAC,MAAM,OAAO,MAAM,KAAK;AAAA,IACvC,CAAC;AAAA,EACL;AAAA;AAAA;AAAA;AAAA,EAKA,8BAA8B;AAAA,IAC1B,GAAG,UAAU;AAAA,MACT,aAAa;AAAA,MACb,SAAS;AAAA,MACT,UAAU;AAAA,MACV,UAAU,CAAC,IAAI,IAAI,EAAE;AAA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,IAC1B,GAAG,UAAU;AAAA,MACT,aAAa;AAAA,MACb,UAAU;AAAA,MACV,UAAU,CAAC,uBAAuB,qBAAqB;AAAA,IAC3D,CAAC;AAAA,EACL;AAAA,EAEA,6BAA6B;AAAA,IACzB,GAAG,UAAU;AAAA,MACT,aAAa;AAAA,MACb,UAAU;AAAA,MACV,UAAU,CAAC,SAAS,cAAc;AAAA,IACtC,CAAC;AAAA,EACL;AACJ,CAAC;;;AD5PD,IAAM,WAAW,kBAAkB,aAAa;AACzC,IAAM,MAAM,SAAS,SAAS;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/config/index.ts","../src/config/schema.ts"],"sourcesContent":["/**\n * Core Package Configuration\n *\n * @example\n * ```typescript\n * import { registry } from '@spfn/core/config';\n *\n * const env = registry.validate();\n * console.log(env.DB_POOL_MAX);\n * ```\n *\n * @module config\n */\n\nimport { createEnvRegistry } from '@spfn/core/env';\nimport { authEnvSchema } from './schema';\n\nexport { authEnvSchema as envSchema } from './schema';\n\n/**\n * Environment registry\n */\nconst registry = createEnvRegistry(authEnvSchema);\nexport const env = registry.validate();","/**\n * Auth Environment Variable Schema\n *\n * Centralized schema definition for all environment variables used in @spfn/auth.\n * This provides type safety, validation, and documentation for Auth configuration.\n *\n * @module config/schema\n */\n\nimport {\n defineEnvSchema,\n envString,\n envNumber,\n createSecureSecretParser,\n createPasswordParser,\n} from '@spfn/core/env';\n\n/**\n * Auth environment variable schema\n *\n * Defines all Auth environment variables with:\n * - Type information\n * - Default values\n * - Validation rules\n * - Documentation\n *\n * @example\n * ```typescript\n * import { authEnvSchema } from '@spfn/auth/config';\n *\n * // Access schema information\n * console.log(authEnvSchema.SPFN_AUTH_SESSION_SECRET.description);\n * console.log(authEnvSchema.SPFN_AUTH_JWT_EXPIRES_IN.default);\n * ```\n */\nexport const authEnvSchema = defineEnvSchema({\n // ============================================================================\n // Session Configuration\n // ============================================================================\n SPFN_AUTH_SESSION_SECRET: {\n ...envString({\n description: 'Session encryption secret (minimum 32 characters for AES-256)',\n required: true,\n fallbackKeys: ['SESSION_SECRET'],\n validator: createSecureSecretParser({\n minLength: 32,\n minUniqueChars: 16,\n minEntropy: 3.5,\n }),\n sensitive: true,\n nextjs: true, // Required for Next.js RSC session validation\n examples: [\n 'my-super-secret-session-key-at-least-32-chars-long',\n 'use-a-cryptographically-secure-random-string-here',\n ],\n }),\n },\n\n SPFN_AUTH_SESSION_TTL: {\n ...envString({\n description: 'Session TTL (time to live) - supports duration strings like \\'7d\\', \\'12h\\', \\'45m\\'',\n default: '7d',\n required: false,\n nextjs: true, // May be needed for session validation in Next.js RSC\n examples: ['7d', '30d', '12h', '45m', '3600'],\n }),\n },\n\n // ============================================================================\n // JWT Configuration\n // ============================================================================\n SPFN_AUTH_JWT_SECRET: {\n ...envString({\n description: 'JWT signing secret for server-signed tokens (legacy mode)',\n default: 'dev-secret-key-change-in-production',\n required: false,\n examples: [\n 'your-jwt-secret-key-here',\n 'use-different-from-session-secret',\n ],\n }),\n },\n\n SPFN_AUTH_JWT_EXPIRES_IN: {\n ...envString({\n description: 'JWT token expiration time (e.g., \\'7d\\', \\'24h\\', \\'1h\\')',\n default: '7d',\n required: false,\n examples: ['7d', '24h', '1h', '30m'],\n }),\n },\n\n // ============================================================================\n // Security Configuration\n // ============================================================================\n SPFN_AUTH_BCRYPT_SALT_ROUNDS: {\n ...envNumber({\n description: 'Bcrypt salt rounds (cost factor, higher = more secure but slower)',\n default: 10,\n required: false,\n examples: [10, 12, 14],\n }),\n key: 'SPFN_AUTH_BCRYPT_SALT_ROUNDS',\n },\n\n SPFN_AUTH_VERIFICATION_TOKEN_SECRET: {\n ...envString({\n description: 'Verification token secret for email verification, password reset, etc.',\n required: true,\n examples: [\n 'your-verification-token-secret',\n 'can-be-different-from-jwt-secret',\n ],\n }),\n },\n\n // ============================================================================\n // Admin Account Configuration\n // ============================================================================\n SPFN_AUTH_ADMIN_ACCOUNTS: {\n ...envString({\n description: 'JSON array of admin accounts (recommended for multiple admins)',\n required: false,\n examples: [\n '[{\"email\":\"admin@example.com\",\"password\":\"secure-pass\",\"role\":\"admin\"}]',\n '[{\"email\":\"super@example.com\",\"password\":\"pass1\",\"role\":\"superadmin\"},{\"email\":\"admin@example.com\",\"password\":\"pass2\",\"role\":\"admin\"}]',\n ],\n }),\n },\n\n SPFN_AUTH_ADMIN_EMAILS: {\n ...envString({\n description: 'Comma-separated list of admin emails (legacy CSV format)',\n required: false,\n examples: [\n 'admin@example.com,user@example.com',\n 'super@example.com,admin@example.com,user@example.com',\n ],\n }),\n },\n\n SPFN_AUTH_ADMIN_PASSWORDS: {\n ...envString({\n description: 'Comma-separated list of admin passwords (legacy CSV format)',\n required: false,\n examples: [\n 'admin-pass,user-pass',\n 'super-pass,admin-pass,user-pass',\n ],\n }),\n },\n\n SPFN_AUTH_ADMIN_ROLES: {\n ...envString({\n description: 'Comma-separated list of admin roles (legacy CSV format)',\n required: false,\n examples: [\n 'admin,user',\n 'superadmin,admin,user',\n ],\n }),\n },\n\n SPFN_AUTH_ADMIN_EMAIL: {\n ...envString({\n description: 'Single admin email (simplest format)',\n required: false,\n examples: ['admin@example.com'],\n }),\n },\n\n SPFN_AUTH_ADMIN_PASSWORD: {\n ...envString({\n description: 'Single admin password (simplest format)',\n required: false,\n validator: createPasswordParser({\n minLength: 8,\n requireUppercase: true,\n requireLowercase: true,\n requireNumber: true,\n requireSpecial: true,\n }),\n sensitive: true,\n examples: ['SecureAdmin123!'],\n }),\n },\n\n // ============================================================================\n // API Configuration\n // ============================================================================\n SPFN_API_URL: {\n ...envString({\n description: 'Base API URL for invitation links and other external-facing URLs',\n default: 'http://localhost:8790',\n required: false,\n examples: [\n 'https://api.example.com',\n 'http://localhost:8790',\n ],\n }),\n },\n\n // ============================================================================\n // AWS SNS Configuration (SMS)\n // ============================================================================\n SPFN_AUTH_AWS_REGION: {\n ...envString({\n description: 'AWS region for SNS service',\n default: 'ap-northeast-2',\n required: false,\n examples: ['ap-northeast-2', 'us-east-1', 'eu-west-1'],\n }),\n },\n\n SPFN_AUTH_AWS_SNS_ACCESS_KEY_ID: {\n ...envString({\n description: 'AWS SNS access key ID (optional, uses default credentials chain if not provided)',\n required: false,\n sensitive: true,\n examples: ['AKIAIOSFODNN7EXAMPLE'],\n }),\n },\n\n SPFN_AUTH_AWS_SNS_SECRET_ACCESS_KEY: {\n ...envString({\n description: 'AWS SNS secret access key (optional, uses default credentials chain if not provided)',\n required: false,\n sensitive: true,\n examples: ['wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY'],\n }),\n },\n\n SPFN_AUTH_AWS_SNS_SENDER_ID: {\n ...envString({\n description: 'SMS sender ID displayed to recipients (max 11 characters, alphanumeric)',\n required: false,\n examples: ['MyApp', 'YourBrand'],\n }),\n },\n\n // ============================================================================\n // AWS SES Configuration (Email)\n // ============================================================================\n SPFN_AUTH_AWS_SES_ACCESS_KEY_ID: {\n ...envString({\n description: 'AWS SES access key ID (optional, uses default credentials chain if not provided)',\n required: false,\n sensitive: true,\n examples: ['AKIAIOSFODNN7EXAMPLE'],\n }),\n },\n\n SPFN_AUTH_AWS_SES_SECRET_ACCESS_KEY: {\n ...envString({\n description: 'AWS SES secret access key (optional, uses default credentials chain if not provided)',\n required: false,\n sensitive: true,\n examples: ['wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY'],\n }),\n },\n\n SPFN_AUTH_AWS_SES_FROM_EMAIL: {\n ...envString({\n description: 'Sender email address (must be verified in AWS SES)',\n required: false,\n examples: ['noreply@example.com', 'auth@yourdomain.com'],\n }),\n },\n\n SPFN_AUTH_AWS_SES_FROM_NAME: {\n ...envString({\n description: 'Sender display name',\n required: false,\n examples: ['MyApp', 'Your Company'],\n }),\n },\n});"],"mappings":";AAcA,SAAS,yBAAyB;;;ACLlC;AAAA,EACI;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACG;AAoBA,IAAM,gBAAgB,gBAAgB;AAAA;AAAA;AAAA;AAAA,EA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