@warlock.js/auth 5.31.0 → 5.32.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.
Files changed (159) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/esm/commands/auth-cleanup-command.d.mts +1 -2
  3. package/esm/commands/auth-cleanup-command.d.mts.map +1 -1
  4. package/esm/commands/auth-purge-never-expiring-command.d.mts +1 -2
  5. package/esm/commands/auth-purge-never-expiring-command.d.mts.map +1 -1
  6. package/esm/commands/jwt-secret-generator-command.d.mts +1 -2
  7. package/esm/commands/jwt-secret-generator-command.d.mts.map +1 -1
  8. package/esm/contracts/auth-contract.d.mts +1 -3
  9. package/esm/contracts/auth-contract.d.mts.map +1 -1
  10. package/esm/contracts/index.d.mts +2 -1
  11. package/esm/contracts/providers.d.mts +82 -50
  12. package/esm/contracts/providers.d.mts.map +1 -1
  13. package/esm/contracts/request-locals.d.mts +2 -3
  14. package/esm/contracts/request-locals.d.mts.map +1 -1
  15. package/esm/contracts/types.d.mts +59 -43
  16. package/esm/contracts/types.d.mts.map +1 -1
  17. package/esm/errors/auth-provider-sdk-missing.error.d.mts +1 -3
  18. package/esm/errors/auth-provider-sdk-missing.error.d.mts.map +1 -1
  19. package/esm/errors/email-not-verified.error.d.mts +1 -3
  20. package/esm/errors/email-not-verified.error.d.mts.map +1 -1
  21. package/esm/errors/index.d.mts +2 -1
  22. package/esm/errors/index.mjs +1 -1
  23. package/esm/errors/invalid-one-time-token.error.d.mts +1 -3
  24. package/esm/errors/invalid-one-time-token.error.d.mts.map +1 -1
  25. package/esm/errors/invalid-passkey.error.d.mts +1 -3
  26. package/esm/errors/invalid-passkey.error.d.mts.map +1 -1
  27. package/esm/errors/invalid-provider-callback.error.d.mts +1 -3
  28. package/esm/errors/invalid-provider-callback.error.d.mts.map +1 -1
  29. package/esm/errors/notifications-unavailable.error.d.mts +1 -3
  30. package/esm/errors/notifications-unavailable.error.d.mts.map +1 -1
  31. package/esm/errors/provider-email-not-verified.error.d.mts +1 -3
  32. package/esm/errors/provider-email-not-verified.error.d.mts.map +1 -1
  33. package/esm/index.d.mts +8 -0
  34. package/esm/localization/auth-default-translations.d.mts +1 -3
  35. package/esm/localization/auth-default-translations.d.mts.map +1 -1
  36. package/esm/localization/auth-translations.type.d.mts +11 -7
  37. package/esm/localization/auth-translations.type.d.mts.map +1 -1
  38. package/esm/localization/index.mjs +1 -1
  39. package/esm/localization/register-auth-translations.d.mts +1 -2
  40. package/esm/localization/register-auth-translations.d.mts.map +1 -1
  41. package/esm/middleware/auth.middleware.d.mts +10 -10
  42. package/esm/middleware/auth.middleware.d.mts.map +1 -1
  43. package/esm/middleware/csrf-origin-check.d.mts +4 -6
  44. package/esm/middleware/csrf-origin-check.d.mts.map +1 -1
  45. package/esm/middleware/csrf-origin-check.mjs +1 -1
  46. package/esm/middleware/csrf-origin-check.mjs.map +1 -1
  47. package/esm/middleware/index.d.mts +2 -1
  48. package/esm/middleware/index.mjs +1 -1
  49. package/esm/middleware/login-throttle.middleware.d.mts +4 -6
  50. package/esm/middleware/login-throttle.middleware.d.mts.map +1 -1
  51. package/esm/middleware/one-time-token-throttle.middleware.d.mts +2 -4
  52. package/esm/middleware/one-time-token-throttle.middleware.d.mts.map +1 -1
  53. package/esm/middleware/otp-throttle.middleware.d.mts +2 -4
  54. package/esm/middleware/otp-throttle.middleware.d.mts.map +1 -1
  55. package/esm/middleware/require-verified-email.middleware.d.mts +1 -3
  56. package/esm/middleware/require-verified-email.middleware.d.mts.map +1 -1
  57. package/esm/models/access-token/access-token.model.d.mts +6 -6
  58. package/esm/models/access-token/access-token.model.d.mts.map +1 -1
  59. package/esm/models/access-token/index.d.mts +2 -1
  60. package/esm/models/access-token/index.mjs +1 -1
  61. package/esm/models/auth-token-family/auth-token-family.model.d.mts +2 -4
  62. package/esm/models/auth-token-family/auth-token-family.model.d.mts.map +1 -1
  63. package/esm/models/auth-token-family/index.d.mts +2 -1
  64. package/esm/models/auth-token-family/index.mjs +1 -1
  65. package/esm/models/auth.model.d.mts +1 -3
  66. package/esm/models/auth.model.d.mts.map +1 -1
  67. package/esm/models/index.d.mts +8 -2
  68. package/esm/models/index.d.mts.map +1 -1
  69. package/esm/models/index.mjs +1 -1
  70. package/esm/models/one-time-token/index.d.mts +2 -1
  71. package/esm/models/one-time-token/index.mjs +1 -1
  72. package/esm/models/one-time-token/one-time-token.model.d.mts +3 -5
  73. package/esm/models/one-time-token/one-time-token.model.d.mts.map +1 -1
  74. package/esm/models/passkey-credential/index.d.mts +2 -1
  75. package/esm/models/passkey-credential/index.mjs +1 -1
  76. package/esm/models/passkey-credential/passkey-credential.model.d.mts +2 -4
  77. package/esm/models/passkey-credential/passkey-credential.model.d.mts.map +1 -1
  78. package/esm/models/provider-account/index.d.mts +2 -1
  79. package/esm/models/provider-account/index.mjs +1 -1
  80. package/esm/models/provider-account/provider-account.model.d.mts +2 -4
  81. package/esm/models/provider-account/provider-account.model.d.mts.map +1 -1
  82. package/esm/models/refresh-token/index.d.mts +2 -1
  83. package/esm/models/refresh-token/index.mjs +1 -1
  84. package/esm/models/refresh-token/refresh-token.model.d.mts +7 -7
  85. package/esm/models/refresh-token/refresh-token.model.d.mts.map +1 -1
  86. package/esm/otp/index.d.mts +2 -1
  87. package/esm/otp/index.mjs +1 -1
  88. package/esm/otp/otp.d.mts +2 -4
  89. package/esm/otp/otp.d.mts.map +1 -1
  90. package/esm/otp/otp.mjs +2 -1
  91. package/esm/otp/otp.mjs.map +1 -1
  92. package/esm/passkeys/index.d.mts +2 -1
  93. package/esm/passkeys/index.mjs +1 -1
  94. package/esm/passkeys/passkey-authentication.d.mts +2 -4
  95. package/esm/passkeys/passkey-authentication.d.mts.map +1 -1
  96. package/esm/passkeys/passkey-authentication.mjs +2 -1
  97. package/esm/passkeys/passkey-authentication.mjs.map +1 -1
  98. package/esm/passkeys/passkey-registration.d.mts +3 -4
  99. package/esm/passkeys/passkey-registration.d.mts.map +1 -1
  100. package/esm/passkeys/simplewebauthn.d.mts +2 -3
  101. package/esm/passkeys/simplewebauthn.d.mts.map +1 -1
  102. package/esm/passkeys/simplewebauthn.mjs +1 -1
  103. package/esm/providers/apple-provider.d.mts +5 -9
  104. package/esm/providers/apple-provider.d.mts.map +1 -1
  105. package/esm/providers/discord-provider.d.mts +2 -7
  106. package/esm/providers/discord-provider.d.mts.map +1 -1
  107. package/esm/providers/facebook-provider.d.mts +2 -7
  108. package/esm/providers/facebook-provider.d.mts.map +1 -1
  109. package/esm/providers/github-provider.d.mts +2 -7
  110. package/esm/providers/github-provider.d.mts.map +1 -1
  111. package/esm/providers/google-provider.d.mts +5 -10
  112. package/esm/providers/google-provider.d.mts.map +1 -1
  113. package/esm/providers/index.d.mts +2 -1
  114. package/esm/providers/index.mjs +1 -1
  115. package/esm/providers/linkedin-provider.d.mts +3 -8
  116. package/esm/providers/linkedin-provider.d.mts.map +1 -1
  117. package/esm/providers/provider-login.d.mts +3 -5
  118. package/esm/providers/provider-login.d.mts.map +1 -1
  119. package/esm/providers/provider-login.mjs +3 -2
  120. package/esm/providers/provider-login.mjs.map +1 -1
  121. package/esm/providers/provider-state-cookie.mjs +3 -2
  122. package/esm/providers/provider-state-cookie.mjs.map +1 -1
  123. package/esm/providers/x-provider.d.mts +2 -7
  124. package/esm/providers/x-provider.d.mts.map +1 -1
  125. package/esm/services/auth-events.d.mts +5 -6
  126. package/esm/services/auth-events.d.mts.map +1 -1
  127. package/esm/services/auth.service.d.mts +10 -9
  128. package/esm/services/auth.service.d.mts.map +1 -1
  129. package/esm/services/current-user.d.mts +1 -3
  130. package/esm/services/current-user.d.mts.map +1 -1
  131. package/esm/services/email-verification.d.mts +3 -5
  132. package/esm/services/email-verification.d.mts.map +1 -1
  133. package/esm/services/generate-jwt-secret.d.mts +1 -2
  134. package/esm/services/generate-jwt-secret.d.mts.map +1 -1
  135. package/esm/services/index.d.mts +2 -1
  136. package/esm/services/index.mjs +1 -1
  137. package/esm/services/jwt.d.mts +8 -29
  138. package/esm/services/jwt.d.mts.map +1 -1
  139. package/esm/services/jwt.mjs +2 -2
  140. package/esm/services/jwt.mjs.map +1 -1
  141. package/esm/services/one-time-tokens.d.mts +6 -6
  142. package/esm/services/one-time-tokens.d.mts.map +1 -1
  143. package/esm/services/password-reset.d.mts +2 -4
  144. package/esm/services/password-reset.d.mts.map +1 -1
  145. package/esm/services/resolve-request-user.d.mts +19 -14
  146. package/esm/services/resolve-request-user.d.mts.map +1 -1
  147. package/esm/services/token-family-operation.mjs +1 -1
  148. package/esm/session/index.d.mts +2 -1
  149. package/esm/session/index.mjs +1 -1
  150. package/esm/session/page-session.d.mts +26 -18
  151. package/esm/session/page-session.d.mts.map +1 -1
  152. package/esm/utils/auth-error-codes.d.mts +11 -22
  153. package/esm/utils/auth-error-codes.d.mts.map +1 -1
  154. package/esm/utils/index.mjs +1 -1
  155. package/esm/utils/safe-equal.d.mts +1 -2
  156. package/esm/utils/safe-equal.d.mts.map +1 -1
  157. package/esm/utils/token-expiry.d.mts +3 -4
  158. package/esm/utils/token-expiry.d.mts.map +1 -1
  159. package/package.json +8 -8
