@gaganref/confect-core 10.3.1-fork.2 → 10.3.1-fork.21
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/App.d.ts +14 -3
- 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 +2 -2
- package/dist/Auth.d.ts.map +1 -1
- package/dist/Auth.js.map +1 -1
- package/dist/Callback.d.ts +3 -3
- package/dist/Callback.d.ts.map +1 -1
- package/dist/Callback.js.map +1 -1
- package/dist/Component.d.ts +8 -8
- package/dist/Component.d.ts.map +1 -1
- package/dist/Component.js.map +1 -1
- package/dist/FunctionProvenance.d.ts +2 -2
- package/dist/FunctionProvenance.d.ts.map +1 -1
- package/dist/FunctionProvenance.js.map +1 -1
- package/dist/FunctionSpec.d.ts +320 -4
- package/dist/FunctionSpec.d.ts.map +1 -1
- package/dist/FunctionSpec.js +35 -3
- package/dist/FunctionSpec.js.map +1 -1
- package/dist/GenericId.d.ts +2 -2
- package/dist/GenericId.d.ts.map +1 -1
- package/dist/GenericId.js.map +1 -1
- package/dist/GroupPath.d.ts +1 -1
- package/dist/GroupPath.d.ts.map +1 -1
- package/dist/GroupPath.js.map +1 -1
- package/dist/GroupSpec.d.ts +4 -4
- package/dist/GroupSpec.d.ts.map +1 -1
- package/dist/GroupSpec.js.map +1 -1
- package/dist/Http.d.ts +1 -1
- package/dist/Http.d.ts.map +1 -1
- package/dist/Http.js.map +1 -1
- package/dist/Manifest.d.ts +1 -1
- package/dist/Manifest.d.ts.map +1 -1
- package/dist/Manifest.js.map +1 -1
- package/dist/MiddlewareAttachment.d.ts +1 -1
- package/dist/MiddlewareAttachment.d.ts.map +1 -1
- package/dist/MiddlewareAttachment.js.map +1 -1
- package/dist/MiddlewareSpec.d.ts +3 -3
- package/dist/MiddlewareSpec.d.ts.map +1 -1
- package/dist/MiddlewareSpec.js.map +1 -1
- package/dist/Profile.d.ts +52 -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 +5 -5
- package/dist/Ref.d.ts.map +1 -1
- package/dist/Ref.js.map +1 -1
- package/dist/Refs.d.ts +5 -5
- package/dist/Refs.d.ts.map +1 -1
- package/dist/Refs.js.map +1 -1
- package/dist/SchemaToValidator.d.ts +2 -2
- package/dist/SchemaToValidator.d.ts.map +1 -1
- package/dist/SchemaToValidator.js.map +1 -1
- package/dist/Spec.d.ts +1 -1
- package/dist/Spec.d.ts.map +1 -1
- package/dist/Spec.js.map +1 -1
- package/dist/SystemFields.d.ts +2 -2
- package/dist/SystemFields.d.ts.map +1 -1
- package/dist/SystemFields.js.map +1 -1
- package/dist/Table.d.ts +3 -3
- package/dist/Table.d.ts.map +1 -1
- package/dist/Table.js.map +1 -1
- package/dist/index.d.ts +30 -29
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/package.json +1 -1
- package/src/App.ts +20 -4
- package/src/Auth.ts +2 -2
- package/src/Callback.ts +3 -3
- package/src/Component.ts +11 -11
- package/src/FunctionProvenance.ts +3 -3
- package/src/FunctionSpec.ts +414 -8
- package/src/GenericId.ts +2 -2
- package/src/GroupPath.ts +1 -1
- package/src/GroupSpec.ts +5 -5
- package/src/Http.ts +1 -1
- package/src/Manifest.ts +1 -1
- package/src/MiddlewareAttachment.ts +1 -1
- package/src/MiddlewareSpec.ts +4 -4
- package/src/Profile.ts +80 -0
- package/src/Ref.ts +6 -6
- package/src/Refs.ts +5 -5
- package/src/SchemaToValidator.ts +3 -3
- package/src/Spec.ts +1 -1
- package/src/SystemFields.ts +2 -2
- package/src/Table.ts +4 -4
- package/src/index.ts +30 -29
package/src/Profile.ts
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import type * as FunctionProvenance from "./FunctionProvenance.js";
|
|
2
|
+
import type * as MiddlewareSpec from "./MiddlewareSpec.js";
|
|
3
|
+
|
|
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
|
+
// `unknown`, not `ArgsFields`: an index signature here would leak into
|
|
13
|
+
// `keyof this["Args"]`.
|
|
14
|
+
readonly Args: unknown;
|
|
15
|
+
readonly Type: object;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface NoFields extends Fields {
|
|
19
|
+
readonly Type: {};
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export type Apply<
|
|
23
|
+
Fields_ extends Fields,
|
|
24
|
+
Name_ extends string,
|
|
25
|
+
Args_,
|
|
26
|
+
> = (Fields_ & { readonly Name: Name_; readonly Args: Args_ })["Type"];
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* A base profile's fields and its extension's, for one function.
|
|
30
|
+
*/
|
|
31
|
+
export interface Both<
|
|
32
|
+
Base extends Fields,
|
|
33
|
+
Extension extends Fields,
|
|
34
|
+
> extends Fields {
|
|
35
|
+
readonly Type: Apply<Base, this["Name"], this["Args"]> &
|
|
36
|
+
Apply<Extension, this["Name"], this["Args"]>;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* What an attachment's options factory sees. `args` stays a thunk.
|
|
41
|
+
*/
|
|
42
|
+
export interface Info<FieldsType> {
|
|
43
|
+
readonly name: string;
|
|
44
|
+
readonly args: () => FunctionProvenance.ArgsFields;
|
|
45
|
+
readonly fields: FieldsType;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export interface Attachment<
|
|
49
|
+
MiddlewareSpec_ extends MiddlewareSpec.AnyMiddlewareSpec,
|
|
50
|
+
FieldsType,
|
|
51
|
+
> {
|
|
52
|
+
readonly spec: MiddlewareSpec_;
|
|
53
|
+
readonly options: (
|
|
54
|
+
info: Info<FieldsType>,
|
|
55
|
+
) => MiddlewareSpec.Options<MiddlewareSpec_>;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* A middleware without options has none to compute and is attached at most
|
|
60
|
+
* once, so it joins a profile's list directly.
|
|
61
|
+
*/
|
|
62
|
+
type TakesOptions<MiddlewareSpec_ extends MiddlewareSpec.AnyMiddlewareSpec> = [
|
|
63
|
+
MiddlewareSpec.WithoutOptions<MiddlewareSpec_>,
|
|
64
|
+
] extends [never]
|
|
65
|
+
? unknown
|
|
66
|
+
: MiddlewareSpec.AttachmentError<`Middleware "${MiddlewareSpec.Key<MiddlewareSpec_>}" takes no options, so list it without Profile.attach`>;
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Attach a middleware that takes options to every function a profile builds,
|
|
70
|
+
* with options computed from each function's fields.
|
|
71
|
+
*/
|
|
72
|
+
export const attach = <
|
|
73
|
+
MiddlewareSpec_ extends MiddlewareSpec.AnyMiddlewareSpec,
|
|
74
|
+
FieldsType,
|
|
75
|
+
>(
|
|
76
|
+
spec: MiddlewareSpec_ & TakesOptions<MiddlewareSpec_>,
|
|
77
|
+
options: (
|
|
78
|
+
info: Info<FieldsType>,
|
|
79
|
+
) => MiddlewareSpec.Options<NoInfer<MiddlewareSpec_>>,
|
|
80
|
+
): Attachment<MiddlewareSpec_, FieldsType> => ({ spec, options });
|
package/src/Ref.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type * as MiddlewareAttachment from "./MiddlewareAttachment";
|
|
1
|
+
import type * as MiddlewareAttachment from "./MiddlewareAttachment.js";
|
|
2
2
|
import type {
|
|
3
3
|
DefaultFunctionArgs,
|
|
4
4
|
FunctionReference as ConvexFunctionReference,
|
|
@@ -14,11 +14,11 @@ import * as Match from "effect/Match";
|
|
|
14
14
|
import * as Option from "effect/Option";
|
|
15
15
|
import * as Predicate from "effect/Predicate";
|
|
16
16
|
import * as Schema from "effect/Schema";
|
|
17
|
-
import type * as FunctionProvenance from "./FunctionProvenance";
|
|
18
|
-
import type * as FunctionSpec from "./FunctionSpec";
|
|
19
|
-
import * as Lazy from "./Lazy";
|
|
20
|
-
import * as MiddlewareSpec from "./MiddlewareSpec";
|
|
21
|
-
import type * as RuntimeAndFunctionType from "./RuntimeAndFunctionType";
|
|
17
|
+
import type * as FunctionProvenance from "./FunctionProvenance.js";
|
|
18
|
+
import type * as FunctionSpec from "./FunctionSpec.js";
|
|
19
|
+
import * as Lazy from "./Lazy.js";
|
|
20
|
+
import * as MiddlewareSpec from "./MiddlewareSpec.js";
|
|
21
|
+
import type * as RuntimeAndFunctionType from "./RuntimeAndFunctionType.js";
|
|
22
22
|
|
|
23
23
|
export const TypeId = "~@confect/core/Ref";
|
|
24
24
|
export type TypeId = typeof TypeId;
|
package/src/Refs.ts
CHANGED
|
@@ -2,11 +2,11 @@ import type { Types } from "effect";
|
|
|
2
2
|
import { pipe } from "effect/Function";
|
|
3
3
|
import * as Option from "effect/Option";
|
|
4
4
|
import * as Record from "effect/Record";
|
|
5
|
-
import type * as FunctionSpec from "./FunctionSpec";
|
|
6
|
-
import type * as GroupSpec from "./GroupSpec";
|
|
7
|
-
import type * as MiddlewareSpec from "./MiddlewareSpec";
|
|
8
|
-
import * as Ref from "./Ref";
|
|
9
|
-
import * as Spec from "./Spec";
|
|
5
|
+
import type * as FunctionSpec from "./FunctionSpec.js";
|
|
6
|
+
import type * as GroupSpec from "./GroupSpec.js";
|
|
7
|
+
import type * as MiddlewareSpec from "./MiddlewareSpec.js";
|
|
8
|
+
import * as Ref from "./Ref.js";
|
|
9
|
+
import * as Spec from "./Spec.js";
|
|
10
10
|
|
|
11
11
|
export type Refs<
|
|
12
12
|
Spec_ extends Spec.AnyWithProps,
|
package/src/SchemaToValidator.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as IdScope from "./IdScope";
|
|
1
|
+
import * as IdScope from "./IdScope.js";
|
|
2
2
|
import type {
|
|
3
3
|
GenericId as ConvexGenericId,
|
|
4
4
|
PropertyValidators,
|
|
@@ -30,7 +30,7 @@ import * as Schema from "effect/Schema";
|
|
|
30
30
|
import * as SchemaAST from "effect/SchemaAST";
|
|
31
31
|
import * as String from "effect/String";
|
|
32
32
|
|
|
33
|
-
import * as GenericId from "./GenericId";
|
|
33
|
+
import * as GenericId from "./GenericId.js";
|
|
34
34
|
import type {
|
|
35
35
|
IsAny,
|
|
36
36
|
IsOptional,
|
|
@@ -39,7 +39,7 @@ import type {
|
|
|
39
39
|
IsUnion,
|
|
40
40
|
TypeError,
|
|
41
41
|
UnionToTuple,
|
|
42
|
-
} from "./Types";
|
|
42
|
+
} from "./Types.js";
|
|
43
43
|
|
|
44
44
|
// Args
|
|
45
45
|
|
package/src/Spec.ts
CHANGED
package/src/SystemFields.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type * as IdScope from "./IdScope";
|
|
1
|
+
import type * as IdScope from "./IdScope.js";
|
|
2
2
|
import type { SystemFields as NonIdSystemFields } from "convex/server";
|
|
3
3
|
import { pipe } from "effect/Function";
|
|
4
4
|
import * as Array from "effect/Array";
|
|
@@ -11,7 +11,7 @@ import * as SchemaAST from "effect/SchemaAST";
|
|
|
11
11
|
import * as SchemaGetter from "effect/SchemaGetter";
|
|
12
12
|
import * as SchemaTransformation from "effect/SchemaTransformation";
|
|
13
13
|
import * as Struct from "effect/Struct";
|
|
14
|
-
import * as GenericId from "./GenericId";
|
|
14
|
+
import * as GenericId from "./GenericId.js";
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
17
|
* Produces a schema for Convex system fields. In Confect, system fields include
|
package/src/Table.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import * as IdScope from "./IdScope";
|
|
2
|
-
import * as Lazy from "./Lazy";
|
|
3
|
-
import * as SystemFields from "./SystemFields";
|
|
4
|
-
import type { TableSchemaToTableValidator } from "./SchemaToValidator";
|
|
1
|
+
import * as IdScope from "./IdScope.js";
|
|
2
|
+
import * as Lazy from "./Lazy.js";
|
|
3
|
+
import * as SystemFields from "./SystemFields.js";
|
|
4
|
+
import type { TableSchemaToTableValidator } from "./SchemaToValidator.js";
|
|
5
5
|
import type {
|
|
6
6
|
SystemFields as ConvexSystemFields,
|
|
7
7
|
Expand,
|
package/src/index.ts
CHANGED
|
@@ -1,29 +1,30 @@
|
|
|
1
|
-
export * as Callback from "./Callback";
|
|
2
|
-
export * as FunctionProvenance from "./FunctionProvenance";
|
|
3
|
-
export * as FunctionSpec from "./FunctionSpec";
|
|
4
|
-
export * as GenericId from "./GenericId";
|
|
5
|
-
export * as App from "./App";
|
|
6
|
-
export * as Auth from "./Auth";
|
|
7
|
-
export * as Component from "./Component";
|
|
8
|
-
export * as Env from "./Env";
|
|
9
|
-
export * as Http from "./Http";
|
|
10
|
-
export * as IdScope from "./IdScope";
|
|
11
|
-
export * as GroupPath from "./GroupPath";
|
|
12
|
-
export * as GroupSpec from "./GroupSpec";
|
|
13
|
-
export * as Identifier from "./Identifier";
|
|
14
|
-
export * as Lazy from "./Lazy";
|
|
15
|
-
export * as Manifest from "./Manifest";
|
|
16
|
-
export * as MiddlewareAttachment from "./MiddlewareAttachment";
|
|
17
|
-
export * as MiddlewareSpec from "./MiddlewareSpec";
|
|
18
|
-
export * as PaginationError from "./PaginationError";
|
|
19
|
-
export * as PaginationOptions from "./PaginationOptions";
|
|
20
|
-
export * as PaginationResult from "./PaginationResult";
|
|
21
|
-
export * as
|
|
22
|
-
export * as
|
|
23
|
-
export * as
|
|
24
|
-
export * as
|
|
25
|
-
export * as
|
|
26
|
-
export * as
|
|
27
|
-
export * as
|
|
28
|
-
export * as
|
|
29
|
-
export * as
|
|
1
|
+
export * as Callback from "./Callback.js";
|
|
2
|
+
export * as FunctionProvenance from "./FunctionProvenance.js";
|
|
3
|
+
export * as FunctionSpec from "./FunctionSpec.js";
|
|
4
|
+
export * as GenericId from "./GenericId.js";
|
|
5
|
+
export * as App from "./App.js";
|
|
6
|
+
export * as Auth from "./Auth.js";
|
|
7
|
+
export * as Component from "./Component.js";
|
|
8
|
+
export * as Env from "./Env.js";
|
|
9
|
+
export * as Http from "./Http.js";
|
|
10
|
+
export * as IdScope from "./IdScope.js";
|
|
11
|
+
export * as GroupPath from "./GroupPath.js";
|
|
12
|
+
export * as GroupSpec from "./GroupSpec.js";
|
|
13
|
+
export * as Identifier from "./Identifier.js";
|
|
14
|
+
export * as Lazy from "./Lazy.js";
|
|
15
|
+
export * as Manifest from "./Manifest.js";
|
|
16
|
+
export * as MiddlewareAttachment from "./MiddlewareAttachment.js";
|
|
17
|
+
export * as MiddlewareSpec from "./MiddlewareSpec.js";
|
|
18
|
+
export * as PaginationError from "./PaginationError.js";
|
|
19
|
+
export * as PaginationOptions from "./PaginationOptions.js";
|
|
20
|
+
export * as PaginationResult from "./PaginationResult.js";
|
|
21
|
+
export * as Profile from "./Profile.js";
|
|
22
|
+
export * as Ref from "./Ref.js";
|
|
23
|
+
export * as Refs from "./Refs.js";
|
|
24
|
+
export * as RuntimeAndFunctionType from "./RuntimeAndFunctionType.js";
|
|
25
|
+
export * as SchemaToValidator from "./SchemaToValidator.js";
|
|
26
|
+
export * as Spec from "./Spec.js";
|
|
27
|
+
export * as SystemFields from "./SystemFields.js";
|
|
28
|
+
export * as Table from "./Table.js";
|
|
29
|
+
export * as Types from "./Types.js";
|
|
30
|
+
export * as UserIdentity from "./UserIdentity.js";
|