@effect-auth/core 0.1.0-alpha.16 → 0.1.0-alpha.19

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 (637) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +307 -133
  3. package/dist/AbuseProtection.d.ts +100 -0
  4. package/dist/AbuseProtection.d.ts.map +1 -0
  5. package/dist/AbuseProtection.js +71 -0
  6. package/dist/AbuseProtection.js.map +1 -0
  7. package/dist/AccessGrant.d.ts +344 -0
  8. package/dist/AccessGrant.d.ts.map +1 -0
  9. package/dist/AccessGrant.js +687 -0
  10. package/dist/AccessGrant.js.map +1 -0
  11. package/dist/ApiKey.d.ts +0 -12
  12. package/dist/ApiKey.d.ts.map +1 -1
  13. package/dist/ApiKey.js +36 -27
  14. package/dist/ApiKey.js.map +1 -1
  15. package/dist/Assurance.d.ts +415 -0
  16. package/dist/Assurance.d.ts.map +1 -0
  17. package/dist/Assurance.js +764 -0
  18. package/dist/Assurance.js.map +1 -0
  19. package/dist/AtomicPlanExecutor.d.ts +28 -0
  20. package/dist/AtomicPlanExecutor.d.ts.map +1 -0
  21. package/dist/AtomicPlanExecutor.js +5 -0
  22. package/dist/AtomicPlanExecutor.js.map +1 -0
  23. package/dist/AuditLog.d.ts +2314 -52
  24. package/dist/AuditLog.d.ts.map +1 -1
  25. package/dist/AuditLog.js +511 -33
  26. package/dist/AuditLog.js.map +1 -1
  27. package/dist/AuthFlow.d.ts +128 -38
  28. package/dist/AuthFlow.d.ts.map +1 -1
  29. package/dist/AuthFlow.js +611 -263
  30. package/dist/AuthFlow.js.map +1 -1
  31. package/dist/AuthRateLimit.d.ts +96 -0
  32. package/dist/AuthRateLimit.d.ts.map +1 -0
  33. package/dist/AuthRateLimit.js +212 -0
  34. package/dist/AuthRateLimit.js.map +1 -0
  35. package/dist/Challenge.d.ts +0 -3
  36. package/dist/Challenge.d.ts.map +1 -1
  37. package/dist/Challenge.js +1 -4
  38. package/dist/Challenge.js.map +1 -1
  39. package/dist/Client.d.ts +205 -10
  40. package/dist/Client.d.ts.map +1 -1
  41. package/dist/Client.js +397 -16
  42. package/dist/Client.js.map +1 -1
  43. package/dist/CloudflareTurnstile.d.ts +28 -0
  44. package/dist/CloudflareTurnstile.d.ts.map +1 -0
  45. package/dist/CloudflareTurnstile.js +205 -0
  46. package/dist/CloudflareTurnstile.js.map +1 -0
  47. package/dist/Crypto.d.ts +0 -3
  48. package/dist/Crypto.d.ts.map +1 -1
  49. package/dist/Crypto.js +1 -4
  50. package/dist/Crypto.js.map +1 -1
  51. package/dist/DelegatedAccessStorageMigrations.d.ts +7 -0
  52. package/dist/DelegatedAccessStorageMigrations.d.ts.map +1 -0
  53. package/dist/DelegatedAccessStorageMigrations.js +159 -0
  54. package/dist/DelegatedAccessStorageMigrations.js.map +1 -0
  55. package/dist/DevEmail.d.ts +44 -0
  56. package/dist/DevEmail.d.ts.map +1 -0
  57. package/dist/DevEmail.js +115 -0
  58. package/dist/DevEmail.js.map +1 -0
  59. package/dist/DevelopmentSeed.d.ts +47 -0
  60. package/dist/DevelopmentSeed.d.ts.map +1 -0
  61. package/dist/DevelopmentSeed.js +337 -0
  62. package/dist/DevelopmentSeed.js.map +1 -0
  63. package/dist/DisposableEmailDomains.d.ts +19 -0
  64. package/dist/DisposableEmailDomains.d.ts.map +1 -0
  65. package/dist/DisposableEmailDomains.js +85 -0
  66. package/dist/DisposableEmailDomains.js.map +1 -0
  67. package/dist/DomainVerification.d.ts +0 -9
  68. package/dist/DomainVerification.d.ts.map +1 -1
  69. package/dist/DomainVerification.js +36 -22
  70. package/dist/DomainVerification.js.map +1 -1
  71. package/dist/DrizzleBunSqliteStorage.d.ts +18 -0
  72. package/dist/DrizzleBunSqliteStorage.d.ts.map +1 -0
  73. package/dist/DrizzleBunSqliteStorage.js +11 -0
  74. package/dist/DrizzleBunSqliteStorage.js.map +1 -0
  75. package/dist/DrizzleD1SqliteStorage.d.ts +4 -4
  76. package/dist/DrizzleD1SqliteStorage.d.ts.map +1 -1
  77. package/dist/DrizzleD1SqliteStorage.js +5 -5
  78. package/dist/DrizzleD1SqliteStorage.js.map +1 -1
  79. package/dist/DrizzleEffectSqliteStorage.d.ts +13 -4
  80. package/dist/DrizzleEffectSqliteStorage.d.ts.map +1 -1
  81. package/dist/DrizzleEffectSqliteStorage.js +71 -4
  82. package/dist/DrizzleEffectSqliteStorage.js.map +1 -1
  83. package/dist/DrizzleNodeSqliteStorage.d.ts +18 -0
  84. package/dist/DrizzleNodeSqliteStorage.d.ts.map +1 -0
  85. package/dist/DrizzleNodeSqliteStorage.js +11 -0
  86. package/dist/DrizzleNodeSqliteStorage.js.map +1 -0
  87. package/dist/DrizzlePostgresStorage.d.ts +26 -0
  88. package/dist/DrizzlePostgresStorage.d.ts.map +1 -0
  89. package/dist/DrizzlePostgresStorage.js +14 -0
  90. package/dist/DrizzlePostgresStorage.js.map +1 -0
  91. package/dist/EffectQbPostgresDelegatedAccessStorage.d.ts +34 -0
  92. package/dist/EffectQbPostgresDelegatedAccessStorage.d.ts.map +1 -0
  93. package/dist/EffectQbPostgresDelegatedAccessStorage.js +499 -0
  94. package/dist/EffectQbPostgresDelegatedAccessStorage.js.map +1 -0
  95. package/dist/EffectQbPostgresStorage.d.ts +178 -0
  96. package/dist/EffectQbPostgresStorage.d.ts.map +1 -0
  97. package/dist/EffectQbPostgresStorage.js +4637 -0
  98. package/dist/EffectQbPostgresStorage.js.map +1 -0
  99. package/dist/EffectQbSqliteDelegatedAccessStorage.d.ts +112 -0
  100. package/dist/EffectQbSqliteDelegatedAccessStorage.d.ts.map +1 -0
  101. package/dist/EffectQbSqliteDelegatedAccessStorage.js +602 -0
  102. package/dist/EffectQbSqliteDelegatedAccessStorage.js.map +1 -0
  103. package/dist/EffectQbSqliteStorage.d.ts +221 -23
  104. package/dist/EffectQbSqliteStorage.d.ts.map +1 -1
  105. package/dist/EffectQbSqliteStorage.js +2064 -135
  106. package/dist/EffectQbSqliteStorage.js.map +1 -1
  107. package/dist/EmailAuth.d.ts +65 -0
  108. package/dist/EmailAuth.d.ts.map +1 -0
  109. package/dist/EmailAuth.js +171 -0
  110. package/dist/EmailAuth.js.map +1 -0
  111. package/dist/EmailIdentityAuth.d.ts +30 -0
  112. package/dist/EmailIdentityAuth.d.ts.map +1 -0
  113. package/dist/EmailIdentityAuth.js +142 -0
  114. package/dist/EmailIdentityAuth.js.map +1 -0
  115. package/dist/EmailOtp.d.ts +10 -11
  116. package/dist/EmailOtp.d.ts.map +1 -1
  117. package/dist/EmailOtp.js +44 -81
  118. package/dist/EmailOtp.js.map +1 -1
  119. package/dist/EmailRisk.d.ts +48 -0
  120. package/dist/EmailRisk.d.ts.map +1 -0
  121. package/dist/EmailRisk.js +33 -0
  122. package/dist/EmailRisk.js.map +1 -0
  123. package/dist/EmailVerification.d.ts +10 -16
  124. package/dist/EmailVerification.d.ts.map +1 -1
  125. package/dist/EmailVerification.js +85 -42
  126. package/dist/EmailVerification.js.map +1 -1
  127. package/dist/Guard.d.ts +11 -0
  128. package/dist/Guard.d.ts.map +1 -0
  129. package/dist/Guard.js +11 -0
  130. package/dist/Guard.js.map +1 -0
  131. package/dist/HibpPwnedPasswords.d.ts +56 -0
  132. package/dist/HibpPwnedPasswords.d.ts.map +1 -0
  133. package/dist/HibpPwnedPasswords.js +232 -0
  134. package/dist/HibpPwnedPasswords.js.map +1 -0
  135. package/dist/HttpApi/AdminPermissionDefinition.d.ts +4 -0
  136. package/dist/HttpApi/AdminPermissionDefinition.d.ts.map +1 -0
  137. package/dist/HttpApi/AdminPermissionDefinition.js +4 -0
  138. package/dist/HttpApi/AdminPermissionDefinition.js.map +1 -0
  139. package/dist/HttpApi/AdminSecurityTimeline.d.ts +4 -0
  140. package/dist/HttpApi/AdminSecurityTimeline.d.ts.map +1 -0
  141. package/dist/HttpApi/AdminSecurityTimeline.js +4 -0
  142. package/dist/HttpApi/AdminSecurityTimeline.js.map +1 -0
  143. package/dist/HttpApi/AdminSession.d.ts +4 -0
  144. package/dist/HttpApi/AdminSession.d.ts.map +1 -0
  145. package/dist/HttpApi/AdminSession.js +4 -0
  146. package/dist/HttpApi/AdminSession.js.map +1 -0
  147. package/dist/HttpApi/AdminTrustedDevice.d.ts +4 -0
  148. package/dist/HttpApi/AdminTrustedDevice.d.ts.map +1 -0
  149. package/dist/HttpApi/AdminTrustedDevice.js +4 -0
  150. package/dist/HttpApi/AdminTrustedDevice.js.map +1 -0
  151. package/dist/HttpApi/Api.d.ts +939 -884
  152. package/dist/HttpApi/Api.d.ts.map +1 -1
  153. package/dist/HttpApi/Api.js +2254 -940
  154. package/dist/HttpApi/Api.js.map +1 -1
  155. package/dist/HttpApi/ApiKey.d.ts +4 -0
  156. package/dist/HttpApi/ApiKey.d.ts.map +1 -0
  157. package/dist/HttpApi/ApiKey.js +4 -0
  158. package/dist/HttpApi/ApiKey.js.map +1 -0
  159. package/dist/HttpApi/Audit.d.ts +6 -0
  160. package/dist/HttpApi/Audit.d.ts.map +1 -0
  161. package/dist/HttpApi/Audit.js +10 -0
  162. package/dist/HttpApi/Audit.js.map +1 -0
  163. package/dist/HttpApi/ClientApi.d.ts +917 -0
  164. package/dist/HttpApi/ClientApi.d.ts.map +1 -0
  165. package/dist/HttpApi/ClientApi.js +101 -0
  166. package/dist/HttpApi/ClientApi.js.map +1 -0
  167. package/dist/HttpApi/EmailAuth.d.ts +6 -0
  168. package/dist/HttpApi/EmailAuth.d.ts.map +1 -0
  169. package/dist/HttpApi/EmailAuth.js +6 -0
  170. package/dist/HttpApi/EmailAuth.js.map +1 -0
  171. package/dist/HttpApi/EmailGuards.d.ts +115 -0
  172. package/dist/HttpApi/EmailGuards.d.ts.map +1 -0
  173. package/dist/HttpApi/EmailGuards.js +191 -0
  174. package/dist/HttpApi/EmailGuards.js.map +1 -0
  175. package/dist/HttpApi/EmailOtp.d.ts +6 -0
  176. package/dist/HttpApi/EmailOtp.d.ts.map +1 -0
  177. package/dist/HttpApi/EmailOtp.js +6 -0
  178. package/dist/HttpApi/EmailOtp.js.map +1 -0
  179. package/dist/HttpApi/EmailVerification.d.ts +6 -0
  180. package/dist/HttpApi/EmailVerification.d.ts.map +1 -0
  181. package/dist/HttpApi/EmailVerification.js +6 -0
  182. package/dist/HttpApi/EmailVerification.js.map +1 -0
  183. package/dist/HttpApi/Endpoints.d.ts +661 -301
  184. package/dist/HttpApi/Endpoints.d.ts.map +1 -1
  185. package/dist/HttpApi/Endpoints.js +207 -120
  186. package/dist/HttpApi/Endpoints.js.map +1 -1
  187. package/dist/HttpApi/Errors.d.ts +37 -10
  188. package/dist/HttpApi/Errors.d.ts.map +1 -1
  189. package/dist/HttpApi/Errors.js +42 -4
  190. package/dist/HttpApi/Errors.js.map +1 -1
  191. package/dist/HttpApi/Identity.d.ts +6 -0
  192. package/dist/HttpApi/Identity.d.ts.map +1 -0
  193. package/dist/HttpApi/Identity.js +6 -0
  194. package/dist/HttpApi/Identity.js.map +1 -0
  195. package/dist/HttpApi/IdentityGuards.d.ts +31 -0
  196. package/dist/HttpApi/IdentityGuards.d.ts.map +1 -0
  197. package/dist/HttpApi/IdentityGuards.js +33 -0
  198. package/dist/HttpApi/IdentityGuards.js.map +1 -0
  199. package/dist/HttpApi/Jwt.d.ts +4 -0
  200. package/dist/HttpApi/Jwt.d.ts.map +1 -0
  201. package/dist/HttpApi/Jwt.js +4 -0
  202. package/dist/HttpApi/Jwt.js.map +1 -0
  203. package/dist/HttpApi/JwtDiscovery.d.ts +4 -0
  204. package/dist/HttpApi/JwtDiscovery.d.ts.map +1 -0
  205. package/dist/HttpApi/JwtDiscovery.js +4 -0
  206. package/dist/HttpApi/JwtDiscovery.js.map +1 -0
  207. package/dist/HttpApi/LoginApproval.d.ts +5 -0
  208. package/dist/HttpApi/LoginApproval.d.ts.map +1 -0
  209. package/dist/HttpApi/LoginApproval.js +5 -0
  210. package/dist/HttpApi/LoginApproval.js.map +1 -0
  211. package/dist/HttpApi/LoginNotification.d.ts +5 -0
  212. package/dist/HttpApi/LoginNotification.d.ts.map +1 -0
  213. package/dist/HttpApi/LoginNotification.js +5 -0
  214. package/dist/HttpApi/LoginNotification.js.map +1 -0
  215. package/dist/HttpApi/MagicLink.d.ts +6 -0
  216. package/dist/HttpApi/MagicLink.d.ts.map +1 -0
  217. package/dist/HttpApi/MagicLink.js +6 -0
  218. package/dist/HttpApi/MagicLink.js.map +1 -0
  219. package/dist/HttpApi/Mfa.d.ts +5 -0
  220. package/dist/HttpApi/Mfa.d.ts.map +1 -0
  221. package/dist/HttpApi/Mfa.js +5 -0
  222. package/dist/HttpApi/Mfa.js.map +1 -0
  223. package/dist/HttpApi/Middleware.d.ts +26 -0
  224. package/dist/HttpApi/Middleware.d.ts.map +1 -0
  225. package/dist/HttpApi/Middleware.js +13 -0
  226. package/dist/HttpApi/Middleware.js.map +1 -0
  227. package/dist/HttpApi/OAuth.d.ts +4 -0
  228. package/dist/HttpApi/OAuth.d.ts.map +1 -0
  229. package/dist/HttpApi/OAuth.js +4 -0
  230. package/dist/HttpApi/OAuth.js.map +1 -0
  231. package/dist/HttpApi/OAuthDeviceAuthorization.d.ts +106 -0
  232. package/dist/HttpApi/OAuthDeviceAuthorization.d.ts.map +1 -0
  233. package/dist/HttpApi/OAuthDeviceAuthorization.js +415 -0
  234. package/dist/HttpApi/OAuthDeviceAuthorization.js.map +1 -0
  235. package/dist/HttpApi/OAuthProviderAuthorization.d.ts +4 -0
  236. package/dist/HttpApi/OAuthProviderAuthorization.d.ts.map +1 -0
  237. package/dist/HttpApi/OAuthProviderAuthorization.js +4 -0
  238. package/dist/HttpApi/OAuthProviderAuthorization.js.map +1 -0
  239. package/dist/HttpApi/OAuthToken.d.ts +4 -0
  240. package/dist/HttpApi/OAuthToken.d.ts.map +1 -0
  241. package/dist/HttpApi/OAuthToken.js +4 -0
  242. package/dist/HttpApi/OAuthToken.js.map +1 -0
  243. package/dist/HttpApi/OidcDiscovery.d.ts +4 -0
  244. package/dist/HttpApi/OidcDiscovery.d.ts.map +1 -0
  245. package/dist/HttpApi/OidcDiscovery.js +4 -0
  246. package/dist/HttpApi/OidcDiscovery.js.map +1 -0
  247. package/dist/HttpApi/Operations/AdminPermissionDefinition.d.ts +28 -0
  248. package/dist/HttpApi/Operations/AdminPermissionDefinition.d.ts.map +1 -0
  249. package/dist/HttpApi/Operations/AdminPermissionDefinition.js +5 -0
  250. package/dist/HttpApi/Operations/AdminPermissionDefinition.js.map +1 -0
  251. package/dist/HttpApi/Operations/AdminSession.d.ts +16 -0
  252. package/dist/HttpApi/Operations/AdminSession.d.ts.map +1 -0
  253. package/dist/HttpApi/Operations/AdminSession.js +5 -0
  254. package/dist/HttpApi/Operations/AdminSession.js.map +1 -0
  255. package/dist/HttpApi/Operations/ApiKey.d.ts +16 -0
  256. package/dist/HttpApi/Operations/ApiKey.d.ts.map +1 -0
  257. package/dist/HttpApi/Operations/ApiKey.js +5 -0
  258. package/dist/HttpApi/Operations/ApiKey.js.map +1 -0
  259. package/dist/HttpApi/Operations/Discovery.d.ts +19 -0
  260. package/dist/HttpApi/Operations/Discovery.d.ts.map +1 -0
  261. package/dist/HttpApi/Operations/Discovery.js +7 -0
  262. package/dist/HttpApi/Operations/Discovery.js.map +1 -0
  263. package/dist/HttpApi/Operations/EmailAuth.d.ts +12 -0
  264. package/dist/HttpApi/Operations/EmailAuth.d.ts.map +1 -0
  265. package/dist/HttpApi/Operations/EmailAuth.js +5 -0
  266. package/dist/HttpApi/Operations/EmailAuth.js.map +1 -0
  267. package/dist/HttpApi/Operations/EmailOtp.d.ts +14 -0
  268. package/dist/HttpApi/Operations/EmailOtp.d.ts.map +1 -0
  269. package/dist/HttpApi/Operations/EmailOtp.js +5 -0
  270. package/dist/HttpApi/Operations/EmailOtp.js.map +1 -0
  271. package/dist/HttpApi/Operations/EmailVerification.d.ts +14 -0
  272. package/dist/HttpApi/Operations/EmailVerification.d.ts.map +1 -0
  273. package/dist/HttpApi/Operations/EmailVerification.js +5 -0
  274. package/dist/HttpApi/Operations/EmailVerification.js.map +1 -0
  275. package/dist/HttpApi/Operations/HttpOperation.d.ts +4 -0
  276. package/dist/HttpApi/Operations/HttpOperation.d.ts.map +1 -0
  277. package/dist/HttpApi/Operations/HttpOperation.js +2 -0
  278. package/dist/HttpApi/Operations/HttpOperation.js.map +1 -0
  279. package/dist/HttpApi/Operations/Identity.d.ts +22 -0
  280. package/dist/HttpApi/Operations/Identity.d.ts.map +1 -0
  281. package/dist/HttpApi/Operations/Identity.js +5 -0
  282. package/dist/HttpApi/Operations/Identity.js.map +1 -0
  283. package/dist/HttpApi/Operations/Jwt.d.ts +14 -0
  284. package/dist/HttpApi/Operations/Jwt.d.ts.map +1 -0
  285. package/dist/HttpApi/Operations/Jwt.js +5 -0
  286. package/dist/HttpApi/Operations/Jwt.js.map +1 -0
  287. package/dist/HttpApi/Operations/LoginApproval.d.ts +16 -0
  288. package/dist/HttpApi/Operations/LoginApproval.d.ts.map +1 -0
  289. package/dist/HttpApi/Operations/LoginApproval.js +5 -0
  290. package/dist/HttpApi/Operations/LoginApproval.js.map +1 -0
  291. package/dist/HttpApi/Operations/MagicLink.d.ts +14 -0
  292. package/dist/HttpApi/Operations/MagicLink.d.ts.map +1 -0
  293. package/dist/HttpApi/Operations/MagicLink.js +5 -0
  294. package/dist/HttpApi/Operations/MagicLink.js.map +1 -0
  295. package/dist/HttpApi/Operations/Mfa.d.ts +24 -0
  296. package/dist/HttpApi/Operations/Mfa.d.ts.map +1 -0
  297. package/dist/HttpApi/Operations/Mfa.js +5 -0
  298. package/dist/HttpApi/Operations/Mfa.js.map +1 -0
  299. package/dist/HttpApi/Operations/OAuth.d.ts +20 -0
  300. package/dist/HttpApi/Operations/OAuth.d.ts.map +1 -0
  301. package/dist/HttpApi/Operations/OAuth.js +5 -0
  302. package/dist/HttpApi/Operations/OAuth.js.map +1 -0
  303. package/dist/HttpApi/Operations/OAuthDeviceAuthorization.d.ts +23 -0
  304. package/dist/HttpApi/Operations/OAuthDeviceAuthorization.d.ts.map +1 -0
  305. package/dist/HttpApi/Operations/OAuthDeviceAuthorization.js +7 -0
  306. package/dist/HttpApi/Operations/OAuthDeviceAuthorization.js.map +1 -0
  307. package/dist/HttpApi/Operations/OAuthProviderAuthorization.d.ts +12 -0
  308. package/dist/HttpApi/Operations/OAuthProviderAuthorization.d.ts.map +1 -0
  309. package/dist/HttpApi/Operations/OAuthProviderAuthorization.js +5 -0
  310. package/dist/HttpApi/Operations/OAuthProviderAuthorization.js.map +1 -0
  311. package/dist/HttpApi/Operations/OAuthToken.d.ts +26 -0
  312. package/dist/HttpApi/Operations/OAuthToken.d.ts.map +1 -0
  313. package/dist/HttpApi/Operations/OAuthToken.js +9 -0
  314. package/dist/HttpApi/Operations/OAuthToken.js.map +1 -0
  315. package/dist/HttpApi/Operations/Passkey.d.ts +22 -0
  316. package/dist/HttpApi/Operations/Passkey.d.ts.map +1 -0
  317. package/dist/HttpApi/Operations/Passkey.js +5 -0
  318. package/dist/HttpApi/Operations/Passkey.js.map +1 -0
  319. package/dist/HttpApi/Operations/Password.d.ts +22 -0
  320. package/dist/HttpApi/Operations/Password.d.ts.map +1 -0
  321. package/dist/HttpApi/Operations/Password.js +5 -0
  322. package/dist/HttpApi/Operations/Password.js.map +1 -0
  323. package/dist/HttpApi/Operations/RecoveryCodes.d.ts +20 -0
  324. package/dist/HttpApi/Operations/RecoveryCodes.d.ts.map +1 -0
  325. package/dist/HttpApi/Operations/RecoveryCodes.js +5 -0
  326. package/dist/HttpApi/Operations/RecoveryCodes.js.map +1 -0
  327. package/dist/HttpApi/Operations/RefreshToken.d.ts +12 -0
  328. package/dist/HttpApi/Operations/RefreshToken.d.ts.map +1 -0
  329. package/dist/HttpApi/Operations/RefreshToken.js +5 -0
  330. package/dist/HttpApi/Operations/RefreshToken.js.map +1 -0
  331. package/dist/HttpApi/Operations/Security.d.ts +12 -0
  332. package/dist/HttpApi/Operations/Security.d.ts.map +1 -0
  333. package/dist/HttpApi/Operations/Security.js +5 -0
  334. package/dist/HttpApi/Operations/Security.js.map +1 -0
  335. package/dist/HttpApi/Operations/SecurityTimeline.d.ts +19 -0
  336. package/dist/HttpApi/Operations/SecurityTimeline.d.ts.map +1 -0
  337. package/dist/HttpApi/Operations/SecurityTimeline.js +7 -0
  338. package/dist/HttpApi/Operations/SecurityTimeline.js.map +1 -0
  339. package/dist/HttpApi/Operations/Session.d.ts +22 -0
  340. package/dist/HttpApi/Operations/Session.d.ts.map +1 -0
  341. package/dist/HttpApi/Operations/Session.js +5 -0
  342. package/dist/HttpApi/Operations/Session.js.map +1 -0
  343. package/dist/HttpApi/Operations/StepUp.d.ts +22 -0
  344. package/dist/HttpApi/Operations/StepUp.d.ts.map +1 -0
  345. package/dist/HttpApi/Operations/StepUp.js +5 -0
  346. package/dist/HttpApi/Operations/StepUp.js.map +1 -0
  347. package/dist/HttpApi/Operations/Totp.d.ts +20 -0
  348. package/dist/HttpApi/Operations/Totp.d.ts.map +1 -0
  349. package/dist/HttpApi/Operations/Totp.js +5 -0
  350. package/dist/HttpApi/Operations/Totp.js.map +1 -0
  351. package/dist/HttpApi/Operations/TrustedDevice.d.ts +23 -0
  352. package/dist/HttpApi/Operations/TrustedDevice.d.ts.map +1 -0
  353. package/dist/HttpApi/Operations/TrustedDevice.js +7 -0
  354. package/dist/HttpApi/Operations/TrustedDevice.js.map +1 -0
  355. package/dist/HttpApi/Operations/index.d.ts +28 -0
  356. package/dist/HttpApi/Operations/index.d.ts.map +1 -0
  357. package/dist/HttpApi/Operations/index.js +28 -0
  358. package/dist/HttpApi/Operations/index.js.map +1 -0
  359. package/dist/HttpApi/Passkey.d.ts +5 -0
  360. package/dist/HttpApi/Passkey.d.ts.map +1 -0
  361. package/dist/HttpApi/Passkey.js +5 -0
  362. package/dist/HttpApi/Passkey.js.map +1 -0
  363. package/dist/HttpApi/Password.d.ts +220 -0
  364. package/dist/HttpApi/Password.d.ts.map +1 -0
  365. package/dist/HttpApi/Password.js +237 -0
  366. package/dist/HttpApi/Password.js.map +1 -0
  367. package/dist/HttpApi/PasswordContract.d.ts +307 -0
  368. package/dist/HttpApi/PasswordContract.d.ts.map +1 -0
  369. package/dist/HttpApi/PasswordContract.js +63 -0
  370. package/dist/HttpApi/PasswordContract.js.map +1 -0
  371. package/dist/HttpApi/PasswordGuards.d.ts +82 -0
  372. package/dist/HttpApi/PasswordGuards.d.ts.map +1 -0
  373. package/dist/HttpApi/PasswordGuards.js +179 -0
  374. package/dist/HttpApi/PasswordGuards.js.map +1 -0
  375. package/dist/HttpApi/RecoveryCodes.d.ts +5 -0
  376. package/dist/HttpApi/RecoveryCodes.d.ts.map +1 -0
  377. package/dist/HttpApi/RecoveryCodes.js +5 -0
  378. package/dist/HttpApi/RecoveryCodes.js.map +1 -0
  379. package/dist/HttpApi/RefreshToken.d.ts +4 -0
  380. package/dist/HttpApi/RefreshToken.d.ts.map +1 -0
  381. package/dist/HttpApi/RefreshToken.js +4 -0
  382. package/dist/HttpApi/RefreshToken.js.map +1 -0
  383. package/dist/HttpApi/RequestGuards.d.ts +42 -0
  384. package/dist/HttpApi/RequestGuards.d.ts.map +1 -0
  385. package/dist/HttpApi/RequestGuards.js +194 -0
  386. package/dist/HttpApi/RequestGuards.js.map +1 -0
  387. package/dist/HttpApi/Schemas.d.ts +399 -84
  388. package/dist/HttpApi/Schemas.d.ts.map +1 -1
  389. package/dist/HttpApi/Schemas.js +225 -27
  390. package/dist/HttpApi/Schemas.js.map +1 -1
  391. package/dist/HttpApi/Security.d.ts +12 -93
  392. package/dist/HttpApi/Security.d.ts.map +1 -1
  393. package/dist/HttpApi/Security.js +65 -356
  394. package/dist/HttpApi/Security.js.map +1 -1
  395. package/dist/HttpApi/SecurityTimeline.d.ts +4 -0
  396. package/dist/HttpApi/SecurityTimeline.d.ts.map +1 -0
  397. package/dist/HttpApi/SecurityTimeline.js +4 -0
  398. package/dist/HttpApi/SecurityTimeline.js.map +1 -0
  399. package/dist/HttpApi/Session.d.ts +5 -0
  400. package/dist/HttpApi/Session.d.ts.map +1 -0
  401. package/dist/HttpApi/Session.js +5 -0
  402. package/dist/HttpApi/Session.js.map +1 -0
  403. package/dist/HttpApi/SessionGuards.d.ts +15 -0
  404. package/dist/HttpApi/SessionGuards.d.ts.map +1 -0
  405. package/dist/HttpApi/SessionGuards.js +37 -0
  406. package/dist/HttpApi/SessionGuards.js.map +1 -0
  407. package/dist/HttpApi/StepUp.d.ts +5 -0
  408. package/dist/HttpApi/StepUp.d.ts.map +1 -0
  409. package/dist/HttpApi/StepUp.js +5 -0
  410. package/dist/HttpApi/StepUp.js.map +1 -0
  411. package/dist/HttpApi/Totp.d.ts +5 -0
  412. package/dist/HttpApi/Totp.d.ts.map +1 -0
  413. package/dist/HttpApi/Totp.js +5 -0
  414. package/dist/HttpApi/Totp.js.map +1 -0
  415. package/dist/HttpApi/Transport.d.ts +4 -6
  416. package/dist/HttpApi/Transport.d.ts.map +1 -1
  417. package/dist/HttpApi/Transport.js +62 -36
  418. package/dist/HttpApi/Transport.js.map +1 -1
  419. package/dist/HttpApi/TrustedDevice.d.ts +4 -0
  420. package/dist/HttpApi/TrustedDevice.d.ts.map +1 -0
  421. package/dist/HttpApi/TrustedDevice.js +4 -0
  422. package/dist/HttpApi/TrustedDevice.js.map +1 -0
  423. package/dist/HttpApi/index.d.ts +11 -3
  424. package/dist/HttpApi/index.d.ts.map +1 -1
  425. package/dist/HttpApi/index.js +10 -2
  426. package/dist/HttpApi/index.js.map +1 -1
  427. package/dist/Identity.d.ts +138 -0
  428. package/dist/Identity.d.ts.map +1 -0
  429. package/dist/Identity.js +105 -0
  430. package/dist/Identity.js.map +1 -0
  431. package/dist/IdentityManagement.d.ts +189 -0
  432. package/dist/IdentityManagement.d.ts.map +1 -0
  433. package/dist/IdentityManagement.js +317 -0
  434. package/dist/IdentityManagement.js.map +1 -0
  435. package/dist/IncidentAction.d.ts +1 -4
  436. package/dist/IncidentAction.d.ts.map +1 -1
  437. package/dist/IncidentAction.js +15 -9
  438. package/dist/IncidentAction.js.map +1 -1
  439. package/dist/Internal.d.ts +2 -0
  440. package/dist/Internal.d.ts.map +1 -1
  441. package/dist/Internal.js +30 -0
  442. package/dist/Internal.js.map +1 -1
  443. package/dist/Invitation.d.ts +362 -0
  444. package/dist/Invitation.d.ts.map +1 -0
  445. package/dist/Invitation.js +633 -0
  446. package/dist/Invitation.js.map +1 -0
  447. package/dist/IpQualityScore.d.ts +38 -0
  448. package/dist/IpQualityScore.d.ts.map +1 -0
  449. package/dist/IpQualityScore.js +215 -0
  450. package/dist/IpQualityScore.js.map +1 -0
  451. package/dist/Jwt.d.ts +8 -29
  452. package/dist/Jwt.d.ts.map +1 -1
  453. package/dist/Jwt.js +67 -56
  454. package/dist/Jwt.js.map +1 -1
  455. package/dist/LoginApproval.d.ts +15 -30
  456. package/dist/LoginApproval.d.ts.map +1 -1
  457. package/dist/LoginApproval.js +47 -41
  458. package/dist/LoginApproval.js.map +1 -1
  459. package/dist/LoginNotification.d.ts +7 -11
  460. package/dist/LoginNotification.d.ts.map +1 -1
  461. package/dist/LoginNotification.js +30 -17
  462. package/dist/LoginNotification.js.map +1 -1
  463. package/dist/LoginRisk.d.ts +11 -13
  464. package/dist/LoginRisk.d.ts.map +1 -1
  465. package/dist/LoginRisk.js +66 -26
  466. package/dist/LoginRisk.js.map +1 -1
  467. package/dist/LoginRiskEnrichment.d.ts +145 -0
  468. package/dist/LoginRiskEnrichment.d.ts.map +1 -0
  469. package/dist/LoginRiskEnrichment.js +220 -0
  470. package/dist/LoginRiskEnrichment.js.map +1 -0
  471. package/dist/MagicLink.d.ts +9 -8
  472. package/dist/MagicLink.d.ts.map +1 -1
  473. package/dist/MagicLink.js +40 -73
  474. package/dist/MagicLink.js.map +1 -1
  475. package/dist/Mailer.d.ts +19 -12
  476. package/dist/Mailer.d.ts.map +1 -1
  477. package/dist/Mailer.js +10 -12
  478. package/dist/Mailer.js.map +1 -1
  479. package/dist/OAuth.d.ts +138 -96
  480. package/dist/OAuth.d.ts.map +1 -1
  481. package/dist/OAuth.js +522 -221
  482. package/dist/OAuth.js.map +1 -1
  483. package/dist/OAuthDeviceAuthorization.d.ts +378 -0
  484. package/dist/OAuthDeviceAuthorization.d.ts.map +1 -0
  485. package/dist/OAuthDeviceAuthorization.js +860 -0
  486. package/dist/OAuthDeviceAuthorization.js.map +1 -0
  487. package/dist/OAuthDeviceClient.d.ts +76 -0
  488. package/dist/OAuthDeviceClient.d.ts.map +1 -0
  489. package/dist/OAuthDeviceClient.js +362 -0
  490. package/dist/OAuthDeviceClient.js.map +1 -0
  491. package/dist/Passkey.d.ts +15 -17
  492. package/dist/Passkey.d.ts.map +1 -1
  493. package/dist/Passkey.js +86 -39
  494. package/dist/Passkey.js.map +1 -1
  495. package/dist/PasskeyBrowser.d.ts +39 -0
  496. package/dist/PasskeyBrowser.d.ts.map +1 -0
  497. package/dist/PasskeyBrowser.js +206 -0
  498. package/dist/PasskeyBrowser.js.map +1 -0
  499. package/dist/PasskeySimpleWebAuthn.d.ts.map +1 -1
  500. package/dist/PasskeySimpleWebAuthn.js +19 -7
  501. package/dist/PasskeySimpleWebAuthn.js.map +1 -1
  502. package/dist/Password.d.ts +71 -37
  503. package/dist/Password.d.ts.map +1 -1
  504. package/dist/Password.js +295 -81
  505. package/dist/Password.js.map +1 -1
  506. package/dist/PasswordRisk.d.ts +63 -0
  507. package/dist/PasswordRisk.d.ts.map +1 -0
  508. package/dist/PasswordRisk.js +37 -0
  509. package/dist/PasswordRisk.js.map +1 -0
  510. package/dist/Permission.d.ts +308 -0
  511. package/dist/Permission.d.ts.map +1 -0
  512. package/dist/Permission.js +827 -0
  513. package/dist/Permission.js.map +1 -0
  514. package/dist/Policy.d.ts +31 -18
  515. package/dist/Policy.d.ts.map +1 -1
  516. package/dist/Policy.js +58 -14
  517. package/dist/Policy.js.map +1 -1
  518. package/dist/PostgresDelegatedAccessStorageMigrations.d.ts +7 -0
  519. package/dist/PostgresDelegatedAccessStorageMigrations.d.ts.map +1 -0
  520. package/dist/PostgresDelegatedAccessStorageMigrations.js +119 -0
  521. package/dist/PostgresDelegatedAccessStorageMigrations.js.map +1 -0
  522. package/dist/PostgresStorageMigrations.d.ts +16 -0
  523. package/dist/PostgresStorageMigrations.d.ts.map +1 -0
  524. package/dist/PostgresStorageMigrations.js +674 -0
  525. package/dist/PostgresStorageMigrations.js.map +1 -0
  526. package/dist/Privacy.d.ts +0 -3
  527. package/dist/Privacy.d.ts.map +1 -1
  528. package/dist/Privacy.js +2 -5
  529. package/dist/Privacy.js.map +1 -1
  530. package/dist/RateLimiter.d.ts +0 -3
  531. package/dist/RateLimiter.d.ts.map +1 -1
  532. package/dist/RateLimiter.js +1 -4
  533. package/dist/RateLimiter.js.map +1 -1
  534. package/dist/RecoveryCode.d.ts +83 -11
  535. package/dist/RecoveryCode.d.ts.map +1 -1
  536. package/dist/RecoveryCode.js +273 -75
  537. package/dist/RecoveryCode.js.map +1 -1
  538. package/dist/RecoveryPolicy.d.ts +81 -0
  539. package/dist/RecoveryPolicy.d.ts.map +1 -0
  540. package/dist/RecoveryPolicy.js +119 -0
  541. package/dist/RecoveryPolicy.js.map +1 -0
  542. package/dist/RefreshToken.d.ts +0 -9
  543. package/dist/RefreshToken.d.ts.map +1 -1
  544. package/dist/RefreshToken.js +31 -22
  545. package/dist/RefreshToken.js.map +1 -1
  546. package/dist/Retention.d.ts +6 -1
  547. package/dist/Retention.d.ts.map +1 -1
  548. package/dist/Retention.js +49 -12
  549. package/dist/Retention.js.map +1 -1
  550. package/dist/SecurityTimeline.d.ts +1 -4
  551. package/dist/SecurityTimeline.d.ts.map +1 -1
  552. package/dist/SecurityTimeline.js +110 -17
  553. package/dist/SecurityTimeline.js.map +1 -1
  554. package/dist/Sessions.d.ts +124 -29
  555. package/dist/Sessions.d.ts.map +1 -1
  556. package/dist/Sessions.js +626 -94
  557. package/dist/Sessions.js.map +1 -1
  558. package/dist/SqliteStorageSchemaData.d.ts +2 -0
  559. package/dist/SqliteStorageSchemaData.d.ts.map +1 -0
  560. package/dist/SqliteStorageSchemaData.js +508 -0
  561. package/dist/SqliteStorageSchemaData.js.map +1 -0
  562. package/dist/StepUp.d.ts +132 -11
  563. package/dist/StepUp.d.ts.map +1 -1
  564. package/dist/StepUp.js +387 -19
  565. package/dist/StepUp.js.map +1 -1
  566. package/dist/Storage.d.ts +89 -23
  567. package/dist/Storage.d.ts.map +1 -1
  568. package/dist/Storage.js +10 -12
  569. package/dist/Storage.js.map +1 -1
  570. package/dist/StorageMigrations.d.ts +7 -1
  571. package/dist/StorageMigrations.d.ts.map +1 -1
  572. package/dist/StorageMigrations.js +256 -0
  573. package/dist/StorageMigrations.js.map +1 -1
  574. package/dist/StorageSchemaGenerator.d.ts +544 -0
  575. package/dist/StorageSchemaGenerator.d.ts.map +1 -0
  576. package/dist/StorageSchemaGenerator.js +1418 -0
  577. package/dist/StorageSchemaGenerator.js.map +1 -0
  578. package/dist/StrongFactor.d.ts +64 -0
  579. package/dist/StrongFactor.d.ts.map +1 -0
  580. package/dist/StrongFactor.js +100 -0
  581. package/dist/StrongFactor.js.map +1 -0
  582. package/dist/Testing.js +2 -2
  583. package/dist/Testing.js.map +1 -1
  584. package/dist/Totp.d.ts +88 -13
  585. package/dist/Totp.d.ts.map +1 -1
  586. package/dist/Totp.js +192 -34
  587. package/dist/Totp.js.map +1 -1
  588. package/dist/TrustedDevice.d.ts +0 -9
  589. package/dist/TrustedDevice.d.ts.map +1 -1
  590. package/dist/TrustedDevice.js +15 -17
  591. package/dist/TrustedDevice.js.map +1 -1
  592. package/dist/WaitUntil.d.ts +0 -3
  593. package/dist/WaitUntil.d.ts.map +1 -1
  594. package/dist/WaitUntil.js +1 -4
  595. package/dist/WaitUntil.js.map +1 -1
  596. package/dist/Webhook.d.ts +42 -12
  597. package/dist/Webhook.d.ts.map +1 -1
  598. package/dist/Webhook.js +165 -26
  599. package/dist/Webhook.js.map +1 -1
  600. package/dist/alchemy/cloudflare/Email.d.ts.map +1 -1
  601. package/dist/alchemy/cloudflare/Email.js +9 -4
  602. package/dist/alchemy/cloudflare/Email.js.map +1 -1
  603. package/dist/cloudflare/Email.js +1 -1
  604. package/dist/cloudflare/Email.js.map +1 -1
  605. package/dist/cloudflare/RequestMetadata.d.ts +49 -0
  606. package/dist/cloudflare/RequestMetadata.d.ts.map +1 -0
  607. package/dist/cloudflare/RequestMetadata.js +71 -0
  608. package/dist/cloudflare/RequestMetadata.js.map +1 -0
  609. package/dist/index.d.ts +0 -35
  610. package/dist/index.d.ts.map +1 -1
  611. package/dist/index.js +0 -35
  612. package/dist/index.js.map +1 -1
  613. package/dist/internal/AuthFlowFinalizer.d.ts +31 -0
  614. package/dist/internal/AuthFlowFinalizer.d.ts.map +1 -0
  615. package/dist/internal/AuthFlowFinalizer.js +182 -0
  616. package/dist/internal/AuthFlowFinalizer.js.map +1 -0
  617. package/migrations/0001_auth_storage.sql +1 -0
  618. package/migrations/0006_auth_totp_factor.sql +1 -0
  619. package/migrations/0024_auth_permission.sql +39 -0
  620. package/migrations/0025_auth_permission_definition.sql +19 -0
  621. package/migrations/0026_auth_user_identity.sql +59 -0
  622. package/migrations/0027_auth_audit_log_storage_order.sql +46 -0
  623. package/migrations/0028_auth_oauth_client_secret_key.sql +39 -0
  624. package/migrations/0029_auth_oauth_device_authorization.sql +28 -0
  625. package/migrations/delegated-access/0001_auth_delegated_access.sql +152 -0
  626. package/migrations/postgres/0001_auth_core.sql +77 -0
  627. package/migrations/postgres/0002_auth_security_oauth.sql +65 -0
  628. package/migrations/postgres/0003_auth_credentials_tokens.sql +43 -0
  629. package/migrations/postgres/0004_auth_security_history.sql +103 -0
  630. package/migrations/postgres/0005_auth_webhooks.sql +29 -0
  631. package/migrations/postgres/0006_auth_domain_timeline.sql +50 -0
  632. package/migrations/postgres/0007_auth_oauth_clients.sql +85 -0
  633. package/migrations/postgres/0008_auth_oauth_tokens.sql +63 -0
  634. package/migrations/postgres/0009_auth_permissions.sql +66 -0
  635. package/migrations/postgres/0010_auth_oauth_device_authorization.sql +50 -0
  636. package/migrations/postgres/delegated-access/0001_auth_delegated_access.sql +112 -0
  637. package/package.json +309 -2
