@rocicorp/zero 0.6.2024112101 → 0.7.2024112700

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 (223) hide show
  1. package/out/advanced.js +1 -1
  2. package/out/{chunk-5UY46OAF.js → chunk-C7M3BJ3Z.js} +16 -8
  3. package/out/chunk-C7M3BJ3Z.js.map +7 -0
  4. package/out/{chunk-MPEWBBGZ.js → chunk-HDEKBM3G.js} +686 -660
  5. package/out/{chunk-MPEWBBGZ.js.map → chunk-HDEKBM3G.js.map} +4 -4
  6. package/out/shared/src/expand.js +2 -0
  7. package/out/shared/src/expand.js.map +1 -0
  8. package/out/shared/src/immutable.js +2 -0
  9. package/out/shared/src/immutable.js.map +1 -0
  10. package/out/{zero-cache/src/config/config.d.ts → shared/src/options.d.ts} +3 -5
  11. package/out/shared/src/options.d.ts.map +1 -0
  12. package/out/{zero-cache/src/config/config.js → shared/src/options.js} +26 -26
  13. package/out/shared/src/options.js.map +1 -0
  14. package/out/shared/src/sorted-entries.js +6 -0
  15. package/out/shared/src/sorted-entries.js.map +1 -0
  16. package/out/shared/src/writable.js +2 -0
  17. package/out/shared/src/writable.js.map +1 -0
  18. package/out/solid.js +2 -2
  19. package/out/zero/src/build-schema.d.ts +3 -0
  20. package/out/zero/src/build-schema.d.ts.map +1 -0
  21. package/out/zero/src/build-schema.js +3 -0
  22. package/out/zero/src/build-schema.js.map +1 -0
  23. package/out/zero-cache/src/auth/load-schema.d.ts +8 -0
  24. package/out/zero-cache/src/auth/load-schema.d.ts.map +1 -0
  25. package/out/zero-cache/src/auth/load-schema.js +34 -0
  26. package/out/zero-cache/src/auth/load-schema.js.map +1 -0
  27. package/out/zero-cache/src/auth/write-authorizer.d.ts +20 -0
  28. package/out/zero-cache/src/auth/write-authorizer.d.ts.map +1 -0
  29. package/out/zero-cache/src/auth/write-authorizer.js +320 -0
  30. package/out/zero-cache/src/auth/write-authorizer.js.map +1 -0
  31. package/out/zero-cache/src/config/zero-config.d.ts +14 -4
  32. package/out/zero-cache/src/config/zero-config.d.ts.map +1 -1
  33. package/out/zero-cache/src/config/zero-config.js +27 -14
  34. package/out/zero-cache/src/config/zero-config.js.map +1 -1
  35. package/out/zero-cache/src/server/main.js +7 -0
  36. package/out/zero-cache/src/server/main.js.map +1 -1
  37. package/out/zero-cache/src/server/replicator.d.ts.map +1 -1
  38. package/out/zero-cache/src/server/replicator.js +4 -3
  39. package/out/zero-cache/src/server/replicator.js.map +1 -1
  40. package/out/zero-cache/src/server/runtime.d.ts +3 -0
  41. package/out/zero-cache/src/server/runtime.d.ts.map +1 -0
  42. package/out/zero-cache/src/server/runtime.js +19 -0
  43. package/out/zero-cache/src/server/runtime.js.map +1 -0
  44. package/out/zero-cache/src/server/syncer.d.ts.map +1 -1
  45. package/out/zero-cache/src/server/syncer.js +7 -6
  46. package/out/zero-cache/src/server/syncer.js.map +1 -1
  47. package/out/zero-cache/src/services/change-streamer/change-streamer-service.js +1 -1
  48. package/out/zero-cache/src/services/change-streamer/change-streamer-service.js.map +1 -1
  49. package/out/zero-cache/src/services/mutagen/mutagen.d.ts +6 -5
  50. package/out/zero-cache/src/services/mutagen/mutagen.d.ts.map +1 -1
  51. package/out/zero-cache/src/services/mutagen/mutagen.js +19 -33
  52. package/out/zero-cache/src/services/mutagen/mutagen.js.map +1 -1
  53. package/out/zero-cache/src/services/replicator/replicator.d.ts +1 -1
  54. package/out/zero-cache/src/services/replicator/replicator.d.ts.map +1 -1
  55. package/out/zero-cache/src/services/replicator/replicator.js +2 -2
  56. package/out/zero-cache/src/services/replicator/replicator.js.map +1 -1
  57. package/out/zero-cache/src/services/view-syncer/client-handler.d.ts +1 -1
  58. package/out/zero-cache/src/services/view-syncer/client-handler.d.ts.map +1 -1
  59. package/out/zero-cache/src/services/view-syncer/client-handler.js +11 -8
  60. package/out/zero-cache/src/services/view-syncer/client-handler.js.map +1 -1
  61. package/out/zero-cache/src/services/view-syncer/cvr-store.d.ts +17 -8
  62. package/out/zero-cache/src/services/view-syncer/cvr-store.d.ts.map +1 -1
  63. package/out/zero-cache/src/services/view-syncer/cvr-store.js +357 -94
  64. package/out/zero-cache/src/services/view-syncer/cvr-store.js.map +1 -1
  65. package/out/zero-cache/src/services/view-syncer/cvr.d.ts +6 -9
  66. package/out/zero-cache/src/services/view-syncer/cvr.d.ts.map +1 -1
  67. package/out/zero-cache/src/services/view-syncer/cvr.js +36 -22
  68. package/out/zero-cache/src/services/view-syncer/cvr.js.map +1 -1
  69. package/out/zero-cache/src/services/view-syncer/pipeline-driver.d.ts.map +1 -1
  70. package/out/zero-cache/src/services/view-syncer/pipeline-driver.js +2 -2
  71. package/out/zero-cache/src/services/view-syncer/pipeline-driver.js.map +1 -1
  72. package/out/zero-cache/src/services/view-syncer/schema/cvr.d.ts +22 -0
  73. package/out/zero-cache/src/services/view-syncer/schema/cvr.d.ts.map +1 -1
  74. package/out/zero-cache/src/services/view-syncer/schema/cvr.js +33 -7
  75. package/out/zero-cache/src/services/view-syncer/schema/cvr.js.map +1 -1
  76. package/out/zero-cache/src/services/view-syncer/schema/init.d.ts.map +1 -1
  77. package/out/zero-cache/src/services/view-syncer/schema/init.js +44 -5
  78. package/out/zero-cache/src/services/view-syncer/schema/init.js.map +1 -1
  79. package/out/zero-cache/src/services/view-syncer/schema/types.d.ts +1 -0
  80. package/out/zero-cache/src/services/view-syncer/schema/types.d.ts.map +1 -1
  81. package/out/zero-cache/src/services/view-syncer/schema/types.js +3 -0
  82. package/out/zero-cache/src/services/view-syncer/schema/types.js.map +1 -1
  83. package/out/zero-cache/src/services/view-syncer/snapshotter.d.ts.map +1 -1
  84. package/out/zero-cache/src/services/view-syncer/snapshotter.js +5 -0
  85. package/out/zero-cache/src/services/view-syncer/snapshotter.js.map +1 -1
  86. package/out/zero-cache/src/services/view-syncer/view-syncer.d.ts +1 -1
  87. package/out/zero-cache/src/services/view-syncer/view-syncer.d.ts.map +1 -1
  88. package/out/zero-cache/src/services/view-syncer/view-syncer.js +69 -19
  89. package/out/zero-cache/src/services/view-syncer/view-syncer.js.map +1 -1
  90. package/out/zero-cache/src/types/row-key.d.ts +6 -0
  91. package/out/zero-cache/src/types/row-key.d.ts.map +1 -1
  92. package/out/zero-cache/src/types/row-key.js +16 -1
  93. package/out/zero-cache/src/types/row-key.js.map +1 -1
  94. package/out/zero-cache/src/workers/connection.d.ts +1 -1
  95. package/out/zero-cache/src/workers/connection.d.ts.map +1 -1
  96. package/out/zero-cache/src/workers/connection.js.map +1 -1
  97. package/out/zero-cache/src/workers/replicator.d.ts +3 -1
  98. package/out/zero-cache/src/workers/replicator.d.ts.map +1 -1
  99. package/out/zero-cache/src/workers/replicator.js +2 -0
  100. package/out/zero-cache/src/workers/replicator.js.map +1 -1
  101. package/out/zero-cache/src/workers/syncer.d.ts.map +1 -1
  102. package/out/zero-cache/src/workers/syncer.js +8 -3
  103. package/out/zero-cache/src/workers/syncer.js.map +1 -1
  104. package/out/zero-client/src/client/options.d.ts +37 -8
  105. package/out/zero-client/src/client/options.d.ts.map +1 -1
  106. package/out/zero-client/src/client/reload-error-handler.d.ts +16 -1
  107. package/out/zero-client/src/client/reload-error-handler.d.ts.map +1 -1
  108. package/out/zero-client/src/client/zero.d.ts +7 -55
  109. package/out/zero-client/src/client/zero.d.ts.map +1 -1
  110. package/out/zero-client/src/mod.d.ts +1 -1
  111. package/out/zero-client/src/mod.d.ts.map +1 -1
  112. package/out/zero-protocol/src/ast-hash.js +14 -0
  113. package/out/zero-protocol/src/ast-hash.js.map +1 -0
  114. package/out/zero-protocol/src/down.d.ts +4 -4
  115. package/out/zero-protocol/src/poke.d.ts +16 -8
  116. package/out/zero-protocol/src/poke.d.ts.map +1 -1
  117. package/out/zero-protocol/src/poke.js +8 -2
  118. package/out/zero-protocol/src/poke.js.map +1 -1
  119. package/out/zero-schema/src/authorization.d.ts +12 -5
  120. package/out/zero-schema/src/authorization.d.ts.map +1 -1
  121. package/out/zero-schema/src/build-schema.d.ts +14 -0
  122. package/out/zero-schema/src/build-schema.d.ts.map +1 -0
  123. package/out/zero-schema/src/build-schema.js +55 -0
  124. package/out/zero-schema/src/build-schema.js.map +1 -0
  125. package/out/zero-schema/src/compiled-authorization.d.ts +213 -294
  126. package/out/zero-schema/src/compiled-authorization.d.ts.map +1 -1
  127. package/out/zero-schema/src/compiled-authorization.js +9 -4
  128. package/out/zero-schema/src/compiled-authorization.js.map +1 -1
  129. package/out/zero-schema/src/normalize-table-schema.d.ts +2 -11
  130. package/out/zero-schema/src/normalize-table-schema.d.ts.map +1 -1
  131. package/out/zero-schema/src/normalize-table-schema.js +108 -0
  132. package/out/zero-schema/src/normalize-table-schema.js.map +1 -0
  133. package/out/zero-schema/src/normalized-schema.js +31 -0
  134. package/out/zero-schema/src/normalized-schema.js.map +1 -0
  135. package/out/zero-schema/src/schema-config.d.ts +325 -0
  136. package/out/zero-schema/src/schema-config.d.ts.map +1 -0
  137. package/out/zero-schema/src/schema-config.js +41 -0
  138. package/out/zero-schema/src/schema-config.js.map +1 -0
  139. package/out/zero-schema/src/schema.js +4 -0
  140. package/out/zero-schema/src/schema.js.map +1 -0
  141. package/out/zero-schema/src/table-schema.d.ts +6 -15
  142. package/out/zero-schema/src/table-schema.d.ts.map +1 -1
  143. package/out/zero-schema/src/table-schema.js.map +1 -1
  144. package/out/zero.js +2 -2
  145. package/out/zql/src/builder/builder.d.ts +2 -2
  146. package/out/zql/src/builder/builder.d.ts.map +1 -1
  147. package/out/zql/src/builder/builder.js +19 -20
  148. package/out/zql/src/builder/builder.js.map +1 -1
  149. package/out/zql/src/builder/filter.d.ts +25 -2
  150. package/out/zql/src/builder/filter.d.ts.map +1 -1
  151. package/out/zql/src/builder/filter.js +91 -1
  152. package/out/zql/src/builder/filter.js.map +1 -1
  153. package/out/zql/src/ivm/array-view.js +70 -0
  154. package/out/zql/src/ivm/array-view.js.map +1 -0
  155. package/out/zql/src/ivm/change.d.ts +18 -6
  156. package/out/zql/src/ivm/change.d.ts.map +1 -1
  157. package/out/zql/src/ivm/change.js +1 -1
  158. package/out/zql/src/ivm/change.js.map +1 -1
  159. package/out/zql/src/ivm/constraint.d.ts +14 -0
  160. package/out/zql/src/ivm/constraint.d.ts.map +1 -0
  161. package/out/zql/src/ivm/constraint.js +60 -0
  162. package/out/zql/src/ivm/constraint.js.map +1 -0
  163. package/out/zql/src/ivm/exists.d.ts.map +1 -1
  164. package/out/zql/src/ivm/exists.js +19 -2
  165. package/out/zql/src/ivm/exists.js.map +1 -1
  166. package/out/zql/src/ivm/join.d.ts +11 -5
  167. package/out/zql/src/ivm/join.d.ts.map +1 -1
  168. package/out/zql/src/ivm/join.js +49 -95
  169. package/out/zql/src/ivm/join.js.map +1 -1
  170. package/out/zql/src/ivm/maybe-split-and-push-edit-change.d.ts.map +1 -1
  171. package/out/zql/src/ivm/maybe-split-and-push-edit-change.js +4 -13
  172. package/out/zql/src/ivm/maybe-split-and-push-edit-change.js.map +1 -1
  173. package/out/zql/src/ivm/memory-source.d.ts +5 -22
  174. package/out/zql/src/ivm/memory-source.d.ts.map +1 -1
  175. package/out/zql/src/ivm/memory-source.js +58 -80
  176. package/out/zql/src/ivm/memory-source.js.map +1 -1
  177. package/out/zql/src/ivm/operator.d.ts +7 -10
  178. package/out/zql/src/ivm/operator.d.ts.map +1 -1
  179. package/out/zql/src/ivm/operator.js +1 -1
  180. package/out/zql/src/ivm/operator.js.map +1 -1
  181. package/out/zql/src/ivm/take.d.ts +3 -1
  182. package/out/zql/src/ivm/take.d.ts.map +1 -1
  183. package/out/zql/src/ivm/take.js +95 -95
  184. package/out/zql/src/ivm/take.js.map +1 -1
  185. package/out/zql/src/ivm/view-apply-change.d.ts.map +1 -1
  186. package/out/zql/src/ivm/view-apply-change.js +168 -0
  187. package/out/zql/src/ivm/view-apply-change.js.map +1 -0
  188. package/out/zql/src/ivm/view.js +2 -0
  189. package/out/zql/src/ivm/view.js.map +1 -0
  190. package/out/zql/src/query/auth-query.d.ts +3 -1
  191. package/out/zql/src/query/auth-query.d.ts.map +1 -1
  192. package/out/zql/src/query/auth-query.js +34 -0
  193. package/out/zql/src/query/auth-query.js.map +1 -0
  194. package/out/zql/src/query/dnf.js +57 -0
  195. package/out/zql/src/query/dnf.js.map +1 -0
  196. package/out/zql/src/query/expression.js +155 -0
  197. package/out/zql/src/query/expression.js.map +1 -0
  198. package/out/zql/src/query/query-impl.d.ts +4 -1
  199. package/out/zql/src/query/query-impl.d.ts.map +1 -1
  200. package/out/zql/src/query/query-impl.js +359 -0
  201. package/out/zql/src/query/query-impl.js.map +1 -0
  202. package/out/zql/src/query/query-internal.js +2 -0
  203. package/out/zql/src/query/query-internal.js.map +1 -0
  204. package/out/zql/src/query/query.js +3 -0
  205. package/out/zql/src/query/query.js.map +1 -0
  206. package/out/zql/src/query/typed-view.js +2 -0
  207. package/out/zql/src/query/typed-view.js.map +1 -0
  208. package/out/zqlite/src/table-source.d.ts +2 -11
  209. package/out/zqlite/src/table-source.d.ts.map +1 -1
  210. package/out/zqlite/src/table-source.js +28 -80
  211. package/out/zqlite/src/table-source.js.map +1 -1
  212. package/package.json +5 -3
  213. package/out/chunk-5UY46OAF.js.map +0 -7
  214. package/out/zero-cache/src/auth/load-authorization.d.ts +0 -4
  215. package/out/zero-cache/src/auth/load-authorization.d.ts.map +0 -1
  216. package/out/zero-cache/src/auth/load-authorization.js +0 -20
  217. package/out/zero-cache/src/auth/load-authorization.js.map +0 -1
  218. package/out/zero-cache/src/config/config.d.ts.map +0 -1
  219. package/out/zero-cache/src/config/config.js.map +0 -1
  220. package/out/zero-cache/src/services/mutagen/write-authorizer.d.ts +0 -21
  221. package/out/zero-cache/src/services/mutagen/write-authorizer.d.ts.map +0 -1
  222. package/out/zero-cache/src/services/mutagen/write-authorizer.js +0 -168
  223. package/out/zero-cache/src/services/mutagen/write-authorizer.js.map +0 -1
