@xyo-network/bridge-pub-sub 2.111.3 → 3.0.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/dist/neutral/index.d.ts +401 -8
- package/package.json +25 -44
- package/xy.config.ts +12 -0
- package/dist/browser/AbstractModuleHost/AbstractModuleHost.d.cts +0 -11
- package/dist/browser/AbstractModuleHost/AbstractModuleHost.d.cts.map +0 -1
- package/dist/browser/AbstractModuleHost/AbstractModuleHost.d.mts +0 -11
- package/dist/browser/AbstractModuleHost/AbstractModuleHost.d.mts.map +0 -1
- package/dist/browser/AbstractModuleHost/AbstractModuleHost.d.ts +0 -11
- package/dist/browser/AbstractModuleHost/AbstractModuleHost.d.ts.map +0 -1
- package/dist/browser/AbstractModuleHost/index.d.cts +0 -2
- package/dist/browser/AbstractModuleHost/index.d.cts.map +0 -1
- package/dist/browser/AbstractModuleHost/index.d.mts +0 -2
- package/dist/browser/AbstractModuleHost/index.d.mts.map +0 -1
- package/dist/browser/AbstractModuleHost/index.d.ts +0 -2
- package/dist/browser/AbstractModuleHost/index.d.ts.map +0 -1
- package/dist/browser/AsyncQueryBus/AsyncQueryBusBase.d.cts +0 -137
- package/dist/browser/AsyncQueryBus/AsyncQueryBusBase.d.cts.map +0 -1
- package/dist/browser/AsyncQueryBus/AsyncQueryBusBase.d.mts +0 -137
- package/dist/browser/AsyncQueryBus/AsyncQueryBusBase.d.mts.map +0 -1
- package/dist/browser/AsyncQueryBus/AsyncQueryBusBase.d.ts +0 -137
- package/dist/browser/AsyncQueryBus/AsyncQueryBusBase.d.ts.map +0 -1
- package/dist/browser/AsyncQueryBus/AsyncQueryBusClient.d.cts +0 -23
- package/dist/browser/AsyncQueryBus/AsyncQueryBusClient.d.cts.map +0 -1
- package/dist/browser/AsyncQueryBus/AsyncQueryBusClient.d.mts +0 -23
- package/dist/browser/AsyncQueryBus/AsyncQueryBusClient.d.mts.map +0 -1
- package/dist/browser/AsyncQueryBus/AsyncQueryBusClient.d.ts +0 -23
- package/dist/browser/AsyncQueryBus/AsyncQueryBusClient.d.ts.map +0 -1
- package/dist/browser/AsyncQueryBus/AsyncQueryBusHost.d.cts +0 -64
- package/dist/browser/AsyncQueryBus/AsyncQueryBusHost.d.cts.map +0 -1
- package/dist/browser/AsyncQueryBus/AsyncQueryBusHost.d.mts +0 -64
- package/dist/browser/AsyncQueryBus/AsyncQueryBusHost.d.mts.map +0 -1
- package/dist/browser/AsyncQueryBus/AsyncQueryBusHost.d.ts +0 -64
- package/dist/browser/AsyncQueryBus/AsyncQueryBusHost.d.ts.map +0 -1
- package/dist/browser/AsyncQueryBus/ModuleHost/ModuleHost.d.cts +0 -12
- package/dist/browser/AsyncQueryBus/ModuleHost/ModuleHost.d.cts.map +0 -1
- package/dist/browser/AsyncQueryBus/ModuleHost/ModuleHost.d.mts +0 -12
- package/dist/browser/AsyncQueryBus/ModuleHost/ModuleHost.d.mts.map +0 -1
- package/dist/browser/AsyncQueryBus/ModuleHost/ModuleHost.d.ts +0 -12
- package/dist/browser/AsyncQueryBus/ModuleHost/ModuleHost.d.ts.map +0 -1
- package/dist/browser/AsyncQueryBus/ModuleHost/index.d.cts +0 -2
- package/dist/browser/AsyncQueryBus/ModuleHost/index.d.cts.map +0 -1
- package/dist/browser/AsyncQueryBus/ModuleHost/index.d.mts +0 -2
- package/dist/browser/AsyncQueryBus/ModuleHost/index.d.mts.map +0 -1
- package/dist/browser/AsyncQueryBus/ModuleHost/index.d.ts +0 -2
- package/dist/browser/AsyncQueryBus/ModuleHost/index.d.ts.map +0 -1
- package/dist/browser/AsyncQueryBus/ModuleProxy/ModuleProxy.d.cts +0 -27
- package/dist/browser/AsyncQueryBus/ModuleProxy/ModuleProxy.d.cts.map +0 -1
- package/dist/browser/AsyncQueryBus/ModuleProxy/ModuleProxy.d.mts +0 -27
- package/dist/browser/AsyncQueryBus/ModuleProxy/ModuleProxy.d.mts.map +0 -1
- package/dist/browser/AsyncQueryBus/ModuleProxy/ModuleProxy.d.ts +0 -27
- package/dist/browser/AsyncQueryBus/ModuleProxy/ModuleProxy.d.ts.map +0 -1
- package/dist/browser/AsyncQueryBus/ModuleProxy/index.d.cts +0 -2
- package/dist/browser/AsyncQueryBus/ModuleProxy/index.d.cts.map +0 -1
- package/dist/browser/AsyncQueryBus/ModuleProxy/index.d.mts +0 -2
- package/dist/browser/AsyncQueryBus/ModuleProxy/index.d.mts.map +0 -1
- package/dist/browser/AsyncQueryBus/ModuleProxy/index.d.ts +0 -2
- package/dist/browser/AsyncQueryBus/ModuleProxy/index.d.ts.map +0 -1
- package/dist/browser/AsyncQueryBus/index.d.cts +0 -6
- package/dist/browser/AsyncQueryBus/index.d.cts.map +0 -1
- package/dist/browser/AsyncQueryBus/index.d.mts +0 -6
- package/dist/browser/AsyncQueryBus/index.d.mts.map +0 -1
- package/dist/browser/AsyncQueryBus/index.d.ts +0 -6
- package/dist/browser/AsyncQueryBus/index.d.ts.map +0 -1
- package/dist/browser/AsyncQueryBus/model/BaseConfig.d.cts +0 -8
- package/dist/browser/AsyncQueryBus/model/BaseConfig.d.cts.map +0 -1
- package/dist/browser/AsyncQueryBus/model/BaseConfig.d.mts +0 -8
- package/dist/browser/AsyncQueryBus/model/BaseConfig.d.mts.map +0 -1
- package/dist/browser/AsyncQueryBus/model/BaseConfig.d.ts +0 -8
- package/dist/browser/AsyncQueryBus/model/BaseConfig.d.ts.map +0 -1
- package/dist/browser/AsyncQueryBus/model/ClientConfig.d.cts +0 -7
- package/dist/browser/AsyncQueryBus/model/ClientConfig.d.cts.map +0 -1
- package/dist/browser/AsyncQueryBus/model/ClientConfig.d.mts +0 -7
- package/dist/browser/AsyncQueryBus/model/ClientConfig.d.mts.map +0 -1
- package/dist/browser/AsyncQueryBus/model/ClientConfig.d.ts +0 -7
- package/dist/browser/AsyncQueryBus/model/ClientConfig.d.ts.map +0 -1
- package/dist/browser/AsyncQueryBus/model/HostConfig.d.cts +0 -9
- package/dist/browser/AsyncQueryBus/model/HostConfig.d.cts.map +0 -1
- package/dist/browser/AsyncQueryBus/model/HostConfig.d.mts +0 -9
- package/dist/browser/AsyncQueryBus/model/HostConfig.d.mts.map +0 -1
- package/dist/browser/AsyncQueryBus/model/HostConfig.d.ts +0 -9
- package/dist/browser/AsyncQueryBus/model/HostConfig.d.ts.map +0 -1
- package/dist/browser/AsyncQueryBus/model/IntersectConfig.d.cts +0 -6
- package/dist/browser/AsyncQueryBus/model/IntersectConfig.d.cts.map +0 -1
- package/dist/browser/AsyncQueryBus/model/IntersectConfig.d.mts +0 -6
- package/dist/browser/AsyncQueryBus/model/IntersectConfig.d.mts.map +0 -1
- package/dist/browser/AsyncQueryBus/model/IntersectConfig.d.ts +0 -6
- package/dist/browser/AsyncQueryBus/model/IntersectConfig.d.ts.map +0 -1
- package/dist/browser/AsyncQueryBus/model/Params.d.cts +0 -16
- package/dist/browser/AsyncQueryBus/model/Params.d.cts.map +0 -1
- package/dist/browser/AsyncQueryBus/model/Params.d.mts +0 -16
- package/dist/browser/AsyncQueryBus/model/Params.d.mts.map +0 -1
- package/dist/browser/AsyncQueryBus/model/Params.d.ts +0 -16
- package/dist/browser/AsyncQueryBus/model/Params.d.ts.map +0 -1
- package/dist/browser/AsyncQueryBus/model/QueryStatus.d.cts +0 -3
- package/dist/browser/AsyncQueryBus/model/QueryStatus.d.cts.map +0 -1
- package/dist/browser/AsyncQueryBus/model/QueryStatus.d.mts +0 -3
- package/dist/browser/AsyncQueryBus/model/QueryStatus.d.mts.map +0 -1
- package/dist/browser/AsyncQueryBus/model/QueryStatus.d.ts +0 -3
- package/dist/browser/AsyncQueryBus/model/QueryStatus.d.ts.map +0 -1
- package/dist/browser/AsyncQueryBus/model/index.d.cts +0 -7
- package/dist/browser/AsyncQueryBus/model/index.d.cts.map +0 -1
- package/dist/browser/AsyncQueryBus/model/index.d.mts +0 -7
- package/dist/browser/AsyncQueryBus/model/index.d.mts.map +0 -1
- package/dist/browser/AsyncQueryBus/model/index.d.ts +0 -7
- package/dist/browser/AsyncQueryBus/model/index.d.ts.map +0 -1
- package/dist/browser/Config.d.cts +0 -12
- package/dist/browser/Config.d.cts.map +0 -1
- package/dist/browser/Config.d.mts +0 -12
- package/dist/browser/Config.d.mts.map +0 -1
- package/dist/browser/Config.d.ts +0 -12
- package/dist/browser/Config.d.ts.map +0 -1
- package/dist/browser/Params.d.cts +0 -5
- package/dist/browser/Params.d.cts.map +0 -1
- package/dist/browser/Params.d.mts +0 -5
- package/dist/browser/Params.d.mts.map +0 -1
- package/dist/browser/Params.d.ts +0 -5
- package/dist/browser/Params.d.ts.map +0 -1
- package/dist/browser/PubSubBridge.d.cts +0 -42
- package/dist/browser/PubSubBridge.d.cts.map +0 -1
- package/dist/browser/PubSubBridge.d.mts +0 -42
- package/dist/browser/PubSubBridge.d.mts.map +0 -1
- package/dist/browser/PubSubBridge.d.ts +0 -42
- package/dist/browser/PubSubBridge.d.ts.map +0 -1
- package/dist/browser/PubSubBridgeModuleResolver.d.cts +0 -26
- package/dist/browser/PubSubBridgeModuleResolver.d.cts.map +0 -1
- package/dist/browser/PubSubBridgeModuleResolver.d.mts +0 -26
- package/dist/browser/PubSubBridgeModuleResolver.d.mts.map +0 -1
- package/dist/browser/PubSubBridgeModuleResolver.d.ts +0 -26
- package/dist/browser/PubSubBridgeModuleResolver.d.ts.map +0 -1
- package/dist/browser/Schema.d.cts +0 -3
- package/dist/browser/Schema.d.cts.map +0 -1
- package/dist/browser/Schema.d.mts +0 -3
- package/dist/browser/Schema.d.mts.map +0 -1
- package/dist/browser/Schema.d.ts +0 -3
- package/dist/browser/Schema.d.ts.map +0 -1
- package/dist/browser/index.cjs +0 -1047
- package/dist/browser/index.cjs.map +0 -1
- package/dist/browser/index.d.cts +0 -8
- package/dist/browser/index.d.cts.map +0 -1
- package/dist/browser/index.d.mts +0 -8
- package/dist/browser/index.d.mts.map +0 -1
- package/dist/browser/index.d.ts +0 -8
- package/dist/browser/index.d.ts.map +0 -1
- package/dist/browser/index.mjs +0 -1026
- package/dist/browser/index.mjs.map +0 -1
- package/dist/neutral/AbstractModuleHost/AbstractModuleHost.d.cts +0 -11
- package/dist/neutral/AbstractModuleHost/AbstractModuleHost.d.cts.map +0 -1
- package/dist/neutral/AbstractModuleHost/AbstractModuleHost.d.mts +0 -11
- package/dist/neutral/AbstractModuleHost/AbstractModuleHost.d.mts.map +0 -1
- package/dist/neutral/AbstractModuleHost/AbstractModuleHost.d.ts +0 -11
- package/dist/neutral/AbstractModuleHost/AbstractModuleHost.d.ts.map +0 -1
- package/dist/neutral/AbstractModuleHost/index.d.cts +0 -2
- package/dist/neutral/AbstractModuleHost/index.d.cts.map +0 -1
- package/dist/neutral/AbstractModuleHost/index.d.mts +0 -2
- package/dist/neutral/AbstractModuleHost/index.d.mts.map +0 -1
- package/dist/neutral/AbstractModuleHost/index.d.ts +0 -2
- package/dist/neutral/AbstractModuleHost/index.d.ts.map +0 -1
- package/dist/neutral/AsyncQueryBus/AsyncQueryBusBase.d.cts +0 -137
- package/dist/neutral/AsyncQueryBus/AsyncQueryBusBase.d.cts.map +0 -1
- package/dist/neutral/AsyncQueryBus/AsyncQueryBusBase.d.mts +0 -137
- package/dist/neutral/AsyncQueryBus/AsyncQueryBusBase.d.mts.map +0 -1
- package/dist/neutral/AsyncQueryBus/AsyncQueryBusBase.d.ts +0 -137
- package/dist/neutral/AsyncQueryBus/AsyncQueryBusBase.d.ts.map +0 -1
- package/dist/neutral/AsyncQueryBus/AsyncQueryBusClient.d.cts +0 -23
- package/dist/neutral/AsyncQueryBus/AsyncQueryBusClient.d.cts.map +0 -1
- package/dist/neutral/AsyncQueryBus/AsyncQueryBusClient.d.mts +0 -23
- package/dist/neutral/AsyncQueryBus/AsyncQueryBusClient.d.mts.map +0 -1
- package/dist/neutral/AsyncQueryBus/AsyncQueryBusClient.d.ts +0 -23
- package/dist/neutral/AsyncQueryBus/AsyncQueryBusClient.d.ts.map +0 -1
- package/dist/neutral/AsyncQueryBus/AsyncQueryBusHost.d.cts +0 -64
- package/dist/neutral/AsyncQueryBus/AsyncQueryBusHost.d.cts.map +0 -1
- package/dist/neutral/AsyncQueryBus/AsyncQueryBusHost.d.mts +0 -64
- package/dist/neutral/AsyncQueryBus/AsyncQueryBusHost.d.mts.map +0 -1
- package/dist/neutral/AsyncQueryBus/AsyncQueryBusHost.d.ts +0 -64
- package/dist/neutral/AsyncQueryBus/AsyncQueryBusHost.d.ts.map +0 -1
- package/dist/neutral/AsyncQueryBus/ModuleHost/ModuleHost.d.cts +0 -12
- package/dist/neutral/AsyncQueryBus/ModuleHost/ModuleHost.d.cts.map +0 -1
- package/dist/neutral/AsyncQueryBus/ModuleHost/ModuleHost.d.mts +0 -12
- package/dist/neutral/AsyncQueryBus/ModuleHost/ModuleHost.d.mts.map +0 -1
- package/dist/neutral/AsyncQueryBus/ModuleHost/ModuleHost.d.ts +0 -12
- package/dist/neutral/AsyncQueryBus/ModuleHost/ModuleHost.d.ts.map +0 -1
- package/dist/neutral/AsyncQueryBus/ModuleHost/index.d.cts +0 -2
- package/dist/neutral/AsyncQueryBus/ModuleHost/index.d.cts.map +0 -1
- package/dist/neutral/AsyncQueryBus/ModuleHost/index.d.mts +0 -2
- package/dist/neutral/AsyncQueryBus/ModuleHost/index.d.mts.map +0 -1
- package/dist/neutral/AsyncQueryBus/ModuleHost/index.d.ts +0 -2
- package/dist/neutral/AsyncQueryBus/ModuleHost/index.d.ts.map +0 -1
- package/dist/neutral/AsyncQueryBus/ModuleProxy/ModuleProxy.d.cts +0 -27
- package/dist/neutral/AsyncQueryBus/ModuleProxy/ModuleProxy.d.cts.map +0 -1
- package/dist/neutral/AsyncQueryBus/ModuleProxy/ModuleProxy.d.mts +0 -27
- package/dist/neutral/AsyncQueryBus/ModuleProxy/ModuleProxy.d.mts.map +0 -1
- package/dist/neutral/AsyncQueryBus/ModuleProxy/ModuleProxy.d.ts +0 -27
- package/dist/neutral/AsyncQueryBus/ModuleProxy/ModuleProxy.d.ts.map +0 -1
- package/dist/neutral/AsyncQueryBus/ModuleProxy/index.d.cts +0 -2
- package/dist/neutral/AsyncQueryBus/ModuleProxy/index.d.cts.map +0 -1
- package/dist/neutral/AsyncQueryBus/ModuleProxy/index.d.mts +0 -2
- package/dist/neutral/AsyncQueryBus/ModuleProxy/index.d.mts.map +0 -1
- package/dist/neutral/AsyncQueryBus/ModuleProxy/index.d.ts +0 -2
- package/dist/neutral/AsyncQueryBus/ModuleProxy/index.d.ts.map +0 -1
- package/dist/neutral/AsyncQueryBus/index.d.cts +0 -6
- package/dist/neutral/AsyncQueryBus/index.d.cts.map +0 -1
- package/dist/neutral/AsyncQueryBus/index.d.mts +0 -6
- package/dist/neutral/AsyncQueryBus/index.d.mts.map +0 -1
- package/dist/neutral/AsyncQueryBus/index.d.ts +0 -6
- package/dist/neutral/AsyncQueryBus/index.d.ts.map +0 -1
- package/dist/neutral/AsyncQueryBus/model/BaseConfig.d.cts +0 -8
- package/dist/neutral/AsyncQueryBus/model/BaseConfig.d.cts.map +0 -1
- package/dist/neutral/AsyncQueryBus/model/BaseConfig.d.mts +0 -8
- package/dist/neutral/AsyncQueryBus/model/BaseConfig.d.mts.map +0 -1
- package/dist/neutral/AsyncQueryBus/model/BaseConfig.d.ts +0 -8
- package/dist/neutral/AsyncQueryBus/model/BaseConfig.d.ts.map +0 -1
- package/dist/neutral/AsyncQueryBus/model/ClientConfig.d.cts +0 -7
- package/dist/neutral/AsyncQueryBus/model/ClientConfig.d.cts.map +0 -1
- package/dist/neutral/AsyncQueryBus/model/ClientConfig.d.mts +0 -7
- package/dist/neutral/AsyncQueryBus/model/ClientConfig.d.mts.map +0 -1
- package/dist/neutral/AsyncQueryBus/model/ClientConfig.d.ts +0 -7
- package/dist/neutral/AsyncQueryBus/model/ClientConfig.d.ts.map +0 -1
- package/dist/neutral/AsyncQueryBus/model/HostConfig.d.cts +0 -9
- package/dist/neutral/AsyncQueryBus/model/HostConfig.d.cts.map +0 -1
- package/dist/neutral/AsyncQueryBus/model/HostConfig.d.mts +0 -9
- package/dist/neutral/AsyncQueryBus/model/HostConfig.d.mts.map +0 -1
- package/dist/neutral/AsyncQueryBus/model/HostConfig.d.ts +0 -9
- package/dist/neutral/AsyncQueryBus/model/HostConfig.d.ts.map +0 -1
- package/dist/neutral/AsyncQueryBus/model/IntersectConfig.d.cts +0 -6
- package/dist/neutral/AsyncQueryBus/model/IntersectConfig.d.cts.map +0 -1
- package/dist/neutral/AsyncQueryBus/model/IntersectConfig.d.mts +0 -6
- package/dist/neutral/AsyncQueryBus/model/IntersectConfig.d.mts.map +0 -1
- package/dist/neutral/AsyncQueryBus/model/IntersectConfig.d.ts +0 -6
- package/dist/neutral/AsyncQueryBus/model/IntersectConfig.d.ts.map +0 -1
- package/dist/neutral/AsyncQueryBus/model/Params.d.cts +0 -16
- package/dist/neutral/AsyncQueryBus/model/Params.d.cts.map +0 -1
- package/dist/neutral/AsyncQueryBus/model/Params.d.mts +0 -16
- package/dist/neutral/AsyncQueryBus/model/Params.d.mts.map +0 -1
- package/dist/neutral/AsyncQueryBus/model/Params.d.ts +0 -16
- package/dist/neutral/AsyncQueryBus/model/Params.d.ts.map +0 -1
- package/dist/neutral/AsyncQueryBus/model/QueryStatus.d.cts +0 -3
- package/dist/neutral/AsyncQueryBus/model/QueryStatus.d.cts.map +0 -1
- package/dist/neutral/AsyncQueryBus/model/QueryStatus.d.mts +0 -3
- package/dist/neutral/AsyncQueryBus/model/QueryStatus.d.mts.map +0 -1
- package/dist/neutral/AsyncQueryBus/model/QueryStatus.d.ts +0 -3
- package/dist/neutral/AsyncQueryBus/model/QueryStatus.d.ts.map +0 -1
- package/dist/neutral/AsyncQueryBus/model/index.d.cts +0 -7
- package/dist/neutral/AsyncQueryBus/model/index.d.cts.map +0 -1
- package/dist/neutral/AsyncQueryBus/model/index.d.mts +0 -7
- package/dist/neutral/AsyncQueryBus/model/index.d.mts.map +0 -1
- package/dist/neutral/AsyncQueryBus/model/index.d.ts +0 -7
- package/dist/neutral/AsyncQueryBus/model/index.d.ts.map +0 -1
- package/dist/neutral/Config.d.cts +0 -12
- package/dist/neutral/Config.d.cts.map +0 -1
- package/dist/neutral/Config.d.mts +0 -12
- package/dist/neutral/Config.d.mts.map +0 -1
- package/dist/neutral/Config.d.ts +0 -12
- package/dist/neutral/Config.d.ts.map +0 -1
- package/dist/neutral/Params.d.cts +0 -5
- package/dist/neutral/Params.d.cts.map +0 -1
- package/dist/neutral/Params.d.mts +0 -5
- package/dist/neutral/Params.d.mts.map +0 -1
- package/dist/neutral/Params.d.ts +0 -5
- package/dist/neutral/Params.d.ts.map +0 -1
- package/dist/neutral/PubSubBridge.d.cts +0 -42
- package/dist/neutral/PubSubBridge.d.cts.map +0 -1
- package/dist/neutral/PubSubBridge.d.mts +0 -42
- package/dist/neutral/PubSubBridge.d.mts.map +0 -1
- package/dist/neutral/PubSubBridge.d.ts +0 -42
- package/dist/neutral/PubSubBridge.d.ts.map +0 -1
- package/dist/neutral/PubSubBridgeModuleResolver.d.cts +0 -26
- package/dist/neutral/PubSubBridgeModuleResolver.d.cts.map +0 -1
- package/dist/neutral/PubSubBridgeModuleResolver.d.mts +0 -26
- package/dist/neutral/PubSubBridgeModuleResolver.d.mts.map +0 -1
- package/dist/neutral/PubSubBridgeModuleResolver.d.ts +0 -26
- package/dist/neutral/PubSubBridgeModuleResolver.d.ts.map +0 -1
- package/dist/neutral/Schema.d.cts +0 -3
- package/dist/neutral/Schema.d.cts.map +0 -1
- package/dist/neutral/Schema.d.mts +0 -3
- package/dist/neutral/Schema.d.mts.map +0 -1
- package/dist/neutral/Schema.d.ts +0 -3
- package/dist/neutral/Schema.d.ts.map +0 -1
- package/dist/neutral/index.cjs +0 -1047
- package/dist/neutral/index.cjs.map +0 -1
- package/dist/neutral/index.d.cts +0 -8
- package/dist/neutral/index.d.cts.map +0 -1
- package/dist/neutral/index.d.mts +0 -8
- package/dist/neutral/index.d.mts.map +0 -1
- package/dist/neutral/index.d.ts.map +0 -1
- package/dist/node/AbstractModuleHost/AbstractModuleHost.d.cts +0 -11
- package/dist/node/AbstractModuleHost/AbstractModuleHost.d.cts.map +0 -1
- package/dist/node/AbstractModuleHost/AbstractModuleHost.d.mts +0 -11
- package/dist/node/AbstractModuleHost/AbstractModuleHost.d.mts.map +0 -1
- package/dist/node/AbstractModuleHost/AbstractModuleHost.d.ts +0 -11
- package/dist/node/AbstractModuleHost/AbstractModuleHost.d.ts.map +0 -1
- package/dist/node/AbstractModuleHost/index.d.cts +0 -2
- package/dist/node/AbstractModuleHost/index.d.cts.map +0 -1
- package/dist/node/AbstractModuleHost/index.d.mts +0 -2
- package/dist/node/AbstractModuleHost/index.d.mts.map +0 -1
- package/dist/node/AbstractModuleHost/index.d.ts +0 -2
- package/dist/node/AbstractModuleHost/index.d.ts.map +0 -1
- package/dist/node/AsyncQueryBus/AsyncQueryBusBase.d.cts +0 -137
- package/dist/node/AsyncQueryBus/AsyncQueryBusBase.d.cts.map +0 -1
- package/dist/node/AsyncQueryBus/AsyncQueryBusBase.d.mts +0 -137
- package/dist/node/AsyncQueryBus/AsyncQueryBusBase.d.mts.map +0 -1
- package/dist/node/AsyncQueryBus/AsyncQueryBusBase.d.ts +0 -137
- package/dist/node/AsyncQueryBus/AsyncQueryBusBase.d.ts.map +0 -1
- package/dist/node/AsyncQueryBus/AsyncQueryBusClient.d.cts +0 -23
- package/dist/node/AsyncQueryBus/AsyncQueryBusClient.d.cts.map +0 -1
- package/dist/node/AsyncQueryBus/AsyncQueryBusClient.d.mts +0 -23
- package/dist/node/AsyncQueryBus/AsyncQueryBusClient.d.mts.map +0 -1
- package/dist/node/AsyncQueryBus/AsyncQueryBusClient.d.ts +0 -23
- package/dist/node/AsyncQueryBus/AsyncQueryBusClient.d.ts.map +0 -1
- package/dist/node/AsyncQueryBus/AsyncQueryBusHost.d.cts +0 -64
- package/dist/node/AsyncQueryBus/AsyncQueryBusHost.d.cts.map +0 -1
- package/dist/node/AsyncQueryBus/AsyncQueryBusHost.d.mts +0 -64
- package/dist/node/AsyncQueryBus/AsyncQueryBusHost.d.mts.map +0 -1
- package/dist/node/AsyncQueryBus/AsyncQueryBusHost.d.ts +0 -64
- package/dist/node/AsyncQueryBus/AsyncQueryBusHost.d.ts.map +0 -1
- package/dist/node/AsyncQueryBus/ModuleHost/ModuleHost.d.cts +0 -12
- package/dist/node/AsyncQueryBus/ModuleHost/ModuleHost.d.cts.map +0 -1
- package/dist/node/AsyncQueryBus/ModuleHost/ModuleHost.d.mts +0 -12
- package/dist/node/AsyncQueryBus/ModuleHost/ModuleHost.d.mts.map +0 -1
- package/dist/node/AsyncQueryBus/ModuleHost/ModuleHost.d.ts +0 -12
- package/dist/node/AsyncQueryBus/ModuleHost/ModuleHost.d.ts.map +0 -1
- package/dist/node/AsyncQueryBus/ModuleHost/index.d.cts +0 -2
- package/dist/node/AsyncQueryBus/ModuleHost/index.d.cts.map +0 -1
- package/dist/node/AsyncQueryBus/ModuleHost/index.d.mts +0 -2
- package/dist/node/AsyncQueryBus/ModuleHost/index.d.mts.map +0 -1
- package/dist/node/AsyncQueryBus/ModuleHost/index.d.ts +0 -2
- package/dist/node/AsyncQueryBus/ModuleHost/index.d.ts.map +0 -1
- package/dist/node/AsyncQueryBus/ModuleProxy/ModuleProxy.d.cts +0 -27
- package/dist/node/AsyncQueryBus/ModuleProxy/ModuleProxy.d.cts.map +0 -1
- package/dist/node/AsyncQueryBus/ModuleProxy/ModuleProxy.d.mts +0 -27
- package/dist/node/AsyncQueryBus/ModuleProxy/ModuleProxy.d.mts.map +0 -1
- package/dist/node/AsyncQueryBus/ModuleProxy/ModuleProxy.d.ts +0 -27
- package/dist/node/AsyncQueryBus/ModuleProxy/ModuleProxy.d.ts.map +0 -1
- package/dist/node/AsyncQueryBus/ModuleProxy/index.d.cts +0 -2
- package/dist/node/AsyncQueryBus/ModuleProxy/index.d.cts.map +0 -1
- package/dist/node/AsyncQueryBus/ModuleProxy/index.d.mts +0 -2
- package/dist/node/AsyncQueryBus/ModuleProxy/index.d.mts.map +0 -1
- package/dist/node/AsyncQueryBus/ModuleProxy/index.d.ts +0 -2
- package/dist/node/AsyncQueryBus/ModuleProxy/index.d.ts.map +0 -1
- package/dist/node/AsyncQueryBus/index.d.cts +0 -6
- package/dist/node/AsyncQueryBus/index.d.cts.map +0 -1
- package/dist/node/AsyncQueryBus/index.d.mts +0 -6
- package/dist/node/AsyncQueryBus/index.d.mts.map +0 -1
- package/dist/node/AsyncQueryBus/index.d.ts +0 -6
- package/dist/node/AsyncQueryBus/index.d.ts.map +0 -1
- package/dist/node/AsyncQueryBus/model/BaseConfig.d.cts +0 -8
- package/dist/node/AsyncQueryBus/model/BaseConfig.d.cts.map +0 -1
- package/dist/node/AsyncQueryBus/model/BaseConfig.d.mts +0 -8
- package/dist/node/AsyncQueryBus/model/BaseConfig.d.mts.map +0 -1
- package/dist/node/AsyncQueryBus/model/BaseConfig.d.ts +0 -8
- package/dist/node/AsyncQueryBus/model/BaseConfig.d.ts.map +0 -1
- package/dist/node/AsyncQueryBus/model/ClientConfig.d.cts +0 -7
- package/dist/node/AsyncQueryBus/model/ClientConfig.d.cts.map +0 -1
- package/dist/node/AsyncQueryBus/model/ClientConfig.d.mts +0 -7
- package/dist/node/AsyncQueryBus/model/ClientConfig.d.mts.map +0 -1
- package/dist/node/AsyncQueryBus/model/ClientConfig.d.ts +0 -7
- package/dist/node/AsyncQueryBus/model/ClientConfig.d.ts.map +0 -1
- package/dist/node/AsyncQueryBus/model/HostConfig.d.cts +0 -9
- package/dist/node/AsyncQueryBus/model/HostConfig.d.cts.map +0 -1
- package/dist/node/AsyncQueryBus/model/HostConfig.d.mts +0 -9
- package/dist/node/AsyncQueryBus/model/HostConfig.d.mts.map +0 -1
- package/dist/node/AsyncQueryBus/model/HostConfig.d.ts +0 -9
- package/dist/node/AsyncQueryBus/model/HostConfig.d.ts.map +0 -1
- package/dist/node/AsyncQueryBus/model/IntersectConfig.d.cts +0 -6
- package/dist/node/AsyncQueryBus/model/IntersectConfig.d.cts.map +0 -1
- package/dist/node/AsyncQueryBus/model/IntersectConfig.d.mts +0 -6
- package/dist/node/AsyncQueryBus/model/IntersectConfig.d.mts.map +0 -1
- package/dist/node/AsyncQueryBus/model/IntersectConfig.d.ts +0 -6
- package/dist/node/AsyncQueryBus/model/IntersectConfig.d.ts.map +0 -1
- package/dist/node/AsyncQueryBus/model/Params.d.cts +0 -16
- package/dist/node/AsyncQueryBus/model/Params.d.cts.map +0 -1
- package/dist/node/AsyncQueryBus/model/Params.d.mts +0 -16
- package/dist/node/AsyncQueryBus/model/Params.d.mts.map +0 -1
- package/dist/node/AsyncQueryBus/model/Params.d.ts +0 -16
- package/dist/node/AsyncQueryBus/model/Params.d.ts.map +0 -1
- package/dist/node/AsyncQueryBus/model/QueryStatus.d.cts +0 -3
- package/dist/node/AsyncQueryBus/model/QueryStatus.d.cts.map +0 -1
- package/dist/node/AsyncQueryBus/model/QueryStatus.d.mts +0 -3
- package/dist/node/AsyncQueryBus/model/QueryStatus.d.mts.map +0 -1
- package/dist/node/AsyncQueryBus/model/QueryStatus.d.ts +0 -3
- package/dist/node/AsyncQueryBus/model/QueryStatus.d.ts.map +0 -1
- package/dist/node/AsyncQueryBus/model/index.d.cts +0 -7
- package/dist/node/AsyncQueryBus/model/index.d.cts.map +0 -1
- package/dist/node/AsyncQueryBus/model/index.d.mts +0 -7
- package/dist/node/AsyncQueryBus/model/index.d.mts.map +0 -1
- package/dist/node/AsyncQueryBus/model/index.d.ts +0 -7
- package/dist/node/AsyncQueryBus/model/index.d.ts.map +0 -1
- package/dist/node/Config.d.cts +0 -12
- package/dist/node/Config.d.cts.map +0 -1
- package/dist/node/Config.d.mts +0 -12
- package/dist/node/Config.d.mts.map +0 -1
- package/dist/node/Config.d.ts +0 -12
- package/dist/node/Config.d.ts.map +0 -1
- package/dist/node/Params.d.cts +0 -5
- package/dist/node/Params.d.cts.map +0 -1
- package/dist/node/Params.d.mts +0 -5
- package/dist/node/Params.d.mts.map +0 -1
- package/dist/node/Params.d.ts +0 -5
- package/dist/node/Params.d.ts.map +0 -1
- package/dist/node/PubSubBridge.d.cts +0 -42
- package/dist/node/PubSubBridge.d.cts.map +0 -1
- package/dist/node/PubSubBridge.d.mts +0 -42
- package/dist/node/PubSubBridge.d.mts.map +0 -1
- package/dist/node/PubSubBridge.d.ts +0 -42
- package/dist/node/PubSubBridge.d.ts.map +0 -1
- package/dist/node/PubSubBridgeModuleResolver.d.cts +0 -26
- package/dist/node/PubSubBridgeModuleResolver.d.cts.map +0 -1
- package/dist/node/PubSubBridgeModuleResolver.d.mts +0 -26
- package/dist/node/PubSubBridgeModuleResolver.d.mts.map +0 -1
- package/dist/node/PubSubBridgeModuleResolver.d.ts +0 -26
- package/dist/node/PubSubBridgeModuleResolver.d.ts.map +0 -1
- package/dist/node/Schema.d.cts +0 -3
- package/dist/node/Schema.d.cts.map +0 -1
- package/dist/node/Schema.d.mts +0 -3
- package/dist/node/Schema.d.mts.map +0 -1
- package/dist/node/Schema.d.ts +0 -3
- package/dist/node/Schema.d.ts.map +0 -1
- package/dist/node/index.cjs +0 -1103
- package/dist/node/index.cjs.map +0 -1
- package/dist/node/index.d.cts +0 -8
- package/dist/node/index.d.cts.map +0 -1
- package/dist/node/index.d.mts +0 -8
- package/dist/node/index.d.mts.map +0 -1
- package/dist/node/index.d.ts +0 -8
- package/dist/node/index.d.ts.map +0 -1
- package/dist/node/index.mjs +0 -1069
- package/dist/node/index.mjs.map +0 -1
package/dist/neutral/index.cjs
DELETED
|
@@ -1,1047 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
7
|
-
var __export = (target, all) => {
|
|
8
|
-
for (var name in all)
|
|
9
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
-
};
|
|
11
|
-
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
-
for (let key of __getOwnPropNames(from))
|
|
14
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
-
}
|
|
17
|
-
return to;
|
|
18
|
-
};
|
|
19
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
-
|
|
21
|
-
// src/index.ts
|
|
22
|
-
var src_exports = {};
|
|
23
|
-
__export(src_exports, {
|
|
24
|
-
AbstractModuleHost: () => AbstractModuleHost,
|
|
25
|
-
AsyncQueryBusClient: () => AsyncQueryBusClient,
|
|
26
|
-
AsyncQueryBusHost: () => AsyncQueryBusHost,
|
|
27
|
-
AsyncQueryBusModuleHost: () => AsyncQueryBusModuleHost,
|
|
28
|
-
AsyncQueryBusModuleProxy: () => AsyncQueryBusModuleProxy,
|
|
29
|
-
Pending: () => Pending,
|
|
30
|
-
PubSubBridge: () => PubSubBridge,
|
|
31
|
-
PubSubBridgeConfigSchema: () => PubSubBridgeConfigSchema,
|
|
32
|
-
PubSubBridgeModuleResolver: () => PubSubBridgeModuleResolver,
|
|
33
|
-
PubSubBridgeSchema: () => PubSubBridgeSchema
|
|
34
|
-
});
|
|
35
|
-
module.exports = __toCommonJS(src_exports);
|
|
36
|
-
|
|
37
|
-
// src/AbstractModuleHost/AbstractModuleHost.ts
|
|
38
|
-
var import_object = require("@xylabs/object");
|
|
39
|
-
var AbstractModuleHost = class extends import_object.Base {
|
|
40
|
-
static {
|
|
41
|
-
__name(this, "AbstractModuleHost");
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
// src/AsyncQueryBus/AsyncQueryBusClient.ts
|
|
46
|
-
var import_assert2 = require("@xylabs/assert");
|
|
47
|
-
var import_delay = require("@xylabs/delay");
|
|
48
|
-
var import_forget = require("@xylabs/forget");
|
|
49
|
-
var import_timer = require("@xylabs/timer");
|
|
50
|
-
var import_boundwitness_model = require("@xyo-network/boundwitness-model");
|
|
51
|
-
var import_diviner_boundwitness_model = require("@xyo-network/diviner-boundwitness-model");
|
|
52
|
-
var import_payload_builder = require("@xyo-network/payload-builder");
|
|
53
|
-
var import_lru_cache2 = require("lru-cache");
|
|
54
|
-
|
|
55
|
-
// src/AsyncQueryBus/AsyncQueryBusBase.ts
|
|
56
|
-
var import_assert = require("@xylabs/assert");
|
|
57
|
-
var import_object2 = require("@xylabs/object");
|
|
58
|
-
var import_archivist_model = require("@xyo-network/archivist-model");
|
|
59
|
-
var import_diviner_model = require("@xyo-network/diviner-model");
|
|
60
|
-
var import_module_model = require("@xyo-network/module-model");
|
|
61
|
-
var import_async_mutex = require("async-mutex");
|
|
62
|
-
var import_lru_cache = require("lru-cache");
|
|
63
|
-
var POLLING_FREQUENCY_MIN = 100;
|
|
64
|
-
var POLLING_FREQUENCY_MAX = 6e4;
|
|
65
|
-
var POLLING_FREQUENCY_DEFAULT = 1e3;
|
|
66
|
-
var AsyncQueryBusBase = class extends import_object2.Base {
|
|
67
|
-
static {
|
|
68
|
-
__name(this, "AsyncQueryBusBase");
|
|
69
|
-
}
|
|
70
|
-
_lastState;
|
|
71
|
-
_targetConfigs = {};
|
|
72
|
-
_targetQueries = {};
|
|
73
|
-
_lastResolveFailure = {};
|
|
74
|
-
_queriesArchivist;
|
|
75
|
-
_queriesDiviner;
|
|
76
|
-
_reResolveDelay = 1e3 * 5;
|
|
77
|
-
_resolveMutex = new import_async_mutex.Mutex();
|
|
78
|
-
_responsesArchivist;
|
|
79
|
-
_responsesDiviner;
|
|
80
|
-
constructor(params) {
|
|
81
|
-
super(params);
|
|
82
|
-
}
|
|
83
|
-
get config() {
|
|
84
|
-
return this.params.config;
|
|
85
|
-
}
|
|
86
|
-
get pollFrequency() {
|
|
87
|
-
const frequency = this.config?.pollFrequency ?? POLLING_FREQUENCY_DEFAULT;
|
|
88
|
-
if (frequency < POLLING_FREQUENCY_MIN || frequency > POLLING_FREQUENCY_MAX) {
|
|
89
|
-
return POLLING_FREQUENCY_DEFAULT;
|
|
90
|
-
}
|
|
91
|
-
return frequency;
|
|
92
|
-
}
|
|
93
|
-
get rootModule() {
|
|
94
|
-
return this.params.rootModule;
|
|
95
|
-
}
|
|
96
|
-
/**
|
|
97
|
-
* A cache of the last offset of the Diviner process per address
|
|
98
|
-
*/
|
|
99
|
-
get lastState() {
|
|
100
|
-
const requiredConfig = {
|
|
101
|
-
max: 1e3,
|
|
102
|
-
ttl: 0
|
|
103
|
-
};
|
|
104
|
-
this._lastState = this._lastState ?? new import_lru_cache.LRUCache(requiredConfig);
|
|
105
|
-
return this._lastState;
|
|
106
|
-
}
|
|
107
|
-
async queriesArchivist() {
|
|
108
|
-
return await this._resolveMutex.runExclusive(async () => {
|
|
109
|
-
this._queriesArchivist = this._queriesArchivist ?? await this.resolve((0, import_assert.assertEx)(this.config?.intersect?.queries?.archivist, () => "No queries Archivist defined"), import_archivist_model.isArchivistInstance);
|
|
110
|
-
return this._queriesArchivist;
|
|
111
|
-
});
|
|
112
|
-
}
|
|
113
|
-
async queriesDiviner() {
|
|
114
|
-
return await this._resolveMutex.runExclusive(async () => {
|
|
115
|
-
this._queriesDiviner = this._queriesDiviner ?? await this.resolve((0, import_assert.assertEx)(this.config?.intersect?.queries?.boundWitnessDiviner, () => "No queries Diviner defined"), import_diviner_model.isDivinerInstance);
|
|
116
|
-
return this._queriesDiviner;
|
|
117
|
-
});
|
|
118
|
-
}
|
|
119
|
-
async responsesArchivist() {
|
|
120
|
-
return await this._resolveMutex.runExclusive(async () => {
|
|
121
|
-
this._responsesArchivist = this._responsesArchivist ?? await this.resolve((0, import_assert.assertEx)(this.config?.intersect?.responses?.archivist, () => "No responses Archivist defined"), import_archivist_model.isArchivistInstance);
|
|
122
|
-
return this._responsesArchivist;
|
|
123
|
-
});
|
|
124
|
-
}
|
|
125
|
-
async responsesDiviner() {
|
|
126
|
-
return await this._resolveMutex.runExclusive(async () => {
|
|
127
|
-
this._responsesDiviner = this._responsesDiviner ?? await this.resolve((0, import_assert.assertEx)(this.config?.intersect?.responses?.boundWitnessDiviner, () => "No responses Diviner defined"), import_diviner_model.isDivinerInstance);
|
|
128
|
-
return this._responsesDiviner;
|
|
129
|
-
});
|
|
130
|
-
}
|
|
131
|
-
/**
|
|
132
|
-
* Commit the internal state of the process. This is similar
|
|
133
|
-
* to a transaction completion in a database and should only be called
|
|
134
|
-
* when results have been successfully persisted to the appropriate
|
|
135
|
-
* external stores.
|
|
136
|
-
* @param address The module address to commit the state for
|
|
137
|
-
* @param nextState The state to commit
|
|
138
|
-
*/
|
|
139
|
-
async commitState(address, nextState) {
|
|
140
|
-
await Promise.resolve();
|
|
141
|
-
const lastState = this.lastState.get(address);
|
|
142
|
-
if (lastState && lastState >= nextState) return;
|
|
143
|
-
this.lastState.set(address, nextState);
|
|
144
|
-
}
|
|
145
|
-
/**
|
|
146
|
-
* Retrieves the last state of the process. Used to recover state after
|
|
147
|
-
* preemptions, reboots, etc.
|
|
148
|
-
*/
|
|
149
|
-
async retrieveState(address) {
|
|
150
|
-
await Promise.resolve();
|
|
151
|
-
const state = this.lastState.get(address);
|
|
152
|
-
if (state === void 0) {
|
|
153
|
-
const newState = Date.now() - 1e3;
|
|
154
|
-
this.lastState.set(address, newState);
|
|
155
|
-
return newState;
|
|
156
|
-
} else {
|
|
157
|
-
return state;
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
async resolve(id, typeCheck) {
|
|
161
|
-
if (Date.now() - (this._lastResolveFailure[id] ?? 0) < this._reResolveDelay) {
|
|
162
|
-
return;
|
|
163
|
-
}
|
|
164
|
-
this._lastResolveFailure[id] = Date.now();
|
|
165
|
-
const resolved = await import_module_model.ResolveHelper.resolveModuleIdentifier(this.rootModule, id);
|
|
166
|
-
if (resolved) {
|
|
167
|
-
if (typeCheck(resolved)) {
|
|
168
|
-
delete this._lastResolveFailure[id];
|
|
169
|
-
return resolved;
|
|
170
|
-
} else {
|
|
171
|
-
this.logger?.warn(`Unable to resolve responsesDiviner as correct type [${id}][${resolved?.constructor?.name}]: ${resolved.id}`);
|
|
172
|
-
}
|
|
173
|
-
} else {
|
|
174
|
-
this.logger?.debug(`Unable to resolve queriesArchivist [${id}] [${await import_module_model.ResolveHelper.traceModuleIdentifier(this.rootModule, id)}]`);
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
};
|
|
178
|
-
|
|
179
|
-
// src/AsyncQueryBus/model/QueryStatus.ts
|
|
180
|
-
var Pending = "pending";
|
|
181
|
-
|
|
182
|
-
// src/AsyncQueryBus/AsyncQueryBusClient.ts
|
|
183
|
-
var AsyncQueryBusClient = class extends AsyncQueryBusBase {
|
|
184
|
-
static {
|
|
185
|
-
__name(this, "AsyncQueryBusClient");
|
|
186
|
-
}
|
|
187
|
-
_queryCache;
|
|
188
|
-
_pollCount = 0;
|
|
189
|
-
_pollId;
|
|
190
|
-
constructor(params) {
|
|
191
|
-
super(params);
|
|
192
|
-
}
|
|
193
|
-
get queryCacheConfig() {
|
|
194
|
-
const queryCacheConfig = this.config?.queryCache === true ? {} : this.config?.queryCache;
|
|
195
|
-
return {
|
|
196
|
-
max: 100,
|
|
197
|
-
ttl: 1e3 * 60,
|
|
198
|
-
...queryCacheConfig
|
|
199
|
-
};
|
|
200
|
-
}
|
|
201
|
-
get started() {
|
|
202
|
-
return !!this._pollId;
|
|
203
|
-
}
|
|
204
|
-
/**
|
|
205
|
-
* A cache of queries that have been issued
|
|
206
|
-
*/
|
|
207
|
-
get queryCache() {
|
|
208
|
-
const config = this.queryCacheConfig;
|
|
209
|
-
const requiredConfig = {
|
|
210
|
-
noUpdateTTL: false,
|
|
211
|
-
ttlAutopurge: true
|
|
212
|
-
};
|
|
213
|
-
this._queryCache = this._queryCache ?? new import_lru_cache2.LRUCache({
|
|
214
|
-
...config,
|
|
215
|
-
...requiredConfig
|
|
216
|
-
});
|
|
217
|
-
return this._queryCache;
|
|
218
|
-
}
|
|
219
|
-
listeningAddresses() {
|
|
220
|
-
return this._queryCache?.keys();
|
|
221
|
-
}
|
|
222
|
-
async send(address, query, payloads) {
|
|
223
|
-
this.logger?.debug(`Begin issuing query to: ${address}`);
|
|
224
|
-
const $meta = {
|
|
225
|
-
...query?.$meta,
|
|
226
|
-
destination: [
|
|
227
|
-
address
|
|
228
|
-
]
|
|
229
|
-
};
|
|
230
|
-
const routedQuery = await import_payload_builder.PayloadBuilder.build({
|
|
231
|
-
...query,
|
|
232
|
-
$meta
|
|
233
|
-
});
|
|
234
|
-
const queryArchivist = (0, import_assert2.assertEx)(await this.queriesArchivist(), () => `Unable to contact queriesArchivist [${this.config?.intersect?.queries?.archivist}]`);
|
|
235
|
-
const routedQueryHash = routedQuery?.$hash ?? Object.keys(await import_payload_builder.PayloadBuilder.dataHash(routedQuery));
|
|
236
|
-
this.logger?.debug(`Issuing query: ${routedQueryHash} to: ${address}`);
|
|
237
|
-
const data = payloads ? [
|
|
238
|
-
routedQuery,
|
|
239
|
-
...payloads
|
|
240
|
-
] : [
|
|
241
|
-
routedQuery
|
|
242
|
-
];
|
|
243
|
-
const insertResult = await queryArchivist.insert?.(data);
|
|
244
|
-
this.logger?.debug(`Issued query: ${routedQueryHash} to: ${address}`);
|
|
245
|
-
this.queryCache.set(routedQueryHash, Pending);
|
|
246
|
-
if (!insertResult) throw new Error("Unable to issue query to queryArchivist");
|
|
247
|
-
return new Promise((resolve, reject) => {
|
|
248
|
-
this.logger?.debug(`Polling for response to query: ${routedQueryHash}`);
|
|
249
|
-
let nextDelay = 100;
|
|
250
|
-
const pollForResponse = /* @__PURE__ */ __name(async () => {
|
|
251
|
-
try {
|
|
252
|
-
this.start();
|
|
253
|
-
let response = this.queryCache.get(routedQueryHash);
|
|
254
|
-
while (response !== void 0) {
|
|
255
|
-
await (0, import_delay.delay)(nextDelay);
|
|
256
|
-
response = this.queryCache.get(routedQueryHash);
|
|
257
|
-
if (response && response !== Pending) {
|
|
258
|
-
this.logger?.log(`Returning response to query: ${routedQueryHash}`);
|
|
259
|
-
resolve(response);
|
|
260
|
-
return;
|
|
261
|
-
}
|
|
262
|
-
nextDelay = Math.floor(nextDelay * 1.2);
|
|
263
|
-
if (nextDelay > 1e3) nextDelay = 1e3;
|
|
264
|
-
}
|
|
265
|
-
this.logger?.error("Timeout waiting for query response");
|
|
266
|
-
const error = {
|
|
267
|
-
message: "Timeout waiting for query response",
|
|
268
|
-
query: "network.xyo.boundwitness",
|
|
269
|
-
schema: "network.xyo.error.module",
|
|
270
|
-
sources: [
|
|
271
|
-
routedQueryHash
|
|
272
|
-
]
|
|
273
|
-
};
|
|
274
|
-
reject(error);
|
|
275
|
-
return;
|
|
276
|
-
} finally {
|
|
277
|
-
this.stop();
|
|
278
|
-
}
|
|
279
|
-
}, "pollForResponse");
|
|
280
|
-
(0, import_forget.forget)(pollForResponse());
|
|
281
|
-
});
|
|
282
|
-
}
|
|
283
|
-
/**
|
|
284
|
-
* Runs the background divine process on a loop with a delay
|
|
285
|
-
* specified by the `config.pollFrequency`
|
|
286
|
-
*/
|
|
287
|
-
poll() {
|
|
288
|
-
this._pollId = (0, import_timer.setTimeoutEx)(async () => {
|
|
289
|
-
try {
|
|
290
|
-
await this.processIncomingResponses();
|
|
291
|
-
} catch (e) {
|
|
292
|
-
this.logger?.error?.(`Error in main loop: ${e}`);
|
|
293
|
-
} finally {
|
|
294
|
-
if (this._pollId) (0, import_timer.clearTimeoutEx)(this._pollId);
|
|
295
|
-
this._pollId = void 0;
|
|
296
|
-
this.poll();
|
|
297
|
-
}
|
|
298
|
-
}, this.pollFrequency);
|
|
299
|
-
}
|
|
300
|
-
/**
|
|
301
|
-
* Background process for processing incoming responses to previously issued queries
|
|
302
|
-
*/
|
|
303
|
-
processIncomingResponses = /* @__PURE__ */ __name(async () => {
|
|
304
|
-
const responseArchivist = await this.responsesArchivist();
|
|
305
|
-
if (responseArchivist) {
|
|
306
|
-
const responseBoundWitnessDiviner = await this.responsesDiviner();
|
|
307
|
-
if (responseBoundWitnessDiviner) {
|
|
308
|
-
const pendingCommands = [
|
|
309
|
-
...this.queryCache.entries()
|
|
310
|
-
].filter(([_, status]) => status === Pending);
|
|
311
|
-
await Promise.allSettled(pendingCommands.map(async ([sourceQuery, status]) => {
|
|
312
|
-
if (status === Pending) {
|
|
313
|
-
const divinerQuery = {
|
|
314
|
-
limit: 1,
|
|
315
|
-
order: "desc",
|
|
316
|
-
schema: import_diviner_boundwitness_model.BoundWitnessDivinerQuerySchema,
|
|
317
|
-
sourceQuery
|
|
318
|
-
};
|
|
319
|
-
const result = await responseBoundWitnessDiviner.divine([
|
|
320
|
-
divinerQuery
|
|
321
|
-
]);
|
|
322
|
-
if (result && result.length > 0) {
|
|
323
|
-
const response = result.find(import_boundwitness_model.isBoundWitnessWithMeta);
|
|
324
|
-
if (response && response?.$meta?.sourceQuery === sourceQuery) {
|
|
325
|
-
this.logger?.debug(`Found response to query: ${sourceQuery}`);
|
|
326
|
-
const payloads = response.payload_hashes?.length > 0 ? await responseArchivist.get(response.payload_hashes) : [];
|
|
327
|
-
this.queryCache.set(sourceQuery, [
|
|
328
|
-
response,
|
|
329
|
-
payloads,
|
|
330
|
-
[]
|
|
331
|
-
]);
|
|
332
|
-
}
|
|
333
|
-
}
|
|
334
|
-
}
|
|
335
|
-
}));
|
|
336
|
-
}
|
|
337
|
-
}
|
|
338
|
-
}, "processIncomingResponses");
|
|
339
|
-
start() {
|
|
340
|
-
if (this._pollCount === 0) {
|
|
341
|
-
this.poll();
|
|
342
|
-
}
|
|
343
|
-
this._pollCount++;
|
|
344
|
-
}
|
|
345
|
-
stop() {
|
|
346
|
-
this._pollCount--;
|
|
347
|
-
if (this._pollCount <= 0) {
|
|
348
|
-
if (this._pollId) (0, import_timer.clearTimeoutEx)(this._pollId);
|
|
349
|
-
this._pollId = void 0;
|
|
350
|
-
this._pollCount = 0;
|
|
351
|
-
}
|
|
352
|
-
}
|
|
353
|
-
};
|
|
354
|
-
|
|
355
|
-
// src/AsyncQueryBus/AsyncQueryBusHost.ts
|
|
356
|
-
var import_array = require("@xylabs/array");
|
|
357
|
-
var import_assert3 = require("@xylabs/assert");
|
|
358
|
-
var import_timer2 = require("@xylabs/timer");
|
|
359
|
-
var import_boundwitness_model2 = require("@xyo-network/boundwitness-model");
|
|
360
|
-
var import_bridge_model = require("@xyo-network/bridge-model");
|
|
361
|
-
var import_diviner_boundwitness_model2 = require("@xyo-network/diviner-boundwitness-model");
|
|
362
|
-
var import_module_model2 = require("@xyo-network/module-model");
|
|
363
|
-
var import_payload_builder2 = require("@xyo-network/payload-builder");
|
|
364
|
-
var IDLE_POLLING_FREQUENCY_RATIO_MIN = 4;
|
|
365
|
-
var IDLE_POLLING_FREQUENCY_RATIO_MAX = 64;
|
|
366
|
-
var IDLE_POLLING_FREQUENCY_RATIO_DEFAULT = 16;
|
|
367
|
-
var IDLE_THRESHOLD_RATIO_MIN = 4;
|
|
368
|
-
var IDLE_THRESHOLD_RATIO_MAX = 64;
|
|
369
|
-
var IDLE_THRESHOLD_RATIO_DEFAULT = 16;
|
|
370
|
-
var AsyncQueryBusHost = class extends AsyncQueryBusBase {
|
|
371
|
-
static {
|
|
372
|
-
__name(this, "AsyncQueryBusHost");
|
|
373
|
-
}
|
|
374
|
-
_exposedAddresses = /* @__PURE__ */ new Set();
|
|
375
|
-
_exposeOptions = {};
|
|
376
|
-
_idle = false;
|
|
377
|
-
_lastQueryTime;
|
|
378
|
-
_pollId;
|
|
379
|
-
constructor(params) {
|
|
380
|
-
super(params);
|
|
381
|
-
}
|
|
382
|
-
get exposedAddresses() {
|
|
383
|
-
return this._exposedAddresses;
|
|
384
|
-
}
|
|
385
|
-
get idlePollFrequency() {
|
|
386
|
-
const frequency = this.config?.idlePollFrequency ?? IDLE_POLLING_FREQUENCY_RATIO_DEFAULT * this.pollFrequency;
|
|
387
|
-
if (frequency < this.pollFrequency * IDLE_POLLING_FREQUENCY_RATIO_MIN) {
|
|
388
|
-
return IDLE_POLLING_FREQUENCY_RATIO_MIN * this.pollFrequency;
|
|
389
|
-
}
|
|
390
|
-
if (frequency > this.pollFrequency * IDLE_POLLING_FREQUENCY_RATIO_MAX) {
|
|
391
|
-
return IDLE_POLLING_FREQUENCY_RATIO_MAX * this.pollFrequency;
|
|
392
|
-
}
|
|
393
|
-
return frequency;
|
|
394
|
-
}
|
|
395
|
-
get idleThreshold() {
|
|
396
|
-
const threshold = this.config?.idleThreshold ?? IDLE_THRESHOLD_RATIO_DEFAULT * this.idlePollFrequency;
|
|
397
|
-
if (threshold < this.idlePollFrequency * IDLE_THRESHOLD_RATIO_MIN) {
|
|
398
|
-
return IDLE_POLLING_FREQUENCY_RATIO_MIN * this.pollFrequency;
|
|
399
|
-
}
|
|
400
|
-
if (threshold > this.idlePollFrequency * IDLE_THRESHOLD_RATIO_MAX) {
|
|
401
|
-
return IDLE_POLLING_FREQUENCY_RATIO_MAX * this.pollFrequency;
|
|
402
|
-
}
|
|
403
|
-
return threshold;
|
|
404
|
-
}
|
|
405
|
-
get perAddressBatchQueryLimit() {
|
|
406
|
-
return this.config?.perAddressBatchQueryLimit ?? 10;
|
|
407
|
-
}
|
|
408
|
-
get started() {
|
|
409
|
-
return !!this._pollId;
|
|
410
|
-
}
|
|
411
|
-
expose(mod, options) {
|
|
412
|
-
const { failOnAlreadyExposed } = options ?? {};
|
|
413
|
-
if ((0, import_bridge_model.isBridgeInstance)(mod)) {
|
|
414
|
-
this.logger?.warn(`Attempted to expose a BridgeModule [${mod.id}] - Not exposing`);
|
|
415
|
-
} else {
|
|
416
|
-
(0, import_assert3.assertEx)(!failOnAlreadyExposed || !this._exposedAddresses.has(mod.address), () => `Address already exposed: ${mod.id} [${mod.address}]`);
|
|
417
|
-
this._exposedAddresses.add(mod.address);
|
|
418
|
-
this._exposeOptions[mod.address] = {
|
|
419
|
-
...options
|
|
420
|
-
};
|
|
421
|
-
this.logger?.debug(`${mod.id} exposed [${mod.address}]`);
|
|
422
|
-
return mod;
|
|
423
|
-
}
|
|
424
|
-
}
|
|
425
|
-
async listeningModules() {
|
|
426
|
-
const exposedModules = [
|
|
427
|
-
...this.config?.listeningModules ?? [],
|
|
428
|
-
...this.exposedAddresses.values()
|
|
429
|
-
];
|
|
430
|
-
return await Promise.all(exposedModules.map(async (exposedModule) => (0, import_assert3.assertEx)((0, import_module_model2.asModuleInstance)(await (0, import_module_model2.resolveAddressToInstance)(this.rootModule, exposedModule)), () => `Unable to resolve listeningModule [${exposedModule}]`)));
|
|
431
|
-
}
|
|
432
|
-
start() {
|
|
433
|
-
if (this.started) {
|
|
434
|
-
console.warn("AsyncQueryBus starting when already started");
|
|
435
|
-
}
|
|
436
|
-
this.poll();
|
|
437
|
-
}
|
|
438
|
-
stop() {
|
|
439
|
-
if (!this.started) {
|
|
440
|
-
console.warn("AsyncQueryBus stopping when already stopped");
|
|
441
|
-
}
|
|
442
|
-
if (this._pollId) (0, import_timer2.clearTimeoutEx)(this._pollId);
|
|
443
|
-
this._pollId = void 0;
|
|
444
|
-
}
|
|
445
|
-
async unexpose(id, validate = true) {
|
|
446
|
-
const mod = (0, import_module_model2.asModuleInstance)(await this.rootModule.resolve(id, {
|
|
447
|
-
maxDepth: 10
|
|
448
|
-
}));
|
|
449
|
-
if (mod) {
|
|
450
|
-
(0, import_assert3.assertEx)(!validate || this._exposedAddresses.has(mod.address), () => `Address not exposed [${mod.address}][${mod.id}]`);
|
|
451
|
-
this._exposedAddresses.delete(mod.address);
|
|
452
|
-
delete this._exposeOptions[mod.address];
|
|
453
|
-
this.logger?.debug(`${mod.address} [${mod.id}] unexposed`);
|
|
454
|
-
}
|
|
455
|
-
return mod;
|
|
456
|
-
}
|
|
457
|
-
// eslint-disable-next-line complexity
|
|
458
|
-
callLocalModule = /* @__PURE__ */ __name(async (localModule, query) => {
|
|
459
|
-
this._idle = false;
|
|
460
|
-
this._lastQueryTime = Date.now();
|
|
461
|
-
const localModuleName = localModule.id;
|
|
462
|
-
const queryArchivist = (0, import_assert3.assertEx)(await this.queriesArchivist(), () => `Unable to contact queriesArchivist [${this.config?.intersect?.queries?.archivist}]`);
|
|
463
|
-
const responsesArchivist = (0, import_assert3.assertEx)(await this.responsesArchivist(), () => `Unable to contact responsesArchivist [${this.config?.intersect?.queries?.archivist}]`);
|
|
464
|
-
const queryDestination = query.$meta?.destination;
|
|
465
|
-
if (queryDestination && queryDestination?.includes(localModule.address)) {
|
|
466
|
-
const queryIndex = query.payload_hashes.indexOf(query.query);
|
|
467
|
-
if (queryIndex !== -1) {
|
|
468
|
-
const querySchema = query.payload_schemas[queryIndex];
|
|
469
|
-
if (localModule.queries.includes(querySchema)) {
|
|
470
|
-
const queryPayloads = await queryArchivist.get(query.payload_hashes);
|
|
471
|
-
this.params.onQueryFulfillStarted?.({
|
|
472
|
-
payloads: queryPayloads,
|
|
473
|
-
query
|
|
474
|
-
});
|
|
475
|
-
const queryPayloadsDict = await import_payload_builder2.PayloadBuilder.toAllHashMap(queryPayloads);
|
|
476
|
-
const queryHash = (await import_payload_builder2.PayloadBuilder.build(query)).$hash;
|
|
477
|
-
if (!(0, import_array.containsAll)(Object.keys(queryPayloadsDict), query.payload_hashes)) {
|
|
478
|
-
this.logger?.error(`Error processing command ${queryHash} for module ${localModuleName}, missing payloads`);
|
|
479
|
-
return;
|
|
480
|
-
}
|
|
481
|
-
try {
|
|
482
|
-
const querySchema2 = queryPayloadsDict[query.query].schema;
|
|
483
|
-
this.logger?.debug(`Issuing query ${querySchema2} (${queryHash}) addressed to module: ${localModuleName}`);
|
|
484
|
-
const result = await localModule.query(query, queryPayloads, {
|
|
485
|
-
allowedQueries: this._exposeOptions[localModule.address]?.allowedQueries,
|
|
486
|
-
schema: import_module_model2.ModuleConfigSchema
|
|
487
|
-
});
|
|
488
|
-
const [bw, payloads, errors] = result;
|
|
489
|
-
this.logger?.debug(`Replying to query ${queryHash} addressed to module: ${localModuleName}`);
|
|
490
|
-
const insertResult = await responsesArchivist.insert([
|
|
491
|
-
bw,
|
|
492
|
-
...payloads,
|
|
493
|
-
...errors
|
|
494
|
-
]);
|
|
495
|
-
if (insertResult.length === 0) {
|
|
496
|
-
this.logger?.error(`Error replying to query ${queryHash} addressed to module: ${localModuleName}`);
|
|
497
|
-
}
|
|
498
|
-
if (query?.timestamp) {
|
|
499
|
-
await this.commitState(localModule.address, query.timestamp);
|
|
500
|
-
}
|
|
501
|
-
this.params.onQueryFulfillFinished?.({
|
|
502
|
-
payloads: queryPayloads,
|
|
503
|
-
query,
|
|
504
|
-
result,
|
|
505
|
-
status: "success"
|
|
506
|
-
});
|
|
507
|
-
} catch (error) {
|
|
508
|
-
this.params.onQueryFulfillFinished?.({
|
|
509
|
-
payloads: queryPayloads,
|
|
510
|
-
query,
|
|
511
|
-
status: "failure"
|
|
512
|
-
});
|
|
513
|
-
this.logger?.error(`Error processing query ${queryHash} for module ${localModuleName}: ${error}`);
|
|
514
|
-
}
|
|
515
|
-
}
|
|
516
|
-
}
|
|
517
|
-
}
|
|
518
|
-
}, "callLocalModule");
|
|
519
|
-
/**
|
|
520
|
-
* Finds unprocessed commands addressed to the supplied address
|
|
521
|
-
* @param address The address to find commands for
|
|
522
|
-
*/
|
|
523
|
-
findQueriesToAddress = /* @__PURE__ */ __name(async (address) => {
|
|
524
|
-
const queriesDivinerId = (0, import_assert3.assertEx)(this.config?.intersect?.queries?.boundWitnessDiviner, () => "No queries Diviner defined");
|
|
525
|
-
const queriesBoundWitnessDiviner = await this.queriesDiviner();
|
|
526
|
-
if (queriesBoundWitnessDiviner) {
|
|
527
|
-
const prevState = await this.retrieveState(address);
|
|
528
|
-
const destination = [
|
|
529
|
-
address
|
|
530
|
-
];
|
|
531
|
-
const limit = this.perAddressBatchQueryLimit;
|
|
532
|
-
const divinerQuery = {
|
|
533
|
-
destination,
|
|
534
|
-
limit,
|
|
535
|
-
order: "asc",
|
|
536
|
-
schema: import_diviner_boundwitness_model2.BoundWitnessDivinerQuerySchema,
|
|
537
|
-
timestamp: prevState + 1
|
|
538
|
-
};
|
|
539
|
-
const result = await queriesBoundWitnessDiviner.divine([
|
|
540
|
-
divinerQuery
|
|
541
|
-
]);
|
|
542
|
-
const queries = result.filter(import_boundwitness_model2.isQueryBoundWitnessWithMeta);
|
|
543
|
-
const nextState = queries.length > 0 ? Math.max(...queries.map((c) => c.timestamp ?? prevState)) + 1 : Date.now();
|
|
544
|
-
await this.commitState(address, nextState);
|
|
545
|
-
this.logger?.debug("findQueriesToAddress", address, prevState, nextState);
|
|
546
|
-
return queries;
|
|
547
|
-
} else {
|
|
548
|
-
this.logger?.warn(`Unable to resolve queriesBoundWitnessDiviner [${queriesDivinerId}] [${await import_module_model2.ResolveHelper.traceModuleIdentifier(this.rootModule, queriesDivinerId)}]`);
|
|
549
|
-
}
|
|
550
|
-
}, "findQueriesToAddress");
|
|
551
|
-
/**
|
|
552
|
-
* Runs the background divine process on a loop with a delay
|
|
553
|
-
* specified by the `config.pollFrequency`
|
|
554
|
-
*/
|
|
555
|
-
poll() {
|
|
556
|
-
this._pollId = (0, import_timer2.setTimeoutEx)(async () => {
|
|
557
|
-
try {
|
|
558
|
-
await this.processIncomingQueries();
|
|
559
|
-
} catch (e) {
|
|
560
|
-
this.logger?.error?.(`Error in main loop: ${e}`);
|
|
561
|
-
} finally {
|
|
562
|
-
if (this._pollId) (0, import_timer2.clearTimeoutEx)(this._pollId);
|
|
563
|
-
this._pollId = void 0;
|
|
564
|
-
this.poll();
|
|
565
|
-
}
|
|
566
|
-
const now = Date.now();
|
|
567
|
-
if (this.idleThreshold < now - (this._lastQueryTime ?? now)) {
|
|
568
|
-
this._idle = true;
|
|
569
|
-
}
|
|
570
|
-
}, this._idle ? this.idlePollFrequency : this.pollFrequency);
|
|
571
|
-
}
|
|
572
|
-
/**
|
|
573
|
-
* Background process for checking for inbound queries
|
|
574
|
-
*/
|
|
575
|
-
processIncomingQueries = /* @__PURE__ */ __name(async () => {
|
|
576
|
-
this.logger?.debug("Checking for inbound queries");
|
|
577
|
-
const localModules = await this.listeningModules();
|
|
578
|
-
await Promise.allSettled(localModules.map(async (localModule) => {
|
|
579
|
-
try {
|
|
580
|
-
const localModuleName = localModule.id;
|
|
581
|
-
this.logger?.debug(`Checking for inbound queries to ${localModuleName} [${localModule.address}]`);
|
|
582
|
-
const queries = await this.findQueriesToAddress(localModule.address) ?? [];
|
|
583
|
-
if (queries.length === 0) return;
|
|
584
|
-
this.logger?.debug(`Found queries addressed to local module: ${localModuleName}`);
|
|
585
|
-
for (const query of queries) {
|
|
586
|
-
await this.callLocalModule(localModule, query);
|
|
587
|
-
}
|
|
588
|
-
} catch (error) {
|
|
589
|
-
this.logger?.error(`Error processing queries for address ${localModule.address}: ${error}`);
|
|
590
|
-
}
|
|
591
|
-
}));
|
|
592
|
-
}, "processIncomingQueries");
|
|
593
|
-
};
|
|
594
|
-
|
|
595
|
-
// src/AsyncQueryBus/ModuleHost/ModuleHost.ts
|
|
596
|
-
var AsyncQueryBusModuleHost = class extends AbstractModuleHost {
|
|
597
|
-
static {
|
|
598
|
-
__name(this, "AsyncQueryBusModuleHost");
|
|
599
|
-
}
|
|
600
|
-
_busHost;
|
|
601
|
-
constructor(params) {
|
|
602
|
-
super(params);
|
|
603
|
-
}
|
|
604
|
-
async start() {
|
|
605
|
-
const listeningModules = this.params.config.listeningModules ?? (await this.params.mod.resolve("*", {
|
|
606
|
-
direction: "down"
|
|
607
|
-
})).map((m) => m.address);
|
|
608
|
-
this._busHost = new AsyncQueryBusHost({
|
|
609
|
-
config: {
|
|
610
|
-
...this.params.config,
|
|
611
|
-
listeningModules
|
|
612
|
-
},
|
|
613
|
-
logger: this.params.logger,
|
|
614
|
-
rootModule: this.params.mod
|
|
615
|
-
});
|
|
616
|
-
this._busHost?.start();
|
|
617
|
-
}
|
|
618
|
-
stop() {
|
|
619
|
-
this._busHost?.stop();
|
|
620
|
-
}
|
|
621
|
-
};
|
|
622
|
-
|
|
623
|
-
// src/AsyncQueryBus/ModuleProxy/ModuleProxy.ts
|
|
624
|
-
var import_assert4 = require("@xylabs/assert");
|
|
625
|
-
var import_exists = require("@xylabs/exists");
|
|
626
|
-
var import_forget2 = require("@xylabs/forget");
|
|
627
|
-
var import_hex = require("@xylabs/hex");
|
|
628
|
-
var import_bridge_abstract = require("@xyo-network/bridge-abstract");
|
|
629
|
-
var import_module_model3 = require("@xyo-network/module-model");
|
|
630
|
-
var AsyncQueryBusModuleProxy = class _AsyncQueryBusModuleProxy extends import_bridge_abstract.AbstractModuleProxy {
|
|
631
|
-
static {
|
|
632
|
-
__name(this, "AsyncQueryBusModuleProxy");
|
|
633
|
-
}
|
|
634
|
-
static createCount = 0;
|
|
635
|
-
constructor(params) {
|
|
636
|
-
_AsyncQueryBusModuleProxy.createCount = _AsyncQueryBusModuleProxy.createCount + 1;
|
|
637
|
-
if (Math.floor(_AsyncQueryBusModuleProxy.createCount / 10) === _AsyncQueryBusModuleProxy.createCount / 10) {
|
|
638
|
-
console.log(`AsyncQueryBusModuleProxy.createCount: ${_AsyncQueryBusModuleProxy.createCount}`);
|
|
639
|
-
}
|
|
640
|
-
super(params);
|
|
641
|
-
}
|
|
642
|
-
get id() {
|
|
643
|
-
return this.address;
|
|
644
|
-
}
|
|
645
|
-
get modName() {
|
|
646
|
-
return void 0;
|
|
647
|
-
}
|
|
648
|
-
async proxyQueryHandler(query, payloads) {
|
|
649
|
-
if (this.archiving && this.isAllowedArchivingQuery(query.schema)) {
|
|
650
|
-
(0, import_forget2.forget)(this.storeToArchivists([
|
|
651
|
-
query,
|
|
652
|
-
...payloads ?? []
|
|
653
|
-
]));
|
|
654
|
-
}
|
|
655
|
-
const result = await this.params.busClient.send(this.address, query, payloads);
|
|
656
|
-
if (this.archiving && this.isAllowedArchivingQuery(query.schema)) {
|
|
657
|
-
(0, import_forget2.forget)(this.storeToArchivists(result.flat()));
|
|
658
|
-
}
|
|
659
|
-
return result;
|
|
660
|
-
}
|
|
661
|
-
async publicChildren() {
|
|
662
|
-
return (await Promise.all(Object.keys(await this.childAddressMap()).filter(import_exists.exists).map((address) => this.resolve(address)))).filter(import_exists.exists);
|
|
663
|
-
}
|
|
664
|
-
async resolve(idOrFilter = "*", options = {}) {
|
|
665
|
-
const config = {
|
|
666
|
-
address: this.address,
|
|
667
|
-
dead: this.dead,
|
|
668
|
-
downResolver: this.downResolver,
|
|
669
|
-
logger: this.logger,
|
|
670
|
-
mod: this,
|
|
671
|
-
transformers: this.moduleIdentifierTransformers,
|
|
672
|
-
upResolver: this.upResolver
|
|
673
|
-
};
|
|
674
|
-
if (idOrFilter === "*") {
|
|
675
|
-
return await this.publicChildren();
|
|
676
|
-
}
|
|
677
|
-
switch (typeof idOrFilter) {
|
|
678
|
-
case "string": {
|
|
679
|
-
const parts = idOrFilter.split(":");
|
|
680
|
-
const first = (0, import_assert4.assertEx)(parts.shift(), () => "Missing first");
|
|
681
|
-
const remainingPath = parts.join(":");
|
|
682
|
-
const address = (0, import_hex.isAddress)(first) ? first : this.childAddressByName(first);
|
|
683
|
-
if (!address) return void 0;
|
|
684
|
-
const firstInstance = await this.params.host.resolve(address);
|
|
685
|
-
return remainingPath ? await firstInstance?.resolve(remainingPath) : firstInstance;
|
|
686
|
-
}
|
|
687
|
-
case "object": {
|
|
688
|
-
return (await import_module_model3.ResolveHelper.resolve(config, idOrFilter, options)).filter((mod) => mod.address !== this.address);
|
|
689
|
-
}
|
|
690
|
-
default: {
|
|
691
|
-
return (await import_module_model3.ResolveHelper.resolve(config, idOrFilter, options)).filter((mod) => mod.address !== this.address);
|
|
692
|
-
}
|
|
693
|
-
}
|
|
694
|
-
}
|
|
695
|
-
async startHandler() {
|
|
696
|
-
return await super.startHandler();
|
|
697
|
-
}
|
|
698
|
-
};
|
|
699
|
-
|
|
700
|
-
// src/Schema.ts
|
|
701
|
-
var PubSubBridgeSchema = "network.xyo.bridge.pubsub";
|
|
702
|
-
|
|
703
|
-
// src/Config.ts
|
|
704
|
-
var PubSubBridgeConfigSchema = `${PubSubBridgeSchema}.config`;
|
|
705
|
-
|
|
706
|
-
// src/PubSubBridge.ts
|
|
707
|
-
var import_assert6 = require("@xylabs/assert");
|
|
708
|
-
var import_exists2 = require("@xylabs/exists");
|
|
709
|
-
var import_forget3 = require("@xylabs/forget");
|
|
710
|
-
var import_hex3 = require("@xylabs/hex");
|
|
711
|
-
var import_object3 = require("@xylabs/object");
|
|
712
|
-
var import_bridge_abstract3 = require("@xyo-network/bridge-abstract");
|
|
713
|
-
var import_module_model5 = require("@xyo-network/module-model");
|
|
714
|
-
var import_node_model = require("@xyo-network/node-model");
|
|
715
|
-
var import_payload_model = require("@xyo-network/payload-model");
|
|
716
|
-
var import_async_mutex3 = require("async-mutex");
|
|
717
|
-
|
|
718
|
-
// src/PubSubBridgeModuleResolver.ts
|
|
719
|
-
var import_assert5 = require("@xylabs/assert");
|
|
720
|
-
var import_hex2 = require("@xylabs/hex");
|
|
721
|
-
var import_account = require("@xyo-network/account");
|
|
722
|
-
var import_bridge_abstract2 = require("@xyo-network/bridge-abstract");
|
|
723
|
-
var import_config_payload_plugin = require("@xyo-network/config-payload-plugin");
|
|
724
|
-
var import_module_model4 = require("@xyo-network/module-model");
|
|
725
|
-
var import_async_mutex2 = require("async-mutex");
|
|
726
|
-
var import_lru_cache3 = require("lru-cache");
|
|
727
|
-
var PubSubBridgeModuleResolver = class extends import_bridge_abstract2.AbstractBridgeModuleResolver {
|
|
728
|
-
static {
|
|
729
|
-
__name(this, "PubSubBridgeModuleResolver");
|
|
730
|
-
}
|
|
731
|
-
_resolvedCache = new import_lru_cache3.LRUCache({
|
|
732
|
-
max: 1e3
|
|
733
|
-
});
|
|
734
|
-
_resolvedCacheMutex = new import_async_mutex2.Mutex();
|
|
735
|
-
async resolveHandler(id, options) {
|
|
736
|
-
const parentResult = await super.resolveHandler(id, options);
|
|
737
|
-
if (parentResult.length > 0) {
|
|
738
|
-
return parentResult;
|
|
739
|
-
}
|
|
740
|
-
const idParts = id.split(":");
|
|
741
|
-
const untransformedFirstPart = (0, import_assert5.assertEx)(idParts.shift(), () => "Missing module identifier");
|
|
742
|
-
const firstPart = await import_module_model4.ResolveHelper.transformModuleIdentifier(untransformedFirstPart);
|
|
743
|
-
(0, import_assert5.assertEx)((0, import_hex2.isAddress)(firstPart), () => `Invalid module address: ${firstPart}`);
|
|
744
|
-
const remainderParts = idParts.join(":");
|
|
745
|
-
const instance = await this._resolvedCacheMutex.runExclusive(async () => {
|
|
746
|
-
const cachedMod = this._resolvedCache.get(firstPart);
|
|
747
|
-
if (cachedMod) {
|
|
748
|
-
const result2 = idParts.length <= 0 ? cachedMod : cachedMod.resolve(remainderParts, {
|
|
749
|
-
...options,
|
|
750
|
-
maxDepth: (options?.maxDepth ?? 5) - 1
|
|
751
|
-
});
|
|
752
|
-
return result2;
|
|
753
|
-
}
|
|
754
|
-
const account = await import_account.Account.random();
|
|
755
|
-
const finalParams = {
|
|
756
|
-
account,
|
|
757
|
-
archiving: this.params.archiving,
|
|
758
|
-
busClient: this.params.busClient,
|
|
759
|
-
config: {
|
|
760
|
-
schema: import_module_model4.ModuleConfigSchema
|
|
761
|
-
},
|
|
762
|
-
host: this,
|
|
763
|
-
moduleAddress: firstPart,
|
|
764
|
-
onQuerySendFinished: this.params.onQuerySendFinished,
|
|
765
|
-
onQuerySendStarted: this.params.onQuerySendStarted
|
|
766
|
-
};
|
|
767
|
-
const proxy = new AsyncQueryBusModuleProxy(finalParams);
|
|
768
|
-
const state = await proxy.state();
|
|
769
|
-
if (state) {
|
|
770
|
-
const configSchema = state.find((payload) => payload.schema === import_config_payload_plugin.ConfigSchema)?.config;
|
|
771
|
-
const config = (0, import_assert5.assertEx)(state.find((payload) => payload.schema === configSchema), () => "Unable to locate config");
|
|
772
|
-
proxy.setConfig(config);
|
|
773
|
-
}
|
|
774
|
-
await proxy.start?.();
|
|
775
|
-
const wrapped = (0, import_bridge_abstract2.wrapModuleWithType)(proxy, account);
|
|
776
|
-
(0, import_assert5.assertEx)((0, import_module_model4.asModuleInstance)(wrapped, {}), () => `Failed to asModuleInstance [${id}]`);
|
|
777
|
-
this._resolvedCache.set(wrapped.address, wrapped);
|
|
778
|
-
return wrapped;
|
|
779
|
-
});
|
|
780
|
-
const result = remainderParts.length > 0 ? await instance.resolve(remainderParts, options) : instance;
|
|
781
|
-
return result ? [
|
|
782
|
-
result
|
|
783
|
-
] : [];
|
|
784
|
-
}
|
|
785
|
-
};
|
|
786
|
-
|
|
787
|
-
// src/PubSubBridge.ts
|
|
788
|
-
function _ts_decorate(decorators, target, key, desc) {
|
|
789
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
790
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
791
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
792
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
793
|
-
}
|
|
794
|
-
__name(_ts_decorate, "_ts_decorate");
|
|
795
|
-
var moduleName = "PubSubBridge";
|
|
796
|
-
var PubSubBridge = class extends import_bridge_abstract3.AbstractBridge {
|
|
797
|
-
static {
|
|
798
|
-
__name(this, "PubSubBridge");
|
|
799
|
-
}
|
|
800
|
-
static configSchemas = [
|
|
801
|
-
...super.configSchemas,
|
|
802
|
-
PubSubBridgeConfigSchema
|
|
803
|
-
];
|
|
804
|
-
static defaultConfigSchema = PubSubBridgeConfigSchema;
|
|
805
|
-
_configRootAddress = "";
|
|
806
|
-
_configStateStoreArchivist = "";
|
|
807
|
-
_configStateStoreBoundWitnessDiviner = "";
|
|
808
|
-
_exposedAddresses = [];
|
|
809
|
-
_lastState;
|
|
810
|
-
_busClient;
|
|
811
|
-
_busHost;
|
|
812
|
-
_discoverRootsMutex = new import_async_mutex3.Mutex();
|
|
813
|
-
_resolver;
|
|
814
|
-
get resolver() {
|
|
815
|
-
this._resolver = this._resolver ?? new PubSubBridgeModuleResolver({
|
|
816
|
-
additionalSigners: this.additionalSigners,
|
|
817
|
-
archiving: {
|
|
818
|
-
...this.archiving,
|
|
819
|
-
resolveArchivists: this.resolveArchivingArchivists.bind(this)
|
|
820
|
-
},
|
|
821
|
-
bridge: this,
|
|
822
|
-
busClient: (0, import_assert6.assertEx)(this.busClient(), () => "busClient not configured"),
|
|
823
|
-
onQuerySendFinished: /* @__PURE__ */ __name((args) => {
|
|
824
|
-
(0, import_forget3.forget)(this.emit("querySendFinished", {
|
|
825
|
-
mod: this,
|
|
826
|
-
...args
|
|
827
|
-
}));
|
|
828
|
-
}, "onQuerySendFinished"),
|
|
829
|
-
onQuerySendStarted: /* @__PURE__ */ __name((args) => {
|
|
830
|
-
(0, import_forget3.forget)(this.emit("querySendStarted", {
|
|
831
|
-
mod: this,
|
|
832
|
-
...args
|
|
833
|
-
}));
|
|
834
|
-
}, "onQuerySendStarted"),
|
|
835
|
-
root: this,
|
|
836
|
-
wrapperAccount: this.account
|
|
837
|
-
});
|
|
838
|
-
return this._resolver;
|
|
839
|
-
}
|
|
840
|
-
get moduleName() {
|
|
841
|
-
return this.modName ?? moduleName;
|
|
842
|
-
}
|
|
843
|
-
async connect(id, maxDepth = 5) {
|
|
844
|
-
const transformedId = (0, import_assert6.assertEx)(await import_module_model5.ResolveHelper.transformModuleIdentifier(id), () => `Unable to transform module identifier: ${id}`);
|
|
845
|
-
const existingInstance = await this.resolve(transformedId);
|
|
846
|
-
if (existingInstance) {
|
|
847
|
-
return existingInstance.address;
|
|
848
|
-
}
|
|
849
|
-
const [instance] = await this.resolver.resolveHandler(id);
|
|
850
|
-
return await this.connectInstance(instance, maxDepth);
|
|
851
|
-
}
|
|
852
|
-
async disconnect(id) {
|
|
853
|
-
const transformedId = (0, import_assert6.assertEx)(await import_module_model5.ResolveHelper.transformModuleIdentifier(id), () => `Unable to transform module identifier: ${id}`);
|
|
854
|
-
const instance = await this.resolve(transformedId);
|
|
855
|
-
if (instance) {
|
|
856
|
-
this.downResolver.remove(instance.address);
|
|
857
|
-
return instance.address;
|
|
858
|
-
}
|
|
859
|
-
}
|
|
860
|
-
async exposeChild(mod, options) {
|
|
861
|
-
const { maxDepth = 5 } = options ?? {};
|
|
862
|
-
console.log(`exposeChild: ${mod.address} ${mod?.id} ${maxDepth}`);
|
|
863
|
-
const host = (0, import_assert6.assertEx)(this.busHost(), () => "Not configured as a host");
|
|
864
|
-
host.expose(mod);
|
|
865
|
-
const children = maxDepth > 0 ? await mod.publicChildren?.() ?? [] : [];
|
|
866
|
-
this.logger.log(`childrenToExpose [${mod.id}][${mod.address}]: ${(0, import_object3.toJsonString)(children.map((child) => child.id))}`);
|
|
867
|
-
const exposedChildren = (await Promise.all(children.map((child) => this.exposeChild(child, {
|
|
868
|
-
maxDepth: maxDepth - 1,
|
|
869
|
-
required: false
|
|
870
|
-
})))).flat().filter(import_exists2.exists);
|
|
871
|
-
const allExposed = [
|
|
872
|
-
mod,
|
|
873
|
-
...exposedChildren
|
|
874
|
-
];
|
|
875
|
-
for (const exposedMod of allExposed) this.logger?.log(`exposed: ${exposedMod.address} [${mod.id}]`);
|
|
876
|
-
return allExposed;
|
|
877
|
-
}
|
|
878
|
-
async exposeHandler(address, options) {
|
|
879
|
-
const { required = true } = options ?? {};
|
|
880
|
-
const mod = await (0, import_module_model5.resolveAddressToInstanceUp)(this, address);
|
|
881
|
-
console.log(`exposeHandler: ${address} ${mod?.id}`);
|
|
882
|
-
if (required && !mod) {
|
|
883
|
-
throw new Error(`Unable to find required module: ${address}`);
|
|
884
|
-
}
|
|
885
|
-
if (mod) {
|
|
886
|
-
return this.exposeChild(mod, options);
|
|
887
|
-
}
|
|
888
|
-
return [];
|
|
889
|
-
}
|
|
890
|
-
exposedHandler() {
|
|
891
|
-
const exposedSet = this.busHost()?.exposedAddresses;
|
|
892
|
-
return exposedSet ? [
|
|
893
|
-
...exposedSet
|
|
894
|
-
] : [];
|
|
895
|
-
}
|
|
896
|
-
async getRoots(force) {
|
|
897
|
-
return await this._discoverRootsMutex.runExclusive(async () => {
|
|
898
|
-
if (this._roots === void 0 || force) {
|
|
899
|
-
const rootAddresses = (await Promise.all((this.config.roots ?? []).map((id) => {
|
|
900
|
-
try {
|
|
901
|
-
return import_module_model5.ResolveHelper.transformModuleIdentifier(id);
|
|
902
|
-
} catch (ex) {
|
|
903
|
-
this.logger?.warn("Unable to transform module identifier:", id, ex);
|
|
904
|
-
return;
|
|
905
|
-
}
|
|
906
|
-
}))).filter(import_exists2.exists);
|
|
907
|
-
const rootInstances = (await Promise.all(rootAddresses.map(async (root) => {
|
|
908
|
-
try {
|
|
909
|
-
return await this.resolver.resolveHandler(root);
|
|
910
|
-
} catch (ex) {
|
|
911
|
-
this.logger?.warn("Unable to resolve root:", root, ex);
|
|
912
|
-
return;
|
|
913
|
-
}
|
|
914
|
-
}))).flat().filter(import_exists2.exists);
|
|
915
|
-
for (const instance of rootInstances) {
|
|
916
|
-
this.downResolver.add(instance);
|
|
917
|
-
}
|
|
918
|
-
this._roots = rootInstances;
|
|
919
|
-
}
|
|
920
|
-
return this._roots;
|
|
921
|
-
});
|
|
922
|
-
}
|
|
923
|
-
async resolve(idOrFilter = "*", options = {}) {
|
|
924
|
-
const roots = this._roots ?? [];
|
|
925
|
-
const workingSet = options.direction === "up" ? [
|
|
926
|
-
this
|
|
927
|
-
] : [
|
|
928
|
-
...roots,
|
|
929
|
-
this
|
|
930
|
-
];
|
|
931
|
-
if (idOrFilter === "*") {
|
|
932
|
-
const remainingDepth = (options.maxDepth ?? 1) - 1;
|
|
933
|
-
return remainingDepth <= 0 ? workingSet : [
|
|
934
|
-
...workingSet,
|
|
935
|
-
...(await Promise.all(roots.map((mod) => mod.resolve("*", {
|
|
936
|
-
...options,
|
|
937
|
-
maxDepth: remainingDepth
|
|
938
|
-
})))).flat()
|
|
939
|
-
];
|
|
940
|
-
}
|
|
941
|
-
switch (typeof idOrFilter) {
|
|
942
|
-
case "string": {
|
|
943
|
-
const parts = idOrFilter.split(":");
|
|
944
|
-
const first = (0, import_assert6.assertEx)(parts.shift(), () => "Missing first part");
|
|
945
|
-
const firstInstance = (0, import_hex3.isAddress)(first) ? await (0, import_module_model5.resolveAddressToInstance)(this, first, void 0, [], options.direction) : this._roots?.find((mod) => mod.id === first);
|
|
946
|
-
return parts.length === 0 ? firstInstance : firstInstance?.resolve(parts.join(":"), options);
|
|
947
|
-
}
|
|
948
|
-
case "object": {
|
|
949
|
-
const results = [];
|
|
950
|
-
if ((0, import_module_model5.isAddressModuleFilter)(idOrFilter)) {
|
|
951
|
-
for (const mod of workingSet) {
|
|
952
|
-
if (mod.modName && idOrFilter.address.includes(mod.address)) results.push(mod);
|
|
953
|
-
}
|
|
954
|
-
}
|
|
955
|
-
return results;
|
|
956
|
-
}
|
|
957
|
-
default: {
|
|
958
|
-
return;
|
|
959
|
-
}
|
|
960
|
-
}
|
|
961
|
-
}
|
|
962
|
-
async startHandler() {
|
|
963
|
-
this.busHost()?.start();
|
|
964
|
-
return await super.startHandler();
|
|
965
|
-
}
|
|
966
|
-
async unexposeHandler(id, options) {
|
|
967
|
-
const { maxDepth = 2, required = true } = options ?? {};
|
|
968
|
-
const host = (0, import_assert6.assertEx)(this.busHost(), () => "Not configured as a host");
|
|
969
|
-
const mod = await host.unexpose(id, required);
|
|
970
|
-
if (mod) {
|
|
971
|
-
const children = maxDepth > 0 ? await mod.publicChildren?.() ?? [] : [];
|
|
972
|
-
const exposedChildren = (await Promise.all(children.map((child) => this.unexposeHandler(child.address, {
|
|
973
|
-
maxDepth: maxDepth - 1,
|
|
974
|
-
required: false
|
|
975
|
-
})))).flat().filter(import_exists2.exists);
|
|
976
|
-
return [
|
|
977
|
-
mod,
|
|
978
|
-
...exposedChildren
|
|
979
|
-
];
|
|
980
|
-
}
|
|
981
|
-
return [];
|
|
982
|
-
}
|
|
983
|
-
busClient() {
|
|
984
|
-
if (!this._busClient && this.config.client) {
|
|
985
|
-
this._busClient = new AsyncQueryBusClient({
|
|
986
|
-
config: this.config.client,
|
|
987
|
-
logger: this.logger,
|
|
988
|
-
rootModule: this
|
|
989
|
-
});
|
|
990
|
-
}
|
|
991
|
-
return this._busClient;
|
|
992
|
-
}
|
|
993
|
-
busHost() {
|
|
994
|
-
if (!this._busHost && this.config.host) {
|
|
995
|
-
this._busHost = new AsyncQueryBusHost({
|
|
996
|
-
config: this.config.host,
|
|
997
|
-
logger: this.logger,
|
|
998
|
-
onQueryFulfillFinished: /* @__PURE__ */ __name((args) => {
|
|
999
|
-
if (this.archiving && this.isAllowedArchivingQuery(args.query.schema)) {
|
|
1000
|
-
(0, import_forget3.forget)(this.storeToArchivists(args.result?.flat() ?? []));
|
|
1001
|
-
}
|
|
1002
|
-
(0, import_forget3.forget)(this.emit("queryFulfillFinished", {
|
|
1003
|
-
mod: this,
|
|
1004
|
-
...args
|
|
1005
|
-
}));
|
|
1006
|
-
}, "onQueryFulfillFinished"),
|
|
1007
|
-
onQueryFulfillStarted: /* @__PURE__ */ __name((args) => {
|
|
1008
|
-
if (this.archiving && this.isAllowedArchivingQuery(args.query.schema)) {
|
|
1009
|
-
(0, import_forget3.forget)(this.storeToArchivists([
|
|
1010
|
-
args.query,
|
|
1011
|
-
...args.payloads ?? []
|
|
1012
|
-
]));
|
|
1013
|
-
}
|
|
1014
|
-
(0, import_forget3.forget)(this.emit("queryFulfillStarted", {
|
|
1015
|
-
mod: this,
|
|
1016
|
-
...args
|
|
1017
|
-
}));
|
|
1018
|
-
}, "onQueryFulfillStarted"),
|
|
1019
|
-
rootModule: this
|
|
1020
|
-
});
|
|
1021
|
-
}
|
|
1022
|
-
return this._busHost;
|
|
1023
|
-
}
|
|
1024
|
-
async connectInstance(instance, maxDepth = 5) {
|
|
1025
|
-
if (instance) {
|
|
1026
|
-
this.downResolver.add(instance);
|
|
1027
|
-
if (maxDepth > 0) {
|
|
1028
|
-
const node = (0, import_node_model.asNodeInstance)(instance);
|
|
1029
|
-
if (node) {
|
|
1030
|
-
const state = await node.state();
|
|
1031
|
-
const children = (state?.filter((0, import_payload_model.isPayloadOfSchemaType)(import_module_model5.AddressSchema)).map((s) => s.address) ?? []).filter((a) => a !== instance.address);
|
|
1032
|
-
await Promise.all(children.map((child) => this.connect(child, maxDepth - 1)));
|
|
1033
|
-
}
|
|
1034
|
-
}
|
|
1035
|
-
this.logger?.log(`Connect: ${instance.id}`);
|
|
1036
|
-
return instance.address;
|
|
1037
|
-
}
|
|
1038
|
-
}
|
|
1039
|
-
stopHandler(_timeout) {
|
|
1040
|
-
this.busHost()?.stop();
|
|
1041
|
-
return true;
|
|
1042
|
-
}
|
|
1043
|
-
};
|
|
1044
|
-
PubSubBridge = _ts_decorate([
|
|
1045
|
-
(0, import_module_model5.creatableModule)()
|
|
1046
|
-
], PubSubBridge);
|
|
1047
|
-
//# sourceMappingURL=index.cjs.map
|