@rocicorp/zero 1.12.0-canary.6 → 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 (373) hide show
  1. package/out/zero/package.js +10 -10
  2. package/out/zero/package.js.map +1 -1
  3. package/out/zero-cache/src/auth/write-authorizer.js +9 -2
  4. package/out/zero-cache/src/auth/write-authorizer.js.map +1 -1
  5. package/out/zero-cache/src/server/change-streamer.js +1 -0
  6. package/out/zero-cache/src/server/change-streamer.js.map +1 -1
  7. package/out/zero-cache/src/services/change-source/common/replica-restore.js.map +1 -1
  8. package/out/zero-cache/src/services/change-source/pg/change-source-init.js +17 -9
  9. package/out/zero-cache/src/services/change-source/pg/change-source-init.js.map +1 -1
  10. package/out/zero-cache/src/services/change-streamer/server-start-metrics.js +1 -1
  11. package/out/zero-cache/src/services/change-streamer/server-start-metrics.js.map +1 -1
  12. package/out/zero-cache/src/services/mutagen/mutagen.js +1 -2
  13. package/out/zero-cache/src/services/mutagen/mutagen.js.map +1 -1
  14. package/out/zero-cache/src/services/view-syncer/view-syncer.js +19 -2
  15. package/out/zero-cache/src/services/view-syncer/view-syncer.js.map +1 -1
  16. package/out/zero-client/src/client/version.js +1 -1
  17. package/out/zero-protocol/src/inspect-down.d.ts +81 -81
  18. package/out/zero-protocol/src/up.d.ts +60 -60
  19. package/package.json +10 -10
  20. package/out/shared/src/cache.d.ts +0 -22
  21. package/out/shared/src/cache.d.ts.map +0 -1
  22. package/out/shared/src/custom-key-map.d.ts +0 -26
  23. package/out/shared/src/custom-key-map.d.ts.map +0 -1
  24. package/out/shared/src/custom-key-set.d.ts +0 -25
  25. package/out/shared/src/custom-key-set.d.ts.map +0 -1
  26. package/out/shared/src/logging-test-utils.d.ts +0 -12
  27. package/out/shared/src/logging-test-utils.d.ts.map +0 -1
  28. package/out/shared/src/queue.d.ts +0 -53
  29. package/out/shared/src/queue.d.ts.map +0 -1
  30. package/out/shared/src/ring-buffer.d.ts +0 -42
  31. package/out/shared/src/ring-buffer.d.ts.map +0 -1
  32. package/out/shared/src/sorted-entries.d.ts +0 -2
  33. package/out/shared/src/sorted-entries.d.ts.map +0 -1
  34. package/out/zero/src/server/change-streamer.d.ts +0 -2
  35. package/out/zero/src/server/change-streamer.d.ts.map +0 -1
  36. package/out/zero/src/server/main.d.ts +0 -2
  37. package/out/zero/src/server/main.d.ts.map +0 -1
  38. package/out/zero/src/server/reaper.d.ts +0 -2
  39. package/out/zero/src/server/reaper.d.ts.map +0 -1
  40. package/out/zero/src/server/replicator.d.ts +0 -2
  41. package/out/zero/src/server/replicator.d.ts.map +0 -1
  42. package/out/zero/src/server/syncer.d.ts +0 -2
  43. package/out/zero/src/server/syncer.d.ts.map +0 -1
  44. package/out/zero-cache/src/auth/jwt.d.ts +0 -12
  45. package/out/zero-cache/src/auth/jwt.d.ts.map +0 -1
  46. package/out/zero-cache/src/auth/load-permissions.d.ts +0 -17
  47. package/out/zero-cache/src/auth/load-permissions.d.ts.map +0 -1
  48. package/out/zero-cache/src/auth/write-authorizer.d.ts +0 -28
  49. package/out/zero-cache/src/auth/write-authorizer.d.ts.map +0 -1
  50. package/out/zero-cache/src/config/server-context.d.ts +0 -16
  51. package/out/zero-cache/src/config/server-context.d.ts.map +0 -1
  52. package/out/zero-cache/src/custom/fetch.d.ts +0 -38
  53. package/out/zero-cache/src/custom/fetch.d.ts.map +0 -1
  54. package/out/zero-cache/src/custom/metrics.d.ts +0 -31
  55. package/out/zero-cache/src/custom/metrics.d.ts.map +0 -1
  56. package/out/zero-cache/src/custom-queries/transform-query.d.ts +0 -68
  57. package/out/zero-cache/src/custom-queries/transform-query.d.ts.map +0 -1
  58. package/out/zero-cache/src/db/create.d.ts +0 -12
  59. package/out/zero-cache/src/db/create.d.ts.map +0 -1
  60. package/out/zero-cache/src/db/delete-lite-db.d.ts +0 -2
  61. package/out/zero-cache/src/db/delete-lite-db.d.ts.map +0 -1
  62. package/out/zero-cache/src/db/index-predicate.d.ts +0 -4
  63. package/out/zero-cache/src/db/index-predicate.d.ts.map +0 -1
  64. package/out/zero-cache/src/db/migration-lite.d.ts +0 -78
  65. package/out/zero-cache/src/db/migration-lite.d.ts.map +0 -1
  66. package/out/zero-cache/src/db/migration.d.ts +0 -80
  67. package/out/zero-cache/src/db/migration.d.ts.map +0 -1
  68. package/out/zero-cache/src/db/pg-copy-binary.d.ts +0 -101
  69. package/out/zero-cache/src/db/pg-copy-binary.d.ts.map +0 -1
  70. package/out/zero-cache/src/db/pg-copy.d.ts +0 -30
  71. package/out/zero-cache/src/db/pg-copy.d.ts.map +0 -1
  72. package/out/zero-cache/src/db/pg-type-parser.d.ts +0 -15
  73. package/out/zero-cache/src/db/pg-type-parser.d.ts.map +0 -1
  74. package/out/zero-cache/src/db/transaction-pool.d.ts +0 -205
  75. package/out/zero-cache/src/db/transaction-pool.d.ts.map +0 -1
  76. package/out/zero-cache/src/db/warmup.d.ts +0 -4
  77. package/out/zero-cache/src/db/warmup.d.ts.map +0 -1
  78. package/out/zero-cache/src/observability/events.d.ts +0 -15
  79. package/out/zero-cache/src/observability/events.d.ts.map +0 -1
  80. package/out/zero-cache/src/observability/log-throttle.d.ts +0 -44
  81. package/out/zero-cache/src/observability/log-throttle.d.ts.map +0 -1
  82. package/out/zero-cache/src/server/anonymous-otel-start.d.ts +0 -21
  83. package/out/zero-cache/src/server/anonymous-otel-start.d.ts.map +0 -1
  84. package/out/zero-cache/src/server/change-streamer.d.ts +0 -3
  85. package/out/zero-cache/src/server/change-streamer.d.ts.map +0 -1
  86. package/out/zero-cache/src/server/inspector-delegate.d.ts +0 -71
  87. package/out/zero-cache/src/server/inspector-delegate.d.ts.map +0 -1
  88. package/out/zero-cache/src/server/main.d.ts +0 -3
  89. package/out/zero-cache/src/server/main.d.ts.map +0 -1
  90. package/out/zero-cache/src/server/otel-diag-logger.d.ts +0 -16
  91. package/out/zero-cache/src/server/otel-diag-logger.d.ts.map +0 -1
  92. package/out/zero-cache/src/server/otel-start.d.ts +0 -3
  93. package/out/zero-cache/src/server/otel-start.d.ts.map +0 -1
  94. package/out/zero-cache/src/server/priority-op.d.ts +0 -8
  95. package/out/zero-cache/src/server/priority-op.d.ts.map +0 -1
  96. package/out/zero-cache/src/server/reaper.d.ts +0 -3
  97. package/out/zero-cache/src/server/reaper.d.ts.map +0 -1
  98. package/out/zero-cache/src/server/replicator.d.ts +0 -10
  99. package/out/zero-cache/src/server/replicator.d.ts.map +0 -1
  100. package/out/zero-cache/src/server/slot-keeper.d.ts +0 -26
  101. package/out/zero-cache/src/server/slot-keeper.d.ts.map +0 -1
  102. package/out/zero-cache/src/server/syncer-assigner.d.ts +0 -14
  103. package/out/zero-cache/src/server/syncer-assigner.d.ts.map +0 -1
  104. package/out/zero-cache/src/server/syncer.d.ts +0 -3
  105. package/out/zero-cache/src/server/syncer.d.ts.map +0 -1
  106. package/out/zero-cache/src/server/worker-dispatcher.d.ts +0 -17
  107. package/out/zero-cache/src/server/worker-dispatcher.d.ts.map +0 -1
  108. package/out/zero-cache/src/services/analyze.d.ts +0 -9
  109. package/out/zero-cache/src/services/analyze.d.ts.map +0 -1
  110. package/out/zero-cache/src/services/change-source/change-source.d.ts +0 -39
  111. package/out/zero-cache/src/services/change-source/change-source.d.ts.map +0 -1
  112. package/out/zero-cache/src/services/change-source/common/backfill-manager.d.ts +0 -57
  113. package/out/zero-cache/src/services/change-source/common/backfill-manager.d.ts.map +0 -1
  114. package/out/zero-cache/src/services/change-source/common/change-stream-multiplexer.d.ts +0 -55
  115. package/out/zero-cache/src/services/change-source/common/change-stream-multiplexer.d.ts.map +0 -1
  116. package/out/zero-cache/src/services/change-source/common/init-cleanup.d.ts +0 -24
  117. package/out/zero-cache/src/services/change-source/common/init-cleanup.d.ts.map +0 -1
  118. package/out/zero-cache/src/services/change-source/common/replica-restore.d.ts +0 -140
  119. package/out/zero-cache/src/services/change-source/common/replica-restore.d.ts.map +0 -1
  120. package/out/zero-cache/src/services/change-source/common/replica-schema.d.ts +0 -14
  121. package/out/zero-cache/src/services/change-source/common/replica-schema.d.ts.map +0 -1
  122. package/out/zero-cache/src/services/change-source/custom/change-source.d.ts +0 -25
  123. package/out/zero-cache/src/services/change-source/custom/change-source.d.ts.map +0 -1
  124. package/out/zero-cache/src/services/change-source/pg/backfill-metadata.d.ts +0 -14
  125. package/out/zero-cache/src/services/change-source/pg/backfill-metadata.d.ts.map +0 -1
  126. package/out/zero-cache/src/services/change-source/pg/backfill-stream.d.ts +0 -36
  127. package/out/zero-cache/src/services/change-source/pg/backfill-stream.d.ts.map +0 -1
  128. package/out/zero-cache/src/services/change-source/pg/change-source-init.d.ts +0 -72
  129. package/out/zero-cache/src/services/change-source/pg/change-source-init.d.ts.map +0 -1
  130. package/out/zero-cache/src/services/change-source/pg/change-source.d.ts +0 -127
  131. package/out/zero-cache/src/services/change-source/pg/change-source.d.ts.map +0 -1
  132. package/out/zero-cache/src/services/change-source/pg/fork-request.d.ts +0 -57
  133. package/out/zero-cache/src/services/change-source/pg/fork-request.d.ts.map +0 -1
  134. package/out/zero-cache/src/services/change-source/pg/initial-sync.d.ts +0 -155
  135. package/out/zero-cache/src/services/change-source/pg/initial-sync.d.ts.map +0 -1
  136. package/out/zero-cache/src/services/change-source/pg/logical-replication/binary-reader.d.ts +0 -17
  137. package/out/zero-cache/src/services/change-source/pg/logical-replication/binary-reader.d.ts.map +0 -1
  138. package/out/zero-cache/src/services/change-source/pg/logical-replication/pgoutput-parser.d.ts +0 -28
  139. package/out/zero-cache/src/services/change-source/pg/logical-replication/pgoutput-parser.d.ts.map +0 -1
  140. package/out/zero-cache/src/services/change-source/pg/logical-replication/pgoutput.types.d.ts +0 -76
  141. package/out/zero-cache/src/services/change-source/pg/logical-replication/pgoutput.types.d.ts.map +0 -1
  142. package/out/zero-cache/src/services/change-source/pg/logical-replication/stream.d.ts +0 -169
  143. package/out/zero-cache/src/services/change-source/pg/logical-replication/stream.d.ts.map +0 -1
  144. package/out/zero-cache/src/services/change-source/pg/replication-slot-cleanup-monitor.d.ts +0 -16
  145. package/out/zero-cache/src/services/change-source/pg/replication-slot-cleanup-monitor.d.ts.map +0 -1
  146. package/out/zero-cache/src/services/change-source/pg/replication-slot-health.d.ts +0 -15
  147. package/out/zero-cache/src/services/change-source/pg/replication-slot-health.d.ts.map +0 -1
  148. package/out/zero-cache/src/services/change-source/pg/replication-slots.d.ts +0 -127
  149. package/out/zero-cache/src/services/change-source/pg/replication-slots.d.ts.map +0 -1
  150. package/out/zero-cache/src/services/change-source/pg/schema/init.d.ts +0 -9
  151. package/out/zero-cache/src/services/change-source/pg/schema/init.d.ts.map +0 -1
  152. package/out/zero-cache/src/services/change-source/protocol/backfill-progress.d.ts +0 -68
  153. package/out/zero-cache/src/services/change-source/protocol/backfill-progress.d.ts.map +0 -1
  154. package/out/zero-cache/src/services/change-streamer/backfill-state-tracker.d.ts +0 -72
  155. package/out/zero-cache/src/services/change-streamer/backfill-state-tracker.d.ts.map +0 -1
  156. package/out/zero-cache/src/services/change-streamer/backfill-state.d.ts +0 -50
  157. package/out/zero-cache/src/services/change-streamer/backfill-state.d.ts.map +0 -1
  158. package/out/zero-cache/src/services/change-streamer/backup-cleanup-monitor-factory.d.ts +0 -12
  159. package/out/zero-cache/src/services/change-streamer/backup-cleanup-monitor-factory.d.ts.map +0 -1
  160. package/out/zero-cache/src/services/change-streamer/backup-monitor.d.ts +0 -57
  161. package/out/zero-cache/src/services/change-streamer/backup-monitor.d.ts.map +0 -1
  162. package/out/zero-cache/src/services/change-streamer/broadcast.d.ts +0 -98
  163. package/out/zero-cache/src/services/change-streamer/broadcast.d.ts.map +0 -1
  164. package/out/zero-cache/src/services/change-streamer/change-log-codec.d.ts +0 -34
  165. package/out/zero-cache/src/services/change-streamer/change-log-codec.d.ts.map +0 -1
  166. package/out/zero-cache/src/services/change-streamer/change-log-compare-digest.d.ts +0 -34
  167. package/out/zero-cache/src/services/change-streamer/change-log-compare-digest.d.ts.map +0 -1
  168. package/out/zero-cache/src/services/change-streamer/change-log-initializer.d.ts +0 -158
  169. package/out/zero-cache/src/services/change-streamer/change-log-initializer.d.ts.map +0 -1
  170. package/out/zero-cache/src/services/change-streamer/change-log-transaction-hash.d.ts +0 -19
  171. package/out/zero-cache/src/services/change-streamer/change-log-transaction-hash.d.ts.map +0 -1
  172. package/out/zero-cache/src/services/change-streamer/change-streamer-http.d.ts +0 -78
  173. package/out/zero-cache/src/services/change-streamer/change-streamer-http.d.ts.map +0 -1
  174. package/out/zero-cache/src/services/change-streamer/change-streamer-service.d.ts +0 -152
  175. package/out/zero-cache/src/services/change-streamer/change-streamer-service.d.ts.map +0 -1
  176. package/out/zero-cache/src/services/change-streamer/change-streamer.d.ts +0 -575
  177. package/out/zero-cache/src/services/change-streamer/change-streamer.d.ts.map +0 -1
  178. package/out/zero-cache/src/services/change-streamer/drain-tracker.d.ts +0 -24
  179. package/out/zero-cache/src/services/change-streamer/drain-tracker.d.ts.map +0 -1
  180. package/out/zero-cache/src/services/change-streamer/error-type-enum.d.ts +0 -15
  181. package/out/zero-cache/src/services/change-streamer/error-type-enum.d.ts.map +0 -1
  182. package/out/zero-cache/src/services/change-streamer/forwarder.d.ts +0 -49
  183. package/out/zero-cache/src/services/change-streamer/forwarder.d.ts.map +0 -1
  184. package/out/zero-cache/src/services/change-streamer/litestream-sync-requester.d.ts +0 -80
  185. package/out/zero-cache/src/services/change-streamer/litestream-sync-requester.d.ts.map +0 -1
  186. package/out/zero-cache/src/services/change-streamer/litestream3-prometheus-poller.d.ts +0 -88
  187. package/out/zero-cache/src/services/change-streamer/litestream3-prometheus-poller.d.ts.map +0 -1
  188. package/out/zero-cache/src/services/change-streamer/replica-poller.d.ts +0 -15
  189. package/out/zero-cache/src/services/change-streamer/replica-poller.d.ts.map +0 -1
  190. package/out/zero-cache/src/services/change-streamer/restore-admission.d.ts +0 -243
  191. package/out/zero-cache/src/services/change-streamer/restore-admission.d.ts.map +0 -1
  192. package/out/zero-cache/src/services/change-streamer/schema/init.d.ts +0 -6
  193. package/out/zero-cache/src/services/change-streamer/schema/init.d.ts.map +0 -1
  194. package/out/zero-cache/src/services/change-streamer/schema/tables.d.ts +0 -152
  195. package/out/zero-cache/src/services/change-streamer/schema/tables.d.ts.map +0 -1
  196. package/out/zero-cache/src/services/change-streamer/server-start-metrics.d.ts +0 -33
  197. package/out/zero-cache/src/services/change-streamer/server-start-metrics.d.ts.map +0 -1
  198. package/out/zero-cache/src/services/change-streamer/shard-sampling.d.ts +0 -11
  199. package/out/zero-cache/src/services/change-streamer/shard-sampling.d.ts.map +0 -1
  200. package/out/zero-cache/src/services/change-streamer/snapshot-message.d.ts +0 -92
  201. package/out/zero-cache/src/services/change-streamer/snapshot-message.d.ts.map +0 -1
  202. package/out/zero-cache/src/services/change-streamer/snapshot-reservations.d.ts +0 -36
  203. package/out/zero-cache/src/services/change-streamer/snapshot-reservations.d.ts.map +0 -1
  204. package/out/zero-cache/src/services/change-streamer/snapshot.d.ts +0 -22
  205. package/out/zero-cache/src/services/change-streamer/snapshot.d.ts.map +0 -1
  206. package/out/zero-cache/src/services/change-streamer/sqlite-change-log-catchup.d.ts +0 -99
  207. package/out/zero-cache/src/services/change-streamer/sqlite-change-log-catchup.d.ts.map +0 -1
  208. package/out/zero-cache/src/services/change-streamer/sqlite-change-log-comparator.d.ts +0 -83
  209. package/out/zero-cache/src/services/change-streamer/sqlite-change-log-comparator.d.ts.map +0 -1
  210. package/out/zero-cache/src/services/change-streamer/sqlite-change-log-purge-scheduler.d.ts +0 -121
  211. package/out/zero-cache/src/services/change-streamer/sqlite-change-log-purge-scheduler.d.ts.map +0 -1
  212. package/out/zero-cache/src/services/change-streamer/sqlite-change-log-read-router.d.ts +0 -73
  213. package/out/zero-cache/src/services/change-streamer/sqlite-change-log-read-router.d.ts.map +0 -1
  214. package/out/zero-cache/src/services/change-streamer/sqlite-change-log-reader.d.ts +0 -62
  215. package/out/zero-cache/src/services/change-streamer/sqlite-change-log-reader.d.ts.map +0 -1
  216. package/out/zero-cache/src/services/change-streamer/sqlite-change-log-writer.d.ts +0 -114
  217. package/out/zero-cache/src/services/change-streamer/sqlite-change-log-writer.d.ts.map +0 -1
  218. package/out/zero-cache/src/services/change-streamer/storer.d.ts +0 -276
  219. package/out/zero-cache/src/services/change-streamer/storer.d.ts.map +0 -1
  220. package/out/zero-cache/src/services/change-streamer/subscribe.d.ts +0 -485
  221. package/out/zero-cache/src/services/change-streamer/subscribe.d.ts.map +0 -1
  222. package/out/zero-cache/src/services/change-streamer/subscriber.d.ts +0 -205
  223. package/out/zero-cache/src/services/change-streamer/subscriber.d.ts.map +0 -1
  224. package/out/zero-cache/src/services/change-streamer/upstream-acker.d.ts +0 -52
  225. package/out/zero-cache/src/services/change-streamer/upstream-acker.d.ts.map +0 -1
  226. package/out/zero-cache/src/services/limiter/sliding-window-limiter.d.ts +0 -57
  227. package/out/zero-cache/src/services/limiter/sliding-window-limiter.d.ts.map +0 -1
  228. package/out/zero-cache/src/services/litestream/commands.d.ts +0 -77
  229. package/out/zero-cache/src/services/litestream/commands.d.ts.map +0 -1
  230. package/out/zero-cache/src/services/litestream/litestream-controller.d.ts +0 -78
  231. package/out/zero-cache/src/services/litestream/litestream-controller.d.ts.map +0 -1
  232. package/out/zero-cache/src/services/litestream/metrics.d.ts +0 -31
  233. package/out/zero-cache/src/services/litestream/metrics.d.ts.map +0 -1
  234. package/out/zero-cache/src/services/litestream/restore-progress.d.ts +0 -24
  235. package/out/zero-cache/src/services/litestream/restore-progress.d.ts.map +0 -1
  236. package/out/zero-cache/src/services/mutagen/mutagen.d.ts +0 -40
  237. package/out/zero-cache/src/services/mutagen/mutagen.d.ts.map +0 -1
  238. package/out/zero-cache/src/services/mutagen/pusher.d.ts +0 -63
  239. package/out/zero-cache/src/services/mutagen/pusher.d.ts.map +0 -1
  240. package/out/zero-cache/src/services/replicator/change-log-db.d.ts +0 -368
  241. package/out/zero-cache/src/services/replicator/change-log-db.d.ts.map +0 -1
  242. package/out/zero-cache/src/services/replicator/change-log-stream-writer.d.ts +0 -56
  243. package/out/zero-cache/src/services/replicator/change-log-stream-writer.d.ts.map +0 -1
  244. package/out/zero-cache/src/services/replicator/change-processor.d.ts +0 -37
  245. package/out/zero-cache/src/services/replicator/change-processor.d.ts.map +0 -1
  246. package/out/zero-cache/src/services/replicator/drain-handler.d.ts +0 -82
  247. package/out/zero-cache/src/services/replicator/drain-handler.d.ts.map +0 -1
  248. package/out/zero-cache/src/services/replicator/incremental-sync.d.ts +0 -25
  249. package/out/zero-cache/src/services/replicator/incremental-sync.d.ts.map +0 -1
  250. package/out/zero-cache/src/services/replicator/notifier.d.ts +0 -9
  251. package/out/zero-cache/src/services/replicator/notifier.d.ts.map +0 -1
  252. package/out/zero-cache/src/services/replicator/replication-status.d.ts +0 -71
  253. package/out/zero-cache/src/services/replicator/replication-status.d.ts.map +0 -1
  254. package/out/zero-cache/src/services/replicator/replicator.d.ts +0 -86
  255. package/out/zero-cache/src/services/replicator/replicator.d.ts.map +0 -1
  256. package/out/zero-cache/src/services/replicator/reporter/recorder.d.ts +0 -55
  257. package/out/zero-cache/src/services/replicator/reporter/recorder.d.ts.map +0 -1
  258. package/out/zero-cache/src/services/replicator/sqlite-change-log-observability.d.ts +0 -132
  259. package/out/zero-cache/src/services/replicator/sqlite-change-log-observability.d.ts.map +0 -1
  260. package/out/zero-cache/src/services/replicator/sqlite-change-log-purger.d.ts +0 -120
  261. package/out/zero-cache/src/services/replicator/sqlite-change-log-purger.d.ts.map +0 -1
  262. package/out/zero-cache/src/services/replicator/write-worker-client.d.ts +0 -111
  263. package/out/zero-cache/src/services/replicator/write-worker-client.d.ts.map +0 -1
  264. package/out/zero-cache/src/services/run-ast.d.ts +0 -39
  265. package/out/zero-cache/src/services/run-ast.d.ts.map +0 -1
  266. package/out/zero-cache/src/services/runner.d.ts +0 -19
  267. package/out/zero-cache/src/services/runner.d.ts.map +0 -1
  268. package/out/zero-cache/src/services/view-syncer/active-users-gauge.d.ts +0 -17
  269. package/out/zero-cache/src/services/view-syncer/active-users-gauge.d.ts.map +0 -1
  270. package/out/zero-cache/src/services/view-syncer/advancement-metrics.d.ts +0 -26
  271. package/out/zero-cache/src/services/view-syncer/advancement-metrics.d.ts.map +0 -1
  272. package/out/zero-cache/src/services/view-syncer/batch-pacer.d.ts +0 -79
  273. package/out/zero-cache/src/services/view-syncer/batch-pacer.d.ts.map +0 -1
  274. package/out/zero-cache/src/services/view-syncer/client-handler.d.ts +0 -97
  275. package/out/zero-cache/src/services/view-syncer/client-handler.d.ts.map +0 -1
  276. package/out/zero-cache/src/services/view-syncer/client-schema.d.ts +0 -18
  277. package/out/zero-cache/src/services/view-syncer/client-schema.d.ts.map +0 -1
  278. package/out/zero-cache/src/services/view-syncer/connection-context-manager.d.ts +0 -184
  279. package/out/zero-cache/src/services/view-syncer/connection-context-manager.d.ts.map +0 -1
  280. package/out/zero-cache/src/services/view-syncer/cvr-purger.d.ts +0 -22
  281. package/out/zero-cache/src/services/view-syncer/cvr-purger.d.ts.map +0 -1
  282. package/out/zero-cache/src/services/view-syncer/cvr-store.d.ts +0 -128
  283. package/out/zero-cache/src/services/view-syncer/cvr-store.d.ts.map +0 -1
  284. package/out/zero-cache/src/services/view-syncer/cvr.d.ts +0 -294
  285. package/out/zero-cache/src/services/view-syncer/cvr.d.ts.map +0 -1
  286. package/out/zero-cache/src/services/view-syncer/deferred-writes-budget.d.ts +0 -81
  287. package/out/zero-cache/src/services/view-syncer/deferred-writes-budget.d.ts.map +0 -1
  288. package/out/zero-cache/src/services/view-syncer/drain-coordinator.d.ts +0 -45
  289. package/out/zero-cache/src/services/view-syncer/drain-coordinator.d.ts.map +0 -1
  290. package/out/zero-cache/src/services/view-syncer/e2e-serving-lag.d.ts +0 -53
  291. package/out/zero-cache/src/services/view-syncer/e2e-serving-lag.d.ts.map +0 -1
  292. package/out/zero-cache/src/services/view-syncer/hydration-budget.d.ts +0 -33
  293. package/out/zero-cache/src/services/view-syncer/hydration-budget.d.ts.map +0 -1
  294. package/out/zero-cache/src/services/view-syncer/hydration-circuit-breaker.d.ts +0 -51
  295. package/out/zero-cache/src/services/view-syncer/hydration-circuit-breaker.d.ts.map +0 -1
  296. package/out/zero-cache/src/services/view-syncer/inspect-handler.d.ts +0 -34
  297. package/out/zero-cache/src/services/view-syncer/inspect-handler.d.ts.map +0 -1
  298. package/out/zero-cache/src/services/view-syncer/pipeline-driver.d.ts +0 -296
  299. package/out/zero-cache/src/services/view-syncer/pipeline-driver.d.ts.map +0 -1
  300. package/out/zero-cache/src/services/view-syncer/plan-warnings.d.ts +0 -7
  301. package/out/zero-cache/src/services/view-syncer/plan-warnings.d.ts.map +0 -1
  302. package/out/zero-cache/src/services/view-syncer/push-cost.d.ts +0 -132
  303. package/out/zero-cache/src/services/view-syncer/push-cost.d.ts.map +0 -1
  304. package/out/zero-cache/src/services/view-syncer/push-cutoff.d.ts +0 -55
  305. package/out/zero-cache/src/services/view-syncer/push-cutoff.d.ts.map +0 -1
  306. package/out/zero-cache/src/services/view-syncer/query-covering.d.ts +0 -28
  307. package/out/zero-cache/src/services/view-syncer/query-covering.d.ts.map +0 -1
  308. package/out/zero-cache/src/services/view-syncer/query-shape.d.ts +0 -25
  309. package/out/zero-cache/src/services/view-syncer/query-shape.d.ts.map +0 -1
  310. package/out/zero-cache/src/services/view-syncer/query-stats.d.ts +0 -89
  311. package/out/zero-cache/src/services/view-syncer/query-stats.d.ts.map +0 -1
  312. package/out/zero-cache/src/services/view-syncer/row-record-cache.d.ts +0 -90
  313. package/out/zero-cache/src/services/view-syncer/row-record-cache.d.ts.map +0 -1
  314. package/out/zero-cache/src/services/view-syncer/row-set-signature.d.ts +0 -17
  315. package/out/zero-cache/src/services/view-syncer/row-set-signature.d.ts.map +0 -1
  316. package/out/zero-cache/src/services/view-syncer/schema/cvr.d.ts +0 -86
  317. package/out/zero-cache/src/services/view-syncer/schema/cvr.d.ts.map +0 -1
  318. package/out/zero-cache/src/services/view-syncer/schema/init.d.ts +0 -5
  319. package/out/zero-cache/src/services/view-syncer/schema/init.d.ts.map +0 -1
  320. package/out/zero-cache/src/services/view-syncer/schema/types.d.ts +0 -563
  321. package/out/zero-cache/src/services/view-syncer/schema/types.d.ts.map +0 -1
  322. package/out/zero-cache/src/services/view-syncer/snapshot-row-cache.d.ts +0 -95
  323. package/out/zero-cache/src/services/view-syncer/snapshot-row-cache.d.ts.map +0 -1
  324. package/out/zero-cache/src/services/view-syncer/snapshotter.d.ts +0 -420
  325. package/out/zero-cache/src/services/view-syncer/snapshotter.d.ts.map +0 -1
  326. package/out/zero-cache/src/services/view-syncer/tracer.d.ts +0 -2
  327. package/out/zero-cache/src/services/view-syncer/tracer.d.ts.map +0 -1
  328. package/out/zero-cache/src/services/view-syncer/ttl-clock.d.ts +0 -10
  329. package/out/zero-cache/src/services/view-syncer/ttl-clock.d.ts.map +0 -1
  330. package/out/zero-cache/src/services/view-syncer/view-syncer.d.ts +0 -133
  331. package/out/zero-cache/src/services/view-syncer/view-syncer.d.ts.map +0 -1
  332. package/out/zero-cache/src/types/downstream.d.ts +0 -11
  333. package/out/zero-cache/src/types/downstream.d.ts.map +0 -1
  334. package/out/zero-cache/src/types/error-with-level.d.ts +0 -9
  335. package/out/zero-cache/src/types/error-with-level.d.ts.map +0 -1
  336. package/out/zero-cache/src/types/pg-patch.d.ts +0 -21
  337. package/out/zero-cache/src/types/pg-patch.d.ts.map +0 -1
  338. package/out/zero-cache/src/types/pg-versions.d.ts +0 -3
  339. package/out/zero-cache/src/types/pg-versions.d.ts.map +0 -1
  340. package/out/zero-cache/src/types/poke-chunk.d.ts +0 -18
  341. package/out/zero-cache/src/types/poke-chunk.d.ts.map +0 -1
  342. package/out/zero-cache/src/types/streams.d.ts +0 -115
  343. package/out/zero-cache/src/types/streams.d.ts.map +0 -1
  344. package/out/zero-cache/src/types/subscription.d.ts +0 -197
  345. package/out/zero-cache/src/types/subscription.d.ts.map +0 -1
  346. package/out/zero-cache/src/workers/connect-params.d.ts +0 -28
  347. package/out/zero-cache/src/workers/connect-params.d.ts.map +0 -1
  348. package/out/zero-cache/src/workers/connection.d.ts +0 -77
  349. package/out/zero-cache/src/workers/connection.d.ts.map +0 -1
  350. package/out/zero-cache/src/workers/replicator.d.ts +0 -57
  351. package/out/zero-cache/src/workers/replicator.d.ts.map +0 -1
  352. package/out/zero-cache/src/workers/syncer-ws-message-handler.d.ts +0 -14
  353. package/out/zero-cache/src/workers/syncer-ws-message-handler.d.ts.map +0 -1
  354. package/out/zero-cache/src/workers/syncer.d.ts +0 -67
  355. package/out/zero-cache/src/workers/syncer.d.ts.map +0 -1
  356. package/out/zero-events/src/index.d.ts +0 -27
  357. package/out/zero-events/src/index.d.ts.map +0 -1
  358. package/out/zero-events/src/json.d.ts +0 -20
  359. package/out/zero-events/src/json.d.ts.map +0 -1
  360. package/out/zero-events/src/status.d.ts +0 -144
  361. package/out/zero-events/src/status.d.ts.map +0 -1
  362. package/out/zqlite/src/database-storage.d.ts +0 -43
  363. package/out/zqlite/src/database-storage.d.ts.map +0 -1
  364. package/out/zqlite/src/explain-queries.d.ts +0 -4
  365. package/out/zqlite/src/explain-queries.d.ts.map +0 -1
  366. package/out/zqlite/src/internal/sql-inline.d.ts +0 -13
  367. package/out/zqlite/src/internal/sql-inline.d.ts.map +0 -1
  368. package/out/zqlite/src/resolve-scalar-subqueries.d.ts +0 -72
  369. package/out/zqlite/src/resolve-scalar-subqueries.d.ts.map +0 -1
  370. package/out/zqlite/src/sqlite-cost-model.d.ts +0 -17
  371. package/out/zqlite/src/sqlite-cost-model.d.ts.map +0 -1
  372. package/out/zqlite/src/sqlite-stat-fanout.d.ts +0 -121
  373. package/out/zqlite/src/sqlite-stat-fanout.d.ts.map +0 -1
