@softistx/janus 0.0.0-stage → 0.73.1

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 (911) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +2928 -2
  3. package/dist/auth/api-keys/authenticate-key.d.ts +21 -0
  4. package/dist/auth/api-keys/authenticate-key.d.ts.map +1 -0
  5. package/dist/auth/api-keys/bound.d.ts +11 -0
  6. package/dist/auth/api-keys/bound.d.ts.map +1 -0
  7. package/dist/auth/api-keys/count.d.ts +8 -0
  8. package/dist/auth/api-keys/count.d.ts.map +1 -0
  9. package/dist/auth/api-keys/create/checks.d.ts +42 -0
  10. package/dist/auth/api-keys/create/checks.d.ts.map +1 -0
  11. package/dist/auth/api-keys/create/index.d.ts +10 -0
  12. package/dist/auth/api-keys/create/index.d.ts.map +1 -0
  13. package/dist/auth/api-keys/events.d.ts +22 -0
  14. package/dist/auth/api-keys/events.d.ts.map +1 -0
  15. package/dist/auth/api-keys/expiry.d.ts +11 -0
  16. package/dist/auth/api-keys/expiry.d.ts.map +1 -0
  17. package/dist/auth/api-keys/flows.d.ts +13 -0
  18. package/dist/auth/api-keys/flows.d.ts.map +1 -0
  19. package/dist/auth/api-keys/index.d.ts +11 -0
  20. package/dist/auth/api-keys/index.d.ts.map +1 -0
  21. package/dist/auth/api-keys/read.d.ts +10 -0
  22. package/dist/auth/api-keys/read.d.ts.map +1 -0
  23. package/dist/auth/api-keys/shape.d.ts +24 -0
  24. package/dist/auth/api-keys/shape.d.ts.map +1 -0
  25. package/dist/auth/api-keys/to-api-key.d.ts +8 -0
  26. package/dist/auth/api-keys/to-api-key.d.ts.map +1 -0
  27. package/dist/auth/api-keys/token.d.ts +23 -0
  28. package/dist/auth/api-keys/token.d.ts.map +1 -0
  29. package/dist/auth/api-keys/user-bound.d.ts +10 -0
  30. package/dist/auth/api-keys/user-bound.d.ts.map +1 -0
  31. package/dist/auth/at.d.ts +9 -0
  32. package/dist/auth/at.d.ts.map +1 -0
  33. package/dist/auth/avatar/any-type.d.ts +13 -0
  34. package/dist/auth/avatar/any-type.d.ts.map +1 -0
  35. package/dist/auth/avatar/flows.d.ts +7 -0
  36. package/dist/auth/avatar/flows.d.ts.map +1 -0
  37. package/dist/auth/avatar/id.d.ts +10 -0
  38. package/dist/auth/avatar/id.d.ts.map +1 -0
  39. package/dist/auth/avatar/index.d.ts +7 -0
  40. package/dist/auth/avatar/index.d.ts.map +1 -0
  41. package/dist/auth/avatar/remove.d.ts +10 -0
  42. package/dist/auth/avatar/remove.d.ts.map +1 -0
  43. package/dist/auth/avatar/set.d.ts +12 -0
  44. package/dist/auth/avatar/set.d.ts.map +1 -0
  45. package/dist/auth/concurrency-limit.d.ts +13 -0
  46. package/dist/auth/concurrency-limit.d.ts.map +1 -0
  47. package/dist/auth/config/api-keys-config.d.ts +33 -0
  48. package/dist/auth/config/api-keys-config.d.ts.map +1 -0
  49. package/dist/auth/config/hasher.d.ts +22 -0
  50. package/dist/auth/config/hasher.d.ts.map +1 -0
  51. package/dist/auth/config/index.d.ts +24 -0
  52. package/dist/auth/config/index.d.ts.map +1 -0
  53. package/dist/auth/config/invitations-config.d.ts +74 -0
  54. package/dist/auth/config/invitations-config.d.ts.map +1 -0
  55. package/dist/auth/config/janus-config.d.ts +233 -0
  56. package/dist/auth/config/janus-config.d.ts.map +1 -0
  57. package/dist/auth/config/magic-link-config.d.ts +6 -0
  58. package/dist/auth/config/magic-link-config.d.ts.map +1 -0
  59. package/dist/auth/config/names.d.ts +9 -0
  60. package/dist/auth/config/names.d.ts.map +1 -0
  61. package/dist/auth/config/normalize.d.ts +26 -0
  62. package/dist/auth/config/normalize.d.ts.map +1 -0
  63. package/dist/auth/config/passkeys-config.d.ts +49 -0
  64. package/dist/auth/config/passkeys-config.d.ts.map +1 -0
  65. package/dist/auth/config/password-config.d.ts +22 -0
  66. package/dist/auth/config/password-config.d.ts.map +1 -0
  67. package/dist/auth/config/reserved.d.ts +14 -0
  68. package/dist/auth/config/reserved.d.ts.map +1 -0
  69. package/dist/auth/config/resolve-api-keys.d.ts +5 -0
  70. package/dist/auth/config/resolve-api-keys.d.ts.map +1 -0
  71. package/dist/auth/config/resolve-config.d.ts +9 -0
  72. package/dist/auth/config/resolve-config.d.ts.map +1 -0
  73. package/dist/auth/config/resolve-cookie.d.ts +5 -0
  74. package/dist/auth/config/resolve-cookie.d.ts.map +1 -0
  75. package/dist/auth/config/resolve-devices.d.ts +5 -0
  76. package/dist/auth/config/resolve-devices.d.ts.map +1 -0
  77. package/dist/auth/config/resolve-invitation-types.d.ts +5 -0
  78. package/dist/auth/config/resolve-invitation-types.d.ts.map +1 -0
  79. package/dist/auth/config/resolve-invitations.d.ts +5 -0
  80. package/dist/auth/config/resolve-invitations.d.ts.map +1 -0
  81. package/dist/auth/config/resolve-magic-link.d.ts +4 -0
  82. package/dist/auth/config/resolve-magic-link.d.ts.map +1 -0
  83. package/dist/auth/config/resolve-passkeys.d.ts +5 -0
  84. package/dist/auth/config/resolve-passkeys.d.ts.map +1 -0
  85. package/dist/auth/config/resolve-second-factor.d.ts +5 -0
  86. package/dist/auth/config/resolve-second-factor.d.ts.map +1 -0
  87. package/dist/auth/config/resolve-social.d.ts +17 -0
  88. package/dist/auth/config/resolve-social.d.ts.map +1 -0
  89. package/dist/auth/config/resolve-throttle.d.ts +37 -0
  90. package/dist/auth/config/resolve-throttle.d.ts.map +1 -0
  91. package/dist/auth/config/resolve-type.d.ts +6 -0
  92. package/dist/auth/config/resolve-type.d.ts.map +1 -0
  93. package/dist/auth/config/resolved-config.d.ts +126 -0
  94. package/dist/auth/config/resolved-config.d.ts.map +1 -0
  95. package/dist/auth/config/social-config.d.ts +154 -0
  96. package/dist/auth/config/social-config.d.ts.map +1 -0
  97. package/dist/auth/config/user-type.d.ts +79 -0
  98. package/dist/auth/config/user-type.d.ts.map +1 -0
  99. package/dist/auth/config/warn-throttle-window.d.ts +14 -0
  100. package/dist/auth/config/warn-throttle-window.d.ts.map +1 -0
  101. package/dist/auth/context/create-context.d.ts +31 -0
  102. package/dist/auth/context/create-context.d.ts.map +1 -0
  103. package/dist/auth/context/index.d.ts +17 -0
  104. package/dist/auth/context/index.d.ts.map +1 -0
  105. package/dist/auth/context/logins.d.ts +28 -0
  106. package/dist/auth/context/logins.d.ts.map +1 -0
  107. package/dist/auth/context/password.d.ts +34 -0
  108. package/dist/auth/context/password.d.ts.map +1 -0
  109. package/dist/auth/context/records.d.ts +27 -0
  110. package/dist/auth/context/records.d.ts.map +1 -0
  111. package/dist/auth/context/user.d.ts +21 -0
  112. package/dist/auth/context/user.d.ts.map +1 -0
  113. package/dist/auth/context/validate-fields.d.ts +12 -0
  114. package/dist/auth/context/validate-fields.d.ts.map +1 -0
  115. package/dist/auth/counter-key.d.ts +20 -0
  116. package/dist/auth/counter-key.d.ts.map +1 -0
  117. package/dist/auth/derived-keys.d.ts +9 -0
  118. package/dist/auth/derived-keys.d.ts.map +1 -0
  119. package/dist/auth/devices/cookie.d.ts +56 -0
  120. package/dist/auth/devices/cookie.d.ts.map +1 -0
  121. package/dist/auth/devices/hint.d.ts +42 -0
  122. package/dist/auth/devices/hint.d.ts.map +1 -0
  123. package/dist/auth/devices/index.d.ts +11 -0
  124. package/dist/auth/devices/index.d.ts.map +1 -0
  125. package/dist/auth/devices/report.d.ts +11 -0
  126. package/dist/auth/devices/report.d.ts.map +1 -0
  127. package/dist/auth/devices/token.d.ts +13 -0
  128. package/dist/auth/devices/token.d.ts.map +1 -0
  129. package/dist/auth/email-flows/any-type-change-email.d.ts +18 -0
  130. package/dist/auth/email-flows/any-type-change-email.d.ts.map +1 -0
  131. package/dist/auth/email-flows/any-type-reset-password.d.ts +19 -0
  132. package/dist/auth/email-flows/any-type-reset-password.d.ts.map +1 -0
  133. package/dist/auth/email-flows/any-type-verify-email.d.ts +18 -0
  134. package/dist/auth/email-flows/any-type-verify-email.d.ts.map +1 -0
  135. package/dist/auth/email-flows/change-email-token.d.ts +47 -0
  136. package/dist/auth/email-flows/change-email-token.d.ts.map +1 -0
  137. package/dist/auth/email-flows/change-email.d.ts +17 -0
  138. package/dist/auth/email-flows/change-email.d.ts.map +1 -0
  139. package/dist/auth/email-flows/confirm-reset.d.ts +16 -0
  140. package/dist/auth/email-flows/confirm-reset.d.ts.map +1 -0
  141. package/dist/auth/email-flows/email-token.d.ts +30 -0
  142. package/dist/auth/email-flows/email-token.d.ts.map +1 -0
  143. package/dist/auth/email-flows/flows.d.ts +13 -0
  144. package/dist/auth/email-flows/flows.d.ts.map +1 -0
  145. package/dist/auth/email-flows/index.d.ts +10 -0
  146. package/dist/auth/email-flows/index.d.ts.map +1 -0
  147. package/dist/auth/email-flows/owner-of.d.ts +17 -0
  148. package/dist/auth/email-flows/owner-of.d.ts.map +1 -0
  149. package/dist/auth/email-flows/prove-first.d.ts +45 -0
  150. package/dist/auth/email-flows/prove-first.d.ts.map +1 -0
  151. package/dist/auth/email-flows/reset-password.d.ts +17 -0
  152. package/dist/auth/email-flows/reset-password.d.ts.map +1 -0
  153. package/dist/auth/email-flows/set-email-verified.d.ts +19 -0
  154. package/dist/auth/email-flows/set-email-verified.d.ts.map +1 -0
  155. package/dist/auth/email-flows/verify-email.d.ts +25 -0
  156. package/dist/auth/email-flows/verify-email.d.ts.map +1 -0
  157. package/dist/auth/email-sign-in.d.ts +51 -0
  158. package/dist/auth/email-sign-in.d.ts.map +1 -0
  159. package/dist/auth/events.d.ts +166 -0
  160. package/dist/auth/events.d.ts.map +1 -0
  161. package/dist/auth/first-proof.d.ts +43 -0
  162. package/dist/auth/first-proof.d.ts.map +1 -0
  163. package/dist/auth/hashers.d.ts +52 -0
  164. package/dist/auth/hashers.d.ts.map +1 -0
  165. package/dist/auth/index.d.ts +22 -0
  166. package/dist/auth/index.d.ts.map +1 -0
  167. package/dist/auth/invitations/accept.d.ts +10 -0
  168. package/dist/auth/invitations/accept.d.ts.map +1 -0
  169. package/dist/auth/invitations/change-pending.d.ts +17 -0
  170. package/dist/auth/invitations/change-pending.d.ts.map +1 -0
  171. package/dist/auth/invitations/claim.d.ts +31 -0
  172. package/dist/auth/invitations/claim.d.ts.map +1 -0
  173. package/dist/auth/invitations/events.d.ts +46 -0
  174. package/dist/auth/invitations/events.d.ts.map +1 -0
  175. package/dist/auth/invitations/find-invitee.d.ts +20 -0
  176. package/dist/auth/invitations/find-invitee.d.ts.map +1 -0
  177. package/dist/auth/invitations/find-pending.d.ts +5 -0
  178. package/dist/auth/invitations/find-pending.d.ts.map +1 -0
  179. package/dist/auth/invitations/flows.d.ts +7 -0
  180. package/dist/auth/invitations/flows.d.ts.map +1 -0
  181. package/dist/auth/invitations/history-input.d.ts +29 -0
  182. package/dist/auth/invitations/history-input.d.ts.map +1 -0
  183. package/dist/auth/invitations/history.d.ts +10 -0
  184. package/dist/auth/invitations/history.d.ts.map +1 -0
  185. package/dist/auth/invitations/index.d.ts +11 -0
  186. package/dist/auth/invitations/index.d.ts.map +1 -0
  187. package/dist/auth/invitations/input.d.ts +30 -0
  188. package/dist/auth/invitations/input.d.ts.map +1 -0
  189. package/dist/auth/invitations/invited-type.d.ts +22 -0
  190. package/dist/auth/invitations/invited-type.d.ts.map +1 -0
  191. package/dist/auth/invitations/invitee.d.ts +11 -0
  192. package/dist/auth/invitations/invitee.d.ts.map +1 -0
  193. package/dist/auth/invitations/issue.d.ts +9 -0
  194. package/dist/auth/invitations/issue.d.ts.map +1 -0
  195. package/dist/auth/invitations/limit.d.ts +7 -0
  196. package/dist/auth/invitations/limit.d.ts.map +1 -0
  197. package/dist/auth/invitations/password-invitee.d.ts +18 -0
  198. package/dist/auth/invitations/password-invitee.d.ts.map +1 -0
  199. package/dist/auth/invitations/passwordless-invitee.d.ts +13 -0
  200. package/dist/auth/invitations/passwordless-invitee.d.ts.map +1 -0
  201. package/dist/auth/invitations/preview.d.ts +8 -0
  202. package/dist/auth/invitations/preview.d.ts.map +1 -0
  203. package/dist/auth/invitations/read.d.ts +10 -0
  204. package/dist/auth/invitations/read.d.ts.map +1 -0
  205. package/dist/auth/invitations/resend.d.ts +12 -0
  206. package/dist/auth/invitations/resend.d.ts.map +1 -0
  207. package/dist/auth/invitations/to-invitation.d.ts +11 -0
  208. package/dist/auth/invitations/to-invitation.d.ts.map +1 -0
  209. package/dist/auth/invitations/write.d.ts +17 -0
  210. package/dist/auth/invitations/write.d.ts.map +1 -0
  211. package/dist/auth/issuers/cache.d.ts +21 -0
  212. package/dist/auth/issuers/cache.d.ts.map +1 -0
  213. package/dist/auth/issuers/create.d.ts +18 -0
  214. package/dist/auth/issuers/create.d.ts.map +1 -0
  215. package/dist/auth/issuers/index.d.ts +3 -0
  216. package/dist/auth/issuers/index.d.ts.map +1 -0
  217. package/dist/auth/issuers/types.d.ts +45 -0
  218. package/dist/auth/issuers/types.d.ts.map +1 -0
  219. package/dist/auth/janus.d.ts +39 -0
  220. package/dist/auth/janus.d.ts.map +1 -0
  221. package/dist/auth/magic-link.d.ts +25 -0
  222. package/dist/auth/magic-link.d.ts.map +1 -0
  223. package/dist/auth/mail-requests.d.ts +55 -0
  224. package/dist/auth/mail-requests.d.ts.map +1 -0
  225. package/dist/auth/one-time/codes.d.ts +46 -0
  226. package/dist/auth/one-time/codes.d.ts.map +1 -0
  227. package/dist/auth/one-time/index.d.ts +15 -0
  228. package/dist/auth/one-time/index.d.ts.map +1 -0
  229. package/dist/auth/one-time/issue.d.ts +45 -0
  230. package/dist/auth/one-time/issue.d.ts.map +1 -0
  231. package/dist/auth/one-time/refusals.d.ts +26 -0
  232. package/dist/auth/one-time/refusals.d.ts.map +1 -0
  233. package/dist/auth/one-time/spend.d.ts +24 -0
  234. package/dist/auth/one-time/spend.d.ts.map +1 -0
  235. package/dist/auth/one-time/window.d.ts +50 -0
  236. package/dist/auth/one-time/window.d.ts.map +1 -0
  237. package/dist/auth/outage.d.ts +66 -0
  238. package/dist/auth/outage.d.ts.map +1 -0
  239. package/dist/auth/parse-sealing-keys.d.ts +26 -0
  240. package/dist/auth/parse-sealing-keys.d.ts.map +1 -0
  241. package/dist/auth/passkeys/assert.d.ts +51 -0
  242. package/dist/auth/passkeys/assert.d.ts.map +1 -0
  243. package/dist/auth/passkeys/assertion-options.d.ts +9 -0
  244. package/dist/auth/passkeys/assertion-options.d.ts.map +1 -0
  245. package/dist/auth/passkeys/challenge.d.ts +19 -0
  246. package/dist/auth/passkeys/challenge.d.ts.map +1 -0
  247. package/dist/auth/passkeys/commit.d.ts +33 -0
  248. package/dist/auth/passkeys/commit.d.ts.map +1 -0
  249. package/dist/auth/passkeys/flows.d.ts +13 -0
  250. package/dist/auth/passkeys/flows.d.ts.map +1 -0
  251. package/dist/auth/passkeys/index.d.ts +12 -0
  252. package/dist/auth/passkeys/index.d.ts.map +1 -0
  253. package/dist/auth/passkeys/manage.d.ts +11 -0
  254. package/dist/auth/passkeys/manage.d.ts.map +1 -0
  255. package/dist/auth/passkeys/name.d.ts +4 -0
  256. package/dist/auth/passkeys/name.d.ts.map +1 -0
  257. package/dist/auth/passkeys/register.d.ts +20 -0
  258. package/dist/auth/passkeys/register.d.ts.map +1 -0
  259. package/dist/auth/passkeys/registration-options.d.ts +22 -0
  260. package/dist/auth/passkeys/registration-options.d.ts.map +1 -0
  261. package/dist/auth/passkeys/remove-all.d.ts +26 -0
  262. package/dist/auth/passkeys/remove-all.d.ts.map +1 -0
  263. package/dist/auth/passkeys/sign-in-options.d.ts +12 -0
  264. package/dist/auth/passkeys/sign-in-options.d.ts.map +1 -0
  265. package/dist/auth/passkeys/sign-in.d.ts +21 -0
  266. package/dist/auth/passkeys/sign-in.d.ts.map +1 -0
  267. package/dist/auth/passkeys/verifier.d.ts +113 -0
  268. package/dist/auth/passkeys/verifier.d.ts.map +1 -0
  269. package/dist/auth/passkeys/view.d.ts +5 -0
  270. package/dist/auth/passkeys/view.d.ts.map +1 -0
  271. package/dist/auth/passkeys/wiring.d.ts +24 -0
  272. package/dist/auth/passkeys/wiring.d.ts.map +1 -0
  273. package/dist/auth/password-written.d.ts +55 -0
  274. package/dist/auth/password-written.d.ts.map +1 -0
  275. package/dist/auth/port/assert-api-keys.d.ts +21 -0
  276. package/dist/auth/port/assert-api-keys.d.ts.map +1 -0
  277. package/dist/auth/port/assert-invitations.d.ts +15 -0
  278. package/dist/auth/port/assert-invitations.d.ts.map +1 -0
  279. package/dist/auth/port/assert-stores.d.ts +16 -0
  280. package/dist/auth/port/assert-stores.d.ts.map +1 -0
  281. package/dist/auth/port/memory/api-keys/capabilities.d.ts +8 -0
  282. package/dist/auth/port/memory/api-keys/capabilities.d.ts.map +1 -0
  283. package/dist/auth/port/memory/api-keys/index.d.ts +13 -0
  284. package/dist/auth/port/memory/api-keys/index.d.ts.map +1 -0
  285. package/dist/auth/port/memory/api-keys/pages.d.ts +7 -0
  286. package/dist/auth/port/memory/api-keys/pages.d.ts.map +1 -0
  287. package/dist/auth/port/memory/copy.d.ts +6 -0
  288. package/dist/auth/port/memory/copy.d.ts.map +1 -0
  289. package/dist/auth/port/memory/index.d.ts +10 -0
  290. package/dist/auth/port/memory/index.d.ts.map +1 -0
  291. package/dist/auth/port/memory/invitations-pending.d.ts +6 -0
  292. package/dist/auth/port/memory/invitations-pending.d.ts.map +1 -0
  293. package/dist/auth/port/memory/invitations.d.ts +12 -0
  294. package/dist/auth/port/memory/invitations.d.ts.map +1 -0
  295. package/dist/auth/port/memory/passkeys.d.ts +9 -0
  296. package/dist/auth/port/memory/passkeys.d.ts.map +1 -0
  297. package/dist/auth/port/memory/sessions.d.ts +4 -0
  298. package/dist/auth/port/memory/sessions.d.ts.map +1 -0
  299. package/dist/auth/port/memory/social-links.d.ts +10 -0
  300. package/dist/auth/port/memory/social-links.d.ts.map +1 -0
  301. package/dist/auth/port/memory/stores.d.ts +26 -0
  302. package/dist/auth/port/memory/stores.d.ts.map +1 -0
  303. package/dist/auth/port/memory/tokens.d.ts +4 -0
  304. package/dist/auth/port/memory/tokens.d.ts.map +1 -0
  305. package/dist/auth/port/memory/user-index.d.ts +20 -0
  306. package/dist/auth/port/memory/user-index.d.ts.map +1 -0
  307. package/dist/auth/port/memory/user-update.d.ts +10 -0
  308. package/dist/auth/port/memory/user-update.d.ts.map +1 -0
  309. package/dist/auth/port/memory/users.d.ts +4 -0
  310. package/dist/auth/port/memory/users.d.ts.map +1 -0
  311. package/dist/auth/port/types/api-keys.d.ts +199 -0
  312. package/dist/auth/port/types/api-keys.d.ts.map +1 -0
  313. package/dist/auth/port/types/credentials.d.ts +46 -0
  314. package/dist/auth/port/types/credentials.d.ts.map +1 -0
  315. package/dist/auth/port/types/index.d.ts +75 -0
  316. package/dist/auth/port/types/index.d.ts.map +1 -0
  317. package/dist/auth/port/types/invitations/index.d.ts +15 -0
  318. package/dist/auth/port/types/invitations/index.d.ts.map +1 -0
  319. package/dist/auth/port/types/invitations/page.d.ts +52 -0
  320. package/dist/auth/port/types/invitations/page.d.ts.map +1 -0
  321. package/dist/auth/port/types/invitations/records.d.ts +101 -0
  322. package/dist/auth/port/types/invitations/records.d.ts.map +1 -0
  323. package/dist/auth/port/types/invitations/store.d.ts +82 -0
  324. package/dist/auth/port/types/invitations/store.d.ts.map +1 -0
  325. package/dist/auth/port/types/json.d.ts +27 -0
  326. package/dist/auth/port/types/json.d.ts.map +1 -0
  327. package/dist/auth/port/types/passkeys.d.ts +94 -0
  328. package/dist/auth/port/types/passkeys.d.ts.map +1 -0
  329. package/dist/auth/port/types/sessions.d.ts +142 -0
  330. package/dist/auth/port/types/sessions.d.ts.map +1 -0
  331. package/dist/auth/port/types/social-links.d.ts +64 -0
  332. package/dist/auth/port/types/social-links.d.ts.map +1 -0
  333. package/dist/auth/port/types/stores.d.ts +48 -0
  334. package/dist/auth/port/types/stores.d.ts.map +1 -0
  335. package/dist/auth/port/types/tokens.d.ts +168 -0
  336. package/dist/auth/port/types/tokens.d.ts.map +1 -0
  337. package/dist/auth/port/types/users.d.ts +260 -0
  338. package/dist/auth/port/types/users.d.ts.map +1 -0
  339. package/dist/auth/prepared.d.ts +21 -0
  340. package/dist/auth/prepared.d.ts.map +1 -0
  341. package/dist/auth/proven-sign-in.d.ts +22 -0
  342. package/dist/auth/proven-sign-in.d.ts.map +1 -0
  343. package/dist/auth/sealer-for.d.ts +44 -0
  344. package/dist/auth/sealer-for.d.ts.map +1 -0
  345. package/dist/auth/sealing.d.ts +36 -0
  346. package/dist/auth/sealing.d.ts.map +1 -0
  347. package/dist/auth/second-factor/activate.d.ts +9 -0
  348. package/dist/auth/second-factor/activate.d.ts.map +1 -0
  349. package/dist/auth/second-factor/app-code-attempts.d.ts +47 -0
  350. package/dist/auth/second-factor/app-code-attempts.d.ts.map +1 -0
  351. package/dist/auth/second-factor/challenge.d.ts +15 -0
  352. package/dist/auth/second-factor/challenge.d.ts.map +1 -0
  353. package/dist/auth/second-factor/codes-left.d.ts +14 -0
  354. package/dist/auth/second-factor/codes-left.d.ts.map +1 -0
  355. package/dist/auth/second-factor/disable.d.ts +10 -0
  356. package/dist/auth/second-factor/disable.d.ts.map +1 -0
  357. package/dist/auth/second-factor/enroll.d.ts +6 -0
  358. package/dist/auth/second-factor/enroll.d.ts.map +1 -0
  359. package/dist/auth/second-factor/factor.d.ts +33 -0
  360. package/dist/auth/second-factor/factor.d.ts.map +1 -0
  361. package/dist/auth/second-factor/flows.d.ts +36 -0
  362. package/dist/auth/second-factor/flows.d.ts.map +1 -0
  363. package/dist/auth/second-factor/lifecycle.d.ts +14 -0
  364. package/dist/auth/second-factor/lifecycle.d.ts.map +1 -0
  365. package/dist/auth/second-factor/passkey-confirm.d.ts +21 -0
  366. package/dist/auth/second-factor/passkey-confirm.d.ts.map +1 -0
  367. package/dist/auth/second-factor/recovery-codes.d.ts +36 -0
  368. package/dist/auth/second-factor/recovery-codes.d.ts.map +1 -0
  369. package/dist/auth/second-factor/recovery.d.ts +20 -0
  370. package/dist/auth/second-factor/recovery.d.ts.map +1 -0
  371. package/dist/auth/second-factor/redeem.d.ts +42 -0
  372. package/dist/auth/second-factor/redeem.d.ts.map +1 -0
  373. package/dist/auth/second-factor/refusal.d.ts +6 -0
  374. package/dist/auth/second-factor/refusal.d.ts.map +1 -0
  375. package/dist/auth/second-factor/regenerate.d.ts +12 -0
  376. package/dist/auth/second-factor/regenerate.d.ts.map +1 -0
  377. package/dist/auth/second-factor/reseal.d.ts +17 -0
  378. package/dist/auth/second-factor/reseal.d.ts.map +1 -0
  379. package/dist/auth/second-factor/spend-recovery-code.d.ts +15 -0
  380. package/dist/auth/second-factor/spend-recovery-code.d.ts.map +1 -0
  381. package/dist/auth/secrets.d.ts +17 -0
  382. package/dist/auth/secrets.d.ts.map +1 -0
  383. package/dist/auth/sessions/amr.d.ts +36 -0
  384. package/dist/auth/sessions/amr.d.ts.map +1 -0
  385. package/dist/auth/sessions/authenticate.d.ts +12 -0
  386. package/dist/auth/sessions/authenticate.d.ts.map +1 -0
  387. package/dist/auth/sessions/collect-expired.d.ts +15 -0
  388. package/dist/auth/sessions/collect-expired.d.ts.map +1 -0
  389. package/dist/auth/sessions/cookie.d.ts +9 -0
  390. package/dist/auth/sessions/cookie.d.ts.map +1 -0
  391. package/dist/auth/sessions/fresh.d.ts +35 -0
  392. package/dist/auth/sessions/fresh.d.ts.map +1 -0
  393. package/dist/auth/sessions/index.d.ts +12 -0
  394. package/dist/auth/sessions/index.d.ts.map +1 -0
  395. package/dist/auth/sessions/open-session.d.ts +22 -0
  396. package/dist/auth/sessions/open-session.d.ts.map +1 -0
  397. package/dist/auth/sessions/presented-token.d.ts +25 -0
  398. package/dist/auth/sessions/presented-token.d.ts.map +1 -0
  399. package/dist/auth/sessions/shared-api.d.ts +17 -0
  400. package/dist/auth/sessions/shared-api.d.ts.map +1 -0
  401. package/dist/auth/sessions/standing.d.ts +32 -0
  402. package/dist/auth/sessions/standing.d.ts.map +1 -0
  403. package/dist/auth/shared-api.d.ts +139 -0
  404. package/dist/auth/shared-api.d.ts.map +1 -0
  405. package/dist/auth/sign-in-attempts.d.ts +45 -0
  406. package/dist/auth/sign-in-attempts.d.ts.map +1 -0
  407. package/dist/auth/sign-in-code.d.ts +26 -0
  408. package/dist/auth/sign-in-code.d.ts.map +1 -0
  409. package/dist/auth/social/attach.d.ts +31 -0
  410. package/dist/auth/social/attach.d.ts.map +1 -0
  411. package/dist/auth/social/begin.d.ts +30 -0
  412. package/dist/auth/social/begin.d.ts.map +1 -0
  413. package/dist/auth/social/complete-link.d.ts +17 -0
  414. package/dist/auth/social/complete-link.d.ts.map +1 -0
  415. package/dist/auth/social/complete.d.ts +54 -0
  416. package/dist/auth/social/complete.d.ts.map +1 -0
  417. package/dist/auth/social/cookie.d.ts +16 -0
  418. package/dist/auth/social/cookie.d.ts.map +1 -0
  419. package/dist/auth/social/find-provider.d.ts +23 -0
  420. package/dist/auth/social/find-provider.d.ts.map +1 -0
  421. package/dist/auth/social/finish.d.ts +60 -0
  422. package/dist/auth/social/finish.d.ts.map +1 -0
  423. package/dist/auth/social/flow-cookie-value.d.ts +26 -0
  424. package/dist/auth/social/flow-cookie-value.d.ts.map +1 -0
  425. package/dist/auth/social/flow-secret.d.ts +40 -0
  426. package/dist/auth/social/flow-secret.d.ts.map +1 -0
  427. package/dist/auth/social/index.d.ts +19 -0
  428. package/dist/auth/social/index.d.ts.map +1 -0
  429. package/dist/auth/social/link-holder.d.ts +33 -0
  430. package/dist/auth/social/link-holder.d.ts.map +1 -0
  431. package/dist/auth/social/provider-call.d.ts +31 -0
  432. package/dist/auth/social/provider-call.d.ts.map +1 -0
  433. package/dist/auth/social/redeem.d.ts +45 -0
  434. package/dist/auth/social/redeem.d.ts.map +1 -0
  435. package/dist/auth/social/return-to.d.ts +18 -0
  436. package/dist/auth/social/return-to.d.ts.map +1 -0
  437. package/dist/auth/social/sign-in.d.ts +41 -0
  438. package/dist/auth/social/sign-in.d.ts.map +1 -0
  439. package/dist/auth/social/sign-up.d.ts +37 -0
  440. package/dist/auth/social/sign-up.d.ts.map +1 -0
  441. package/dist/auth/social/start.d.ts +21 -0
  442. package/dist/auth/social/start.d.ts.map +1 -0
  443. package/dist/auth/social/step-up-proof.d.ts +26 -0
  444. package/dist/auth/social/step-up-proof.d.ts.map +1 -0
  445. package/dist/auth/social/step-up-request.d.ts +28 -0
  446. package/dist/auth/social/step-up-request.d.ts.map +1 -0
  447. package/dist/auth/social/step-up.d.ts +19 -0
  448. package/dist/auth/social/step-up.d.ts.map +1 -0
  449. package/dist/auth/social/types-of.d.ts +12 -0
  450. package/dist/auth/social/types-of.d.ts.map +1 -0
  451. package/dist/auth/social/unlink.d.ts +16 -0
  452. package/dist/auth/social/unlink.d.ts.map +1 -0
  453. package/dist/auth/social/wiring.d.ts +10 -0
  454. package/dist/auth/social/wiring.d.ts.map +1 -0
  455. package/dist/auth/standard-schema.d.ts +41 -0
  456. package/dist/auth/standard-schema.d.ts.map +1 -0
  457. package/dist/auth/step-up/codes.d.ts +35 -0
  458. package/dist/auth/step-up/codes.d.ts.map +1 -0
  459. package/dist/auth/step-up/flows.d.ts +18 -0
  460. package/dist/auth/step-up/flows.d.ts.map +1 -0
  461. package/dist/auth/step-up/open.d.ts +23 -0
  462. package/dist/auth/step-up/open.d.ts.map +1 -0
  463. package/dist/auth/step-up/passkey.d.ts +31 -0
  464. package/dist/auth/step-up/passkey.d.ts.map +1 -0
  465. package/dist/auth/step-up/request.d.ts +15 -0
  466. package/dist/auth/step-up/request.d.ts.map +1 -0
  467. package/dist/auth/step-up/spend.d.ts +4 -0
  468. package/dist/auth/step-up/spend.d.ts.map +1 -0
  469. package/dist/auth/totp.d.ts +36 -0
  470. package/dist/auth/totp.d.ts.map +1 -0
  471. package/dist/auth/types/api-keys-of.d.ts +19 -0
  472. package/dist/auth/types/api-keys-of.d.ts.map +1 -0
  473. package/dist/auth/types/api-keys.d.ts +164 -0
  474. package/dist/auth/types/api-keys.d.ts.map +1 -0
  475. package/dist/auth/types/avatar.d.ts +72 -0
  476. package/dist/auth/types/avatar.d.ts.map +1 -0
  477. package/dist/auth/types/change-email.d.ts +82 -0
  478. package/dist/auth/types/change-email.d.ts.map +1 -0
  479. package/dist/auth/types/checks.d.ts +147 -0
  480. package/dist/auth/types/checks.d.ts.map +1 -0
  481. package/dist/auth/types/email-flows.d.ts +117 -0
  482. package/dist/auth/types/email-flows.d.ts.map +1 -0
  483. package/dist/auth/types/find-by-email.d.ts +31 -0
  484. package/dist/auth/types/find-by-email.d.ts.map +1 -0
  485. package/dist/auth/types/find-or-create.d.ts +59 -0
  486. package/dist/auth/types/find-or-create.d.ts.map +1 -0
  487. package/dist/auth/types/index.d.ts +38 -0
  488. package/dist/auth/types/index.d.ts.map +1 -0
  489. package/dist/auth/types/inference.d.ts +62 -0
  490. package/dist/auth/types/inference.d.ts.map +1 -0
  491. package/dist/auth/types/invitations/api.d.ts +203 -0
  492. package/dist/auth/types/invitations/api.d.ts.map +1 -0
  493. package/dist/auth/types/invitations/history.d.ts +87 -0
  494. package/dist/auth/types/invitations/history.d.ts.map +1 -0
  495. package/dist/auth/types/invitations/index.d.ts +10 -0
  496. package/dist/auth/types/invitations/index.d.ts.map +1 -0
  497. package/dist/auth/types/invitations/invitation.d.ts +76 -0
  498. package/dist/auth/types/invitations/invitation.d.ts.map +1 -0
  499. package/dist/auth/types/invitations/issue-type.d.ts +15 -0
  500. package/dist/auth/types/invitations/issue-type.d.ts.map +1 -0
  501. package/dist/auth/types/invitations-of.d.ts +26 -0
  502. package/dist/auth/types/invitations-of.d.ts.map +1 -0
  503. package/dist/auth/types/janus.d.ts +51 -0
  504. package/dist/auth/types/janus.d.ts.map +1 -0
  505. package/dist/auth/types/magic-link.d.ts +69 -0
  506. package/dist/auth/types/magic-link.d.ts.map +1 -0
  507. package/dist/auth/types/passkeys.d.ts +183 -0
  508. package/dist/auth/types/passkeys.d.ts.map +1 -0
  509. package/dist/auth/types/password.d.ts +113 -0
  510. package/dist/auth/types/password.d.ts.map +1 -0
  511. package/dist/auth/types/prepared.d.ts +68 -0
  512. package/dist/auth/types/prepared.d.ts.map +1 -0
  513. package/dist/auth/types/proven-sign-in.d.ts +43 -0
  514. package/dist/auth/types/proven-sign-in.d.ts.map +1 -0
  515. package/dist/auth/types/reset-password.d.ts +46 -0
  516. package/dist/auth/types/reset-password.d.ts.map +1 -0
  517. package/dist/auth/types/second-factor.d.ts +164 -0
  518. package/dist/auth/types/second-factor.d.ts.map +1 -0
  519. package/dist/auth/types/session.d.ts +68 -0
  520. package/dist/auth/types/session.d.ts.map +1 -0
  521. package/dist/auth/types/shared-api.d.ts +96 -0
  522. package/dist/auth/types/shared-api.d.ts.map +1 -0
  523. package/dist/auth/types/sign-in.d.ts +102 -0
  524. package/dist/auth/types/sign-in.d.ts.map +1 -0
  525. package/dist/auth/types/social-flow.d.ts +28 -0
  526. package/dist/auth/types/social-flow.d.ts.map +1 -0
  527. package/dist/auth/types/social-step-up.d.ts +38 -0
  528. package/dist/auth/types/social-step-up.d.ts.map +1 -0
  529. package/dist/auth/types/social.d.ts +193 -0
  530. package/dist/auth/types/social.d.ts.map +1 -0
  531. package/dist/auth/types/step-up.d.ts +133 -0
  532. package/dist/auth/types/step-up.d.ts.map +1 -0
  533. package/dist/auth/types/type-api.d.ts +29 -0
  534. package/dist/auth/types/type-api.d.ts.map +1 -0
  535. package/dist/auth/types/user-type.d.ts +106 -0
  536. package/dist/auth/types/user-type.d.ts.map +1 -0
  537. package/dist/auth/types/user.d.ts +62 -0
  538. package/dist/auth/types/user.d.ts.map +1 -0
  539. package/dist/auth/types/verify-email.d.ts +190 -0
  540. package/dist/auth/types/verify-email.d.ts.map +1 -0
  541. package/dist/auth/users/any-type-api.d.ts +6 -0
  542. package/dist/auth/users/any-type-api.d.ts.map +1 -0
  543. package/dist/auth/users/by-login.d.ts +10 -0
  544. package/dist/auth/users/by-login.d.ts.map +1 -0
  545. package/dist/auth/users/change-password.d.ts +26 -0
  546. package/dist/auth/users/change-password.d.ts.map +1 -0
  547. package/dist/auth/users/delete.d.ts +10 -0
  548. package/dist/auth/users/delete.d.ts.map +1 -0
  549. package/dist/auth/users/email-move-guard.d.ts +20 -0
  550. package/dist/auth/users/email-move-guard.d.ts.map +1 -0
  551. package/dist/auth/users/email-prefix.d.ts +23 -0
  552. package/dist/auth/users/email-prefix.d.ts.map +1 -0
  553. package/dist/auth/users/fields-patch.d.ts +21 -0
  554. package/dist/auth/users/fields-patch.d.ts.map +1 -0
  555. package/dist/auth/users/find-by-email.d.ts +11 -0
  556. package/dist/auth/users/find-by-email.d.ts.map +1 -0
  557. package/dist/auth/users/find-many.d.ts +29 -0
  558. package/dist/auth/users/find-many.d.ts.map +1 -0
  559. package/dist/auth/users/find-or-create.d.ts +12 -0
  560. package/dist/auth/users/find-or-create.d.ts.map +1 -0
  561. package/dist/auth/users/flow-types.d.ts +15 -0
  562. package/dist/auth/users/flow-types.d.ts.map +1 -0
  563. package/dist/auth/users/index.d.ts +9 -0
  564. package/dist/auth/users/index.d.ts.map +1 -0
  565. package/dist/auth/users/insert.d.ts +15 -0
  566. package/dist/auth/users/insert.d.ts.map +1 -0
  567. package/dist/auth/users/name-prefix.d.ts +19 -0
  568. package/dist/auth/users/name-prefix.d.ts.map +1 -0
  569. package/dist/auth/users/password-flows.d.ts +11 -0
  570. package/dist/auth/users/password-flows.d.ts.map +1 -0
  571. package/dist/auth/users/record-flows.d.ts +11 -0
  572. package/dist/auth/users/record-flows.d.ts.map +1 -0
  573. package/dist/auth/users/sign-in.d.ts +24 -0
  574. package/dist/auth/users/sign-in.d.ts.map +1 -0
  575. package/dist/auth/users/sign-up.d.ts +13 -0
  576. package/dist/auth/users/sign-up.d.ts.map +1 -0
  577. package/dist/auth/users/type-api.d.ts +10 -0
  578. package/dist/auth/users/type-api.d.ts.map +1 -0
  579. package/dist/auth/users/update.d.ts +16 -0
  580. package/dist/auth/users/update.d.ts.map +1 -0
  581. package/dist/background/background.d.ts +22 -0
  582. package/dist/background/background.d.ts.map +1 -0
  583. package/dist/chunks/index-2ttdcz7n.js +354 -0
  584. package/dist/chunks/index-2ttdcz7n.js.map +16 -0
  585. package/dist/chunks/index-5dxynm32.js +85 -0
  586. package/dist/chunks/index-5dxynm32.js.map +10 -0
  587. package/dist/chunks/index-ftz0ne6j.js +127 -0
  588. package/dist/chunks/index-ftz0ne6j.js.map +11 -0
  589. package/dist/chunks/index-k6y18nx9.js +724 -0
  590. package/dist/chunks/index-k6y18nx9.js.map +24 -0
  591. package/dist/chunks/index-n8jxmxeg.js +64 -0
  592. package/dist/chunks/index-n8jxmxeg.js.map +11 -0
  593. package/dist/conformance/api-keys/cases/bound.d.ts +3 -0
  594. package/dist/conformance/api-keys/cases/bound.d.ts.map +1 -0
  595. package/dist/conformance/api-keys/cases/expiry.d.ts +3 -0
  596. package/dist/conformance/api-keys/cases/expiry.d.ts.map +1 -0
  597. package/dist/conformance/api-keys/cases/index.d.ts +4 -0
  598. package/dist/conformance/api-keys/cases/index.d.ts.map +1 -0
  599. package/dist/conformance/api-keys/cases/insert.d.ts +3 -0
  600. package/dist/conformance/api-keys/cases/insert.d.ts.map +1 -0
  601. package/dist/conformance/api-keys/cases/outage.d.ts +3 -0
  602. package/dist/conformance/api-keys/cases/outage.d.ts.map +1 -0
  603. package/dist/conformance/api-keys/cases/revoke.d.ts +3 -0
  604. package/dist/conformance/api-keys/cases/revoke.d.ts.map +1 -0
  605. package/dist/conformance/api-keys/cases/touch.d.ts +3 -0
  606. package/dist/conformance/api-keys/cases/touch.d.ts.map +1 -0
  607. package/dist/conformance/api-keys/cases/user-bound.d.ts +3 -0
  608. package/dist/conformance/api-keys/cases/user-bound.d.ts.map +1 -0
  609. package/dist/conformance/api-keys/describe.d.ts +20 -0
  610. package/dist/conformance/api-keys/describe.d.ts.map +1 -0
  611. package/dist/conformance/api-keys/fixtures.d.ts +4 -0
  612. package/dist/conformance/api-keys/fixtures.d.ts.map +1 -0
  613. package/dist/conformance/api-keys/index.d.ts +18 -0
  614. package/dist/conformance/api-keys/index.d.ts.map +1 -0
  615. package/dist/conformance/api-keys/reference.d.ts +4 -0
  616. package/dist/conformance/api-keys/reference.d.ts.map +1 -0
  617. package/dist/conformance/api-keys/types.d.ts +42 -0
  618. package/dist/conformance/api-keys/types.d.ts.map +1 -0
  619. package/dist/conformance/assert.d.ts +40 -0
  620. package/dist/conformance/assert.d.ts.map +1 -0
  621. package/dist/conformance/cases/outage.d.ts +3 -0
  622. package/dist/conformance/cases/outage.d.ts.map +1 -0
  623. package/dist/conformance/cases/outage.passkeys.d.ts +12 -0
  624. package/dist/conformance/cases/outage.passkeys.d.ts.map +1 -0
  625. package/dist/conformance/cases/passkeys/deletion.d.ts +4 -0
  626. package/dist/conformance/cases/passkeys/deletion.d.ts.map +1 -0
  627. package/dist/conformance/cases/passkeys/index.d.ts +8 -0
  628. package/dist/conformance/cases/passkeys/index.d.ts.map +1 -0
  629. package/dist/conformance/cases/passkeys/inserts.d.ts +4 -0
  630. package/dist/conformance/cases/passkeys/inserts.d.ts.map +1 -0
  631. package/dist/conformance/cases/passkeys/reads.d.ts +4 -0
  632. package/dist/conformance/cases/passkeys/reads.d.ts.map +1 -0
  633. package/dist/conformance/cases/passkeys/uses.d.ts +4 -0
  634. package/dist/conformance/cases/passkeys/uses.d.ts.map +1 -0
  635. package/dist/conformance/cases/sessions/deletion.d.ts +4 -0
  636. package/dist/conformance/cases/sessions/deletion.d.ts.map +1 -0
  637. package/dist/conformance/cases/sessions/extension.d.ts +4 -0
  638. package/dist/conformance/cases/sessions/extension.d.ts.map +1 -0
  639. package/dist/conformance/cases/sessions/index.d.ts +4 -0
  640. package/dist/conformance/cases/sessions/index.d.ts.map +1 -0
  641. package/dist/conformance/cases/sessions/inserts.d.ts +4 -0
  642. package/dist/conformance/cases/sessions/inserts.d.ts.map +1 -0
  643. package/dist/conformance/cases/sessions/list.d.ts +4 -0
  644. package/dist/conformance/cases/sessions/list.d.ts.map +1 -0
  645. package/dist/conformance/cases/sessions/reads.d.ts +4 -0
  646. package/dist/conformance/cases/sessions/reads.d.ts.map +1 -0
  647. package/dist/conformance/cases/sessions/reauthentication.d.ts +4 -0
  648. package/dist/conformance/cases/sessions/reauthentication.d.ts.map +1 -0
  649. package/dist/conformance/cases/sessions/revocation.d.ts +4 -0
  650. package/dist/conformance/cases/sessions/revocation.d.ts.map +1 -0
  651. package/dist/conformance/cases/social-links/deletion.d.ts +4 -0
  652. package/dist/conformance/cases/social-links/deletion.d.ts.map +1 -0
  653. package/dist/conformance/cases/social-links/index.d.ts +8 -0
  654. package/dist/conformance/cases/social-links/index.d.ts.map +1 -0
  655. package/dist/conformance/cases/social-links/inserts.d.ts +4 -0
  656. package/dist/conformance/cases/social-links/inserts.d.ts.map +1 -0
  657. package/dist/conformance/cases/social-links/reads.d.ts +4 -0
  658. package/dist/conformance/cases/social-links/reads.d.ts.map +1 -0
  659. package/dist/conformance/cases/tokens/attempts.d.ts +7 -0
  660. package/dist/conformance/cases/tokens/attempts.d.ts.map +1 -0
  661. package/dist/conformance/cases/tokens/change-email.d.ts +8 -0
  662. package/dist/conformance/cases/tokens/change-email.d.ts.map +1 -0
  663. package/dist/conformance/cases/tokens/deletion.d.ts +4 -0
  664. package/dist/conformance/cases/tokens/deletion.d.ts.map +1 -0
  665. package/dist/conformance/cases/tokens/index.d.ts +4 -0
  666. package/dist/conformance/cases/tokens/index.d.ts.map +1 -0
  667. package/dist/conformance/cases/tokens/inserts.d.ts +7 -0
  668. package/dist/conformance/cases/tokens/inserts.d.ts.map +1 -0
  669. package/dist/conformance/cases/tokens/kinds.d.ts +7 -0
  670. package/dist/conformance/cases/tokens/kinds.d.ts.map +1 -0
  671. package/dist/conformance/cases/tokens/redemption.d.ts +7 -0
  672. package/dist/conformance/cases/tokens/redemption.d.ts.map +1 -0
  673. package/dist/conformance/cases/tokens/social-flow.d.ts +8 -0
  674. package/dist/conformance/cases/tokens/social-flow.d.ts.map +1 -0
  675. package/dist/conformance/cases/tokens/spending.d.ts +7 -0
  676. package/dist/conformance/cases/tokens/spending.d.ts.map +1 -0
  677. package/dist/conformance/cases/users/avatar.d.ts +8 -0
  678. package/dist/conformance/cases/users/avatar.d.ts.map +1 -0
  679. package/dist/conformance/cases/users/batch.d.ts +8 -0
  680. package/dist/conformance/cases/users/batch.d.ts.map +1 -0
  681. package/dist/conformance/cases/users/deletion.d.ts +4 -0
  682. package/dist/conformance/cases/users/deletion.d.ts.map +1 -0
  683. package/dist/conformance/cases/users/index.d.ts +4 -0
  684. package/dist/conformance/cases/users/index.d.ts.map +1 -0
  685. package/dist/conformance/cases/users/inserts.d.ts +4 -0
  686. package/dist/conformance/cases/users/inserts.d.ts.map +1 -0
  687. package/dist/conformance/cases/users/listing.d.ts +4 -0
  688. package/dist/conformance/cases/users/listing.d.ts.map +1 -0
  689. package/dist/conformance/cases/users/patches.d.ts +7 -0
  690. package/dist/conformance/cases/users/patches.d.ts.map +1 -0
  691. package/dist/conformance/cases/users/reads.d.ts +7 -0
  692. package/dist/conformance/cases/users/reads.d.ts.map +1 -0
  693. package/dist/conformance/cases/users/second-factor.d.ts +16 -0
  694. package/dist/conformance/cases/users/second-factor.d.ts.map +1 -0
  695. package/dist/conformance/cases/users/versions.d.ts +7 -0
  696. package/dist/conformance/cases/users/versions.d.ts.map +1 -0
  697. package/dist/conformance/describe.d.ts +82 -0
  698. package/dist/conformance/describe.d.ts.map +1 -0
  699. package/dist/conformance/fixtures.d.ts +31 -0
  700. package/dist/conformance/fixtures.d.ts.map +1 -0
  701. package/dist/conformance/index.d.ts +46 -0
  702. package/dist/conformance/index.d.ts.map +1 -0
  703. package/dist/conformance/index.js +4411 -0
  704. package/dist/conformance/index.js.map +86 -0
  705. package/dist/conformance/invitations/cases/actors.d.ts +3 -0
  706. package/dist/conformance/invitations/cases/actors.d.ts.map +1 -0
  707. package/dist/conformance/invitations/cases/find-pending.d.ts +3 -0
  708. package/dist/conformance/invitations/cases/find-pending.d.ts.map +1 -0
  709. package/dist/conformance/invitations/cases/imported.d.ts +3 -0
  710. package/dist/conformance/invitations/cases/imported.d.ts.map +1 -0
  711. package/dist/conformance/invitations/cases/index.d.ts +4 -0
  712. package/dist/conformance/invitations/cases/index.d.ts.map +1 -0
  713. package/dist/conformance/invitations/cases/insert.d.ts +3 -0
  714. package/dist/conformance/invitations/cases/insert.d.ts.map +1 -0
  715. package/dist/conformance/invitations/cases/list-lapsed.d.ts +3 -0
  716. package/dist/conformance/invitations/cases/list-lapsed.d.ts.map +1 -0
  717. package/dist/conformance/invitations/cases/list-status.d.ts +3 -0
  718. package/dist/conformance/invitations/cases/list-status.d.ts.map +1 -0
  719. package/dist/conformance/invitations/cases/list.d.ts +3 -0
  720. package/dist/conformance/invitations/cases/list.d.ts.map +1 -0
  721. package/dist/conformance/invitations/cases/outage.d.ts +3 -0
  722. package/dist/conformance/invitations/cases/outage.d.ts.map +1 -0
  723. package/dist/conformance/invitations/cases/scope.d.ts +3 -0
  724. package/dist/conformance/invitations/cases/scope.d.ts.map +1 -0
  725. package/dist/conformance/invitations/cases/update.d.ts +3 -0
  726. package/dist/conformance/invitations/cases/update.d.ts.map +1 -0
  727. package/dist/conformance/invitations/describe.d.ts +20 -0
  728. package/dist/conformance/invitations/describe.d.ts.map +1 -0
  729. package/dist/conformance/invitations/fixtures.d.ts +4 -0
  730. package/dist/conformance/invitations/fixtures.d.ts.map +1 -0
  731. package/dist/conformance/invitations/index.d.ts +18 -0
  732. package/dist/conformance/invitations/index.d.ts.map +1 -0
  733. package/dist/conformance/invitations/reference.d.ts +4 -0
  734. package/dist/conformance/invitations/reference.d.ts.map +1 -0
  735. package/dist/conformance/invitations/types.d.ts +34 -0
  736. package/dist/conformance/invitations/types.d.ts.map +1 -0
  737. package/dist/conformance/reference.d.ts +13 -0
  738. package/dist/conformance/reference.d.ts.map +1 -0
  739. package/dist/conformance/relations/cases/deletion.d.ts +4 -0
  740. package/dist/conformance/relations/cases/deletion.d.ts.map +1 -0
  741. package/dist/conformance/relations/cases/holders.d.ts +9 -0
  742. package/dist/conformance/relations/cases/holders.d.ts.map +1 -0
  743. package/dist/conformance/relations/cases/index.d.ts +4 -0
  744. package/dist/conformance/relations/cases/index.d.ts.map +1 -0
  745. package/dist/conformance/relations/cases/outage.d.ts +3 -0
  746. package/dist/conformance/relations/cases/outage.d.ts.map +1 -0
  747. package/dist/conformance/relations/cases/reads.d.ts +8 -0
  748. package/dist/conformance/relations/cases/reads.d.ts.map +1 -0
  749. package/dist/conformance/relations/cases/traversal.d.ts +7 -0
  750. package/dist/conformance/relations/cases/traversal.d.ts.map +1 -0
  751. package/dist/conformance/relations/cases/writes.d.ts +4 -0
  752. package/dist/conformance/relations/cases/writes.d.ts.map +1 -0
  753. package/dist/conformance/relations/describe.d.ts +20 -0
  754. package/dist/conformance/relations/describe.d.ts.map +1 -0
  755. package/dist/conformance/relations/fixtures.d.ts +8 -0
  756. package/dist/conformance/relations/fixtures.d.ts.map +1 -0
  757. package/dist/conformance/relations/index.d.ts +18 -0
  758. package/dist/conformance/relations/index.d.ts.map +1 -0
  759. package/dist/conformance/relations/reference.d.ts +4 -0
  760. package/dist/conformance/relations/reference.d.ts.map +1 -0
  761. package/dist/conformance/relations/types.d.ts +34 -0
  762. package/dist/conformance/relations/types.d.ts.map +1 -0
  763. package/dist/conformance/types.d.ts +79 -0
  764. package/dist/conformance/types.d.ts.map +1 -0
  765. package/dist/errors/janus-error/base.d.ts +47 -0
  766. package/dist/errors/janus-error/base.d.ts.map +1 -0
  767. package/dist/errors/janus-error/codes.credentials.d.ts +36 -0
  768. package/dist/errors/janus-error/codes.credentials.d.ts.map +1 -0
  769. package/dist/errors/janus-error/codes.d.ts +23 -0
  770. package/dist/errors/janus-error/codes.d.ts.map +1 -0
  771. package/dist/errors/janus-error/codes.invitations.d.ts +52 -0
  772. package/dist/errors/janus-error/codes.invitations.d.ts.map +1 -0
  773. package/dist/errors/janus-error/codes.one-time.d.ts +63 -0
  774. package/dist/errors/janus-error/codes.one-time.d.ts.map +1 -0
  775. package/dist/errors/janus-error/codes.records.d.ts +86 -0
  776. package/dist/errors/janus-error/codes.records.d.ts.map +1 -0
  777. package/dist/errors/janus-error/codes.social.d.ts +88 -0
  778. package/dist/errors/janus-error/codes.social.d.ts.map +1 -0
  779. package/dist/errors/janus-error/index.d.ts +17 -0
  780. package/dist/errors/janus-error/index.d.ts.map +1 -0
  781. package/dist/errors/janus-error/options.d.ts +105 -0
  782. package/dist/errors/janus-error/options.d.ts.map +1 -0
  783. package/dist/errors/janus-error/refusals.d.ts +151 -0
  784. package/dist/errors/janus-error/refusals.d.ts.map +1 -0
  785. package/dist/errors/janus-error/status.d.ts +21 -0
  786. package/dist/errors/janus-error/status.d.ts.map +1 -0
  787. package/dist/errors/janus-error/store.d.ts +36 -0
  788. package/dist/errors/janus-error/store.d.ts.map +1 -0
  789. package/dist/ids/derived.d.ts +25 -0
  790. package/dist/ids/derived.d.ts.map +1 -0
  791. package/dist/ids/id.d.ts +55 -0
  792. package/dist/ids/id.d.ts.map +1 -0
  793. package/dist/index.d.ts +32 -0
  794. package/dist/index.d.ts.map +1 -0
  795. package/dist/index.js +6933 -0
  796. package/dist/index.js.map +208 -0
  797. package/dist/pagination/cursor-page.d.ts +53 -0
  798. package/dist/pagination/cursor-page.d.ts.map +1 -0
  799. package/dist/permissions/bound-model.d.ts +10 -0
  800. package/dist/permissions/bound-model.d.ts.map +1 -0
  801. package/dist/permissions/can.d.ts +13 -0
  802. package/dist/permissions/can.d.ts.map +1 -0
  803. package/dist/permissions/engine.d.ts +49 -0
  804. package/dist/permissions/engine.d.ts.map +1 -0
  805. package/dist/permissions/holders.d.ts +12 -0
  806. package/dist/permissions/holders.d.ts.map +1 -0
  807. package/dist/permissions/index.d.ts +36 -0
  808. package/dist/permissions/index.d.ts.map +1 -0
  809. package/dist/permissions/index.js +924 -0
  810. package/dist/permissions/index.js.map +28 -0
  811. package/dist/permissions/input.d.ts +43 -0
  812. package/dist/permissions/input.d.ts.map +1 -0
  813. package/dist/permissions/list.d.ts +16 -0
  814. package/dist/permissions/list.d.ts.map +1 -0
  815. package/dist/permissions/model/can.d.ts +41 -0
  816. package/dist/permissions/model/can.d.ts.map +1 -0
  817. package/dist/permissions/model/config.d.ts +36 -0
  818. package/dist/permissions/model/config.d.ts.map +1 -0
  819. package/dist/permissions/model/constraint.d.ts +37 -0
  820. package/dist/permissions/model/constraint.d.ts.map +1 -0
  821. package/dist/permissions/model/ctx.d.ts +23 -0
  822. package/dist/permissions/model/ctx.d.ts.map +1 -0
  823. package/dist/permissions/model/define.d.ts +78 -0
  824. package/dist/permissions/model/define.d.ts.map +1 -0
  825. package/dist/permissions/model/from-field.d.ts +31 -0
  826. package/dist/permissions/model/from-field.d.ts.map +1 -0
  827. package/dist/permissions/model/grant.d.ts +81 -0
  828. package/dist/permissions/model/grant.d.ts.map +1 -0
  829. package/dist/permissions/model/list.d.ts +48 -0
  830. package/dist/permissions/model/list.d.ts.map +1 -0
  831. package/dist/permissions/model/names.d.ts +51 -0
  832. package/dist/permissions/model/names.d.ts.map +1 -0
  833. package/dist/permissions/model/permissions.d.ts +48 -0
  834. package/dist/permissions/model/permissions.d.ts.map +1 -0
  835. package/dist/permissions/model/refs.d.ts +36 -0
  836. package/dist/permissions/model/refs.d.ts.map +1 -0
  837. package/dist/permissions/model/refusal.d.ts +13 -0
  838. package/dist/permissions/model/refusal.d.ts.map +1 -0
  839. package/dist/permissions/model/unions.d.ts +3 -0
  840. package/dist/permissions/model/unions.d.ts.map +1 -0
  841. package/dist/permissions/model/when.d.ts +16 -0
  842. package/dist/permissions/model/when.d.ts.map +1 -0
  843. package/dist/permissions/port/holders.d.ts +38 -0
  844. package/dist/permissions/port/holders.d.ts.map +1 -0
  845. package/dist/permissions/port/memory.d.ts +17 -0
  846. package/dist/permissions/port/memory.d.ts.map +1 -0
  847. package/dist/permissions/port/types.d.ts +101 -0
  848. package/dist/permissions/port/types.d.ts.map +1 -0
  849. package/dist/permissions/replace.d.ts +25 -0
  850. package/dist/permissions/replace.d.ts.map +1 -0
  851. package/dist/permissions/resolve/declared-names.d.ts +24 -0
  852. package/dist/permissions/resolve/declared-names.d.ts.map +1 -0
  853. package/dist/permissions/resolve/refuse-data-beyond-root.d.ts +11 -0
  854. package/dist/permissions/resolve/refuse-data-beyond-root.d.ts.map +1 -0
  855. package/dist/permissions/resolve/refuse-loops.d.ts +10 -0
  856. package/dist/permissions/resolve/refuse-loops.d.ts.map +1 -0
  857. package/dist/permissions/resolve/resolve-model.d.ts +13 -0
  858. package/dist/permissions/resolve/resolve-model.d.ts.map +1 -0
  859. package/dist/permissions/resolve/resolve-relation.d.ts +9 -0
  860. package/dist/permissions/resolve/resolve-relation.d.ts.map +1 -0
  861. package/dist/permissions/resolve/resolve-rule.d.ts +12 -0
  862. package/dist/permissions/resolve/resolve-rule.d.ts.map +1 -0
  863. package/dist/permissions/resolve/resolved.d.ts +52 -0
  864. package/dist/permissions/resolve/resolved.d.ts.map +1 -0
  865. package/dist/permissions/resolve/step.d.ts +4 -0
  866. package/dist/permissions/resolve/step.d.ts.map +1 -0
  867. package/dist/permissions/reverse.d.ts +53 -0
  868. package/dist/permissions/reverse.d.ts.map +1 -0
  869. package/dist/permissions/walk.d.ts +29 -0
  870. package/dist/permissions/walk.d.ts.map +1 -0
  871. package/dist/stores/guard.d.ts +24 -0
  872. package/dist/stores/guard.d.ts.map +1 -0
  873. package/dist/stores/storable.d.ts +15 -0
  874. package/dist/stores/storable.d.ts.map +1 -0
  875. package/dist/subjects/notation.d.ts +39 -0
  876. package/dist/subjects/notation.d.ts.map +1 -0
  877. package/dist/subjects/subject.d.ts +128 -0
  878. package/dist/subjects/subject.d.ts.map +1 -0
  879. package/dist/testing/index.d.ts +12 -0
  880. package/dist/testing/index.d.ts.map +1 -0
  881. package/dist/testing/index.js +26 -0
  882. package/dist/testing/index.js.map +10 -0
  883. package/dist/time/clock.d.ts +31 -0
  884. package/dist/time/clock.d.ts.map +1 -0
  885. package/dist/time/duration.d.ts +23 -0
  886. package/dist/time/duration.d.ts.map +1 -0
  887. package/docs/README.md +46 -0
  888. package/docs/guide/adapters.md +858 -0
  889. package/docs/guide/api-keys.md +316 -0
  890. package/docs/guide/avatars.md +334 -0
  891. package/docs/guide/devices.md +441 -0
  892. package/docs/guide/email-flows.md +880 -0
  893. package/docs/guide/errors.md +180 -0
  894. package/docs/guide/events.md +467 -0
  895. package/docs/guide/invitations.md +465 -0
  896. package/docs/guide/issuers.md +107 -0
  897. package/docs/guide/magic-link.md +580 -0
  898. package/docs/guide/migrating-invitations.md +142 -0
  899. package/docs/guide/passkeys.md +425 -0
  900. package/docs/guide/passwords.md +325 -0
  901. package/docs/guide/permissions.md +719 -0
  902. package/docs/guide/second-factor.md +1124 -0
  903. package/docs/guide/sessions.md +521 -0
  904. package/docs/guide/sign-in-code.md +631 -0
  905. package/docs/guide/social.md +639 -0
  906. package/docs/guide/step-up.md +262 -0
  907. package/docs/guide/users.md +557 -0
  908. package/docs/guide/vocabulary.md +316 -0
  909. package/docs/roadmap.md +101 -0
  910. package/docs/troubleshooting.md +3305 -0
  911. package/package.json +77 -5
