@confect/server 9.0.0-next.5 → 9.0.0-next.6
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 +156 -0
- package/dist/Auth.d.ts +1 -1
- package/dist/DatabaseReader.d.ts +4299 -26
- package/dist/DatabaseReader.d.ts.map +1 -1
- package/dist/DatabaseReader.js +5 -6
- package/dist/DatabaseReader.js.map +1 -1
- package/dist/DatabaseSchema.d.ts +25 -112
- package/dist/DatabaseSchema.d.ts.map +1 -1
- package/dist/DatabaseSchema.js +20 -30
- package/dist/DatabaseSchema.js.map +1 -1
- package/dist/DatabaseWriter.d.ts +4 -4
- package/dist/DatabaseWriter.d.ts.map +1 -1
- package/dist/DatabaseWriter.js +3 -4
- package/dist/DatabaseWriter.js.map +1 -1
- package/dist/FunctionImpl.d.ts +26 -17
- package/dist/FunctionImpl.d.ts.map +1 -1
- package/dist/FunctionImpl.js +22 -14
- package/dist/FunctionImpl.js.map +1 -1
- package/dist/GroupImpl.d.ts +22 -13
- package/dist/GroupImpl.d.ts.map +1 -1
- package/dist/GroupImpl.js +34 -35
- package/dist/GroupImpl.js.map +1 -1
- package/dist/Handler.d.ts +1 -1
- package/dist/QueryInitializer.d.ts +1 -1
- package/dist/QueryInitializer.d.ts.map +1 -1
- package/dist/QueryInitializer.js.map +1 -1
- package/dist/RegisteredConvexFunction.d.ts +1084 -17
- package/dist/RegisteredConvexFunction.d.ts.map +1 -1
- package/dist/RegisteredConvexFunction.js +4 -4
- package/dist/RegisteredConvexFunction.js.map +1 -1
- package/dist/RegisteredFunction.d.ts +3 -3
- package/dist/RegisteredFunction.d.ts.map +1 -1
- package/dist/RegisteredFunctions.d.ts +36 -12
- package/dist/RegisteredFunctions.d.ts.map +1 -1
- package/dist/RegisteredFunctions.js +21 -9
- package/dist/RegisteredFunctions.js.map +1 -1
- package/dist/RegisteredNodeFunction.d.ts +4 -4
- package/dist/RegisteredNodeFunction.d.ts.map +1 -1
- package/dist/RegisteredNodeFunction.js +2 -2
- package/dist/RegisteredNodeFunction.js.map +1 -1
- package/dist/StorageActionWriter.d.ts +1 -1
- package/dist/Table.d.ts +35 -27
- package/dist/Table.d.ts.map +1 -1
- package/dist/Table.js +69 -60
- package/dist/Table.js.map +1 -1
- package/dist/index.d.ts +4 -5
- package/dist/index.js +4 -5
- package/package.json +51 -52
- package/src/DatabaseReader.ts +17 -21
- package/src/DatabaseSchema.ts +38 -98
- package/src/DatabaseWriter.ts +8 -5
- package/src/FunctionImpl.ts +33 -43
- package/src/GroupImpl.ts +45 -69
- package/src/QueryInitializer.ts +10 -2
- package/src/RegisteredConvexFunction.ts +5 -6
- package/src/RegisteredFunctions.ts +67 -93
- package/src/RegisteredNodeFunction.ts +3 -4
- package/src/Table.ts +251 -131
- package/src/index.ts +0 -1
- package/dist/Api.d.ts +0 -43
- package/dist/Api.d.ts.map +0 -1
- package/dist/Api.js +0 -43
- package/dist/Api.js.map +0 -1
- package/src/Api.ts +0 -102
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DatabaseReader.d.ts","names":[],"sources":["../src/DatabaseReader.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"DatabaseReader.d.ts","names":[],"sources":["../src/DatabaseReader.ts"],"mappings":";;;;;;;;;;;;;;;;;;;cAQa,IAAA,2BAAgC,YAAA,EAC3C,cAAA,EAAgB,eAAA,EAChB,oBAAA,EAAsB,qBAAA,CACpB,QAAA,CAAmB,UAAA,CAAqB,eAAA;kCAOR,IAAA,CAAU,MAAA,CAAA,eAAA,IAAA,YAAA,GAAgB,SAAA,EAC7C,SAAA;IAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAuCf,cAAA,yBACc,YAAA,IACtB,UAAA,QAAkB,cAAA,CAAe,eAAA;AAAA,cAExB,KAAA,2BAAiC,YAAA,EAC5C,cAAA,EAAgB,eAAA,EAChB,oBAAA,EAAsB,qBAAA,CACpB,QAAA,CAAmB,UAAA,CAAqB,eAAA,QACzC,KAAA,CAAA,KAAA;kCA/CwB,IAAA,CAAA,MAAA,CAAA,eAAA,0CAAA,SAAA,EAAA,SAAA;IAAA"}
|
package/dist/DatabaseReader.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { __exportAll } from "./_virtual/_rolldown/runtime.js";
|
|
2
|
-
import { systemTables } from "./Table.js";
|
|
3
|
-
import { extendWithSystemTables } from "./DatabaseSchema.js";
|
|
4
2
|
import { make as make$1 } from "./QueryInitializer.js";
|
|
5
|
-
import {
|
|
3
|
+
import { systemTables } from "./Table.js";
|
|
4
|
+
import { Context, Layer } from "effect";
|
|
6
5
|
|
|
7
6
|
//#region src/DatabaseReader.ts
|
|
8
7
|
var DatabaseReader_exports = /* @__PURE__ */ __exportAll({
|
|
@@ -11,16 +10,16 @@ var DatabaseReader_exports = /* @__PURE__ */ __exportAll({
|
|
|
11
10
|
make: () => make
|
|
12
11
|
});
|
|
13
12
|
const make = (databaseSchema, convexDatabaseReader) => {
|
|
14
|
-
const extendedTables = extendWithSystemTables(databaseSchema.tables);
|
|
15
13
|
return { table: (tableName) => {
|
|
16
|
-
const
|
|
17
|
-
const baseDatabaseReader =
|
|
14
|
+
const isSystem = Object.hasOwn(systemTables, tableName);
|
|
15
|
+
const baseDatabaseReader = isSystem ? {
|
|
18
16
|
get: convexDatabaseReader.system.get,
|
|
19
17
|
query: convexDatabaseReader.system.query
|
|
20
18
|
} : {
|
|
21
19
|
get: convexDatabaseReader.get,
|
|
22
20
|
query: convexDatabaseReader.query
|
|
23
21
|
};
|
|
22
|
+
const table = isSystem ? systemTables[tableName] : databaseSchema.tables[tableName];
|
|
24
23
|
return make$1(tableName, baseDatabaseReader, table);
|
|
25
24
|
} };
|
|
26
25
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DatabaseReader.js","names":["
|
|
1
|
+
{"version":3,"file":"DatabaseReader.js","names":["Table.systemTables","QueryInitializer.make"],"sources":["../src/DatabaseReader.ts"],"sourcesContent":["import type { GenericDatabaseReader } from \"convex/server\";\nimport { Context, Layer } from \"effect\";\nimport type { BaseDatabaseReader } from \"@confect/core/Types\";\nimport type * as DatabaseSchema from \"./DatabaseSchema\";\nimport type * as DataModel from \"./DataModel\";\nimport * as QueryInitializer from \"./QueryInitializer\";\nimport * as Table from \"./Table\";\n\nexport const make = <DatabaseSchema_ extends DatabaseSchema.AnyWithProps>(\n databaseSchema: DatabaseSchema_,\n convexDatabaseReader: GenericDatabaseReader<\n DataModel.ToConvex<DataModel.FromSchema<DatabaseSchema_>>\n >,\n) => {\n type Tables = DatabaseSchema.Tables<DatabaseSchema_>;\n type IncludedTables = Tables | Table.SystemTables;\n\n return {\n table: <const TableName extends Table.Name<IncludedTables>>(\n tableName: TableName,\n ) => {\n const isSystem = Object.hasOwn(Table.systemTables, tableName);\n\n const baseDatabaseReader: BaseDatabaseReader<any> = isSystem\n ? {\n get: convexDatabaseReader.system.get,\n query: convexDatabaseReader.system.query,\n }\n : {\n get: convexDatabaseReader.get,\n query: convexDatabaseReader.query,\n };\n\n const table = (\n isSystem\n ? (Table.systemTables as Record<string, Table.AnyWithProps>)[\n tableName\n ]\n : databaseSchema.tables[tableName]\n ) as Table.WithName<IncludedTables, TableName>;\n\n return QueryInitializer.make<IncludedTables, TableName>(\n tableName,\n baseDatabaseReader,\n table,\n );\n },\n };\n};\n\nexport const DatabaseReader = <\n DatabaseSchema_ extends DatabaseSchema.AnyWithProps,\n>() =>\n Context.GenericTag<ReturnType<typeof make<DatabaseSchema_>>>(\n \"@confect/server/DatabaseReader\",\n );\n\nexport type DatabaseReader<\n DatabaseSchema_ extends DatabaseSchema.AnyWithProps,\n> = ReturnType<typeof DatabaseReader<DatabaseSchema_>>[\"Identifier\"];\n\nexport const layer = <DatabaseSchema_ extends DatabaseSchema.AnyWithProps>(\n databaseSchema: DatabaseSchema_,\n convexDatabaseReader: GenericDatabaseReader<\n DataModel.ToConvex<DataModel.FromSchema<DatabaseSchema_>>\n >,\n) =>\n Layer.succeed(\n DatabaseReader<DatabaseSchema_>(),\n make(databaseSchema, convexDatabaseReader),\n );\n"],"mappings":";;;;;;;;;;;AAQA,MAAa,QACX,gBACA,yBAGG;AAIH,QAAO,EACL,QACE,cACG;EACH,MAAM,WAAW,OAAO,OAAOA,cAAoB,UAAU;EAE7D,MAAM,qBAA8C,WAChD;GACE,KAAK,qBAAqB,OAAO;GACjC,OAAO,qBAAqB,OAAO;GACpC,GACD;GACE,KAAK,qBAAqB;GAC1B,OAAO,qBAAqB;GAC7B;EAEL,MAAM,QACJ,WACKA,aACC,aAEF,eAAe,OAAO;AAG5B,SAAOC,OACL,WACA,oBACA,MACD;IAEJ;;AAGH,MAAa,uBAGX,QAAQ,WACN,iCACD;AAMH,MAAa,SACX,gBACA,yBAIA,MAAM,QACJ,gBAAiC,EACjC,KAAK,gBAAgB,qBAAqB,CAC3C"}
|
package/dist/DatabaseSchema.d.ts
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
import { AnyWithProps as AnyWithProps$1, Name,
|
|
2
|
-
import { Expand, GenericSchema, SchemaDefinition } from "convex/server";
|
|
3
|
-
import * as convex_values0 from "convex/values";
|
|
4
|
-
import * as effect_Schema0 from "effect/Schema";
|
|
1
|
+
import { AnyWithProps as AnyWithProps$1, Name, WithName } from "./Table.js";
|
|
5
2
|
|
|
6
3
|
//#region src/DatabaseSchema.d.ts
|
|
7
4
|
declare namespace DatabaseSchema_d_exports {
|
|
8
|
-
export { Any, AnyWithProps,
|
|
5
|
+
export { Any, AnyWithProps, DatabaseSchema, TableNames, TableWithName, Tables, TypeId, isDatabaseSchema, make };
|
|
9
6
|
}
|
|
10
7
|
declare const TypeId = "@confect/server/DatabaseSchema";
|
|
11
8
|
type TypeId = typeof TypeId;
|
|
@@ -14,126 +11,42 @@ interface Any {
|
|
|
14
11
|
}
|
|
15
12
|
declare const isDatabaseSchema: (u: unknown) => u is Any;
|
|
16
13
|
/**
|
|
17
|
-
* A schema definition
|
|
14
|
+
* A schema definition holding a record of bound `Table`s keyed by table
|
|
15
|
+
* name. Codegen emits a single static `DatabaseSchema.make({ ... })` call;
|
|
16
|
+
* laziness now lives entirely on each `Table` (its `Fields`, `Doc`, and
|
|
17
|
+
* `tableDefinition` are lazy memoised getters), so this layer is a plain
|
|
18
|
+
* record indirection with no module-loading or async machinery.
|
|
18
19
|
*/
|
|
19
20
|
interface DatabaseSchema<Tables_ extends AnyWithProps$1 = never> {
|
|
20
21
|
readonly [TypeId]: TypeId;
|
|
21
|
-
readonly tables:
|
|
22
|
-
readonly convexSchemaDefinition: SchemaDefinition<ConvexDatabaseSchemaFromTables<Tables_>, true>;
|
|
23
|
-
/**
|
|
24
|
-
* Add a table definition to the schema.
|
|
25
|
-
*/
|
|
26
|
-
addTable<TableDef extends AnyWithProps$1>(table: TableDef): DatabaseSchema<Tables_ | TableDef>;
|
|
22
|
+
readonly tables: { readonly [TableName in Name<Tables_>]: WithName<Tables_, TableName> };
|
|
27
23
|
}
|
|
28
24
|
interface AnyWithProps {
|
|
29
25
|
readonly [TypeId]: TypeId;
|
|
30
26
|
readonly tables: Record<string, AnyWithProps$1>;
|
|
31
|
-
readonly convexSchemaDefinition: SchemaDefinition<GenericSchema, true>;
|
|
32
|
-
addTable<TableDef extends AnyWithProps$1>(table: TableDef): AnyWithProps;
|
|
33
27
|
}
|
|
34
28
|
type Tables<DatabaseSchema_ extends AnyWithProps> = DatabaseSchema_ extends DatabaseSchema<infer Tables_> ? Tables_ : never;
|
|
35
29
|
type TableNames<DatabaseSchema_ extends AnyWithProps> = Name<Tables<DatabaseSchema_>> & string;
|
|
36
30
|
type TableWithName<DatabaseSchema_ extends AnyWithProps, TableName extends TableNames<DatabaseSchema_>> = Extract<Tables<DatabaseSchema_>, {
|
|
37
|
-
readonly
|
|
31
|
+
readonly tableName: TableName;
|
|
38
32
|
}>;
|
|
39
33
|
/**
|
|
40
|
-
*
|
|
34
|
+
* Construct a `DatabaseSchema` from a record of bound `Table`s. The empty
|
|
35
|
+
* case is `DatabaseSchema.make({})`. The `Tables_` union is inferred from
|
|
36
|
+
* the value record's values, so codegen-emitted calls of the form
|
|
37
|
+
* `DatabaseSchema.make({ notes, tags, users })` do not need an explicit
|
|
38
|
+
* type argument.
|
|
39
|
+
*
|
|
40
|
+
* Invariant: each record **key must equal its value's `tableName`**. The
|
|
41
|
+
* record is stored verbatim and later read by key (`databaseSchema.tables[
|
|
42
|
+
* tableName]` in `DatabaseReader`/`DatabaseWriter`), so a key that diverges
|
|
43
|
+
* from the bound table's name would make those lookups silently miss. The
|
|
44
|
+
* type signature does not enforce this — codegen upholds it by deriving both
|
|
45
|
+
* the key and the table name from the same filename (and the shorthand
|
|
46
|
+
* `{ notes, tags, users }` form it emits makes them identical by
|
|
47
|
+
* construction). Hand-written calls must preserve it.
|
|
41
48
|
*/
|
|
42
|
-
declare const make: () => DatabaseSchema<
|
|
43
|
-
type ConvexDatabaseSchemaFromTables<Tables_ extends AnyWithProps$1> = Expand<{ [TableName in Name<Tables_> & string]: WithName<Tables_, TableName>["tableDefinition"] }>;
|
|
44
|
-
declare const systemSchema: DatabaseSchema<Table<"_scheduled_functions", effect_Schema0.Struct<{
|
|
45
|
-
name: typeof effect_Schema0.String;
|
|
46
|
-
args: effect_Schema0.Array$<typeof effect_Schema0.Any>;
|
|
47
|
-
scheduledTime: typeof effect_Schema0.Number;
|
|
48
|
-
completedTime: effect_Schema0.optionalWith<typeof effect_Schema0.Number, {
|
|
49
|
-
exact: true;
|
|
50
|
-
}>;
|
|
51
|
-
state: effect_Schema0.Union<[effect_Schema0.Struct<{
|
|
52
|
-
kind: effect_Schema0.Literal<["pending"]>;
|
|
53
|
-
}>, effect_Schema0.Struct<{
|
|
54
|
-
kind: effect_Schema0.Literal<["inProgress"]>;
|
|
55
|
-
}>, effect_Schema0.Struct<{
|
|
56
|
-
kind: effect_Schema0.Literal<["success"]>;
|
|
57
|
-
}>, effect_Schema0.Struct<{
|
|
58
|
-
kind: effect_Schema0.Literal<["failed"]>;
|
|
59
|
-
error: typeof effect_Schema0.String;
|
|
60
|
-
}>, effect_Schema0.Struct<{
|
|
61
|
-
kind: effect_Schema0.Literal<["canceled"]>;
|
|
62
|
-
}>]>;
|
|
63
|
-
}>, convex_values0.VObject<{
|
|
64
|
-
name: string;
|
|
65
|
-
args: any[];
|
|
66
|
-
scheduledTime: number;
|
|
67
|
-
state: {
|
|
68
|
-
kind: "pending";
|
|
69
|
-
} | {
|
|
70
|
-
kind: "inProgress";
|
|
71
|
-
} | {
|
|
72
|
-
kind: "success";
|
|
73
|
-
} | {
|
|
74
|
-
kind: "failed";
|
|
75
|
-
error: string;
|
|
76
|
-
} | {
|
|
77
|
-
kind: "canceled";
|
|
78
|
-
};
|
|
79
|
-
completedTime?: number;
|
|
80
|
-
}, {
|
|
81
|
-
name: convex_values0.VString<string, "required">;
|
|
82
|
-
args: convex_values0.VArray<any[], convex_values0.VAny<any, "required", string>, "required">;
|
|
83
|
-
scheduledTime: convex_values0.VFloat64<number, "required">;
|
|
84
|
-
state: convex_values0.VUnion<{
|
|
85
|
-
kind: "pending";
|
|
86
|
-
} | {
|
|
87
|
-
kind: "inProgress";
|
|
88
|
-
} | {
|
|
89
|
-
kind: "success";
|
|
90
|
-
} | {
|
|
91
|
-
kind: "failed";
|
|
92
|
-
error: string;
|
|
93
|
-
} | {
|
|
94
|
-
kind: "canceled";
|
|
95
|
-
}, [convex_values0.VObject<{
|
|
96
|
-
kind: "pending";
|
|
97
|
-
}, {
|
|
98
|
-
kind: convex_values0.VLiteral<"pending", "required">;
|
|
99
|
-
}, "required", "kind">, convex_values0.VObject<{
|
|
100
|
-
kind: "inProgress";
|
|
101
|
-
}, {
|
|
102
|
-
kind: convex_values0.VLiteral<"inProgress", "required">;
|
|
103
|
-
}, "required", "kind">, convex_values0.VObject<{
|
|
104
|
-
kind: "success";
|
|
105
|
-
}, {
|
|
106
|
-
kind: convex_values0.VLiteral<"success", "required">;
|
|
107
|
-
}, "required", "kind">, convex_values0.VObject<{
|
|
108
|
-
kind: "failed";
|
|
109
|
-
error: string;
|
|
110
|
-
}, {
|
|
111
|
-
kind: convex_values0.VLiteral<"failed", "required">;
|
|
112
|
-
error: convex_values0.VString<string, "required">;
|
|
113
|
-
}, "required", "kind" | "error">, convex_values0.VObject<{
|
|
114
|
-
kind: "canceled";
|
|
115
|
-
}, {
|
|
116
|
-
kind: convex_values0.VLiteral<"canceled", "required">;
|
|
117
|
-
}, "required", "kind">], "required", "kind" | "error">;
|
|
118
|
-
completedTime: convex_values0.VFloat64<number | undefined, "optional">;
|
|
119
|
-
}, "required", "name" | "args" | "scheduledTime" | "completedTime" | "state" | "state.kind" | "state.error">, {}, {}, {}> | Table<"_storage", effect_Schema0.Struct<{
|
|
120
|
-
sha256: typeof effect_Schema0.String;
|
|
121
|
-
size: typeof effect_Schema0.Number;
|
|
122
|
-
contentType: effect_Schema0.optionalWith<typeof effect_Schema0.String, {
|
|
123
|
-
exact: true;
|
|
124
|
-
}>;
|
|
125
|
-
}>, convex_values0.VObject<{
|
|
126
|
-
sha256: string;
|
|
127
|
-
size: number;
|
|
128
|
-
contentType?: string;
|
|
129
|
-
}, {
|
|
130
|
-
sha256: convex_values0.VString<string, "required">;
|
|
131
|
-
size: convex_values0.VFloat64<number, "required">;
|
|
132
|
-
contentType: convex_values0.VString<string | undefined, "optional">;
|
|
133
|
-
}, "required", "sha256" | "size" | "contentType">, {}, {}, {}>>;
|
|
134
|
-
declare const extendWithSystemTables: <Tables_ extends AnyWithProps$1>(tables: TablesRecord<Tables_>) => ExtendWithSystemTables<Tables_>;
|
|
135
|
-
type ExtendWithSystemTables<Tables_ extends AnyWithProps$1> = TablesRecord<Tables_ | SystemTables>;
|
|
136
|
-
type IncludeSystemTables<Tables_ extends AnyWithProps$1> = Tables_ | SystemTables extends infer T ? T extends AnyWithProps$1 ? T : never : never;
|
|
49
|
+
declare const make: <const TablesRecord extends Record<string, AnyWithProps$1>>(tables: TablesRecord) => DatabaseSchema<TablesRecord[keyof TablesRecord]>;
|
|
137
50
|
//#endregion
|
|
138
|
-
export { Any, AnyWithProps,
|
|
51
|
+
export { Any, AnyWithProps, DatabaseSchema, DatabaseSchema_d_exports, TableNames, TableWithName, Tables, TypeId, isDatabaseSchema, make };
|
|
139
52
|
//# sourceMappingURL=DatabaseSchema.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DatabaseSchema.d.ts","names":[],"sources":["../src/DatabaseSchema.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"DatabaseSchema.d.ts","names":[],"sources":["../src/DatabaseSchema.ts"],"mappings":";;;;;;cAGa,MAAA;AAAA,KACD,MAAA,UAAgB,MAAA;AAAA,UAEX,GAAA;EAAA,UACL,MAAA,GAAS,MAAA;AAAA;AAAA,cAGR,gBAAA,GAAoB,CAAA,cAAa,CAAA,IAAK,GAAA;;;;;;;;UAUlC,cAAA,iBAA+B,cAAA;EAAA,UACpC,MAAA,GAAS,MAAA;EAAA,SACV,MAAA,2BACgB,IAAA,CAAW,OAAA,IAAW,QAAA,CAC3C,OAAA,EACA,SAAA;AAAA;AAAA,UAKW,YAAA;EAAA,UACL,MAAA,GAAS,MAAA;EAAA,SACV,MAAA,EAAQ,MAAA,SAAe,cAAA;AAAA;AAAA,KAGtB,MAAA,yBAA+B,YAAA,IACzC,eAAA,SAAwB,cAAA,kBAAgC,OAAA;AAAA,KAE9C,UAAA,yBAAmC,YAAA,IAAgB,IAAA,CAC7D,MAAA,CAAO,eAAA;AAAA,KAIG,aAAA,yBACc,YAAA,oBACN,UAAA,CAAW,eAAA,KAC3B,OAAA,CAAQ,MAAA,CAAO,eAAA;EAAA,SAA6B,SAAA,EAAW,SAAA;AAAA;;AApC3D;;;;;;;;;AAUA;;;;;;cA4Ca,IAAA,8BACgB,MAAA,SAAe,cAAA,GAE1C,MAAA,EAAQ,YAAA,KACP,cAAA,CAAe,YAAA,OAAmB,YAAA"}
|
package/dist/DatabaseSchema.js
CHANGED
|
@@ -1,45 +1,35 @@
|
|
|
1
1
|
import { __exportAll } from "./_virtual/_rolldown/runtime.js";
|
|
2
|
-
import {
|
|
3
|
-
import { Array, Predicate, Record, pipe } from "effect";
|
|
4
|
-
import { defineSchema } from "convex/server";
|
|
2
|
+
import { Predicate } from "effect";
|
|
5
3
|
|
|
6
4
|
//#region src/DatabaseSchema.ts
|
|
7
5
|
var DatabaseSchema_exports = /* @__PURE__ */ __exportAll({
|
|
8
6
|
TypeId: () => TypeId,
|
|
9
|
-
extendWithSystemTables: () => extendWithSystemTables,
|
|
10
7
|
isDatabaseSchema: () => isDatabaseSchema,
|
|
11
|
-
make: () => make
|
|
12
|
-
systemSchema: () => systemSchema
|
|
8
|
+
make: () => make
|
|
13
9
|
});
|
|
14
10
|
const TypeId = "@confect/server/DatabaseSchema";
|
|
15
11
|
const isDatabaseSchema = (u) => Predicate.hasProperty(u, TypeId);
|
|
16
|
-
const Proto = {
|
|
17
|
-
[TypeId]: TypeId,
|
|
18
|
-
addTable(table) {
|
|
19
|
-
const newTablesArray = [...Object.values(this.tables), table];
|
|
20
|
-
return makeProto({
|
|
21
|
-
tables: Record.set(this.tables, table.name, table),
|
|
22
|
-
convexSchemaDefinition: pipe(newTablesArray, Array.map(({ name, tableDefinition }) => [name, tableDefinition]), Record.fromEntries, defineSchema)
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
const makeProto = ({ tables, convexSchemaDefinition }) => Object.assign(Object.create(Proto), {
|
|
27
|
-
tables,
|
|
28
|
-
convexSchemaDefinition
|
|
29
|
-
});
|
|
30
12
|
/**
|
|
31
|
-
*
|
|
13
|
+
* Construct a `DatabaseSchema` from a record of bound `Table`s. The empty
|
|
14
|
+
* case is `DatabaseSchema.make({})`. The `Tables_` union is inferred from
|
|
15
|
+
* the value record's values, so codegen-emitted calls of the form
|
|
16
|
+
* `DatabaseSchema.make({ notes, tags, users })` do not need an explicit
|
|
17
|
+
* type argument.
|
|
18
|
+
*
|
|
19
|
+
* Invariant: each record **key must equal its value's `tableName`**. The
|
|
20
|
+
* record is stored verbatim and later read by key (`databaseSchema.tables[
|
|
21
|
+
* tableName]` in `DatabaseReader`/`DatabaseWriter`), so a key that diverges
|
|
22
|
+
* from the bound table's name would make those lookups silently miss. The
|
|
23
|
+
* type signature does not enforce this — codegen upholds it by deriving both
|
|
24
|
+
* the key and the table name from the same filename (and the shorthand
|
|
25
|
+
* `{ notes, tags, users }` form it emits makes them identical by
|
|
26
|
+
* construction). Hand-written calls must preserve it.
|
|
32
27
|
*/
|
|
33
|
-
const make = () =>
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
});
|
|
37
|
-
const systemSchema = make().addTable(scheduledFunctionsTable).addTable(storageTable);
|
|
38
|
-
const extendWithSystemTables = (tables) => ({
|
|
39
|
-
...tables,
|
|
40
|
-
...systemTables
|
|
28
|
+
const make = (tables) => ({
|
|
29
|
+
[TypeId]: TypeId,
|
|
30
|
+
tables
|
|
41
31
|
});
|
|
42
32
|
|
|
43
33
|
//#endregion
|
|
44
|
-
export { DatabaseSchema_exports, TypeId,
|
|
34
|
+
export { DatabaseSchema_exports, TypeId, isDatabaseSchema, make };
|
|
45
35
|
//# sourceMappingURL=DatabaseSchema.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DatabaseSchema.js","names":[
|
|
1
|
+
{"version":3,"file":"DatabaseSchema.js","names":[],"sources":["../src/DatabaseSchema.ts"],"sourcesContent":["import { Predicate } from \"effect\";\nimport type * as Table from \"./Table\";\n\nexport const TypeId = \"@confect/server/DatabaseSchema\";\nexport type TypeId = typeof TypeId;\n\nexport interface Any {\n readonly [TypeId]: TypeId;\n}\n\nexport const isDatabaseSchema = (u: unknown): u is Any =>\n Predicate.hasProperty(u, TypeId);\n\n/**\n * A schema definition holding a record of bound `Table`s keyed by table\n * name. Codegen emits a single static `DatabaseSchema.make({ ... })` call;\n * laziness now lives entirely on each `Table` (its `Fields`, `Doc`, and\n * `tableDefinition` are lazy memoised getters), so this layer is a plain\n * record indirection with no module-loading or async machinery.\n */\nexport interface DatabaseSchema<Tables_ extends Table.AnyWithProps = never> {\n readonly [TypeId]: TypeId;\n readonly tables: {\n readonly [TableName in Table.Name<Tables_>]: Table.WithName<\n Tables_,\n TableName\n >;\n };\n}\n\nexport interface AnyWithProps {\n readonly [TypeId]: TypeId;\n readonly tables: Record<string, Table.AnyWithProps>;\n}\n\nexport type Tables<DatabaseSchema_ extends AnyWithProps> =\n DatabaseSchema_ extends DatabaseSchema<infer Tables_> ? Tables_ : never;\n\nexport type TableNames<DatabaseSchema_ extends AnyWithProps> = Table.Name<\n Tables<DatabaseSchema_>\n> &\n string;\n\nexport type TableWithName<\n DatabaseSchema_ extends AnyWithProps,\n TableName extends TableNames<DatabaseSchema_>,\n> = Extract<Tables<DatabaseSchema_>, { readonly tableName: TableName }>;\n\n/**\n * Construct a `DatabaseSchema` from a record of bound `Table`s. The empty\n * case is `DatabaseSchema.make({})`. The `Tables_` union is inferred from\n * the value record's values, so codegen-emitted calls of the form\n * `DatabaseSchema.make({ notes, tags, users })` do not need an explicit\n * type argument.\n *\n * Invariant: each record **key must equal its value's `tableName`**. The\n * record is stored verbatim and later read by key (`databaseSchema.tables[\n * tableName]` in `DatabaseReader`/`DatabaseWriter`), so a key that diverges\n * from the bound table's name would make those lookups silently miss. The\n * type signature does not enforce this — codegen upholds it by deriving both\n * the key and the table name from the same filename (and the shorthand\n * `{ notes, tags, users }` form it emits makes them identical by\n * construction). Hand-written calls must preserve it.\n */\nexport const make = <\n const TablesRecord extends Record<string, Table.AnyWithProps>,\n>(\n tables: TablesRecord,\n): DatabaseSchema<TablesRecord[keyof TablesRecord]> => ({\n [TypeId]: TypeId,\n tables: tables as unknown as DatabaseSchema<\n TablesRecord[keyof TablesRecord]\n >[\"tables\"],\n});\n"],"mappings":";;;;;;;;;AAGA,MAAa,SAAS;AAOtB,MAAa,oBAAoB,MAC/B,UAAU,YAAY,GAAG,OAAO;;;;;;;;;;;;;;;;;AAqDlC,MAAa,QAGX,YACsD;EACrD,SAAS;CACF;CAGT"}
|
package/dist/DatabaseWriter.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ declare namespace DatabaseWriter_d_exports {
|
|
|
13
13
|
declare const make: <DatabaseSchema_ extends AnyWithProps>(databaseSchema: DatabaseSchema_, convexDatabaseWriter: GenericDatabaseWriter<ToConvex<FromSchema<DatabaseSchema_>>>) => {
|
|
14
14
|
table: <const TableName extends TableNames<FromSchema<DatabaseSchema_>>>(tableName: TableName) => {
|
|
15
15
|
insert: (document: WithoutSystemFields$1<DocumentByName<FromSchema<DatabaseSchema_>, TableName>>) => Effect.Effect<GenericId<TableName>, DocumentEncodeError, never>;
|
|
16
|
-
patch: (id: GenericId<TableName>, patchedValues: Partial<WithoutSystemFields<DocumentByName<FromSchema<DatabaseSchema_>, TableName>>>) => Effect.Effect<void,
|
|
16
|
+
patch: (id: GenericId<TableName>, patchedValues: Partial<WithoutSystemFields<DocumentByName<FromSchema<DatabaseSchema_>, TableName>>>) => Effect.Effect<void, DocumentDecodeError | DocumentEncodeError | GetByIdFailure, never>;
|
|
17
17
|
replace: (id: GenericId<TableName>, value: WithoutSystemFields<DocumentByName<FromSchema<DatabaseSchema_>, TableName>>) => Effect.Effect<void, DocumentEncodeError, never>;
|
|
18
18
|
delete: (id: GenericId<TableName>) => Effect.Effect<void, never, never>;
|
|
19
19
|
};
|
|
@@ -21,14 +21,14 @@ declare const make: <DatabaseSchema_ extends AnyWithProps>(databaseSchema: Datab
|
|
|
21
21
|
declare const DatabaseWriter: <DatabaseSchema_ extends AnyWithProps>() => Context.Tag<{
|
|
22
22
|
table: <const TableName extends TableNames<FromSchema<DatabaseSchema_>>>(tableName: TableName) => {
|
|
23
23
|
insert: (document: WithoutSystemFields$1<DocumentByName<FromSchema<DatabaseSchema_>, TableName>>) => Effect.Effect<GenericId<TableName>, DocumentEncodeError, never>;
|
|
24
|
-
patch: (id: GenericId<TableName>, patchedValues: Partial<Expand<BetterOmit<DocumentByName<FromSchema<DatabaseSchema_>, TableName>, "_id" | "_creationTime">>>) => Effect.Effect<void,
|
|
24
|
+
patch: (id: GenericId<TableName>, patchedValues: Partial<Expand<BetterOmit<DocumentByName<FromSchema<DatabaseSchema_>, TableName>, "_id" | "_creationTime">>>) => Effect.Effect<void, DocumentDecodeError | DocumentEncodeError | GetByIdFailure, never>;
|
|
25
25
|
replace: (id: GenericId<TableName>, value: Expand<BetterOmit<DocumentByName<FromSchema<DatabaseSchema_>, TableName>, "_id" | "_creationTime">>) => Effect.Effect<void, DocumentEncodeError, never>;
|
|
26
26
|
delete: (id: GenericId<TableName>) => Effect.Effect<void, never, never>;
|
|
27
27
|
};
|
|
28
28
|
}, {
|
|
29
29
|
table: <const TableName extends TableNames<FromSchema<DatabaseSchema_>>>(tableName: TableName) => {
|
|
30
30
|
insert: (document: WithoutSystemFields$1<DocumentByName<FromSchema<DatabaseSchema_>, TableName>>) => Effect.Effect<GenericId<TableName>, DocumentEncodeError, never>;
|
|
31
|
-
patch: (id: GenericId<TableName>, patchedValues: Partial<Expand<BetterOmit<DocumentByName<FromSchema<DatabaseSchema_>, TableName>, "_id" | "_creationTime">>>) => Effect.Effect<void,
|
|
31
|
+
patch: (id: GenericId<TableName>, patchedValues: Partial<Expand<BetterOmit<DocumentByName<FromSchema<DatabaseSchema_>, TableName>, "_id" | "_creationTime">>>) => Effect.Effect<void, DocumentDecodeError | DocumentEncodeError | GetByIdFailure, never>;
|
|
32
32
|
replace: (id: GenericId<TableName>, value: Expand<BetterOmit<DocumentByName<FromSchema<DatabaseSchema_>, TableName>, "_id" | "_creationTime">>) => Effect.Effect<void, DocumentEncodeError, never>;
|
|
33
33
|
delete: (id: GenericId<TableName>) => Effect.Effect<void, never, never>;
|
|
34
34
|
};
|
|
@@ -37,7 +37,7 @@ type DatabaseWriter<DatabaseSchema_ extends AnyWithProps> = ReturnType<typeof Da
|
|
|
37
37
|
declare const layer: <DatabaseSchema_ extends AnyWithProps>(databaseSchema: DatabaseSchema_, convexDatabaseWriter: GenericDatabaseWriter<ToConvex<FromSchema<DatabaseSchema_>>>) => Layer.Layer<{
|
|
38
38
|
table: <const TableName extends TableNames<FromSchema<DatabaseSchema_>>>(tableName: TableName) => {
|
|
39
39
|
insert: (document: WithoutSystemFields$1<DocumentByName<FromSchema<DatabaseSchema_>, TableName>>) => Effect.Effect<GenericId<TableName>, DocumentEncodeError, never>;
|
|
40
|
-
patch: (id: GenericId<TableName>, patchedValues: Partial<Expand<BetterOmit<DocumentByName<FromSchema<DatabaseSchema_>, TableName>, "_id" | "_creationTime">>>) => Effect.Effect<void,
|
|
40
|
+
patch: (id: GenericId<TableName>, patchedValues: Partial<Expand<BetterOmit<DocumentByName<FromSchema<DatabaseSchema_>, TableName>, "_id" | "_creationTime">>>) => Effect.Effect<void, DocumentDecodeError | DocumentEncodeError | GetByIdFailure, never>;
|
|
41
41
|
replace: (id: GenericId<TableName>, value: Expand<BetterOmit<DocumentByName<FromSchema<DatabaseSchema_>, TableName>, "_id" | "_creationTime">>) => Effect.Effect<void, DocumentEncodeError, never>;
|
|
42
42
|
delete: (id: GenericId<TableName>) => Effect.Effect<void, never, never>;
|
|
43
43
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DatabaseWriter.d.ts","names":[],"sources":["../src/DatabaseWriter.ts"],"mappings":";;;;;;;;;;;;cAiBa,IAAA,2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pB,QAAA,CAAmB,UAAA,CAAqB,eAAA,QACzC,KAAA,CAAA,KAAA;kCA/H6B,UAAA,CAAA,UAAA,CAAA,eAAA,IAAA,SAAA,EAAA,SAAA"}
|
package/dist/DatabaseWriter.js
CHANGED
|
@@ -10,21 +10,20 @@ var DatabaseWriter_exports = /* @__PURE__ */ __exportAll({
|
|
|
10
10
|
make: () => make
|
|
11
11
|
});
|
|
12
12
|
const make = (databaseSchema, convexDatabaseWriter) => {
|
|
13
|
-
const tables = databaseSchema.tables;
|
|
14
13
|
const table = (tableName) => {
|
|
15
|
-
const tableDef = tables[tableName];
|
|
16
|
-
const tableSchema = tableDef.Fields;
|
|
14
|
+
const tableDef = databaseSchema.tables[tableName];
|
|
17
15
|
const insert = (document) => Effect.gen(function* () {
|
|
18
16
|
const encodedDocument = yield* encode(document, tableName, tableDef.Fields);
|
|
19
17
|
return yield* Effect.promise(() => convexDatabaseWriter.insert(tableName, encodedDocument));
|
|
20
18
|
});
|
|
21
19
|
const patch = (id, patchedValues) => Effect.gen(function* () {
|
|
20
|
+
const tableSchema = tableDef.Fields;
|
|
22
21
|
const originalDecodedDoc = yield* getById(tableName, convexDatabaseWriter, tableDef)(id);
|
|
23
22
|
const updatedEncodedDoc = yield* pipe(patchedValues, Record.reduce(originalDecodedDoc, (acc, value, key) => value === void 0 ? Record.remove(acc, key) : Record.set(acc, key, value)), encode(tableName, tableSchema));
|
|
24
23
|
yield* Effect.promise(() => convexDatabaseWriter.replace(id, updatedEncodedDoc));
|
|
25
24
|
});
|
|
26
25
|
const replace = (id, value) => Effect.gen(function* () {
|
|
27
|
-
const updatedEncodedDoc = yield* encode(value, tableName,
|
|
26
|
+
const updatedEncodedDoc = yield* encode(value, tableName, tableDef.Fields);
|
|
28
27
|
yield* Effect.promise(() => convexDatabaseWriter.replace(id, updatedEncodedDoc));
|
|
29
28
|
});
|
|
30
29
|
const delete_ = (id) => Effect.promise(() => convexDatabaseWriter.delete(id));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DatabaseWriter.js","names":["Document.encode","QueryInitializer.getById"],"sources":["../src/DatabaseWriter.ts"],"sourcesContent":["import type {\n BetterOmit,\n DocumentByName,\n Expand,\n GenericDatabaseWriter,\n WithoutSystemFields,\n} from \"convex/server\";\nimport type { GenericId } from \"convex/values\";\nimport { Context, Effect, Layer, pipe, Record } from \"effect\";\nimport type * as DatabaseSchema from \"./DatabaseSchema\";\nimport type * as DataModel from \"./DataModel\";\nimport type { DocumentByName as DocumentByName_ } from \"./DataModel\";\nimport * as Document from \"./Document\";\nimport * as QueryInitializer from \"./QueryInitializer\";\nimport type * as Table from \"./Table\";\nimport type * as TableInfo from \"./TableInfo\";\n\nexport const make = <DatabaseSchema_ extends DatabaseSchema.AnyWithProps>(\n databaseSchema: DatabaseSchema_,\n convexDatabaseWriter: GenericDatabaseWriter<\n DataModel.ToConvex<DataModel.FromSchema<DatabaseSchema_>>\n >,\n) => {\n type DataModel_ = DataModel.FromSchema<DatabaseSchema_>;\n
|
|
1
|
+
{"version":3,"file":"DatabaseWriter.js","names":["Document.encode","QueryInitializer.getById"],"sources":["../src/DatabaseWriter.ts"],"sourcesContent":["import type {\n BetterOmit,\n DocumentByName,\n Expand,\n GenericDatabaseWriter,\n WithoutSystemFields,\n} from \"convex/server\";\nimport type { GenericId } from \"convex/values\";\nimport { Context, Effect, Layer, pipe, Record } from \"effect\";\nimport type * as DatabaseSchema from \"./DatabaseSchema\";\nimport type * as DataModel from \"./DataModel\";\nimport type { DocumentByName as DocumentByName_ } from \"./DataModel\";\nimport * as Document from \"./Document\";\nimport * as QueryInitializer from \"./QueryInitializer\";\nimport type * as Table from \"./Table\";\nimport type * as TableInfo from \"./TableInfo\";\n\nexport const make = <DatabaseSchema_ extends DatabaseSchema.AnyWithProps>(\n databaseSchema: DatabaseSchema_,\n convexDatabaseWriter: GenericDatabaseWriter<\n DataModel.ToConvex<DataModel.FromSchema<DatabaseSchema_>>\n >,\n) => {\n type DataModel_ = DataModel.FromSchema<DatabaseSchema_>;\n\n const table = <const TableName extends DataModel.TableNames<DataModel_>>(\n tableName: TableName,\n ) => {\n const tableDef = databaseSchema.tables[tableName] as Table.WithName<\n DatabaseSchema.Tables<DatabaseSchema_>,\n TableName\n >;\n\n const insert = (\n document: Document.WithoutSystemFields<\n DocumentByName_<DataModel_, TableName>\n >,\n ) =>\n Effect.gen(function* () {\n const encodedDocument = yield* Document.encode(\n document,\n tableName,\n tableDef.Fields,\n );\n\n const id = yield* Effect.promise(() =>\n convexDatabaseWriter.insert(\n tableName,\n encodedDocument as WithoutSystemFields<\n DocumentByName<DataModel.ToConvex<DataModel_>, TableName>\n >,\n ),\n );\n\n return id;\n });\n\n const patch = (\n id: GenericId<TableName>,\n patchedValues: Partial<\n WithoutSystemFields<DocumentByName_<DataModel_, TableName>>\n >,\n ) =>\n Effect.gen(function* () {\n const tableSchema = tableDef.Fields as TableInfo.TableSchema<\n DataModel.TableInfoWithName_<DataModel_, TableName>\n >;\n\n const originalDecodedDoc = yield* QueryInitializer.getById(\n tableName,\n convexDatabaseWriter as any,\n tableDef,\n )(id);\n\n const updatedEncodedDoc = yield* pipe(\n patchedValues,\n Record.reduce(originalDecodedDoc, (acc, value, key) =>\n value === undefined\n ? Record.remove(acc, key)\n : Record.set(acc, key, value),\n ),\n Document.encode(tableName, tableSchema),\n );\n\n yield* Effect.promise(() =>\n convexDatabaseWriter.replace(\n id,\n updatedEncodedDoc as Expand<\n BetterOmit<\n DocumentByName<DataModel.ToConvex<DataModel_>, TableName>,\n \"_creationTime\" | \"_id\"\n >\n >,\n ),\n );\n });\n\n const replace = (\n id: GenericId<TableName>,\n value: WithoutSystemFields<DocumentByName_<DataModel_, TableName>>,\n ) =>\n Effect.gen(function* () {\n const updatedEncodedDoc = yield* Document.encode(\n value,\n tableName,\n tableDef.Fields,\n );\n\n yield* Effect.promise(() =>\n convexDatabaseWriter.replace(\n id,\n updatedEncodedDoc as Expand<\n BetterOmit<\n DocumentByName<DataModel.ToConvex<DataModel_>, TableName>,\n \"_creationTime\" | \"_id\"\n >\n >,\n ),\n );\n });\n\n const delete_ = (id: GenericId<TableName>) =>\n Effect.promise(() => convexDatabaseWriter.delete(id));\n\n return {\n insert,\n patch,\n replace,\n delete: delete_,\n };\n };\n\n return {\n table,\n };\n};\n\nexport const DatabaseWriter = <\n DatabaseSchema_ extends DatabaseSchema.AnyWithProps,\n>() =>\n Context.GenericTag<ReturnType<typeof make<DatabaseSchema_>>>(\n \"@confect/server/DatabaseWriter\",\n );\n\nexport type DatabaseWriter<\n DatabaseSchema_ extends DatabaseSchema.AnyWithProps,\n> = ReturnType<typeof DatabaseWriter<DatabaseSchema_>>[\"Identifier\"];\n\nexport const layer = <DatabaseSchema_ extends DatabaseSchema.AnyWithProps>(\n databaseSchema: DatabaseSchema_,\n convexDatabaseWriter: GenericDatabaseWriter<\n DataModel.ToConvex<DataModel.FromSchema<DatabaseSchema_>>\n >,\n) =>\n Layer.succeed(\n DatabaseWriter<DatabaseSchema_>(),\n make(databaseSchema, convexDatabaseWriter),\n );\n"],"mappings":";;;;;;;;;;;AAiBA,MAAa,QACX,gBACA,yBAGG;CAGH,MAAM,SACJ,cACG;EACH,MAAM,WAAW,eAAe,OAAO;EAKvC,MAAM,UACJ,aAIA,OAAO,IAAI,aAAa;GACtB,MAAM,kBAAkB,OAAOA,OAC7B,UACA,WACA,SAAS,OACV;AAWD,UATW,OAAO,OAAO,cACvB,qBAAqB,OACnB,WACA,gBAGD,CACF;IAGD;EAEJ,MAAM,SACJ,IACA,kBAIA,OAAO,IAAI,aAAa;GACtB,MAAM,cAAc,SAAS;GAI7B,MAAM,qBAAqB,OAAOC,QAChC,WACA,sBACA,SACD,CAAC,GAAG;GAEL,MAAM,oBAAoB,OAAO,KAC/B,eACA,OAAO,OAAO,qBAAqB,KAAK,OAAO,QAC7C,UAAU,SACN,OAAO,OAAO,KAAK,IAAI,GACvB,OAAO,IAAI,KAAK,KAAK,MAAM,CAChC,EACDD,OAAgB,WAAW,YAAY,CACxC;AAED,UAAO,OAAO,cACZ,qBAAqB,QACnB,IACA,kBAMD,CACF;IACD;EAEJ,MAAM,WACJ,IACA,UAEA,OAAO,IAAI,aAAa;GACtB,MAAM,oBAAoB,OAAOA,OAC/B,OACA,WACA,SAAS,OACV;AAED,UAAO,OAAO,cACZ,qBAAqB,QACnB,IACA,kBAMD,CACF;IACD;EAEJ,MAAM,WAAW,OACf,OAAO,cAAc,qBAAqB,OAAO,GAAG,CAAC;AAEvD,SAAO;GACL;GACA;GACA;GACA,QAAQ;GACT;;AAGH,QAAO,EACL,OACD;;AAGH,MAAa,uBAGX,QAAQ,WACN,iCACD;AAMH,MAAa,SACX,gBACA,yBAIA,MAAM,QACJ,gBAAiC,EACjC,KAAK,gBAAgB,qBAAqB,CAC3C"}
|
package/dist/FunctionImpl.d.ts
CHANGED
|
@@ -1,37 +1,46 @@
|
|
|
1
|
-
import { AnyWithProps
|
|
1
|
+
import { AnyWithProps } from "./DatabaseSchema.js";
|
|
2
2
|
import { WithName } from "./Handler.js";
|
|
3
3
|
import { Context, Layer } from "effect";
|
|
4
|
-
import * as GroupSpec from "@confect/core/GroupSpec";
|
|
5
4
|
import * as FunctionSpec from "@confect/core/FunctionSpec";
|
|
5
|
+
import * as GroupSpec from "@confect/core/GroupSpec";
|
|
6
6
|
|
|
7
7
|
//#region src/FunctionImpl.d.ts
|
|
8
8
|
declare namespace FunctionImpl_d_exports {
|
|
9
|
-
export {
|
|
9
|
+
export { ForFunction, FromGroupSpec, FunctionImpl, make };
|
|
10
10
|
}
|
|
11
|
-
interface FunctionImpl<
|
|
12
|
-
readonly groupPath: GroupPath_;
|
|
11
|
+
interface FunctionImpl<FunctionName extends string> {
|
|
13
12
|
readonly functionName: FunctionName;
|
|
14
13
|
}
|
|
15
|
-
declare const FunctionImpl: <
|
|
16
|
-
groupPath,
|
|
14
|
+
declare const FunctionImpl: <FunctionName extends string>({
|
|
17
15
|
functionName
|
|
18
16
|
}: {
|
|
19
|
-
groupPath: GroupPath_;
|
|
20
17
|
functionName: FunctionName;
|
|
21
|
-
}) => Context.Tag<FunctionImpl<
|
|
22
|
-
declare const make: <Api_ extends AnyWithProps, Group extends GroupSpec.AnyWithProps, const FunctionName extends FunctionSpec.Name<GroupSpec.Functions<Group>>>(api: Api_, group: Group, functionName: FunctionName, handler: WithName<Schema$1<Api_>, GroupSpec.Functions<Group>, FunctionName>) => Layer.Layer<FunctionImpl<string, FunctionName>>;
|
|
18
|
+
}) => Context.Tag<FunctionImpl<FunctionName>, FunctionImpl<FunctionName>>;
|
|
23
19
|
/**
|
|
24
|
-
*
|
|
20
|
+
* Register a single function's implementation into the group's `Registry`.
|
|
21
|
+
*
|
|
22
|
+
* The function is registered under a flat, single-segment key (its own
|
|
23
|
+
* `functionName`), not a project-wide dot-path. Each group's impl layer is
|
|
24
|
+
* built in isolation — `RegisteredFunctions.buildForGroup` (and the CLI's
|
|
25
|
+
* `validateImpl`) provide a fresh `Registry` per group — so function names
|
|
26
|
+
* only need to be unique within their own group.
|
|
27
|
+
*
|
|
28
|
+
* `databaseSchema` is retained purely as a type-level carrier: the handler's
|
|
29
|
+
* ctx-service requirements (`DatabaseReader`, `QueryCtx<DataModel>`, …) are
|
|
30
|
+
* derived from it via `Handler.WithName`. It is not read at runtime — the
|
|
31
|
+
* generated per-group registry forwards the schema value to the function
|
|
32
|
+
* builders — so impls depend on `_generated/schema` (table schemas) rather than
|
|
33
|
+
* `_generated/api` (which transitively imports every function spec).
|
|
25
34
|
*/
|
|
26
|
-
|
|
35
|
+
declare const make: <DatabaseSchema_ extends AnyWithProps, Group extends GroupSpec.AnyWithProps, const FunctionName extends FunctionSpec.Name<GroupSpec.Functions<Group>>>(_databaseSchema: DatabaseSchema_, group: Group, functionName: FunctionName, handler: WithName<DatabaseSchema_, GroupSpec.Functions<Group>, FunctionName>) => Layer.Layer<FunctionImpl<FunctionName>>;
|
|
27
36
|
/**
|
|
28
|
-
* Get
|
|
37
|
+
* Get the function implementation service type for a specific function name.
|
|
29
38
|
*/
|
|
30
|
-
type
|
|
39
|
+
type ForFunction<FunctionName extends string> = FunctionImpl<FunctionName>;
|
|
31
40
|
/**
|
|
32
|
-
*
|
|
41
|
+
* Get all function implementation services required for a group spec.
|
|
33
42
|
*/
|
|
34
|
-
type
|
|
43
|
+
type FromGroupSpec<Group extends GroupSpec.AnyWithProps> = FunctionSpec.Name<GroupSpec.Functions<Group>> extends infer FunctionNames extends string ? FunctionNames extends string ? FunctionImpl<FunctionNames> : never : never;
|
|
35
44
|
//#endregion
|
|
36
|
-
export {
|
|
45
|
+
export { ForFunction, FromGroupSpec, FunctionImpl, FunctionImpl_d_exports, make };
|
|
37
46
|
//# sourceMappingURL=FunctionImpl.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FunctionImpl.d.ts","names":[],"sources":["../src/FunctionImpl.ts"],"mappings":";;;;;;;;;;UASiB,YAAA;EAAA,
|
|
1
|
+
{"version":3,"file":"FunctionImpl.d.ts","names":[],"sources":["../src/FunctionImpl.ts"],"mappings":";;;;;;;;;;UASiB,YAAA;EAAA,SACN,YAAA,EAAc,YAAA;AAAA;AAAA,cAGZ,YAAA;EAA6C;AAAA;EAGxD,YAAA,EAAc,YAAA;AAAA,MACf,OAAA,CAAA,GAAA,CAAA,YAAA,CAAA,YAAA,GAAA,YAAA,CAAA,YAAA;;;;AARD;;;;;;;;;AAIA;;;;cAyBa,IAAA,2BACa,YAAA,gBACV,SAAA,CAAU,YAAA,6BACG,YAAA,CAAa,IAAA,CAAK,SAAA,CAAU,SAAA,CAAU,KAAA,IAEjE,eAAA,EAAiB,eAAA,EACjB,KAAA,EAAO,KAAA,EACP,YAAA,EAAc,YAAA,EACd,OAAA,EAAS,QAAA,CACP,eAAA,EACA,SAAA,CAAU,SAAA,CAAU,KAAA,GACpB,YAAA,MAED,KAAA,CAAM,KAAA,CAAM,YAAA,CAAa,YAAA;;;;KA2BhB,WAAA,gCACV,YAAA,CAAa,YAAA;;;;KAKH,aAAA,eAA4B,SAAA,CAAU,YAAA,IAChD,YAAA,CAAa,IAAA,CACX,SAAA,CAAU,SAAA,CAAU,KAAA,gDAElB,aAAA,kBACE,YAAA,CAAa,aAAA"}
|
package/dist/FunctionImpl.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { __exportAll } from "./_virtual/_rolldown/runtime.js";
|
|
2
|
-
import { resolveGroupPathUnsafe } from "./Api.js";
|
|
3
2
|
import { setNestedProperty } from "./internal/utils.js";
|
|
4
3
|
import { make as make$1 } from "./RegistryItem.js";
|
|
5
|
-
import { Context, Effect, Layer, Ref
|
|
4
|
+
import { Context, Effect, Layer, Ref } from "effect";
|
|
6
5
|
import * as Registry from "@confect/core/Registry";
|
|
7
6
|
|
|
8
7
|
//#region src/FunctionImpl.ts
|
|
@@ -10,23 +9,32 @@ var FunctionImpl_exports = /* @__PURE__ */ __exportAll({
|
|
|
10
9
|
FunctionImpl: () => FunctionImpl,
|
|
11
10
|
make: () => make
|
|
12
11
|
});
|
|
13
|
-
const FunctionImpl = ({
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
const FunctionImpl = ({ functionName }) => Context.GenericTag(`@confect/server/FunctionImpl/${functionName}`);
|
|
13
|
+
/**
|
|
14
|
+
* Register a single function's implementation into the group's `Registry`.
|
|
15
|
+
*
|
|
16
|
+
* The function is registered under a flat, single-segment key (its own
|
|
17
|
+
* `functionName`), not a project-wide dot-path. Each group's impl layer is
|
|
18
|
+
* built in isolation — `RegisteredFunctions.buildForGroup` (and the CLI's
|
|
19
|
+
* `validateImpl`) provide a fresh `Registry` per group — so function names
|
|
20
|
+
* only need to be unique within their own group.
|
|
21
|
+
*
|
|
22
|
+
* `databaseSchema` is retained purely as a type-level carrier: the handler's
|
|
23
|
+
* ctx-service requirements (`DatabaseReader`, `QueryCtx<DataModel>`, …) are
|
|
24
|
+
* derived from it via `Handler.WithName`. It is not read at runtime — the
|
|
25
|
+
* generated per-group registry forwards the schema value to the function
|
|
26
|
+
* builders — so impls depend on `_generated/schema` (table schemas) rather than
|
|
27
|
+
* `_generated/api` (which transitively imports every function spec).
|
|
28
|
+
*/
|
|
29
|
+
const make = (_databaseSchema, group, functionName, handler) => {
|
|
16
30
|
const functionSpec = group.functions[functionName];
|
|
17
|
-
return Layer.effect(FunctionImpl({
|
|
18
|
-
groupPath,
|
|
19
|
-
functionName
|
|
20
|
-
}), Effect.gen(function* () {
|
|
31
|
+
return Layer.effect(FunctionImpl({ functionName }), Effect.gen(function* () {
|
|
21
32
|
const registry = yield* Registry.Registry;
|
|
22
|
-
yield* Ref.update(registry, (registryItems) => setNestedProperty(registryItems, [
|
|
33
|
+
yield* Ref.update(registry, (registryItems) => setNestedProperty(registryItems, [functionName], make$1({
|
|
23
34
|
functionSpec,
|
|
24
35
|
handler
|
|
25
36
|
})));
|
|
26
|
-
return {
|
|
27
|
-
groupPath,
|
|
28
|
-
functionName
|
|
29
|
-
};
|
|
37
|
+
return { functionName };
|
|
30
38
|
}));
|
|
31
39
|
};
|
|
32
40
|
|
package/dist/FunctionImpl.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FunctionImpl.js","names":["
|
|
1
|
+
{"version":3,"file":"FunctionImpl.js","names":["RegistryItem.make"],"sources":["../src/FunctionImpl.ts"],"sourcesContent":["import type * as FunctionSpec from \"@confect/core/FunctionSpec\";\nimport type * as GroupSpec from \"@confect/core/GroupSpec\";\nimport * as Registry from \"@confect/core/Registry\";\nimport { Context, Effect, Layer, Ref } from \"effect\";\nimport type * as DatabaseSchema from \"./DatabaseSchema\";\nimport type * as Handler from \"./Handler\";\nimport { setNestedProperty } from \"./internal/utils\";\nimport * as RegistryItem from \"./RegistryItem\";\n\nexport interface FunctionImpl<FunctionName extends string> {\n readonly functionName: FunctionName;\n}\n\nexport const FunctionImpl = <FunctionName extends string>({\n functionName,\n}: {\n functionName: FunctionName;\n}) =>\n Context.GenericTag<FunctionImpl<FunctionName>>(\n `@confect/server/FunctionImpl/${functionName}`,\n );\n\n/**\n * Register a single function's implementation into the group's `Registry`.\n *\n * The function is registered under a flat, single-segment key (its own\n * `functionName`), not a project-wide dot-path. Each group's impl layer is\n * built in isolation — `RegisteredFunctions.buildForGroup` (and the CLI's\n * `validateImpl`) provide a fresh `Registry` per group — so function names\n * only need to be unique within their own group.\n *\n * `databaseSchema` is retained purely as a type-level carrier: the handler's\n * ctx-service requirements (`DatabaseReader`, `QueryCtx<DataModel>`, …) are\n * derived from it via `Handler.WithName`. It is not read at runtime — the\n * generated per-group registry forwards the schema value to the function\n * builders — so impls depend on `_generated/schema` (table schemas) rather than\n * `_generated/api` (which transitively imports every function spec).\n */\nexport const make = <\n DatabaseSchema_ extends DatabaseSchema.AnyWithProps,\n Group extends GroupSpec.AnyWithProps,\n const FunctionName extends FunctionSpec.Name<GroupSpec.Functions<Group>>,\n>(\n _databaseSchema: DatabaseSchema_,\n group: Group,\n functionName: FunctionName,\n handler: Handler.WithName<\n DatabaseSchema_,\n GroupSpec.Functions<Group>,\n FunctionName\n >,\n): Layer.Layer<FunctionImpl<FunctionName>> => {\n const functionSpec = group.functions[functionName]!;\n\n return Layer.effect(\n FunctionImpl<FunctionName>({ functionName }),\n Effect.gen(function* () {\n const registry = yield* Registry.Registry;\n\n yield* Ref.update(registry, (registryItems) =>\n setNestedProperty(\n registryItems,\n [functionName],\n RegistryItem.make({\n functionSpec,\n handler,\n }),\n ),\n );\n\n return { functionName };\n }),\n );\n};\n\n/**\n * Get the function implementation service type for a specific function name.\n */\nexport type ForFunction<FunctionName extends string> =\n FunctionImpl<FunctionName>;\n\n/**\n * Get all function implementation services required for a group spec.\n */\nexport type FromGroupSpec<Group extends GroupSpec.AnyWithProps> =\n FunctionSpec.Name<\n GroupSpec.Functions<Group>\n > extends infer FunctionNames extends string\n ? FunctionNames extends string\n ? FunctionImpl<FunctionNames>\n : never\n : never;\n"],"mappings":";;;;;;;;;;;AAaA,MAAa,gBAA6C,EACxD,mBAIA,QAAQ,WACN,gCAAgC,eACjC;;;;;;;;;;;;;;;;;AAkBH,MAAa,QAKX,iBACA,OACA,cACA,YAK4C;CAC5C,MAAM,eAAe,MAAM,UAAU;AAErC,QAAO,MAAM,OACX,aAA2B,EAAE,cAAc,CAAC,EAC5C,OAAO,IAAI,aAAa;EACtB,MAAM,WAAW,OAAO,SAAS;AAEjC,SAAO,IAAI,OAAO,WAAW,kBAC3B,kBACE,eACA,CAAC,aAAa,EACdA,OAAkB;GAChB;GACA;GACD,CAAC,CACH,CACF;AAED,SAAO,EAAE,cAAc;GACvB,CACH"}
|