@@ -1,152 +0,0 @@
1
- import type { LogContext } from '@rocicorp/logger';
2
- import type postgres from 'postgres';
3
- import { AbortError } from '../../../../../shared/src/abort-error.ts';
4
- import { type PostgresDB } from '../../../types/pg.ts';
5
- import { type ShardID } from '../../../types/shards.ts';
6
- import type { BackfillID, Change, TableMetadata } from '../../change-source/protocol/current/data.ts';
7
- import type { SubscriptionState } from '../../replicator/schema/replication-state.ts';
8
- export declare const PG_SCHEMA = "cdc";
9
- export type ChangeLogEntry = {
10
- watermark: string;
11
- change: Change;
12
- };
13
- /**
14
- * Tracks the watermark from which to resume the change stream and the
15
- * current owner (task ID) acting as the single writer to the changeLog.
16
- */
17
- export type ReplicationState = {
18
- lastWatermark: string;
19
- owner: string | null;
20
- ownerAddress: string | null;
21
- };
22
- export declare function createReplicationStateTable(shard: ShardID): string;
23
- export declare function discoverChangeStreamerAddress(shard: ShardID, sql: PostgresDB): Promise<string | null>;
24
- /**
25
- * This mirrors the analogously named table in the SQLite replica
26
- * (`services/replicator/schema/replication-state.ts`), and is used
27
- * to detect when the replica has been reset and is no longer compatible
28
- * with the current ChangeLog.
29
- */
30
- export type ReplicationConfig = {
31
- replicaVersion: string;
32
- publications: readonly string[];
33
- };
34
- export declare function createBackfillTables(shard: ShardID): string;
35
- export type TableMetadataRow = {
36
- schema: string;
37
- table: string;
38
- metadata: TableMetadata;
39
- };
40
- export type BackfillingColumn = {
41
- schema: string;
42
- table: string;
43
- column: string;
44
- backfill: BackfillID;
45
- };
46
- interface PurgeLock {
47
- release(): Promise<void>;
48
- }
49
- export declare function setupCDCTables(lc: LogContext, db: postgres.TransactionSql, shard: ShardID): Promise<void>;
50
- export declare function markResetRequired(sql: PostgresDB, shard: ShardID): Promise<void>;
51
- export type ReplicaSubscriptionState = Pick<SubscriptionState, 'publications' | 'replicaVersion' | 'watermark'>;
52
- /**
53
- * Checks, without modifying the change db, that the replica can be served
54
- * by the change log once {@link ensureReplicationConfig} is called upon
55
- * taking over the change log. Throws an {@link AutoResetSignal} otherwise.
56
- *
57
- * This allows a replication-manager to detect an incompatible replica at
58
- * startup while leaving the change log to its current owner until then.
59
- */
60
- export declare function checkReplicationConfig(lc: LogContext, db: PostgresDB, subscriptionState: ReplicaSubscriptionState, shard: ShardID, autoReset: boolean, behindSlot?: boolean): Promise<void>;
61
- /**
62
- * Initializes the cdc tables for the replica, resetting them if they were
63
- * written for a different replica (version or publications). This disrupts
64
- * a replication-manager that is serving the change log, and is thus only
65
- * done when taking over the change log (see `Storer.assumeOwnershipAtHead`).
66
- *
67
- * @param purgeLock A purge lock held by the caller, if any, which is released
68
- * before the tables are reset.
69
- * @param behindSlot See {@link checkReplicationConfig}.
70
- */
71
- export declare function ensureReplicationConfig(lc: LogContext, db: PostgresDB, subscriptionState: ReplicaSubscriptionState, shard: ShardID, autoReset: boolean, purgeLock?: PurgeLock, setTimeoutFn?: typeof setTimeout, behindSlot?: boolean): Promise<void>;
72
- export type ChangeLogReinitialization = {
73
- /**
74
- * The watermark of the replica from which the change log is re-initialized,
75
- * i.e. the watermark from which the change stream will resume.
76
- */
77
- watermark: string;
78
- cookies: {
79
- tableMetadata: readonly {
80
- schema: string;
81
- table: string;
82
- metadata: TableMetadata;
83
- }[];
84
- backfilling: readonly {
85
- schema: string;
86
- table: string;
87
- column: string;
88
- backfill: BackfillID;
89
- }[];
90
- };
91
- owner: string;
92
- ownerAddress: string;
93
- };
94
- /**
95
- * Re-initializes the change log from the state of the replica if it does not
96
- * contain all of the replica's changes, i.e. if its `lastWatermark` is before
97
- * the replica's watermark. This is the case if the change log is no longer
98
- * maintained (e.g. after running in high-availability mode), or if its last
99
- * owner stopped before persisting changes that it had already forwarded
100
- * (and backed up). Ownership of the change log is taken in the same
101
- * transaction, in which:
102
- *
103
- * * The `replicationState`, `changeLog`, `tableMetadata`, and `backfilling`
104
- * tables are truncated. (The `replicationConfig` is kept;
105
- * {@link ensureReplicationConfig} handles changes of the replica version
106
- * or publications.)
107
- * * The change log is seeded with an empty transaction at the replica's
108
- * watermark, so that subscribers at that watermark can be caught up, while
109
- * subscribers at earlier watermarks are rejected as being too old.
110
- * * The `tableMetadata` and `backfilling` cookies are set from the replica.
111
- *
112
- * Returns `'maintained'` without modifying anything if the change log's
113
- * `lastWatermark` is at or past the replica's watermark, i.e. the change log
114
- * contains all of the replica's changes. Because a replication slot is only
115
- * acked past a transaction once it has been backed up, this means that the
116
- * change log contains every transaction up to the position of the replica's
117
- * replication slot, and it can be taken over (and resumed from its head).
118
- *
119
- * This is called when the change log's head is behind the position of the
120
- * replication slot (see `PgChangeLogPurgeLocker`). That position cannot be
121
- * compared with the watermarks of transactions to determine whether the
122
- * change log is maintained, as it is also advanced past positions of changes
123
- * outside of the publication.
124
- *
125
- * @param purgeLock A purge lock held by the caller, if any, which is released
126
- * before the tables are truncated.
127
- */
128
- export declare function reinitializeChangeLog(lc: LogContext, db: PostgresDB, shard: ShardID, { watermark, cookies, owner, ownerAddress }: ChangeLogReinitialization, purgeLock?: PurgeLock, setTimeoutFn?: typeof setTimeout): Promise<'reinitialized' | 'maintained'>;
129
- export declare const CHANGE_STREAMER_APP_NAME = "zero-change-streamer";
130
- export declare class AutoResetSignal extends AbortError {
131
- readonly name = "AutoResetSignal";
132
- }
133
- /**
134
- * Terminates zero-cache backends that are blocking the current backend
135
- * from acquiring locks on CDC tables (e.g., during TRUNCATE).
136
- *
137
- * This is used during change-DB takeover when the new replication-manager's
138
- * `ensureReplicationConfig` needs to TRUNCATE tables, but the old
139
- * replication-manager's storer is still reading from them (e.g., large
140
- * catchup cursors).
141
- *
142
- * The function:
143
- * 1. Finds backends waiting for a lock on a TRUNCATE in {schema}
144
- * 2. Uses `pg_blocking_pids()` to identify which backends are blocking them
145
- * 3. Terminates blocking backends that have `application_name = 'zero-change-streamer'`
146
- *
147
- * Must be called on a **separate connection** from the one that is blocked,
148
- * since the blocked connection is inside a pending transaction.
149
- */
150
- export declare function terminateChangeDBLockHolders(lc: LogContext, db: PostgresDB, shard: ShardID): Promise<void>;
151
- export {};
152
- //# sourceMappingURL=tables.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tables.d.ts","sourceRoot":"","sources":["../../../../../../../zero-cache/src/services/change-streamer/schema/tables.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,kBAAkB,CAAC;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AM,CAAC;YACd,MAAM,EAAE,MAAM,CAAC;YACf,QAAQ,EAAE,UAAU,CAAC;SACtB,EAAE,CAAC;KACL,CAAC;IACF,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,wBAAgB,qBAAqB,CACnC,EAAE,EAAE,UAAU,EACd,EAAE,EAAE,UAAU,EACd,KAAK,EAAE,OAAO,EACd,EAAC,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,YAAY,EAAC,EAAE,yBAAyB,EACpE,SAAS,CAAC,EAAE,SAAS,EACrB,YAAY,GAAE,OAAO,UAAuB,GAC3C,OAAO,CAAC,eAAe,GAAG,YAAY,CAAC,CAuDzC;AAED,eAAO,MAAM,wBAAwB,yBAAyB,CAAC;AAE/D,qBAAa,eAAgB,SAAQ,UAAU;IAC7C,QAAQ,CAAC,IAAI,qBAAqB;CACnC;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,4BAA4B,CAChD,EAAE,EAAE,UAAU,EACd,EAAE,EAAE,UAAU,EACd,KAAK,EAAE,OAAO,iBA4Cf"}
@@ -1,33 +0,0 @@
1
- import type { InitializeKind } from '../change-source/common/replica-restore.ts';
2
- /**
3
- * The phases of a replication-manager's start:
4
- * - `fork_wait`: selecting the replica to restore from (and creating or
5
- * claiming its slot), including the wait for a forked replica to pass the
6
- * new slot's position
7
- * - `restore`: restoring the replica from its backup
8
- * - `catch_up`: from initialization to the backup-replicator being caught up
9
- * (i.e. its replication lag readiness)
10
- * - `backup_confirm`: waiting for the first backup to cover the replica
11
- * - `total`: from the start of the (change-streamer) process to readiness
12
- *
13
- * The phases are not exhaustive (e.g. connecting to and preparing the
14
- * upstream), and `catch_up` and `backup_confirm` overlap.
15
- */
16
- export type ServerStartPhase = 'fork_wait' | 'restore' | 'catch_up' | 'backup_confirm' | 'total';
17
- /**
18
- * Records where a replication-manager's start goes, reported once it is
19
- * ready by the `zero.replication.server_start` gauge, in seconds, labeled
20
- * by `phase` and `kind` (see {@link InitializeKind}). This is for diagnosis,
21
- * e.g. of why a start is slow, as the process only starts once.
22
- */
23
- export declare class ServerStartMetrics {
24
- #private;
25
- setKind(kind: InitializeKind | undefined): void;
26
- record(phase: ServerStartPhase, ms: number | undefined): void;
27
- /**
28
- * Records the `total` (by default, the time since the process started) and
29
- * starts reporting the gauge. Phases recorded afterwards are ignored.
30
- */
31
- ready(totalMs?: number): void;
32
- }
33
- //# sourceMappingURL=server-start-metrics.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"server-start-metrics.d.ts","sourceRoot":"","sources":["../../../../../../zero-cache/src/services/change-streamer/server-start-metrics.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,4CAA4C,CAAC;AAE/E;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,gBAAgB,GACxB,WAAW,GACX,SAAS,GACT,UAAU,GACV,gBAAgB,GAChB,OAAO,CAAC;AAEZ;;;;;GAKG;AACH,qBAAa,kBAAkB;;IAK7B,OAAO,CAAC,IAAI,EAAE,cAAc,GAAG,SAAS,QAEvC;IAED,MAAM,CAAC,KAAK,EAAE,gBAAgB,EAAE,EAAE,EAAE,MAAM,GAAG,SAAS,QAIrD;IAED;;;OAGG;IACH,KAAK,CAAC,OAAO,SAAoB,QAmBhC;CACF"}
@@ -1,11 +0,0 @@
1
- import type { ShardID } from '../../types/shards.ts';
2
- /**
3
- * Stable percentage sampling keyed by shard and an arbitrary identity: a
4
- * subscriber's task for read routing, a watermark for catchup comparison.
5
- *
6
- * The same key always lands in the same bucket, so raising `percent` only ever
7
- * adds to the sampled set, and every process in a shard agrees on the set
8
- * without coordinating.
9
- */
10
- export declare function isSampledForShard(shard: ShardID, key: string, percent: number): boolean;
11
- //# sourceMappingURL=shard-sampling.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"shard-sampling.d.ts","sourceRoot":"","sources":["../../../../../../zero-cache/src/services/change-streamer/shard-sampling.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,uBAAuB,CAAC;AAEnD;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,OAAO,EACd,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,MAAM,GACd,OAAO,CAQT"}
@@ -1,92 +0,0 @@
1
- /**
2
- * Pure schema definitions for the `/snapshot` reservation status message.
3
- *
4
- * These live in their own module (depending only on valita) so that both
5
- * {@link snapshot.ts} (which also pulls in the change-streamer HTTP client) and
6
- * {@link subscribe.ts} can import them without forming an import cycle.
7
- */
8
- import * as v from '../../../../shared/src/valita.ts';
9
- export declare const statusSchema: v.ObjectType<{
10
- tag: v.Type<"status">;
11
- /**
12
- * The location from which litestream should perform the restore.
13
- */
14
- backupURL: v.Type<string>;
15
- /**
16
- * The `replicaVersion` of the backup. If a subscriber's restored or
17
- * existing replica is of a different version, it should delete it and
18
- * retry the restore from litestream (i.e. equivalent to a
19
- * `WrongReplicaVersion` response from a `/changes` subscription).
20
- */
21
- replicaVersion: v.Type<string>;
22
- /**
23
- * The earliest watermark from which catchup is possible. If the
24
- * subscriber's replica is older that this watermark, it should delete it
25
- * and (retry the) restore from litestream (i.e. equivalent to a
26
- * `WatermarkTooOld` response from a `/changes` subscription).
27
- */
28
- minWatermark: v.Type<string>;
29
- /**
30
- * The size in bytes of the replication-manager's replica when the snapshot
31
- * was reserved, used as an estimate of the size of the restored replica
32
- * when reporting restore progress. Absent from older replication-managers.
33
- */
34
- replicaSize: v.Optional<number>;
35
- }, undefined>;
36
- export type SnapshotStatus = v.Infer<typeof statusSchema>;
37
- export declare const statusMessageSchema: v.TupleType<[v.Type<"status">, v.ObjectType<{
38
- tag: v.Type<"status">;
39
- /**
40
- * The location from which litestream should perform the restore.
41
- */
42
- backupURL: v.Type<string>;
43
- /**
44
- * The `replicaVersion` of the backup. If a subscriber's restored or
45
- * existing replica is of a different version, it should delete it and
46
- * retry the restore from litestream (i.e. equivalent to a
47
- * `WrongReplicaVersion` response from a `/changes` subscription).
48
- */
49
- replicaVersion: v.Type<string>;
50
- /**
51
- * The earliest watermark from which catchup is possible. If the
52
- * subscriber's replica is older that this watermark, it should delete it
53
- * and (retry the) restore from litestream (i.e. equivalent to a
54
- * `WatermarkTooOld` response from a `/changes` subscription).
55
- */
56
- minWatermark: v.Type<string>;
57
- /**
58
- * The size in bytes of the replication-manager's replica when the snapshot
59
- * was reserved, used as an estimate of the size of the restored replica
60
- * when reporting restore progress. Absent from older replication-managers.
61
- */
62
- replicaSize: v.Optional<number>;
63
- }, undefined>]>;
64
- export declare const snapshotMessageSchema: v.UnionType<[v.TupleType<[v.Type<"status">, v.ObjectType<{
65
- tag: v.Type<"status">;
66
- /**
67
- * The location from which litestream should perform the restore.
68
- */
69
- backupURL: v.Type<string>;
70
- /**
71
- * The `replicaVersion` of the backup. If a subscriber's restored or
72
- * existing replica is of a different version, it should delete it and
73
- * retry the restore from litestream (i.e. equivalent to a
74
- * `WrongReplicaVersion` response from a `/changes` subscription).
75
- */
76
- replicaVersion: v.Type<string>;
77
- /**
78
- * The earliest watermark from which catchup is possible. If the
79
- * subscriber's replica is older that this watermark, it should delete it
80
- * and (retry the) restore from litestream (i.e. equivalent to a
81
- * `WatermarkTooOld` response from a `/changes` subscription).
82
- */
83
- minWatermark: v.Type<string>;
84
- /**
85
- * The size in bytes of the replication-manager's replica when the snapshot
86
- * was reserved, used as an estimate of the size of the restored replica
87
- * when reporting restore progress. Absent from older replication-managers.
88
- */
89
- replicaSize: v.Optional<number>;
90
- }, undefined>]>]>;
91
- export type SnapshotMessage = v.Infer<typeof statusMessageSchema>;
92
- //# sourceMappingURL=snapshot-message.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"snapshot-message.d.ts","sourceRoot":"","sources":["../../../../../../zero-cache/src/services/change-streamer/snapshot-message.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,CAAC,MAAM,kCAAkC,CAAC;AAEtD,eAAO,MAAM,YAAY;;IAGvB;;OAEG;;IAGH;;;;;OAKG;;IAGH;;;;;OAKG;;IAGH;;;;OAIG;;aAEH,CAAC;AAEH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AAE1D,eAAO,MAAM,mBAAmB;;IA/B9B;;OAEG;;IAGH;;;;;OAKG;;IAGH;;;;;OAKG;;IAGH;;;;OAIG;;eAM0E,CAAC;AAEhF,eAAO,MAAM,qBAAqB;;IAjChC;;OAEG;;IAGH;;;;;OAKG;;IAGH;;;;;OAKG;;IAGH;;;;OAIG;;iBAQ4D,CAAC;AAElE,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC"}
@@ -1,36 +0,0 @@
1
- import type { LogContext } from '@rocicorp/logger';
2
- import type { Source } from '../../types/streams.ts';
3
- import type { BackupConfig } from './change-streamer-service.ts';
4
- import type { SnapshotMessage } from './snapshot-message.ts';
5
- import type { ChangeLogReadSource } from './sqlite-change-log-read-router.ts';
6
- export type ReservationCallbacks = {
7
- /**
8
- * Called whenever a reservation is closed, including when it is replaced
9
- * by a new reservation (e.g. a retry) for the same task.
10
- */
11
- onClose?: ((taskID: string) => void) | undefined;
12
- /**
13
- * Called when a task's reservation is closed without being replaced,
14
- * i.e. when the task no longer holds a reservation.
15
- */
16
- onEnd?: ((taskID: string) => void) | undefined;
17
- };
18
- export declare class SnapshotReservations {
19
- #private;
20
- constructor(lc: LogContext, backupConfig: BackupConfig, callbacks?: ReservationCallbacks);
21
- open(taskID: string): Source<SnapshotMessage>;
22
- close(taskID: string): void;
23
- isCurrent(taskID: string, source: Source<SnapshotMessage>): boolean;
24
- confirmationsRequired(): boolean;
25
- unconfirmedTaskIDs(): string[];
26
- /** Confirms one reservation with the bounds of its pinned read source. */
27
- confirmFor(taskID: string, replicaVersion: string, minWatermark: string, source: ChangeLogReadSource): void;
28
- /**
29
- * Notes that a confirmation was deferred, returning true only the first time
30
- * for this reservation. Confirmation is retried on every backup, so an
31
- * undeduplicated count would measure backups rather than delayed followers.
32
- */
33
- noteConfirmationDelayed(taskID: string): boolean;
34
- getReservedWatermarks(): string[];
35
- }
36
- //# sourceMappingURL=snapshot-reservations.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"snapshot-reservations.d.ts","sourceRoot":"","sources":["../../../../../../zero-cache/src/services/change-streamer/snapshot-reservations.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,kBAAkB,CAAC;AACjD,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,wBAAwB,CAAC;AAOnD,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,8BAA8B,CAAC;AAC/D,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,uBAAuB,CAAC;AAC3D,OAAO,KAAK,EAAC,mBAAmB,EAAC,MAAM,oCAAoC,CAAC;AAE5E,MAAM,MAAM,oBAAoB,GAAG;IACjC;;;OAGG;IACH,OAAO,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;IAEjD;;;OAGG;IACH,KAAK,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;CAChD,CAAC;AAEF,qBAAa,oBAAoB;;IAM/B,YACE,EAAE,EAAE,UAAU,EACd,YAAY,EAAE,YAAY,EAC1B,SAAS,GAAE,oBAAyB,EAKrC;IAED,IAAI,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,eAAe,CAAC,CAU5C;IAED,KAAK,CAAC,MAAM,EAAE,MAAM,QAEnB;IAED,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,eAAe,CAAC,GAAG,OAAO,CAElE;IA6CD,qBAAqB,YAOpB;IAED,kBAAkB,IAAI,MAAM,EAAE,CAI7B;IAED,0EAA0E;IAC1E,UAAU,CACR,MAAM,EAAE,MAAM,EACd,cAAc,EAAE,MAAM,EACtB,YAAY,EAAE,MAAM,EACpB,MAAM,EAAE,mBAAmB,GAC1B,IAAI,CAmBN;IAeD;;;;OAIG;IACH,uBAAuB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAE/C;IAED,qBAAqB,aAKpB;CACF"}
@@ -1,22 +0,0 @@
1
- /**
2
- * The `snapshot` API serves the purpose of:
3
- * - informing subscribers (i.e. view-syncers) of the (litestream)
4
- * backup location from which to restore a replica snapshot
5
- * - checking whether a restored backup or existing replica is
6
- * compatible with the change-streamer
7
- * - preventing change-log cleanup while a snapshot restore is in
8
- * progress
9
- * - tracking the approximate time it takes from the beginning of
10
- * snapshot "reservation" to the subsequent subscription, which
11
- * serves as the minimum interval to wait before cleaning up
12
- * backed up changes.
13
- */
14
- import type { LogContext } from '@rocicorp/logger';
15
- import type { ReservationFollowup, SnapshotReserver } from './change-streamer-http.ts';
16
- import type { LocalReplica, SnapshotStatus } from './subscribe.ts';
17
- export type { SnapshotStatus };
18
- export declare function reserveAndGetSnapshotStatus(lc: LogContext, taskID: string, changeStreamer: SnapshotReserver, localReplica?: LocalReplica | undefined): Promise<{
19
- reserved: SnapshotStatus;
20
- followup: ReservationFollowup;
21
- }>;
22
- //# sourceMappingURL=snapshot.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"snapshot.d.ts","sourceRoot":"","sources":["../../../../../../zero-cache/src/services/change-streamer/snapshot.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,kBAAkB,CAAC;AASjD,OAAO,KAAK,EACV,mBAAmB,EACnB,gBAAgB,EACjB,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAAC,YAAY,EAAE,cAAc,EAAC,MAAM,gBAAgB,CAAC;AAEjE,YAAY,EAAC,cAAc,EAAC,CAAC;AAE7B,wBAAsB,2BAA2B,CAC/C,EAAE,EAAE,UAAU,EACd,MAAM,EAAE,MAAM,EACd,cAAc,EAAE,gBAAgB,EAChC,YAAY,CAAC,EAAE,YAAY,GAAG,SAAS,GACtC,OAAO,CAAC;IAAC,QAAQ,EAAE,cAAc,CAAC;IAAC,QAAQ,EAAE,mBAAmB,CAAA;CAAC,CAAC,CAmDpE"}
@@ -1,99 +0,0 @@
1
- import type { LogContext } from '@rocicorp/logger';
2
- import { sleep } from '../../../../shared/src/sleep.ts';
3
- import type { WatermarkedChange } from './change-streamer.ts';
4
- import type { Forwarder } from './forwarder.ts';
5
- import type { CatchupPlan } from './sqlite-change-log-reader.ts';
6
- import type { Subscriber } from './subscriber.ts';
7
- export interface SQLiteChangeLogCatchupReader {
8
- plan(fromWatermark: string): CatchupPlan;
9
- read(fromWatermark: string, throughWatermark: string, batchSize: number, signal?: AbortSignal): AsyncIterable<readonly WatermarkedChange[]>;
10
- close(): void;
11
- }
12
- /**
13
- * Slice 9 replaces this no-op implementation with a guard that waits for an
14
- * in-flight purge and blocks new purge dispatch while the subscriber's ACK is
15
- * made visible to the Forwarder.
16
- */
17
- export interface SQLiteChangeLogCleanupGuard {
18
- runWhilePurgeBlocked<T>(register: () => T): Promise<T>;
19
- }
20
- export type SQLiteChangeLogCatchupOptions = {
21
- batchSize: number;
22
- barrierTimeoutMs: number;
23
- barrierPollIntervalMs?: number | undefined;
24
- cleanupGuard?: SQLiteChangeLogCleanupGuard | undefined;
25
- sleep?: typeof sleep | undefined;
26
- now?: (() => number) | undefined;
27
- /** Opens slice 11's process-local breaker after registration has committed. */
28
- onFailure?: ((failure: SQLiteChangeLogCatchupFailure) => void) | undefined;
29
- };
30
- export type SQLiteChangeLogCatchupRequest = {
31
- /**
32
- * Whether the routing warm-up gate classified the log as warm *for this
33
- * subscriber*. The coordinator is opened once and reused, so this cannot be
34
- * a property of it: `coldReadPercent` serves some subscribers from a log
35
- * that is still inside its warm-up window, and the catchup metrics have to
36
- * separate those from steady-state serving.
37
- */
38
- readonly logWarm?: boolean | undefined;
39
- };
40
- export type SQLiteChangeLogCatchupFailure = 'barrier-timeout' | 'reader-error';
41
- export type SQLiteChangeLogCatchupRegistration = {
42
- readonly kind: 'registered';
43
- } | {
44
- readonly kind: 'uncovered';
45
- readonly minWatermark: string;
46
- } | {
47
- readonly kind: 'declined';
48
- readonly error: unknown;
49
- } | {
50
- readonly kind: 'handled';
51
- };
52
- /**
53
- * Coordinates a serving subscriber's gap-free transition from replica-local
54
- * SQLite catchup to the Forwarder's live stream.
55
- *
56
- * Registration and required-head capture happen in one synchronous callback.
57
- * The subscriber therefore either sees a transaction in SQLite catchup or in
58
- * its live backlog (duplicates across that boundary are filtered by
59
- * Subscriber), never in neither place.
60
- */
61
- export declare class SQLiteChangeLogCatchup implements Disposable {
62
- #private;
63
- constructor(lc: LogContext, forwarder: Forwarder, reader: SQLiteChangeLogCatchupReader, opts: SQLiteChangeLogCatchupOptions);
64
- /**
65
- * Registers the subscriber before resolving. Catchup itself continues in
66
- * the background so subscribe() does not wait for SQLite to reach the
67
- * required head.
68
- */
69
- catchup(subscriber: Subscriber, captureRequiredHead: () => string | Promise<string>, request?: SQLiteChangeLogCatchupRequest): Promise<SQLiteChangeLogCatchupRegistration>;
70
- /**
71
- * Notes that the change-log writer has committed `watermark`, i.e. that the
72
- * log's head has advanced to it. The writer runs in this process, so this is
73
- * the event itself rather than a subscriber's ACK of it.
74
- *
75
- * It is a wakeup, not an authority: `plan()` still decides what can be read.
76
- * A notification that never arrives costs the barrier a poll interval, and one
77
- * that arrives early costs an extra `plan()` call.
78
- */
79
- onChangeLogCommit(watermark: string): void;
80
- remove(subscriber: Subscriber): void;
81
- close(): void;
82
- [Symbol.dispose](): void;
83
- }
84
- /**
85
- * A barrier that gave up on the replica reaching the required head. Both
86
- * reasons mean "not yet", not "never", so both end the subscription cleanly
87
- * for a retry rather than failing it.
88
- */
89
- export declare class SQLiteChangeLogBarrierError extends Error {
90
- }
91
- /** The replica did not reach the required head before the deadline. */
92
- export declare class SQLiteChangeLogBarrierTimeoutError extends SQLiteChangeLogBarrierError {
93
- readonly name = "SQLiteChangeLogBarrierTimeoutError";
94
- }
95
- /** Waiting any longer would have cost more than reconnecting. */
96
- export declare class SQLiteChangeLogBarrierBacklogError extends SQLiteChangeLogBarrierError {
97
- readonly name = "SQLiteChangeLogBarrierBacklogError";
98
- }
99
- //# sourceMappingURL=sqlite-change-log-catchup.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sqlite-change-log-catchup.d.ts","sourceRoot":"","sources":["../../../../../../zero-cache/src/services/change-streamer/sqlite-change-log-catchup.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,kBAAkB,CAAC;AAGjD,OAAO,EAAC,KAAK,EAAC,MAAM,iCAAiC,CAAC;AAMtD,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,sBAAsB,CAAC;AAE5D,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAC9C,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,+BAA+B,CAAC;AAC/D,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,iBAAiB,CAAC;AAEhD,MAAM,WAAW,4BAA4B;IAC3C,IAAI,CAAC,aAAa,EAAE,MAAM,GAAG,WAAW,CAAC;IACzC,IAAI,CACF,aAAa,EAAE,MAAM,EACrB,gBAAgB,EAAE,MAAM,EACxB,SAAS,EAAE,MAAM,EACjB,MAAM,CAAC,EAAE,WAAW,GACnB,aAAa,CAAC,SAAS,iBAAiB,EAAE,CAAC,CAAC;IAC/C,KAAK,IAAI,IAAI,CAAC;CACf;AAED;;;;GAIG;AACH,MAAM,WAAW,2BAA2B;IAC1C,oBAAoB,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;CACxD;AAQD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MAAM,CAAC,EACnD,OAAO,GAAE,6BAAkC,GAC1C,OAAO,CAAC,kCAAkC,CAAC,CA+D7C;IAED;;;;;;;;OAQG;IACH,iBAAiB,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAOzC;IAED,MAAM,CAAC,UAAU,EAAE,UAAU,GAAG,IAAI,CAInC;IAED,KAAK,IAAI,IAAI,CAWZ;IAED,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,IAAI,CAEvB;CA8TF;AAID;;;;GAIG;AACH,qBAAa,2BAA4B,SAAQ,KAAK;CAAG;AAEzD,uEAAuE;AACvE,qBAAa,kCAAmC,SAAQ,2BAA2B;IACjF,QAAQ,CAAC,IAAI,wCAAwC;CACtD;AAED,iEAAiE;AACjE,qBAAa,kCAAmC,SAAQ,2BAA2B;IACjF,QAAQ,CAAC,IAAI,wCAAwC;CACtD"}
@@ -1,83 +0,0 @@
1
- import type { LogContext } from '@rocicorp/logger';
2
- import type { ShardID } from '../../types/shards.ts';
3
- import { type ChangeLogIdentity } from '../replicator/change-log-db.ts';
4
- import { type ChangeLogEntry } from './change-log-codec.ts';
5
- /**
6
- * Result for one committed transaction.
7
- *
8
- * `mismatch` covers missing, extra, changed, or reordered rows.
9
- * `inconclusive` means that store bounds changed during the comparison.
10
- */
11
- export type CompareOutcome = 'match' | 'mismatch' | 'inconclusive' | 'deferred' | 'oversized';
12
- export type CompareSkipReason = 'stopped' | 'log-rebuilt' | 'log-unavailable' | 'ineligible-schema' | 'ineligible-identity' | 'cold-log' | 'nothing-to-compare' | 'error';
13
- export type CompareCycleResult = {
14
- readonly kind: 'skipped';
15
- readonly reason: CompareSkipReason;
16
- } | {
17
- readonly kind: 'compared';
18
- /** Exclusive lower bound of the compared range. */
19
- readonly fromWatermark: string;
20
- /** Inclusive upper bound handled. The next cycle resumes from here. */
21
- readonly throughWatermark: string;
22
- /** Committed transactions handled through `throughWatermark`. */
23
- readonly transactions: number;
24
- /** Transactions with compared catchup output. */
25
- readonly sampled: number;
26
- readonly matched: number;
27
- readonly mismatched: number;
28
- /** Suspects rejected because store bounds changed. */
29
- readonly inconclusive: number;
30
- /** Sampled transactions deferred to a fresh budget. */
31
- readonly deferred: number;
32
- /** Sampled transactions that exceed a fresh budget. */
33
- readonly oversized: number;
34
- };
35
- /** Provides the Postgres side of the catchup comparison. */
36
- export interface PGChangeLogRangeReader {
37
- getCatchupBounds(): Promise<{
38
- minWatermark: string | null;
39
- lastWatermark: string;
40
- }>;
41
- listCommitWatermarks(afterWatermark: string, throughWatermark: string, limit: number): Promise<string[]>;
42
- readCatchupRange(afterWatermark: string, throughWatermark: string, batchRows?: number | undefined): AsyncIterable<ChangeLogEntry[]>;
43
- }
44
- export type SQLiteChangeLogCompareOptions = {
45
- /** Stable percentage of transactions selected for payload comparison. */
46
- readonly comparePercent: number;
47
- /** Warm-up time after a seed. The comparator skips a younger log. */
48
- readonly retentionMs: number;
49
- readonly intervalMs?: number | undefined;
50
- readonly maxTransactionsPerCycle?: number | undefined;
51
- /** Maximum catchup rows read from each store in one cycle. */
52
- readonly maxRowsPerSourcePerCycle?: number | undefined;
53
- /** Maximum catchup bytes read from each store in one cycle. */
54
- readonly maxBytesPerSourcePerCycle?: number | undefined;
55
- readonly readBatchRows?: number | undefined;
56
- /** Clock for the warm-up period. Defaults to `Date.now`. */
57
- readonly now?: (() => number) | undefined;
58
- readonly setTimeoutFn?: typeof setTimeout | undefined;
59
- readonly clearTimeoutFn?: typeof clearTimeout | undefined;
60
- /** Yields between sampled transactions. Defaults to `setImmediate`. */
61
- readonly yieldFn?: (() => Promise<void>) | undefined;
62
- };
63
- /**
64
- * Compares SQLite and Postgres catchup output without affecting subscribers.
65
- *
66
- * Each cycle compares complete ranges through the lower store head.
67
- * It checks every transaction for presence and samples payloads.
68
- * A bounds change makes the affected result `inconclusive`.
69
- * Postgres remains authoritative.
70
- */
71
- export declare class SQLiteChangeLogComparator {
72
- #private;
73
- constructor(lc: LogContext, shard: ShardID, changeLogFile: string, identity: ChangeLogIdentity, pg: PGChangeLogRangeReader, opts: SQLiteChangeLogCompareOptions);
74
- /**
75
- * Runs one cycle. Concurrent calls share the same promise.
76
- * Errors produce `skipped: 'error'`.
77
- */
78
- compareOnce(): Promise<CompareCycleResult>;
79
- stop(): void;
80
- /** Invalidates cycles that can still read a replaced file. */
81
- invalidate(): void;
82
- }
83
- //# sourceMappingURL=sqlite-change-log-comparator.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sqlite-change-log-comparator.d.ts","sourceRoot":"","sources":["../../../../../../zero-cache/src/services/change-streamer/sqlite-change-log-comparator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,kBAAkB,CAAC;AAMjD,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAIL,KAAK,iBAAiB,EAEvB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAEL,KAAK,cAAc,EACpB,MAAM,uBAAuB,CAAC;AA8B/B;;;;;GAKG;AACH,MAAM,MAAM,cAAc,GACtB,OAAO,GACP,UAAU,GACV,cAAc,GACd,UAAU,GACV,WAAW,CAAC;AAEhB,MAAM,MAAM,iBAAiB,GAEzB,SAAS,GAET,aAAa,GAEb,iBAAiB,GAEjB,mBAAmB,GAEnB,qBAAqB,GAErB,UAAU,GAEV,oBAAoB,GAEpB,OAAO,CAAC;AAEZ,MAAM,MAAM,kBAAkB,GAC1B;IAAC,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,iBAAiB,CAAA;CAAC,GAC9D;IACE,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAC1B,mDAAmD;IACnD,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,uEAAuE;IACvE,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAClC,iEAAiE;IACjE,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,i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