cvx-kit 0.2.0 → 2.0.0-beta.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/README.md +556 -99
- package/dist/agent-tools.d.mts +39 -26
- package/dist/agent-tools.mjs +1 -1
- package/dist/agent-tools.mjs.map +1 -1
- package/dist/auth.d.mts +120 -308
- package/dist/auth.mjs +1 -1
- package/dist/auth.mjs.map +1 -1
- package/dist/components/approvals/_generated/api.d.mts +7 -9
- package/dist/components/approvals/_generated/api.mjs.map +1 -1
- package/dist/components/approvals/_generated/component.d.mts +1 -4
- package/dist/components/approvals/_generated/dataModel.d.mts +5 -8
- package/dist/components/approvals/_generated/server.d.mts +12 -15
- package/dist/components/approvals/_generated/server.mjs.map +1 -1
- package/dist/components/approvals/audit.d.mts +8 -9
- package/dist/components/approvals/audit.mjs +1 -1
- package/dist/components/approvals/audit.mjs.map +1 -1
- package/dist/components/approvals/client.d.mts +11 -12
- package/dist/components/approvals/client.mjs +1 -1
- package/dist/components/approvals/client.mjs.map +1 -1
- package/dist/components/approvals/constants.d.mts +30 -31
- package/dist/components/approvals/constants.mjs.map +1 -1
- package/dist/components/approvals/convex.config.d.mts +0 -2
- package/dist/components/approvals/convex.config.mjs.map +1 -1
- package/dist/components/approvals/decisions.d.mts +13 -17
- package/dist/components/approvals/decisions.mjs +1 -1
- package/dist/components/approvals/decisions.mjs.map +1 -1
- package/dist/components/approvals/functions.d.mts +3 -4
- package/dist/components/approvals/functions.mjs +1 -1
- package/dist/components/approvals/functions.mjs.map +1 -1
- package/dist/components/approvals/health.d.mts +2 -3
- package/dist/components/approvals/health.mjs.map +1 -1
- package/dist/components/approvals/requests.d.mts +114 -131
- package/dist/components/approvals/requests.mjs +1 -1
- package/dist/components/approvals/requests.mjs.map +1 -1
- package/dist/components/approvals/schema.d.ts +106 -315
- package/dist/components/approvals/schema.js +1 -1
- package/dist/components/approvals/validators.d.mts +323 -395
- package/dist/components/approvals/validators.mjs +1 -1
- package/dist/components/approvals/validators.mjs.map +1 -1
- package/dist/components/approvals/workflow.d.mts +4 -5
- package/dist/components/approvals/workflow.mjs +1 -1
- package/dist/components/approvals/workflow.mjs.map +1 -1
- package/dist/components/approvals/workflow_steps.d.mts +16 -17
- package/dist/components/approvals/workflow_steps.mjs +1 -1
- package/dist/components/approvals/workflow_steps.mjs.map +1 -1
- package/dist/components/foundation/_generated/api.d.mts +6 -8
- package/dist/components/foundation/_generated/api.mjs.map +1 -1
- package/dist/components/foundation/_generated/component.d.mts +1 -4
- package/dist/components/foundation/_generated/dataModel.d.mts +5 -8
- package/dist/components/foundation/_generated/server.d.mts +12 -15
- package/dist/components/foundation/_generated/server.mjs.map +1 -1
- package/dist/components/foundation/client.d.mts +45 -38
- package/dist/components/foundation/client.mjs +1 -1
- package/dist/components/foundation/client.mjs.map +1 -1
- package/dist/components/foundation/convex.config.d.mts +0 -2
- package/dist/components/foundation/convex.config.mjs.map +1 -1
- package/dist/components/foundation/functions.d.mts +2 -3
- package/dist/components/foundation/functions.mjs.map +1 -1
- package/dist/components/foundation/modules/command/command.d.mts +65 -17
- package/dist/components/foundation/modules/command/command.mjs +1 -1
- package/dist/components/foundation/modules/command/command.mjs.map +1 -1
- package/dist/components/foundation/modules/command/lifecycle.d.mts +78 -0
- package/dist/components/foundation/modules/command/lifecycle.mjs +2 -0
- package/dist/components/foundation/modules/command/lifecycle.mjs.map +1 -0
- package/dist/components/foundation/modules/observability/observability.d.mts +13 -6
- package/dist/components/foundation/modules/observability/observability.mjs +1 -1
- package/dist/components/foundation/modules/observability/observability.mjs.map +1 -1
- package/dist/components/foundation/modules/query/query.d.mts +11 -12
- package/dist/components/foundation/modules/query/query.mjs +1 -1
- package/dist/components/foundation/modules/query/query.mjs.map +1 -1
- package/dist/components/foundation/operation.d.mts +72 -0
- package/dist/components/foundation/operation.mjs +2 -0
- package/dist/components/foundation/operation.mjs.map +1 -0
- package/dist/components/foundation/result.d.mts +7 -8
- package/dist/components/foundation/result.mjs.map +1 -1
- package/dist/components/foundation/schema.d.ts +0 -2
- package/dist/components/foundation/telemetry.d.mts +2 -3
- package/dist/components/foundation/telemetry.mjs +1 -1
- package/dist/components/foundation/telemetry.mjs.map +1 -1
- package/dist/contracts.d.mts +5 -0
- package/dist/contracts.mjs +1 -0
- package/dist/crud.d.mts +185 -27
- package/dist/crud.mjs +1 -1
- package/dist/crud.mjs.map +1 -1
- package/dist/effect.d.mts +16 -0
- package/dist/effect.mjs +1 -0
- package/dist/errors.d.mts +6 -6
- package/dist/errors.mjs +1 -1
- package/dist/errors.mjs.map +1 -1
- package/dist/filters.d.mts +4 -0
- package/dist/filters.mjs +1 -0
- package/dist/idempotency.d.mts +2 -0
- package/dist/idempotency.mjs +1 -0
- package/dist/index.d.mts +14 -7
- package/dist/index.mjs +1 -1
- package/dist/json-schema.d.mts +40 -0
- package/dist/json-schema.mjs +2 -0
- package/dist/json-schema.mjs.map +1 -0
- package/dist/k/compile.d.mts +17 -0
- package/dist/k/compile.mjs +2 -0
- package/dist/k/compile.mjs.map +1 -0
- package/dist/k/dates.d.mts +23 -0
- package/dist/k/dates.mjs +2 -0
- package/dist/k/dates.mjs.map +1 -0
- package/dist/k/formats.d.mts +24 -0
- package/dist/k/formats.mjs +2 -0
- package/dist/k/formats.mjs.map +1 -0
- package/dist/k/index.d.mts +32 -0
- package/dist/k/index.mjs +2 -0
- package/dist/k/index.mjs.map +1 -0
- package/dist/k/issues.d.mts +31 -0
- package/dist/k/issues.mjs +2 -0
- package/dist/k/issues.mjs.map +1 -0
- package/dist/k/kinds.d.mts +81 -0
- package/dist/k/kinds.mjs +2 -0
- package/dist/k/kinds.mjs.map +1 -0
- package/dist/k/object.d.mts +43 -0
- package/dist/k/object.mjs +2 -0
- package/dist/k/object.mjs.map +1 -0
- package/dist/k/parse.d.mts +29 -0
- package/dist/k/parse.mjs +2 -0
- package/dist/k/parse.mjs.map +1 -0
- package/dist/k/schema.d.mts +100 -0
- package/dist/k/schema.mjs +2 -0
- package/dist/k/schema.mjs.map +1 -0
- package/dist/k/standard.d.mts +8 -0
- package/dist/k/standard.mjs +2 -0
- package/dist/k/standard.mjs.map +1 -0
- package/dist/k/types.d.mts +64 -0
- package/dist/k/types.mjs +1 -0
- package/dist/k.d.mts +8 -0
- package/dist/k.mjs +1 -0
- package/dist/middleware.d.mts +8 -11
- package/dist/middleware.mjs +1 -1
- package/dist/middleware.mjs.map +1 -1
- package/dist/modules/contracts/binding.d.mts +23 -0
- package/dist/modules/contracts/binding.mjs +2 -0
- package/dist/modules/contracts/binding.mjs.map +1 -0
- package/dist/modules/contracts/contract.d.mts +67 -0
- package/dist/modules/contracts/contract.mjs +2 -0
- package/dist/modules/contracts/contract.mjs.map +1 -0
- package/dist/modules/contracts/convex.d.mts +18 -0
- package/dist/modules/contracts/convex.mjs +2 -0
- package/dist/modules/contracts/convex.mjs.map +1 -0
- package/dist/modules/contracts/domain.d.mts +62 -0
- package/dist/modules/contracts/domain.mjs +2 -0
- package/dist/modules/contracts/domain.mjs.map +1 -0
- package/dist/modules/contracts/errors.d.mts +737 -0
- package/dist/modules/contracts/errors.mjs +2 -0
- package/dist/modules/contracts/errors.mjs.map +1 -0
- package/dist/modules/contracts/exposure.d.mts +103 -0
- package/dist/modules/contracts/exposure.mjs +2 -0
- package/dist/modules/contracts/exposure.mjs.map +1 -0
- package/dist/modules/contracts/idempotency.d.mts +85 -0
- package/dist/modules/contracts/idempotency.mjs +2 -0
- package/dist/modules/contracts/idempotency.mjs.map +1 -0
- package/dist/modules/contracts/lazy.d.mts +6 -0
- package/dist/modules/contracts/lazy.mjs +2 -0
- package/dist/modules/contracts/lazy.mjs.map +1 -0
- package/dist/modules/contracts/standard.d.mts +17 -0
- package/dist/modules/contracts/standard.mjs +2 -0
- package/dist/modules/contracts/standard.mjs.map +1 -0
- package/dist/modules/contracts/workflow.d.mts +165 -0
- package/dist/modules/contracts/workflow.mjs +2 -0
- package/dist/modules/contracts/workflow.mjs.map +1 -0
- package/dist/modules/effect/action.d.mts +63 -0
- package/dist/modules/effect/action.mjs +2 -0
- package/dist/modules/effect/action.mjs.map +1 -0
- package/dist/modules/effect/agent-tools.d.mts +2 -0
- package/dist/modules/effect/agent-tools.mjs +1 -0
- package/dist/modules/effect/api-runtime.d.mts +36 -0
- package/dist/modules/effect/api-runtime.mjs +2 -0
- package/dist/modules/effect/api-runtime.mjs.map +1 -0
- package/dist/modules/effect/api.d.mts +46 -0
- package/dist/modules/effect/api.mjs +2 -0
- package/dist/modules/effect/api.mjs.map +1 -0
- package/dist/modules/effect/auth.d.mts +46 -0
- package/dist/modules/effect/auth.mjs +2 -0
- package/dist/modules/effect/auth.mjs.map +1 -0
- package/dist/modules/effect/client.d.mts +15 -0
- package/dist/modules/effect/client.mjs +1 -0
- package/dist/modules/effect/command.d.mts +108 -0
- package/dist/modules/effect/command.mjs +2 -0
- package/dist/modules/effect/command.mjs.map +1 -0
- package/dist/modules/effect/crud.d.mts +885 -0
- package/dist/modules/effect/crud.mjs +2 -0
- package/dist/modules/effect/crud.mjs.map +1 -0
- package/dist/modules/effect/domain.d.mts +82 -0
- package/dist/modules/effect/domain.mjs +2 -0
- package/dist/modules/effect/domain.mjs.map +1 -0
- package/dist/modules/effect/errors.d.mts +13 -0
- package/dist/modules/effect/errors.mjs +2 -0
- package/dist/modules/effect/errors.mjs.map +1 -0
- package/dist/modules/effect/failure-audit.d.mts +48 -0
- package/dist/modules/effect/failure-audit.mjs +2 -0
- package/dist/modules/effect/failure-audit.mjs.map +1 -0
- package/dist/modules/effect/failures.d.mts +21 -0
- package/dist/modules/effect/failures.mjs +2 -0
- package/dist/modules/effect/failures.mjs.map +1 -0
- package/dist/modules/effect/foundation.d.mts +23 -0
- package/dist/modules/effect/foundation.mjs +2 -0
- package/dist/modules/effect/foundation.mjs.map +1 -0
- package/dist/modules/effect/idempotency.d.mts +29 -0
- package/dist/modules/effect/idempotency.mjs +2 -0
- package/dist/modules/effect/idempotency.mjs.map +1 -0
- package/dist/modules/effect/input.d.mts +10 -0
- package/dist/modules/effect/input.mjs +2 -0
- package/dist/modules/effect/input.mjs.map +1 -0
- package/dist/modules/effect/normalize.d.mts +7 -0
- package/dist/modules/effect/normalize.mjs +2 -0
- package/dist/modules/effect/normalize.mjs.map +1 -0
- package/dist/modules/effect/operation.d.mts +148 -0
- package/dist/modules/effect/operation.mjs +2 -0
- package/dist/modules/effect/operation.mjs.map +1 -0
- package/dist/modules/effect/query.d.mts +90 -0
- package/dist/modules/effect/query.mjs +2 -0
- package/dist/modules/effect/query.mjs.map +1 -0
- package/dist/modules/effect/schema.d.mts +30 -0
- package/dist/modules/effect/schema.mjs +2 -0
- package/dist/modules/effect/schema.mjs.map +1 -0
- package/dist/modules/effect/scope.d.mts +25 -0
- package/dist/modules/effect/scope.mjs +2 -0
- package/dist/modules/effect/scope.mjs.map +1 -0
- package/dist/modules/effect/workflow.d.mts +75 -0
- package/dist/modules/effect/workflow.mjs +2 -0
- package/dist/modules/effect/workflow.mjs.map +1 -0
- package/dist/modules/foundation/foundation.d.mts +108 -0
- package/dist/modules/foundation/foundation.mjs +2 -0
- package/dist/modules/foundation/foundation.mjs.map +1 -0
- package/dist/modules/foundation/operation.d.mts +139 -0
- package/dist/modules/foundation/operation.mjs +2 -0
- package/dist/modules/foundation/operation.mjs.map +1 -0
- package/dist/namespace.d.mts +104 -0
- package/dist/namespace.mjs +2 -0
- package/dist/namespace.mjs.map +1 -0
- package/dist/oxlint/architecture.d.mts +23 -0
- package/dist/oxlint/architecture.mjs +2 -0
- package/dist/oxlint/architecture.mjs.map +1 -0
- package/dist/oxlint/ast.d.mts +51 -0
- package/dist/oxlint/ast.mjs +2 -0
- package/dist/oxlint/ast.mjs.map +1 -0
- package/dist/oxlint/components.d.mts +4 -0
- package/dist/oxlint/components.mjs +2 -0
- package/dist/oxlint/components.mjs.map +1 -0
- package/dist/oxlint/ownership.d.mts +59 -0
- package/dist/oxlint/ownership.mjs +2 -0
- package/dist/oxlint/ownership.mjs.map +1 -0
- package/dist/oxlint/reserved-files.d.mts +4 -0
- package/dist/oxlint/reserved-files.mjs +2 -0
- package/dist/oxlint/reserved-files.mjs.map +1 -0
- package/dist/oxlint.d.mts +9 -0
- package/dist/oxlint.mjs +2 -0
- package/dist/oxlint.mjs.map +1 -0
- package/dist/querying/cursors.d.mts +94 -0
- package/dist/querying/cursors.mjs +2 -0
- package/dist/querying/cursors.mjs.map +1 -0
- package/dist/querying/execution.d.mts +40 -0
- package/dist/querying/execution.mjs +2 -0
- package/dist/querying/execution.mjs.map +1 -0
- package/dist/querying/failures.d.mts +11 -0
- package/dist/querying/failures.mjs +2 -0
- package/dist/querying/failures.mjs.map +1 -0
- package/dist/querying/filter-boundary.d.mts +25 -0
- package/dist/querying/filter-boundary.mjs +2 -0
- package/dist/querying/filter-boundary.mjs.map +1 -0
- package/dist/querying/filters.d.mts +180 -0
- package/dist/querying/filters.mjs +2 -0
- package/dist/querying/filters.mjs.map +1 -0
- package/dist/querying/planner.d.mts +61 -0
- package/dist/querying/planner.mjs +2 -0
- package/dist/querying/planner.mjs.map +1 -0
- package/dist/querying/relationships.d.mts +58 -0
- package/dist/querying/relationships.mjs +2 -0
- package/dist/querying/relationships.mjs.map +1 -0
- package/dist/querying/search.d.mts +69 -0
- package/dist/querying/search.mjs +2 -0
- package/dist/querying/search.mjs.map +1 -0
- package/dist/querying/security.d.mts +123 -0
- package/dist/querying/security.mjs +2 -0
- package/dist/querying/security.mjs.map +1 -0
- package/dist/querying/shared/ast.d.mts +26 -0
- package/dist/querying/shared/ast.mjs +2 -0
- package/dist/querying/shared/ast.mjs.map +1 -0
- package/dist/querying/shared/contract.d.mts +98 -0
- package/dist/querying/shared/contract.mjs +2 -0
- package/dist/querying/shared/contract.mjs.map +1 -0
- package/dist/querying/shared/evaluate.d.mts +5 -0
- package/dist/querying/shared/evaluate.mjs +2 -0
- package/dist/querying/shared/evaluate.mjs.map +1 -0
- package/dist/querying/shared/filters.d.mts +65 -0
- package/dist/querying/shared/filters.mjs +2 -0
- package/dist/querying/shared/filters.mjs.map +1 -0
- package/dist/querying/shared/native-json.d.mts +7 -0
- package/dist/querying/shared/native-json.mjs +2 -0
- package/dist/querying/shared/native-json.mjs.map +1 -0
- package/dist/querying/shared/page.d.mts +20 -0
- package/dist/querying/shared/page.mjs +2 -0
- package/dist/querying/shared/page.mjs.map +1 -0
- package/dist/querying.d.mts +82 -0
- package/dist/querying.mjs +2 -0
- package/dist/querying.mjs.map +1 -0
- package/dist/react/failures.d.mts +24 -0
- package/dist/react/failures.mjs +2 -0
- package/dist/react/failures.mjs.map +1 -0
- package/dist/react/optimistic.d.mts +46 -0
- package/dist/react/optimistic.mjs +2 -0
- package/dist/react/optimistic.mjs.map +1 -0
- package/dist/react/pagination-state.d.mts +39 -0
- package/dist/react/pagination-state.mjs +2 -0
- package/dist/react/pagination-state.mjs.map +1 -0
- package/dist/react/use-command.d.mts +22 -0
- package/dist/react/use-command.mjs +2 -0
- package/dist/react/use-command.mjs.map +1 -0
- package/dist/react/use-paginated-list.d.mts +34 -0
- package/dist/react/use-paginated-list.mjs +2 -0
- package/dist/react/use-paginated-list.mjs.map +1 -0
- package/dist/react.d.mts +6 -0
- package/dist/react.mjs +1 -0
- package/dist/registration.d.mts +65 -0
- package/dist/registration.mjs +2 -0
- package/dist/registration.mjs.map +1 -0
- package/dist/relations-public.d.mts +2 -0
- package/dist/relations-public.mjs +1 -0
- package/dist/relations.d.mts +274 -0
- package/dist/relations.mjs +2 -0
- package/dist/relations.mjs.map +1 -0
- package/dist/state-machine.d.mts +1 -4
- package/dist/state-machine.mjs.map +1 -1
- package/dist/table.d.mts +222 -0
- package/dist/table.mjs +2 -0
- package/dist/table.mjs.map +1 -0
- package/dist/tenancy.d.mts +6 -8
- package/dist/tenancy.mjs +1 -1
- package/dist/tenancy.mjs.map +1 -1
- package/dist/triggers.d.mts +12 -10
- package/dist/triggers.mjs +1 -1
- package/dist/triggers.mjs.map +1 -1
- package/dist/webhooks.d.mts +22 -112
- package/dist/webhooks.mjs +1 -1
- package/dist/webhooks.mjs.map +1 -1
- package/dist/workflow.d.mts +2 -0
- package/dist/workflow.mjs +1 -0
- package/dist/zod.d.mts +30 -0
- package/dist/zod.mjs +2 -0
- package/dist/zod.mjs.map +1 -0
- package/package.json +145 -33
- package/src/test.ts +9 -17
- package/CHANGELOG.md +0 -145
- package/ROADMAP.md +0 -126
- package/dist/zod-table.d.mts +0 -175
- package/dist/zod-table.mjs +0 -2
- package/dist/zod-table.mjs.map +0 -1
- package/docs/agent-tools.md +0 -41
- package/docs/approvals.md +0 -200
- package/docs/architecture.md +0 -124
- package/docs/auth.md +0 -218
- package/docs/commands.md +0 -278
- package/docs/conventions.md +0 -291
- package/docs/crud.md +0 -62
- package/docs/llms.md +0 -220
- package/docs/maintainability.md +0 -124
- package/docs/migration.md +0 -351
- package/docs/plans/2026-08-14-001-feat-v0.1.0-feature-set-plan.md +0 -461
- package/docs/plans/2026-08-21-0930-feat-resolve-organization-hook-plan.md +0 -178
- package/docs/tenancy.md +0 -179
- package/docs/triggers.md +0 -75
- package/docs/upgrading.md +0 -175
- package/docs/webhooks.md +0 -58
- package/docs/zod-table.md +0 -173
- package/scripts/convex-config-bridge.mjs +0 -55
- package/scripts/extract-changelog.mjs +0 -29
- package/scripts/smoke-packed-components.mjs +0 -374
package/dist/agent-tools.d.mts
CHANGED
|
@@ -1,45 +1,58 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { KType } from "./k/types.mjs";
|
|
2
|
+
import { KObject } from "./k/object.mjs";
|
|
3
|
+
import "./k.mjs";
|
|
4
|
+
import { convexPaginationOptions } from "./querying/filters.mjs";
|
|
5
|
+
import { OperationExecutor, OperationPublicResult, OperationTool, OperationToolConverter, OperationToolDefinition, OperationToolJsonSchema, OperationToolOutcome, SelectedOperation, bindOperationExecutor, createOperationTools, operationToolDialect, selectOperation } from "./modules/contracts/exposure.mjs";
|
|
3
6
|
/**
|
|
4
|
-
* A framework-agnostic tool record:
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
7
|
+
* A framework-agnostic tool record: `args` is a `k` schema, which implements Standard Schema v1
|
|
8
|
+
* (`args['~standard']`) and parses with `args.parse`. For a JSON Schema of the input (ids are strings,
|
|
9
|
+
* `.describe()` texts carry through) call `toJsonSchema(record.args)` from `cvx-kit/json-schema`; for a
|
|
10
|
+
* framework that only takes Zod, `toZod(record.args)` from `cvx-kit/zod`. The kit imports no agent
|
|
11
|
+
* framework.
|
|
8
12
|
*/
|
|
9
|
-
type AgentToolRecord = {
|
|
13
|
+
export type AgentToolRecord<Result = unknown, Context = never, Input = never> = {
|
|
10
14
|
name: string;
|
|
11
15
|
description: string;
|
|
12
|
-
args:
|
|
13
|
-
handler: (ctx:
|
|
16
|
+
args: KType;
|
|
17
|
+
handler: (ctx: Context, input: Input) => Promise<Result>;
|
|
14
18
|
};
|
|
15
19
|
type ToolTable = {
|
|
16
|
-
tableName: string;
|
|
17
|
-
tools: {
|
|
18
|
-
insert:
|
|
19
|
-
update:
|
|
20
|
-
id:
|
|
20
|
+
readonly tableName: string;
|
|
21
|
+
readonly tools: {
|
|
22
|
+
readonly insert: KType;
|
|
23
|
+
readonly update: KType;
|
|
24
|
+
readonly id: KType;
|
|
21
25
|
};
|
|
22
26
|
};
|
|
23
|
-
|
|
24
|
-
type
|
|
27
|
+
/** The `list` tool input: Convex's pagination options under `paginationOpts`. */
|
|
28
|
+
export type AgentListArgs = KObject<{
|
|
29
|
+
readonly paginationOpts: ReturnType<typeof convexPaginationOptions>;
|
|
30
|
+
}>;
|
|
31
|
+
type ToolHandler<Result> = (ctx: never, input: never) => Promise<Result>;
|
|
32
|
+
export type AgentToolHandlers<Result = unknown> = {
|
|
25
33
|
/** Mutations: route through command executors — agents get audited commands. */
|
|
26
|
-
create?: ToolHandler
|
|
27
|
-
update?: ToolHandler
|
|
28
|
-
archive?: ToolHandler
|
|
34
|
+
create?: ToolHandler<Result>;
|
|
35
|
+
update?: ToolHandler<Result>;
|
|
36
|
+
archive?: ToolHandler<Result>;
|
|
29
37
|
/** Reads: caller-supplied query handlers (reads do not route through commands). */
|
|
30
|
-
get?: ToolHandler
|
|
31
|
-
list?: ToolHandler
|
|
38
|
+
get?: ToolHandler<Result>;
|
|
39
|
+
list?: ToolHandler<Result>;
|
|
32
40
|
};
|
|
33
41
|
/**
|
|
34
42
|
* Emits agent tool definitions from the existing table tool masks: args are
|
|
35
|
-
* the masks (
|
|
43
|
+
* the masks (`k` schemas; ids are strings in their JSON Schema),
|
|
36
44
|
* names are `<tableName>_<verb>`, and only the kinds you supply handlers for
|
|
37
45
|
* are emitted. Wire mutation handlers to createCrudCommands executors (or
|
|
38
46
|
* your own) so every agent action is an audited command.
|
|
39
47
|
*/
|
|
40
|
-
declare function createAgentTools(table:
|
|
48
|
+
export declare function createAgentTools<Table extends ToolTable, Handlers extends AgentToolHandlers>(table: Table, handlers: Handlers, options?: {
|
|
41
49
|
descriptions?: Partial<Record<keyof AgentToolHandlers, string>>;
|
|
42
|
-
}):
|
|
43
|
-
|
|
44
|
-
|
|
50
|
+
}): AgentTools<Table, Handlers>;
|
|
51
|
+
export type AgentTools<Table extends ToolTable, Handlers extends AgentToolHandlers> = Partial<{ [Verb in keyof Handlers & keyof AgentToolHandlers as `${Table['tableName']}_${Verb}`]: {
|
|
52
|
+
name: string;
|
|
53
|
+
description: string;
|
|
54
|
+
args: Verb extends 'create' ? Table['tools']['insert'] : Verb extends 'update' ? Table['tools']['update'] : Verb extends 'list' ? AgentListArgs : Table['tools']['id'];
|
|
55
|
+
handler: NonNullable<Handlers[Verb]>;
|
|
56
|
+
}; }>;
|
|
57
|
+
export { type OperationExecutor, type OperationPublicResult, type OperationTool, type OperationToolConverter, type OperationToolDefinition, type OperationToolJsonSchema, type OperationToolOutcome, type SelectedOperation, bindOperationExecutor, createOperationTools, operationToolDialect, selectOperation };
|
|
45
58
|
//# sourceMappingURL=agent-tools.d.mts.map
|
package/dist/agent-tools.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{k as e}from"./k/index.mjs";import{convexPaginationOptions as t}from"./querying/filters.mjs";import{bindOperationExecutor as n,createOperationTools as r,operationToolDialect as i,selectOperation as a}from"./modules/contracts/exposure.mjs";function o(e,t,n){let r=e.tableName,i={create:()=>e.tools.insert,update:()=>e.tools.update,archive:()=>e.tools.id,get:()=>e.tools.id,list:c},a={create:`Create a ${r} record`,update:`Update fields of an existing ${r} record`,archive:`Archive (soft-delete) a ${r} record`,get:`Fetch one ${r} record by id`,list:`List ${r} records, paginated`},o={};for(let e of[`create`,`update`,`archive`,`get`,`list`]){let s=t[e];s&&(o[`${r}_${e}`]={name:`${r}_${e}`,description:n?.descriptions?.[e]??a[e],args:i[e](),handler:s})}return o}let s;function c(){return s??=e.object({paginationOpts:t()})}export{n as bindOperationExecutor,o as createAgentTools,r as createOperationTools,i as operationToolDialect,a as selectOperation};
|
|
2
2
|
//# sourceMappingURL=agent-tools.mjs.map
|
package/dist/agent-tools.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-tools.mjs","names":[],"sources":["../src/agent-tools.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"agent-tools.mjs","names":["createAgentTools","name","table","masks","listArgsSchema","defaults","tools","verb","handler","handlers","options","listArgs","k","convexPaginationOptions","bindOperationExecutor","createOperationTools","operationToolDialect","selectOperation"],"sources":["../src/agent-tools.ts"],"sourcesContent":["import { k, type KObject, type KType } from './k'\nimport { convexPaginationOptions } from './querying/filters'\n\n/**\n * A framework-agnostic tool record: `args` is a `k` schema, which implements Standard Schema v1\n * (`args['~standard']`) and parses with `args.parse`. For a JSON Schema of the input (ids are strings,\n * `.describe()` texts carry through) call `toJsonSchema(record.args)` from `cvx-kit/json-schema`; for a\n * framework that only takes Zod, `toZod(record.args)` from `cvx-kit/zod`. The kit imports no agent\n * framework.\n */\nexport type AgentToolRecord<Result = unknown, Context = never, Input = never> = {\n\tname: string\n\tdescription: string\n\targs: KType\n\thandler: (ctx: Context, input: Input) => Promise<Result>\n}\n\ntype ToolTable = {\n\treadonly tableName: string\n\treadonly tools: {\n\t\treadonly insert: KType\n\t\treadonly update: KType\n\t\treadonly id: KType\n\t}\n}\n\n/** The `list` tool input: Convex's pagination options under `paginationOpts`. */\nexport type AgentListArgs = KObject<{\n\treadonly paginationOpts: ReturnType<typeof convexPaginationOptions>\n}>\n\ntype ToolHandler<Result> = (ctx: never, input: never) => Promise<Result>\n\nexport type AgentToolHandlers<Result = unknown> = {\n\t/** Mutations: route through command executors — agents get audited commands. */\n\tcreate?: ToolHandler<Result>\n\tupdate?: ToolHandler<Result>\n\tarchive?: ToolHandler<Result>\n\t/** Reads: caller-supplied query handlers (reads do not route through commands). */\n\tget?: ToolHandler<Result>\n\tlist?: ToolHandler<Result>\n}\n\n/**\n * Emits agent tool definitions from the existing table tool masks: args are\n * the masks (`k` schemas; ids are strings in their JSON Schema),\n * names are `<tableName>_<verb>`, and only the kinds you supply handlers for\n * are emitted. Wire mutation handlers to createCrudCommands executors (or\n * your own) so every agent action is an audited command.\n */\nexport function createAgentTools<Table extends ToolTable, Handlers extends AgentToolHandlers>(\n\ttable: Table,\n\thandlers: Handlers,\n\toptions?: { descriptions?: Partial<Record<keyof AgentToolHandlers, string>> },\n) {\n\tconst name = table.tableName\n\tconst masks: Record<keyof AgentToolHandlers, () => KType> = {\n\t\tcreate: () => table.tools.insert,\n\t\tupdate: () => table.tools.update,\n\t\tarchive: () => table.tools.id,\n\t\tget: () => table.tools.id,\n\t\tlist: listArgsSchema,\n\t}\n\tconst defaults: Record<keyof AgentToolHandlers, string> = {\n\t\tcreate: `Create a ${name} record`,\n\t\tupdate: `Update fields of an existing ${name} record`,\n\t\tarchive: `Archive (soft-delete) a ${name} record`,\n\t\tget: `Fetch one ${name} record by id`,\n\t\tlist: `List ${name} records, paginated`,\n\t}\n\tconst tools: Record<string, AgentToolRecord> = {}\n\tfor (const verb of ['create', 'update', 'archive', 'get', 'list'] as const) {\n\t\tconst handler = handlers[verb]\n\t\tif (!handler) continue\n\t\ttools[`${name}_${verb}`] = {\n\t\t\tname: `${name}_${verb}`,\n\t\t\tdescription: options?.descriptions?.[verb] ?? defaults[verb],\n\t\t\targs: masks[verb](),\n\t\t\thandler,\n\t\t}\n\t}\n\t// SAFETY: each emitted key combines this table name with a supplied verb; its handler and schema come from those same inputs.\n\treturn tools as AgentTools<Table, Handlers>\n}\n\nexport type AgentTools<Table extends ToolTable, Handlers extends AgentToolHandlers> = Partial<{\n\t[Verb in keyof Handlers & keyof AgentToolHandlers as `${Table['tableName']}_${Verb}`]: {\n\t\tname: string\n\t\tdescription: string\n\t\targs: Verb extends 'create'\n\t\t\t? Table['tools']['insert']\n\t\t\t: Verb extends 'update'\n\t\t\t\t? Table['tools']['update']\n\t\t\t\t: Verb extends 'list'\n\t\t\t\t\t? AgentListArgs\n\t\t\t\t\t: Table['tools']['id']\n\t\thandler: NonNullable<Handlers[Verb]>\n\t}\n}>\nexport {\n\tselectOperation,\n\tbindOperationExecutor,\n\tcreateOperationTools,\n\toperationToolDialect,\n\ttype SelectedOperation,\n\ttype OperationExecutor,\n\ttype OperationPublicResult,\n\ttype OperationToolJsonSchema,\n\ttype OperationToolConverter,\n\ttype OperationToolDefinition,\n\ttype OperationToolOutcome,\n\ttype OperationTool,\n} from './modules/contracts/exposure'\n\nlet listArgs: AgentListArgs | undefined\n\n/** Built on the first `list` tool, so importing this module builds nothing. */\nfunction listArgsSchema(): AgentListArgs {\n\treturn (listArgs ??= k.object({ paginationOpts: convexPaginationOptions() }))\n}\n"],"mappings":"A,qPAkDA,SAAgBA,EACf,EACA,EACA,EACC,CACD,IAAMC,EAAOC,EAAM,UACbC,EAAsD,CAC3D,WAAcD,EAAM,MAAM,OAC1B,WAAcA,EAAM,MAAM,OAC1B,YAAeA,EAAM,MAAM,GAC3B,QAAWA,EAAM,MAAM,GACvB,KAAME,CACP,EACMC,EAAoD,CACzD,OAAQ,YAAYJ,EAAK,SACzB,OAAQ,gCAAgCA,EAAK,SAC7C,QAAS,2BAA2BA,EAAK,SACzC,IAAK,aAAaA,EAAK,eACvB,KAAM,QAAQA,EAAK,oBACpB,EACMK,EAAyC,CAAC,EAChD,IAAK,IAAMC,IAAQ,CAAC,SAAU,SAAU,UAAW,MAAO,MAAM,EAAY,CAC3E,IAAMC,EAAUC,EAASF,GACpBC,IACL,EAAM,GAAGP,EAAK,GAAGM,KAAU,CAC1B,KAAM,GAAGN,EAAK,GAAGM,IACjB,YAAaG,GAAS,eAAeH,IAASF,EAASE,GACvD,KAAMJ,EAAMI,EAAK,CAAC,EAClB,SACD,EACD,CAEA,OAAOD,CACR,CA+BA,IAAIK,EAGJ,SAASP,GAAgC,CACxC,MAAQ,KAAaQ,EAAE,OAAO,CAAE,eAAgBC,EAAwB,CAAE,CAAC,CAC5E,C"}
|
package/dist/auth.d.mts
CHANGED
|
@@ -1,16 +1,18 @@
|
|
|
1
|
+
import { KCustomBuilder } from "./registration.mjs";
|
|
2
|
+
import { ArgumentFailurePolicy } from "./modules/contracts/errors.mjs";
|
|
1
3
|
import { ErrorFactory } from "./errors.mjs";
|
|
4
|
+
import { SecurityPolicyContext } from "./querying/security.mjs";
|
|
2
5
|
import { RLSConfig, Rules } from "./tenancy.mjs";
|
|
3
|
-
import { ActionBuilder, DocumentByInfo, GenericActionCtx, GenericDataModel, GenericMutationCtx, GenericQueryCtx, GenericTableInfo, IndexNames, IndexRange, IndexRangeBuilder, MutationBuilder, NamedIndex, PaginationOptions, PaginationResult, Query, QueryBuilder, QueryInitializer, TableNamesInDataModel, UserIdentity } from "convex/server";
|
|
6
|
+
import { ActionBuilder, DefaultFunctionArgs, DocumentByInfo, GenericActionCtx, GenericDataModel, GenericMutationCtx, GenericQueryCtx, GenericTableInfo, IndexNames, IndexRange, IndexRangeBuilder, MutationBuilder, NamedIndex, PaginationOptions, PaginationResult, Query, QueryBuilder, QueryInitializer, TableNamesInDataModel, UserIdentity } from "convex/server";
|
|
4
7
|
import { Triggers } from "convex-helpers/server/triggers";
|
|
5
|
-
//#region src/auth.d.ts
|
|
6
8
|
/** The default vocabulary; every app can supply its own via the Role generic. */
|
|
7
|
-
type DefaultRole = 'reader' | 'writer' | 'admin';
|
|
8
|
-
type Actor<Role extends string> = Readonly<{
|
|
9
|
+
export type DefaultRole = 'reader' | 'writer' | 'admin';
|
|
10
|
+
export type Actor<Role extends string> = Readonly<{
|
|
9
11
|
userId: string;
|
|
10
12
|
organizationId: string;
|
|
11
13
|
role: Role;
|
|
12
14
|
}>;
|
|
13
|
-
type AuthBundle<Role extends string> = Readonly<{
|
|
15
|
+
export type AuthBundle<Role extends string> = Readonly<{
|
|
14
16
|
identity: UserIdentity;
|
|
15
17
|
user: Readonly<{
|
|
16
18
|
id: string;
|
|
@@ -24,12 +26,27 @@ type AuthBundle<Role extends string> = Readonly<{
|
|
|
24
26
|
/** The resolved tenant — security.tenancy.resolve, or the organization id. */
|
|
25
27
|
tenant: string;
|
|
26
28
|
}>;
|
|
29
|
+
/**
|
|
30
|
+
* The bundle handed to security rules. Service principals (serviceQuery /
|
|
31
|
+
* serviceMutation) may carry extra host-supplied fields beside the standard
|
|
32
|
+
* bundle; rules read them as unknown and narrow as needed.
|
|
33
|
+
*/
|
|
34
|
+
export type SecurityBundle<Role extends string> = AuthBundle<Role> & ServiceExtras;
|
|
35
|
+
/** Extra fields a host factory attaches to a service principal. */
|
|
36
|
+
export type ServiceExtras = Readonly<Record<string, unknown>>;
|
|
37
|
+
/**
|
|
38
|
+
* A trusted host factory producing the principal a service function runs as.
|
|
39
|
+
* `args` are the raw (unparsed) arguments of the invocation, so the host can
|
|
40
|
+
* derive the scope (e.g. a client id) from them. Never accept the principal
|
|
41
|
+
* itself from the caller — only derive it.
|
|
42
|
+
*/
|
|
43
|
+
export type ServicePrincipal<Ctx, Role extends string, Extra extends Record<string, unknown>> = (ctx: Ctx, args: DefaultFunctionArgs) => (AuthBundle<Role> & Extra) | Promise<AuthBundle<Role> & Extra>;
|
|
27
44
|
/**
|
|
28
45
|
* Row-level security configuration. Tenant isolation and role-level rules
|
|
29
46
|
* compose (AND) onto the same wrapped database: queries get a wrapped
|
|
30
47
|
* reader, mutations get triggers first, then a wrapped writer.
|
|
31
48
|
*/
|
|
32
|
-
type SecurityConfig<DataModel extends GenericDataModel, Role extends string> = {
|
|
49
|
+
export type SecurityConfig<DataModel extends GenericDataModel, Role extends string> = {
|
|
33
50
|
/**
|
|
34
51
|
* Tenant isolation. `tables` is THE registry: every listed table gets
|
|
35
52
|
* read/insert/modify gated on row.tenant === ctx.tenant. Pair with
|
|
@@ -45,7 +62,7 @@ type SecurityConfig<DataModel extends GenericDataModel, Role extends string> = {
|
|
|
45
62
|
* composed AND-wise with tenant isolation. E.g. gate `modify` on a table
|
|
46
63
|
* to admin roles.
|
|
47
64
|
*/
|
|
48
|
-
rules?: (bundle:
|
|
65
|
+
rules?: (bundle: SecurityBundle<Role>) => Rules<SecurityPolicyContext<DataModel>, DataModel>;
|
|
49
66
|
/**
|
|
50
67
|
* Policy for tables with no rule. Defaults to 'deny' when tenancy is
|
|
51
68
|
* configured (unlisted tables are unreachable — fail closed), 'allow'
|
|
@@ -54,16 +71,23 @@ type SecurityConfig<DataModel extends GenericDataModel, Role extends string> = {
|
|
|
54
71
|
defaultPolicy?: RLSConfig['defaultPolicy'];
|
|
55
72
|
};
|
|
56
73
|
type AnyAuthContext<DataModel extends GenericDataModel> = GenericQueryCtx<DataModel> | GenericMutationCtx<DataModel> | GenericActionCtx<DataModel>;
|
|
57
|
-
|
|
74
|
+
/**
|
|
75
|
+
* Configuration for createAuthReaders: everything createAuthFunctions takes
|
|
76
|
+
* except the mutation builders and trigger wrapping, so a module built from
|
|
77
|
+
* it never has to import the trigger registry.
|
|
78
|
+
*/
|
|
79
|
+
export type AuthReadersConfig<DataModel extends GenericDataModel, Role extends string> = {
|
|
58
80
|
/** The consumer's generated function builders (from ./_generated/server). */
|
|
59
81
|
query: QueryBuilder<DataModel, 'public'>;
|
|
60
|
-
mutation: MutationBuilder<DataModel, 'public'>;
|
|
61
82
|
action: ActionBuilder<DataModel, 'public'>;
|
|
62
83
|
internalQuery: QueryBuilder<DataModel, 'internal'>;
|
|
63
|
-
internalMutation: MutationBuilder<DataModel, 'internal'>;
|
|
64
84
|
internalAction: ActionBuilder<DataModel, 'internal'>;
|
|
65
|
-
/**
|
|
66
|
-
|
|
85
|
+
/**
|
|
86
|
+
* Resolves the synchronized principal, e.g. (ctx) => authKit.getAuthUser(ctx).
|
|
87
|
+
* The already-resolved, non-null identity is supplied as a second argument.
|
|
88
|
+
* Callbacks may ignore it; using it can avoid a redundant identity lookup.
|
|
89
|
+
*/
|
|
90
|
+
getAuthUser: (ctx: AnyAuthContext<DataModel>, identity: UserIdentity) => Promise<{
|
|
67
91
|
id: string;
|
|
68
92
|
} | null>;
|
|
69
93
|
/**
|
|
@@ -103,6 +127,26 @@ type AuthFunctionsConfig<DataModel extends GenericDataModel, Role extends string
|
|
|
103
127
|
} | null>;
|
|
104
128
|
/** Host error policy; defaults to throwing KitError. */
|
|
105
129
|
errors?: ErrorFactory;
|
|
130
|
+
/** Upper bound for include() reads. */
|
|
131
|
+
maxIncludedQueryRows?: number;
|
|
132
|
+
/**
|
|
133
|
+
* How argument validation failures are thrown by every constructor. `'validation'`
|
|
134
|
+
* (default) throws `KValidationError` (`ConvexError({ code: 'VALIDATION', issues })`);
|
|
135
|
+
* `'declared'` throws `argumentErrors` `INVALID_ARGUMENTS`; a function returns the value to throw.
|
|
136
|
+
*/
|
|
137
|
+
argumentFailure?: ArgumentFailurePolicy;
|
|
138
|
+
/**
|
|
139
|
+
* Row-level security: tenant isolation (from a table registry) and
|
|
140
|
+
* role-level rules, applied structurally inside every auth*, role*,
|
|
141
|
+
* admin*, and service* constructor. system* constructors stay unwrapped
|
|
142
|
+
* (trusted).
|
|
143
|
+
*/
|
|
144
|
+
security?: SecurityConfig<DataModel, Role>;
|
|
145
|
+
};
|
|
146
|
+
/** A reader config plus the mutation builders and trigger wrapping. */
|
|
147
|
+
export type AuthFunctionsConfig<DataModel extends GenericDataModel, Role extends string> = AuthReadersConfig<DataModel, Role> & {
|
|
148
|
+
mutation: MutationBuilder<DataModel, 'public'>;
|
|
149
|
+
internalMutation: MutationBuilder<DataModel, 'internal'>;
|
|
106
150
|
/**
|
|
107
151
|
* Application trigger registry. When set, every authMutation,
|
|
108
152
|
* roleMutation, and systemMutation write runs through triggers.wrapDB —
|
|
@@ -111,35 +155,74 @@ type AuthFunctionsConfig<DataModel extends GenericDataModel, Role extends string
|
|
|
111
155
|
triggers?: Triggers<DataModel>;
|
|
112
156
|
/** Lower-level alternative to `triggers`: a custom ctx wrapper. */
|
|
113
157
|
wrapDB?: (ctx: GenericMutationCtx<DataModel>) => GenericMutationCtx<DataModel>;
|
|
114
|
-
/** Upper bound for include() reads. */
|
|
115
|
-
maxIncludedQueryRows?: number;
|
|
116
|
-
/**
|
|
117
|
-
* Row-level security: tenant isolation (from a table registry) and
|
|
118
|
-
* role-level rules, applied structurally inside every auth*, role*, and
|
|
119
|
-
* admin* constructor. system* constructors stay unwrapped (trusted).
|
|
120
|
-
*/
|
|
121
|
-
security?: SecurityConfig<DataModel, Role>;
|
|
122
158
|
};
|
|
123
159
|
/** WorkOS-style default: `member` writes; reader/writer/admin pass through. */
|
|
124
|
-
declare function defaultRoleMap(roleSlug?: string): DefaultRole | null;
|
|
125
|
-
type IncludedQuery<Table extends GenericTableInfo> = {
|
|
160
|
+
export declare function defaultRoleMap(roleSlug?: string): DefaultRole | null;
|
|
161
|
+
export type IncludedQuery<Table extends GenericTableInfo> = {
|
|
126
162
|
when<Value>(value: Value | null | undefined, select: (query: QueryInitializer<Table>, value: Value) => Query<Table>): IncludedQuery<Table>;
|
|
127
163
|
matching<IndexName extends IndexNames<Table>>(indexName: IndexName, indexRange?: (query: IndexRangeBuilder<DocumentByInfo<Table>, NamedIndex<Table, IndexName>>) => IndexRange, shouldMatch?: boolean): IncludedQuery<Table>;
|
|
128
164
|
otherwise(select: (query: QueryInitializer<Table>) => Query<Table>): Query<Table>;
|
|
129
165
|
resolve(): Query<Table>;
|
|
130
|
-
execute
|
|
166
|
+
execute(limit: number): Promise<DocumentByInfo<Table>[]>;
|
|
167
|
+
execute<Result>(limit: number, transform: (data: Awaited<ReturnType<Query<Table>['take']>>) => Result | Promise<Result>): Promise<Result>;
|
|
131
168
|
/**
|
|
132
169
|
* Cursor pagination over the selected indexed query. numItems is bounded
|
|
133
170
|
* by the same maxRows policy as execute(). Under row-level security a
|
|
134
171
|
* page may be shorter than numItems (rejected rows are filtered after
|
|
135
172
|
* pagination); cursors remain correct. Pair with paginated(dto) from
|
|
136
|
-
* cvx-kit/
|
|
173
|
+
* cvx-kit/table for the boundary schemas.
|
|
174
|
+
*/
|
|
175
|
+
paginate(opts: PaginationOptions): Promise<PaginationResult<DocumentByInfo<Table>>>;
|
|
176
|
+
paginate<Item>(opts: PaginationOptions, transform: (page: DocumentByInfo<Table>[]) => Item[] | Promise<Item[]>): Promise<PaginationResult<Item>>;
|
|
177
|
+
};
|
|
178
|
+
export type Include = <Table extends GenericTableInfo>(query: QueryInitializer<Table>) => IncludedQuery<Table>;
|
|
179
|
+
/**
|
|
180
|
+
* The auth-aware constructors, registered through `k` schemas and native validators
|
|
181
|
+
* (src/registration.ts). Keep native contexts symbolic in published declarations: inferred spreads
|
|
182
|
+
* copy build-time Convex methods and override the consumer's native context.
|
|
183
|
+
*/
|
|
184
|
+
export type AuthFunctions<DataModel extends GenericDataModel, Role extends string = DefaultRole> = {
|
|
185
|
+
include: Include;
|
|
186
|
+
authenticatedUser: (ctx: AnyAuthContext<DataModel>) => Promise<AuthBundle<Role>>;
|
|
187
|
+
authQuery: KCustomBuilder<'query', {}, GenericQueryCtx<DataModel> & AuthBundle<Role> & {
|
|
188
|
+
include: Include;
|
|
189
|
+
}, {}, GenericQueryCtx<DataModel>, 'public', object>;
|
|
190
|
+
authMutation: KCustomBuilder<'mutation', {}, GenericMutationCtx<DataModel> & AuthBundle<Role> & {
|
|
191
|
+
include: Include;
|
|
192
|
+
}, {}, GenericMutationCtx<DataModel>, 'public', object>;
|
|
193
|
+
authAction: KCustomBuilder<'action', {}, GenericActionCtx<DataModel> & AuthBundle<Role>, {}, GenericActionCtx<DataModel>, 'public', object>;
|
|
194
|
+
roleQuery: (...allowed: readonly Role[]) => AuthFunctions<DataModel, Role>['authQuery'];
|
|
195
|
+
roleMutation: (...allowed: readonly Role[]) => AuthFunctions<DataModel, Role>['authMutation'];
|
|
196
|
+
roleAction: (...allowed: readonly Role[]) => AuthFunctions<DataModel, Role>['authAction'];
|
|
197
|
+
adminQuery: AuthFunctions<DataModel, Role>['authQuery'];
|
|
198
|
+
adminMutation: AuthFunctions<DataModel, Role>['authMutation'];
|
|
199
|
+
adminAction: AuthFunctions<DataModel, Role>['authAction'];
|
|
200
|
+
/**
|
|
201
|
+
* Internal query running as a host-supplied service principal with the
|
|
202
|
+
* app's security rules fully applied. No identity lookup; the trusted
|
|
203
|
+
* host's factory is the only principal source.
|
|
137
204
|
*/
|
|
138
|
-
|
|
205
|
+
serviceQuery: <Extra extends Record<string, unknown> = {}>(principal: ServicePrincipal<GenericQueryCtx<DataModel>, Role, Extra>) => ServiceQuery<DataModel, Role, Extra>;
|
|
206
|
+
/** Internal mutation running as a service principal: triggers first, then the secured writer. */
|
|
207
|
+
serviceMutation: <Extra extends Record<string, unknown> = {}>(principal: ServicePrincipal<GenericMutationCtx<DataModel>, Role, Extra>) => ServiceMutation<DataModel, Role, Extra>;
|
|
208
|
+
systemQuery: KCustomBuilder<'query', {}, GenericQueryCtx<DataModel> & {
|
|
209
|
+
include: Include;
|
|
210
|
+
}, {}, GenericQueryCtx<DataModel>, 'internal', object>;
|
|
211
|
+
systemMutation: KCustomBuilder<'mutation', {}, GenericMutationCtx<DataModel> & {
|
|
212
|
+
include: Include;
|
|
213
|
+
}, {}, GenericMutationCtx<DataModel>, 'internal', object>;
|
|
214
|
+
systemAction: KCustomBuilder<'action', {}, GenericActionCtx<DataModel>, {}, GenericActionCtx<DataModel>, 'internal', object>;
|
|
139
215
|
};
|
|
140
|
-
|
|
216
|
+
/** The read-only constructors: everything AuthFunctions has except mutations. */
|
|
217
|
+
export type AuthReaders<DataModel extends GenericDataModel, Role extends string = DefaultRole> = Omit<AuthFunctions<DataModel, Role>, `${string}Mutation`>;
|
|
218
|
+
export type ServiceQuery<DataModel extends GenericDataModel, Role extends string, Extra extends Record<string, unknown> = {}> = KCustomBuilder<'query', {}, GenericQueryCtx<DataModel> & AuthBundle<Role> & Extra & {
|
|
219
|
+
include: Include;
|
|
220
|
+
}, {}, GenericQueryCtx<DataModel>, 'internal', object>;
|
|
221
|
+
export type ServiceMutation<DataModel extends GenericDataModel, Role extends string, Extra extends Record<string, unknown> = {}> = KCustomBuilder<'mutation', {}, GenericMutationCtx<DataModel> & AuthBundle<Role> & Extra & {
|
|
222
|
+
include: Include;
|
|
223
|
+
}, {}, GenericMutationCtx<DataModel>, 'internal', object>;
|
|
141
224
|
/** Builds an include() that selects the first matching indexed query and bounds the read. */
|
|
142
|
-
declare function createInclude(options?: {
|
|
225
|
+
export declare function createInclude(options?: {
|
|
143
226
|
errors?: ErrorFactory;
|
|
144
227
|
maxRows?: number;
|
|
145
228
|
}): Include;
|
|
@@ -151,285 +234,14 @@ declare function createInclude(options?: {
|
|
|
151
234
|
* has a role-gated variant (roleQuery/roleMutation/roleAction), and the
|
|
152
235
|
* admin* constructors are just that gate applied to config.adminRoles.
|
|
153
236
|
*/
|
|
154
|
-
declare function createAuthFunctions<DataModel extends GenericDataModel, const Role extends string = DefaultRole>(config: AuthFunctionsConfig<DataModel, Role>):
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
meta: import("convex/server").QueryMeta;
|
|
165
|
-
identity: UserIdentity;
|
|
166
|
-
user: Readonly<{
|
|
167
|
-
id: string;
|
|
168
|
-
}>;
|
|
169
|
-
org: Readonly<{
|
|
170
|
-
organizationId: string;
|
|
171
|
-
role: Role;
|
|
172
|
-
}>;
|
|
173
|
-
role: Role;
|
|
174
|
-
actor: Readonly<{
|
|
175
|
-
userId: string;
|
|
176
|
-
organizationId: string;
|
|
177
|
-
role: Role;
|
|
178
|
-
}>;
|
|
179
|
-
tenant: string;
|
|
180
|
-
include: Include;
|
|
181
|
-
}, {}, GenericQueryCtx<DataModel>, "public", object>;
|
|
182
|
-
roleMutation: (...allowed: readonly Role[]) => import("convex-helpers/server/zod4").CustomBuilder<"mutation", {}, {
|
|
183
|
-
db: import("convex/server").GenericDatabaseWriter<DataModel>;
|
|
184
|
-
auth: import("convex/server").Auth;
|
|
185
|
-
storage: import("convex/server").StorageWriter;
|
|
186
|
-
scheduler: import("convex/server").Scheduler;
|
|
187
|
-
runQuery: <Query extends import("convex/server").FunctionReference<"query", "public" | "internal">>(query: Query, ...args: import("convex/server").ArgsAndOptions<Query, import("convex/server").AdvancedRunQueryOptions>) => Promise<import("convex/server").FunctionReturnType<Query>>;
|
|
188
|
-
runMutation: <Mutation extends import("convex/server").FunctionReference<"mutation", "public" | "internal">>(mutation: Mutation, ...args: import("convex/server").ArgsAndOptions<Mutation, {
|
|
189
|
-
transactionLimits?: import("convex/server").TransactionLimits;
|
|
190
|
-
}>) => Promise<import("convex/server").FunctionReturnType<Mutation>>;
|
|
191
|
-
meta: import("convex/server").MutationMeta;
|
|
192
|
-
identity: UserIdentity;
|
|
193
|
-
user: Readonly<{
|
|
194
|
-
id: string;
|
|
195
|
-
}>;
|
|
196
|
-
org: Readonly<{
|
|
197
|
-
organizationId: string;
|
|
198
|
-
role: Role;
|
|
199
|
-
}>;
|
|
200
|
-
role: Role;
|
|
201
|
-
actor: Readonly<{
|
|
202
|
-
userId: string;
|
|
203
|
-
organizationId: string;
|
|
204
|
-
role: Role;
|
|
205
|
-
}>;
|
|
206
|
-
tenant: string;
|
|
207
|
-
include: Include;
|
|
208
|
-
}, {}, GenericMutationCtx<DataModel>, "public", object>;
|
|
209
|
-
roleAction: (...allowed: readonly Role[]) => import("convex-helpers/server/zod4").CustomBuilder<"action", {}, {
|
|
210
|
-
runQuery<Query extends import("convex/server").FunctionReference<"query", "public" | "internal">>(query: Query, ...args: import("convex/server").OptionalRestArgs<Query>): Promise<import("convex/server").FunctionReturnType<Query>>;
|
|
211
|
-
runMutation<Mutation extends import("convex/server").FunctionReference<"mutation", "public" | "internal">>(mutation: Mutation, ...args: import("convex/server").OptionalRestArgs<Mutation>): Promise<import("convex/server").FunctionReturnType<Mutation>>;
|
|
212
|
-
runAction<Action extends import("convex/server").FunctionReference<"action", "public" | "internal">>(action: Action, ...args: import("convex/server").OptionalRestArgs<Action>): Promise<import("convex/server").FunctionReturnType<Action>>;
|
|
213
|
-
scheduler: import("convex/server").Scheduler;
|
|
214
|
-
auth: import("convex/server").Auth;
|
|
215
|
-
storage: import("convex/server").StorageActionWriter;
|
|
216
|
-
vectorSearch<TableName extends TableNamesInDataModel<DataModel>, IndexName extends import("convex/server").VectorIndexNames<import("convex/server").NamedTableInfo<DataModel, TableName>>>(tableName: TableName, indexName: IndexName, query: {
|
|
217
|
-
vector: number[];
|
|
218
|
-
limit?: number;
|
|
219
|
-
filter?: ((q: import("convex/server").VectorFilterBuilder<DocumentByInfo<import("convex/server").NamedTableInfo<DataModel, TableName>>, import("convex/server").NamedVectorIndex<import("convex/server").NamedTableInfo<DataModel, TableName>, IndexName>>) => import("convex/server").FilterExpression<boolean>) | undefined;
|
|
220
|
-
}): Promise<{
|
|
221
|
-
_id: import("convex/values").GenericId<TableName>;
|
|
222
|
-
_score: number;
|
|
223
|
-
}[]>;
|
|
224
|
-
meta: import("convex/server").ActionMeta;
|
|
225
|
-
identity: UserIdentity;
|
|
226
|
-
user: Readonly<{
|
|
227
|
-
id: string;
|
|
228
|
-
}>;
|
|
229
|
-
org: Readonly<{
|
|
230
|
-
organizationId: string;
|
|
231
|
-
role: Role;
|
|
232
|
-
}>;
|
|
233
|
-
role: Role;
|
|
234
|
-
actor: Readonly<{
|
|
235
|
-
userId: string;
|
|
236
|
-
organizationId: string;
|
|
237
|
-
role: Role;
|
|
238
|
-
}>;
|
|
239
|
-
tenant: string;
|
|
240
|
-
}, {}, GenericActionCtx<DataModel>, "public", object>;
|
|
241
|
-
authQuery: import("convex-helpers/server/zod4").CustomBuilder<"query", {}, {
|
|
242
|
-
db: import("convex/server").GenericDatabaseReader<DataModel>;
|
|
243
|
-
auth: import("convex/server").Auth;
|
|
244
|
-
storage: import("convex/server").StorageReader;
|
|
245
|
-
runQuery: <Query extends import("convex/server").FunctionReference<"query", "public" | "internal">>(query: Query, ...args: import("convex/server").ArgsAndOptions<Query, {
|
|
246
|
-
transactionLimits?: import("convex/server").TransactionLimits;
|
|
247
|
-
}>) => Promise<import("convex/server").FunctionReturnType<Query>>;
|
|
248
|
-
meta: import("convex/server").QueryMeta;
|
|
249
|
-
identity: UserIdentity;
|
|
250
|
-
user: Readonly<{
|
|
251
|
-
id: string;
|
|
252
|
-
}>;
|
|
253
|
-
org: Readonly<{
|
|
254
|
-
organizationId: string;
|
|
255
|
-
role: Role;
|
|
256
|
-
}>;
|
|
257
|
-
role: Role;
|
|
258
|
-
actor: Readonly<{
|
|
259
|
-
userId: string;
|
|
260
|
-
organizationId: string;
|
|
261
|
-
role: Role;
|
|
262
|
-
}>;
|
|
263
|
-
tenant: string;
|
|
264
|
-
include: Include;
|
|
265
|
-
}, {}, GenericQueryCtx<DataModel>, "public", object>;
|
|
266
|
-
authMutation: import("convex-helpers/server/zod4").CustomBuilder<"mutation", {}, {
|
|
267
|
-
db: import("convex/server").GenericDatabaseWriter<DataModel>;
|
|
268
|
-
auth: import("convex/server").Auth;
|
|
269
|
-
storage: import("convex/server").StorageWriter;
|
|
270
|
-
scheduler: import("convex/server").Scheduler;
|
|
271
|
-
runQuery: <Query extends import("convex/server").FunctionReference<"query", "public" | "internal">>(query: Query, ...args: import("convex/server").ArgsAndOptions<Query, import("convex/server").AdvancedRunQueryOptions>) => Promise<import("convex/server").FunctionReturnType<Query>>;
|
|
272
|
-
runMutation: <Mutation extends import("convex/server").FunctionReference<"mutation", "public" | "internal">>(mutation: Mutation, ...args: import("convex/server").ArgsAndOptions<Mutation, {
|
|
273
|
-
transactionLimits?: import("convex/server").TransactionLimits;
|
|
274
|
-
}>) => Promise<import("convex/server").FunctionReturnType<Mutation>>;
|
|
275
|
-
meta: import("convex/server").MutationMeta;
|
|
276
|
-
identity: UserIdentity;
|
|
277
|
-
user: Readonly<{
|
|
278
|
-
id: string;
|
|
279
|
-
}>;
|
|
280
|
-
org: Readonly<{
|
|
281
|
-
organizationId: string;
|
|
282
|
-
role: Role;
|
|
283
|
-
}>;
|
|
284
|
-
role: Role;
|
|
285
|
-
actor: Readonly<{
|
|
286
|
-
userId: string;
|
|
287
|
-
organizationId: string;
|
|
288
|
-
role: Role;
|
|
289
|
-
}>;
|
|
290
|
-
tenant: string;
|
|
291
|
-
include: Include;
|
|
292
|
-
}, {}, GenericMutationCtx<DataModel>, "public", object>;
|
|
293
|
-
authAction: import("convex-helpers/server/zod4").CustomBuilder<"action", {}, {
|
|
294
|
-
runQuery<Query extends import("convex/server").FunctionReference<"query", "public" | "internal">>(query: Query, ...args: import("convex/server").OptionalRestArgs<Query>): Promise<import("convex/server").FunctionReturnType<Query>>;
|
|
295
|
-
runMutation<Mutation extends import("convex/server").FunctionReference<"mutation", "public" | "internal">>(mutation: Mutation, ...args: import("convex/server").OptionalRestArgs<Mutation>): Promise<import("convex/server").FunctionReturnType<Mutation>>;
|
|
296
|
-
runAction<Action extends import("convex/server").FunctionReference<"action", "public" | "internal">>(action: Action, ...args: import("convex/server").OptionalRestArgs<Action>): Promise<import("convex/server").FunctionReturnType<Action>>;
|
|
297
|
-
scheduler: import("convex/server").Scheduler;
|
|
298
|
-
auth: import("convex/server").Auth;
|
|
299
|
-
storage: import("convex/server").StorageActionWriter;
|
|
300
|
-
vectorSearch<TableName extends TableNamesInDataModel<DataModel>, IndexName extends import("convex/server").VectorIndexNames<import("convex/server").NamedTableInfo<DataModel, TableName>>>(tableName: TableName, indexName: IndexName, query: {
|
|
301
|
-
vector: number[];
|
|
302
|
-
limit?: number;
|
|
303
|
-
filter?: ((q: import("convex/server").VectorFilterBuilder<DocumentByInfo<import("convex/server").NamedTableInfo<DataModel, TableName>>, import("convex/server").NamedVectorIndex<import("convex/server").NamedTableInfo<DataModel, TableName>, IndexName>>) => import("convex/server").FilterExpression<boolean>) | undefined;
|
|
304
|
-
}): Promise<{
|
|
305
|
-
_id: import("convex/values").GenericId<TableName>;
|
|
306
|
-
_score: number;
|
|
307
|
-
}[]>;
|
|
308
|
-
meta: import("convex/server").ActionMeta;
|
|
309
|
-
identity: UserIdentity;
|
|
310
|
-
user: Readonly<{
|
|
311
|
-
id: string;
|
|
312
|
-
}>;
|
|
313
|
-
org: Readonly<{
|
|
314
|
-
organizationId: string;
|
|
315
|
-
role: Role;
|
|
316
|
-
}>;
|
|
317
|
-
role: Role;
|
|
318
|
-
actor: Readonly<{
|
|
319
|
-
userId: string;
|
|
320
|
-
organizationId: string;
|
|
321
|
-
role: Role;
|
|
322
|
-
}>;
|
|
323
|
-
tenant: string;
|
|
324
|
-
}, {}, GenericActionCtx<DataModel>, "public", object>;
|
|
325
|
-
adminQuery: import("convex-helpers/server/zod4").CustomBuilder<"query", {}, {
|
|
326
|
-
db: import("convex/server").GenericDatabaseReader<DataModel>;
|
|
327
|
-
auth: import("convex/server").Auth;
|
|
328
|
-
storage: import("convex/server").StorageReader;
|
|
329
|
-
runQuery: <Query extends import("convex/server").FunctionReference<"query", "public" | "internal">>(query: Query, ...args: import("convex/server").ArgsAndOptions<Query, {
|
|
330
|
-
transactionLimits?: import("convex/server").TransactionLimits;
|
|
331
|
-
}>) => Promise<import("convex/server").FunctionReturnType<Query>>;
|
|
332
|
-
meta: import("convex/server").QueryMeta;
|
|
333
|
-
identity: UserIdentity;
|
|
334
|
-
user: Readonly<{
|
|
335
|
-
id: string;
|
|
336
|
-
}>;
|
|
337
|
-
org: Readonly<{
|
|
338
|
-
organizationId: string;
|
|
339
|
-
role: Role;
|
|
340
|
-
}>;
|
|
341
|
-
role: Role;
|
|
342
|
-
actor: Readonly<{
|
|
343
|
-
userId: string;
|
|
344
|
-
organizationId: string;
|
|
345
|
-
role: Role;
|
|
346
|
-
}>;
|
|
347
|
-
tenant: string;
|
|
348
|
-
include: Include;
|
|
349
|
-
}, {}, GenericQueryCtx<DataModel>, "public", object>;
|
|
350
|
-
adminMutation: import("convex-helpers/server/zod4").CustomBuilder<"mutation", {}, {
|
|
351
|
-
db: import("convex/server").GenericDatabaseWriter<DataModel>;
|
|
352
|
-
auth: import("convex/server").Auth;
|
|
353
|
-
storage: import("convex/server").StorageWriter;
|
|
354
|
-
scheduler: import("convex/server").Scheduler;
|
|
355
|
-
runQuery: <Query extends import("convex/server").FunctionReference<"query", "public" | "internal">>(query: Query, ...args: import("convex/server").ArgsAndOptions<Query, import("convex/server").AdvancedRunQueryOptions>) => Promise<import("convex/server").FunctionReturnType<Query>>;
|
|
356
|
-
runMutation: <Mutation extends import("convex/server").FunctionReference<"mutation", "public" | "internal">>(mutation: Mutation, ...args: import("convex/server").ArgsAndOptions<Mutation, {
|
|
357
|
-
transactionLimits?: import("convex/server").TransactionLimits;
|
|
358
|
-
}>) => Promise<import("convex/server").FunctionReturnType<Mutation>>;
|
|
359
|
-
meta: import("convex/server").MutationMeta;
|
|
360
|
-
identity: UserIdentity;
|
|
361
|
-
user: Readonly<{
|
|
362
|
-
id: string;
|
|
363
|
-
}>;
|
|
364
|
-
org: Readonly<{
|
|
365
|
-
organizationId: string;
|
|
366
|
-
role: Role;
|
|
367
|
-
}>;
|
|
368
|
-
role: Role;
|
|
369
|
-
actor: Readonly<{
|
|
370
|
-
userId: string;
|
|
371
|
-
organizationId: string;
|
|
372
|
-
role: Role;
|
|
373
|
-
}>;
|
|
374
|
-
tenant: string;
|
|
375
|
-
include: Include;
|
|
376
|
-
}, {}, GenericMutationCtx<DataModel>, "public", object>;
|
|
377
|
-
adminAction: import("convex-helpers/server/zod4").CustomBuilder<"action", {}, {
|
|
378
|
-
runQuery<Query extends import("convex/server").FunctionReference<"query", "public" | "internal">>(query: Query, ...args: import("convex/server").OptionalRestArgs<Query>): Promise<import("convex/server").FunctionReturnType<Query>>;
|
|
379
|
-
runMutation<Mutation extends import("convex/server").FunctionReference<"mutation", "public" | "internal">>(mutation: Mutation, ...args: import("convex/server").OptionalRestArgs<Mutation>): Promise<import("convex/server").FunctionReturnType<Mutation>>;
|
|
380
|
-
runAction<Action extends import("convex/server").FunctionReference<"action", "public" | "internal">>(action: Action, ...args: import("convex/server").OptionalRestArgs<Action>): Promise<import("convex/server").FunctionReturnType<Action>>;
|
|
381
|
-
scheduler: import("convex/server").Scheduler;
|
|
382
|
-
auth: import("convex/server").Auth;
|
|
383
|
-
storage: import("convex/server").StorageActionWriter;
|
|
384
|
-
vectorSearch<TableName extends TableNamesInDataModel<DataModel>, IndexName extends import("convex/server").VectorIndexNames<import("convex/server").NamedTableInfo<DataModel, TableName>>>(tableName: TableName, indexName: IndexName, query: {
|
|
385
|
-
vector: number[];
|
|
386
|
-
limit?: number;
|
|
387
|
-
filter?: ((q: import("convex/server").VectorFilterBuilder<DocumentByInfo<import("convex/server").NamedTableInfo<DataModel, TableName>>, import("convex/server").NamedVectorIndex<import("convex/server").NamedTableInfo<DataModel, TableName>, IndexName>>) => import("convex/server").FilterExpression<boolean>) | undefined;
|
|
388
|
-
}): Promise<{
|
|
389
|
-
_id: import("convex/values").GenericId<TableName>;
|
|
390
|
-
_score: number;
|
|
391
|
-
}[]>;
|
|
392
|
-
meta: import("convex/server").ActionMeta;
|
|
393
|
-
identity: UserIdentity;
|
|
394
|
-
user: Readonly<{
|
|
395
|
-
id: string;
|
|
396
|
-
}>;
|
|
397
|
-
org: Readonly<{
|
|
398
|
-
organizationId: string;
|
|
399
|
-
role: Role;
|
|
400
|
-
}>;
|
|
401
|
-
role: Role;
|
|
402
|
-
actor: Readonly<{
|
|
403
|
-
userId: string;
|
|
404
|
-
organizationId: string;
|
|
405
|
-
role: Role;
|
|
406
|
-
}>;
|
|
407
|
-
tenant: string;
|
|
408
|
-
}, {}, GenericActionCtx<DataModel>, "public", object>;
|
|
409
|
-
systemQuery: import("convex-helpers/server/zod4").CustomBuilder<"query", {}, {
|
|
410
|
-
db: import("convex/server").GenericDatabaseReader<DataModel>;
|
|
411
|
-
auth: import("convex/server").Auth;
|
|
412
|
-
storage: import("convex/server").StorageReader;
|
|
413
|
-
runQuery: <Query extends import("convex/server").FunctionReference<"query", "public" | "internal">>(query: Query, ...args: import("convex/server").ArgsAndOptions<Query, {
|
|
414
|
-
transactionLimits?: import("convex/server").TransactionLimits;
|
|
415
|
-
}>) => Promise<import("convex/server").FunctionReturnType<Query>>;
|
|
416
|
-
meta: import("convex/server").QueryMeta;
|
|
417
|
-
include: Include;
|
|
418
|
-
}, {}, GenericQueryCtx<DataModel>, "internal", object>;
|
|
419
|
-
systemMutation: import("convex-helpers/server/zod4").CustomBuilder<"mutation", {}, {
|
|
420
|
-
db: import("convex/server").GenericDatabaseWriter<DataModel>;
|
|
421
|
-
auth: import("convex/server").Auth;
|
|
422
|
-
storage: import("convex/server").StorageWriter;
|
|
423
|
-
scheduler: import("convex/server").Scheduler;
|
|
424
|
-
runQuery: <Query extends import("convex/server").FunctionReference<"query", "public" | "internal">>(query: Query, ...args: import("convex/server").ArgsAndOptions<Query, import("convex/server").AdvancedRunQueryOptions>) => Promise<import("convex/server").FunctionReturnType<Query>>;
|
|
425
|
-
runMutation: <Mutation extends import("convex/server").FunctionReference<"mutation", "public" | "internal">>(mutation: Mutation, ...args: import("convex/server").ArgsAndOptions<Mutation, {
|
|
426
|
-
transactionLimits?: import("convex/server").TransactionLimits;
|
|
427
|
-
}>) => Promise<import("convex/server").FunctionReturnType<Mutation>>;
|
|
428
|
-
meta: import("convex/server").MutationMeta;
|
|
429
|
-
include: Include;
|
|
430
|
-
}, {}, GenericMutationCtx<DataModel>, "internal", object>;
|
|
431
|
-
systemAction: import("convex-helpers/server/zod4").CustomBuilder<"action", {}, GenericActionCtx<DataModel>, {}, GenericActionCtx<DataModel>, "internal", object>;
|
|
432
|
-
};
|
|
433
|
-
//#endregion
|
|
434
|
-
export { Actor, AuthBundle, AuthFunctionsConfig, DefaultRole, Include, IncludedQuery, SecurityConfig, createAuthFunctions, createInclude, defaultRoleMap };
|
|
237
|
+
export declare function createAuthFunctions<DataModel extends GenericDataModel, const Role extends string = DefaultRole>(config: AuthFunctionsConfig<DataModel, Role>): AuthFunctions<DataModel, Role>;
|
|
238
|
+
/**
|
|
239
|
+
* Builds the read-only constructors (queries and actions) from the same
|
|
240
|
+
* policy as createAuthFunctions, without mutation builders or triggers.
|
|
241
|
+
* Identity, tenancy, rules, role gates, membership checks and errors are the
|
|
242
|
+
* same implementation, so a module built from these never imports the
|
|
243
|
+
* trigger registry or the domains it pulls in.
|
|
244
|
+
*/
|
|
245
|
+
export declare function createAuthReaders<DataModel extends GenericDataModel, const Role extends string = DefaultRole>(config: AuthReadersConfig<DataModel, Role>): AuthReaders<DataModel, Role>;
|
|
246
|
+
export type { SecurityPolicyContext };
|
|
435
247
|
//# sourceMappingURL=auth.d.mts.map
|