actor-ts 0.9.0 → 0.10.0

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 (886) hide show
  1. package/CHANGELOG.md +408 -0
  2. package/README.md +285 -269
  3. package/dist/ActorSystem.d.ts +3 -38
  4. package/dist/ActorSystem.d.ts.map +1 -1
  5. package/dist/ActorSystem.js +2 -2
  6. package/dist/ActorSystem.js.map +1 -1
  7. package/dist/ActorSystemOptions.d.ts +91 -0
  8. package/dist/ActorSystemOptions.d.ts.map +1 -0
  9. package/dist/ActorSystemOptions.js +45 -0
  10. package/dist/ActorSystemOptions.js.map +1 -0
  11. package/dist/Logger.d.ts +63 -0
  12. package/dist/Logger.d.ts.map +1 -1
  13. package/dist/Logger.js +146 -0
  14. package/dist/Logger.js.map +1 -1
  15. package/dist/cache/MemcachedCache.d.ts +2 -12
  16. package/dist/cache/MemcachedCache.d.ts.map +1 -1
  17. package/dist/cache/MemcachedCache.js +2 -1
  18. package/dist/cache/MemcachedCache.js.map +1 -1
  19. package/dist/cache/MemcachedCacheOptions.d.ts +40 -0
  20. package/dist/cache/MemcachedCacheOptions.d.ts.map +1 -0
  21. package/dist/cache/MemcachedCacheOptions.js +32 -0
  22. package/dist/cache/MemcachedCacheOptions.js.map +1 -0
  23. package/dist/cache/RedisCache.d.ts +2 -22
  24. package/dist/cache/RedisCache.d.ts.map +1 -1
  25. package/dist/cache/RedisCache.js +2 -1
  26. package/dist/cache/RedisCache.js.map +1 -1
  27. package/dist/cache/RedisCacheOptions.d.ts +56 -0
  28. package/dist/cache/RedisCacheOptions.d.ts.map +1 -0
  29. package/dist/cache/RedisCacheOptions.js +43 -0
  30. package/dist/cache/RedisCacheOptions.js.map +1 -0
  31. package/dist/cache/index.d.ts +6 -2
  32. package/dist/cache/index.d.ts.map +1 -1
  33. package/dist/cache/index.js +2 -0
  34. package/dist/cache/index.js.map +1 -1
  35. package/dist/cluster/Cluster.d.ts +4 -63
  36. package/dist/cluster/Cluster.d.ts.map +1 -1
  37. package/dist/cluster/Cluster.js +10 -5
  38. package/dist/cluster/Cluster.js.map +1 -1
  39. package/dist/cluster/ClusterBootstrap.d.ts +6 -84
  40. package/dist/cluster/ClusterBootstrap.d.ts.map +1 -1
  41. package/dist/cluster/ClusterBootstrap.js +33 -21
  42. package/dist/cluster/ClusterBootstrap.js.map +1 -1
  43. package/dist/cluster/ClusterBootstrapOptions.d.ts +152 -0
  44. package/dist/cluster/ClusterBootstrapOptions.d.ts.map +1 -0
  45. package/dist/cluster/ClusterBootstrapOptions.js +103 -0
  46. package/dist/cluster/ClusterBootstrapOptions.js.map +1 -0
  47. package/dist/cluster/ClusterClient.d.ts +21 -31
  48. package/dist/cluster/ClusterClient.d.ts.map +1 -1
  49. package/dist/cluster/ClusterClient.js +21 -6
  50. package/dist/cluster/ClusterClient.js.map +1 -1
  51. package/dist/cluster/ClusterClientOptions.d.ts +65 -0
  52. package/dist/cluster/ClusterClientOptions.d.ts.map +1 -0
  53. package/dist/cluster/ClusterClientOptions.js +43 -0
  54. package/dist/cluster/ClusterClientOptions.js.map +1 -0
  55. package/dist/cluster/ClusterClientReceptionist.d.ts +2 -8
  56. package/dist/cluster/ClusterClientReceptionist.d.ts.map +1 -1
  57. package/dist/cluster/ClusterClientReceptionist.js +3 -1
  58. package/dist/cluster/ClusterClientReceptionist.js.map +1 -1
  59. package/dist/cluster/ClusterClientReceptionistOptions.d.ts +32 -0
  60. package/dist/cluster/ClusterClientReceptionistOptions.d.ts.map +1 -0
  61. package/dist/cluster/ClusterClientReceptionistOptions.js +22 -0
  62. package/dist/cluster/ClusterClientReceptionistOptions.js.map +1 -0
  63. package/dist/cluster/ClusterOptions.d.ts +116 -0
  64. package/dist/cluster/ClusterOptions.d.ts.map +1 -0
  65. package/dist/cluster/ClusterOptions.js +77 -0
  66. package/dist/cluster/ClusterOptions.js.map +1 -0
  67. package/dist/cluster/FailureDetector.d.ts +4 -11
  68. package/dist/cluster/FailureDetector.d.ts.map +1 -1
  69. package/dist/cluster/FailureDetector.js +4 -3
  70. package/dist/cluster/FailureDetector.js.map +1 -1
  71. package/dist/cluster/FailureDetectorOptions.d.ts +38 -0
  72. package/dist/cluster/FailureDetectorOptions.d.ts.map +1 -0
  73. package/dist/cluster/FailureDetectorOptions.js +31 -0
  74. package/dist/cluster/FailureDetectorOptions.js.map +1 -0
  75. package/dist/cluster/PhiAccrualFailureDetector.d.ts +3 -19
  76. package/dist/cluster/PhiAccrualFailureDetector.d.ts.map +1 -1
  77. package/dist/cluster/PhiAccrualFailureDetector.js +2 -2
  78. package/dist/cluster/PhiAccrualFailureDetector.js.map +1 -1
  79. package/dist/cluster/PhiAccrualOptions.d.ts +53 -0
  80. package/dist/cluster/PhiAccrualOptions.d.ts.map +1 -0
  81. package/dist/cluster/PhiAccrualOptions.js +43 -0
  82. package/dist/cluster/PhiAccrualOptions.js.map +1 -0
  83. package/dist/cluster/downing/KeepOldest.d.ts +2 -11
  84. package/dist/cluster/downing/KeepOldest.d.ts.map +1 -1
  85. package/dist/cluster/downing/KeepOldest.js +2 -2
  86. package/dist/cluster/downing/KeepOldest.js.map +1 -1
  87. package/dist/cluster/downing/KeepOldestOptions.d.ts +34 -0
  88. package/dist/cluster/downing/KeepOldestOptions.d.ts.map +1 -0
  89. package/dist/cluster/downing/KeepOldestOptions.js +23 -0
  90. package/dist/cluster/downing/KeepOldestOptions.js.map +1 -0
  91. package/dist/cluster/downing/KeepReferee.d.ts +2 -10
  92. package/dist/cluster/downing/KeepReferee.d.ts.map +1 -1
  93. package/dist/cluster/downing/KeepReferee.js +3 -3
  94. package/dist/cluster/downing/KeepReferee.js.map +1 -1
  95. package/dist/cluster/downing/KeepRefereeOptions.d.ts +35 -0
  96. package/dist/cluster/downing/KeepRefereeOptions.d.ts.map +1 -0
  97. package/dist/cluster/downing/KeepRefereeOptions.js +25 -0
  98. package/dist/cluster/downing/KeepRefereeOptions.js.map +1 -0
  99. package/dist/cluster/downing/LeaseMajority.d.ts +63 -21
  100. package/dist/cluster/downing/LeaseMajority.d.ts.map +1 -1
  101. package/dist/cluster/downing/LeaseMajority.js +132 -9
  102. package/dist/cluster/downing/LeaseMajority.js.map +1 -1
  103. package/dist/cluster/downing/LeaseMajorityOptions.d.ts +49 -0
  104. package/dist/cluster/downing/LeaseMajorityOptions.d.ts.map +1 -0
  105. package/dist/cluster/downing/LeaseMajorityOptions.js +31 -0
  106. package/dist/cluster/downing/LeaseMajorityOptions.js.map +1 -0
  107. package/dist/cluster/downing/StaticQuorum.d.ts +2 -7
  108. package/dist/cluster/downing/StaticQuorum.d.ts.map +1 -1
  109. package/dist/cluster/downing/StaticQuorum.js +3 -3
  110. package/dist/cluster/downing/StaticQuorum.js.map +1 -1
  111. package/dist/cluster/downing/StaticQuorumOptions.d.ts +30 -0
  112. package/dist/cluster/downing/StaticQuorumOptions.d.ts.map +1 -0
  113. package/dist/cluster/downing/StaticQuorumOptions.js +23 -0
  114. package/dist/cluster/downing/StaticQuorumOptions.js.map +1 -0
  115. package/dist/cluster/downing/index.d.ts +8 -4
  116. package/dist/cluster/downing/index.d.ts.map +1 -1
  117. package/dist/cluster/downing/index.js +4 -0
  118. package/dist/cluster/downing/index.js.map +1 -1
  119. package/dist/cluster/index.d.ts +34 -19
  120. package/dist/cluster/index.d.ts.map +1 -1
  121. package/dist/cluster/index.js +15 -4
  122. package/dist/cluster/index.js.map +1 -1
  123. package/dist/cluster/pubsub/DistributedPubSubExtension.d.ts +2 -2
  124. package/dist/cluster/pubsub/DistributedPubSubExtension.d.ts.map +1 -1
  125. package/dist/cluster/pubsub/DistributedPubSubExtension.js +5 -2
  126. package/dist/cluster/pubsub/DistributedPubSubExtension.js.map +1 -1
  127. package/dist/cluster/pubsub/DistributedPubSubMediator.d.ts +3 -7
  128. package/dist/cluster/pubsub/DistributedPubSubMediator.d.ts.map +1 -1
  129. package/dist/cluster/pubsub/DistributedPubSubMediator.js +3 -3
  130. package/dist/cluster/pubsub/DistributedPubSubMediator.js.map +1 -1
  131. package/dist/cluster/pubsub/DistributedPubSubOptions.d.ts +29 -0
  132. package/dist/cluster/pubsub/DistributedPubSubOptions.d.ts.map +1 -0
  133. package/dist/cluster/pubsub/DistributedPubSubOptions.js +23 -0
  134. package/dist/cluster/pubsub/DistributedPubSubOptions.js.map +1 -0
  135. package/dist/cluster/pubsub/index.d.ts +2 -1
  136. package/dist/cluster/pubsub/index.d.ts.map +1 -1
  137. package/dist/cluster/pubsub/index.js +1 -0
  138. package/dist/cluster/pubsub/index.js.map +1 -1
  139. package/dist/cluster/router/ClusterRouter.d.ts +12 -32
  140. package/dist/cluster/router/ClusterRouter.d.ts.map +1 -1
  141. package/dist/cluster/router/ClusterRouter.js +4 -2
  142. package/dist/cluster/router/ClusterRouter.js.map +1 -1
  143. package/dist/cluster/router/ClusterRouterOptions.d.ts +60 -0
  144. package/dist/cluster/router/ClusterRouterOptions.d.ts.map +1 -0
  145. package/dist/cluster/router/ClusterRouterOptions.js +41 -0
  146. package/dist/cluster/router/ClusterRouterOptions.js.map +1 -0
  147. package/dist/cluster/router/index.d.ts +3 -1
  148. package/dist/cluster/router/index.d.ts.map +1 -1
  149. package/dist/cluster/router/index.js +1 -0
  150. package/dist/cluster/router/index.js.map +1 -1
  151. package/dist/cluster/sharding/CassandraRememberEntitiesStore.d.ts +1 -15
  152. package/dist/cluster/sharding/CassandraRememberEntitiesStore.d.ts.map +1 -1
  153. package/dist/cluster/sharding/CassandraRememberEntitiesStore.js +35 -2
  154. package/dist/cluster/sharding/CassandraRememberEntitiesStore.js.map +1 -1
  155. package/dist/cluster/sharding/CassandraRememberEntitiesStoreOptions.d.ts +63 -0
  156. package/dist/cluster/sharding/CassandraRememberEntitiesStoreOptions.d.ts.map +1 -0
  157. package/dist/cluster/sharding/CassandraRememberEntitiesStoreOptions.js +63 -0
  158. package/dist/cluster/sharding/CassandraRememberEntitiesStoreOptions.js.map +1 -0
  159. package/dist/cluster/sharding/ClusterSharding.d.ts +18 -64
  160. package/dist/cluster/sharding/ClusterSharding.d.ts.map +1 -1
  161. package/dist/cluster/sharding/ClusterSharding.js +44 -20
  162. package/dist/cluster/sharding/ClusterSharding.js.map +1 -1
  163. package/dist/cluster/sharding/CoordinatorState.d.ts +1 -1
  164. package/dist/cluster/sharding/CoordinatorState.js +1 -1
  165. package/dist/cluster/sharding/ShardCoordinator.d.ts +3 -63
  166. package/dist/cluster/sharding/ShardCoordinator.d.ts.map +1 -1
  167. package/dist/cluster/sharding/ShardCoordinator.js +3 -3
  168. package/dist/cluster/sharding/ShardCoordinator.js.map +1 -1
  169. package/dist/cluster/sharding/ShardCoordinatorOptions.d.ts +111 -0
  170. package/dist/cluster/sharding/ShardCoordinatorOptions.d.ts.map +1 -0
  171. package/dist/cluster/sharding/ShardCoordinatorOptions.js +69 -0
  172. package/dist/cluster/sharding/ShardCoordinatorOptions.js.map +1 -0
  173. package/dist/cluster/sharding/ShardRegion.d.ts +2 -33
  174. package/dist/cluster/sharding/ShardRegion.d.ts.map +1 -1
  175. package/dist/cluster/sharding/ShardRegion.js.map +1 -1
  176. package/dist/cluster/sharding/ShardedDaemonProcess.d.ts +2 -22
  177. package/dist/cluster/sharding/ShardedDaemonProcess.d.ts.map +1 -1
  178. package/dist/cluster/sharding/ShardedDaemonProcess.js +14 -11
  179. package/dist/cluster/sharding/ShardedDaemonProcess.js.map +1 -1
  180. package/dist/cluster/sharding/ShardedDaemonProcessOptions.d.ts +51 -0
  181. package/dist/cluster/sharding/ShardedDaemonProcessOptions.d.ts.map +1 -0
  182. package/dist/cluster/sharding/ShardedDaemonProcessOptions.js +35 -0
  183. package/dist/cluster/sharding/ShardedDaemonProcessOptions.js.map +1 -0
  184. package/dist/cluster/sharding/ShardingOptions.d.ts +84 -0
  185. package/dist/cluster/sharding/ShardingOptions.d.ts.map +1 -0
  186. package/dist/cluster/sharding/ShardingOptions.js +62 -0
  187. package/dist/cluster/sharding/ShardingOptions.js.map +1 -0
  188. package/dist/cluster/sharding/StartShardingOptions.d.ts +98 -0
  189. package/dist/cluster/sharding/StartShardingOptions.d.ts.map +1 -0
  190. package/dist/cluster/sharding/StartShardingOptions.js +52 -0
  191. package/dist/cluster/sharding/StartShardingOptions.js.map +1 -0
  192. package/dist/cluster/singleton/ClusterSingleton.d.ts +2 -30
  193. package/dist/cluster/singleton/ClusterSingleton.d.ts.map +1 -1
  194. package/dist/cluster/singleton/ClusterSingleton.js +15 -9
  195. package/dist/cluster/singleton/ClusterSingleton.js.map +1 -1
  196. package/dist/cluster/singleton/ClusterSingletonManager.d.ts +3 -18
  197. package/dist/cluster/singleton/ClusterSingletonManager.d.ts.map +1 -1
  198. package/dist/cluster/singleton/ClusterSingletonManager.js +3 -3
  199. package/dist/cluster/singleton/ClusterSingletonManager.js.map +1 -1
  200. package/dist/cluster/singleton/ClusterSingletonManagerOptions.d.ts +49 -0
  201. package/dist/cluster/singleton/ClusterSingletonManagerOptions.d.ts.map +1 -0
  202. package/dist/cluster/singleton/ClusterSingletonManagerOptions.js +40 -0
  203. package/dist/cluster/singleton/ClusterSingletonManagerOptions.js.map +1 -0
  204. package/dist/cluster/singleton/StartSingletonOptions.d.ts +64 -0
  205. package/dist/cluster/singleton/StartSingletonOptions.d.ts.map +1 -0
  206. package/dist/cluster/singleton/StartSingletonOptions.js +40 -0
  207. package/dist/cluster/singleton/StartSingletonOptions.js.map +1 -0
  208. package/dist/cluster/singleton/index.d.ts +6 -2
  209. package/dist/cluster/singleton/index.d.ts.map +1 -1
  210. package/dist/cluster/singleton/index.js +2 -0
  211. package/dist/cluster/singleton/index.js.map +1 -1
  212. package/dist/config/ConfigKeys.d.ts +5 -0
  213. package/dist/config/ConfigKeys.d.ts.map +1 -1
  214. package/dist/config/ConfigKeys.js +5 -0
  215. package/dist/config/ConfigKeys.js.map +1 -1
  216. package/dist/coordination/Lease.d.ts +32 -14
  217. package/dist/coordination/Lease.d.ts.map +1 -1
  218. package/dist/coordination/LeaseOptions.d.ts +61 -0
  219. package/dist/coordination/LeaseOptions.d.ts.map +1 -0
  220. package/dist/coordination/LeaseOptions.js +50 -0
  221. package/dist/coordination/LeaseOptions.js.map +1 -0
  222. package/dist/coordination/index.d.ts +5 -2
  223. package/dist/coordination/index.d.ts.map +1 -1
  224. package/dist/coordination/index.js +2 -0
  225. package/dist/coordination/index.js.map +1 -1
  226. package/dist/coordination/leases/InMemoryLease.d.ts +18 -5
  227. package/dist/coordination/leases/InMemoryLease.d.ts.map +1 -1
  228. package/dist/coordination/leases/InMemoryLease.js +23 -11
  229. package/dist/coordination/leases/InMemoryLease.js.map +1 -1
  230. package/dist/coordination/leases/KubernetesLease.d.ts +19 -24
  231. package/dist/coordination/leases/KubernetesLease.d.ts.map +1 -1
  232. package/dist/coordination/leases/KubernetesLease.js +28 -9
  233. package/dist/coordination/leases/KubernetesLease.js.map +1 -1
  234. package/dist/coordination/leases/KubernetesLeaseOptions.d.ts +58 -0
  235. package/dist/coordination/leases/KubernetesLeaseOptions.d.ts.map +1 -0
  236. package/dist/coordination/leases/KubernetesLeaseOptions.js +42 -0
  237. package/dist/coordination/leases/KubernetesLeaseOptions.js.map +1 -0
  238. package/dist/crdt/DistributedData.d.ts +2 -22
  239. package/dist/crdt/DistributedData.d.ts.map +1 -1
  240. package/dist/crdt/DistributedData.js +3 -2
  241. package/dist/crdt/DistributedData.js.map +1 -1
  242. package/dist/crdt/DistributedDataOptions.d.ts +50 -0
  243. package/dist/crdt/DistributedDataOptions.d.ts.map +1 -0
  244. package/dist/crdt/DistributedDataOptions.js +28 -0
  245. package/dist/crdt/DistributedDataOptions.js.map +1 -0
  246. package/dist/crdt/index.d.ts +3 -1
  247. package/dist/crdt/index.d.ts.map +1 -1
  248. package/dist/crdt/index.js +1 -0
  249. package/dist/crdt/index.js.map +1 -1
  250. package/dist/delivery/ProducerController.d.ts +4 -19
  251. package/dist/delivery/ProducerController.d.ts.map +1 -1
  252. package/dist/delivery/ProducerController.js +4 -3
  253. package/dist/delivery/ProducerController.js.map +1 -1
  254. package/dist/delivery/ProducerControllerOptions.d.ts +50 -0
  255. package/dist/delivery/ProducerControllerOptions.d.ts.map +1 -0
  256. package/dist/delivery/ProducerControllerOptions.js +36 -0
  257. package/dist/delivery/ProducerControllerOptions.js.map +1 -0
  258. package/dist/delivery/ReliableDelivery.d.ts +3 -2
  259. package/dist/delivery/ReliableDelivery.d.ts.map +1 -1
  260. package/dist/delivery/ReliableDelivery.js +2 -2
  261. package/dist/delivery/ReliableDelivery.js.map +1 -1
  262. package/dist/delivery/index.d.ts +3 -1
  263. package/dist/delivery/index.d.ts.map +1 -1
  264. package/dist/delivery/index.js +1 -0
  265. package/dist/delivery/index.js.map +1 -1
  266. package/dist/discovery/AutoDiscoveryOptions.d.ts +72 -0
  267. package/dist/discovery/AutoDiscoveryOptions.d.ts.map +1 -0
  268. package/dist/discovery/AutoDiscoveryOptions.js +34 -0
  269. package/dist/discovery/AutoDiscoveryOptions.js.map +1 -0
  270. package/dist/discovery/ConfigSeedProvider.d.ts +2 -7
  271. package/dist/discovery/ConfigSeedProvider.d.ts.map +1 -1
  272. package/dist/discovery/ConfigSeedProvider.js +4 -3
  273. package/dist/discovery/ConfigSeedProvider.js.map +1 -1
  274. package/dist/discovery/ConfigSeedProviderOptions.d.ts +34 -0
  275. package/dist/discovery/ConfigSeedProviderOptions.d.ts.map +1 -0
  276. package/dist/discovery/ConfigSeedProviderOptions.js +27 -0
  277. package/dist/discovery/ConfigSeedProviderOptions.js.map +1 -0
  278. package/dist/discovery/DnsSeedProvider.d.ts +3 -27
  279. package/dist/discovery/DnsSeedProvider.d.ts.map +1 -1
  280. package/dist/discovery/DnsSeedProvider.js +4 -4
  281. package/dist/discovery/DnsSeedProvider.js.map +1 -1
  282. package/dist/discovery/DnsSeedProviderOptions.d.ts +67 -0
  283. package/dist/discovery/DnsSeedProviderOptions.d.ts.map +1 -0
  284. package/dist/discovery/DnsSeedProviderOptions.js +48 -0
  285. package/dist/discovery/DnsSeedProviderOptions.js.map +1 -0
  286. package/dist/discovery/KubernetesApiSeedProvider.d.ts +2 -13
  287. package/dist/discovery/KubernetesApiSeedProvider.d.ts.map +1 -1
  288. package/dist/discovery/KubernetesApiSeedProvider.js +2 -2
  289. package/dist/discovery/KubernetesApiSeedProvider.js.map +1 -1
  290. package/dist/discovery/KubernetesApiSeedProviderOptions.d.ts +46 -0
  291. package/dist/discovery/KubernetesApiSeedProviderOptions.d.ts.map +1 -0
  292. package/dist/discovery/KubernetesApiSeedProviderOptions.js +39 -0
  293. package/dist/discovery/KubernetesApiSeedProviderOptions.js.map +1 -0
  294. package/dist/discovery/Receptionist.d.ts +3 -6
  295. package/dist/discovery/Receptionist.d.ts.map +1 -1
  296. package/dist/discovery/Receptionist.js +10 -3
  297. package/dist/discovery/Receptionist.js.map +1 -1
  298. package/dist/discovery/ReceptionistOptions.d.ts +30 -0
  299. package/dist/discovery/ReceptionistOptions.d.ts.map +1 -0
  300. package/dist/discovery/ReceptionistOptions.js +24 -0
  301. package/dist/discovery/ReceptionistOptions.js.map +1 -0
  302. package/dist/discovery/autoDiscovery.d.ts +3 -44
  303. package/dist/discovery/autoDiscovery.d.ts.map +1 -1
  304. package/dist/discovery/autoDiscovery.js +31 -32
  305. package/dist/discovery/autoDiscovery.js.map +1 -1
  306. package/dist/discovery/index.d.ts +10 -5
  307. package/dist/discovery/index.d.ts.map +1 -1
  308. package/dist/discovery/index.js +5 -0
  309. package/dist/discovery/index.js.map +1 -1
  310. package/dist/http/HttpExtension.d.ts.map +1 -1
  311. package/dist/http/HttpExtension.js +69 -8
  312. package/dist/http/HttpExtension.js.map +1 -1
  313. package/dist/http/Route.d.ts +76 -4
  314. package/dist/http/Route.d.ts.map +1 -1
  315. package/dist/http/Route.js +74 -1
  316. package/dist/http/Route.js.map +1 -1
  317. package/dist/http/backend/ExpressBackend.d.ts +18 -12
  318. package/dist/http/backend/ExpressBackend.d.ts.map +1 -1
  319. package/dist/http/backend/ExpressBackend.js +134 -8
  320. package/dist/http/backend/ExpressBackend.js.map +1 -1
  321. package/dist/http/backend/ExpressBackendOptions.d.ts +47 -0
  322. package/dist/http/backend/ExpressBackendOptions.d.ts.map +1 -0
  323. package/dist/http/backend/ExpressBackendOptions.js +35 -0
  324. package/dist/http/backend/ExpressBackendOptions.js.map +1 -0
  325. package/dist/http/backend/FastifyBackend.d.ts +4 -1
  326. package/dist/http/backend/FastifyBackend.d.ts.map +1 -1
  327. package/dist/http/backend/FastifyBackend.js +71 -1
  328. package/dist/http/backend/FastifyBackend.js.map +1 -1
  329. package/dist/http/backend/HonoBackend.d.ts +19 -13
  330. package/dist/http/backend/HonoBackend.d.ts.map +1 -1
  331. package/dist/http/backend/HonoBackend.js +152 -5
  332. package/dist/http/backend/HonoBackend.js.map +1 -1
  333. package/dist/http/backend/HonoBackendOptions.d.ts +47 -0
  334. package/dist/http/backend/HonoBackendOptions.d.ts.map +1 -0
  335. package/dist/http/backend/HonoBackendOptions.js +35 -0
  336. package/dist/http/backend/HonoBackendOptions.js.map +1 -0
  337. package/dist/http/backend/HttpServerBackend.d.ts +24 -0
  338. package/dist/http/backend/HttpServerBackend.d.ts.map +1 -1
  339. package/dist/http/index.d.ts +11 -5
  340. package/dist/http/index.d.ts.map +1 -1
  341. package/dist/http/index.js +8 -1
  342. package/dist/http/index.js.map +1 -1
  343. package/dist/http/middleware/BearerToken.d.ts +44 -0
  344. package/dist/http/middleware/BearerToken.d.ts.map +1 -0
  345. package/dist/http/middleware/BearerToken.js +72 -0
  346. package/dist/http/middleware/BearerToken.js.map +1 -0
  347. package/dist/http/middleware/IpAllowlist.d.ts +45 -0
  348. package/dist/http/middleware/IpAllowlist.d.ts.map +1 -0
  349. package/dist/http/middleware/IpAllowlist.js +148 -0
  350. package/dist/http/middleware/IpAllowlist.js.map +1 -0
  351. package/dist/http/middleware/index.d.ts +5 -0
  352. package/dist/http/middleware/index.d.ts.map +1 -0
  353. package/dist/http/middleware/index.js +3 -0
  354. package/dist/http/middleware/index.js.map +1 -0
  355. package/dist/http/types.d.ts +9 -0
  356. package/dist/http/types.d.ts.map +1 -1
  357. package/dist/http/types.js.map +1 -1
  358. package/dist/http/ws/ConnectionWiring.d.ts +59 -0
  359. package/dist/http/ws/ConnectionWiring.d.ts.map +1 -0
  360. package/dist/http/ws/ConnectionWiring.js +112 -0
  361. package/dist/http/ws/ConnectionWiring.js.map +1 -0
  362. package/dist/http/ws/SocketAdapter.d.ts +72 -0
  363. package/dist/http/ws/SocketAdapter.d.ts.map +1 -0
  364. package/dist/http/ws/SocketAdapter.js +97 -0
  365. package/dist/http/ws/SocketAdapter.js.map +1 -0
  366. package/dist/http/ws/WebSocketClientActor.d.ts +66 -0
  367. package/dist/http/ws/WebSocketClientActor.d.ts.map +1 -0
  368. package/dist/http/ws/WebSocketClientActor.js +194 -0
  369. package/dist/http/ws/WebSocketClientActor.js.map +1 -0
  370. package/dist/http/ws/WebSocketClientOptions.d.ts +77 -0
  371. package/dist/http/ws/WebSocketClientOptions.d.ts.map +1 -0
  372. package/dist/http/ws/WebSocketClientOptions.js +69 -0
  373. package/dist/http/ws/WebSocketClientOptions.js.map +1 -0
  374. package/dist/http/ws/WebSocketConnectionActor.d.ts +51 -0
  375. package/dist/http/ws/WebSocketConnectionActor.d.ts.map +1 -0
  376. package/dist/http/ws/WebSocketConnectionActor.js +170 -0
  377. package/dist/http/ws/WebSocketConnectionActor.js.map +1 -0
  378. package/dist/http/ws/WebSocketRoute.d.ts +20 -0
  379. package/dist/http/ws/WebSocketRoute.d.ts.map +1 -0
  380. package/dist/http/ws/WebSocketRoute.js +44 -0
  381. package/dist/http/ws/WebSocketRoute.js.map +1 -0
  382. package/dist/http/ws/WebSocketRouteOptions.d.ts +54 -0
  383. package/dist/http/ws/WebSocketRouteOptions.d.ts.map +1 -0
  384. package/dist/http/ws/WebSocketRouteOptions.js +55 -0
  385. package/dist/http/ws/WebSocketRouteOptions.js.map +1 -0
  386. package/dist/http/ws/WebSocketServerActor.d.ts +65 -0
  387. package/dist/http/ws/WebSocketServerActor.d.ts.map +1 -0
  388. package/dist/http/ws/WebSocketServerActor.js +133 -0
  389. package/dist/http/ws/WebSocketServerActor.js.map +1 -0
  390. package/dist/http/ws/WsCodec.d.ts +65 -0
  391. package/dist/http/ws/WsCodec.d.ts.map +1 -0
  392. package/dist/http/ws/WsCodec.js +82 -0
  393. package/dist/http/ws/WsCodec.js.map +1 -0
  394. package/dist/http/ws/WsConnection.d.ts +59 -0
  395. package/dist/http/ws/WsConnection.d.ts.map +1 -0
  396. package/dist/http/ws/WsConnection.js +45 -0
  397. package/dist/http/ws/WsConnection.js.map +1 -0
  398. package/dist/http/ws/WsMessages.d.ts +91 -0
  399. package/dist/http/ws/WsMessages.d.ts.map +1 -0
  400. package/dist/http/ws/WsMessages.js +90 -0
  401. package/dist/http/ws/WsMessages.js.map +1 -0
  402. package/dist/http/ws/WsPolicy.d.ts +32 -0
  403. package/dist/http/ws/WsPolicy.d.ts.map +1 -0
  404. package/dist/http/ws/WsPolicy.js +43 -0
  405. package/dist/http/ws/WsPolicy.js.map +1 -0
  406. package/dist/http/ws/index.d.ts +22 -0
  407. package/dist/http/ws/index.d.ts.map +1 -0
  408. package/dist/http/ws/index.js +15 -0
  409. package/dist/http/ws/index.js.map +1 -0
  410. package/dist/http/ws/matchPattern.d.ts +12 -0
  411. package/dist/http/ws/matchPattern.d.ts.map +1 -0
  412. package/dist/http/ws/matchPattern.js +29 -0
  413. package/dist/http/ws/matchPattern.js.map +1 -0
  414. package/dist/http/ws/rawResponse.d.ts +15 -0
  415. package/dist/http/ws/rawResponse.d.ts.map +1 -0
  416. package/dist/http/ws/rawResponse.js +54 -0
  417. package/dist/http/ws/rawResponse.js.map +1 -0
  418. package/dist/http/ws/types.d.ts +70 -0
  419. package/dist/http/ws/types.d.ts.map +1 -0
  420. package/dist/http/ws/types.js +81 -0
  421. package/dist/http/ws/types.js.map +1 -0
  422. package/dist/http/ws/wsCtor.d.ts +34 -0
  423. package/dist/http/ws/wsCtor.d.ts.map +1 -0
  424. package/dist/http/ws/wsCtor.js +38 -0
  425. package/dist/http/ws/wsCtor.js.map +1 -0
  426. package/dist/index.d.ts +25 -23
  427. package/dist/index.d.ts.map +1 -1
  428. package/dist/index.js +15 -11
  429. package/dist/index.js.map +1 -1
  430. package/dist/internal/ActorCell.d.ts +16 -1
  431. package/dist/internal/ActorCell.d.ts.map +1 -1
  432. package/dist/internal/ActorCell.js +32 -2
  433. package/dist/internal/ActorCell.js.map +1 -1
  434. package/dist/io/broker/AmqpActor.d.ts +19 -16
  435. package/dist/io/broker/AmqpActor.d.ts.map +1 -1
  436. package/dist/io/broker/AmqpActor.js +13 -5
  437. package/dist/io/broker/AmqpActor.js.map +1 -1
  438. package/dist/io/broker/AmqpOptions.d.ts +41 -0
  439. package/dist/io/broker/AmqpOptions.d.ts.map +1 -0
  440. package/dist/io/broker/AmqpOptions.js +34 -0
  441. package/dist/io/broker/AmqpOptions.js.map +1 -0
  442. package/dist/io/broker/BrokerActor.d.ts +4 -3
  443. package/dist/io/broker/BrokerActor.d.ts.map +1 -1
  444. package/dist/io/broker/BrokerActor.js +4 -2
  445. package/dist/io/broker/BrokerActor.js.map +1 -1
  446. package/dist/io/broker/BrokerOptions.d.ts +24 -0
  447. package/dist/io/broker/BrokerOptions.d.ts.map +1 -0
  448. package/dist/io/broker/BrokerOptions.js +29 -0
  449. package/dist/io/broker/BrokerOptions.js.map +1 -0
  450. package/dist/io/broker/BrokerSettings.d.ts +2 -2
  451. package/dist/io/broker/BrokerSettings.d.ts.map +1 -1
  452. package/dist/io/broker/BrokerSettings.js.map +1 -1
  453. package/dist/io/broker/GrpcClientActor.d.ts +6 -19
  454. package/dist/io/broker/GrpcClientActor.d.ts.map +1 -1
  455. package/dist/io/broker/GrpcClientActor.js +1 -1
  456. package/dist/io/broker/GrpcClientActor.js.map +1 -1
  457. package/dist/io/broker/GrpcClientOptions.d.ts +48 -0
  458. package/dist/io/broker/GrpcClientOptions.d.ts.map +1 -0
  459. package/dist/io/broker/GrpcClientOptions.js +42 -0
  460. package/dist/io/broker/GrpcClientOptions.js.map +1 -0
  461. package/dist/io/broker/GrpcServerActor.d.ts +3 -24
  462. package/dist/io/broker/GrpcServerActor.d.ts.map +1 -1
  463. package/dist/io/broker/GrpcServerActor.js +3 -3
  464. package/dist/io/broker/GrpcServerActor.js.map +1 -1
  465. package/dist/io/broker/GrpcServerOptions.d.ts +58 -0
  466. package/dist/io/broker/GrpcServerOptions.d.ts.map +1 -0
  467. package/dist/io/broker/GrpcServerOptions.js +44 -0
  468. package/dist/io/broker/GrpcServerOptions.js.map +1 -0
  469. package/dist/io/broker/JetStreamActor.d.ts +13 -35
  470. package/dist/io/broker/JetStreamActor.d.ts.map +1 -1
  471. package/dist/io/broker/JetStreamActor.js +2 -2
  472. package/dist/io/broker/JetStreamActor.js.map +1 -1
  473. package/dist/io/broker/JetStreamOptions.d.ts +64 -0
  474. package/dist/io/broker/JetStreamOptions.d.ts.map +1 -0
  475. package/dist/io/broker/JetStreamOptions.js +54 -0
  476. package/dist/io/broker/JetStreamOptions.js.map +1 -0
  477. package/dist/io/broker/KafkaActor.d.ts +13 -54
  478. package/dist/io/broker/KafkaActor.d.ts.map +1 -1
  479. package/dist/io/broker/KafkaActor.js +20 -8
  480. package/dist/io/broker/KafkaActor.js.map +1 -1
  481. package/dist/io/broker/KafkaOptions.d.ts +82 -0
  482. package/dist/io/broker/KafkaOptions.d.ts.map +1 -0
  483. package/dist/io/broker/KafkaOptions.js +50 -0
  484. package/dist/io/broker/KafkaOptions.js.map +1 -0
  485. package/dist/io/broker/MqttActor.d.ts +174 -114
  486. package/dist/io/broker/MqttActor.d.ts.map +1 -1
  487. package/dist/io/broker/MqttActor.js +328 -103
  488. package/dist/io/broker/MqttActor.js.map +1 -1
  489. package/dist/io/broker/MqttCodec.d.ts +70 -0
  490. package/dist/io/broker/MqttCodec.d.ts.map +1 -0
  491. package/dist/io/broker/MqttCodec.js +98 -0
  492. package/dist/io/broker/MqttCodec.js.map +1 -0
  493. package/dist/io/broker/MqttMessages.d.ts +145 -0
  494. package/dist/io/broker/MqttMessages.d.ts.map +1 -0
  495. package/dist/io/broker/MqttMessages.js +102 -0
  496. package/dist/io/broker/MqttMessages.js.map +1 -0
  497. package/dist/io/broker/MqttOptions.d.ts +100 -0
  498. package/dist/io/broker/MqttOptions.d.ts.map +1 -0
  499. package/dist/io/broker/MqttOptions.js +73 -0
  500. package/dist/io/broker/MqttOptions.js.map +1 -0
  501. package/dist/io/broker/NatsActor.d.ts +6 -21
  502. package/dist/io/broker/NatsActor.d.ts.map +1 -1
  503. package/dist/io/broker/NatsActor.js +1 -1
  504. package/dist/io/broker/NatsActor.js.map +1 -1
  505. package/dist/io/broker/NatsOptions.d.ts +51 -0
  506. package/dist/io/broker/NatsOptions.d.ts.map +1 -0
  507. package/dist/io/broker/NatsOptions.js +42 -0
  508. package/dist/io/broker/NatsOptions.js.map +1 -0
  509. package/dist/io/broker/RedisStreamsActor.d.ts +6 -24
  510. package/dist/io/broker/RedisStreamsActor.d.ts.map +1 -1
  511. package/dist/io/broker/RedisStreamsActor.js +1 -1
  512. package/dist/io/broker/RedisStreamsActor.js.map +1 -1
  513. package/dist/io/broker/RedisStreamsOptions.d.ts +51 -0
  514. package/dist/io/broker/RedisStreamsOptions.d.ts.map +1 -0
  515. package/dist/io/broker/RedisStreamsOptions.js +38 -0
  516. package/dist/io/broker/RedisStreamsOptions.js.map +1 -0
  517. package/dist/io/broker/SseActor.d.ts +6 -15
  518. package/dist/io/broker/SseActor.d.ts.map +1 -1
  519. package/dist/io/broker/SseActor.js +1 -1
  520. package/dist/io/broker/SseActor.js.map +1 -1
  521. package/dist/io/broker/SseOptions.d.ts +38 -0
  522. package/dist/io/broker/SseOptions.d.ts.map +1 -0
  523. package/dist/io/broker/SseOptions.js +30 -0
  524. package/dist/io/broker/SseOptions.js.map +1 -0
  525. package/dist/io/broker/TcpSocketActor.d.ts +6 -21
  526. package/dist/io/broker/TcpSocketActor.d.ts.map +1 -1
  527. package/dist/io/broker/TcpSocketActor.js +1 -1
  528. package/dist/io/broker/TcpSocketActor.js.map +1 -1
  529. package/dist/io/broker/TcpSocketOptions.d.ts +46 -0
  530. package/dist/io/broker/TcpSocketOptions.d.ts.map +1 -0
  531. package/dist/io/broker/TcpSocketOptions.js +34 -0
  532. package/dist/io/broker/TcpSocketOptions.js.map +1 -0
  533. package/dist/io/broker/UdpSocketActor.d.ts +6 -17
  534. package/dist/io/broker/UdpSocketActor.d.ts.map +1 -1
  535. package/dist/io/broker/UdpSocketActor.js +1 -1
  536. package/dist/io/broker/UdpSocketActor.js.map +1 -1
  537. package/dist/io/broker/UdpSocketOptions.d.ts +42 -0
  538. package/dist/io/broker/UdpSocketOptions.d.ts.map +1 -0
  539. package/dist/io/broker/UdpSocketOptions.js +34 -0
  540. package/dist/io/broker/UdpSocketOptions.js.map +1 -0
  541. package/dist/io/broker/index.d.ts +39 -19
  542. package/dist/io/broker/index.d.ts.map +1 -1
  543. package/dist/io/broker/index.js +21 -4
  544. package/dist/io/broker/index.js.map +1 -1
  545. package/dist/mailbox/BoundedMailbox.d.ts +12 -0
  546. package/dist/mailbox/BoundedMailbox.d.ts.map +1 -1
  547. package/dist/mailbox/BoundedMailbox.js +7 -1
  548. package/dist/mailbox/BoundedMailbox.js.map +1 -1
  549. package/dist/management/HttpManagement.d.ts +34 -1
  550. package/dist/management/HttpManagement.d.ts.map +1 -1
  551. package/dist/management/HttpManagement.js +30 -4
  552. package/dist/management/HttpManagement.js.map +1 -1
  553. package/dist/metrics/PromClientAdapter.d.ts +2 -12
  554. package/dist/metrics/PromClientAdapter.d.ts.map +1 -1
  555. package/dist/metrics/PromClientAdapter.js +2 -2
  556. package/dist/metrics/PromClientAdapter.js.map +1 -1
  557. package/dist/metrics/PromClientAdapterOptions.d.ts +46 -0
  558. package/dist/metrics/PromClientAdapterOptions.d.ts.map +1 -0
  559. package/dist/metrics/PromClientAdapterOptions.js +35 -0
  560. package/dist/metrics/PromClientAdapterOptions.js.map +1 -0
  561. package/dist/metrics/index.d.ts +3 -1
  562. package/dist/metrics/index.d.ts.map +1 -1
  563. package/dist/metrics/index.js +1 -0
  564. package/dist/metrics/index.js.map +1 -1
  565. package/dist/persistence/DurableStateActor.d.ts +4 -9
  566. package/dist/persistence/DurableStateActor.d.ts.map +1 -1
  567. package/dist/persistence/DurableStateActor.js +3 -3
  568. package/dist/persistence/DurableStateActor.js.map +1 -1
  569. package/dist/persistence/DurableStateOptions.d.ts +40 -0
  570. package/dist/persistence/DurableStateOptions.d.ts.map +1 -0
  571. package/dist/persistence/DurableStateOptions.js +36 -0
  572. package/dist/persistence/DurableStateOptions.js.map +1 -0
  573. package/dist/persistence/PersistenceOptions.d.ts +45 -0
  574. package/dist/persistence/PersistenceOptions.d.ts.map +1 -1
  575. package/dist/persistence/ReplicatedEventSourcedActor.d.ts.map +1 -1
  576. package/dist/persistence/ReplicatedEventSourcedActor.js +2 -2
  577. package/dist/persistence/ReplicatedEventSourcedActor.js.map +1 -1
  578. package/dist/persistence/durable-state-stores/MariaDbDurableStateStore.d.ts +32 -0
  579. package/dist/persistence/durable-state-stores/MariaDbDurableStateStore.d.ts.map +1 -0
  580. package/dist/persistence/durable-state-stores/MariaDbDurableStateStore.js +120 -0
  581. package/dist/persistence/durable-state-stores/MariaDbDurableStateStore.js.map +1 -0
  582. package/dist/persistence/durable-state-stores/MariaDbDurableStateStoreOptions.d.ts +38 -0
  583. package/dist/persistence/durable-state-stores/MariaDbDurableStateStoreOptions.d.ts.map +1 -0
  584. package/dist/persistence/durable-state-stores/MariaDbDurableStateStoreOptions.js +38 -0
  585. package/dist/persistence/durable-state-stores/MariaDbDurableStateStoreOptions.js.map +1 -0
  586. package/dist/persistence/durable-state-stores/ObjectStorageDurableStateStore.d.ts +4 -9
  587. package/dist/persistence/durable-state-stores/ObjectStorageDurableStateStore.d.ts.map +1 -1
  588. package/dist/persistence/durable-state-stores/ObjectStorageDurableStateStore.js +49 -7
  589. package/dist/persistence/durable-state-stores/ObjectStorageDurableStateStore.js.map +1 -1
  590. package/dist/persistence/durable-state-stores/ObjectStorageDurableStateStoreOptions.d.ts +61 -0
  591. package/dist/persistence/durable-state-stores/ObjectStorageDurableStateStoreOptions.d.ts.map +1 -0
  592. package/dist/persistence/durable-state-stores/ObjectStorageDurableStateStoreOptions.js +42 -0
  593. package/dist/persistence/durable-state-stores/ObjectStorageDurableStateStoreOptions.js.map +1 -0
  594. package/dist/persistence/durable-state-stores/PostgresDurableStateStore.d.ts +38 -0
  595. package/dist/persistence/durable-state-stores/PostgresDurableStateStore.d.ts.map +1 -0
  596. package/dist/persistence/durable-state-stores/PostgresDurableStateStore.js +121 -0
  597. package/dist/persistence/durable-state-stores/PostgresDurableStateStore.js.map +1 -0
  598. package/dist/persistence/durable-state-stores/PostgresDurableStateStoreOptions.d.ts +38 -0
  599. package/dist/persistence/durable-state-stores/PostgresDurableStateStoreOptions.d.ts.map +1 -0
  600. package/dist/persistence/durable-state-stores/PostgresDurableStateStoreOptions.js +38 -0
  601. package/dist/persistence/durable-state-stores/PostgresDurableStateStoreOptions.js.map +1 -0
  602. package/dist/persistence/index.d.ts +59 -16
  603. package/dist/persistence/index.d.ts.map +1 -1
  604. package/dist/persistence/index.js +33 -2
  605. package/dist/persistence/index.js.map +1 -1
  606. package/dist/persistence/journals/CassandraJournal.d.ts +1 -48
  607. package/dist/persistence/journals/CassandraJournal.d.ts.map +1 -1
  608. package/dist/persistence/journals/CassandraJournal.js +2 -2
  609. package/dist/persistence/journals/CassandraJournal.js.map +1 -1
  610. package/dist/persistence/journals/CassandraJournalOptions.d.ts +107 -0
  611. package/dist/persistence/journals/CassandraJournalOptions.d.ts.map +1 -0
  612. package/dist/persistence/journals/CassandraJournalOptions.js +90 -0
  613. package/dist/persistence/journals/CassandraJournalOptions.js.map +1 -0
  614. package/dist/persistence/journals/CassandraPlugin.d.ts +1 -16
  615. package/dist/persistence/journals/CassandraPlugin.d.ts.map +1 -1
  616. package/dist/persistence/journals/CassandraPlugin.js +9 -4
  617. package/dist/persistence/journals/CassandraPlugin.js.map +1 -1
  618. package/dist/persistence/journals/CassandraPluginOptions.d.ts +51 -0
  619. package/dist/persistence/journals/CassandraPluginOptions.d.ts.map +1 -0
  620. package/dist/persistence/journals/CassandraPluginOptions.js +37 -0
  621. package/dist/persistence/journals/CassandraPluginOptions.js.map +1 -0
  622. package/dist/persistence/journals/MariaDbClient.d.ts +54 -0
  623. package/dist/persistence/journals/MariaDbClient.d.ts.map +1 -0
  624. package/dist/persistence/journals/MariaDbClient.js +40 -0
  625. package/dist/persistence/journals/MariaDbClient.js.map +1 -0
  626. package/dist/persistence/journals/MariaDbJournal.d.ts +29 -0
  627. package/dist/persistence/journals/MariaDbJournal.d.ts.map +1 -0
  628. package/dist/persistence/journals/MariaDbJournal.js +161 -0
  629. package/dist/persistence/journals/MariaDbJournal.js.map +1 -0
  630. package/dist/persistence/journals/MariaDbJournalOptions.d.ts +43 -0
  631. package/dist/persistence/journals/MariaDbJournalOptions.d.ts.map +1 -0
  632. package/dist/persistence/journals/MariaDbJournalOptions.js +43 -0
  633. package/dist/persistence/journals/MariaDbJournalOptions.js.map +1 -0
  634. package/dist/persistence/journals/MariaDbPlugin.d.ts +27 -0
  635. package/dist/persistence/journals/MariaDbPlugin.d.ts.map +1 -0
  636. package/dist/persistence/journals/MariaDbPlugin.js +30 -0
  637. package/dist/persistence/journals/MariaDbPlugin.js.map +1 -0
  638. package/dist/persistence/journals/MariaDbPluginOptions.d.ts +52 -0
  639. package/dist/persistence/journals/MariaDbPluginOptions.d.ts.map +1 -0
  640. package/dist/persistence/journals/MariaDbPluginOptions.js +38 -0
  641. package/dist/persistence/journals/MariaDbPluginOptions.js.map +1 -0
  642. package/dist/persistence/journals/PostgresClient.d.ts +56 -0
  643. package/dist/persistence/journals/PostgresClient.d.ts.map +1 -0
  644. package/dist/persistence/journals/PostgresClient.js +35 -0
  645. package/dist/persistence/journals/PostgresClient.js.map +1 -0
  646. package/dist/persistence/journals/PostgresJournal.d.ts +41 -0
  647. package/dist/persistence/journals/PostgresJournal.d.ts.map +1 -0
  648. package/dist/persistence/journals/PostgresJournal.js +176 -0
  649. package/dist/persistence/journals/PostgresJournal.js.map +1 -0
  650. package/dist/persistence/journals/PostgresJournalOptions.d.ts +44 -0
  651. package/dist/persistence/journals/PostgresJournalOptions.d.ts.map +1 -0
  652. package/dist/persistence/journals/PostgresJournalOptions.js +44 -0
  653. package/dist/persistence/journals/PostgresJournalOptions.js.map +1 -0
  654. package/dist/persistence/journals/PostgresPlugin.d.ts +32 -0
  655. package/dist/persistence/journals/PostgresPlugin.d.ts.map +1 -0
  656. package/dist/persistence/journals/PostgresPlugin.js +35 -0
  657. package/dist/persistence/journals/PostgresPlugin.js.map +1 -0
  658. package/dist/persistence/journals/PostgresPluginOptions.d.ts +54 -0
  659. package/dist/persistence/journals/PostgresPluginOptions.d.ts.map +1 -0
  660. package/dist/persistence/journals/PostgresPluginOptions.js +39 -0
  661. package/dist/persistence/journals/PostgresPluginOptions.js.map +1 -0
  662. package/dist/persistence/journals/SqliteJournal.d.ts +5 -19
  663. package/dist/persistence/journals/SqliteJournal.d.ts.map +1 -1
  664. package/dist/persistence/journals/SqliteJournal.js +10 -9
  665. package/dist/persistence/journals/SqliteJournal.js.map +1 -1
  666. package/dist/persistence/journals/SqliteJournalOptions.d.ts +41 -0
  667. package/dist/persistence/journals/SqliteJournalOptions.d.ts.map +1 -0
  668. package/dist/persistence/journals/SqliteJournalOptions.js +31 -0
  669. package/dist/persistence/journals/SqliteJournalOptions.js.map +1 -0
  670. package/dist/persistence/object-storage/BodyCodec.d.ts +43 -0
  671. package/dist/persistence/object-storage/BodyCodec.d.ts.map +1 -1
  672. package/dist/persistence/object-storage/BodyCodec.js +78 -20
  673. package/dist/persistence/object-storage/BodyCodec.js.map +1 -1
  674. package/dist/persistence/object-storage/Compression.d.ts +21 -7
  675. package/dist/persistence/object-storage/Compression.d.ts.map +1 -1
  676. package/dist/persistence/object-storage/Compression.js +79 -29
  677. package/dist/persistence/object-storage/Compression.js.map +1 -1
  678. package/dist/persistence/object-storage/FilesystemObjectStorageBackend.d.ts +2 -61
  679. package/dist/persistence/object-storage/FilesystemObjectStorageBackend.d.ts.map +1 -1
  680. package/dist/persistence/object-storage/FilesystemObjectStorageBackend.js +56 -11
  681. package/dist/persistence/object-storage/FilesystemObjectStorageBackend.js.map +1 -1
  682. package/dist/persistence/object-storage/FilesystemObjectStorageOptions.d.ts +45 -0
  683. package/dist/persistence/object-storage/FilesystemObjectStorageOptions.d.ts.map +1 -0
  684. package/dist/persistence/object-storage/FilesystemObjectStorageOptions.js +30 -0
  685. package/dist/persistence/object-storage/FilesystemObjectStorageOptions.js.map +1 -0
  686. package/dist/persistence/object-storage/Integrity.d.ts +43 -0
  687. package/dist/persistence/object-storage/Integrity.d.ts.map +1 -0
  688. package/dist/persistence/object-storage/Integrity.js +66 -0
  689. package/dist/persistence/object-storage/Integrity.js.map +1 -0
  690. package/dist/persistence/object-storage/ObjectStoragePlugin.d.ts +6 -22
  691. package/dist/persistence/object-storage/ObjectStoragePlugin.d.ts.map +1 -1
  692. package/dist/persistence/object-storage/ObjectStoragePlugin.js +36 -28
  693. package/dist/persistence/object-storage/ObjectStoragePlugin.js.map +1 -1
  694. package/dist/persistence/object-storage/ObjectStoragePluginOptions.d.ts +60 -0
  695. package/dist/persistence/object-storage/ObjectStoragePluginOptions.d.ts.map +1 -0
  696. package/dist/persistence/object-storage/ObjectStoragePluginOptions.js +52 -0
  697. package/dist/persistence/object-storage/ObjectStoragePluginOptions.js.map +1 -0
  698. package/dist/persistence/object-storage/PluginConfig.d.ts +5 -2
  699. package/dist/persistence/object-storage/PluginConfig.d.ts.map +1 -1
  700. package/dist/persistence/object-storage/PluginConfig.js +8 -0
  701. package/dist/persistence/object-storage/PluginConfig.js.map +1 -1
  702. package/dist/persistence/object-storage/S3ObjectStorageBackend.d.ts +1 -30
  703. package/dist/persistence/object-storage/S3ObjectStorageBackend.d.ts.map +1 -1
  704. package/dist/persistence/object-storage/S3ObjectStorageBackend.js +12 -7
  705. package/dist/persistence/object-storage/S3ObjectStorageBackend.js.map +1 -1
  706. package/dist/persistence/object-storage/S3ObjectStorageOptions.d.ts +64 -0
  707. package/dist/persistence/object-storage/S3ObjectStorageOptions.d.ts.map +1 -0
  708. package/dist/persistence/object-storage/S3ObjectStorageOptions.js +42 -0
  709. package/dist/persistence/object-storage/S3ObjectStorageOptions.js.map +1 -0
  710. package/dist/persistence/object-storage/reEncryptionSweep.d.ts +72 -0
  711. package/dist/persistence/object-storage/reEncryptionSweep.d.ts.map +1 -1
  712. package/dist/persistence/object-storage/reEncryptionSweep.js +82 -2
  713. package/dist/persistence/object-storage/reEncryptionSweep.js.map +1 -1
  714. package/dist/persistence/projection/ProjectionActor.d.ts +4 -24
  715. package/dist/persistence/projection/ProjectionActor.d.ts.map +1 -1
  716. package/dist/persistence/projection/ProjectionActor.js +36 -2
  717. package/dist/persistence/projection/ProjectionActor.js.map +1 -1
  718. package/dist/persistence/projection/ProjectionOptions.d.ts +109 -0
  719. package/dist/persistence/projection/ProjectionOptions.d.ts.map +1 -0
  720. package/dist/persistence/projection/ProjectionOptions.js +108 -0
  721. package/dist/persistence/projection/ProjectionOptions.js.map +1 -0
  722. package/dist/persistence/snapshot-stores/CachedSnapshotStore.d.ts +2 -10
  723. package/dist/persistence/snapshot-stores/CachedSnapshotStore.d.ts.map +1 -1
  724. package/dist/persistence/snapshot-stores/CachedSnapshotStore.js +12 -6
  725. package/dist/persistence/snapshot-stores/CachedSnapshotStore.js.map +1 -1
  726. package/dist/persistence/snapshot-stores/CachedSnapshotStoreOptions.d.ts +37 -0
  727. package/dist/persistence/snapshot-stores/CachedSnapshotStoreOptions.d.ts.map +1 -0
  728. package/dist/persistence/snapshot-stores/CachedSnapshotStoreOptions.js +31 -0
  729. package/dist/persistence/snapshot-stores/CachedSnapshotStoreOptions.js.map +1 -0
  730. package/dist/persistence/snapshot-stores/CassandraSnapshotStore.d.ts +1 -11
  731. package/dist/persistence/snapshot-stores/CassandraSnapshotStore.d.ts.map +1 -1
  732. package/dist/persistence/snapshot-stores/CassandraSnapshotStore.js +3 -3
  733. package/dist/persistence/snapshot-stores/CassandraSnapshotStore.js.map +1 -1
  734. package/dist/persistence/snapshot-stores/CassandraSnapshotStoreOptions.d.ts +61 -0
  735. package/dist/persistence/snapshot-stores/CassandraSnapshotStoreOptions.d.ts.map +1 -0
  736. package/dist/persistence/snapshot-stores/CassandraSnapshotStoreOptions.js +73 -0
  737. package/dist/persistence/snapshot-stores/CassandraSnapshotStoreOptions.js.map +1 -0
  738. package/dist/persistence/snapshot-stores/MariaDbSnapshotStore.d.ts +30 -0
  739. package/dist/persistence/snapshot-stores/MariaDbSnapshotStore.d.ts.map +1 -0
  740. package/dist/persistence/snapshot-stores/MariaDbSnapshotStore.js +102 -0
  741. package/dist/persistence/snapshot-stores/MariaDbSnapshotStore.js.map +1 -0
  742. package/dist/persistence/snapshot-stores/MariaDbSnapshotStoreOptions.d.ts +42 -0
  743. package/dist/persistence/snapshot-stores/MariaDbSnapshotStoreOptions.d.ts.map +1 -0
  744. package/dist/persistence/snapshot-stores/MariaDbSnapshotStoreOptions.js +42 -0
  745. package/dist/persistence/snapshot-stores/MariaDbSnapshotStoreOptions.js.map +1 -0
  746. package/dist/persistence/snapshot-stores/ObjectStorageSnapshotStore.d.ts +2 -15
  747. package/dist/persistence/snapshot-stores/ObjectStorageSnapshotStore.d.ts.map +1 -1
  748. package/dist/persistence/snapshot-stores/ObjectStorageSnapshotStore.js +10 -6
  749. package/dist/persistence/snapshot-stores/ObjectStorageSnapshotStore.js.map +1 -1
  750. package/dist/persistence/snapshot-stores/ObjectStorageSnapshotStoreOptions.d.ts +45 -0
  751. package/dist/persistence/snapshot-stores/ObjectStorageSnapshotStoreOptions.d.ts.map +1 -0
  752. package/dist/persistence/snapshot-stores/ObjectStorageSnapshotStoreOptions.js +38 -0
  753. package/dist/persistence/snapshot-stores/ObjectStorageSnapshotStoreOptions.js.map +1 -0
  754. package/dist/persistence/snapshot-stores/PostgresSnapshotStore.d.ts +31 -0
  755. package/dist/persistence/snapshot-stores/PostgresSnapshotStore.d.ts.map +1 -0
  756. package/dist/persistence/snapshot-stores/PostgresSnapshotStore.js +101 -0
  757. package/dist/persistence/snapshot-stores/PostgresSnapshotStore.js.map +1 -0
  758. package/dist/persistence/snapshot-stores/PostgresSnapshotStoreOptions.d.ts +42 -0
  759. package/dist/persistence/snapshot-stores/PostgresSnapshotStoreOptions.d.ts.map +1 -0
  760. package/dist/persistence/snapshot-stores/PostgresSnapshotStoreOptions.js +42 -0
  761. package/dist/persistence/snapshot-stores/PostgresSnapshotStoreOptions.js.map +1 -0
  762. package/dist/persistence/snapshot-stores/SqliteSnapshotStore.d.ts +2 -15
  763. package/dist/persistence/snapshot-stores/SqliteSnapshotStore.d.ts.map +1 -1
  764. package/dist/persistence/snapshot-stores/SqliteSnapshotStore.js +7 -6
  765. package/dist/persistence/snapshot-stores/SqliteSnapshotStore.js.map +1 -1
  766. package/dist/persistence/snapshot-stores/SqliteSnapshotStoreOptions.d.ts +40 -0
  767. package/dist/persistence/snapshot-stores/SqliteSnapshotStoreOptions.d.ts.map +1 -0
  768. package/dist/persistence/snapshot-stores/SqliteSnapshotStoreOptions.js +31 -0
  769. package/dist/persistence/snapshot-stores/SqliteSnapshotStoreOptions.js.map +1 -0
  770. package/dist/runtime/http/BunHonoRunner.d.ts +7 -1
  771. package/dist/runtime/http/BunHonoRunner.d.ts.map +1 -1
  772. package/dist/runtime/http/BunHonoRunner.js +22 -0
  773. package/dist/runtime/http/BunHonoRunner.js.map +1 -1
  774. package/dist/runtime/http/DenoHonoRunner.d.ts +5 -2
  775. package/dist/runtime/http/DenoHonoRunner.d.ts.map +1 -1
  776. package/dist/runtime/http/DenoHonoRunner.js +19 -2
  777. package/dist/runtime/http/DenoHonoRunner.js.map +1 -1
  778. package/dist/runtime/http/HonoServerRunner.d.ts +39 -0
  779. package/dist/runtime/http/HonoServerRunner.d.ts.map +1 -1
  780. package/dist/runtime/http/NodeHonoRunner.d.ts +3 -1
  781. package/dist/runtime/http/NodeHonoRunner.d.ts.map +1 -1
  782. package/dist/runtime/http/NodeHonoRunner.js +22 -0
  783. package/dist/runtime/http/NodeHonoRunner.js.map +1 -1
  784. package/dist/runtime/http/index.d.ts +1 -1
  785. package/dist/runtime/http/index.d.ts.map +1 -1
  786. package/dist/runtime/http/index.js.map +1 -1
  787. package/dist/testkit/ManualScheduler.d.ts +2 -1
  788. package/dist/testkit/ManualScheduler.d.ts.map +1 -1
  789. package/dist/testkit/ManualScheduler.js +2 -1
  790. package/dist/testkit/ManualScheduler.js.map +1 -1
  791. package/dist/testkit/MockCluster.d.ts +74 -0
  792. package/dist/testkit/MockCluster.d.ts.map +1 -0
  793. package/dist/testkit/MockCluster.js +163 -0
  794. package/dist/testkit/MockCluster.js.map +1 -0
  795. package/dist/testkit/MultiNodeClusterFixture.d.ts +62 -0
  796. package/dist/testkit/MultiNodeClusterFixture.d.ts.map +1 -0
  797. package/dist/testkit/MultiNodeClusterFixture.js +43 -0
  798. package/dist/testkit/MultiNodeClusterFixture.js.map +1 -0
  799. package/dist/testkit/MultiNodeSpec.d.ts +45 -3
  800. package/dist/testkit/MultiNodeSpec.d.ts.map +1 -1
  801. package/dist/testkit/MultiNodeSpec.js +108 -14
  802. package/dist/testkit/MultiNodeSpec.js.map +1 -1
  803. package/dist/testkit/ParallelMultiNodeSpec.d.ts +12 -2
  804. package/dist/testkit/ParallelMultiNodeSpec.d.ts.map +1 -1
  805. package/dist/testkit/ParallelMultiNodeSpec.js +49 -4
  806. package/dist/testkit/ParallelMultiNodeSpec.js.map +1 -1
  807. package/dist/testkit/SnapshotMigrationTest.d.ts +86 -0
  808. package/dist/testkit/SnapshotMigrationTest.d.ts.map +1 -0
  809. package/dist/testkit/SnapshotMigrationTest.js +77 -0
  810. package/dist/testkit/SnapshotMigrationTest.js.map +1 -0
  811. package/dist/testkit/TestKit.d.ts +6 -8
  812. package/dist/testkit/TestKit.d.ts.map +1 -1
  813. package/dist/testkit/TestKit.js +10 -6
  814. package/dist/testkit/TestKit.js.map +1 -1
  815. package/dist/testkit/TestKitOptions.d.ts +26 -0
  816. package/dist/testkit/TestKitOptions.d.ts.map +1 -0
  817. package/dist/testkit/TestKitOptions.js +19 -0
  818. package/dist/testkit/TestKitOptions.js.map +1 -0
  819. package/dist/testkit/TestProbe.d.ts +2 -7
  820. package/dist/testkit/TestProbe.d.ts.map +1 -1
  821. package/dist/testkit/TestProbe.js +2 -1
  822. package/dist/testkit/TestProbe.js.map +1 -1
  823. package/dist/testkit/TestProbeOptions.d.ts +26 -0
  824. package/dist/testkit/TestProbeOptions.d.ts.map +1 -0
  825. package/dist/testkit/TestProbeOptions.js +19 -0
  826. package/dist/testkit/TestProbeOptions.js.map +1 -0
  827. package/dist/testkit/index.d.ts +10 -2
  828. package/dist/testkit/index.d.ts.map +1 -1
  829. package/dist/testkit/index.js +5 -0
  830. package/dist/testkit/index.js.map +1 -1
  831. package/dist/testkit/internal/parallel-multi-node-bootstrap.d.ts.map +1 -1
  832. package/dist/testkit/internal/parallel-multi-node-bootstrap.js +16 -12
  833. package/dist/testkit/internal/parallel-multi-node-bootstrap.js.map +1 -1
  834. package/dist/tracing/OtelAdapter.d.ts +4 -12
  835. package/dist/tracing/OtelAdapter.d.ts.map +1 -1
  836. package/dist/tracing/OtelAdapter.js +4 -2
  837. package/dist/tracing/OtelAdapter.js.map +1 -1
  838. package/dist/tracing/OtelAdapterOptions.d.ts +42 -0
  839. package/dist/tracing/OtelAdapterOptions.d.ts.map +1 -0
  840. package/dist/tracing/OtelAdapterOptions.js +34 -0
  841. package/dist/tracing/OtelAdapterOptions.js.map +1 -0
  842. package/dist/tracing/OtelLogsAdapter.d.ts +100 -0
  843. package/dist/tracing/OtelLogsAdapter.d.ts.map +1 -0
  844. package/dist/tracing/OtelLogsAdapter.js +130 -0
  845. package/dist/tracing/OtelLogsAdapter.js.map +1 -0
  846. package/dist/tracing/index.d.ts +5 -1
  847. package/dist/tracing/index.d.ts.map +1 -1
  848. package/dist/tracing/index.js +2 -0
  849. package/dist/tracing/index.js.map +1 -1
  850. package/dist/util/Constants.d.ts +23 -0
  851. package/dist/util/Constants.d.ts.map +1 -1
  852. package/dist/util/Constants.js +23 -0
  853. package/dist/util/Constants.js.map +1 -1
  854. package/dist/util/Lazy.d.ts +31 -0
  855. package/dist/util/Lazy.d.ts.map +1 -1
  856. package/dist/util/Lazy.js +70 -0
  857. package/dist/util/Lazy.js.map +1 -1
  858. package/dist/util/OptionsBuilder.d.ts +48 -0
  859. package/dist/util/OptionsBuilder.d.ts.map +1 -0
  860. package/dist/util/OptionsBuilder.js +53 -0
  861. package/dist/util/OptionsBuilder.js.map +1 -0
  862. package/dist/worker/WorkerCluster.d.ts +2 -11
  863. package/dist/worker/WorkerCluster.d.ts.map +1 -1
  864. package/dist/worker/WorkerCluster.js +2 -1
  865. package/dist/worker/WorkerCluster.js.map +1 -1
  866. package/dist/worker/WorkerClusterOptions.d.ts +55 -0
  867. package/dist/worker/WorkerClusterOptions.d.ts.map +1 -0
  868. package/dist/worker/WorkerClusterOptions.js +55 -0
  869. package/dist/worker/WorkerClusterOptions.js.map +1 -0
  870. package/dist/worker/index.d.ts +3 -1
  871. package/dist/worker/index.d.ts.map +1 -1
  872. package/dist/worker/index.js +1 -0
  873. package/dist/worker/index.js.map +1 -1
  874. package/package.json +56 -13
  875. package/dist/io/broker/ServerWebSocketActor.d.ts +0 -109
  876. package/dist/io/broker/ServerWebSocketActor.d.ts.map +0 -1
  877. package/dist/io/broker/ServerWebSocketActor.js +0 -128
  878. package/dist/io/broker/ServerWebSocketActor.js.map +0 -1
  879. package/dist/io/broker/WebSocketActor.d.ts +0 -77
  880. package/dist/io/broker/WebSocketActor.d.ts.map +0 -1
  881. package/dist/io/broker/WebSocketActor.js +0 -217
  882. package/dist/io/broker/WebSocketActor.js.map +0 -1
  883. package/dist/io/broker/WebSocketServerAdapters.d.ts +0 -140
  884. package/dist/io/broker/WebSocketServerAdapters.d.ts.map +0 -1
  885. package/dist/io/broker/WebSocketServerAdapters.js +0 -155
  886. package/dist/io/broker/WebSocketServerAdapters.js.map +0 -1
