effect-zero 0.4.2 → 0.5.0-beta.0
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/client-transaction.d.ts +77 -7
- package/dist/client-transaction.d.ts.map +1 -1
- package/dist/client-transaction.js +11 -7
- package/dist/client-transaction.js.map +1 -1
- package/dist/client.d.ts +119 -7
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +7 -6
- package/dist/client.js.map +1 -1
- package/dist/internal/server-synchronization-context.d.ts +19 -0
- package/dist/internal/server-synchronization-context.d.ts.map +1 -0
- package/dist/internal/server-synchronization-context.js +46 -0
- package/dist/internal/server-synchronization-context.js.map +1 -0
- package/dist/internal/server.d.ts +5 -16
- package/dist/internal/server.d.ts.map +1 -1
- package/dist/internal/server.js +1 -38
- package/dist/internal/server.js.map +1 -1
- package/dist/internal/server.test.js +7 -8
- package/dist/internal/server.test.js.map +1 -1
- package/dist/internal/utils.d.ts +7 -0
- package/dist/internal/utils.d.ts.map +1 -1
- package/dist/internal/utils.js +7 -0
- package/dist/internal/utils.js.map +1 -1
- package/dist/mutators.d.ts +1 -1
- package/dist/mutators.d.ts.map +1 -1
- package/dist/mutators.js +1 -1
- package/dist/query.d.ts +3 -5
- package/dist/query.d.ts.map +1 -1
- package/dist/query.js +6 -12
- package/dist/query.js.map +1 -1
- package/dist/result.d.ts +15 -15
- package/dist/result.d.ts.map +1 -1
- package/dist/result.js +11 -11
- package/dist/result.js.map +1 -1
- package/dist/server-transaction.d.ts +142 -15
- package/dist/server-transaction.d.ts.map +1 -1
- package/dist/server-transaction.js +24 -19
- package/dist/server-transaction.js.map +1 -1
- package/dist/server.d.ts +247 -12
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +21 -18
- package/dist/server.js.map +1 -1
- package/dist/types/common.d.ts +1 -1
- package/dist/types/common.d.ts.map +1 -1
- package/dist/types/error.d.ts +69 -48
- package/dist/types/error.d.ts.map +1 -1
- package/dist/types/error.js +38 -30
- package/dist/types/error.js.map +1 -1
- package/dist/types/push.d.ts +149 -149
- package/dist/types/push.d.ts.map +1 -1
- package/dist/types/push.js +45 -40
- package/dist/types/push.js.map +1 -1
- package/dist/types/queries.d.ts +42 -42
- package/dist/types/queries.d.ts.map +1 -1
- package/dist/types/queries.js +7 -7
- package/dist/types/queries.js.map +1 -1
- package/dist/types.test.js +13 -15
- package/dist/types.test.js.map +1 -1
- package/package.json +5 -7
- package/src/client-transaction.ts +13 -11
- package/src/client.ts +17 -19
- package/src/internal/server-synchronization-context.ts +64 -0
- package/src/internal/server.ts +3 -59
- package/src/internal/utils.ts +8 -0
- package/src/mutators.ts +2 -2
- package/src/query.ts +8 -20
- package/src/result.ts +40 -37
- package/src/server-transaction.ts +32 -37
- package/src/server.ts +34 -37
- package/src/types/error.ts +8 -8
- package/src/types/push.ts +22 -22
- package/src/types/queries.ts +7 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.test.js","sourceRoot":"","sources":["../../src/internal/server.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,IAAI,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,kBAAkB,EAAE,4BAA4B,
|
|
1
|
+
{"version":3,"file":"server.test.js","sourceRoot":"","sources":["../../src/internal/server.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,IAAI,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,KAAK,4BAA4B,MAAM,qCAAqC,CAAC;AAEpF,QAAQ,CAAC,8BAA8B,EAAE,GAAG,EAAE;IAC5C,EAAE,CAAC,MAAM,CAAC,qEAAqE,EAAE,GAAG,EAAE,CACpF,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;QAClB,MAAM,MAAM,GAAG,KAAK,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CACpC,4BAA4B,CAAC,QAAQ,EACrC,MAAM,CAAC,OAAO,CAAC,4BAA4B,CAAC,KAAK,CAAC,EAClD,MAAM,CAAC,IAAI,CACZ,CAAC;QACF,iBAAiB,CAAC,MAAM,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,kBAAkB,EAAE,CAAC,CAAC,CAAC;IAClE,CAAC,CAAC,CACH,CAAC;IAEF,EAAE,CAAC,MAAM,CACP,yDAAyD,EACzD,MAAM,CAAC,EAAE,CAAC,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE;QAC7B,MAAM,MAAM,GAAG,KAAK,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CACpC,4BAA4B,CAAC,KAAK,EAClC,4BAA4B,CAAC,QAAQ,EACrC,MAAM,CAAC,OAAO,CAAC,4BAA4B,CAAC,KAAK,CAAC,EAClD,MAAM,CAAC,IAAI,CACZ,CAAC;QACF,IAAI,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC;YAC3B,MAAM,CAAC,IAAI,CAAC,kBAAkB,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC;QAChD,CAAC;IACH,CAAC,CAAC,CACH,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
package/dist/internal/utils.d.ts
CHANGED
|
@@ -2,4 +2,11 @@
|
|
|
2
2
|
* Prefix a string with the package name.
|
|
3
3
|
*/
|
|
4
4
|
export declare const prefixId: <S extends string>(name: S) => `effect-zero/${S}`;
|
|
5
|
+
/**
|
|
6
|
+
* Zero unconditionally serializes arg-less mutator calls as `null` on the wire
|
|
7
|
+
* (https://github.com/rocicorp/mono/blob/3082c9fa061891067b4bd7dc9fe74f798270d8d7/packages/zero-client/src/client/custom.ts).
|
|
8
|
+
* v3 `Schema.Void` happened to accept any input; v4 `Schema.Void` is strict
|
|
9
|
+
* `=== undefined`, so we renormalize before decoding.
|
|
10
|
+
*/
|
|
11
|
+
export declare const normalizeArgs: (args: unknown) => unknown;
|
|
5
12
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/internal/utils.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,QAAQ,GAAI,CAAC,SAAS,MAAM,EAAE,MAAM,CAAC,uBAAmC,CAAC"}
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/internal/utils.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,QAAQ,GAAI,CAAC,SAAS,MAAM,EAAE,MAAM,CAAC,uBAAmC,CAAC;AAEtF;;;;;GAKG;AACH,eAAO,MAAM,aAAa,GAAI,MAAM,OAAO,KAAG,OAA6C,CAAC"}
|
package/dist/internal/utils.js
CHANGED
|
@@ -2,4 +2,11 @@
|
|
|
2
2
|
* Prefix a string with the package name.
|
|
3
3
|
*/
|
|
4
4
|
export const prefixId = (name) => `effect-zero/${name}`;
|
|
5
|
+
/**
|
|
6
|
+
* Zero unconditionally serializes arg-less mutator calls as `null` on the wire
|
|
7
|
+
* (https://github.com/rocicorp/mono/blob/3082c9fa061891067b4bd7dc9fe74f798270d8d7/packages/zero-client/src/client/custom.ts).
|
|
8
|
+
* v3 `Schema.Void` happened to accept any input; v4 `Schema.Void` is strict
|
|
9
|
+
* `=== undefined`, so we renormalize before decoding.
|
|
10
|
+
*/
|
|
11
|
+
export const normalizeArgs = (args) => (args === null ? undefined : args);
|
|
5
12
|
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/internal/utils.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAmB,IAAO,EAAE,EAAE,CAAC,eAAe,IAAI,EAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/internal/utils.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAmB,IAAO,EAAE,EAAE,CAAC,eAAe,IAAI,EAAW,CAAC;AAEtF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,IAAa,EAAW,EAAE,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC"}
|
package/dist/mutators.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ export type AnyMutatorFns<R = any> = {
|
|
|
6
6
|
[K: string]: AnyMutatorFn<R>;
|
|
7
7
|
};
|
|
8
8
|
};
|
|
9
|
-
export type AnyMutatorSchema = Schema.
|
|
9
|
+
export type AnyMutatorSchema = Schema.Codec<any, any>;
|
|
10
10
|
export type AnyMutatorSchemas = Record<string, AnyMutatorSchema | Record<string, AnyMutatorSchema>>;
|
|
11
11
|
export type MutatorFns<TSchema extends AnyMutatorSchemas> = {
|
|
12
12
|
[K in keyof TSchema]: TSchema[K] extends AnyMutatorSchema ? AnyMutatorFn<unknown, [Schema.Schema.Type<TSchema[K]>]> : TSchema[K] extends infer TSchema extends Record<string, AnyMutatorSchema> ? {
|
package/dist/mutators.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mutators.d.ts","sourceRoot":"","sources":["../src/mutators.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,MAAM,eAAe,CAAC;AAK7C,OAAO,K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IAAI,SAAS,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,GAC7D;SAAG,CAAC,IAAI,MAAM,IAAI,GAAG,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;KAAE,GACnE,KAAK,GACP,KAAK;CACZ,GAAG,EAAE,CAAC;AAGP,MAAM,MAAM,UAAU,CAAC,CAAC,GAAG,GAAG,EAAE,CAAC,GAAG,GAAG,IAAI,OAAO,CAAC,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AAGjG,MAAM,MAAM,WAAW,CAAC,CAAC,GAAG,GAAG,IAAI,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAEjG,MAAM,MAAM,2BAA2B,CAAC,SAAS,SAAS,WAAW,IAAI,SAAS,SAAS,WAAW,CAAC,MAAM,CAAC,CAAC,GAC3G,CAAC,GACD,KAAK,CAAC;AAEV,eAAO,MAAM,MAAM,GAAI,OAAO,SAAS,iBAAiB,EAAE,QAAQ,OAAO,YAAW,CAAC;AAErF,wBAAgB,IAAI,CAAC,OAAO,SAAS,iBAAiB,EAAE,IAAI,SAAS,UAAU,CAAC,OAAO,CAAC,EACtF,MAAM,EAAE,OAAO,EACf,QAAQ,EAAE,IAAI,GACb,QAAQ,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC"}
|
package/dist/mutators.js
CHANGED
|
@@ -11,7 +11,7 @@ export function make(schema, mutators) {
|
|
|
11
11
|
return Object.assign(fn, { [MutatorSchemaSymbol]: schema });
|
|
12
12
|
}
|
|
13
13
|
return Rec.map(mutators, (v, name) => {
|
|
14
|
-
return Match.value([v, schema[name]]).pipe(Match.when([Predicate.isFunction, Schema.isSchema], ([mutator, schema]) => makeMutator(schema, mutator)), Match.when([Predicate.
|
|
14
|
+
return Match.value([v, schema[name]]).pipe(Match.when([Predicate.isFunction, Schema.isSchema], ([mutator, schema]) => makeMutator(schema, mutator)), Match.when([Predicate.isObject, Predicate.isObject], ([mutator, schema]) => Rec.map(mutator, (mutator, name) => makeMutator(Option.getOrThrow(Rec.get(schema, name)), mutator))), Match.orElseAbsurd);
|
|
15
15
|
});
|
|
16
16
|
}
|
|
17
17
|
//# sourceMappingURL=mutators.js.map
|
package/dist/query.d.ts
CHANGED
|
@@ -3,7 +3,6 @@ import * as Effect from "effect/Effect";
|
|
|
3
3
|
import * as Equal from "effect/Equal";
|
|
4
4
|
import * as Schema from "effect/Schema";
|
|
5
5
|
import * as Stream from "effect/Stream";
|
|
6
|
-
import * as Subscribable from "effect/Subscribable";
|
|
7
6
|
import * as QueryResult from "./internal/query-result.js";
|
|
8
7
|
type QueryArgs<A extends ReadonlyJSONValue | void, B> = {
|
|
9
8
|
_tag: "Encoded";
|
|
@@ -16,15 +15,14 @@ export declare const RunQuerySymbol: unique symbol;
|
|
|
16
15
|
export declare const QueryNameSymbol: unique symbol;
|
|
17
16
|
export declare const make: <N extends string, A extends ReadonlyJSONValue | void, B, T extends keyof S["tables"] & string, S extends ZeroSchema, R, E, R1, R2>(options: {
|
|
18
17
|
name: N;
|
|
19
|
-
payload: Schema.
|
|
18
|
+
payload: Schema.Codec<B, A, R1, R1>;
|
|
20
19
|
query: (args: NoInfer<B>) => Effect.Effect<ZeroQuery<T, S, R>, E, R2>;
|
|
21
|
-
}) => ((args: B) => Effect.Effect<ZeroQuery<T, S, R> & Equal.Equal,
|
|
20
|
+
}) => ((args: B) => Effect.Effect<ZeroQuery<T, S, R> & Equal.Equal, Schema.SchemaError | E, R1 | R2>) & {
|
|
22
21
|
[QueryNameSymbol]: N;
|
|
23
|
-
[RunQuerySymbol]: (args: QueryArgs<A, B>) => Effect.Effect<ZeroQuery<T, S, R> & Equal.Equal,
|
|
22
|
+
[RunQuerySymbol]: (args: QueryArgs<A, B>) => Effect.Effect<ZeroQuery<T, S, R> & Equal.Equal, Schema.SchemaError | E, R1 | R2>;
|
|
24
23
|
};
|
|
25
24
|
export type MakeQueryResult<E = any, R1 = any, R2 = any> = ReturnType<typeof make<string, any, any, string, ZeroSchema, Record<string, any> | undefined, E, R1, R2>>;
|
|
26
25
|
export declare const stream: <T extends keyof S["tables"] & string, S extends ZeroSchema, R>(zero: Zero<S>, query: ZeroQuery<T, S, R>) => Stream.Stream<QueryResult.QueryResult<R>, never, never>;
|
|
27
26
|
export declare const initialValue: <T extends keyof S["tables"] & string, S extends ZeroSchema, R>(query: ZeroQuery<T, S, R>) => QueryResult.QueryResult<R>;
|
|
28
|
-
export declare const subscribable: <T extends keyof S["tables"] & string, S extends ZeroSchema, R>(zero: Zero<S>, query: ZeroQuery<T, S, R>) => Subscribable.Subscribable<QueryResult.QueryResult<R>, never, never>;
|
|
29
27
|
export {};
|
|
30
28
|
//# sourceMappingURL=query.d.ts.map
|
package/dist/query.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../src/query.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAiB,iBAAiB,EAAE,IAAI,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAEvH,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../src/query.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAiB,iBAAiB,EAAE,IAAI,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAEvH,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,cA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,CAAC,GAAG,SAAS,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,CAC9F,CAAC;AAEF,eAAO,MAAM,MAAM,GAAI,CAAC,SAAS,MAAM,CAAC,CAAC,QAAQ,CAAC,GAAG,MAAM,EAAE,CAAC,SAAS,UAAU,EAAE,CAAC,EAClF,MAAM,IAAI,CAAC,CAAC,CAAC,EACb,OAAO,SAAS,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,4DA6BH,CAAC;AAEzB,eAAO,MAAM,YAAY,GAAI,CAAC,SAAS,MAAM,CAAC,CAAC,QAAQ,CAAC,GAAG,MAAM,EAAE,CAAC,SAAS,UAAU,EAAE,CAAC,EACxF,OAAO,SAAS,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,+BAC0D,CAAC"}
|
package/dist/query.js
CHANGED
|
@@ -3,9 +3,9 @@ import * as Effect from "effect/Effect";
|
|
|
3
3
|
import * as Equal from "effect/Equal";
|
|
4
4
|
import * as Hash from "effect/Hash";
|
|
5
5
|
import * as Match from "effect/Match";
|
|
6
|
+
import * as Queue from "effect/Queue";
|
|
6
7
|
import * as Schema from "effect/Schema";
|
|
7
8
|
import * as Stream from "effect/Stream";
|
|
8
|
-
import * as Subscribable from "effect/Subscribable";
|
|
9
9
|
import * as QueryResult from "./internal/query-result.js";
|
|
10
10
|
import { prefixId } from "./internal/utils.js";
|
|
11
11
|
import { deepClone, getDefaultSnapshot, getSnapshot } from "./snapshot.js";
|
|
@@ -14,8 +14,8 @@ export const QueryNameSymbol = Symbol.for(prefixId("QueryName"));
|
|
|
14
14
|
export const make = (options) => {
|
|
15
15
|
const runQuery = Effect.fn(function* (args) {
|
|
16
16
|
const { encoded, decoded } = yield* Match.valueTags(args, {
|
|
17
|
-
Encoded: ({ args: encoded }) => Effect.map(Schema.
|
|
18
|
-
Decoded: ({ args: decoded }) => Effect.map(Schema.
|
|
17
|
+
Encoded: ({ args: encoded }) => Effect.map(Schema.decodeEffect(options.payload)(encoded), (decoded) => ({ encoded, decoded })),
|
|
18
|
+
Decoded: ({ args: decoded }) => Effect.map(Schema.encodeEffect(options.payload)(decoded), (encoded) => ({ encoded, decoded })),
|
|
19
19
|
});
|
|
20
20
|
return yield* options.query(decoded).pipe(Effect.map((rawQuery) => {
|
|
21
21
|
const query = asQueryInternals(rawQuery).nameAndArgs(options.name,
|
|
@@ -42,21 +42,15 @@ export const make = (options) => {
|
|
|
42
42
|
};
|
|
43
43
|
export const stream = (zero, query) => Effect.gen(function* () {
|
|
44
44
|
const view = yield* Effect.acquireRelease(Effect.sync(() => zero.materialize(query)), (view) => Effect.sync(() => view.destroy()));
|
|
45
|
-
return Stream.
|
|
45
|
+
return Stream.callback((queue) => Effect.sync(() => view.addListener((...args) => Queue.offerUnsafe(queue, args)))).pipe(Stream.mapEffect(([data, resultType, error]) => Effect.sync(() => {
|
|
46
46
|
// logic here borrowed from: https://github.com/rocicorp/mono/blob/8e0f600fb3a9185facf60cfd4971d260b266690e/packages/zero-react/src/use-query.tsx#L543
|
|
47
47
|
const cloned = data === undefined ? data : deepClone(data);
|
|
48
48
|
return getSnapshot(asQueryInternals(query).format.singular, cloned, resultType,
|
|
49
49
|
// TODO: Look into this. It seems like this is difficult but not impossible to model in the Effect paradigm.
|
|
50
50
|
// Likely need some kind of stateful piece between the publisher and and subscriber, allowing the subscriber to swap out
|
|
51
51
|
// the publisher when this function is called.
|
|
52
|
-
() => Effect.
|
|
52
|
+
() => Effect.die("retry not available in `effect-zero`"), error);
|
|
53
53
|
})), Stream.map(QueryResult.make));
|
|
54
|
-
}).pipe(Stream.
|
|
54
|
+
}).pipe(Stream.unwrap);
|
|
55
55
|
export const initialValue = (query) => QueryResult.make(getDefaultSnapshot(asQueryInternals(query).format.singular));
|
|
56
|
-
export const subscribable = (zero, query) => {
|
|
57
|
-
return Subscribable.make({
|
|
58
|
-
get: Effect.promise(() => zero.run(query, { type: "unknown" })).pipe(Effect.map((value) => ({ _tag: "Partial", value }))),
|
|
59
|
-
changes: stream(zero, query),
|
|
60
|
-
});
|
|
61
|
-
};
|
|
62
56
|
//# sourceMappingURL=query.js.map
|
package/dist/query.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query.js","sourceRoot":"","sources":["../src/query.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,IAAI,MAAM,aAAa,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"query.js","sourceRoot":"","sources":["../src/query.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,IAAI,MAAM,aAAa,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,WAAW,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAK3E,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC;AAC/D,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC;AAEjE,MAAM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AW,CAAC,CAAC,GAAG,IAAI,EAAE,EAAE,CAAC,KAAK,CAAC,WAAW,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,CACjF,CAAC,IAAI,CACJ,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,EAAE,UAAU,EAAE,KAAK,CAAC,EAAE,EAAE,CAC7C,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE;QACf,sJAAsJ;QACtJ,MAAM,MAAM,GAAG,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAE,SAAS,CAAC,IAAyB,CAAsB,CAAC;QACtG,OAAO,WAAW,CAChB,gBAAgB,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,QAAQ,EACvC,MAAM,EACN,UAAU;QACV,4GAA4G;QAC5G,wHAAwH;QACxH,8CAA8C;QAC9C,GAAG,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,sCAAsC,CAAC,EACxD,KAAK,CACN,CAAC;IACJ,CAAC,CAAC,CACH,EACD,MAAM,CAAC,GAAG,CAAC,WAAW,CAAC,IAAI,CAAC,CAC7B,CAAC;AACJ,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;AAEzB,MAAM,CAAC,MAAM,YAAY,GAAG,CAC1B,KAAyB,EACzB,EAAE,CAAC,WAAW,CAAC,IAAI,CAAI,kBAAkB,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC"}
|
package/dist/result.d.ts
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { Result as AtomResult } from "@effect-atom/atom";
|
|
2
1
|
import type { HumanReadable } from "@rocicorp/zero";
|
|
3
2
|
import * as Cause from "effect/Cause";
|
|
3
|
+
import { AsyncResult } from "effect/unstable/reactivity";
|
|
4
4
|
import type { QueryResult } from "./internal/query-result.js";
|
|
5
|
-
export type Result<A, E = never> =
|
|
5
|
+
export type Result<A, E = never> = AsyncResult.AsyncResult<QueryResult.Partial<A> | QueryResult.Complete<A>, E | QueryError>;
|
|
6
6
|
export declare namespace Result {
|
|
7
|
-
type Initial<A, E = never> =
|
|
8
|
-
type Failure<A, E = never> =
|
|
9
|
-
type Success<A, E = never> =
|
|
10
|
-
type Partial<A, E = never> =
|
|
11
|
-
type Complete<A, E = never> =
|
|
7
|
+
type Initial<A, E = never> = AsyncResult.Initial<QueryResult.Partial<A> | QueryResult.Complete<A>, E | QueryError>;
|
|
8
|
+
type Failure<A, E = never> = AsyncResult.Failure<QueryResult.Partial<A> | QueryResult.Complete<A>, E | QueryError>;
|
|
9
|
+
type Success<A, E = never> = AsyncResult.Success<QueryResult.Partial<A> | QueryResult.Complete<A>, E | QueryError>;
|
|
10
|
+
type Partial<A, E = never> = AsyncResult.Success<QueryResult.Partial<A>, E | QueryError>;
|
|
11
|
+
type Complete<A, E = never> = AsyncResult.Success<QueryResult.Complete<A>, E | QueryError>;
|
|
12
12
|
}
|
|
13
|
-
declare const QueryError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").
|
|
13
|
+
declare const QueryError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => Cause.YieldableError & {
|
|
14
14
|
readonly _tag: "QueryError";
|
|
15
15
|
} & Readonly<A>;
|
|
16
16
|
export declare class QueryError extends QueryError_base<{
|
|
17
17
|
readonly details: QueryResult.Error["details"];
|
|
18
18
|
}> {
|
|
19
19
|
}
|
|
20
|
-
export declare const make: <A, E>(value:
|
|
20
|
+
export declare const make: <A, E>(value: AsyncResult.AsyncResult<QueryResult<A>, E>) => Result<A, E>;
|
|
21
21
|
export declare const match: {
|
|
22
22
|
<A, E, W, X, Y, Z>(options: {
|
|
23
23
|
readonly onInitial: (_: Result.Initial<A, E>) => W;
|
|
@@ -33,12 +33,12 @@ export declare const match: {
|
|
|
33
33
|
}): W | X | Y | Z;
|
|
34
34
|
};
|
|
35
35
|
export declare const mapSuccess: {
|
|
36
|
-
<A, B>(f: (value: A) => B): <E = never>(self:
|
|
37
|
-
<A, B, E = never>(self:
|
|
36
|
+
<A, B>(f: (value: A) => B): <E = never>(self: AsyncResult.Success<A, E>) => AsyncResult.Success<B, E>;
|
|
37
|
+
<A, B, E = never>(self: AsyncResult.Success<A, E>, f: (value: A) => B): AsyncResult.Success<B, E>;
|
|
38
38
|
};
|
|
39
39
|
export declare const acceptPartialWith: {
|
|
40
|
-
<A, E = never>(self: Result<A, E>, predicate: (value: HumanReadable<A>) => boolean):
|
|
41
|
-
<A, E = never>(self: Result<A, E>): (predicate: (value: HumanReadable<A>) => boolean) =>
|
|
40
|
+
<A, E = never>(self: Result<A, E>, predicate: (value: HumanReadable<A>) => boolean): AsyncResult.Initial<HumanReadable<A>, E> | AsyncResult.Success<HumanReadable<A>, QueryError | E> | AsyncResult.Failure<HumanReadable<A>, QueryError | E>;
|
|
41
|
+
<A, E = never>(self: Result<A, E>): (predicate: (value: HumanReadable<A>) => boolean) => AsyncResult.Initial<HumanReadable<A>, E> | AsyncResult.Success<HumanReadable<A>, QueryError | E> | AsyncResult.Failure<HumanReadable<A>, QueryError | E>;
|
|
42
42
|
};
|
|
43
43
|
export type AcceptPartialMode = "waitForServer" | "acceptCached";
|
|
44
44
|
export declare const acceptPartialMode: {
|
|
@@ -53,7 +53,7 @@ export declare const acceptPartialMode: {
|
|
|
53
53
|
* - When you want to wait for the server before doing something.
|
|
54
54
|
* - Only used for queries in which you need an fully accurate result before doing something.
|
|
55
55
|
**/
|
|
56
|
-
mode: AcceptPartialMode):
|
|
56
|
+
mode: AcceptPartialMode): AsyncResult.Initial<HumanReadable<A>, E> | AsyncResult.Success<HumanReadable<A>, QueryError | E> | AsyncResult.Failure<HumanReadable<A>, QueryError | E>;
|
|
57
57
|
<A, E>(
|
|
58
58
|
/**
|
|
59
59
|
* - `acceptCached` -> Will resolve to the partial result if it is available
|
|
@@ -65,7 +65,7 @@ export declare const acceptPartialMode: {
|
|
|
65
65
|
* - When you want to wait for the server before doing something.
|
|
66
66
|
* - Only used for queries in which you need an fully accurate result before doing something.
|
|
67
67
|
**/
|
|
68
|
-
mode: AcceptPartialMode): (self: Result<A, E>) =>
|
|
68
|
+
mode: AcceptPartialMode): (self: Result<A, E>) => AsyncResult.Initial<HumanReadable<A>, E> | AsyncResult.Success<HumanReadable<A>, QueryError | E> | AsyncResult.Failure<HumanReadable<A>, QueryError | E>;
|
|
69
69
|
};
|
|
70
70
|
export {};
|
|
71
71
|
//# sourceMappingURL=result.d.ts.map
|
package/dist/result.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"result.d.ts","sourceRoot":"","sources":["../src/result.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"result.d.ts","sourceRoot":"","sources":["../src/result.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAOtC,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAyC9D,MAAM,MAAM,MAAM,CAAC,CAAC,EAAE,CAAC,GAAG,KAAK,IAAI,WAAW,CAAC,WAAW,CACxD,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,WAAW,CAAC,QAAQ,CAAC,CAAC,CAAC,EAChD,CAAC,GAAG,UAAU,CACf,CAAC;AACF,yBAAiB,MAAM,CAAC;IACtB,KAAY,OAAO,CAAC,CAAC,EAAE,CAAC,GAAG,KAAK,IAAI,WAAW,CAAC,OAAO,CACrD,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,WAAW,CAAC,QAAQ,CAAC,CAAC,CAAC,EAChD,CAAC,GAAG,UAAU,CACf,CAAC;IACF,KAAY,OA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CAAC,CAAC,EAAE,UAAU,GAAG,CAAC,CAAC,CAAC;CAoB3D,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG,eAAe,GAAG,cAAc,CAAC;AAEjE,eAAO,MAAM,iBAAiB,EAAE;IAC9B,CAAC,CAAC,EAAE,CAAC,EACH,IAAI,EAAE,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC;IAClB;;;;;;;;;QASI;IACJ,IAAI,EAAE,iBAAiB,GAErB,WAAW,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,GACxC,WAAW,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,UAAU,GAAG,CAAC,CAAC,GACrD,WAAW,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,UAAU,GAAG,CAAC,CAAC,CAAC;IAC1D,CAAC,CAAC,EAAE,CAAC;IACH;;;;;;;;;QASI;IACJ,IAAI,EAAE,iBAAiB,GACtB,CACD,IAAI,EAAE,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,KAEhB,WAAW,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,GACxC,WAAW,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,UAAU,GAAG,CAAC,CAAC,GACrD,WAAW,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,UAAU,GAAG,CAAC,CAAC,CAAC;CAO3D,CAAC"}
|
package/dist/result.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { Result as AtomResult } from "@effect-atom/atom";
|
|
2
1
|
import * as Cause from "effect/Cause";
|
|
3
2
|
import * as Data from "effect/Data";
|
|
4
3
|
import * as Fn from "effect/Function";
|
|
@@ -6,16 +5,17 @@ import * as Match from "effect/Match";
|
|
|
6
5
|
import * as Option from "effect/Option";
|
|
7
6
|
import * as Predicate from "effect/Predicate";
|
|
8
7
|
import * as Struct from "effect/Struct";
|
|
8
|
+
import { AsyncResult } from "effect/unstable/reactivity";
|
|
9
9
|
export class QueryError extends Data.TaggedError("QueryError") {
|
|
10
10
|
}
|
|
11
11
|
export const make = (value) => Match.valueTags(value, {
|
|
12
|
-
Initial: () =>
|
|
12
|
+
Initial: () => AsyncResult.initial(),
|
|
13
13
|
Success: ({ value }) => Match.valueTags(value, {
|
|
14
|
-
Partial: (value) =>
|
|
15
|
-
Complete: (value) =>
|
|
16
|
-
Error: (e) =>
|
|
14
|
+
Partial: (value) => AsyncResult.success(value),
|
|
15
|
+
Complete: (value) => AsyncResult.success(value),
|
|
16
|
+
Error: (e) => AsyncResult.failure(Cause.fail(new QueryError(e))),
|
|
17
17
|
}),
|
|
18
|
-
Failure: (e) =>
|
|
18
|
+
Failure: (e) => AsyncResult.failure(e.cause),
|
|
19
19
|
});
|
|
20
20
|
// based on: https://github.com/tim-smart/effect-atom/blob/04c15cacda42dd230782f52c0e978400793a502c/packages/atom/src/Result.ts#L424
|
|
21
21
|
export const match = Fn.dual(2, (self, options) => Match.valueTags(self, {
|
|
@@ -26,18 +26,18 @@ export const match = Fn.dual(2, (self, options) => Match.valueTags(self, {
|
|
|
26
26
|
Complete: (complete) => options.onComplete(complete),
|
|
27
27
|
}),
|
|
28
28
|
}));
|
|
29
|
-
export const mapSuccess = Fn.dual(2, (self, f) =>
|
|
30
|
-
export const acceptPartialWith = Fn.dual(2, (self, predicate) =>
|
|
29
|
+
export const mapSuccess = Fn.dual(2, (self, f) => AsyncResult.map(self, f));
|
|
30
|
+
export const acceptPartialWith = Fn.dual(2, (self, predicate) => AsyncResult.match(self, {
|
|
31
31
|
onSuccess: (success) => Predicate.isTagged(success.value, "Partial") && !predicate(success.value.value)
|
|
32
|
-
?
|
|
32
|
+
? AsyncResult.initial(success.waiting)
|
|
33
33
|
: mapSuccess(success, Struct.get("value")),
|
|
34
|
-
onFailure: (failure) =>
|
|
34
|
+
onFailure: (failure) => AsyncResult.failure(failure.cause, {
|
|
35
35
|
waiting: failure.waiting,
|
|
36
36
|
previousSuccess: failure.previousSuccess.pipe(Option.flatMap((success) => Predicate.isTagged(success.value, "Partial") && !predicate(success.value.value)
|
|
37
37
|
? Option.none()
|
|
38
38
|
: Option.some(mapSuccess(success, Struct.get("value"))))),
|
|
39
39
|
}),
|
|
40
|
-
onInitial: (initial) =>
|
|
40
|
+
onInitial: (initial) => AsyncResult.initial(initial.waiting),
|
|
41
41
|
}));
|
|
42
42
|
export const acceptPartialMode = Fn.dual(2, (self, mode) => Match.value(mode).pipe(Match.when("waitForServer", () => acceptPartialWith(self, () => false)), Match.when("acceptCached", () => acceptPartialWith(self, (v) => v !== undefined)), Match.exhaustive));
|
|
43
43
|
//# sourceMappingURL=result.js.map
|
package/dist/result.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"result.js","sourceRoot":"","sources":["../src/result.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"result.js","sourceRoot":"","sources":["../src/result.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,IAAI,MAAM,aAAa,CAAC;AACpC,OAAO,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACtC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,SAAS,MAAM,kBAAkB,CAAC;AAC9C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAiEzD,MAAM,OAAO,UAAW,SAAQ,IAAI,CAAC,WAAW,CAAC,YAAY,CAE3D;CAAG;AAEL,MAAM,CAAC,MAAM,IAAI,GAAG,CAAO,KAAiD,EAAgB,EAAE,CAC5F,KAAK,CAAC,SAAS,CAAC,KAAK,EAAE;IACrB,OAAO,EAAE,GAAG,EAAE,CAAC,WAAW,CAAC,OAAO,EA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AO,CAAC;CAC7D,CAAC,CACH,CAAC;AAIF,MAAM,CAAC,MAAM,iBAAiB,GAoC1B,EAAE,CAAC,IAAI,CAAC,CAAC,EAAE,CAAO,IAAkB,EAAE,IAAuB,EAAE,EAAE,CACnE,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,CACpB,KAAK,CAAC,IAAI,CAAC,eAAe,EAAE,GAAG,EAAE,CAAC,iBAAiB,CAAC,IAAI,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,CAAC,EACvE,KAAK,CAAC,IAAI,CAAC,cAAc,EAAE,GAAG,EAAE,CAAC,iBAAiB,CAAC,IAAI,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,SAAS,CAAC,CAAC,EACjF,KAAK,CAAC,UAAU,CACjB,CACF,CAAC"}
|
|
@@ -1,37 +1,164 @@
|
|
|
1
|
-
import type { Schema as ZeroSchema, ServerTransaction as ZeroServerTransaction
|
|
1
|
+
import type { Schema as ZeroSchema, ServerTransaction as ZeroServerTransaction } from "@rocicorp/zero";
|
|
2
2
|
import type { TransactionProviderHooks, ZQLDatabase } from "@rocicorp/zero/server";
|
|
3
3
|
import * as Cause from "effect/Cause";
|
|
4
|
-
import * as
|
|
4
|
+
import * as Ctx from "effect/Context";
|
|
5
5
|
import * as Effect from "effect/Effect";
|
|
6
|
+
import type { NodeInspectSymbol } from "effect/Inspectable";
|
|
6
7
|
import type * as ClientTransaction from "./client-transaction.js";
|
|
7
|
-
import { MutationAlreadyProcessedError, OutOfOrderMutationError,
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
8
|
+
import { MutationAlreadyProcessedError, OutOfOrderMutationError, ServerTransactionInput } from "./internal/server.js";
|
|
9
|
+
import * as ServerSynchronizationContext from "./internal/server-synchronization-context.js";
|
|
10
|
+
export type Context<TSchema extends ZeroSchema, TTransaction> = ReturnType<typeof make<any, TSchema, TTransaction>>;
|
|
11
|
+
export declare const make: <const Id extends string, TSchema extends ZeroSchema, TTransaction>(id: Id, database: ZQLDatabase<TSchema, TTransaction>, clientTransaction: ClientTransaction.Context<TSchema>) => {
|
|
12
|
+
Context: {
|
|
13
|
+
new (_: never): {
|
|
14
|
+
readonly Service: {
|
|
15
|
+
transaction: ZeroServerTransaction<TSchema, TTransaction>;
|
|
16
|
+
transactionHooks: TransactionProviderHooks;
|
|
17
|
+
};
|
|
18
|
+
readonly key: `${string}/ServerTransactionContext`;
|
|
19
|
+
readonly "~effect/Context/Service": typeof Ctx.ServiceTypeId;
|
|
20
|
+
};
|
|
21
|
+
readonly key: `${string}/ServerTransactionContext`;
|
|
22
|
+
of(this: void, self: {
|
|
23
|
+
transaction: ZeroServerTransaction<TSchema, TTransaction>;
|
|
24
|
+
transactionHooks: TransactionProviderHooks;
|
|
25
|
+
}): {
|
|
26
|
+
transaction: ZeroServerTransaction<TSchema, TTransaction>;
|
|
27
|
+
transactionHooks: TransactionProviderHooks;
|
|
28
|
+
};
|
|
29
|
+
context(self: {
|
|
30
|
+
transaction: ZeroServerTransaction<TSchema, TTransaction>;
|
|
31
|
+
transactionHooks: TransactionProviderHooks;
|
|
32
|
+
}): Ctx.Context<{
|
|
33
|
+
readonly Service: {
|
|
34
|
+
transaction: ZeroServerTransaction<TSchema, TTransaction>;
|
|
35
|
+
transactionHooks: TransactionProviderHooks;
|
|
36
|
+
};
|
|
37
|
+
readonly key: `${string}/ServerTransactionContext`;
|
|
38
|
+
readonly "~effect/Context/Service": typeof Ctx.ServiceTypeId;
|
|
39
|
+
}>;
|
|
40
|
+
use<A, E, R>(f: (service: {
|
|
41
|
+
transaction: ZeroServerTransaction<TSchema, TTransaction>;
|
|
42
|
+
transactionHooks: TransactionProviderHooks;
|
|
43
|
+
}) => Effect.Effect<A, E, R>): Effect.Effect<A, E, {
|
|
44
|
+
readonly Service: {
|
|
45
|
+
transaction: ZeroServerTransaction<TSchema, TTransaction>;
|
|
46
|
+
transactionHooks: TransactionProviderHooks;
|
|
47
|
+
};
|
|
48
|
+
readonly key: `${string}/ServerTransactionContext`;
|
|
49
|
+
readonly "~effect/Context/Service": typeof Ctx.ServiceTypeId;
|
|
50
|
+
} | R>;
|
|
51
|
+
useSync<A>(f: (service: {
|
|
52
|
+
transaction: ZeroServerTransaction<TSchema, TTransaction>;
|
|
53
|
+
transactionHooks: TransactionProviderHooks;
|
|
54
|
+
}) => A): Effect.Effect<A, never, {
|
|
55
|
+
readonly Service: {
|
|
56
|
+
transaction: ZeroServerTransaction<TSchema, TTransaction>;
|
|
57
|
+
transactionHooks: TransactionProviderHooks;
|
|
58
|
+
};
|
|
59
|
+
readonly key: `${string}/ServerTransactionContext`;
|
|
60
|
+
readonly "~effect/Context/Service": typeof Ctx.ServiceTypeId;
|
|
61
|
+
}>;
|
|
62
|
+
readonly Identifier: {
|
|
63
|
+
readonly Service: {
|
|
64
|
+
transaction: ZeroServerTransaction<TSchema, TTransaction>;
|
|
65
|
+
transactionHooks: TransactionProviderHooks;
|
|
66
|
+
};
|
|
67
|
+
readonly key: `${string}/ServerTransactionContext`;
|
|
68
|
+
readonly "~effect/Context/Service": typeof Ctx.ServiceTypeId;
|
|
69
|
+
};
|
|
70
|
+
readonly Service: {
|
|
71
|
+
transaction: ZeroServerTransaction<TSchema, TTransaction>;
|
|
72
|
+
transactionHooks: TransactionProviderHooks;
|
|
73
|
+
};
|
|
74
|
+
readonly stack?: string | undefined;
|
|
75
|
+
asEffect(): Effect.Effect<{
|
|
76
|
+
transaction: ZeroServerTransaction<TSchema, TTransaction>;
|
|
77
|
+
transactionHooks: TransactionProviderHooks;
|
|
78
|
+
}, never, {
|
|
79
|
+
readonly Service: {
|
|
80
|
+
transaction: ZeroServerTransaction<TSchema, TTransaction>;
|
|
81
|
+
transactionHooks: TransactionProviderHooks;
|
|
82
|
+
};
|
|
83
|
+
readonly key: `${string}/ServerTransactionContext`;
|
|
84
|
+
readonly "~effect/Context/Service": typeof Ctx.ServiceTypeId;
|
|
85
|
+
}>;
|
|
86
|
+
readonly "~effect/Context/Service": Ctx.ServiceTypeId;
|
|
87
|
+
pipe<A>(this: A): A;
|
|
88
|
+
pipe<A, B = never>(this: A, ab: (_: A) => B): B;
|
|
89
|
+
pipe<A, B_1 = never, C = never>(this: A, ab: (_: A) => B_1, bc: (_: B_1) => C): C;
|
|
90
|
+
pipe<A, B_2 = never, C_1 = never, D = never>(this: A, ab: (_: A) => B_2, bc: (_: B_2) => C_1, cd: (_: C_1) => D): D;
|
|
91
|
+
pipe<A, B_3 = never, C_2 = never, D_1 = never, E_1 = never>(this: A, ab: (_: A) => B_3, bc: (_: B_3) => C_2, cd: (_: C_2) => D_1, de: (_: D_1) => E_1): E_1;
|
|
92
|
+
pipe<A, B_4 = never, C_3 = never, D_2 = never, E_2 = never, F = never>(this: A, ab: (_: A) => B_4, bc: (_: B_4) => C_3, cd: (_: C_3) => D_2, de: (_: D_2) => E_2, ef: (_: E_2) => F): F;
|
|
93
|
+
pipe<A, B_5 = never, C_4 = never, D_3 = never, E_3 = never, F_1 = never, G = never>(this: A, ab: (_: A) => B_5, bc: (_: B_5) => C_4, cd: (_: C_4) => D_3, de: (_: D_3) => E_3, ef: (_: E_3) => F_1, fg: (_: F_1) => G): G;
|
|
94
|
+
pipe<A, B_6 = never, C_5 = never, D_4 = never, E_4 = never, F_2 = never, G_1 = never, H = never>(this: A, ab: (_: A) => B_6, bc: (_: B_6) => C_5, cd: (_: C_5) => D_4, de: (_: D_4) => E_4, ef: (_: E_4) => F_2, fg: (_: F_2) => G_1, gh: (_: G_1) => H): H;
|
|
95
|
+
pipe<A, B_7 = never, C_6 = never, D_5 = never, E_5 = never, F_3 = never, G_2 = never, H_1 = never, I = never>(this: A, ab: (_: A) => B_7, bc: (_: B_7) => C_6, cd: (_: C_6) => D_5, de: (_: D_5) => E_5, ef: (_: E_5) => F_3, fg: (_: F_3) => G_2, gh: (_: G_2) => H_1, hi: (_: H_1) => I): I;
|
|
96
|
+
pipe<A, B_8 = never, C_7 = never, D_6 = never, E_6 = never, F_4 = never, G_3 = never, H_2 = never, I_1 = never, J = never>(this: A, ab: (_: A) => B_8, bc: (_: B_8) => C_7, cd: (_: C_7) => D_6, de: (_: D_6) => E_6, ef: (_: E_6) => F_4, fg: (_: F_4) => G_3, gh: (_: G_3) => H_2, hi: (_: H_2) => I_1, ij: (_: I_1) => J): J;
|
|
97
|
+
pipe<A, B_9 = never, C_8 = never, D_7 = never, E_7 = never, F_5 = never, G_4 = never, H_3 = never, I_2 = never, J_1 = never, K = never>(this: A, ab: (_: A) => B_9, bc: (_: B_9) => C_8, cd: (_: C_8) => D_7, de: (_: D_7) => E_7, ef: (_: E_7) => F_5, fg: (_: F_5) => G_4, gh: (_: G_4) => H_3, hi: (_: H_3) => I_2, ij: (_: I_2) => J_1, jk: (_: J_1) => K): K;
|
|
98
|
+
pipe<A, B_10 = never, C_9 = never, D_8 = never, E_8 = never, F_6 = never, G_5 = never, H_4 = never, I_3 = never, J_2 = never, K_1 = never, L = never>(this: A, ab: (_: A) => B_10, bc: (_: B_10) => C_9, cd: (_: C_9) => D_8, de: (_: D_8) => E_8, ef: (_: E_8) => F_6, fg: (_: F_6) => G_5, gh: (_: G_5) => H_4, hi: (_: H_4) => I_3, ij: (_: I_3) => J_2, jk: (_: J_2) => K_1, kl: (_: K_1) => L): L;
|
|
99
|
+
pipe<A, B_11 = never, C_10 = never, D_9 = never, E_9 = never, F_7 = never, G_6 = never, H_5 = never, I_4 = never, J_3 = never, K_2 = never, L_1 = never, M = never>(this: A, ab: (_: A) => B_11, bc: (_: B_11) => C_10, cd: (_: C_10) => D_9, de: (_: D_9) => E_9, ef: (_: E_9) => F_7, fg: (_: F_7) => G_6, gh: (_: G_6) => H_5, hi: (_: H_5) => I_4, ij: (_: I_4) => J_3, jk: (_: J_3) => K_2, kl: (_: K_2) => L_1, lm: (_: L_1) => M): M;
|
|
100
|
+
pipe<A, B_12 = never, C_11 = never, D_10 = never, E_10 = never, F_8 = never, G_7 = never, H_6 = never, I_5 = never, J_4 = never, K_3 = never, L_2 = never, M_1 = never, N = never>(this: A, ab: (_: A) => B_12, bc: (_: B_12) => C_11, cd: (_: C_11) => D_10, de: (_: D_10) => E_10, ef: (_: E_10) => F_8, fg: (_: F_8) => G_7, gh: (_: G_7) => H_6, hi: (_: H_6) => I_5, ij: (_: I_5) => J_4, jk: (_: J_4) => K_3, kl: (_: K_3) => L_2, lm: (_: L_2) => M_1, mn: (_: M_1) => N): N;
|
|
101
|
+
pipe<A, B_13 = never, C_12 = never, D_11 = never, E_11 = never, F_9 = never, G_8 = never, H_7 = never, I_6 = never, J_5 = never, K_4 = never, L_3 = never, M_2 = never, N_1 = never, O = never>(this: A, ab: (_: A) => B_13, bc: (_: B_13) => C_12, cd: (_: C_12) => D_11, de: (_: D_11) => E_11, ef: (_: E_11) => F_9, fg: (_: F_9) => G_8, gh: (_: G_8) => H_7, hi: (_: H_7) => I_6, ij: (_: I_6) => J_5, jk: (_: J_5) => K_4, kl: (_: K_4) => L_3, lm: (_: L_3) => M_2, mn: (_: M_2) => N_1, no: (_: N_1) => O): O;
|
|
102
|
+
pipe<A, B_14 = never, C_13 = never, D_12 = never, E_12 = never, F_10 = never, G_9 = never, H_8 = never, I_7 = never, J_6 = never, K_5 = never, L_4 = never, M_3 = never, N_2 = never, O_1 = never, P = never>(this: A, ab: (_: A) => B_14, bc: (_: B_14) => C_13, cd: (_: C_13) => D_12, de: (_: D_12) => E_12, ef: (_: E_12) => F_10, fg: (_: F_10) => G_9, gh: (_: G_9) => H_8, hi: (_: H_8) => I_7, ij: (_: I_7) => J_6, jk: (_: J_6) => K_5, kl: (_: K_5) => L_4, lm: (_: L_4) => M_3, mn: (_: M_3) => N_2, no: (_: N_2) => O_1, op: (_: O_1) => P): P;
|
|
103
|
+
pipe<A, B_15 = never, C_14 = never, D_13 = never, E_13 = never, F_11 = never, G_10 = never, H_9 = never, I_8 = never, J_7 = never, K_6 = never, L_5 = never, M_4 = never, N_3 = never, O_2 = never, P_1 = never, Q = never>(this: A, ab: (_: A) => B_15, bc: (_: B_15) => C_14, cd: (_: C_14) => D_13, de: (_: D_13) => E_13, ef: (_: E_13) => F_11, fg: (_: F_11) => G_10, gh: (_: G_10) => H_9, hi: (_: H_9) => I_8, ij: (_: I_8) => J_7, jk: (_: J_7) => K_6, kl: (_: K_6) => L_5, lm: (_: L_5) => M_4, mn: (_: M_4) => N_3, no: (_: N_3) => O_2, op: (_: O_2) => P_1, pq: (_: P_1) => Q): Q;
|
|
104
|
+
pipe<A, B_16 = never, C_15 = never, D_14 = never, E_14 = never, F_12 = never, G_11 = never, H_10 = never, I_9 = never, J_8 = never, K_7 = never, L_6 = never, M_5 = never, N_4 = never, O_3 = never, P_2 = never, Q_1 = never, R_1 = never>(this: A, ab: (_: A) => B_16, bc: (_: B_16) => C_15, cd: (_: C_15) => D_14, de: (_: D_14) => E_14, ef: (_: E_14) => F_12, fg: (_: F_12) => G_11, gh: (_: G_11) => H_10, hi: (_: H_10) => I_9, ij: (_: I_9) => J_8, jk: (_: J_8) => K_7, kl: (_: K_7) => L_6, lm: (_: L_6) => M_5, mn: (_: M_5) => N_4, no: (_: N_4) => O_3, op: (_: O_3) => P_2, pq: (_: P_2) => Q_1, qr: (_: Q_1) => R_1): R_1;
|
|
105
|
+
pipe<A, B_17 = never, C_16 = never, D_15 = never, E_15 = never, F_13 = never, G_12 = never, H_11 = never, I_10 = never, J_9 = never, K_8 = never, L_7 = never, M_6 = never, N_5 = never, O_4 = never, P_3 = never, Q_2 = never, R_2 = never, S = never>(this: A, ab: (_: A) => B_17, bc: (_: B_17) => C_16, cd: (_: C_16) => D_15, de: (_: D_15) => E_15, ef: (_: E_15) => F_13, fg: (_: F_13) => G_12, gh: (_: G_12) => H_11, hi: (_: H_11) => I_10, ij: (_: I_10) => J_9, jk: (_: J_9) => K_8, kl: (_: K_8) => L_7, lm: (_: L_7) => M_6, mn: (_: M_6) => N_5, no: (_: N_5) => O_4, op: (_: O_4) => P_3, pq: (_: P_3) => Q_2, qr: (_: Q_2) => R_2, rs: (_: R_2) => S): S;
|
|
106
|
+
pipe<A, B_18 = never, C_17 = never, D_16 = never, E_16 = never, F_14 = never, G_13 = never, H_12 = never, I_11 = never, J_10 = never, K_9 = never, L_8 = never, M_7 = never, N_6 = never, O_5 = never, P_4 = never, Q_3 = never, R_3 = never, S_1 = never, T = never>(this: A, ab: (_: A) => B_18, bc: (_: B_18) => C_17, cd: (_: C_17) => D_16, de: (_: D_16) => E_16, ef: (_: E_16) => F_14, fg: (_: F_14) => G_13, gh: (_: G_13) => H_12, hi: (_: H_12) => I_11, ij: (_: I_11) => J_10, jk: (_: J_10) => K_9, kl: (_: K_9) => L_8, lm: (_: L_8) => M_7, mn: (_: M_7) => N_6, no: (_: N_6) => O_5, op: (_: O_5) => P_4, pq: (_: P_4) => Q_3, qr: (_: Q_3) => R_3, rs: (_: R_3) => S_1, st: (_: S_1) => T): T;
|
|
107
|
+
pipe<A, B_19 = never, C_18 = never, D_17 = never, E_17 = never, F_15 = never, G_14 = never, H_13 = never, I_12 = never, J_11 = never, K_10 = never, L_9 = never, M_8 = never, N_7 = never, O_6 = never, P_5 = never, Q_4 = never, R_4 = never, S_2 = never, T_1 = never, U = never>(this: A, ab: (_: A) => B_19, bc: (_: B_19) => C_18, cd: (_: C_18) => D_17, de: (_: D_17) => E_17, ef: (_: E_17) => F_15, fg: (_: F_15) => G_14, gh: (_: G_14) => H_13, hi: (_: H_13) => I_12, ij: (_: I_12) => J_11, jk: (_: J_11) => K_10, kl: (_: K_10) => L_9, lm: (_: L_9) => M_8, mn: (_: M_8) => N_7, no: (_: N_7) => O_6, op: (_: O_6) => P_5, pq: (_: P_5) => Q_4, qr: (_: Q_4) => R_4, rs: (_: R_4) => S_2, st: (_: S_2) => T_1, tu: (_: T_1) => U): U;
|
|
108
|
+
pipe<A, B_20 = never, C_19 = never, D_18 = never, E_18 = never, F_16 = never, G_15 = never, H_14 = never, I_13 = never, J_12 = never, K_11 = never, L_10 = never, M_9 = never, N_8 = never, O_7 = never, P_6 = never, Q_5 = never, R_5 = never, S_3 = never, T_2 = never, U_1 = never>(this: A, ab: (_: A) => B_20, bc: (_: B_20) => C_19, cd: (_: C_19) => D_18, de: (_: D_18) => E_18, ef: (_: E_18) => F_16, fg: (_: F_16) => G_15, gh: (_: G_15) => H_14, hi: (_: H_14) => I_13, ij: (_: I_13) => J_12, jk: (_: J_12) => K_11, kl: (_: K_11) => L_10, lm: (_: L_10) => M_9, mn: (_: M_9) => N_8, no: (_: N_8) => O_7, op: (_: O_7) => P_6, pq: (_: P_6) => Q_5, qr: (_: Q_5) => R_5, rs: (_: R_5) => S_3, st: (_: S_3) => T_2, tu: (_: T_2) => U_1): U_1;
|
|
109
|
+
toString(): string;
|
|
110
|
+
toJSON(): unknown;
|
|
111
|
+
[NodeInspectSymbol](): unknown;
|
|
112
|
+
[Symbol.iterator](): Effect.EffectIterator<Ctx.Service<{
|
|
113
|
+
readonly Service: {
|
|
114
|
+
transaction: ZeroServerTransaction<TSchema, TTransaction>;
|
|
115
|
+
transactionHooks: TransactionProviderHooks;
|
|
116
|
+
};
|
|
117
|
+
readonly key: `${string}/ServerTransactionContext`;
|
|
118
|
+
readonly "~effect/Context/Service": typeof Ctx.ServiceTypeId;
|
|
119
|
+
}, {
|
|
120
|
+
transaction: ZeroServerTransaction<TSchema, TTransaction>;
|
|
121
|
+
transactionHooks: TransactionProviderHooks;
|
|
122
|
+
}>>;
|
|
123
|
+
};
|
|
15
124
|
use: <A>(fn: (transaction: ZeroServerTransaction<TSchema, TTransaction>, options: {
|
|
16
125
|
readonly signal: AbortSignal;
|
|
17
|
-
}) => PromiseLike<A>) => Effect.Effect<A, ServerTransactionError,
|
|
18
|
-
|
|
126
|
+
}) => PromiseLike<A>) => Effect.Effect<A, ServerTransactionError, {
|
|
127
|
+
readonly Service: {
|
|
128
|
+
transaction: ZeroServerTransaction<TSchema, TTransaction>;
|
|
129
|
+
transactionHooks: TransactionProviderHooks;
|
|
130
|
+
};
|
|
131
|
+
readonly key: `${string}/ServerTransactionContext`;
|
|
132
|
+
readonly "~effect/Context/Service": typeof Ctx.ServiceTypeId;
|
|
133
|
+
}>;
|
|
134
|
+
execute: <A, E_19, R_6>(effect: Effect.Effect<A, E_19, R_6>) => Effect.Effect<A, import("./internal/server.js").MultipleTransactionsError | OutOfOrderMutationError | MutationAlreadyProcessedError | E_19 | UpdateClientMutationIdError | ZeroDatabaseError, ServerTransactionInput | ServerSynchronizationContext.ServerSynchronizationContext | Exclude<R_6, {
|
|
135
|
+
readonly Service: {
|
|
136
|
+
transaction: ZeroServerTransaction<TSchema, TTransaction>;
|
|
137
|
+
transactionHooks: TransactionProviderHooks;
|
|
138
|
+
};
|
|
139
|
+
readonly key: `${string}/ServerTransactionContext`;
|
|
140
|
+
readonly "~effect/Context/Service": typeof Ctx.ServiceTypeId;
|
|
141
|
+
} | {
|
|
142
|
+
readonly Service: import("@rocicorp/zero").Transaction<TSchema>;
|
|
143
|
+
readonly key: any;
|
|
144
|
+
readonly "~effect/Context/Service": typeof Ctx.ServiceTypeId;
|
|
145
|
+
}>>;
|
|
19
146
|
};
|
|
20
|
-
declare const ServerTransactionError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").
|
|
147
|
+
declare const ServerTransactionError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => Cause.YieldableError & {
|
|
21
148
|
readonly _tag: "ServerTransactionError";
|
|
22
149
|
} & Readonly<A>;
|
|
23
150
|
declare class ServerTransactionError extends ServerTransactionError_base<{
|
|
24
151
|
readonly cause: Cause.Cause<unknown>;
|
|
25
152
|
}> {
|
|
26
153
|
}
|
|
27
|
-
declare const UpdateClientMutationIdError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").
|
|
154
|
+
declare const UpdateClientMutationIdError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => Cause.YieldableError & {
|
|
28
155
|
readonly _tag: "UpdateClientMutationIdError";
|
|
29
156
|
} & Readonly<A>;
|
|
30
157
|
declare class UpdateClientMutationIdError extends UpdateClientMutationIdError_base<{
|
|
31
158
|
readonly cause: Cause.Cause<unknown>;
|
|
32
159
|
}> {
|
|
33
160
|
}
|
|
34
|
-
declare const ZeroDatabaseError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").
|
|
161
|
+
declare const ZeroDatabaseError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => Cause.YieldableError & {
|
|
35
162
|
readonly _tag: "ZeroDatabaseError";
|
|
36
163
|
} & Readonly<A>;
|
|
37
164
|
declare class ZeroDatabaseError extends ZeroDatabaseError_base<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server-transaction.d.ts","sourceRoot":"","sources":["../src/server-transaction.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"server-transaction.d.ts","sourceRoot":"","sources":["../src/server-transaction.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,IAAI,UAAU,EAAE,iBAAiB,IAAI,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AACvG,OAAO,KAAK,EAAE,wBAAwB,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACnF,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,GAAG,MAAM,gBAAgB,CAAC;AAGtC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAG5D,OAAO,KAAK,KAAK,iBAAiB,MAAM,yBAAyB,CAAC;AAClE,OAAO,EAAE,6BAA6B,EAAE,uBAAuB,EAAE,sBAAsB,EAAE,M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