@effect-auth/core 0.1.0-alpha.15 → 0.1.0-alpha.18

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 (627) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +332 -131
  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 +2 -14
  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/AuthConfig.d.ts.map +1 -1
  28. package/dist/AuthConfig.js.map +1 -1
  29. package/dist/AuthFlow.d.ts +326 -220
  30. package/dist/AuthFlow.d.ts.map +1 -1
  31. package/dist/AuthFlow.js +611 -263
  32. package/dist/AuthFlow.js.map +1 -1
  33. package/dist/AuthKernel.d.ts +1 -1
  34. package/dist/AuthRateLimit.d.ts +96 -0
  35. package/dist/AuthRateLimit.d.ts.map +1 -0
  36. package/dist/AuthRateLimit.js +212 -0
  37. package/dist/AuthRateLimit.js.map +1 -0
  38. package/dist/Challenge.d.ts +0 -3
  39. package/dist/Challenge.d.ts.map +1 -1
  40. package/dist/Challenge.js +1 -4
  41. package/dist/Challenge.js.map +1 -1
  42. package/dist/Client.d.ts +205 -10
  43. package/dist/Client.d.ts.map +1 -1
  44. package/dist/Client.js +397 -16
  45. package/dist/Client.js.map +1 -1
  46. package/dist/CloudflareTurnstile.d.ts +28 -0
  47. package/dist/CloudflareTurnstile.d.ts.map +1 -0
  48. package/dist/CloudflareTurnstile.js +205 -0
  49. package/dist/CloudflareTurnstile.js.map +1 -0
  50. package/dist/Crypto.d.ts +0 -3
  51. package/dist/Crypto.d.ts.map +1 -1
  52. package/dist/Crypto.js +5 -7
  53. package/dist/Crypto.js.map +1 -1
  54. package/dist/DelegatedAccessStorageMigrations.d.ts +7 -0
  55. package/dist/DelegatedAccessStorageMigrations.d.ts.map +1 -0
  56. package/dist/DelegatedAccessStorageMigrations.js +159 -0
  57. package/dist/DelegatedAccessStorageMigrations.js.map +1 -0
  58. package/dist/DisposableEmailDomains.d.ts +19 -0
  59. package/dist/DisposableEmailDomains.d.ts.map +1 -0
  60. package/dist/DisposableEmailDomains.js +85 -0
  61. package/dist/DisposableEmailDomains.js.map +1 -0
  62. package/dist/DomainVerification.d.ts +0 -9
  63. package/dist/DomainVerification.d.ts.map +1 -1
  64. package/dist/DomainVerification.js +36 -22
  65. package/dist/DomainVerification.js.map +1 -1
  66. package/dist/DrizzleBunSqliteStorage.d.ts +18 -0
  67. package/dist/DrizzleBunSqliteStorage.d.ts.map +1 -0
  68. package/dist/DrizzleBunSqliteStorage.js +11 -0
  69. package/dist/DrizzleBunSqliteStorage.js.map +1 -0
  70. package/dist/DrizzleD1SqliteStorage.d.ts +28 -0
  71. package/dist/DrizzleD1SqliteStorage.d.ts.map +1 -0
  72. package/dist/DrizzleD1SqliteStorage.js +10 -0
  73. package/dist/DrizzleD1SqliteStorage.js.map +1 -0
  74. package/dist/DrizzleDurableObjectSqliteStorage.d.ts +19 -0
  75. package/dist/DrizzleDurableObjectSqliteStorage.d.ts.map +1 -0
  76. package/dist/DrizzleDurableObjectSqliteStorage.js +14 -0
  77. package/dist/DrizzleDurableObjectSqliteStorage.js.map +1 -0
  78. package/dist/DrizzleEffectSqliteStorage.d.ts +31 -0
  79. package/dist/DrizzleEffectSqliteStorage.d.ts.map +1 -0
  80. package/dist/DrizzleEffectSqliteStorage.js +108 -0
  81. package/dist/DrizzleEffectSqliteStorage.js.map +1 -0
  82. package/dist/DrizzleNodeSqliteStorage.d.ts +18 -0
  83. package/dist/DrizzleNodeSqliteStorage.d.ts.map +1 -0
  84. package/dist/DrizzleNodeSqliteStorage.js +11 -0
  85. package/dist/DrizzleNodeSqliteStorage.js.map +1 -0
  86. package/dist/DrizzleWasmSqliteStorage.d.ts +23 -0
  87. package/dist/DrizzleWasmSqliteStorage.d.ts.map +1 -0
  88. package/dist/DrizzleWasmSqliteStorage.js +15 -0
  89. package/dist/DrizzleWasmSqliteStorage.js.map +1 -0
  90. package/dist/EffectQbPostgresDelegatedAccessStorage.d.ts +34 -0
  91. package/dist/EffectQbPostgresDelegatedAccessStorage.d.ts.map +1 -0
  92. package/dist/EffectQbPostgresDelegatedAccessStorage.js +499 -0
  93. package/dist/EffectQbPostgresDelegatedAccessStorage.js.map +1 -0
  94. package/dist/EffectQbPostgresStorage.d.ts +171 -0
  95. package/dist/EffectQbPostgresStorage.d.ts.map +1 -0
  96. package/dist/EffectQbPostgresStorage.js +4280 -0
  97. package/dist/EffectQbPostgresStorage.js.map +1 -0
  98. package/dist/EffectQbSqliteDelegatedAccessStorage.d.ts +112 -0
  99. package/dist/EffectQbSqliteDelegatedAccessStorage.d.ts.map +1 -0
  100. package/dist/EffectQbSqliteDelegatedAccessStorage.js +602 -0
  101. package/dist/EffectQbSqliteDelegatedAccessStorage.js.map +1 -0
  102. package/dist/EffectQbSqliteStorage.d.ts +184 -27
  103. package/dist/EffectQbSqliteStorage.d.ts.map +1 -1
  104. package/dist/EffectQbSqliteStorage.js +1729 -135
  105. package/dist/EffectQbSqliteStorage.js.map +1 -1
  106. package/dist/EmailAuth.d.ts +65 -0
  107. package/dist/EmailAuth.d.ts.map +1 -0
  108. package/dist/EmailAuth.js +171 -0
  109. package/dist/EmailAuth.js.map +1 -0
  110. package/dist/EmailIdentityAuth.d.ts +30 -0
  111. package/dist/EmailIdentityAuth.d.ts.map +1 -0
  112. package/dist/EmailIdentityAuth.js +142 -0
  113. package/dist/EmailIdentityAuth.js.map +1 -0
  114. package/dist/EmailOtp.d.ts +10 -11
  115. package/dist/EmailOtp.d.ts.map +1 -1
  116. package/dist/EmailOtp.js +44 -81
  117. package/dist/EmailOtp.js.map +1 -1
  118. package/dist/EmailRisk.d.ts +48 -0
  119. package/dist/EmailRisk.d.ts.map +1 -0
  120. package/dist/EmailRisk.js +33 -0
  121. package/dist/EmailRisk.js.map +1 -0
  122. package/dist/EmailVerification.d.ts +10 -16
  123. package/dist/EmailVerification.d.ts.map +1 -1
  124. package/dist/EmailVerification.js +85 -42
  125. package/dist/EmailVerification.js.map +1 -1
  126. package/dist/Guard.d.ts +11 -0
  127. package/dist/Guard.d.ts.map +1 -0
  128. package/dist/Guard.js +11 -0
  129. package/dist/Guard.js.map +1 -0
  130. package/dist/HibpPwnedPasswords.d.ts +56 -0
  131. package/dist/HibpPwnedPasswords.d.ts.map +1 -0
  132. package/dist/HibpPwnedPasswords.js +232 -0
  133. package/dist/HibpPwnedPasswords.js.map +1 -0
  134. package/dist/HttpApi/AdminPermissionDefinition.d.ts +4 -0
  135. package/dist/HttpApi/AdminPermissionDefinition.d.ts.map +1 -0
  136. package/dist/HttpApi/AdminPermissionDefinition.js +4 -0
  137. package/dist/HttpApi/AdminPermissionDefinition.js.map +1 -0
  138. package/dist/HttpApi/AdminSecurityTimeline.d.ts +4 -0
  139. package/dist/HttpApi/AdminSecurityTimeline.d.ts.map +1 -0
  140. package/dist/HttpApi/AdminSecurityTimeline.js +4 -0
  141. package/dist/HttpApi/AdminSecurityTimeline.js.map +1 -0
  142. package/dist/HttpApi/AdminSession.d.ts +4 -0
  143. package/dist/HttpApi/AdminSession.d.ts.map +1 -0
  144. package/dist/HttpApi/AdminSession.js +4 -0
  145. package/dist/HttpApi/AdminSession.js.map +1 -0
  146. package/dist/HttpApi/AdminTrustedDevice.d.ts +4 -0
  147. package/dist/HttpApi/AdminTrustedDevice.d.ts.map +1 -0
  148. package/dist/HttpApi/AdminTrustedDevice.js +4 -0
  149. package/dist/HttpApi/AdminTrustedDevice.js.map +1 -0
  150. package/dist/HttpApi/Api.d.ts +1172 -1172
  151. package/dist/HttpApi/Api.d.ts.map +1 -1
  152. package/dist/HttpApi/Api.js +2160 -896
  153. package/dist/HttpApi/Api.js.map +1 -1
  154. package/dist/HttpApi/ApiKey.d.ts +4 -0
  155. package/dist/HttpApi/ApiKey.d.ts.map +1 -0
  156. package/dist/HttpApi/ApiKey.js +4 -0
  157. package/dist/HttpApi/ApiKey.js.map +1 -0
  158. package/dist/HttpApi/Audit.d.ts +6 -0
  159. package/dist/HttpApi/Audit.d.ts.map +1 -0
  160. package/dist/HttpApi/Audit.js +10 -0
  161. package/dist/HttpApi/Audit.js.map +1 -0
  162. package/dist/HttpApi/ClientApi.d.ts +917 -0
  163. package/dist/HttpApi/ClientApi.d.ts.map +1 -0
  164. package/dist/HttpApi/ClientApi.js +101 -0
  165. package/dist/HttpApi/ClientApi.js.map +1 -0
  166. package/dist/HttpApi/EmailAuth.d.ts +6 -0
  167. package/dist/HttpApi/EmailAuth.d.ts.map +1 -0
  168. package/dist/HttpApi/EmailAuth.js +6 -0
  169. package/dist/HttpApi/EmailAuth.js.map +1 -0
  170. package/dist/HttpApi/EmailGuards.d.ts +115 -0
  171. package/dist/HttpApi/EmailGuards.d.ts.map +1 -0
  172. package/dist/HttpApi/EmailGuards.js +191 -0
  173. package/dist/HttpApi/EmailGuards.js.map +1 -0
  174. package/dist/HttpApi/EmailOtp.d.ts +6 -0
  175. package/dist/HttpApi/EmailOtp.d.ts.map +1 -0
  176. package/dist/HttpApi/EmailOtp.js +6 -0
  177. package/dist/HttpApi/EmailOtp.js.map +1 -0
  178. package/dist/HttpApi/EmailVerification.d.ts +6 -0
  179. package/dist/HttpApi/EmailVerification.d.ts.map +1 -0
  180. package/dist/HttpApi/EmailVerification.js +6 -0
  181. package/dist/HttpApi/EmailVerification.js.map +1 -0
  182. package/dist/HttpApi/Endpoints.d.ts +629 -301
  183. package/dist/HttpApi/Endpoints.d.ts.map +1 -1
  184. package/dist/HttpApi/Endpoints.js +178 -120
  185. package/dist/HttpApi/Endpoints.js.map +1 -1
  186. package/dist/HttpApi/Errors.d.ts +26 -7
  187. package/dist/HttpApi/Errors.d.ts.map +1 -1
  188. package/dist/HttpApi/Errors.js +26 -4
  189. package/dist/HttpApi/Errors.js.map +1 -1
  190. package/dist/HttpApi/Identity.d.ts +6 -0
  191. package/dist/HttpApi/Identity.d.ts.map +1 -0
  192. package/dist/HttpApi/Identity.js +6 -0
  193. package/dist/HttpApi/Identity.js.map +1 -0
  194. package/dist/HttpApi/IdentityGuards.d.ts +31 -0
  195. package/dist/HttpApi/IdentityGuards.d.ts.map +1 -0
  196. package/dist/HttpApi/IdentityGuards.js +33 -0
  197. package/dist/HttpApi/IdentityGuards.js.map +1 -0
  198. package/dist/HttpApi/Jwt.d.ts +4 -0
  199. package/dist/HttpApi/Jwt.d.ts.map +1 -0
  200. package/dist/HttpApi/Jwt.js +4 -0
  201. package/dist/HttpApi/Jwt.js.map +1 -0
  202. package/dist/HttpApi/JwtDiscovery.d.ts +4 -0
  203. package/dist/HttpApi/JwtDiscovery.d.ts.map +1 -0
  204. package/dist/HttpApi/JwtDiscovery.js +4 -0
  205. package/dist/HttpApi/JwtDiscovery.js.map +1 -0
  206. package/dist/HttpApi/LoginApproval.d.ts +5 -0
  207. package/dist/HttpApi/LoginApproval.d.ts.map +1 -0
  208. package/dist/HttpApi/LoginApproval.js +5 -0
  209. package/dist/HttpApi/LoginApproval.js.map +1 -0
  210. package/dist/HttpApi/LoginNotification.d.ts +5 -0
  211. package/dist/HttpApi/LoginNotification.d.ts.map +1 -0
  212. package/dist/HttpApi/LoginNotification.js +5 -0
  213. package/dist/HttpApi/LoginNotification.js.map +1 -0
  214. package/dist/HttpApi/MagicLink.d.ts +6 -0
  215. package/dist/HttpApi/MagicLink.d.ts.map +1 -0
  216. package/dist/HttpApi/MagicLink.js +6 -0
  217. package/dist/HttpApi/MagicLink.js.map +1 -0
  218. package/dist/HttpApi/Mfa.d.ts +5 -0
  219. package/dist/HttpApi/Mfa.d.ts.map +1 -0
  220. package/dist/HttpApi/Mfa.js +5 -0
  221. package/dist/HttpApi/Mfa.js.map +1 -0
  222. package/dist/HttpApi/Middleware.d.ts +14 -0
  223. package/dist/HttpApi/Middleware.d.ts.map +1 -0
  224. package/dist/HttpApi/Middleware.js +5 -0
  225. package/dist/HttpApi/Middleware.js.map +1 -0
  226. package/dist/HttpApi/OAuth.d.ts +4 -0
  227. package/dist/HttpApi/OAuth.d.ts.map +1 -0
  228. package/dist/HttpApi/OAuth.js +4 -0
  229. package/dist/HttpApi/OAuth.js.map +1 -0
  230. package/dist/HttpApi/OAuthProviderAuthorization.d.ts +4 -0
  231. package/dist/HttpApi/OAuthProviderAuthorization.d.ts.map +1 -0
  232. package/dist/HttpApi/OAuthProviderAuthorization.js +4 -0
  233. package/dist/HttpApi/OAuthProviderAuthorization.js.map +1 -0
  234. package/dist/HttpApi/OAuthToken.d.ts +4 -0
  235. package/dist/HttpApi/OAuthToken.d.ts.map +1 -0
  236. package/dist/HttpApi/OAuthToken.js +4 -0
  237. package/dist/HttpApi/OAuthToken.js.map +1 -0
  238. package/dist/HttpApi/OidcDiscovery.d.ts +4 -0
  239. package/dist/HttpApi/OidcDiscovery.d.ts.map +1 -0
  240. package/dist/HttpApi/OidcDiscovery.js +4 -0
  241. package/dist/HttpApi/OidcDiscovery.js.map +1 -0
  242. package/dist/HttpApi/Operations/AdminPermissionDefinition.d.ts +28 -0
  243. package/dist/HttpApi/Operations/AdminPermissionDefinition.d.ts.map +1 -0
  244. package/dist/HttpApi/Operations/AdminPermissionDefinition.js +5 -0
  245. package/dist/HttpApi/Operations/AdminPermissionDefinition.js.map +1 -0
  246. package/dist/HttpApi/Operations/AdminSession.d.ts +16 -0
  247. package/dist/HttpApi/Operations/AdminSession.d.ts.map +1 -0
  248. package/dist/HttpApi/Operations/AdminSession.js +5 -0
  249. package/dist/HttpApi/Operations/AdminSession.js.map +1 -0
  250. package/dist/HttpApi/Operations/ApiKey.d.ts +16 -0
  251. package/dist/HttpApi/Operations/ApiKey.d.ts.map +1 -0
  252. package/dist/HttpApi/Operations/ApiKey.js +5 -0
  253. package/dist/HttpApi/Operations/ApiKey.js.map +1 -0
  254. package/dist/HttpApi/Operations/Discovery.d.ts +19 -0
  255. package/dist/HttpApi/Operations/Discovery.d.ts.map +1 -0
  256. package/dist/HttpApi/Operations/Discovery.js +7 -0
  257. package/dist/HttpApi/Operations/Discovery.js.map +1 -0
  258. package/dist/HttpApi/Operations/EmailAuth.d.ts +12 -0
  259. package/dist/HttpApi/Operations/EmailAuth.d.ts.map +1 -0
  260. package/dist/HttpApi/Operations/EmailAuth.js +5 -0
  261. package/dist/HttpApi/Operations/EmailAuth.js.map +1 -0
  262. package/dist/HttpApi/Operations/EmailOtp.d.ts +14 -0
  263. package/dist/HttpApi/Operations/EmailOtp.d.ts.map +1 -0
  264. package/dist/HttpApi/Operations/EmailOtp.js +5 -0
  265. package/dist/HttpApi/Operations/EmailOtp.js.map +1 -0
  266. package/dist/HttpApi/Operations/EmailVerification.d.ts +14 -0
  267. package/dist/HttpApi/Operations/EmailVerification.d.ts.map +1 -0
  268. package/dist/HttpApi/Operations/EmailVerification.js +5 -0
  269. package/dist/HttpApi/Operations/EmailVerification.js.map +1 -0
  270. package/dist/HttpApi/Operations/HttpOperation.d.ts +4 -0
  271. package/dist/HttpApi/Operations/HttpOperation.d.ts.map +1 -0
  272. package/dist/HttpApi/Operations/HttpOperation.js +2 -0
  273. package/dist/HttpApi/Operations/HttpOperation.js.map +1 -0
  274. package/dist/HttpApi/Operations/Identity.d.ts +22 -0
  275. package/dist/HttpApi/Operations/Identity.d.ts.map +1 -0
  276. package/dist/HttpApi/Operations/Identity.js +5 -0
  277. package/dist/HttpApi/Operations/Identity.js.map +1 -0
  278. package/dist/HttpApi/Operations/Jwt.d.ts +14 -0
  279. package/dist/HttpApi/Operations/Jwt.d.ts.map +1 -0
  280. package/dist/HttpApi/Operations/Jwt.js +5 -0
  281. package/dist/HttpApi/Operations/Jwt.js.map +1 -0
  282. package/dist/HttpApi/Operations/LoginApproval.d.ts +16 -0
  283. package/dist/HttpApi/Operations/LoginApproval.d.ts.map +1 -0
  284. package/dist/HttpApi/Operations/LoginApproval.js +5 -0
  285. package/dist/HttpApi/Operations/LoginApproval.js.map +1 -0
  286. package/dist/HttpApi/Operations/MagicLink.d.ts +14 -0
  287. package/dist/HttpApi/Operations/MagicLink.d.ts.map +1 -0
  288. package/dist/HttpApi/Operations/MagicLink.js +5 -0
  289. package/dist/HttpApi/Operations/MagicLink.js.map +1 -0
  290. package/dist/HttpApi/Operations/Mfa.d.ts +24 -0
  291. package/dist/HttpApi/Operations/Mfa.d.ts.map +1 -0
  292. package/dist/HttpApi/Operations/Mfa.js +5 -0
  293. package/dist/HttpApi/Operations/Mfa.js.map +1 -0
  294. package/dist/HttpApi/Operations/OAuth.d.ts +20 -0
  295. package/dist/HttpApi/Operations/OAuth.d.ts.map +1 -0
  296. package/dist/HttpApi/Operations/OAuth.js +5 -0
  297. package/dist/HttpApi/Operations/OAuth.js.map +1 -0
  298. package/dist/HttpApi/Operations/OAuthProviderAuthorization.d.ts +12 -0
  299. package/dist/HttpApi/Operations/OAuthProviderAuthorization.d.ts.map +1 -0
  300. package/dist/HttpApi/Operations/OAuthProviderAuthorization.js +5 -0
  301. package/dist/HttpApi/Operations/OAuthProviderAuthorization.js.map +1 -0
  302. package/dist/HttpApi/Operations/OAuthToken.d.ts +16 -0
  303. package/dist/HttpApi/Operations/OAuthToken.d.ts.map +1 -0
  304. package/dist/HttpApi/Operations/OAuthToken.js +5 -0
  305. package/dist/HttpApi/Operations/OAuthToken.js.map +1 -0
  306. package/dist/HttpApi/Operations/Passkey.d.ts +22 -0
  307. package/dist/HttpApi/Operations/Passkey.d.ts.map +1 -0
  308. package/dist/HttpApi/Operations/Passkey.js +5 -0
  309. package/dist/HttpApi/Operations/Passkey.js.map +1 -0
  310. package/dist/HttpApi/Operations/Password.d.ts +22 -0
  311. package/dist/HttpApi/Operations/Password.d.ts.map +1 -0
  312. package/dist/HttpApi/Operations/Password.js +5 -0
  313. package/dist/HttpApi/Operations/Password.js.map +1 -0
  314. package/dist/HttpApi/Operations/RecoveryCodes.d.ts +20 -0
  315. package/dist/HttpApi/Operations/RecoveryCodes.d.ts.map +1 -0
  316. package/dist/HttpApi/Operations/RecoveryCodes.js +5 -0
  317. package/dist/HttpApi/Operations/RecoveryCodes.js.map +1 -0
  318. package/dist/HttpApi/Operations/RefreshToken.d.ts +12 -0
  319. package/dist/HttpApi/Operations/RefreshToken.d.ts.map +1 -0
  320. package/dist/HttpApi/Operations/RefreshToken.js +5 -0
  321. package/dist/HttpApi/Operations/RefreshToken.js.map +1 -0
  322. package/dist/HttpApi/Operations/Security.d.ts +12 -0
  323. package/dist/HttpApi/Operations/Security.d.ts.map +1 -0
  324. package/dist/HttpApi/Operations/Security.js +5 -0
  325. package/dist/HttpApi/Operations/Security.js.map +1 -0
  326. package/dist/HttpApi/Operations/SecurityTimeline.d.ts +19 -0
  327. package/dist/HttpApi/Operations/SecurityTimeline.d.ts.map +1 -0
  328. package/dist/HttpApi/Operations/SecurityTimeline.js +7 -0
  329. package/dist/HttpApi/Operations/SecurityTimeline.js.map +1 -0
  330. package/dist/HttpApi/Operations/Session.d.ts +22 -0
  331. package/dist/HttpApi/Operations/Session.d.ts.map +1 -0
  332. package/dist/HttpApi/Operations/Session.js +5 -0
  333. package/dist/HttpApi/Operations/Session.js.map +1 -0
  334. package/dist/HttpApi/Operations/StepUp.d.ts +22 -0
  335. package/dist/HttpApi/Operations/StepUp.d.ts.map +1 -0
  336. package/dist/HttpApi/Operations/StepUp.js +5 -0
  337. package/dist/HttpApi/Operations/StepUp.js.map +1 -0
  338. package/dist/HttpApi/Operations/Totp.d.ts +20 -0
  339. package/dist/HttpApi/Operations/Totp.d.ts.map +1 -0
  340. package/dist/HttpApi/Operations/Totp.js +5 -0
  341. package/dist/HttpApi/Operations/Totp.js.map +1 -0
  342. package/dist/HttpApi/Operations/TrustedDevice.d.ts +23 -0
  343. package/dist/HttpApi/Operations/TrustedDevice.d.ts.map +1 -0
  344. package/dist/HttpApi/Operations/TrustedDevice.js +7 -0
  345. package/dist/HttpApi/Operations/TrustedDevice.js.map +1 -0
  346. package/dist/HttpApi/Operations/index.d.ts +27 -0
  347. package/dist/HttpApi/Operations/index.d.ts.map +1 -0
  348. package/dist/HttpApi/Operations/index.js +27 -0
  349. package/dist/HttpApi/Operations/index.js.map +1 -0
  350. package/dist/HttpApi/Passkey.d.ts +5 -0
  351. package/dist/HttpApi/Passkey.d.ts.map +1 -0
  352. package/dist/HttpApi/Passkey.js +5 -0
  353. package/dist/HttpApi/Passkey.js.map +1 -0
  354. package/dist/HttpApi/Password.d.ts +220 -0
  355. package/dist/HttpApi/Password.d.ts.map +1 -0
  356. package/dist/HttpApi/Password.js +237 -0
  357. package/dist/HttpApi/Password.js.map +1 -0
  358. package/dist/HttpApi/PasswordContract.d.ts +307 -0
  359. package/dist/HttpApi/PasswordContract.d.ts.map +1 -0
  360. package/dist/HttpApi/PasswordContract.js +63 -0
  361. package/dist/HttpApi/PasswordContract.js.map +1 -0
  362. package/dist/HttpApi/PasswordGuards.d.ts +82 -0
  363. package/dist/HttpApi/PasswordGuards.d.ts.map +1 -0
  364. package/dist/HttpApi/PasswordGuards.js +179 -0
  365. package/dist/HttpApi/PasswordGuards.js.map +1 -0
  366. package/dist/HttpApi/RecoveryCodes.d.ts +5 -0
  367. package/dist/HttpApi/RecoveryCodes.d.ts.map +1 -0
  368. package/dist/HttpApi/RecoveryCodes.js +5 -0
  369. package/dist/HttpApi/RecoveryCodes.js.map +1 -0
  370. package/dist/HttpApi/RefreshToken.d.ts +4 -0
  371. package/dist/HttpApi/RefreshToken.d.ts.map +1 -0
  372. package/dist/HttpApi/RefreshToken.js +4 -0
  373. package/dist/HttpApi/RefreshToken.js.map +1 -0
  374. package/dist/HttpApi/RequestGuards.d.ts +42 -0
  375. package/dist/HttpApi/RequestGuards.d.ts.map +1 -0
  376. package/dist/HttpApi/RequestGuards.js +194 -0
  377. package/dist/HttpApi/RequestGuards.js.map +1 -0
  378. package/dist/HttpApi/Schemas.d.ts +361 -84
  379. package/dist/HttpApi/Schemas.d.ts.map +1 -1
  380. package/dist/HttpApi/Schemas.js +190 -27
  381. package/dist/HttpApi/Schemas.js.map +1 -1
  382. package/dist/HttpApi/Security.d.ts +12 -93
  383. package/dist/HttpApi/Security.d.ts.map +1 -1
  384. package/dist/HttpApi/Security.js +65 -356
  385. package/dist/HttpApi/Security.js.map +1 -1
  386. package/dist/HttpApi/SecurityTimeline.d.ts +4 -0
  387. package/dist/HttpApi/SecurityTimeline.d.ts.map +1 -0
  388. package/dist/HttpApi/SecurityTimeline.js +4 -0
  389. package/dist/HttpApi/SecurityTimeline.js.map +1 -0
  390. package/dist/HttpApi/Session.d.ts +5 -0
  391. package/dist/HttpApi/Session.d.ts.map +1 -0
  392. package/dist/HttpApi/Session.js +5 -0
  393. package/dist/HttpApi/Session.js.map +1 -0
  394. package/dist/HttpApi/SessionGuards.d.ts +15 -0
  395. package/dist/HttpApi/SessionGuards.d.ts.map +1 -0
  396. package/dist/HttpApi/SessionGuards.js +37 -0
  397. package/dist/HttpApi/SessionGuards.js.map +1 -0
  398. package/dist/HttpApi/StepUp.d.ts +5 -0
  399. package/dist/HttpApi/StepUp.d.ts.map +1 -0
  400. package/dist/HttpApi/StepUp.js +5 -0
  401. package/dist/HttpApi/StepUp.js.map +1 -0
  402. package/dist/HttpApi/Totp.d.ts +5 -0
  403. package/dist/HttpApi/Totp.d.ts.map +1 -0
  404. package/dist/HttpApi/Totp.js +5 -0
  405. package/dist/HttpApi/Totp.js.map +1 -0
  406. package/dist/HttpApi/Transport.d.ts +4 -6
  407. package/dist/HttpApi/Transport.d.ts.map +1 -1
  408. package/dist/HttpApi/Transport.js +62 -36
  409. package/dist/HttpApi/Transport.js.map +1 -1
  410. package/dist/HttpApi/TrustedDevice.d.ts +4 -0
  411. package/dist/HttpApi/TrustedDevice.d.ts.map +1 -0
  412. package/dist/HttpApi/TrustedDevice.js +4 -0
  413. package/dist/HttpApi/TrustedDevice.js.map +1 -0
  414. package/dist/HttpApi/index.d.ts +9 -3
  415. package/dist/HttpApi/index.d.ts.map +1 -1
  416. package/dist/HttpApi/index.js +8 -2
  417. package/dist/HttpApi/index.js.map +1 -1
  418. package/dist/Identity.d.ts +138 -0
  419. package/dist/Identity.d.ts.map +1 -0
  420. package/dist/Identity.js +105 -0
  421. package/dist/Identity.js.map +1 -0
  422. package/dist/IdentityManagement.d.ts +189 -0
  423. package/dist/IdentityManagement.d.ts.map +1 -0
  424. package/dist/IdentityManagement.js +317 -0
  425. package/dist/IdentityManagement.js.map +1 -0
  426. package/dist/IncidentAction.d.ts +1 -4
  427. package/dist/IncidentAction.d.ts.map +1 -1
  428. package/dist/IncidentAction.js +15 -9
  429. package/dist/IncidentAction.js.map +1 -1
  430. package/dist/Internal.d.ts +2 -0
  431. package/dist/Internal.d.ts.map +1 -1
  432. package/dist/Internal.js +30 -0
  433. package/dist/Internal.js.map +1 -1
  434. package/dist/Invitation.d.ts +362 -0
  435. package/dist/Invitation.d.ts.map +1 -0
  436. package/dist/Invitation.js +633 -0
  437. package/dist/Invitation.js.map +1 -0
  438. package/dist/IpQualityScore.d.ts +38 -0
  439. package/dist/IpQualityScore.d.ts.map +1 -0
  440. package/dist/IpQualityScore.js +215 -0
  441. package/dist/IpQualityScore.js.map +1 -0
  442. package/dist/Jwt.d.ts +9 -30
  443. package/dist/Jwt.d.ts.map +1 -1
  444. package/dist/Jwt.js +72 -60
  445. package/dist/Jwt.js.map +1 -1
  446. package/dist/LoginApproval.d.ts +16 -31
  447. package/dist/LoginApproval.d.ts.map +1 -1
  448. package/dist/LoginApproval.js +47 -41
  449. package/dist/LoginApproval.js.map +1 -1
  450. package/dist/LoginNotification.d.ts +8 -12
  451. package/dist/LoginNotification.d.ts.map +1 -1
  452. package/dist/LoginNotification.js +30 -17
  453. package/dist/LoginNotification.js.map +1 -1
  454. package/dist/LoginRisk.d.ts +11 -13
  455. package/dist/LoginRisk.d.ts.map +1 -1
  456. package/dist/LoginRisk.js +66 -26
  457. package/dist/LoginRisk.js.map +1 -1
  458. package/dist/LoginRiskEnrichment.d.ts +145 -0
  459. package/dist/LoginRiskEnrichment.d.ts.map +1 -0
  460. package/dist/LoginRiskEnrichment.js +220 -0
  461. package/dist/LoginRiskEnrichment.js.map +1 -0
  462. package/dist/MachineAuth.d.ts.map +1 -1
  463. package/dist/MachineAuth.js.map +1 -1
  464. package/dist/MagicLink.d.ts +9 -8
  465. package/dist/MagicLink.d.ts.map +1 -1
  466. package/dist/MagicLink.js +40 -73
  467. package/dist/MagicLink.js.map +1 -1
  468. package/dist/Mailer.d.ts +20 -13
  469. package/dist/Mailer.d.ts.map +1 -1
  470. package/dist/Mailer.js +10 -12
  471. package/dist/Mailer.js.map +1 -1
  472. package/dist/OAuth.d.ts +100 -103
  473. package/dist/OAuth.d.ts.map +1 -1
  474. package/dist/OAuth.js +404 -217
  475. package/dist/OAuth.js.map +1 -1
  476. package/dist/Passkey.d.ts +17 -19
  477. package/dist/Passkey.d.ts.map +1 -1
  478. package/dist/Passkey.js +86 -39
  479. package/dist/Passkey.js.map +1 -1
  480. package/dist/PasskeyBrowser.d.ts +39 -0
  481. package/dist/PasskeyBrowser.d.ts.map +1 -0
  482. package/dist/PasskeyBrowser.js +206 -0
  483. package/dist/PasskeyBrowser.js.map +1 -0
  484. package/dist/PasskeySimpleWebAuthn.d.ts.map +1 -1
  485. package/dist/PasskeySimpleWebAuthn.js +19 -7
  486. package/dist/PasskeySimpleWebAuthn.js.map +1 -1
  487. package/dist/Password.d.ts +71 -37
  488. package/dist/Password.d.ts.map +1 -1
  489. package/dist/Password.js +296 -82
  490. package/dist/Password.js.map +1 -1
  491. package/dist/PasswordRisk.d.ts +63 -0
  492. package/dist/PasswordRisk.d.ts.map +1 -0
  493. package/dist/PasswordRisk.js +37 -0
  494. package/dist/PasswordRisk.js.map +1 -0
  495. package/dist/Permission.d.ts +308 -0
  496. package/dist/Permission.d.ts.map +1 -0
  497. package/dist/Permission.js +827 -0
  498. package/dist/Permission.js.map +1 -0
  499. package/dist/Policy.d.ts +31 -18
  500. package/dist/Policy.d.ts.map +1 -1
  501. package/dist/Policy.js +58 -14
  502. package/dist/Policy.js.map +1 -1
  503. package/dist/PostgresDelegatedAccessStorageMigrations.d.ts +7 -0
  504. package/dist/PostgresDelegatedAccessStorageMigrations.d.ts.map +1 -0
  505. package/dist/PostgresDelegatedAccessStorageMigrations.js +119 -0
  506. package/dist/PostgresDelegatedAccessStorageMigrations.js.map +1 -0
  507. package/dist/PostgresStorageMigrations.d.ts +15 -0
  508. package/dist/PostgresStorageMigrations.d.ts.map +1 -0
  509. package/dist/PostgresStorageMigrations.js +620 -0
  510. package/dist/PostgresStorageMigrations.js.map +1 -0
  511. package/dist/Privacy.d.ts +0 -3
  512. package/dist/Privacy.d.ts.map +1 -1
  513. package/dist/Privacy.js +2 -5
  514. package/dist/Privacy.js.map +1 -1
  515. package/dist/RateLimiter.d.ts +0 -3
  516. package/dist/RateLimiter.d.ts.map +1 -1
  517. package/dist/RateLimiter.js +1 -4
  518. package/dist/RateLimiter.js.map +1 -1
  519. package/dist/RecoveryCode.d.ts +84 -12
  520. package/dist/RecoveryCode.d.ts.map +1 -1
  521. package/dist/RecoveryCode.js +273 -75
  522. package/dist/RecoveryCode.js.map +1 -1
  523. package/dist/RecoveryPolicy.d.ts +81 -0
  524. package/dist/RecoveryPolicy.d.ts.map +1 -0
  525. package/dist/RecoveryPolicy.js +119 -0
  526. package/dist/RecoveryPolicy.js.map +1 -0
  527. package/dist/RefreshToken.d.ts +1 -10
  528. package/dist/RefreshToken.d.ts.map +1 -1
  529. package/dist/RefreshToken.js +31 -22
  530. package/dist/RefreshToken.js.map +1 -1
  531. package/dist/Retention.d.ts.map +1 -1
  532. package/dist/Retention.js.map +1 -1
  533. package/dist/SecurityTimeline.d.ts +1 -4
  534. package/dist/SecurityTimeline.d.ts.map +1 -1
  535. package/dist/SecurityTimeline.js +110 -17
  536. package/dist/SecurityTimeline.js.map +1 -1
  537. package/dist/Sessions.d.ts +124 -29
  538. package/dist/Sessions.d.ts.map +1 -1
  539. package/dist/Sessions.js +626 -94
  540. package/dist/Sessions.js.map +1 -1
  541. package/dist/StepUp.d.ts +132 -11
  542. package/dist/StepUp.d.ts.map +1 -1
  543. package/dist/StepUp.js +387 -19
  544. package/dist/StepUp.js.map +1 -1
  545. package/dist/Storage.d.ts +89 -23
  546. package/dist/Storage.d.ts.map +1 -1
  547. package/dist/Storage.js +10 -12
  548. package/dist/Storage.js.map +1 -1
  549. package/dist/StorageMigrations.d.ts +6 -1
  550. package/dist/StorageMigrations.d.ts.map +1 -1
  551. package/dist/StorageMigrations.js +224 -0
  552. package/dist/StorageMigrations.js.map +1 -1
  553. package/dist/StorageSchemaGenerator.d.ts +486 -0
  554. package/dist/StorageSchemaGenerator.d.ts.map +1 -0
  555. package/dist/StorageSchemaGenerator.js +1022 -0
  556. package/dist/StorageSchemaGenerator.js.map +1 -0
  557. package/dist/StrongFactor.d.ts +64 -0
  558. package/dist/StrongFactor.d.ts.map +1 -0
  559. package/dist/StrongFactor.js +100 -0
  560. package/dist/StrongFactor.js.map +1 -0
  561. package/dist/Testing.d.ts +1 -1
  562. package/dist/Testing.js +2 -2
  563. package/dist/Testing.js.map +1 -1
  564. package/dist/Totp.d.ts +88 -13
  565. package/dist/Totp.d.ts.map +1 -1
  566. package/dist/Totp.js +194 -36
  567. package/dist/Totp.js.map +1 -1
  568. package/dist/TrustedDevice.d.ts +0 -9
  569. package/dist/TrustedDevice.d.ts.map +1 -1
  570. package/dist/TrustedDevice.js +15 -17
  571. package/dist/TrustedDevice.js.map +1 -1
  572. package/dist/WaitUntil.d.ts +0 -3
  573. package/dist/WaitUntil.d.ts.map +1 -1
  574. package/dist/WaitUntil.js +1 -4
  575. package/dist/WaitUntil.js.map +1 -1
  576. package/dist/Webhook.d.ts +42 -12
  577. package/dist/Webhook.d.ts.map +1 -1
  578. package/dist/Webhook.js +165 -26
  579. package/dist/Webhook.js.map +1 -1
  580. package/dist/alchemy/cloudflare/Email.d.ts +4 -4
  581. package/dist/alchemy/cloudflare/Email.d.ts.map +1 -1
  582. package/dist/alchemy/cloudflare/Email.js +10 -5
  583. package/dist/alchemy/cloudflare/Email.js.map +1 -1
  584. package/dist/alchemy/cloudflare/RateLimitDurableObject.d.ts +4 -4
  585. package/dist/alchemy/cloudflare/RateLimitDurableObject.d.ts.map +1 -1
  586. package/dist/alchemy/cloudflare/RateLimitDurableObject.js +5 -4
  587. package/dist/alchemy/cloudflare/RateLimitDurableObject.js.map +1 -1
  588. package/dist/cloudflare/Email.d.ts.map +1 -1
  589. package/dist/cloudflare/Email.js +1 -1
  590. package/dist/cloudflare/Email.js.map +1 -1
  591. package/dist/cloudflare/RateLimitDurableObject.d.ts +6 -5
  592. package/dist/cloudflare/RateLimitDurableObject.d.ts.map +1 -1
  593. package/dist/cloudflare/RateLimitDurableObject.js.map +1 -1
  594. package/dist/cloudflare/RequestMetadata.d.ts +49 -0
  595. package/dist/cloudflare/RequestMetadata.d.ts.map +1 -0
  596. package/dist/cloudflare/RequestMetadata.js +71 -0
  597. package/dist/cloudflare/RequestMetadata.js.map +1 -0
  598. package/dist/index.d.ts +0 -35
  599. package/dist/index.d.ts.map +1 -1
  600. package/dist/index.js +0 -35
  601. package/dist/index.js.map +1 -1
  602. package/dist/internal/AuthFlowFinalizer.d.ts +31 -0
  603. package/dist/internal/AuthFlowFinalizer.d.ts.map +1 -0
  604. package/dist/internal/AuthFlowFinalizer.js +182 -0
  605. package/dist/internal/AuthFlowFinalizer.js.map +1 -0
  606. package/dist/internal/RateLimitDurableObject.d.ts.map +1 -1
  607. package/dist/internal/RateLimitDurableObject.js +3 -0
  608. package/dist/internal/RateLimitDurableObject.js.map +1 -1
  609. package/migrations/0001_auth_storage.sql +1 -0
  610. package/migrations/0006_auth_totp_factor.sql +1 -0
  611. package/migrations/0024_auth_permission.sql +39 -0
  612. package/migrations/0025_auth_permission_definition.sql +19 -0
  613. package/migrations/0026_auth_user_identity.sql +59 -0
  614. package/migrations/0027_auth_audit_log_storage_order.sql +46 -0
  615. package/migrations/0028_auth_oauth_client_secret_key.sql +39 -0
  616. package/migrations/delegated-access/0001_auth_delegated_access.sql +152 -0
  617. package/migrations/postgres/0001_auth_core.sql +77 -0
  618. package/migrations/postgres/0002_auth_security_oauth.sql +65 -0
  619. package/migrations/postgres/0003_auth_credentials_tokens.sql +43 -0
  620. package/migrations/postgres/0004_auth_security_history.sql +103 -0
  621. package/migrations/postgres/0005_auth_webhooks.sql +29 -0
  622. package/migrations/postgres/0006_auth_domain_timeline.sql +50 -0
  623. package/migrations/postgres/0007_auth_oauth_clients.sql +85 -0
  624. package/migrations/postgres/0008_auth_oauth_tokens.sql +63 -0
  625. package/migrations/postgres/0009_auth_permissions.sql +66 -0
  626. package/migrations/postgres/delegated-access/0001_auth_delegated_access.sql +112 -0
  627. package/package.json +309 -2
