@confect/core 9.0.0-next.8 → 9.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/CHANGELOG.md +170 -4
  2. package/dist/FunctionProvenance.d.ts +87 -93
  3. package/dist/FunctionProvenance.d.ts.map +1 -1
  4. package/dist/FunctionSpec.d.ts +178 -218
  5. package/dist/FunctionSpec.d.ts.map +1 -1
  6. package/dist/GenericId.d.ts +6 -13
  7. package/dist/GenericId.d.ts.map +1 -1
  8. package/dist/GroupPath.d.ts +10 -16
  9. package/dist/GroupPath.d.ts.map +1 -1
  10. package/dist/GroupSpec.d.ts +38 -37
  11. package/dist/GroupSpec.d.ts.map +1 -1
  12. package/dist/GroupSpec.js.map +1 -1
  13. package/dist/Identifier.d.ts +2 -7
  14. package/dist/Identifier.d.ts.map +1 -1
  15. package/dist/Lazy.d.ts +1 -6
  16. package/dist/Lazy.d.ts.map +1 -1
  17. package/dist/PaginationResult.d.ts +10 -17
  18. package/dist/PaginationResult.d.ts.map +1 -1
  19. package/dist/Ref.d.ts +54 -52
  20. package/dist/Ref.d.ts.map +1 -1
  21. package/dist/Refs.d.ts +21 -21
  22. package/dist/Refs.d.ts.map +1 -1
  23. package/dist/Refs.js +2 -10
  24. package/dist/Refs.js.map +1 -1
  25. package/dist/Registry.d.ts +5 -10
  26. package/dist/Registry.d.ts.map +1 -1
  27. package/dist/RuntimeAndFunctionType.d.ts +36 -41
  28. package/dist/RuntimeAndFunctionType.d.ts.map +1 -1
  29. package/dist/Spec.d.ts +23 -33
  30. package/dist/Spec.d.ts.map +1 -1
  31. package/dist/Spec.js +7 -50
  32. package/dist/Spec.js.map +1 -1
  33. package/dist/SystemFields.d.ts +9 -15
  34. package/dist/SystemFields.d.ts.map +1 -1
  35. package/dist/Types.d.ts +27 -27
  36. package/dist/Types.d.ts.map +1 -1
  37. package/dist/UserIdentity.d.ts +55 -62
  38. package/dist/UserIdentity.d.ts.map +1 -1
  39. package/dist/index.d.ts +17 -17
  40. package/dist/index.d.ts.map +1 -0
  41. package/dist/tsconfig.src.tsbuildinfo +1 -0
  42. package/package.json +3 -11
  43. package/src/GroupSpec.ts +7 -6
  44. package/src/Refs.ts +10 -44
  45. package/src/Spec.ts +16 -83
