@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,164 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a user type with a password, or with an e-mail and no password, answers besides once `janus()` is given a
|
|
3
|
+
* `secondFactor`: a TOTP second factor, from enrolment to the code `signIn`
|
|
4
|
+
* asks for.
|
|
5
|
+
*
|
|
6
|
+
* Part of what `janus()` hands back; `./index` gathers it.
|
|
7
|
+
*/
|
|
8
|
+
import type { SignedIn, SignInOptions } from './sign-in';
|
|
9
|
+
import type { UserRef, WriteOptions } from './user';
|
|
10
|
+
/** What `secondFactor.enroll` answers: show both, keep neither. */
|
|
11
|
+
export interface SecondFactorEnrolment {
|
|
12
|
+
/** The TOTP secret, in base32: for a user who types it in instead of scanning. */
|
|
13
|
+
readonly secret: string;
|
|
14
|
+
/** The `otpauth://` URI to render as a QR code. */
|
|
15
|
+
readonly uri: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* What `secondFactor.activate` and `regenerateRecoveryCodes` answer: the user,
|
|
19
|
+
* and **ten recovery codes, shown once**. Only their hashes are stored, so no
|
|
20
|
+
* call answers them again.
|
|
21
|
+
*/
|
|
22
|
+
export interface RecoveryCodesIssued<U> {
|
|
23
|
+
readonly user: U;
|
|
24
|
+
/** `xxxxx-xxxxx`, each accepted once by `secondFactor.recover`. */
|
|
25
|
+
readonly recoveryCodes: readonly string[];
|
|
26
|
+
}
|
|
27
|
+
/** What one `secondFactor.reseal` call did to its page of users. */
|
|
28
|
+
export interface SecondFactorResealed {
|
|
29
|
+
/** Users the call visited, with or without a factor. */
|
|
30
|
+
readonly scanned: number;
|
|
31
|
+
/** Secrets now sealed under the first key by this call. */
|
|
32
|
+
readonly resealed: number;
|
|
33
|
+
/** Secrets already under the first key, left alone. */
|
|
34
|
+
readonly current: number;
|
|
35
|
+
/** Users who changed between the read and the write: run again. */
|
|
36
|
+
readonly skipped: number;
|
|
37
|
+
/** Secrets no key held opens (a key dropped too early): left as they are, and counted, so one user never stops the run. */
|
|
38
|
+
readonly unreadable: number;
|
|
39
|
+
/** Pass it as `after` for the next call; `null` once the last user was visited. */
|
|
40
|
+
readonly nextCursor: string | null;
|
|
41
|
+
}
|
|
42
|
+
/** What `secondFactor.spendRecoveryCode` answers: the user, and how many codes are left. No session. */
|
|
43
|
+
export interface SpentRecoveryCode<U> {
|
|
44
|
+
readonly user: U;
|
|
45
|
+
/** The user's recovery codes still unused, this one spent. `0`: regenerate them. */
|
|
46
|
+
readonly recoveryCodesLeft: number;
|
|
47
|
+
}
|
|
48
|
+
/** What `secondFactor.recover` answers: the session, and how many codes are left. */
|
|
49
|
+
export type RecoveredSignIn<U> = SignedIn<U> & {
|
|
50
|
+
/** The user's recovery codes still unused, this one spent. `0`: regenerate them. */
|
|
51
|
+
readonly recoveryCodesLeft: number;
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* What a user type with a password, or with an e-mail and no password,
|
|
55
|
+
* answers besides, once `janus()` is given a
|
|
56
|
+
* `secondFactor`: a TOTP second factor, from the first QR code to the code
|
|
57
|
+
* `signIn` asks for.
|
|
58
|
+
*
|
|
59
|
+
* A factor is **enrolled** by `enroll`, **active** once `activate` accepted a
|
|
60
|
+
* first code, and gone after `disable`. Only an active one is asked for.
|
|
61
|
+
*/
|
|
62
|
+
export interface SecondFactorApi<U> {
|
|
63
|
+
readonly secondFactor: {
|
|
64
|
+
/**
|
|
65
|
+
* Mints a TOTP secret, seals it onto the user, and answers it with the
|
|
66
|
+
* URI to show as a QR code. The factor waits for `activate`; a factor
|
|
67
|
+
* already waiting is replaced. `SECOND_FACTOR_ACTIVE` when one is active;
|
|
68
|
+
* `EMAIL_UNVERIFIED` when the type holds an e-mail never verified (the
|
|
69
|
+
* first proof would remove the factor); `activate` refuses the same.
|
|
70
|
+
*/
|
|
71
|
+
enroll(user: UserRef, options?: WriteOptions): Promise<SecondFactorEnrolment>;
|
|
72
|
+
/**
|
|
73
|
+
* Checks a first code from the app, and makes the factor active: from
|
|
74
|
+
* then on `signIn` asks for a code. Answers the user and ten recovery
|
|
75
|
+
* codes, **shown once**. `CODE_INVALID` when the code does not match,
|
|
76
|
+
* `SECOND_FACTOR_NOT_ENROLLED` before `enroll`.
|
|
77
|
+
*/
|
|
78
|
+
activate(user: UserRef, code: string, options?: WriteOptions): Promise<RecoveryCodesIssued<U>>;
|
|
79
|
+
/**
|
|
80
|
+
* Replaces the user's recovery codes with ten new ones, answered once,
|
|
81
|
+
* on a fresh code from the app: the old ones stop working.
|
|
82
|
+
* `CODE_INVALID` when the code does not match or was already used,
|
|
83
|
+
* `SECOND_FACTOR_NOT_ENROLLED` without an active factor.
|
|
84
|
+
*
|
|
85
|
+
* It takes **five attempts per user per 15-minute window**, counted by
|
|
86
|
+
* the store: a code that does not match is `CODE_INVALID` with
|
|
87
|
+
* `attemptsLeft`, and past the fifth every call is `CODE_INVALID` with
|
|
88
|
+
* `attemptsLeft: 0`, the right code included, until the next window —
|
|
89
|
+
* with `reason: 'throttled'` and `retryAfter`, the seconds until it
|
|
90
|
+
* frees. A code accepted — here, or at sign-in — starts the count again.
|
|
91
|
+
*/
|
|
92
|
+
regenerateRecoveryCodes(user: UserRef, code: string, options?: WriteOptions): Promise<RecoveryCodesIssued<U>>;
|
|
93
|
+
/**
|
|
94
|
+
* Spends one **recovery code** outside a sign-in — to turn the factor off
|
|
95
|
+
* from a session that already stands, say. Opens no session, sends no
|
|
96
|
+
* event and no sign-in notice. `CODE_INVALID` when the code is not one
|
|
97
|
+
* of the user's or was already used, `SECOND_FACTOR_NOT_ENROLLED`
|
|
98
|
+
* without an active factor, `NOT_FOUND` for an unknown user.
|
|
99
|
+
*
|
|
100
|
+
* It takes the **five attempts per user per 15-minute window**
|
|
101
|
+
* `regenerateRecoveryCodes` takes, in the same count: past the fifth
|
|
102
|
+
* every call is `CODE_INVALID` with `attemptsLeft: 0`,
|
|
103
|
+
* `reason: 'throttled'` and `retryAfter`, the right code included.
|
|
104
|
+
*/
|
|
105
|
+
spendRecoveryCode(user: UserRef, code: string, options?: WriteOptions): Promise<SpentRecoveryCode<U>>;
|
|
106
|
+
/** Removes the factor, active or waiting, and its recovery codes. A user without one is answered as is. */
|
|
107
|
+
disable(user: UserRef, options?: WriteOptions): Promise<U>;
|
|
108
|
+
/**
|
|
109
|
+
* Redeems `signIn`'s challenge with a code, and opens the session.
|
|
110
|
+
*
|
|
111
|
+
* A challenge takes **five attempts**: a code that does not match is
|
|
112
|
+
* `CODE_INVALID` with `attemptsLeft`, and the fifth spends the challenge.
|
|
113
|
+
* A code is accepted once, so a replay is `CODE_INVALID` too. An unknown,
|
|
114
|
+
* spent or lapsed challenge is `TOKEN_UNKNOWN`, `TOKEN_SPENT` or
|
|
115
|
+
* `TOKEN_EXPIRED`: sign in again.
|
|
116
|
+
*
|
|
117
|
+
* The `device` given to `signIn` is not carried by the challenge: give
|
|
118
|
+
* it here again.
|
|
119
|
+
*/
|
|
120
|
+
confirm(challenge: string, code: string, options?: SignInOptions): Promise<SignedIn<U>>;
|
|
121
|
+
/**
|
|
122
|
+
* Redeems `signIn`'s challenge with a **recovery code** instead of the
|
|
123
|
+
* app's, for a user whose phone is gone, and opens the session. The
|
|
124
|
+
* code is spent; `recoveryCodesLeft` says how many remain.
|
|
125
|
+
*
|
|
126
|
+
* The challenge's attempts are the ones `confirm` counts, and it is
|
|
127
|
+
* refused the same ways. A code that does not match, or was already
|
|
128
|
+
* used, is `CODE_INVALID` with `attemptsLeft`; the same code used by
|
|
129
|
+
* two sign-ins at once opens one session, and the other call is
|
|
130
|
+
* `VERSION_CONFLICT`.
|
|
131
|
+
*/
|
|
132
|
+
recover(challenge: string, code: string, options?: SignInOptions): Promise<RecoveredSignIn<U>>;
|
|
133
|
+
/**
|
|
134
|
+
* How many recovery codes the user still holds — what `recover`
|
|
135
|
+
* answered as `recoveryCodesLeft`, read again for whoever did not see
|
|
136
|
+
* that answer: a `user.recoveryCodeUsed` listener, which carries the
|
|
137
|
+
* user's id only, or a security settings page. `null` when the user
|
|
138
|
+
* has no active factor, so no codes to count; `NOT_FOUND` for an
|
|
139
|
+
* unknown id. Writes nothing.
|
|
140
|
+
*/
|
|
141
|
+
recoveryCodesLeft(user: UserRef): Promise<number | null>;
|
|
142
|
+
/**
|
|
143
|
+
* Seals the TOTP secrets of up to `batch` users (default 100, at most
|
|
144
|
+
* 100) again under the first of `secondFactor.keys`, so the old key can
|
|
145
|
+
* be dropped without waiting for every user to sign in. Loop on
|
|
146
|
+
* `nextCursor` until it is `null`; a run that reports `skipped` or
|
|
147
|
+
* `resealed` above 0 is followed by one more pass from the start, until
|
|
148
|
+
* both are 0 and `unreadable` is 0.
|
|
149
|
+
*
|
|
150
|
+
* Sends no event and changes nothing but the secret, `updatedAt` and `version`. Idempotent (a secret already under the first key is left alone), safe
|
|
151
|
+
* to run twice at once (each write is conditional on the version read:
|
|
152
|
+
* the loser counts `skipped`), and resumable from any `nextCursor`.
|
|
153
|
+
* Recovery codes are hashes and cannot be sealed again: new ones come
|
|
154
|
+
* from `regenerateRecoveryCodes`. A `batch` that is not a positive
|
|
155
|
+
* integer, or an `after` this package did not mint, is a `TypeError` /
|
|
156
|
+
* `INVALID_CURSOR`.
|
|
157
|
+
*/
|
|
158
|
+
reseal(input?: {
|
|
159
|
+
readonly batch?: number;
|
|
160
|
+
readonly after?: string | null;
|
|
161
|
+
}): Promise<SecondFactorResealed>;
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
//# sourceMappingURL=second-factor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"second-factor.d.ts","sourceRoot":"","sources":["../../../src/auth/types/second-factor.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AACzD,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAEpD,mEAAmE;AACnE,MAAM,WAAW,qBAAqB;IACrC,kFAAkF;IAClF,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,mDAAmD;IACnD,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;CACrB;AAED;;;;GAIG;AACH,MAAM,WAAW,mBAAmB,CAAC,CAAC;IACrC,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC;IACjB,mEAAmE;IACnE,QAAQ,CAAC,aAAa,EAAE,SAAS,MAAM,EAAE,CAAC;CAC1C;AAED,oEAAoE;AACpE,MAAM,WAAW,oBAAoB;IACpC,wDAAwD;IACxD,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,2DAA2D;IAC3D,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,uDAAuD;IACvD,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,mEAAmE;IACnE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,2HAA2H;IAC3H,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,mFAAmF;IACnF,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;CACnC;AAED,wGAAwG;AACxG,MAAM,WAAW,iBAAiB,CAAC,CAAC;IACnC,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC;IACjB,oFAAoF;IACpF,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC;CACnC;AAED,qFAAqF;AACrF,MAAM,MAAM,eAAe,CAAC,CAAC,IAAI,QAAQ,CAAC,CAAC,CAAC,GAAG;IAC9C,oFAAoF;IACpF,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC;CACnC,CAAC;AAEF;;;;;;;;GAQG;AACH,MAAM,WAAW,eAAe,CAAC,CAAC;IACjC,QAAQ,CAAC,YAAY,EAAE;QACtB;;;;;;WAMG;QACH,MAAM,CACL,IAAI,EAAE,OAAO,EACb,OAAO,CAAC,EAAE,YAAY,GACpB,OAAO,CAAC,qBAAqB,CAAC,CAAC;QAClC;;;;;WAKG;QACH,QAAQ,CACP,IAAI,EAAE,OAAO,EACb,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,YAAY,GACpB,OAAO,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC,CAAC;QACnC;;;;;;;;;;;;WAYG;QACH,uBAAuB,CACtB,IAAI,EAAE,OAAO,EACb,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,YAAY,GACpB,OAAO,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC,CAAC;QACnC;;;;;;;;;;;WAWG;QACH,iBAAiB,CAChB,IAAI,EAAE,OAAO,EACb,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,YAAY,GACpB,OAAO,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAC;QACjC,2GAA2G;QAC3G,OAAO,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;QAC3D;;;;;;;;;;;WAWG;QACH,OAAO,CACN,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,aAAa,GACrB,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;QACxB;;;;;;;;;;WAUG;QACH,OAAO,CACN,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,aAAa,GACrB,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC;QAC/B;;;;;;;WAOG;QACH,iBAAiB,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;QACzD;;;;;;;;;;;;;;;WAeG;QACH,MAAM,CAAC,KAAK,CAAC,EAAE;YACd,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;YACxB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;SAC/B,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;KAClC,CAAC;CACF"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A session as application code sees it, who a request belongs to, and what
|
|
3
|
+
* a session token is read from.
|
|
4
|
+
*
|
|
5
|
+
* Part of what `janus()` hands back; `./index` gathers it.
|
|
6
|
+
*/
|
|
7
|
+
import type { ApiKeyBound } from '../port/types/api-keys';
|
|
8
|
+
import type { SessionRecord } from '../port/types/sessions';
|
|
9
|
+
import type { ApiKey } from './api-keys';
|
|
10
|
+
/** A session, as application code sees it: everything but the token's hash. */
|
|
11
|
+
export type Session = Omit<SessionRecord, 'tokenHash' | 'amr'> & {
|
|
12
|
+
/**
|
|
13
|
+
* The RFC 8176 methods proved: at the sign-in, extended by each step-up.
|
|
14
|
+
* `[]` for a session stored before this field existed. With
|
|
15
|
+
* `authenticatedAt`, the time of the last proof, what an OAuth approval
|
|
16
|
+
* needs for `amr`, `acr` and `auth_time`.
|
|
17
|
+
*/
|
|
18
|
+
readonly amr: readonly string[];
|
|
19
|
+
};
|
|
20
|
+
/** Who a request belongs to. */
|
|
21
|
+
export interface Authenticated<U> {
|
|
22
|
+
/** Told apart from a key by this field: `'session'`. */
|
|
23
|
+
readonly via: 'session';
|
|
24
|
+
readonly user: U;
|
|
25
|
+
readonly session: Session;
|
|
26
|
+
/** The token the request presented. */
|
|
27
|
+
readonly token: string;
|
|
28
|
+
/**
|
|
29
|
+
* Whether this call renewed the session. When it did, `session.expiresAt`
|
|
30
|
+
* moved: send the cookie again with `auth.cookie.serialize(token, session)`.
|
|
31
|
+
*/
|
|
32
|
+
readonly renewed: boolean;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Who a request belongs to when it presented an API key. It has **no
|
|
36
|
+
* session**: nothing was signed in, so nothing is fresh and nothing renews.
|
|
37
|
+
*/
|
|
38
|
+
export interface KeyAuthenticated<U> {
|
|
39
|
+
readonly via: 'apiKey';
|
|
40
|
+
readonly user: U;
|
|
41
|
+
/** The key that authenticated the request. */
|
|
42
|
+
readonly apiKey: ApiKey;
|
|
43
|
+
/**
|
|
44
|
+
* The key's scopes, as `apiKey.scopes`: `null` for an unscoped key. Janus
|
|
45
|
+
* does not enforce them; the application does.
|
|
46
|
+
*/
|
|
47
|
+
readonly scopes: readonly string[] | null;
|
|
48
|
+
/**
|
|
49
|
+
* The object the key is bound to, as `apiKey.bound`: `null` for an unbound
|
|
50
|
+
* key. Janus does not enforce it; the application does.
|
|
51
|
+
*/
|
|
52
|
+
readonly bound: ApiKeyBound | null;
|
|
53
|
+
readonly session: null;
|
|
54
|
+
/** The token the request presented. */
|
|
55
|
+
readonly token: string;
|
|
56
|
+
readonly renewed: false;
|
|
57
|
+
}
|
|
58
|
+
/** Whoever a request belongs to: a session, or an API key. Narrow on `via`. */
|
|
59
|
+
export type Principal<U> = Authenticated<U> | KeyAuthenticated<U>;
|
|
60
|
+
/** What `authenticate` and `signOut` read a session token from. */
|
|
61
|
+
export type RequestLike = Request | Headers | {
|
|
62
|
+
readonly headers: Headers | HeaderRecord;
|
|
63
|
+
} | HeaderRecord;
|
|
64
|
+
/** Headers as Node's `IncomingMessage` and most frameworks hold them. */
|
|
65
|
+
export type HeaderRecord = {
|
|
66
|
+
readonly [name: string]: string | readonly string[] | undefined;
|
|
67
|
+
};
|
|
68
|
+
//# sourceMappingURL=session.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../../src/auth/types/session.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEzC,+EAA+E;AAC/E,MAAM,MAAM,OAAO,GAAG,IAAI,CAAC,aAAa,EAAE,WAAW,GAAG,KAAK,CAAC,GAAG;IAChE;;;;;OAKG;IACH,QAAQ,CAAC,GAAG,EAAE,SAAS,MAAM,EAAE,CAAC;CAChC,CAAC;AAEF,gCAAgC;AAChC,MAAM,WAAW,aAAa,CAAC,CAAC;IAC/B,wDAAwD;IACxD,QAAQ,CAAC,GAAG,EAAE,SAAS,CAAC;IACxB,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC;IACjB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,uCAAuC;IACvC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;CAC1B;AAED;;;GAGG;AACH,MAAM,WAAW,gBAAgB,CAAC,CAAC;IAClC,QAAQ,CAAC,GAAG,EAAE,QAAQ,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC;IACjB,8CAA8C;IAC9C,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB;;;OAGG;IACH,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,GAAG,IAAI,CAAC;IAC1C;;;OAGG;IACH,QAAQ,CAAC,KAAK,EAAE,WAAW,GAAG,IAAI,CAAC;IACnC,QAAQ,CAAC,OAAO,EAAE,IAAI,CAAC;IACvB,uCAAuC;IACvC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,OAAO,EAAE,KAAK,CAAC;CACxB;AAED,+EAA+E;AAC/E,MAAM,MAAM,SAAS,CAAC,CAAC,IAAI,aAAa,CAAC,CAAC,CAAC,GAAG,gBAAgB,CAAC,CAAC,CAAC,CAAC;AAElE,mEAAmE;AACnE,MAAM,MAAM,WAAW,GACpB,OAAO,GACP,OAAO,GACP;IAAE,QAAQ,CAAC,OAAO,EAAE,OAAO,GAAG,YAAY,CAAA;CAAE,GAC5C,YAAY,CAAC;AAEhB,yEAAyE;AACzE,MAAM,MAAM,YAAY,GAAG;IAC1B,QAAQ,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,MAAM,EAAE,GAAG,SAAS,CAAC;CAChE,CAAC"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What every configuration answers, whatever its user types.
|
|
3
|
+
*
|
|
4
|
+
* Part of what `janus()` hands back; `./index` gathers it.
|
|
5
|
+
*/
|
|
6
|
+
import type { Authenticated, Principal, RequestLike, Session } from './session';
|
|
7
|
+
import type { UserRef } from './user';
|
|
8
|
+
/** What every configuration answers, whatever its user types. */
|
|
9
|
+
export interface SharedApi<U extends {
|
|
10
|
+
readonly type: string;
|
|
11
|
+
}> {
|
|
12
|
+
/**
|
|
13
|
+
* With `apiKey: true`, a key-shaped bearer is also accepted: it answers a
|
|
14
|
+
* {@link Principal} you narrow on `via` (`'session'` or `'apiKey'`). A key
|
|
15
|
+
* has no session, is never fresh and renews nothing. Without it, a
|
|
16
|
+
* key-shaped bearer answers `null` (anonymous). Needs `janus({ apiKeys })`,
|
|
17
|
+
* a `TypeError` otherwise.
|
|
18
|
+
*/
|
|
19
|
+
authenticate<T extends U['type'] = U['type']>(request: RequestLike, options: {
|
|
20
|
+
readonly type?: T;
|
|
21
|
+
readonly apiKey: true;
|
|
22
|
+
}): Promise<Principal<Extract<U, {
|
|
23
|
+
readonly type: T;
|
|
24
|
+
}>> | null>;
|
|
25
|
+
/**
|
|
26
|
+
* Who a request belongs to, or `null` for an anonymous one.
|
|
27
|
+
*
|
|
28
|
+
* Reads `Authorization: Bearer`, then `X-Session-Token`, then the cookie:
|
|
29
|
+
* **the first credential present wins, not the first valid one.** A lapsed
|
|
30
|
+
* or revoked session, a user gone or inactive, or a user of another type
|
|
31
|
+
* than `options.type` is anonymous. Renews a sliding session in passing.
|
|
32
|
+
*
|
|
33
|
+
* **An outage is not anonymous**: a store that cannot answer rejects with
|
|
34
|
+
* `STORE_FAILED`. Answer 503, never 401.
|
|
35
|
+
*/
|
|
36
|
+
authenticate<T extends U['type'] = U['type']>(request: RequestLike, options?: {
|
|
37
|
+
readonly type?: T;
|
|
38
|
+
readonly apiKey?: false;
|
|
39
|
+
}): Promise<Authenticated<Extract<U, {
|
|
40
|
+
readonly type: T;
|
|
41
|
+
}>> | null>;
|
|
42
|
+
/** Revokes the session a request presents. `false` when it presents none, or an unknown one. */
|
|
43
|
+
signOut(request: RequestLike): Promise<boolean>;
|
|
44
|
+
/**
|
|
45
|
+
* Revokes every session of a user, but `except` and, when `issuedBefore` is
|
|
46
|
+
* given, the ones created at or after it. Answers how many.
|
|
47
|
+
*/
|
|
48
|
+
signOutEverywhere(user: UserRef, options?: {
|
|
49
|
+
readonly except?: string;
|
|
50
|
+
/** Revokes only the sessions created strictly before this instant. */
|
|
51
|
+
readonly issuedBefore?: Date;
|
|
52
|
+
}): Promise<number>;
|
|
53
|
+
/**
|
|
54
|
+
* One user's sessions, for an admin or "your devices" screen. Needs a
|
|
55
|
+
* sessions store that implements `listUserSessions`: `UNSUPPORTED`
|
|
56
|
+
* otherwise.
|
|
57
|
+
*/
|
|
58
|
+
readonly sessions: {
|
|
59
|
+
/**
|
|
60
|
+
* The user's standing sessions — not revoked, not lapsed — newest first,
|
|
61
|
+
* without their tokens. `device` is the `deviceLabel` the sign-in gave;
|
|
62
|
+
* `lastUsedAt` moves when `authenticate` renews the session (at most once
|
|
63
|
+
* per `renewAfter`), so it is as fresh as that. Both are absent on a
|
|
64
|
+
* session opened before they existed. `[]` for a user with none, or an
|
|
65
|
+
* id that is no user's.
|
|
66
|
+
*/
|
|
67
|
+
list(user: UserRef): Promise<readonly Session[]>;
|
|
68
|
+
/**
|
|
69
|
+
* Revokes one of the user's standing sessions. `false` — and nothing is
|
|
70
|
+
* revoked — when the session is not this user's, is already revoked or
|
|
71
|
+
* lapsed, or does not exist: a session id taken off a URL cannot reach
|
|
72
|
+
* another user's.
|
|
73
|
+
*/
|
|
74
|
+
revoke(user: UserRef, sessionId: string): Promise<boolean>;
|
|
75
|
+
};
|
|
76
|
+
/** The user with this id, whatever their type, or `null`. */
|
|
77
|
+
findUser(id: string): Promise<U | null>;
|
|
78
|
+
/** The user with this id, whatever their type, or `NOT_FOUND`. */
|
|
79
|
+
getUser(id: string): Promise<U>;
|
|
80
|
+
/** The session cookie, as `Set-Cookie` values. Synchronous. */
|
|
81
|
+
readonly cookie: {
|
|
82
|
+
readonly name: string;
|
|
83
|
+
serialize(token: string, session: Session): string;
|
|
84
|
+
clear(): string;
|
|
85
|
+
};
|
|
86
|
+
/**
|
|
87
|
+
* Deletes lapsed sessions and lapsed one-time tokens — the throttles' counts
|
|
88
|
+
* included — from the stores that implement `deleteExpiredSessions` /
|
|
89
|
+
* `deleteExpiredTokens`, and answers how many in all. `UNSUPPORTED` when
|
|
90
|
+
* neither does — a store with its own TTL does not need to.
|
|
91
|
+
*/
|
|
92
|
+
collectExpired(): Promise<number>;
|
|
93
|
+
/** The user type names, in the order they were declared. */
|
|
94
|
+
readonly types: readonly U['type'][];
|
|
95
|
+
}
|
|
96
|
+
//# sourceMappingURL=shared-api.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared-api.d.ts","sourceRoot":"","sources":["../../../src/auth/types/shared-api.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAChF,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAEtC,iEAAiE;AACjE,MAAM,WAAW,SAAS,CAAC,CAAC,SAAS;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE;IAC7D;;;;;;OAMG;IACH,YAAY,CAAC,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,EAC3C,OAAO,EAAE,WAAW,EACpB,OAAO,EAAE;QAAE,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAAC,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAA;KAAE,GACnD,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,EAAE;QAAE,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAA;KAAE,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;IAC/D;;;;;;;;;;OAUG;IACH,YAAY,CAAC,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,EAC3C,OAAO,EAAE,WAAW,EACpB,OAAO,CAAC,EAAE;QAAE,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,KAAK,CAAA;KAAE,GACtD,OAAO,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,EAAE;QAAE,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAA;KAAE,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;IAEnE,gGAAgG;IAChG,OAAO,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAEhD;;;OAGG;IACH,iBAAiB,CAChB,IAAI,EAAE,OAAO,EACb,OAAO,CAAC,EAAE;QACT,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;QACzB,sEAAsE;QACtE,QAAQ,CAAC,YAAY,CAAC,EAAE,IAAI,CAAC;KAC7B,GACC,OAAO,CAAC,MAAM,CAAC,CAAC;IAEnB;;;;OAIG;IACH,QAAQ,CAAC,QAAQ,EAAE;QAClB;;;;;;;WAOG;QACH,IAAI,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,SAAS,OAAO,EAAE,CAAC,CAAC;QACjD;;;;;WAKG;QACH,MAAM,CAAC,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;KAC3D,CAAC;IAEF,6DAA6D;IAC7D,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;IAExC,kEAAkE;IAClE,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IAEhC,+DAA+D;IAC/D,QAAQ,CAAC,MAAM,EAAE;QAChB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;QACtB,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,MAAM,CAAC;QACnD,KAAK,IAAI,MAAM,CAAC;KAChB,CAAC;IAEF;;;;;OAKG;IACH,cAAc,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IAElC,4DAA4D;IAC5D,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC;CACrC"}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a sign-in answers: a session opened, or a second factor still to
|
|
3
|
+
* prove.
|
|
4
|
+
*
|
|
5
|
+
* Part of what `janus()` hands back; `./index` gathers it.
|
|
6
|
+
*/
|
|
7
|
+
import type { Id } from '../../ids/id';
|
|
8
|
+
import type { Session } from './session';
|
|
9
|
+
/**
|
|
10
|
+
* A session just opened. **The token is here and nowhere else**: the store
|
|
11
|
+
* holds its hash. Put it in a cookie with `auth.cookie.serialize`, or hand it
|
|
12
|
+
* to a client that sends it as `Authorization: Bearer`.
|
|
13
|
+
*/
|
|
14
|
+
export interface SignedIn<U> {
|
|
15
|
+
readonly status: 'signedIn';
|
|
16
|
+
readonly user: U;
|
|
17
|
+
readonly session: Session;
|
|
18
|
+
readonly token: string;
|
|
19
|
+
/**
|
|
20
|
+
* Whether the session was opened from a device the user had not signed in
|
|
21
|
+
* from: the `device` given held no token, or one that did not prove this
|
|
22
|
+
* user signed in there before. Then `user.newDeviceSignedIn` was sent too.
|
|
23
|
+
* **`false` without a `device`**, and always on `signUp`.
|
|
24
|
+
*/
|
|
25
|
+
readonly newDevice: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* The device token for the client to keep — in a long-lived cookie — and
|
|
28
|
+
* to present as `device` at its next sign-in: the one it presented, a
|
|
29
|
+
* fresh one for a new device, or the same device signed again with the
|
|
30
|
+
* first key. **`null` without a `device`**: nothing is minted then.
|
|
31
|
+
*/
|
|
32
|
+
readonly deviceToken: string | null;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* What a sign-in takes besides its credentials: `signUp`, `signIn`,
|
|
36
|
+
* `secondFactor.confirm`, `secondFactor.recover`, `signInCode.confirm`,
|
|
37
|
+
* `magicLink.confirm` and `signInProven`.
|
|
38
|
+
*/
|
|
39
|
+
export interface SignInOptions {
|
|
40
|
+
/**
|
|
41
|
+
* The device token the client holds — the `deviceToken` an earlier
|
|
42
|
+
* sign-in answered — or `null` when it holds none yet. Absent, devices
|
|
43
|
+
* are not tracked for this call: `newDevice` is `false`, `deviceToken`
|
|
44
|
+
* `null`, and no event is sent. **Requires `janus({ devices })`.**
|
|
45
|
+
*
|
|
46
|
+
* A sign-in answering a second-factor challenge carries nothing to its
|
|
47
|
+
* confirmation: give the device again to `secondFactor.confirm` or
|
|
48
|
+
* `recover`.
|
|
49
|
+
*/
|
|
50
|
+
readonly device?: string | null;
|
|
51
|
+
/**
|
|
52
|
+
* What to show for this device in a list of the user's sessions — the
|
|
53
|
+
* request's `User-Agent`, a name the client sent. Stored on the session as
|
|
54
|
+
* `device` and read by `auth.sessions.list`. Not a credential: never
|
|
55
|
+
* trusted, never compared; cut at 256 characters. Independent of `device`,
|
|
56
|
+
* which needs `janus({ devices })` — this does not.
|
|
57
|
+
*/
|
|
58
|
+
readonly deviceLabel?: string;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* The password was right, and the user has a second factor: no session yet.
|
|
62
|
+
* Ask for a code, then call `secondFactor.confirm(challenge, code)` — or,
|
|
63
|
+
* when `methods` holds `'passkey'`, hand `passkeyOptions` to
|
|
64
|
+
* `navigator.credentials.get` and call
|
|
65
|
+
* `secondFactor.confirmPasskey(challenge, assertion)`.
|
|
66
|
+
*
|
|
67
|
+
* **The challenge is a secret** like a session token: keep it where the
|
|
68
|
+
* visitor's next request can present it — a short-lived cookie, or the body
|
|
69
|
+
* of your code form — and never in a URL or a log.
|
|
70
|
+
*/
|
|
71
|
+
export interface SecondFactorRequired {
|
|
72
|
+
readonly status: 'secondFactor';
|
|
73
|
+
readonly challenge: string;
|
|
74
|
+
/** When the challenge lapses. Five minutes after `signIn`, by default. */
|
|
75
|
+
readonly expiresAt: Date;
|
|
76
|
+
/**
|
|
77
|
+
* Whose sign-in waits for its code — for your logs and your rate limits.
|
|
78
|
+
* **Not for the visitor**: they have proved a password or an e-mail, not
|
|
79
|
+
* yet who they are, so answer them the challenge alone.
|
|
80
|
+
*/
|
|
81
|
+
readonly userId: Id;
|
|
82
|
+
/**
|
|
83
|
+
* What the user can answer the challenge with: always `'totp'` (the app's
|
|
84
|
+
* code, or a recovery code), plus `'passkey'` when `janus()` was given
|
|
85
|
+
* `passkeys` and the user holds at least one. Show only these.
|
|
86
|
+
*/
|
|
87
|
+
readonly methods: readonly SecondFactorMethod[];
|
|
88
|
+
/**
|
|
89
|
+
* The JSON for `navigator.credentials.get({ publicKey })`, as the
|
|
90
|
+
* verifier shaped it, allowing the user's passkeys — present exactly when
|
|
91
|
+
* `methods` holds `'passkey'`. Its WebAuthn challenge is derived from
|
|
92
|
+
* `challenge`: nothing more is stored. Like `userId`, it names the user's
|
|
93
|
+
* credential ids: **answer it only to a visitor who proved the first
|
|
94
|
+
* factor**, which `signIn` just checked.
|
|
95
|
+
*/
|
|
96
|
+
readonly passkeyOptions?: Readonly<Record<string, unknown>>;
|
|
97
|
+
}
|
|
98
|
+
/** A way to answer a {@link SecondFactorRequired}. */
|
|
99
|
+
export type SecondFactorMethod = 'totp' | 'passkey';
|
|
100
|
+
/** What `signIn` answers once a second factor is configured: switch on `status`. */
|
|
101
|
+
export type SignInResult<U> = SignedIn<U> | SecondFactorRequired;
|
|
102
|
+
//# sourceMappingURL=sign-in.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sign-in.d.ts","sourceRoot":"","sources":["../../../src/auth/types/sign-in.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC;;;;GAIG;AACH,MAAM,WAAW,QAAQ,CAAC,CAAC;IAC1B,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC;IAC5B,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC;IACjB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB;;;;;OAKG;IACH,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B;;;;;OAKG;IACH,QAAQ,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;CACpC;AAED;;;;GAIG;AACH,MAAM,WAAW,aAAa;IAC7B;;;;;;;;;OASG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC;;;;;;OAMG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED;;;;;;;;;;GAUG;AACH,MAAM,WAAW,oBAAoB;IACpC,QAAQ,CAAC,MAAM,EAAE,cAAc,CAAC;IAChC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,0EAA0E;IAC1E,QAAQ,CAAC,SAAS,EAAE,IAAI,CAAC;IACzB;;;;OAIG;IACH,QAAQ,CAAC,MAAM,EAAE,EAAE,CAAC;IACpB;;;;OAIG;IACH,QAAQ,CAAC,OAAO,EAAE,SAAS,kBAAkB,EAAE,CAAC;IAChD;;;;;;;OAOG;IACH,QAAQ,CAAC,cAAc,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;CAC5D;AAED,sDAAsD;AACtD,MAAM,MAAM,kBAAkB,GAAG,MAAM,GAAG,SAAS,CAAC;AAEpD,oFAAoF;AACpF,MAAM,MAAM,YAAY,CAAC,CAAC,IAAI,QAAQ,CAAC,CAAC,CAAC,GAAG,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/** What a social flow's start answers, and what a linked account is: the small records `social.ts` builds on. */
|
|
2
|
+
/** One linked social account, as application code sees it. */
|
|
3
|
+
export interface SocialLink {
|
|
4
|
+
/** The application's name for the provider (`'google'`). */
|
|
5
|
+
readonly provider: string;
|
|
6
|
+
/** The provider's identifier of the account. Keep it out of logs and events. */
|
|
7
|
+
readonly accountId: string;
|
|
8
|
+
/** The e-mail the provider reported when the account was linked, or `null`. */
|
|
9
|
+
readonly email: string | null;
|
|
10
|
+
readonly linkedAt: Date;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* A flow begun: send the visitor to `url`, with the flow kept until the
|
|
14
|
+
* callback. **`flow` is a secret** like a session token: it goes in
|
|
15
|
+
* `setCookie`'s `HttpOnly` cookie (or, behind a BFF, in one of its own) and
|
|
16
|
+
* comes back to `social.complete`; never in a URL or a log.
|
|
17
|
+
*/
|
|
18
|
+
export interface SocialFlowStart {
|
|
19
|
+
/** The provider's authorization URL. */
|
|
20
|
+
readonly url: string;
|
|
21
|
+
/** The flow's secret and contents: the flow cookie's value. */
|
|
22
|
+
readonly flow: string;
|
|
23
|
+
/** When the flow lapses (`tokens.socialFlow`, ten minutes by default). */
|
|
24
|
+
readonly expiresAt: Date;
|
|
25
|
+
/** The flow cookie as a `Set-Cookie` value: `HttpOnly`, `SameSite=Lax`. */
|
|
26
|
+
readonly setCookie: string;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=social-flow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"social-flow.d.ts","sourceRoot":"","sources":["../../../src/auth/types/social-flow.ts"],"names":[],"mappings":"AAAA,iHAAiH;AAEjH,8DAA8D;AAC9D,MAAM,WAAW,UAAU;IAC1B,4DAA4D;IAC5D,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,gFAAgF;IAChF,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,+EAA+E;IAC/E,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,QAAQ,CAAC,QAAQ,EAAE,IAAI,CAAC;CACxB;AAED;;;;;GAKG;AACH,MAAM,WAAW,eAAe;IAC/B,wCAAwC;IACxC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,+DAA+D;IAC/D,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,0EAA0E;IAC1E,QAAQ,CAAC,SAAS,EAAE,IAAI,CAAC;IACzB,2EAA2E;IAC3E,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC3B"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The per-request step-up types of `social.start` / `social.link` and what
|
|
3
|
+
* `social.complete` echoes back.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* A per-request step-up for `social.start` / `social.link`: what to ask the
|
|
7
|
+
* provider for beyond a plain sign-in, at least one of the two. The provider
|
|
8
|
+
* must set `supportsStepUp`, else `start` throws a `TypeError`.
|
|
9
|
+
*
|
|
10
|
+
* `acrValues` are the authentication context classes wanted (`acr_values`),
|
|
11
|
+
* best first; the identity must come back with one of them. `maxAge` is how
|
|
12
|
+
* old, in seconds (0 to 2 592 000), the user's last active authentication at
|
|
13
|
+
* the provider may be (`max_age`), with a 60 s tolerance either way, so `0`
|
|
14
|
+
* means roughly "just now".
|
|
15
|
+
*/
|
|
16
|
+
export type SocialStepUp = {
|
|
17
|
+
readonly acrValues: readonly string[];
|
|
18
|
+
readonly maxAge?: number;
|
|
19
|
+
} | {
|
|
20
|
+
readonly acrValues?: readonly string[];
|
|
21
|
+
readonly maxAge: number;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* What a flow that asked for a step-up and got it carries: what was asked
|
|
25
|
+
* (`acrValues`, `maxAge`, `null` for a part not asked) and what the provider
|
|
26
|
+
* reported (`acr`, `authTime`, `null` when it reported none and none was
|
|
27
|
+
* needed). `authTime` is unchecked unless `maxAge` was asked, and `acr`
|
|
28
|
+
* unless `acrValues` was. **A plain flow answers `stepUp: null`**: an application that needs
|
|
29
|
+
* the step-up checks `result.stepUp !== null` itself, since a flow cookie
|
|
30
|
+
* from a plain `start` completes at the same callback.
|
|
31
|
+
*/
|
|
32
|
+
export interface SocialStepUpProof {
|
|
33
|
+
readonly acrValues: readonly string[] | null;
|
|
34
|
+
readonly maxAge: number | null;
|
|
35
|
+
readonly acr: string | null;
|
|
36
|
+
readonly authTime: Date | null;
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=social-step-up.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"social-step-up.d.ts","sourceRoot":"","sources":["../../../src/auth/types/social-step-up.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;GAUG;AACH,MAAM,MAAM,YAAY,GACrB;IACA,QAAQ,CAAC,SAAS,EAAE,SAAS,MAAM,EAAE,CAAC;IACtC,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;CACxB,GACD;IACA,QAAQ,CAAC,SAAS,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACvC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACvB,CAAC;AAEL;;;;;;;;GAQG;AACH,MAAM,WAAW,iBAAiB;IACjC,QAAQ,CAAC,SAAS,EAAE,SAAS,MAAM,EAAE,GAAG,IAAI,CAAC;IAC7C,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,QAAQ,CAAC,QAAQ,EAAE,IAAI,GAAG,IAAI,CAAC;CAC/B"}
|