@rocicorp/zero 1.12.0-canary.5 → 1.12.0-canary.7

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 (414) hide show
  1. package/out/replicache/src/btree/node.js +1 -1
  2. package/out/replicache/src/deleted-clients.d.ts.map +1 -1
  3. package/out/replicache/src/deleted-clients.js +2 -1
  4. package/out/replicache/src/deleted-clients.js.map +1 -1
  5. package/out/replicache/src/kv/sqlite-store.d.ts.map +1 -1
  6. package/out/replicache/src/kv/sqlite-store.js +7 -3
  7. package/out/replicache/src/kv/sqlite-store.js.map +1 -1
  8. package/out/replicache/src/replicache-impl.d.ts.map +1 -1
  9. package/out/replicache/src/replicache-impl.js +17 -14
  10. package/out/replicache/src/replicache-impl.js.map +1 -1
  11. package/out/z2s/src/compiler.js +3 -3
  12. package/out/z2s/src/compiler.js.map +1 -1
  13. package/out/zero/package.js +11 -11
  14. package/out/zero/package.js.map +1 -1
  15. package/out/zero-cache/src/auth/write-authorizer.js +9 -2
  16. package/out/zero-cache/src/auth/write-authorizer.js.map +1 -1
  17. package/out/zero-cache/src/config/zero-config.js +2 -2
  18. package/out/zero-cache/src/config/zero-config.js.map +1 -1
  19. package/out/zero-cache/src/server/change-streamer.js +33 -9
  20. package/out/zero-cache/src/server/change-streamer.js.map +1 -1
  21. package/out/zero-cache/src/services/change-source/common/replica-restore.js.map +1 -1
  22. package/out/zero-cache/src/services/change-source/pg/change-source-init.js +49 -24
  23. package/out/zero-cache/src/services/change-source/pg/change-source-init.js.map +1 -1
  24. package/out/zero-cache/src/services/change-source/pg/change-source.js +64 -7
  25. package/out/zero-cache/src/services/change-source/pg/change-source.js.map +1 -1
  26. package/out/zero-cache/src/services/change-source/pg/fork-request.js +54 -0
  27. package/out/zero-cache/src/services/change-source/pg/fork-request.js.map +1 -0
  28. package/out/zero-cache/src/services/change-source/pg/replication-slots.js +6 -0
  29. package/out/zero-cache/src/services/change-source/pg/replication-slots.js.map +1 -1
  30. package/out/zero-cache/src/services/change-source/protocol/current/downstream.d.ts +1 -0
  31. package/out/zero-cache/src/services/change-source/protocol/current/downstream.d.ts.map +1 -1
  32. package/out/zero-cache/src/services/change-source/protocol/current/status.d.ts +3 -0
  33. package/out/zero-cache/src/services/change-source/protocol/current/status.d.ts.map +1 -1
  34. package/out/zero-cache/src/services/change-source/protocol/current/status.js +2 -1
  35. package/out/zero-cache/src/services/change-source/protocol/current/status.js.map +1 -1
  36. package/out/zero-cache/src/services/change-source/protocol/current/upstream.d.ts +1 -0
  37. package/out/zero-cache/src/services/change-source/protocol/current/upstream.d.ts.map +1 -1
  38. package/out/zero-cache/src/services/change-streamer/backup-cleanup-monitor-factory.js +6 -6
  39. package/out/zero-cache/src/services/change-streamer/backup-cleanup-monitor-factory.js.map +1 -1
  40. package/out/zero-cache/src/services/change-streamer/backup-monitor.js +55 -20
  41. package/out/zero-cache/src/services/change-streamer/backup-monitor.js.map +1 -1
  42. package/out/zero-cache/src/services/change-streamer/change-streamer-service.js +27 -8
  43. package/out/zero-cache/src/services/change-streamer/change-streamer-service.js.map +1 -1
  44. package/out/zero-cache/src/services/change-streamer/change-streamer.js.map +1 -1
  45. package/out/zero-cache/src/services/change-streamer/litestream-sync-requester.js +80 -11
  46. package/out/zero-cache/src/services/change-streamer/litestream-sync-requester.js.map +1 -1
  47. package/out/zero-cache/src/services/change-streamer/litestream3-prometheus-poller.js.map +1 -1
  48. package/out/zero-cache/src/services/change-streamer/replica-poller.js.map +1 -1
  49. package/out/zero-cache/src/services/change-streamer/server-start-metrics.js +42 -0
  50. package/out/zero-cache/src/services/change-streamer/server-start-metrics.js.map +1 -0
  51. package/out/zero-cache/src/services/change-streamer/subscriber.js +5 -4
  52. package/out/zero-cache/src/services/change-streamer/subscriber.js.map +1 -1
  53. package/out/zero-cache/src/services/mutagen/mutagen.js +1 -2
  54. package/out/zero-cache/src/services/mutagen/mutagen.js.map +1 -1
  55. package/out/zero-cache/src/services/view-syncer/view-syncer.js +19 -2
  56. package/out/zero-cache/src/services/view-syncer/view-syncer.js.map +1 -1
  57. package/out/zero-client/src/client/version.js +1 -1
  58. package/out/zero-protocol/src/ast.d.ts.map +1 -1
  59. package/out/zero-protocol/src/ast.js +2 -1
  60. package/out/zero-protocol/src/ast.js.map +1 -1
  61. package/out/zero-protocol/src/down.d.ts +27 -27
  62. package/out/zero-protocol/src/inspect-down.d.ts +81 -81
  63. package/out/zero-protocol/src/up.d.ts +60 -60
  64. package/package.json +11 -11
  65. package/out/shared/src/cache.d.ts +0 -22
  66. package/out/shared/src/cache.d.ts.map +0 -1
  67. package/out/shared/src/custom-key-map.d.ts +0 -26
  68. package/out/shared/src/custom-key-map.d.ts.map +0 -1
  69. package/out/shared/src/custom-key-set.d.ts +0 -25
  70. package/out/shared/src/custom-key-set.d.ts.map +0 -1
  71. package/out/shared/src/logging-test-utils.d.ts +0 -12
  72. package/out/shared/src/logging-test-utils.d.ts.map +0 -1
  73. package/out/shared/src/queue.d.ts +0 -53
  74. package/out/shared/src/queue.d.ts.map +0 -1
  75. package/out/shared/src/ring-buffer.d.ts +0 -42
  76. package/out/shared/src/ring-buffer.d.ts.map +0 -1
  77. package/out/shared/src/sorted-entries.d.ts +0 -2
  78. package/out/shared/src/sorted-entries.d.ts.map +0 -1
  79. package/out/zero/src/server/change-streamer.d.ts +0 -2
  80. package/out/zero/src/server/change-streamer.d.ts.map +0 -1
  81. package/out/zero/src/server/main.d.ts +0 -2
  82. package/out/zero/src/server/main.d.ts.map +0 -1
  83. package/out/zero/src/server/reaper.d.ts +0 -2
  84. package/out/zero/src/server/reaper.d.ts.map +0 -1
  85. package/out/zero/src/server/replicator.d.ts +0 -2
  86. package/out/zero/src/server/replicator.d.ts.map +0 -1
  87. package/out/zero/src/server/syncer.d.ts +0 -2
  88. package/out/zero/src/server/syncer.d.ts.map +0 -1
  89. package/out/zero-cache/src/auth/jwt.d.ts +0 -12
  90. package/out/zero-cache/src/auth/jwt.d.ts.map +0 -1
  91. package/out/zero-cache/src/auth/load-permissions.d.ts +0 -17
  92. package/out/zero-cache/src/auth/load-permissions.d.ts.map +0 -1
  93. package/out/zero-cache/src/auth/write-authorizer.d.ts +0 -28
  94. package/out/zero-cache/src/auth/write-authorizer.d.ts.map +0 -1
  95. package/out/zero-cache/src/config/server-context.d.ts +0 -16
  96. package/out/zero-cache/src/config/server-context.d.ts.map +0 -1
  97. package/out/zero-cache/src/custom/fetch.d.ts +0 -38
  98. package/out/zero-cache/src/custom/fetch.d.ts.map +0 -1
  99. package/out/zero-cache/src/custom/metrics.d.ts +0 -31
  100. package/out/zero-cache/src/custom/metrics.d.ts.map +0 -1
  101. package/out/zero-cache/src/custom-queries/transform-query.d.ts +0 -68
  102. package/out/zero-cache/src/custom-queries/transform-query.d.ts.map +0 -1
  103. package/out/zero-cache/src/db/create.d.ts +0 -12
  104. package/out/zero-cache/src/db/create.d.ts.map +0 -1
  105. package/out/zero-cache/src/db/delete-lite-db.d.ts +0 -2
  106. package/out/zero-cache/src/db/delete-lite-db.d.ts.map +0 -1
  107. package/out/zero-cache/src/db/index-predicate.d.ts +0 -4
  108. package/out/zero-cache/src/db/index-predicate.d.ts.map +0 -1
  109. package/out/zero-cache/src/db/migration-lite.d.ts +0 -78
  110. package/out/zero-cache/src/db/migration-lite.d.ts.map +0 -1
  111. package/out/zero-cache/src/db/migration.d.ts +0 -80
  112. package/out/zero-cache/src/db/migration.d.ts.map +0 -1
  113. package/out/zero-cache/src/db/pg-copy-binary.d.ts +0 -101
  114. package/out/zero-cache/src/db/pg-copy-binary.d.ts.map +0 -1
  115. package/out/zero-cache/src/db/pg-copy.d.ts +0 -30
  116. package/out/zero-cache/src/db/pg-copy.d.ts.map +0 -1
  117. package/out/zero-cache/src/db/pg-type-parser.d.ts +0 -15
  118. package/out/zero-cache/src/db/pg-type-parser.d.ts.map +0 -1
  119. package/out/zero-cache/src/db/transaction-pool.d.ts +0 -205
  120. package/out/zero-cache/src/db/transaction-pool.d.ts.map +0 -1
  121. package/out/zero-cache/src/db/warmup.d.ts +0 -4
  122. package/out/zero-cache/src/db/warmup.d.ts.map +0 -1
  123. package/out/zero-cache/src/observability/events.d.ts +0 -15
  124. package/out/zero-cache/src/observability/events.d.ts.map +0 -1
  125. package/out/zero-cache/src/observability/log-throttle.d.ts +0 -44
  126. package/out/zero-cache/src/observability/log-throttle.d.ts.map +0 -1
  127. package/out/zero-cache/src/server/anonymous-otel-start.d.ts +0 -21
  128. package/out/zero-cache/src/server/anonymous-otel-start.d.ts.map +0 -1
  129. package/out/zero-cache/src/server/change-streamer.d.ts +0 -3
  130. package/out/zero-cache/src/server/change-streamer.d.ts.map +0 -1
  131. package/out/zero-cache/src/server/inspector-delegate.d.ts +0 -71
  132. package/out/zero-cache/src/server/inspector-delegate.d.ts.map +0 -1
  133. package/out/zero-cache/src/server/main.d.ts +0 -3
  134. package/out/zero-cache/src/server/main.d.ts.map +0 -1
  135. package/out/zero-cache/src/server/otel-diag-logger.d.ts +0 -16
  136. package/out/zero-cache/src/server/otel-diag-logger.d.ts.map +0 -1
  137. package/out/zero-cache/src/server/otel-start.d.ts +0 -3
  138. package/out/zero-cache/src/server/otel-start.d.ts.map +0 -1
  139. package/out/zero-cache/src/server/priority-op.d.ts +0 -8
  140. package/out/zero-cache/src/server/priority-op.d.ts.map +0 -1
  141. package/out/zero-cache/src/server/reaper.d.ts +0 -3
  142. package/out/zero-cache/src/server/reaper.d.ts.map +0 -1
  143. package/out/zero-cache/src/server/replicator.d.ts +0 -10
  144. package/out/zero-cache/src/server/replicator.d.ts.map +0 -1
  145. package/out/zero-cache/src/server/slot-keeper.d.ts +0 -26
  146. package/out/zero-cache/src/server/slot-keeper.d.ts.map +0 -1
  147. package/out/zero-cache/src/server/syncer-assigner.d.ts +0 -14
  148. package/out/zero-cache/src/server/syncer-assigner.d.ts.map +0 -1
  149. package/out/zero-cache/src/server/syncer.d.ts +0 -3
  150. package/out/zero-cache/src/server/syncer.d.ts.map +0 -1
  151. package/out/zero-cache/src/server/worker-dispatcher.d.ts +0 -17
  152. package/out/zero-cache/src/server/worker-dispatcher.d.ts.map +0 -1
  153. package/out/zero-cache/src/services/analyze.d.ts +0 -9
  154. package/out/zero-cache/src/services/analyze.d.ts.map +0 -1
  155. package/out/zero-cache/src/services/change-source/change-source.d.ts +0 -32
  156. package/out/zero-cache/src/services/change-source/change-source.d.ts.map +0 -1
  157. package/out/zero-cache/src/services/change-source/common/backfill-manager.d.ts +0 -57
  158. package/out/zero-cache/src/services/change-source/common/backfill-manager.d.ts.map +0 -1
  159. package/out/zero-cache/src/services/change-source/common/change-stream-multiplexer.d.ts +0 -55
  160. package/out/zero-cache/src/services/change-source/common/change-stream-multiplexer.d.ts.map +0 -1
  161. package/out/zero-cache/src/services/change-source/common/init-cleanup.d.ts +0 -24
  162. package/out/zero-cache/src/services/change-source/common/init-cleanup.d.ts.map +0 -1
  163. package/out/zero-cache/src/services/change-source/common/replica-restore.d.ts +0 -115
  164. package/out/zero-cache/src/services/change-source/common/replica-restore.d.ts.map +0 -1
  165. package/out/zero-cache/src/services/change-source/common/replica-schema.d.ts +0 -14
  166. package/out/zero-cache/src/services/change-source/common/replica-schema.d.ts.map +0 -1
  167. package/out/zero-cache/src/services/change-source/custom/change-source.d.ts +0 -25
  168. package/out/zero-cache/src/services/change-source/custom/change-source.d.ts.map +0 -1
  169. package/out/zero-cache/src/services/change-source/pg/backfill-metadata.d.ts +0 -14
  170. package/out/zero-cache/src/services/change-source/pg/backfill-metadata.d.ts.map +0 -1
  171. package/out/zero-cache/src/services/change-source/pg/backfill-stream.d.ts +0 -36
  172. package/out/zero-cache/src/services/change-source/pg/backfill-stream.d.ts.map +0 -1
  173. package/out/zero-cache/src/services/change-source/pg/change-source-init.d.ts +0 -65
  174. package/out/zero-cache/src/services/change-source/pg/change-source-init.d.ts.map +0 -1
  175. package/out/zero-cache/src/services/change-source/pg/change-source.d.ts +0 -115
  176. package/out/zero-cache/src/services/change-source/pg/change-source.d.ts.map +0 -1
  177. package/out/zero-cache/src/services/change-source/pg/initial-sync.d.ts +0 -155
  178. package/out/zero-cache/src/services/change-source/pg/initial-sync.d.ts.map +0 -1
  179. package/out/zero-cache/src/services/change-source/pg/logical-replication/binary-reader.d.ts +0 -17
  180. package/out/zero-cache/src/services/change-source/pg/logical-replication/binary-reader.d.ts.map +0 -1
  181. package/out/zero-cache/src/services/change-source/pg/logical-replication/pgoutput-parser.d.ts +0 -28
  182. package/out/zero-cache/src/services/change-source/pg/logical-replication/pgoutput-parser.d.ts.map +0 -1
  183. package/out/zero-cache/src/services/change-source/pg/logical-replication/pgoutput.types.d.ts +0 -76
  184. package/out/zero-cache/src/services/change-source/pg/logical-replication/pgoutput.types.d.ts.map +0 -1
  185. package/out/zero-cache/src/services/change-source/pg/logical-replication/stream.d.ts +0 -169
  186. package/out/zero-cache/src/services/change-source/pg/logical-replication/stream.d.ts.map +0 -1
  187. package/out/zero-cache/src/services/change-source/pg/replication-slot-cleanup-monitor.d.ts +0 -16
  188. package/out/zero-cache/src/services/change-source/pg/replication-slot-cleanup-monitor.d.ts.map +0 -1
  189. package/out/zero-cache/src/services/change-source/pg/replication-slot-health.d.ts +0 -15
  190. package/out/zero-cache/src/services/change-source/pg/replication-slot-health.d.ts.map +0 -1
  191. package/out/zero-cache/src/services/change-source/pg/replication-slots.d.ts +0 -127
  192. package/out/zero-cache/src/services/change-source/pg/replication-slots.d.ts.map +0 -1
  193. package/out/zero-cache/src/services/change-source/pg/schema/init.d.ts +0 -9
  194. package/out/zero-cache/src/services/change-source/pg/schema/init.d.ts.map +0 -1
  195. package/out/zero-cache/src/services/change-source/protocol/backfill-progress.d.ts +0 -68
  196. package/out/zero-cache/src/services/change-source/protocol/backfill-progress.d.ts.map +0 -1
  197. package/out/zero-cache/src/services/change-streamer/backfill-state-tracker.d.ts +0 -72
  198. package/out/zero-cache/src/services/change-streamer/backfill-state-tracker.d.ts.map +0 -1
  199. package/out/zero-cache/src/services/change-streamer/backfill-state.d.ts +0 -50
  200. package/out/zero-cache/src/services/change-streamer/backfill-state.d.ts.map +0 -1
  201. package/out/zero-cache/src/services/change-streamer/backup-cleanup-monitor-factory.d.ts +0 -14
  202. package/out/zero-cache/src/services/change-streamer/backup-cleanup-monitor-factory.d.ts.map +0 -1
  203. package/out/zero-cache/src/services/change-streamer/backup-monitor.d.ts +0 -18
  204. package/out/zero-cache/src/services/change-streamer/backup-monitor.d.ts.map +0 -1
  205. package/out/zero-cache/src/services/change-streamer/broadcast.d.ts +0 -98
  206. package/out/zero-cache/src/services/change-streamer/broadcast.d.ts.map +0 -1
  207. package/out/zero-cache/src/services/change-streamer/change-log-codec.d.ts +0 -34
  208. package/out/zero-cache/src/services/change-streamer/change-log-codec.d.ts.map +0 -1
  209. package/out/zero-cache/src/services/change-streamer/change-log-compare-digest.d.ts +0 -34
  210. package/out/zero-cache/src/services/change-streamer/change-log-compare-digest.d.ts.map +0 -1
  211. package/out/zero-cache/src/services/change-streamer/change-log-initializer.d.ts +0 -158
  212. package/out/zero-cache/src/services/change-streamer/change-log-initializer.d.ts.map +0 -1
  213. package/out/zero-cache/src/services/change-streamer/change-log-transaction-hash.d.ts +0 -19
  214. package/out/zero-cache/src/services/change-streamer/change-log-transaction-hash.d.ts.map +0 -1
  215. package/out/zero-cache/src/services/change-streamer/change-streamer-http.d.ts +0 -78
  216. package/out/zero-cache/src/services/change-streamer/change-streamer-http.d.ts.map +0 -1
  217. package/out/zero-cache/src/services/change-streamer/change-streamer-service.d.ts +0 -143
  218. package/out/zero-cache/src/services/change-streamer/change-streamer-service.d.ts.map +0 -1
  219. package/out/zero-cache/src/services/change-streamer/change-streamer.d.ts +0 -586
  220. package/out/zero-cache/src/services/change-streamer/change-streamer.d.ts.map +0 -1
  221. package/out/zero-cache/src/services/change-streamer/drain-tracker.d.ts +0 -24
  222. package/out/zero-cache/src/services/change-streamer/drain-tracker.d.ts.map +0 -1
  223. package/out/zero-cache/src/services/change-streamer/error-type-enum.d.ts +0 -15
  224. package/out/zero-cache/src/services/change-streamer/error-type-enum.d.ts.map +0 -1
  225. package/out/zero-cache/src/services/change-streamer/forwarder.d.ts +0 -49
  226. package/out/zero-cache/src/services/change-streamer/forwarder.d.ts.map +0 -1
  227. package/out/zero-cache/src/services/change-streamer/litestream-sync-requester.d.ts +0 -53
  228. package/out/zero-cache/src/services/change-streamer/litestream-sync-requester.d.ts.map +0 -1
  229. package/out/zero-cache/src/services/change-streamer/litestream3-prometheus-poller.d.ts +0 -88
  230. package/out/zero-cache/src/services/change-streamer/litestream3-prometheus-poller.d.ts.map +0 -1
  231. package/out/zero-cache/src/services/change-streamer/replica-poller.d.ts +0 -15
  232. package/out/zero-cache/src/services/change-streamer/replica-poller.d.ts.map +0 -1
  233. package/out/zero-cache/src/services/change-streamer/restore-admission.d.ts +0 -243
  234. package/out/zero-cache/src/services/change-streamer/restore-admission.d.ts.map +0 -1
  235. package/out/zero-cache/src/services/change-streamer/schema/init.d.ts +0 -6
  236. package/out/zero-cache/src/services/change-streamer/schema/init.d.ts.map +0 -1
  237. package/out/zero-cache/src/services/change-streamer/schema/tables.d.ts +0 -152
  238. package/out/zero-cache/src/services/change-streamer/schema/tables.d.ts.map +0 -1
  239. package/out/zero-cache/src/services/change-streamer/shard-sampling.d.ts +0 -11
  240. package/out/zero-cache/src/services/change-streamer/shard-sampling.d.ts.map +0 -1
  241. package/out/zero-cache/src/services/change-streamer/snapshot-message.d.ts +0 -92
  242. package/out/zero-cache/src/services/change-streamer/snapshot-message.d.ts.map +0 -1
  243. package/out/zero-cache/src/services/change-streamer/snapshot-reservations.d.ts +0 -36
  244. package/out/zero-cache/src/services/change-streamer/snapshot-reservations.d.ts.map +0 -1
  245. package/out/zero-cache/src/services/change-streamer/snapshot.d.ts +0 -22
  246. package/out/zero-cache/src/services/change-streamer/snapshot.d.ts.map +0 -1
  247. package/out/zero-cache/src/services/change-streamer/sqlite-change-log-catchup.d.ts +0 -99
  248. package/out/zero-cache/src/services/change-streamer/sqlite-change-log-catchup.d.ts.map +0 -1
  249. package/out/zero-cache/src/services/change-streamer/sqlite-change-log-comparator.d.ts +0 -83
  250. package/out/zero-cache/src/services/change-streamer/sqlite-change-log-comparator.d.ts.map +0 -1
  251. package/out/zero-cache/src/services/change-streamer/sqlite-change-log-purge-scheduler.d.ts +0 -121
  252. package/out/zero-cache/src/services/change-streamer/sqlite-change-log-purge-scheduler.d.ts.map +0 -1
  253. package/out/zero-cache/src/services/change-streamer/sqlite-change-log-read-router.d.ts +0 -73
  254. package/out/zero-cache/src/services/change-streamer/sqlite-change-log-read-router.d.ts.map +0 -1
  255. package/out/zero-cache/src/services/change-streamer/sqlite-change-log-reader.d.ts +0 -62
  256. package/out/zero-cache/src/services/change-streamer/sqlite-change-log-reader.d.ts.map +0 -1
  257. package/out/zero-cache/src/services/change-streamer/sqlite-change-log-writer.d.ts +0 -114
  258. package/out/zero-cache/src/services/change-streamer/sqlite-change-log-writer.d.ts.map +0 -1
  259. package/out/zero-cache/src/services/change-streamer/storer.d.ts +0 -276
  260. package/out/zero-cache/src/services/change-streamer/storer.d.ts.map +0 -1
  261. package/out/zero-cache/src/services/change-streamer/subscribe.d.ts +0 -485
  262. package/out/zero-cache/src/services/change-streamer/subscribe.d.ts.map +0 -1
  263. package/out/zero-cache/src/services/change-streamer/subscriber.d.ts +0 -194
  264. package/out/zero-cache/src/services/change-streamer/subscriber.d.ts.map +0 -1
  265. package/out/zero-cache/src/services/change-streamer/upstream-acker.d.ts +0 -52
  266. package/out/zero-cache/src/services/change-streamer/upstream-acker.d.ts.map +0 -1
  267. package/out/zero-cache/src/services/limiter/sliding-window-limiter.d.ts +0 -57
  268. package/out/zero-cache/src/services/limiter/sliding-window-limiter.d.ts.map +0 -1
  269. package/out/zero-cache/src/services/litestream/commands.d.ts +0 -77
  270. package/out/zero-cache/src/services/litestream/commands.d.ts.map +0 -1
  271. package/out/zero-cache/src/services/litestream/litestream-controller.d.ts +0 -78
  272. package/out/zero-cache/src/services/litestream/litestream-controller.d.ts.map +0 -1
  273. package/out/zero-cache/src/services/litestream/metrics.d.ts +0 -31
  274. package/out/zero-cache/src/services/litestream/metrics.d.ts.map +0 -1
  275. package/out/zero-cache/src/services/litestream/restore-progress.d.ts +0 -24
  276. package/out/zero-cache/src/services/litestream/restore-progress.d.ts.map +0 -1
  277. package/out/zero-cache/src/services/mutagen/mutagen.d.ts +0 -40
  278. package/out/zero-cache/src/services/mutagen/mutagen.d.ts.map +0 -1
  279. package/out/zero-cache/src/services/mutagen/pusher.d.ts +0 -63
  280. package/out/zero-cache/src/services/mutagen/pusher.d.ts.map +0 -1
  281. package/out/zero-cache/src/services/replicator/change-log-db.d.ts +0 -368
  282. package/out/zero-cache/src/services/replicator/change-log-db.d.ts.map +0 -1
  283. package/out/zero-cache/src/services/replicator/change-log-stream-writer.d.ts +0 -56
  284. package/out/zero-cache/src/services/replicator/change-log-stream-writer.d.ts.map +0 -1
  285. package/out/zero-cache/src/services/replicator/change-processor.d.ts +0 -37
  286. package/out/zero-cache/src/services/replicator/change-processor.d.ts.map +0 -1
  287. package/out/zero-cache/src/services/replicator/drain-handler.d.ts +0 -82
  288. package/out/zero-cache/src/services/replicator/drain-handler.d.ts.map +0 -1
  289. package/out/zero-cache/src/services/replicator/incremental-sync.d.ts +0 -25
  290. package/out/zero-cache/src/services/replicator/incremental-sync.d.ts.map +0 -1
  291. package/out/zero-cache/src/services/replicator/notifier.d.ts +0 -9
  292. package/out/zero-cache/src/services/replicator/notifier.d.ts.map +0 -1
  293. package/out/zero-cache/src/services/replicator/replication-status.d.ts +0 -71
  294. package/out/zero-cache/src/services/replicator/replication-status.d.ts.map +0 -1
  295. package/out/zero-cache/src/services/replicator/replicator.d.ts +0 -86
  296. package/out/zero-cache/src/services/replicator/replicator.d.ts.map +0 -1
  297. package/out/zero-cache/src/services/replicator/reporter/recorder.d.ts +0 -55
  298. package/out/zero-cache/src/services/replicator/reporter/recorder.d.ts.map +0 -1
  299. package/out/zero-cache/src/services/replicator/sqlite-change-log-observability.d.ts +0 -132
  300. package/out/zero-cache/src/services/replicator/sqlite-change-log-observability.d.ts.map +0 -1
  301. package/out/zero-cache/src/services/replicator/sqlite-change-log-purger.d.ts +0 -120
  302. package/out/zero-cache/src/services/replicator/sqlite-change-log-purger.d.ts.map +0 -1
  303. package/out/zero-cache/src/services/replicator/write-worker-client.d.ts +0 -111
  304. package/out/zero-cache/src/services/replicator/write-worker-client.d.ts.map +0 -1
  305. package/out/zero-cache/src/services/run-ast.d.ts +0 -39
  306. package/out/zero-cache/src/services/run-ast.d.ts.map +0 -1
  307. package/out/zero-cache/src/services/runner.d.ts +0 -19
  308. package/out/zero-cache/src/services/runner.d.ts.map +0 -1
  309. package/out/zero-cache/src/services/view-syncer/active-users-gauge.d.ts +0 -17
  310. package/out/zero-cache/src/services/view-syncer/active-users-gauge.d.ts.map +0 -1
  311. package/out/zero-cache/src/services/view-syncer/advancement-metrics.d.ts +0 -26
  312. package/out/zero-cache/src/services/view-syncer/advancement-metrics.d.ts.map +0 -1
  313. package/out/zero-cache/src/services/view-syncer/batch-pacer.d.ts +0 -79
  314. package/out/zero-cache/src/services/view-syncer/batch-pacer.d.ts.map +0 -1
  315. package/out/zero-cache/src/services/view-syncer/client-handler.d.ts +0 -97
  316. package/out/zero-cache/src/services/view-syncer/client-handler.d.ts.map +0 -1
  317. package/out/zero-cache/src/services/view-syncer/client-schema.d.ts +0 -18
  318. package/out/zero-cache/src/services/view-syncer/client-schema.d.ts.map +0 -1
  319. package/out/zero-cache/src/services/view-syncer/connection-context-manager.d.ts +0 -184
  320. package/out/zero-cache/src/services/view-syncer/connection-context-manager.d.ts.map +0 -1
  321. package/out/zero-cache/src/services/view-syncer/cvr-purger.d.ts +0 -22
  322. package/out/zero-cache/src/services/view-syncer/cvr-purger.d.ts.map +0 -1
  323. package/out/zero-cache/src/services/view-syncer/cvr-store.d.ts +0 -128
  324. package/out/zero-cache/src/services/view-syncer/cvr-store.d.ts.map +0 -1
  325. package/out/zero-cache/src/services/view-syncer/cvr.d.ts +0 -294
  326. package/out/zero-cache/src/services/view-syncer/cvr.d.ts.map +0 -1
  327. package/out/zero-cache/src/services/view-syncer/deferred-writes-budget.d.ts +0 -81
  328. package/out/zero-cache/src/services/view-syncer/deferred-writes-budget.d.ts.map +0 -1
  329. package/out/zero-cache/src/services/view-syncer/drain-coordinator.d.ts +0 -45
  330. package/out/zero-cache/src/services/view-syncer/drain-coordinator.d.ts.map +0 -1
  331. package/out/zero-cache/src/services/view-syncer/e2e-serving-lag.d.ts +0 -53
  332. package/out/zero-cache/src/services/view-syncer/e2e-serving-lag.d.ts.map +0 -1
  333. package/out/zero-cache/src/services/view-syncer/hydration-budget.d.ts +0 -33
  334. package/out/zero-cache/src/services/view-syncer/hydration-budget.d.ts.map +0 -1
  335. package/out/zero-cache/src/services/view-syncer/hydration-circuit-breaker.d.ts +0 -51
  336. package/out/zero-cache/src/services/view-syncer/hydration-circuit-breaker.d.ts.map +0 -1
  337. package/out/zero-cache/src/services/view-syncer/inspect-handler.d.ts +0 -34
  338. package/out/zero-cache/src/services/view-syncer/inspect-handler.d.ts.map +0 -1
  339. package/out/zero-cache/src/services/view-syncer/pipeline-driver.d.ts +0 -296
  340. package/out/zero-cache/src/services/view-syncer/pipeline-driver.d.ts.map +0 -1
  341. package/out/zero-cache/src/services/view-syncer/plan-warnings.d.ts +0 -7
  342. package/out/zero-cache/src/services/view-syncer/plan-warnings.d.ts.map +0 -1
  343. package/out/zero-cache/src/services/view-syncer/push-cost.d.ts +0 -132
  344. package/out/zero-cache/src/services/view-syncer/push-cost.d.ts.map +0 -1
  345. package/out/zero-cache/src/services/view-syncer/push-cutoff.d.ts +0 -55
  346. package/out/zero-cache/src/services/view-syncer/push-cutoff.d.ts.map +0 -1
  347. package/out/zero-cache/src/services/view-syncer/query-covering.d.ts +0 -28
  348. package/out/zero-cache/src/services/view-syncer/query-covering.d.ts.map +0 -1
  349. package/out/zero-cache/src/services/view-syncer/query-shape.d.ts +0 -25
  350. package/out/zero-cache/src/services/view-syncer/query-shape.d.ts.map +0 -1
  351. package/out/zero-cache/src/services/view-syncer/query-stats.d.ts +0 -89
  352. package/out/zero-cache/src/services/view-syncer/query-stats.d.ts.map +0 -1
  353. package/out/zero-cache/src/services/view-syncer/row-record-cache.d.ts +0 -90
  354. package/out/zero-cache/src/services/view-syncer/row-record-cache.d.ts.map +0 -1
  355. package/out/zero-cache/src/services/view-syncer/row-set-signature.d.ts +0 -17
  356. package/out/zero-cache/src/services/view-syncer/row-set-signature.d.ts.map +0 -1
  357. package/out/zero-cache/src/services/view-syncer/schema/cvr.d.ts +0 -86
  358. package/out/zero-cache/src/services/view-syncer/schema/cvr.d.ts.map +0 -1
  359. package/out/zero-cache/src/services/view-syncer/schema/init.d.ts +0 -5
  360. package/out/zero-cache/src/services/view-syncer/schema/init.d.ts.map +0 -1
  361. package/out/zero-cache/src/services/view-syncer/schema/types.d.ts +0 -563
  362. package/out/zero-cache/src/services/view-syncer/schema/types.d.ts.map +0 -1
  363. package/out/zero-cache/src/services/view-syncer/snapshot-row-cache.d.ts +0 -95
  364. package/out/zero-cache/src/services/view-syncer/snapshot-row-cache.d.ts.map +0 -1
  365. package/out/zero-cache/src/services/view-syncer/snapshotter.d.ts +0 -420
  366. package/out/zero-cache/src/services/view-syncer/snapshotter.d.ts.map +0 -1
  367. package/out/zero-cache/src/services/view-syncer/tracer.d.ts +0 -2
  368. package/out/zero-cache/src/services/view-syncer/tracer.d.ts.map +0 -1
  369. package/out/zero-cache/src/services/view-syncer/ttl-clock.d.ts +0 -10
  370. package/out/zero-cache/src/services/view-syncer/ttl-clock.d.ts.map +0 -1
  371. package/out/zero-cache/src/services/view-syncer/view-syncer.d.ts +0 -133
  372. package/out/zero-cache/src/services/view-syncer/view-syncer.d.ts.map +0 -1
  373. package/out/zero-cache/src/types/downstream.d.ts +0 -11
  374. package/out/zero-cache/src/types/downstream.d.ts.map +0 -1
  375. package/out/zero-cache/src/types/error-with-level.d.ts +0 -9
  376. package/out/zero-cache/src/types/error-with-level.d.ts.map +0 -1
  377. package/out/zero-cache/src/types/pg-patch.d.ts +0 -21
  378. package/out/zero-cache/src/types/pg-patch.d.ts.map +0 -1
  379. package/out/zero-cache/src/types/pg-versions.d.ts +0 -3
  380. package/out/zero-cache/src/types/pg-versions.d.ts.map +0 -1
  381. package/out/zero-cache/src/types/poke-chunk.d.ts +0 -18
  382. package/out/zero-cache/src/types/poke-chunk.d.ts.map +0 -1
  383. package/out/zero-cache/src/types/streams.d.ts +0 -115
  384. package/out/zero-cache/src/types/streams.d.ts.map +0 -1
  385. package/out/zero-cache/src/types/subscription.d.ts +0 -197
  386. package/out/zero-cache/src/types/subscription.d.ts.map +0 -1
  387. package/out/zero-cache/src/workers/connect-params.d.ts +0 -28
  388. package/out/zero-cache/src/workers/connect-params.d.ts.map +0 -1
  389. package/out/zero-cache/src/workers/connection.d.ts +0 -77
  390. package/out/zero-cache/src/workers/connection.d.ts.map +0 -1
  391. package/out/zero-cache/src/workers/replicator.d.ts +0 -57
  392. package/out/zero-cache/src/workers/replicator.d.ts.map +0 -1
  393. package/out/zero-cache/src/workers/syncer-ws-message-handler.d.ts +0 -14
  394. package/out/zero-cache/src/workers/syncer-ws-message-handler.d.ts.map +0 -1
  395. package/out/zero-cache/src/workers/syncer.d.ts +0 -67
  396. package/out/zero-cache/src/workers/syncer.d.ts.map +0 -1
  397. package/out/zero-events/src/index.d.ts +0 -27
  398. package/out/zero-events/src/index.d.ts.map +0 -1
  399. package/out/zero-events/src/json.d.ts +0 -20
  400. package/out/zero-events/src/json.d.ts.map +0 -1
  401. package/out/zero-events/src/status.d.ts +0 -144
  402. package/out/zero-events/src/status.d.ts.map +0 -1
  403. package/out/zqlite/src/database-storage.d.ts +0 -43
  404. package/out/zqlite/src/database-storage.d.ts.map +0 -1
  405. package/out/zqlite/src/explain-queries.d.ts +0 -4
  406. package/out/zqlite/src/explain-queries.d.ts.map +0 -1
  407. package/out/zqlite/src/internal/sql-inline.d.ts +0 -13
  408. package/out/zqlite/src/internal/sql-inline.d.ts.map +0 -1
  409. package/out/zqlite/src/resolve-scalar-subqueries.d.ts +0 -72
  410. package/out/zqlite/src/resolve-scalar-subqueries.d.ts.map +0 -1
  411. package/out/zqlite/src/sqlite-cost-model.d.ts +0 -17
  412. package/out/zqlite/src/sqlite-cost-model.d.ts.map +0 -1
  413. package/out/zqlite/src/sqlite-stat-fanout.d.ts +0 -121
  414. package/out/zqlite/src/sqlite-stat-fanout.d.ts.map +0 -1
