@confect/server 9.0.0-next.9 → 9.0.1

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.
Files changed (89) hide show
  1. package/CHANGELOG.md +168 -4
  2. package/dist/ActionCtx.d.ts +3 -10
  3. package/dist/ActionCtx.d.ts.map +1 -1
  4. package/dist/ActionRunner.d.ts +7 -14
  5. package/dist/ActionRunner.d.ts.map +1 -1
  6. package/dist/Auth.d.ts +15 -23
  7. package/dist/Auth.d.ts.map +1 -1
  8. package/dist/BlobNotFoundError.d.ts +5 -11
  9. package/dist/BlobNotFoundError.d.ts.map +1 -1
  10. package/dist/ConvexConfigProvider.d.ts +1 -8
  11. package/dist/ConvexConfigProvider.d.ts.map +1 -1
  12. package/dist/CronJob.d.ts +12 -19
  13. package/dist/CronJob.d.ts.map +1 -1
  14. package/dist/CronJobs.d.ts +11 -18
  15. package/dist/CronJobs.d.ts.map +1 -1
  16. package/dist/DataModel.d.ts +24 -29
  17. package/dist/DataModel.d.ts.map +1 -1
  18. package/dist/DatabaseReader.d.ts +4313 -4328
  19. package/dist/DatabaseReader.d.ts.map +1 -1
  20. package/dist/DatabaseSchema.d.ts +19 -24
  21. package/dist/DatabaseSchema.d.ts.map +1 -1
  22. package/dist/DatabaseWriter.d.ts +36 -42
  23. package/dist/DatabaseWriter.d.ts.map +1 -1
  24. package/dist/Document.d.ts +26 -36
  25. package/dist/Document.d.ts.map +1 -1
  26. package/dist/FunctionImpl.d.ts +11 -20
  27. package/dist/FunctionImpl.d.ts.map +1 -1
  28. package/dist/GroupImpl.d.ts +29 -35
  29. package/dist/GroupImpl.d.ts.map +1 -1
  30. package/dist/Handler.d.ts +34 -40
  31. package/dist/Handler.d.ts.map +1 -1
  32. package/dist/HttpApi.d.ts +19 -25
  33. package/dist/HttpApi.d.ts.map +1 -1
  34. package/dist/HttpApi.js +4 -4
  35. package/dist/HttpApi.js.map +1 -1
  36. package/dist/MutationCtx.d.ts +3 -10
  37. package/dist/MutationCtx.d.ts.map +1 -1
  38. package/dist/MutationRunner.d.ts +7 -14
  39. package/dist/MutationRunner.d.ts.map +1 -1
  40. package/dist/OrderedQuery.d.ts +15 -22
  41. package/dist/OrderedQuery.d.ts.map +1 -1
  42. package/dist/QueryCtx.d.ts +3 -10
  43. package/dist/QueryCtx.d.ts.map +1 -1
  44. package/dist/QueryInitializer.d.ts +32 -38
  45. package/dist/QueryInitializer.d.ts.map +1 -1
  46. package/dist/QueryRunner.d.ts +7 -14
  47. package/dist/QueryRunner.d.ts.map +1 -1
  48. package/dist/RegisteredConvexFunction.d.ts +1099 -1121
  49. package/dist/RegisteredConvexFunction.d.ts.map +1 -1
  50. package/dist/RegisteredConvexFunction.js +4 -4
  51. package/dist/RegisteredConvexFunction.js.map +1 -1
  52. package/dist/RegisteredFunction.d.ts +46 -64
  53. package/dist/RegisteredFunction.d.ts.map +1 -1
  54. package/dist/RegisteredFunction.js +4 -4
  55. package/dist/RegisteredFunction.js.map +1 -1
  56. package/dist/RegisteredFunctions.d.ts +20 -22
  57. package/dist/RegisteredFunctions.d.ts.map +1 -1
  58. package/dist/RegisteredNodeFunction.d.ts +4 -14
  59. package/dist/RegisteredNodeFunction.d.ts.map +1 -1
  60. package/dist/RegistryItem.d.ts +17 -27
  61. package/dist/RegistryItem.d.ts.map +1 -1
  62. package/dist/Scheduler.d.ts +14 -22
  63. package/dist/Scheduler.d.ts.map +1 -1
  64. package/dist/SchemaToValidator.d.ts +68 -64
  65. package/dist/SchemaToValidator.d.ts.map +1 -1
  66. package/dist/SchemaToValidator.js +2 -2
  67. package/dist/SchemaToValidator.js.map +1 -1
  68. package/dist/StorageActionWriter.d.ts +20 -28
  69. package/dist/StorageActionWriter.d.ts.map +1 -1
  70. package/dist/StorageReader.d.ts +13 -21
  71. package/dist/StorageReader.d.ts.map +1 -1
  72. package/dist/StorageWriter.d.ts +15 -23
  73. package/dist/StorageWriter.d.ts.map +1 -1
  74. package/dist/Table.d.ts +202 -203
  75. package/dist/Table.d.ts.map +1 -1
  76. package/dist/Table.js +2 -2
  77. package/dist/Table.js.map +1 -1
  78. package/dist/TableInfo.d.ts +35 -41
  79. package/dist/TableInfo.d.ts.map +1 -1
  80. package/dist/VectorSearch.d.ts +28 -35
  81. package/dist/VectorSearch.d.ts.map +1 -1
  82. package/dist/index.d.ts +35 -35
  83. package/dist/index.d.ts.map +1 -0
  84. package/dist/internal/utils.d.ts +10 -13
  85. package/dist/internal/utils.d.ts.map +1 -1
  86. package/dist/node.d.ts +2 -2
  87. package/dist/node.d.ts.map +1 -0
  88. package/dist/tsconfig.src.tsbuildinfo +1 -0
  89. package/package.json +10 -13