package/CHANGELOG.md CHANGED
@@ -4,6 +4,12 @@ All notable changes to `@warlock.js/auth` are documented in this file.
4
4
 
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). `@warlock.js/*` packages are released in lockstep — every package shares the same version number, so a version below may list only the changes that affected this package.
6
6
 
7
+ ## 5.32.0 - 2026-10-18
8
+
9
+ ### Changed
10
+
11
+ - Pin the package development compiler to TypeScript 7.0.2 and use explicit Node types and source roots with supported module resolution.
12
+
7
13
  ## 5.31.0 - 2026-10-18
8
14
 
9
15
  ### Added
@@ -7,7 +7,6 @@
7
7
  * warlock auth:cleanup
8
8
  * ```
9
9
  */
10
- declare function registerAuthCleanupCommand(): import("@warlock.js/core").CLICommand;
10
+ export declare function registerAuthCleanupCommand(): import("@warlock.js/core").CLICommand;
11
11
  //#endregion
12
- export { registerAuthCleanupCommand };
13
12
  //# sourceMappingURL=auth-cleanup-command.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"auth-cleanup-command.d.mts","names":[],"sources":["../../../../../../../../packages/auth/src/commands/auth-cleanup-command.ts"],"mappings":";;AAYA;;;;AAA0C;;;iBAA1B,0BAAA,+BAA0B,UAAA"}
1
+ {"version":3,"file":"auth-cleanup-command.d.mts","names":[],"sources":["../../../../../../../../packages/auth/src/commands/auth-cleanup-command.ts"],"mappings":";;;;;;;;;wBAYgB,yDAA0B"}
@@ -23,7 +23,6 @@
23
23
  * warlock auth.purge-never-expiring # report, then delete
24
24
  * ```
