@rocicorp/zero 0.7.2024120108 → 0.7.2024120400

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.
Files changed (96) hide show
  1. package/out/advanced.js +1 -1
  2. package/out/{chunk-C7M3BJ3Z.js → chunk-6HXO6VMP.js} +13 -12
  3. package/out/chunk-6HXO6VMP.js.map +7 -0
  4. package/out/{chunk-YQFIGL5R.js → chunk-WJCWI5I4.js} +76 -43
  5. package/out/{chunk-YQFIGL5R.js.map → chunk-WJCWI5I4.js.map} +3 -3
  6. package/out/shared/src/asserts.d.ts +1 -1
  7. package/out/shared/src/asserts.d.ts.map +1 -1
  8. package/out/shared/src/asserts.js +2 -1
  9. package/out/shared/src/asserts.js.map +1 -1
  10. package/out/solid.js +2 -2
  11. package/out/zero-cache/src/auth/load-schema.d.ts.map +1 -1
  12. package/out/zero-cache/src/auth/load-schema.js +4 -20
  13. package/out/zero-cache/src/auth/load-schema.js.map +1 -1
  14. package/out/zero-cache/src/auth/write-authorizer.d.ts.map +1 -1
  15. package/out/zero-cache/src/auth/write-authorizer.js +7 -2
  16. package/out/zero-cache/src/auth/write-authorizer.js.map +1 -1
  17. package/out/zero-cache/src/services/change-streamer/storer.d.ts.map +1 -1
  18. package/out/zero-cache/src/services/change-streamer/storer.js +11 -6
  19. package/out/zero-cache/src/services/change-streamer/storer.js.map +1 -1
  20. package/out/zero-cache/src/services/mutagen/mutagen.d.ts +2 -2
  21. package/out/zero-cache/src/services/mutagen/mutagen.d.ts.map +1 -1
  22. package/out/zero-cache/src/services/mutagen/mutagen.js +4 -3
  23. package/out/zero-cache/src/services/mutagen/mutagen.js.map +1 -1
  24. package/out/zero-cache/src/services/view-syncer/cvr-store.d.ts.map +1 -1
  25. package/out/zero-cache/src/services/view-syncer/cvr-store.js +5 -3
  26. package/out/zero-cache/src/services/view-syncer/cvr-store.js.map +1 -1
  27. package/out/zero-cache/src/services/view-syncer/pipeline-driver.d.ts.map +1 -1
  28. package/out/zero-cache/src/services/view-syncer/pipeline-driver.js +5 -2
  29. package/out/zero-cache/src/services/view-syncer/pipeline-driver.js.map +1 -1
  30. package/out/zero-cache/src/services/view-syncer/schema/types.d.ts +5 -195
  31. package/out/zero-cache/src/services/view-syncer/schema/types.d.ts.map +1 -1
  32. package/out/zero-cache/src/services/view-syncer/view-syncer.d.ts.map +1 -1
  33. package/out/zero-cache/src/services/view-syncer/view-syncer.js +2 -2
  34. package/out/zero-cache/src/services/view-syncer/view-syncer.js.map +1 -1
  35. package/out/zero-client/src/client/context.d.ts +1 -1
  36. package/out/zero-client/src/client/context.d.ts.map +1 -1
  37. package/out/zero-client/src/client/options.d.ts +9 -14
  38. package/out/zero-client/src/client/options.d.ts.map +1 -1
  39. package/out/zero-client/src/client/zero.d.ts.map +1 -1
  40. package/out/zero-protocol/src/ast.d.ts +5 -95
  41. package/out/zero-protocol/src/ast.d.ts.map +1 -1
  42. package/out/zero-protocol/src/ast.js +7 -9
  43. package/out/zero-protocol/src/ast.js.map +1 -1
  44. package/out/zero-protocol/src/change-desired-queries.d.ts +2 -78
  45. package/out/zero-protocol/src/change-desired-queries.d.ts.map +1 -1
  46. package/out/zero-protocol/src/connect.d.ts +2 -78
  47. package/out/zero-protocol/src/connect.d.ts.map +1 -1
  48. package/out/zero-protocol/src/down.d.ts +2 -78
  49. package/out/zero-protocol/src/down.d.ts.map +1 -1
  50. package/out/zero-protocol/src/poke.d.ts +4 -156
  51. package/out/zero-protocol/src/poke.d.ts.map +1 -1
  52. package/out/zero-protocol/src/queries-patch.d.ts +3 -117
  53. package/out/zero-protocol/src/queries-patch.d.ts.map +1 -1
  54. package/out/zero-protocol/src/up.d.ts +2 -78
  55. package/out/zero-protocol/src/up.d.ts.map +1 -1
  56. package/out/zero-schema/src/build-schema.d.ts.map +1 -1
  57. package/out/zero-schema/src/build-schema.js +2 -14
  58. package/out/zero-schema/src/build-schema.js.map +1 -1
  59. package/out/zero-schema/src/compiled-permissions.d.ts +17 -459
  60. package/out/zero-schema/src/compiled-permissions.d.ts.map +1 -1
  61. package/out/zero-schema/src/normalize-table-schema.d.ts +3 -2
  62. package/out/zero-schema/src/normalize-table-schema.d.ts.map +1 -1
  63. package/out/zero-schema/src/normalize-table-schema.js +39 -13
  64. package/out/zero-schema/src/normalize-table-schema.js.map +1 -1
  65. package/out/zero-schema/src/permissions.d.ts +1 -1
  66. package/out/zero-schema/src/permissions.d.ts.map +1 -1
  67. package/out/zero-schema/src/schema-config.d.ts +15 -29
  68. package/out/zero-schema/src/schema-config.d.ts.map +1 -1
  69. package/out/zero-schema/src/schema-config.js +39 -13
  70. package/out/zero-schema/src/schema-config.js.map +1 -1
  71. package/out/zero-schema/src/table-schema.d.ts +25 -36
  72. package/out/zero-schema/src/table-schema.d.ts.map +1 -1
  73. package/out/zero-schema/src/table-schema.js.map +1 -1
  74. package/out/zero.js +2 -2
  75. package/out/zql/src/ivm/memory-source.d.ts +1 -0
  76. package/out/zql/src/ivm/memory-source.d.ts.map +1 -1
  77. package/out/zql/src/ivm/memory-source.js +9 -9
  78. package/out/zql/src/ivm/memory-source.js.map +1 -1
  79. package/out/zql/src/ivm/schema.d.ts +6 -2
  80. package/out/zql/src/ivm/schema.d.ts.map +1 -1
  81. package/out/zql/src/ivm/source.d.ts +10 -0
  82. package/out/zql/src/ivm/source.d.ts.map +1 -1
  83. package/out/zql/src/ivm/view-apply-change.js +4 -2
  84. package/out/zql/src/ivm/view-apply-change.js.map +1 -1
  85. package/out/zql/src/query/expression.d.ts +3 -2
  86. package/out/zql/src/query/expression.d.ts.map +1 -1
  87. package/out/zql/src/query/expression.js.map +1 -1
  88. package/out/zql/src/query/query-impl.d.ts +2 -2
  89. package/out/zql/src/query/query-impl.d.ts.map +1 -1
  90. package/out/zql/src/query/query-impl.js.map +1 -1
  91. package/out/zqlite/src/table-source.d.ts +1 -0
  92. package/out/zqlite/src/table-source.d.ts.map +1 -1
  93. package/out/zqlite/src/table-source.js +9 -3
  94. package/out/zqlite/src/table-source.js.map +1 -1
  95. package/package.json +2 -2
  96. package/out/chunk-C7M3BJ3Z.js.map +0 -7
