@confect/server 9.0.0-next.2 → 9.0.0-next.4

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 CHANGED
@@ -1,5 +1,40 @@
1
1
  # @confect/server
2
2
 
3
+ ## 9.0.0-next.4
4
+
5
+ ### Patch Changes
6
+
7
+ - @confect/core@9.0.0-next.4
8
+
9
+ ## 9.0.0-next.3
10
+
11
+ ### Patch Changes
12
+
13
+ - 6d85210: Resolve `FunctionImpl` / `GroupImpl` group paths via an immutable `paths` map on `Spec` instead of identity-walking the assembled tree.
14
+
15
+ ### Why
16
+
17
+ 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.
18
+
19
+ ### What changed
20
+ - `@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.
21
+ - `@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.
22
+ - `@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.
23
+ - `@confect/server/GroupPath` (the old identity-based resolver) is deleted.
24
+ - `@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.
25
+
26
+ ### User-facing impact
27
+ - 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.
28
+ - 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.
29
+ - 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.
30
+
31
+ ### Fixes
32
+
33
+ This eliminates the runtime regression introduced in `9.0.0-next.1` for any project layout where a `confect/{path}.spec.ts` declares functions alongside a sibling `confect/{path}/` subdirectory of further specs.
34
+
35
+ - Updated dependencies [6d85210]
36
+ - @confect/core@9.0.0-next.3
37
+
3
38
  ## 9.0.0-next.2
4
39
 
5
40
  ### Patch Changes
package/dist/Api.d.ts CHANGED
@@ -1,11 +1,12 @@
1
1
  import { AnyWithProps as AnyWithProps$1 } from "./DatabaseSchema.js";
2
2
  import { GenericSchema, SchemaDefinition } from "convex/server";
3
3
  import { RuntimeAndFunctionType } from "@confect/core";
4
+ import * as GroupSpec from "@confect/core/GroupSpec";
4
5
  import * as Spec from "@confect/core/Spec";
5
6
 
6
7
  //#region src/Api.d.ts
7
8
  declare namespace Api_d_exports {
8
- export { Any, AnyWithProps, AnyWithPropsWithRuntime, Api, GetSpec, Groups, Schema, TypeId, isApi, make };
9
+ export { Any, AnyWithProps, AnyWithPropsWithRuntime, Api, GetSpec, Groups, Schema, TypeId, isApi, make, resolveGroupPathUnsafe };
9
10
  }
10
11
  declare const TypeId = "@confect/server/Api";
11
12
  type TypeId = typeof TypeId;
@@ -25,6 +26,18 @@ type Schema<Api_ extends AnyWithProps> = Api_["databaseSchema"];
25
26
  type GetSpec<Api_ extends AnyWithProps> = Api_["spec"];
26
27
  type Groups<Api_ extends AnyWithProps> = Spec.Groups<Api_["spec"]>;
27
28
  declare const make: <DatabaseSchema_ extends AnyWithProps$1, Spec_ extends Spec.AnyWithProps>(databaseSchema: DatabaseSchema_, spec: Spec_) => Api<DatabaseSchema_, Spec_>;
29
+ /**
30
+ * Resolve the dot-path of `group` within `api.spec` by reading the immutable
31
+ * `paths` mapping that codegen populated in `_generated/spec.ts`. Throws when
32
+ * the spec is not registered, with a message pointing the caller at the
33
+ * place to register it.
34
+ *
35
+ * The legacy identity-based tree walk (`packages/server/src/GroupPath.ts`)
36
+ * was deleted in favor of this O(1) map lookup; both the registration
37
+ * mechanism (`Spec.addPath`) and the lookup key are the same JS reference
38
+ * thanks to ES module dedup between `_generated/spec.ts` and `*.impl.ts`.
39
+ */
40
+ declare const resolveGroupPathUnsafe: (api: AnyWithProps, group: GroupSpec.AnyWithProps) => string;
28
41
  //#endregion
29
- export { Any, AnyWithProps, AnyWithPropsWithRuntime, Api, Api_d_exports, GetSpec, Groups, Schema, TypeId, isApi, make };
42
+ export { Any, AnyWithProps, AnyWithPropsWithRuntime, Api, Api_d_exports, GetSpec, Groups, Schema, TypeId, isApi, make, resolveGroupPathUnsafe };
30
43
  //# sourceMappingURL=Api.d.ts.map
package/dist/Api.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"Api.d.ts","names":[],"sources":["../src/Api.ts"],"mappings":";;;;;;;;;cAOa,MAAA;AAAA,KACD,MAAA,UAAgB,MAAA;AAAA,cAEf,KAAA,GAAS,CAAA,cAAa,CAAA,IAAK,GAAA;AAAA,UAEvB,GAAA,yBACS,cAAA,gBACV,IAAA,CAAK,YAAA;EAAA,UAET,MAAA,GAAS,MAAA;EAAA,SACV,IAAA,EAAM,KAAA;EAAA,SACN,cAAA,EAAgB,eAAA;EAAA,SAChB,sBAAA,EAAwB,gBAAA,CAAiB,aAAA;AAAA;AAAA,UAGnC,GAAA;EAAA,UACL,MAAA,GAAS,MAAA;AAAA;AAAA,UAGJ,YAAA,SAAqB,GAAA,CACpC,cAAA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AK,YAAA,EAEnB,cAAA,EAAgB,eAAA,EAChB,IAAA,EAAM,KAAA,KACL,GAAA,CAAI,eAAA,EAAiB,KAAA;;AAlExB;;;;;AAEA;;;;;cA6Ea,sBAAA,GACX,GAAA,EAAK,YAAA,EACL,KAAA,EAAO,SAAA,CAAU,YAAA"}
package/dist/Api.js CHANGED
@@ -6,7 +6,8 @@ import { defineSchema } from "convex/server";
6
6
  var Api_exports = /* @__PURE__ */ __exportAll({
7
7
  TypeId: () => TypeId,
8
8
  isApi: () => isApi,
9
- make: () => make
9
+ make: () => make,
10
+ resolveGroupPathUnsafe: () => resolveGroupPathUnsafe
10
11
  });
11
12
  const TypeId = "@confect/server/Api";
12
13
  const isApi = (u) => Predicate.hasProperty(u, TypeId);
@@ -20,7 +21,23 @@ const make = (databaseSchema, spec) => makeProto({
20
21
  databaseSchema,
21
22
  spec
22
23
  });
24
+ /**
25
+ * Resolve the dot-path of `group` within `api.spec` by reading the immutable
26
+ * `paths` mapping that codegen populated in `_generated/spec.ts`. Throws when
27
+ * the spec is not registered, with a message pointing the caller at the
28
+ * place to register it.
29
+ *
30
+ * The legacy identity-based tree walk (`packages/server/src/GroupPath.ts`)
31
+ * was deleted in favor of this O(1) map lookup; both the registration
32
+ * mechanism (`Spec.addPath`) and the lookup key are the same JS reference
33
+ * thanks to ES module dedup between `_generated/spec.ts` and `*.impl.ts`.
34
+ */
35
+ const resolveGroupPathUnsafe = (api, group) => {
36
+ const groupPath = api.spec.paths.get(group);
37
+ if (groupPath === void 0) throw new Error("GroupSpec has no registered path in this api's spec. Ensure the spec is added via Spec.addPath in _generated/spec.ts (or, in tests, call .addPath(spec, 'dot.path') on the Spec you pass to Api.make).");
38
+ return groupPath;
39
+ };
23
40
 
24
41
  //#endregion
25
- export { Api_exports, TypeId, isApi, make };
42
+ export { Api_exports, TypeId, isApi, make, resolveGroupPathUnsafe };
26
43
  //# sourceMappingURL=Api.js.map
package/dist/Api.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"Api.js","names":["defineConvexSchema"],"sources":["../src/Api.ts"],"sourcesContent":["import type { RuntimeAndFunctionType } from \"@confect/core\";\nimport type * as Spec from \"@confect/core/Spec\";\nimport type { GenericSchema, SchemaDefinition } from \"convex/server\";\nimport { defineSchema as defineConvexSchema } from \"convex/server\";\nimport { pipe, Predicate, Record } from \"effect\";\nimport type * as DatabaseSchema from \"./DatabaseSchema\";\n\nexport const TypeId = \"@confect/server/Api\";\nexport type TypeId = typeof TypeId;\n\nexport const isApi = (u: unknown): u is Any => Predicate.hasProperty(u, TypeId);\n\nexport interface Api<\n DatabaseSchema_ extends DatabaseSchema.AnyWithProps,\n Spec_ extends Spec.AnyWithProps,\n> {\n readonly [TypeId]: TypeId;\n readonly spec: Spec_;\n readonly databaseSchema: DatabaseSchema_;\n readonly convexSchemaDefinition: SchemaDefinition<GenericSchema, true>;\n}\n\nexport interface Any {\n readonly [TypeId]: TypeId;\n}\n\nexport interface AnyWithProps extends Api<\n DatabaseSchema.AnyWithProps,\n Spec.AnyWithProps\n> {}\n\nexport interface AnyWithPropsWithRuntime<\n Runtime extends RuntimeAndFunctionType.Runtime,\n> extends Api<\n DatabaseSchema.AnyWithProps,\n Spec.AnyWithPropsWithRuntime<Runtime>\n> {}\n\nexport type Schema<Api_ extends AnyWithProps> = Api_[\"databaseSchema\"];\n\nexport type GetSpec<Api_ extends AnyWithProps> = Api_[\"spec\"];\n\nexport type Groups<Api_ extends AnyWithProps> = Spec.Groups<Api_[\"spec\"]>;\n\nconst Proto = {\n [TypeId]: TypeId,\n};\n\nconst makeProto = <\n DatabaseSchema_ extends DatabaseSchema.AnyWithProps,\n Spec_ extends Spec.AnyWithProps,\n>({\n databaseSchema,\n spec,\n}: {\n databaseSchema: DatabaseSchema.AnyWithProps;\n spec: Spec_;\n}): Api<DatabaseSchema_, Spec_> =>\n Object.assign(Object.create(Proto), {\n databaseSchema,\n spec,\n convexSchemaDefinition: pipe(\n databaseSchema.tables,\n Record.map(({ tableDefinition }) => tableDefinition),\n defineConvexSchema,\n ),\n });\n\nexport const make = <\n DatabaseSchema_ extends DatabaseSchema.AnyWithProps,\n Spec_ extends Spec.AnyWithProps,\n>(\n databaseSchema: DatabaseSchema_,\n spec: Spec_,\n): Api<DatabaseSchema_, Spec_> => makeProto({ databaseSchema, spec });\n"],"mappings":";;;;;;;;;;AAOA,MAAa,SAAS;AAGtB,MAAa,SAAS,MAAyB,UAAU,YAAY,GAAG,OAAO;AAkC/E,MAAM,QAAQ,GACX,SAAS,QACX;AAED,MAAM,aAGJ,EACA,gBACA,WAKA,OAAO,OAAO,OAAO,OAAO,MAAM,EAAE;CAClC;CACA;CACA,wBAAwB,KACtB,eAAe,QACf,OAAO,KAAK,EAAE,sBAAsB,gBAAgB,EACpDA,aACD;CACF,CAAC;AAEJ,MAAa,QAIX,gBACA,SACgC,UAAU;CAAE;CAAgB;CAAM,CAAC"}
1
+ {"version":3,"file":"Api.js","names":["defineConvexSchema"],"sources":["../src/Api.ts"],"sourcesContent":["import type { RuntimeAndFunctionType } from \"@confect/core\";\nimport type * as GroupSpec from \"@confect/core/GroupSpec\";\nimport type * as Spec from \"@confect/core/Spec\";\nimport type { GenericSchema, SchemaDefinition } from \"convex/server\";\nimport { defineSchema as defineConvexSchema } from \"convex/server\";\nimport { pipe, Predicate, Record } from \"effect\";\nimport type * as DatabaseSchema from \"./DatabaseSchema\";\n\nexport const TypeId = \"@confect/server/Api\";\nexport type TypeId = typeof TypeId;\n\nexport const isApi = (u: unknown): u is Any => Predicate.hasProperty(u, TypeId);\n\nexport interface Api<\n DatabaseSchema_ extends DatabaseSchema.AnyWithProps,\n Spec_ extends Spec.AnyWithProps,\n> {\n readonly [TypeId]: TypeId;\n readonly spec: Spec_;\n readonly databaseSchema: DatabaseSchema_;\n readonly convexSchemaDefinition: SchemaDefinition<GenericSchema, true>;\n}\n\nexport interface Any {\n readonly [TypeId]: TypeId;\n}\n\nexport interface AnyWithProps extends Api<\n DatabaseSchema.AnyWithProps,\n Spec.AnyWithProps\n> {}\n\nexport interface AnyWithPropsWithRuntime<\n Runtime extends RuntimeAndFunctionType.Runtime,\n> extends Api<\n DatabaseSchema.AnyWithProps,\n Spec.AnyWithPropsWithRuntime<Runtime>\n> {}\n\nexport type Schema<Api_ extends AnyWithProps> = Api_[\"databaseSchema\"];\n\nexport type GetSpec<Api_ extends AnyWithProps> = Api_[\"spec\"];\n\nexport type Groups<Api_ extends AnyWithProps> = Spec.Groups<Api_[\"spec\"]>;\n\nconst Proto = {\n [TypeId]: TypeId,\n};\n\nconst makeProto = <\n DatabaseSchema_ extends DatabaseSchema.AnyWithProps,\n Spec_ extends Spec.AnyWithProps,\n>({\n databaseSchema,\n spec,\n}: {\n databaseSchema: DatabaseSchema.AnyWithProps;\n spec: Spec_;\n}): Api<DatabaseSchema_, Spec_> =>\n Object.assign(Object.create(Proto), {\n databaseSchema,\n spec,\n convexSchemaDefinition: pipe(\n databaseSchema.tables,\n Record.map(({ tableDefinition }) => tableDefinition),\n defineConvexSchema,\n ),\n });\n\nexport const make = <\n DatabaseSchema_ extends DatabaseSchema.AnyWithProps,\n Spec_ extends Spec.AnyWithProps,\n>(\n databaseSchema: DatabaseSchema_,\n spec: Spec_,\n): Api<DatabaseSchema_, Spec_> => makeProto({ databaseSchema, spec });\n\n/**\n * Resolve the dot-path of `group` within `api.spec` by reading the immutable\n * `paths` mapping that codegen populated in `_generated/spec.ts`. Throws when\n * the spec is not registered, with a message pointing the caller at the\n * place to register it.\n *\n * The legacy identity-based tree walk (`packages/server/src/GroupPath.ts`)\n * was deleted in favor of this O(1) map lookup; both the registration\n * mechanism (`Spec.addPath`) and the lookup key are the same JS reference\n * thanks to ES module dedup between `_generated/spec.ts` and `*.impl.ts`.\n */\nexport const resolveGroupPathUnsafe = (\n api: AnyWithProps,\n group: GroupSpec.AnyWithProps,\n): string => {\n const groupPath = api.spec.paths.get(group);\n if (groupPath === undefined) {\n throw new Error(\n \"GroupSpec has no registered path in this api's spec. \" +\n \"Ensure the spec is added via Spec.addPath in _generated/spec.ts \" +\n \"(or, in tests, call .addPath(spec, 'dot.path') on the Spec you pass to Api.make).\",\n );\n }\n return groupPath;\n};\n"],"mappings":";;;;;;;;;;;AAQA,MAAa,SAAS;AAGtB,MAAa,SAAS,MAAyB,UAAU,YAAY,GAAG,OAAO;AAkC/E,MAAM,QAAQ,GACX,SAAS,QACX;AAED,MAAM,aAGJ,EACA,gBACA,WAKA,OAAO,OAAO,OAAO,OAAO,MAAM,EAAE;CAClC;CACA;CACA,wBAAwB,KACtB,eAAe,QACf,OAAO,KAAK,EAAE,sBAAsB,gBAAgB,EACpDA,aACD;CACF,CAAC;AAEJ,MAAa,QAIX,gBACA,SACgC,UAAU;CAAE;CAAgB;CAAM,CAAC;;;;;;;;;;;;AAarE,MAAa,0BACX,KACA,UACW;CACX,MAAM,YAAY,IAAI,KAAK,MAAM,IAAI,MAAM;AAC3C,KAAI,cAAc,OAChB,OAAM,IAAI,MACR,yMAGD;AAEH,QAAO"}
package/dist/Auth.d.ts CHANGED
@@ -15,7 +15,7 @@ declare const Auth_base: effect_Context0.TagClass<Auth, "@confect/server/Auth",
15
15
  }> & {
16
16
  use: <X>(body: (_: {
17
17
  getUserIdentity: Effect.Effect<convex_server0.UserIdentity, NoUserIdentityFoundError, never>;
18
- }) => 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>;
18
+ }) => X) => [X] extends [Effect.Effect<infer A, infer E, infer R>] ? Effect.Effect<A, E, R | Auth> : [X] extends [PromiseLike<infer A_1>] ? Effect.Effect<A_1, effect_Cause0.UnknownException, Auth> : Effect.Effect<X, never, Auth>;
19
19
  };
