@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,521 @@
|
|
|
1
|
+
# Sessions
|
|
2
|
+
|
|
3
|
+
This page is for everything after a user has signed in: finding who a request
|
|
4
|
+
belongs to, the session cookie, renewal, signing out, and testing expiry.
|
|
5
|
+
Signing up and signing in are on the [users](users.md) page; signing in a
|
|
6
|
+
user your application proved itself — accepting an invitation — is
|
|
7
|
+
[below](#signing-in-on-your-own-proof--signinproven).
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
import { z } from 'zod';
|
|
11
|
+
import { createMemoryStores, janus, scryptHasher } from '@softistx/janus';
|
|
12
|
+
|
|
13
|
+
const auth = janus({
|
|
14
|
+
user: z.object({ email: z.email(), name: z.string() }),
|
|
15
|
+
password: { login: 'email' },
|
|
16
|
+
store: createMemoryStores(),
|
|
17
|
+
hasher: scryptHasher(),
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
export async function me(request: Request): Promise<Response> {
|
|
21
|
+
const current = await auth.authenticate(request);
|
|
22
|
+
if (current === null) return new Response(null, { status: 401 });
|
|
23
|
+
|
|
24
|
+
const headers = new Headers();
|
|
25
|
+
if (current.renewed) {
|
|
26
|
+
headers.set('Set-Cookie', auth.cookie.serialize(current.token, current.session));
|
|
27
|
+
}
|
|
28
|
+
return Response.json({ id: current.user.id, email: current.user.email }, { headers });
|
|
29
|
+
}
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## `authenticate`
|
|
33
|
+
|
|
34
|
+
```ts
|
|
35
|
+
authenticate<T extends User['type'] = User['type']>(
|
|
36
|
+
request: RequestLike,
|
|
37
|
+
options?: { readonly type?: T; readonly apiKey?: false },
|
|
38
|
+
): Promise<Authenticated<Extract<User, { type: T }>> | null>;
|
|
39
|
+
// With `apiKey: true` (an instance wired with `apiKeys`): a Principal.
|
|
40
|
+
authenticate<T extends User['type'] = User['type']>(
|
|
41
|
+
request: RequestLike,
|
|
42
|
+
options: { readonly type?: T; readonly apiKey: true },
|
|
43
|
+
): Promise<Principal<Extract<User, { type: T }>> | null>;
|
|
44
|
+
|
|
45
|
+
interface Authenticated<U> {
|
|
46
|
+
readonly user: U;
|
|
47
|
+
readonly session: Session; // the stored session, without its token hash
|
|
48
|
+
readonly token: string; // the token the request presented
|
|
49
|
+
readonly renewed: boolean; // true when this call moved session.expiresAt
|
|
50
|
+
readonly via: 'session'; // what tells it from an API key's principal, `Principal`
|
|
51
|
+
}
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
`Principal<U>` is `Authenticated<U> | KeyAuthenticated<U>`; narrow on `via`.
|
|
55
|
+
A `KeyAuthenticated` (`via: 'apiKey'`) has `apiKey`, `session: null`,
|
|
56
|
+
`renewed: false`: nothing was signed in, so nothing is fresh. `authenticate`
|
|
57
|
+
answers `Authenticated` unless called with `apiKey: true`; **without it, a
|
|
58
|
+
key-shaped bearer answers `null`**, so existing routes never take a key
|
|
59
|
+
([API keys](api-keys.md#accepting-a-key)).
|
|
60
|
+
|
|
61
|
+
`request` is a `Request`, a `Headers`, anything with `headers` (a Node
|
|
62
|
+
`IncomingMessage`), or a plain header record:
|
|
63
|
+
|
|
64
|
+
```ts
|
|
65
|
+
await auth.authenticate(new Headers({ authorization: `Bearer ${token}` }));
|
|
66
|
+
await auth.authenticate({ 'x-session-token': token });
|
|
67
|
+
await auth.authenticate({ headers: { cookie: `janus-session=${token}` } });
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
It reads `Authorization: Bearer`, then `X-Session-Token`, then the cookie.
|
|
71
|
+
**The first session credential present wins, not the first valid one**: a client that
|
|
72
|
+
sends a lapsed bearer beside a live cookie is anonymous. An `Authorization`
|
|
73
|
+
header of another scheme (`Basic`) is not a session credential.
|
|
74
|
+
|
|
75
|
+
It answers `null` — anonymous — for no session credential, an unknown token, a lapsed
|
|
76
|
+
or revoked session, a user deleted or inactive, or a user of another type than
|
|
77
|
+
`options.type`:
|
|
78
|
+
|
|
79
|
+
```ts
|
|
80
|
+
const staff = await clinic.authenticate(request, { type: 'staff' }); // a patient's session → null
|
|
81
|
+
staff?.user.username; // typed as staff
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
**An outage is not anonymous.** When a store cannot answer, `authenticate`
|
|
85
|
+
rejects with `STORE_FAILED` — answer 503. A 401 would sign everybody out during
|
|
86
|
+
the outage and send them to a sign-in page that cannot work either:
|
|
87
|
+
|
|
88
|
+
```ts
|
|
89
|
+
import { StoreFailure } from '@softistx/janus';
|
|
90
|
+
|
|
91
|
+
export async function guarded(request: Request): Promise<Response> {
|
|
92
|
+
try {
|
|
93
|
+
const current = await auth.authenticate(request);
|
|
94
|
+
return current === null ? new Response(null, { status: 401 }) : Response.json(current.user);
|
|
95
|
+
} catch (error) {
|
|
96
|
+
if (error instanceof StoreFailure) return new Response(null, { status: 503 });
|
|
97
|
+
throw error;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
## Lifespan and renewal
|
|
103
|
+
|
|
104
|
+
| Option | Type | Default | Effect |
|
|
105
|
+
| --- | --- | --- | --- |
|
|
106
|
+
| `session.lifespan` | `Duration` | `'7d'` | How long a session lives from when it was opened or last renewed |
|
|
107
|
+
| `session.renewAfter` | `Duration \| false` | `'1d'` | Once this much has passed, `authenticate` moves `expiresAt` to a whole `lifespan` from now and answers `renewed: true`. `false`: a fixed lifespan |
|
|
108
|
+
| `session.absolute` | `Duration` | none | An absolute cap counted from when the session was opened: past it the session is anonymous however recently it was used, and no renewal goes beyond it. Must be above zero |
|
|
109
|
+
|
|
110
|
+
A sliding session is written **at most once per `renewAfter`**, not on every
|
|
111
|
+
request. When `renewed` is `true`, send the cookie again — its `Expires` moved.
|
|
112
|
+
With several user types, each type has its own `session`.
|
|
113
|
+
|
|
114
|
+
Expiry is decided by the core on every read, not by the store: a store may
|
|
115
|
+
still hold a lapsed session, and `authenticate` answers it as anonymous.
|
|
116
|
+
|
|
117
|
+
### An absolute cap
|
|
118
|
+
|
|
119
|
+
A sliding session lives as long as it is used. To end every session a fixed time
|
|
120
|
+
after its sign-in whatever the activity, set `session.absolute`:
|
|
121
|
+
|
|
122
|
+
```ts
|
|
123
|
+
import { janus } from '@softistx/janus';
|
|
124
|
+
|
|
125
|
+
const auth = janus({
|
|
126
|
+
user,
|
|
127
|
+
password: { login: 'email' },
|
|
128
|
+
store,
|
|
129
|
+
// 14 days sliding, and never more than 30 days after sign-in.
|
|
130
|
+
session: { lifespan: '14d', renewAfter: '1d', absolute: '30d' },
|
|
131
|
+
});
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
- A session older than `absolute` since its `createdAt` is refused by
|
|
135
|
+
`authenticate` (anonymous), by `stepUp.confirm` and by API-key creation, even
|
|
136
|
+
if it was used a minute ago and its `expiresAt` is still ahead. The user signs in again.
|
|
137
|
+
- A renewal never moves `expiresAt` past `createdAt + absolute`; the last one
|
|
138
|
+
clamps to the cap, and a session already at its cap is not written again
|
|
139
|
+
(`renewed: false`).
|
|
140
|
+
- A new session whose `lifespan` is longer than the cap ends at the cap.
|
|
141
|
+
- The cap is read on every request, so adding it applies to sessions already
|
|
142
|
+
open. It is per user type, like the rest of `session`.
|
|
143
|
+
- Without the option nothing changes. The stores are not involved: the cap is
|
|
144
|
+
decided by the core, from the `createdAt` every session record already holds.
|
|
145
|
+
|
|
146
|
+
**Renewal is not freshness.** `session.authenticatedAt` is when the session
|
|
147
|
+
last proved who it is — at the sign-in, or since by a
|
|
148
|
+
[step-up](step-up.md) — and renewal never moves it. A sensitive route checks
|
|
149
|
+
it with `assertFresh(session, '10m')`, which throws `STEP_UP_REQUIRED` for
|
|
150
|
+
an older one.
|
|
151
|
+
|
|
152
|
+
## The cookie
|
|
153
|
+
|
|
154
|
+
```ts
|
|
155
|
+
const auth = janus({
|
|
156
|
+
user: z.object({ email: z.email() }),
|
|
157
|
+
password: { login: 'email' },
|
|
158
|
+
store: createMemoryStores(),
|
|
159
|
+
hasher: scryptHasher(),
|
|
160
|
+
cookie: { name: 'sid', sameSite: 'strict', domain: 'example.com' },
|
|
161
|
+
});
|
|
162
|
+
|
|
163
|
+
const { session, token } = await auth.signUp({ email: 'ada@example.com', password: 'correct horse' });
|
|
164
|
+
|
|
165
|
+
auth.cookie.name; // 'sid'
|
|
166
|
+
auth.cookie.serialize(token, session); // 'sid=…; Expires=…; Path=/; Domain=example.com; HttpOnly; SameSite=Strict; Secure'
|
|
167
|
+
auth.cookie.clear(); // the same cookie, expired
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
| Option | Type | Default | Effect |
|
|
171
|
+
| --- | --- | --- | --- |
|
|
172
|
+
| `name` | string | `'janus-session'` | A cookie-name token: no space, `;` or `=` |
|
|
173
|
+
| `domain` | string | none | `Domain=` |
|
|
174
|
+
| `path` | string | `'/'` | `Path=` |
|
|
175
|
+
| `sameSite` | `'lax' \| 'strict' \| 'none'` | `'lax'` | `SameSite=` |
|
|
176
|
+
| `secure` | boolean | `true` | `Secure`. `sameSite: 'none'` requires it |
|
|
177
|
+
|
|
178
|
+
`HttpOnly` is always set. The cookie methods are synchronous and write
|
|
179
|
+
nothing: they build a `Set-Cookie` value for you to send.
|
|
180
|
+
|
|
181
|
+
## Signing in and out
|
|
182
|
+
|
|
183
|
+
```ts
|
|
184
|
+
export async function signIn(request: Request): Promise<Response> {
|
|
185
|
+
const { email, password } = (await request.json()) as { email: string; password: string };
|
|
186
|
+
const { user, session, token } = await auth.signIn({ email, password });
|
|
187
|
+
return Response.json(
|
|
188
|
+
{ id: user.id, token }, // a native client keeps the token and sends it as a bearer
|
|
189
|
+
{ headers: { 'Set-Cookie': auth.cookie.serialize(token, session) } },
|
|
190
|
+
);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
export async function signOut(request: Request): Promise<Response> {
|
|
194
|
+
await auth.signOut(request); // false when the request presents no session, or an unknown one
|
|
195
|
+
return new Response(null, { status: 204, headers: { 'Set-Cookie': auth.cookie.clear() } });
|
|
196
|
+
}
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
**With `secondFactor` configured, switch on `status` first.** A user whose
|
|
200
|
+
second factor is active gets a challenge from `signIn`, not a session — no
|
|
201
|
+
`token`, no `session` — and the destructuring above no longer compiles:
|
|
202
|
+
|
|
203
|
+
```ts
|
|
204
|
+
const result = await auth.signIn({ email, password });
|
|
205
|
+
if (result.status === 'secondFactor') {
|
|
206
|
+
// keep result.challenge for the next request — never in a URL — and ask for a code
|
|
207
|
+
return Response.json({ next: 'code' });
|
|
208
|
+
}
|
|
209
|
+
const { user, session, token } = result; // status 'signedIn': as above
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
`secondFactor.confirm(challenge, code)` then answers the same `SignedIn`, and
|
|
213
|
+
its session is sent the same way. See
|
|
214
|
+
[the second factor](second-factor.md#signing-in-switch-on-status).
|
|
215
|
+
|
|
216
|
+
**With `janus({ devices })`, a second cookie rides beside the session's.**
|
|
217
|
+
A sign-in given `{ device }` answers a `deviceToken` for the client to keep
|
|
218
|
+
in a long-lived cookie of its own, apart from the session cookie: it
|
|
219
|
+
outlives every session, and a sign-out leaves it, so the device stays
|
|
220
|
+
known. `auth.cookie` builds only the session cookie — see
|
|
221
|
+
[devices](devices.md#keeping-the-token-the-cookie) for the device cookie.
|
|
222
|
+
|
|
223
|
+
`signOutEverywhere(user, { except })` revokes every standing session of a
|
|
224
|
+
user, but the one named, and answers how many it revoked — "sign out
|
|
225
|
+
everywhere else". An `except` that names no session of theirs — an unknown
|
|
226
|
+
id, or anything that is not an id at all — keeps none: every session goes,
|
|
227
|
+
the current one included.
|
|
228
|
+
|
|
229
|
+
```ts
|
|
230
|
+
const current = await auth.authenticate(request);
|
|
231
|
+
if (current !== null) {
|
|
232
|
+
await auth.signOutEverywhere(current.user, { except: current.session.id });
|
|
233
|
+
}
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
`issuedBefore` (a `Date`) narrows the call to the sessions **created strictly
|
|
237
|
+
before** that instant; a session opened at or after it stands. Use it when the
|
|
238
|
+
sign-out may run late — a retried queue job after a credential change — so it
|
|
239
|
+
cannot end the sessions the user opened since. An invalid `Date` throws a
|
|
240
|
+
`TypeError` rather than end every session.
|
|
241
|
+
|
|
242
|
+
```ts
|
|
243
|
+
// at the credential change: const changedAt = new Date();
|
|
244
|
+
await auth.signOutEverywhere(userId, {
|
|
245
|
+
except: currentSessionId,
|
|
246
|
+
issuedBefore: changedAt,
|
|
247
|
+
});
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
## Listing and revoking one user's sessions — `auth.sessions`
|
|
251
|
+
|
|
252
|
+
An admin screen, or a "your devices" page, lists a user's standing sessions and
|
|
253
|
+
ends one of them. Give each sign-in a `deviceLabel` — the request's
|
|
254
|
+
`User-Agent`, or a name the client sent — and the session records it:
|
|
255
|
+
|
|
256
|
+
```ts
|
|
257
|
+
await auth.signIn({ email, password }, { deviceLabel: request.headers.get('user-agent') ?? undefined });
|
|
258
|
+
|
|
259
|
+
const sessions = await auth.sessions.list(user); // newest first
|
|
260
|
+
// [{ id, createdAt, authenticatedAt, expiresAt, revokedAt: null, device?, lastUsedAt? }]
|
|
261
|
+
|
|
262
|
+
const revoked = await auth.sessions.revoke(user, sessions[0].id); // true
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
- `list(user)` answers the sessions that are not revoked and not lapsed, newest
|
|
266
|
+
first, without their tokens. `[]` for a user with none.
|
|
267
|
+
- `revoke(user, sessionId)` ends one and answers `true`. It answers `false`
|
|
268
|
+
— and revokes nothing — for a session that is not the user's, is already
|
|
269
|
+
revoked or lapsed, or does not exist: a session id taken off a URL cannot
|
|
270
|
+
reach another user's.
|
|
271
|
+
- `device` is the `deviceLabel`, cut at 256 characters. It is the client's
|
|
272
|
+
word: show it, never trust it. It is **not** the `device` token of
|
|
273
|
+
[`janus({ devices })`](devices.md), and needs no such wiring.
|
|
274
|
+
- `lastUsedAt` is set when the session opens and moves when `authenticate`
|
|
275
|
+
renews it, which is at most once per `renewAfter`: it is as fresh as that,
|
|
276
|
+
not a per-request timestamp. A session opened before these fields existed
|
|
277
|
+
lists without `device` and `lastUsedAt`.
|
|
278
|
+
- `sessions` is a reserved user type name now, as the other keys of the
|
|
279
|
+
`janus()` answer are.
|
|
280
|
+
- Both need a sessions store that implements the optional `listUserSessions`
|
|
281
|
+
(the memory store and the Mongo, Drizzle and Redis adapters do); without it
|
|
282
|
+
they throw `UNSUPPORTED`.
|
|
283
|
+
|
|
284
|
+
`changePassword` leaves other sessions open; call this after it when that is
|
|
285
|
+
your policy. `resetPassword.confirm` signs out everywhere on its own, and so
|
|
286
|
+
do `signInCode.confirm` and `magicLink.confirm` when they prove an e-mail
|
|
287
|
+
never verified, before opening their own session
|
|
288
|
+
([why](magic-link.md#an-account-someone-else-registered)).
|
|
289
|
+
|
|
290
|
+
## Signing in on your own proof — `signInProven`
|
|
291
|
+
|
|
292
|
+
Some sign-ins are proved by the application, not by janus: a person accepts
|
|
293
|
+
an invitation your server issued, and the token they followed is the proof.
|
|
294
|
+
`auth.<type>.signInProven(user, options?)` signs that user in and answers
|
|
295
|
+
what every other sign-in answers — a `SignedIn`, or a challenge when their
|
|
296
|
+
second factor is active.
|
|
297
|
+
|
|
298
|
+
```ts
|
|
299
|
+
signInProven(user: UserRef, options?: SignInOptions): Promise<SignInResult<User>>
|
|
300
|
+
// SignedIn<User> on a type that cannot have a second factor (no password and no e-mail)
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
**It checks no credential: your server carries the proof.** It is a
|
|
304
|
+
privileged call, like `setPassword`. Call it only right after verifying a
|
|
305
|
+
proof your server issued, and take the id from that proof's own record —
|
|
306
|
+
never from the request body, a query string, or a cookie the client wrote.
|
|
307
|
+
An id a visitor can choose signs that visitor in as anybody.
|
|
308
|
+
|
|
309
|
+
### Accepting an invitation
|
|
310
|
+
|
|
311
|
+
The recipe the call is made for. The invitation is yours: a random token,
|
|
312
|
+
stored hashed, used once, with an expiry — the same rules janus applies to
|
|
313
|
+
its own links.
|
|
314
|
+
|
|
315
|
+
```ts
|
|
316
|
+
import { createHash, randomBytes } from 'node:crypto';
|
|
317
|
+
|
|
318
|
+
const hash = (token: string) => createHash('sha256').update(token).digest('base64url');
|
|
319
|
+
|
|
320
|
+
// Inviting: mail a link of yours to the address — nothing of janus's is sent.
|
|
321
|
+
export async function invite(email: string) {
|
|
322
|
+
const token = randomBytes(32).toString('base64url');
|
|
323
|
+
await invitations.insert({ hash: hash(token), email, expiresAt: inSevenDays() });
|
|
324
|
+
await sendMail(email, `Join us: https://app.example/invitation?token=${token}`);
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
// Accepting — from the page's POST, never from the link's GET, which a mail scanner follows.
|
|
328
|
+
export async function accept(request: Request): Promise<Response> {
|
|
329
|
+
const body = (await request.json()) as { token: string; password?: string };
|
|
330
|
+
const { token } = body;
|
|
331
|
+
// One conditional write: spent once, and only while it has not expired.
|
|
332
|
+
const invitation = await invitations.spend(hash(String(token)), new Date());
|
|
333
|
+
if (invitation === null) return Response.json({ code: 'INVITATION_INVALID' }, { status: 404 });
|
|
334
|
+
|
|
335
|
+
// 1. The address is the invitation's, never the request's. The person may already have an
|
|
336
|
+
// account — findByEmail counts nothing, sends nothing — or gets one, with no password.
|
|
337
|
+
const user =
|
|
338
|
+
(await auth.findByEmail(invitation.email)) ??
|
|
339
|
+
(await auth.create({ email: invitation.email, name: '' }));
|
|
340
|
+
// 2. The invitation reached the inbox: prove the e-mail. On an address never proved this
|
|
341
|
+
// drops whatever someone who signed up with it set — password, second factor, avatar, sessions.
|
|
342
|
+
await auth.verifyEmail.proveFirst(user);
|
|
343
|
+
// 3. Only now the invitee's own password, if your form asks for one: proveFirst would drop it.
|
|
344
|
+
if (typeof body.password === 'string') await auth.setPassword(user, body.password);
|
|
345
|
+
// 4. Last: proveFirst revokes every session, so the new one opens after it.
|
|
346
|
+
const result = await auth.signInProven(user, { device: deviceOf(request) });
|
|
347
|
+
if (result.status === 'secondFactor') {
|
|
348
|
+
// keep result.challenge for the next request — never in a URL — and ask for a code
|
|
349
|
+
return Response.json({ next: 'code' });
|
|
350
|
+
}
|
|
351
|
+
return Response.json(
|
|
352
|
+
{ id: result.user.id },
|
|
353
|
+
{ headers: { 'Set-Cookie': auth.cookie.serialize(result.token, result.session) } },
|
|
354
|
+
);
|
|
355
|
+
}
|
|
356
|
+
```
|
|
357
|
+
|
|
358
|
+
**`findOrCreate` is step 1 in one call.** `auth.findOrCreate(invitation.email, () => ({ … }))`
|
|
359
|
+
finds the holder or creates the user, losing no race to a second acceptance
|
|
360
|
+
of the same invitation, and its `input` may throw to refuse — "a password is
|
|
361
|
+
required" — before anything is written
|
|
362
|
+
([users](users.md#finding-a-user-or-creating-them--findorcreate)).
|
|
363
|
+
|
|
364
|
+
**The order is the recipe.** `verifyEmail.proveFirst` (since 0.22) applies
|
|
365
|
+
the first proof of the e-mail that a sign-in link would: on an address
|
|
366
|
+
never proved, somebody may have signed up with it first, with a password
|
|
367
|
+
and a second factor of their own, and `signInProven` alone would leave them
|
|
368
|
+
both — and that person's sessions — in place. It drops them and revokes
|
|
369
|
+
every session, so it comes **before** `setPassword`, which would otherwise
|
|
370
|
+
be erased, and **before** `signInProven`, whose session would otherwise be
|
|
371
|
+
revoked. On an address already proved it does nothing. It is privileged as
|
|
372
|
+
`signInProven` is: call it on the user your verified invitation names,
|
|
373
|
+
never on an id from the request
|
|
374
|
+
([e-mail flows](email-flows.md#proving-an-e-mail-on-your-own-proof--provefirst)).
|
|
375
|
+
|
|
376
|
+
**`findByEmail` works on every type with an e-mail, password or not** —
|
|
377
|
+
since 0.21. A type with no password has no `findByLogin`, and must not
|
|
378
|
+
declare one just to be looked up: that would open the password and reset
|
|
379
|
+
flows on it. It answers whether an account exists, so call it only here,
|
|
380
|
+
after the invitation was verified, on the address the invitation holds
|
|
381
|
+
([users](users.md#finding-a-user-by-e-mail--findbyemail)).
|
|
382
|
+
|
|
383
|
+
**Before 0.20 this was `magicLink.request(email)` then `magicLink.confirm`,
|
|
384
|
+
at once — use `signInProven` instead.** `request` is counted against the
|
|
385
|
+
mail throttle per address, five per 10 minutes by default: anybody asking
|
|
386
|
+
five links for the invitee's address made the real acceptance answer
|
|
387
|
+
`MAIL_THROTTLED`, with a message about "the last one sent" when nothing had
|
|
388
|
+
been sent. `signInProven` counts nothing, sends nothing, and spends nothing:
|
|
389
|
+
a link or a code already in the person's inbox still works afterwards.
|
|
390
|
+
|
|
391
|
+
### What it does, and what it does not
|
|
392
|
+
|
|
393
|
+
- **The same ending as every sign-in.** A user whose second factor is active
|
|
394
|
+
gets `{ status: 'secondFactor', challenge }` — the application's proof is
|
|
395
|
+
a first factor — and `secondFactor.confirm` opens the session. Given a
|
|
396
|
+
`device`, it answers `newDevice` and `deviceToken`, and sends
|
|
397
|
+
`user.newDeviceSignedIn` for a device new to the user
|
|
398
|
+
([devices](devices.md)). `@softistx/janus-telemetry` traces it as
|
|
399
|
+
`janus.<type>.signInProven` and writes `janus.signIn` with
|
|
400
|
+
`janus.signIn.proven: true`.
|
|
401
|
+
- **Refused as every sign-in refuses.** An inactive user is `USER_INACTIVE`;
|
|
402
|
+
a malformed id, an unknown one, a deleted user or a user of another type
|
|
403
|
+
is `NOT_FOUND`, as for `get` — never `null`, since a sign-in that found
|
|
404
|
+
nobody must not be read past. Options that are not `{ device }` are a
|
|
405
|
+
`TypeError`, as on every sign-in.
|
|
406
|
+
- **No e-mail proved.** `emailVerified` stays as it was: the call does not
|
|
407
|
+
know your proof reached the inbox. Nothing is dropped either — unlike a
|
|
408
|
+
first proof by link or code, the password and second factor stay. When
|
|
409
|
+
your proof did reach the inbox, call `verifyEmail.proveFirst` first.
|
|
410
|
+
- **No throttle.** Neither the mail throttle nor the sign-in throttle counts
|
|
411
|
+
it, and it restarts neither: a login past its password attempts is still
|
|
412
|
+
throttled for `signIn`. Limit your own acceptance route per client, as
|
|
413
|
+
any route that redeems a token.
|
|
414
|
+
- **No route.** `@softistx/janus-hono` and `@softistx/janus-graphql` expose nothing
|
|
415
|
+
for it: the proof is yours, so the route is yours.
|
|
416
|
+
|
|
417
|
+
## `collectExpired`
|
|
418
|
+
|
|
419
|
+
```ts
|
|
420
|
+
const removed: number = await auth.collectExpired();
|
|
421
|
+
```
|
|
422
|
+
|
|
423
|
+
Deletes lapsed sessions and lapsed one-time tokens, from the stores that keep
|
|
424
|
+
them, and answers how many in all. The tokens include the sign-in and mail
|
|
425
|
+
throttles' counts, which are ordinary tokens. It runs whichever of the
|
|
426
|
+
optional `sessions.deleteExpiredSessions` and `tokens.deleteExpiredTokens` the
|
|
427
|
+
stores implement, sessions first, and rejects with `UNSUPPORTED` only when
|
|
428
|
+
neither does — a store with its own TTL, such as `@softistx/janus-mongo`'s, does
|
|
429
|
+
not implement them. The reference store implements both.
|
|
430
|
+
|
|
431
|
+
A token is deleted once its `expiresAt` is at or before now, spent or not;
|
|
432
|
+
one that has not lapsed is never deleted, so a throttle keeps counting and a
|
|
433
|
+
link still redeems until its time is up. After a token is collected, its link
|
|
434
|
+
answers `TOKEN_UNKNOWN` rather than `TOKEN_EXPIRED` or `TOKEN_SPENT`, as it
|
|
435
|
+
already does on a store with a TTL. A failure in the tokens store, after the
|
|
436
|
+
sessions went, is `STORE_FAILED`; both deletions are idempotent, so call it
|
|
437
|
+
again.
|
|
438
|
+
|
|
439
|
+
## Testing expiry
|
|
440
|
+
|
|
441
|
+
`fixedClock` is shipped for this:
|
|
442
|
+
|
|
443
|
+
```ts
|
|
444
|
+
import { expect, it } from 'bun:test';
|
|
445
|
+
import { z } from 'zod';
|
|
446
|
+
import { createMemoryStores, fixedClock, janus, scryptHasher } from '@softistx/janus';
|
|
447
|
+
|
|
448
|
+
it('lapses after seven days', async () => {
|
|
449
|
+
const clock = fixedClock(Date.UTC(2026, 0, 1));
|
|
450
|
+
const auth = janus({
|
|
451
|
+
user: z.object({ email: z.email() }),
|
|
452
|
+
password: { login: 'email' },
|
|
453
|
+
store: createMemoryStores(),
|
|
454
|
+
hasher: scryptHasher({ cost: 10 }), // fast in tests; keep the default in production
|
|
455
|
+
clock,
|
|
456
|
+
});
|
|
457
|
+
const { token } = await auth.signUp({ email: 'ada@example.com', password: 'correct horse' });
|
|
458
|
+
const bearer = { authorization: `Bearer ${token}` };
|
|
459
|
+
|
|
460
|
+
clock.advance(8 * 24 * 60 * 60 * 1000);
|
|
461
|
+
|
|
462
|
+
expect(await auth.authenticate(bearer)).toBeNull();
|
|
463
|
+
});
|
|
464
|
+
```
|
|
465
|
+
|
|
466
|
+
## What the session proved — `amr`
|
|
467
|
+
|
|
468
|
+
`session.amr` lists the RFC 8176 methods the user proved: those of the sign-in,
|
|
469
|
+
extended by each successful `stepUp.confirm` or `stepUp.confirmPasskey`.
|
|
470
|
+
`session.authenticatedAt` is the time of the last proof. Both are on
|
|
471
|
+
`authenticate`'s `session` and on every `SignedIn`. A session stored before
|
|
472
|
+
the field existed reads `amr: []`.
|
|
473
|
+
|
|
474
|
+
| Proof | Adds |
|
|
475
|
+
| --- | --- |
|
|
476
|
+
| Password (`signIn`, `signUp`) | `pwd` |
|
|
477
|
+
| E-mailed code, magic link | `otp` |
|
|
478
|
+
| Passkey sign-in (user verified) | `hwk`, `user` |
|
|
479
|
+
| App code (TOTP) as second factor or step-up | `otp`, `mfa` |
|
|
480
|
+
| Recovery code as second factor | `otp`, `mfa` |
|
|
481
|
+
| Passkey as second factor or step-up | `hwk`, `user`, `mfa` |
|
|
482
|
+
| Social sign-in | `fed` |
|
|
483
|
+
| `signInProven` | nothing: the proof is yours |
|
|
484
|
+
|
|
485
|
+
A second factor adds to its first factor's methods (`['pwd', 'otp', 'mfa']`),
|
|
486
|
+
and a step-up adds to the session's (an e-mailed step-up after a password:
|
|
487
|
+
`['pwd', 'otp']`). Each value once, in the order proved. The table is
|
|
488
|
+
`AMR` in `@softistx/janus`, the one place the mapping lives;
|
|
489
|
+
`isMultiFactor(session)` is true when `mfa` was proved, or a user-verified
|
|
490
|
+
passkey (`hwk` with `user`).
|
|
491
|
+
|
|
492
|
+
```ts
|
|
493
|
+
import { isMultiFactor } from '@softistx/janus';
|
|
494
|
+
|
|
495
|
+
const current = await auth.authenticate(request);
|
|
496
|
+
current?.session.amr; // ['pwd', 'otp', 'mfa']
|
|
497
|
+
current && isMultiFactor(current.session); // true
|
|
498
|
+
```
|
|
499
|
+
|
|
500
|
+
A store of your own writes `SessionRecord.amr` as given and, when
|
|
501
|
+
`reauthenticateSession(id, at, amr)` is given an `amr`, replaces it in the same
|
|
502
|
+
write (the core passes the union). Without one it stays.
|
|
503
|
+
|
|
504
|
+
## What is stored
|
|
505
|
+
|
|
506
|
+
The token is 32 random bytes, handed back once in `SignedIn` and
|
|
507
|
+
`Authenticated`. The store holds only its `sha256`, so a dump of the store
|
|
508
|
+
cannot be replayed. `Session` is the stored record without that hash: `id`,
|
|
509
|
+
`userId`, `authenticatedAt`, `expiresAt`, `revokedAt`, `createdAt`, and
|
|
510
|
+
`amr` (see above).
|
|
511
|
+
|
|
512
|
+
## See also
|
|
513
|
+
|
|
514
|
+
- [Users](users.md) — `signUp`, `signIn`, the configuration
|
|
515
|
+
- [Signing in with an e-mailed link](magic-link.md) — when janus, not your application, proves the person
|
|
516
|
+
- [The second factor](second-factor.md) — the challenge `signIn` answers instead of a session
|
|
517
|
+
- [Step-up](step-up.md) — proving again who you are, and `assertFresh`
|
|
518
|
+
- [Devices](devices.md) — the device cookie beside the session cookie, and a sign-in from a new device
|
|
519
|
+
- [E-mail flows](email-flows.md) — verification and password reset
|
|
520
|
+
- [Invitations](invitations.md) — `accept` opens a session for an invitee, as `signInProven` does: `signedIn`, `secondFactor`, or `signIn` for an account that already exists
|
|
521
|
+
- [Errors](errors.md) — `STORE_FAILED`, `UNSUPPORTED` and the rest
|