@estifanos-sh/convex-auth 0.0.7 → 0.0.8
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/dist/client/core/types.d.ts.map +1 -1
- package/dist/client/core/types.js.map +1 -1
- package/dist/component/account.d.ts +30 -30
- package/dist/component/connection/audit.d.ts +103 -109
- package/dist/component/connection/audit.d.ts.map +1 -1
- package/dist/component/connection/audit.js +6 -118
- package/dist/component/connection/audit.js.map +1 -1
- package/dist/component/connection/cache.d.ts +6 -6
- package/dist/component/connection/domain/verification.d.ts +15 -15
- package/dist/component/connection/domain.d.ts +18 -18
- package/dist/component/connection/saml/assertion.d.ts +4 -4
- package/dist/component/connection/saml/request.d.ts +7 -7
- package/dist/component/connection/scim/config.d.ts +11 -11
- package/dist/component/connection/scim/identity.d.ts +39 -39
- package/dist/component/connection/scim/identity.d.ts.map +1 -1
- package/dist/component/connection/scim/identity.js +43 -24
- package/dist/component/connection/scim/identity.js.map +1 -1
- package/dist/component/connection/secret.d.ts +13 -13
- package/dist/component/connection/webhook/delivery.d.ts +33 -33
- package/dist/component/connection/webhook/delivery.d.ts.map +1 -1
- package/dist/component/connection/webhook/delivery.js +2 -2
- package/dist/component/connection/webhook/delivery.js.map +1 -1
- package/dist/component/connection/webhook/endpoint.d.ts +21 -21
- package/dist/component/connection/webhook/events.d.ts +2 -2
- package/dist/component/connection/webhook/events.d.ts.map +1 -1
- package/dist/component/connection/webhook/events.js.map +1 -1
- package/dist/component/connection.d.ts +26 -26
- package/dist/component/connection.d.ts.map +1 -1
- package/dist/component/connection.js +2 -2
- package/dist/component/connection.js.map +1 -1
- package/dist/component/context.d.ts +19 -19
- package/dist/component/crons.d.ts +2 -2
- package/dist/component/documents.d.ts +575 -575
- package/dist/component/event.d.ts +29 -29
- package/dist/component/event.d.ts.map +1 -1
- package/dist/component/event.js +6 -111
- package/dist/component/event.js.map +1 -1
- package/dist/component/factor/device.d.ts +21 -21
- package/dist/component/factor/device.d.ts.map +1 -1
- package/dist/component/factor/passkey.d.ts +71 -71
- package/dist/component/factor/passkey.d.ts.map +1 -1
- package/dist/component/factor/totp.d.ts +44 -44
- package/dist/component/group/active.d.ts +98 -98
- package/dist/component/group/invite.d.ts +33 -33
- package/dist/component/group/invite.d.ts.map +1 -1
- package/dist/component/group/invite.js +2 -2
- package/dist/component/group/invite.js.map +1 -1
- package/dist/component/group/member.d.ts +35 -35
- package/dist/component/group/member.d.ts.map +1 -1
- package/dist/component/group/member.js +2 -2
- package/dist/component/group/member.js.map +1 -1
- package/dist/component/group.d.ts +45 -45
- package/dist/component/group.d.ts.map +1 -1
- package/dist/component/group.js +2 -2
- package/dist/component/group.js.map +1 -1
- package/dist/component/http.d.ts +2 -2
- package/dist/component/limits.d.ts +4 -4
- package/dist/component/maintenance.d.ts +2 -2
- package/dist/component/model.d.ts +513 -483
- package/dist/component/model.d.ts.map +1 -1
- package/dist/component/model.js +11 -3
- package/dist/component/model.js.map +1 -1
- package/dist/component/modules.d.ts +1 -1
- package/dist/component/oauth/client.d.ts +18 -18
- package/dist/component/oauth/client.d.ts.map +1 -1
- package/dist/component/oauth/client.js +17 -15
- package/dist/component/oauth/client.js.map +1 -1
- package/dist/component/oauth/code.d.ts +11 -11
- package/dist/component/oauth/refresh.d.ts +16 -16
- package/dist/component/schema.d.ts +661 -661
- package/dist/component/schema.d.ts.map +1 -1
- package/dist/component/schema.js +2 -2
- package/dist/component/schema.js.map +1 -1
- package/dist/component/session.d.ts +26 -26
- package/dist/component/session.d.ts.map +1 -1
- package/dist/component/token/continuation.d.ts +10 -10
- package/dist/component/token/enrollment.d.ts +9 -9
- package/dist/component/token/enrollment.d.ts.map +1 -1
- package/dist/component/token/pkce.d.ts +22 -22
- package/dist/component/token/pkce.d.ts.map +1 -1
- package/dist/component/token/refresh.d.ts +42 -57
- package/dist/component/token/refresh.d.ts.map +1 -1
- package/dist/component/token/refresh.js +18 -31
- package/dist/component/token/refresh.js.map +1 -1
- package/dist/component/token/verification.d.ts +19 -19
- package/dist/component/user/email.d.ts +18 -18
- package/dist/component/user/email.d.ts.map +1 -1
- package/dist/component/user/key.d.ts +27 -27
- package/dist/component/user/key.d.ts.map +1 -1
- package/dist/component/user/key.js +2 -2
- package/dist/component/user/key.js.map +1 -1
- package/dist/component/user.d.ts +33 -33
- package/dist/component/user.js +2 -2
- package/dist/component/user.js.map +1 -1
- package/dist/expo/webauthn.js.map +1 -1
- package/dist/providers/anonymous.d.ts +3 -3
- package/dist/providers/anonymous.d.ts.map +1 -1
- package/dist/providers/credentials.d.ts +2 -2
- package/dist/providers/credentials.d.ts.map +1 -1
- package/dist/providers/credentials.js.map +1 -1
- package/dist/providers/index.d.ts +4 -3
- package/dist/providers/password.d.ts +12 -12
- package/dist/providers/webauthn.d.ts +6 -10
- package/dist/providers/webauthn.d.ts.map +1 -1
- package/dist/providers/webauthn.js.map +1 -1
- package/dist/server/component/factor/db.js.map +1 -1
- package/dist/server/connection/config.js.map +1 -1
- package/dist/server/connection/domain.d.ts +12 -10
- package/dist/server/connection/domain.d.ts.map +1 -1
- package/dist/server/connection/domain.js +27 -45
- package/dist/server/connection/domain.js.map +1 -1
- package/dist/server/connection/group/service.d.ts +2 -1
- package/dist/server/connection/group/service.d.ts.map +1 -1
- package/dist/server/connection/group/service.js +1 -1
- package/dist/server/connection/group/service.js.map +1 -1
- package/dist/server/connection/http.js +47 -33
- package/dist/server/connection/http.js.map +1 -1
- package/dist/server/connection/oidc.d.ts +12 -0
- package/dist/server/connection/oidc.d.ts.map +1 -0
- package/dist/server/connection/oidc.js.map +1 -1
- package/dist/server/connection/provision.js.map +1 -1
- package/dist/server/connection/saml.d.ts.map +1 -1
- package/dist/server/connection/saml.js.map +1 -1
- package/dist/server/connection/shared.js.map +1 -1
- package/dist/server/connection/webhook.js.map +1 -1
- package/dist/server/context.d.ts.map +1 -1
- package/dist/server/context.js +15 -5
- package/dist/server/context.js.map +1 -1
- package/dist/server/contract.js.map +1 -1
- package/dist/server/cookies.js +2 -1
- package/dist/server/cookies.js.map +1 -1
- package/dist/server/core.js +3 -8
- package/dist/server/core.js.map +1 -1
- package/dist/server/cors.d.ts +2 -2
- package/dist/server/cors.d.ts.map +1 -1
- package/dist/server/db.js.map +1 -1
- package/dist/server/device.js +2 -2
- package/dist/server/domains/account.js +3 -11
- package/dist/server/domains/account.js.map +1 -1
- package/dist/server/domains/factor.d.ts.map +1 -1
- package/dist/server/domains/factor.js +4 -14
- package/dist/server/domains/factor.js.map +1 -1
- package/dist/server/domains/group.js.map +1 -1
- package/dist/server/domains/invite.js +2 -6
- package/dist/server/domains/invite.js.map +1 -1
- package/dist/server/domains/key.js.map +1 -1
- package/dist/server/domains/member.js.map +1 -1
- package/dist/server/domains/user.js +4 -14
- package/dist/server/domains/user.js.map +1 -1
- package/dist/server/errors.js +38 -2
- package/dist/server/errors.js.map +1 -1
- package/dist/server/events.d.ts +6 -6
- package/dist/server/events.d.ts.map +1 -1
- package/dist/server/events.js +64 -1
- package/dist/server/events.js.map +1 -1
- package/dist/server/facade.d.ts.map +1 -1
- package/dist/server/facade.js +3 -8
- package/dist/server/facade.js.map +1 -1
- package/dist/server/http.d.ts.map +1 -1
- package/dist/server/http.js +2 -7
- package/dist/server/http.js.map +1 -1
- package/dist/server/limits.js.map +1 -1
- package/dist/server/mutations/credentials/signin.js +8 -42
- package/dist/server/mutations/credentials/signin.js.map +1 -1
- package/dist/server/mutations/oauth.js +2 -2
- package/dist/server/mutations/oauth.js.map +1 -1
- package/dist/server/mutations/register.js +2 -1
- package/dist/server/mutations/register.js.map +1 -1
- package/dist/server/mutations/verify.js +2 -1
- package/dist/server/mutations/verify.js.map +1 -1
- package/dist/server/oauth/authorize.js +1 -9
- package/dist/server/oauth/authorize.js.map +1 -1
- package/dist/server/oauth/manage.js +2 -1
- package/dist/server/oauth/manage.js.map +1 -1
- package/dist/server/oauth/register.js +3 -14
- package/dist/server/oauth/register.js.map +1 -1
- package/dist/server/oauth/response.js +37 -0
- package/dist/server/oauth/response.js.map +1 -0
- package/dist/server/oauth/token.js +2 -12
- package/dist/server/oauth/token.js.map +1 -1
- package/dist/server/payloads.d.ts +5 -2
- package/dist/server/payloads.d.ts.map +1 -1
- package/dist/server/payloads.js +2 -6
- package/dist/server/payloads.js.map +1 -1
- package/dist/server/preload.js +20 -22
- package/dist/server/preload.js.map +1 -1
- package/dist/server/redirects.js +1 -5
- package/dist/server/redirects.js.map +1 -1
- package/dist/server/runtime.d.ts +115 -138
- package/dist/server/runtime.d.ts.map +1 -1
- package/dist/server/runtime.js +2 -1
- package/dist/server/runtime.js.map +1 -1
- package/dist/server/session/lifecycle.js +5 -24
- package/dist/server/session/lifecycle.js.map +1 -1
- package/dist/server/signin/flow.js +2 -7
- package/dist/server/signin/flow.js.map +1 -1
- package/dist/server/totp.js +9 -46
- package/dist/server/totp.js.map +1 -1
- package/dist/server/types.d.ts +14 -13
- package/dist/server/types.d.ts.map +1 -1
- package/dist/server/user/account.js.map +1 -1
- package/dist/server/validators.d.ts +683 -683
- package/dist/server/validators.d.ts.map +1 -1
- package/dist/server/validators.js +3 -3
- package/dist/server/validators.js.map +1 -1
- package/dist/server/webauthn.js +9 -46
- package/dist/server/webauthn.js.map +1 -1
- package/dist/shared/webauthn.d.ts +10 -8
- package/dist/shared/webauthn.d.ts.map +1 -1
- package/dist/shared/webauthn.js +13 -5
- package/dist/shared/webauthn.js.map +1 -1
- package/dist/test.d.ts +598 -598
- package/dist/test.d.ts.map +1 -1
- package/dist/test.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","names":[],"sources":["../../../src/client/core/types.ts"],"mappings":";;;;;;;;;AA6BA;;;;;;;UAAiB,eAAA;EACf,MAAA,CAAO,MAAA,WAAiB,IAAA,YAAgB,OAAA,CAAQ,KAAA;EAChD,OAAA,CACE,UAAA,GAAa,IAAA;IAAQ,iBAAA;EAAA,MAAiC,OAAA,6BACtD,QAAA,IAAY,eAAA;EA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AAA,GAAW,cAAA,EAjHkB;EAmH7B,gBAAA,GAAmB,sBAAA,EA/Hc;EAiIjC,GAAA;EA/HE;;;;;EAqIF,OAAA,GAAU,OAAA;EA/HF;;;;;;AAIqB;;EAoI7B,KAAA,kBAlIsC;EAoItC,QAAA,GAAW,GAAA,UAAa,GAAA;EAnIxB;;;;;EAyIA,eAAA;EA1ImD;;;;;EAgJnD,kBAAA;AAAA;;KAIU,mBAAA,aAAgC,WAAA,GAAc,WAAA,IAAe,iBAAA;EAnJK,8EAqJ5E,GAAA,EAAK,GAAA,EAlJsB;EAoJ3B,SAAA;EApJwC;;;;EAyJxC,UAAA,GAAa,eAAA;AAAA;;KAIH,kBAAA,GAAqB,iBAAA;EAtJtB,+DAwJT,SAAA,UAtJiC;EAwJjC,GAAA,UAxJU;EA0JV,UAAA;AAAA;;;;;KAOU,aAAA,aAA0B,WAAA,GAAc,WAAA,IAChD,mBAAA,CAAoB,GAAA,IACpB,kBAAA;AAAA,KAEQ,qBAAA;EAA0B,OAAA;AAAA;EAAqB,OAAA;EAAe,UAAA,EAAY,GAAA;AAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":[],"sources":["../../../src/client/core/types.ts"],"sourcesContent":["import type { FunctionArgs, FunctionReference } from \"convex/server\";\nimport type { ConvexError, Value } from \"convex/values\";\n\nimport type { AccessToken } from \"../../shared/brand\";\nimport type {\n AnonymousParams,\n CodeParams,\n ConnectionParams,\n EmailParams,\n OAuthParams,\n PasswordParams,\n} from \"../../shared/params\";\nimport type {\n AuthParameters,\n AuthTokens,\n SignInFlowResult,\n SignInWebAuthnOptionsResult,\n} from \"../../shared/results\";\nimport type { ErrorCode } from \"../../shared/codes\";\n\n/**\n * Structural interface for any Convex client.\n * Satisfied by `ConvexClient` (`convex/browser`),\n * `ConvexReactClient` (`convex/react`), and similar transports.\n *\n * `clearAuth` is present on `ConvexReactClient` and `BaseConvexClient`\n * but not on the simplified `ConvexClient`. When available we call it\n * during sign-out for a clean deauthentication.\n */\nexport interface ConvexTransport {\n action(action: unknown, args: unknown): Promise<Value>;\n setAuth(\n fetchToken: (args: { forceRefreshToken: boolean }) => Promise<string | null | undefined>,\n onChange?: (isAuthenticated: boolean) => void,\n ): void;\n clearAuth?(): void;\n}\n\n/** Minimal action-only transport used for unauthenticated auth flows. */\nexport interface ActionTransport {\n action(action: unknown, args: unknown): Promise<Value>;\n}\n\n/** @internal */\nexport type SignInApiRef = { signIn: AuthApiRefs[\"signIn\"] };\n\n/** Pluggable key-value storage supplied by the host runtime. */\nexport interface Storage {\n getItem(key: string): string | null | undefined | Promise<string | null | undefined>;\n setItem(key: string, value: string): void | Promise<void>;\n removeItem(key: string): void | Promise<void>;\n}\n\n/** Platform-neutral location/navigation hooks. */\ninterface LocationRuntime {\n get(): URL | null;\n replace(relativeUrl: string): void | Promise<void>;\n}\n\n/**\n * Platform-specific OAuth launch primitive.\n *\n * `open` receives the provider authorization URL. Platforms that navigate the\n * whole page away (browser) return nothing; platforms that run the flow in an\n * in-app session (Expo) return the callback URL so the core can complete the\n * exchange inline.\n */\ninterface OAuthRuntime {\n open(url: URL): void | string | URL | Promise<void | string | URL>;\n}\n\n/** Cross-context synchronization hooks, such as browser storage events. */\ninterface SyncRuntime {\n subscribe(\n key: string,\n callback: (value: string | null) => void | Promise<void>,\n ): (() => void) | null;\n}\n\n/** Cross-context mutex/locking primitive. */\ninterface MutexRuntime {\n withKey<T>(key: string, callback: () => Promise<T>): Promise<T>;\n}\n\n/** Proxy request execution supplied by the host runtime. */\ninterface ProxyRuntime {\n fetch(body: AuthParameters, proxyPath: string): Promise<Response>;\n}\n\n/**\n * Platform-neutral client runtime dependencies.\n *\n * The core `client` package should depend only on these interfaces, while the\n * browser package can provide concrete implementations backed by DOM APIs.\n */\nexport interface ClientRuntime {\n environment?: \"client\" | \"server\";\n storage?: Storage | null;\n location?: LocationRuntime;\n oauth?: OAuthRuntime;\n sync?: SyncRuntime;\n mutex?: MutexRuntime;\n proxy?: ProxyRuntime;\n}\n\n/** Platform-specific factor adapters injected by entrypoints like `browser`. */\nexport interface ClientAdapters {\n webauthn?: WebAuthnClient;\n totp?: TotpClient;\n device?: DeviceClient;\n}\n\n/**\n * Shared dependencies threaded into every factor client (`totp`, `device`,\n * `webauthn`). The core `client` builds one of these and passes it to each\n * factor factory.\n *\n * @internal\n */\nexport interface FactorDeps {\n proxy: string | undefined;\n convex: ConvexTransport;\n requireApiRefs: () => SignInApiRef;\n proxyFetch: (body: AuthParameters) => Promise<Value>;\n setTokenAndMaybeWait: (\n args:\n | {\n shouldStore: true;\n tokens: AuthTokens | null;\n waitForHandshake: boolean;\n context: { provider?: string; flow: string };\n }\n | {\n shouldStore: false;\n tokens: { token: AccessToken } | null;\n waitForHandshake: boolean;\n context: { provider?: string; flow: string };\n },\n ) => Promise<boolean>;\n}\n\n/**\n * Dependencies provided to platform-specific factor adapters.\n *\n * @internal\n */\nexport type ClientAdapterDeps = FactorDeps;\n\n/**\n * Factory overrides for platform-specific factor adapters.\n *\n * @internal\n */\nexport interface ClientAdapterFactories {\n webauthn?: (deps: ClientAdapterDeps) => WebAuthnClient;\n}\n\n/** @internal */\nexport type SignInActionResult = SignInFlowResult<AuthTokens | null>;\n\n/** @internal */\nexport type WebAuthnRotationResult = Extract<SignInWebAuthnOptionsResult, { operation: \"rotate\" }>;\n/** @internal Passkey sign-in options returned by a provider continuation. */\nexport type WebAuthnContinuationSignInResult = Extract<\n SignInWebAuthnOptionsResult,\n { operation: \"signIn\" }\n>;\n\n/**\n * Device authorization payload returned from the `deviceCode` sign-in flow.\n */\nexport type DeviceCodeResult = {\n deviceCode: string;\n userCode: string;\n verificationUri: string;\n verificationUriComplete: string;\n expiresIn: number;\n interval: number;\n};\n\n/**\n * Result of a `signIn` call.\n *\n * - `kind: \"signedIn\"` — credentials were accepted and a client session is now available.\n * - `kind: \"redirect\"` — OAuth flow initiated; redirect the user to `redirect.toString()`.\n * - `kind: \"totpRequired\"` — credentials valid but 2FA is needed; call `auth.totp.verify()`.\n * - `kind: \"deviceCode\"` — device flow initiated; display the code and poll via `auth.device.poll()`.\n * - `kind: \"started\"` — a non-immediate flow started (for example email/phone verification).\n * - `kind: \"failed\"` — the flow did not complete; `code` is the typed {@link ErrorCode}.\n *\n * @see {@link AuthState}\n */\nexport type SignInResult =\n | { kind: \"signedIn\" }\n | { kind: \"redirect\"; redirect: URL; verifier: string }\n | { kind: \"totpRequired\"; verifier: string }\n | { kind: \"deviceCode\"; deviceCode: DeviceCodeResult }\n | { kind: \"started\" }\n | { kind: \"failed\"; code: ErrorCode };\n\n/** @internal */\nexport type AuthSnapshot = {\n phase: \"loading\" | \"handshake\" | \"authenticated\" | \"unauthenticated\";\n isLoading: boolean;\n isAuthenticated: boolean;\n token: string | null;\n};\n\n/** Reactive auth state. `token` is non-null only after Convex confirms auth. */\nexport type AuthState =\n | { status: \"loading\"; token: null }\n | { status: \"signedOut\"; token: null }\n | { status: \"signedIn\"; token: string };\n\n/** Handler for `auth.subscribe`. */\nexport type AuthSubscriber = (state: AuthState) => void;\n\n/**\n * Typed Convex API references for the auth functions.\n * Pass these from your generated `api` object.\n *\n * @typeParam HasWebAuthn - Whether the WebAuthn provider is configured.\n * @typeParam HasTotp - Whether the TOTP provider is configured.\n * @typeParam HasDevice - Whether the device provider is configured.\n */\ntype DefaultSignInReference = FunctionReference<\n \"action\",\n \"public\",\n {\n request: {\n provider?: string;\n params?: AuthParameters;\n refreshToken?: string;\n };\n verifier?: string;\n continuation?: string;\n calledBy?: string;\n },\n unknown\n>;\n\ntype AnySignInReference = FunctionReference<\"action\", \"public\", any, any>;\n\nexport type AuthApiRefs<SignIn extends AnySignInReference = DefaultSignInReference> = {\n signIn: SignIn;\n signOut: FunctionReference<\"action\", \"public\", Record<string, Value>, unknown>;\n};\n\n/**\n * Optional hints for {@link WebAuthnClient.register}.\n */\nexport type WebAuthnRegisterOptions = {\n /** Human-readable label for this credential (e.g. `\"MacBook Pro\"`). */\n name?: string;\n /** WebAuthn `user.name` override. */\n userName?: string;\n /** WebAuthn `user.displayName` override. */\n userDisplayName?: string;\n};\n\n/**\n * Optional hints for {@link WebAuthnClient.signIn}.\n */\nexport type WebAuthnSignInOptions = {\n /** Email hint to filter discoverable credentials. */\n email?: string;\n /** Set to `true` for conditional UI (autofill) mode. */\n autofill?: boolean;\n};\n\n/**\n * WebAuthn client-side helpers.\n *\n * @see {@link TotpClient}\n * @see {@link DeviceClient}\n */\nexport interface WebAuthnClient {\n /**\n * Check whether the current runtime exposes WebAuthn passkey APIs.\n *\n * @returns `true` when `navigator.credentials` is available.\n *\n * @example\n * ```ts\n * if (auth.webauthn.isSupported()) {\n * // Show passkey registration button\n * }\n * ```\n */\n isSupported(): boolean;\n\n /**\n * Check whether conditional mediation (autofill-style passkeys) is available.\n *\n * @returns `true` when the browser supports `PublicKeyCredential.isConditionalMediationAvailable`.\n *\n * @example\n * ```ts\n * if (await auth.webauthn.isAutofillSupported()) {\n * await auth.webauthn.signIn({ autofill: true });\n * }\n * ```\n */\n isAutofillSupported(): Promise<boolean>;\n\n /**\n * Start a passkey registration flow and complete the WebAuthn ceremony.\n *\n * Creates a new credential bound to the current user's account.\n *\n * @param opts - Optional registration hints.\n * @param opts.name - Human-readable name for the passkey (e.g. `\"MacBook Pro\"`).\n * @param opts.userName - WebAuthn `user.name` override.\n * @param opts.userDisplayName - WebAuthn `user.displayName` override.\n * @returns A {@link SignInResult} — typically `{ kind: \"signedIn\" }` once a client session is available.\n *\n * @example\n * ```ts\n * const result = await auth.webauthn.register({ name: \"My laptop\" });\n * ```\n */\n register(opts?: WebAuthnRegisterOptions): Promise<SignInResult>;\n\n /** @internal Complete registration options returned by a provider continuation. */\n completeRegistration(result: WebAuthnRotationResult): Promise<SignInResult>;\n\n /** @internal Complete passkey sign-in options returned by a provider continuation. */\n completeSignIn(result: WebAuthnContinuationSignInResult): Promise<SignInResult>;\n\n /**\n * Sign in with an existing passkey and complete the WebAuthn ceremony.\n *\n * @param opts - Optional sign-in hints.\n * @param opts.email - Email hint to filter discoverable credentials.\n * @param opts.autofill - Set to `true` for conditional UI (autofill) mode.\n * @returns A {@link SignInResult} — typically `{ kind: \"signedIn\" }` once a client session is available.\n *\n * @example\n * ```ts\n * const result = await auth.webauthn.signIn();\n * ```\n */\n signIn(opts?: WebAuthnSignInOptions): Promise<SignInResult>;\n}\n\n/**\n * Optional hints for {@link TotpClient.setup}.\n */\nexport type TotpSetupOptions = {\n /** Issuer name shown in the authenticator app. */\n name?: string;\n /** Account label shown in the authenticator app. */\n accountName?: string;\n};\n\n/** Result of {@link TotpClient.setup}. */\nexport type TotpSetupResult = {\n /** `otpauth://` URL — render as a QR code. */\n uri: string;\n /** Raw base32-encoded shared secret. */\n secret: string;\n /** Verifier token to pass to {@link TotpClient.confirm}. */\n verifier: string;\n /** Factor ID to pass to {@link TotpClient.confirm}. */\n totpId: string;\n};\n\n/** Params for {@link TotpClient.confirm}. */\nexport type TotpConfirmParams = {\n /** Six-digit OTP from the authenticator app. */\n code: string;\n /** Verifier token from {@link TotpSetupResult.verifier}. */\n verifier: string;\n /** Factor ID from {@link TotpSetupResult.totpId}. */\n totpId: string;\n};\n\n/** Params for {@link TotpClient.verify}. */\nexport type TotpVerifyParams = {\n /** Six-digit OTP from the authenticator app. */\n code: string;\n /** Verifier token from a `totpRequired` sign-in result. */\n verifier: string;\n};\n\n/**\n * TOTP two-factor authentication client-side helpers.\n *\n * @see {@link WebAuthnClient}\n * @see {@link DeviceClient}\n */\nexport interface TotpClient {\n /**\n * Start TOTP enrollment and return the setup URI, secret, verifier, and factor ID.\n *\n * The returned `uri` is an `otpauth://` URL that can be rendered as a QR code\n * for the user to scan with their authenticator app.\n *\n * @param opts - Optional setup hints.\n * @param opts.name - Issuer name shown in the authenticator app.\n * @param opts.accountName - Account label in the authenticator app.\n * @returns An object with `{ uri, secret, verifier, totpId }`.\n *\n * @example\n * ```ts\n * const { uri, secret, verifier, totpId } = await auth.totp.setup();\n * // Render `uri` as a QR code, then confirm:\n * await auth.totp.confirm({ code: userCode, verifier, totpId });\n * ```\n */\n setup(opts?: TotpSetupOptions): Promise<TotpSetupResult>;\n\n /**\n * Confirm a newly created TOTP factor with the first authenticator code.\n *\n * Call this after the user scans the QR code and enters the first OTP.\n *\n * @param opts - Confirmation parameters.\n * @param opts.code - The 6-digit TOTP code from the authenticator app.\n * @param opts.verifier - The verifier string returned by {@link TotpClient.setup}.\n * @param opts.totpId - The factor ID returned by {@link TotpClient.setup}.\n * @returns A {@link SignInResult} — `{ kind: \"signedIn\" }` on success, or\n * `{ kind: \"failed\", code }` when the code is rejected.\n *\n * @example\n * ```ts\n * const result = await auth.totp.confirm({ code: \"123456\", verifier, totpId });\n * if (result.kind === \"failed\") showError(result.code);\n * ```\n */\n confirm(opts: TotpConfirmParams): Promise<SignInResult>;\n\n /**\n * Complete a sign-in that is waiting on TOTP verification.\n *\n * Called when `signIn()` returns `{ kind: \"totpRequired\" }`.\n *\n * @param opts - Verification parameters.\n * @param opts.code - The 6-digit TOTP code from the authenticator app.\n * @param opts.verifier - The verifier string from the `totpRequired` result.\n * @returns A {@link SignInResult} — `{ kind: \"signedIn\" }` on success, or\n * `{ kind: \"failed\", code }` when the code is rejected.\n *\n * @example\n * ```ts\n * const result = await auth.signIn(\"password\", { email, password });\n * if (result.kind === \"totpRequired\") {\n * const totp = await auth.totp.verify({ code: totpCode, verifier: result.verifier });\n * if (totp.kind === \"failed\") showError(totp.code);\n * }\n * ```\n */\n verify(opts: TotpVerifyParams): Promise<SignInResult>;\n}\n\n/** Params for {@link DeviceClient.poll}. */\nexport type DevicePollParams = {\n code: DeviceCodeResult;\n /** Aborts the poll loop cleanly, e.g. on UI unmount. */\n signal?: AbortSignal;\n};\n\n/** Params for {@link DeviceClient.verify}. */\nexport type DeviceVerifyParams = { code: string };\n\n/**\n * Device authorization (RFC 8628) client-side helpers.\n *\n * @see {@link WebAuthnClient}\n * @see {@link TotpClient}\n */\nexport interface DeviceClient {\n /**\n * Poll until a device flow is approved or expires.\n *\n * Polls the server at the interval specified in the {@link DeviceCodeResult}\n * until the user authorizes the device or the code expires.\n *\n * @param opts - Poll options.\n * @param opts.code - The {@link DeviceCodeResult} returned from `signIn(\"device\")`.\n * @param opts.signal - Optional {@link AbortSignal}; aborting returns cleanly\n * at the next loop boundary (e.g. on UI unmount).\n * @throws `ConvexError({ code: \"DEVICE_CODE_EXPIRED\" })` when the code expires before authorization.\n *\n * @example\n * ```ts\n * const controller = new AbortController();\n * const result = await auth.signIn(\"device\");\n * if (result.kind === \"deviceCode\") {\n * // Display result.deviceCode.userCode to the user\n * await auth.device.poll({ code: result.deviceCode, signal: controller.signal });\n * console.log(\"Device authorized!\");\n * }\n * ```\n */\n poll(opts: DevicePollParams): Promise<void>;\n\n /**\n * Approve a device flow from the verification page using the displayed user code.\n *\n * Call this on the authorization page where the user enters the short code\n * shown on the device screen.\n *\n * @param opts - Verification options.\n * @param opts.code - The user code string (e.g. `\"WDJB-MJHT\"`).\n * @throws `ConvexError({ code: \"DEVICE_AUTHORIZATION_FAILED\" })` when verification fails.\n *\n * @example\n * ```ts\n * await auth.device.verify({ code: \"WDJB-MJHT\" });\n * ```\n */\n verify(opts: DeviceVerifyParams): Promise<void>;\n}\n\n/**\n * Extract capability flags from an AuthApiRefs type.\n *\n * @typeParam Api - An AuthApiRefs type to extract capability flags from.\n */\ntype SignInRequest<Api extends AuthApiRefs> =\n FunctionArgs<Api[\"signIn\"]> extends infer Args\n ? Args extends { request: infer Request }\n ? Request\n : Args\n : never;\n\ntype ProviderIds<Api extends AuthApiRefs> = [Api[\"signIn\"]] extends [never]\n ? string\n : SignInRequest<Api> extends infer Args\n ? Args extends unknown\n ? \"provider\" extends keyof Args\n ? Exclude<Args[keyof Args & \"provider\"], undefined>\n : never\n : never\n : never;\n\ntype HasProvider<Api extends AuthApiRefs, Id extends string> =\n string extends ProviderIds<Api> ? boolean : Id extends ProviderIds<Api> ? true : false;\n\ntype InferCaps<Api extends AuthApiRefs> = {\n webauthn: HasProvider<Api, \"webauthn\">;\n totp: HasProvider<Api, \"totp\">;\n device: HasProvider<Api, \"device\">;\n};\n\n/**\n * Include a capability when configured, omit it when disabled, and keep it\n * optional when a framework binding cannot know the capability.\n */\ntype CapabilityClient<Enabled extends boolean, Name extends string, Client> = [Enabled] extends [\n false,\n]\n ? {}\n : [boolean] extends [Enabled]\n ? { [Key in Name]?: Client }\n : { [Key in Name]: Client };\n\n/** Pending invite detected from URL or recovered from storage after redirect. */\nexport interface PendingInvite {\n /**\n * Raw one-time invite token. Pass to your invite acceptance mutation.\n * @readonly\n */\n readonly token: string;\n /**\n * Invite email from the URL or stored redirect state, if available.\n * @readonly\n */\n readonly email: string | null;\n /**\n * Consume the invite: clears storage/URL params and returns the token.\n *\n * @returns The invite token.\n * @throws When there is no pending invite to accept.\n */\n accept(): Promise<{ token: string }>;\n}\n\n/**\n * Discriminated union of params for the password provider's flows.\n *\n * Each branch maps to one of the six password flows: `signUp`, `signIn`,\n * `reset`, `recover`, `verify`, `change`. Selecting a `flow` literal narrows the\n * accepted params automatically.\n */\nexport type { PasswordParams } from \"../../shared/params\";\n\n/** Params for the email (magic link) provider's initiation step. */\nexport type EmailInitiateParams = EmailParams;\n\n/**\n * Params for completing a code-based flow (no provider). Used to finalise\n * email magic-link sign-ins and other provider-owned code flows when the\n * verification call is made without re-specifying the originating provider.\n */\nexport type CodeCompletionParams = CodeParams;\n\n/** Params for the `connection` provider — requires a connection ID. */\nexport type { ConnectionParams } from \"../../shared/params\";\n\n/** Params for the anonymous provider. Empty / `redirectTo` only. */\nexport type { AnonymousParams } from \"../../shared/params\";\n\n/** Default params shape for OAuth-style providers (google, github, etc.). */\nexport type OAuthSignInParams = OAuthParams;\n\n/**\n * Resolves the `params` argument shape from the `provider` literal.\n *\n * Known special providers (`\"password\"`, `\"email\"`, etc.) get strict typing.\n * Any other string falls back to OAuth-style params, since custom OAuth\n * providers can be registered under arbitrary IDs.\n */\ntype DefaultParamsForProvider<P> = P extends \"password\"\n ? PasswordParams\n : P extends \"email\"\n ? EmailInitiateParams\n : P extends \"anonymous\"\n ? AnonymousParams | undefined\n : P extends \"connection\"\n ? ConnectionParams\n : P extends \"webauthn\"\n ? never\n : P extends undefined\n ? CodeCompletionParams\n : OAuthSignInParams | undefined;\n\ntype ConfiguredProviderArgs<Api extends AuthApiRefs, P> =\n SignInRequest<Api> extends infer Args ? (Args extends { provider: P } ? Args : never) : never;\n\n/** Resolve a provider's exact params from the generated auth action reference. */\nexport type ParamsForProvider<Api extends AuthApiRefs, P> =\n string extends ProviderIds<Api>\n ? DefaultParamsForProvider<P>\n : P extends \"webauthn\" | \"totp\" | \"device\"\n ? never\n : P extends \"connection\"\n ? ConnectionParams\n : [P] extends [undefined]\n ? CodeCompletionParams\n : ConfiguredProviderArgs<Api, P> extends infer Args\n ? [Args] extends [never]\n ? never\n : Args extends { params: infer Params }\n ? Params\n : Args extends { params?: infer Params }\n ? Params | undefined\n : undefined\n : never;\n\n/**\n * Tuple-rest helper that flips `params` between required and optional based\n * on whether `undefined` is in its resolved type.\n */\nexport type SignInArgs<Api extends AuthApiRefs, P> =\n undefined extends ParamsForProvider<Api, P>\n ? [params?: ParamsForProvider<Api, P>]\n : [params: ParamsForProvider<Api, P>];\n\n/**\n * Public signature for `auth.signIn`. The provider literal discriminates the\n * params shape via {@link ParamsForProvider}, and the params slot is\n * automatically optional when the resolved type permits `undefined`.\n *\n * @example\n * ```ts\n * auth.signIn(\"password\", { flow: \"signIn\", email, password });\n * auth.signIn(\"password\", { flow: \"change\", email, currentPassword, newPassword });\n * auth.signIn(\"anonymous\"); // params optional\n * ```\n */\nexport type SignInOverloads<Api extends AuthApiRefs = AuthApiRefs> = <\n const P extends ProviderIds<Api> | undefined,\n>(\n provider: P,\n ...args: SignInArgs<Api, P>\n) => Promise<SignInResult>;\n\n/**\n * Internal-only loose signature for the `signIn` value. Use this when\n * forwarding through wrappers where TypeScript cannot select an overload\n * from the wrapper's union-typed `provider` argument.\n *\n * @internal\n */\nexport type SignInImpl = (provider?: string, params?: AuthParameters) => Promise<SignInResult>;\n\n/** Base auth client — always present. */\ninterface AuthClientBase<Api extends AuthApiRefs> {\n /** Restore initial auth state for the current runtime. */\n initialize: () => Promise<void>;\n /** SSR-safe query-param reader. */\n param: (name: string) => string | null;\n /**\n * Pending invite recovered from the URL or storage, if present.\n * @readonly\n */\n readonly invite: PendingInvite | null;\n /** Complete an OAuth callback using a URL or authorization code. */\n completeOAuth: (input: URL | string | { code: string }) => Promise<OAuthCompletionResult>;\n /** Start a sign-in flow for a provider. */\n signIn: SignInOverloads<Api>;\n /** Sign out and clear local auth state. */\n signOut: () => Promise<void>;\n /** Subscribe to auth state changes; returns an unsubscribe. */\n subscribe: (handler: AuthSubscriber) => () => void;\n /** Read the current auth state synchronously, e.g. for `useSyncExternalStore`. */\n getSnapshot: () => AuthState;\n /** Tear down listeners and reject in-flight handshakes. */\n destroy: () => void;\n}\n\n/**\n * Framework-agnostic auth client return type.\n *\n * Conditionally includes `totp` and `device` helpers based on the\n * capabilities in the `AuthApiRefs` type. Platform-specific `webauthn` helpers\n * are added by {@link PlatformAuthClient}.\n *\n * @typeParam Api - An AuthApiRefs type that determines which factor helpers are included.\n */\nexport type AuthClient<Api extends AuthApiRefs = AuthApiRefs> = AuthClientBase<Api> &\n CapabilityClient<InferCaps<Api>[\"totp\"], \"totp\", TotpClient> &\n CapabilityClient<InferCaps<Api>[\"device\"], \"device\", DeviceClient>;\n\n/**\n * Browser auth client return type.\n *\n * Extends {@link AuthClient} with conditional WebAuthn helpers when the\n * generated auth API exposes WebAuthn capabilities.\n *\n * @typeParam Api - An AuthApiRefs type that determines which factor helpers are included.\n */\nexport type PlatformAuthClient<Api extends AuthApiRefs = AuthApiRefs> = AuthClient<Api> &\n CapabilityClient<InferCaps<Api>[\"webauthn\"], \"webauthn\", WebAuthnClient>;\n\n/**\n * Options for {@link client}.\n *\n * @typeParam Api - An AuthApiRefs type.\n */\ntype ClientOptionsBase = {\n /** Any Convex client implementation used to run auth actions. */\n convex: ConvexTransport;\n /** Platform runtime implementation used by the client core. */\n runtime?: ClientRuntime;\n /** Platform-specific factor adapters supplied by higher-level entrypoints. */\n adapters?: ClientAdapters;\n /** Platform-specific adapter factories supplied by higher-level entrypoints. */\n adapterFactories?: ClientAdapterFactories;\n /** Explicit Convex deployment URL when it cannot be inferred from the client. */\n url?: string;\n /**\n * Storage backend for persisted tokens.\n *\n * Defaults to `runtime.storage` when provided, otherwise `null`.\n */\n storage?: Storage | null;\n /**\n * Server-known auth used to seed the synchronous boot so SSR and hydration\n * render the resolved state on first paint. A non-empty JWT boots signed in;\n * `null` boots signed out. Providing this at all marks auth as resolved, so\n * the client skips the loading phase. Omit it (leave `undefined`) to read the\n * persisted value from `storage` instead. Ongoing persistence always uses\n * `storage`.\n */\n token?: string | null;\n /** SSR-safe URL source for reading query parameters. */\n location?: URL | (() => URL | null);\n /**\n * Default OAuth `redirectTo` applied to `signIn` calls that omit it. Platform\n * entrypoints set this (e.g. Expo passes its native redirect URI) so the core\n * can build the authorization URL without a platform-specific `signIn` wrapper.\n */\n oauthRedirectTo?: string;\n /**\n * Milliseconds to wait for the Convex client to confirm a new token\n * before a sign-in handshake rejects with `AUTH_HANDSHAKE_TIMEOUT`.\n * Defaults to `5000`.\n */\n handshakeTimeoutMs?: number;\n};\n\n/** Direct Convex mode. Generated auth references are the client contract. */\nexport type DirectClientOptions<Api extends AuthApiRefs = AuthApiRefs> = ClientOptionsBase & {\n /** Typed auth function refs from the application's generated `api` object. */\n api: Api;\n /** Proxy transport and direct transport are mutually exclusive. */\n proxyPath?: never;\n /**\n * Action-only transport used for direct code exchange. Browser and Expo\n * entrypoints provide one automatically; headless runtimes must inject it.\n */\n httpClient?: ActionTransport | null;\n};\n\n/** HTTP proxy mode. The proxy owns the Convex function references. */\nexport type ProxyClientOptions = ClientOptionsBase & {\n /** Proxy endpoint used instead of direct Convex auth calls. */\n proxyPath: string;\n /** Generated references belong to direct mode and cannot be mixed with a proxy. */\n api?: never;\n /** Direct action transports belong to direct mode. */\n httpClient?: never;\n};\n\n/**\n * Client configuration. Selecting direct or proxy mode makes every required\n * transport explicit and prevents the two modes from being combined.\n */\nexport type ClientOptions<Api extends AuthApiRefs = AuthApiRefs> =\n | DirectClientOptions<Api>\n | ProxyClientOptions;\n\nexport type OAuthCompletionResult = { handled: false } | { handled: true; cleanupUrl: URL | null };\n\n/**\n * Metadata describing the current auth flow for handshake diagnostics.\n *\n * @internal\n */\nexport type AuthFlowContext = {\n provider?: string;\n flow: string;\n};\n\n/**\n * A simple deferred promise that can be resolved or rejected externally.\n */\ninterface SimpleDeferred<T, E = unknown> {\n readonly promise: Promise<T>;\n resolve(value: T): void;\n reject(error: E): void;\n}\n\n/**\n * Create a deferred promise that can be resolved or rejected externally.\n *\n * @returns A deferred object containing the promise and control methods.\n * @internal\n */\nexport function createDeferred<T, E = unknown>(): SimpleDeferred<T, E> {\n let resolve!: (value: T) => void;\n let reject!: (error: E) => void;\n const promise = new Promise<T>((res, rej) => {\n resolve = res;\n reject = rej as (error: E) => void;\n });\n return { promise, resolve, reject };\n}\n\n/** @internal */\nexport type HandshakeWaiter = {\n epoch: number;\n context: AuthFlowContext;\n deferred: SimpleDeferred<void, ConvexError<Value>>;\n timeoutId: ReturnType<typeof setTimeout>;\n};\n"],"mappings":";;;;;;;AA00BA,SAAgB,iBAAuD;CACrE,IAAI;CACJ,IAAI;AAKJ,QAAO;EAAE,SAJO,IAAI,SAAY,KAAK,QAAQ;AAC3C,aAAU;AACV,YAAS;IACT;EACgB;EAAS;EAAQ"}
|
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["../../../src/client/core/types.ts"],"sourcesContent":["import type { FunctionArgs, FunctionReference } from \"convex/server\";\nimport type { ConvexError, Value } from \"convex/values\";\n\nimport type { AccessToken } from \"../../shared/brand\";\nimport type {\n AnonymousParams,\n CodeParams,\n ConnectionParams,\n EmailParams,\n OAuthParams,\n PasswordParams,\n} from \"../../shared/params\";\nimport type {\n AuthParameters,\n AuthTokens,\n SignInFlowResult,\n SignInWebAuthnOptionsResult,\n} from \"../../shared/results\";\nimport type { ErrorCode } from \"../../shared/codes\";\n\n/**\n * Structural interface for any Convex client.\n * Satisfied by `ConvexClient` (`convex/browser`),\n * `ConvexReactClient` (`convex/react`), and similar transports.\n *\n * `clearAuth` is present on `ConvexReactClient` and `BaseConvexClient`\n * but not on the simplified `ConvexClient`. When available we call it\n * during sign-out for a clean deauthentication.\n */\nexport interface ConvexTransport {\n action(action: unknown, args: unknown): Promise<Value>;\n setAuth(\n fetchToken: (args: { forceRefreshToken: boolean }) => Promise<string | null | undefined>,\n onChange?: (isAuthenticated: boolean) => void,\n ): void;\n clearAuth?(): void;\n}\n\n/** Minimal action-only transport used for unauthenticated auth flows. */\nexport interface ActionTransport {\n action(action: unknown, args: unknown): Promise<Value>;\n}\n\n/** @internal */\nexport type SignInApiRef = { signIn: AuthApiRefs[\"signIn\"] };\n\n/** Pluggable key-value storage supplied by the host runtime. */\nexport interface Storage {\n getItem(key: string): string | null | undefined | Promise<string | null | undefined>;\n setItem(key: string, value: string): void | Promise<void>;\n removeItem(key: string): void | Promise<void>;\n}\n\n/** Platform-neutral location/navigation hooks. */\ninterface LocationRuntime {\n get(): URL | null;\n replace(relativeUrl: string): void | Promise<void>;\n}\n\n/**\n * Platform-specific OAuth launch primitive.\n *\n * `open` receives the provider authorization URL. Platforms that navigate the\n * whole page away (browser) return nothing; platforms that run the flow in an\n * in-app session (Expo) return the callback URL so the core can complete the\n * exchange inline.\n */\ninterface OAuthRuntime {\n open(url: URL): void | string | URL | Promise<void | string | URL>;\n}\n\n/** Cross-context synchronization hooks, such as browser storage events. */\ninterface SyncRuntime {\n subscribe(\n key: string,\n callback: (value: string | null) => void | Promise<void>,\n ): (() => void) | null;\n}\n\n/** Cross-context mutex/locking primitive. */\ninterface MutexRuntime {\n withKey<T>(key: string, callback: () => Promise<T>): Promise<T>;\n}\n\n/** Proxy request execution supplied by the host runtime. */\ninterface ProxyRuntime {\n fetch(body: AuthParameters, proxyPath: string): Promise<Response>;\n}\n\n/**\n * Platform-neutral client runtime dependencies.\n *\n * The core `client` package should depend only on these interfaces, while the\n * browser package can provide concrete implementations backed by DOM APIs.\n */\nexport interface ClientRuntime {\n environment?: \"client\" | \"server\";\n storage?: Storage | null;\n location?: LocationRuntime;\n oauth?: OAuthRuntime;\n sync?: SyncRuntime;\n mutex?: MutexRuntime;\n proxy?: ProxyRuntime;\n}\n\n/** Platform-specific factor adapters injected by entrypoints like `browser`. */\nexport interface ClientAdapters {\n webauthn?: WebAuthnClient;\n totp?: TotpClient;\n device?: DeviceClient;\n}\n\n/**\n * Shared dependencies threaded into every factor client (`totp`, `device`,\n * `webauthn`). The core `client` builds one of these and passes it to each\n * factor factory.\n *\n * @internal\n */\nexport interface FactorDeps {\n proxy: string | undefined;\n convex: ConvexTransport;\n requireApiRefs: () => SignInApiRef;\n proxyFetch: (body: AuthParameters) => Promise<Value>;\n setTokenAndMaybeWait: (\n args:\n | {\n shouldStore: true;\n tokens: AuthTokens | null;\n waitForHandshake: boolean;\n context: { provider?: string; flow: string };\n }\n | {\n shouldStore: false;\n tokens: { token: AccessToken } | null;\n waitForHandshake: boolean;\n context: { provider?: string; flow: string };\n },\n ) => Promise<boolean>;\n}\n\n/**\n * Dependencies provided to platform-specific factor adapters.\n *\n * @internal\n */\nexport type ClientAdapterDeps = FactorDeps;\n\n/**\n * Factory overrides for platform-specific factor adapters.\n *\n * @internal\n */\nexport interface ClientAdapterFactories {\n webauthn?: (deps: ClientAdapterDeps) => WebAuthnClient;\n}\n\n/** @internal */\nexport type SignInActionResult = SignInFlowResult<AuthTokens | null>;\n\n/** @internal */\nexport type WebAuthnRotationResult = Extract<SignInWebAuthnOptionsResult, { operation: \"rotate\" }>;\n/** @internal Passkey sign-in options returned by a provider continuation. */\nexport type WebAuthnContinuationSignInResult = Extract<\n SignInWebAuthnOptionsResult,\n { operation: \"signIn\" }\n>;\n\n/**\n * Device authorization payload returned from the `deviceCode` sign-in flow.\n */\nexport type DeviceCodeResult = {\n deviceCode: string;\n userCode: string;\n verificationUri: string;\n verificationUriComplete: string;\n expiresIn: number;\n interval: number;\n};\n\n/**\n * Result of a `signIn` call.\n *\n * - `kind: \"signedIn\"` — credentials were accepted and a client session is now available.\n * - `kind: \"redirect\"` — OAuth flow initiated; redirect the user to `redirect.toString()`.\n * - `kind: \"totpRequired\"` — credentials valid but 2FA is needed; call `auth.totp.verify()`.\n * - `kind: \"deviceCode\"` — device flow initiated; display the code and poll via `auth.device.poll()`.\n * - `kind: \"started\"` — a non-immediate flow started (for example email/phone verification).\n * - `kind: \"failed\"` — the flow did not complete; `code` is the typed {@link ErrorCode}.\n *\n * @see {@link AuthState}\n */\nexport type SignInResult =\n | { kind: \"signedIn\" }\n | { kind: \"redirect\"; redirect: URL; verifier: string }\n | { kind: \"totpRequired\"; verifier: string }\n | { kind: \"deviceCode\"; deviceCode: DeviceCodeResult }\n | { kind: \"started\" }\n | { kind: \"failed\"; code: ErrorCode };\n\n/** @internal */\nexport type AuthSnapshot = {\n phase: \"loading\" | \"handshake\" | \"authenticated\" | \"unauthenticated\";\n isLoading: boolean;\n isAuthenticated: boolean;\n token: string | null;\n};\n\n/** Reactive auth state. `token` is non-null only after Convex confirms auth. */\nexport type AuthState =\n | { status: \"loading\"; token: null }\n | { status: \"signedOut\"; token: null }\n | { status: \"signedIn\"; token: string };\n\n/** Handler for `auth.subscribe`. */\nexport type AuthSubscriber = (state: AuthState) => void;\n\n/**\n * Typed Convex API references for the auth functions.\n * Pass these from your generated `api` object.\n *\n * @typeParam HasWebAuthn - Whether the WebAuthn provider is configured.\n * @typeParam HasTotp - Whether the TOTP provider is configured.\n * @typeParam HasDevice - Whether the device provider is configured.\n */\ntype DefaultSignInReference = FunctionReference<\n \"action\",\n \"public\",\n {\n request: {\n provider?: string;\n params?: AuthParameters;\n refreshToken?: string;\n };\n verifier?: string;\n continuation?: string;\n calledBy?: string;\n },\n unknown\n>;\n\ntype AnySignInReference = FunctionReference<\"action\", \"public\", any, any>;\n\nexport type AuthApiRefs<SignIn extends AnySignInReference = DefaultSignInReference> = {\n signIn: SignIn;\n signOut: FunctionReference<\"action\", \"public\", Record<string, Value>, unknown>;\n};\n\n/**\n * Optional hints for {@link WebAuthnClient.register}.\n */\nexport type WebAuthnRegisterOptions = {\n /** Human-readable label for this credential (e.g. `\"MacBook Pro\"`). */\n name?: string;\n /** WebAuthn `user.name` override. */\n userName?: string;\n /** WebAuthn `user.displayName` override. */\n userDisplayName?: string;\n};\n\n/**\n * Optional hints for {@link WebAuthnClient.signIn}.\n */\nexport type WebAuthnSignInOptions = {\n /** Email hint to filter discoverable credentials. */\n email?: string;\n /** Set to `true` for conditional UI (autofill) mode. */\n autofill?: boolean;\n};\n\n/**\n * WebAuthn client-side helpers.\n *\n * @see {@link TotpClient}\n * @see {@link DeviceClient}\n */\nexport interface WebAuthnClient {\n /**\n * Check whether the current runtime exposes WebAuthn passkey APIs.\n *\n * @returns `true` when `navigator.credentials` is available.\n *\n * @example\n * ```ts\n * if (auth.webauthn.isSupported()) {\n * // Show passkey registration button\n * }\n * ```\n */\n isSupported(): boolean;\n\n /**\n * Check whether conditional mediation (autofill-style passkeys) is available.\n *\n * @returns `true` when the browser supports `PublicKeyCredential.isConditionalMediationAvailable`.\n *\n * @example\n * ```ts\n * if (await auth.webauthn.isAutofillSupported()) {\n * await auth.webauthn.signIn({ autofill: true });\n * }\n * ```\n */\n isAutofillSupported(): Promise<boolean>;\n\n /**\n * Start a passkey registration flow and complete the WebAuthn ceremony.\n *\n * Creates a new credential bound to the current user's account.\n *\n * @param opts - Optional registration hints.\n * @param opts.name - Human-readable name for the passkey (e.g. `\"MacBook Pro\"`).\n * @param opts.userName - WebAuthn `user.name` override.\n * @param opts.userDisplayName - WebAuthn `user.displayName` override.\n * @returns A {@link SignInResult} — typically `{ kind: \"signedIn\" }` once a client session is available.\n *\n * @example\n * ```ts\n * const result = await auth.webauthn.register({ name: \"My laptop\" });\n * ```\n */\n register(opts?: WebAuthnRegisterOptions): Promise<SignInResult>;\n\n /** @internal Complete registration options returned by a provider continuation. */\n completeRegistration(result: WebAuthnRotationResult): Promise<SignInResult>;\n\n /** @internal Complete passkey sign-in options returned by a provider continuation. */\n completeSignIn(result: WebAuthnContinuationSignInResult): Promise<SignInResult>;\n\n /**\n * Sign in with an existing passkey and complete the WebAuthn ceremony.\n *\n * @param opts - Optional sign-in hints.\n * @param opts.email - Email hint to filter discoverable credentials.\n * @param opts.autofill - Set to `true` for conditional UI (autofill) mode.\n * @returns A {@link SignInResult} — typically `{ kind: \"signedIn\" }` once a client session is available.\n *\n * @example\n * ```ts\n * const result = await auth.webauthn.signIn();\n * ```\n */\n signIn(opts?: WebAuthnSignInOptions): Promise<SignInResult>;\n}\n\n/**\n * Optional hints for {@link TotpClient.setup}.\n */\nexport type TotpSetupOptions = {\n /** Issuer name shown in the authenticator app. */\n name?: string;\n /** Account label shown in the authenticator app. */\n accountName?: string;\n};\n\n/** Result of {@link TotpClient.setup}. */\nexport type TotpSetupResult = {\n /** `otpauth://` URL — render as a QR code. */\n uri: string;\n /** Raw base32-encoded shared secret. */\n secret: string;\n /** Verifier token to pass to {@link TotpClient.confirm}. */\n verifier: string;\n /** Factor ID to pass to {@link TotpClient.confirm}. */\n totpId: string;\n};\n\n/** Params for {@link TotpClient.confirm}. */\nexport type TotpConfirmParams = {\n /** Six-digit OTP from the authenticator app. */\n code: string;\n /** Verifier token from {@link TotpSetupResult.verifier}. */\n verifier: string;\n /** Factor ID from {@link TotpSetupResult.totpId}. */\n totpId: string;\n};\n\n/** Params for {@link TotpClient.verify}. */\nexport type TotpVerifyParams = {\n /** Six-digit OTP from the authenticator app. */\n code: string;\n /** Verifier token from a `totpRequired` sign-in result. */\n verifier: string;\n};\n\n/**\n * TOTP two-factor authentication client-side helpers.\n *\n * @see {@link WebAuthnClient}\n * @see {@link DeviceClient}\n */\nexport interface TotpClient {\n /**\n * Start TOTP enrollment and return the setup URI, secret, verifier, and factor ID.\n *\n * The returned `uri` is an `otpauth://` URL that can be rendered as a QR code\n * for the user to scan with their authenticator app.\n *\n * @param opts - Optional setup hints.\n * @param opts.name - Issuer name shown in the authenticator app.\n * @param opts.accountName - Account label in the authenticator app.\n * @returns An object with `{ uri, secret, verifier, totpId }`.\n *\n * @example\n * ```ts\n * const { uri, secret, verifier, totpId } = await auth.totp.setup();\n * // Render `uri` as a QR code, then confirm:\n * await auth.totp.confirm({ code: userCode, verifier, totpId });\n * ```\n */\n setup(opts?: TotpSetupOptions): Promise<TotpSetupResult>;\n\n /**\n * Confirm a newly created TOTP factor with the first authenticator code.\n *\n * Call this after the user scans the QR code and enters the first OTP.\n *\n * @param opts - Confirmation parameters.\n * @param opts.code - The 6-digit TOTP code from the authenticator app.\n * @param opts.verifier - The verifier string returned by {@link TotpClient.setup}.\n * @param opts.totpId - The factor ID returned by {@link TotpClient.setup}.\n * @returns A {@link SignInResult} — `{ kind: \"signedIn\" }` on success, or\n * `{ kind: \"failed\", code }` when the code is rejected.\n *\n * @example\n * ```ts\n * const result = await auth.totp.confirm({ code: \"123456\", verifier, totpId });\n * if (result.kind === \"failed\") showError(result.code);\n * ```\n */\n confirm(opts: TotpConfirmParams): Promise<SignInResult>;\n\n /**\n * Complete a sign-in that is waiting on TOTP verification.\n *\n * Called when `signIn()` returns `{ kind: \"totpRequired\" }`.\n *\n * @param opts - Verification parameters.\n * @param opts.code - The 6-digit TOTP code from the authenticator app.\n * @param opts.verifier - The verifier string from the `totpRequired` result.\n * @returns A {@link SignInResult} — `{ kind: \"signedIn\" }` on success, or\n * `{ kind: \"failed\", code }` when the code is rejected.\n *\n * @example\n * ```ts\n * const result = await auth.signIn(\"password\", { email, password });\n * if (result.kind === \"totpRequired\") {\n * const totp = await auth.totp.verify({ code: totpCode, verifier: result.verifier });\n * if (totp.kind === \"failed\") showError(totp.code);\n * }\n * ```\n */\n verify(opts: TotpVerifyParams): Promise<SignInResult>;\n}\n\n/** Params for {@link DeviceClient.poll}. */\nexport type DevicePollParams = {\n code: DeviceCodeResult;\n /** Aborts the poll loop cleanly, e.g. on UI unmount. */\n signal?: AbortSignal;\n};\n\n/** Params for {@link DeviceClient.verify}. */\nexport type DeviceVerifyParams = { code: string };\n\n/**\n * Device authorization (RFC 8628) client-side helpers.\n *\n * @see {@link WebAuthnClient}\n * @see {@link TotpClient}\n */\nexport interface DeviceClient {\n /**\n * Poll until a device flow is approved or expires.\n *\n * Polls the server at the interval specified in the {@link DeviceCodeResult}\n * until the user authorizes the device or the code expires.\n *\n * @param opts - Poll options.\n * @param opts.code - The {@link DeviceCodeResult} returned from `signIn(\"device\")`.\n * @param opts.signal - Optional {@link AbortSignal}; aborting returns cleanly\n * at the next loop boundary (e.g. on UI unmount).\n * @throws `ConvexError({ code: \"DEVICE_CODE_EXPIRED\" })` when the code expires before authorization.\n *\n * @example\n * ```ts\n * const controller = new AbortController();\n * const result = await auth.signIn(\"device\");\n * if (result.kind === \"deviceCode\") {\n * // Display result.deviceCode.userCode to the user\n * await auth.device.poll({ code: result.deviceCode, signal: controller.signal });\n * console.log(\"Device authorized!\");\n * }\n * ```\n */\n poll(opts: DevicePollParams): Promise<void>;\n\n /**\n * Approve a device flow from the verification page using the displayed user code.\n *\n * Call this on the authorization page where the user enters the short code\n * shown on the device screen.\n *\n * @param opts - Verification options.\n * @param opts.code - The user code string (e.g. `\"WDJB-MJHT\"`).\n * @throws `ConvexError({ code: \"DEVICE_AUTHORIZATION_FAILED\" })` when verification fails.\n *\n * @example\n * ```ts\n * await auth.device.verify({ code: \"WDJB-MJHT\" });\n * ```\n */\n verify(opts: DeviceVerifyParams): Promise<void>;\n}\n\n/**\n * Extract capability flags from an AuthApiRefs type.\n *\n * @typeParam Api - An AuthApiRefs type to extract capability flags from.\n */\ntype SignInRequest<Api extends AuthApiRefs> =\n FunctionArgs<Api[\"signIn\"]> extends infer Args\n ? Args extends { request: infer Request }\n ? Request\n : Args\n : never;\n\ntype ProviderIds<Api extends AuthApiRefs> = [Api[\"signIn\"]] extends [never]\n ? string\n : SignInRequest<Api> extends infer Args\n ? Args extends unknown\n ? \"provider\" extends keyof Args\n ? Exclude<Args[keyof Args & \"provider\"], undefined>\n : never\n : never\n : never;\n\ntype HasProvider<Api extends AuthApiRefs, Id extends string> =\n string extends ProviderIds<Api> ? boolean : Id extends ProviderIds<Api> ? true : false;\n\ntype InferCaps<Api extends AuthApiRefs> = {\n webauthn: HasProvider<Api, \"webauthn\">;\n totp: HasProvider<Api, \"totp\">;\n device: HasProvider<Api, \"device\">;\n};\n\n/**\n * Include a capability when configured, omit it when disabled, and keep it\n * optional when a framework binding cannot know the capability.\n */\ntype CapabilityClient<Enabled extends boolean, Name extends string, Client> = [Enabled] extends [\n false,\n]\n ? {}\n : [boolean] extends [Enabled]\n ? { [Key in Name]?: Client }\n : { [Key in Name]: Client };\n\n/** Pending invite detected from URL or recovered from storage after redirect. */\nexport interface PendingInvite {\n /**\n * Raw one-time invite token. Pass to your invite acceptance mutation.\n * @readonly\n */\n readonly token: string;\n /**\n * Invite email from the URL or stored redirect state, if available.\n * @readonly\n */\n readonly email: string | null;\n /**\n * Consume the invite: clears storage/URL params and returns the token.\n *\n * @returns The invite token.\n * @throws When there is no pending invite to accept.\n */\n accept(): Promise<{ token: string }>;\n}\n\n/**\n * Discriminated union of params for the password provider's flows.\n *\n * Each branch maps to one of the six password flows: `signUp`, `signIn`,\n * `reset`, `recover`, `verify`, `change`. Selecting a `flow` literal narrows the\n * accepted params automatically.\n */\nexport type { PasswordParams } from \"../../shared/params\";\n\n/** Params for the email (magic link) provider's initiation step. */\nexport type EmailInitiateParams = EmailParams;\n\n/**\n * Params for completing a code-based flow (no provider). Used to finalise\n * email magic-link sign-ins and other provider-owned code flows when the\n * verification call is made without re-specifying the originating provider.\n */\nexport type CodeCompletionParams = CodeParams;\n\n/** Params for the `connection` provider — requires a connection ID. */\nexport type { ConnectionParams } from \"../../shared/params\";\n\n/** Params for the anonymous provider. Empty / `redirectTo` only. */\nexport type { AnonymousParams } from \"../../shared/params\";\n\n/** Default params shape for OAuth-style providers (google, github, etc.). */\nexport type OAuthSignInParams = OAuthParams;\n\n/**\n * Resolves the `params` argument shape from the `provider` literal.\n *\n * Known special providers (`\"password\"`, `\"email\"`, etc.) get strict typing.\n * Any other string falls back to OAuth-style params, since custom OAuth\n * providers can be registered under arbitrary IDs.\n */\ntype DefaultParamsForProvider<P> = P extends \"password\"\n ? PasswordParams\n : P extends \"email\"\n ? EmailInitiateParams\n : P extends \"anonymous\"\n ? AnonymousParams | undefined\n : P extends \"connection\"\n ? ConnectionParams\n : P extends \"webauthn\"\n ? never\n : P extends undefined\n ? CodeCompletionParams\n : OAuthSignInParams | undefined;\n\ntype ConfiguredProviderArgs<Api extends AuthApiRefs, P> =\n SignInRequest<Api> extends infer Args ? (Args extends { provider: P } ? Args : never) : never;\n\n/** Resolve a provider's exact params from the generated auth action reference. */\nexport type ParamsForProvider<Api extends AuthApiRefs, P> =\n string extends ProviderIds<Api>\n ? DefaultParamsForProvider<P>\n : P extends \"webauthn\" | \"totp\" | \"device\"\n ? never\n : P extends \"connection\"\n ? ConnectionParams\n : [P] extends [undefined]\n ? CodeCompletionParams\n : ConfiguredProviderArgs<Api, P> extends infer Args\n ? [Args] extends [never]\n ? never\n : Args extends { params: infer Params }\n ? Params\n : Args extends { params?: infer Params }\n ? Params | undefined\n : undefined\n : never;\n\n/**\n * Tuple-rest helper that flips `params` between required and optional based\n * on whether `undefined` is in its resolved type.\n */\nexport type SignInArgs<Api extends AuthApiRefs, P> =\n undefined extends ParamsForProvider<Api, P>\n ? [params?: ParamsForProvider<Api, P>]\n : [params: ParamsForProvider<Api, P>];\n\n/**\n * Public signature for `auth.signIn`. The provider literal discriminates the\n * params shape via {@link ParamsForProvider}, and the params slot is\n * automatically optional when the resolved type permits `undefined`.\n *\n * @example\n * ```ts\n * auth.signIn(\"password\", { flow: \"signIn\", email, password });\n * auth.signIn(\"password\", { flow: \"change\", email, currentPassword, newPassword });\n * auth.signIn(\"anonymous\"); // params optional\n * ```\n */\nexport type SignInOverloads<Api extends AuthApiRefs = AuthApiRefs> = <\n const P extends ProviderIds<Api> | undefined,\n>(\n provider: P,\n ...args: SignInArgs<Api, P>\n) => Promise<SignInResult>;\n\n/** Base auth client — always present. */\ninterface AuthClientBase<Api extends AuthApiRefs> {\n /** Restore initial auth state for the current runtime. */\n initialize: () => Promise<void>;\n /** SSR-safe query-param reader. */\n param: (name: string) => string | null;\n /**\n * Pending invite recovered from the URL or storage, if present.\n * @readonly\n */\n readonly invite: PendingInvite | null;\n /** Complete an OAuth callback using a URL or authorization code. */\n completeOAuth: (input: URL | string | { code: string }) => Promise<OAuthCompletionResult>;\n /** Start a sign-in flow for a provider. */\n signIn: SignInOverloads<Api>;\n /** Sign out and clear local auth state. */\n signOut: () => Promise<void>;\n /** Subscribe to auth state changes; returns an unsubscribe. */\n subscribe: (handler: AuthSubscriber) => () => void;\n /** Read the current auth state synchronously, e.g. for `useSyncExternalStore`. */\n getSnapshot: () => AuthState;\n /** Tear down listeners and reject in-flight handshakes. */\n destroy: () => void;\n}\n\n/**\n * Framework-agnostic auth client return type.\n *\n * Conditionally includes `totp` and `device` helpers based on the\n * capabilities in the `AuthApiRefs` type. Platform-specific `webauthn` helpers\n * are added by {@link PlatformAuthClient}.\n *\n * @typeParam Api - An AuthApiRefs type that determines which factor helpers are included.\n */\nexport type AuthClient<Api extends AuthApiRefs = AuthApiRefs> = AuthClientBase<Api> &\n CapabilityClient<InferCaps<Api>[\"totp\"], \"totp\", TotpClient> &\n CapabilityClient<InferCaps<Api>[\"device\"], \"device\", DeviceClient>;\n\n/**\n * Browser auth client return type.\n *\n * Extends {@link AuthClient} with conditional WebAuthn helpers when the\n * generated auth API exposes WebAuthn capabilities.\n *\n * @typeParam Api - An AuthApiRefs type that determines which factor helpers are included.\n */\nexport type PlatformAuthClient<Api extends AuthApiRefs = AuthApiRefs> = AuthClient<Api> &\n CapabilityClient<InferCaps<Api>[\"webauthn\"], \"webauthn\", WebAuthnClient>;\n\n/**\n * Options for {@link client}.\n *\n * @typeParam Api - An AuthApiRefs type.\n */\ntype ClientOptionsBase = {\n /** Any Convex client implementation used to run auth actions. */\n convex: ConvexTransport;\n /** Platform runtime implementation used by the client core. */\n runtime?: ClientRuntime;\n /** Platform-specific factor adapters supplied by higher-level entrypoints. */\n adapters?: ClientAdapters;\n /** Platform-specific adapter factories supplied by higher-level entrypoints. */\n adapterFactories?: ClientAdapterFactories;\n /** Explicit Convex deployment URL when it cannot be inferred from the client. */\n url?: string;\n /**\n * Storage backend for persisted tokens.\n *\n * Defaults to `runtime.storage` when provided, otherwise `null`.\n */\n storage?: Storage | null;\n /**\n * Server-known auth used to seed the synchronous boot so SSR and hydration\n * render the resolved state on first paint. A non-empty JWT boots signed in;\n * `null` boots signed out. Providing this at all marks auth as resolved, so\n * the client skips the loading phase. Omit it (leave `undefined`) to read the\n * persisted value from `storage` instead. Ongoing persistence always uses\n * `storage`.\n */\n token?: string | null;\n /** SSR-safe URL source for reading query parameters. */\n location?: URL | (() => URL | null);\n /**\n * Default OAuth `redirectTo` applied to `signIn` calls that omit it. Platform\n * entrypoints set this (e.g. Expo passes its native redirect URI) so the core\n * can build the authorization URL without a platform-specific `signIn` wrapper.\n */\n oauthRedirectTo?: string;\n /**\n * Milliseconds to wait for the Convex client to confirm a new token\n * before a sign-in handshake rejects with `AUTH_HANDSHAKE_TIMEOUT`.\n * Defaults to `5000`.\n */\n handshakeTimeoutMs?: number;\n};\n\n/** Direct Convex mode. Generated auth references are the client contract. */\nexport type DirectClientOptions<Api extends AuthApiRefs = AuthApiRefs> = ClientOptionsBase & {\n /** Typed auth function refs from the application's generated `api` object. */\n api: Api;\n /** Proxy transport and direct transport are mutually exclusive. */\n proxyPath?: never;\n /**\n * Action-only transport used for direct code exchange. Browser and Expo\n * entrypoints provide one automatically; headless runtimes must inject it.\n */\n httpClient?: ActionTransport | null;\n};\n\n/** HTTP proxy mode. The proxy owns the Convex function references. */\nexport type ProxyClientOptions = ClientOptionsBase & {\n /** Proxy endpoint used instead of direct Convex auth calls. */\n proxyPath: string;\n /** Generated references belong to direct mode and cannot be mixed with a proxy. */\n api?: never;\n /** Direct action transports belong to direct mode. */\n httpClient?: never;\n};\n\n/**\n * Client configuration. Selecting direct or proxy mode makes every required\n * transport explicit and prevents the two modes from being combined.\n */\nexport type ClientOptions<Api extends AuthApiRefs = AuthApiRefs> =\n | DirectClientOptions<Api>\n | ProxyClientOptions;\n\nexport type OAuthCompletionResult = { handled: false } | { handled: true; cleanupUrl: URL | null };\n\n/**\n * Metadata describing the current auth flow for handshake diagnostics.\n *\n * @internal\n */\nexport type AuthFlowContext = {\n provider?: string;\n flow: string;\n};\n\n/**\n * A simple deferred promise that can be resolved or rejected externally.\n */\ninterface SimpleDeferred<T, E = unknown> {\n readonly promise: Promise<T>;\n resolve(value: T): void;\n reject(error: E): void;\n}\n\n/**\n * Create a deferred promise that can be resolved or rejected externally.\n *\n * @returns A deferred object containing the promise and control methods.\n * @internal\n */\nexport function createDeferred<T, E = unknown>(): SimpleDeferred<T, E> {\n let resolve!: (value: T) => void;\n let reject!: (error: E) => void;\n const promise = new Promise<T>((res, rej) => {\n resolve = res;\n reject = rej as (error: E) => void;\n });\n return { promise, resolve, reject };\n}\n\n/** @internal */\nexport type HandshakeWaiter = {\n epoch: number;\n context: AuthFlowContext;\n deferred: SimpleDeferred<void, ConvexError<Value>>;\n timeoutId: ReturnType<typeof setTimeout>;\n};\n"],"mappings":";;;;;;;AAi0BA,SAAgB,iBAAuD;CACrE,IAAI;CACJ,IAAI;AAKJ,QAAO;EAAE,SAJO,IAAI,SAAY,KAAK,QAAQ;AAC3C,aAAU;AACV,YAAS;IACT;EACgB;EAAS;EAAQ"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SessionRows } from "./session.js";
|
|
2
|
-
import * as
|
|
3
|
-
import * as
|
|
2
|
+
import * as convex_values2300 from "convex/values";
|
|
3
|
+
import * as convex_server56 from "convex/server";
|
|
4
4
|
|
|
5
5
|
//#region src/component/account.d.ts
|
|
6
6
|
declare namespace account_d_exports {
|
|
@@ -10,7 +10,7 @@ type AcceptedCredentialsSignIn = Omit<SessionRows, "epoch"> & {
|
|
|
10
10
|
status: "accepted";
|
|
11
11
|
};
|
|
12
12
|
/** Reserve a password attempt and load all sign-in state in one transaction. */
|
|
13
|
-
declare const beginCredentialsSignIn:
|
|
13
|
+
declare const beginCredentialsSignIn: convex_server56.RegisteredMutation<"public", {
|
|
14
14
|
provider: string;
|
|
15
15
|
providerAccountId: string;
|
|
16
16
|
limitIdentifier: string;
|
|
@@ -30,22 +30,22 @@ declare const beginCredentialsSignIn: convex_server83.RegisteredMutation<"public
|
|
|
30
30
|
} | {
|
|
31
31
|
status: "ready";
|
|
32
32
|
account: {
|
|
33
|
-
_id:
|
|
33
|
+
_id: convex_values2300.GenericId<"Account">;
|
|
34
34
|
_creationTime: number;
|
|
35
35
|
extend?: any;
|
|
36
36
|
secret?: string | undefined;
|
|
37
37
|
emailVerified?: string | undefined;
|
|
38
38
|
phoneVerified?: string | undefined;
|
|
39
|
-
userId:
|
|
39
|
+
userId: convex_values2300.GenericId<"User">;
|
|
40
40
|
provider: string;
|
|
41
41
|
providerAccountId: string;
|
|
42
42
|
};
|
|
43
43
|
user: {
|
|
44
|
-
_id:
|
|
44
|
+
_id: convex_values2300.GenericId<"User">;
|
|
45
45
|
_creationTime: number;
|
|
46
|
-
extend?: any;
|
|
47
46
|
email?: string | undefined;
|
|
48
47
|
phone?: string | undefined;
|
|
48
|
+
extend?: any;
|
|
49
49
|
name?: string | undefined;
|
|
50
50
|
firstName?: string | undefined;
|
|
51
51
|
lastName?: string | undefined;
|
|
@@ -53,20 +53,20 @@ declare const beginCredentialsSignIn: convex_server83.RegisteredMutation<"public
|
|
|
53
53
|
emailVerificationTime?: number | undefined;
|
|
54
54
|
phoneVerificationTime?: number | undefined;
|
|
55
55
|
isAnonymous?: boolean | undefined;
|
|
56
|
-
lastActiveGroup?:
|
|
56
|
+
lastActiveGroup?: convex_values2300.GenericId<"Group"> | undefined;
|
|
57
57
|
sessionEpoch: number;
|
|
58
58
|
};
|
|
59
59
|
hasTotp: boolean;
|
|
60
60
|
}>>;
|
|
61
61
|
/** Refund a verified password attempt and optionally issue its session atomically. */
|
|
62
|
-
declare const completeCredentialsSignIn:
|
|
62
|
+
declare const completeCredentialsSignIn: convex_server56.RegisteredMutation<"public", {
|
|
63
63
|
replaceSession?: {
|
|
64
|
-
sessionId:
|
|
65
|
-
authenticatedUserId:
|
|
64
|
+
sessionId: convex_values2300.GenericId<"Session">;
|
|
65
|
+
authenticatedUserId: convex_values2300.GenericId<"User">;
|
|
66
66
|
} | undefined;
|
|
67
67
|
sessionExpirationTime: number;
|
|
68
68
|
refreshTokenExpirationTime: number;
|
|
69
|
-
accountId:
|
|
69
|
+
accountId: convex_values2300.GenericId<"Account">;
|
|
70
70
|
limitIdentifier: string;
|
|
71
71
|
issueSession: boolean;
|
|
72
72
|
generateTokens: boolean;
|
|
@@ -79,18 +79,18 @@ declare const completeCredentialsSignIn: convex_server83.RegisteredMutation<"pub
|
|
|
79
79
|
* Read an account by id, or by `{ provider, providerAccountId }` when both
|
|
80
80
|
* are given. Returns `null` when no selector matches.
|
|
81
81
|
*/
|
|
82
|
-
declare const get:
|
|
83
|
-
id?:
|
|
82
|
+
declare const get: convex_server56.RegisteredQuery<"public", {
|
|
83
|
+
id?: convex_values2300.GenericId<"Account"> | undefined;
|
|
84
84
|
provider?: string | undefined;
|
|
85
85
|
providerAccountId?: string | undefined;
|
|
86
86
|
}, Promise<{
|
|
87
|
-
_id:
|
|
87
|
+
_id: convex_values2300.GenericId<"Account">;
|
|
88
88
|
_creationTime: number;
|
|
89
89
|
extend?: any;
|
|
90
90
|
secret?: string | undefined;
|
|
91
91
|
emailVerified?: string | undefined;
|
|
92
92
|
phoneVerified?: string | undefined;
|
|
93
|
-
userId:
|
|
93
|
+
userId: convex_values2300.GenericId<"User">;
|
|
94
94
|
provider: string;
|
|
95
95
|
providerAccountId: string;
|
|
96
96
|
} | null>>;
|
|
@@ -101,35 +101,35 @@ declare const get: convex_server83.RegisteredQuery<"public", {
|
|
|
101
101
|
* public server facade projects these raw records into safe capability
|
|
102
102
|
* summaries before exposing them to application code.
|
|
103
103
|
*/
|
|
104
|
-
declare const list:
|
|
105
|
-
userId?:
|
|
104
|
+
declare const list: convex_server56.RegisteredQuery<"public", {
|
|
105
|
+
userId?: convex_values2300.GenericId<"User"> | undefined;
|
|
106
106
|
provider?: string | undefined;
|
|
107
|
-
userIds?:
|
|
107
|
+
userIds?: convex_values2300.GenericId<"User">[] | undefined;
|
|
108
108
|
}, Promise<{
|
|
109
|
-
_id:
|
|
109
|
+
_id: convex_values2300.GenericId<"Account">;
|
|
110
110
|
_creationTime: number;
|
|
111
111
|
extend?: any;
|
|
112
112
|
secret?: string | undefined;
|
|
113
113
|
emailVerified?: string | undefined;
|
|
114
114
|
phoneVerified?: string | undefined;
|
|
115
|
-
userId:
|
|
115
|
+
userId: convex_values2300.GenericId<"User">;
|
|
116
116
|
provider: string;
|
|
117
117
|
providerAccountId: string;
|
|
118
118
|
}[]>>;
|
|
119
119
|
/** Insert a new account. */
|
|
120
|
-
declare const create:
|
|
120
|
+
declare const create: convex_server56.RegisteredMutation<"public", {
|
|
121
121
|
extend?: any;
|
|
122
122
|
secret?: string | undefined;
|
|
123
|
-
userId:
|
|
123
|
+
userId: convex_values2300.GenericId<"User">;
|
|
124
124
|
provider: string;
|
|
125
125
|
providerAccountId: string;
|
|
126
|
-
}, Promise<
|
|
126
|
+
}, Promise<convex_values2300.GenericId<"Account">>>;
|
|
127
127
|
/** Patch fields on an account. */
|
|
128
|
-
declare const update:
|
|
129
|
-
id:
|
|
128
|
+
declare const update: convex_server56.RegisteredMutation<"public", {
|
|
129
|
+
id: convex_values2300.GenericId<"Account">;
|
|
130
130
|
patch: {
|
|
131
|
+
userId?: convex_values2300.GenericId<"User"> | undefined;
|
|
131
132
|
extend?: any;
|
|
132
|
-
userId?: convex_values1512.GenericId<"User"> | undefined;
|
|
133
133
|
provider?: string | undefined;
|
|
134
134
|
providerAccountId?: string | undefined;
|
|
135
135
|
secret?: string | undefined;
|
|
@@ -141,10 +141,10 @@ declare const update: convex_server83.RegisteredMutation<"public", {
|
|
|
141
141
|
* Delete an account. When `requireOtherAccount` is set, refuses to delete the
|
|
142
142
|
* user's last remaining account so they are never left with none.
|
|
143
143
|
*/
|
|
144
|
-
declare const remove:
|
|
145
|
-
userId?:
|
|
144
|
+
declare const remove: convex_server56.RegisteredMutation<"public", {
|
|
145
|
+
userId?: convex_values2300.GenericId<"User"> | undefined;
|
|
146
146
|
requireOtherAccount?: boolean | undefined;
|
|
147
|
-
id:
|
|
147
|
+
id: convex_values2300.GenericId<"Account">;
|
|
148
148
|
}, Promise<null>>;
|
|
149
149
|
//#endregion
|
|
150
150
|
export { account_d_exports };
|
|
@@ -1,22 +1,21 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import * as
|
|
1
|
+
import * as convex_values2754 from "convex/values";
|
|
2
|
+
import * as convex_server172 from "convex/server";
|
|
3
3
|
|
|
4
4
|
//#region src/component/connection/audit.d.ts
|
|
5
5
|
declare namespace audit_d_exports {
|
|
6
6
|
export { list };
|
|
7
7
|
}
|
|
8
8
|
/**
|
|
9
|
-
* `component.connection.audit.*` -
|
|
9
|
+
* `component.connection.audit.*` - Auth events scoped to a connection or group.
|
|
10
10
|
*
|
|
11
11
|
* @module
|
|
12
12
|
*/
|
|
13
13
|
/**
|
|
14
|
-
* List
|
|
15
|
-
* paginated.
|
|
16
|
-
*
|
|
17
|
-
* neither throws rather than scanning the entire audit log.
|
|
14
|
+
* List auth events scoped to a connection or a group, newest first and
|
|
15
|
+
* paginated. Requires exactly one of `connectionId` or `groupId`, so a caller
|
|
16
|
+
* cannot scan the whole event log by omitting the scope.
|
|
18
17
|
*/
|
|
19
|
-
declare const list:
|
|
18
|
+
declare const list: convex_server172.RegisteredQuery<"public", {
|
|
20
19
|
paginationOpts: {
|
|
21
20
|
id?: number;
|
|
22
21
|
endCursor?: string | null;
|
|
@@ -26,109 +25,104 @@ declare const list: convex_server186.RegisteredQuery<"public", {
|
|
|
26
25
|
cursor: string | null;
|
|
27
26
|
};
|
|
28
27
|
scope: {
|
|
29
|
-
connectionId:
|
|
28
|
+
connectionId: convex_values2754.GenericId<"GroupConnection">;
|
|
30
29
|
} | {
|
|
31
|
-
groupId:
|
|
30
|
+
groupId: convex_values2754.GenericId<"Group">;
|
|
32
31
|
};
|
|
33
|
-
}, Promise<{
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
isDone: boolean;
|
|
128
|
-
continueCursor: convex_server186.Cursor;
|
|
129
|
-
splitCursor?: convex_server186.Cursor | null;
|
|
130
|
-
pageStatus?: "SplitRecommended" | "SplitRequired" | null;
|
|
131
|
-
}>>;
|
|
32
|
+
}, Promise<convex_server172.PaginationResult<{
|
|
33
|
+
_id: convex_values2754.GenericId<"AuthEventProjection">;
|
|
34
|
+
_creationTime: number;
|
|
35
|
+
requestId?: string | undefined;
|
|
36
|
+
ip?: string | undefined;
|
|
37
|
+
userAgent?: string | undefined;
|
|
38
|
+
errorCode?: string | undefined;
|
|
39
|
+
data?: {
|
|
40
|
+
type?: string | undefined;
|
|
41
|
+
provider?: string | undefined;
|
|
42
|
+
profile?: Record<string, any> | undefined;
|
|
43
|
+
existingUserId?: string | undefined;
|
|
44
|
+
} | {
|
|
45
|
+
method?: string | undefined;
|
|
46
|
+
provider: string;
|
|
47
|
+
} | {
|
|
48
|
+
userId?: string | undefined;
|
|
49
|
+
sessionId?: string | undefined;
|
|
50
|
+
reason?: string | undefined;
|
|
51
|
+
refreshTokenId?: string | undefined;
|
|
52
|
+
flow?: "reset" | "change" | undefined;
|
|
53
|
+
} | {
|
|
54
|
+
provider?: string | undefined;
|
|
55
|
+
providerAccountId?: string | undefined;
|
|
56
|
+
accountId?: string | undefined;
|
|
57
|
+
} | {
|
|
58
|
+
reason?: string | undefined;
|
|
59
|
+
passkeyId?: string | undefined;
|
|
60
|
+
credentialId?: string | undefined;
|
|
61
|
+
totpId?: string | undefined;
|
|
62
|
+
keyId?: string | undefined;
|
|
63
|
+
name?: string | undefined;
|
|
64
|
+
prefix?: string | undefined;
|
|
65
|
+
} | {
|
|
66
|
+
userId?: string | undefined;
|
|
67
|
+
email?: string | undefined;
|
|
68
|
+
phone?: string | undefined;
|
|
69
|
+
} | {
|
|
70
|
+
userId?: string | undefined;
|
|
71
|
+
name?: string | undefined;
|
|
72
|
+
clientId?: string | undefined;
|
|
73
|
+
codeId?: string | undefined;
|
|
74
|
+
scopes?: string[] | undefined;
|
|
75
|
+
redirectUri?: string | undefined;
|
|
76
|
+
grantType?: string | undefined;
|
|
77
|
+
resource?: string | undefined;
|
|
78
|
+
} | {
|
|
79
|
+
userId?: string | undefined;
|
|
80
|
+
errorCode?: string | undefined;
|
|
81
|
+
connectionId?: string | undefined;
|
|
82
|
+
changed?: string[] | undefined;
|
|
83
|
+
protocol?: "oidc" | "saml" | undefined;
|
|
84
|
+
domain?: string | undefined;
|
|
85
|
+
recordName?: string | undefined;
|
|
86
|
+
expiresAt?: number | undefined;
|
|
87
|
+
verifiedAt?: number | undefined;
|
|
88
|
+
metadataUrl?: string | undefined;
|
|
89
|
+
domains?: string[] | undefined;
|
|
90
|
+
issuer?: string | undefined;
|
|
91
|
+
discoveryUrl?: string | undefined;
|
|
92
|
+
jwksUri?: string | undefined;
|
|
93
|
+
audience?: string | string[] | undefined;
|
|
94
|
+
tokenEndpointAuthMethod?: string | undefined;
|
|
95
|
+
version?: number | undefined;
|
|
96
|
+
} | {
|
|
97
|
+
userId?: string | undefined;
|
|
98
|
+
scimConfigId?: string | undefined;
|
|
99
|
+
resourceType?: "user" | "group" | undefined;
|
|
100
|
+
resourceId?: string | undefined;
|
|
101
|
+
operation?: string | undefined;
|
|
102
|
+
externalId?: string | undefined;
|
|
103
|
+
active?: boolean | undefined;
|
|
104
|
+
groupId?: string | undefined;
|
|
105
|
+
} | {
|
|
106
|
+
endpointId?: string | undefined;
|
|
107
|
+
deliveryId?: string | undefined;
|
|
108
|
+
sourceEventId?: string | undefined;
|
|
109
|
+
sourceEventType?: "user.created" | "user.updated" | "session.signed_in" | "session.signed_out" | "session.invalidated" | "session.refresh_exchanged" | "session.refresh_reuse_detected" | "account.linked" | "account.unlinked" | "password.changed" | "passkey.added" | "passkey.removed" | "totp.enrolled" | "totp.removed" | "email.verified" | "phone.verified" | "api_key.created" | "api_key.revoked" | "oauth.client.created" | "oauth.client.revoked" | "oauth.code.created" | "oauth.token.created" | "oauth.token.exchanged" | "oauth.refresh.reuse_detected" | "oauth.refresh.revoked" | "connection.created" | "connection.updated" | "connection.removed" | "connection.login.succeeded" | "connection.login.failed" | "connection.domain.verification_requested" | "connection.domain.verified" | "connection.policy.updated" | "connection.saml.set" | "connection.saml.refreshed" | "connection.oidc.set" | "connection.scim.set" | "connection.scim.read" | "connection.scim.user.provisioned" | "connection.scim.user.updated" | "connection.scim.user.deactivated" | "connection.scim.user.reactivated" | "connection.scim.group.provisioned" | "connection.scim.group.updated" | "connection.scim.group.deactivated" | "connection.scim.group.reactivated" | "webhook.endpoint.created" | "webhook.endpoint.disabled" | "webhook.delivery.created" | "webhook.delivery.attempted" | "webhook.delivery.succeeded" | "webhook.delivery.failed" | undefined;
|
|
110
|
+
attemptCount?: number | undefined;
|
|
111
|
+
status?: number | undefined;
|
|
112
|
+
error?: string | undefined;
|
|
113
|
+
} | undefined;
|
|
114
|
+
actorId?: string | undefined;
|
|
115
|
+
subjectId?: string | undefined;
|
|
116
|
+
eventId: string;
|
|
117
|
+
kind: "user.created" | "user.updated" | "session.signed_in" | "session.signed_out" | "session.invalidated" | "session.refresh_exchanged" | "session.refresh_reuse_detected" | "account.linked" | "account.unlinked" | "password.changed" | "passkey.added" | "passkey.removed" | "totp.enrolled" | "totp.removed" | "email.verified" | "phone.verified" | "api_key.created" | "api_key.revoked" | "oauth.client.created" | "oauth.client.revoked" | "oauth.code.created" | "oauth.token.created" | "oauth.token.exchanged" | "oauth.refresh.reuse_detected" | "oauth.refresh.revoked" | "connection.created" | "connection.updated" | "connection.removed" | "connection.login.succeeded" | "connection.login.failed" | "connection.domain.verification_requested" | "connection.domain.verified" | "connection.policy.updated" | "connection.saml.set" | "connection.saml.refreshed" | "connection.oidc.set" | "connection.scim.set" | "connection.scim.read" | "connection.scim.user.provisioned" | "connection.scim.user.updated" | "connection.scim.user.deactivated" | "connection.scim.user.reactivated" | "connection.scim.group.provisioned" | "connection.scim.group.updated" | "connection.scim.group.deactivated" | "connection.scim.group.reactivated" | "webhook.endpoint.created" | "webhook.endpoint.disabled" | "webhook.delivery.created" | "webhook.delivery.attempted" | "webhook.delivery.succeeded" | "webhook.delivery.failed";
|
|
118
|
+
category: "user" | "session" | "account" | "password" | "passkey" | "totp" | "email" | "phone" | "api_key" | "oauth" | "connection" | "scim" | "webhook" | "security";
|
|
119
|
+
occurredAt: number;
|
|
120
|
+
outcome: "success" | "failure";
|
|
121
|
+
targetKind: "user" | "group" | "session" | "api_key" | "connection" | "oauth_client" | "global";
|
|
122
|
+
actorType: "user" | "api_key" | "scim" | "webhook" | "system" | "oauth_client" | "anonymous";
|
|
123
|
+
subjectType: "user" | "group" | "session" | "account" | "passkey" | "totp" | "email" | "phone" | "api_key" | "connection" | "system" | "oauth_client" | "oauth_code" | "scim_identity" | "webhook_endpoint" | "webhook_delivery";
|
|
124
|
+
targetId: string;
|
|
125
|
+
}>>>;
|
|
132
126
|
//#endregion
|
|
133
127
|
export { audit_d_exports };
|
|
134
128
|
//# sourceMappingURL=audit.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"audit.d.ts","names":[],"sources":["../../../src/component/connection/audit.ts"],"mappings":";;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"audit.d.ts","names":[],"sources":["../../../src/component/connection/audit.ts"],"mappings":";;;;;;;;;;;;;AAoBA;;;;cAAa,IAAA,mBAAI,eAAA;;;;;;;;;;kBA6Bf,iBAAA,CAAA,SAAA;EAAA"}
|