@gaganref/confect-server 10.3.1-fork.26 → 10.3.1-fork.28
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/ActionCall.d.ts +30 -0
- package/dist/ActionCall.d.ts.map +1 -0
- package/dist/ActionCall.js +41 -0
- package/dist/ActionCall.js.map +1 -0
- package/dist/ActionRunner.js +2 -2
- package/dist/AiGatewayDecisionClient.js +1 -1
- package/dist/AiGatewayLanguageClient.js +1 -1
- package/dist/Auth.js +1 -1
- package/dist/Callback.js +3 -3
- package/dist/ConvexConfigProvider.js +2 -2
- package/dist/ConvexFunctionDefinitions.js +2 -2
- package/dist/ConvexLogger.js +1 -1
- package/dist/CronJobs.js +6 -6
- package/dist/DatabaseSchema.js +2 -2
- package/dist/DatabaseWriter.js +3 -3
- package/dist/ExecutionMetadata.js +1 -1
- package/dist/FunctionImpl.js +2 -2
- package/dist/FunctionRegistryItem.js +1 -1
- package/dist/GroupImpl.js +5 -5
- package/dist/Handler.d.ts +7 -3
- package/dist/Handler.d.ts.map +1 -1
- package/dist/Handler.js.map +1 -1
- package/dist/HttpRouter.js +2 -2
- package/dist/MiddlewareImpl.js +1 -1
- package/dist/MutationRunner.js +2 -2
- package/dist/MutationTransactionContext.js +2 -2
- package/dist/QueryInitializer.js +2 -2
- package/dist/QueryRunner.js +2 -2
- package/dist/QueryStream.d.ts +32 -0
- package/dist/QueryStream.d.ts.map +1 -1
- package/dist/QueryStream.js +40 -4
- package/dist/QueryStream.js.map +1 -1
- package/dist/QueryStreamCursor.js +1 -1
- package/dist/QueryStreamIndexPrefix.js +1 -1
- package/dist/QueryStreamIndexRange.js +2 -2
- package/dist/QueryStreamKey.js +1 -1
- package/dist/QueryStreamKeyBounds.js +2 -2
- package/dist/QueryStreamKeyLayout.js +2 -2
- package/dist/QueryStreamKeyValues.js +1 -1
- package/dist/QueryStreamPagination.js +1 -1
- package/dist/QueryStreamReadBudget.js +2 -2
- package/dist/QueryTransactionContext.js +2 -2
- package/dist/RegisteredConvexFunction.js +19 -19
- package/dist/RegisteredConvexFunction.js.map +1 -1
- package/dist/RegisteredFunction.d.ts.map +1 -1
- package/dist/RegisteredFunction.js +55 -13
- package/dist/RegisteredFunction.js.map +1 -1
- package/dist/RegisteredNodeFunction.js +1 -1
- package/dist/RegistryItems.js +1 -1
- package/dist/RequestMetadata.js +1 -1
- package/dist/Scheduler.js +2 -2
- package/dist/Storage.js +1 -1
- package/dist/StorageActionWriter.js +1 -1
- package/dist/StorageReader.js +1 -1
- package/dist/StorageWriter.js +1 -1
- package/dist/TransactionMetadata.js +1 -1
- package/dist/VectorSearch.js +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -9
- package/dist/internal/AiGatewayDecisionClient.js +1 -1
- package/dist/internal/AiGatewayLanguageClient.js +1 -1
- package/dist/internal/AiGatewayServiceToken.js +1 -1
- package/dist/internal/DocumentPatch.js +1 -1
- package/package.json +2 -2
- package/src/ActionCall.ts +82 -0
- package/src/Handler.ts +20 -5
- package/src/QueryStream.ts +83 -0
- package/src/RegisteredFunction.ts +54 -1
- package/src/index.ts +1 -0
package/dist/QueryStream.js
CHANGED
|
@@ -11,17 +11,17 @@ import { admittedByLower, admittedByUpper, forLayout, fromParsed, intersect, int
|
|
|
11
11
|
import { apply, equalityPrefixLength, fromBounds, toBounds as toBounds$1 } from "./QueryStreamIndexRange.js";
|
|
12
12
|
import { EmptyInitialPageError, InvalidPageSizeError, Range, Start, finish, initial, parseRequest, record } from "./QueryStreamPagination.js";
|
|
13
13
|
import { InvalidReadLimitError, Limits, QueryStreamReadBudget, make as make$1 } from "./QueryStreamReadBudget.js";
|
|
14
|
+
import * as Data from "effect/Data";
|
|
14
15
|
import * as Effect from "effect/Effect";
|
|
16
|
+
import * as Predicate from "effect/Predicate";
|
|
17
|
+
import * as Array from "effect/Array";
|
|
15
18
|
import * as Schema from "effect/Schema";
|
|
16
19
|
import { dual, identity, pipe } from "effect/Function";
|
|
17
20
|
import * as Match from "effect/Match";
|
|
18
21
|
import * as Option from "effect/Option";
|
|
19
22
|
import { ConvexError } from "convex/values";
|
|
20
|
-
import * as Array from "effect/Array";
|
|
21
23
|
import * as Order from "effect/Order";
|
|
22
|
-
import * as Predicate from "effect/Predicate";
|
|
23
24
|
import * as Result from "effect/Result";
|
|
24
|
-
import * as Data from "effect/Data";
|
|
25
25
|
import * as Stream from "effect/Stream";
|
|
26
26
|
import { pipeArguments } from "effect/Pipeable";
|
|
27
27
|
import * as Chunk from "effect/Chunk";
|
|
@@ -32,6 +32,7 @@ import * as String from "effect/String";
|
|
|
32
32
|
import * as Tuple from "effect/Tuple";
|
|
33
33
|
//#region src/QueryStream.ts
|
|
34
34
|
var QueryStream_exports = /* @__PURE__ */ __exportAll({
|
|
35
|
+
DeferredStreamMismatchError: () => DeferredStreamMismatchError,
|
|
35
36
|
Element: () => Element,
|
|
36
37
|
EmptyInitialPageError: () => EmptyInitialPageError,
|
|
37
38
|
IncompatibleStreamsError: () => IncompatibleStreamsError,
|
|
@@ -44,6 +45,7 @@ var QueryStream_exports = /* @__PURE__ */ __exportAll({
|
|
|
44
45
|
QueryStream: () => QueryStream,
|
|
45
46
|
ReadBudgetExceededError: () => ReadBudgetExceededError,
|
|
46
47
|
TypeId: () => TypeId,
|
|
48
|
+
defer: () => defer,
|
|
47
49
|
distinct: () => distinct,
|
|
48
50
|
empty: () => empty,
|
|
49
51
|
filter: () => filter,
|
|
@@ -234,6 +236,40 @@ const empty = () => (keyLayout, orderDirection = "asc") => {
|
|
|
234
236
|
return make(orderDirection);
|
|
235
237
|
};
|
|
236
238
|
/**
|
|
239
|
+
* A deferred stream's resolved direction or layout differs from its
|
|
240
|
+
* declaration. The check runs on consumption, before the resolved source is
|
|
241
|
+
* pulled.
|
|
242
|
+
*
|
|
243
|
+
* @experimental
|
|
244
|
+
*/
|
|
245
|
+
var DeferredStreamMismatchError = class extends Data.TaggedError("DeferredStreamMismatchError") {};
|
|
246
|
+
/**
|
|
247
|
+
* Defer an effect that checks access or constructs a query stream until it is
|
|
248
|
+
* pulled. Supply its layout and direction without reading documents. This lets
|
|
249
|
+
* `flatMap` build and narrow an inner stream before running its checks.
|
|
250
|
+
*
|
|
251
|
+
* The effect runs afresh on each consumption, seek, or reversal. Failures and
|
|
252
|
+
* service requirements are preserved. Its stream must match the declared layout
|
|
253
|
+
* and direction, or consumption dies with `DeferredStreamMismatchError`.
|
|
254
|
+
*
|
|
255
|
+
* @experimental
|
|
256
|
+
*/
|
|
257
|
+
const defer = (options, make) => {
|
|
258
|
+
const checked = Effect.map(make, (stream) => {
|
|
259
|
+
if (stream.orderDirection !== options.orderDirection || !Equivalence(stream.keyLayout, options.keyLayout)) throw new DeferredStreamMismatchError({
|
|
260
|
+
expectedOrderDirection: options.orderDirection,
|
|
261
|
+
actualOrderDirection: stream.orderDirection,
|
|
262
|
+
expectedKeyLayout: options.keyLayout,
|
|
263
|
+
actualKeyLayout: stream.keyLayout
|
|
264
|
+
});
|
|
265
|
+
return stream;
|
|
266
|
+
});
|
|
267
|
+
return new QueryStream(options.orderDirection, options.keyLayout, Stream.unwrap(Effect.map(checked, (stream) => stream.annotated)), void 0, (bounds) => defer(options, Effect.map(checked, (stream) => narrowByParsedBounds(stream, bounds))), () => defer({
|
|
268
|
+
...options,
|
|
269
|
+
orderDirection: flip(options.orderDirection)
|
|
270
|
+
}, Effect.map(checked, reverse)));
|
|
271
|
+
};
|
|
272
|
+
/**
|
|
237
273
|
* Create a reusable query stream from an index-query description. Prefer
|
|
238
274
|
* `reader.table(...).stream(...)` for inferred document and ordering types.
|
|
239
275
|
*
|
|
@@ -938,6 +974,6 @@ const paginate = dual(2, Effect.fn("QueryStream.paginate")(function* (self, opti
|
|
|
938
974
|
}));
|
|
939
975
|
}, (effect, _self, options) => Effect.provideServiceEffect(effect, QueryStreamReadBudget, Schema.decodeEffect(Limits)(options).pipe(Effect.catchTag("SchemaError", (cause) => Effect.die(new InvalidReadLimitError({ cause }))), Effect.flatMap(make$1)))));
|
|
940
976
|
//#endregion
|
|
941
|
-
export { Element, EmptyInitialPageError, IncompatibleStreamsError, InnerStreamLayoutMismatchError, InnerStreamOrderMismatchError, InvalidPageSizeError, InvalidReadLimitError, MissingReversalRecipeError, NotUniqueError, QueryStream, QueryStream_exports, ReadBudgetExceededError, TypeId, distinct, empty, filter, filterEffect, flatMap, fromReflection, isQueryStream, map, mapEffect, merge, narrow, paginate, renameKey, reverse, unique };
|
|
977
|
+
export { DeferredStreamMismatchError, Element, EmptyInitialPageError, IncompatibleStreamsError, InnerStreamLayoutMismatchError, InnerStreamOrderMismatchError, InvalidPageSizeError, InvalidReadLimitError, MissingReversalRecipeError, NotUniqueError, QueryStream, QueryStream_exports, ReadBudgetExceededError, TypeId, defer, distinct, empty, filter, filterEffect, flatMap, fromReflection, isQueryStream, map, mapEffect, merge, narrow, paginate, renameKey, reverse, unique };
|
|
942
978
|
|
|
943
979
|
//# sourceMappingURL=QueryStream.js.map
|