@rocicorp/zero 0.6.2024112102 → 0.7.2024120100

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 (243) hide show
  1. package/out/advanced.js +1 -1
  2. package/out/{chunk-QB7G63C6.js → chunk-4XX2NVJ7.js} +737 -738
  3. package/out/{chunk-QB7G63C6.js.map → chunk-4XX2NVJ7.js.map} +4 -4
  4. package/out/{chunk-5UY46OAF.js → chunk-C7M3BJ3Z.js} +16 -8
  5. package/out/chunk-C7M3BJ3Z.js.map +7 -0
  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 +35 -0
  26. package/out/zero-cache/src/auth/load-schema.js.map +1 -0
  27. package/out/zero-cache/src/auth/read-authorizer.d.ts +25 -0
  28. package/out/zero-cache/src/auth/read-authorizer.d.ts.map +1 -0
  29. package/out/zero-cache/src/auth/read-authorizer.js +126 -0
  30. package/out/zero-cache/src/auth/read-authorizer.js.map +1 -0
  31. package/out/zero-cache/src/auth/write-authorizer.d.ts +20 -0
  32. package/out/zero-cache/src/auth/write-authorizer.d.ts.map +1 -0
  33. package/out/zero-cache/src/auth/write-authorizer.js +320 -0
  34. package/out/zero-cache/src/auth/write-authorizer.js.map +1 -0
  35. package/out/zero-cache/src/config/zero-config.d.ts +14 -4
  36. package/out/zero-cache/src/config/zero-config.d.ts.map +1 -1
  37. package/out/zero-cache/src/config/zero-config.js +27 -14
  38. package/out/zero-cache/src/config/zero-config.js.map +1 -1
  39. package/out/zero-cache/src/server/main.js +7 -0
  40. package/out/zero-cache/src/server/main.js.map +1 -1
  41. package/out/zero-cache/src/server/replicator.d.ts.map +1 -1
  42. package/out/zero-cache/src/server/replicator.js +4 -3
  43. package/out/zero-cache/src/server/replicator.js.map +1 -1
  44. package/out/zero-cache/src/server/runtime.d.ts +3 -0
  45. package/out/zero-cache/src/server/runtime.d.ts.map +1 -0
  46. package/out/zero-cache/src/server/runtime.js +19 -0
  47. package/out/zero-cache/src/server/runtime.js.map +1 -0
  48. package/out/zero-cache/src/server/syncer.d.ts.map +1 -1
  49. package/out/zero-cache/src/server/syncer.js +7 -6
  50. package/out/zero-cache/src/server/syncer.js.map +1 -1
  51. package/out/zero-cache/src/services/change-streamer/change-streamer-service.js +1 -1
  52. package/out/zero-cache/src/services/change-streamer/change-streamer-service.js.map +1 -1
  53. package/out/zero-cache/src/services/mutagen/mutagen.d.ts +7 -6
  54. package/out/zero-cache/src/services/mutagen/mutagen.d.ts.map +1 -1
  55. package/out/zero-cache/src/services/mutagen/mutagen.js +19 -33
  56. package/out/zero-cache/src/services/mutagen/mutagen.js.map +1 -1
  57. package/out/zero-cache/src/services/replicator/replicator.d.ts +1 -1
  58. package/out/zero-cache/src/services/replicator/replicator.d.ts.map +1 -1
  59. package/out/zero-cache/src/services/replicator/replicator.js +2 -2
  60. package/out/zero-cache/src/services/replicator/replicator.js.map +1 -1
  61. package/out/zero-cache/src/services/view-syncer/client-handler.d.ts +1 -1
  62. package/out/zero-cache/src/services/view-syncer/client-handler.d.ts.map +1 -1
  63. package/out/zero-cache/src/services/view-syncer/client-handler.js +11 -8
  64. package/out/zero-cache/src/services/view-syncer/client-handler.js.map +1 -1
  65. package/out/zero-cache/src/services/view-syncer/cvr-store.d.ts +17 -8
  66. package/out/zero-cache/src/services/view-syncer/cvr-store.d.ts.map +1 -1
  67. package/out/zero-cache/src/services/view-syncer/cvr-store.js +357 -94
  68. package/out/zero-cache/src/services/view-syncer/cvr-store.js.map +1 -1
  69. package/out/zero-cache/src/services/view-syncer/cvr.d.ts +15 -10
  70. package/out/zero-cache/src/services/view-syncer/cvr.d.ts.map +1 -1
  71. package/out/zero-cache/src/services/view-syncer/cvr.js +42 -23
  72. package/out/zero-cache/src/services/view-syncer/cvr.js.map +1 -1
  73. package/out/zero-cache/src/services/view-syncer/pipeline-driver.d.ts.map +1 -1
  74. package/out/zero-cache/src/services/view-syncer/pipeline-driver.js +2 -2
  75. package/out/zero-cache/src/services/view-syncer/pipeline-driver.js.map +1 -1
  76. package/out/zero-cache/src/services/view-syncer/schema/cvr.d.ts +22 -0
  77. package/out/zero-cache/src/services/view-syncer/schema/cvr.d.ts.map +1 -1
  78. package/out/zero-cache/src/services/view-syncer/schema/cvr.js +33 -7
  79. package/out/zero-cache/src/services/view-syncer/schema/cvr.js.map +1 -1
  80. package/out/zero-cache/src/services/view-syncer/schema/init.d.ts.map +1 -1
  81. package/out/zero-cache/src/services/view-syncer/schema/init.js +44 -5
  82. package/out/zero-cache/src/services/view-syncer/schema/init.js.map +1 -1
  83. package/out/zero-cache/src/services/view-syncer/schema/types.d.ts +1 -0
  84. package/out/zero-cache/src/services/view-syncer/schema/types.d.ts.map +1 -1
  85. package/out/zero-cache/src/services/view-syncer/schema/types.js +3 -0
  86. package/out/zero-cache/src/services/view-syncer/schema/types.js.map +1 -1
  87. package/out/zero-cache/src/services/view-syncer/snapshotter.d.ts.map +1 -1
  88. package/out/zero-cache/src/services/view-syncer/snapshotter.js +5 -0
  89. package/out/zero-cache/src/services/view-syncer/snapshotter.js.map +1 -1
  90. package/out/zero-cache/src/services/view-syncer/view-syncer.d.ts +9 -1
  91. package/out/zero-cache/src/services/view-syncer/view-syncer.d.ts.map +1 -1
  92. package/out/zero-cache/src/services/view-syncer/view-syncer.js +167 -50
  93. package/out/zero-cache/src/services/view-syncer/view-syncer.js.map +1 -1
  94. package/out/zero-cache/src/types/row-key.d.ts +6 -0
  95. package/out/zero-cache/src/types/row-key.d.ts.map +1 -1
  96. package/out/zero-cache/src/types/row-key.js +16 -1
  97. package/out/zero-cache/src/types/row-key.js.map +1 -1
  98. package/out/zero-cache/src/workers/connection.d.ts +2 -3
  99. package/out/zero-cache/src/workers/connection.d.ts.map +1 -1
  100. package/out/zero-cache/src/workers/connection.js +4 -3
  101. package/out/zero-cache/src/workers/connection.js.map +1 -1
  102. package/out/zero-cache/src/workers/replicator.d.ts +3 -1
  103. package/out/zero-cache/src/workers/replicator.d.ts.map +1 -1
  104. package/out/zero-cache/src/workers/replicator.js +2 -0
  105. package/out/zero-cache/src/workers/replicator.js.map +1 -1
  106. package/out/zero-cache/src/workers/syncer.d.ts.map +1 -1
  107. package/out/zero-cache/src/workers/syncer.js +13 -3
  108. package/out/zero-cache/src/workers/syncer.js.map +1 -1
  109. package/out/zero-client/src/client/options.d.ts +37 -8
  110. package/out/zero-client/src/client/options.d.ts.map +1 -1
  111. package/out/zero-client/src/client/reload-error-handler.d.ts +16 -1
  112. package/out/zero-client/src/client/reload-error-handler.d.ts.map +1 -1
  113. package/out/zero-client/src/client/zero.d.ts +7 -55
  114. package/out/zero-client/src/client/zero.d.ts.map +1 -1
  115. package/out/zero-client/src/mod.d.ts +2 -2
  116. package/out/zero-client/src/mod.d.ts.map +1 -1
  117. package/out/zero-protocol/src/ast-hash.js +14 -0
  118. package/out/zero-protocol/src/ast-hash.js.map +1 -0
  119. package/out/zero-protocol/src/ast.d.ts +9 -9
  120. package/out/zero-protocol/src/ast.d.ts.map +1 -1
  121. package/out/zero-protocol/src/ast.js +11 -12
  122. package/out/zero-protocol/src/ast.js.map +1 -1
  123. package/out/zero-protocol/src/down.d.ts +4 -4
  124. package/out/zero-protocol/src/poke.d.ts +16 -8
  125. package/out/zero-protocol/src/poke.d.ts.map +1 -1
  126. package/out/zero-protocol/src/poke.js +8 -2
  127. package/out/zero-protocol/src/poke.js.map +1 -1
  128. package/out/zero-schema/src/build-schema.d.ts +14 -0
  129. package/out/zero-schema/src/build-schema.d.ts.map +1 -0
  130. package/out/zero-schema/src/build-schema.js +55 -0
  131. package/out/zero-schema/src/build-schema.js.map +1 -0
  132. package/out/zero-schema/src/compiled-permissions.d.ts +480 -0
  133. package/out/zero-schema/src/compiled-permissions.d.ts.map +1 -0
  134. package/out/zero-schema/src/compiled-permissions.js +20 -0
  135. package/out/zero-schema/src/compiled-permissions.js.map +1 -0
  136. package/out/zero-schema/src/mod.d.ts +1 -1
  137. package/out/zero-schema/src/mod.d.ts.map +1 -1
  138. package/out/zero-schema/src/normalize-table-schema.d.ts +19 -17
  139. package/out/zero-schema/src/normalize-table-schema.d.ts.map +1 -1
  140. package/out/zero-schema/src/normalize-table-schema.js +92 -0
  141. package/out/zero-schema/src/normalize-table-schema.js.map +1 -0
  142. package/out/zero-schema/src/normalized-schema.d.ts +6 -1
  143. package/out/zero-schema/src/normalized-schema.d.ts.map +1 -1
  144. package/out/zero-schema/src/normalized-schema.js +31 -0
  145. package/out/zero-schema/src/normalized-schema.js.map +1 -0
  146. package/out/zero-schema/src/permissions.d.ts +32 -0
  147. package/out/zero-schema/src/permissions.d.ts.map +1 -0
  148. package/out/zero-schema/src/schema-config.d.ts +43 -0
  149. package/out/zero-schema/src/schema-config.d.ts.map +1 -0
  150. package/out/zero-schema/src/schema-config.js +79 -0
  151. package/out/zero-schema/src/schema-config.js.map +1 -0
  152. package/out/zero-schema/src/schema.js +4 -0
  153. package/out/zero-schema/src/schema.js.map +1 -0
  154. package/out/zero-schema/src/table-schema.d.ts +15 -20
  155. package/out/zero-schema/src/table-schema.d.ts.map +1 -1
  156. package/out/zero-schema/src/table-schema.js +15 -2
  157. package/out/zero-schema/src/table-schema.js.map +1 -1
  158. package/out/zero.js +4 -4
  159. package/out/zql/src/builder/builder.d.ts +2 -2
  160. package/out/zql/src/builder/builder.d.ts.map +1 -1
  161. package/out/zql/src/builder/builder.js +15 -17
  162. package/out/zql/src/builder/builder.js.map +1 -1
  163. package/out/zql/src/builder/filter.d.ts +25 -2
  164. package/out/zql/src/builder/filter.d.ts.map +1 -1
  165. package/out/zql/src/builder/filter.js +91 -1
  166. package/out/zql/src/builder/filter.js.map +1 -1
  167. package/out/zql/src/ivm/array-view.js +70 -0
  168. package/out/zql/src/ivm/array-view.js.map +1 -0
  169. package/out/zql/src/ivm/change.d.ts +18 -6
  170. package/out/zql/src/ivm/change.d.ts.map +1 -1
  171. package/out/zql/src/ivm/change.js +1 -1
  172. package/out/zql/src/ivm/change.js.map +1 -1
  173. package/out/zql/src/ivm/constraint.d.ts +14 -0
  174. package/out/zql/src/ivm/constraint.d.ts.map +1 -0
  175. package/out/zql/src/ivm/constraint.js +60 -0
  176. package/out/zql/src/ivm/constraint.js.map +1 -0
  177. package/out/zql/src/ivm/exists.d.ts.map +1 -1
  178. package/out/zql/src/ivm/exists.js +19 -2
  179. package/out/zql/src/ivm/exists.js.map +1 -1
  180. package/out/zql/src/ivm/join.d.ts +11 -5
  181. package/out/zql/src/ivm/join.d.ts.map +1 -1
  182. package/out/zql/src/ivm/join.js +49 -95
  183. package/out/zql/src/ivm/join.js.map +1 -1
  184. package/out/zql/src/ivm/maybe-split-and-push-edit-change.d.ts.map +1 -1
  185. package/out/zql/src/ivm/maybe-split-and-push-edit-change.js +4 -13
  186. package/out/zql/src/ivm/maybe-split-and-push-edit-change.js.map +1 -1
  187. package/out/zql/src/ivm/memory-source.d.ts +5 -22
  188. package/out/zql/src/ivm/memory-source.d.ts.map +1 -1
  189. package/out/zql/src/ivm/memory-source.js +61 -83
  190. package/out/zql/src/ivm/memory-source.js.map +1 -1
  191. package/out/zql/src/ivm/operator.d.ts +7 -10
  192. package/out/zql/src/ivm/operator.d.ts.map +1 -1
  193. package/out/zql/src/ivm/operator.js +1 -1
  194. package/out/zql/src/ivm/operator.js.map +1 -1
  195. package/out/zql/src/ivm/take.d.ts +3 -1
  196. package/out/zql/src/ivm/take.d.ts.map +1 -1
  197. package/out/zql/src/ivm/take.js +95 -95
  198. package/out/zql/src/ivm/take.js.map +1 -1
  199. package/out/zql/src/ivm/view-apply-change.d.ts.map +1 -1
  200. package/out/zql/src/ivm/view-apply-change.js +168 -0
  201. package/out/zql/src/ivm/view-apply-change.js.map +1 -0
  202. package/out/zql/src/ivm/view.js +2 -0
  203. package/out/zql/src/ivm/view.js.map +1 -0
  204. package/out/zql/src/query/auth-query.d.ts +3 -5
  205. package/out/zql/src/query/auth-query.d.ts.map +1 -1
  206. package/out/zql/src/query/auth-query.js +30 -0
  207. package/out/zql/src/query/auth-query.js.map +1 -0
  208. package/out/zql/src/query/dnf.js +57 -0
  209. package/out/zql/src/query/dnf.js.map +1 -0
  210. package/out/zql/src/query/expression.js +155 -0
  211. package/out/zql/src/query/expression.js.map +1 -0
  212. package/out/zql/src/query/query-impl.d.ts +4 -1
  213. package/out/zql/src/query/query-impl.d.ts.map +1 -1
  214. package/out/zql/src/query/query-impl.js +353 -0
  215. package/out/zql/src/query/query-impl.js.map +1 -0
  216. package/out/zql/src/query/query-internal.js +2 -0
  217. package/out/zql/src/query/query-internal.js.map +1 -0
  218. package/out/zql/src/query/query.js +3 -0
  219. package/out/zql/src/query/query.js.map +1 -0
  220. package/out/zql/src/query/typed-view.js +2 -0
  221. package/out/zql/src/query/typed-view.js.map +1 -0
  222. package/out/zqlite/src/table-source.d.ts +2 -11
  223. package/out/zqlite/src/table-source.d.ts.map +1 -1
  224. package/out/zqlite/src/table-source.js +33 -82
  225. package/out/zqlite/src/table-source.js.map +1 -1
  226. package/package.json +5 -3
  227. package/out/chunk-5UY46OAF.js.map +0 -7
  228. package/out/zero-cache/src/auth/load-authorization.d.ts +0 -4
  229. package/out/zero-cache/src/auth/load-authorization.d.ts.map +0 -1
  230. package/out/zero-cache/src/auth/load-authorization.js +0 -20
  231. package/out/zero-cache/src/auth/load-authorization.js.map +0 -1
  232. package/out/zero-cache/src/config/config.d.ts.map +0 -1
  233. package/out/zero-cache/src/config/config.js.map +0 -1
  234. package/out/zero-cache/src/services/mutagen/write-authorizer.d.ts +0 -21
  235. package/out/zero-cache/src/services/mutagen/write-authorizer.d.ts.map +0 -1
  236. package/out/zero-cache/src/services/mutagen/write-authorizer.js +0 -168
  237. package/out/zero-cache/src/services/mutagen/write-authorizer.js.map +0 -1
  238. package/out/zero-schema/src/authorization.d.ts +0 -25
  239. package/out/zero-schema/src/authorization.d.ts.map +0 -1
  240. package/out/zero-schema/src/compiled-authorization.d.ts +0 -561
  241. package/out/zero-schema/src/compiled-authorization.d.ts.map +0 -1
  242. package/out/zero-schema/src/compiled-authorization.js +0 -15
  243. package/out/zero-schema/src/compiled-authorization.js.map +0 -1
