@softistx/janus 0.0.0-stage → 0.74.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +2929 -2
- package/dist/auth/api-keys/authenticate-key.d.ts +21 -0
- package/dist/auth/api-keys/authenticate-key.d.ts.map +1 -0
- package/dist/auth/api-keys/bound.d.ts +11 -0
- package/dist/auth/api-keys/bound.d.ts.map +1 -0
- package/dist/auth/api-keys/count.d.ts +8 -0
- package/dist/auth/api-keys/count.d.ts.map +1 -0
- package/dist/auth/api-keys/create/checks.d.ts +42 -0
- package/dist/auth/api-keys/create/checks.d.ts.map +1 -0
- package/dist/auth/api-keys/create/index.d.ts +10 -0
- package/dist/auth/api-keys/create/index.d.ts.map +1 -0
- package/dist/auth/api-keys/events.d.ts +22 -0
- package/dist/auth/api-keys/events.d.ts.map +1 -0
- package/dist/auth/api-keys/expiry.d.ts +11 -0
- package/dist/auth/api-keys/expiry.d.ts.map +1 -0
- package/dist/auth/api-keys/flows.d.ts +13 -0
- package/dist/auth/api-keys/flows.d.ts.map +1 -0
- package/dist/auth/api-keys/index.d.ts +11 -0
- package/dist/auth/api-keys/index.d.ts.map +1 -0
- package/dist/auth/api-keys/read.d.ts +10 -0
- package/dist/auth/api-keys/read.d.ts.map +1 -0
- package/dist/auth/api-keys/shape.d.ts +24 -0
- package/dist/auth/api-keys/shape.d.ts.map +1 -0
- package/dist/auth/api-keys/to-api-key.d.ts +8 -0
- package/dist/auth/api-keys/to-api-key.d.ts.map +1 -0
- package/dist/auth/api-keys/token.d.ts +23 -0
- package/dist/auth/api-keys/token.d.ts.map +1 -0
- package/dist/auth/api-keys/user-bound.d.ts +10 -0
- package/dist/auth/api-keys/user-bound.d.ts.map +1 -0
- package/dist/auth/at.d.ts +9 -0
- package/dist/auth/at.d.ts.map +1 -0
- package/dist/auth/avatar/any-type.d.ts +13 -0
- package/dist/auth/avatar/any-type.d.ts.map +1 -0
- package/dist/auth/avatar/flows.d.ts +7 -0
- package/dist/auth/avatar/flows.d.ts.map +1 -0
- package/dist/auth/avatar/id.d.ts +10 -0
- package/dist/auth/avatar/id.d.ts.map +1 -0
- package/dist/auth/avatar/index.d.ts +7 -0
- package/dist/auth/avatar/index.d.ts.map +1 -0
- package/dist/auth/avatar/remove.d.ts +10 -0
- package/dist/auth/avatar/remove.d.ts.map +1 -0
- package/dist/auth/avatar/set.d.ts +12 -0
- package/dist/auth/avatar/set.d.ts.map +1 -0
- package/dist/auth/concurrency-limit.d.ts +13 -0
- package/dist/auth/concurrency-limit.d.ts.map +1 -0
- package/dist/auth/config/api-keys-config.d.ts +33 -0
- package/dist/auth/config/api-keys-config.d.ts.map +1 -0
- package/dist/auth/config/hasher.d.ts +22 -0
- package/dist/auth/config/hasher.d.ts.map +1 -0
- package/dist/auth/config/index.d.ts +24 -0
- package/dist/auth/config/index.d.ts.map +1 -0
- package/dist/auth/config/invitations-config.d.ts +74 -0
- package/dist/auth/config/invitations-config.d.ts.map +1 -0
- package/dist/auth/config/janus-config.d.ts +233 -0
- package/dist/auth/config/janus-config.d.ts.map +1 -0
- package/dist/auth/config/magic-link-config.d.ts +6 -0
- package/dist/auth/config/magic-link-config.d.ts.map +1 -0
- package/dist/auth/config/names.d.ts +9 -0
- package/dist/auth/config/names.d.ts.map +1 -0
- package/dist/auth/config/normalize.d.ts +26 -0
- package/dist/auth/config/normalize.d.ts.map +1 -0
- package/dist/auth/config/passkeys-config.d.ts +49 -0
- package/dist/auth/config/passkeys-config.d.ts.map +1 -0
- package/dist/auth/config/password-config.d.ts +22 -0
- package/dist/auth/config/password-config.d.ts.map +1 -0
- package/dist/auth/config/reserved.d.ts +14 -0
- package/dist/auth/config/reserved.d.ts.map +1 -0
- package/dist/auth/config/resolve-api-keys.d.ts +5 -0
- package/dist/auth/config/resolve-api-keys.d.ts.map +1 -0
- package/dist/auth/config/resolve-config.d.ts +9 -0
- package/dist/auth/config/resolve-config.d.ts.map +1 -0
- package/dist/auth/config/resolve-cookie.d.ts +5 -0
- package/dist/auth/config/resolve-cookie.d.ts.map +1 -0
- package/dist/auth/config/resolve-devices.d.ts +5 -0
- package/dist/auth/config/resolve-devices.d.ts.map +1 -0
- package/dist/auth/config/resolve-invitation-types.d.ts +5 -0
- package/dist/auth/config/resolve-invitation-types.d.ts.map +1 -0
- package/dist/auth/config/resolve-invitations.d.ts +5 -0
- package/dist/auth/config/resolve-invitations.d.ts.map +1 -0
- package/dist/auth/config/resolve-magic-link.d.ts +4 -0
- package/dist/auth/config/resolve-magic-link.d.ts.map +1 -0
- package/dist/auth/config/resolve-passkeys.d.ts +5 -0
- package/dist/auth/config/resolve-passkeys.d.ts.map +1 -0
- package/dist/auth/config/resolve-second-factor.d.ts +5 -0
- package/dist/auth/config/resolve-second-factor.d.ts.map +1 -0
- package/dist/auth/config/resolve-social.d.ts +17 -0
- package/dist/auth/config/resolve-social.d.ts.map +1 -0
- package/dist/auth/config/resolve-throttle.d.ts +37 -0
- package/dist/auth/config/resolve-throttle.d.ts.map +1 -0
- package/dist/auth/config/resolve-type.d.ts +6 -0
- package/dist/auth/config/resolve-type.d.ts.map +1 -0
- package/dist/auth/config/resolved-config.d.ts +126 -0
- package/dist/auth/config/resolved-config.d.ts.map +1 -0
- package/dist/auth/config/social-config.d.ts +154 -0
- package/dist/auth/config/social-config.d.ts.map +1 -0
- package/dist/auth/config/user-type.d.ts +79 -0
- package/dist/auth/config/user-type.d.ts.map +1 -0
- package/dist/auth/config/warn-throttle-window.d.ts +14 -0
- package/dist/auth/config/warn-throttle-window.d.ts.map +1 -0
- package/dist/auth/context/create-context.d.ts +31 -0
- package/dist/auth/context/create-context.d.ts.map +1 -0
- package/dist/auth/context/index.d.ts +17 -0
- package/dist/auth/context/index.d.ts.map +1 -0
- package/dist/auth/context/logins.d.ts +28 -0
- package/dist/auth/context/logins.d.ts.map +1 -0
- package/dist/auth/context/password.d.ts +34 -0
- package/dist/auth/context/password.d.ts.map +1 -0
- package/dist/auth/context/records.d.ts +27 -0
- package/dist/auth/context/records.d.ts.map +1 -0
- package/dist/auth/context/user.d.ts +21 -0
- package/dist/auth/context/user.d.ts.map +1 -0
- package/dist/auth/context/validate-fields.d.ts +12 -0
- package/dist/auth/context/validate-fields.d.ts.map +1 -0
- package/dist/auth/counter-key.d.ts +20 -0
- package/dist/auth/counter-key.d.ts.map +1 -0
- package/dist/auth/derived-keys.d.ts +9 -0
- package/dist/auth/derived-keys.d.ts.map +1 -0
- package/dist/auth/devices/cookie.d.ts +56 -0
- package/dist/auth/devices/cookie.d.ts.map +1 -0
- package/dist/auth/devices/hint.d.ts +42 -0
- package/dist/auth/devices/hint.d.ts.map +1 -0
- package/dist/auth/devices/index.d.ts +11 -0
- package/dist/auth/devices/index.d.ts.map +1 -0
- package/dist/auth/devices/report.d.ts +11 -0
- package/dist/auth/devices/report.d.ts.map +1 -0
- package/dist/auth/devices/token.d.ts +13 -0
- package/dist/auth/devices/token.d.ts.map +1 -0
- package/dist/auth/email-flows/any-type-change-email.d.ts +18 -0
- package/dist/auth/email-flows/any-type-change-email.d.ts.map +1 -0
- package/dist/auth/email-flows/any-type-reset-password.d.ts +19 -0
- package/dist/auth/email-flows/any-type-reset-password.d.ts.map +1 -0
- package/dist/auth/email-flows/any-type-verify-email.d.ts +18 -0
- package/dist/auth/email-flows/any-type-verify-email.d.ts.map +1 -0
- package/dist/auth/email-flows/change-email-token.d.ts +47 -0
- package/dist/auth/email-flows/change-email-token.d.ts.map +1 -0
- package/dist/auth/email-flows/change-email.d.ts +17 -0
- package/dist/auth/email-flows/change-email.d.ts.map +1 -0
- package/dist/auth/email-flows/confirm-reset.d.ts +16 -0
- package/dist/auth/email-flows/confirm-reset.d.ts.map +1 -0
- package/dist/auth/email-flows/email-token.d.ts +30 -0
- package/dist/auth/email-flows/email-token.d.ts.map +1 -0
- package/dist/auth/email-flows/flows.d.ts +13 -0
- package/dist/auth/email-flows/flows.d.ts.map +1 -0
- package/dist/auth/email-flows/index.d.ts +10 -0
- package/dist/auth/email-flows/index.d.ts.map +1 -0
- package/dist/auth/email-flows/owner-of.d.ts +17 -0
- package/dist/auth/email-flows/owner-of.d.ts.map +1 -0
- package/dist/auth/email-flows/prove-first.d.ts +45 -0
- package/dist/auth/email-flows/prove-first.d.ts.map +1 -0
- package/dist/auth/email-flows/reset-password.d.ts +17 -0
- package/dist/auth/email-flows/reset-password.d.ts.map +1 -0
- package/dist/auth/email-flows/set-email-verified.d.ts +19 -0
- package/dist/auth/email-flows/set-email-verified.d.ts.map +1 -0
- package/dist/auth/email-flows/verify-email.d.ts +25 -0
- package/dist/auth/email-flows/verify-email.d.ts.map +1 -0
- package/dist/auth/email-sign-in.d.ts +51 -0
- package/dist/auth/email-sign-in.d.ts.map +1 -0
- package/dist/auth/events.d.ts +166 -0
- package/dist/auth/events.d.ts.map +1 -0
- package/dist/auth/first-proof.d.ts +43 -0
- package/dist/auth/first-proof.d.ts.map +1 -0
- package/dist/auth/hashers.d.ts +52 -0
- package/dist/auth/hashers.d.ts.map +1 -0
- package/dist/auth/index.d.ts +22 -0
- package/dist/auth/index.d.ts.map +1 -0
- package/dist/auth/invitations/accept.d.ts +10 -0
- package/dist/auth/invitations/accept.d.ts.map +1 -0
- package/dist/auth/invitations/change-pending.d.ts +17 -0
- package/dist/auth/invitations/change-pending.d.ts.map +1 -0
- package/dist/auth/invitations/claim.d.ts +31 -0
- package/dist/auth/invitations/claim.d.ts.map +1 -0
- package/dist/auth/invitations/events.d.ts +46 -0
- package/dist/auth/invitations/events.d.ts.map +1 -0
- package/dist/auth/invitations/find-invitee.d.ts +20 -0
- package/dist/auth/invitations/find-invitee.d.ts.map +1 -0
- package/dist/auth/invitations/find-pending.d.ts +5 -0
- package/dist/auth/invitations/find-pending.d.ts.map +1 -0
- package/dist/auth/invitations/flows.d.ts +7 -0
- package/dist/auth/invitations/flows.d.ts.map +1 -0
- package/dist/auth/invitations/history-input.d.ts +29 -0
- package/dist/auth/invitations/history-input.d.ts.map +1 -0
- package/dist/auth/invitations/history.d.ts +10 -0
- package/dist/auth/invitations/history.d.ts.map +1 -0
- package/dist/auth/invitations/index.d.ts +11 -0
- package/dist/auth/invitations/index.d.ts.map +1 -0
- package/dist/auth/invitations/input.d.ts +30 -0
- package/dist/auth/invitations/input.d.ts.map +1 -0
- package/dist/auth/invitations/invited-type.d.ts +22 -0
- package/dist/auth/invitations/invited-type.d.ts.map +1 -0
- package/dist/auth/invitations/invitee.d.ts +11 -0
- package/dist/auth/invitations/invitee.d.ts.map +1 -0
- package/dist/auth/invitations/issue.d.ts +9 -0
- package/dist/auth/invitations/issue.d.ts.map +1 -0
- package/dist/auth/invitations/limit.d.ts +7 -0
- package/dist/auth/invitations/limit.d.ts.map +1 -0
- package/dist/auth/invitations/password-invitee.d.ts +18 -0
- package/dist/auth/invitations/password-invitee.d.ts.map +1 -0
- package/dist/auth/invitations/passwordless-invitee.d.ts +13 -0
- package/dist/auth/invitations/passwordless-invitee.d.ts.map +1 -0
- package/dist/auth/invitations/preview.d.ts +8 -0
- package/dist/auth/invitations/preview.d.ts.map +1 -0
- package/dist/auth/invitations/read.d.ts +10 -0
- package/dist/auth/invitations/read.d.ts.map +1 -0
- package/dist/auth/invitations/resend.d.ts +12 -0
- package/dist/auth/invitations/resend.d.ts.map +1 -0
- package/dist/auth/invitations/to-invitation.d.ts +11 -0
- package/dist/auth/invitations/to-invitation.d.ts.map +1 -0
- package/dist/auth/invitations/write.d.ts +17 -0
- package/dist/auth/invitations/write.d.ts.map +1 -0
- package/dist/auth/issuers/cache.d.ts +21 -0
- package/dist/auth/issuers/cache.d.ts.map +1 -0
- package/dist/auth/issuers/create.d.ts +18 -0
- package/dist/auth/issuers/create.d.ts.map +1 -0
- package/dist/auth/issuers/index.d.ts +3 -0
- package/dist/auth/issuers/index.d.ts.map +1 -0
- package/dist/auth/issuers/types.d.ts +45 -0
- package/dist/auth/issuers/types.d.ts.map +1 -0
- package/dist/auth/janus.d.ts +39 -0
- package/dist/auth/janus.d.ts.map +1 -0
- package/dist/auth/magic-link.d.ts +25 -0
- package/dist/auth/magic-link.d.ts.map +1 -0
- package/dist/auth/mail-requests.d.ts +55 -0
- package/dist/auth/mail-requests.d.ts.map +1 -0
- package/dist/auth/one-time/codes.d.ts +46 -0
- package/dist/auth/one-time/codes.d.ts.map +1 -0
- package/dist/auth/one-time/index.d.ts +15 -0
- package/dist/auth/one-time/index.d.ts.map +1 -0
- package/dist/auth/one-time/issue.d.ts +45 -0
- package/dist/auth/one-time/issue.d.ts.map +1 -0
- package/dist/auth/one-time/refusals.d.ts +26 -0
- package/dist/auth/one-time/refusals.d.ts.map +1 -0
- package/dist/auth/one-time/spend.d.ts +24 -0
- package/dist/auth/one-time/spend.d.ts.map +1 -0
- package/dist/auth/one-time/window.d.ts +50 -0
- package/dist/auth/one-time/window.d.ts.map +1 -0
- package/dist/auth/outage.d.ts +66 -0
- package/dist/auth/outage.d.ts.map +1 -0
- package/dist/auth/parse-sealing-keys.d.ts +26 -0
- package/dist/auth/parse-sealing-keys.d.ts.map +1 -0
- package/dist/auth/passkeys/assert.d.ts +51 -0
- package/dist/auth/passkeys/assert.d.ts.map +1 -0
- package/dist/auth/passkeys/assertion-options.d.ts +9 -0
- package/dist/auth/passkeys/assertion-options.d.ts.map +1 -0
- package/dist/auth/passkeys/challenge.d.ts +19 -0
- package/dist/auth/passkeys/challenge.d.ts.map +1 -0
- package/dist/auth/passkeys/commit.d.ts +33 -0
- package/dist/auth/passkeys/commit.d.ts.map +1 -0
- package/dist/auth/passkeys/flows.d.ts +13 -0
- package/dist/auth/passkeys/flows.d.ts.map +1 -0
- package/dist/auth/passkeys/index.d.ts +12 -0
- package/dist/auth/passkeys/index.d.ts.map +1 -0
- package/dist/auth/passkeys/manage.d.ts +11 -0
- package/dist/auth/passkeys/manage.d.ts.map +1 -0
- package/dist/auth/passkeys/name.d.ts +4 -0
- package/dist/auth/passkeys/name.d.ts.map +1 -0
- package/dist/auth/passkeys/register.d.ts +20 -0
- package/dist/auth/passkeys/register.d.ts.map +1 -0
- package/dist/auth/passkeys/registration-options.d.ts +22 -0
- package/dist/auth/passkeys/registration-options.d.ts.map +1 -0
- package/dist/auth/passkeys/remove-all.d.ts +26 -0
- package/dist/auth/passkeys/remove-all.d.ts.map +1 -0
- package/dist/auth/passkeys/sign-in-options.d.ts +12 -0
- package/dist/auth/passkeys/sign-in-options.d.ts.map +1 -0
- package/dist/auth/passkeys/sign-in.d.ts +21 -0
- package/dist/auth/passkeys/sign-in.d.ts.map +1 -0
- package/dist/auth/passkeys/verifier.d.ts +113 -0
- package/dist/auth/passkeys/verifier.d.ts.map +1 -0
- package/dist/auth/passkeys/view.d.ts +5 -0
- package/dist/auth/passkeys/view.d.ts.map +1 -0
- package/dist/auth/passkeys/wiring.d.ts +24 -0
- package/dist/auth/passkeys/wiring.d.ts.map +1 -0
- package/dist/auth/password-written.d.ts +55 -0
- package/dist/auth/password-written.d.ts.map +1 -0
- package/dist/auth/port/assert-api-keys.d.ts +21 -0
- package/dist/auth/port/assert-api-keys.d.ts.map +1 -0
- package/dist/auth/port/assert-invitations.d.ts +15 -0
- package/dist/auth/port/assert-invitations.d.ts.map +1 -0
- package/dist/auth/port/assert-stores.d.ts +16 -0
- package/dist/auth/port/assert-stores.d.ts.map +1 -0
- package/dist/auth/port/memory/api-keys/capabilities.d.ts +8 -0
- package/dist/auth/port/memory/api-keys/capabilities.d.ts.map +1 -0
- package/dist/auth/port/memory/api-keys/index.d.ts +13 -0
- package/dist/auth/port/memory/api-keys/index.d.ts.map +1 -0
- package/dist/auth/port/memory/api-keys/pages.d.ts +7 -0
- package/dist/auth/port/memory/api-keys/pages.d.ts.map +1 -0
- package/dist/auth/port/memory/copy.d.ts +6 -0
- package/dist/auth/port/memory/copy.d.ts.map +1 -0
- package/dist/auth/port/memory/index.d.ts +10 -0
- package/dist/auth/port/memory/index.d.ts.map +1 -0
- package/dist/auth/port/memory/invitations-pending.d.ts +6 -0
- package/dist/auth/port/memory/invitations-pending.d.ts.map +1 -0
- package/dist/auth/port/memory/invitations.d.ts +12 -0
- package/dist/auth/port/memory/invitations.d.ts.map +1 -0
- package/dist/auth/port/memory/passkeys.d.ts +9 -0
- package/dist/auth/port/memory/passkeys.d.ts.map +1 -0
- package/dist/auth/port/memory/sessions.d.ts +4 -0
- package/dist/auth/port/memory/sessions.d.ts.map +1 -0
- package/dist/auth/port/memory/social-links.d.ts +10 -0
- package/dist/auth/port/memory/social-links.d.ts.map +1 -0
- package/dist/auth/port/memory/stores.d.ts +26 -0
- package/dist/auth/port/memory/stores.d.ts.map +1 -0
- package/dist/auth/port/memory/tokens.d.ts +4 -0
- package/dist/auth/port/memory/tokens.d.ts.map +1 -0
- package/dist/auth/port/memory/user-index.d.ts +20 -0
- package/dist/auth/port/memory/user-index.d.ts.map +1 -0
- package/dist/auth/port/memory/user-update.d.ts +10 -0
- package/dist/auth/port/memory/user-update.d.ts.map +1 -0
- package/dist/auth/port/memory/users.d.ts +4 -0
- package/dist/auth/port/memory/users.d.ts.map +1 -0
- package/dist/auth/port/types/api-keys.d.ts +199 -0
- package/dist/auth/port/types/api-keys.d.ts.map +1 -0
- package/dist/auth/port/types/credentials.d.ts +46 -0
- package/dist/auth/port/types/credentials.d.ts.map +1 -0
- package/dist/auth/port/types/index.d.ts +75 -0
- package/dist/auth/port/types/index.d.ts.map +1 -0
- package/dist/auth/port/types/invitations/index.d.ts +15 -0
- package/dist/auth/port/types/invitations/index.d.ts.map +1 -0
- package/dist/auth/port/types/invitations/page.d.ts +52 -0
- package/dist/auth/port/types/invitations/page.d.ts.map +1 -0
- package/dist/auth/port/types/invitations/records.d.ts +101 -0
- package/dist/auth/port/types/invitations/records.d.ts.map +1 -0
- package/dist/auth/port/types/invitations/store.d.ts +82 -0
- package/dist/auth/port/types/invitations/store.d.ts.map +1 -0
- package/dist/auth/port/types/json.d.ts +27 -0
- package/dist/auth/port/types/json.d.ts.map +1 -0
- package/dist/auth/port/types/passkeys.d.ts +94 -0
- package/dist/auth/port/types/passkeys.d.ts.map +1 -0
- package/dist/auth/port/types/sessions.d.ts +142 -0
- package/dist/auth/port/types/sessions.d.ts.map +1 -0
- package/dist/auth/port/types/social-links.d.ts +72 -0
- package/dist/auth/port/types/social-links.d.ts.map +1 -0
- package/dist/auth/port/types/stores.d.ts +48 -0
- package/dist/auth/port/types/stores.d.ts.map +1 -0
- package/dist/auth/port/types/tokens.d.ts +168 -0
- package/dist/auth/port/types/tokens.d.ts.map +1 -0
- package/dist/auth/port/types/users.d.ts +260 -0
- package/dist/auth/port/types/users.d.ts.map +1 -0
- package/dist/auth/prepared.d.ts +21 -0
- package/dist/auth/prepared.d.ts.map +1 -0
- package/dist/auth/proven-sign-in.d.ts +22 -0
- package/dist/auth/proven-sign-in.d.ts.map +1 -0
- package/dist/auth/sealer-for.d.ts +44 -0
- package/dist/auth/sealer-for.d.ts.map +1 -0
- package/dist/auth/sealing.d.ts +36 -0
- package/dist/auth/sealing.d.ts.map +1 -0
- package/dist/auth/second-factor/activate.d.ts +9 -0
- package/dist/auth/second-factor/activate.d.ts.map +1 -0
- package/dist/auth/second-factor/app-code-attempts.d.ts +47 -0
- package/dist/auth/second-factor/app-code-attempts.d.ts.map +1 -0
- package/dist/auth/second-factor/challenge.d.ts +15 -0
- package/dist/auth/second-factor/challenge.d.ts.map +1 -0
- package/dist/auth/second-factor/codes-left.d.ts +14 -0
- package/dist/auth/second-factor/codes-left.d.ts.map +1 -0
- package/dist/auth/second-factor/disable.d.ts +10 -0
- package/dist/auth/second-factor/disable.d.ts.map +1 -0
- package/dist/auth/second-factor/enroll.d.ts +6 -0
- package/dist/auth/second-factor/enroll.d.ts.map +1 -0
- package/dist/auth/second-factor/factor.d.ts +33 -0
- package/dist/auth/second-factor/factor.d.ts.map +1 -0
- package/dist/auth/second-factor/flows.d.ts +36 -0
- package/dist/auth/second-factor/flows.d.ts.map +1 -0
- package/dist/auth/second-factor/lifecycle.d.ts +14 -0
- package/dist/auth/second-factor/lifecycle.d.ts.map +1 -0
- package/dist/auth/second-factor/passkey-confirm.d.ts +21 -0
- package/dist/auth/second-factor/passkey-confirm.d.ts.map +1 -0
- package/dist/auth/second-factor/recovery-codes.d.ts +36 -0
- package/dist/auth/second-factor/recovery-codes.d.ts.map +1 -0
- package/dist/auth/second-factor/recovery.d.ts +20 -0
- package/dist/auth/second-factor/recovery.d.ts.map +1 -0
- package/dist/auth/second-factor/redeem.d.ts +42 -0
- package/dist/auth/second-factor/redeem.d.ts.map +1 -0
- package/dist/auth/second-factor/refusal.d.ts +6 -0
- package/dist/auth/second-factor/refusal.d.ts.map +1 -0
- package/dist/auth/second-factor/regenerate.d.ts +12 -0
- package/dist/auth/second-factor/regenerate.d.ts.map +1 -0
- package/dist/auth/second-factor/reseal.d.ts +17 -0
- package/dist/auth/second-factor/reseal.d.ts.map +1 -0
- package/dist/auth/second-factor/spend-recovery-code.d.ts +15 -0
- package/dist/auth/second-factor/spend-recovery-code.d.ts.map +1 -0
- package/dist/auth/secrets.d.ts +17 -0
- package/dist/auth/secrets.d.ts.map +1 -0
- package/dist/auth/sessions/amr.d.ts +36 -0
- package/dist/auth/sessions/amr.d.ts.map +1 -0
- package/dist/auth/sessions/authenticate.d.ts +12 -0
- package/dist/auth/sessions/authenticate.d.ts.map +1 -0
- package/dist/auth/sessions/collect-expired.d.ts +15 -0
- package/dist/auth/sessions/collect-expired.d.ts.map +1 -0
- package/dist/auth/sessions/cookie.d.ts +9 -0
- package/dist/auth/sessions/cookie.d.ts.map +1 -0
- package/dist/auth/sessions/fresh.d.ts +35 -0
- package/dist/auth/sessions/fresh.d.ts.map +1 -0
- package/dist/auth/sessions/index.d.ts +12 -0
- package/dist/auth/sessions/index.d.ts.map +1 -0
- package/dist/auth/sessions/open-session.d.ts +22 -0
- package/dist/auth/sessions/open-session.d.ts.map +1 -0
- package/dist/auth/sessions/presented-token.d.ts +25 -0
- package/dist/auth/sessions/presented-token.d.ts.map +1 -0
- package/dist/auth/sessions/shared-api.d.ts +17 -0
- package/dist/auth/sessions/shared-api.d.ts.map +1 -0
- package/dist/auth/sessions/standing.d.ts +32 -0
- package/dist/auth/sessions/standing.d.ts.map +1 -0
- package/dist/auth/shared-api.d.ts +142 -0
- package/dist/auth/shared-api.d.ts.map +1 -0
- package/dist/auth/sign-in-attempts.d.ts +45 -0
- package/dist/auth/sign-in-attempts.d.ts.map +1 -0
- package/dist/auth/sign-in-code.d.ts +26 -0
- package/dist/auth/sign-in-code.d.ts.map +1 -0
- package/dist/auth/social/attach.d.ts +31 -0
- package/dist/auth/social/attach.d.ts.map +1 -0
- package/dist/auth/social/begin.d.ts +30 -0
- package/dist/auth/social/begin.d.ts.map +1 -0
- package/dist/auth/social/complete-link.d.ts +17 -0
- package/dist/auth/social/complete-link.d.ts.map +1 -0
- package/dist/auth/social/complete.d.ts +54 -0
- package/dist/auth/social/complete.d.ts.map +1 -0
- package/dist/auth/social/cookie.d.ts +16 -0
- package/dist/auth/social/cookie.d.ts.map +1 -0
- package/dist/auth/social/find-provider.d.ts +23 -0
- package/dist/auth/social/find-provider.d.ts.map +1 -0
- package/dist/auth/social/finish.d.ts +60 -0
- package/dist/auth/social/finish.d.ts.map +1 -0
- package/dist/auth/social/flow-cookie-value.d.ts +26 -0
- package/dist/auth/social/flow-cookie-value.d.ts.map +1 -0
- package/dist/auth/social/flow-secret.d.ts +40 -0
- package/dist/auth/social/flow-secret.d.ts.map +1 -0
- package/dist/auth/social/index.d.ts +19 -0
- package/dist/auth/social/index.d.ts.map +1 -0
- package/dist/auth/social/link-holder.d.ts +33 -0
- package/dist/auth/social/link-holder.d.ts.map +1 -0
- package/dist/auth/social/provider-call.d.ts +31 -0
- package/dist/auth/social/provider-call.d.ts.map +1 -0
- package/dist/auth/social/redeem.d.ts +45 -0
- package/dist/auth/social/redeem.d.ts.map +1 -0
- package/dist/auth/social/return-to.d.ts +18 -0
- package/dist/auth/social/return-to.d.ts.map +1 -0
- package/dist/auth/social/sign-in.d.ts +41 -0
- package/dist/auth/social/sign-in.d.ts.map +1 -0
- package/dist/auth/social/sign-up.d.ts +37 -0
- package/dist/auth/social/sign-up.d.ts.map +1 -0
- package/dist/auth/social/start.d.ts +21 -0
- package/dist/auth/social/start.d.ts.map +1 -0
- package/dist/auth/social/step-up-proof.d.ts +26 -0
- package/dist/auth/social/step-up-proof.d.ts.map +1 -0
- package/dist/auth/social/step-up-request.d.ts +28 -0
- package/dist/auth/social/step-up-request.d.ts.map +1 -0
- package/dist/auth/social/step-up.d.ts +19 -0
- package/dist/auth/social/step-up.d.ts.map +1 -0
- package/dist/auth/social/types-of.d.ts +12 -0
- package/dist/auth/social/types-of.d.ts.map +1 -0
- package/dist/auth/social/unlink.d.ts +23 -0
- package/dist/auth/social/unlink.d.ts.map +1 -0
- package/dist/auth/social/wiring.d.ts +10 -0
- package/dist/auth/social/wiring.d.ts.map +1 -0
- package/dist/auth/standard-schema.d.ts +41 -0
- package/dist/auth/standard-schema.d.ts.map +1 -0
- package/dist/auth/step-up/codes.d.ts +35 -0
- package/dist/auth/step-up/codes.d.ts.map +1 -0
- package/dist/auth/step-up/flows.d.ts +18 -0
- package/dist/auth/step-up/flows.d.ts.map +1 -0
- package/dist/auth/step-up/open.d.ts +23 -0
- package/dist/auth/step-up/open.d.ts.map +1 -0
- package/dist/auth/step-up/passkey.d.ts +31 -0
- package/dist/auth/step-up/passkey.d.ts.map +1 -0
- package/dist/auth/step-up/request.d.ts +15 -0
- package/dist/auth/step-up/request.d.ts.map +1 -0
- package/dist/auth/step-up/spend.d.ts +4 -0
- package/dist/auth/step-up/spend.d.ts.map +1 -0
- package/dist/auth/totp.d.ts +36 -0
- package/dist/auth/totp.d.ts.map +1 -0
- package/dist/auth/types/api-keys-of.d.ts +19 -0
- package/dist/auth/types/api-keys-of.d.ts.map +1 -0
- package/dist/auth/types/api-keys.d.ts +164 -0
- package/dist/auth/types/api-keys.d.ts.map +1 -0
- package/dist/auth/types/avatar.d.ts +72 -0
- package/dist/auth/types/avatar.d.ts.map +1 -0
- package/dist/auth/types/change-email.d.ts +82 -0
- package/dist/auth/types/change-email.d.ts.map +1 -0
- package/dist/auth/types/checks.d.ts +147 -0
- package/dist/auth/types/checks.d.ts.map +1 -0
- package/dist/auth/types/email-flows.d.ts +117 -0
- package/dist/auth/types/email-flows.d.ts.map +1 -0
- package/dist/auth/types/find-by-email.d.ts +31 -0
- package/dist/auth/types/find-by-email.d.ts.map +1 -0
- package/dist/auth/types/find-or-create.d.ts +59 -0
- package/dist/auth/types/find-or-create.d.ts.map +1 -0
- package/dist/auth/types/index.d.ts +38 -0
- package/dist/auth/types/index.d.ts.map +1 -0
- package/dist/auth/types/inference.d.ts +62 -0
- package/dist/auth/types/inference.d.ts.map +1 -0
- package/dist/auth/types/invitations/api.d.ts +203 -0
- package/dist/auth/types/invitations/api.d.ts.map +1 -0
- package/dist/auth/types/invitations/history.d.ts +87 -0
- package/dist/auth/types/invitations/history.d.ts.map +1 -0
- package/dist/auth/types/invitations/index.d.ts +10 -0
- package/dist/auth/types/invitations/index.d.ts.map +1 -0
- package/dist/auth/types/invitations/invitation.d.ts +76 -0
- package/dist/auth/types/invitations/invitation.d.ts.map +1 -0
- package/dist/auth/types/invitations/issue-type.d.ts +15 -0
- package/dist/auth/types/invitations/issue-type.d.ts.map +1 -0
- package/dist/auth/types/invitations-of.d.ts +26 -0
- package/dist/auth/types/invitations-of.d.ts.map +1 -0
- package/dist/auth/types/janus.d.ts +51 -0
- package/dist/auth/types/janus.d.ts.map +1 -0
- package/dist/auth/types/magic-link.d.ts +69 -0
- package/dist/auth/types/magic-link.d.ts.map +1 -0
- package/dist/auth/types/passkeys.d.ts +183 -0
- package/dist/auth/types/passkeys.d.ts.map +1 -0
- package/dist/auth/types/password.d.ts +113 -0
- package/dist/auth/types/password.d.ts.map +1 -0
- package/dist/auth/types/prepared.d.ts +68 -0
- package/dist/auth/types/prepared.d.ts.map +1 -0
- package/dist/auth/types/proven-sign-in.d.ts +43 -0
- package/dist/auth/types/proven-sign-in.d.ts.map +1 -0
- package/dist/auth/types/reset-password.d.ts +46 -0
- package/dist/auth/types/reset-password.d.ts.map +1 -0
- package/dist/auth/types/second-factor.d.ts +164 -0
- package/dist/auth/types/second-factor.d.ts.map +1 -0
- package/dist/auth/types/session.d.ts +68 -0
- package/dist/auth/types/session.d.ts.map +1 -0
- package/dist/auth/types/shared-api.d.ts +96 -0
- package/dist/auth/types/shared-api.d.ts.map +1 -0
- package/dist/auth/types/sign-in.d.ts +102 -0
- package/dist/auth/types/sign-in.d.ts.map +1 -0
- package/dist/auth/types/social-flow.d.ts +28 -0
- package/dist/auth/types/social-flow.d.ts.map +1 -0
- package/dist/auth/types/social-step-up.d.ts +38 -0
- package/dist/auth/types/social-step-up.d.ts.map +1 -0
- package/dist/auth/types/social.d.ts +201 -0
- package/dist/auth/types/social.d.ts.map +1 -0
- package/dist/auth/types/step-up.d.ts +133 -0
- package/dist/auth/types/step-up.d.ts.map +1 -0
- package/dist/auth/types/type-api.d.ts +29 -0
- package/dist/auth/types/type-api.d.ts.map +1 -0
- package/dist/auth/types/user-type.d.ts +106 -0
- package/dist/auth/types/user-type.d.ts.map +1 -0
- package/dist/auth/types/user.d.ts +62 -0
- package/dist/auth/types/user.d.ts.map +1 -0
- package/dist/auth/types/verify-email.d.ts +190 -0
- package/dist/auth/types/verify-email.d.ts.map +1 -0
- package/dist/auth/users/any-type-api.d.ts +6 -0
- package/dist/auth/users/any-type-api.d.ts.map +1 -0
- package/dist/auth/users/by-login.d.ts +10 -0
- package/dist/auth/users/by-login.d.ts.map +1 -0
- package/dist/auth/users/change-password.d.ts +26 -0
- package/dist/auth/users/change-password.d.ts.map +1 -0
- package/dist/auth/users/delete.d.ts +10 -0
- package/dist/auth/users/delete.d.ts.map +1 -0
- package/dist/auth/users/email-move-guard.d.ts +20 -0
- package/dist/auth/users/email-move-guard.d.ts.map +1 -0
- package/dist/auth/users/email-prefix.d.ts +23 -0
- package/dist/auth/users/email-prefix.d.ts.map +1 -0
- package/dist/auth/users/fields-patch.d.ts +21 -0
- package/dist/auth/users/fields-patch.d.ts.map +1 -0
- package/dist/auth/users/find-by-email.d.ts +11 -0
- package/dist/auth/users/find-by-email.d.ts.map +1 -0
- package/dist/auth/users/find-many.d.ts +29 -0
- package/dist/auth/users/find-many.d.ts.map +1 -0
- package/dist/auth/users/find-or-create.d.ts +12 -0
- package/dist/auth/users/find-or-create.d.ts.map +1 -0
- package/dist/auth/users/flow-types.d.ts +15 -0
- package/dist/auth/users/flow-types.d.ts.map +1 -0
- package/dist/auth/users/index.d.ts +9 -0
- package/dist/auth/users/index.d.ts.map +1 -0
- package/dist/auth/users/insert.d.ts +15 -0
- package/dist/auth/users/insert.d.ts.map +1 -0
- package/dist/auth/users/name-prefix.d.ts +19 -0
- package/dist/auth/users/name-prefix.d.ts.map +1 -0
- package/dist/auth/users/password-flows.d.ts +11 -0
- package/dist/auth/users/password-flows.d.ts.map +1 -0
- package/dist/auth/users/record-flows.d.ts +11 -0
- package/dist/auth/users/record-flows.d.ts.map +1 -0
- package/dist/auth/users/sign-in.d.ts +24 -0
- package/dist/auth/users/sign-in.d.ts.map +1 -0
- package/dist/auth/users/sign-up.d.ts +13 -0
- package/dist/auth/users/sign-up.d.ts.map +1 -0
- package/dist/auth/users/type-api.d.ts +10 -0
- package/dist/auth/users/type-api.d.ts.map +1 -0
- package/dist/auth/users/update.d.ts +16 -0
- package/dist/auth/users/update.d.ts.map +1 -0
- package/dist/background/background.d.ts +22 -0
- package/dist/background/background.d.ts.map +1 -0
- package/dist/chunks/index-2ttdcz7n.js +354 -0
- package/dist/chunks/index-2ttdcz7n.js.map +16 -0
- package/dist/chunks/index-5dxynm32.js +85 -0
- package/dist/chunks/index-5dxynm32.js.map +10 -0
- package/dist/chunks/index-7h34nqrm.js +732 -0
- package/dist/chunks/index-7h34nqrm.js.map +24 -0
- package/dist/chunks/index-ftz0ne6j.js +127 -0
- package/dist/chunks/index-ftz0ne6j.js.map +11 -0
- package/dist/chunks/index-n8jxmxeg.js +64 -0
- package/dist/chunks/index-n8jxmxeg.js.map +11 -0
- package/dist/conformance/api-keys/cases/bound.d.ts +3 -0
- package/dist/conformance/api-keys/cases/bound.d.ts.map +1 -0
- package/dist/conformance/api-keys/cases/expiry.d.ts +3 -0
- package/dist/conformance/api-keys/cases/expiry.d.ts.map +1 -0
- package/dist/conformance/api-keys/cases/index.d.ts +4 -0
- package/dist/conformance/api-keys/cases/index.d.ts.map +1 -0
- package/dist/conformance/api-keys/cases/insert.d.ts +3 -0
- package/dist/conformance/api-keys/cases/insert.d.ts.map +1 -0
- package/dist/conformance/api-keys/cases/outage.d.ts +3 -0
- package/dist/conformance/api-keys/cases/outage.d.ts.map +1 -0
- package/dist/conformance/api-keys/cases/revoke.d.ts +3 -0
- package/dist/conformance/api-keys/cases/revoke.d.ts.map +1 -0
- package/dist/conformance/api-keys/cases/touch.d.ts +3 -0
- package/dist/conformance/api-keys/cases/touch.d.ts.map +1 -0
- package/dist/conformance/api-keys/cases/user-bound.d.ts +3 -0
- package/dist/conformance/api-keys/cases/user-bound.d.ts.map +1 -0
- package/dist/conformance/api-keys/describe.d.ts +20 -0
- package/dist/conformance/api-keys/describe.d.ts.map +1 -0
- package/dist/conformance/api-keys/fixtures.d.ts +4 -0
- package/dist/conformance/api-keys/fixtures.d.ts.map +1 -0
- package/dist/conformance/api-keys/index.d.ts +18 -0
- package/dist/conformance/api-keys/index.d.ts.map +1 -0
- package/dist/conformance/api-keys/reference.d.ts +4 -0
- package/dist/conformance/api-keys/reference.d.ts.map +1 -0
- package/dist/conformance/api-keys/types.d.ts +42 -0
- package/dist/conformance/api-keys/types.d.ts.map +1 -0
- package/dist/conformance/assert.d.ts +40 -0
- package/dist/conformance/assert.d.ts.map +1 -0
- package/dist/conformance/cases/outage.d.ts +3 -0
- package/dist/conformance/cases/outage.d.ts.map +1 -0
- package/dist/conformance/cases/outage.passkeys.d.ts +12 -0
- package/dist/conformance/cases/outage.passkeys.d.ts.map +1 -0
- package/dist/conformance/cases/passkeys/deletion.d.ts +4 -0
- package/dist/conformance/cases/passkeys/deletion.d.ts.map +1 -0
- package/dist/conformance/cases/passkeys/index.d.ts +8 -0
- package/dist/conformance/cases/passkeys/index.d.ts.map +1 -0
- package/dist/conformance/cases/passkeys/inserts.d.ts +4 -0
- package/dist/conformance/cases/passkeys/inserts.d.ts.map +1 -0
- package/dist/conformance/cases/passkeys/reads.d.ts +4 -0
- package/dist/conformance/cases/passkeys/reads.d.ts.map +1 -0
- package/dist/conformance/cases/passkeys/uses.d.ts +4 -0
- package/dist/conformance/cases/passkeys/uses.d.ts.map +1 -0
- package/dist/conformance/cases/sessions/deletion.d.ts +4 -0
- package/dist/conformance/cases/sessions/deletion.d.ts.map +1 -0
- package/dist/conformance/cases/sessions/extension.d.ts +4 -0
- package/dist/conformance/cases/sessions/extension.d.ts.map +1 -0
- package/dist/conformance/cases/sessions/index.d.ts +4 -0
- package/dist/conformance/cases/sessions/index.d.ts.map +1 -0
- package/dist/conformance/cases/sessions/inserts.d.ts +4 -0
- package/dist/conformance/cases/sessions/inserts.d.ts.map +1 -0
- package/dist/conformance/cases/sessions/list.d.ts +4 -0
- package/dist/conformance/cases/sessions/list.d.ts.map +1 -0
- package/dist/conformance/cases/sessions/reads.d.ts +4 -0
- package/dist/conformance/cases/sessions/reads.d.ts.map +1 -0
- package/dist/conformance/cases/sessions/reauthentication.d.ts +4 -0
- package/dist/conformance/cases/sessions/reauthentication.d.ts.map +1 -0
- package/dist/conformance/cases/sessions/revocation.d.ts +4 -0
- package/dist/conformance/cases/sessions/revocation.d.ts.map +1 -0
- package/dist/conformance/cases/social-links/deletion.d.ts +4 -0
- package/dist/conformance/cases/social-links/deletion.d.ts.map +1 -0
- package/dist/conformance/cases/social-links/index.d.ts +8 -0
- package/dist/conformance/cases/social-links/index.d.ts.map +1 -0
- package/dist/conformance/cases/social-links/inserts.d.ts +4 -0
- package/dist/conformance/cases/social-links/inserts.d.ts.map +1 -0
- package/dist/conformance/cases/social-links/reads.d.ts +4 -0
- package/dist/conformance/cases/social-links/reads.d.ts.map +1 -0
- package/dist/conformance/cases/tokens/attempts.d.ts +7 -0
- package/dist/conformance/cases/tokens/attempts.d.ts.map +1 -0
- package/dist/conformance/cases/tokens/change-email.d.ts +8 -0
- package/dist/conformance/cases/tokens/change-email.d.ts.map +1 -0
- package/dist/conformance/cases/tokens/deletion.d.ts +4 -0
- package/dist/conformance/cases/tokens/deletion.d.ts.map +1 -0
- package/dist/conformance/cases/tokens/index.d.ts +4 -0
- package/dist/conformance/cases/tokens/index.d.ts.map +1 -0
- package/dist/conformance/cases/tokens/inserts.d.ts +7 -0
- package/dist/conformance/cases/tokens/inserts.d.ts.map +1 -0
- package/dist/conformance/cases/tokens/kinds.d.ts +7 -0
- package/dist/conformance/cases/tokens/kinds.d.ts.map +1 -0
- package/dist/conformance/cases/tokens/redemption.d.ts +7 -0
- package/dist/conformance/cases/tokens/redemption.d.ts.map +1 -0
- package/dist/conformance/cases/tokens/social-flow.d.ts +8 -0
- package/dist/conformance/cases/tokens/social-flow.d.ts.map +1 -0
- package/dist/conformance/cases/tokens/spending.d.ts +7 -0
- package/dist/conformance/cases/tokens/spending.d.ts.map +1 -0
- package/dist/conformance/cases/users/avatar.d.ts +8 -0
- package/dist/conformance/cases/users/avatar.d.ts.map +1 -0
- package/dist/conformance/cases/users/batch.d.ts +8 -0
- package/dist/conformance/cases/users/batch.d.ts.map +1 -0
- package/dist/conformance/cases/users/deletion.d.ts +4 -0
- package/dist/conformance/cases/users/deletion.d.ts.map +1 -0
- package/dist/conformance/cases/users/index.d.ts +4 -0
- package/dist/conformance/cases/users/index.d.ts.map +1 -0
- package/dist/conformance/cases/users/inserts.d.ts +4 -0
- package/dist/conformance/cases/users/inserts.d.ts.map +1 -0
- package/dist/conformance/cases/users/listing.d.ts +4 -0
- package/dist/conformance/cases/users/listing.d.ts.map +1 -0
- package/dist/conformance/cases/users/patches.d.ts +7 -0
- package/dist/conformance/cases/users/patches.d.ts.map +1 -0
- package/dist/conformance/cases/users/reads.d.ts +7 -0
- package/dist/conformance/cases/users/reads.d.ts.map +1 -0
- package/dist/conformance/cases/users/second-factor.d.ts +16 -0
- package/dist/conformance/cases/users/second-factor.d.ts.map +1 -0
- package/dist/conformance/cases/users/versions.d.ts +7 -0
- package/dist/conformance/cases/users/versions.d.ts.map +1 -0
- package/dist/conformance/describe.d.ts +82 -0
- package/dist/conformance/describe.d.ts.map +1 -0
- package/dist/conformance/fixtures.d.ts +31 -0
- package/dist/conformance/fixtures.d.ts.map +1 -0
- package/dist/conformance/index.d.ts +46 -0
- package/dist/conformance/index.d.ts.map +1 -0
- package/dist/conformance/index.js +4442 -0
- package/dist/conformance/index.js.map +86 -0
- package/dist/conformance/invitations/cases/actors.d.ts +3 -0
- package/dist/conformance/invitations/cases/actors.d.ts.map +1 -0
- package/dist/conformance/invitations/cases/find-pending.d.ts +3 -0
- package/dist/conformance/invitations/cases/find-pending.d.ts.map +1 -0
- package/dist/conformance/invitations/cases/imported.d.ts +3 -0
- package/dist/conformance/invitations/cases/imported.d.ts.map +1 -0
- package/dist/conformance/invitations/cases/index.d.ts +4 -0
- package/dist/conformance/invitations/cases/index.d.ts.map +1 -0
- package/dist/conformance/invitations/cases/insert.d.ts +3 -0
- package/dist/conformance/invitations/cases/insert.d.ts.map +1 -0
- package/dist/conformance/invitations/cases/list-lapsed.d.ts +3 -0
- package/dist/conformance/invitations/cases/list-lapsed.d.ts.map +1 -0
- package/dist/conformance/invitations/cases/list-status.d.ts +3 -0
- package/dist/conformance/invitations/cases/list-status.d.ts.map +1 -0
- package/dist/conformance/invitations/cases/list.d.ts +3 -0
- package/dist/conformance/invitations/cases/list.d.ts.map +1 -0
- package/dist/conformance/invitations/cases/outage.d.ts +3 -0
- package/dist/conformance/invitations/cases/outage.d.ts.map +1 -0
- package/dist/conformance/invitations/cases/scope.d.ts +3 -0
- package/dist/conformance/invitations/cases/scope.d.ts.map +1 -0
- package/dist/conformance/invitations/cases/update.d.ts +3 -0
- package/dist/conformance/invitations/cases/update.d.ts.map +1 -0
- package/dist/conformance/invitations/describe.d.ts +20 -0
- package/dist/conformance/invitations/describe.d.ts.map +1 -0
- package/dist/conformance/invitations/fixtures.d.ts +4 -0
- package/dist/conformance/invitations/fixtures.d.ts.map +1 -0
- package/dist/conformance/invitations/index.d.ts +18 -0
- package/dist/conformance/invitations/index.d.ts.map +1 -0
- package/dist/conformance/invitations/reference.d.ts +4 -0
- package/dist/conformance/invitations/reference.d.ts.map +1 -0
- package/dist/conformance/invitations/types.d.ts +34 -0
- package/dist/conformance/invitations/types.d.ts.map +1 -0
- package/dist/conformance/reference.d.ts +13 -0
- package/dist/conformance/reference.d.ts.map +1 -0
- package/dist/conformance/relations/cases/deletion.d.ts +4 -0
- package/dist/conformance/relations/cases/deletion.d.ts.map +1 -0
- package/dist/conformance/relations/cases/holders.d.ts +9 -0
- package/dist/conformance/relations/cases/holders.d.ts.map +1 -0
- package/dist/conformance/relations/cases/index.d.ts +4 -0
- package/dist/conformance/relations/cases/index.d.ts.map +1 -0
- package/dist/conformance/relations/cases/outage.d.ts +3 -0
- package/dist/conformance/relations/cases/outage.d.ts.map +1 -0
- package/dist/conformance/relations/cases/reads.d.ts +8 -0
- package/dist/conformance/relations/cases/reads.d.ts.map +1 -0
- package/dist/conformance/relations/cases/traversal.d.ts +7 -0
- package/dist/conformance/relations/cases/traversal.d.ts.map +1 -0
- package/dist/conformance/relations/cases/writes.d.ts +4 -0
- package/dist/conformance/relations/cases/writes.d.ts.map +1 -0
- package/dist/conformance/relations/describe.d.ts +20 -0
- package/dist/conformance/relations/describe.d.ts.map +1 -0
- package/dist/conformance/relations/fixtures.d.ts +8 -0
- package/dist/conformance/relations/fixtures.d.ts.map +1 -0
- package/dist/conformance/relations/index.d.ts +18 -0
- package/dist/conformance/relations/index.d.ts.map +1 -0
- package/dist/conformance/relations/reference.d.ts +4 -0
- package/dist/conformance/relations/reference.d.ts.map +1 -0
- package/dist/conformance/relations/types.d.ts +34 -0
- package/dist/conformance/relations/types.d.ts.map +1 -0
- package/dist/conformance/types.d.ts +79 -0
- package/dist/conformance/types.d.ts.map +1 -0
- package/dist/errors/janus-error/base.d.ts +47 -0
- package/dist/errors/janus-error/base.d.ts.map +1 -0
- package/dist/errors/janus-error/codes.credentials.d.ts +36 -0
- package/dist/errors/janus-error/codes.credentials.d.ts.map +1 -0
- package/dist/errors/janus-error/codes.d.ts +23 -0
- package/dist/errors/janus-error/codes.d.ts.map +1 -0
- package/dist/errors/janus-error/codes.invitations.d.ts +52 -0
- package/dist/errors/janus-error/codes.invitations.d.ts.map +1 -0
- package/dist/errors/janus-error/codes.one-time.d.ts +63 -0
- package/dist/errors/janus-error/codes.one-time.d.ts.map +1 -0
- package/dist/errors/janus-error/codes.records.d.ts +86 -0
- package/dist/errors/janus-error/codes.records.d.ts.map +1 -0
- package/dist/errors/janus-error/codes.social.d.ts +88 -0
- package/dist/errors/janus-error/codes.social.d.ts.map +1 -0
- package/dist/errors/janus-error/index.d.ts +17 -0
- package/dist/errors/janus-error/index.d.ts.map +1 -0
- package/dist/errors/janus-error/options.d.ts +105 -0
- package/dist/errors/janus-error/options.d.ts.map +1 -0
- package/dist/errors/janus-error/refusals.d.ts +151 -0
- package/dist/errors/janus-error/refusals.d.ts.map +1 -0
- package/dist/errors/janus-error/status.d.ts +21 -0
- package/dist/errors/janus-error/status.d.ts.map +1 -0
- package/dist/errors/janus-error/store.d.ts +36 -0
- package/dist/errors/janus-error/store.d.ts.map +1 -0
- package/dist/ids/derived.d.ts +25 -0
- package/dist/ids/derived.d.ts.map +1 -0
- package/dist/ids/id.d.ts +55 -0
- package/dist/ids/id.d.ts.map +1 -0
- package/dist/index.d.ts +32 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6948 -0
- package/dist/index.js.map +208 -0
- package/dist/pagination/cursor-page.d.ts +53 -0
- package/dist/pagination/cursor-page.d.ts.map +1 -0
- package/dist/permissions/bound-model.d.ts +10 -0
- package/dist/permissions/bound-model.d.ts.map +1 -0
- package/dist/permissions/can.d.ts +13 -0
- package/dist/permissions/can.d.ts.map +1 -0
- package/dist/permissions/engine.d.ts +49 -0
- package/dist/permissions/engine.d.ts.map +1 -0
- package/dist/permissions/holders.d.ts +12 -0
- package/dist/permissions/holders.d.ts.map +1 -0
- package/dist/permissions/index.d.ts +36 -0
- package/dist/permissions/index.d.ts.map +1 -0
- package/dist/permissions/index.js +924 -0
- package/dist/permissions/index.js.map +28 -0
- package/dist/permissions/input.d.ts +43 -0
- package/dist/permissions/input.d.ts.map +1 -0
- package/dist/permissions/list.d.ts +16 -0
- package/dist/permissions/list.d.ts.map +1 -0
- package/dist/permissions/model/can.d.ts +41 -0
- package/dist/permissions/model/can.d.ts.map +1 -0
- package/dist/permissions/model/config.d.ts +36 -0
- package/dist/permissions/model/config.d.ts.map +1 -0
- package/dist/permissions/model/constraint.d.ts +37 -0
- package/dist/permissions/model/constraint.d.ts.map +1 -0
- package/dist/permissions/model/ctx.d.ts +23 -0
- package/dist/permissions/model/ctx.d.ts.map +1 -0
- package/dist/permissions/model/define.d.ts +78 -0
- package/dist/permissions/model/define.d.ts.map +1 -0
- package/dist/permissions/model/from-field.d.ts +31 -0
- package/dist/permissions/model/from-field.d.ts.map +1 -0
- package/dist/permissions/model/grant.d.ts +81 -0
- package/dist/permissions/model/grant.d.ts.map +1 -0
- package/dist/permissions/model/list.d.ts +48 -0
- package/dist/permissions/model/list.d.ts.map +1 -0
- package/dist/permissions/model/names.d.ts +51 -0
- package/dist/permissions/model/names.d.ts.map +1 -0
- package/dist/permissions/model/permissions.d.ts +48 -0
- package/dist/permissions/model/permissions.d.ts.map +1 -0
- package/dist/permissions/model/refs.d.ts +36 -0
- package/dist/permissions/model/refs.d.ts.map +1 -0
- package/dist/permissions/model/refusal.d.ts +13 -0
- package/dist/permissions/model/refusal.d.ts.map +1 -0
- package/dist/permissions/model/unions.d.ts +3 -0
- package/dist/permissions/model/unions.d.ts.map +1 -0
- package/dist/permissions/model/when.d.ts +16 -0
- package/dist/permissions/model/when.d.ts.map +1 -0
- package/dist/permissions/port/holders.d.ts +38 -0
- package/dist/permissions/port/holders.d.ts.map +1 -0
- package/dist/permissions/port/memory.d.ts +17 -0
- package/dist/permissions/port/memory.d.ts.map +1 -0
- package/dist/permissions/port/types.d.ts +101 -0
- package/dist/permissions/port/types.d.ts.map +1 -0
- package/dist/permissions/replace.d.ts +25 -0
- package/dist/permissions/replace.d.ts.map +1 -0
- package/dist/permissions/resolve/declared-names.d.ts +24 -0
- package/dist/permissions/resolve/declared-names.d.ts.map +1 -0
- package/dist/permissions/resolve/refuse-data-beyond-root.d.ts +11 -0
- package/dist/permissions/resolve/refuse-data-beyond-root.d.ts.map +1 -0
- package/dist/permissions/resolve/refuse-loops.d.ts +10 -0
- package/dist/permissions/resolve/refuse-loops.d.ts.map +1 -0
- package/dist/permissions/resolve/resolve-model.d.ts +13 -0
- package/dist/permissions/resolve/resolve-model.d.ts.map +1 -0
- package/dist/permissions/resolve/resolve-relation.d.ts +9 -0
- package/dist/permissions/resolve/resolve-relation.d.ts.map +1 -0
- package/dist/permissions/resolve/resolve-rule.d.ts +12 -0
- package/dist/permissions/resolve/resolve-rule.d.ts.map +1 -0
- package/dist/permissions/resolve/resolved.d.ts +52 -0
- package/dist/permissions/resolve/resolved.d.ts.map +1 -0
- package/dist/permissions/resolve/step.d.ts +4 -0
- package/dist/permissions/resolve/step.d.ts.map +1 -0
- package/dist/permissions/reverse.d.ts +53 -0
- package/dist/permissions/reverse.d.ts.map +1 -0
- package/dist/permissions/walk.d.ts +29 -0
- package/dist/permissions/walk.d.ts.map +1 -0
- package/dist/stores/guard.d.ts +24 -0
- package/dist/stores/guard.d.ts.map +1 -0
- package/dist/stores/storable.d.ts +15 -0
- package/dist/stores/storable.d.ts.map +1 -0
- package/dist/subjects/notation.d.ts +39 -0
- package/dist/subjects/notation.d.ts.map +1 -0
- package/dist/subjects/subject.d.ts +128 -0
- package/dist/subjects/subject.d.ts.map +1 -0
- package/dist/testing/index.d.ts +12 -0
- package/dist/testing/index.d.ts.map +1 -0
- package/dist/testing/index.js +26 -0
- package/dist/testing/index.js.map +10 -0
- package/dist/time/clock.d.ts +31 -0
- package/dist/time/clock.d.ts.map +1 -0
- package/dist/time/duration.d.ts +23 -0
- package/dist/time/duration.d.ts.map +1 -0
- package/docs/README.md +46 -0
- package/docs/guide/adapters.md +861 -0
- package/docs/guide/api-keys.md +316 -0
- package/docs/guide/avatars.md +334 -0
- package/docs/guide/devices.md +441 -0
- package/docs/guide/email-flows.md +880 -0
- package/docs/guide/errors.md +180 -0
- package/docs/guide/events.md +467 -0
- package/docs/guide/invitations.md +465 -0
- package/docs/guide/issuers.md +107 -0
- package/docs/guide/magic-link.md +580 -0
- package/docs/guide/migrating-invitations.md +142 -0
- package/docs/guide/passkeys.md +425 -0
- package/docs/guide/passwords.md +325 -0
- package/docs/guide/permissions.md +719 -0
- package/docs/guide/second-factor.md +1124 -0
- package/docs/guide/sessions.md +521 -0
- package/docs/guide/sign-in-code.md +631 -0
- package/docs/guide/social.md +648 -0
- package/docs/guide/step-up.md +262 -0
- package/docs/guide/users.md +557 -0
- package/docs/guide/vocabulary.md +316 -0
- package/docs/roadmap.md +102 -0
- package/docs/troubleshooting.md +3318 -0
- package/package.json +77 -5
|
@@ -0,0 +1,732 @@
|
|
|
1
|
+
import {
|
|
2
|
+
StoreConflict2,
|
|
3
|
+
NotFoundError2
|
|
4
|
+
} from "./index-2ttdcz7n.js";
|
|
5
|
+
|
|
6
|
+
// src/ids/id.ts
|
|
7
|
+
var HEX = Array.from({ length: 256 }, (_, i) => i.toString(16).padStart(2, "0"));
|
|
8
|
+
var lastMs = -1;
|
|
9
|
+
var sequence = 0;
|
|
10
|
+
var SEQUENCE_MAX = 4095;
|
|
11
|
+
function mintId2(now = Date.now()) {
|
|
12
|
+
let ms = now;
|
|
13
|
+
if (ms === lastMs) {
|
|
14
|
+
sequence += 1;
|
|
15
|
+
if (sequence > SEQUENCE_MAX) {
|
|
16
|
+
ms = lastMs + 1;
|
|
17
|
+
sequence = 0;
|
|
18
|
+
}
|
|
19
|
+
} else if (ms > lastMs) {
|
|
20
|
+
sequence = 0;
|
|
21
|
+
} else {
|
|
22
|
+
ms = lastMs;
|
|
23
|
+
sequence += 1;
|
|
24
|
+
if (sequence > SEQUENCE_MAX) {
|
|
25
|
+
ms = lastMs + 1;
|
|
26
|
+
sequence = 0;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
lastMs = ms;
|
|
30
|
+
const bytes = new Uint8Array(16);
|
|
31
|
+
crypto.getRandomValues(bytes.subarray(8));
|
|
32
|
+
bytes[0] = ms / 2 ** 40 & 255;
|
|
33
|
+
bytes[1] = ms / 2 ** 32 & 255;
|
|
34
|
+
bytes[2] = ms / 2 ** 24 & 255;
|
|
35
|
+
bytes[3] = ms / 2 ** 16 & 255;
|
|
36
|
+
bytes[4] = ms / 2 ** 8 & 255;
|
|
37
|
+
bytes[5] = ms & 255;
|
|
38
|
+
bytes[6] = 112 | sequence >> 8 & 15;
|
|
39
|
+
bytes[7] = sequence & 255;
|
|
40
|
+
bytes[8] = 128 | bytes[8] & 63;
|
|
41
|
+
return `${HEX[bytes[0]]}${HEX[bytes[1]]}${HEX[bytes[2]]}${HEX[bytes[3]]}-${HEX[bytes[4]]}${HEX[bytes[5]]}-${HEX[bytes[6]]}${HEX[bytes[7]]}-${HEX[bytes[8]]}${HEX[bytes[9]]}-${HEX[bytes[10]]}${HEX[bytes[11]]}${HEX[bytes[12]]}${HEX[bytes[13]]}${HEX[bytes[14]]}${HEX[bytes[15]]}`;
|
|
42
|
+
}
|
|
43
|
+
var UUID_V7 = /^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/;
|
|
44
|
+
function isId2(value) {
|
|
45
|
+
return UUID_V7.test(value);
|
|
46
|
+
}
|
|
47
|
+
function mintedAt2(id) {
|
|
48
|
+
const hex = id.replace(/-/g, "").slice(0, 12);
|
|
49
|
+
return new Date(Number.parseInt(hex, 16));
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// src/auth/port/memory/copy.ts
|
|
53
|
+
var copy = (value) => structuredClone(value);
|
|
54
|
+
|
|
55
|
+
// src/auth/port/memory/api-keys/pages.ts
|
|
56
|
+
function sameBound(stored, bound) {
|
|
57
|
+
return stored !== undefined && stored.type === bound.type && stored.id === bound.id;
|
|
58
|
+
}
|
|
59
|
+
function pageWhere(byId, { first, after }, matches) {
|
|
60
|
+
const ids = [...byId.values()].filter(matches).map((key) => key.id).filter((id) => after === null || id > after).sort();
|
|
61
|
+
const pageIds = ids.slice(0, first);
|
|
62
|
+
const last = pageIds.at(-1);
|
|
63
|
+
return {
|
|
64
|
+
items: pageIds.map((id) => copy(byId.get(id))),
|
|
65
|
+
nextCursor: ids.length > first && last !== undefined ? last : null
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
function deleteWhere(byId, matches) {
|
|
69
|
+
let deleted = 0;
|
|
70
|
+
for (const [id, stored] of byId) {
|
|
71
|
+
if (matches(stored)) {
|
|
72
|
+
byId.delete(id);
|
|
73
|
+
deleted += 1;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
return deleted;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
// src/auth/port/memory/api-keys/capabilities.ts
|
|
80
|
+
function boundMethods(byId) {
|
|
81
|
+
return {
|
|
82
|
+
async listBoundApiKeys(bound, page) {
|
|
83
|
+
return pageWhere(byId, page, (key) => sameBound(key.bound, bound));
|
|
84
|
+
},
|
|
85
|
+
async revokeBoundApiKeys(userId, bound, at) {
|
|
86
|
+
let revoked = 0;
|
|
87
|
+
for (const [id, stored] of byId) {
|
|
88
|
+
if (stored.userId === userId && stored.revokedAt === null && sameBound(stored.bound, bound)) {
|
|
89
|
+
byId.set(id, { ...stored, revokedAt: new Date(at) });
|
|
90
|
+
revoked += 1;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
return revoked;
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
function userBoundMethods(byId) {
|
|
98
|
+
return {
|
|
99
|
+
async listUserBoundApiKeys(userId, bound, page) {
|
|
100
|
+
return pageWhere(byId, page, (key) => key.userId === userId && (bound === null ? key.bound === undefined : sameBound(key.bound, bound)));
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
function expiryNoticeMethods(byId) {
|
|
105
|
+
return {
|
|
106
|
+
async listExpiringApiKeys({ now, before, first, after }) {
|
|
107
|
+
return pageWhere(byId, { first, after }, (key) => key.revokedAt === null && key.expiryNotifiedAt === undefined && key.expiresAt.getTime() > now.getTime() && key.expiresAt.getTime() <= before.getTime());
|
|
108
|
+
},
|
|
109
|
+
async markApiKeyExpiryNotified(id, at) {
|
|
110
|
+
const stored = byId.get(id);
|
|
111
|
+
if (stored === undefined || stored.expiryNotifiedAt !== undefined) {
|
|
112
|
+
return false;
|
|
113
|
+
}
|
|
114
|
+
byId.set(id, { ...stored, expiryNotifiedAt: new Date(at) });
|
|
115
|
+
return true;
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
// src/auth/port/memory/api-keys/index.ts
|
|
121
|
+
function createMemoryApiKeys2() {
|
|
122
|
+
const byId = new Map;
|
|
123
|
+
return {
|
|
124
|
+
async insertApiKey(record) {
|
|
125
|
+
if (!byId.has(record.id))
|
|
126
|
+
byId.set(record.id, copy(record));
|
|
127
|
+
},
|
|
128
|
+
async findApiKey(id) {
|
|
129
|
+
const stored = byId.get(id);
|
|
130
|
+
return stored === undefined ? null : copy(stored);
|
|
131
|
+
},
|
|
132
|
+
async listUserApiKeys(userId, page) {
|
|
133
|
+
return pageWhere(byId, page, (key) => key.userId === userId);
|
|
134
|
+
},
|
|
135
|
+
async touchApiKey(id, at, staleBefore) {
|
|
136
|
+
const stored = byId.get(id);
|
|
137
|
+
if (stored === undefined || stored.revokedAt !== null)
|
|
138
|
+
return false;
|
|
139
|
+
if (stored.lastUsedAt !== null && stored.lastUsedAt.getTime() >= staleBefore.getTime()) {
|
|
140
|
+
return false;
|
|
141
|
+
}
|
|
142
|
+
byId.set(id, { ...stored, lastUsedAt: new Date(at) });
|
|
143
|
+
return true;
|
|
144
|
+
},
|
|
145
|
+
async revokeApiKey(id, at) {
|
|
146
|
+
const stored = byId.get(id);
|
|
147
|
+
if (stored === undefined)
|
|
148
|
+
return false;
|
|
149
|
+
if (stored.revokedAt === null) {
|
|
150
|
+
byId.set(id, { ...stored, revokedAt: new Date(at) });
|
|
151
|
+
}
|
|
152
|
+
return true;
|
|
153
|
+
},
|
|
154
|
+
async revokeUserApiKeys(userId, at) {
|
|
155
|
+
let revoked = 0;
|
|
156
|
+
for (const [id, stored] of byId) {
|
|
157
|
+
if (stored.userId === userId && stored.revokedAt === null) {
|
|
158
|
+
byId.set(id, { ...stored, revokedAt: new Date(at) });
|
|
159
|
+
revoked += 1;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
return revoked;
|
|
163
|
+
},
|
|
164
|
+
async deleteUserApiKeys(userId) {
|
|
165
|
+
return deleteWhere(byId, (stored) => stored.userId === userId);
|
|
166
|
+
},
|
|
167
|
+
async deleteExpiredApiKeys(before) {
|
|
168
|
+
return deleteWhere(byId, (stored) => stored.expiresAt.getTime() <= before.getTime());
|
|
169
|
+
},
|
|
170
|
+
...boundMethods(byId),
|
|
171
|
+
...userBoundMethods(byId),
|
|
172
|
+
...expiryNoticeMethods(byId)
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
// src/auth/port/memory/invitations-pending.ts
|
|
176
|
+
function holdsPending(byId, record) {
|
|
177
|
+
for (const other of byId.values()) {
|
|
178
|
+
if (other.id !== record.id && other.status === "pending" && other.scope === record.scope && other.email === record.email) {
|
|
179
|
+
return true;
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
return false;
|
|
183
|
+
}
|
|
184
|
+
function findPendingInvitation(byId, scope, email) {
|
|
185
|
+
for (const stored of byId.values()) {
|
|
186
|
+
if (stored.status === "pending" && stored.scope === scope && stored.email === email) {
|
|
187
|
+
return copy(stored);
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
return null;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
// src/auth/port/memory/invitations.ts
|
|
194
|
+
function createMemoryInvitations2() {
|
|
195
|
+
const byId = new Map;
|
|
196
|
+
return {
|
|
197
|
+
insertInvitation: async (record) => insertInvitation(byId, record),
|
|
198
|
+
findInvitation: async (id) => findInvitation(byId, id),
|
|
199
|
+
findInvitationByCodeHash: async (codeHash) => findInvitationByCodeHash(byId, codeHash),
|
|
200
|
+
listScopeInvitations: async (scope, query) => listScopeInvitations(byId, scope, query),
|
|
201
|
+
findPendingInvitation: async (scope, email) => findPendingInvitation(byId, scope, email),
|
|
202
|
+
countScopeInvitations: async (scope, filter) => countScopeInvitations(byId, scope, filter),
|
|
203
|
+
countPendingInvitations: async (scope, now) => countPendingInvitations(byId, scope, now),
|
|
204
|
+
updateInvitation: async (id, ifVersion, patch) => updateInvitation(byId, id, ifVersion, patch),
|
|
205
|
+
deleteScopeInvitations: async (scope) => deleteWhere2(byId, (stored) => stored.scope === scope),
|
|
206
|
+
deleteExpiredInvitations: async (before) => deleteWhere2(byId, (stored) => stored.expiresAt.getTime() <= before.getTime())
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
function insertInvitation(byId, record) {
|
|
210
|
+
if (byId.has(record.id))
|
|
211
|
+
return true;
|
|
212
|
+
if (record.status === "pending" && holdsPending(byId, record))
|
|
213
|
+
return false;
|
|
214
|
+
byId.set(record.id, copy(record));
|
|
215
|
+
return true;
|
|
216
|
+
}
|
|
217
|
+
function findInvitation(byId, id) {
|
|
218
|
+
const stored = byId.get(id);
|
|
219
|
+
return stored === undefined ? null : copy(stored);
|
|
220
|
+
}
|
|
221
|
+
function findInvitationByCodeHash(byId, codeHash) {
|
|
222
|
+
for (const stored of byId.values()) {
|
|
223
|
+
if (stored.codeHash === codeHash)
|
|
224
|
+
return copy(stored);
|
|
225
|
+
}
|
|
226
|
+
return null;
|
|
227
|
+
}
|
|
228
|
+
function listScopeInvitations(byId, scope, {
|
|
229
|
+
status,
|
|
230
|
+
first,
|
|
231
|
+
after,
|
|
232
|
+
role = null,
|
|
233
|
+
ref = null,
|
|
234
|
+
order = "asc",
|
|
235
|
+
lapsed = null
|
|
236
|
+
}) {
|
|
237
|
+
const desc = order === "desc";
|
|
238
|
+
const ids = [...byId.values()].filter((invitation) => matches(invitation, scope, { status, role, ref, lapsed })).map((invitation) => invitation.id).filter((id) => after === null || (desc ? id < after : id > after)).sort();
|
|
239
|
+
if (desc)
|
|
240
|
+
ids.reverse();
|
|
241
|
+
const pageIds = ids.slice(0, first);
|
|
242
|
+
const last = pageIds.at(-1);
|
|
243
|
+
return {
|
|
244
|
+
items: pageIds.map((id) => copy(byId.get(id))),
|
|
245
|
+
nextCursor: ids.length > first && last !== undefined ? last : null
|
|
246
|
+
};
|
|
247
|
+
}
|
|
248
|
+
function matches(invitation, scope, filter) {
|
|
249
|
+
return invitation.scope === scope && (filter.status === null || invitation.status === filter.status) && (filter.role === null || invitation.role === filter.role) && (filter.ref === null || (invitation.ref ?? null) === filter.ref) && keptByLapsed(invitation, filter.lapsed);
|
|
250
|
+
}
|
|
251
|
+
function keptByLapsed(invitation, lapsed) {
|
|
252
|
+
if (lapsed == null)
|
|
253
|
+
return true;
|
|
254
|
+
const isLapsed = invitation.status === "pending" && invitation.expiresAt.getTime() <= lapsed.now.getTime();
|
|
255
|
+
return lapsed.mode === "only" ? isLapsed : !isLapsed;
|
|
256
|
+
}
|
|
257
|
+
function countScopeInvitations(byId, scope, filter) {
|
|
258
|
+
let count = 0;
|
|
259
|
+
for (const stored of byId.values()) {
|
|
260
|
+
if (matches(stored, scope, filter))
|
|
261
|
+
count += 1;
|
|
262
|
+
}
|
|
263
|
+
return count;
|
|
264
|
+
}
|
|
265
|
+
function countPendingInvitations(byId, scope, now) {
|
|
266
|
+
let count = 0;
|
|
267
|
+
for (const stored of byId.values()) {
|
|
268
|
+
if (stored.scope === scope && stored.status === "pending" && stored.expiresAt.getTime() > now.getTime()) {
|
|
269
|
+
count += 1;
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
return count;
|
|
273
|
+
}
|
|
274
|
+
function updateInvitation(byId, id, ifVersion, patch) {
|
|
275
|
+
const stored = byId.get(id);
|
|
276
|
+
if (stored === undefined)
|
|
277
|
+
return null;
|
|
278
|
+
if (stored.version !== ifVersion) {
|
|
279
|
+
throw new StoreConflict2("version", `updateInvitation: expected version ${ifVersion}, found ${stored.version}`, {
|
|
280
|
+
expectedVersion: ifVersion,
|
|
281
|
+
actualVersion: stored.version,
|
|
282
|
+
operation: "updateInvitation"
|
|
283
|
+
});
|
|
284
|
+
}
|
|
285
|
+
const next = {
|
|
286
|
+
...stored,
|
|
287
|
+
...definedOnly(patch),
|
|
288
|
+
version: stored.version + 1
|
|
289
|
+
};
|
|
290
|
+
if (next.status === "pending" && holdsPending(byId, next)) {
|
|
291
|
+
throw new StoreConflict2("pending", "updateInvitation: another pending invitation holds this scope and address", { operation: "updateInvitation" });
|
|
292
|
+
}
|
|
293
|
+
byId.set(id, copy(next));
|
|
294
|
+
return copy(next);
|
|
295
|
+
}
|
|
296
|
+
function definedOnly(patch) {
|
|
297
|
+
return Object.fromEntries(Object.entries(patch).filter(([, value]) => value !== undefined));
|
|
298
|
+
}
|
|
299
|
+
function deleteWhere2(byId, matches) {
|
|
300
|
+
let deleted = 0;
|
|
301
|
+
for (const [id, stored] of byId) {
|
|
302
|
+
if (matches(stored)) {
|
|
303
|
+
byId.delete(id);
|
|
304
|
+
deleted += 1;
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
return deleted;
|
|
308
|
+
}
|
|
309
|
+
// src/auth/port/memory/passkeys.ts
|
|
310
|
+
function memoryPasskeyStore() {
|
|
311
|
+
const byCredential = new Map;
|
|
312
|
+
return {
|
|
313
|
+
async insertPasskey(record) {
|
|
314
|
+
const held = byCredential.get(record.credentialId);
|
|
315
|
+
if (held !== undefined)
|
|
316
|
+
return copy(held);
|
|
317
|
+
byCredential.set(record.credentialId, copy(record));
|
|
318
|
+
return copy(record);
|
|
319
|
+
},
|
|
320
|
+
async findPasskey(credentialId) {
|
|
321
|
+
const stored = byCredential.get(credentialId);
|
|
322
|
+
return stored === undefined ? null : copy(stored);
|
|
323
|
+
},
|
|
324
|
+
async listUserPasskeys(userId) {
|
|
325
|
+
return [...byCredential.values()].filter((passkey) => passkey.userId === userId).map(copy);
|
|
326
|
+
},
|
|
327
|
+
async recordPasskeyUse(userId, credentialId, use, ifCounter) {
|
|
328
|
+
const stored = byCredential.get(credentialId);
|
|
329
|
+
if (stored?.userId !== userId || stored.counter !== ifCounter) {
|
|
330
|
+
return null;
|
|
331
|
+
}
|
|
332
|
+
const updated = {
|
|
333
|
+
...stored,
|
|
334
|
+
counter: use.counter,
|
|
335
|
+
backedUp: use.backedUp,
|
|
336
|
+
lastUsedAt: new Date(use.lastUsedAt)
|
|
337
|
+
};
|
|
338
|
+
byCredential.set(credentialId, updated);
|
|
339
|
+
return copy(updated);
|
|
340
|
+
},
|
|
341
|
+
async renamePasskey(userId, credentialId, name) {
|
|
342
|
+
const stored = byCredential.get(credentialId);
|
|
343
|
+
if (stored?.userId !== userId)
|
|
344
|
+
return false;
|
|
345
|
+
byCredential.set(credentialId, { ...stored, name });
|
|
346
|
+
return true;
|
|
347
|
+
},
|
|
348
|
+
async deletePasskey(userId, credentialId) {
|
|
349
|
+
if (byCredential.get(credentialId)?.userId !== userId)
|
|
350
|
+
return false;
|
|
351
|
+
byCredential.delete(credentialId);
|
|
352
|
+
return true;
|
|
353
|
+
},
|
|
354
|
+
async deleteUserPasskeys(userId) {
|
|
355
|
+
let deleted = 0;
|
|
356
|
+
for (const [key, stored] of byCredential) {
|
|
357
|
+
if (stored.userId === userId) {
|
|
358
|
+
byCredential.delete(key);
|
|
359
|
+
deleted += 1;
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
return deleted;
|
|
363
|
+
}
|
|
364
|
+
};
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
// src/auth/port/memory/sessions.ts
|
|
368
|
+
function memorySessionStore() {
|
|
369
|
+
const index = {
|
|
370
|
+
byId: new Map,
|
|
371
|
+
byTokenHash: new Map
|
|
372
|
+
};
|
|
373
|
+
const { byId, byTokenHash } = index;
|
|
374
|
+
return {
|
|
375
|
+
async insertSession(record) {
|
|
376
|
+
if (byId.has(record.id))
|
|
377
|
+
return;
|
|
378
|
+
const written = copy(record);
|
|
379
|
+
byId.set(written.id, written);
|
|
380
|
+
byTokenHash.set(written.tokenHash, written.id);
|
|
381
|
+
},
|
|
382
|
+
async findSessionByTokenHash(tokenHash) {
|
|
383
|
+
const id = byTokenHash.get(tokenHash);
|
|
384
|
+
const stored = id === undefined ? undefined : byId.get(id);
|
|
385
|
+
return stored === undefined ? null : copy(stored);
|
|
386
|
+
},
|
|
387
|
+
async extendSession(id, expiresAt, lastUsedAt) {
|
|
388
|
+
return standingWrite(index, id, {
|
|
389
|
+
expiresAt: new Date(expiresAt),
|
|
390
|
+
...lastUsedAt === undefined ? {} : { lastUsedAt: new Date(lastUsedAt) }
|
|
391
|
+
});
|
|
392
|
+
},
|
|
393
|
+
async reauthenticateSession(id, at, amr) {
|
|
394
|
+
return standingWrite(index, id, {
|
|
395
|
+
authenticatedAt: new Date(at),
|
|
396
|
+
...amr === undefined ? {} : { amr: [...amr] }
|
|
397
|
+
});
|
|
398
|
+
},
|
|
399
|
+
async revokeSession(id, at) {
|
|
400
|
+
const stored = byId.get(id);
|
|
401
|
+
if (stored === undefined)
|
|
402
|
+
return false;
|
|
403
|
+
if (stored.revokedAt === null)
|
|
404
|
+
revoke(index, id, stored, at);
|
|
405
|
+
return true;
|
|
406
|
+
},
|
|
407
|
+
async listUserSessions(userId, now) {
|
|
408
|
+
const listed = [];
|
|
409
|
+
for (const stored of byId.values()) {
|
|
410
|
+
if (stored.userId === userId && stored.revokedAt === null && stored.expiresAt.getTime() > now.getTime()) {
|
|
411
|
+
listed.push(copy(stored));
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
return listed;
|
|
415
|
+
},
|
|
416
|
+
async revokeUserSessions(userId, at, except, issuedBefore) {
|
|
417
|
+
let revoked = 0;
|
|
418
|
+
for (const [id, stored] of byId) {
|
|
419
|
+
if (stored.userId === userId && stored.revokedAt === null && id !== except && (issuedBefore === undefined || stored.createdAt.getTime() < issuedBefore.getTime())) {
|
|
420
|
+
revoke(index, id, stored, at);
|
|
421
|
+
revoked += 1;
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
return revoked;
|
|
425
|
+
},
|
|
426
|
+
async deleteUserSessions(userId) {
|
|
427
|
+
return deleteWhere3(index, (stored) => stored.userId === userId);
|
|
428
|
+
},
|
|
429
|
+
async deleteExpiredSessions(before) {
|
|
430
|
+
return deleteWhere3(index, (stored) => stored.expiresAt.getTime() <= before.getTime());
|
|
431
|
+
}
|
|
432
|
+
};
|
|
433
|
+
}
|
|
434
|
+
function standingWrite({ byId }, id, patch) {
|
|
435
|
+
const stored = byId.get(id);
|
|
436
|
+
if (stored === undefined || stored.revokedAt !== null)
|
|
437
|
+
return null;
|
|
438
|
+
const written = { ...stored, ...patch };
|
|
439
|
+
byId.set(id, written);
|
|
440
|
+
return copy(written);
|
|
441
|
+
}
|
|
442
|
+
function revoke({ byId }, id, stored, at) {
|
|
443
|
+
byId.set(id, { ...stored, revokedAt: new Date(at) });
|
|
444
|
+
}
|
|
445
|
+
function deleteWhere3({ byId, byTokenHash }, matches) {
|
|
446
|
+
let deleted = 0;
|
|
447
|
+
for (const [id, stored] of byId) {
|
|
448
|
+
if (matches(stored)) {
|
|
449
|
+
byId.delete(id);
|
|
450
|
+
byTokenHash.delete(stored.tokenHash);
|
|
451
|
+
deleted += 1;
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
return deleted;
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
// src/auth/port/memory/social-links.ts
|
|
458
|
+
function memorySocialLinkStore() {
|
|
459
|
+
const byPair = new Map;
|
|
460
|
+
return {
|
|
461
|
+
async insertSocialLink(record) {
|
|
462
|
+
const key = keyOf(record.provider, record.accountId);
|
|
463
|
+
const held = byPair.get(key);
|
|
464
|
+
if (held !== undefined)
|
|
465
|
+
return copy(held);
|
|
466
|
+
byPair.set(key, copy(record));
|
|
467
|
+
return copy(record);
|
|
468
|
+
},
|
|
469
|
+
async findSocialLink(provider, accountId) {
|
|
470
|
+
const stored = byPair.get(keyOf(provider, accountId));
|
|
471
|
+
return stored === undefined ? null : copy(stored);
|
|
472
|
+
},
|
|
473
|
+
async listUserSocialLinks(userId) {
|
|
474
|
+
return [...byPair.values()].filter((link) => link.userId === userId).map(copy);
|
|
475
|
+
},
|
|
476
|
+
async countSocialLinks(provider) {
|
|
477
|
+
let count = 0;
|
|
478
|
+
for (const link of byPair.values()) {
|
|
479
|
+
if (link.provider === provider)
|
|
480
|
+
count += 1;
|
|
481
|
+
}
|
|
482
|
+
return count;
|
|
483
|
+
},
|
|
484
|
+
async deleteSocialLink(userId, provider, accountId) {
|
|
485
|
+
const key = keyOf(provider, accountId);
|
|
486
|
+
if (byPair.get(key)?.userId !== userId)
|
|
487
|
+
return false;
|
|
488
|
+
byPair.delete(key);
|
|
489
|
+
return true;
|
|
490
|
+
},
|
|
491
|
+
async deleteUserSocialLinks(userId) {
|
|
492
|
+
let deleted = 0;
|
|
493
|
+
for (const [key, stored] of byPair) {
|
|
494
|
+
if (stored.userId === userId) {
|
|
495
|
+
byPair.delete(key);
|
|
496
|
+
deleted += 1;
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
return deleted;
|
|
500
|
+
}
|
|
501
|
+
};
|
|
502
|
+
}
|
|
503
|
+
function keyOf(provider, accountId) {
|
|
504
|
+
return JSON.stringify([provider, accountId]);
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
// src/auth/port/memory/tokens.ts
|
|
508
|
+
function memoryTokenStore() {
|
|
509
|
+
const byTokenHash = new Map;
|
|
510
|
+
return {
|
|
511
|
+
async insertToken(record) {
|
|
512
|
+
if (byTokenHash.has(record.tokenHash))
|
|
513
|
+
return;
|
|
514
|
+
byTokenHash.set(record.tokenHash, copy(record));
|
|
515
|
+
},
|
|
516
|
+
async consumeToken(tokenHash, kind, at, userId) {
|
|
517
|
+
return consume(byTokenHash, tokenHash, kind, at, userId);
|
|
518
|
+
},
|
|
519
|
+
async countAttempt(tokenHash, kind) {
|
|
520
|
+
return count(byTokenHash, tokenHash, kind);
|
|
521
|
+
},
|
|
522
|
+
async spendUserTokens(userId, kind, at, except) {
|
|
523
|
+
let spent = 0;
|
|
524
|
+
for (const [tokenHash, stored] of byTokenHash) {
|
|
525
|
+
if (tokenHash !== except && stored.userId === userId && stored.kind === kind && stored.spentAt === null) {
|
|
526
|
+
byTokenHash.set(tokenHash, { ...stored, spentAt: new Date(at) });
|
|
527
|
+
spent += 1;
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
return spent;
|
|
531
|
+
},
|
|
532
|
+
async deleteUserTokens(userId) {
|
|
533
|
+
let deleted = 0;
|
|
534
|
+
for (const [tokenHash, stored] of byTokenHash) {
|
|
535
|
+
if (stored.userId === userId) {
|
|
536
|
+
byTokenHash.delete(tokenHash);
|
|
537
|
+
deleted += 1;
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
return deleted;
|
|
541
|
+
},
|
|
542
|
+
async deleteExpiredTokens(before) {
|
|
543
|
+
let deleted = 0;
|
|
544
|
+
for (const [tokenHash, stored] of byTokenHash) {
|
|
545
|
+
if (stored.expiresAt.getTime() <= before.getTime()) {
|
|
546
|
+
byTokenHash.delete(tokenHash);
|
|
547
|
+
deleted += 1;
|
|
548
|
+
}
|
|
549
|
+
}
|
|
550
|
+
return deleted;
|
|
551
|
+
}
|
|
552
|
+
};
|
|
553
|
+
}
|
|
554
|
+
function consume(byTokenHash, tokenHash, kind, at, userId) {
|
|
555
|
+
const stored = byTokenHash.get(tokenHash);
|
|
556
|
+
if (stored === undefined || stored.kind !== kind)
|
|
557
|
+
return null;
|
|
558
|
+
if (userId !== undefined && stored.userId !== userId)
|
|
559
|
+
return null;
|
|
560
|
+
const before = copy(stored);
|
|
561
|
+
if (stored.spentAt === null) {
|
|
562
|
+
byTokenHash.set(tokenHash, { ...stored, spentAt: new Date(at) });
|
|
563
|
+
}
|
|
564
|
+
return before;
|
|
565
|
+
}
|
|
566
|
+
function count(byTokenHash, tokenHash, kind) {
|
|
567
|
+
const stored = byTokenHash.get(tokenHash);
|
|
568
|
+
if (stored === undefined || stored.kind !== kind)
|
|
569
|
+
return null;
|
|
570
|
+
if (stored.spentAt !== null)
|
|
571
|
+
return copy(stored);
|
|
572
|
+
const counted = { ...stored, attempts: stored.attempts + 1 };
|
|
573
|
+
byTokenHash.set(tokenHash, counted);
|
|
574
|
+
return copy(counted);
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
// src/auth/port/memory/user-index.ts
|
|
578
|
+
var keyOf2 = (type, login) => `${type}\x00${login}`;
|
|
579
|
+
var takenBy = ({ byLogin }, type, logins, id) => logins.find((login) => {
|
|
580
|
+
const holder = byLogin.get(keyOf2(type, login));
|
|
581
|
+
return holder !== undefined && holder !== id;
|
|
582
|
+
});
|
|
583
|
+
var taken = (operation, type, login) => new StoreConflict2("login", `${operation}: the login is taken by another ${type}`, { login, userType: type, operation });
|
|
584
|
+
function indexLogins({ byLogin }, record) {
|
|
585
|
+
for (const login of record.logins) {
|
|
586
|
+
byLogin.set(keyOf2(record.type, login), record.id);
|
|
587
|
+
}
|
|
588
|
+
}
|
|
589
|
+
function dropLogins({ byLogin }, record) {
|
|
590
|
+
for (const login of record.logins) {
|
|
591
|
+
byLogin.delete(keyOf2(record.type, login));
|
|
592
|
+
}
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
// src/auth/port/memory/user-update.ts
|
|
596
|
+
function updateStored(index, id, patch, ifVersion) {
|
|
597
|
+
const stored = index.byId.get(id);
|
|
598
|
+
if (stored === undefined) {
|
|
599
|
+
throw new NotFoundError2("updateUser: no user has this id", {
|
|
600
|
+
userId: id,
|
|
601
|
+
operation: "updateUser"
|
|
602
|
+
});
|
|
603
|
+
}
|
|
604
|
+
if (stored.version !== ifVersion) {
|
|
605
|
+
throw new StoreConflict2("version", `updateUser: expected version ${ifVersion}, found ${stored.version}`, {
|
|
606
|
+
userId: id,
|
|
607
|
+
expectedVersion: ifVersion,
|
|
608
|
+
actualVersion: stored.version,
|
|
609
|
+
operation: "updateUser"
|
|
610
|
+
});
|
|
611
|
+
}
|
|
612
|
+
if (patch.logins !== undefined) {
|
|
613
|
+
const collision = takenBy(index, stored.type, patch.logins, id);
|
|
614
|
+
if (collision !== undefined) {
|
|
615
|
+
throw taken("updateUser", stored.type, collision);
|
|
616
|
+
}
|
|
617
|
+
}
|
|
618
|
+
const written = applyPatch(stored, copy(patch));
|
|
619
|
+
index.byId.set(id, written);
|
|
620
|
+
if (patch.logins !== undefined) {
|
|
621
|
+
dropLogins(index, stored);
|
|
622
|
+
indexLogins(index, written);
|
|
623
|
+
}
|
|
624
|
+
return copy(written);
|
|
625
|
+
}
|
|
626
|
+
function applyPatch(stored, patch) {
|
|
627
|
+
const { nameKey: _kept, ...unnamed } = stored;
|
|
628
|
+
const nameKey = patch.nameKey === undefined ? _kept : patch.nameKey;
|
|
629
|
+
return {
|
|
630
|
+
...unnamed,
|
|
631
|
+
...nameKey === undefined || nameKey === null ? {} : { nameKey },
|
|
632
|
+
schemaVersion: patch.schemaVersion ?? stored.schemaVersion,
|
|
633
|
+
active: patch.active ?? stored.active,
|
|
634
|
+
fields: patch.fields ?? stored.fields,
|
|
635
|
+
logins: patch.logins ?? stored.logins,
|
|
636
|
+
password: patch.password === undefined ? stored.password : patch.password,
|
|
637
|
+
secondFactor: patch.secondFactor === undefined ? stored.secondFactor : patch.secondFactor,
|
|
638
|
+
avatar: patch.avatar === undefined ? stored.avatar : patch.avatar,
|
|
639
|
+
emailVerifiedAt: patch.emailVerifiedAt === undefined ? stored.emailVerifiedAt : patch.emailVerifiedAt,
|
|
640
|
+
version: stored.version + 1,
|
|
641
|
+
updatedAt: patch.updatedAt
|
|
642
|
+
};
|
|
643
|
+
}
|
|
644
|
+
|
|
645
|
+
// src/auth/port/memory/users.ts
|
|
646
|
+
function memoryUserStore() {
|
|
647
|
+
const index = {
|
|
648
|
+
byId: new Map,
|
|
649
|
+
byLogin: new Map
|
|
650
|
+
};
|
|
651
|
+
const { byId, byLogin } = index;
|
|
652
|
+
return {
|
|
653
|
+
async insertUser(record) {
|
|
654
|
+
const stored = byId.get(record.id);
|
|
655
|
+
if (stored !== undefined)
|
|
656
|
+
return copy(stored);
|
|
657
|
+
const collision = takenBy(index, record.type, record.logins, record.id);
|
|
658
|
+
if (collision !== undefined) {
|
|
659
|
+
throw taken("insertUser", record.type, collision);
|
|
660
|
+
}
|
|
661
|
+
const written = copy(record);
|
|
662
|
+
byId.set(written.id, written);
|
|
663
|
+
indexLogins(index, written);
|
|
664
|
+
return copy(written);
|
|
665
|
+
},
|
|
666
|
+
async findUser(id) {
|
|
667
|
+
const stored = byId.get(id);
|
|
668
|
+
return stored === undefined ? null : copy(stored);
|
|
669
|
+
},
|
|
670
|
+
async findUsers(ids) {
|
|
671
|
+
return [...new Set(ids)].flatMap((id) => {
|
|
672
|
+
const stored = byId.get(id);
|
|
673
|
+
return stored === undefined ? [] : [copy(stored)];
|
|
674
|
+
});
|
|
675
|
+
},
|
|
676
|
+
async findUserByLogin(type, login) {
|
|
677
|
+
const id = byLogin.get(keyOf2(type, login));
|
|
678
|
+
const stored = id === undefined ? undefined : byId.get(id);
|
|
679
|
+
return stored === undefined ? null : copy(stored);
|
|
680
|
+
},
|
|
681
|
+
async listUsers({ type, loginPrefix, namePrefix, after, limit }) {
|
|
682
|
+
const ids = [...byId.values()].filter((user) => user.type === type && holdsPrefix(user, loginPrefix) && namedPrefix(user, namePrefix)).map((user) => user.id).filter((id) => after === null || id > after).sort();
|
|
683
|
+
const pageIds = ids.slice(0, limit);
|
|
684
|
+
const last = pageIds.at(-1);
|
|
685
|
+
return {
|
|
686
|
+
items: pageIds.map((id) => copy(byId.get(id))),
|
|
687
|
+
nextCursor: ids.length > limit && last !== undefined ? last : null
|
|
688
|
+
};
|
|
689
|
+
},
|
|
690
|
+
async countUsers({ type, loginPrefix, namePrefix }) {
|
|
691
|
+
let count = 0;
|
|
692
|
+
for (const user of byId.values()) {
|
|
693
|
+
if (user.type === type && holdsPrefix(user, loginPrefix) && namedPrefix(user, namePrefix)) {
|
|
694
|
+
count += 1;
|
|
695
|
+
}
|
|
696
|
+
}
|
|
697
|
+
return count;
|
|
698
|
+
},
|
|
699
|
+
async updateUser(id, patch, ifVersion) {
|
|
700
|
+
return updateStored(index, id, patch, ifVersion);
|
|
701
|
+
},
|
|
702
|
+
async deleteUser(id) {
|
|
703
|
+
const stored = byId.get(id);
|
|
704
|
+
if (stored === undefined)
|
|
705
|
+
return false;
|
|
706
|
+
byId.delete(id);
|
|
707
|
+
dropLogins(index, stored);
|
|
708
|
+
return true;
|
|
709
|
+
}
|
|
710
|
+
};
|
|
711
|
+
}
|
|
712
|
+
function holdsPrefix(user, prefix) {
|
|
713
|
+
return prefix === undefined || user.logins.some((login) => login.startsWith(prefix));
|
|
714
|
+
}
|
|
715
|
+
function namedPrefix(user, prefix) {
|
|
716
|
+
return prefix === undefined || user.nameKey?.startsWith(prefix) === true;
|
|
717
|
+
}
|
|
718
|
+
|
|
719
|
+
// src/auth/port/memory/stores.ts
|
|
720
|
+
function createMemoryStores2() {
|
|
721
|
+
return {
|
|
722
|
+
users: memoryUserStore(),
|
|
723
|
+
sessions: memorySessionStore(),
|
|
724
|
+
tokens: memoryTokenStore(),
|
|
725
|
+
socialLinks: memorySocialLinkStore(),
|
|
726
|
+
passkeys: memoryPasskeyStore()
|
|
727
|
+
};
|
|
728
|
+
}
|
|
729
|
+
export { mintId2, isId2, mintedAt2, createMemoryApiKeys2, createMemoryInvitations2, createMemoryStores2 };
|
|
730
|
+
|
|
731
|
+
//# debugId=FE4DC62DCBE8117364756E2164756E21
|
|
732
|
+
//# sourceMappingURL=index-7h34nqrm.js.map
|