@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.
- package/LICENSE +21 -0
- package/README.md +2928 -2
- package/dist/auth/api-keys/authenticate-key.d.ts +21 -0
- package/dist/auth/api-keys/authenticate-key.d.ts.map +1 -0
- package/dist/auth/api-keys/bound.d.ts +11 -0
- package/dist/auth/api-keys/bound.d.ts.map +1 -0
- package/dist/auth/api-keys/count.d.ts +8 -0
- package/dist/auth/api-keys/count.d.ts.map +1 -0
- package/dist/auth/api-keys/create/checks.d.ts +42 -0
- package/dist/auth/api-keys/create/checks.d.ts.map +1 -0
- package/dist/auth/api-keys/create/index.d.ts +10 -0
- package/dist/auth/api-keys/create/index.d.ts.map +1 -0
- package/dist/auth/api-keys/events.d.ts +22 -0
- package/dist/auth/api-keys/events.d.ts.map +1 -0
- package/dist/auth/api-keys/expiry.d.ts +11 -0
- package/dist/auth/api-keys/expiry.d.ts.map +1 -0
- package/dist/auth/api-keys/flows.d.ts +13 -0
- package/dist/auth/api-keys/flows.d.ts.map +1 -0
- package/dist/auth/api-keys/index.d.ts +11 -0
- package/dist/auth/api-keys/index.d.ts.map +1 -0
- package/dist/auth/api-keys/read.d.ts +10 -0
- package/dist/auth/api-keys/read.d.ts.map +1 -0
- package/dist/auth/api-keys/shape.d.ts +24 -0
- package/dist/auth/api-keys/shape.d.ts.map +1 -0
- package/dist/auth/api-keys/to-api-key.d.ts +8 -0
- package/dist/auth/api-keys/to-api-key.d.ts.map +1 -0
- package/dist/auth/api-keys/token.d.ts +23 -0
- package/dist/auth/api-keys/token.d.ts.map +1 -0
- package/dist/auth/api-keys/user-bound.d.ts +10 -0
- package/dist/auth/api-keys/user-bound.d.ts.map +1 -0
- package/dist/auth/at.d.ts +9 -0
- package/dist/auth/at.d.ts.map +1 -0
- package/dist/auth/avatar/any-type.d.ts +13 -0
- package/dist/auth/avatar/any-type.d.ts.map +1 -0
- package/dist/auth/avatar/flows.d.ts +7 -0
- package/dist/auth/avatar/flows.d.ts.map +1 -0
- package/dist/auth/avatar/id.d.ts +10 -0
- package/dist/auth/avatar/id.d.ts.map +1 -0
- package/dist/auth/avatar/index.d.ts +7 -0
- package/dist/auth/avatar/index.d.ts.map +1 -0
- package/dist/auth/avatar/remove.d.ts +10 -0
- package/dist/auth/avatar/remove.d.ts.map +1 -0
- package/dist/auth/avatar/set.d.ts +12 -0
- package/dist/auth/avatar/set.d.ts.map +1 -0
- package/dist/auth/concurrency-limit.d.ts +13 -0
- package/dist/auth/concurrency-limit.d.ts.map +1 -0
- package/dist/auth/config/api-keys-config.d.ts +33 -0
- package/dist/auth/config/api-keys-config.d.ts.map +1 -0
- package/dist/auth/config/hasher.d.ts +22 -0
- package/dist/auth/config/hasher.d.ts.map +1 -0
- package/dist/auth/config/index.d.ts +24 -0
- package/dist/auth/config/index.d.ts.map +1 -0
- package/dist/auth/config/invitations-config.d.ts +74 -0
- package/dist/auth/config/invitations-config.d.ts.map +1 -0
- package/dist/auth/config/janus-config.d.ts +233 -0
- package/dist/auth/config/janus-config.d.ts.map +1 -0
- package/dist/auth/config/magic-link-config.d.ts +6 -0
- package/dist/auth/config/magic-link-config.d.ts.map +1 -0
- package/dist/auth/config/names.d.ts +9 -0
- package/dist/auth/config/names.d.ts.map +1 -0
- package/dist/auth/config/normalize.d.ts +26 -0
- package/dist/auth/config/normalize.d.ts.map +1 -0
- package/dist/auth/config/passkeys-config.d.ts +49 -0
- package/dist/auth/config/passkeys-config.d.ts.map +1 -0
- package/dist/auth/config/password-config.d.ts +22 -0
- package/dist/auth/config/password-config.d.ts.map +1 -0
- package/dist/auth/config/reserved.d.ts +14 -0
- package/dist/auth/config/reserved.d.ts.map +1 -0
- package/dist/auth/config/resolve-api-keys.d.ts +5 -0
- package/dist/auth/config/resolve-api-keys.d.ts.map +1 -0
- package/dist/auth/config/resolve-config.d.ts +9 -0
- package/dist/auth/config/resolve-config.d.ts.map +1 -0
- package/dist/auth/config/resolve-cookie.d.ts +5 -0
- package/dist/auth/config/resolve-cookie.d.ts.map +1 -0
- package/dist/auth/config/resolve-devices.d.ts +5 -0
- package/dist/auth/config/resolve-devices.d.ts.map +1 -0
- package/dist/auth/config/resolve-invitation-types.d.ts +5 -0
- package/dist/auth/config/resolve-invitation-types.d.ts.map +1 -0
- package/dist/auth/config/resolve-invitations.d.ts +5 -0
- package/dist/auth/config/resolve-invitations.d.ts.map +1 -0
- package/dist/auth/config/resolve-magic-link.d.ts +4 -0
- package/dist/auth/config/resolve-magic-link.d.ts.map +1 -0
- package/dist/auth/config/resolve-passkeys.d.ts +5 -0
- package/dist/auth/config/resolve-passkeys.d.ts.map +1 -0
- package/dist/auth/config/resolve-second-factor.d.ts +5 -0
- package/dist/auth/config/resolve-second-factor.d.ts.map +1 -0
- package/dist/auth/config/resolve-social.d.ts +17 -0
- package/dist/auth/config/resolve-social.d.ts.map +1 -0
- package/dist/auth/config/resolve-throttle.d.ts +37 -0
- package/dist/auth/config/resolve-throttle.d.ts.map +1 -0
- package/dist/auth/config/resolve-type.d.ts +6 -0
- package/dist/auth/config/resolve-type.d.ts.map +1 -0
- package/dist/auth/config/resolved-config.d.ts +126 -0
- package/dist/auth/config/resolved-config.d.ts.map +1 -0
- package/dist/auth/config/social-config.d.ts +154 -0
- package/dist/auth/config/social-config.d.ts.map +1 -0
- package/dist/auth/config/user-type.d.ts +79 -0
- package/dist/auth/config/user-type.d.ts.map +1 -0
- package/dist/auth/config/warn-throttle-window.d.ts +14 -0
- package/dist/auth/config/warn-throttle-window.d.ts.map +1 -0
- package/dist/auth/context/create-context.d.ts +31 -0
- package/dist/auth/context/create-context.d.ts.map +1 -0
- package/dist/auth/context/index.d.ts +17 -0
- package/dist/auth/context/index.d.ts.map +1 -0
- package/dist/auth/context/logins.d.ts +28 -0
- package/dist/auth/context/logins.d.ts.map +1 -0
- package/dist/auth/context/password.d.ts +34 -0
- package/dist/auth/context/password.d.ts.map +1 -0
- package/dist/auth/context/records.d.ts +27 -0
- package/dist/auth/context/records.d.ts.map +1 -0
- package/dist/auth/context/user.d.ts +21 -0
- package/dist/auth/context/user.d.ts.map +1 -0
- package/dist/auth/context/validate-fields.d.ts +12 -0
- package/dist/auth/context/validate-fields.d.ts.map +1 -0
- package/dist/auth/counter-key.d.ts +20 -0
- package/dist/auth/counter-key.d.ts.map +1 -0
- package/dist/auth/derived-keys.d.ts +9 -0
- package/dist/auth/derived-keys.d.ts.map +1 -0
- package/dist/auth/devices/cookie.d.ts +56 -0
- package/dist/auth/devices/cookie.d.ts.map +1 -0
- package/dist/auth/devices/hint.d.ts +42 -0
- package/dist/auth/devices/hint.d.ts.map +1 -0
- package/dist/auth/devices/index.d.ts +11 -0
- package/dist/auth/devices/index.d.ts.map +1 -0
- package/dist/auth/devices/report.d.ts +11 -0
- package/dist/auth/devices/report.d.ts.map +1 -0
- package/dist/auth/devices/token.d.ts +13 -0
- package/dist/auth/devices/token.d.ts.map +1 -0
- package/dist/auth/email-flows/any-type-change-email.d.ts +18 -0
- package/dist/auth/email-flows/any-type-change-email.d.ts.map +1 -0
- package/dist/auth/email-flows/any-type-reset-password.d.ts +19 -0
- package/dist/auth/email-flows/any-type-reset-password.d.ts.map +1 -0
- package/dist/auth/email-flows/any-type-verify-email.d.ts +18 -0
- package/dist/auth/email-flows/any-type-verify-email.d.ts.map +1 -0
- package/dist/auth/email-flows/change-email-token.d.ts +47 -0
- package/dist/auth/email-flows/change-email-token.d.ts.map +1 -0
- package/dist/auth/email-flows/change-email.d.ts +17 -0
- package/dist/auth/email-flows/change-email.d.ts.map +1 -0
- package/dist/auth/email-flows/confirm-reset.d.ts +16 -0
- package/dist/auth/email-flows/confirm-reset.d.ts.map +1 -0
- package/dist/auth/email-flows/email-token.d.ts +30 -0
- package/dist/auth/email-flows/email-token.d.ts.map +1 -0
- package/dist/auth/email-flows/flows.d.ts +13 -0
- package/dist/auth/email-flows/flows.d.ts.map +1 -0
- package/dist/auth/email-flows/index.d.ts +10 -0
- package/dist/auth/email-flows/index.d.ts.map +1 -0
- package/dist/auth/email-flows/owner-of.d.ts +17 -0
- package/dist/auth/email-flows/owner-of.d.ts.map +1 -0
- package/dist/auth/email-flows/prove-first.d.ts +45 -0
- package/dist/auth/email-flows/prove-first.d.ts.map +1 -0
- package/dist/auth/email-flows/reset-password.d.ts +17 -0
- package/dist/auth/email-flows/reset-password.d.ts.map +1 -0
- package/dist/auth/email-flows/set-email-verified.d.ts +19 -0
- package/dist/auth/email-flows/set-email-verified.d.ts.map +1 -0
- package/dist/auth/email-flows/verify-email.d.ts +25 -0
- package/dist/auth/email-flows/verify-email.d.ts.map +1 -0
- package/dist/auth/email-sign-in.d.ts +51 -0
- package/dist/auth/email-sign-in.d.ts.map +1 -0
- package/dist/auth/events.d.ts +166 -0
- package/dist/auth/events.d.ts.map +1 -0
- package/dist/auth/first-proof.d.ts +43 -0
- package/dist/auth/first-proof.d.ts.map +1 -0
- package/dist/auth/hashers.d.ts +52 -0
- package/dist/auth/hashers.d.ts.map +1 -0
- package/dist/auth/index.d.ts +22 -0
- package/dist/auth/index.d.ts.map +1 -0
- package/dist/auth/invitations/accept.d.ts +10 -0
- package/dist/auth/invitations/accept.d.ts.map +1 -0
- package/dist/auth/invitations/change-pending.d.ts +17 -0
- package/dist/auth/invitations/change-pending.d.ts.map +1 -0
- package/dist/auth/invitations/claim.d.ts +31 -0
- package/dist/auth/invitations/claim.d.ts.map +1 -0
- package/dist/auth/invitations/events.d.ts +46 -0
- package/dist/auth/invitations/events.d.ts.map +1 -0
- package/dist/auth/invitations/find-invitee.d.ts +20 -0
- package/dist/auth/invitations/find-invitee.d.ts.map +1 -0
- package/dist/auth/invitations/find-pending.d.ts +5 -0
- package/dist/auth/invitations/find-pending.d.ts.map +1 -0
- package/dist/auth/invitations/flows.d.ts +7 -0
- package/dist/auth/invitations/flows.d.ts.map +1 -0
- package/dist/auth/invitations/history-input.d.ts +29 -0
- package/dist/auth/invitations/history-input.d.ts.map +1 -0
- package/dist/auth/invitations/history.d.ts +10 -0
- package/dist/auth/invitations/history.d.ts.map +1 -0
- package/dist/auth/invitations/index.d.ts +11 -0
- package/dist/auth/invitations/index.d.ts.map +1 -0
- package/dist/auth/invitations/input.d.ts +30 -0
- package/dist/auth/invitations/input.d.ts.map +1 -0
- package/dist/auth/invitations/invited-type.d.ts +22 -0
- package/dist/auth/invitations/invited-type.d.ts.map +1 -0
- package/dist/auth/invitations/invitee.d.ts +11 -0
- package/dist/auth/invitations/invitee.d.ts.map +1 -0
- package/dist/auth/invitations/issue.d.ts +9 -0
- package/dist/auth/invitations/issue.d.ts.map +1 -0
- package/dist/auth/invitations/limit.d.ts +7 -0
- package/dist/auth/invitations/limit.d.ts.map +1 -0
- package/dist/auth/invitations/password-invitee.d.ts +18 -0
- package/dist/auth/invitations/password-invitee.d.ts.map +1 -0
- package/dist/auth/invitations/passwordless-invitee.d.ts +13 -0
- package/dist/auth/invitations/passwordless-invitee.d.ts.map +1 -0
- package/dist/auth/invitations/preview.d.ts +8 -0
- package/dist/auth/invitations/preview.d.ts.map +1 -0
- package/dist/auth/invitations/read.d.ts +10 -0
- package/dist/auth/invitations/read.d.ts.map +1 -0
- package/dist/auth/invitations/resend.d.ts +12 -0
- package/dist/auth/invitations/resend.d.ts.map +1 -0
- package/dist/auth/invitations/to-invitation.d.ts +11 -0
- package/dist/auth/invitations/to-invitation.d.ts.map +1 -0
- package/dist/auth/invitations/write.d.ts +17 -0
- package/dist/auth/invitations/write.d.ts.map +1 -0
- package/dist/auth/issuers/cache.d.ts +21 -0
- package/dist/auth/issuers/cache.d.ts.map +1 -0
- package/dist/auth/issuers/create.d.ts +18 -0
- package/dist/auth/issuers/create.d.ts.map +1 -0
- package/dist/auth/issuers/index.d.ts +3 -0
- package/dist/auth/issuers/index.d.ts.map +1 -0
- package/dist/auth/issuers/types.d.ts +45 -0
- package/dist/auth/issuers/types.d.ts.map +1 -0
- package/dist/auth/janus.d.ts +39 -0
- package/dist/auth/janus.d.ts.map +1 -0
- package/dist/auth/magic-link.d.ts +25 -0
- package/dist/auth/magic-link.d.ts.map +1 -0
- package/dist/auth/mail-requests.d.ts +55 -0
- package/dist/auth/mail-requests.d.ts.map +1 -0
- package/dist/auth/one-time/codes.d.ts +46 -0
- package/dist/auth/one-time/codes.d.ts.map +1 -0
- package/dist/auth/one-time/index.d.ts +15 -0
- package/dist/auth/one-time/index.d.ts.map +1 -0
- package/dist/auth/one-time/issue.d.ts +45 -0
- package/dist/auth/one-time/issue.d.ts.map +1 -0
- package/dist/auth/one-time/refusals.d.ts +26 -0
- package/dist/auth/one-time/refusals.d.ts.map +1 -0
- package/dist/auth/one-time/spend.d.ts +24 -0
- package/dist/auth/one-time/spend.d.ts.map +1 -0
- package/dist/auth/one-time/window.d.ts +50 -0
- package/dist/auth/one-time/window.d.ts.map +1 -0
- package/dist/auth/outage.d.ts +66 -0
- package/dist/auth/outage.d.ts.map +1 -0
- package/dist/auth/parse-sealing-keys.d.ts +26 -0
- package/dist/auth/parse-sealing-keys.d.ts.map +1 -0
- package/dist/auth/passkeys/assert.d.ts +51 -0
- package/dist/auth/passkeys/assert.d.ts.map +1 -0
- package/dist/auth/passkeys/assertion-options.d.ts +9 -0
- package/dist/auth/passkeys/assertion-options.d.ts.map +1 -0
- package/dist/auth/passkeys/challenge.d.ts +19 -0
- package/dist/auth/passkeys/challenge.d.ts.map +1 -0
- package/dist/auth/passkeys/commit.d.ts +33 -0
- package/dist/auth/passkeys/commit.d.ts.map +1 -0
- package/dist/auth/passkeys/flows.d.ts +13 -0
- package/dist/auth/passkeys/flows.d.ts.map +1 -0
- package/dist/auth/passkeys/index.d.ts +12 -0
- package/dist/auth/passkeys/index.d.ts.map +1 -0
- package/dist/auth/passkeys/manage.d.ts +11 -0
- package/dist/auth/passkeys/manage.d.ts.map +1 -0
- package/dist/auth/passkeys/name.d.ts +4 -0
- package/dist/auth/passkeys/name.d.ts.map +1 -0
- package/dist/auth/passkeys/register.d.ts +20 -0
- package/dist/auth/passkeys/register.d.ts.map +1 -0
- package/dist/auth/passkeys/registration-options.d.ts +22 -0
- package/dist/auth/passkeys/registration-options.d.ts.map +1 -0
- package/dist/auth/passkeys/remove-all.d.ts +26 -0
- package/dist/auth/passkeys/remove-all.d.ts.map +1 -0
- package/dist/auth/passkeys/sign-in-options.d.ts +12 -0
- package/dist/auth/passkeys/sign-in-options.d.ts.map +1 -0
- package/dist/auth/passkeys/sign-in.d.ts +21 -0
- package/dist/auth/passkeys/sign-in.d.ts.map +1 -0
- package/dist/auth/passkeys/verifier.d.ts +113 -0
- package/dist/auth/passkeys/verifier.d.ts.map +1 -0
- package/dist/auth/passkeys/view.d.ts +5 -0
- package/dist/auth/passkeys/view.d.ts.map +1 -0
- package/dist/auth/passkeys/wiring.d.ts +24 -0
- package/dist/auth/passkeys/wiring.d.ts.map +1 -0
- package/dist/auth/password-written.d.ts +55 -0
- package/dist/auth/password-written.d.ts.map +1 -0
- package/dist/auth/port/assert-api-keys.d.ts +21 -0
- package/dist/auth/port/assert-api-keys.d.ts.map +1 -0
- package/dist/auth/port/assert-invitations.d.ts +15 -0
- package/dist/auth/port/assert-invitations.d.ts.map +1 -0
- package/dist/auth/port/assert-stores.d.ts +16 -0
- package/dist/auth/port/assert-stores.d.ts.map +1 -0
- package/dist/auth/port/memory/api-keys/capabilities.d.ts +8 -0
- package/dist/auth/port/memory/api-keys/capabilities.d.ts.map +1 -0
- package/dist/auth/port/memory/api-keys/index.d.ts +13 -0
- package/dist/auth/port/memory/api-keys/index.d.ts.map +1 -0
- package/dist/auth/port/memory/api-keys/pages.d.ts +7 -0
- package/dist/auth/port/memory/api-keys/pages.d.ts.map +1 -0
- package/dist/auth/port/memory/copy.d.ts +6 -0
- package/dist/auth/port/memory/copy.d.ts.map +1 -0
- package/dist/auth/port/memory/index.d.ts +10 -0
- package/dist/auth/port/memory/index.d.ts.map +1 -0
- package/dist/auth/port/memory/invitations-pending.d.ts +6 -0
- package/dist/auth/port/memory/invitations-pending.d.ts.map +1 -0
- package/dist/auth/port/memory/invitations.d.ts +12 -0
- package/dist/auth/port/memory/invitations.d.ts.map +1 -0
- package/dist/auth/port/memory/passkeys.d.ts +9 -0
- package/dist/auth/port/memory/passkeys.d.ts.map +1 -0
- package/dist/auth/port/memory/sessions.d.ts +4 -0
- package/dist/auth/port/memory/sessions.d.ts.map +1 -0
- package/dist/auth/port/memory/social-links.d.ts +10 -0
- package/dist/auth/port/memory/social-links.d.ts.map +1 -0
- package/dist/auth/port/memory/stores.d.ts +26 -0
- package/dist/auth/port/memory/stores.d.ts.map +1 -0
- package/dist/auth/port/memory/tokens.d.ts +4 -0
- package/dist/auth/port/memory/tokens.d.ts.map +1 -0
- package/dist/auth/port/memory/user-index.d.ts +20 -0
- package/dist/auth/port/memory/user-index.d.ts.map +1 -0
- package/dist/auth/port/memory/user-update.d.ts +10 -0
- package/dist/auth/port/memory/user-update.d.ts.map +1 -0
- package/dist/auth/port/memory/users.d.ts +4 -0
- package/dist/auth/port/memory/users.d.ts.map +1 -0
- package/dist/auth/port/types/api-keys.d.ts +199 -0
- package/dist/auth/port/types/api-keys.d.ts.map +1 -0
- package/dist/auth/port/types/credentials.d.ts +46 -0
- package/dist/auth/port/types/credentials.d.ts.map +1 -0
- package/dist/auth/port/types/index.d.ts +75 -0
- package/dist/auth/port/types/index.d.ts.map +1 -0
- package/dist/auth/port/types/invitations/index.d.ts +15 -0
- package/dist/auth/port/types/invitations/index.d.ts.map +1 -0
- package/dist/auth/port/types/invitations/page.d.ts +52 -0
- package/dist/auth/port/types/invitations/page.d.ts.map +1 -0
- package/dist/auth/port/types/invitations/records.d.ts +101 -0
- package/dist/auth/port/types/invitations/records.d.ts.map +1 -0
- package/dist/auth/port/types/invitations/store.d.ts +82 -0
- package/dist/auth/port/types/invitations/store.d.ts.map +1 -0
- package/dist/auth/port/types/json.d.ts +27 -0
- package/dist/auth/port/types/json.d.ts.map +1 -0
- package/dist/auth/port/types/passkeys.d.ts +94 -0
- package/dist/auth/port/types/passkeys.d.ts.map +1 -0
- package/dist/auth/port/types/sessions.d.ts +142 -0
- package/dist/auth/port/types/sessions.d.ts.map +1 -0
- package/dist/auth/port/types/social-links.d.ts +64 -0
- package/dist/auth/port/types/social-links.d.ts.map +1 -0
- package/dist/auth/port/types/stores.d.ts +48 -0
- package/dist/auth/port/types/stores.d.ts.map +1 -0
- package/dist/auth/port/types/tokens.d.ts +168 -0
- package/dist/auth/port/types/tokens.d.ts.map +1 -0
- package/dist/auth/port/types/users.d.ts +260 -0
- package/dist/auth/port/types/users.d.ts.map +1 -0
- package/dist/auth/prepared.d.ts +21 -0
- package/dist/auth/prepared.d.ts.map +1 -0
- package/dist/auth/proven-sign-in.d.ts +22 -0
- package/dist/auth/proven-sign-in.d.ts.map +1 -0
- package/dist/auth/sealer-for.d.ts +44 -0
- package/dist/auth/sealer-for.d.ts.map +1 -0
- package/dist/auth/sealing.d.ts +36 -0
- package/dist/auth/sealing.d.ts.map +1 -0
- package/dist/auth/second-factor/activate.d.ts +9 -0
- package/dist/auth/second-factor/activate.d.ts.map +1 -0
- package/dist/auth/second-factor/app-code-attempts.d.ts +47 -0
- package/dist/auth/second-factor/app-code-attempts.d.ts.map +1 -0
- package/dist/auth/second-factor/challenge.d.ts +15 -0
- package/dist/auth/second-factor/challenge.d.ts.map +1 -0
- package/dist/auth/second-factor/codes-left.d.ts +14 -0
- package/dist/auth/second-factor/codes-left.d.ts.map +1 -0
- package/dist/auth/second-factor/disable.d.ts +10 -0
- package/dist/auth/second-factor/disable.d.ts.map +1 -0
- package/dist/auth/second-factor/enroll.d.ts +6 -0
- package/dist/auth/second-factor/enroll.d.ts.map +1 -0
- package/dist/auth/second-factor/factor.d.ts +33 -0
- package/dist/auth/second-factor/factor.d.ts.map +1 -0
- package/dist/auth/second-factor/flows.d.ts +36 -0
- package/dist/auth/second-factor/flows.d.ts.map +1 -0
- package/dist/auth/second-factor/lifecycle.d.ts +14 -0
- package/dist/auth/second-factor/lifecycle.d.ts.map +1 -0
- package/dist/auth/second-factor/passkey-confirm.d.ts +21 -0
- package/dist/auth/second-factor/passkey-confirm.d.ts.map +1 -0
- package/dist/auth/second-factor/recovery-codes.d.ts +36 -0
- package/dist/auth/second-factor/recovery-codes.d.ts.map +1 -0
- package/dist/auth/second-factor/recovery.d.ts +20 -0
- package/dist/auth/second-factor/recovery.d.ts.map +1 -0
- package/dist/auth/second-factor/redeem.d.ts +42 -0
- package/dist/auth/second-factor/redeem.d.ts.map +1 -0
- package/dist/auth/second-factor/refusal.d.ts +6 -0
- package/dist/auth/second-factor/refusal.d.ts.map +1 -0
- package/dist/auth/second-factor/regenerate.d.ts +12 -0
- package/dist/auth/second-factor/regenerate.d.ts.map +1 -0
- package/dist/auth/second-factor/reseal.d.ts +17 -0
- package/dist/auth/second-factor/reseal.d.ts.map +1 -0
- package/dist/auth/second-factor/spend-recovery-code.d.ts +15 -0
- package/dist/auth/second-factor/spend-recovery-code.d.ts.map +1 -0
- package/dist/auth/secrets.d.ts +17 -0
- package/dist/auth/secrets.d.ts.map +1 -0
- package/dist/auth/sessions/amr.d.ts +36 -0
- package/dist/auth/sessions/amr.d.ts.map +1 -0
- package/dist/auth/sessions/authenticate.d.ts +12 -0
- package/dist/auth/sessions/authenticate.d.ts.map +1 -0
- package/dist/auth/sessions/collect-expired.d.ts +15 -0
- package/dist/auth/sessions/collect-expired.d.ts.map +1 -0
- package/dist/auth/sessions/cookie.d.ts +9 -0
- package/dist/auth/sessions/cookie.d.ts.map +1 -0
- package/dist/auth/sessions/fresh.d.ts +35 -0
- package/dist/auth/sessions/fresh.d.ts.map +1 -0
- package/dist/auth/sessions/index.d.ts +12 -0
- package/dist/auth/sessions/index.d.ts.map +1 -0
- package/dist/auth/sessions/open-session.d.ts +22 -0
- package/dist/auth/sessions/open-session.d.ts.map +1 -0
- package/dist/auth/sessions/presented-token.d.ts +25 -0
- package/dist/auth/sessions/presented-token.d.ts.map +1 -0
- package/dist/auth/sessions/shared-api.d.ts +17 -0
- package/dist/auth/sessions/shared-api.d.ts.map +1 -0
- package/dist/auth/sessions/standing.d.ts +32 -0
- package/dist/auth/sessions/standing.d.ts.map +1 -0
- package/dist/auth/shared-api.d.ts +139 -0
- package/dist/auth/shared-api.d.ts.map +1 -0
- package/dist/auth/sign-in-attempts.d.ts +45 -0
- package/dist/auth/sign-in-attempts.d.ts.map +1 -0
- package/dist/auth/sign-in-code.d.ts +26 -0
- package/dist/auth/sign-in-code.d.ts.map +1 -0
- package/dist/auth/social/attach.d.ts +31 -0
- package/dist/auth/social/attach.d.ts.map +1 -0
- package/dist/auth/social/begin.d.ts +30 -0
- package/dist/auth/social/begin.d.ts.map +1 -0
- package/dist/auth/social/complete-link.d.ts +17 -0
- package/dist/auth/social/complete-link.d.ts.map +1 -0
- package/dist/auth/social/complete.d.ts +54 -0
- package/dist/auth/social/complete.d.ts.map +1 -0
- package/dist/auth/social/cookie.d.ts +16 -0
- package/dist/auth/social/cookie.d.ts.map +1 -0
- package/dist/auth/social/find-provider.d.ts +23 -0
- package/dist/auth/social/find-provider.d.ts.map +1 -0
- package/dist/auth/social/finish.d.ts +60 -0
- package/dist/auth/social/finish.d.ts.map +1 -0
- package/dist/auth/social/flow-cookie-value.d.ts +26 -0
- package/dist/auth/social/flow-cookie-value.d.ts.map +1 -0
- package/dist/auth/social/flow-secret.d.ts +40 -0
- package/dist/auth/social/flow-secret.d.ts.map +1 -0
- package/dist/auth/social/index.d.ts +19 -0
- package/dist/auth/social/index.d.ts.map +1 -0
- package/dist/auth/social/link-holder.d.ts +33 -0
- package/dist/auth/social/link-holder.d.ts.map +1 -0
- package/dist/auth/social/provider-call.d.ts +31 -0
- package/dist/auth/social/provider-call.d.ts.map +1 -0
- package/dist/auth/social/redeem.d.ts +45 -0
- package/dist/auth/social/redeem.d.ts.map +1 -0
- package/dist/auth/social/return-to.d.ts +18 -0
- package/dist/auth/social/return-to.d.ts.map +1 -0
- package/dist/auth/social/sign-in.d.ts +41 -0
- package/dist/auth/social/sign-in.d.ts.map +1 -0
- package/dist/auth/social/sign-up.d.ts +37 -0
- package/dist/auth/social/sign-up.d.ts.map +1 -0
- package/dist/auth/social/start.d.ts +21 -0
- package/dist/auth/social/start.d.ts.map +1 -0
- package/dist/auth/social/step-up-proof.d.ts +26 -0
- package/dist/auth/social/step-up-proof.d.ts.map +1 -0
- package/dist/auth/social/step-up-request.d.ts +28 -0
- package/dist/auth/social/step-up-request.d.ts.map +1 -0
- package/dist/auth/social/step-up.d.ts +19 -0
- package/dist/auth/social/step-up.d.ts.map +1 -0
- package/dist/auth/social/types-of.d.ts +12 -0
- package/dist/auth/social/types-of.d.ts.map +1 -0
- package/dist/auth/social/unlink.d.ts +16 -0
- package/dist/auth/social/unlink.d.ts.map +1 -0
- package/dist/auth/social/wiring.d.ts +10 -0
- package/dist/auth/social/wiring.d.ts.map +1 -0
- package/dist/auth/standard-schema.d.ts +41 -0
- package/dist/auth/standard-schema.d.ts.map +1 -0
- package/dist/auth/step-up/codes.d.ts +35 -0
- package/dist/auth/step-up/codes.d.ts.map +1 -0
- package/dist/auth/step-up/flows.d.ts +18 -0
- package/dist/auth/step-up/flows.d.ts.map +1 -0
- package/dist/auth/step-up/open.d.ts +23 -0
- package/dist/auth/step-up/open.d.ts.map +1 -0
- package/dist/auth/step-up/passkey.d.ts +31 -0
- package/dist/auth/step-up/passkey.d.ts.map +1 -0
- package/dist/auth/step-up/request.d.ts +15 -0
- package/dist/auth/step-up/request.d.ts.map +1 -0
- package/dist/auth/step-up/spend.d.ts +4 -0
- package/dist/auth/step-up/spend.d.ts.map +1 -0
- package/dist/auth/totp.d.ts +36 -0
- package/dist/auth/totp.d.ts.map +1 -0
- package/dist/auth/types/api-keys-of.d.ts +19 -0
- package/dist/auth/types/api-keys-of.d.ts.map +1 -0
- package/dist/auth/types/api-keys.d.ts +164 -0
- package/dist/auth/types/api-keys.d.ts.map +1 -0
- package/dist/auth/types/avatar.d.ts +72 -0
- package/dist/auth/types/avatar.d.ts.map +1 -0
- package/dist/auth/types/change-email.d.ts +82 -0
- package/dist/auth/types/change-email.d.ts.map +1 -0
- package/dist/auth/types/checks.d.ts +147 -0
- package/dist/auth/types/checks.d.ts.map +1 -0
- package/dist/auth/types/email-flows.d.ts +117 -0
- package/dist/auth/types/email-flows.d.ts.map +1 -0
- package/dist/auth/types/find-by-email.d.ts +31 -0
- package/dist/auth/types/find-by-email.d.ts.map +1 -0
- package/dist/auth/types/find-or-create.d.ts +59 -0
- package/dist/auth/types/find-or-create.d.ts.map +1 -0
- package/dist/auth/types/index.d.ts +38 -0
- package/dist/auth/types/index.d.ts.map +1 -0
- package/dist/auth/types/inference.d.ts +62 -0
- package/dist/auth/types/inference.d.ts.map +1 -0
- package/dist/auth/types/invitations/api.d.ts +203 -0
- package/dist/auth/types/invitations/api.d.ts.map +1 -0
- package/dist/auth/types/invitations/history.d.ts +87 -0
- package/dist/auth/types/invitations/history.d.ts.map +1 -0
- package/dist/auth/types/invitations/index.d.ts +10 -0
- package/dist/auth/types/invitations/index.d.ts.map +1 -0
- package/dist/auth/types/invitations/invitation.d.ts +76 -0
- package/dist/auth/types/invitations/invitation.d.ts.map +1 -0
- package/dist/auth/types/invitations/issue-type.d.ts +15 -0
- package/dist/auth/types/invitations/issue-type.d.ts.map +1 -0
- package/dist/auth/types/invitations-of.d.ts +26 -0
- package/dist/auth/types/invitations-of.d.ts.map +1 -0
- package/dist/auth/types/janus.d.ts +51 -0
- package/dist/auth/types/janus.d.ts.map +1 -0
- package/dist/auth/types/magic-link.d.ts +69 -0
- package/dist/auth/types/magic-link.d.ts.map +1 -0
- package/dist/auth/types/passkeys.d.ts +183 -0
- package/dist/auth/types/passkeys.d.ts.map +1 -0
- package/dist/auth/types/password.d.ts +113 -0
- package/dist/auth/types/password.d.ts.map +1 -0
- package/dist/auth/types/prepared.d.ts +68 -0
- package/dist/auth/types/prepared.d.ts.map +1 -0
- package/dist/auth/types/proven-sign-in.d.ts +43 -0
- package/dist/auth/types/proven-sign-in.d.ts.map +1 -0
- package/dist/auth/types/reset-password.d.ts +46 -0
- package/dist/auth/types/reset-password.d.ts.map +1 -0
- package/dist/auth/types/second-factor.d.ts +164 -0
- package/dist/auth/types/second-factor.d.ts.map +1 -0
- package/dist/auth/types/session.d.ts +68 -0
- package/dist/auth/types/session.d.ts.map +1 -0
- package/dist/auth/types/shared-api.d.ts +96 -0
- package/dist/auth/types/shared-api.d.ts.map +1 -0
- package/dist/auth/types/sign-in.d.ts +102 -0
- package/dist/auth/types/sign-in.d.ts.map +1 -0
- package/dist/auth/types/social-flow.d.ts +28 -0
- package/dist/auth/types/social-flow.d.ts.map +1 -0
- package/dist/auth/types/social-step-up.d.ts +38 -0
- package/dist/auth/types/social-step-up.d.ts.map +1 -0
- package/dist/auth/types/social.d.ts +193 -0
- package/dist/auth/types/social.d.ts.map +1 -0
- package/dist/auth/types/step-up.d.ts +133 -0
- package/dist/auth/types/step-up.d.ts.map +1 -0
- package/dist/auth/types/type-api.d.ts +29 -0
- package/dist/auth/types/type-api.d.ts.map +1 -0
- package/dist/auth/types/user-type.d.ts +106 -0
- package/dist/auth/types/user-type.d.ts.map +1 -0
- package/dist/auth/types/user.d.ts +62 -0
- package/dist/auth/types/user.d.ts.map +1 -0
- package/dist/auth/types/verify-email.d.ts +190 -0
- package/dist/auth/types/verify-email.d.ts.map +1 -0
- package/dist/auth/users/any-type-api.d.ts +6 -0
- package/dist/auth/users/any-type-api.d.ts.map +1 -0
- package/dist/auth/users/by-login.d.ts +10 -0
- package/dist/auth/users/by-login.d.ts.map +1 -0
- package/dist/auth/users/change-password.d.ts +26 -0
- package/dist/auth/users/change-password.d.ts.map +1 -0
- package/dist/auth/users/delete.d.ts +10 -0
- package/dist/auth/users/delete.d.ts.map +1 -0
- package/dist/auth/users/email-move-guard.d.ts +20 -0
- package/dist/auth/users/email-move-guard.d.ts.map +1 -0
- package/dist/auth/users/email-prefix.d.ts +23 -0
- package/dist/auth/users/email-prefix.d.ts.map +1 -0
- package/dist/auth/users/fields-patch.d.ts +21 -0
- package/dist/auth/users/fields-patch.d.ts.map +1 -0
- package/dist/auth/users/find-by-email.d.ts +11 -0
- package/dist/auth/users/find-by-email.d.ts.map +1 -0
- package/dist/auth/users/find-many.d.ts +29 -0
- package/dist/auth/users/find-many.d.ts.map +1 -0
- package/dist/auth/users/find-or-create.d.ts +12 -0
- package/dist/auth/users/find-or-create.d.ts.map +1 -0
- package/dist/auth/users/flow-types.d.ts +15 -0
- package/dist/auth/users/flow-types.d.ts.map +1 -0
- package/dist/auth/users/index.d.ts +9 -0
- package/dist/auth/users/index.d.ts.map +1 -0
- package/dist/auth/users/insert.d.ts +15 -0
- package/dist/auth/users/insert.d.ts.map +1 -0
- package/dist/auth/users/name-prefix.d.ts +19 -0
- package/dist/auth/users/name-prefix.d.ts.map +1 -0
- package/dist/auth/users/password-flows.d.ts +11 -0
- package/dist/auth/users/password-flows.d.ts.map +1 -0
- package/dist/auth/users/record-flows.d.ts +11 -0
- package/dist/auth/users/record-flows.d.ts.map +1 -0
- package/dist/auth/users/sign-in.d.ts +24 -0
- package/dist/auth/users/sign-in.d.ts.map +1 -0
- package/dist/auth/users/sign-up.d.ts +13 -0
- package/dist/auth/users/sign-up.d.ts.map +1 -0
- package/dist/auth/users/type-api.d.ts +10 -0
- package/dist/auth/users/type-api.d.ts.map +1 -0
- package/dist/auth/users/update.d.ts +16 -0
- package/dist/auth/users/update.d.ts.map +1 -0
- package/dist/background/background.d.ts +22 -0
- package/dist/background/background.d.ts.map +1 -0
- package/dist/chunks/index-2ttdcz7n.js +354 -0
- package/dist/chunks/index-2ttdcz7n.js.map +16 -0
- package/dist/chunks/index-5dxynm32.js +85 -0
- package/dist/chunks/index-5dxynm32.js.map +10 -0
- package/dist/chunks/index-ftz0ne6j.js +127 -0
- package/dist/chunks/index-ftz0ne6j.js.map +11 -0
- package/dist/chunks/index-k6y18nx9.js +724 -0
- package/dist/chunks/index-k6y18nx9.js.map +24 -0
- package/dist/chunks/index-n8jxmxeg.js +64 -0
- package/dist/chunks/index-n8jxmxeg.js.map +11 -0
- package/dist/conformance/api-keys/cases/bound.d.ts +3 -0
- package/dist/conformance/api-keys/cases/bound.d.ts.map +1 -0
- package/dist/conformance/api-keys/cases/expiry.d.ts +3 -0
- package/dist/conformance/api-keys/cases/expiry.d.ts.map +1 -0
- package/dist/conformance/api-keys/cases/index.d.ts +4 -0
- package/dist/conformance/api-keys/cases/index.d.ts.map +1 -0
- package/dist/conformance/api-keys/cases/insert.d.ts +3 -0
- package/dist/conformance/api-keys/cases/insert.d.ts.map +1 -0
- package/dist/conformance/api-keys/cases/outage.d.ts +3 -0
- package/dist/conformance/api-keys/cases/outage.d.ts.map +1 -0
- package/dist/conformance/api-keys/cases/revoke.d.ts +3 -0
- package/dist/conformance/api-keys/cases/revoke.d.ts.map +1 -0
- package/dist/conformance/api-keys/cases/touch.d.ts +3 -0
- package/dist/conformance/api-keys/cases/touch.d.ts.map +1 -0
- package/dist/conformance/api-keys/cases/user-bound.d.ts +3 -0
- package/dist/conformance/api-keys/cases/user-bound.d.ts.map +1 -0
- package/dist/conformance/api-keys/describe.d.ts +20 -0
- package/dist/conformance/api-keys/describe.d.ts.map +1 -0
- package/dist/conformance/api-keys/fixtures.d.ts +4 -0
- package/dist/conformance/api-keys/fixtures.d.ts.map +1 -0
- package/dist/conformance/api-keys/index.d.ts +18 -0
- package/dist/conformance/api-keys/index.d.ts.map +1 -0
- package/dist/conformance/api-keys/reference.d.ts +4 -0
- package/dist/conformance/api-keys/reference.d.ts.map +1 -0
- package/dist/conformance/api-keys/types.d.ts +42 -0
- package/dist/conformance/api-keys/types.d.ts.map +1 -0
- package/dist/conformance/assert.d.ts +40 -0
- package/dist/conformance/assert.d.ts.map +1 -0
- package/dist/conformance/cases/outage.d.ts +3 -0
- package/dist/conformance/cases/outage.d.ts.map +1 -0
- package/dist/conformance/cases/outage.passkeys.d.ts +12 -0
- package/dist/conformance/cases/outage.passkeys.d.ts.map +1 -0
- package/dist/conformance/cases/passkeys/deletion.d.ts +4 -0
- package/dist/conformance/cases/passkeys/deletion.d.ts.map +1 -0
- package/dist/conformance/cases/passkeys/index.d.ts +8 -0
- package/dist/conformance/cases/passkeys/index.d.ts.map +1 -0
- package/dist/conformance/cases/passkeys/inserts.d.ts +4 -0
- package/dist/conformance/cases/passkeys/inserts.d.ts.map +1 -0
- package/dist/conformance/cases/passkeys/reads.d.ts +4 -0
- package/dist/conformance/cases/passkeys/reads.d.ts.map +1 -0
- package/dist/conformance/cases/passkeys/uses.d.ts +4 -0
- package/dist/conformance/cases/passkeys/uses.d.ts.map +1 -0
- package/dist/conformance/cases/sessions/deletion.d.ts +4 -0
- package/dist/conformance/cases/sessions/deletion.d.ts.map +1 -0
- package/dist/conformance/cases/sessions/extension.d.ts +4 -0
- package/dist/conformance/cases/sessions/extension.d.ts.map +1 -0
- package/dist/conformance/cases/sessions/index.d.ts +4 -0
- package/dist/conformance/cases/sessions/index.d.ts.map +1 -0
- package/dist/conformance/cases/sessions/inserts.d.ts +4 -0
- package/dist/conformance/cases/sessions/inserts.d.ts.map +1 -0
- package/dist/conformance/cases/sessions/list.d.ts +4 -0
- package/dist/conformance/cases/sessions/list.d.ts.map +1 -0
- package/dist/conformance/cases/sessions/reads.d.ts +4 -0
- package/dist/conformance/cases/sessions/reads.d.ts.map +1 -0
- package/dist/conformance/cases/sessions/reauthentication.d.ts +4 -0
- package/dist/conformance/cases/sessions/reauthentication.d.ts.map +1 -0
- package/dist/conformance/cases/sessions/revocation.d.ts +4 -0
- package/dist/conformance/cases/sessions/revocation.d.ts.map +1 -0
- package/dist/conformance/cases/social-links/deletion.d.ts +4 -0
- package/dist/conformance/cases/social-links/deletion.d.ts.map +1 -0
- package/dist/conformance/cases/social-links/index.d.ts +8 -0
- package/dist/conformance/cases/social-links/index.d.ts.map +1 -0
- package/dist/conformance/cases/social-links/inserts.d.ts +4 -0
- package/dist/conformance/cases/social-links/inserts.d.ts.map +1 -0
- package/dist/conformance/cases/social-links/reads.d.ts +4 -0
- package/dist/conformance/cases/social-links/reads.d.ts.map +1 -0
- package/dist/conformance/cases/tokens/attempts.d.ts +7 -0
- package/dist/conformance/cases/tokens/attempts.d.ts.map +1 -0
- package/dist/conformance/cases/tokens/change-email.d.ts +8 -0
- package/dist/conformance/cases/tokens/change-email.d.ts.map +1 -0
- package/dist/conformance/cases/tokens/deletion.d.ts +4 -0
- package/dist/conformance/cases/tokens/deletion.d.ts.map +1 -0
- package/dist/conformance/cases/tokens/index.d.ts +4 -0
- package/dist/conformance/cases/tokens/index.d.ts.map +1 -0
- package/dist/conformance/cases/tokens/inserts.d.ts +7 -0
- package/dist/conformance/cases/tokens/inserts.d.ts.map +1 -0
- package/dist/conformance/cases/tokens/kinds.d.ts +7 -0
- package/dist/conformance/cases/tokens/kinds.d.ts.map +1 -0
- package/dist/conformance/cases/tokens/redemption.d.ts +7 -0
- package/dist/conformance/cases/tokens/redemption.d.ts.map +1 -0
- package/dist/conformance/cases/tokens/social-flow.d.ts +8 -0
- package/dist/conformance/cases/tokens/social-flow.d.ts.map +1 -0
- package/dist/conformance/cases/tokens/spending.d.ts +7 -0
- package/dist/conformance/cases/tokens/spending.d.ts.map +1 -0
- package/dist/conformance/cases/users/avatar.d.ts +8 -0
- package/dist/conformance/cases/users/avatar.d.ts.map +1 -0
- package/dist/conformance/cases/users/batch.d.ts +8 -0
- package/dist/conformance/cases/users/batch.d.ts.map +1 -0
- package/dist/conformance/cases/users/deletion.d.ts +4 -0
- package/dist/conformance/cases/users/deletion.d.ts.map +1 -0
- package/dist/conformance/cases/users/index.d.ts +4 -0
- package/dist/conformance/cases/users/index.d.ts.map +1 -0
- package/dist/conformance/cases/users/inserts.d.ts +4 -0
- package/dist/conformance/cases/users/inserts.d.ts.map +1 -0
- package/dist/conformance/cases/users/listing.d.ts +4 -0
- package/dist/conformance/cases/users/listing.d.ts.map +1 -0
- package/dist/conformance/cases/users/patches.d.ts +7 -0
- package/dist/conformance/cases/users/patches.d.ts.map +1 -0
- package/dist/conformance/cases/users/reads.d.ts +7 -0
- package/dist/conformance/cases/users/reads.d.ts.map +1 -0
- package/dist/conformance/cases/users/second-factor.d.ts +16 -0
- package/dist/conformance/cases/users/second-factor.d.ts.map +1 -0
- package/dist/conformance/cases/users/versions.d.ts +7 -0
- package/dist/conformance/cases/users/versions.d.ts.map +1 -0
- package/dist/conformance/describe.d.ts +82 -0
- package/dist/conformance/describe.d.ts.map +1 -0
- package/dist/conformance/fixtures.d.ts +31 -0
- package/dist/conformance/fixtures.d.ts.map +1 -0
- package/dist/conformance/index.d.ts +46 -0
- package/dist/conformance/index.d.ts.map +1 -0
- package/dist/conformance/index.js +4411 -0
- package/dist/conformance/index.js.map +86 -0
- package/dist/conformance/invitations/cases/actors.d.ts +3 -0
- package/dist/conformance/invitations/cases/actors.d.ts.map +1 -0
- package/dist/conformance/invitations/cases/find-pending.d.ts +3 -0
- package/dist/conformance/invitations/cases/find-pending.d.ts.map +1 -0
- package/dist/conformance/invitations/cases/imported.d.ts +3 -0
- package/dist/conformance/invitations/cases/imported.d.ts.map +1 -0
- package/dist/conformance/invitations/cases/index.d.ts +4 -0
- package/dist/conformance/invitations/cases/index.d.ts.map +1 -0
- package/dist/conformance/invitations/cases/insert.d.ts +3 -0
- package/dist/conformance/invitations/cases/insert.d.ts.map +1 -0
- package/dist/conformance/invitations/cases/list-lapsed.d.ts +3 -0
- package/dist/conformance/invitations/cases/list-lapsed.d.ts.map +1 -0
- package/dist/conformance/invitations/cases/list-status.d.ts +3 -0
- package/dist/conformance/invitations/cases/list-status.d.ts.map +1 -0
- package/dist/conformance/invitations/cases/list.d.ts +3 -0
- package/dist/conformance/invitations/cases/list.d.ts.map +1 -0
- package/dist/conformance/invitations/cases/outage.d.ts +3 -0
- package/dist/conformance/invitations/cases/outage.d.ts.map +1 -0
- package/dist/conformance/invitations/cases/scope.d.ts +3 -0
- package/dist/conformance/invitations/cases/scope.d.ts.map +1 -0
- package/dist/conformance/invitations/cases/update.d.ts +3 -0
- package/dist/conformance/invitations/cases/update.d.ts.map +1 -0
- package/dist/conformance/invitations/describe.d.ts +20 -0
- package/dist/conformance/invitations/describe.d.ts.map +1 -0
- package/dist/conformance/invitations/fixtures.d.ts +4 -0
- package/dist/conformance/invitations/fixtures.d.ts.map +1 -0
- package/dist/conformance/invitations/index.d.ts +18 -0
- package/dist/conformance/invitations/index.d.ts.map +1 -0
- package/dist/conformance/invitations/reference.d.ts +4 -0
- package/dist/conformance/invitations/reference.d.ts.map +1 -0
- package/dist/conformance/invitations/types.d.ts +34 -0
- package/dist/conformance/invitations/types.d.ts.map +1 -0
- package/dist/conformance/reference.d.ts +13 -0
- package/dist/conformance/reference.d.ts.map +1 -0
- package/dist/conformance/relations/cases/deletion.d.ts +4 -0
- package/dist/conformance/relations/cases/deletion.d.ts.map +1 -0
- package/dist/conformance/relations/cases/holders.d.ts +9 -0
- package/dist/conformance/relations/cases/holders.d.ts.map +1 -0
- package/dist/conformance/relations/cases/index.d.ts +4 -0
- package/dist/conformance/relations/cases/index.d.ts.map +1 -0
- package/dist/conformance/relations/cases/outage.d.ts +3 -0
- package/dist/conformance/relations/cases/outage.d.ts.map +1 -0
- package/dist/conformance/relations/cases/reads.d.ts +8 -0
- package/dist/conformance/relations/cases/reads.d.ts.map +1 -0
- package/dist/conformance/relations/cases/traversal.d.ts +7 -0
- package/dist/conformance/relations/cases/traversal.d.ts.map +1 -0
- package/dist/conformance/relations/cases/writes.d.ts +4 -0
- package/dist/conformance/relations/cases/writes.d.ts.map +1 -0
- package/dist/conformance/relations/describe.d.ts +20 -0
- package/dist/conformance/relations/describe.d.ts.map +1 -0
- package/dist/conformance/relations/fixtures.d.ts +8 -0
- package/dist/conformance/relations/fixtures.d.ts.map +1 -0
- package/dist/conformance/relations/index.d.ts +18 -0
- package/dist/conformance/relations/index.d.ts.map +1 -0
- package/dist/conformance/relations/reference.d.ts +4 -0
- package/dist/conformance/relations/reference.d.ts.map +1 -0
- package/dist/conformance/relations/types.d.ts +34 -0
- package/dist/conformance/relations/types.d.ts.map +1 -0
- package/dist/conformance/types.d.ts +79 -0
- package/dist/conformance/types.d.ts.map +1 -0
- package/dist/errors/janus-error/base.d.ts +47 -0
- package/dist/errors/janus-error/base.d.ts.map +1 -0
- package/dist/errors/janus-error/codes.credentials.d.ts +36 -0
- package/dist/errors/janus-error/codes.credentials.d.ts.map +1 -0
- package/dist/errors/janus-error/codes.d.ts +23 -0
- package/dist/errors/janus-error/codes.d.ts.map +1 -0
- package/dist/errors/janus-error/codes.invitations.d.ts +52 -0
- package/dist/errors/janus-error/codes.invitations.d.ts.map +1 -0
- package/dist/errors/janus-error/codes.one-time.d.ts +63 -0
- package/dist/errors/janus-error/codes.one-time.d.ts.map +1 -0
- package/dist/errors/janus-error/codes.records.d.ts +86 -0
- package/dist/errors/janus-error/codes.records.d.ts.map +1 -0
- package/dist/errors/janus-error/codes.social.d.ts +88 -0
- package/dist/errors/janus-error/codes.social.d.ts.map +1 -0
- package/dist/errors/janus-error/index.d.ts +17 -0
- package/dist/errors/janus-error/index.d.ts.map +1 -0
- package/dist/errors/janus-error/options.d.ts +105 -0
- package/dist/errors/janus-error/options.d.ts.map +1 -0
- package/dist/errors/janus-error/refusals.d.ts +151 -0
- package/dist/errors/janus-error/refusals.d.ts.map +1 -0
- package/dist/errors/janus-error/status.d.ts +21 -0
- package/dist/errors/janus-error/status.d.ts.map +1 -0
- package/dist/errors/janus-error/store.d.ts +36 -0
- package/dist/errors/janus-error/store.d.ts.map +1 -0
- package/dist/ids/derived.d.ts +25 -0
- package/dist/ids/derived.d.ts.map +1 -0
- package/dist/ids/id.d.ts +55 -0
- package/dist/ids/id.d.ts.map +1 -0
- package/dist/index.d.ts +32 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6933 -0
- package/dist/index.js.map +208 -0
- package/dist/pagination/cursor-page.d.ts +53 -0
- package/dist/pagination/cursor-page.d.ts.map +1 -0
- package/dist/permissions/bound-model.d.ts +10 -0
- package/dist/permissions/bound-model.d.ts.map +1 -0
- package/dist/permissions/can.d.ts +13 -0
- package/dist/permissions/can.d.ts.map +1 -0
- package/dist/permissions/engine.d.ts +49 -0
- package/dist/permissions/engine.d.ts.map +1 -0
- package/dist/permissions/holders.d.ts +12 -0
- package/dist/permissions/holders.d.ts.map +1 -0
- package/dist/permissions/index.d.ts +36 -0
- package/dist/permissions/index.d.ts.map +1 -0
- package/dist/permissions/index.js +924 -0
- package/dist/permissions/index.js.map +28 -0
- package/dist/permissions/input.d.ts +43 -0
- package/dist/permissions/input.d.ts.map +1 -0
- package/dist/permissions/list.d.ts +16 -0
- package/dist/permissions/list.d.ts.map +1 -0
- package/dist/permissions/model/can.d.ts +41 -0
- package/dist/permissions/model/can.d.ts.map +1 -0
- package/dist/permissions/model/config.d.ts +36 -0
- package/dist/permissions/model/config.d.ts.map +1 -0
- package/dist/permissions/model/constraint.d.ts +37 -0
- package/dist/permissions/model/constraint.d.ts.map +1 -0
- package/dist/permissions/model/ctx.d.ts +23 -0
- package/dist/permissions/model/ctx.d.ts.map +1 -0
- package/dist/permissions/model/define.d.ts +78 -0
- package/dist/permissions/model/define.d.ts.map +1 -0
- package/dist/permissions/model/from-field.d.ts +31 -0
- package/dist/permissions/model/from-field.d.ts.map +1 -0
- package/dist/permissions/model/grant.d.ts +81 -0
- package/dist/permissions/model/grant.d.ts.map +1 -0
- package/dist/permissions/model/list.d.ts +48 -0
- package/dist/permissions/model/list.d.ts.map +1 -0
- package/dist/permissions/model/names.d.ts +51 -0
- package/dist/permissions/model/names.d.ts.map +1 -0
- package/dist/permissions/model/permissions.d.ts +48 -0
- package/dist/permissions/model/permissions.d.ts.map +1 -0
- package/dist/permissions/model/refs.d.ts +36 -0
- package/dist/permissions/model/refs.d.ts.map +1 -0
- package/dist/permissions/model/refusal.d.ts +13 -0
- package/dist/permissions/model/refusal.d.ts.map +1 -0
- package/dist/permissions/model/unions.d.ts +3 -0
- package/dist/permissions/model/unions.d.ts.map +1 -0
- package/dist/permissions/model/when.d.ts +16 -0
- package/dist/permissions/model/when.d.ts.map +1 -0
- package/dist/permissions/port/holders.d.ts +38 -0
- package/dist/permissions/port/holders.d.ts.map +1 -0
- package/dist/permissions/port/memory.d.ts +17 -0
- package/dist/permissions/port/memory.d.ts.map +1 -0
- package/dist/permissions/port/types.d.ts +101 -0
- package/dist/permissions/port/types.d.ts.map +1 -0
- package/dist/permissions/replace.d.ts +25 -0
- package/dist/permissions/replace.d.ts.map +1 -0
- package/dist/permissions/resolve/declared-names.d.ts +24 -0
- package/dist/permissions/resolve/declared-names.d.ts.map +1 -0
- package/dist/permissions/resolve/refuse-data-beyond-root.d.ts +11 -0
- package/dist/permissions/resolve/refuse-data-beyond-root.d.ts.map +1 -0
- package/dist/permissions/resolve/refuse-loops.d.ts +10 -0
- package/dist/permissions/resolve/refuse-loops.d.ts.map +1 -0
- package/dist/permissions/resolve/resolve-model.d.ts +13 -0
- package/dist/permissions/resolve/resolve-model.d.ts.map +1 -0
- package/dist/permissions/resolve/resolve-relation.d.ts +9 -0
- package/dist/permissions/resolve/resolve-relation.d.ts.map +1 -0
- package/dist/permissions/resolve/resolve-rule.d.ts +12 -0
- package/dist/permissions/resolve/resolve-rule.d.ts.map +1 -0
- package/dist/permissions/resolve/resolved.d.ts +52 -0
- package/dist/permissions/resolve/resolved.d.ts.map +1 -0
- package/dist/permissions/resolve/step.d.ts +4 -0
- package/dist/permissions/resolve/step.d.ts.map +1 -0
- package/dist/permissions/reverse.d.ts +53 -0
- package/dist/permissions/reverse.d.ts.map +1 -0
- package/dist/permissions/walk.d.ts +29 -0
- package/dist/permissions/walk.d.ts.map +1 -0
- package/dist/stores/guard.d.ts +24 -0
- package/dist/stores/guard.d.ts.map +1 -0
- package/dist/stores/storable.d.ts +15 -0
- package/dist/stores/storable.d.ts.map +1 -0
- package/dist/subjects/notation.d.ts +39 -0
- package/dist/subjects/notation.d.ts.map +1 -0
- package/dist/subjects/subject.d.ts +128 -0
- package/dist/subjects/subject.d.ts.map +1 -0
- package/dist/testing/index.d.ts +12 -0
- package/dist/testing/index.d.ts.map +1 -0
- package/dist/testing/index.js +26 -0
- package/dist/testing/index.js.map +10 -0
- package/dist/time/clock.d.ts +31 -0
- package/dist/time/clock.d.ts.map +1 -0
- package/dist/time/duration.d.ts +23 -0
- package/dist/time/duration.d.ts.map +1 -0
- package/docs/README.md +46 -0
- package/docs/guide/adapters.md +858 -0
- package/docs/guide/api-keys.md +316 -0
- package/docs/guide/avatars.md +334 -0
- package/docs/guide/devices.md +441 -0
- package/docs/guide/email-flows.md +880 -0
- package/docs/guide/errors.md +180 -0
- package/docs/guide/events.md +467 -0
- package/docs/guide/invitations.md +465 -0
- package/docs/guide/issuers.md +107 -0
- package/docs/guide/magic-link.md +580 -0
- package/docs/guide/migrating-invitations.md +142 -0
- package/docs/guide/passkeys.md +425 -0
- package/docs/guide/passwords.md +325 -0
- package/docs/guide/permissions.md +719 -0
- package/docs/guide/second-factor.md +1124 -0
- package/docs/guide/sessions.md +521 -0
- package/docs/guide/sign-in-code.md +631 -0
- package/docs/guide/social.md +639 -0
- package/docs/guide/step-up.md +262 -0
- package/docs/guide/users.md +557 -0
- package/docs/guide/vocabulary.md +316 -0
- package/docs/roadmap.md +101 -0
- package/docs/troubleshooting.md +3305 -0
- 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"}
|