@spfn/auth 0.2.0-beta.1 → 0.2.0-beta.2

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.
@@ -500,7 +500,7 @@ declare const mainAuthRouter: _spfn_core_route.Router<{
500
500
  id: number;
501
501
  name: string;
502
502
  displayName: string;
503
- category: "custom" | "user" | "auth" | "rbac" | "system" | undefined;
503
+ category: "auth" | "custom" | "user" | "rbac" | "system" | undefined;
504
504
  }[];
505
505
  userId: number;
506
506
  email: string | null;
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, U as UserProfile, C as CheckAccountExistsResult, S as SendVerificationCodeResult, a as RegisterResult, L as LoginResult, b as RotateKeyResult, m as mainAuthRouter } from './dto-81uR9gzF.js';
3
- export { k as AuthInitOptions, A as AuthSession, I as INVITATION_STATUSES, n as InvitationStatus, K as KEY_ALGORITHM, l as KeyAlgorithmType, i as PERMISSION_CATEGORIES, j as PermissionCategory, c as ProfileInfo, e as SOCIAL_PROVIDERS, p as SocialProvider, d as USER_STATUSES, o as UserStatus, h as VERIFICATION_PURPOSES, g as VERIFICATION_TARGET_TYPES, f as VerificationPurpose, V as VerificationTargetType } from './dto-81uR9gzF.js';
2
+ import { R as RoleConfig, P as PermissionConfig, U as UserProfile, C as CheckAccountExistsResult, S as SendVerificationCodeResult, a as RegisterResult, L as LoginResult, b as RotateKeyResult, m as mainAuthRouter } from './dto-CLYtuAom.js';
3
+ export { k as AuthInitOptions, A as AuthSession, I as INVITATION_STATUSES, n as InvitationStatus, K as KEY_ALGORITHM, l as KeyAlgorithmType, i as PERMISSION_CATEGORIES, j as PermissionCategory, c as ProfileInfo, e as SOCIAL_PROVIDERS, p as SocialProvider, d as USER_STATUSES, o as UserStatus, h as VERIFICATION_PURPOSES, g as VERIFICATION_TARGET_TYPES, f as VerificationPurpose, V as VerificationTargetType } from './dto-CLYtuAom.js';
4
4
  import * as _spfn_core_route from '@spfn/core/route';
5
5
  import * as _sinclair_typebox from '@sinclair/typebox';
6
6
  import '@spfn/auth/server';
@@ -260,7 +260,7 @@ declare const authApi: _spfn_core_nextjs.Client<_spfn_core_route.Router<{
260
260
  id: number;
261
261
  name: string;
262
262
  displayName: string;
263
- category: "custom" | "user" | "auth" | "rbac" | "system" | undefined;
263
+ category: "auth" | "custom" | "user" | "rbac" | "system" | undefined;
264
264
  }[];
265
265
  userId: number;
266
266
  email: string | null;