@@ -1,10 +1,13 @@
1
- import { Context, Effect, Layer } from "effect";
1
+ import { Context, Effect, Layer, Schema } from "effect";
2
2
  import type { ApiKeyId } from "./ApiKey.js";
3
- import type { AuditEventId, ChallengeId, CredentialId, EmailHash, IpHash, OAuthAccountId, OAuthProviderId, PolicyId, SessionId, UnixMillis, UserAgentHash, UserId } from "./Identifiers.js";
3
+ import type { AssuranceLevel, AuthMethodReference } from "./Assurance.js";
4
+ import type { AuditEventId, ChallengeId, CredentialId, EmailHash, IdentityId, IpHash, OAuthAccountId, OAuthProviderId, PermissionId, PolicyId, RoleId, SessionId, UnixMillis, UserAgentHash, UserId } from "./Identifiers.js";
5
+ import type { IdentityKind, IdentityScope } from "./Identity.js";
4
6
  import type { IncidentActionResult } from "./IncidentAction.js";
5
7
  import type { LoginRiskAssessment } from "./LoginRisk.js";
6
8
  import type { PasskeyCredentialId } from "./Passkey.js";
7
9
  import type { RefreshTokenFamilyId, RefreshTokenId } from "./RefreshToken.js";
10
+ import type { SessionRequirement } from "./Sessions.js";
8
11
  declare const AuditLogError_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 & {
9
12
  readonly _tag: "AuditLogError";
10
13
  } & Readonly<A>;
@@ -13,7 +16,7 @@ export declare class AuditLogError extends AuditLogError_base<{
13
16
  readonly cause?: unknown;
14
17
  }> {
15
18
  }
16
- export type AuditLogStoreOperation = "insert" | "list" | "deleteBefore";
19
+ export type AuditLogStoreOperation = "insertMany" | "list" | "deleteBefore";
17
20
  declare const AuditLogStoreError_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 & {
18
21
  readonly _tag: "AuditLogStoreError";
19
22
  } & Readonly<A>;
@@ -29,6 +32,10 @@ export type AuditActor = {
29
32
  readonly type: "user";
30
33
  readonly userId: UserId;
31
34
  readonly sessionId?: SessionId;
35
+ } | {
36
+ readonly type: "custom";
37
+ readonly actorType: string;
38
+ readonly actorReference?: string;
32
39
  };
33
40
  export declare const AuditActor: {
34
41
  readonly anonymous: () => AuditActor;
@@ -36,7 +43,22 @@ export declare const AuditActor: {
36
43
  readonly userId: UserId;
37
44
  readonly sessionId?: SessionId;
38
45
  }) => AuditActor;
46
+ readonly custom: (input: {
47
+ readonly actorType: string;
48
+ readonly actorReference?: string;
49
+ }) => AuditActor;
39
50
  };