@@ -1,9 +1,62 @@
1
1
  import * as v from '../../shared/src/valita.js';
2
- declare const ruleSchema: v.TupleType<[v.Type<"allow">, v.ObjectType<{
3
- schema: v.Optional<string>;
4
- table: v.Type<string>;
5
- alias: v.Optional<string>;
6
- where: v.Optional<{
2
+ declare const ruleSchema: v.TupleType<[v.Type<"allow">, v.UnionType<[v.ObjectType<{
3
+ type: v.Type<"simple">;
4
+ op: v.UnionType<[v.UnionType<[v.Type<"=">, v.Type<"!=">, v.Type<"IS">, v.Type<"IS NOT">]>, 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">]>]>;
5
+ left: v.UnionType<[v.ObjectType<{
6
+ type: v.Type<"literal">;
7
+ value: v.UnionType<[v.Type<string>, v.Type<number>, v.Type<boolean>, v.Type<null>, v.Type<readonly (string | number | boolean)[]>]>;
8
+ }, undefined>, v.ObjectType<{
9
+ type: v.Type<"column">;
10
+ name: v.Type<string>;
11
+ }, undefined>, v.ObjectType<{
12
+ type: v.Type<"static">;
13
+ anchor: v.UnionType<[v.Type<"authData">, v.Type<"preMutationRow">]>;
14
+ field: v.Type<string>;
15
+ }, undefined>]>;
16
+ right: v.UnionType<[v.ObjectType<{
17
+ type: v.Type<"static">;
18
+ anchor: v.UnionType<[v.Type<"authData">, v.Type<"preMutationRow">]>;
19
+ field: v.Type<string>;
20
+ }, undefined>, v.ObjectType<{
21
+ type: v.Type<"literal">;
22
+ value: v.UnionType<[v.Type<string>, v.Type<number>, v.Type<boolean>, v.Type<null>, v.Type<readonly (string | number | boolean)[]>]>;
23
+ }, undefined>]>;
24
+ }, undefined>, v.Type<import("../../zero-protocol/src/ast.js").Conjunction>, v.Type<import("../../zero-protocol/src/ast.js").Disjunction>, v.ObjectType<Readonly<{
25
+ type: v.Type<"correlatedSubquery">;
26
+ related: v.Type<import("../../zero-protocol/src/ast.js").CorrelatedSubquery>;
27
+ op: v.UnionType<[v.Type<"EXISTS">, v.Type<"NOT EXISTS">]>;
28
+ }>, undefined>]>]>;
29
+ export type Rule = v.Infer<typeof ruleSchema>;
30
+ declare const policySchema: v.ArrayType<v.TupleType<[v.Type<"allow">, v.UnionType<[v.ObjectType<{
31
+ type: v.Type<"simple">;
32
+ op: v.UnionType<[v.UnionType<[v.Type<"=">, v.Type<"!=">, v.Type<"IS">, v.Type<"IS NOT">]>, 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">]>]>;
33
+ left: v.UnionType<[v.ObjectType<{
34
+ type: v.Type<"literal">;
35
+ value: v.UnionType<[v.Type<string>, v.Type<number>, v.Type<boolean>, v.Type<null>, v.Type<readonly (string | number | boolean)[]>]>;
36
+ }, undefined>, v.ObjectType<{
37
+ type: v.Type<"column">;
38
+ name: v.Type<string>;
39
+ }, undefined>, v.ObjectType<{
40
+ type: v.Type<"static">;
41
+ anchor: v.UnionType<[v.Type<"authData">, v.Type<"preMutationRow">]>;
42
+ field: v.Type<string>;
43
+ }, undefined>]>;
44
+ right: v.UnionType<[v.ObjectType<{
45
+ type: v.Type<"static">;
46
+ anchor: v.UnionType<[v.Type<"authData">, v.Type<"preMutationRow">]>;
47
+ field: v.Type<string>;
48
+ }, undefined>, v.ObjectType<{
49
+ type: v.Type<"literal">;
50
+ value: v.UnionType<[v.Type<string>, v.Type<number>, v.Type<boolean>, v.Type<null>, v.Type<readonly (string | number | boolean)[]>]>;
51
+ }, undefined>]>;
52
+ }, undefined>, v.Type<import("../../zero-protocol/src/ast.js").Conjunction>, v.Type<import("../../zero-protocol/src/ast.js").Disjunction>, v.ObjectType<Readonly<{
53
+ type: v.Type<"correlatedSubquery">;
54
+ related: v.Type<import("../../zero-protocol/src/ast.js").CorrelatedSubquery>;
55
+ op: v.UnionType<[v.Type<"EXISTS">, v.Type<"NOT EXISTS">]>;
56
+ }>, undefined>]>]>>;
57
+ export type Policy = v.Infer<typeof policySchema>;
58
+ declare const assetSchema: v.ObjectType<{
59
+ select: v.Optional<["allow", {
7
60
  type: "simple";
8
61
  op: "=" | "!=" | "IS" | "IS NOT" | "<" | ">" | "<=" | ">=" | "LIKE" | "NOT LIKE" | "ILIKE" | "NOT ILIKE" | "IN" | "NOT IN";
9
62
  left: {
@@ -29,21 +82,8 @@ declare const ruleSchema: v.TupleType<[v.Type<"allow">, v.ObjectType<{
29
82
  readonly type: "correlatedSubquery";
30
83
  readonly related: import("../../zero-protocol/src/ast.js").CorrelatedSubquery;
31
84
  readonly op: "EXISTS" | "NOT EXISTS";
32
- }>;
33
- related: v.Optional<readonly import("../../zero-protocol/src/ast.js").CorrelatedSubquery[]>;
34
- limit: v.Optional<number>;
35
- orderBy: v.Optional<readonly (readonly [string, "asc" | "desc"])[]>;
36
- start: v.Optional<{
37
- row: Record<string, import("../../shared/src/json.js").ReadonlyJSONValue | undefined>;
38
- exclusive: boolean;
39
- }>;
40
- }, undefined>]>;
41
- export type Rule = v.Infer<typeof ruleSchema>;
42
- declare const policySchema: v.ArrayType<v.TupleType<[v.Type<"allow">, v.ObjectType<{
43
- schema: v.Optional<string>;
44
- table: v.Type<string>;
45
- alias: v.Optional<string>;
46
- where: v.Optional<{
85
+ }][]>;
86
+ insert: v.Optional<["allow", {
47
87
  type: "simple";
48
88
  op: "=" | "!=" | "IS" | "IS NOT" | "<" | ">" | "<=" | ">=" | "LIKE" | "NOT LIKE" | "ILIKE" | "NOT ILIKE" | "IN" | "NOT IN";
49
89
  left: {
@@ -69,21 +109,9 @@ declare const policySchema: v.ArrayType<v.TupleType<[v.Type<"allow">, v.ObjectTy
69
109
  readonly type: "correlatedSubquery";
70
110
  readonly related: import("../../zero-protocol/src/ast.js").CorrelatedSubquery;
71
111
  readonly op: "EXISTS" | "NOT EXISTS";
72
- }>;
73
- related: v.Optional<readonly import("../../zero-protocol/src/ast.js").CorrelatedSubquery[]>;
74
- limit: v.Optional<number>;
75
- orderBy: v.Optional<readonly (readonly [string, "asc" | "desc"])[]>;
76
- start: v.Optional<{
77
- row: Record<string, import("../../shared/src/json.js").ReadonlyJSONValue | undefined>;
78
- exclusive: boolean;
79
- }>;
80
- }, undefined>]>>;
81
- export type Policy = v.Infer<typeof policySchema>;
82
- declare const assetSchema: v.ObjectType<{
83
- select: v.Optional<["allow", {
84
- schema?: string | undefined;
85
- alias?: string | undefined;
86
- where?: {
112
+ }][]>;
113
+ update: v.Optional<{
114
+ preMutation?: ["allow", {
87
115
  type: "simple";
88
116
  op: "=" | "!=" | "IS" | "IS NOT" | "<" | ">" | "<=" | ">=" | "LIKE" | "NOT LIKE" | "ILIKE" | "NOT ILIKE" | "IN" | "NOT IN";
89
117
  left: {
@@ -109,20 +137,8 @@ declare const assetSchema: v.ObjectType<{
109
137
  readonly type: "correlatedSubquery";
110
138
  readonly related: import("../../zero-protocol/src/ast.js").CorrelatedSubquery;
111
139
  readonly op: "EXISTS" | "NOT EXISTS";
112
- } | undefined;
113
- related?: readonly import("../../zero-protocol/src/ast.js").CorrelatedSubquery[] | undefined;
114
- limit?: number | undefined;
115
- orderBy?: readonly (readonly [string, "asc" | "desc"])[] | undefined;
116
- start?: {
117
- row: Record<string, import("../../shared/src/json.js").ReadonlyJSONValue | undefined>;
118
- exclusive: boolean;
119
- } | undefined;
120
- table: string;
121
- }][]>;
122
- insert: v.Optional<["allow", {
123
- schema?: string | undefined;
124
- alias?: string | undefined;
125
- where?: {
140
+ }][] | undefined;
141
+ postProposedMutation?: ["allow", {
126
142
  type: "simple";
127
143
  op: "=" | "!=" | "IS" | "IS NOT" | "<" | ">" | "<=" | ">=" | "LIKE" | "NOT LIKE" | "ILIKE" | "NOT ILIKE" | "IN" | "NOT IN";
128
144
  left: {
@@ -148,20 +164,40 @@ declare const assetSchema: v.ObjectType<{
148
164
  readonly type: "correlatedSubquery";
149
165
  readonly related: import("../../zero-protocol/src/ast.js").CorrelatedSubquery;
150
166
  readonly op: "EXISTS" | "NOT EXISTS";
151
- } | undefined;
152
- related?: readonly import("../../zero-protocol/src/ast.js").CorrelatedSubquery[] | undefined;
153
- limit?: number | undefined;
154
- orderBy?: readonly (readonly [string, "asc" | "desc"])[] | undefined;
155
- start?: {
156
- row: Record<string, import("../../shared/src/json.js").ReadonlyJSONValue | undefined>;
157
- exclusive: boolean;
158
- } | undefined;
159
- table: string;
167
+ }][] | undefined;
168
+ }>;
169
+ delete: v.Optional<["allow", {
170
+ type: "simple";
171
+ op: "=" | "!=" | "IS" | "IS NOT" | "<" | ">" | "<=" | ">=" | "LIKE" | "NOT LIKE" | "ILIKE" | "NOT ILIKE" | "IN" | "NOT IN";
172
+ left: {
173
+ type: "literal";
174
+ value: string | number | boolean | readonly (string | number | boolean)[] | null;
175
+ } | {
176
+ type: "column";
177
+ name: string;
178
+ } | {
179
+ type: "static";
180
+ anchor: "authData" | "preMutationRow";
181
+ field: string;
182
+ };
183
+ right: {
184
+ type: "literal";
185
+ value: string | number | boolean | readonly (string | number | boolean)[] | null;
186
+ } | {
187
+ type: "static";
188
+ anchor: "authData" | "preMutationRow";
189
+ field: string;
190
+ };
191
+ } | import("../../zero-protocol/src/ast.js").Conjunction | import("../../zero-protocol/src/ast.js").Disjunction | {
192
+ readonly type: "correlatedSubquery";
193
+ readonly related: import("../../zero-protocol/src/ast.js").CorrelatedSubquery;
194
+ readonly op: "EXISTS" | "NOT EXISTS";
160
195
  }][]>;
161
- update: v.Optional<["allow", {
162
- schema?: string | undefined;
163
- alias?: string | undefined;
164
- where?: {
196
+ }, undefined>;
197
+ export type AssetAuthorization = v.Infer<typeof assetSchema>;
198
+ export declare const authorizationConfigSchema: v.Type<Record<string, {
199
+ row?: {
200
+ select?: ["allow", {
165
201
  type: "simple";
166
202
  op: "=" | "!=" | "IS" | "IS NOT" | "<" | ">" | "<=" | ">=" | "LIKE" | "NOT LIKE" | "ILIKE" | "NOT ILIKE" | "IN" | "NOT IN";
167
203
  left: {
@@ -187,20 +223,8 @@ declare const assetSchema: v.ObjectType<{
187
223
  readonly type: "correlatedSubquery";
188
224
  readonly related: import("../../zero-protocol/src/ast.js").CorrelatedSubquery;
189
225
  readonly op: "EXISTS" | "NOT EXISTS";
190
- } | undefined;
191
- related?: readonly import("../../zero-protocol/src/ast.js").CorrelatedSubquery[] | undefined;
192
- limit?: number | undefined;
193
- orderBy?: readonly (readonly [string, "asc" | "desc"])[] | undefined;
194
- start?: {
195
- row: Record<string, import("../../shared/src/json.js").ReadonlyJSONValue | undefined>;
196
- exclusive: boolean;
197
- } | undefined;
198
- table: string;
199
- }][]>;
200
- delete: v.Optional<["allow", {
201
- schema?: string | undefined;
202
- alias?: string | undefined;
203
- where?: {
226
+ }][] | undefined;
227
+ insert?: ["allow", {
204
228
  type: "simple";
205
229
  op: "=" | "!=" | "IS" | "IS NOT" | "<" | ">" | "<=" | ">=" | "LIKE" | "NOT LIKE" | "ILIKE" | "NOT ILIKE" | "IN" | "NOT IN";
206
230
  left: {
@@ -226,63 +250,9 @@ declare const assetSchema: v.ObjectType<{
226
250
  readonly type: "correlatedSubquery";
227
251
  readonly related: import("../../zero-protocol/src/ast.js").CorrelatedSubquery;
228
252
  readonly op: "EXISTS" | "NOT EXISTS";
229
- } | undefined;
230
- related?: readonly import("../../zero-protocol/src/ast.js").CorrelatedSubquery[] | undefined;
231
- limit?: number | undefined;
232
- orderBy?: readonly (readonly [string, "asc" | "desc"])[] | undefined;
233
- start?: {
234
- row: Record<string, import("../../shared/src/json.js").ReadonlyJSONValue | undefined>;
235
- exclusive: boolean;
236
- } | undefined;
237
- table: string;
238
- }][]>;
239
- }, undefined>;
240
- export type AssetAuthorization = v.Infer<typeof assetSchema>;
241
- declare const authorizationConfigSchema: v.Type<Record<string, {
242
- row?: {
243
- select?: ["allow", {
244
- schema?: string | undefined;
245
- alias?: string | undefined;
246
- where?: {
247
- type: "simple";
248
- op: "=" | "!=" | "IS" | "IS NOT" | "<" | ">" | "<=" | ">=" | "LIKE" | "NOT LIKE" | "ILIKE" | "NOT ILIKE" | "IN" | "NOT IN";
249
- left: {
250
- type: "literal";
251
- value: string | number | boolean | readonly (string | number | boolean)[] | null;
252
- } | {
253
- type: "column";
254
- name: string;
255
- } | {
256
- type: "static";
257
- anchor: "authData" | "preMutationRow";
258
- field: string;
259
- };
260
- right: {
261
- type: "literal";
262
- value: string | number | boolean | readonly (string | number | boolean)[] | null;
263
- } | {
264
- type: "static";
265
- anchor: "authData" | "preMutationRow";
266
- field: string;
267
- };
268
- } | import("../../zero-protocol/src/ast.js").Conjunction | import("../../zero-protocol/src/ast.js").Disjunction | {
269
- readonly type: "correlatedSubquery";
270
- readonly related: import("../../zero-protocol/src/ast.js").CorrelatedSubquery;
271
- readonly op: "EXISTS" | "NOT EXISTS";
272
- } | undefined;
273
- related?: readonly import("../../zero-protocol/src/ast.js").CorrelatedSubquery[] | undefined;
274
- limit?: number | undefined;
275
- orderBy?: readonly (readonly [string, "asc" | "desc"])[] | undefined;
276
- start?: {
277
- row: Record<string, import("../../shared/src/json.js").ReadonlyJSONValue | undefined>;
278
- exclusive: boolean;
279
- } | undefined;
280
- table: string;
281
253
  }][] | undefined;
282
- insert?: ["allow", {
283
- schema?: string | undefined;
284
- alias?: string | undefined;
285
- where?: {
254
+ update?: {
255
+ preMutation?: ["allow", {
286
256
  type: "simple";
287
257
  op: "=" | "!=" | "IS" | "IS NOT" | "<" | ">" | "<=" | ">=" | "LIKE" | "NOT LIKE" | "ILIKE" | "NOT ILIKE" | "IN" | "NOT IN";
288
258
  left: {
@@ -308,20 +278,8 @@ declare const authorizationConfigSchema: v.Type<Record<string, {
308
278
  readonly type: "correlatedSubquery";
309
279
  readonly related: import("../../zero-protocol/src/ast.js").CorrelatedSubquery;
310
280
  readonly op: "EXISTS" | "NOT EXISTS";
311
- } | undefined;
312
- related?: readonly import("../../zero-protocol/src/ast.js").CorrelatedSubquery[] | undefined;
313
- limit?: number | undefined;
314
- orderBy?: readonly (readonly [string, "asc" | "desc"])[] | undefined;
315
- start?: {
316
- row: Record<string, import("../../shared/src/json.js").ReadonlyJSONValue | undefined>;
317
- exclusive: boolean;
318
- } | undefined;
319
- table: string;
320
- }][] | undefined;
321
- update?: ["allow", {
322
- schema?: string | undefined;
323
- alias?: string | undefined;
324
- where?: {
281
+ }][] | undefined;
282
+ postProposedMutation?: ["allow", {
325
283
  type: "simple";
326
284
  op: "=" | "!=" | "IS" | "IS NOT" | "<" | ">" | "<=" | ">=" | "LIKE" | "NOT LIKE" | "ILIKE" | "NOT ILIKE" | "IN" | "NOT IN";
327
285
  left: {
@@ -347,139 +305,93 @@ declare const authorizationConfigSchema: v.Type<Record<string, {
347
305
  readonly type: "correlatedSubquery";
348
306
  readonly related: import("../../zero-protocol/src/ast.js").CorrelatedSubquery;
349
307
  readonly op: "EXISTS" | "NOT EXISTS";
350
- } | undefined;
351
- related?: readonly import("../../zero-protocol/src/ast.js").CorrelatedSubquery[] | undefined;
352
- limit?: number | undefined;
353
- orderBy?: readonly (readonly [string, "asc" | "desc"])[] | undefined;
354
- start?: {
355
- row: Record<string, import("../../shared/src/json.js").ReadonlyJSONValue | undefined>;
356
- exclusive: boolean;
357
- } | undefined;
358
- table: string;
359
- }][] | undefined;
308
+ }][] | undefined;
309
+ } | undefined;
360
310
  delete?: ["allow", {
361
- schema?: string | undefined;
362
- alias?: string | undefined;
363
- where?: {
364
- type: "simple";
365
- op: "=" | "!=" | "IS" | "IS NOT" | "<" | ">" | "<=" | ">=" | "LIKE" | "NOT LIKE" | "ILIKE" | "NOT ILIKE" | "IN" | "NOT IN";
366
- left: {
367
- type: "literal";
368
- value: string | number | boolean | readonly (string | number | boolean)[] | null;
369
- } | {
370
- type: "column";
371
- name: string;
372
- } | {
373
- type: "static";
374
- anchor: "authData" | "preMutationRow";
375
- field: string;
376
- };
377
- right: {
378
- type: "literal";
379
- value: string | number | boolean | readonly (string | number | boolean)[] | null;
380
- } | {
381
- type: "static";
382
- anchor: "authData" | "preMutationRow";
383
- field: string;
384
- };
385
- } | import("../../zero-protocol/src/ast.js").Conjunction | import("../../zero-protocol/src/ast.js").Disjunction | {
386
- readonly type: "correlatedSubquery";
387
- readonly related: import("../../zero-protocol/src/ast.js").CorrelatedSubquery;
388
- readonly op: "EXISTS" | "NOT EXISTS";
389
- } | undefined;
390
- related?: readonly import("../../zero-protocol/src/ast.js").CorrelatedSubquery[] | undefined;
391
- limit?: number | undefined;
392
- orderBy?: readonly (readonly [string, "asc" | "desc"])[] | undefined;
393
- start?: {
394
- row: Record<string, import("../../shared/src/json.js").ReadonlyJSONValue | undefined>;
395
- exclusive: boolean;
396
- } | undefined;
397
- table: string;
311
+ type: "simple";
312
+ op: "=" | "!=" | "IS" | "IS NOT" | "<" | ">" | "<=" | ">=" | "LIKE" | "NOT LIKE" | "ILIKE" | "NOT ILIKE" | "IN" | "NOT IN";
313
+ left: {
314
+ type: "literal";
315
+ value: string | number | boolean | readonly (string | number | boolean)[] | null;
316
+ } | {
317
+ type: "column";
318
+ name: string;
319
+ } | {
320
+ type: "static";
321
+ anchor: "authData" | "preMutationRow";
322
+ field: string;
323
+ };
324
+ right: {
325
+ type: "literal";
326
+ value: string | number | boolean | readonly (string | number | boolean)[] | null;
327
+ } | {
328
+ type: "static";
329
+ anchor: "authData" | "preMutationRow";
330
+ field: string;
331
+ };
332
+ } | import("../../zero-protocol/src/ast.js").Conjunction | import("../../zero-protocol/src/ast.js").Disjunction | {
333
+ readonly type: "correlatedSubquery";
334
+ readonly related: import("../../zero-protocol/src/ast.js").CorrelatedSubquery;
335
+ readonly op: "EXISTS" | "NOT EXISTS";
398
336
  }][] | undefined;
399
337
  } | undefined;
400
338
  cell?: Record<string, {
401
339
  select?: ["allow", {
402
- schema?: string | undefined;
403
- alias?: string | undefined;
404
- where?: {
405
- type: "simple";
406
- op: "=" | "!=" | "IS" | "IS NOT" | "<" | ">" | "<=" | ">=" | "LIKE" | "NOT LIKE" | "ILIKE" | "NOT ILIKE" | "IN" | "NOT IN";
407
- left: {
408
- type: "literal";
409
- value: string | number | boolean | readonly (string | number | boolean)[] | null;
410
- } | {
411
- type: "column";
412
- name: string;
413
- } | {
414
- type: "static";
415
- anchor: "authData" | "preMutationRow";
416
- field: string;
417
- };
418
- right: {
419
- type: "literal";
420
- value: string | number | boolean | readonly (string | number | boolean)[] | null;
421
- } | {
422
- type: "static";
423
- anchor: "authData" | "preMutationRow";
424
- field: string;
425
- };
426
- } | import("../../zero-protocol/src/ast.js").Conjunction | import("../../zero-protocol/src/ast.js").Disjunction | {
427
- readonly type: "correlatedSubquery";
428
- readonly related: import("../../zero-protocol/src/ast.js").CorrelatedSubquery;
429
- readonly op: "EXISTS" | "NOT EXISTS";
430
- } | undefined;
431
- related?: readonly import("../../zero-protocol/src/ast.js").CorrelatedSubquery[] | undefined;
432
- limit?: number | undefined;
433
- orderBy?: readonly (readonly [string, "asc" | "desc"])[] | undefined;
434
- start?: {
435
- row: Record<string, import("../../shared/src/json.js").ReadonlyJSONValue | undefined>;
436
- exclusive: boolean;
437
- } | undefined;
438
- table: string;
340
+ type: "simple";
341
+ op: "=" | "!=" | "IS" | "IS NOT" | "<" | ">" | "<=" | ">=" | "LIKE" | "NOT LIKE" | "ILIKE" | "NOT ILIKE" | "IN" | "NOT IN";
342
+ left: {
343
+ type: "literal";
344
+ value: string | number | boolean | readonly (string | number | boolean)[] | null;
345
+ } | {
346
+ type: "column";
347
+ name: string;
348
+ } | {
349
+ type: "static";
350
+ anchor: "authData" | "preMutationRow";
351
+ field: string;
352
+ };
353
+ right: {
354
+ type: "literal";
355
+ value: string | number | boolean | readonly (string | number | boolean)[] | null;
356
+ } | {
357
+ type: "static";
358
+ anchor: "authData" | "preMutationRow";
359
+ field: string;
360
+ };
361
+ } | import("../../zero-protocol/src/ast.js").Conjunction | import("../../zero-protocol/src/ast.js").Disjunction | {
362
+ readonly type: "correlatedSubquery";
363
+ readonly related: import("../../zero-protocol/src/ast.js").CorrelatedSubquery;
364
+ readonly op: "EXISTS" | "NOT EXISTS";
439
365
  }][] | undefined;
440
366
  insert?: ["allow", {
441
- schema?: string | undefined;
442
- alias?: string | undefined;
443
- where?: {
444
- type: "simple";
445
- op: "=" | "!=" | "IS" | "IS NOT" | "<" | ">" | "<=" | ">=" | "LIKE" | "NOT LIKE" | "ILIKE" | "NOT ILIKE" | "IN" | "NOT IN";
446
- left: {
447
- type: "literal";
448
- value: string | number | boolean | readonly (string | number | boolean)[] | null;
449
- } | {
450
- type: "column";
451
- name: string;
452
- } | {
453
- type: "static";
454
- anchor: "authData" | "preMutationRow";
455
- field: string;
456
- };
457
- right: {
458
- type: "literal";
459
- value: string | number | boolean | readonly (string | number | boolean)[] | null;
460
- } | {
461
- type: "static";
462
- anchor: "authData" | "preMutationRow";
463
- field: string;
464
- };
465
- } | import("../../zero-protocol/src/ast.js").Conjunction | import("../../zero-protocol/src/ast.js").Disjunction | {
466
- readonly type: "correlatedSubquery";
467
- readonly related: import("../../zero-protocol/src/ast.js").CorrelatedSubquery;
468
- readonly op: "EXISTS" | "NOT EXISTS";
469
- } | undefined;
470
- related?: readonly import("../../zero-protocol/src/ast.js").CorrelatedSubquery[] | undefined;
471
- limit?: number | undefined;
472
- orderBy?: readonly (readonly [string, "asc" | "desc"])[] | undefined;
473
- start?: {
474
- row: Record<string, import("../../shared/src/json.js").ReadonlyJSONValue | undefined>;
475
- exclusive: boolean;
476
- } | undefined;
477
- table: string;
367
+ type: "simple";
368
+ op: "=" | "!=" | "IS" | "IS NOT" | "<" | ">" | "<=" | ">=" | "LIKE" | "NOT LIKE" | "ILIKE" | "NOT ILIKE" | "IN" | "NOT IN";
369
+ left: {
370
+ type: "literal";
371
+ value: string | number | boolean | readonly (string | number | boolean)[] | null;
372
+ } | {
373
+ type: "column";
374
+ name: string;
375
+ } | {
376
+ type: "static";
377
+ anchor: "authData" | "preMutationRow";
378
+ field: string;
379
+ };
380
+ right: {
381
+ type: "literal";
382
+ value: string | number | boolean | readonly (string | number | boolean)[] | null;
383
+ } | {
384
+ type: "static";
385
+ anchor: "authData" | "preMutationRow";
386
+ field: string;
387
+ };
388
+ } | import("../../zero-protocol/src/ast.js").Conjunction | import("../../zero-protocol/src/ast.js").Disjunction | {
389
+ readonly type: "correlatedSubquery";
390
+ readonly related: import("../../zero-protocol/src/ast.js").CorrelatedSubquery;
391
+ readonly op: "EXISTS" | "NOT EXISTS";
478
392
  }][] | undefined;
479
- update?: ["allow", {
480
- schema?: string | undefined;
481
- alias?: string | undefined;
482
- where?: {
393
+ update?: {
394
+ preMutation?: ["allow", {
483
395
  type: "simple";
484
396
  op: "=" | "!=" | "IS" | "IS NOT" | "<" | ">" | "<=" | ">=" | "LIKE" | "NOT LIKE" | "ILIKE" | "NOT ILIKE" | "IN" | "NOT IN";
485
397
  left: {
@@ -505,20 +417,8 @@ declare const authorizationConfigSchema: v.Type<Record<string, {
505
417
  readonly type: "correlatedSubquery";
506
418
  readonly related: import("../../zero-protocol/src/ast.js").CorrelatedSubquery;
507
419
  readonly op: "EXISTS" | "NOT EXISTS";
508
- } | undefined;
509
- related?: readonly import("../../zero-protocol/src/ast.js").CorrelatedSubquery[] | undefined;
510
- limit?: number | undefined;
511
- orderBy?: readonly (readonly [string, "asc" | "desc"])[] | undefined;
512
- start?: {
513
- row: Record<string, import("../../shared/src/json.js").ReadonlyJSONValue | undefined>;
514
- exclusive: boolean;
515
- } | undefined;
516
- table: string;
517
- }][] | undefined;
518
- delete?: ["allow", {
519
- schema?: string | undefined;
520
- alias?: string | undefined;
521
- where?: {
420
+ }][] | undefined;
421
+ postProposedMutation?: ["allow", {
522
422
  type: "simple";
523
423
  op: "=" | "!=" | "IS" | "IS NOT" | "<" | ">" | "<=" | ">=" | "LIKE" | "NOT LIKE" | "ILIKE" | "NOT ILIKE" | "IN" | "NOT IN";
524
424
  left: {
@@ -544,15 +444,34 @@ declare const authorizationConfigSchema: v.Type<Record<string, {
544
444
  readonly type: "correlatedSubquery";
545
445
  readonly related: import("../../zero-protocol/src/ast.js").CorrelatedSubquery;
546
446
  readonly op: "EXISTS" | "NOT EXISTS";
547
- } | undefined;
548
- related?: readonly import("../../zero-protocol/src/ast.js").CorrelatedSubquery[] | undefined;
549
- limit?: number | undefined;
550
- orderBy?: readonly (readonly [string, "asc" | "desc"])[] | undefined;
551
- start?: {
552
- row: Record<string, import("../../shared/src/json.js").ReadonlyJSONValue | undefined>;
553
- exclusive: boolean;
554
- } | undefined;
555
- table: string;
447
+ }][] | undefined;
448
+ } | undefined;
449
+ delete?: ["allow", {
450
+ type: "simple";
451
+ op: "=" | "!=" | "IS" | "IS NOT" | "<" | ">" | "<=" | ">=" | "LIKE" | "NOT LIKE" | "ILIKE" | "NOT ILIKE" | "IN" | "NOT IN";
452
+ left: {
453
+ type: "literal";
454
+ value: string | number | boolean | readonly (string | number | boolean)[] | null;
455
+ } | {
456
+ type: "column";
457
+ name: string;
458
+ } | {
459
+ type: "static";
460
+ anchor: "authData" | "preMutationRow";
461
+ field: string;
462
+ };
463
+ right: {
464
+ type: "literal";
465
+ value: string | number | boolean | readonly (string | number | boolean)[] | null;
466
+ } | {
467
+ type: "static";
468
+ anchor: "authData" | "preMutationRow";
469
+ field: string;
470
+ };
471
+ } | import("../../zero-protocol/src/ast.js").Conjunction | import("../../zero-protocol/src/ast.js").Disjunction | {
472
+ readonly type: "correlatedSubquery";
473
+ readonly related: import("../../zero-protocol/src/ast.js").CorrelatedSubquery;
474
+ readonly op: "EXISTS" | "NOT EXISTS";
556
475
  }][] | undefined;
557
476
  }> | undefined;
558
477
  }>>;
@@ -1 +1 @@
1
- {"version":3,"file":"compiled-authorization.d.ts","sourceRoot":"","sources":["../../../../zero-schema/src/compiled-authorization.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,4BAA4B,CAAC;AAGhD,QAAA,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eAA2C,CAAC;AAC5D,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC;AAC9C,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gBAAsB,CAAC;AACzC,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AAElD,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aAKf,CAAC;AAEH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC;AAE7D,QAAA,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAK9B,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC"}
1
+ {"version":3,"file":"compiled-authorization.d.ts","sourceRoot":"","sources":["../../../../zero-schema/src/compiled-authorization.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,4BAA4B,CAAC;AAGhD,QAAA,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;kBAAiD,CAAC;AAClE,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC;AAC9C,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;mBAAsB,CAAC;AACzC,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AAElD,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aAUf,CAAC;AAEH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC;AAE7D,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAKrC,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC"}
@@ -1,14 +1,19 @@
1
1
  import * as v from '../../shared/src/valita.js';
2
- import { astSchema } from '../../zero-protocol/src/ast.js';
3
- const ruleSchema = v.tuple([v.literal('allow'), astSchema]);
2
+ import { conditionSchema } from '../../zero-protocol/src/ast.js';
3
+ const ruleSchema = v.tuple([v.literal('allow'), conditionSchema]);
4
4
  const policySchema = v.array(ruleSchema);
5
5
  const assetSchema = v.object({
6
6
  select: policySchema.optional(),
7
7
  insert: policySchema.optional(),
8
- update: policySchema.optional(),
8
+ update: v
9
+ .object({
10
+ preMutation: policySchema.optional(),
11
+ postProposedMutation: policySchema.optional(),
12
+ })
13
+ .optional(),
9
14
  delete: policySchema.optional(),
10
15
  });
11
- const authorizationConfigSchema = v.record(v.object({
16
+ export const authorizationConfigSchema = v.record(v.object({
12
17
  row: assetSchema.optional(),
13
18
  cell: v.record(assetSchema).optional(),
14
19
  }));
@@ -1 +1 @@
1
- {"version":3,"file":"compiled-authorization.js","sourceRoot":"","sources":["../../../../zero-schema/src/compiled-authorization.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,4BAA4B,CAAC;AAChD,OAAO,EAAC,SAAS,EAAC,MAAM,gCAAgC,CAAC;AAEzD,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC;AAE5D,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;AAGzC,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3B,MAAM,EAAE,YAAY,CAAC,QAAQ,EAAE;IAC/B,MAAM,EAAE,YAAY,CAAC,QAAQ,EAAE;IAC/B,MAAM,EAAE,YAAY,CAAC,QAAQ,EAAE;IAC/B,MAAM,EAAE,YAAY,CAAC,QAAQ,EAAE;CAChC,CAAC,CAAC;AAIH,MAAM,yBAAyB,GAAG,CAAC,CAAC,MAAM,CACxC,CAAC,CAAC,MAAM,CAAC;IACP,GAAG,EAAE,WAAW,CAAC,QAAQ,EAAE;IAC3B,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,QAAQ,EAAE;CACvC,CAAC,CACH,CAAC"}
1
+ {"version":3,"file":"compiled-authorization.js","sourceRoot":"","sources":["../../../../zero-schema/src/compiled-authorization.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,4BAA4B,CAAC;AAChD,OAAO,EAAC,eAAe,EAAC,MAAM,gCAAgC,CAAC;AAE/D,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,eAAe,CAAC,CAAC,CAAC;AAElE,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;AAGzC,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3B,MAAM,EAAE,YAAY,CAAC,QAAQ,EAAE;IAC/B,MAAM,EAAE,YAAY,CAAC,QAAQ,EAAE;IAC/B,MAAM,EAAE,CAAC;SACN,MAAM,CAAC;QACN,WAAW,EAAE,YAAY,CAAC,QAAQ,EAAE;QACpC,oBAAoB,EAAE,YAAY,CAAC,QAAQ,EAAE;KAC9C,CAAC;SACD,QAAQ,EAAE;IACb,MAAM,EAAE,YAAY,CAAC,QAAQ,EAAE;CAChC,CAAC,CAAC;AAIH,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,CAAC,MAAM,CAC/C,CAAC,CAAC,MAAM,CAAC;IACP,GAAG,EAAE,WAAW,CAAC,QAAQ,EAAE;IAC3B,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,QAAQ,EAAE;CACvC,CAAC,CACH,CAAC"}