@@ -1,23 +1,5 @@
1
- import type { Lease } from '../../coordination/Lease.js';
2
1
  import { type ClusterPartitionView, type DowningDecision, type DowningProvider } from './DowningProvider.js';
3
- export interface LeaseMajoritySettings {
4
- /**
5
- * External arbiter — typically a `KubernetesLease` so both sides
6
- * of a partition reach the same K8s API and only one acquires.
7
- * Each replica owns its own `Lease` instance with a distinct
8
- * `owner` (its node address); the underlying lease record is
9
- * shared (same `name`).
10
- */
11
- readonly lease: Lease;
12
- /**
13
- * Hard ceiling on a single `acquire()` attempt. After this we
14
- * return no decision and let the next failure-detection tick
15
- * trigger a fresh attempt. Default: 5 s.
16
- */
17
- readonly acquireTimeoutMs?: number;
18
- /** If set, only members carrying this role count toward the majority. */
19
- readonly role?: string;
20
- }
2
+ import type { LeaseMajorityOptions } from './LeaseMajorityOptions.js';
21
3
  /**
22
4
  * Split-brain resolver that uses an external `Lease` to break ties
23
5
  * when the cluster splits into equal-sized partitions — the case
@@ -46,9 +28,41 @@ export interface LeaseMajoritySettings {
46
28
  * `acquire()` rejects → strategy stays in pending state and returns
47
29
  * an empty decision. Better to wait than to risk both sides
48
30
  * surviving.
31
+ *
32
+ * **Slow / hung acquire (#142 split-brain hardening)**
33
+ *
34
+ * If `lease.acquire()` hasn't resolved by `acquireTimeoutMs`, the
35
+ * defence-in-depth logic kicks in:
36
+ *
37
+ * - **Epoch invalidation** — every kickoff captures a monotonic
38
+ * `acquireEpoch`. The timeout-recovery bumps the epoch, so a
39
+ * late-arriving result from the timed-out attempt is dropped
40
+ * (it can't write a stale `decision`).
41
+ * - **Release-on-abandon** — we fire-and-forget `lease.release()`
42
+ * to undo any acquire that may have succeeded on the wire
43
+ * after we gave up locally. Without this, an acquire that
44
+ * timed out on the client but succeeded on the server leaves
45
+ * the lease record claimed without anyone observing the win —
46
+ * a classic stale-token split-brain vector.
47
+ * - **Fail-safe on release failure** — if the abandoning release
48
+ * itself rejects, the lease state is now ambiguous (we may or
49
+ * may not hold it; we can't tell). The strategy enters
50
+ * fail-safe: every subsequent `decide()` for the same partition
51
+ * view returns an empty decision, refusing to claim majority
52
+ * until the partition heals (which resets the fail-safe flag).
53
+ *
54
+ * **Fencing tokens (optional)**
55
+ *
56
+ * If the underlying `Lease` implements `acquireWithToken()` (K8s
57
+ * Lease's `resourceVersion`, Redis SETNX with counter, etc.), the
58
+ * strategy uses it instead of plain `acquire()`. The token isn't
59
+ * inspected at decide-time — the local epoch is the source of
60
+ * truth for "is this result still valid?" — but having the token
61
+ * means tighter integration with the underlying lease's native
62
+ * fencing primitive (e.g. release-with-token semantics, when
63
+ * future work adds them).
49
64
  */