@@ -0,0 +1,508 @@
1
+ // Selective fresh baseline derived from the maintained SQLite migrations through 0029.
2
+ // Historical data-copy and table-rebuild statements are intentionally excluded.
3
+ export const sqliteAuthStorageSchema = `create table auth_user (
4
+ id text primary key,
5
+ created_at integer not null,
6
+ updated_at integer not null,
7
+ disabled_at integer,
8
+ metadata text
9
+ );
10
+
11
+ create table auth_user_identity (
12
+ id text primary key,
13
+ user_id text not null,
14
+ scope_type text not null,
15
+ scope_id text not null,
16
+ kind text not null,
17
+ value text not null,
18
+ normalized_value text not null,
19
+ verified_at integer,
20
+ is_primary_login integer not null,
21
+ created_at integer not null,
22
+ updated_at integer not null,
23
+ revoked_at integer,
24
+ replaced_by_id text,
25
+ metadata text
26
+ );
27
+ create unique index auth_user_identity_active_value_idx on auth_user_identity (scope_type, scope_id, kind, normalized_value) where revoked_at is null;
28
+ create index auth_user_identity_user_id_idx on auth_user_identity (user_id);
29
+ create index auth_user_identity_replaced_by_id_idx on auth_user_identity (replaced_by_id);
30
+ create unique index auth_user_identity_active_primary_idx on auth_user_identity (user_id) where revoked_at is null and is_primary_login = 1;
31
+
32
+ create table auth_credential (
33
+ id text primary key,
34
+ user_id text not null,
35
+ type text not null,
36
+ password_hash text,
37
+ created_at integer not null,
38
+ updated_at integer not null,
39
+ revoked_at integer,
40
+ metadata text
41
+ );
42
+ create index auth_credential_user_id_idx on auth_credential (user_id);
43
+ create unique index auth_credential_user_type_idx on auth_credential (user_id, type);
44
+
45
+ create table auth_session (
46
+ id text primary key,
47
+ user_id text not null,
48
+ secret_hash text not null,
49
+ created_at integer not null,
50
+ expires_at integer not null,
51
+ auth_time integer not null,
52
+ authentication_events text not null,
53
+ aal text not null,
54
+ amr text not null,
55
+ mfa_verified_at integer,
56
+ metadata text,
57
+ revoked_at integer,
58
+ last_seen_at integer,
59
+ rotated_at integer
60
+ );
61
+ create index auth_session_user_id_idx on auth_session (user_id);
62
+ create index auth_session_expires_at_idx on auth_session (expires_at);
63
+
64
+ create table auth_verification (
65
+ id text primary key,
66
+ type text not null,
67
+ subject text not null,
68
+ secret_hash text,
69
+ created_at integer not null,
70
+ expires_at integer not null,
71
+ metadata text,
72
+ consumed_at integer
73
+ );
74
+ create index auth_verification_type_subject_idx on auth_verification (type, subject);
75
+ create index auth_verification_expires_at_idx on auth_verification (expires_at);
76
+
77
+ create table auth_totp_factor (
78
+ id text primary key,
79
+ user_id text not null,
80
+ secret text not null,
81
+ algorithm text not null,
82
+ digits integer not null,
83
+ period integer not null,
84
+ created_at integer not null,
85
+ confirmed_at integer,
86
+ last_used_at integer,
87
+ last_accepted_counter integer,
88
+ revoked_at integer,
89
+ metadata text
90
+ );
91
+ create index auth_totp_factor_user_id_idx on auth_totp_factor (user_id);
92
+ create index auth_totp_factor_confirmed_at_idx on auth_totp_factor (confirmed_at);
93
+ create index auth_totp_factor_revoked_at_idx on auth_totp_factor (revoked_at);
94
+
95
+ create table auth_recovery_code (
96
+ id text primary key,
97
+ user_id text not null,
98
+ code_hash text not null,
99
+ created_at integer not null,
100
+ used_at integer,
101
+ revoked_at integer,
102
+ metadata text
103
+ );
104
+ create index auth_recovery_code_user_id_idx on auth_recovery_code (user_id);
105
+ create index auth_recovery_code_used_at_idx on auth_recovery_code (used_at);
106
+ create index auth_recovery_code_revoked_at_idx on auth_recovery_code (revoked_at);
107
+
108
+ create table auth_refresh_token (
109
+ id text primary key,
110
+ family_id text not null,
111
+ user_id text not null,
112
+ secret_hash text not null,
113
+ created_at integer not null,
114
+ expires_at integer not null,
115
+ last_used_at integer,
116
+ rotated_at integer,
117
+ replaced_by_id text,
118
+ revoked_at integer,
119
+ reuse_detected_at integer,
120
+ metadata text
121
+ );
122
+ create unique index auth_refresh_token_secret_hash_idx on auth_refresh_token (secret_hash);
123
+ create index auth_refresh_token_family_id_idx on auth_refresh_token (family_id);
124
+ create index auth_refresh_token_user_id_idx on auth_refresh_token (user_id);
125
+ create index auth_refresh_token_expires_at_idx on auth_refresh_token (expires_at);
126
+ create index auth_refresh_token_rotated_at_idx on auth_refresh_token (rotated_at);
127
+ create index auth_refresh_token_revoked_at_idx on auth_refresh_token (revoked_at);
128
+
129
+ create table auth_oauth_account (
130
+ id text primary key,
131
+ provider_id text not null,
132
+ provider_account_id text not null,
133
+ user_id text not null,
134
+ email text,
135
+ email_verified integer,
136
+ created_at integer not null,
137
+ updated_at integer not null,
138
+ unlinked_at integer,
139
+ metadata text
140
+ );
141
+ create unique index auth_oauth_account_provider_account_idx on auth_oauth_account (provider_id, provider_account_id);
142
+ create index auth_oauth_account_user_id_idx on auth_oauth_account (user_id);
143
+ create index auth_oauth_account_unlinked_at_idx on auth_oauth_account (unlinked_at);
144
+
145
+ create table auth_passkey_credential (
146
+ id text primary key,
147
+ user_id text not null,
148
+ credential_id text not null,
149
+ public_key text not null,
150
+ sign_count integer not null,
151
+ transports text,
152
+ backed_up integer,
153
+ created_at integer not null,
154
+ last_used_at integer,
155
+ revoked_at integer,
156
+ metadata text
157
+ );
158
+ create unique index auth_passkey_credential_credential_id_idx on auth_passkey_credential (credential_id);
159
+ create index auth_passkey_credential_user_id_idx on auth_passkey_credential (user_id);
160
+ create index auth_passkey_credential_revoked_at_idx on auth_passkey_credential (revoked_at);
161
+
162
+ create table auth_api_key (
163
+ id text primary key,
164
+ user_id text not null,
165
+ prefix text not null,
166
+ secret_hash text not null,
167
+ scopes text not null,
168
+ created_at integer not null,
169
+ expires_at integer,
170
+ last_used_at integer,
171
+ revoked_at integer,
172
+ metadata text
173
+ );
174
+ create unique index auth_api_key_prefix_idx on auth_api_key (prefix);
175
+ create index auth_api_key_user_id_idx on auth_api_key (user_id);
176
+ create index auth_api_key_expires_at_idx on auth_api_key (expires_at);
177
+ create index auth_api_key_revoked_at_idx on auth_api_key (revoked_at);
178
+
179
+ create table auth_jwt_revocation (
180
+ jwt_id text primary key,
181
+ revoked_at integer not null,
182
+ expires_at integer,
183
+ reason text
184
+ );
185
+ create index auth_jwt_revocation_expires_at_idx on auth_jwt_revocation (expires_at);
186
+
187
+ create table auth_audit_log (
188
+ storage_id integer primary key autoincrement,
189
+ id text,
190
+ type text not null,
191
+ user_id text,
192
+ actor_user_id text,
193
+ occurred_at integer not null,
194
+ request_ip_hash text,
195
+ request_user_agent_hash text,
196
+ event text not null,
197
+ created_at integer not null
198
+ );
199
+ create index auth_audit_log_id_idx on auth_audit_log (id);
200
+ create index auth_audit_log_user_occurred_at_idx on auth_audit_log (user_id, occurred_at);
201
+ create index auth_audit_log_actor_user_occurred_at_idx on auth_audit_log (actor_user_id, occurred_at);
202
+ create index auth_audit_log_type_occurred_at_idx on auth_audit_log (type, occurred_at);
203
+ create index auth_audit_log_occurred_at_idx on auth_audit_log (occurred_at);
204
+
205
+ create table auth_login_approval_review (
206
+ approval_challenge_id text primary key,
207
+ flow_id text not null,
208
+ user_id text not null,
209
+ channel text not null,
210
+ reason text not null,
211
+ session_binding text not null,
212
+ same_device_required integer not null,
213
+ status text not null,
214
+ created_at integer not null,
215
+ expires_at integer not null,
216
+ reviewed_at integer,
217
+ reviewed_by text,
218
+ denied_reason text,
219
+ risk text,
220
+ metadata text,
221
+ review_metadata text
222
+ );
223
+ create index auth_login_approval_review_flow_id_idx on auth_login_approval_review (flow_id);
224
+ create index auth_login_approval_review_user_id_idx on auth_login_approval_review (user_id);
225
+ create index auth_login_approval_review_status_expires_at_idx on auth_login_approval_review (status, expires_at);
226
+
227
+ create table auth_login_risk_history (
228
+ id text primary key,
229
+ user_id text not null,
230
+ occurred_at integer not null,
231
+ outcome text not null,
232
+ method text not null,
233
+ amr text not null,
234
+ aal text not null,
235
+ device_status text not null,
236
+ device_key text,
237
+ location_key text,
238
+ country text,
239
+ region text,
240
+ latitude_micro integer,
241
+ longitude_micro integer,
242
+ risk_level text,
243
+ created_at integer not null
244
+ );
245
+ create index auth_login_risk_history_user_occurred_at_idx on auth_login_risk_history (user_id, occurred_at);
246
+ create index auth_login_risk_history_user_device_key_idx on auth_login_risk_history (user_id, device_key);
247
+ create index auth_login_risk_history_user_location_key_idx on auth_login_risk_history (user_id, location_key);
248
+ create index auth_login_risk_history_occurred_at_idx on auth_login_risk_history (occurred_at);
249
+
250
+ create table auth_trusted_device (
251
+ user_id text not null,
252
+ token_hash text not null,
253
+ created_at integer not null,
254
+ last_seen_at integer not null,
255
+ expires_at integer not null,
256
+ metadata text,
257
+ primary key (user_id, token_hash)
258
+ );
259
+ create index auth_trusted_device_user_id_idx on auth_trusted_device (user_id);
260
+ create index auth_trusted_device_expires_at_idx on auth_trusted_device (expires_at);
261
+
262
+ create table auth_webhook_outbox (
263
+ id text primary key,
264
+ endpoint_key text not null,
265
+ event text not null,
266
+ status text not null,
267
+ attempts integer not null,
268
+ next_attempt_at integer not null,
269
+ created_at integer not null,
270
+ updated_at integer not null,
271
+ delivered_at integer,
272
+ last_error text
273
+ );
274
+ create index auth_webhook_outbox_due_idx on auth_webhook_outbox (next_attempt_at, status);
275
+ create index auth_webhook_outbox_endpoint_due_idx on auth_webhook_outbox (endpoint_key, next_attempt_at);
276
+ create index auth_webhook_outbox_status_idx on auth_webhook_outbox (status);
277
+
278
+ create table auth_webhook_replay (
279
+ id text primary key,
280
+ expires_at integer not null,
281
+ created_at integer not null
282
+ );
283
+ create index auth_webhook_replay_expires_at_idx on auth_webhook_replay (expires_at);
284
+
285
+ create table auth_domain_verification (
286
+ id text primary key,
287
+ owner_id text not null,
288
+ domain text not null,
289
+ proof_method text not null,
290
+ proof_token text not null,
291
+ status text not null,
292
+ created_at integer not null,
293
+ expires_at integer not null,
294
+ verified_at integer,
295
+ revoked_at integer,
296
+ last_checked_at integer,
297
+ metadata text
298
+ );
299
+ create unique index auth_domain_verification_owner_domain_idx on auth_domain_verification (owner_id, domain);
300
+ create index auth_domain_verification_domain_idx on auth_domain_verification (domain);
301
+ create index auth_domain_verification_status_expires_at_idx on auth_domain_verification (status, expires_at);
302
+
303
+ create table auth_security_timeline (
304
+ id text primary key,
305
+ user_id text not null,
306
+ type text not null,
307
+ category text not null,
308
+ severity text not null,
309
+ occurred_at integer not null,
310
+ summary text not null,
311
+ actor text,
312
+ request text,
313
+ metadata text
314
+ );
315
+ create index auth_security_timeline_user_occurred_at_idx on auth_security_timeline (user_id, occurred_at);
316
+ create index auth_security_timeline_type_idx on auth_security_timeline (type);
317
+ create index auth_security_timeline_category_idx on auth_security_timeline (category);
318
+
319
+ create table auth_oauth_client (
320
+ id text primary key,
321
+ type text not null,
322
+ status text not null,
323
+ name text,
324
+ redirect_uris text not null,
325
+ allowed_grant_types text not null,
326
+ allowed_response_types text not null,
327
+ allowed_scopes text,
328
+ created_at integer,
329
+ updated_at integer,
330
+ metadata text
331
+ );
332
+ create index auth_oauth_client_status_idx on auth_oauth_client (status);
333
+
334
+ create table auth_oauth_consent (
335
+ id text primary key,
336
+ user_id text not null,
337
+ client_id text not null,
338
+ scopes text not null,
339
+ granted_at integer not null,
340
+ expires_at integer,
341
+ revoked_at integer,
342
+ metadata text
343
+ );
344
+ create unique index auth_oauth_consent_user_client_idx on auth_oauth_consent (user_id, client_id);
345
+ create index auth_oauth_consent_user_id_idx on auth_oauth_consent (user_id);
346
+ create index auth_oauth_consent_expires_at_idx on auth_oauth_consent (expires_at);
347
+ create index auth_oauth_consent_revoked_at_idx on auth_oauth_consent (revoked_at);
348
+
349
+ create table auth_oauth_authorization_code (
350
+ code_hash text primary key,
351
+ client_id text not null,
352
+ subject text not null,
353
+ redirect_uri text not null,
354
+ scopes text not null,
355
+ code_challenge text,
356
+ code_challenge_method text,
357
+ issued_at integer not null,
358
+ expires_at integer not null,
359
+ consumed_at integer,
360
+ metadata text
361
+ );
362
+ create index auth_oauth_authorization_code_client_expires_at_idx on auth_oauth_authorization_code (client_id, expires_at);
363
+ create index auth_oauth_authorization_code_expires_at_idx on auth_oauth_authorization_code (expires_at);
364
+ create index auth_oauth_authorization_code_consumed_at_idx on auth_oauth_authorization_code (consumed_at);
365
+
366
+ create table auth_oauth_client_secret (
367
+ prefix text not null,
368
+ client_id text not null,
369
+ secret_hash text not null,
370
+ authentication_methods text not null,
371
+ created_at integer not null,
372
+ expires_at integer,
373
+ last_used_at integer,
374
+ revoked_at integer,
375
+ metadata text,
376
+ primary key (client_id, prefix)
377
+ );
378
+
379
+ create table auth_oauth_provider_mode_token (
380
+ token_hash text primary key,
381
+ token_type text not null,
382
+ client_id text not null,
383
+ subject text not null,
384
+ scopes text not null,
385
+ issued_at integer not null,
386
+ expires_at integer not null,
387
+ issuer text,
388
+ audience text,
389
+ jwt_id text,
390
+ revoked_at integer,
391
+ revocation_reason text,
392
+ rotated_at integer,
393
+ replaced_by_token_hash text,
394
+ metadata text
395
+ );
396
+ create index auth_oauth_provider_mode_token_client_expires_at_idx on auth_oauth_provider_mode_token (client_id, expires_at);
397
+ create index auth_oauth_provider_mode_token_subject_idx on auth_oauth_provider_mode_token (subject);
398
+ create index auth_oauth_provider_mode_token_expires_at_idx on auth_oauth_provider_mode_token (expires_at);
399
+ create index auth_oauth_provider_mode_token_revoked_at_idx on auth_oauth_provider_mode_token (revoked_at);
400
+ create index auth_oauth_provider_mode_token_rotated_at_idx on auth_oauth_provider_mode_token (rotated_at);
401
+ create index auth_oauth_provider_mode_token_jwt_id_idx on auth_oauth_provider_mode_token (jwt_id);
402
+
403
+ create table auth_oauth_provider_token_vault (
404
+ account_id text primary key,
405
+ user_id text not null,
406
+ provider_id text not null,
407
+ provider_account_id text not null,
408
+ access_token_ciphertext text not null,
409
+ refresh_token_ciphertext text,
410
+ id_token_ciphertext text,
411
+ token_type text not null,
412
+ scopes text,
413
+ expires_at integer,
414
+ updated_at integer not null,
415
+ revoked_at integer,
416
+ revocation_reason text
417
+ );
418
+ create index auth_oauth_provider_token_vault_user_id_idx on auth_oauth_provider_token_vault (user_id);
419
+ create index auth_oauth_provider_token_vault_provider_account_idx on auth_oauth_provider_token_vault (provider_id, provider_account_id);
420
+ create index auth_oauth_provider_token_vault_expires_at_idx on auth_oauth_provider_token_vault (expires_at);
421
+ create index auth_oauth_provider_token_vault_revoked_at_idx on auth_oauth_provider_token_vault (revoked_at);
422
+
423
+ create table auth_permission_definition (
424
+ id text primary key,
425
+ description text,
426
+ scope_type_present integer not null,
427
+ scope_type text not null,
428
+ created_at integer not null,
429
+ updated_at integer not null,
430
+ disabled_at integer,
431
+ deleted_at integer
432
+ );
433
+
434
+ create table auth_role_definition (
435
+ id text primary key,
436
+ description text,
437
+ created_at integer not null,
438
+ updated_at integer not null,
439
+ disabled_at integer,
440
+ deleted_at integer
441
+ );
442
+
443
+ create table auth_permission_grant (
444
+ subject_type text not null,
445
+ subject_id text not null,
446
+ permission_id text not null,
447
+ scope_type text not null,
448
+ scope_id_present integer not null,
449
+ scope_id text not null,
450
+ expires_at integer,
451
+ metadata text,
452
+ revoked_at integer,
453
+ primary key (subject_type, subject_id, permission_id, scope_type, scope_id_present, scope_id)
454
+ );
455
+ create index auth_permission_grant_check_idx on auth_permission_grant (subject_type, subject_id, permission_id, revoked_at, expires_at);
456
+
457
+ create table auth_role_grant (
458
+ subject_type text not null,
459
+ subject_id text not null,
460
+ role_id text not null,
461
+ scope_type text not null,
462
+ scope_id_present integer not null,
463
+ scope_id text not null,
464
+ expires_at integer,
465
+ metadata text,
466
+ revoked_at integer,
467
+ primary key (subject_type, subject_id, role_id, scope_type, scope_id_present, scope_id)
468
+ );
469
+ create index auth_role_grant_check_idx on auth_role_grant (subject_type, subject_id, role_id, revoked_at, expires_at);
470
+
471
+ create table auth_role_permission (
472
+ role_id text not null,
473
+ permission_id text not null,
474
+ scope_type_present integer not null,
475
+ scope_type text not null,
476
+ primary key (role_id, permission_id, scope_type_present, scope_type)
477
+ );
478
+ create index auth_role_permission_check_idx on auth_role_permission (permission_id, role_id, scope_type_present, scope_type);
479
+
480
+ create table auth_oauth_device_authorization (
481
+ id text primary key,
482
+ device_code_hash text not null unique,
483
+ user_code_hash text not null unique,
484
+ client_id text not null,
485
+ requested_scopes text not null check (json_valid(requested_scopes) and json_type(requested_scopes) = 'array'),
486
+ granted_scopes text check (granted_scopes is null or (json_valid(granted_scopes) and json_type(granted_scopes) = 'array')),
487
+ subject text,
488
+ status text not null check (status in ('pending', 'approved', 'denied')),
489
+ issued_at integer not null,
490
+ expires_at integer not null,
491
+ poll_interval_seconds integer not null check (poll_interval_seconds > 0),
492
+ next_poll_at integer not null,
493
+ last_polled_at integer,
494
+ approved_at integer,
495
+ denied_at integer,
496
+ consumed_at integer,
497
+ metadata text check (metadata is null or (json_valid(metadata) and json_type(metadata) = 'object')),
498
+ check (
499
+ (status = 'pending' and granted_scopes is null and subject is null and approved_at is null and denied_at is null and consumed_at is null)
500
+ or (status = 'approved' and granted_scopes is not null and subject is not null and approved_at is not null and denied_at is null)
501
+ or (status = 'denied' and granted_scopes is null and subject is null and approved_at is null and denied_at is not null and consumed_at is null)
502
+ )
503
+ );
504
+ create index auth_oauth_device_authorization_expires_at_idx on auth_oauth_device_authorization (expires_at);
505
+ create index auth_oauth_device_authorization_client_status_expires_at_idx on auth_oauth_device_authorization (client_id, status, expires_at);
506
+ create index auth_oauth_device_authorization_status_expires_at_idx on auth_oauth_device_authorization (status, expires_at);
507
+ `;
508
+ //# sourceMappingURL=SqliteStorageSchemaData.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SqliteStorageSchemaData.js","sourceRoot":"","sources":["../src/SqliteStorageSchemaData.ts"],"names":[],"mappings":"AAAA,uFAAuF;AACvF,gFAAgF;AAChF,MAAM,CAAC,MAAM,uBAAuB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwftC,CAAC"}
package/dist/StepUp.d.ts CHANGED
@@ -1,9 +1,14 @@
1
- import { Duration, Effect } from "effect";
2
- import type { PolicyId } from "./Identifiers.js";
3
- import { AuthzError } from "./Policy.js";
1
+ import { Context, Duration, Effect, Layer } from "effect";
2
+ import { type CustomEvidencePolicyError } from "./Assurance.js";
3
+ import type { CredentialId, PolicyId, UserId } from "./Identifiers.js";
4
+ import type { PasskeyCredentialInfo, PasskeyCredentialManagementService } from "./Passkey.js";
5
+ import { AuthorizationError } from "./Policy.js";
6
+ import type { RecoveryCodeManagementService } from "./RecoveryCode.js";
4
7
  import { CurrentSession } from "./Sessions.js";
