@confect/server 9.0.0-next.8 → 9.0.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/CHANGELOG.md +182 -4
- package/dist/ActionCtx.d.ts +3 -10
- package/dist/ActionCtx.d.ts.map +1 -1
- package/dist/ActionRunner.d.ts +7 -14
- package/dist/ActionRunner.d.ts.map +1 -1
- package/dist/Auth.d.ts +15 -23
- package/dist/Auth.d.ts.map +1 -1
- package/dist/BlobNotFoundError.d.ts +5 -11
- package/dist/BlobNotFoundError.d.ts.map +1 -1
- package/dist/ConvexConfigProvider.d.ts +1 -8
- package/dist/ConvexConfigProvider.d.ts.map +1 -1
- package/dist/CronJob.d.ts +12 -19
- package/dist/CronJob.d.ts.map +1 -1
- package/dist/CronJobs.d.ts +11 -18
- package/dist/CronJobs.d.ts.map +1 -1
- package/dist/DataModel.d.ts +24 -29
- package/dist/DataModel.d.ts.map +1 -1
- package/dist/DatabaseReader.d.ts +4313 -4328
- package/dist/DatabaseReader.d.ts.map +1 -1
- package/dist/DatabaseSchema.d.ts +20 -25
- package/dist/DatabaseSchema.d.ts.map +1 -1
- package/dist/DatabaseSchema.js.map +1 -1
- package/dist/DatabaseWriter.d.ts +36 -42
- package/dist/DatabaseWriter.d.ts.map +1 -1
- package/dist/Document.d.ts +26 -36
- package/dist/Document.d.ts.map +1 -1
- package/dist/FunctionImpl.d.ts +11 -20
- package/dist/FunctionImpl.d.ts.map +1 -1
- package/dist/GroupImpl.d.ts +29 -35
- package/dist/GroupImpl.d.ts.map +1 -1
- package/dist/Handler.d.ts +34 -40
- package/dist/Handler.d.ts.map +1 -1
- package/dist/HttpApi.d.ts +19 -25
- package/dist/HttpApi.d.ts.map +1 -1
- package/dist/HttpApi.js +4 -4
- package/dist/HttpApi.js.map +1 -1
- package/dist/MutationCtx.d.ts +3 -10
- package/dist/MutationCtx.d.ts.map +1 -1
- package/dist/MutationRunner.d.ts +7 -14
- package/dist/MutationRunner.d.ts.map +1 -1
- package/dist/OrderedQuery.d.ts +15 -22
- package/dist/OrderedQuery.d.ts.map +1 -1
- package/dist/QueryCtx.d.ts +3 -10
- package/dist/QueryCtx.d.ts.map +1 -1
- package/dist/QueryInitializer.d.ts +32 -38
- package/dist/QueryInitializer.d.ts.map +1 -1
- package/dist/QueryRunner.d.ts +7 -14
- package/dist/QueryRunner.d.ts.map +1 -1
- package/dist/RegisteredConvexFunction.d.ts +1099 -1121
- package/dist/RegisteredConvexFunction.d.ts.map +1 -1
- package/dist/RegisteredConvexFunction.js +4 -4
- package/dist/RegisteredConvexFunction.js.map +1 -1
- package/dist/RegisteredFunction.d.ts +46 -64
- package/dist/RegisteredFunction.d.ts.map +1 -1
- package/dist/RegisteredFunction.js +4 -4
- package/dist/RegisteredFunction.js.map +1 -1
- package/dist/RegisteredFunctions.d.ts +20 -22
- package/dist/RegisteredFunctions.d.ts.map +1 -1
- package/dist/RegisteredNodeFunction.d.ts +4 -14
- package/dist/RegisteredNodeFunction.d.ts.map +1 -1
- package/dist/RegistryItem.d.ts +17 -27
- package/dist/RegistryItem.d.ts.map +1 -1
- package/dist/Scheduler.d.ts +14 -22
- package/dist/Scheduler.d.ts.map +1 -1
- package/dist/SchemaToValidator.d.ts +68 -64
- package/dist/SchemaToValidator.d.ts.map +1 -1
- package/dist/SchemaToValidator.js +2 -2
- package/dist/SchemaToValidator.js.map +1 -1
- package/dist/StorageActionWriter.d.ts +20 -28
- package/dist/StorageActionWriter.d.ts.map +1 -1
- package/dist/StorageReader.d.ts +13 -21
- package/dist/StorageReader.d.ts.map +1 -1
- package/dist/StorageWriter.d.ts +15 -23
- package/dist/StorageWriter.d.ts.map +1 -1
- package/dist/Table.d.ts +202 -203
- package/dist/Table.d.ts.map +1 -1
- package/dist/Table.js +2 -2
- package/dist/Table.js.map +1 -1
- package/dist/TableInfo.d.ts +35 -41
- package/dist/TableInfo.d.ts.map +1 -1
- package/dist/VectorSearch.d.ts +28 -35
- package/dist/VectorSearch.d.ts.map +1 -1
- package/dist/index.d.ts +35 -35
- package/dist/index.d.ts.map +1 -0
- package/dist/internal/utils.d.ts +10 -13
- package/dist/internal/utils.d.ts.map +1 -1
- package/dist/node.d.ts +2 -2
- package/dist/node.d.ts.map +1 -0
- package/dist/tsconfig.src.tsbuildinfo +1 -0
- package/package.json +4 -12
- package/src/DatabaseSchema.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,175 @@
|
|
|
1
1
|
# @confect/server
|
|
2
2
|
|
|
3
|
+
## 9.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- a905072: Rearchitect Confect so that cold-starting a Convex function only evaluates its own group's module graph, cutting cold-start execution time on large projects. The change touches how you author tables, specs, and impls, and removes the project-wide aggregation that used to make every function evaluate every other function's code—and every table's schema—the first time it ran.
|
|
8
|
+
|
|
9
|
+
Convex bundles a deployment into a single artifact, but a function's cold start only _evaluates_ the module graph reachable from its own entry point. Previously, all impls were assembled into a single root `confect/impl.ts` that every generated `convex/` module imported, so cold-starting any one query, mutation, or action transitively evaluated the impl of every other function in the project, plus every function spec and every table schema, at module-load time. Cold-start execution time scaled with the size of the whole project. In v9, `confect codegen` emits one registry per group and each generated `convex/` module imports only its own group—so a function's cold-start work scales with its own group, not the project.
|
|
10
|
+
|
|
11
|
+
### Filesystem-driven groups
|
|
12
|
+
|
|
13
|
+
Your API is now authored as colocated `*.spec.ts`/`*.impl.ts` pairs, one pair per group, and **the file's path within `confect/` is the group's name** (its stem for top-level groups, the dot-joined directory path for nested groups). `GroupSpec.make()` and `GroupSpec.makeNode()` no longer take a name argument.
|
|
14
|
+
|
|
15
|
+
- Each `*.spec.ts` `export default`s its `GroupSpec` (named co-exports like error classes are still allowed).
|
|
16
|
+
- Each `*.impl.ts` default-imports its sibling spec, passes it to `FunctionImpl.make` / `GroupImpl.make`, and ends the layer pipeline with `GroupImpl.finalize`—a compile-time completeness check that only typechecks once every function the spec declares has a `FunctionImpl` provided.
|
|
17
|
+
- The root `confect/spec.ts`, `confect/impl.ts`, `confect/nodeSpec.ts`, and `confect/nodeImpl.ts` files are gone, along with `Impl.make` and `Impl.finalize`. `confect codegen` deletes any of these (and the stale aggregate `_generated/registeredFunctions.ts` / `_generated/nodeRegisteredFunctions.ts`) on upgrade.
|
|
18
|
+
|
|
19
|
+
### Tables are the source of truth, named by their filename
|
|
20
|
+
|
|
21
|
+
Your schema now lives entirely in `confect/tables/`, one `Table` per file, and **the filename is the table name**—`confect/tables/notes.ts` defines the `notes` table. `Table.make` no longer takes a name argument. The user-authored `confect/schema.ts` is removed; codegen scans `confect/tables/*.ts` and generates everything else.
|
|
22
|
+
|
|
23
|
+
Each table file is a default-export-only module, and its field schema is wrapped in a `() =>` callback so it is built lazily—a function only pays a table's schema-construction cost at cold start for tables it actually reads.
|
|
24
|
+
|
|
25
|
+
```ts confect/tables/notes.ts
|
|
26
|
+
import { Table } from "@confect/server";
|
|
27
|
+
import { Schema } from "effect";
|
|
28
|
+
import { Id } from "../_generated/id";
|
|
29
|
+
|
|
30
|
+
export default Table.make(() =>
|
|
31
|
+
Schema.Struct({
|
|
32
|
+
userId: Schema.optional(Id("users")),
|
|
33
|
+
text: Schema.String,
|
|
34
|
+
})
|
|
35
|
+
);
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Codegen emits, alongside it:
|
|
39
|
+
|
|
40
|
+
- `_generated/schema.ts`—the runtime `DatabaseSchema`. Never imports `convex/server`, so a runtime cold start no longer evaluates `defineSchema(...)`.
|
|
41
|
+
- `_generated/convexSchema.ts`—the Convex deploy `SchemaDefinition`, re-exported from `convex/schema.ts`.
|
|
42
|
+
- `_generated/id.ts`—a type-safe `Id` constructor whose argument is constrained to your table names. Use `Id("notes")` everywhere you previously wrote `GenericId.GenericId("notes")`; cross-table `_id` typos are now caught at compile time.
|
|
43
|
+
- `_generated/tables/<name>.ts`—a thin wrapper that binds the filename to the table. Read a table's `Doc`, `Fields`, and `tableName` from this wrapper (`import notes from "../_generated/tables/notes"`), not from `confect/tables/`.
|
|
44
|
+
|
|
45
|
+
A bound table's `name` property is renamed to `tableName` (avoiding a collision with `Function.prototype.name`).
|
|
46
|
+
|
|
47
|
+
### Specs and impls: lazy schemas, and impls take the `DatabaseSchema`
|
|
48
|
+
|
|
49
|
+
`FunctionSpec.*` constructors now take `args`, `returns`, and the optional `error` as `() => Schema` thunks, so importing a spec builds no schemas until a function is invoked. `FunctionImpl.make` and `GroupImpl.make` take the runtime `DatabaseSchema` (the default export of `_generated/schema`) as their first argument instead of the whole `Api`—which keeps the project-wide spec graph out of a function's cold-start module graph. The `Api` module (`Api.make`, the `Api` type) and the generated `_generated/api.ts` / `_generated/nodeApi.ts` files are removed.
|
|
50
|
+
|
|
51
|
+
**Before:**
|
|
52
|
+
|
|
53
|
+
```ts confect/notes.spec.ts
|
|
54
|
+
export const notes = GroupSpec.make("notes").addFunction(
|
|
55
|
+
FunctionSpec.publicQuery({
|
|
56
|
+
name: "list",
|
|
57
|
+
args: Schema.Struct({}),
|
|
58
|
+
returns: Schema.Array(Notes.Doc),
|
|
59
|
+
})
|
|
60
|
+
);
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
```ts confect/notes.impl.ts
|
|
64
|
+
const list = FunctionImpl.make(api, "notes", "list", handler);
|
|
65
|
+
export const notes = GroupImpl.make(api, "notes").pipe(Layer.provide(list));
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
**After:**
|
|
69
|
+
|
|
70
|
+
```ts confect/notes.spec.ts
|
|
71
|
+
import notes from "./_generated/tables/notes";
|
|
72
|
+
|
|
73
|
+
export default GroupSpec.make().addFunction(
|
|
74
|
+
FunctionSpec.publicQuery({
|
|
75
|
+
name: "list",
|
|
76
|
+
args: () => Schema.Struct({}),
|
|
77
|
+
returns: () => Schema.Array(notes.Doc),
|
|
78
|
+
})
|
|
79
|
+
);
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
```ts confect/notes.impl.ts
|
|
83
|
+
import databaseSchema from "./_generated/schema";
|
|
84
|
+
import notes from "./notes.spec";
|
|
85
|
+
|
|
86
|
+
const list = FunctionImpl.make(databaseSchema, notes, "list", handler);
|
|
87
|
+
export default GroupImpl.make(databaseSchema, notes).pipe(
|
|
88
|
+
Layer.provide(list),
|
|
89
|
+
GroupImpl.finalize
|
|
90
|
+
);
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### Node functions are first-class
|
|
94
|
+
|
|
95
|
+
A group's runtime is now declared solely by its spec—`GroupSpec.makeNode()` for a Node action group, `GroupSpec.make()` otherwise—mirroring vanilla Convex's per-file `"use node"` directive. The separate `node` namespace is gone: Node specs/impls are ordinary colocated pairs that can live anywhere in `confect/`, and codegen emits the `"use node"` directive based on the spec.
|
|
96
|
+
|
|
97
|
+
- A Node group at `confect/email.spec.ts` is now reached at `refs.public.email.send` instead of `refs.public.node.email.send`.
|
|
98
|
+
- `@confect/core` removes `Spec.makeNode`, `Spec.merge`, and `Spec.isConvexSpec` / `Spec.isNodeSpec`; `Spec.make()` is a single mixed-runtime container and `Refs.make(spec)` takes one argument. `GroupSpec.makeNode()`, `FunctionSpec.publicNodeAction()` / `internalNodeAction()` are unchanged.
|
|
99
|
+
|
|
100
|
+
### Less work at cold start
|
|
101
|
+
|
|
102
|
+
Confect's own packages now import Effect from its submodule paths (`import * as Schema from "effect/Schema"`) instead of the `"effect"` barrel. A barrel import of a namespace re-export pulls the entire namespace into the module graph a function evaluates at cold start, even when only a small part is used; importing the submodule path evaluates only what's needed. On a minimal function this cut cold-start module-evaluation time by ~35%. This is an internal change with no effect on your code—but to get the full win, import Effect from its submodule paths in your own `confect/` files too, since a single barrel import anywhere in a function's module graph re-pins the whole namespace.
|
|
103
|
+
|
|
104
|
+
### Stable React hook results
|
|
105
|
+
|
|
106
|
+
`@confect/react` hooks now hold stable identities across renders, matching Convex's own hooks. `useQuery` memoizes the decoded `QueryResult` by the (referentially stable) Convex result, so unchanged data keeps the same `QueryResult` instead of a fresh one each render—fixing effect/memo loops (including `Maximum update depth exceeded`) for code that derives off the result. `useMutation` and `useAction` return a stable `useCallback`, and `Ref.getFunctionReference` caches the Convex function reference per function name.
|
|
107
|
+
|
|
108
|
+
### Codegen robustness
|
|
109
|
+
|
|
110
|
+
The codegen bundler now uses [`bundle-require`](https://github.com/egoist/bundle-require), so impls may import third-party packages and use `tsconfig.json` `paths` aliases (`~/*`, `@/*`, …) for their own source. A parent `confect/{path}.spec.ts` may now declare functions alongside a sibling `confect/{path}/` subdirectory of further specs, and codegen reports a clear error on a name collision between the two.
|
|
111
|
+
|
|
112
|
+
### Migration
|
|
113
|
+
|
|
114
|
+
1. **Tables.** Delete `confect/schema.ts`. Rename each table file to a valid JS identifier (e.g. `confect/tables/notes.ts`); the basename becomes the table name. Drop the name argument from `Table.make`, wrap the field struct in `() =>`, and replace `GenericId.GenericId("x")` with `Id("x")` from `_generated/id`. If you read `table.name` off a bound table, rename it to `table.tableName`.
|
|
115
|
+
2. **Specs.** Split each group into a colocated `*.spec.ts` that `export default`s `GroupSpec.make()` (no name). Wrap every `args`/`returns`/`error` in `() =>`. Import a table's `Doc`/`Fields` from its wrapper, `import notes from "./_generated/tables/notes"`.
|
|
116
|
+
3. **Impls.** In each `*.impl.ts`, default-import the sibling spec, import `databaseSchema` from `_generated/schema`, pass it to `FunctionImpl.make` / `GroupImpl.make` in place of `api`, end the pipeline with `GroupImpl.finalize`, and `export default` it. Delete the root `confect/spec.ts`, `impl.ts`, `nodeSpec.ts`, and `nodeImpl.ts` (codegen will also remove them).
|
|
117
|
+
4. **Node groups.** Move any `confect/node/<path>` files anywhere you like under `confect/`; the `node/` directory no longer has special meaning. Drop the `node` segment from call sites (`refs.public.node.<group>` → `refs.public.<group>`) and replace `Refs.make(spec, nodeSpec)` with `Refs.make(spec)`.
|
|
118
|
+
5. **Tests.** If you use `@confect/test`, import `confectSchema` from `_generated/schema`, import the generated `convexSchema` from `_generated/convexSchema`, and pass `convexSchema` as the new second argument to `TestConfect.layer`.
|
|
119
|
+
6. **Optional.** Adopt submodule Effect imports (`import * as Schema from "effect/Schema"`) in your own `confect/` files for the full cold-start savings.
|
|
120
|
+
7. Run `confect codegen`. It re-emits the entire `convex/` tree and `confect/_generated/`, deleting any stale files from earlier versions.
|
|
121
|
+
|
|
122
|
+
### Patch Changes
|
|
123
|
+
|
|
124
|
+
- 9eec71c: Generate the published `.d.ts` declarations with the TypeScript compiler instead of tsdown's declaration bundler. tsdown now emits JavaScript only (`dts: false`); each package has a composite `tsconfig.src.json`, and `tsc -b` emits the declarations into `dist/` as part of the build. (`@confect/cli` is the exception: it ships only a binary, so it emits no declarations at all.)
|
|
125
|
+
|
|
126
|
+
The emitted types are equivalent to before—same exported surface, same inferred shapes—so no consumer-facing type changes. One incidental improvement comes with the switch: declaration maps (`.d.ts.map`) now ship alongside the types (with `src/` included in the published files, so "go to definition" lands on the original source).
|
|
127
|
+
|
|
128
|
+
- Updated dependencies [9eec71c]
|
|
129
|
+
- Updated dependencies [a905072]
|
|
130
|
+
- @confect/core@9.0.0
|
|
131
|
+
|
|
132
|
+
## 9.0.0-next.10
|
|
133
|
+
|
|
134
|
+
### Patch Changes
|
|
135
|
+
|
|
136
|
+
- 9eec71c: Generate the published `.d.ts` declarations with the TypeScript compiler instead of tsdown's declaration bundler. tsdown now emits JavaScript only (`dts: false`); each package has a composite `tsconfig.src.json`, and `tsc -b` emits the declarations into `dist/` as part of the build. (`@confect/cli` is the exception: it ships only a binary, so it emits no declarations at all.)
|
|
137
|
+
|
|
138
|
+
The emitted types are equivalent to before—same exported surface, same inferred shapes—so no consumer-facing type changes. One incidental improvement comes with the switch: declaration maps (`.d.ts.map`) now ship alongside the types (with `src/` included in the published files, so "go to definition" lands on the original source).
|
|
139
|
+
|
|
140
|
+
- Updated dependencies [9eec71c]
|
|
141
|
+
- @confect/core@9.0.0-next.10
|
|
142
|
+
|
|
143
|
+
## 9.0.0-next.9
|
|
144
|
+
|
|
145
|
+
### Major Changes
|
|
146
|
+
|
|
147
|
+
- 4894959: Make Node-runtime functions first-class and remove the separate `node` namespace.
|
|
148
|
+
|
|
149
|
+
A function group's runtime is now declared solely by its spec — `GroupSpec.makeNode()` for a Node action group, `GroupSpec.make()` for a Convex group — exactly like vanilla Convex's per-file `"use node"` directive. The `confect/node/` directory is no longer special: Node specs/impls are ordinary colocated `.spec.ts`/`.impl.ts` pairs that can live anywhere in `confect/`, and codegen emits the `"use node"` directive into the generated `convex/` module based on the spec. This is safe because v9's per-group registries already isolate each Convex function's bundle from every other group's impl, so Node-only code can no longer leak into a Convex-runtime bundle regardless of namespace.
|
|
150
|
+
|
|
151
|
+
### Why
|
|
152
|
+
|
|
153
|
+
The `node` namespace existed only because the pre-v9 architecture aggregated every function's impl into one module that all generated `convex/` modules imported; Node functions had to be quarantined into a separate spec/impl/registry tree so Convex-runtime functions wouldn't transitively import Node-only code. v9's per-group isolation removed that constraint, so the namespace was no longer load-bearing — only ergonomic overhead that diverged from vanilla Convex (which identifies Node modules per-file, with no directory requirement).
|
|
154
|
+
|
|
155
|
+
### Breaking changes
|
|
156
|
+
|
|
157
|
+
- **API namespace removed.** A Node group at `confect/email.spec.ts` is now referenced as `refs.public.email.send` instead of `refs.public.node.email.send`. Node groups are ordinary groups in the refs tree, nesting preserved like any other group.
|
|
158
|
+
- **Generated layout changed.** Node modules are emitted at `convex/<path>.ts` (carrying `"use node"`) instead of `convex/node/<path>.ts`, and their registries at `confect/_generated/registeredFunctions/<path>.ts`. The single assembled `confect/_generated/spec.ts` now contains every group regardless of runtime; `confect/_generated/nodeSpec.ts` is no longer generated (codegen deletes any stale copy on upgrade).
|
|
159
|
+
- **`@confect/core` API.** Removed `Spec.makeNode`, `Spec.merge`, and `Spec.isConvexSpec`/`Spec.isNodeSpec`. `Spec` is now a single mixed-runtime container (`Spec.make()` accepts groups of any runtime). `Refs.make(spec)` takes a single argument (the unified spec) instead of `(convexSpec, nodeSpec)`. `GroupSpec.makeNode()`/`makeNodeAt()` and `FunctionSpec.publicNodeAction()`/`internalNodeAction()` are unchanged; `GroupSpec` subgroups may now be of any runtime (a group is just a namespace for its children).
|
|
160
|
+
|
|
161
|
+
### Migration
|
|
162
|
+
|
|
163
|
+
1. Move any `confect/node/<path>.spec.ts`/`.impl.ts` files to wherever you want them under `confect/` (e.g. `confect/<path>.spec.ts`); the `node/` directory has no special meaning anymore. Their specs already use `GroupSpec.makeNode()`, so no spec-body change is needed — only fix the impl's relative import of `_generated/schema` if its depth changed.
|
|
164
|
+
2. Update call sites to drop the `node` segment: `refs.public.node.<group>.<fn>` → `refs.public.<group>.<fn>`.
|
|
165
|
+
3. Replace `Refs.make(spec, nodeSpec)` with `Refs.make(spec)` (codegen does this for `_generated/refs.ts` automatically).
|
|
166
|
+
4. Run `confect codegen`. The `convex/` tree and `confect/_generated/` are re-emitted; the stale `_generated/nodeSpec.ts` is removed.
|
|
167
|
+
|
|
168
|
+
### Patch Changes
|
|
169
|
+
|
|
170
|
+
- Updated dependencies [4894959]
|
|
171
|
+
- @confect/core@9.0.0-next.9
|
|
172
|
+
|
|
3
173
|
## 9.0.0-next.8
|
|
4
174
|
|
|
5
175
|
### Patch Changes
|
|
@@ -99,6 +269,7 @@
|
|
|
99
269
|
Previously, `confect/schema.ts` was user-authored and `DatabaseSchema` carried a `convexSchemaDefinition` field that was eagerly rebuilt on every `.addTable(...)`. That field was an `O(n²)` allocation for `n` tables, and it forced both the deploy CLI (which only needs `defineSchema(...)`) and the runtime (which only needs the table codec lookup) through the same module — so any runtime function bundle dragged in `convex/server`'s `defineSchema`. Issue 1.
|
|
100
270
|
|
|
101
271
|
Codegen now scans `confect/tables/*.ts` (every file must default-export a `Table`) and emits two siblings:
|
|
272
|
+
|
|
102
273
|
- `confect/_generated/schema.ts` — the runtime `DatabaseSchema`, consumed by `_generated/api.ts`. Imports `@confect/server` but never `convex/server`.
|
|
103
274
|
- `confect/_generated/convexSchema.ts` — the Convex deploy `SchemaDefinition`, re-exported one-line from `convex/schema.ts`. Imports `convex/server` but never `@confect/server`.
|
|
104
275
|
|
|
@@ -111,6 +282,7 @@
|
|
|
111
282
|
This eliminates a class of subtle infelicities: the file basename and the table name can never drift out of sync, cross-table `_id` references are type-constrained against the actual set of declared tables (catching typos at compile time), and ESM cycle hazards for mutual cross-table `Id` references are gone because authoring files no longer transitively import each other.
|
|
112
283
|
|
|
113
284
|
Codegen now emits two new sets of files alongside `_generated/schema.ts` and `_generated/convexSchema.ts`:
|
|
285
|
+
|
|
114
286
|
- `confect/_generated/id.ts` — a single `Id` constructor whose argument is type-constrained to the union of your table names. Use `Id("notes")` everywhere you previously wrote `GenericId.GenericId("notes")`.
|
|
115
287
|
- `confect/_generated/tables/<name>.ts` — one thin wrapper per table that binds the unnamed value from `confect/tables/<name>.ts` to its filename. This is what other modules (specs, impls, HTTP handlers) default-import to reach a table's `Doc`, `Fields`, and `tableName`.
|
|
116
288
|
|
|
@@ -127,6 +299,7 @@
|
|
|
127
299
|
The bound `Table` now exposes `Fields` / `Doc` / `tableDefinition` as lazy getters that compute their value on first access, then replace themselves with a plain non-writable data property so second-and-subsequent accesses are observably indistinguishable from a plain property (and skip all function-call overhead). The result: a function bundle only pays the schema-construction cost for tables it actually touches via `db.table(name)` (which reaches `Fields` through `Document.decode`). The `UnnamedTable` callable no longer exposes `Fields` or `tableDefinition` — read these off the bound `Table` (the generated `_generated/tables/<name>.ts` wrapper already binds the name).
|
|
128
300
|
|
|
129
301
|
### Migration
|
|
302
|
+
|
|
130
303
|
1. Delete your `confect/schema.ts`. Codegen will refuse to run while a stray copy is present.
|
|
131
304
|
2. Rename each `confect/tables/<Name>.ts` to a valid JS identifier in your chosen casing convention (e.g. `confect/tables/notes.ts`). The basename becomes the table name; you no longer pass it as an argument.
|
|
132
305
|
3. Convert each table file to a **default-export-only** unnamed module: drop the name argument from `Table.make`, wrap the field-schema struct in a `() => ...` callback, and switch any `GenericId.GenericId("users")` references to `Id("users")` imported from `../_generated/id`:
|
|
@@ -216,6 +389,7 @@
|
|
|
216
389
|
Since `9.0.0-next.1`, codegen has wrapped every parent leaf that has sibling subdirectory specs in `<parent>.addGroupAt("child", <child>)`. Because `GroupSpec.addGroupAt` is immutable, that produced a fresh object in the assembled tree, while the parent's `*.impl.ts` continued to hold a reference to the original imported leaf. The runtime resolver compared by `===`, so every such impl failed `validateImpl` with "Could not resolve group path for the provided GroupSpec." Child impls happened to work only because `GroupSpec.withName` was secretly mutating its argument in place to keep the child's identity stable — an asymmetry that was load-bearing for one half of the API and broken for the other.
|
|
217
390
|
|
|
218
391
|
### What changed
|
|
392
|
+
|
|
219
393
|
- `@confect/core/Spec` carries a new `readonly paths: ReadonlyMap<GroupSpec.AnyWithProps, string>` field and exposes a chainable `Spec#addPath(group, path)` builder. `add` / `addAt` / `merge` propagate `paths` unchanged; `merge` re-prefixes a node spec's entries with `"node."` to match the merged tree.
|
|
220
394
|
- `@confect/core/GroupSpec.withName` is now pure: it returns a fresh copy when the name differs and no longer rewrites the input in place. No new identity-tracking machinery is introduced.
|
|
221
395
|
- `@confect/server/FunctionImpl.make` and `GroupImpl.make` resolve their group path via `api.spec.paths.get(group)` — an O(1) map lookup instead of a tree walk — and throw a clearer error pointing at `Spec.addPath` when the spec hasn't been registered.
|
|
@@ -223,6 +397,7 @@
|
|
|
223
397
|
- `@confect/cli` codegen emits one `.addPath(<binding>, "<dot.path>")` call per leaf in `_generated/spec.ts` (and `_generated/nodeSpec.ts`) so the imported leaves carry their full paths into the assembled spec value.
|
|
224
398
|
|
|
225
399
|
### User-facing impact
|
|
400
|
+
|
|
226
401
|
- Spec authoring (`*.spec.ts`) and impl authoring (`*.impl.ts`) APIs are unchanged. `FunctionImpl.make(api, spec, name, handler)` and `GroupImpl.make(api, spec)` keep their exact signatures.
|
|
227
402
|
- Generated `_generated/spec.ts` (and `_generated/nodeSpec.ts`) pick up one `.addPath(...)` chain entry per leaf on the next `confect codegen` run. The shape is fully immutable — no module-load mutation, no hidden side effects.
|
|
228
403
|
- Hand-rolled tests that construct a `Spec` and pass it to `Api.make` must now also call `.addPath(spec, "dot.path")` for any group they intend to look up.
|
|
@@ -261,6 +436,7 @@
|
|
|
261
436
|
Splitting impl across colocated `*.impl.ts` files is the vehicle for fixing that. With this change, `confect codegen` emits one `_generated/registeredFunctions/{path}.ts` per group, and each generated `convex/` module imports only its own group's per-group registry — which in turn imports only its own sibling `.impl.ts`. A Convex function's cold-start bundle now scales with its own group's impl rather than with the size of the whole project.
|
|
262
437
|
|
|
263
438
|
### Breaking changes
|
|
439
|
+
|
|
264
440
|
- `GroupSpec.make()` and `GroupSpec.makeNode()` no longer take a name argument; the group name is derived from the spec file's path within `confect/`.
|
|
265
441
|
- `FunctionImpl.make(api, groupSpec, fn, handler)` and `GroupImpl.make(api, groupSpec)` now take the imported sibling spec object as their second argument instead of a dot-path string.
|
|
266
442
|
- Every `GroupImpl` pipeline must end with `GroupImpl.finalize`, which only typechecks once every function declared by the spec has a corresponding `FunctionImpl` provided to the group layer. `GroupImpl.finalize` snapshots the names of every registered function onto the produced `Finalized` `GroupImpl` service value, and `confect codegen` reads those names to verify per-function coverage against the spec at runtime.
|
|
@@ -269,6 +445,7 @@
|
|
|
269
445
|
- Every module under `convex/` is re-emitted to import from `_generated/registeredFunctions/{path}` instead of the previous aggregate file. Users who commit `convex/` to source control should expect a full rewrite of that directory on first codegen.
|
|
270
446
|
|
|
271
447
|
### Migration
|
|
448
|
+
|
|
272
449
|
1. For each existing group, create a colocated `confect/{path}.spec.ts` and `confect/{path}.impl.ts` pair (under a subdirectory for nested groups).
|
|
273
450
|
- In each spec, call `GroupSpec.make()` (or `GroupSpec.makeNode()`) without a name and `export default` the result.
|
|
274
451
|
- In each impl, default-import the sibling spec (e.g. `import notes from "./notes.spec"`), pass it to `FunctionImpl.make`/`GroupImpl.make` in place of the previous dot-path string, append `GroupImpl.finalize` to the pipeline, and `export default` the resulting `GroupImpl` layer:
|
|
@@ -276,7 +453,7 @@
|
|
|
276
453
|
export default GroupImpl.make(api, notes).pipe(
|
|
277
454
|
Layer.provide(list),
|
|
278
455
|
Layer.provide(insert),
|
|
279
|
-
GroupImpl.finalize
|
|
456
|
+
GroupImpl.finalize
|
|
280
457
|
);
|
|
281
458
|
```
|
|
282
459
|
2. Delete root `confect/spec.ts`, `confect/impl.ts`, `confect/nodeSpec.ts`, `confect/nodeImpl.ts`, and any parent aggregator spec/impl files. (`confect codegen` will also delete any of these it finds, plus the stale `_generated/registeredFunctions.ts` and `_generated/nodeRegisteredFunctions.ts`, so this step can be skipped.)
|
|
@@ -334,7 +511,7 @@
|
|
|
334
511
|
|
|
335
512
|
export class NoteNotFound extends Schema.TaggedError<NoteNotFound>()(
|
|
336
513
|
"NoteNotFound",
|
|
337
|
-
{ noteId: GenericId.GenericId("notes") }
|
|
514
|
+
{ noteId: GenericId.GenericId("notes") }
|
|
338
515
|
) {}
|
|
339
516
|
|
|
340
517
|
export const notes = GroupSpec.make("notes").addFunction(
|
|
@@ -343,7 +520,7 @@
|
|
|
343
520
|
args: Schema.Struct({ noteId: GenericId.GenericId("notes") }),
|
|
344
521
|
returns: Notes.Doc,
|
|
345
522
|
error: NoteNotFound,
|
|
346
|
-
})
|
|
523
|
+
})
|
|
347
524
|
);
|
|
348
525
|
```
|
|
349
526
|
|
|
@@ -363,7 +540,7 @@
|
|
|
363
540
|
.table("notes")
|
|
364
541
|
.get(noteId)
|
|
365
542
|
.pipe(Effect.mapError(() => new NoteNotFound({ noteId })));
|
|
366
|
-
})
|
|
543
|
+
})
|
|
367
544
|
);
|
|
368
545
|
```
|
|
369
546
|
|
|
@@ -435,6 +612,7 @@
|
|
|
435
612
|
Unspecified failures continue to reject the promise.
|
|
436
613
|
|
|
437
614
|
### Migration
|
|
615
|
+
|
|
438
616
|
- For each `useQuery` call site, replace `result === undefined` checks and direct property access with `QueryResult.match` (or the lower-level `QueryResult.isLoading`/`isSuccess`/`isFailure` predicates).
|
|
439
617
|
- For each `useMutation`/`useAction` call site whose ref now declares an `error` schema, unwrap the resolved `Either` (e.g. with `Either.match`); call sites against refs without an `error` schema need no change.
|
|
440
618
|
|
package/dist/ActionCtx.d.ts
CHANGED
|
@@ -1,12 +1,5 @@
|
|
|
1
|
+
import type { GenericActionCtx, GenericDataModel } from "convex/server";
|
|
1
2
|
import * as Context from "effect/Context";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
//#region src/ActionCtx.d.ts
|
|
5
|
-
declare namespace ActionCtx_d_exports {
|
|
6
|
-
export { ActionCtx };
|
|
7
|
-
}
|
|
8
|
-
declare const ActionCtx: <DataModel extends GenericDataModel>() => Context.Tag<GenericActionCtx<DataModel>, GenericActionCtx<DataModel>>;
|
|
9
|
-
type ActionCtx<DataModel extends GenericDataModel> = ReturnType<typeof ActionCtx<DataModel>>["Identifier"];
|
|
10
|
-
//#endregion
|
|
11
|
-
export { ActionCtx, ActionCtx_d_exports };
|
|
3
|
+
export declare const ActionCtx: <DataModel extends GenericDataModel>() => Context.Tag<GenericActionCtx<DataModel>, GenericActionCtx<DataModel>>;
|
|
4
|
+
export type ActionCtx<DataModel extends GenericDataModel> = ReturnType<typeof ActionCtx<DataModel>>["Identifier"];
|
|
12
5
|
//# sourceMappingURL=ActionCtx.d.ts.map
|
package/dist/ActionCtx.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionCtx.d.ts","
|
|
1
|
+
{"version":3,"file":"ActionCtx.d.ts","sourceRoot":"","sources":["../src/ActionCtx.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACxE,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAE1C,eAAO,MAAM,SAAS,GAAI,SAAS,SAAS,gBAAgB,4EACkB,CAAC;AAE/E,MAAM,MAAM,SAAS,CAAC,SAAS,SAAS,gBAAgB,IAAI,UAAU,CACpE,OAAO,SAAS,CAAC,SAAS,CAAC,CAC5B,CAAC,YAAY,CAAC,CAAC"}
|
package/dist/ActionRunner.d.ts
CHANGED
|
@@ -1,16 +1,9 @@
|
|
|
1
|
-
import * as Context from "effect/Context";
|
|
2
1
|
import * as Ref from "@confect/core/Ref";
|
|
3
|
-
import { GenericActionCtx } from "convex/server";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
11
|
-
declare const ActionRunner: Context.Tag<(<Action extends Ref.AnyAction>(action: Action, ...args: Ref.OptionalArgs<Action>) => Effect.Effect<Ref.Returns<Action>, Ref.Error<Action> | ParseResult.ParseError>), <Action extends Ref.AnyAction>(action: Action, ...args: Ref.OptionalArgs<Action>) => Effect.Effect<Ref.Returns<Action>, Ref.Error<Action> | ParseResult.ParseError>>;
|
|
12
|
-
type ActionRunner = typeof ActionRunner.Identifier;
|
|
13
|
-
declare const layer: (runAction: GenericActionCtx<any>["runAction"]) => Layer$1.Layer<(<Action extends Ref.AnyAction>(action: Action, ...args: Ref.OptionalArgs<Action>) => Effect.Effect<Ref.Returns<Action>, Ref.Error<Action> | ParseResult.ParseError>), never, never>;
|
|
14
|
-
//#endregion
|
|
15
|
-
export { ActionRunner, ActionRunner_d_exports, layer };
|
|
2
|
+
import { type GenericActionCtx } from "convex/server";
|
|
3
|
+
import type { ParseResult, Effect } from "effect";
|
|
4
|
+
import * as Context from "effect/Context";
|
|
5
|
+
import * as Layer from "effect/Layer";
|
|
6
|
+
export declare const ActionRunner: Context.Tag<(<Action extends Ref.AnyAction>(action: Action, ...args: Ref.OptionalArgs<Action>) => Effect.Effect<Ref.Returns<Action>, Ref.Error<Action> | ParseResult.ParseError>), <Action extends Ref.AnyAction>(action: Action, ...args: Ref.OptionalArgs<Action>) => Effect.Effect<Ref.Returns<Action>, Ref.Error<Action> | ParseResult.ParseError>>;
|
|
7
|
+
export type ActionRunner = typeof ActionRunner.Identifier;
|
|
8
|
+
export declare const layer: (runAction: GenericActionCtx<any>["runAction"]) => Layer.Layer<(<Action extends Ref.AnyAction>(action: Action, ...args: Ref.OptionalArgs<Action>) => Effect.Effect<Ref.Returns<Action>, Ref.Error<Action> | ParseResult.ParseError>), never, never>;
|
|
16
9
|
//# sourceMappingURL=ActionRunner.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionRunner.d.ts","
|
|
1
|
+
{"version":3,"file":"ActionRunner.d.ts","sourceRoot":"","sources":["../src/ActionRunner.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAClD,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAkBtC,eAAO,MAAM,YAAY,gBAdtB,MAAM,SAAS,GAAG,CAAC,SAAS,UACnB,MAAM,WACL,GAAG,CAAC,YAAY,CAAC,MAAM,CAAC,KAChC,MAAM,CAAC,MAAM,CACd,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,EACnB,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,WAAW,CAAC,UAAU,CAC3C,IANA,MAAM,SAAS,GAAG,CAAC,SAAS,UACnB,MAAM,WACL,GAAG,CAAC,YAAY,CAAC,MAAM,CAAC,KAChC,MAAM,CAAC,MAAM,CACd,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,EACnB,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,WAAW,CAAC,UAAU,CAC3C,CAUF,CAAC;AACF,MAAM,MAAM,YAAY,GAAG,OAAO,YAAY,CAAC,UAAU,CAAC;AAE1D,eAAO,MAAM,KAAK,GAAI,WAAW,gBAAgB,CAAC,GAAG,CAAC,CAAC,WAAW,CAAC,mBAnBhE,MAAM,SAAS,GAAG,CAAC,SAAS,UACnB,MAAM,WACL,GAAG,CAAC,YAAY,CAAC,MAAM,CAAC,KAChC,MAAM,CAAC,MAAM,CACd,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,EACnB,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,WAAW,CAAC,UAAU,CAC3C,gBAc2C,CAAC"}
|
package/dist/Auth.d.ts
CHANGED
|
@@ -1,32 +1,24 @@
|
|
|
1
|
-
import
|
|
2
|
-
import * as convex_server0 from "convex/server";
|
|
3
|
-
import { Auth as Auth$1 } from "convex/server";
|
|
4
|
-
import * as Layer from "effect/Layer";
|
|
1
|
+
import type { Auth as ConvexAuth } from "convex/server";
|
|
5
2
|
import * as Effect from "effect/Effect";
|
|
3
|
+
import * as Layer from "effect/Layer";
|
|
6
4
|
import * as Schema from "effect/Schema";
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
//#region src/Auth.d.ts
|
|
10
|
-
declare namespace Auth_d_exports {
|
|
11
|
-
export { Auth, NoUserIdentityFoundError, layer };
|
|
12
|
-
}
|
|
13
|
-
declare const Auth_base: effect_Context0.TagClass<Auth, "@confect/server/Auth", {
|
|
14
|
-
getUserIdentity: Effect.Effect<convex_server0.UserIdentity, NoUserIdentityFoundError, never>;
|
|
5
|
+
declare const Auth_base: import("effect/Context").TagClass<Auth, "@confect/server/Auth", {
|
|
6
|
+
getUserIdentity: Effect.Effect<import("convex/server").UserIdentity, NoUserIdentityFoundError, never>;
|
|
15
7
|
}> & Effect.Tag.Proxy<Auth, {
|
|
16
|
-
|
|
8
|
+
getUserIdentity: Effect.Effect<import("convex/server").UserIdentity, NoUserIdentityFoundError, never>;
|
|
17
9
|
}> & {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
10
|
+
use: <X>(body: (_: {
|
|
11
|
+
getUserIdentity: Effect.Effect<import("convex/server").UserIdentity, NoUserIdentityFoundError, never>;
|
|
12
|
+
}) => X) => [X] extends [Effect.Effect<infer A, infer E, infer R>] ? Effect.Effect<A, E, Auth | R> : [X] extends [PromiseLike<infer A_1>] ? Effect.Effect<A_1, import("effect/Cause").UnknownException, Auth> : Effect.Effect<X, never, Auth>;
|
|
21
13
|
};
|
|
22
|
-
declare class Auth extends Auth_base {
|
|
23
|
-
|
|
14
|
+
export declare class Auth extends Auth_base {
|
|
15
|
+
}
|
|
16
|
+
export declare const layer: (auth: ConvexAuth) => Layer.Layer<Auth, never, never>;
|
|
24
17
|
declare const NoUserIdentityFoundError_base: Schema.TaggedErrorClass<NoUserIdentityFoundError, "NoUserIdentityFoundError", {
|
|
25
|
-
|
|
18
|
+
readonly _tag: Schema.tag<"NoUserIdentityFoundError">;
|
|
26
19
|
}>;
|
|
27
|
-
declare class NoUserIdentityFoundError extends NoUserIdentityFoundError_base {
|
|
28
|
-
|
|
20
|
+
export declare class NoUserIdentityFoundError extends NoUserIdentityFoundError_base {
|
|
21
|
+
get message(): string;
|
|
29
22
|
}
|
|
30
|
-
|
|
31
|
-
export { Auth, Auth_d_exports, NoUserIdentityFoundError, layer };
|
|
23
|
+
export {};
|
|
32
24
|
//# sourceMappingURL=Auth.d.ts.map
|
package/dist/Auth.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Auth.d.ts","
|
|
1
|
+
{"version":3,"file":"Auth.d.ts","sourceRoot":"","sources":["../src/Auth.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,IAAI,UAAU,EAAE,MAAM,eAAe,CAAC;AAExD,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAEtC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;;;;;;;;;;AAgBxC,qBAAa,IAAK,SAAQ,SAGvB;CAAG;AAEN,eAAO,MAAM,KAAK,GAAI,MAAM,UAAU,oCAAoC,CAAC;;;;AAE3E,qBAAa,wBAAyB,SAAQ,6BAG7C;IACC,IAAa,OAAO,IAAI,MAAM,CAE7B;CACF"}
|
|
@@ -1,17 +1,11 @@
|
|
|
1
1
|
import * as Schema from "effect/Schema";
|
|
2
|
-
|
|
3
|
-
//#region src/BlobNotFoundError.d.ts
|
|
4
|
-
declare namespace BlobNotFoundError_d_exports {
|
|
5
|
-
export { BlobNotFoundError };
|
|
6
|
-
}
|
|
7
2
|
declare const BlobNotFoundError_base: Schema.TaggedErrorClass<BlobNotFoundError, "BlobNotFoundError", {
|
|
8
|
-
|
|
3
|
+
readonly _tag: Schema.tag<"BlobNotFoundError">;
|
|
9
4
|
} & {
|
|
10
|
-
|
|
5
|
+
id: typeof Schema.String;
|
|
11
6
|
}>;
|
|
12
|
-
declare class BlobNotFoundError extends BlobNotFoundError_base {
|
|
13
|
-
|
|
7
|
+
export declare class BlobNotFoundError extends BlobNotFoundError_base {
|
|
8
|
+
get message(): string;
|
|
14
9
|
}
|
|
15
|
-
|
|
16
|
-
export { BlobNotFoundError, BlobNotFoundError_d_exports };
|
|
10
|
+
export {};
|
|
17
11
|
//# sourceMappingURL=BlobNotFoundError.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BlobNotFoundError.d.ts","
|
|
1
|
+
{"version":3,"file":"BlobNotFoundError.d.ts","sourceRoot":"","sources":["../src/BlobNotFoundError.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;;;;;;AAExC,qBAAa,iBAAkB,SAAQ,sBAKtC;IACC,IAAa,OAAO,IAAI,MAAM,CAE7B;CACF"}
|
|
@@ -1,10 +1,3 @@
|
|
|
1
1
|
import * as ConfigProvider from "effect/ConfigProvider";
|
|
2
|
-
|
|
3
|
-
//#region src/ConvexConfigProvider.d.ts
|
|
4
|
-
declare namespace ConvexConfigProvider_d_exports {
|
|
5
|
-
export { make };
|
|
6
|
-
}
|
|
7
|
-
declare const make: (options?: Partial<ConfigProvider.ConfigProvider.FromEnvConfig>) => ConfigProvider.ConfigProvider;
|
|
8
|
-
//#endregion
|
|
9
|
-
export { ConvexConfigProvider_d_exports, make };
|
|
2
|
+
export declare const make: (options?: Partial<ConfigProvider.ConfigProvider.FromEnvConfig>) => ConfigProvider.ConfigProvider;
|
|
10
3
|
//# sourceMappingURL=ConvexConfigProvider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConvexConfigProvider.d.ts","
|
|
1
|
+
{"version":3,"file":"ConvexConfigProvider.d.ts","sourceRoot":"","sources":["../src/ConvexConfigProvider.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,cAAc,MAAM,uBAAuB,CAAC;AAMxD,eAAO,MAAM,IAAI,GACf,UAAU,OAAO,CAAC,cAAc,CAAC,cAAc,CAAC,aAAa,CAAC,KAC7D,cAAc,CAAC,cA4CjB,CAAC"}
|
package/dist/CronJob.d.ts
CHANGED
|
@@ -1,21 +1,14 @@
|
|
|
1
|
-
import { Ref } from "@confect/core";
|
|
2
|
-
import { Cron, Duration } from "effect";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import type { Ref } from "@confect/core";
|
|
2
|
+
import type { Cron, Duration } from "effect";
|
|
3
|
+
export declare const TypeId = "@confect/server/CronJob";
|
|
4
|
+
export type TypeId = typeof TypeId;
|
|
5
|
+
export interface CronJob {
|
|
6
|
+
readonly [TypeId]: TypeId;
|
|
7
|
+
readonly identifier: string;
|
|
8
|
+
readonly schedule: Cron.Cron | Duration.Duration;
|
|
9
|
+
readonly ref: Ref.AnyMutation | Ref.AnyAction;
|
|
10
|
+
readonly args: Record<string, unknown>;
|
|
7
11
|
}
|
|
8
|
-
declare const
|
|
9
|
-
|
|
10
|
-
interface CronJob {
|
|
11
|
-
readonly [TypeId]: TypeId;
|
|
12
|
-
readonly identifier: string;
|
|
13
|
-
readonly schedule: Cron.Cron | Duration.Duration;
|
|
14
|
-
readonly ref: Ref.AnyMutation | Ref.AnyAction;
|
|
15
|
-
readonly args: Record<string, unknown>;
|
|
16
|
-
}
|
|
17
|
-
declare const isCronJob: (u: unknown) => u is CronJob;
|
|
18
|
-
declare const make: <R extends Ref.AnyMutation | Ref.AnyAction>(identifier: string, schedule: Cron.Cron | Duration.Duration, ref: R, ...args: Ref.OptionalArgs<R>) => CronJob;
|
|
19
|
-
//#endregion
|
|
20
|
-
export { CronJob, CronJob_d_exports, TypeId, isCronJob, make };
|
|
12
|
+
export declare const isCronJob: (u: unknown) => u is CronJob;
|
|
13
|
+
export declare const make: <R extends Ref.AnyMutation | Ref.AnyAction>(identifier: string, schedule: Cron.Cron | Duration.Duration, ref: R, ...args: Ref.OptionalArgs<R>) => CronJob;
|
|
21
14
|
//# sourceMappingURL=CronJob.d.ts.map
|
package/dist/CronJob.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CronJob.d.ts","
|
|
1
|
+
{"version":3,"file":"CronJob.d.ts","sourceRoot":"","sources":["../src/CronJob.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAG7C,eAAO,MAAM,MAAM,4BAA4B,CAAC;AAChD,MAAM,MAAM,MAAM,GAAG,OAAO,MAAM,CAAC;AAEnC,MAAM,WAAW,OAAO;IACtB,QAAQ,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IAE1B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,QAAQ,EAAE,IAAI,CAAC,IAAI,GAAG,QAAQ,CAAC,QAAQ,CAAC;IACjD,QAAQ,CAAC,GAAG,EAAE,GAAG,CAAC,WAAW,GAAG,GAAG,CAAC,SAAS,CAAC;IAC9C,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACxC;AAED,eAAO,MAAM,SAAS,GAAI,GAAG,OAAO,KAAG,CAAC,IAAI,OACV,CAAC;AAmBnC,eAAO,MAAM,IAAI,GAAI,CAAC,SAAS,GAAG,CAAC,WAAW,GAAG,GAAG,CAAC,SAAS,EAC5D,YAAY,MAAM,EAClB,UAAU,IAAI,CAAC,IAAI,GAAG,QAAQ,CAAC,QAAQ,EACvC,KAAK,CAAC,EACN,GAAG,MAAM,GAAG,CAAC,YAAY,CAAC,CAAC,CAAC,KAC3B,OAA8D,CAAC"}
|
package/dist/CronJobs.d.ts
CHANGED
|
@@ -1,20 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { type Crons } from "convex/server";
|
|
2
|
+
import type * as CronJob from "./CronJob";
|
|
3
|
+
export declare const TypeId = "@confect/server/CronJobs";
|
|
4
|
+
export type TypeId = typeof TypeId;
|
|
5
|
+
export interface CronJobs {
|
|
6
|
+
readonly [TypeId]: TypeId;
|
|
7
|
+
readonly cronJobs: Record<string, CronJob.CronJob>;
|
|
8
|
+
readonly convexCronJobs: Crons;
|
|
9
|
+
add(cron: CronJob.CronJob): CronJobs;
|
|
7
10
|
}
|
|
8
|
-
declare const
|
|
9
|
-
|
|
10
|
-
interface CronJobs {
|
|
11
|
-
readonly [TypeId]: TypeId;
|
|
12
|
-
readonly cronJobs: Record<string, CronJob>;
|
|
13
|
-
readonly convexCronJobs: Crons;
|
|
14
|
-
add(cron: CronJob): CronJobs;
|
|
15
|
-
}
|
|
16
|
-
declare const isCronJobs: (u: unknown) => u is CronJobs;
|
|
17
|
-
declare const make: () => CronJobs;
|
|
18
|
-
//#endregion
|
|
19
|
-
export { CronJobs, CronJobs_d_exports, TypeId, isCronJobs, make };
|
|
11
|
+
export declare const isCronJobs: (u: unknown) => u is CronJobs;
|
|
12
|
+
export declare const make: () => CronJobs;
|
|
20
13
|
//# sourceMappingURL=CronJobs.d.ts.map
|
package/dist/CronJobs.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CronJobs.d.ts","
|
|
1
|
+
{"version":3,"file":"CronJobs.d.ts","sourceRoot":"","sources":["../src/CronJobs.ts"],"names":[],"mappings":"AAEA,OAAO,EAA+B,KAAK,KAAK,EAAE,MAAM,eAAe,CAAC;AASxE,OAAO,KAAK,KAAK,OAAO,MAAM,WAAW,CAAC;AAE1C,eAAO,MAAM,MAAM,6BAA6B,CAAC;AACjD,MAAM,MAAM,MAAM,GAAG,OAAO,MAAM,CAAC;AAEnC,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;IACnD,QAAQ,CAAC,cAAc,EAAE,KAAK,CAAC;IAE/B,GAAG,CAAC,IAAI,EAAE,OAAO,CAAC,OAAO,GAAG,QAAQ,CAAC;CACtC;AAED,eAAO,MAAM,UAAU,GAAI,GAAG,OAAO,KAAG,CAAC,IAAI,QACX,CAAC;AAiDnC,eAAO,MAAM,IAAI,QAAO,QAA4C,CAAC"}
|
package/dist/DataModel.d.ts
CHANGED
|
@@ -1,33 +1,28 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import type * as DatabaseSchema from "./DatabaseSchema";
|
|
2
|
+
import type * as Table from "./Table";
|
|
3
|
+
import type * as TableInfo from "./TableInfo";
|
|
4
|
+
export declare const TypeId: "@confect/server/DataModel";
|
|
5
|
+
export type TypeId = typeof TypeId;
|
|
6
|
+
export interface DataModel<Tables_ extends Table.AnyWithProps> {
|
|
7
|
+
readonly [TypeId]: TypeId;
|
|
8
|
+
readonly tables: Table.TablesRecord<Tables_>;
|
|
8
9
|
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
interface DataModel<Tables_ extends AnyWithProps$1> {
|
|
12
|
-
readonly [TypeId]: TypeId;
|
|
13
|
-
readonly tables: TablesRecord<Tables_>;
|
|
10
|
+
export interface Any {
|
|
11
|
+
readonly [TypeId]: TypeId;
|
|
14
12
|
}
|
|
15
|
-
interface Any {
|
|
16
|
-
|
|
13
|
+
export interface AnyWithProps extends Any {
|
|
14
|
+
readonly tables: Record<string, Table.AnyWithProps>;
|
|
17
15
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
type
|
|
24
|
-
type
|
|
25
|
-
type
|
|
26
|
-
type
|
|
27
|
-
type
|
|
28
|
-
type
|
|
29
|
-
type
|
|
30
|
-
type DocumentByName<DataModel_ extends AnyWithProps, TableName extends TableNames<DataModel_>> = DocumentWithName<DataModel_, TableName>;
|
|
31
|
-
//#endregion
|
|
32
|
-
export { Any, AnyWithProps, DataModel, DataModel_d_exports, DocumentByName, DocumentWithName, FromSchema, FromTables, TableInfoWithName, TableInfoWithName_, TableNames, TableWithName, Tables, ToConvex, TypeId };
|
|
16
|
+
export type FromSchema<Schema extends DatabaseSchema.AnyWithProps> = DataModel<DatabaseSchema.Tables<Schema>>;
|
|
17
|
+
export type FromTables<Tables_ extends Table.AnyWithProps> = DataModel<Tables_>;
|
|
18
|
+
export type ToConvex<DataModel_ extends AnyWithProps> = {
|
|
19
|
+
[TableName_ in TableNames<DataModel_>]: TableInfoWithName<DataModel_, TableName_>;
|
|
20
|
+
};
|
|
21
|
+
export type Tables<DataModel_ extends AnyWithProps> = DataModel_ extends DataModel<infer Tables_> ? Tables_ : never;
|
|
22
|
+
export type TableNames<DataModel_ extends AnyWithProps> = Table.Name<Tables<DataModel_>> & string;
|
|
23
|
+
export type TableWithName<DataModel_ extends AnyWithProps, TableName extends TableNames<DataModel_>> = Table.WithName<Tables<DataModel_>, TableName>;
|
|
24
|
+
export type TableInfoWithName_<DataModel_ extends AnyWithProps, TableName extends TableNames<DataModel_>> = TableInfo.TableInfo<Table.WithName<Tables<DataModel_>, TableName>>;
|
|
25
|
+
export type TableInfoWithName<DataModel_ extends AnyWithProps, TableName extends TableNames<DataModel_>> = TableInfo.ConvexTableInfo<TableInfo.TableInfo<Table.WithName<Tables<DataModel_>, TableName>>>;
|
|
26
|
+
export type DocumentWithName<DataModel_ extends AnyWithProps, TableName extends TableNames<DataModel_>> = TableInfo.Document<TableInfo.TableInfo<Table.WithName<Tables<DataModel_>, TableName>>>;
|
|
27
|
+
export type DocumentByName<DataModel_ extends AnyWithProps, TableName extends TableNames<DataModel_>> = DocumentWithName<DataModel_, TableName>;
|
|
33
28
|
//# sourceMappingURL=DataModel.d.ts.map
|