import { AuthBundle, AuthFunctions, AuthFunctionsConfig, DefaultRole, Include, ServiceMutation, ServicePrincipal, ServiceQuery } from "../../auth.mjs"; import { EffectValue } from "./operation.mjs"; import { EffectApiContext, EffectApiOptions, EffectApiServices, ProvidedServices } from "./api-runtime.mjs"; import { EffectZodApiBuilder } from "./api-zod.mjs"; import { CustomBuilder } from "convex-helpers/server/zod4"; import { GenericActionCtx, GenericDataModel, GenericMutationCtx, GenericQueryCtx } from "convex/server"; import { Context } from "effect"; //#region src/modules/effect/auth.d.ts type Adapted = Builder extends CustomBuilder ? EffectZodApiBuilder, EffectValue, Added> : never; /** Shared post-auth composition; internal/system policies are configured separately. */ export type EffectAuthFunctions, QueryAdded extends EffectApiContext = {}, MutationServices extends EffectApiServices = Context.Context, MutationAdded extends EffectApiContext = {}, ActionServices extends EffectApiServices = Context.Context, ActionAdded extends EffectApiContext = {}, SystemQueryServices extends EffectApiServices = Context.Context, SystemQueryAdded extends EffectApiContext = {}, SystemMutationServices extends EffectApiServices = Context.Context, SystemMutationAdded extends EffectApiContext = {}, SystemActionServices extends EffectApiServices = Context.Context, SystemActionAdded extends EffectApiContext = {}> = Pick, 'include' | 'authenticatedUser'> & { authQuery: Adapted['authQuery'], QueryServices, QueryAdded>; roleQuery: (...allowed: readonly Role[]) => Adapted['authQuery'], QueryServices, QueryAdded>; adminQuery: Adapted['authQuery'], QueryServices, QueryAdded>; authMutation: Adapted['authMutation'], MutationServices, MutationAdded>; roleMutation: (...allowed: readonly Role[]) => Adapted['authMutation'], MutationServices, MutationAdded>; adminMutation: Adapted['authMutation'], MutationServices, MutationAdded>; authAction: Adapted['authAction'], ActionServices, ActionAdded>; roleAction: (...allowed: readonly Role[]) => Adapted['authAction'], ActionServices, ActionAdded>; adminAction: Adapted['authAction'], ActionServices, ActionAdded>; /** Service principals share the `query` policy; the host factory is the only principal source. */ serviceQuery: = {}>(principal: ServicePrincipal, Role, Extra>) => Adapted, QueryServices, QueryAdded>; /** Service principals share the `mutation` policy. */ serviceMutation: = {}>(principal: ServicePrincipal, Role, Extra>) => Adapted, MutationServices, MutationAdded>; systemQuery: Adapted['systemQuery'], SystemQueryServices, SystemQueryAdded>; systemMutation: Adapted['systemMutation'], SystemMutationServices, SystemMutationAdded>; systemAction: Adapted['systemAction'], SystemActionServices, SystemActionAdded>; }; /** Providers and handles run once per invocation after security and live role checks. */ export declare function createEffectAuthFunctions, QueryAdded extends EffectApiContext = {}, MutationServices extends EffectApiServices = Context.Context, MutationAdded extends EffectApiContext = {}, ActionServices extends EffectApiServices = Context.Context, ActionAdded extends EffectApiContext = {}, SystemQueryServices extends EffectApiServices = Context.Context, SystemQueryAdded extends EffectApiContext = {}, SystemMutationServices extends EffectApiServices = Context.Context, SystemMutationAdded extends EffectApiContext = {}, SystemActionServices extends EffectApiServices = Context.Context, SystemActionAdded extends EffectApiContext = {}>(config: AuthFunctionsConfig, options: { query: EffectApiOptions & AuthBundle & { include: Include; }, QueryServices, QueryAdded>; mutation: EffectApiOptions & AuthBundle & { include: Include; }, MutationServices, MutationAdded>; action: EffectApiOptions & AuthBundle, ActionServices, ActionAdded>; systemQuery: EffectApiOptions & { include: Include; }, SystemQueryServices, SystemQueryAdded>; systemMutation: EffectApiOptions & { include: Include; }, SystemMutationServices, SystemMutationAdded>; systemAction: EffectApiOptions, SystemActionServices, SystemActionAdded>; }): EffectAuthFunctions; //#endregion //# sourceMappingURL=auth.d.mts.map