5
- import type { AuthAssuranceLevel, CurrentSessionShape, SessionRequirement } from "./Sessions.js";
6
- export type StepUpReason = "aal-too-low" | "auth-too-old" | "session-requirement-unsatisfied";
8
+ import type { AuthAssuranceLevel, AuthMethodReference, CurrentSessionShape, SessionRequirement } from "./Sessions.js";
9
+ import type { CredentialStoreService } from "./Storage.js";
10
+ import type { TotpFactorManagementService } from "./Totp.js";
11
+ export type StepUpReason = "aal-too-low" | "amr-missing" | "auth-too-old" | "step-up-alternative-unsatisfied" | "session-requirement-unsatisfied";
7
12
  export interface StepUpRequirement {
8
13
  readonly aal?: AuthAssuranceLevel;
9
14
  readonly maxAge?: Duration.Duration;
@@ -13,17 +18,97 @@ export interface StepUpFailureDetail {
13
18
  readonly reason: StepUpReason;
14
19
  readonly requiredAal?: AuthAssuranceLevel;
15
20
  readonly currentAal?: AuthAssuranceLevel;
21
+ readonly method?: AuthMethodReference;
16
22
  readonly maxAgeMillis?: number;
17
23
  readonly authAgeMillis?: number;
18
24
  readonly requirement?: SessionRequirement;
19
25
  }
26
+ export type StepUpCapability = "password" | "passkey" | "totp" | "recovery-code" | "aal1-capable" | "aal2-capable" | "aal3-capable" | (string & {});
27
+ export type StepUpCapabilityMatcher = StepUpCapability | readonly StepUpCapability[];
28
+ export interface StepUpCapabilitiesListInput {
29
+ readonly userId: UserId;
30
+ }
31
+ declare const StepUpCapabilityError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
32
+ readonly _tag: "StepUpCapabilityError";
33
+ } & Readonly<A>;
34
+ export declare class StepUpCapabilityError extends StepUpCapabilityError_base<{
35
+ readonly message: string;
36
+ readonly cause?: unknown;
37
+ }> {
38
+ }
39
+ export interface StepUpCapabilitiesService {
40
+ readonly listForUser: (input: StepUpCapabilitiesListInput) => Effect.Effect<readonly StepUpCapability[], StepUpCapabilityError>;
41
+ }
42
+ declare const StepUpCapabilities_base: Context.ServiceClass<StepUpCapabilities, "auth/StepUpCapabilities", StepUpCapabilitiesService>;
43
+ export declare class StepUpCapabilities extends StepUpCapabilities_base {
44
+ }
45
+ export interface StepUpCapabilitiesDependencies {
46
+ readonly credentials?: CredentialStoreService;
47
+ readonly passkeyCredentialManagement?: PasskeyCredentialManagementService;
48
+ readonly totpFactorManagement?: TotpFactorManagementService;
49
+ readonly recoveryCodeManagement?: RecoveryCodeManagementService;
50
+ readonly passkeySupportsAal2?: (credential: PasskeyCredentialInfo) => boolean;
51
+ }
52
+ export interface StepUpPredicateOptions {
53
+ readonly maxAge?: Duration.Duration;
54
+ }
55
+ export type StepUpPredicate = {
56
+ readonly _tag: "Aal";
57
+ readonly aal: AuthAssuranceLevel;
58
+ readonly maxAge?: Duration.Duration;
59
+ } | {
60
+ readonly _tag: "Amr";
61
+ readonly method: AuthMethodReference;
62
+ readonly maxAge?: Duration.Duration;
63
+ } | {
64
+ readonly _tag: "Factor";
65
+ readonly method: AuthMethodReference;
66
+ readonly factorId: CredentialId;
67
+ readonly maxAge?: Duration.Duration;
68
+ } | {
69
+ readonly _tag: "Every";
70
+ readonly requirements: readonly StepUpPredicate[];
71
+ } | {
72
+ readonly _tag: "OneOf";
73
+ readonly requirements: readonly StepUpPredicate[];
74
+ };
75
+ export interface SessionStepUpPolicy {
76
+ readonly _tag: "SessionStepUpPolicy";
77
+ readonly require: StepUpPredicate;
78
+ readonly maxAge?: Duration.Duration;
79
+ readonly noSessionRequirements?: readonly SessionRequirement[];
80
+ }
81
+ export type StepUpPolicy = StepUpRequirement | SessionStepUpPolicy;
82
+ export type AdaptiveStepUpRule = {
83
+ readonly _tag: "Available";
84
+ readonly capabilities: readonly StepUpCapability[];
85
+ readonly policy: StepUpPolicy;
86
+ } | {
87
+ readonly _tag: "Allow";
88
+ } | {
89
+ readonly _tag: "Deny";
90
+ readonly reason: string;
91
+ };
92
+ export interface AdaptiveStepUpPolicy {
93
+ readonly _tag: "AdaptiveStepUpPolicy";
94
+ readonly rules: readonly AdaptiveStepUpRule[];
95
+ }
96
+ export type AnyStepUpPolicy = StepUpPolicy | AdaptiveStepUpPolicy;
20
97
  export type StepUpDecision = {
21
98
  readonly _tag: "Satisfied";
22
99
  readonly session: CurrentSessionShape;
100
+ readonly capabilities?: readonly StepUpCapability[];
23
101
  } | {
24
102
  readonly _tag: "Required";
25
103
  readonly session: CurrentSessionShape;
26
104
  readonly failures: readonly StepUpFailureDetail[];
105
+ readonly capabilities?: readonly StepUpCapability[];
106
+ };
107
+ export type AdaptiveStepUpDecision = StepUpDecision | {
108
+ readonly _tag: "Denied";
109
+ readonly session: CurrentSessionShape;
110
+ readonly reason: string;
111
+ readonly capabilities?: readonly StepUpCapability[];
27
112
  };
