@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,205 +0,0 @@
1
- import type { Enum } from '../../../../shared/src/enum.ts';
2
- import type { Subscription } from '../../types/subscription.ts';
3
- import type { ReplicatorMode } from '../replicator/replicator.ts';
4
- import type { BackfillState } from './backfill-state.ts';
5
- import type { PreSerializedBatch } from './broadcast.ts';
6
- import type { ChangeTag, Status, WatermarkedChange } from './change-streamer.ts';
7
- import type * as ErrorType from './error-type-enum.ts';
8
- type ErrorType = Enum<typeof ErrorType>;
9
- export type SubscriberOptions = {
10
- backlogHighWaterBytes?: number | undefined;
11
- backlogLowWaterRatio?: number | undefined;
12
- wsBatched?: boolean | undefined;
13
- /**
14
- * Called whenever the subscriber's acked watermark advances, i.e. when it
15
- * has confirmed that a commit was durably applied to its replica. The ACK
16
- * therefore lags the subscriber's replica rather than leading it.
17
- */
18
- onAck?: ((watermark: string) => void) | undefined;
19
- /**
20
- * The subscriber's pending backfills (protocol v8+), which are tracked
21
- * over the changes sent to the subscriber.
22
- */
23
- backfills?: BackfillState | undefined;
24
- /**
25
- * Called once the subscriber has been sent all changes up to the head of
26
- * the stream, i.e. its catchup and backlog have been flushed. From this
27
- * point on, the subscriber's tracked {@link backfills} reflect the same
28
- * position in the stream as that of the change-streamer.
29
- */
30
- onAligned?: ((subscriber: Subscriber) => void) | undefined;
31
- /**
32
- * Called when a `backfill` or `backfill-completed` message is ignored for
33
- * some of the subscriber's pending backfill columns, after the subscriber
34
- * is aligned.
35
- */
36
- onBackfillIgnored?: ((columns: string[]) => void) | undefined;
37
- /**
38
- * Resolves, once it is known whether lag reporting is enabled upstream, to
39
- * the means of requesting a lag report, or to `undefined` if it is disabled.
40
- *
41
- * Subscribers use lag reports to determine that they are caught up (e.g. to
42
- * advertise readiness to serve traffic). Once the subscriber is aligned, a
43
- * report is therefore requested, so that it is received without waiting out
44
- * the report interval. If lag reporting is disabled, a
45
- * {@link LAG_REPORTING_DISABLED} status is sent as a stand-in instead.
46
- */
47
- lagReports?: Promise<LagReports | undefined> | undefined;
48
- /**
49
- * Whether the subscriber switches over to another replication-manager
50
- * when this one drains (see `DrainTracker`).
51
- */
52
- drainable?: boolean | undefined;
53
- };
54
- export type BacklogFullWait = {
55
- readonly promise: Promise<void>;
56
- cancel(): void;
57
- };
58
- export type SubscriberStats = {
59
- processRate: number;
60
- pending: number;
61
- backlog: number;
62
- backlogBytes: number;
63
- totalBufferedBytes: number;
64
- missedLastTimeout: boolean;
65
- };
66
- /**
67
- * Encapsulates a subscriber to changes. All subscribers start in a
68
- * "catchup" phase in which changes are buffered in a backlog while the
69
- * storer is queried to send any changes that were committed since the
70
- * subscriber's watermark. Once the catchup is complete, calls to
71
- * {@link send()} result in immediately sending the change.
72
- */
73
- export declare class Subscriber {
74
- #private;
75
- readonly id: string;
76
- readonly mode: ReplicatorMode;
77
- readonly drainable: boolean;
78
- constructor(protocolVersion: number, id: string, mode: ReplicatorMode, watermark: string, downstream: Subscription<string | PreSerializedBatch>, options?: SubscriberOptions);
79
- /**
80
- * The subscriber's tracked pending backfills, or `undefined` if the
81
- * subscriber does not report them (i.e. protocol < v8).
82
- */
83
- get backfills(): BackfillState | undefined;
84
- /**
85
- * Whether the subscriber has been sent all changes up to the head of the
86
- * stream (see {@link SubscriberOptions.onAligned}).
87
- */
88
- get aligned(): boolean;
89
- /**
90
- * Resolves once the subscriber has caught up, i.e. once it has acked
91
- * (durably applied) all changes up to the head of the stream at the time
92
- * it was {@link aligned}. Never resolves if the subscriber is closed first.
93
- */
94
- get caughtUp(): Promise<void>;
95
- get watermark(): string;
96
- get acked(): string;
97
- /**
98
- * Whether the backlog of live changes buffered during catchup has reached the
99
- * point at which {@link send()} stops resolving. Past it the subscriber is no
100
- * longer free: it holds up every subsequent flush, and with no other
101
- * subscriber to form a majority it stalls replication outright.
102
- */
103
- get backlogFull(): boolean;
104
- /**
105
- * @returns whether the subscriber is currently sending backlogged messages,
106
- * vs caught up and sending the "head" of the replication stream.
107
- */
108
- isBacklogged(): boolean;
109
- /**
110
- * Resolves the first time {@link backlogFull} becomes true, so that a caller
111
- * holding the subscriber in catchup can give up at the moment the subscriber
112
- * starts costing replication rather than on a timer. Call cancel() when the
113
- * wait is no longer needed so the subscriber does not retain it.
114
- */
115
- whenBacklogFull(): BacklogFullWait;
116
- send(change: WatermarkedChange): Promise<void>;
117
- sendBatch(changes: readonly WatermarkedChange[], preSerialized?: PreSerializedBatch | undefined): Promise<void>;
118
- /**
119
- * Sends a status message (e.g. a lag report) downstream. While the
120
- * subscriber is catching up, the status is queued in the backlog behind
121
- * the changes that preceded it in the replication stream, so that the
122
- * subscriber processes it in stream order. This is necessary for lag
123
- * reports to measure the lag of the subscriber, including its catchup.
124
- *
125
- * Status messages received before the subscriber is initialized are
126
- * dropped.
127
- */
128
- sendStatus(status: Status): void;
129
- /**
130
- * Sends a control status (e.g. `draining` or `restore`) downstream
131
- * immediately, regardless of whether the subscriber is initialized or
132
- * catching up. Unlike {@link sendStatus}, such statuses are not tied to a
133
- * position in the replication stream.
134
- */
135
- sendControlStatus(status: Status): void;
136
- /** catchup() is called on ChangeEntries loaded from the store. */
137
- catchup(change: WatermarkedChange): Promise<void>;
138
- /**
139
- * Marks the Subscribe as "caught up" and flushes any backlog of
140
- * entries that were received during the catchup.
141
- */
142
- setCaughtUp(): Promise<void>;
143
- /**
144
- * The number of downstream messages that have yet to be acked.
145
- */
146
- get numPending(): number;
147
- /**
148
- * The total number of downstream messages that the subscriber has
149
- * processed (i.e. acked).
150
- */
151
- get numProcessed(): number;
152
- /**
153
- * Records a new history entry for the number of messages processed,
154
- * keeping the number of samples bounded to `maxSamples`.
155
- */
156
- sampleProcessRate(now: number, maxSamples?: number): this;
157
- getStats(): SubscriberStats;
158
- trackResponseResult(result: 'on-time' | 'timed-out'): void;
159
- /**
160
- * Reports the change rate of a slow subscriber (i.e. that missed the last
161
- * timeout) compared to the change rate of the (slowest) subscriber that
162
- * responded on time.
163
- *
164
- * * `lagging` indicates that this subscriber is slower
165
- * * `catching-up` indicates that it is faster
166
- *
167
- * Returns the total duration in which subscriber has been continuously
168
- * reported as `lagging`.
169
- */
170
- reportChangeRate(now: number, status: 'lagging' | 'catching-up'): number;
171
- supportsMessage(tag: ChangeTag): boolean;
172
- /**
173
- * Ends the subscription without sending a downstream `['error', ...]`.
174
- *
175
- * This is deliberate, and not the same as reporting the failure to the
176
- * subscriber: `IncrementalSyncer` treats any `['error', ...]` as terminal and
177
- * shuts down to restore a fresh replica from litestream, whereas a clean end
178
- * backs off and re-subscribes. The failures routed here -- storer catchup
179
- * errors, backlog drain errors, backup-monitor errors -- are transient, so a
180
- * reconnect is the proportionate response and a fleet-wide restore is not.
181
- *
182
- * Callers are responsible for logging `err`; it is not carried downstream.
183
- */
184
- fail(_err?: unknown): void;
185
- close(error?: ErrorType, message?: string, details?: {
186
- replicaVersion?: string | undefined;
187
- }): void;
188
- }
189
- /** Requests lag reports from upstream (see {@link SubscriberOptions.lagReports}). */
190
- export type LagReports = {
191
- /**
192
- * Requests that a lag report be sent now rather than at the next report
193
- * interval. Requests are coalesced upstream, e.g. with a report in flight.
194
- */
195
- request(): void;
196
- };
197
- /**
198
- * Sent to an aligned subscriber when lag reporting is disabled upstream,
199
- * signaling that the subscriber is caught up. This is a lag report with a
200
- * `nextSendTimeMs` of 0 and no `lastTimings`, so that no lag is measured
201
- * (see `isLagReportingDisabledSignal()` in the replicator's recorder).
202
- */
203
- export declare const LAG_REPORTING_DISABLED: Status;
204
- export {};
205
- //# sourceMappingURL=subscriber.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"subscriber.d.ts","sourceRoot":"","sources":["../../../../../../zero-cache/src/services/change-streamer/subscriber.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,gCAAgC,CAAC;AAKzD,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,6BAA6B,CAAC;AAC9D,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,6BAA6B,CAAC;AAChE,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,qBAAqB,CAAC;AACvD,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,gBAAgB,CAAC;AACvD,OAAO,KAAK,EACV,SAAS,EAET,MAAM,EACN,iBAAiB,EAClB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,KAAK,SAAS,MAAM,sBAAsB,CAAC;A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U,SAAK,GAAG,IAAI,CAMpD;IAED,QAAQ,IAAI,eAAe,CAyB1B;IAKD,mBAAmB,CAAC,MAAM,EAAE,SAAS,GAAG,WAAW,QAKlD;IAED;;;;;;;;;;OAUG;IACH,gBAAgB,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,GAAG,aAAa,UAW9D;IAED,eAAe,CAAC,GAAG,EAAE,SAAS,WAO7B;IAED;;;;;;;;;;;OAWG;IACH,IAAI,CAAC,IAAI,CAAC,EAAE,OAAO,QAElB;IAED,KAAK,CACH,KAAK,CAAC,EAAE,SAAS,EACjB,OAAO,CAAC,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE;QAAC,cAAc,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;KAAC,QAoBhD;CA6GF;AA4CD,qFAAqF;AACrF,MAAM,MAAM,UAAU,GAAG;IACvB;;;OAGG;IACH,OAAO,IAAI,IAAI,CAAC;CACjB,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,EAAE,MAGpC,CAAC"}
@@ -1,52 +0,0 @@
1
- import type { Sink } from '../../types/streams.ts';
2
- import type { ChangeSourceUpstream, ChangeStreamMessage } from '../change-source/protocol/current.ts';
3
- type Opts = {
4
- trackPgChangeLog: boolean;
5
- trackBackup: boolean;
6
- };
7
- /**
8
- * Tracks the progress (watermark) of multiple streams:
9
- * - downstream transactions and status messages (the latter
10
- * indicating LSNs that are not relevant to the publication
11
- * but nevertheless need to be ACKed)
12
- * - PG change-log commits
13
- * - backup watermarks
14
- *
15
- * and sends upstream ACKs accordingly. When both the PG change-log
16
- * and backup watermarks are being considered for upstream ACKs
17
- * (i.e. RMv1.5), only watermarks that have been reached by both
18
- * stores are acked.
19
- *
20
- * The UpstreamAcker also takes into account that an upstream
21
- * connection can be disconnected and {@link reset()}. In this case,
22
- * the progress of the persistent stores is retained and the acks
23
- * are resent on the new upstream connection as necessary.
24
- */
25
- export declare class UpstreamAcker {
26
- #private;
27
- constructor({ trackPgChangeLog, trackBackup }: Opts);
28
- /**
29
- * Starts tracking a new upstream connection, which resumes the change stream
30
- * after `resumeWatermark`.
31
- *
32
- * Everything at or before `resumeWatermark` was committed on an earlier
33
- * connection, so it counts as committed on this one: a status watermark past
34
- * it waits for the tracked stores to reach it, as it would for a commit on
35
- * this connection. Otherwise the first keepalive of a stream that resumes
36
- * ahead of the stores -- a change log ahead of its backup, which is the
37
- * normal state -- would move the replication slot past transactions that the
38
- * backup has not persisted, and a task restored from the backup would then
39
- * resume below the slot, which the upstream moves forward without a word.
40
- *
41
- * When the PG change log is tracked, the stream resumes from its head, so
42
- * `resumeWatermark` has been persisted in it (by this or another
43
- * change-streamer). Without this, status messages would not be acked on an
44
- * idle upstream until a commit is stored.
45
- */
46
- reset(upstream: Sink<ChangeSourceUpstream>, resumeWatermark: string): void;
47
- trackDownstream(downstream: ChangeStreamMessage): void;
48
- trackPgChangeLog(committedWatermark: string): void;
49
- trackBackup(backedUpWatermark: string): void;
50
- }
51
- export {};
52
- //# sourceMappingURL=upstream-acker.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"upstream-acker.d.ts","sourceRoot":"","sources":["../../../../../../zero-cache/src/services/change-streamer/upstream-acker.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,wBAAwB,CAAC;AACjD,OAAO,KAAK,EACV,oBAAoB,EACpB,mBAAmB,EACpB,MAAM,sCAAsC,CAAC;AAE9C,KAAK,IAAI,GAAG;IACV,gBAAgB,EAAE,OAAO,CAAC;IAC1B,WAAW,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF;;;;;;;;;;;;;;;;;GAiBG;AACH,qBAAa,aAAa;;IAYxB,YAAY,EAAC,gBAAgB,EAAE,WAAW,EAAC,EAAE,IAAI,EAOhD;IAED;;;;;;;;;;;;;;;;;OAiBG;IACH,KAAK,CAAC,QAAQ,EAAE,IAAI,CAAC,oBAAoB,CAAC,EAAE,eAAe,EAAE,MAAM,QAalE;IAED,eAAe,CAAC,UAAU,EAAE,mBAAmB,QAe9C;IAED,gBAAgB,CAAC,kBAAkB,EAAE,MAAM,QAO1C;IAED,WAAW,CAAC,iBAAiB,EAAE,MAAM,QAIpC;CA2BF"}
@@ -1,57 +0,0 @@
1
- type Window = {
2
- start: number;
3
- count: number;
4
- };
5
- /**
6
- * The limiter is a sliding window rate limiter that allows a maximum
7
- * number of mutations per window.
8
- *
9
- * The window is divided into two parts: the prev window and the next window.
10
- * The prev window is the part of the window that has already passed, and the
11
- * next window is the part of the window that is still in the future.
12
- *
13
- * The limiter keeps track of the number of mutations in each window. When the
14
- * current time moves completely past the next window, the limiter creates new
15
- * windows (this only happens if the limiter is not called for a long time).
16
- * When the current time moves completely into the next window, the
17
- * limiter rotates the windows.
18
- *
19
- * Case 1: need new windows
20
- * |----|----|
21
- * |----| (sliding window)
22
- *
23
- * Case 2: rotate windows
24
- * |----|----|
25
- * |----| (sliding window)
26
- *
27
- * or
28
- *
29
- * |----|----|
30
- * |----| (sliding window)
31
- *
32
- * The leading edge of the sliding window is current time.
33
- *
34
- * The limiter increments the count for the prev window if the current time is
35
- * in the prior window. Otherwise, it increments the count for the next
36
- * window.
37
- *
38
- * The limiter computes the total mutations by: taking the number of mutation in the next window and
39
- * adding the number of mutation from the prev window, weighted by
40
- * the fraction of the window that has passed. The total mutations must be less
41
- * than the maximum number of mutations allowed per window.
42
- *
43
- * |----|----|
44
- * |----| (sliding window)
45
- * ^-- the sliding window covers 25% of the prior window. Only 25% of that window's count counts.
46
- * The entirety of the next window's count counts.
47
- */
48
- export declare class SlidingWindowLimiter {
49
- #private;
50
- constructor(windowSizeMs: number, maxMutations: number);
51
- canDo(): boolean;
52
- totalCallsForTime(now: number): number;
53
- get priorWindow(): Window;
54
- get nextWindow(): Window;
55
- }
56
- export {};
57
- //# sourceMappingURL=sliding-window-limiter.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sliding-window-limiter.d.ts","sourceRoot":"","sources":["../../../../../../zero-cache/src/services/limiter/sliding-window-limiter.ts"],"names":[],"mappings":"AAEA,KAAK,MAAM,GAAG;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,qBAAa,oBAAoB;;IAO/B,YAAY,YAAY,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAKrD;IAED,KAAK,IAAI,OAAO,CAoCf;IAED,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAqBrC;IAED,IAAI,WAAW,IAAI,MAAM,CAExB;IAED,IAAI,UAAU,IAAI,MAAM,CAEvB;CA4BF"}
@@ -1,77 +0,0 @@
1
- import type { ChildProcess } from 'node:child_process';
2
- import type { LogContext } from '@rocicorp/logger';
3
- import { type LitestreamConfig } from '../../config/normalize.ts';
4
- import { type LitestreamRole } from './metrics.ts';
5
- export type ReplicaConstraints = {
6
- replicaVersion: string;
7
- minWatermark: string;
8
- };
9
- export type RestoreResult = 'success' | 'no_backup' | 'invalid_replica' | 'error';
10
- export type RestoreAttempt = {
11
- restored: boolean;
12
- backupURL: string | undefined;
13
- result: RestoreResult;
14
- /**
15
- * Set when the restore forked the backup (see {@link ForkBackup}), which
16
- * then continues from the restored replica's WAL. The WAL is kept when the
17
- * last connection closes (see `Database.persistWal()`).
18
- */
19
- forked?: boolean | undefined;
20
- };
21
- /**
22
- * Prepares the restored replica to continue from a forked backup
23
- * instead of starting a new lineage with a full snapshot.
24
- */
25
- export type ForkBackup = {
26
- /** The restore also forks its backup into the (new, empty) one at this URL. */
27
- url: string;
28
- };
29
- export declare class BackupNotFoundException extends Error {
30
- static readonly name = "BackupNotFoundException";
31
- constructor(backupURL: string | undefined);
32
- }
33
- /**
34
- * The effective backup URL: the `backupURLOverride` if present (i.e. a
35
- * lineage-specific location computed by the replication-manager), or
36
- * otherwise the configured `backupURL`.
37
- */
38
- export declare function backupDestinationURL(config: Pick<LitestreamConfig, 'backupURL' | 'backupURLOverride'>): string | undefined;
39
- export declare function tryRestore(lc: LogContext, config: LitestreamConfig, replicaFile: string, replicaConstraints: ReplicaConstraints | undefined, role: LitestreamRole, signal?: AbortSignal, forkBackup?: ForkBackup | undefined): Promise<RestoreAttempt>;
40
- /**
41
- * Deletes litestream's local state for `replicaFile` (its default meta
42
- * directory, `.<file>-litestream`).
43
- */
44
- export declare function deleteLitestreamMetaDir(replicaFile: string): void;
45
- /**
46
- * Returns the replica version and watermark of the local replica file, or
47
- * `undefined` if it does not exist or cannot be read.
48
- */
49
- export declare function readLocalReplica(lc: LogContext, replica: string): {
50
- replicaVersion: string;
51
- watermark: string;
52
- } | undefined;
53
- export declare function startReplicaBackupProcess(lc: LogContext, config: LitestreamConfig, replicaFile: string): ChildProcess;
54
- /**
55
- * Returns the time of the most recent object (snapshot or WAL segment)
56
- * actually uploaded to the backup replica destination, as listed by the
57
- * bundled litestream CLI (`litestream snapshots` / `litestream wal`).
58
- *
59
- * This queries the replica destination (e.g. S3) directly, and thus serves
60
- * as a source of truth for backup durability. This is in contrast to the
61
- * `litestream_replica_progress` metric, which is exported when litestream
62
- * *believes* an upload has succeeded, and has been observed to advance even
63
- * when nothing is actually written to the destination.
64
- *
65
- * Rejects if the backup state cannot be determined (spawn error, non-zero
66
- * exit, timeout, or empty/unparseable listing).
67
- */
68
- export declare function getLastBackupTime(lc: LogContext, config: LitestreamConfig, replicaFile: string): Promise<Date>;
69
- /**
70
- * Parses the `created` column (the last, RFC3339-formatted column) from the
71
- * tab-formatted output of `litestream snapshots` / `litestream wal`. The
72
- * header row and any unparseable lines are skipped.
73
- *
74
- * Exported for testing.
75
- */
76
- export declare function parseBackupCreatedTimes(lc: LogContext, command: 'snapshots' | 'wal', output: string): Date[];
77
- //# sourceMappingURL=commands.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../../../../../zero-cache/src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U,CAAC,EAAE,UAAU,GAAG,SAAS,GAClC,OAAO,CAAC,cAAc,CAAC,CA2BzB;AAsND;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,WAAW,EAAE,MAAM,QAK1D;AAwDD;;;GAGG;AACH,wBAAgB,gBAAgB,CAC9B,EAAE,EAAE,UAAU,EACd,OAAO,EAAE,MAAM,GACd;IAAC,cAAc,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAC,GAAG,SAAS,CAiBzD;AAqDD,wBAAgB,yBAAyB,CACvC,EAAE,EAAE,UAAU,EACd,MAAM,EAAE,gBAAgB,EACxB,WAAW,EAAE,MAAM,GAClB,YAAY,CAuCd;AAQD;;;;;;;;;;;;;GAaG;AACH,wBAAsB,iBAAiB,CACrC,EAAE,EAAE,UAAU,EACd,MAAM,EAAE,gBAAgB,EACxB,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,IAAI,CAAC,CAgBf;AA8DD;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CACrC,EAAE,EAAE,UAAU,EACd,OAAO,EAAE,WAAW,GAAG,KAAK,EAC5B,MAAM,EAAE,MAAM,GACb,IAAI,EAAE,CAoBR"}
@@ -1,78 +0,0 @@
1
- import type { LogContext } from '@rocicorp/logger';
2
- /**
3
- * Path of the litestream control socket, derived from the replica file's
4
- * directory. The socket must live on a filesystem the (non-root) runtime user
5
- * can write — the replica directory is guaranteed writable since litestream
6
- * writes the replica there — so it must NOT default to a root-owned location
7
- * like /var/run. Kept in sync with config-v5.yml's `socket.path`, which is set
8
- * from `ZERO_LITESTREAM_SOCKET_PATH` (see getLitestream() in commands.ts).
9
- */
10
- export declare function litestreamSocketPath(replicaFile: string): string;
11
- /** Response body from litestream's `POST /sync` control endpoint. */
12
- export type SyncResponse = {
13
- /**
14
- * `synced` when `wait` was true and the upload completed, `synced_local`
15
- * when the WAL was sealed locally without waiting on the remote replica, or
16
- * `no_change` when there was nothing to sync.
17
- */
18
- status: 'synced' | 'synced_local' | 'no_change';
19
- path: string;
20
- txid: number;
21
- replicated_txid: number;
22
- };
23
- export type SyncOptions = {
24
- /**
25
- * When true, block until the sealed WAL has been uploaded to the remote
26
- * replica (litestream's SyncAndWait). When false (the default), litestream
27
- * only seals the WAL into local LTX files and runs its checkpoint thresholds,
28
- * returning without waiting on the backup store. Use false on the write path
29
- * where the goal is to keep the WAL small, not to durably back it up.
30
- */
31
- wait?: boolean | undefined;
32
- /** Overall request timeout in milliseconds. Defaults to 30s. */
33
- timeoutMs?: number | undefined;
34
- /**
35
- * Server-side deadline in seconds, sent as litestream's `timeout`. When set,
36
- * litestream ends the request itself (with an error response) once it
37
- * elapses. Set it below {@link timeoutMs} so that litestream, rather than
38
- * the client, ends a slow request. (litestream defaults to 30s when `wait`
39
- * is set, and to no deadline otherwise.)
40
- */
41
- serverTimeoutSeconds?: number | undefined;
42
- };
43
- /**
44
- * IPC client for the litestream control server. litestream serves an HTTP API
45
- * over a Unix domain socket (enabled via the `socket:` block in config-v5.yml);
46
- * because zero-cache runs litestream as a subprocess in the same container, the
47
- * socket is reachable directly on the local filesystem.
48
- *
49
- * A single keep-alive connection is held open and reused across calls, so a
50
- * high-frequency caller (e.g. write-path backpressure) does not pay a
51
- * connect/handshake per request.
52
- */
53
- export declare class LitestreamController {
54
- #private;
55
- /**
56
- * @param replicaFile Path of the replica database litestream is managing —
57
- * the same value passed to litestream as `ZERO_REPLICA_FILE`. This is the
58
- * `path` litestream matches control requests against.
59
- * @param socketPath Path of the control socket; defaults to the path derived
60
- * from `replicaFile`, matching config-v5.yml's `socket.path`.
61
- */
62
- constructor(lc: LogContext, replicaFile: string, socketPath?: string);
63
- /**
64
- * Forces litestream to sync the WAL into LTX files immediately and run its
65
- * checkpoint thresholds, instead of waiting for the next monitor-interval
66
- * tick. The checkpoint itself is still litestream's usual (non-blocking)
67
- * PASSIVE attempt, so it is skipped if the database is busy — call this once
68
- * writes are quiesced.
69
- *
70
- * Best-effort: callers should tolerate rejection (e.g. ECONNREFUSED/ENOENT
71
- * while litestream is restarting or before it has created the socket) rather
72
- * than blocking application progress on it.
73
- */
74
- sync(opts?: SyncOptions, signal?: AbortSignal): Promise<SyncResponse>;
75
- /** Releases the pooled keep-alive connection. */
76
- close(): void;
77
- }
78
- //# sourceMappingURL=litestream-controller.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"litestream-controller.d.ts","sourceRoot":"","sources":["../../../../../../zero-cache/src/services/litestream/litestream-controller.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,kBAAkB,CAAC;AAEjD;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAEhE;AAID,qEAAqE;AACrE,MAAM,MAAM,YAAY,GAAG;IACzB;;;;OAIG;IACH,MAAM,EAAE,QAAQ,GAAG,cAAc,GAAG,WAAW,CAAC;IAChD,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,eAAe,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACxB;;;;;;OAMG;IACH,IAAI,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAE3B,gEAAgE;IAChE,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAE/B;;;;;;OAMG;IACH,oBAAoB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC3C,CAAC;AAEF;;;;;;;;;GASG;AACH,qBAAa,oBAAoB;;IAM/B;;;;;;OAMG;IACH,YACE,EAAE,EAAE,UAAU,EACd,WAAW,EAAE,MAAM,EACnB,UAAU,SAAoC,EAQ/C;IAED;;;;;;;;;;OAUG;IACG,IAAI,CACR,IAAI,GAAE,WAAgB,EACtB,MAAM,CAAC,EAAE,WAAW,GACnB,OAAO,CAAC,YAAY,CAAC,CAkBvB;IAED,iDAAiD;IACjD,KAAK,IAAI,IAAI,CAEZ;CA4DF"}
@@ -1,31 +0,0 @@
1
- import type { LitestreamConfig } from '../../config/normalize.ts';
2
- export type LitestreamRole = 'replication_manager' | 'view_syncer';
3
- export type LitestreamVersion = 'legacy' | 'v5';
4
- export type LitestreamMetricAttrs = {
5
- role: LitestreamRole;
6
- backup_scheme: string;
7
- litestream: LitestreamVersion;
8
- };
9
- type LitestreamMultipartMetricAttrs = {
10
- multipart_concurrency: number;
11
- multipart_size_mib: number;
12
- };
13
- export declare function litestreamRestoreMetricAttrs(config: LitestreamConfig, role: LitestreamRole, backupURL?: string | undefined): LitestreamMetricAttrs & LitestreamMultipartMetricAttrs;
14
- export declare function litestreamBackupMetricAttrs(config: LitestreamConfig): LitestreamMetricAttrs;
15
- export declare function litestreamBackupProcessMetricAttrs(config: LitestreamConfig): LitestreamMetricAttrs & LitestreamMultipartMetricAttrs;
16
- export declare function litestreamMonitorMetricAttrs(backupURL: string, litestream: LitestreamVersion, role: LitestreamRole): LitestreamMetricAttrs;
17
- export declare function litestreamRestoreRuns(): import("@opentelemetry/api").Counter<import("@opentelemetry/api").Attributes>;
18
- export declare function litestreamRestoreAttempts(): import("@opentelemetry/api").Counter<import("@opentelemetry/api").Attributes>;
19
- export declare function litestreamRestoredDbBytes(): import("@opentelemetry/api").Counter<import("@opentelemetry/api").Attributes>;
20
- export declare function litestreamBackupProcessRuns(): import("@opentelemetry/api").Counter<import("@opentelemetry/api").Attributes>;
21
- export declare function litestreamRestoreDuration(): import("../../observability/metrics.ts").LatencyHistogram;
22
- export declare function litestreamRestoreWaitDuration(): import("../../observability/metrics.ts").LatencyHistogram;
23
- export declare function litestreamRestoreProcessDuration(): import("../../observability/metrics.ts").LatencyHistogram;
24
- export declare function litestreamRestoreValidationDuration(): import("../../observability/metrics.ts").LatencyHistogram;
25
- export declare function litestreamBackupProcessDuration(): import("../../observability/metrics.ts").LatencyHistogram;
26
- export declare function litestreamBackupListDuration(): import("../../observability/metrics.ts").LatencyHistogram;
27
- export declare function litestreamBackupVerificationDuration(): import("../../observability/metrics.ts").LatencyHistogram;
28
- export declare function litestreamSnapshotReservationDuration(): import("../../observability/metrics.ts").LatencyHistogram;
29
- export declare function litestreamSnapshotReservationConfirmDuration(): import("../../observability/metrics.ts").LatencyHistogram;
30
- export {};
31
- //# sourceMappingURL=metrics.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"metrics.d.ts","sourceRoot":"","sources":["../../../../../../zero-cache/src/services/litestream/metrics.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,2BAA2B,CAAC;AAOhE,MAAM,MAAM,cAAc,GAAG,qBAAqB,GAAG,aAAa,CAAC;AACnE,MAAM,MAAM,iBAAiB,GAAG,QAAQ,GAAG,IAAI,CAAC;AAEhD,MAAM,MAAM,qBAAqB,GAAG;IAClC,IAAI,EAAE,cAAc,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,iBAAiB,CAAC;CAC/B,CAAC;AAEF,KAAK,8BAA8B,GAAG;IACpC,qBAAqB,EAAE,MAAM,CAAC;IAC9B,kBAAkB,EAAE,MAAM,CAAC;CAC5B,CAAC;AAEF,wBAAgB,4BAA4B,CAC1C,MAAM,EAAE,gBAAgB,EACxB,IAAI,EAAE,cAAc,EACpB,SAAS,qBAAmB,GAC3B,qBAAqB,GAAG,8BAA8B,CAaxD;AAED,wBAAgB,2BAA2B,CACzC,MAAM,EAAE,gBAAgB,GACvB,qBAAqB,CAUvB;AAED,wBAAgB,kCAAkC,CAChD,MAAM,EAAE,gBAAgB,GACvB,qBAAqB,GAAG,8BAA8B,CAKxD;AAED,wBAAgB,4BAA4B,CAC1C,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,iBAAiB,EAC7B,IAAI,EAAE,cAAc,GACnB,qBAAqB,CAMvB;AAuBD,wBAAgB,qBAAqB,kFAMpC;AAED,wBAAgB,yBAAyB,kFAMxC;AAED,wBAAgB,yBAAyB,kFAMxC;AAED,wBAAgB,2BAA2B,kFAM1C;AAED,wBAAgB,yBAAyB,8DAKxC;AAED,wBAAgB,6BAA6B,8DAK5C;AAED,wBAAgB,gCAAgC,8DAK/C;AAED,wBAAgB,mCAAmC,8DAKlD;AAED,wBAAgB,+BAA+B,8DAK9C;AAED,wBAAgB,4BAA4B,8DAK3C;AAED,wBAAgB,oCAAoC,8DAKnD;AAED,wBAAgB,qCAAqC,8DAKpD;AAED,wBAAgB,4CAA4C,8DAM3D"}
@@ -1,24 +0,0 @@
1
- import type { LogContext } from '@rocicorp/logger';
2
- import type { ViewSyncerStatusEvent } from '../../../../zero-events/src/status.ts';
3
- type PublishFn = (lc: LogContext, event: ViewSyncerStatusEvent) => void;
4
- /**
5
- * Publishes the progress of a view-syncer's litestream restore.
6
- *
7
- * `litestream restore` writes the database page by page into
8
- * `<replica>.tmp` and renames it to the replica when it is done, so the
9
- * size of the temporary file is the number of bytes restored so far.
10
- */
11
- export declare class RestoreProgressReporter {
12
- #private;
13
- constructor(lc: LogContext, replicaFile: string, publishFn?: PublishFn);
14
- /**
15
- * Publishes a `Restoring` event now and then every `intervalMs` while the
16
- * number of restored bytes changes, until {@link stop} or {@link done}.
17
- */
18
- start(totalBytes: number | undefined, intervalMs?: number): void;
19
- stop(): void;
20
- /** Publishes a `Restored` event with the size of the restored replica. */
21
- done(): void;
22
- }
23
- export {};
24
- //# sourceMappingURL=restore-progress.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"restore-progress.d.ts","sourceRoot":"","sources":["../../../../../../zero-cache/src/services/litestream/restore-progress.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,kBAAkB,CAAC;AACjD,OAAO,KAAK,EAGV,qBAAqB,EACtB,MAAM,uCAAuC,CAAC;AAK/C,KAAK,SAAS,GAAG,CAAC,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE,qBAAqB,KAAK,IAAI,CAAC;AAExE;;;;;;GAMG;AACH,qBAAa,uBAAuB;;IAUlC,YACE,EAAE,EAAE,UAAU,EACd,WAAW,EAAE,MAAM,EACnB,SAAS,GAAE,SAAwB,EAKpC;IAED;;;OAGG;IACH,KAAK,CAAC,UAAU,EAAE,MAAM,GAAG,SAAS,EAAE,UAAU,SAAsB,QAcrE;IAED,IAAI,SAGH;IAED,0EAA0E;IAC1E,IAAI,SAGH;CA2CF"}
@@ -1,40 +0,0 @@
1
- import type { LogContext } from '@rocicorp/logger';
2
- import type { JWTPayload } from 'jose';
3
- import postgres from 'postgres';
4
- import { ErrorKind } from '../../../../zero-protocol/src/error-kind.ts';
5
- import { type CRUDMutation, type InsertOp, type Mutation, type UpsertOp } from '../../../../zero-protocol/src/mutation.ts';
6
- import type { DatabaseStorage } from '../../../../zqlite/src/database-storage.ts';
7
- import { type WriteAuthorizer } from '../../auth/write-authorizer.ts';
8
- import { type ZeroConfig } from '../../config/zero-config.ts';
9
- import type { PostgresDB, PostgresTransaction } from '../../types/pg.ts';
10
- import { type ShardID } from '../../types/shards.ts';
11
- import type { RefCountedService, Service } from '../service.ts';
12
- export type MutationError = [
13
- kind: ErrorKind.MutationFailed | ErrorKind.MutationRateLimited,
14
- desc: string
15
- ];
16
- export interface Mutagen extends RefCountedService {
17
- /**
18
- * Callers must hold a {@link ref} for the duration of a push (i.e. across
19
- * all of its mutations). The service stops, closing its replica handle,
20
- * when its ref count drops to zero.
21
- */
22
- processMutation(mutation: Mutation, authData: JWTPayload | undefined, customMutatorsEnabled: boolean): Promise<MutationError | undefined>;
23
- }
24
- export declare class MutagenService implements Mutagen, Service {
25
- #private;
26
- readonly id: string;
27
- constructor(lc: LogContext, shard: ShardID, clientGroupID: string, upstream: PostgresDB, config: ZeroConfig, writeAuthzStorage: DatabaseStorage);
28
- ref(): void;
29
- unref(): void;
30
- hasRefs(): boolean;
31
- processMutation(mutation: Mutation, authData: JWTPayload | undefined, customMutatorsEnabled?: boolean): Promise<MutationError | undefined>;
32
- run(): Promise<void>;
33
- stop(): Promise<void>;
34
- }
35
- export declare function processMutation(lc: LogContext, authData: JWTPayload | undefined, db: PostgresDB, shard: ShardID, clientGroupID: string, mutation: Mutation, writeAuthorizer: WriteAuthorizer, onTxStart?: () => void | Promise<void>, // for testing
36
- customMutatorsEnabled?: boolean): Promise<MutationError | undefined>;
37
- export declare function processMutationWithTx(lc: LogContext, tx: PostgresTransaction, authData: JWTPayload | undefined, shard: ShardID, clientGroupID: string, mutation: CRUDMutation, errorMode: boolean, authorizer: WriteAuthorizer): Promise<void>;
38
- export declare function getInsertSQL(tx: postgres.TransactionSql, create: InsertOp): postgres.PendingQuery<postgres.Row[]>;
39
- export declare function getUpsertSQL(tx: postgres.TransactionSql, set: UpsertOp): postgres.PendingQuery<postgres.Row[]>;
40
- //# sourceMappingURL=mutagen.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mutagen.d.ts","sourceRoot":"","sources":["../../../../../../zero-cache/src/services/mutagen/mutagen.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,kBAAkB,CAAC;AAEjD,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,MAAM,CAAC;AACrC,OAAO,QAAQ,MAAM,UAAU,CAAC;AAGhC,OAAO,EAAC,SAAS,EAAC,MAAM,6CAA6C,CAAC;AAOtE,OAAO,EACL,KAAK,YAAY,EAEjB,KAAK,QAAQ,EACb,KAAK,QAAQ,EAEb,KAAK,QAAQ,EACd,MAAM,2CAA2C,CAAC;AAKnD,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,4CAA4C,CAAC;AAEhF,OAAO,EAEL,KAAK,eAAe,EACrB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAC,KAAK,UAAU,EAAC,MAAM,6BAA6B,CAAC;AAK5D,OAAO,KAAK,EAAC,UAAU,EAAE,mBAAmB,EAAC,MAAM,mBAAmB,CAAC;AACvE,OAAO,EAAiB,KAAK,OAAO,EAAC,MAAM,uBAAuB,CAAC;AAEnE,OAAO,KAAK,EAAC,iBAAiB,EAAE,OAAO,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