@@ -1,44 +1,45 @@
1
- import { Runtime } from "./RuntimeAndFunctionType.js";
2
- import { AnyWithProps as AnyWithProps$1, AnyWithPropsWithRuntime as AnyWithPropsWithRuntime$1, Name as Name$1, WithName as WithName$1 } from "./FunctionSpec.js";
3
-
4
- //#region src/GroupSpec.d.ts
5
- declare namespace GroupSpec_d_exports {
6
- export { Any, AnyWithProps, AnyWithPropsWithRuntime, Functions, GroupNames, GroupSpec, Groups, Name, NamedAt, TypeId, WithName, isGroupSpec, make, makeAt, makeNode, makeNodeAt, withName };
1
+ import type * as FunctionSpec from "./FunctionSpec";
2
+ import type * as RuntimeAndFunctionType from "./RuntimeAndFunctionType";
3
+ export declare const TypeId = "@confect/core/GroupSpec";
4
+ export type TypeId = typeof TypeId;
5
+ export declare const isGroupSpec: (u: unknown) => u is AnyWithProps;
6
+ export interface GroupSpec<Runtime extends RuntimeAndFunctionType.Runtime, Name_ extends string, Functions_ extends FunctionSpec.AnyWithPropsWithRuntime<Runtime> = never, Groups_ extends AnyWithProps = never> {
7
+ readonly [TypeId]: TypeId;
8
+ readonly runtime: Runtime;
9
+ readonly name: Name_;
10
+ readonly functions: {
11
+ [FunctionName in FunctionSpec.Name<FunctionSpec.AnyWithPropsWithRuntime<Runtime>>]: FunctionSpec.WithName<Functions_, FunctionName>;
12
+ };
13
+ readonly groups: {
14
+ [GroupName in Name<Groups_>]: WithName<Groups_, GroupName>;
15
+ };
16
+ addFunction<Function extends FunctionSpec.AnyWithPropsWithRuntime<Runtime>>(function_: Function): GroupSpec<Runtime, Name_, Functions_ | Function, Groups_>;
17
+ addGroup<Group extends AnyWithProps>(group: Group): GroupSpec<Runtime, Name_, Functions_, Groups_ | Group>;
18
+ addGroupAt<const AtName extends string, Group extends AnyWithProps>(name: AtName, group: Group): GroupSpec<Runtime, Name_, Functions_, Groups_ | NamedAt<Group, AtName>>;
7
19
  }
8
- declare const TypeId = "@confect/core/GroupSpec";
9
- type TypeId = typeof TypeId;
10
- declare const isGroupSpec: (u: unknown) => u is AnyWithProps;
11
- interface GroupSpec<Runtime$2 extends Runtime, Name_ extends string, Functions_ extends AnyWithPropsWithRuntime$1<Runtime$2> = never, Groups_ extends AnyWithPropsWithRuntime<Runtime$2> = never> {
12
- readonly [TypeId]: TypeId;
13
- readonly runtime: Runtime$2;
14
- readonly name: Name_;
15
- readonly functions: { [FunctionName in Name$1<AnyWithPropsWithRuntime$1<Runtime$2>>]: WithName$1<Functions_, FunctionName> };
16
- readonly groups: { [GroupName in Name<Groups_>]: WithName<Groups_, GroupName> };
17
- addFunction<Function extends AnyWithPropsWithRuntime$1<Runtime$2>>(function_: Function): GroupSpec<Runtime$2, Name_, Functions_ | Function, Groups_>;
18
- addGroup<Group extends AnyWithPropsWithRuntime<Runtime$2>>(group: Group): GroupSpec<Runtime$2, Name_, Functions_, Groups_ | Group>;
19
- addGroupAt<const AtName extends string, Group extends AnyWithPropsWithRuntime<Runtime$2>>(name: AtName, group: Group): GroupSpec<Runtime$2, Name_, Functions_, Groups_ | NamedAt<Group, AtName>>;
20
+ export interface Any {
21
+ readonly [TypeId]: TypeId;
20
22
  }
21
- interface Any {
22
- readonly [TypeId]: TypeId;
23
+ export interface AnyWithProps extends GroupSpec<RuntimeAndFunctionType.Runtime, string, FunctionSpec.AnyWithProps, AnyWithProps> {
23
24
  }
24
- interface AnyWithProps extends GroupSpec<Runtime, string, AnyWithProps$1, AnyWithProps> {}
25
- interface AnyWithPropsWithRuntime<Runtime$1 extends Runtime> extends GroupSpec<Runtime$1, string, AnyWithPropsWithRuntime$1<Runtime$1>, AnyWithPropsWithRuntime<Runtime$1>> {}
26
- type Name<Group extends AnyWithProps> = Group["name"];
27
- type Functions<Group extends AnyWithProps> = Group["functions"][keyof Group["functions"]];
28
- type Groups<Group extends AnyWithProps> = Group["groups"][keyof Group["groups"]];
29
- type GroupNames<Group extends AnyWithProps> = [Groups<Group>] extends [never] ? never : Name<Groups<Group>>;
30
- type WithName<Group extends AnyWithProps, Name_ extends Name<Group>> = Extract<Group, {
31
- readonly name: Name_;
25
+ export interface AnyWithPropsWithRuntime<Runtime extends RuntimeAndFunctionType.Runtime> extends GroupSpec<Runtime, string, FunctionSpec.AnyWithPropsWithRuntime<Runtime>, AnyWithPropsWithRuntime<Runtime>> {
26
+ }
27
+ export type Name<Group extends AnyWithProps> = Group["name"];
28
+ export type Functions<Group extends AnyWithProps> = Group["functions"][keyof Group["functions"]];
29
+ export type Groups<Group extends AnyWithProps> = Group["groups"][keyof Group["groups"]];
30
+ export type GroupNames<Group extends AnyWithProps> = [Groups<Group>] extends [
31
+ never
32
+ ] ? never : Name<Groups<Group>>;
33
+ export type WithName<Group extends AnyWithProps, Name_ extends Name<Group>> = Extract<Group, {
34
+ readonly name: Name_;
32
35
  }>;
33
36
  /** Assigns a segment name to a leaf group created with {@link make} for typing and refs. */
34
- type NamedAt<Group extends Any, Name_ extends string> = Omit<Group, "name"> & {
35
- readonly name: Name_;
37
+ export type NamedAt<Group extends Any, Name_ extends string> = Omit<Group, "name"> & {
38
+ readonly name: Name_;
36
39
  };
37
- declare const make: () => GroupSpec<"Convex", "">;
38
- declare const makeAt: <const Name_ extends string>(name: Name_) => GroupSpec<"Convex", Name_>;
39
- declare const makeNode: () => GroupSpec<"Node", "">;
40
- declare const makeNodeAt: <const Name_ extends string>(name: Name_) => GroupSpec<"Node", Name_>;
41
- declare const withName: <const Name_ extends string>(name: Name_, group: Any) => AnyWithProps;
42
- //#endregion
43
- export { Any, AnyWithProps, AnyWithPropsWithRuntime, Functions, GroupNames, GroupSpec, GroupSpec_d_exports, Groups, Name, NamedAt, TypeId, WithName, isGroupSpec, make, makeAt, makeNode, makeNodeAt, withName };
40
+ export declare const make: () => GroupSpec<"Convex", "">;
41
+ export declare const makeAt: <const Name_ extends string>(name: Name_) => GroupSpec<"Convex", Name_>;
42
+ export declare const makeNode: () => GroupSpec<"Node", "">;
43
+ export declare const makeNodeAt: <const Name_ extends string>(name: Name_) => GroupSpec<"Node", Name_>;
44
+ export declare const withName: <const Name_ extends string>(name: Name_, group: Any) => AnyWithProps;
44
45
  //# sourceMappingURL=GroupSpec.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"GroupSpec.d.ts","names":[],"sources":["../src/GroupSpec.ts"],"mappings":";;;;;;;cAMa,MAAA;AAAA,KACD,MAAA,UAAgB,MAAA;AAAA,cAEf,WAAA,GAAe,CAAA,cAAa,CAAA,IAAK,YAAA;AAAA,UAG7B,SAAA,mBACC,OAAA,2CAEG,yBAAA,CAAqC,SAAA,2BACxC,uBAAA,CAAwB,SAAA;EAAA,UAE9B,MAAA,GAAS,MAAA;EAAA,SACV,OAAA,EAAS,SAAA;EAAA,SACT,IAAA,EAAM,KAAA;EAAA,SACN,SAAA,qBACU,MAAA,CACf,yBAAA,CAAqC,SAAA,KACnC,UAAA,CAAsB,UAAA,EAAY,YAAA;EAAA,SAE/B,MAAA,kBACO,IAAA,CAAK,OAAA,IAAW,QAAA,CAAS,OAAA,EAAS,SAAA;EAGlD,WAAA,kBAA6B,yBAAA,CAAqC,SAAA,GAChE,SAAA,EAAW,QAAA,GACV,SAAA,CAAU,SAAA,EAAS,KAAA,EAAO,UAAA,GAAa,QAAA,EAAU,OAAA;EAEpD,QAAA,eAAuB,uBAAA,CAAwB,SAAA,GAC7C,KAAA,EAAO,KAAA,GACN,SAAA,CAAU,SAAA,EAAS,KAAA,EAAO,UAAA,EAAY,OAAA,GAAU,KAAA;EAEnD,UAAA,4CAEgB,uBAAA,CAAwB,SAAA,GAEtC,IAAA,EAAM,MAAA,EACN,KAAA,EAAO,KAAA,GACN,SAAA,CAAU,SAAA,EAAS,KAAA,EAAO,UAAA,EAAY,OAAA,GAAU,OAAA,CAAQ,K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M,MAAM,OAAO,CAAC,KAAK,SAAS,GAAG,EAAE,KAAK,SAAS,MAAM,IAAI,IAAI,CACjE,KAAK,EACL,MAAM,CACP,GAAG;IACF,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC;CACtB,CAAC;AAmEF,eAAO,MAAM,IAAI,QAAO,SAAS,CAAC,QAAQ,EAAE,EAAE,CAM1C,CAAC;AAEL,eAAO,MAAM,MAAM,GAAI,KAAK,CAAC,KAAK,SAAS,MAAM,EAC/C,MAAM,KAAK,KACV,SAAS,CAAC,QAAQ,EAAE,KAAK,CAS3B,CAAC;AAEF,eAAO,MAAM,QAAQ,QAAO,SAAS,CAAC,MAAM,EAAE,EAAE,CAM5C,CAAC;AAEL,eAAO,MAAM,UAAU,GAAI,KAAK,CAAC,KAAK,SAAS,MAAM,EACnD,MAAM,KAAK,KACV,SAAS,CAAC,MAAM,EAAE,KAAK,CASzB,CAAC;AAEF,eAAO,MAAM,QAAQ,GAAI,KAAK,CAAC,KAAK,SAAS,MAAM,EACjD,MAAM,KAAK,EACX,OAAO,GAAG,KACT,YAcF,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"GroupSpec.js","names":[],"sources":["../src/GroupSpec.ts"],"sourcesContent":["import * as Predicate from \"effect/Predicate\";\nimport * as Record from \"effect/Record\";\nimport type * as FunctionSpec from \"./FunctionSpec\";\nimport type * as RuntimeAndFunctionType from \"./RuntimeAndFunctionType\";\nimport { validateConfectFunctionIdentifier } from \"./Identifier\";\n\nexport const TypeId = \"@confect/core/GroupSpec\";\nexport type TypeId = typeof TypeId;\n\nexport const isGroupSpec = (u: unknown): u is AnyWithProps =>\n Predicate.hasProperty(u, TypeId);\n\nexport interface GroupSpec<\n Runtime extends RuntimeAndFunctionType.Runtime,\n Name_ extends string,\n Functions_ extends FunctionSpec.AnyWithPropsWithRuntime<Runtime> = never,\n Groups_ extends AnyWithPropsWithRuntime<Runtime> = never,\n> {\n readonly [TypeId]: TypeId;\n readonly runtime: Runtime;\n readonly name: Name_;\n readonly functions: {\n [FunctionName in FunctionSpec.Name<\n FunctionSpec.AnyWithPropsWithRuntime<Runtime>\n >]: FunctionSpec.WithName<Functions_, FunctionName>;\n };\n readonly groups: {\n [GroupName in Name<Groups_>]: WithName<Groups_, GroupName>;\n };\n\n addFunction<Function extends FunctionSpec.AnyWithPropsWithRuntime<Runtime>>(\n function_: Function,\n ): GroupSpec<Runtime, Name_, Functions_ | Function, Groups_>;\n\n addGroup<Group extends AnyWithPropsWithRuntime<Runtime>>(\n group: Group,\n ): GroupSpec<Runtime, Name_, Functions_, Groups_ | Group>;\n\n addGroupAt<\n const AtName extends string,\n Group extends AnyWithPropsWithRuntime<Runtime>,\n >(\n name: AtName,\n group: Group,\n ): GroupSpec<Runtime, Name_, Functions_, Groups_ | NamedAt<Group, AtName>>;\n}\n\nexport interface Any {\n readonly [TypeId]: TypeId;\n}\n\nexport interface AnyWithProps extends GroupSpec<\n RuntimeAndFunctionType.Runtime,\n string,\n FunctionSpec.AnyWithProps,\n AnyWithProps\n> {}\n\nexport interface AnyWithPropsWithRuntime<\n Runtime extends RuntimeAndFunctionType.Runtime,\n> extends GroupSpec<\n Runtime,\n string,\n FunctionSpec.AnyWithPropsWithRuntime<Runtime>,\n AnyWithPropsWithRuntime<Runtime>\n> {}\n\nexport type Name<Group extends AnyWithProps> = Group[\"name\"];\n\nexport type Functions<Group extends AnyWithProps> =\n Group[\"functions\"][keyof Group[\"functions\"]];\n\nexport type Groups<Group extends AnyWithProps> =\n Group[\"groups\"][keyof Group[\"groups\"]];\n\nexport type GroupNames<Group extends AnyWithProps> = [Groups<Group>] extends [\n never,\n]\n ? never\n : Name<Groups<Group>>;\n\nexport type WithName<\n Group extends AnyWithProps,\n Name_ extends Name<Group>,\n> = Extract<Group, { readonly name: Name_ }>;\n\n/** Assigns a segment name to a leaf group created with {@link make} for typing and refs. */\nexport type NamedAt<Group extends Any, Name_ extends string> = Omit<\n Group,\n \"name\"\n> & {\n readonly name: Name_;\n};\n\nconst Proto = {\n [TypeId]: TypeId,\n\n addFunction<Function extends FunctionSpec.AnyWithProps>(\n this: Any,\n function_: Function,\n ) {\n const this_ = this as AnyWithProps;\n\n return makeProto({\n runtime: this_.runtime,\n name: this_.name,\n functions: Record.set(this_.functions, function_.name, function_),\n groups: this_.groups,\n });\n },\n\n addGroup<Group extends Any>(this: Any, group: Group) {\n const this_ = this as AnyWithProps;\n const group_ = group as unknown as AnyWithProps;\n\n return makeProto({\n runtime: this_.runtime,\n name: this_.name,\n functions: this_.functions,\n groups: Record.set(this_.groups, group_.name, group_),\n });\n },\n\n addGroupAt<Group extends Any>(this: Any, name: string, group: Group) {\n const this_ = this as AnyWithProps;\n const group_ = group as unknown as AnyWithProps;\n\n return makeProto({\n runtime: this_.runtime,\n name: this_.name,\n functions: this_.functions,\n groups: Record.set(this_.groups, name, withName(name, group_)),\n });\n },\n};\n\nconst makeProto = <\n Runtime extends RuntimeAndFunctionType.Runtime,\n Name_ extends string,\n Functions_ extends FunctionSpec.AnyWithPropsWithRuntime<Runtime>,\n Groups_ extends AnyWithPropsWithRuntime<Runtime>,\n>({\n runtime,\n name,\n functions,\n groups,\n}: {\n runtime: Runtime;\n name: Name_;\n functions: Record.ReadonlyRecord<string, Functions_>;\n groups: Record.ReadonlyRecord<string, Groups_>;\n}): GroupSpec<Runtime, Name_, Functions_, Groups_> =>\n Object.assign(Object.create(Proto), {\n runtime,\n name,\n functions,\n groups,\n });\n\nexport const make = (): GroupSpec<\"Convex\", \"\"> =>\n makeProto({\n runtime: \"Convex\",\n name: \"\",\n functions: Record.empty(),\n groups: Record.empty(),\n });\n\nexport const makeAt = <const Name_ extends string>(\n name: Name_,\n): GroupSpec<\"Convex\", Name_> => {\n validateConfectFunctionIdentifier(name);\n\n return makeProto({\n runtime: \"Convex\",\n name,\n functions: Record.empty(),\n groups: Record.empty(),\n });\n};\n\nexport const makeNode = (): GroupSpec<\"Node\", \"\"> =>\n makeProto({\n runtime: \"Node\",\n name: \"\",\n functions: Record.empty(),\n groups: Record.empty(),\n });\n\nexport const makeNodeAt = <const Name_ extends string>(\n name: Name_,\n): GroupSpec<\"Node\", Name_> => {\n validateConfectFunctionIdentifier(name);\n\n return makeProto({\n runtime: \"Node\",\n name,\n functions: Record.empty(),\n groups: Record.empty(),\n });\n};\n\nexport const withName = <const Name_ extends string>(\n name: Name_,\n group: Any,\n): AnyWithProps => {\n validateConfectFunctionIdentifier(name);\n const group_ = group as AnyWithProps;\n\n if (group_.name === name) {\n return group_;\n }\n\n return makeProto({\n runtime: group_.runtime,\n name,\n functions: group_.functions,\n groups: group_.groups,\n });\n};\n"],"mappings":";;;;;;;;;;;;;;;AAMA,MAAa,SAAS;AAGtB,MAAa,eAAe,MAC1B,UAAU,YAAY,GAAG,OAAO;AAoFlC,MAAM,QAAQ;EACX,SAAS;CAEV,YAEE,WACA;EACA,MAAM,QAAQ;AAEd,SAAO,UAAU;GACf,SAAS,MAAM;GACf,MAAM,MAAM;GACZ,WAAW,OAAO,IAAI,MAAM,WAAW,UAAU,MAAM,UAAU;GACjE,QAAQ,MAAM;GACf,CAAC;;CAGJ,SAAuC,OAAc;EACnD,MAAM,QAAQ;EACd,MAAM,SAAS;AAEf,SAAO,UAAU;GACf,SAAS,MAAM;GACf,MAAM,MAAM;GACZ,WAAW,MAAM;GACjB,QAAQ,OAAO,IAAI,MAAM,QAAQ,OAAO,MAAM,OAAO;GACtD,CAAC;;CAGJ,WAAyC,MAAc,OAAc;EACnE,MAAM,QAAQ;EACd,MAAM,SAAS;AAEf,SAAO,UAAU;GACf,SAAS,MAAM;GACf,MAAM,MAAM;GACZ,WAAW,MAAM;GACjB,QAAQ,OAAO,IAAI,MAAM,QAAQ,MAAM,SAAS,MAAM,OAAO,CAAC;GAC/D,CAAC;;CAEL;AAED,MAAM,aAKJ,EACA,SACA,MACA,WACA,aAOA,OAAO,OAAO,OAAO,OAAO,MAAM,EAAE;CAClC;CACA;CACA;CACA;CACD,CAAC;AAEJ,MAAa,aACX,UAAU;CACR,SAAS;CACT,MAAM;CACN,WAAW,OAAO,OAAO;CACzB,QAAQ,OAAO,OAAO;CACvB,CAAC;AAEJ,MAAa,UACX,SAC+B;AAC/B,mCAAkC,KAAK;AAEvC,QAAO,UAAU;EACf,SAAS;EACT;EACA,WAAW,OAAO,OAAO;EACzB,QAAQ,OAAO,OAAO;EACvB,CAAC;;AAGJ,MAAa,iBACX,UAAU;CACR,SAAS;CACT,MAAM;CACN,WAAW,OAAO,OAAO;CACzB,QAAQ,OAAO,OAAO;CACvB,CAAC;AAEJ,MAAa,cACX,SAC6B;AAC7B,mCAAkC,KAAK;AAEvC,QAAO,UAAU;EACf,SAAS;EACT;EACA,WAAW,OAAO,OAAO;EACzB,QAAQ,OAAO,OAAO;EACvB,CAAC;;AAGJ,MAAa,YACX,MACA,UACiB;AACjB,mCAAkC,KAAK;CACvC,MAAM,SAAS;AAEf,KAAI,OAAO,SAAS,KAClB,QAAO;AAGT,QAAO,UAAU;EACf,SAAS,OAAO;EAChB;EACA,WAAW,OAAO;EAClB,QAAQ,OAAO;EAChB,CAAC"}
1
+ {"version":3,"file":"GroupSpec.js","names":[],"sources":["../src/GroupSpec.ts"],"sourcesContent":["import * as Predicate from \"effect/Predicate\";\nimport * as Record from \"effect/Record\";\nimport type * as FunctionSpec from \"./FunctionSpec\";\nimport type * as RuntimeAndFunctionType from \"./RuntimeAndFunctionType\";\nimport { validateConfectFunctionIdentifier } from \"./Identifier\";\n\nexport const TypeId = \"@confect/core/GroupSpec\";\nexport type TypeId = typeof TypeId;\n\nexport const isGroupSpec = (u: unknown): u is AnyWithProps =>\n Predicate.hasProperty(u, TypeId);\n\nexport interface GroupSpec<\n Runtime extends RuntimeAndFunctionType.Runtime,\n Name_ extends string,\n Functions_ extends FunctionSpec.AnyWithPropsWithRuntime<Runtime> = never,\n // Subgroups may be of any runtime, independent of this group's own runtime: a\n // group is only a namespace for its children, which are otherwise-independent\n // modules. Functions, by contrast, stay homogeneous (a Node group only accepts\n // Node actions) — `addFunction` keeps the `<Runtime>` bound below.\n Groups_ extends AnyWithProps = never,\n> {\n readonly [TypeId]: TypeId;\n readonly runtime: Runtime;\n readonly name: Name_;\n readonly functions: {\n [FunctionName in FunctionSpec.Name<\n FunctionSpec.AnyWithPropsWithRuntime<Runtime>\n >]: FunctionSpec.WithName<Functions_, FunctionName>;\n };\n readonly groups: {\n [GroupName in Name<Groups_>]: WithName<Groups_, GroupName>;\n };\n\n addFunction<Function extends FunctionSpec.AnyWithPropsWithRuntime<Runtime>>(\n function_: Function,\n ): GroupSpec<Runtime, Name_, Functions_ | Function, Groups_>;\n\n addGroup<Group extends AnyWithProps>(\n group: Group,\n ): GroupSpec<Runtime, Name_, Functions_, Groups_ | Group>;\n\n addGroupAt<const AtName extends string, Group extends AnyWithProps>(\n name: AtName,\n group: Group,\n ): GroupSpec<Runtime, Name_, Functions_, Groups_ | NamedAt<Group, AtName>>;\n}\n\nexport interface Any {\n readonly [TypeId]: TypeId;\n}\n\nexport interface AnyWithProps extends GroupSpec<\n RuntimeAndFunctionType.Runtime,\n string,\n FunctionSpec.AnyWithProps,\n AnyWithProps\n> {}\n\nexport interface AnyWithPropsWithRuntime<\n Runtime extends RuntimeAndFunctionType.Runtime,\n> extends GroupSpec<\n Runtime,\n string,\n FunctionSpec.AnyWithPropsWithRuntime<Runtime>,\n AnyWithPropsWithRuntime<Runtime>\n> {}\n\nexport type Name<Group extends AnyWithProps> = Group[\"name\"];\n\nexport type Functions<Group extends AnyWithProps> =\n Group[\"functions\"][keyof Group[\"functions\"]];\n\nexport type Groups<Group extends AnyWithProps> =\n Group[\"groups\"][keyof Group[\"groups\"]];\n\nexport type GroupNames<Group extends AnyWithProps> = [Groups<Group>] extends [\n never,\n]\n ? never\n : Name<Groups<Group>>;\n\nexport type WithName<\n Group extends AnyWithProps,\n Name_ extends Name<Group>,\n> = Extract<Group, { readonly name: Name_ }>;\n\n/** Assigns a segment name to a leaf group created with {@link make} for typing and refs. */\nexport type NamedAt<Group extends Any, Name_ extends string> = Omit<\n Group,\n \"name\"\n> & {\n readonly name: Name_;\n};\n\nconst Proto = {\n [TypeId]: TypeId,\n\n addFunction<Function extends FunctionSpec.AnyWithProps>(\n this: Any,\n function_: Function,\n ) {\n const this_ = this as AnyWithProps;\n\n return makeProto({\n runtime: this_.runtime,\n name: this_.name,\n functions: Record.set(this_.functions, function_.name, function_),\n groups: this_.groups,\n });\n },\n\n addGroup<Group extends Any>(this: Any, group: Group) {\n const this_ = this as AnyWithProps;\n const group_ = group as unknown as AnyWithProps;\n\n return makeProto({\n runtime: this_.runtime,\n name: this_.name,\n functions: this_.functions,\n groups: Record.set(this_.groups, group_.name, group_),\n });\n },\n\n addGroupAt<Group extends Any>(this: Any, name: string, group: Group) {\n const this_ = this as AnyWithProps;\n const group_ = group as unknown as AnyWithProps;\n\n return makeProto({\n runtime: this_.runtime,\n name: this_.name,\n functions: this_.functions,\n groups: Record.set(this_.groups, name, withName(name, group_)),\n });\n },\n};\n\nconst makeProto = <\n Runtime extends RuntimeAndFunctionType.Runtime,\n Name_ extends string,\n Functions_ extends FunctionSpec.AnyWithPropsWithRuntime<Runtime>,\n Groups_ extends AnyWithPropsWithRuntime<Runtime>,\n>({\n runtime,\n name,\n functions,\n groups,\n}: {\n runtime: Runtime;\n name: Name_;\n functions: Record.ReadonlyRecord<string, Functions_>;\n groups: Record.ReadonlyRecord<string, Groups_>;\n}): GroupSpec<Runtime, Name_, Functions_, Groups_> =>\n Object.assign(Object.create(Proto), {\n runtime,\n name,\n functions,\n groups,\n });\n\nexport const make = (): GroupSpec<\"Convex\", \"\"> =>\n makeProto({\n runtime: \"Convex\",\n name: \"\",\n functions: Record.empty(),\n groups: Record.empty(),\n });\n\nexport const makeAt = <const Name_ extends string>(\n name: Name_,\n): GroupSpec<\"Convex\", Name_> => {\n validateConfectFunctionIdentifier(name);\n\n return makeProto({\n runtime: \"Convex\",\n name,\n functions: Record.empty(),\n groups: Record.empty(),\n });\n};\n\nexport const makeNode = (): GroupSpec<\"Node\", \"\"> =>\n makeProto({\n runtime: \"Node\",\n name: \"\",\n functions: Record.empty(),\n groups: Record.empty(),\n });\n\nexport const makeNodeAt = <const Name_ extends string>(\n name: Name_,\n): GroupSpec<\"Node\", Name_> => {\n validateConfectFunctionIdentifier(name);\n\n return makeProto({\n runtime: \"Node\",\n name,\n functions: Record.empty(),\n groups: Record.empty(),\n });\n};\n\nexport const withName = <const Name_ extends string>(\n name: Name_,\n group: Any,\n): AnyWithProps => {\n validateConfectFunctionIdentifier(name);\n const group_ = group as AnyWithProps;\n\n if (group_.name === name) {\n return group_;\n }\n\n return makeProto({\n runtime: group_.runtime,\n name,\n functions: group_.functions,\n groups: group_.groups,\n });\n};\n"],"mappings":";;;;;;;;;;;;;;;AAMA,MAAa,SAAS;AAGtB,MAAa,eAAe,MAC1B,UAAU,YAAY,GAAG,OAAO;AAqFlC,MAAM,QAAQ;EACX,SAAS;CAEV,YAEE,WACA;EACA,MAAM,QAAQ;AAEd,SAAO,UAAU;GACf,SAAS,MAAM;GACf,MAAM,MAAM;GACZ,WAAW,OAAO,IAAI,MAAM,WAAW,UAAU,MAAM,UAAU;GACjE,QAAQ,MAAM;GACf,CAAC;;CAGJ,SAAuC,OAAc;EACnD,MAAM,QAAQ;EACd,MAAM,SAAS;AAEf,SAAO,UAAU;GACf,SAAS,MAAM;GACf,MAAM,MAAM;GACZ,WAAW,MAAM;GACjB,QAAQ,OAAO,IAAI,MAAM,QAAQ,OAAO,MAAM,OAAO;GACtD,CAAC;;CAGJ,WAAyC,MAAc,OAAc;EACnE,MAAM,QAAQ;EACd,MAAM,SAAS;AAEf,SAAO,UAAU;GACf,SAAS,MAAM;GACf,MAAM,MAAM;GACZ,WAAW,MAAM;GACjB,QAAQ,OAAO,IAAI,MAAM,QAAQ,MAAM,SAAS,MAAM,OAAO,CAAC;GAC/D,CAAC;;CAEL;AAED,MAAM,aAKJ,EACA,SACA,MACA,WACA,aAOA,OAAO,OAAO,OAAO,OAAO,MAAM,EAAE;CAClC;CACA;CACA;CACA;CACD,CAAC;AAEJ,MAAa,aACX,UAAU;CACR,SAAS;CACT,MAAM;CACN,WAAW,OAAO,OAAO;CACzB,QAAQ,OAAO,OAAO;CACvB,CAAC;AAEJ,MAAa,UACX,SAC+B;AAC/B,mCAAkC,KAAK;AAEvC,QAAO,UAAU;EACf,SAAS;EACT;EACA,WAAW,OAAO,OAAO;EACzB,QAAQ,OAAO,OAAO;EACvB,CAAC;;AAGJ,MAAa,iBACX,UAAU;CACR,SAAS;CACT,MAAM;CACN,WAAW,OAAO,OAAO;CACzB,QAAQ,OAAO,OAAO;CACvB,CAAC;AAEJ,MAAa,cACX,SAC6B;AAC7B,mCAAkC,KAAK;AAEvC,QAAO,UAAU;EACf,SAAS;EACT;EACA,WAAW,OAAO,OAAO;EACzB,QAAQ,OAAO,OAAO;EACvB,CAAC;;AAGJ,MAAa,YACX,MACA,UACiB;AACjB,mCAAkC,KAAK;CACvC,MAAM,SAAS;AAEf,KAAI,OAAO,SAAS,KAClB,QAAO;AAGT,QAAO,UAAU;EACf,SAAS,OAAO;EAChB;EACA,WAAW,OAAO;EAClB,QAAQ,OAAO;EAChB,CAAC"}
@@ -1,7 +1,4 @@
1
- declare namespace Identifier_d_exports {
2
- export { validateConfectFunctionIdentifier, validateConfectTableIdentifier };
3
- }
4
- declare const validateConfectFunctionIdentifier: (identifier: string) => void;
1
+ export declare const validateConfectFunctionIdentifier: (identifier: string) => void;
5
2
  /**
6
3
  * Validate that `identifier` is suitable as a Convex table name (and, equivalently,
7
4
  * as a `confect/tables/<identifier>.ts` filename).
@@ -13,7 +10,5 @@ declare const validateConfectFunctionIdentifier: (identifier: string) => void;
13
10
  * - Must not be a reserved JavaScript identifier, so the name can also be used
14
11
  * as a binding name in generated code without escaping.
15
12
  */
16
- declare const validateConfectTableIdentifier: (identifier: string) => void;
17
- //#endregion
18
- export { Identifier_d_exports, validateConfectFunctionIdentifier, validateConfectTableIdentifier };
13
+ export declare const validateConfectTableIdentifier: (identifier: string) => void;
19
14
  //# sourceMappingURL=Identifier.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Identifier.d.ts","names":[],"sources":["../src/Identifier.ts"],"mappings":";;;cA4Ea,iCAAA,GAAqC,UAAA;;;;;;;AAAlD;;;;;cA+Ba,8BAAA,GAAkC,UAAA"}
1
+ {"version":3,"file":"Identifier.d.ts","sourceRoot":"","sources":["../src/Identifier.ts"],"names":[],"mappings":"AA4EA,eAAO,MAAM,iCAAiC,GAAI,YAAY,MAAM,SAkBnE,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,8BAA8B,GAAI,YAAY,MAAM,SAYhE,CAAC"}
package/dist/Lazy.d.ts CHANGED
@@ -1,6 +1,3 @@
1
- declare namespace Lazy_d_exports {
2
- export { defineProperty };
3
- }
4
1
  /**
5
2
  * Install a lazy memoised property on `target`. The first access runs
6
3
  * `compute()` and replaces the getter with a plain, non-writable data
@@ -21,7 +18,5 @@ declare namespace Lazy_d_exports {
21
18
  * `Table` `Fields` / `Doc` / `tableDefinition`), so there is no chance of the
22
19
  * two drifting apart.
23
20
  */
24
- declare const defineProperty: <T extends object, K extends PropertyKey>(target: T, key: K, compute: () => unknown) => void;
25
- //#endregion
26
- export { Lazy_d_exports, defineProperty };
21
+ export declare const defineProperty: <T extends object, K extends PropertyKey>(target: T, key: K, compute: () => unknown) => void;
27
22
  //# sourceMappingURL=Lazy.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Lazy.d.ts","names":[],"sources":["../src/Lazy.ts"],"mappings":";;;;;;;AAoBA;;;;;;;;;;;;;;;;cAAa,cAAA,+BAA8C,WAAA,EACzD,MAAA,EAAQ,CAAA,EACR,GAAA,EAAK,CAAA,EACL,OAAA"}
1
+ {"version":3,"file":"Lazy.d.ts","sourceRoot":"","sources":["../src/Lazy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,cAAc,GAAI,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,WAAW,EACpE,QAAQ,CAAC,EACT,KAAK,CAAC,EACN,SAAS,MAAM,OAAO,KACrB,IAeF,CAAC"}
@@ -1,20 +1,13 @@
1
1
  import * as Schema from "effect/Schema";
2
-
3
- //#region src/PaginationResult.d.ts
4
- declare namespace PaginationResult_d_exports {
5
- export { PaginationResult };
6
- }
7
- declare const PaginationResult: <Doc extends Schema.Schema.AnyNoContext>(Doc: Doc) => Schema.Struct<{
8
- page: Schema.mutable<Schema.Array$<Doc>>;
9
- isDone: typeof Schema.Boolean;
10
- continueCursor: typeof Schema.String;
11
- splitCursor: Schema.optionalWith<Schema.Union<[typeof Schema.String, typeof Schema.Null]>, {
12
- exact: true;
13
- }>;
14
- pageStatus: Schema.optionalWith<Schema.Union<[Schema.Literal<["SplitRecommended"]>, Schema.Literal<["SplitRequired"]>, typeof Schema.Null]>, {
15
- exact: true;
16
- }>;
2
+ export declare const PaginationResult: <Doc extends Schema.Schema.AnyNoContext>(Doc: Doc) => Schema.Struct<{
3
+ page: Schema.mutable<Schema.Array$<Doc>>;
4
+ isDone: typeof Schema.Boolean;
5
+ continueCursor: typeof Schema.String;
6
+ splitCursor: Schema.optionalWith<Schema.Union<[typeof Schema.String, typeof Schema.Null]>, {
7
+ exact: true;
8
+ }>;
9
+ pageStatus: Schema.optionalWith<Schema.Union<[Schema.Literal<["SplitRecommended"]>, Schema.Literal<["SplitRequired"]>, typeof Schema.Null]>, {
10
+ exact: true;
11
+ }>;
17
12
  }>;
18
- //#endregion
19
- export { PaginationResult, PaginationResult_d_exports };
20
13
  //# sourceMappingURL=PaginationResult.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"PaginationResult.d.ts","names":[],"sources":["../src/PaginationResult.ts"],"mappings":";;;;;;cAEa,gBAAA,eAAgC,MAAA,CAAO,MAAA,CAAO,YAAA,EACzD,GAAA,EAAK,GAAA,KAAG,MAAA,CAAA,MAAA"}
1
+ {"version":3,"file":"PaginationResult.d.ts","sourceRoot":"","sources":["../src/PaginationResult.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,eAAO,MAAM,gBAAgB,GAAI,GAAG,SAAS,MAAM,CAAC,MAAM,CAAC,YAAY,EACrE,KAAK,GAAG;;;;;;;;;;EAiBN,CAAC"}
package/dist/Ref.d.ts CHANGED
@@ -1,57 +1,61 @@
1
- import { AnyAction as AnyAction$1, AnyMutation as AnyMutation$1, AnyQuery as AnyQuery$1, GetFunctionType as GetFunctionType$1, GetRuntime as GetRuntime$1, RuntimeAndFunctionType } from "./RuntimeAndFunctionType.js";
2
- import { AnyWithProps, Args as Args$1, Error as Error$1, GetFunctionVisibility as GetFunctionVisibility$1, GetRuntimeAndFunctionType as GetRuntimeAndFunctionType$1, Returns as Returns$1 } from "./FunctionSpec.js";
3
- import { FunctionReference as FunctionReference$1, FunctionVisibility } from "convex/server";
4
- import { ConvexError, Value } from "convex/values";
1
+ import type { FunctionReference as ConvexFunctionReference, FunctionVisibility } from "convex/server";
2
+ import type { Value } from "convex/values";
3
+ import { ConvexError } from "convex/values";
4
+ import type { ParseResult } from "effect";
5
5
  import * as Effect from "effect/Effect";
6
- import * as Option$1 from "effect/Option";
7
- import { ParseResult } from "effect";
8
-
9
- //#region src/Ref.d.ts
10
- declare namespace Ref_d_exports {
11
- export { Any, AnyAction, AnyInternal, AnyMutation, AnyPublic, AnyPublicAction, AnyPublicMutation, AnyPublicQuery, AnyQuery, Args, Error, FromFunctionSpec, FunctionReference, GetFunctionType, GetFunctionVisibility, GetRuntime, GetRuntimeAndFunctionType, OptionalArgs, Ref, Returns, decodeError, decodeErrorOrElse, decodeErrorSync, decodeReturns, decodeReturnsSync, encodeArgs, encodeArgsSync, getConvexFunctionName, getFunctionReference, hasErrorSchema, isConvexError, make, maybeDecodeErrorSync, runWithCodec };
6
+ import * as Option from "effect/Option";
7
+ import type * as FunctionSpec from "./FunctionSpec";
8
+ import type * as RuntimeAndFunctionType from "./RuntimeAndFunctionType";
9
+ export interface Ref<_RuntimeAndFunctionType extends RuntimeAndFunctionType.RuntimeAndFunctionType, _FunctionVisibility extends FunctionVisibility, _Args, _Returns, _Error = never> {
10
+ readonly _RuntimeAndFunctionType?: _RuntimeAndFunctionType;
11
+ readonly _FunctionVisibility?: _FunctionVisibility;
12
+ readonly _Args?: _Args;
13
+ readonly _Returns?: _Returns;
14
+ readonly _Error?: _Error;
12
15
  }
13
- interface Ref<_RuntimeAndFunctionType extends RuntimeAndFunctionType, _FunctionVisibility extends FunctionVisibility, _Args, _Returns, _Error = never> {
14
- readonly _RuntimeAndFunctionType?: _RuntimeAndFunctionType;
15
- readonly _FunctionVisibility?: _FunctionVisibility;
16
- readonly _Args?: _Args;
17
- readonly _Returns?: _Returns;
18
- readonly _Error?: _Error;
16
+ export interface Any extends Ref<any, any, any, any, any> {
19
17
  }
20
- interface Any extends Ref<any, any, any, any, any> {}
21
- interface AnyInternal extends Ref<any, "internal", any, any, any> {}
22
- interface AnyPublic extends Ref<any, "public", any, any, any> {}
23
- interface AnyQuery extends Ref<AnyQuery$1, FunctionVisibility, any, any, any> {}
24
- interface AnyMutation extends Ref<AnyMutation$1, FunctionVisibility, any, any, any> {}
25
- interface AnyAction extends Ref<AnyAction$1, FunctionVisibility, any, any, any> {}
26
- interface AnyPublicQuery extends Ref<AnyQuery$1, "public", any, any, any> {}
27
- interface AnyPublicMutation extends Ref<AnyMutation$1, "public", any, any, any> {}
28
- interface AnyPublicAction extends Ref<AnyAction$1, "public", any, any, any> {}
29
- type GetRuntimeAndFunctionType<Ref_> = Ref_ extends Ref<infer RuntimeAndFunctionType_, infer _FunctionVisibility, infer _Args, infer _Returns, infer _Error> ? RuntimeAndFunctionType_ : never;
30
- type GetRuntime<Ref_> = Ref_ extends Ref<infer RuntimeAndFunctionType_, infer _FunctionVisibility, infer _Args, infer _Returns, infer _Error> ? GetRuntime$1<RuntimeAndFunctionType_> : never;
31
- type GetFunctionType<Ref_> = Ref_ extends Ref<infer RuntimeAndFunctionType_, infer _FunctionVisibility, infer _Args, infer _Returns, infer _Error> ? GetFunctionType$1<RuntimeAndFunctionType_> : never;
32
- type GetFunctionVisibility<Ref_> = Ref_ extends Ref<infer _RuntimeAndFunctionType, infer FunctionVisibility_, infer _Args, infer _Returns, infer _Error> ? FunctionVisibility_ : never;
33
- type Args<Ref_> = Ref_ extends Ref<infer _RuntimeAndFunctionType, infer _FunctionVisibility, infer Args_, infer _Returns, infer _Error> ? Args_ : never;
34
- type OptionalArgs<Ref_ extends Any> = keyof Args<Ref_> extends never ? [args?: Args<Ref_>] : [args: Args<Ref_>];
35
- type Returns<Ref_> = Ref_ extends Ref<infer _RuntimeAndFunctionType, infer _FunctionVisibility, infer _Args, infer Returns_, infer _Error> ? Returns_ : never;
36
- type Error<Ref_> = Ref_ extends Ref<infer _RuntimeAndFunctionType, infer _FunctionVisibility, infer _Args, infer _Returns, infer Error_> ? Error_ : never;
37
- type FunctionReference<Ref_ extends Any> = FunctionReference$1<GetFunctionType<Ref_>, GetFunctionVisibility<Ref_>>;
38
- type FromFunctionSpec<FunctionSpec_ extends AnyWithProps> = Ref<GetRuntimeAndFunctionType$1<FunctionSpec_>, GetFunctionVisibility$1<FunctionSpec_>, Args$1<FunctionSpec_>, Returns$1<FunctionSpec_>, Error$1<FunctionSpec_>>;
39
- declare const make: <FunctionSpec_ extends AnyWithProps>(
18
+ export interface AnyInternal extends Ref<any, "internal", any, any, any> {
19
+ }
20
+ export interface AnyPublic extends Ref<any, "public", any, any, any> {
21
+ }
22
+ export interface AnyQuery extends Ref<RuntimeAndFunctionType.AnyQuery, FunctionVisibility, any, any, any> {
23
+ }
24
+ export interface AnyMutation extends Ref<RuntimeAndFunctionType.AnyMutation, FunctionVisibility, any, any, any> {
25
+ }
26
+ export interface AnyAction extends Ref<RuntimeAndFunctionType.AnyAction, FunctionVisibility, any, any, any> {
27
+ }
28
+ export interface AnyPublicQuery extends Ref<RuntimeAndFunctionType.AnyQuery, "public", any, any, any> {
29
+ }
30
+ export interface AnyPublicMutation extends Ref<RuntimeAndFunctionType.AnyMutation, "public", any, any, any> {
31
+ }
32
+ export interface AnyPublicAction extends Ref<RuntimeAndFunctionType.AnyAction, "public", any, any, any> {
33
+ }
34
+ export type GetRuntimeAndFunctionType<Ref_> = Ref_ extends Ref<infer RuntimeAndFunctionType_, infer _FunctionVisibility, infer _Args, infer _Returns, infer _Error> ? RuntimeAndFunctionType_ : never;
35
+ export type GetRuntime<Ref_> = Ref_ extends Ref<infer RuntimeAndFunctionType_, infer _FunctionVisibility, infer _Args, infer _Returns, infer _Error> ? RuntimeAndFunctionType.GetRuntime<RuntimeAndFunctionType_> : never;
36
+ export type GetFunctionType<Ref_> = Ref_ extends Ref<infer RuntimeAndFunctionType_, infer _FunctionVisibility, infer _Args, infer _Returns, infer _Error> ? RuntimeAndFunctionType.GetFunctionType<RuntimeAndFunctionType_> : never;
37
+ export type GetFunctionVisibility<Ref_> = Ref_ extends Ref<infer _RuntimeAndFunctionType, infer FunctionVisibility_, infer _Args, infer _Returns, infer _Error> ? FunctionVisibility_ : never;
38
+ export type Args<Ref_> = Ref_ extends Ref<infer _RuntimeAndFunctionType, infer _FunctionVisibility, infer Args_, infer _Returns, infer _Error> ? Args_ : never;
39
+ export type OptionalArgs<Ref_ extends Any> = keyof Args<Ref_> extends never ? [args?: Args<Ref_>] : [args: Args<Ref_>];
40
+ export type Returns<Ref_> = Ref_ extends Ref<infer _RuntimeAndFunctionType, infer _FunctionVisibility, infer _Args, infer Returns_, infer _Error> ? Returns_ : never;
41
+ export type Error<Ref_> = Ref_ extends Ref<infer _RuntimeAndFunctionType, infer _FunctionVisibility, infer _Args, infer _Returns, infer Error_> ? Error_ : never;
42
+ export type FunctionReference<Ref_ extends Any> = ConvexFunctionReference<GetFunctionType<Ref_>, GetFunctionVisibility<Ref_>>;
43
+ export type FromFunctionSpec<FunctionSpec_ extends FunctionSpec.AnyWithProps> = Ref<FunctionSpec.GetRuntimeAndFunctionType<FunctionSpec_>, FunctionSpec.GetFunctionVisibility<FunctionSpec_>, FunctionSpec.Args<FunctionSpec_>, FunctionSpec.Returns<FunctionSpec_>, FunctionSpec.Error<FunctionSpec_>>;
44
+ export declare const make: <FunctionSpec_ extends FunctionSpec.AnyWithProps>(
40
45
  /**
41
46
  * The namespace portion of a Convex function name, i.e. the part before the
42
47
  * colon. For example, for `myGroupDir/myGroupMod:myFunc` this would be
43
48
  * `myGroupDir/myGroupMod`.
44
49
  */
45
-
46
50
  functionNamespace: string, functionSpec: FunctionSpec_) => FromFunctionSpec<FunctionSpec_>;
47
- declare const getConvexFunctionName: (ref: Any) => string;
48
- declare const getFunctionReference: <Ref_ extends Any>(ref: Ref_) => FunctionReference<Ref_>;
49
- declare const hasErrorSchema: (ref: Any) => boolean;
50
- declare const encodeArgs: <Ref_ extends Any>(ref: Ref_, args: Args<Ref_>) => Effect.Effect<unknown, ParseResult.ParseError>;
51
- declare const decodeReturns: <Ref_ extends Any>(ref: Ref_, returns: unknown) => Effect.Effect<Returns<Ref_>, ParseResult.ParseError>;
52
- declare const encodeArgsSync: <Ref_ extends Any>(ref: Ref_, args: Args<Ref_>) => unknown;
53
- declare const decodeReturnsSync: <Ref_ extends Any>(ref: Ref_, encodedReturns: unknown) => Returns<Ref_>;
54
- declare const isConvexError: (error: unknown) => error is ConvexError<Value>;
51
+ export declare const getConvexFunctionName: (ref: Any) => string;
52
+ export declare const getFunctionReference: <Ref_ extends Any>(ref: Ref_) => FunctionReference<Ref_>;
53
+ export declare const hasErrorSchema: (ref: Any) => boolean;
54
+ export declare const encodeArgs: <Ref_ extends Any>(ref: Ref_, args: Args<Ref_>) => Effect.Effect<unknown, ParseResult.ParseError>;
55
+ export declare const decodeReturns: <Ref_ extends Any>(ref: Ref_, returns: unknown) => Effect.Effect<Returns<Ref_>, ParseResult.ParseError>;
56
+ export declare const encodeArgsSync: <Ref_ extends Any>(ref: Ref_, args: Args<Ref_>) => unknown;
57
+ export declare const decodeReturnsSync: <Ref_ extends Any>(ref: Ref_, encodedReturns: unknown) => Returns<Ref_>;
58
+ export declare const isConvexError: (error: unknown) => error is ConvexError<Value>;
55
59
  /**
56
60
  * Build a callback-style handler that decodes the ref's typed error from a
57
61
  * caught `ConvexError`, or else forwards the value to `mapUnknownError`. The
@@ -61,7 +65,7 @@ declare const isConvexError: (error: unknown) => error is ConvexError<Value>;
61
65
  * emitter callbacks for streamed subscriptions) to the same error semantics
62
66
  * that `runWithCodec` provides.
63
67
  */
64
- declare const decodeErrorOrElse: <Ref_ extends Any, E>(ref: Ref_, mapUnknownError: (error: unknown) => E) => (error: unknown) => Error<Ref_> | E;
68
+ export declare const decodeErrorOrElse: <Ref_ extends Any, E>(ref: Ref_, mapUnknownError: (error: unknown) => E) => (error: unknown) => Error<Ref_> | E;
65
69
  /**
66
70
  * Decode `encodedError` against the ref's error schema. Returns `None` if the
67
71
  * ref doesn't declare a typed error (Confect ref without an `error` schema, or
@@ -69,13 +73,13 @@ declare const decodeErrorOrElse: <Ref_ extends Any, E>(ref: Ref_, mapUnknownErro
69
73
  * into, and the caller is responsible for deciding what to do (typically:
70
74
  * surface the original value as a defect).
71
75
  */
72
- declare const decodeError: <Ref_ extends Any>(ref: Ref_, encodedError: unknown) => Effect.Effect<Option$1.Option<Error<Ref_>>, ParseResult.ParseError>;
76
+ export declare const decodeError: <Ref_ extends Any>(ref: Ref_, encodedError: unknown) => Effect.Effect<Option.Option<Error<Ref_>>, ParseResult.ParseError>;
73
77
  /**
74
78
  * Synchronous counterpart to `decodeError`. Throws on schema decode failure;
75
79
  * returns `None` when the ref doesn't declare a typed error.
76
80
  */
77
- declare const decodeErrorSync: <Ref_ extends Any>(ref: Ref_, encodedError: unknown) => Option$1.Option<Error<Ref_>>;
78
- declare const maybeDecodeErrorSync: <Ref_ extends Any>(ref: Ref_, error: unknown) => unknown;
81
+ export declare const decodeErrorSync: <Ref_ extends Any>(ref: Ref_, encodedError: unknown) => Option.Option<Error<Ref_>>;
82
+ export declare const maybeDecodeErrorSync: <Ref_ extends Any>(ref: Ref_, error: unknown) => unknown;
79
83
  /**
80
84
  * Encode args via the ref's args schema, invoke `call`, decode returns via the
81
85
  * ref's returns schema, and translate any thrown `ConvexError` into the ref's
@@ -84,7 +88,5 @@ declare const maybeDecodeErrorSync: <Ref_ extends Any>(ref: Ref_, error: unknown
84
88
  * `mapUnknownError` to be turned into a typed `E`, or surfaced as a defect when
85
89
  * no handler is provided.
86
90
  */
87
- declare const runWithCodec: <Ref_ extends Any, E = never>(ref: Ref_, args: Args<Ref_>, call: (functionReference: FunctionReference<Ref_>, encodedArgs: unknown) => PromiseLike<unknown>, mapUnknownError?: (error: unknown) => E) => Effect.Effect<Returns<Ref_>, E | Error<Ref_> | ParseResult.ParseError>;
88
- //#endregion
89
- export { Any, AnyAction, AnyInternal, AnyMutation, AnyPublic, AnyPublicAction, AnyPublicMutation, AnyPublicQuery, AnyQuery, Args, Error, FromFunctionSpec, FunctionReference, GetFunctionType, GetFunctionVisibility, GetRuntime, GetRuntimeAndFunctionType, OptionalArgs, Ref, Ref_d_exports, Returns, decodeError, decodeErrorOrElse, decodeErrorSync, decodeReturns, decodeReturnsSync, encodeArgs, encodeArgsSync, getConvexFunctionName, getFunctionReference, hasErrorSchema, isConvexError, make, maybeDecodeErrorSync, runWithCodec };
91
+ export declare const runWithCodec: <Ref_ extends Any, E = never>(ref: Ref_, args: Args<Ref_>, call: (functionReference: FunctionReference<Ref_>, encodedArgs: unknown) => PromiseLike<unknown>, mapUnknownError?: (error: unknown) => E) => Effect.Effect<Returns<Ref_>, E | Error<Ref_> | ParseResult.ParseError>;
90
92
  //# sourceMappingURL=Ref.d.ts.map
package/dist/Ref.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"Ref.d.ts","names":[],"sources":["../src/Ref.ts"],"mappings":";;;;;;;;;;;;UAeiB,GAAA,iCACiB,sBAAA,8BACJ,kBAAA;EAAA,SAKnB,uBAAA,GAA0B,uBAAA;EAAA,SAC1B,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,SAAS,GAAG,EAC9C,KAAK,IAAI,EACT,cAAc,OAAO,KACpB,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAazB,CAAC;AAEJ,eAAO,MAAM,oBAAoB,GAAI,IAAI,SAAS,GAAG,EACnD,KAAK,IAAI,EACT,OAAO,OAAO,KACb,OAWQ,CAAC;AAEZ;;;;;;;GAOG;AACH,eAAO,MAAM,YAAY,GAAI,IAAI,SAAS,GAAG,EAAE,CAAC,GAAG,KAAK,EACtD,KAAK,IAAI,EACT,MAAM,IAAI,CAAC,IAAI,CAAC,EAChB,MAAM,CACJ,iBAAiB,EAAE,iBAAiB,CAAC,IAAI,CAAC,EAC1C,WAAW,EAAE,OAAO,KACjB,WAAW,CAAC,OAAO,CAAC,EACzB,kBAAkB,CAAC,KAAK,EAAE,OAAO,KAAK,CAAC,KACtC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,WAAW,CAAC,UAAU,CAqCpE,CAAC"}
package/dist/Refs.d.ts CHANGED
@@ -1,23 +1,23 @@
1
- import { AnyWithProps, GetFunctionVisibility, GetRuntimeAndFunctionType, Name as Name$1, WithName } from "./FunctionSpec.js";
2
- import { AnyWithProps as AnyWithProps$1, Functions, GroupSpec, Groups, Name as Name$2, WithName as WithName$1 } from "./GroupSpec.js";
3
- import { Any, AnyInternal, AnyPublic, FromFunctionSpec, Ref } from "./Ref.js";
4
- import { AnyWithPropsWithRuntime, Groups as Groups$1 } from "./Spec.js";
5
- import { Types } from "effect";
6
-
7
- //#region src/Refs.d.ts
8
- declare namespace Refs_d_exports {
9
- export { Refs, make };
10
- }
11
- type Refs<ConvexSpec extends AnyWithPropsWithRuntime<"Convex">, NodeSpec extends AnyWithPropsWithRuntime<"Node"> = never, Predicate extends Any = Any> = Types.Simplify<OmitEmpty<Helper<Groups$1<ConvexSpec> | (NodeSpec extends never ? never : GroupSpec<"Node", "node", never, NodeSpec["groups"][keyof NodeSpec["groups"]]>), Predicate>>>;
12
- type GroupRefs<Group extends AnyWithProps$1, Predicate extends Any> = Types.Simplify<OmitEmpty<Helper<Groups<Group>, Predicate>> & FilteredFunctions<Functions<Group>, Predicate>>;
13
- type OmitEmpty<T> = { [K in keyof T as keyof T[K] extends never ? never : K]: T[K] };
14
- type FunctionSpecMatchesPredicate<FunctionSpec_ extends AnyWithProps, Predicate extends Any> = Ref<GetRuntimeAndFunctionType<FunctionSpec_>, GetFunctionVisibility<FunctionSpec_>, any, any> extends Predicate ? true : false;
15
- type FilteredFunctions<FunctionSpecs extends AnyWithProps, Predicate extends Any> = { [Name in Name$1<FunctionSpecs> as WithName<FunctionSpecs, Name> extends infer FunctionSpec_ extends AnyWithProps ? FunctionSpecMatchesPredicate<FunctionSpec_, Predicate> extends true ? Name : never : never]: WithName<FunctionSpecs, Name> extends infer F extends AnyWithProps ? FromFunctionSpec<F> : never };
16
- type Helper<Groups extends AnyWithProps$1, Predicate extends Any> = { [GroupName in Name$2<Groups>]: WithName$1<Groups, GroupName> extends infer Group extends AnyWithProps$1 ? GroupRefs<Group, Predicate> : never };
17
- declare const make: <ConvexSpec extends AnyWithPropsWithRuntime<"Convex">, NodeSpec extends AnyWithPropsWithRuntime<"Node"> = never>(convexSpec: ConvexSpec, nodeSpec?: NodeSpec) => {
18
- public: Refs<ConvexSpec, NodeSpec, AnyPublic>;
19
- internal: Refs<ConvexSpec, NodeSpec, AnyInternal>;
1
+ import type { Types } from "effect";
2
+ import type * as FunctionSpec from "./FunctionSpec";
3
+ import type * as GroupSpec from "./GroupSpec";
4
+ import * as Ref from "./Ref";
5
+ import type * as Spec from "./Spec";
6
+ export type Refs<Spec_ extends Spec.AnyWithProps, Predicate extends Ref.Any = Ref.Any> = Types.Simplify<OmitEmpty<Helper<Spec.Groups<Spec_>, Predicate>>>;
7
+ type GroupRefs<Group extends GroupSpec.AnyWithProps, Predicate extends Ref.Any> = Types.Simplify<OmitEmpty<Helper<GroupSpec.Groups<Group>, Predicate>> & FilteredFunctions<GroupSpec.Functions<Group>, Predicate>>;
8
+ type OmitEmpty<T> = {
9
+ [K in keyof T as keyof T[K] extends never ? never : K]: T[K];
20
10
  };
21
- //#endregion
22
- export { Refs, Refs_d_exports, make };
11
+ type FunctionSpecMatchesPredicate<FunctionSpec_ extends FunctionSpec.AnyWithProps, Predicate extends Ref.Any> = Ref.Ref<FunctionSpec.GetRuntimeAndFunctionType<FunctionSpec_>, FunctionSpec.GetFunctionVisibility<FunctionSpec_>, any, any> extends Predicate ? true : false;
12
+ type FilteredFunctions<FunctionSpecs extends FunctionSpec.AnyWithProps, Predicate extends Ref.Any> = {
13
+ [Name in FunctionSpec.Name<FunctionSpecs> as FunctionSpec.WithName<FunctionSpecs, Name> extends infer FunctionSpec_ extends FunctionSpec.AnyWithProps ? FunctionSpecMatchesPredicate<FunctionSpec_, Predicate> extends true ? Name : never : never]: FunctionSpec.WithName<FunctionSpecs, Name> extends infer F extends FunctionSpec.AnyWithProps ? Ref.FromFunctionSpec<F> : never;
14
+ };
15
+ type Helper<Groups extends GroupSpec.AnyWithProps, Predicate extends Ref.Any> = {
16
+ [GroupName in GroupSpec.Name<Groups>]: GroupSpec.WithName<Groups, GroupName> extends infer Group extends GroupSpec.AnyWithProps ? GroupRefs<Group, Predicate> : never;
17
+ };
18
+ export declare const make: <Spec_ extends Spec.AnyWithProps>(spec: Spec_) => {
19
+ public: Refs<Spec_, Ref.AnyPublic>;
20
+ internal: Refs<Spec_, Ref.AnyInternal>;
21
+ };
22
+ export {};
23
23
  //# sourceMappingURL=Refs.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Refs.d.ts","names":[],"sources":["../src/Refs.ts"],"mappings":";;;;;;;;;;KAUY,IAAA,oBACS,uBAAA,6BACF,uBAAA,oCACC,GAAA,GAAU,GAAA,IAC1B,KAAA,CAAM,QAAA,CACR,SAAA,CACE,MAAA,CACI,QAAA,CAAY,UAAA,KACX,QAAA,y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AC/C,SAAS,SAAS,GAAG,CAAC,GAAG,IACvB;KACD,IAAI,IAAI,YAAY,CAAC,IAAI,CAAC,aAAa,CAAC,IAAI,YAAY,CAAC,QAAQ,CAChE,aAAa,EACb,IAAI,CACL,SAAS,MAAM,aAAa,SAAS,YAAY,CAAC,YAAY,GAC3D,4BAA4B,CAAC,aAAa,EAAE,SAAS,CAAC,SAAS,IAAI,GACjE,IAAI,GACJ,KAAK,GACP,KAAK,GAAG,YAAY,CAAC,QAAQ,CAAC,aAAa,EAAE,IAAI,CAAC,SAAS,MAAM,CAAC,SACpE,YAAY,CAAC,YAAY,GACvB,GAAG,CAAC,gBAAgB,CAAC,CAAC,CAAC,GACvB,KAAK;CACV,CAAC;AAEF,KAAK,MAAM,CACT,MAAM,SAAS,SAAS,CAAC,YAAY,EACrC,SAAS,SAAS,GAAG,CAAC,GAAG,IACvB;KACD,SAAS,IAAI,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,SAAS,CAAC,QAAQ,CACvD,MAAM,EACN,SAAS,CACV,SAAS,MAAM,KAAK,SAAS,SAAS,CAAC,YAAY,GAChD,SAAS,CAAC,KAAK,EAAE,SAAS,CAAC,GAC3B,KAAK;CACV,CAAC;AAQF,eAAO,MAAM,IAAI,GAAI,KAAK,SAAS,IAAI,CAAC,YAAY,EAClD,MAAM,KAAK,KACV;IACD,MAAM,EAAE,IAAI,CAAC,KAAK,EAAE,GAAG,CAAC,SAAS,CAAC,CAAC;IACnC,QAAQ,EAAE,IAAI,CAAC,KAAK,EAAE,GAAG,CAAC,WAAW,CAAC,CAAC;CAOxC,CAAC"}
package/dist/Refs.js CHANGED
@@ -1,21 +1,13 @@
1
1
  import { __exportAll } from "./_virtual/_rolldown/runtime.js";
2
- import { makeNodeAt } from "./GroupSpec.js";
3
2
  import { getConvexFunctionName, make as make$1 } from "./Ref.js";
4
3
  import * as Record from "effect/Record";
5
4
  import * as Option from "effect/Option";
6
5
  import { pipe } from "effect/Function";
7
- import * as Array from "effect/Array";
8
6
 
9
7
  //#region src/Refs.ts
10
8
  var Refs_exports = /* @__PURE__ */ __exportAll({ make: () => make });
11
- const make = (convexSpec, nodeSpec) => {
12
- const refs = makeHelper(Option.fromNullable(nodeSpec).pipe(Option.map((nodeSpec_) => Array.reduce(Record.toEntries(nodeSpec_.groups), makeNodeAt("node"), (nodeGroupSpec, [name, group]) => nodeGroupSpec.addGroupAt(name, group))), Option.match({
13
- onNone: () => convexSpec.groups,
14
- onSome: (nodeGroup) => ({
15
- ...convexSpec.groups,
16
- node: nodeGroup
17
- })
18
- })));
9
+ const make = (spec) => {
10
+ const refs = makeHelper(spec.groups);
19
11
  return {
20
12
  public: refs,
21
13
  internal: refs
package/dist/Refs.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"Refs.js","names":["GroupSpec.makeNodeAt","Ref.make","Ref.getConvexFunctionName"],"sources":["../src/Refs.ts"],"sourcesContent":["import type { Types } from \"effect\";\nimport { pipe } from \"effect/Function\";\nimport * as Array from \"effect/Array\";\nimport * as Option from \"effect/Option\";\nimport * as Record from \"effect/Record\";\nimport type * as FunctionSpec from \"./FunctionSpec\";\nimport * as GroupSpec from \"./GroupSpec\";\nimport * as Ref from \"./Ref\";\nimport type * as Spec from \"./Spec\";\n\nexport type Refs<\n ConvexSpec extends Spec.AnyWithPropsWithRuntime<\"Convex\">,\n NodeSpec extends Spec.AnyWithPropsWithRuntime<\"Node\"> = never,\n Predicate extends Ref.Any = Ref.Any,\n> = Types.Simplify<\n OmitEmpty<\n Helper<\n | Spec.Groups<ConvexSpec>\n | (NodeSpec extends never\n ? never\n : GroupSpec.GroupSpec<\n \"Node\",\n \"node\",\n never,\n NodeSpec[\"groups\"][keyof NodeSpec[\"groups\"]]\n >),\n Predicate\n >\n >\n>;\n\ntype GroupRefs<\n Group extends GroupSpec.AnyWithProps,\n Predicate extends Ref.Any,\n> = Types.Simplify<\n OmitEmpty<Helper<GroupSpec.Groups<Group>, Predicate>> &\n FilteredFunctions<GroupSpec.Functions<Group>, Predicate>\n>;\n\ntype OmitEmpty<T> = {\n [K in keyof T as keyof T[K] extends never ? never : K]: T[K];\n};\n\ntype FunctionSpecMatchesPredicate<\n FunctionSpec_ extends FunctionSpec.AnyWithProps,\n Predicate extends Ref.Any,\n> =\n Ref.Ref<\n FunctionSpec.GetRuntimeAndFunctionType<FunctionSpec_>,\n FunctionSpec.GetFunctionVisibility<FunctionSpec_>,\n any,\n any\n > extends Predicate\n ? true\n : false;\n\ntype FilteredFunctions<\n FunctionSpecs extends FunctionSpec.AnyWithProps,\n Predicate extends Ref.Any,\n> = {\n [Name in FunctionSpec.Name<FunctionSpecs> as FunctionSpec.WithName<\n FunctionSpecs,\n Name\n > extends infer FunctionSpec_ extends FunctionSpec.AnyWithProps\n ? FunctionSpecMatchesPredicate<FunctionSpec_, Predicate> extends true\n ? Name\n : never\n : never]: FunctionSpec.WithName<FunctionSpecs, Name> extends infer F extends\n FunctionSpec.AnyWithProps\n ? Ref.FromFunctionSpec<F>\n : never;\n};\n\ntype Helper<\n Groups extends GroupSpec.AnyWithProps,\n Predicate extends Ref.Any,\n> = {\n [GroupName in GroupSpec.Name<Groups>]: GroupSpec.WithName<\n Groups,\n GroupName\n > extends infer Group extends GroupSpec.AnyWithProps\n ? GroupRefs<Group, Predicate>\n : never;\n};\n\ntype Any =\n | {\n readonly [key: string]: Any;\n }\n | Ref.Any;\n\nexport const make = <\n ConvexSpec extends Spec.AnyWithPropsWithRuntime<\"Convex\">,\n NodeSpec extends Spec.AnyWithPropsWithRuntime<\"Node\"> = never,\n>(\n convexSpec: ConvexSpec,\n nodeSpec?: NodeSpec,\n): {\n public: Refs<ConvexSpec, NodeSpec, Ref.AnyPublic>;\n internal: Refs<ConvexSpec, NodeSpec, Ref.AnyInternal>;\n} => {\n const groups = Option.fromNullable(nodeSpec).pipe(\n Option.map((nodeSpec_) =>\n Array.reduce(\n Record.toEntries(nodeSpec_.groups),\n GroupSpec.makeNodeAt(\"node\"),\n (nodeGroupSpec, [name, group]) => nodeGroupSpec.addGroupAt(name, group),\n ),\n ),\n Option.match({\n onNone: () => convexSpec.groups,\n onSome: (nodeGroup) => ({ ...convexSpec.groups, node: nodeGroup }),\n }),\n );\n const refs = makeHelper(groups);\n return {\n public: refs as Refs<ConvexSpec, NodeSpec, Ref.AnyPublic>,\n internal: refs as Refs<ConvexSpec, NodeSpec, Ref.AnyInternal>,\n };\n};\n\nconst makeHelper = (\n groups: Record.ReadonlyRecord<string, GroupSpec.Any>,\n functionNamespace: Option.Option<string> = Option.none(),\n): Any =>\n pipe(\n groups as Record.ReadonlyRecord<string, GroupSpec.AnyWithProps>,\n Record.map((group, name) => {\n const currentFunctionNamespace = Option.match(functionNamespace, {\n onNone: () => name,\n onSome: (parentNamespace) => `${parentNamespace}/${name}`,\n });\n\n return Record.union(\n makeHelper(group.groups, Option.some(currentFunctionNamespace)),\n Record.map(group.functions, (function_) =>\n Ref.make(currentFunctionNamespace, function_),\n ),\n (_subGroup, _function) => {\n throw new Error(\n `Group and function at same level have same name ('${Ref.getConvexFunctionName(_function)}')`,\n );\n },\n );\n }),\n );\n"],"mappings":";;;;;;;;;;AA2FA,MAAa,QAIX,YACA,aAIG;CAcH,MAAM,OAAO,WAbE,OAAO,aAAa,SAAS,CAAC,KAC3C,OAAO,KAAK,cACV,MAAM,OACJ,OAAO,UAAU,UAAU,OAAO,EAClCA,WAAqB,OAAO,GAC3B,eAAe,CAAC,MAAM,WAAW,cAAc,WAAW,MAAM,MAAM,CACxE,CACF,EACD,OAAO,MAAM;EACX,cAAc,WAAW;EACzB,SAAS,eAAe;GAAE,GAAG,WAAW;GAAQ,MAAM;GAAW;EAClE,CAAC,CACH,CAC8B;AAC/B,QAAO;EACL,QAAQ;EACR,UAAU;EACX;;AAGH,MAAM,cACJ,QACA,oBAA2C,OAAO,MAAM,KAExD,KACE,QACA,OAAO,KAAK,OAAO,SAAS;CAC1B,MAAM,2BAA2B,OAAO,MAAM,mBAAmB;EAC/D,cAAc;EACd,SAAS,oBAAoB,GAAG,gBAAgB,GAAG;EACpD,CAAC;AAEF,QAAO,OAAO,MACZ,WAAW,MAAM,QAAQ,OAAO,KAAK,yBAAyB,CAAC,EAC/D,OAAO,IAAI,MAAM,YAAY,cAC3BC,OAAS,0BAA0B,UAAU,CAC9C,GACA,WAAW,cAAc;AACxB,QAAM,IAAI,MACR,qDAAqDC,sBAA0B,UAAU,CAAC,IAC3F;GAEJ;EACD,CACH"}
1
+ {"version":3,"file":"Refs.js","names":["Ref.make","Ref.getConvexFunctionName"],"sources":["../src/Refs.ts"],"sourcesContent":["import type { Types } from \"effect\";\nimport { pipe } from \"effect/Function\";\nimport * as Option from \"effect/Option\";\nimport * as Record from \"effect/Record\";\nimport type * as FunctionSpec from \"./FunctionSpec\";\nimport type * as GroupSpec from \"./GroupSpec\";\nimport * as Ref from \"./Ref\";\nimport type * as Spec from \"./Spec\";\n\nexport type Refs<\n Spec_ extends Spec.AnyWithProps,\n Predicate extends Ref.Any = Ref.Any,\n> = Types.Simplify<OmitEmpty<Helper<Spec.Groups<Spec_>, Predicate>>>;\n\ntype GroupRefs<\n Group extends GroupSpec.AnyWithProps,\n Predicate extends Ref.Any,\n> = Types.Simplify<\n OmitEmpty<Helper<GroupSpec.Groups<Group>, Predicate>> &\n FilteredFunctions<GroupSpec.Functions<Group>, Predicate>\n>;\n\ntype OmitEmpty<T> = {\n [K in keyof T as keyof T[K] extends never ? never : K]: T[K];\n};\n\ntype FunctionSpecMatchesPredicate<\n FunctionSpec_ extends FunctionSpec.AnyWithProps,\n Predicate extends Ref.Any,\n> =\n Ref.Ref<\n FunctionSpec.GetRuntimeAndFunctionType<FunctionSpec_>,\n FunctionSpec.GetFunctionVisibility<FunctionSpec_>,\n any,\n any\n > extends Predicate\n ? true\n : false;\n\ntype FilteredFunctions<\n FunctionSpecs extends FunctionSpec.AnyWithProps,\n Predicate extends Ref.Any,\n> = {\n [Name in FunctionSpec.Name<FunctionSpecs> as FunctionSpec.WithName<\n FunctionSpecs,\n Name\n > extends infer FunctionSpec_ extends FunctionSpec.AnyWithProps\n ? FunctionSpecMatchesPredicate<FunctionSpec_, Predicate> extends true\n ? Name\n : never\n : never]: FunctionSpec.WithName<FunctionSpecs, Name> extends infer F extends\n FunctionSpec.AnyWithProps\n ? Ref.FromFunctionSpec<F>\n : never;\n};\n\ntype Helper<\n Groups extends GroupSpec.AnyWithProps,\n Predicate extends Ref.Any,\n> = {\n [GroupName in GroupSpec.Name<Groups>]: GroupSpec.WithName<\n Groups,\n GroupName\n > extends infer Group extends GroupSpec.AnyWithProps\n ? GroupRefs<Group, Predicate>\n : never;\n};\n\ntype Any =\n | {\n readonly [key: string]: Any;\n }\n | Ref.Any;\n\nexport const make = <Spec_ extends Spec.AnyWithProps>(\n spec: Spec_,\n): {\n public: Refs<Spec_, Ref.AnyPublic>;\n internal: Refs<Spec_, Ref.AnyInternal>;\n} => {\n const refs = makeHelper(spec.groups);\n return {\n public: refs as Refs<Spec_, Ref.AnyPublic>,\n internal: refs as Refs<Spec_, Ref.AnyInternal>,\n };\n};\n\nconst makeHelper = (\n groups: Record.ReadonlyRecord<string, GroupSpec.Any>,\n functionNamespace: Option.Option<string> = Option.none(),\n): Any =>\n pipe(\n groups as Record.ReadonlyRecord<string, GroupSpec.AnyWithProps>,\n Record.map((group, name) => {\n const currentFunctionNamespace = Option.match(functionNamespace, {\n onNone: () => name,\n onSome: (parentNamespace) => `${parentNamespace}/${name}`,\n });\n\n return Record.union(\n makeHelper(group.groups, Option.some(currentFunctionNamespace)),\n Record.map(group.functions, (function_) =>\n Ref.make(currentFunctionNamespace, function_),\n ),\n (_subGroup, _function) => {\n throw new Error(\n `Group and function at same level have same name ('${Ref.getConvexFunctionName(_function)}')`,\n );\n },\n );\n }),\n );\n"],"mappings":";;;;;;;;AA0EA,MAAa,QACX,SAIG;CACH,MAAM,OAAO,WAAW,KAAK,OAAO;AACpC,QAAO;EACL,QAAQ;EACR,UAAU;EACX;;AAGH,MAAM,cACJ,QACA,oBAA2C,OAAO,MAAM,KAExD,KACE,QACA,OAAO,KAAK,OAAO,SAAS;CAC1B,MAAM,2BAA2B,OAAO,MAAM,mBAAmB;EAC/D,cAAc;EACd,SAAS,oBAAoB,GAAG,gBAAgB,GAAG;EACpD,CAAC;AAEF,QAAO,OAAO,MACZ,WAAW,MAAM,QAAQ,OAAO,KAAK,yBAAyB,CAAC,EAC/D,OAAO,IAAI,MAAM,YAAY,cAC3BA,OAAS,0BAA0B,UAAU,CAC9C,GACA,WAAW,cAAc;AACxB,QAAM,IAAI,MACR,qDAAqDC,sBAA0B,UAAU,CAAC,IAC3F;GAEJ;EACD,CACH"}
@@ -1,10 +1,5 @@
1
1
  import * as Context from "effect/Context";
2
2
  import * as Ref from "effect/Ref";
3
-
4
- //#region src/Registry.d.ts
5
- declare namespace Registry_d_exports {
6
- export { Registry, RegistryItems };
7
- }
8
3
  /**
9
4
  * Recursive tree that mirrors a `Spec`'s group structure. Leaves are the
10
5
  * per-function items written by each `FunctionImpl`'s layer initializer. The
@@ -13,8 +8,8 @@ declare namespace Registry_d_exports {
13
8
  * consumers (the server runtime and the CLI's `implValidation`) narrow as
14
9
  * needed.
15
10
  */
16
- interface RegistryItems {
17
- readonly [key: string]: unknown | RegistryItems;
11
+ export interface RegistryItems {
12
+ readonly [key: string]: unknown | RegistryItems;
18
13
  }
19
14
  declare const Registry_base: Context.ReferenceClass<Registry, "@confect/core/Registry", Ref.Ref<RegistryItems>>;
20
15
  /**
@@ -26,7 +21,7 @@ declare const Registry_base: Context.ReferenceClass<Registry, "@confect/core/Reg
26
21
  * Effect's global default-value cache to align two separately-defined tags
27
22
  * by string key.
28
23
  */
29
- declare class Registry extends Registry_base {}
30
- //#endregion
31
- export { Registry, RegistryItems, Registry_d_exports };
24
+ export declare class Registry extends Registry_base {
25
+ }
26
+ export {};
32
27
  //# sourceMappingURL=Registry.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Registry.d.ts","names":[],"sources":["../src/Registry.ts"],"mappings":";;;;;;;;;;;;;;AAWA;UAAiB,aAAA;EAAA,UACL,GAAA,qBAAwB,aAAA;AAAA;AAAA,cACnC,aAAA;AAAA;;;;;;;;;AAAA,cAWY,QAAA,SAAiB,aAAA"}
1
+ {"version":3,"file":"Registry.d.ts","sourceRoot":"","sources":["../src/Registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,GAAG,MAAM,YAAY,CAAC;AAElC;;;;;;;GAOG;AACH,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,GAAG,aAAa,CAAC;CACjD;;AAED;;;;;;;;GAQG;AACH,qBAAa,QAAS,SAAQ,aAK7B;CAAG"}