@spfn/auth 0.3.0-beta.6 → 0.3.0-beta.7
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 +64 -0
- package/dist/{authenticate-98lBIMxP.d.ts → authenticate-Mg9D7Nys.d.ts} +60 -7
- package/dist/index.d.ts +6 -6
- package/dist/server.d.ts +87 -87
- package/dist/server.js +18 -1
- package/dist/server.js.map +1 -1
- package/package.json +1 -1
package/dist/server.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as AuthInitOptions, n as OAuthProvider, k as VerificationPurpose, i as PermissionCategory, o as AuthContext } from './authenticate-
|
|
2
|
-
export { p as AuthProfileOutcome, q as AuthProfileVerifier, r as ChangePasswordParams, s as CompleteSignupParams, t as ConfirmSignupLinkParams, C as ConfirmSignupLinkResult, D as DeviceNameSchema, E as EmailSchema, I as IssueOneTimeTokenResult, u as KEY_FINGERPRINT_PREFIX_LENGTH, K as KeySummary, v as LoginParams, L as LoginResult, w as LogoutParams, N as NativeVerifyOptions, x as NormalizedIdentity, y as OAuthCallbackParams, z as OAuthCallbackResult, B as OAuthCodeExchangeOptions, F as OAuthNativeParams, e as OAuthNativeResult, G as OAuthStartParams, O as OAuthStartResult, H as OAuthTokens, J as PasswordSchema, M as PhoneSchema, Q as PlatformSchema, T as RegisterParams, W as RegisterPublicKeyParams, a as RegisterResult, X as RequestSignupLinkParams, b as RequestSignupLinkResult, Y as RevokeAllKeysParams, d as RevokeAllKeysResult, Z as RevokeKeyParams, _ as RotateKeyParams, c as RotateKeyResult, $ as SendVerificationCodeParams, S as SendVerificationCodeResult, a0 as TargetTypeSchema, a1 as UnlinkNotification, a2 as UnlinkNotifyRejection, a3 as UnlinkNotifyRequest, a4 as UnlinkNotifyResult, V as VERIFICATION_PURPOSES, j as VERIFICATION_TARGET_TYPES, a5 as VerificationPurposeSchema, l as VerificationTargetType, a6 as VerifyCodeParams, a7 as VerifyCodeResult, m as authRouter, a8 as authenticate, a9 as buildOAuthErrorUrl, aa as changePasswordService, ab as completeSignupService, ac as confirmSignupLinkService, ad as getEnabledOAuthProviders, ae as getGoogleAccessToken, af as getOAuthProvider, ag as getRegisteredProviders, ah as isOAuthProviderEnabled, ai as isSafeReturnPath, aj as issueOneTimeTokenService, ak as listKeysService, al as loginService, am as logoutService, an as oauthCallbackService, ao as oauthNativeService, ap as oauthStartService, aq as oauthUnlinkNotifyService, ar as optionalAuth, as as
|
|
1
|
+
import { A as AuthInitOptions, n as OAuthProvider, k as VerificationPurpose, i as PermissionCategory, o as AuthContext } from './authenticate-Mg9D7Nys.js';
|
|
2
|
+
export { p as AuthProfileOutcome, q as AuthProfileVerifier, r as ChangePasswordParams, s as CompleteSignupParams, t as ConfirmSignupLinkParams, C as ConfirmSignupLinkResult, D as DeviceNameSchema, E as EmailSchema, I as IssueOneTimeTokenResult, u as KEY_FINGERPRINT_PREFIX_LENGTH, K as KeySummary, v as LoginParams, L as LoginResult, w as LogoutParams, N as NativeVerifyOptions, x as NormalizedIdentity, y as OAuthCallbackParams, z as OAuthCallbackResult, B as OAuthCodeExchangeOptions, F as OAuthNativeParams, e as OAuthNativeResult, G as OAuthStartParams, O as OAuthStartResult, H as OAuthTokens, J as PasswordSchema, M as PhoneSchema, Q as PlatformSchema, T as RegisterParams, W as RegisterPublicKeyParams, a as RegisterResult, X as RequestSignupLinkParams, b as RequestSignupLinkResult, Y as RevokeAllKeysParams, d as RevokeAllKeysResult, Z as RevokeKeyParams, _ as RotateKeyParams, c as RotateKeyResult, $ as SendVerificationCodeParams, S as SendVerificationCodeResult, a0 as TargetTypeSchema, a1 as UnlinkNotification, a2 as UnlinkNotifyRejection, a3 as UnlinkNotifyRequest, a4 as UnlinkNotifyResult, V as VERIFICATION_PURPOSES, j as VERIFICATION_TARGET_TYPES, a5 as VerificationPurposeSchema, l as VerificationTargetType, a6 as VerifyCodeParams, a7 as VerifyCodeResult, m as authRouter, a8 as authenticate, a9 as buildOAuthErrorUrl, aa as changePasswordService, ab as completeSignupService, ac as confirmSignupLinkService, ad as getEnabledOAuthProviders, ae as getGoogleAccessToken, af as getOAuthProvider, ag as getRegisteredProviders, ah as isOAuthProviderEnabled, ai as isSafeReturnPath, aj as issueOneTimeTokenService, ak as listKeysService, al as loginService, am as logoutService, an as oauthCallbackService, ao as oauthNativeService, ap as oauthStartService, aq as oauthUnlinkNotifyService, ar as optionalAuth, as as registerAuthProfile, at as registerOAuthProvider, au as registerPublicKeyService, av as registerService, aw as requestSignupLinkService, ax as requireEnabledProvider, ay as resolveAuthenticatedUser, az as revokeAllKeysService, aA as revokeKeyService, aB as rotateKeyService, aC as runAuthProfile, aD as selectAuthProfile, aE as sendVerificationCodeService, aF as verifyCodeService, aG as verifyOneTimeTokenService } from './authenticate-Mg9D7Nys.js';
|
|
3
3
|
import * as drizzle_orm_pg_core from 'drizzle-orm/pg-core';
|
|
4
4
|
import { K as KeyAlgorithmType, d as InvitationStatus, j as SocialProvider, c as AccountDeletionRequestedBy, i as PurgeStrategy } from './types-DYyhze28.js';
|
|
5
5
|
export { A as ACCOUNT_DELETION_REQUESTED_BY, a as ACCOUNT_DELETION_REQUEST_STATUSES, b as AccountDeletionRequestStatus, I as INVITATION_STATUSES, e as KEY_ALGORITHM, f as KEY_DEVICE_NAME_MAX_LENGTH, g as KEY_PLATFORM, h as KeyPlatformType, P as PURGE_STRATEGIES, S as SOCIAL_PROVIDERS, U as USER_STATUSES, k as UserStatus } from './types-DYyhze28.js';
|
|
@@ -1355,7 +1355,7 @@ declare function getAuthSessionService(userId: string | number | bigint): Promis
|
|
|
1355
1355
|
id: number;
|
|
1356
1356
|
name: string;
|
|
1357
1357
|
displayName: string;
|
|
1358
|
-
category: "
|
|
1358
|
+
category: "custom" | "user" | "auth" | "rbac" | "system" | undefined;
|
|
1359
1359
|
}[];
|
|
1360
1360
|
userId: number;
|
|
1361
1361
|
publicId: string;
|
|
@@ -1801,7 +1801,7 @@ declare const accountDeletionRequests: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
1801
1801
|
name: string;
|
|
1802
1802
|
tableName: "account_deletion_requests";
|
|
1803
1803
|
dataType: "string enum";
|
|
1804
|
-
data: "
|
|
1804
|
+
data: "self" | "admin";
|
|
1805
1805
|
driverParam: string;
|
|
1806
1806
|
notNull: true;
|
|
1807
1807
|
hasDefault: true;
|
|
@@ -3405,7 +3405,7 @@ declare const permissions: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
3405
3405
|
name: string;
|
|
3406
3406
|
tableName: "permissions";
|
|
3407
3407
|
dataType: "string enum";
|
|
3408
|
-
data: "
|
|
3408
|
+
data: "custom" | "user" | "auth" | "rbac" | "system";
|
|
3409
3409
|
driverParam: string;
|
|
3410
3410
|
notNull: false;
|
|
3411
3411
|
hasDefault: false;
|
|
@@ -4026,15 +4026,15 @@ declare class UsersRepository extends BaseRepository {
|
|
|
4026
4026
|
create(data: NewUser): Promise<{
|
|
4027
4027
|
email: string | null;
|
|
4028
4028
|
phone: string | null;
|
|
4029
|
+
status: "active" | "inactive" | "suspended" | "pending_deletion" | "deleted";
|
|
4030
|
+
username: string | null;
|
|
4029
4031
|
id: number;
|
|
4032
|
+
createdAt: Date;
|
|
4033
|
+
updatedAt: Date;
|
|
4030
4034
|
publicId: string;
|
|
4031
|
-
username: string | null;
|
|
4032
4035
|
passwordHash: string | null;
|
|
4033
4036
|
passwordChangeRequired: boolean;
|
|
4034
4037
|
roleId: number;
|
|
4035
|
-
createdAt: Date;
|
|
4036
|
-
updatedAt: Date;
|
|
4037
|
-
status: "active" | "inactive" | "suspended" | "pending_deletion" | "deleted";
|
|
4038
4038
|
emailVerifiedAt: Date | null;
|
|
4039
4039
|
phoneVerifiedAt: Date | null;
|
|
4040
4040
|
lastLoginAt: Date | null;
|
|
@@ -4186,15 +4186,15 @@ declare class UsersRepository extends BaseRepository {
|
|
|
4186
4186
|
deleteById(id: number): Promise<{
|
|
4187
4187
|
email: string | null;
|
|
4188
4188
|
phone: string | null;
|
|
4189
|
+
status: "active" | "inactive" | "suspended" | "pending_deletion" | "deleted";
|
|
4190
|
+
username: string | null;
|
|
4189
4191
|
id: number;
|
|
4192
|
+
createdAt: Date;
|
|
4193
|
+
updatedAt: Date;
|
|
4190
4194
|
publicId: string;
|
|
4191
|
-
username: string | null;
|
|
4192
4195
|
passwordHash: string | null;
|
|
4193
4196
|
passwordChangeRequired: boolean;
|
|
4194
4197
|
roleId: number;
|
|
4195
|
-
createdAt: Date;
|
|
4196
|
-
updatedAt: Date;
|
|
4197
|
-
status: "active" | "inactive" | "suspended" | "pending_deletion" | "deleted";
|
|
4198
4198
|
emailVerifiedAt: Date | null;
|
|
4199
4199
|
phoneVerifiedAt: Date | null;
|
|
4200
4200
|
lastLoginAt: Date | null;
|
|
@@ -4219,7 +4219,7 @@ declare class UsersRepository extends BaseRepository {
|
|
|
4219
4219
|
id: number;
|
|
4220
4220
|
name: string;
|
|
4221
4221
|
displayName: string;
|
|
4222
|
-
category: "
|
|
4222
|
+
category: "custom" | "user" | "auth" | "rbac" | "system" | undefined;
|
|
4223
4223
|
}[];
|
|
4224
4224
|
}>;
|
|
4225
4225
|
/**
|
|
@@ -4374,23 +4374,23 @@ declare class KeysRepository extends BaseRepository {
|
|
|
4374
4374
|
* Write primary 사용
|
|
4375
4375
|
*/
|
|
4376
4376
|
create(data: NewUserPublicKey): Promise<{
|
|
4377
|
-
publicKey: string;
|
|
4378
|
-
keyId: string;
|
|
4379
|
-
fingerprint: string;
|
|
4380
|
-
algorithm: "ES256" | "RS256";
|
|
4381
|
-
deviceName: string | null;
|
|
4382
|
-
platform: "ios" | "android" | "web" | "desktop" | null;
|
|
4383
4377
|
userId: number;
|
|
4378
|
+
keyId: string;
|
|
4384
4379
|
id: number;
|
|
4385
4380
|
isActive: boolean;
|
|
4386
4381
|
createdAt: Date;
|
|
4387
|
-
|
|
4388
|
-
|
|
4389
|
-
|
|
4382
|
+
publicKey: string;
|
|
4383
|
+
algorithm: "ES256" | "RS256";
|
|
4384
|
+
fingerprint: string;
|
|
4385
|
+
deviceName: string | null;
|
|
4386
|
+
platform: "ios" | "android" | "web" | "desktop" | null;
|
|
4390
4387
|
clientKind: "ios" | "android" | "web" | null;
|
|
4391
4388
|
clientVersion: string | null;
|
|
4392
4389
|
clientContractVersion: string | null;
|
|
4393
4390
|
clientSeenAt: Date | null;
|
|
4391
|
+
lastUsedAt: Date | null;
|
|
4392
|
+
expiresAt: Date | null;
|
|
4393
|
+
revokedAt: Date | null;
|
|
4394
4394
|
revokedReason: string | null;
|
|
4395
4395
|
}>;
|
|
4396
4396
|
/**
|
|
@@ -4476,23 +4476,23 @@ declare class KeysRepository extends BaseRepository {
|
|
|
4476
4476
|
* Write primary 사용
|
|
4477
4477
|
*/
|
|
4478
4478
|
deleteByKeyIdAndUserId(keyId: string, userId: number): Promise<{
|
|
4479
|
-
publicKey: string;
|
|
4480
|
-
keyId: string;
|
|
4481
|
-
fingerprint: string;
|
|
4482
|
-
algorithm: "ES256" | "RS256";
|
|
4483
|
-
deviceName: string | null;
|
|
4484
|
-
platform: "ios" | "android" | "web" | "desktop" | null;
|
|
4485
4479
|
userId: number;
|
|
4480
|
+
keyId: string;
|
|
4486
4481
|
id: number;
|
|
4487
4482
|
isActive: boolean;
|
|
4488
4483
|
createdAt: Date;
|
|
4489
|
-
|
|
4490
|
-
|
|
4491
|
-
|
|
4484
|
+
publicKey: string;
|
|
4485
|
+
algorithm: "ES256" | "RS256";
|
|
4486
|
+
fingerprint: string;
|
|
4487
|
+
deviceName: string | null;
|
|
4488
|
+
platform: "ios" | "android" | "web" | "desktop" | null;
|
|
4492
4489
|
clientKind: "ios" | "android" | "web" | null;
|
|
4493
4490
|
clientVersion: string | null;
|
|
4494
4491
|
clientContractVersion: string | null;
|
|
4495
4492
|
clientSeenAt: Date | null;
|
|
4493
|
+
lastUsedAt: Date | null;
|
|
4494
|
+
expiresAt: Date | null;
|
|
4495
|
+
revokedAt: Date | null;
|
|
4496
4496
|
revokedReason: string | null;
|
|
4497
4497
|
}>;
|
|
4498
4498
|
/**
|
|
@@ -4680,14 +4680,14 @@ declare class VerificationCodesRepository extends BaseRepository {
|
|
|
4680
4680
|
* Write primary 사용
|
|
4681
4681
|
*/
|
|
4682
4682
|
create(data: NewVerificationCode): Promise<{
|
|
4683
|
-
target: string;
|
|
4684
|
-
targetType: "email" | "phone";
|
|
4685
|
-
purpose: "registration" | "login" | "password_reset" | "email_change" | "phone_change" | "account_deletion";
|
|
4686
|
-
code: string;
|
|
4687
4683
|
id: number;
|
|
4688
4684
|
createdAt: Date;
|
|
4689
4685
|
updatedAt: Date;
|
|
4690
4686
|
expiresAt: Date;
|
|
4687
|
+
target: string;
|
|
4688
|
+
targetType: "email" | "phone";
|
|
4689
|
+
code: string;
|
|
4690
|
+
purpose: "registration" | "login" | "password_reset" | "email_change" | "phone_change" | "account_deletion";
|
|
4691
4691
|
usedAt: Date | null;
|
|
4692
4692
|
attempts: number;
|
|
4693
4693
|
}>;
|
|
@@ -4889,8 +4889,8 @@ declare class RolesRepository extends BaseRepository {
|
|
|
4889
4889
|
*/
|
|
4890
4890
|
create(data: NewRoleEntity): Promise<{
|
|
4891
4891
|
description: string | null;
|
|
4892
|
-
name: string;
|
|
4893
4892
|
id: number;
|
|
4893
|
+
name: string;
|
|
4894
4894
|
displayName: string;
|
|
4895
4895
|
isBuiltin: boolean;
|
|
4896
4896
|
isSystem: boolean;
|
|
@@ -4919,8 +4919,8 @@ declare class RolesRepository extends BaseRepository {
|
|
|
4919
4919
|
*/
|
|
4920
4920
|
deleteById(id: number): Promise<{
|
|
4921
4921
|
description: string | null;
|
|
4922
|
-
name: string;
|
|
4923
4922
|
id: number;
|
|
4923
|
+
name: string;
|
|
4924
4924
|
displayName: string;
|
|
4925
4925
|
isBuiltin: boolean;
|
|
4926
4926
|
isSystem: boolean;
|
|
@@ -4953,7 +4953,7 @@ declare class PermissionsRepository extends BaseRepository {
|
|
|
4953
4953
|
name: string;
|
|
4954
4954
|
displayName: string;
|
|
4955
4955
|
description: string | null;
|
|
4956
|
-
category: "
|
|
4956
|
+
category: "custom" | "user" | "auth" | "rbac" | "system" | null;
|
|
4957
4957
|
isBuiltin: boolean;
|
|
4958
4958
|
isSystem: boolean;
|
|
4959
4959
|
isActive: boolean;
|
|
@@ -4969,7 +4969,7 @@ declare class PermissionsRepository extends BaseRepository {
|
|
|
4969
4969
|
name: string;
|
|
4970
4970
|
displayName: string;
|
|
4971
4971
|
description: string | null;
|
|
4972
|
-
category: "
|
|
4972
|
+
category: "custom" | "user" | "auth" | "rbac" | "system" | null;
|
|
4973
4973
|
isBuiltin: boolean;
|
|
4974
4974
|
isSystem: boolean;
|
|
4975
4975
|
isActive: boolean;
|
|
@@ -5009,7 +5009,7 @@ declare class PermissionsRepository extends BaseRepository {
|
|
|
5009
5009
|
name: string;
|
|
5010
5010
|
displayName: string;
|
|
5011
5011
|
description: string | null;
|
|
5012
|
-
category: "
|
|
5012
|
+
category: "custom" | "user" | "auth" | "rbac" | "system" | null;
|
|
5013
5013
|
isBuiltin: boolean;
|
|
5014
5014
|
isSystem: boolean;
|
|
5015
5015
|
isActive: boolean;
|
|
@@ -5020,16 +5020,16 @@ declare class PermissionsRepository extends BaseRepository {
|
|
|
5020
5020
|
*/
|
|
5021
5021
|
deleteById(id: number): Promise<{
|
|
5022
5022
|
description: string | null;
|
|
5023
|
-
metadata: Record<string, any> | null;
|
|
5024
|
-
name: string;
|
|
5025
5023
|
id: number;
|
|
5024
|
+
name: string;
|
|
5026
5025
|
displayName: string;
|
|
5027
5026
|
isBuiltin: boolean;
|
|
5028
5027
|
isSystem: boolean;
|
|
5029
5028
|
isActive: boolean;
|
|
5030
5029
|
createdAt: Date;
|
|
5031
5030
|
updatedAt: Date;
|
|
5032
|
-
|
|
5031
|
+
metadata: Record<string, any> | null;
|
|
5032
|
+
category: "custom" | "user" | "auth" | "rbac" | "system" | null;
|
|
5033
5033
|
}>;
|
|
5034
5034
|
}
|
|
5035
5035
|
declare const permissionsRepository: PermissionsRepository;
|
|
@@ -5074,9 +5074,9 @@ declare class RolePermissionsRepository extends BaseRepository {
|
|
|
5074
5074
|
*/
|
|
5075
5075
|
createMany(data: NewRolePermission[]): Promise<{
|
|
5076
5076
|
id: number;
|
|
5077
|
-
roleId: number;
|
|
5078
5077
|
createdAt: Date;
|
|
5079
5078
|
updatedAt: Date;
|
|
5079
|
+
roleId: number;
|
|
5080
5080
|
permissionId: number;
|
|
5081
5081
|
}[]>;
|
|
5082
5082
|
/**
|
|
@@ -5092,9 +5092,9 @@ declare class RolePermissionsRepository extends BaseRepository {
|
|
|
5092
5092
|
*/
|
|
5093
5093
|
setPermissionsForRole(roleId: number, permissionIds: number[]): Promise<{
|
|
5094
5094
|
id: number;
|
|
5095
|
-
roleId: number;
|
|
5096
5095
|
createdAt: Date;
|
|
5097
5096
|
updatedAt: Date;
|
|
5097
|
+
roleId: number;
|
|
5098
5098
|
permissionId: number;
|
|
5099
5099
|
}[]>;
|
|
5100
5100
|
}
|
|
@@ -5159,9 +5159,9 @@ declare class UserPermissionsRepository extends BaseRepository {
|
|
|
5159
5159
|
id: number;
|
|
5160
5160
|
createdAt: Date;
|
|
5161
5161
|
updatedAt: Date;
|
|
5162
|
-
permissionId: number;
|
|
5163
|
-
reason: string | null;
|
|
5164
5162
|
expiresAt: Date | null;
|
|
5163
|
+
reason: string | null;
|
|
5164
|
+
permissionId: number;
|
|
5165
5165
|
granted: boolean;
|
|
5166
5166
|
}>;
|
|
5167
5167
|
/**
|
|
@@ -5185,9 +5185,9 @@ declare class UserPermissionsRepository extends BaseRepository {
|
|
|
5185
5185
|
id: number;
|
|
5186
5186
|
createdAt: Date;
|
|
5187
5187
|
updatedAt: Date;
|
|
5188
|
-
permissionId: number;
|
|
5189
|
-
reason: string | null;
|
|
5190
5188
|
expiresAt: Date | null;
|
|
5189
|
+
reason: string | null;
|
|
5190
|
+
permissionId: number;
|
|
5191
5191
|
granted: boolean;
|
|
5192
5192
|
}>;
|
|
5193
5193
|
/**
|
|
@@ -5266,7 +5266,6 @@ declare class UserProfilesRepository extends BaseRepository {
|
|
|
5266
5266
|
* 프로필 생성
|
|
5267
5267
|
*/
|
|
5268
5268
|
create(data: NewUserProfile): Promise<{
|
|
5269
|
-
metadata: Record<string, any> | null;
|
|
5270
5269
|
userId: number;
|
|
5271
5270
|
id: number;
|
|
5272
5271
|
displayName: string | null;
|
|
@@ -5284,6 +5283,7 @@ declare class UserProfilesRepository extends BaseRepository {
|
|
|
5284
5283
|
location: string | null;
|
|
5285
5284
|
company: string | null;
|
|
5286
5285
|
jobTitle: string | null;
|
|
5286
|
+
metadata: Record<string, any> | null;
|
|
5287
5287
|
}>;
|
|
5288
5288
|
/**
|
|
5289
5289
|
* 프로필 업데이트 (by ID)
|
|
@@ -5335,7 +5335,6 @@ declare class UserProfilesRepository extends BaseRepository {
|
|
|
5335
5335
|
* 프로필 삭제 (by ID)
|
|
5336
5336
|
*/
|
|
5337
5337
|
deleteById(id: number): Promise<{
|
|
5338
|
-
metadata: Record<string, any> | null;
|
|
5339
5338
|
userId: number;
|
|
5340
5339
|
id: number;
|
|
5341
5340
|
displayName: string | null;
|
|
@@ -5353,12 +5352,12 @@ declare class UserProfilesRepository extends BaseRepository {
|
|
|
5353
5352
|
location: string | null;
|
|
5354
5353
|
company: string | null;
|
|
5355
5354
|
jobTitle: string | null;
|
|
5355
|
+
metadata: Record<string, any> | null;
|
|
5356
5356
|
}>;
|
|
5357
5357
|
/**
|
|
5358
5358
|
* 프로필 삭제 (by User ID)
|
|
5359
5359
|
*/
|
|
5360
5360
|
deleteByUserId(userId: number): Promise<{
|
|
5361
|
-
metadata: Record<string, any> | null;
|
|
5362
5361
|
userId: number;
|
|
5363
5362
|
id: number;
|
|
5364
5363
|
displayName: string | null;
|
|
@@ -5376,6 +5375,7 @@ declare class UserProfilesRepository extends BaseRepository {
|
|
|
5376
5375
|
location: string | null;
|
|
5377
5376
|
company: string | null;
|
|
5378
5377
|
jobTitle: string | null;
|
|
5378
|
+
metadata: Record<string, any> | null;
|
|
5379
5379
|
}>;
|
|
5380
5380
|
/**
|
|
5381
5381
|
* 프로필 Upsert (by User ID)
|
|
@@ -5384,7 +5384,6 @@ declare class UserProfilesRepository extends BaseRepository {
|
|
|
5384
5384
|
* 새로 생성 시 displayName은 필수 (없으면 'User'로 설정)
|
|
5385
5385
|
*/
|
|
5386
5386
|
upsertByUserId(userId: number, data: Partial<Omit<NewUserProfile, 'userId'>>): Promise<{
|
|
5387
|
-
metadata: Record<string, any> | null;
|
|
5388
5387
|
userId: number;
|
|
5389
5388
|
id: number;
|
|
5390
5389
|
displayName: string | null;
|
|
@@ -5402,6 +5401,7 @@ declare class UserProfilesRepository extends BaseRepository {
|
|
|
5402
5401
|
location: string | null;
|
|
5403
5402
|
company: string | null;
|
|
5404
5403
|
jobTitle: string | null;
|
|
5404
|
+
metadata: Record<string, any> | null;
|
|
5405
5405
|
}>;
|
|
5406
5406
|
/**
|
|
5407
5407
|
* User ID로 프로필 데이터 조회 (formatted)
|
|
@@ -5529,15 +5529,15 @@ declare class InvitationsRepository extends BaseRepository {
|
|
|
5529
5529
|
*/
|
|
5530
5530
|
create(data: NewInvitation): Promise<{
|
|
5531
5531
|
email: string;
|
|
5532
|
-
|
|
5533
|
-
token: string;
|
|
5532
|
+
status: "pending" | "accepted" | "expired" | "cancelled";
|
|
5534
5533
|
id: number;
|
|
5535
|
-
roleId: number;
|
|
5536
5534
|
createdAt: Date;
|
|
5537
5535
|
updatedAt: Date;
|
|
5538
|
-
|
|
5539
|
-
|
|
5536
|
+
roleId: number;
|
|
5537
|
+
metadata: Record<string, any> | null;
|
|
5540
5538
|
expiresAt: Date;
|
|
5539
|
+
token: string;
|
|
5540
|
+
invitedBy: number;
|
|
5541
5541
|
acceptedAt: Date | null;
|
|
5542
5542
|
cancelledAt: Date | null;
|
|
5543
5543
|
}>;
|
|
@@ -5563,15 +5563,15 @@ declare class InvitationsRepository extends BaseRepository {
|
|
|
5563
5563
|
*/
|
|
5564
5564
|
deleteById(id: number): Promise<{
|
|
5565
5565
|
email: string;
|
|
5566
|
-
|
|
5567
|
-
token: string;
|
|
5566
|
+
status: "pending" | "accepted" | "expired" | "cancelled";
|
|
5568
5567
|
id: number;
|
|
5569
|
-
roleId: number;
|
|
5570
5568
|
createdAt: Date;
|
|
5571
5569
|
updatedAt: Date;
|
|
5572
|
-
|
|
5573
|
-
|
|
5570
|
+
roleId: number;
|
|
5571
|
+
metadata: Record<string, any> | null;
|
|
5574
5572
|
expiresAt: Date;
|
|
5573
|
+
token: string;
|
|
5574
|
+
invitedBy: number;
|
|
5575
5575
|
acceptedAt: Date | null;
|
|
5576
5576
|
cancelledAt: Date | null;
|
|
5577
5577
|
}>;
|
|
@@ -5809,9 +5809,9 @@ declare class SocialAccountsRepository extends BaseRepository {
|
|
|
5809
5809
|
createdAt: Date;
|
|
5810
5810
|
updatedAt: Date;
|
|
5811
5811
|
provider: "google" | "apple" | "github" | "kakao" | "naver" | "superself";
|
|
5812
|
-
accessToken: string | null;
|
|
5813
5812
|
providerUserId: string;
|
|
5814
5813
|
providerEmail: string | null;
|
|
5814
|
+
accessToken: string | null;
|
|
5815
5815
|
refreshToken: string | null;
|
|
5816
5816
|
tokenExpiresAt: Date | null;
|
|
5817
5817
|
}>;
|
|
@@ -5825,9 +5825,9 @@ declare class SocialAccountsRepository extends BaseRepository {
|
|
|
5825
5825
|
createdAt: Date;
|
|
5826
5826
|
updatedAt: Date;
|
|
5827
5827
|
provider: "google" | "apple" | "github" | "kakao" | "naver" | "superself";
|
|
5828
|
-
accessToken: string | null;
|
|
5829
5828
|
providerUserId: string;
|
|
5830
5829
|
providerEmail: string | null;
|
|
5830
|
+
accessToken: string | null;
|
|
5831
5831
|
refreshToken: string | null;
|
|
5832
5832
|
tokenExpiresAt: Date | null;
|
|
5833
5833
|
}>;
|
|
@@ -5887,7 +5887,7 @@ declare class AccountDeletionRequestsRepository extends BaseRepository {
|
|
|
5887
5887
|
requestedAt: Date;
|
|
5888
5888
|
purgeScheduledAt: Date;
|
|
5889
5889
|
status: "pending" | "cancelled" | "completed";
|
|
5890
|
-
requestedBy: "
|
|
5890
|
+
requestedBy: "self" | "admin";
|
|
5891
5891
|
reason: string | null;
|
|
5892
5892
|
cancelledAt: Date | null;
|
|
5893
5893
|
completedAt: Date | null;
|
|
@@ -5906,7 +5906,7 @@ declare class AccountDeletionRequestsRepository extends BaseRepository {
|
|
|
5906
5906
|
requestedAt: Date;
|
|
5907
5907
|
purgeScheduledAt: Date;
|
|
5908
5908
|
status: "pending" | "cancelled" | "completed";
|
|
5909
|
-
requestedBy: "
|
|
5909
|
+
requestedBy: "self" | "admin";
|
|
5910
5910
|
reason: string | null;
|
|
5911
5911
|
cancelledAt: Date | null;
|
|
5912
5912
|
completedAt: Date | null;
|
|
@@ -5928,7 +5928,7 @@ declare class AccountDeletionRequestsRepository extends BaseRepository {
|
|
|
5928
5928
|
requestedAt: Date;
|
|
5929
5929
|
purgeScheduledAt: Date;
|
|
5930
5930
|
status: "pending" | "cancelled" | "completed";
|
|
5931
|
-
requestedBy: "
|
|
5931
|
+
requestedBy: "self" | "admin";
|
|
5932
5932
|
reason: string | null;
|
|
5933
5933
|
cancelledAt: Date | null;
|
|
5934
5934
|
completedAt: Date | null;
|
|
@@ -5947,7 +5947,7 @@ declare class AccountDeletionRequestsRepository extends BaseRepository {
|
|
|
5947
5947
|
requestedAt: Date;
|
|
5948
5948
|
purgeScheduledAt: Date;
|
|
5949
5949
|
status: "pending" | "cancelled" | "completed";
|
|
5950
|
-
requestedBy: "
|
|
5950
|
+
requestedBy: "self" | "admin";
|
|
5951
5951
|
reason: string | null;
|
|
5952
5952
|
cancelledAt: Date | null;
|
|
5953
5953
|
completedAt: Date | null;
|
|
@@ -5959,17 +5959,17 @@ declare class AccountDeletionRequestsRepository extends BaseRepository {
|
|
|
5959
5959
|
*/
|
|
5960
5960
|
create(data: NewAccountDeletionRequest): Promise<{
|
|
5961
5961
|
userId: number | null;
|
|
5962
|
+
status: "pending" | "cancelled" | "completed";
|
|
5963
|
+
purgeScheduledAt: Date;
|
|
5962
5964
|
id: number;
|
|
5963
5965
|
createdAt: Date;
|
|
5964
5966
|
updatedAt: Date;
|
|
5965
|
-
status: "pending" | "cancelled" | "completed";
|
|
5966
|
-
reason: string | null;
|
|
5967
|
-
purgeScheduledAt: Date;
|
|
5968
|
-
cancelledAt: Date | null;
|
|
5969
5967
|
completedAt: Date | null;
|
|
5968
|
+
cancelledAt: Date | null;
|
|
5970
5969
|
userPublicId: string;
|
|
5971
5970
|
requestedAt: Date;
|
|
5972
|
-
requestedBy: "
|
|
5971
|
+
requestedBy: "self" | "admin";
|
|
5972
|
+
reason: string | null;
|
|
5973
5973
|
purgeStrategy: "anonymize" | "hard-delete" | null;
|
|
5974
5974
|
}>;
|
|
5975
5975
|
/**
|
|
@@ -5989,7 +5989,7 @@ declare class AccountDeletionRequestsRepository extends BaseRepository {
|
|
|
5989
5989
|
requestedAt: Date;
|
|
5990
5990
|
purgeScheduledAt: Date;
|
|
5991
5991
|
status: "pending" | "cancelled" | "completed";
|
|
5992
|
-
requestedBy: "
|
|
5992
|
+
requestedBy: "self" | "admin";
|
|
5993
5993
|
reason: string | null;
|
|
5994
5994
|
cancelledAt: Date | null;
|
|
5995
5995
|
completedAt: Date | null;
|
|
@@ -6014,7 +6014,7 @@ declare class AccountDeletionRequestsRepository extends BaseRepository {
|
|
|
6014
6014
|
requestedAt: Date;
|
|
6015
6015
|
purgeScheduledAt: Date;
|
|
6016
6016
|
status: "pending" | "cancelled" | "completed";
|
|
6017
|
-
requestedBy: "
|
|
6017
|
+
requestedBy: "self" | "admin";
|
|
6018
6018
|
reason: string | null;
|
|
6019
6019
|
cancelledAt: Date | null;
|
|
6020
6020
|
completedAt: Date | null;
|
|
@@ -6552,15 +6552,15 @@ declare function getUser(c: Context | {
|
|
|
6552
6552
|
}): {
|
|
6553
6553
|
email: string | null;
|
|
6554
6554
|
phone: string | null;
|
|
6555
|
+
status: "active" | "inactive" | "suspended" | "pending_deletion" | "deleted";
|
|
6556
|
+
username: string | null;
|
|
6555
6557
|
id: number;
|
|
6558
|
+
createdAt: Date;
|
|
6559
|
+
updatedAt: Date;
|
|
6556
6560
|
publicId: string;
|
|
6557
|
-
username: string | null;
|
|
6558
6561
|
passwordHash: string | null;
|
|
6559
6562
|
passwordChangeRequired: boolean;
|
|
6560
6563
|
roleId: number;
|
|
6561
|
-
createdAt: Date;
|
|
6562
|
-
updatedAt: Date;
|
|
6563
|
-
status: "active" | "inactive" | "suspended" | "pending_deletion" | "deleted";
|
|
6564
6564
|
emailVerifiedAt: Date | null;
|
|
6565
6565
|
phoneVerifiedAt: Date | null;
|
|
6566
6566
|
lastLoginAt: Date | null;
|
|
@@ -7193,7 +7193,7 @@ declare const authLoginEvent: _spfn_core_event.EventDef<{
|
|
|
7193
7193
|
email?: string | undefined;
|
|
7194
7194
|
phone?: string | undefined;
|
|
7195
7195
|
userId: string;
|
|
7196
|
-
provider: "
|
|
7196
|
+
provider: "google" | "apple" | "github" | "kakao" | "naver" | "superself" | "email" | "phone";
|
|
7197
7197
|
}>;
|
|
7198
7198
|
/**
|
|
7199
7199
|
* auth.register - 회원가입 성공 이벤트
|
|
@@ -7216,7 +7216,7 @@ declare const authRegisterEvent: _spfn_core_event.EventDef<{
|
|
|
7216
7216
|
[x: string]: unknown;
|
|
7217
7217
|
} | undefined;
|
|
7218
7218
|
userId: string;
|
|
7219
|
-
provider: "
|
|
7219
|
+
provider: "google" | "apple" | "github" | "kakao" | "naver" | "superself" | "email" | "phone";
|
|
7220
7220
|
}>;
|
|
7221
7221
|
/**
|
|
7222
7222
|
* auth.invitation.created - 초대 생성 이벤트
|
|
@@ -7243,10 +7243,10 @@ declare const invitationCreatedEvent: _spfn_core_event.EventDef<{
|
|
|
7243
7243
|
[x: string]: unknown;
|
|
7244
7244
|
} | undefined;
|
|
7245
7245
|
email: string;
|
|
7246
|
-
token: string;
|
|
7247
7246
|
roleId: number;
|
|
7248
|
-
invitedBy: string;
|
|
7249
7247
|
expiresAt: string;
|
|
7248
|
+
token: string;
|
|
7249
|
+
invitedBy: string;
|
|
7250
7250
|
invitationId: string;
|
|
7251
7251
|
isResend: boolean;
|
|
7252
7252
|
}>;
|
|
@@ -7290,7 +7290,7 @@ declare const authDeletionRequestedEvent: _spfn_core_event.EventDef<{
|
|
|
7290
7290
|
userId: string;
|
|
7291
7291
|
purgeScheduledAt: string;
|
|
7292
7292
|
userPublicId: string;
|
|
7293
|
-
requestedBy: "
|
|
7293
|
+
requestedBy: "self" | "admin";
|
|
7294
7294
|
}>;
|
|
7295
7295
|
/**
|
|
7296
7296
|
* auth.deletion.cancelled - 계정 탈퇴 복구 이벤트
|
|
@@ -7335,7 +7335,7 @@ declare const authDeletionCompletedEvent: _spfn_core_event.EventDef<{
|
|
|
7335
7335
|
declare const oauthUnlinkedEvent: _spfn_core_event.EventDef<{
|
|
7336
7336
|
reason?: string | undefined;
|
|
7337
7337
|
userId: string;
|
|
7338
|
-
provider: "
|
|
7338
|
+
provider: "google" | "apple" | "github" | "kakao" | "naver" | "superself" | "email" | "phone";
|
|
7339
7339
|
providerUserId: string;
|
|
7340
7340
|
}>;
|
|
7341
7341
|
/**
|
package/dist/server.js
CHANGED
|
@@ -12745,7 +12745,11 @@ async function runAuthProfile(c) {
|
|
|
12745
12745
|
if (verifier === null) {
|
|
12746
12746
|
return { kind: "none" };
|
|
12747
12747
|
}
|
|
12748
|
-
|
|
12748
|
+
const auth = await verifier.verify(c);
|
|
12749
|
+
if (!auth?.userId) {
|
|
12750
|
+
throw new UnauthorizedError({ message: "Auth profile verifier returned no principal" });
|
|
12751
|
+
}
|
|
12752
|
+
return { kind: "authenticated", auth };
|
|
12749
12753
|
} catch (err) {
|
|
12750
12754
|
if (err instanceof ClientProofRefusalError) {
|
|
12751
12755
|
return { kind: "refused", response: clientProofRefusalResponse(c, err.refusal) };
|
|
@@ -12867,6 +12871,18 @@ function verifyProofOrThrow(proofInput, credentials, publicKeySpkiDerBase64) {
|
|
|
12867
12871
|
var AUTH_PROFILE_VERIFIERS = /* @__PURE__ */ new Map([
|
|
12868
12872
|
[CLIENT_PROOF_PROFILE, { verify: verifyClientProofProfile }]
|
|
12869
12873
|
]);
|
|
12874
|
+
function registerAuthProfile(profileId, verifier) {
|
|
12875
|
+
if (typeof profileId !== "string" || profileId.length === 0) {
|
|
12876
|
+
throw new Error("registerAuthProfile: profileId must be a non-empty string");
|
|
12877
|
+
}
|
|
12878
|
+
if (typeof verifier?.verify !== "function") {
|
|
12879
|
+
throw new Error(`registerAuthProfile: auth profile '${profileId}' needs a verifier with a callable verify(c)`);
|
|
12880
|
+
}
|
|
12881
|
+
if (AUTH_PROFILE_VERIFIERS.has(profileId)) {
|
|
12882
|
+
throw new Error(`registerAuthProfile: auth profile '${profileId}' is already registered`);
|
|
12883
|
+
}
|
|
12884
|
+
AUTH_PROFILE_VERIFIERS.set(profileId, { verify: verifier.verify.bind(verifier) });
|
|
12885
|
+
}
|
|
12870
12886
|
|
|
12871
12887
|
// src/server/middleware/authenticate.ts
|
|
12872
12888
|
var authenticate = defineMiddleware("auth", async (c, next) => {
|
|
@@ -14801,6 +14817,7 @@ export {
|
|
|
14801
14817
|
permissionsRepository,
|
|
14802
14818
|
purgeUserService,
|
|
14803
14819
|
refreshAccessToken,
|
|
14820
|
+
registerAuthProfile,
|
|
14804
14821
|
registerOAuthProvider,
|
|
14805
14822
|
registerPublicKeyService,
|
|
14806
14823
|
registerService,
|