@softistx/janus 0.0.0-stage → 0.74.0
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 +2929 -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 +72 -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 +142 -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 +23 -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 +201 -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-7h34nqrm.js +732 -0
- package/dist/chunks/index-7h34nqrm.js.map +24 -0
- package/dist/chunks/index-ftz0ne6j.js +127 -0
- package/dist/chunks/index-ftz0ne6j.js.map +11 -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 +4442 -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 +6948 -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 +861 -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 +648 -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 +102 -0
- package/docs/troubleshooting.md +3318 -0
- package/package.json +77 -5
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The users store: a user's record, what one update changes, and the port a
|
|
3
|
+
* store implements for them.
|
|
4
|
+
*
|
|
5
|
+
* Part of the store port; the rules every implementation keeps are in
|
|
6
|
+
* `./index`.
|
|
7
|
+
*/
|
|
8
|
+
import type { Id } from '../../../ids/id';
|
|
9
|
+
import type { CursorPage } from '../../../pagination/cursor-page';
|
|
10
|
+
import type { PasswordRecord, SecondFactorRecord } from './credentials';
|
|
11
|
+
import type { JsonObject } from './json';
|
|
12
|
+
/**
|
|
13
|
+
* A user's avatar, as a store holds it: which image, and when it was set.
|
|
14
|
+
*
|
|
15
|
+
* `id` is opaque to a store and to the core — the application picks it, for
|
|
16
|
+
* example an image key with its content hash. A new image gets a new `id`, so
|
|
17
|
+
* it doubles as a cache-buster. A store keeps both fields verbatim.
|
|
18
|
+
*/
|
|
19
|
+
export interface AvatarRecord {
|
|
20
|
+
readonly id: string;
|
|
21
|
+
readonly updatedAt: Date;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* A user, as a store holds it.
|
|
25
|
+
*
|
|
26
|
+
* Everything is `readonly`: the core hands records to application code, and a
|
|
27
|
+
* mutation would not reach the store — it could only mislead whoever wrote it.
|
|
28
|
+
*/
|
|
29
|
+
export interface UserRecord {
|
|
30
|
+
/** A UUIDv7 minted by the core. The store never mints an id. */
|
|
31
|
+
readonly id: Id;
|
|
32
|
+
/**
|
|
33
|
+
* Which of the application's user types — `'patient'`, `'staff'`, or
|
|
34
|
+
* `'user'` when it declares one. Never changes after insertion.
|
|
35
|
+
*/
|
|
36
|
+
readonly type: string;
|
|
37
|
+
/**
|
|
38
|
+
* Which version of the type's schema these fields were last validated
|
|
39
|
+
* against.
|
|
40
|
+
*
|
|
41
|
+
* **Nothing reads it yet**, and it is here from v1 on purpose. Tightening a
|
|
42
|
+
* schema changes what an update accepts, and every stored user was validated
|
|
43
|
+
* against the old one: without this field there is no way to find the users
|
|
44
|
+
* that are now unmodifiable. Adding a field to the port later breaks every
|
|
45
|
+
* adapter; adding it now costs one column.
|
|
46
|
+
*/
|
|
47
|
+
readonly schemaVersion: string;
|
|
48
|
+
/** `false` keeps the record and its password, and refuses every sign-in. */
|
|
49
|
+
readonly active: boolean;
|
|
50
|
+
/** The application's own fields, as the type's schema validated them. */
|
|
51
|
+
readonly fields: JsonObject;
|
|
52
|
+
/**
|
|
53
|
+
* What the user signs in with, **already normalised** by the core. Unique
|
|
54
|
+
* per `type`, and that uniqueness is a constraint the store enforces
|
|
55
|
+
* (rule 3): the same e-mail may hold a patient user and a staff user,
|
|
56
|
+
* and never two of either.
|
|
57
|
+
*/
|
|
58
|
+
readonly logins: readonly string[];
|
|
59
|
+
/** `null` when the user has no password. */
|
|
60
|
+
readonly password: PasswordRecord | null;
|
|
61
|
+
/** `null` when the user has no second factor. */
|
|
62
|
+
readonly secondFactor: SecondFactorRecord | null;
|
|
63
|
+
/** `null` when the user has no avatar. */
|
|
64
|
+
readonly avatar: AvatarRecord | null;
|
|
65
|
+
/**
|
|
66
|
+
* When the user proved they hold their current e-mail, or `null`. The core
|
|
67
|
+
* sets it back to `null` in the same write that changes the e-mail.
|
|
68
|
+
*/
|
|
69
|
+
readonly emailVerifiedAt: Date | null;
|
|
70
|
+
/**
|
|
71
|
+
* The user's display name as a search key, **already folded** by the core
|
|
72
|
+
* (NFKC, lowercased, trimmed, runs of white space reduced to one space, cut
|
|
73
|
+
* to 128 characters), or absent when the user has no name to search. What
|
|
74
|
+
* {@link UserFilter.namePrefix} is compared with, byte for byte. A store keeps
|
|
75
|
+
* it verbatim, and reads a record written before the key existed as absent.
|
|
76
|
+
*/
|
|
77
|
+
readonly nameKey?: string;
|
|
78
|
+
/**
|
|
79
|
+
* `0` at insertion, and one more on every accepted write. What
|
|
80
|
+
* {@link UserStore.updateUser}'s `ifVersion` is compared against.
|
|
81
|
+
*/
|
|
82
|
+
readonly version: number;
|
|
83
|
+
readonly createdAt: Date;
|
|
84
|
+
readonly updatedAt: Date;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* What one {@link UserStore.updateUser} changes.
|
|
88
|
+
*
|
|
89
|
+
* **A field the patch does not name is left as it is.** There is no full
|
|
90
|
+
* replacement of a record anywhere on this port: in Kratos, an update that
|
|
91
|
+
* omits `state` deactivates the identity, and an edit form that omits a trait
|
|
92
|
+
* deletes it. A conformance case carries that trap's name.
|
|
93
|
+
*
|
|
94
|
+
* A field the patch *does* name is replaced whole — `fields` and `logins`
|
|
95
|
+
* included. A deep merge would make every adapter implement a merge on nested
|
|
96
|
+
* values, differently on every database. The core computes the next value from
|
|
97
|
+
* the record it just read, under `ifVersion`, so no write is lost by it.
|
|
98
|
+
*
|
|
99
|
+
* `password: null` removes the password; a patch that does not name `password`
|
|
100
|
+
* keeps it. `secondFactor` and `avatar` follow the same rule.
|
|
101
|
+
*
|
|
102
|
+
* `id`, `type`, `version` and `createdAt` are not patchable. `updatedAt` is
|
|
103
|
+
* **required**, and comes from the core's clock rather than the database's, so
|
|
104
|
+
* every timestamp on a record comes from one clock.
|
|
105
|
+
*
|
|
106
|
+
* A key present with the value `undefined` is absent. This package is compiled
|
|
107
|
+
* with `exactOptionalPropertyTypes`, so the core cannot write one; an adapter
|
|
108
|
+
* receiving one from JavaScript still treats it as absent, never as an erasure.
|
|
109
|
+
*/
|
|
110
|
+
export interface UserPatch {
|
|
111
|
+
readonly updatedAt: Date;
|
|
112
|
+
readonly schemaVersion?: string;
|
|
113
|
+
readonly active?: boolean;
|
|
114
|
+
readonly fields?: JsonObject;
|
|
115
|
+
readonly logins?: readonly string[];
|
|
116
|
+
readonly password?: PasswordRecord | null;
|
|
117
|
+
readonly secondFactor?: SecondFactorRecord | null;
|
|
118
|
+
readonly avatar?: AvatarRecord | null;
|
|
119
|
+
readonly emailVerifiedAt?: Date | null;
|
|
120
|
+
/** A new search key, or `null` for none; absent leaves it as it is. */
|
|
121
|
+
readonly nameKey?: string | null;
|
|
122
|
+
}
|
|
123
|
+
/** Which users a listing or a count covers. */
|
|
124
|
+
export interface UserFilter {
|
|
125
|
+
/** Only users of this type. */
|
|
126
|
+
readonly type: string;
|
|
127
|
+
/**
|
|
128
|
+
* Only users holding a login that **starts with** this prefix, compared
|
|
129
|
+
* byte for byte.
|
|
130
|
+
*
|
|
131
|
+
* Already normalised by the core with the rule that normalised the logins
|
|
132
|
+
* when they were written (an e-mail is lowercased and trimmed), so the
|
|
133
|
+
* store compares bytes and folds no case itself. Never empty: the core
|
|
134
|
+
* leaves the key out when there is no prefix. It is plain text, not a
|
|
135
|
+
* pattern: `.`, `+`, `%`, `_` and `\` match themselves, and an adapter
|
|
136
|
+
* escapes them for its database.
|
|
137
|
+
*
|
|
138
|
+
* A store answers it from an index (rule 4, "no scan"): the logins'
|
|
139
|
+
* unique index in the adapters of this repository.
|
|
140
|
+
*/
|
|
141
|
+
readonly loginPrefix?: string;
|
|
142
|
+
/**
|
|
143
|
+
* Only users whose {@link UserRecord.nameKey} **starts with** this prefix,
|
|
144
|
+
* compared byte for byte, together with `loginPrefix` when both are given.
|
|
145
|
+
*
|
|
146
|
+
* Already folded by the core as `nameKey` is, so the store folds no case.
|
|
147
|
+
* Never empty: the core leaves the key out when there is no prefix. Plain
|
|
148
|
+
* text, not a pattern: an adapter escapes `.`, `%`, `_` and `\` for its
|
|
149
|
+
* database. A user with no `nameKey` never matches.
|
|
150
|
+
*
|
|
151
|
+
* A store answers it from an index (rule 4, "no scan"): `(type, nameKey)`
|
|
152
|
+
* in the adapters of this repository.
|
|
153
|
+
*/
|
|
154
|
+
readonly namePrefix?: string;
|
|
155
|
+
}
|
|
156
|
+
/** Which users a page lists, where it starts, and how much of it to read. */
|
|
157
|
+
export interface UserPageRequest extends UserFilter {
|
|
158
|
+
/**
|
|
159
|
+
* The last id of the previous page, or `null` for the first.
|
|
160
|
+
*
|
|
161
|
+
* Already checked by the core to be an id this package could have minted,
|
|
162
|
+
* so the store never parses a cursor. It need not name a stored user: the
|
|
163
|
+
* page is every id strictly greater than it.
|
|
164
|
+
*/
|
|
165
|
+
readonly after: Id | null;
|
|
166
|
+
/** Already bounded by the core, between 1 and `MAX_PAGE_SIZE`. */
|
|
167
|
+
readonly limit: number;
|
|
168
|
+
}
|
|
169
|
+
/** Users and their passwords: one unit of atomicity. */
|
|
170
|
+
export interface UserStore {
|
|
171
|
+
/**
|
|
172
|
+
* Stores a new user, verbatim, and answers what is stored.
|
|
173
|
+
*
|
|
174
|
+
* **Idempotent under retry.** When a user with this `id` already exists, it
|
|
175
|
+
* answers the stored record and writes nothing — a retry after a timeout
|
|
176
|
+
* whose first attempt landed is a success, not a conflict. That includes the
|
|
177
|
+
* logins: a login held by the user with this same `id` is not taken.
|
|
178
|
+
*
|
|
179
|
+
* A login held by **another** user of the same type rejects with
|
|
180
|
+
* `StoreConflict('login', …)`, carrying `login` and `userType` — never the
|
|
181
|
+
* login in its message — and writes nothing. That refusal comes from the store's own constraint, never from a
|
|
182
|
+
* read made first.
|
|
183
|
+
*/
|
|
184
|
+
insertUser(record: UserRecord): Promise<UserRecord>;
|
|
185
|
+
/** The user with this id, whatever their type, or `null`. */
|
|
186
|
+
findUser(id: Id): Promise<UserRecord | null>;
|
|
187
|
+
/**
|
|
188
|
+
* **Optional capability.** The users holding these ids, whatever their
|
|
189
|
+
* type, in **one query** — `@softistx/janus-drizzle`'s `inArray`,
|
|
190
|
+
* `@softistx/janus-mongo`'s `$in`.
|
|
191
|
+
*
|
|
192
|
+
* An id no user holds is **left out**: an absence here is a shorter list,
|
|
193
|
+
* never `null` and never a rejection. Each record appears once, in any
|
|
194
|
+
* order — the core puts them back in the caller's order. A failure throws,
|
|
195
|
+
* as everywhere on this port: answering `[]` for an outage turns it into
|
|
196
|
+
* "nobody", which is the lockout rule 2 exists to prevent.
|
|
197
|
+
*
|
|
198
|
+
* The core calls it with **1 to 100 distinct, well-formed ids**, never an
|
|
199
|
+
* empty list, and reads a longer list in several calls. A store that does
|
|
200
|
+
* not implement it is read with `findUser`, a few ids at a time, so every
|
|
201
|
+
* store answers `findMany`; this method only makes it one round trip.
|
|
202
|
+
*/
|
|
203
|
+
findUsers?(ids: readonly Id[]): Promise<readonly UserRecord[]>;
|
|
204
|
+
/**
|
|
205
|
+
* The user of this type holding this login, or `null`.
|
|
206
|
+
*
|
|
207
|
+
* `login` is compared byte for byte: the core normalised it with the same
|
|
208
|
+
* rule it used when the login was written.
|
|
209
|
+
*/
|
|
210
|
+
findUserByLogin(type: string, login: string): Promise<UserRecord | null>;
|
|
211
|
+
/**
|
|
212
|
+
* One page of users of one type, in ascending id order — which is creation
|
|
213
|
+
* order.
|
|
214
|
+
*
|
|
215
|
+
* `nextCursor` is the last id of the page when more follow, and `null` on
|
|
216
|
+
* the last page. An empty store answers an empty page, never `null`.
|
|
217
|
+
*/
|
|
218
|
+
listUsers(page: UserPageRequest): Promise<CursorPage<UserRecord>>;
|
|
219
|
+
/**
|
|
220
|
+
* How many users the filter covers: the length of every page
|
|
221
|
+
* {@link UserStore.listUsers} would walk with the same `type`,
|
|
222
|
+
* `loginPrefix` and `namePrefix`, exactly, at the instant of the read. `0` for none, never
|
|
223
|
+
* `null`.
|
|
224
|
+
*/
|
|
225
|
+
countUsers(filter: UserFilter): Promise<number>;
|
|
226
|
+
/**
|
|
227
|
+
* Applies a patch, **only if the stored version is exactly `ifVersion`**,
|
|
228
|
+
* and answers the record as written, with `version` one higher.
|
|
229
|
+
*
|
|
230
|
+
* `ifVersion` is required: every update in the core comes from a record it
|
|
231
|
+
* has just read, so a version is always at hand — and an optional check is
|
|
232
|
+
* the one somebody forgets on the one write where it mattered. An adapter
|
|
233
|
+
* therefore has no unchecked path to write.
|
|
234
|
+
*
|
|
235
|
+
* Rejects, **writing nothing**, with:
|
|
236
|
+
*
|
|
237
|
+
* - `NotFoundError` when no user has this id. The one method on this port
|
|
238
|
+
* that throws for an absence: it always follows a read, so an absence here
|
|
239
|
+
* is a race, not an answer;
|
|
240
|
+
* - `StoreConflict('version', …)` with `expectedVersion` and
|
|
241
|
+
* `actualVersion` when the version moved. A conditional write cannot tell
|
|
242
|
+
* this from an absent id on its own, so the adapter reads again after a
|
|
243
|
+
* write that matched nothing;
|
|
244
|
+
* - `StoreConflict('login', …)` when the patch's logins collide with another
|
|
245
|
+
* user's of the same type, carrying `login` and `userType` — never the
|
|
246
|
+
* login in its message.
|
|
247
|
+
*/
|
|
248
|
+
updateUser(id: Id, patch: UserPatch, ifVersion: number): Promise<UserRecord>;
|
|
249
|
+
/**
|
|
250
|
+
* Deletes the user with this id, whatever their type, and frees their
|
|
251
|
+
* logins. `true` when there was one, `false` when there was none.
|
|
252
|
+
*
|
|
253
|
+
* **Idempotent**, so a deletion interrupted half-way can be replayed: the
|
|
254
|
+
* replay answers `false` here and goes on to the sessions and the tokens.
|
|
255
|
+
* This deletes the record only — those two are other stores', and the core
|
|
256
|
+
* deletes them next.
|
|
257
|
+
*/
|
|
258
|
+
deleteUser(id: Id): Promise<boolean>;
|
|
259
|
+
}
|
|
260
|
+
//# sourceMappingURL=users.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"users.d.ts","sourceRoot":"","sources":["../../../../src/auth/port/types/users.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,KAAK,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACxE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAEzC;;;;;;GAMG;AACH,MAAM,WAAW,YAAY;IAC5B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,SAAS,EAAE,IAAI,CAAC;CACzB;AAED;;;;;GAKG;AACH,MAAM,WAAW,UAAU;IAC1B,gEAAgE;IAChE,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAC;IAChB;;;OAGG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB;;;;;;;;;OASG;IACH,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,4EAA4E;IAC5E,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,yEAAyE;IACzE,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC;IAC5B;;;;;OAKG;IACH,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;IACnC,4CAA4C;IAC5C,QAAQ,CAAC,QAAQ,EAAE,cAAc,GAAG,IAAI,CAAC;IACzC,iDAAiD;IACjD,QAAQ,CAAC,YAAY,EAAE,kBAAkB,GAAG,IAAI,CAAC;IACjD,0CAA0C;IAC1C,QAAQ,CAAC,MAAM,EAAE,YAAY,GAAG,IAAI,CAAC;IACrC;;;OAGG;IACH,QAAQ,CAAC,eAAe,EAAE,IAAI,GAAG,IAAI,CAAC;IACtC;;;;;;OAMG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B;;;OAGG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,SAAS,EAAE,IAAI,CAAC;IACzB,QAAQ,CAAC,SAAS,EAAE,IAAI,CAAC;CACzB;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,WAAW,SAAS;IACzB,QAAQ,CAAC,SAAS,EAAE,IAAI,CAAC;IACzB,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,MAAM,CAAC,EAAE,UAAU,CAAC;IAC7B,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,QAAQ,CAAC,QAAQ,CAAC,EAAE,cAAc,GAAG,IAAI,CAAC;IAC1C,QAAQ,CAAC,YAAY,CAAC,EAAE,kBAAkB,GAAG,IAAI,CAAC;IAClD,QAAQ,CAAC,MAAM,CAAC,EAAE,YAAY,GAAG,IAAI,CAAC;IACtC,QAAQ,CAAC,eAAe,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACvC,uEAAuE;IACvE,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACjC;AAED,+CAA+C;AAC/C,MAAM,WAAW,UAAU;IAC1B,+BAA+B;IAC/B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB;;;;;;;;;;;;;OAaG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,6EAA6E;AAC7E,MAAM,WAAW,eAAgB,SAAQ,UAAU;IAClD;;;;;;OAMG;IACH,QAAQ,CAAC,KAAK,EAAE,EAAE,GAAG,IAAI,CAAC;IAC1B,kEAAkE;IAClE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACvB;AAED,wDAAwD;AACxD,MAAM,WAAW,SAAS;IACzB;;;;;;;;;;;;OAYG;IACH,UAAU,CAAC,MAAM,EAAE,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IAEpD,6DAA6D;IAC7D,QAAQ,CAAC,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,CAAC;IAE7C;;;;;;;;;;;;;;;OAeG;IACH,SAAS,CAAC,CAAC,GAAG,EAAE,SAAS,EAAE,EAAE,GAAG,OAAO,CAAC,SAAS,UAAU,EAAE,CAAC,CAAC;IAE/D;;;;;OAKG;IACH,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,CAAC;IAEzE;;;;;;OAMG;IACH,SAAS,CAAC,IAAI,EAAE,eAAe,GAAG,OAAO,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC;IAElE;;;;;OAKG;IACH,UAAU,CAAC,MAAM,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAEhD;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,UAAU,CAAC,EAAE,EAAE,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IAE7E;;;;;;;;OAQG;IACH,UAAU,CAAC,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CACrC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A request for an e-mail made in two steps — `prepare` counts it, `send`
|
|
3
|
+
* issues — so the mail throttle answers in the visitor's own request, while
|
|
4
|
+
* the lookup and the writes, whose time depends on whether the address has
|
|
5
|
+
* an account, run off it.
|
|
6
|
+
*
|
|
7
|
+
* `prepare` looks nobody up: it validates, counts the address
|
|
8
|
+
* (`mail-requests.ts`) and refuses past the limit, the same store calls for
|
|
9
|
+
* any address. `send` is what `request` does after the count, **once**: the
|
|
10
|
+
* count `prepare` made pays for one issue, so a second call is a `TypeError`
|
|
11
|
+
* — a bug of the caller's, never a value from a request — and nothing a
|
|
12
|
+
* caller can pass skips the count.
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* `send` for a prepared request: `issue` on the first call, a `TypeError`
|
|
16
|
+
* on every other — marked spent before `issue` starts, so two calls at once
|
|
17
|
+
* cannot both issue, and spent even when `issue` fails: prepare again then,
|
|
18
|
+
* which counts again.
|
|
19
|
+
*/
|
|
20
|
+
export declare function sendOnce<T>(where: string, issue: () => Promise<T>): () => Promise<T>;
|
|
21
|
+
//# sourceMappingURL=prepared.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prepared.d.ts","sourceRoot":"","sources":["../../src/auth/prepared.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EACzB,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GACrB,MAAM,OAAO,CAAC,CAAC,CAAC,CAWlB"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Signing in a user the application proved by its own means — an
|
|
3
|
+
* invitation token it issued, a channel of its own: no credential checked
|
|
4
|
+
* here, so nothing to count, nothing to send and nothing to spend.
|
|
5
|
+
*/
|
|
6
|
+
import type { At } from './at';
|
|
7
|
+
import type { ResolvedType } from './config';
|
|
8
|
+
import { type AnyUser, type Context } from './context';
|
|
9
|
+
import type { Finish } from './email-sign-in';
|
|
10
|
+
import type { ProvenSignInApi, SignInResult } from './types';
|
|
11
|
+
/**
|
|
12
|
+
* `signInProven` for one user type: the user read by id — `NOT_FOUND` for
|
|
13
|
+
* nobody, as `get` — refused when inactive, then finished as every sign-in
|
|
14
|
+
* is, by `secondFactor.finish`: a session, or a challenge for an active
|
|
15
|
+
* factor.
|
|
16
|
+
*
|
|
17
|
+
* No throttle is counted and no count restarted, no token issued or spent,
|
|
18
|
+
* no e-mail proved: the proof is the application's, and links and codes
|
|
19
|
+
* already sent keep working.
|
|
20
|
+
*/
|
|
21
|
+
export declare function provenSignInFlows(context: Context, type: ResolvedType, at: At, finish: Finish): ProvenSignInApi<AnyUser, SignInResult<AnyUser>>;
|
|
22
|
+
//# sourceMappingURL=proven-sign-in.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"proven-sign-in.d.ts","sourceRoot":"","sources":["../../src/auth/proven-sign-in.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,MAAM,CAAC;AAC/B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,OAAO,EAAoB,MAAM,WAAW,CAAC;AAEzE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE7D;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAChC,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,YAAY,EAClB,EAAE,EAAE,EAAE,EACN,MAAM,EAAE,MAAM,GACZ,eAAe,CAAC,OAAO,EAAE,YAAY,CAAC,OAAO,CAAC,CAAC,CAiBjD"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { type SealingKey } from './sealing';
|
|
2
|
+
/**
|
|
3
|
+
* Seals and opens an application's own secrets at rest, under keys derived
|
|
4
|
+
* for one purpose.
|
|
5
|
+
*/
|
|
6
|
+
export interface PurposeSealer {
|
|
7
|
+
/**
|
|
8
|
+
* Seals `plaintext` under the first key, bound to `id` (the record it
|
|
9
|
+
* belongs to): `v1.<key id>.<iv>.<ciphertext and tag>`.
|
|
10
|
+
*/
|
|
11
|
+
seal(id: string, plaintext: string): string;
|
|
12
|
+
/**
|
|
13
|
+
* Opens `sealed` for `id`, or answers `null` when it does not open: another
|
|
14
|
+
* id, a sealed value altered or copied from another purpose, a key no longer
|
|
15
|
+
* held, or text that is not a sealed value. Never throws.
|
|
16
|
+
*/
|
|
17
|
+
unseal(id: string, sealed: string): string | null;
|
|
18
|
+
/** The id of the key that seals new values: the first of `keys`. */
|
|
19
|
+
readonly sealWith: string;
|
|
20
|
+
/**
|
|
21
|
+
* Whether `sealed` was sealed under a key other than the first, so the
|
|
22
|
+
* caller can seal it again after a rotation. `false` for text that is not a
|
|
23
|
+
* sealed value.
|
|
24
|
+
*/
|
|
25
|
+
needsReseal(sealed: string): boolean;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* A sealer for `purpose`, from the same `keys` as `janus({ secondFactor: {
|
|
29
|
+
* keys } })` or `parseSealingKeys`: AES-256-GCM, the first key seals, every
|
|
30
|
+
* key opens, and the id is the additional data.
|
|
31
|
+
*
|
|
32
|
+
* The key of each entry is derived for `purpose` (HKDF-SHA-256), never used as
|
|
33
|
+
* it is, so a value sealed here does not open under another purpose or under
|
|
34
|
+
* the keys of the second factor. Keep a purpose stable: renamed, what was
|
|
35
|
+
* sealed no longer opens. Rotation is by key id: put the new key first and keep
|
|
36
|
+
* the old one until no value is sealed with it.
|
|
37
|
+
*
|
|
38
|
+
* Refuses, with a `TypeError`, an empty, longer than 256 characters or
|
|
39
|
+
* badly formed `purpose` (a NUL or a lone surrogate), and any list
|
|
40
|
+
* `parseSealingKeys` refuses. `seal` refuses non-strings, an empty plaintext
|
|
41
|
+
* and a badly formed id or plaintext the same way.
|
|
42
|
+
*/
|
|
43
|
+
export declare function sealerFor(keys: readonly SealingKey[], purpose: string): PurposeSealer;
|
|
44
|
+
//# sourceMappingURL=sealer-for.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sealer-for.d.ts","sourceRoot":"","sources":["../../src/auth/sealer-for.ts"],"names":[],"mappings":"AAEA,OAAO,EAAiB,KAAK,UAAU,EAAgB,MAAM,WAAW,CAAC;AAEzE;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC7B;;;OAGG;IACH,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAAC;IAC5C;;;;OAIG;IACH,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IAClD,oEAAoE;IACpE,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B;;;;OAIG;IACH,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC;CACrC;AA6CD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,SAAS,CACxB,IAAI,EAAE,SAAS,UAAU,EAAE,EAC3B,OAAO,EAAE,MAAM,GACb,aAAa,CAyDf"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A second factor's secret, sealed before any store sees it: AES-256-GCM
|
|
3
|
+
* under a key the application holds, so a dump of the users is not a dump of
|
|
4
|
+
* everyone's authenticator.
|
|
5
|
+
*
|
|
6
|
+
* The sealed form is `v1.<key id>.<iv>.<ciphertext and tag>`, the last two in
|
|
7
|
+
* base64url. It names its key, so keys rotate: the first key seals, every key
|
|
8
|
+
* opens, and a secret sealed under an older one is sealed again under the
|
|
9
|
+
* first the next time a code is accepted. The user's id is the additional
|
|
10
|
+
* data, so a sealed secret copied onto another user does not open.
|
|
11
|
+
*/
|
|
12
|
+
/** One key, as `janus({ secondFactor: { keys } })` takes it. */
|
|
13
|
+
export interface SealingKey {
|
|
14
|
+
/** Names the key in every secret it seals: letters, digits, `_` and `-`. */
|
|
15
|
+
readonly id: string;
|
|
16
|
+
/** 32 random bytes, in base64 or base64url: `openssl rand -base64 32`. */
|
|
17
|
+
readonly key: string;
|
|
18
|
+
}
|
|
19
|
+
/** The keys, decoded and checked: the first seals. */
|
|
20
|
+
export interface Sealer {
|
|
21
|
+
readonly sealWith: string;
|
|
22
|
+
readonly keys: ReadonlyMap<string, Buffer>;
|
|
23
|
+
}
|
|
24
|
+
/** Decodes the keys and refuses what cannot seal. `where` names the option. */
|
|
25
|
+
export declare function resolveSealer(keys: unknown, where: string): Sealer;
|
|
26
|
+
/** Seals `plain` under the first key, bound to `boundTo` — the user's id. */
|
|
27
|
+
export declare function seal(sealer: Sealer, plain: string, boundTo: string): string;
|
|
28
|
+
type Opened = {
|
|
29
|
+
readonly plain: string;
|
|
30
|
+
readonly keyId: string;
|
|
31
|
+
};
|
|
32
|
+
/** As {@link unseal}, but a secret that does not open is answered as `null`, for a sweep that counts it and goes on. */
|
|
33
|
+
export declare function tryUnseal(sealer: Sealer, sealed: string, boundTo: string, where: string): Opened | null;
|
|
34
|
+
export declare function unseal(sealer: Sealer, sealed: string, boundTo: string, where: string): Opened;
|
|
35
|
+
export {};
|
|
36
|
+
//# sourceMappingURL=sealing.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sealing.d.ts","sourceRoot":"","sources":["../../src/auth/sealing.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;GAUG;AAEH,gEAAgE;AAChE,MAAM,WAAW,UAAU;IAC1B,4EAA4E;IAC5E,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,0EAA0E;IAC1E,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;CACrB;AAED,sDAAsD;AACtD,MAAM,WAAW,MAAM;IACtB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC3C;AAUD,+EAA+E;AAC/E,wBAAgB,aAAa,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAkClE;AAED,6EAA6E;AAC7E,wBAAgB,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAW3E;AAwDD,KAAK,MAAM,GAAG;IAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAEjE,wHAAwH;AACxH,wBAAgB,SAAS,CACxB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,MAAM,GACX,MAAM,GAAG,IAAI,CAGf;AAED,wBAAgB,MAAM,CACrB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,MAAM,GACX,MAAM,CAIR"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ResolvedType } from '../config';
|
|
2
|
+
import { type AnyUser, type Context } from '../context';
|
|
3
|
+
import type { RecoveryCodesIssued, UserRef, WriteOptions } from '../types';
|
|
4
|
+
/**
|
|
5
|
+
* Confirms a waiting factor with its first code: from then on, it is asked
|
|
6
|
+
* for. Its recovery codes are written in the same write, and answered once.
|
|
7
|
+
*/
|
|
8
|
+
export declare function activateFactor(context: Context, type: ResolvedType, user: UserRef, code: string, options: WriteOptions | undefined, where: string): Promise<RecoveryCodesIssued<AnyUser>>;
|
|
9
|
+
//# sourceMappingURL=activate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"activate.d.ts","sourceRoot":"","sources":["../../../src/auth/second-factor/activate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,OAAO,EAAqB,MAAM,YAAY,CAAC;AAI3E,OAAO,KAAK,EAAE,mBAAmB,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAU3E;;;GAGG;AACH,wBAAsB,cAAc,CACnC,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,YAAY,EAClB,IAAI,EAAE,OAAO,EACb,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,YAAY,GAAG,SAAS,EACjC,KAAK,EAAE,MAAM,GACX,OAAO,CAAC,mBAAmB,CAAC,OAAO,CAAC,CAAC,CA4DvC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { Context } from '../context';
|
|
2
|
+
import type { UserRecord } from '../port/types';
|
|
3
|
+
import type { Sealer } from '../sealing';
|
|
4
|
+
/**
|
|
5
|
+
* The attempts at an app's code outside a sign-in — `regenerateRecoveryCodes`
|
|
6
|
+
* and a step-up confirmed with the app — counted by the store, in one count
|
|
7
|
+
* both share: the same {@link CODE_ATTEMPTS} a challenge takes, per user and
|
|
8
|
+
* per window, so a stolen session cannot guess the app's code at leisure,
|
|
9
|
+
* nor buy more guesses by switching from one to the other.
|
|
10
|
+
*
|
|
11
|
+
* Counted in an attempt window (`../one-time/window.ts`): a `secondFactor`
|
|
12
|
+
* token named by a keyed hash of what the count is for, so nobody without
|
|
13
|
+
* the sealing keys can name it — nor redeem it as a challenge.
|
|
14
|
+
*
|
|
15
|
+
* What it is for decides when it starts again: the **window**, a fixed
|
|
16
|
+
* {@link APP_CODE_WINDOW_MS} slice of the clock, and the factor's
|
|
17
|
+
* `lastStep`, which **any code accepted** moves — a regenerate that
|
|
18
|
+
* succeeded starts the count again, and so does a sign-in finished with the
|
|
19
|
+
* app.
|
|
20
|
+
*
|
|
21
|
+
* {@link countSignInCodeAttempt} is the same count for `signIn`'s second step
|
|
22
|
+
* (`confirm`, `recover`), in a window of its own.
|
|
23
|
+
*
|
|
24
|
+
* Writing a password spends every `secondFactor` token of the user, this one
|
|
25
|
+
* included. So a spent link **carries** its attempts on to the next — a
|
|
26
|
+
* password written between guesses buys none.
|
|
27
|
+
*/
|
|
28
|
+
/** How long the attempts of one window last: fifteen minutes. */
|
|
29
|
+
export declare const APP_CODE_WINDOW_MS: number;
|
|
30
|
+
/**
|
|
31
|
+
* Counts one attempt at the app's code — to regenerate the user's recovery
|
|
32
|
+
* codes, or to confirm a step-up — before the code is compared, and
|
|
33
|
+
* answers how many are left. Past the last one, it refuses — the right
|
|
34
|
+
* code included — until the window ends, with `reason: 'throttled'` and
|
|
35
|
+
* `retryAfter`, the seconds until it does, as a sign-in's throttle does.
|
|
36
|
+
*/
|
|
37
|
+
export declare function countAppCodeAttempt(context: Context, sealer: Sealer, record: UserRecord, where: string): Promise<number>;
|
|
38
|
+
/**
|
|
39
|
+
* Counts one code tried at `signIn`'s second step — `confirm` or `recover`,
|
|
40
|
+
* on any challenge of the account — before it is compared, in the account's
|
|
41
|
+
* own window (`secondFactor.throttle`), apart from the app-code one. Refuses
|
|
42
|
+
* past the limit as {@link countAppCodeAttempt} does. Nothing is counted
|
|
43
|
+
* with the throttle off. A code accepted moves the factor's `lastStep`, and
|
|
44
|
+
* the count starts again, as it does for the app-code window.
|
|
45
|
+
*/
|
|
46
|
+
export declare function countSignInCodeAttempt(context: Context, sealer: Sealer, record: UserRecord, where: string): Promise<void>;
|
|
47
|
+
//# sourceMappingURL=app-code-attempts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app-code-attempts.d.ts","sourceRoot":"","sources":["../../../src/auth/second-factor/app-code-attempts.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAG1C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAGzC;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,iEAAiE;AACjE,eAAO,MAAM,kBAAkB,QAAc,CAAC;AA0C9C;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAClC,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,UAAU,EAClB,KAAK,EAAE,MAAM,GACX,OAAO,CAAC,MAAM,CAAC,CAMjB;AAED;;;;;;;GAOG;AACH,wBAAsB,sBAAsB,CAC3C,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,UAAU,EAClB,KAAK,EAAE,MAAM,GACX,OAAO,CAAC,IAAI,CAAC,CAQf"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { At } from '../at';
|
|
2
|
+
import type { ResolvedType } from '../config';
|
|
3
|
+
import type { AnyUser, Context } from '../context';
|
|
4
|
+
import type { UserRecord } from '../port/types';
|
|
5
|
+
import type { SecondFactorRequired, SignedIn, SignInOptions } from '../types';
|
|
6
|
+
/**
|
|
7
|
+
* The challenge `signIn` answers instead of a session, and the code that
|
|
8
|
+
* redeems it. **Only the challenge's hash is stored**, like a session
|
|
9
|
+
* token's.
|
|
10
|
+
*/
|
|
11
|
+
export declare function challengeFlows(context: Context, type: ResolvedType, at: At): {
|
|
12
|
+
issue(record: UserRecord, where: string, firstFactor?: readonly string[]): Promise<SecondFactorRequired>;
|
|
13
|
+
confirm(challenge: string, code: string, options?: SignInOptions): Promise<SignedIn<AnyUser>>;
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=challenge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"challenge.d.ts","sourceRoot":"","sources":["../../../src/auth/second-factor/challenge.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAInD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAIhD,OAAO,KAAK,EAAE,oBAAoB,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAU9E;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,EAAE,EAAE,EAAE;kBAGhE,UAAU,SACX,MAAM,gBACA,SAAS,MAAM,EAAE,GAC5B,OAAO,CAAC,oBAAoB,CAAC;uBAiCpB,MAAM,QACX,MAAM,YACF,aAAa,GACrB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;EAI9B"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ResolvedType } from '../config';
|
|
2
|
+
import { type Context } from '../context';
|
|
3
|
+
import type { UserRef } from '../types';
|
|
4
|
+
/**
|
|
5
|
+
* How many recovery codes the user still holds, read from their record: the
|
|
6
|
+
* count `secondFactor.recover` answers, for whoever did not see that answer —
|
|
7
|
+
* a `user.recoveryCodeUsed` listener, a security settings page.
|
|
8
|
+
*
|
|
9
|
+
* `null` when the user has no active factor: none, or one still waiting for
|
|
10
|
+
* its first code, holds no codes to count. An unknown id, or a user of
|
|
11
|
+
* another type, is `NOT_FOUND`; a store that fails throws. Writes nothing.
|
|
12
|
+
*/
|
|
13
|
+
export declare function recoveryCodesLeftOf(context: Context, type: ResolvedType, user: UserRef, where: string): Promise<number | null>;
|
|
14
|
+
//# sourceMappingURL=codes-left.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codes-left.d.ts","sourceRoot":"","sources":["../../../src/auth/second-factor/codes-left.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,EAAE,KAAK,OAAO,EAAmB,MAAM,YAAY,CAAC;AAC3D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAGxC;;;;;;;;GAQG;AACH,wBAAsB,mBAAmB,CACxC,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,YAAY,EAClB,IAAI,EAAE,OAAO,EACb,KAAK,EAAE,MAAM,GACX,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAIxB"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ResolvedType } from '../config';
|
|
2
|
+
import { type AnyUser, type Context } from '../context';
|
|
3
|
+
import type { UserRef, WriteOptions } from '../types';
|
|
4
|
+
/**
|
|
5
|
+
* Removes the factor, active or waiting. Reported only when an active one
|
|
6
|
+
* went: a user who had none, or whose factor never received its first code,
|
|
7
|
+
* was never asked for one, and still is not.
|
|
8
|
+
*/
|
|
9
|
+
export declare function disableFactor(context: Context, type: ResolvedType, user: UserRef, options: WriteOptions | undefined, where: string): Promise<AnyUser>;
|
|
10
|
+
//# sourceMappingURL=disable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"disable.d.ts","sourceRoot":"","sources":["../../../src/auth/second-factor/disable.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,OAAO,EAAqB,MAAM,YAAY,CAAC;AAG3E,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAGtD;;;;GAIG;AACH,wBAAsB,aAAa,CAClC,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,YAAY,EAClB,IAAI,EAAE,OAAO,EACb,OAAO,EAAE,YAAY,GAAG,SAAS,EACjC,KAAK,EAAE,MAAM,GACX,OAAO,CAAC,OAAO,CAAC,CA4BlB"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ResolvedType } from '../config';
|
|
2
|
+
import { type Context } from '../context';
|
|
3
|
+
import type { SecondFactorEnrolment, UserRef, WriteOptions } from '../types';
|
|
4
|
+
/** Writes a factor waiting for its first code, and answers the secret to show. */
|
|
5
|
+
export declare function enrollFactor(context: Context, type: ResolvedType, user: UserRef, options: WriteOptions | undefined, where: string): Promise<SecondFactorEnrolment>;
|
|
6
|
+
//# sourceMappingURL=enroll.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"enroll.d.ts","sourceRoot":"","sources":["../../../src/auth/second-factor/enroll.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,EAAE,KAAK,OAAO,EAAsB,MAAM,YAAY,CAAC;AAI9D,OAAO,KAAK,EAAE,qBAAqB,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAI7E,kFAAkF;AAClF,wBAAsB,YAAY,CACjC,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,YAAY,EAClB,IAAI,EAAE,OAAO,EACb,OAAO,EAAE,YAAY,GAAG,SAAS,EACjC,KAAK,EAAE,MAAM,GACX,OAAO,CAAC,qBAAqB,CAAC,CA0ChC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { ResolvedConfig, ResolvedType } from '../config';
|
|
2
|
+
import { type Context } from '../context';
|
|
3
|
+
import type { SecondFactorRecord, UserRecord } from '../port/types';
|
|
4
|
+
/**
|
|
5
|
+
* What the second factor's flows share: its configuration, its states, and
|
|
6
|
+
* the one check of a code against a sealed secret.
|
|
7
|
+
*
|
|
8
|
+
* A factor is **enrolled** once `enroll` wrote it, **active** once a first
|
|
9
|
+
* code confirmed it, and gone after `disable`. Only an active one is asked
|
|
10
|
+
* for at sign-in.
|
|
11
|
+
*/
|
|
12
|
+
export type Settings = NonNullable<ResolvedConfig['secondFactor']>;
|
|
13
|
+
type ActiveFactor = SecondFactorRecord & {
|
|
14
|
+
readonly confirmedAt: Date;
|
|
15
|
+
};
|
|
16
|
+
export declare const isActive: (factor: SecondFactorRecord | null) => factor is ActiveFactor;
|
|
17
|
+
/**
|
|
18
|
+
* Refuses a factor on an account whose e-mail is not proved: the first proof
|
|
19
|
+
* (`proveFirstEmail`) drops whatever factor stands, so one enrolled before it
|
|
20
|
+
* would vanish unannounced. A type without an e-mail has nothing to prove.
|
|
21
|
+
*/
|
|
22
|
+
export declare function assertEmailProved(type: ResolvedType, record: UserRecord, where: string, what: string): void;
|
|
23
|
+
/** The configuration, or a wiring refusal: no keys, no second factor. */
|
|
24
|
+
export declare function requireSettings(context: Context, where: string, why: string): Settings;
|
|
25
|
+
/**
|
|
26
|
+
* Checks a code against the user's secret. Answers the factor as it is to be
|
|
27
|
+
* written — the step accepted, and the secret sealed again under the first
|
|
28
|
+
* key when an older one sealed it — or `null` for a code that does not match,
|
|
29
|
+
* or was already used.
|
|
30
|
+
*/
|
|
31
|
+
export declare function acceptCode(configured: Settings, record: UserRecord, factor: SecondFactorRecord, code: string, now: Date, where: string): SecondFactorRecord | null;
|
|
32
|
+
export {};
|
|
33
|
+
//# sourceMappingURL=factor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"factor.d.ts","sourceRoot":"","sources":["../../../src/auth/second-factor/factor.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAC9D,OAAO,EAAE,KAAK,OAAO,EAAW,MAAM,YAAY,CAAC;AACnD,OAAO,KAAK,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAIpE;;;;;;;GAOG;AAEH,MAAM,MAAM,QAAQ,GAAG,WAAW,CAAC,cAAc,CAAC,cAAc,CAAC,CAAC,CAAC;AAEnE,KAAK,YAAY,GAAG,kBAAkB,GAAG;IAAE,QAAQ,CAAC,WAAW,EAAE,IAAI,CAAA;CAAE,CAAC;AAExE,eAAO,MAAM,QAAQ,GACpB,QAAQ,kBAAkB,GAAG,IAAI,KAC/B,MAAM,IAAI,YAA8D,CAAC;AAE5E;;;;GAIG;AACH,wBAAgB,iBAAiB,CAChC,IAAI,EAAE,YAAY,EAClB,MAAM,EAAE,UAAU,EAClB,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,GACV,IAAI,CAUN;AAED,yEAAyE;AACzE,wBAAgB,eAAe,CAC9B,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,MAAM,EACb,GAAG,EAAE,MAAM,GACT,QAAQ,CAQV;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CACzB,UAAU,EAAE,QAAQ,EACpB,MAAM,EAAE,UAAU,EAClB,MAAM,EAAE,kBAAkB,EAC1B,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,IAAI,EACT,KAAK,EAAE,MAAM,GACX,kBAAkB,GAAG,IAAI,CAiB3B"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { At } from '../at';
|
|
2
|
+
import type { ResolvedType } from '../config';
|
|
3
|
+
import type { AnyUser, Context } from '../context';
|
|
4
|
+
import type { DeviceHint } from '../devices';
|
|
5
|
+
import type { UserRecord } from '../port/types';
|
|
6
|
+
import type { SignInResult } from '../types';
|
|
7
|
+
/**
|
|
8
|
+
* The second factor of one user type: the flows its API answers, and what
|
|
9
|
+
* `signIn` needs — whether to ask for a code, and the challenge to answer.
|
|
10
|
+
*/
|
|
11
|
+
export declare function secondFactorFlows(context: Context, type: ResolvedType, at: At): {
|
|
12
|
+
api: {
|
|
13
|
+
enroll(user: import("..").UserRef, options?: import("..").WriteOptions): Promise<import("..").SecondFactorEnrolment>;
|
|
14
|
+
activate(user: import("..").UserRef, code: string, options?: import("..").WriteOptions): Promise<import("..").RecoveryCodesIssued<AnyUser>>;
|
|
15
|
+
regenerateRecoveryCodes(user: import("..").UserRef, code: string, options?: import("..").WriteOptions): Promise<import("..").RecoveryCodesIssued<AnyUser>>;
|
|
16
|
+
spendRecoveryCode(user: import("..").UserRef, code: string, options?: import("..").WriteOptions): Promise<import("..").SpentRecoveryCode<AnyUser>>;
|
|
17
|
+
disable(user: import("..").UserRef, options?: import("..").WriteOptions): Promise<AnyUser>;
|
|
18
|
+
confirm(challenge: string, code: string, options?: import("..").SignInOptions): Promise<import("..").SignedIn<AnyUser>>;
|
|
19
|
+
recover(challenge: string, code: string, options?: import("..").SignInOptions): Promise<import("..").RecoveredSignIn<AnyUser>>;
|
|
20
|
+
recoveryCodesLeft(user: import("..").UserRef): Promise<number | null>;
|
|
21
|
+
reseal(input?: {
|
|
22
|
+
readonly batch?: number;
|
|
23
|
+
readonly after?: string | null;
|
|
24
|
+
}): Promise<import("..").SecondFactorResealed>;
|
|
25
|
+
} & {
|
|
26
|
+
confirmPasskey(challenge: string, assertion: unknown, options?: import("..").SignInOptions): Promise<import("..").SignedIn<AnyUser>>;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* What a sign-in answers once the user proved who they are — by
|
|
30
|
+
* password or by an e-mail code: a session, or a challenge when their
|
|
31
|
+
* second factor is active. The first factor alone opens nothing then,
|
|
32
|
+
* and the device is not carried: its confirmation is given it again.
|
|
33
|
+
*/
|
|
34
|
+
finish: (record: UserRecord, where: string, device: DeviceHint, amr?: readonly string[]) => Promise<SignInResult<AnyUser>>;
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=flows.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flows.d.ts","sourceRoot":"","sources":["../../../src/auth/second-factor/flows.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAEhD,OAAO,KAAK,EAAqC,YAAY,EAAE,MAAM,UAAU,CAAC;AAShF;;;GAGG;AACH,wBAAgB,iBAAiB,CAChC,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,YAAY,EAClB,EAAE,EAAE,EAAE;;;;;;;;;;;0BAyC0yL,CAAC;0BAA2B,CAAC;;;;;IAjB50L;;;;;OAKG;qBAEM,UAAU,SACX,MAAM,UACL,UAAU,QACb,SAAS,MAAM,EAAE,KACpB,OAAO,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;EAKlC"}
|