@gaganref/confect-core 10.3.1-fork.6 → 10.3.1-fork.60
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/dist/ActionCall.d.ts +18 -0
- package/dist/ActionCall.d.ts.map +1 -0
- package/dist/ActionCall.js +21 -0
- package/dist/ActionCall.js.map +1 -0
- package/dist/App.d.ts +13 -2
- package/dist/App.d.ts.map +1 -1
- package/dist/App.js +6 -3
- package/dist/App.js.map +1 -1
- package/dist/Auth.d.ts +31 -6
- package/dist/Auth.d.ts.map +1 -1
- package/dist/Auth.js +15 -1
- package/dist/Auth.js.map +1 -1
- package/dist/Callback.d.ts.map +1 -1
- package/dist/Callback.js +4 -3
- package/dist/Callback.js.map +1 -1
- package/dist/Component.d.ts.map +1 -1
- package/dist/Component.js +1 -1
- package/dist/Component.js.map +1 -1
- package/dist/FunctionSpec.d.ts +365 -2
- package/dist/FunctionSpec.d.ts.map +1 -1
- package/dist/FunctionSpec.js +66 -3
- package/dist/FunctionSpec.js.map +1 -1
- package/dist/GroupSpec.js +1 -1
- package/dist/Http.d.ts.map +1 -1
- package/dist/Http.js +2 -2
- package/dist/Http.js.map +1 -1
- package/dist/ManifestSection.d.ts +66 -0
- package/dist/ManifestSection.d.ts.map +1 -0
- package/dist/ManifestSection.js +7 -0
- package/dist/ManifestSection.js.map +1 -0
- package/dist/Profile.d.ts +95 -0
- package/dist/Profile.d.ts.map +1 -0
- package/dist/Profile.js +15 -0
- package/dist/Profile.js.map +1 -0
- package/dist/Ref.d.ts +4 -3
- package/dist/Ref.d.ts.map +1 -1
- package/dist/Ref.js +11 -17
- package/dist/Ref.js.map +1 -1
- package/dist/RefInternal.d.ts +3 -0
- package/dist/RefInternal.d.ts.map +1 -0
- package/dist/RefInternal.js +16 -0
- package/dist/RefInternal.js.map +1 -0
- package/dist/SchemaToValidator.d.ts +10 -1
- package/dist/SchemaToValidator.d.ts.map +1 -1
- package/dist/SchemaToValidator.js +19 -4
- package/dist/SchemaToValidator.js.map +1 -1
- package/dist/SystemFields.js +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -6
- package/dist/internal/scalarDocs.d.ts +5 -0
- package/dist/internal/scalarDocs.d.ts.map +1 -0
- package/dist/internal/scalarDocs.js +43 -0
- package/dist/internal/scalarDocs.js.map +1 -0
- package/package.json +3 -3
- package/src/ActionCall.ts +25 -0
- package/src/App.ts +19 -3
- package/src/Auth.ts +48 -6
- package/src/Callback.ts +3 -1
- package/src/Component.ts +2 -0
- package/src/FunctionSpec.ts +566 -5
- package/src/Http.ts +2 -5
- package/src/ManifestSection.ts +74 -0
- package/src/Profile.ts +141 -0
- package/src/Ref.ts +19 -26
- package/src/RefInternal.ts +26 -0
- package/src/SchemaToValidator.ts +22 -1
- package/src/index.ts +3 -0
- package/src/internal/scalarDocs.ts +72 -0
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import type * as Schema from "effect/Schema";
|
|
2
|
+
import type * as FunctionProvenance from "./FunctionProvenance.js";
|
|
3
|
+
import type * as MiddlewareSpec from "./MiddlewareSpec.js";
|
|
4
|
+
/**
|
|
5
|
+
* A type-level function from a function's name and args fields to the fields a
|
|
6
|
+
* profile's builders require. Read `this["Name"]` and `this["Args"]` directly
|
|
7
|
+
* in `Type`, passing them to a type alias; a nested object type cannot name
|
|
8
|
+
* `this`.
|
|
9
|
+
*/
|
|
10
|
+
export interface Fields {
|
|
11
|
+
readonly Name: string;
|
|
12
|
+
readonly Args: unknown;
|
|
13
|
+
readonly Type: object;
|
|
14
|
+
}
|
|
15
|
+
export interface NoFields extends Fields {
|
|
16
|
+
readonly Type: {};
|
|
17
|
+
}
|
|
18
|
+
export type Apply<Fields_ extends Fields, Name_ extends string, Args_> = (Fields_ & {
|
|
19
|
+
readonly Name: Name_;
|
|
20
|
+
readonly Args: Args_;
|
|
21
|
+
})["Type"];
|
|
22
|
+
/**
|
|
23
|
+
* A base profile's fields and its extension's, for one function.
|
|
24
|
+
*/
|
|
25
|
+
export interface Both<Base extends Fields, Extension extends Fields> extends Fields {
|
|
26
|
+
readonly Type: Apply<Base, this["Name"], this["Args"]> & Apply<Extension, this["Name"], this["Args"]>;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* What a profile callback sees. `args` stays a thunk.
|
|
30
|
+
*/
|
|
31
|
+
export interface Info<FieldsType> {
|
|
32
|
+
readonly name: string;
|
|
33
|
+
readonly description?: string;
|
|
34
|
+
readonly args: () => FunctionProvenance.ArgsFields;
|
|
35
|
+
readonly fields: "description" extends keyof FieldsType ? Omit<FieldsType, "description"> : FieldsType;
|
|
36
|
+
}
|
|
37
|
+
export interface Attachment<MiddlewareSpec_ extends MiddlewareSpec.AnyMiddlewareSpec, FieldsType> {
|
|
38
|
+
readonly spec: MiddlewareSpec_;
|
|
39
|
+
readonly options: (info: Info<FieldsType>) => MiddlewareSpec.Options<MiddlewareSpec_>;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* A middleware without options has none to compute and is attached at most
|
|
43
|
+
* once, so it joins a profile's list directly.
|
|
44
|
+
*/
|
|
45
|
+
type TakesOptions<MiddlewareSpec_ extends MiddlewareSpec.AnyMiddlewareSpec> = [
|
|
46
|
+
MiddlewareSpec.WithoutOptions<MiddlewareSpec_>
|
|
47
|
+
] extends [never] ? unknown : MiddlewareSpec.AttachmentError<`Middleware "${MiddlewareSpec.Key<MiddlewareSpec_>}" takes no options, so list it without Profile.attach`>;
|
|
48
|
+
/**
|
|
49
|
+
* Attach a middleware that takes options to every function a profile builds,
|
|
50
|
+
* with options computed from each function's fields.
|
|
51
|
+
*/
|
|
52
|
+
export declare const attach: <MiddlewareSpec_ extends MiddlewareSpec.AnyMiddlewareSpec, FieldsType>(spec: MiddlewareSpec_ & TakesOptions<MiddlewareSpec_>, options: (info: Info<FieldsType>) => MiddlewareSpec.Options<NoInfer<MiddlewareSpec_>>) => Attachment<MiddlewareSpec_, FieldsType>;
|
|
53
|
+
/**
|
|
54
|
+
* A type function for a schema wrapper, applied to each declared codec.
|
|
55
|
+
*/
|
|
56
|
+
export interface SchemaTransform {
|
|
57
|
+
readonly Input: Schema.Codec<unknown, unknown>;
|
|
58
|
+
readonly Type: Schema.Codec<any, any>;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Args wrappers transform the declared field map, before Struct composition.
|
|
62
|
+
*/
|
|
63
|
+
export interface ArgsTransform {
|
|
64
|
+
readonly Input: unknown;
|
|
65
|
+
readonly Type: FunctionProvenance.ArgsFields;
|
|
66
|
+
}
|
|
67
|
+
export interface Transforms {
|
|
68
|
+
readonly args?: ArgsTransform;
|
|
69
|
+
readonly returns?: SchemaTransform;
|
|
70
|
+
readonly item?: SchemaTransform;
|
|
71
|
+
readonly error?: SchemaTransform;
|
|
72
|
+
}
|
|
73
|
+
export type Transform<T, Input> = (T & {
|
|
74
|
+
readonly Input: Input;
|
|
75
|
+
})["Type" & keyof T];
|
|
76
|
+
/**
|
|
77
|
+
* Error wrappers opt into Schema.Never when no error thunk was declared.
|
|
78
|
+
*/
|
|
79
|
+
export type Wrappers<T extends Transforms, FieldsType> = {
|
|
80
|
+
readonly [K in keyof T]-?: K extends keyof Transforms ? <Input extends (K extends "args" ? FunctionProvenance.ArgsFields : Schema.Codec<any, any>)>(thunk: () => Input, info: Info<FieldsType>) => () => Transform<T[K], Input> : never;
|
|
81
|
+
} & {
|
|
82
|
+
readonly [K in Exclude<keyof Transforms, keyof T>]?: never;
|
|
83
|
+
};
|
|
84
|
+
type NonemptyError<T extends Transforms> = T extends {
|
|
85
|
+
readonly error: infer E extends SchemaTransform;
|
|
86
|
+
} ? [Transform<E, typeof Schema.Never>["Type"]] extends [never] ? MiddlewareSpec.AttachmentError<"Profile error wrapper must add an error to Schema.Never"> : unknown : unknown;
|
|
87
|
+
export type SchemaConfig<T extends Transforms, FieldsType> = ([
|
|
88
|
+
keyof T
|
|
89
|
+
] extends [never] ? {
|
|
90
|
+
readonly schemas?: never;
|
|
91
|
+
} : {
|
|
92
|
+
readonly schemas: Wrappers<T, FieldsType>;
|
|
93
|
+
}) & NonemptyError<T>;
|
|
94
|
+
export {};
|
|
95
|
+
//# sourceMappingURL=Profile.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Profile.d.ts","sourceRoot":"","sources":["../src/Profile.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,MAAM,eAAe,CAAC;AAC7C,OAAO,KAAK,KAAK,kBAAkB,MAAM,yBAAyB,CAAC;AACnE,OAAO,KAAK,KAAK,cAAc,MAAM,qBAAqB,CAAC;AAE3D;;;;;GAKG;AACH,MAAM,WAAW,MAAM;IACrB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAGtB,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,QAAS,SAAQ,MAAM;IACtC,QAAQ,CAAC,IAAI,EAAE,EAAE,CAAC;CACnB;AAED,MAAM,MAAM,KAAK,CACf,OAAO,SAAS,MAAM,EACtB,KAAK,SAAS,MAAM,EACpB,KAAK,IACH,CAAC,OAAO,GAAG;IAAE,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAA;CAAE,CAAC,CAAC,MAAM,CAAC,CAAC;AAEvE;;GAEG;AACH,MAAM,WAAW,IAAI,CACnB,IAAI,SAAS,MAAM,EACnB,SAAS,SAAS,MAAM,CACxB,SAAQ,MAAM;IACd,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,GACpD,KAAK,CAAC,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;CAChD;AAED;;GAE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C,CAAC,SAAS,UAAU,IAAI,CAAC,SAAS;IACnD,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,SAAS,eAAe,CAAC;CACjD,GACG,CAAC,SAAS,CAAC,CAAC,EAAE,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC,GACzD,cAAc,CAAC,eAAe,CAAC,yDAAyD,CAAC,GACzF,OAAO,GACT,OAAO,CAAC;AAEZ,MAAM,MAAM,YAAY,CAAC,CAAC,SAAS,UAAU,EAAE,UAAU,IAAI,CAAC;IAC5D,MAAM,CAAC;CACR,SAAS,CAAC,KAAK,CAAC,GACb;IAAE,QAAQ,CAAC,OAAO,CAAC,EAAE,KAAK,CAAA;CAAE,GAC5B;IAAE,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC,EAAE,UAAU,CAAC,CAAA;CAAE,CAAC,GAChD,aAAa,CAAC,CAAC,CAAC,CAAC"}
|
package/dist/Profile.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { __exportAll } from "./_virtual/_rolldown/runtime.js";
|
|
2
|
+
//#region src/Profile.ts
|
|
3
|
+
var Profile_exports = /* @__PURE__ */ __exportAll({ attach: () => attach });
|
|
4
|
+
/**
|
|
5
|
+
* Attach a middleware that takes options to every function a profile builds,
|
|
6
|
+
* with options computed from each function's fields.
|
|
7
|
+
*/
|
|
8
|
+
const attach = (spec, options) => ({
|
|
9
|
+
spec,
|
|
10
|
+
options
|
|
11
|
+
});
|
|
12
|
+
//#endregion
|
|
13
|
+
export { Profile_exports, attach };
|
|
14
|
+
|
|
15
|
+
//# sourceMappingURL=Profile.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Profile.js","names":[],"sources":["../src/Profile.ts"],"sourcesContent":["import type * as Schema from \"effect/Schema\";\nimport type * as FunctionProvenance from \"./FunctionProvenance.js\";\nimport type * as MiddlewareSpec from \"./MiddlewareSpec.js\";\n\n/**\n * A type-level function from a function's name and args fields to the fields a\n * profile's builders require. Read `this[\"Name\"]` and `this[\"Args\"]` directly\n * in `Type`, passing them to a type alias; a nested object type cannot name\n * `this`.\n */\nexport interface Fields {\n readonly Name: string;\n // `unknown`, not `ArgsFields`: an index signature here would leak into\n // `keyof this[\"Args\"]`.\n readonly Args: unknown;\n readonly Type: object;\n}\n\nexport interface NoFields extends Fields {\n readonly Type: {};\n}\n\nexport type Apply<\n Fields_ extends Fields,\n Name_ extends string,\n Args_,\n> = (Fields_ & { readonly Name: Name_; readonly Args: Args_ })[\"Type\"];\n\n/**\n * A base profile's fields and its extension's, for one function.\n */\nexport interface Both<\n Base extends Fields,\n Extension extends Fields,\n> extends Fields {\n readonly Type: Apply<Base, this[\"Name\"], this[\"Args\"]> &\n Apply<Extension, this[\"Name\"], this[\"Args\"]>;\n}\n\n/**\n * What a profile callback sees. `args` stays a thunk.\n */\nexport interface Info<FieldsType> {\n readonly name: string;\n readonly description?: string;\n readonly args: () => FunctionProvenance.ArgsFields;\n readonly fields: \"description\" extends keyof FieldsType\n ? Omit<FieldsType, \"description\">\n : FieldsType;\n}\n\nexport interface Attachment<\n MiddlewareSpec_ extends MiddlewareSpec.AnyMiddlewareSpec,\n FieldsType,\n> {\n readonly spec: MiddlewareSpec_;\n readonly options: (\n info: Info<FieldsType>,\n ) => MiddlewareSpec.Options<MiddlewareSpec_>;\n}\n\n/**\n * A middleware without options has none to compute and is attached at most\n * once, so it joins a profile's list directly.\n */\ntype TakesOptions<MiddlewareSpec_ extends MiddlewareSpec.AnyMiddlewareSpec> = [\n MiddlewareSpec.WithoutOptions<MiddlewareSpec_>,\n] extends [never]\n ? unknown\n : MiddlewareSpec.AttachmentError<`Middleware \"${MiddlewareSpec.Key<MiddlewareSpec_>}\" takes no options, so list it without Profile.attach`>;\n\n/**\n * Attach a middleware that takes options to every function a profile builds,\n * with options computed from each function's fields.\n */\nexport const attach = <\n MiddlewareSpec_ extends MiddlewareSpec.AnyMiddlewareSpec,\n FieldsType,\n>(\n spec: MiddlewareSpec_ & TakesOptions<MiddlewareSpec_>,\n options: (\n info: Info<FieldsType>,\n ) => MiddlewareSpec.Options<NoInfer<MiddlewareSpec_>>,\n): Attachment<MiddlewareSpec_, FieldsType> => ({ spec, options });\n\n/**\n * A type function for a schema wrapper, applied to each declared codec.\n */\nexport interface SchemaTransform {\n readonly Input: Schema.Codec<unknown, unknown>;\n readonly Type: Schema.Codec<any, any>;\n}\n\n/**\n * Args wrappers transform the declared field map, before Struct composition.\n */\nexport interface ArgsTransform {\n readonly Input: unknown;\n readonly Type: FunctionProvenance.ArgsFields;\n}\n\nexport interface Transforms {\n readonly args?: ArgsTransform;\n readonly returns?: SchemaTransform;\n readonly item?: SchemaTransform;\n readonly error?: SchemaTransform;\n}\n\nexport type Transform<T, Input> = (T & { readonly Input: Input })[\"Type\" &\n keyof T];\n\n/**\n * Error wrappers opt into Schema.Never when no error thunk was declared.\n */\nexport type Wrappers<T extends Transforms, FieldsType> = {\n readonly [K in keyof T]-?: K extends keyof Transforms\n ? <\n Input extends (K extends \"args\"\n ? FunctionProvenance.ArgsFields\n : Schema.Codec<any, any>),\n >(\n thunk: () => Input,\n info: Info<FieldsType>,\n ) => () => Transform<T[K], Input>\n : never;\n} & { readonly [K in Exclude<keyof Transforms, keyof T>]?: never };\n\ntype NonemptyError<T extends Transforms> = T extends {\n readonly error: infer E extends SchemaTransform;\n}\n ? [Transform<E, typeof Schema.Never>[\"Type\"]] extends [never]\n ? MiddlewareSpec.AttachmentError<\"Profile error wrapper must add an error to Schema.Never\">\n : unknown\n : unknown;\n\nexport type SchemaConfig<T extends Transforms, FieldsType> = ([\n keyof T,\n] extends [never]\n ? { readonly schemas?: never }\n : { readonly schemas: Wrappers<T, FieldsType> }) &\n NonemptyError<T>;\n"],"mappings":";;;;;;;AA2EA,MAAa,UAIX,MACA,aAG6C;CAAE;CAAM;AAAQ"}
|
package/dist/Ref.d.ts
CHANGED
|
@@ -19,7 +19,9 @@ export interface Base<RuntimeAndFunctionType_ extends RuntimeAndFunctionType.Run
|
|
|
19
19
|
readonly "~ArgsVariance"?: string extends keyof Args_ ? unknown : (args: Args_) => void;
|
|
20
20
|
readonly "~Returns": Returns_;
|
|
21
21
|
readonly "~Error": Error_;
|
|
22
|
+
readonly functionType?: RuntimeAndFunctionType_["functionType"];
|
|
22
23
|
readonly convexFunctionName: string;
|
|
24
|
+
readonly reservedArgument?: string;
|
|
23
25
|
/**
|
|
24
26
|
* Preserved for component references and function handles, which have no
|
|
25
27
|
* local name.
|
|
@@ -169,13 +171,12 @@ convexFunctionNamespace: string, functionSpec: FunctionSpec_, groupMiddlewareAtt
|
|
|
169
171
|
* and `error` from the provenance on first use, so building it forces no
|
|
170
172
|
* schema.
|
|
171
173
|
*/
|
|
172
|
-
export declare const fromProvenance: (convexFunctionName: string, provenance: FunctionProvenance.AnyConfect, middlewareAttachments: ReadonlyArray<MiddlewareAttachment.MiddlewareAttachment>, functionReference?: ConvexFunctionReference<any, any
|
|
174
|
+
export declare const fromProvenance: (convexFunctionName: string, provenance: FunctionProvenance.AnyConfect, middlewareAttachments: ReadonlyArray<MiddlewareAttachment.MiddlewareAttachment>, functionReference?: ConvexFunctionReference<any, any>, functionType?: "query" | "mutation" | "action", reservedArgument?: string) => AnyConfect;
|
|
173
175
|
export declare const getConvexFunctionName: (ref: Any) => string;
|
|
174
|
-
export declare const getFunctionReference: <Ref_ extends Any>(ref: Ref_) => FunctionReference<Ref_>;
|
|
175
176
|
/**
|
|
176
177
|
* Adapt a native reference without assigning Confect codecs or typed errors.
|
|
177
178
|
*/
|
|
178
|
-
export declare const fromFunctionReference: <Type extends "query" | "mutation" | "action", Visibility extends FunctionVisibility, Args_ extends DefaultFunctionArgs, Returns_>(functionReference: ConvexFunctionReference<Type, Visibility, Args_, Returns_>) => ConvexRef<Extract<RuntimeAndFunctionType.RuntimeAndFunctionType, {
|
|
179
|
+
export declare const fromFunctionReference: <Type extends "query" | "mutation" | "action", Visibility extends FunctionVisibility, Args_ extends DefaultFunctionArgs, Returns_>(functionReference: ConvexFunctionReference<Type, Visibility, Args_, Returns_>, functionType?: NoInfer<Type>) => ConvexRef<Extract<RuntimeAndFunctionType.RuntimeAndFunctionType, {
|
|
179
180
|
readonly runtime: "Convex";
|
|
180
181
|
readonly functionType: Type;
|
|
181
182
|
}>, Visibility, Args_, Returns_>;
|
package/dist/Ref.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Ref.d.ts","sourceRoot":"","sources":["../src/Ref.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,oBAAoB,MAAM,2BAA2B,CAAC;AACvE,OAAO,KAAK,EACV,mBAAmB,EACnB,iBAAiB,IAAI,uBAAuB,EAC5C,kBAAkB,EAClB,iBAAiB,EACjB,gBAAgB,EACjB,MAAM,eAAe,CAAC;AAEvB,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,KAAK,kBAAkB,MAAM,yBAAyB,CAAC;AACnE,OAAO,KAAK,KAAK,YAAY,MAAM,mBAAmB,CAAC;AAEvD,OAAO,KAAK,cAAc,MAAM,qBAAqB,CAAC;AACtD,OAAO,KAAK,KAAK,sBAAsB,MAAM,6BAA6B,CAAC;AAE3E,eAAO,MAAM,MAAM,uBAAuB,CAAC;AAC3C,MAAM,MAAM,MAAM,GAAG,OAAO,MAAM,CAAC;AAEnC,MAAM,WAAW,IAAI,CACnB,uBAAuB,SAAS,sBAAsB,CAAC,sBAAsB,EAC7E,mBAAmB,SAAS,kBAAkB,EAC9C,KAAK,SAAS,mBAAmB,EACjC,QAAQ,EACR,MAAM,GAAG,KAAK;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IAAI,CAAC,CAAC,EAAE,MAAM,CAAC,WAAW,CAO3D,CAAC;AAEL;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,iBAAiB,GAAI,IAAI,SAAS,GAAG,OAC3C,IAAI,gBACK,OAAO,KACpB,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAOzB,CAAC;AAwBJ;;;;;;GAMG;AACH,eAAO,MAAM,4BAA4B,GACvC,IAAI,SAAS,uBAAuB,OAE/B,IAAI,QACH,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,gBAAgB,CAAC,KACvC,OAOA,CAAC;AAEJ;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,GAAI,IAAI,SAAS,uBAAuB,OACtE,IAAI,eACI,OAAO,KACnB,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,CAOK,CAAC;AAE7B;;;;;;;GAOG;AACH,eAAO,MAAM,YAAY,GACvB,IAAI,SAAS,GAAG,EAChB,CAAC,iEAKoB,iBAAiB,CAAC,IAAI,CAAC,eAC7B,OAAO,KACjB,WAAW,CAAC,OAAO,CAAC,6BACC,OAAO,KAAK,CAAC,2FAyBvC,CAAC"}
|
package/dist/Ref.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { __exportAll } from "./_virtual/_rolldown/runtime.js";
|
|
2
2
|
import { defineProperty } from "./Lazy.js";
|
|
3
3
|
import { errorSchemas } from "./MiddlewareSpec.js";
|
|
4
|
-
import
|
|
4
|
+
import { getFunctionReference } from "./RefInternal.js";
|
|
5
5
|
import * as Schema from "effect/Schema";
|
|
6
|
-
import
|
|
6
|
+
import * as Predicate from "effect/Predicate";
|
|
7
|
+
import { getFunctionAddress } from "convex/server";
|
|
7
8
|
import { ConvexError } from "convex/values";
|
|
8
9
|
import * as Effect from "effect/Effect";
|
|
9
10
|
import * as Match from "effect/Match";
|
|
@@ -25,7 +26,6 @@ var Ref_exports = /* @__PURE__ */ __exportAll({
|
|
|
25
26
|
fromFunctionReference: () => fromFunctionReference,
|
|
26
27
|
fromProvenance: () => fromProvenance,
|
|
27
28
|
getConvexFunctionName: () => getConvexFunctionName,
|
|
28
|
-
getFunctionReference: () => getFunctionReference,
|
|
29
29
|
hasErrorSchema: () => hasErrorSchema,
|
|
30
30
|
isConvexError: () => isConvexError,
|
|
31
31
|
isRef: () => isRef,
|
|
@@ -42,8 +42,9 @@ const make = (convexFunctionNamespace, functionSpec, groupMiddlewareAttachments
|
|
|
42
42
|
return Match.value(functionSpec.functionProvenance).pipe(Match.tag("Convex", () => ({
|
|
43
43
|
[TypeId]: TypeId,
|
|
44
44
|
_tag: "Convex",
|
|
45
|
+
functionType: functionSpec.runtimeAndFunctionType.functionType,
|
|
45
46
|
convexFunctionName
|
|
46
|
-
})), Match.tag("Confect", (provenance) => fromProvenance(convexFunctionName, provenance, [...groupMiddlewareAttachments, ...functionSpec.middlewareAttachments])), Match.exhaustive);
|
|
47
|
+
})), Match.tag("Confect", (provenance) => fromProvenance(convexFunctionName, provenance, [...groupMiddlewareAttachments, ...functionSpec.middlewareAttachments], void 0, functionSpec.runtimeAndFunctionType.functionType, functionSpec.reservedArgument)), Match.exhaustive);
|
|
47
48
|
};
|
|
48
49
|
/**
|
|
49
50
|
* Build a Confect ref that runs with `provenance`'s codecs. Pass
|
|
@@ -52,11 +53,13 @@ const make = (convexFunctionNamespace, functionSpec, groupMiddlewareAttachments
|
|
|
52
53
|
* and `error` from the provenance on first use, so building it forces no
|
|
53
54
|
* schema.
|
|
54
55
|
*/
|
|
55
|
-
const fromProvenance = (convexFunctionName, provenance, middlewareAttachments, functionReference) => {
|
|
56
|
+
const fromProvenance = (convexFunctionName, provenance, middlewareAttachments, functionReference, functionType, reservedArgument) => {
|
|
56
57
|
const ref = {
|
|
57
58
|
[TypeId]: TypeId,
|
|
58
59
|
_tag: "Confect",
|
|
60
|
+
...functionType === void 0 ? {} : { functionType },
|
|
59
61
|
convexFunctionName,
|
|
62
|
+
...reservedArgument === void 0 ? {} : { reservedArgument },
|
|
60
63
|
...functionReference === void 0 ? {} : { functionReference },
|
|
61
64
|
kind: provenance.kind,
|
|
62
65
|
middlewareAttachments,
|
|
@@ -70,24 +73,15 @@ const fromProvenance = (convexFunctionName, provenance, middlewareAttachments, f
|
|
|
70
73
|
return ref;
|
|
71
74
|
};
|
|
72
75
|
const getConvexFunctionName = (ref) => ref.convexFunctionName;
|
|
73
|
-
const functionReferenceCache = /* @__PURE__ */ new Map();
|
|
74
|
-
const getFunctionReference = (ref) => {
|
|
75
|
-
if (ref.functionReference !== void 0) return ref.functionReference;
|
|
76
|
-
const convexFunctionName = getConvexFunctionName(ref);
|
|
77
|
-
const cached = functionReferenceCache.get(convexFunctionName);
|
|
78
|
-
if (cached !== void 0) return cached;
|
|
79
|
-
const functionReference = makeFunctionReference(convexFunctionName);
|
|
80
|
-
functionReferenceCache.set(convexFunctionName, functionReference);
|
|
81
|
-
return functionReference;
|
|
82
|
-
};
|
|
83
76
|
/**
|
|
84
77
|
* Adapt a native reference without assigning Confect codecs or typed errors.
|
|
85
78
|
*/
|
|
86
|
-
const fromFunctionReference = (functionReference) => {
|
|
79
|
+
const fromFunctionReference = (functionReference, functionType) => {
|
|
87
80
|
const address = getFunctionAddress(functionReference);
|
|
88
81
|
return {
|
|
89
82
|
[TypeId]: TypeId,
|
|
90
83
|
_tag: "Convex",
|
|
84
|
+
...functionType === void 0 ? {} : { functionType },
|
|
91
85
|
convexFunctionName: address.name ?? address.reference ?? address.functionHandle ?? "<external function>",
|
|
92
86
|
functionReference
|
|
93
87
|
};
|
|
@@ -198,6 +192,6 @@ const runWithCodec = Effect.fnUntraced(function* (ref, args, call, mapUnknownErr
|
|
|
198
192
|
return yield* decodeReturns(ref, encodedReturns);
|
|
199
193
|
});
|
|
200
194
|
//#endregion
|
|
201
|
-
export { Ref_exports, TypeId, decodeArgsSync, decodeError, decodeErrorOption, decodeErrorOrElse, decodePaginationPageSync, decodeReturns, decodeReturnsSync, encodeArgs, encodeArgsSync, encodePaginatedQueryArgsSync, encodeReturnsSync, fromFunctionReference, fromProvenance, getConvexFunctionName,
|
|
195
|
+
export { Ref_exports, TypeId, decodeArgsSync, decodeError, decodeErrorOption, decodeErrorOrElse, decodePaginationPageSync, decodeReturns, decodeReturnsSync, encodeArgs, encodeArgsSync, encodePaginatedQueryArgsSync, encodeReturnsSync, fromFunctionReference, fromProvenance, getConvexFunctionName, hasErrorSchema, isConvexError, isRef, make, runWithCodec };
|
|
202
196
|
|
|
203
197
|
//# sourceMappingURL=Ref.js.map
|
package/dist/Ref.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Ref.js","names":["MiddlewareSpec.errorSchemas"],"sources":["../src/Ref.ts"],"sourcesContent":["import type * as MiddlewareAttachment from \"./MiddlewareAttachment.js\";\nimport type {\n DefaultFunctionArgs,\n FunctionReference as ConvexFunctionReference,\n FunctionVisibility,\n PaginationOptions,\n PaginationResult,\n} from \"convex/server\";\nimport { getFunctionAddress, makeFunctionReference } from \"convex/server\";\nimport type { Value } from \"convex/values\";\nimport { ConvexError } from \"convex/values\";\nimport * as Effect from \"effect/Effect\";\nimport * as Match from \"effect/Match\";\nimport * as Option from \"effect/Option\";\nimport * as Predicate from \"effect/Predicate\";\nimport * as Schema from \"effect/Schema\";\nimport type * as FunctionProvenance from \"./FunctionProvenance.js\";\nimport type * as FunctionSpec from \"./FunctionSpec.js\";\nimport * as Lazy from \"./Lazy.js\";\nimport * as MiddlewareSpec from \"./MiddlewareSpec.js\";\nimport type * as RuntimeAndFunctionType from \"./RuntimeAndFunctionType.js\";\n\nexport const TypeId = \"~@confect/core/Ref\";\nexport type TypeId = typeof TypeId;\n\nexport interface Base<\n RuntimeAndFunctionType_ extends RuntimeAndFunctionType.RuntimeAndFunctionType,\n FunctionVisibility_ extends FunctionVisibility,\n Args_ extends DefaultFunctionArgs,\n Returns_,\n Error_ = never,\n> {\n readonly [TypeId]: TypeId;\n readonly \"~RuntimeAndFunctionType\": RuntimeAndFunctionType_;\n readonly \"~FunctionVisibility\": FunctionVisibility_;\n readonly \"~Args\": Args_;\n // Concrete call inputs must not narrow across assignments. Erased refs and\n // pagination constraints use index signatures and keep their broad variance.\n readonly \"~ArgsVariance\"?: string extends keyof Args_\n ? unknown\n : (args: Args_) => void;\n readonly \"~Returns\": Returns_;\n readonly \"~Error\": Error_;\n readonly convexFunctionName: string;\n /**\n * Preserved for component references and function handles, which have no\n * local name.\n */\n readonly functionReference?: ConvexFunctionReference<any, any>;\n}\n\n/**\n * A reference to a single Convex function, as callers see it: the wire name\n * plus the data needed to encode args, decode returns, and decode typed errors.\n * A ref is one of two shapes, keyed by the spec's provenance.\n */\nexport type Ref<\n RuntimeAndFunctionType_ extends RuntimeAndFunctionType.RuntimeAndFunctionType,\n FunctionVisibility_ extends FunctionVisibility,\n Args_ extends DefaultFunctionArgs,\n Returns_,\n Error_ = never,\n> =\n | ConfectRefWithTypes<\n RuntimeAndFunctionType_,\n FunctionVisibility_,\n FunctionProvenance.ArgsFields,\n Args_,\n Returns_,\n Error_\n >\n | ConvexRef<\n RuntimeAndFunctionType_,\n FunctionVisibility_,\n Args_,\n Returns_,\n Error_\n >;\n\nexport type ConfectRef<\n RuntimeAndFunctionType_ extends RuntimeAndFunctionType.RuntimeAndFunctionType,\n FunctionVisibility_ extends FunctionVisibility,\n ArgsFields_ extends FunctionProvenance.ArgsFields,\n ReturnsSchema_ extends Schema.Codec<any, any>,\n ErrorSchema_ extends Schema.Codec<any, any> = never,\n MiddlewareError_ = never,\n MiddlewareEncodedError_ = never,\n> = ConfectRefWithTypes<\n RuntimeAndFunctionType_,\n FunctionVisibility_,\n ArgsFields_,\n Schema.Struct.Type<ArgsFields_>,\n ReturnsSchema_[\"Type\"],\n ErrorSchema_[\"Type\"] | MiddlewareError_,\n ReturnsSchema_,\n ErrorSchema_,\n ErrorSchema_[\"Encoded\"] | MiddlewareEncodedError_\n>;\n\n/**\n * Internal form used while mapping a spec to a ref. Supplying the already\n * derived value types avoids repeatedly expanding `Schema.Struct` for every\n * leaf in a generated ref tree; the public `ConfectRef` alias still derives the\n * same values from its fields and schemas.\n *\n * The codecs keep their own types so that a ref's wire encoding stays visible\n * to type-level checks, and `~EncodedError` carries the wire form of every\n * error the function can fail with, middleware included. A ref built from value\n * types alone (`Ref`) has no codecs to keep and erases them.\n */\ninterface ConfectRefWithTypes<\n RuntimeAndFunctionType_ extends RuntimeAndFunctionType.RuntimeAndFunctionType,\n FunctionVisibility_ extends FunctionVisibility,\n ArgsFields_ extends FunctionProvenance.ArgsFields,\n Args_ extends DefaultFunctionArgs,\n Returns_,\n Error_,\n ReturnsSchema_ extends Schema.Codec<any, any> = Schema.Codec<any, any>,\n ErrorSchema_ extends Schema.Codec<any, any> = Schema.Codec<any, any>,\n EncodedError_ = any,\n> extends Base<\n RuntimeAndFunctionType_,\n FunctionVisibility_,\n Args_,\n Returns_,\n Error_\n> {\n readonly _tag: \"Confect\";\n readonly args: FunctionProvenance.ArgsSchema<ArgsFields_>;\n readonly returns: ReturnsSchema_;\n readonly kind: FunctionProvenance.ConfectKind;\n readonly middlewareSpecs: ReadonlyArray<MiddlewareSpec.AnyMiddlewareSpec>;\n readonly middlewareAttachments: ReadonlyArray<MiddlewareAttachment.MiddlewareAttachment>;\n readonly error?: ErrorSchema_;\n readonly \"~EncodedError\": EncodedError_;\n}\n\nexport interface ConvexRef<\n RuntimeAndFunctionType_ extends RuntimeAndFunctionType.RuntimeAndFunctionType,\n FunctionVisibility_ extends FunctionVisibility,\n Args_ extends DefaultFunctionArgs,\n Returns_,\n Error_ = never,\n> extends Base<\n RuntimeAndFunctionType_,\n FunctionVisibility_,\n Args_,\n Returns_,\n Error_\n> {\n readonly _tag: \"Convex\";\n}\n\n/**\n * A ref's call contract without a visibility requirement. Use this for handlers\n * shared by a component's public ref and its host's internal binding. Args,\n * returns, errors, runtime and function kind remain constrained.\n */\nexport type Callable<Ref_ extends Any> = Ref<\n GetRuntimeAndFunctionType<Ref_>,\n FunctionVisibility,\n Args<Ref_>,\n Returns<Ref_>,\n Error<Ref_>\n>;\n\nexport type Any = Ref<any, any, any, any, any>;\n\n/**\n * Recognizes references by their runtime type identity.\n */\nexport const isRef = (value: unknown): value is Any =>\n Predicate.hasProperty(value, TypeId);\n\n/**\n * Erased Confect-provenance ref used by provenance-specific APIs.\n */\nexport type AnyConfect = Extract<Any, { readonly _tag: \"Confect\" }>;\n\nexport type AnyInternal = Ref<any, \"internal\", any, any, any>;\n\nexport type AnyPublic = Ref<any, \"public\", any, any, any>;\n\nexport type AnyQuery = Ref<\n RuntimeAndFunctionType.AnyQuery,\n FunctionVisibility,\n any,\n any,\n any\n>;\n\nexport type AnyPaginatedQuery = AnyQuery &\n Base<\n RuntimeAndFunctionType.AnyQuery,\n FunctionVisibility,\n {\n [key: string]: any;\n paginationOpts: PaginationOptions;\n },\n PaginationResult<any>,\n any\n >;\n\nexport type AnyMutation = Ref<\n RuntimeAndFunctionType.AnyMutation,\n FunctionVisibility,\n any,\n any,\n any\n>;\n\nexport type AnyAction = Ref<\n RuntimeAndFunctionType.AnyAction,\n FunctionVisibility,\n any,\n any,\n any\n>;\n\nexport type AnyPublicQuery = Ref<\n RuntimeAndFunctionType.AnyQuery,\n \"public\",\n any,\n any,\n any\n>;\n\nexport type AnyConfectPublicQuery = Extract<AnyPublicQuery, AnyConfect>;\n\nexport type AnyPublicPaginatedQuery = AnyPublicQuery & AnyPaginatedQuery;\n\nexport type AnyConfectPublicPaginatedQuery = AnyConfectPublicQuery &\n AnyPublicPaginatedQuery;\n\nexport type AnyPublicMutation = Ref<\n RuntimeAndFunctionType.AnyMutation,\n \"public\",\n any,\n any,\n any\n>;\n\nexport type AnyConfectPublicMutation = Extract<AnyPublicMutation, AnyConfect>;\n\nexport type AnyPublicAction = Ref<\n RuntimeAndFunctionType.AnyAction,\n \"public\",\n any,\n any,\n any\n>;\n\nexport type AnyConfectPublicAction = Extract<AnyPublicAction, AnyConfect>;\n\nexport type GetRuntimeAndFunctionType<Ref_> = Ref_ extends {\n readonly \"~RuntimeAndFunctionType\": infer RuntimeAndFunctionType_ extends\n RuntimeAndFunctionType.RuntimeAndFunctionType;\n}\n ? RuntimeAndFunctionType_\n : never;\n\nexport type GetRuntime<Ref_> = RuntimeAndFunctionType.GetRuntime<\n GetRuntimeAndFunctionType<Ref_>\n>;\n\nexport type GetFunctionType<Ref_> = RuntimeAndFunctionType.GetFunctionType<\n GetRuntimeAndFunctionType<Ref_>\n>;\n\nexport type GetFunctionVisibility<Ref_> = Ref_ extends {\n readonly \"~FunctionVisibility\": infer FunctionVisibility_;\n}\n ? FunctionVisibility_\n : never;\n\nexport type Args<Ref_> = Ref_ extends { readonly \"~Args\": infer Args_ }\n ? Args_\n : never;\n\n/**\n * The field map captured by a Confect-provenance ref.\n */\nexport type ArgsFields<Ref_> = Ref_ extends {\n readonly _tag: \"Confect\";\n readonly args: {\n readonly fields: infer ArgsFields_ extends FunctionProvenance.ArgsFields;\n };\n}\n ? ArgsFields_\n : never;\n\n/**\n * The assembled args schema carried by a Confect-provenance ref.\n */\nexport type ArgsSchema<Ref_> = Ref_ extends {\n readonly _tag: \"Confect\";\n readonly args: infer ArgsSchema_ extends FunctionProvenance.AnyArgsSchema;\n}\n ? ArgsSchema_\n : never;\n\nexport type OptionalArgs<Ref_ extends Any> = keyof Args<Ref_> extends never\n ? [args?: Args<Ref_>]\n : [args: Args<Ref_>];\n\nexport type Returns<Ref_> = Ref_ extends { readonly \"~Returns\": infer Returns_ }\n ? Returns_\n : never;\n\n/**\n * The returns codec carried by a Confect-provenance ref.\n */\nexport type ReturnsSchema<Ref_> = Ref_ extends {\n readonly _tag: \"Confect\";\n readonly returns: infer ReturnsSchema_ extends Schema.Codec<any, any>;\n}\n ? ReturnsSchema_\n : never;\n\n/**\n * The wire form of every error a ref can fail with: its function's declared\n * error and its middleware's errors.\n */\nexport type EncodedError<Ref_> = Ref_ extends {\n readonly \"~EncodedError\": infer EncodedError_;\n}\n ? EncodedError_\n : never;\n\n/**\n * The function's own error codec carried by a Confect-provenance ref; errors\n * contributed by middleware are not part of it.\n */\nexport type ErrorSchema<Ref_> = Ref_ extends {\n readonly _tag: \"Confect\";\n readonly error?: infer ErrorSchema_;\n}\n ? Extract<ErrorSchema_, Schema.Codec<any, any>>\n : never;\n\nexport type Error<Ref_> = Ref_ extends { readonly \"~Error\": infer Error_ }\n ? Error_\n : never;\n\nexport type FunctionReference<Ref_ extends Any> = ConvexFunctionReference<\n GetFunctionType<Ref_>,\n GetFunctionVisibility<Ref_>\n>;\n\n/**\n * The ref type of a function spec. Errors from middleware attached to the\n * function are included; pass the errors of middleware attached to its groups\n * as `MiddlewareError` and `MiddlewareEncodedError`.\n */\nexport type FromFunctionSpec<\n FunctionSpec_ extends FunctionSpec.AnyWithProps,\n MiddlewareError = never,\n MiddlewareEncodedError = never,\n> = FromFunctionSpecHelper<\n FunctionSpec_,\n FunctionSpec.GetRuntimeAndFunctionType<FunctionSpec_>,\n FunctionSpec.GetFunctionVisibility<FunctionSpec_>,\n FunctionSpec.ArgsFields<FunctionSpec_>,\n FunctionSpec.Args<FunctionSpec_>,\n FunctionSpec.Returns<FunctionSpec_>,\n | FunctionSpec.Error<FunctionSpec_>\n | MiddlewareSpec.Error<FunctionSpec.MiddlewareSpecs<FunctionSpec_>>\n | MiddlewareError,\n FunctionSpec.ReturnsSchema<FunctionSpec_>,\n FunctionSpec.ErrorSchema<FunctionSpec_>,\n | FunctionSpec.EncodedError<FunctionSpec_>\n | MiddlewareSpec.EncodedError<FunctionSpec.MiddlewareSpecs<FunctionSpec_>>\n | MiddlewareEncodedError\n>;\n\ntype FromFunctionSpecHelper<\n FunctionSpec_ extends FunctionSpec.AnyWithProps,\n RuntimeAndFunctionType_ extends RuntimeAndFunctionType.RuntimeAndFunctionType,\n FunctionVisibility_ extends FunctionVisibility,\n ArgsFields_ extends FunctionProvenance.ArgsFields,\n Args_ extends DefaultFunctionArgs,\n Returns_,\n Error_,\n ReturnsSchema_ extends Schema.Codec<any, any>,\n ErrorSchema_ extends Schema.Codec<any, any>,\n EncodedError_,\n> =\n FunctionSpec_ extends FunctionSpec.WithFunctionProvenance<\n FunctionSpec_,\n FunctionProvenance.AnyConvex\n >\n ? ConvexRef<\n RuntimeAndFunctionType_,\n FunctionVisibility_,\n Args_ extends DefaultFunctionArgs ? Args_ : never,\n Returns_,\n never\n >\n : FunctionSpec_ extends FunctionSpec.WithFunctionProvenance<\n FunctionSpec_,\n FunctionProvenance.AnyConfect\n >\n ? ConfectRefWithTypes<\n RuntimeAndFunctionType_,\n FunctionVisibility_,\n ArgsFields_,\n Args_,\n Returns_,\n Error_,\n ReturnsSchema_,\n ErrorSchema_,\n EncodedError_\n >\n : Ref<\n RuntimeAndFunctionType_,\n FunctionVisibility_,\n Args_,\n Returns_,\n Error_\n >;\n\nexport const make = <\n FunctionSpec_ extends FunctionSpec.AnyWithProps,\n GroupMiddlewareSpec_ extends MiddlewareSpec.AnyMiddlewareSpec = never,\n>(\n /**\n * The namespace portion of a Convex function name, i.e. the part before the\n * colon. For example, for `myGroupDir/myGroupMod:myFunc` this would be\n * `myGroupDir/myGroupMod`.\n */\n convexFunctionNamespace: string,\n functionSpec: FunctionSpec_,\n groupMiddlewareAttachments: ReadonlyArray<\n MiddlewareAttachment.MiddlewareAttachment<GroupMiddlewareSpec_>\n > = [],\n): FromFunctionSpec<\n FunctionSpec_,\n MiddlewareSpec.Error<GroupMiddlewareSpec_>,\n MiddlewareSpec.EncodedError<GroupMiddlewareSpec_>\n> => {\n const convexFunctionName = `${convexFunctionNamespace}:${functionSpec.name}`;\n\n return Match.value(functionSpec.functionProvenance).pipe(\n Match.tag(\n \"Convex\",\n (): Any =>\n ({\n [TypeId]: TypeId,\n _tag: \"Convex\",\n convexFunctionName,\n }) as Any,\n ),\n Match.tag(\"Confect\", (provenance): Any =>\n fromProvenance(convexFunctionName, provenance, [\n ...groupMiddlewareAttachments,\n ...functionSpec.middlewareAttachments,\n ]),\n ),\n Match.exhaustive,\n ) as FromFunctionSpec<\n FunctionSpec_,\n MiddlewareSpec.Error<GroupMiddlewareSpec_>,\n MiddlewareSpec.EncodedError<GroupMiddlewareSpec_>\n >;\n};\n\n/**\n * Build a Confect ref that runs with `provenance`'s codecs. Pass\n * `functionReference` when the function has no local name: an installed\n * component's function or a function handle. The ref reads `args`, `returns`\n * and `error` from the provenance on first use, so building it forces no\n * schema.\n */\nexport const fromProvenance = (\n convexFunctionName: string,\n provenance: FunctionProvenance.AnyConfect,\n middlewareAttachments: ReadonlyArray<MiddlewareAttachment.MiddlewareAttachment>,\n functionReference?: ConvexFunctionReference<any, any>,\n): AnyConfect => {\n const ref = {\n [TypeId]: TypeId as TypeId,\n _tag: \"Confect\" as const,\n convexFunctionName,\n ...(functionReference === undefined ? {} : { functionReference }),\n kind: provenance.kind,\n middlewareAttachments,\n get middlewareSpecs() {\n return middlewareAttachments.map(({ spec }) => spec);\n },\n };\n\n Lazy.defineProperty(ref, \"args\", () => provenance.args);\n Lazy.defineProperty(ref, \"returns\", () => provenance.returns);\n if (\"error\" in provenance) {\n Lazy.defineProperty(ref, \"error\", () => provenance.error);\n }\n\n return ref as unknown as AnyConfect;\n};\n\nexport const getConvexFunctionName = (ref: Any): string =>\n ref.convexFunctionName;\n\nconst functionReferenceCache = new Map<string, FunctionReference<Any>>();\n\nexport const getFunctionReference = <Ref_ extends Any>(\n ref: Ref_,\n): FunctionReference<Ref_> => {\n if (ref.functionReference !== undefined) {\n return ref.functionReference as FunctionReference<Ref_>;\n }\n const convexFunctionName = getConvexFunctionName(ref);\n\n const cached = functionReferenceCache.get(convexFunctionName);\n if (cached !== undefined) {\n return cached as FunctionReference<Ref_>;\n }\n\n const functionReference = makeFunctionReference(convexFunctionName);\n functionReferenceCache.set(convexFunctionName, functionReference);\n\n return functionReference as FunctionReference<Ref_>;\n};\n\n/**\n * Adapt a native reference without assigning Confect codecs or typed errors.\n */\nexport const fromFunctionReference = <\n Type extends \"query\" | \"mutation\" | \"action\",\n Visibility extends FunctionVisibility,\n Args_ extends DefaultFunctionArgs,\n Returns_,\n>(\n functionReference: ConvexFunctionReference<Type, Visibility, Args_, Returns_>,\n): ConvexRef<\n Extract<\n RuntimeAndFunctionType.RuntimeAndFunctionType,\n { readonly runtime: \"Convex\"; readonly functionType: Type }\n >,\n Visibility,\n Args_,\n Returns_\n> => {\n const address = getFunctionAddress(functionReference);\n return {\n [TypeId]: TypeId,\n _tag: \"Convex\",\n convexFunctionName:\n address.name ??\n address.reference ??\n address.functionHandle ??\n \"<external function>\",\n functionReference,\n } as ConvexRef<\n Extract<\n RuntimeAndFunctionType.RuntimeAndFunctionType,\n { readonly runtime: \"Convex\"; readonly functionType: Type }\n >,\n Visibility,\n Args_,\n Returns_\n >;\n};\n\nexport const hasErrorSchema = (ref: Any): boolean =>\n Match.value(ref).pipe(\n Match.tag(\n \"Confect\",\n (confectRef) =>\n \"error\" in confectRef ||\n confectRef.middlewareSpecs.some(\n (middlewareSpec) => \"error\" in middlewareSpec,\n ),\n ),\n Match.tag(\"Convex\", () => false),\n Match.exhaustive,\n );\n\nexport const encodeArgs = <Ref_ extends Any>(\n ref: Ref_,\n args: Args<Ref_>,\n): Effect.Effect<unknown, Schema.SchemaError> =>\n Match.value<Any>(ref).pipe(\n Match.tag(\"Confect\", (confectRef) =>\n Schema.encodeEffect(confectRef.args)(args),\n ),\n Match.tag(\"Convex\", () => Effect.succeed(args)),\n Match.exhaustive,\n );\n\nexport const decodeReturns = <Ref_ extends Any>(\n ref: Ref_,\n returns: unknown,\n): Effect.Effect<Returns<Ref_>, Schema.SchemaError> =>\n Match.value<Any>(ref).pipe(\n Match.tag(\"Confect\", (confectRef) =>\n Schema.decodeUnknownEffect(confectRef.returns)(returns),\n ),\n Match.tag(\"Convex\", () => Effect.succeed(returns as Returns<Ref_>)),\n Match.exhaustive,\n );\n\nexport const encodeArgsSync = <Ref_ extends Any>(\n ref: Ref_,\n args: Args<Ref_>,\n): unknown =>\n Match.value<Any>(ref).pipe(\n Match.tag(\"Confect\", (confectRef) =>\n Schema.encodeSync(confectRef.args)(args),\n ),\n Match.tag(\"Convex\", () => args),\n Match.exhaustive,\n );\n\nexport const decodeArgsSync = <Ref_ extends Any>(\n ref: Ref_,\n encodedArgs: unknown,\n): Args<Ref_> =>\n Match.value<Any>(ref).pipe(\n Match.tag(\"Confect\", (confectRef) =>\n Schema.decodeUnknownSync(confectRef.args)(encodedArgs),\n ),\n Match.tag(\"Convex\", () => encodedArgs),\n Match.exhaustive,\n ) as Args<Ref_>;\n\nexport const encodeReturnsSync = <Ref_ extends Any>(\n ref: Ref_,\n returns: Returns<Ref_>,\n): unknown =>\n Match.value<Any>(ref).pipe(\n Match.tag(\"Confect\", (confectRef) =>\n Schema.encodeSync(confectRef.returns)(returns),\n ),\n Match.tag(\"Convex\", () => returns),\n Match.exhaustive,\n );\n\nexport const decodeReturnsSync = <Ref_ extends Any>(\n ref: Ref_,\n encodedReturns: unknown,\n): Returns<Ref_> =>\n Match.value<Any>(ref).pipe(\n Match.tag(\"Confect\", (confectRef) =>\n Schema.decodeUnknownSync(confectRef.returns)(encodedReturns),\n ),\n Match.tag(\"Convex\", () => encodedReturns),\n Match.exhaustive,\n ) as Returns<Ref_>;\n\nconst ConvexErrorIdentifier = Symbol.for(\"ConvexError\");\n\nexport const isConvexError = (error: unknown): error is ConvexError<Value> =>\n error instanceof ConvexError ||\n (typeof error === \"object\" &&\n error !== null &&\n ConvexErrorIdentifier in error);\n\n/**\n * Build a callback-style handler that decodes the ref's typed error from a\n * caught `ConvexError`, or else forwards the value to `mapUnknownError`. The\n * fallback is also invoked when the input _is_ a `ConvexError` but the ref\n * doesn't declare a typed-error schema—by definition such a value falls outside\n * the ref's error contract. Useful when adapting non-Effect APIs (e.g. emitter\n * callbacks for streamed subscriptions) to the same error semantics that\n * `runWithCodec` provides.\n */\nexport const decodeErrorOrElse =\n <Ref_ extends Any, E>(ref: Ref_, mapUnknownError: (error: unknown) => E) =>\n (error: unknown): Error<Ref_> | E => {\n if (isConvexError(error)) {\n const decoded = decodeErrorOption(ref, error.data);\n if (Option.isSome(decoded)) {\n return decoded.value;\n }\n }\n return mapUnknownError(error);\n };\n\nconst errorSchemaOf = (ref: Any): Option.Option<Schema.Codec<any, any>> =>\n Match.value(ref).pipe(\n Match.tag(\"Confect\", (confectRef) => {\n const schemas = [\n ...(\"error\" in confectRef && confectRef.error !== undefined\n ? [confectRef.error]\n : []),\n ...MiddlewareSpec.errorSchemas(confectRef.middlewareSpecs),\n ];\n return schemas.length === 0\n ? Option.none<Schema.Codec<any, any>>()\n : Option.some(\n schemas.length === 1 ? schemas[0]! : Schema.Union(schemas),\n );\n }),\n Match.tag(\"Convex\", () => Option.none<Schema.Codec<any, any>>()),\n Match.exhaustive,\n );\n\n/**\n * Decode `encodedError` against the ref's error schema—the function's declared\n * `error` schema unioned with its covering middlewares' error schemas. Returns\n * `None` if the ref declares no typed error at all (Confect ref without an\n * `error` schema and without failing middleware, or a Convex-provenance ref)—by\n * definition there's nothing to decode the value into, and the caller is\n * responsible for deciding what to do (typically: surface the original value as\n * a defect).\n */\nexport const decodeError = <Ref_ extends Any>(\n ref: Ref_,\n encodedError: unknown,\n): Effect.Effect<Option.Option<Error<Ref_>>, Schema.SchemaError> =>\n Option.match(errorSchemaOf(ref), {\n onNone: () => Effect.succeed(Option.none<Error<Ref_>>()),\n onSome: (schema) =>\n Effect.asSome(\n Schema.decodeUnknownEffect(schema)(encodedError),\n ) as Effect.Effect<Option.Option<Error<Ref_>>, Schema.SchemaError>,\n });\n\n/**\n * Synchronous counterpart to `decodeError`. Returns `None` when the value is\n * not this ref's typed error—either because the ref declares no `error` schema,\n * or because `encodedError` doesn't match the one it declares.\n *\n * The second case is reachable in normal operation: Convex raises its own\n * `ConvexError`s (an `InvalidCursor` pagination error, for instance), and those\n * never match a user-declared error schema. Callers pair this with a fallback\n * that surfaces the original error, so failing to decode must not throw—a\n * `ParseError` here would replace the real error with an opaque one and lose\n * the only useful diagnostic. Hence the `Option` suffix rather than `Sync`,\n * matching `Schema.decodeUnknownOption`: the sibling `*Sync` helpers in this\n * module all throw on a parse failure, and this one deliberately doesn't.\n */\nexport const decodeErrorOption = <Ref_ extends Any>(\n ref: Ref_,\n encodedError: unknown,\n): Option.Option<Error<Ref_>> =>\n Option.flatMap(\n errorSchemaOf(ref),\n (schema) =>\n Schema.decodeUnknownOption(schema)(encodedError) as Option.Option<\n Error<Ref_>\n >,\n );\n\nconst missingPaginatedProvenanceError = (ref: Any) =>\n new globalThis.Error(\n `Paginated query ref \"${getConvexFunctionName(ref)}\" was not built with ` +\n \"`FunctionSpec.publicPaginatedQuery` (or `FunctionSpec.internalPaginatedQuery`). \" +\n \"Paginated encoding and decoding require the user-args and item schemas \" +\n \"those constructors store. Define the function as, e.g.:\\n\\n\" +\n \" FunctionSpec.publicPaginatedQuery({\\n\" +\n ' name: \"...\",\\n' +\n \" args: () => ({ ... }), // optional; without paginationOpts\\n\" +\n \" item: () => ItemSchema,\\n\" +\n \" })\",\n );\n\nconst paginatedKind = (ref: AnyConfect): FunctionProvenance.Paginated =>\n Match.value(ref.kind).pipe(\n Match.tag(\"Paginated\", (kind) => kind),\n Match.tag(\"Standard\", () => {\n throw missingPaginatedProvenanceError(ref);\n }),\n Match.exhaustive,\n );\n\n/**\n * Encode the args of a paginated query ref via its user-args\n * schema—`paginationOpts` is excluded, since the pagination protocol fields are\n * managed by the client (e.g. `usePaginatedQuery` from `convex/react`), not by\n * the caller. Requires a ref built with `FunctionSpec.publicPaginatedQuery` (or\n * `internalPaginatedQuery`).\n */\nexport const encodePaginatedQueryArgsSync = <\n Ref_ extends AnyPublicPaginatedQuery,\n>(\n ref: Ref_,\n args: Omit<Args<Ref_>, \"paginationOpts\">,\n): unknown =>\n Match.value<Any>(ref).pipe(\n Match.tag(\"Confect\", (confectRef) =>\n Schema.encodeUnknownSync(paginatedKind(confectRef).userArgs)(args),\n ),\n Match.tag(\"Convex\", () => args),\n Match.exhaustive,\n );\n\n/**\n * Decode a page of a paginated query's results via the ref's item schema.\n * Requires a ref built with `FunctionSpec.publicPaginatedQuery` (or\n * `internalPaginatedQuery`).\n */\nexport const decodePaginationPageSync = <Ref_ extends AnyPublicPaginatedQuery>(\n ref: Ref_,\n encodedPage: unknown,\n): Returns<Ref_>[\"page\"] =>\n Match.value<Any>(ref).pipe(\n Match.tag(\"Confect\", (confectRef) =>\n Schema.decodeUnknownSync(paginatedKind(confectRef).page)(encodedPage),\n ),\n Match.tag(\"Convex\", () => encodedPage),\n Match.exhaustive,\n ) as Returns<Ref_>[\"page\"];\n\n/**\n * Encode args via the ref's args schema, invoke `call`, decode returns via the\n * ref's returns schema, and translate any thrown `ConvexError` into the ref's\n * typed error. Anything else the Promise rejects with—network failures,\n * server-side runtime errors, validation failures, etc.—is passed to\n * `mapUnknownError` to be turned into a typed `E`, or surfaced as a defect when\n * no handler is provided.\n */\nexport const runWithCodec = Effect.fnUntraced(function* <\n Ref_ extends Any,\n E = never,\n>(\n ref: Ref_,\n args: Args<Ref_>,\n call: (\n functionReference: FunctionReference<Ref_>,\n encodedArgs: unknown,\n ) => PromiseLike<unknown>,\n mapUnknownError?: (error: unknown) => E,\n): Effect.fn.Return<Returns<Ref_>, E | Error<Ref_> | Schema.SchemaError> {\n const functionReference = getFunctionReference(ref);\n const invoke = (\n encodedArgs: unknown,\n ): Effect.Effect<unknown, Error<Ref_> | E> =>\n Effect.tryPromise({\n try: () => Promise.resolve(call(functionReference, encodedArgs)),\n catch: (error): Error<Ref_> | E => {\n if (isConvexError(error)) {\n const decoded = decodeErrorOption(ref, error.data);\n if (Option.isSome(decoded)) {\n return decoded.value;\n }\n }\n if (mapUnknownError !== undefined) {\n return mapUnknownError(error);\n }\n throw error;\n },\n });\n\n const encodedArgs = yield* encodeArgs(ref, args);\n const encodedReturns = yield* invoke(encodedArgs);\n return yield* decodeReturns(ref, encodedReturns);\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsBA,MAAa,SAAS;;;;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KAAK,cAAc;AACjD,CAAC"}
|
|
1
|
+
{"version":3,"file":"Ref.js","names":["MiddlewareSpec.errorSchemas"],"sources":["../src/Ref.ts"],"sourcesContent":["import type * as MiddlewareAttachment from \"./MiddlewareAttachment.js\";\nimport type {\n DefaultFunctionArgs,\n FunctionReference as ConvexFunctionReference,\n FunctionVisibility,\n PaginationOptions,\n PaginationResult,\n} from \"convex/server\";\nimport { getFunctionAddress } from \"convex/server\";\nimport type { Value } from \"convex/values\";\nimport { ConvexError } from \"convex/values\";\nimport * as Effect from \"effect/Effect\";\nimport * as Match from \"effect/Match\";\nimport * as Option from \"effect/Option\";\nimport * as Predicate from \"effect/Predicate\";\nimport * as Schema from \"effect/Schema\";\nimport type * as FunctionProvenance from \"./FunctionProvenance.js\";\nimport type * as FunctionSpec from \"./FunctionSpec.js\";\nimport * as Lazy from \"./Lazy.js\";\nimport * as MiddlewareSpec from \"./MiddlewareSpec.js\";\nimport { getFunctionReference } from \"./RefInternal.js\";\nimport type * as RuntimeAndFunctionType from \"./RuntimeAndFunctionType.js\";\n\nexport const TypeId = \"~@confect/core/Ref\";\nexport type TypeId = typeof TypeId;\n\nexport interface Base<\n RuntimeAndFunctionType_ extends RuntimeAndFunctionType.RuntimeAndFunctionType,\n FunctionVisibility_ extends FunctionVisibility,\n Args_ extends DefaultFunctionArgs,\n Returns_,\n Error_ = never,\n> {\n readonly [TypeId]: TypeId;\n readonly \"~RuntimeAndFunctionType\": RuntimeAndFunctionType_;\n readonly \"~FunctionVisibility\": FunctionVisibility_;\n readonly \"~Args\": Args_;\n // Concrete call inputs must not narrow across assignments. Erased refs and\n // pagination constraints use index signatures and keep their broad variance.\n readonly \"~ArgsVariance\"?: string extends keyof Args_\n ? unknown\n : (args: Args_) => void;\n readonly \"~Returns\": Returns_;\n readonly \"~Error\": Error_;\n readonly functionType?: RuntimeAndFunctionType_[\"functionType\"];\n readonly convexFunctionName: string;\n readonly reservedArgument?: string;\n /**\n * Preserved for component references and function handles, which have no\n * local name.\n */\n readonly functionReference?: ConvexFunctionReference<any, any>;\n}\n\n/**\n * A reference to a single Convex function, as callers see it: the wire name\n * plus the data needed to encode args, decode returns, and decode typed errors.\n * A ref is one of two shapes, keyed by the spec's provenance.\n */\nexport type Ref<\n RuntimeAndFunctionType_ extends RuntimeAndFunctionType.RuntimeAndFunctionType,\n FunctionVisibility_ extends FunctionVisibility,\n Args_ extends DefaultFunctionArgs,\n Returns_,\n Error_ = never,\n> =\n | ConfectRefWithTypes<\n RuntimeAndFunctionType_,\n FunctionVisibility_,\n FunctionProvenance.ArgsFields,\n Args_,\n Returns_,\n Error_\n >\n | ConvexRef<\n RuntimeAndFunctionType_,\n FunctionVisibility_,\n Args_,\n Returns_,\n Error_\n >;\n\nexport type ConfectRef<\n RuntimeAndFunctionType_ extends RuntimeAndFunctionType.RuntimeAndFunctionType,\n FunctionVisibility_ extends FunctionVisibility,\n ArgsFields_ extends FunctionProvenance.ArgsFields,\n ReturnsSchema_ extends Schema.Codec<any, any>,\n ErrorSchema_ extends Schema.Codec<any, any> = never,\n MiddlewareError_ = never,\n MiddlewareEncodedError_ = never,\n> = ConfectRefWithTypes<\n RuntimeAndFunctionType_,\n FunctionVisibility_,\n ArgsFields_,\n Schema.Struct.Type<ArgsFields_>,\n ReturnsSchema_[\"Type\"],\n ErrorSchema_[\"Type\"] | MiddlewareError_,\n ReturnsSchema_,\n ErrorSchema_,\n ErrorSchema_[\"Encoded\"] | MiddlewareEncodedError_\n>;\n\n/**\n * Internal form used while mapping a spec to a ref. Supplying the already\n * derived value types avoids repeatedly expanding `Schema.Struct` for every\n * leaf in a generated ref tree; the public `ConfectRef` alias still derives the\n * same values from its fields and schemas.\n *\n * The codecs keep their own types so that a ref's wire encoding stays visible\n * to type-level checks, and `~EncodedError` carries the wire form of every\n * error the function can fail with, middleware included. A ref built from value\n * types alone (`Ref`) has no codecs to keep and erases them.\n */\ninterface ConfectRefWithTypes<\n RuntimeAndFunctionType_ extends RuntimeAndFunctionType.RuntimeAndFunctionType,\n FunctionVisibility_ extends FunctionVisibility,\n ArgsFields_ extends FunctionProvenance.ArgsFields,\n Args_ extends DefaultFunctionArgs,\n Returns_,\n Error_,\n ReturnsSchema_ extends Schema.Codec<any, any> = Schema.Codec<any, any>,\n ErrorSchema_ extends Schema.Codec<any, any> = Schema.Codec<any, any>,\n EncodedError_ = any,\n> extends Base<\n RuntimeAndFunctionType_,\n FunctionVisibility_,\n Args_,\n Returns_,\n Error_\n> {\n readonly _tag: \"Confect\";\n readonly args: FunctionProvenance.ArgsSchema<ArgsFields_>;\n readonly returns: ReturnsSchema_;\n readonly kind: FunctionProvenance.ConfectKind;\n readonly middlewareSpecs: ReadonlyArray<MiddlewareSpec.AnyMiddlewareSpec>;\n readonly middlewareAttachments: ReadonlyArray<MiddlewareAttachment.MiddlewareAttachment>;\n readonly error?: ErrorSchema_;\n readonly \"~EncodedError\": EncodedError_;\n}\n\nexport interface ConvexRef<\n RuntimeAndFunctionType_ extends RuntimeAndFunctionType.RuntimeAndFunctionType,\n FunctionVisibility_ extends FunctionVisibility,\n Args_ extends DefaultFunctionArgs,\n Returns_,\n Error_ = never,\n> extends Base<\n RuntimeAndFunctionType_,\n FunctionVisibility_,\n Args_,\n Returns_,\n Error_\n> {\n readonly _tag: \"Convex\";\n}\n\n/**\n * A ref's call contract without a visibility requirement. Use this for handlers\n * shared by a component's public ref and its host's internal binding. Args,\n * returns, errors, runtime and function kind remain constrained.\n */\nexport type Callable<Ref_ extends Any> = Ref<\n GetRuntimeAndFunctionType<Ref_>,\n FunctionVisibility,\n Args<Ref_>,\n Returns<Ref_>,\n Error<Ref_>\n>;\n\nexport type Any = Ref<any, any, any, any, any>;\n\n/**\n * Recognizes references by their runtime type identity.\n */\nexport const isRef = (value: unknown): value is Any =>\n Predicate.hasProperty(value, TypeId);\n\n/**\n * Erased Confect-provenance ref used by provenance-specific APIs.\n */\nexport type AnyConfect = Extract<Any, { readonly _tag: \"Confect\" }>;\n\nexport type AnyInternal = Ref<any, \"internal\", any, any, any>;\n\nexport type AnyPublic = Ref<any, \"public\", any, any, any>;\n\nexport type AnyQuery = Ref<\n RuntimeAndFunctionType.AnyQuery,\n FunctionVisibility,\n any,\n any,\n any\n>;\n\nexport type AnyPaginatedQuery = AnyQuery &\n Base<\n RuntimeAndFunctionType.AnyQuery,\n FunctionVisibility,\n {\n [key: string]: any;\n paginationOpts: PaginationOptions;\n },\n PaginationResult<any>,\n any\n >;\n\nexport type AnyMutation = Ref<\n RuntimeAndFunctionType.AnyMutation,\n FunctionVisibility,\n any,\n any,\n any\n>;\n\nexport type AnyAction = Ref<\n RuntimeAndFunctionType.AnyAction,\n FunctionVisibility,\n any,\n any,\n any\n>;\n\nexport type AnyPublicQuery = Ref<\n RuntimeAndFunctionType.AnyQuery,\n \"public\",\n any,\n any,\n any\n>;\n\nexport type AnyConfectPublicQuery = Extract<AnyPublicQuery, AnyConfect>;\n\nexport type AnyPublicPaginatedQuery = AnyPublicQuery & AnyPaginatedQuery;\n\nexport type AnyConfectPublicPaginatedQuery = AnyConfectPublicQuery &\n AnyPublicPaginatedQuery;\n\nexport type AnyPublicMutation = Ref<\n RuntimeAndFunctionType.AnyMutation,\n \"public\",\n any,\n any,\n any\n>;\n\nexport type AnyConfectPublicMutation = Extract<AnyPublicMutation, AnyConfect>;\n\nexport type AnyPublicAction = Ref<\n RuntimeAndFunctionType.AnyAction,\n \"public\",\n any,\n any,\n any\n>;\n\nexport type AnyConfectPublicAction = Extract<AnyPublicAction, AnyConfect>;\n\nexport type GetRuntimeAndFunctionType<Ref_> = Ref_ extends {\n readonly \"~RuntimeAndFunctionType\": infer RuntimeAndFunctionType_ extends\n RuntimeAndFunctionType.RuntimeAndFunctionType;\n}\n ? RuntimeAndFunctionType_\n : never;\n\nexport type GetRuntime<Ref_> = RuntimeAndFunctionType.GetRuntime<\n GetRuntimeAndFunctionType<Ref_>\n>;\n\nexport type GetFunctionType<Ref_> = RuntimeAndFunctionType.GetFunctionType<\n GetRuntimeAndFunctionType<Ref_>\n>;\n\nexport type GetFunctionVisibility<Ref_> = Ref_ extends {\n readonly \"~FunctionVisibility\": infer FunctionVisibility_;\n}\n ? FunctionVisibility_\n : never;\n\nexport type Args<Ref_> = Ref_ extends { readonly \"~Args\": infer Args_ }\n ? Args_\n : never;\n\n/**\n * The field map captured by a Confect-provenance ref.\n */\nexport type ArgsFields<Ref_> = Ref_ extends {\n readonly _tag: \"Confect\";\n readonly args: {\n readonly fields: infer ArgsFields_ extends FunctionProvenance.ArgsFields;\n };\n}\n ? ArgsFields_\n : never;\n\n/**\n * The assembled args schema carried by a Confect-provenance ref.\n */\nexport type ArgsSchema<Ref_> = Ref_ extends {\n readonly _tag: \"Confect\";\n readonly args: infer ArgsSchema_ extends FunctionProvenance.AnyArgsSchema;\n}\n ? ArgsSchema_\n : never;\n\nexport type OptionalArgs<Ref_ extends Any> = keyof Args<Ref_> extends never\n ? [args?: Args<Ref_>]\n : [args: Args<Ref_>];\n\nexport type Returns<Ref_> = Ref_ extends { readonly \"~Returns\": infer Returns_ }\n ? Returns_\n : never;\n\n/**\n * The returns codec carried by a Confect-provenance ref.\n */\nexport type ReturnsSchema<Ref_> = Ref_ extends {\n readonly _tag: \"Confect\";\n readonly returns: infer ReturnsSchema_ extends Schema.Codec<any, any>;\n}\n ? ReturnsSchema_\n : never;\n\n/**\n * The wire form of every error a ref can fail with: its function's declared\n * error and its middleware's errors.\n */\nexport type EncodedError<Ref_> = Ref_ extends {\n readonly \"~EncodedError\": infer EncodedError_;\n}\n ? EncodedError_\n : never;\n\n/**\n * The function's own error codec carried by a Confect-provenance ref; errors\n * contributed by middleware are not part of it.\n */\nexport type ErrorSchema<Ref_> = Ref_ extends {\n readonly _tag: \"Confect\";\n readonly error?: infer ErrorSchema_;\n}\n ? Extract<ErrorSchema_, Schema.Codec<any, any>>\n : never;\n\nexport type Error<Ref_> = Ref_ extends { readonly \"~Error\": infer Error_ }\n ? Error_\n : never;\n\nexport type FunctionReference<Ref_ extends Any> = ConvexFunctionReference<\n GetFunctionType<Ref_>,\n GetFunctionVisibility<Ref_>\n>;\n\n/**\n * The ref type of a function spec. Errors from middleware attached to the\n * function are included; pass the errors of middleware attached to its groups\n * as `MiddlewareError` and `MiddlewareEncodedError`.\n */\nexport type FromFunctionSpec<\n FunctionSpec_ extends FunctionSpec.AnyWithProps,\n MiddlewareError = never,\n MiddlewareEncodedError = never,\n> = FromFunctionSpecHelper<\n FunctionSpec_,\n FunctionSpec.GetRuntimeAndFunctionType<FunctionSpec_>,\n FunctionSpec.GetFunctionVisibility<FunctionSpec_>,\n FunctionSpec.ArgsFields<FunctionSpec_>,\n FunctionSpec.Args<FunctionSpec_>,\n FunctionSpec.Returns<FunctionSpec_>,\n | FunctionSpec.Error<FunctionSpec_>\n | MiddlewareSpec.Error<FunctionSpec.MiddlewareSpecs<FunctionSpec_>>\n | MiddlewareError,\n FunctionSpec.ReturnsSchema<FunctionSpec_>,\n FunctionSpec.ErrorSchema<FunctionSpec_>,\n | FunctionSpec.EncodedError<FunctionSpec_>\n | MiddlewareSpec.EncodedError<FunctionSpec.MiddlewareSpecs<FunctionSpec_>>\n | MiddlewareEncodedError\n>;\n\ntype FromFunctionSpecHelper<\n FunctionSpec_ extends FunctionSpec.AnyWithProps,\n RuntimeAndFunctionType_ extends RuntimeAndFunctionType.RuntimeAndFunctionType,\n FunctionVisibility_ extends FunctionVisibility,\n ArgsFields_ extends FunctionProvenance.ArgsFields,\n Args_ extends DefaultFunctionArgs,\n Returns_,\n Error_,\n ReturnsSchema_ extends Schema.Codec<any, any>,\n ErrorSchema_ extends Schema.Codec<any, any>,\n EncodedError_,\n> =\n FunctionSpec_ extends FunctionSpec.WithFunctionProvenance<\n FunctionSpec_,\n FunctionProvenance.AnyConvex\n >\n ? ConvexRef<\n RuntimeAndFunctionType_,\n FunctionVisibility_,\n Args_ extends DefaultFunctionArgs ? Args_ : never,\n Returns_,\n never\n >\n : FunctionSpec_ extends FunctionSpec.WithFunctionProvenance<\n FunctionSpec_,\n FunctionProvenance.AnyConfect\n >\n ? ConfectRefWithTypes<\n RuntimeAndFunctionType_,\n FunctionVisibility_,\n ArgsFields_,\n Args_,\n Returns_,\n Error_,\n ReturnsSchema_,\n ErrorSchema_,\n EncodedError_\n >\n : Ref<\n RuntimeAndFunctionType_,\n FunctionVisibility_,\n Args_,\n Returns_,\n Error_\n >;\n\nexport const make = <\n FunctionSpec_ extends FunctionSpec.AnyWithProps,\n GroupMiddlewareSpec_ extends MiddlewareSpec.AnyMiddlewareSpec = never,\n>(\n /**\n * The namespace portion of a Convex function name, i.e. the part before the\n * colon. For example, for `myGroupDir/myGroupMod:myFunc` this would be\n * `myGroupDir/myGroupMod`.\n */\n convexFunctionNamespace: string,\n functionSpec: FunctionSpec_,\n groupMiddlewareAttachments: ReadonlyArray<\n MiddlewareAttachment.MiddlewareAttachment<GroupMiddlewareSpec_>\n > = [],\n): FromFunctionSpec<\n FunctionSpec_,\n MiddlewareSpec.Error<GroupMiddlewareSpec_>,\n MiddlewareSpec.EncodedError<GroupMiddlewareSpec_>\n> => {\n const convexFunctionName = `${convexFunctionNamespace}:${functionSpec.name}`;\n\n return Match.value(functionSpec.functionProvenance).pipe(\n Match.tag(\n \"Convex\",\n (): Any =>\n ({\n [TypeId]: TypeId,\n _tag: \"Convex\",\n functionType: functionSpec.runtimeAndFunctionType.functionType,\n convexFunctionName,\n }) as Any,\n ),\n Match.tag(\"Confect\", (provenance): Any =>\n fromProvenance(\n convexFunctionName,\n provenance,\n [...groupMiddlewareAttachments, ...functionSpec.middlewareAttachments],\n undefined,\n functionSpec.runtimeAndFunctionType.functionType,\n functionSpec.reservedArgument,\n ),\n ),\n Match.exhaustive,\n ) as FromFunctionSpec<\n FunctionSpec_,\n MiddlewareSpec.Error<GroupMiddlewareSpec_>,\n MiddlewareSpec.EncodedError<GroupMiddlewareSpec_>\n >;\n};\n\n/**\n * Build a Confect ref that runs with `provenance`'s codecs. Pass\n * `functionReference` when the function has no local name: an installed\n * component's function or a function handle. The ref reads `args`, `returns`\n * and `error` from the provenance on first use, so building it forces no\n * schema.\n */\nexport const fromProvenance = (\n convexFunctionName: string,\n provenance: FunctionProvenance.AnyConfect,\n middlewareAttachments: ReadonlyArray<MiddlewareAttachment.MiddlewareAttachment>,\n functionReference?: ConvexFunctionReference<any, any>,\n functionType?: \"query\" | \"mutation\" | \"action\",\n reservedArgument?: string,\n): AnyConfect => {\n const ref = {\n [TypeId]: TypeId as TypeId,\n _tag: \"Confect\" as const,\n ...(functionType === undefined ? {} : { functionType }),\n convexFunctionName,\n ...(reservedArgument === undefined ? {} : { reservedArgument }),\n ...(functionReference === undefined ? {} : { functionReference }),\n kind: provenance.kind,\n middlewareAttachments,\n get middlewareSpecs() {\n return middlewareAttachments.map(({ spec }) => spec);\n },\n };\n\n Lazy.defineProperty(ref, \"args\", () => provenance.args);\n Lazy.defineProperty(ref, \"returns\", () => provenance.returns);\n if (\"error\" in provenance) {\n Lazy.defineProperty(ref, \"error\", () => provenance.error);\n }\n\n return ref as unknown as AnyConfect;\n};\n\nexport const getConvexFunctionName = (ref: Any): string =>\n ref.convexFunctionName;\n\n/**\n * Adapt a native reference without assigning Confect codecs or typed errors.\n */\nexport const fromFunctionReference = <\n Type extends \"query\" | \"mutation\" | \"action\",\n Visibility extends FunctionVisibility,\n Args_ extends DefaultFunctionArgs,\n Returns_,\n>(\n functionReference: ConvexFunctionReference<Type, Visibility, Args_, Returns_>,\n functionType?: NoInfer<Type>,\n): ConvexRef<\n Extract<\n RuntimeAndFunctionType.RuntimeAndFunctionType,\n { readonly runtime: \"Convex\"; readonly functionType: Type }\n >,\n Visibility,\n Args_,\n Returns_\n> => {\n const address = getFunctionAddress(functionReference);\n return {\n [TypeId]: TypeId,\n _tag: \"Convex\",\n ...(functionType === undefined ? {} : { functionType }),\n convexFunctionName:\n address.name ??\n address.reference ??\n address.functionHandle ??\n \"<external function>\",\n functionReference,\n } as ConvexRef<\n Extract<\n RuntimeAndFunctionType.RuntimeAndFunctionType,\n { readonly runtime: \"Convex\"; readonly functionType: Type }\n >,\n Visibility,\n Args_,\n Returns_\n >;\n};\n\nexport const hasErrorSchema = (ref: Any): boolean =>\n Match.value(ref).pipe(\n Match.tag(\n \"Confect\",\n (confectRef) =>\n \"error\" in confectRef ||\n confectRef.middlewareSpecs.some(\n (middlewareSpec) => \"error\" in middlewareSpec,\n ),\n ),\n Match.tag(\"Convex\", () => false),\n Match.exhaustive,\n );\n\nexport const encodeArgs = <Ref_ extends Any>(\n ref: Ref_,\n args: Args<Ref_>,\n): Effect.Effect<unknown, Schema.SchemaError> =>\n Match.value<Any>(ref).pipe(\n Match.tag(\"Confect\", (confectRef) =>\n Schema.encodeEffect(confectRef.args)(args),\n ),\n Match.tag(\"Convex\", () => Effect.succeed(args)),\n Match.exhaustive,\n );\n\nexport const decodeReturns = <Ref_ extends Any>(\n ref: Ref_,\n returns: unknown,\n): Effect.Effect<Returns<Ref_>, Schema.SchemaError> =>\n Match.value<Any>(ref).pipe(\n Match.tag(\"Confect\", (confectRef) =>\n Schema.decodeUnknownEffect(confectRef.returns)(returns),\n ),\n Match.tag(\"Convex\", () => Effect.succeed(returns as Returns<Ref_>)),\n Match.exhaustive,\n );\n\nexport const encodeArgsSync = <Ref_ extends Any>(\n ref: Ref_,\n args: Args<Ref_>,\n): unknown =>\n Match.value<Any>(ref).pipe(\n Match.tag(\"Confect\", (confectRef) =>\n Schema.encodeSync(confectRef.args)(args),\n ),\n Match.tag(\"Convex\", () => args),\n Match.exhaustive,\n );\n\nexport const decodeArgsSync = <Ref_ extends Any>(\n ref: Ref_,\n encodedArgs: unknown,\n): Args<Ref_> =>\n Match.value<Any>(ref).pipe(\n Match.tag(\"Confect\", (confectRef) =>\n Schema.decodeUnknownSync(confectRef.args)(encodedArgs),\n ),\n Match.tag(\"Convex\", () => encodedArgs),\n Match.exhaustive,\n ) as Args<Ref_>;\n\nexport const encodeReturnsSync = <Ref_ extends Any>(\n ref: Ref_,\n returns: Returns<Ref_>,\n): unknown =>\n Match.value<Any>(ref).pipe(\n Match.tag(\"Confect\", (confectRef) =>\n Schema.encodeSync(confectRef.returns)(returns),\n ),\n Match.tag(\"Convex\", () => returns),\n Match.exhaustive,\n );\n\nexport const decodeReturnsSync = <Ref_ extends Any>(\n ref: Ref_,\n encodedReturns: unknown,\n): Returns<Ref_> =>\n Match.value<Any>(ref).pipe(\n Match.tag(\"Confect\", (confectRef) =>\n Schema.decodeUnknownSync(confectRef.returns)(encodedReturns),\n ),\n Match.tag(\"Convex\", () => encodedReturns),\n Match.exhaustive,\n ) as Returns<Ref_>;\n\nconst ConvexErrorIdentifier = Symbol.for(\"ConvexError\");\n\nexport const isConvexError = (error: unknown): error is ConvexError<Value> =>\n error instanceof ConvexError ||\n (typeof error === \"object\" &&\n error !== null &&\n ConvexErrorIdentifier in error);\n\n/**\n * Build a callback-style handler that decodes the ref's typed error from a\n * caught `ConvexError`, or else forwards the value to `mapUnknownError`. The\n * fallback is also invoked when the input _is_ a `ConvexError` but the ref\n * doesn't declare a typed-error schema—by definition such a value falls outside\n * the ref's error contract. Useful when adapting non-Effect APIs (e.g. emitter\n * callbacks for streamed subscriptions) to the same error semantics that\n * `runWithCodec` provides.\n */\nexport const decodeErrorOrElse =\n <Ref_ extends Any, E>(ref: Ref_, mapUnknownError: (error: unknown) => E) =>\n (error: unknown): Error<Ref_> | E => {\n if (isConvexError(error)) {\n const decoded = decodeErrorOption(ref, error.data);\n if (Option.isSome(decoded)) {\n return decoded.value;\n }\n }\n return mapUnknownError(error);\n };\n\nconst errorSchemaOf = (ref: Any): Option.Option<Schema.Codec<any, any>> =>\n Match.value(ref).pipe(\n Match.tag(\"Confect\", (confectRef) => {\n const schemas = [\n ...(\"error\" in confectRef && confectRef.error !== undefined\n ? [confectRef.error]\n : []),\n ...MiddlewareSpec.errorSchemas(confectRef.middlewareSpecs),\n ];\n return schemas.length === 0\n ? Option.none<Schema.Codec<any, any>>()\n : Option.some(\n schemas.length === 1 ? schemas[0]! : Schema.Union(schemas),\n );\n }),\n Match.tag(\"Convex\", () => Option.none<Schema.Codec<any, any>>()),\n Match.exhaustive,\n );\n\n/**\n * Decode `encodedError` against the ref's error schema—the function's declared\n * `error` schema unioned with its covering middlewares' error schemas. Returns\n * `None` if the ref declares no typed error at all (Confect ref without an\n * `error` schema and without failing middleware, or a Convex-provenance ref)—by\n * definition there's nothing to decode the value into, and the caller is\n * responsible for deciding what to do (typically: surface the original value as\n * a defect).\n */\nexport const decodeError = <Ref_ extends Any>(\n ref: Ref_,\n encodedError: unknown,\n): Effect.Effect<Option.Option<Error<Ref_>>, Schema.SchemaError> =>\n Option.match(errorSchemaOf(ref), {\n onNone: () => Effect.succeed(Option.none<Error<Ref_>>()),\n onSome: (schema) =>\n Effect.asSome(\n Schema.decodeUnknownEffect(schema)(encodedError),\n ) as Effect.Effect<Option.Option<Error<Ref_>>, Schema.SchemaError>,\n });\n\n/**\n * Synchronous counterpart to `decodeError`. Returns `None` when the value is\n * not this ref's typed error—either because the ref declares no `error` schema,\n * or because `encodedError` doesn't match the one it declares.\n *\n * The second case is reachable in normal operation: Convex raises its own\n * `ConvexError`s (an `InvalidCursor` pagination error, for instance), and those\n * never match a user-declared error schema. Callers pair this with a fallback\n * that surfaces the original error, so failing to decode must not throw—a\n * `ParseError` here would replace the real error with an opaque one and lose\n * the only useful diagnostic. Hence the `Option` suffix rather than `Sync`,\n * matching `Schema.decodeUnknownOption`: the sibling `*Sync` helpers in this\n * module all throw on a parse failure, and this one deliberately doesn't.\n */\nexport const decodeErrorOption = <Ref_ extends Any>(\n ref: Ref_,\n encodedError: unknown,\n): Option.Option<Error<Ref_>> =>\n Option.flatMap(\n errorSchemaOf(ref),\n (schema) =>\n Schema.decodeUnknownOption(schema)(encodedError) as Option.Option<\n Error<Ref_>\n >,\n );\n\nconst missingPaginatedProvenanceError = (ref: Any) =>\n new globalThis.Error(\n `Paginated query ref \"${getConvexFunctionName(ref)}\" was not built with ` +\n \"`FunctionSpec.publicPaginatedQuery` (or `FunctionSpec.internalPaginatedQuery`). \" +\n \"Paginated encoding and decoding require the user-args and item schemas \" +\n \"those constructors store. Define the function as, e.g.:\\n\\n\" +\n \" FunctionSpec.publicPaginatedQuery({\\n\" +\n ' name: \"...\",\\n' +\n \" args: () => ({ ... }), // optional; without paginationOpts\\n\" +\n \" item: () => ItemSchema,\\n\" +\n \" })\",\n );\n\nconst paginatedKind = (ref: AnyConfect): FunctionProvenance.Paginated =>\n Match.value(ref.kind).pipe(\n Match.tag(\"Paginated\", (kind) => kind),\n Match.tag(\"Standard\", () => {\n throw missingPaginatedProvenanceError(ref);\n }),\n Match.exhaustive,\n );\n\n/**\n * Encode the args of a paginated query ref via its user-args\n * schema—`paginationOpts` is excluded, since the pagination protocol fields are\n * managed by the client (e.g. `usePaginatedQuery` from `convex/react`), not by\n * the caller. Requires a ref built with `FunctionSpec.publicPaginatedQuery` (or\n * `internalPaginatedQuery`).\n */\nexport const encodePaginatedQueryArgsSync = <\n Ref_ extends AnyPublicPaginatedQuery,\n>(\n ref: Ref_,\n args: Omit<Args<Ref_>, \"paginationOpts\">,\n): unknown =>\n Match.value<Any>(ref).pipe(\n Match.tag(\"Confect\", (confectRef) =>\n Schema.encodeUnknownSync(paginatedKind(confectRef).userArgs)(args),\n ),\n Match.tag(\"Convex\", () => args),\n Match.exhaustive,\n );\n\n/**\n * Decode a page of a paginated query's results via the ref's item schema.\n * Requires a ref built with `FunctionSpec.publicPaginatedQuery` (or\n * `internalPaginatedQuery`).\n */\nexport const decodePaginationPageSync = <Ref_ extends AnyPublicPaginatedQuery>(\n ref: Ref_,\n encodedPage: unknown,\n): Returns<Ref_>[\"page\"] =>\n Match.value<Any>(ref).pipe(\n Match.tag(\"Confect\", (confectRef) =>\n Schema.decodeUnknownSync(paginatedKind(confectRef).page)(encodedPage),\n ),\n Match.tag(\"Convex\", () => encodedPage),\n Match.exhaustive,\n ) as Returns<Ref_>[\"page\"];\n\n/**\n * Encode args via the ref's args schema, invoke `call`, decode returns via the\n * ref's returns schema, and translate any thrown `ConvexError` into the ref's\n * typed error. Anything else the Promise rejects with—network failures,\n * server-side runtime errors, validation failures, etc.—is passed to\n * `mapUnknownError` to be turned into a typed `E`, or surfaced as a defect when\n * no handler is provided.\n */\nexport const runWithCodec = Effect.fnUntraced(function* <\n Ref_ extends Any,\n E = never,\n>(\n ref: Ref_,\n args: Args<Ref_>,\n call: (\n functionReference: FunctionReference<Ref_>,\n encodedArgs: unknown,\n ) => PromiseLike<unknown>,\n mapUnknownError?: (error: unknown) => E,\n): Effect.fn.Return<Returns<Ref_>, E | Error<Ref_> | Schema.SchemaError> {\n const functionReference = getFunctionReference(ref);\n const invoke = (\n encodedArgs: unknown,\n ): Effect.Effect<unknown, Error<Ref_> | E> =>\n Effect.tryPromise({\n try: () => Promise.resolve(call(functionReference, encodedArgs)),\n catch: (error): Error<Ref_> | E => {\n if (isConvexError(error)) {\n const decoded = decodeErrorOption(ref, error.data);\n if (Option.isSome(decoded)) {\n return decoded.value;\n }\n }\n if (mapUnknownError !== undefined) {\n return mapUnknownError(error);\n }\n throw error;\n },\n });\n\n const encodedArgs = yield* encodeArgs(ref, args);\n const encodedReturns = yield* invoke(encodedArgs);\n return yield* decodeReturns(ref, encodedReturns);\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuBA,MAAa,SAAS;;;;AAuJtB,MAAa,SAAS,UACpB,UAAU,YAAY,OAAO,MAAM;AAyPrC,MAAa,QASX,yBACA,cACA,6BAEI,CAAC,MAKF;CACH,MAAM,qBAAqB,GAAG,wBAAwB,GAAG,aAAa;CAEtE,OAAO,MAAM,MAAM,aAAa,kBAAkB,CAAC,CAAC,KAClD,MAAM,IACJ,iBAEG;GACE,SAAS;EACV,MAAM;EACN,cAAc,aAAa,uBAAuB;EAClD;CACF,EACJ,GACA,MAAM,IAAI,YAAY,eACpB,eACE,oBACA,YACA,CAAC,GAAG,4BAA4B,GAAG,aAAa,qBAAqB,GACrE,KAAA,GACA,a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CACnE,GACA,MAAM,IAAI,gBAAgB,IAAI,GAC9B,MAAM,UACR;;;;;;AAOF,MAAa,4BACX,KACA,gBAEA,MAAM,MAAW,GAAG,CAAC,CAAC,KACpB,MAAM,IAAI,YAAY,eACpB,OAAO,kBAAkB,cAAc,UAAU,CAAC,CAAC,IAAI,CAAC,CAAC,WAAW,CACtE,GACA,MAAM,IAAI,gBAAgB,WAAW,GACrC,MAAM,UACR;;;;;;;;;AAUF,MAAa,eAAe,OAAO,WAAW,WAI5C,KACA,MACA,MAIA,iBACuE;CACvE,MAAM,oBAAoB,qBAAqB,GAAG;CAClD,MAAM,UACJ,gBAEA,OAAO,WAAW;EAChB,WAAW,QAAQ,QAAQ,KAAK,mBAAmB,WAAW,CAAC;EAC/D,QAAQ,UAA2B;GACjC,IAAI,cAAc,KAAK,GAAG;IACxB,MAAM,UAAU,kBAAkB,KAAK,MAAM,IAAI;IACjD,IAAI,OAAO,OAAO,OAAO,GACvB,OAAO,QAAQ;GAEnB;GACA,IAAI,oBAAoB,KAAA,GACtB,OAAO,gBAAgB,KAAK;GAE9B,MAAM;EACR;CACF,CAAC;CAGH,MAAM,iBAAiB,OAAO,OAAO,OADV,WAAW,KAAK,IAAI,CACC;CAChD,OAAO,OAAO,cAAc,KAAK,cAAc;AACjD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RefInternal.d.ts","sourceRoot":"","sources":["../src/RefInternal.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,GAAG,MAAM,UAAU,CAAC;AAOrC,eAAO,MAAM,oBAAoB,GAAI,IAAI,SAAS,GAAG,CAAC,GAAG,OAClD,IAAI,KACR,GAAG,CAAC,iBAAiB,CAAC,IAAI,CAe5B,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { makeFunctionReference } from "convex/server";
|
|
2
|
+
//#region src/RefInternal.ts
|
|
3
|
+
const functionReferenceCache = /* @__PURE__ */ new Map();
|
|
4
|
+
const getFunctionReference = (ref) => {
|
|
5
|
+
if (ref.functionReference !== void 0) return ref.functionReference;
|
|
6
|
+
const convexFunctionName = ref.convexFunctionName;
|
|
7
|
+
const cached = functionReferenceCache.get(convexFunctionName);
|
|
8
|
+
if (cached !== void 0) return cached;
|
|
9
|
+
const functionReference = makeFunctionReference(convexFunctionName);
|
|
10
|
+
functionReferenceCache.set(convexFunctionName, functionReference);
|
|
11
|
+
return functionReference;
|
|
12
|
+
};
|
|
13
|
+
//#endregion
|
|
14
|
+
export { getFunctionReference };
|
|
15
|
+
|
|
16
|
+
//# sourceMappingURL=RefInternal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RefInternal.js","names":[],"sources":["../src/RefInternal.ts"],"sourcesContent":["import { makeFunctionReference } from \"convex/server\";\nimport type * as Ref from \"./Ref.js\";\n\nconst functionReferenceCache = new Map<\n string,\n Ref.FunctionReference<Ref.Any>\n>();\n\nexport const getFunctionReference = <Ref_ extends Ref.Any>(\n ref: Ref_,\n): Ref.FunctionReference<Ref_> => {\n if (ref.functionReference !== undefined) {\n return ref.functionReference as Ref.FunctionReference<Ref_>;\n }\n const convexFunctionName = ref.convexFunctionName;\n\n const cached = functionReferenceCache.get(convexFunctionName);\n if (cached !== undefined) {\n return cached as Ref.FunctionReference<Ref_>;\n }\n\n const functionReference = makeFunctionReference(convexFunctionName);\n functionReferenceCache.set(convexFunctionName, functionReference);\n\n return functionReference as Ref.FunctionReference<Ref_>;\n};\n"],"mappings":";;AAGA,MAAM,yCAAyB,IAAI,IAGjC;AAEF,MAAa,wBACX,QACgC;CAChC,IAAI,IAAI,sBAAsB,KAAA,GAC5B,OAAO,IAAI;CAEb,MAAM,qBAAqB,IAAI;CAE/B,MAAM,SAAS,uBAAuB,IAAI,kBAAkB;CAC5D,IAAI,WAAW,KAAA,GACb,OAAO;CAGT,MAAM,oBAAoB,sBAAsB,kBAAkB;CAClE,uBAAuB,IAAI,oBAAoB,iBAAiB;CAEhE,OAAO;AACT"}
|
|
@@ -4,7 +4,16 @@ import * as Effect from "effect/Effect";
|
|
|
4
4
|
import * as Schema from "effect/Schema";
|
|
5
5
|
import * as SchemaAST from "effect/SchemaAST";
|
|
6
6
|
import type { IsAny, IsOptional, IsRecord, IsRecursive, IsUnion, TypeError, UnionToTuple } from "./Types.js";
|
|
7
|
-
export declare const compileArgsSchema: <ConfectValue, ConvexValue>(argsSchema: Schema.Codec<ConfectValue, ConvexValue>, scope?: IdScope.IdScope) => PropertyValidators;
|
|
7
|
+
export declare const compileArgsSchema: <ConfectValue, ConvexValue>(argsSchema: Schema.Codec<ConfectValue, ConvexValue>, scope?: IdScope.IdScope, reservedArgument?: string, functionName?: string) => PropertyValidators;
|
|
8
|
+
declare const ReservedArgumentCollision_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
9
|
+
readonly _tag: "ReservedArgumentCollision";
|
|
10
|
+
} & Readonly<A>;
|
|
11
|
+
export declare class ReservedArgumentCollision extends ReservedArgumentCollision_base<{
|
|
12
|
+
readonly functionName: string | undefined;
|
|
13
|
+
readonly argument: string;
|
|
14
|
+
}> {
|
|
15
|
+
get message(): string;
|
|
16
|
+
}
|
|
8
17
|
export declare const compileReturnsSchema: <ConfectValue, ConvexValue>(schema: Schema.Codec<ConfectValue, ConvexValue>, scope?: IdScope.IdScope) => Validator<any, any, any>;
|
|
9
18
|
/**
|
|
10
19
|
* Convert a table `Schema` to a table `Validator`.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SchemaToValidator.d.ts","sourceRoot":"","sources":["../src/SchemaToValidator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,cAAc,CAAC;AACxC,OAAO,KAAK,EACV,SAAS,IAAI,eAAe,EAC5B,kBAAkB,EAClB,SAAS,EACT,IAAI,EACJ,MAAM,EACN,QAAQ,E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kCAElD;IAEC,IAAa,OAAO,WAEnB;CAEF;;;;AAED,qBAAa,6BAA8B,SAAQ,kCAElD;IAEC,IAAa,OAAO,WAEnB;CAEF;;;;AAED,qBAAa,0BAA2B,SAAQ,gCAE9C;IACA,QAAQ,CAAC,UAAU,EAAE,SAAS,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CAC5C,CAAC;IAEA,IAAa,OAAO,WAEnB;CAEF;;;;AAED,qBAAa,mCAAoC,SAAQ,wCAExD;IAEC,IAAa,OAAO,WAEnB;CAEF;;;;AAED,qBAAa,mDAAoD,SAAQ,wDAExE;IAEC,IAAa,OAAO,WAEnB;CAEF;;;;AAED,qBAAa,yCAA0C,SAAQ,8CAE9D;IAEC,IAAa,OAAO,WAEnB;CAEF"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { __exportAll } from "./_virtual/_rolldown/runtime.js";
|
|
2
2
|
import { app } from "./IdScope.js";
|
|
3
3
|
import { scope, tableName } from "./GenericId.js";
|
|
4
|
-
import * as Predicate from "effect/Predicate";
|
|
5
4
|
import * as Schema from "effect/Schema";
|
|
5
|
+
import * as Predicate from "effect/Predicate";
|
|
6
6
|
import * as Data from "effect/Data";
|
|
7
7
|
import { v } from "convex/values";
|
|
8
8
|
import * as Effect from "effect/Effect";
|
|
@@ -20,6 +20,7 @@ var SchemaToValidator_exports = /* @__PURE__ */ __exportAll({
|
|
|
20
20
|
IndexSignaturesAreNotSupportedError: () => IndexSignaturesAreNotSupportedError,
|
|
21
21
|
MixedIndexAndPropertySignaturesAreNotSupportedError: () => MixedIndexAndPropertySignaturesAreNotSupportedError,
|
|
22
22
|
OptionalTupleElementsAreNotSupportedError: () => OptionalTupleElementsAreNotSupportedError,
|
|
23
|
+
ReservedArgumentCollision: () => ReservedArgumentCollision,
|
|
23
24
|
TopLevelMustBeObjectError: () => TopLevelMustBeObjectError,
|
|
24
25
|
TopLevelMustBeObjectOrUnionError: () => TopLevelMustBeObjectOrUnionError,
|
|
25
26
|
UnsupportedPropertySignatureKeyTypeError: () => UnsupportedPropertySignatureKeyTypeError,
|
|
@@ -31,9 +32,23 @@ var SchemaToValidator_exports = /* @__PURE__ */ __exportAll({
|
|
|
31
32
|
compileTableSchema: () => compileTableSchema,
|
|
32
33
|
isRecursive: () => isRecursive
|
|
33
34
|
});
|
|
34
|
-
const compileArgsSchema = (argsSchema, scope = app) => {
|
|
35
|
+
const compileArgsSchema = (argsSchema, scope = app, reservedArgument, functionName) => {
|
|
35
36
|
const ast = Schema.toEncoded(argsSchema).ast;
|
|
36
|
-
|
|
37
|
+
const validators = pipe(ast, Match.value, Match.tag("Objects", (objectsAst) => Array.isReadonlyArrayEmpty(objectsAst.indexSignatures) ? handlePropertySignatures(objectsAst, scope) : Effect.fail(new IndexSignaturesAreNotSupportedError())), Match.orElse(() => Effect.fail(new TopLevelMustBeObjectError())), Effect.runSync);
|
|
38
|
+
if (reservedArgument === void 0) return validators;
|
|
39
|
+
if (Object.hasOwn(validators, reservedArgument)) throw new ReservedArgumentCollision({
|
|
40
|
+
functionName,
|
|
41
|
+
argument: reservedArgument
|
|
42
|
+
});
|
|
43
|
+
return {
|
|
44
|
+
...validators,
|
|
45
|
+
[reservedArgument]: v.optional(v.any())
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
var ReservedArgumentCollision = class extends Data.TaggedError("ReservedArgumentCollision") {
|
|
49
|
+
get message() {
|
|
50
|
+
return `${this.functionName} declares the argument "${this.argument}", which its profile reserves. Rename the argument.`;
|
|
51
|
+
}
|
|
37
52
|
};
|
|
38
53
|
const compileReturnsSchema = (schema, scope = app) => Effect.runSync(compileAst(Schema.toEncoded(schema).ast, false, scope));
|
|
39
54
|
const compileTableSchema = (schema, scope = app) => {
|
|
@@ -154,6 +169,6 @@ var OptionalTupleElementsAreNotSupportedError = class extends Data.TaggedError("
|
|
|
154
169
|
}
|
|
155
170
|
};
|
|
156
171
|
//#endregion
|
|
157
|
-
export { EmptyTupleIsNotSupportedError, EmptyUnionIsNotSupportedError, IndexSignaturesAreNotSupportedError, MixedIndexAndPropertySignaturesAreNotSupportedError, OptionalTupleElementsAreNotSupportedError, SchemaToValidator_exports, TopLevelMustBeObjectError, TopLevelMustBeObjectOrUnionError, UnsupportedPropertySignatureKeyTypeError, UnsupportedSchemaTypeError, compileArgsSchema, compileAst, compileReturnsSchema, compileSchema, compileTableSchema, isRecursive };
|
|
172
|
+
export { EmptyTupleIsNotSupportedError, EmptyUnionIsNotSupportedError, IndexSignaturesAreNotSupportedError, MixedIndexAndPropertySignaturesAreNotSupportedError, OptionalTupleElementsAreNotSupportedError, ReservedArgumentCollision, SchemaToValidator_exports, TopLevelMustBeObjectError, TopLevelMustBeObjectOrUnionError, UnsupportedPropertySignatureKeyTypeError, UnsupportedSchemaTypeError, compileArgsSchema, compileAst, compileReturnsSchema, compileSchema, compileTableSchema, isRecursive };
|
|
158
173
|
|
|
159
174
|
//# sourceMappingURL=SchemaToValidator.js.map
|