50
65
  export declare class LeaseMajority implements DowningProvider {
51
- private readonly settings;
52
66
  /** Cached decision once acquire has resolved. Cleared on a fresh
53
67
  * partition view so a new split triggers a new acquire. */
54
68
  private decision;
@@ -61,9 +75,37 @@ export declare class LeaseMajority implements DowningProvider {
61
75
  /** Wall-clock deadline of the in-flight acquire — used to recover
62
76
  * if `acquire()` hangs longer than the user's budget. */
63
77
  private acquireDeadline;
64
- constructor(settings: LeaseMajoritySettings);
78
+ /**
79
+ * Monotonic counter incremented on every acquire kickoff AND on
80
+ * every timeout / reset. `runAcquire` captures the epoch at start
81
+ * and drops its result if the epoch has moved on by the time it
82
+ * resolves — that's the core of #142's stale-acquire protection.
83
+ */
84
+ private acquireEpoch;
85
+ /**
86
+ * Set when an abandoning `release()` itself failed. The lease's
87
+ * holder identity is now ambiguous and we MUST NOT claim majority
88
+ * until the partition heals (which clears the flag). See #142.
89
+ */
90
+ private failSafe;
91
+ private readonly settings;
92
+ constructor(options: LeaseMajorityOptions);
65
93
  decide(view: ClusterPartitionView): DowningDecision;
94
+ /**
95
+ * Run a single acquire attempt, scoped to a captured epoch. The
96
+ * write to `this.decision` only happens if the epoch is still
97
+ * current at resolve time — that's how we drop stale results
98
+ * from a previously-timed-out attempt.
99
+ */
66
100
  private runAcquire;
101
+ /**
102
+ * Best-effort release of any in-flight ownership after a timeout.
103
+ * If the release itself rejects, the lease state is ambiguous and
104
+ * the strategy enters fail-safe. Same epoch as the abandoned
105
+ * acquire — if a fresh acquire has already kicked off (incremented
106
+ * epoch beyond ours), the failure isn't ours to act on.
107
+ */
108
+ private runAbandonRelease;
67
109
  private reset;
68
110
  private fingerprintOf;
69
111
  }
@@ -1 +1 @@
1
- {"version":3,"file":"LeaseMajority.d.ts","sourceRoot":"","sources":["../../../src/cluster/downing/LeaseMajority.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAEL,KAAK,oBAAoB,EACzB,KAAK,eAAe,EACpB,KAAK,eAAe,EACrB,MAAM,sBAAsB,CAAC;AAE9B,MAAM,WAAW,qBAAqB;IACpC;;;;;;OAMG;IACH,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC;IACtB;;;;OAIG;IACH,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IACnC,yEAAyE;IACzE,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,qBAAa,aAAc,YAAW,eAAe;IAiBvC,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAhBrC;gEAC4D;IAC5D,OAAO,CAAC,QAAQ,CAAgC;IAEhD,8CAA8C;IAC9C,OAAO,CAAC,SAAS,CAAS;IAE1B;;4BAEwB;IACxB,OAAO,CAAC,eAAe,CAAuB;IAE9C;8DAC0D;IAC1D,OAAO,CAAC,eAAe,CAAK;gBAEC,QAAQ,EAAE,qBAAqB;IAE5D,MAAM,CAAC,IAAI,EAAE,oBAAoB,GAAG,eAAe;YAmErC,UAAU;IAiBxB,OAAO,CAAC,KAAK;IAMb,OAAO,CAAC,aAAa;CAQtB"}
1
+ {"version":3,"file":"LeaseMajority.d.ts","sourceRoot":"","sources":["../../../src/cluster/downing/LeaseMajority.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,oBAAoB,EACzB,KAAK,eAAe,EACpB,KAAK,eAAe,EACrB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,oBAAoB,EAA4B,MAAM,2BAA2B,CAAC;AAEhG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6DG;AACH,qBAAa,aAAc,YAAW,eAAe;IACnD;gEAC4D;IAC5D,OAAO,CAAC,QAAQ,CAAgC;IAEhD,8CAA8C;IAC9C,OAAO,CAAC,SAAS,CAAS;IAE1B;;4BAEwB;IACxB,OAAO,CAAC,eAAe,CAAuB;IAE9C;8DAC0D;IAC1D,OAAO,CAAC,eAAe,CAAK;IAE5B;;;;;OAKG;IACH,OAAO,CAAC,YAAY,CAAK;IAEzB;;;;OAIG;IACH,OAAO,CAAC,QAAQ,CAAS;IAEzB,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAA2B;gBAExC,OAAO,EAAE,oBAAoB;IAIzC,MAAM,CAAC,IAAI,EAAE,oBAAoB,GAAG,eAAe;IAsFnD;;;;;OAKG;YACW,UAAU;IA4CxB;;;;;;OAMG;YACW,iBAAiB;IAe/B,OAAO,CAAC,KAAK;IAWb,OAAO,CAAC,aAAa;CAQtB"}
@@ -27,9 +27,41 @@ import { addrKey, } from './DowningProvider.js';
27
27
  * `acquire()` rejects → strategy stays in pending state and returns
28
28
  * an empty decision. Better to wait than to risk both sides
29
29
  * surviving.
30
+ *
31
+ * **Slow / hung acquire (#142 split-brain hardening)**
32
+ *
33
+ * If `lease.acquire()` hasn't resolved by `acquireTimeoutMs`, the
34
+ * defence-in-depth logic kicks in:
35
+ *
36
+ * - **Epoch invalidation** — every kickoff captures a monotonic
37
+ * `acquireEpoch`. The timeout-recovery bumps the epoch, so a
38
+ * late-arriving result from the timed-out attempt is dropped
39
+ * (it can't write a stale `decision`).
40
+ * - **Release-on-abandon** — we fire-and-forget `lease.release()`
41
+ * to undo any acquire that may have succeeded on the wire
42
+ * after we gave up locally. Without this, an acquire that
43
+ * timed out on the client but succeeded on the server leaves
44
+ * the lease record claimed without anyone observing the win —
45
+ * a classic stale-token split-brain vector.
46
+ * - **Fail-safe on release failure** — if the abandoning release
47
+ * itself rejects, the lease state is now ambiguous (we may or
48
+ * may not hold it; we can't tell). The strategy enters
49
+ * fail-safe: every subsequent `decide()` for the same partition
50
+ * view returns an empty decision, refusing to claim majority
51
+ * until the partition heals (which resets the fail-safe flag).
52
+ *
53
+ * **Fencing tokens (optional)**
54
+ *
55
+ * If the underlying `Lease` implements `acquireWithToken()` (K8s
56
+ * Lease's `resourceVersion`, Redis SETNX with counter, etc.), the
57
+ * strategy uses it instead of plain `acquire()`. The token isn't
58
+ * inspected at decide-time — the local epoch is the source of
59
+ * truth for "is this result still valid?" — but having the token
60
+ * means tighter integration with the underlying lease's native
61
+ * fencing primitive (e.g. release-with-token semantics, when
62
+ * future work adds them).
30
63
  */
31
64
  export class LeaseMajority {
32
- settings;
33
65
  /** Cached decision once acquire has resolved. Cleared on a fresh
34
66
  * partition view so a new split triggers a new acquire. */
35
67
  decision = null;
@@ -42,8 +74,22 @@ export class LeaseMajority {
42
74
  /** Wall-clock deadline of the in-flight acquire — used to recover
43
75
  * if `acquire()` hangs longer than the user's budget. */
44
76
  acquireDeadline = 0;
45
- constructor(settings) {
46
- this.settings = settings;
77
+ /**
78
+ * Monotonic counter incremented on every acquire kickoff AND on
79
+ * every timeout / reset. `runAcquire` captures the epoch at start
80
+ * and drops its result if the epoch has moved on by the time it
81
+ * resolves — that's the core of #142's stale-acquire protection.
82
+ */
83
+ acquireEpoch = 0;
84
+ /**
85
+ * Set when an abandoning `release()` itself failed. The lease's
86
+ * holder identity is now ambiguous and we MUST NOT claim majority
87
+ * until the partition heals (which clears the flag). See #142.
88
+ */
89
+ failSafe = false;
90
+ settings;
91
+ constructor(options) {
92
+ this.settings = options;
47
93
  }
48
94
  decide(view) {
49
95
  const candidates = view.allMembers.filter((m) => (m.status === 'up' || m.status === 'leaving' || m.status === 'unreachable') &&
@@ -78,6 +124,15 @@ export class LeaseMajority {
78
124
  }
79
125
  // Equal-size partition (or stuck-quorum corner case) — Lease
80
126
  // arbitration kicks in.
127
+ // Fail-safe: a prior abandon-release failed and the lease state
128
+ // is ambiguous. Refuse to claim majority until the partition
129
+ // heals (which clears the flag via reset()). Refuses to even
130
+ // kick off a fresh acquire — we don't know whether we already
131
+ // hold the lease, so a fresh acquire might "succeed" trivially
132
+ // (same-owner renew) and give us a false win. #142.
133
+ if (this.failSafe) {
134
+ return new Set();
135
+ }
81
136
  if (this.decision !== null) {
82
137
  // Cached from a prior tick on this same view.
83
138
  return this.decision;
@@ -86,10 +141,16 @@ export class LeaseMajority {
86
141
  // Recover if the acquire stalled past its budget. The Lease
87
142
  // implementation is supposed to honour its own retry/timeout
88
143
  // settings, but defence-in-depth: if it hasn't resolved by
89
- // the deadline, treat it as a transient failure and let the
90
- // next tick try again.
144
+ // the deadline, bump the epoch (so the late result is dropped)
145
+ // and proactively release any in-flight ownership — see #142.
91
146
  if (Date.now() > this.acquireDeadline) {
92
147
  this.acquiring = false;
148
+ // Bump the epoch FIRST so the late runAcquire bails out before
149
+ // it can touch `this.decision`.
150
+ this.acquireEpoch += 1;
151
+ // Fire-and-forget release. If it rejects, the lease state is
152
+ // ambiguous and we must enter fail-safe — see runAbandonRelease.
153
+ void this.runAbandonRelease();
93
154
  }
94
155
  return new Set();
95
156
  }
@@ -97,28 +158,90 @@ export class LeaseMajority {
97
158
  const downSelfSet = new Set(reachable.map(addrKey));
98
159
  this.acquiring = true;
99
160
  this.acquireDeadline = Date.now() + (this.settings.acquireTimeoutMs ?? 5_000);
100
- void this.runAcquire(surviveSet, downSelfSet);
161
+ this.acquireEpoch += 1;
162
+ const myEpoch = this.acquireEpoch;
163
+ void this.runAcquire(myEpoch, surviveSet, downSelfSet);
101
164
  return new Set();
102
165
  }
103
166
  /* ------------------------------ internals ------------------------------ */
104
- async runAcquire(surviveSet, downSelfSet) {
167
+ /**
168
+ * Run a single acquire attempt, scoped to a captured epoch. The
169
+ * write to `this.decision` only happens if the epoch is still
170
+ * current at resolve time — that's how we drop stale results
171
+ * from a previously-timed-out attempt.
172
+ */
173
+ async runAcquire(myEpoch, surviveSet, downSelfSet) {
105
174
  let won;
106
175
  try {
107
- won = await this.settings.lease.acquire();
176
+ // Prefer the fencing-token API when the backend implements it.
177
+ // The token isn't inspected here (local epoch is sufficient for
178
+ // stale detection at decide-time), but using the API where
179
+ // available means the underlying lease's native fencing
180
+ // primitive participates in the round-trip — useful for backend-
181
+ // specific consistency checks and a stepping-stone for future
182
+ // release-with-token semantics.
183
+ if (typeof this.settings.lease.acquireWithToken === 'function') {
184
+ const result = await this.settings.lease.acquireWithToken();
185
+ won = result !== null;
186
+ }
187
+ else {
188
+ won = await this.settings.lease.acquire();
189
+ }
108
190
  }
109
191
  catch {
110
192
  // Lease backend unreachable — stay pending. The next decide()
111
193
  // call sees `acquiring=false` (we clear it below) and restarts.
112
- this.acquiring = false;
194
+ // But only if our epoch is still current; otherwise the timeout
195
+ // path has already moved on and we should not touch shared state.
196
+ if (myEpoch === this.acquireEpoch) {
197
+ this.acquiring = false;
198
+ }
199
+ return;
200
+ }
201
+ // Stale resolve: the defence-in-depth timeout (or a reset()) has
202
+ // already invalidated this attempt. Drop the result silently —
203
+ // a fresh acquire is either already in flight or will be kicked
204
+ // off on the next decide(). Critical for #142: without this
205
+ // guard a slow `acquire() → true` could write `decision=surviveSet`
206
+ // after the operator considered the attempt abandoned, producing
207
+ // a split-brain where both sides "win".
208
+ if (myEpoch !== this.acquireEpoch) {
113
209
  return;
114
210
  }
115
211
  this.acquiring = false;
116
212
  this.decision = won ? surviveSet : downSelfSet;
117
213
  }
214
+ /**
215
+ * Best-effort release of any in-flight ownership after a timeout.
216
+ * If the release itself rejects, the lease state is ambiguous and
217
+ * the strategy enters fail-safe. Same epoch as the abandoned
218
+ * acquire — if a fresh acquire has already kicked off (incremented
219
+ * epoch beyond ours), the failure isn't ours to act on.
220
+ */
221
+ async runAbandonRelease() {
222
+ const myEpoch = this.acquireEpoch;
223
+ try {
224
+ await this.settings.lease.release();
225
+ }
226
+ catch {
227
+ // Release failed. We may or may not hold the lease — we can't
228
+ // tell. Mark fail-safe so we don't claim majority on this
229
+ // view. But only if our epoch is still current; if a partition
230
+ // heal has already reset() us, this older failure is moot.
231
+ if (myEpoch === this.acquireEpoch) {
232
+ this.failSafe = true;
233
+ }
234
+ }
235
+ }
118
236
  reset() {
119
237
  this.decision = null;
120
238
  this.acquiring = false;
121
239
  this.lastFingerprint = null;
240
+ this.failSafe = false;
241
+ // Bump the epoch so any in-flight runAcquire from before the
242
+ // reset drops its result instead of writing to the cleared
243
+ // decision.
244
+ this.acquireEpoch += 1;
122
245
  }
123
246
  fingerprintOf(reachable, unreachable) {
124
247
  const r = reachable.map((m) => m.address.toString()).sort().join(',');
@@ -1 +1 @@
1
- {"version":3,"file":"LeaseMajority.js","sourceRoot":"","sources":["../../../src/cluster/downing/LeaseMajority.ts"],"names":[],"mappings":"AACA,OAAO,EACL,OAAO,GAIR,MAAM,sBAAsB,CAAC;AAqB9B;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,MAAM,OAAO,aAAa;IAiBK;IAhB7B;gEAC4D;IACpD,QAAQ,GAA2B,IAAI,CAAC;IAEhD,8CAA8C;IACtC,SAAS,GAAG,KAAK,CAAC;IAE1B;;4BAEwB;IAChB,eAAe,GAAkB,IAAI,CAAC;IAE9C;8DAC0D;IAClD,eAAe,GAAG,CAAC,CAAC;IAE5B,YAA6B,QAA+B;QAA/B,aAAQ,GAAR,QAAQ,CAAuB;IAAG,CAAC;IAEhE,MAAM,CAAC,IAA0B;QAC/B,MAAM,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAC9C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M,CAAC;YACP,+DAA+D;YAC/D,2DAA2D;YAC3D,gEAAgE;YAChE,2DAA2D;YAC3D,IAAI,OAAO,KAAK,IAAI,CAAC,YAAY,EAAE,CAAC;gBAClC,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;YACvB,CAAC;QACH,CAAC;IACH,CAAC;IAEO,KAAK;QACX,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QACrB,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;QACvB,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC;QAC5B,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;QACtB,6DAA6D;QAC7D,2DAA2D;QAC3D,YAAY;QACZ,IAAI,CAAC,YAAY,IAAI,CAAC,CAAC;IACzB,CAAC;IAEO,aAAa,CACnB,SAA6D,EAC7D,WAA+D;QAE/D,MAAM,CAAC,GAAG,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACtE,MAAM,CAAC,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACxE,OAAO,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC;IAC3B,CAAC;CACF"}
@@ -0,0 +1,49 @@
1
+ import type { Lease } from '../../coordination/Lease.js';
2
+ import { OptionsBuilder } from '../../util/OptionsBuilder.js';
3
+ /** Plain settings-object shape accepted by {@link LeaseMajority}. */
4
+ export interface LeaseMajorityOptionsType {
5
+ /**
6
+ * External arbiter — typically a `KubernetesLease` so both sides
7
+ * of a partition reach the same K8s API and only one acquires.
8
+ * Each replica owns its own `Lease` instance with a distinct
9
+ * `owner` (its node address); the underlying lease record is
10
+ * shared (same `name`).
11
+ */
12
+ readonly lease: Lease;
13
+ /**
14
+ * Hard ceiling on a single `acquire()` attempt. After this we
15
+ * return no decision and let the next failure-detection tick
16
+ * trigger a fresh attempt. Default: 5 s.
17
+ */
18
+ readonly acquireTimeoutMs?: number;
19
+ /** If set, only members carrying this role count toward the majority. */
20
+ readonly role?: string;
21
+ }
22
+ /**
23
+ * Fluent builder for {@link LeaseMajorityOptionsType}:
24
+ *
25
+ * new LeaseMajority(
26
+ * LeaseMajorityOptions.create()
27
+ * .withLease(kubernetesLease)
28
+ * .withAcquireTimeoutMs(5_000),
29
+ * );
30
+ */
31
+ export declare class LeaseMajorityOptionsBuilder extends OptionsBuilder<LeaseMajorityOptionsType> {
32
+ /** Start a fresh builder. */
33
+ static create(): LeaseMajorityOptionsBuilder;
34
+ /** External arbiter lease — both sides of a partition contend for it. */
35
+ withLease(lease: Lease): this;
36
+ /** Hard ceiling on a single `acquire()` attempt in ms. Default 5 s. */
37
+ withAcquireTimeoutMs(ms: number): this;
38
+ /** Only members carrying this role count toward the majority. */
39
+ withRole(role: string): this;
40
+ }
41
+ /**
42
+ * Accepted input for the {@link LeaseMajority} constructor: the fluent
43
+ * {@link LeaseMajorityOptionsBuilder} OR a plain {@link LeaseMajorityOptionsType}
44
+ * object.
45
+ */
46
+ export type LeaseMajorityOptions = LeaseMajorityOptionsBuilder | Partial<LeaseMajorityOptionsType>;
47
+ /** Value alias so `LeaseMajorityOptions.create()` / `new LeaseMajorityOptions()` resolve to the builder. */
48
+ export declare const LeaseMajorityOptions: typeof LeaseMajorityOptionsBuilder;
49
+ //# sourceMappingURL=LeaseMajorityOptions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LeaseMajorityOptions.d.ts","sourceRoot":"","sources":["../../../src/cluster/downing/LeaseMajorityOptions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAE9D,qEAAqE;AACrE,MAAM,WAAW,wBAAwB;IACvC;;;;;;OAMG;IACH,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC;IACtB;;;;OAIG;IACH,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IACnC,yEAAyE;IACzE,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;;;;;;GAQG;AACH,qBAAa,2BAA4B,SAAQ,cAAc,CAAC,wBAAwB,CAAC;IACvF,6BAA6B;IAC7B,MAAM,CAAC,MAAM,IAAI,2BAA2B;IAI5C,yEAAyE;IACzE,SAAS,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI;IAI7B,wEAAwE;IACxE,oBAAoB,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI;IAItC,iEAAiE;IACjE,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;CAG7B;AAED;;;;GAIG;AACH,MAAM,MAAM,oBAAoB,GAAG,2BAA2B,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAAC;AACnG,4GAA4G;AAC5G,eAAO,MAAM,oBAAoB,oCAA8B,CAAC"}
@@ -0,0 +1,31 @@
1
+ import { OptionsBuilder } from '../../util/OptionsBuilder.js';
2
+ /**
3
+ * Fluent builder for {@link LeaseMajorityOptionsType}:
4
+ *
5
+ * new LeaseMajority(
6
+ * LeaseMajorityOptions.create()
7
+ * .withLease(kubernetesLease)
8
+ * .withAcquireTimeoutMs(5_000),
9
+ * );
10
+ */
11
+ export class LeaseMajorityOptionsBuilder extends OptionsBuilder {
12
+ /** Start a fresh builder. */
13
+ static create() {
14
+ return new LeaseMajorityOptionsBuilder();
15
+ }
16
+ /** External arbiter lease — both sides of a partition contend for it. */
17
+ withLease(lease) {
18
+ return this.set('lease', lease);
19
+ }
20
+ /** Hard ceiling on a single `acquire()` attempt in ms. Default 5 s. */
21
+ withAcquireTimeoutMs(ms) {
22
+ return this.set('acquireTimeoutMs', ms);
23
+ }
24
+ /** Only members carrying this role count toward the majority. */
25
+ withRole(role) {
26
+ return this.set('role', role);
27
+ }
28
+ }
29
+ /** Value alias so `LeaseMajorityOptions.create()` / `new LeaseMajorityOptions()` resolve to the builder. */
30
+ export const LeaseMajorityOptions = LeaseMajorityOptionsBuilder;
31
+ //# sourceMappingURL=LeaseMajorityOptions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LeaseMajorityOptions.js","sourceRoot":"","sources":["../../../src/cluster/downing/LeaseMajorityOptions.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAsB9D;;;;;;;;GAQG;AACH,MAAM,OAAO,2BAA4B,SAAQ,cAAwC;IACvF,6BAA6B;IAC7B,MAAM,CAAC,MAAM;QACX,OAAO,IAAI,2BAA2B,EAAE,CAAC;IAC3C,CAAC;IAED,yEAAyE;IACzE,SAAS,CAAC,KAAY;QACpB,OAAO,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IAClC,CAAC;IAED,wEAAwE;IACxE,oBAAoB,CAAC,EAAU;QAC7B,OAAO,IAAI,CAAC,GAAG,CAAC,kBAAkB,EAAE,EAAE,CAAC,CAAC;IAC1C,CAAC;IAED,iEAAiE;IACjE,QAAQ,CAAC,IAAY;QACnB,OAAO,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IAChC,CAAC;CACF;AAQD,4GAA4G;AAC5G,MAAM,CAAC,MAAM,oBAAoB,GAAG,2BAA2B,CAAC"}
@@ -1,10 +1,5 @@
1
1
  import { type ClusterPartitionView, type DowningDecision, type DowningProvider } from './DowningProvider.js';
2
- export interface StaticQuorumSettings {
3
- /** Exact size of the quorum needed on the reachable side. */
4
- readonly quorumSize: number;
5
- /** If set, only members carrying this role count toward quorum. */
6
- readonly role?: string;
7
- }
2
+ import type { StaticQuorumOptions } from './StaticQuorumOptions.js';
8
3
  /**
9
4
  * "Static quorum" — as long as at least `quorumSize` reachable members are
10
5
  * up on this side, keep them and down the rest. Otherwise, down ourselves.
@@ -15,7 +10,7 @@ export interface StaticQuorumSettings {
15
10
  */
16
11
  export declare class StaticQuorum implements DowningProvider {
17
12
  private readonly settings;
18
- constructor(settings: StaticQuorumSettings);
13
+ constructor(options: StaticQuorumOptions);
19
14
  decide(view: ClusterPartitionView): DowningDecision;
20
15
  }
21
16
  //# sourceMappingURL=StaticQuorum.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"StaticQuorum.d.ts","sourceRoot":"","sources":["../../../src/cluster/downing/StaticQuorum.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,oBAAoB,EACzB,KAAK,eAAe,EACpB,KAAK,eAAe,EACrB,MAAM,sBAAsB,CAAC;AAE9B,MAAM,WAAW,oBAAoB;IACnC,6DAA6D;IAC7D,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,mEAAmE;IACnE,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;;;;;GAOG;AACH,qBAAa,YAAa,YAAW,eAAe;IACtC,OAAO,CAAC,QAAQ,CAAC,QAAQ;gBAAR,QAAQ,EAAE,oBAAoB;IAM3D,MAAM,CAAC,IAAI,EAAE,oBAAoB,GAAG,eAAe;CAepD"}
1
+ {"version":3,"file":"StaticQuorum.d.ts","sourceRoot":"","sources":["../../../src/cluster/downing/StaticQuorum.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,oBAAoB,EACzB,KAAK,eAAe,EACpB,KAAK,eAAe,EACrB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,mBAAmB,EAA2B,MAAM,0BAA0B,CAAC;AAE7F;;;;;;;GAOG;AACH,qBAAa,YAAa,YAAW,eAAe;IAClD,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAA0B;gBAEvC,OAAO,EAAE,mBAAmB;IAOxC,MAAM,CAAC,IAAI,EAAE,oBAAoB,GAAG,eAAe;CAepD"}
@@ -9,9 +9,9 @@ import { addrKey, } from './DowningProvider.js';
9
9
  */
10
10
  export class StaticQuorum {
11
11
  settings;
12
- constructor(settings) {
13
- this.settings = settings;
14
- if (settings.quorumSize < 1) {
12
+ constructor(options) {
13
+ this.settings = options;
14
+ if (this.settings.quorumSize < 1) {
15
15
  throw new Error('StaticQuorum: quorumSize must be >= 1');
16
16
  }
17
17
  }
@@ -1 +1 @@
1
- {"version":3,"file":"StaticQuorum.js","sourceRoot":"","sources":["../../../src/cluster/downing/StaticQuorum.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,GAIR,MAAM,sBAAsB,CAAC;AAS9B;;;;;;;GAOG;AACH,MAAM,OAAO,YAAY;IACM;IAA7B,YAA6B,QAA8B;QAA9B,aAAQ,GAAR,QAAQ,CAAsB;QACzD,IAAI,QAAQ,CAAC,UAAU,GAAG,CAAC,EAAE,CAAC;YAC5B,MAAM,IAAI,KAAK,CAAC,uCAAuC,CAAC,CAAC;QAC3D,CAAC;IACH,CAAC;IAED,MAAM,CAAC,IAA0B;QAC/B,MAAM,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAC9C,CAAC,CAAC,CAAC,MAAM,KAAK,IAAI,IAAI,CAAC,CAAC,MAAM,KAAK,SAAS,IAAI,CAAC,CAAC,MAAM,KAAK,aAAa,CAAC;YAC3E,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,IAAI,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CACvD,CAAC;QAEF,MAAM,SAAS,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC9E,MAAM,WAAW,GAAG,UAAU,CAAC,MAAM,C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AE,EAAE,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC9E,MAAM,WAAW,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAE/E,IAAI,SAAS,CAAC,MAAM,IAAI,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE,CAAC;YACjD,OAAO,IAAI,GAAG,CAAC,WAAW,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC;QAC3C,CAAC;QACD,6DAA6D;QAC7D,OAAO,IAAI,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC;IACzC,CAAC;CACF"}
@@ -0,0 +1,30 @@
1
+ import { OptionsBuilder } from '../../util/OptionsBuilder.js';
2
+ /** Plain settings-object shape accepted by {@link StaticQuorum}. */
3
+ export interface StaticQuorumOptionsType {
4
+ /** Exact size of the quorum needed on the reachable side. */
5
+ readonly quorumSize: number;
6
+ /** If set, only members carrying this role count toward quorum. */
7
+ readonly role?: string;
8
+ }
9
+ /**
10
+ * Fluent builder for {@link StaticQuorumOptionsType}:
11
+ *
12
+ * new StaticQuorum(StaticQuorumOptions.create().withQuorumSize(3));
13
+ */
14
+ export declare class StaticQuorumOptionsBuilder extends OptionsBuilder<StaticQuorumOptionsType> {
15
+ /** Start a fresh builder. */
16
+ static create(): StaticQuorumOptionsBuilder;
17
+ /** Exact size of the quorum needed on the reachable side. */
18
+ withQuorumSize(quorumSize: number): this;
19
+ /** Only members carrying this role count toward quorum. */
20
+ withRole(role: string): this;
21
+ }
22
+ /**
23
+ * Accepted input for the {@link StaticQuorum} constructor: the fluent
24
+ * {@link StaticQuorumOptionsBuilder} OR a plain {@link StaticQuorumOptionsType}
25
+ * object.
26
+ */
27
+ export type StaticQuorumOptions = StaticQuorumOptionsBuilder | Partial<StaticQuorumOptionsType>;
28
+ /** Value alias so `StaticQuorumOptions.create()` / `new StaticQuorumOptions()` resolve to the builder. */
29
+ export declare const StaticQuorumOptions: typeof StaticQuorumOptionsBuilder;
30
+ //# sourceMappingURL=StaticQuorumOptions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StaticQuorumOptions.d.ts","sourceRoot":"","sources":["../../../src/cluster/downing/StaticQuorumOptions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAE9D,oEAAoE;AACpE,MAAM,WAAW,uBAAuB;IACtC,6DAA6D;IAC7D,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,mEAAmE;IACnE,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;;GAIG;AACH,qBAAa,0BAA2B,SAAQ,cAAc,CAAC,uBAAuB,CAAC;IACrF,6BAA6B;IAC7B,MAAM,CAAC,MAAM,IAAI,0BAA0B;IAI3C,6DAA6D;IAC7D,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI;IAIxC,2DAA2D;IAC3D,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;CAG7B;AAED;;;;GAIG;AACH,MAAM,MAAM,mBAAmB,GAAG,0BAA0B,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAAC;AAChG,0GAA0G;AAC1G,eAAO,MAAM,mBAAmB,mCAA6B,CAAC"}
@@ -0,0 +1,23 @@
1
+ import { OptionsBuilder } from '../../util/OptionsBuilder.js';
2
+ /**
3
+ * Fluent builder for {@link StaticQuorumOptionsType}:
4
+ *
5
+ * new StaticQuorum(StaticQuorumOptions.create().withQuorumSize(3));
6
+ */
7
+ export class StaticQuorumOptionsBuilder extends OptionsBuilder {
8
+ /** Start a fresh builder. */
9
+ static create() {
10
+ return new StaticQuorumOptionsBuilder();
11
+ }
12
+ /** Exact size of the quorum needed on the reachable side. */
13
+ withQuorumSize(quorumSize) {
14
+ return this.set('quorumSize', quorumSize);
15
+ }
16
+ /** Only members carrying this role count toward quorum. */
17
+ withRole(role) {
18
+ return this.set('role', role);
19
+ }
20
+ }
21
+ /** Value alias so `StaticQuorumOptions.create()` / `new StaticQuorumOptions()` resolve to the builder. */
22
+ export const StaticQuorumOptions = StaticQuorumOptionsBuilder;
23
+ //# sourceMappingURL=StaticQuorumOptions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StaticQuorumOptions.js","sourceRoot":"","sources":["../../../src/cluster/downing/StaticQuorumOptions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAU9D;;;;GAIG;AACH,MAAM,OAAO,0BAA2B,SAAQ,cAAuC;IACrF,6BAA6B;IAC7B,MAAM,CAAC,MAAM;QACX,OAAO,IAAI,0BAA0B,EAAE,CAAC;IAC1C,CAAC;IAED,6DAA6D;IAC7D,cAAc,CAAC,UAAkB;QAC/B,OAAO,IAAI,CAAC,GAAG,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;IAC5C,CAAC;IAED,2DAA2D;IAC3D,QAAQ,CAAC,IAAY;QACnB,OAAO,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IAChC,CAAC;CACF;AAQD,0GAA0G;AAC1G,MAAM,CAAC,MAAM,mBAAmB,GAAG,0BAA0B,CAAC"}
@@ -1,13 +1,17 @@
1
1
  export { KeepMajority } from './KeepMajority.js';
2
2
  export type { KeepMajoritySettings } from './KeepMajority.js';
3
3
  export { KeepOldest } from './KeepOldest.js';
4
- export type { KeepOldestSettings } from './KeepOldest.js';
4
+ export { KeepOldestOptions, KeepOldestOptionsBuilder } from './KeepOldestOptions.js';
5
+ export type { KeepOldestOptionsType } from './KeepOldestOptions.js';
5
6
  export { StaticQuorum } from './StaticQuorum.js';
6
- export type { StaticQuorumSettings } from './StaticQuorum.js';
7
+ export { StaticQuorumOptions, StaticQuorumOptionsBuilder } from './StaticQuorumOptions.js';
8
+ export type { StaticQuorumOptionsType } from './StaticQuorumOptions.js';
7
9
  export { KeepReferee } from './KeepReferee.js';
8
- export type { KeepRefereeSettings } from './KeepReferee.js';
10
+ export { KeepRefereeOptions, KeepRefereeOptionsBuilder } from './KeepRefereeOptions.js';
11
+ export type { KeepRefereeOptionsType } from './KeepRefereeOptions.js';
9
12
  export { LeaseMajority } from './LeaseMajority.js';
10
- export type { LeaseMajoritySettings } from './LeaseMajority.js';
13
+ export { LeaseMajorityOptions, LeaseMajorityOptionsBuilder } from './LeaseMajorityOptions.js';
14
+ export type { LeaseMajorityOptionsType } from './LeaseMajorityOptions.js';
11
15
  export { addrKey } from './DowningProvider.js';
12
16
  export type { DowningProvider, DowningDecision, ClusterPartitionView, } from './DowningProvider.js';
13
17
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cluster/downing/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,YAAY,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,YAAY,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,YAAY,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,YAAY,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,YAAY,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,YAAY,EACV,eAAe,EACf,eAAe,EACf,oBAAoB,GACrB,MAAM,sBAAsB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cluster/downing/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,YAAY,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AACrF,YAAY,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AACpE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,mBAAmB,EAAE,0BAA0B,EAAE,MAAM,0BAA0B,CAAC;AAC3F,YAAY,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AACxE,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAC;AACxF,YAAY,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,2BAA2B,EAAE,MAAM,2BAA2B,CAAC;AAC9F,YAAY,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AAC1E,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,YAAY,EACV,eAAe,EACf,eAAe,EACf,oBAAoB,GACrB,MAAM,sBAAsB,CAAC"}
@@ -1,7 +1,11 @@
1
1
  export { KeepMajority } from './KeepMajority.js';
2
2
  export { KeepOldest } from './KeepOldest.js';
3
+ export { KeepOldestOptions, KeepOldestOptionsBuilder } from './KeepOldestOptions.js';
3
4
  export { StaticQuorum } from './StaticQuorum.js';
5
+ export { StaticQuorumOptions, StaticQuorumOptionsBuilder } from './StaticQuorumOptions.js';
4
6
  export { KeepReferee } from './KeepReferee.js';
7
+ export { KeepRefereeOptions, KeepRefereeOptionsBuilder } from './KeepRefereeOptions.js';
5
8
  export { LeaseMajority } from './LeaseMajority.js';
9
+ export { LeaseMajorityOptions, LeaseMajorityOptionsBuilder } from './LeaseMajorityOptions.js';
6
10
  export { addrKey } from './DowningProvider.js';
7
11
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/cluster/downing/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/cluster/downing/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAErF,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,mBAAmB,EAAE,0BAA0B,EAAE,MAAM,0BAA0B,CAAC;AAE3F,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAC;AAExF,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,2BAA2B,EAAE,MAAM,2BAA2B,CAAC;AAE9F,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC"}