@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,39 +0,0 @@
1
- import type { LogContext } from '@rocicorp/logger';
2
- import type { AnalyzeQueryResult } from '../../../zero-protocol/src/analyze-query-result.ts';
3
- import type { AST } from '../../../zero-protocol/src/ast.ts';
4
- import type { ClientSchema } from '../../../zero-protocol/src/client-schema.ts';
5
- import type { PermissionsConfig } from '../../../zero-schema/src/compiled-permissions.ts';
6
- import type { NameMapper } from '../../../zero-schema/src/name-mapper.ts';
7
- import { type BuilderDelegate } from '../../../zql/src/builder/builder.ts';
8
- import type { ConnectionCostModel } from '../../../zql/src/planner/planner-connection.ts';
9
- import type { PlanDebugger } from '../../../zql/src/planner/planner-debug.ts';
10
- import type { Database } from '../../../zqlite/src/db.ts';
11
- import type { JWTAuth } from '../auth/auth.ts';
12
- import type { LiteAndZqlSpec } from '../db/specs.ts';
13
- /**
14
- * Maximum number of synced rows returned per table, and read rows returned
15
- * per table/query, when analyzing a query in zero-cache. Rows past this are
16
- * still counted. Keeping every row can exhaust the heap when analyzing queries
17
- * over large tables.
18
- */
19
- export declare const MAX_ANALYZE_ROWS = 1000;
20
- export type RunAstOptions = {
21
- applyPermissions?: boolean | undefined;
22
- auth?: JWTAuth | undefined;
23
- clientToServerMapper?: NameMapper | undefined;
24
- costModel?: ConnectionCostModel | undefined;
25
- db: Database;
26
- host: BuilderDelegate;
27
- /**
28
- * Maximum number of synced rows returned per table. Rows past this are still
29
- * counted. Defaults to no limit.
30
- */
31
- maxSyncedRowsPerTable?: number | undefined;
32
- permissions?: PermissionsConfig | undefined;
33
- planDebugger?: PlanDebugger | undefined;
34
- syncedRows?: boolean | undefined;
35
- tableSpecs: Map<string, LiteAndZqlSpec>;
36
- vendedRows?: boolean | undefined;
37
- };
38
- export declare function runAst(lc: LogContext, clientSchema: ClientSchema, ast: AST, isTransformed: boolean, options: RunAstOptions, yieldProcess: () => Promise<void>): Promise<AnalyzeQueryResult>;
39
- //# sourceMappingURL=run-ast.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"run-ast.d.ts","sourceRoot":"","sources":["../../../../../zero-cache/src/services/run-ast.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,kBAAkB,CAAC;AAQjD,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,oDAAoD,CAAC;AAC3F,OAAO,KAAK,EAAC,GAAG,EAAe,MAAM,mCAAmC,CAAC;AAEzE,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,6CAA6C,CAAC;AAG9E,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,kDAAkD,CAAC;AACxF,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,yCAAyC,CAAC;AACxE,OAAO,EAEL,KAAK,eAAe,EACrB,MAAM,qCAAqC,CAAC;AAG7C,OAAO,KAAK,EAAC,mBAAmB,EAAC,MAAM,gDAAgD,CAAC;AACxF,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,2CAA2C,CAAC;AAC5E,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,2BAA2B,CAAC;AAExD,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,iBAAiB,CAAC;AAG7C,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,gBAAgB,CAAC;AAOnD;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,OAAO,CAAC;AAErC,MAAM,MAAM,aAAa,GAAG;IAC1B,gBAAgB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IACvC,IAAI,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC3B,oBAAoB,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC;IAC9C,SAAS,CAAC,EAAE,mBAAmB,GAAG,SAAS,CAAC;IAC5C,EAAE,EAAE,QAAQ,CAAC;IACb,IAAI,EAAE,eAAe,CAAC;IACtB;;;OAGG;IACH,qBAAqB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3C,WAAW,CAAC,EAAE,iBAAiB,GAAG,SAAS,CAAC;IAC5C,YAAY,CAAC,EAAE,YAAY,GAAG,SAAS,CAAC;IACxC,UAAU,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IACjC,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;IACxC,UAAU,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CAClC,CAAC;AAEF,wBAAsB,MAAM,CAC1B,EAAE,EAAE,UAAU,EACd,YAAY,EAAE,YAAY,EAC1B,GAAG,EAAE,GAAG,EACR,aAAa,EAAE,OAAO,EACtB,OAAO,EAAE,aAAa,EACtB,YAAY,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,GAChC,OAAO,CAAC,kBAAkB,CAAC,CAyL7B"}
@@ -1,19 +0,0 @@
1
- import type { LogContext } from '@rocicorp/logger';
2
- import type { Service } from './service.ts';
3
- /**
4
- * Manages the creation and lifecycle of objects that implement
5
- * {@link Service}.
6
- */
7
- export declare class ServiceRunner<S extends Service> {
8
- #private;
9
- constructor(lc: LogContext, factory: (id: string) => S, isValid?: (existing: S) => boolean, onStop?: ((id: string) => void) | undefined);
10
- /**
11
- * Creates and runs the Service with the given `id`, returning
12
- * an existing one if it is still running a valid.
13
- */
14
- getService(id: string): S;
15
- hasService(id: string): boolean;
16
- get size(): number;
17
- getServices(): Iterable<S>;
18
- }
19
- //# sourceMappingURL=runner.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"runner.d.ts","sourceRoot":"","sources":["../../../../../zero-cache/src/services/runner.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,kBAAkB,CAAC;AACjD,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,cAAc,CAAC;AAE1C;;;GAGG;AACH,qBAAa,aAAa,CAAC,CAAC,SAAS,OAAO;;IAO1C,YACE,EAAE,EAAE,UAAU,EACd,OAAO,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,CAAC,EAC1B,OAAO,GAAE,CAAC,QAAQ,EAAE,CAAC,KAAK,OAAoB,EAC9C,MAAM,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC,GAAG,SAAS,EAM5C;IAED;;;OAGG;IACH,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,CAAC,CA4BxB;IAED,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAE9B;IAED,IAAI,IAAI,WAEP;IAED,WAAW,IAAI,QAAQ,CAAC,CAAC,CAAC,CAEzB;CACF"}
@@ -1,17 +0,0 @@
1
- import type { LogContext } from '@rocicorp/logger';
2
- import { setActiveUsersGetter } from '../../server/anonymous-otel-start.ts';
3
- import type { PostgresDB } from '../../types/pg.ts';
4
- import { type ShardID } from '../../types/shards.ts';
5
- import type { Service } from '../service.ts';
6
- type Options = {
7
- updateIntervalMs?: number;
8
- };
9
- export declare class ActiveUsersGauge implements Service {
10
- #private;
11
- readonly id = "active-users-gauge";
12
- constructor(lc: LogContext, db: PostgresDB, shard: ShardID, opts?: Options, setActiveUsersGetterFn?: typeof setActiveUsersGetter);
13
- run(): Promise<void>;
14
- stop(): Promise<void>;
15
- }
16
- export {};
17
- //# sourceMappingURL=active-users-gauge.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"active-users-gauge.d.ts","sourceRoot":"","sources":["../../../../../../zero-cache/src/services/view-syncer/active-users-gauge.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,kBAAkB,CAAC;AAGjD,OAAO,EACL,oBAAoB,EAErB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAY,KAAK,OAAO,EAAC,MAAM,uBAAuB,CAAC;AAE9D,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,eAAe,CAAC;AAK3C,KAAK,OAAO,GAAG;IACb,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B,CAAC;AAEF,qBAAa,gBAAiB,YAAW,OAAO;;IAC9C,QAAQ,CAAC,EAAE,wBAAwB;IAYnC,YACE,EAAE,EAAE,UAAU,EACd,EAAE,EAAE,UAAU,EACd,KAAK,EAAE,OAAO,EACd,IAAI,GAAE,OAAY,EAClB,sBAAsB,8BAAuB,EAO9C;IAEK,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC,CA4CzB;IAED,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAGpB;CACF"}
@@ -1,26 +0,0 @@
1
- import type { ResetPipelinesReason } from './snapshotter.ts';
2
- export type AdvancementOutcome = {
3
- readonly outcome: 'success' | 'error';
4
- } | {
5
- readonly outcome: 'reset';
6
- readonly reason: ResetPipelinesReason;
7
- };
8
- export type AdvancementTimings = {
9
- /** Setup plus time between time-slice yields, including asynchronous I/O. */
10
- readonly processingTimeMs: number;
11
- /** Synchronous snapshot, change-count, CVR updater, and poke preparation. */
12
- readonly setupTimeMs: number;
13
- /** Elapsed wall time, including time-slice waits and output cleanup. */
14
- readonly wallTimeMs: number;
15
- };
16
- /**
17
- * Counts and times every advancement attempt, including work abandoned by a
18
- * reset. The existing sync.advance-time histogram measures successes only.
19
- * Outcome and reset reason are bounded labels; client and query IDs are not
20
- * recorded here. Recording once per attempt adds no clocks to row processing.
21
- */
22
- export declare class AdvancementMetrics {
23
- #private;
24
- record({ processingTimeMs, setupTimeMs, wallTimeMs }: AdvancementTimings, outcome: AdvancementOutcome): void;
25
- }
26
- //# sourceMappingURL=advancement-metrics.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"advancement-metrics.d.ts","sourceRoot":"","sources":["../../../../../../zero-cache/src/services/view-syncer/advancement-metrics.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,oBAAoB,EAAC,MAAM,kBAAkB,CAAC;AAE3D,MAAM,MAAM,kBAAkB,GAC1B;IAAC,QAAQ,CAAC,OAAO,EAAE,SAAS,GAAG,OAAO,CAAA;CAAC,GACvC;IAAC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,oBAAoB,CAAA;CAAC,CAAC;AAEvE,MAAM,MAAM,kBAAkB,GAAG;IAC/B,6EAA6E;IAC7E,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAClC,6EAA6E;IAC7E,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,wEAAwE;IACxE,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B,CAAC;AAEF;;;;;GAKG;AACH,qBAAa,kBAAkB;;IAqB7B,MAAM,CACJ,EAAC,gBAAgB,EAAE,WAAW,EAAE,UAAU,EAAC,EAAE,kBAAkB,EAC/D,OAAO,EAAE,kBAAkB,GAC1B,IAAI,CAQN;CACF"}
@@ -1,79 +0,0 @@
1
- import type { LogContext } from '@rocicorp/logger';
2
- export type BatchPacerOptions = {
3
- /**
4
- * The largest share of the worker's time that it may be busy before its
5
- * client groups are paced.
6
- */
7
- readonly shareTarget: number;
8
- /** The longest a client group waits between batches. */
9
- readonly maxIntervalMs: number;
10
- readonly now?: (() => number) | undefined;
11
- /**
12
- * The share of the time since the previous call that the worker was busy.
13
- * By default, the utilization of the event loop.
14
- */
15
- readonly utilization?: (() => number) | undefined;
16
- /** Where the worker says that it is pacing its client groups. */
17
- readonly lc?: LogContext | undefined;
18
- };
19
- /**
20
- * Paces the batches (advancements, including the queries they hydrate
21
- * again) of the client groups of a sync worker, so that the worker is left
22
- * with time for new hydrations and connections, and gives the hydrations of
23
- * new queries priority over the batches.
24
- *
25
- * **Pacing.** After each batch, a client group waits {@link waitMs} before
26
- * it starts the next. The wait is a multiple of the batch's processing
27
- * time, so a client group that always has changes waiting is busy at most
28
- * `1 / (1 + k)` of the time, where `k` is the {@link multiplier}. Because
29
- * the wait is in proportion to a client group's own processing time, those
30
- * that cause the load are slowed the most, and cheap ones barely at all.
31
- *
32
- * The multiplier is shared by the client groups of the worker. Once per
33
- * second, it is scaled by how far the share of its time that the worker was
34
- * busy, smoothed over a few seconds, is from the target, and by more while
35
- * the worker has no time to spare. It never goes below 0, where no client
36
- * group waits. The share is the utilization of the worker's event loop, i.e. all
37
- * of what the worker does: what a batch costs is spread over the pipelines,
38
- * the CVR, the pokes and garbage collection, and is not measurable batch by
39
- * batch.
40
- *
41
- * **Priority of new hydrations.** The worker's time slices are handed out
42
- * by the pacer (see {@link yieldSlice}), and while the hydration of new
43
- * queries is waiting for one, most of them go to it rather than to batches.
44
- */
45
- export declare class BatchPacer {
46
- #private;
47
- constructor({ shareTarget, maxIntervalMs, now, utilization, lc, }: BatchPacerOptions);
48
- /**
49
- * How long a client group should wait before its next batch, after one
50
- * that took `processingMs` to process. The multiplier changes while a
51
- * client group waits, so a long wait should be taken in steps, asking
52
- * again after each.
53
- */
54
- waitMs(processingMs: number): number;
55
- /** `k`: a client group waits `k` times the processing time of a batch. */
56
- get multiplier(): number;
57
- /**
58
- * The share of its time that the worker was busy, smoothed over the last
59
- * few seconds, as of the last update of the multiplier.
60
- */
61
- get share(): number;
62
- /**
63
- * Yields the worker to the other work that is waiting for a time slice,
64
- * and resolves when it is the caller's turn again. One piece of work runs
65
- * per turn of the event loop, as when the work of a worker's client groups
66
- * simply takes turns, except that the hydration of new queries goes first:
67
- * while both kinds of work are waiting, `HYDRATION_PRIORITY` slices go to
68
- * hydrations for each one that goes to a batch.
69
- *
70
- * Batches are never made to wait for anything but a slice. If no
71
- * hydration is waiting for one (because none is running, or because those
72
- * that are running are waiting for I/O), batches get every slice. And
73
- * however many hydrations there are, batches keep a share of the slices,
74
- * so they keep moving, and so do the snapshots of the replica that they
75
- * hold.
76
- */
77
- yieldSlice(kind: 'hydration' | 'batch'): Promise<void>;
78
- }
79
- //# sourceMappingURL=batch-pacer.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"batch-pacer.d.ts","sourceRoot":"","sources":["../../../../../../zero-cache/src/services/view-syncer/batch-pacer.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,kBAAkB,CAAC;AAyDjD,MAAM,MAAM,iBAAiB,GAAG;IAC9B;;;OAGG;IACH,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,wDAAwD;IACxD,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC,MAAM,MAAM,CAAC,GAAG,SAAS,CAAC;IAC1C;;;OAGG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC,MAAM,MAAM,CAAC,GAAG,SAAS,CAAC;IAClD,iEAAiE;IACjE,QAAQ,CAAC,EAAE,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC;CACtC,CAAC;AAYF;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,qBAAa,UAAU;;IA8BrB,YAAY,EACV,WAAW,EACX,aAAa,EACb,GAAG,EACH,WAAW,EACX,EAAE,GACH,EAAE,iBAAiB,EAOnB;IAED;;;;;OAKG;IACH,MAAM,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CASnC;IAED,0EAA0E;IAC1E,IAAI,UAAU,IAAI,MAAM,CAGvB;IAED;;;OAGG;IACH,IAAI,KAAK,IAAI,MAAM,CAGlB;IA+FD;;;;;;;;;;;;;;OAcG;IACH,UAAU,CAAC,IAAI,EAAE,WAAW,GAAG,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAQrD;CAuBF"}
@@ -1,97 +0,0 @@
1
- import type { LogContext } from '@rocicorp/logger';
2
- import type { JSONObject } from '../../../../shared/src/bigint-json.ts';
3
- import { type JSONObject as SafeJSONObject } from '../../../../shared/src/json.ts';
4
- import type { ErroredQuery } from '../../../../zero-protocol/src/custom-queries.ts';
5
- import { type TransformFailedBody } from '../../../../zero-protocol/src/error.ts';
6
- import type { InspectDownBody } from '../../../../zero-protocol/src/inspect-down.ts';
7
- import type { RowPatchOp } from '../../../../zero-protocol/src/row-patch.ts';
8
- import type { ViewSyncerDownstream } from '../../types/downstream.ts';
9
- import { type ShardID } from '../../types/shards.ts';
10
- import type { Subscription } from '../../types/subscription.ts';
11
- import { type CVRVersion, type DelQueryPatch, type NullableCVRVersion, type PutQueryPatch, type RowID } from './schema/types.ts';
12
- export type PutRowPatch = {
13
- type: 'row';
14
- op: 'put';
15
- id: RowID;
16
- contents: JSONObject;
17
- };
18
- export type DeleteRowPatch = {
19
- type: 'row';
20
- op: 'del';
21
- id: RowID;
22
- };
23
- export type RowPatch = PutRowPatch | DeleteRowPatch;
24
- export type ConfigPatch = DelQueryPatch | PutQueryPatch;
25
- export type Patch = ConfigPatch | RowPatch;
26
- export type PatchToVersion = {
27
- patch: Patch;
28
- toVersion: CVRVersion;
29
- };
30
- export interface PokeHandler {
31
- addPatch(patch: PatchToVersion): Promise<void>;
32
- cancel(): Promise<void>;
33
- end(finalVersion: CVRVersion): Promise<void>;
34
- }
35
- /**
36
- * A put/del row patch and its JSON serialization. Computed once per client
37
- * group and shared by all of the group's clients.
38
- */
39
- type SerializedRowPatch = {
40
- readonly rowPatch: RowPatchOp;
41
- readonly json: string;
42
- };
43
- /**
44
- * Lazily holds the {@link SerializedRowPatch} of one patch so that it is
45
- * computed at most once, by the first client that needs it.
46
- */
47
- type SharedRowPatch = {
48
- serialized?: SerializedRowPatch | undefined;
49
- };
50
- /** A {@link PokeHandler} for a single client. */
51
- export interface ClientPokeHandler extends PokeHandler {
52
- addPatch(patch: PatchToVersion, shared?: SharedRowPatch): Promise<void>;
53
- /**
54
- * Whether a patch has been sent to the client. Once one has, the poke can
55
- * only be ended with a `finalVersion` that is ahead of the client's base
56
- * version.
57
- */
58
- readonly patchesSent: boolean;
59
- }
60
- /**
61
- * A {@link PokeHandler} for multiple clients, as returned by
62
- * {@link startPoke}.
63
- */
64
- export interface MultiPokeHandler extends PokeHandler {
65
- /** Whether a patch has been sent to any of the clients. */
66
- readonly patchesSent: boolean;
67
- }
68
- /** Wraps PokeHandlers for multiple clients in a single PokeHandler. */
69
- export declare function startPoke(lc: LogContext, clients: ClientHandler[], tentativeVersion: CVRVersion): MultiPokeHandler;
70
- export declare const POKE_PART_FLUSH_THRESHOLD_CHARS: number;
71
- /**
72
- * Handles a single `ViewSyncer` connection.
73
- */
74
- export declare class ClientHandler {
75
- #private;
76
- readonly clientID: string;
77
- readonly wsID: string;
78
- constructor(lc: LogContext, clientGroupID: string, clientID: string, wsID: string, shard: ShardID, baseCookie: string | null, downstream: Subscription<ViewSyncerDownstream>);
79
- version(): NullableCVRVersion;
80
- fail(e: unknown): void;
81
- close(reason: string): void;
82
- startPoke(tentativeVersion: CVRVersion): ClientPokeHandler;
83
- sendDeleteClients(lc: LogContext, deletedClientIDs: string[], deletedClientGroupIDs: string[]): Promise<void>;
84
- sendQueryTransformApplicationErrors(errors: ErroredQuery[]): void;
85
- sendQueryTransformFailedError(error: TransformFailedBody): void;
86
- sendInspectResponse(lc: LogContext, response: InspectDownBody): void;
87
- }
88
- /**
89
- * Column values of type INT8 are returned as the `bigint` from the
90
- * Postgres library. These are converted to `number` if they are within
91
- * the safe Number range, allowing the protocol to support numbers larger
92
- * than 32-bits. Values outside of the safe number range (e.g. > 2^53) will
93
- * result in an Error.
94
- */
95
- export declare function ensureSafeJSON(row: JSONObject): SafeJSONObject;
96
- export {};
97
- //# sourceMappingURL=client-handler.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"client-handler.d.ts","sourceRoot":"","sources":["../../../../../../zero-cache/src/services/view-syncer/client-handler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,E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AE,MAAM,EACZ,KAAK,EAAE,OAAO,EACd,UAAU,EAAE,MAAM,GAAG,IAAI,EACzB,UAAU,EAAE,YAAY,CAAC,oBAAoB,CAAC,EAW/C;IAED,OAAO,IAAI,kBAAkB,CAE5B;IAOD,IAAI,CAAC,CAAC,EAAE,OAAO,QAMd;IAED,KAAK,CAAC,MAAM,EAAE,MAAM,QAGnB;IAED,SAAS,CAAC,gBAAgB,EAAE,UAAU,GAAG,iBAAiB,CA8MzD;IAEK,iBAAiB,CACrB,EAAE,EAAE,UAAU,EACd,gBAAgB,EAAE,MAAM,EAAE,EAC1B,qBAAqB,EAAE,MAAM,EAAE,iBAWhC;IAED,mCAAmC,CAAC,MAAM,EAAE,YAAY,EAAE,QAEzD;IAED,6BAA6B,CAAC,KAAK,EAAE,mBAAmB,QAEvD;IAED,mBAAmB,CAAC,EAAE,EAAE,UAAU,EAAE,QAAQ,EAAE,eAAe,GAAG,IAAI,CAMnE;CAuBF;AAiDD;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,UAAU,GAAG,cAAc,CAiB9D"}
@@ -1,18 +0,0 @@
1
- import type { ClientSchema } from '../../../../zero-protocol/src/client-schema.ts';
2
- import type { LiteTableSpecWithReplicationStatus } from '../../db/lite-tables.ts';
3
- import type { LiteAndZqlSpec } from '../../db/specs.ts';
4
- import { type ShardID } from '../../types/shards.ts';
5
- /**
6
- * Throws a `SchemaVersionNotSupported` error if the client schema is not
7
- * compatible with the replica, or a `ServerOverloaded` error (which clients
8
- * retry with backoff) if the only incompatibilities are tables or columns
9
- * that are still being backfilled.
10
- *
11
- * @param tableSpecsWithBackfills the table specs computed with backfilling
12
- * columns included. Permanent incompatibilities are checked against
13
- * these, so that a table or column that will not be syncable after its
14
- * backfill completes is not reported as retriable. Defaults to
15
- * `tableSpecs`, for replicas with nothing being backfilled.
16
- */
17
- export declare function checkClientSchema(shardID: ShardID, clientSchema: ClientSchema, tableSpecs: Map<string, LiteAndZqlSpec>, fullTables: Map<string, LiteTableSpecWithReplicationStatus>, tableSpecsWithBackfills?: Map<string, LiteAndZqlSpec>): void;
18
- //# sourceMappingURL=client-schema.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"client-schema.d.ts","sourceRoot":"","sources":["../../../../../../zero-cache/src/services/view-syncer/client-schema.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,gDAAgD,CAAC;AAIjF,OAAO,KAAK,EAAC,kCAAkC,EAAC,MAAM,yBAAyB,CAAC;AAChF,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,mBAAmB,CAAC;AAEtD,OAAO,EAA4B,KAAK,OAAO,EAAC,MAAM,uBAAuB,CAAC;AAQ9E;;;;;;;;;;;GAWG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,OAAO,EAChB,YAAY,EAAE,YAAY,EAC1B,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE,cAAc,CAAC,EACvC,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE,kCAAkC,CAAC,EAC3D,uBAAuB,GAAE,GAAG,CAAC,MAAM,EAAE,cAAc,CAAc,QAkClE"}
@@ -1,184 +0,0 @@
1
- import type { LogContext } from '@rocicorp/logger';
2
- import type { InitConnectionBody } from '../../../../zero-protocol/src/connect.ts';
3
- import type { UpdateAuthBody } from '../../../../zero-protocol/src/update-auth.ts';
4
- import { type Auth, type ValidateLegacyJWT } from '../../auth/auth.ts';
5
- import type { ZeroConfig } from '../../config/zero-config.ts';
6
- import type { ConnectParams } from '../../workers/connect-params.ts';
7
- export type ConnectionState = 'provisional' | 'validated';
8
- /**
9
- * Normalized user identity shared by live connection state and group auth state.
10
- * `id: null` means logged out.
11
- */
12
- export type UserState = {
13
- readonly id: string | null;
14
- };
15
- /**
16
- * Delineates the two paths for validating a connection: either server can validate
17
- * the user's identity and return a definitive userID to trust, or we fall back to
18
- * trusting the one provided by the client in the incoming query params.
19
- */
20
- export type ConnectionValidation = {
21
- kind: 'client-fallback';
22
- } | {
23
- kind: 'server-validated';
24
- validatedUserID: string | null;
25
- };
26
- /**
27
- * Identifies one live websocket for a client slot.
28
- */
29
- export type ConnectionSelector = {
30
- readonly clientID: string;
31
- readonly wsID: string;
32
- };
33
- type FetchConfig = ZeroConfig['query'];
34
- export type HeaderOptions = {
35
- readonly apiKey?: string | undefined;
36
- /** Allowlisted headers provided in the client options. */
37
- readonly customHeaders?: Readonly<Record<string, string>> | undefined;
38
- /** Allowlisted headers from the incoming HTTP request. */
39
- readonly requestHeaders?: Readonly<Record<string, string>> | undefined;
40
- readonly cookie?: string | undefined;
41
- readonly origin?: string | undefined;
42
- };
43
- export type ConnectionFetchContext = {
44
- readonly url: string | undefined;
45
- readonly allowedUrlPatterns: readonly URLPattern[] | undefined;
46
- readonly headerOptions: HeaderOptions;
47
- };
48
- /**
49
- * A snapshot of one live connection tracked by the manager.
50
- *
51
- * `revalidateAt` is only populated while the connection is `validated`.
52
- */
53
- export type ConnectionContext = {
54
- readonly state: ConnectionState;
55
- readonly clientID: string;
56
- readonly wsID: string;
57
- readonly user: UserState;
58
- readonly auth: Auth | undefined;
59
- readonly profileID: string | null;
60
- readonly baseCookie: string | null;
61
- readonly protocolVersion: number;
62
- readonly revision: number;
63
- readonly revalidateAt: number | undefined;
64
- readonly insertionOrder: number;
65
- readonly queryContext: ConnectionFetchContext;
66
- readonly mutateContext: ConnectionFetchContext;
67
- };
68
- /**
69
- * Group-scoped auth state shared across the live connections.
70
- *
71
- * The background connection is the validated connection currently used for
72
- * shared background work. Retransform happens on a group level, and uses
73
- * the background connection's credential to refetch the latest queries.
74
- */
75
- export type GroupAuthState = {
76
- readonly pinnedUser: UserState | undefined;
77
- readonly backgroundConnection: ConnectionSelector | undefined;
78
- readonly retransformAt: number | undefined;
79
- readonly maintenanceNotBeforeAt: number | undefined;
80
- };
81
- export type ConnectionContextManager = {
82
- registerConnection(selector: ConnectionSelector, connectParams: ConnectParams, auth?: Auth): Readonly<ConnectionContext>;
83
- initConnection(selector: ConnectionSelector, body: InitConnectionBody): Readonly<ConnectionContext>;
84
- updateAuth(selector: ConnectionSelector, body: UpdateAuthBody): Promise<Readonly<ConnectionContext>>;
85
- validateConnection(selector: ConnectionSelector, revision: number, validation: ConnectionValidation): Readonly<{
86
- connection: ConnectionContext;
87
- group: GroupAuthState;
88
- }> | undefined;
89
- failConnection(selector: ConnectionSelector, revision: number): Readonly<ConnectionContext> | undefined;
90
- closeConnection(selector: ConnectionSelector): Readonly<ConnectionContext> | undefined;
91
- markBackgroundRetransformSuccess(selector: ConnectionSelector, revision: number): void;
92
- setSharedRetransformReady(ready: boolean): void;
93
- deferMaintenance(kind: 'revalidate' | 'retransform'): void;
94
- getConnectionContext(selector: ConnectionSelector): Readonly<ConnectionContext> | undefined;
95
- mustGetConnectionContext(selector: ConnectionSelector): Readonly<ConnectionContext>;
96
- getBackgroundConnectionContext(): Readonly<ConnectionContext> | undefined;
97
- mustGetBackgroundConnectionContext(): Readonly<ConnectionContext>;
98
- getGroupState(): Readonly<GroupAuthState>;
99
- planMaintenance(): {
100
- dueRevalidations: Readonly<ConnectionContext>[];
101
- dueRetransform: boolean;
102
- earliestDeadlineAt: number | undefined;
103
- };
104
- };
105
- /**
106
- * State machine for the auth state of a single `ViewSyncerService`.
107
- *
108
- * Connections are registered as `provisional`, optionally backfilled with
109
- * `initConnection` metadata, and then promoted to `validated` once their
110
- * effective `userID` is confirmed as valid. The manager also tracks which
111
- * validated connection currently serves as the group's background connection.
112
- */
113
- export declare class ConnectionContextManagerImpl implements ConnectionContextManager {
114
- #private;
115
- constructor(lc: LogContext, revalidateIntervalSeconds?: number, retransformIntervalSeconds?: number, queryConfig?: FetchConfig, pushConfig?: FetchConfig, validateLegacyJWT?: ValidateLegacyJWT, now?: () => number);
116
- /**
117
- * Creates or replaces the live record for a websocket connection.
118
- *
119
- * Re-registering the same `clientID` drops the old socket record and starts
120
- * the replacement back in `provisional` state.
121
- */
122
- registerConnection(selector: ConnectionSelector, connectParams: ConnectParams, auth?: Auth): Readonly<ConnectionContext>;
123
- /**
124
- * Backfills `initConnection` data for sockets that were registered before the
125
- * client could send its full init payload.
126
- *
127
- * This updates metadata only; it does not validate the connection.
128
- */
129
- initConnection(selector: ConnectionSelector, body: InitConnectionBody): Readonly<ConnectionContext>;
130
- /**
131
- * A material auth change demotes the connection back to provisional until it
132
- * is validated again.
133
- */
134
- updateAuth(selector: ConnectionSelector, body: UpdateAuthBody): Promise<Readonly<ConnectionContext>>;
135
- /**
136
- * Validates one connection against the group's pinned `userID`.
137
- *
138
- * The first successful validation binds the group `userID`. Later
139
- * validations must match it. Validation also refreshes the connection's
140
- * revalidation deadline and may pick the connection as the group
141
- * background connection if none is currently available. If the websocket is
142
- * gone by the time async validation finishes, this becomes a no-op.
143
- */
144
- validateConnection(selector: ConnectionSelector, revision: number, validation: ConnectionValidation): Readonly<{
145
- connection: ConnectionContext;
146
- group: GroupAuthState;
147
- }> | undefined;
148
- /** Removes one connection due to failed auth and updates all derived background/deadline state. */
149
- failConnection(selector: ConnectionSelector, revision: number): ConnectionContext | undefined;
150
- /** Removes one disconnected connection and updates all derived background/deadline state. */
151
- closeConnection(selector: ConnectionSelector): ConnectionContext | undefined;
152
- /**
153
- * Records a successful background retransform. This starts a fresh interval
154
- * from the manager clock when shared retransform is schedulable, or
155
- * clears the deadline if it is not.
156
- */
157
- markBackgroundRetransformSuccess(selector: ConnectionSelector, revision: number): void;
158
- setSharedRetransformReady(ready: boolean): void;
159
- deferMaintenance(kind: 'revalidate' | 'retransform'): void;
160
- /** Returns the current live record for a client slot, if any. */
161
- getConnectionContext(selector: ConnectionSelector): Readonly<ConnectionContext> | undefined;
162
- /** Returns the live record for one websocket or throws if it is unavailable. */
163
- mustGetConnectionContext(selector: ConnectionSelector): Readonly<ConnectionContext>;
164
- /** Returns the current background connection, if one exists. */
165
- getBackgroundConnectionContext(): Readonly<ConnectionContext> | undefined;
166
- mustGetBackgroundConnectionContext(): Readonly<ConnectionContext>;
167
- /** Returns the shared group auth state. */
168
- getGroupState(): Readonly<GroupAuthState>;
169
- /**
170
- * Reports which maintenance work is currently due.
171
- *
172
- * The result is a pure snapshot: callers decide which actions to run and
173
- * when to wake up next. `earliestDeadlineAt` is the earliest outstanding
174
- * maintenance deadline, including overdue work, unless a transient failure
175
- * has deferred all scheduled maintenance until `maintenanceNotBeforeAt`.
176
- */
177
- planMaintenance(): {
178
- dueRevalidations: Readonly<ConnectionContext>[];
179
- dueRetransform: boolean;
180
- earliestDeadlineAt: number | undefined;
181
- };
182
- }
183
- export {};
184
- //# sourceMappingURL=connection-context-manager.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"connection-context-manager.d.ts","sourceRoot":"","sources":["../../../../../../zero-cache/src/services/view-syncer/connection-context-manager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,kBAAkB,CAAC;AACjD,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,0CAA0C,CAAC;AAGjF,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,8CAA8C,CAAC;AACjF,OAAO,EAGL,KAAK,IAAI,EACT,KAAK,iBAAiB,EACvB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,6BAA6B,CAAC;AAG5D,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,iCAAiC,CAAC;AAEnE,MAAM,MAAM,eAAe,GAAG,aAAa,GAAG,WAAW,CAAC;AAE1D;;;GAGG;AACH,MAAM,MAAM,SAAS,GAAG;IAAC,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAAA;CAAC,CAAC;AAErD;;;;GAIG;AACH,MAAM,MAAM,oBAAoB,GAC5B;IAAC,IAAI,EAAE,iBAAiB,CAAA;CAAC,GACzB;IAAC,IAAI,EAAE,kBAAkB,CAAC;IAAC,eAAe,EAAE,MAAM,GAAG,IAAI,CAAA;CAAC,CAAC;AAE/D;;GAEG;A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AE,kBAAkB,GAC3B,QAAQ,CAAC,iBAAiB,CAAC,CAE7B;IAED,gEAAgE;IAChE,8BAA8B,IAAI,QAAQ,CAAC,iBAAiB,CAAC,GAAG,SAAS,CAExE;IAED,kCAAkC,IAAI,QAAQ,CAAC,iBAAiB,CAAC,CAchE;IAED,2CAA2C;IAC3C,aAAa,IAAI,QAAQ,CAAC,cAAc,CAAC,CAExC;IAED;;;;;;;OAOG;IACH,eAAe,IAAI;QACjB,gBAAgB,EAAE,QAAQ,CAAC,iBAAiB,CAAC,EAAE,CAAC;QAChD,cAAc,EAAE,OAAO,CAAC;QACxB,kBAAkB,EAAE,MAAM,GAAG,SAAS,CAAC;KACxC,CA8CA;CAiNF"}
@@ -1,22 +0,0 @@
1
- import type { LogContext } from '@rocicorp/logger';
2
- import { type PostgresDB } from '../../types/pg.ts';
3
- import { type ShardID } from '../../types/shards.ts';
4
- import type { Service } from '../service.ts';
5
- type Options = {
6
- inactivityThresholdMs: number;
7
- initialBatchSize: number;
8
- initialIntervalMs: number;
9
- };
10
- export declare class CVRPurger implements Service {
11
- #private;
12
- readonly id = "reaper";
13
- constructor(lc: LogContext, db: PostgresDB, shard: ShardID, { inactivityThresholdMs, initialBatchSize, initialIntervalMs }: Options, tombstonePurgeThreshold?: number);
14
- run(): Promise<void>;
15
- purgeInactiveCVRs(maxCVRs: number): Promise<{
16
- purged: number;
17
- remaining: number;
18
- }>;
19
- stop(): Promise<void>;
20
- }
21
- export {};
22
- //# sourceMappingURL=cvr-purger.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cvr-purger.d.ts","sourceRoot":"","sources":["../../../../../../zero-cache/src/services/view-syncer/cvr-purger.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,kBAAkB,CAAC;AAIjD,OAAO,EAAC,KAAK,UAAU,EAAC,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAY,KAAK,OAAO,EAAC,MAAM,uBAAuB,CAAC;AAE9D,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,eAAe,CAAC;AAQ3C,KAAK,OAAO,GAAG;IACb,qBAAqB,EAAE,MAAM,CAAC;IAC9B,gBAAgB,EAAE,MAAM,CAAC;IACzB,iBAAiB,EAAE,MAAM,CAAC;CAC3B,CAAC;AAEF,qBAAa,SAAU,YAAW,OAAO;;IACvC,QAAQ,CAAC,EAAE,YAAY;IAWvB,YACE,EAAE,EAAE,UAAU,EACd,EAAE,EAAE,UAAU,EACd,KAAK,EAAE,OAAO,EACd,EAAC,qBAAqB,EAAE,gBAAgB,EAAE,iBAAiB,EAAC,EAAE,OAAO,EACrE,uBAAuB,SAA4B,EAYpD;IAEK,GAAG,kBA8CR;IAGD,iBAAiB,CACf,OAAO,EAAE,MAAM,GACd,OAAO,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAC,CAAC,CAgF9C;IAED,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAGpB;CACF"}