package/CHANGELOG.md CHANGED
@@ -1,5 +1,159 @@
1
1
  # @confect/server
2
2
 
3
+ ## 9.0.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 445ea9b: Loosen and align dependency ranges across all packages:
8
+
9
+ - The `convex` peer dependency is now `^1.32.0` in every package (previously pinned exactly to `1.39.1`, or `^1.30.0` in `@confect/react`). The range is validated against convex 1.32.0 through 1.40.0.
10
+ - `@confect/server`'s `@effect/platform-node` peer dependency is now optional — it is only needed when using the `@confect/server/node` entrypoint.
11
+ - `@confect/cli` now uses caret ranges for its `@effect/platform` and `@effect/platform-node` dependencies so they can deduplicate with the versions resolved for `@confect/server`, and no longer declares an unused direct dependency on `@effect/platform-node-shared`.
12
+ - `@confect/test` now accepts any `convex-test` release in `>=0.0.50 <0.1.0` instead of exactly 0.0.50.
13
+
14
+ - Updated dependencies [445ea9b]
15
+ - @confect/core@9.0.1
16
+
17
+ ## 9.0.0
18
+
19
+ ### Major Changes
20
+
21
+ - 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.
22
+
23
+ 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.
24
+
25
+ ### Filesystem-driven groups
26
+
27
+ 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.
28
+
29
+ - Each `*.spec.ts` `export default`s its `GroupSpec` (named co-exports like error classes are still allowed).
30
+ - 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.
31
+ - 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.
32
+
33
+ ### Tables are the source of truth, named by their filename
34
+
35
+ 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.
36
+
37
+ 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.
38
+
39
+ ```ts confect/tables/notes.ts
40
+ import { Table } from "@confect/server";
41
+ import { Schema } from "effect";
42
+ import { Id } from "../_generated/id";
43
+
44
+ export default Table.make(() =>
45
+ Schema.Struct({
46
+ userId: Schema.optional(Id("users")),
47
+ text: Schema.String,
48
+ })
49
+ );
50
+ ```
51
+
52
+ Codegen emits, alongside it:
53
+
54
+ - `_generated/schema.ts`—the runtime `DatabaseSchema`. Never imports `convex/server`, so a runtime cold start no longer evaluates `defineSchema(...)`.
55
+ - `_generated/convexSchema.ts`—the Convex deploy `SchemaDefinition`, re-exported from `convex/schema.ts`.
56
+ - `_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.
57
+ - `_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/`.
58
+
59
+ A bound table's `name` property is renamed to `tableName` (avoiding a collision with `Function.prototype.name`).
60
+
61
+ ### Specs and impls: lazy schemas, and impls take the `DatabaseSchema`
62
+
63
+ `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.
64
+
65
+ **Before:**
66
+
67
+ ```ts confect/notes.spec.ts
68
+ export const notes = GroupSpec.make("notes").addFunction(
69
+ FunctionSpec.publicQuery({
70
+ name: "list",
71
+ args: Schema.Struct({}),
72
+ returns: Schema.Array(Notes.Doc),
73
+ })
74
+ );
75
+ ```
76
+
77
+ ```ts confect/notes.impl.ts
78
+ const list = FunctionImpl.make(api, "notes", "list", handler);
79
+ export const notes = GroupImpl.make(api, "notes").pipe(Layer.provide(list));
80
+ ```
81
+
82
+ **After:**
83
+
84
+ ```ts confect/notes.spec.ts
85
+ import notes from "./_generated/tables/notes";
86
+
87
+ export default GroupSpec.make().addFunction(
88
+ FunctionSpec.publicQuery({
89
+ name: "list",
90
+ args: () => Schema.Struct({}),
91
+ returns: () => Schema.Array(notes.Doc),
92
+ })
93
+ );
94
+ ```
95
+
96
+ ```ts confect/notes.impl.ts
97
+ import databaseSchema from "./_generated/schema";
98
+ import notes from "./notes.spec";
99
+
100
+ const list = FunctionImpl.make(databaseSchema, notes, "list", handler);
101
+ export default GroupImpl.make(databaseSchema, notes).pipe(
102
+ Layer.provide(list),
103
+ GroupImpl.finalize
104
+ );
105
+ ```
106
+
107
+ ### Node functions are first-class
108
+
109
+ 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.
110
+
111
+ - A Node group at `confect/email.spec.ts` is now reached at `refs.public.email.send` instead of `refs.public.node.email.send`.
112
+ - `@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.
113
+
114
+ ### Less work at cold start
115
+
116
+ 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.
117
+
118
+ ### Stable React hook results
119
+
120
+ `@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.
121
+
122
+ ### Codegen robustness
123
+
124
+ 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.
125
+
126
+ ### Migration
127
+
128
+ 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`.
129
+ 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"`.
130
+ 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).
131
+ 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)`.
132
+ 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`.
133
+ 6. **Optional.** Adopt submodule Effect imports (`import * as Schema from "effect/Schema"`) in your own `confect/` files for the full cold-start savings.
134
+ 7. Run `confect codegen`. It re-emits the entire `convex/` tree and `confect/_generated/`, deleting any stale files from earlier versions.
135
+
136
+ ### Patch Changes
137
+
138
+ - 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.)
139
+
140
+ 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).
141
+
142
+ - Updated dependencies [9eec71c]
143
+ - Updated dependencies [a905072]
144
+ - @confect/core@9.0.0
145
+
146
+ ## 9.0.0-next.10
147
+
148
+ ### Patch Changes
149
+
150
+ - 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.)
151
+
152
+ 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).
153
+
154
+ - Updated dependencies [9eec71c]
155
+ - @confect/core@9.0.0-next.10
156
+
3
157
  ## 9.0.0-next.9
