@confect/core 9.0.0-next.0 → 9.0.0-next.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +268 -4
- package/dist/FunctionProvenance.d.ts +101 -95
- package/dist/FunctionProvenance.d.ts.map +1 -1
- package/dist/FunctionProvenance.js +25 -6
- package/dist/FunctionProvenance.js.map +1 -1
- package/dist/FunctionSpec.d.ts +178 -218
- package/dist/FunctionSpec.d.ts.map +1 -1
- package/dist/FunctionSpec.js +2 -2
- package/dist/FunctionSpec.js.map +1 -1
- package/dist/GenericId.d.ts +7 -12
- package/dist/GenericId.d.ts.map +1 -1
- package/dist/GenericId.js +2 -1
- package/dist/GenericId.js.map +1 -1
- package/dist/GroupPath.d.ts +10 -16
- package/dist/GroupPath.d.ts.map +1 -1
- package/dist/GroupSpec.d.ts +38 -37
- package/dist/GroupSpec.d.ts.map +1 -1
- package/dist/GroupSpec.js +9 -3
- package/dist/GroupSpec.js.map +1 -1
- package/dist/Identifier.d.ts +14 -0
- package/dist/Identifier.d.ts.map +1 -0
- package/dist/{internal/utils.js → Identifier.js} +26 -3
- package/dist/Identifier.js.map +1 -0
- package/dist/Lazy.d.ts +22 -0
- package/dist/Lazy.d.ts.map +1 -0
- package/dist/Lazy.js +44 -0
- package/dist/Lazy.js.map +1 -0
- package/dist/PaginationResult.d.ts +11 -18
- package/dist/PaginationResult.d.ts.map +1 -1
- package/dist/PaginationResult.js +1 -1
- package/dist/PaginationResult.js.map +1 -1
- package/dist/Ref.d.ts +55 -51
- package/dist/Ref.d.ts.map +1 -1
- package/dist/Ref.js +17 -6
- package/dist/Ref.js.map +1 -1
- package/dist/Refs.d.ts +21 -21
- package/dist/Refs.d.ts.map +1 -1
- package/dist/Refs.js +5 -10
- package/dist/Refs.js.map +1 -1
- package/dist/Registry.d.ts +7 -11
- package/dist/Registry.d.ts.map +1 -1
- package/dist/Registry.js +2 -1
- package/dist/Registry.js.map +1 -1
- package/dist/RuntimeAndFunctionType.d.ts +36 -41
- package/dist/RuntimeAndFunctionType.d.ts.map +1 -1
- package/dist/Spec.d.ts +23 -32
- package/dist/Spec.d.ts.map +1 -1
- package/dist/Spec.js +9 -48
- package/dist/Spec.js.map +1 -1
- package/dist/SystemFields.d.ts +10 -16
- package/dist/SystemFields.d.ts.map +1 -1
- package/dist/SystemFields.js +1 -1
- package/dist/SystemFields.js.map +1 -1
- package/dist/Types.d.ts +27 -27
- package/dist/Types.d.ts.map +1 -1
- package/dist/UserIdentity.d.ts +56 -63
- package/dist/UserIdentity.d.ts.map +1 -1
- package/dist/UserIdentity.js +1 -1
- package/dist/UserIdentity.js.map +1 -1
- package/dist/index.d.ts +17 -15
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3 -1
- package/dist/tsconfig.src.tsbuildinfo +1 -0
- package/package.json +37 -46
- package/src/FunctionProvenance.ts +32 -10
- package/src/FunctionSpec.ts +5 -5
- package/src/GenericId.ts +3 -1
- package/src/GroupSpec.ts +16 -11
- package/src/{internal/utils.ts → Identifier.ts} +34 -0
- package/src/Lazy.ts +40 -0
- package/src/PaginationResult.ts +1 -1
- package/src/Ref.ts +23 -8
- package/src/Refs.ts +13 -44
- package/src/Registry.ts +2 -1
- package/src/Spec.ts +18 -81
- package/src/SystemFields.ts +1 -1
- package/src/UserIdentity.ts +1 -1
- package/src/index.ts +2 -0
- package/dist/internal/utils.d.ts +0 -5
- package/dist/internal/utils.d.ts.map +0 -1
- package/dist/internal/utils.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RuntimeAndFunctionType.d.ts","
|
|
1
|
+
{"version":3,"file":"RuntimeAndFunctionType.d.ts","sourceRoot":"","sources":["../src/RuntimeAndFunctionType.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,sBAAsB,GAC9B;IAAE,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC;IAAC,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAA;CAA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AAc,CAAC;AAEnD,eAAO,MAAM,YAAY;;;CAA2B,CAAC;AACrD,MAAM,MAAM,YAAY,GAAG,OAAO,YAAY,CAAC;AAE/C,eAAO,MAAM,UAAU;;;CAAyB,CAAC;AACjD,MAAM,MAAM,UAAU,GAAG,OAAO,UAAU,CAAC"}
|
package/dist/Spec.d.ts
CHANGED
|
@@ -1,36 +1,27 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import * as GroupSpec from "./GroupSpec";
|
|
2
|
+
export declare const TypeId = "@confect/core/Spec";
|
|
3
|
+
export type TypeId = typeof TypeId;
|
|
4
|
+
export declare const isSpec: (u: unknown) => u is AnyWithProps;
|
|
5
|
+
/**
|
|
6
|
+
* A Confect spec: a flat container of function groups. Groups may be of any
|
|
7
|
+
* runtime — a group built with `GroupSpec.makeNode()` (a Node action group) sits
|
|
8
|
+
* alongside `GroupSpec.make()` groups in the same namespace. The runtime of a
|
|
9
|
+
* group lives on the group itself (`GroupSpec.runtime`) and on each function's
|
|
10
|
+
* `RuntimeAndFunctionType`; the spec does not carry a runtime of its own.
|
|
11
|
+
*/
|
|
12
|
+
export interface Spec<Groups_ extends GroupSpec.AnyWithProps = never> {
|
|
13
|
+
readonly [TypeId]: TypeId;
|
|
14
|
+
readonly groups: {
|
|
15
|
+
[GroupName in GroupSpec.Name<Groups_>]: GroupSpec.WithName<Groups_, GroupName>;
|
|
16
|
+
};
|
|
17
|
+
add<Group extends GroupSpec.AnyWithProps>(group: Group): Spec<Groups_ | Group>;
|
|
18
|
+
addAt<const Name extends string, Group extends GroupSpec.AnyWithProps>(name: Name, group: Group): Spec<Groups_ | GroupSpec.NamedAt<Group, Name>>;
|
|
7
19
|
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
declare const isSpec: (u: unknown) => u is AnyWithProps;
|
|
11
|
-
declare const isConvexSpec: (u: unknown) => u is AnyWithPropsWithRuntime<"Convex">;
|
|
12
|
-
declare const isNodeSpec: (u: unknown) => u is AnyWithPropsWithRuntime<"Node">;
|
|
13
|
-
interface Spec<Runtime$1 extends Runtime, Groups_ extends AnyWithPropsWithRuntime$1<Runtime$1> = never> {
|
|
14
|
-
readonly [TypeId]: TypeId;
|
|
15
|
-
readonly runtime: Runtime$1;
|
|
16
|
-
readonly groups: { [GroupName in Name<Groups_>]: WithName<Groups_, GroupName> };
|
|
17
|
-
add<Group extends AnyWithPropsWithRuntime$1<Runtime$1>>(group: Group): Spec<Runtime$1, Groups_ | Group>;
|
|
18
|
-
addAt<const Name$1 extends string, Group extends AnyWithPropsWithRuntime$1<Runtime$1>>(name: Name$1, group: Group): Spec<Runtime$1, Groups_ | NamedAt<Group, Name$1>>;
|
|
20
|
+
export interface Any {
|
|
21
|
+
readonly [TypeId]: TypeId;
|
|
19
22
|
}
|
|
20
|
-
interface
|
|
21
|
-
readonly [TypeId]: TypeId;
|
|
23
|
+
export interface AnyWithProps extends Spec<GroupSpec.AnyWithProps> {
|
|
22
24
|
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
type Groups<Spec_ extends AnyWithProps> = Spec_["groups"][keyof Spec_["groups"]];
|
|
26
|
-
declare const make: () => Spec<"Convex">;
|
|
27
|
-
declare const makeNode: () => Spec<"Node">;
|
|
28
|
-
/**
|
|
29
|
-
* Merges a Convex spec with an optional Node spec for use with `Api.make`.
|
|
30
|
-
* When `nodeSpec` is provided, its groups are merged under a "node" namespace,
|
|
31
|
-
* mirroring the structure used by `Refs.make`.
|
|
32
|
-
*/
|
|
33
|
-
declare const merge: <ConvexSpec extends AnyWithPropsWithRuntime<"Convex">, NodeSpec extends AnyWithPropsWithRuntime<"Node">>(convexSpec: ConvexSpec, nodeSpec?: NodeSpec) => AnyWithProps;
|
|
34
|
-
//#endregion
|
|
35
|
-
export { Any, AnyWithProps, AnyWithPropsWithRuntime, Groups, Spec, Spec_d_exports, TypeId, isConvexSpec, isNodeSpec, isSpec, make, makeNode, merge };
|
|
25
|
+
export type Groups<Spec_ extends AnyWithProps> = Spec_["groups"][keyof Spec_["groups"]];
|
|
26
|
+
export declare const make: () => Spec;
|
|
36
27
|
//# sourceMappingURL=Spec.d.ts.map
|
package/dist/Spec.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Spec.d.ts","
|
|
1
|
+
{"version":3,"file":"Spec.d.ts","sourceRoot":"","sources":["../src/Spec.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,SAAS,MAAM,aAAa,CAAC;AAEzC,eAAO,MAAM,MAAM,uBAAuB,CAAC;AAC3C,MAAM,MAAM,MAAM,GAAG,OAAO,MAAM,CAAC;AAEnC,eAAO,MAAM,MAAM,GAAI,GAAG,OAAO,KAAG,CAAC,IAAI,YACP,CAAC;AAEnC;;;;;;GAMG;AACH,MAAM,WAAW,IAAI,CAAC,OAAO,SAAS,SAAS,CAAC,YAAY,GAAG,KAAK;IAClE,QAAQ,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,MAAM,EAAE;SACd,SAAS,IAAI,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,SAAS,CAAC,QAAQ,CACxD,OAAO,EACP,SAAS,CACV;KACF,CAAC;IAEF,GAAG,CAAC,KAAK,SAAS,SAAS,CAAC,YAAY,EACtC,KAAK,EAAE,KAAK,GACX,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC,CAAC;IAEzB,KAAK,CAAC,KAAK,CAAC,IAAI,SAAS,MAAM,EAAE,KAAK,SAAS,SAAS,CAAC,YAAY,EACnE,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,KAAK,GACX,IAAI,CAAC,OAAO,GAAG,SAAS,CAAC,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC;CACnD;AAED,MAAM,WAAW,GAAG;IAClB,QAAQ,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,MAAM,WAAW,YAAa,SAAQ,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC;CAAG;AAErE,MAAM,MAAM,MAAM,CAAC,KAAK,SAAS,YAAY,IAC3C,KAAK,CAAC,QAAQ,CAAC,CAAC,MAAM,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC;AA+BzC,eAAO,MAAM,IAAI,QAAO,IAAiC,CAAC"}
|
package/dist/Spec.js
CHANGED
|
@@ -1,67 +1,28 @@
|
|
|
1
1
|
import { __exportAll } from "./_virtual/_rolldown/runtime.js";
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
2
|
+
import { withName } from "./GroupSpec.js";
|
|
3
|
+
import * as Predicate from "effect/Predicate";
|
|
4
|
+
import * as Record from "effect/Record";
|
|
4
5
|
|
|
5
6
|
//#region src/Spec.ts
|
|
6
7
|
var Spec_exports = /* @__PURE__ */ __exportAll({
|
|
7
8
|
TypeId: () => TypeId,
|
|
8
|
-
isConvexSpec: () => isConvexSpec,
|
|
9
|
-
isNodeSpec: () => isNodeSpec,
|
|
10
9
|
isSpec: () => isSpec,
|
|
11
|
-
make: () => make
|
|
12
|
-
makeNode: () => makeNode,
|
|
13
|
-
merge: () => merge
|
|
10
|
+
make: () => make
|
|
14
11
|
});
|
|
15
12
|
const TypeId = "@confect/core/Spec";
|
|
16
13
|
const isSpec = (u) => Predicate.hasProperty(u, TypeId);
|
|
17
|
-
const isConvexSpec = (u) => Predicate.hasProperty(u, TypeId) && Predicate.hasProperty(u, "runtime") && u.runtime === "Convex";
|
|
18
|
-
const isNodeSpec = (u) => Predicate.hasProperty(u, TypeId) && Predicate.hasProperty(u, "runtime") && u.runtime === "Node";
|
|
19
14
|
const Proto = {
|
|
20
15
|
[TypeId]: TypeId,
|
|
21
16
|
add(group) {
|
|
22
|
-
return makeProto({
|
|
23
|
-
runtime: this.runtime,
|
|
24
|
-
groups: Record.set(this.groups, group.name, group)
|
|
25
|
-
});
|
|
17
|
+
return makeProto({ groups: Record.set(this.groups, group.name, group) });
|
|
26
18
|
},
|
|
27
19
|
addAt(name, group) {
|
|
28
|
-
return makeProto({
|
|
29
|
-
runtime: this.runtime,
|
|
30
|
-
groups: Record.set(this.groups, name, withName(name, group))
|
|
31
|
-
});
|
|
20
|
+
return makeProto({ groups: Record.set(this.groups, name, withName(name, group)) });
|
|
32
21
|
}
|
|
33
22
|
};
|
|
34
|
-
const makeProto = ({
|
|
35
|
-
|
|
36
|
-
groups
|
|
37
|
-
});
|
|
38
|
-
const make = () => makeProto({
|
|
39
|
-
runtime: "Convex",
|
|
40
|
-
groups: {}
|
|
41
|
-
});
|
|
42
|
-
const makeNode = () => makeProto({
|
|
43
|
-
runtime: "Node",
|
|
44
|
-
groups: {}
|
|
45
|
-
});
|
|
46
|
-
/**
|
|
47
|
-
* Merges a Convex spec with an optional Node spec for use with `Api.make`.
|
|
48
|
-
* When `nodeSpec` is provided, its groups are merged under a "node" namespace,
|
|
49
|
-
* mirroring the structure used by `Refs.make`.
|
|
50
|
-
*/
|
|
51
|
-
const merge = (convexSpec, nodeSpec) => {
|
|
52
|
-
const groups = Option.fromNullable(nodeSpec).pipe(Option.map((nodeSpec_) => Array.reduce(Record.toEntries(nodeSpec_.groups), makeNodeAt("node"), (nodeGroupSpec, [name, group]) => nodeGroupSpec.addGroupAt(name, group))), Option.match({
|
|
53
|
-
onNone: () => convexSpec.groups,
|
|
54
|
-
onSome: (nodeGroup) => ({
|
|
55
|
-
...convexSpec.groups,
|
|
56
|
-
node: nodeGroup
|
|
57
|
-
})
|
|
58
|
-
}));
|
|
59
|
-
return Object.assign(Object.create(Proto), {
|
|
60
|
-
runtime: "Convex",
|
|
61
|
-
groups
|
|
62
|
-
});
|
|
63
|
-
};
|
|
23
|
+
const makeProto = ({ groups }) => Object.assign(Object.create(Proto), { groups });
|
|
24
|
+
const make = () => makeProto({ groups: {} });
|
|
64
25
|
|
|
65
26
|
//#endregion
|
|
66
|
-
export { Spec_exports, TypeId,
|
|
27
|
+
export { Spec_exports, TypeId, isSpec, make };
|
|
67
28
|
//# sourceMappingURL=Spec.js.map
|
package/dist/Spec.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Spec.js","names":["GroupSpec.withName"
|
|
1
|
+
{"version":3,"file":"Spec.js","names":["GroupSpec.withName"],"sources":["../src/Spec.ts"],"sourcesContent":["import * as Predicate from \"effect/Predicate\";\nimport * as Record from \"effect/Record\";\nimport * as GroupSpec from \"./GroupSpec\";\n\nexport const TypeId = \"@confect/core/Spec\";\nexport type TypeId = typeof TypeId;\n\nexport const isSpec = (u: unknown): u is AnyWithProps =>\n Predicate.hasProperty(u, TypeId);\n\n/**\n * A Confect spec: a flat container of function groups. Groups may be of any\n * runtime — a group built with `GroupSpec.makeNode()` (a Node action group) sits\n * alongside `GroupSpec.make()` groups in the same namespace. The runtime of a\n * group lives on the group itself (`GroupSpec.runtime`) and on each function's\n * `RuntimeAndFunctionType`; the spec does not carry a runtime of its own.\n */\nexport interface Spec<Groups_ extends GroupSpec.AnyWithProps = never> {\n readonly [TypeId]: TypeId;\n readonly groups: {\n [GroupName in GroupSpec.Name<Groups_>]: GroupSpec.WithName<\n Groups_,\n GroupName\n >;\n };\n\n add<Group extends GroupSpec.AnyWithProps>(\n group: Group,\n ): Spec<Groups_ | Group>;\n\n addAt<const Name extends string, Group extends GroupSpec.AnyWithProps>(\n name: Name,\n group: Group,\n ): Spec<Groups_ | GroupSpec.NamedAt<Group, Name>>;\n}\n\nexport interface Any {\n readonly [TypeId]: TypeId;\n}\n\nexport interface AnyWithProps extends Spec<GroupSpec.AnyWithProps> {}\n\nexport type Groups<Spec_ extends AnyWithProps> =\n Spec_[\"groups\"][keyof Spec_[\"groups\"]];\n\nconst Proto = {\n [TypeId]: TypeId,\n\n add<Group extends GroupSpec.AnyWithProps>(this: AnyWithProps, group: Group) {\n return makeProto({\n groups: Record.set(this.groups, group.name, group),\n });\n },\n\n addAt<Group extends GroupSpec.AnyWithProps>(\n this: AnyWithProps,\n name: string,\n group: Group,\n ) {\n return makeProto({\n groups: Record.set(this.groups, name, GroupSpec.withName(name, group)),\n });\n },\n};\n\nconst makeProto = <Groups_ extends GroupSpec.AnyWithProps>({\n groups,\n}: {\n groups: Record.ReadonlyRecord<string, Groups_>;\n}): Spec<Groups_> =>\n Object.assign(Object.create(Proto), {\n groups,\n });\n\nexport const make = (): Spec => makeProto({ groups: {} });\n"],"mappings":";;;;;;;;;;;AAIA,MAAa,SAAS;AAGtB,MAAa,UAAU,MACrB,UAAU,YAAY,GAAG,OAAO;AAqClC,MAAM,QAAQ;EACX,SAAS;CAEV,IAA8D,OAAc;AAC1E,SAAO,UAAU,EACf,QAAQ,OAAO,IAAI,KAAK,QAAQ,MAAM,MAAM,MAAM,EACnD,CAAC;;CAGJ,MAEE,MACA,OACA;AACA,SAAO,UAAU,EACf,QAAQ,OAAO,IAAI,KAAK,QAAQ,MAAMA,SAAmB,MAAM,MAAM,CAAC,EACvE,CAAC;;CAEL;AAED,MAAM,aAAqD,EACzD,aAIA,OAAO,OAAO,OAAO,OAAO,MAAM,EAAE,EAClC,QACD,CAAC;AAEJ,MAAa,aAAmB,UAAU,EAAE,QAAQ,EAAE,EAAE,CAAC"}
|
package/dist/SystemFields.d.ts
CHANGED
|
@@ -1,28 +1,22 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
//#region src/SystemFields.d.ts
|
|
6
|
-
declare namespace SystemFields_d_exports {
|
|
7
|
-
export { ExtendWithSystemFields, SystemFields, WithSystemFields, extendWithSystemFields };
|
|
8
|
-
}
|
|
1
|
+
import type { Expand, IdField, SystemFields as NonIdSystemFields } from "convex/server";
|
|
2
|
+
import * as Schema from "effect/Schema";
|
|
3
|
+
import * as GenericId from "./GenericId";
|
|
9
4
|
type SystemFieldsSchema<TableName extends string> = Schema.Struct<{
|
|
10
|
-
|
|
11
|
-
|
|
5
|
+
_id: Schema.Schema<GenericId.GenericId<TableName>, GenericId.GenericId<TableName>, never>;
|
|
6
|
+
_creationTime: typeof Schema.Number;
|
|
12
7
|
}>;
|
|
13
8
|
/**
|
|
14
9
|
* Produces a schema for Convex system fields.
|
|
15
10
|
*/
|
|
16
|
-
declare const SystemFields: <TableName extends string>(tableName: TableName) => SystemFieldsSchema<TableName>;
|
|
11
|
+
export declare const SystemFields: <TableName extends string>(tableName: TableName) => SystemFieldsSchema<TableName>;
|
|
17
12
|
/**
|
|
18
13
|
* Extend a table schema with Convex system fields.
|
|
19
14
|
*/
|
|
20
|
-
declare const extendWithSystemFields: <TableName extends string, TableSchema extends Schema.Schema.AnyNoContext>(tableName: TableName, schema: TableSchema) => ExtendWithSystemFields<TableName, TableSchema>;
|
|
15
|
+
export declare const extendWithSystemFields: <TableName extends string, TableSchema extends Schema.Schema.AnyNoContext>(tableName: TableName, schema: TableSchema) => ExtendWithSystemFields<TableName, TableSchema>;
|
|
21
16
|
/**
|
|
22
17
|
* Extend a table schema with Convex system fields at the type level.
|
|
23
18
|
*/
|
|
24
|
-
type ExtendWithSystemFields<TableName extends string, TableSchema extends Schema.Schema.AnyNoContext> = Schema.extend<SystemFieldsSchema<TableName>, TableSchema>;
|
|
25
|
-
type WithSystemFields<TableName extends string, Document> = Expand<Readonly<IdField<TableName>> & Readonly<
|
|
26
|
-
|
|
27
|
-
export { ExtendWithSystemFields, SystemFields, SystemFields_d_exports, WithSystemFields, extendWithSystemFields };
|
|
19
|
+
export type ExtendWithSystemFields<TableName extends string, TableSchema extends Schema.Schema.AnyNoContext> = Schema.extend<SystemFieldsSchema<TableName>, TableSchema>;
|
|
20
|
+
export type WithSystemFields<TableName extends string, Document> = Expand<Readonly<IdField<TableName>> & Readonly<NonIdSystemFields> & Document>;
|
|
21
|
+
export {};
|
|
28
22
|
//# sourceMappingURL=SystemFields.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SystemFields.d.ts","
|
|
1
|
+
{"version":3,"file":"SystemFields.d.ts","sourceRoot":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1,6 @@
|
|
|
1
1
|
import { __exportAll } from "./_virtual/_rolldown/runtime.js";
|
|
2
2
|
import { GenericId } from "./GenericId.js";
|
|
3
|
-
import
|
|
3
|
+
import * as Schema from "effect/Schema";
|
|
4
4
|
|
|
5
5
|
//#region src/SystemFields.ts
|
|
6
6
|
var SystemFields_exports = /* @__PURE__ */ __exportAll({
|
package/dist/SystemFields.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SystemFields.js","names":["GenericId.GenericId"],"sources":["../src/SystemFields.ts"],"sourcesContent":["import type {\n Expand,\n IdField,\n SystemFields as NonIdSystemFields,\n} from \"convex/server\";\nimport
|
|
1
|
+
{"version":3,"file":"SystemFields.js","names":["GenericId.GenericId"],"sources":["../src/SystemFields.ts"],"sourcesContent":["import type {\n Expand,\n IdField,\n SystemFields as NonIdSystemFields,\n} from \"convex/server\";\nimport * as Schema from \"effect/Schema\";\nimport * as GenericId from \"./GenericId\";\n\ntype SystemFieldsSchema<TableName extends string> = Schema.Struct<{\n _id: Schema.Schema<\n GenericId.GenericId<TableName>,\n GenericId.GenericId<TableName>,\n never\n >;\n _creationTime: typeof Schema.Number;\n}>;\n\n/**\n * Produces a schema for Convex system fields.\n */\nexport const SystemFields = <TableName extends string>(\n tableName: TableName,\n): SystemFieldsSchema<TableName> =>\n Schema.Struct({\n _id: GenericId.GenericId(tableName),\n _creationTime: Schema.Number,\n });\n\n/**\n * Extend a table schema with Convex system fields.\n */\nexport const extendWithSystemFields = <\n TableName extends string,\n TableSchema extends Schema.Schema.AnyNoContext,\n>(\n tableName: TableName,\n schema: TableSchema,\n): ExtendWithSystemFields<TableName, TableSchema> =>\n Schema.extend(SystemFields(tableName), schema);\n\n/**\n * Extend a table schema with Convex system fields at the type level.\n */\nexport type ExtendWithSystemFields<\n TableName extends string,\n TableSchema extends Schema.Schema.AnyNoContext,\n> = Schema.extend<SystemFieldsSchema<TableName>, TableSchema>;\n\nexport type WithSystemFields<TableName extends string, Document> = Expand<\n Readonly<IdField<TableName>> & Readonly<NonIdSystemFields> & Document\n>;\n"],"mappings":";;;;;;;;;;;;AAoBA,MAAa,gBACX,cAEA,OAAO,OAAO;CACZ,KAAKA,UAAoB,UAAU;CACnC,eAAe,OAAO;CACvB,CAAC;;;;AAKJ,MAAa,0BAIX,WACA,WAEA,OAAO,OAAO,aAAa,UAAU,EAAE,OAAO"}
|
package/dist/Types.d.ts
CHANGED
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}
|
|
9
|
-
type IsOptional<T, K extends keyof T> = {} extends Pick<T, K> ? true : false;
|
|
10
|
-
type IsAny<T> = 0 extends 1 & T ? true : false;
|
|
11
|
-
type IsUnion<T, U extends T = T> = T extends unknown ? [U] extends [T] ? false : true : never;
|
|
12
|
-
type IsValueLiteral<Vl> = [Vl] extends [never] ? never : IsUnion<Vl> extends true ? false : [Vl] extends [string | number | bigint | boolean] ? [string] extends [Vl] ? false : [number] extends [Vl] ? false : [boolean] extends [Vl] ? false : [bigint] extends [Vl] ? false : true : false;
|
|
1
|
+
import type { DocumentByName, FieldTypeFromFieldPath, GenericDatabaseReader, GenericDataModel, TableNamesInDataModel } from "convex/server";
|
|
2
|
+
import type { GenericId } from "convex/values";
|
|
3
|
+
import type { Brand } from "effect";
|
|
4
|
+
export type IsOptional<T, K extends keyof T> = {} extends Pick<T, K> ? true : false;
|
|
5
|
+
export type IsAny<T> = 0 extends 1 & T ? true : false;
|
|
6
|
+
export type IsUnion<T, U extends T = T> = T extends unknown ? [U] extends [T] ? false : true : never;
|
|
7
|
+
export type IsValueLiteral<Vl> = [Vl] extends [never] ? never : IsUnion<Vl> extends true ? false : [Vl] extends [string | number | bigint | boolean] ? [string] extends [Vl] ? false : [number] extends [Vl] ? false : [boolean] extends [Vl] ? false : [bigint] extends [Vl] ? false : true : false;
|
|
13
8
|
/**
|
|
14
9
|
* Only checks for records with string keys.
|
|
15
10
|
*/
|
|
16
|
-
type IsRecord<T> = [T] extends [never] ? false : IsUnion<T> extends true ? false : T extends Record<string, infer V> ? string extends keyof T ? keyof T extends string ? T extends Record<string, V> ? Record<string, V> extends T ? true : false : false : false : false : false;
|
|
17
|
-
type DeepMutable<T> = IsAny<T> extends true ? any : T extends NonRecursiveLeaf ? T : T extends ReadonlyMap<infer K, infer V> ? Map<DeepMutable<K>, DeepMutable<V>> : T extends ReadonlySet<infer V> ? Set<DeepMutable<V>> : [keyof T] extends [never] ? T : {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
type
|
|
11
|
+
export type IsRecord<T> = [T] extends [never] ? false : IsUnion<T> extends true ? false : T extends Record<string, infer V> ? string extends keyof T ? keyof T extends string ? T extends Record<string, V> ? Record<string, V> extends T ? true : false : false : false : false : false;
|
|
12
|
+
export type DeepMutable<T> = IsAny<T> extends true ? any : T extends NonRecursiveLeaf ? T : T extends ReadonlyMap<infer K, infer V> ? Map<DeepMutable<K>, DeepMutable<V>> : T extends ReadonlySet<infer V> ? Set<DeepMutable<V>> : [keyof T] extends [never] ? T : {
|
|
13
|
+
-readonly [K in keyof T]: DeepMutable<T[K]>;
|
|
14
|
+
};
|
|
15
|
+
export type TypeError<Message extends string, T = never> = [Message, T];
|
|
16
|
+
export type TypeDefect<Message extends string, T = never> = [Message, T];
|
|
17
|
+
export type IsRecursive<T> = true extends DetectCycle<T> ? true : false;
|
|
21
18
|
type NonRecursiveLeaf = Brand.Brand<any> | GenericId<any> | ArrayBuffer;
|
|
22
|
-
type DetectCycle<T, Cache extends any[] = []> = IsAny<T> extends true ? false : [T] extends [any] ? T extends NonRecursiveLeaf ? false : T extends Cache[number] ? true : T extends Array<infer U> ? DetectCycle<U, [...Cache, T]> : T extends Map<infer _U, infer V> ? DetectCycle<V, [...Cache, T]> : T extends Set<infer U> ? DetectCycle<U, [...Cache, T]> : T extends object ? true extends {
|
|
23
|
-
|
|
19
|
+
type DetectCycle<T, Cache extends any[] = []> = IsAny<T> extends true ? false : [T] extends [any] ? T extends NonRecursiveLeaf ? false : T extends Cache[number] ? true : T extends Array<infer U> ? DetectCycle<U, [...Cache, T]> : T extends Map<infer _U, infer V> ? DetectCycle<V, [...Cache, T]> : T extends Set<infer U> ? DetectCycle<U, [...Cache, T]> : T extends object ? true extends {
|
|
20
|
+
[K in keyof T]: DetectCycle<T[K], [...Cache, T]>;
|
|
21
|
+
}[keyof T] ? true : false : false : never;
|
|
22
|
+
export type UnionToTuple<t> = _unionToTuple<t, []> extends infer result ? conform<result, t[]> : never;
|
|
24
23
|
type _unionToTuple<t, result extends unknown[]> = getLastBranch<t> extends infer current ? [t] extends [never] ? result : _unionToTuple<Exclude<t, current>, [current, ...result]> : never;
|
|
25
|
-
type getLastBranch<t> = intersectUnion<t extends unknown ? (x: t) => void : never> extends (
|
|
26
|
-
type intersectUnion<t> = (t extends unknown ? (_: t) => void : never) extends (
|
|
24
|
+
type getLastBranch<t> = intersectUnion<t extends unknown ? (x: t) => void : never> extends (x: infer branch) => void ? branch : never;
|
|
25
|
+
type intersectUnion<t> = (t extends unknown ? (_: t) => void : never) extends (_: infer intersection) => void ? intersection : never;
|
|
27
26
|
type conform<t, base> = t extends base ? t : base;
|
|
28
|
-
type IndexFieldTypesForEq<ConvexDataModel extends GenericDataModel, Table extends TableNamesInDataModel<ConvexDataModel>, T extends string[]> = T extends readonly [...infer Rest, any] ? Rest extends readonly string[] ? {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
27
|
+
export type IndexFieldTypesForEq<ConvexDataModel extends GenericDataModel, Table extends TableNamesInDataModel<ConvexDataModel>, T extends string[]> = T extends readonly [...infer Rest, any] ? Rest extends readonly string[] ? {
|
|
28
|
+
[K in keyof Rest]: FieldTypeFromFieldPath<DocumentByName<ConvexDataModel, Table>, Rest[K]>;
|
|
29
|
+
} : never : never;
|
|
30
|
+
export type BaseDatabaseReader<DataModel extends GenericDataModel> = {
|
|
31
|
+
get: GenericDatabaseReader<DataModel>["get"];
|
|
32
|
+
query: GenericDatabaseReader<DataModel>["query"];
|
|
32
33
|
};
|
|
33
|
-
|
|
34
|
-
export { BaseDatabaseReader, DeepMutable, IndexFieldTypesForEq, IsAny, IsOptional, IsRecord, IsRecursive, IsUnion, IsValueLiteral, TypeDefect, TypeError, Types_d_exports, UnionToTuple };
|
|
34
|
+
export {};
|
|
35
35
|
//# sourceMappingURL=Types.d.ts.map
|
package/dist/Types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Types.d.ts","
|
|
1
|
+
{"version":3,"file":"Types.d.ts","sourceRoot":"","sources":["../src/Types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,sBAAsB,EACtB,qBAAqB,EACrB,gBAAgB,EAChB,qBAAqB,EACtB,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAEpC,MAAM,MAAM,UAAU,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,IACzC,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,IAAI,GAAG,KAAK,CAAC;AAEvC,MAAM,MAAM,KAAK,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,IAAI,GAAG,KAAK,CAAC;AAEtD,MAAM,MAAM,OAAO,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,OAAO,GACvD,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,GACb,KAAK,GACL,IAAI,GACN,KAAK,CAAC;AAGV,MAAM,MAAM,cAAc,CAAC,EAAE,IAAI,CAAC,EAAE,CAAC,SAAS,CAAC,KAAK,CAAC,GACjD,KAAK,GACL,OAAO,CAAC,EAAE,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
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
exact: true;
|
|
58
|
-
}>;
|
|
59
|
-
updatedAt: Schema.optionalWith<typeof Schema.String, {
|
|
60
|
-
exact: true;
|
|
61
|
-
}>;
|
|
1
|
+
import * as Schema from "effect/Schema";
|
|
2
|
+
export declare const UserIdentity: <CustomClaimsFields extends Schema.Struct.Fields>(customClaimsFields: CustomClaimsFields) => Schema.Struct<CustomClaimsFields & {
|
|
3
|
+
tokenIdentifier: typeof Schema.String;
|
|
4
|
+
subject: typeof Schema.String;
|
|
5
|
+
issuer: typeof Schema.String;
|
|
6
|
+
name: Schema.optionalWith<typeof Schema.String, {
|
|
7
|
+
exact: true;
|
|
8
|
+
}>;
|
|
9
|
+
givenName: Schema.optionalWith<typeof Schema.String, {
|
|
10
|
+
exact: true;
|
|
11
|
+
}>;
|
|
12
|
+
familyName: Schema.optionalWith<typeof Schema.String, {
|
|
13
|
+
exact: true;
|
|
14
|
+
}>;
|
|
15
|
+
nickname: Schema.optionalWith<typeof Schema.String, {
|
|
16
|
+
exact: true;
|
|
17
|
+
}>;
|
|
18
|
+
preferredUsername: Schema.optionalWith<typeof Schema.String, {
|
|
19
|
+
exact: true;
|
|
20
|
+
}>;
|
|
21
|
+
profileUrl: Schema.optionalWith<typeof Schema.String, {
|
|
22
|
+
exact: true;
|
|
23
|
+
}>;
|
|
24
|
+
pictureUrl: Schema.optionalWith<typeof Schema.String, {
|
|
25
|
+
exact: true;
|
|
26
|
+
}>;
|
|
27
|
+
email: Schema.optionalWith<typeof Schema.String, {
|
|
28
|
+
exact: true;
|
|
29
|
+
}>;
|
|
30
|
+
emailVerified: Schema.optionalWith<typeof Schema.Boolean, {
|
|
31
|
+
exact: true;
|
|
32
|
+
}>;
|
|
33
|
+
gender: Schema.optionalWith<typeof Schema.String, {
|
|
34
|
+
exact: true;
|
|
35
|
+
}>;
|
|
36
|
+
birthday: Schema.optionalWith<typeof Schema.String, {
|
|
37
|
+
exact: true;
|
|
38
|
+
}>;
|
|
39
|
+
timezone: Schema.optionalWith<typeof Schema.String, {
|
|
40
|
+
exact: true;
|
|
41
|
+
}>;
|
|
42
|
+
language: Schema.optionalWith<typeof Schema.String, {
|
|
43
|
+
exact: true;
|
|
44
|
+
}>;
|
|
45
|
+
phoneNumber: Schema.optionalWith<typeof Schema.String, {
|
|
46
|
+
exact: true;
|
|
47
|
+
}>;
|
|
48
|
+
phoneNumberVerified: Schema.optionalWith<typeof Schema.Boolean, {
|
|
49
|
+
exact: true;
|
|
50
|
+
}>;
|
|
51
|
+
address: Schema.optionalWith<typeof Schema.String, {
|
|
52
|
+
exact: true;
|
|
53
|
+
}>;
|
|
54
|
+
updatedAt: Schema.optionalWith<typeof Schema.String, {
|
|
55
|
+
exact: true;
|
|
56
|
+
}>;
|
|
62
57
|
}>;
|
|
63
|
-
//#endregion
|
|
64
|
-
export { UserIdentity, UserIdentity_d_exports };
|
|
65
58
|
//# sourceMappingURL=UserIdentity.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserIdentity.d.ts","
|
|
1
|
+
{"version":3,"file":"UserIdentity.d.ts","sourceRoot":"","sources":["../src/UserIdentity.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,eAAO,MAAM,YAAY,GAAI,kBAAkB,SAAS,MAAM,CAAC,MAAM,CAAC,MAAM,EAC1E,oBAAoB,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwBpC,CAAC"}
|
package/dist/UserIdentity.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __exportAll } from "./_virtual/_rolldown/runtime.js";
|
|
2
|
-
import
|
|
2
|
+
import * as Schema from "effect/Schema";
|
|
3
3
|
|
|
4
4
|
//#region src/UserIdentity.ts
|
|
5
5
|
var UserIdentity_exports = /* @__PURE__ */ __exportAll({ UserIdentity: () => UserIdentity });
|
package/dist/UserIdentity.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserIdentity.js","names":[],"sources":["../src/UserIdentity.ts"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"UserIdentity.js","names":[],"sources":["../src/UserIdentity.ts"],"sourcesContent":["import * as Schema from \"effect/Schema\";\n\nexport const UserIdentity = <CustomClaimsFields extends Schema.Struct.Fields>(\n customClaimsFields: CustomClaimsFields,\n) =>\n Schema.Struct({\n ...customClaimsFields,\n tokenIdentifier: Schema.String,\n subject: Schema.String,\n issuer: Schema.String,\n name: Schema.optionalWith(Schema.String, { exact: true }),\n givenName: Schema.optionalWith(Schema.String, { exact: true }),\n familyName: Schema.optionalWith(Schema.String, { exact: true }),\n nickname: Schema.optionalWith(Schema.String, { exact: true }),\n preferredUsername: Schema.optionalWith(Schema.String, { exact: true }),\n profileUrl: Schema.optionalWith(Schema.String, { exact: true }),\n pictureUrl: Schema.optionalWith(Schema.String, { exact: true }),\n email: Schema.optionalWith(Schema.String, { exact: true }),\n emailVerified: Schema.optionalWith(Schema.Boolean, { exact: true }),\n gender: Schema.optionalWith(Schema.String, { exact: true }),\n birthday: Schema.optionalWith(Schema.String, { exact: true }),\n timezone: Schema.optionalWith(Schema.String, { exact: true }),\n language: Schema.optionalWith(Schema.String, { exact: true }),\n phoneNumber: Schema.optionalWith(Schema.String, { exact: true }),\n phoneNumberVerified: Schema.optionalWith(Schema.Boolean, { exact: true }),\n address: Schema.optionalWith(Schema.String, { exact: true }),\n updatedAt: Schema.optionalWith(Schema.String, { exact: true }),\n });\n"],"mappings":";;;;;AAEA,MAAa,gBACX,uBAEA,OAAO,OAAO;CACZ,GAAG;CACH,iBAAiB,OAAO;CACxB,SAAS,OAAO;CAChB,QAAQ,OAAO;CACf,MAAM,OAAO,aAAa,OAAO,QAAQ,EAAE,OAAO,MAAM,CAAC;CACzD,WAA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
export
|
|
1
|
+
export * as FunctionProvenance from "./FunctionProvenance";
|
|
2
|
+
export * as FunctionSpec from "./FunctionSpec";
|
|
3
|
+
export * as GenericId from "./GenericId";
|
|
4
|
+
export * as GroupPath from "./GroupPath";
|
|
5
|
+
export * as GroupSpec from "./GroupSpec";
|
|
6
|
+
export * as Identifier from "./Identifier";
|
|
7
|
+
export * as Lazy from "./Lazy";
|
|
8
|
+
export * as PaginationResult from "./PaginationResult";
|
|
9
|
+
export * as Ref from "./Ref";
|
|
10
|
+
export * as Refs from "./Refs";
|
|
11
|
+
export * as Registry from "./Registry";
|
|
12
|
+
export * as RuntimeAndFunctionType from "./RuntimeAndFunctionType";
|
|
13
|
+
export * as Spec from "./Spec";
|
|
14
|
+
export * as SystemFields from "./SystemFields";
|
|
15
|
+
export * as Types from "./Types";
|
|
16
|
+
export * as UserIdentity from "./UserIdentity";
|
|
17
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,kBAAkB,MAAM,sBAAsB,CAAC;AAC3D,OAAO,KAAK,YAAY,MAAM,gBAAgB,CAAC;AAC/C,OAAO,KAAK,SAAS,MAAM,aAAa,CAAC;AACzC,OAAO,KAAK,SAAS,MAAM,aAAa,CAAC;AACzC,OAAO,KAAK,SAAS,MAAM,aAAa,CAAC;AACzC,OAAO,KAAK,UAAU,MAAM,cAAc,CAAC;AAC3C,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAC/B,OAAO,KAAK,gBAAgB,MAAM,oBAAoB,CAAC;AACvD,OAAO,KAAK,GAAG,MAAM,OAAO,CAAC;AAC7B,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAC/B,OAAO,KAAK,QAAQ,MAAM,YAAY,CAAC;AACvC,OAAO,KAAK,sBAAsB,MAAM,0BAA0B,CAAC;AACnE,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAC/B,OAAO,KAAK,YAAY,MAAM,gBAAgB,CAAC;AAC/C,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AACjC,OAAO,KAAK,YAAY,MAAM,gBAAgB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { Lazy_exports } from "./Lazy.js";
|
|
1
2
|
import { FunctionProvenance_exports } from "./FunctionProvenance.js";
|
|
3
|
+
import { Identifier_exports } from "./Identifier.js";
|
|
2
4
|
import { RuntimeAndFunctionType_exports } from "./RuntimeAndFunctionType.js";
|
|
3
5
|
import { FunctionSpec_exports } from "./FunctionSpec.js";
|
|
4
6
|
import { GenericId_exports } from "./GenericId.js";
|
|
@@ -13,4 +15,4 @@ import { SystemFields_exports } from "./SystemFields.js";
|
|
|
13
15
|
import { Types_exports } from "./Types.js";
|
|
14
16
|
import { UserIdentity_exports } from "./UserIdentity.js";
|
|
15
17
|
|
|
16
|
-
export { FunctionProvenance_exports as FunctionProvenance, FunctionSpec_exports as FunctionSpec, GenericId_exports as GenericId, GroupPath_exports as GroupPath, GroupSpec_exports as GroupSpec, PaginationResult_exports as PaginationResult, Ref_exports as Ref, Refs_exports as Refs, Registry_exports as Registry, RuntimeAndFunctionType_exports as RuntimeAndFunctionType, Spec_exports as Spec, SystemFields_exports as SystemFields, Types_exports as Types, UserIdentity_exports as UserIdentity };
|
|
18
|
+
export { FunctionProvenance_exports as FunctionProvenance, FunctionSpec_exports as FunctionSpec, GenericId_exports as GenericId, GroupPath_exports as GroupPath, GroupSpec_exports as GroupSpec, Identifier_exports as Identifier, Lazy_exports as Lazy, PaginationResult_exports as PaginationResult, Ref_exports as Ref, Refs_exports as Refs, Registry_exports as Registry, RuntimeAndFunctionType_exports as RuntimeAndFunctionType, Spec_exports as Spec, SystemFields_exports as SystemFields, Types_exports as Types, UserIdentity_exports as UserIdentity };
|