20
20
  declare class Auth extends Auth_base {}
21
21
  declare const layer: (auth: Auth$1) => Layer.Layer<Auth, never, never>;
@@ -19,7 +19,7 @@ declare namespace DatabaseReader_d_exports {
19
19
  declare const make: <DatabaseSchema_ extends AnyWithProps>(databaseSchema: DatabaseSchema_, convexDatabaseReader: GenericDatabaseReader<ToConvex<FromSchema<DatabaseSchema_>>>) => {
20
20
  table: <const TableName extends Name<IncludeSystemTables<Tables<DatabaseSchema_>>>>(tableName: TableName) => {
21
21
  readonly get: {
22
- (id: convex_values0.GenericId<TableName>): effect_Effect0.Effect<TableInfo<WithName<IncludeSystemTables<Tables<DatabaseSchema_>>, TableName>>["document"], DocumentDecodeError | GetByIdFailure, never>;
22
+ (id: convex_values0.GenericId<TableName>): effect_Effect0.Effect<TableInfo<WithName<IncludeSystemTables<Tables<DatabaseSchema_>>, TableName>>["document"], GetByIdFailure | DocumentDecodeError, never>;
23
23
  <IndexName extends keyof TableInfo<WithName<IncludeSystemTables<Tables<DatabaseSchema_>>, TableName>>["indexes"]>(indexName: IndexName, ...indexFieldValues: _confect_core_Types0.IndexFieldTypesForEq<ToConvex<DataModel<IncludeSystemTables<Tables<DatabaseSchema_>>>>, TableName, TableInfo<WithName<IncludeSystemTables<Tables<DatabaseSchema_>>, TableName>>["indexes"][IndexName]>): effect_Effect0.Effect<TableInfo<WithName<IncludeSystemTables<Tables<DatabaseSchema_>>, TableName>>["document"], DocumentDecodeError | GetByIndexFailure, never>;
24
24
  };
25
25
  readonly index: {
@@ -32,7 +32,7 @@ declare const make: <DatabaseSchema_ extends AnyWithProps>(databaseSchema: Datab
32
32
  declare const DatabaseReader: <DatabaseSchema_ extends AnyWithProps>() => Context.Tag<{
33
33
  table: <const TableName extends Name<IncludeSystemTables<Tables<DatabaseSchema_>>>>(tableName: TableName) => {
34
34
  readonly get: {
35
- (id: convex_values0.GenericId<TableName>): effect_Effect0.Effect<TableInfo<WithName<IncludeSystemTables<Tables<DatabaseSchema_>>, TableName>>["document"], DocumentDecodeError | GetByIdFailure, never>;
35
+ (id: convex_values0.GenericId<TableName>): effect_Effect0.Effect<TableInfo<WithName<IncludeSystemTables<Tables<DatabaseSchema_>>, TableName>>["document"], GetByIdFailure | DocumentDecodeError, never>;
36
36
  <IndexName extends keyof TableInfo<WithName<IncludeSystemTables<Tables<DatabaseSchema_>>, TableName>>["indexes"]>(indexName: IndexName, ...indexFieldValues: _confect_core_Types0.IndexFieldTypesForEq<ToConvex<DataModel<IncludeSystemTables<Tables<DatabaseSchema_>>>>, TableName, TableInfo<WithName<IncludeSystemTables<Tables<DatabaseSchema_>>, TableName>>["indexes"][IndexName]>): effect_Effect0.Effect<TableInfo<WithName<IncludeSystemTables<Tables<DatabaseSchema_>>, TableName>>["document"], DocumentDecodeError | GetByIndexFailure, never>;
37
37
  };
38
38
  readonly index: {
@@ -44,7 +44,7 @@ declare const DatabaseReader: <DatabaseSchema_ extends AnyWithProps>() => Contex
44
44
  }, {
45
45
  table: <const TableName extends Name<IncludeSystemTables<Tables<DatabaseSchema_>>>>(tableName: TableName) => {
46
46
  readonly get: {
47
- (id: convex_values0.GenericId<TableName>): effect_Effect0.Effect<TableInfo<WithName<IncludeSystemTables<Tables<DatabaseSchema_>>, TableName>>["document"], DocumentDecodeError | GetByIdFailure, never>;
47
+ (id: convex_values0.GenericId<TableName>): effect_Effect0.Effect<TableInfo<WithName<IncludeSystemTables<Tables<DatabaseSchema_>>, TableName>>["document"], GetByIdFailure | DocumentDecodeError, never>;
48
48
  <IndexName extends keyof TableInfo<WithName<IncludeSystemTables<Tables<DatabaseSchema_>>, TableName>>["indexes"]>(indexName: IndexName, ...indexFieldValues: _confect_core_Types0.IndexFieldTypesForEq<ToConvex<DataModel<IncludeSystemTables<Tables<DatabaseSchema_>>>>, TableName, TableInfo<WithName<IncludeSystemTables<Tables<DatabaseSchema_>>, TableName>>["indexes"][IndexName]>): effect_Effect0.Effect<TableInfo<WithName<IncludeSystemTables<Tables<DatabaseSchema_>>, TableName>>["document"], DocumentDecodeError | GetByIndexFailure, never>;
49
49
  };
50
50
  readonly index: {
@@ -58,7 +58,7 @@ type DatabaseReader<DatabaseSchema_ extends AnyWithProps> = ReturnType<typeof Da
58
58
  declare const layer: <DatabaseSchema_ extends AnyWithProps>(databaseSchema: DatabaseSchema_, convexDatabaseReader: GenericDatabaseReader<ToConvex<FromSchema<DatabaseSchema_>>>) => Layer.Layer<{
59
59
  table: <const TableName extends Name<IncludeSystemTables<Tables<DatabaseSchema_>>>>(tableName: TableName) => {
60
60
  readonly get: {
61
- (id: convex_values0.GenericId<TableName>): effect_Effect0.Effect<TableInfo<WithName<IncludeSystemTables<Tables<DatabaseSchema_>>, TableName>>["document"], DocumentDecodeError | GetByIdFailure, never>;
61
+ (id: convex_values0.GenericId<TableName>): effect_Effect0.Effect<TableInfo<WithName<IncludeSystemTables<Tables<DatabaseSchema_>>, TableName>>["document"], GetByIdFailure | DocumentDecodeError, never>;
62
62
  <IndexName extends keyof TableInfo<WithName<IncludeSystemTables<Tables<DatabaseSchema_>>, TableName>>["indexes"]>(indexName: IndexName, ...indexFieldValues: _confect_core_Types0.IndexFieldTypesForEq<ToConvex<DataModel<IncludeSystemTables<Tables<DatabaseSchema_>>>>, TableName, TableInfo<WithName<IncludeSystemTables<Tables<DatabaseSchema_>>, TableName>>["indexes"][IndexName]>): effect_Effect0.Effect<TableInfo<WithName<IncludeSystemTables<Tables<DatabaseSchema_>>, TableName>>["document"], DocumentDecodeError | GetByIndexFailure, never>;
63
63
  };
64
64
  readonly index: {
@@ -61,8 +61,8 @@ declare const systemSchema: DatabaseSchema<Table<"_scheduled_functions", effect_
61
61
  kind: effect_Schema0.Literal<["canceled"]>;
62
62
  }>]>;
63
63
  }>, convex_values0.VObject<{
64
- name: string;
65
64
  args: any[];
65
+ name: string;
66
66
  scheduledTime: number;
67
67
  state: {
68
68
  kind: "pending";
@@ -71,15 +71,15 @@ declare const systemSchema: DatabaseSchema<Table<"_scheduled_functions", effect_
71
71
  } | {
72
72
  kind: "success";
73
73
  } | {
74
- kind: "failed";
75
74
  error: string;
75
+ kind: "failed";
76
76
  } | {
77
77
  kind: "canceled";
78
78
  };
79
79
  completedTime?: number;
80
80
  }, {
81
- name: convex_values0.VString<string, "required">;
82
81
  args: convex_values0.VArray<any[], convex_values0.VAny<any, "required", string>, "required">;
82
+ name: convex_values0.VString<string, "required">;
83
83
  scheduledTime: convex_values0.VFloat64<number, "required">;
84
84
  state: convex_values0.VUnion<{
85
85
  kind: "pending";
@@ -88,8 +88,8 @@ declare const systemSchema: DatabaseSchema<Table<"_scheduled_functions", effect_
88
88
  } | {
89
89
  kind: "success";
90
90
  } | {
91
- kind: "failed";
92
91
  error: string;
92
+ kind: "failed";
93
93
  } | {
94
94
  kind: "canceled";
95
95
  }, [convex_values0.VObject<{
@@ -105,18 +105,18 @@ declare const systemSchema: DatabaseSchema<Table<"_scheduled_functions", effect_
105
105
  }, {
106
106
  kind: convex_values0.VLiteral<"success", "required">;
107
107
  }, "required", "kind">, convex_values0.VObject<{
108
- kind: "failed";
109
108
  error: string;
109
+ kind: "failed";
110
110
  }, {
111
- kind: convex_values0.VLiteral<"failed", "required">;
112
111
  error: convex_values0.VString<string, "required">;
113
- }, "required", "kind" | "error">, convex_values0.VObject<{
112
+ kind: convex_values0.VLiteral<"failed", "required">;
113
+ }, "required", "error" | "kind">, convex_values0.VObject<{
114
114
  kind: "canceled";
115
115
  }, {
116
116
  kind: convex_values0.VLiteral<"canceled", "required">;
117
- }, "required", "kind">], "required", "kind" | "error">;
117
+ }, "required", "kind">], "required", "error" | "kind">;
118
118
  completedTime: convex_values0.VFloat64<number | undefined, "optional">;
119
- }, "required", "name" | "args" | "scheduledTime" | "completedTime" | "state" | "state.kind" | "state.error">, {}, {}, {}> | Table<"_storage", effect_Schema0.Struct<{
119
+ }, "required", "args" | "name" | "scheduledTime" | "completedTime" | "state" | "state.error" | "state.kind">, {}, {}, {}> | Table<"_storage", effect_Schema0.Struct<{
120
120
  sha256: typeof effect_Schema0.String;
121
121
  size: typeof effect_Schema0.Number;
122
122
  contentType: effect_Schema0.optionalWith<typeof effect_Schema0.String, {
@@ -1 +1 @@
1
- {"version":3,"file":"DatabaseS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YAAA,oBACN,UAAA,CAAW,eAAA,KAC3B,OAAA,CAAQ,MAAA,CAAO,eAAA;EAAA,SAA6B,IAAA,EAAM,SAAA;AAAA;;AA5CtD;;cAqFa,IAAA,QAAW,cAAA;AAAA,KAMZ,8BAAA,iBAA+C,cAAA,IACzD,MAAA,iBACgB,IAAA,CAAW,OAAA,aAAoB,QAAA,CAC3C,OAAA,EACA,SAAA;AAAA,cAMO,YAAA,EAAY,cAAA,CAAA,KAAA,wCAAA,MAAA;eAEM,cAAA,CAAA,MAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qCAFN,cAAA,CAAA,IAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAA,cAAA,CAAA,MAAA;;;;;;;;;;;;;;cAIZ,sBAAA,mBAA0C,cAAA,EACrD,MAAA,EAAQ,YAAA,CAAmB,OAAA,MAC1B,sBAAA,CAAuB,OAAA;AAAA,KAMd,sBAAA,iBAAuC,cAAA,IACjD,YAAA,CAAmB,OAAA,GAAU,YAAA;AAAA,KAEnB,mBAAA,iBAAoC,cAAA,IAC5C,OAAA,GACA,YAAA,mBACA,CAAA,SAAU,cAAA,GACR,CAAA"}
@@ -13,7 +13,7 @@ declare namespace DatabaseWriter_d_exports {
13
13
  declare const make: <DatabaseSchema_ extends AnyWithProps>(databaseSchema: DatabaseSchema_, convexDatabaseWriter: GenericDatabaseWriter<ToConvex<FromSchema<DatabaseSchema_>>>) => {
14
14
  table: <const TableName extends TableNames<FromSchema<DatabaseSchema_>>>(tableName: TableName) => {
15
15
  insert: (document: WithoutSystemFields$1<DocumentByName<FromSchema<DatabaseSchema_>, TableName>>) => Effect.Effect<GenericId<TableName>, DocumentEncodeError, never>;
16
- patch: (id: GenericId<TableName>, patchedValues: Partial<WithoutSystemFields<DocumentByName<FromSchema<DatabaseSchema_>, TableName>>>) => Effect.Effect<void, DocumentDecodeError | GetByIdFailure | DocumentEncodeError, never>;
16
+ patch: (id: GenericId<TableName>, patchedValues: Partial<WithoutSystemFields<DocumentByName<FromSchema<DatabaseSchema_>, TableName>>>) => Effect.Effect<void, GetByIdFailure | DocumentDecodeError | DocumentEncodeError, never>;
17
17
  replace: (id: GenericId<TableName>, value: WithoutSystemFields<DocumentByName<FromSchema<DatabaseSchema_>, TableName>>) => Effect.Effect<void, DocumentEncodeError, never>;
18
18
  delete: (id: GenericId<TableName>) => Effect.Effect<void, never, never>;
19
19
  };
@@ -21,14 +21,14 @@ declare const make: <DatabaseSchema_ extends AnyWithProps>(databaseSchema: Datab
21
21
  declare const DatabaseWriter: <DatabaseSchema_ extends AnyWithProps>() => Context.Tag<{
22
22
  table: <const TableName extends TableNames<FromSchema<DatabaseSchema_>>>(tableName: TableName) => {
23
23
  insert: (document: WithoutSystemFields$1<DocumentByName<FromSchema<DatabaseSchema_>, TableName>>) => Effect.Effect<GenericId<TableName>, DocumentEncodeError, never>;
24
- patch: (id: GenericId<TableName>, patchedValues: Partial<Expand<BetterOmit<DocumentByName<FromSchema<DatabaseSchema_>, TableName>, "_id" | "_creationTime">>>) => Effect.Effect<void, DocumentDecodeError | GetByIdFailure | DocumentEncodeError, never>;
24
+ patch: (id: GenericId<TableName>, patchedValues: Partial<Expand<BetterOmit<DocumentByName<FromSchema<DatabaseSchema_>, TableName>, "_id" | "_creationTime">>>) => Effect.Effect<void, GetByIdFailure | DocumentDecodeError | DocumentEncodeError, never>;
25
25
  replace: (id: GenericId<TableName>, value: Expand<BetterOmit<DocumentByName<FromSchema<DatabaseSchema_>, TableName>, "_id" | "_creationTime">>) => Effect.Effect<void, DocumentEncodeError, never>;
26
26
  delete: (id: GenericId<TableName>) => Effect.Effect<void, never, never>;
27
27
  };
28
28
  }, {
29
29
  table: <const TableName extends TableNames<FromSchema<DatabaseSchema_>>>(tableName: TableName) => {
30
30
  insert: (document: WithoutSystemFields$1<DocumentByName<FromSchema<DatabaseSchema_>, TableName>>) => Effect.Effect<GenericId<TableName>, DocumentEncodeError, never>;
31
- patch: (id: GenericId<TableName>, patchedValues: Partial<Expand<BetterOmit<DocumentByName<FromSchema<DatabaseSchema_>, TableName>, "_id" | "_creationTime">>>) => Effect.Effect<void, DocumentDecodeError | GetByIdFailure | DocumentEncodeError, never>;
31
+ patch: (id: GenericId<TableName>, patchedValues: Partial<Expand<BetterOmit<DocumentByName<FromSchema<DatabaseSchema_>, TableName>, "_id" | "_creationTime">>>) => Effect.Effect<void, GetByIdFailure | DocumentDecodeError | DocumentEncodeError, never>;
32
32
  replace: (id: GenericId<TableName>, value: Expand<BetterOmit<DocumentByName<FromSchema<DatabaseSchema_>, TableName>, "_id" | "_creationTime">>) => Effect.Effect<void, DocumentEncodeError, never>;
33
33
  delete: (id: GenericId<TableName>) => Effect.Effect<void, never, never>;
34
34
  };
@@ -37,7 +37,7 @@ type DatabaseWriter<DatabaseSchema_ extends AnyWithProps> = ReturnType<typeof Da
37
37
  declare const layer: <DatabaseSchema_ extends AnyWithProps>(databaseSchema: DatabaseSchema_, convexDatabaseWriter: GenericDatabaseWriter<ToConvex<FromSchema<DatabaseSchema_>>>) => Layer.Layer<{
38
38
  table: <const TableName extends TableNames<FromSchema<DatabaseSchema_>>>(tableName: TableName) => {
39
39
  insert: (document: WithoutSystemFields$1<DocumentByName<FromSchema<DatabaseSchema_>, TableName>>) => Effect.Effect<GenericId<TableName>, DocumentEncodeError, never>;
40
- patch: (id: GenericId<TableName>, patchedValues: Partial<Expand<BetterOmit<DocumentByName<FromSchema<DatabaseSchema_>, TableName>, "_id" | "_creationTime">>>) => Effect.Effect<void, DocumentDecodeError | GetByIdFailure | DocumentEncodeError, never>;
40
+ patch: (id: GenericId<TableName>, patchedValues: Partial<Expand<BetterOmit<DocumentByName<FromSchema<DatabaseSchema_>, TableName>, "_id" | "_creationTime">>>) => Effect.Effect<void, GetByIdFailure | DocumentDecodeError | DocumentEncodeError, never>;
41
41
  replace: (id: GenericId<TableName>, value: Expand<BetterOmit<DocumentByName<FromSchema<DatabaseSchema_>, TableName>, "_id" | "_creationTime">>) => Effect.Effect<void, DocumentEncodeError, never>;
42
42
  delete: (id: GenericId<TableName>) => Effect.Effect<void, never, never>;
43
43
  };
@@ -1 +1 @@
1
- {"version":3,"file":"DatabaseWriter.d.ts","names":[],"sources":["../src/DatabaseWriter.ts"],"mappings":";;;;;;;;;;;;cAiBa,IAAA,2BAAgC,YAAA,EAC3C,cAAA,EAAgB,eAAA,EAChB,oBAAA,EAAsB,qBAAA,CACpB,QAAA,CAAmB,UAAA,CAAqB,eAAA;kCAMH,UAAA,CAAoB,UAAA,CAAA,eAAA,IAAY,SAAA,EAC1D,SAAA;uBAQC,qBAAA,CACR,cAAA,CAAe,UAAA,CAAA,eAAA,GAAa,SAAA,OAC7B,MAAA,CAAA,MAAA,CAAA,SAAA,CAAA,SAAA,GAAA,mBAAA;gBAsBG,SAAA,CAAU,SAAA,GAAU,aAAA,EACT,OAAA,CACb,mBAAA,CAAoB,cAAA,CAAe,UAAA,CAAA,eAAA,GAAa,SAAA,QACjD,MAAA,CAAA,MAAA,OAAA,mBAAA,GAAA,cAAA,GAAA,mBAAA;kBAiCG,SAAA,CAAU,SAAA,GAAU,KAAA,EACjB,mBAAA,CAAoB,cAAA,CAAe,UAAA,CAAA,eAAA,GAAa,SAAA,OAAW,MAAA,CAAA,MAAA,OAAA,mBAAA;iBAsB/C,SAAA,CAAU,SAAA,MAAU,MAAA,CAAA,MAAA;EAAA;AAAA;AAAA,cAgBhC,cAAA,2BACa,YAAA,OAA2B,OAAA,CAAA,GAAA;kCA7GrB,UAAA,CAAA,UAAA,CAAA,eAAA,IAAA,SAAA,EAAA,SAAA;;;;;;;kCAAA,UAAA,CAAA,UAAA,CAAA,eAAA,IAAA,SAAA,EAAA,SAAA;;;;;;;KAmHpB,cAAA,yBACc,YAAA,IACtB,UAAA,QAAkB,cAAA,CAAe,eAAA;AAAA,cAExB,KAAA,2BAAiC,YAAA,EAC5C,cAAA,EAAgB,eAAA,EAChB,oBAAA,EAAsB,qBAAA,CACpB,QA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AA,CACpB,QAAA,CAAmB,UAAA,CAAqB,eAAA,QACzC,KAAA,CAAA,KAAA;kCA3H6B,UAAA,CAAA,UAAA,CAAA,eAAA,IAAA,SAAA,EAAA,SAAA"}
@@ -1,8 +1,8 @@
1
1
  import { AnyWithProps, Schema as Schema$1 } from "./Api.js";
2
2
  import { WithName } from "./Handler.js";
3
3
  import { Context, Layer } from "effect";
4
- import * as FunctionSpec from "@confect/core/FunctionSpec";
5
4
  import * as GroupSpec from "@confect/core/GroupSpec";
5
+ import * as FunctionSpec from "@confect/core/FunctionSpec";
6
6
 
7
7
  //#region src/FunctionImpl.d.ts
8
8
  declare namespace FunctionImpl_d_exports {
@@ -1 +1 @@
1
- {"version":3,"file":"FunctionImpl.d.ts","names":[],"sources":["../src/FunctionImpl.ts"],"mappings":";;;;;;;;;;UAUiB,YAAA;EAAA,SAIN,SAAA,EAAW,UAAA;EAAA,SACX,YAAA,EAAc,YAAA;AAAA;AAAA,cAGZ,YAAA;EAGX,SAAA;EAAA;AAAA;EAIA,SAAA,EAAW,UAAA;EACX,YAAA,EAAc,YAAA;AAAA,MACf,OAAA,CAAA,GAAA,CAAA,YAAA,CAAA,UAAA,EAAA,YAAA,GAAA,YAAA,CAAA,UAAA,EAAA,YAAA;AAAA,cAKY,IAAA,gBACE,YAAA,gBACC,SAAA,CAAU,YAAA,6BACG,YAAA,CAAa,IAAA,CAAK,SAAA,CAAU,SAAA,CAAU,KAAA,IAEjE,GAAA,EAAK,IAAA,EACL,KAAA,EAAO,KAAA,EACP,YAAA,EAAc,YAAA,EACd,OAAA,EAAS,QAAA,CACP,QAAA,CAAW,IAAA,GACX,SAAA,CAAU,SAAA,CAAU,KAAA,GACpB,YAAA,MAED,KAAA,CAAM,KAAA,CAAM,YAAA,SAAqB,YAAA;;AAnCpC;;KAqEY,uBAAA,2DAGR,YAAA,CAAa,UAAA,EAAY,YAAA;;;;KAKjB,aAAA,eAA4B,SAAA,CAAU,YAAA,IAChD,YAAA,CAAa,IAAA,CACX,SAAA,CAAU,SAAA,CAAU,KAAA,gDAElB,aAAA,kBACE,YAAA,SAAqB,aAAA;;;;KAOjB,eAAA,0CAEI,SAAA,CAAU,YAAA,IACtB,aAAA,CAAc,KAAA"}
1
+ {"version":3,"file":"FunctionImpl.d.ts","names":[],"sources":["../src/FunctionImpl.ts"],"mappings":";;;;;;;;;;UASiB,YAAA;EAAA,SAIN,SAAA,EAAW,UAAA;EAAA,SACX,YAAA,EAAc,YAAA;AAAA;AAAA,cAGZ,YAAA;EAGX,SAAA;EAAA;AAAA;EAIA,SAAA,EAAW,UAAA;EACX,YAAA,EAAc,YAAA;AAAA,MACf,OAAA,CAAA,GAAA,CAAA,YAAA,CAAA,UAAA,EAAA,YAAA,GAAA,YAAA,CAAA,UAAA,EAAA,YAAA;AAAA,cAKY,IAAA,gBACE,YAAA,gBACC,SAAA,CAAU,YAAA,6BACG,YAAA,CAAa,IAAA,CAAK,SAAA,CAAU,SAAA,CAAU,KAAA,IAEjE,GAAA,EAAK,IAAA,EACL,KAAA,EAAO,KAAA,EACP,YAAA,EAAc,YAAA,EACd,OAAA,EAAS,QAAA,CACP,QAAA,CAAW,IAAA,GACX,SAAA,CAAU,SAAA,CAAU,KAAA,GACpB,YAAA,MAED,KAAA,CAAM,KAAA,CAAM,YAAA,SAAqB,YAAA;;AAnCpC;;KAqEY,uBAAA,2DAGR,YAAA,CAAa,UAAA,EAAY,YAAA;;;;KAKjB,aAAA,eAA4B,SAAA,CAAU,YAAA,IAChD,YAAA,CAAa,IAAA,CACX,SAAA,CAAU,SAAA,CAAU,KAAA,gDAElB,aAAA,kBACE,YAAA,SAAqB,aAAA;;;;KAOjB,eAAA,0CAEI,SAAA,CAAU,YAAA,IACtB,aAAA,CAAc,KAAA"}
@@ -1,5 +1,5 @@
1
1
  import { __exportAll } from "./_virtual/_rolldown/runtime.js";
2
- import { resolveGroupPathUnsafe } from "./GroupPath.js";
2
+ import { resolveGroupPathUnsafe } from "./Api.js";
3
3
  import { setNestedProperty } from "./internal/utils.js";
4
4
  import { make as make$1 } from "./RegistryItem.js";
5
5
  import { Context, Effect, Layer, Ref, String } from "effect";
@@ -12,7 +12,7 @@ var FunctionImpl_exports = /* @__PURE__ */ __exportAll({
12
12
  });
13
13
  const FunctionImpl = ({ groupPath, functionName }) => Context.GenericTag(`@confect/server/FunctionImpl/${groupPath}/${functionName}`);
14
14
  const make = (api, group, functionName, handler) => {
15
- const groupPath = resolveGroupPathUnsafe(api.spec, group);
15
+ const groupPath = resolveGroupPathUnsafe(api, group);
16
16
  const functionSpec = group.functions[functionName];
17
17
  return Layer.effect(FunctionImpl({
18
18
  groupPath,
@@ -1 +1 @@
1
- {"version":3,"file":"FunctionImpl.js","names":["RegistryItem.make"],"sources":["../src/FunctionImpl.ts"],"sourcesContent":["import type * as FunctionSpec from \"@confect/core/FunctionSpec\";\nimport type * as GroupSpec from \"@confect/core/GroupSpec\";\nimport * as Registry from \"@confect/core/Registry\";\nimport { Context, Effect, Layer, Ref, String } from \"effect\";\nimport type * as Api from \"./Api\";\nimport { resolveGroupPathUnsafe } from \"./GroupPath\";\nimport type * as Handler from \"./Handler\";\nimport { setNestedProperty } from \"./internal/utils\";\nimport * as RegistryItem from \"./RegistryItem\";\n\nexport interface FunctionImpl<\n GroupPath_ extends string,\n FunctionName extends string,\n> {\n readonly groupPath: GroupPath_;\n readonly functionName: FunctionName;\n}\n\nexport const FunctionImpl = <\n GroupPath_ extends string,\n FunctionName extends string,\n>({\n groupPath,\n functionName,\n}: {\n groupPath: GroupPath_;\n functionName: FunctionName;\n}) =>\n Context.GenericTag<FunctionImpl<GroupPath_, FunctionName>>(\n `@confect/server/FunctionImpl/${groupPath}/${functionName}`,\n );\n\nexport const make = <\n Api_ extends Api.AnyWithProps,\n Group extends GroupSpec.AnyWithProps,\n const FunctionName extends FunctionSpec.Name<GroupSpec.Functions<Group>>,\n>(\n api: Api_,\n group: Group,\n functionName: FunctionName,\n handler: Handler.WithName<\n Api.Schema<Api_>,\n GroupSpec.Functions<Group>,\n FunctionName\n >,\n): Layer.Layer<FunctionImpl<string, FunctionName>> => {\n const groupPath = resolveGroupPathUnsafe(api.spec, group);\n const functionSpec = group.functions[functionName]!;\n\n return Layer.effect(\n FunctionImpl<string, FunctionName>({\n groupPath,\n functionName,\n }),\n Effect.gen(function* () {\n const registry = yield* Registry.Registry;\n\n yield* Ref.update(registry, (registryItems) =>\n setNestedProperty(\n registryItems,\n [...String.split(groupPath, \".\"), functionName],\n RegistryItem.make({\n functionSpec,\n handler,\n }),\n ),\n );\n\n return {\n groupPath,\n functionName,\n };\n }),\n );\n};\n\n/**\n * Get the function implementation service type for a specific group path and function name.\n */\nexport type ForGroupPathAndFunction<\n GroupPath_ extends string,\n FunctionName extends string,\n> = FunctionImpl<GroupPath_, FunctionName>;\n\n/**\n * Get all function implementation services required for a group spec.\n */\nexport type FromGroupSpec<Group extends GroupSpec.AnyWithProps> =\n FunctionSpec.Name<\n GroupSpec.Functions<Group>\n > extends infer FunctionNames extends string\n ? FunctionNames extends string\n ? FunctionImpl<string, FunctionNames>\n : never\n : never;\n\n/**\n * @deprecated Use {@link FromGroupSpec} instead.\n */\nexport type FromGroupAtPath<\n _GroupPath extends string,\n Group extends GroupSpec.AnyWithProps,\n> = FromGroupSpec<Group>;\n"],"mappings":";;;;;;;;;;;;AAkBA,MAAa,gBAGX,EACA,WACA,mBAKA,QAAQ,WACN,gCAAgC,UAAU,GAAG,eAC9C;AAEH,MAAa,QAKX,KACA,OACA,cACA,YAKoD;CACpD,MAAM,YAAY,uBAAuB,IAAI,MAAM,MAAM;CACzD,MAAM,eAAe,MAAM,UAAU;AAErC,QAAO,MAAM,OACX,aAAmC;EACjC;EACA;EACD,CAAC,EACF,OAAO,IAAI,aAAa;EACtB,MAAM,WAAW,OAAO,SAAS;AAEjC,SAAO,IAAI,OAAO,WAAW,kBAC3B,kBACE,eACA,CAAC,GAAG,OAAO,MAAM,WAAW,IAAI,EAAE,aAAa,EAC/CA,OAAkB;GAChB;GACA;GACD,CAAC,CACH,CACF;AAED,SAAO;GACL;GACA;GACD;GACD,CACH"}
1
+ {"version":3,"file":"FunctionImpl.js","names":["Api.resolveGroupPathUnsafe","RegistryItem.make"],"sources":["../src/FunctionImpl.ts"],"sourcesContent":["import type * as FunctionSpec from \"@confect/core/FunctionSpec\";\nimport type * as GroupSpec from \"@confect/core/GroupSpec\";\nimport * as Registry from \"@confect/core/Registry\";\nimport { Context, Effect, Layer, Ref, String } from \"effect\";\nimport * as Api from \"./Api\";\nimport type * as Handler from \"./Handler\";\nimport { setNestedProperty } from \"./internal/utils\";\nimport * as RegistryItem from \"./RegistryItem\";\n\nexport interface FunctionImpl<\n GroupPath_ extends string,\n FunctionName extends string,\n> {\n readonly groupPath: GroupPath_;\n readonly functionName: FunctionName;\n}\n\nexport const FunctionImpl = <\n GroupPath_ extends string,\n FunctionName extends string,\n>({\n groupPath,\n functionName,\n}: {\n groupPath: GroupPath_;\n functionName: FunctionName;\n}) =>\n Context.GenericTag<FunctionImpl<GroupPath_, FunctionName>>(\n `@confect/server/FunctionImpl/${groupPath}/${functionName}`,\n );\n\nexport const make = <\n Api_ extends Api.AnyWithProps,\n Group extends GroupSpec.AnyWithProps,\n const FunctionName extends FunctionSpec.Name<GroupSpec.Functions<Group>>,\n>(\n api: Api_,\n group: Group,\n functionName: FunctionName,\n handler: Handler.WithName<\n Api.Schema<Api_>,\n GroupSpec.Functions<Group>,\n FunctionName\n >,\n): Layer.Layer<FunctionImpl<string, FunctionName>> => {\n const groupPath = Api.resolveGroupPathUnsafe(api, group);\n const functionSpec = group.functions[functionName]!;\n\n return Layer.effect(\n FunctionImpl<string, FunctionName>({\n groupPath,\n functionName,\n }),\n Effect.gen(function* () {\n const registry = yield* Registry.Registry;\n\n yield* Ref.update(registry, (registryItems) =>\n setNestedProperty(\n registryItems,\n [...String.split(groupPath, \".\"), functionName],\n RegistryItem.make({\n functionSpec,\n handler,\n }),\n ),\n );\n\n return {\n groupPath,\n functionName,\n };\n }),\n );\n};\n\n/**\n * Get the function implementation service type for a specific group path and function name.\n */\nexport type ForGroupPathAndFunction<\n GroupPath_ extends string,\n FunctionName extends string,\n> = FunctionImpl<GroupPath_, FunctionName>;\n\n/**\n * Get all function implementation services required for a group spec.\n */\nexport type FromGroupSpec<Group extends GroupSpec.AnyWithProps> =\n FunctionSpec.Name<\n GroupSpec.Functions<Group>\n > extends infer FunctionNames extends string\n ? FunctionNames extends string\n ? FunctionImpl<string, FunctionNames>\n : never\n : never;\n\n/**\n * @deprecated Use {@link FromGroupSpec} instead.\n */\nexport type FromGroupAtPath<\n _GroupPath extends string,\n Group extends GroupSpec.AnyWithProps,\n> = FromGroupSpec<Group>;\n"],"mappings":";;;;;;;;;;;;AAiBA,MAAa,gBAGX,EACA,WACA,mBAKA,QAAQ,WACN,gCAAgC,UAAU,GAAG,eAC9C;AAEH,MAAa,QAKX,KACA,OACA,cACA,YAKoD;CACpD,MAAM,YAAYA,uBAA2B,KAAK,MAAM;CACxD,MAAM,eAAe,MAAM,UAAU;AAErC,QAAO,MAAM,OACX,aAAmC;EACjC;EACA;EACD,CAAC,EACF,OAAO,IAAI,aAAa;EACtB,MAAM,WAAW,OAAO,SAAS;AAEjC,SAAO,IAAI,OAAO,WAAW,kBAC3B,kBACE,eACA,CAAC,GAAG,OAAO,MAAM,WAAW,IAAI,EAAE,aAAa,EAC/CC,OAAkB;GAChB;GACA;GACD,CAAC,CACH,CACF;AAED,SAAO;GACL;GACA;GACD;GACD,CACH"}
@@ -1 +1 @@
1
- {"version":3,"file":"GroupImpl.d.ts","names":[],"sources":["../src/GroupImpl.ts"],"mappings":";;;;;;;;;cAkBa,MAAA;AAAA,KACD,MAAA,UAAgB,MAAA;AAAA,KAEhB,kBAAA;AAAA,UAEK,SAAA,wDAEa,kBAAA;EAAA,UAElB,MAAA,GAAS,MAAA;EAAA,SACV,SAAA,EAAW,UAAA;EAAA,SACX,kBAAA,EAAoB,mBAAA;;;;;;;WAOpB,uBAAA,EAAyB,a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kBAAA;AAAA,cAElC,WAAA,GAAe,CAAA,cAAa,CAAA,IAAK,GAAA;AAAA,UAG7B,YAAA,SAAqB,SAAA;AAAA,UACrB,cAAA,SAAuB,SAAA;AAAA,cAE3B,oBAAA,GAAwB,CAAA,cAAa,CAAA,IAAK,YAAA;AAAA,cAG1C,sBAAA,GAA0B,CAAA,cAAa,CAAA,IAAK,cAAA;;;;AA7BzD;;;;cAuCa,SAAA,0DAEiB,kBAAA;EAC5B,SAAA;EAAA;AAAA;EAIA,SAAA,EAAW,UAAA;EACX,kBAAA,EAAoB,mBAAA;AAAA,MACrB,OAAA,CAAA,GAAA,CAAA,SAAA,CAAA,UAAA,EAAA,mBAAA,GAAA,SAAA,CAAA,UAAA,EAAA,mBAAA;AAAA,cAKY,IAAA,gBACE,YAAA,gBACC,SAAA,CAAU,YAAA,EAExB,GAAA,EAAK,IAAA,EACL,KAAA,EAAO,KAAA,KACN,KAAA,CAAM,KAAA,CACP,SAAA,gCAEA,eAAA,CAA2B,KAAA;;;;;;;;;;;;;;cAuEhB,QAAA,8BACX,KAAA,EAAO,KAAA,CAAM,KAAA,CAAM,SAAA,CAAU,UAAA,sBAC5B,KAAA,CAAM,KAAA,CAAM,SAAA,CAAU,UAAA;AAAA,KAsCb,aAAA,eAA4B,SAAA,CAAU,YAAA,IAChD,eAAA,CAA2B,KAAA"}
package/dist/GroupImpl.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { __exportAll } from "./_virtual/_rolldown/runtime.js";
2
- import { resolveGroupPathUnsafe } from "./GroupPath.js";
2
+ import { resolveGroupPathUnsafe } from "./Api.js";
3
3
  import { Array, Context, Effect, Layer, Option, Predicate, Record, Ref, String, pipe } from "effect";
4
4
  import * as Registry from "@confect/core/Registry";
5
5
 
@@ -26,7 +26,7 @@ const isUnfinalizedGroupImpl = (u) => isGroupImpl(u) && u.finalizationStatus ===
26
26
  */
27
27
  const GroupImpl = ({ groupPath, finalizationStatus }) => Context.GenericTag(`@confect/server/GroupImpl/${finalizationStatus}/${groupPath}`);
28
28
  const make = (api, group) => {
29
- const groupPath = resolveGroupPathUnsafe(api.spec, group);
29
+ const groupPath = resolveGroupPathUnsafe(api, group);
30
30
  return Layer.succeed(GroupImpl({
31
31
  groupPath,
32
32
  finalizationStatus: "Unfinalized"
@@ -1 +1 @@
1
- {"version":3,"file":"GroupImpl.js","names":[],"sources":["../src/GroupImpl.ts"],"sourcesContent":["import type * as GroupSpec from \"@confect/core/GroupSpec\";\nimport * as Registry from \"@confect/core/Registry\";\nimport {\n Array,\n Context,\n Effect,\n Layer,\n Option,\n pipe,\n Predicate,\n Record,\n Ref,\n String,\n} from \"effect\";\nimport type * as Api from \"./Api\";\nimport type * as FunctionImpl from \"./FunctionImpl\";\nimport { resolveGroupPathUnsafe } from \"./GroupPath\";\n\nexport const TypeId = \"@confect/server/GroupImpl\";\nexport type TypeId = typeof TypeId;\n\nexport type FinalizationStatus = \"Unfinalized\" | \"Finalized\";\n\nexport interface GroupImpl<\n GroupPath_ extends string,\n FinalizationStatus_ extends FinalizationStatus = \"Unfinalized\",\n> {\n readonly [TypeId]: TypeId;\n readonly groupPath: GroupPath_;\n readonly finalizationStatus: FinalizationStatus_;\n /**\n * Names of every function registered into this group's layer scope by\n * `FunctionImpl.make`. Authoritative only when `finalizationStatus` is\n * `\"Finalized\"`; the `\"Unfinalized\"` value is set to `[]` at `make`-time\n * since the list is only known once `finalize` snapshots the registry.\n */\n readonly registeredFunctionNames: ReadonlyArray<string>;\n}\n\nexport interface Any extends GroupImpl<string, FinalizationStatus> {}\n\nexport const isGroupImpl = (u: unknown): u is Any =>\n Predicate.hasProperty(u, TypeId);\n\nexport interface AnyFinalized extends GroupImpl<string, \"Finalized\"> {}\nexport interface AnyUnfinalized extends GroupImpl<string, \"Unfinalized\"> {}\n\nexport const isFinalizedGroupImpl = (u: unknown): u is AnyFinalized =>\n isGroupImpl(u) && u.finalizationStatus === \"Finalized\";\n\nexport const isUnfinalizedGroupImpl = (u: unknown): u is AnyUnfinalized =>\n isGroupImpl(u) && u.finalizationStatus === \"Unfinalized\";\n\n/**\n * Build the runtime tag for a `GroupImpl` service. The finalization status is\n * embedded in the tag string so that `Unfinalized` and `Finalized` are distinct\n * services at runtime; consumers of a finalized layer (the server's\n * `RegisteredFunctions.buildForGroup` and the CLI's `implValidation`) retrieve\n * the typed `Finalized` service directly rather than scanning the context.\n */\nexport const GroupImpl = <\n GroupPath_ extends string,\n FinalizationStatus_ extends FinalizationStatus,\n>({\n groupPath,\n finalizationStatus,\n}: {\n groupPath: GroupPath_;\n finalizationStatus: FinalizationStatus_;\n}) =>\n Context.GenericTag<GroupImpl<GroupPath_, FinalizationStatus_>>(\n `@confect/server/GroupImpl/${finalizationStatus}/${groupPath}`,\n );\n\nexport const make = <\n Api_ extends Api.AnyWithProps,\n Group extends GroupSpec.AnyWithProps,\n>(\n api: Api_,\n group: Group,\n): Layer.Layer<\n GroupImpl<string, \"Unfinalized\">,\n never,\n FunctionImpl.FromGroupSpec<Group>\n> => {\n const groupPath = resolveGroupPathUnsafe(api.spec, group);\n\n return Layer.succeed(\n GroupImpl<string, \"Unfinalized\">({\n groupPath,\n finalizationStatus: \"Unfinalized\",\n }),\n {\n [TypeId]: TypeId,\n groupPath,\n finalizationStatus: \"Unfinalized\" as const,\n registeredFunctionNames: [],\n },\n ) as Layer.Layer<\n GroupImpl<string, \"Unfinalized\">,\n never,\n FunctionImpl.FromGroupSpec<Group>\n >;\n};\n\nconst isFunctionShaped = (value: unknown): boolean =>\n Predicate.isRecord(value) && \"functionSpec\" in value;\n\n/**\n * Walk a `RegistryItems` tree to the entries at `groupPath` and return the\n * names of the function-shaped leaves directly underneath.\n */\nconst collectFunctionNamesAtPath = (\n items: Registry.RegistryItems,\n groupPath: string,\n): ReadonlyArray<string> =>\n pipe(\n String.split(groupPath, \".\"),\n Array.reduce(Option.some<unknown>(items), (acc, segment) =>\n acc.pipe(\n Option.filter(Predicate.isRecord),\n Option.flatMap((node) =>\n segment in node ? Option.some(node[segment]) : Option.none(),\n ),\n ),\n ),\n Option.filter(Predicate.isRecord),\n Option.map(Record.toEntries),\n Option.map(\n Array.filterMap(([name, value]) =>\n isFunctionShaped(value) ? Option.some(name) : Option.none(),\n ),\n ),\n Option.getOrElse((): ReadonlyArray<string> => []),\n );\n\nconst findUnfinalizedGroupImpl = <S>(\n context: Context.Context<S>,\n): Option.Option<AnyUnfinalized> =>\n Array.findFirst(context.unsafeMap.values(), isUnfinalizedGroupImpl);\n\n/**\n * Mark a `GroupImpl` layer as fully implemented. The parameter type defaults\n * `RIn = never`, so passing a layer that still requires any `FunctionImpl`\n * service produces a type error at the impl author's site. The codegen\n * boundary requires the resulting `\"Finalized\"` brand, so omitting this call\n * is also rejected downstream.\n *\n * As a side effect of finalization, the names of every `FunctionImpl` that\n * registered into this group's scope are snapshotted onto the produced\n * service value's `registeredFunctionNames` field, so consumers can verify\n * impl completeness against a `GroupSpec`'s expected functions without\n * having to inspect the `Registry` themselves.\n */\nexport const finalize = <GroupPath_ extends string>(\n group: Layer.Layer<GroupImpl<GroupPath_, \"Unfinalized\">>,\n): Layer.Layer<GroupImpl<GroupPath_, \"Finalized\">> =>\n Layer.flatMap(\n group,\n (context): Layer.Layer<GroupImpl<GroupPath_, \"Finalized\">> =>\n findUnfinalizedGroupImpl(context).pipe(\n Option.match({\n onNone: () =>\n Layer.die(\n new Error(\n \"GroupImpl.finalize: no Unfinalized GroupImpl service was found in the layer's context.\",\n ),\n ),\n onSome: (unfinalized) => {\n const groupPath = unfinalized.groupPath as GroupPath_;\n return Layer.effect(\n GroupImpl<GroupPath_, \"Finalized\">({\n groupPath,\n finalizationStatus: \"Finalized\",\n }),\n Effect.gen(function* () {\n const registry = yield* Registry.Registry;\n const items = yield* Ref.get(registry);\n return {\n [TypeId]: TypeId,\n groupPath,\n finalizationStatus: \"Finalized\" as const,\n registeredFunctionNames: collectFunctionNamesAtPath(\n items,\n groupPath,\n ),\n };\n }),\n );\n },\n }),\n ),\n );\n\nexport type F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,QAAQ,CAAC,KAChC,OAAO,MAAM;CACX,cACE,MAAM,oBACJ,IAAI,MACF,yFACD,CACF;CACH,SAAS,gBAAgB;EACvB,MAAM,YAAY,YAAY;AAC9B,SAAO,MAAM,OACX,UAAmC;GACjC;GACA,oBAAoB;GACrB,CAAC,EACF,OAAO,IAAI,aAAa;GACtB,MAAM,WAAW,OAAO,SAAS;GACjC,MAAM,QAAQ,OAAO,IAAI,IAAI,SAAS;AACtC,UAAO;KACJ,SAAS;IACV;IACA,oBAAoB;IACpB,yBAAyB,2BACvB,OACA,UACD;IACF;IACD,CACH;;CAEJ,CAAC,CACH,CACJ"}
1
+ {"version":3,"file":"GroupImpl.js","names":["Api.resolveGroupPathUnsafe"],"sources":["../src/GroupImpl.ts"],"sourcesContent":["import type * as GroupSpec from \"@confect/core/GroupSpec\";\nimport * as Registry from \"@confect/core/Registry\";\nimport {\n Array,\n Context,\n Effect,\n Layer,\n Option,\n pipe,\n Predicate,\n Record,\n Ref,\n String,\n} from \"effect\";\nimport * as Api from \"./Api\";\nimport type * as FunctionImpl from \"./FunctionImpl\";\n\nexport const TypeId = \"@confect/server/GroupImpl\";\nexport type TypeId = typeof TypeId;\n\nexport type FinalizationStatus = \"Unfinalized\" | \"Finalized\";\n\nexport interface GroupImpl<\n GroupPath_ extends string,\n FinalizationStatus_ extends FinalizationStatus = \"Unfinalized\",\n> {\n readonly [TypeId]: TypeId;\n readonly groupPath: GroupPath_;\n readonly finalizationStatus: FinalizationStatus_;\n /**\n * Names of every function registered into this group's layer scope by\n * `FunctionImpl.make`. Authoritative only when `finalizationStatus` is\n * `\"Finalized\"`; the `\"Unfinalized\"` value is set to `[]` at `make`-time\n * since the list is only known once `finalize` snapshots the registry.\n */\n readonly registeredFunctionNames: ReadonlyArray<string>;\n}\n\nexport interface Any extends GroupImpl<string, FinalizationStatus> {}\n\nexport const isGroupImpl = (u: unknown): u is Any =>\n Predicate.hasProperty(u, TypeId);\n\nexport interface AnyFinalized extends GroupImpl<string, \"Finalized\"> {}\nexport interface AnyUnfinalized extends GroupImpl<string, \"Unfinalized\"> {}\n\nexport const isFinalizedGroupImpl = (u: unknown): u is AnyFinalized =>\n isGroupImpl(u) && u.finalizationStatus === \"Finalized\";\n\nexport const isUnfinalizedGroupImpl = (u: unknown): u is AnyUnfinalized =>\n isGroupImpl(u) && u.finalizationStatus === \"Unfinalized\";\n\n/**\n * Build the runtime tag for a `GroupImpl` service. The finalization status is\n * embedded in the tag string so that `Unfinalized` and `Finalized` are distinct\n * services at runtime; consumers of a finalized layer (the server's\n * `RegisteredFunctions.buildForGroup` and the CLI's `implValidation`) retrieve\n * the typed `Finalized` service directly rather than scanning the context.\n */\nexport const GroupImpl = <\n GroupPath_ extends string,\n FinalizationStatus_ extends FinalizationStatus,\n>({\n groupPath,\n finalizationStatus,\n}: {\n groupPath: GroupPath_;\n finalizationStatus: FinalizationStatus_;\n}) =>\n Context.GenericTag<GroupImpl<GroupPath_, FinalizationStatus_>>(\n `@confect/server/GroupImpl/${finalizationStatus}/${groupPath}`,\n );\n\nexport const make = <\n Api_ extends Api.AnyWithProps,\n Group extends GroupSpec.AnyWithProps,\n>(\n api: Api_,\n group: Group,\n): Layer.Layer<\n GroupImpl<string, \"Unfinalized\">,\n never,\n FunctionImpl.FromGroupSpec<Group>\n> => {\n const groupPath = Api.resolveGroupPathUnsafe(api, group);\n\n return Layer.succeed(\n GroupImpl<string, \"Unfinalized\">({\n groupPath,\n finalizationStatus: \"Unfinalized\",\n }),\n {\n [TypeId]: TypeId,\n groupPath,\n finalizationStatus: \"Unfinalized\" as const,\n registeredFunctionNames: [],\n },\n ) as Layer.Layer<\n GroupImpl<string, \"Unfinalized\">,\n never,\n FunctionImpl.FromGroupSpec<Group>\n >;\n};\n\nconst isFunctionShaped = (value: unknown): boolean =>\n Predicate.isRecord(value) && \"functionSpec\" in value;\n\n/**\n * Walk a `RegistryItems` tree to the entries at `groupPath` and return the\n * names of the function-shaped leaves directly underneath.\n */\nconst collectFunctionNamesAtPath = (\n items: Registry.RegistryItems,\n groupPath: string,\n): ReadonlyArray<string> =>\n pipe(\n String.split(groupPath, \".\"),\n Array.reduce(Option.some<unknown>(items), (acc, segment) =>\n acc.pipe(\n Option.filter(Predicate.isRecord),\n Option.flatMap((node) =>\n segment in node ? Option.some(node[segment]) : Option.none(),\n ),\n ),\n ),\n Option.filter(Predicate.isRecord),\n Option.map(Record.toEntries),\n Option.map(\n Array.filterMap(([name, value]) =>\n isFunctionShaped(value) ? Option.some(name) : Option.none(),\n ),\n ),\n Option.getOrElse((): ReadonlyArray<string> => []),\n );\n\nconst findUnfinalizedGroupImpl = <S>(\n context: Context.Context<S>,\n): Option.Option<AnyUnfinalized> =>\n Array.findFirst(context.unsafeMap.values(), isUnfinalizedGroupImpl);\n\n/**\n * Mark a `GroupImpl` layer as fully implemented. The parameter type defaults\n * `RIn = never`, so passing a layer that still requires any `FunctionImpl`\n * service produces a type error at the impl author's site. The codegen\n * boundary requires the resulting `\"Finalized\"` brand, so omitting this call\n * is also rejected downstream.\n *\n * As a side effect of finalization, the names of every `FunctionImpl` that\n * registered into this group's scope are snapshotted onto the produced\n * service value's `registeredFunctionNames` field, so consumers can verify\n * impl completeness against a `GroupSpec`'s expected functions without\n * having to inspect the `Registry` themselves.\n */\nexport const finalize = <GroupPath_ extends string>(\n group: Layer.Layer<GroupImpl<GroupPath_, \"Unfinalized\">>,\n): Layer.Layer<GroupImpl<GroupPath_, \"Finalized\">> =>\n Layer.flatMap(\n group,\n (context): Layer.Layer<GroupImpl<GroupPath_, \"Finalized\">> =>\n findUnfinalizedGroupImpl(context).pipe(\n Option.match({\n onNone: () =>\n Layer.die(\n new Error(\n \"GroupImpl.finalize: no Unfinalized GroupImpl service was found in the layer's context.\",\n ),\n ),\n onSome: (unfinalized) => {\n const groupPath = unfinalized.groupPath as GroupPath_;\n return Layer.effect(\n GroupImpl<GroupPath_, \"Finalized\">({\n groupPath,\n finalizationStatus: \"Finalized\",\n }),\n Effect.gen(function* () {\n const registry = yield* Registry.Registry;\n const items = yield* Ref.get(registry);\n return {\n [TypeId]: TypeId,\n groupPath,\n finalizationStatus: \"Finalized\" as const,\n registeredFunctionNames: collectFunctionNamesAtPath(\n items,\n groupPath,\n ),\n };\n }),\n );\n },\n }),\n ),\n );\n\nexport type FromGroupSpec<Group extends GroupSpec.AnyWithProps> =\n FunctionImpl.FromGroupSpec<Group>;\n"],"mappings":";;;;;;;;;;;;;;;AAiBA,MAAa,SAAS;AAuBtB,MAAa,eAAe,MAC1B,UAAU,YAAY,GAAG,OAAO;AAKlC,MAAa,wBAAwB,MACnC,YAAY,EAAE,IAAI,EAAE,uBAAuB;AAE7C,MAAa,0BAA0B,MACrC,YAAY,EAAE,IAAI,EAAE,uBAAuB;;;;;;;;AAS7C,MAAa,aAGX,EACA,WACA,yBAKA,QAAQ,WACN,6BAA6B,mBAAmB,GAAG,YACpD;AAEH,MAAa,QAIX,KACA,UAKG;CACH,MAAM,YAAYA,uBAA2B,KAAK,MAAM;AAExD,QAAO,MAAM,QACX,UAAiC;EAC/B;EACA,oBAAoB;EACrB,CAAC,EACF;GACG,SAAS;EACV;EACA,oBAAoB;EACpB,yBAAyB,EAAE;EAC5B,CACF;;AAOH,MAAM,oBAAoB,UACxB,UAAU,SAAS,MAAM,IAAI,kBAAkB;;;;;AAMjD,MAAM,8BACJ,OACA,cAEA,KACE,OAAO,MAAM,WAAW,IAAI,EAC5B,MAAM,OAAO,OAAO,KAAc,MAAM,GAAG,KAAK,YAC9C,IAAI,KACF,OAAO,OAAO,UAAU,SAAS,EACjC,OAAO,SAAS,SACd,WAAW,OAAO,OAAO,KAAK,KAAK,SAAS,GAAG,OAAO,MAAM,CAC7D,CACF,CACF,EACD,OAAO,OAAO,UAAU,SAAS,EACjC,OAAO,IAAI,OAAO,UAAU,EAC5B,OAAO,IACL,MAAM,WAAW,CAAC,MAAM,WACtB,iBAAiB,MAAM,GAAG,OAAO,KAAK,KAAK,GAAG,OAAO,MAAM,CAC5D,CACF,EACD,OAAO,gBAAuC,EAAE,CAAC,CAClD;AAEH,MAAM,4BACJ,YAEA,MAAM,UAAU,QAAQ,UAAU,QAAQ,EAAE,uBAAuB;;;;;;;;;;;;;;AAerE,MAAa,YACX,UAEA,MAAM,QACJ,QACC,YACC,yBAAyB,QAAQ,CAAC,KAChC,OAAO,MAAM;CACX,cACE,MAAM,oBACJ,IAAI,MACF,yFACD,CACF;CACH,SAAS,gBAAgB;EACvB,MAAM,YAAY,YAAY;AAC9B,SAAO,MAAM,OACX,UAAmC;GACjC;GACA,oBAAoB;GACrB,CAAC,EACF,OAAO,IAAI,aAAa;GACtB,MAAM,WAAW,OAAO,SAAS;GACjC,MAAM,QAAQ,OAAO,IAAI,IAAI,SAAS;AACtC,UAAO;KACJ,SAAS;IACV;IACA,oBAAoB;IACpB,yBAAyB,2BACvB,OACA,UACD;IACF;IACD,CACH;;CAEJ,CAAC,CACH,CACJ"}
@@ -24,7 +24,7 @@ type QueryInitializer<DataModel_ extends AnyWithProps$2, TableName extends Table
24
24
  readonly search: <IndexName extends keyof SearchIndexes<_ConvexTableInfo>>(indexName: IndexName, searchFilter: (q: SearchFilterBuilder<DocumentByInfo<_ConvexTableInfo>, NamedSearchIndex<_ConvexTableInfo, IndexName>>) => SearchFilter) => OrderedQuery$1<_TableInfo, TableName>;
25
25
  };
26
26
  declare const make: <Tables extends AnyWithProps, TableName extends Name<Tables>>(tableName: TableName, convexDatabaseReader: BaseDatabaseReader<ToConvex<FromTables<Tables>>>, table: WithName<Tables, TableName>) => QueryInitializer<DataModel<Tables>, TableName, TableInfoWithName<DataModel<Tables>, TableName>, TableInfoWithName_<DataModel<Tables>, TableName>>;
27
- declare const getById: <Tables extends AnyWithProps, TableName extends Name<Tables>>(tableName: TableName, convexDatabaseReader: BaseDatabaseReader<ToConvex<FromTables<Tables>>>, table: WithName<Tables, TableName>) => (id: GenericId<TableName>) => Effect.Effect<any, DocumentDecodeError | GetByIdFailure, never>;
27
+ declare const getById: <Tables extends AnyWithProps, TableName extends Name<Tables>>(tableName: TableName, convexDatabaseReader: BaseDatabaseReader<ToConvex<FromTables<Tables>>>, table: WithName<Tables, TableName>) => (id: GenericId<TableName>) => Effect.Effect<any, GetByIdFailure | DocumentDecodeError, never>;
28
28
  declare const GetByIdFailure_base: Schema.TaggedErrorClass<GetByIdFailure, "GetByIdFailure", {
29
29
  readonly _tag: Schema.tag<"GetByIdFailure">;
30
30
  } & {
@@ -1 +1 @@
1
- {"version":3,"file":"QueryInitializer.d.ts","names":[],"sources":["../src/QueryInitializer.ts"],"mappings":";;;;;;;;;;;;;;KA6BK,gBAAA,oBACgB,cAAA,oBACD,UAAA,CAAqB,UAAA,4BACd,gBAAA,qBACN,cAAA;EAAA,SAEV,GAAA;IAAA,CAEL,EAAA,EAAI,SAAA,CAAU,SAAA,IACb,MAAA,CAAO,MAAA,CACR,UAAA,cACA,mBAAA,GAA+B,cAAA;IAAA,yBAER,OAAA,CAAQ,gBAAA,GAC/B,SAAA,EAAW,SAAA,KACR,gBAAA,EAAkB,oBAAA,CACnB,QAAA,CAAmB,UAAA,GACnB,SAAA,EACA,OAAA,CAAQ,gBAAA,EAAkB,SAAA,KAE3B,MAAA,CAAO,MAAA,CACR,UAAA,cACA,mBAAA,GAA+B,iBAAA;EAAA;EAAA,SAG1B,KAAA;IAAA,yBACkB,OAAA,CAAQ,gBAAA,GAC/B,SAAA,EAAW,SAAA,EACX,UAAA,IACE,CAAA,EAAG,iBAAA,CACD,UAAA,oBACA,UAAA,CAAW,gBAAA,EAAkB,SAAA,OAE5B,UAAA,EACL,KAAA,oBACC,cAAA,CAA0B,UAAA,EAAY,SAAA;IAAA,yBAChB,OAAA,CAAQ,gBAAA,GAC/B,SAAA,EAAW,SAAA,EACX,KAAA,oBACC,cAAA,CAA0B,UAAA,EAAY,SAAA;EAAA;EAAA,SAElC,MAAA,2BAAiC,aAAA,CAAc,gBAAA,GACtD,SAAA,EAAW,SAAA,EACX,YAAA,GACE,CAAA,EAAG,mBAAA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AA,CAAmB,UAAA,CAAqB,MAAA,KAE1C,KAAA,EAAO,QAAA,CAAe,MAAA,EAAQ,SAAA,OAE/B,EAAA,EAAI,SAAA,CAAU,SAAA,MAAU,MAAA,CAAA,MAAA,MAAA,cAAA,GAAA,mBAAA;AAAA,cAOrB,mBAAA;;;;;;cAEO,cAAA,SAAuB,mBAAA;EAAA,IAOrB,OAAA,CAAA;AAAA;AAAA,cAOd,sBAAA;;;;;;;cAEY,iBAAA,SAA0B,sBAAA;EAAA,IAQxB,OAAA,CAAA;AAAA"}
@@ -23,9 +23,9 @@ import * as convex_server0 from "convex/server";
23
23
  import { GenericMutationCtx } from "convex/server";
24
24
  import * as convex_values0 from "convex/values";
25
25
  import * as _confect_core_Types0 from "@confect/core/Types";
26
- import * as effect_ParseResult0 from "effect/ParseResult";
27
26
  import * as effect_Duration0 from "effect/Duration";
28
27
  import * as effect_DateTime0 from "effect/DateTime";
28
+ import * as effect_ParseResult0 from "effect/ParseResult";
29
29
 
30
30
  //#region src/RegisteredConvexFunction.d.ts
31
31
  declare namespace RegisteredConvexFunction_d_exports {
@@ -35,10 +35,13 @@ declare const make: <Api_ extends AnyWithPropsWithRuntime<"Convex">>(api: Api_,
35
35
  functionSpec,
36
36
  handler
37
37
  }: AnyWithProps$1) => Any;
38
- declare const mutationLayer: <Schema extends AnyWithProps>(schema: Schema, ctx: GenericMutationCtx<ToConvex<FromSchema<Schema>>>) => Layer.Layer<(<Mutation extends _confect_core_Ref0.AnyMutation>(mutation: Mutation, ...args: _confect_core_Ref0.OptionalArgs<Mutation>) => Effect.Effect<_confect_core_Ref0.Returns<Mutation>, _confect_core_Ref0.Error<Mutation> | effect_ParseResult0.ParseError>) | (<Query extends _confect_core_Ref0.AnyQuery>(query: Query, ...args: _confect_core_Ref0.OptionalArgs<Query>) => Effect.Effect<_confect_core_Ref0.Returns<Query>, _confect_core_Ref0.Error<Query> | effect_ParseResult0.ParseError>) | GenericMutationCtx<ToConvex<FromSchema<Schema>>> | {
38
+ declare const mutationLayer: <Schema extends AnyWithProps>(schema: Schema, ctx: GenericMutationCtx<ToConvex<FromSchema<Schema>>>) => Layer.Layer<StorageReader$1 | {
39
+ runAfter: <Ref_ extends _confect_core_Ref0.AnyMutation | _confect_core_Ref0.AnyAction>(delay: effect_Duration0.Duration, ref: Ref_, ...args: _confect_core_Ref0.OptionalArgs<Ref_>) => Effect.Effect<convex_values0.GenericId<"_scheduled_functions">, never, never>;
40
+ runAt: <Ref_ extends _confect_core_Ref0.AnyMutation | _confect_core_Ref0.AnyAction>(dateTime: effect_DateTime0.DateTime, ref: Ref_, ...args: _confect_core_Ref0.OptionalArgs<Ref_>) => Effect.Effect<convex_values0.GenericId<"_scheduled_functions">, never, never>;
41
+ } | Auth$1 | StorageWriter$1 | (<Query extends _confect_core_Ref0.AnyQuery>(query: Query, ...args: _confect_core_Ref0.OptionalArgs<Query>) => Effect.Effect<_confect_core_Ref0.Returns<Query>, _confect_core_Ref0.Error<Query> | effect_ParseResult0.ParseError>) | (<Mutation extends _confect_core_Ref0.AnyMutation>(mutation: Mutation, ...args: _confect_core_Ref0.OptionalArgs<Mutation>) => Effect.Effect<_confect_core_Ref0.Returns<Mutation>, _confect_core_Ref0.Error<Mutation> | effect_ParseResult0.ParseError>) | GenericMutationCtx<ToConvex<FromSchema<Schema>>> | {
39
42
  table: <const TableName extends Name<IncludeSystemTables<Tables<Schema>>>>(tableName: TableName) => {
40
43
  readonly get: {
41
- (id: convex_values0.GenericId<TableName>): Effect.Effect<TableInfo<WithName<IncludeSystemTables<Tables<Schema>>, TableName>>["document"], DocumentDecodeError | GetByIdFailure, never>;
44
+ (id: convex_values0.GenericId<TableName>): Effect.Effect<TableInfo<WithName<IncludeSystemTables<Tables<Schema>>, TableName>>["document"], GetByIdFailure | DocumentDecodeError, never>;
42
45
  <IndexName extends keyof TableInfo<WithName<IncludeSystemTables<Tables<Schema>>, TableName>>["indexes"]>(indexName: IndexName, ...indexFieldValues: _confect_core_Types0.IndexFieldTypesForEq<ToConvex<DataModel<IncludeSystemTables<Tables<Schema>>>>, TableName, TableInfo<WithName<IncludeSystemTables<Tables<Schema>>, TableName>>["indexes"][IndexName]>): Effect.Effect<TableInfo<WithName<IncludeSystemTables<Tables<Schema>>, TableName>>["document"], DocumentDecodeError | GetByIndexFailure, never>;
43
46
  };
44
47
  readonly index: {
@@ -50,14 +53,11 @@ declare const mutationLayer: <Schema extends AnyWithProps>(schema: Schema, ctx:
50
53
  } | {
51
54
  table: <const TableName extends TableNames<FromSchema<Schema>>>(tableName: TableName) => {
52
55
  insert: (document: WithoutSystemFields$1<DocumentByName<FromSchema<Schema>, TableName>>) => Effect.Effect<convex_values0.GenericId<TableName>, DocumentEncodeError, never>;
53
- patch: (id: convex_values0.GenericId<TableName>, patchedValues: Partial<convex_server0.Expand<convex_server0.BetterOmit<DocumentByName<FromSchema<Schema>, TableName>, "_id" | "_creationTime">>>) => Effect.Effect<void, DocumentDecodeError | GetByIdFailure | DocumentEncodeError, never>;
56
+ patch: (id: convex_values0.GenericId<TableName>, patchedValues: Partial<convex_server0.Expand<convex_server0.BetterOmit<DocumentByName<FromSchema<Schema>, TableName>, "_id" | "_creationTime">>>) => Effect.Effect<void, GetByIdFailure | DocumentDecodeError | DocumentEncodeError, never>;
54
57
  replace: (id: convex_values0.GenericId<TableName>, value: convex_server0.Expand<convex_server0.BetterOmit<DocumentByName<FromSchema<Schema>, TableName>, "_id" | "_creationTime">>) => Effect.Effect<void, DocumentEncodeError, never>;
55
58
  delete: (id: convex_values0.GenericId<TableName>) => Effect.Effect<void, never, never>;
56
59
  };
57
- } | Auth$1 | {
58
- runAfter: <Ref_ extends _confect_core_Ref0.AnyMutation | _confect_core_Ref0.AnyAction>(delay: effect_Duration0.Duration, ref: Ref_, ...args: _confect_core_Ref0.OptionalArgs<Ref_>) => Effect.Effect<convex_values0.GenericId<"_scheduled_functions">, never, never>;
59
- runAt: <Ref_ extends _confect_core_Ref0.AnyMutation | _confect_core_Ref0.AnyAction>(dateTime: effect_DateTime0.DateTime, ref: Ref_, ...args: _confect_core_Ref0.OptionalArgs<Ref_>) => Effect.Effect<convex_values0.GenericId<"_scheduled_functions">, never, never>;
60
- } | StorageReader$1 | StorageWriter$1, never, never>;
60
+ }, never, never>;
61
61
  type MutationServices<Schema extends AnyWithProps> = DatabaseReader<Schema> | DatabaseWriter<Schema> | Auth$1 | Scheduler$1 | StorageReader$1 | StorageWriter$1 | QueryRunner | MutationRunner | MutationCtx<ToConvex<FromSchema<Schema>>>;
62
62
  //#endregion
63
63
  export { MutationServices, RegisteredConvexFunction_d_exports, make, mutationLayer };
@@ -1 +1 @@
1
- {"version":3,"file":"RegisteredConvexFunction.d.ts","names":[],"sources":["../src/RegisteredConvexFunction.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAiCa,IAAA,gBAAqB,uBAAA,YAChC,GAAA,EAAK,IAAA;EACL,YAAA;EAAA;AAAA,GAA2B,cAAA,KAC1B,GAAA;AAAA,cAkLU,aAAA,kBAAgC,YAAA,EAC3C,MAAA,EAAQ,MAAA,EACR,GAAA,EAAK,kBAAA,CAAmB,QAAA,CAAmB,UAAA,CAAqB,MAAA,QAAS,KAAA,CAAA,KAAA,oBAAlD,kBAAA,CAAkD,WAAA,EAAA,QAAA,EAAA,QAAA,KAAA,IAAA,EAAA,kBAAA,CAAA,YAAA,CAAA,QAAA,MAAA,MAAA,CAAA,MAAA,CAAA,kBAAA,CAAA,OAAA,CAAA,QAAA,GAAA,kBAAA,CAAA,KAAA,CAAA,QAAA,IAAA,mBAAA,CAAA,UAAA,qBAAA,kBAAA,CAAA,QAAA,EAAA,KAAA,EAAA,KAAA,KAAA,IAAA,EAAA,kBAAA,CAAA,YAAA,CAAA,KAAA,MAAA,MAAA,CAAA,MAAA,CAAA,kBAAA,CAAA,OAAA,CAAA,KAAA,GAAA,kBAAA,CAAA,KAAA,CAAA,KAAA,IAAA,mBAAA,CAAA,UAAA,KAAA,kBAAA,CAAA,QAAA,CAAA,UAAA,CAAA,MAAA;;;;;;;;;;;;;;;;;;;;;;;KAoB/D,gBAAA,gBAAgC,YAAA,IACxC,cAAA,CAA8B,MAAA,IAC9B,cAAA,CAA8B,MAAA,IAC9B,MAAA,GACA,WAAA,GACA,eAAA,GACA,eAAA,GACA,WAAA,GACA,cAAA,GACA,WAAA,CAAwB,QAAA,CAAmB,UAAA,CAAqB,MAAA"}
1
+ {"version":3,"file":"RegisteredConvexFunction.d.ts","names":[],"sources":["../src/RegisteredConvexFunction.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAiCa,IAAA,gBAAqB,uBAAA,YAChC,GAAA,EAAK,IAAA;EACL,YAAA;EAAA;AAAA,GAA2B,cAAA,KAC1B,GAAA;AAAA,cAkLU,aAAA,kBAAgC,YAAA,EAC3C,MAAA,EAAQ,MAAA,EACR,GAAA,EAAK,kBAAA,CAAmB,QAAA,CAAmB,UAAA,CAAqB,MAAA,QAAS,KAAA,CAAA,KAAA,CAAA,eAAA;0BAAA,kBAAA,CAAA,WAAA;;;;;;;;;;;;;;;;;;;;;;KAoB/D,gBAAA,gBAAgC,YAAA,IACxC,cAAA,CAA8B,MAAA,IAC9B,cAAA,CAA8B,MAAA,IAC9B,MAAA,GACA,WAAA,GACA,eAAA,GACA,eAAA,GACA,WAAA,GACA,cAAA,GACA,WAAA,CAAwB,QAAA,CAAmB,UAAA,CAAqB,MAAA"}
@@ -18,9 +18,9 @@ import { FunctionSpec, RuntimeAndFunctionType } from "@confect/core";
18
18
  import * as convex_values0 from "convex/values";
19
19
  import { Value } from "convex/values";
20
20
  import * as FunctionProvenance from "@confect/core/FunctionProvenance";
21
- import * as effect_ParseResult0 from "effect/ParseResult";
22
21
  import * as effect_Duration0 from "effect/Duration";
23
22
  import * as effect_DateTime0 from "effect/DateTime";
23
+ import * as effect_ParseResult0 from "effect/ParseResult";
24
24
 
25
25
  //#region src/RegisteredFunction.d.ts
26
26
  declare namespace RegisteredFunction_d_exports {
@@ -70,10 +70,10 @@ declare const actionFunctionBase: <Schema extends AnyWithProps, Args, ConvexArgs
70
70
  handler: (ctx: GenericActionCtx<ToConvex<FromSchema<Schema>>>, actualArgs: ConvexArgs) => Promise<ConvexReturns>;
71
71
  };
72
72
  type ActionServices<DatabaseSchema_ extends AnyWithProps> = Scheduler$1 | Auth$1 | StorageReader$1 | StorageWriter$1 | StorageActionWriter$1 | QueryRunner | MutationRunner | ActionRunner | VectorSearch<FromSchema<DatabaseSchema_>> | ActionCtx<ToConvex<FromSchema<DatabaseSchema_>>>;
73
- declare const actionLayer: <DatabaseSchema_ extends AnyWithProps>(databaseSchema: DatabaseSchema_, ctx: GenericActionCtx<ToConvex<FromSchema<DatabaseSchema_>>>) => Layer.Layer<(<Mutation extends _confect_core_Ref0.AnyMutation>(mutation: Mutation, ...args: _confect_core_Ref0.OptionalArgs<Mutation>) => Effect.Effect<_confect_core_Ref0.Returns<Mutation>, _confect_core_Ref0.Error<Mutation> | effect_ParseResult0.ParseError>) | (<Query extends _confect_core_Ref0.AnyQuery>(query: Query, ...args: _confect_core_Ref0.OptionalArgs<Query>) => Effect.Effect<_confect_core_Ref0.Returns<Query>, _confect_core_Ref0.Error<Query> | effect_ParseResult0.ParseError>) | Auth$1 | {
73
+ declare const actionLayer: <DatabaseSchema_ extends AnyWithProps>(databaseSchema: DatabaseSchema_, ctx: GenericActionCtx<ToConvex<FromSchema<DatabaseSchema_>>>) => Layer.Layer<StorageActionWriter$1 | StorageReader$1 | {
74
74
  runAfter: <Ref_ extends _confect_core_Ref0.AnyMutation | _confect_core_Ref0.AnyAction>(delay: effect_Duration0.Duration, ref: Ref_, ...args: _confect_core_Ref0.OptionalArgs<Ref_>) => Effect.Effect<convex_values0.GenericId<"_scheduled_functions">, never, never>;
75
75
  runAt: <Ref_ extends _confect_core_Ref0.AnyMutation | _confect_core_Ref0.AnyAction>(dateTime: effect_DateTime0.DateTime, ref: Ref_, ...args: _confect_core_Ref0.OptionalArgs<Ref_>) => Effect.Effect<convex_values0.GenericId<"_scheduled_functions">, never, never>;
76
- } | StorageReader$1 | StorageWriter$1 | GenericActionCtx<ToConvex<FromSchema<DatabaseSchema_>>> | StorageActionWriter$1 | (<Action extends _confect_core_Ref0.AnyAction>(action: Action, ...args: _confect_core_Ref0.OptionalArgs<Action>) => Effect.Effect<_confect_core_Ref0.Returns<Action>, _confect_core_Ref0.Error<Action> | effect_ParseResult0.ParseError>) | (<TableName extends TableNames<FromSchema<DatabaseSchema_>>, IndexName extends keyof convex_server0.VectorIndexes<convex_server0.NamedTableInfo<ToConvex<FromSchema<DatabaseSchema_>>, TableName>>>(tableName: TableName, indexName: IndexName, query: {
76
+ } | GenericActionCtx<ToConvex<FromSchema<DatabaseSchema_>>> | Auth$1 | StorageWriter$1 | (<Query extends _confect_core_Ref0.AnyQuery>(query: Query, ...args: _confect_core_Ref0.OptionalArgs<Query>) => Effect.Effect<_confect_core_Ref0.Returns<Query>, _confect_core_Ref0.Error<Query> | effect_ParseResult0.ParseError>) | (<Mutation extends _confect_core_Ref0.AnyMutation>(mutation: Mutation, ...args: _confect_core_Ref0.OptionalArgs<Mutation>) => Effect.Effect<_confect_core_Ref0.Returns<Mutation>, _confect_core_Ref0.Error<Mutation> | effect_ParseResult0.ParseError>) | (<Action extends _confect_core_Ref0.AnyAction>(action: Action, ...args: _confect_core_Ref0.OptionalArgs<Action>) => Effect.Effect<_confect_core_Ref0.Returns<Action>, _confect_core_Ref0.Error<Action> | effect_ParseResult0.ParseError>) | (<TableName extends TableNames<FromSchema<DatabaseSchema_>>, IndexName extends keyof convex_server0.VectorIndexes<convex_server0.NamedTableInfo<ToConvex<FromSchema<DatabaseSchema_>>, TableName>>>(tableName: TableName, indexName: IndexName, query: {
77
77
  vector: number[];
78
78
  limit?: number;
79
79
  filter?: (q: convex_server0.VectorFilterBuilder<convex_server0.DocumentByInfo<convex_server0.NamedTableInfo<ToConvex<FromSchema<DatabaseSchema_>>, TableName>>, convex_server0.NamedVectorIndex<convex_server0.NamedTableInfo<ToConvex<FromSchema<DatabaseSchema_>>, TableName>, IndexName>>) => convex_server0.FilterExpression<boolean>;
@@ -1 +1 @@
1
- {"version":3,"file":"RegisteredFunction.d.ts","names":[],"sources":["../src/RegisteredFunction.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;KA2BY,GAAA,GACR,eAAA,CAAgB,kBAAA,EAAoB,mBAAA,SACpC,kBAAA,CAAmB,kBAAA,EAAoB,mBAAA,SACvC,gBAAA,CAAiB,kBAAA,EAAoB,mBAAA;AAAA,KAEpC,yBAAA,uBACmB,YAAA,CAAa,YAAA,IAEnC,YAAA,CAAa,WAAA,CAAY,aAAA,8BACvB,mBAAA,GACE,sBAAA,CAAuB,eAAA,CACrB,aAAA,8CAEA,eAAA,CACE,YAAA,CAAa,qBAAA,CAAsB,aAAA,GACnC,KAAA,EACA,OAAA,CAAQ,YAAA,CAAa,cAAA,CAAe,aAAA,MAEtC,sBAAA,CAAuB,eAAA,CACnB,aAAA,iDAEF,kBAAA,CACE,YAAA,CAAa,qBAAA,CAAsB,aAAA,GACnC,KAAA,EACA,OAAA,CAAQ,YAAA,CAAa,cAAA,CAAe,aAAA,MAEtC,sBAAA,CAAuB,eAAA,CACnB,aAAA,+CAEF,gBAAA,CACE,YAAA,CAAa,qBAAA,CAAsB,aAAA,GACnC,KAAA,EACA,OAAA,CAAQ,YAAA,CAAa,cAAA,CAAe,aAAA;AAAA,KAKtC,wBAAA,uBACY,YAAA,CAAa,YAAA,IACjC,aAAA;EACF,kBAAA;IACE,IAAA;IACA,KAAA,sBAA2B,mBAAA;IAC3B,QAAA;EAAA;AAAA,IAGA,sBAAA,CAAuB,eAAA,CACrB,aAAA,8CAEA,eAAA,CACE,YAAA,CAAa,qBAAA,CAAsB,aAAA,GACnC,KAAA,EACA,QAAA,IAEF,sBAAA,CAAuB,eAAA,CACnB,aAAA,iDAEF,kBAAA,CACE,YAAA,CAAa,qBAAA,CAAsB,aAAA,GACnC,KAAA,EACA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AAA,CAAQ,CAAA;AAAA,cAyBlC,kBAAA,kBACI,YAAA,2BAEI,mBAAA;EAKnB,IAAA;EAAA,OAAA;EAAA,KAAA;EAAA,OAAA;EAAA;AAAA;EAOA,IAAA,EAAM,MAAA,CAAO,MAAA,CAAO,IAAA,EAAM,UAAA;EAC1B,OAAA,EAAS,MAAA,CAAO,MAAA,CAAO,OAAA,EAAS,aAAA;EAChC,KAAA,EAAO,MAAA,CAAO,MAAA,CAAO,KAAA,EAAO,KAAA;EAC5B,OAAA,GAAU,CAAA,EAAG,IAAA,KAAS,MAAA,CAAO,MAAA,CAAO,OAAA,EAAS,CAAA,EAAG,CAAA;EAChD,WAAA,GACE,GAAA,EAAK,gBAAA,CAAiB,QAAA,CAAmB,UAAA,CAAqB,MAAA,QAC3D,KAAA,CAAM,KAAA,CAAM,CAAA;AAAA;QAAD,cAAA,CAAA,kBAAA;;iBAKT,gBAAA,CAAiB,QAAA,CAAmB,UAAA,CAAqB,MAAA,KAAS,UAAA,EAC3D,UAAA,KACX,OAAA,CAAQ,aAAA;AAAA;AAAA,KAcD,cAAA,yBACc,YAAA,IAEtB,WAAA,GACA,MAAA,GACA,eAAA,GACA,eAAA,GACA,qBAAA,GACA,WAAA,GACA,cAAA,GACA,YAAA,GACA,YAAA,CAA0B,UAAA,CAAqB,eAAA,KAC/C,SAAA,CACE,QAAA,CAAmB,UAAA,CAAqB,eAAA;AAAA,cAGjC,WAAA,2BACa,YAAA,EAExB,cAAA,EAAgB,eAAA,EAChB,GAAA,EAAK,gBAAA,CACH,QAAA,CAAmB,UAAA,CAAqB,eAAA,QACzC,KAAA,CAAA,KAAA,CAAA,qBAAA,GAAA,eAAA;0BAAA,kBAAA,CAAA,WAAA"}
@@ -3,9 +3,9 @@ import { Any, RegisteredFunction } from "./RegisteredFunction.js";
3
3
  import { GroupImpl } from "./GroupImpl.js";
4
4
  import { AnyWithProps as AnyWithProps$2 } from "./RegistryItem.js";
5
5
  import { Layer, Types } from "effect";
6
+ import * as GroupSpec from "@confect/core/GroupSpec";
6
7
  import * as Spec from "@confect/core/Spec";
7
8
  import * as FunctionSpec from "@confect/core/FunctionSpec";
8
- import * as GroupSpec from "@confect/core/GroupSpec";
9
9
 
10
10
  //#region src/RegisteredFunctions.d.ts
11
11
  declare namespace RegisteredFunctions_d_exports {
@@ -25,7 +25,7 @@ declare const StorageActionWriter_base: effect_Context0.TagClass<StorageActionWr
25
25
  store: (blob: Blob, options?: {
26
26
  sha256?: string;
27
27
  }) => Effect.Effect<GenericId<"_storage">, never, never>;
28
- }) => X) => [X] extends [Effect.Effect<infer A, infer E, infer R>] ? Effect.Effect<A, E, R | StorageActionWriter> : [X] extends [PromiseLike<infer A_1>] ? Effect.Effect<A_1, effect_Cause0.UnknownException, StorageActionWriter> : Effect.Effect<X, never, StorageActionWriter>;
28
+ }) => X) => [X] extends [Effect.Effect<infer A, infer E, infer R>] ? Effect.Effect<A, E, StorageActionWriter | R> : [X] extends [PromiseLike<infer A_1>] ? Effect.Effect<A_1, effect_Cause0.UnknownException, StorageActionWriter> : Effect.Effect<X, never, StorageActionWriter>;
29
29
  };
30
30
  declare class StorageActionWriter extends StorageActionWriter_base {
31
31
  static readonly layer: (storageActionWriter: StorageActionWriter$1) => Layer.Layer<StorageActionWriter, never, never>;
package/dist/Table.d.ts CHANGED
@@ -70,8 +70,8 @@ declare const scheduledFunctionsTable: Table<"_scheduled_functions", Schema.Stru
70
70
  kind: Schema.Literal<["canceled"]>;
71
71
  }>]>;
72
72
  }>, convex_values0.VObject<{
73
- name: string;
74
73
  args: any[];
74
+ name: string;
75
75
  scheduledTime: number;
76
76
  state: {
77
77
  kind: "pending";
@@ -80,15 +80,15 @@ declare const scheduledFunctionsTable: Table<"_scheduled_functions", Schema.Stru
80
80
  } | {
81
81
  kind: "success";
82
82
  } | {
83
- kind: "failed";
84
83
  error: string;
84
+ kind: "failed";
85
85
  } | {
86
86
  kind: "canceled";
87
87
  };
88
88
  completedTime?: number;
89
89
  }, {
90
- name: convex_values0.VString<string, "required">;
91
90
  args: convex_values0.VArray<any[], convex_values0.VAny<any, "required", string>, "required">;
91
+ name: convex_values0.VString<string, "required">;
92
92
  scheduledTime: convex_values0.VFloat64<number, "required">;
93
93
  state: convex_values0.VUnion<{
94
94
  kind: "pending";
@@ -97,8 +97,8 @@ declare const scheduledFunctionsTable: Table<"_scheduled_functions", Schema.Stru
97
97
  } | {
98
98
  kind: "success";
99
99
  } | {
100
- kind: "failed";
101
100
  error: string;
101
+ kind: "failed";
102
102
  } | {
103
103
  kind: "canceled";
104
104
  }, [convex_values0.VObject<{
@@ -114,18 +114,18 @@ declare const scheduledFunctionsTable: Table<"_scheduled_functions", Schema.Stru
114
114
  }, {
115
115
  kind: convex_values0.VLiteral<"success", "required">;
116
116
  }, "required", "kind">, convex_values0.VObject<{
117
- kind: "failed";
118
117
  error: string;
118
+ kind: "failed";
119
119
  }, {
120
- kind: convex_values0.VLiteral<"failed", "required">;
121
120
  error: convex_values0.VString<string, "required">;
122
- }, "required", "kind" | "error">, convex_values0.VObject<{
121
+ kind: convex_values0.VLiteral<"failed", "required">;
122
+ }, "required", "error" | "kind">, convex_values0.VObject<{
123
123
  kind: "canceled";
124
124
  }, {
125
125
  kind: convex_values0.VLiteral<"canceled", "required">;
126
- }, "required", "kind">], "required", "kind" | "error">;
126
+ }, "required", "kind">], "required", "error" | "kind">;
127
127
  completedTime: convex_values0.VFloat64<number | undefined, "optional">;
128
- }, "required", "name" | "args" | "scheduledTime" | "completedTime" | "state" | "state.kind" | "state.error">, {}, {}, {}>;
128
+ }, "required", "args" | "name" | "scheduledTime" | "completedTime" | "state" | "state.error" | "state.kind">, {}, {}, {}>;
129
129
  declare const storageTable: Table<"_storage", Schema.Struct<{
130
130
  sha256: typeof Schema.String;
131
131
  size: typeof Schema.Number;
@@ -162,8 +162,8 @@ declare const systemTables: {
162
162
  kind: Schema.Literal<["canceled"]>;
163
163
  }>]>;
164
164
  }>, convex_values0.VObject<{
165
- name: string;
166
165
  args: any[];
166
+ name: string;
167
167
  scheduledTime: number;
168
168
  state: {
169
169
  kind: "pending";
@@ -172,15 +172,15 @@ declare const systemTables: {
172
172
  } | {
173
173
  kind: "success";
174
174
  } | {
175
- kind: "failed";
176
175
  error: string;
176
+ kind: "failed";
177
177
  } | {
178
178
  kind: "canceled";
179
179
  };
180
180
  completedTime?: number;
181
181
  }, {
182
- name: convex_values0.VString<string, "required">;
183
182
  args: convex_values0.VArray<any[], convex_values0.VAny<any, "required", string>, "required">;
183
+ name: convex_values0.VString<string, "required">;
184
184
  scheduledTime: convex_values0.VFloat64<number, "required">;
185
185
  state: convex_values0.VUnion<{
186
186
  kind: "pending";
@@ -189,8 +189,8 @@ declare const systemTables: {
189
189
  } | {
190
190
  kind: "success";
191
191
  } | {
192
- kind: "failed";
193
192
  error: string;
193
+ kind: "failed";
194
194
  } | {
195
195
  kind: "canceled";
196
196
  }, [convex_values0.VObject<{
@@ -206,18 +206,18 @@ declare const systemTables: {
206
206
  }, {
207
207
  kind: convex_values0.VLiteral<"success", "required">;
208
208
  }, "required", "kind">, convex_values0.VObject<{
209
- kind: "failed";
210
209
  error: string;
210
+ kind: "failed";
211
211
  }, {
212
- kind: convex_values0.VLiteral<"failed", "required">;
213
212
  error: convex_values0.VString<string, "required">;
214
- }, "required", "kind" | "error">, convex_values0.VObject<{
213
+ kind: convex_values0.VLiteral<"failed", "required">;
214
+ }, "required", "error" | "kind">, convex_values0.VObject<{
215
215
  kind: "canceled";
216
216
  }, {
217
217
  kind: convex_values0.VLiteral<"canceled", "required">;
218
- }, "required", "kind">], "required", "kind" | "error">;
218
+ }, "required", "kind">], "required", "error" | "kind">;
219
219
  completedTime: convex_values0.VFloat64<number | undefined, "optional">;
220
- }, "required", "name" | "args" | "scheduledTime" | "completedTime" | "state" | "state.kind" | "state.error">, {}, {}, {}>;
220
+ }, "required", "args" | "name" | "scheduledTime" | "completedTime" | "state" | "state.error" | "state.kind">, {}, {}, {}>;
221
221
  readonly _storage: Table<"_storage", Schema.Struct<{
222
222
  sha256: typeof Schema.String;
223
223
  size: typeof Schema.Number;
@@ -1 +1 @@
1
- {"version":3,"file":"Table.d.ts","names":[],"sources":["../src/Table.ts"],"mappings":";;;;;;;;;;;cAoBa,MAAA;AAAA,KACD,MAAA,UAAgB,MAAA;AAAA,cAEf,OAAA,GAAW,CAAA,cAAa,CAAA,IAAK,GAAA;AAAA,UAGzB,KAAA,4CAEM,MAAA,CAAO,MAAA,CAAO,YAAA,0BACX,gBAAA,GACtB,2BAAA,CAA4B,YAAA,oBACb,mBAAA,8BACM,yBAAA,8BACA,yBAAA;EAAA,UAEb,MAAA,GAAS,MAAA;EAAA,SACV,eAAA,EAAiB,eAAA,CACxB,eAAA,EACA,QAAA,EACA,cAAA,EACA,cAAA;EAAA,SAGO,IAAA,EAAM,KAAA;EAAA,SAEN,MAAA,EAAQ,YAAA;EAAA,SACR,GAAA,EAAK,cAAA,CAAa,sBAAA,CAAuB,KAAA,EAAO,YAAA;EAAA,SAEhD,OAAA,EAAS,QAAA;EAElB,KAAA,kDAEyB,iBAAA,CAAkB,eAAA,0BAClB,iBAAA,CAAkB,eAAA,KAEzC,IAAA,EAAM,SAAA,EACN,MAAA,GAAS,cAAA,KAAmB,cAAA,IAC3B,KAAA,CACD,KAAA,EACA,YAAA,EACA,eAAA,EACA,MAAA,CACE,QAAA,GACE,MAAA,CACE,SAAA,GACC,cAAA,KAAmB,cAAA,EAAgB,oBAAA,KAG1C,cAAA,EACA,cAAA;EAGF,WAAA,+CAEsB,iBAAA,CAAkB,eAAA,wBACjB,iBAAA,CAAkB,eAAA,WAEvC,IAAA,EAAM,SAAA,EACN,WAAA,EAAa,MAAA,CAAO,iBAAA,CAAkB,WAAA,EAAa,YAAA,KAClD,KAAA,CACD,KAAA,EACA,YAAA,EACA,eAAA,EACA,QAAA,EACA,MAAA,CACE,cAAA,GACE,MAAA,CACE,SAAA;IAEE,WAAA,EAAa,WAAA;IACb,YAAA,EAAc,YAAA;EAAA,KAItB,c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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAoBvB,YAAA,EAAY,KAAA,aAAA,MAAA,CAAA,MAAA;;;;;;;;;;;UAAA,cAAA,CAAA,OAAA;;;;cASZ,YAAA;EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAKD,YAAA,UAAsB,uBAAA,UAAiC,YAAA;;;;;;;KAU9D,iBAAA,WAA4B,SAAA,mBAI/B,CAAA,uBAAwB,YAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@confect/server",
3
- "version": "9.0.0-next.2",
3
+ "version": "9.0.0-next.4",
4
4
  "description": "Backend bindings to the Convex platform",
5
5
  "repository": {
6
6
  "type": "git",
@@ -73,7 +73,7 @@
73
73
  "@effect/platform-node": "^0.106.0",
74
74
  "convex": "1.39.1",
75
75
  "effect": "^3.21.2",
76
- "@confect/core": "^9.0.0-next.2"
76
+ "@confect/core": "^9.0.0-next.4"
77
77
  },
78
78
  "engines": {
79
79
  "node": ">=22",
package/src/Api.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import type { RuntimeAndFunctionType } from "@confect/core";
2
+ import type * as GroupSpec from "@confect/core/GroupSpec";
2
3
  import type * as Spec from "@confect/core/Spec";
3
4
  import type { GenericSchema, SchemaDefinition } from "convex/server";
4
5
  import { defineSchema as defineConvexSchema } from "convex/server";
@@ -73,3 +74,29 @@ export const make = <
73
74
  databaseSchema: DatabaseSchema_,
74
75
  spec: Spec_,
75
76
  ): Api<DatabaseSchema_, Spec_> => makeProto({ databaseSchema, spec });
77
+
78
+ /**
79
+ * Resolve the dot-path of `group` within `api.spec` by reading the immutable
80
+ * `paths` mapping that codegen populated in `_generated/spec.ts`. Throws when
81
+ * the spec is not registered, with a message pointing the caller at the
82
+ * place to register it.
83
+ *
84
+ * The legacy identity-based tree walk (`packages/server/src/GroupPath.ts`)
85
+ * was deleted in favor of this O(1) map lookup; both the registration
86
+ * mechanism (`Spec.addPath`) and the lookup key are the same JS reference
87
+ * thanks to ES module dedup between `_generated/spec.ts` and `*.impl.ts`.
88
+ */
89
+ export const resolveGroupPathUnsafe = (
90
+ api: AnyWithProps,
91
+ group: GroupSpec.AnyWithProps,
92
+ ): string => {
93
+ const groupPath = api.spec.paths.get(group);
94
+ if (groupPath === undefined) {
95
+ throw new Error(
96
+ "GroupSpec has no registered path in this api's spec. " +
97
+ "Ensure the spec is added via Spec.addPath in _generated/spec.ts " +
98
+ "(or, in tests, call .addPath(spec, 'dot.path') on the Spec you pass to Api.make).",
99
+ );
100
+ }
101
+ return groupPath;
102
+ };
@@ -2,8 +2,7 @@ import type * as FunctionSpec from "@confect/core/FunctionSpec";
2
2
  import type * as GroupSpec from "@confect/core/GroupSpec";
3
3
  import * as Registry from "@confect/core/Registry";
4
4
  import { Context, Effect, Layer, Ref, String } from "effect";
5
- import type * as Api from "./Api";
6
- import { resolveGroupPathUnsafe } from "./GroupPath";
5
+ import * as Api from "./Api";
7
6
  import type * as Handler from "./Handler";
8
7
  import { setNestedProperty } from "./internal/utils";
9
8
  import * as RegistryItem from "./RegistryItem";
@@ -44,7 +43,7 @@ export const make = <
44
43
  FunctionName
45
44
  >,
46
45
  ): Layer.Layer<FunctionImpl<string, FunctionName>> => {
47
- const groupPath = resolveGroupPathUnsafe(api.spec, group);
46
+ const groupPath = Api.resolveGroupPathUnsafe(api, group);
48
47
  const functionSpec = group.functions[functionName]!;
49
48
 
50
49
  return Layer.effect(
package/src/GroupImpl.ts CHANGED
@@ -12,9 +12,8 @@ import {
12
12
  Ref,
13
13
  String,
14
14
  } from "effect";
15
- import type * as Api from "./Api";
15
+ import * as Api from "./Api";
16
16
  import type * as FunctionImpl from "./FunctionImpl";
17
- import { resolveGroupPathUnsafe } from "./GroupPath";
18
17
 
19
18
  export const TypeId = "@confect/server/GroupImpl";
20
19
  export type TypeId = typeof TypeId;
@@ -83,7 +82,7 @@ export const make = <
83
82
  never,
84
83
  FunctionImpl.FromGroupSpec<Group>
85
84
  > => {
86
- const groupPath = resolveGroupPathUnsafe(api.spec, group);
85
+ const groupPath = Api.resolveGroupPathUnsafe(api, group);
87
86
 
88
87
  return Layer.succeed(
89
88
  GroupImpl<string, "Unfinalized">({
@@ -1,8 +0,0 @@
1
- import * as Spec from "@confect/core/Spec";
2
- import * as GroupSpec from "@confect/core/GroupSpec";
3
-
4
- //#region src/GroupPath.d.ts
5
- declare const resolveGroupPathUnsafe: (spec: Spec.AnyWithProps, target: GroupSpec.AnyWithProps) => string;
6
- //#endregion
7
- export { resolveGroupPathUnsafe };
8
- //# sourceMappingURL=GroupPath.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"GroupPath.d.ts","names":[],"sources":["../src/GroupPath.ts"],"mappings":";;;;cA+Ba,sBAAA,GACX,IAAA,EAAM,IAAA,CAAK,YAAA,EACX,MAAA,EAAQ,SAAA,CAAU,YAAA"}
package/dist/GroupPath.js DELETED
@@ -1,10 +0,0 @@
1
- import { Array, Option, Record, pipe } from "effect";
2
-
3
- //#region src/GroupPath.ts
4
- const resolveGroupPathInGroup = (group, target, pathSegments) => pipe(Record.toEntries(group.groups), Array.findFirst(([name, child]) => child === target ? Option.some(Array.join([...pathSegments, name], ".")) : resolveGroupPathInGroup(child, target, [...pathSegments, name])));
5
- const resolveGroupPath = (spec, target) => pipe(Record.toEntries(spec.groups), Array.findFirst(([name, group]) => group === target ? Option.some(name) : resolveGroupPathInGroup(group, target, [name])));
6
- const resolveGroupPathUnsafe = (spec, target) => resolveGroupPath(spec, target).pipe(Option.getOrThrowWith(() => /* @__PURE__ */ new Error("Could not resolve group path for the provided GroupSpec. Ensure the spec is part of the assembled API spec tree.")));
7
-
8
- //#endregion
9
- export { resolveGroupPathUnsafe };
10
- //# sourceMappingURL=GroupPath.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"GroupPath.js","names":[],"sources":["../src/GroupPath.ts"],"sourcesContent":["import type * as GroupSpec from \"@confect/core/GroupSpec\";\nimport type * as Spec from \"@confect/core/Spec\";\nimport { Array, Option, pipe, Record } from \"effect\";\n\nconst resolveGroupPathInGroup = (\n group: GroupSpec.AnyWithProps,\n target: GroupSpec.AnyWithProps,\n pathSegments: ReadonlyArray<string>,\n): Option.Option<string> =>\n pipe(\n Record.toEntries(group.groups),\n Array.findFirst(([name, child]) =>\n child === target\n ? Option.some(Array.join([...pathSegments, name], \".\"))\n : resolveGroupPathInGroup(child, target, [...pathSegments, name]),\n ),\n );\n\nconst resolveGroupPath = (\n spec: Spec.AnyWithProps,\n target: GroupSpec.AnyWithProps,\n): Option.Option<string> =>\n pipe(\n Record.toEntries(spec.groups),\n Array.findFirst(([name, group]) =>\n group === target\n ? Option.some(name)\n : resolveGroupPathInGroup(group, target, [name]),\n ),\n );\n\nexport const resolveGroupPathUnsafe = (\n spec: Spec.AnyWithProps,\n target: GroupSpec.AnyWithProps,\n): string =>\n resolveGroupPath(spec, target).pipe(\n Option.getOrThrowWith(\n () =>\n new Error(\n \"Could not resolve group path for the provided GroupSpec. Ensure the spec is part of the assembled API spec tree.\",\n ),\n ),\n );\n"],"mappings":";;;AAIA,MAAM,2BACJ,OACA,QACA,iBAEA,KACE,OAAO,UAAU,MAAM,OAAO,EAC9B,MAAM,WAAW,CAAC,MAAM,WACtB,UAAU,SACN,OAAO,KAAK,MAAM,KAAK,CAAC,GAAG,cAAc,KAAK,EAAE,IAAI,CAAC,GACrD,wBAAwB,OAAO,QAAQ,CAAC,GAAG,cAAc,KAAK,CAAC,CACpE,CACF;AAEH,MAAM,oBACJ,MACA,WAEA,KACE,OAAO,UAAU,KAAK,OAAO,EAC7B,MAAM,WAAW,CAAC,MAAM,WACtB,UAAU,SACN,OAAO,KAAK,KAAK,GACjB,wBAAwB,OAAO,QAAQ,CAAC,KAAK,CAAC,CACnD,CACF;AAEH,MAAa,0BACX,MACA,WAEA,iBAAiB,MAAM,OAAO,CAAC,KAC7B,OAAO,qCAEH,IAAI,MACF,mHACD,CACJ,CACF"}
package/src/GroupPath.ts DELETED
@@ -1,43 +0,0 @@
1
- import type * as GroupSpec from "@confect/core/GroupSpec";
2
- import type * as Spec from "@confect/core/Spec";
3
- import { Array, Option, pipe, Record } from "effect";
4
-
5
- const resolveGroupPathInGroup = (
6
- group: GroupSpec.AnyWithProps,
7
- target: GroupSpec.AnyWithProps,
8
- pathSegments: ReadonlyArray<string>,
9
- ): Option.Option<string> =>
10
- pipe(
11
- Record.toEntries(group.groups),
12
- Array.findFirst(([name, child]) =>
13
- child === target
14
- ? Option.some(Array.join([...pathSegments, name], "."))
15
- : resolveGroupPathInGroup(child, target, [...pathSegments, name]),
16
- ),
17
- );
18
-
19
- const resolveGroupPath = (
20
- spec: Spec.AnyWithProps,
21
- target: GroupSpec.AnyWithProps,
22
- ): Option.Option<string> =>
23
- pipe(
24
- Record.toEntries(spec.groups),
25
- Array.findFirst(([name, group]) =>
26
- group === target
27
- ? Option.some(name)
28
- : resolveGroupPathInGroup(group, target, [name]),
29
- ),
30
- );
31
-
32
- export const resolveGroupPathUnsafe = (
33
- spec: Spec.AnyWithProps,
34
- target: GroupSpec.AnyWithProps,
35
- ): string =>
36
- resolveGroupPath(spec, target).pipe(
37
- Option.getOrThrowWith(
38
- () =>
39
- new Error(
40
- "Could not resolve group path for the provided GroupSpec. Ensure the spec is part of the assembled API spec tree.",
41
- ),
42
- ),
43
- );