25
25
  */
26
- declare function registerAuthPurgeNeverExpiringCommand(): import("@warlock.js/core").CLICommand;
26
+ export declare function registerAuthPurgeNeverExpiringCommand(): import("@warlock.js/core").CLICommand;
27
27
  //#endregion
28
- export { registerAuthPurgeNeverExpiringCommand };
29
28
  //# sourceMappingURL=auth-purge-never-expiring-command.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"auth-purge-never-expiring-command.d.mts","names":[],"sources":["../../../../../../../../packages/auth/src/commands/auth-purge-never-expiring-command.ts"],"mappings":";;AA4BA;;;;AAAqD;;;;;;;;;;;;;;;;;;;iBAArC,qCAAA,+BAAqC,UAAA"}
1
+ {"version":3,"file":"auth-purge-never-expiring-command.d.mts","names":[],"sources":["../../../../../../../../packages/auth/src/commands/auth-purge-never-expiring-command.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;wBA4BgB,oEAAqC"}
@@ -1,5 +1,4 @@
1
1
  //#region ../../packages/auth/src/commands/jwt-secret-generator-command.d.ts
2
- declare function registerJWTSecretGeneratorCommand(): import("@warlock.js/core").CLICommand;
2
+ export declare function registerJWTSecretGeneratorCommand(): import("@warlock.js/core").CLICommand;
3
3
  //#endregion
4
- export { registerJWTSecretGeneratorCommand };
5
4
  //# sourceMappingURL=jwt-secret-generator-command.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"jwt-secret-generator-command.d.mts","names":[],"sources":["../../../../../../../../packages/auth/src/commands/jwt-secret-generator-command.ts"],"mappings":";iBAGgB,iCAAA,+BAAiC,UAAA"}
1
+ {"version":3,"file":"jwt-secret-generator-command.d.mts","names":[],"sources":["../../../../../../../../packages/auth/src/commands/jwt-secret-generator-command.ts"],"mappings":";wBAGgB,gEAAiC"}
@@ -1,6 +1,5 @@
1
1
  import { AccessTokenOutput, DeviceInfo, TokenPair } from "./types.mjs";
2
2
  import { RefreshToken } from "../models/refresh-token/refresh-token.model.mjs";
3
-
4
3
  //#region ../../packages/auth/src/contracts/auth-contract.d.ts
5
4
  /**
6
5
  * Surface every authenticable user model exposes once it extends the
@@ -10,7 +9,7 @@ import { RefreshToken } from "../models/refresh-token/refresh-token.model.mjs";
10
9
  * Kept in sync with `Auth` — if a method here drifts from the class, the
11
10
  * `implements Authenticable` clause on `Auth` fails to compile.
12
11
  */
13
- interface Authenticable {
12
+ export interface Authenticable {
14
13
  /**
15
14
  * Discriminator identifying which user type this model represents.
16
15
  * Drives token payloads and `authMiddleware` type checks.
@@ -36,5 +35,4 @@ interface Authenticable {
36
35
  confirmPassword(password: string): Promise<boolean>;
37
36
  }
38
37
  //#endregion
39
- export { Authenticable };
40
38
  //# sourceMappingURL=auth-contract.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"auth-contract.d.mts","names":[],"sources":["../../../../../../../../packages/auth/src/contracts/auth-contract.ts"],"mappings":";;;;;;AAWA;;;;;;UAAiB,aAAA;EAiBwC;;;;EAAA,IAZnD,QAAA;EAsB+B;;;;EAhBnC,mBAAA,CAAoB,OAAA,GAAU,MAAA,oBAA0B,OAAA,CAAQ,iBAAA;EAAlC;;;;EAM9B,oBAAA,CAAqB,UAAA,GAAa,UAAA,GAAa,OAAA,CAAQ,YAAA;EAArB;;;EAKlC,eAAA,CAAgB,UAAA,GAAa,UAAA,GAAa,OAAA,CAAQ,SAAA;EAAlD;;;EAKA,eAAA,CAAgB,QAAA,WAAmB,OAAA;AAAA"}
1
+ {"version":3,"file":"auth-contract.d.mts","names":[],"sources":["../../../../../../../../packages/auth/src/contracts/auth-contract.ts"],"mappings":";;;;;;;;;;;iBAWiB;;;;;MAKX;;;;;EAMJ,oBAAoB,UAAU,0BAA0B,QAAQ;;;;;EAMhE,qBAAqB,aAAa,aAAa,QAAQ;;;;EAKvD,gBAAgB,aAAa,aAAa,QAAQ;;;;EAKlD,gBAAgB,mBAAmB"}
@@ -1,4 +1,5 @@
1
1
  import { AppleProviderConfig, AuthProvider, DiscordProviderConfig, FacebookProviderConfig, GitHubProviderConfig, GoogleProviderConfig, LinkedInProviderConfig, OtpConfig, OtpMessage, OtpSender, PasskeysConfig, ProviderAuthorizationState, ProviderCallbackParams, ProviderProfile, ProviderUserCreator, ProvidersConfig, XProviderConfig } from "./providers.mjs";
2
2
  import { AccessTokenConfig, AccessTokenOutput, AuthConfigurations, AuthCredentialDescriptor, AuthCredentials, AuthMiddlewareOptions, AuthNotification, AuthRefreshCredentialDescriptor, CanAuthenticate, ClearAuthCookieOptions, CookieAuthConfig, CookieDomainResolver, CsrfConfig, DeviceInfo, EmailVerificationConfig, LegacyJwtConfig, LoginResult, LogoutWithoutTokenBehavior, NO_EXPIRATION, OneTimeTokenConfig, OneTimeTokenNotificationData, OneTimeTokenUrlBuilder, PageAuthConfig, PasswordResetConfig, PasswordSetter, RefreshTokenConfig, SetAuthCookieOptions, TokenFrom, TokenPair } from "./types.mjs";
3
3
  import { Authenticable } from "./auth-contract.mjs";
4
- import { RequestUser } from "./request-locals.mjs";
4
+ import { RequestUser } from "./request-locals.mjs";
5
+ export { AccessTokenConfig, AccessTokenOutput, AppleProviderConfig, AuthConfigurations, AuthCredentialDescriptor, AuthCredentials, AuthMiddlewareOptions, AuthNotification, AuthProvider, AuthRefreshCredentialDescriptor, Authenticable, CanAuthenticate, ClearAuthCookieOptions, CookieAuthConfig, CookieDomainResolver, CsrfConfig, DeviceInfo, DiscordProviderConfig, EmailVerificationConfig, FacebookProviderConfig, GitHubProviderConfig, GoogleProviderConfig, LegacyJwtConfig, LinkedInProviderConfig, LoginResult, LogoutWithoutTokenBehavior, NO_EXPIRATION, OneTimeTokenConfig, OneTimeTokenNotificationData, OneTimeTokenUrlBuilder, OtpConfig, OtpMessage, OtpSender, PageAuthConfig, PasskeysConfig, PasswordResetConfig, PasswordSetter, ProviderAuthorizationState, ProviderCallbackParams, ProviderProfile, ProviderUserCreator, ProvidersConfig, RefreshTokenConfig, RequestUser, SetAuthCookieOptions, TokenFrom, TokenPair, XProviderConfig };
@@ -1,12 +1,11 @@
1
1
  import { Auth } from "../models/auth.model.mjs";
2
2
  import { ChildModel } from "@warlock.js/cascade";
3
-
4
3
  //#region ../../packages/auth/src/contracts/providers.d.ts
5
4
  /**
6
5
  * The per-login secrets a redirect provider round-trips: `state` (CSRF),
7
6
  * `nonce` (id_token replay binding) and the PKCE `codeVerifier`.
8
7
  */
9
- type ProviderAuthorizationState = {
8
+ export type ProviderAuthorizationState = {
10
9
  state: string;
11
10
  nonce: string;
12
11
  codeVerifier: string;
@@ -16,18 +15,22 @@ type ProviderAuthorizationState = {
16
15
  * callback query and the state that was stored when the login started. The
17
16
  * caller has already checked `query.state` against `expected.state`.
18
17
  */
19
- type ProviderCallbackParams = {
18
+ export type ProviderCallbackParams = {
20
19
  query: Record<string, unknown>;
21
20
  expected: ProviderAuthorizationState;
22
21
  };
23
22
  /** The identity a provider asserts, normalized across providers. */
24
- type ProviderProfile = {
25
- /** Provider name, e.g. `"google"`. */provider: string; /** The provider's stable user id (`sub`). The link key — never the email. */
23
+ export type ProviderProfile = {
24
+ /** Provider name, e.g. `"google"`. */
25
+ provider: string;
26
+ /** The provider's stable user id (`sub`). The link key — never the email. */
26
27
  providerUserId: string;
27
- email?: string; /** Whether the PROVIDER verified `email`. Accounts are never linked on `false`. */
28
+ email?: string;
29
+ /** Whether the PROVIDER verified `email`. Accounts are never linked on `false`. */
28
30
  emailVerified: boolean;
29
31
  name?: string;
30
- avatar?: string; /** The verified claims the profile was built from. */
32
+ avatar?: string;
33
+ /** The verified claims the profile was built from. */
31
34
  raw: Record<string, unknown>;
32
35
  };
33
36
  /**
@@ -35,7 +38,7 @@ type ProviderProfile = {
35
38
  * Register an instance under `auth.providers.custom.<name>` to add one auth does
36
39
  * not ship.
37
40
  */
38
- interface AuthProvider {
41
+ export interface AuthProvider {
39
42
  readonly name: string;
40
43
  /**
41
44
  * How the provider's callback arrives. `"query"` (default) is a top-level
@@ -51,60 +54,78 @@ interface AuthProvider {
51
54
  handleCallback(params: ProviderCallbackParams): Promise<ProviderProfile>;
52
55
  }
53
56
  /** `auth.providers.google`. */
54
- type GoogleProviderConfig = {
57
+ export type GoogleProviderConfig = {
55
58
  clientId: string;
56
- clientSecret: string; /** Must exactly match a redirect URI registered in the Google console. */
57
- redirectUri: string; /** @default ["openid", "email", "profile"] */
59
+ clientSecret: string;
60
+ /** Must exactly match a redirect URI registered in the Google console. */
61
+ redirectUri: string;
62
+ /** @default ["openid", "email", "profile"] */
58
63
  scopes?: string[];
59
64
  };
60
65
  /** `auth.providers.github`. */
61
- type GitHubProviderConfig = {
66
+ export type GitHubProviderConfig = {
62
67
  clientId: string;
63
- clientSecret: string; /** Must exactly match the "Authorization callback URL" registered on the GitHub OAuth App. */
64
- redirectUri: string; /** @default ["read:user", "user:email"] */
68
+ clientSecret: string;
69
+ /** Must exactly match the "Authorization callback URL" registered on the GitHub OAuth App. */
70
+ redirectUri: string;
71
+ /** @default ["read:user", "user:email"] */
65
72
  scopes?: string[];
66
73
  };
67
74
  /** `auth.providers.discord`. */
68
- type DiscordProviderConfig = {
75
+ export type DiscordProviderConfig = {
69
76
  clientId: string;
70
- clientSecret: string; /** Must exactly match a redirect registered on the Discord application. */
71
- redirectUri: string; /** @default ["identify", "email"] */
77
+ clientSecret: string;
78
+ /** Must exactly match a redirect registered on the Discord application. */
79
+ redirectUri: string;
80
+ /** @default ["identify", "email"] */
72
81
  scopes?: string[];
73
82
  };
74
83
  /** `auth.providers.linkedin`. */
75
- type LinkedInProviderConfig = {
84
+ export type LinkedInProviderConfig = {
76
85
  clientId: string;
77
- clientSecret: string; /** Must exactly match a redirect URL registered on the LinkedIn app. */
78
- redirectUri: string; /** @default ["openid", "profile", "email"] */
86
+ clientSecret: string;
87
+ /** Must exactly match a redirect URL registered on the LinkedIn app. */
88
+ redirectUri: string;
89
+ /** @default ["openid", "profile", "email"] */
79
90
  scopes?: string[];
80
91
  };
81
92
  /** `auth.providers.apple`. */
82
- type AppleProviderConfig = {
83
- /** The Services ID (or app id) registered with Sign in with Apple. */clientId: string; /** The Apple Developer team id — signed into the client-secret JWT as `iss`. */
84
- teamId: string; /** The id of the private key created for Sign in with Apple — signed into the client-secret JWT header as `kid`. */
85
- keyId: string; /** The PKCS8 PEM contents of that private key (`.p8` file), used to sign the client-secret JWT. */
86
- privateKey: string; /** Must exactly match a return URL registered on the Services ID. */
87
- redirectUri: string; /** @default ["name", "email"] */
93
+ export type AppleProviderConfig = {
94
+ /** The Services ID (or app id) registered with Sign in with Apple. */
95
+ clientId: string;
96
+ /** The Apple Developer team id — signed into the client-secret JWT as `iss`. */
97
+ teamId: string;
98
+ /** The id of the private key created for Sign in with Apple — signed into the client-secret JWT header as `kid`. */
99
+ keyId: string;
100
+ /** The PKCS8 PEM contents of that private key (`.p8` file), used to sign the client-secret JWT. */
101
+ privateKey: string;
102
+ /** Must exactly match a return URL registered on the Services ID. */
103
+ redirectUri: string;
104
+ /** @default ["name", "email"] */
88
105
  scopes?: string[];
89
106
  };
90
107
  /** `auth.providers.facebook`. */
91
- type FacebookProviderConfig = {
108
+ export type FacebookProviderConfig = {
92
109
  clientId: string;
93
- clientSecret: string; /** Must exactly match a valid OAuth redirect URI registered on the Facebook app. */
94
- redirectUri: string; /** @default ["email", "public_profile"] */
110
+ clientSecret: string;
111
+ /** Must exactly match a valid OAuth redirect URI registered on the Facebook app. */
112
+ redirectUri: string;
113
+ /** @default ["email", "public_profile"] */
95
114
  scopes?: string[];
96
115
  };
97
116
  /** `auth.providers.x`. */
98
- type XProviderConfig = {
117
+ export type XProviderConfig = {
99
118
  clientId: string;
100
- clientSecret: string; /** Must exactly match a callback URI registered on the X app (confidential client). */
101
- redirectUri: string; /** @default ["tweet.read", "users.read"] */
119
+ clientSecret: string;
120
+ /** Must exactly match a callback URI registered on the X app (confidential client). */
121
+ redirectUri: string;
122
+ /** @default ["tweet.read", "users.read"] */
102
123
  scopes?: string[];
103
124
  };
104
125
  /** Creates the app user for a verified provider profile with no matching account. */
105
- type ProviderUserCreator = (profile: ProviderProfile, Model: ChildModel<Auth>) => Auth | Promise<Auth>;
126
+ export type ProviderUserCreator = (profile: ProviderProfile, Model: ChildModel<Auth>) => Auth | Promise<Auth>;
106
127
  /** `auth.providers`. */
107
- type ProvidersConfig = {
128
+ export type ProvidersConfig = {
108
129
  google?: GoogleProviderConfig;
109
130
  github?: GitHubProviderConfig;
110
131
  discord?: DiscordProviderConfig;
@@ -116,44 +137,55 @@ type ProvidersConfig = {
116
137
  * User attribute a verified provider email is matched against.
117
138
  * @default "email"
118
139
  */
119
- emailField?: string; /** Replace the default user creation (`{ email, name, <verification.field>: now }`). */
120
- createUser?: ProviderUserCreator; /** Providers auth does not ship, by name. */
140
+ emailField?: string;
141
+ /** Replace the default user creation (`{ email, name, <verification.field>: now }`). */
142
+ createUser?: ProviderUserCreator;
143
+ /** Providers auth does not ship, by name. */
121
144
  custom?: Record<string, AuthProvider>;
122
145
  };
123
146
  /** `auth.passkeys`. */
124
- type PasskeysConfig = {
125
- /** Relying-party id — the site's registrable domain, e.g. `"example.com"`. */rpID: string; /** Name shown by the authenticator. */
126
- rpName: string; /** Exact origin(s) the browser ceremony runs on, e.g. `"https://example.com"`. */
147
+ export type PasskeysConfig = {
148
+ /** Relying-party id — the site's registrable domain, e.g. `"example.com"`. */
149
+ rpID: string;
150
+ /** Name shown by the authenticator. */
151
+ rpName: string;
152
+ /** Exact origin(s) the browser ceremony runs on, e.g. `"https://example.com"`. */
127
153
  origin: string | string[];
128
154
  /**
129
155
  * Challenge lifetime — a positive `ms` duration string.
130
156
  * @default "5m"
131
157
  */
132
- challengeExpiresIn?: string; /** Account name shown by the authenticator. @default user email, else id */
158
+ challengeExpiresIn?: string;
159
+ /** Account name shown by the authenticator. @default user email, else id */
133
160
  userName?: (user: Auth) => string;
134
161
  };
135
162
  /** Data an OTP delivery receives. */
136
- type OtpMessage = {
137
- /** Ready-to-send text containing the code. */body: string;
163
+ export type OtpMessage = {
164
+ /** Ready-to-send text containing the code. */
165
+ body: string;
138
166
  code: string;
139
167
  expiresAt: Date;
140
168
  };
141
169
  /** Delivers an OTP. Replaces the default `notify.channel(channel).send(phone, message)`. */
142
- type OtpSender = (phone: string, message: OtpMessage, channel: string) => unknown;
170
+ export type OtpSender = (phone: string, message: OtpMessage, channel: string) => unknown;
143
171
  /** `auth.otp`. */
144
- type OtpConfig = {
172
+ export type OtpConfig = {
145
173
  /**
146
174
  * Notifications channel the code is sent through. The app registers it
147
175
  * (auth ships no SMS/WhatsApp driver).
148
176
  * @default "sms"
149
177
  */
150
- channel?: string; /** User attribute holding the phone number. @default "phone" */
151
- phoneField?: string; /** Code lifetime. @default "5m" */
152
- expiresIn?: string; /** Verify attempts before the code is invalidated. @default 5 */
153
- maxAttempts?: number; /** Build the message text. @default "Your verification code is <code>" */
154
- message?: (code: string) => string; /** Replace delivery entirely. */
178
+ channel?: string;
179
+ /** User attribute holding the phone number. @default "phone" */
180
+ phoneField?: string;
181
+ /** Code lifetime. @default "5m" */
182
+ expiresIn?: string;
183
+ /** Verify attempts before the code is invalidated. @default 5 */
184
+ maxAttempts?: number;
185
+ /** Build the message text. @default "Your verification code is <code>" */
186
+ message?: (code: string) => string;
187
+ /** Replace delivery entirely. */
155
188
  send?: OtpSender;
156
189
  };
157
190
  //#endregion
158
- export { AppleProviderConfig, AuthProvider, DiscordProviderConfig, FacebookProviderConfig, GitHubProviderConfig, GoogleProviderConfig, LinkedInProviderConfig, OtpConfig, OtpMessage, OtpSender, PasskeysConfig, ProviderAuthorizationState, ProviderCallbackParams, ProviderProfile, ProviderUserCreator, ProvidersConfig, XProviderConfig };
159
191
  //# sourceMappingURL=providers.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"providers.d.mts","names":[],"sources":["../../../../../../../../packages/auth/src/contracts/providers.ts"],"mappings":";;;;;;AAOA;;KAAY,0BAAA;EACV,KAAA;EACA,KAAA;EACA,YAAA;AAAA;;AAAY;AAQd;;;KAAY,sBAAA;EACV,KAAA,EAAO,MAAA;EACP,QAAA,EAAU,0BAA0B;AAAA;;KAI1B,eAAA;EAJ0B,sCAMpC,QAAA,UAFyB;EAIzB,cAAA;EACA,KAAA,WAHA;EAKA,aAAA;EACA,IAAA;EACA,MAAA,WADA;EAGA,GAAA,EAAK,MAAM;AAAA;;;AAAA;AAQb;;UAAiB,YAAA;EAAA,SACN,IAAA;EAUqD;;;;;;;EAAA,SAFrD,YAAA;EAET;EAAA,gBAAA,CAAiB,KAAA,EAAO,0BAAA,YAAsC,OAAA;EAA7C;EAEjB,cAAA,CAAe,MAAA,EAAQ,sBAAA,GAAyB,OAAA,CAAQ,eAAA;AAAA;;KAI9C,oBAAA;EACV,QAAA;EACA,YAAA,UANuE;EAQvE,WAAA,UAJU;EAMV,MAAA;AAAA;;KAIU,oBAAA;EACV,QAAA;EACA,YAAA,UANA;EAQA,WAAA,UARM;EAUN,MAAA;AAAA;;KAIU,qBAAA;EACV,QAAA;EACA,YAAA,UARA;EAUA,WAAA,UARM;EAUN,MAAA;AAAA;;KAIU,sBAAA;EACV,QAAA;EACA,YAAA,UAVA;EAYA,WAAA,UARA;EAUA,MAAA;AAAA;AANF;AAAA,KAUY,mBAAA;wEAEV,QAAA,UAXA;EAaA,MAAA,UAVA;EAYA,KAAA,UAVM;EAYN,UAAA,UARU;EAUV,WAAA;EAEA,MAAA;AAAA;;KAIU,sBAAA;EACV,QAAA;EACA,YAAA,UANA;EAQA,WAAA,UARM;EAUN,MAAA;AAAA;;KAIU,eAAA;EACV,QAAA;EACA,YAAA,UARA;EAUA,WAAA,UARM;EAUN,MAAA;AAAA;;KAIU,mBAAA,IACV,OAAA,EAAS,eAAA,EACT,KAAA,EAAO,UAAA,CAAW,IAAA,MACf,IAAA,GAAO,OAAA,CAAQ,IAAA;;KAGR,eAAA;EACV,MAAA,GAAS,oBAAA;EACT,MAAA,GAAS,oBAAA;EACT,OAAA,GAAU,qBAAA;EACV,QAAA,GAAW,sBAAA;EACX,KAAA,GAAQ,mBAAA;EACR,QAAA,GAAW,sBAAA;EACX,CAAA,GAAI,eAAA;;;;;EAKJ,UAAA,WAfkB;EAiBlB,UAAA,GAAa,mBAAA,EAjBI;EAmBjB,MAAA,GAAS,MAAA,SAAe,YAAA;AAAA;;KAId,cAAA;EAxBQ,8EA0BlB,IAAA,UAzBG;EA2BH,MAAA,UA3BkB;EA6BlB,MAAA;EA7BsB;AAGxB;;;EA+BE,kBAAA,WA7BS;EA+BT,QAAA,IAAY,IAAA,EAAM,IAAI;AAAA;;KAIZ,UAAA;EA9BN,8CAgCJ,IAAA;EACA,IAAA;EACA,SAAA,EAAW,IAAI;AAAA;;KAIL,SAAA,IAAa,KAAA,UAAe,OAAA,EAAS,UAAU,EAAE,OAAA;;KAGjD,SAAA;EA9CD;;;;;EAoDT,OAAA,WAjDQ;EAmDR,UAAA,WAlDW;EAoDX,SAAA,WAnDI;EAqDJ,WAAA,WA9CA;EAgDA,OAAA,IAAW,IAAA,qBA9CX;EAgDA,IAAA,GAAO,SAAS;AAAA"}
1
+ {"version":3,"file":"providers.d.mts","names":[],"sources":["../../../../../../../../packages/auth/src/contracts/providers.ts"],"mappings":";;;;;;;YAOY;EACV;EACA;EACA;;;;;;;YAQU;EACV,OAAO;EACP,UAAU;;;YAIA;;EAEV;;EAEA;EACA;;EAEA;EACA;EACA;;EAEA,KAAK;;;;;;;iBAQU;WACN;;;;;;;;WAQA;;EAET,iBAAiB,OAAO,sCAAsC;;EAE9D,eAAe,QAAQ,yBAAyB,QAAQ;;;YAI9C;EACV;EACA;;EAEA;;EAEA;;;YAIU;EACV;EACA;;EAEA;;EAEA;;;YAIU;EACV;EACA;;EAEA;;EAEA;;;YAIU;EACV;EACA;;EAEA;;EAEA;;;YAIU;;EAEV;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;;YAIU;EACV;EACA;;EAEA;;EAEA;;;YAIU;EACV;EACA;;EAEA;;EAEA;;;YAIU,uBACV,SAAS,iBACT,OAAO,WAAW,UACf,OAAO,QAAQ;;YAGR;EACV,SAAS;EACT,SAAS;EACT,UAAU;EACV,WAAW;EACX,QAAQ;EACR,WAAW;EACX,IAAI;;;;;EAKJ;;EAEA,aAAa;;EAEb,SAAS,eAAe;;;YAId;;EAEV;;EAEA;;EAEA;;;;;EAKA;;EAEA,YAAY,MAAM;;;YAIR;;EAEV;EACA;EACA,WAAW;;;YAID,aAAa,eAAe,SAAS,YAAY;;YAGjD;;;;;;EAMV;;EAEA;;EAEA;;EAEA;;EAEA,WAAW;;EAEX,OAAO"}
@@ -24,7 +24,7 @@
24
24
  * would fail to compile (TS2320). See `access/src/middleware/gate.middleware.ts`
25
25
  * for the same hazard documented at its call site.
26
26
  */
27
- interface RequestUser {}
27
+ export interface RequestUser {}
28
28
  /**
29
29
  * Augments core's `RequestLocals` (`request.locals`) with the `user` key —
30
30
  * done in the module that OWNS the key, per `RequestLocals`' own contract
@@ -42,7 +42,6 @@ declare module "@warlock.js/core" {
42
42
  */
43
43
  session?: Promise<any>;
44
44
  }
45
- } //# sourceMappingURL=request-locals.d.ts.map
45
+ }
46
46
  //#endregion
47
- export { RequestUser };
48
47
  //# sourceMappingURL=request-locals.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"request-locals.d.mts","names":[],"sources":["../../../../../../../../packages/auth/src/contracts/request-locals.ts"],"mappings":";;AAyBA;;;;AAA4B;AAAG;;;;;;;;;;;AAiBV;;;;;;;;UAjBJ,WAAA;;;;;;;;;;YAWL,aAAA;IACR,IAAA,GAAO,WAAA;;;;;IAKP,OAAA,GAAU,OAAO;EAAA;AAAA"}
1
+ {"version":3,"file":"request-locals.d.mts","names":[],"sources":["../../../../../../../../packages/auth/src/contracts/request-locals.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;iBAyBiB;;;;;;;;;;YAWL;IACR,OAAO;;;;;IAKP,UAAU"}