51
+ export declare const AuditActorSchema: Schema.Union<readonly [Schema.Struct<{
52
+ readonly type: Schema.Literal<"anonymous">;
53
+ }>, Schema.Struct<{
54
+ readonly type: Schema.Literal<"user">;
55
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
56
+ readonly sessionId: Schema.optional<Schema.brand<Schema.String, "auth/SessionId">>;
57
+ }>, Schema.Struct<{
58
+ readonly type: Schema.Literal<"custom">;
59
+ readonly actorType: Schema.String;
60
+ readonly actorReference: Schema.optional<Schema.String>;
61
+ }>]>;
40
62
  export type AuditSubject = {
41
63
  readonly type: "anonymous";
42
64
  } | {
@@ -51,11 +73,164 @@ export declare const AuditSubject: {
51
73
  readonly email: (emailHash: EmailHash) => AuditSubject;
52
74
  readonly user: (userId: UserId) => AuditSubject;
53
75
  };
76
+ export declare const AuditSubjectSchema: Schema.Union<readonly [Schema.Struct<{
77
+ readonly type: Schema.Literal<"anonymous">;
78
+ }>, Schema.Struct<{
79
+ readonly type: Schema.Literal<"email">;
80
+ readonly emailHash: Schema.brand<Schema.String, "auth/EmailHash">;
81
+ }>, Schema.Struct<{
82
+ readonly type: Schema.Literal<"user">;
83
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
84
+ }>]>;
54
85
  export interface AuditRequest {
55
86
  readonly ipHash?: IpHash;
56
87
  readonly userAgentHash?: UserAgentHash;
57
88
  }
58
- export type AuthAuditEvent = {
89
+ export declare const AuditRequestSchema: Schema.Struct<{
90
+ readonly ipHash: Schema.optional<Schema.brand<Schema.String, "auth/IpHash">>;
91
+ readonly userAgentHash: Schema.optional<Schema.brand<Schema.String, "auth/UserAgentHash">>;
92
+ }>;
93
+ export type AuthorizationAuditEventType = "auth.permission_definition.created" | "auth.permission_definition.updated" | "auth.permission_definition.disabled" | "auth.permission_definition.enabled" | "auth.permission_definition.deleted" | "auth.role_definition.created" | "auth.role_definition.updated" | "auth.role_definition.disabled" | "auth.role_definition.enabled" | "auth.role_definition.deleted" | "auth.permission.granted" | "auth.permission.revoked" | "auth.role.granted" | "auth.role.revoked" | "auth.role_permission.assigned" | "auth.role_permission.removed";
94
+ export type AuthorizationAuditSubject = {
95
+ readonly type: "user";
96
+ readonly userId: UserId;
97
+ } | {
98
+ readonly type: "custom";
99
+ readonly subjectType: string;
100
+ readonly subjectReference?: string;
101
+ readonly userId?: never;
102
+ };
103
+ export interface AuthorizationAuditScope {
104
+ readonly type: string;
105
+ readonly reference?: string;
106
+ }
107
+ type AuthorizationAuditEventBase<Type extends AuthorizationAuditEventType> = {
108
+ readonly type: Type;
109
+ readonly id?: AuditEventId;
110
+ readonly actor: AuditActor;
111
+ readonly request?: AuditRequest;
112
+ readonly occurredAt: UnixMillis;
113
+ };
114
+ type PermissionDefinitionAuditEvent = (AuthorizationAuditEventBase<"auth.permission_definition.created"> & {
115
+ readonly permissionId: PermissionId;
116
+ readonly scopeType?: string;
117
+ }) | (AuthorizationAuditEventBase<"auth.permission_definition.updated"> & {
118
+ readonly permissionId: PermissionId;
119
+ readonly scopeType?: string;
120
+ readonly changedFields: readonly ("description" | "scopeType")[];
121
+ }) | {
122
+ readonly [Type in "auth.permission_definition.disabled" | "auth.permission_definition.enabled" | "auth.permission_definition.deleted"]: AuthorizationAuditEventBase<Type> & {
123
+ readonly permissionId: PermissionId;
124
+ readonly scopeType?: string;
125
+ };
126
+ }["auth.permission_definition.disabled" | "auth.permission_definition.enabled" | "auth.permission_definition.deleted"];
127
+ type RoleDefinitionAuditEvent = (AuthorizationAuditEventBase<"auth.role_definition.created"> & {
128
+ readonly roleId: RoleId;
129
+ }) | (AuthorizationAuditEventBase<"auth.role_definition.updated"> & {
130
+ readonly roleId: RoleId;
131
+ readonly changedFields: readonly "description"[];
132
+ }) | {
133
+ readonly [Type in "auth.role_definition.disabled" | "auth.role_definition.enabled" | "auth.role_definition.deleted"]: AuthorizationAuditEventBase<Type> & {
134
+ readonly roleId: RoleId;
135
+ };
136
+ }["auth.role_definition.disabled" | "auth.role_definition.enabled" | "auth.role_definition.deleted"];
137
+ type PermissionGrantAuditEvent = (AuthorizationAuditEventBase<"auth.permission.granted"> & {
138
+ readonly subject: AuthorizationAuditSubject;
139
+ readonly permissionId: PermissionId;
140
+ readonly scope?: AuthorizationAuditScope;
141
+ readonly expiresAt?: UnixMillis;
142
+ }) | (AuthorizationAuditEventBase<"auth.permission.revoked"> & {
143
+ readonly subject: AuthorizationAuditSubject;
144
+ readonly permissionId: PermissionId;
145
+ readonly scope?: AuthorizationAuditScope;
146
+ readonly expiresAt?: never;
147
+ });
148
+ type RoleGrantAuditEvent = (AuthorizationAuditEventBase<"auth.role.granted"> & {
149
+ readonly subject: AuthorizationAuditSubject;
150
+ readonly roleId: RoleId;
151
+ readonly scope?: AuthorizationAuditScope;
152
+ readonly expiresAt?: UnixMillis;
153
+ }) | (AuthorizationAuditEventBase<"auth.role.revoked"> & {
154
+ readonly subject: AuthorizationAuditSubject;
155
+ readonly roleId: RoleId;
156
+ readonly scope?: AuthorizationAuditScope;
157
+ readonly expiresAt?: never;
158
+ });
159
+ type RolePermissionAuditEvent = {
160
+ readonly [Type in "auth.role_permission.assigned" | "auth.role_permission.removed"]: AuthorizationAuditEventBase<Type> & {
161
+ readonly roleId: RoleId;
162
+ readonly permissionId: PermissionId;
163
+ readonly scopeType?: string;
164
+ };
165
+ }["auth.role_permission.assigned" | "auth.role_permission.removed"];
166
+ export type AuthorizationAuditEvent = PermissionDefinitionAuditEvent | RoleDefinitionAuditEvent | PermissionGrantAuditEvent | RoleGrantAuditEvent | RolePermissionAuditEvent;
167
+ export interface AssuranceTransitionSummary {
168
+ readonly userId: UserId;
169
+ readonly sessionId: SessionId;
170
+ readonly oldAal: AssuranceLevel;
171
+ readonly newAal: AssuranceLevel;
172
+ readonly amr: readonly AuthMethodReference[];
173
+ readonly method: AuthMethodReference;
174
+ readonly rotatedAt: UnixMillis;
175
+ readonly requirementsEntered: readonly SessionRequirement[];
176
+ readonly requirementsCleared: readonly SessionRequirement[];
177
+ }
178
+ export type AssuranceAuditEventType = "auth.session.assurance_changed" | "auth.session.step_up_completed" | "auth.session.primary_reauthenticated" | "auth.session.recovery_remediation.entered" | "auth.session.recovery_remediation.completed";
179
+ export type AssuranceAuditEvent = {
180
+ readonly [Type in AssuranceAuditEventType]: AssuranceTransitionSummary & {
181
+ readonly type: Type;
182
+ readonly id?: AuditEventId;
183
+ readonly actor: AuditActor;
184
+ readonly request?: AuditRequest;
185
+ readonly occurredAt: UnixMillis;
186
+ };
187
+ }[AssuranceAuditEventType];
188
+ export type AssuranceAuditEventInput = Omit<AssuranceAuditEvent, "type" | "occurredAt"> & {
189
+ readonly occurredAt?: UnixMillis;
190
+ };
191
+ export type AuthAuditEvent = AssuranceAuditEvent | AuthorizationAuditEvent | {
192
+ readonly type: "auth.identity.added";
193
+ readonly id?: AuditEventId;
194
+ readonly actor: AuditActor;
195
+ readonly userId: UserId;
196
+ readonly identityId: IdentityId;
197
+ readonly kind: IdentityKind;
198
+ readonly scope: IdentityScope;
199
+ readonly request?: AuditRequest;
200
+ readonly occurredAt: UnixMillis;
201
+ } | {
202
+ readonly type: "auth.identity.primary_changed";
203
+ readonly id?: AuditEventId;
204
+ readonly actor: AuditActor;
205
+ readonly userId: UserId;
206
+ readonly identityId: IdentityId;
207
+ readonly kind: IdentityKind;
208
+ readonly scope: IdentityScope;
209
+ readonly request?: AuditRequest;
210
+ readonly occurredAt: UnixMillis;
211
+ } | {
212
+ readonly type: "auth.identity.replaced";
213
+ readonly id?: AuditEventId;
214
+ readonly actor: AuditActor;
215
+ readonly userId: UserId;
216
+ readonly identityId: IdentityId;
217
+ readonly replacementIdentityId: IdentityId;
218
+ readonly kind: IdentityKind;
219
+ readonly scope: IdentityScope;
220
+ readonly request?: AuditRequest;
221
+ readonly occurredAt: UnixMillis;
222
+ } | {
223
+ readonly type: "auth.identity.revoked";
224
+ readonly id?: AuditEventId;
225
+ readonly actor: AuditActor;
226
+ readonly userId: UserId;
227
+ readonly identityId: IdentityId;
228
+ readonly kind: IdentityKind;
229
+ readonly scope: IdentityScope;
230
+ readonly reason?: string;
231
+ readonly request?: AuditRequest;
232
+ readonly occurredAt: UnixMillis;
233
+ } | {
59
234
  readonly type: "auth.login.succeeded";
60
235
  readonly id?: AuditEventId;
61
236
  readonly actor: AuditActor;
@@ -327,12 +502,2096 @@ export type AuthAuditEvent = {
327
502
  readonly request?: AuditRequest;
328
503
  readonly occurredAt: UnixMillis;
329
504
  };
505
+ export declare const AuthAuditEventSchema: Schema.Union<readonly [Schema.Struct<{
506
+ readonly id: Schema.optional<Schema.brand<Schema.String, "auth/AuditEventId">>;
507
+ readonly request: Schema.optional<Schema.Struct<{
508
+ readonly ipHash: Schema.optional<Schema.brand<Schema.String, "auth/IpHash">>;
509
+ readonly userAgentHash: Schema.optional<Schema.brand<Schema.String, "auth/UserAgentHash">>;
510
+ }>>;
511
+ readonly occurredAt: Schema.brand<Schema.Number, "auth/UnixMillis">;
512
+ readonly actor: Schema.Union<readonly [Schema.Struct<{
513
+ readonly type: Schema.Literal<"anonymous">;
514
+ }>, Schema.Struct<{
515
+ readonly type: Schema.Literal<"user">;
516
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
517
+ readonly sessionId: Schema.optional<Schema.brand<Schema.String, "auth/SessionId">>;
518
+ }>, Schema.Struct<{
519
+ readonly type: Schema.Literal<"custom">;
520
+ readonly actorType: Schema.String;
521
+ readonly actorReference: Schema.optional<Schema.String>;
522
+ }>]>;
523
+ readonly type: Schema.Literals<readonly ["auth.session.assurance_changed", "auth.session.step_up_completed", "auth.session.primary_reauthenticated", "auth.session.recovery_remediation.entered", "auth.session.recovery_remediation.completed"]>;
524
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
525
+ readonly sessionId: Schema.brand<Schema.String, "auth/SessionId">;
526
+ readonly oldAal: Schema.Literals<readonly ["aal1", "aal2", "aal3"]>;
527
+ readonly newAal: Schema.Literals<readonly ["aal1", "aal2", "aal3"]>;
528
+ readonly amr: Schema.$Array<Schema.String>;
529
+ readonly method: Schema.String;
530
+ readonly rotatedAt: Schema.brand<Schema.Number, "auth/UnixMillis">;
531
+ readonly requirementsEntered: Schema.$Array<Schema.String>;
532
+ readonly requirementsCleared: Schema.$Array<Schema.String>;
533
+ }>, Schema.Struct<{
534
+ readonly id: Schema.optional<Schema.brand<Schema.String, "auth/AuditEventId">>;
535
+ readonly request: Schema.optional<Schema.Struct<{
536
+ readonly ipHash: Schema.optional<Schema.brand<Schema.String, "auth/IpHash">>;
537
+ readonly userAgentHash: Schema.optional<Schema.brand<Schema.String, "auth/UserAgentHash">>;
538
+ }>>;
539
+ readonly occurredAt: Schema.brand<Schema.Number, "auth/UnixMillis">;
540
+ readonly actor: Schema.Union<readonly [Schema.Struct<{
541
+ readonly type: Schema.Literal<"anonymous">;
542
+ }>, Schema.Struct<{
543
+ readonly type: Schema.Literal<"user">;
544
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
545
+ readonly sessionId: Schema.optional<Schema.brand<Schema.String, "auth/SessionId">>;
546
+ }>, Schema.Struct<{
547
+ readonly type: Schema.Literal<"custom">;
548
+ readonly actorType: Schema.String;
549
+ readonly actorReference: Schema.optional<Schema.String>;
550
+ }>]>;
551
+ readonly type: Schema.Literal<"auth.permission_definition.created">;
552
+ readonly permissionId: Schema.brand<Schema.String, "auth/PermissionId">;
553
+ readonly scopeType: Schema.optional<Schema.String>;
554
+ }>, Schema.Struct<{
555
+ readonly id: Schema.optional<Schema.brand<Schema.String, "auth/AuditEventId">>;
556
+ readonly request: Schema.optional<Schema.Struct<{
557
+ readonly ipHash: Schema.optional<Schema.brand<Schema.String, "auth/IpHash">>;
558
+ readonly userAgentHash: Schema.optional<Schema.brand<Schema.String, "auth/UserAgentHash">>;
559
+ }>>;
560
+ readonly occurredAt: Schema.brand<Schema.Number, "auth/UnixMillis">;
561
+ readonly actor: Schema.Union<readonly [Schema.Struct<{
562
+ readonly type: Schema.Literal<"anonymous">;
563
+ }>, Schema.Struct<{
564
+ readonly type: Schema.Literal<"user">;
565
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
566
+ readonly sessionId: Schema.optional<Schema.brand<Schema.String, "auth/SessionId">>;
567
+ }>, Schema.Struct<{
568
+ readonly type: Schema.Literal<"custom">;
569
+ readonly actorType: Schema.String;
570
+ readonly actorReference: Schema.optional<Schema.String>;
571
+ }>]>;
572
+ readonly type: Schema.Literal<"auth.permission_definition.updated">;
573
+ readonly permissionId: Schema.brand<Schema.String, "auth/PermissionId">;
574
+ readonly scopeType: Schema.optional<Schema.String>;
575
+ readonly changedFields: Schema.$Array<Schema.Literals<readonly ["description", "scopeType"]>>;
576
+ }>, Schema.Struct<{
577
+ readonly id: Schema.optional<Schema.brand<Schema.String, "auth/AuditEventId">>;
578
+ readonly request: Schema.optional<Schema.Struct<{
579
+ readonly ipHash: Schema.optional<Schema.brand<Schema.String, "auth/IpHash">>;
580
+ readonly userAgentHash: Schema.optional<Schema.brand<Schema.String, "auth/UserAgentHash">>;
581
+ }>>;
582
+ readonly occurredAt: Schema.brand<Schema.Number, "auth/UnixMillis">;
583
+ readonly actor: Schema.Union<readonly [Schema.Struct<{
584
+ readonly type: Schema.Literal<"anonymous">;
585
+ }>, Schema.Struct<{
586
+ readonly type: Schema.Literal<"user">;
587
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
588
+ readonly sessionId: Schema.optional<Schema.brand<Schema.String, "auth/SessionId">>;
589
+ }>, Schema.Struct<{
590
+ readonly type: Schema.Literal<"custom">;
591
+ readonly actorType: Schema.String;
592
+ readonly actorReference: Schema.optional<Schema.String>;
593
+ }>]>;
594
+ readonly type: Schema.Literals<readonly ["auth.permission_definition.disabled", "auth.permission_definition.enabled", "auth.permission_definition.deleted"]>;
595
+ readonly permissionId: Schema.brand<Schema.String, "auth/PermissionId">;
596
+ readonly scopeType: Schema.optional<Schema.String>;
597
+ }>, Schema.Struct<{
598
+ readonly id: Schema.optional<Schema.brand<Schema.String, "auth/AuditEventId">>;
599
+ readonly request: Schema.optional<Schema.Struct<{
600
+ readonly ipHash: Schema.optional<Schema.brand<Schema.String, "auth/IpHash">>;
601
+ readonly userAgentHash: Schema.optional<Schema.brand<Schema.String, "auth/UserAgentHash">>;
602
+ }>>;
603
+ readonly occurredAt: Schema.brand<Schema.Number, "auth/UnixMillis">;
604
+ readonly actor: Schema.Union<readonly [Schema.Struct<{
605
+ readonly type: Schema.Literal<"anonymous">;
606
+ }>, Schema.Struct<{
607
+ readonly type: Schema.Literal<"user">;
608
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
609
+ readonly sessionId: Schema.optional<Schema.brand<Schema.String, "auth/SessionId">>;
610
+ }>, Schema.Struct<{
611
+ readonly type: Schema.Literal<"custom">;
612
+ readonly actorType: Schema.String;
613
+ readonly actorReference: Schema.optional<Schema.String>;
614
+ }>]>;
615
+ readonly type: Schema.Literal<"auth.role_definition.created">;
616
+ readonly roleId: Schema.brand<Schema.String, "auth/RoleId">;
617
+ }>, Schema.Struct<{
618
+ readonly id: Schema.optional<Schema.brand<Schema.String, "auth/AuditEventId">>;
619
+ readonly request: Schema.optional<Schema.Struct<{
620
+ readonly ipHash: Schema.optional<Schema.brand<Schema.String, "auth/IpHash">>;
621
+ readonly userAgentHash: Schema.optional<Schema.brand<Schema.String, "auth/UserAgentHash">>;
622
+ }>>;
623
+ readonly occurredAt: Schema.brand<Schema.Number, "auth/UnixMillis">;
624
+ readonly actor: Schema.Union<readonly [Schema.Struct<{
625
+ readonly type: Schema.Literal<"anonymous">;
626
+ }>, Schema.Struct<{
627
+ readonly type: Schema.Literal<"user">;
628
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
629
+ readonly sessionId: Schema.optional<Schema.brand<Schema.String, "auth/SessionId">>;
630
+ }>, Schema.Struct<{
631
+ readonly type: Schema.Literal<"custom">;
632
+ readonly actorType: Schema.String;
633
+ readonly actorReference: Schema.optional<Schema.String>;
634
+ }>]>;
635
+ readonly type: Schema.Literal<"auth.role_definition.updated">;
636
+ readonly roleId: Schema.brand<Schema.String, "auth/RoleId">;
637
+ readonly changedFields: Schema.$Array<Schema.Literal<"description">>;
638
+ }>, Schema.Struct<{
639
+ readonly id: Schema.optional<Schema.brand<Schema.String, "auth/AuditEventId">>;
640
+ readonly request: Schema.optional<Schema.Struct<{
641
+ readonly ipHash: Schema.optional<Schema.brand<Schema.String, "auth/IpHash">>;
642
+ readonly userAgentHash: Schema.optional<Schema.brand<Schema.String, "auth/UserAgentHash">>;
643
+ }>>;
644
+ readonly occurredAt: Schema.brand<Schema.Number, "auth/UnixMillis">;
645
+ readonly actor: Schema.Union<readonly [Schema.Struct<{
646
+ readonly type: Schema.Literal<"anonymous">;
647
+ }>, Schema.Struct<{
648
+ readonly type: Schema.Literal<"user">;
649
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
650
+ readonly sessionId: Schema.optional<Schema.brand<Schema.String, "auth/SessionId">>;
651
+ }>, Schema.Struct<{
652
+ readonly type: Schema.Literal<"custom">;
653
+ readonly actorType: Schema.String;
654
+ readonly actorReference: Schema.optional<Schema.String>;
655
+ }>]>;
656
+ readonly type: Schema.Literals<readonly ["auth.role_definition.disabled", "auth.role_definition.enabled", "auth.role_definition.deleted"]>;
657
+ readonly roleId: Schema.brand<Schema.String, "auth/RoleId">;
658
+ }>, Schema.Struct<{
659
+ readonly id: Schema.optional<Schema.brand<Schema.String, "auth/AuditEventId">>;
660
+ readonly request: Schema.optional<Schema.Struct<{
661
+ readonly ipHash: Schema.optional<Schema.brand<Schema.String, "auth/IpHash">>;
662
+ readonly userAgentHash: Schema.optional<Schema.brand<Schema.String, "auth/UserAgentHash">>;
663
+ }>>;
664
+ readonly occurredAt: Schema.brand<Schema.Number, "auth/UnixMillis">;
665
+ readonly actor: Schema.Union<readonly [Schema.Struct<{
666
+ readonly type: Schema.Literal<"anonymous">;
667
+ }>, Schema.Struct<{
668
+ readonly type: Schema.Literal<"user">;
669
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
670
+ readonly sessionId: Schema.optional<Schema.brand<Schema.String, "auth/SessionId">>;
671
+ }>, Schema.Struct<{
672
+ readonly type: Schema.Literal<"custom">;
673
+ readonly actorType: Schema.String;
674
+ readonly actorReference: Schema.optional<Schema.String>;
675
+ }>]>;
676
+ readonly type: Schema.Literal<"auth.permission.granted">;
677
+ readonly subject: Schema.Union<readonly [Schema.Struct<{
678
+ readonly type: Schema.Literal<"user">;
679
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
680
+ }>, Schema.Struct<{
681
+ readonly type: Schema.Literal<"custom">;
682
+ readonly subjectType: Schema.String;
683
+ readonly subjectReference: Schema.optional<Schema.String>;
684
+ }>]>;
685
+ readonly permissionId: Schema.brand<Schema.String, "auth/PermissionId">;
686
+ readonly scope: Schema.optional<Schema.Struct<{
687
+ readonly type: Schema.String;
688
+ readonly reference: Schema.optional<Schema.String>;
689
+ }>>;
690
+ readonly expiresAt: Schema.optional<Schema.brand<Schema.Number, "auth/UnixMillis">>;
691
+ }>, Schema.Struct<{
692
+ readonly id: Schema.optional<Schema.brand<Schema.String, "auth/AuditEventId">>;
693
+ readonly request: Schema.optional<Schema.Struct<{
694
+ readonly ipHash: Schema.optional<Schema.brand<Schema.String, "auth/IpHash">>;
695
+ readonly userAgentHash: Schema.optional<Schema.brand<Schema.String, "auth/UserAgentHash">>;
696
+ }>>;
697
+ readonly occurredAt: Schema.brand<Schema.Number, "auth/UnixMillis">;
698
+ readonly actor: Schema.Union<readonly [Schema.Struct<{
699
+ readonly type: Schema.Literal<"anonymous">;
700
+ }>, Schema.Struct<{
701
+ readonly type: Schema.Literal<"user">;
702
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
703
+ readonly sessionId: Schema.optional<Schema.brand<Schema.String, "auth/SessionId">>;
704
+ }>, Schema.Struct<{
705
+ readonly type: Schema.Literal<"custom">;
706
+ readonly actorType: Schema.String;
707
+ readonly actorReference: Schema.optional<Schema.String>;
708
+ }>]>;
709
+ readonly type: Schema.Literal<"auth.permission.revoked">;
710
+ readonly subject: Schema.Union<readonly [Schema.Struct<{
711
+ readonly type: Schema.Literal<"user">;
712
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
713
+ }>, Schema.Struct<{
714
+ readonly type: Schema.Literal<"custom">;
715
+ readonly subjectType: Schema.String;
716
+ readonly subjectReference: Schema.optional<Schema.String>;
717
+ }>]>;
718
+ readonly permissionId: Schema.brand<Schema.String, "auth/PermissionId">;
719
+ readonly scope: Schema.optional<Schema.Struct<{
720
+ readonly type: Schema.String;
721
+ readonly reference: Schema.optional<Schema.String>;
722
+ }>>;
723
+ }>, Schema.Struct<{
724
+ readonly id: Schema.optional<Schema.brand<Schema.String, "auth/AuditEventId">>;
725
+ readonly request: Schema.optional<Schema.Struct<{
726
+ readonly ipHash: Schema.optional<Schema.brand<Schema.String, "auth/IpHash">>;
727
+ readonly userAgentHash: Schema.optional<Schema.brand<Schema.String, "auth/UserAgentHash">>;
728
+ }>>;
729
+ readonly occurredAt: Schema.brand<Schema.Number, "auth/UnixMillis">;
730
+ readonly actor: Schema.Union<readonly [Schema.Struct<{
731
+ readonly type: Schema.Literal<"anonymous">;
732
+ }>, Schema.Struct<{
733
+ readonly type: Schema.Literal<"user">;
734
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
735
+ readonly sessionId: Schema.optional<Schema.brand<Schema.String, "auth/SessionId">>;
736
+ }>, Schema.Struct<{
737
+ readonly type: Schema.Literal<"custom">;
738
+ readonly actorType: Schema.String;
739
+ readonly actorReference: Schema.optional<Schema.String>;
740
+ }>]>;
741
+ readonly type: Schema.Literal<"auth.role.granted">;
742
+ readonly subject: Schema.Union<readonly [Schema.Struct<{
743
+ readonly type: Schema.Literal<"user">;
744
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
745
+ }>, Schema.Struct<{
746
+ readonly type: Schema.Literal<"custom">;
747
+ readonly subjectType: Schema.String;
748
+ readonly subjectReference: Schema.optional<Schema.String>;
749
+ }>]>;
750
+ readonly roleId: Schema.brand<Schema.String, "auth/RoleId">;
751
+ readonly scope: Schema.optional<Schema.Struct<{
752
+ readonly type: Schema.String;
753
+ readonly reference: Schema.optional<Schema.String>;
754
+ }>>;
755
+ readonly expiresAt: Schema.optional<Schema.brand<Schema.Number, "auth/UnixMillis">>;
756
+ }>, Schema.Struct<{
757
+ readonly id: Schema.optional<Schema.brand<Schema.String, "auth/AuditEventId">>;
758
+ readonly request: Schema.optional<Schema.Struct<{
759
+ readonly ipHash: Schema.optional<Schema.brand<Schema.String, "auth/IpHash">>;
760
+ readonly userAgentHash: Schema.optional<Schema.brand<Schema.String, "auth/UserAgentHash">>;
761
+ }>>;
762
+ readonly occurredAt: Schema.brand<Schema.Number, "auth/UnixMillis">;
763
+ readonly actor: Schema.Union<readonly [Schema.Struct<{
764
+ readonly type: Schema.Literal<"anonymous">;
765
+ }>, Schema.Struct<{
766
+ readonly type: Schema.Literal<"user">;
767
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
768
+ readonly sessionId: Schema.optional<Schema.brand<Schema.String, "auth/SessionId">>;
769
+ }>, Schema.Struct<{
770
+ readonly type: Schema.Literal<"custom">;
771
+ readonly actorType: Schema.String;
772
+ readonly actorReference: Schema.optional<Schema.String>;
773
+ }>]>;
774
+ readonly type: Schema.Literal<"auth.role.revoked">;
775
+ readonly subject: Schema.Union<readonly [Schema.Struct<{
776
+ readonly type: Schema.Literal<"user">;
777
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
778
+ }>, Schema.Struct<{
779
+ readonly type: Schema.Literal<"custom">;
780
+ readonly subjectType: Schema.String;
781
+ readonly subjectReference: Schema.optional<Schema.String>;
782
+ }>]>;
783
+ readonly roleId: Schema.brand<Schema.String, "auth/RoleId">;
784
+ readonly scope: Schema.optional<Schema.Struct<{
785
+ readonly type: Schema.String;
786
+ readonly reference: Schema.optional<Schema.String>;
787
+ }>>;
788
+ }>, Schema.Struct<{
789
+ readonly id: Schema.optional<Schema.brand<Schema.String, "auth/AuditEventId">>;
790
+ readonly request: Schema.optional<Schema.Struct<{
791
+ readonly ipHash: Schema.optional<Schema.brand<Schema.String, "auth/IpHash">>;
792
+ readonly userAgentHash: Schema.optional<Schema.brand<Schema.String, "auth/UserAgentHash">>;
793
+ }>>;
794
+ readonly occurredAt: Schema.brand<Schema.Number, "auth/UnixMillis">;
795
+ readonly actor: Schema.Union<readonly [Schema.Struct<{
796
+ readonly type: Schema.Literal<"anonymous">;
797
+ }>, Schema.Struct<{
798
+ readonly type: Schema.Literal<"user">;
799
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
800
+ readonly sessionId: Schema.optional<Schema.brand<Schema.String, "auth/SessionId">>;
801
+ }>, Schema.Struct<{
802
+ readonly type: Schema.Literal<"custom">;
803
+ readonly actorType: Schema.String;
804
+ readonly actorReference: Schema.optional<Schema.String>;
805
+ }>]>;
806
+ readonly type: Schema.Literals<readonly ["auth.role_permission.assigned", "auth.role_permission.removed"]>;
807
+ readonly roleId: Schema.brand<Schema.String, "auth/RoleId">;
808
+ readonly permissionId: Schema.brand<Schema.String, "auth/PermissionId">;
809
+ readonly scopeType: Schema.optional<Schema.String>;
810
+ }>, Schema.Struct<{
811
+ readonly id: Schema.optional<Schema.brand<Schema.String, "auth/AuditEventId">>;
812
+ readonly request: Schema.optional<Schema.Struct<{
813
+ readonly ipHash: Schema.optional<Schema.brand<Schema.String, "auth/IpHash">>;
814
+ readonly userAgentHash: Schema.optional<Schema.brand<Schema.String, "auth/UserAgentHash">>;
815
+ }>>;
816
+ readonly occurredAt: Schema.brand<Schema.Number, "auth/UnixMillis">;
817
+ readonly actor: Schema.Union<readonly [Schema.Struct<{
818
+ readonly type: Schema.Literal<"anonymous">;
819
+ }>, Schema.Struct<{
820
+ readonly type: Schema.Literal<"user">;
821
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
822
+ readonly sessionId: Schema.optional<Schema.brand<Schema.String, "auth/SessionId">>;
823
+ }>, Schema.Struct<{
824
+ readonly type: Schema.Literal<"custom">;
825
+ readonly actorType: Schema.String;
826
+ readonly actorReference: Schema.optional<Schema.String>;
827
+ }>]>;
828
+ readonly type: Schema.Literals<readonly ["auth.identity.added", "auth.identity.primary_changed"]>;
829
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
830
+ readonly identityId: Schema.brand<Schema.String, "auth/IdentityId">;
831
+ readonly kind: Schema.String;
832
+ readonly scope: Schema.Union<readonly [Schema.Struct<{
833
+ readonly type: Schema.Literal<"global">;
834
+ }>, Schema.Struct<{
835
+ readonly type: Schema.Literal<"tenant">;
836
+ readonly tenantId: Schema.String;
837
+ }>]>;
838
+ }>, Schema.Struct<{
839
+ readonly id: Schema.optional<Schema.brand<Schema.String, "auth/AuditEventId">>;
840
+ readonly request: Schema.optional<Schema.Struct<{
841
+ readonly ipHash: Schema.optional<Schema.brand<Schema.String, "auth/IpHash">>;
842
+ readonly userAgentHash: Schema.optional<Schema.brand<Schema.String, "auth/UserAgentHash">>;
843
+ }>>;
844
+ readonly occurredAt: Schema.brand<Schema.Number, "auth/UnixMillis">;
845
+ readonly actor: Schema.Union<readonly [Schema.Struct<{
846
+ readonly type: Schema.Literal<"anonymous">;
847
+ }>, Schema.Struct<{
848
+ readonly type: Schema.Literal<"user">;
849
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
850
+ readonly sessionId: Schema.optional<Schema.brand<Schema.String, "auth/SessionId">>;
851
+ }>, Schema.Struct<{
852
+ readonly type: Schema.Literal<"custom">;
853
+ readonly actorType: Schema.String;
854
+ readonly actorReference: Schema.optional<Schema.String>;
855
+ }>]>;
856
+ readonly type: Schema.Literal<"auth.identity.replaced">;
857
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
858
+ readonly identityId: Schema.brand<Schema.String, "auth/IdentityId">;
859
+ readonly replacementIdentityId: Schema.brand<Schema.String, "auth/IdentityId">;
860
+ readonly kind: Schema.String;
861
+ readonly scope: Schema.Union<readonly [Schema.Struct<{
862
+ readonly type: Schema.Literal<"global">;
863
+ }>, Schema.Struct<{
864
+ readonly type: Schema.Literal<"tenant">;
865
+ readonly tenantId: Schema.String;
866
+ }>]>;
867
+ }>, Schema.Struct<{
868
+ readonly id: Schema.optional<Schema.brand<Schema.String, "auth/AuditEventId">>;
869
+ readonly request: Schema.optional<Schema.Struct<{
870
+ readonly ipHash: Schema.optional<Schema.brand<Schema.String, "auth/IpHash">>;
871
+ readonly userAgentHash: Schema.optional<Schema.brand<Schema.String, "auth/UserAgentHash">>;
872
+ }>>;
873
+ readonly occurredAt: Schema.brand<Schema.Number, "auth/UnixMillis">;
874
+ readonly actor: Schema.Union<readonly [Schema.Struct<{
875
+ readonly type: Schema.Literal<"anonymous">;
876
+ }>, Schema.Struct<{
877
+ readonly type: Schema.Literal<"user">;
878
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
879
+ readonly sessionId: Schema.optional<Schema.brand<Schema.String, "auth/SessionId">>;
880
+ }>, Schema.Struct<{
881
+ readonly type: Schema.Literal<"custom">;
882
+ readonly actorType: Schema.String;
883
+ readonly actorReference: Schema.optional<Schema.String>;
884
+ }>]>;
885
+ readonly type: Schema.Literal<"auth.identity.revoked">;
886
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
887
+ readonly identityId: Schema.brand<Schema.String, "auth/IdentityId">;
888
+ readonly kind: Schema.String;
889
+ readonly scope: Schema.Union<readonly [Schema.Struct<{
890
+ readonly type: Schema.Literal<"global">;
891
+ }>, Schema.Struct<{
892
+ readonly type: Schema.Literal<"tenant">;
893
+ readonly tenantId: Schema.String;
894
+ }>]>;
895
+ readonly reason: Schema.optional<Schema.String>;
896
+ }>, Schema.Struct<{
897
+ readonly id: Schema.optional<Schema.brand<Schema.String, "auth/AuditEventId">>;
898
+ readonly request: Schema.optional<Schema.Struct<{
899
+ readonly ipHash: Schema.optional<Schema.brand<Schema.String, "auth/IpHash">>;
900
+ readonly userAgentHash: Schema.optional<Schema.brand<Schema.String, "auth/UserAgentHash">>;
901
+ }>>;
902
+ readonly occurredAt: Schema.brand<Schema.Number, "auth/UnixMillis">;
903
+ readonly actor: Schema.Union<readonly [Schema.Struct<{
904
+ readonly type: Schema.Literal<"anonymous">;
905
+ }>, Schema.Struct<{
906
+ readonly type: Schema.Literal<"user">;
907
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
908
+ readonly sessionId: Schema.optional<Schema.brand<Schema.String, "auth/SessionId">>;
909
+ }>, Schema.Struct<{
910
+ readonly type: Schema.Literal<"custom">;
911
+ readonly actorType: Schema.String;
912
+ readonly actorReference: Schema.optional<Schema.String>;
913
+ }>]>;
914
+ readonly type: Schema.Literal<"auth.login.succeeded">;
915
+ readonly method: Schema.String;
916
+ }>, Schema.Struct<{
917
+ readonly id: Schema.optional<Schema.brand<Schema.String, "auth/AuditEventId">>;
918
+ readonly request: Schema.optional<Schema.Struct<{
919
+ readonly ipHash: Schema.optional<Schema.brand<Schema.String, "auth/IpHash">>;
920
+ readonly userAgentHash: Schema.optional<Schema.brand<Schema.String, "auth/UserAgentHash">>;
921
+ }>>;
922
+ readonly occurredAt: Schema.brand<Schema.Number, "auth/UnixMillis">;
923
+ readonly type: Schema.Literal<"auth.login.failed">;
924
+ readonly subject: Schema.Union<readonly [Schema.Struct<{
925
+ readonly type: Schema.Literal<"anonymous">;
926
+ }>, Schema.Struct<{
927
+ readonly type: Schema.Literal<"email">;
928
+ readonly emailHash: Schema.brand<Schema.String, "auth/EmailHash">;
929
+ }>, Schema.Struct<{
930
+ readonly type: Schema.Literal<"user">;
931
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
932
+ }>]>;
933
+ readonly method: Schema.String;
934
+ readonly reason: Schema.String;
935
+ }>, Schema.Struct<{
936
+ readonly id: Schema.optional<Schema.brand<Schema.String, "auth/AuditEventId">>;
937
+ readonly request: Schema.optional<Schema.Struct<{
938
+ readonly ipHash: Schema.optional<Schema.brand<Schema.String, "auth/IpHash">>;
939
+ readonly userAgentHash: Schema.optional<Schema.brand<Schema.String, "auth/UserAgentHash">>;
940
+ }>>;
941
+ readonly occurredAt: Schema.brand<Schema.Number, "auth/UnixMillis">;
942
+ readonly actor: Schema.Union<readonly [Schema.Struct<{
943
+ readonly type: Schema.Literal<"anonymous">;
944
+ }>, Schema.Struct<{
945
+ readonly type: Schema.Literal<"user">;
946
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
947
+ readonly sessionId: Schema.optional<Schema.brand<Schema.String, "auth/SessionId">>;
948
+ }>, Schema.Struct<{
949
+ readonly type: Schema.Literal<"custom">;
950
+ readonly actorType: Schema.String;
951
+ readonly actorReference: Schema.optional<Schema.String>;
952
+ }>]>;
953
+ readonly type: Schema.Literal<"auth.session.revoked">;
954
+ readonly sessionId: Schema.brand<Schema.String, "auth/SessionId">;
955
+ readonly reason: Schema.String;
956
+ }>, Schema.Struct<{
957
+ readonly id: Schema.optional<Schema.brand<Schema.String, "auth/AuditEventId">>;
958
+ readonly request: Schema.optional<Schema.Struct<{
959
+ readonly ipHash: Schema.optional<Schema.brand<Schema.String, "auth/IpHash">>;
960
+ readonly userAgentHash: Schema.optional<Schema.brand<Schema.String, "auth/UserAgentHash">>;
961
+ }>>;
962
+ readonly occurredAt: Schema.brand<Schema.Number, "auth/UnixMillis">;
963
+ readonly actor: Schema.Union<readonly [Schema.Struct<{
964
+ readonly type: Schema.Literal<"anonymous">;
965
+ }>, Schema.Struct<{
966
+ readonly type: Schema.Literal<"user">;
967
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
968
+ readonly sessionId: Schema.optional<Schema.brand<Schema.String, "auth/SessionId">>;
969
+ }>, Schema.Struct<{
970
+ readonly type: Schema.Literal<"custom">;
971
+ readonly actorType: Schema.String;
972
+ readonly actorReference: Schema.optional<Schema.String>;
973
+ }>]>;
974
+ readonly type: Schema.Literal<"auth.risk.assessed">;
975
+ readonly assessment: Schema.Struct<{
976
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
977
+ readonly method: Schema.String;
978
+ readonly amr: Schema.$Array<Schema.String>;
979
+ readonly aal: Schema.Literals<readonly ["aal1", "aal2", "aal3"]>;
980
+ readonly device: Schema.Struct<{
981
+ readonly status: Schema.Literals<readonly ["known", "new", "unknown"]>;
982
+ }>;
983
+ readonly risk: Schema.Struct<{
984
+ readonly level: Schema.Literals<readonly ["unknown", "low", "medium", "high", "critical"]>;
985
+ readonly signals: Schema.$Array<Schema.Struct<{
986
+ readonly type: Schema.String;
987
+ readonly level: Schema.optional<Schema.Literals<readonly ["unknown", "low", "medium", "high", "critical"]>>;
988
+ }>>;
989
+ }>;
990
+ readonly metadata: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
991
+ }>;
992
+ }>, Schema.Struct<{
993
+ readonly id: Schema.optional<Schema.brand<Schema.String, "auth/AuditEventId">>;
994
+ readonly request: Schema.optional<Schema.Struct<{
995
+ readonly ipHash: Schema.optional<Schema.brand<Schema.String, "auth/IpHash">>;
996
+ readonly userAgentHash: Schema.optional<Schema.brand<Schema.String, "auth/UserAgentHash">>;
997
+ }>>;
998
+ readonly occurredAt: Schema.brand<Schema.Number, "auth/UnixMillis">;
999
+ readonly actor: Schema.Union<readonly [Schema.Struct<{
1000
+ readonly type: Schema.Literal<"anonymous">;
1001
+ }>, Schema.Struct<{
1002
+ readonly type: Schema.Literal<"user">;
1003
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
1004
+ readonly sessionId: Schema.optional<Schema.brand<Schema.String, "auth/SessionId">>;
1005
+ }>, Schema.Struct<{
1006
+ readonly type: Schema.Literal<"custom">;
1007
+ readonly actorType: Schema.String;
1008
+ readonly actorReference: Schema.optional<Schema.String>;
1009
+ }>]>;
1010
+ readonly type: Schema.Literal<"auth.policy.denied">;
1011
+ readonly policyId: Schema.brand<Schema.String, "auth/PolicyId">;
1012
+ readonly reason: Schema.String;
1013
+ }>, Schema.Struct<{
1014
+ readonly id: Schema.optional<Schema.brand<Schema.String, "auth/AuditEventId">>;
1015
+ readonly request: Schema.optional<Schema.Struct<{
1016
+ readonly ipHash: Schema.optional<Schema.brand<Schema.String, "auth/IpHash">>;
1017
+ readonly userAgentHash: Schema.optional<Schema.brand<Schema.String, "auth/UserAgentHash">>;
1018
+ }>>;
1019
+ readonly occurredAt: Schema.brand<Schema.Number, "auth/UnixMillis">;
1020
+ readonly actor: Schema.Union<readonly [Schema.Struct<{
1021
+ readonly type: Schema.Literal<"anonymous">;
1022
+ }>, Schema.Struct<{
1023
+ readonly type: Schema.Literal<"user">;
1024
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
1025
+ readonly sessionId: Schema.optional<Schema.brand<Schema.String, "auth/SessionId">>;
1026
+ }>, Schema.Struct<{
1027
+ readonly type: Schema.Literal<"custom">;
1028
+ readonly actorType: Schema.String;
1029
+ readonly actorReference: Schema.optional<Schema.String>;
1030
+ }>]>;
1031
+ readonly type: Schema.Literals<readonly ["auth.oauth.account.linked", "auth.oauth.account.unlinked"]>;
1032
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
1033
+ readonly accountId: Schema.brand<Schema.String, "auth/OAuthAccountId">;
1034
+ readonly providerId: Schema.brand<Schema.String, "auth/OAuthProviderId">;
1035
+ readonly providerAccountId: Schema.String;
1036
+ readonly reason: Schema.String;
1037
+ }>, Schema.Struct<{
1038
+ readonly id: Schema.optional<Schema.brand<Schema.String, "auth/AuditEventId">>;
1039
+ readonly request: Schema.optional<Schema.Struct<{
1040
+ readonly ipHash: Schema.optional<Schema.brand<Schema.String, "auth/IpHash">>;
1041
+ readonly userAgentHash: Schema.optional<Schema.brand<Schema.String, "auth/UserAgentHash">>;
1042
+ }>>;
1043
+ readonly occurredAt: Schema.brand<Schema.Number, "auth/UnixMillis">;
1044
+ readonly actor: Schema.Union<readonly [Schema.Struct<{
1045
+ readonly type: Schema.Literal<"anonymous">;
1046
+ }>, Schema.Struct<{
1047
+ readonly type: Schema.Literal<"user">;
1048
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
1049
+ readonly sessionId: Schema.optional<Schema.brand<Schema.String, "auth/SessionId">>;
1050
+ }>, Schema.Struct<{
1051
+ readonly type: Schema.Literal<"custom">;
1052
+ readonly actorType: Schema.String;
1053
+ readonly actorReference: Schema.optional<Schema.String>;
1054
+ }>]>;
1055
+ readonly type: Schema.Literals<readonly ["auth.oauth.link_confirmation.started", "auth.oauth.link_confirmation.confirmed"]>;
1056
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
1057
+ readonly challengeId: Schema.brand<Schema.String, "auth/ChallengeId">;
1058
+ readonly providerId: Schema.brand<Schema.String, "auth/OAuthProviderId">;
1059
+ readonly providerAccountId: Schema.String;
1060
+ readonly reason: Schema.String;
1061
+ }>, Schema.Struct<{
1062
+ readonly id: Schema.optional<Schema.brand<Schema.String, "auth/AuditEventId">>;
1063
+ readonly request: Schema.optional<Schema.Struct<{
1064
+ readonly ipHash: Schema.optional<Schema.brand<Schema.String, "auth/IpHash">>;
1065
+ readonly userAgentHash: Schema.optional<Schema.brand<Schema.String, "auth/UserAgentHash">>;
1066
+ }>>;
1067
+ readonly occurredAt: Schema.brand<Schema.Number, "auth/UnixMillis">;
1068
+ readonly actor: Schema.Union<readonly [Schema.Struct<{
1069
+ readonly type: Schema.Literal<"anonymous">;
1070
+ }>, Schema.Struct<{
1071
+ readonly type: Schema.Literal<"user">;
1072
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
1073
+ readonly sessionId: Schema.optional<Schema.brand<Schema.String, "auth/SessionId">>;
1074
+ }>, Schema.Struct<{
1075
+ readonly type: Schema.Literal<"custom">;
1076
+ readonly actorType: Schema.String;
1077
+ readonly actorReference: Schema.optional<Schema.String>;
1078
+ }>]>;
1079
+ readonly type: Schema.Literal<"auth.oauth.provider_token.refreshed">;
1080
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
1081
+ readonly accountId: Schema.brand<Schema.String, "auth/OAuthAccountId">;
1082
+ readonly providerId: Schema.brand<Schema.String, "auth/OAuthProviderId">;
1083
+ readonly providerAccountId: Schema.String;
1084
+ }>, Schema.Struct<{
1085
+ readonly id: Schema.optional<Schema.brand<Schema.String, "auth/AuditEventId">>;
1086
+ readonly request: Schema.optional<Schema.Struct<{
1087
+ readonly ipHash: Schema.optional<Schema.brand<Schema.String, "auth/IpHash">>;
1088
+ readonly userAgentHash: Schema.optional<Schema.brand<Schema.String, "auth/UserAgentHash">>;
1089
+ }>>;
1090
+ readonly occurredAt: Schema.brand<Schema.Number, "auth/UnixMillis">;
1091
+ readonly actor: Schema.Union<readonly [Schema.Struct<{
1092
+ readonly type: Schema.Literal<"anonymous">;
1093
+ }>, Schema.Struct<{
1094
+ readonly type: Schema.Literal<"user">;
1095
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
1096
+ readonly sessionId: Schema.optional<Schema.brand<Schema.String, "auth/SessionId">>;
1097
+ }>, Schema.Struct<{
1098
+ readonly type: Schema.Literal<"custom">;
1099
+ readonly actorType: Schema.String;
1100
+ readonly actorReference: Schema.optional<Schema.String>;
1101
+ }>]>;
1102
+ readonly type: Schema.Literal<"auth.oauth.provider_token.revoked">;
1103
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
1104
+ readonly accountId: Schema.brand<Schema.String, "auth/OAuthAccountId">;
1105
+ readonly providerId: Schema.brand<Schema.String, "auth/OAuthProviderId">;
1106
+ readonly providerAccountId: Schema.String;
1107
+ readonly reason: Schema.String;
1108
+ }>, Schema.Struct<{
1109
+ readonly id: Schema.optional<Schema.brand<Schema.String, "auth/AuditEventId">>;
1110
+ readonly request: Schema.optional<Schema.Struct<{
1111
+ readonly ipHash: Schema.optional<Schema.brand<Schema.String, "auth/IpHash">>;
1112
+ readonly userAgentHash: Schema.optional<Schema.brand<Schema.String, "auth/UserAgentHash">>;
1113
+ }>>;
1114
+ readonly occurredAt: Schema.brand<Schema.Number, "auth/UnixMillis">;
1115
+ readonly actor: Schema.Union<readonly [Schema.Struct<{
1116
+ readonly type: Schema.Literal<"anonymous">;
1117
+ }>, Schema.Struct<{
1118
+ readonly type: Schema.Literal<"user">;
1119
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
1120
+ readonly sessionId: Schema.optional<Schema.brand<Schema.String, "auth/SessionId">>;
1121
+ }>, Schema.Struct<{
1122
+ readonly type: Schema.Literal<"custom">;
1123
+ readonly actorType: Schema.String;
1124
+ readonly actorReference: Schema.optional<Schema.String>;
1125
+ }>]>;
1126
+ readonly type: Schema.Literal<"auth.passkey.credential.revoked">;
1127
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
1128
+ readonly credentialId: Schema.brand<Schema.String, "auth/PasskeyCredentialId">;
1129
+ readonly reason: Schema.String;
1130
+ }>, Schema.Struct<{
1131
+ readonly id: Schema.optional<Schema.brand<Schema.String, "auth/AuditEventId">>;
1132
+ readonly request: Schema.optional<Schema.Struct<{
1133
+ readonly ipHash: Schema.optional<Schema.brand<Schema.String, "auth/IpHash">>;
1134
+ readonly userAgentHash: Schema.optional<Schema.brand<Schema.String, "auth/UserAgentHash">>;
1135
+ }>>;
1136
+ readonly occurredAt: Schema.brand<Schema.Number, "auth/UnixMillis">;
1137
+ readonly actor: Schema.Union<readonly [Schema.Struct<{
1138
+ readonly type: Schema.Literal<"anonymous">;
1139
+ }>, Schema.Struct<{
1140
+ readonly type: Schema.Literal<"user">;
1141
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
1142
+ readonly sessionId: Schema.optional<Schema.brand<Schema.String, "auth/SessionId">>;
1143
+ }>, Schema.Struct<{
1144
+ readonly type: Schema.Literal<"custom">;
1145
+ readonly actorType: Schema.String;
1146
+ readonly actorReference: Schema.optional<Schema.String>;
1147
+ }>]>;
1148
+ readonly type: Schema.Literals<readonly ["auth.totp.enrollment.started", "auth.totp.factor.confirmed", "auth.totp.factor.verified"]>;
1149
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
1150
+ readonly factorId: Schema.brand<Schema.String, "auth/CredentialId">;
1151
+ }>, Schema.Struct<{
1152
+ readonly id: Schema.optional<Schema.brand<Schema.String, "auth/AuditEventId">>;
1153
+ readonly request: Schema.optional<Schema.Struct<{
1154
+ readonly ipHash: Schema.optional<Schema.brand<Schema.String, "auth/IpHash">>;
1155
+ readonly userAgentHash: Schema.optional<Schema.brand<Schema.String, "auth/UserAgentHash">>;
1156
+ }>>;
1157
+ readonly occurredAt: Schema.brand<Schema.Number, "auth/UnixMillis">;
1158
+ readonly actor: Schema.Union<readonly [Schema.Struct<{
1159
+ readonly type: Schema.Literal<"anonymous">;
1160
+ }>, Schema.Struct<{
1161
+ readonly type: Schema.Literal<"user">;
1162
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
1163
+ readonly sessionId: Schema.optional<Schema.brand<Schema.String, "auth/SessionId">>;
1164
+ }>, Schema.Struct<{
1165
+ readonly type: Schema.Literal<"custom">;
1166
+ readonly actorType: Schema.String;
1167
+ readonly actorReference: Schema.optional<Schema.String>;
1168
+ }>]>;
1169
+ readonly type: Schema.Literal<"auth.totp.factor.revoked">;
1170
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
1171
+ readonly factorId: Schema.brand<Schema.String, "auth/CredentialId">;
1172
+ readonly reason: Schema.String;
1173
+ }>, Schema.Struct<{
1174
+ readonly id: Schema.optional<Schema.brand<Schema.String, "auth/AuditEventId">>;
1175
+ readonly request: Schema.optional<Schema.Struct<{
1176
+ readonly ipHash: Schema.optional<Schema.brand<Schema.String, "auth/IpHash">>;
1177
+ readonly userAgentHash: Schema.optional<Schema.brand<Schema.String, "auth/UserAgentHash">>;
1178
+ }>>;
1179
+ readonly occurredAt: Schema.brand<Schema.Number, "auth/UnixMillis">;
1180
+ readonly actor: Schema.Union<readonly [Schema.Struct<{
1181
+ readonly type: Schema.Literal<"anonymous">;
1182
+ }>, Schema.Struct<{
1183
+ readonly type: Schema.Literal<"user">;
1184
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
1185
+ readonly sessionId: Schema.optional<Schema.brand<Schema.String, "auth/SessionId">>;
1186
+ }>, Schema.Struct<{
1187
+ readonly type: Schema.Literal<"custom">;
1188
+ readonly actorType: Schema.String;
1189
+ readonly actorReference: Schema.optional<Schema.String>;
1190
+ }>]>;
1191
+ readonly type: Schema.Literal<"auth.recovery_code.generated">;
1192
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
1193
+ readonly count: Schema.Number;
1194
+ }>, Schema.Struct<{
1195
+ readonly id: Schema.optional<Schema.brand<Schema.String, "auth/AuditEventId">>;
1196
+ readonly request: Schema.optional<Schema.Struct<{
1197
+ readonly ipHash: Schema.optional<Schema.brand<Schema.String, "auth/IpHash">>;
1198
+ readonly userAgentHash: Schema.optional<Schema.brand<Schema.String, "auth/UserAgentHash">>;
1199
+ }>>;
1200
+ readonly occurredAt: Schema.brand<Schema.Number, "auth/UnixMillis">;
1201
+ readonly actor: Schema.Union<readonly [Schema.Struct<{
1202
+ readonly type: Schema.Literal<"anonymous">;
1203
+ }>, Schema.Struct<{
1204
+ readonly type: Schema.Literal<"user">;
1205
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
1206
+ readonly sessionId: Schema.optional<Schema.brand<Schema.String, "auth/SessionId">>;
1207
+ }>, Schema.Struct<{
1208
+ readonly type: Schema.Literal<"custom">;
1209
+ readonly actorType: Schema.String;
1210
+ readonly actorReference: Schema.optional<Schema.String>;
1211
+ }>]>;
1212
+ readonly type: Schema.Literal<"auth.recovery_code.verified">;
1213
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
1214
+ readonly codeId: Schema.brand<Schema.String, "auth/CredentialId">;
1215
+ }>, Schema.Struct<{
1216
+ readonly id: Schema.optional<Schema.brand<Schema.String, "auth/AuditEventId">>;
1217
+ readonly request: Schema.optional<Schema.Struct<{
1218
+ readonly ipHash: Schema.optional<Schema.brand<Schema.String, "auth/IpHash">>;
1219
+ readonly userAgentHash: Schema.optional<Schema.brand<Schema.String, "auth/UserAgentHash">>;
1220
+ }>>;
1221
+ readonly occurredAt: Schema.brand<Schema.Number, "auth/UnixMillis">;
1222
+ readonly actor: Schema.Union<readonly [Schema.Struct<{
1223
+ readonly type: Schema.Literal<"anonymous">;
1224
+ }>, Schema.Struct<{
1225
+ readonly type: Schema.Literal<"user">;
1226
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
1227
+ readonly sessionId: Schema.optional<Schema.brand<Schema.String, "auth/SessionId">>;
1228
+ }>, Schema.Struct<{
1229
+ readonly type: Schema.Literal<"custom">;
1230
+ readonly actorType: Schema.String;
1231
+ readonly actorReference: Schema.optional<Schema.String>;
1232
+ }>]>;
1233
+ readonly type: Schema.Literal<"auth.recovery_code.revoked">;
1234
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
1235
+ readonly codeId: Schema.brand<Schema.String, "auth/CredentialId">;
1236
+ readonly reason: Schema.String;
1237
+ }>, Schema.Struct<{
1238
+ readonly id: Schema.optional<Schema.brand<Schema.String, "auth/AuditEventId">>;
1239
+ readonly request: Schema.optional<Schema.Struct<{
1240
+ readonly ipHash: Schema.optional<Schema.brand<Schema.String, "auth/IpHash">>;
1241
+ readonly userAgentHash: Schema.optional<Schema.brand<Schema.String, "auth/UserAgentHash">>;
1242
+ }>>;
1243
+ readonly occurredAt: Schema.brand<Schema.Number, "auth/UnixMillis">;
1244
+ readonly actor: Schema.Union<readonly [Schema.Struct<{
1245
+ readonly type: Schema.Literal<"anonymous">;
1246
+ }>, Schema.Struct<{
1247
+ readonly type: Schema.Literal<"user">;
1248
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
1249
+ readonly sessionId: Schema.optional<Schema.brand<Schema.String, "auth/SessionId">>;
1250
+ }>, Schema.Struct<{
1251
+ readonly type: Schema.Literal<"custom">;
1252
+ readonly actorType: Schema.String;
1253
+ readonly actorReference: Schema.optional<Schema.String>;
1254
+ }>]>;
1255
+ readonly type: Schema.Literals<readonly ["auth.api_key.created", "auth.api_key.verified"]>;
1256
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
1257
+ readonly keyId: Schema.brand<Schema.String, "auth/ApiKeyId">;
1258
+ readonly scopes: Schema.$Array<Schema.String>;
1259
+ }>, Schema.Struct<{
1260
+ readonly id: Schema.optional<Schema.brand<Schema.String, "auth/AuditEventId">>;
1261
+ readonly request: Schema.optional<Schema.Struct<{
1262
+ readonly ipHash: Schema.optional<Schema.brand<Schema.String, "auth/IpHash">>;
1263
+ readonly userAgentHash: Schema.optional<Schema.brand<Schema.String, "auth/UserAgentHash">>;
1264
+ }>>;
1265
+ readonly occurredAt: Schema.brand<Schema.Number, "auth/UnixMillis">;
1266
+ readonly actor: Schema.Union<readonly [Schema.Struct<{
1267
+ readonly type: Schema.Literal<"anonymous">;
1268
+ }>, Schema.Struct<{
1269
+ readonly type: Schema.Literal<"user">;
1270
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
1271
+ readonly sessionId: Schema.optional<Schema.brand<Schema.String, "auth/SessionId">>;
1272
+ }>, Schema.Struct<{
1273
+ readonly type: Schema.Literal<"custom">;
1274
+ readonly actorType: Schema.String;
1275
+ readonly actorReference: Schema.optional<Schema.String>;
1276
+ }>]>;
1277
+ readonly type: Schema.Literal<"auth.api_key.revoked">;
1278
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
1279
+ readonly keyId: Schema.brand<Schema.String, "auth/ApiKeyId">;
1280
+ readonly reason: Schema.String;
1281
+ }>, Schema.Struct<{
1282
+ readonly id: Schema.optional<Schema.brand<Schema.String, "auth/AuditEventId">>;
1283
+ readonly request: Schema.optional<Schema.Struct<{
1284
+ readonly ipHash: Schema.optional<Schema.brand<Schema.String, "auth/IpHash">>;
1285
+ readonly userAgentHash: Schema.optional<Schema.brand<Schema.String, "auth/UserAgentHash">>;
1286
+ }>>;
1287
+ readonly occurredAt: Schema.brand<Schema.Number, "auth/UnixMillis">;
1288
+ readonly actor: Schema.Union<readonly [Schema.Struct<{
1289
+ readonly type: Schema.Literal<"anonymous">;
1290
+ }>, Schema.Struct<{
1291
+ readonly type: Schema.Literal<"user">;
1292
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
1293
+ readonly sessionId: Schema.optional<Schema.brand<Schema.String, "auth/SessionId">>;
1294
+ }>, Schema.Struct<{
1295
+ readonly type: Schema.Literal<"custom">;
1296
+ readonly actorType: Schema.String;
1297
+ readonly actorReference: Schema.optional<Schema.String>;
1298
+ }>]>;
1299
+ readonly type: Schema.Literal<"auth.api_key.verification_failed">;
1300
+ readonly reason: Schema.String;
1301
+ }>, Schema.Struct<{
1302
+ readonly id: Schema.optional<Schema.brand<Schema.String, "auth/AuditEventId">>;
1303
+ readonly request: Schema.optional<Schema.Struct<{
1304
+ readonly ipHash: Schema.optional<Schema.brand<Schema.String, "auth/IpHash">>;
1305
+ readonly userAgentHash: Schema.optional<Schema.brand<Schema.String, "auth/UserAgentHash">>;
1306
+ }>>;
1307
+ readonly occurredAt: Schema.brand<Schema.Number, "auth/UnixMillis">;
1308
+ readonly actor: Schema.Union<readonly [Schema.Struct<{
1309
+ readonly type: Schema.Literal<"anonymous">;
1310
+ }>, Schema.Struct<{
1311
+ readonly type: Schema.Literal<"user">;
1312
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
1313
+ readonly sessionId: Schema.optional<Schema.brand<Schema.String, "auth/SessionId">>;
1314
+ }>, Schema.Struct<{
1315
+ readonly type: Schema.Literal<"custom">;
1316
+ readonly actorType: Schema.String;
1317
+ readonly actorReference: Schema.optional<Schema.String>;
1318
+ }>]>;
1319
+ readonly type: Schema.Literal<"auth.refresh_token.issued">;
1320
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
1321
+ readonly tokenId: Schema.brand<Schema.String, "auth/RefreshTokenId">;
1322
+ readonly familyId: Schema.brand<Schema.String, "auth/RefreshTokenFamilyId">;
1323
+ readonly expiresAt: Schema.brand<Schema.Number, "auth/UnixMillis">;
1324
+ }>, Schema.Struct<{
1325
+ readonly id: Schema.optional<Schema.brand<Schema.String, "auth/AuditEventId">>;
1326
+ readonly request: Schema.optional<Schema.Struct<{
1327
+ readonly ipHash: Schema.optional<Schema.brand<Schema.String, "auth/IpHash">>;
1328
+ readonly userAgentHash: Schema.optional<Schema.brand<Schema.String, "auth/UserAgentHash">>;
1329
+ }>>;
1330
+ readonly occurredAt: Schema.brand<Schema.Number, "auth/UnixMillis">;
1331
+ readonly actor: Schema.Union<readonly [Schema.Struct<{
1332
+ readonly type: Schema.Literal<"anonymous">;
1333
+ }>, Schema.Struct<{
1334
+ readonly type: Schema.Literal<"user">;
1335
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
1336
+ readonly sessionId: Schema.optional<Schema.brand<Schema.String, "auth/SessionId">>;
1337
+ }>, Schema.Struct<{
1338
+ readonly type: Schema.Literal<"custom">;
1339
+ readonly actorType: Schema.String;
1340
+ readonly actorReference: Schema.optional<Schema.String>;
1341
+ }>]>;
1342
+ readonly type: Schema.Literal<"auth.refresh_token.rotated">;
1343
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
1344
+ readonly previousTokenId: Schema.brand<Schema.String, "auth/RefreshTokenId">;
1345
+ readonly tokenId: Schema.brand<Schema.String, "auth/RefreshTokenId">;
1346
+ readonly familyId: Schema.brand<Schema.String, "auth/RefreshTokenFamilyId">;
1347
+ readonly expiresAt: Schema.brand<Schema.Number, "auth/UnixMillis">;
1348
+ }>, Schema.Struct<{
1349
+ readonly id: Schema.optional<Schema.brand<Schema.String, "auth/AuditEventId">>;
1350
+ readonly request: Schema.optional<Schema.Struct<{
1351
+ readonly ipHash: Schema.optional<Schema.brand<Schema.String, "auth/IpHash">>;
1352
+ readonly userAgentHash: Schema.optional<Schema.brand<Schema.String, "auth/UserAgentHash">>;
1353
+ }>>;
1354
+ readonly occurredAt: Schema.brand<Schema.Number, "auth/UnixMillis">;
1355
+ readonly actor: Schema.Union<readonly [Schema.Struct<{
1356
+ readonly type: Schema.Literal<"anonymous">;
1357
+ }>, Schema.Struct<{
1358
+ readonly type: Schema.Literal<"user">;
1359
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
1360
+ readonly sessionId: Schema.optional<Schema.brand<Schema.String, "auth/SessionId">>;
1361
+ }>, Schema.Struct<{
1362
+ readonly type: Schema.Literal<"custom">;
1363
+ readonly actorType: Schema.String;
1364
+ readonly actorReference: Schema.optional<Schema.String>;
1365
+ }>]>;
1366
+ readonly type: Schema.Literal<"auth.refresh_token.reuse_detected">;
1367
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
1368
+ readonly tokenId: Schema.brand<Schema.String, "auth/RefreshTokenId">;
1369
+ readonly familyId: Schema.brand<Schema.String, "auth/RefreshTokenFamilyId">;
1370
+ }>, Schema.Struct<{
1371
+ readonly id: Schema.optional<Schema.brand<Schema.String, "auth/AuditEventId">>;
1372
+ readonly request: Schema.optional<Schema.Struct<{
1373
+ readonly ipHash: Schema.optional<Schema.brand<Schema.String, "auth/IpHash">>;
1374
+ readonly userAgentHash: Schema.optional<Schema.brand<Schema.String, "auth/UserAgentHash">>;
1375
+ }>>;
1376
+ readonly occurredAt: Schema.brand<Schema.Number, "auth/UnixMillis">;
1377
+ readonly actor: Schema.Union<readonly [Schema.Struct<{
1378
+ readonly type: Schema.Literal<"anonymous">;
1379
+ }>, Schema.Struct<{
1380
+ readonly type: Schema.Literal<"user">;
1381
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
1382
+ readonly sessionId: Schema.optional<Schema.brand<Schema.String, "auth/SessionId">>;
1383
+ }>, Schema.Struct<{
1384
+ readonly type: Schema.Literal<"custom">;
1385
+ readonly actorType: Schema.String;
1386
+ readonly actorReference: Schema.optional<Schema.String>;
1387
+ }>]>;
1388
+ readonly type: Schema.Literal<"auth.refresh_token.revoked">;
1389
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
1390
+ readonly familyId: Schema.brand<Schema.String, "auth/RefreshTokenFamilyId">;
1391
+ readonly tokenId: Schema.optional<Schema.brand<Schema.String, "auth/RefreshTokenId">>;
1392
+ readonly reason: Schema.String;
1393
+ }>, Schema.Struct<{
1394
+ readonly id: Schema.optional<Schema.brand<Schema.String, "auth/AuditEventId">>;
1395
+ readonly request: Schema.optional<Schema.Struct<{
1396
+ readonly ipHash: Schema.optional<Schema.brand<Schema.String, "auth/IpHash">>;
1397
+ readonly userAgentHash: Schema.optional<Schema.brand<Schema.String, "auth/UserAgentHash">>;
1398
+ }>>;
1399
+ readonly occurredAt: Schema.brand<Schema.Number, "auth/UnixMillis">;
1400
+ readonly actor: Schema.Union<readonly [Schema.Struct<{
1401
+ readonly type: Schema.Literal<"anonymous">;
1402
+ }>, Schema.Struct<{
1403
+ readonly type: Schema.Literal<"user">;
1404
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
1405
+ readonly sessionId: Schema.optional<Schema.brand<Schema.String, "auth/SessionId">>;
1406
+ }>, Schema.Struct<{
1407
+ readonly type: Schema.Literal<"custom">;
1408
+ readonly actorType: Schema.String;
1409
+ readonly actorReference: Schema.optional<Schema.String>;
1410
+ }>]>;
1411
+ readonly type: Schema.Literal<"auth.incident_action.executed">;
1412
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
1413
+ readonly result: Schema.Struct<{
1414
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
1415
+ readonly reason: Schema.optional<Schema.String>;
1416
+ readonly sessions: Schema.optional<Schema.Struct<{
1417
+ readonly revokedAll: Schema.Literal<true>;
1418
+ readonly activeBefore: Schema.Number;
1419
+ readonly sessionIds: Schema.$Array<Schema.brand<Schema.String, "auth/SessionId">>;
1420
+ }>>;
1421
+ readonly trustedDevices: Schema.optional<Schema.Struct<{
1422
+ readonly revoked: Schema.Number;
1423
+ readonly deviceIds: Schema.$Array<Schema.String>;
1424
+ }>>;
1425
+ readonly apiKeys: Schema.optional<Schema.Struct<{
1426
+ readonly revoked: Schema.Number;
1427
+ readonly keyIds: Schema.$Array<Schema.brand<Schema.String, "auth/ApiKeyId">>;
1428
+ }>>;
1429
+ readonly refreshTokens: Schema.optional<Schema.Struct<{
1430
+ readonly revokedFamilies: Schema.Number;
1431
+ readonly activeBefore: Schema.Number;
1432
+ readonly tokenIds: Schema.$Array<Schema.brand<Schema.String, "auth/RefreshTokenId">>;
1433
+ readonly familyIds: Schema.$Array<Schema.brand<Schema.String, "auth/RefreshTokenFamilyId">>;
1434
+ }>>;
1435
+ }>;
1436
+ }>, Schema.Struct<{
1437
+ readonly id: Schema.optional<Schema.brand<Schema.String, "auth/AuditEventId">>;
1438
+ readonly request: Schema.optional<Schema.Struct<{
1439
+ readonly ipHash: Schema.optional<Schema.brand<Schema.String, "auth/IpHash">>;
1440
+ readonly userAgentHash: Schema.optional<Schema.brand<Schema.String, "auth/UserAgentHash">>;
1441
+ }>>;
1442
+ readonly occurredAt: Schema.brand<Schema.Number, "auth/UnixMillis">;
1443
+ readonly actor: Schema.Union<readonly [Schema.Struct<{
1444
+ readonly type: Schema.Literal<"anonymous">;
1445
+ }>, Schema.Struct<{
1446
+ readonly type: Schema.Literal<"user">;
1447
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
1448
+ readonly sessionId: Schema.optional<Schema.brand<Schema.String, "auth/SessionId">>;
1449
+ }>, Schema.Struct<{
1450
+ readonly type: Schema.Literal<"custom">;
1451
+ readonly actorType: Schema.String;
1452
+ readonly actorReference: Schema.optional<Schema.String>;
1453
+ }>]>;
1454
+ readonly type: Schema.Literal<"auth.jwt.introspected">;
1455
+ readonly active: Schema.Boolean;
1456
+ readonly jwtId: Schema.optional<Schema.String>;
1457
+ readonly expiresAt: Schema.optional<Schema.brand<Schema.Number, "auth/UnixMillis">>;
1458
+ readonly reason: Schema.optional<Schema.String>;
1459
+ }>, Schema.Struct<{
1460
+ readonly id: Schema.optional<Schema.brand<Schema.String, "auth/AuditEventId">>;
1461
+ readonly request: Schema.optional<Schema.Struct<{
1462
+ readonly ipHash: Schema.optional<Schema.brand<Schema.String, "auth/IpHash">>;
1463
+ readonly userAgentHash: Schema.optional<Schema.brand<Schema.String, "auth/UserAgentHash">>;
1464
+ }>>;
1465
+ readonly occurredAt: Schema.brand<Schema.Number, "auth/UnixMillis">;
1466
+ readonly actor: Schema.Union<readonly [Schema.Struct<{
1467
+ readonly type: Schema.Literal<"anonymous">;
1468
+ }>, Schema.Struct<{
1469
+ readonly type: Schema.Literal<"user">;
1470
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
1471
+ readonly sessionId: Schema.optional<Schema.brand<Schema.String, "auth/SessionId">>;
1472
+ }>, Schema.Struct<{
1473
+ readonly type: Schema.Literal<"custom">;
1474
+ readonly actorType: Schema.String;
1475
+ readonly actorReference: Schema.optional<Schema.String>;
1476
+ }>]>;
1477
+ readonly type: Schema.Literal<"auth.jwt.revoked">;
1478
+ readonly jwtId: Schema.String;
1479
+ readonly expiresAt: Schema.optional<Schema.brand<Schema.Number, "auth/UnixMillis">>;
1480
+ readonly reason: Schema.String;
1481
+ }>]>;
1482
+ declare const CustomAuditEvent_base: Schema.Class<CustomAuditEvent, Schema.Struct<{
1483
+ readonly type: Schema.TemplateLiteral<readonly ["app.", Schema.String]>;
1484
+ readonly version: Schema.Int;
1485
+ readonly id: Schema.optional<Schema.brand<Schema.String, "auth/AuditEventId">>;
1486
+ readonly actor: Schema.Union<readonly [Schema.Struct<{
1487
+ readonly type: Schema.Literal<"anonymous">;
1488
+ }>, Schema.Struct<{
1489
+ readonly type: Schema.Literal<"user">;
1490
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
1491
+ readonly sessionId: Schema.optional<Schema.brand<Schema.String, "auth/SessionId">>;
1492
+ }>, Schema.Struct<{
1493
+ readonly type: Schema.Literal<"custom">;
1494
+ readonly actorType: Schema.String;
1495
+ readonly actorReference: Schema.optional<Schema.String>;
1496
+ }>]>;
1497
+ readonly subject: Schema.optional<Schema.Union<readonly [Schema.Struct<{
1498
+ readonly type: Schema.Literal<"anonymous">;
1499
+ }>, Schema.Struct<{
1500
+ readonly type: Schema.Literal<"email">;
1501
+ readonly emailHash: Schema.brand<Schema.String, "auth/EmailHash">;
1502
+ }>, Schema.Struct<{
1503
+ readonly type: Schema.Literal<"user">;
1504
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
1505
+ }>]>>;
1506
+ readonly request: Schema.optional<Schema.Struct<{
1507
+ readonly ipHash: Schema.optional<Schema.brand<Schema.String, "auth/IpHash">>;
1508
+ readonly userAgentHash: Schema.optional<Schema.brand<Schema.String, "auth/UserAgentHash">>;
1509
+ }>>;
1510
+ readonly payload: Schema.$Record<Schema.String, Schema.Unknown>;
1511
+ readonly occurredAt: Schema.brand<Schema.Number, "auth/UnixMillis">;
1512
+ }>, {}>;
1513
+ export declare class CustomAuditEvent extends CustomAuditEvent_base {
1514
+ }
1515
+ export declare const CustomAuditEventSchema: Schema.Struct<{
1516
+ readonly type: Schema.TemplateLiteral<readonly ["app.", Schema.String]>;
1517
+ readonly version: Schema.Int;
1518
+ readonly id: Schema.optional<Schema.brand<Schema.String, "auth/AuditEventId">>;
1519
+ readonly actor: Schema.Union<readonly [Schema.Struct<{
1520
+ readonly type: Schema.Literal<"anonymous">;
1521
+ }>, Schema.Struct<{
1522
+ readonly type: Schema.Literal<"user">;
1523
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
1524
+ readonly sessionId: Schema.optional<Schema.brand<Schema.String, "auth/SessionId">>;
1525
+ }>, Schema.Struct<{
1526
+ readonly type: Schema.Literal<"custom">;
1527
+ readonly actorType: Schema.String;
1528
+ readonly actorReference: Schema.optional<Schema.String>;
1529
+ }>]>;
1530
+ readonly subject: Schema.optional<Schema.Union<readonly [Schema.Struct<{
1531
+ readonly type: Schema.Literal<"anonymous">;
1532
+ }>, Schema.Struct<{
1533
+ readonly type: Schema.Literal<"email">;
1534
+ readonly emailHash: Schema.brand<Schema.String, "auth/EmailHash">;
1535
+ }>, Schema.Struct<{
1536
+ readonly type: Schema.Literal<"user">;
1537
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
1538
+ }>]>>;
1539
+ readonly request: Schema.optional<Schema.Struct<{
1540
+ readonly ipHash: Schema.optional<Schema.brand<Schema.String, "auth/IpHash">>;
1541
+ readonly userAgentHash: Schema.optional<Schema.brand<Schema.String, "auth/UserAgentHash">>;
1542
+ }>>;
1543
+ readonly payload: Schema.$Record<Schema.String, Schema.Unknown>;
1544
+ readonly occurredAt: Schema.brand<Schema.Number, "auth/UnixMillis">;
1545
+ }>;
1546
+ export declare const isCustomAuditEvent: <I>(input: I) => input is I & {
1547
+ readonly type: `app.${string}`;
1548
+ readonly version: number;
1549
+ readonly id?: (string & import("effect/Brand").Brand<"auth/AuditEventId">) | undefined;
1550
+ readonly actor: Schema.Struct.ReadonlySide<{
1551
+ readonly type: Schema.Literal<"anonymous">;
1552
+ }, "Type"> | {
1553
+ readonly type: "user";
1554
+ readonly userId: string & import("effect/Brand").Brand<"auth/UserId">;
1555
+ readonly sessionId?: (string & import("effect/Brand").Brand<"auth/SessionId">) | undefined;
1556
+ } | {
1557
+ readonly type: "custom";
1558
+ readonly actorType: string;
1559
+ readonly actorReference?: string | undefined;
1560
+ };
1561
+ readonly subject?: Schema.Struct.ReadonlySide<{
1562
+ readonly type: Schema.Literal<"anonymous">;
1563
+ }, "Type"> | Schema.Struct.ReadonlySide<{
1564
+ readonly type: Schema.Literal<"email">;
1565
+ readonly emailHash: Schema.brand<Schema.String, "auth/EmailHash">;
1566
+ }, "Type"> | Schema.Struct.ReadonlySide<{
1567
+ readonly type: Schema.Literal<"user">;
1568
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
1569
+ }, "Type"> | undefined;
1570
+ readonly request?: {
1571
+ readonly ipHash?: (string & import("effect/Brand").Brand<"auth/IpHash">) | undefined;
1572
+ readonly userAgentHash?: (string & import("effect/Brand").Brand<"auth/UserAgentHash">) | undefined;
1573
+ } | undefined;
1574
+ readonly payload: {
1575
+ readonly [x: string]: unknown;
1576
+ };
1577
+ readonly occurredAt: number & import("effect/Brand").Brand<"auth/UnixMillis">;
1578
+ };
1579
+ export type AuditEvent = AuthAuditEvent | CustomAuditEvent;
1580
+ export declare const AuditEventSchema: Schema.Union<readonly [Schema.Union<readonly [Schema.Struct<{
1581
+ readonly id: Schema.optional<Schema.brand<Schema.String, "auth/AuditEventId">>;
1582
+ readonly request: Schema.optional<Schema.Struct<{
1583
+ readonly ipHash: Schema.optional<Schema.brand<Schema.String, "auth/IpHash">>;
1584
+ readonly userAgentHash: Schema.optional<Schema.brand<Schema.String, "auth/UserAgentHash">>;
1585
+ }>>;
1586
+ readonly occurredAt: Schema.brand<Schema.Number, "auth/UnixMillis">;
1587
+ readonly actor: Schema.Union<readonly [Schema.Struct<{
1588
+ readonly type: Schema.Literal<"anonymous">;
1589
+ }>, Schema.Struct<{
1590
+ readonly type: Schema.Literal<"user">;
1591
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
1592
+ readonly sessionId: Schema.optional<Schema.brand<Schema.String, "auth/SessionId">>;
1593
+ }>, Schema.Struct<{
1594
+ readonly type: Schema.Literal<"custom">;
1595
+ readonly actorType: Schema.String;
1596
+ readonly actorReference: Schema.optional<Schema.String>;
1597
+ }>]>;
1598
+ readonly type: Schema.Literals<readonly ["auth.session.assurance_changed", "auth.session.step_up_completed", "auth.session.primary_reauthenticated", "auth.session.recovery_remediation.entered", "auth.session.recovery_remediation.completed"]>;
1599
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
1600
+ readonly sessionId: Schema.brand<Schema.String, "auth/SessionId">;
1601
+ readonly oldAal: Schema.Literals<readonly ["aal1", "aal2", "aal3"]>;
1602
+ readonly newAal: Schema.Literals<readonly ["aal1", "aal2", "aal3"]>;
1603
+ readonly amr: Schema.$Array<Schema.String>;
1604
+ readonly method: Schema.String;
1605
+ readonly rotatedAt: Schema.brand<Schema.Number, "auth/UnixMillis">;
1606
+ readonly requirementsEntered: Schema.$Array<Schema.String>;
1607
+ readonly requirementsCleared: Schema.$Array<Schema.String>;
1608
+ }>, Schema.Struct<{
1609
+ readonly id: Schema.optional<Schema.brand<Schema.String, "auth/AuditEventId">>;
1610
+ readonly request: Schema.optional<Schema.Struct<{
1611
+ readonly ipHash: Schema.optional<Schema.brand<Schema.String, "auth/IpHash">>;
1612
+ readonly userAgentHash: Schema.optional<Schema.brand<Schema.String, "auth/UserAgentHash">>;
1613
+ }>>;
1614
+ readonly occurredAt: Schema.brand<Schema.Number, "auth/UnixMillis">;
1615
+ readonly actor: Schema.Union<readonly [Schema.Struct<{
1616
+ readonly type: Schema.Literal<"anonymous">;
1617
+ }>, Schema.Struct<{
1618
+ readonly type: Schema.Literal<"user">;
1619
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
1620
+ readonly sessionId: Schema.optional<Schema.brand<Schema.String, "auth/SessionId">>;
1621
+ }>, Schema.Struct<{
1622
+ readonly type: Schema.Literal<"custom">;
1623
+ readonly actorType: Schema.String;
1624
+ readonly actorReference: Schema.optional<Schema.String>;
1625
+ }>]>;
1626
+ readonly type: Schema.Literal<"auth.permission_definition.created">;
1627
+ readonly permissionId: Schema.brand<Schema.String, "auth/PermissionId">;
1628
+ readonly scopeType: Schema.optional<Schema.String>;
1629
+ }>, Schema.Struct<{
1630
+ readonly id: Schema.optional<Schema.brand<Schema.String, "auth/AuditEventId">>;
1631
+ readonly request: Schema.optional<Schema.Struct<{
1632
+ readonly ipHash: Schema.optional<Schema.brand<Schema.String, "auth/IpHash">>;
1633
+ readonly userAgentHash: Schema.optional<Schema.brand<Schema.String, "auth/UserAgentHash">>;
1634
+ }>>;
1635
+ readonly occurredAt: Schema.brand<Schema.Number, "auth/UnixMillis">;
1636
+ readonly actor: Schema.Union<readonly [Schema.Struct<{
1637
+ readonly type: Schema.Literal<"anonymous">;
1638
+ }>, Schema.Struct<{
1639
+ readonly type: Schema.Literal<"user">;
1640
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
1641
+ readonly sessionId: Schema.optional<Schema.brand<Schema.String, "auth/SessionId">>;
1642
+ }>, Schema.Struct<{
1643
+ readonly type: Schema.Literal<"custom">;
1644
+ readonly actorType: Schema.String;
1645
+ readonly actorReference: Schema.optional<Schema.String>;
1646
+ }>]>;
1647
+ readonly type: Schema.Literal<"auth.permission_definition.updated">;
1648
+ readonly permissionId: Schema.brand<Schema.String, "auth/PermissionId">;
1649
+ readonly scopeType: Schema.optional<Schema.String>;
1650
+ readonly changedFields: Schema.$Array<Schema.Literals<readonly ["description", "scopeType"]>>;
1651
+ }>, Schema.Struct<{
1652
+ readonly id: Schema.optional<Schema.brand<Schema.String, "auth/AuditEventId">>;
1653
+ readonly request: Schema.optional<Schema.Struct<{
1654
+ readonly ipHash: Schema.optional<Schema.brand<Schema.String, "auth/IpHash">>;
1655
+ readonly userAgentHash: Schema.optional<Schema.brand<Schema.String, "auth/UserAgentHash">>;
1656
+ }>>;
1657
+ readonly occurredAt: Schema.brand<Schema.Number, "auth/UnixMillis">;
1658
+ readonly actor: Schema.Union<readonly [Schema.Struct<{
1659
+ readonly type: Schema.Literal<"anonymous">;
1660
+ }>, Schema.Struct<{
1661
+ readonly type: Schema.Literal<"user">;
1662
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
1663
+ readonly sessionId: Schema.optional<Schema.brand<Schema.String, "auth/SessionId">>;
1664
+ }>, Schema.Struct<{
1665
+ readonly type: Schema.Literal<"custom">;
1666
+ readonly actorType: Schema.String;
1667
+ readonly actorReference: Schema.optional<Schema.String>;
1668
+ }>]>;
1669
+ readonly type: Schema.Literals<readonly ["auth.permission_definition.disabled", "auth.permission_definition.enabled", "auth.permission_definition.deleted"]>;
1670
+ readonly permissionId: Schema.brand<Schema.String, "auth/PermissionId">;
1671
+ readonly scopeType: Schema.optional<Schema.String>;
1672
+ }>, Schema.Struct<{
1673
+ readonly id: Schema.optional<Schema.brand<Schema.String, "auth/AuditEventId">>;
1674
+ readonly request: Schema.optional<Schema.Struct<{
1675
+ readonly ipHash: Schema.optional<Schema.brand<Schema.String, "auth/IpHash">>;
1676
+ readonly userAgentHash: Schema.optional<Schema.brand<Schema.String, "auth/UserAgentHash">>;
1677
+ }>>;
1678
+ readonly occurredAt: Schema.brand<Schema.Number, "auth/UnixMillis">;
1679
+ readonly actor: Schema.Union<readonly [Schema.Struct<{
1680
+ readonly type: Schema.Literal<"anonymous">;
1681
+ }>, Schema.Struct<{
1682
+ readonly type: Schema.Literal<"user">;
1683
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
1684
+ readonly sessionId: Schema.optional<Schema.brand<Schema.String, "auth/SessionId">>;
1685
+ }>, Schema.Struct<{
1686
+ readonly type: Schema.Literal<"custom">;
1687
+ readonly actorType: Schema.String;
1688
+ readonly actorReference: Schema.optional<Schema.String>;
1689
+ }>]>;
1690
+ readonly type: Schema.Literal<"auth.role_definition.created">;
1691
+ readonly roleId: Schema.brand<Schema.String, "auth/RoleId">;
1692
+ }>, Schema.Struct<{
1693
+ readonly id: Schema.optional<Schema.brand<Schema.String, "auth/AuditEventId">>;
1694
+ readonly request: Schema.optional<Schema.Struct<{
1695
+ readonly ipHash: Schema.optional<Schema.brand<Schema.String, "auth/IpHash">>;
1696
+ readonly userAgentHash: Schema.optional<Schema.brand<Schema.String, "auth/UserAgentHash">>;
1697
+ }>>;
1698
+ readonly occurredAt: Schema.brand<Schema.Number, "auth/UnixMillis">;
1699
+ readonly actor: Schema.Union<readonly [Schema.Struct<{
1700
+ readonly type: Schema.Literal<"anonymous">;
1701
+ }>, Schema.Struct<{
1702
+ readonly type: Schema.Literal<"user">;
1703
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
1704
+ readonly sessionId: Schema.optional<Schema.brand<Schema.String, "auth/SessionId">>;
1705
+ }>, Schema.Struct<{
1706
+ readonly type: Schema.Literal<"custom">;
1707
+ readonly actorType: Schema.String;
1708
+ readonly actorReference: Schema.optional<Schema.String>;
1709
+ }>]>;
1710
+ readonly type: Schema.Literal<"auth.role_definition.updated">;
1711
+ readonly roleId: Schema.brand<Schema.String, "auth/RoleId">;
1712
+ readonly changedFields: Schema.$Array<Schema.Literal<"description">>;
1713
+ }>, Schema.Struct<{
1714
+ readonly id: Schema.optional<Schema.brand<Schema.String, "auth/AuditEventId">>;
1715
+ readonly request: Schema.optional<Schema.Struct<{
1716
+ readonly ipHash: Schema.optional<Schema.brand<Schema.String, "auth/IpHash">>;
1717
+ readonly userAgentHash: Schema.optional<Schema.brand<Schema.String, "auth/UserAgentHash">>;
1718
+ }>>;
1719
+ readonly occurredAt: Schema.brand<Schema.Number, "auth/UnixMillis">;
1720
+ readonly actor: Schema.Union<readonly [Schema.Struct<{
1721
+ readonly type: Schema.Literal<"anonymous">;
1722
+ }>, Schema.Struct<{
1723
+ readonly type: Schema.Literal<"user">;
1724
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
1725
+ readonly sessionId: Schema.optional<Schema.brand<Schema.String, "auth/SessionId">>;
1726
+ }>, Schema.Struct<{
1727
+ readonly type: Schema.Literal<"custom">;
1728
+ readonly actorType: Schema.String;
1729
+ readonly actorReference: Schema.optional<Schema.String>;
1730
+ }>]>;
1731
+ readonly type: Schema.Literals<readonly ["auth.role_definition.disabled", "auth.role_definition.enabled", "auth.role_definition.deleted"]>;
1732
+ readonly roleId: Schema.brand<Schema.String, "auth/RoleId">;
1733
+ }>, Schema.Struct<{
1734
+ readonly id: Schema.optional<Schema.brand<Schema.String, "auth/AuditEventId">>;
1735
+ readonly request: Schema.optional<Schema.Struct<{
1736
+ readonly ipHash: Schema.optional<Schema.brand<Schema.String, "auth/IpHash">>;
1737
+ readonly userAgentHash: Schema.optional<Schema.brand<Schema.String, "auth/UserAgentHash">>;
1738
+ }>>;
1739
+ readonly occurredAt: Schema.brand<Schema.Number, "auth/UnixMillis">;
1740
+ readonly actor: Schema.Union<readonly [Schema.Struct<{
1741
+ readonly type: Schema.Literal<"anonymous">;
1742
+ }>, Schema.Struct<{
1743
+ readonly type: Schema.Literal<"user">;
1744
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
1745
+ readonly sessionId: Schema.optional<Schema.brand<Schema.String, "auth/SessionId">>;
1746
+ }>, Schema.Struct<{
1747
+ readonly type: Schema.Literal<"custom">;
1748
+ readonly actorType: Schema.String;
1749
+ readonly actorReference: Schema.optional<Schema.String>;
1750
+ }>]>;
1751
+ readonly type: Schema.Literal<"auth.permission.granted">;
1752
+ readonly subject: Schema.Union<readonly [Schema.Struct<{
1753
+ readonly type: Schema.Literal<"user">;
1754
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
1755
+ }>, Schema.Struct<{
1756
+ readonly type: Schema.Literal<"custom">;
1757
+ readonly subjectType: Schema.String;
1758
+ readonly subjectReference: Schema.optional<Schema.String>;
1759
+ }>]>;
1760
+ readonly permissionId: Schema.brand<Schema.String, "auth/PermissionId">;
1761
+ readonly scope: Schema.optional<Schema.Struct<{
1762
+ readonly type: Schema.String;
1763
+ readonly reference: Schema.optional<Schema.String>;
1764
+ }>>;
1765
+ readonly expiresAt: Schema.optional<Schema.brand<Schema.Number, "auth/UnixMillis">>;
1766
+ }>, Schema.Struct<{
1767
+ readonly id: Schema.optional<Schema.brand<Schema.String, "auth/AuditEventId">>;
1768
+ readonly request: Schema.optional<Schema.Struct<{
1769
+ readonly ipHash: Schema.optional<Schema.brand<Schema.String, "auth/IpHash">>;
1770
+ readonly userAgentHash: Schema.optional<Schema.brand<Schema.String, "auth/UserAgentHash">>;
1771
+ }>>;
1772
+ readonly occurredAt: Schema.brand<Schema.Number, "auth/UnixMillis">;
1773
+ readonly actor: Schema.Union<readonly [Schema.Struct<{
1774
+ readonly type: Schema.Literal<"anonymous">;
1775
+ }>, Schema.Struct<{
1776
+ readonly type: Schema.Literal<"user">;
1777
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
1778
+ readonly sessionId: Schema.optional<Schema.brand<Schema.String, "auth/SessionId">>;
1779
+ }>, Schema.Struct<{
1780
+ readonly type: Schema.Literal<"custom">;
1781
+ readonly actorType: Schema.String;
1782
+ readonly actorReference: Schema.optional<Schema.String>;
1783
+ }>]>;
1784
+ readonly type: Schema.Literal<"auth.permission.revoked">;
1785
+ readonly subject: Schema.Union<readonly [Schema.Struct<{
1786
+ readonly type: Schema.Literal<"user">;
1787
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
1788
+ }>, Schema.Struct<{
1789
+ readonly type: Schema.Literal<"custom">;
1790
+ readonly subjectType: Schema.String;
1791
+ readonly subjectReference: Schema.optional<Schema.String>;
1792
+ }>]>;
1793
+ readonly permissionId: Schema.brand<Schema.String, "auth/PermissionId">;
1794
+ readonly scope: Schema.optional<Schema.Struct<{
1795
+ readonly type: Schema.String;
1796
+ readonly reference: Schema.optional<Schema.String>;
1797
+ }>>;
1798
+ }>, Schema.Struct<{
1799
+ readonly id: Schema.optional<Schema.brand<Schema.String, "auth/AuditEventId">>;
1800
+ readonly request: Schema.optional<Schema.Struct<{
1801
+ readonly ipHash: Schema.optional<Schema.brand<Schema.String, "auth/IpHash">>;
1802
+ readonly userAgentHash: Schema.optional<Schema.brand<Schema.String, "auth/UserAgentHash">>;
1803
+ }>>;
1804
+ readonly occurredAt: Schema.brand<Schema.Number, "auth/UnixMillis">;
1805
+ readonly actor: Schema.Union<readonly [Schema.Struct<{
1806
+ readonly type: Schema.Literal<"anonymous">;
1807
+ }>, Schema.Struct<{
1808
+ readonly type: Schema.Literal<"user">;
1809
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
1810
+ readonly sessionId: Schema.optional<Schema.brand<Schema.String, "auth/SessionId">>;
1811
+ }>, Schema.Struct<{
1812
+ readonly type: Schema.Literal<"custom">;
1813
+ readonly actorType: Schema.String;
1814
+ readonly actorReference: Schema.optional<Schema.String>;
1815
+ }>]>;
1816
+ readonly type: Schema.Literal<"auth.role.granted">;
1817
+ readonly subject: Schema.Union<readonly [Schema.Struct<{
1818
+ readonly type: Schema.Literal<"user">;
1819
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
1820
+ }>, Schema.Struct<{
1821
+ readonly type: Schema.Literal<"custom">;
1822
+ readonly subjectType: Schema.String;
1823
+ readonly subjectReference: Schema.optional<Schema.String>;
1824
+ }>]>;
1825
+ readonly roleId: Schema.brand<Schema.String, "auth/RoleId">;
1826
+ readonly scope: Schema.optional<Schema.Struct<{
1827
+ readonly type: Schema.String;
1828
+ readonly reference: Schema.optional<Schema.String>;
1829
+ }>>;
1830
+ readonly expiresAt: Schema.optional<Schema.brand<Schema.Number, "auth/UnixMillis">>;
1831
+ }>, Schema.Struct<{
1832
+ readonly id: Schema.optional<Schema.brand<Schema.String, "auth/AuditEventId">>;
1833
+ readonly request: Schema.optional<Schema.Struct<{
1834
+ readonly ipHash: Schema.optional<Schema.brand<Schema.String, "auth/IpHash">>;
1835
+ readonly userAgentHash: Schema.optional<Schema.brand<Schema.String, "auth/UserAgentHash">>;
1836
+ }>>;
1837
+ readonly occurredAt: Schema.brand<Schema.Number, "auth/UnixMillis">;
1838
+ readonly actor: Schema.Union<readonly [Schema.Struct<{
1839
+ readonly type: Schema.Literal<"anonymous">;
1840
+ }>, Schema.Struct<{
1841
+ readonly type: Schema.Literal<"user">;
1842
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
1843
+ readonly sessionId: Schema.optional<Schema.brand<Schema.String, "auth/SessionId">>;
1844
+ }>, Schema.Struct<{
1845
+ readonly type: Schema.Literal<"custom">;
1846
+ readonly actorType: Schema.String;
1847
+ readonly actorReference: Schema.optional<Schema.String>;
1848
+ }>]>;
1849
+ readonly type: Schema.Literal<"auth.role.revoked">;
1850
+ readonly subject: Schema.Union<readonly [Schema.Struct<{
1851
+ readonly type: Schema.Literal<"user">;
1852
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
1853
+ }>, Schema.Struct<{
1854
+ readonly type: Schema.Literal<"custom">;
1855
+ readonly subjectType: Schema.String;
1856
+ readonly subjectReference: Schema.optional<Schema.String>;
1857
+ }>]>;
1858
+ readonly roleId: Schema.brand<Schema.String, "auth/RoleId">;
1859
+ readonly scope: Schema.optional<Schema.Struct<{
1860
+ readonly type: Schema.String;
1861
+ readonly reference: Schema.optional<Schema.String>;
1862
+ }>>;
1863
+ }>, Schema.Struct<{
1864
+ readonly id: Schema.optional<Schema.brand<Schema.String, "auth/AuditEventId">>;
1865
+ readonly request: Schema.optional<Schema.Struct<{
1866
+ readonly ipHash: Schema.optional<Schema.brand<Schema.String, "auth/IpHash">>;
1867
+ readonly userAgentHash: Schema.optional<Schema.brand<Schema.String, "auth/UserAgentHash">>;
1868
+ }>>;
1869
+ readonly occurredAt: Schema.brand<Schema.Number, "auth/UnixMillis">;
1870
+ readonly actor: Schema.Union<readonly [Schema.Struct<{
1871
+ readonly type: Schema.Literal<"anonymous">;
1872
+ }>, Schema.Struct<{
1873
+ readonly type: Schema.Literal<"user">;
1874
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
1875
+ readonly sessionId: Schema.optional<Schema.brand<Schema.String, "auth/SessionId">>;
1876
+ }>, Schema.Struct<{
1877
+ readonly type: Schema.Literal<"custom">;
1878
+ readonly actorType: Schema.String;
1879
+ readonly actorReference: Schema.optional<Schema.String>;
1880
+ }>]>;
1881
+ readonly type: Schema.Literals<readonly ["auth.role_permission.assigned", "auth.role_permission.removed"]>;
1882
+ readonly roleId: Schema.brand<Schema.String, "auth/RoleId">;
1883
+ readonly permissionId: Schema.brand<Schema.String, "auth/PermissionId">;
1884
+ readonly scopeType: Schema.optional<Schema.String>;
1885
+ }>, Schema.Struct<{
1886
+ readonly id: Schema.optional<Schema.brand<Schema.String, "auth/AuditEventId">>;
1887
+ readonly request: Schema.optional<Schema.Struct<{
1888
+ readonly ipHash: Schema.optional<Schema.brand<Schema.String, "auth/IpHash">>;
1889
+ readonly userAgentHash: Schema.optional<Schema.brand<Schema.String, "auth/UserAgentHash">>;
1890
+ }>>;
1891
+ readonly occurredAt: Schema.brand<Schema.Number, "auth/UnixMillis">;
1892
+ readonly actor: Schema.Union<readonly [Schema.Struct<{
1893
+ readonly type: Schema.Literal<"anonymous">;
1894
+ }>, Schema.Struct<{
1895
+ readonly type: Schema.Literal<"user">;
1896
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
1897
+ readonly sessionId: Schema.optional<Schema.brand<Schema.String, "auth/SessionId">>;
1898
+ }>, Schema.Struct<{
1899
+ readonly type: Schema.Literal<"custom">;
1900
+ readonly actorType: Schema.String;
1901
+ readonly actorReference: Schema.optional<Schema.String>;
1902
+ }>]>;
1903
+ readonly type: Schema.Literals<readonly ["auth.identity.added", "auth.identity.primary_changed"]>;
1904
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
1905
+ readonly identityId: Schema.brand<Schema.String, "auth/IdentityId">;
1906
+ readonly kind: Schema.String;
1907
+ readonly scope: Schema.Union<readonly [Schema.Struct<{
1908
+ readonly type: Schema.Literal<"global">;
1909
+ }>, Schema.Struct<{
1910
+ readonly type: Schema.Literal<"tenant">;
1911
+ readonly tenantId: Schema.String;
1912
+ }>]>;
1913
+ }>, Schema.Struct<{
1914
+ readonly id: Schema.optional<Schema.brand<Schema.String, "auth/AuditEventId">>;
1915
+ readonly request: Schema.optional<Schema.Struct<{
1916
+ readonly ipHash: Schema.optional<Schema.brand<Schema.String, "auth/IpHash">>;
1917
+ readonly userAgentHash: Schema.optional<Schema.brand<Schema.String, "auth/UserAgentHash">>;
1918
+ }>>;
1919
+ readonly occurredAt: Schema.brand<Schema.Number, "auth/UnixMillis">;
1920
+ readonly actor: Schema.Union<readonly [Schema.Struct<{
1921
+ readonly type: Schema.Literal<"anonymous">;
1922
+ }>, Schema.Struct<{
1923
+ readonly type: Schema.Literal<"user">;
1924
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
1925
+ readonly sessionId: Schema.optional<Schema.brand<Schema.String, "auth/SessionId">>;
1926
+ }>, Schema.Struct<{
1927
+ readonly type: Schema.Literal<"custom">;
1928
+ readonly actorType: Schema.String;
1929
+ readonly actorReference: Schema.optional<Schema.String>;
1930
+ }>]>;
1931
+ readonly type: Schema.Literal<"auth.identity.replaced">;
1932
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
1933
+ readonly identityId: Schema.brand<Schema.String, "auth/IdentityId">;
1934
+ readonly replacementIdentityId: Schema.brand<Schema.String, "auth/IdentityId">;
1935
+ readonly kind: Schema.String;
1936
+ readonly scope: Schema.Union<readonly [Schema.Struct<{
1937
+ readonly type: Schema.Literal<"global">;
1938
+ }>, Schema.Struct<{
1939
+ readonly type: Schema.Literal<"tenant">;
1940
+ readonly tenantId: Schema.String;
1941
+ }>]>;
1942
+ }>, Schema.Struct<{
1943
+ readonly id: Schema.optional<Schema.brand<Schema.String, "auth/AuditEventId">>;
1944
+ readonly request: Schema.optional<Schema.Struct<{
1945
+ readonly ipHash: Schema.optional<Schema.brand<Schema.String, "auth/IpHash">>;
1946
+ readonly userAgentHash: Schema.optional<Schema.brand<Schema.String, "auth/UserAgentHash">>;
1947
+ }>>;
1948
+ readonly occurredAt: Schema.brand<Schema.Number, "auth/UnixMillis">;
1949
+ readonly actor: Schema.Union<readonly [Schema.Struct<{
1950
+ readonly type: Schema.Literal<"anonymous">;
1951
+ }>, Schema.Struct<{
1952
+ readonly type: Schema.Literal<"user">;
1953
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
1954
+ readonly sessionId: Schema.optional<Schema.brand<Schema.String, "auth/SessionId">>;
1955
+ }>, Schema.Struct<{
1956
+ readonly type: Schema.Literal<"custom">;
1957
+ readonly actorType: Schema.String;
1958
+ readonly actorReference: Schema.optional<Schema.String>;
1959
+ }>]>;
1960
+ readonly type: Schema.Literal<"auth.identity.revoked">;
1961
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
1962
+ readonly identityId: Schema.brand<Schema.String, "auth/IdentityId">;
1963
+ readonly kind: Schema.String;
1964
+ readonly scope: Schema.Union<readonly [Schema.Struct<{
1965
+ readonly type: Schema.Literal<"global">;
1966
+ }>, Schema.Struct<{
1967
+ readonly type: Schema.Literal<"tenant">;
1968
+ readonly tenantId: Schema.String;
1969
+ }>]>;
1970
+ readonly reason: Schema.optional<Schema.String>;
1971
+ }>, Schema.Struct<{
1972
+ readonly id: Schema.optional<Schema.brand<Schema.String, "auth/AuditEventId">>;
1973
+ readonly request: Schema.optional<Schema.Struct<{
1974
+ readonly ipHash: Schema.optional<Schema.brand<Schema.String, "auth/IpHash">>;
1975
+ readonly userAgentHash: Schema.optional<Schema.brand<Schema.String, "auth/UserAgentHash">>;
1976
+ }>>;
1977
+ readonly occurredAt: Schema.brand<Schema.Number, "auth/UnixMillis">;
1978
+ readonly actor: Schema.Union<readonly [Schema.Struct<{
1979
+ readonly type: Schema.Literal<"anonymous">;
1980
+ }>, Schema.Struct<{
1981
+ readonly type: Schema.Literal<"user">;
1982
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
1983
+ readonly sessionId: Schema.optional<Schema.brand<Schema.String, "auth/SessionId">>;
1984
+ }>, Schema.Struct<{
1985
+ readonly type: Schema.Literal<"custom">;
1986
+ readonly actorType: Schema.String;
1987
+ readonly actorReference: Schema.optional<Schema.String>;
1988
+ }>]>;
1989
+ readonly type: Schema.Literal<"auth.login.succeeded">;
1990
+ readonly method: Schema.String;
1991
+ }>, Schema.Struct<{
1992
+ readonly id: Schema.optional<Schema.brand<Schema.String, "auth/AuditEventId">>;
1993
+ readonly request: Schema.optional<Schema.Struct<{
1994
+ readonly ipHash: Schema.optional<Schema.brand<Schema.String, "auth/IpHash">>;
1995
+ readonly userAgentHash: Schema.optional<Schema.brand<Schema.String, "auth/UserAgentHash">>;
1996
+ }>>;
1997
+ readonly occurredAt: Schema.brand<Schema.Number, "auth/UnixMillis">;
1998
+ readonly type: Schema.Literal<"auth.login.failed">;
1999
+ readonly subject: Schema.Union<readonly [Schema.Struct<{
2000
+ readonly type: Schema.Literal<"anonymous">;
2001
+ }>, Schema.Struct<{
2002
+ readonly type: Schema.Literal<"email">;
2003
+ readonly emailHash: Schema.brand<Schema.String, "auth/EmailHash">;
2004
+ }>, Schema.Struct<{
2005
+ readonly type: Schema.Literal<"user">;
2006
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
2007
+ }>]>;
2008
+ readonly method: Schema.String;
2009
+ readonly reason: Schema.String;
2010
+ }>, Schema.Struct<{
2011
+ readonly id: Schema.optional<Schema.brand<Schema.String, "auth/AuditEventId">>;
2012
+ readonly request: Schema.optional<Schema.Struct<{
2013
+ readonly ipHash: Schema.optional<Schema.brand<Schema.String, "auth/IpHash">>;
2014
+ readonly userAgentHash: Schema.optional<Schema.brand<Schema.String, "auth/UserAgentHash">>;
2015
+ }>>;
2016
+ readonly occurredAt: Schema.brand<Schema.Number, "auth/UnixMillis">;
2017
+ readonly actor: Schema.Union<readonly [Schema.Struct<{
2018
+ readonly type: Schema.Literal<"anonymous">;
2019
+ }>, Schema.Struct<{
2020
+ readonly type: Schema.Literal<"user">;
2021
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
2022
+ readonly sessionId: Schema.optional<Schema.brand<Schema.String, "auth/SessionId">>;
2023
+ }>, Schema.Struct<{
2024
+ readonly type: Schema.Literal<"custom">;
2025
+ readonly actorType: Schema.String;
2026
+ readonly actorReference: Schema.optional<Schema.String>;
2027
+ }>]>;
2028
+ readonly type: Schema.Literal<"auth.session.revoked">;
2029
+ readonly sessionId: Schema.brand<Schema.String, "auth/SessionId">;
2030
+ readonly reason: Schema.String;
2031
+ }>, Schema.Struct<{
2032
+ readonly id: Schema.optional<Schema.brand<Schema.String, "auth/AuditEventId">>;
2033
+ readonly request: Schema.optional<Schema.Struct<{
2034
+ readonly ipHash: Schema.optional<Schema.brand<Schema.String, "auth/IpHash">>;
2035
+ readonly userAgentHash: Schema.optional<Schema.brand<Schema.String, "auth/UserAgentHash">>;
2036
+ }>>;
2037
+ readonly occurredAt: Schema.brand<Schema.Number, "auth/UnixMillis">;
2038
+ readonly actor: Schema.Union<readonly [Schema.Struct<{
2039
+ readonly type: Schema.Literal<"anonymous">;
2040
+ }>, Schema.Struct<{
2041
+ readonly type: Schema.Literal<"user">;
2042
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
2043
+ readonly sessionId: Schema.optional<Schema.brand<Schema.String, "auth/SessionId">>;
2044
+ }>, Schema.Struct<{
2045
+ readonly type: Schema.Literal<"custom">;
2046
+ readonly actorType: Schema.String;
2047
+ readonly actorReference: Schema.optional<Schema.String>;
2048
+ }>]>;
2049
+ readonly type: Schema.Literal<"auth.risk.assessed">;
2050
+ readonly assessment: Schema.Struct<{
2051
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
2052
+ readonly method: Schema.String;
2053
+ readonly amr: Schema.$Array<Schema.String>;
2054
+ readonly aal: Schema.Literals<readonly ["aal1", "aal2", "aal3"]>;
2055
+ readonly device: Schema.Struct<{
2056
+ readonly status: Schema.Literals<readonly ["known", "new", "unknown"]>;
2057
+ }>;
2058
+ readonly risk: Schema.Struct<{
2059
+ readonly level: Schema.Literals<readonly ["unknown", "low", "medium", "high", "critical"]>;
2060
+ readonly signals: Schema.$Array<Schema.Struct<{
2061
+ readonly type: Schema.String;
2062
+ readonly level: Schema.optional<Schema.Literals<readonly ["unknown", "low", "medium", "high", "critical"]>>;
2063
+ }>>;
2064
+ }>;
2065
+ readonly metadata: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
2066
+ }>;
2067
+ }>, Schema.Struct<{
2068
+ readonly id: Schema.optional<Schema.brand<Schema.String, "auth/AuditEventId">>;
2069
+ readonly request: Schema.optional<Schema.Struct<{
2070
+ readonly ipHash: Schema.optional<Schema.brand<Schema.String, "auth/IpHash">>;
2071
+ readonly userAgentHash: Schema.optional<Schema.brand<Schema.String, "auth/UserAgentHash">>;
2072
+ }>>;
2073
+ readonly occurredAt: Schema.brand<Schema.Number, "auth/UnixMillis">;
2074
+ readonly actor: Schema.Union<readonly [Schema.Struct<{
2075
+ readonly type: Schema.Literal<"anonymous">;
2076
+ }>, Schema.Struct<{
2077
+ readonly type: Schema.Literal<"user">;
2078
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
2079
+ readonly sessionId: Schema.optional<Schema.brand<Schema.String, "auth/SessionId">>;
2080
+ }>, Schema.Struct<{
2081
+ readonly type: Schema.Literal<"custom">;
2082
+ readonly actorType: Schema.String;
2083
+ readonly actorReference: Schema.optional<Schema.String>;
2084
+ }>]>;
2085
+ readonly type: Schema.Literal<"auth.policy.denied">;
2086
+ readonly policyId: Schema.brand<Schema.String, "auth/PolicyId">;
2087
+ readonly reason: Schema.String;
2088
+ }>, Schema.Struct<{
2089
+ readonly id: Schema.optional<Schema.brand<Schema.String, "auth/AuditEventId">>;
2090
+ readonly request: Schema.optional<Schema.Struct<{
2091
+ readonly ipHash: Schema.optional<Schema.brand<Schema.String, "auth/IpHash">>;
2092
+ readonly userAgentHash: Schema.optional<Schema.brand<Schema.String, "auth/UserAgentHash">>;
2093
+ }>>;
2094
+ readonly occurredAt: Schema.brand<Schema.Number, "auth/UnixMillis">;
2095
+ readonly actor: Schema.Union<readonly [Schema.Struct<{
2096
+ readonly type: Schema.Literal<"anonymous">;
2097
+ }>, Schema.Struct<{
2098
+ readonly type: Schema.Literal<"user">;
2099
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
2100
+ readonly sessionId: Schema.optional<Schema.brand<Schema.String, "auth/SessionId">>;
2101
+ }>, Schema.Struct<{
2102
+ readonly type: Schema.Literal<"custom">;
2103
+ readonly actorType: Schema.String;
2104
+ readonly actorReference: Schema.optional<Schema.String>;
2105
+ }>]>;
2106
+ readonly type: Schema.Literals<readonly ["auth.oauth.account.linked", "auth.oauth.account.unlinked"]>;
2107
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
2108
+ readonly accountId: Schema.brand<Schema.String, "auth/OAuthAccountId">;
2109
+ readonly providerId: Schema.brand<Schema.String, "auth/OAuthProviderId">;
2110
+ readonly providerAccountId: Schema.String;
2111
+ readonly reason: Schema.String;
2112
+ }>, Schema.Struct<{
2113
+ readonly id: Schema.optional<Schema.brand<Schema.String, "auth/AuditEventId">>;
2114
+ readonly request: Schema.optional<Schema.Struct<{
2115
+ readonly ipHash: Schema.optional<Schema.brand<Schema.String, "auth/IpHash">>;
2116
+ readonly userAgentHash: Schema.optional<Schema.brand<Schema.String, "auth/UserAgentHash">>;
2117
+ }>>;
2118
+ readonly occurredAt: Schema.brand<Schema.Number, "auth/UnixMillis">;
2119
+ readonly actor: Schema.Union<readonly [Schema.Struct<{
2120
+ readonly type: Schema.Literal<"anonymous">;
2121
+ }>, Schema.Struct<{
2122
+ readonly type: Schema.Literal<"user">;
2123
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
2124
+ readonly sessionId: Schema.optional<Schema.brand<Schema.String, "auth/SessionId">>;
2125
+ }>, Schema.Struct<{
2126
+ readonly type: Schema.Literal<"custom">;
2127
+ readonly actorType: Schema.String;
2128
+ readonly actorReference: Schema.optional<Schema.String>;
2129
+ }>]>;
2130
+ readonly type: Schema.Literals<readonly ["auth.oauth.link_confirmation.started", "auth.oauth.link_confirmation.confirmed"]>;
2131
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
2132
+ readonly challengeId: Schema.brand<Schema.String, "auth/ChallengeId">;
2133
+ readonly providerId: Schema.brand<Schema.String, "auth/OAuthProviderId">;
2134
+ readonly providerAccountId: Schema.String;
2135
+ readonly reason: Schema.String;
2136
+ }>, Schema.Struct<{
2137
+ readonly id: Schema.optional<Schema.brand<Schema.String, "auth/AuditEventId">>;
2138
+ readonly request: Schema.optional<Schema.Struct<{
2139
+ readonly ipHash: Schema.optional<Schema.brand<Schema.String, "auth/IpHash">>;
2140
+ readonly userAgentHash: Schema.optional<Schema.brand<Schema.String, "auth/UserAgentHash">>;
2141
+ }>>;
2142
+ readonly occurredAt: Schema.brand<Schema.Number, "auth/UnixMillis">;
2143
+ readonly actor: Schema.Union<readonly [Schema.Struct<{
2144
+ readonly type: Schema.Literal<"anonymous">;
2145
+ }>, Schema.Struct<{
2146
+ readonly type: Schema.Literal<"user">;
2147
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
2148
+ readonly sessionId: Schema.optional<Schema.brand<Schema.String, "auth/SessionId">>;
2149
+ }>, Schema.Struct<{
2150
+ readonly type: Schema.Literal<"custom">;
2151
+ readonly actorType: Schema.String;
2152
+ readonly actorReference: Schema.optional<Schema.String>;
2153
+ }>]>;
2154
+ readonly type: Schema.Literal<"auth.oauth.provider_token.refreshed">;
2155
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
2156
+ readonly accountId: Schema.brand<Schema.String, "auth/OAuthAccountId">;
2157
+ readonly providerId: Schema.brand<Schema.String, "auth/OAuthProviderId">;
2158
+ readonly providerAccountId: Schema.String;
2159
+ }>, Schema.Struct<{
2160
+ readonly id: Schema.optional<Schema.brand<Schema.String, "auth/AuditEventId">>;
2161
+ readonly request: Schema.optional<Schema.Struct<{
2162
+ readonly ipHash: Schema.optional<Schema.brand<Schema.String, "auth/IpHash">>;
2163
+ readonly userAgentHash: Schema.optional<Schema.brand<Schema.String, "auth/UserAgentHash">>;
2164
+ }>>;
2165
+ readonly occurredAt: Schema.brand<Schema.Number, "auth/UnixMillis">;
2166
+ readonly actor: Schema.Union<readonly [Schema.Struct<{
2167
+ readonly type: Schema.Literal<"anonymous">;
2168
+ }>, Schema.Struct<{
2169
+ readonly type: Schema.Literal<"user">;
2170
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
2171
+ readonly sessionId: Schema.optional<Schema.brand<Schema.String, "auth/SessionId">>;
2172
+ }>, Schema.Struct<{
2173
+ readonly type: Schema.Literal<"custom">;
2174
+ readonly actorType: Schema.String;
2175
+ readonly actorReference: Schema.optional<Schema.String>;
2176
+ }>]>;
2177
+ readonly type: Schema.Literal<"auth.oauth.provider_token.revoked">;
2178
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
2179
+ readonly accountId: Schema.brand<Schema.String, "auth/OAuthAccountId">;
2180
+ readonly providerId: Schema.brand<Schema.String, "auth/OAuthProviderId">;
2181
+ readonly providerAccountId: Schema.String;
2182
+ readonly reason: Schema.String;
2183
+ }>, Schema.Struct<{
2184
+ readonly id: Schema.optional<Schema.brand<Schema.String, "auth/AuditEventId">>;
2185
+ readonly request: Schema.optional<Schema.Struct<{
2186
+ readonly ipHash: Schema.optional<Schema.brand<Schema.String, "auth/IpHash">>;
2187
+ readonly userAgentHash: Schema.optional<Schema.brand<Schema.String, "auth/UserAgentHash">>;
2188
+ }>>;
2189
+ readonly occurredAt: Schema.brand<Schema.Number, "auth/UnixMillis">;
2190
+ readonly actor: Schema.Union<readonly [Schema.Struct<{
2191
+ readonly type: Schema.Literal<"anonymous">;
2192
+ }>, Schema.Struct<{
2193
+ readonly type: Schema.Literal<"user">;
2194
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
2195
+ readonly sessionId: Schema.optional<Schema.brand<Schema.String, "auth/SessionId">>;
2196
+ }>, Schema.Struct<{
2197
+ readonly type: Schema.Literal<"custom">;
2198
+ readonly actorType: Schema.String;
2199
+ readonly actorReference: Schema.optional<Schema.String>;
2200
+ }>]>;
2201
+ readonly type: Schema.Literal<"auth.passkey.credential.revoked">;
2202
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
2203
+ readonly credentialId: Schema.brand<Schema.String, "auth/PasskeyCredentialId">;
2204
+ readonly reason: Schema.String;
2205
+ }>, Schema.Struct<{
2206
+ readonly id: Schema.optional<Schema.brand<Schema.String, "auth/AuditEventId">>;
2207
+ readonly request: Schema.optional<Schema.Struct<{
2208
+ readonly ipHash: Schema.optional<Schema.brand<Schema.String, "auth/IpHash">>;
2209
+ readonly userAgentHash: Schema.optional<Schema.brand<Schema.String, "auth/UserAgentHash">>;
2210
+ }>>;
2211
+ readonly occurredAt: Schema.brand<Schema.Number, "auth/UnixMillis">;
2212
+ readonly actor: Schema.Union<readonly [Schema.Struct<{
2213
+ readonly type: Schema.Literal<"anonymous">;
2214
+ }>, Schema.Struct<{
2215
+ readonly type: Schema.Literal<"user">;
2216
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
2217
+ readonly sessionId: Schema.optional<Schema.brand<Schema.String, "auth/SessionId">>;
2218
+ }>, Schema.Struct<{
2219
+ readonly type: Schema.Literal<"custom">;
2220
+ readonly actorType: Schema.String;
2221
+ readonly actorReference: Schema.optional<Schema.String>;
2222
+ }>]>;
2223
+ readonly type: Schema.Literals<readonly ["auth.totp.enrollment.started", "auth.totp.factor.confirmed", "auth.totp.factor.verified"]>;
2224
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
2225
+ readonly factorId: Schema.brand<Schema.String, "auth/CredentialId">;
2226
+ }>, Schema.Struct<{
2227
+ readonly id: Schema.optional<Schema.brand<Schema.String, "auth/AuditEventId">>;
2228
+ readonly request: Schema.optional<Schema.Struct<{
2229
+ readonly ipHash: Schema.optional<Schema.brand<Schema.String, "auth/IpHash">>;
2230
+ readonly userAgentHash: Schema.optional<Schema.brand<Schema.String, "auth/UserAgentHash">>;
2231
+ }>>;
2232
+ readonly occurredAt: Schema.brand<Schema.Number, "auth/UnixMillis">;
2233
+ readonly actor: Schema.Union<readonly [Schema.Struct<{
2234
+ readonly type: Schema.Literal<"anonymous">;
2235
+ }>, Schema.Struct<{
2236
+ readonly type: Schema.Literal<"user">;
2237
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
2238
+ readonly sessionId: Schema.optional<Schema.brand<Schema.String, "auth/SessionId">>;
2239
+ }>, Schema.Struct<{
2240
+ readonly type: Schema.Literal<"custom">;
2241
+ readonly actorType: Schema.String;
2242
+ readonly actorReference: Schema.optional<Schema.String>;
2243
+ }>]>;
2244
+ readonly type: Schema.Literal<"auth.totp.factor.revoked">;
2245
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
2246
+ readonly factorId: Schema.brand<Schema.String, "auth/CredentialId">;
2247
+ readonly reason: Schema.String;
2248
+ }>, Schema.Struct<{
2249
+ readonly id: Schema.optional<Schema.brand<Schema.String, "auth/AuditEventId">>;
2250
+ readonly request: Schema.optional<Schema.Struct<{
2251
+ readonly ipHash: Schema.optional<Schema.brand<Schema.String, "auth/IpHash">>;
2252
+ readonly userAgentHash: Schema.optional<Schema.brand<Schema.String, "auth/UserAgentHash">>;
2253
+ }>>;
2254
+ readonly occurredAt: Schema.brand<Schema.Number, "auth/UnixMillis">;
2255
+ readonly actor: Schema.Union<readonly [Schema.Struct<{
2256
+ readonly type: Schema.Literal<"anonymous">;
2257
+ }>, Schema.Struct<{
2258
+ readonly type: Schema.Literal<"user">;
2259
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
2260
+ readonly sessionId: Schema.optional<Schema.brand<Schema.String, "auth/SessionId">>;
2261
+ }>, Schema.Struct<{
2262
+ readonly type: Schema.Literal<"custom">;
2263
+ readonly actorType: Schema.String;
2264
+ readonly actorReference: Schema.optional<Schema.String>;
2265
+ }>]>;
2266
+ readonly type: Schema.Literal<"auth.recovery_code.generated">;
2267
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
2268
+ readonly count: Schema.Number;
2269
+ }>, Schema.Struct<{
2270
+ readonly id: Schema.optional<Schema.brand<Schema.String, "auth/AuditEventId">>;
2271
+ readonly request: Schema.optional<Schema.Struct<{
2272
+ readonly ipHash: Schema.optional<Schema.brand<Schema.String, "auth/IpHash">>;
2273
+ readonly userAgentHash: Schema.optional<Schema.brand<Schema.String, "auth/UserAgentHash">>;
2274
+ }>>;
2275
+ readonly occurredAt: Schema.brand<Schema.Number, "auth/UnixMillis">;
2276
+ readonly actor: Schema.Union<readonly [Schema.Struct<{
2277
+ readonly type: Schema.Literal<"anonymous">;
2278
+ }>, Schema.Struct<{
2279
+ readonly type: Schema.Literal<"user">;
2280
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
2281
+ readonly sessionId: Schema.optional<Schema.brand<Schema.String, "auth/SessionId">>;
2282
+ }>, Schema.Struct<{
2283
+ readonly type: Schema.Literal<"custom">;
2284
+ readonly actorType: Schema.String;
2285
+ readonly actorReference: Schema.optional<Schema.String>;
2286
+ }>]>;
2287
+ readonly type: Schema.Literal<"auth.recovery_code.verified">;
2288
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
2289
+ readonly codeId: Schema.brand<Schema.String, "auth/CredentialId">;
2290
+ }>, Schema.Struct<{
2291
+ readonly id: Schema.optional<Schema.brand<Schema.String, "auth/AuditEventId">>;
2292
+ readonly request: Schema.optional<Schema.Struct<{
2293
+ readonly ipHash: Schema.optional<Schema.brand<Schema.String, "auth/IpHash">>;
2294
+ readonly userAgentHash: Schema.optional<Schema.brand<Schema.String, "auth/UserAgentHash">>;
2295
+ }>>;
2296
+ readonly occurredAt: Schema.brand<Schema.Number, "auth/UnixMillis">;
2297
+ readonly actor: Schema.Union<readonly [Schema.Struct<{
2298
+ readonly type: Schema.Literal<"anonymous">;
2299
+ }>, Schema.Struct<{
2300
+ readonly type: Schema.Literal<"user">;
2301
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
2302
+ readonly sessionId: Schema.optional<Schema.brand<Schema.String, "auth/SessionId">>;
2303
+ }>, Schema.Struct<{
2304
+ readonly type: Schema.Literal<"custom">;
2305
+ readonly actorType: Schema.String;
2306
+ readonly actorReference: Schema.optional<Schema.String>;
2307
+ }>]>;
2308
+ readonly type: Schema.Literal<"auth.recovery_code.revoked">;
2309
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
2310
+ readonly codeId: Schema.brand<Schema.String, "auth/CredentialId">;
2311
+ readonly reason: Schema.String;
2312
+ }>, Schema.Struct<{
2313
+ readonly id: Schema.optional<Schema.brand<Schema.String, "auth/AuditEventId">>;
2314
+ readonly request: Schema.optional<Schema.Struct<{
2315
+ readonly ipHash: Schema.optional<Schema.brand<Schema.String, "auth/IpHash">>;
2316
+ readonly userAgentHash: Schema.optional<Schema.brand<Schema.String, "auth/UserAgentHash">>;
2317
+ }>>;
2318
+ readonly occurredAt: Schema.brand<Schema.Number, "auth/UnixMillis">;
2319
+ readonly actor: Schema.Union<readonly [Schema.Struct<{
2320
+ readonly type: Schema.Literal<"anonymous">;
2321
+ }>, Schema.Struct<{
2322
+ readonly type: Schema.Literal<"user">;
2323
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
2324
+ readonly sessionId: Schema.optional<Schema.brand<Schema.String, "auth/SessionId">>;
2325
+ }>, Schema.Struct<{
2326
+ readonly type: Schema.Literal<"custom">;
2327
+ readonly actorType: Schema.String;
2328
+ readonly actorReference: Schema.optional<Schema.String>;
2329
+ }>]>;
2330
+ readonly type: Schema.Literals<readonly ["auth.api_key.created", "auth.api_key.verified"]>;
2331
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
2332
+ readonly keyId: Schema.brand<Schema.String, "auth/ApiKeyId">;
2333
+ readonly scopes: Schema.$Array<Schema.String>;
2334
+ }>, Schema.Struct<{
2335
+ readonly id: Schema.optional<Schema.brand<Schema.String, "auth/AuditEventId">>;
2336
+ readonly request: Schema.optional<Schema.Struct<{
2337
+ readonly ipHash: Schema.optional<Schema.brand<Schema.String, "auth/IpHash">>;
2338
+ readonly userAgentHash: Schema.optional<Schema.brand<Schema.String, "auth/UserAgentHash">>;
2339
+ }>>;
2340
+ readonly occurredAt: Schema.brand<Schema.Number, "auth/UnixMillis">;
2341
+ readonly actor: Schema.Union<readonly [Schema.Struct<{
2342
+ readonly type: Schema.Literal<"anonymous">;
2343
+ }>, Schema.Struct<{
2344
+ readonly type: Schema.Literal<"user">;
2345
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
2346
+ readonly sessionId: Schema.optional<Schema.brand<Schema.String, "auth/SessionId">>;
2347
+ }>, Schema.Struct<{
2348
+ readonly type: Schema.Literal<"custom">;
2349
+ readonly actorType: Schema.String;
2350
+ readonly actorReference: Schema.optional<Schema.String>;
2351
+ }>]>;
2352
+ readonly type: Schema.Literal<"auth.api_key.revoked">;
2353
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
2354
+ readonly keyId: Schema.brand<Schema.String, "auth/ApiKeyId">;
2355
+ readonly reason: Schema.String;
2356
+ }>, Schema.Struct<{
2357
+ readonly id: Schema.optional<Schema.brand<Schema.String, "auth/AuditEventId">>;
2358
+ readonly request: Schema.optional<Schema.Struct<{
2359
+ readonly ipHash: Schema.optional<Schema.brand<Schema.String, "auth/IpHash">>;
2360
+ readonly userAgentHash: Schema.optional<Schema.brand<Schema.String, "auth/UserAgentHash">>;
2361
+ }>>;
2362
+ readonly occurredAt: Schema.brand<Schema.Number, "auth/UnixMillis">;
2363
+ readonly actor: Schema.Union<readonly [Schema.Struct<{
2364
+ readonly type: Schema.Literal<"anonymous">;
2365
+ }>, Schema.Struct<{
2366
+ readonly type: Schema.Literal<"user">;
2367
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
2368
+ readonly sessionId: Schema.optional<Schema.brand<Schema.String, "auth/SessionId">>;
2369
+ }>, Schema.Struct<{
2370
+ readonly type: Schema.Literal<"custom">;
2371
+ readonly actorType: Schema.String;
2372
+ readonly actorReference: Schema.optional<Schema.String>;
2373
+ }>]>;
2374
+ readonly type: Schema.Literal<"auth.api_key.verification_failed">;
2375
+ readonly reason: Schema.String;
2376
+ }>, Schema.Struct<{
2377
+ readonly id: Schema.optional<Schema.brand<Schema.String, "auth/AuditEventId">>;
2378
+ readonly request: Schema.optional<Schema.Struct<{
2379
+ readonly ipHash: Schema.optional<Schema.brand<Schema.String, "auth/IpHash">>;
2380
+ readonly userAgentHash: Schema.optional<Schema.brand<Schema.String, "auth/UserAgentHash">>;
2381
+ }>>;
2382
+ readonly occurredAt: Schema.brand<Schema.Number, "auth/UnixMillis">;
2383
+ readonly actor: Schema.Union<readonly [Schema.Struct<{
2384
+ readonly type: Schema.Literal<"anonymous">;
2385
+ }>, Schema.Struct<{
2386
+ readonly type: Schema.Literal<"user">;
2387
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
2388
+ readonly sessionId: Schema.optional<Schema.brand<Schema.String, "auth/SessionId">>;
2389
+ }>, Schema.Struct<{
2390
+ readonly type: Schema.Literal<"custom">;
2391
+ readonly actorType: Schema.String;
2392
+ readonly actorReference: Schema.optional<Schema.String>;
2393
+ }>]>;
2394
+ readonly type: Schema.Literal<"auth.refresh_token.issued">;
2395
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
2396
+ readonly tokenId: Schema.brand<Schema.String, "auth/RefreshTokenId">;
2397
+ readonly familyId: Schema.brand<Schema.String, "auth/RefreshTokenFamilyId">;
2398
+ readonly expiresAt: Schema.brand<Schema.Number, "auth/UnixMillis">;
2399
+ }>, Schema.Struct<{
2400
+ readonly id: Schema.optional<Schema.brand<Schema.String, "auth/AuditEventId">>;
2401
+ readonly request: Schema.optional<Schema.Struct<{
2402
+ readonly ipHash: Schema.optional<Schema.brand<Schema.String, "auth/IpHash">>;
2403
+ readonly userAgentHash: Schema.optional<Schema.brand<Schema.String, "auth/UserAgentHash">>;
2404
+ }>>;
2405
+ readonly occurredAt: Schema.brand<Schema.Number, "auth/UnixMillis">;
2406
+ readonly actor: Schema.Union<readonly [Schema.Struct<{
2407
+ readonly type: Schema.Literal<"anonymous">;
2408
+ }>, Schema.Struct<{
2409
+ readonly type: Schema.Literal<"user">;
2410
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
2411
+ readonly sessionId: Schema.optional<Schema.brand<Schema.String, "auth/SessionId">>;
2412
+ }>, Schema.Struct<{
2413
+ readonly type: Schema.Literal<"custom">;
2414
+ readonly actorType: Schema.String;
2415
+ readonly actorReference: Schema.optional<Schema.String>;
2416
+ }>]>;
2417
+ readonly type: Schema.Literal<"auth.refresh_token.rotated">;
2418
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
2419
+ readonly previousTokenId: Schema.brand<Schema.String, "auth/RefreshTokenId">;
2420
+ readonly tokenId: Schema.brand<Schema.String, "auth/RefreshTokenId">;
2421
+ readonly familyId: Schema.brand<Schema.String, "auth/RefreshTokenFamilyId">;
2422
+ readonly expiresAt: Schema.brand<Schema.Number, "auth/UnixMillis">;
2423
+ }>, Schema.Struct<{
2424
+ readonly id: Schema.optional<Schema.brand<Schema.String, "auth/AuditEventId">>;
2425
+ readonly request: Schema.optional<Schema.Struct<{
2426
+ readonly ipHash: Schema.optional<Schema.brand<Schema.String, "auth/IpHash">>;
2427
+ readonly userAgentHash: Schema.optional<Schema.brand<Schema.String, "auth/UserAgentHash">>;
2428
+ }>>;
2429
+ readonly occurredAt: Schema.brand<Schema.Number, "auth/UnixMillis">;
2430
+ readonly actor: Schema.Union<readonly [Schema.Struct<{
2431
+ readonly type: Schema.Literal<"anonymous">;
2432
+ }>, Schema.Struct<{
2433
+ readonly type: Schema.Literal<"user">;
2434
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
2435
+ readonly sessionId: Schema.optional<Schema.brand<Schema.String, "auth/SessionId">>;
2436
+ }>, Schema.Struct<{
2437
+ readonly type: Schema.Literal<"custom">;
2438
+ readonly actorType: Schema.String;
2439
+ readonly actorReference: Schema.optional<Schema.String>;
2440
+ }>]>;
2441
+ readonly type: Schema.Literal<"auth.refresh_token.reuse_detected">;
2442
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
2443
+ readonly tokenId: Schema.brand<Schema.String, "auth/RefreshTokenId">;
2444
+ readonly familyId: Schema.brand<Schema.String, "auth/RefreshTokenFamilyId">;
2445
+ }>, Schema.Struct<{
2446
+ readonly id: Schema.optional<Schema.brand<Schema.String, "auth/AuditEventId">>;
2447
+ readonly request: Schema.optional<Schema.Struct<{
2448
+ readonly ipHash: Schema.optional<Schema.brand<Schema.String, "auth/IpHash">>;
2449
+ readonly userAgentHash: Schema.optional<Schema.brand<Schema.String, "auth/UserAgentHash">>;
2450
+ }>>;
2451
+ readonly occurredAt: Schema.brand<Schema.Number, "auth/UnixMillis">;
2452
+ readonly actor: Schema.Union<readonly [Schema.Struct<{
2453
+ readonly type: Schema.Literal<"anonymous">;
2454
+ }>, Schema.Struct<{
2455
+ readonly type: Schema.Literal<"user">;
2456
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
2457
+ readonly sessionId: Schema.optional<Schema.brand<Schema.String, "auth/SessionId">>;
2458
+ }>, Schema.Struct<{
2459
+ readonly type: Schema.Literal<"custom">;
2460
+ readonly actorType: Schema.String;
2461
+ readonly actorReference: Schema.optional<Schema.String>;
2462
+ }>]>;
2463
+ readonly type: Schema.Literal<"auth.refresh_token.revoked">;
2464
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
2465
+ readonly familyId: Schema.brand<Schema.String, "auth/RefreshTokenFamilyId">;
2466
+ readonly tokenId: Schema.optional<Schema.brand<Schema.String, "auth/RefreshTokenId">>;
2467
+ readonly reason: Schema.String;
2468
+ }>, Schema.Struct<{
2469
+ readonly id: Schema.optional<Schema.brand<Schema.String, "auth/AuditEventId">>;
2470
+ readonly request: Schema.optional<Schema.Struct<{
2471
+ readonly ipHash: Schema.optional<Schema.brand<Schema.String, "auth/IpHash">>;
2472
+ readonly userAgentHash: Schema.optional<Schema.brand<Schema.String, "auth/UserAgentHash">>;
2473
+ }>>;
2474
+ readonly occurredAt: Schema.brand<Schema.Number, "auth/UnixMillis">;
2475
+ readonly actor: Schema.Union<readonly [Schema.Struct<{
2476
+ readonly type: Schema.Literal<"anonymous">;
2477
+ }>, Schema.Struct<{
2478
+ readonly type: Schema.Literal<"user">;
2479
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
2480
+ readonly sessionId: Schema.optional<Schema.brand<Schema.String, "auth/SessionId">>;
2481
+ }>, Schema.Struct<{
2482
+ readonly type: Schema.Literal<"custom">;
2483
+ readonly actorType: Schema.String;
2484
+ readonly actorReference: Schema.optional<Schema.String>;
2485
+ }>]>;
2486
+ readonly type: Schema.Literal<"auth.incident_action.executed">;
2487
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
2488
+ readonly result: Schema.Struct<{
2489
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
2490
+ readonly reason: Schema.optional<Schema.String>;
2491
+ readonly sessions: Schema.optional<Schema.Struct<{
2492
+ readonly revokedAll: Schema.Literal<true>;
2493
+ readonly activeBefore: Schema.Number;
2494
+ readonly sessionIds: Schema.$Array<Schema.brand<Schema.String, "auth/SessionId">>;
2495
+ }>>;
2496
+ readonly trustedDevices: Schema.optional<Schema.Struct<{
2497
+ readonly revoked: Schema.Number;
2498
+ readonly deviceIds: Schema.$Array<Schema.String>;
2499
+ }>>;
2500
+ readonly apiKeys: Schema.optional<Schema.Struct<{
2501
+ readonly revoked: Schema.Number;
2502
+ readonly keyIds: Schema.$Array<Schema.brand<Schema.String, "auth/ApiKeyId">>;
2503
+ }>>;
2504
+ readonly refreshTokens: Schema.optional<Schema.Struct<{
2505
+ readonly revokedFamilies: Schema.Number;
2506
+ readonly activeBefore: Schema.Number;
2507
+ readonly tokenIds: Schema.$Array<Schema.brand<Schema.String, "auth/RefreshTokenId">>;
2508
+ readonly familyIds: Schema.$Array<Schema.brand<Schema.String, "auth/RefreshTokenFamilyId">>;
2509
+ }>>;
2510
+ }>;
2511
+ }>, Schema.Struct<{
2512
+ readonly id: Schema.optional<Schema.brand<Schema.String, "auth/AuditEventId">>;
2513
+ readonly request: Schema.optional<Schema.Struct<{
2514
+ readonly ipHash: Schema.optional<Schema.brand<Schema.String, "auth/IpHash">>;
2515
+ readonly userAgentHash: Schema.optional<Schema.brand<Schema.String, "auth/UserAgentHash">>;
2516
+ }>>;
2517
+ readonly occurredAt: Schema.brand<Schema.Number, "auth/UnixMillis">;
2518
+ readonly actor: Schema.Union<readonly [Schema.Struct<{
2519
+ readonly type: Schema.Literal<"anonymous">;
2520
+ }>, Schema.Struct<{
2521
+ readonly type: Schema.Literal<"user">;
2522
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
2523
+ readonly sessionId: Schema.optional<Schema.brand<Schema.String, "auth/SessionId">>;
2524
+ }>, Schema.Struct<{
2525
+ readonly type: Schema.Literal<"custom">;
2526
+ readonly actorType: Schema.String;
2527
+ readonly actorReference: Schema.optional<Schema.String>;
2528
+ }>]>;
2529
+ readonly type: Schema.Literal<"auth.jwt.introspected">;
2530
+ readonly active: Schema.Boolean;
2531
+ readonly jwtId: Schema.optional<Schema.String>;
2532
+ readonly expiresAt: Schema.optional<Schema.brand<Schema.Number, "auth/UnixMillis">>;
2533
+ readonly reason: Schema.optional<Schema.String>;
2534
+ }>, Schema.Struct<{
2535
+ readonly id: Schema.optional<Schema.brand<Schema.String, "auth/AuditEventId">>;
2536
+ readonly request: Schema.optional<Schema.Struct<{
2537
+ readonly ipHash: Schema.optional<Schema.brand<Schema.String, "auth/IpHash">>;
2538
+ readonly userAgentHash: Schema.optional<Schema.brand<Schema.String, "auth/UserAgentHash">>;
2539
+ }>>;
2540
+ readonly occurredAt: Schema.brand<Schema.Number, "auth/UnixMillis">;
2541
+ readonly actor: Schema.Union<readonly [Schema.Struct<{
2542
+ readonly type: Schema.Literal<"anonymous">;
2543
+ }>, Schema.Struct<{
2544
+ readonly type: Schema.Literal<"user">;
2545
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
2546
+ readonly sessionId: Schema.optional<Schema.brand<Schema.String, "auth/SessionId">>;
2547
+ }>, Schema.Struct<{
2548
+ readonly type: Schema.Literal<"custom">;
2549
+ readonly actorType: Schema.String;
2550
+ readonly actorReference: Schema.optional<Schema.String>;
2551
+ }>]>;
2552
+ readonly type: Schema.Literal<"auth.jwt.revoked">;
2553
+ readonly jwtId: Schema.String;
2554
+ readonly expiresAt: Schema.optional<Schema.brand<Schema.Number, "auth/UnixMillis">>;
2555
+ readonly reason: Schema.String;
2556
+ }>]>, Schema.Struct<{
2557
+ readonly type: Schema.TemplateLiteral<readonly ["app.", Schema.String]>;
2558
+ readonly version: Schema.Int;
2559
+ readonly id: Schema.optional<Schema.brand<Schema.String, "auth/AuditEventId">>;
2560
+ readonly actor: Schema.Union<readonly [Schema.Struct<{
2561
+ readonly type: Schema.Literal<"anonymous">;
2562
+ }>, Schema.Struct<{
2563
+ readonly type: Schema.Literal<"user">;
2564
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
2565
+ readonly sessionId: Schema.optional<Schema.brand<Schema.String, "auth/SessionId">>;
2566
+ }>, Schema.Struct<{
2567
+ readonly type: Schema.Literal<"custom">;
2568
+ readonly actorType: Schema.String;
2569
+ readonly actorReference: Schema.optional<Schema.String>;
2570
+ }>]>;
2571
+ readonly subject: Schema.optional<Schema.Union<readonly [Schema.Struct<{
2572
+ readonly type: Schema.Literal<"anonymous">;
2573
+ }>, Schema.Struct<{
2574
+ readonly type: Schema.Literal<"email">;
2575
+ readonly emailHash: Schema.brand<Schema.String, "auth/EmailHash">;
2576
+ }>, Schema.Struct<{
2577
+ readonly type: Schema.Literal<"user">;
2578
+ readonly userId: Schema.brand<Schema.String, "auth/UserId">;
2579
+ }>]>>;
2580
+ readonly request: Schema.optional<Schema.Struct<{
2581
+ readonly ipHash: Schema.optional<Schema.brand<Schema.String, "auth/IpHash">>;
2582
+ readonly userAgentHash: Schema.optional<Schema.brand<Schema.String, "auth/UserAgentHash">>;
2583
+ }>>;
2584
+ readonly payload: Schema.$Record<Schema.String, Schema.Unknown>;
2585
+ readonly occurredAt: Schema.brand<Schema.Number, "auth/UnixMillis">;
2586
+ }>]>;
2587
+ export declare const decodeAuditEvent: (input: unknown) => AuditEvent;
2588
+ export declare const isAuthAuditEvent: (event: AuditEvent) => event is AuthAuditEvent;
330
2589
  export interface AuditLogService {
331
- readonly emit: (event: AuthAuditEvent) => Effect.Effect<void, AuditLogError>;
2590
+ readonly emit: (event: AuditEvent) => Effect.Effect<void, AuditLogError>;
332
2591
  }
333
2592
  export interface AuditLogListInput {
334
2593
  readonly userId?: UserId;
335
- readonly types?: readonly AuthAuditEvent["type"][];
2594
+ readonly types?: readonly AuditEvent["type"][];
336
2595
  readonly beforeOccurredAt?: UnixMillis;
337
2596
  readonly limit?: number;
338
2597
  }
@@ -341,68 +2600,71 @@ export interface AuditLogDeleteBeforeInput {
341
2600
  readonly userId?: UserId;
342
2601
  }
343
2602
  export interface AuditLogStoreService {
344
- readonly insert: (event: AuthAuditEvent) => Effect.Effect<void, AuditLogStoreError>;
345
- readonly list: (input?: AuditLogListInput) => Effect.Effect<readonly AuthAuditEvent[], AuditLogStoreError>;
2603
+ readonly insertMany: (events: readonly AuditEvent[]) => Effect.Effect<void, AuditLogStoreError>;
2604
+ readonly list: (input?: AuditLogListInput) => Effect.Effect<readonly AuditEvent[], AuditLogStoreError>;
346
2605
  readonly deleteBefore: (input: AuditLogDeleteBeforeInput) => Effect.Effect<number, AuditLogStoreError>;
347
2606
  }
348
2607
  declare const AuditLog_base: Context.ServiceClass<AuditLog, "auth/AuditLog", AuditLogService>;
349
2608
  export declare class AuditLog extends AuditLog_base {
350
2609
  }
351
- export declare namespace AuditLog {
352
- const make: (service: AuditLogService) => AuditLogService;
353
- }
354
2610
  declare const AuditLogStore_base: Context.ServiceClass<AuditLogStore, "auth/AuditLogStore", AuditLogStoreService>;
355
2611
  export declare class AuditLogStore extends AuditLogStore_base {
356
2612
  }
357
- export declare namespace AuditLogStore {
358
- const make: (service: AuditLogStoreService) => AuditLogStoreService;
359
- }
360
2613
  export type AuditEventInput<Type extends AuthAuditEvent["type"]> = Omit<Extract<AuthAuditEvent, {
361
2614
  readonly type: Type;
362
2615
  }>, "type" | "occurredAt"> & {
363
2616
  readonly occurredAt?: UnixMillis;
364
2617
  };
365
- export declare const auditEventUserId: (event: AuthAuditEvent) => UserId | undefined;
366
- export declare const auditEventActorUserId: (event: AuthAuditEvent) => UserId | undefined;
367
- export declare const filterAuditLogEvents: (events: Iterable<AuthAuditEvent>, input?: AuditLogListInput) => readonly AuthAuditEvent[];
368
- export declare const makeAuditLogFromStore: (store: AuditLogStoreService) => AuditLogService;
369
- export declare const emit: (event: AuthAuditEvent) => Effect.Effect<void, AuditLogError, AuditLog>;
370
- export declare const insertAuditLogEvent: (event: AuthAuditEvent) => Effect.Effect<void, AuditLogStoreError, AuditLogStore>;
371
- export declare const listAuditLogEvents: (input?: AuditLogListInput) => Effect.Effect<readonly AuthAuditEvent[], AuditLogStoreError, AuditLogStore>;
2618
+ export declare const auditEventUserId: (event: AuditEvent) => UserId | undefined;
2619
+ export declare const auditEventActorUserId: (event: AuditEvent) => UserId | undefined;
2620
+ export declare const filterAuditLogEvents: (events: Iterable<AuditEvent>, input?: AuditLogListInput) => readonly AuditEvent[];
2621
+ export declare const emit: (event: AuditEvent) => Effect.Effect<void>;
2622
+ export declare const emitRequired: (event: AuditEvent) => Effect.Effect<void, AuditLogError, AuditLog>;
2623
+ export declare const insertAuditLogEvents: (events: readonly AuditEvent[]) => Effect.Effect<void, AuditLogStoreError, AuditLogStore>;
2624
+ export declare const listAuditLogEvents: (input?: AuditLogListInput) => Effect.Effect<readonly AuditEvent[], AuditLogStoreError, AuditLogStore>;
372
2625
  export declare const deleteAuditLogEventsBefore: (input: AuditLogDeleteBeforeInput) => Effect.Effect<number, AuditLogStoreError, AuditLogStore>;
373
- export declare const loginSucceeded: (input: AuditEventInput<"auth.login.succeeded">) => Effect.Effect<void, AuditLogError, AuditLog>;
374
- export declare const loginFailed: (input: AuditEventInput<"auth.login.failed">) => Effect.Effect<void, AuditLogError, AuditLog>;
375
- export declare const sessionRevoked: (input: AuditEventInput<"auth.session.revoked">) => Effect.Effect<void, AuditLogError, AuditLog>;
376
- export declare const loginRiskAssessed: (input: AuditEventInput<"auth.risk.assessed">) => Effect.Effect<void, AuditLogError, AuditLog>;
377
- export declare const policyDenied: (input: AuditEventInput<"auth.policy.denied">) => Effect.Effect<void, AuditLogError, AuditLog>;
378
- export declare const oauthAccountLinked: (input: AuditEventInput<"auth.oauth.account.linked">) => Effect.Effect<void, AuditLogError, AuditLog>;
379
- export declare const oauthAccountUnlinked: (input: AuditEventInput<"auth.oauth.account.unlinked">) => Effect.Effect<void, AuditLogError, AuditLog>;
380
- export declare const oauthLinkConfirmationStarted: (input: AuditEventInput<"auth.oauth.link_confirmation.started">) => Effect.Effect<void, AuditLogError, AuditLog>;
381
- export declare const oauthLinkConfirmationConfirmed: (input: AuditEventInput<"auth.oauth.link_confirmation.confirmed">) => Effect.Effect<void, AuditLogError, AuditLog>;
382
- export declare const oauthProviderTokenRefreshed: (input: AuditEventInput<"auth.oauth.provider_token.refreshed">) => Effect.Effect<void, AuditLogError, AuditLog>;
383
- export declare const oauthProviderTokenRevoked: (input: AuditEventInput<"auth.oauth.provider_token.revoked">) => Effect.Effect<void, AuditLogError, AuditLog>;
384
- export declare const passkeyCredentialRevoked: (input: AuditEventInput<"auth.passkey.credential.revoked">) => Effect.Effect<void, AuditLogError, AuditLog>;
385
- export declare const totpEnrollmentStarted: (input: AuditEventInput<"auth.totp.enrollment.started">) => Effect.Effect<void, AuditLogError, AuditLog>;
386
- export declare const totpFactorConfirmed: (input: AuditEventInput<"auth.totp.factor.confirmed">) => Effect.Effect<void, AuditLogError, AuditLog>;
387
- export declare const totpFactorVerified: (input: AuditEventInput<"auth.totp.factor.verified">) => Effect.Effect<void, AuditLogError, AuditLog>;
388
- export declare const totpFactorRevoked: (input: AuditEventInput<"auth.totp.factor.revoked">) => Effect.Effect<void, AuditLogError, AuditLog>;
389
- export declare const recoveryCodeGenerated: (input: AuditEventInput<"auth.recovery_code.generated">) => Effect.Effect<void, AuditLogError, AuditLog>;
390
- export declare const recoveryCodeVerified: (input: AuditEventInput<"auth.recovery_code.verified">) => Effect.Effect<void, AuditLogError, AuditLog>;
391
- export declare const recoveryCodeRevoked: (input: AuditEventInput<"auth.recovery_code.revoked">) => Effect.Effect<void, AuditLogError, AuditLog>;
392
- export declare const apiKeyCreated: (input: AuditEventInput<"auth.api_key.created">) => Effect.Effect<void, AuditLogError, AuditLog>;
393
- export declare const apiKeyVerified: (input: AuditEventInput<"auth.api_key.verified">) => Effect.Effect<void, AuditLogError, AuditLog>;
394
- export declare const apiKeyRevoked: (input: AuditEventInput<"auth.api_key.revoked">) => Effect.Effect<void, AuditLogError, AuditLog>;
395
- export declare const apiKeyVerificationFailed: (input: AuditEventInput<"auth.api_key.verification_failed">) => Effect.Effect<void, AuditLogError, AuditLog>;
396
- export declare const refreshTokenIssued: (input: AuditEventInput<"auth.refresh_token.issued">) => Effect.Effect<void, AuditLogError, AuditLog>;
397
- export declare const refreshTokenRotated: (input: AuditEventInput<"auth.refresh_token.rotated">) => Effect.Effect<void, AuditLogError, AuditLog>;
398
- export declare const refreshTokenReuseDetected: (input: AuditEventInput<"auth.refresh_token.reuse_detected">) => Effect.Effect<void, AuditLogError, AuditLog>;
399
- export declare const refreshTokenRevoked: (input: AuditEventInput<"auth.refresh_token.revoked">) => Effect.Effect<void, AuditLogError, AuditLog>;
400
- export declare const incidentActionExecuted: (input: AuditEventInput<"auth.incident_action.executed">) => Effect.Effect<void, AuditLogError, AuditLog>;
401
- export declare const jwtIntrospected: (input: AuditEventInput<"auth.jwt.introspected">) => Effect.Effect<void, AuditLogError, AuditLog>;
402
- export declare const jwtRevoked: (input: AuditEventInput<"auth.jwt.revoked">) => Effect.Effect<void, AuditLogError, AuditLog>;
2626
+ export declare const loginSucceeded: (input: AuditEventInput<"auth.login.succeeded">) => Effect.Effect<void>;
2627
+ export declare const identityAdded: (input: AuditEventInput<"auth.identity.added">) => Effect.Effect<void, never, never>;
2628
+ export declare const identityReplaced: (input: AuditEventInput<"auth.identity.replaced">) => Effect.Effect<void, never, never>;
2629
+ export declare const identityRevoked: (input: AuditEventInput<"auth.identity.revoked">) => Effect.Effect<void, never, never>;
2630
+ export declare const identityPrimaryChanged: (input: AuditEventInput<"auth.identity.primary_changed">) => Effect.Effect<void, never, never>;
2631
+ export declare const sessionAssuranceChanged: (input: AssuranceAuditEventInput) => Effect.Effect<void, never, never>;
2632
+ export declare const sessionStepUpCompleted: (input: AssuranceAuditEventInput) => Effect.Effect<void, never, never>;
2633
+ export declare const sessionPrimaryReauthenticated: (input: AssuranceAuditEventInput) => Effect.Effect<void, never, never>;
2634
+ export declare const recoveryRemediationEntered: (input: AssuranceAuditEventInput) => Effect.Effect<void, never, never>;
2635
+ export declare const recoveryRemediationCompleted: (input: AssuranceAuditEventInput) => Effect.Effect<void, never, never>;
2636
+ export declare const loginFailed: (input: AuditEventInput<"auth.login.failed">) => Effect.Effect<void>;
2637
+ export declare const sessionRevoked: (input: AuditEventInput<"auth.session.revoked">) => Effect.Effect<void>;
2638
+ export declare const loginRiskAssessed: (input: AuditEventInput<"auth.risk.assessed">) => Effect.Effect<void>;
2639
+ export declare const policyDenied: (input: AuditEventInput<"auth.policy.denied">) => Effect.Effect<void>;
2640
+ export declare const oauthAccountLinked: (input: AuditEventInput<"auth.oauth.account.linked">) => Effect.Effect<void>;
2641
+ export declare const oauthAccountUnlinked: (input: AuditEventInput<"auth.oauth.account.unlinked">) => Effect.Effect<void>;
2642
+ export declare const oauthLinkConfirmationStarted: (input: AuditEventInput<"auth.oauth.link_confirmation.started">) => Effect.Effect<void>;
2643
+ export declare const oauthLinkConfirmationConfirmed: (input: AuditEventInput<"auth.oauth.link_confirmation.confirmed">) => Effect.Effect<void>;
2644
+ export declare const oauthProviderTokenRefreshed: (input: AuditEventInput<"auth.oauth.provider_token.refreshed">) => Effect.Effect<void>;
2645
+ export declare const oauthProviderTokenRevoked: (input: AuditEventInput<"auth.oauth.provider_token.revoked">) => Effect.Effect<void>;
2646
+ export declare const passkeyCredentialRevoked: (input: AuditEventInput<"auth.passkey.credential.revoked">) => Effect.Effect<void>;
2647
+ export declare const totpEnrollmentStarted: (input: AuditEventInput<"auth.totp.enrollment.started">) => Effect.Effect<void>;
2648
+ export declare const totpFactorConfirmed: (input: AuditEventInput<"auth.totp.factor.confirmed">) => Effect.Effect<void>;
2649
+ export declare const totpFactorVerified: (input: AuditEventInput<"auth.totp.factor.verified">) => Effect.Effect<void>;
2650
+ export declare const totpFactorRevoked: (input: AuditEventInput<"auth.totp.factor.revoked">) => Effect.Effect<void>;
2651
+ export declare const recoveryCodeGenerated: (input: AuditEventInput<"auth.recovery_code.generated">) => Effect.Effect<void>;
2652
+ export declare const recoveryCodeVerified: (input: AuditEventInput<"auth.recovery_code.verified">) => Effect.Effect<void>;
2653
+ export declare const recoveryCodeRevoked: (input: AuditEventInput<"auth.recovery_code.revoked">) => Effect.Effect<void>;
2654
+ export declare const apiKeyCreated: (input: AuditEventInput<"auth.api_key.created">) => Effect.Effect<void>;
2655
+ export declare const apiKeyVerified: (input: AuditEventInput<"auth.api_key.verified">) => Effect.Effect<void>;
2656
+ export declare const apiKeyRevoked: (input: AuditEventInput<"auth.api_key.revoked">) => Effect.Effect<void>;
2657
+ export declare const apiKeyVerificationFailed: (input: AuditEventInput<"auth.api_key.verification_failed">) => Effect.Effect<void>;
2658
+ export declare const refreshTokenIssued: (input: AuditEventInput<"auth.refresh_token.issued">) => Effect.Effect<void>;
2659
+ export declare const refreshTokenRotated: (input: AuditEventInput<"auth.refresh_token.rotated">) => Effect.Effect<void>;
2660
+ export declare const refreshTokenReuseDetected: (input: AuditEventInput<"auth.refresh_token.reuse_detected">) => Effect.Effect<void>;
2661
+ export declare const refreshTokenRevoked: (input: AuditEventInput<"auth.refresh_token.revoked">) => Effect.Effect<void>;
2662
+ export declare const incidentActionExecuted: (input: AuditEventInput<"auth.incident_action.executed">) => Effect.Effect<void>;
2663
+ export declare const jwtIntrospected: (input: AuditEventInput<"auth.jwt.introspected">) => Effect.Effect<void>;
2664
+ export declare const jwtRevoked: (input: AuditEventInput<"auth.jwt.revoked">) => Effect.Effect<void>;
403
2665
  export declare const makeAuditLogStoreMemory: () => AuditLogStoreService;
404
2666
  export declare const AuditLogStoreMemoryLive: Layer.Layer<AuditLogStore, never, never>;
405
- export declare const AuditLogFromStoreLive: Layer.Layer<AuditLog, never, AuditLogStore>;
2667
+ export declare const AuditLogLive: Layer.Layer<AuditLog, never, AuditLogStore>;
406
2668
  export declare const AuditLogNoopLive: Layer.Layer<AuditLog, never, never>;
407
2669
  export {};
408
2670
  //# sourceMappingURL=AuditLog.d.ts.map