@gaganref/confect-server 10.3.1-fork.61 → 10.3.1-fork.63
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/OrderedQuery.d.ts
CHANGED
|
@@ -14,14 +14,13 @@ export type OrderedQuery<TableInfo_ extends TableInfo.AnyWithProps, Doc = TableI
|
|
|
14
14
|
readonly collect: () => Effect.Effect<ReadonlyArray<Doc>, Document.DocumentDecodeError>;
|
|
15
15
|
readonly stream: () => Stream.Stream<Doc, Document.DocumentDecodeError>;
|
|
16
16
|
/**
|
|
17
|
-
* Native pagination
|
|
18
|
-
* component
|
|
17
|
+
* Native pagination works in applications and components. A query may call
|
|
18
|
+
* `.paginate()` once across the host and every component query it calls. A
|
|
19
|
+
* second call throws. Use `QueryStream.paginate` for another index read.
|
|
19
20
|
*/
|
|
20
21
|
readonly paginate: {
|
|
21
22
|
readonly app: NativePaginate<TableInfo_, Doc>;
|
|
22
|
-
readonly component:
|
|
23
|
-
readonly "Native pagination is unavailable in components. Use QueryStream.paginate for index queries.": never;
|
|
24
|
-
};
|
|
23
|
+
readonly component: NativePaginate<TableInfo_, Doc>;
|
|
25
24
|
}[TargetKind];
|
|
26
25
|
};
|
|
27
26
|
export declare function make<Table_ extends Table.AnyWithProps>(query: ConvexOrderedQuery<TableInfo.ConvexTableInfo<TableInfo.TableInfo<Table_>>>, table: Table_ & {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OrderedQuery.d.ts","sourceRoot":"","sources":["../src/OrderedQuery.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,OAAO,MAAM,uBAAuB,CAAC;AACtD,OAAO,KAAK,EACV,iBAAiB,EACjB,aAAa,EACb,YAAY,IAAI,kBAAkB,EAClC,iBAAiB,EACjB,gBAAgB,EACjB,MAAM,eAAe,CAAC;AAEvB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACrC,OAAO,KAAK,MA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S,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,UAAU,CAAC,EACvC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,SAAS,OAAO,CAAC,GAAG,GAAG,KAAK,GAAG,WAAW,CAC9D,CAAC"}
|
package/dist/OrderedQuery.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OrderedQuery.js","names":["Document.decode"],"sources":["../src/OrderedQuery.ts"],"sourcesContent":["import type * as IdScope from \"@confect/core/IdScope\";\nimport type {\n ExpressionOrValue,\n FilterBuilder,\n OrderedQuery as ConvexOrderedQuery,\n PaginationOptions,\n PaginationResult,\n} from \"convex/server\";\nimport { identity, pipe } from \"effect/Function\";\nimport type { Option } from \"effect\";\nimport * as Effect from \"effect/Effect\";\nimport * as Stream from \"effect/Stream\";\nimport type * as DatabaseSchema from \"./DatabaseSchema.js\";\nimport * as Document from \"./Document.js\";\nimport type * as TableInfo from \"./TableInfo.js\";\nimport type * as Table from \"./Table.js\";\n\ntype NativePaginate<TableInfo_ extends TableInfo.AnyWithProps, Doc> = (\n options: PaginationOptions,\n filter?: (\n q: FilterBuilder<TableInfo.ConvexTableInfo<TableInfo_>>,\n ) => ExpressionOrValue<boolean>,\n) => Effect.Effect<PaginationResult<Doc>, Document.DocumentDecodeError>;\n\nexport type OrderedQuery<\n TableInfo_ extends TableInfo.AnyWithProps,\n Doc = TableInfo_[\"document\"],\n TargetKind extends DatabaseSchema.Target[\"kind\"] = \"app\",\n> = {\n readonly first: () => Effect.Effect<\n Option.Option<Doc>,\n Document.DocumentDecodeError\n >;\n readonly take: (\n n: number,\n ) => Effect.Effect<ReadonlyArray<Doc>, Document.DocumentDecodeError>;\n readonly collect: () => Effect.Effect<\n ReadonlyArray<Doc>,\n Document.DocumentDecodeError\n >;\n readonly stream: () => Stream.Stream<Doc, Document.DocumentDecodeError>;\n /**\n * Native pagination
|
|
1
|
+
{"version":3,"file":"OrderedQuery.js","names":["Document.decode"],"sources":["../src/OrderedQuery.ts"],"sourcesContent":["import type * as IdScope from \"@confect/core/IdScope\";\nimport type {\n ExpressionOrValue,\n FilterBuilder,\n OrderedQuery as ConvexOrderedQuery,\n PaginationOptions,\n PaginationResult,\n} from \"convex/server\";\nimport { identity, pipe } from \"effect/Function\";\nimport type { Option } from \"effect\";\nimport * as Effect from \"effect/Effect\";\nimport * as Stream from \"effect/Stream\";\nimport type * as DatabaseSchema from \"./DatabaseSchema.js\";\nimport * as Document from \"./Document.js\";\nimport type * as TableInfo from \"./TableInfo.js\";\nimport type * as Table from \"./Table.js\";\n\ntype NativePaginate<TableInfo_ extends TableInfo.AnyWithProps, Doc> = (\n options: PaginationOptions,\n filter?: (\n q: FilterBuilder<TableInfo.ConvexTableInfo<TableInfo_>>,\n ) => ExpressionOrValue<boolean>,\n) => Effect.Effect<PaginationResult<Doc>, Document.DocumentDecodeError>;\n\nexport type OrderedQuery<\n TableInfo_ extends TableInfo.AnyWithProps,\n Doc = TableInfo_[\"document\"],\n TargetKind extends DatabaseSchema.Target[\"kind\"] = \"app\",\n> = {\n readonly first: () => Effect.Effect<\n Option.Option<Doc>,\n Document.DocumentDecodeError\n >;\n readonly take: (\n n: number,\n ) => Effect.Effect<ReadonlyArray<Doc>, Document.DocumentDecodeError>;\n readonly collect: () => Effect.Effect<\n ReadonlyArray<Doc>,\n Document.DocumentDecodeError\n >;\n readonly stream: () => Stream.Stream<Doc, Document.DocumentDecodeError>;\n /**\n * Native pagination works in applications and components. A query may call\n * `.paginate()` once across the host and every component query it calls. A\n * second call throws. Use `QueryStream.paginate` for another index read.\n */\n readonly paginate: {\n readonly app: NativePaginate<TableInfo_, Doc>;\n readonly component: NativePaginate<TableInfo_, Doc>;\n }[TargetKind];\n};\n\nexport function make<Table_ extends Table.AnyWithProps>(\n query: ConvexOrderedQuery<\n TableInfo.ConvexTableInfo<TableInfo.TableInfo<Table_>>\n >,\n table: Table_ & { readonly scope: IdScope.App },\n): OrderedQuery<TableInfo.TableInfo<Table_>>;\nexport function make<Table_ extends Table.AnyWithProps>(\n query: ConvexOrderedQuery<\n TableInfo.ConvexTableInfo<TableInfo.TableInfo<Table_>>\n >,\n table: Table_,\n): OrderedQuery<\n TableInfo.TableInfo<Table_>,\n TableInfo.TableInfo<Table_>[\"document\"],\n Table.Scope<Table_> extends IdScope.App ? \"app\" : \"component\"\n>;\nexport function make<Table_ extends Table.AnyWithProps>(\n query: ConvexOrderedQuery<\n TableInfo.ConvexTableInfo<TableInfo.TableInfo<Table_>>\n >,\n table: Table_,\n): OrderedQuery<\n TableInfo.TableInfo<Table_>,\n TableInfo.TableInfo<Table_>[\"document\"],\n DatabaseSchema.Target[\"kind\"]\n> {\n type TableInfo_ = TableInfo.TableInfo<Table_>;\n type OrderedQueryFunction<\n FunctionName extends keyof OrderedQuery<TableInfo_>,\n > = OrderedQuery<TableInfo_>[FunctionName];\n\n const streamEncoded = Stream.fromAsyncIterable(query, identity).pipe(\n Stream.orDie,\n );\n\n const stream: OrderedQueryFunction<\"stream\"> = () =>\n pipe(streamEncoded, Stream.mapEffect(Document.decode(table)));\n\n const first: OrderedQueryFunction<\"first\"> = () =>\n pipe(stream(), Stream.take(1), Stream.runHead);\n\n const take: OrderedQueryFunction<\"take\"> = (n: number) =>\n pipe(stream(), Stream.take(n), Stream.runCollect);\n\n const collect: OrderedQueryFunction<\"collect\"> = () =>\n pipe(stream(), Stream.runCollect);\n\n const paginate: NativePaginate<TableInfo_, TableInfo_[\"document\"]> =\n Effect.fn(\"OrderedQuery.paginate\")(function* (options, filter) {\n const filteredQuery = filter !== undefined ? query.filter(filter) : query;\n\n const paginationResult = yield* Effect.promise(() =>\n filteredQuery.paginate(options),\n );\n\n const parsedPage = yield* Effect.forEach(\n paginationResult.page,\n Document.decode(table),\n );\n\n return {\n page: parsedPage,\n isDone: paginationResult.isDone,\n continueCursor: paginationResult.continueCursor,\n /* v8 ignore start */\n ...(paginationResult.splitCursor\n ? { splitCursor: paginationResult.splitCursor }\n : {}),\n ...(paginationResult.pageStatus\n ? { pageStatus: paginationResult.pageStatus }\n : {}),\n /* v8 ignore stop */\n };\n });\n\n return {\n first,\n take,\n collect,\n paginate,\n stream,\n };\n}\n"],"mappings":";;;;;;;AAoEA,SAAgB,KACd,OAGA,OAKA;CAMA,MAAM,gBAAgB,OAAO,kBAAkB,OAAO,QAAQ,CAAC,CAAC,KAC9D,OAAO,KACT;CAEA,MAAM,eACJ,KAAK,eAAe,OAAO,UAAUA,OAAgB,KAAK,CAAC,CAAC;CAE9D,MAAM,cACJ,KAAK,OAAO,GAAG,OAAO,KAAK,CAAC,GAAG,OAAO,OAAO;CAE/C,MAAM,QAAsC,MAC1C,KAAK,OAAO,GAAG,OAAO,KAAK,CAAC,GAAG,OAAO,UAAU;CAElD,MAAM,gBACJ,KAAK,OAAO,GAAG,OAAO,UAAU;CA8BlC,OAAO;EACL;EACA;EACA;EACA,UA/BA,OAAO,GAAG,uBAAuB,CAAC,CAAC,WAAW,SAAS,QAAQ;GAC7D,MAAM,gBAAgB,WAAW,KAAA,IAAY,MAAM,OAAO,MAAM,IAAI;GAEpE,MAAM,mBAAmB,OAAO,OAAO,cACrC,cAAc,SAAS,OAAO,CAChC;GAOA,OAAO;IACL,MAAM,OANkB,OAAO,QAC/B,iBAAiB,MACjBA,OAAgB,KAAK,CACvB;IAIE,QAAQ,iBAAiB;IACzB,gBAAgB,iBAAiB;;IAEjC,GAAI,iBAAiB,cACjB,EAAE,aAAa,iBAAiB,YAAY,IAC5C,CAAC;IACL,GAAI,iBAAiB,aACjB,EAAE,YAAY,iBAAiB,WAAW,IAC1C,CAAC;GAEP;EACF,CAMO;EACP;CACF;AACF"}
|
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.63",
|
|
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.63",
|
|
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/OrderedQuery.ts
CHANGED
|
@@ -40,14 +40,13 @@ export type OrderedQuery<
|
|
|
40
40
|
>;
|
|
41
41
|
readonly stream: () => Stream.Stream<Doc, Document.DocumentDecodeError>;
|
|
42
42
|
/**
|
|
43
|
-
* Native pagination
|
|
44
|
-
* component
|
|
43
|
+
* Native pagination works in applications and components. A query may call
|
|
44
|
+
* `.paginate()` once across the host and every component query it calls. A
|
|
45
|
+
* second call throws. Use `QueryStream.paginate` for another index read.
|
|
45
46
|
*/
|
|
46
47
|
readonly paginate: {
|
|
47
48
|
readonly app: NativePaginate<TableInfo_, Doc>;
|
|
48
|
-
readonly component:
|
|
49
|
-
readonly "Native pagination is unavailable in components. Use QueryStream.paginate for index queries.": never;
|
|
50
|
-
};
|
|
49
|
+
readonly component: NativePaginate<TableInfo_, Doc>;
|
|
51
50
|
}[TargetKind];
|
|
52
51
|
};
|
|
53
52
|
|