@powerhousedao/reactor 6.0.0-dev.13 → 6.0.0-dev.131

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 (409) hide show
  1. package/dist/index.d.ts +4320 -0
  2. package/dist/index.d.ts.map +1 -0
  3. package/dist/index.js +9442 -0
  4. package/dist/index.js.map +1 -0
  5. package/package.json +21 -20
  6. package/dist/src/actions/index.d.ts +0 -24
  7. package/dist/src/actions/index.d.ts.map +0 -1
  8. package/dist/src/actions/index.js +0 -76
  9. package/dist/src/actions/index.js.map +0 -1
  10. package/dist/src/cache/buffer/ring-buffer.d.ts +0 -37
  11. package/dist/src/cache/buffer/ring-buffer.d.ts.map +0 -1
  12. package/dist/src/cache/buffer/ring-buffer.js +0 -69
  13. package/dist/src/cache/buffer/ring-buffer.js.map +0 -1
  14. package/dist/src/cache/document-meta-cache-types.d.ts +0 -114
  15. package/dist/src/cache/document-meta-cache-types.d.ts.map +0 -1
  16. package/dist/src/cache/document-meta-cache-types.js +0 -2
  17. package/dist/src/cache/document-meta-cache-types.js.map +0 -1
  18. package/dist/src/cache/document-meta-cache.d.ts +0 -30
  19. package/dist/src/cache/document-meta-cache.d.ts.map +0 -1
  20. package/dist/src/cache/document-meta-cache.js +0 -128
  21. package/dist/src/cache/document-meta-cache.js.map +0 -1
  22. package/dist/src/cache/index.d.ts +0 -3
  23. package/dist/src/cache/index.d.ts.map +0 -1
  24. package/dist/src/cache/index.js +0 -2
  25. package/dist/src/cache/index.js.map +0 -1
  26. package/dist/src/cache/kysely-operation-index.d.ts +0 -15
  27. package/dist/src/cache/kysely-operation-index.d.ts.map +0 -1
  28. package/dist/src/cache/kysely-operation-index.js +0 -250
  29. package/dist/src/cache/kysely-operation-index.js.map +0 -1
  30. package/dist/src/cache/kysely-write-cache.d.ts +0 -134
  31. package/dist/src/cache/kysely-write-cache.d.ts.map +0 -1
  32. package/dist/src/cache/kysely-write-cache.js +0 -388
  33. package/dist/src/cache/kysely-write-cache.js.map +0 -1
  34. package/dist/src/cache/lru/lru-tracker.d.ts +0 -15
  35. package/dist/src/cache/lru/lru-tracker.d.ts.map +0 -1
  36. package/dist/src/cache/lru/lru-tracker.js +0 -96
  37. package/dist/src/cache/lru/lru-tracker.js.map +0 -1
  38. package/dist/src/cache/operation-index-types.d.ts +0 -50
  39. package/dist/src/cache/operation-index-types.d.ts.map +0 -1
  40. package/dist/src/cache/operation-index-types.js +0 -4
  41. package/dist/src/cache/operation-index-types.js.map +0 -1
  42. package/dist/src/cache/write/interfaces.d.ts +0 -83
  43. package/dist/src/cache/write/interfaces.d.ts.map +0 -1
  44. package/dist/src/cache/write/interfaces.js +0 -2
  45. package/dist/src/cache/write/interfaces.js.map +0 -1
  46. package/dist/src/cache/write-cache-types.d.ts +0 -42
  47. package/dist/src/cache/write-cache-types.d.ts.map +0 -1
  48. package/dist/src/cache/write-cache-types.js +0 -2
  49. package/dist/src/cache/write-cache-types.js.map +0 -1
  50. package/dist/src/client/reactor-client.d.ts +0 -117
  51. package/dist/src/client/reactor-client.d.ts.map +0 -1
  52. package/dist/src/client/reactor-client.js +0 -406
  53. package/dist/src/client/reactor-client.js.map +0 -1
  54. package/dist/src/client/types.d.ts +0 -241
  55. package/dist/src/client/types.d.ts.map +0 -1
  56. package/dist/src/client/types.js +0 -14
  57. package/dist/src/client/types.js.map +0 -1
  58. package/dist/src/core/reactor-builder.d.ts +0 -47
  59. package/dist/src/core/reactor-builder.d.ts.map +0 -1
  60. package/dist/src/core/reactor-builder.js +0 -231
  61. package/dist/src/core/reactor-builder.js.map +0 -1
  62. package/dist/src/core/reactor-client-builder.d.ts +0 -49
  63. package/dist/src/core/reactor-client-builder.d.ts.map +0 -1
  64. package/dist/src/core/reactor-client-builder.js +0 -123
  65. package/dist/src/core/reactor-client-builder.js.map +0 -1
  66. package/dist/src/core/reactor.d.ts +0 -116
  67. package/dist/src/core/reactor.d.ts.map +0 -1
  68. package/dist/src/core/reactor.js +0 -981
  69. package/dist/src/core/reactor.js.map +0 -1
  70. package/dist/src/core/types.d.ts +0 -276
  71. package/dist/src/core/types.d.ts.map +0 -1
  72. package/dist/src/core/types.js +0 -2
  73. package/dist/src/core/types.js.map +0 -1
  74. package/dist/src/core/utils.d.ts +0 -59
  75. package/dist/src/core/utils.d.ts.map +0 -1
  76. package/dist/src/core/utils.js +0 -171
  77. package/dist/src/core/utils.js.map +0 -1
  78. package/dist/src/events/event-bus.d.ts +0 -8
  79. package/dist/src/events/event-bus.d.ts.map +0 -1
  80. package/dist/src/events/event-bus.js +0 -53
  81. package/dist/src/events/event-bus.js.map +0 -1
  82. package/dist/src/events/interfaces.d.ts +0 -27
  83. package/dist/src/events/interfaces.d.ts.map +0 -1
  84. package/dist/src/events/interfaces.js +0 -2
  85. package/dist/src/events/interfaces.js.map +0 -1
  86. package/dist/src/events/types.d.ts +0 -67
  87. package/dist/src/events/types.d.ts.map +0 -1
  88. package/dist/src/events/types.js +0 -28
  89. package/dist/src/events/types.js.map +0 -1
  90. package/dist/src/executor/interfaces.d.ts +0 -49
  91. package/dist/src/executor/interfaces.d.ts.map +0 -1
  92. package/dist/src/executor/interfaces.js +0 -2
  93. package/dist/src/executor/interfaces.js.map +0 -1
  94. package/dist/src/executor/simple-job-executor-manager.d.ts +0 -34
  95. package/dist/src/executor/simple-job-executor-manager.d.ts.map +0 -1
  96. package/dist/src/executor/simple-job-executor-manager.js +0 -233
  97. package/dist/src/executor/simple-job-executor-manager.js.map +0 -1
  98. package/dist/src/executor/simple-job-executor.d.ts +0 -80
  99. package/dist/src/executor/simple-job-executor.d.ts.map +0 -1
  100. package/dist/src/executor/simple-job-executor.js +0 -898
  101. package/dist/src/executor/simple-job-executor.js.map +0 -1
  102. package/dist/src/executor/types.d.ts +0 -93
  103. package/dist/src/executor/types.d.ts.map +0 -1
  104. package/dist/src/executor/types.js +0 -11
  105. package/dist/src/executor/types.js.map +0 -1
  106. package/dist/src/executor/util.d.ts +0 -74
  107. package/dist/src/executor/util.d.ts.map +0 -1
  108. package/dist/src/executor/util.js +0 -184
  109. package/dist/src/executor/util.js.map +0 -1
  110. package/dist/src/index.d.ts +0 -53
  111. package/dist/src/index.d.ts.map +0 -1
  112. package/dist/src/index.js +0 -62
  113. package/dist/src/index.js.map +0 -1
  114. package/dist/src/job-tracker/in-memory-job-tracker.d.ts +0 -25
  115. package/dist/src/job-tracker/in-memory-job-tracker.d.ts.map +0 -1
  116. package/dist/src/job-tracker/in-memory-job-tracker.js +0 -112
  117. package/dist/src/job-tracker/in-memory-job-tracker.js.map +0 -1
  118. package/dist/src/job-tracker/index.d.ts +0 -3
  119. package/dist/src/job-tracker/index.d.ts.map +0 -1
  120. package/dist/src/job-tracker/index.js +0 -2
  121. package/dist/src/job-tracker/index.js.map +0 -1
  122. package/dist/src/job-tracker/interfaces.d.ts +0 -39
  123. package/dist/src/job-tracker/interfaces.d.ts.map +0 -1
  124. package/dist/src/job-tracker/interfaces.js +0 -2
  125. package/dist/src/job-tracker/interfaces.js.map +0 -1
  126. package/dist/src/logging/console.d.ts +0 -23
  127. package/dist/src/logging/console.d.ts.map +0 -1
  128. package/dist/src/logging/console.js +0 -108
  129. package/dist/src/logging/console.js.map +0 -1
  130. package/dist/src/logging/types.d.ts +0 -12
  131. package/dist/src/logging/types.d.ts.map +0 -1
  132. package/dist/src/logging/types.js +0 -2
  133. package/dist/src/logging/types.js.map +0 -1
  134. package/dist/src/processors/index.d.ts +0 -3
  135. package/dist/src/processors/index.d.ts.map +0 -1
  136. package/dist/src/processors/index.js +0 -2
  137. package/dist/src/processors/index.js.map +0 -1
  138. package/dist/src/processors/processor-manager.d.ts +0 -38
  139. package/dist/src/processors/processor-manager.d.ts.map +0 -1
  140. package/dist/src/processors/processor-manager.js +0 -165
  141. package/dist/src/processors/processor-manager.js.map +0 -1
  142. package/dist/src/processors/types.d.ts +0 -63
  143. package/dist/src/processors/types.d.ts.map +0 -1
  144. package/dist/src/processors/types.js +0 -2
  145. package/dist/src/processors/types.js.map +0 -1
  146. package/dist/src/processors/utils.d.ts +0 -10
  147. package/dist/src/processors/utils.d.ts.map +0 -1
  148. package/dist/src/processors/utils.js +0 -59
  149. package/dist/src/processors/utils.js.map +0 -1
  150. package/dist/src/queue/interfaces.d.ts +0 -103
  151. package/dist/src/queue/interfaces.d.ts.map +0 -1
  152. package/dist/src/queue/interfaces.js +0 -2
  153. package/dist/src/queue/interfaces.js.map +0 -1
  154. package/dist/src/queue/job-execution-handle.d.ts +0 -25
  155. package/dist/src/queue/job-execution-handle.d.ts.map +0 -1
  156. package/dist/src/queue/job-execution-handle.js +0 -62
  157. package/dist/src/queue/job-execution-handle.js.map +0 -1
  158. package/dist/src/queue/queue.d.ts +0 -81
  159. package/dist/src/queue/queue.d.ts.map +0 -1
  160. package/dist/src/queue/queue.js +0 -384
  161. package/dist/src/queue/queue.js.map +0 -1
  162. package/dist/src/queue/types.d.ts +0 -73
  163. package/dist/src/queue/types.d.ts.map +0 -1
  164. package/dist/src/queue/types.js +0 -19
  165. package/dist/src/queue/types.js.map +0 -1
  166. package/dist/src/read-models/base-read-model.d.ts +0 -60
  167. package/dist/src/read-models/base-read-model.d.ts.map +0 -1
  168. package/dist/src/read-models/base-read-model.js +0 -143
  169. package/dist/src/read-models/base-read-model.js.map +0 -1
  170. package/dist/src/read-models/coordinator.d.ts +0 -39
  171. package/dist/src/read-models/coordinator.d.ts.map +0 -1
  172. package/dist/src/read-models/coordinator.js +0 -72
  173. package/dist/src/read-models/coordinator.js.map +0 -1
  174. package/dist/src/read-models/document-view.d.ts +0 -24
  175. package/dist/src/read-models/document-view.d.ts.map +0 -1
  176. package/dist/src/read-models/document-view.js +0 -375
  177. package/dist/src/read-models/document-view.js.map +0 -1
  178. package/dist/src/read-models/interfaces.d.ts +0 -29
  179. package/dist/src/read-models/interfaces.d.ts.map +0 -1
  180. package/dist/src/read-models/interfaces.js +0 -2
  181. package/dist/src/read-models/interfaces.js.map +0 -1
  182. package/dist/src/read-models/types.d.ts +0 -47
  183. package/dist/src/read-models/types.d.ts.map +0 -1
  184. package/dist/src/read-models/types.js +0 -2
  185. package/dist/src/read-models/types.js.map +0 -1
  186. package/dist/src/registry/implementation.d.ts +0 -70
  187. package/dist/src/registry/implementation.d.ts.map +0 -1
  188. package/dist/src/registry/implementation.js +0 -216
  189. package/dist/src/registry/implementation.js.map +0 -1
  190. package/dist/src/registry/index.d.ts +0 -3
  191. package/dist/src/registry/index.d.ts.map +0 -1
  192. package/dist/src/registry/index.js +0 -2
  193. package/dist/src/registry/index.js.map +0 -1
  194. package/dist/src/registry/interfaces.d.ts +0 -100
  195. package/dist/src/registry/interfaces.d.ts.map +0 -1
  196. package/dist/src/registry/interfaces.js +0 -2
  197. package/dist/src/registry/interfaces.js.map +0 -1
  198. package/dist/src/shared/awaiter.d.ts +0 -35
  199. package/dist/src/shared/awaiter.d.ts.map +0 -1
  200. package/dist/src/shared/awaiter.js +0 -123
  201. package/dist/src/shared/awaiter.js.map +0 -1
  202. package/dist/src/shared/consistency-tracker.d.ts +0 -48
  203. package/dist/src/shared/consistency-tracker.d.ts.map +0 -1
  204. package/dist/src/shared/consistency-tracker.js +0 -123
  205. package/dist/src/shared/consistency-tracker.js.map +0 -1
  206. package/dist/src/shared/drive-url.d.ts +0 -15
  207. package/dist/src/shared/drive-url.d.ts.map +0 -1
  208. package/dist/src/shared/drive-url.js +0 -17
  209. package/dist/src/shared/drive-url.js.map +0 -1
  210. package/dist/src/shared/errors.d.ts +0 -41
  211. package/dist/src/shared/errors.d.ts.map +0 -1
  212. package/dist/src/shared/errors.js +0 -75
  213. package/dist/src/shared/errors.js.map +0 -1
  214. package/dist/src/shared/factories.d.ts +0 -16
  215. package/dist/src/shared/factories.d.ts.map +0 -1
  216. package/dist/src/shared/factories.js +0 -33
  217. package/dist/src/shared/factories.js.map +0 -1
  218. package/dist/src/shared/types.d.ts +0 -135
  219. package/dist/src/shared/types.d.ts.map +0 -1
  220. package/dist/src/shared/types.js +0 -38
  221. package/dist/src/shared/types.js.map +0 -1
  222. package/dist/src/shared/utils.d.ts +0 -3
  223. package/dist/src/shared/utils.d.ts.map +0 -1
  224. package/dist/src/shared/utils.js +0 -8
  225. package/dist/src/shared/utils.js.map +0 -1
  226. package/dist/src/signer/passthrough-signer.d.ts +0 -12
  227. package/dist/src/signer/passthrough-signer.d.ts.map +0 -1
  228. package/dist/src/signer/passthrough-signer.js +0 -19
  229. package/dist/src/signer/passthrough-signer.js.map +0 -1
  230. package/dist/src/signer/types.d.ts +0 -17
  231. package/dist/src/signer/types.d.ts.map +0 -1
  232. package/dist/src/signer/types.js +0 -2
  233. package/dist/src/signer/types.js.map +0 -1
  234. package/dist/src/storage/consistency-aware-legacy-storage.d.ts +0 -33
  235. package/dist/src/storage/consistency-aware-legacy-storage.d.ts.map +0 -1
  236. package/dist/src/storage/consistency-aware-legacy-storage.js +0 -65
  237. package/dist/src/storage/consistency-aware-legacy-storage.js.map +0 -1
  238. package/dist/src/storage/index.d.ts +0 -4
  239. package/dist/src/storage/index.d.ts.map +0 -1
  240. package/dist/src/storage/index.js +0 -3
  241. package/dist/src/storage/index.js.map +0 -1
  242. package/dist/src/storage/interfaces.d.ts +0 -439
  243. package/dist/src/storage/interfaces.d.ts.map +0 -1
  244. package/dist/src/storage/interfaces.js +0 -19
  245. package/dist/src/storage/interfaces.js.map +0 -1
  246. package/dist/src/storage/kysely/document-indexer.d.ts +0 -28
  247. package/dist/src/storage/kysely/document-indexer.d.ts.map +0 -1
  248. package/dist/src/storage/kysely/document-indexer.js +0 -350
  249. package/dist/src/storage/kysely/document-indexer.js.map +0 -1
  250. package/dist/src/storage/kysely/keyframe-store.d.ts +0 -15
  251. package/dist/src/storage/kysely/keyframe-store.d.ts.map +0 -1
  252. package/dist/src/storage/kysely/keyframe-store.js +0 -64
  253. package/dist/src/storage/kysely/keyframe-store.js.map +0 -1
  254. package/dist/src/storage/kysely/store.d.ts +0 -16
  255. package/dist/src/storage/kysely/store.d.ts.map +0 -1
  256. package/dist/src/storage/kysely/store.js +0 -233
  257. package/dist/src/storage/kysely/store.js.map +0 -1
  258. package/dist/src/storage/kysely/sync-cursor-storage.d.ts +0 -13
  259. package/dist/src/storage/kysely/sync-cursor-storage.d.ts.map +0 -1
  260. package/dist/src/storage/kysely/sync-cursor-storage.js +0 -93
  261. package/dist/src/storage/kysely/sync-cursor-storage.js.map +0 -1
  262. package/dist/src/storage/kysely/sync-remote-storage.d.ts +0 -13
  263. package/dist/src/storage/kysely/sync-remote-storage.d.ts.map +0 -1
  264. package/dist/src/storage/kysely/sync-remote-storage.js +0 -133
  265. package/dist/src/storage/kysely/sync-remote-storage.js.map +0 -1
  266. package/dist/src/storage/kysely/types.d.ts +0 -135
  267. package/dist/src/storage/kysely/types.d.ts.map +0 -1
  268. package/dist/src/storage/kysely/types.js +0 -2
  269. package/dist/src/storage/kysely/types.js.map +0 -1
  270. package/dist/src/storage/migrations/001_create_operation_table.d.ts +0 -3
  271. package/dist/src/storage/migrations/001_create_operation_table.d.ts.map +0 -1
  272. package/dist/src/storage/migrations/001_create_operation_table.js +0 -41
  273. package/dist/src/storage/migrations/001_create_operation_table.js.map +0 -1
  274. package/dist/src/storage/migrations/002_create_keyframe_table.d.ts +0 -3
  275. package/dist/src/storage/migrations/002_create_keyframe_table.d.ts.map +0 -1
  276. package/dist/src/storage/migrations/002_create_keyframe_table.js +0 -27
  277. package/dist/src/storage/migrations/002_create_keyframe_table.js.map +0 -1
  278. package/dist/src/storage/migrations/003_create_document_table.d.ts +0 -3
  279. package/dist/src/storage/migrations/003_create_document_table.d.ts.map +0 -1
  280. package/dist/src/storage/migrations/003_create_document_table.js +0 -10
  281. package/dist/src/storage/migrations/003_create_document_table.js.map +0 -1
  282. package/dist/src/storage/migrations/004_create_document_relationship_table.d.ts +0 -3
  283. package/dist/src/storage/migrations/004_create_document_relationship_table.d.ts.map +0 -1
  284. package/dist/src/storage/migrations/004_create_document_relationship_table.js +0 -35
  285. package/dist/src/storage/migrations/004_create_document_relationship_table.js.map +0 -1
  286. package/dist/src/storage/migrations/005_create_indexer_state_table.d.ts +0 -3
  287. package/dist/src/storage/migrations/005_create_indexer_state_table.d.ts.map +0 -1
  288. package/dist/src/storage/migrations/005_create_indexer_state_table.js +0 -10
  289. package/dist/src/storage/migrations/005_create_indexer_state_table.js.map +0 -1
  290. package/dist/src/storage/migrations/006_create_document_snapshot_table.d.ts +0 -3
  291. package/dist/src/storage/migrations/006_create_document_snapshot_table.d.ts.map +0 -1
  292. package/dist/src/storage/migrations/006_create_document_snapshot_table.js +0 -49
  293. package/dist/src/storage/migrations/006_create_document_snapshot_table.js.map +0 -1
  294. package/dist/src/storage/migrations/007_create_slug_mapping_table.d.ts +0 -3
  295. package/dist/src/storage/migrations/007_create_slug_mapping_table.d.ts.map +0 -1
  296. package/dist/src/storage/migrations/007_create_slug_mapping_table.js +0 -24
  297. package/dist/src/storage/migrations/007_create_slug_mapping_table.js.map +0 -1
  298. package/dist/src/storage/migrations/008_create_view_state_table.d.ts +0 -3
  299. package/dist/src/storage/migrations/008_create_view_state_table.d.ts.map +0 -1
  300. package/dist/src/storage/migrations/008_create_view_state_table.js +0 -10
  301. package/dist/src/storage/migrations/008_create_view_state_table.js.map +0 -1
  302. package/dist/src/storage/migrations/009_create_operation_index_tables.d.ts +0 -3
  303. package/dist/src/storage/migrations/009_create_operation_index_tables.d.ts.map +0 -1
  304. package/dist/src/storage/migrations/009_create_operation_index_tables.js +0 -50
  305. package/dist/src/storage/migrations/009_create_operation_index_tables.js.map +0 -1
  306. package/dist/src/storage/migrations/010_create_sync_tables.d.ts +0 -3
  307. package/dist/src/storage/migrations/010_create_sync_tables.d.ts.map +0 -1
  308. package/dist/src/storage/migrations/010_create_sync_tables.js +0 -43
  309. package/dist/src/storage/migrations/010_create_sync_tables.js.map +0 -1
  310. package/dist/src/storage/migrations/index.d.ts +0 -3
  311. package/dist/src/storage/migrations/index.d.ts.map +0 -1
  312. package/dist/src/storage/migrations/index.js +0 -3
  313. package/dist/src/storage/migrations/index.js.map +0 -1
  314. package/dist/src/storage/migrations/migrator.d.ts +0 -6
  315. package/dist/src/storage/migrations/migrator.d.ts.map +0 -1
  316. package/dist/src/storage/migrations/migrator.js +0 -78
  317. package/dist/src/storage/migrations/migrator.js.map +0 -1
  318. package/dist/src/storage/migrations/run-migrations.d.ts +0 -2
  319. package/dist/src/storage/migrations/run-migrations.d.ts.map +0 -1
  320. package/dist/src/storage/migrations/run-migrations.js +0 -58
  321. package/dist/src/storage/migrations/run-migrations.js.map +0 -1
  322. package/dist/src/storage/migrations/types.d.ts +0 -9
  323. package/dist/src/storage/migrations/types.d.ts.map +0 -1
  324. package/dist/src/storage/migrations/types.js +0 -2
  325. package/dist/src/storage/migrations/types.js.map +0 -1
  326. package/dist/src/storage/txn.d.ts +0 -15
  327. package/dist/src/storage/txn.d.ts.map +0 -1
  328. package/dist/src/storage/txn.js +0 -42
  329. package/dist/src/storage/txn.js.map +0 -1
  330. package/dist/src/subs/default-error-handler.d.ts +0 -13
  331. package/dist/src/subs/default-error-handler.d.ts.map +0 -1
  332. package/dist/src/subs/default-error-handler.js +0 -27
  333. package/dist/src/subs/default-error-handler.js.map +0 -1
  334. package/dist/src/subs/react-subscription-manager.d.ts +0 -45
  335. package/dist/src/subs/react-subscription-manager.d.ts.map +0 -1
  336. package/dist/src/subs/react-subscription-manager.js +0 -185
  337. package/dist/src/subs/react-subscription-manager.js.map +0 -1
  338. package/dist/src/subs/subscription-notification-read-model.d.ts +0 -17
  339. package/dist/src/subs/subscription-notification-read-model.d.ts.map +0 -1
  340. package/dist/src/subs/subscription-notification-read-model.js +0 -62
  341. package/dist/src/subs/subscription-notification-read-model.js.map +0 -1
  342. package/dist/src/subs/types.d.ts +0 -64
  343. package/dist/src/subs/types.d.ts.map +0 -1
  344. package/dist/src/subs/types.js +0 -2
  345. package/dist/src/subs/types.js.map +0 -1
  346. package/dist/src/sync/channels/composite-channel-factory.d.ts +0 -30
  347. package/dist/src/sync/channels/composite-channel-factory.d.ts.map +0 -1
  348. package/dist/src/sync/channels/composite-channel-factory.js +0 -87
  349. package/dist/src/sync/channels/composite-channel-factory.js.map +0 -1
  350. package/dist/src/sync/channels/gql-channel-factory.d.ts +0 -25
  351. package/dist/src/sync/channels/gql-channel-factory.d.ts.map +0 -1
  352. package/dist/src/sync/channels/gql-channel-factory.js +0 -76
  353. package/dist/src/sync/channels/gql-channel-factory.js.map +0 -1
  354. package/dist/src/sync/channels/gql-channel.d.ts +0 -118
  355. package/dist/src/sync/channels/gql-channel.d.ts.map +0 -1
  356. package/dist/src/sync/channels/gql-channel.js +0 -423
  357. package/dist/src/sync/channels/gql-channel.js.map +0 -1
  358. package/dist/src/sync/channels/index.d.ts +0 -6
  359. package/dist/src/sync/channels/index.d.ts.map +0 -1
  360. package/dist/src/sync/channels/index.js +0 -6
  361. package/dist/src/sync/channels/index.js.map +0 -1
  362. package/dist/src/sync/channels/polling-channel.d.ts +0 -39
  363. package/dist/src/sync/channels/polling-channel.d.ts.map +0 -1
  364. package/dist/src/sync/channels/polling-channel.js +0 -72
  365. package/dist/src/sync/channels/polling-channel.js.map +0 -1
  366. package/dist/src/sync/channels/utils.d.ts +0 -30
  367. package/dist/src/sync/channels/utils.d.ts.map +0 -1
  368. package/dist/src/sync/channels/utils.js +0 -96
  369. package/dist/src/sync/channels/utils.js.map +0 -1
  370. package/dist/src/sync/errors.d.ts +0 -10
  371. package/dist/src/sync/errors.d.ts.map +0 -1
  372. package/dist/src/sync/errors.js +0 -17
  373. package/dist/src/sync/errors.js.map +0 -1
  374. package/dist/src/sync/index.d.ts +0 -12
  375. package/dist/src/sync/index.d.ts.map +0 -1
  376. package/dist/src/sync/index.js +0 -9
  377. package/dist/src/sync/index.js.map +0 -1
  378. package/dist/src/sync/interfaces.d.ts +0 -180
  379. package/dist/src/sync/interfaces.d.ts.map +0 -1
  380. package/dist/src/sync/interfaces.js +0 -2
  381. package/dist/src/sync/interfaces.js.map +0 -1
  382. package/dist/src/sync/mailbox.d.ts +0 -21
  383. package/dist/src/sync/mailbox.d.ts.map +0 -1
  384. package/dist/src/sync/mailbox.js +0 -59
  385. package/dist/src/sync/mailbox.js.map +0 -1
  386. package/dist/src/sync/sync-builder.d.ts +0 -19
  387. package/dist/src/sync/sync-builder.d.ts.map +0 -1
  388. package/dist/src/sync/sync-builder.js +0 -39
  389. package/dist/src/sync/sync-builder.js.map +0 -1
  390. package/dist/src/sync/sync-manager.d.ts +0 -37
  391. package/dist/src/sync/sync-manager.d.ts.map +0 -1
  392. package/dist/src/sync/sync-manager.js +0 -266
  393. package/dist/src/sync/sync-manager.js.map +0 -1
  394. package/dist/src/sync/sync-operation.d.ts +0 -28
  395. package/dist/src/sync/sync-operation.d.ts.map +0 -1
  396. package/dist/src/sync/sync-operation.js +0 -63
  397. package/dist/src/sync/sync-operation.js.map +0 -1
  398. package/dist/src/sync/types.d.ts +0 -60
  399. package/dist/src/sync/types.d.ts.map +0 -1
  400. package/dist/src/sync/types.js +0 -16
  401. package/dist/src/sync/types.js.map +0 -1
  402. package/dist/src/sync/utils.d.ts +0 -36
  403. package/dist/src/sync/utils.d.ts.map +0 -1
  404. package/dist/src/sync/utils.js +0 -78
  405. package/dist/src/sync/utils.js.map +0 -1
  406. package/dist/src/utils/reshuffle.d.ts +0 -30
  407. package/dist/src/utils/reshuffle.d.ts.map +0 -1
  408. package/dist/src/utils/reshuffle.js +0 -47
  409. package/dist/src/utils/reshuffle.js.map +0 -1
