najm-auth 3.2.0 → 3.3.0

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 CHANGED
@@ -129,9 +129,10 @@ auth({
129
129
  database?: string // Default: 'default'
130
130
  blacklistPrefix?: string // Default: 'auth:blacklist:'
131
131
 
132
- // Registration
133
- defaultRole?: string | null // Auto-assign role to new users
134
- bcryptRounds?: number // Default: 10 (valid: 4-31)
132
+ // Registration
133
+ defaultRole?: string | null // Auto-assign role to new users
134
+ publicRegistration?: boolean // Default: true; mounts POST /auth/register
135
+ bcryptRounds?: number // Default: 10 (valid: 4-31)
135
136
 
136
137
  // Frontend
137
138
  frontendUrl?: string // Password reset link base URL
@@ -181,7 +182,7 @@ All routes are prefixed with `/auth` and auto-registered by the plugin.
181
182
 
182
183
  | Method | Path | Description | Auth |
183
184
  |--------|------|-------------|------|
184
- | `POST` | `/auth/register` | Register new user | None |
185
+ | `POST` | `/auth/register` | Register new user (omitted when `publicRegistration: false`) | None |
185
186
  | `POST` | `/auth/login` | Login with email/password | None |
186
187
  | `POST` | `/auth/refresh` | Refresh access token (cookie) | None (uses refresh cookie) |
187
188
  | `POST` | `/auth/session/recover` | Reissue signed session without token rotation | Refresh cookie + recovery header |
@@ -194,7 +195,12 @@ All routes are prefixed with `/auth` and auto-registered by the plugin.
194
195
  | `POST` | `/auth/oauth/google/link` | Link Google to the current user | ✅ Required |
195
196
  | `GET` | `/auth/credential-setup/setup` | Read the pending setup session | Setup cookie |
196
197
  | `POST` | `/auth/credential-setup/change` | Replace the temporary credential | Setup cookie |
197
- | `POST` | `/auth/credential-setup/cancel` | Abandon the setup session | Setup cookie |
198
+ | `POST` | `/auth/credential-setup/cancel` | Abandon the setup session | Setup cookie |
199
+
200
+ Applications with an approval-owned onboarding flow should set
201
+ `publicRegistration: false`. This removes the unauthenticated route while
202
+ retaining `AuthService.registerUser()`, `provisionUser()`, and other internal
203
+ account-management APIs for trusted application services.
198
204
 
199
205
  ### Identity presets
200
206
 
@@ -1,4 +1,3 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
1
  import * as react from 'react';
3
2
  import { ReactNode, CSSProperties, ReactElement } from 'react';
4
3
  import { N as NajmAuthClient, H as HydrateSession } from '../../NajmAuthClient-ZtXTIUSF.js';
@@ -20,7 +19,7 @@ interface AuthProviderProps {
20
19
  */
21
20
  autoRefresh?: boolean;
22
21
  }
23
- declare function AuthProvider({ client, children, initialSession, autoRefresh, }: AuthProviderProps): react_jsx_runtime.JSX.Element;
22
+ declare function AuthProvider({ client, children, initialSession, autoRefresh, }: AuthProviderProps): react.JSX.Element;
24
23
 
25
24
  interface AuthBoundaryProps {
26
25
  children: ReactNode;
@@ -28,7 +27,7 @@ interface AuthBoundaryProps {
28
27
  /** Only gate while we truly have no identity; default false. */
29
28
  requireToken?: boolean;
30
29
  }
31
- declare function AuthBoundary({ children, fallback, requireToken, }: AuthBoundaryProps): react_jsx_runtime.JSX.Element;
30
+ declare function AuthBoundary({ children, fallback, requireToken, }: AuthBoundaryProps): react.JSX.Element;
32
31
 
33
32
  declare function useAuthClient(): NajmAuthClient;
34
33
 
@@ -240,7 +239,7 @@ interface SignedInProps {
240
239
  * </SignedIn>
241
240
  * ```
242
241
  */
243
- declare function SignedIn({ children }: SignedInProps): react_jsx_runtime.JSX.Element;
242
+ declare function SignedIn({ children }: SignedInProps): react.JSX.Element;
244
243
 
245
244
  interface SignedOutProps {
246
245
  children: ReactNode;
@@ -256,7 +255,7 @@ interface SignedOutProps {
256
255
  * </SignedOut>
257
256
  * ```
258
257
  */
259
- declare function SignedOut({ children }: SignedOutProps): react_jsx_runtime.JSX.Element;
258
+ declare function SignedOut({ children }: SignedOutProps): react.JSX.Element;
260
259
 
261
260
  interface AuthLoadingProps {
262
261
  children: ReactNode;
@@ -274,7 +273,7 @@ interface AuthLoadingProps {
274
273
  * <SignedOut>...</SignedOut>
275
274
  * ```
276
275
  */
277
- declare function AuthLoading({ children }: AuthLoadingProps): react_jsx_runtime.JSX.Element;
276
+ declare function AuthLoading({ children }: AuthLoadingProps): react.JSX.Element;
278
277
 
279
278
  interface CanProps {
280
279
  /** Required permission (e.g., 'read:posts') */
@@ -300,7 +299,7 @@ interface CanProps {
300
299
  * </Can>
301
300
  * ```
302
301
  */
303
- declare function Can({ permission, role, children, fallback }: CanProps): react_jsx_runtime.JSX.Element;
302
+ declare function Can({ permission, role, children, fallback }: CanProps): react.JSX.Element;
304
303
 
305
304
  interface RoleProps {
306
305
  /** Required role name */
@@ -324,7 +323,7 @@ interface RoleProps {
324
323
  * </Role>
325
324
  * ```
326
325
  */
327
- declare function Role(props: RoleProps): react_jsx_runtime.JSX.Element;
326
+ declare function Role(props: RoleProps): react.JSX.Element;
328
327
 
329
328
  interface IfAuthProps {
330
329
  /** Render when authenticated — receives user */
@@ -346,7 +345,7 @@ interface IfAuthProps {
346
345
  * />
347
346
  * ```
348
347
  */
349
- declare function IfAuth({ authenticated, unauthenticated, loading }: IfAuthProps): react_jsx_runtime.JSX.Element;
348
+ declare function IfAuth({ authenticated, unauthenticated, loading }: IfAuthProps): react.JSX.Element;
350
349
 
351
350
  interface ProtectedProps {
352
351
  children: ReactNode;
@@ -377,7 +376,7 @@ interface ProtectedProps {
377
376
  * </Protected>
378
377
  * ```
379
378
  */
380
- declare function Protected({ children, redirectTo, onUnauthenticated, role, permission, loadingFallback, fallback, }: ProtectedProps): react_jsx_runtime.JSX.Element;
379
+ declare function Protected({ children, redirectTo, onUnauthenticated, role, permission, loadingFallback, fallback, }: ProtectedProps): react.JSX.Element;
381
380
 
382
381
  interface AuthGateProps {
383
382
  children: ReactNode;
@@ -407,7 +406,7 @@ interface AuthGateProps {
407
406
  * **Without SSR hydration** (client-side nav, hard reload without initialSession):
408
407
  * Shows `loader` while attempting a token refresh, then either opens or redirects.
409
408
  */
410
- declare function AuthGate({ children, loader, redirectTo, onUnauthenticated, role, permission, denied, }: AuthGateProps): react_jsx_runtime.JSX.Element;
409
+ declare function AuthGate({ children, loader, redirectTo, onUnauthenticated, role, permission, denied, }: AuthGateProps): react.JSX.Element;
411
410
 
412
411
  interface UserNameProps {
413
412
  /** Optional fallback shown when no user is loaded */
@@ -422,7 +421,7 @@ interface UserNameProps {
422
421
  * <span>Hi, <UserName fallback="guest" />!</span>
423
422
  * ```
424
423
  */
425
- declare function UserName({ fallback }: UserNameProps): react_jsx_runtime.JSX.Element;
424
+ declare function UserName({ fallback }: UserNameProps): react.JSX.Element;
426
425
 
427
426
  interface UserEmailProps {
428
427
  fallback?: string;
@@ -435,7 +434,7 @@ interface UserEmailProps {
435
434
  * <p>Email: <UserEmail fallback="Not available" /></p>
436
435
  * ```
437
436
  */
438
- declare function UserEmail({ fallback }: UserEmailProps): react_jsx_runtime.JSX.Element;
437
+ declare function UserEmail({ fallback }: UserEmailProps): react.JSX.Element;
439
438
 
440
439
  interface UserRoleProps {
441
440
  fallback?: string;
@@ -448,7 +447,7 @@ interface UserRoleProps {
448
447
  * <span>Role: <UserRole fallback="none" /></span>
449
448
  * ```
450
449
  */
451
- declare function UserRole({ fallback }: UserRoleProps): react_jsx_runtime.JSX.Element;
450
+ declare function UserRole({ fallback }: UserRoleProps): react.JSX.Element;
452
451
 
453
452
  interface UserAvatarProps {
454
453
  /** Pixel size of the avatar (default: 32) */
@@ -474,7 +473,7 @@ interface UserAvatarProps {
474
473
  * <UserAvatar className="my-avatar" />
475
474
  * ```
476
475
  */
477
- declare function UserAvatar({ size, className, style, alt }: UserAvatarProps): react_jsx_runtime.JSX.Element;
476
+ declare function UserAvatar({ size, className, style, alt }: UserAvatarProps): react.JSX.Element;
478
477
 
479
478
  interface PermissionListProps {
480
479
  /** Render function for each permission */
@@ -492,7 +491,7 @@ interface PermissionListProps {
492
491
  * </PermissionList>
493
492
  * ```
494
493
  */
495
- declare function PermissionList({ children, fallback }: PermissionListProps): react_jsx_runtime.JSX.Element;
494
+ declare function PermissionList({ children, fallback }: PermissionListProps): react.JSX.Element;
496
495
 
497
496
  interface SignOutButtonProps {
498
497
  /** A single clickable child element. Its `onClick` will be wired to logout. */
@@ -579,6 +578,6 @@ interface OAuthCallbackProps {
579
578
  }) => ReactNode);
580
579
  defaultRedirect?: string;
581
580
  }
582
- declare function OAuthCallback({ fallback, errorFallback, defaultRedirect, }: OAuthCallbackProps): react_jsx_runtime.JSX.Element;
581
+ declare function OAuthCallback({ fallback, errorFallback, defaultRedirect, }: OAuthCallbackProps): react.JSX.Element;
583
582
 
584
583
  export { AuthBoundary, type AuthEventEntry, AuthGate, AuthLoading, AuthProvider, Can, GoogleLoginButton, IfAuth, LoginButton, OAuthCallback, PermissionList, Protected, RedirectToLogin, Role, type SessionStatus, SignOutButton, SignedIn, SignedOut, UserAvatar, UserEmail, UserName, UserRole, useAuth, useAuthClient, useAuthEvent, useAuthEvents, useChangePassword, useForgotPassword, useGoogleLogin, useLogin, useLogout, useOAuthCallback, usePermissions, useRegister, useResetPassword, useSession, useUser };
package/dist/index.d.ts CHANGED
@@ -1,7 +1,8 @@
1
1
  import * as najm_core from 'najm-core';
2
2
  import { Container } from 'najm-core';
3
3
  import { ValidationPluginConfig } from 'najm-validation';
4
- import { RateLimitPluginConfig, TimeWindow } from 'najm-rate';
4
+ import { RateLimitPluginConfig, RateLimitKeyContext, TimeWindow } from 'najm-rate';
5
+ import { CachePluginConfig, CacheService } from 'najm-cache';
5
6
  import { EmailPluginConfig, EmailService } from 'najm-email';
6
7
  import { R as ResolvedIdentityConfig, I as IdentityConfig, T as TemporaryCredentialInput } from './ma-sNHnUGLO.js';
7
8
  export { D as DEFAULT_IDENTITY_PRESET, E as EXACT_TEMPORARY_CREDENTIAL_KIND, a as IDENTITY_PRESETS, b as IdentityNormalizer, c as IdentityPreset, d as IdentityPresetName, M as MOROCCAN_CIN_TEMPORARY_CREDENTIAL_KIND, e as TemporaryCredential, f as TemporaryCredentialKind, g as compactPhone, i as isMoroccanCin, h as isTemporaryCredentialKind, m as moroccanCinTemporaryCredential, j as moroccoIdentityPreset, n as normalizeMoroccanCin, k as normalizeMoroccanPhone, l as normalizeTunisianPhone, r as resolveTemporaryCredentialKind, t as toTemporaryCredential, o as tunisiaIdentityPreset } from './ma-sNHnUGLO.js';
@@ -10,7 +11,6 @@ import { I18nService } from 'najm-i18n';
10
11
  import { TDb, SeedEntry } from 'najm-database';
11
12
  import { User, NewUser, RoleEntity, NewRoleEntity, Permission, NewPermission, RolePermission } from './schema/pg.js';
12
13
  export { CredentialSetupRequirement, CredentialSetupSession, NewCredentialSetupRequirement, NewCredentialSetupSession, NewOAuthAccount, NewRolePermission, NewToken, OAuthAccount, Token, authSchema, baseFields, credentialSetupRequirementsTable, credentialSetupSessionsTable, oauthAccountsTable, permissionsTable, rolePermissionsTable, rolesTable, tokenStatusEnum, tokenTypeEnum, tokensTable, userStatusEnum, usersTable } from './schema/pg.js';
13
- import { CacheService } from 'najm-cache';
14
14
  import { CookieService } from 'najm-cookies';
15
15
  import { Context } from 'hono';
16
16
  import { GuardResult } from 'najm-guard';
@@ -169,6 +169,8 @@ interface AuthConfig {
169
169
  frontendUrl: string;
170
170
  /** Registration mode: 'active' auto-activates, 'pending' requires admin approval (default: 'active') */
171
171
  registrationMode: 'active' | 'pending';
172
+ /** Whether the unauthenticated POST /auth/register route is mounted. */
173
+ publicRegistration: boolean;
172
174
  /** When true, users with emailVerified=false are blocked from logging in (default: false) */
173
175
  requireVerifiedEmail: boolean;
174
176
  /** Cookie path for the refresh token. Scope to the refresh endpoint to limit exposure (default: '/') */
@@ -234,6 +236,13 @@ type AuthPluginConfig = {
234
236
  frontendUrl?: string;
235
237
  /** Registration mode: 'active' auto-activates new users, 'pending' requires admin approval (default: 'active') */
236
238
  registrationMode?: 'active' | 'pending';
239
+ /**
240
+ * Mount the unauthenticated POST /auth/register route (default: true for
241
+ * backwards compatibility). Set false when onboarding belongs to an
242
+ * application-owned approval flow. Internal AuthService provisioning stays
243
+ * available.
244
+ */
245
+ publicRegistration?: boolean;
237
246
  /** Block login for users whose email is not verified (default: false) */
238
247
  requireVerifiedEmail?: boolean;
239
248
  /** Cookie path for the refresh token (default: '/'). Set e.g. '/auth' to keep it off unrelated routes. */
@@ -260,6 +269,15 @@ type AuthPluginConfig = {
260
269
  validation?: ValidationPluginConfig;
261
270
  /** Optional config forwarded to rateLimit() dependency */
262
271
  rateLimit?: RateLimitPluginConfig;
272
+ /**
273
+ * Optional config forwarded to the package-owned cache() dependency.
274
+ *
275
+ * Auth registers cache() itself, so a consumer cannot configure the store by
276
+ * registering its own plugin first. Pass it here to select a shared, durable
277
+ * backend — required in production wherever the cache backs rate limiting,
278
+ * since a per-process memory bucket resets on every restart.
279
+ */
280
+ cache?: CachePluginConfig;
263
281
  /** Email transport used by password reset and verification flows. */
264
282
  email?: EmailPluginConfig;
265
283
  /** AES-256-GCM key for reversible encryption (e.g. API keys). Falls back to NAJM_ENCRYPTION_KEY env var. */
@@ -1644,15 +1662,17 @@ declare class AuthService {
1644
1662
  }
1645
1663
 
1646
1664
  /**
1647
- * Composite key: IP + hashed normalized login/registration identity.
1648
- * Buckets rate limits per IP+credential combo so different users
1649
- * on the same IP (e.g. localhost, NAT) don't share a single bucket.
1665
+ * Composite key: resolved client address + hashed normalized identity.
1666
+ * Buckets rate limits per client+credential combo so different users
1667
+ * on the same address (e.g. localhost, NAT) don't share a single bucket.
1668
+ *
1669
+ * The address arrives already resolved through the configured trusted-proxy
1670
+ * boundary; this module must never parse forwarding headers itself.
1650
1671
  */
1651
- declare const authIdentityRateLimitKey: (ctx: Context) => Promise<string>;
1672
+ declare const authIdentityRateLimitKey: (ctx: Context, keyContext?: RateLimitKeyContext) => Promise<string>;
1652
1673
  declare class AuthController {
1653
1674
  private authService;
1654
1675
  constructor(authService: AuthService);
1655
- registerUser(body: RegisterDto): Promise<SanitizedUser>;
1656
1676
  loginUser(body: LoginDto): Promise<LoginResult>;
1657
1677
  inviteUser(body: InviteUserDto): Promise<Omit<{
1658
1678
  password: string;
@@ -1772,6 +1792,17 @@ declare class AuthIdentityContextService {
1772
1792
  configure(): Promise<void>;
1773
1793
  }
1774
1794
 
1795
+ /**
1796
+ * Public self-registration is isolated from the rest of the auth transport so
1797
+ * applications can omit this controller without disabling internal account
1798
+ * provisioning through AuthService.
1799
+ */
1800
+ declare class RegistrationController {
1801
+ private authService;
1802
+ constructor(authService: AuthService);
1803
+ registerUser(body: RegisterDto): Promise<SanitizedUser>;
1804
+ }
1805
+
1775
1806
  type IdentityResolver = (value: unknown) => string | null;
1776
1807
  /**
1777
1808
  * Build the identifier pipeline used by login lookup, lockout accounting, and
@@ -1811,7 +1842,10 @@ interface RunAsUser {
1811
1842
  }
1812
1843
  declare function runAsUser<T>(container: Container, user: RunAsUser, fn: () => Promise<T> | T): Promise<T>;
1813
1844
 
1814
- declare const AUTH_MODULE: readonly [typeof AuthService, typeof AuthSessionService, typeof CookieManager, typeof EncryptionService, typeof AuthGuard, typeof AuthController, typeof AuthResolver, typeof AuthIdentityContextService];
1845
+ declare const AUTH_CORE_MODULE: readonly [typeof AuthService, typeof AuthSessionService, typeof CookieManager, typeof EncryptionService, typeof AuthGuard, typeof AuthController, typeof AuthResolver, typeof AuthIdentityContextService];
1846
+ declare const PUBLIC_REGISTRATION_MODULE: readonly [typeof RegistrationController];
1847
+ /** Full module retained for consumers that register the exported module directly. */
1848
+ declare const AUTH_MODULE: readonly [typeof AuthService, typeof AuthSessionService, typeof CookieManager, typeof EncryptionService, typeof AuthGuard, typeof AuthController, typeof AuthResolver, typeof AuthIdentityContextService, typeof RegistrationController];
1815
1849
 
1816
1850
  declare class PermissionRepository {
1817
1851
  db: TDb;
@@ -2765,4 +2799,4 @@ declare const authSeed: (config: AuthSeedConfig) => Record<string, SeedEntry>;
2765
2799
  */
2766
2800
  declare function seedAuthData(config: SeedAuthDataConfig): Promise<SeedAuthDataResult>;
2767
2801
 
2768
- export { AUTH_CONFIG, en as AUTH_EN, AUTH_LOCALES, AUTH_LOGIN_RATE_LIMIT_ENV, AUTH_MODULE, AUTH_PERMISSIONS, AUTH_ROLE, AUTH_SCHEMA, AUTH_SUPPORTED_LANGUAGES, AUTH_USER, type AssignPermissionDto, type AssignRoleDto, type AssignRoleParams, type AuthConfig, AuthController, AuthGuard, type AuthLoginRateLimitConfig, type AuthPluginConfig, AuthQueries, type AuthRateLimitEnvironment, AuthResolver, type AuthSchema, type AuthSeedConfig, AuthService, AuthSessionService, type AuthUser, CREDENTIAL_SETUP_CODES, CREDENTIAL_SETUP_MODULE, Can, CanCreate, CanDelete, CanList, CanRead, CanUpdate, type ChainableGuard, type ChangePasswordDto, type CheckPermissionDto, type ConfiguredOwnership, type ConfirmResetPasswordDto, CookieManager, type CreatePermissionDto, type CreateRoleDto, type CreateTokenDto, type CreateUserDto, type CredentialSetupChangeDto, type CredentialSetupCode, type CredentialSetupConfig, CredentialSetupController, type CredentialSetupOptions, type CredentialSetupPasswordOptions, type CredentialSetupPending, CredentialSetupRepository, CredentialSetupRequirementRepository, type CredentialSetupRequirementRow, CredentialSetupRequirementService, CredentialSetupService, type CredentialSetupSessionInfo, type CredentialSetupStarted, DEFAULT_AUTH_LOGIN_RATE_LIMIT, DEFAULT_CREDENTIAL_SETUP_COOKIE_NAME, DEFAULT_CREDENTIAL_SETUP_TTL_MS, type DefineRolesOptions, type EmailParam, EncryptionService, type GoogleOAuthConfig, IdentityConfig, type IdentityResolver, type InviteUserDto, type JwtConfig, type JwtPayload, type LanguageParam, type LoginDto, type LoginResult, NewPermission, NewRoleEntity, NewUser, type OAuthConfig, type OAuthProvider, Owned, type OwnedMethods, type OwnershipConfig, type OwnershipProvider, type OwnershipRule, OwnershipToken, type OwnershipTokenOptions, PASSWORD_SETUP_PURPOSE, PasswordSetupService, Permission, PermissionController, PermissionGuard, type PermissionIdParam, PermissionRepository, PermissionService, PermissionValidator, Policy, type ProvisionUserInput, type ProvisionUserWithPasswordInput, type ProvisionUserWithSetupInput, ROLES, ROLE_GROUPS, type RefreshTokenDto, type RegisterDto, type ResetPasswordDto, type ResolvedCredentialSetupConfig, ResolvedIdentityConfig, type ResourceAccessor, type ResourceGuards, type ResourceGuardsOptions, type RevokeTokenDto, Role, RoleController, RoleEntity, RoleGuard, type RoleIdParam, type RoleInput, RolePermission, RoleRepository, RoleService, type RoleType, RoleValidator, type RunAsUser, type SanitizedUser, ScopeContext, type ScopeResult, type SeedAuthDataConfig, type SeedAuthDataResult, type SeedUserConfig, type SessionCookieData, TOKEN_STATUS, TOKEN_TYPE, TemporaryCredentialInput, type TokenIdParam, type TokenPair, TokenRepository, TokenService, USER_STATUS, type UpdatePermissionDto, type UpdateRoleDto, type UpdateTokenDto, type UpdateUserDto, User, UserController, type UserIdInParam, type UserIdParam, type UserListQuery, UserRepository, UserService, UserValidator, type UserWithPermissions, type VerifyTokenDto, assignPermissionDto, assignRoleDto, assignRoleParams, auth$1 as auth, authIdentityRateLimitKey, authSeed, avatarsPath, calculateAge, calculateYearsOfExperience, changePasswordDto, checkPermissionDto, clean, configureOwnership, confirmResetPasswordDto, createIdentityResolver, createPermissionDto, createRoleDto, createTokenDto, createUserDto, credentialSetupChangeDto, credentialSetupError, defaultCredentialSetupPasswordSchema, defineRoles, emailParam, formatDate, getAuthLocale, getAvatarFile, inviteUserDto, isAdmin, isAdministrator, isAuth, isEmailIdentifier, isEmpty, isFile, isPath, join, languageParam, loginDto, normalizeAuthIdentifier, normalizeSetupPurpose, own, parseSchema, permissionIdParam, pickProps, refreshTokenDto, registerDto, resetPasswordDto, resolveAuthLoginRateLimitConfig, revokeTokenDto, roleIdParam, runAsUser, seedAuthData, tokenIdParam, updatePermissionDto, updateRoleDto, updateTokenDto, updateUserDto, userIdInParam, userIdParam, userListQuery, verifyTokenDto, where };
2802
+ export { AUTH_CONFIG, AUTH_CORE_MODULE, en as AUTH_EN, AUTH_LOCALES, AUTH_LOGIN_RATE_LIMIT_ENV, AUTH_MODULE, AUTH_PERMISSIONS, AUTH_ROLE, AUTH_SCHEMA, AUTH_SUPPORTED_LANGUAGES, AUTH_USER, type AssignPermissionDto, type AssignRoleDto, type AssignRoleParams, type AuthConfig, AuthController, AuthGuard, type AuthLoginRateLimitConfig, type AuthPluginConfig, AuthQueries, type AuthRateLimitEnvironment, AuthResolver, type AuthSchema, type AuthSeedConfig, AuthService, AuthSessionService, type AuthUser, CREDENTIAL_SETUP_CODES, CREDENTIAL_SETUP_MODULE, Can, CanCreate, CanDelete, CanList, CanRead, CanUpdate, type ChainableGuard, type ChangePasswordDto, type CheckPermissionDto, type ConfiguredOwnership, type ConfirmResetPasswordDto, CookieManager, type CreatePermissionDto, type CreateRoleDto, type CreateTokenDto, type CreateUserDto, type CredentialSetupChangeDto, type CredentialSetupCode, type CredentialSetupConfig, CredentialSetupController, type CredentialSetupOptions, type CredentialSetupPasswordOptions, type CredentialSetupPending, CredentialSetupRepository, CredentialSetupRequirementRepository, type CredentialSetupRequirementRow, CredentialSetupRequirementService, CredentialSetupService, type CredentialSetupSessionInfo, type CredentialSetupStarted, DEFAULT_AUTH_LOGIN_RATE_LIMIT, DEFAULT_CREDENTIAL_SETUP_COOKIE_NAME, DEFAULT_CREDENTIAL_SETUP_TTL_MS, type DefineRolesOptions, type EmailParam, EncryptionService, type GoogleOAuthConfig, IdentityConfig, type IdentityResolver, type InviteUserDto, type JwtConfig, type JwtPayload, type LanguageParam, type LoginDto, type LoginResult, NewPermission, NewRoleEntity, NewUser, type OAuthConfig, type OAuthProvider, Owned, type OwnedMethods, type OwnershipConfig, type OwnershipProvider, type OwnershipRule, OwnershipToken, type OwnershipTokenOptions, PASSWORD_SETUP_PURPOSE, PUBLIC_REGISTRATION_MODULE, PasswordSetupService, Permission, PermissionController, PermissionGuard, type PermissionIdParam, PermissionRepository, PermissionService, PermissionValidator, Policy, type ProvisionUserInput, type ProvisionUserWithPasswordInput, type ProvisionUserWithSetupInput, ROLES, ROLE_GROUPS, type RefreshTokenDto, type RegisterDto, RegistrationController, type ResetPasswordDto, type ResolvedCredentialSetupConfig, ResolvedIdentityConfig, type ResourceAccessor, type ResourceGuards, type ResourceGuardsOptions, type RevokeTokenDto, Role, RoleController, RoleEntity, RoleGuard, type RoleIdParam, type RoleInput, RolePermission, RoleRepository, RoleService, type RoleType, RoleValidator, type RunAsUser, type SanitizedUser, ScopeContext, type ScopeResult, type SeedAuthDataConfig, type SeedAuthDataResult, type SeedUserConfig, type SessionCookieData, TOKEN_STATUS, TOKEN_TYPE, TemporaryCredentialInput, type TokenIdParam, type TokenPair, TokenRepository, TokenService, USER_STATUS, type UpdatePermissionDto, type UpdateRoleDto, type UpdateTokenDto, type UpdateUserDto, User, UserController, type UserIdInParam, type UserIdParam, type UserListQuery, UserRepository, UserService, UserValidator, type UserWithPermissions, type VerifyTokenDto, assignPermissionDto, assignRoleDto, assignRoleParams, auth$1 as auth, authIdentityRateLimitKey, authSeed, avatarsPath, calculateAge, calculateYearsOfExperience, changePasswordDto, checkPermissionDto, clean, configureOwnership, confirmResetPasswordDto, createIdentityResolver, createPermissionDto, createRoleDto, createTokenDto, createUserDto, credentialSetupChangeDto, credentialSetupError, defaultCredentialSetupPasswordSchema, defineRoles, emailParam, formatDate, getAuthLocale, getAvatarFile, inviteUserDto, isAdmin, isAdministrator, isAuth, isEmailIdentifier, isEmpty, isFile, isPath, join, languageParam, loginDto, normalizeAuthIdentifier, normalizeSetupPurpose, own, parseSchema, permissionIdParam, pickProps, refreshTokenDto, registerDto, resetPasswordDto, resolveAuthLoginRateLimitConfig, revokeTokenDto, roleIdParam, runAsUser, seedAuthData, tokenIdParam, updatePermissionDto, updateRoleDto, updateTokenDto, updateUserDto, userIdInParam, userIdParam, userListQuery, verifyTokenDto, where };