@spfn/auth 0.2.0-beta.65 → 0.2.0-beta.67
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/LICENSE +1 -1
- package/README.md +321 -2534
- package/dist/{authenticate-mfVRzeIK.d.ts → authenticate-Cn5krz5U.d.ts} +82 -10
- package/dist/config.d.ts +39 -3
- package/dist/config.js +25 -0
- package/dist/config.js.map +1 -1
- package/dist/errors.d.ts +16 -2
- package/dist/errors.js +9 -0
- package/dist/errors.js.map +1 -1
- package/dist/index.d.ts +26 -9
- package/dist/index.js +9 -1
- package/dist/index.js.map +1 -1
- package/dist/nextjs/api.js.map +1 -1
- package/dist/nextjs/server.d.ts +2 -2
- package/dist/nextjs/server.js.map +1 -1
- package/dist/server.d.ts +112 -72
- package/dist/server.js +241 -31
- package/dist/server.js.map +1 -1
- package/dist/{session-2CyIVxMY.d.ts → session-s_hiXmXC.d.ts} +1 -1
- package/dist/{types-B4auHIax.d.ts → types-BtksCI9X.d.ts} +1 -1
- package/package.json +8 -5
package/dist/server.d.ts
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
1
|
+
import { j as AuthInitOptions, k as OAuthProvider, e as VerificationPurpose, i as PermissionCategory, l as AuthContext } from './authenticate-Cn5krz5U.js';
|
|
2
|
+
export { w as ChangePasswordParams, s as CheckAccountExistsParams, C as CheckAccountExistsResult, a6 as EmailSchema, I as IssueOneTimeTokenResult, u as LoginParams, L as LoginResult, v as LogoutParams, ad as NativeVerifyOptions, ab as NormalizedIdentity, a0 as OAuthCallbackParams, a1 as OAuthCallbackResult, a3 as OAuthNativeParams, c as OAuthNativeResult, $ as OAuthStartParams, O as OAuthStartResult, ac as OAuthTokens, a8 as PasswordSchema, a7 as PhoneSchema, t as RegisterParams, H as RegisterPublicKeyParams, a as RegisterResult, K as RevokeKeyParams, J as RotateKeyParams, b as RotateKeyResult, z as SendVerificationCodeParams, S as SendVerificationCodeResult, a9 as TargetTypeSchema, g as VERIFICATION_PURPOSES, f as VERIFICATION_TARGET_TYPES, aa as VerificationPurposeSchema, V as VerificationTargetType, B as VerifyCodeParams, D as VerifyCodeResult, m as authRouter, a4 as authenticate, W as buildOAuthErrorUrl, q as changePasswordService, n as checkAccountExistsService, Z as getEnabledOAuthProviders, _ as getGoogleAccessToken, af as getOAuthProvider, ag as getRegisteredProviders, X as isOAuthProviderEnabled, M as issueOneTimeTokenService, o as loginService, p as logoutService, T as oauthCallbackService, a2 as oauthNativeService, Q as oauthStartService, a5 as optionalAuth, ae as registerOAuthProvider, E as registerPublicKeyService, r as registerService, Y as requireEnabledProvider, G as revokeKeyService, F as rotateKeyService, x as sendVerificationCodeService, y as verifyCodeService, N as verifyOneTimeTokenService } from './authenticate-Cn5krz5U.js';
|
|
3
3
|
import * as drizzle_orm_pg_core from 'drizzle-orm/pg-core';
|
|
4
|
-
import { K as KeyAlgorithmType, b as InvitationStatus, d as SocialProvider } from './types-
|
|
5
|
-
export { I as INVITATION_STATUSES, a as KEY_ALGORITHM, S as SOCIAL_PROVIDERS, U as USER_STATUSES, c as UserStatus } from './types-
|
|
4
|
+
import { K as KeyAlgorithmType, b as InvitationStatus, d as SocialProvider } from './types-BtksCI9X.js';
|
|
5
|
+
export { I as INVITATION_STATUSES, a as KEY_ALGORITHM, S as SOCIAL_PROVIDERS, U as USER_STATUSES, c as UserStatus } from './types-BtksCI9X.js';
|
|
6
6
|
import { UserProfile as UserProfile$1, ProfileInfo } from '@spfn/auth';
|
|
7
7
|
import { BaseRepository } from '@spfn/core/db';
|
|
8
8
|
import { Context } from 'hono';
|
|
9
9
|
import * as _spfn_core_route from '@spfn/core/route';
|
|
10
10
|
import { Algorithm } from 'jsonwebtoken';
|
|
11
|
-
export { S as SessionData, g as getSessionInfo, s as sealSession, a as shouldRefreshSession, u as unsealSession } from './session-
|
|
11
|
+
export { S as SessionData, g as getSessionInfo, s as sealSession, a as shouldRefreshSession, u as unsealSession } from './session-s_hiXmXC.js';
|
|
12
|
+
import { JWTPayload } from 'jose';
|
|
12
13
|
import { SSETokenStore, SSETokenManager } from '@spfn/core/event/sse';
|
|
13
14
|
import * as _spfn_core_logger from '@spfn/core/logger';
|
|
14
15
|
import * as _spfn_core_event from '@spfn/core/event';
|
|
@@ -1333,7 +1334,7 @@ declare function getAuthSessionService(userId: string | number | bigint): Promis
|
|
|
1333
1334
|
id: number;
|
|
1334
1335
|
name: string;
|
|
1335
1336
|
displayName: string;
|
|
1336
|
-
category: "
|
|
1337
|
+
category: "auth" | "custom" | "user" | "rbac" | "system" | undefined;
|
|
1337
1338
|
}[];
|
|
1338
1339
|
userId: number;
|
|
1339
1340
|
publicId: string;
|
|
@@ -1526,6 +1527,31 @@ declare function createOAuthState(params: CreateOAuthStateParams): Promise<strin
|
|
|
1526
1527
|
*/
|
|
1527
1528
|
declare function verifyOAuthState(encryptedState: string): Promise<OAuthState>;
|
|
1528
1529
|
|
|
1530
|
+
/**
|
|
1531
|
+
* 소셜 provider id_token JWKS 검증
|
|
1532
|
+
*
|
|
1533
|
+
* 네이티브/웹 SDK가 받은 id_token을 provider의 공개키(JWKS)로 검증한다.
|
|
1534
|
+
* authorization code 교환이 없으므로 client secret을 쓰지 않는다.
|
|
1535
|
+
* 서명·issuer·audience·만료는 jose가, nonce는 여기서 직접 대조한다.
|
|
1536
|
+
*/
|
|
1537
|
+
|
|
1538
|
+
interface VerifyIdTokenParams {
|
|
1539
|
+
idToken: string;
|
|
1540
|
+
jwksUri: string;
|
|
1541
|
+
issuer: string | string[];
|
|
1542
|
+
audiences: string[];
|
|
1543
|
+
/** 허용 서명 알고리즘 화이트리스트(alg confusion 방어). Google/Apple은 'RS256'. */
|
|
1544
|
+
algorithms: string[];
|
|
1545
|
+
/** id_token의 nonce claim과 정확히 일치해야 하는 값(provider별로 raw 또는 SHA-256 해시). */
|
|
1546
|
+
expectedNonce: string;
|
|
1547
|
+
}
|
|
1548
|
+
/**
|
|
1549
|
+
* id_token을 검증하고 claims(payload)를 반환한다.
|
|
1550
|
+
*
|
|
1551
|
+
* @throws InvalidSocialTokenError 서명/issuer/audience/만료/알고리즘/nonce/sub 검증 실패 시
|
|
1552
|
+
*/
|
|
1553
|
+
declare function verifyIdToken(params: VerifyIdTokenParams): Promise<JWTPayload>;
|
|
1554
|
+
|
|
1529
1555
|
/**
|
|
1530
1556
|
* Google OAuthProvider 구현
|
|
1531
1557
|
*
|
|
@@ -1537,6 +1563,20 @@ declare function verifyOAuthState(encryptedState: string): Promise<OAuthState>;
|
|
|
1537
1563
|
|
|
1538
1564
|
declare const googleProvider: OAuthProvider;
|
|
1539
1565
|
|
|
1566
|
+
/**
|
|
1567
|
+
* Apple OAuthProvider 구현 (native id_token 검증 전용)
|
|
1568
|
+
*
|
|
1569
|
+
* Apple은 Android·웹에 네이티브 SDK를 제공하지 않으므로, web 흐름(Sign in with Apple JS,
|
|
1570
|
+
* Android Custom Tab)도 결국 id_token을 클라이언트가 받아 서버로 보낸다. 서버는 그 id_token을
|
|
1571
|
+
* Apple JWKS로 검증만 한다(authorization code 교환·client secret 없음).
|
|
1572
|
+
*
|
|
1573
|
+
* 따라서 web 메서드(getAuthUrl/exchangeCodeForTokens/getUserInfo)는 지원하지 않는다.
|
|
1574
|
+
*
|
|
1575
|
+
* 이 모듈을 import 하는 것만으로 apple provider가 registry에 자기 등록된다.
|
|
1576
|
+
*/
|
|
1577
|
+
|
|
1578
|
+
declare const appleProvider: OAuthProvider;
|
|
1579
|
+
|
|
1540
1580
|
/**
|
|
1541
1581
|
* @spfn/auth - Database Schema Definition
|
|
1542
1582
|
*
|
|
@@ -2184,14 +2224,14 @@ declare const userSocialAccounts: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
2184
2224
|
tableName: "user_social_accounts";
|
|
2185
2225
|
dataType: "string";
|
|
2186
2226
|
columnType: "PgText";
|
|
2187
|
-
data: "google" | "github" | "kakao" | "naver" | "superself";
|
|
2227
|
+
data: "google" | "apple" | "github" | "kakao" | "naver" | "superself";
|
|
2188
2228
|
driverParam: string;
|
|
2189
2229
|
notNull: true;
|
|
2190
2230
|
hasDefault: false;
|
|
2191
2231
|
isPrimaryKey: false;
|
|
2192
2232
|
isAutoincrement: false;
|
|
2193
2233
|
hasRuntimeDefault: false;
|
|
2194
|
-
enumValues: ["google", "github", "kakao", "naver", "superself"] & [string, ...string[]];
|
|
2234
|
+
enumValues: ["google", "apple", "github", "kakao", "naver", "superself"] & [string, ...string[]];
|
|
2195
2235
|
baseColumn: never;
|
|
2196
2236
|
identity: undefined;
|
|
2197
2237
|
generated: undefined;
|
|
@@ -2595,7 +2635,7 @@ declare const permissions: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
2595
2635
|
tableName: "permissions";
|
|
2596
2636
|
dataType: "string";
|
|
2597
2637
|
columnType: "PgText";
|
|
2598
|
-
data: "
|
|
2638
|
+
data: "auth" | "custom" | "user" | "rbac" | "system";
|
|
2599
2639
|
driverParam: string;
|
|
2600
2640
|
notNull: false;
|
|
2601
2641
|
hasDefault: false;
|
|
@@ -3186,17 +3226,17 @@ declare class UsersRepository extends BaseRepository {
|
|
|
3186
3226
|
* Write primary 사용
|
|
3187
3227
|
*/
|
|
3188
3228
|
create(data: NewUser): Promise<{
|
|
3189
|
-
username: string | null;
|
|
3190
|
-
status: "active" | "inactive" | "suspended";
|
|
3191
3229
|
email: string | null;
|
|
3192
3230
|
phone: string | null;
|
|
3193
3231
|
id: number;
|
|
3194
|
-
createdAt: Date;
|
|
3195
|
-
updatedAt: Date;
|
|
3196
3232
|
publicId: string;
|
|
3233
|
+
username: string | null;
|
|
3197
3234
|
passwordHash: string | null;
|
|
3198
3235
|
passwordChangeRequired: boolean;
|
|
3199
3236
|
roleId: number;
|
|
3237
|
+
createdAt: Date;
|
|
3238
|
+
updatedAt: Date;
|
|
3239
|
+
status: "active" | "inactive" | "suspended";
|
|
3200
3240
|
emailVerifiedAt: Date | null;
|
|
3201
3241
|
phoneVerifiedAt: Date | null;
|
|
3202
3242
|
lastLoginAt: Date | null;
|
|
@@ -3266,17 +3306,17 @@ declare class UsersRepository extends BaseRepository {
|
|
|
3266
3306
|
* Write primary 사용
|
|
3267
3307
|
*/
|
|
3268
3308
|
deleteById(id: number): Promise<{
|
|
3269
|
-
username: string | null;
|
|
3270
|
-
status: "active" | "inactive" | "suspended";
|
|
3271
3309
|
email: string | null;
|
|
3272
3310
|
phone: string | null;
|
|
3273
3311
|
id: number;
|
|
3274
|
-
createdAt: Date;
|
|
3275
|
-
updatedAt: Date;
|
|
3276
3312
|
publicId: string;
|
|
3313
|
+
username: string | null;
|
|
3277
3314
|
passwordHash: string | null;
|
|
3278
3315
|
passwordChangeRequired: boolean;
|
|
3279
3316
|
roleId: number;
|
|
3317
|
+
createdAt: Date;
|
|
3318
|
+
updatedAt: Date;
|
|
3319
|
+
status: "active" | "inactive" | "suspended";
|
|
3280
3320
|
emailVerifiedAt: Date | null;
|
|
3281
3321
|
phoneVerifiedAt: Date | null;
|
|
3282
3322
|
lastLoginAt: Date | null;
|
|
@@ -3299,7 +3339,7 @@ declare class UsersRepository extends BaseRepository {
|
|
|
3299
3339
|
id: number;
|
|
3300
3340
|
name: string;
|
|
3301
3341
|
displayName: string;
|
|
3302
|
-
category: "
|
|
3342
|
+
category: "auth" | "custom" | "user" | "rbac" | "system" | undefined;
|
|
3303
3343
|
}[];
|
|
3304
3344
|
}>;
|
|
3305
3345
|
/**
|
|
@@ -3414,16 +3454,16 @@ declare class KeysRepository extends BaseRepository {
|
|
|
3414
3454
|
* Write primary 사용
|
|
3415
3455
|
*/
|
|
3416
3456
|
create(data: NewUserPublicKey): Promise<{
|
|
3417
|
-
|
|
3457
|
+
publicKey: string;
|
|
3418
3458
|
keyId: string;
|
|
3459
|
+
fingerprint: string;
|
|
3460
|
+
algorithm: "ES256" | "RS256";
|
|
3461
|
+
userId: number;
|
|
3419
3462
|
id: number;
|
|
3420
3463
|
isActive: boolean;
|
|
3421
3464
|
createdAt: Date;
|
|
3422
|
-
publicKey: string;
|
|
3423
|
-
algorithm: "ES256" | "RS256";
|
|
3424
|
-
fingerprint: string;
|
|
3425
|
-
lastUsedAt: Date | null;
|
|
3426
3465
|
expiresAt: Date | null;
|
|
3466
|
+
lastUsedAt: Date | null;
|
|
3427
3467
|
revokedAt: Date | null;
|
|
3428
3468
|
revokedReason: string | null;
|
|
3429
3469
|
}>;
|
|
@@ -3450,16 +3490,16 @@ declare class KeysRepository extends BaseRepository {
|
|
|
3450
3490
|
* Write primary 사용
|
|
3451
3491
|
*/
|
|
3452
3492
|
deleteByKeyIdAndUserId(keyId: string, userId: number): Promise<{
|
|
3453
|
-
|
|
3493
|
+
publicKey: string;
|
|
3454
3494
|
keyId: string;
|
|
3495
|
+
fingerprint: string;
|
|
3496
|
+
algorithm: "ES256" | "RS256";
|
|
3497
|
+
userId: number;
|
|
3455
3498
|
id: number;
|
|
3456
3499
|
isActive: boolean;
|
|
3457
3500
|
createdAt: Date;
|
|
3458
|
-
publicKey: string;
|
|
3459
|
-
algorithm: "ES256" | "RS256";
|
|
3460
|
-
fingerprint: string;
|
|
3461
|
-
lastUsedAt: Date | null;
|
|
3462
3501
|
expiresAt: Date | null;
|
|
3502
|
+
lastUsedAt: Date | null;
|
|
3463
3503
|
revokedAt: Date | null;
|
|
3464
3504
|
revokedReason: string | null;
|
|
3465
3505
|
}>;
|
|
@@ -3574,14 +3614,14 @@ declare class VerificationCodesRepository extends BaseRepository {
|
|
|
3574
3614
|
* Write primary 사용
|
|
3575
3615
|
*/
|
|
3576
3616
|
create(data: NewVerificationCode): Promise<{
|
|
3617
|
+
target: string;
|
|
3618
|
+
targetType: "email" | "phone";
|
|
3619
|
+
purpose: "registration" | "login" | "password_reset" | "email_change" | "phone_change";
|
|
3620
|
+
code: string;
|
|
3577
3621
|
id: number;
|
|
3578
3622
|
createdAt: Date;
|
|
3579
3623
|
updatedAt: Date;
|
|
3580
3624
|
expiresAt: Date;
|
|
3581
|
-
target: string;
|
|
3582
|
-
targetType: "email" | "phone";
|
|
3583
|
-
code: string;
|
|
3584
|
-
purpose: "registration" | "login" | "password_reset" | "email_change" | "phone_change";
|
|
3585
3625
|
usedAt: Date | null;
|
|
3586
3626
|
attempts: number;
|
|
3587
3627
|
}>;
|
|
@@ -3770,7 +3810,7 @@ declare class PermissionsRepository extends BaseRepository {
|
|
|
3770
3810
|
name: string;
|
|
3771
3811
|
displayName: string;
|
|
3772
3812
|
description: string | null;
|
|
3773
|
-
category: "
|
|
3813
|
+
category: "auth" | "custom" | "user" | "rbac" | "system" | null;
|
|
3774
3814
|
isBuiltin: boolean;
|
|
3775
3815
|
isSystem: boolean;
|
|
3776
3816
|
isActive: boolean;
|
|
@@ -3786,7 +3826,7 @@ declare class PermissionsRepository extends BaseRepository {
|
|
|
3786
3826
|
name: string;
|
|
3787
3827
|
displayName: string;
|
|
3788
3828
|
description: string | null;
|
|
3789
|
-
category: "
|
|
3829
|
+
category: "auth" | "custom" | "user" | "rbac" | "system" | null;
|
|
3790
3830
|
isBuiltin: boolean;
|
|
3791
3831
|
isSystem: boolean;
|
|
3792
3832
|
isActive: boolean;
|
|
@@ -3826,7 +3866,7 @@ declare class PermissionsRepository extends BaseRepository {
|
|
|
3826
3866
|
name: string;
|
|
3827
3867
|
displayName: string;
|
|
3828
3868
|
description: string | null;
|
|
3829
|
-
category: "
|
|
3869
|
+
category: "auth" | "custom" | "user" | "rbac" | "system" | null;
|
|
3830
3870
|
isBuiltin: boolean;
|
|
3831
3871
|
isSystem: boolean;
|
|
3832
3872
|
isActive: boolean;
|
|
@@ -3837,6 +3877,7 @@ declare class PermissionsRepository extends BaseRepository {
|
|
|
3837
3877
|
*/
|
|
3838
3878
|
deleteById(id: number): Promise<{
|
|
3839
3879
|
description: string | null;
|
|
3880
|
+
metadata: Record<string, any> | null;
|
|
3840
3881
|
id: number;
|
|
3841
3882
|
name: string;
|
|
3842
3883
|
displayName: string;
|
|
@@ -3845,8 +3886,7 @@ declare class PermissionsRepository extends BaseRepository {
|
|
|
3845
3886
|
isActive: boolean;
|
|
3846
3887
|
createdAt: Date;
|
|
3847
3888
|
updatedAt: Date;
|
|
3848
|
-
|
|
3849
|
-
category: "custom" | "user" | "auth" | "rbac" | "system" | null;
|
|
3889
|
+
category: "auth" | "custom" | "user" | "rbac" | "system" | null;
|
|
3850
3890
|
}>;
|
|
3851
3891
|
}
|
|
3852
3892
|
declare const permissionsRepository: PermissionsRepository;
|
|
@@ -3891,9 +3931,9 @@ declare class RolePermissionsRepository extends BaseRepository {
|
|
|
3891
3931
|
*/
|
|
3892
3932
|
createMany(data: NewRolePermission[]): Promise<{
|
|
3893
3933
|
id: number;
|
|
3934
|
+
roleId: number;
|
|
3894
3935
|
createdAt: Date;
|
|
3895
3936
|
updatedAt: Date;
|
|
3896
|
-
roleId: number;
|
|
3897
3937
|
permissionId: number;
|
|
3898
3938
|
}[]>;
|
|
3899
3939
|
/**
|
|
@@ -3909,9 +3949,9 @@ declare class RolePermissionsRepository extends BaseRepository {
|
|
|
3909
3949
|
*/
|
|
3910
3950
|
setPermissionsForRole(roleId: number, permissionIds: number[]): Promise<{
|
|
3911
3951
|
id: number;
|
|
3952
|
+
roleId: number;
|
|
3912
3953
|
createdAt: Date;
|
|
3913
3954
|
updatedAt: Date;
|
|
3914
|
-
roleId: number;
|
|
3915
3955
|
permissionId: number;
|
|
3916
3956
|
}[]>;
|
|
3917
3957
|
}
|
|
@@ -3976,10 +4016,10 @@ declare class UserPermissionsRepository extends BaseRepository {
|
|
|
3976
4016
|
id: number;
|
|
3977
4017
|
createdAt: Date;
|
|
3978
4018
|
updatedAt: Date;
|
|
3979
|
-
expiresAt: Date | null;
|
|
3980
4019
|
permissionId: number;
|
|
3981
|
-
|
|
4020
|
+
expiresAt: Date | null;
|
|
3982
4021
|
reason: string | null;
|
|
4022
|
+
granted: boolean;
|
|
3983
4023
|
}>;
|
|
3984
4024
|
/**
|
|
3985
4025
|
* 사용자 권한 오버라이드 업데이트
|
|
@@ -4002,10 +4042,10 @@ declare class UserPermissionsRepository extends BaseRepository {
|
|
|
4002
4042
|
id: number;
|
|
4003
4043
|
createdAt: Date;
|
|
4004
4044
|
updatedAt: Date;
|
|
4005
|
-
expiresAt: Date | null;
|
|
4006
4045
|
permissionId: number;
|
|
4007
|
-
|
|
4046
|
+
expiresAt: Date | null;
|
|
4008
4047
|
reason: string | null;
|
|
4048
|
+
granted: boolean;
|
|
4009
4049
|
}>;
|
|
4010
4050
|
/**
|
|
4011
4051
|
* 사용자의 모든 권한 오버라이드 삭제
|
|
@@ -4083,6 +4123,7 @@ declare class UserProfilesRepository extends BaseRepository {
|
|
|
4083
4123
|
* 프로필 생성
|
|
4084
4124
|
*/
|
|
4085
4125
|
create(data: NewUserProfile): Promise<{
|
|
4126
|
+
metadata: Record<string, any> | null;
|
|
4086
4127
|
userId: number;
|
|
4087
4128
|
id: number;
|
|
4088
4129
|
displayName: string | null;
|
|
@@ -4100,7 +4141,6 @@ declare class UserProfilesRepository extends BaseRepository {
|
|
|
4100
4141
|
location: string | null;
|
|
4101
4142
|
company: string | null;
|
|
4102
4143
|
jobTitle: string | null;
|
|
4103
|
-
metadata: Record<string, any> | null;
|
|
4104
4144
|
}>;
|
|
4105
4145
|
/**
|
|
4106
4146
|
* 프로필 업데이트 (by ID)
|
|
@@ -4152,6 +4192,7 @@ declare class UserProfilesRepository extends BaseRepository {
|
|
|
4152
4192
|
* 프로필 삭제 (by ID)
|
|
4153
4193
|
*/
|
|
4154
4194
|
deleteById(id: number): Promise<{
|
|
4195
|
+
metadata: Record<string, any> | null;
|
|
4155
4196
|
userId: number;
|
|
4156
4197
|
id: number;
|
|
4157
4198
|
displayName: string | null;
|
|
@@ -4169,12 +4210,12 @@ declare class UserProfilesRepository extends BaseRepository {
|
|
|
4169
4210
|
location: string | null;
|
|
4170
4211
|
company: string | null;
|
|
4171
4212
|
jobTitle: string | null;
|
|
4172
|
-
metadata: Record<string, any> | null;
|
|
4173
4213
|
}>;
|
|
4174
4214
|
/**
|
|
4175
4215
|
* 프로필 삭제 (by User ID)
|
|
4176
4216
|
*/
|
|
4177
4217
|
deleteByUserId(userId: number): Promise<{
|
|
4218
|
+
metadata: Record<string, any> | null;
|
|
4178
4219
|
userId: number;
|
|
4179
4220
|
id: number;
|
|
4180
4221
|
displayName: string | null;
|
|
@@ -4192,7 +4233,6 @@ declare class UserProfilesRepository extends BaseRepository {
|
|
|
4192
4233
|
location: string | null;
|
|
4193
4234
|
company: string | null;
|
|
4194
4235
|
jobTitle: string | null;
|
|
4195
|
-
metadata: Record<string, any> | null;
|
|
4196
4236
|
}>;
|
|
4197
4237
|
/**
|
|
4198
4238
|
* 프로필 Upsert (by User ID)
|
|
@@ -4201,6 +4241,7 @@ declare class UserProfilesRepository extends BaseRepository {
|
|
|
4201
4241
|
* 새로 생성 시 displayName은 필수 (없으면 'User'로 설정)
|
|
4202
4242
|
*/
|
|
4203
4243
|
upsertByUserId(userId: number, data: Partial<Omit<NewUserProfile, 'userId'>>): Promise<{
|
|
4244
|
+
metadata: Record<string, any> | null;
|
|
4204
4245
|
userId: number;
|
|
4205
4246
|
id: number;
|
|
4206
4247
|
displayName: string | null;
|
|
@@ -4218,7 +4259,6 @@ declare class UserProfilesRepository extends BaseRepository {
|
|
|
4218
4259
|
location: string | null;
|
|
4219
4260
|
company: string | null;
|
|
4220
4261
|
jobTitle: string | null;
|
|
4221
|
-
metadata: Record<string, any> | null;
|
|
4222
4262
|
}>;
|
|
4223
4263
|
/**
|
|
4224
4264
|
* User ID로 프로필 데이터 조회 (formatted)
|
|
@@ -4345,16 +4385,16 @@ declare class InvitationsRepository extends BaseRepository {
|
|
|
4345
4385
|
* 초대 생성
|
|
4346
4386
|
*/
|
|
4347
4387
|
create(data: NewInvitation): Promise<{
|
|
4348
|
-
status: "pending" | "accepted" | "expired" | "cancelled";
|
|
4349
4388
|
email: string;
|
|
4389
|
+
metadata: Record<string, any> | null;
|
|
4350
4390
|
id: number;
|
|
4391
|
+
roleId: number;
|
|
4351
4392
|
createdAt: Date;
|
|
4352
4393
|
updatedAt: Date;
|
|
4353
|
-
|
|
4354
|
-
metadata: Record<string, any> | null;
|
|
4355
|
-
expiresAt: Date;
|
|
4394
|
+
status: "pending" | "accepted" | "expired" | "cancelled";
|
|
4356
4395
|
token: string;
|
|
4357
4396
|
invitedBy: number;
|
|
4397
|
+
expiresAt: Date;
|
|
4358
4398
|
acceptedAt: Date | null;
|
|
4359
4399
|
cancelledAt: Date | null;
|
|
4360
4400
|
}>;
|
|
@@ -4379,16 +4419,16 @@ declare class InvitationsRepository extends BaseRepository {
|
|
|
4379
4419
|
* 초대 삭제
|
|
4380
4420
|
*/
|
|
4381
4421
|
deleteById(id: number): Promise<{
|
|
4382
|
-
status: "pending" | "accepted" | "expired" | "cancelled";
|
|
4383
4422
|
email: string;
|
|
4423
|
+
metadata: Record<string, any> | null;
|
|
4384
4424
|
id: number;
|
|
4425
|
+
roleId: number;
|
|
4385
4426
|
createdAt: Date;
|
|
4386
4427
|
updatedAt: Date;
|
|
4387
|
-
|
|
4388
|
-
metadata: Record<string, any> | null;
|
|
4389
|
-
expiresAt: Date;
|
|
4428
|
+
status: "pending" | "accepted" | "expired" | "cancelled";
|
|
4390
4429
|
token: string;
|
|
4391
4430
|
invitedBy: number;
|
|
4431
|
+
expiresAt: Date;
|
|
4392
4432
|
acceptedAt: Date | null;
|
|
4393
4433
|
cancelledAt: Date | null;
|
|
4394
4434
|
}>;
|
|
@@ -4543,7 +4583,7 @@ declare class SocialAccountsRepository extends BaseRepository {
|
|
|
4543
4583
|
id: number;
|
|
4544
4584
|
createdAt: Date;
|
|
4545
4585
|
updatedAt: Date;
|
|
4546
|
-
provider: "google" | "github" | "kakao" | "naver" | "superself";
|
|
4586
|
+
provider: "google" | "apple" | "github" | "kakao" | "naver" | "superself";
|
|
4547
4587
|
providerUserId: string;
|
|
4548
4588
|
providerEmail: string | null;
|
|
4549
4589
|
tokenExpiresAt: Date | null;
|
|
@@ -4559,7 +4599,7 @@ declare class SocialAccountsRepository extends BaseRepository {
|
|
|
4559
4599
|
id: number;
|
|
4560
4600
|
createdAt: Date;
|
|
4561
4601
|
updatedAt: Date;
|
|
4562
|
-
provider: "google" | "github" | "kakao" | "naver" | "superself";
|
|
4602
|
+
provider: "google" | "apple" | "github" | "kakao" | "naver" | "superself";
|
|
4563
4603
|
providerUserId: string;
|
|
4564
4604
|
providerEmail: string | null;
|
|
4565
4605
|
tokenExpiresAt: Date | null;
|
|
@@ -4575,7 +4615,7 @@ declare class SocialAccountsRepository extends BaseRepository {
|
|
|
4575
4615
|
id: number;
|
|
4576
4616
|
createdAt: Date;
|
|
4577
4617
|
updatedAt: Date;
|
|
4578
|
-
provider: "google" | "github" | "kakao" | "naver" | "superself";
|
|
4618
|
+
provider: "google" | "apple" | "github" | "kakao" | "naver" | "superself";
|
|
4579
4619
|
providerUserId: string;
|
|
4580
4620
|
providerEmail: string | null;
|
|
4581
4621
|
tokenExpiresAt: Date | null;
|
|
@@ -4591,7 +4631,7 @@ declare class SocialAccountsRepository extends BaseRepository {
|
|
|
4591
4631
|
id: number;
|
|
4592
4632
|
createdAt: Date;
|
|
4593
4633
|
updatedAt: Date;
|
|
4594
|
-
provider: "google" | "github" | "kakao" | "naver" | "superself";
|
|
4634
|
+
provider: "google" | "apple" | "github" | "kakao" | "naver" | "superself";
|
|
4595
4635
|
providerUserId: string;
|
|
4596
4636
|
providerEmail: string | null;
|
|
4597
4637
|
tokenExpiresAt: Date | null;
|
|
@@ -4611,7 +4651,7 @@ declare class SocialAccountsRepository extends BaseRepository {
|
|
|
4611
4651
|
id: number;
|
|
4612
4652
|
createdAt: Date;
|
|
4613
4653
|
updatedAt: Date;
|
|
4614
|
-
provider: "google" | "github" | "kakao" | "naver" | "superself";
|
|
4654
|
+
provider: "google" | "apple" | "github" | "kakao" | "naver" | "superself";
|
|
4615
4655
|
providerUserId: string;
|
|
4616
4656
|
providerEmail: string | null;
|
|
4617
4657
|
tokenExpiresAt: Date | null;
|
|
@@ -4625,7 +4665,7 @@ declare class SocialAccountsRepository extends BaseRepository {
|
|
|
4625
4665
|
id: number;
|
|
4626
4666
|
createdAt: Date;
|
|
4627
4667
|
updatedAt: Date;
|
|
4628
|
-
provider: "google" | "github" | "kakao" | "naver" | "superself";
|
|
4668
|
+
provider: "google" | "apple" | "github" | "kakao" | "naver" | "superself";
|
|
4629
4669
|
providerUserId: string;
|
|
4630
4670
|
providerEmail: string | null;
|
|
4631
4671
|
accessToken: string | null;
|
|
@@ -4641,7 +4681,7 @@ declare class SocialAccountsRepository extends BaseRepository {
|
|
|
4641
4681
|
id: number;
|
|
4642
4682
|
createdAt: Date;
|
|
4643
4683
|
updatedAt: Date;
|
|
4644
|
-
provider: "google" | "github" | "kakao" | "naver" | "superself";
|
|
4684
|
+
provider: "google" | "apple" | "github" | "kakao" | "naver" | "superself";
|
|
4645
4685
|
providerUserId: string;
|
|
4646
4686
|
providerEmail: string | null;
|
|
4647
4687
|
accessToken: string | null;
|
|
@@ -5103,17 +5143,17 @@ declare function getOptionalAuth(c: Context | {
|
|
|
5103
5143
|
declare function getUser(c: Context | {
|
|
5104
5144
|
raw: Context;
|
|
5105
5145
|
}): {
|
|
5106
|
-
username: string | null;
|
|
5107
|
-
status: "active" | "inactive" | "suspended";
|
|
5108
5146
|
email: string | null;
|
|
5109
5147
|
phone: string | null;
|
|
5110
5148
|
id: number;
|
|
5111
|
-
createdAt: Date;
|
|
5112
|
-
updatedAt: Date;
|
|
5113
5149
|
publicId: string;
|
|
5150
|
+
username: string | null;
|
|
5114
5151
|
passwordHash: string | null;
|
|
5115
5152
|
passwordChangeRequired: boolean;
|
|
5116
5153
|
roleId: number;
|
|
5154
|
+
createdAt: Date;
|
|
5155
|
+
updatedAt: Date;
|
|
5156
|
+
status: "active" | "inactive" | "suspended";
|
|
5117
5157
|
emailVerifiedAt: Date | null;
|
|
5118
5158
|
phoneVerifiedAt: Date | null;
|
|
5119
5159
|
lastLoginAt: Date | null;
|
|
@@ -5190,7 +5230,7 @@ declare function getKeyId(c: Context | {
|
|
|
5190
5230
|
* - RS256 (RSA 2048): ~294 bytes (Base64: ~392 chars)
|
|
5191
5231
|
*/
|
|
5192
5232
|
|
|
5193
|
-
type Unit =
|
|
5233
|
+
type Unit = 'Years' | 'Year' | 'Yrs' | 'Yr' | 'Y' | 'Weeks' | 'Week' | 'W' | 'Days' | 'Day' | 'D' | 'Hours' | 'Hour' | 'Hrs' | 'Hr' | 'H' | 'Minutes' | 'Minute' | 'Mins' | 'Min' | 'M' | 'Seconds' | 'Second' | 'Secs' | 'Sec' | 's' | 'Milliseconds' | 'Millisecond' | 'Msecs' | 'Msec' | 'Ms';
|
|
5194
5234
|
type UnitAnyCase = Unit | Uppercase<Unit> | Lowercase<Unit>;
|
|
5195
5235
|
type StringValue = `${number}` | `${number}${UnitAnyCase}` | `${number} ${UnitAnyCase}`;
|
|
5196
5236
|
interface KeyPair {
|
|
@@ -5505,7 +5545,7 @@ declare function createAuthLifecycle(options?: AuthLifecycleOptions): AuthLifecy
|
|
|
5505
5545
|
*
|
|
5506
5546
|
* 직접 인증(email/phone) + 등록 가능한 모든 소셜 provider(SOCIAL_PROVIDERS).
|
|
5507
5547
|
*/
|
|
5508
|
-
declare const AuthProviderSchema: _sinclair_typebox.TUnion<[_sinclair_typebox.TLiteral<"email">, _sinclair_typebox.TLiteral<"phone">, ..._sinclair_typebox.TLiteral<"google" | "github" | "kakao" | "naver" | "superself">[]]>;
|
|
5548
|
+
declare const AuthProviderSchema: _sinclair_typebox.TUnion<[_sinclair_typebox.TLiteral<"email">, _sinclair_typebox.TLiteral<"phone">, ..._sinclair_typebox.TLiteral<"google" | "apple" | "github" | "kakao" | "naver" | "superself">[]]>;
|
|
5509
5549
|
/**
|
|
5510
5550
|
* auth.login - 로그인 성공 이벤트
|
|
5511
5551
|
*
|
|
@@ -5524,7 +5564,7 @@ declare const authLoginEvent: _spfn_core_event.EventDef<{
|
|
|
5524
5564
|
email?: string | undefined;
|
|
5525
5565
|
phone?: string | undefined;
|
|
5526
5566
|
userId: string;
|
|
5527
|
-
provider: "email" | "phone" | "google" | "github" | "kakao" | "naver" | "superself";
|
|
5567
|
+
provider: "email" | "phone" | "google" | "apple" | "github" | "kakao" | "naver" | "superself";
|
|
5528
5568
|
}>;
|
|
5529
5569
|
/**
|
|
5530
5570
|
* auth.register - 회원가입 성공 이벤트
|
|
@@ -5547,7 +5587,7 @@ declare const authRegisterEvent: _spfn_core_event.EventDef<{
|
|
|
5547
5587
|
[x: string]: unknown;
|
|
5548
5588
|
} | undefined;
|
|
5549
5589
|
userId: string;
|
|
5550
|
-
provider: "email" | "phone" | "google" | "github" | "kakao" | "naver" | "superself";
|
|
5590
|
+
provider: "email" | "phone" | "google" | "apple" | "github" | "kakao" | "naver" | "superself";
|
|
5551
5591
|
}>;
|
|
5552
5592
|
/**
|
|
5553
5593
|
* auth.invitation.created - 초대 생성 이벤트
|
|
@@ -5575,9 +5615,9 @@ declare const invitationCreatedEvent: _spfn_core_event.EventDef<{
|
|
|
5575
5615
|
} | undefined;
|
|
5576
5616
|
email: string;
|
|
5577
5617
|
roleId: number;
|
|
5578
|
-
expiresAt: string;
|
|
5579
5618
|
token: string;
|
|
5580
5619
|
invitedBy: string;
|
|
5620
|
+
expiresAt: string;
|
|
5581
5621
|
invitationId: string;
|
|
5582
5622
|
isResend: boolean;
|
|
5583
5623
|
}>;
|
|
@@ -5612,4 +5652,4 @@ type AuthRegisterPayload = typeof authRegisterEvent._payload;
|
|
|
5612
5652
|
type InvitationCreatedPayload = typeof invitationCreatedEvent._payload;
|
|
5613
5653
|
type InvitationAcceptedPayload = typeof invitationAcceptedEvent._payload;
|
|
5614
5654
|
|
|
5615
|
-
export { type AuthConfig, AuthContext, type AuthLifecycleConfig, type AuthLifecycleOptions, type AuthLoginPayload, type AuthMetadataEntity, AuthMetadataRepository, AuthProviderSchema, type AuthRegisterPayload, COOKIE_NAMES, type CreateOAuthStateParams, type GoogleTokenResponse, type GoogleUserInfo, type Invitation, type InvitationAcceptedPayload, type InvitationCreatedPayload, InvitationStatus, InvitationsRepository, KeyAlgorithmType, type KeyPair, KeysRepository, type NewAuthMetadataEntity, type NewInvitation, type NewPermission, type NewPermissionEntity, type NewRole, type NewRoleEntity, type NewRolePermission, type NewUser, type NewUserPermission, type NewUserProfile, type NewUserPublicKey, type NewUserSocialAccount, type NewVerificationCode, OAuthProvider, type OAuthState, type Permission, type PermissionEntity, PermissionsRepository, type Role, type RoleEntity, type RoleGuardOptions, type RolePermission, RolePermissionsRepository, RolesRepository, type SessionPayload, SocialAccountsRepository, SocialProvider, type TokenPayload, type UpdateProfileParams, type User, type UserPermission, UserPermissionsRepository, type UserProfile, UserProfilesRepository, type UserPublicKey, type UserSocialAccount, UsersRepository, type VerificationCode, VerificationCodesRepository, VerificationPurpose, acceptInvitation, addPermissionToRole, authLogger, authLoginEvent, authMetadata, authMetadataRepository, authRegisterEvent, authSchema, cancelInvitation, checkUsernameAvailableService, configureAuth, createAuthLifecycle, createInvitation, createOAuthState, createRole, decodeToken, deleteInvitation, deleteRole, exchangeCodeForTokens, expireOldInvitations, generateClientToken, generateKeyPair, generateKeyPairES256, generateKeyPairRS256, generateToken, getAllRoles, getAuth, getAuthConfig, getAuthSessionService, getGoogleAuthUrl, getGoogleOAuthConfig, getGoogleUserInfo, getInvitationByToken, getInvitationWithDetails, getKeyId, getKeySize, getLocale, getOneTimeTokenManager, getOptionalAuth, getRole, getRoleByName, getRolePermissions, getSessionTtl, getUser, getUserByEmailService, getUserByIdService, getUserByPhoneService, getUserId, getUserPermissions, getUserProfileService, getUserRole, googleProvider, hasAllPermissions, hasAnyPermission, hasAnyRole, hasPermission, hasRole, hashPassword, initOneTimeTokenManager, initializeAuth, invitationAcceptedEvent, invitationCreatedEvent, invitationsRepository, isGoogleOAuthEnabled, keysRepository, listInvitations, oneTimeTokenAuth, parseDuration, permissions, permissionsRepository, refreshAccessToken, removePermissionFromRole, requireAnyPermission, requirePermissions, requireRole, resendInvitation, roleGuard, rolePermissions, rolePermissionsRepository, roles, rolesRepository, setRolePermissions, shouldRotateKey, socialAccountsRepository, updateLastLoginService, updateLocaleService, updateRole, updateUserProfileService, updateUserService, updateUsernameService, userInvitations, userPermissions, userPermissionsRepository, userProfiles, userProfilesRepository, userPublicKeys, userSocialAccounts, users, usersRepository, validateInvitation, validatePasswordStrength, verificationCodes, verificationCodesRepository, verifyClientToken, verifyKeyFingerprint, verifyOAuthState, verifyPassword, verifyToken };
|
|
5655
|
+
export { type AuthConfig, AuthContext, type AuthLifecycleConfig, type AuthLifecycleOptions, type AuthLoginPayload, type AuthMetadataEntity, AuthMetadataRepository, AuthProviderSchema, type AuthRegisterPayload, COOKIE_NAMES, type CreateOAuthStateParams, type GoogleTokenResponse, type GoogleUserInfo, type Invitation, type InvitationAcceptedPayload, type InvitationCreatedPayload, InvitationStatus, InvitationsRepository, KeyAlgorithmType, type KeyPair, KeysRepository, type NewAuthMetadataEntity, type NewInvitation, type NewPermission, type NewPermissionEntity, type NewRole, type NewRoleEntity, type NewRolePermission, type NewUser, type NewUserPermission, type NewUserProfile, type NewUserPublicKey, type NewUserSocialAccount, type NewVerificationCode, OAuthProvider, type OAuthState, type Permission, type PermissionEntity, PermissionsRepository, type Role, type RoleEntity, type RoleGuardOptions, type RolePermission, RolePermissionsRepository, RolesRepository, type SessionPayload, SocialAccountsRepository, SocialProvider, type TokenPayload, type UpdateProfileParams, type User, type UserPermission, UserPermissionsRepository, type UserProfile, UserProfilesRepository, type UserPublicKey, type UserSocialAccount, UsersRepository, type VerificationCode, VerificationCodesRepository, VerificationPurpose, type VerifyIdTokenParams, acceptInvitation, addPermissionToRole, appleProvider, authLogger, authLoginEvent, authMetadata, authMetadataRepository, authRegisterEvent, authSchema, cancelInvitation, checkUsernameAvailableService, configureAuth, createAuthLifecycle, createInvitation, createOAuthState, createRole, decodeToken, deleteInvitation, deleteRole, exchangeCodeForTokens, expireOldInvitations, generateClientToken, generateKeyPair, generateKeyPairES256, generateKeyPairRS256, generateToken, getAllRoles, getAuth, getAuthConfig, getAuthSessionService, getGoogleAuthUrl, getGoogleOAuthConfig, getGoogleUserInfo, getInvitationByToken, getInvitationWithDetails, getKeyId, getKeySize, getLocale, getOneTimeTokenManager, getOptionalAuth, getRole, getRoleByName, getRolePermissions, getSessionTtl, getUser, getUserByEmailService, getUserByIdService, getUserByPhoneService, getUserId, getUserPermissions, getUserProfileService, getUserRole, googleProvider, hasAllPermissions, hasAnyPermission, hasAnyRole, hasPermission, hasRole, hashPassword, initOneTimeTokenManager, initializeAuth, invitationAcceptedEvent, invitationCreatedEvent, invitationsRepository, isGoogleOAuthEnabled, keysRepository, listInvitations, oneTimeTokenAuth, parseDuration, permissions, permissionsRepository, refreshAccessToken, removePermissionFromRole, requireAnyPermission, requirePermissions, requireRole, resendInvitation, roleGuard, rolePermissions, rolePermissionsRepository, roles, rolesRepository, setRolePermissions, shouldRotateKey, socialAccountsRepository, updateLastLoginService, updateLocaleService, updateRole, updateUserProfileService, updateUserService, updateUsernameService, userInvitations, userPermissions, userPermissionsRepository, userProfiles, userProfilesRepository, userPublicKeys, userSocialAccounts, users, usersRepository, validateInvitation, validatePasswordStrength, verificationCodes, verificationCodesRepository, verifyClientToken, verifyIdToken, verifyKeyFingerprint, verifyOAuthState, verifyPassword, verifyToken };
|