actor-ts 0.9.1 → 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.
- package/CHANGELOG.md +382 -0
- package/README.md +285 -269
- package/dist/ActorSystem.d.ts +3 -38
- package/dist/ActorSystem.d.ts.map +1 -1
- package/dist/ActorSystem.js +2 -2
- package/dist/ActorSystem.js.map +1 -1
- package/dist/ActorSystemOptions.d.ts +91 -0
- package/dist/ActorSystemOptions.d.ts.map +1 -0
- package/dist/ActorSystemOptions.js +45 -0
- package/dist/ActorSystemOptions.js.map +1 -0
- package/dist/Logger.d.ts +63 -0
- package/dist/Logger.d.ts.map +1 -1
- package/dist/Logger.js +146 -0
- package/dist/Logger.js.map +1 -1
- package/dist/cache/MemcachedCache.d.ts +2 -12
- package/dist/cache/MemcachedCache.d.ts.map +1 -1
- package/dist/cache/MemcachedCache.js +2 -1
- package/dist/cache/MemcachedCache.js.map +1 -1
- package/dist/cache/MemcachedCacheOptions.d.ts +40 -0
- package/dist/cache/MemcachedCacheOptions.d.ts.map +1 -0
- package/dist/cache/MemcachedCacheOptions.js +32 -0
- package/dist/cache/MemcachedCacheOptions.js.map +1 -0
- package/dist/cache/RedisCache.d.ts +2 -22
- package/dist/cache/RedisCache.d.ts.map +1 -1
- package/dist/cache/RedisCache.js +2 -1
- package/dist/cache/RedisCache.js.map +1 -1
- package/dist/cache/RedisCacheOptions.d.ts +56 -0
- package/dist/cache/RedisCacheOptions.d.ts.map +1 -0
- package/dist/cache/RedisCacheOptions.js +43 -0
- package/dist/cache/RedisCacheOptions.js.map +1 -0
- package/dist/cache/index.d.ts +6 -2
- package/dist/cache/index.d.ts.map +1 -1
- package/dist/cache/index.js +2 -0
- package/dist/cache/index.js.map +1 -1
- package/dist/cluster/Cluster.d.ts +4 -63
- package/dist/cluster/Cluster.d.ts.map +1 -1
- package/dist/cluster/Cluster.js +10 -5
- package/dist/cluster/Cluster.js.map +1 -1
- package/dist/cluster/ClusterBootstrap.d.ts +6 -84
- package/dist/cluster/ClusterBootstrap.d.ts.map +1 -1
- package/dist/cluster/ClusterBootstrap.js +33 -21
- package/dist/cluster/ClusterBootstrap.js.map +1 -1
- package/dist/cluster/ClusterBootstrapOptions.d.ts +152 -0
- package/dist/cluster/ClusterBootstrapOptions.d.ts.map +1 -0
- package/dist/cluster/ClusterBootstrapOptions.js +103 -0
- package/dist/cluster/ClusterBootstrapOptions.js.map +1 -0
- package/dist/cluster/ClusterClient.d.ts +21 -31
- package/dist/cluster/ClusterClient.d.ts.map +1 -1
- package/dist/cluster/ClusterClient.js +21 -6
- package/dist/cluster/ClusterClient.js.map +1 -1
- package/dist/cluster/ClusterClientOptions.d.ts +65 -0
- package/dist/cluster/ClusterClientOptions.d.ts.map +1 -0
- package/dist/cluster/ClusterClientOptions.js +43 -0
- package/dist/cluster/ClusterClientOptions.js.map +1 -0
- package/dist/cluster/ClusterClientReceptionist.d.ts +2 -8
- package/dist/cluster/ClusterClientReceptionist.d.ts.map +1 -1
- package/dist/cluster/ClusterClientReceptionist.js +3 -1
- package/dist/cluster/ClusterClientReceptionist.js.map +1 -1
- package/dist/cluster/ClusterClientReceptionistOptions.d.ts +32 -0
- package/dist/cluster/ClusterClientReceptionistOptions.d.ts.map +1 -0
- package/dist/cluster/ClusterClientReceptionistOptions.js +22 -0
- package/dist/cluster/ClusterClientReceptionistOptions.js.map +1 -0
- package/dist/cluster/ClusterOptions.d.ts +116 -0
- package/dist/cluster/ClusterOptions.d.ts.map +1 -0
- package/dist/cluster/ClusterOptions.js +77 -0
- package/dist/cluster/ClusterOptions.js.map +1 -0
- package/dist/cluster/FailureDetector.d.ts +4 -11
- package/dist/cluster/FailureDetector.d.ts.map +1 -1
- package/dist/cluster/FailureDetector.js +4 -3
- package/dist/cluster/FailureDetector.js.map +1 -1
- package/dist/cluster/FailureDetectorOptions.d.ts +38 -0
- package/dist/cluster/FailureDetectorOptions.d.ts.map +1 -0
- package/dist/cluster/FailureDetectorOptions.js +31 -0
- package/dist/cluster/FailureDetectorOptions.js.map +1 -0
- package/dist/cluster/PhiAccrualFailureDetector.d.ts +3 -19
- package/dist/cluster/PhiAccrualFailureDetector.d.ts.map +1 -1
- package/dist/cluster/PhiAccrualFailureDetector.js +2 -2
- package/dist/cluster/PhiAccrualFailureDetector.js.map +1 -1
- package/dist/cluster/PhiAccrualOptions.d.ts +53 -0
- package/dist/cluster/PhiAccrualOptions.d.ts.map +1 -0
- package/dist/cluster/PhiAccrualOptions.js +43 -0
- package/dist/cluster/PhiAccrualOptions.js.map +1 -0
- package/dist/cluster/downing/KeepOldest.d.ts +2 -11
- package/dist/cluster/downing/KeepOldest.d.ts.map +1 -1
- package/dist/cluster/downing/KeepOldest.js +2 -2
- package/dist/cluster/downing/KeepOldest.js.map +1 -1
- package/dist/cluster/downing/KeepOldestOptions.d.ts +34 -0
- package/dist/cluster/downing/KeepOldestOptions.d.ts.map +1 -0
- package/dist/cluster/downing/KeepOldestOptions.js +23 -0
- package/dist/cluster/downing/KeepOldestOptions.js.map +1 -0
- package/dist/cluster/downing/KeepReferee.d.ts +2 -10
- package/dist/cluster/downing/KeepReferee.d.ts.map +1 -1
- package/dist/cluster/downing/KeepReferee.js +3 -3
- package/dist/cluster/downing/KeepReferee.js.map +1 -1
- package/dist/cluster/downing/KeepRefereeOptions.d.ts +35 -0
- package/dist/cluster/downing/KeepRefereeOptions.d.ts.map +1 -0
- package/dist/cluster/downing/KeepRefereeOptions.js +25 -0
- package/dist/cluster/downing/KeepRefereeOptions.js.map +1 -0
- package/dist/cluster/downing/LeaseMajority.d.ts +63 -21
- package/dist/cluster/downing/LeaseMajority.d.ts.map +1 -1
- package/dist/cluster/downing/LeaseMajority.js +132 -9
- package/dist/cluster/downing/LeaseMajority.js.map +1 -1
- package/dist/cluster/downing/LeaseMajorityOptions.d.ts +49 -0
- package/dist/cluster/downing/LeaseMajorityOptions.d.ts.map +1 -0
- package/dist/cluster/downing/LeaseMajorityOptions.js +31 -0
- package/dist/cluster/downing/LeaseMajorityOptions.js.map +1 -0
- package/dist/cluster/downing/StaticQuorum.d.ts +2 -7
- package/dist/cluster/downing/StaticQuorum.d.ts.map +1 -1
- package/dist/cluster/downing/StaticQuorum.js +3 -3
- package/dist/cluster/downing/StaticQuorum.js.map +1 -1
- package/dist/cluster/downing/StaticQuorumOptions.d.ts +30 -0
- package/dist/cluster/downing/StaticQuorumOptions.d.ts.map +1 -0
- package/dist/cluster/downing/StaticQuorumOptions.js +23 -0
- package/dist/cluster/downing/StaticQuorumOptions.js.map +1 -0
- package/dist/cluster/downing/index.d.ts +8 -4
- package/dist/cluster/downing/index.d.ts.map +1 -1
- package/dist/cluster/downing/index.js +4 -0
- package/dist/cluster/downing/index.js.map +1 -1
- package/dist/cluster/index.d.ts +34 -19
- package/dist/cluster/index.d.ts.map +1 -1
- package/dist/cluster/index.js +15 -4
- package/dist/cluster/index.js.map +1 -1
- package/dist/cluster/pubsub/DistributedPubSubExtension.d.ts +2 -2
- package/dist/cluster/pubsub/DistributedPubSubExtension.d.ts.map +1 -1
- package/dist/cluster/pubsub/DistributedPubSubExtension.js +5 -2
- package/dist/cluster/pubsub/DistributedPubSubExtension.js.map +1 -1
- package/dist/cluster/pubsub/DistributedPubSubMediator.d.ts +3 -7
- package/dist/cluster/pubsub/DistributedPubSubMediator.d.ts.map +1 -1
- package/dist/cluster/pubsub/DistributedPubSubMediator.js +3 -3
- package/dist/cluster/pubsub/DistributedPubSubMediator.js.map +1 -1
- package/dist/cluster/pubsub/DistributedPubSubOptions.d.ts +29 -0
- package/dist/cluster/pubsub/DistributedPubSubOptions.d.ts.map +1 -0
- package/dist/cluster/pubsub/DistributedPubSubOptions.js +23 -0
- package/dist/cluster/pubsub/DistributedPubSubOptions.js.map +1 -0
- package/dist/cluster/pubsub/index.d.ts +2 -1
- package/dist/cluster/pubsub/index.d.ts.map +1 -1
- package/dist/cluster/pubsub/index.js +1 -0
- package/dist/cluster/pubsub/index.js.map +1 -1
- package/dist/cluster/router/ClusterRouter.d.ts +12 -32
- package/dist/cluster/router/ClusterRouter.d.ts.map +1 -1
- package/dist/cluster/router/ClusterRouter.js +4 -2
- package/dist/cluster/router/ClusterRouter.js.map +1 -1
- package/dist/cluster/router/ClusterRouterOptions.d.ts +60 -0
- package/dist/cluster/router/ClusterRouterOptions.d.ts.map +1 -0
- package/dist/cluster/router/ClusterRouterOptions.js +41 -0
- package/dist/cluster/router/ClusterRouterOptions.js.map +1 -0
- package/dist/cluster/router/index.d.ts +3 -1
- package/dist/cluster/router/index.d.ts.map +1 -1
- package/dist/cluster/router/index.js +1 -0
- package/dist/cluster/router/index.js.map +1 -1
- package/dist/cluster/sharding/CassandraRememberEntitiesStore.d.ts +1 -15
- package/dist/cluster/sharding/CassandraRememberEntitiesStore.d.ts.map +1 -1
- package/dist/cluster/sharding/CassandraRememberEntitiesStore.js +35 -2
- package/dist/cluster/sharding/CassandraRememberEntitiesStore.js.map +1 -1
- package/dist/cluster/sharding/CassandraRememberEntitiesStoreOptions.d.ts +63 -0
- package/dist/cluster/sharding/CassandraRememberEntitiesStoreOptions.d.ts.map +1 -0
- package/dist/cluster/sharding/CassandraRememberEntitiesStoreOptions.js +63 -0
- package/dist/cluster/sharding/CassandraRememberEntitiesStoreOptions.js.map +1 -0
- package/dist/cluster/sharding/ClusterSharding.d.ts +18 -64
- package/dist/cluster/sharding/ClusterSharding.d.ts.map +1 -1
- package/dist/cluster/sharding/ClusterSharding.js +44 -20
- package/dist/cluster/sharding/ClusterSharding.js.map +1 -1
- package/dist/cluster/sharding/CoordinatorState.d.ts +1 -1
- package/dist/cluster/sharding/CoordinatorState.js +1 -1
- package/dist/cluster/sharding/ShardCoordinator.d.ts +3 -63
- package/dist/cluster/sharding/ShardCoordinator.d.ts.map +1 -1
- package/dist/cluster/sharding/ShardCoordinator.js +3 -3
- package/dist/cluster/sharding/ShardCoordinator.js.map +1 -1
- package/dist/cluster/sharding/ShardCoordinatorOptions.d.ts +111 -0
- package/dist/cluster/sharding/ShardCoordinatorOptions.d.ts.map +1 -0
- package/dist/cluster/sharding/ShardCoordinatorOptions.js +69 -0
- package/dist/cluster/sharding/ShardCoordinatorOptions.js.map +1 -0
- package/dist/cluster/sharding/ShardRegion.d.ts +2 -33
- package/dist/cluster/sharding/ShardRegion.d.ts.map +1 -1
- package/dist/cluster/sharding/ShardRegion.js.map +1 -1
- package/dist/cluster/sharding/ShardedDaemonProcess.d.ts +2 -22
- package/dist/cluster/sharding/ShardedDaemonProcess.d.ts.map +1 -1
- package/dist/cluster/sharding/ShardedDaemonProcess.js +14 -11
- package/dist/cluster/sharding/ShardedDaemonProcess.js.map +1 -1
- package/dist/cluster/sharding/ShardedDaemonProcessOptions.d.ts +51 -0
- package/dist/cluster/sharding/ShardedDaemonProcessOptions.d.ts.map +1 -0
- package/dist/cluster/sharding/ShardedDaemonProcessOptions.js +35 -0
- package/dist/cluster/sharding/ShardedDaemonProcessOptions.js.map +1 -0
- package/dist/cluster/sharding/ShardingOptions.d.ts +84 -0
- package/dist/cluster/sharding/ShardingOptions.d.ts.map +1 -0
- package/dist/cluster/sharding/ShardingOptions.js +62 -0
- package/dist/cluster/sharding/ShardingOptions.js.map +1 -0
- package/dist/cluster/sharding/StartShardingOptions.d.ts +98 -0
- package/dist/cluster/sharding/StartShardingOptions.d.ts.map +1 -0
- package/dist/cluster/sharding/StartShardingOptions.js +52 -0
- package/dist/cluster/sharding/StartShardingOptions.js.map +1 -0
- package/dist/cluster/singleton/ClusterSingleton.d.ts +2 -30
- package/dist/cluster/singleton/ClusterSingleton.d.ts.map +1 -1
- package/dist/cluster/singleton/ClusterSingleton.js +15 -9
- package/dist/cluster/singleton/ClusterSingleton.js.map +1 -1
- package/dist/cluster/singleton/ClusterSingletonManager.d.ts +3 -18
- package/dist/cluster/singleton/ClusterSingletonManager.d.ts.map +1 -1
- package/dist/cluster/singleton/ClusterSingletonManager.js +3 -3
- package/dist/cluster/singleton/ClusterSingletonManager.js.map +1 -1
- package/dist/cluster/singleton/ClusterSingletonManagerOptions.d.ts +49 -0
- package/dist/cluster/singleton/ClusterSingletonManagerOptions.d.ts.map +1 -0
- package/dist/cluster/singleton/ClusterSingletonManagerOptions.js +40 -0
- package/dist/cluster/singleton/ClusterSingletonManagerOptions.js.map +1 -0
- package/dist/cluster/singleton/StartSingletonOptions.d.ts +64 -0
- package/dist/cluster/singleton/StartSingletonOptions.d.ts.map +1 -0
- package/dist/cluster/singleton/StartSingletonOptions.js +40 -0
- package/dist/cluster/singleton/StartSingletonOptions.js.map +1 -0
- package/dist/cluster/singleton/index.d.ts +6 -2
- package/dist/cluster/singleton/index.d.ts.map +1 -1
- package/dist/cluster/singleton/index.js +2 -0
- package/dist/cluster/singleton/index.js.map +1 -1
- package/dist/config/ConfigKeys.d.ts +5 -0
- package/dist/config/ConfigKeys.d.ts.map +1 -1
- package/dist/config/ConfigKeys.js +5 -0
- package/dist/config/ConfigKeys.js.map +1 -1
- package/dist/coordination/Lease.d.ts +32 -14
- package/dist/coordination/Lease.d.ts.map +1 -1
- package/dist/coordination/LeaseOptions.d.ts +61 -0
- package/dist/coordination/LeaseOptions.d.ts.map +1 -0
- package/dist/coordination/LeaseOptions.js +50 -0
- package/dist/coordination/LeaseOptions.js.map +1 -0
- package/dist/coordination/index.d.ts +5 -2
- package/dist/coordination/index.d.ts.map +1 -1
- package/dist/coordination/index.js +2 -0
- package/dist/coordination/index.js.map +1 -1
- package/dist/coordination/leases/InMemoryLease.d.ts +18 -5
- package/dist/coordination/leases/InMemoryLease.d.ts.map +1 -1
- package/dist/coordination/leases/InMemoryLease.js +23 -11
- package/dist/coordination/leases/InMemoryLease.js.map +1 -1
- package/dist/coordination/leases/KubernetesLease.d.ts +19 -24
- package/dist/coordination/leases/KubernetesLease.d.ts.map +1 -1
- package/dist/coordination/leases/KubernetesLease.js +28 -9
- package/dist/coordination/leases/KubernetesLease.js.map +1 -1
- package/dist/coordination/leases/KubernetesLeaseOptions.d.ts +58 -0
- package/dist/coordination/leases/KubernetesLeaseOptions.d.ts.map +1 -0
- package/dist/coordination/leases/KubernetesLeaseOptions.js +42 -0
- package/dist/coordination/leases/KubernetesLeaseOptions.js.map +1 -0
- package/dist/crdt/DistributedData.d.ts +2 -22
- package/dist/crdt/DistributedData.d.ts.map +1 -1
- package/dist/crdt/DistributedData.js +3 -2
- package/dist/crdt/DistributedData.js.map +1 -1
- package/dist/crdt/DistributedDataOptions.d.ts +50 -0
- package/dist/crdt/DistributedDataOptions.d.ts.map +1 -0
- package/dist/crdt/DistributedDataOptions.js +28 -0
- package/dist/crdt/DistributedDataOptions.js.map +1 -0
- package/dist/crdt/index.d.ts +3 -1
- package/dist/crdt/index.d.ts.map +1 -1
- package/dist/crdt/index.js +1 -0
- package/dist/crdt/index.js.map +1 -1
- package/dist/delivery/ProducerController.d.ts +4 -19
- package/dist/delivery/ProducerController.d.ts.map +1 -1
- package/dist/delivery/ProducerController.js +4 -3
- package/dist/delivery/ProducerController.js.map +1 -1
- package/dist/delivery/ProducerControllerOptions.d.ts +50 -0
- package/dist/delivery/ProducerControllerOptions.d.ts.map +1 -0
- package/dist/delivery/ProducerControllerOptions.js +36 -0
- package/dist/delivery/ProducerControllerOptions.js.map +1 -0
- package/dist/delivery/ReliableDelivery.d.ts +3 -2
- package/dist/delivery/ReliableDelivery.d.ts.map +1 -1
- package/dist/delivery/ReliableDelivery.js +2 -2
- package/dist/delivery/ReliableDelivery.js.map +1 -1
- package/dist/delivery/index.d.ts +3 -1
- package/dist/delivery/index.d.ts.map +1 -1
- package/dist/delivery/index.js +1 -0
- package/dist/delivery/index.js.map +1 -1
- package/dist/discovery/AutoDiscoveryOptions.d.ts +72 -0
- package/dist/discovery/AutoDiscoveryOptions.d.ts.map +1 -0
- package/dist/discovery/AutoDiscoveryOptions.js +34 -0
- package/dist/discovery/AutoDiscoveryOptions.js.map +1 -0
- package/dist/discovery/ConfigSeedProvider.d.ts +2 -7
- package/dist/discovery/ConfigSeedProvider.d.ts.map +1 -1
- package/dist/discovery/ConfigSeedProvider.js +4 -3
- package/dist/discovery/ConfigSeedProvider.js.map +1 -1
- package/dist/discovery/ConfigSeedProviderOptions.d.ts +34 -0
- package/dist/discovery/ConfigSeedProviderOptions.d.ts.map +1 -0
- package/dist/discovery/ConfigSeedProviderOptions.js +27 -0
- package/dist/discovery/ConfigSeedProviderOptions.js.map +1 -0
- package/dist/discovery/DnsSeedProvider.d.ts +3 -27
- package/dist/discovery/DnsSeedProvider.d.ts.map +1 -1
- package/dist/discovery/DnsSeedProvider.js +4 -4
- package/dist/discovery/DnsSeedProvider.js.map +1 -1
- package/dist/discovery/DnsSeedProviderOptions.d.ts +67 -0
- package/dist/discovery/DnsSeedProviderOptions.d.ts.map +1 -0
- package/dist/discovery/DnsSeedProviderOptions.js +48 -0
- package/dist/discovery/DnsSeedProviderOptions.js.map +1 -0
- package/dist/discovery/KubernetesApiSeedProvider.d.ts +2 -13
- package/dist/discovery/KubernetesApiSeedProvider.d.ts.map +1 -1
- package/dist/discovery/KubernetesApiSeedProvider.js +2 -2
- package/dist/discovery/KubernetesApiSeedProvider.js.map +1 -1
- package/dist/discovery/KubernetesApiSeedProviderOptions.d.ts +46 -0
- package/dist/discovery/KubernetesApiSeedProviderOptions.d.ts.map +1 -0
- package/dist/discovery/KubernetesApiSeedProviderOptions.js +39 -0
- package/dist/discovery/KubernetesApiSeedProviderOptions.js.map +1 -0
- package/dist/discovery/Receptionist.d.ts +3 -6
- package/dist/discovery/Receptionist.d.ts.map +1 -1
- package/dist/discovery/Receptionist.js +10 -3
- package/dist/discovery/Receptionist.js.map +1 -1
- package/dist/discovery/ReceptionistOptions.d.ts +30 -0
- package/dist/discovery/ReceptionistOptions.d.ts.map +1 -0
- package/dist/discovery/ReceptionistOptions.js +24 -0
- package/dist/discovery/ReceptionistOptions.js.map +1 -0
- package/dist/discovery/autoDiscovery.d.ts +3 -44
- package/dist/discovery/autoDiscovery.d.ts.map +1 -1
- package/dist/discovery/autoDiscovery.js +31 -32
- package/dist/discovery/autoDiscovery.js.map +1 -1
- package/dist/discovery/index.d.ts +10 -5
- package/dist/discovery/index.d.ts.map +1 -1
- package/dist/discovery/index.js +5 -0
- package/dist/discovery/index.js.map +1 -1
- package/dist/http/HttpExtension.d.ts.map +1 -1
- package/dist/http/HttpExtension.js +69 -8
- package/dist/http/HttpExtension.js.map +1 -1
- package/dist/http/Route.d.ts +76 -4
- package/dist/http/Route.d.ts.map +1 -1
- package/dist/http/Route.js +74 -1
- package/dist/http/Route.js.map +1 -1
- package/dist/http/backend/ExpressBackend.d.ts +18 -12
- package/dist/http/backend/ExpressBackend.d.ts.map +1 -1
- package/dist/http/backend/ExpressBackend.js +134 -8
- package/dist/http/backend/ExpressBackend.js.map +1 -1
- package/dist/http/backend/ExpressBackendOptions.d.ts +47 -0
- package/dist/http/backend/ExpressBackendOptions.d.ts.map +1 -0
- package/dist/http/backend/ExpressBackendOptions.js +35 -0
- package/dist/http/backend/ExpressBackendOptions.js.map +1 -0
- package/dist/http/backend/FastifyBackend.d.ts +4 -1
- package/dist/http/backend/FastifyBackend.d.ts.map +1 -1
- package/dist/http/backend/FastifyBackend.js +71 -1
- package/dist/http/backend/FastifyBackend.js.map +1 -1
- package/dist/http/backend/HonoBackend.d.ts +19 -13
- package/dist/http/backend/HonoBackend.d.ts.map +1 -1
- package/dist/http/backend/HonoBackend.js +152 -5
- package/dist/http/backend/HonoBackend.js.map +1 -1
- package/dist/http/backend/HonoBackendOptions.d.ts +47 -0
- package/dist/http/backend/HonoBackendOptions.d.ts.map +1 -0
- package/dist/http/backend/HonoBackendOptions.js +35 -0
- package/dist/http/backend/HonoBackendOptions.js.map +1 -0
- package/dist/http/backend/HttpServerBackend.d.ts +24 -0
- package/dist/http/backend/HttpServerBackend.d.ts.map +1 -1
- package/dist/http/index.d.ts +11 -5
- package/dist/http/index.d.ts.map +1 -1
- package/dist/http/index.js +8 -1
- package/dist/http/index.js.map +1 -1
- package/dist/http/middleware/BearerToken.d.ts +44 -0
- package/dist/http/middleware/BearerToken.d.ts.map +1 -0
- package/dist/http/middleware/BearerToken.js +72 -0
- package/dist/http/middleware/BearerToken.js.map +1 -0
- package/dist/http/middleware/IpAllowlist.d.ts +45 -0
- package/dist/http/middleware/IpAllowlist.d.ts.map +1 -0
- package/dist/http/middleware/IpAllowlist.js +148 -0
- package/dist/http/middleware/IpAllowlist.js.map +1 -0
- package/dist/http/middleware/index.d.ts +5 -0
- package/dist/http/middleware/index.d.ts.map +1 -0
- package/dist/http/middleware/index.js +3 -0
- package/dist/http/middleware/index.js.map +1 -0
- package/dist/http/types.d.ts +9 -0
- package/dist/http/types.d.ts.map +1 -1
- package/dist/http/types.js.map +1 -1
- package/dist/http/ws/ConnectionWiring.d.ts +59 -0
- package/dist/http/ws/ConnectionWiring.d.ts.map +1 -0
- package/dist/http/ws/ConnectionWiring.js +112 -0
- package/dist/http/ws/ConnectionWiring.js.map +1 -0
- package/dist/http/ws/SocketAdapter.d.ts +72 -0
- package/dist/http/ws/SocketAdapter.d.ts.map +1 -0
- package/dist/http/ws/SocketAdapter.js +97 -0
- package/dist/http/ws/SocketAdapter.js.map +1 -0
- package/dist/http/ws/WebSocketClientActor.d.ts +66 -0
- package/dist/http/ws/WebSocketClientActor.d.ts.map +1 -0
- package/dist/http/ws/WebSocketClientActor.js +194 -0
- package/dist/http/ws/WebSocketClientActor.js.map +1 -0
- package/dist/http/ws/WebSocketClientOptions.d.ts +77 -0
- package/dist/http/ws/WebSocketClientOptions.d.ts.map +1 -0
- package/dist/http/ws/WebSocketClientOptions.js +69 -0
- package/dist/http/ws/WebSocketClientOptions.js.map +1 -0
- package/dist/http/ws/WebSocketConnectionActor.d.ts +51 -0
- package/dist/http/ws/WebSocketConnectionActor.d.ts.map +1 -0
- package/dist/http/ws/WebSocketConnectionActor.js +170 -0
- package/dist/http/ws/WebSocketConnectionActor.js.map +1 -0
- package/dist/http/ws/WebSocketRoute.d.ts +20 -0
- package/dist/http/ws/WebSocketRoute.d.ts.map +1 -0
- package/dist/http/ws/WebSocketRoute.js +44 -0
- package/dist/http/ws/WebSocketRoute.js.map +1 -0
- package/dist/http/ws/WebSocketRouteOptions.d.ts +54 -0
- package/dist/http/ws/WebSocketRouteOptions.d.ts.map +1 -0
- package/dist/http/ws/WebSocketRouteOptions.js +55 -0
- package/dist/http/ws/WebSocketRouteOptions.js.map +1 -0
- package/dist/http/ws/WebSocketServerActor.d.ts +65 -0
- package/dist/http/ws/WebSocketServerActor.d.ts.map +1 -0
- package/dist/http/ws/WebSocketServerActor.js +133 -0
- package/dist/http/ws/WebSocketServerActor.js.map +1 -0
- package/dist/http/ws/WsCodec.d.ts +65 -0
- package/dist/http/ws/WsCodec.d.ts.map +1 -0
- package/dist/http/ws/WsCodec.js +82 -0
- package/dist/http/ws/WsCodec.js.map +1 -0
- package/dist/http/ws/WsConnection.d.ts +59 -0
- package/dist/http/ws/WsConnection.d.ts.map +1 -0
- package/dist/http/ws/WsConnection.js +45 -0
- package/dist/http/ws/WsConnection.js.map +1 -0
- package/dist/http/ws/WsMessages.d.ts +91 -0
- package/dist/http/ws/WsMessages.d.ts.map +1 -0
- package/dist/http/ws/WsMessages.js +90 -0
- package/dist/http/ws/WsMessages.js.map +1 -0
- package/dist/http/ws/WsPolicy.d.ts +32 -0
- package/dist/http/ws/WsPolicy.d.ts.map +1 -0
- package/dist/http/ws/WsPolicy.js +43 -0
- package/dist/http/ws/WsPolicy.js.map +1 -0
- package/dist/http/ws/index.d.ts +22 -0
- package/dist/http/ws/index.d.ts.map +1 -0
- package/dist/http/ws/index.js +15 -0
- package/dist/http/ws/index.js.map +1 -0
- package/dist/http/ws/matchPattern.d.ts +12 -0
- package/dist/http/ws/matchPattern.d.ts.map +1 -0
- package/dist/http/ws/matchPattern.js +29 -0
- package/dist/http/ws/matchPattern.js.map +1 -0
- package/dist/http/ws/rawResponse.d.ts +15 -0
- package/dist/http/ws/rawResponse.d.ts.map +1 -0
- package/dist/http/ws/rawResponse.js +54 -0
- package/dist/http/ws/rawResponse.js.map +1 -0
- package/dist/http/ws/types.d.ts +70 -0
- package/dist/http/ws/types.d.ts.map +1 -0
- package/dist/http/ws/types.js +81 -0
- package/dist/http/ws/types.js.map +1 -0
- package/dist/http/ws/wsCtor.d.ts +34 -0
- package/dist/http/ws/wsCtor.d.ts.map +1 -0
- package/dist/http/ws/wsCtor.js +38 -0
- package/dist/http/ws/wsCtor.js.map +1 -0
- package/dist/index.d.ts +25 -23
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +15 -11
- package/dist/index.js.map +1 -1
- package/dist/internal/ActorCell.d.ts +16 -1
- package/dist/internal/ActorCell.d.ts.map +1 -1
- package/dist/internal/ActorCell.js +32 -2
- package/dist/internal/ActorCell.js.map +1 -1
- package/dist/io/broker/AmqpActor.d.ts +19 -16
- package/dist/io/broker/AmqpActor.d.ts.map +1 -1
- package/dist/io/broker/AmqpActor.js +13 -5
- package/dist/io/broker/AmqpActor.js.map +1 -1
- package/dist/io/broker/AmqpOptions.d.ts +41 -0
- package/dist/io/broker/AmqpOptions.d.ts.map +1 -0
- package/dist/io/broker/AmqpOptions.js +34 -0
- package/dist/io/broker/AmqpOptions.js.map +1 -0
- package/dist/io/broker/BrokerActor.d.ts +4 -3
- package/dist/io/broker/BrokerActor.d.ts.map +1 -1
- package/dist/io/broker/BrokerActor.js +4 -2
- package/dist/io/broker/BrokerActor.js.map +1 -1
- package/dist/io/broker/BrokerOptions.d.ts +24 -0
- package/dist/io/broker/BrokerOptions.d.ts.map +1 -0
- package/dist/io/broker/BrokerOptions.js +29 -0
- package/dist/io/broker/BrokerOptions.js.map +1 -0
- package/dist/io/broker/BrokerSettings.d.ts +2 -2
- package/dist/io/broker/BrokerSettings.d.ts.map +1 -1
- package/dist/io/broker/BrokerSettings.js.map +1 -1
- package/dist/io/broker/GrpcClientActor.d.ts +6 -19
- package/dist/io/broker/GrpcClientActor.d.ts.map +1 -1
- package/dist/io/broker/GrpcClientActor.js +1 -1
- package/dist/io/broker/GrpcClientActor.js.map +1 -1
- package/dist/io/broker/GrpcClientOptions.d.ts +48 -0
- package/dist/io/broker/GrpcClientOptions.d.ts.map +1 -0
- package/dist/io/broker/GrpcClientOptions.js +42 -0
- package/dist/io/broker/GrpcClientOptions.js.map +1 -0
- package/dist/io/broker/GrpcServerActor.d.ts +3 -24
- package/dist/io/broker/GrpcServerActor.d.ts.map +1 -1
- package/dist/io/broker/GrpcServerActor.js +3 -3
- package/dist/io/broker/GrpcServerActor.js.map +1 -1
- package/dist/io/broker/GrpcServerOptions.d.ts +58 -0
- package/dist/io/broker/GrpcServerOptions.d.ts.map +1 -0
- package/dist/io/broker/GrpcServerOptions.js +44 -0
- package/dist/io/broker/GrpcServerOptions.js.map +1 -0
- package/dist/io/broker/JetStreamActor.d.ts +13 -35
- package/dist/io/broker/JetStreamActor.d.ts.map +1 -1
- package/dist/io/broker/JetStreamActor.js +2 -2
- package/dist/io/broker/JetStreamActor.js.map +1 -1
- package/dist/io/broker/JetStreamOptions.d.ts +64 -0
- package/dist/io/broker/JetStreamOptions.d.ts.map +1 -0
- package/dist/io/broker/JetStreamOptions.js +54 -0
- package/dist/io/broker/JetStreamOptions.js.map +1 -0
- package/dist/io/broker/KafkaActor.d.ts +13 -54
- package/dist/io/broker/KafkaActor.d.ts.map +1 -1
- package/dist/io/broker/KafkaActor.js +20 -8
- package/dist/io/broker/KafkaActor.js.map +1 -1
- package/dist/io/broker/KafkaOptions.d.ts +82 -0
- package/dist/io/broker/KafkaOptions.d.ts.map +1 -0
- package/dist/io/broker/KafkaOptions.js +50 -0
- package/dist/io/broker/KafkaOptions.js.map +1 -0
- package/dist/io/broker/MqttActor.d.ts +174 -114
- package/dist/io/broker/MqttActor.d.ts.map +1 -1
- package/dist/io/broker/MqttActor.js +328 -103
- package/dist/io/broker/MqttActor.js.map +1 -1
- package/dist/io/broker/MqttCodec.d.ts +70 -0
- package/dist/io/broker/MqttCodec.d.ts.map +1 -0
- package/dist/io/broker/MqttCodec.js +98 -0
- package/dist/io/broker/MqttCodec.js.map +1 -0
- package/dist/io/broker/MqttMessages.d.ts +145 -0
- package/dist/io/broker/MqttMessages.d.ts.map +1 -0
- package/dist/io/broker/MqttMessages.js +102 -0
- package/dist/io/broker/MqttMessages.js.map +1 -0
- package/dist/io/broker/MqttOptions.d.ts +100 -0
- package/dist/io/broker/MqttOptions.d.ts.map +1 -0
- package/dist/io/broker/MqttOptions.js +73 -0
- package/dist/io/broker/MqttOptions.js.map +1 -0
- package/dist/io/broker/NatsActor.d.ts +6 -21
- package/dist/io/broker/NatsActor.d.ts.map +1 -1
- package/dist/io/broker/NatsActor.js +1 -1
- package/dist/io/broker/NatsActor.js.map +1 -1
- package/dist/io/broker/NatsOptions.d.ts +51 -0
- package/dist/io/broker/NatsOptions.d.ts.map +1 -0
- package/dist/io/broker/NatsOptions.js +42 -0
- package/dist/io/broker/NatsOptions.js.map +1 -0
- package/dist/io/broker/RedisStreamsActor.d.ts +6 -24
- package/dist/io/broker/RedisStreamsActor.d.ts.map +1 -1
- package/dist/io/broker/RedisStreamsActor.js +1 -1
- package/dist/io/broker/RedisStreamsActor.js.map +1 -1
- package/dist/io/broker/RedisStreamsOptions.d.ts +51 -0
- package/dist/io/broker/RedisStreamsOptions.d.ts.map +1 -0
- package/dist/io/broker/RedisStreamsOptions.js +38 -0
- package/dist/io/broker/RedisStreamsOptions.js.map +1 -0
- package/dist/io/broker/SseActor.d.ts +6 -15
- package/dist/io/broker/SseActor.d.ts.map +1 -1
- package/dist/io/broker/SseActor.js +1 -1
- package/dist/io/broker/SseActor.js.map +1 -1
- package/dist/io/broker/SseOptions.d.ts +38 -0
- package/dist/io/broker/SseOptions.d.ts.map +1 -0
- package/dist/io/broker/SseOptions.js +30 -0
- package/dist/io/broker/SseOptions.js.map +1 -0
- package/dist/io/broker/TcpSocketActor.d.ts +6 -21
- package/dist/io/broker/TcpSocketActor.d.ts.map +1 -1
- package/dist/io/broker/TcpSocketActor.js +1 -1
- package/dist/io/broker/TcpSocketActor.js.map +1 -1
- package/dist/io/broker/TcpSocketOptions.d.ts +46 -0
- package/dist/io/broker/TcpSocketOptions.d.ts.map +1 -0
- package/dist/io/broker/TcpSocketOptions.js +34 -0
- package/dist/io/broker/TcpSocketOptions.js.map +1 -0
- package/dist/io/broker/UdpSocketActor.d.ts +6 -17
- package/dist/io/broker/UdpSocketActor.d.ts.map +1 -1
- package/dist/io/broker/UdpSocketActor.js +1 -1
- package/dist/io/broker/UdpSocketActor.js.map +1 -1
- package/dist/io/broker/UdpSocketOptions.d.ts +42 -0
- package/dist/io/broker/UdpSocketOptions.d.ts.map +1 -0
- package/dist/io/broker/UdpSocketOptions.js +34 -0
- package/dist/io/broker/UdpSocketOptions.js.map +1 -0
- package/dist/io/broker/index.d.ts +39 -19
- package/dist/io/broker/index.d.ts.map +1 -1
- package/dist/io/broker/index.js +21 -4
- package/dist/io/broker/index.js.map +1 -1
- package/dist/mailbox/BoundedMailbox.d.ts +12 -0
- package/dist/mailbox/BoundedMailbox.d.ts.map +1 -1
- package/dist/mailbox/BoundedMailbox.js +7 -1
- package/dist/mailbox/BoundedMailbox.js.map +1 -1
- package/dist/management/HttpManagement.d.ts +34 -1
- package/dist/management/HttpManagement.d.ts.map +1 -1
- package/dist/management/HttpManagement.js +30 -4
- package/dist/management/HttpManagement.js.map +1 -1
- package/dist/metrics/PromClientAdapter.d.ts +2 -12
- package/dist/metrics/PromClientAdapter.d.ts.map +1 -1
- package/dist/metrics/PromClientAdapter.js +2 -2
- package/dist/metrics/PromClientAdapter.js.map +1 -1
- package/dist/metrics/PromClientAdapterOptions.d.ts +46 -0
- package/dist/metrics/PromClientAdapterOptions.d.ts.map +1 -0
- package/dist/metrics/PromClientAdapterOptions.js +35 -0
- package/dist/metrics/PromClientAdapterOptions.js.map +1 -0
- package/dist/metrics/index.d.ts +3 -1
- package/dist/metrics/index.d.ts.map +1 -1
- package/dist/metrics/index.js +1 -0
- package/dist/metrics/index.js.map +1 -1
- package/dist/persistence/DurableStateActor.d.ts +4 -9
- package/dist/persistence/DurableStateActor.d.ts.map +1 -1
- package/dist/persistence/DurableStateActor.js +3 -3
- package/dist/persistence/DurableStateActor.js.map +1 -1
- package/dist/persistence/DurableStateOptions.d.ts +40 -0
- package/dist/persistence/DurableStateOptions.d.ts.map +1 -0
- package/dist/persistence/DurableStateOptions.js +36 -0
- package/dist/persistence/DurableStateOptions.js.map +1 -0
- package/dist/persistence/PersistenceOptions.d.ts +45 -0
- package/dist/persistence/PersistenceOptions.d.ts.map +1 -1
- package/dist/persistence/ReplicatedEventSourcedActor.d.ts.map +1 -1
- package/dist/persistence/ReplicatedEventSourcedActor.js +2 -2
- package/dist/persistence/ReplicatedEventSourcedActor.js.map +1 -1
- package/dist/persistence/durable-state-stores/MariaDbDurableStateStore.d.ts +32 -0
- package/dist/persistence/durable-state-stores/MariaDbDurableStateStore.d.ts.map +1 -0
- package/dist/persistence/durable-state-stores/MariaDbDurableStateStore.js +120 -0
- package/dist/persistence/durable-state-stores/MariaDbDurableStateStore.js.map +1 -0
- package/dist/persistence/durable-state-stores/MariaDbDurableStateStoreOptions.d.ts +38 -0
- package/dist/persistence/durable-state-stores/MariaDbDurableStateStoreOptions.d.ts.map +1 -0
- package/dist/persistence/durable-state-stores/MariaDbDurableStateStoreOptions.js +38 -0
- package/dist/persistence/durable-state-stores/MariaDbDurableStateStoreOptions.js.map +1 -0
- package/dist/persistence/durable-state-stores/ObjectStorageDurableStateStore.d.ts +4 -9
- package/dist/persistence/durable-state-stores/ObjectStorageDurableStateStore.d.ts.map +1 -1
- package/dist/persistence/durable-state-stores/ObjectStorageDurableStateStore.js +49 -7
- package/dist/persistence/durable-state-stores/ObjectStorageDurableStateStore.js.map +1 -1
- package/dist/persistence/durable-state-stores/ObjectStorageDurableStateStoreOptions.d.ts +61 -0
- package/dist/persistence/durable-state-stores/ObjectStorageDurableStateStoreOptions.d.ts.map +1 -0
- package/dist/persistence/durable-state-stores/ObjectStorageDurableStateStoreOptions.js +42 -0
- package/dist/persistence/durable-state-stores/ObjectStorageDurableStateStoreOptions.js.map +1 -0
- package/dist/persistence/durable-state-stores/PostgresDurableStateStore.d.ts +38 -0
- package/dist/persistence/durable-state-stores/PostgresDurableStateStore.d.ts.map +1 -0
- package/dist/persistence/durable-state-stores/PostgresDurableStateStore.js +121 -0
- package/dist/persistence/durable-state-stores/PostgresDurableStateStore.js.map +1 -0
- package/dist/persistence/durable-state-stores/PostgresDurableStateStoreOptions.d.ts +38 -0
- package/dist/persistence/durable-state-stores/PostgresDurableStateStoreOptions.d.ts.map +1 -0
- package/dist/persistence/durable-state-stores/PostgresDurableStateStoreOptions.js +38 -0
- package/dist/persistence/durable-state-stores/PostgresDurableStateStoreOptions.js.map +1 -0
- package/dist/persistence/index.d.ts +59 -16
- package/dist/persistence/index.d.ts.map +1 -1
- package/dist/persistence/index.js +33 -2
- package/dist/persistence/index.js.map +1 -1
- package/dist/persistence/journals/CassandraJournal.d.ts +1 -48
- package/dist/persistence/journals/CassandraJournal.d.ts.map +1 -1
- package/dist/persistence/journals/CassandraJournal.js +2 -2
- package/dist/persistence/journals/CassandraJournal.js.map +1 -1
- package/dist/persistence/journals/CassandraJournalOptions.d.ts +107 -0
- package/dist/persistence/journals/CassandraJournalOptions.d.ts.map +1 -0
- package/dist/persistence/journals/CassandraJournalOptions.js +90 -0
- package/dist/persistence/journals/CassandraJournalOptions.js.map +1 -0
- package/dist/persistence/journals/CassandraPlugin.d.ts +1 -16
- package/dist/persistence/journals/CassandraPlugin.d.ts.map +1 -1
- package/dist/persistence/journals/CassandraPlugin.js +9 -4
- package/dist/persistence/journals/CassandraPlugin.js.map +1 -1
- package/dist/persistence/journals/CassandraPluginOptions.d.ts +51 -0
- package/dist/persistence/journals/CassandraPluginOptions.d.ts.map +1 -0
- package/dist/persistence/journals/CassandraPluginOptions.js +37 -0
- package/dist/persistence/journals/CassandraPluginOptions.js.map +1 -0
- package/dist/persistence/journals/MariaDbClient.d.ts +54 -0
- package/dist/persistence/journals/MariaDbClient.d.ts.map +1 -0
- package/dist/persistence/journals/MariaDbClient.js +40 -0
- package/dist/persistence/journals/MariaDbClient.js.map +1 -0
- package/dist/persistence/journals/MariaDbJournal.d.ts +29 -0
- package/dist/persistence/journals/MariaDbJournal.d.ts.map +1 -0
- package/dist/persistence/journals/MariaDbJournal.js +161 -0
- package/dist/persistence/journals/MariaDbJournal.js.map +1 -0
- package/dist/persistence/journals/MariaDbJournalOptions.d.ts +43 -0
- package/dist/persistence/journals/MariaDbJournalOptions.d.ts.map +1 -0
- package/dist/persistence/journals/MariaDbJournalOptions.js +43 -0
- package/dist/persistence/journals/MariaDbJournalOptions.js.map +1 -0
- package/dist/persistence/journals/MariaDbPlugin.d.ts +27 -0
- package/dist/persistence/journals/MariaDbPlugin.d.ts.map +1 -0
- package/dist/persistence/journals/MariaDbPlugin.js +30 -0
- package/dist/persistence/journals/MariaDbPlugin.js.map +1 -0
- package/dist/persistence/journals/MariaDbPluginOptions.d.ts +52 -0
- package/dist/persistence/journals/MariaDbPluginOptions.d.ts.map +1 -0
- package/dist/persistence/journals/MariaDbPluginOptions.js +38 -0
- package/dist/persistence/journals/MariaDbPluginOptions.js.map +1 -0
- package/dist/persistence/journals/PostgresClient.d.ts +56 -0
- package/dist/persistence/journals/PostgresClient.d.ts.map +1 -0
- package/dist/persistence/journals/PostgresClient.js +35 -0
- package/dist/persistence/journals/PostgresClient.js.map +1 -0
- package/dist/persistence/journals/PostgresJournal.d.ts +41 -0
- package/dist/persistence/journals/PostgresJournal.d.ts.map +1 -0
- package/dist/persistence/journals/PostgresJournal.js +176 -0
- package/dist/persistence/journals/PostgresJournal.js.map +1 -0
- package/dist/persistence/journals/PostgresJournalOptions.d.ts +44 -0
- package/dist/persistence/journals/PostgresJournalOptions.d.ts.map +1 -0
- package/dist/persistence/journals/PostgresJournalOptions.js +44 -0
- package/dist/persistence/journals/PostgresJournalOptions.js.map +1 -0
- package/dist/persistence/journals/PostgresPlugin.d.ts +32 -0
- package/dist/persistence/journals/PostgresPlugin.d.ts.map +1 -0
- package/dist/persistence/journals/PostgresPlugin.js +35 -0
- package/dist/persistence/journals/PostgresPlugin.js.map +1 -0
- package/dist/persistence/journals/PostgresPluginOptions.d.ts +54 -0
- package/dist/persistence/journals/PostgresPluginOptions.d.ts.map +1 -0
- package/dist/persistence/journals/PostgresPluginOptions.js +39 -0
- package/dist/persistence/journals/PostgresPluginOptions.js.map +1 -0
- package/dist/persistence/journals/SqliteJournal.d.ts +5 -19
- package/dist/persistence/journals/SqliteJournal.d.ts.map +1 -1
- package/dist/persistence/journals/SqliteJournal.js +10 -9
- package/dist/persistence/journals/SqliteJournal.js.map +1 -1
- package/dist/persistence/journals/SqliteJournalOptions.d.ts +41 -0
- package/dist/persistence/journals/SqliteJournalOptions.d.ts.map +1 -0
- package/dist/persistence/journals/SqliteJournalOptions.js +31 -0
- package/dist/persistence/journals/SqliteJournalOptions.js.map +1 -0
- package/dist/persistence/object-storage/BodyCodec.d.ts +43 -0
- package/dist/persistence/object-storage/BodyCodec.d.ts.map +1 -1
- package/dist/persistence/object-storage/BodyCodec.js +78 -20
- package/dist/persistence/object-storage/BodyCodec.js.map +1 -1
- package/dist/persistence/object-storage/Compression.d.ts +21 -7
- package/dist/persistence/object-storage/Compression.d.ts.map +1 -1
- package/dist/persistence/object-storage/Compression.js +79 -29
- package/dist/persistence/object-storage/Compression.js.map +1 -1
- package/dist/persistence/object-storage/FilesystemObjectStorageBackend.d.ts +2 -61
- package/dist/persistence/object-storage/FilesystemObjectStorageBackend.d.ts.map +1 -1
- package/dist/persistence/object-storage/FilesystemObjectStorageBackend.js +56 -11
- package/dist/persistence/object-storage/FilesystemObjectStorageBackend.js.map +1 -1
- package/dist/persistence/object-storage/FilesystemObjectStorageOptions.d.ts +45 -0
- package/dist/persistence/object-storage/FilesystemObjectStorageOptions.d.ts.map +1 -0
- package/dist/persistence/object-storage/FilesystemObjectStorageOptions.js +30 -0
- package/dist/persistence/object-storage/FilesystemObjectStorageOptions.js.map +1 -0
- package/dist/persistence/object-storage/Integrity.d.ts +43 -0
- package/dist/persistence/object-storage/Integrity.d.ts.map +1 -0
- package/dist/persistence/object-storage/Integrity.js +66 -0
- package/dist/persistence/object-storage/Integrity.js.map +1 -0
- package/dist/persistence/object-storage/ObjectStoragePlugin.d.ts +6 -22
- package/dist/persistence/object-storage/ObjectStoragePlugin.d.ts.map +1 -1
- package/dist/persistence/object-storage/ObjectStoragePlugin.js +36 -28
- package/dist/persistence/object-storage/ObjectStoragePlugin.js.map +1 -1
- package/dist/persistence/object-storage/ObjectStoragePluginOptions.d.ts +60 -0
- package/dist/persistence/object-storage/ObjectStoragePluginOptions.d.ts.map +1 -0
- package/dist/persistence/object-storage/ObjectStoragePluginOptions.js +52 -0
- package/dist/persistence/object-storage/ObjectStoragePluginOptions.js.map +1 -0
- package/dist/persistence/object-storage/PluginConfig.d.ts +5 -2
- package/dist/persistence/object-storage/PluginConfig.d.ts.map +1 -1
- package/dist/persistence/object-storage/PluginConfig.js +8 -0
- package/dist/persistence/object-storage/PluginConfig.js.map +1 -1
- package/dist/persistence/object-storage/S3ObjectStorageBackend.d.ts +1 -30
- package/dist/persistence/object-storage/S3ObjectStorageBackend.d.ts.map +1 -1
- package/dist/persistence/object-storage/S3ObjectStorageBackend.js +12 -7
- package/dist/persistence/object-storage/S3ObjectStorageBackend.js.map +1 -1
- package/dist/persistence/object-storage/S3ObjectStorageOptions.d.ts +64 -0
- package/dist/persistence/object-storage/S3ObjectStorageOptions.d.ts.map +1 -0
- package/dist/persistence/object-storage/S3ObjectStorageOptions.js +42 -0
- package/dist/persistence/object-storage/S3ObjectStorageOptions.js.map +1 -0
- package/dist/persistence/object-storage/reEncryptionSweep.d.ts +72 -0
- package/dist/persistence/object-storage/reEncryptionSweep.d.ts.map +1 -1
- package/dist/persistence/object-storage/reEncryptionSweep.js +82 -2
- package/dist/persistence/object-storage/reEncryptionSweep.js.map +1 -1
- package/dist/persistence/projection/ProjectionActor.d.ts +4 -24
- package/dist/persistence/projection/ProjectionActor.d.ts.map +1 -1
- package/dist/persistence/projection/ProjectionActor.js +36 -2
- package/dist/persistence/projection/ProjectionActor.js.map +1 -1
- package/dist/persistence/projection/ProjectionOptions.d.ts +109 -0
- package/dist/persistence/projection/ProjectionOptions.d.ts.map +1 -0
- package/dist/persistence/projection/ProjectionOptions.js +108 -0
- package/dist/persistence/projection/ProjectionOptions.js.map +1 -0
- package/dist/persistence/snapshot-stores/CachedSnapshotStore.d.ts +2 -10
- package/dist/persistence/snapshot-stores/CachedSnapshotStore.d.ts.map +1 -1
- package/dist/persistence/snapshot-stores/CachedSnapshotStore.js +12 -6
- package/dist/persistence/snapshot-stores/CachedSnapshotStore.js.map +1 -1
- package/dist/persistence/snapshot-stores/CachedSnapshotStoreOptions.d.ts +37 -0
- package/dist/persistence/snapshot-stores/CachedSnapshotStoreOptions.d.ts.map +1 -0
- package/dist/persistence/snapshot-stores/CachedSnapshotStoreOptions.js +31 -0
- package/dist/persistence/snapshot-stores/CachedSnapshotStoreOptions.js.map +1 -0
- package/dist/persistence/snapshot-stores/CassandraSnapshotStore.d.ts +1 -11
- package/dist/persistence/snapshot-stores/CassandraSnapshotStore.d.ts.map +1 -1
- package/dist/persistence/snapshot-stores/CassandraSnapshotStore.js +3 -3
- package/dist/persistence/snapshot-stores/CassandraSnapshotStore.js.map +1 -1
- package/dist/persistence/snapshot-stores/CassandraSnapshotStoreOptions.d.ts +61 -0
- package/dist/persistence/snapshot-stores/CassandraSnapshotStoreOptions.d.ts.map +1 -0
- package/dist/persistence/snapshot-stores/CassandraSnapshotStoreOptions.js +73 -0
- package/dist/persistence/snapshot-stores/CassandraSnapshotStoreOptions.js.map +1 -0
- package/dist/persistence/snapshot-stores/MariaDbSnapshotStore.d.ts +30 -0
- package/dist/persistence/snapshot-stores/MariaDbSnapshotStore.d.ts.map +1 -0
- package/dist/persistence/snapshot-stores/MariaDbSnapshotStore.js +102 -0
- package/dist/persistence/snapshot-stores/MariaDbSnapshotStore.js.map +1 -0
- package/dist/persistence/snapshot-stores/MariaDbSnapshotStoreOptions.d.ts +42 -0
- package/dist/persistence/snapshot-stores/MariaDbSnapshotStoreOptions.d.ts.map +1 -0
- package/dist/persistence/snapshot-stores/MariaDbSnapshotStoreOptions.js +42 -0
- package/dist/persistence/snapshot-stores/MariaDbSnapshotStoreOptions.js.map +1 -0
- package/dist/persistence/snapshot-stores/ObjectStorageSnapshotStore.d.ts +2 -15
- package/dist/persistence/snapshot-stores/ObjectStorageSnapshotStore.d.ts.map +1 -1
- package/dist/persistence/snapshot-stores/ObjectStorageSnapshotStore.js +10 -6
- package/dist/persistence/snapshot-stores/ObjectStorageSnapshotStore.js.map +1 -1
- package/dist/persistence/snapshot-stores/ObjectStorageSnapshotStoreOptions.d.ts +45 -0
- package/dist/persistence/snapshot-stores/ObjectStorageSnapshotStoreOptions.d.ts.map +1 -0
- package/dist/persistence/snapshot-stores/ObjectStorageSnapshotStoreOptions.js +38 -0
- package/dist/persistence/snapshot-stores/ObjectStorageSnapshotStoreOptions.js.map +1 -0
- package/dist/persistence/snapshot-stores/PostgresSnapshotStore.d.ts +31 -0
- package/dist/persistence/snapshot-stores/PostgresSnapshotStore.d.ts.map +1 -0
- package/dist/persistence/snapshot-stores/PostgresSnapshotStore.js +101 -0
- package/dist/persistence/snapshot-stores/PostgresSnapshotStore.js.map +1 -0
- package/dist/persistence/snapshot-stores/PostgresSnapshotStoreOptions.d.ts +42 -0
- package/dist/persistence/snapshot-stores/PostgresSnapshotStoreOptions.d.ts.map +1 -0
- package/dist/persistence/snapshot-stores/PostgresSnapshotStoreOptions.js +42 -0
- package/dist/persistence/snapshot-stores/PostgresSnapshotStoreOptions.js.map +1 -0
- package/dist/persistence/snapshot-stores/SqliteSnapshotStore.d.ts +2 -15
- package/dist/persistence/snapshot-stores/SqliteSnapshotStore.d.ts.map +1 -1
- package/dist/persistence/snapshot-stores/SqliteSnapshotStore.js +7 -6
- package/dist/persistence/snapshot-stores/SqliteSnapshotStore.js.map +1 -1
- package/dist/persistence/snapshot-stores/SqliteSnapshotStoreOptions.d.ts +40 -0
- package/dist/persistence/snapshot-stores/SqliteSnapshotStoreOptions.d.ts.map +1 -0
- package/dist/persistence/snapshot-stores/SqliteSnapshotStoreOptions.js +31 -0
- package/dist/persistence/snapshot-stores/SqliteSnapshotStoreOptions.js.map +1 -0
- package/dist/runtime/http/BunHonoRunner.d.ts +7 -1
- package/dist/runtime/http/BunHonoRunner.d.ts.map +1 -1
- package/dist/runtime/http/BunHonoRunner.js +22 -0
- package/dist/runtime/http/BunHonoRunner.js.map +1 -1
- package/dist/runtime/http/DenoHonoRunner.d.ts +5 -2
- package/dist/runtime/http/DenoHonoRunner.d.ts.map +1 -1
- package/dist/runtime/http/DenoHonoRunner.js +19 -2
- package/dist/runtime/http/DenoHonoRunner.js.map +1 -1
- package/dist/runtime/http/HonoServerRunner.d.ts +39 -0
- package/dist/runtime/http/HonoServerRunner.d.ts.map +1 -1
- package/dist/runtime/http/NodeHonoRunner.d.ts +3 -1
- package/dist/runtime/http/NodeHonoRunner.d.ts.map +1 -1
- package/dist/runtime/http/NodeHonoRunner.js +22 -0
- package/dist/runtime/http/NodeHonoRunner.js.map +1 -1
- package/dist/runtime/http/index.d.ts +1 -1
- package/dist/runtime/http/index.d.ts.map +1 -1
- package/dist/runtime/http/index.js.map +1 -1
- package/dist/testkit/ManualScheduler.d.ts +2 -1
- package/dist/testkit/ManualScheduler.d.ts.map +1 -1
- package/dist/testkit/ManualScheduler.js +2 -1
- package/dist/testkit/ManualScheduler.js.map +1 -1
- package/dist/testkit/MockCluster.d.ts +74 -0
- package/dist/testkit/MockCluster.d.ts.map +1 -0
- package/dist/testkit/MockCluster.js +163 -0
- package/dist/testkit/MockCluster.js.map +1 -0
- package/dist/testkit/MultiNodeClusterFixture.d.ts +62 -0
- package/dist/testkit/MultiNodeClusterFixture.d.ts.map +1 -0
- package/dist/testkit/MultiNodeClusterFixture.js +43 -0
- package/dist/testkit/MultiNodeClusterFixture.js.map +1 -0
- package/dist/testkit/MultiNodeSpec.d.ts +45 -3
- package/dist/testkit/MultiNodeSpec.d.ts.map +1 -1
- package/dist/testkit/MultiNodeSpec.js +108 -14
- package/dist/testkit/MultiNodeSpec.js.map +1 -1
- package/dist/testkit/ParallelMultiNodeSpec.d.ts +12 -2
- package/dist/testkit/ParallelMultiNodeSpec.d.ts.map +1 -1
- package/dist/testkit/ParallelMultiNodeSpec.js +49 -4
- package/dist/testkit/ParallelMultiNodeSpec.js.map +1 -1
- package/dist/testkit/SnapshotMigrationTest.d.ts +86 -0
- package/dist/testkit/SnapshotMigrationTest.d.ts.map +1 -0
- package/dist/testkit/SnapshotMigrationTest.js +77 -0
- package/dist/testkit/SnapshotMigrationTest.js.map +1 -0
- package/dist/testkit/TestKit.d.ts +6 -8
- package/dist/testkit/TestKit.d.ts.map +1 -1
- package/dist/testkit/TestKit.js +10 -6
- package/dist/testkit/TestKit.js.map +1 -1
- package/dist/testkit/TestKitOptions.d.ts +26 -0
- package/dist/testkit/TestKitOptions.d.ts.map +1 -0
- package/dist/testkit/TestKitOptions.js +19 -0
- package/dist/testkit/TestKitOptions.js.map +1 -0
- package/dist/testkit/TestProbe.d.ts +2 -7
- package/dist/testkit/TestProbe.d.ts.map +1 -1
- package/dist/testkit/TestProbe.js +2 -1
- package/dist/testkit/TestProbe.js.map +1 -1
- package/dist/testkit/TestProbeOptions.d.ts +26 -0
- package/dist/testkit/TestProbeOptions.d.ts.map +1 -0
- package/dist/testkit/TestProbeOptions.js +19 -0
- package/dist/testkit/TestProbeOptions.js.map +1 -0
- package/dist/testkit/index.d.ts +10 -2
- package/dist/testkit/index.d.ts.map +1 -1
- package/dist/testkit/index.js +5 -0
- package/dist/testkit/index.js.map +1 -1
- package/dist/testkit/internal/parallel-multi-node-bootstrap.d.ts.map +1 -1
- package/dist/testkit/internal/parallel-multi-node-bootstrap.js +16 -12
- package/dist/testkit/internal/parallel-multi-node-bootstrap.js.map +1 -1
- package/dist/tracing/OtelAdapter.d.ts +4 -12
- package/dist/tracing/OtelAdapter.d.ts.map +1 -1
- package/dist/tracing/OtelAdapter.js +4 -2
- package/dist/tracing/OtelAdapter.js.map +1 -1
- package/dist/tracing/OtelAdapterOptions.d.ts +42 -0
- package/dist/tracing/OtelAdapterOptions.d.ts.map +1 -0
- package/dist/tracing/OtelAdapterOptions.js +34 -0
- package/dist/tracing/OtelAdapterOptions.js.map +1 -0
- package/dist/tracing/OtelLogsAdapter.d.ts +100 -0
- package/dist/tracing/OtelLogsAdapter.d.ts.map +1 -0
- package/dist/tracing/OtelLogsAdapter.js +130 -0
- package/dist/tracing/OtelLogsAdapter.js.map +1 -0
- package/dist/tracing/index.d.ts +5 -1
- package/dist/tracing/index.d.ts.map +1 -1
- package/dist/tracing/index.js +2 -0
- package/dist/tracing/index.js.map +1 -1
- package/dist/util/Constants.d.ts +23 -0
- package/dist/util/Constants.d.ts.map +1 -1
- package/dist/util/Constants.js +23 -0
- package/dist/util/Constants.js.map +1 -1
- package/dist/util/Lazy.d.ts +31 -0
- package/dist/util/Lazy.d.ts.map +1 -1
- package/dist/util/Lazy.js +70 -0
- package/dist/util/Lazy.js.map +1 -1
- package/dist/util/OptionsBuilder.d.ts +48 -0
- package/dist/util/OptionsBuilder.d.ts.map +1 -0
- package/dist/util/OptionsBuilder.js +53 -0
- package/dist/util/OptionsBuilder.js.map +1 -0
- package/dist/worker/WorkerCluster.d.ts +2 -11
- package/dist/worker/WorkerCluster.d.ts.map +1 -1
- package/dist/worker/WorkerCluster.js +2 -1
- package/dist/worker/WorkerCluster.js.map +1 -1
- package/dist/worker/WorkerClusterOptions.d.ts +55 -0
- package/dist/worker/WorkerClusterOptions.d.ts.map +1 -0
- package/dist/worker/WorkerClusterOptions.js +55 -0
- package/dist/worker/WorkerClusterOptions.js.map +1 -0
- package/dist/worker/index.d.ts +3 -1
- package/dist/worker/index.d.ts.map +1 -1
- package/dist/worker/index.js +1 -0
- package/dist/worker/index.js.map +1 -1
- package/package.json +56 -13
- package/dist/io/broker/ServerWebSocketActor.d.ts +0 -109
- package/dist/io/broker/ServerWebSocketActor.d.ts.map +0 -1
- package/dist/io/broker/ServerWebSocketActor.js +0 -128
- package/dist/io/broker/ServerWebSocketActor.js.map +0 -1
- package/dist/io/broker/WebSocketActor.d.ts +0 -77
- package/dist/io/broker/WebSocketActor.d.ts.map +0 -1
- package/dist/io/broker/WebSocketActor.js +0 -217
- package/dist/io/broker/WebSocketActor.js.map +0 -1
- package/dist/io/broker/WebSocketServerAdapters.d.ts +0 -140
- package/dist/io/broker/WebSocketServerAdapters.d.ts.map +0 -1
- package/dist/io/broker/WebSocketServerAdapters.js +0 -155
- package/dist/io/broker/WebSocketServerAdapters.js.map +0 -1
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import { JournalConcurrencyError, JournalError, } from '../JournalTypes.js';
|
|
2
|
+
import { assertSafeIdentifier, buildMariaDbPool, isDuplicateKeyError, rowsOf, } from './MariaDbClient.js';
|
|
3
|
+
/**
|
|
4
|
+
* Journal backed by MariaDB / MySQL via the `mariadb` connector. Sibling
|
|
5
|
+
* of `PostgresJournal` (separate implementation, MariaDB dialect): `?`
|
|
6
|
+
* placeholders, `INSERT IGNORE` for the tag dedup, `ER_DUP_ENTRY` (1062)
|
|
7
|
+
* as the optimistic-concurrency backstop, and `LONGTEXT`/`BIGINT` columns.
|
|
8
|
+
* Cross-process backend → no in-process event bus.
|
|
9
|
+
*/
|
|
10
|
+
export class MariaDbJournal {
|
|
11
|
+
settings;
|
|
12
|
+
table;
|
|
13
|
+
tagsTable;
|
|
14
|
+
autoCreate;
|
|
15
|
+
pool = null;
|
|
16
|
+
initPromise = null;
|
|
17
|
+
closed = false;
|
|
18
|
+
constructor(options = {}) {
|
|
19
|
+
const s = options;
|
|
20
|
+
this.settings = s;
|
|
21
|
+
this.table = assertSafeIdentifier(s.eventsTable ?? 'events', 'events table');
|
|
22
|
+
this.tagsTable = assertSafeIdentifier(s.tagsTable ?? `${this.table}_tags`, 'tags table');
|
|
23
|
+
this.autoCreate = s.autoCreateTables ?? true;
|
|
24
|
+
}
|
|
25
|
+
async append(pid, events, expectedSeq, tags) {
|
|
26
|
+
if (events.length === 0)
|
|
27
|
+
return [];
|
|
28
|
+
const pool = await this.ensureOpen();
|
|
29
|
+
const conn = await pool.getConnection();
|
|
30
|
+
const now = Date.now();
|
|
31
|
+
try {
|
|
32
|
+
await conn.beginTransaction();
|
|
33
|
+
const head = rowsOf(await conn.query(`SELECT COALESCE(MAX(sequence_nr), 0) AS hi FROM ${this.table} WHERE persistence_id = ?`, [pid]));
|
|
34
|
+
const actualSeq = Number(head[0].hi);
|
|
35
|
+
if (actualSeq !== expectedSeq) {
|
|
36
|
+
await conn.rollback();
|
|
37
|
+
throw new JournalConcurrencyError(pid, expectedSeq, actualSeq);
|
|
38
|
+
}
|
|
39
|
+
const out = [];
|
|
40
|
+
const tagString = tags && tags.length ? tags.join(',') : null;
|
|
41
|
+
let seq = actualSeq;
|
|
42
|
+
for (const ev of events) {
|
|
43
|
+
seq++;
|
|
44
|
+
await conn.query(`INSERT INTO ${this.table}(persistence_id, sequence_nr, payload, tags, timestamp) VALUES (?, ?, ?, ?, ?)`, [pid, seq, JSON.stringify(ev), tagString, now]);
|
|
45
|
+
if (tags) {
|
|
46
|
+
for (const tag of tags) {
|
|
47
|
+
if (tag.length === 0)
|
|
48
|
+
continue;
|
|
49
|
+
await conn.query(`INSERT IGNORE INTO ${this.tagsTable}(persistence_id, sequence_nr, tag, timestamp) VALUES (?, ?, ?, ?)`, [pid, seq, tag, now]);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
out.push({
|
|
53
|
+
persistenceId: pid,
|
|
54
|
+
sequenceNr: seq,
|
|
55
|
+
event: ev,
|
|
56
|
+
timestamp: now,
|
|
57
|
+
tags: tags ? [...tags] : undefined,
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
await conn.commit();
|
|
61
|
+
return out;
|
|
62
|
+
}
|
|
63
|
+
catch (e) {
|
|
64
|
+
try {
|
|
65
|
+
await conn.rollback();
|
|
66
|
+
}
|
|
67
|
+
catch { /* already rolled back */ }
|
|
68
|
+
if (e instanceof JournalConcurrencyError)
|
|
69
|
+
throw e;
|
|
70
|
+
if (isDuplicateKeyError(e)) {
|
|
71
|
+
const actual = await this.highestSeq(pid).catch(() => expectedSeq);
|
|
72
|
+
throw new JournalConcurrencyError(pid, expectedSeq, actual);
|
|
73
|
+
}
|
|
74
|
+
throw new JournalError(`MariaDbJournal.append failed: ${e.message}`, e);
|
|
75
|
+
}
|
|
76
|
+
finally {
|
|
77
|
+
conn.release();
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
async read(pid, fromSeq, toSeq) {
|
|
81
|
+
const pool = await this.ensureOpen();
|
|
82
|
+
try {
|
|
83
|
+
const rows = rowsOf(toSeq === undefined
|
|
84
|
+
? await pool.query(`SELECT persistence_id, sequence_nr, payload, tags, timestamp FROM ${this.table} WHERE persistence_id = ? AND sequence_nr >= ? ORDER BY sequence_nr ASC`, [pid, fromSeq])
|
|
85
|
+
: await pool.query(`SELECT persistence_id, sequence_nr, payload, tags, timestamp FROM ${this.table} WHERE persistence_id = ? AND sequence_nr >= ? AND sequence_nr <= ? ORDER BY sequence_nr ASC`, [pid, fromSeq, toSeq]));
|
|
86
|
+
return rows.map((r) => ({
|
|
87
|
+
persistenceId: r.persistence_id,
|
|
88
|
+
sequenceNr: Number(r.sequence_nr),
|
|
89
|
+
event: JSON.parse(r.payload),
|
|
90
|
+
timestamp: Number(r.timestamp),
|
|
91
|
+
tags: r.tags ? String(r.tags).split(',') : undefined,
|
|
92
|
+
}));
|
|
93
|
+
}
|
|
94
|
+
catch (e) {
|
|
95
|
+
throw new JournalError(`MariaDbJournal.read failed: ${e.message}`, e);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
async highestSeq(pid) {
|
|
99
|
+
const pool = await this.ensureOpen();
|
|
100
|
+
const rows = rowsOf(await pool.query(`SELECT COALESCE(MAX(sequence_nr), 0) AS hi FROM ${this.table} WHERE persistence_id = ?`, [pid]));
|
|
101
|
+
return Number(rows[0].hi);
|
|
102
|
+
}
|
|
103
|
+
async delete(pid, toSeq) {
|
|
104
|
+
const pool = await this.ensureOpen();
|
|
105
|
+
await pool.query(`DELETE FROM ${this.tagsTable} WHERE persistence_id = ? AND sequence_nr <= ?`, [pid, toSeq]);
|
|
106
|
+
await pool.query(`DELETE FROM ${this.table} WHERE persistence_id = ? AND sequence_nr <= ?`, [pid, toSeq]);
|
|
107
|
+
}
|
|
108
|
+
async persistenceIds() {
|
|
109
|
+
const pool = await this.ensureOpen();
|
|
110
|
+
const rows = rowsOf(await pool.query(`SELECT DISTINCT persistence_id FROM ${this.table}`));
|
|
111
|
+
return rows.map((r) => r.persistence_id);
|
|
112
|
+
}
|
|
113
|
+
async close() {
|
|
114
|
+
if (this.closed)
|
|
115
|
+
return;
|
|
116
|
+
this.closed = true;
|
|
117
|
+
try {
|
|
118
|
+
await this.pool?.end();
|
|
119
|
+
}
|
|
120
|
+
catch { /* ignore */ }
|
|
121
|
+
this.pool = null;
|
|
122
|
+
}
|
|
123
|
+
/* --------------------------- internals -------------------------------- */
|
|
124
|
+
async ensureOpen() {
|
|
125
|
+
if (this.closed)
|
|
126
|
+
throw new JournalError('MariaDbJournal is closed');
|
|
127
|
+
if (this.pool)
|
|
128
|
+
return this.pool;
|
|
129
|
+
if (!this.initPromise)
|
|
130
|
+
this.initPromise = this.init();
|
|
131
|
+
await this.initPromise;
|
|
132
|
+
return this.pool;
|
|
133
|
+
}
|
|
134
|
+
async init() {
|
|
135
|
+
const pool = await buildMariaDbPool(this.settings);
|
|
136
|
+
if (this.autoCreate) {
|
|
137
|
+
// Indexes declared inline — `CREATE INDEX IF NOT EXISTS` isn't
|
|
138
|
+
// portable across MariaDB/MySQL versions, but inline INDEX in
|
|
139
|
+
// CREATE TABLE is.
|
|
140
|
+
await pool.query(`CREATE TABLE IF NOT EXISTS ${this.table} (
|
|
141
|
+
persistence_id VARCHAR(255) NOT NULL,
|
|
142
|
+
sequence_nr BIGINT NOT NULL,
|
|
143
|
+
payload LONGTEXT NOT NULL,
|
|
144
|
+
tags TEXT,
|
|
145
|
+
timestamp BIGINT NOT NULL,
|
|
146
|
+
PRIMARY KEY (persistence_id, sequence_nr),
|
|
147
|
+
INDEX idx_${this.table}_pid (persistence_id)
|
|
148
|
+
)`);
|
|
149
|
+
await pool.query(`CREATE TABLE IF NOT EXISTS ${this.tagsTable} (
|
|
150
|
+
persistence_id VARCHAR(255) NOT NULL,
|
|
151
|
+
sequence_nr BIGINT NOT NULL,
|
|
152
|
+
tag VARCHAR(255) NOT NULL,
|
|
153
|
+
timestamp BIGINT NOT NULL,
|
|
154
|
+
PRIMARY KEY (tag, timestamp, persistence_id, sequence_nr),
|
|
155
|
+
INDEX idx_${this.tagsTable}_pid_seq (persistence_id, sequence_nr)
|
|
156
|
+
)`);
|
|
157
|
+
}
|
|
158
|
+
this.pool = pool;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
//# sourceMappingURL=MariaDbJournal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MariaDbJournal.js","sourceRoot":"","sources":["../../../src/persistence/journals/MariaDbJournal.ts"],"names":[],"mappings":"AACA,OAAO,EACL,uBAAuB,EACvB,YAAY,GAEb,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,oBAAoB,EACpB,gBAAgB,EAChB,mBAAmB,EACnB,MAAM,GAEP,MAAM,oBAAoB,CAAC;AAW5B;;;;;;GAMG;AACH,MAAM,OAAO,cAAc;IACR,QAAQ,CAA4B;IACpC,KAAK,CAAS;IACd,SAAS,CAAS;IAClB,UAAU,CAAU;IAE7B,IAAI,GAA2B,IAAI,CAAC;IACpC,WAAW,GAAyB,IAAI,CAAC;IACzC,MAAM,GAAG,KAAK,CAAC;IAEvB,YAAY,UAAiC,EAAE;QAC7C,MAAM,CAAC,GAAI,OAAqC,CAAC;QACjD,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAC;QAClB,IAAI,CAAC,KAAK,GAAG,oBAAoB,CAAC,CAAC,CAAC,WAAW,IAAI,QAAQ,EAAE,cAAc,CAAC,CAAC;QAC7E,IAAI,CAAC,SAAS,GAAG,oBAAoB,CACnC,CAAC,CAAC,SAAS,IAAI,GAAG,IAAI,CAAC,KAAK,OAAO,EAAE,YAAY,CAClD,CAAC;QACF,IAAI,CAAC,UAAU,GAAG,CAAC,CAAC,gBAAgB,IAAI,IAAI,CAAC;IAC/C,CAAC;IAED,KAAK,CAAC,MAAM,CACV,GAAW,EACX,MAAwB,EACxB,WAAmB,EACnB,IAA4B;QAE5B,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,EAAE,CAAC;QACnC,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,UAAU,EAAE,CAAC;QACrC,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,aAAa,EAAE,CAAC;QACxC,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QACvB,IAAI,CAAC;YACH,MAAM,IAAI,CAAC,gBAAgB,EAAE,CAAC;YAC9B,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,IAAI,CAAC,KAAK,CAClC,mDAAmD,IAAI,CAAC,KAAK,2BAA2B,EACxF,CAAC,GAAG,CAAC,CACN,CAAC,CAAC;YACH,MAAM,SAAS,GAAG,MAAM,CAAE,IAAI,CAAC,CAAC,CAAsC,CAAC,EAAE,CAAC,CAAC;YAC3E,IAAI,SAAS,KAAK,WAAW,EAAE,CAAC;gBAC9B,MAAM,IAAI,CAAC,QAAQ,EAAE,CAAC;gBACtB,MAAM,IAAI,uBAAuB,CAAC,GAAG,EAAE,WAAW,EAAE,SAAS,CAAC,CAAC;YACjE,CAAC;YACD,MAAM,GAAG,GAAyB,EAAE,CAAC;YACrC,MAAM,SAAS,GAAG,IAAI,IAAI,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;YAC9D,IAAI,GAAG,GAAG,SAAS,CAAC;YACpB,KAAK,MAAM,EAAE,IAAI,MAAM,EAAE,CAAC;gBACxB,GAAG,EAAE,CAAC;gBACN,MAAM,IAAI,CAAC,KAAK,CACd,eAAe,IAAI,CAAC,KAAK,gFAAgF,EACzG,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,EAAE,SAAS,EAAE,GAAG,CAAC,CAC/C,CAAC;gBACF,IAAI,IAAI,EAAE,CAAC;oBACT,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;wBACvB,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC;4BAAE,SAAS;wBAC/B,MAAM,IAAI,CAAC,KAAK,CACd,sBAAsB,IAAI,CAAC,SAAS,mEAAmE,EACvG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CACrB,CAAC;oBACJ,CAAC;gBACH,CAAC;gBACD,GAAG,CAAC,IAAI,CAAC;oBACP,aAAa,EAAE,GAAG;oBAClB,UAAU,EAAE,GAAG;oBACf,KAAK,EAAE,EAAE;oBACT,SAAS,EAAE,GAAG;oBACd,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS;iBACnC,CAAC,CAAC;YACL,CAAC;YACD,MAAM,IAAI,CAAC,MAAM,EAAE,CAAC;YACpB,OAAO,GAAG,CAAC;QACb,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,IAAI,CAAC;gBAAC,MAAM,IAAI,CAAC,QAAQ,EAAE,CAAC;YAAC,CAAC;YAAC,MAAM,CAAC,CAAC,yBAAyB,CAAC,CAAC;YAClE,IAAI,CAAC,YAAY,uBAAuB;gBAAE,MAAM,CAAC,CAAC;YAClD,IAAI,mBAAmB,CAAC,CAAC,CAAC,EAAE,CAAC;gBAC3B,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,WAAW,CAAC,CAAC;gBACnE,MAAM,IAAI,uBAAuB,CAAC,GAAG,EAAE,WAAW,EAAE,MAAM,CAAC,CAAC;YAC9D,CAAC;YACD,MAAM,IAAI,YAAY,CAAC,iCAAkC,CAAW,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;QACrF,CAAC;gBAAS,CAAC;YACT,IAAI,CAAC,OAAO,EAAE,CAAC;QACjB,CAAC;IACH,CAAC;IAED,KAAK,CAAC,IAAI,CAAI,GAAW,EAAE,OAAe,EAAE,KAAc;QACxD,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,UAAU,EAAE,CAAC;QACrC,IAAI,CAAC;YACH,MAAM,IAAI,GAAG,MAAM,CAAC,KAAK,KAAK,SAAS;gBACrC,CAAC,CAAC,MAAM,IAAI,CAAC,KAAK,CACd,qEAAqE,IAAI,CAAC,KAAK,yEAAyE,EACxJ,CAAC,GAAG,EAAE,OAAO,CAAC,CACf;gBACH,CAAC,CAAC,MAAM,IAAI,CAAC,KAAK,CACd,qEAAqE,IAAI,CAAC,KAAK,8FAA8F,EAC7K,CAAC,GAAG,EAAE,OAAO,EAAE,KAAK,CAAC,CACtB,CAAC,CAAC;YACP,OAAQ,IAA8B,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;gBACjD,aAAa,EAAE,CAAC,CAAC,cAAc;gBAC/B,UAAU,EAAE,MAAM,CAAC,CAAC,CAAC,WAAW,CAAC;gBACjC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAM;gBACjC,SAAS,EAAE,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;gBAC9B,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS;aACrD,CAAC,CAAC,CAAC;QACN,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,MAAM,IAAI,YAAY,CAAC,+BAAgC,CAAW,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;QACnF,CAAC;IACH,CAAC;IAED,KAAK,CAAC,UAAU,CAAC,GAAW;QAC1B,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,UAAU,EAAE,CAAC;QACrC,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,IAAI,CAAC,KAAK,CAClC,mDAAmD,IAAI,CAAC,KAAK,2BAA2B,EACxF,CAAC,GAAG,CAAC,CACN,CAAC,CAAC;QACH,OAAO,MAAM,CAAE,IAAI,CAAC,CAAC,CAAsC,CAAC,EAAE,CAAC,CAAC;IAClE,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,GAAW,EAAE,KAAa;QACrC,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,UAAU,EAAE,CAAC;QACrC,MAAM,IAAI,CAAC,KAAK,CACd,eAAe,IAAI,CAAC,SAAS,gDAAgD,EAC7E,CAAC,GAAG,EAAE,KAAK,CAAC,CACb,CAAC;QACF,MAAM,IAAI,CAAC,KAAK,CACd,eAAe,IAAI,CAAC,KAAK,gDAAgD,EACzE,CAAC,GAAG,EAAE,KAAK,CAAC,CACb,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,cAAc;QAClB,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,UAAU,EAAE,CAAC;QACrC,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,IAAI,CAAC,KAAK,CAAC,uCAAuC,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;QAC3F,OAAQ,IAA0C,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC;IAClF,CAAC;IAED,KAAK,CAAC,KAAK;QACT,IAAI,IAAI,CAAC,MAAM;YAAE,OAAO;QACxB,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;QACnB,IAAI,CAAC;YAAC,MAAM,IAAI,CAAC,IAAI,EAAE,GAAG,EAAE,CAAC;QAAC,CAAC;QAAC,MAAM,CAAC,CAAC,YAAY,CAAC,CAAC;QACtD,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IAED,4EAA4E;IAEpE,KAAK,CAAC,UAAU;QACtB,IAAI,IAAI,CAAC,MAAM;YAAE,MAAM,IAAI,YAAY,CAAC,0BAA0B,CAAC,CAAC;QACpE,IAAI,IAAI,CAAC,IAAI;YAAE,OAAO,IAAI,CAAC,IAAI,CAAC;QAChC,IAAI,CAAC,IAAI,CAAC,WAAW;YAAE,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;QACtD,MAAM,IAAI,CAAC,WAAW,CAAC;QACvB,OAAO,IAAI,CAAC,IAAK,CAAC;IACpB,CAAC;IAEO,KAAK,CAAC,IAAI;QAChB,MAAM,IAAI,GAAG,MAAM,gBAAgB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACnD,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;YACpB,+DAA+D;YAC/D,8DAA8D;YAC9D,mBAAmB;YACnB,MAAM,IAAI,CAAC,KAAK,CACd,8BAA8B,IAAI,CAAC,KAAK;;;;;;;uBAOzB,IAAI,CAAC,KAAK;WACtB,CACJ,CAAC;YACF,MAAM,IAAI,CAAC,KAAK,CACd,8BAA8B,IAAI,CAAC,SAAS;;;;;;uBAM7B,IAAI,CAAC,SAAS;WAC1B,CACJ,CAAC;QACJ,CAAC;QACD,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;CACF"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { OptionsBuilder } from '../../util/OptionsBuilder.js';
|
|
2
|
+
import type { MariaDbPoolLike, MariaDbConnection } from './MariaDbClient.js';
|
|
3
|
+
export interface MariaDbJournalOptionsType extends MariaDbConnection {
|
|
4
|
+
/** Events table name. Default: `events`. */
|
|
5
|
+
readonly eventsTable?: string;
|
|
6
|
+
/** Tags join table name. Default: `${eventsTable}_tags`. */
|
|
7
|
+
readonly tagsTable?: string;
|
|
8
|
+
/** Run `CREATE TABLE IF NOT EXISTS` on first use. Default: true. */
|
|
9
|
+
readonly autoCreateTables?: boolean;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Fluent builder for {@link MariaDbJournalOptionsType}:
|
|
13
|
+
*
|
|
14
|
+
* new MariaDbJournal(MariaDbJournalOptions.create().withUrl('mariadb://…').withEventsTable('journal'))
|
|
15
|
+
*
|
|
16
|
+
* The connection fields (`withUrl` / `withPoolConfig` / `withPool`) come
|
|
17
|
+
* from the shared {@link MariaDbConnection} mixin; the rest are journal
|
|
18
|
+
* specific.
|
|
19
|
+
*/
|
|
20
|
+
export declare class MariaDbJournalOptionsBuilder extends OptionsBuilder<MariaDbJournalOptionsType> {
|
|
21
|
+
/** Start a fresh builder. Equivalent to `new MariaDbJournalOptionsBuilder()`. */
|
|
22
|
+
static create(): MariaDbJournalOptionsBuilder;
|
|
23
|
+
/** Connection URI passed straight to `createPool`, e.g. `mariadb://user:pass@host:3306/db`. */
|
|
24
|
+
withUrl(url: string): this;
|
|
25
|
+
/** `createPool` config object (host/user/password/database/…); takes precedence over `url`. */
|
|
26
|
+
withPoolConfig(poolConfig: Record<string, unknown>): this;
|
|
27
|
+
/** Pre-built pool — shares one pool across the three stores, or injects a fake in tests. */
|
|
28
|
+
withPool(pool: MariaDbPoolLike): this;
|
|
29
|
+
/** Events table name. Default: `events`. */
|
|
30
|
+
withEventsTable(eventsTable: string): this;
|
|
31
|
+
/** Tags join table name. Default: `${eventsTable}_tags`. */
|
|
32
|
+
withTagsTable(tagsTable: string): this;
|
|
33
|
+
/** Run `CREATE TABLE IF NOT EXISTS` on first use. Default: true. */
|
|
34
|
+
withAutoCreateTables(autoCreateTables: boolean): this;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Accepted input for any MariaDB-journal constructor: the fluent
|
|
38
|
+
* {@link MariaDbJournalOptionsBuilder} OR a plain {@link MariaDbJournalOptionsType} object.
|
|
39
|
+
*/
|
|
40
|
+
export type MariaDbJournalOptions = MariaDbJournalOptionsBuilder | Partial<MariaDbJournalOptionsType>;
|
|
41
|
+
/** Value alias so `MariaDbJournalOptions.create()` / `new MariaDbJournalOptions()` resolve to the builder. */
|
|
42
|
+
export declare const MariaDbJournalOptions: typeof MariaDbJournalOptionsBuilder;
|
|
43
|
+
//# sourceMappingURL=MariaDbJournalOptions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MariaDbJournalOptions.d.ts","sourceRoot":"","sources":["../../../src/persistence/journals/MariaDbJournalOptions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,KAAK,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAE7E,MAAM,WAAW,yBAA0B,SAAQ,iBAAiB;IAClE,6CAA6C;IAC7C,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,6DAA6D;IAC7D,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,qEAAqE;IACrE,QAAQ,CAAC,gBAAgB,CAAC,EAAE,OAAO,CAAC;CACrC;AAED;;;;;;;;GAQG;AACH,qBAAa,4BAA6B,SAAQ,cAAc,CAAC,yBAAyB,CAAC;IACzF,kFAAkF;IAClF,MAAM,CAAC,MAAM,IAAI,4BAA4B;IAI7C,+FAA+F;IAC/F,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAI1B,+FAA+F;IAC/F,cAAc,CAAC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;IAIzD,4FAA4F;IAC5F,QAAQ,CAAC,IAAI,EAAE,eAAe,GAAG,IAAI;IAIrC,6CAA6C;IAC7C,eAAe,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI;IAI1C,6DAA6D;IAC7D,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI;IAItC,qEAAqE;IACrE,oBAAoB,CAAC,gBAAgB,EAAE,OAAO,GAAG,IAAI;CAGtD;AAED;;;GAGG;AACH,MAAM,MAAM,qBAAqB,GAAG,4BAA4B,GAAG,OAAO,CAAC,yBAAyB,CAAC,CAAC;AACtG,8GAA8G;AAC9G,eAAO,MAAM,qBAAqB,qCAA+B,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { OptionsBuilder } from '../../util/OptionsBuilder.js';
|
|
2
|
+
/**
|
|
3
|
+
* Fluent builder for {@link MariaDbJournalOptionsType}:
|
|
4
|
+
*
|
|
5
|
+
* new MariaDbJournal(MariaDbJournalOptions.create().withUrl('mariadb://…').withEventsTable('journal'))
|
|
6
|
+
*
|
|
7
|
+
* The connection fields (`withUrl` / `withPoolConfig` / `withPool`) come
|
|
8
|
+
* from the shared {@link MariaDbConnection} mixin; the rest are journal
|
|
9
|
+
* specific.
|
|
10
|
+
*/
|
|
11
|
+
export class MariaDbJournalOptionsBuilder extends OptionsBuilder {
|
|
12
|
+
/** Start a fresh builder. Equivalent to `new MariaDbJournalOptionsBuilder()`. */
|
|
13
|
+
static create() {
|
|
14
|
+
return new MariaDbJournalOptionsBuilder();
|
|
15
|
+
}
|
|
16
|
+
/** Connection URI passed straight to `createPool`, e.g. `mariadb://user:pass@host:3306/db`. */
|
|
17
|
+
withUrl(url) {
|
|
18
|
+
return this.set('url', url);
|
|
19
|
+
}
|
|
20
|
+
/** `createPool` config object (host/user/password/database/…); takes precedence over `url`. */
|
|
21
|
+
withPoolConfig(poolConfig) {
|
|
22
|
+
return this.set('poolConfig', poolConfig);
|
|
23
|
+
}
|
|
24
|
+
/** Pre-built pool — shares one pool across the three stores, or injects a fake in tests. */
|
|
25
|
+
withPool(pool) {
|
|
26
|
+
return this.set('pool', pool);
|
|
27
|
+
}
|
|
28
|
+
/** Events table name. Default: `events`. */
|
|
29
|
+
withEventsTable(eventsTable) {
|
|
30
|
+
return this.set('eventsTable', eventsTable);
|
|
31
|
+
}
|
|
32
|
+
/** Tags join table name. Default: `${eventsTable}_tags`. */
|
|
33
|
+
withTagsTable(tagsTable) {
|
|
34
|
+
return this.set('tagsTable', tagsTable);
|
|
35
|
+
}
|
|
36
|
+
/** Run `CREATE TABLE IF NOT EXISTS` on first use. Default: true. */
|
|
37
|
+
withAutoCreateTables(autoCreateTables) {
|
|
38
|
+
return this.set('autoCreateTables', autoCreateTables);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
/** Value alias so `MariaDbJournalOptions.create()` / `new MariaDbJournalOptions()` resolve to the builder. */
|
|
42
|
+
export const MariaDbJournalOptions = MariaDbJournalOptionsBuilder;
|
|
43
|
+
//# sourceMappingURL=MariaDbJournalOptions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MariaDbJournalOptions.js","sourceRoot":"","sources":["../../../src/persistence/journals/MariaDbJournalOptions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAY9D;;;;;;;;GAQG;AACH,MAAM,OAAO,4BAA6B,SAAQ,cAAyC;IACzF,kFAAkF;IAClF,MAAM,CAAC,MAAM;QACX,OAAO,IAAI,4BAA4B,EAAE,CAAC;IAC5C,CAAC;IAED,+FAA+F;IAC/F,OAAO,CAAC,GAAW;QACjB,OAAO,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IAC9B,CAAC;IAED,+FAA+F;IAC/F,cAAc,CAAC,UAAmC;QAChD,OAAO,IAAI,CAAC,GAAG,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;IAC5C,CAAC;IAED,4FAA4F;IAC5F,QAAQ,CAAC,IAAqB;QAC5B,OAAO,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IAChC,CAAC;IAED,6CAA6C;IAC7C,eAAe,CAAC,WAAmB;QACjC,OAAO,IAAI,CAAC,GAAG,CAAC,aAAa,EAAE,WAAW,CAAC,CAAC;IAC9C,CAAC;IAED,6DAA6D;IAC7D,aAAa,CAAC,SAAiB;QAC7B,OAAO,IAAI,CAAC,GAAG,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC;IAC1C,CAAC;IAED,qEAAqE;IACrE,oBAAoB,CAAC,gBAAyB;QAC5C,OAAO,IAAI,CAAC,GAAG,CAAC,kBAAkB,EAAE,gBAAgB,CAAC,CAAC;IACxD,CAAC;CACF;AAOD,8GAA8G;AAC9G,MAAM,CAAC,MAAM,qBAAqB,GAAG,4BAA4B,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { PersistenceExtension } from '../PersistenceExtension.js';
|
|
2
|
+
import { MariaDbDurableStateStore } from '../durable-state-stores/MariaDbDurableStateStore.js';
|
|
3
|
+
import type { RegisterMariaDbPluginsOptions } from './MariaDbPluginOptions.js';
|
|
4
|
+
/** Canonical plug-in IDs for the MariaDB journal, snapshot, and durable-state stores. */
|
|
5
|
+
export declare const MARIADB_JOURNAL_PLUGIN_ID = "actor-ts.persistence.journal.mariadb";
|
|
6
|
+
export declare const MARIADB_SNAPSHOT_PLUGIN_ID = "actor-ts.persistence.snapshot-store.mariadb";
|
|
7
|
+
export declare const MARIADB_DURABLE_STATE_PLUGIN_ID = "actor-ts.persistence.durable-state.mariadb";
|
|
8
|
+
export interface MariaDbPluginHandles {
|
|
9
|
+
/**
|
|
10
|
+
* The DurableState store instance. `PersistenceExtension` carries no
|
|
11
|
+
* DurableState registry (same as the object-storage / Postgres plugins),
|
|
12
|
+
* so callers who want DurableState read this from the return value and
|
|
13
|
+
* pass it into their `DurableStateActor` settings.
|
|
14
|
+
*/
|
|
15
|
+
readonly durableStateStore: MariaDbDurableStateStore;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* One-shot registration of the MariaDB journal + snapshot store against the
|
|
19
|
+
* running `PersistenceExtension`, returning a ready-to-use DurableState
|
|
20
|
+
* store handle. Mirrors `registerPostgresPlugins`.
|
|
21
|
+
*
|
|
22
|
+
* After this call, activate via:
|
|
23
|
+
* `actor-ts.persistence.journal.plugin = "actor-ts.persistence.journal.mariadb"`
|
|
24
|
+
* `actor-ts.persistence.snapshot-store.plugin = "actor-ts.persistence.snapshot-store.mariadb"`
|
|
25
|
+
*/
|
|
26
|
+
export declare function registerMariaDbPlugins(ext: PersistenceExtension, options: RegisterMariaDbPluginsOptions): MariaDbPluginHandles;
|
|
27
|
+
//# sourceMappingURL=MariaDbPlugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MariaDbPlugin.d.ts","sourceRoot":"","sources":["../../../src/persistence/journals/MariaDbPlugin.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAKvE,OAAO,EAAE,wBAAwB,EAAE,MAAM,qDAAqD,CAAC;AAE/F,OAAO,KAAK,EAAE,6BAA6B,EAAqC,MAAM,2BAA2B,CAAC;AAElH,yFAAyF;AACzF,eAAO,MAAM,yBAAyB,yCAAyC,CAAC;AAChF,eAAO,MAAM,0BAA0B,gDAAgD,CAAC;AACxF,eAAO,MAAM,+BAA+B,+CAA+C,CAAC;AAE5F,MAAM,WAAW,oBAAoB;IACnC;;;;;OAKG;IACH,QAAQ,CAAC,iBAAiB,EAAE,wBAAwB,CAAC;CACtD;AAED;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CACpC,GAAG,EAAE,oBAAoB,EACzB,OAAO,EAAE,6BAA6B,GACrC,oBAAoB,CAkBtB"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { MariaDbJournal } from './MariaDbJournal.js';
|
|
2
|
+
import { MariaDbSnapshotStore } from '../snapshot-stores/MariaDbSnapshotStore.js';
|
|
3
|
+
import { MariaDbDurableStateStore } from '../durable-state-stores/MariaDbDurableStateStore.js';
|
|
4
|
+
/** Canonical plug-in IDs for the MariaDB journal, snapshot, and durable-state stores. */
|
|
5
|
+
export const MARIADB_JOURNAL_PLUGIN_ID = 'actor-ts.persistence.journal.mariadb';
|
|
6
|
+
export const MARIADB_SNAPSHOT_PLUGIN_ID = 'actor-ts.persistence.snapshot-store.mariadb';
|
|
7
|
+
export const MARIADB_DURABLE_STATE_PLUGIN_ID = 'actor-ts.persistence.durable-state.mariadb';
|
|
8
|
+
/**
|
|
9
|
+
* One-shot registration of the MariaDB journal + snapshot store against the
|
|
10
|
+
* running `PersistenceExtension`, returning a ready-to-use DurableState
|
|
11
|
+
* store handle. Mirrors `registerPostgresPlugins`.
|
|
12
|
+
*
|
|
13
|
+
* After this call, activate via:
|
|
14
|
+
* `actor-ts.persistence.journal.plugin = "actor-ts.persistence.journal.mariadb"`
|
|
15
|
+
* `actor-ts.persistence.snapshot-store.plugin = "actor-ts.persistence.snapshot-store.mariadb"`
|
|
16
|
+
*/
|
|
17
|
+
export function registerMariaDbPlugins(ext, options) {
|
|
18
|
+
const s = options;
|
|
19
|
+
// Resolve each leaf to a plain object and merge the shared pool (when set)
|
|
20
|
+
// onto it. A missing leaf falls back to an empty object so the shared
|
|
21
|
+
// pool still reaches every store.
|
|
22
|
+
const journal = { ...(s.journal ?? {}), ...(s.pool ? { pool: s.pool } : {}) };
|
|
23
|
+
const snapshotStore = { ...(s.snapshotStore ?? {}), ...(s.pool ? { pool: s.pool } : {}) };
|
|
24
|
+
const durableState = { ...(s.durableStateStore ?? {}), ...(s.pool ? { pool: s.pool } : {}) };
|
|
25
|
+
ext.registerJournal(MARIADB_JOURNAL_PLUGIN_ID, (_system) => new MariaDbJournal(journal));
|
|
26
|
+
ext.registerSnapshotStore(MARIADB_SNAPSHOT_PLUGIN_ID, (_system) => new MariaDbSnapshotStore(snapshotStore));
|
|
27
|
+
const durableStateStore = new MariaDbDurableStateStore(durableState);
|
|
28
|
+
return { durableStateStore };
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=MariaDbPlugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MariaDbPlugin.js","sourceRoot":"","sources":["../../../src/persistence/journals/MariaDbPlugin.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD,OAAO,EAAE,oBAAoB,EAAE,MAAM,4CAA4C,CAAC;AAElF,OAAO,EAAE,wBAAwB,EAAE,MAAM,qDAAqD,CAAC;AAI/F,yFAAyF;AACzF,MAAM,CAAC,MAAM,yBAAyB,GAAG,sCAAsC,CAAC;AAChF,MAAM,CAAC,MAAM,0BAA0B,GAAG,6CAA6C,CAAC;AACxF,MAAM,CAAC,MAAM,+BAA+B,GAAG,4CAA4C,CAAC;AAY5F;;;;;;;;GAQG;AACH,MAAM,UAAU,sBAAsB,CACpC,GAAyB,EACzB,OAAsC;IAEtC,MAAM,CAAC,GAAI,OAA6C,CAAC;IACzD,2EAA2E;IAC3E,uEAAuE;IACvE,kCAAkC;IAClC,MAAM,OAAO,GAAG,EAAE,GAAI,CAAC,CAAC,CAAC,OAAO,IAAI,EAAE,CAAwC,EAAE,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;IACtH,MAAM,aAAa,GAAG,EAAE,GAAI,CAAC,CAAC,CAAC,aAAa,IAAI,EAAE,CAA8C,EAAE,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;IACxI,MAAM,YAAY,GAAG,EAAE,GAAI,CAAC,CAAC,CAAC,iBAAiB,IAAI,EAAE,CAAkD,EAAE,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;IAC/I,GAAG,CAAC,eAAe,CACjB,yBAAyB,EACzB,CAAC,OAAoB,EAAE,EAAE,CAAC,IAAI,cAAc,CAAC,OAAO,CAAC,CACtD,CAAC;IACF,GAAG,CAAC,qBAAqB,CACvB,0BAA0B,EAC1B,CAAC,OAAoB,EAAE,EAAE,CAAC,IAAI,oBAAoB,CAAC,aAAa,CAAC,CAClE,CAAC;IACF,MAAM,iBAAiB,GAAG,IAAI,wBAAwB,CAAC,YAAY,CAAC,CAAC;IACrE,OAAO,EAAE,iBAAiB,EAAE,CAAC;AAC/B,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { OptionsBuilder } from '../../util/OptionsBuilder.js';
|
|
2
|
+
import type { MariaDbPoolLike } from './MariaDbClient.js';
|
|
3
|
+
import type { MariaDbJournalOptions } from './MariaDbJournalOptions.js';
|
|
4
|
+
import type { MariaDbSnapshotStoreOptions } from '../snapshot-stores/MariaDbSnapshotStoreOptions.js';
|
|
5
|
+
import type { MariaDbDurableStateStoreOptions } from '../durable-state-stores/MariaDbDurableStateStoreOptions.js';
|
|
6
|
+
export interface RegisterMariaDbPluginsOptionsType {
|
|
7
|
+
/**
|
|
8
|
+
* Shared connection pool injected into all three stores. When provided,
|
|
9
|
+
* the journal + snapshot + durable-state stores reuse ONE pool. When
|
|
10
|
+
* omitted, each store lazily builds its own from its `url` / `poolConfig`.
|
|
11
|
+
*/
|
|
12
|
+
readonly pool?: MariaDbPoolLike;
|
|
13
|
+
/** Journal builder — its `pool` is overridden by the shared `pool` when set. */
|
|
14
|
+
readonly journal?: MariaDbJournalOptions;
|
|
15
|
+
/** Snapshot-store builder — its `pool` is overridden by the shared `pool` when set. */
|
|
16
|
+
readonly snapshotStore?: MariaDbSnapshotStoreOptions;
|
|
17
|
+
/** Durable-state-store builder — its `pool` is overridden by the shared `pool` when set. */
|
|
18
|
+
readonly durableStateStore?: MariaDbDurableStateStoreOptions;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Fluent builder for {@link RegisterMariaDbPluginsOptionsType}:
|
|
22
|
+
*
|
|
23
|
+
* registerMariaDbPlugins(ext, RegisterMariaDbPluginsOptions.create()
|
|
24
|
+
* .withPool(sharedPool)
|
|
25
|
+
* .withJournal(MariaDbJournalOptions.create().withEventsTable('journal')))
|
|
26
|
+
*
|
|
27
|
+
* Each per-store field is the store's own leaf builder (or a plain object
|
|
28
|
+
* of its settings); the shared `pool` (when set via `withPool`) is merged
|
|
29
|
+
* onto every store's resolved settings at registration time, so a leaf
|
|
30
|
+
* need not repeat the connection.
|
|
31
|
+
*/
|
|
32
|
+
export declare class RegisterMariaDbPluginsOptionsBuilder extends OptionsBuilder<RegisterMariaDbPluginsOptionsType> {
|
|
33
|
+
/** Start a fresh builder. Equivalent to `new RegisterMariaDbPluginsOptionsBuilder()`. */
|
|
34
|
+
static create(): RegisterMariaDbPluginsOptionsBuilder;
|
|
35
|
+
/** Shared connection pool reused by all three stores (overrides each leaf's own pool). */
|
|
36
|
+
withPool(pool: MariaDbPoolLike): this;
|
|
37
|
+
/** Journal builder — table names / autoCreate (connection filled from the shared pool). */
|
|
38
|
+
withJournal(journal: MariaDbJournalOptions): this;
|
|
39
|
+
/** Snapshot-store builder — table name / keepN (connection filled from the shared pool). */
|
|
40
|
+
withSnapshotStore(snapshotStore: MariaDbSnapshotStoreOptions): this;
|
|
41
|
+
/** Durable-state-store builder — table name (connection filled from the shared pool). */
|
|
42
|
+
withDurableStateStore(durableStateStore: MariaDbDurableStateStoreOptions): this;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Accepted input for {@link registerMariaDbPlugins}: the fluent
|
|
46
|
+
* {@link RegisterMariaDbPluginsOptionsBuilder} OR a plain
|
|
47
|
+
* {@link RegisterMariaDbPluginsOptionsType} object.
|
|
48
|
+
*/
|
|
49
|
+
export type RegisterMariaDbPluginsOptions = RegisterMariaDbPluginsOptionsBuilder | Partial<RegisterMariaDbPluginsOptionsType>;
|
|
50
|
+
/** Value alias so `RegisterMariaDbPluginsOptions.create()` / `new RegisterMariaDbPluginsOptions()` resolve to the builder. */
|
|
51
|
+
export declare const RegisterMariaDbPluginsOptions: typeof RegisterMariaDbPluginsOptionsBuilder;
|
|
52
|
+
//# sourceMappingURL=MariaDbPluginOptions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MariaDbPluginOptions.d.ts","sourceRoot":"","sources":["../../../src/persistence/journals/MariaDbPluginOptions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACxE,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,mDAAmD,CAAC;AACrG,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,4DAA4D,CAAC;AAElH,MAAM,WAAW,iCAAiC;IAChD;;;;OAIG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,eAAe,CAAC;IAChC,gFAAgF;IAChF,QAAQ,CAAC,OAAO,CAAC,EAAE,qBAAqB,CAAC;IACzC,uFAAuF;IACvF,QAAQ,CAAC,aAAa,CAAC,EAAE,2BAA2B,CAAC;IACrD,4FAA4F;IAC5F,QAAQ,CAAC,iBAAiB,CAAC,EAAE,+BAA+B,CAAC;CAC9D;AAED;;;;;;;;;;;GAWG;AACH,qBAAa,oCAAqC,SAAQ,cAAc,CAAC,iCAAiC,CAAC;IACzG,0FAA0F;IAC1F,MAAM,CAAC,MAAM,IAAI,oCAAoC;IAIrD,0FAA0F;IAC1F,QAAQ,CAAC,IAAI,EAAE,eAAe,GAAG,IAAI;IAIrC,2FAA2F;IAC3F,WAAW,CAAC,OAAO,EAAE,qBAAqB,GAAG,IAAI;IAIjD,4FAA4F;IAC5F,iBAAiB,CAAC,aAAa,EAAE,2BAA2B,GAAG,IAAI;IAInE,yFAAyF;IACzF,qBAAqB,CAAC,iBAAiB,EAAE,+BAA+B,GAAG,IAAI;CAGhF;AAED;;;;GAIG;AACH,MAAM,MAAM,6BAA6B,GACrC,oCAAoC,GACpC,OAAO,CAAC,iCAAiC,CAAC,CAAC;AAC/C,8HAA8H;AAC9H,eAAO,MAAM,6BAA6B,6CAAuC,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { OptionsBuilder } from '../../util/OptionsBuilder.js';
|
|
2
|
+
/**
|
|
3
|
+
* Fluent builder for {@link RegisterMariaDbPluginsOptionsType}:
|
|
4
|
+
*
|
|
5
|
+
* registerMariaDbPlugins(ext, RegisterMariaDbPluginsOptions.create()
|
|
6
|
+
* .withPool(sharedPool)
|
|
7
|
+
* .withJournal(MariaDbJournalOptions.create().withEventsTable('journal')))
|
|
8
|
+
*
|
|
9
|
+
* Each per-store field is the store's own leaf builder (or a plain object
|
|
10
|
+
* of its settings); the shared `pool` (when set via `withPool`) is merged
|
|
11
|
+
* onto every store's resolved settings at registration time, so a leaf
|
|
12
|
+
* need not repeat the connection.
|
|
13
|
+
*/
|
|
14
|
+
export class RegisterMariaDbPluginsOptionsBuilder extends OptionsBuilder {
|
|
15
|
+
/** Start a fresh builder. Equivalent to `new RegisterMariaDbPluginsOptionsBuilder()`. */
|
|
16
|
+
static create() {
|
|
17
|
+
return new RegisterMariaDbPluginsOptionsBuilder();
|
|
18
|
+
}
|
|
19
|
+
/** Shared connection pool reused by all three stores (overrides each leaf's own pool). */
|
|
20
|
+
withPool(pool) {
|
|
21
|
+
return this.set('pool', pool);
|
|
22
|
+
}
|
|
23
|
+
/** Journal builder — table names / autoCreate (connection filled from the shared pool). */
|
|
24
|
+
withJournal(journal) {
|
|
25
|
+
return this.set('journal', journal);
|
|
26
|
+
}
|
|
27
|
+
/** Snapshot-store builder — table name / keepN (connection filled from the shared pool). */
|
|
28
|
+
withSnapshotStore(snapshotStore) {
|
|
29
|
+
return this.set('snapshotStore', snapshotStore);
|
|
30
|
+
}
|
|
31
|
+
/** Durable-state-store builder — table name (connection filled from the shared pool). */
|
|
32
|
+
withDurableStateStore(durableStateStore) {
|
|
33
|
+
return this.set('durableStateStore', durableStateStore);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
/** Value alias so `RegisterMariaDbPluginsOptions.create()` / `new RegisterMariaDbPluginsOptions()` resolve to the builder. */
|
|
37
|
+
export const RegisterMariaDbPluginsOptions = RegisterMariaDbPluginsOptionsBuilder;
|
|
38
|
+
//# sourceMappingURL=MariaDbPluginOptions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MariaDbPluginOptions.js","sourceRoot":"","sources":["../../../src/persistence/journals/MariaDbPluginOptions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAqB9D;;;;;;;;;;;GAWG;AACH,MAAM,OAAO,oCAAqC,SAAQ,cAAiD;IACzG,0FAA0F;IAC1F,MAAM,CAAC,MAAM;QACX,OAAO,IAAI,oCAAoC,EAAE,CAAC;IACpD,CAAC;IAED,0FAA0F;IAC1F,QAAQ,CAAC,IAAqB;QAC5B,OAAO,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IAChC,CAAC;IAED,2FAA2F;IAC3F,WAAW,CAAC,OAA8B;QACxC,OAAO,IAAI,CAAC,GAAG,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;IACtC,CAAC;IAED,4FAA4F;IAC5F,iBAAiB,CAAC,aAA0C;QAC1D,OAAO,IAAI,CAAC,GAAG,CAAC,eAAe,EAAE,aAAa,CAAC,CAAC;IAClD,CAAC;IAED,yFAAyF;IACzF,qBAAqB,CAAC,iBAAkD;QACtE,OAAO,IAAI,CAAC,GAAG,CAAC,mBAAmB,EAAE,iBAAiB,CAAC,CAAC;IAC1D,CAAC;CACF;AAUD,8HAA8H;AAC9H,MAAM,CAAC,MAAM,6BAA6B,GAAG,oCAAoC,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Minimal shapes of the `pg` (node-postgres) API the Postgres backends
|
|
3
|
+
* use. We deliberately define our own interfaces rather than depend on
|
|
4
|
+
* `@types/pg` — the framework stays dependency-free, `pg` is an OPTIONAL
|
|
5
|
+
* peer-dep loaded lazily, and tests can inject a fake pool that satisfies
|
|
6
|
+
* just these methods.
|
|
7
|
+
*
|
|
8
|
+
* Note: node-postgres returns `BIGINT` columns as **strings** (to avoid
|
|
9
|
+
* precision loss), so every numeric column the backends read is coerced
|
|
10
|
+
* with `Number(...)` at the mapping boundary.
|
|
11
|
+
*/
|
|
12
|
+
export interface PgQueryResult {
|
|
13
|
+
readonly rows: ReadonlyArray<Record<string, unknown>>;
|
|
14
|
+
/** Rows affected by INSERT/UPDATE/DELETE — `null` for some statements. */
|
|
15
|
+
readonly rowCount: number | null;
|
|
16
|
+
}
|
|
17
|
+
/** A single pooled connection — `query` + `release` back to the pool. */
|
|
18
|
+
export interface PgClientLike {
|
|
19
|
+
query(text: string, values?: ReadonlyArray<unknown>): Promise<PgQueryResult>;
|
|
20
|
+
release(): void;
|
|
21
|
+
}
|
|
22
|
+
export interface PgPoolLike {
|
|
23
|
+
query(text: string, values?: ReadonlyArray<unknown>): Promise<PgQueryResult>;
|
|
24
|
+
/** Check out a dedicated connection — required for multi-statement transactions. */
|
|
25
|
+
connect(): Promise<PgClientLike>;
|
|
26
|
+
end(): Promise<void>;
|
|
27
|
+
}
|
|
28
|
+
/** Connection options shared by all three Postgres stores. */
|
|
29
|
+
export interface PostgresConnection {
|
|
30
|
+
/** Connection string, e.g. `postgres://user:pass@host:5432/db`. */
|
|
31
|
+
readonly url?: string;
|
|
32
|
+
/**
|
|
33
|
+
* Extra node-postgres `Pool` config, merged over `{ connectionString:
|
|
34
|
+
* url }` — e.g. `{ max: 10, ssl: { rejectUnauthorized: false } }`.
|
|
35
|
+
*/
|
|
36
|
+
readonly poolConfig?: Record<string, unknown>;
|
|
37
|
+
/**
|
|
38
|
+
* Pre-built pool — bypasses the lazy `pg` import entirely. Use to
|
|
39
|
+
* share ONE pool across the journal + snapshot + durable-state stores
|
|
40
|
+
* (see `registerPostgresPlugins`), or to inject a fake in tests.
|
|
41
|
+
*/
|
|
42
|
+
readonly pool?: PgPoolLike;
|
|
43
|
+
}
|
|
44
|
+
/** Build (or pass through) the connection pool for a store. */
|
|
45
|
+
export declare function buildPgPool(conn: PostgresConnection): Promise<PgPoolLike>;
|
|
46
|
+
/**
|
|
47
|
+
* Guard configurable table names against SQL injection (#136). Table
|
|
48
|
+
* names come from trusted config, not user input — but a parameter bind
|
|
49
|
+
* (`$1`) cannot stand in for an *identifier*, so the name is interpolated
|
|
50
|
+
* into the DDL/DML string directly. Constrain it to a safe charset so a
|
|
51
|
+
* hostile/typo'd config can't smuggle SQL through the table name.
|
|
52
|
+
*/
|
|
53
|
+
export declare function assertSafeIdentifier(name: string, what: string): string;
|
|
54
|
+
/** Test hook — reset the cached lazy `pg` import. */
|
|
55
|
+
export declare function resetPgModuleCache(): void;
|
|
56
|
+
//# sourceMappingURL=PostgresClient.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PostgresClient.d.ts","sourceRoot":"","sources":["../../../src/persistence/journals/PostgresClient.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;GAUG;AACH,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IACtD,0EAA0E;IAC1E,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;CAClC;AAED,yEAAyE;AACzE,MAAM,WAAW,YAAY;IAC3B,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,aAAa,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;IAC7E,OAAO,IAAI,IAAI,CAAC;CACjB;AAED,MAAM,WAAW,UAAU;IACzB,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,aAAa,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;IAC7E,oFAAoF;IACpF,OAAO,IAAI,OAAO,CAAC,YAAY,CAAC,CAAC;IACjC,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACtB;AAaD,8DAA8D;AAC9D,MAAM,WAAW,kBAAkB;IACjC,mEAAmE;IACnE,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC9C;;;;OAIG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,UAAU,CAAC;CAC5B;AAED,+DAA+D;AAC/D,wBAAsB,WAAW,CAAC,IAAI,EAAE,kBAAkB,GAAG,OAAO,CAAC,UAAU,CAAC,CAM/E;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAQvE;AAED,qDAAqD;AACrD,wBAAgB,kBAAkB,IAAI,IAAI,CAEzC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Lazy } from '../../util/Lazy.js';
|
|
2
|
+
import { lazyImportModule } from '../../util/LazyImport.js';
|
|
3
|
+
const pgLazy = Lazy.of(() => lazyImportModule('pg', {
|
|
4
|
+
context: 'The Postgres persistence backends require',
|
|
5
|
+
installHint: 'npm install pg',
|
|
6
|
+
}));
|
|
7
|
+
/** Build (or pass through) the connection pool for a store. */
|
|
8
|
+
export async function buildPgPool(conn) {
|
|
9
|
+
if (conn.pool)
|
|
10
|
+
return conn.pool;
|
|
11
|
+
const pg = await pgLazy.get();
|
|
12
|
+
const config = { ...conn.poolConfig };
|
|
13
|
+
if (conn.url !== undefined)
|
|
14
|
+
config.connectionString = conn.url;
|
|
15
|
+
return new pg.Pool(config);
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Guard configurable table names against SQL injection (#136). Table
|
|
19
|
+
* names come from trusted config, not user input — but a parameter bind
|
|
20
|
+
* (`$1`) cannot stand in for an *identifier*, so the name is interpolated
|
|
21
|
+
* into the DDL/DML string directly. Constrain it to a safe charset so a
|
|
22
|
+
* hostile/typo'd config can't smuggle SQL through the table name.
|
|
23
|
+
*/
|
|
24
|
+
export function assertSafeIdentifier(name, what) {
|
|
25
|
+
if (!/^[A-Za-z_][A-Za-z0-9_]*$/.test(name)) {
|
|
26
|
+
throw new Error(`Postgres: unsafe ${what} identifier ${JSON.stringify(name)} — `
|
|
27
|
+
+ 'must match /^[A-Za-z_][A-Za-z0-9_]*$/.');
|
|
28
|
+
}
|
|
29
|
+
return name;
|
|
30
|
+
}
|
|
31
|
+
/** Test hook — reset the cached lazy `pg` import. */
|
|
32
|
+
export function resetPgModuleCache() {
|
|
33
|
+
pgLazy.reset();
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=PostgresClient.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PostgresClient.js","sourceRoot":"","sources":["../../../src/persistence/journals/PostgresClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAoC5D,MAAM,MAAM,GAA4B,IAAI,CAAC,EAAE,CAC7C,GAAG,EAAE,CAAC,gBAAgB,CAAW,IAAI,EAAE;IACrC,OAAO,EAAE,2CAA2C;IACpD,WAAW,EAAE,gBAAgB;CAC9B,CAAC,CACH,CAAC;AAmBF,+DAA+D;AAC/D,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,IAAwB;IACxD,IAAI,IAAI,CAAC,IAAI;QAAE,OAAO,IAAI,CAAC,IAAI,CAAC;IAChC,MAAM,EAAE,GAAG,MAAM,MAAM,CAAC,GAAG,EAAE,CAAC;IAC9B,MAAM,MAAM,GAA4B,EAAE,GAAG,IAAI,CAAC,UAAU,EAAE,CAAC;IAC/D,IAAI,IAAI,CAAC,GAAG,KAAK,SAAS;QAAE,MAAM,CAAC,gBAAgB,GAAG,IAAI,CAAC,GAAG,CAAC;IAC/D,OAAO,IAAI,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AAC7B,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,oBAAoB,CAAC,IAAY,EAAE,IAAY;IAC7D,IAAI,CAAC,0BAA0B,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;QAC3C,MAAM,IAAI,KAAK,CACb,oBAAoB,IAAI,eAAe,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK;cAC9D,wCAAwC,CAC3C,CAAC;IACJ,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,qDAAqD;AACrD,MAAM,UAAU,kBAAkB;IAChC,MAAM,CAAC,KAAK,EAAE,CAAC;AACjB,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { Journal } from '../Journal.js';
|
|
2
|
+
import { type PersistentEvent } from '../JournalTypes.js';
|
|
3
|
+
import type { PostgresJournalOptions } from './PostgresJournalOptions.js';
|
|
4
|
+
/**
|
|
5
|
+
* Journal backed by PostgreSQL via the `pg` (node-postgres) driver.
|
|
6
|
+
*
|
|
7
|
+
* Mirrors `SqliteJournal`'s shape — an events table keyed on
|
|
8
|
+
* `(persistence_id, sequence_nr)` plus a tags join table for indexed
|
|
9
|
+
* tag queries — using Postgres types and `$1` bind parameters.
|
|
10
|
+
*
|
|
11
|
+
* Optimistic concurrency: `append` runs `SELECT MAX(sequence_nr)` and the
|
|
12
|
+
* INSERTs inside one transaction; a racing writer that slips between the
|
|
13
|
+
* read and the insert trips the primary-key unique constraint (SQLSTATE
|
|
14
|
+
* `23505`), which is translated to `JournalConcurrencyError` as a
|
|
15
|
+
* backstop. Construction is lazy — the pool opens and tables are created
|
|
16
|
+
* on the first call.
|
|
17
|
+
*
|
|
18
|
+
* No in-process event bus: Postgres is a cross-process backend (like
|
|
19
|
+
* Cassandra), so the `events` field is left undefined and the query layer
|
|
20
|
+
* falls back to polling. (A `LISTEN/NOTIFY` bus is a possible future
|
|
21
|
+
* enhancement.)
|
|
22
|
+
*/
|
|
23
|
+
export declare class PostgresJournal implements Journal {
|
|
24
|
+
private readonly settings;
|
|
25
|
+
private readonly table;
|
|
26
|
+
private readonly tagsTable;
|
|
27
|
+
private readonly autoCreate;
|
|
28
|
+
private pool;
|
|
29
|
+
private initPromise;
|
|
30
|
+
private closed;
|
|
31
|
+
constructor(options?: PostgresJournalOptions);
|
|
32
|
+
append<E>(pid: string, events: ReadonlyArray<E>, expectedSeq: number, tags?: ReadonlyArray<string>): Promise<PersistentEvent<E>[]>;
|
|
33
|
+
read<E>(pid: string, fromSeq: number, toSeq?: number): Promise<PersistentEvent<E>[]>;
|
|
34
|
+
highestSeq(pid: string): Promise<number>;
|
|
35
|
+
delete(pid: string, toSeq: number): Promise<void>;
|
|
36
|
+
persistenceIds(): Promise<string[]>;
|
|
37
|
+
close(): Promise<void>;
|
|
38
|
+
private ensureOpen;
|
|
39
|
+
private init;
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=PostgresJournal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PostgresJournal.d.ts","sourceRoot":"","sources":["../../../src/persistence/journals/PostgresJournal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAGL,KAAK,eAAe,EACrB,MAAM,oBAAoB,CAAC;AAM5B,OAAO,KAAK,EAAE,sBAAsB,EAA8B,MAAM,6BAA6B,CAAC;AAUtG;;;;;;;;;;;;;;;;;;GAkBG;AACH,qBAAa,eAAgB,YAAW,OAAO;IAC7C,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAA6B;IACtD,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAS;IAC/B,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;IACnC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAU;IAErC,OAAO,CAAC,IAAI,CAA2B;IACvC,OAAO,CAAC,WAAW,CAA8B;IACjD,OAAO,CAAC,MAAM,CAAS;gBAEX,OAAO,GAAE,sBAA2B;IAU1C,MAAM,CAAC,CAAC,EACZ,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,aAAa,CAAC,CAAC,CAAC,EACxB,WAAW,EAAE,MAAM,EACnB,IAAI,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,GAC3B,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC,EAAE,CAAC;IA4D1B,IAAI,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC,EAAE,CAAC;IAwBpF,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IASxC,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAejD,cAAc,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;IAMnC,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;YASd,UAAU;YAQV,IAAI;CA+BnB"}
|