@@ -0,0 +1,199 @@
1
+ /**
2
+ * API keys: a key's record, and the port a store implements for them.
3
+ *
4
+ * **A port of its own, not a slot of `JanusStores`.** API keys are opt-in
5
+ * (`janus({ apiKeys })`), and a new required slot would break every adapter
6
+ * that has not written it yet. An application that configures keys hands the
7
+ * store to that block; one that does not never needs it. The rules every
8
+ * implementation keeps are the store port's, in `./index`.
9
+ */
10
+ import type { Id } from '../../../ids/id';
11
+ import type { CursorPage } from '../../../pagination/cursor-page';
12
+ /** A key's id: a UUIDv7 minted by the core, as a user's is. */
13
+ export type ApiKeyId = string;
14
+ /**
15
+ * The one object a key is bound to: a workspace, an account, a project… The
16
+ * core never reads what it names; the application decides what a key bound
17
+ * to it may reach.
18
+ */
19
+ export interface ApiKeyBound {
20
+ /** What kind of object: `workspace`, `account`… 1 to 64 characters. */
21
+ readonly type: string;
22
+ /** Which one, as the application names it. 1 to 200 characters. */
23
+ readonly id: string;
24
+ }
25
+ /**
26
+ * An API key, as a store holds it.
27
+ *
28
+ * **The secret is never stored.** The core mints 32 random bytes, hands the
29
+ * store `sha256(secret)` as `secretHash`, and gives the plain token to the
30
+ * application once. A dump of the store cannot be replayed.
31
+ */
32
+ export interface ApiKeyRecord {
33
+ readonly id: ApiKeyId;
34
+ readonly userId: Id;
35
+ /** A label the owner chose, to tell their keys apart. */
36
+ readonly name: string;
37
+ /** `sha256` of the secret, hex. */
38
+ readonly secretHash: string;
39
+ readonly createdAt: Date;
40
+ /** Every key expires: there is no unlimited key. */
41
+ readonly expiresAt: Date;
42
+ /** When the key last authenticated a request, within the throttle; `null` if never. */
43
+ readonly lastUsedAt: Date | null;
44
+ /** `null` while the key stands. */
45
+ readonly revokedAt: Date | null;
46
+ /**
47
+ * What the key may do, as the application names it (`mcp:read`…); absent
48
+ * for a key that may do whatever its user may. Only a store with the
49
+ * `bound` capability is handed one.
50
+ */
51
+ readonly scopes?: readonly string[];
52
+ /**
53
+ * The object the key acts in, and only in; absent for a key that is bound
54
+ * to nothing. Only a store with the `bound` capability is handed one.
55
+ */
56
+ readonly bound?: ApiKeyBound;
57
+ /** When the expiry notice was recorded; absent until it is. */
58
+ readonly expiryNotifiedAt?: Date;
59
+ }
60
+ /** Which keys of one user a page lists, and how much of it to read. */
61
+ export interface ApiKeyPageRequest {
62
+ /**
63
+ * Page size, already bounded by the core, between 1 and `MAX_PAGE_SIZE`.
64
+ */
65
+ readonly first: number;
66
+ /**
67
+ * The last id of the previous page, or `null` for the first. It need not
68
+ * name a stored key: the page is every id strictly greater than it.
69
+ */
70
+ readonly after: ApiKeyId | null;
71
+ }
72
+ /** Which keys the expiry sweep lists, and how much of it to read. */
73
+ export interface ApiKeyExpiringRequest extends ApiKeyPageRequest {
74
+ /** Only keys whose `expiresAt` is strictly after it: a lapsed key is no notice's business. */
75
+ readonly now: Date;
76
+ /** Only keys whose `expiresAt` is at or before it. */
77
+ readonly before: Date;
78
+ }
79
+ /**
80
+ * The methods every API key store has. Every method is atomic on its own, and
81
+ * `null`, `false` and `0` are answers: only a failure throws (`StoreFailure`).
82
+ *
83
+ * **Expiry is the core's decision, not the store's.** A read answers a present
84
+ * record **verbatim**, lapsed or revoked, and may answer `null` once a store's
85
+ * own expiry has dropped it. It must never answer a record it has *changed*.
86
+ */
87
+ export interface ApiKeyStoreBase {
88
+ /**
89
+ * Stores a new key. Idempotent under retry: when a key with this id
90
+ * exists, it writes nothing.
91
+ */
92
+ insertApiKey(record: ApiKeyRecord): Promise<void>;
93
+ /** The key with this id, verbatim, or `null`. */
94
+ findApiKey(id: ApiKeyId): Promise<ApiKeyRecord | null>;
95
+ /**
96
+ * One user's keys — standing, revoked or lapsed — in id order, which is
97
+ * creation order. `nextCursor` is the last id of the page, or `null` on the
98
+ * last page. A user without keys has an empty page, never `null`.
99
+ */
100
+ listUserApiKeys(userId: Id, page: ApiKeyPageRequest): Promise<CursorPage<ApiKeyRecord>>;
101
+ /**
102
+ * Moves `lastUsedAt` to `at` — **a conditional write**, so a busy key does
103
+ * not cost a write per request. It writes only while the key exists, is
104
+ * not revoked, and has never been used or was last used strictly before
105
+ * `staleBefore`.
106
+ *
107
+ * Answers `true` when this call wrote and `false` when it did not (no such
108
+ * key, revoked, or used recently enough). Of concurrent calls on a stale
109
+ * key, exactly one answers `true`.
110
+ */
111
+ touchApiKey(id: ApiKeyId, at: Date, staleBefore: Date): Promise<boolean>;
112
+ /**
113
+ * Revokes one key. `true` when the key exists — revoked by this call or
114
+ * already — and `false` when there is none. A key already revoked keeps its
115
+ * first `revokedAt`.
116
+ */
117
+ revokeApiKey(id: ApiKeyId, at: Date): Promise<boolean>;
118
+ /**
119
+ * Revokes every standing key of one user and answers how many this call
120
+ * revoked; `0` is an answer, not a failure.
121
+ */
122
+ revokeUserApiKeys(userId: Id, at: Date): Promise<number>;
123
+ /**
124
+ * Deletes every key of one user — standing, revoked or lapsed — and answers
125
+ * how many. `0` is an answer, not a failure. What deleting a user calls.
126
+ */
127
+ deleteUserApiKeys(userId: Id): Promise<number>;
128
+ /**
129
+ * **Optional capability.** Deletes every key whose `expiresAt` is at or
130
+ * before `before`, and answers how many. A store with its own expiry — a
131
+ * TTL index — does not implement it.
132
+ */
133
+ deleteExpiredApiKeys?(before: Date): Promise<number>;
134
+ }
135
+ /**
136
+ * The optional capability `bound`: both methods, or neither. A store that has
137
+ * them also stores `scopes` and `bound` as given, and answers them verbatim.
138
+ */
139
+ export interface ApiKeyBoundMethods {
140
+ /**
141
+ * **Optional capability `bound`**, with `revokeBoundApiKeys`: a store that
142
+ * has them also stores `scopes` and `bound` as given, and answers them
143
+ * verbatim. A store without them is never handed either field.
144
+ *
145
+ * Every key bound to `bound` — same `type` and `id`, standing, revoked or
146
+ * lapsed, whoever holds it — in id order, paged as `listUserApiKeys` is.
147
+ */
148
+ listBoundApiKeys(bound: ApiKeyBound, page: ApiKeyPageRequest): Promise<CursorPage<ApiKeyRecord>>;
149
+ /**
150
+ * **Optional capability `bound`.** Revokes every standing key of one user
151
+ * bound to `bound`, and answers how many this call revoked; `0` is an
152
+ * answer. The user's other keys stand.
153
+ */
154
+ revokeBoundApiKeys(userId: Id, bound: ApiKeyBound, at: Date): Promise<number>;
155
+ }
156
+ /**
157
+ * The optional capability `userBound`: one method, on top of `bound` (a store
158
+ * with it must also have `listBoundApiKeys` and `revokeBoundApiKeys`). A store
159
+ * without it still serves `apiKeys.list(user, { bound })`: the core reads the
160
+ * user's keys and filters them.
161
+ */
162
+ export interface ApiKeyUserBoundMethods {
163
+ /**
164
+ * **Optional capability `userBound`**, needs `bound`: one user's keys bound
165
+ * to `bound` — same `type` and `id` — or, for `null`, the user's unbound
166
+ * keys. Standing, revoked or lapsed, in id order, paged as
167
+ * `listUserApiKeys` is.
168
+ */
169
+ listUserBoundApiKeys(userId: Id, bound: ApiKeyBound | null, page: ApiKeyPageRequest): Promise<CursorPage<ApiKeyRecord>>;
170
+ }
171
+ /** The optional capability `expiryNotice`: both methods, or neither. */
172
+ export interface ApiKeyExpiryNoticeMethods {
173
+ /**
174
+ * **Optional capability `expiryNotice`**, with `markApiKeyExpiryNotified`.
175
+ * The standing keys — not revoked — whose `expiresAt` is after `now` and at
176
+ * or before `before`, and that have no `expiryNotifiedAt`, in id order,
177
+ * paged as `listUserApiKeys` is.
178
+ */
179
+ listExpiringApiKeys(request: ApiKeyExpiringRequest): Promise<CursorPage<ApiKeyRecord>>;
180
+ /**
181
+ * **Optional capability `expiryNotice`.** Records `expiryNotifiedAt = at`
182
+ * — **a conditional write**: only on a key that exists and has none yet.
183
+ * `true` when this call wrote; `false` for no such key or one already
184
+ * notified, which keeps its first instant. Of concurrent calls on one key,
185
+ * exactly one answers `true`.
186
+ */
187
+ markApiKeyExpiryNotified(id: ApiKeyId, at: Date): Promise<boolean>;
188
+ }
189
+ /**
190
+ * API keys: the base methods, and each optional capability's pair. The pairs
191
+ * are optional here so that a class can still `implements ApiKeyStore`; an
192
+ * adapter that has a capability also implements its interface
193
+ * (`implements ApiKeyStore, ApiKeyBoundMethods`), which makes half a pair a
194
+ * compile error naming the missing method. `janus()` refuses half a pair at
195
+ * wiring either way (`assertApiKeyStore`).
196
+ */
197
+ export interface ApiKeyStore extends ApiKeyStoreBase, Partial<ApiKeyBoundMethods>, Partial<ApiKeyUserBoundMethods>, Partial<ApiKeyExpiryNoticeMethods> {
198
+ }
199
+ //# sourceMappingURL=api-keys.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api-keys.d.ts","sourceRoot":"","sources":["../../../../src/auth/port/types/api-keys.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAElE,+DAA+D;AAC/D,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC;AAE9B;;;;GAIG;AACH,MAAM,WAAW,WAAW;IAC3B,uEAAuE;IACvE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,mEAAmE;IACnE,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,YAAY;IAC5B,QAAQ,CAAC,EAAE,EAAE,QAAQ,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,EAAE,CAAC;IACpB,yDAAyD;IACzD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,mCAAmC;IACnC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,SAAS,EAAE,IAAI,CAAC;IACzB,oDAAoD;IACpD,QAAQ,CAAC,SAAS,EAAE,IAAI,CAAC;IACzB,uFAAuF;IACvF,QAAQ,CAAC,UAAU,EAAE,IAAI,GAAG,IAAI,CAAC;IACjC,mCAAmC;IACnC,QAAQ,CAAC,SAAS,EAAE,IAAI,GAAG,IAAI,CAAC;IAChC;;;;OAIG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC;;;OAGG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,WAAW,CAAC;IAC7B,+DAA+D;IAC/D,QAAQ,CAAC,gBAAgB,CAAC,EAAE,IAAI,CAAC;CACjC;AAED,uEAAuE;AACvE,MAAM,WAAW,iBAAiB;IACjC;;OAEG;IACH,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,QAAQ,CAAC,KAAK,EAAE,QAAQ,GAAG,IAAI,CAAC;CAChC;AAED,qEAAqE;AACrE,MAAM,WAAW,qBAAsB,SAAQ,iBAAiB;IAC/D,8FAA8F;IAC9F,QAAQ,CAAC,GAAG,EAAE,IAAI,CAAC;IACnB,sDAAsD;IACtD,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC;CACtB;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,eAAe;IAC/B;;;OAGG;IACH,YAAY,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAElD,iDAAiD;IACjD,UAAU,CAAC,EAAE,EAAE,QAAQ,GAAG,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC,CAAC;IAEvD;;;;OAIG;IACH,eAAe,CACd,MAAM,EAAE,EAAE,EACV,IAAI,EAAE,iBAAiB,GACrB,OAAO,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC,CAAC;IAErC;;;;;;;;;OASG;IACH,WAAW,CAAC,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAEzE;;;;OAIG;IACH,YAAY,CAAC,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAEvD;;;OAGG;IACH,iBAAiB,CAAC,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAEzD;;;OAGG;IACH,iBAAiB,CAAC,MAAM,EAAE,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAE/C;;;;OAIG;IACH,oBAAoB,CAAC,CAAC,MAAM,EAAE,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CACrD;AAED;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IAClC;;;;;;;OAOG;IACH,gBAAgB,CACf,KAAK,EAAE,WAAW,EAClB,IAAI,EAAE,iBAAiB,GACrB,OAAO,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC,CAAC;IAErC;;;;OAIG;IACH,kBAAkB,CAAC,MAAM,EAAE,EAAE,EAAE,KAAK,EAAE,WAAW,EAAE,EAAE,EAAE,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CAC9E;AAED;;;;;GAKG;AACH,MAAM,WAAW,sBAAsB;IACtC;;;;;OAKG;IACH,oBAAoB,CACnB,MAAM,EAAE,EAAE,EACV,KAAK,EAAE,WAAW,GAAG,IAAI,EACzB,IAAI,EAAE,iBAAiB,GACrB,OAAO,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC,CAAC;CACrC;AAED,wEAAwE;AACxE,MAAM,WAAW,yBAAyB;IACzC;;;;;OAKG;IACH,mBAAmB,CAClB,OAAO,EAAE,qBAAqB,GAC5B,OAAO,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC,CAAC;IAErC;;;;;;OAMG;IACH,wBAAwB,CAAC,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CACnE;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,WAChB,SAAQ,eAAe,EACtB,OAAO,CAAC,kBAAkB,CAAC,EAC3B,OAAO,CAAC,sBAAsB,CAAC,EAC/B,OAAO,CAAC,yBAAyB,CAAC;CAAG"}
@@ -0,0 +1,46 @@
1
+ /**
2
+ * A user's credentials as a store holds them: a password hash and a sealed
3
+ * second-factor secret, both opaque to the store and kept byte for byte.
4
+ *
5
+ * Part of the store port; the rules every implementation keeps are in
6
+ * `./index`.
7
+ */
8
+ /** A password, as the store holds it: a self-describing hash, never the plain text. */
9
+ export interface PasswordRecord {
10
+ /** Self-describing — `$argon2id$…`, `$scrypt$…` — so any wired verifier can read it. */
11
+ readonly hash: string;
12
+ readonly updatedAt: Date;
13
+ }
14
+ /**
15
+ * A second factor, as the store holds it: a TOTP secret.
16
+ *
17
+ * **The secret is opaque to a store.** The core seals it with a key the
18
+ * application holds — AES-256-GCM, `v1.<key id>.<iv>.<ciphertext>` — before a
19
+ * store ever sees it, so a dump of the users cannot produce a code. A store
20
+ * keeps the string byte for byte, like a password hash, and never parses it.
21
+ */
22
+ export interface SecondFactorRecord {
23
+ /** How the codes are made. `'totp'`, the codes of an authenticator app, is the only one. */
24
+ readonly method: 'totp';
25
+ /** The secret, opaque to a store: kept byte for byte. */
26
+ readonly secret: string;
27
+ /**
28
+ * When the user proved their app holds the secret, with a first code — or
29
+ * `null` while the enrolment waits for it. A second factor is asked for at
30
+ * sign-in only once confirmed.
31
+ */
32
+ readonly confirmedAt: Date | null;
33
+ /**
34
+ * The time step of the last code accepted, or `null` before the first. A
35
+ * code of this step or an earlier one is refused, so a code works once.
36
+ */
37
+ readonly lastStep: number | null;
38
+ /**
39
+ * The recovery codes still unused, as keyed hashes — `[]` for none. Each is
40
+ * opaque to a store, like the secret: kept byte for byte, **in order**, and
41
+ * replaced whole by a patch that names the factor. A store that drops the
42
+ * field, or answers it as absent, locks out a user whose phone is gone.
43
+ */
44
+ readonly recoveryCodes: readonly string[];
45
+ }
46
+ //# sourceMappingURL=credentials.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"credentials.d.ts","sourceRoot":"","sources":["../../../../src/auth/port/types/credentials.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,uFAAuF;AACvF,MAAM,WAAW,cAAc;IAC9B,wFAAwF;IACxF,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,SAAS,EAAE,IAAI,CAAC;CACzB;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,kBAAkB;IAClC,4FAA4F;IAC5F,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,yDAAyD;IACzD,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB;;;;OAIG;IACH,QAAQ,CAAC,WAAW,EAAE,IAAI,GAAG,IAAI,CAAC;IAClC;;;OAGG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC;;;;;OAKG;IACH,QAAQ,CAAC,aAAa,EAAE,SAAS,MAAM,EAAE,CAAC;CAC1C"}
@@ -0,0 +1,75 @@
1
+ /**
2
+ * The store port: what an adapter implements, and nothing else.
3
+ *
4
+ * **This is the contract strangers are asked to implement**, so every line of
5
+ * it is a promise. It is small on purpose — anything the core can derive from
6
+ * what the port already offers (merging fields, deciding that an e-mail is no
7
+ * longer verified, deciding that a session has lapsed) lives in the core, where
8
+ * it is written once, rather than here, where every adapter would write it
9
+ * again, differently.
10
+ *
11
+ * ## The six rules an implementation keeps
12
+ *
13
+ * All of them are checked by `@softistx/janus/conformance`.
14
+ *
15
+ * 1. **An absence is `null`. A failure throws.** A method that can
16
+ * legitimately find nothing answers `null`, `false`, `0` or an empty page.
17
+ * Everything else — a refused connection, a timeout, a primary stepping
18
+ * down, a bug in the adapter — **throws**, preferably `StoreFailure` with
19
+ * the driver error as `cause`. Never write `try { … } catch { return null }`
20
+ * in an implementation of this port: that one line turns an outage into
21
+ * "no such user", and every caller above it answers 404 to a user who
22
+ * exists.
23
+ * 2. **`null`, not `undefined`.** `undefined` is what a missing property and a
24
+ * function with no `return` both produce, so a store that forgot to answer
25
+ * would report "not found" by accident. `null` has to be written on purpose.
26
+ * 3. **Uniqueness is yours, and it is a constraint.** A unique index, a
27
+ * constraint, an atomic `SET NX` — never a read followed by a write, which
28
+ * two concurrent sign-ups both pass.
29
+ * 4. **Bytes round-trip.** Logins, hashes and fields come back exactly as they
30
+ * were written: no normalisation, no trimming, no `1` turned into `'1'`. The
31
+ * core normalises a login before a store ever sees it, so uniqueness is
32
+ * uniqueness of bytes and no adapter needs a collation. The core never
33
+ * hands a store `\u0000` or a lone surrogate — PostgreSQL keeps neither —
34
+ * and every other character must come back as it went in.
35
+ * 5. **Every method is atomic on its own.** Nothing composes into a
36
+ * transaction, and the core never opens one. An adapter may open one
37
+ * *inside* a method — a normalised SQL schema writes several rows per
38
+ * user — but the port exposes none. And **a read sees every write that
39
+ * completed before it**: never a secondary or a read replica. A sign-in
40
+ * that re-reads the user after answering, and a new code spending the
41
+ * ones issued before it, both count on it — the one promise here no suite
42
+ * can check.
43
+ * 6. **Schema management is not on this interface.** An adapter exposes its own
44
+ * `sync()`; the core never calls it.
45
+ *
46
+ * ## Why three stores and not one
47
+ *
48
+ * The seam is **where atomicity is not required**. A user and their password
49
+ * are written together — a sign-up that stores the user and loses the hash is
50
+ * a user nobody can sign in as — so they are one record. A session is derived
51
+ * state: losing them all signs everybody out, which recovers. A one-time token
52
+ * is ephemeral by construction. So `sessions` and `tokens` may live in Redis
53
+ * while `users` lives in MongoDB, with no distributed transaction anywhere.
54
+ *
55
+ * ## Why the port is not generic
56
+ *
57
+ * A store does not know the application's schemas, and must not have to:
58
+ * fields are a {@link JsonObject} here, and the core casts once, at the
59
+ * boundary, after the schema has validated them. That is the shape `nxgt-data`
60
+ * uses — a generic public form, a degenericised mirror inside — and it keeps
61
+ * every adapter free of type parameters it could only pass through.
62
+ */
63
+ import type { JsonObject } from './json';
64
+ export type { ApiKeyBound, ApiKeyBoundMethods, ApiKeyExpiringRequest, ApiKeyExpiryNoticeMethods, ApiKeyId, ApiKeyPageRequest, ApiKeyRecord, ApiKeyStore, ApiKeyStoreBase, ApiKeyUserBoundMethods, } from './api-keys';
65
+ export type { PasswordRecord, SecondFactorRecord } from './credentials';
66
+ export type { InvitationFilter, InvitationId, InvitationLapsedFilter, InvitationPageRequest, InvitationPatch, InvitationRecord, InvitationStatus, InvitationStore, } from './invitations';
67
+ export type { Json } from './json';
68
+ export type { PasskeyRecord, PasskeyStore, PasskeyUse } from './passkeys';
69
+ export type { SessionId, SessionRecord, SessionStore } from './sessions';
70
+ export type { SocialLinkRecord, SocialLinkStore } from './social-links';
71
+ export type { JanusStores, StoreCapabilities } from './stores';
72
+ export type { TokenKind, TokenRecord, TokenStore } from './tokens';
73
+ export type { AvatarRecord, UserFilter, UserPageRequest, UserPatch, UserRecord, UserStore, } from './users';
74
+ export type { JsonObject };
75
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/auth/port/types/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6DG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAEzC,YAAY,EACX,WAAW,EACX,kBAAkB,EAClB,qBAAqB,EACrB,yBAAyB,EACzB,QAAQ,EACR,iBAAiB,EACjB,YAAY,EACZ,WAAW,EACX,eAAe,EACf,sBAAsB,GACtB,MAAM,YAAY,CAAC;AACpB,YAAY,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACxE,YAAY,EACX,gBAAgB,EAChB,YAAY,EACZ,sBAAsB,EACtB,qBAAqB,EACrB,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,GACf,MAAM,eAAe,CAAC;AACvB,YAAY,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AACnC,YAAY,EAAE,aAAa,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAC1E,YAAY,EAAE,SAAS,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AACzE,YAAY,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACxE,YAAY,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAC/D,YAAY,EAAE,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACnE,YAAY,EACX,YAAY,EACZ,UAAU,EACV,eAAe,EACf,SAAS,EACT,UAAU,EACV,SAAS,GACT,MAAM,SAAS,CAAC;AACjB,YAAY,EAAE,UAAU,EAAE,CAAC"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Invitations: an invitation's record, and the port a store implements for
3
+ * them.
4
+ *
5
+ * **A port of its own, not a slot of `JanusStores`.** Invitations are opt-in
6
+ * (`janus({ invitations })`), and a new required slot would break every
7
+ * adapter that has not written it yet. It is not a `TokenKind` either: a
8
+ * preview reads an invitation without spending it, a claim can be released,
9
+ * and an organization lists its own. The rules every implementation keeps are
10
+ * the store port's, in `./index`.
11
+ */
12
+ export type { InvitationFilter, InvitationLapsedFilter, InvitationPageRequest, } from './page';
13
+ export type { InvitationId, InvitationPatch, InvitationRecord, InvitationStatus, } from './records';
14
+ export type { InvitationStore } from './store';
15
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/auth/port/types/invitations/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,YAAY,EACX,gBAAgB,EAChB,sBAAsB,EACtB,qBAAqB,GACrB,MAAM,QAAQ,CAAC;AAChB,YAAY,EACX,YAAY,EACZ,eAAe,EACf,gBAAgB,EAChB,gBAAgB,GAChB,MAAM,WAAW,CAAC;AACnB,YAAY,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC"}
@@ -0,0 +1,52 @@
1
+ import type { InvitationId, InvitationStatus } from './records';
2
+ /**
3
+ * The lapsed filter: lapsed means `pending` with `expiresAt` at or before
4
+ * `now` (the core's clock). `'exclude'` drops those and keeps every other
5
+ * record; `'only'` keeps only those.
6
+ */
7
+ export interface InvitationLapsedFilter {
8
+ readonly mode: 'exclude' | 'only';
9
+ readonly now: Date;
10
+ }
11
+ /** Which invitations of one scope a page lists, and how much of it to read. */
12
+ export interface InvitationPageRequest {
13
+ /** `null` for every status. */
14
+ readonly status: InvitationStatus | null;
15
+ /** Page size, already bounded by the core, between 1 and `MAX_PAGE_SIZE`. */
16
+ readonly first: number;
17
+ /**
18
+ * The last id of the previous page, or `null` for the first. It need not
19
+ * name a stored invitation: the page is every id strictly greater than it.
20
+ */
21
+ readonly after: InvitationId | null;
22
+ /**
23
+ * **Optional, additive.** Only the invitations whose `role` is this one;
24
+ * absent or `null` for every role.
25
+ */
26
+ readonly role?: string | null;
27
+ /**
28
+ * **Optional, additive.** Only the invitations whose `ref` is this one;
29
+ * absent or `null` for every ref.
30
+ */
31
+ readonly ref?: string | null;
32
+ /**
33
+ * **Optional, additive.** `'asc'` (the default) pages ids from the smallest
34
+ * up; `'desc'` pages newest first, ids from the greatest down, and `after`
35
+ * is then every id strictly **smaller** than it.
36
+ */
37
+ readonly order?: 'asc' | 'desc';
38
+ /** **Optional, additive.** The lapsed filter; absent or `null` for none. */
39
+ readonly lapsed?: InvitationLapsedFilter | null;
40
+ }
41
+ /** What {@link InvitationStore.countScopeInvitations} counts: the filters of a page, without paging. */
42
+ export interface InvitationFilter {
43
+ /** `null` for every status. */
44
+ readonly status: InvitationStatus | null;
45
+ /** `null` for every role. */
46
+ readonly role: string | null;
47
+ /** `null` for every ref. */
48
+ readonly ref: string | null;
49
+ /** **Optional, additive.** As {@link InvitationPageRequest.lapsed}. */
50
+ readonly lapsed?: InvitationLapsedFilter | null;
51
+ }
52
+ //# sourceMappingURL=page.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"page.d.ts","sourceRoot":"","sources":["../../../../../src/auth/port/types/invitations/page.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAEhE;;;;GAIG;AACH,MAAM,WAAW,sBAAsB;IACtC,QAAQ,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAAC;IAClC,QAAQ,CAAC,GAAG,EAAE,IAAI,CAAC;CACnB;AAED,+EAA+E;AAC/E,MAAM,WAAW,qBAAqB;IACrC,+BAA+B;IAC/B,QAAQ,CAAC,MAAM,EAAE,gBAAgB,GAAG,IAAI,CAAC;IACzC,6EAA6E;IAC7E,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,QAAQ,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI,CAAC;IACpC;;;OAGG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B;;;OAGG;IACH,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B;;;;OAIG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;IAChC,4EAA4E;IAC5E,QAAQ,CAAC,MAAM,CAAC,EAAE,sBAAsB,GAAG,IAAI,CAAC;CAChD;AAED,wGAAwG;AACxG,MAAM,WAAW,gBAAgB;IAChC,+BAA+B;IAC/B,QAAQ,CAAC,MAAM,EAAE,gBAAgB,GAAG,IAAI,CAAC;IACzC,6BAA6B;IAC7B,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,4BAA4B;IAC5B,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,uEAAuE;IACvE,QAAQ,CAAC,MAAM,CAAC,EAAE,sBAAsB,GAAG,IAAI,CAAC;CAChD"}
@@ -0,0 +1,101 @@
1
+ import type { Id } from '../../../../ids/id';
2
+ /** An invitation's id: a UUIDv7 minted by the core. */
3
+ export type InvitationId = string;
4
+ /** Where an invitation stands. `accepted` and `revoked` are final, except a released claim. */
5
+ export type InvitationStatus = 'pending' | 'accepted' | 'revoked';
6
+ /**
7
+ * An invitation, as a store holds it.
8
+ *
9
+ * **The code is never stored.** The core mints 32 random bytes, hands the
10
+ * store `sha256(code)` as `codeHash`, and gives the plain code to the
11
+ * application once, to put in the e-mail.
12
+ */
13
+ export interface InvitationRecord {
14
+ readonly id: InvitationId;
15
+ /** The organization (or any grouping) the invitation is into. Opaque to the store. */
16
+ readonly scope: string;
17
+ /** The invited address, **already normalised by the core**; stored as given. */
18
+ readonly email: string;
19
+ /** The name the inviter gave the invitee. */
20
+ readonly name: string;
21
+ /** The role the invitee takes on accepting. Opaque to the store. */
22
+ readonly role: string;
23
+ /** The language of the invitation e-mail, or `null` for the instance's default. */
24
+ readonly locale: string | null;
25
+ /**
26
+ * An opaque reference to the application's own record (a person row, say),
27
+ * 1 to 100 characters, or `null`. **Fixed at insertion**: not patchable,
28
+ * kept by `resend` and `revoke`. Absent on a record stored before the field
29
+ * existed, which reads as `null`. An adapter indexes it with the scope
30
+ * ({@link InvitationPageRequest.ref}).
31
+ */
32
+ readonly ref?: string | null;
33
+ /**
34
+ * The user type the invitation is for (a key of `invitations.type`), or
35
+ * `null`. **Fixed at insertion**: not patchable, kept by `resend` and
36
+ * `revoke`. **A store keeps it as given, `null` included**: the core reads a
37
+ * record without one (stored before the field existed) as the first type
38
+ * listed, and refuses to issue when several types are configured and the
39
+ * store does not return what it was given.
40
+ */
41
+ readonly type?: string | null;
42
+ /**
43
+ * What finds the invitation by its code. For an issued invitation, `sha256`
44
+ * of the code, hex. For one imported with `importHistory`, `import:` and 64
45
+ * hex digits, which no code hashes to. **Kept verbatim, whatever it holds,
46
+ * and unique across the store**: an adapter indexes it uniquely, which is
47
+ * what makes {@link InvitationStore.findInvitationByCodeHash} answer one
48
+ * record, and what lets `importHistory` find a record it imported before.
49
+ */
50
+ readonly codeHash: string;
51
+ /** Who sent it, or `null` when the system did (`issue({ invitedBy: null })`). */
52
+ readonly invitedBy: Id | null;
53
+ readonly status: InvitationStatus;
54
+ /**
55
+ * `0` at insertion, and one more on every accepted write. What
56
+ * {@link InvitationStore.updateInvitation}'s `ifVersion` is compared against.
57
+ */
58
+ readonly version: number;
59
+ readonly createdAt: Date;
60
+ readonly updatedAt: Date;
61
+ readonly expiresAt: Date;
62
+ /** Who accepted it; `null` until then. */
63
+ readonly acceptedBy: Id | null;
64
+ readonly acceptedAt: Date | null;
65
+ readonly revokedAt: Date | null;
66
+ /**
67
+ * **Optional, additive.** Who revoked it (the application's own user id,
68
+ * opaque to the store), or `null`. Absent on a record stored before the
69
+ * field existed, which reads as `null`.
70
+ */
71
+ readonly revokedBy?: string | null;
72
+ /**
73
+ * **Optional, additive.** Who sent it again last, or `null` when the last
74
+ * resend named nobody. Absent on a record stored before the field existed,
75
+ * which reads as `null`.
76
+ */
77
+ readonly resentBy?: string | null;
78
+ }
79
+ /**
80
+ * What one {@link InvitationStore.updateInvitation} changes. A field the
81
+ * patch does not name is left as it is; one it names is replaced whole.
82
+ * `updatedAt` is required and comes from the core's clock.
83
+ *
84
+ * `id`, `scope`, `email`, `invitedBy`, `version` and `createdAt` are not
85
+ * patchable. A key present with the value `undefined` is absent.
86
+ */
87
+ export interface InvitationPatch {
88
+ readonly updatedAt: Date;
89
+ readonly status?: InvitationStatus;
90
+ readonly codeHash?: string;
91
+ readonly expiresAt?: Date;
92
+ readonly name?: string;
93
+ readonly role?: string;
94
+ readonly locale?: string | null;
95
+ readonly acceptedBy?: Id | null;
96
+ readonly acceptedAt?: Date | null;
97
+ readonly revokedAt?: Date | null;
98
+ readonly revokedBy?: string | null;
99
+ readonly resentBy?: string | null;
100
+ }
101
+ //# sourceMappingURL=records.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"records.d.ts","sourceRoot":"","sources":["../../../../../src/auth/port/types/invitations/records.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAC;AAE7C,uDAAuD;AACvD,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC;AAElC,+FAA+F;AAC/F,MAAM,MAAM,gBAAgB,GAAG,SAAS,GAAG,UAAU,GAAG,SAAS,CAAC;AAElE;;;;;;GAMG;AACH,MAAM,WAAW,gBAAgB;IAChC,QAAQ,CAAC,EAAE,EAAE,YAAY,CAAC;IAC1B,sFAAsF;IACtF,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,gFAAgF;IAChF,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,6CAA6C;IAC7C,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,oEAAoE;IACpE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,mFAAmF;IACnF,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B;;;;;;OAMG;IACH,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B;;;;;;;OAOG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B;;;;;;;OAOG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,iFAAiF;IACjF,QAAQ,CAAC,SAAS,EAAE,EAAE,GAAG,IAAI,CAAC;IAC9B,QAAQ,CAAC,MAAM,EAAE,gBAAgB,CAAC;IAClC;;;OAGG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,SAAS,EAAE,IAAI,CAAC;IACzB,QAAQ,CAAC,SAAS,EAAE,IAAI,CAAC;IACzB,QAAQ,CAAC,SAAS,EAAE,IAAI,CAAC;IACzB,0CAA0C;IAC1C,QAAQ,CAAC,UAAU,EAAE,EAAE,GAAG,IAAI,CAAC;IAC/B,QAAQ,CAAC,UAAU,EAAE,IAAI,GAAG,IAAI,CAAC;IACjC,QAAQ,CAAC,SAAS,EAAE,IAAI,GAAG,IAAI,CAAC;IAChC;;;;OAIG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC;;;;OAIG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAClC;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,eAAe;IAC/B,QAAQ,CAAC,SAAS,EAAE,IAAI,CAAC;IACzB,QAAQ,CAAC,MAAM,CAAC,EAAE,gBAAgB,CAAC;IACnC,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,SAAS,CAAC,EAAE,IAAI,CAAC;IAC1B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,QAAQ,CAAC,UAAU,CAAC,EAAE,EAAE,GAAG,IAAI,CAAC;IAChC,QAAQ,CAAC,UAAU,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IAClC,QAAQ,CAAC,SAAS,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACjC,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAClC"}
@@ -0,0 +1,82 @@
1
+ import type { CursorPage } from '../../../../pagination/cursor-page';
2
+ import type { InvitationFilter, InvitationPageRequest } from './page';
3
+ import type { InvitationId, InvitationPatch, InvitationRecord } from './records';
4
+ /**
5
+ * Invitations. Every method is atomic on its own, and `null`, `false` and `0`
6
+ * are answers: only a failure throws (`StoreFailure`).
7
+ *
8
+ * **Expiry is the core's decision, not the store's.** A read answers a present
9
+ * record **verbatim**, lapsed or not, and must never answer a record it has
10
+ * *changed*.
11
+ */
12
+ export interface InvitationStore {
13
+ /**
14
+ * Stores a new invitation. **Idempotent by id**: when an invitation with
15
+ * this id exists, it writes nothing and answers `true`, so a retry is safe.
16
+ *
17
+ * Answers `false`, writing nothing, when the record is `pending` and
18
+ * another pending invitation already holds the same `scope` and `email`:
19
+ * **one pending invitation per scope and address**, a constraint (a
20
+ * partial unique index), never a read followed by a write.
21
+ */
22
+ insertInvitation(record: InvitationRecord): Promise<boolean>;
23
+ /** The invitation with this id, verbatim, or `null`. */
24
+ findInvitation(id: InvitationId): Promise<InvitationRecord | null>;
25
+ /** The invitation whose `codeHash` is this one, whatever its status, or `null`. */
26
+ findInvitationByCodeHash(codeHash: string): Promise<InvitationRecord | null>;
27
+ /**
28
+ * One scope's invitations, optionally of one status, in id order (creation
29
+ * order, or newest first when `page.order` is `'desc'`), optionally of one
30
+ * role or ref, and optionally without (or only) the lapsed ones: the store
31
+ * must honour `page.lapsed` (`pending` with `expiresAt <= now`). `nextCursor` is the last id of the page, or `null` on the
32
+ * last page. A scope without invitations has an empty page, never `null`.
33
+ */
34
+ listScopeInvitations(scope: string, page: InvitationPageRequest): Promise<CursorPage<InvitationRecord>>;
35
+ /**
36
+ * **Optional capability.** How many invitations of this scope match the
37
+ * filter, whatever the page: `pending` means the stored status, lapsed or
38
+ * not, as in a listing. The store must honour `filter.lapsed` (`pending`
39
+ * with `expiresAt <= now`) as the listing does. `0` is an answer. A store without it is counted by
40
+ * paging through {@link InvitationStore.listScopeInvitations}.
41
+ */
42
+ countScopeInvitations?(scope: string, filter: InvitationFilter): Promise<number>;
43
+ /**
44
+ * **Optional, additive.** The `pending` invitation this address holds in
45
+ * this scope, verbatim, lapsed or not, or `null`: at most one exists (one
46
+ * pending invitation per scope and address). The address is compared as
47
+ * stored, exactly. A store without it is searched by paging through
48
+ * {@link InvitationStore.listScopeInvitations} with `status: 'pending'`,
49
+ * which reads every pending invitation of the scope.
50
+ */
51
+ findPendingInvitation?(scope: string, email: string): Promise<InvitationRecord | null>;
52
+ /**
53
+ * How many invitations of this scope are `pending` and not lapsed
54
+ * (`expiresAt` strictly after `now`). `0` is an answer.
55
+ */
56
+ countPendingInvitations(scope: string, now: Date): Promise<number>;
57
+ /**
58
+ * Applies a patch **only if the stored version is exactly `ifVersion`**,
59
+ * and answers the record as written, with `version` one higher. This is
60
+ * how a claim is made: of concurrent claims on one version, exactly one
61
+ * wins.
62
+ *
63
+ * Answers `null`, writing nothing, when no invitation has this id.
64
+ * Throws, writing nothing, `StoreConflict('version', …)` when the version
65
+ * moved, and `StoreConflict('pending', …)` (code `INVITATION_PENDING`) when the patch sets `status` back
66
+ * to `pending` while another pending invitation holds the same scope and
67
+ * address.
68
+ */
69
+ updateInvitation(id: InvitationId, ifVersion: number, patch: InvitationPatch): Promise<InvitationRecord | null>;
70
+ /**
71
+ * Deletes every invitation of one scope, whatever its status, and answers
72
+ * how many. `0` is an answer. What deleting an organization calls.
73
+ */
74
+ deleteScopeInvitations(scope: string): Promise<number>;
75
+ /**
76
+ * **Optional capability.** Deletes every invitation whose `expiresAt` is at
77
+ * or before `before`, and answers how many. A store with its own expiry
78
+ * does not implement it.
79
+ */
80
+ deleteExpiredInvitations?(before: Date): Promise<number>;
81
+ }
82
+ //# sourceMappingURL=store.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../../../../src/auth/port/types/invitations/store.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAC;AACrE,OAAO,KAAK,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,QAAQ,CAAC;AACtE,OAAO,KAAK,EACX,YAAY,EACZ,eAAe,EACf,gBAAgB,EAChB,MAAM,WAAW,CAAC;AAEnB;;;;;;;GAOG;AACH,MAAM,WAAW,eAAe;IAC/B;;;;;;;;OAQG;IACH,gBAAgB,CAAC,MAAM,EAAE,gBAAgB,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAE7D,wDAAwD;IACxD,cAAc,CAAC,EAAE,EAAE,YAAY,GAAG,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAAC;IAEnE,mFAAmF;IACnF,wBAAwB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAAC;IAE7E;;;;;;OAMG;IACH,oBAAoB,CACnB,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,qBAAqB,GACzB,OAAO,CAAC,UAAU,CAAC,gBAAgB,CAAC,CAAC,CAAC;IAEzC;;;;;;OAMG;IACH,qBAAqB,CAAC,CACrB,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,gBAAgB,GACtB,OAAO,CAAC,MAAM,CAAC,CAAC;IAEnB;;;;;;;OAOG;IACH,qBAAqB,CAAC,CACrB,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,GACX,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAAC;IAEpC;;;OAGG;IACH,uBAAuB,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAEnE;;;;;;;;;;;OAWG;IACH,gBAAgB,CACf,EAAE,EAAE,YAAY,EAChB,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,eAAe,GACpB,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAAC;IAEpC;;;OAGG;IACH,sBAAsB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAEvD;;;;OAIG;IACH,wBAAwB,CAAC,CAAC,MAAM,EAAE,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CACzD"}
@@ -0,0 +1,27 @@
1
+ /**
2
+ * What a store round-trips in a user's fields: JSON, and nothing else.
3
+ *
4
+ * Part of the store port; the rules every implementation keeps are in
5
+ * `./index`.
6
+ */
7
+ /**
8
+ * A value a store must be able to round-trip byte for byte.
9
+ *
10
+ * JSON and nothing else. A `Date` inside fields round-trips through MongoDB and
11
+ * not through a JSON column or Redis, so an adapter could pass the conformance
12
+ * suite on one database and corrupt fields on the next. The record's own
13
+ * timestamps are `Date`s, because every adapter stores those in a column it
14
+ * chose for them.
15
+ */
16
+ export type Json = string | number | boolean | null | readonly Json[] | JsonObject;
17
+ /**
18
+ * An object of {@link Json} values.
19
+ *
20
+ * An `interface` declared by the application is not assignable to this — an
21
+ * index signature is only satisfied by a type alias. The core never asks a
22
+ * caller to write one: it casts at the boundary, after validation.
23
+ */
24
+ export type JsonObject = {
25
+ readonly [key: string]: Json;
26
+ };
27
+ //# sourceMappingURL=json.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"json.d.ts","sourceRoot":"","sources":["../../../../src/auth/port/types/json.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;;;;;;GAQG;AACH,MAAM,MAAM,IAAI,GACb,MAAM,GACN,MAAM,GACN,OAAO,GACP,IAAI,GACJ,SAAS,IAAI,EAAE,GACf,UAAU,CAAC;AAEd;;;;;;GAMG;AACH,MAAM,MAAM,UAAU,GAAG;IAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CAAC"}