@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,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resolves a model: parses every string once, checks every reference, and
|
|
3
|
+
* refuses with a `TypeError` naming where it is.
|
|
4
|
+
*
|
|
5
|
+
* The types refuse most of these first. This is what refuses them for a model
|
|
6
|
+
* built at run time or written in JavaScript, and what refuses what the types
|
|
7
|
+
* cannot see: names, and a permission that reaches itself without crossing a
|
|
8
|
+
* relation.
|
|
9
|
+
*/
|
|
10
|
+
import type { ModelConfig } from '../model/config';
|
|
11
|
+
import type { ResolvedModel } from './resolved';
|
|
12
|
+
export declare function resolveModel(config: ModelConfig, where: string): ResolvedModel;
|
|
13
|
+
//# sourceMappingURL=resolve-model.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve-model.d.ts","sourceRoot":"","sources":["../../../src/permissions/resolve/resolve-model.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAWnD,OAAO,KAAK,EACX,aAAa,EAIb,MAAM,YAAY,CAAC;AAGpB,wBAAgB,YAAY,CAC3B,MAAM,EAAE,WAAW,EACnB,KAAK,EAAE,MAAM,GACX,aAAa,CAkBf"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** One relation of an object type: its holders, or the field `fromField` reads. */
|
|
2
|
+
import type { ResolvedRelation } from './resolved';
|
|
3
|
+
import { type Refuse } from './step';
|
|
4
|
+
export declare function resolveRelation(value: unknown, here: string, { refuse, isSubjectType, relationNames, }: {
|
|
5
|
+
refuse: Refuse;
|
|
6
|
+
isSubjectType: (type: string) => boolean;
|
|
7
|
+
relationNames: ReadonlyMap<string, ReadonlySet<string>>;
|
|
8
|
+
}): ResolvedRelation;
|
|
9
|
+
//# sourceMappingURL=resolve-relation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve-relation.d.ts","sourceRoot":"","sources":["../../../src/permissions/resolve/resolve-relation.ts"],"names":[],"mappings":"AAAA,mFAAmF;AAEnF,OAAO,KAAK,EAAU,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAC3D,OAAO,EAAY,KAAK,MAAM,EAAE,MAAM,QAAQ,CAAC;AAK/C,wBAAgB,eAAe,CAC9B,KAAK,EAAE,OAAO,EACd,IAAI,EAAE,MAAM,EACZ,EACC,MAAM,EACN,aAAa,EACb,aAAa,GACb,EAAE;IACF,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC;IACzC,aAAa,EAAE,WAAW,CAAC,MAAM,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC;CACxD,GACC,gBAAgB,CAkDlB"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** One rule of a permission: a name, an arrow, or either under `when()`. */
|
|
2
|
+
import type { ResolvedRelation, ResolvedRule } from './resolved';
|
|
3
|
+
import { type Refuse } from './step';
|
|
4
|
+
export declare function resolveRule(value: unknown, here: string, context: {
|
|
5
|
+
refuse: Refuse;
|
|
6
|
+
own: ReadonlySet<string>;
|
|
7
|
+
relations: ReadonlyMap<string, ResolvedRelation>;
|
|
8
|
+
typeNames: ReadonlySet<string>;
|
|
9
|
+
namesOf: (type: string) => ReadonlySet<string>;
|
|
10
|
+
self: string;
|
|
11
|
+
}): ResolvedRule;
|
|
12
|
+
//# sourceMappingURL=resolve-rule.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve-rule.d.ts","sourceRoot":"","sources":["../../../src/permissions/resolve/resolve-rule.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAE5E,OAAO,KAAK,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AACjE,OAAO,EAAY,KAAK,MAAM,EAAE,MAAM,QAAQ,CAAC;AAE/C,wBAAgB,WAAW,CAC1B,KAAK,EAAE,OAAO,EACd,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE;IACR,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACzB,SAAS,EAAE,WAAW,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;IACjD,SAAS,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC/B,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,WAAW,CAAC,MAAM,CAAC,CAAC;IAC/C,IAAI,EAAE,MAAM,CAAC;CACb,GACC,YAAY,CAoDd"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A model, resolved: what `can()`, `list()` and `grant()` read — every string
|
|
3
|
+
* already parsed, every reference already checked.
|
|
4
|
+
*/
|
|
5
|
+
import type { Subject } from '../../subjects/subject';
|
|
6
|
+
/** Who may hold a stored relation: a subject type, or a subject set. */
|
|
7
|
+
export type Holder = {
|
|
8
|
+
readonly kind: 'type';
|
|
9
|
+
readonly type: string;
|
|
10
|
+
} | {
|
|
11
|
+
readonly kind: 'set';
|
|
12
|
+
readonly type: string;
|
|
13
|
+
readonly relation: string;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Whether a stored relation admits `subject` as a holder: an entity of a
|
|
17
|
+
* declared type, or a set of a declared `type#relation`. One rule for what
|
|
18
|
+
* `grant()` writes and what `can()` and `list()` follow — a tuple the model
|
|
19
|
+
* does not admit grants nothing, however it was stored.
|
|
20
|
+
*/
|
|
21
|
+
export declare function admits(holders: readonly Holder[], subject: Subject): boolean;
|
|
22
|
+
export type ResolvedRelation = {
|
|
23
|
+
readonly kind: 'stored';
|
|
24
|
+
readonly holders: readonly Holder[];
|
|
25
|
+
} | {
|
|
26
|
+
readonly kind: 'fromField';
|
|
27
|
+
readonly field: string;
|
|
28
|
+
readonly subject: string;
|
|
29
|
+
/** What `list()` reverses it with. Absent: `list()` cannot reach through it. */
|
|
30
|
+
readonly lookup?: (subjectId: string) => Promise<readonly string[]>;
|
|
31
|
+
};
|
|
32
|
+
/** One rule of a permission. `test`, when present, must pass for it to grant. */
|
|
33
|
+
export type ResolvedRule = ({
|
|
34
|
+
readonly kind: 'name';
|
|
35
|
+
readonly name: string;
|
|
36
|
+
} | {
|
|
37
|
+
readonly kind: 'arrow';
|
|
38
|
+
readonly relation: string;
|
|
39
|
+
readonly target: string;
|
|
40
|
+
}) & {
|
|
41
|
+
readonly test?: (ctx: never) => boolean;
|
|
42
|
+
};
|
|
43
|
+
export interface ResolvedObjectType {
|
|
44
|
+
readonly name: string;
|
|
45
|
+
readonly relations: ReadonlyMap<string, ResolvedRelation>;
|
|
46
|
+
readonly permissions: ReadonlyMap<string, readonly ResolvedRule[]>;
|
|
47
|
+
}
|
|
48
|
+
export interface ResolvedModel {
|
|
49
|
+
readonly subjects: ReadonlySet<string>;
|
|
50
|
+
readonly types: ReadonlyMap<string, ResolvedObjectType>;
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=resolved.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolved.d.ts","sourceRoot":"","sources":["../../../src/permissions/resolve/resolved.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAEtD,wEAAwE;AACxE,MAAM,MAAM,MAAM,GACf;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAChD;IAAE,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC;AAE9E;;;;;GAKG;AACH,wBAAgB,MAAM,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,EAAE,OAAO,EAAE,OAAO,GAAG,OAAO,CAQ5E;AAED,MAAM,MAAM,gBAAgB,GACzB;IAAE,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,GAChE;IACA,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAC3B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,gFAAgF;IAChF,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC,SAAS,MAAM,EAAE,CAAC,CAAC;CACnE,CAAC;AAEL,iFAAiF;AACjF,MAAM,MAAM,YAAY,GAAG,CACxB;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAChD;IACA,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACvB,CACH,GAAG;IAAE,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG,EAAE,KAAK,KAAK,OAAO,CAAA;CAAE,CAAC;AAEhD,MAAM,WAAW,kBAAkB;IAClC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,SAAS,EAAE,WAAW,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;IAC1D,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC,MAAM,EAAE,SAAS,YAAY,EAAE,CAAC,CAAC;CACnE;AAED,MAAM,WAAW,aAAa;IAC7B,QAAQ,CAAC,QAAQ,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACvC,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC;CACxD"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** What every step of resolving shares: a refusal naming where, and a record read from anything. */
|
|
2
|
+
export type Refuse = (message: string) => TypeError;
|
|
3
|
+
export declare const isRecord: (value: unknown) => value is Record<string, unknown>;
|
|
4
|
+
//# sourceMappingURL=step.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"step.d.ts","sourceRoot":"","sources":["../../../src/permissions/resolve/step.ts"],"names":[],"mappings":"AAAA,oGAAoG;AAEpG,MAAM,MAAM,MAAM,GAAG,CAAC,OAAO,EAAE,MAAM,KAAK,SAAS,CAAC;AAEpD,eAAO,MAAM,QAAQ,GAAI,OAAO,OAAO,KAAG,KAAK,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CACJ,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { Subject } from '../subjects/subject';
|
|
2
|
+
import type { RelationStore } from './port/types';
|
|
3
|
+
import { type ResolvedModel } from './resolve/resolved';
|
|
4
|
+
/**
|
|
5
|
+
* One `list()`: the objects a subject holds a name on, found backwards —
|
|
6
|
+
* from the subject to the tuples naming it, through the sets and arrows the
|
|
7
|
+
* model declares, to the objects.
|
|
8
|
+
*
|
|
9
|
+
* **A least fixpoint.** `objects(type, name)` is a union of what its rules
|
|
10
|
+
* reach, and a rule can reach its own name again — a folder viewable through
|
|
11
|
+
* its parent, a team member through a team. Such a name, met again on the
|
|
12
|
+
* current path, answers what the previous round found; rounds repeat until
|
|
13
|
+
* none adds an id. That is exactly the set of objects with a derivation that
|
|
14
|
+
* does not loop — what `can()`'s cut finds, one object at a time. A round
|
|
15
|
+
* that met no loop is final.
|
|
16
|
+
*
|
|
17
|
+
* **Depth.** Each round past the first follows the loops one relation
|
|
18
|
+
* further; more than `maxDepth` rounds is `PERMISSION_DEPTH`, as crossing more
|
|
19
|
+
* than `maxDepth` relations is for `can()`.
|
|
20
|
+
*
|
|
21
|
+
* **Cost.** Every page of `findObjects` for every id each step reaches, every
|
|
22
|
+
* round. Linear in what the subject can reach — fine for the objects of one
|
|
23
|
+
* user, not for a subject set holding most of the database.
|
|
24
|
+
*/
|
|
25
|
+
export declare class Reverse {
|
|
26
|
+
private readonly model;
|
|
27
|
+
private readonly store;
|
|
28
|
+
private readonly maxDepth;
|
|
29
|
+
private readonly ctx;
|
|
30
|
+
private readonly subject;
|
|
31
|
+
private readonly question;
|
|
32
|
+
private previous;
|
|
33
|
+
private current;
|
|
34
|
+
private readonly path;
|
|
35
|
+
private looped;
|
|
36
|
+
constructor(model: ResolvedModel, store: RelationStore, maxDepth: number, ctx: unknown, subject: Subject, question: string);
|
|
37
|
+
objects(type: string, name: string): Promise<ReadonlySet<string>>;
|
|
38
|
+
/** Whether this round found what the previous one did: nothing more to find. */
|
|
39
|
+
private same;
|
|
40
|
+
/** The ids of the objects of `typeName` on which the subject holds `name`. */
|
|
41
|
+
private reach;
|
|
42
|
+
private relation;
|
|
43
|
+
private permission;
|
|
44
|
+
/** The objects of `type` whose `relation` reaches an object on which the subject holds `target`. */
|
|
45
|
+
private arrow;
|
|
46
|
+
/** Every id of every page of `findObjects`. */
|
|
47
|
+
private holding;
|
|
48
|
+
/** The objects whose field names `id`, from the `fromField`'s lookup. */
|
|
49
|
+
private lookup;
|
|
50
|
+
/** The condition, run on the caller's `ctx`, as for `can()`. */
|
|
51
|
+
private passes;
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=reverse.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reverse.d.ts","sourceRoot":"","sources":["../../src/permissions/reverse.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAEN,KAAK,aAAa,EAGlB,MAAM,oBAAoB,CAAC;AAE5B;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,qBAAa,OAAO;IAOlB,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,GAAG;IACpB,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAX1B,OAAO,CAAC,QAAQ,CAA0C;IAC1D,OAAO,CAAC,OAAO,CAA0C;IACzD,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAqB;IAC1C,OAAO,CAAC,MAAM,CAAS;gBAGL,KAAK,EAAE,aAAa,EACpB,KAAK,EAAE,aAAa,EACpB,QAAQ,EAAE,MAAM,EAChB,GAAG,EAAE,OAAO,EACZ,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,MAAM;IAG5B,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;IAcvE,gFAAgF;IAChF,OAAO,CAAC,IAAI;IAOZ,8EAA8E;YAChE,KAAK;YA2BL,QAAQ;YAgCR,UAAU;IAmBxB,oGAAoG;YACtF,KAAK;IAiCnB,+CAA+C;YACjC,OAAO;IAqBrB,yEAAyE;YAC3D,MAAM;IAwBpB,gEAAgE;IAChE,OAAO,CAAC,MAAM;CAYd"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/** The walk behind `can()`: from an object, through its rules, to a subject. */
|
|
2
|
+
import type { Entity, Subject } from '../subjects/subject';
|
|
3
|
+
import type { RelationStore } from './port/types';
|
|
4
|
+
import { type ResolvedModel } from './resolve/resolved';
|
|
5
|
+
/** An object on the walk: its entity, and its data when the caller passed it. */
|
|
6
|
+
export interface Node {
|
|
7
|
+
readonly entity: Entity;
|
|
8
|
+
readonly data: Readonly<Record<string, unknown>> | null;
|
|
9
|
+
}
|
|
10
|
+
/** One check: its context, its path, and the depth it may reach. */
|
|
11
|
+
export declare class Walk {
|
|
12
|
+
private readonly model;
|
|
13
|
+
private readonly store;
|
|
14
|
+
private readonly maxDepth;
|
|
15
|
+
private readonly ctx;
|
|
16
|
+
private readonly question;
|
|
17
|
+
/** The nodes on the current path. The walk is sequential, so one set is the stack. */
|
|
18
|
+
private readonly path;
|
|
19
|
+
constructor(model: ResolvedModel, store: RelationStore, maxDepth: number, ctx: unknown, question: string);
|
|
20
|
+
/** Whether `subject` holds `name` — a relation or a permission — on `node`. */
|
|
21
|
+
holds(subject: Subject, node: Node, name: string, depth: number): Promise<boolean>;
|
|
22
|
+
private relation;
|
|
23
|
+
private permission;
|
|
24
|
+
/** The condition, run on the caller's `ctx`. Its absence is a caller's bug, not a denial. */
|
|
25
|
+
private passes;
|
|
26
|
+
/** The objects an arrow through `relation` reaches from `node`. */
|
|
27
|
+
private targets;
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=walk.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"walk.d.ts","sourceRoot":"","sources":["../../src/permissions/walk.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAKhF,OAAO,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAEN,KAAK,aAAa,EAGlB,MAAM,oBAAoB,CAAC;AAE5B,iFAAiF;AACjF,MAAM,WAAW,IAAI;IACpB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC;CACxD;AAED,oEAAoE;AACpE,qBAAa,IAAI;IAKf,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,GAAG;IACpB,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAR1B,sFAAsF;IACtF,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAqB;gBAGxB,KAAK,EAAE,aAAa,EACpB,KAAK,EAAE,aAAa,EACpB,QAAQ,EAAE,MAAM,EAChB,GAAG,EAAE,OAAO,EACZ,QAAQ,EAAE,MAAM;IAGlC,+EAA+E;IACzE,KAAK,CACV,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,IAAI,EACV,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,GACX,OAAO,CAAC,OAAO,CAAC;YA0BL,QAAQ;YAqCR,UAAU;IAuBxB,6FAA6F;IAC7F,OAAO,CAAC,MAAM;IAad,mEAAmE;YACrD,OAAO;CAsBrB"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* **The one place a store's answer is caught**, shared by both sides of the
|
|
3
|
+
* package: the identity stores and the relation store reach a caller only
|
|
4
|
+
* through {@link guardStore}.
|
|
5
|
+
*
|
|
6
|
+
* - A `JanusError` the store threw passes through, so `instanceof` holds.
|
|
7
|
+
* - **Anything else it threw is a failure** — `StoreFailure`, naming the slot
|
|
8
|
+
* and the method, with the original as `cause`. Never an absence.
|
|
9
|
+
* - `undefined` where the port says `null` is a store that forgot to answer,
|
|
10
|
+
* and becomes `StoreFailure` rather than "not found".
|
|
11
|
+
*
|
|
12
|
+
* The `catch` below always rethrows; `src/auth/outage.scan.spec.ts` holds it to that.
|
|
13
|
+
*/
|
|
14
|
+
import { StoreFailure } from '../errors/janus-error';
|
|
15
|
+
import type { RelationStore } from '../permissions/port/types';
|
|
16
|
+
/** A store the guard names in a `StoreFailure`: `users`, `sessions`, `tokens` or `relations`. */
|
|
17
|
+
export type StoreSlot = NonNullable<StoreFailure['slot']>;
|
|
18
|
+
export declare function guardStore<S extends object>(slot: StoreSlot, store: S): S;
|
|
19
|
+
/**
|
|
20
|
+
* The relation store, guarded the same way: the permission engine's only way
|
|
21
|
+
* to a store, so a failure there is `STORE_FAILED` and never a denial.
|
|
22
|
+
*/
|
|
23
|
+
export declare function guardRelations(store: RelationStore): RelationStore;
|
|
24
|
+
//# sourceMappingURL=guard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"guard.d.ts","sourceRoot":"","sources":["../../src/stores/guard.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAGN,YAAY,EACZ,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE/D,iGAAiG;AACjG,MAAM,MAAM,SAAS,GAAG,WAAW,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC;AAc1D,wBAAgB,UAAU,CAAC,CAAC,SAAS,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,CA6BzE;AAoCD;;;GAGG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,aAAa,GAAG,aAAa,CAElE"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What every store can keep. PostgreSQL refuses `\u0000` in `text` and
|
|
3
|
+
* `jsonb`, and a lone surrogate in `jsonb`; MongoDB and the memory store keep
|
|
4
|
+
* both. The core refuses them before a store is asked, so a request that sends
|
|
5
|
+
* one is answered the same way on every adapter — not `STORE_FAILED` on one of
|
|
6
|
+
* them, a 503 for a database that is up.
|
|
7
|
+
*
|
|
8
|
+
* Shared by both sides of the package, like `guard.ts`: a string from a
|
|
9
|
+
* request reaches the identity stores and the relation store alike.
|
|
10
|
+
*/
|
|
11
|
+
/** Whether every store can keep this string. */
|
|
12
|
+
export declare const isStorable: (value: string) => boolean;
|
|
13
|
+
/** What an issue says about a string no store can keep. */
|
|
14
|
+
export declare const UNSTORABLE = "holds a NUL character or a lone surrogate, which no store can keep";
|
|
15
|
+
//# sourceMappingURL=storable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"storable.d.ts","sourceRoot":"","sources":["../../src/stores/storable.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,gDAAgD;AAChD,eAAO,MAAM,UAAU,GAAI,OAAO,MAAM,KAAG,OACO,CAAC;AAEnD,2DAA2D;AAC3D,eAAO,MAAM,UAAU,uEAC8C,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { type Entity, type RelationTuple, type SetOf, type Subject } from './subject';
|
|
2
|
+
/**
|
|
3
|
+
* Zanzibar's notation, with typed subjects:
|
|
4
|
+
*
|
|
5
|
+
* ```
|
|
6
|
+
* record:r1#viewer@staff:u1
|
|
7
|
+
* record:r1#viewer@team:t1#member
|
|
8
|
+
* ```
|
|
9
|
+
*
|
|
10
|
+
* It exists for **messages, logs and documentation**, not as a wire format:
|
|
11
|
+
* nothing in this package parses a tuple off the network, and a tuple that
|
|
12
|
+
* crosses a boundary crosses it as an object. Keeping the notation is worth it
|
|
13
|
+
* because every piece of Zanzibar writing uses it, so an error message in it is
|
|
14
|
+
* an error message a reader has already learned to read.
|
|
15
|
+
*
|
|
16
|
+
* A type holds no `:`, and no part holds `@`, `#` or a parenthesis, so a
|
|
17
|
+
* subject set needs no parentheses: after the `@`, a `#` can only begin its
|
|
18
|
+
* relation. {@link parseTuple} refuses a string where that would not hold,
|
|
19
|
+
* rather than reading it two ways.
|
|
20
|
+
*/
|
|
21
|
+
export declare function formatEntity(entity: Entity): string;
|
|
22
|
+
/** One subject: `staff:u1`, or `team:t1#member`. */
|
|
23
|
+
export declare function formatSubject(subject: Subject): string;
|
|
24
|
+
/** One relation tuple, in the notation above. */
|
|
25
|
+
export declare function formatTuple(tuple: RelationTuple): string;
|
|
26
|
+
/**
|
|
27
|
+
* Reads a tuple back. Refuses, with a `TypeError`, a string that is not one —
|
|
28
|
+
* a permission question built from a malformed string is a question whose
|
|
29
|
+
* answer means nothing, and no request is behind it: the string came from a
|
|
30
|
+
* developer's own code.
|
|
31
|
+
*/
|
|
32
|
+
export declare function parseTuple(text: string): RelationTuple;
|
|
33
|
+
/**
|
|
34
|
+
* Reads one subject back: `staff:u1`, or `team:t1#member`. A set is answered
|
|
35
|
+
* as `setOf()` makes it, so `can()` and `grant()` read it as the set it names
|
|
36
|
+
* on a user type too.
|
|
37
|
+
*/
|
|
38
|
+
export declare function parseSubject(text: string): Entity | SetOf;
|
|
39
|
+
//# sourceMappingURL=notation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notation.d.ts","sourceRoot":"","sources":["../../src/subjects/notation.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,MAAM,EAEX,KAAK,aAAa,EAClB,KAAK,KAAK,EACV,KAAK,OAAO,EAEZ,MAAM,WAAW,CAAC;AAEnB;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAEnD;AAED,oDAAoD;AACpD,wBAAgB,aAAa,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,CAItD;AAED,iDAAiD;AACjD,wBAAgB,WAAW,CAAC,KAAK,EAAE,aAAa,GAAG,MAAM,CAExD;AASD;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,aAAa,CAkBtD;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,KAAK,CAiBzD"}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The id every decision in this package hangs on: a user's `id`, as `janus()`
|
|
3
|
+
* mints it.
|
|
4
|
+
*
|
|
5
|
+
* In Ory, the equality between a Kratos identity id and Keto's `subject_id` is
|
|
6
|
+
* a comment and a convention, restated in three repositories and enforced
|
|
7
|
+
* nowhere. Here a user **is** a subject — see {@link subjectOf} — and that
|
|
8
|
+
* shared vocabulary is the whole reason users and permissions are one package
|
|
9
|
+
* rather than two: two packages would make this contract implicit, and an
|
|
10
|
+
* implicit contract between independently versioned packages breaks silently.
|
|
11
|
+
*
|
|
12
|
+
* Opaque: compared with `===`, carried in a URL, logged, never parsed.
|
|
13
|
+
*/
|
|
14
|
+
export type SubjectId = string;
|
|
15
|
+
/**
|
|
16
|
+
* Something a permission is about or held by — a user, a record, a team — by
|
|
17
|
+
* its type and its id.
|
|
18
|
+
*
|
|
19
|
+
* **Typed, unlike Keto's subjects.** One application has patients and staff,
|
|
20
|
+
* and an object can hold a relation too (a record's team), so an id alone does
|
|
21
|
+
* not say who. `type` is a user type of `janus()` or an object type of the
|
|
22
|
+
* permission model, and the same word as a user's own `type`.
|
|
23
|
+
*/
|
|
24
|
+
export interface Entity {
|
|
25
|
+
readonly type: string;
|
|
26
|
+
readonly id: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Everyone who holds `relation` on an entity — `team:t1#member` — which is how
|
|
30
|
+
* a permission is inherited rather than granted.
|
|
31
|
+
*
|
|
32
|
+
* A tuple whose subject is a subject set lets a whole group be given access
|
|
33
|
+
* with one write: granting a record's `viewer` to `team:t1#member` means every
|
|
34
|
+
* member of that team can view it, and no member holds a tuple on the record.
|
|
35
|
+
*/
|
|
36
|
+
export interface SubjectSet extends Entity {
|
|
37
|
+
readonly relation: string;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Who a tuple is about: one entity, or everyone who holds a relation on one.
|
|
41
|
+
* {@link isSubjectSet} tells them apart.
|
|
42
|
+
*/
|
|
43
|
+
export type Subject = Entity | SubjectSet;
|
|
44
|
+
/**
|
|
45
|
+
* A relation tuple: `subject` holds `relation` on `object`.
|
|
46
|
+
*
|
|
47
|
+
* `relation` is Zanzibar's word, and a tuple is Zanzibar's unit. What is not
|
|
48
|
+
* carried over is Keto's `namespace`/`object` pair: here the object is an
|
|
49
|
+
* {@link Entity}, with the `type` and `id` a user already has.
|
|
50
|
+
*/
|
|
51
|
+
export interface RelationTuple {
|
|
52
|
+
readonly object: Entity;
|
|
53
|
+
readonly relation: string;
|
|
54
|
+
readonly subject: Subject;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Whether this subject is a set rather than one entity. Narrows.
|
|
58
|
+
*
|
|
59
|
+
* It reads the shape, so pass a user through {@link subjectOf} first: a user
|
|
60
|
+
* whose fields include a string `relation` would otherwise read as a set.
|
|
61
|
+
*/
|
|
62
|
+
export declare function isSubjectSet(subject: Subject): subject is SubjectSet;
|
|
63
|
+
/**
|
|
64
|
+
* The subject a user is: their `type` and `id`, and nothing else.
|
|
65
|
+
*
|
|
66
|
+
* One line, and the entire join between the two sides of the package. It
|
|
67
|
+
* takes the narrowest shape it reads, so the permissions side never has to
|
|
68
|
+
* know what a user is, and it copies those two fields so none of the user's
|
|
69
|
+
* own fields ever reaches a tuple.
|
|
70
|
+
*/
|
|
71
|
+
export declare function subjectOf(user: {
|
|
72
|
+
readonly type: string;
|
|
73
|
+
readonly id: SubjectId;
|
|
74
|
+
}): Entity;
|
|
75
|
+
/**
|
|
76
|
+
* The mark `setOf()` puts on a set: a symbol property, so it survives a spread
|
|
77
|
+
* and `Object.assign`, and no value read from a database or from JSON can
|
|
78
|
+
* carry it. Registered with `Symbol.for`, so two copies of this module — two
|
|
79
|
+
* bundles, two entry points — still agree on it.
|
|
80
|
+
*/
|
|
81
|
+
declare const SET_OF: unique symbol;
|
|
82
|
+
/**
|
|
83
|
+
* A subject set `setOf()` made: everyone who holds `relation` on `type:id`.
|
|
84
|
+
*
|
|
85
|
+
* Marked, because a user is passed to `can()` and `grant()` as it is, fields
|
|
86
|
+
* flat on it: a user whose fields include `relation` must stay that user, and
|
|
87
|
+
* never read as the set of whoever holds that relation on them. For an object
|
|
88
|
+
* type, `{ type, id, relation }` is a set as written; for a user type — one
|
|
89
|
+
* the model also declares as an object type — only `setOf()` makes one.
|
|
90
|
+
*
|
|
91
|
+
* A spread keeps the mark. `JSON.stringify` and `structuredClone` drop it:
|
|
92
|
+
* through either, a set comes back as a user — call `setOf()` again, or
|
|
93
|
+
* `parseSubject()` on its notation.
|
|
94
|
+
*/
|
|
95
|
+
export type SetOf<Type extends string = string, Relation extends string = string> = SubjectSet & {
|
|
96
|
+
readonly type: Type;
|
|
97
|
+
readonly relation: Relation;
|
|
98
|
+
readonly [SET_OF]: true;
|
|
99
|
+
};
|
|
100
|
+
/**
|
|
101
|
+
* A user or an object, never a set `setOf()` made: where a relation admits
|
|
102
|
+
* `staff` but not `staff#managers`, a set passed there is refused at compile
|
|
103
|
+
* time as it is at run time.
|
|
104
|
+
*/
|
|
105
|
+
export type NotASet = {
|
|
106
|
+
readonly [SET_OF]?: never;
|
|
107
|
+
};
|
|
108
|
+
/**
|
|
109
|
+
* Everyone who holds `relation` on this user or object — `staff:s1#managers`.
|
|
110
|
+
*
|
|
111
|
+
* ```ts
|
|
112
|
+
* await access.grant(record, 'viewers', setOf(ada, 'managers'));
|
|
113
|
+
* ```
|
|
114
|
+
*
|
|
115
|
+
* Copies `type` and `id` only, like {@link subjectOf}: none of a user's own
|
|
116
|
+
* fields reaches a tuple.
|
|
117
|
+
*/
|
|
118
|
+
export declare function setOf<const Type extends string, const Relation extends string>(entity: {
|
|
119
|
+
readonly type: Type;
|
|
120
|
+
readonly id: SubjectId;
|
|
121
|
+
}, relation: Relation): SetOf<Type, Relation>;
|
|
122
|
+
/**
|
|
123
|
+
* Whether `setOf()` made this value, or a spread of one — what `can()` and
|
|
124
|
+
* `grant()` read to tell a set on a user type from a user.
|
|
125
|
+
*/
|
|
126
|
+
export declare function isSetOf(value: unknown): value is SetOf;
|
|
127
|
+
export {};
|
|
128
|
+
//# sourceMappingURL=subject.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subject.d.ts","sourceRoot":"","sources":["../../src/subjects/subject.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC;AAE/B;;;;;;;;GAQG;AACH,MAAM,WAAW,MAAM;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,UAAW,SAAQ,MAAM;IACzC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC1B;AAED;;;GAGG;AACH,MAAM,MAAM,OAAO,GAAG,MAAM,GAAG,UAAU,CAAC;AAE1C;;;;;;GAMG;AACH,MAAM,WAAW,aAAa;IAC7B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;CAC1B;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,IAAI,UAAU,CAEpE;AAED;;;;;;;GAOG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE;IAC/B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,EAAE,SAAS,CAAC;CACvB,GAAG,MAAM,CAET;AAED;;;;;GAKG;AACH,QAAA,MAAM,MAAM,EAAE,OAAO,MAA4C,CAAC;AAElE;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,KAAK,CAChB,IAAI,SAAS,MAAM,GAAG,MAAM,EAC5B,QAAQ,SAAS,MAAM,GAAG,MAAM,IAC7B,UAAU,GAAG;IAChB,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC;IACpB,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC5B,QAAQ,CAAC,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC;CACxB,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,OAAO,GAAG;IAAE,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,CAAA;CAAE,CAAC;AAEpD;;;;;;;;;GASG;AACH,wBAAgB,KAAK,CAAC,KAAK,CAAC,IAAI,SAAS,MAAM,EAAE,KAAK,CAAC,QAAQ,SAAS,MAAM,EAC7E,MAAM,EAAE;IAAE,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC;IAAC,QAAQ,CAAC,EAAE,EAAE,SAAS,CAAA;CAAE,EACvD,QAAQ,EAAE,QAAQ,GAChB,KAAK,CAAC,IAAI,EAAE,QAAQ,CAAC,CAkBvB;AAED;;;GAGG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,KAAK,CAMtD"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The code an authenticator app shows for a base32 secret at a moment: RFC
|
|
3
|
+
* 6238, HMAC-SHA-1, six digits, a thirty-second step. For tests that enroll a
|
|
4
|
+
* second factor and then confirm with a code; `at` defaults to now, and a
|
|
5
|
+
* test that passes `fixedClock` to `janus()` passes `clock.now()`.
|
|
6
|
+
*
|
|
7
|
+
* The secret is what `secondFactor.enroll` answers (spaces, padding and case
|
|
8
|
+
* are ignored, as an authenticator app does); anything that is not base32,
|
|
9
|
+
* or an invalid `at`, throws a `TypeError` naming `totpCode`.
|
|
10
|
+
*/
|
|
11
|
+
export declare function totpCode(secret: string, at?: Date): string;
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/testing/index.ts"],"names":[],"mappings":"AAEA;;;;;;;;;GASG;AACH,wBAAgB,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,GAAE,IAAiB,GAAG,MAAM,CAYtE"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import {
|
|
2
|
+
fromBase32,
|
|
3
|
+
stepAt,
|
|
4
|
+
codeAt
|
|
5
|
+
} from "../chunks/index-5dxynm32.js";
|
|
6
|
+
|
|
7
|
+
// src/testing/index.ts
|
|
8
|
+
function totpCode(secret, at = new Date) {
|
|
9
|
+
if (!(at instanceof Date) || Number.isNaN(at.getTime())) {
|
|
10
|
+
throw new TypeError("totpCode: at is not a valid Date");
|
|
11
|
+
}
|
|
12
|
+
const clean = secret.replace(/[\s=]/g, "").toUpperCase();
|
|
13
|
+
let key;
|
|
14
|
+
try {
|
|
15
|
+
key = fromBase32(clean);
|
|
16
|
+
} catch {
|
|
17
|
+
throw new TypeError("totpCode: the secret is not base32");
|
|
18
|
+
}
|
|
19
|
+
return codeAt(key, stepAt(at));
|
|
20
|
+
}
|
|
21
|
+
export {
|
|
22
|
+
totpCode
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
//# debugId=B0DBB2112D6A90D464756E2164756E21
|
|
26
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/testing/index.ts"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"import { codeAt, fromBase32, stepAt } from '../auth/totp';\n\n/**\n * The code an authenticator app shows for a base32 secret at a moment: RFC\n * 6238, HMAC-SHA-1, six digits, a thirty-second step. For tests that enroll a\n * second factor and then confirm with a code; `at` defaults to now, and a\n * test that passes `fixedClock` to `janus()` passes `clock.now()`.\n *\n * The secret is what `secondFactor.enroll` answers (spaces, padding and case\n * are ignored, as an authenticator app does); anything that is not base32,\n * or an invalid `at`, throws a `TypeError` naming `totpCode`.\n */\nexport function totpCode(secret: string, at: Date = new Date()): string {\n\tif (!(at instanceof Date) || Number.isNaN(at.getTime())) {\n\t\tthrow new TypeError('totpCode: at is not a valid Date');\n\t}\n\tconst clean = secret.replace(/[\\s=]/g, '').toUpperCase();\n\tlet key: Buffer;\n\ttry {\n\t\tkey = fromBase32(clean);\n\t} catch {\n\t\tthrow new TypeError('totpCode: the secret is not base32');\n\t}\n\treturn codeAt(key, stepAt(at));\n}\n"
|
|
6
|
+
],
|
|
7
|
+
"mappings": ";;;;;;;AAYO,SAAS,QAAQ,CAAC,QAAgB,KAAW,IAAI,MAAgB;AAAA,EACvE,IAAI,EAAE,cAAc,SAAS,OAAO,MAAM,GAAG,QAAQ,CAAC,GAAG;AAAA,IACxD,MAAM,IAAI,UAAU,kCAAkC;AAAA,EACvD;AAAA,EACA,MAAM,QAAQ,OAAO,QAAQ,UAAU,EAAE,EAAE,YAAY;AAAA,EACvD,IAAI;AAAA,EACJ,IAAI;AAAA,IACH,MAAM,WAAW,KAAK;AAAA,IACrB,MAAM;AAAA,IACP,MAAM,IAAI,UAAU,oCAAoC;AAAA;AAAA,EAEzD,OAAO,OAAO,KAAK,OAAO,EAAE,CAAC;AAAA;",
|
|
8
|
+
"debugId": "B0DBB2112D6A90D464756E2164756E21",
|
|
9
|
+
"names": []
|
|
10
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where `now` comes from.
|
|
3
|
+
*
|
|
4
|
+
* Injected rather than read from `Date` directly, for one practical reason:
|
|
5
|
+
* every expiry in this package — sessions, one-time tokens, refresh windows —
|
|
6
|
+
* is a comparison against the current time, and a spec that has to move the
|
|
7
|
+
* real clock to test one is a spec that needs fake timers, leaks them, and
|
|
8
|
+
* fails differently under load. A `Clock` makes those specs synchronous and
|
|
9
|
+
* exact.
|
|
10
|
+
*
|
|
11
|
+
* It is also the seam an application needs if it ever has to reason about a
|
|
12
|
+
* store's clock rather than its own: MongoDB stamps a TTL against the server's
|
|
13
|
+
* time, not the process's.
|
|
14
|
+
*/
|
|
15
|
+
export interface Clock {
|
|
16
|
+
now(): Date;
|
|
17
|
+
}
|
|
18
|
+
/** The process's own clock. The default everywhere. */
|
|
19
|
+
export declare const systemClock: Clock;
|
|
20
|
+
/**
|
|
21
|
+
* A clock a spec drives by hand.
|
|
22
|
+
*
|
|
23
|
+
* Shipped rather than kept in `test/`: a consumer writing their own tests
|
|
24
|
+
* against this package needs exactly this, and writing it again is how two
|
|
25
|
+
* subtly different versions of "advance time" come to exist.
|
|
26
|
+
*/
|
|
27
|
+
export declare function fixedClock(start?: Date | number): Clock & {
|
|
28
|
+
advance(ms: number): void;
|
|
29
|
+
set(at: Date | number): void;
|
|
30
|
+
};
|
|
31
|
+
//# sourceMappingURL=clock.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clock.d.ts","sourceRoot":"","sources":["../../src/time/clock.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,KAAK;IACrB,GAAG,IAAI,IAAI,CAAC;CACZ;AAED,uDAAuD;AACvD,eAAO,MAAM,WAAW,EAAE,KAEzB,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,KAAK,GAAE,IAAI,GAAG,MAAU,GAAG,KAAK,GAAG;IAC7D,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,GAAG,CAAC,EAAE,EAAE,IAAI,GAAG,MAAM,GAAG,IAAI,CAAC;CAC7B,CAYA"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A span of time, written the way a configuration file writes one: `'15m'`,
|
|
3
|
+
* `'720h'`, `'30d'`. A plain number is milliseconds.
|
|
4
|
+
*
|
|
5
|
+
* Strings rather than milliseconds everywhere, because `2592000000` in a config
|
|
6
|
+
* object is a number nobody reads back correctly, and Ory's own configuration
|
|
7
|
+
* uses exactly this notation — so a team moving across recognises it.
|
|
8
|
+
*/
|
|
9
|
+
export type Duration = number | `${number}${'ms' | 's' | 'm' | 'h' | 'd'}`;
|
|
10
|
+
/**
|
|
11
|
+
* The duration in milliseconds.
|
|
12
|
+
*
|
|
13
|
+
* `where` names the option the consumer wrote — `session.lifespan`, not
|
|
14
|
+
* `parseDuration` — because this package has half a dozen durations and a
|
|
15
|
+
* message that does not say which one leaves the reader to guess.
|
|
16
|
+
*
|
|
17
|
+
* A bare `TypeError`: durations are written when the application is wired, so
|
|
18
|
+
* this cannot come from a request, and no handler should answer it. The refusal
|
|
19
|
+
* reports the **shape** expected and not the value's own bytes beyond echoing
|
|
20
|
+
* it, which is the rule this repository inherits.
|
|
21
|
+
*/
|
|
22
|
+
export declare function parseDuration(value: Duration, where: string): number;
|
|
23
|
+
//# sourceMappingURL=duration.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"duration.d.ts","sourceRoot":"","sources":["../../src/time/duration.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,GAAG,MAAM,GAAG,IAAI,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,EAAE,CAAC;AAY3E;;;;;;;;;;;GAWG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CA2BpE"}
|
package/docs/README.md
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# @softistx/janus — documentation
|
|
2
|
+
|
|
3
|
+
The [README](../README.md) shows that it works; these pages show how, one area
|
|
4
|
+
at a time, with an example for every option.
|
|
5
|
+
|
|
6
|
+
Janus has two sides, each usable alone — see
|
|
7
|
+
[Three ways to use it](../README.md#three-ways-to-use-it) — and the words
|
|
8
|
+
below are defined once, in [Words](guide/vocabulary.md#words).
|
|
9
|
+
|
|
10
|
+
### Identities — `janus()`
|
|
11
|
+
|
|
12
|
+
| Page | Read it when |
|
|
13
|
+
| --- | --- |
|
|
14
|
+
| [Users](guide/users.md) | You are wiring `janus()`, declaring one or several user types, or calling `create`, `update`, `list`, `delete` — or finding a user by e-mail on a type with no password (`findByEmail`), or finding or creating one in a single call (`findOrCreate`) |
|
|
15
|
+
| [Sessions](guide/sessions.md) | You need to know who a request belongs to, set or clear the cookie, renew, sign out, or test expiry — or sign in a user your application proved itself, such as on accepting an invitation (`signInProven`) |
|
|
16
|
+
| [E-mail verification, password reset and changing an e-mail](guide/email-flows.md) | You are sending a verification, reset or e-mail-change link (`changeEmail`), and handling what comes back — or proving an address on your own proof, such as an invitation (`verifyEmail.proveFirst`) — and how requests that send e-mail are throttled per address or user |
|
|
17
|
+
| [Signing in with an e-mailed link](guide/magic-link.md) | You are signing users in with a link sent by e-mail — a magic link: the page that confirms it from a `POST` so mail scanners spend nothing, the lifetime, the errors, and what ends a link |
|
|
18
|
+
| [Signing in with an e-mailed code](guide/sign-in-code.md) | You are signing users in with a six-digit code sent by e-mail — with no password, or beside one: requesting it without telling who exists, keeping the challenge, the attempts and the errors |
|
|
19
|
+
| [The second factor](guide/second-factor.md) | You are turning on TOTP codes: making and rotating the sealing keys, the QR code, `signIn`'s `status`, confirming a challenge, recovery codes for a lost phone, disabling — and sealing your own secrets at rest with `sealerFor` |
|
|
20
|
+
| [Passkeys](guide/passkeys.md) | A user registers a passkey and answers with it, as a second factor beside TOTP or, with `firstFactor`, to sign in with no password (`signInOptions`, `signIn`): wiring `passkeys` (`rpId`, `origins`, the verifier), the two-step registration, `list`, `rename` and `remove`, freshness, `methods` and `passkeyOptions` on the sign-in challenge, `confirmPasskey`, a step-up `via: 'passkey'`, the counter rule, the errors, and a test with a fake verifier |
|
|
21
|
+
| [Step-up](guide/step-up.md) | A sensitive action — changing the e-mail, disabling the second factor, deleting the account — should ask a signed-in user to prove again who they are: `assertFresh`, `stepUp.request` and `confirm`, by e-mailed code, by their app or by a passkey |
|
|
22
|
+
| [Invitations](guide/invitations.md) | Inviting somebody into an organization: wiring `invitations`, `issue`, `resend`, `revoke`, `list`, `preview` and `accept`, the e-mail link, what `accept` does for a new, an unproved and a proved address, and the traps |
|
|
23
|
+
| [Migrating invitations](guide/migrating-invitations.md) | Importing an older system's invitation history with `importHistory`: the field mapping, which fields are Janus user ids, the dry run, re-running, and what keeps the history in MongoDB and Drizzle |
|
|
24
|
+
| [API keys](guide/api-keys.md) | Users create personal keys for their scripts: wiring `apiKeys`, the prefix and lifetimes, creating one behind a fresh proof (`create`), the limit, `get`, `list` (with its `bound` filter), `revoke` and `revokeAll`, and what ends a key |
|
|
25
|
+
| [Devices](guide/devices.md) | You want to tell a user their account was signed in from a new device: wiring `devices`, the `device` each sign-in takes, the device cookie, the second factor, the notice by e-mail, rotating the keys and forgetting devices |
|
|
26
|
+
| [User events](guide/events.md) | You want to hear when a user is created, verifies their e-mail, resets or changes their password, changes their e-mail, turns the second factor on or off, uses a recovery code, adds or removes a passkey, signs in from a new device, links or unlinks a social account or is deleted — to queue it, sync it, or send it as a webhook |
|
|
27
|
+
| [Social sign-in](guide/social.md) | Users sign in, sign up or link accounts through an external provider (Google, GitHub, …): the flow and its cookie, every case `social.complete` decides, linking and unlinking behind a fresh session, `returnTo`, writing your own `SocialProvider`, and a test with a fake one |
|
|
28
|
+
| [Account avatars](guide/avatars.md) | Accounts have an avatar: the upload and remove routes, the proxy route that streams it behind your session, who may see its image (`viewAvatar` through an organization's members), and what fails in what order |
|
|
29
|
+
| [Password hashing](guide/passwords.md) | You are choosing a hasher, raising its cost, moving to argon2id, or importing hashes from another system — or how `signIn` and `changePassword` throttle password guessing per login, and what you still limit per client |
|
|
30
|
+
| [Several issuers](guide/issuers.md) | One process serves several tenants, each with its own `janus()` instance: `createJanusIssuers` resolves the request's issuer, builds its instance once, rebuilds it on a new version, keeps a bounded cache, and `evict` |
|
|
31
|
+
|
|
32
|
+
### Permissions — `@softistx/janus/permissions`
|
|
33
|
+
|
|
34
|
+
| Page | Read it when |
|
|
35
|
+
| --- | --- |
|
|
36
|
+
| [Permissions](guide/permissions.md) | You are modelling access with `defineModel`, `fromField` and `when`, and calling `can`, `list`, `grant`, `revoke`, `replace` |
|
|
37
|
+
|
|
38
|
+
### Shared by both sides
|
|
39
|
+
|
|
40
|
+
| Page | Read it when |
|
|
41
|
+
| --- | --- |
|
|
42
|
+
| [The shared vocabulary](guide/vocabulary.md) | You want the words the documentation uses, or subjects and the tuple notation, ids, cursors, durations, `fixedClock` or the `background` runner (fire-and-forget work with `settled()`) |
|
|
43
|
+
| [Errors](guide/errors.md) | You are turning what the package throws into a status code, and want every code and what it carries |
|
|
44
|
+
| [Writing an adapter](guide/adapters.md) | You are implementing the identity stores or the relation store for your database, upgrading one for `countAttempt`, `spendUserTokens`, the second factor and a new token kind, adding the optional `socialLinks` and `passkeys` slots, or running the conformance suites |
|
|
45
|
+
| [Troubleshooting](troubleshooting.md) | You have an error message and want its cause and its fix |
|
|
46
|
+
| [Roadmap](roadmap.md) | You want to know what is coming, what shipped, and what is deliberately not planned |
|