@@ -1,561 +0,0 @@
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<{
7
- type: "simple";
8
- op: "=" | "!=" | "IS" | "IS NOT" | "<" | ">" | "<=" | ">=" | "LIKE" | "NOT LIKE" | "ILIKE" | "NOT ILIKE" | "IN" | "NOT IN";
9
- left: {
10
- type: "literal";
11
- value: string | number | boolean | readonly (string | number | boolean)[] | null;
12
- } | {
13
- type: "column";
14
- name: string;
15
- } | {
16
- type: "static";
17
- anchor: "authData" | "preMutationRow";
18
- field: string;
19
- };
20
- right: {
21
- type: "literal";
22
- value: string | number | boolean | readonly (string | number | boolean)[] | null;
23
- } | {
24
- type: "static";
25
- anchor: "authData" | "preMutationRow";
26
- field: string;
27
- };
28
- } | import("../../zero-protocol/src/ast.js").Conjunction | import("../../zero-protocol/src/ast.js").Disjunction | {
29
- readonly type: "correlatedSubquery";
30
- readonly related: import("../../zero-protocol/src/ast.js").CorrelatedSubquery;
31
- 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<{
47
- type: "simple";
48
- op: "=" | "!=" | "IS" | "IS NOT" | "<" | ">" | "<=" | ">=" | "LIKE" | "NOT LIKE" | "ILIKE" | "NOT ILIKE" | "IN" | "NOT IN";
49
- left: {
50
- type: "literal";
51
- value: string | number | boolean | readonly (string | number | boolean)[] | null;
52
- } | {
53
- type: "column";
54
- name: string;
55
- } | {
56
- type: "static";
57
- anchor: "authData" | "preMutationRow";
58
- field: string;
59
- };
60
- right: {
61
- type: "literal";
62
- value: string | number | boolean | readonly (string | number | boolean)[] | null;
63
- } | {
64
- type: "static";
65
- anchor: "authData" | "preMutationRow";
66
- field: string;
67
- };
68
- } | import("../../zero-protocol/src/ast.js").Conjunction | import("../../zero-protocol/src/ast.js").Disjunction | {
69
- readonly type: "correlatedSubquery";
70
- readonly related: import("../../zero-protocol/src/ast.js").CorrelatedSubquery;
71
- 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?: {
87
- type: "simple";
88
- op: "=" | "!=" | "IS" | "IS NOT" | "<" | ">" | "<=" | ">=" | "LIKE" | "NOT LIKE" | "ILIKE" | "NOT ILIKE" | "IN" | "NOT IN";
89
- left: {
90
- type: "literal";
91
- value: string | number | boolean | readonly (string | number | boolean)[] | null;
92
- } | {
93
- type: "column";
94
- name: string;
95
- } | {
96
- type: "static";
97
- anchor: "authData" | "preMutationRow";
98
- field: string;
99
- };
100
- right: {
101
- type: "literal";
102
- value: string | number | boolean | readonly (string | number | boolean)[] | null;
103
- } | {
104
- type: "static";
105
- anchor: "authData" | "preMutationRow";
106
- field: string;
107
- };
108
- } | import("../../zero-protocol/src/ast.js").Conjunction | import("../../zero-protocol/src/ast.js").Disjunction | {
109
- readonly type: "correlatedSubquery";
110
- readonly related: import("../../zero-protocol/src/ast.js").CorrelatedSubquery;
111
- 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?: {
126
- type: "simple";
127
- op: "=" | "!=" | "IS" | "IS NOT" | "<" | ">" | "<=" | ">=" | "LIKE" | "NOT LIKE" | "ILIKE" | "NOT ILIKE" | "IN" | "NOT IN";
128
- left: {
129
- type: "literal";
130
- value: string | number | boolean | readonly (string | number | boolean)[] | null;
131
- } | {
132
- type: "column";
133
- name: string;
134
- } | {
135
- type: "static";
136
- anchor: "authData" | "preMutationRow";
137
- field: string;
138
- };
139
- right: {
140
- type: "literal";
141
- value: string | number | boolean | readonly (string | number | boolean)[] | null;
142
- } | {
143
- type: "static";
144
- anchor: "authData" | "preMutationRow";
145
- field: string;
146
- };
147
- } | import("../../zero-protocol/src/ast.js").Conjunction | import("../../zero-protocol/src/ast.js").Disjunction | {
148
- readonly type: "correlatedSubquery";
149
- readonly related: import("../../zero-protocol/src/ast.js").CorrelatedSubquery;
150
- 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;
160
- }][]>;
161
- update: v.Optional<["allow", {
162
- schema?: string | undefined;
163
- alias?: string | undefined;
164
- where?: {
165
- type: "simple";
166
- op: "=" | "!=" | "IS" | "IS NOT" | "<" | ">" | "<=" | ">=" | "LIKE" | "NOT LIKE" | "ILIKE" | "NOT ILIKE" | "IN" | "NOT IN";
167
- left: {
168
- type: "literal";
169
- value: string | number | boolean | readonly (string | number | boolean)[] | null;
170
- } | {
171
- type: "column";
172
- name: string;
173
- } | {
174
- type: "static";
175
- anchor: "authData" | "preMutationRow";
176
- field: string;
177
- };
178
- right: {
179
- type: "literal";
180
- value: string | number | boolean | readonly (string | number | boolean)[] | null;
181
- } | {
182
- type: "static";
183
- anchor: "authData" | "preMutationRow";
184
- field: string;
185
- };
186
- } | import("../../zero-protocol/src/ast.js").Conjunction | import("../../zero-protocol/src/ast.js").Disjunction | {
187
- readonly type: "correlatedSubquery";
188
- readonly related: import("../../zero-protocol/src/ast.js").CorrelatedSubquery;
189
- 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?: {
204
- type: "simple";
205
- op: "=" | "!=" | "IS" | "IS NOT" | "<" | ">" | "<=" | ">=" | "LIKE" | "NOT LIKE" | "ILIKE" | "NOT ILIKE" | "IN" | "NOT IN";
206
- left: {
207
- type: "literal";
208
- value: string | number | boolean | readonly (string | number | boolean)[] | null;
209
- } | {
210
- type: "column";
211
- name: string;
212
- } | {
213
- type: "static";
214
- anchor: "authData" | "preMutationRow";
215
- field: string;
216
- };
217
- right: {
218
- type: "literal";
219
- value: string | number | boolean | readonly (string | number | boolean)[] | null;
220
- } | {
221
- type: "static";
222
- anchor: "authData" | "preMutationRow";
223
- field: string;
224
- };
225
- } | import("../../zero-protocol/src/ast.js").Conjunction | import("../../zero-protocol/src/ast.js").Disjunction | {
226
- readonly type: "correlatedSubquery";
227
- readonly related: import("../../zero-protocol/src/ast.js").CorrelatedSubquery;
228
- 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
- }][] | undefined;
282
- insert?: ["allow", {
283
- schema?: string | undefined;
284
- alias?: string | undefined;
285
- where?: {
286
- type: "simple";
287
- op: "=" | "!=" | "IS" | "IS NOT" | "<" | ">" | "<=" | ">=" | "LIKE" | "NOT LIKE" | "ILIKE" | "NOT ILIKE" | "IN" | "NOT IN";
288
- left: {
289
- type: "literal";
290
- value: string | number | boolean | readonly (string | number | boolean)[] | null;
291
- } | {
292
- type: "column";
293
- name: string;
294
- } | {
295
- type: "static";
296
- anchor: "authData" | "preMutationRow";
297
- field: string;
298
- };
299
- right: {
300
- type: "literal";
301
- value: string | number | boolean | readonly (string | number | boolean)[] | null;
302
- } | {
303
- type: "static";
304
- anchor: "authData" | "preMutationRow";
305
- field: string;
306
- };
307
- } | import("../../zero-protocol/src/ast.js").Conjunction | import("../../zero-protocol/src/ast.js").Disjunction | {
308
- readonly type: "correlatedSubquery";
309
- readonly related: import("../../zero-protocol/src/ast.js").CorrelatedSubquery;
310
- 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?: {
325
- type: "simple";
326
- op: "=" | "!=" | "IS" | "IS NOT" | "<" | ">" | "<=" | ">=" | "LIKE" | "NOT LIKE" | "ILIKE" | "NOT ILIKE" | "IN" | "NOT IN";
327
- left: {
328
- type: "literal";
329
- value: string | number | boolean | readonly (string | number | boolean)[] | null;
330
- } | {
331
- type: "column";
332
- name: string;
333
- } | {
334
- type: "static";
335
- anchor: "authData" | "preMutationRow";
336
- field: string;
337
- };
338
- right: {
339
- type: "literal";
340
- value: string | number | boolean | readonly (string | number | boolean)[] | null;
341
- } | {
342
- type: "static";
343
- anchor: "authData" | "preMutationRow";
344
- field: string;
345
- };
346
- } | import("../../zero-protocol/src/ast.js").Conjunction | import("../../zero-protocol/src/ast.js").Disjunction | {
347
- readonly type: "correlatedSubquery";
348
- readonly related: import("../../zero-protocol/src/ast.js").CorrelatedSubquery;
349
- 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;
360
- 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;
398
- }][] | undefined;
399
- } | undefined;
400
- cell?: Record<string, {
401
- 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;
439
- }][] | undefined;
440
- 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;
478
- }][] | undefined;
479
- update?: ["allow", {
480
- schema?: string | undefined;
481
- alias?: string | undefined;
482
- where?: {
483
- type: "simple";
484
- op: "=" | "!=" | "IS" | "IS NOT" | "<" | ">" | "<=" | ">=" | "LIKE" | "NOT LIKE" | "ILIKE" | "NOT ILIKE" | "IN" | "NOT IN";
485
- left: {
486
- type: "literal";
487
- value: string | number | boolean | readonly (string | number | boolean)[] | null;
488
- } | {
489
- type: "column";
490
- name: string;
491
- } | {
492
- type: "static";
493
- anchor: "authData" | "preMutationRow";
494
- field: string;
495
- };
496
- right: {
497
- type: "literal";
498
- value: string | number | boolean | readonly (string | number | boolean)[] | null;
499
- } | {
500
- type: "static";
501
- anchor: "authData" | "preMutationRow";
502
- field: string;
503
- };
504
- } | import("../../zero-protocol/src/ast.js").Conjunction | import("../../zero-protocol/src/ast.js").Disjunction | {
505
- readonly type: "correlatedSubquery";
506
- readonly related: import("../../zero-protocol/src/ast.js").CorrelatedSubquery;
507
- 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?: {
522
- type: "simple";
523
- op: "=" | "!=" | "IS" | "IS NOT" | "<" | ">" | "<=" | ">=" | "LIKE" | "NOT LIKE" | "ILIKE" | "NOT ILIKE" | "IN" | "NOT IN";
524
- left: {
525
- type: "literal";
526
- value: string | number | boolean | readonly (string | number | boolean)[] | null;
527
- } | {
528
- type: "column";
529
- name: string;
530
- } | {
531
- type: "static";
532
- anchor: "authData" | "preMutationRow";
533
- field: string;
534
- };
535
- right: {
536
- type: "literal";
537
- value: string | number | boolean | readonly (string | number | boolean)[] | null;
538
- } | {
539
- type: "static";
540
- anchor: "authData" | "preMutationRow";
541
- field: string;
542
- };
543
- } | import("../../zero-protocol/src/ast.js").Conjunction | import("../../zero-protocol/src/ast.js").Disjunction | {
544
- readonly type: "correlatedSubquery";
545
- readonly related: import("../../zero-protocol/src/ast.js").CorrelatedSubquery;
546
- 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;
556
- }][] | undefined;
557
- }> | undefined;
558
- }>>;
559
- export type AuthorizationConfig = v.Infer<typeof authorizationConfigSchema>;
560
- export {};
561
- //# sourceMappingURL=compiled-authorization.d.ts.map
@@ -1 +0,0 @@
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,15 +0,0 @@
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]);
4
- const policySchema = v.array(ruleSchema);
5
- const assetSchema = v.object({
6
- select: policySchema.optional(),
7
- insert: policySchema.optional(),
8
- update: policySchema.optional(),
9
- delete: policySchema.optional(),
10
- });
11
- const authorizationConfigSchema = v.record(v.object({
12
- row: assetSchema.optional(),
13
- cell: v.record(assetSchema).optional(),
14
- }));
15
- //# sourceMappingURL=compiled-authorization.js.map
@@ -1 +0,0 @@
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"}