@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,467 @@
|
|
|
1
|
+
# User events
|
|
2
|
+
|
|
3
|
+
This page is for hearing what happens to a user once it is written: created,
|
|
4
|
+
e-mail verified, password reset or changed, e-mail changed, second factor
|
|
5
|
+
turned on or off, recovery codes regenerated or one used, a sign-in from a
|
|
6
|
+
new device, a social account linked or unlinked, deleted. Another service can then follow
|
|
7
|
+
without polling. `janus` hands each event to one function you give it;
|
|
8
|
+
**delivering it is yours** — or
|
|
9
|
+
[`@softistx/janus-webhooks`](https://github.com/softistx/nxgt-janus/tree/develop/packages/janus-webhooks)'s:
|
|
10
|
+
`webhooks({ endpoints })` signs and posts each event.
|
|
11
|
+
|
|
12
|
+
```ts
|
|
13
|
+
import { z } from 'zod';
|
|
14
|
+
import { createMemoryStores, janus, scryptHasher, type UserEvent } from '@softistx/janus';
|
|
15
|
+
|
|
16
|
+
const received: UserEvent[] = [];
|
|
17
|
+
|
|
18
|
+
const auth = janus({
|
|
19
|
+
user: z.object({ email: z.email() }),
|
|
20
|
+
password: { login: 'email' },
|
|
21
|
+
store: createMemoryStores(),
|
|
22
|
+
hasher: scryptHasher(),
|
|
23
|
+
events(event) {
|
|
24
|
+
received.push(event);
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
const { user } = await auth.signUp({ email: 'ada@example.com', password: 'correct horse' });
|
|
29
|
+
received[0];
|
|
30
|
+
// {
|
|
31
|
+
// id: '0199…', a UUIDv7 minted for this event
|
|
32
|
+
// type: 'user.created',
|
|
33
|
+
// occurredAt: Date, when the write landed — its createdAt here
|
|
34
|
+
// userId: user.id,
|
|
35
|
+
// userType: 'user',
|
|
36
|
+
// }
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
The words — **user event**, **listener** — are defined in
|
|
40
|
+
[the vocabulary](vocabulary.md#identities).
|
|
41
|
+
|
|
42
|
+
## The twenty types
|
|
43
|
+
|
|
44
|
+
| `type` | Sent by | Not sent |
|
|
45
|
+
| --- | --- | --- |
|
|
46
|
+
| `user.created` | `create`, `signUp` — once the user is inserted, even if `signUp`'s session then fails to open | for a sign-up refused (`LOGIN_TAKEN`, `USER_INVALID`, `PASSWORD_TOO_SHORT`) |
|
|
47
|
+
| `user.emailVerified` | `verifyEmail.confirm`, `verifyEmail.proveFirst` and `setEmailVerified` (turning the flag on; clearing it sends no event); `changeEmail.confirm`, whose link reached the new address; `resetPassword.confirm` and `magicLink.confirm`, whose link proves the e-mail; `signInCode.confirm`, whose code does | for an e-mail already verified — `changeEmail.confirm` to the same address in another case included — or a refused confirm |
|
|
48
|
+
| `user.passwordReset` | `resetPassword.confirm` | for `setPassword` or `changePassword` — they are not resets |
|
|
49
|
+
| `user.passwordChanged` | `changePassword` and `setPassword` — a first password set on a user created without one included, which carries `first: true` — once the password is written — even if spending the reset links and second-factor challenges it ends then fails; `signInCode.confirm`, `magicLink.confirm`, `verifyEmail.proveFirst` and `verifyEmail.confirm(token, { firstProof: true })` when their first proof of the e-mail dropped a password, after `user.emailVerified` | for a reset, which is `user.passwordReset` alone; for a `changePassword` refused (`CREDENTIALS_INVALID`) |
|
|
50
|
+
| `user.emailChanged` | `update` and `changeEmail.confirm`, when they changed the e-mail — added, replaced or removed. It carries `formerEmail`, the address before | for an update that leaves the e-mail alone, or changes only its case (`Ada@…` for `ada@…`): compared normalised, the same test that makes the new address unverified; for a type with no e-mail; for an update refused |
|
|
51
|
+
| `user.secondFactorEnabled` | `secondFactor.activate`, once the first code made the factor active | for `enroll`, which leaves the factor waiting and asked for nowhere; for a code refused |
|
|
52
|
+
| `user.secondFactorDisabled` | `secondFactor.disable`, when it removed an **active** factor; `signInCode.confirm`, `magicLink.confirm`, `verifyEmail.proveFirst` and `verifyEmail.confirm(token, { firstProof: true })` when their first proof of the e-mail removed one, after `user.emailVerified` and any `user.passwordChanged` — even if an outage interrupts the sign-outs | for a user who had no factor, a factor still waiting for its first code — it was never asked for — or a second `disable` |
|
|
53
|
+
| `user.recoveryCodesRegenerated` | `secondFactor.regenerateRecoveryCodes`: the codes the user held stopped working | for `activate`, whose first codes come with `user.secondFactorEnabled`; for a code refused |
|
|
54
|
+
| `user.recoveryCodeUsed` (not `spendRecoveryCode`, which sends nothing) | `secondFactor.recover`, once the recovery code is spent — even if opening the session then fails | for a recovery code refused. How many are left is not in the event: `secondFactor.recoveryCodesLeft(event.userId)` reads it |
|
|
55
|
+
| `user.newDeviceSignedIn` | `signIn`, `secondFactor.confirm`, `secondFactor.recover`, `signInCode.confirm`, `magicLink.confirm` and `signInProven`, given a `device` whose token did not prove this user signed in there — once the sign-in is complete. It carries `sessionId`, the new session's. See [devices](devices.md) | for `signUp`, which mints the first token; for a call given no `device`; for a known device; for a challenge, which opens no session; for a sign-in refused — a wrong password, or a `signIn` refused after its session opened because a password was written meanwhile |
|
|
56
|
+
| `user.avatarChanged` | `avatar.set`, when it wrote an id different from the user's current one. It carries `formerAvatarId`, the id replaced, `null` for a first avatar | for the same id set again; for a refused id (`AVATAR_ID_INVALID`) |
|
|
57
|
+
| `user.avatarRemoved` | `avatar.remove`, or the first proof of an e-mail (`verifyEmail.proveFirst`, a code, a link), when the user had an avatar. It carries `formerAvatarId`, the id it had | for a user with no avatar |
|
|
58
|
+
| `user.socialLinked` | `social.complete`, when it linked an account: a link flow, an existing user matched by a verified e-mail, or the user a social sign-up created (after `user.created`). It carries `provider`, never the account's id. See [social sign-in](social.md) | for an account already linked to that user; for a refused link (`SOCIAL_ACCOUNT_TAKEN`, `EMAIL_NOT_VERIFIED_FOR_LINK`) |
|
|
59
|
+
| `user.socialUnlinked` | `social.unlink`, when it deleted a link. It carries `provider` | for a link that is not the user's or not there (`false`); for a refused unlink (`LAST_SIGN_IN_METHOD`) |
|
|
60
|
+
| `user.passkeyAdded` | `passkeys.register`, once the passkey is stored. It carries `passkey: { credentialId, name }` | for `registrationOptions`, which stores nothing; for a registration refused (`PASSKEY_INVALID`, `PASSKEY_TAKEN`, a spent challenge) |
|
|
61
|
+
| `user.passkeyRemoved` | `passkeys.remove`, when it deleted a passkey; `secondFactor.disable` (and a first proof that removed an active TOTP), once for each passkey it took with the factor. It carries `passkey: { credentialId, name }` | for a passkey that is not the user's or not there (`false`) |
|
|
62
|
+
| `user.passkeyCloneSuspected` | `secondFactor.confirmPasskey` and `stepUp.confirmPasskey`, when an assertion's counter did not move forward (both counters non-zero). It carries `passkey: { credentialId, name }` | for a counter of `0`, stored or received, which is always accepted; for any other refusal. The call is refused, the passkey stays active |
|
|
63
|
+
| `user.apiKeyCreated` | `apiKeys.create`, once the key is stored. See [API keys](api-keys.md) | for a create refused (`STEP_UP_REQUIRED`, `API_KEY_LIMIT`, …) |
|
|
64
|
+
| `user.apiKeyRevoked` | every call that revoked keys: `apiKeys.revoke`, `apiKeys.revokeAll`, `apiKeys.revokeAllBound`, and the password reset and first proof of an e-mail that revoke the user's keys. **One event per call**, carrying `count`, the keys it ended | for a call that ended none (a key already revoked, a user with no standing key); for `delete`, which sends `user.deleted` |
|
|
65
|
+
| `user.deleted` | `delete`, when it deleted the user | for a replay that finds nobody, or an id of another user type |
|
|
66
|
+
|
|
67
|
+
`user.passwordChanged` carries `first`: `true` when the user had no password
|
|
68
|
+
before the write (a `setPassword` on an account created without a credential),
|
|
69
|
+
`false` for a change and for a first proof that dropped a password. A "your
|
|
70
|
+
password was changed" notice skips `first: true`: the user just created that
|
|
71
|
+
password. Like `formerEmail`, it stays in the process: an event a webhook
|
|
72
|
+
delivers does not carry it.
|
|
73
|
+
|
|
74
|
+
A reset whose link verifies the e-mail sends both, `user.passwordReset`
|
|
75
|
+
first. **A reset does not also send `user.passwordChanged`**: a listener that
|
|
76
|
+
cares about every new password handles both types, as the `switch` below
|
|
77
|
+
does — one event per write, rather than two a listener would have to tell
|
|
78
|
+
apart. Switch on `type`: the twenty are a closed set, and TypeScript refuses a
|
|
79
|
+
twenty-first. A new type is a compile error in a `switch` that exhausts them — the
|
|
80
|
+
two recovery-code types, added in 0.10, the two change types, added in
|
|
81
|
+
0.14, `user.newDeviceSignedIn`, added in 0.17, the two avatar types, added in 0.29,
|
|
82
|
+
and the two social types, added in 0.38, each broke such a `switch` until it handled them.
|
|
83
|
+
|
|
84
|
+
```ts
|
|
85
|
+
function onUserEvent(event: UserEvent): void {
|
|
86
|
+
switch (event.type) {
|
|
87
|
+
case 'user.created':
|
|
88
|
+
return welcomeTheUser(event.userId); // reads the user, then @softistx/janus-mail's mail.welcome
|
|
89
|
+
case 'user.emailVerified':
|
|
90
|
+
return unlockFeatures(event.userId);
|
|
91
|
+
case 'user.passwordReset':
|
|
92
|
+
case 'user.passwordChanged':
|
|
93
|
+
return noticeTheUser(event); // @softistx/janus-mail's passwordChanged — see below
|
|
94
|
+
case 'user.emailChanged':
|
|
95
|
+
return noticeTheFormerAddress(event); // to event.formerEmail — see below
|
|
96
|
+
case 'user.secondFactorEnabled':
|
|
97
|
+
case 'user.secondFactorDisabled':
|
|
98
|
+
return noticeTheUser(event); // @softistx/janus-mail's twoFactorEnabled or twoFactorDisabled
|
|
99
|
+
case 'user.recoveryCodesRegenerated':
|
|
100
|
+
return;
|
|
101
|
+
case 'user.recoveryCodeUsed':
|
|
102
|
+
return warnTheUser(event.userId); // a sign-in without their phone — see below
|
|
103
|
+
case 'user.newDeviceSignedIn':
|
|
104
|
+
return warnTheUser(event.userId); // @softistx/janus-mail's newSignIn — see below
|
|
105
|
+
case 'user.avatarChanged':
|
|
106
|
+
case 'user.avatarRemoved':
|
|
107
|
+
// formerAvatarId is null on a first set: nothing to delete — see below
|
|
108
|
+
return event.formerAvatarId == null ? undefined : store.remove({ imageId: event.formerAvatarId });
|
|
109
|
+
case 'user.socialLinked':
|
|
110
|
+
case 'user.socialUnlinked':
|
|
111
|
+
return noticeTheUser(event); // event.provider: 'google'; a notice that a sign-in method changed
|
|
112
|
+
case 'user.deleted':
|
|
113
|
+
return forgetEverywhere(event.userId);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### Telling the user a recovery code was used
|
|
119
|
+
|
|
120
|
+
A recovery code used by someone else is a sign-in without the user's phone,
|
|
121
|
+
so tell the user each time — and how many codes they have left, which the
|
|
122
|
+
event does not carry: `secondFactor.recoveryCodesLeft` reads it, after the
|
|
123
|
+
write, so the code just spent is already out of the count.
|
|
124
|
+
[`@softistx/janus-mail`](https://github.com/softistx/nxgt-janus/tree/develop/packages/janus-mail)'s
|
|
125
|
+
`recoveryCodeUsed` is the e-mail, in English and French:
|
|
126
|
+
|
|
127
|
+
```ts
|
|
128
|
+
// `mail` is janusMail({ … }), and the user schema holds a name and a locale.
|
|
129
|
+
const auth = janus({
|
|
130
|
+
...config,
|
|
131
|
+
async events(event) {
|
|
132
|
+
if (event.type === 'user.recoveryCodeUsed') {
|
|
133
|
+
const user = await auth.get(event.userId);
|
|
134
|
+
const recoveryCodesLeft = await auth.secondFactor.recoveryCodesLeft(user);
|
|
135
|
+
if (recoveryCodesLeft === null) return; // the factor was turned off since
|
|
136
|
+
const when = new Intl.DateTimeFormat(user.locale, {
|
|
137
|
+
dateStyle: 'long',
|
|
138
|
+
timeStyle: 'short',
|
|
139
|
+
timeZone: 'Europe/Paris', // the user's, when you keep it
|
|
140
|
+
}).format(event.occurredAt);
|
|
141
|
+
await mail.recoveryCodeUsed(
|
|
142
|
+
{ name: user.name, locale: user.locale, email: user.email },
|
|
143
|
+
{ when, recoveryCodesLeft }, // "You have 9 recovery codes left."
|
|
144
|
+
);
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
});
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
With several user types, the count is the type's:
|
|
151
|
+
`auth.patient.secondFactor.recoveryCodesLeft(event.userId)`, on
|
|
152
|
+
`event.userType`.
|
|
153
|
+
|
|
154
|
+
### Telling the user a new device signed in
|
|
155
|
+
|
|
156
|
+
A sign-in from a device the user had not signed in from is how a stolen
|
|
157
|
+
password shows, so tell the user.
|
|
158
|
+
[`@softistx/janus-mail`](https://github.com/softistx/nxgt-janus/tree/develop/packages/janus-mail)'s
|
|
159
|
+
`newSignIn` is the e-mail — the device, the time and, when you know it, the
|
|
160
|
+
place, each your text in the user's locale:
|
|
161
|
+
|
|
162
|
+
```ts
|
|
163
|
+
// `mail` is janusMail({ … }), and the user schema holds a name and a locale.
|
|
164
|
+
const auth = janus({
|
|
165
|
+
...config,
|
|
166
|
+
async events(event) {
|
|
167
|
+
if (event.type === 'user.newDeviceSignedIn') {
|
|
168
|
+
const user = await auth.get(event.userId);
|
|
169
|
+
const time = new Intl.DateTimeFormat(user.locale, {
|
|
170
|
+
dateStyle: 'long',
|
|
171
|
+
timeStyle: 'short',
|
|
172
|
+
timeZone: 'Europe/Paris', // the user's, when you keep it
|
|
173
|
+
}).format(event.occurredAt); // the new session's createdAt
|
|
174
|
+
await mail.newSignIn({ name: user.name, locale: user.locale, email: user.email }, { device: 'a new device', time });
|
|
175
|
+
}
|
|
176
|
+
},
|
|
177
|
+
});
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
The event has no request, so it cannot say which device: send from the
|
|
181
|
+
sign-in's answer instead — `if (signedIn.newDevice) …` — to name it from
|
|
182
|
+
the `User-Agent`. [Devices](devices.md#the-e-mail-nxgtjanus-mails-newsignin)
|
|
183
|
+
has both.
|
|
184
|
+
|
|
185
|
+
### Telling the user their password or e-mail changed
|
|
186
|
+
|
|
187
|
+
A password changed by someone else, or an e-mail moved to their inbox, is how
|
|
188
|
+
an account is taken over — so tell the user each time. For a password, read
|
|
189
|
+
the user and write to their address. For an e-mail, write to the **former**
|
|
190
|
+
address: the new one belongs to whoever changed it. The event carries it,
|
|
191
|
+
since nothing else keeps it once the write landed:
|
|
192
|
+
|
|
193
|
+
```ts
|
|
194
|
+
// `mail` is janusMail({ … }), and the user schema holds a name and a locale.
|
|
195
|
+
const auth = janus({
|
|
196
|
+
...config,
|
|
197
|
+
async events(event) {
|
|
198
|
+
if (event.type === 'user.passwordChanged' && !event.first) {
|
|
199
|
+
const user = await auth.get(event.userId);
|
|
200
|
+
await mail.passwordChanged({ name: user.name, locale: user.locale, email: user.email });
|
|
201
|
+
}
|
|
202
|
+
if (event.type === 'user.emailChanged' && event.formerEmail != null) {
|
|
203
|
+
const user = await auth.get(event.userId);
|
|
204
|
+
await mail.emailChanged({
|
|
205
|
+
name: user.name,
|
|
206
|
+
locale: user.locale,
|
|
207
|
+
formerEmail: event.formerEmail, // to the inbox the account just left
|
|
208
|
+
newEmail: user.email,
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
},
|
|
212
|
+
});
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
`formerEmail` is `null` for a user who had no e-mail before the update:
|
|
216
|
+
there is no former inbox to tell. The example assumes a required e-mail; with
|
|
217
|
+
an optional one, an update that removes it sends the event too, and the user
|
|
218
|
+
read back has no `newEmail` to name — check `user.email` before the notice. Pass the same notices on `user.passwordReset`
|
|
219
|
+
too, if a reset should be told as well.
|
|
220
|
+
|
|
221
|
+
## What an event carries
|
|
222
|
+
|
|
223
|
+
**The user named by id, and nothing else** — with four exceptions, below. No
|
|
224
|
+
login, no field of the schema, no password or hash, no session or one-time
|
|
225
|
+
token. An event can
|
|
226
|
+
land in a queue, a log or another company's endpoint; whoever receives it
|
|
227
|
+
reads the rest from where it is kept — `auth.get(event.userId)` — if they
|
|
228
|
+
may. A user deleted since is `NOT_FOUND` there, which is the answer.
|
|
229
|
+
|
|
230
|
+
**The first exception is `formerEmail`, on `user.emailChanged` only**: the address
|
|
231
|
+
the user had before the update, as it was stored, or `null` when they had
|
|
232
|
+
none. Once the write landed it is kept nowhere else, and a notice to the
|
|
233
|
+
inbox the account just left needs it. It is absent from every other type.
|
|
234
|
+
`@softistx/janus-webhooks` does not carry it: it strips it before the queue, so
|
|
235
|
+
it reaches no endpoint, no queue and no `onGivingUp` report — send the
|
|
236
|
+
notice from the listener, in the process that wrote.
|
|
237
|
+
|
|
238
|
+
**The second is `sessionId`, on `user.newDeviceSignedIn` only**: the id of
|
|
239
|
+
the session the new device opened, so a "this wasn't me" page can end that
|
|
240
|
+
one. It is absent from every other type, and `@softistx/janus-webhooks` strips
|
|
241
|
+
it as it strips `formerEmail`.
|
|
242
|
+
|
|
243
|
+
**The third is `formerAvatarId`, on `user.avatarChanged` and
|
|
244
|
+
`user.avatarRemoved` only**: the avatar id the user had before — `null` on a
|
|
245
|
+
first `avatar.set`, always a string on `user.avatarRemoved`. Janus keeps only
|
|
246
|
+
the id, so this is how the application learns which image to delete from its
|
|
247
|
+
storage once the record no longer points at it. It is absent from every other
|
|
248
|
+
type, and `@softistx/janus-webhooks` strips it as it strips `formerEmail`:
|
|
249
|
+
delete the image from the `events` listener, in the process that wrote — the
|
|
250
|
+
`store.remove` case in the listener at the top of this page, and the
|
|
251
|
+
[README's avatar example](../../README.md#avatars--avatar), do exactly this; the whole recipe is in [account avatars](avatars.md).
|
|
252
|
+
|
|
253
|
+
**The fourth is `provider`, on `user.socialLinked` and `user.socialUnlinked` only**:
|
|
254
|
+
the application's name for the provider (`'google'`). Never the provider's
|
|
255
|
+
account id, nor its e-mail: read the links with `auth.social.list(userId)`.
|
|
256
|
+
|
|
257
|
+
**The fifth is `count`, on `user.apiKeyRevoked` only**: how many keys the call
|
|
258
|
+
revoked. A bulk revoke (`revokeAll`, `revokeAllBound`, a password reset) sends
|
|
259
|
+
one event with its count, never one per key, and a call that revoked nothing
|
|
260
|
+
sends none. The event never names a key: its id and its secret stay where the
|
|
261
|
+
keys are kept (`auth.apiKeys.list(userId)`). Like `formerEmail`, `count`
|
|
262
|
+
stays in the process: a webhook posts the user alone.
|
|
263
|
+
|
|
264
|
+
A receiver that only gets webhooks never sees `formerAvatarId`, and janus keeps
|
|
265
|
+
no former id to ask for. It must keep the id itself: read the user's current
|
|
266
|
+
avatar id (`user.avatar?.id`) before calling `avatar.set` or `avatar.remove`,
|
|
267
|
+
and delete that image once the call answered.
|
|
268
|
+
|
|
269
|
+
`id` is minted for the event, a UUIDv7 that sorts by time. Deliver on it:
|
|
270
|
+
a queue job id, a primary key, a webhook's `webhook-id` header. Two events
|
|
271
|
+
never share one.
|
|
272
|
+
|
|
273
|
+
## When the listener runs
|
|
274
|
+
|
|
275
|
+
After the write, **awaited**, before the flow answers. So a listener
|
|
276
|
+
that stores the event durably — a job queue, an outbox table — has done so
|
|
277
|
+
when `signUp` answers:
|
|
278
|
+
|
|
279
|
+
```ts
|
|
280
|
+
const auth = janus({
|
|
281
|
+
...config,
|
|
282
|
+
async events(event) {
|
|
283
|
+
await jobs.add(event.type, event, { jobId: event.id });
|
|
284
|
+
},
|
|
285
|
+
});
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
Where the listener runs within a flow, and what an outage does to it:
|
|
289
|
+
|
|
290
|
+
| Flow | The listener runs | A store outage after the write |
|
|
291
|
+
| --- | --- | --- |
|
|
292
|
+
| `create` | after the insert — its last step | — |
|
|
293
|
+
| `signUp` | after the insert, **before** the session is opened | fails the call; the event is already sent |
|
|
294
|
+
| `verifyEmail.confirm` | after the write — the flow's last step (with `{ firstProof: true }` on an e-mail never verified, as the first-proof flows below) | — |
|
|
295
|
+
| `update` | after the write — and, when it moved the e-mail, after the user's pending change links are spent | fails the call with `STORE_FAILED`, the write landed; the event is sent all the same, from a `finally` |
|
|
296
|
+
| `changeEmail.confirm` | after the write — the flow's last step: `user.emailChanged`, then `user.emailVerified` | — (a `VERSION_CONFLICT` or `LOGIN_TAKEN` leaves nothing written and sends nothing; the token is already spent) |
|
|
297
|
+
| `changePassword`, `setPassword` | **after** the reset links and the second-factor challenges left open are spent | fails the call; the event is sent all the same, from a `finally` |
|
|
298
|
+
| `signInCode.confirm`, `magicLink.confirm`, `verifyEmail.proveFirst`, `verifyEmail.confirm` with `{ firstProof: true }` | on an e-mail never verified: **after** every session and API key is revoked and the reset links and second-factor challenges left open are spent — before the write and again after it — and **before** the new session or second-factor challenge is opened. `user.passwordChanged` follows `user.emailVerified` when a password was dropped, then `user.secondFactorDisabled` when an active second factor was removed, then `user.avatarRemoved` when an avatar was cleared. An e-mail already verified sends nothing | fails the call; the events are sent all the same, from a `finally`. An outage in the sign-outs before the write fails the call with nothing written and nothing sent: the next code, link or `proveFirst` proves the e-mail again |
|
|
299
|
+
| `secondFactor.activate`, `secondFactor.regenerateRecoveryCodes`, `secondFactor.disable` | after the write — the flow's last step | — |
|
|
300
|
+
| `avatar.set`, `avatar.remove` | after the write — the flow's last step | — |
|
|
301
|
+
| `social.complete` (a link), `social.unlink` | after the write — the flow's last step; for a sign-in that links, before the session is opened | fails the call; the event is already sent |
|
|
302
|
+
| `secondFactor.recover` | after the recovery code is spent and the session opened — or failed to open | fails the call; the recovery code is spent and the event sent all the same, from a `finally` |
|
|
303
|
+
| `signIn`, `secondFactor.confirm`, `secondFactor.recover`, `signInCode.confirm`, `magicLink.confirm`, `signInProven` — `user.newDeviceSignedIn` | **last**, once the session is open and the sign-in complete: after `user.recoveryCodeUsed`, and after the events of a first proof of the e-mail | fails the call, and `user.newDeviceSignedIn` is not sent: it comes only once the sign-in is complete |
|
|
304
|
+
| `resetPassword.confirm` | **after** the sessions opened with the old password are revoked, and the other reset links and the second-factor challenges left open are spent | fails the call; the events are sent all the same, from a `finally` |
|
|
305
|
+
| `delete` | **after** the user's sessions and one-time tokens are removed, and the relation tuples naming them when `relations` is wired | fails the call; the event is sent all the same, from a `finally` |
|
|
306
|
+
|
|
307
|
+
So a listener that takes its time never leaves an old session alive after a
|
|
308
|
+
reset, one that hears of a password changed finds the older reset links
|
|
309
|
+
already spent, and one that checks permissions on `user.deleted` finds the
|
|
310
|
+
tuples gone. A retry could not send a lost event either way: `delete` then finds
|
|
311
|
+
nobody, and the reset link is spent.
|
|
312
|
+
|
|
313
|
+
`occurredAt` is the write's own time: the `createdAt` or `updatedAt` it
|
|
314
|
+
wrote, the time read just before the deletion — not when the listener ran.
|
|
315
|
+
|
|
316
|
+
It runs inline, so it costs every flow that sends an event: store the event
|
|
317
|
+
and return. Sending an HTTP request from the listener makes every sign-up as
|
|
318
|
+
slow as the slowest endpoint, and as fragile.
|
|
319
|
+
|
|
320
|
+
## When the listener fails
|
|
321
|
+
|
|
322
|
+
**It fails no flow.** The write happened: answering `signUp` with an error
|
|
323
|
+
would tell the visitor their account does not exist when it does, and a retry
|
|
324
|
+
would hit `LOGIN_TAKEN`. So a listener that throws, or rejects, is a warning:
|
|
325
|
+
|
|
326
|
+
```
|
|
327
|
+
(node:4242) [JANUS_EVENT_FAILED] Warning: janus: the events listener failed on user.created 0199… for user 0199…: Error
|
|
328
|
+
```
|
|
329
|
+
|
|
330
|
+
It names the event's type, its `id` and the user's id — what it takes to send
|
|
331
|
+
it again — and the failure's name, never its message, which may hold anything.
|
|
332
|
+
Listen for it where you watch your process's health:
|
|
333
|
+
|
|
334
|
+
```ts
|
|
335
|
+
process.on('warning', (warning) => {
|
|
336
|
+
if ((warning as { code?: string }).code === 'JANUS_EVENT_FAILED') {
|
|
337
|
+
metrics.increment('janus.events.failed');
|
|
338
|
+
logger.error(warning.message);
|
|
339
|
+
}
|
|
340
|
+
});
|
|
341
|
+
```
|
|
342
|
+
|
|
343
|
+
## What is not promised
|
|
344
|
+
|
|
345
|
+
**At most once, from the process that wrote.** The event is handed to the
|
|
346
|
+
listener after the write, in memory: a crash between the two loses it, and
|
|
347
|
+
nothing sends it later — there is no outbox in the store. What must never
|
|
348
|
+
miss one — a billing sync, a search index — also reads the users now and
|
|
349
|
+
then, and treats events as the fast path.
|
|
350
|
+
|
|
351
|
+
**No order across processes.** Two instances each hand their own events to
|
|
352
|
+
their own listener. `occurredAt` and the time-sorted `id` let a receiver put
|
|
353
|
+
them back in order.
|
|
354
|
+
|
|
355
|
+
## In a test
|
|
356
|
+
|
|
357
|
+
```ts
|
|
358
|
+
import { expect, it } from 'bun:test';
|
|
359
|
+
import { z } from 'zod';
|
|
360
|
+
import { createMemoryStores, janus, scryptHasher, type UserEvent } from '@softistx/janus';
|
|
361
|
+
|
|
362
|
+
it('tells the CRM about a sign-up', async () => {
|
|
363
|
+
const received: UserEvent[] = [];
|
|
364
|
+
const auth = janus({
|
|
365
|
+
user: z.object({ email: z.email() }),
|
|
366
|
+
password: { login: 'email' },
|
|
367
|
+
store: createMemoryStores(),
|
|
368
|
+
hasher: scryptHasher({ cost: 10 }),
|
|
369
|
+
events: (event) => void received.push(event),
|
|
370
|
+
});
|
|
371
|
+
|
|
372
|
+
const { user } = await auth.signUp({ email: 'ada@example.com', password: 'correct horse' });
|
|
373
|
+
|
|
374
|
+
expect(received).toEqual([expect.objectContaining({ type: 'user.created', userId: user.id })]);
|
|
375
|
+
});
|
|
376
|
+
```
|
|
377
|
+
|
|
378
|
+
## Signatures
|
|
379
|
+
|
|
380
|
+
```ts
|
|
381
|
+
type UserEventType =
|
|
382
|
+
| 'user.created'
|
|
383
|
+
| 'user.emailVerified'
|
|
384
|
+
| 'user.passwordReset'
|
|
385
|
+
| 'user.passwordChanged'
|
|
386
|
+
| 'user.emailChanged'
|
|
387
|
+
| 'user.secondFactorEnabled'
|
|
388
|
+
| 'user.secondFactorDisabled'
|
|
389
|
+
| 'user.recoveryCodesRegenerated'
|
|
390
|
+
| 'user.recoveryCodeUsed'
|
|
391
|
+
| 'user.newDeviceSignedIn'
|
|
392
|
+
| 'user.avatarChanged'
|
|
393
|
+
| 'user.avatarRemoved'
|
|
394
|
+
| 'user.socialLinked'
|
|
395
|
+
| 'user.socialUnlinked'
|
|
396
|
+
| 'user.passkeyAdded'
|
|
397
|
+
| 'user.passkeyRemoved'
|
|
398
|
+
| 'user.passkeyCloneSuspected'
|
|
399
|
+
| 'user.apiKeyCreated'
|
|
400
|
+
| 'user.apiKeyRevoked'
|
|
401
|
+
| 'user.deleted';
|
|
402
|
+
|
|
403
|
+
interface UserEvent {
|
|
404
|
+
readonly id: Id; // a UUIDv7, the key to deliver it once
|
|
405
|
+
readonly type: UserEventType;
|
|
406
|
+
readonly occurredAt: Date; // when the write landed: the createdAt or updatedAt written, or the time read just before a deletion
|
|
407
|
+
readonly userId: Id;
|
|
408
|
+
readonly userType: string;
|
|
409
|
+
readonly formerEmail?: string | null; // on user.emailChanged only: the address before, null for none
|
|
410
|
+
readonly sessionId?: string; // on user.newDeviceSignedIn only: the session the new device opened
|
|
411
|
+
readonly formerAvatarId?: string | null; // on user.avatarChanged and user.avatarRemoved only: the avatar id before, null for none
|
|
412
|
+
readonly first?: boolean; // on user.passwordChanged only: true when the user had no password before
|
|
413
|
+
readonly count?: number; // on user.apiKeyRevoked only: how many keys the call revoked
|
|
414
|
+
readonly provider?: string; // on user.socialLinked and user.socialUnlinked only: the application's name for the provider, never the account id
|
|
415
|
+
readonly passkey?: { readonly credentialId: string; readonly name: string }; // on the three passkey events only; stays in the process, a webhook does not carry it
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
type UserEventListener = (event: UserEvent) => void | Promise<void>;
|
|
419
|
+
|
|
420
|
+
janus({ ..., events?: UserEventListener });
|
|
421
|
+
```
|
|
422
|
+
|
|
423
|
+
`events` that is not a function is a `TypeError` when `janus()` is called —
|
|
424
|
+
see [troubleshooting](../troubleshooting.md#janus-events-must-be-a-function-that-takes-a-user-event--webhooks---from-nxgtjanus-webhooks-or-your-own).
|
|
425
|
+
|
|
426
|
+
## Invitation events
|
|
427
|
+
|
|
428
|
+
`janus({ invitations })` has its own listener, `invitations.events`, and its
|
|
429
|
+
events are **not** `UserEventType`s: an invitation is not a user, and a
|
|
430
|
+
listener for users never hears them. Same contract otherwise: called once the
|
|
431
|
+
write landed, awaited, and a listener that throws fails nothing (a
|
|
432
|
+
`JANUS_EVENT_FAILED` warning names the event).
|
|
433
|
+
|
|
434
|
+
| `type` | Sent by |
|
|
435
|
+
| --- | --- |
|
|
436
|
+
| `invitation.issued` | `invitations.issue`, once the invitation is stored |
|
|
437
|
+
| `invitation.resent` | `invitations.resend`: the old code stopped working |
|
|
438
|
+
| `invitation.revoked` | `invitations.revoke`, and an `issue` that took the place of a pending invitation for the same address |
|
|
439
|
+
| `invitation.accepted` | `invitations.accept`, once the invitee is a user and `onAccepted` returned. Not sent when the accept failed and the claim was released |
|
|
440
|
+
|
|
441
|
+
`invitation.resent` and `invitation.revoked` also carry `by`, the actor's user id, when the call to `resend` or `revoke` named one (the key is absent otherwise).
|
|
442
|
+
|
|
443
|
+
```ts
|
|
444
|
+
invitations: {
|
|
445
|
+
// …
|
|
446
|
+
events: (event) => {
|
|
447
|
+
// { id, type, occurredAt, invitationId, scope, invitedBy }
|
|
448
|
+
if (event.type === 'invitation.accepted') metrics.count('invitation.accepted', { scope: event.scope });
|
|
449
|
+
},
|
|
450
|
+
},
|
|
451
|
+
```
|
|
452
|
+
|
|
453
|
+
An event carries the invitation's id and scope and who sent it (`invitedBy`, `null` for an invitation the system issued),
|
|
454
|
+
**never the address, the name or the code**: read the rest from where it is
|
|
455
|
+
kept. See [Invitations](invitations.md).
|
|
456
|
+
|
|
457
|
+
## See also
|
|
458
|
+
|
|
459
|
+
- [E-mail verification, password reset and changing an e-mail](email-flows.md) — the flows that send `user.emailVerified`, `user.passwordReset` and, with `changeEmail`, `user.emailChanged`
|
|
460
|
+
- [The second factor](second-factor.md) — `activate` and `disable`, which send `user.secondFactorEnabled` and `user.secondFactorDisabled` — sent too by the first proof of an e-mail by a [code](sign-in-code.md) or a [link](magic-link.md#an-account-someone-else-registered); [recovery codes](second-factor.md#recovery-codes), which send `user.recoveryCodesRegenerated` and `user.recoveryCodeUsed`
|
|
461
|
+
- [Devices](devices.md) — the sign-ins that send `user.newDeviceSignedIn`, the device token and the cookie
|
|
462
|
+
- [Account avatars](avatars.md) — what to do with `formerAvatarId`, step by step
|
|
463
|
+
- [Social sign-in](social.md) — what links and unlinks an account
|
|
464
|
+
- [Invitations](invitations.md) — the `invitation.*` events, on their own listener
|
|
465
|
+
- [Users](users.md) — `create`, `signUp`, `update`, `delete`
|
|
466
|
+
- [Passwords](passwords.md) — `changePassword` and `setPassword`, which send `user.passwordChanged`
|
|
467
|
+
- [Troubleshooting](../troubleshooting.md) — `JANUS_EVENT_FAILED`
|