@@ -52,45 +52,7 @@ export declare const pokePartBodySchema: v.ObjectType<{
52
52
  desiredQueriesPatches: v.Optional<Record<string, ({
53
53
  op: "put";
54
54
  hash: string;
55
- ast: {
56
- schema?: string | undefined;
57
- alias?: string | undefined;
58
- where?: {
59
- type: "simple";
60
- op: "=" | "!=" | "IS" | "IS NOT" | "<" | ">" | "<=" | ">=" | "LIKE" | "NOT LIKE" | "ILIKE" | "NOT ILIKE" | "IN" | "NOT IN";
61
- left: {
62
- type: "literal";
63
- value: string | number | boolean | readonly (string | number | boolean)[] | null;
64
- } | {
65
- type: "column";
66
- name: string;
67
- } | {
68
- type: "static";
69
- anchor: "authData" | "preMutationRow";
70
- field: string;
71
- };
72
- right: {
73
- type: "literal";
74
- value: string | number | boolean | readonly (string | number | boolean)[] | null;
75
- } | {
76
- type: "static";
77
- anchor: "authData" | "preMutationRow";
78
- field: string;
79
- };
80
- } | import("./ast.js").Conjunction | import("./ast.js").Disjunction | {
81
- readonly type: "correlatedSubquery";
82
- readonly related: import("./ast.js").CorrelatedSubquery;
83
- readonly op: "EXISTS" | "NOT EXISTS";
84
- } | undefined;
85
- related?: readonly import("./ast.js").CorrelatedSubquery[] | undefined;
86
- limit?: number | undefined;
87
- orderBy?: readonly (readonly [string, "asc" | "desc"])[] | undefined;
88
- start?: {
89
- row: Record<string, import("../../shared/src/json.js").ReadonlyJSONValue | undefined>;
90
- exclusive: boolean;
91
- } | undefined;
92
- table: string;
93
- };
55
+ ast: import("./ast.js").AST;
94
56
  } | {
95
57
  op: "del";
96
58
  hash: string;
@@ -100,45 +62,7 @@ export declare const pokePartBodySchema: v.ObjectType<{
100
62
  gotQueriesPatch: v.Optional<({
101
63
  op: "put";
102
64
  hash: string;
103
- ast: {
104
- schema?: string | undefined;
105
- alias?: string | undefined;
106
- where?: {
107
- type: "simple";
108
- op: "=" | "!=" | "IS" | "IS NOT" | "<" | ">" | "<=" | ">=" | "LIKE" | "NOT LIKE" | "ILIKE" | "NOT ILIKE" | "IN" | "NOT IN";
109
- left: {
110
- type: "literal";
111
- value: string | number | boolean | readonly (string | number | boolean)[] | null;
112
- } | {
113
- type: "column";
114
- name: string;
115
- } | {
116
- type: "static";
117
- anchor: "authData" | "preMutationRow";
118
- field: string;
119
- };
120
- right: {
121
- type: "literal";
122
- value: string | number | boolean | readonly (string | number | boolean)[] | null;
123
- } | {
124
- type: "static";
125
- anchor: "authData" | "preMutationRow";
126
- field: string;
127
- };
128
- } | import("./ast.js").Conjunction | import("./ast.js").Disjunction | {
129
- readonly type: "correlatedSubquery";
130
- readonly related: import("./ast.js").CorrelatedSubquery;
131
- readonly op: "EXISTS" | "NOT EXISTS";
132
- } | undefined;
133
- related?: readonly import("./ast.js").CorrelatedSubquery[] | undefined;
134
- limit?: number | undefined;
135
- orderBy?: readonly (readonly [string, "asc" | "desc"])[] | undefined;
136
- start?: {
137
- row: Record<string, import("../../shared/src/json.js").ReadonlyJSONValue | undefined>;
138
- exclusive: boolean;
139
- } | undefined;
140
- table: string;
141
- };
65
+ ast: import("./ast.js").AST;
142
66
  } | {
143
67
  op: "del";
144
68
  hash: string;
@@ -196,45 +120,7 @@ export declare const pokePartMessageSchema: v.TupleType<[v.Type<"pokePart">, v.O
196
120
  desiredQueriesPatches: v.Optional<Record<string, ({
197
121
  op: "put";
198
122
  hash: string;
199
- ast: {
200
- schema?: string | undefined;
201
- alias?: string | undefined;
202
- where?: {
203
- type: "simple";
204
- op: "=" | "!=" | "IS" | "IS NOT" | "<" | ">" | "<=" | ">=" | "LIKE" | "NOT LIKE" | "ILIKE" | "NOT ILIKE" | "IN" | "NOT IN";
205
- left: {
206
- type: "literal";
207
- value: string | number | boolean | readonly (string | number | boolean)[] | null;
208
- } | {
209
- type: "column";
210
- name: string;
211
- } | {
212
- type: "static";
213
- anchor: "authData" | "preMutationRow";
214
- field: string;
215
- };
216
- right: {
217
- type: "literal";
218
- value: string | number | boolean | readonly (string | number | boolean)[] | null;
219
- } | {
220
- type: "static";
221
- anchor: "authData" | "preMutationRow";
222
- field: string;
223
- };
224
- } | import("./ast.js").Conjunction | import("./ast.js").Disjunction | {
225
- readonly type: "correlatedSubquery";
226
- readonly related: import("./ast.js").CorrelatedSubquery;
227
- readonly op: "EXISTS" | "NOT EXISTS";
228
- } | undefined;
229
- related?: readonly import("./ast.js").CorrelatedSubquery[] | undefined;
230
- limit?: number | undefined;
231
- orderBy?: readonly (readonly [string, "asc" | "desc"])[] | undefined;
232
- start?: {
233
- row: Record<string, import("../../shared/src/json.js").ReadonlyJSONValue | undefined>;
234
- exclusive: boolean;
235
- } | undefined;
236
- table: string;
237
- };
123
+ ast: import("./ast.js").AST;
238
124
  } | {
239
125
  op: "del";
240
126
  hash: string;
@@ -244,45 +130,7 @@ export declare const pokePartMessageSchema: v.TupleType<[v.Type<"pokePart">, v.O
244
130
  gotQueriesPatch: v.Optional<({
245
131
  op: "put";
246
132
  hash: string;
247
- ast: {
248
- schema?: string | undefined;
249
- alias?: string | undefined;
250
- where?: {
251
- type: "simple";
252
- op: "=" | "!=" | "IS" | "IS NOT" | "<" | ">" | "<=" | ">=" | "LIKE" | "NOT LIKE" | "ILIKE" | "NOT ILIKE" | "IN" | "NOT IN";
253
- left: {
254
- type: "literal";
255
- value: string | number | boolean | readonly (string | number | boolean)[] | null;
256
- } | {
257
- type: "column";
258
- name: string;
259
- } | {
260
- type: "static";
261
- anchor: "authData" | "preMutationRow";
262
- field: string;
263
- };
264
- right: {
265
- type: "literal";
266
- value: string | number | boolean | readonly (string | number | boolean)[] | null;
267
- } | {
268
- type: "static";
269
- anchor: "authData" | "preMutationRow";
270
- field: string;
271
- };
272
- } | import("./ast.js").Conjunction | import("./ast.js").Disjunction | {
273
- readonly type: "correlatedSubquery";
274
- readonly related: import("./ast.js").CorrelatedSubquery;
275
- readonly op: "EXISTS" | "NOT EXISTS";
276
- } | undefined;
277
- related?: readonly import("./ast.js").CorrelatedSubquery[] | undefined;
278
- limit?: number | undefined;
279
- orderBy?: readonly (readonly [string, "asc" | "desc"])[] | undefined;
280
- start?: {
281
- row: Record<string, import("../../shared/src/json.js").ReadonlyJSONValue | undefined>;
282
- exclusive: boolean;
283
- } | undefined;
284
- table: string;
285
- };
133
+ ast: import("./ast.js").AST;
286
134
  } | {
287
135
  op: "del";
288
136
  hash: string;
@@ -1 +1 @@
1
- {"version":3,"file":"poke.d.ts","sourceRoot":"","sources":["../../../../zero-protocol/src/poke.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,4BAA4B,CAAC;AAMhD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,eAAO,MAAM,mBAAmB;;;;IAO9B;;;OAGG;;;;;;aAQH,CAAC;AAEH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aAc7B,CAAC;AAEH,eAAO,MAAM,iBAAiB;;;aAK5B,CAAC;AAEH,eAAO,MAAM,sBAAsB;;;;IApCjC;;;OAGG;;;;;;eAoCH,CAAC;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eAGhC,CAAC;AACH,eAAO,MAAM,oBAAoB;;;eAG/B,CAAC;AAEH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAChE,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAC9D,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO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qB,CAAC,CAAC;AACpE,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
@@ -2,45 +2,7 @@ import * as v from '../../shared/src/valita.js';
2
2
  declare const putOpSchema: v.ObjectType<{
3
3
  op: v.Type<"put">;
4
4
  hash: v.Type<string>;
5
- ast: v.ObjectType<{
6
- schema: v.Optional<string>;
7
- table: v.Type<string>;
8
- alias: v.Optional<string>;
9
- where: v.Optional<{
10
- type: "simple";
11
- op: "=" | "!=" | "IS" | "IS NOT" | "<" | ">" | "<=" | ">=" | "LIKE" | "NOT LIKE" | "ILIKE" | "NOT ILIKE" | "IN" | "NOT IN";
12
- left: {
13
- type: "literal";
14
- value: string | number | boolean | readonly (string | number | boolean)[] | null;
15
- } | {
16
- type: "column";
17
- name: string;
18
- } | {
19
- type: "static";
20
- anchor: "authData" | "preMutationRow";
21
- field: string;
22
- };
23
- right: {
24
- type: "literal";
25
- value: string | number | boolean | readonly (string | number | boolean)[] | null;
26
- } | {
27
- type: "static";
28
- anchor: "authData" | "preMutationRow";
29
- field: string;
30
- };
31
- } | import("./ast.js").Conjunction | import("./ast.js").Disjunction | {
32
- readonly type: "correlatedSubquery";
33
- readonly related: import("./ast.js").CorrelatedSubquery;
34
- readonly op: "EXISTS" | "NOT EXISTS";
35
- }>;
36
- related: v.Optional<readonly import("./ast.js").CorrelatedSubquery[]>;
37
- limit: v.Optional<number>;
38
- orderBy: v.Optional<readonly (readonly [string, "asc" | "desc"])[]>;
39
- start: v.Optional<{
40
- row: Record<string, import("../../shared/src/json.js").ReadonlyJSONValue | undefined>;
41
- exclusive: boolean;
42
- }>;
43
- }, undefined>;
5
+ ast: v.Type<import("./ast.js").AST>;
44
6
  }, undefined>;
45
7
  declare const delOpSchema: v.ObjectType<{
46
8
  op: v.Type<"del">;
@@ -52,45 +14,7 @@ declare const clearOpSchema: v.ObjectType<{
52
14
  declare const patchOpSchema: v.UnionType<[v.ObjectType<{
53
15
  op: v.Type<"put">;
54
16
  hash: v.Type<string>;
55
- ast: v.ObjectType<{
56
- schema: v.Optional<string>;
57
- table: v.Type<string>;
58
- alias: v.Optional<string>;
59
- where: v.Optional<{
60
- type: "simple";
61
- op: "=" | "!=" | "IS" | "IS NOT" | "<" | ">" | "<=" | ">=" | "LIKE" | "NOT LIKE" | "ILIKE" | "NOT ILIKE" | "IN" | "NOT IN";
62
- left: {
63
- type: "literal";
64
- value: string | number | boolean | readonly (string | number | boolean)[] | null;
65
- } | {
66
- type: "column";
67
- name: string;
68
- } | {
69
- type: "static";
70
- anchor: "authData" | "preMutationRow";
71
- field: string;
72
- };
73
- right: {
74
- type: "literal";
75
- value: string | number | boolean | readonly (string | number | boolean)[] | null;
76
- } | {
77
- type: "static";
78
- anchor: "authData" | "preMutationRow";
79
- field: string;
80
- };
81
- } | import("./ast.js").Conjunction | import("./ast.js").Disjunction | {
82
- readonly type: "correlatedSubquery";
83
- readonly related: import("./ast.js").CorrelatedSubquery;
84
- readonly op: "EXISTS" | "NOT EXISTS";
85
- }>;
86
- related: v.Optional<readonly import("./ast.js").CorrelatedSubquery[]>;
87
- limit: v.Optional<number>;
88
- orderBy: v.Optional<readonly (readonly [string, "asc" | "desc"])[]>;
89
- start: v.Optional<{
90
- row: Record<string, import("../../shared/src/json.js").ReadonlyJSONValue | undefined>;
91
- exclusive: boolean;
92
- }>;
93
- }, undefined>;
17
+ ast: v.Type<import("./ast.js").AST>;
94
18
  }, undefined>, v.ObjectType<{
95
19
  op: v.Type<"del">;
96
20
  hash: v.Type<string>;
@@ -100,45 +24,7 @@ declare const patchOpSchema: v.UnionType<[v.ObjectType<{
100
24
  export declare const queriesPatchSchema: v.ArrayType<v.UnionType<[v.ObjectType<{
101
25
  op: v.Type<"put">;
102
26
  hash: v.Type<string>;
103
- ast: v.ObjectType<{
104
- schema: v.Optional<string>;
105
- table: v.Type<string>;
106
- alias: v.Optional<string>;
107
- where: v.Optional<{
108
- type: "simple";
109
- op: "=" | "!=" | "IS" | "IS NOT" | "<" | ">" | "<=" | ">=" | "LIKE" | "NOT LIKE" | "ILIKE" | "NOT ILIKE" | "IN" | "NOT IN";
110
- left: {
111
- type: "literal";
112
- value: string | number | boolean | readonly (string | number | boolean)[] | null;
113
- } | {
114
- type: "column";
115
- name: string;
116
- } | {
117
- type: "static";
118
- anchor: "authData" | "preMutationRow";
119
- field: string;
120
- };
121
- right: {
122
- type: "literal";
123
- value: string | number | boolean | readonly (string | number | boolean)[] | null;
124
- } | {
125
- type: "static";
126
- anchor: "authData" | "preMutationRow";
127
- field: string;
128
- };
129
- } | import("./ast.js").Conjunction | import("./ast.js").Disjunction | {
130
- readonly type: "correlatedSubquery";
131
- readonly related: import("./ast.js").CorrelatedSubquery;
132
- readonly op: "EXISTS" | "NOT EXISTS";
133
- }>;
134
- related: v.Optional<readonly import("./ast.js").CorrelatedSubquery[]>;
135
- limit: v.Optional<number>;
136
- orderBy: v.Optional<readonly (readonly [string, "asc" | "desc"])[]>;
137
- start: v.Optional<{
138
- row: Record<string, import("../../shared/src/json.js").ReadonlyJSONValue | undefined>;
139
- exclusive: boolean;
140
- }>;
141
- }, undefined>;
27
+ ast: v.Type<import("./ast.js").AST>;
142
28
  }, undefined>, v.ObjectType<{
143
29
  op: v.Type<"del">;
144
30
  hash: v.Type<string>;
@@ -1 +1 @@
1
- {"version":3,"file":"queries-patch.d.ts","sourceRoot":"","sources":["../../../../zero-protocol/src/queries-patch.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,4BAA4B,CAAC;AAGhD,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aAIf,CAAC;AAEH,QAAA,MAAM,WAAW;;;aAGf,CAAC;AAEH,QAAA,MAAM,aAAa;;aAEjB,CAAC;AAEH,QAAA,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eAAmD,CAAC;AAEvE,eAAO,MAAM,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45 +3,7 @@ export declare const upstreamSchema: v.UnionType<[v.TupleType<[v.Type<"initConne
3
3
  desiredQueriesPatch: v.ArrayType<v.UnionType<[v.ObjectType<{
4
4
  op: v.Type<"put">;
5
5
  hash: v.Type<string>;
6
- ast: v.ObjectType<{
7
- schema: v.Optional<string>;
8
- table: v.Type<string>;
9
- alias: v.Optional<string>;
10
- where: v.Optional<{
11
- type: "simple";
12
- op: "=" | "!=" | "IS" | "IS NOT" | "<" | ">" | "<=" | ">=" | "LIKE" | "NOT LIKE" | "ILIKE" | "NOT ILIKE" | "IN" | "NOT IN";
13
- left: {
14
- type: "literal";
15
- value: string | number | boolean | readonly (string | number | boolean)[] | null;
16
- } | {
17
- type: "column";
18
- name: string;
19
- } | {
20
- type: "static";
21
- anchor: "authData" | "preMutationRow";
22
- field: string;
23
- };
24
- right: {
25
- type: "literal";
26
- value: string | number | boolean | readonly (string | number | boolean)[] | null;
27
- } | {
28
- type: "static";
29
- anchor: "authData" | "preMutationRow";
30
- field: string;
31
- };
32
- } | import("./ast.js").Conjunction | import("./ast.js").Disjunction | {
33
- readonly type: "correlatedSubquery";
34
- readonly related: import("./ast.js").CorrelatedSubquery;
35
- readonly op: "EXISTS" | "NOT EXISTS";
36
- }>;
37
- related: v.Optional<readonly import("./ast.js").CorrelatedSubquery[]>;
38
- limit: v.Optional<number>;
39
- orderBy: v.Optional<readonly (readonly [string, "asc" | "desc"])[]>;
40
- start: v.Optional<{
41
- row: Record<string, import("../../shared/src/json.js").ReadonlyJSONValue | undefined>;
42
- exclusive: boolean;
43
- }>;
44
- }, undefined>;
6
+ ast: v.Type<import("./ast.js").AST>;
45
7
  }, undefined>, v.ObjectType<{
46
8
  op: v.Type<"del">;
47
9
  hash: v.Type<string>;
@@ -54,45 +16,7 @@ export declare const upstreamSchema: v.UnionType<[v.TupleType<[v.Type<"initConne
54
16
  desiredQueriesPatch: v.ArrayType<v.UnionType<[v.ObjectType<{
55
17
  op: v.Type<"put">;
56
18
  hash: v.Type<string>;
57
- ast: v.ObjectType<{
58
- schema: v.Optional<string>;
59
- table: v.Type<string>;
60
- alias: v.Optional<string>;
61
- where: v.Optional<{
62
- type: "simple";
63
- op: "=" | "!=" | "IS" | "IS NOT" | "<" | ">" | "<=" | ">=" | "LIKE" | "NOT LIKE" | "ILIKE" | "NOT ILIKE" | "IN" | "NOT IN";
64
- left: {
65
- type: "literal";
66
- value: string | number | boolean | readonly (string | number | boolean)[] | null;
67
- } | {
68
- type: "column";
69
- name: string;
70
- } | {
71
- type: "static";
72
- anchor: "authData" | "preMutationRow";
73
- field: string;
74
- };
75
- right: {
76
- type: "literal";
77
- value: string | number | boolean | readonly (string | number | boolean)[] | null;
78
- } | {
79
- type: "static";
80
- anchor: "authData" | "preMutationRow";
81
- field: string;
82
- };
83
- } | import("./ast.js").Conjunction | import("./ast.js").Disjunction | {
84
- readonly type: "correlatedSubquery";
85
- readonly related: import("./ast.js").CorrelatedSubquery;
86
- readonly op: "EXISTS" | "NOT EXISTS";
87
- }>;
88
- related: v.Optional<readonly import("./ast.js").CorrelatedSubquery[]>;
89
- limit: v.Optional<number>;
90
- orderBy: v.Optional<readonly (readonly [string, "asc" | "desc"])[]>;
91
- start: v.Optional<{
92
- row: Record<string, import("../../shared/src/json.js").ReadonlyJSONValue | undefined>;
93
- exclusive: boolean;
94
- }>;
95
- }, undefined>;
19
+ ast: v.Type<import("./ast.js").AST>;
96
20
  }, undefined>, v.ObjectType<{
97
21
  op: v.Type<"del">;
98
22
  hash: v.Type<string>;
@@ -1 +1 @@
1
- {"version":3,"file":"up.d.ts","sourceRoot":"","sources":["../../../../zero-protocol/src/up.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,4BAA4B,CAAC;AAQhD,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAO1B,CAAC;AAEF,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC"}
1
+ {"version":3,"file":"up.d.ts","sourceRoot":"","sources":["../../../../zero-protocol/src/up.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,4BAA4B,CAAC;AAQhD,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAO1B,CAAC;AAEF,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"build-schema.d.ts","sourceRoot":"","sources":["../../../../zero-schema/src/build-schema.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,CAAC,MAAM,4BAA4B,CAAC;AAQhD,eAAO,MAAM,aAAa;;;;;;;;;;;CAmBzB,CAAC"}
1
+ {"version":3,"file":"build-schema.d.ts","sourceRoot":"","sources":["../../../../zero-schema/src/build-schema.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,4BAA4B,CAAC;AAIhD,eAAO,MAAM,aAAa;;;;;;;;;;;CAmBzB,CAAC"}
@@ -2,11 +2,9 @@ import path from 'node:path';
2
2
  import { fileURLToPath } from 'node:url';
3
3
  import { tsImport } from 'tsx/esm/api';
4
4
  import { writeFile } from 'node:fs/promises';
5
- import { permissionsConfigSchema } from './compiled-permissions.js';
6
5
  import * as v from '../../shared/src/valita.js';
7
6
  import { parseOptions } from '../../shared/src/options.js';
8
- import { normalizeSchema } from './normalized-schema.js';
9
- import { isSchemaConfig, replacePointersWithSchemaNames, } from './schema-config.js';
7
+ import { stringifySchema } from './schema-config.js';
10
8
  export const schemaOptions = {
11
9
  path: {
12
10
  type: v.string().default('schema.ts'),
@@ -34,17 +32,7 @@ async function main() {
34
32
  const relativePath = path.join(path.relative(dirname, path.dirname(absoluteConfigPath)), path.basename(absoluteConfigPath));
35
33
  try {
36
34
  const module = await tsImport(relativePath, import.meta.url);
37
- if (!isSchemaConfig(module)) {
38
- throw new Error('Schema file must have a export `schema` and `permissions`.');
39
- }
40
- const schemaConfig = module;
41
- const permissions = v.parse(await schemaConfig.permissions, permissionsConfigSchema);
42
- const cycleFreeNormalizedSchema = replacePointersWithSchemaNames(normalizeSchema(schemaConfig.schema));
43
- const output = {
44
- permissions,
45
- schema: cycleFreeNormalizedSchema,
46
- };
47
- await writeFile(config.output, JSON.stringify(output, undefined, 2));
35
+ await writeFile(config.output, await stringifySchema(module));
48
36
  }
49
37
  catch (e) {
50
38
  console.error(`Failed to load zero schema from ${absoluteConfigPath}:`, e);
@@ -1 +1 @@
1
- {"version":3,"file":"build-schema.js","sourceRoot":"","sources":["../../../../zero-schema/src/build-schema.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAC,aAAa,EAAC,MAAM,UAAU,CAAC;AACvC,OAAO,EAAC,QAAQ,EAAC,MAAM,aAAa,CAAC;AACrC,OAAO,EAAC,SAAS,EAAC,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAC,uBAAuB,EAAC,MAAM,2BAA2B,CAAC;AAClE,OAAO,KAAK,CAAC,MAAM,4BAA4B,CAAC;AAChD,OAAO,EAAC,YAAY,EAAC,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAC,eAAe,EAAC,MAAM,wBAAwB,CAAC;AACvD,OAAO,EACL,cAAc,EACd,8BAA8B,GAC/B,MAAM,oBAAoB,CAAC;AAE5B,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,IAAI,EAAE;QACJ,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,WAAW,CAAC;QACrC,IAAI,EAAE;YACJ,6DAA6D;YAC7D,2DAA2D;SAC5D;QACD,KAAK,E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