28
113
  declare const StepUpRequired_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
29
114
  readonly _tag: "StepUpRequired";
@@ -31,14 +116,50 @@ declare const StepUpRequired_base: new <A extends Record<string, any> = {}>(args
31
116
  export declare class StepUpRequired extends StepUpRequired_base<{
32
117
  readonly failures: readonly StepUpFailureDetail[];
33
118
  readonly session: CurrentSessionShape;
119
+ readonly capabilities?: readonly StepUpCapability[];
120
+ }> {
121
+ }
122
+ declare const StepUpDenied_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
123
+ readonly _tag: "StepUpDenied";
124
+ } & Readonly<A>;
125
+ export declare class StepUpDenied extends StepUpDenied_base<{
126
+ readonly reason: string;
127
+ readonly session: CurrentSessionShape;
128
+ readonly capabilities?: readonly StepUpCapability[];
34
129
  }> {
35
130
  }
131
+ export declare const makeStepUpCapabilities: (dependencies: StepUpCapabilitiesDependencies) => StepUpCapabilitiesService;
132
+ export declare const StepUpCapabilitiesLive: Layer.Layer<StepUpCapabilities, never, never>;
36
133
  export declare const aalAtLeast: (actual: AuthAssuranceLevel, minimum: AuthAssuranceLevel) => boolean;