@@ -1,96 +0,0 @@
1
- import { SyncOperation } from "../sync-operation.js";
2
- import { batchOperationsByDocument } from "../utils.js";
3
- let syncOpCounter = 0;
4
- /**
5
- * Deserializes a signature from a comma-separated string back to a tuple.
6
- *
7
- * GraphQL serializes Signature tuples as comma-separated strings for transport.
8
- * This function converts them back to the expected [string, string, string, string, string] format.
9
- */
10
- function deserializeSignature(sig) {
11
- if (Array.isArray(sig)) {
12
- return sig;
13
- }
14
- return sig.split(", ");
15
- }
16
- /**
17
- * Deserializes signatures in an operation's signer context from strings back to tuples.
18
- *
19
- * When operations are transported via GraphQL, signatures are serialized as comma-separated
20
- * strings. This function restores them to the Signature tuple format required for verification.
21
- */
22
- function deserializeOperationSignatures(opWithContext) {
23
- const signer = opWithContext.operation.action.context?.signer;
24
- if (!signer?.signatures || signer.signatures.length === 0) {
25
- return opWithContext;
26
- }
27
- const deserializedSignatures = signer.signatures.map(deserializeSignature);
28
- const deserializedOperation = {
29
- ...opWithContext.operation,
30
- action: {
31
- ...opWithContext.operation.action,
32
- context: {
33
- ...opWithContext.operation.action.context,
34
- signer: {
35
- ...signer,
36
- signatures: deserializedSignatures,
37
- },
38
- },
39
- },
40
- };
41
- return {
42
- ...opWithContext,
43
- operation: deserializedOperation,
44
- };
45
- }
46
- /**
47
- * Converts a SyncEnvelope containing operations into a SyncOperation.
48
- *
49
- * Extracts the necessary metadata from the envelope's operations to create
50
- * a sync operation that can be processed by the receiving channel. Also
51
- * deserializes any signatures from comma-separated strings back to tuples,
52
- * as GraphQL transport serializes Signature tuples for compatibility.
53
- *
54
- * @param envelope - The sync envelope containing operations
55
- * @param remoteName - The name of the remote this sync operation is associated with
56
- * @returns A new SyncOperation containing the envelope's operations with deserialized signatures
57
- * @throws Error if envelope has no operations or operations array is empty
58
- */
59
- export function envelopeToSyncOperation(envelope, remoteName) {
60
- if (!envelope.operations || envelope.operations.length === 0) {
61
- throw new Error("Cannot create SyncOperation from envelope without operations");
62
- }
63
- const deserializedOperations = envelope.operations.map(deserializeOperationSignatures);
64
- const firstOp = deserializedOperations[0];
65
- const documentId = firstOp.context.documentId;
66
- const branch = firstOp.context.branch;
67
- const scopes = [
68
- ...new Set(deserializedOperations.map((op) => op.context.scope)),
69
- ];
70
- const syncOpId = `syncop-${envelope.channelMeta.id}-${Date.now()}-${syncOpCounter++}`;
71
- return new SyncOperation(syncOpId, remoteName, documentId, scopes, branch, deserializedOperations);
72
- }
73
- /**
74
- * Converts a SyncEnvelope containing operations into multiple SyncOperations.
75
- *
76
- * This function batches operations by documentId, preserving cross-document ordering.
77
- * For operations [a1, a2, a3, b1, b2, a4], it returns:
78
- * - SyncOperation 1: [a1, a2, a3] for doc-a
79
- * - SyncOperation 2: [b1, b2] for doc-b
80
- * - SyncOperation 3: [a4] for doc-a
81
- *
82
- * This ensures operations are grouped for efficient processing while maintaining
83
- * causality across documents.
84
- */
85
- export function envelopesToSyncOperations(envelope, remoteName) {
86
- if (!envelope.operations || envelope.operations.length === 0) {
87
- return [];
88
- }
89
- const deserializedOps = envelope.operations.map(deserializeOperationSignatures);
90
- const batches = batchOperationsByDocument(deserializedOps);
91
- return batches.map((batch) => {
92
- const syncOpId = `syncop-${envelope.channelMeta.id}-${Date.now()}-${syncOpCounter++}`;
93
- return new SyncOperation(syncOpId, remoteName, batch.documentId, [batch.scope], batch.branch, batch.operations);
94
- });
95
- }
96
- //# sourceMappingURL=utils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../src/sync/channels/utils.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAErD,OAAO,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAC;AAExD,IAAI,aAAa,GAAG,CAAC,CAAC;AAEtB;;;;;GAKG;AACH,SAAS,oBAAoB,CAAC,GAAuB;IACnD,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;QACvB,OAAO,GAAG,CAAC;IACb,CAAC;IACD,OAAO,GAAG,CAAC,KAAK,CAAC,IAAI,CAAc,CAAC;AACtC,CAAC;AAED;;;;;GAKG;AACH,SAAS,8BAA8B,CACrC,aAAmC;IAEnC,MAAM,MAAM,GAAG,aAAa,CAAC,SAAS,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC;IAC9D,IAAI,CAAC,MAAM,EAAE,UAAU,IAAI,MAAM,CAAC,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC1D,OAAO,aAAa,CAAC;IACvB,CAAC;IAED,MAAM,sBAA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,aAAa,CACtB,QAAQ,EACR,UAAU,EACV,UAAU,EACV,MAAM,EACN,MAAM,EACN,sBAAsB,CACvB,CAAC;AACJ,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,yBAAyB,CACvC,QAAsB,EACtB,UAAkB;IAElB,IAAI,CAAC,QAAQ,CAAC,UAAU,IAAI,QAAQ,CAAC,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC7D,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,MAAM,eAAe,GAAG,QAAQ,CAAC,UAAU,CAAC,GAAG,CAC7C,8BAA8B,CAC/B,CAAC;IACF,MAAM,OAAO,GAAG,yBAAyB,CAAC,eAAe,CAAC,CAAC;IAE3D,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;QAC3B,MAAM,QAAQ,GAAG,UAAU,QAAQ,CAAC,WAAW,CAAC,EAAE,IAAI,IAAI,CAAC,GAAG,EAAE,IAAI,aAAa,EAAE,EAAE,CAAC;QACtF,OAAO,IAAI,aAAa,CACtB,QAAQ,EACR,UAAU,EACV,KAAK,CAAC,UAAU,EAChB,CAAC,KAAK,CAAC,KAAK,CAAC,EACb,KAAK,CAAC,MAAM,EACZ,KAAK,CAAC,UAAU,CACjB,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -1,10 +0,0 @@
1
- import type { ChannelErrorSource } from "./types.js";
2
- export declare class PollingChannelError extends Error {
3
- constructor(message: string);
4
- }
5
- export declare class ChannelError extends Error {
6
- source: ChannelErrorSource;
7
- error: Error;
8
- constructor(source: ChannelErrorSource, error: Error);
9
- }
10
- //# sourceMappingURL=errors.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/sync/errors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAErD,qBAAa,mBAAoB,SAAQ,KAAK;gBAChC,OAAO,EAAE,MAAM;CAI5B;AAED,qBAAa,YAAa,SAAQ,KAAK;IACrC,MAAM,EAAE,kBAAkB,CAAC;IAC3B,KAAK,EAAE,KAAK,CAAC;gBAED,MAAM,EAAE,kBAAkB,EAAE,KAAK,EAAE,KAAK;CAMrD"}
@@ -1,17 +0,0 @@
1
- export class PollingChannelError extends Error {
2
- constructor(message) {
3
- super(message);
4
- this.name = "PollingChannelError";
5
- }
6
- }
7
- export class ChannelError extends Error {
8
- source;
9
- error;
10
- constructor(source, error) {
11
- super(`ChannelError[${source}]: ${error.message}`);
12
- this.name = "ChannelError";
13
- this.source = source;
14
- this.error = error;
15
- }
16
- }
17
- //# sourceMappingURL=errors.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../src/sync/errors.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,mBAAoB,SAAQ,KAAK;IAC5C,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,qBAAqB,CAAC;IACpC,CAAC;CACF;AAED,MAAM,OAAO,YAAa,SAAQ,KAAK;IACrC,MAAM,CAAqB;IAC3B,KAAK,CAAQ;IAEb,YAAY,MAA0B,EAAE,KAAY;QAClD,KAAK,CAAC,gBAAgB,MAAM,MAAM,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;QACnD,IAAI,CAAC,IAAI,GAAG,cAAc,CAAC;QAC3B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;CACF"}
@@ -1,12 +0,0 @@
1
- export type { IChannel, IChannelFactory, ISyncManager, Remote, } from "./interfaces.js";
2
- export type { ShutdownStatus } from "../shared/types.js";
3
- export type { ChannelConfig, ChannelHealth, SyncOperationErrorType, RemoteFilter, RemoteOptions, RemoteRecord, RemoteCursor, RemoteStatus, SyncEnvelope, SyncEnvelopeType, ChannelMeta, } from "./types.js";
4
- export { ChannelErrorSource, SyncOperationStatus } from "./types.js";
5
- export { SyncOperation, SyncOperationAggregateError, } from "./sync-operation.js";
6
- export { Mailbox, type MailboxItem } from "./mailbox.js";
7
- export { ChannelError, PollingChannelError } from "./errors.js";
8
- export { PollingChannel, GqlChannelFactory, CompositeChannelFactory, } from "./channels/index.js";
9
- export { SyncManager } from "./sync-manager.js";
10
- export { SyncBuilder } from "./sync-builder.js";
11
- export { createIdleHealth, filterOperations } from "./utils.js";
12
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/sync/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,QAAQ,EACR,eAAe,EACf,YAAY,EACZ,MAAM,GACP,MAAM,iBAAiB,CAAC;AAEzB,YAAY,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEzD,YAAY,EACV,aAAa,EACb,aAAa,EACb,sBAAsB,EACtB,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,gBAAgB,EAChB,WAAW,GACZ,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAErE,OAAO,EACL,aAAa,EACb,2BAA2B,GAC5B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,cAAc,CAAC;AAEzD,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAEhE,OAAO,EACL,cAAc,EACd,iBAAiB,EACjB,uBAAuB,GACxB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC"}
@@ -1,9 +0,0 @@
1
- export { ChannelErrorSource, SyncOperationStatus } from "./types.js";
2
- export { SyncOperation, SyncOperationAggregateError, } from "./sync-operation.js";
3
- export { Mailbox } from "./mailbox.js";
4
- export { ChannelError, PollingChannelError } from "./errors.js";
5
- export { PollingChannel, GqlChannelFactory, CompositeChannelFactory, } from "./channels/index.js";
6
- export { SyncManager } from "./sync-manager.js";
7
- export { SyncBuilder } from "./sync-builder.js";
8
- export { createIdleHealth, filterOperations } from "./utils.js";
9
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/sync/index.ts"],"names":[],"mappings":"AAuBA,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAErE,OAAO,EACL,aAAa,EACb,2BAA2B,GAC5B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,OAAO,EAAoB,MAAM,cAAc,CAAC;AAEzD,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAEhE,OAAO,EACL,cAAc,EACd,iBAAiB,EACjB,uBAAuB,GACxB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC"}
@@ -1,180 +0,0 @@
1
- import type { ShutdownStatus } from "../shared/types.js";
2
- import type { ISyncCursorStorage } from "../storage/interfaces.js";
3
- import type { SyncOperation } from "./sync-operation.js";
4
- import type { Mailbox } from "./mailbox.js";
5
- import type { ChannelConfig, RemoteFilter, RemoteOptions } from "./types.js";
6
- /**
7
- * Represents a bidirectional synchronization channel between two reactor instances.
8
- *
9
- * A channel manages three mailboxes:
10
- * - inbox: Sync operations received from the remote that need to be applied locally
11
- * - outbox: Sync operations to be sent to the remote
12
- * - deadLetter: Sync operations that failed and cannot be retried
13
- *
14
- * Channels are responsible for:
15
- * - Transporting sync envelopes between reactor instances
16
- * - Managing sync operation lifecycle through status transitions
17
- * - Handling errors and moving failed sync operations to dead letter queue
18
- * - Updating cursors as operations are applied
19
- */
20
- export interface IChannel {
21
- /**
22
- * Mailbox containing sync operations received from the remote that need to be applied locally.
23
- * Consumers should register callbacks via onAdded to process incoming sync operations.
24
- */
25
- inbox: Mailbox<SyncOperation>;
26
- /**
27
- * Mailbox containing sync operations that need to be sent to the remote.
28
- * The channel is responsible for transporting these sync operations and handling ACKs.
29
- */
30
- outbox: Mailbox<SyncOperation>;
31
- /**
32
- * Mailbox containing sync operations that failed and cannot be retried.
33
- * These sync operations require manual intervention or should be logged for debugging.
34
- */
35
- deadLetter: Mailbox<SyncOperation>;
36
- /**
37
- * Initializes the channel asynchronously.
38
- * For remote channels, this typically involves registering the channel on the remote server.
39
- * Must be called after construction before the channel is used.
40
- */
41
- init(): Promise<void>;
42
- /**
43
- * Shuts down the channel and prevents further operations.
44
- */
45
- shutdown(): void;
46
- /**
47
- * Updates the synchronization cursor for this channel.
48
- * For polling channels, this also removes acknowledged operations from the outbox.
49
- *
50
- * @param cursorOrdinal - The last processed ordinal
51
- */
52
- updateCursor(cursorOrdinal: number): Promise<void>;
53
- }
54
- /**
55
- * Factory for creating channel instances.
56
- *
57
- * Different channel implementations (InternalChannel, GqlChannel, etc.) will have
58
- * their own factories that implement this interface.
59
- */
60
- export interface IChannelFactory {
61
- /**
62
- * Creates a new channel instance with the given configuration.
63
- *
64
- * @param remoteId - Unique identifier for the remote
65
- * @param remoteName - Name of the remote
66
- * @param config - Channel configuration including type and parameters
67
- * @param cursorStorage - Storage for persisting synchronization cursors
68
- * @param collectionId - Collection ID to synchronize
69
- * @param filter - Filter to apply to operations
70
- * @returns A new channel instance
71
- */
72
- instance(remoteId: string, remoteName: string, config: ChannelConfig, cursorStorage: ISyncCursorStorage, collectionId: string, filter: RemoteFilter): IChannel;
73
- }
74
- /**
75
- * Represents a configured remote with an active channel.
76
- *
77
- * A remote defines what to synchronize (collectionId, filter) and how to synchronize it (channel).
78
- * The remote name is used as a unique identifier across the system.
79
- */
80
- export type Remote = {
81
- /**
82
- * Unique identifier for this remote.
83
- */
84
- id: string;
85
- /**
86
- * Unique name for this remote.
87
- */
88
- name: string;
89
- /**
90
- * Collection ID to synchronize.
91
- * Typically created via driveCollectionId(branch, documentId) for drive-level sync.
92
- */
93
- collectionId: string;
94
- /**
95
- * Filter to apply to operations.
96
- * Can filter by documentId, scope, and branch.
97
- */
98
- filter: RemoteFilter;
99
- /**
100
- * Additional configuration options for the remote.
101
- */
102
- options: RemoteOptions;
103
- /**
104
- * Active channel for bidirectional communication with the remote.
105
- */
106
- channel: IChannel;
107
- };
108
- /**
109
- * Orchestrates all synchronization activity for a reactor instance.
110
- */
111
- export interface ISyncManager {
112
- /**
113
- * Starts the synchronization manager.
114
- *
115
- * This recreates all remotes from storage and prepares channels for synchronization.
116
- * Each remote's channel will begin processing its inbox/outbox mailboxes.
117
- *
118
- * @returns Promise that resolves when the manager is started
119
- */
120
- startup(): Promise<void>;
121
- /**
122
- * Shuts down the synchronization manager.
123
- *
124
- * This stops all channels, flushes pending operations, and releases resources.
125
- * The shutdown status indicates whether the system was cleanly shut down.
126
- *
127
- * @returns Status object with shutdown information
128
- */
129
- shutdown(): ShutdownStatus;
130
- /**
131
- * Gets a remote by name.
132
- *
133
- * @param name - The name of the remote
134
- * @returns The remote
135
- * @throws Error if the remote does not exist
136
- */
137
- getByName(name: string): Remote;
138
- /**
139
- * Gets a remote by ID.
140
- *
141
- * @param id - The ID of the remote
142
- * @returns The remote
143
- * @throws Error if the remote does not exist
144
- */
145
- getById(id: string): Remote;
146
- /**
147
- * Adds a new remote and starts its channel.
148
- *
149
- * The remote configuration is persisted to storage and a channel is created
150
- * using the appropriate factory. The channel begins processing immediately.
151
- *
152
- * @param name - Unique name for the remote
153
- * @param collectionId - Collection ID to synchronize
154
- * @param channelConfig - Configuration for the channel type and parameters
155
- * @param filter - Optional filter for operations (defaults to no filtering)
156
- * @param options - Optional remote configuration options
157
- * @param id - Optional ID for the remote (generated if not provided)
158
- * @returns Promise that resolves with the created remote
159
- * @throws Error if a remote with this name already exists
160
- */
161
- add(name: string, collectionId: string, channelConfig: ChannelConfig, filter?: RemoteFilter, options?: RemoteOptions, id?: string): Promise<Remote>;
162
- /**
163
- * Removes a remote and stops its channel.
164
- *
165
- * The remote configuration is removed from storage and the channel is shut down.
166
- * Any pending sync operations in the channel's mailboxes will be processed before shutdown.
167
- *
168
- * @param name - The name of the remote to remove
169
- * @returns Promise that resolves when the remote is removed
170
- * @throws Error if the remote does not exist
171
- */
172
- remove(name: string): Promise<void>;
173
- /**
174
- * Lists all configured remotes.
175
- *
176
- * @returns Array of all remotes
177
- */
178
- list(): Remote[];
179
- }
180
- //# sourceMappingURL=interfaces.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/sync/interfaces.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AACnE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE7E;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,QAAQ;IACvB;;;OAGG;IACH,KAAK,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;IAE9B;;;OAGG;IACH,MAAM,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;IAE/B;;;OAGG;IACH,UAAU,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;IAEnC;;;;OAIG;IACH,I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E,MAAM,GACV,OAAO,CAAC,MAAM,CAAC,CAAC;IAEnB;;;;;;;;;OASG;IACH,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEpC;;;;OAIG;IACH,IAAI,IAAI,MAAM,EAAE,CAAC;CAClB"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=interfaces.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/sync/interfaces.ts"],"names":[],"mappings":""}
@@ -1,21 +0,0 @@
1
- export type MailboxItem = {
2
- id: string;
3
- };
4
- type MailboxCallback<T extends MailboxItem> = (item: T) => void;
5
- export declare class MailboxAggregateError extends Error {
6
- errors: Error[];
7
- constructor(errors: Error[]);
8
- }
9
- export declare class Mailbox<T extends MailboxItem> {
10
- private itemsMap;
11
- private addedCallbacks;
12
- private removedCallbacks;
13
- get items(): ReadonlyArray<T>;
14
- get(id: string): T | undefined;
15
- add(item: T): void;
16
- remove(item: T): void;
17
- onAdded(callback: MailboxCallback<T>): void;
18
- onRemoved(callback: MailboxCallback<T>): void;
19
- }
20
- export {};
21
- //# sourceMappingURL=mailbox.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mailbox.d.ts","sourceRoot":"","sources":["../../../src/sync/mailbox.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,WAAW,GAAG;IACxB,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AAEF,KAAK,eAAe,CAAC,CAAC,SAAS,WAAW,IAAI,CAAC,IAAI,EAAE,CAAC,KAAK,IAAI,CAAC;AAEhE,qBAAa,qBAAsB,SAAQ,KAAK;IAC9C,MAAM,EAAE,KAAK,EAAE,CAAC;gBAEJ,MAAM,EAAE,KAAK,EAAE;CAQ5B;AAED,qBAAa,OAAO,CAAC,CAAC,SAAS,WAAW;IACxC,OAAO,CAAC,QAAQ,CAA6B;IAC7C,OAAO,CAAC,cAAc,CAA4B;IAClD,OAAO,CAAC,gBAAgB,CAA4B;IAEpD,IAAI,KAAK,IAAI,aAAa,CAAC,CAAC,CAAC,CAE5B;IAED,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,CAAC,GAAG,SAAS;IAI9B,GAAG,CAAC,IAAI,EAAE,CAAC,GAAG,IAAI;IAgBlB,MAAM,CAAC,IAAI,EAAE,CAAC,GAAG,IAAI;IAgBrB,OAAO,CAAC,QAAQ,EAAE,eAAe,CAAC,CAAC,CAAC,GAAG,IAAI;IAI3C,SAAS,CAAC,QAAQ,EAAE,eAAe,CAAC,CAAC,CAAC,GAAG,IAAI;CAG9C"}
@@ -1,59 +0,0 @@
1
- export class MailboxAggregateError extends Error {
2
- errors;
3
- constructor(errors) {
4
- const messages = errors.map((e) => e.message).join("; ");
5
- super(`Mailbox callback failed with ${errors.length} error(s): ${messages}`);
6
- this.name = "MailboxAggregateError";
7
- this.errors = errors;
8
- }
9
- }
10
- export class Mailbox {
11
- itemsMap = new Map();
12
- addedCallbacks = [];
13
- removedCallbacks = [];
14
- get items() {
15
- return Array.from(this.itemsMap.values());
16
- }
17
- get(id) {
18
- return this.itemsMap.get(id);
19
- }
20
- add(item) {
21
- this.itemsMap.set(item.id, item);
22
- const callbacks = [...this.addedCallbacks];
23
- const errors = [];
24
- for (const callback of callbacks) {
25
- try {
26
- callback(item);
27
- }
28
- catch (error) {
29
- errors.push(error instanceof Error ? error : new Error(String(error)));
30
- }
31
- }
32
- if (errors.length > 0) {
33
- throw new MailboxAggregateError(errors);
34
- }
35
- }
36
- remove(item) {
37
- this.itemsMap.delete(item.id);
38
- const callbacks = [...this.removedCallbacks];
39
- const errors = [];
40
- for (const callback of callbacks) {
41
- try {
42
- callback(item);
43
- }
44
- catch (error) {
45
- errors.push(error instanceof Error ? error : new Error(String(error)));
46
- }
47
- }
48
- if (errors.length > 0) {
49
- throw new MailboxAggregateError(errors);
50
- }
51
- }
52
- onAdded(callback) {
53
- this.addedCallbacks.push(callback);
54
- }
55
- onRemoved(callback) {
56
- this.removedCallbacks.push(callback);
57
- }
58
- }
59
- //# sourceMappingURL=mailbox.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mailbox.js","sourceRoot":"","sources":["../../../src/sync/mailbox.ts"],"names":[],"mappings":"AAMA,MAAM,OAAO,qBAAsB,SAAQ,KAAK;IAC9C,MAAM,CAAU;IAEhB,YAAY,MAAe;QACzB,MAAM,QAAQ,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACzD,KAAK,CACH,gCAAgC,MAAM,CAAC,MAAM,cAAc,QAAQ,EAAE,CACtE,CAAC;QACF,IAAI,CAAC,IAAI,GAAG,uBAAuB,CAAC;QACpC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;CACF;AAED,MAAM,OAAO,OAAO;IACV,QAAQ,GAAmB,IAAI,GAAG,EAAE,CAAC;IACrC,cAAc,GAAyB,EAAE,CAAC;IAC1C,gBAAgB,GAAyB,EAAE,CAAC;IAEpD,IAAI,KAAK;QACP,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC;IAC5C,CAAC;IAED,GAAG,CAAC,EAAU;QACZ,OAAO,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAC/B,CAAC;IAED,GAAG,CAAC,IAAO;QACT,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC;QACjC,MAAM,SAAS,GAAG,CAAC,GAAG,IAAI,CAAC,cAAc,CAAC,CAAC;QAC3C,MAAM,MAAM,GAAY,EAAE,CAAC;QAC3B,KAAK,MAAM,QAAQ,IAAI,SAAS,EAAE,CAAC;YACjC,IAAI,CAAC;gBACH,QAAQ,CAAC,IAAI,CAAC,CAAC;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from "kysely";
2
- import type { IOperationIndex } from "../cache/operation-index-types.js";
3
- import type { IReactor, SyncModule } from "../core/types.js";
4
- import type { IEventBus } from "../events/interfaces.js";
5
- import type { ILogger } from "../logging/types.js";
6
- import type { ISyncCursorStorage, ISyncRemoteStorage } from "../storage/interfaces.js";
7
- import type { Database } from "../storage/kysely/types.js";
8
- import type { IChannelFactory, ISyncManager } from "./interfaces.js";
9
- export declare class SyncBuilder {
10
- private channelFactory?;
11
- private remoteStorage?;
12
- private cursorStorage?;
13
- withChannelFactory(factory: IChannelFactory): this;
14
- withRemoteStorage(storage: ISyncRemoteStorage): this;
15
- withCursorStorage(storage: ISyncCursorStorage): this;
16
- build(reactor: IReactor, logger: ILogger, operationIndex: IOperationIndex, eventBus: IEventBus, db: Kysely<Database>): ISyncManager;
17
- buildModule(reactor: IReactor, logger: ILogger, operationIndex: IOperationIndex, eventBus: IEventBus, db: Kysely<Database>): SyncModule;
18
- }
19
- //# sourceMappingURL=sync-builder.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sync-builder.d.ts","sourceRoot":"","sources":["../../../src/sync/sync-builder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACrC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,KAAK,EACV,kBAAkB,EAClB,kBAAkB,EACnB,MAAM,0BAA0B,CAAC;AAGlC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAGrE,qBAAa,WAAW;IACtB,OAAO,CAAC,cAAc,CAAC,CAAkB;IACzC,OAAO,CAAC,aAAa,CAAC,CAAqB;IAC3C,OAAO,CAAC,aAAa,CAAC,CAAqB;IAE3C,kBAAkB,CAAC,OAAO,EAAE,eAAe,GAAG,IAAI;IAKlD,iBAAiB,CAAC,OAAO,EAAE,kBAAkB,GAAG,IAAI;IAKpD,iBAAiB,CAAC,OAAO,EAAE,kBAAkB,GAAG,IAAI;IAKpD,KAAK,CACH,OAAO,EAAE,QAAQ,EACjB,MAAM,EAAE,OAAO,EACf,cAAc,EAAE,eAAe,EAC/B,QAAQ,EAAE,SAAS,EACnB,EAAE,EAAE,MAAM,CAAC,QAAQ,CAAC,GACnB,YAAY;IAWf,WAAW,CACT,OAAO,EAAE,QAAQ,EACjB,MAAM,EAAE,OAAO,EACf,cAAc,EAAE,eAAe,EAC/B,QAAQ,EAAE,SAAS,EACnB,EAAE,EAAE,MAAM,CAAC,QAAQ,CAAC,GACnB,UAAU;CAyBd"}
@@ -1,39 +0,0 @@
1
- import { KyselySyncCursorStorage } from "../storage/kysely/sync-cursor-storage.js";
2
- import { KyselySyncRemoteStorage } from "../storage/kysely/sync-remote-storage.js";
3
- import { SyncManager } from "./sync-manager.js";
4
- export class SyncBuilder {
5
- channelFactory;
6
- remoteStorage;
7
- cursorStorage;
8
- withChannelFactory(factory) {
9
- this.channelFactory = factory;
10
- return this;
11
- }
12
- withRemoteStorage(storage) {
13
- this.remoteStorage = storage;
14
- return this;
15
- }
16
- withCursorStorage(storage) {
17
- this.cursorStorage = storage;
18
- return this;
19
- }
20
- build(reactor, logger, operationIndex, eventBus, db) {
21
- const module = this.buildModule(reactor, logger, operationIndex, eventBus, db);
22
- return module.syncManager;
23
- }
24
- buildModule(reactor, logger, operationIndex, eventBus, db) {
25
- if (!this.channelFactory) {
26
- throw new Error("Channel factory is required");
27
- }
28
- const remoteStorage = this.remoteStorage ?? new KyselySyncRemoteStorage(db);
29
- const cursorStorage = this.cursorStorage ?? new KyselySyncCursorStorage(db);
30
- const syncManager = new SyncManager(logger, remoteStorage, cursorStorage, this.channelFactory, operationIndex, reactor, eventBus);
31
- return {
32
- remoteStorage,
33
- cursorStorage,
34
- channelFactory: this.channelFactory,
35
- syncManager,
36
- };
37
- }
38
- }
39
- //# sourceMappingURL=sync-builder.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sync-builder.js","sourceRoot":"","sources":["../../../src/sync/sync-builder.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,uBAAuB,EAAE,MAAM,0CAA0C,CAAC;AACnF,OAAO,EAAE,uBAAuB,EAAE,MAAM,0CAA0C,CAAC;AAGnF,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,MAAM,OAAO,WAAW;IACd,cAAc,CAAmB;IACjC,aAAa,CAAsB;IACnC,aAAa,CAAsB;IAE3C,kBAAkB,CAAC,OAAwB;QACzC,IAAI,CAAC,cAAc,GAAG,OAAO,CAAC;QAC9B,OAAO,IAAI,CAAC;IACd,CAAC;IAED,iBAAiB,CAAC,OAA2B;QAC3C,IAAI,CAAC,aAAa,GAAG,OAAO,CAAC;QAC7B,OAAO,IAAI,CAAC;IACd,CAAC;IAED,iBAAiB,CAAC,OAA2B;QAC3C,IAAI,CAAC,aAAa,GAAG,OAAO,CAAC;QAC7B,OAAO,IAAI,CAAC;IACd,CAAC;IAED,KAAK,CACH,OAAiB,EACjB,MAAe,EACf,cAA+B,EAC/B,QAAmB,EACnB,EAAoB;QAEpB,MAAM,MAAM,GAAG,IAAI,CAAC,WAAW,CAC7B,OAAO,EACP,MAAM,EACN,cAAc,EACd,QAAQ,EACR,EAAE,CACH,CAAC;QACF,OAAO,MAAM,CAAC,WAAW,CAAC;IAC5B,CAAC;IAED,WAAW,CACT,OAAiB,EACjB,MAAe,EACf,cAA+B,EAC/B,QAAmB,EACnB,EAAoB;QAEpB,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,CAAC;YACzB,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAC;QACjD,CAAC;QAED,MAAM,aAAa,GAAG,IAAI,CAAC,aAAa,IAAI,IAAI,uBAAuB,CAAC,EAAE,CAAC,CAAC;QAC5E,MAAM,aAAa,GAAG,IAAI,CAAC,aAAa,IAAI,IAAI,uBAAuB,CAAC,EAAE,CAAC,CAAC;QAE5E,MAAM,WAAW,GAAG,IAAI,WAAW,CACjC,MAAM,EACN,aAAa,EACb,aAAa,EACb,IAAI,CAAC,cAAc,EACnB,cAAc,EACd,OAAO,EACP,QAAQ,CACT,CAAC;QAEF,OAAO;YACL,aAAa;YACb,aAAa;YACb,cAAc,EAAE,IAAI,CAAC,cAAc;YACnC,WAAW;SACZ,CAAC;IACJ,CAAC;CACF"}
@@ -1,37 +0,0 @@
1
- import type { IOperationIndex } from "../cache/operation-index-types.js";
2
- import type { IReactor } from "../core/types.js";
3
- import type { IEventBus } from "../events/interfaces.js";
4
- import type { ILogger } from "../logging/types.js";
5
- import { type JobInfo, type ShutdownStatus } from "../shared/types.js";
6
- import type { ISyncCursorStorage, ISyncRemoteStorage } from "../storage/interfaces.js";
7
- import type { IChannelFactory, ISyncManager, Remote } from "./interfaces.js";
8
- import type { ChannelConfig, RemoteFilter, RemoteOptions } from "./types.js";
9
- export declare class SyncManager implements ISyncManager {
10
- private readonly logger;
11
- private readonly remoteStorage;
12
- private readonly cursorStorage;
13
- private readonly channelFactory;
14
- private readonly _operationIndex;
15
- private readonly reactor;
16
- private readonly eventBus;
17
- private readonly remotes;
18
- private readonly awaiter;
19
- private isShutdown;
20
- private eventUnsubscribe?;
21
- loadJobs: Map<string, JobInfo>;
22
- constructor(logger: ILogger, remoteStorage: ISyncRemoteStorage, cursorStorage: ISyncCursorStorage, channelFactory: IChannelFactory, operationIndex: IOperationIndex, reactor: IReactor, eventBus: IEventBus);
23
- startup(): Promise<void>;
24
- shutdown(): ShutdownStatus;
25
- getByName(name: string): Remote;
26
- getById(id: string): Remote;
27
- add(name: string, collectionId: string, channelConfig: ChannelConfig, filter?: RemoteFilter, options?: RemoteOptions, id?: string): Promise<Remote>;
28
- private backfillOutbox;
29
- remove(name: string): Promise<void>;
30
- list(): Remote[];
31
- private wireChannelCallbacks;
32
- private handleOperationWritten;
33
- private handleInboxJob;
34
- private handleOutboxJob;
35
- private applyInboxJob;
36
- }
37
- //# sourceMappingURL=sync-manager.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sync-manager.d.ts","sourceRoot":"","sources":["../../../src/sync/sync-manager.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAKzD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAEnD,OAAO,EAEL,KAAK,OAAO,EACZ,KAAK,cAAc,EACpB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EACV,kBAAkB,EAClB,kBAAkB,EACnB,MAAM,0BAA0B,CAAC;AAElC,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAE7E,OAAO,KAAK,EACV,aAAa,EACb,YAAY,EACZ,aAAa,EAGd,MAAM,YAAY,CAAC;AAQpB,qBAAa,WAAY,YAAW,YAAY;IAC9C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAU;IACjC,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAqB;IACnD,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAqB;IACnD,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAkB;IACjD,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAkB;IAClD,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAW;IACnC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAY;IACrC,OAAO,CAAC,QAAQ,CAAC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