@@ -1,563 +0,0 @@
1
- import * as v from '../../../../../shared/src/valita.ts';
2
- import type { QueriesRow } from './cvr.ts';
3
- export declare const cvrVersionSchema: v.ObjectType<{
4
- /**
5
- * The database `stateVersion` with which the rows in the CVR are consistent.
6
- */
7
- stateVersion: v.Type<string>;
8
- /**
9
- * `configVersion` is subversion of `stateVersion` that is initially absent for each
10
- * `stateVersion`, and incremented for configuration changes that affect the contents
11
- * of the CVR such as:
12
- *
13
- * * query set changes
14
- * * query transformation changes (which may happen for changes
15
- * in server-side logic or authorization policies)
16
- *
17
- * Such configuration changes are always correlated with a change to one or more
18
- * `/meta/...` records in the CVR, often (but not always) with corresponding
19
- * patches in `/patches/meta/...`.
20
- *
21
- * When the `stateVersion` moves forward, the `minorVersion` is reset to absent.
22
- * In this manner it behaves like the analogous concept in semantic versioning.
23
- */
24
- configVersion: v.Optional<number>;
25
- }, undefined>;
26
- export type CVRVersion = v.Infer<typeof cvrVersionSchema>;
27
- export declare const EMPTY_CVR_VERSION: CVRVersion;
28
- export declare function oneAfter(v: NullableCVRVersion): CVRVersion;
29
- export type NullableCVRVersion = CVRVersion | null;
30
- export declare function cmpVersions(a: NullableCVRVersion, b: NullableCVRVersion): number;
31
- export declare function maxVersion(a: CVRVersion, b?: CVRVersion): CVRVersion;
32
- export declare function versionToCookie(v: CVRVersion): string;
33
- export declare function versionToNullableCookie(v: NullableCVRVersion): string | null;
34
- export declare function cookieToVersion(cookie: string | null): NullableCVRVersion;
35
- export declare const cvrIDSchema: v.ObjectType<{
36
- id: v.Type<string>;
37
- }, undefined>;
38
- export type CvrID = v.Infer<typeof cvrIDSchema>;
39
- export declare const clientRecordSchema: v.ObjectType<{
40
- /** The client ID, of which there can be multiple for a client group view. */
41
- id: v.Type<string>;
42
- /** The client's desired query IDs. Patch information is stored in the QueryRecord. */
43
- desiredQueryIDs: v.ArrayType<v.Type<string>>;
44
- }, undefined>;
45
- export type ClientRecord = v.Infer<typeof clientRecordSchema>;
46
- export declare const baseQueryRecordSchema: v.ObjectType<{
47
- /** The client-specified ID used to identify this query. Typically a hash. */
48
- id: v.Type<string>;
49
- /**
50
- * The hash of the query after server-side transformations, which include:
51
- *
52
- * * Normalization (which may differ from what the client does)
53
- * * Query "expansion" to include primary keys and query-execution-related columns
54
- * * Authorization transforms
55
- *
56
- * Transformations depend on conditions that are independent of the db state version,
57
- * such as server-side logic and authorization policies. As such, the version of a CVR
58
- * version may need to be advanced independent of db state changes. This is done
59
- * via the `minorVersion` counter of the CVRVersion object, which is used to account
60
- * for both changes to the query set and changes to query transformations (which are
61
- * effectively remove-old-query + add-new-query).
62
- *
63
- * Note that the transformed AST itself is **not** stored, as the result of the previous
64
- * transformation is not useful in and of itself. If the current transformation results in
65
- * a different hash than that of the transformation used for the last version of the CVR,
66
- * it is simply handled by invalidating the existing rows, re-executed the query with
67
- * the new transformation, and advancing the CVR's `minorVersion` and this query's
68
- * `transformationVersion`.
69
- *
70
- * Note that the transformationHash is only stored when the query has reached the "gotten"
71
- * state. If the query is in the "desired" but not yet "gotten" state, the field is absent.
72
- */
73
- transformationHash: v.Optional<string>;
74
- /**
75
- * The CVR version corresponding to the `transformationHash`. This essentially tracks when
76
- * this version of the query was effectively added to the CVR (as opposed to the
77
- * `patchVersion`, which is simply when the client was notified that its query was added
78
- * to the gotten set). Catchup of clients from old CVR versions require executing all
79
- * queries with a newer `transformationVersion`.
80
- */
81
- transformationVersion: v.Optional<{
82
- stateVersion: string;
83
- configVersion?: number | undefined;
84
- }>;
85
- }, undefined>;
86
- /**
87
- * Internal queries track rows in the database for internal use, such as the
88
- * `lastMutationID`s in the `zero.clients` table. They participate in the standard
89
- * invalidation / update logic for row contents, but not in the desired/got or
90
- * size-based quota logic for client-requested queries.
91
- */
92
- export declare const internalQueryRecordSchema: v.ObjectType<Omit<{
93
- /** The client-specified ID used to identify this query. Typically a hash. */
94
- id: v.Type<string>;
95
- /**
96
- * The hash of the query after server-side transformations, which include:
97
- *
98
- * * Normalization (which may differ from what the client does)
99
- * * Query "expansion" to include primary keys and query-execution-related columns
100
- * * Authorization transforms
101
- *
102
- * Transformations depend on conditions that are independent of the db state version,
103
- * such as server-side logic and authorization policies. As such, the version of a CVR
104
- * version may need to be advanced independent of db state changes. This is done
105
- * via the `minorVersion` counter of the CVRVersion object, which is used to account
106
- * for both changes to the query set and changes to query transformations (which are
107
- * effectively remove-old-query + add-new-query).
108
- *
109
- * Note that the transformed AST itself is **not** stored, as the result of the previous
110
- * transformation is not useful in and of itself. If the current transformation results in
111
- * a different hash than that of the transformation used for the last version of the CVR,
112
- * it is simply handled by invalidating the existing rows, re-executed the query with
113
- * the new transformation, and advancing the CVR's `minorVersion` and this query's
114
- * `transformationVersion`.
115
- *
116
- * Note that the transformationHash is only stored when the query has reached the "gotten"
117
- * state. If the query is in the "desired" but not yet "gotten" state, the field is absent.
118
- */
119
- transformationHash: v.Optional<string>;
120
- /**
121
- * The CVR version corresponding to the `transformationHash`. This essentially tracks when
122
- * this version of the query was effectively added to the CVR (as opposed to the
123
- * `patchVersion`, which is simply when the client was notified that its query was added
124
- * to the gotten set). Catchup of clients from old CVR versions require executing all
125
- * queries with a newer `transformationVersion`.
126
- */
127
- transformationVersion: v.Optional<{
128
- stateVersion: string;
129
- configVersion?: number | undefined;
130
- }>;
131
- }, "ast" | "type"> & {
132
- type: v.Type<"internal">;
133
- ast: v.Type<import("../../../../../zero-protocol/src/ast.ts").AST>;
134
- }, undefined>;
135
- export type InternalQueryRecord = v.Infer<typeof internalQueryRecordSchema>;
136
- export declare const clientQueryRecordSchema: v.ObjectType<Omit<Omit<{
137
- /** The client-specified ID used to identify this query. Typically a hash. */
138
- id: v.Type<string>;
139
- /**
140
- * The hash of the query after server-side transformations, which include:
141
- *
142
- * * Normalization (which may differ from what the client does)
143
- * * Query "expansion" to include primary keys and query-execution-related columns
144
- * * Authorization transforms
145
- *
146
- * Transformations depend on conditions that are independent of the db state version,
147
- * such as server-side logic and authorization policies. As such, the version of a CVR
148
- * version may need to be advanced independent of db state changes. This is done
149
- * via the `minorVersion` counter of the CVRVersion object, which is used to account
150
- * for both changes to the query set and changes to query transformations (which are
151
- * effectively remove-old-query + add-new-query).
152
- *
153
- * Note that the transformed AST itself is **not** stored, as the result of the previous
154
- * transformation is not useful in and of itself. If the current transformation results in
155
- * a different hash than that of the transformation used for the last version of the CVR,
156
- * it is simply handled by invalidating the existing rows, re-executed the query with
157
- * the new transformation, and advancing the CVR's `minorVersion` and this query's
158
- * `transformationVersion`.
159
- *
160
- * Note that the transformationHash is only stored when the query has reached the "gotten"
161
- * state. If the query is in the "desired" but not yet "gotten" state, the field is absent.
162
- */
163
- transformationHash: v.Optional<string>;
164
- /**
165
- * The CVR version corresponding to the `transformationHash`. This essentially tracks when
166
- * this version of the query was effectively added to the CVR (as opposed to the
167
- * `patchVersion`, which is simply when the client was notified that its query was added
168
- * to the gotten set). Catchup of clients from old CVR versions require executing all
169
- * queries with a newer `transformationVersion`.
170
- */
171
- transformationVersion: v.Optional<{
172
- stateVersion: string;
173
- configVersion?: number | undefined;
174
- }>;
175
- }, "clientState" | "patchVersion"> & {
176
- /**
177
- * The client state for this query, which includes the inactivatedAt, ttl and
178
- * version. The client state is stored in a record with the client ID as the
179
- * key.
180
- */
181
- clientState: v.Type<Record<string, {
182
- inactivatedAt?: import("../ttl-clock.ts").TTLClock | undefined;
183
- ttl: number;
184
- version: {
185
- stateVersion: string;
186
- configVersion?: number | undefined;
187
- };
188
- }>>;
189
- patchVersion: v.Optional<{
190
- stateVersion: string;
191
- configVersion?: number | undefined;
192
- }>;
193
- }, "ast" | "type"> & {
194
- type: v.Type<"client">;
195
- /** The original AST as supplied by the client. */
196
- ast: v.Type<import("../../../../../zero-protocol/src/ast.ts").AST>;
197
- }, undefined>;
198
- export type ClientQueryRecord = v.Infer<typeof clientQueryRecordSchema>;
199
- export declare const customQueryRecordSchema: v.ObjectType<Omit<Omit<{
200
- /** The client-specified ID used to identify this query. Typically a hash. */
201
- id: v.Type<string>;
202
- /**
203
- * The hash of the query after server-side transformations, which include:
204
- *
205
- * * Normalization (which may differ from what the client does)
206
- * * Query "expansion" to include primary keys and query-execution-related columns
207
- * * Authorization transforms
208
- *
209
- * Transformations depend on conditions that are independent of the db state version,
210
- * such as server-side logic and authorization policies. As such, the version of a CVR
211
- * version may need to be advanced independent of db state changes. This is done
212
- * via the `minorVersion` counter of the CVRVersion object, which is used to account
213
- * for both changes to the query set and changes to query transformations (which are
214
- * effectively remove-old-query + add-new-query).
215
- *
216
- * Note that the transformed AST itself is **not** stored, as the result of the previous
217
- * transformation is not useful in and of itself. If the current transformation results in
218
- * a different hash than that of the transformation used for the last version of the CVR,
219
- * it is simply handled by invalidating the existing rows, re-executed the query with
220
- * the new transformation, and advancing the CVR's `minorVersion` and this query's
221
- * `transformationVersion`.
222
- *
223
- * Note that the transformationHash is only stored when the query has reached the "gotten"
224
- * state. If the query is in the "desired" but not yet "gotten" state, the field is absent.
225
- */
226
- transformationHash: v.Optional<string>;
227
- /**
228
- * The CVR version corresponding to the `transformationHash`. This essentially tracks when
229
- * this version of the query was effectively added to the CVR (as opposed to the
230
- * `patchVersion`, which is simply when the client was notified that its query was added
231
- * to the gotten set). Catchup of clients from old CVR versions require executing all
232
- * queries with a newer `transformationVersion`.
233
- */
234
- transformationVersion: v.Optional<{
235
- stateVersion: string;
236
- configVersion?: number | undefined;
237
- }>;
238
- }, "clientState" | "patchVersion"> & {
239
- /**
240
- * The client state for this query, which includes the inactivatedAt, ttl and
241
- * version. The client state is stored in a record with the client ID as the
242
- * key.
243
- */
244
- clientState: v.Type<Record<string, {
245
- inactivatedAt?: import("../ttl-clock.ts").TTLClock | undefined;
246
- ttl: number;
247
- version: {
248
- stateVersion: string;
249
- configVersion?: number | undefined;
250
- };
251
- }>>;
252
- patchVersion: v.Optional<{
253
- stateVersion: string;
254
- configVersion?: number | undefined;
255
- }>;
256
- }, "args" | "name" | "type"> & {
257
- type: v.Type<"custom">;
258
- name: v.Type<string>;
259
- args: v.Type<readonly import("../../../../../shared/src/json.ts").ReadonlyJSONValue[]>;
260
- }, undefined>;
261
- export type CustomQueryRecord = v.Infer<typeof customQueryRecordSchema>;
262
- export declare const queryRecordSchema: v.UnionType<[v.ObjectType<Omit<Omit<{
263
- /** The client-specified ID used to identify this query. Typically a hash. */
264
- id: v.Type<string>;
265
- /**
266
- * The hash of the query after server-side transformations, which include:
267
- *
268
- * * Normalization (which may differ from what the client does)
269
- * * Query "expansion" to include primary keys and query-execution-related columns
270
- * * Authorization transforms
271
- *
272
- * Transformations depend on conditions that are independent of the db state version,
273
- * such as server-side logic and authorization policies. As such, the version of a CVR
274
- * version may need to be advanced independent of db state changes. This is done
275
- * via the `minorVersion` counter of the CVRVersion object, which is used to account
276
- * for both changes to the query set and changes to query transformations (which are
277
- * effectively remove-old-query + add-new-query).
278
- *
279
- * Note that the transformed AST itself is **not** stored, as the result of the previous
280
- * transformation is not useful in and of itself. If the current transformation results in
281
- * a different hash than that of the transformation used for the last version of the CVR,
282
- * it is simply handled by invalidating the existing rows, re-executed the query with
283
- * the new transformation, and advancing the CVR's `minorVersion` and this query's
284
- * `transformationVersion`.
285
- *
286
- * Note that the transformationHash is only stored when the query has reached the "gotten"
287
- * state. If the query is in the "desired" but not yet "gotten" state, the field is absent.
288
- */
289
- transformationHash: v.Optional<string>;
290
- /**
291
- * The CVR version corresponding to the `transformationHash`. This essentially tracks when
292
- * this version of the query was effectively added to the CVR (as opposed to the
293
- * `patchVersion`, which is simply when the client was notified that its query was added
294
- * to the gotten set). Catchup of clients from old CVR versions require executing all
295
- * queries with a newer `transformationVersion`.
296
- */
297
- transformationVersion: v.Optional<{
298
- stateVersion: string;
299
- configVersion?: number | undefined;
300
- }>;
301
- }, "clientState" | "patchVersion"> & {
302
- /**
303
- * The client state for this query, which includes the inactivatedAt, ttl and
304
- * version. The client state is stored in a record with the client ID as the
305
- * key.
306
- */
307
- clientState: v.Type<Record<string, {
308
- inactivatedAt?: import("../ttl-clock.ts").TTLClock | undefined;
309
- ttl: number;
310
- version: {
311
- stateVersion: string;
312
- configVersion?: number | undefined;
313
- };
314
- }>>;
315
- patchVersion: v.Optional<{
316
- stateVersion: string;
317
- configVersion?: number | undefined;
318
- }>;
319
- }, "ast" | "type"> & {
320
- type: v.Type<"client">;
321
- /** The original AST as supplied by the client. */
322
- ast: v.Type<import("../../../../../zero-protocol/src/ast.ts").AST>;
323
- }, undefined>, v.ObjectType<Omit<Omit<{
324
- /** The client-specified ID used to identify this query. Typically a hash. */
325
- id: v.Type<string>;
326
- /**
327
- * The hash of the query after server-side transformations, which include:
328
- *
329
- * * Normalization (which may differ from what the client does)
330
- * * Query "expansion" to include primary keys and query-execution-related columns
331
- * * Authorization transforms
332
- *
333
- * Transformations depend on conditions that are independent of the db state version,
334
- * such as server-side logic and authorization policies. As such, the version of a CVR
335
- * version may need to be advanced independent of db state changes. This is done
336
- * via the `minorVersion` counter of the CVRVersion object, which is used to account
337
- * for both changes to the query set and changes to query transformations (which are
338
- * effectively remove-old-query + add-new-query).
339
- *
340
- * Note that the transformed AST itself is **not** stored, as the result of the previous
341
- * transformation is not useful in and of itself. If the current transformation results in
342
- * a different hash than that of the transformation used for the last version of the CVR,
343
- * it is simply handled by invalidating the existing rows, re-executed the query with
344
- * the new transformation, and advancing the CVR's `minorVersion` and this query's
345
- * `transformationVersion`.
346
- *
347
- * Note that the transformationHash is only stored when the query has reached the "gotten"
348
- * state. If the query is in the "desired" but not yet "gotten" state, the field is absent.
349
- */
350
- transformationHash: v.Optional<string>;
351
- /**
352
- * The CVR version corresponding to the `transformationHash`. This essentially tracks when
353
- * this version of the query was effectively added to the CVR (as opposed to the
354
- * `patchVersion`, which is simply when the client was notified that its query was added
355
- * to the gotten set). Catchup of clients from old CVR versions require executing all
356
- * queries with a newer `transformationVersion`.
357
- */
358
- transformationVersion: v.Optional<{
359
- stateVersion: string;
360
- configVersion?: number | undefined;
361
- }>;
362
- }, "clientState" | "patchVersion"> & {
363
- /**
364
- * The client state for this query, which includes the inactivatedAt, ttl and
365
- * version. The client state is stored in a record with the client ID as the
366
- * key.
367
- */
368
- clientState: v.Type<Record<string, {
369
- inactivatedAt?: import("../ttl-clock.ts").TTLClock | undefined;
370
- ttl: number;
371
- version: {
372
- stateVersion: string;
373
- configVersion?: number | undefined;
374
- };
375
- }>>;
376
- patchVersion: v.Optional<{
377
- stateVersion: string;
378
- configVersion?: number | undefined;
379
- }>;
380
- }, "args" | "name" | "type"> & {
381
- type: v.Type<"custom">;
382
- name: v.Type<string>;
383
- args: v.Type<readonly import("../../../../../shared/src/json.ts").ReadonlyJSONValue[]>;
384
- }, undefined>, v.ObjectType<Omit<{
385
- /** The client-specified ID used to identify this query. Typically a hash. */
386
- id: v.Type<string>;
387
- /**
388
- * The hash of the query after server-side transformations, which include:
389
- *
390
- * * Normalization (which may differ from what the client does)
391
- * * Query "expansion" to include primary keys and query-execution-related columns
392
- * * Authorization transforms
393
- *
394
- * Transformations depend on conditions that are independent of the db state version,
395
- * such as server-side logic and authorization policies. As such, the version of a CVR
396
- * version may need to be advanced independent of db state changes. This is done
397
- * via the `minorVersion` counter of the CVRVersion object, which is used to account
398
- * for both changes to the query set and changes to query transformations (which are
399
- * effectively remove-old-query + add-new-query).
400
- *
401
- * Note that the transformed AST itself is **not** stored, as the result of the previous
402
- * transformation is not useful in and of itself. If the current transformation results in
403
- * a different hash than that of the transformation used for the last version of the CVR,
404
- * it is simply handled by invalidating the existing rows, re-executed the query with
405
- * the new transformation, and advancing the CVR's `minorVersion` and this query's
406
- * `transformationVersion`.
407
- *
408
- * Note that the transformationHash is only stored when the query has reached the "gotten"
409
- * state. If the query is in the "desired" but not yet "gotten" state, the field is absent.
410
- */
411
- transformationHash: v.Optional<string>;
412
- /**
413
- * The CVR version corresponding to the `transformationHash`. This essentially tracks when
414
- * this version of the query was effectively added to the CVR (as opposed to the
415
- * `patchVersion`, which is simply when the client was notified that its query was added
416
- * to the gotten set). Catchup of clients from old CVR versions require executing all
417
- * queries with a newer `transformationVersion`.
418
- */
419
- transformationVersion: v.Optional<{
420
- stateVersion: string;
421
- configVersion?: number | undefined;
422
- }>;
423
- }, "ast" | "type"> & {
424
- type: v.Type<"internal">;
425
- ast: v.Type<import("../../../../../zero-protocol/src/ast.ts").AST>;
426
- }, undefined>]>;
427
- export type QueryRecord = v.Infer<typeof queryRecordSchema>;
428
- export declare const rowIDSchema: v.ObjectType<{
429
- schema: v.Type<string>;
430
- table: v.Type<string>;
431
- rowKey: v.Type<Record<string, import("../../../../../shared/src/bigint-json.ts").JSONValue>>;
432
- }, undefined>;
433
- export type RowID = v.Infer<typeof rowIDSchema>;
434
- export declare const rowRecordSchema: v.ObjectType<Omit<{
435
- /**
436
- * CVR records store the CVRVersion at which the record was last patched into
437
- * the CVR, which corresponds with a patch row that is cleaned up when the
438
- * record is changed (updated, deleted, and re-added in the case of rows).
439
- *
440
- * Tombstones are stored for row records but not for config records. This means
441
- * that "orphaned" delete patches for config records may exist, and therefore
442
- * scans of config patches must always run until the end of the list. On the
443
- * contrary, for row patches, the row record tombstones allow cleanup of delete
444
- * patches.
445
- */
446
- patchVersion: v.ObjectType<{
447
- /**
448
- * The database `stateVersion` with which the rows in the CVR are consistent.
449
- */
450
- stateVersion: v.Type<string>;
451
- /**
452
- * `configVersion` is subversion of `stateVersion` that is initially absent for each
453
- * `stateVersion`, and incremented for configuration changes that affect the contents
454
- * of the CVR such as:
455
- *
456
- * * query set changes
457
- * * query transformation changes (which may happen for changes
458
- * in server-side logic or authorization policies)
459
- *
460
- * Such configuration changes are always correlated with a change to one or more
461
- * `/meta/...` records in the CVR, often (but not always) with corresponding
462
- * patches in `/patches/meta/...`.
463
- *
464
- * When the `stateVersion` moves forward, the `minorVersion` is reset to absent.
465
- * In this manner it behaves like the analogous concept in semantic versioning.
466
- */
467
- configVersion: v.Optional<number>;
468
- }, undefined>;
469
- }, "id" | "refCounts" | "rowVersion"> & {
470
- id: v.ObjectType<{
471
- schema: v.Type<string>;
472
- table: v.Type<string>;
473
- rowKey: v.Type<Record<string, import("../../../../../shared/src/bigint-json.ts").JSONValue>>;
474
- }, undefined>;
475
- rowVersion: v.Type<string>;
476
- refCounts: v.UnionType<[v.Type<null>, v.Type<Record<string, number>>]>;
477
- }, undefined>;
478
- export type RowRecord = v.Infer<typeof rowRecordSchema>;
479
- export declare const patchSchema: v.ObjectType<{
480
- type: v.Type<"query" | "row">;
481
- op: v.Type<"del" | "put">;
482
- }, undefined>;
483
- export declare const putRowPatchSchema: v.ObjectType<Omit<{
484
- type: v.Type<"query" | "row">;
485
- op: v.Type<"del" | "put">;
486
- }, "id" | "op" | "rowVersion" | "type"> & {
487
- type: v.Type<"row">;
488
- op: v.Type<"put">;
489
- id: v.ObjectType<{
490
- schema: v.Type<string>;
491
- table: v.Type<string>;
492
- rowKey: v.Type<Record<string, import("../../../../../shared/src/bigint-json.ts").JSONValue>>;
493
- }, undefined>;
494
- rowVersion: v.Type<string>;
495
- }, undefined>;
496
- export type PutRowPatch = v.Infer<typeof putRowPatchSchema>;
497
- export declare const delRowPatchSchema: v.ObjectType<Omit<{
498
- type: v.Type<"query" | "row">;
499
- op: v.Type<"del" | "put">;
500
- }, "id" | "op" | "type"> & {
501
- type: v.Type<"row">;
502
- op: v.Type<"del">;
503
- id: v.ObjectType<{
504
- schema: v.Type<string>;
505
- table: v.Type<string>;
506
- rowKey: v.Type<Record<string, import("../../../../../shared/src/bigint-json.ts").JSONValue>>;
507
- }, undefined>;
508
- }, undefined>;
509
- export type DelRowPatch = v.Infer<typeof delRowPatchSchema>;
510
- export declare const rowPatchSchema: v.UnionType<[v.ObjectType<Omit<{
511
- type: v.Type<"query" | "row">;
512
- op: v.Type<"del" | "put">;
513
- }, "id" | "op" | "rowVersion" | "type"> & {
514
- type: v.Type<"row">;
515
- op: v.Type<"put">;
516
- id: v.ObjectType<{
517
- schema: v.Type<string>;
518
- table: v.Type<string>;
519
- rowKey: v.Type<Record<string, import("../../../../../shared/src/bigint-json.ts").JSONValue>>;
520
- }, undefined>;
521
- rowVersion: v.Type<string>;
522
- }, undefined>, v.ObjectType<Omit<{
523
- type: v.Type<"query" | "row">;
524
- op: v.Type<"del" | "put">;
525
- }, "id" | "op" | "type"> & {
526
- type: v.Type<"row">;
527
- op: v.Type<"del">;
528
- id: v.ObjectType<{
529
- schema: v.Type<string>;
530
- table: v.Type<string>;
531
- rowKey: v.Type<Record<string, import("../../../../../shared/src/bigint-json.ts").JSONValue>>;
532
- }, undefined>;
533
- }, undefined>]>;
534
- export type RowPatch = v.Infer<typeof rowPatchSchema>;
535
- export declare const queryPatchSchema: v.ObjectType<Omit<{
536
- type: v.Type<"query" | "row">;
537
- op: v.Type<"del" | "put">;
538
- }, "clientID" | "id" | "type"> & {
539
- type: v.Type<"query">;
540
- id: v.Type<string>;
541
- clientID: v.Optional<string>;
542
- }, undefined>;
543
- export type QueryPatch = v.Infer<typeof queryPatchSchema>;
544
- export type PutQueryPatch = QueryPatch & {
545
- op: 'put';
546
- };
547
- export type DelQueryPatch = QueryPatch & {
548
- op: 'del';
549
- };
550
- export declare const metadataPatchSchema: v.ObjectType<Omit<{
551
- type: v.Type<"query" | "row">;
552
- op: v.Type<"del" | "put">;
553
- }, "clientID" | "id" | "type"> & {
554
- type: v.Type<"query">;
555
- id: v.Type<string>;
556
- clientID: v.Optional<string>;
557
- }, undefined>;
558
- export type MetadataPatch = v.Infer<typeof metadataPatchSchema>;
559
- export declare function versionString(v: CVRVersion): string;
560
- export declare function versionFromString(str: string): CVRVersion;
561
- export declare function queryRecordToQueryRow(clientGroupID: string, query: QueryRecord, rowSetSignature: string | null): QueriesRow;
562
- export declare const maybeVersionString: (v: CVRVersion | undefined) => string | null;
563
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../../zero-cache/src/services/view-syncer/schema/types.ts"],"names":[],"mappings":"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"}
@@ -1,95 +0,0 @@
1
- /**
2
- * The default maximum number of entries retained by a {@link SnapshotRowCache}.
3
- *
4
- * Each entry is a raw SQLite row (or the list of rows conflicting with
5
- * a row on its unique keys) read while computing a snapshot diff. A
6
- * replicated transaction of N rows produces up to 2N entries (the new value
7
- * and the previous value(s) of each row), so the cache should be large enough
8
- * to hold the largest transactions that are commonly replicated in order for
9
- * all of the client groups on a worker to share the reads.
10
- */
11
- export declare const DEFAULT_MAX_SNAPSHOT_ROW_CACHE_ENTRIES = 50000;
12
- /**
13
- * How a statement's results are read: a single row (`Statement.get()`) or
14
- * all rows (`Statement.all()`).
15
- */
16
- export type ReadMode = 'get' | 'all';
17
- /**
18
- * The maximum number of distinct SQL statements interned by a
19
- * {@link SnapshotRowCache} before it is cleared. There is one per table and
20
- * lookup shape, so this is only reached after many schema changes.
21
- */
22
- export declare const MAX_INTERNED_STATEMENTS = 10000;
23
- /**
24
- * A worker-wide, bounded cache of the rows that a `Snapshotter` reads from
25
- * replica snapshots when computing the diff between two versions of the
26
- * replica.
27
- *
28
- * Every client group (i.e. view-syncer) on a sync worker computes its own
29
- * diff from the shared `_zero.changeLog2`, and each change in the diff costs
30
- * two SQLite reads: the new value of the row (from the `curr` snapshot) and
31
- * the previous value(s) that it replaces (from the `prev` snapshot). The
32
- * reads for a given change are identical for every client group that
33
- * traverses it, so a replicated transaction of N rows costs N × 2 × (client
34
- * groups) reads per worker, most of which are redundant. This cache lets the
35
- * client groups on a worker share those reads.
36
- *
37
- * ### Keys
38
- *
39
- * Entries are keyed by the exact SQL statement and arguments of the read
40
- * (which encodes the table, the selected columns and the lookup keys), plus
41
- * a `tag` supplied by the caller that pins the result to a version of the
42
- * replica:
43
- *
44
- * - The new value of a row is the row as of the `stateVersion` recorded in
45
- * its change log entry (its `_0_version` is asserted to equal that
46
- * version), and is tagged with that `stateVersion`. It is thus shareable
47
- * by all client groups regardless of the snapshots they are advancing
48
- * between.
49
- * - Previous values are read from the `prev` snapshot at its version, and
50
- * are tagged with that version (and, when the result can depend on the
51
- * changes applied to the snapshot before the read, the `curr` version
52
- * as well). See `Diff` in `snapshotter.ts` for the details.
53
- *
54
- * Because every key includes the version(s) that the result depends on,
55
- * entries never go stale and are never invalidated; they are only evicted.
56
- *
57
- * ### Eviction
58
- *
59
- * The cache is bounded by entry count and evicts in insertion (FIFO) order
60
- * rather than by recency. Diffs are traversed in change log order by every
61
- * client group, so the entries that will not be needed again are those that
62
- * were inserted the earliest (all groups have moved past them), while the
63
- * most recently inserted entries are the ones that the trailing groups have
64
- * yet to reach. Refreshing an entry on a hit would evict exactly the wrong
65
- * entries when a trailing group catches up.
66
- *
67
- * ### Sharing
68
- *
69
- * Cached values are shared by reference across client groups and must
70
- * therefore never be mutated by callers.
71
- */
72
- export declare class SnapshotRowCache {
73
- #private;
74
- constructor(maxEntries?: number);
75
- get size(): number;
76
- get maxEntries(): number;
77
- stats(): {
78
- hits: number;
79
- misses: number;
80
- size: number;
81
- };
82
- /**
83
- * Returns the cached result of the read identified by `tag`, `sql`, `mode`
84
- * and `args`, or performs the read via `read()`, caching and returning its
85
- * result. `undefined` results (i.e. a missing row) are not cached.
86
- *
87
- * `mode` is part of the key because the same statement can be read both
88
- * ways: for a table whose only unique key is its primary key, `getRow()`
89
- * and `getRows()` produce identical SQL, args and tags, but the former
90
- * caches a row and the latter an array of rows.
91
- */
92
- getOrRead<T>(tag: string, sql: string, mode: ReadMode, args: unknown[], read: () => T): T;
93
- clear(): void;
94
- }
95
- //# sourceMappingURL=snapshot-row-cache.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"snapshot-row-cache.d.ts","sourceRoot":"","sources":["../../../../../../zero-cache/src/services/view-syncer/snapshot-row-cache.ts"],"names":[],"mappings":"AAMA;;;;;;;;;GASG;AACH,eAAO,MAAM,sCAAsC,QAAS,CAAC;AAwB7D;;;GAGG;AACH,MAAM,MAAM,QAAQ,GAAG,KAAK,GAAG,KAAK,CAAC;AAErC;;;;GAIG;AACH,eAAO,MAAM,uBAAuB,QAAS,CAAC;AAK9C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AACH,qBAAa,gBAAgB;;IAmB3B,YAAY,UAAU,SAAyC,EAE9D;IAED,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED,IAAI,UAAU,IAAI,MAAM,CAEvB;IAED,KAAK,IAAI;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAC,CAEpD;IAED;;;;;;;;;OASG;IACH,SAAS,CAAC,CAAC,EACT,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,QAAQ,EACd,IAAI,EAAE,OAAO,EAAE,EACf,IAAI,EAAE,MAAM,CAAC,GACZ,CAAC,CAoBH;IAED,KAAK,IAAI,IAAI,CAIZ;CAsBF"}