@confect/core 9.0.0-next.9 → 9.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +158 -4
- package/dist/FunctionProvenance.d.ts +84 -90
- package/dist/FunctionProvenance.d.ts.map +1 -1
- package/dist/FunctionSpec.d.ts +178 -218
- package/dist/FunctionSpec.d.ts.map +1 -1
- package/dist/GenericId.d.ts +6 -13
- package/dist/GenericId.d.ts.map +1 -1
- package/dist/GroupPath.d.ts +10 -16
- package/dist/GroupPath.d.ts.map +1 -1
- package/dist/GroupSpec.d.ts +38 -37
- package/dist/GroupSpec.d.ts.map +1 -1
- package/dist/Identifier.d.ts +2 -7
- package/dist/Identifier.d.ts.map +1 -1
- package/dist/Lazy.d.ts +1 -6
- package/dist/Lazy.d.ts.map +1 -1
- package/dist/PaginationResult.d.ts +10 -17
- package/dist/PaginationResult.d.ts.map +1 -1
- package/dist/Ref.d.ts +54 -52
- package/dist/Ref.d.ts.map +1 -1
- package/dist/Refs.d.ts +21 -21
- package/dist/Refs.d.ts.map +1 -1
- package/dist/Registry.d.ts +5 -10
- package/dist/Registry.d.ts.map +1 -1
- package/dist/RuntimeAndFunctionType.d.ts +36 -41
- package/dist/RuntimeAndFunctionType.d.ts.map +1 -1
- package/dist/Spec.d.ts +17 -21
- package/dist/Spec.d.ts.map +1 -1
- package/dist/SystemFields.d.ts +9 -15
- package/dist/SystemFields.d.ts.map +1 -1
- package/dist/Types.d.ts +27 -27
- package/dist/Types.d.ts.map +1 -1
- package/dist/UserIdentity.d.ts +55 -62
- package/dist/UserIdentity.d.ts.map +1 -1
- package/dist/index.d.ts +17 -17
- package/dist/index.d.ts.map +1 -0
- package/dist/tsconfig.src.tsbuildinfo +1 -0
- package/package.json +4 -12
package/dist/GroupSpec.d.ts
CHANGED
|
@@ -1,44 +1,45 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
declare
|
|
6
|
-
|
|
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
|
-
|
|
9
|
-
|
|
10
|
-
declare const isGroupSpec: (u: unknown) => u is AnyWithProps;
|
|
11
|
-
interface GroupSpec<Runtime$1 extends Runtime, Name_ extends string, Functions_ extends AnyWithPropsWithRuntime$1<Runtime$1> = never, Groups_ extends AnyWithProps = never> {
|
|
12
|
-
readonly [TypeId]: TypeId;
|
|
13
|
-
readonly runtime: Runtime$1;
|
|
14
|
-
readonly name: Name_;
|
|
15
|
-
readonly functions: { [FunctionName in Name$1<AnyWithPropsWithRuntime$1<Runtime$1>>]: WithName$1<Functions_, FunctionName> };
|
|
16
|
-
readonly groups: { [GroupName in Name<Groups_>]: WithName<Groups_, GroupName> };
|
|
17
|
-
addFunction<Function extends AnyWithPropsWithRuntime$1<Runtime$1>>(function_: Function): GroupSpec<Runtime$1, Name_, Functions_ | Function, Groups_>;
|
|
18
|
-
addGroup<Group extends AnyWithProps>(group: Group): GroupSpec<Runtime$1, Name_, Functions_, Groups_ | Group>;
|
|
19
|
-
addGroupAt<const AtName extends string, Group extends AnyWithProps>(name: AtName, group: Group): GroupSpec<Runtime$1, Name_, Functions_, Groups_ | NamedAt<Group, AtName>>;
|
|
20
|
+
export interface Any {
|
|
21
|
+
readonly [TypeId]: TypeId;
|
|
20
22
|
}
|
|
21
|
-
interface
|
|
22
|
-
readonly [TypeId]: TypeId;
|
|
23
|
+
export interface AnyWithProps extends GroupSpec<RuntimeAndFunctionType.Runtime, string, FunctionSpec.AnyWithProps, AnyWithProps> {
|
|
23
24
|
}
|
|
24
|
-
interface
|
|
25
|
-
|
|
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 [
|
|
30
|
-
|
|
31
|
-
|
|
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
|
-
|
|
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
|
package/dist/GroupSpec.d.ts.map
CHANGED
|
@@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AC,SAAS;IAC3E,KAAK;CACN,GACG,KAAK,GACL,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;AAExB,MAAM,MAAM,QAAQ,CAClB,KAAK,SAAS,YAAY,EAC1B,KAAK,SAAS,IAAI,CAAC,KAAK,CAAC,IACvB,OAAO,CAAC,KAAK,EAAE;IAAE,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAA;CAAE,CAAC,CAAC;AAE7C,4FAA4F;AAC5F,MAAM,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"}
|
package/dist/Identifier.d.ts
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
declare
|
|
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
|
package/dist/Identifier.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Identifier.d.ts","
|
|
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
|
package/dist/Lazy.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Lazy.d.ts","
|
|
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
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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","
|
|
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 {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
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
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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
|
|
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
|
|
21
|
-
|
|
22
|
-
interface AnyPublic extends Ref<any, "public", any, any, any> {
|
|
23
|
-
|
|
24
|
-
interface
|
|
25
|
-
|
|
26
|
-
interface
|
|
27
|
-
|
|
28
|
-
interface
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
type
|
|
37
|
-
type
|
|
38
|
-
type
|
|
39
|
-
|
|
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
|
|
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
|
|
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_>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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 {
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
11
|
-
type Refs<Spec_ extends AnyWithProps$2, Predicate extends Any = Any> = Types.Simplify<OmitEmpty<Helper<Groups$1<Spec_>, 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: <Spec_ extends AnyWithProps$2>(spec: Spec_) => {
|
|
18
|
-
public: Refs<Spec_, AnyPublic>;
|
|
19
|
-
internal: Refs<Spec_, 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
|
-
|
|
22
|
-
|
|
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
|
package/dist/Refs.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Refs.d.ts","
|
|
1
|
+
{"version":3,"file":"Refs.d.ts","sourceRoot":"","sources":["../src/Refs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAIpC,OAAO,KAAK,KAAK,YAAY,MAAM,gBAAgB,CAAC;AACpD,OAAO,KAAK,KAAK,SAAS,MAAM,aAAa,CAAC;AAC9C,OAAO,KAAK,GAAG,MAAM,OAAO,CAAC;AAC7B,OAAO,KAAK,KAAK,IAAI,MAAM,QAAQ,CAAC;AAEpC,MAAM,MAAM,IAAI,CACd,KAAK,SAAS,IAAI,CAAC,YAAY,EAC/B,SAAS,SAAS,GAAG,CAAC,GAAG,GAAG,GAAG,CAAC,GAAG,IACjC,KAAK,CAAC,QAAQ,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC;AAErE,KAAK,SAAS,CACZ,KAAK,SAAS,SAAS,CAAC,YAAY,EACpC,SAAS,SAAS,GAAG,CAAC,GAAG,IACvB,KAAK,CAAC,QAAQ,CAChB,SAAS,CAAC,MAAM,CAAC,SAAS,C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AAI,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/Registry.d.ts
CHANGED
|
@@ -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
|
-
|
|
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
|
-
|
|
31
|
-
export {
|
|
24
|
+
export declare class Registry extends Registry_base {
|
|
25
|
+
}
|
|
26
|
+
export {};
|
|
32
27
|
//# sourceMappingURL=Registry.d.ts.map
|
package/dist/Registry.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Registry.d.ts","
|
|
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"}
|
|
@@ -1,54 +1,49 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
type RuntimeAndFunctionType = {
|
|
5
|
-
readonly runtime: "Convex";
|
|
6
|
-
readonly functionType: "query";
|
|
1
|
+
export type RuntimeAndFunctionType = {
|
|
2
|
+
readonly runtime: "Convex";
|
|
3
|
+
readonly functionType: "query";
|
|
7
4
|
} | {
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
readonly runtime: "Convex";
|
|
6
|
+
readonly functionType: "mutation";
|
|
10
7
|
} | {
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
readonly runtime: "Convex";
|
|
9
|
+
readonly functionType: "action";
|
|
13
10
|
} | {
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
readonly runtime: "Node";
|
|
12
|
+
readonly functionType: "action";
|
|
16
13
|
};
|
|
17
|
-
type Runtime = RuntimeAndFunctionType["runtime"];
|
|
18
|
-
type AnyQuery = Extract<RuntimeAndFunctionType, {
|
|
19
|
-
|
|
14
|
+
export type Runtime = RuntimeAndFunctionType["runtime"];
|
|
15
|
+
export type AnyQuery = Extract<RuntimeAndFunctionType, {
|
|
16
|
+
readonly functionType: "query";
|
|
20
17
|
}>;
|
|
21
|
-
type AnyMutation = Extract<RuntimeAndFunctionType, {
|
|
22
|
-
|
|
18
|
+
export type AnyMutation = Extract<RuntimeAndFunctionType, {
|
|
19
|
+
readonly functionType: "mutation";
|
|
23
20
|
}>;
|
|
24
|
-
type AnyAction = Extract<RuntimeAndFunctionType, {
|
|
25
|
-
|
|
21
|
+
export type AnyAction = Extract<RuntimeAndFunctionType, {
|
|
22
|
+
readonly functionType: "action";
|
|
26
23
|
}>;
|
|
27
|
-
type WithRuntime<Runtime_ extends Runtime> = Extract<RuntimeAndFunctionType, {
|
|
28
|
-
|
|
24
|
+
export type WithRuntime<Runtime_ extends Runtime> = Extract<RuntimeAndFunctionType, {
|
|
25
|
+
readonly runtime: Runtime_;
|
|
29
26
|
}>;
|
|
30
|
-
type GetRuntime<RuntimeAndFunctionType_ extends RuntimeAndFunctionType> = RuntimeAndFunctionType_["runtime"];
|
|
31
|
-
type GetFunctionType<RuntimeAndFunctionType_ extends RuntimeAndFunctionType> = RuntimeAndFunctionType_["functionType"];
|
|
32
|
-
declare const ConvexQuery: {
|
|
33
|
-
|
|
34
|
-
|
|
27
|
+
export type GetRuntime<RuntimeAndFunctionType_ extends RuntimeAndFunctionType> = RuntimeAndFunctionType_["runtime"];
|
|
28
|
+
export type GetFunctionType<RuntimeAndFunctionType_ extends RuntimeAndFunctionType> = RuntimeAndFunctionType_["functionType"];
|
|
29
|
+
export declare const ConvexQuery: {
|
|
30
|
+
readonly runtime: "Convex";
|
|
31
|
+
readonly functionType: "query";
|
|
35
32
|
};
|
|
36
|
-
type ConvexQuery = typeof ConvexQuery;
|
|
37
|
-
declare const ConvexMutation: {
|
|
38
|
-
|
|
39
|
-
|
|
33
|
+
export type ConvexQuery = typeof ConvexQuery;
|
|
34
|
+
export declare const ConvexMutation: {
|
|
35
|
+
readonly runtime: "Convex";
|
|
36
|
+
readonly functionType: "mutation";
|
|
40
37
|
};
|
|
41
|
-
type ConvexMutation = typeof ConvexMutation;
|
|
42
|
-
declare const ConvexAction: {
|
|
43
|
-
|
|
44
|
-
|
|
38
|
+
export type ConvexMutation = typeof ConvexMutation;
|
|
39
|
+
export declare const ConvexAction: {
|
|
40
|
+
readonly runtime: "Convex";
|
|
41
|
+
readonly functionType: "action";
|
|
45
42
|
};
|
|
46
|
-
type ConvexAction = typeof ConvexAction;
|
|
47
|
-
declare const NodeAction: {
|
|
48
|
-
|
|
49
|
-
|
|
43
|
+
export type ConvexAction = typeof ConvexAction;
|
|
44
|
+
export declare const NodeAction: {
|
|
45
|
+
readonly runtime: "Node";
|
|
46
|
+
readonly functionType: "action";
|
|
50
47
|
};
|
|
51
|
-
type NodeAction = typeof NodeAction;
|
|
52
|
-
//#endregion
|
|
53
|
-
export { AnyAction, AnyMutation, AnyQuery, ConvexAction, ConvexMutation, ConvexQuery, GetFunctionType, GetRuntime, NodeAction, Runtime, RuntimeAndFunctionType, RuntimeAndFunctionType_d_exports, WithRuntime };
|
|
48
|
+
export type NodeAction = typeof NodeAction;
|
|
54
49
|
//# sourceMappingURL=RuntimeAndFunctionType.d.ts.map
|