package/dist/server.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { k as AuthInitOptions, l as KeyAlgorithmType, n as InvitationStatus, f as VerificationPurpose, j as PermissionCategory, q as AuthContext } from './dto-81uR9gzF.js';
2
- export { B as ChangePasswordParams, w as CheckAccountExistsParams, C as CheckAccountExistsResult, X as EmailSchema, I as INVITATION_STATUSES, K as KEY_ALGORITHM, y as LoginParams, L as LoginResult, z as LogoutParams, Z as PasswordSchema, Y as PhoneSchema, x as RegisterParams, O as RegisterPublicKeyParams, a as RegisterResult, T as RevokeKeyParams, Q as RotateKeyParams, b as RotateKeyResult, e as SOCIAL_PROVIDERS, F as SendVerificationCodeParams, S as SendVerificationCodeResult, p as SocialProvider, _ as TargetTypeSchema, d as USER_STATUSES, o as UserStatus, h as VERIFICATION_PURPOSES, g as VERIFICATION_TARGET_TYPES, $ as VerificationPurposeSchema, V as VerificationTargetType, G as VerifyCodeParams, H as VerifyCodeResult, m as authRouter, W as authenticate, v as changePasswordService, r as checkAccountExistsService, t as loginService, u as logoutService, J as registerPublicKeyService, s as registerService, N as revokeKeyService, M as rotateKeyService, D as sendVerificationCodeService, E as verifyCodeService } from './dto-81uR9gzF.js';
1
+ import { k as AuthInitOptions, l as KeyAlgorithmType, n as InvitationStatus, f as VerificationPurpose, j as PermissionCategory, q as AuthContext } from './dto-CLYtuAom.js';
2
+ export { B as ChangePasswordParams, w as CheckAccountExistsParams, C as CheckAccountExistsResult, X as EmailSchema, I as INVITATION_STATUSES, K as KEY_ALGORITHM, y as LoginParams, L as LoginResult, z as LogoutParams, Z as PasswordSchema, Y as PhoneSchema, x as RegisterParams, O as RegisterPublicKeyParams, a as RegisterResult, T as RevokeKeyParams, Q as RotateKeyParams, b as RotateKeyResult, e as SOCIAL_PROVIDERS, F as SendVerificationCodeParams, S as SendVerificationCodeResult, p as SocialProvider, _ as TargetTypeSchema, d as USER_STATUSES, o as UserStatus, h as VERIFICATION_PURPOSES, g as VERIFICATION_TARGET_TYPES, $ as VerificationPurposeSchema, V as VerificationTargetType, G as VerifyCodeParams, H as VerifyCodeResult, m as authRouter, W as authenticate, v as changePasswordService, r as checkAccountExistsService, t as loginService, u as logoutService, J as registerPublicKeyService, s as registerService, N as revokeKeyService, M as rotateKeyService, D as sendVerificationCodeService, E as verifyCodeService } from './dto-CLYtuAom.js';
3
3
  import * as drizzle_orm_pg_core from 'drizzle-orm/pg-core';
4
4
  import { UserProfile as UserProfile$1 } from '@spfn/auth';
5
5
  import { BaseRepository } from '@spfn/core/db';
@@ -1242,7 +1242,7 @@ declare function getAuthSessionService(userId: string | number | bigint): Promis
1242
1242
  id: number;
1243
1243
  name: string;
1244
1244
  displayName: string;
1245
- category: "custom" | "user" | "auth" | "rbac" | "system" | undefined;
1245
+ category: "auth" | "custom" | "user" | "rbac" | "system" | undefined;
1246
1246
  }[];
1247
1247
  userId: number;
1248
1248
  email: string | null;
