@softistx/janus 0.0.0-stage → 0.73.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +2928 -2
- package/dist/auth/api-keys/authenticate-key.d.ts +21 -0
- package/dist/auth/api-keys/authenticate-key.d.ts.map +1 -0
- package/dist/auth/api-keys/bound.d.ts +11 -0
- package/dist/auth/api-keys/bound.d.ts.map +1 -0
- package/dist/auth/api-keys/count.d.ts +8 -0
- package/dist/auth/api-keys/count.d.ts.map +1 -0
- package/dist/auth/api-keys/create/checks.d.ts +42 -0
- package/dist/auth/api-keys/create/checks.d.ts.map +1 -0
- package/dist/auth/api-keys/create/index.d.ts +10 -0
- package/dist/auth/api-keys/create/index.d.ts.map +1 -0
- package/dist/auth/api-keys/events.d.ts +22 -0
- package/dist/auth/api-keys/events.d.ts.map +1 -0
- package/dist/auth/api-keys/expiry.d.ts +11 -0
- package/dist/auth/api-keys/expiry.d.ts.map +1 -0
- package/dist/auth/api-keys/flows.d.ts +13 -0
- package/dist/auth/api-keys/flows.d.ts.map +1 -0
- package/dist/auth/api-keys/index.d.ts +11 -0
- package/dist/auth/api-keys/index.d.ts.map +1 -0
- package/dist/auth/api-keys/read.d.ts +10 -0
- package/dist/auth/api-keys/read.d.ts.map +1 -0
- package/dist/auth/api-keys/shape.d.ts +24 -0
- package/dist/auth/api-keys/shape.d.ts.map +1 -0
- package/dist/auth/api-keys/to-api-key.d.ts +8 -0
- package/dist/auth/api-keys/to-api-key.d.ts.map +1 -0
- package/dist/auth/api-keys/token.d.ts +23 -0
- package/dist/auth/api-keys/token.d.ts.map +1 -0
- package/dist/auth/api-keys/user-bound.d.ts +10 -0
- package/dist/auth/api-keys/user-bound.d.ts.map +1 -0
- package/dist/auth/at.d.ts +9 -0
- package/dist/auth/at.d.ts.map +1 -0
- package/dist/auth/avatar/any-type.d.ts +13 -0
- package/dist/auth/avatar/any-type.d.ts.map +1 -0
- package/dist/auth/avatar/flows.d.ts +7 -0
- package/dist/auth/avatar/flows.d.ts.map +1 -0
- package/dist/auth/avatar/id.d.ts +10 -0
- package/dist/auth/avatar/id.d.ts.map +1 -0
- package/dist/auth/avatar/index.d.ts +7 -0
- package/dist/auth/avatar/index.d.ts.map +1 -0
- package/dist/auth/avatar/remove.d.ts +10 -0
- package/dist/auth/avatar/remove.d.ts.map +1 -0
- package/dist/auth/avatar/set.d.ts +12 -0
- package/dist/auth/avatar/set.d.ts.map +1 -0
- package/dist/auth/concurrency-limit.d.ts +13 -0
- package/dist/auth/concurrency-limit.d.ts.map +1 -0
- package/dist/auth/config/api-keys-config.d.ts +33 -0
- package/dist/auth/config/api-keys-config.d.ts.map +1 -0
- package/dist/auth/config/hasher.d.ts +22 -0
- package/dist/auth/config/hasher.d.ts.map +1 -0
- package/dist/auth/config/index.d.ts +24 -0
- package/dist/auth/config/index.d.ts.map +1 -0
- package/dist/auth/config/invitations-config.d.ts +74 -0
- package/dist/auth/config/invitations-config.d.ts.map +1 -0
- package/dist/auth/config/janus-config.d.ts +233 -0
- package/dist/auth/config/janus-config.d.ts.map +1 -0
- package/dist/auth/config/magic-link-config.d.ts +6 -0
- package/dist/auth/config/magic-link-config.d.ts.map +1 -0
- package/dist/auth/config/names.d.ts +9 -0
- package/dist/auth/config/names.d.ts.map +1 -0
- package/dist/auth/config/normalize.d.ts +26 -0
- package/dist/auth/config/normalize.d.ts.map +1 -0
- package/dist/auth/config/passkeys-config.d.ts +49 -0
- package/dist/auth/config/passkeys-config.d.ts.map +1 -0
- package/dist/auth/config/password-config.d.ts +22 -0
- package/dist/auth/config/password-config.d.ts.map +1 -0
- package/dist/auth/config/reserved.d.ts +14 -0
- package/dist/auth/config/reserved.d.ts.map +1 -0
- package/dist/auth/config/resolve-api-keys.d.ts +5 -0
- package/dist/auth/config/resolve-api-keys.d.ts.map +1 -0
- package/dist/auth/config/resolve-config.d.ts +9 -0
- package/dist/auth/config/resolve-config.d.ts.map +1 -0
- package/dist/auth/config/resolve-cookie.d.ts +5 -0
- package/dist/auth/config/resolve-cookie.d.ts.map +1 -0
- package/dist/auth/config/resolve-devices.d.ts +5 -0
- package/dist/auth/config/resolve-devices.d.ts.map +1 -0
- package/dist/auth/config/resolve-invitation-types.d.ts +5 -0
- package/dist/auth/config/resolve-invitation-types.d.ts.map +1 -0
- package/dist/auth/config/resolve-invitations.d.ts +5 -0
- package/dist/auth/config/resolve-invitations.d.ts.map +1 -0
- package/dist/auth/config/resolve-magic-link.d.ts +4 -0
- package/dist/auth/config/resolve-magic-link.d.ts.map +1 -0
- package/dist/auth/config/resolve-passkeys.d.ts +5 -0
- package/dist/auth/config/resolve-passkeys.d.ts.map +1 -0
- package/dist/auth/config/resolve-second-factor.d.ts +5 -0
- package/dist/auth/config/resolve-second-factor.d.ts.map +1 -0
- package/dist/auth/config/resolve-social.d.ts +17 -0
- package/dist/auth/config/resolve-social.d.ts.map +1 -0
- package/dist/auth/config/resolve-throttle.d.ts +37 -0
- package/dist/auth/config/resolve-throttle.d.ts.map +1 -0
- package/dist/auth/config/resolve-type.d.ts +6 -0
- package/dist/auth/config/resolve-type.d.ts.map +1 -0
- package/dist/auth/config/resolved-config.d.ts +126 -0
- package/dist/auth/config/resolved-config.d.ts.map +1 -0
- package/dist/auth/config/social-config.d.ts +154 -0
- package/dist/auth/config/social-config.d.ts.map +1 -0
- package/dist/auth/config/user-type.d.ts +79 -0
- package/dist/auth/config/user-type.d.ts.map +1 -0
- package/dist/auth/config/warn-throttle-window.d.ts +14 -0
- package/dist/auth/config/warn-throttle-window.d.ts.map +1 -0
- package/dist/auth/context/create-context.d.ts +31 -0
- package/dist/auth/context/create-context.d.ts.map +1 -0
- package/dist/auth/context/index.d.ts +17 -0
- package/dist/auth/context/index.d.ts.map +1 -0
- package/dist/auth/context/logins.d.ts +28 -0
- package/dist/auth/context/logins.d.ts.map +1 -0
- package/dist/auth/context/password.d.ts +34 -0
- package/dist/auth/context/password.d.ts.map +1 -0
- package/dist/auth/context/records.d.ts +27 -0
- package/dist/auth/context/records.d.ts.map +1 -0
- package/dist/auth/context/user.d.ts +21 -0
- package/dist/auth/context/user.d.ts.map +1 -0
- package/dist/auth/context/validate-fields.d.ts +12 -0
- package/dist/auth/context/validate-fields.d.ts.map +1 -0
- package/dist/auth/counter-key.d.ts +20 -0
- package/dist/auth/counter-key.d.ts.map +1 -0
- package/dist/auth/derived-keys.d.ts +9 -0
- package/dist/auth/derived-keys.d.ts.map +1 -0
- package/dist/auth/devices/cookie.d.ts +56 -0
- package/dist/auth/devices/cookie.d.ts.map +1 -0
- package/dist/auth/devices/hint.d.ts +42 -0
- package/dist/auth/devices/hint.d.ts.map +1 -0
- package/dist/auth/devices/index.d.ts +11 -0
- package/dist/auth/devices/index.d.ts.map +1 -0
- package/dist/auth/devices/report.d.ts +11 -0
- package/dist/auth/devices/report.d.ts.map +1 -0
- package/dist/auth/devices/token.d.ts +13 -0
- package/dist/auth/devices/token.d.ts.map +1 -0
- package/dist/auth/email-flows/any-type-change-email.d.ts +18 -0
- package/dist/auth/email-flows/any-type-change-email.d.ts.map +1 -0
- package/dist/auth/email-flows/any-type-reset-password.d.ts +19 -0
- package/dist/auth/email-flows/any-type-reset-password.d.ts.map +1 -0
- package/dist/auth/email-flows/any-type-verify-email.d.ts +18 -0
- package/dist/auth/email-flows/any-type-verify-email.d.ts.map +1 -0
- package/dist/auth/email-flows/change-email-token.d.ts +47 -0
- package/dist/auth/email-flows/change-email-token.d.ts.map +1 -0
- package/dist/auth/email-flows/change-email.d.ts +17 -0
- package/dist/auth/email-flows/change-email.d.ts.map +1 -0
- package/dist/auth/email-flows/confirm-reset.d.ts +16 -0
- package/dist/auth/email-flows/confirm-reset.d.ts.map +1 -0
- package/dist/auth/email-flows/email-token.d.ts +30 -0
- package/dist/auth/email-flows/email-token.d.ts.map +1 -0
- package/dist/auth/email-flows/flows.d.ts +13 -0
- package/dist/auth/email-flows/flows.d.ts.map +1 -0
- package/dist/auth/email-flows/index.d.ts +10 -0
- package/dist/auth/email-flows/index.d.ts.map +1 -0
- package/dist/auth/email-flows/owner-of.d.ts +17 -0
- package/dist/auth/email-flows/owner-of.d.ts.map +1 -0
- package/dist/auth/email-flows/prove-first.d.ts +45 -0
- package/dist/auth/email-flows/prove-first.d.ts.map +1 -0
- package/dist/auth/email-flows/reset-password.d.ts +17 -0
- package/dist/auth/email-flows/reset-password.d.ts.map +1 -0
- package/dist/auth/email-flows/set-email-verified.d.ts +19 -0
- package/dist/auth/email-flows/set-email-verified.d.ts.map +1 -0
- package/dist/auth/email-flows/verify-email.d.ts +25 -0
- package/dist/auth/email-flows/verify-email.d.ts.map +1 -0
- package/dist/auth/email-sign-in.d.ts +51 -0
- package/dist/auth/email-sign-in.d.ts.map +1 -0
- package/dist/auth/events.d.ts +166 -0
- package/dist/auth/events.d.ts.map +1 -0
- package/dist/auth/first-proof.d.ts +43 -0
- package/dist/auth/first-proof.d.ts.map +1 -0
- package/dist/auth/hashers.d.ts +52 -0
- package/dist/auth/hashers.d.ts.map +1 -0
- package/dist/auth/index.d.ts +22 -0
- package/dist/auth/index.d.ts.map +1 -0
- package/dist/auth/invitations/accept.d.ts +10 -0
- package/dist/auth/invitations/accept.d.ts.map +1 -0
- package/dist/auth/invitations/change-pending.d.ts +17 -0
- package/dist/auth/invitations/change-pending.d.ts.map +1 -0
- package/dist/auth/invitations/claim.d.ts +31 -0
- package/dist/auth/invitations/claim.d.ts.map +1 -0
- package/dist/auth/invitations/events.d.ts +46 -0
- package/dist/auth/invitations/events.d.ts.map +1 -0
- package/dist/auth/invitations/find-invitee.d.ts +20 -0
- package/dist/auth/invitations/find-invitee.d.ts.map +1 -0
- package/dist/auth/invitations/find-pending.d.ts +5 -0
- package/dist/auth/invitations/find-pending.d.ts.map +1 -0
- package/dist/auth/invitations/flows.d.ts +7 -0
- package/dist/auth/invitations/flows.d.ts.map +1 -0
- package/dist/auth/invitations/history-input.d.ts +29 -0
- package/dist/auth/invitations/history-input.d.ts.map +1 -0
- package/dist/auth/invitations/history.d.ts +10 -0
- package/dist/auth/invitations/history.d.ts.map +1 -0
- package/dist/auth/invitations/index.d.ts +11 -0
- package/dist/auth/invitations/index.d.ts.map +1 -0
- package/dist/auth/invitations/input.d.ts +30 -0
- package/dist/auth/invitations/input.d.ts.map +1 -0
- package/dist/auth/invitations/invited-type.d.ts +22 -0
- package/dist/auth/invitations/invited-type.d.ts.map +1 -0
- package/dist/auth/invitations/invitee.d.ts +11 -0
- package/dist/auth/invitations/invitee.d.ts.map +1 -0
- package/dist/auth/invitations/issue.d.ts +9 -0
- package/dist/auth/invitations/issue.d.ts.map +1 -0
- package/dist/auth/invitations/limit.d.ts +7 -0
- package/dist/auth/invitations/limit.d.ts.map +1 -0
- package/dist/auth/invitations/password-invitee.d.ts +18 -0
- package/dist/auth/invitations/password-invitee.d.ts.map +1 -0
- package/dist/auth/invitations/passwordless-invitee.d.ts +13 -0
- package/dist/auth/invitations/passwordless-invitee.d.ts.map +1 -0
- package/dist/auth/invitations/preview.d.ts +8 -0
- package/dist/auth/invitations/preview.d.ts.map +1 -0
- package/dist/auth/invitations/read.d.ts +10 -0
- package/dist/auth/invitations/read.d.ts.map +1 -0
- package/dist/auth/invitations/resend.d.ts +12 -0
- package/dist/auth/invitations/resend.d.ts.map +1 -0
- package/dist/auth/invitations/to-invitation.d.ts +11 -0
- package/dist/auth/invitations/to-invitation.d.ts.map +1 -0
- package/dist/auth/invitations/write.d.ts +17 -0
- package/dist/auth/invitations/write.d.ts.map +1 -0
- package/dist/auth/issuers/cache.d.ts +21 -0
- package/dist/auth/issuers/cache.d.ts.map +1 -0
- package/dist/auth/issuers/create.d.ts +18 -0
- package/dist/auth/issuers/create.d.ts.map +1 -0
- package/dist/auth/issuers/index.d.ts +3 -0
- package/dist/auth/issuers/index.d.ts.map +1 -0
- package/dist/auth/issuers/types.d.ts +45 -0
- package/dist/auth/issuers/types.d.ts.map +1 -0
- package/dist/auth/janus.d.ts +39 -0
- package/dist/auth/janus.d.ts.map +1 -0
- package/dist/auth/magic-link.d.ts +25 -0
- package/dist/auth/magic-link.d.ts.map +1 -0
- package/dist/auth/mail-requests.d.ts +55 -0
- package/dist/auth/mail-requests.d.ts.map +1 -0
- package/dist/auth/one-time/codes.d.ts +46 -0
- package/dist/auth/one-time/codes.d.ts.map +1 -0
- package/dist/auth/one-time/index.d.ts +15 -0
- package/dist/auth/one-time/index.d.ts.map +1 -0
- package/dist/auth/one-time/issue.d.ts +45 -0
- package/dist/auth/one-time/issue.d.ts.map +1 -0
- package/dist/auth/one-time/refusals.d.ts +26 -0
- package/dist/auth/one-time/refusals.d.ts.map +1 -0
- package/dist/auth/one-time/spend.d.ts +24 -0
- package/dist/auth/one-time/spend.d.ts.map +1 -0
- package/dist/auth/one-time/window.d.ts +50 -0
- package/dist/auth/one-time/window.d.ts.map +1 -0
- package/dist/auth/outage.d.ts +66 -0
- package/dist/auth/outage.d.ts.map +1 -0
- package/dist/auth/parse-sealing-keys.d.ts +26 -0
- package/dist/auth/parse-sealing-keys.d.ts.map +1 -0
- package/dist/auth/passkeys/assert.d.ts +51 -0
- package/dist/auth/passkeys/assert.d.ts.map +1 -0
- package/dist/auth/passkeys/assertion-options.d.ts +9 -0
- package/dist/auth/passkeys/assertion-options.d.ts.map +1 -0
- package/dist/auth/passkeys/challenge.d.ts +19 -0
- package/dist/auth/passkeys/challenge.d.ts.map +1 -0
- package/dist/auth/passkeys/commit.d.ts +33 -0
- package/dist/auth/passkeys/commit.d.ts.map +1 -0
- package/dist/auth/passkeys/flows.d.ts +13 -0
- package/dist/auth/passkeys/flows.d.ts.map +1 -0
- package/dist/auth/passkeys/index.d.ts +12 -0
- package/dist/auth/passkeys/index.d.ts.map +1 -0
- package/dist/auth/passkeys/manage.d.ts +11 -0
- package/dist/auth/passkeys/manage.d.ts.map +1 -0
- package/dist/auth/passkeys/name.d.ts +4 -0
- package/dist/auth/passkeys/name.d.ts.map +1 -0
- package/dist/auth/passkeys/register.d.ts +20 -0
- package/dist/auth/passkeys/register.d.ts.map +1 -0
- package/dist/auth/passkeys/registration-options.d.ts +22 -0
- package/dist/auth/passkeys/registration-options.d.ts.map +1 -0
- package/dist/auth/passkeys/remove-all.d.ts +26 -0
- package/dist/auth/passkeys/remove-all.d.ts.map +1 -0
- package/dist/auth/passkeys/sign-in-options.d.ts +12 -0
- package/dist/auth/passkeys/sign-in-options.d.ts.map +1 -0
- package/dist/auth/passkeys/sign-in.d.ts +21 -0
- package/dist/auth/passkeys/sign-in.d.ts.map +1 -0
- package/dist/auth/passkeys/verifier.d.ts +113 -0
- package/dist/auth/passkeys/verifier.d.ts.map +1 -0
- package/dist/auth/passkeys/view.d.ts +5 -0
- package/dist/auth/passkeys/view.d.ts.map +1 -0
- package/dist/auth/passkeys/wiring.d.ts +24 -0
- package/dist/auth/passkeys/wiring.d.ts.map +1 -0
- package/dist/auth/password-written.d.ts +55 -0
- package/dist/auth/password-written.d.ts.map +1 -0
- package/dist/auth/port/assert-api-keys.d.ts +21 -0
- package/dist/auth/port/assert-api-keys.d.ts.map +1 -0
- package/dist/auth/port/assert-invitations.d.ts +15 -0
- package/dist/auth/port/assert-invitations.d.ts.map +1 -0
- package/dist/auth/port/assert-stores.d.ts +16 -0
- package/dist/auth/port/assert-stores.d.ts.map +1 -0
- package/dist/auth/port/memory/api-keys/capabilities.d.ts +8 -0
- package/dist/auth/port/memory/api-keys/capabilities.d.ts.map +1 -0
- package/dist/auth/port/memory/api-keys/index.d.ts +13 -0
- package/dist/auth/port/memory/api-keys/index.d.ts.map +1 -0
- package/dist/auth/port/memory/api-keys/pages.d.ts +7 -0
- package/dist/auth/port/memory/api-keys/pages.d.ts.map +1 -0
- package/dist/auth/port/memory/copy.d.ts +6 -0
- package/dist/auth/port/memory/copy.d.ts.map +1 -0
- package/dist/auth/port/memory/index.d.ts +10 -0
- package/dist/auth/port/memory/index.d.ts.map +1 -0
- package/dist/auth/port/memory/invitations-pending.d.ts +6 -0
- package/dist/auth/port/memory/invitations-pending.d.ts.map +1 -0
- package/dist/auth/port/memory/invitations.d.ts +12 -0
- package/dist/auth/port/memory/invitations.d.ts.map +1 -0
- package/dist/auth/port/memory/passkeys.d.ts +9 -0
- package/dist/auth/port/memory/passkeys.d.ts.map +1 -0
- package/dist/auth/port/memory/sessions.d.ts +4 -0
- package/dist/auth/port/memory/sessions.d.ts.map +1 -0
- package/dist/auth/port/memory/social-links.d.ts +10 -0
- package/dist/auth/port/memory/social-links.d.ts.map +1 -0
- package/dist/auth/port/memory/stores.d.ts +26 -0
- package/dist/auth/port/memory/stores.d.ts.map +1 -0
- package/dist/auth/port/memory/tokens.d.ts +4 -0
- package/dist/auth/port/memory/tokens.d.ts.map +1 -0
- package/dist/auth/port/memory/user-index.d.ts +20 -0
- package/dist/auth/port/memory/user-index.d.ts.map +1 -0
- package/dist/auth/port/memory/user-update.d.ts +10 -0
- package/dist/auth/port/memory/user-update.d.ts.map +1 -0
- package/dist/auth/port/memory/users.d.ts +4 -0
- package/dist/auth/port/memory/users.d.ts.map +1 -0
- package/dist/auth/port/types/api-keys.d.ts +199 -0
- package/dist/auth/port/types/api-keys.d.ts.map +1 -0
- package/dist/auth/port/types/credentials.d.ts +46 -0
- package/dist/auth/port/types/credentials.d.ts.map +1 -0
- package/dist/auth/port/types/index.d.ts +75 -0
- package/dist/auth/port/types/index.d.ts.map +1 -0
- package/dist/auth/port/types/invitations/index.d.ts +15 -0
- package/dist/auth/port/types/invitations/index.d.ts.map +1 -0
- package/dist/auth/port/types/invitations/page.d.ts +52 -0
- package/dist/auth/port/types/invitations/page.d.ts.map +1 -0
- package/dist/auth/port/types/invitations/records.d.ts +101 -0
- package/dist/auth/port/types/invitations/records.d.ts.map +1 -0
- package/dist/auth/port/types/invitations/store.d.ts +82 -0
- package/dist/auth/port/types/invitations/store.d.ts.map +1 -0
- package/dist/auth/port/types/json.d.ts +27 -0
- package/dist/auth/port/types/json.d.ts.map +1 -0
- package/dist/auth/port/types/passkeys.d.ts +94 -0
- package/dist/auth/port/types/passkeys.d.ts.map +1 -0
- package/dist/auth/port/types/sessions.d.ts +142 -0
- package/dist/auth/port/types/sessions.d.ts.map +1 -0
- package/dist/auth/port/types/social-links.d.ts +64 -0
- package/dist/auth/port/types/social-links.d.ts.map +1 -0
- package/dist/auth/port/types/stores.d.ts +48 -0
- package/dist/auth/port/types/stores.d.ts.map +1 -0
- package/dist/auth/port/types/tokens.d.ts +168 -0
- package/dist/auth/port/types/tokens.d.ts.map +1 -0
- package/dist/auth/port/types/users.d.ts +260 -0
- package/dist/auth/port/types/users.d.ts.map +1 -0
- package/dist/auth/prepared.d.ts +21 -0
- package/dist/auth/prepared.d.ts.map +1 -0
- package/dist/auth/proven-sign-in.d.ts +22 -0
- package/dist/auth/proven-sign-in.d.ts.map +1 -0
- package/dist/auth/sealer-for.d.ts +44 -0
- package/dist/auth/sealer-for.d.ts.map +1 -0
- package/dist/auth/sealing.d.ts +36 -0
- package/dist/auth/sealing.d.ts.map +1 -0
- package/dist/auth/second-factor/activate.d.ts +9 -0
- package/dist/auth/second-factor/activate.d.ts.map +1 -0
- package/dist/auth/second-factor/app-code-attempts.d.ts +47 -0
- package/dist/auth/second-factor/app-code-attempts.d.ts.map +1 -0
- package/dist/auth/second-factor/challenge.d.ts +15 -0
- package/dist/auth/second-factor/challenge.d.ts.map +1 -0
- package/dist/auth/second-factor/codes-left.d.ts +14 -0
- package/dist/auth/second-factor/codes-left.d.ts.map +1 -0
- package/dist/auth/second-factor/disable.d.ts +10 -0
- package/dist/auth/second-factor/disable.d.ts.map +1 -0
- package/dist/auth/second-factor/enroll.d.ts +6 -0
- package/dist/auth/second-factor/enroll.d.ts.map +1 -0
- package/dist/auth/second-factor/factor.d.ts +33 -0
- package/dist/auth/second-factor/factor.d.ts.map +1 -0
- package/dist/auth/second-factor/flows.d.ts +36 -0
- package/dist/auth/second-factor/flows.d.ts.map +1 -0
- package/dist/auth/second-factor/lifecycle.d.ts +14 -0
- package/dist/auth/second-factor/lifecycle.d.ts.map +1 -0
- package/dist/auth/second-factor/passkey-confirm.d.ts +21 -0
- package/dist/auth/second-factor/passkey-confirm.d.ts.map +1 -0
- package/dist/auth/second-factor/recovery-codes.d.ts +36 -0
- package/dist/auth/second-factor/recovery-codes.d.ts.map +1 -0
- package/dist/auth/second-factor/recovery.d.ts +20 -0
- package/dist/auth/second-factor/recovery.d.ts.map +1 -0
- package/dist/auth/second-factor/redeem.d.ts +42 -0
- package/dist/auth/second-factor/redeem.d.ts.map +1 -0
- package/dist/auth/second-factor/refusal.d.ts +6 -0
- package/dist/auth/second-factor/refusal.d.ts.map +1 -0
- package/dist/auth/second-factor/regenerate.d.ts +12 -0
- package/dist/auth/second-factor/regenerate.d.ts.map +1 -0
- package/dist/auth/second-factor/reseal.d.ts +17 -0
- package/dist/auth/second-factor/reseal.d.ts.map +1 -0
- package/dist/auth/second-factor/spend-recovery-code.d.ts +15 -0
- package/dist/auth/second-factor/spend-recovery-code.d.ts.map +1 -0
- package/dist/auth/secrets.d.ts +17 -0
- package/dist/auth/secrets.d.ts.map +1 -0
- package/dist/auth/sessions/amr.d.ts +36 -0
- package/dist/auth/sessions/amr.d.ts.map +1 -0
- package/dist/auth/sessions/authenticate.d.ts +12 -0
- package/dist/auth/sessions/authenticate.d.ts.map +1 -0
- package/dist/auth/sessions/collect-expired.d.ts +15 -0
- package/dist/auth/sessions/collect-expired.d.ts.map +1 -0
- package/dist/auth/sessions/cookie.d.ts +9 -0
- package/dist/auth/sessions/cookie.d.ts.map +1 -0
- package/dist/auth/sessions/fresh.d.ts +35 -0
- package/dist/auth/sessions/fresh.d.ts.map +1 -0
- package/dist/auth/sessions/index.d.ts +12 -0
- package/dist/auth/sessions/index.d.ts.map +1 -0
- package/dist/auth/sessions/open-session.d.ts +22 -0
- package/dist/auth/sessions/open-session.d.ts.map +1 -0
- package/dist/auth/sessions/presented-token.d.ts +25 -0
- package/dist/auth/sessions/presented-token.d.ts.map +1 -0
- package/dist/auth/sessions/shared-api.d.ts +17 -0
- package/dist/auth/sessions/shared-api.d.ts.map +1 -0
- package/dist/auth/sessions/standing.d.ts +32 -0
- package/dist/auth/sessions/standing.d.ts.map +1 -0
- package/dist/auth/shared-api.d.ts +139 -0
- package/dist/auth/shared-api.d.ts.map +1 -0
- package/dist/auth/sign-in-attempts.d.ts +45 -0
- package/dist/auth/sign-in-attempts.d.ts.map +1 -0
- package/dist/auth/sign-in-code.d.ts +26 -0
- package/dist/auth/sign-in-code.d.ts.map +1 -0
- package/dist/auth/social/attach.d.ts +31 -0
- package/dist/auth/social/attach.d.ts.map +1 -0
- package/dist/auth/social/begin.d.ts +30 -0
- package/dist/auth/social/begin.d.ts.map +1 -0
- package/dist/auth/social/complete-link.d.ts +17 -0
- package/dist/auth/social/complete-link.d.ts.map +1 -0
- package/dist/auth/social/complete.d.ts +54 -0
- package/dist/auth/social/complete.d.ts.map +1 -0
- package/dist/auth/social/cookie.d.ts +16 -0
- package/dist/auth/social/cookie.d.ts.map +1 -0
- package/dist/auth/social/find-provider.d.ts +23 -0
- package/dist/auth/social/find-provider.d.ts.map +1 -0
- package/dist/auth/social/finish.d.ts +60 -0
- package/dist/auth/social/finish.d.ts.map +1 -0
- package/dist/auth/social/flow-cookie-value.d.ts +26 -0
- package/dist/auth/social/flow-cookie-value.d.ts.map +1 -0
- package/dist/auth/social/flow-secret.d.ts +40 -0
- package/dist/auth/social/flow-secret.d.ts.map +1 -0
- package/dist/auth/social/index.d.ts +19 -0
- package/dist/auth/social/index.d.ts.map +1 -0
- package/dist/auth/social/link-holder.d.ts +33 -0
- package/dist/auth/social/link-holder.d.ts.map +1 -0
- package/dist/auth/social/provider-call.d.ts +31 -0
- package/dist/auth/social/provider-call.d.ts.map +1 -0
- package/dist/auth/social/redeem.d.ts +45 -0
- package/dist/auth/social/redeem.d.ts.map +1 -0
- package/dist/auth/social/return-to.d.ts +18 -0
- package/dist/auth/social/return-to.d.ts.map +1 -0
- package/dist/auth/social/sign-in.d.ts +41 -0
- package/dist/auth/social/sign-in.d.ts.map +1 -0
- package/dist/auth/social/sign-up.d.ts +37 -0
- package/dist/auth/social/sign-up.d.ts.map +1 -0
- package/dist/auth/social/start.d.ts +21 -0
- package/dist/auth/social/start.d.ts.map +1 -0
- package/dist/auth/social/step-up-proof.d.ts +26 -0
- package/dist/auth/social/step-up-proof.d.ts.map +1 -0
- package/dist/auth/social/step-up-request.d.ts +28 -0
- package/dist/auth/social/step-up-request.d.ts.map +1 -0
- package/dist/auth/social/step-up.d.ts +19 -0
- package/dist/auth/social/step-up.d.ts.map +1 -0
- package/dist/auth/social/types-of.d.ts +12 -0
- package/dist/auth/social/types-of.d.ts.map +1 -0
- package/dist/auth/social/unlink.d.ts +16 -0
- package/dist/auth/social/unlink.d.ts.map +1 -0
- package/dist/auth/social/wiring.d.ts +10 -0
- package/dist/auth/social/wiring.d.ts.map +1 -0
- package/dist/auth/standard-schema.d.ts +41 -0
- package/dist/auth/standard-schema.d.ts.map +1 -0
- package/dist/auth/step-up/codes.d.ts +35 -0
- package/dist/auth/step-up/codes.d.ts.map +1 -0
- package/dist/auth/step-up/flows.d.ts +18 -0
- package/dist/auth/step-up/flows.d.ts.map +1 -0
- package/dist/auth/step-up/open.d.ts +23 -0
- package/dist/auth/step-up/open.d.ts.map +1 -0
- package/dist/auth/step-up/passkey.d.ts +31 -0
- package/dist/auth/step-up/passkey.d.ts.map +1 -0
- package/dist/auth/step-up/request.d.ts +15 -0
- package/dist/auth/step-up/request.d.ts.map +1 -0
- package/dist/auth/step-up/spend.d.ts +4 -0
- package/dist/auth/step-up/spend.d.ts.map +1 -0
- package/dist/auth/totp.d.ts +36 -0
- package/dist/auth/totp.d.ts.map +1 -0
- package/dist/auth/types/api-keys-of.d.ts +19 -0
- package/dist/auth/types/api-keys-of.d.ts.map +1 -0
- package/dist/auth/types/api-keys.d.ts +164 -0
- package/dist/auth/types/api-keys.d.ts.map +1 -0
- package/dist/auth/types/avatar.d.ts +72 -0
- package/dist/auth/types/avatar.d.ts.map +1 -0
- package/dist/auth/types/change-email.d.ts +82 -0
- package/dist/auth/types/change-email.d.ts.map +1 -0
- package/dist/auth/types/checks.d.ts +147 -0
- package/dist/auth/types/checks.d.ts.map +1 -0
- package/dist/auth/types/email-flows.d.ts +117 -0
- package/dist/auth/types/email-flows.d.ts.map +1 -0
- package/dist/auth/types/find-by-email.d.ts +31 -0
- package/dist/auth/types/find-by-email.d.ts.map +1 -0
- package/dist/auth/types/find-or-create.d.ts +59 -0
- package/dist/auth/types/find-or-create.d.ts.map +1 -0
- package/dist/auth/types/index.d.ts +38 -0
- package/dist/auth/types/index.d.ts.map +1 -0
- package/dist/auth/types/inference.d.ts +62 -0
- package/dist/auth/types/inference.d.ts.map +1 -0
- package/dist/auth/types/invitations/api.d.ts +203 -0
- package/dist/auth/types/invitations/api.d.ts.map +1 -0
- package/dist/auth/types/invitations/history.d.ts +87 -0
- package/dist/auth/types/invitations/history.d.ts.map +1 -0
- package/dist/auth/types/invitations/index.d.ts +10 -0
- package/dist/auth/types/invitations/index.d.ts.map +1 -0
- package/dist/auth/types/invitations/invitation.d.ts +76 -0
- package/dist/auth/types/invitations/invitation.d.ts.map +1 -0
- package/dist/auth/types/invitations/issue-type.d.ts +15 -0
- package/dist/auth/types/invitations/issue-type.d.ts.map +1 -0
- package/dist/auth/types/invitations-of.d.ts +26 -0
- package/dist/auth/types/invitations-of.d.ts.map +1 -0
- package/dist/auth/types/janus.d.ts +51 -0
- package/dist/auth/types/janus.d.ts.map +1 -0
- package/dist/auth/types/magic-link.d.ts +69 -0
- package/dist/auth/types/magic-link.d.ts.map +1 -0
- package/dist/auth/types/passkeys.d.ts +183 -0
- package/dist/auth/types/passkeys.d.ts.map +1 -0
- package/dist/auth/types/password.d.ts +113 -0
- package/dist/auth/types/password.d.ts.map +1 -0
- package/dist/auth/types/prepared.d.ts +68 -0
- package/dist/auth/types/prepared.d.ts.map +1 -0
- package/dist/auth/types/proven-sign-in.d.ts +43 -0
- package/dist/auth/types/proven-sign-in.d.ts.map +1 -0
- package/dist/auth/types/reset-password.d.ts +46 -0
- package/dist/auth/types/reset-password.d.ts.map +1 -0
- package/dist/auth/types/second-factor.d.ts +164 -0
- package/dist/auth/types/second-factor.d.ts.map +1 -0
- package/dist/auth/types/session.d.ts +68 -0
- package/dist/auth/types/session.d.ts.map +1 -0
- package/dist/auth/types/shared-api.d.ts +96 -0
- package/dist/auth/types/shared-api.d.ts.map +1 -0
- package/dist/auth/types/sign-in.d.ts +102 -0
- package/dist/auth/types/sign-in.d.ts.map +1 -0
- package/dist/auth/types/social-flow.d.ts +28 -0
- package/dist/auth/types/social-flow.d.ts.map +1 -0
- package/dist/auth/types/social-step-up.d.ts +38 -0
- package/dist/auth/types/social-step-up.d.ts.map +1 -0
- package/dist/auth/types/social.d.ts +193 -0
- package/dist/auth/types/social.d.ts.map +1 -0
- package/dist/auth/types/step-up.d.ts +133 -0
- package/dist/auth/types/step-up.d.ts.map +1 -0
- package/dist/auth/types/type-api.d.ts +29 -0
- package/dist/auth/types/type-api.d.ts.map +1 -0
- package/dist/auth/types/user-type.d.ts +106 -0
- package/dist/auth/types/user-type.d.ts.map +1 -0
- package/dist/auth/types/user.d.ts +62 -0
- package/dist/auth/types/user.d.ts.map +1 -0
- package/dist/auth/types/verify-email.d.ts +190 -0
- package/dist/auth/types/verify-email.d.ts.map +1 -0
- package/dist/auth/users/any-type-api.d.ts +6 -0
- package/dist/auth/users/any-type-api.d.ts.map +1 -0
- package/dist/auth/users/by-login.d.ts +10 -0
- package/dist/auth/users/by-login.d.ts.map +1 -0
- package/dist/auth/users/change-password.d.ts +26 -0
- package/dist/auth/users/change-password.d.ts.map +1 -0
- package/dist/auth/users/delete.d.ts +10 -0
- package/dist/auth/users/delete.d.ts.map +1 -0
- package/dist/auth/users/email-move-guard.d.ts +20 -0
- package/dist/auth/users/email-move-guard.d.ts.map +1 -0
- package/dist/auth/users/email-prefix.d.ts +23 -0
- package/dist/auth/users/email-prefix.d.ts.map +1 -0
- package/dist/auth/users/fields-patch.d.ts +21 -0
- package/dist/auth/users/fields-patch.d.ts.map +1 -0
- package/dist/auth/users/find-by-email.d.ts +11 -0
- package/dist/auth/users/find-by-email.d.ts.map +1 -0
- package/dist/auth/users/find-many.d.ts +29 -0
- package/dist/auth/users/find-many.d.ts.map +1 -0
- package/dist/auth/users/find-or-create.d.ts +12 -0
- package/dist/auth/users/find-or-create.d.ts.map +1 -0
- package/dist/auth/users/flow-types.d.ts +15 -0
- package/dist/auth/users/flow-types.d.ts.map +1 -0
- package/dist/auth/users/index.d.ts +9 -0
- package/dist/auth/users/index.d.ts.map +1 -0
- package/dist/auth/users/insert.d.ts +15 -0
- package/dist/auth/users/insert.d.ts.map +1 -0
- package/dist/auth/users/name-prefix.d.ts +19 -0
- package/dist/auth/users/name-prefix.d.ts.map +1 -0
- package/dist/auth/users/password-flows.d.ts +11 -0
- package/dist/auth/users/password-flows.d.ts.map +1 -0
- package/dist/auth/users/record-flows.d.ts +11 -0
- package/dist/auth/users/record-flows.d.ts.map +1 -0
- package/dist/auth/users/sign-in.d.ts +24 -0
- package/dist/auth/users/sign-in.d.ts.map +1 -0
- package/dist/auth/users/sign-up.d.ts +13 -0
- package/dist/auth/users/sign-up.d.ts.map +1 -0
- package/dist/auth/users/type-api.d.ts +10 -0
- package/dist/auth/users/type-api.d.ts.map +1 -0
- package/dist/auth/users/update.d.ts +16 -0
- package/dist/auth/users/update.d.ts.map +1 -0
- package/dist/background/background.d.ts +22 -0
- package/dist/background/background.d.ts.map +1 -0
- package/dist/chunks/index-2ttdcz7n.js +354 -0
- package/dist/chunks/index-2ttdcz7n.js.map +16 -0
- package/dist/chunks/index-5dxynm32.js +85 -0
- package/dist/chunks/index-5dxynm32.js.map +10 -0
- package/dist/chunks/index-ftz0ne6j.js +127 -0
- package/dist/chunks/index-ftz0ne6j.js.map +11 -0
- package/dist/chunks/index-k6y18nx9.js +724 -0
- package/dist/chunks/index-k6y18nx9.js.map +24 -0
- package/dist/chunks/index-n8jxmxeg.js +64 -0
- package/dist/chunks/index-n8jxmxeg.js.map +11 -0
- package/dist/conformance/api-keys/cases/bound.d.ts +3 -0
- package/dist/conformance/api-keys/cases/bound.d.ts.map +1 -0
- package/dist/conformance/api-keys/cases/expiry.d.ts +3 -0
- package/dist/conformance/api-keys/cases/expiry.d.ts.map +1 -0
- package/dist/conformance/api-keys/cases/index.d.ts +4 -0
- package/dist/conformance/api-keys/cases/index.d.ts.map +1 -0
- package/dist/conformance/api-keys/cases/insert.d.ts +3 -0
- package/dist/conformance/api-keys/cases/insert.d.ts.map +1 -0
- package/dist/conformance/api-keys/cases/outage.d.ts +3 -0
- package/dist/conformance/api-keys/cases/outage.d.ts.map +1 -0
- package/dist/conformance/api-keys/cases/revoke.d.ts +3 -0
- package/dist/conformance/api-keys/cases/revoke.d.ts.map +1 -0
- package/dist/conformance/api-keys/cases/touch.d.ts +3 -0
- package/dist/conformance/api-keys/cases/touch.d.ts.map +1 -0
- package/dist/conformance/api-keys/cases/user-bound.d.ts +3 -0
- package/dist/conformance/api-keys/cases/user-bound.d.ts.map +1 -0
- package/dist/conformance/api-keys/describe.d.ts +20 -0
- package/dist/conformance/api-keys/describe.d.ts.map +1 -0
- package/dist/conformance/api-keys/fixtures.d.ts +4 -0
- package/dist/conformance/api-keys/fixtures.d.ts.map +1 -0
- package/dist/conformance/api-keys/index.d.ts +18 -0
- package/dist/conformance/api-keys/index.d.ts.map +1 -0
- package/dist/conformance/api-keys/reference.d.ts +4 -0
- package/dist/conformance/api-keys/reference.d.ts.map +1 -0
- package/dist/conformance/api-keys/types.d.ts +42 -0
- package/dist/conformance/api-keys/types.d.ts.map +1 -0
- package/dist/conformance/assert.d.ts +40 -0
- package/dist/conformance/assert.d.ts.map +1 -0
- package/dist/conformance/cases/outage.d.ts +3 -0
- package/dist/conformance/cases/outage.d.ts.map +1 -0
- package/dist/conformance/cases/outage.passkeys.d.ts +12 -0
- package/dist/conformance/cases/outage.passkeys.d.ts.map +1 -0
- package/dist/conformance/cases/passkeys/deletion.d.ts +4 -0
- package/dist/conformance/cases/passkeys/deletion.d.ts.map +1 -0
- package/dist/conformance/cases/passkeys/index.d.ts +8 -0
- package/dist/conformance/cases/passkeys/index.d.ts.map +1 -0
- package/dist/conformance/cases/passkeys/inserts.d.ts +4 -0
- package/dist/conformance/cases/passkeys/inserts.d.ts.map +1 -0
- package/dist/conformance/cases/passkeys/reads.d.ts +4 -0
- package/dist/conformance/cases/passkeys/reads.d.ts.map +1 -0
- package/dist/conformance/cases/passkeys/uses.d.ts +4 -0
- package/dist/conformance/cases/passkeys/uses.d.ts.map +1 -0
- package/dist/conformance/cases/sessions/deletion.d.ts +4 -0
- package/dist/conformance/cases/sessions/deletion.d.ts.map +1 -0
- package/dist/conformance/cases/sessions/extension.d.ts +4 -0
- package/dist/conformance/cases/sessions/extension.d.ts.map +1 -0
- package/dist/conformance/cases/sessions/index.d.ts +4 -0
- package/dist/conformance/cases/sessions/index.d.ts.map +1 -0
- package/dist/conformance/cases/sessions/inserts.d.ts +4 -0
- package/dist/conformance/cases/sessions/inserts.d.ts.map +1 -0
- package/dist/conformance/cases/sessions/list.d.ts +4 -0
- package/dist/conformance/cases/sessions/list.d.ts.map +1 -0
- package/dist/conformance/cases/sessions/reads.d.ts +4 -0
- package/dist/conformance/cases/sessions/reads.d.ts.map +1 -0
- package/dist/conformance/cases/sessions/reauthentication.d.ts +4 -0
- package/dist/conformance/cases/sessions/reauthentication.d.ts.map +1 -0
- package/dist/conformance/cases/sessions/revocation.d.ts +4 -0
- package/dist/conformance/cases/sessions/revocation.d.ts.map +1 -0
- package/dist/conformance/cases/social-links/deletion.d.ts +4 -0
- package/dist/conformance/cases/social-links/deletion.d.ts.map +1 -0
- package/dist/conformance/cases/social-links/index.d.ts +8 -0
- package/dist/conformance/cases/social-links/index.d.ts.map +1 -0
- package/dist/conformance/cases/social-links/inserts.d.ts +4 -0
- package/dist/conformance/cases/social-links/inserts.d.ts.map +1 -0
- package/dist/conformance/cases/social-links/reads.d.ts +4 -0
- package/dist/conformance/cases/social-links/reads.d.ts.map +1 -0
- package/dist/conformance/cases/tokens/attempts.d.ts +7 -0
- package/dist/conformance/cases/tokens/attempts.d.ts.map +1 -0
- package/dist/conformance/cases/tokens/change-email.d.ts +8 -0
- package/dist/conformance/cases/tokens/change-email.d.ts.map +1 -0
- package/dist/conformance/cases/tokens/deletion.d.ts +4 -0
- package/dist/conformance/cases/tokens/deletion.d.ts.map +1 -0
- package/dist/conformance/cases/tokens/index.d.ts +4 -0
- package/dist/conformance/cases/tokens/index.d.ts.map +1 -0
- package/dist/conformance/cases/tokens/inserts.d.ts +7 -0
- package/dist/conformance/cases/tokens/inserts.d.ts.map +1 -0
- package/dist/conformance/cases/tokens/kinds.d.ts +7 -0
- package/dist/conformance/cases/tokens/kinds.d.ts.map +1 -0
- package/dist/conformance/cases/tokens/redemption.d.ts +7 -0
- package/dist/conformance/cases/tokens/redemption.d.ts.map +1 -0
- package/dist/conformance/cases/tokens/social-flow.d.ts +8 -0
- package/dist/conformance/cases/tokens/social-flow.d.ts.map +1 -0
- package/dist/conformance/cases/tokens/spending.d.ts +7 -0
- package/dist/conformance/cases/tokens/spending.d.ts.map +1 -0
- package/dist/conformance/cases/users/avatar.d.ts +8 -0
- package/dist/conformance/cases/users/avatar.d.ts.map +1 -0
- package/dist/conformance/cases/users/batch.d.ts +8 -0
- package/dist/conformance/cases/users/batch.d.ts.map +1 -0
- package/dist/conformance/cases/users/deletion.d.ts +4 -0
- package/dist/conformance/cases/users/deletion.d.ts.map +1 -0
- package/dist/conformance/cases/users/index.d.ts +4 -0
- package/dist/conformance/cases/users/index.d.ts.map +1 -0
- package/dist/conformance/cases/users/inserts.d.ts +4 -0
- package/dist/conformance/cases/users/inserts.d.ts.map +1 -0
- package/dist/conformance/cases/users/listing.d.ts +4 -0
- package/dist/conformance/cases/users/listing.d.ts.map +1 -0
- package/dist/conformance/cases/users/patches.d.ts +7 -0
- package/dist/conformance/cases/users/patches.d.ts.map +1 -0
- package/dist/conformance/cases/users/reads.d.ts +7 -0
- package/dist/conformance/cases/users/reads.d.ts.map +1 -0
- package/dist/conformance/cases/users/second-factor.d.ts +16 -0
- package/dist/conformance/cases/users/second-factor.d.ts.map +1 -0
- package/dist/conformance/cases/users/versions.d.ts +7 -0
- package/dist/conformance/cases/users/versions.d.ts.map +1 -0
- package/dist/conformance/describe.d.ts +82 -0
- package/dist/conformance/describe.d.ts.map +1 -0
- package/dist/conformance/fixtures.d.ts +31 -0
- package/dist/conformance/fixtures.d.ts.map +1 -0
- package/dist/conformance/index.d.ts +46 -0
- package/dist/conformance/index.d.ts.map +1 -0
- package/dist/conformance/index.js +4411 -0
- package/dist/conformance/index.js.map +86 -0
- package/dist/conformance/invitations/cases/actors.d.ts +3 -0
- package/dist/conformance/invitations/cases/actors.d.ts.map +1 -0
- package/dist/conformance/invitations/cases/find-pending.d.ts +3 -0
- package/dist/conformance/invitations/cases/find-pending.d.ts.map +1 -0
- package/dist/conformance/invitations/cases/imported.d.ts +3 -0
- package/dist/conformance/invitations/cases/imported.d.ts.map +1 -0
- package/dist/conformance/invitations/cases/index.d.ts +4 -0
- package/dist/conformance/invitations/cases/index.d.ts.map +1 -0
- package/dist/conformance/invitations/cases/insert.d.ts +3 -0
- package/dist/conformance/invitations/cases/insert.d.ts.map +1 -0
- package/dist/conformance/invitations/cases/list-lapsed.d.ts +3 -0
- package/dist/conformance/invitations/cases/list-lapsed.d.ts.map +1 -0
- package/dist/conformance/invitations/cases/list-status.d.ts +3 -0
- package/dist/conformance/invitations/cases/list-status.d.ts.map +1 -0
- package/dist/conformance/invitations/cases/list.d.ts +3 -0
- package/dist/conformance/invitations/cases/list.d.ts.map +1 -0
- package/dist/conformance/invitations/cases/outage.d.ts +3 -0
- package/dist/conformance/invitations/cases/outage.d.ts.map +1 -0
- package/dist/conformance/invitations/cases/scope.d.ts +3 -0
- package/dist/conformance/invitations/cases/scope.d.ts.map +1 -0
- package/dist/conformance/invitations/cases/update.d.ts +3 -0
- package/dist/conformance/invitations/cases/update.d.ts.map +1 -0
- package/dist/conformance/invitations/describe.d.ts +20 -0
- package/dist/conformance/invitations/describe.d.ts.map +1 -0
- package/dist/conformance/invitations/fixtures.d.ts +4 -0
- package/dist/conformance/invitations/fixtures.d.ts.map +1 -0
- package/dist/conformance/invitations/index.d.ts +18 -0
- package/dist/conformance/invitations/index.d.ts.map +1 -0
- package/dist/conformance/invitations/reference.d.ts +4 -0
- package/dist/conformance/invitations/reference.d.ts.map +1 -0
- package/dist/conformance/invitations/types.d.ts +34 -0
- package/dist/conformance/invitations/types.d.ts.map +1 -0
- package/dist/conformance/reference.d.ts +13 -0
- package/dist/conformance/reference.d.ts.map +1 -0
- package/dist/conformance/relations/cases/deletion.d.ts +4 -0
- package/dist/conformance/relations/cases/deletion.d.ts.map +1 -0
- package/dist/conformance/relations/cases/holders.d.ts +9 -0
- package/dist/conformance/relations/cases/holders.d.ts.map +1 -0
- package/dist/conformance/relations/cases/index.d.ts +4 -0
- package/dist/conformance/relations/cases/index.d.ts.map +1 -0
- package/dist/conformance/relations/cases/outage.d.ts +3 -0
- package/dist/conformance/relations/cases/outage.d.ts.map +1 -0
- package/dist/conformance/relations/cases/reads.d.ts +8 -0
- package/dist/conformance/relations/cases/reads.d.ts.map +1 -0
- package/dist/conformance/relations/cases/traversal.d.ts +7 -0
- package/dist/conformance/relations/cases/traversal.d.ts.map +1 -0
- package/dist/conformance/relations/cases/writes.d.ts +4 -0
- package/dist/conformance/relations/cases/writes.d.ts.map +1 -0
- package/dist/conformance/relations/describe.d.ts +20 -0
- package/dist/conformance/relations/describe.d.ts.map +1 -0
- package/dist/conformance/relations/fixtures.d.ts +8 -0
- package/dist/conformance/relations/fixtures.d.ts.map +1 -0
- package/dist/conformance/relations/index.d.ts +18 -0
- package/dist/conformance/relations/index.d.ts.map +1 -0
- package/dist/conformance/relations/reference.d.ts +4 -0
- package/dist/conformance/relations/reference.d.ts.map +1 -0
- package/dist/conformance/relations/types.d.ts +34 -0
- package/dist/conformance/relations/types.d.ts.map +1 -0
- package/dist/conformance/types.d.ts +79 -0
- package/dist/conformance/types.d.ts.map +1 -0
- package/dist/errors/janus-error/base.d.ts +47 -0
- package/dist/errors/janus-error/base.d.ts.map +1 -0
- package/dist/errors/janus-error/codes.credentials.d.ts +36 -0
- package/dist/errors/janus-error/codes.credentials.d.ts.map +1 -0
- package/dist/errors/janus-error/codes.d.ts +23 -0
- package/dist/errors/janus-error/codes.d.ts.map +1 -0
- package/dist/errors/janus-error/codes.invitations.d.ts +52 -0
- package/dist/errors/janus-error/codes.invitations.d.ts.map +1 -0
- package/dist/errors/janus-error/codes.one-time.d.ts +63 -0
- package/dist/errors/janus-error/codes.one-time.d.ts.map +1 -0
- package/dist/errors/janus-error/codes.records.d.ts +86 -0
- package/dist/errors/janus-error/codes.records.d.ts.map +1 -0
- package/dist/errors/janus-error/codes.social.d.ts +88 -0
- package/dist/errors/janus-error/codes.social.d.ts.map +1 -0
- package/dist/errors/janus-error/index.d.ts +17 -0
- package/dist/errors/janus-error/index.d.ts.map +1 -0
- package/dist/errors/janus-error/options.d.ts +105 -0
- package/dist/errors/janus-error/options.d.ts.map +1 -0
- package/dist/errors/janus-error/refusals.d.ts +151 -0
- package/dist/errors/janus-error/refusals.d.ts.map +1 -0
- package/dist/errors/janus-error/status.d.ts +21 -0
- package/dist/errors/janus-error/status.d.ts.map +1 -0
- package/dist/errors/janus-error/store.d.ts +36 -0
- package/dist/errors/janus-error/store.d.ts.map +1 -0
- package/dist/ids/derived.d.ts +25 -0
- package/dist/ids/derived.d.ts.map +1 -0
- package/dist/ids/id.d.ts +55 -0
- package/dist/ids/id.d.ts.map +1 -0
- package/dist/index.d.ts +32 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6933 -0
- package/dist/index.js.map +208 -0
- package/dist/pagination/cursor-page.d.ts +53 -0
- package/dist/pagination/cursor-page.d.ts.map +1 -0
- package/dist/permissions/bound-model.d.ts +10 -0
- package/dist/permissions/bound-model.d.ts.map +1 -0
- package/dist/permissions/can.d.ts +13 -0
- package/dist/permissions/can.d.ts.map +1 -0
- package/dist/permissions/engine.d.ts +49 -0
- package/dist/permissions/engine.d.ts.map +1 -0
- package/dist/permissions/holders.d.ts +12 -0
- package/dist/permissions/holders.d.ts.map +1 -0
- package/dist/permissions/index.d.ts +36 -0
- package/dist/permissions/index.d.ts.map +1 -0
- package/dist/permissions/index.js +924 -0
- package/dist/permissions/index.js.map +28 -0
- package/dist/permissions/input.d.ts +43 -0
- package/dist/permissions/input.d.ts.map +1 -0
- package/dist/permissions/list.d.ts +16 -0
- package/dist/permissions/list.d.ts.map +1 -0
- package/dist/permissions/model/can.d.ts +41 -0
- package/dist/permissions/model/can.d.ts.map +1 -0
- package/dist/permissions/model/config.d.ts +36 -0
- package/dist/permissions/model/config.d.ts.map +1 -0
- package/dist/permissions/model/constraint.d.ts +37 -0
- package/dist/permissions/model/constraint.d.ts.map +1 -0
- package/dist/permissions/model/ctx.d.ts +23 -0
- package/dist/permissions/model/ctx.d.ts.map +1 -0
- package/dist/permissions/model/define.d.ts +78 -0
- package/dist/permissions/model/define.d.ts.map +1 -0
- package/dist/permissions/model/from-field.d.ts +31 -0
- package/dist/permissions/model/from-field.d.ts.map +1 -0
- package/dist/permissions/model/grant.d.ts +81 -0
- package/dist/permissions/model/grant.d.ts.map +1 -0
- package/dist/permissions/model/list.d.ts +48 -0
- package/dist/permissions/model/list.d.ts.map +1 -0
- package/dist/permissions/model/names.d.ts +51 -0
- package/dist/permissions/model/names.d.ts.map +1 -0
- package/dist/permissions/model/permissions.d.ts +48 -0
- package/dist/permissions/model/permissions.d.ts.map +1 -0
- package/dist/permissions/model/refs.d.ts +36 -0
- package/dist/permissions/model/refs.d.ts.map +1 -0
- package/dist/permissions/model/refusal.d.ts +13 -0
- package/dist/permissions/model/refusal.d.ts.map +1 -0
- package/dist/permissions/model/unions.d.ts +3 -0
- package/dist/permissions/model/unions.d.ts.map +1 -0
- package/dist/permissions/model/when.d.ts +16 -0
- package/dist/permissions/model/when.d.ts.map +1 -0
- package/dist/permissions/port/holders.d.ts +38 -0
- package/dist/permissions/port/holders.d.ts.map +1 -0
- package/dist/permissions/port/memory.d.ts +17 -0
- package/dist/permissions/port/memory.d.ts.map +1 -0
- package/dist/permissions/port/types.d.ts +101 -0
- package/dist/permissions/port/types.d.ts.map +1 -0
- package/dist/permissions/replace.d.ts +25 -0
- package/dist/permissions/replace.d.ts.map +1 -0
- package/dist/permissions/resolve/declared-names.d.ts +24 -0
- package/dist/permissions/resolve/declared-names.d.ts.map +1 -0
- package/dist/permissions/resolve/refuse-data-beyond-root.d.ts +11 -0
- package/dist/permissions/resolve/refuse-data-beyond-root.d.ts.map +1 -0
- package/dist/permissions/resolve/refuse-loops.d.ts +10 -0
- package/dist/permissions/resolve/refuse-loops.d.ts.map +1 -0
- package/dist/permissions/resolve/resolve-model.d.ts +13 -0
- package/dist/permissions/resolve/resolve-model.d.ts.map +1 -0
- package/dist/permissions/resolve/resolve-relation.d.ts +9 -0
- package/dist/permissions/resolve/resolve-relation.d.ts.map +1 -0
- package/dist/permissions/resolve/resolve-rule.d.ts +12 -0
- package/dist/permissions/resolve/resolve-rule.d.ts.map +1 -0
- package/dist/permissions/resolve/resolved.d.ts +52 -0
- package/dist/permissions/resolve/resolved.d.ts.map +1 -0
- package/dist/permissions/resolve/step.d.ts +4 -0
- package/dist/permissions/resolve/step.d.ts.map +1 -0
- package/dist/permissions/reverse.d.ts +53 -0
- package/dist/permissions/reverse.d.ts.map +1 -0
- package/dist/permissions/walk.d.ts +29 -0
- package/dist/permissions/walk.d.ts.map +1 -0
- package/dist/stores/guard.d.ts +24 -0
- package/dist/stores/guard.d.ts.map +1 -0
- package/dist/stores/storable.d.ts +15 -0
- package/dist/stores/storable.d.ts.map +1 -0
- package/dist/subjects/notation.d.ts +39 -0
- package/dist/subjects/notation.d.ts.map +1 -0
- package/dist/subjects/subject.d.ts +128 -0
- package/dist/subjects/subject.d.ts.map +1 -0
- package/dist/testing/index.d.ts +12 -0
- package/dist/testing/index.d.ts.map +1 -0
- package/dist/testing/index.js +26 -0
- package/dist/testing/index.js.map +10 -0
- package/dist/time/clock.d.ts +31 -0
- package/dist/time/clock.d.ts.map +1 -0
- package/dist/time/duration.d.ts +23 -0
- package/dist/time/duration.d.ts.map +1 -0
- package/docs/README.md +46 -0
- package/docs/guide/adapters.md +858 -0
- package/docs/guide/api-keys.md +316 -0
- package/docs/guide/avatars.md +334 -0
- package/docs/guide/devices.md +441 -0
- package/docs/guide/email-flows.md +880 -0
- package/docs/guide/errors.md +180 -0
- package/docs/guide/events.md +467 -0
- package/docs/guide/invitations.md +465 -0
- package/docs/guide/issuers.md +107 -0
- package/docs/guide/magic-link.md +580 -0
- package/docs/guide/migrating-invitations.md +142 -0
- package/docs/guide/passkeys.md +425 -0
- package/docs/guide/passwords.md +325 -0
- package/docs/guide/permissions.md +719 -0
- package/docs/guide/second-factor.md +1124 -0
- package/docs/guide/sessions.md +521 -0
- package/docs/guide/sign-in-code.md +631 -0
- package/docs/guide/social.md +639 -0
- package/docs/guide/step-up.md +262 -0
- package/docs/guide/users.md +557 -0
- package/docs/guide/vocabulary.md +316 -0
- package/docs/roadmap.md +101 -0
- package/docs/troubleshooting.md +3305 -0
- package/package.json +77 -5
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"email-sign-in.d.ts","sourceRoot":"","sources":["../../src/auth/email-sign-in.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,OAAO,EAAiB,MAAM,WAAW,CAAC;AACtE,OAAO,EAAE,KAAK,UAAU,EAAmB,MAAM,WAAW,CAAC;AAG7D,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAEvE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C,uFAAuF;AACvF,MAAM,MAAM,MAAM,GAAG,CACpB,MAAM,EAAE,UAAU,EAClB,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,UAAU;AAClB,0EAA0E;AAC1E,GAAG,CAAC,EAAE,SAAS,MAAM,EAAE,KACnB,OAAO,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,CAAC;AAEpC;;;;GAIG;AACH,wBAAsB,YAAY,CACjC,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,YAAY,EAClB,KAAK,EAAE,MAAM,GACX,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,CAG5B;AAED;;;;GAIG;AACH,wBAAsB,cAAc,CACnC,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,SAAS,EACf,MAAM,EAAE,MAAM,GACZ,OAAO,CAAC,IAAI,CAAC,CAOf;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,iBAAiB,CACtC,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,YAAY,EAClB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE;IACP,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAC1B,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC;IAC5B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,CAAC;IAChC,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC;IAC5B,yDAAyD;IACzD,QAAQ,CAAC,GAAG,EAAE,SAAS,MAAM,EAAE,CAAC;CAChC,GACC,OAAO,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,CAiBhC"}
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import { type Id } from '../ids/id';
|
|
2
|
+
import type { Context } from './context';
|
|
3
|
+
/**
|
|
4
|
+
* What happened to a user, once it is written:
|
|
5
|
+
*
|
|
6
|
+
* - `user.created` — by `create` or `signUp`;
|
|
7
|
+
* - `user.emailVerified` — by `verifyEmail.confirm`, or by the link of
|
|
8
|
+
* `resetPassword.confirm`, `magicLink.confirm` or `changeEmail.confirm`, or the code of
|
|
9
|
+
* `signInCode.confirm`, which prove the e-mail too; never for an e-mail
|
|
10
|
+
* already verified;
|
|
11
|
+
* - `user.passwordReset` — by `resetPassword.confirm`;
|
|
12
|
+
* - `user.passwordChanged` — by `changePassword` and `setPassword`, and by
|
|
13
|
+
* `signInCode.confirm` and `magicLink.confirm` when their first proof of
|
|
14
|
+
* the e-mail dropped a password, after `user.emailVerified`; never by a
|
|
15
|
+
* reset, which is `user.passwordReset` alone. Carries `first`: `true` when
|
|
16
|
+
* the user had no password before (a `setPassword` on an account created
|
|
17
|
+
* without a credential), so a "your password was changed" notice can skip it;
|
|
18
|
+
* - `user.emailChanged` — by `update` and `changeEmail.confirm`, when they
|
|
19
|
+
* changed the e-mail — compared
|
|
20
|
+
* normalised, the same test that makes the new one unverified. The one
|
|
21
|
+
* event that carries more than the user: `formerEmail`;
|
|
22
|
+
* - `user.secondFactorEnabled` — by `secondFactor.activate`, once the factor
|
|
23
|
+
* is active: not by `enroll`, which leaves it waiting for its first code;
|
|
24
|
+
* - `user.secondFactorDisabled` — by `secondFactor.disable`, when it removed
|
|
25
|
+
* an active factor, and by `signInCode.confirm` and `magicLink.confirm`
|
|
26
|
+
* when their first proof of the e-mail removed one, after
|
|
27
|
+
* `user.emailVerified` and any `user.passwordChanged`; never for a user who
|
|
28
|
+
* had none, or one still waiting;
|
|
29
|
+
* - `user.recoveryCodesRegenerated` — by `secondFactor.regenerateRecoveryCodes`:
|
|
30
|
+
* the codes the user held stopped working. Not by `activate`, whose codes
|
|
31
|
+
* come with `user.secondFactorEnabled`;
|
|
32
|
+
* - `user.recoveryCodeUsed` — by `secondFactor.recover`, once the code is
|
|
33
|
+
* spent: a sign-in without the user's phone;
|
|
34
|
+
* - `user.newDeviceSignedIn` — by a sign-in that opened a session from a
|
|
35
|
+
* device the user had not signed in from: `signIn`, `secondFactor.confirm`,
|
|
36
|
+
* `secondFactor.recover`, `signInCode.confirm`, `magicLink.confirm` and
|
|
37
|
+
* `signInProven`, when given a `device` its token did not prove. Never by
|
|
38
|
+
* `signUp`, nor without a `device`. Carries `sessionId`;
|
|
39
|
+
* - `user.avatarChanged` — by `avatar.set`, when it wrote a different id than
|
|
40
|
+
* the user had. The same id again is no write and no event. Carries
|
|
41
|
+
* `formerAvatarId`: how the application deletes the image it replaced;
|
|
42
|
+
* - `user.avatarRemoved` — by `avatar.remove`, when the user had an avatar.
|
|
43
|
+
* Carries `formerAvatarId`, the id it had;
|
|
44
|
+
* - `user.socialLinked` — by `social.complete` when it linked a social
|
|
45
|
+
* account: a link flow, an existing user matched by a verified e-mail, or
|
|
46
|
+
* the account a social sign-up created. Not for an account already linked
|
|
47
|
+
* to that user. Carries `provider`, never the account's id;
|
|
48
|
+
* - `user.socialUnlinked` — by `social.unlink`, when it deleted a link.
|
|
49
|
+
* Carries `provider`;
|
|
50
|
+
* - `user.passkeyAdded` — by `passkeys.register`, once the passkey is stored;
|
|
51
|
+
* not by `registrationOptions`, which stores no credential;
|
|
52
|
+
* - `user.passkeyRemoved` — by `passkeys.remove`, when it deleted a passkey,
|
|
53
|
+
* and by `secondFactor.disable` (and a first proof that removed an active
|
|
54
|
+
* TOTP) once per passkey it took with the factor.
|
|
55
|
+
* Both carry `passkey`, the credential id and name;
|
|
56
|
+
* - `user.passkeyCloneSuspected` — by `secondFactor.confirmPasskey` and
|
|
57
|
+
* `stepUp.confirmPasskey`, when an assertion's counter went backwards
|
|
58
|
+
* (both counters non-zero): the sign-in is refused, the passkey stays
|
|
59
|
+
* active. Carries `passkey`, the credential id and name;
|
|
60
|
+
* - `user.apiKeyCreated` — by `apiKeys.create`, once the key is stored. The
|
|
61
|
+
* body names the user, never the key;
|
|
62
|
+
* - `user.apiKeyRevoked` — by every path that revokes keys: `apiKeys.revoke`,
|
|
63
|
+
* `revokeAll` and `revokeAllBound`, a password reset and the first proof
|
|
64
|
+
* of an e-mail that revoke the user's keys. **One event per call**, carrying
|
|
65
|
+
* `count`, the keys it ended; a call that ended none sends none (revoking
|
|
66
|
+
* a revoked key included). Never by `delete`, which sends `user.deleted`;
|
|
67
|
+
* - `user.deleted` — by `delete`, once; a replay that finds nobody is none.
|
|
68
|
+
*/
|
|
69
|
+
export type UserEventType = 'user.created' | 'user.emailVerified' | 'user.passwordReset' | 'user.passwordChanged' | 'user.emailChanged' | 'user.secondFactorEnabled' | 'user.secondFactorDisabled' | 'user.recoveryCodesRegenerated' | 'user.recoveryCodeUsed' | 'user.newDeviceSignedIn' | 'user.avatarChanged' | 'user.avatarRemoved' | 'user.socialLinked' | 'user.socialUnlinked' | 'user.passkeyAdded' | 'user.passkeyRemoved' | 'user.passkeyCloneSuspected' | 'user.apiKeyCreated' | 'user.apiKeyRevoked' | 'user.deleted';
|
|
70
|
+
/**
|
|
71
|
+
* A user event: **the user named by id, and nothing else** — no login, no
|
|
72
|
+
* field, no password, no token. Whoever receives it reads the rest from where
|
|
73
|
+
* it is kept, if they may. Three exceptions: `formerEmail` on
|
|
74
|
+
* `user.emailChanged` — once the write landed, the old address is kept
|
|
75
|
+
* nowhere — `sessionId` on `user.newDeviceSignedIn`, the session the new
|
|
76
|
+
* device holds, and `formerAvatarId` on the two avatar events, the id of the
|
|
77
|
+
* image the write let go, and `provider` on the two social events, the
|
|
78
|
+
* application's name for the provider — never the account's id.
|
|
79
|
+
*/
|
|
80
|
+
export interface UserEvent {
|
|
81
|
+
/** A UUIDv7 minted for this event: the key to deliver it once. */
|
|
82
|
+
readonly id: Id;
|
|
83
|
+
readonly type: UserEventType;
|
|
84
|
+
/**
|
|
85
|
+
* When the write landed: the `createdAt` or `updatedAt` it wrote, or, for
|
|
86
|
+
* a deletion, the time read just before it — not when the listener ran.
|
|
87
|
+
*/
|
|
88
|
+
readonly occurredAt: Date;
|
|
89
|
+
readonly userId: Id;
|
|
90
|
+
readonly userType: string;
|
|
91
|
+
/**
|
|
92
|
+
* On `user.emailChanged` only: the address the user had before, as it was
|
|
93
|
+
* stored — `null` when they had none. So a notice can reach the inbox the
|
|
94
|
+
* account was just taken from; the new address is on the user. Absent
|
|
95
|
+
* from every other type, and from an event a webhook delivered.
|
|
96
|
+
*/
|
|
97
|
+
readonly formerEmail?: string | null;
|
|
98
|
+
/**
|
|
99
|
+
* On `user.newDeviceSignedIn` only: the session the new device opened —
|
|
100
|
+
* to sign it out from a "this wasn't me" page. Absent from every other
|
|
101
|
+
* type, and from an event a webhook delivered.
|
|
102
|
+
*/
|
|
103
|
+
readonly sessionId?: string;
|
|
104
|
+
/**
|
|
105
|
+
* On `user.avatarChanged` and `user.avatarRemoved` only: the avatar id the
|
|
106
|
+
* user had before — `null` on a first `avatar.set` — so the application can
|
|
107
|
+
* delete that image from its storage. Always a string on
|
|
108
|
+
* `user.avatarRemoved`. Absent from every other type, and from an event a
|
|
109
|
+
* webhook delivered.
|
|
110
|
+
*/
|
|
111
|
+
readonly formerAvatarId?: string | null;
|
|
112
|
+
/**
|
|
113
|
+
* On `user.passwordChanged` only: `true` when the user had no password
|
|
114
|
+
* before the write — `setPassword` on an account created without a
|
|
115
|
+
* credential — and `false` for a change, or a first proof that dropped a
|
|
116
|
+
* password. Absent from every other type, and from an event a webhook
|
|
117
|
+
* delivered.
|
|
118
|
+
*/
|
|
119
|
+
readonly first?: boolean;
|
|
120
|
+
/**
|
|
121
|
+
* On `user.socialLinked` and `user.socialUnlinked` only: the application's
|
|
122
|
+
* name for the provider (`'google'`). **Never the provider's account id**,
|
|
123
|
+
* nor its e-mail. Absent from every other type.
|
|
124
|
+
*/
|
|
125
|
+
readonly provider?: string;
|
|
126
|
+
/**
|
|
127
|
+
* On the three passkey events only: which passkey, and
|
|
128
|
+
* the name the user gave it — for a "passkey added" or "clone suspected"
|
|
129
|
+
* notice. Stays in the
|
|
130
|
+
* process, like `formerEmail`: an event a webhook delivers does not carry it.
|
|
131
|
+
*/
|
|
132
|
+
readonly passkey?: {
|
|
133
|
+
readonly credentialId: string;
|
|
134
|
+
readonly name: string;
|
|
135
|
+
};
|
|
136
|
+
/**
|
|
137
|
+
* On `user.apiKeyRevoked` only: how many keys the call revoked, 1 or more.
|
|
138
|
+
* Never a key id or a secret. Stays in the process: an event a webhook
|
|
139
|
+
* delivers does not carry it.
|
|
140
|
+
*/
|
|
141
|
+
readonly count?: number;
|
|
142
|
+
}
|
|
143
|
+
/** What an event carries beyond the user, on the types that do. */
|
|
144
|
+
export type EventExtras = Pick<UserEvent, 'formerEmail' | 'sessionId' | 'formerAvatarId' | 'first' | 'provider' | 'passkey' | 'count'>;
|
|
145
|
+
/**
|
|
146
|
+
* What `janus({ events })` takes: called once per event, **after** the write
|
|
147
|
+
* landed and before the flow answers — awaited, so a queue that stores the
|
|
148
|
+
* event durably has done so by then. A listener that throws fails nothing:
|
|
149
|
+
* the write happened, and the flow answers as it would have. The failure is a
|
|
150
|
+
* `JANUS_EVENT_FAILED` warning naming the event, never silence.
|
|
151
|
+
*/
|
|
152
|
+
export type UserEventListener = (event: UserEvent) => void | Promise<void>;
|
|
153
|
+
/** The listener given to `janus()`, or a wiring refusal for a JavaScript caller. */
|
|
154
|
+
export declare function resolveEvents(events: unknown, where: string): UserEventListener | null;
|
|
155
|
+
/**
|
|
156
|
+
* Hands one event to the listener after the write it reports. A flow whose
|
|
157
|
+
* steps after the write matter to the listener — a reset's revocation, a
|
|
158
|
+
* deletion's cleanup — runs them in a `try` and emits from its `finally`, so
|
|
159
|
+
* an outage there does not lose the event for good. Its failure is the application's, not the flow's: warned about, with what
|
|
160
|
+
* it takes to send the event again — never thrown, since the write has landed.
|
|
161
|
+
*/
|
|
162
|
+
export declare function emit(context: Context, type: UserEventType, user: {
|
|
163
|
+
readonly id: Id;
|
|
164
|
+
readonly type: string;
|
|
165
|
+
}, occurredAt: Date, extras?: EventExtras): Promise<void>;
|
|
166
|
+
//# sourceMappingURL=events.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/auth/events.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,EAAU,MAAM,WAAW,CAAC;AAC5C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiEG;AACH,MAAM,MAAM,aAAa,GACtB,cAAc,GACd,oBAAoB,GACpB,oBAAoB,GACpB,sBAAsB,GACtB,mBAAmB,GACnB,0BAA0B,GAC1B,2BAA2B,GAC3B,+BAA+B,GAC/B,uBAAuB,GACvB,wBAAwB,GACxB,oBAAoB,GACpB,oBAAoB,GACpB,mBAAmB,GACnB,qBAAqB,GACrB,mBAAmB,GACnB,qBAAqB,GACrB,4BAA4B,GAC5B,oBAAoB,GACpB,oBAAoB,GACpB,cAAc,CAAC;AAElB;;;;;;;;;GASG;AACH,MAAM,WAAW,SAAS;IACzB,kEAAkE;IAClE,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAC;IAChB,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAC;IAC7B;;;OAGG;IACH,QAAQ,CAAC,UAAU,EAAE,IAAI,CAAC;IAC1B,QAAQ,CAAC,MAAM,EAAE,EAAE,CAAC;IACpB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B;;;;;OAKG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC;;;;OAIG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B;;;;;;OAMG;IACH,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxC;;;;;;OAMG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC;IACzB;;;;OAIG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B;;;;;OAKG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE;QAClB,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;QAC9B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;KACtB,CAAC;IACF;;;;OAIG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,mEAAmE;AACnE,MAAM,MAAM,WAAW,GAAG,IAAI,CAC7B,SAAS,EACP,aAAa,GACb,WAAW,GACX,gBAAgB,GAChB,OAAO,GACP,UAAU,GACV,SAAS,GACT,OAAO,CACT,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,KAAK,EAAE,SAAS,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;AAE3E,oFAAoF;AACpF,wBAAgB,aAAa,CAC5B,MAAM,EAAE,OAAO,EACf,KAAK,EAAE,MAAM,GACX,iBAAiB,GAAG,IAAI,CAQ1B;AAED;;;;;;GAMG;AACH,wBAAsB,IAAI,CACzB,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,aAAa,EACnB,IAAI,EAAE;IAAE,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,EAChD,UAAU,EAAE,IAAI,EAChB,MAAM,GAAE,WAAgB,GACtB,OAAO,CAAC,IAAI,CAAC,CAqBf"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The first proof of an e-mail by a sign-in code or a sign-in link: the
|
|
3
|
+
* address reached an inbox no one had proved before, so whatever was set on
|
|
4
|
+
* the account before that proof is not the inbox holder's to keep.
|
|
5
|
+
*
|
|
6
|
+
* Anybody can sign up with somebody else's e-mail and a password of their
|
|
7
|
+
* own. Enrolling a factor or a passkey is refused until the e-mail is proved,
|
|
8
|
+
* so a factor only stands here on data stored before that rule, or enrolled
|
|
9
|
+
* through a store write; `update` refuses to move the e-mail of a user who
|
|
10
|
+
* holds a factor or a passkey (`EMAIL_CHANGE_NEEDS_PROOF`), so a factor enrolled
|
|
11
|
+
* while the e-mail was proved is not left beside a new, unproved address —
|
|
12
|
+
* `changeEmail` proves it. Without this, the real
|
|
13
|
+
* holder signing in by e-mail later would verify the address and leave that
|
|
14
|
+
* password, that factor and their sessions working: locked out by a factor
|
|
15
|
+
* they never set, or signed in beside someone who still holds the account.
|
|
16
|
+
* So the write that proves the address also drops the password, the avatar
|
|
17
|
+
* and the second factor with its recovery codes, and every session is
|
|
18
|
+
* revoked before the new one opens: the same ending as `resetPassword.confirm`, which
|
|
19
|
+
* proves the address too, plus the factor it keeps.
|
|
20
|
+
*/
|
|
21
|
+
import type { ResolvedType } from './config';
|
|
22
|
+
import { type Context } from './context';
|
|
23
|
+
import type { UserRecord } from './port/types';
|
|
24
|
+
/**
|
|
25
|
+
* Proves `user`'s e-mail, never proved before, under the version read — an
|
|
26
|
+
* address changed since is not the one proved: a `VERSION_CONFLICT` then.
|
|
27
|
+
* Drops the password, the avatar and the second factor — active or waiting,
|
|
28
|
+
* and its recovery codes with it — in the same write, and revokes every session and
|
|
29
|
+
* spends what the password opened — reset links and second-factor
|
|
30
|
+
* challenges — **both before the write and after it**.
|
|
31
|
+
*
|
|
32
|
+
* Before, so an outage there leaves the e-mail unproved and the owner's next
|
|
33
|
+
* code or link runs this again; after, so a sign-in landing in between is
|
|
34
|
+
* ended too. An outage after the write is the one that leaves a session live.
|
|
35
|
+
*
|
|
36
|
+
* `user.emailVerified` is sent, then `user.passwordChanged` when a password
|
|
37
|
+
* was dropped, `user.secondFactorDisabled` when an active factor was and
|
|
38
|
+
* `user.avatarRemoved` (with `formerAvatarId`) when an avatar was —
|
|
39
|
+
* the rule of `secondFactor.disable` — from a `finally`, so an outage ending
|
|
40
|
+
* the sessions still reports the write, which a retry would not make again.
|
|
41
|
+
*/
|
|
42
|
+
export declare function proveFirstEmail(context: Context, type: ResolvedType, user: UserRecord, where: string): Promise<UserRecord>;
|
|
43
|
+
//# sourceMappingURL=first-proof.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"first-proof.d.ts","sourceRoot":"","sources":["../../src/auth/first-proof.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAIH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAE,KAAK,OAAO,EAAa,MAAM,WAAW,CAAC;AAIpD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAG/C;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAsB,eAAe,CACpC,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,YAAY,EAClB,IAAI,EAAE,UAAU,EAChB,KAAK,EAAE,MAAM,GACX,OAAO,CAAC,UAAU,CAAC,CA4DrB"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { PasswordHasher } from './config';
|
|
2
|
+
/**
|
|
3
|
+
* scrypt through `node:crypto` — the hasher that runs **everywhere**: Node and
|
|
4
|
+
* Bun both implement it, and it needs no dependency.
|
|
5
|
+
*
|
|
6
|
+
* Measured before choosing it: `bun build --target node` leaves `Bun.password`
|
|
7
|
+
* in the output as it is — a target changes the bundle's format, not which
|
|
8
|
+
* APIs exist — and `crypto.argon2` is absent from Node 22. scrypt is the one
|
|
9
|
+
* memory-hard function both runtimes ship.
|
|
10
|
+
*
|
|
11
|
+
* The defaults are OWASP's: N = 2^17, r = 8, p = 1, about 128 MiB per hash.
|
|
12
|
+
* The parameters are written into the hash —
|
|
13
|
+
* `$scrypt$ln=17,r=8,p=1$<salt>$<key>` — and read back from it to verify, so
|
|
14
|
+
* raising `cost` later leaves every existing hash readable.
|
|
15
|
+
*
|
|
16
|
+
* `cost` is log2(N). Lower it only in tests: 10 is fast and still exercises
|
|
17
|
+
* every line.
|
|
18
|
+
*
|
|
19
|
+
* **Concurrency.** Each call holds about 128 MiB while it runs, so a burst of
|
|
20
|
+
* verifies — a credential-stuffing run, including the dummy verify of an unknown
|
|
21
|
+
* e-mail — would otherwise allocate without bound. `concurrency` caps how many
|
|
22
|
+
* `hash` and `verify` calls run at once, per hasher (default 2, about 256 MiB);
|
|
23
|
+
* calls past the cap wait their turn, in order. The application's sign-in
|
|
24
|
+
* throttle still applies on top.
|
|
25
|
+
*
|
|
26
|
+
* A hash written with other parameters than these is rewritten with these the
|
|
27
|
+
* next time its owner signs in (`needsRehash`), so raising `cost` reaches every
|
|
28
|
+
* active user without a migration.
|
|
29
|
+
*/
|
|
30
|
+
export declare function scryptHasher(options?: {
|
|
31
|
+
readonly cost?: number;
|
|
32
|
+
readonly concurrency?: number;
|
|
33
|
+
}): PasswordHasher;
|
|
34
|
+
/**
|
|
35
|
+
* argon2id through `Bun.password`.
|
|
36
|
+
*
|
|
37
|
+
* **Loaded only when named**: nothing reads `Bun` until this function is called,
|
|
38
|
+
* so the package imports cleanly under Node. On Node, `scryptHasher()` is the
|
|
39
|
+
* hasher; a hash written here reads anywhere a verifier for `$argon2id$` is
|
|
40
|
+
* wired, so a database can move between the two runtimes.
|
|
41
|
+
*
|
|
42
|
+
* **Concurrency.** Each call holds 64 MiB (`memoryCost`) while it runs, so a
|
|
43
|
+
* burst of verifies — a credential-stuffing run, including the dummy verify of
|
|
44
|
+
* an unknown e-mail — would otherwise allocate without bound. `concurrency`
|
|
45
|
+
* caps how many `hash` and `verify` calls run at once, per hasher (default 4,
|
|
46
|
+
* about 256 MiB); calls past the cap wait their turn, in order. The
|
|
47
|
+
* application's sign-in throttle still applies on top.
|
|
48
|
+
*/
|
|
49
|
+
export declare function bunHasher(options?: {
|
|
50
|
+
readonly concurrency?: number;
|
|
51
|
+
}): PasswordHasher;
|
|
52
|
+
//# sourceMappingURL=hashers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hashers.d.ts","sourceRoot":"","sources":["../../src/auth/hashers.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE/C;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,YAAY,CAAC,OAAO,CAAC,EAAE;IACtC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;CAC9B,GAAG,cAAc,CAwDjB;AA+BD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,SAAS,CAAC,OAAO,CAAC,EAAE;IACnC,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;CAC9B,GAAG,cAAc,CAoBjB"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export type { ApiKeysConfig, CookieConfig, DevicesConfig, FieldsJson, InvitationsConfig, JanusConfig, MagicLinkConfig, MailConfig, MailThrottleConfig, MultiTypeConfig, Normalize, PasskeysConfig, PasswordConfig, PasswordHasher, SecondFactorConfig, SecondFactorThrottleConfig, SessionConfig, SignInConfig, SignInThrottleConfig, SingleTypeConfig, SocialConfig, SocialIdentity, SocialProfile, SocialProvider, SocialProviderResolver, SocialStepUpRequest, UserSchema, UserTypeConfig, } from './config';
|
|
2
|
+
export { DEVICE_COOKIE, type DeviceCookieOptions, deviceCookie, deviceFromCookieHeader, } from './devices/cookie';
|
|
3
|
+
export type { UserEvent, UserEventListener, UserEventType, } from './events';
|
|
4
|
+
export { bunHasher, scryptHasher } from './hashers';
|
|
5
|
+
export type { InvitationEvent, InvitationEventListener, InvitationEventType, } from './invitations/events';
|
|
6
|
+
export { createJanusIssuers, type JanusIssuerKey, type JanusIssuers, type JanusIssuersCache, type JanusIssuersOptions, } from './issuers';
|
|
7
|
+
export { janus } from './janus';
|
|
8
|
+
export { type ParseSealingKeysOptions, parseSealingKeys, } from './parse-sealing-keys';
|
|
9
|
+
export type { PasskeyAssertion, PasskeyCredential, PasskeyDescriptor, PasskeyRefusal, PasskeyRefusalReason, PasskeyRegistration, PasskeyRelyingParty, PasskeyUser, PasskeyVerifier, } from './passkeys/verifier';
|
|
10
|
+
export { type ApiKeyStoreCapabilities, assertApiKeyStore, } from './port/assert-api-keys';
|
|
11
|
+
export { assertInvitationStore, type InvitationStoreCapabilities, } from './port/assert-invitations';
|
|
12
|
+
export { assertStores } from './port/assert-stores';
|
|
13
|
+
export { createMemoryApiKeys, createMemoryInvitations, createMemoryStores, } from './port/memory';
|
|
14
|
+
export type { ApiKeyBound, ApiKeyBoundMethods, ApiKeyExpiringRequest, ApiKeyExpiryNoticeMethods, ApiKeyId, ApiKeyPageRequest, ApiKeyRecord, ApiKeyStore, ApiKeyStoreBase, ApiKeyUserBoundMethods, AvatarRecord, InvitationFilter, InvitationId, InvitationLapsedFilter, InvitationPageRequest, InvitationPatch, InvitationRecord, InvitationStatus, InvitationStore, JanusStores, Json, JsonObject, PasskeyRecord, PasskeyStore, PasskeyUse, PasswordRecord, SecondFactorRecord, SessionId, SessionRecord, SessionStore, SocialLinkRecord, SocialLinkStore, StoreCapabilities, TokenKind, TokenRecord, TokenStore, UserFilter, UserPageRequest, UserPatch, UserRecord, UserStore, } from './port/types';
|
|
15
|
+
export { type PurposeSealer, sealerFor } from './sealer-for';
|
|
16
|
+
export type { SealingKey } from './sealing';
|
|
17
|
+
export { AMR, isMultiFactor } from './sessions/amr';
|
|
18
|
+
export { assertFresh } from './sessions/fresh';
|
|
19
|
+
export { isReturnTo } from './social/return-to';
|
|
20
|
+
export type { StandardSchemaV1 } from './standard-schema';
|
|
21
|
+
export type { AcceptedInvitation, AnyTypeChangeEmailApi, AnyTypeResetPasswordApi, AnyTypeVerifyEmailApi, ApiKey, ApiKeyListOptions, ApiKeyPage, ApiKeysApi, Authenticated, AvatarApi, ChangeEmailApi, Checked, CreateApiKeyInput, CreatedApiKey, EmailOf, FindByEmailApi, FindOrCreateApi, FirstProof, HeaderRecord, HistoryRecord, HistoryRefusal, ImportHistoryItem, ImportHistoryOptions, ImportHistoryReport, Invitation, InvitationPreview, InvitationsApi, IssuedCode, IssuedInvitation, IssuedToken, Janus, KeyAuthenticated, LoginOf, MagicLinkApi, Passkey, PasskeyFirstFactorApi, PasskeyRegistrationOptions, PasskeySignInApi, PasskeySignInChallenge, PasskeysApi, PasswordApi, PreparedCode, PreparedRequest, Principal, ProvenSignInApi, RecoveredSignIn, RecoveryCodesIssued, RequestLike, RequiredStringKeys, ResetPasswordApi, SecondFactorApi, SecondFactorEnrolment, SecondFactorMethod, SecondFactorRequired, SecondFactorResealed, Session, SharedApi, SignedIn, SignInCodeApi, SignInOptions, SignInResult, SocialApi, SocialCompleted, SocialFlowStart, SocialLink, SocialLinked, SocialStepUp, SocialStepUpProof, SpentRecoveryCode, StepUpApi, StepUpByApp, StepUpByEmail, StepUpByPasskey, StepUpPasskeyApi, TypeApi, TypesOf, User, UserAvatar, UserBase, UserOf, UserRef, UserTypeApi, VerifyEmailApi, WriteOptions, } from './types';
|
|
22
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/auth/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACX,aAAa,EACb,YAAY,EACZ,aAAa,EACb,UAAU,EACV,iBAAiB,EACjB,WAAW,EACX,eAAe,EACf,UAAU,EACV,kBAAkB,EAClB,eAAe,EACf,SAAS,EACT,cAAc,EACd,cAAc,EACd,cAAc,EACd,kBAAkB,EAClB,0BAA0B,EAC1B,aAAa,EACb,YAAY,EACZ,oBAAoB,EACpB,gBAAgB,EAChB,YAAY,EACZ,cAAc,EACd,aAAa,EACb,cAAc,EACd,sBAAsB,EACtB,mBAAmB,EACnB,UAAU,EACV,cAAc,GACd,MAAM,UAAU,CAAC;AAClB,OAAO,EACN,aAAa,EACb,KAAK,mBAAmB,EACxB,YAAY,EACZ,sBAAsB,GACtB,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EACX,SAAS,EACT,iBAAiB,EACjB,aAAa,GACb,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACpD,YAAY,EACX,eAAe,EACf,uBAAuB,EACvB,mBAAmB,GACnB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACN,kBAAkB,EAClB,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,GACxB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EACN,KAAK,uBAAuB,EAC5B,gBAAgB,GAChB,MAAM,sBAAsB,CAAC;AAC9B,YAAY,EACX,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,EACjB,cAAc,EACd,oBAAoB,EACpB,mBAAmB,EACnB,mBAAmB,EACnB,WAAW,EACX,eAAe,GACf,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACN,KAAK,uBAAuB,EAC5B,iBAAiB,GACjB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACN,qBAAqB,EACrB,KAAK,2BAA2B,GAChC,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EACN,mBAAmB,EACnB,uBAAuB,EACvB,kBAAkB,GAClB,MAAM,eAAe,CAAC;AACvB,YAAY,EACX,WAAW,EACX,kBAAkB,EAClB,qBAAqB,EACrB,yBAAyB,EACzB,QAAQ,EACR,iBAAiB,EACjB,YAAY,EACZ,WAAW,EACX,eAAe,EACf,sBAAsB,EACtB,YAAY,EACZ,gBAAgB,EAChB,YAAY,EACZ,sBAAsB,EACtB,qBAAqB,EACrB,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,EACf,WAAW,EACX,IAAI,EACJ,UAAU,EACV,aAAa,EACb,YAAY,EACZ,UAAU,EACV,cAAc,EACd,kBAAkB,EAClB,SAAS,EACT,aAAa,EACb,YAAY,EACZ,gBAAgB,EAChB,eAAe,EACf,iBAAiB,EACjB,SAAS,EACT,WAAW,EACX,UAAU,EACV,UAAU,EACV,eAAe,EACf,SAAS,EACT,UAAU,EACV,SAAS,GACT,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,KAAK,aAAa,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC7D,YAAY,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,GAAG,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,YAAY,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,YAAY,EACX,kBAAkB,EAClB,qBAAqB,EACrB,uBAAuB,EACvB,qBAAqB,EACrB,MAAM,EACN,iBAAiB,EACjB,UAAU,EACV,UAAU,EACV,aAAa,EACb,SAAS,EACT,cAAc,EACd,OAAO,EACP,iBAAiB,EACjB,aAAa,EACb,OAAO,EACP,cAAc,EACd,eAAe,EACf,UAAU,EACV,YAAY,EACZ,aAAa,EACb,cAAc,EACd,iBAAiB,EACjB,oBAAoB,EACpB,mBAAmB,EACnB,UAAU,EACV,iBAAiB,EACjB,cAAc,EACd,UAAU,EACV,gBAAgB,EAChB,WAAW,EACX,KAAK,EACL,gBAAgB,EAChB,OAAO,EACP,YAAY,EACZ,OAAO,EACP,qBAAqB,EACrB,0BAA0B,EAC1B,gBAAgB,EAChB,sBAAsB,EACtB,WAAW,EACX,WAAW,EACX,YAAY,EACZ,eAAe,EACf,SAAS,EACT,eAAe,EACf,eAAe,EACf,mBAAmB,EACnB,WAAW,EACX,kBAAkB,EAClB,gBAAgB,EAChB,eAAe,EACf,qBAAqB,EACrB,kBAAkB,EAClB,oBAAoB,EACpB,oBAAoB,EACpB,OAAO,EACP,SAAS,EACT,QAAQ,EACR,aAAa,EACb,aAAa,EACb,YAAY,EACZ,SAAS,EACT,eAAe,EACf,eAAe,EACf,UAAU,EACV,YAAY,EACZ,YAAY,EACZ,iBAAiB,EACjB,iBAAiB,EACjB,SAAS,EACT,WAAW,EACX,aAAa,EACb,eAAe,EACf,gBAAgB,EAChB,OAAO,EACP,OAAO,EACP,IAAI,EACJ,UAAU,EACV,QAAQ,EACR,MAAM,EACN,OAAO,EACP,WAAW,EACX,cAAc,EACd,YAAY,GACZ,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** `invitations.accept`: claim, make the invitee a user, tell the application, sign them in. */
|
|
2
|
+
import type { Context } from '../context';
|
|
3
|
+
import type { InvitationStore } from '../port/types';
|
|
4
|
+
import type { AcceptedInvitation, InvitationsApi } from '../types';
|
|
5
|
+
import { type InvitedType } from './invited-type';
|
|
6
|
+
type Settings = NonNullable<Context['config']['invitations']>;
|
|
7
|
+
type AcceptInput = Parameters<InvitationsApi['invitations']['accept']>[0];
|
|
8
|
+
export declare function acceptInvitation(context: Context, settings: Settings, invitations: InvitationStore, invited: InvitedType, input: AcceptInput): Promise<AcceptedInvitation>;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=accept.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accept.d.ts","sourceRoot":"","sources":["../../../src/auth/invitations/accept.ts"],"names":[],"mappings":"AAAA,gGAAgG;AAKhG,OAAO,KAAK,EAAW,OAAO,EAAE,MAAM,YAAY,CAAC;AAEnD,OAAO,KAAK,EAAoB,eAAe,EAAE,MAAM,eAAe,CAAC;AAEvE,OAAO,KAAK,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAWnE,OAAO,EAAkB,KAAK,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAMlE,KAAK,QAAQ,GAAG,WAAW,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC;AAC9D,KAAK,WAAW,GAAG,UAAU,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAS1E,wBAAsB,gBAAgB,CACrC,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,QAAQ,EAClB,WAAW,EAAE,eAAe,EAC5B,OAAO,EAAE,WAAW,EACpB,KAAK,EAAE,WAAW,GAChB,OAAO,CAAC,kBAAkB,CAAC,CA0C7B"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/** Applies a patch to a pending invitation of one scope, under its version. */
|
|
2
|
+
import type { Clock } from '../../time/clock';
|
|
3
|
+
import type { InvitationPatch, InvitationRecord, InvitationStore } from '../port/types';
|
|
4
|
+
/**
|
|
5
|
+
* `NOT_FOUND` for an invitation that is not in this scope, whatever the
|
|
6
|
+
* reason; `INVITATION_NOT_PENDING` for one that is final. `before` runs on the
|
|
7
|
+
* pending record just before its write, and may refuse it. A version that
|
|
8
|
+
* moved meanwhile is read again, a few times.
|
|
9
|
+
*/
|
|
10
|
+
export declare function changePending(invitations: InvitationStore, clock: Clock, where: string, input: {
|
|
11
|
+
readonly id: string;
|
|
12
|
+
readonly scope: string;
|
|
13
|
+
}, patch: (now: Date) => Omit<InvitationPatch, 'updatedAt'>, before?: (found: InvitationRecord, now: Date) => Promise<void>): Promise<{
|
|
14
|
+
readonly record: InvitationRecord;
|
|
15
|
+
readonly now: Date;
|
|
16
|
+
}>;
|
|
17
|
+
//# sourceMappingURL=change-pending.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"change-pending.d.ts","sourceRoot":"","sources":["../../../src/auth/invitations/change-pending.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAQ/E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,KAAK,EACX,eAAe,EACf,gBAAgB,EAChB,eAAe,EACf,MAAM,eAAe,CAAC;AAKvB;;;;;GAKG;AACH,wBAAsB,aAAa,CAClC,WAAW,EAAE,eAAe,EAC5B,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,MAAM,EACb,KAAK,EAAE;IAAE,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CAAE,EACtD,KAAK,EAAE,CAAC,GAAG,EAAE,IAAI,KAAK,IAAI,CAAC,eAAe,EAAE,WAAW,CAAC,EACxD,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,gBAAgB,EAAE,GAAG,EAAE,IAAI,KAAK,OAAO,CAAC,IAAI,CAAC,GAC5D,OAAO,CAAC;IAAE,QAAQ,CAAC,MAAM,EAAE,gBAAgB,CAAC;IAAC,QAAQ,CAAC,GAAG,EAAE,IAAI,CAAA;CAAE,CAAC,CAgCpE"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/** The claim on an invitation `accept` makes, and its release. */
|
|
2
|
+
import { InvitationInvalidError, type InvitationRefusal } from '../../errors/janus-error';
|
|
3
|
+
import type { Clock } from '../../time/clock';
|
|
4
|
+
import type { InvitationRecord, InvitationStore } from '../port/types';
|
|
5
|
+
/**
|
|
6
|
+
* The refusal for every code that cannot be accepted: one code, `INVITATION_INVALID`,
|
|
7
|
+
* with `reason` saying why when the invitation is known (`unknown` otherwise,
|
|
8
|
+
* and for what nothing may tell from an unknown code: an inactive account,
|
|
9
|
+
* a login taken, a claim lost to a concurrent write).
|
|
10
|
+
*/
|
|
11
|
+
export declare function invalidCode(where: string, reason?: InvitationRefusal): InvitationInvalidError;
|
|
12
|
+
/** Why a record cannot be used: `accepted` or `revoked` by its status, `expired` when pending past its lifetime, `null` when it can. */
|
|
13
|
+
export declare function refusalOf(clock: Clock, found: InvitationRecord): InvitationRefusal | null;
|
|
14
|
+
/**
|
|
15
|
+
* Moves a pending, unlapsed invitation to `accepted` under its version: of
|
|
16
|
+
* concurrent claims on one version exactly one wins, and the others — or an
|
|
17
|
+
* accept racing a `resend` or a `revoke` — are `INVITATION_INVALID`.
|
|
18
|
+
*/
|
|
19
|
+
export declare function claim(invitations: InvitationStore, clock: Clock, found: InvitationRecord | null, where: string): Promise<InvitationRecord>;
|
|
20
|
+
/** The invitation when it is pending and unlapsed, else the one refusal; writes nothing. */
|
|
21
|
+
export declare function pendingRecord(clock: Clock, found: InvitationRecord | null, where: string): InvitationRecord;
|
|
22
|
+
/** Records who accepted, still under the claim. */
|
|
23
|
+
export declare function recordAcceptor(invitations: InvitationStore, clock: Clock, claimed: InvitationRecord, userId: InvitationRecord['acceptedBy'], where: string): Promise<InvitationRecord>;
|
|
24
|
+
/**
|
|
25
|
+
* Puts a claimed invitation back to `pending`, as it was. Never throws: the
|
|
26
|
+
* failure that made the release necessary is the one the caller sees, so a
|
|
27
|
+
* release that fails too (a store outage, or a newer pending invitation
|
|
28
|
+
* for the same address that took the place meanwhile) is a warning.
|
|
29
|
+
*/
|
|
30
|
+
export declare function release(invitations: InvitationStore, clock: Clock, claimed: InvitationRecord): Promise<void>;
|
|
31
|
+
//# sourceMappingURL=claim.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claim.d.ts","sourceRoot":"","sources":["../../../src/auth/invitations/claim.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAElE,OAAO,EACN,sBAAsB,EACtB,KAAK,iBAAiB,EACtB,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,KAAK,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAGvE;;;;;GAKG;AACH,wBAAgB,WAAW,CAC1B,KAAK,EAAE,MAAM,EACb,MAAM,GAAE,iBAA6B,GACnC,sBAAsB,CAKxB;AAED,wIAAwI;AACxI,wBAAgB,SAAS,CACxB,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,gBAAgB,GACrB,iBAAiB,GAAG,IAAI,CAK1B;AAED;;;;GAIG;AACH,wBAAsB,KAAK,CAC1B,WAAW,EAAE,eAAe,EAC5B,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,gBAAgB,GAAG,IAAI,EAC9B,KAAK,EAAE,MAAM,GACX,OAAO,CAAC,gBAAgB,CAAC,CAU3B;AAED,4FAA4F;AAC5F,wBAAgB,aAAa,CAC5B,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,gBAAgB,GAAG,IAAI,EAC9B,KAAK,EAAE,MAAM,GACX,gBAAgB,CAKlB;AAED,mDAAmD;AACnD,wBAAsB,cAAc,CACnC,WAAW,EAAE,eAAe,EAC5B,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,gBAAgB,EACzB,MAAM,EAAE,gBAAgB,CAAC,YAAY,CAAC,EACtC,KAAK,EAAE,MAAM,GACX,OAAO,CAAC,gBAAgB,CAAC,CAS3B;AAED;;;;;GAKG;AACH,wBAAsB,OAAO,CAC5B,WAAW,EAAE,eAAe,EAC5B,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,gBAAgB,GACvB,OAAO,CAAC,IAAI,CAAC,CAmBf"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/** The events `janus({ invitations: { events } })` is called with, and the step that sends one. */
|
|
2
|
+
import { type Id } from '../../ids/id';
|
|
3
|
+
/**
|
|
4
|
+
* What happened to an invitation, once it is written:
|
|
5
|
+
*
|
|
6
|
+
* - `invitation.issued` — by `issue`, once the invitation is stored;
|
|
7
|
+
* - `invitation.resent` — by `resend`: the old code stopped working;
|
|
8
|
+
* - `invitation.revoked` — by `revoke`, and by an `issue` that took the place
|
|
9
|
+
* of a pending invitation for the same address;
|
|
10
|
+
* - `invitation.accepted` — by `accept`, once the invitee is a user and the
|
|
11
|
+
* application's `onAccepted` returned.
|
|
12
|
+
*/
|
|
13
|
+
export type InvitationEventType = 'invitation.issued' | 'invitation.resent' | 'invitation.revoked' | 'invitation.accepted';
|
|
14
|
+
/**
|
|
15
|
+
* An invitation event: **the invitation named by id and scope, and nothing
|
|
16
|
+
* else** — never the invited address, the name or the code. Whoever receives
|
|
17
|
+
* it reads the rest from where it is kept, if they may.
|
|
18
|
+
*/
|
|
19
|
+
export interface InvitationEvent {
|
|
20
|
+
/** A UUIDv7 minted for this event: the key to deliver it once. */
|
|
21
|
+
readonly id: Id;
|
|
22
|
+
readonly type: InvitationEventType;
|
|
23
|
+
/** When the write landed: the `updatedAt` it wrote, not when the listener ran. */
|
|
24
|
+
readonly occurredAt: Date;
|
|
25
|
+
readonly invitationId: string;
|
|
26
|
+
readonly scope: string;
|
|
27
|
+
/** Who sent the invitation, or `null` when the system did. */
|
|
28
|
+
readonly invitedBy: Id | null;
|
|
29
|
+
/** Who acted (`revoke` and `resend`'s `by`); absent when the call named nobody. */
|
|
30
|
+
readonly by?: string;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* What `janus({ invitations: { events } })` takes: called once per event,
|
|
34
|
+
* **after** the write landed and before the call answers — awaited. A
|
|
35
|
+
* listener that throws fails nothing: the write happened, and the call
|
|
36
|
+
* answers as it would have. The failure is a `JANUS_EVENT_FAILED` warning
|
|
37
|
+
* naming the event, never silence.
|
|
38
|
+
*/
|
|
39
|
+
export type InvitationEventListener = (event: InvitationEvent) => void | Promise<void>;
|
|
40
|
+
/** Hands one event to the listener after the write it reports. */
|
|
41
|
+
export declare function emitInvitation(listener: InvitationEventListener | null, type: InvitationEventType, invitation: {
|
|
42
|
+
readonly id: string;
|
|
43
|
+
readonly scope: string;
|
|
44
|
+
readonly invitedBy: Id | null;
|
|
45
|
+
}, occurredAt: Date, by?: string): Promise<void>;
|
|
46
|
+
//# sourceMappingURL=events.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../../src/auth/invitations/events.ts"],"names":[],"mappings":"AAAA,mGAAmG;AAEnG,OAAO,EAAE,KAAK,EAAE,EAAU,MAAM,cAAc,CAAC;AAE/C;;;;;;;;;GASG;AACH,MAAM,MAAM,mBAAmB,GAC5B,mBAAmB,GACnB,mBAAmB,GACnB,oBAAoB,GACpB,qBAAqB,CAAC;AAEzB;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC/B,kEAAkE;IAClE,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAC;IAChB,QAAQ,CAAC,IAAI,EAAE,mBAAmB,CAAC;IACnC,kFAAkF;IAClF,QAAQ,CAAC,UAAU,EAAE,IAAI,CAAC;IAC1B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,8DAA8D;IAC9D,QAAQ,CAAC,SAAS,EAAE,EAAE,GAAG,IAAI,CAAC;IAC9B,mFAAmF;IACnF,QAAQ,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;GAMG;AACH,MAAM,MAAM,uBAAuB,GAAG,CACrC,KAAK,EAAE,eAAe,KAClB,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;AAE1B,kEAAkE;AAClE,wBAAsB,cAAc,CACnC,QAAQ,EAAE,uBAAuB,GAAG,IAAI,EACxC,IAAI,EAAE,mBAAmB,EACzB,UAAU,EAAE;IACX,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,SAAS,EAAE,EAAE,GAAG,IAAI,CAAC;CAC9B,EACD,UAAU,EAAE,IAAI,EAChB,EAAE,CAAC,EAAE,MAAM,GACT,OAAO,CAAC,IAAI,CAAC,CAoBf"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/** The user who holds an invitation's address, found or made, shared by the invitees of both kinds of user type. */
|
|
2
|
+
import type { AnyUser } from '../context';
|
|
3
|
+
import type { Invitation } from '../types';
|
|
4
|
+
import type { AnyTypeApi } from '../users/any-type-api';
|
|
5
|
+
export type Create = (invitation: Invitation) => Record<string, unknown> | Promise<Record<string, unknown>>;
|
|
6
|
+
/** The invitee, and whether accepting proved their e-mail now (`false`: they are left as they are and sign in themselves). */
|
|
7
|
+
export interface Invitee {
|
|
8
|
+
readonly user: AnyUser;
|
|
9
|
+
readonly proved: boolean;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* The user who holds the invitation's address, made by `make` when nobody
|
|
13
|
+
* does. A second login already taken by the new user, or an inactive account,
|
|
14
|
+
* is as unknown as a spent code.
|
|
15
|
+
*/
|
|
16
|
+
export declare function findInvitee(typed: AnyTypeApi, invitation: Invitation, make: () => Promise<Record<string, unknown>>, where: string): Promise<{
|
|
17
|
+
readonly user: AnyUser;
|
|
18
|
+
readonly created: boolean;
|
|
19
|
+
}>;
|
|
20
|
+
//# sourceMappingURL=find-invitee.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"find-invitee.d.ts","sourceRoot":"","sources":["../../../src/auth/invitations/find-invitee.ts"],"names":[],"mappings":"AAAA,oHAAoH;AAGpH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAGxD,MAAM,MAAM,MAAM,GAAG,CACpB,UAAU,EAAE,UAAU,KAClB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;AAEhE,8HAA8H;AAC9H,MAAM,WAAW,OAAO;IACvB,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;CACzB;AAED;;;;GAIG;AACH,wBAAsB,WAAW,CAChC,KAAK,EAAE,UAAU,EACjB,UAAU,EAAE,UAAU,EACtB,IAAI,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EAC5C,KAAK,EAAE,MAAM,GACX,OAAO,CAAC;IAAE,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;CAAE,CAAC,CAiBhE"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** The pending invitation an address holds in a scope, lapsed or not. */
|
|
2
|
+
import type { InvitationRecord, InvitationStore } from '../port/types';
|
|
3
|
+
/** The pending invitation of an address in a scope — lapsed or not — or `null`. */
|
|
4
|
+
export declare function findPending(invitations: InvitationStore, scope: string, email: string): Promise<InvitationRecord | null>;
|
|
5
|
+
//# sourceMappingURL=find-pending.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"find-pending.d.ts","sourceRoot":"","sources":["../../../src/auth/invitations/find-pending.ts"],"names":[],"mappings":"AAAA,yEAAyE;AAGzE,OAAO,KAAK,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAEvE,mFAAmF;AACnF,wBAAsB,WAAW,CAChC,WAAW,EAAE,eAAe,EAC5B,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,GACX,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAgBlC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** The `auth.invitations` surface: issue, resend, revoke, list, preview, accept. */
|
|
2
|
+
import type { Context } from '../context';
|
|
3
|
+
import type { InvitationStore } from '../port/types';
|
|
4
|
+
import type { InvitationsApi } from '../types';
|
|
5
|
+
/** The `invitations` of an instance whose `janus()` was given `invitations`. */
|
|
6
|
+
export declare function invitationsApi(context: Context, invitations: InvitationStore): InvitationsApi['invitations'];
|
|
7
|
+
//# sourceMappingURL=flows.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flows.d.ts","sourceRoot":"","sources":["../../../src/auth/invitations/flows.ts"],"names":[],"mappings":"AAAA,oFAAoF;AAEpF,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAa/C,gFAAgF;AAChF,wBAAgB,cAAc,CAC7B,OAAO,EAAE,OAAO,EAChB,WAAW,EAAE,eAAe,GAC1B,cAAc,CAAC,aAAa,CAAC,CA4D/B"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/** One record of `invitations.importHistory`, checked into an `InvitationRecord` or a refusal that names a shape, never a value. */
|
|
2
|
+
import type { Context } from '../context';
|
|
3
|
+
import type { InvitationRecord } from '../port/types';
|
|
4
|
+
import type { HistoryRefusal } from '../types';
|
|
5
|
+
type Settings = NonNullable<Context['config']['invitations']>;
|
|
6
|
+
/** The longest `key` the application may give. */
|
|
7
|
+
export declare const KEY_MAX = 100;
|
|
8
|
+
/** A record that cannot be imported: why, and on which field when it is `invalid`. */
|
|
9
|
+
export interface Refused {
|
|
10
|
+
readonly ok: false;
|
|
11
|
+
readonly key: string | null;
|
|
12
|
+
readonly id: string | null;
|
|
13
|
+
readonly reason: HistoryRefusal;
|
|
14
|
+
readonly field?: string;
|
|
15
|
+
}
|
|
16
|
+
/** A record ready for the store. */
|
|
17
|
+
export interface Checked {
|
|
18
|
+
readonly ok: true;
|
|
19
|
+
readonly key: string;
|
|
20
|
+
readonly record: InvitationRecord;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Checks `input` — anything an application passed — and builds the record the
|
|
24
|
+
* store keeps: the derived id and unusable code hash, `version: 0`, the
|
|
25
|
+
* dates the record gave and the defaults the rest take.
|
|
26
|
+
*/
|
|
27
|
+
export declare function checkHistoryRecord(context: Context, settings: Settings, input: unknown): Checked | Refused;
|
|
28
|
+
export {};
|
|
29
|
+
//# sourceMappingURL=history-input.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"history-input.d.ts","sourceRoot":"","sources":["../../../src/auth/invitations/history-input.ts"],"names":[],"mappings":"AAAA,oIAAoI;AAIpI,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAW/C,KAAK,QAAQ,GAAG,WAAW,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC;AAE9D,kDAAkD;AAClD,eAAO,MAAM,OAAO,MAAM,CAAC;AAE3B,sFAAsF;AACtF,MAAM,WAAW,OAAO;IACvB,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC;IACnB,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,QAAQ,CAAC,MAAM,EAAE,cAAc,CAAC;IAChC,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,oCAAoC;AACpC,MAAM,WAAW,OAAO;IACvB,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC;IAClB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,MAAM,EAAE,gBAAgB,CAAC;CAClC;AAgFD;;;;GAIG;AACH,wBAAgB,kBAAkB,CACjC,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,OAAO,GACZ,OAAO,GAAG,OAAO,CAuEnB"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** `invitations.importHistory`: copies the old system's invitations in as history, once each, with no event, mail or code. */
|
|
2
|
+
import type { Context } from '../context';
|
|
3
|
+
import type { InvitationStore } from '../port/types';
|
|
4
|
+
import type { ImportHistoryReport } from '../types';
|
|
5
|
+
/** At most this many records per call: a bigger import is cut into calls. */
|
|
6
|
+
export declare const IMPORT_MAX = 1000;
|
|
7
|
+
type Settings = NonNullable<Context['config']['invitations']>;
|
|
8
|
+
export declare function importHistory(context: Context, settings: Settings, invitations: InvitationStore, records: unknown, options: unknown): Promise<ImportHistoryReport>;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=history.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"history.d.ts","sourceRoot":"","sources":["../../../src/auth/invitations/history.ts"],"names":[],"mappings":"AAAA,8HAA8H;AAE9H,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,KAAK,EAGX,mBAAmB,EACnB,MAAM,UAAU,CAAC;AAKlB,6EAA6E;AAC7E,eAAO,MAAM,UAAU,OAAO,CAAC;AAE/B,KAAK,QAAQ,GAAG,WAAW,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC;AAkC9D,wBAAsB,aAAa,CAClC,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,QAAQ,EAClB,WAAW,EAAE,eAAe,EAC5B,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,GACd,OAAO,CAAC,mBAAmB,CAAC,CAqE9B"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Invitations: the flows `auth.invitations` answers (`flows.ts`, `issue.ts`, `history.ts`),
|
|
3
|
+
* what they accept (`input.ts`), the events (`events.ts`) and the conversion
|
|
4
|
+
* to what the application sees (`to-invitation.ts`).
|
|
5
|
+
*
|
|
6
|
+
* Gathered here from the files beside this one.
|
|
7
|
+
*/
|
|
8
|
+
export type { InvitationEvent, InvitationEventListener, InvitationEventType, } from './events';
|
|
9
|
+
export { invitationsApi } from './flows';
|
|
10
|
+
export { toInvitation } from './to-invitation';
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/auth/invitations/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,YAAY,EACX,eAAe,EACf,uBAAuB,EACvB,mBAAmB,GACnB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/** What `invitations.issue` and its siblings accept from the application, refused as `INVITATION_INVALID` or `NOT_FOUND` when they are not. */
|
|
2
|
+
import type { UserRef } from '../types';
|
|
3
|
+
export declare const SCOPE_MAX = 512;
|
|
4
|
+
export declare const ROLE_MAX = 100;
|
|
5
|
+
export declare const NAME_MAX = 100;
|
|
6
|
+
export declare const EMAIL_MAX = 254;
|
|
7
|
+
export declare const LOCALE_MAX = 35;
|
|
8
|
+
export declare const REF_MAX = 100;
|
|
9
|
+
/** A string of 1 to `max` characters once trimmed that every store can keep, or `null` when it is not one. */
|
|
10
|
+
export declare function shapedText(value: unknown, max: number, trim: boolean): string | null;
|
|
11
|
+
/** The address in the shape of one, normalised the way every e-mail is, or `null`. */
|
|
12
|
+
export declare function shapedEmail(value: unknown): string | null;
|
|
13
|
+
/** A scope is the application's own string, kept as given. */
|
|
14
|
+
export declare function scopeOf(where: string, value: unknown): string;
|
|
15
|
+
export declare function nameOf(where: string, value: unknown): string;
|
|
16
|
+
export declare function roleOf(where: string, value: unknown): string;
|
|
17
|
+
export declare function localeOf(where: string, value: unknown): string | null;
|
|
18
|
+
/** The application's opaque reference, kept as given, or `null`. */
|
|
19
|
+
export declare function refOf(where: string, value: unknown): string | null;
|
|
20
|
+
/** The address, normalised the way every e-mail is, with the shape of one. */
|
|
21
|
+
export declare function emailOf(where: string, value: unknown): string;
|
|
22
|
+
/**
|
|
23
|
+
* The id of the inviter, from a user or an id, or `null` for the system
|
|
24
|
+
* (`invitedBy: null`). `undefined` is not `null`: a forgotten inviter is
|
|
25
|
+
* refused rather than read as a system issue.
|
|
26
|
+
*/
|
|
27
|
+
export declare function inviterOf(where: string, value: UserRef | null): string | null;
|
|
28
|
+
/** Whether `code` has the shape `issue` mints. Anything else names no invitation. */
|
|
29
|
+
export declare function isCode(code: unknown): code is string;
|
|
30
|
+
//# sourceMappingURL=input.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../../src/auth/invitations/input.ts"],"names":[],"mappings":"AAAA,+IAA+I;AAO/I,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAExC,eAAO,MAAM,SAAS,MAAM,CAAC;AAC7B,eAAO,MAAM,QAAQ,MAAM,CAAC;AAC5B,eAAO,MAAM,QAAQ,MAAM,CAAC;AAC5B,eAAO,MAAM,SAAS,MAAM,CAAC;AAC7B,eAAO,MAAM,UAAU,KAAK,CAAC;AAC7B,eAAO,MAAM,OAAO,MAAM,CAAC;AAI3B,8GAA8G;AAC9G,wBAAgB,UAAU,CACzB,KAAK,EAAE,OAAO,EACd,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,OAAO,GACX,MAAM,GAAG,IAAI,CAWf;AAED,sFAAsF;AACtF,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CASzD;AAoBD,8DAA8D;AAC9D,wBAAgB,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,MAAM,CAE7D;AAED,wBAAgB,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,MAAM,CAE5D;AAED,wBAAgB,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,MAAM,CAE5D;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAGrE;AAED,oEAAoE;AACpE,wBAAgB,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAGlE;AAED,8EAA8E;AAC9E,wBAAgB,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,MAAM,CAU7D;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI,GAAG,MAAM,GAAG,IAAI,CAU7E;AAED,qFAAqF;AACrF,wBAAgB,MAAM,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,IAAI,MAAM,CAEpD"}
|