37
- export declare const checkStepUp: (requirement: StepUpRequirement) => Effect.Effect<StepUpDecision, never, CurrentSession>;
38
- export declare const requireStepUp: (requirement: StepUpRequirement) => Effect.Effect<void, StepUpRequired, CurrentSession>;
39
- export declare const requireAal: (aal: AuthAssuranceLevel) => Effect.Effect<void, StepUpRequired, CurrentSession>;
40
- export declare const requireFresh: (maxAge: Duration.Duration) => Effect.Effect<void, StepUpRequired, CurrentSession>;
41
- export declare const requireNoSessionRequirements: (...requirements: readonly SessionRequirement[]) => Effect.Effect<void, StepUpRequired, CurrentSession>;
42
- export declare const toPolicy: (requirement: StepUpRequirement, policyId?: PolicyId) => Effect.Effect<void, AuthzError, CurrentSession>;
134
+ export declare const checkStepUp: (requirement: StepUpRequirement) => Effect.Effect<StepUpDecision, CustomEvidencePolicyError, CurrentSession>;
135
+ export declare const aal: (requiredAal: AuthAssuranceLevel, options?: StepUpPredicateOptions) => StepUpPredicate;
136
+ export declare const amr: (method: AuthMethodReference, options?: StepUpPredicateOptions) => StepUpPredicate;
137
+ export declare const factor: (method: AuthMethodReference, factorId: CredentialId, options?: StepUpPredicateOptions) => StepUpPredicate;
138
+ export declare const every: (...requirements: readonly StepUpPredicate[]) => StepUpPredicate;
139
+ export declare const oneOf: (...requirements: readonly StepUpPredicate[]) => StepUpPredicate;
140
+ export declare const available: (capabilities: StepUpCapabilityMatcher, policy: StepUpPolicy) => AdaptiveStepUpRule;
141
+ export declare const allow: () => AdaptiveStepUpRule;
142
+ export declare const deny: (reason?: string) => AdaptiveStepUpRule;
143
+ export declare const adaptive: (rules: readonly AdaptiveStepUpRule[]) => AdaptiveStepUpPolicy;
144
+ export declare const session: (input: {
145
+ readonly require: StepUpPredicate;
146
+ readonly maxAge?: Duration.Duration;
147
+ readonly noSessionRequirements?: readonly SessionRequirement[];
148
+ }) => SessionStepUpPolicy;
149
+ export declare const isAdaptiveStepUpPolicy: (policy: AnyStepUpPolicy) => policy is AdaptiveStepUpPolicy;
150
+ export declare const checkPolicy: (policy: StepUpPolicy) => Effect.Effect<StepUpDecision, CustomEvidencePolicyError, CurrentSession>;
151
+ export declare const checkAdaptivePolicy: (policy: AdaptiveStepUpPolicy) => Effect.Effect<AdaptiveStepUpDecision, StepUpCapabilityError | CustomEvidencePolicyError, CurrentSession | StepUpCapabilities>;
152
+ export declare const checkAnyPolicy: (policy: AnyStepUpPolicy) => Effect.Effect<AdaptiveStepUpDecision, StepUpCapabilityError | CustomEvidencePolicyError, CurrentSession | StepUpCapabilities>;
153
+ export declare const requireStepUp: (requirement: StepUpRequirement) => Effect.Effect<void, StepUpRequired | CustomEvidencePolicyError, CurrentSession>;
154
+ export declare const requirePolicy: (policy: StepUpPolicy) => Effect.Effect<void, StepUpRequired | CustomEvidencePolicyError, CurrentSession>;
155
+ export declare const requireAdaptivePolicy: (policy: AdaptiveStepUpPolicy) => Effect.Effect<void, StepUpRequired | StepUpDenied | StepUpCapabilityError | CustomEvidencePolicyError, CurrentSession | StepUpCapabilities>;
156
+ export declare const requireAnyPolicy: (policy: AnyStepUpPolicy) => Effect.Effect<void, StepUpRequired | StepUpDenied | StepUpCapabilityError | CustomEvidencePolicyError, CurrentSession | StepUpCapabilities>;
157
+ export declare function toGuard(policy: StepUpPolicy): Effect.Effect<void, StepUpRequired | CustomEvidencePolicyError, CurrentSession>;
158
+ export declare function toGuard(policy: AdaptiveStepUpPolicy): Effect.Effect<void, StepUpRequired | StepUpDenied | StepUpCapabilityError | CustomEvidencePolicyError, CurrentSession | StepUpCapabilities>;
159
+ export declare const requireAal: (requiredAal: AuthAssuranceLevel) => Effect.Effect<void, StepUpRequired | CustomEvidencePolicyError, CurrentSession>;
160
+ export declare const requireFresh: (maxAge: Duration.Duration) => Effect.Effect<void, StepUpRequired | CustomEvidencePolicyError, CurrentSession>;
161
+ export declare const requireNoSessionRequirements: (...requirements: readonly SessionRequirement[]) => Effect.Effect<void, StepUpRequired | CustomEvidencePolicyError, CurrentSession>;
162
+ export declare function toPolicy(requirement: StepUpPolicy, policyId?: PolicyId): Effect.Effect<void, AuthorizationError | CustomEvidencePolicyError, CurrentSession>;
163
+ export declare function toPolicy(requirement: AdaptiveStepUpPolicy, policyId?: PolicyId): Effect.Effect<void, AuthorizationError | CustomEvidencePolicyError, CurrentSession | StepUpCapabilities>;
43
164
  export {};
44
165
  //# sourceMappingURL=StepUp.d.ts.map