@@ -2694,7 +2694,7 @@ declare const permissions: drizzle_orm_pg_core.PgTableWithColumns<{
2694
2694
  tableName: "permissions";
2695
2695
  dataType: "string";
2696
2696
  columnType: "PgText";
2697
- data: "custom" | "user" | "auth" | "rbac" | "system";
2697
+ data: "auth" | "custom" | "user" | "rbac" | "system";
2698
2698
  driverParam: string;
2699
2699
  notNull: false;
2700
2700
  hasDefault: false;
@@ -3143,13 +3143,13 @@ declare class UsersRepository extends BaseRepository {
3143
3143
  create(data: NewUser): Promise<{
3144
3144
  email: string | null;
3145
3145
  phone: string | null;
3146
- status: "active" | "inactive" | "suspended";
3147
3146
  id: number;
3148
- createdAt: Date;
3149
- updatedAt: Date;
3150
3147
  passwordHash: string | null;
3151
3148
  passwordChangeRequired: boolean;
3152
3149
  roleId: number;
3150
+ createdAt: Date;
3151
+ updatedAt: Date;
3152
+ status: "active" | "inactive" | "suspended";
3153
3153
  emailVerifiedAt: Date | null;
3154
3154
  phoneVerifiedAt: Date | null;
3155
3155
  lastLoginAt: Date | null;
@@ -3215,13 +3215,13 @@ declare class UsersRepository extends BaseRepository {
3215
3215
  deleteById(id: number): Promise<{
3216
3216
  email: string | null;
3217
3217
  phone: string | null;
3218
- status: "active" | "inactive" | "suspended";
3219
3218
  id: number;
3220
- createdAt: Date;
3221
- updatedAt: Date;
3222
3219
  passwordHash: string | null;
3223
3220
  passwordChangeRequired: boolean;
3224
3221
  roleId: number;
3222
+ createdAt: Date;
3223
+ updatedAt: Date;
3224
+ status: "active" | "inactive" | "suspended";
3225
3225
  emailVerifiedAt: Date | null;
3226
3226
  phoneVerifiedAt: Date | null;
3227
3227
  lastLoginAt: Date | null;
@@ -3244,7 +3244,7 @@ declare class UsersRepository extends BaseRepository {
3244
3244
  id: number;
3245
3245
  name: string;
3246
3246
  displayName: string;
3247
- category: "custom" | "user" | "auth" | "rbac" | "system" | undefined;
3247
+ category: "auth" | "custom" | "user" | "rbac" | "system" | undefined;
3248
3248
  }[];
3249
3249
  }>;
3250
3250
  /**
@@ -3354,16 +3354,16 @@ declare class KeysRepository extends BaseRepository {
3354
3354
  * Write primary 사용
3355
3355
  */
3356
3356
  create(data: NewUserPublicKey): Promise<{
3357
- userId: number;
3357
+ publicKey: string;
3358
3358
  keyId: string;
3359
+ fingerprint: string;
3360
+ algorithm: "ES256" | "RS256";
3361
+ userId: number;
3359
3362
  id: number;
3360
3363
  isActive: boolean;
3361
3364
  createdAt: Date;
3362
- publicKey: string;
3363
- algorithm: "ES256" | "RS256";
3364
- fingerprint: string;
3365
- lastUsedAt: Date | null;
3366
3365
  expiresAt: Date | null;
3366
+ lastUsedAt: Date | null;
3367
3367
  revokedAt: Date | null;
3368
3368
  revokedReason: string | null;
3369
3369
  }>;
@@ -3390,16 +3390,16 @@ declare class KeysRepository extends BaseRepository {
3390
3390
  * Write primary 사용
3391
3391
  */
3392
3392
  deleteByKeyIdAndUserId(keyId: string, userId: number): Promise<{
3393
- userId: number;
3393
+ publicKey: string;
3394
3394
  keyId: string;
3395
+ fingerprint: string;
3396
+ algorithm: "ES256" | "RS256";
3397
+ userId: number;
3395
3398
  id: number;
3396
3399
  isActive: boolean;
3397
3400
  createdAt: Date;
3398
- publicKey: string;
3399
- algorithm: "ES256" | "RS256";
3400
- fingerprint: string;
3401
- lastUsedAt: Date | null;
3402
3401
  expiresAt: Date | null;
3402
+ lastUsedAt: Date | null;
3403
3403
  revokedAt: Date | null;
3404
3404
  revokedReason: string | null;
3405
3405
  }>;
@@ -3514,14 +3514,14 @@ declare class VerificationCodesRepository extends BaseRepository {
3514
3514
  * Write primary 사용
3515
3515
  */
3516
3516
  create(data: NewVerificationCode): Promise<{
3517
+ target: string;
3518
+ targetType: "email" | "phone";
3519
+ purpose: "registration" | "login" | "password_reset" | "email_change" | "phone_change";
3520
+ code: string;
3517
3521
  id: number;
3518
3522
  createdAt: Date;
3519
3523
  updatedAt: Date;
3520
3524
  expiresAt: Date;
3521
- target: string;
3522
- targetType: "email" | "phone";
3523
- code: string;
3524
- purpose: "registration" | "login" | "password_reset" | "email_change" | "phone_change";
3525
3525
  usedAt: Date | null;
3526
3526
  attempts: number;
3527
3527
  }>;
@@ -3710,7 +3710,7 @@ declare class PermissionsRepository extends BaseRepository {
3710
3710
  name: string;
3711
3711
  displayName: string;
3712
3712
  description: string | null;
3713
- category: "custom" | "user" | "auth" | "rbac" | "system" | null;
3713
+ category: "auth" | "custom" | "user" | "rbac" | "system" | null;
3714
3714
  isBuiltin: boolean;
3715
3715
  isSystem: boolean;
3716
3716
  isActive: boolean;
@@ -3726,7 +3726,7 @@ declare class PermissionsRepository extends BaseRepository {
3726
3726
  name: string;
3727
3727
  displayName: string;
3728
3728
  description: string | null;
3729
- category: "custom" | "user" | "auth" | "rbac" | "system" | null;
3729
+ category: "auth" | "custom" | "user" | "rbac" | "system" | null;
3730
3730
  isBuiltin: boolean;
3731
3731
  isSystem: boolean;
3732
3732
  isActive: boolean;
@@ -3766,7 +3766,7 @@ declare class PermissionsRepository extends BaseRepository {
3766
3766
  name: string;
3767
3767
  displayName: string;
3768
3768
  description: string | null;
3769
- category: "custom" | "user" | "auth" | "rbac" | "system" | null;
3769
+ category: "auth" | "custom" | "user" | "rbac" | "system" | null;
3770
3770
  isBuiltin: boolean;
3771
3771
  isSystem: boolean;
3772
3772
  isActive: boolean;
@@ -3785,8 +3785,8 @@ declare class PermissionsRepository extends BaseRepository {
3785
3785
  isActive: boolean;
3786
3786
  createdAt: Date;
3787
3787
  updatedAt: Date;
3788
+ category: "auth" | "custom" | "user" | "rbac" | "system" | null;
3788
3789
  metadata: Record<string, any> | null;
3789
- category: "custom" | "user" | "auth" | "rbac" | "system" | null;
3790
3790
  }>;
3791
3791
  }
3792
3792
  declare const permissionsRepository: PermissionsRepository;
@@ -3831,9 +3831,9 @@ declare class RolePermissionsRepository extends BaseRepository {
3831
3831
  */
3832
3832
  createMany(data: NewRolePermission[]): Promise<{
3833
3833
  id: number;
3834
+ roleId: number;
3834
3835
  createdAt: Date;
3835
3836
  updatedAt: Date;
3836
- roleId: number;
3837
3837
  permissionId: number;
3838
3838
  }[]>;
3839
3839
  /**
@@ -3849,9 +3849,9 @@ declare class RolePermissionsRepository extends BaseRepository {
3849
3849
  */
3850
3850
  setPermissionsForRole(roleId: number, permissionIds: number[]): Promise<{
3851
3851
  id: number;
3852
+ roleId: number;
3852
3853
  createdAt: Date;
3853
3854
  updatedAt: Date;
3854
- roleId: number;
3855
3855
  permissionId: number;
3856
3856
  }[]>;
3857
3857
  }
@@ -3916,10 +3916,10 @@ declare class UserPermissionsRepository extends BaseRepository {
3916
3916
  id: number;
3917
3917
  createdAt: Date;
3918
3918
  updatedAt: Date;
3919
- expiresAt: Date | null;
3920
3919
  permissionId: number;
3921
- granted: boolean;
3920
+ expiresAt: Date | null;
3922
3921
  reason: string | null;
3922
+ granted: boolean;
3923
3923
  }>;
3924
3924
  /**
3925
3925
  * 사용자 권한 오버라이드 업데이트
@@ -3942,10 +3942,10 @@ declare class UserPermissionsRepository extends BaseRepository {
3942
3942
  id: number;
3943
3943
  createdAt: Date;
3944
3944
  updatedAt: Date;
3945
- expiresAt: Date | null;
3946
3945
  permissionId: number;
3947
- granted: boolean;
3946
+ expiresAt: Date | null;
3948
3947
  reason: string | null;
3948
+ granted: boolean;
3949
3949
  }>;
3950
3950
  /**
3951
3951
  * 사용자의 모든 권한 오버라이드 삭제
@@ -4024,6 +4024,7 @@ declare class UserProfilesRepository extends BaseRepository {
4024
4024
  displayName: string;
4025
4025
  createdAt: Date;
4026
4026
  updatedAt: Date;
4027
+ metadata: Record<string, any> | null;
4027
4028
  firstName: string | null;
4028
4029
  lastName: string | null;
4029
4030
  avatarUrl: string | null;
@@ -4036,7 +4037,6 @@ declare class UserProfilesRepository extends BaseRepository {
4036
4037
  location: string | null;
4037
4038
  company: string | null;
4038
4039
  jobTitle: string | null;
4039
- metadata: Record<string, any> | null;
4040
4040
  }>;
4041
4041
  /**
4042
4042
  * 프로필 업데이트 (by ID)
@@ -4093,6 +4093,7 @@ declare class UserProfilesRepository extends BaseRepository {
4093
4093
  displayName: string;
4094
4094
  createdAt: Date;
4095
4095
  updatedAt: Date;
4096
+ metadata: Record<string, any> | null;
4096
4097
  firstName: string | null;
4097
4098
  lastName: string | null;
4098
4099
  avatarUrl: string | null;
@@ -4105,7 +4106,6 @@ declare class UserProfilesRepository extends BaseRepository {
4105
4106
  location: string | null;
4106
4107
  company: string | null;
4107
4108
  jobTitle: string | null;
4108
- metadata: Record<string, any> | null;
4109
4109
  }>;
4110
4110
  /**
4111
4111
  * 프로필 삭제 (by User ID)
@@ -4116,6 +4116,7 @@ declare class UserProfilesRepository extends BaseRepository {
4116
4116
  displayName: string;
4117
4117
  createdAt: Date;
4118
4118
  updatedAt: Date;
4119
+ metadata: Record<string, any> | null;
4119
4120
  firstName: string | null;
4120
4121
  lastName: string | null;
4121
4122
  avatarUrl: string | null;
@@ -4128,7 +4129,6 @@ declare class UserProfilesRepository extends BaseRepository {
4128
4129
  location: string | null;
4129
4130
  company: string | null;
4130
4131
  jobTitle: string | null;
4131
- metadata: Record<string, any> | null;
4132
4132
  }>;
4133
4133
  /**
4134
4134
  * User ID로 프로필 데이터 조회 (formatted)
@@ -4255,15 +4255,15 @@ declare class InvitationsRepository extends BaseRepository {
4255
4255
  */
4256
4256
  create(data: NewInvitation): Promise<{
4257
4257
  email: string;
4258
- status: "pending" | "accepted" | "expired" | "cancelled";
4259
4258
  id: number;
4259
+ roleId: number;
4260
4260
  createdAt: Date;
4261
4261
  updatedAt: Date;
4262
- roleId: number;
4262
+ status: "pending" | "accepted" | "expired" | "cancelled";
4263
4263
  metadata: Record<string, any> | null;
4264
- expiresAt: Date;
4265
4264
  token: string;
4266
4265
  invitedBy: number;
4266
+ expiresAt: Date;
4267
4267
  acceptedAt: Date | null;
4268
4268
  cancelledAt: Date | null;
4269
4269
  }>;
@@ -4289,15 +4289,15 @@ declare class InvitationsRepository extends BaseRepository {
4289
4289
  */
4290
4290
  deleteById(id: number): Promise<{
4291
4291
  email: string;
4292
- status: "pending" | "accepted" | "expired" | "cancelled";
4293
4292
  id: number;
4293
+ roleId: number;
4294
4294
  createdAt: Date;
4295
4295
  updatedAt: Date;
4296
- roleId: number;
4296
+ status: "pending" | "accepted" | "expired" | "cancelled";
4297
4297
  metadata: Record<string, any> | null;
4298
- expiresAt: Date;
4299
4298
  token: string;
4300
4299
  invitedBy: number;
4300
+ expiresAt: Date;
4301
4301
  acceptedAt: Date | null;
4302
4302
  cancelledAt: Date | null;
4303
4303
  }>;
@@ -4757,13 +4757,13 @@ declare function getUser(c: Context | {
4757
4757
  }): {
4758
4758
  email: string | null;
4759
4759
  phone: string | null;
4760
- status: "active" | "inactive" | "suspended";
4761
4760
  id: number;
4762
- createdAt: Date;
4763
- updatedAt: Date;
4764
4761
  passwordHash: string | null;
4765
4762
  passwordChangeRequired: boolean;
4766
4763
  roleId: number;
4764
+ createdAt: Date;
4765
+ updatedAt: Date;
4766
+ status: "active" | "inactive" | "suspended";
4767
4767
  emailVerifiedAt: Date | null;
4768
4768
  phoneVerifiedAt: Date | null;
4769
4769
  lastLoginAt: Date | null;
@@ -1,5 +1,5 @@
1
1
  {
2
- "id": "7dedce95-7ceb-4691-aaad-0989041d8828",
2
+ "id": "71731821-9a5c-4992-8785-5c84089d7b0b",
3
3
  "prevId": "00000000-0000-0000-0000-000000000000",
4
4
  "version": "7",
5
5
  "dialect": "postgresql",
@@ -5,8 +5,8 @@
5
5
  {
6
6
  "idx": 0,
7
7
  "version": "7",
8
- "when": 1765167910869,
9
- "tag": "0000_mysterious_colossus",
8
+ "when": 1765247036863,
9
+ "tag": "0000_marvelous_justice",
10
10
  "breakpoints": true
11
11
  }
12
12
  ]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spfn/auth",
3
- "version": "0.2.0-beta.1",
3
+ "version": "0.2.0-beta.2",
4
4
  "type": "module",
5
5
  "description": "Authentication, authorization, and RBAC module for SPFN",
6
6
  "main": "./dist/index.js",