@gaganref/confect-server 10.3.1-fork.83 → 10.3.1-fork.85
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/TableInfo.d.ts +7 -7
- package/dist/TableInfo.d.ts.map +1 -1
- package/dist/TableInfo.js.map +1 -1
- package/package.json +2 -2
- package/src/TableInfo.ts +18 -23
package/dist/TableInfo.d.ts
CHANGED
|
@@ -7,15 +7,15 @@ import type * as Document_ from "./Document.js";
|
|
|
7
7
|
import type * as Table from "./Table.js";
|
|
8
8
|
export declare const TypeId: "~@confect/server/TableInfo";
|
|
9
9
|
export type TypeId = typeof TypeId;
|
|
10
|
-
export type TableInfo<Table_ extends Table.AnyWithProps> = Table_ extends Table.Table<
|
|
10
|
+
export type TableInfo<Table_ extends Table.AnyWithProps> = Table_ extends Table.Table<any, any, any, infer Indexes, any, any, any, any> ? {
|
|
11
11
|
readonly [TypeId]: TypeId;
|
|
12
|
-
readonly document: WithSystemFields<
|
|
13
|
-
readonly encodedDocument: WithSystemFields<
|
|
14
|
-
readonly convexDocument: ExtractConvexDocument<
|
|
15
|
-
readonly fieldPaths: keyof IdField<
|
|
12
|
+
readonly document: WithSystemFields<Table.Name<Table_>, Schema.Schema.Type<Table.TableSchema<Table_>>, Table.Scope<Table_>>;
|
|
13
|
+
readonly encodedDocument: WithSystemFields<Table.Name<Table_>, Schema.Codec.Encoded<Table.TableSchema<Table_>>, Table.Scope<Table_>>;
|
|
14
|
+
readonly convexDocument: ExtractConvexDocument<Table.Name<Table_>, Table.TableValidator<Table_>, Table.Scope<Table_>>;
|
|
15
|
+
readonly fieldPaths: keyof IdField<Table.Name<Table_>> | ExtractFieldPaths<Table.TableValidator<Table_>>;
|
|
16
16
|
readonly indexes: Types.Simplify<Indexes & SystemIndexes>;
|
|
17
|
-
readonly searchIndexes: SearchIndexes
|
|
18
|
-
readonly vectorIndexes: VectorIndexes
|
|
17
|
+
readonly searchIndexes: Table.SearchIndexes<Table_>;
|
|
18
|
+
readonly vectorIndexes: Table.VectorIndexes<Table_>;
|
|
19
19
|
} : never;
|
|
20
20
|
export interface Any {
|
|
21
21
|
readonly [TypeId]: TypeId;
|
package/dist/TableInfo.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableInfo.d.ts","sourceRoot":"","sources":["../src/TableInfo.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,OAAO,MAAM,uBAAuB,CAAC;AACtD,OAAO,KAAK,EACV,eAAe,EACf,iBAAiB,EACjB,mBAAmB,EACnB,yBAAyB,EACzB,yBAAyB,EACzB,OAAO,EACP,YAAY,EACZ,aAAa,EACd,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAC5C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,KAAK,KAAK,SAAS,MAAM,eAAe,CAAC;AAChD,OAAO,KAAK,KAAK,KAAK,MAAM,YAAY,CAAC;AAEzC,MAAM,CAAC,OAAO,CAAC,MAAM,MAAM,EAAE,4BAA4B,CAAC;AAC1D,MAAM,MAAM,MAAM,GAAG,OAAO,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"TableInfo.d.ts","sourceRoot":"","sources":["../src/TableInfo.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,OAAO,MAAM,uBAAuB,CAAC;AACtD,OAAO,KAAK,EACV,eAAe,EACf,iBAAiB,EACjB,mBAAmB,EACnB,yBAAyB,EACzB,yBAAyB,EACzB,OAAO,EACP,YAAY,EACZ,aAAa,EACd,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,QA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CAAC,EACtB,UAAU,CAAC,iBAAiB,CAAC,CAC9B,CAAC;AAEF,MAAM,MAAM,QAAQ,CAAC,UAAU,SAAS,YAAY,IAAI,UAAU,CAAC,UAAU,CAAC,CAAC;AAK/E,KAAK,iBAAiB,CAAC,cAAc,SAAS,gBAAgB,IAC1D,cAAc,CAAC,YAAY,CAAC,GAC5B,MAAM,YAAY,CAAC;AAEvB,KAAK,qBAAqB,CACxB,SAAS,SAAS,MAAM,EACxB,cAAc,SAAS,gBAAgB,EACvC,KAAK,SAAS,OAAO,CAAC,OAAO,GAAG,OAAO,CAAC,GAAG,IAE3C,gBAAgB,CACd,SAAS,EACT,cAAc,CAAC,MAAM,CAAC,EACtB,KAAK,CACN,SAAS,eAAe,GACrB,gBAAgB,CAAC,SAAS,EAAE,cAAc,CAAC,MAAM,CAAC,EAAE,KAAK,CAAC,GAC1D,KAAK,CAAC"}
|
package/dist/TableInfo.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableInfo.js","names":[],"sources":["../src/TableInfo.ts"],"sourcesContent":["import type * as IdScope from \"@confect/core/IdScope\";\nimport type {\n GenericDocument,\n GenericFieldPaths,\n GenericTableIndexes,\n GenericTableSearchIndexes,\n GenericTableVectorIndexes,\n IdField,\n SystemFields,\n SystemIndexes,\n} from \"convex/server\";\nimport type { GenericValidator } from \"convex/values\";\nimport type { Schema, Types } from \"effect\";\nimport type { WithSystemFields } from \"@confect/core/SystemFields\";\nimport type * as Document_ from \"./Document.js\";\nimport type * as Table from \"./Table.js\";\n\nexport declare const TypeId: \"~@confect/server/TableInfo\";\nexport type TypeId = typeof TypeId;\n\nexport type TableInfo<Table_ extends Table.AnyWithProps> =\n Table_ extends Table.Table
|
|
1
|
+
{"version":3,"file":"TableInfo.js","names":[],"sources":["../src/TableInfo.ts"],"sourcesContent":["import type * as IdScope from \"@confect/core/IdScope\";\nimport type {\n GenericDocument,\n GenericFieldPaths,\n GenericTableIndexes,\n GenericTableSearchIndexes,\n GenericTableVectorIndexes,\n IdField,\n SystemFields,\n SystemIndexes,\n} from \"convex/server\";\nimport type { GenericValidator } from \"convex/values\";\nimport type { Schema, Types } from \"effect\";\nimport type { WithSystemFields } from \"@confect/core/SystemFields\";\nimport type * as Document_ from \"./Document.js\";\nimport type * as Table from \"./Table.js\";\n\nexport declare const TypeId: \"~@confect/server/TableInfo\";\nexport type TypeId = typeof TypeId;\n\n// Read through Table's extractors, not `infer`: an intersection with a Table,\n// or an interface extending one, matches `Table<infer ...>` only structurally,\n// which widens the name and scope. `Indexes` stays inferred: a generic table's\n// index names resolve only through the inferred type's constraint.\nexport type TableInfo<Table_ extends Table.AnyWithProps> =\n Table_ extends Table.Table<any, any, any, infer Indexes, any, any, any, any>\n ? {\n readonly [TypeId]: TypeId;\n readonly document: WithSystemFields<\n Table.Name<Table_>,\n Schema.Schema.Type<Table.TableSchema<Table_>>,\n Table.Scope<Table_>\n >;\n readonly encodedDocument: WithSystemFields<\n Table.Name<Table_>,\n Schema.Codec.Encoded<Table.TableSchema<Table_>>,\n Table.Scope<Table_>\n >;\n readonly convexDocument: ExtractConvexDocument<\n Table.Name<Table_>,\n Table.TableValidator<Table_>,\n Table.Scope<Table_>\n >;\n readonly fieldPaths:\n | keyof IdField<Table.Name<Table_>>\n | ExtractFieldPaths<Table.TableValidator<Table_>>;\n readonly indexes: Types.Simplify<Indexes & SystemIndexes>;\n readonly searchIndexes: Table.SearchIndexes<Table_>;\n readonly vectorIndexes: Table.VectorIndexes<Table_>;\n }\n : never;\n\nexport interface Any {\n readonly [TypeId]: TypeId;\n}\n\nexport interface AnyWithProps extends Any {\n readonly document: Document_.Any;\n readonly encodedDocument: Document_.AnyEncoded;\n readonly convexDocument: GenericDocument;\n readonly fieldPaths: GenericFieldPaths;\n readonly indexes: GenericTableIndexes;\n readonly searchIndexes: GenericTableSearchIndexes;\n readonly vectorIndexes: GenericTableVectorIndexes;\n}\n\nexport type ConvexTableInfo<TableInfo_ extends AnyWithProps> = {\n document: TableInfo_[\"convexDocument\"];\n fieldPaths: TableInfo_[\"fieldPaths\"];\n indexes: TableInfo_[\"indexes\"];\n searchIndexes: TableInfo_[\"searchIndexes\"];\n vectorIndexes: TableInfo_[\"vectorIndexes\"];\n};\n\nexport type TableSchema<TableInfo_ extends AnyWithProps> = Schema.Codec<\n TableInfo_[\"document\"],\n TableInfo_[\"encodedDocument\"]\n>;\n\nexport type Document<TableInfo_ extends AnyWithProps> = TableInfo_[\"document\"];\n\n// Vendored types from convex-js, partially modified.\n// See https://github.com/get-convex/convex-js/pull/14\n\ntype ExtractFieldPaths<TableValidator extends GenericValidator> =\n | TableValidator[\"fieldPaths\"]\n | keyof SystemFields;\n\ntype ExtractConvexDocument<\n TableName extends string,\n TableValidator extends GenericValidator,\n Scope extends IdScope.IdScope = IdScope.App,\n> =\n WithSystemFields<\n TableName,\n TableValidator[\"type\"],\n Scope\n > extends GenericDocument\n ? WithSystemFields<TableName, TableValidator[\"type\"], Scope>\n : never;\n\n// End of vendored types from convex-js, partially modified.\n"],"mappings":""}
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gaganref/confect-server",
|
|
3
|
-
"version": "10.3.1-fork.
|
|
3
|
+
"version": "10.3.1-fork.85",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"@effect/ai-openai-compat": "4.0.4",
|
|
6
6
|
"@effect/ai-openrouter": "4.0.4"
|
|
7
7
|
},
|
|
8
8
|
"peerDependencies": {
|
|
9
|
-
"@confect/core": "npm:@gaganref/confect-core@10.3.1-fork.
|
|
9
|
+
"@confect/core": "npm:@gaganref/confect-core@10.3.1-fork.85",
|
|
10
10
|
"@effect/platform-node": ">=4.0.0 <4.1.0",
|
|
11
11
|
"convex": "^1.49.0",
|
|
12
12
|
"effect": ">=4.0.4 <4.1.0"
|
package/src/TableInfo.ts
CHANGED
|
@@ -18,40 +18,35 @@ import type * as Table from "./Table.js";
|
|
|
18
18
|
export declare const TypeId: "~@confect/server/TableInfo";
|
|
19
19
|
export type TypeId = typeof TypeId;
|
|
20
20
|
|
|
21
|
+
// Read through Table's extractors, not `infer`: an intersection with a Table,
|
|
22
|
+
// or an interface extending one, matches `Table<infer ...>` only structurally,
|
|
23
|
+
// which widens the name and scope. `Indexes` stays inferred: a generic table's
|
|
24
|
+
// index names resolve only through the inferred type's constraint.
|
|
21
25
|
export type TableInfo<Table_ extends Table.AnyWithProps> =
|
|
22
|
-
Table_ extends Table.Table<
|
|
23
|
-
infer TableName,
|
|
24
|
-
infer TableSchema_,
|
|
25
|
-
infer TableValidator,
|
|
26
|
-
infer Indexes,
|
|
27
|
-
infer SearchIndexes,
|
|
28
|
-
infer VectorIndexes,
|
|
29
|
-
infer Scope,
|
|
30
|
-
any
|
|
31
|
-
>
|
|
26
|
+
Table_ extends Table.Table<any, any, any, infer Indexes, any, any, any, any>
|
|
32
27
|
? {
|
|
33
28
|
readonly [TypeId]: TypeId;
|
|
34
29
|
readonly document: WithSystemFields<
|
|
35
|
-
|
|
36
|
-
Schema.Schema.Type<
|
|
37
|
-
Scope
|
|
30
|
+
Table.Name<Table_>,
|
|
31
|
+
Schema.Schema.Type<Table.TableSchema<Table_>>,
|
|
32
|
+
Table.Scope<Table_>
|
|
38
33
|
>;
|
|
39
34
|
readonly encodedDocument: WithSystemFields<
|
|
40
|
-
|
|
41
|
-
Schema.Codec.Encoded<
|
|
42
|
-
Scope
|
|
35
|
+
Table.Name<Table_>,
|
|
36
|
+
Schema.Codec.Encoded<Table.TableSchema<Table_>>,
|
|
37
|
+
Table.Scope<Table_>
|
|
43
38
|
>;
|
|
44
39
|
readonly convexDocument: ExtractConvexDocument<
|
|
45
|
-
|
|
46
|
-
TableValidator
|
|
47
|
-
Scope
|
|
40
|
+
Table.Name<Table_>,
|
|
41
|
+
Table.TableValidator<Table_>,
|
|
42
|
+
Table.Scope<Table_>
|
|
48
43
|
>;
|
|
49
44
|
readonly fieldPaths:
|
|
50
|
-
| keyof IdField<
|
|
51
|
-
| ExtractFieldPaths<TableValidator
|
|
45
|
+
| keyof IdField<Table.Name<Table_>>
|
|
46
|
+
| ExtractFieldPaths<Table.TableValidator<Table_>>;
|
|
52
47
|
readonly indexes: Types.Simplify<Indexes & SystemIndexes>;
|
|
53
|
-
readonly searchIndexes: SearchIndexes
|
|
54
|
-
readonly vectorIndexes: VectorIndexes
|
|
48
|
+
readonly searchIndexes: Table.SearchIndexes<Table_>;
|
|
49
|
+
readonly vectorIndexes: Table.VectorIndexes<Table_>;
|
|
55
50
|
}
|
|
56
51
|
: never;
|
|
57
52
|
|