4
158
 
5
159
  ### Major Changes
@@ -13,11 +167,13 @@
13
167
  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).
14
168
 
15
169
  ### Breaking changes
170
+
16
171
  - **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.
17
172
  - **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).
18
173
  - **`@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).
19
174
 
20
175
  ### Migration
176
+
21
177
  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.
22
178
  2. Update call sites to drop the `node` segment: `refs.public.node.<group>.<fn>` → `refs.public.<group>.<fn>`.
23
179
  3. Replace `Refs.make(spec, nodeSpec)` with `Refs.make(spec)` (codegen does this for `_generated/refs.ts` automatically).
@@ -127,6 +283,7 @@
127
283
  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.
128
284
 
129
285
  Codegen now scans `confect/tables/*.ts` (every file must default-export a `Table`) and emits two siblings:
286
+
130
287
  - `confect/_generated/schema.ts` — the runtime `DatabaseSchema`, consumed by `_generated/api.ts`. Imports `@confect/server` but never `convex/server`.
131
288
  - `confect/_generated/convexSchema.ts` — the Convex deploy `SchemaDefinition`, re-exported one-line from `convex/schema.ts`. Imports `convex/server` but never `@confect/server`.
132
289
 
@@ -139,6 +296,7 @@
139
296
  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.
140
297
 
141
298
  Codegen now emits two new sets of files alongside `_generated/schema.ts` and `_generated/convexSchema.ts`:
299
+
142
300
  - `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")`.
143
301
  - `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`.
144
302
 
@@ -155,6 +313,7 @@
155
313
  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).
156
314
 
157
315
  ### Migration
316
+
158
317
  1. Delete your `confect/schema.ts`. Codegen will refuse to run while a stray copy is present.
159
318
  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.
160
319
  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`:
@@ -244,6 +403,7 @@
244
403
  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.
245
404
 
246
405
  ### What changed
406
+
247
407
  - `@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.
248
408
  - `@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.
249
409
  - `@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.
@@ -251,6 +411,7 @@
251
411
  - `@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.
252
412
 
253
413
  ### User-facing impact
414
+
254
415
  - 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.
255
416
  - 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.
256
417
  - 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.
@@ -289,6 +450,7 @@
289
450
  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.
290
451
 
291
452
  ### Breaking changes
453
+
292
454
  - `GroupSpec.make()` and `GroupSpec.makeNode()` no longer take a name argument; the group name is derived from the spec file's path within `confect/`.
293
455
  - `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.
294
456
  - 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.
@@ -297,6 +459,7 @@
297
459
  - 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.
298
460
 
299
461
  ### Migration
462
+
300
463
  1. For each existing group, create a colocated `confect/{path}.spec.ts` and `confect/{path}.impl.ts` pair (under a subdirectory for nested groups).
301
464
  - In each spec, call `GroupSpec.make()` (or `GroupSpec.makeNode()`) without a name and `export default` the result.
302
465
  - 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:
@@ -304,7 +467,7 @@
304
467
  export default GroupImpl.make(api, notes).pipe(
305
468
  Layer.provide(list),
306
469
  Layer.provide(insert),
307
- GroupImpl.finalize,
470
+ GroupImpl.finalize
308
471
  );
309
472
  ```
310
473
  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.)
@@ -362,7 +525,7 @@
362
525
 
363
526
  export class NoteNotFound extends Schema.TaggedError<NoteNotFound>()(
364
527
  "NoteNotFound",
365
- { noteId: GenericId.GenericId("notes") },
528
+ { noteId: GenericId.GenericId("notes") }
366
529
  ) {}
367
530
 
368
531
  export const notes = GroupSpec.make("notes").addFunction(
@@ -371,7 +534,7 @@
371
534
  args: Schema.Struct({ noteId: GenericId.GenericId("notes") }),
372
535
  returns: Notes.Doc,
373
536
  error: NoteNotFound,
374
- }),
537
+ })
375
538
  );
376
539
  ```
377
540
 
@@ -391,7 +554,7 @@
391
554
  .table("notes")
392
555
  .get(noteId)
393
556
  .pipe(Effect.mapError(() => new NoteNotFound({ noteId })));
394
- }),
557
+ })
395
558
  );
396
559
  ```
397
560
 
@@ -463,6 +626,7 @@
463
626
  Unspecified failures continue to reject the promise.
464
627
 
465
628
  ### Migration
629
+
466
630
  - 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).
467
631
  - 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.
468
632
 
@@ -1,12 +1,5 @@
1
+ import type { GenericActionCtx, GenericDataModel } from "convex/server";
1
2
  import * as Context from "effect/Context";
2
- import { GenericActionCtx, GenericDataModel } from "convex/server";
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
@@ -1 +1 @@
1
- {"version":3,"file":"ActionCtx.d.ts","names":[],"sources":["../src/ActionCtx.ts"],"mappings":";;;;;;;cAGa,SAAA,qBAA+B,gBAAA,OAAgB,OAAA,CAAA,GAAA,CAAA,gBAAA,CAAA,SAAA,GAAA,gBAAA,CAAA,SAAA;AAAA,KAGhD,SAAA,mBAA4B,gBAAA,IAAoB,UAAA,QACnD,SAAA,CAAU,SAAA"}
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"}
@@ -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 * as Layer$1 from "effect/Layer";
5
- import { Effect, ParseResult } from "effect";
6
-
7
- //#region src/ActionRunner.d.ts
8
- declare namespace ActionRunner_d_exports {
9
- export { ActionRunner, layer };
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","names":[],"sources":["../src/ActionRunner.ts"],"mappings":";;;;;;;;;;cAsBa,YAAA,EAAY,OAAA,CAAA,GAAA,kBAdP,GAAA,CAAI,SAAA,EAAS,MAAA,EACnB,MAAA,KAAM,IAAA,EACL,GAAA,CAAI,YAAA,CAAa,MAAA,MACzB,MAAA,CAAO,MAAA,CACR,GAAA,CAAI,OAAA,CAAQ,MAAA,GACZ,GAAA,CAAI,KAAA,CAAM,MAAA,IAAU,WAAA,CAAY,UAAA,oBALlB,GAAA,CAAI,SAAA,EAAS,MAAA,EACnB,MAAA,KAAM,IAAA,EACL,GAAA,CAAI,YAAA,CAAa,MAAA,MACzB,MAAA,CAAO,MAAA,CACR,GAAA,CAAI,OAAA,CAAQ,MAAA,GACZ,GAAA,CAAI,KAAA,CAAM,MAAA,IAAU,WAAA,CAAY,UAAA;AAAA,KAYxB,YAAA,UAAsB,YAAA,CAAa,UAAA;AAAA,cAElC,KAAA,GAAS,SAAA,EAAW,gBAAA,uBAAkC,OAAA,CAAA,KAAA,kBAnBjD,GAAA,CAAI,SAAA,EAAS,MAAA,EACnB,MAAA,KAAM,IAAA,EACL,GAAA,CAAI,YAAA,CAAa,MAAA,MACzB,MAAA,CAAO,MAAA,CACR,GAAA,CAAI,OAAA,CAAQ,MAAA,GACZ,GAAA,CAAI,KAAA,CAAM,MAAA,IAAU,WAAA,CAAY,UAAA"}
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 * as effect_Context0 from "effect/Context";
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
- import * as effect_Cause0 from "effect/Cause";
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
- getUserIdentity: Effect.Effect<convex_server0.UserIdentity, NoUserIdentityFoundError, never>;
8
+ getUserIdentity: Effect.Effect<import("convex/server").UserIdentity, NoUserIdentityFoundError, never>;
17
9
  }> & {
18
- use: <X>(body: (_: {
19
- getUserIdentity: Effect.Effect<convex_server0.UserIdentity, NoUserIdentityFoundError, never>;
20
- }) => 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, effect_Cause0.UnknownException, Auth> : Effect.Effect<X, never, Auth>;
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
- declare const layer: (auth: Auth$1) => Layer.Layer<Auth, never, never>;
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
- readonly _tag: Schema.tag<"NoUserIdentityFoundError">;
18
+ readonly _tag: Schema.tag<"NoUserIdentityFoundError">;
26
19
  }>;
27
- declare class NoUserIdentityFoundError extends NoUserIdentityFoundError_base {
28
- get message(): string;
20
+ export declare class NoUserIdentityFoundError extends NoUserIdentityFoundError_base {
21
+ get message(): string;
29
22
  }
30
- //#endregion
31
- export { Auth, Auth_d_exports, NoUserIdentityFoundError, layer };
23
+ export {};
32
24
  //# sourceMappingURL=Auth.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Auth.d.ts","names":[],"sources":["../src/Auth.ts"],"mappings":";;;;;;;;;;;;cAKwC,SAAA;;;;;;;;;cAgB3B,IAAA,SAAa,SAAA;AAAA,cAKb,KAAA,GAAS,IAAA,EAAM,MAAA,KAAU,KAAA,CAAA,KAAA,CAAA,IAAA;AAAA,cAAqC,6BAAA;;;cAE9D,wBAAA,SAAiC,6BAAA;EAAA,IAI/B,OAAA,CAAA;AAAA"}
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
- readonly _tag: Schema.tag<"BlobNotFoundError">;
3
+ readonly _tag: Schema.tag<"BlobNotFoundError">;
9
4
  } & {
10
- id: typeof Schema.String;
5
+ id: typeof Schema.String;
11
6
  }>;
12
- declare class BlobNotFoundError extends BlobNotFoundError_base {
13
- get message(): string;
7
+ export declare class BlobNotFoundError extends BlobNotFoundError_base {
8
+ get message(): string;
14
9
  }
15
- //#endregion
16
- export { BlobNotFoundError, BlobNotFoundError_d_exports };
10
+ export {};
17
11
  //# sourceMappingURL=BlobNotFoundError.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"BlobNotFoundError.d.ts","names":[],"sources":["../src/BlobNotFoundError.ts"],"mappings":";;;;;;cAAwC,sBAAA;;;;;cAE3B,iBAAA,SAA0B,sBAAA;EAAA,IAMxB,OAAA,CAAA;AAAA"}
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","names":[],"sources":["../src/ConvexConfigProvider.ts"],"mappings":";;;;;;cASa,IAAA,GACX,OAAA,GAAU,OAAA,CAAQ,cAAA,CAAe,cAAA,CAAe,aAAA,MAC/C,cAAA,CAAe,cAAA"}
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
- //#region src/CronJob.d.ts
5
- declare namespace CronJob_d_exports {
6
- export { CronJob, TypeId, isCronJob, make };
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 TypeId = "@confect/server/CronJob";
9
- type TypeId = typeof TypeId;
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
@@ -1 +1 @@
1
- {"version":3,"file":"CronJob.d.ts","names":[],"sources":["../src/CronJob.ts"],"mappings":";;;;;;;cAIa,MAAA;AAAA,KACD,MAAA,UAAgB,MAAA;AAAA,UAEX,OAAA;EAAA,UACL,MAAA,GAAS,MAAA;EAAA,SAEV,UAAA;EAAA,SACA,QAAA,EAAU,IAAA,CAAK,IAAA,GAAO,QAAA,CAAS,QAAA;EAAA,SAC/B,GAAA,EAAK,GAAA,CAAI,WAAA,GAAc,GAAA,CAAI,SAAA;EAAA,SAC3B,IAAA,EAAM,MAAA;AAAA;AAAA,cAGJ,SAAA,GAAa,CAAA,cAAa,CAAA,IAAK,OAAA;AAAA,cAoB/B,IAAA,aAAkB,GAAA,CAAI,WAAA,GAAc,GAAA,CAAI,SAAA,EACnD,UAAA,UACA,QAAA,EAAU,IAAA,CAAK,IAAA,GAAO,QAAA,CAAS,QAAA,EAC/B,GAAA,EAAK,CAAA,KACF,IAAA,EAAM,GAAA,CAAI,YAAA,CAAa,CAAA,MACzB,OAAA"}
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"}
@@ -1,20 +1,13 @@
1
- import { CronJob } from "./CronJob.js";
2
- import { Crons } from "convex/server";
3
-
4
- //#region src/CronJobs.d.ts
5
- declare namespace CronJobs_d_exports {
6
- export { CronJobs, TypeId, isCronJobs, make };
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 TypeId = "@confect/server/CronJobs";
9
- type TypeId = typeof TypeId;
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
@@ -1 +1 @@
1
- {"version":3,"file":"CronJobs.d.ts","names":[],"sources":["../src/CronJobs.ts"],"mappings":";;;;;;;cAaa,MAAA;AAAA,KACD,MAAA,UAAgB,MAAA;AAAA,UAEX,QAAA;EAAA,UACL,MAAA,GAAS,MAAA;EAAA,SACV,QAAA,EAAU,MAAA,SAAe,OAAA;EAAA,SACzB,cAAA,EAAgB,KAAA;EAEzB,GAAA,CAAI,IAAA,EAAM,OAAA,GAAkB,QAAA;AAAA;AAAA,cAGjB,UAAA,GAAc,CAAA,cAAa,CAAA,IAAK,QAAA;AAAA,cAkDhC,IAAA,QAAW,QAAA"}
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"}
@@ -1,33 +1,28 @@
1
- import { AnyWithProps as AnyWithProps$1, Name, TablesRecord, WithName } from "./Table.js";
2
- import { AnyWithProps as AnyWithProps$2, Tables as Tables$1 } from "./DatabaseSchema.js";
3
- import { ConvexTableInfo, Document, TableInfo } from "./TableInfo.js";
4
-
5
- //#region src/DataModel.d.ts
6
- declare namespace DataModel_d_exports {
7
- export { Any, AnyWithProps, DataModel, DocumentByName, DocumentWithName, FromSchema, FromTables, TableInfoWithName, TableInfoWithName_, TableNames, TableWithName, Tables, ToConvex, TypeId };
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
- declare const TypeId: "@confect/server/DataModel";
10
- type TypeId = typeof TypeId;
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
- readonly [TypeId]: TypeId;
13
+ export interface AnyWithProps extends Any {
14
+ readonly tables: Record<string, Table.AnyWithProps>;
17
15
  }
18
- interface AnyWithProps extends Any {
19
- readonly tables: Record<string, AnyWithProps$1>;
20
- }
21
- type FromSchema<Schema extends AnyWithProps$2> = DataModel<Tables$1<Schema>>;
22
- type FromTables<Tables_ extends AnyWithProps$1> = DataModel<Tables_>;
23
- type ToConvex<DataModel_ extends AnyWithProps> = { [TableName_ in TableNames<DataModel_>]: TableInfoWithName<DataModel_, TableName_> };
24
- type Tables<DataModel_ extends AnyWithProps> = DataModel_ extends DataModel<infer Tables_> ? Tables_ : never;
25
- type TableNames<DataModel_ extends AnyWithProps> = Name<Tables<DataModel_>> & string;
26
- type TableWithName<DataModel_ extends AnyWithProps, TableName extends TableNames<DataModel_>> = WithName<Tables<DataModel_>, TableName>;
27
- type TableInfoWithName_<DataModel_ extends AnyWithProps, TableName extends TableNames<DataModel_>> = TableInfo<WithName<Tables<DataModel_>, TableName>>;
28
- type TableInfoWithName<DataModel_ extends AnyWithProps, TableName extends TableNames<DataModel_>> = ConvexTableInfo<TableInfo<WithName<Tables<DataModel_>, TableName>>>;
29
- type DocumentWithName<DataModel_ extends AnyWithProps, TableName extends TableNames<DataModel_>> = Document<TableInfo<WithName<Tables<DataModel_>, TableName>>>;
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