@spfn/auth 0.2.0-beta.64 → 0.2.0-beta.66
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 +296 -2540
- package/dist/{authenticate-mfVRzeIK.d.ts → authenticate-DKGNvSsH.d.ts} +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/server.d.ts +87 -79
- package/dist/server.js +128 -47
- package/dist/server.js.map +1 -1
- package/package.json +7 -5
|
@@ -620,7 +620,7 @@ declare const mainAuthRouter: _spfn_core_route.Router<{
|
|
|
620
620
|
id: number;
|
|
621
621
|
name: string;
|
|
622
622
|
displayName: string;
|
|
623
|
-
category: "
|
|
623
|
+
category: "auth" | "custom" | "user" | "rbac" | "system" | undefined;
|
|
624
624
|
}[];
|
|
625
625
|
userId: number;
|
|
626
626
|
publicId: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as _spfn_core_nextjs from '@spfn/core/nextjs';
|
|
2
|
-
import { R as RoleConfig, P as PermissionConfig, C as CheckAccountExistsResult, S as SendVerificationCodeResult, a as RegisterResult, L as LoginResult, b as RotateKeyResult, I as IssueOneTimeTokenResult, O as OAuthStartResult, U as UserProfile, c as ProfileInfo, m as mainAuthRouter } from './authenticate-
|
|
3
|
-
export { i as AuthInitOptions, A as AuthSession, g as PERMISSION_CATEGORIES, h as PermissionCategory, f as VERIFICATION_PURPOSES, e as VERIFICATION_TARGET_TYPES, d as VerificationPurpose, V as VerificationTargetType } from './authenticate-
|
|
2
|
+
import { R as RoleConfig, P as PermissionConfig, C as CheckAccountExistsResult, S as SendVerificationCodeResult, a as RegisterResult, L as LoginResult, b as RotateKeyResult, I as IssueOneTimeTokenResult, O as OAuthStartResult, U as UserProfile, c as ProfileInfo, m as mainAuthRouter } from './authenticate-DKGNvSsH.js';
|
|
3
|
+
export { i as AuthInitOptions, A as AuthSession, g as PERMISSION_CATEGORIES, h as PermissionCategory, f as VERIFICATION_PURPOSES, e as VERIFICATION_TARGET_TYPES, d as VerificationPurpose, V as VerificationTargetType } from './authenticate-DKGNvSsH.js';
|
|
4
4
|
import * as _spfn_core_route from '@spfn/core/route';
|
|
5
5
|
import { HttpMethod } from '@spfn/core/route';
|
|
6
6
|
export { I as INVITATION_STATUSES, b as InvitationStatus, a as KEY_ALGORITHM, K as KeyAlgorithmType, S as SOCIAL_PROVIDERS, d as SocialProvider, U as USER_STATUSES, c as UserStatus } from './types-B4auHIax.js';
|
|
@@ -170,7 +170,7 @@ declare const authApi: _spfn_core_nextjs.Client<_spfn_core_route.Router<{
|
|
|
170
170
|
id: number;
|
|
171
171
|
name: string;
|
|
172
172
|
displayName: string;
|
|
173
|
-
category: "
|
|
173
|
+
category: "auth" | "custom" | "user" | "rbac" | "system" | undefined;
|
|
174
174
|
}[];
|
|
175
175
|
userId: number;
|
|
176
176
|
publicId: string;
|
package/dist/server.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { i as AuthInitOptions, j as OAuthProvider, d as VerificationPurpose, h as PermissionCategory, k as AuthContext } from './authenticate-
|
|
2
|
-
export { v as ChangePasswordParams, q as CheckAccountExistsParams, C as CheckAccountExistsResult, a3 as EmailSchema, I as IssueOneTimeTokenResult, t as LoginParams, L as LoginResult, u as LogoutParams, a8 as NormalizedIdentity, $ as OAuthCallbackParams, a0 as OAuthCallbackResult, _ as OAuthStartParams, O as OAuthStartResult, a9 as OAuthTokens, a5 as PasswordSchema, a4 as PhoneSchema, s as RegisterParams, G as RegisterPublicKeyParams, a as RegisterResult, J as RevokeKeyParams, H as RotateKeyParams, b as RotateKeyResult, y as SendVerificationCodeParams, S as SendVerificationCodeResult, a6 as TargetTypeSchema, f as VERIFICATION_PURPOSES, e as VERIFICATION_TARGET_TYPES, a7 as VerificationPurposeSchema, V as VerificationTargetType, z as VerifyCodeParams, B as VerifyCodeResult, m as authRouter, a1 as authenticate, T as buildOAuthErrorUrl, p as changePasswordService, l as checkAccountExistsService, Y as getEnabledOAuthProviders, Z as getGoogleAccessToken, ab as getOAuthProvider, ac as getRegisteredProviders, W as isOAuthProviderEnabled, K as issueOneTimeTokenService, n as loginService, o as logoutService, Q as oauthCallbackService, N as oauthStartService, a2 as optionalAuth, aa as registerOAuthProvider, D as registerPublicKeyService, r as registerService, X as requireEnabledProvider, F as revokeKeyService, E as rotateKeyService, w as sendVerificationCodeService, x as verifyCodeService, M as verifyOneTimeTokenService } from './authenticate-
|
|
1
|
+
import { i as AuthInitOptions, j as OAuthProvider, d as VerificationPurpose, h as PermissionCategory, k as AuthContext } from './authenticate-DKGNvSsH.js';
|
|
2
|
+
export { v as ChangePasswordParams, q as CheckAccountExistsParams, C as CheckAccountExistsResult, a3 as EmailSchema, I as IssueOneTimeTokenResult, t as LoginParams, L as LoginResult, u as LogoutParams, a8 as NormalizedIdentity, $ as OAuthCallbackParams, a0 as OAuthCallbackResult, _ as OAuthStartParams, O as OAuthStartResult, a9 as OAuthTokens, a5 as PasswordSchema, a4 as PhoneSchema, s as RegisterParams, G as RegisterPublicKeyParams, a as RegisterResult, J as RevokeKeyParams, H as RotateKeyParams, b as RotateKeyResult, y as SendVerificationCodeParams, S as SendVerificationCodeResult, a6 as TargetTypeSchema, f as VERIFICATION_PURPOSES, e as VERIFICATION_TARGET_TYPES, a7 as VerificationPurposeSchema, V as VerificationTargetType, z as VerifyCodeParams, B as VerifyCodeResult, m as authRouter, a1 as authenticate, T as buildOAuthErrorUrl, p as changePasswordService, l as checkAccountExistsService, Y as getEnabledOAuthProviders, Z as getGoogleAccessToken, ab as getOAuthProvider, ac as getRegisteredProviders, W as isOAuthProviderEnabled, K as issueOneTimeTokenService, n as loginService, o as logoutService, Q as oauthCallbackService, N as oauthStartService, a2 as optionalAuth, aa as registerOAuthProvider, D as registerPublicKeyService, r as registerService, X as requireEnabledProvider, F as revokeKeyService, E as rotateKeyService, w as sendVerificationCodeService, x as verifyCodeService, M as verifyOneTimeTokenService } from './authenticate-DKGNvSsH.js';
|
|
3
3
|
import * as drizzle_orm_pg_core from 'drizzle-orm/pg-core';
|
|
4
4
|
import { K as KeyAlgorithmType, b as InvitationStatus, d as SocialProvider } from './types-B4auHIax.js';
|
|
5
5
|
export { I as INVITATION_STATUSES, a as KEY_ALGORITHM, S as SOCIAL_PROVIDERS, U as USER_STATUSES, c as UserStatus } from './types-B4auHIax.js';
|
|
@@ -1333,7 +1333,7 @@ declare function getAuthSessionService(userId: string | number | bigint): Promis
|
|
|
1333
1333
|
id: number;
|
|
1334
1334
|
name: string;
|
|
1335
1335
|
displayName: string;
|
|
1336
|
-
category: "
|
|
1336
|
+
category: "auth" | "custom" | "user" | "rbac" | "system" | undefined;
|
|
1337
1337
|
}[];
|
|
1338
1338
|
userId: number;
|
|
1339
1339
|
publicId: string;
|
|
@@ -2595,7 +2595,7 @@ declare const permissions: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
2595
2595
|
tableName: "permissions";
|
|
2596
2596
|
dataType: "string";
|
|
2597
2597
|
columnType: "PgText";
|
|
2598
|
-
data: "
|
|
2598
|
+
data: "auth" | "custom" | "user" | "rbac" | "system";
|
|
2599
2599
|
driverParam: string;
|
|
2600
2600
|
notNull: false;
|
|
2601
2601
|
hasDefault: false;
|
|
@@ -3188,15 +3188,15 @@ declare class UsersRepository extends BaseRepository {
|
|
|
3188
3188
|
create(data: NewUser): Promise<{
|
|
3189
3189
|
email: string | null;
|
|
3190
3190
|
phone: string | null;
|
|
3191
|
-
status: "active" | "inactive" | "suspended";
|
|
3192
|
-
username: string | null;
|
|
3193
3191
|
id: number;
|
|
3194
|
-
createdAt: Date;
|
|
3195
|
-
updatedAt: Date;
|
|
3196
3192
|
publicId: string;
|
|
3193
|
+
username: string | null;
|
|
3197
3194
|
passwordHash: string | null;
|
|
3198
3195
|
passwordChangeRequired: boolean;
|
|
3199
3196
|
roleId: number;
|
|
3197
|
+
createdAt: Date;
|
|
3198
|
+
updatedAt: Date;
|
|
3199
|
+
status: "active" | "inactive" | "suspended";
|
|
3200
3200
|
emailVerifiedAt: Date | null;
|
|
3201
3201
|
phoneVerifiedAt: Date | null;
|
|
3202
3202
|
lastLoginAt: Date | null;
|
|
@@ -3268,15 +3268,15 @@ declare class UsersRepository extends BaseRepository {
|
|
|
3268
3268
|
deleteById(id: number): Promise<{
|
|
3269
3269
|
email: string | null;
|
|
3270
3270
|
phone: string | null;
|
|
3271
|
-
status: "active" | "inactive" | "suspended";
|
|
3272
|
-
username: string | null;
|
|
3273
3271
|
id: number;
|
|
3274
|
-
createdAt: Date;
|
|
3275
|
-
updatedAt: Date;
|
|
3276
3272
|
publicId: string;
|
|
3273
|
+
username: string | null;
|
|
3277
3274
|
passwordHash: string | null;
|
|
3278
3275
|
passwordChangeRequired: boolean;
|
|
3279
3276
|
roleId: number;
|
|
3277
|
+
createdAt: Date;
|
|
3278
|
+
updatedAt: Date;
|
|
3279
|
+
status: "active" | "inactive" | "suspended";
|
|
3280
3280
|
emailVerifiedAt: Date | null;
|
|
3281
3281
|
phoneVerifiedAt: Date | null;
|
|
3282
3282
|
lastLoginAt: Date | null;
|
|
@@ -3299,7 +3299,7 @@ declare class UsersRepository extends BaseRepository {
|
|
|
3299
3299
|
id: number;
|
|
3300
3300
|
name: string;
|
|
3301
3301
|
displayName: string;
|
|
3302
|
-
category: "
|
|
3302
|
+
category: "auth" | "custom" | "user" | "rbac" | "system" | undefined;
|
|
3303
3303
|
}[];
|
|
3304
3304
|
}>;
|
|
3305
3305
|
/**
|
|
@@ -3414,16 +3414,16 @@ declare class KeysRepository extends BaseRepository {
|
|
|
3414
3414
|
* Write primary 사용
|
|
3415
3415
|
*/
|
|
3416
3416
|
create(data: NewUserPublicKey): Promise<{
|
|
3417
|
-
|
|
3417
|
+
publicKey: string;
|
|
3418
3418
|
keyId: string;
|
|
3419
|
+
fingerprint: string;
|
|
3420
|
+
algorithm: "ES256" | "RS256";
|
|
3421
|
+
userId: number;
|
|
3419
3422
|
id: number;
|
|
3420
3423
|
isActive: boolean;
|
|
3421
3424
|
createdAt: Date;
|
|
3422
|
-
publicKey: string;
|
|
3423
|
-
algorithm: "ES256" | "RS256";
|
|
3424
|
-
fingerprint: string;
|
|
3425
|
-
lastUsedAt: Date | null;
|
|
3426
3425
|
expiresAt: Date | null;
|
|
3426
|
+
lastUsedAt: Date | null;
|
|
3427
3427
|
revokedAt: Date | null;
|
|
3428
3428
|
revokedReason: string | null;
|
|
3429
3429
|
}>;
|
|
@@ -3450,16 +3450,16 @@ declare class KeysRepository extends BaseRepository {
|
|
|
3450
3450
|
* Write primary 사용
|
|
3451
3451
|
*/
|
|
3452
3452
|
deleteByKeyIdAndUserId(keyId: string, userId: number): Promise<{
|
|
3453
|
-
|
|
3453
|
+
publicKey: string;
|
|
3454
3454
|
keyId: string;
|
|
3455
|
+
fingerprint: string;
|
|
3456
|
+
algorithm: "ES256" | "RS256";
|
|
3457
|
+
userId: number;
|
|
3455
3458
|
id: number;
|
|
3456
3459
|
isActive: boolean;
|
|
3457
3460
|
createdAt: Date;
|
|
3458
|
-
publicKey: string;
|
|
3459
|
-
algorithm: "ES256" | "RS256";
|
|
3460
|
-
fingerprint: string;
|
|
3461
|
-
lastUsedAt: Date | null;
|
|
3462
3461
|
expiresAt: Date | null;
|
|
3462
|
+
lastUsedAt: Date | null;
|
|
3463
3463
|
revokedAt: Date | null;
|
|
3464
3464
|
revokedReason: string | null;
|
|
3465
3465
|
}>;
|
|
@@ -3574,14 +3574,14 @@ declare class VerificationCodesRepository extends BaseRepository {
|
|
|
3574
3574
|
* Write primary 사용
|
|
3575
3575
|
*/
|
|
3576
3576
|
create(data: NewVerificationCode): Promise<{
|
|
3577
|
+
target: string;
|
|
3578
|
+
targetType: "email" | "phone";
|
|
3579
|
+
purpose: "registration" | "login" | "password_reset" | "email_change" | "phone_change";
|
|
3580
|
+
code: string;
|
|
3577
3581
|
id: number;
|
|
3578
3582
|
createdAt: Date;
|
|
3579
3583
|
updatedAt: Date;
|
|
3580
3584
|
expiresAt: Date;
|
|
3581
|
-
target: string;
|
|
3582
|
-
targetType: "email" | "phone";
|
|
3583
|
-
code: string;
|
|
3584
|
-
purpose: "registration" | "login" | "password_reset" | "email_change" | "phone_change";
|
|
3585
3585
|
usedAt: Date | null;
|
|
3586
3586
|
attempts: number;
|
|
3587
3587
|
}>;
|
|
@@ -3770,7 +3770,7 @@ declare class PermissionsRepository extends BaseRepository {
|
|
|
3770
3770
|
name: string;
|
|
3771
3771
|
displayName: string;
|
|
3772
3772
|
description: string | null;
|
|
3773
|
-
category: "
|
|
3773
|
+
category: "auth" | "custom" | "user" | "rbac" | "system" | null;
|
|
3774
3774
|
isBuiltin: boolean;
|
|
3775
3775
|
isSystem: boolean;
|
|
3776
3776
|
isActive: boolean;
|
|
@@ -3786,7 +3786,7 @@ declare class PermissionsRepository extends BaseRepository {
|
|
|
3786
3786
|
name: string;
|
|
3787
3787
|
displayName: string;
|
|
3788
3788
|
description: string | null;
|
|
3789
|
-
category: "
|
|
3789
|
+
category: "auth" | "custom" | "user" | "rbac" | "system" | null;
|
|
3790
3790
|
isBuiltin: boolean;
|
|
3791
3791
|
isSystem: boolean;
|
|
3792
3792
|
isActive: boolean;
|
|
@@ -3826,7 +3826,7 @@ declare class PermissionsRepository extends BaseRepository {
|
|
|
3826
3826
|
name: string;
|
|
3827
3827
|
displayName: string;
|
|
3828
3828
|
description: string | null;
|
|
3829
|
-
category: "
|
|
3829
|
+
category: "auth" | "custom" | "user" | "rbac" | "system" | null;
|
|
3830
3830
|
isBuiltin: boolean;
|
|
3831
3831
|
isSystem: boolean;
|
|
3832
3832
|
isActive: boolean;
|
|
@@ -3837,6 +3837,7 @@ declare class PermissionsRepository extends BaseRepository {
|
|
|
3837
3837
|
*/
|
|
3838
3838
|
deleteById(id: number): Promise<{
|
|
3839
3839
|
description: string | null;
|
|
3840
|
+
metadata: Record<string, any> | null;
|
|
3840
3841
|
id: number;
|
|
3841
3842
|
name: string;
|
|
3842
3843
|
displayName: string;
|
|
@@ -3845,8 +3846,7 @@ declare class PermissionsRepository extends BaseRepository {
|
|
|
3845
3846
|
isActive: boolean;
|
|
3846
3847
|
createdAt: Date;
|
|
3847
3848
|
updatedAt: Date;
|
|
3848
|
-
|
|
3849
|
-
category: "custom" | "user" | "auth" | "rbac" | "system" | null;
|
|
3849
|
+
category: "auth" | "custom" | "user" | "rbac" | "system" | null;
|
|
3850
3850
|
}>;
|
|
3851
3851
|
}
|
|
3852
3852
|
declare const permissionsRepository: PermissionsRepository;
|
|
@@ -3891,9 +3891,9 @@ declare class RolePermissionsRepository extends BaseRepository {
|
|
|
3891
3891
|
*/
|
|
3892
3892
|
createMany(data: NewRolePermission[]): Promise<{
|
|
3893
3893
|
id: number;
|
|
3894
|
+
roleId: number;
|
|
3894
3895
|
createdAt: Date;
|
|
3895
3896
|
updatedAt: Date;
|
|
3896
|
-
roleId: number;
|
|
3897
3897
|
permissionId: number;
|
|
3898
3898
|
}[]>;
|
|
3899
3899
|
/**
|
|
@@ -3909,9 +3909,9 @@ declare class RolePermissionsRepository extends BaseRepository {
|
|
|
3909
3909
|
*/
|
|
3910
3910
|
setPermissionsForRole(roleId: number, permissionIds: number[]): Promise<{
|
|
3911
3911
|
id: number;
|
|
3912
|
+
roleId: number;
|
|
3912
3913
|
createdAt: Date;
|
|
3913
3914
|
updatedAt: Date;
|
|
3914
|
-
roleId: number;
|
|
3915
3915
|
permissionId: number;
|
|
3916
3916
|
}[]>;
|
|
3917
3917
|
}
|
|
@@ -3976,10 +3976,10 @@ declare class UserPermissionsRepository extends BaseRepository {
|
|
|
3976
3976
|
id: number;
|
|
3977
3977
|
createdAt: Date;
|
|
3978
3978
|
updatedAt: Date;
|
|
3979
|
-
expiresAt: Date | null;
|
|
3980
3979
|
permissionId: number;
|
|
3981
|
-
|
|
3980
|
+
expiresAt: Date | null;
|
|
3982
3981
|
reason: string | null;
|
|
3982
|
+
granted: boolean;
|
|
3983
3983
|
}>;
|
|
3984
3984
|
/**
|
|
3985
3985
|
* 사용자 권한 오버라이드 업데이트
|
|
@@ -4002,10 +4002,10 @@ declare class UserPermissionsRepository extends BaseRepository {
|
|
|
4002
4002
|
id: number;
|
|
4003
4003
|
createdAt: Date;
|
|
4004
4004
|
updatedAt: Date;
|
|
4005
|
-
expiresAt: Date | null;
|
|
4006
4005
|
permissionId: number;
|
|
4007
|
-
|
|
4006
|
+
expiresAt: Date | null;
|
|
4008
4007
|
reason: string | null;
|
|
4008
|
+
granted: boolean;
|
|
4009
4009
|
}>;
|
|
4010
4010
|
/**
|
|
4011
4011
|
* 사용자의 모든 권한 오버라이드 삭제
|
|
@@ -4083,6 +4083,7 @@ declare class UserProfilesRepository extends BaseRepository {
|
|
|
4083
4083
|
* 프로필 생성
|
|
4084
4084
|
*/
|
|
4085
4085
|
create(data: NewUserProfile): Promise<{
|
|
4086
|
+
metadata: Record<string, any> | null;
|
|
4086
4087
|
userId: number;
|
|
4087
4088
|
id: number;
|
|
4088
4089
|
displayName: string | null;
|
|
@@ -4100,7 +4101,6 @@ declare class UserProfilesRepository extends BaseRepository {
|
|
|
4100
4101
|
location: string | null;
|
|
4101
4102
|
company: string | null;
|
|
4102
4103
|
jobTitle: string | null;
|
|
4103
|
-
metadata: Record<string, any> | null;
|
|
4104
4104
|
}>;
|
|
4105
4105
|
/**
|
|
4106
4106
|
* 프로필 업데이트 (by ID)
|
|
@@ -4152,6 +4152,7 @@ declare class UserProfilesRepository extends BaseRepository {
|
|
|
4152
4152
|
* 프로필 삭제 (by ID)
|
|
4153
4153
|
*/
|
|
4154
4154
|
deleteById(id: number): Promise<{
|
|
4155
|
+
metadata: Record<string, any> | null;
|
|
4155
4156
|
userId: number;
|
|
4156
4157
|
id: number;
|
|
4157
4158
|
displayName: string | null;
|
|
@@ -4169,12 +4170,12 @@ declare class UserProfilesRepository extends BaseRepository {
|
|
|
4169
4170
|
location: string | null;
|
|
4170
4171
|
company: string | null;
|
|
4171
4172
|
jobTitle: string | null;
|
|
4172
|
-
metadata: Record<string, any> | null;
|
|
4173
4173
|
}>;
|
|
4174
4174
|
/**
|
|
4175
4175
|
* 프로필 삭제 (by User ID)
|
|
4176
4176
|
*/
|
|
4177
4177
|
deleteByUserId(userId: number): Promise<{
|
|
4178
|
+
metadata: Record<string, any> | null;
|
|
4178
4179
|
userId: number;
|
|
4179
4180
|
id: number;
|
|
4180
4181
|
displayName: string | null;
|
|
@@ -4192,7 +4193,6 @@ declare class UserProfilesRepository extends BaseRepository {
|
|
|
4192
4193
|
location: string | null;
|
|
4193
4194
|
company: string | null;
|
|
4194
4195
|
jobTitle: string | null;
|
|
4195
|
-
metadata: Record<string, any> | null;
|
|
4196
4196
|
}>;
|
|
4197
4197
|
/**
|
|
4198
4198
|
* 프로필 Upsert (by User ID)
|
|
@@ -4201,6 +4201,7 @@ declare class UserProfilesRepository extends BaseRepository {
|
|
|
4201
4201
|
* 새로 생성 시 displayName은 필수 (없으면 'User'로 설정)
|
|
4202
4202
|
*/
|
|
4203
4203
|
upsertByUserId(userId: number, data: Partial<Omit<NewUserProfile, 'userId'>>): Promise<{
|
|
4204
|
+
metadata: Record<string, any> | null;
|
|
4204
4205
|
userId: number;
|
|
4205
4206
|
id: number;
|
|
4206
4207
|
displayName: string | null;
|
|
@@ -4218,7 +4219,6 @@ declare class UserProfilesRepository extends BaseRepository {
|
|
|
4218
4219
|
location: string | null;
|
|
4219
4220
|
company: string | null;
|
|
4220
4221
|
jobTitle: string | null;
|
|
4221
|
-
metadata: Record<string, any> | null;
|
|
4222
4222
|
}>;
|
|
4223
4223
|
/**
|
|
4224
4224
|
* User ID로 프로필 데이터 조회 (formatted)
|
|
@@ -4346,15 +4346,15 @@ declare class InvitationsRepository extends BaseRepository {
|
|
|
4346
4346
|
*/
|
|
4347
4347
|
create(data: NewInvitation): Promise<{
|
|
4348
4348
|
email: string;
|
|
4349
|
-
|
|
4349
|
+
metadata: Record<string, any> | null;
|
|
4350
4350
|
id: number;
|
|
4351
|
+
roleId: number;
|
|
4351
4352
|
createdAt: Date;
|
|
4352
4353
|
updatedAt: Date;
|
|
4353
|
-
|
|
4354
|
-
metadata: Record<string, any> | null;
|
|
4355
|
-
expiresAt: Date;
|
|
4354
|
+
status: "pending" | "accepted" | "expired" | "cancelled";
|
|
4356
4355
|
token: string;
|
|
4357
4356
|
invitedBy: number;
|
|
4357
|
+
expiresAt: Date;
|
|
4358
4358
|
acceptedAt: Date | null;
|
|
4359
4359
|
cancelledAt: Date | null;
|
|
4360
4360
|
}>;
|
|
@@ -4380,15 +4380,15 @@ declare class InvitationsRepository extends BaseRepository {
|
|
|
4380
4380
|
*/
|
|
4381
4381
|
deleteById(id: number): Promise<{
|
|
4382
4382
|
email: string;
|
|
4383
|
-
|
|
4383
|
+
metadata: Record<string, any> | null;
|
|
4384
4384
|
id: number;
|
|
4385
|
+
roleId: number;
|
|
4385
4386
|
createdAt: Date;
|
|
4386
4387
|
updatedAt: Date;
|
|
4387
|
-
|
|
4388
|
-
metadata: Record<string, any> | null;
|
|
4389
|
-
expiresAt: Date;
|
|
4388
|
+
status: "pending" | "accepted" | "expired" | "cancelled";
|
|
4390
4389
|
token: string;
|
|
4391
4390
|
invitedBy: number;
|
|
4391
|
+
expiresAt: Date;
|
|
4392
4392
|
acceptedAt: Date | null;
|
|
4393
4393
|
cancelledAt: Date | null;
|
|
4394
4394
|
}>;
|
|
@@ -4524,59 +4524,69 @@ declare const invitationsRepository: InvitationsRepository;
|
|
|
4524
4524
|
* Social Accounts Repository 클래스
|
|
4525
4525
|
*/
|
|
4526
4526
|
declare class SocialAccountsRepository extends BaseRepository {
|
|
4527
|
+
/**
|
|
4528
|
+
* 저장 row 의 토큰을 평문으로 복호화해 반환한다.
|
|
4529
|
+
*
|
|
4530
|
+
* 레거시 평문(마커 없음)이 감지되면 즉시 재암호화해 저장하는
|
|
4531
|
+
* self-healing 마이그레이션을 수행한다. 호출자에게는 항상 평문이 반환되어
|
|
4532
|
+
* 외부 API 계약(평문 토큰)이 유지된다.
|
|
4533
|
+
*/
|
|
4534
|
+
private decryptAccount;
|
|
4527
4535
|
/**
|
|
4528
4536
|
* provider와 providerUserId로 소셜 계정 조회
|
|
4529
4537
|
* Read replica 사용
|
|
4530
4538
|
*/
|
|
4531
4539
|
findByProviderAndProviderId(provider: SocialProvider, providerUserId: string): Promise<{
|
|
4540
|
+
accessToken: string | null;
|
|
4541
|
+
refreshToken: string | null;
|
|
4542
|
+
userId: number;
|
|
4543
|
+
id: number;
|
|
4532
4544
|
createdAt: Date;
|
|
4533
4545
|
updatedAt: Date;
|
|
4534
|
-
id: number;
|
|
4535
|
-
userId: number;
|
|
4536
4546
|
provider: "google" | "github" | "kakao" | "naver" | "superself";
|
|
4537
4547
|
providerUserId: string;
|
|
4538
4548
|
providerEmail: string | null;
|
|
4539
|
-
accessToken: string | null;
|
|
4540
|
-
refreshToken: string | null;
|
|
4541
4549
|
tokenExpiresAt: Date | null;
|
|
4542
|
-
}>;
|
|
4550
|
+
} | null>;
|
|
4543
4551
|
/**
|
|
4544
4552
|
* userId로 모든 소셜 계정 조회
|
|
4545
4553
|
* Read replica 사용
|
|
4546
4554
|
*/
|
|
4547
|
-
findByUserId(userId: number): Promise<{
|
|
4555
|
+
findByUserId(userId: number): Promise<({
|
|
4556
|
+
accessToken: string | null;
|
|
4557
|
+
refreshToken: string | null;
|
|
4558
|
+
userId: number;
|
|
4559
|
+
id: number;
|
|
4548
4560
|
createdAt: Date;
|
|
4549
4561
|
updatedAt: Date;
|
|
4550
|
-
id: number;
|
|
4551
|
-
userId: number;
|
|
4552
4562
|
provider: "google" | "github" | "kakao" | "naver" | "superself";
|
|
4553
4563
|
providerUserId: string;
|
|
4554
4564
|
providerEmail: string | null;
|
|
4555
|
-
accessToken: string | null;
|
|
4556
|
-
refreshToken: string | null;
|
|
4557
4565
|
tokenExpiresAt: Date | null;
|
|
4558
|
-
}[]>;
|
|
4566
|
+
} | null)[]>;
|
|
4559
4567
|
/**
|
|
4560
4568
|
* userId와 provider로 소셜 계정 조회
|
|
4561
4569
|
* Read replica 사용
|
|
4562
4570
|
*/
|
|
4563
4571
|
findByUserIdAndProvider(userId: number, provider: SocialProvider): Promise<{
|
|
4572
|
+
accessToken: string | null;
|
|
4573
|
+
refreshToken: string | null;
|
|
4574
|
+
userId: number;
|
|
4575
|
+
id: number;
|
|
4564
4576
|
createdAt: Date;
|
|
4565
4577
|
updatedAt: Date;
|
|
4566
|
-
id: number;
|
|
4567
|
-
userId: number;
|
|
4568
4578
|
provider: "google" | "github" | "kakao" | "naver" | "superself";
|
|
4569
4579
|
providerUserId: string;
|
|
4570
4580
|
providerEmail: string | null;
|
|
4571
|
-
accessToken: string | null;
|
|
4572
|
-
refreshToken: string | null;
|
|
4573
4581
|
tokenExpiresAt: Date | null;
|
|
4574
|
-
}>;
|
|
4582
|
+
} | null>;
|
|
4575
4583
|
/**
|
|
4576
4584
|
* 소셜 계정 생성
|
|
4577
4585
|
* Write primary 사용
|
|
4578
4586
|
*/
|
|
4579
4587
|
create(data: NewUserSocialAccount): Promise<{
|
|
4588
|
+
accessToken: string | null;
|
|
4589
|
+
refreshToken: string | null;
|
|
4580
4590
|
userId: number;
|
|
4581
4591
|
id: number;
|
|
4582
4592
|
createdAt: Date;
|
|
@@ -4584,10 +4594,8 @@ declare class SocialAccountsRepository extends BaseRepository {
|
|
|
4584
4594
|
provider: "google" | "github" | "kakao" | "naver" | "superself";
|
|
4585
4595
|
providerUserId: string;
|
|
4586
4596
|
providerEmail: string | null;
|
|
4587
|
-
accessToken: string | null;
|
|
4588
|
-
refreshToken: string | null;
|
|
4589
4597
|
tokenExpiresAt: Date | null;
|
|
4590
|
-
}>;
|
|
4598
|
+
} | null>;
|
|
4591
4599
|
/**
|
|
4592
4600
|
* 토큰 정보 업데이트
|
|
4593
4601
|
* Write primary 사용
|
|
@@ -4597,17 +4605,17 @@ declare class SocialAccountsRepository extends BaseRepository {
|
|
|
4597
4605
|
refreshToken?: string | null;
|
|
4598
4606
|
tokenExpiresAt?: Date | null;
|
|
4599
4607
|
}): Promise<{
|
|
4608
|
+
accessToken: string | null;
|
|
4609
|
+
refreshToken: string | null;
|
|
4610
|
+
userId: number;
|
|
4611
|
+
id: number;
|
|
4600
4612
|
createdAt: Date;
|
|
4601
4613
|
updatedAt: Date;
|
|
4602
|
-
id: number;
|
|
4603
|
-
userId: number;
|
|
4604
4614
|
provider: "google" | "github" | "kakao" | "naver" | "superself";
|
|
4605
4615
|
providerUserId: string;
|
|
4606
4616
|
providerEmail: string | null;
|
|
4607
|
-
accessToken: string | null;
|
|
4608
|
-
refreshToken: string | null;
|
|
4609
4617
|
tokenExpiresAt: Date | null;
|
|
4610
|
-
}>;
|
|
4618
|
+
} | null>;
|
|
4611
4619
|
/**
|
|
4612
4620
|
* 소셜 계정 삭제
|
|
4613
4621
|
* Write primary 사용
|
|
@@ -5097,15 +5105,15 @@ declare function getUser(c: Context | {
|
|
|
5097
5105
|
}): {
|
|
5098
5106
|
email: string | null;
|
|
5099
5107
|
phone: string | null;
|
|
5100
|
-
status: "active" | "inactive" | "suspended";
|
|
5101
|
-
username: string | null;
|
|
5102
5108
|
id: number;
|
|
5103
|
-
createdAt: Date;
|
|
5104
|
-
updatedAt: Date;
|
|
5105
5109
|
publicId: string;
|
|
5110
|
+
username: string | null;
|
|
5106
5111
|
passwordHash: string | null;
|
|
5107
5112
|
passwordChangeRequired: boolean;
|
|
5108
5113
|
roleId: number;
|
|
5114
|
+
createdAt: Date;
|
|
5115
|
+
updatedAt: Date;
|
|
5116
|
+
status: "active" | "inactive" | "suspended";
|
|
5109
5117
|
emailVerifiedAt: Date | null;
|
|
5110
5118
|
phoneVerifiedAt: Date | null;
|
|
5111
5119
|
lastLoginAt: Date | null;
|
|
@@ -5567,9 +5575,9 @@ declare const invitationCreatedEvent: _spfn_core_event.EventDef<{
|
|
|
5567
5575
|
} | undefined;
|
|
5568
5576
|
email: string;
|
|
5569
5577
|
roleId: number;
|
|
5570
|
-
expiresAt: string;
|
|
5571
5578
|
token: string;
|
|
5572
5579
|
invitedBy: string;
|
|
5580
|
+
expiresAt: string;
|
|
5573
5581
|
invitationId: string;
|
|
5574
5582
|
isResend: boolean;
|
|
5575
5583
|
}>;
|