@rocicorp/zero 0.3.2024102600 → 0.4.2024103000
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/out/chunk-4UHYW2B5.js +16483 -0
- package/out/chunk-4UHYW2B5.js.map +7 -0
- package/out/chunk-ULOTOBTC.js +1 -0
- package/out/internal.js +1 -1
- package/out/react.js +3 -3
- package/out/react.js.map +2 -2
- package/out/shared/src/arrays.d.ts +6 -0
- package/out/shared/src/arrays.d.ts.map +1 -0
- package/out/shared/src/arrays.js +20 -0
- package/out/shared/src/arrays.js.map +1 -0
- package/out/shared/src/iterables.d.ts +1 -0
- package/out/shared/src/iterables.d.ts.map +1 -1
- package/out/shared/src/iterables.js +38 -0
- package/out/shared/src/iterables.js.map +1 -1
- package/out/solid.js +19 -2
- package/out/solid.js.map +3 -3
- package/out/zero/src/advanced.d.ts +2 -0
- package/out/zero/src/advanced.d.ts.map +1 -0
- package/out/{zero-internal → zero-advanced}/src/mod.d.ts +2 -0
- package/out/zero-advanced/src/mod.d.ts.map +1 -0
- package/out/zero-cache/src/config/config-query.d.ts +2 -1
- package/out/zero-cache/src/config/config-query.d.ts.map +1 -1
- package/out/zero-cache/src/config/config-query.js +4 -1
- package/out/zero-cache/src/config/config-query.js.map +1 -1
- package/out/zero-cache/src/config/zero-config.d.ts +76 -76
- package/out/zero-cache/src/server/life-cycle.d.ts +19 -3
- package/out/zero-cache/src/server/life-cycle.d.ts.map +1 -1
- package/out/zero-cache/src/server/life-cycle.js +96 -30
- package/out/zero-cache/src/server/life-cycle.js.map +1 -1
- package/out/zero-cache/src/server/logging.js +2 -2
- package/out/zero-cache/src/server/logging.js.map +1 -1
- package/out/zero-cache/src/server/main.js +9 -16
- package/out/zero-cache/src/server/main.js.map +1 -1
- package/out/zero-cache/src/services/change-streamer/change-streamer-http.d.ts +3 -9
- package/out/zero-cache/src/services/change-streamer/change-streamer-http.d.ts.map +1 -1
- package/out/zero-cache/src/services/change-streamer/change-streamer-http.js +12 -32
- package/out/zero-cache/src/services/change-streamer/change-streamer-http.js.map +1 -1
- package/out/zero-cache/src/services/change-streamer/pg/initial-sync.d.ts.map +1 -1
- package/out/zero-cache/src/services/change-streamer/pg/initial-sync.js +4 -4
- package/out/zero-cache/src/services/change-streamer/pg/initial-sync.js.map +1 -1
- package/out/zero-cache/src/services/change-streamer/pg/schema/ddl.d.ts.map +1 -1
- package/out/zero-cache/src/services/change-streamer/pg/schema/ddl.js +11 -2
- package/out/zero-cache/src/services/change-streamer/pg/schema/ddl.js.map +1 -1
- package/out/zero-cache/src/services/change-streamer/pg/schema/shard.d.ts.map +1 -1
- package/out/zero-cache/src/services/change-streamer/pg/schema/shard.js +4 -3
- package/out/zero-cache/src/services/change-streamer/pg/schema/shard.js.map +1 -1
- package/out/zero-cache/src/services/dispatcher/connect-params.d.ts +2 -1
- package/out/zero-cache/src/services/dispatcher/connect-params.d.ts.map +1 -1
- package/out/zero-cache/src/services/dispatcher/connect-params.js +4 -4
- package/out/zero-cache/src/services/dispatcher/connect-params.js.map +1 -1
- package/out/zero-cache/src/services/dispatcher/dispatcher.d.ts +3 -8
- package/out/zero-cache/src/services/dispatcher/dispatcher.d.ts.map +1 -1
- package/out/zero-cache/src/services/dispatcher/dispatcher.js +8 -23
- package/out/zero-cache/src/services/dispatcher/dispatcher.js.map +1 -1
- package/out/zero-cache/src/services/http-service.d.ts +16 -0
- package/out/zero-cache/src/services/http-service.d.ts.map +1 -0
- package/out/zero-cache/src/services/http-service.js +39 -0
- package/out/zero-cache/src/services/http-service.js.map +1 -0
- package/out/zero-cache/src/services/replicator/incremental-sync.d.ts.map +1 -1
- package/out/zero-cache/src/services/replicator/incremental-sync.js +1 -1
- package/out/zero-cache/src/services/replicator/incremental-sync.js.map +1 -1
- package/out/zero-cache/src/services/view-syncer/cvr.d.ts.map +1 -1
- package/out/zero-cache/src/services/view-syncer/cvr.js +6 -8
- package/out/zero-cache/src/services/view-syncer/cvr.js.map +1 -1
- package/out/zero-cache/src/services/view-syncer/drain-coordinator.d.ts.map +1 -1
- package/out/zero-cache/src/services/view-syncer/drain-coordinator.js +6 -0
- package/out/zero-cache/src/services/view-syncer/drain-coordinator.js.map +1 -1
- package/out/zero-cache/src/services/view-syncer/schema/types.d.ts +10 -10
- package/out/zero-cache/src/services/view-syncer/snapshotter.d.ts.map +1 -1
- package/out/zero-cache/src/services/view-syncer/snapshotter.js +6 -6
- package/out/zero-cache/src/services/view-syncer/snapshotter.js.map +1 -1
- package/out/zero-cache/src/services/view-syncer/view-syncer.js +2 -2
- package/out/zero-cache/src/services/view-syncer/view-syncer.js.map +1 -1
- package/out/zero-cache/src/types/processes.d.ts +1 -0
- package/out/zero-cache/src/types/processes.d.ts.map +1 -1
- package/out/zero-cache/src/types/processes.js +3 -2
- package/out/zero-cache/src/types/processes.js.map +1 -1
- package/out/zero-cache/src/workers/replicator.d.ts +2 -2
- package/out/zero-cache/src/workers/replicator.d.ts.map +1 -1
- package/out/zero-cache/src/workers/replicator.js +5 -1
- package/out/zero-cache/src/workers/replicator.js.map +1 -1
- package/out/zero-cache/src/workers/syncer.d.ts.map +1 -1
- package/out/zero-cache/src/workers/syncer.js +3 -1
- package/out/zero-cache/src/workers/syncer.js.map +1 -1
- package/out/zero-client/src/client/context.d.ts +2 -1
- package/out/zero-client/src/client/context.d.ts.map +1 -1
- package/out/zero-client/src/client/context.js +53 -39
- package/out/zero-client/src/client/context.js.map +1 -1
- package/out/zero-client/src/client/options.d.ts +37 -0
- package/out/zero-client/src/client/options.d.ts.map +1 -1
- package/out/zero-client/src/client/query-manager.d.ts.map +1 -1
- package/out/zero-client/src/client/query-manager.js +2 -5
- package/out/zero-client/src/client/query-manager.js.map +1 -1
- package/out/zero-client/src/client/zero.d.ts +1 -1
- package/out/zero-client/src/client/zero.d.ts.map +1 -1
- package/out/zero-client/src/client/zero.js +28 -10
- package/out/zero-client/src/client/zero.js.map +1 -1
- package/out/zero-client/src/mod.d.ts +1 -0
- package/out/zero-client/src/mod.d.ts.map +1 -1
- package/out/zero-client/src/mod.js +1 -0
- package/out/zero-client/src/mod.js.map +1 -1
- package/out/zero-protocol/src/ast-hash.d.ts +3 -0
- package/out/zero-protocol/src/ast-hash.d.ts.map +1 -0
- package/out/zero-protocol/src/ast-hash.js +14 -0
- package/out/zero-protocol/src/ast-hash.js.map +1 -0
- package/out/zero-protocol/src/ast.d.ts +16 -8
- package/out/zero-protocol/src/ast.d.ts.map +1 -1
- package/out/zero-protocol/src/ast.js +86 -12
- package/out/zero-protocol/src/ast.js.map +1 -1
- package/out/zero-protocol/src/change-desired-queries.d.ts +4 -4
- package/out/zero-protocol/src/connect.d.ts +9 -11
- package/out/zero-protocol/src/connect.d.ts.map +1 -1
- package/out/zero-protocol/src/connect.js +6 -16
- package/out/zero-protocol/src/connect.js.map +1 -1
- package/out/zero-protocol/src/down.d.ts +4 -4
- package/out/zero-protocol/src/poke.d.ts +8 -8
- package/out/zero-protocol/src/queries-patch.d.ts +6 -6
- package/out/zero-protocol/src/up.d.ts +4 -4
- package/out/zero-react/src/use-query.d.ts.map +1 -1
- package/out/zero-solid/src/create-zero.d.ts +3 -0
- package/out/zero-solid/src/create-zero.d.ts.map +1 -0
- package/out/zero-solid/src/mod.d.ts +1 -0
- package/out/zero-solid/src/mod.d.ts.map +1 -1
- package/out/zero-solid/src/solid-view.d.ts +1 -1
- package/out/zero-solid/src/use-query.d.ts +1 -2
- package/out/zero-solid/src/use-query.d.ts.map +1 -1
- package/out/zero.js +24 -16007
- package/out/zero.js.map +4 -4
- package/out/zql/src/zql/builder/builder.d.ts.map +1 -1
- package/out/zql/src/zql/builder/builder.js +49 -8
- package/out/zql/src/zql/builder/builder.js.map +1 -1
- package/out/zql/src/zql/builder/filter.d.ts +2 -2
- package/out/zql/src/zql/builder/filter.d.ts.map +1 -1
- package/out/zql/src/zql/builder/filter.js.map +1 -1
- package/out/zql/src/zql/builder/like.js +1 -1
- package/out/zql/src/zql/builder/like.js.map +1 -1
- package/out/zql/src/zql/ivm/fan-in.d.ts +29 -0
- package/out/zql/src/zql/ivm/fan-in.d.ts.map +1 -0
- package/out/zql/src/zql/ivm/fan-in.js +58 -0
- package/out/zql/src/zql/ivm/fan-in.js.map +1 -0
- package/out/zql/src/zql/ivm/fan-out.d.ts +19 -0
- package/out/zql/src/zql/ivm/fan-out.d.ts.map +1 -0
- package/out/zql/src/zql/ivm/fan-out.js +56 -0
- package/out/zql/src/zql/ivm/fan-out.js.map +1 -0
- package/out/zql/src/zql/ivm/memory-source.d.ts +20 -2
- package/out/zql/src/zql/ivm/memory-source.d.ts.map +1 -1
- package/out/zql/src/zql/ivm/memory-source.js +48 -1
- package/out/zql/src/zql/ivm/memory-source.js.map +1 -1
- package/out/zql/src/zql/ivm/source.d.ts +1 -1
- package/out/zql/src/zql/ivm/source.d.ts.map +1 -1
- package/out/zql/src/zql/query/expression.d.ts +25 -0
- package/out/zql/src/zql/query/expression.d.ts.map +1 -0
- package/out/zql/src/zql/query/expression.js +115 -0
- package/out/zql/src/zql/query/expression.js.map +1 -0
- package/out/zql/src/zql/query/query-impl.d.ts +15 -11
- package/out/zql/src/zql/query/query-impl.d.ts.map +1 -1
- package/out/zql/src/zql/query/query-impl.js +68 -56
- package/out/zql/src/zql/query/query-impl.js.map +1 -1
- package/out/zql/src/zql/query/query-internal.d.ts +11 -0
- package/out/zql/src/zql/query/query-internal.d.ts.map +1 -0
- package/out/zql/src/zql/query/query-internal.js +2 -0
- package/out/zql/src/zql/query/query-internal.js.map +1 -0
- package/out/zql/src/zql/query/query.d.ts +15 -6
- package/out/zql/src/zql/query/query.d.ts.map +1 -1
- package/out/zqlite/src/table-source.d.ts +2 -2
- package/out/zqlite/src/table-source.d.ts.map +1 -1
- package/out/zqlite/src/table-source.js +4 -3
- package/out/zqlite/src/table-source.js.map +1 -1
- package/package.json +4 -4
- package/out/chunk-NKGIR6IA.js +0 -1
- package/out/zero/src/internal.d.ts +0 -2
- package/out/zero/src/internal.d.ts.map +0 -1
- package/out/zero-cache/src/server/task-state-watcher.d.ts +0 -14
- package/out/zero-cache/src/server/task-state-watcher.d.ts.map +0 -1
- package/out/zero-cache/src/server/task-state-watcher.js +0 -75
- package/out/zero-cache/src/server/task-state-watcher.js.map +0 -1
- package/out/zero-internal/src/mod.d.ts.map +0 -1
- /package/out/{chunk-NKGIR6IA.js.map → chunk-ULOTOBTC.js.map} +0 -0
|
@@ -25,7 +25,7 @@ export declare const simpleConditionSchema: v.ObjectType<{
|
|
|
25
25
|
field: v.Type<string>;
|
|
26
26
|
}, undefined>]>;
|
|
27
27
|
}, undefined>;
|
|
28
|
-
export declare const conditionSchema: v.ObjectType<{
|
|
28
|
+
export declare const conditionSchema: v.UnionType<[v.ObjectType<{
|
|
29
29
|
type: v.Type<"simple">;
|
|
30
30
|
op: v.UnionType<[v.UnionType<[v.Type<"=">, v.Type<"!=">]>, v.UnionType<[v.Type<"<">, v.Type<">">, v.Type<"<=">, v.Type<">=">]>, v.UnionType<[v.Type<"LIKE">, v.Type<"NOT LIKE">, v.Type<"ILIKE">, v.Type<"NOT ILIKE">]>, v.UnionType<[v.Type<"IN">, v.Type<"NOT IN">]>]>;
|
|
31
31
|
field: v.Type<string>;
|
|
@@ -34,21 +34,21 @@ export declare const conditionSchema: v.ObjectType<{
|
|
|
34
34
|
anchor: v.UnionType<[v.Type<"authData">, v.Type<"preMutationRow">]>;
|
|
35
35
|
field: v.Type<string>;
|
|
36
36
|
}, undefined>]>;
|
|
37
|
-
}, undefined>;
|
|
38
|
-
export declare const correlatedSubquerySchemaOmitSubquery: v.ObjectType<{
|
|
37
|
+
}, undefined>, v.Type<Conjunction>, v.Type<Disjunction>]>;
|
|
38
|
+
export declare const correlatedSubquerySchemaOmitSubquery: v.ObjectType<Readonly<{
|
|
39
39
|
correlation: v.ObjectType<{
|
|
40
40
|
parentField: v.Type<string>;
|
|
41
41
|
childField: v.Type<string>;
|
|
42
42
|
op: v.Type<"=">;
|
|
43
43
|
}, undefined>;
|
|
44
44
|
hidden: v.Optional<boolean>;
|
|
45
|
-
}
|
|
45
|
+
}>, undefined>;
|
|
46
46
|
export declare const correlatedSubquerySchema: v.Type<CorrelatedSubQuery>;
|
|
47
47
|
export declare const astSchema: v.ObjectType<{
|
|
48
48
|
schema: v.Optional<string>;
|
|
49
49
|
table: v.Type<string>;
|
|
50
50
|
alias: v.Optional<string>;
|
|
51
|
-
where: v.Optional<
|
|
51
|
+
where: v.Optional<{
|
|
52
52
|
type: "simple";
|
|
53
53
|
op: "=" | "!=" | "<" | ">" | "<=" | ">=" | "LIKE" | "NOT LIKE" | "ILIKE" | "NOT ILIKE" | "IN" | "NOT IN";
|
|
54
54
|
field: string;
|
|
@@ -57,7 +57,7 @@ export declare const astSchema: v.ObjectType<{
|
|
|
57
57
|
anchor: "authData" | "preMutationRow";
|
|
58
58
|
field: string;
|
|
59
59
|
};
|
|
60
|
-
}
|
|
60
|
+
} | Conjunction | Disjunction>;
|
|
61
61
|
related: v.Optional<readonly CorrelatedSubQuery[]>;
|
|
62
62
|
limit: v.Optional<number>;
|
|
63
63
|
orderBy: v.Optional<readonly (readonly [string, "asc" | "desc"])[]>;
|
|
@@ -85,7 +85,7 @@ export type AST = {
|
|
|
85
85
|
readonly schema?: string | undefined;
|
|
86
86
|
readonly table: string;
|
|
87
87
|
readonly alias?: string | undefined;
|
|
88
|
-
readonly where?:
|
|
88
|
+
readonly where?: Condition | undefined;
|
|
89
89
|
readonly related?: readonly CorrelatedSubQuery[] | undefined;
|
|
90
90
|
readonly start?: Bound | undefined;
|
|
91
91
|
readonly limit?: number | undefined;
|
|
@@ -111,7 +111,7 @@ export type LiteralValue = string | number | boolean | ReadonlyArray<string | nu
|
|
|
111
111
|
* ivm1 supports Conjunctions and Disjunctions.
|
|
112
112
|
* We'll support them in the future.
|
|
113
113
|
*/
|
|
114
|
-
export type Condition = SimpleCondition;
|
|
114
|
+
export type Condition = SimpleCondition | Conjunction | Disjunction;
|
|
115
115
|
export type SimpleCondition = {
|
|
116
116
|
type: 'simple';
|
|
117
117
|
op: SimpleOperator;
|
|
@@ -127,6 +127,14 @@ export type SimpleCondition = {
|
|
|
127
127
|
*/
|
|
128
128
|
value: ValuePosition;
|
|
129
129
|
};
|
|
130
|
+
export type Conjunction = {
|
|
131
|
+
type: 'and';
|
|
132
|
+
conditions: readonly Condition[];
|
|
133
|
+
};
|
|
134
|
+
export type Disjunction = {
|
|
135
|
+
type: 'or';
|
|
136
|
+
conditions: readonly Condition[];
|
|
137
|
+
};
|
|
130
138
|
/**
|
|
131
139
|
* A parameter is a value that is not known at the time the query is written
|
|
132
140
|
* and is resolved at runtime.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ast.d.ts","sourceRoot":"","sources":["../../../../zero-protocol/src/ast.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,KAAK,CAAC,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"ast.d.ts","sourceRoot":"","sources":["../../../../zero-protocol/src/ast.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,KAAK,CAAC,MAAM,4BAA4B,CAAC;AAEhD,OAAO,KAAK,EAAC,GAAG,EAAC,MAAM,WAAW,CAAC;AAEnC,eAAO,MAAM,cAAc,gBAAa,CAAC;AAMzC,eAAO,MAAM,cAAc,wDAAyC,CAAC;AAErE,eAAO,MAAM,eAAe,8EAK3B,CAAC;AAEF,eAAO,MAAM,iBAAiB,0CAA2C,CAAC;AAE1E,eAAO,MAAM,cAAc,qEAK1B,CAAC;AAEF,eAAO,MAAM,aAAa,yFAKzB,CAAC;AAEF,eAAO,MAAM,WAAW,+CAAgD,CAAC;AAEzE,eAAO,MAAM,oBAAoB,sQAKhC,CAAC;AAEF,eAAO,MAAM,qBAAqB;;;;;;;;;aAehC,CAAC;AAEH,eAAO,MAAM,eAAe;;;;;;;;;yDAI3B,CAAC;AAkBF,eAAO,MAAM,oCAAoC;;;;;;;cAO/C,CAAC;AAEH,eAAO,M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AAgB,CAAC;IACtC,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAGF,wBAAgB,YAAY,CAAC,GAAG,EAAE,GAAG,GAAG,QAAQ,CAAC,GAAG,CAAC,CAkCpD"}
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
import { compareUTF8 } from 'compare-utf8';
|
|
9
9
|
import { must } from '../../shared/src/must.js';
|
|
10
10
|
import * as v from '../../shared/src/valita.js';
|
|
11
|
+
import { defined } from '../../shared/src/arrays.js';
|
|
11
12
|
export const selectorSchema = v.string();
|
|
12
13
|
const orderingElementSchema = v.readonly(v.tuple([selectorSchema, v.union(v.literal('asc'), v.literal('desc'))]));
|
|
13
14
|
export const orderingSchema = v.readonlyArray(orderingElementSchema);
|
|
@@ -27,14 +28,22 @@ export const simpleConditionSchema = v.object({
|
|
|
27
28
|
field: v.string(),
|
|
28
29
|
})),
|
|
29
30
|
});
|
|
30
|
-
export const conditionSchema = simpleConditionSchema;
|
|
31
|
+
export const conditionSchema = v.union(simpleConditionSchema, v.lazy(() => conjunctionSchema), v.lazy(() => disjunctionSchema));
|
|
32
|
+
const conjunctionSchema = v.readonlyObject({
|
|
33
|
+
type: v.literal('and'),
|
|
34
|
+
conditions: v.readonlyArray(conditionSchema),
|
|
35
|
+
});
|
|
36
|
+
const disjunctionSchema = v.readonlyObject({
|
|
37
|
+
type: v.literal('or'),
|
|
38
|
+
conditions: v.readonlyArray(conditionSchema),
|
|
39
|
+
});
|
|
31
40
|
// Split out so that its inferred type can be checked against
|
|
32
41
|
// Omit<CorrelatedSubQuery, 'correlation'> in ast-type-test.ts.
|
|
33
42
|
// The mutually-recursive reference of the 'other' field to astSchema
|
|
34
43
|
// is the only thing added in v.lazy. The v.lazy is necessary due to the
|
|
35
44
|
// mutually-recursive types, but v.lazy prevents inference of the resulting
|
|
36
45
|
// type.
|
|
37
|
-
export const correlatedSubquerySchemaOmitSubquery = v.
|
|
46
|
+
export const correlatedSubquerySchemaOmitSubquery = v.readonlyObject({
|
|
38
47
|
correlation: v.object({
|
|
39
48
|
parentField: v.string(),
|
|
40
49
|
childField: v.string(),
|
|
@@ -49,7 +58,7 @@ export const astSchema = v.object({
|
|
|
49
58
|
schema: v.string().optional(),
|
|
50
59
|
table: v.string(),
|
|
51
60
|
alias: v.string().optional(),
|
|
52
|
-
where:
|
|
61
|
+
where: conditionSchema.optional(),
|
|
53
62
|
related: v.readonlyArray(correlatedSubquerySchema).optional(),
|
|
54
63
|
limit: v.number().optional(),
|
|
55
64
|
orderBy: orderingSchema.optional(),
|
|
@@ -60,12 +69,18 @@ export const astSchema = v.object({
|
|
|
60
69
|
})
|
|
61
70
|
.optional(),
|
|
62
71
|
});
|
|
72
|
+
const normalizeCache = new WeakMap();
|
|
63
73
|
export function normalizeAST(ast) {
|
|
64
|
-
|
|
74
|
+
const cached = normalizeCache.get(ast);
|
|
75
|
+
if (cached) {
|
|
76
|
+
return cached;
|
|
77
|
+
}
|
|
78
|
+
const where = flattened(ast.where);
|
|
79
|
+
const normalized = {
|
|
65
80
|
schema: ast.schema,
|
|
66
81
|
table: ast.table,
|
|
67
82
|
alias: ast.alias,
|
|
68
|
-
where:
|
|
83
|
+
where: where ? sortedWhere(where) : undefined,
|
|
69
84
|
related: ast.related
|
|
70
85
|
? sortedRelated(ast.related.map(r => ({
|
|
71
86
|
correlation: {
|
|
@@ -81,24 +96,83 @@ export function normalizeAST(ast) {
|
|
|
81
96
|
limit: ast.limit,
|
|
82
97
|
orderBy: ast.orderBy,
|
|
83
98
|
};
|
|
99
|
+
normalizeCache.set(ast, normalized);
|
|
100
|
+
return normalized;
|
|
84
101
|
}
|
|
85
102
|
function sortedWhere(where) {
|
|
86
|
-
|
|
103
|
+
if (where.type === 'simple') {
|
|
104
|
+
return where;
|
|
105
|
+
}
|
|
106
|
+
return {
|
|
107
|
+
type: where.type,
|
|
108
|
+
conditions: where.conditions.map(w => sortedWhere(w)).sort(cmpCondition),
|
|
109
|
+
};
|
|
87
110
|
}
|
|
88
111
|
function sortedRelated(related) {
|
|
89
112
|
return related.sort(cmpRelated);
|
|
90
113
|
}
|
|
91
114
|
function cmpCondition(a, b) {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
115
|
+
if (a.type === 'simple') {
|
|
116
|
+
if (b.type !== 'simple') {
|
|
117
|
+
return -1; // Order SimpleConditions first to simplify logic for invalidation filtering.
|
|
118
|
+
}
|
|
119
|
+
return (compareUTF8MaybeNull(a.field, b.field) ||
|
|
120
|
+
compareUTF8MaybeNull(a.op, b.op) ||
|
|
121
|
+
// Comparing the same field with the same op more than once doesn't make logical
|
|
122
|
+
// sense, but is technically possible. Assume the values are of the same type and
|
|
123
|
+
// sort by their String forms.
|
|
124
|
+
compareUTF8MaybeNull(String(a.value), String(b.value)));
|
|
125
|
+
}
|
|
126
|
+
if (b.type === 'simple') {
|
|
127
|
+
return 1; // Order SimpleConditions first to simplify logic for invalidation filtering.
|
|
128
|
+
}
|
|
129
|
+
const val = compareUTF8MaybeNull(a.type, b.type);
|
|
130
|
+
if (val !== 0) {
|
|
131
|
+
return val;
|
|
132
|
+
}
|
|
133
|
+
for (let l = 0, r = 0; l < a.conditions.length && r < b.conditions.length; l++, r++) {
|
|
134
|
+
const val = cmpCondition(a.conditions[l], b.conditions[r]);
|
|
135
|
+
if (val !== 0) {
|
|
136
|
+
return val;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
// prefixes first
|
|
140
|
+
return a.conditions.length - b.conditions.length;
|
|
98
141
|
}
|
|
99
142
|
function cmpRelated(a, b) {
|
|
100
143
|
return compareUTF8(must(a.subquery.alias), must(b.subquery.alias));
|
|
101
144
|
}
|
|
145
|
+
/**
|
|
146
|
+
* Returns a flattened version of the Conditions in which nested Conjunctions with
|
|
147
|
+
* the same operation ('AND' or 'OR') are flattened to the same level. e.g.
|
|
148
|
+
*
|
|
149
|
+
* ```
|
|
150
|
+
* ((a AND b) AND (c AND (d OR (e OR f)))) -> (a AND b AND c AND (d OR e OR f))
|
|
151
|
+
* ```
|
|
152
|
+
*
|
|
153
|
+
* Also flattens singleton Conjunctions regardless of operator, and removes
|
|
154
|
+
* empty Conjunctions.
|
|
155
|
+
*/
|
|
156
|
+
function flattened(cond) {
|
|
157
|
+
if (cond === undefined) {
|
|
158
|
+
return undefined;
|
|
159
|
+
}
|
|
160
|
+
if (cond.type === 'simple') {
|
|
161
|
+
return cond;
|
|
162
|
+
}
|
|
163
|
+
const conditions = defined(cond.conditions.flatMap(c => c.type === cond.type ? c.conditions.map(c => flattened(c)) : flattened(c)));
|
|
164
|
+
switch (conditions.length) {
|
|
165
|
+
case 0:
|
|
166
|
+
return undefined;
|
|
167
|
+
case 1:
|
|
168
|
+
return conditions[0];
|
|
169
|
+
default:
|
|
170
|
+
return {
|
|
171
|
+
type: cond.type,
|
|
172
|
+
conditions,
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
}
|
|
102
176
|
function compareUTF8MaybeNull(a, b) {
|
|
103
177
|
if (a !== null && b !== null) {
|
|
104
178
|
return compareUTF8(a, b);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ast.js","sourceRoot":"","sources":["../../../../zero-protocol/src/ast.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAC,WAAW,EAAC,MAAM,cAAc,CAAC;AACzC,OAAO,EAAC,IAAI,EAAC,MAAM,0BAA0B,CAAC;AAC9C,OAAO,KAAK,CAAC,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"ast.js","sourceRoot":"","sources":["../../../../zero-protocol/src/ast.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAC,WAAW,EAAC,MAAM,cAAc,CAAC;AACzC,OAAO,EAAC,IAAI,EAAC,MAAM,0BAA0B,CAAC;AAC9C,OAAO,KAAK,CAAC,MAAM,4BAA4B,CAAC;AAChD,OAAO,EAAC,OAAO,EAAC,MAAM,4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D,IAAI,IAAI,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;QAC3B,OAAO,IAAI,CAAC;IACd,CAAC;IACD,MAAM,UAAU,GAAG,OAAO,CACxB,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAC1B,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAC1E,CACF,CAAC;IAEF,QAAQ,UAAU,CAAC,MAAM,EAAE,CAAC;QAC1B,KAAK,CAAC;YACJ,OAAO,SAAS,CAAC;QACnB,KAAK,CAAC;YACJ,OAAO,UAAU,CAAC,CAAC,CAAM,CAAC;QAC5B;YACE,OAAO;gBACL,IAAI,EAAE,IAAI,CAAC,IAAI;gBACf,UAAU;aACK,CAAC;IACtB,CAAC;AACH,CAAC;AAED,SAAS,oBAAoB,CAAC,CAAgB,EAAE,CAAgB;IAC9D,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC;QAC7B,OAAO,WAAW,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAC3B,CAAC;IACD,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC;QACf,OAAO,CAAC,CAAC,CAAC;IACZ,CAAC;IACD,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC;QACf,OAAO,CAAC,CAAC;IACX,CAAC;IACD,OAAO,CAAC,CAAC;AACX,CAAC"}
|
|
@@ -7,7 +7,7 @@ declare const changeDesiredQueriesBodySchema: v.ObjectType<{
|
|
|
7
7
|
schema: v.Optional<string>;
|
|
8
8
|
table: v.Type<string>;
|
|
9
9
|
alias: v.Optional<string>;
|
|
10
|
-
where: v.Optional<
|
|
10
|
+
where: v.Optional<{
|
|
11
11
|
type: "simple";
|
|
12
12
|
op: "=" | "!=" | "<" | ">" | "<=" | ">=" | "LIKE" | "NOT LIKE" | "ILIKE" | "NOT ILIKE" | "IN" | "NOT IN";
|
|
13
13
|
field: string;
|
|
@@ -16,7 +16,7 @@ declare const changeDesiredQueriesBodySchema: v.ObjectType<{
|
|
|
16
16
|
anchor: "authData" | "preMutationRow";
|
|
17
17
|
field: string;
|
|
18
18
|
};
|
|
19
|
-
}
|
|
19
|
+
} | import("./ast.js").Conjunction | import("./ast.js").Disjunction>;
|
|
20
20
|
related: v.Optional<readonly import("./ast.js").CorrelatedSubQuery[]>;
|
|
21
21
|
limit: v.Optional<number>;
|
|
22
22
|
orderBy: v.Optional<readonly (readonly [string, "asc" | "desc"])[]>;
|
|
@@ -40,7 +40,7 @@ export declare const changeDesiredQueriesMessageSchema: v.TupleType<[v.Type<"cha
|
|
|
40
40
|
schema: v.Optional<string>;
|
|
41
41
|
table: v.Type<string>;
|
|
42
42
|
alias: v.Optional<string>;
|
|
43
|
-
where: v.Optional<
|
|
43
|
+
where: v.Optional<{
|
|
44
44
|
type: "simple";
|
|
45
45
|
op: "=" | "!=" | "<" | ">" | "<=" | ">=" | "LIKE" | "NOT LIKE" | "ILIKE" | "NOT ILIKE" | "IN" | "NOT IN";
|
|
46
46
|
field: string;
|
|
@@ -49,7 +49,7 @@ export declare const changeDesiredQueriesMessageSchema: v.TupleType<[v.Type<"cha
|
|
|
49
49
|
anchor: "authData" | "preMutationRow";
|
|
50
50
|
field: string;
|
|
51
51
|
};
|
|
52
|
-
}
|
|
52
|
+
} | import("./ast.js").Conjunction | import("./ast.js").Disjunction>;
|
|
53
53
|
related: v.Optional<readonly import("./ast.js").CorrelatedSubQuery[]>;
|
|
54
54
|
limit: v.Optional<number>;
|
|
55
55
|
orderBy: v.Optional<readonly (readonly [string, "asc" | "desc"])[]>;
|
|
@@ -22,7 +22,7 @@ declare const initConnectionBodySchema: v.ObjectType<{
|
|
|
22
22
|
schema: v.Optional<string>;
|
|
23
23
|
table: v.Type<string>;
|
|
24
24
|
alias: v.Optional<string>;
|
|
25
|
-
where: v.Optional<
|
|
25
|
+
where: v.Optional<{
|
|
26
26
|
type: "simple";
|
|
27
27
|
op: "=" | "!=" | "<" | ">" | "<=" | ">=" | "LIKE" | "NOT LIKE" | "ILIKE" | "NOT ILIKE" | "IN" | "NOT IN";
|
|
28
28
|
field: string;
|
|
@@ -31,7 +31,7 @@ declare const initConnectionBodySchema: v.ObjectType<{
|
|
|
31
31
|
anchor: "authData" | "preMutationRow";
|
|
32
32
|
field: string;
|
|
33
33
|
};
|
|
34
|
-
}
|
|
34
|
+
} | import("./ast.js").Conjunction | import("./ast.js").Disjunction>;
|
|
35
35
|
related: v.Optional<readonly import("./ast.js").CorrelatedSubQuery[]>;
|
|
36
36
|
limit: v.Optional<number>;
|
|
37
37
|
orderBy: v.Optional<readonly (readonly [string, "asc" | "desc"])[]>;
|
|
@@ -55,7 +55,7 @@ export declare const initConnectionMessageSchema: v.TupleType<[v.Type<"initConne
|
|
|
55
55
|
schema: v.Optional<string>;
|
|
56
56
|
table: v.Type<string>;
|
|
57
57
|
alias: v.Optional<string>;
|
|
58
|
-
where: v.Optional<
|
|
58
|
+
where: v.Optional<{
|
|
59
59
|
type: "simple";
|
|
60
60
|
op: "=" | "!=" | "<" | ">" | "<=" | ">=" | "LIKE" | "NOT LIKE" | "ILIKE" | "NOT ILIKE" | "IN" | "NOT IN";
|
|
61
61
|
field: string;
|
|
@@ -64,7 +64,7 @@ export declare const initConnectionMessageSchema: v.TupleType<[v.Type<"initConne
|
|
|
64
64
|
anchor: "authData" | "preMutationRow";
|
|
65
65
|
field: string;
|
|
66
66
|
};
|
|
67
|
-
}
|
|
67
|
+
} | import("./ast.js").Conjunction | import("./ast.js").Disjunction>;
|
|
68
68
|
related: v.Optional<readonly import("./ast.js").CorrelatedSubQuery[]>;
|
|
69
69
|
limit: v.Optional<number>;
|
|
70
70
|
orderBy: v.Optional<readonly (readonly [string, "asc" | "desc"])[]>;
|
|
@@ -84,12 +84,10 @@ export type ConnectedBody = v.Infer<typeof connectedBodySchema>;
|
|
|
84
84
|
export type ConnectedMessage = v.Infer<typeof connectedMessageSchema>;
|
|
85
85
|
export type InitConnectionBody = v.Infer<typeof initConnectionBodySchema>;
|
|
86
86
|
export type InitConnectionMessage = v.Infer<typeof initConnectionMessageSchema>;
|
|
87
|
-
export declare function encodeSecProtocols(initConnectionMessage: InitConnectionMessage, authToken
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
*/
|
|
93
|
-
export declare function decodeSecProtocols(secProtocol: string): [initConnectionMessage: string, maybeAuthToken: string | undefined];
|
|
87
|
+
export declare function encodeSecProtocols(initConnectionMessage: InitConnectionMessage | undefined, authToken: string | undefined): string;
|
|
88
|
+
export declare function decodeSecProtocols(secProtocol: string): {
|
|
89
|
+
initConnectionMessage: InitConnectionMessage | undefined;
|
|
90
|
+
authToken: string | undefined;
|
|
91
|
+
};
|
|
94
92
|
export {};
|
|
95
93
|
//# sourceMappingURL=connect.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connect.d.ts","sourceRoot":"","sources":["../../../../zero-protocol/src/connect.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"connect.d.ts","sourceRoot":"","sources":["../../../../zero-protocol/src/connect.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,4BAA4B,CAAC;AAGhD;;;;;;GAMG;AAEH,eAAO,MAAM,mBAAmB;;;aAG9B,CAAC;AAEH,eAAO,MAAM,sBAAsB;;;eAGjC,CAAC;AAEH,QAAA,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aAE5B,CAAC;AAEH,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eAGtC,CAAC;AAEH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAChE,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEtE,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAC1E,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAEhF,wBAAgB,kBAAkB,CAChC,qBAAqB,EAAE,qBAAqB,GAAG,SAAS,EACxD,SAAS,EAAE,MAAM,GAAG,SAAS,UAQ9B;AAED,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,MAAM,GAAG;IACvD,qBAAqB,EAAE,qBAAqB,GAAG,SAAS,CAAC;IACzD,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;CAC/B,CAEA"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { assert } from '../../shared/src/asserts.js';
|
|
2
1
|
import * as v from '../../shared/src/valita.js';
|
|
3
2
|
import { queriesPatchSchema } from './queries-patch.js';
|
|
4
3
|
/**
|
|
@@ -24,23 +23,14 @@ export const initConnectionMessageSchema = v.tuple([
|
|
|
24
23
|
initConnectionBodySchema,
|
|
25
24
|
]);
|
|
26
25
|
export function encodeSecProtocols(initConnectionMessage, authToken) {
|
|
26
|
+
const protocols = {
|
|
27
|
+
initConnectionMessage,
|
|
28
|
+
authToken,
|
|
29
|
+
};
|
|
27
30
|
// base64 encoding the JSON before URI encoding it results in a smaller payload.
|
|
28
|
-
|
|
29
|
-
if (authToken !== undefined) {
|
|
30
|
-
protocols.push(authToken);
|
|
31
|
-
}
|
|
32
|
-
return encodeURIComponent(protocols.join(','));
|
|
31
|
+
return encodeURIComponent(btoa(JSON.stringify(protocols)));
|
|
33
32
|
}
|
|
34
|
-
/**
|
|
35
|
-
* The initConnectionMessage is purposely returned as a string
|
|
36
|
-
* since it is passed directly into the WebSocket message handler
|
|
37
|
-
* which does JSON.parse and Valita.parse on the message.
|
|
38
|
-
*/
|
|
39
33
|
export function decodeSecProtocols(secProtocol) {
|
|
40
|
-
|
|
41
|
-
.split(',')
|
|
42
|
-
.map((s, i) => (i === 0 ? atob(s) : s));
|
|
43
|
-
assert(ret.length === 1 || ret.length === 2);
|
|
44
|
-
return ret.length === 1 ? [ret[0], undefined] : [ret[0], ret[1]];
|
|
34
|
+
return JSON.parse(atob(decodeURIComponent(secProtocol)));
|
|
45
35
|
}
|
|
46
36
|
//# sourceMappingURL=connect.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connect.js","sourceRoot":"","sources":["../../../../zero-protocol/src/connect.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"connect.js","sourceRoot":"","sources":["../../../../zero-protocol/src/connect.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,4BAA4B,CAAC;AAChD,OAAO,EAAC,kBAAkB,EAAC,MAAM,oBAAoB,CAAC;AAEtD;;;;;;GAMG;AAEH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC1C,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACjC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC;IAC5C,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC;IACtB,mBAAmB;CACpB,CAAC,CAAC;AAEH,MAAM,wBAAwB,GAAG,CAAC,CAAC,MAAM,CAAC;IACxC,mBAAmB,EAAE,kBAAkB;CACxC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC;IACjD,CAAC,CAAC,OAAO,CAAC,gBAAgB,CAAC;IAC3B,wBAAwB;CACzB,CAAC,CAAC;AAQH,MAAM,UAAU,kBAAkB,CAChC,qBAAwD,EACxD,SAA6B;IAE7B,MAAM,SAAS,GAAG;QAChB,qBAAqB;QACrB,SAAS;KACV,CAAC;IACF,gFAAgF;IAChF,OAAO,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;AAC7D,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,WAAmB;IAIpD,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,kBAAkB,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;AAC3D,CAAC"}
|
|
@@ -31,7 +31,7 @@ export declare const downstreamSchema: v.UnionType<[v.TupleType<[v.Type<"connect
|
|
|
31
31
|
ast: {
|
|
32
32
|
schema?: string | undefined;
|
|
33
33
|
alias?: string | undefined;
|
|
34
|
-
where?:
|
|
34
|
+
where?: {
|
|
35
35
|
type: "simple";
|
|
36
36
|
op: "=" | "!=" | "<" | ">" | "<=" | ">=" | "LIKE" | "NOT LIKE" | "ILIKE" | "NOT ILIKE" | "IN" | "NOT IN";
|
|
37
37
|
field: string;
|
|
@@ -40,7 +40,7 @@ export declare const downstreamSchema: v.UnionType<[v.TupleType<[v.Type<"connect
|
|
|
40
40
|
anchor: "authData" | "preMutationRow";
|
|
41
41
|
field: string;
|
|
42
42
|
};
|
|
43
|
-
}
|
|
43
|
+
} | import("./ast.js").Conjunction | import("./ast.js").Disjunction | undefined;
|
|
44
44
|
related?: readonly import("./ast.js").CorrelatedSubQuery[] | undefined;
|
|
45
45
|
limit?: number | undefined;
|
|
46
46
|
orderBy?: readonly (readonly [string, "asc" | "desc"])[] | undefined;
|
|
@@ -62,7 +62,7 @@ export declare const downstreamSchema: v.UnionType<[v.TupleType<[v.Type<"connect
|
|
|
62
62
|
ast: {
|
|
63
63
|
schema?: string | undefined;
|
|
64
64
|
alias?: string | undefined;
|
|
65
|
-
where?:
|
|
65
|
+
where?: {
|
|
66
66
|
type: "simple";
|
|
67
67
|
op: "=" | "!=" | "<" | ">" | "<=" | ">=" | "LIKE" | "NOT LIKE" | "ILIKE" | "NOT ILIKE" | "IN" | "NOT IN";
|
|
68
68
|
field: string;
|
|
@@ -71,7 +71,7 @@ export declare const downstreamSchema: v.UnionType<[v.TupleType<[v.Type<"connect
|
|
|
71
71
|
anchor: "authData" | "preMutationRow";
|
|
72
72
|
field: string;
|
|
73
73
|
};
|
|
74
|
-
}
|
|
74
|
+
} | import("./ast.js").Conjunction | import("./ast.js").Disjunction | undefined;
|
|
75
75
|
related?: readonly import("./ast.js").CorrelatedSubQuery[] | undefined;
|
|
76
76
|
limit?: number | undefined;
|
|
77
77
|
orderBy?: readonly (readonly [string, "asc" | "desc"])[] | undefined;
|
|
@@ -51,7 +51,7 @@ export declare const pokePartBodySchema: v.ObjectType<{
|
|
|
51
51
|
ast: {
|
|
52
52
|
schema?: string | undefined;
|
|
53
53
|
alias?: string | undefined;
|
|
54
|
-
where?:
|
|
54
|
+
where?: {
|
|
55
55
|
type: "simple";
|
|
56
56
|
op: "=" | "!=" | "<" | ">" | "<=" | ">=" | "LIKE" | "NOT LIKE" | "ILIKE" | "NOT ILIKE" | "IN" | "NOT IN";
|
|
57
57
|
field: string;
|
|
@@ -60,7 +60,7 @@ export declare const pokePartBodySchema: v.ObjectType<{
|
|
|
60
60
|
anchor: "authData" | "preMutationRow";
|
|
61
61
|
field: string;
|
|
62
62
|
};
|
|
63
|
-
}
|
|
63
|
+
} | import("./ast.js").Conjunction | import("./ast.js").Disjunction | undefined;
|
|
64
64
|
related?: readonly import("./ast.js").CorrelatedSubQuery[] | undefined;
|
|
65
65
|
limit?: number | undefined;
|
|
66
66
|
orderBy?: readonly (readonly [string, "asc" | "desc"])[] | undefined;
|
|
@@ -82,7 +82,7 @@ export declare const pokePartBodySchema: v.ObjectType<{
|
|
|
82
82
|
ast: {
|
|
83
83
|
schema?: string | undefined;
|
|
84
84
|
alias?: string | undefined;
|
|
85
|
-
where?:
|
|
85
|
+
where?: {
|
|
86
86
|
type: "simple";
|
|
87
87
|
op: "=" | "!=" | "<" | ">" | "<=" | ">=" | "LIKE" | "NOT LIKE" | "ILIKE" | "NOT ILIKE" | "IN" | "NOT IN";
|
|
88
88
|
field: string;
|
|
@@ -91,7 +91,7 @@ export declare const pokePartBodySchema: v.ObjectType<{
|
|
|
91
91
|
anchor: "authData" | "preMutationRow";
|
|
92
92
|
field: string;
|
|
93
93
|
};
|
|
94
|
-
}
|
|
94
|
+
} | import("./ast.js").Conjunction | import("./ast.js").Disjunction | undefined;
|
|
95
95
|
related?: readonly import("./ast.js").CorrelatedSubQuery[] | undefined;
|
|
96
96
|
limit?: number | undefined;
|
|
97
97
|
orderBy?: readonly (readonly [string, "asc" | "desc"])[] | undefined;
|
|
@@ -157,7 +157,7 @@ export declare const pokePartMessageSchema: v.TupleType<[v.Type<"pokePart">, v.O
|
|
|
157
157
|
ast: {
|
|
158
158
|
schema?: string | undefined;
|
|
159
159
|
alias?: string | undefined;
|
|
160
|
-
where?:
|
|
160
|
+
where?: {
|
|
161
161
|
type: "simple";
|
|
162
162
|
op: "=" | "!=" | "<" | ">" | "<=" | ">=" | "LIKE" | "NOT LIKE" | "ILIKE" | "NOT ILIKE" | "IN" | "NOT IN";
|
|
163
163
|
field: string;
|
|
@@ -166,7 +166,7 @@ export declare const pokePartMessageSchema: v.TupleType<[v.Type<"pokePart">, v.O
|
|
|
166
166
|
anchor: "authData" | "preMutationRow";
|
|
167
167
|
field: string;
|
|
168
168
|
};
|
|
169
|
-
}
|
|
169
|
+
} | import("./ast.js").Conjunction | import("./ast.js").Disjunction | undefined;
|
|
170
170
|
related?: readonly import("./ast.js").CorrelatedSubQuery[] | undefined;
|
|
171
171
|
limit?: number | undefined;
|
|
172
172
|
orderBy?: readonly (readonly [string, "asc" | "desc"])[] | undefined;
|
|
@@ -188,7 +188,7 @@ export declare const pokePartMessageSchema: v.TupleType<[v.Type<"pokePart">, v.O
|
|
|
188
188
|
ast: {
|
|
189
189
|
schema?: string | undefined;
|
|
190
190
|
alias?: string | undefined;
|
|
191
|
-
where?:
|
|
191
|
+
where?: {
|
|
192
192
|
type: "simple";
|
|
193
193
|
op: "=" | "!=" | "<" | ">" | "<=" | ">=" | "LIKE" | "NOT LIKE" | "ILIKE" | "NOT ILIKE" | "IN" | "NOT IN";
|
|
194
194
|
field: string;
|
|
@@ -197,7 +197,7 @@ export declare const pokePartMessageSchema: v.TupleType<[v.Type<"pokePart">, v.O
|
|
|
197
197
|
anchor: "authData" | "preMutationRow";
|
|
198
198
|
field: string;
|
|
199
199
|
};
|
|
200
|
-
}
|
|
200
|
+
} | import("./ast.js").Conjunction | import("./ast.js").Disjunction | undefined;
|
|
201
201
|
related?: readonly import("./ast.js").CorrelatedSubQuery[] | undefined;
|
|
202
202
|
limit?: number | undefined;
|
|
203
203
|
orderBy?: readonly (readonly [string, "asc" | "desc"])[] | undefined;
|
|
@@ -6,7 +6,7 @@ declare const putOpSchema: v.ObjectType<{
|
|
|
6
6
|
schema: v.Optional<string>;
|
|
7
7
|
table: v.Type<string>;
|
|
8
8
|
alias: v.Optional<string>;
|
|
9
|
-
where: v.Optional<
|
|
9
|
+
where: v.Optional<{
|
|
10
10
|
type: "simple";
|
|
11
11
|
op: "=" | "!=" | "<" | ">" | "<=" | ">=" | "LIKE" | "NOT LIKE" | "ILIKE" | "NOT ILIKE" | "IN" | "NOT IN";
|
|
12
12
|
field: string;
|
|
@@ -15,7 +15,7 @@ declare const putOpSchema: v.ObjectType<{
|
|
|
15
15
|
anchor: "authData" | "preMutationRow";
|
|
16
16
|
field: string;
|
|
17
17
|
};
|
|
18
|
-
}
|
|
18
|
+
} | import("./ast.js").Conjunction | import("./ast.js").Disjunction>;
|
|
19
19
|
related: v.Optional<readonly import("./ast.js").CorrelatedSubQuery[]>;
|
|
20
20
|
limit: v.Optional<number>;
|
|
21
21
|
orderBy: v.Optional<readonly (readonly [string, "asc" | "desc"])[]>;
|
|
@@ -39,7 +39,7 @@ declare const patchOpSchema: v.UnionType<[v.ObjectType<{
|
|
|
39
39
|
schema: v.Optional<string>;
|
|
40
40
|
table: v.Type<string>;
|
|
41
41
|
alias: v.Optional<string>;
|
|
42
|
-
where: v.Optional<
|
|
42
|
+
where: v.Optional<{
|
|
43
43
|
type: "simple";
|
|
44
44
|
op: "=" | "!=" | "<" | ">" | "<=" | ">=" | "LIKE" | "NOT LIKE" | "ILIKE" | "NOT ILIKE" | "IN" | "NOT IN";
|
|
45
45
|
field: string;
|
|
@@ -48,7 +48,7 @@ declare const patchOpSchema: v.UnionType<[v.ObjectType<{
|
|
|
48
48
|
anchor: "authData" | "preMutationRow";
|
|
49
49
|
field: string;
|
|
50
50
|
};
|
|
51
|
-
}
|
|
51
|
+
} | import("./ast.js").Conjunction | import("./ast.js").Disjunction>;
|
|
52
52
|
related: v.Optional<readonly import("./ast.js").CorrelatedSubQuery[]>;
|
|
53
53
|
limit: v.Optional<number>;
|
|
54
54
|
orderBy: v.Optional<readonly (readonly [string, "asc" | "desc"])[]>;
|
|
@@ -70,7 +70,7 @@ export declare const queriesPatchSchema: v.ArrayType<v.UnionType<[v.ObjectType<{
|
|
|
70
70
|
schema: v.Optional<string>;
|
|
71
71
|
table: v.Type<string>;
|
|
72
72
|
alias: v.Optional<string>;
|
|
73
|
-
where: v.Optional<
|
|
73
|
+
where: v.Optional<{
|
|
74
74
|
type: "simple";
|
|
75
75
|
op: "=" | "!=" | "<" | ">" | "<=" | ">=" | "LIKE" | "NOT LIKE" | "ILIKE" | "NOT ILIKE" | "IN" | "NOT IN";
|
|
76
76
|
field: string;
|
|
@@ -79,7 +79,7 @@ export declare const queriesPatchSchema: v.ArrayType<v.UnionType<[v.ObjectType<{
|
|
|
79
79
|
anchor: "authData" | "preMutationRow";
|
|
80
80
|
field: string;
|
|
81
81
|
};
|
|
82
|
-
}
|
|
82
|
+
} | import("./ast.js").Conjunction | import("./ast.js").Disjunction>;
|
|
83
83
|
related: v.Optional<readonly import("./ast.js").CorrelatedSubQuery[]>;
|
|
84
84
|
limit: v.Optional<number>;
|
|
85
85
|
orderBy: v.Optional<readonly (readonly [string, "asc" | "desc"])[]>;
|
|
@@ -7,7 +7,7 @@ export declare const upstreamSchema: v.UnionType<[v.TupleType<[v.Type<"initConne
|
|
|
7
7
|
schema: v.Optional<string>;
|
|
8
8
|
table: v.Type<string>;
|
|
9
9
|
alias: v.Optional<string>;
|
|
10
|
-
where: v.Optional<
|
|
10
|
+
where: v.Optional<{
|
|
11
11
|
type: "simple";
|
|
12
12
|
op: "=" | "!=" | "<" | ">" | "<=" | ">=" | "LIKE" | "NOT LIKE" | "ILIKE" | "NOT ILIKE" | "IN" | "NOT IN";
|
|
13
13
|
field: string;
|
|
@@ -16,7 +16,7 @@ export declare const upstreamSchema: v.UnionType<[v.TupleType<[v.Type<"initConne
|
|
|
16
16
|
anchor: "authData" | "preMutationRow";
|
|
17
17
|
field: string;
|
|
18
18
|
};
|
|
19
|
-
}
|
|
19
|
+
} | import("./ast.js").Conjunction | import("./ast.js").Disjunction>;
|
|
20
20
|
related: v.Optional<readonly import("./ast.js").CorrelatedSubQuery[]>;
|
|
21
21
|
limit: v.Optional<number>;
|
|
22
22
|
orderBy: v.Optional<readonly (readonly [string, "asc" | "desc"])[]>;
|
|
@@ -41,7 +41,7 @@ export declare const upstreamSchema: v.UnionType<[v.TupleType<[v.Type<"initConne
|
|
|
41
41
|
schema: v.Optional<string>;
|
|
42
42
|
table: v.Type<string>;
|
|
43
43
|
alias: v.Optional<string>;
|
|
44
|
-
where: v.Optional<
|
|
44
|
+
where: v.Optional<{
|
|
45
45
|
type: "simple";
|
|
46
46
|
op: "=" | "!=" | "<" | ">" | "<=" | ">=" | "LIKE" | "NOT LIKE" | "ILIKE" | "NOT ILIKE" | "IN" | "NOT IN";
|
|
47
47
|
field: string;
|
|
@@ -50,7 +50,7 @@ export declare const upstreamSchema: v.UnionType<[v.TupleType<[v.Type<"initConne
|
|
|
50
50
|
anchor: "authData" | "preMutationRow";
|
|
51
51
|
field: string;
|
|
52
52
|
};
|
|
53
|
-
}
|
|
53
|
+
} | import("./ast.js").Conjunction | import("./ast.js").Disjunction>;
|
|
54
54
|
related: v.Optional<readonly import("./ast.js").CorrelatedSubQuery[]>;
|
|
55
55
|
limit: v.Optional<number>;
|
|
56
56
|
orderBy: v.Optional<readonly (readonly [string, "asc" | "desc"])[]>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-query.d.ts","sourceRoot":"","sources":["../../../../zero-react/src/use-query.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,KAAK,
|
|
1
|
+
{"version":3,"file":"use-query.d.ts","sourceRoot":"","sources":["../../../../zero-react/src/use-query.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,KAAK,EACL,SAAS,EACT,KAAK,EACL,WAAW,EAEZ,MAAM,8BAA8B,CAAC;AAItC,wBAAgB,QAAQ,CACtB,OAAO,SAAS,WAAW,EAC3B,OAAO,SAAS,SAAS,EACzB,CAAC,EAAE,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,EAAE,MAAM,GAAE,OAAc,GAAG,KAAK,CAAC,OAAO,CAAC,CASpE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-zero.d.ts","sourceRoot":"","sources":["../../../../zero-solid/src/create-zero.ts"],"names":[],"mappings":"AACA,OAAO,EACL,IAAI,EACJ,KAAK,MAAM,EACX,KAAK,WAAW,EACjB,MAAM,8BAA8B,CAAC;AAGtC,wBAAgB,UAAU,CAAC,CAAC,SAAS,MAAM,EAAE,OAAO,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAM7E"}
|