@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
@@ -0,0 +1,152 @@
1
+ create table if not exists auth_invitation (
2
+ id text primary key,
3
+ kind text not null,
4
+ target_type text not null,
5
+ target_id text not null,
6
+ intent_type text not null,
7
+ intent_version integer not null,
8
+ intent_payload text not null,
9
+ recipient_type text,
10
+ recipient_reference text,
11
+ issued_by_type text,
12
+ issued_by_id text,
13
+ created_at integer not null,
14
+ expires_at integer not null,
15
+ token_hash text not null,
16
+ accepted_at integer,
17
+ accepted_by_type text,
18
+ accepted_by_id text,
19
+ revoked_at integer,
20
+ superseded_at integer,
21
+ superseded_by_id text,
22
+ metadata text,
23
+ check (length(id) = 22 and id not glob '*[^A-Za-z0-9_-]*'),
24
+ check (length(kind) > 0),
25
+ check (length(target_type) > 0 and length(target_id) > 0),
26
+ check (length(intent_type) > 0),
27
+ check (typeof(intent_version) = 'integer' and intent_version >= 1),
28
+ check (
29
+ case
30
+ when json_valid(intent_payload) then json_type(intent_payload) = 'object'
31
+ else 0
32
+ end
33
+ ),
34
+ check ((recipient_type is null) = (recipient_reference is null)),
35
+ check (recipient_type is null or (length(recipient_type) > 0 and length(recipient_reference) > 0)),
36
+ check ((issued_by_type is null) = (issued_by_id is null)),
37
+ check (issued_by_type is null or (length(issued_by_type) > 0 and length(issued_by_id) > 0)),
38
+ check (typeof(created_at) = 'integer' and created_at >= 0),
39
+ check (typeof(expires_at) = 'integer' and expires_at > created_at),
40
+ check (length(token_hash) > 7 and substr(token_hash, 1, 7) = 'sha256:'),
41
+ check ((accepted_at is null) = (accepted_by_type is null)),
42
+ check ((accepted_by_type is null) = (accepted_by_id is null)),
43
+ check (accepted_by_type is null or (length(accepted_by_type) > 0 and length(accepted_by_id) > 0)),
44
+ check ((superseded_at is null) = (superseded_by_id is null)),
45
+ check (
46
+ superseded_by_id is null or
47
+ (length(superseded_by_id) = 22 and superseded_by_id not glob '*[^A-Za-z0-9_-]*')
48
+ ),
49
+ check (
50
+ (accepted_at is not null) +
51
+ (revoked_at is not null) +
52
+ (superseded_at is not null) <= 1
53
+ ),
54
+ check (accepted_at is null or (typeof(accepted_at) = 'integer' and accepted_at >= created_at)),
55
+ check (revoked_at is null or (typeof(revoked_at) = 'integer' and revoked_at >= created_at)),
56
+ check (superseded_at is null or (typeof(superseded_at) = 'integer' and superseded_at >= created_at)),
57
+ check (
58
+ metadata is null or
59
+ case
60
+ when json_valid(metadata) then json_type(metadata) = 'object'
61
+ else 0
62
+ end
63
+ )
64
+ );
65
+
66
+ create index if not exists auth_invitation_created_at_idx
67
+ on auth_invitation (created_at, id);
68
+ create index if not exists auth_invitation_kind_created_at_idx
69
+ on auth_invitation (kind, created_at, id);
70
+ create index if not exists auth_invitation_target_created_at_idx
71
+ on auth_invitation (target_type, target_id, created_at, id);
72
+ create index if not exists auth_invitation_recipient_created_at_idx
73
+ on auth_invitation (recipient_type, recipient_reference, created_at, id);
74
+ create index if not exists auth_invitation_issued_by_created_at_idx
75
+ on auth_invitation (issued_by_type, issued_by_id, created_at, id);
76
+ create index if not exists auth_invitation_pending_expires_at_idx
77
+ on auth_invitation (expires_at, created_at, id)
78
+ where accepted_at is null and revoked_at is null and superseded_at is null;
79
+
80
+ create table if not exists auth_access_grant (
81
+ id text primary key,
82
+ target_type text not null,
83
+ target_id text not null,
84
+ capabilities text not null,
85
+ binding_type text not null,
86
+ binding_subject_type text,
87
+ binding_subject_id text,
88
+ issuer_type text,
89
+ issuer_id text,
90
+ created_at integer not null,
91
+ expires_at integer,
92
+ token_hash text,
93
+ revoked_at integer,
94
+ superseded_at integer,
95
+ superseded_by_id text,
96
+ metadata text,
97
+ check (length(id) = 22 and id not glob '*[^A-Za-z0-9_-]*'),
98
+ check (length(target_type) > 0 and length(target_id) > 0),
99
+ check (
100
+ case
101
+ when json_valid(capabilities) then
102
+ json_type(capabilities) = 'array' and json_array_length(capabilities) > 0
103
+ else 0
104
+ end
105
+ ),
106
+ check (binding_type in ('bearer', 'subject', 'subject-and-bearer')),
107
+ check ((binding_subject_type is null) = (binding_subject_id is null)),
108
+ check (binding_subject_type is null or (length(binding_subject_type) > 0 and length(binding_subject_id) > 0)),
109
+ check (
110
+ (binding_type = 'bearer' and binding_subject_type is null) or
111
+ (binding_type in ('subject', 'subject-and-bearer') and binding_subject_type is not null)
112
+ ),
113
+ check ((issuer_type is null) = (issuer_id is null)),
114
+ check (issuer_type is null or (length(issuer_type) > 0 and length(issuer_id) > 0)),
115
+ check (typeof(created_at) = 'integer' and created_at >= 0),
116
+ check (
117
+ expires_at is null or
118
+ (typeof(expires_at) = 'integer' and expires_at > created_at)
119
+ ),
120
+ check ((binding_type = 'subject') = (token_hash is null)),
121
+ check (
122
+ token_hash is null or
123
+ (length(token_hash) > 7 and substr(token_hash, 1, 7) = 'sha256:')
124
+ ),
125
+ check ((superseded_at is null) = (superseded_by_id is null)),
126
+ check (
127
+ superseded_by_id is null or
128
+ (length(superseded_by_id) = 22 and superseded_by_id not glob '*[^A-Za-z0-9_-]*')
129
+ ),
130
+ check ((revoked_at is not null) + (superseded_at is not null) <= 1),
131
+ check (revoked_at is null or (typeof(revoked_at) = 'integer' and revoked_at >= created_at)),
132
+ check (superseded_at is null or (typeof(superseded_at) = 'integer' and superseded_at >= created_at)),
133
+ check (
134
+ metadata is null or
135
+ case
136
+ when json_valid(metadata) then json_type(metadata) = 'object'
137
+ else 0
138
+ end
139
+ )
140
+ );
141
+
142
+ create index if not exists auth_access_grant_created_at_idx
143
+ on auth_access_grant (created_at, id);
144
+ create index if not exists auth_access_grant_target_created_at_idx
145
+ on auth_access_grant (target_type, target_id, created_at, id);
146
+ create index if not exists auth_access_grant_issuer_created_at_idx
147
+ on auth_access_grant (issuer_type, issuer_id, created_at, id);
148
+ create index if not exists auth_access_grant_subject_created_at_idx
149
+ on auth_access_grant (binding_subject_type, binding_subject_id, created_at, id);
150
+ create index if not exists auth_access_grant_active_expires_at_idx
151
+ on auth_access_grant (expires_at, created_at, id)
152
+ where revoked_at is null and superseded_at is null;
@@ -0,0 +1,77 @@
1
+ create table auth_user (
2
+ id text constraint auth_user_pkey primary key,
3
+ created_at bigint not null,
4
+ updated_at bigint not null,
5
+ disabled_at bigint,
6
+ metadata jsonb
7
+ );
8
+
9
+ create table auth_user_identity (
10
+ id text constraint auth_user_identity_pkey primary key,
11
+ user_id text not null,
12
+ scope_type text not null,
13
+ scope_id text not null,
14
+ kind text not null,
15
+ value text not null,
16
+ normalized_value text not null,
17
+ verified_at bigint,
18
+ is_primary_login boolean not null default false,
19
+ created_at bigint not null,
20
+ updated_at bigint not null,
21
+ revoked_at bigint,
22
+ replaced_by_id text,
23
+ metadata jsonb
24
+ );
25
+ create unique index auth_user_identity_active_value_idx
26
+ on auth_user_identity (scope_type, scope_id, kind, normalized_value)
27
+ where revoked_at is null;
28
+ create unique index auth_user_identity_active_primary_idx
29
+ on auth_user_identity (user_id) where revoked_at is null and is_primary_login;
30
+ create index auth_user_identity_user_id_idx on auth_user_identity (user_id);
31
+ create index auth_user_identity_replaced_by_id_idx on auth_user_identity (replaced_by_id);
32
+
33
+ create table auth_credential (
34
+ id text constraint auth_credential_pkey primary key,
35
+ user_id text not null,
36
+ type text not null,
37
+ password_hash text,
38
+ created_at bigint not null,
39
+ updated_at bigint not null,
40
+ revoked_at bigint,
41
+ metadata jsonb,
42
+ constraint auth_credential_user_type_key unique (user_id, type)
43
+ );
44
+ create index auth_credential_user_id_idx on auth_credential (user_id);
45
+
46
+ create table auth_session (
47
+ id text constraint auth_session_pkey primary key,
48
+ user_id text not null,
49
+ secret_hash text not null,
50
+ created_at bigint not null,
51
+ expires_at bigint not null,
52
+ auth_time bigint not null,
53
+ authentication_events jsonb not null,
54
+ aal text not null,
55
+ amr jsonb not null,
56
+ claims jsonb,
57
+ mfa_verified_at bigint,
58
+ metadata jsonb,
59
+ revoked_at bigint,
60
+ last_seen_at bigint,
61
+ rotated_at bigint
62
+ );
63
+ create index auth_session_user_id_idx on auth_session (user_id);
64
+ create index auth_session_expires_at_idx on auth_session (expires_at);
65
+
66
+ create table auth_verification (
67
+ id text constraint auth_verification_pkey primary key,
68
+ type text not null,
69
+ subject text not null,
70
+ secret_hash text,
71
+ created_at bigint not null,
72
+ expires_at bigint not null,
73
+ metadata jsonb,
74
+ consumed_at bigint
75
+ );
76
+ create index auth_verification_type_subject_idx on auth_verification (type, subject);
77
+ create index auth_verification_expires_at_idx on auth_verification (expires_at);
@@ -0,0 +1,65 @@
1
+ create table auth_totp_factor (
2
+ id text constraint auth_totp_factor_pkey primary key,
3
+ user_id text not null,
4
+ secret text not null,
5
+ algorithm text not null,
6
+ digits integer not null,
7
+ period integer not null,
8
+ created_at bigint not null,
9
+ confirmed_at bigint,
10
+ last_used_at bigint,
11
+ last_accepted_counter bigint,
12
+ revoked_at bigint,
13
+ metadata jsonb
14
+ );
15
+ create index auth_totp_factor_user_id_idx on auth_totp_factor (user_id);
16
+ create index auth_totp_factor_active_idx on auth_totp_factor (user_id, created_at, id)
17
+ where revoked_at is null and confirmed_at is not null;
18
+
19
+ create table auth_recovery_code (
20
+ id text constraint auth_recovery_code_pkey primary key,
21
+ user_id text not null,
22
+ code_hash text not null,
23
+ created_at bigint not null,
24
+ used_at bigint,
25
+ revoked_at bigint,
26
+ metadata jsonb
27
+ );
28
+ create index auth_recovery_code_user_id_idx on auth_recovery_code (user_id);
29
+ create index auth_recovery_code_active_idx on auth_recovery_code (user_id, created_at, id)
30
+ where used_at is null and revoked_at is null;
31
+
32
+ create table auth_refresh_token (
33
+ id text constraint auth_refresh_token_pkey primary key,
34
+ family_id text not null,
35
+ user_id text not null,
36
+ secret_hash text not null,
37
+ created_at bigint not null,
38
+ expires_at bigint not null,
39
+ last_used_at bigint,
40
+ rotated_at bigint,
41
+ replaced_by_id text,
42
+ revoked_at bigint,
43
+ reuse_detected_at bigint,
44
+ metadata jsonb,
45
+ constraint auth_refresh_token_secret_hash_key unique (secret_hash)
46
+ );
47
+ create index auth_refresh_token_family_id_idx on auth_refresh_token (family_id, created_at, id);
48
+ create index auth_refresh_token_user_id_idx on auth_refresh_token (user_id, created_at, id);
49
+ create index auth_refresh_token_expires_at_idx on auth_refresh_token (expires_at);
50
+
51
+ create table auth_oauth_account (
52
+ id text constraint auth_oauth_account_pkey primary key,
53
+ provider_id text not null,
54
+ provider_account_id text not null,
55
+ user_id text not null,
56
+ email text,
57
+ email_verified boolean,
58
+ created_at bigint not null,
59
+ updated_at bigint not null,
60
+ unlinked_at bigint,
61
+ metadata jsonb,
62
+ constraint auth_oauth_account_provider_account_key unique (provider_id, provider_account_id)
63
+ );
64
+ create index auth_oauth_account_user_id_idx on auth_oauth_account (user_id, created_at, id);
65
+ create index auth_oauth_account_unlinked_at_idx on auth_oauth_account (unlinked_at);
@@ -0,0 +1,43 @@
1
+ create table auth_passkey_credential (
2
+ id text constraint auth_passkey_credential_pkey primary key,
3
+ user_id text not null,
4
+ credential_id text not null,
5
+ public_key text not null,
6
+ sign_count bigint not null,
7
+ transports jsonb,
8
+ backed_up boolean,
9
+ created_at bigint not null,
10
+ last_used_at bigint,
11
+ revoked_at bigint,
12
+ metadata jsonb,
13
+ constraint auth_passkey_credential_credential_id_key unique (credential_id)
14
+ );
15
+ create index auth_passkey_credential_user_id_idx
16
+ on auth_passkey_credential (user_id, created_at, id);
17
+ create index auth_passkey_credential_revoked_at_idx
18
+ on auth_passkey_credential (revoked_at);
19
+
20
+ create table auth_api_key (
21
+ id text constraint auth_api_key_pkey primary key,
22
+ user_id text not null,
23
+ prefix text not null,
24
+ secret_hash text not null,
25
+ scopes jsonb not null,
26
+ created_at bigint not null,
27
+ expires_at bigint,
28
+ last_used_at bigint,
29
+ revoked_at bigint,
30
+ metadata jsonb,
31
+ constraint auth_api_key_prefix_key unique (prefix)
32
+ );
33
+ create index auth_api_key_user_id_idx on auth_api_key (user_id, created_at, id);
34
+ create index auth_api_key_expires_at_idx on auth_api_key (expires_at);
35
+ create index auth_api_key_revoked_at_idx on auth_api_key (revoked_at);
36
+
37
+ create table auth_jwt_revocation (
38
+ jwt_id text constraint auth_jwt_revocation_pkey primary key,
39
+ revoked_at bigint not null,
40
+ expires_at bigint,
41
+ reason text
42
+ );
43
+ create index auth_jwt_revocation_expires_at_idx on auth_jwt_revocation (expires_at);
@@ -0,0 +1,103 @@
1
+ create table auth_audit_log (
2
+ storage_id bigint generated always as identity constraint auth_audit_log_pkey primary key,
3
+ id text,
4
+ type text not null,
5
+ user_id text,
6
+ actor_user_id text,
7
+ occurred_at bigint not null,
8
+ request_ip_hash text,
9
+ request_user_agent_hash text,
10
+ event jsonb not null,
11
+ created_at bigint not null
12
+ );
13
+ create index auth_audit_log_id_idx on auth_audit_log (id);
14
+ create index auth_audit_log_user_occurred_at_idx
15
+ on auth_audit_log (user_id, occurred_at, id);
16
+ create index auth_audit_log_actor_user_occurred_at_idx
17
+ on auth_audit_log (actor_user_id, occurred_at, id);
18
+ create index auth_audit_log_type_occurred_at_idx
19
+ on auth_audit_log (type, occurred_at, id);
20
+ create index auth_audit_log_occurred_at_idx
21
+ on auth_audit_log (occurred_at, id);
22
+
23
+ create table auth_login_approval_review (
24
+ approval_challenge_id text constraint auth_login_approval_review_pkey primary key,
25
+ flow_id text not null,
26
+ user_id text not null,
27
+ channel text not null,
28
+ reason text not null,
29
+ session_binding text not null,
30
+ same_device_required boolean not null,
31
+ status text not null,
32
+ created_at bigint not null,
33
+ expires_at bigint not null,
34
+ reviewed_at bigint,
35
+ reviewed_by text,
36
+ denied_reason text,
37
+ risk jsonb,
38
+ metadata jsonb,
39
+ review_metadata jsonb,
40
+ constraint auth_login_approval_review_session_binding_check
41
+ check (session_binding in ('originating-device', 'approval-device', 'none')),
42
+ constraint auth_login_approval_review_status_check
43
+ check (status in ('pending', 'approved', 'denied'))
44
+ );
45
+ create index auth_login_approval_review_flow_id_idx
46
+ on auth_login_approval_review (flow_id);
47
+ create index auth_login_approval_review_user_id_idx
48
+ on auth_login_approval_review (user_id);
49
+ create index auth_login_approval_review_status_expires_at_idx
50
+ on auth_login_approval_review (status, expires_at);
51
+
52
+ create table auth_login_risk_history (
53
+ id text constraint auth_login_risk_history_pkey primary key,
54
+ user_id text not null,
55
+ occurred_at bigint not null,
56
+ outcome text not null,
57
+ method text not null,
58
+ amr jsonb not null,
59
+ aal text not null,
60
+ device_status text not null,
61
+ device_key text,
62
+ location_key text,
63
+ country text,
64
+ region text,
65
+ latitude_micro bigint,
66
+ longitude_micro bigint,
67
+ risk_level text,
68
+ created_at bigint not null,
69
+ constraint auth_login_risk_history_outcome_check
70
+ check (outcome in ('success', 'failure')),
71
+ constraint auth_login_risk_history_aal_check
72
+ check (aal in ('aal1', 'aal2', 'aal3')),
73
+ constraint auth_login_risk_history_device_status_check
74
+ check (device_status in ('known', 'new', 'unknown')),
75
+ constraint auth_login_risk_history_risk_level_check
76
+ check (risk_level is null or risk_level in ('unknown', 'low', 'medium', 'high', 'critical')),
77
+ constraint auth_login_risk_history_latitude_check
78
+ check (latitude_micro is null or latitude_micro between -90000000 and 90000000),
79
+ constraint auth_login_risk_history_longitude_check
80
+ check (longitude_micro is null or longitude_micro between -180000000 and 180000000)
81
+ );
82
+ create index auth_login_risk_history_user_occurred_at_idx
83
+ on auth_login_risk_history (user_id, occurred_at, id);
84
+ create index auth_login_risk_history_user_device_key_idx
85
+ on auth_login_risk_history (user_id, device_key);
86
+ create index auth_login_risk_history_user_location_key_idx
87
+ on auth_login_risk_history (user_id, location_key);
88
+ create index auth_login_risk_history_occurred_at_idx
89
+ on auth_login_risk_history (occurred_at, id);
90
+
91
+ create table auth_trusted_device (
92
+ user_id text not null,
93
+ token_hash text not null,
94
+ created_at bigint not null,
95
+ last_seen_at bigint not null,
96
+ expires_at bigint not null,
97
+ metadata jsonb,
98
+ constraint auth_trusted_device_pkey primary key (user_id, token_hash)
99
+ );
100
+ create index auth_trusted_device_user_id_idx
101
+ on auth_trusted_device (user_id, last_seen_at, token_hash);
102
+ create index auth_trusted_device_expires_at_idx
103
+ on auth_trusted_device (expires_at);
@@ -0,0 +1,29 @@
1
+ create table auth_webhook_outbox (
2
+ id text constraint auth_webhook_outbox_pkey primary key,
3
+ endpoint_key text not null,
4
+ event jsonb not null,
5
+ status text not null,
6
+ attempts integer not null,
7
+ next_attempt_at bigint not null,
8
+ created_at bigint not null,
9
+ updated_at bigint not null,
10
+ delivered_at bigint,
11
+ last_error text,
12
+ constraint auth_webhook_outbox_status_check
13
+ check (status in ('pending', 'failed', 'delivered', 'dead_lettered')),
14
+ constraint auth_webhook_outbox_attempts_check check (attempts >= 0)
15
+ );
16
+ create index auth_webhook_outbox_due_idx
17
+ on auth_webhook_outbox (next_attempt_at, status);
18
+ create index auth_webhook_outbox_endpoint_due_idx
19
+ on auth_webhook_outbox (endpoint_key, next_attempt_at);
20
+ create index auth_webhook_outbox_status_idx
21
+ on auth_webhook_outbox (status);
22
+
23
+ create table auth_webhook_replay (
24
+ id text constraint auth_webhook_replay_pkey primary key,
25
+ expires_at bigint not null,
26
+ created_at bigint not null
27
+ );
28
+ create index auth_webhook_replay_expires_at_idx
29
+ on auth_webhook_replay (expires_at);
@@ -0,0 +1,50 @@
1
+ create table auth_domain_verification (
2
+ id text constraint auth_domain_verification_pkey primary key,
3
+ owner_id text not null,
4
+ domain text not null,
5
+ proof_method text not null,
6
+ proof_token text not null,
7
+ status text not null,
8
+ created_at bigint not null,
9
+ expires_at bigint not null,
10
+ verified_at bigint,
11
+ revoked_at bigint,
12
+ last_checked_at bigint,
13
+ metadata jsonb,
14
+ constraint auth_domain_verification_owner_domain_key unique (owner_id, domain),
15
+ constraint auth_domain_verification_proof_method_check
16
+ check (proof_method in ('dns-txt', 'http-file', 'meta-tag')),
17
+ constraint auth_domain_verification_status_check
18
+ check (status in ('pending', 'verified', 'revoked'))
19
+ );
20
+ create index auth_domain_verification_domain_idx
21
+ on auth_domain_verification (domain);
22
+ create index auth_domain_verification_status_expires_at_idx
23
+ on auth_domain_verification (status, expires_at);
24
+ create index auth_domain_verification_owner_created_at_idx
25
+ on auth_domain_verification (owner_id, created_at, id collate "C");
26
+
27
+ create table auth_security_timeline (
28
+ id text constraint auth_security_timeline_pkey primary key,
29
+ user_id text not null,
30
+ type text not null,
31
+ category text not null,
32
+ severity text not null,
33
+ occurred_at bigint not null,
34
+ summary text not null,
35
+ actor jsonb,
36
+ request jsonb,
37
+ metadata jsonb,
38
+ constraint auth_security_timeline_category_check
39
+ check (category in ('api_key', 'auth', 'authorization', 'incident', 'identity', 'jwt', 'mfa', 'oauth', 'policy', 'refresh_token', 'risk', 'session')),
40
+ constraint auth_security_timeline_severity_check
41
+ check (severity in ('info', 'warning', 'critical'))
42
+ );
43
+ create index auth_security_timeline_user_occurred_at_idx
44
+ on auth_security_timeline (user_id, occurred_at, id collate "C");
45
+ create index auth_security_timeline_occurred_at_idx
46
+ on auth_security_timeline (occurred_at, id collate "C");
47
+ create index auth_security_timeline_user_type_idx
48
+ on auth_security_timeline (user_id, type, occurred_at, id collate "C");
49
+ create index auth_security_timeline_user_category_idx
50
+ on auth_security_timeline (user_id, category, occurred_at, id collate "C");
@@ -0,0 +1,85 @@
1
+ create table auth_oauth_client (
2
+ id text constraint auth_oauth_client_pkey primary key,
3
+ type text not null,
4
+ status text not null,
5
+ name text,
6
+ redirect_uris jsonb not null,
7
+ allowed_grant_types jsonb not null,
8
+ allowed_response_types jsonb not null,
9
+ allowed_scopes jsonb,
10
+ created_at bigint,
11
+ updated_at bigint,
12
+ metadata jsonb,
13
+ constraint auth_oauth_client_type_check
14
+ check (type in ('public', 'confidential')),
15
+ constraint auth_oauth_client_status_check
16
+ check (status in ('active', 'disabled')),
17
+ constraint auth_oauth_client_redirect_uris_check
18
+ check (jsonb_typeof(redirect_uris) = 'array' and not jsonb_path_exists(redirect_uris, '$[*] ? (@.type() != "string")')),
19
+ constraint auth_oauth_client_allowed_grant_types_check
20
+ check (jsonb_typeof(allowed_grant_types) = 'array' and not jsonb_path_exists(allowed_grant_types, '$[*] ? (@.type() != "string" || (@ != "authorization_code" && @ != "refresh_token" && @ != "client_credentials"))')),
21
+ constraint auth_oauth_client_allowed_response_types_check
22
+ check (jsonb_typeof(allowed_response_types) = 'array' and not jsonb_path_exists(allowed_response_types, '$[*] ? (@.type() != "string" || @ != "code")')),
23
+ constraint auth_oauth_client_allowed_scopes_check
24
+ check (allowed_scopes is null or (jsonb_typeof(allowed_scopes) = 'array' and not jsonb_path_exists(allowed_scopes, '$[*] ? (@.type() != "string")')))
25
+ );
26
+ create index auth_oauth_client_status_idx
27
+ on auth_oauth_client (status, id collate "C");
28
+
29
+ create table auth_oauth_consent (
30
+ user_id text not null,
31
+ client_id text not null,
32
+ scopes jsonb not null,
33
+ granted_at bigint not null,
34
+ expires_at bigint,
35
+ revoked_at bigint,
36
+ metadata jsonb,
37
+ constraint auth_oauth_consent_user_client_key unique (user_id, client_id),
38
+ constraint auth_oauth_consent_scopes_check
39
+ check (jsonb_typeof(scopes) = 'array' and not jsonb_path_exists(scopes, '$[*] ? (@.type() != "string")'))
40
+ );
41
+ create index auth_oauth_consent_user_id_idx
42
+ on auth_oauth_consent (user_id, granted_at, client_id collate "C");
43
+ create index auth_oauth_consent_expires_at_idx
44
+ on auth_oauth_consent (expires_at);
45
+ create index auth_oauth_consent_revoked_at_idx
46
+ on auth_oauth_consent (revoked_at);
47
+
48
+ create table auth_oauth_authorization_code (
49
+ code_hash text constraint auth_oauth_authorization_code_pkey primary key,
50
+ client_id text not null,
51
+ subject text not null,
52
+ redirect_uri text not null,
53
+ scopes jsonb not null,
54
+ code_challenge text,
55
+ code_challenge_method text,
56
+ issued_at bigint not null,
57
+ expires_at bigint not null,
58
+ consumed_at bigint,
59
+ metadata jsonb,
60
+ constraint auth_oauth_authorization_code_scopes_check
61
+ check (jsonb_typeof(scopes) = 'array' and not jsonb_path_exists(scopes, '$[*] ? (@.type() != "string")')),
62
+ constraint auth_oauth_authorization_code_challenge_method_check
63
+ check (code_challenge_method is null or code_challenge_method = 'S256')
64
+ );
65
+ create index auth_oauth_authorization_code_client_expires_at_idx
66
+ on auth_oauth_authorization_code (client_id, expires_at);
67
+ create index auth_oauth_authorization_code_expires_at_idx
68
+ on auth_oauth_authorization_code (expires_at);
69
+ create index auth_oauth_authorization_code_consumed_at_idx
70
+ on auth_oauth_authorization_code (consumed_at);
71
+
72
+ create table auth_oauth_client_secret (
73
+ prefix text collate "C" not null,
74
+ client_id text not null,
75
+ secret_hash text not null,
76
+ authentication_methods jsonb not null,
77
+ created_at bigint not null,
78
+ expires_at bigint,
79
+ last_used_at bigint,
80
+ revoked_at bigint,
81
+ metadata jsonb,
82
+ constraint auth_oauth_client_secret_pkey primary key (client_id, prefix),
83
+ constraint auth_oauth_client_secret_authentication_methods_check
84
+ check (jsonb_typeof(authentication_methods) = 'array' and not jsonb_path_exists(authentication_methods, '$[*] ? (@.type() != "string" || (@ != "client_secret_basic" && @ != "client_secret_post"))'))
85
+ );
@@ -0,0 +1,63 @@
1
+ create table auth_oauth_provider_mode_token (
2
+ token_hash text constraint auth_oauth_provider_mode_token_pkey primary key,
3
+ token_type text not null,
4
+ client_id text not null,
5
+ subject text not null,
6
+ scopes jsonb not null,
7
+ issued_at bigint not null,
8
+ expires_at bigint not null,
9
+ issuer text,
10
+ audience jsonb,
11
+ jwt_id text,
12
+ revoked_at bigint,
13
+ revocation_reason text,
14
+ rotated_at bigint,
15
+ replaced_by_token_hash text,
16
+ metadata jsonb,
17
+ constraint auth_oauth_provider_mode_token_type_check
18
+ check (token_type in ('access_token', 'refresh_token')),
19
+ constraint auth_oauth_provider_mode_token_scopes_check
20
+ check (jsonb_typeof(scopes) = 'array' and not jsonb_path_exists(scopes, '$[*] ? (@.type() != "string")')),
21
+ constraint auth_oauth_provider_mode_token_audience_check
22
+ check (audience is null or jsonb_typeof(audience) = 'string' or (jsonb_typeof(audience) = 'array' and not jsonb_path_exists(audience, '$[*] ? (@.type() != "string")'))),
23
+ constraint auth_oauth_provider_mode_token_metadata_check
24
+ check (metadata is null or jsonb_typeof(metadata) = 'object')
25
+ );
26
+ create index auth_oauth_provider_mode_token_client_expires_at_idx
27
+ on auth_oauth_provider_mode_token (client_id, expires_at);
28
+ create index auth_oauth_provider_mode_token_subject_idx
29
+ on auth_oauth_provider_mode_token (subject);
30
+ create index auth_oauth_provider_mode_token_expires_at_idx
31
+ on auth_oauth_provider_mode_token (expires_at);
32
+ create index auth_oauth_provider_mode_token_revoked_at_idx
33
+ on auth_oauth_provider_mode_token (revoked_at);
34
+ create index auth_oauth_provider_mode_token_rotated_at_idx
35
+ on auth_oauth_provider_mode_token (rotated_at);
36
+ create index auth_oauth_provider_mode_token_jwt_id_idx
37
+ on auth_oauth_provider_mode_token (jwt_id);
38
+
39
+ create table auth_oauth_provider_token_vault (
40
+ account_id text constraint auth_oauth_provider_token_vault_pkey primary key,
41
+ user_id text not null,
42
+ provider_id text not null,
43
+ provider_account_id text not null,
44
+ access_token_ciphertext text not null,
45
+ refresh_token_ciphertext text,
46
+ id_token_ciphertext text,
47
+ token_type text not null,
48
+ scopes jsonb,
49
+ expires_at bigint,
50
+ updated_at bigint not null,
51
+ revoked_at bigint,
52
+ revocation_reason text,
53
+ constraint auth_oauth_provider_token_vault_scopes_check
54
+ check (scopes is null or (jsonb_typeof(scopes) = 'array' and not jsonb_path_exists(scopes, '$[*] ? (@.type() != "string")')))
55
+ );
56
+ create index auth_oauth_provider_token_vault_user_id_idx
57
+ on auth_oauth_provider_token_vault (user_id);
58
+ create index auth_oauth_provider_token_vault_provider_account_idx
59
+ on auth_oauth_provider_token_vault (provider_id, provider_account_id);
60
+ create index auth_oauth_provider_token_vault_expires_at_idx
61
+ on auth_oauth_provider_token_vault (expires_at);
62
+ create index auth_oauth_provider_token_vault_revoked_at_idx
63
+ on auth_oauth_provider_token_vault (revoked_at);