@xyo-network/bridge-pub-sub 2.91.2 → 2.92.0-rc.2
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/browser/AsyncQueryBus/AsyncQueryBusBase.d.cts +4 -1
- package/dist/browser/AsyncQueryBus/AsyncQueryBusBase.d.cts.map +1 -1
- package/dist/browser/AsyncQueryBus/AsyncQueryBusBase.d.mts +4 -1
- package/dist/browser/AsyncQueryBus/AsyncQueryBusBase.d.mts.map +1 -1
- package/dist/browser/AsyncQueryBus/AsyncQueryBusBase.d.ts +4 -1
- package/dist/browser/AsyncQueryBus/AsyncQueryBusBase.d.ts.map +1 -1
- package/dist/browser/AsyncQueryBus/AsyncQueryBusClient.d.cts +1 -2
- package/dist/browser/AsyncQueryBus/AsyncQueryBusClient.d.cts.map +1 -1
- package/dist/browser/AsyncQueryBus/AsyncQueryBusClient.d.mts +1 -2
- package/dist/browser/AsyncQueryBus/AsyncQueryBusClient.d.mts.map +1 -1
- package/dist/browser/AsyncQueryBus/AsyncQueryBusClient.d.ts +1 -2
- package/dist/browser/AsyncQueryBus/AsyncQueryBusClient.d.ts.map +1 -1
- package/dist/browser/AsyncQueryBus/AsyncQueryBusHost.d.cts +2 -2
- package/dist/browser/AsyncQueryBus/AsyncQueryBusHost.d.cts.map +1 -1
- package/dist/browser/AsyncQueryBus/AsyncQueryBusHost.d.mts +2 -2
- package/dist/browser/AsyncQueryBus/AsyncQueryBusHost.d.mts.map +1 -1
- package/dist/browser/AsyncQueryBus/AsyncQueryBusHost.d.ts +2 -2
- package/dist/browser/AsyncQueryBus/AsyncQueryBusHost.d.ts.map +1 -1
- package/dist/browser/AsyncQueryBus/ModuleHost/ModuleHost.d.cts +1 -1
- package/dist/browser/AsyncQueryBus/ModuleHost/ModuleHost.d.cts.map +1 -1
- package/dist/browser/AsyncQueryBus/ModuleHost/ModuleHost.d.mts +1 -1
- package/dist/browser/AsyncQueryBus/ModuleHost/ModuleHost.d.mts.map +1 -1
- package/dist/browser/AsyncQueryBus/ModuleHost/ModuleHost.d.ts +1 -1
- package/dist/browser/AsyncQueryBus/ModuleHost/ModuleHost.d.ts.map +1 -1
- package/dist/browser/AsyncQueryBus/ModuleProxy/ModuleProxy.d.cts +2 -2
- package/dist/browser/AsyncQueryBus/ModuleProxy/ModuleProxy.d.cts.map +1 -1
- package/dist/browser/AsyncQueryBus/ModuleProxy/ModuleProxy.d.mts +2 -2
- package/dist/browser/AsyncQueryBus/ModuleProxy/ModuleProxy.d.mts.map +1 -1
- package/dist/browser/AsyncQueryBus/ModuleProxy/ModuleProxy.d.ts +2 -2
- package/dist/browser/AsyncQueryBus/ModuleProxy/ModuleProxy.d.ts.map +1 -1
- package/dist/browser/AsyncQueryBus/index.d.cts +1 -2
- package/dist/browser/AsyncQueryBus/index.d.cts.map +1 -1
- package/dist/browser/AsyncQueryBus/index.d.mts +1 -2
- package/dist/browser/AsyncQueryBus/index.d.mts.map +1 -1
- package/dist/browser/AsyncQueryBus/index.d.ts +1 -2
- package/dist/browser/AsyncQueryBus/index.d.ts.map +1 -1
- package/dist/browser/AsyncQueryBus/model/BaseConfig.d.cts +14 -0
- package/dist/browser/AsyncQueryBus/model/BaseConfig.d.cts.map +1 -0
- package/dist/browser/AsyncQueryBus/model/BaseConfig.d.mts +14 -0
- package/dist/browser/AsyncQueryBus/model/BaseConfig.d.mts.map +1 -0
- package/dist/browser/AsyncQueryBus/model/BaseConfig.d.ts +14 -0
- package/dist/browser/AsyncQueryBus/model/BaseConfig.d.ts.map +1 -0
- package/dist/browser/AsyncQueryBus/model/ClientConfig.d.cts +9 -0
- package/dist/browser/AsyncQueryBus/model/ClientConfig.d.cts.map +1 -0
- package/dist/browser/AsyncQueryBus/model/ClientConfig.d.mts +9 -0
- package/dist/browser/AsyncQueryBus/model/ClientConfig.d.mts.map +1 -0
- package/dist/browser/AsyncQueryBus/model/ClientConfig.d.ts +9 -0
- package/dist/browser/AsyncQueryBus/model/ClientConfig.d.ts.map +1 -0
- package/dist/browser/AsyncQueryBus/model/HostConfig.d.cts +13 -0
- package/dist/browser/AsyncQueryBus/model/HostConfig.d.cts.map +1 -0
- package/dist/browser/AsyncQueryBus/model/HostConfig.d.mts +13 -0
- package/dist/browser/AsyncQueryBus/model/HostConfig.d.mts.map +1 -0
- package/dist/browser/AsyncQueryBus/model/HostConfig.d.ts +13 -0
- package/dist/browser/AsyncQueryBus/model/HostConfig.d.ts.map +1 -0
- package/dist/browser/AsyncQueryBus/model/IntersectConfig.d.cts +12 -0
- package/dist/browser/AsyncQueryBus/model/IntersectConfig.d.cts.map +1 -0
- package/dist/browser/AsyncQueryBus/model/IntersectConfig.d.mts +12 -0
- package/dist/browser/AsyncQueryBus/model/IntersectConfig.d.mts.map +1 -0
- package/dist/browser/AsyncQueryBus/model/IntersectConfig.d.ts +12 -0
- package/dist/browser/AsyncQueryBus/model/IntersectConfig.d.ts.map +1 -0
- package/dist/browser/AsyncQueryBus/{Params.d.cts → model/Params.d.cts} +3 -1
- package/dist/browser/AsyncQueryBus/model/Params.d.cts.map +1 -0
- package/dist/{node/AsyncQueryBus → browser/AsyncQueryBus/model}/Params.d.mts +3 -1
- package/dist/browser/AsyncQueryBus/model/Params.d.mts.map +1 -0
- package/dist/{node/AsyncQueryBus → browser/AsyncQueryBus/model}/Params.d.ts +3 -1
- package/dist/browser/AsyncQueryBus/model/Params.d.ts.map +1 -0
- package/dist/browser/AsyncQueryBus/model/QueryStatus.d.cts +3 -0
- package/dist/browser/AsyncQueryBus/model/QueryStatus.d.cts.map +1 -0
- package/dist/browser/AsyncQueryBus/model/QueryStatus.d.mts +3 -0
- package/dist/browser/AsyncQueryBus/model/QueryStatus.d.mts.map +1 -0
- package/dist/browser/AsyncQueryBus/model/QueryStatus.d.ts +3 -0
- package/dist/browser/AsyncQueryBus/model/QueryStatus.d.ts.map +1 -0
- package/dist/browser/AsyncQueryBus/model/SearchableStorage.d.cts +15 -0
- package/dist/browser/AsyncQueryBus/model/SearchableStorage.d.cts.map +1 -0
- package/dist/browser/AsyncQueryBus/model/SearchableStorage.d.mts +15 -0
- package/dist/browser/AsyncQueryBus/model/SearchableStorage.d.mts.map +1 -0
- package/dist/browser/AsyncQueryBus/model/SearchableStorage.d.ts +15 -0
- package/dist/browser/AsyncQueryBus/model/SearchableStorage.d.ts.map +1 -0
- package/dist/browser/AsyncQueryBus/model/index.d.cts +8 -0
- package/dist/browser/AsyncQueryBus/model/index.d.cts.map +1 -0
- package/dist/browser/AsyncQueryBus/model/index.d.mts +8 -0
- package/dist/browser/AsyncQueryBus/model/index.d.mts.map +1 -0
- package/dist/browser/AsyncQueryBus/model/index.d.ts +8 -0
- package/dist/browser/AsyncQueryBus/model/index.d.ts.map +1 -0
- package/dist/browser/PubSubBridge.d.cts +9 -24
- package/dist/browser/PubSubBridge.d.cts.map +1 -1
- package/dist/browser/PubSubBridge.d.mts +9 -24
- package/dist/browser/PubSubBridge.d.mts.map +1 -1
- package/dist/browser/PubSubBridge.d.ts +9 -24
- package/dist/browser/PubSubBridge.d.ts.map +1 -1
- package/dist/browser/index.cjs +89 -282
- package/dist/browser/index.cjs.map +1 -1
- package/dist/browser/index.d.cts +1 -1
- package/dist/browser/index.d.cts.map +1 -1
- package/dist/browser/index.d.mts +1 -1
- package/dist/browser/index.d.mts.map +1 -1
- package/dist/browser/index.d.ts +1 -1
- package/dist/browser/index.d.ts.map +1 -1
- package/dist/browser/index.js +84 -277
- package/dist/browser/index.js.map +1 -1
- package/dist/node/AsyncQueryBus/AsyncQueryBusBase.d.cts +4 -1
- package/dist/node/AsyncQueryBus/AsyncQueryBusBase.d.cts.map +1 -1
- package/dist/node/AsyncQueryBus/AsyncQueryBusBase.d.mts +4 -1
- package/dist/node/AsyncQueryBus/AsyncQueryBusBase.d.mts.map +1 -1
- package/dist/node/AsyncQueryBus/AsyncQueryBusBase.d.ts +4 -1
- package/dist/node/AsyncQueryBus/AsyncQueryBusBase.d.ts.map +1 -1
- package/dist/node/AsyncQueryBus/AsyncQueryBusClient.d.cts +1 -2
- package/dist/node/AsyncQueryBus/AsyncQueryBusClient.d.cts.map +1 -1
- package/dist/node/AsyncQueryBus/AsyncQueryBusClient.d.mts +1 -2
- package/dist/node/AsyncQueryBus/AsyncQueryBusClient.d.mts.map +1 -1
- package/dist/node/AsyncQueryBus/AsyncQueryBusClient.d.ts +1 -2
- package/dist/node/AsyncQueryBus/AsyncQueryBusClient.d.ts.map +1 -1
- package/dist/node/AsyncQueryBus/AsyncQueryBusHost.d.cts +2 -2
- package/dist/node/AsyncQueryBus/AsyncQueryBusHost.d.cts.map +1 -1
- package/dist/node/AsyncQueryBus/AsyncQueryBusHost.d.mts +2 -2
- package/dist/node/AsyncQueryBus/AsyncQueryBusHost.d.mts.map +1 -1
- package/dist/node/AsyncQueryBus/AsyncQueryBusHost.d.ts +2 -2
- package/dist/node/AsyncQueryBus/AsyncQueryBusHost.d.ts.map +1 -1
- package/dist/node/AsyncQueryBus/ModuleHost/ModuleHost.d.cts +1 -1
- package/dist/node/AsyncQueryBus/ModuleHost/ModuleHost.d.cts.map +1 -1
- package/dist/node/AsyncQueryBus/ModuleHost/ModuleHost.d.mts +1 -1
- package/dist/node/AsyncQueryBus/ModuleHost/ModuleHost.d.mts.map +1 -1
- package/dist/node/AsyncQueryBus/ModuleHost/ModuleHost.d.ts +1 -1
- package/dist/node/AsyncQueryBus/ModuleHost/ModuleHost.d.ts.map +1 -1
- package/dist/node/AsyncQueryBus/ModuleProxy/ModuleProxy.d.cts +2 -2
- package/dist/node/AsyncQueryBus/ModuleProxy/ModuleProxy.d.cts.map +1 -1
- package/dist/node/AsyncQueryBus/ModuleProxy/ModuleProxy.d.mts +2 -2
- package/dist/node/AsyncQueryBus/ModuleProxy/ModuleProxy.d.mts.map +1 -1
- package/dist/node/AsyncQueryBus/ModuleProxy/ModuleProxy.d.ts +2 -2
- package/dist/node/AsyncQueryBus/ModuleProxy/ModuleProxy.d.ts.map +1 -1
- package/dist/node/AsyncQueryBus/index.d.cts +1 -2
- package/dist/node/AsyncQueryBus/index.d.cts.map +1 -1
- package/dist/node/AsyncQueryBus/index.d.mts +1 -2
- package/dist/node/AsyncQueryBus/index.d.mts.map +1 -1
- package/dist/node/AsyncQueryBus/index.d.ts +1 -2
- package/dist/node/AsyncQueryBus/index.d.ts.map +1 -1
- package/dist/node/AsyncQueryBus/model/BaseConfig.d.cts +14 -0
- package/dist/node/AsyncQueryBus/model/BaseConfig.d.cts.map +1 -0
- package/dist/node/AsyncQueryBus/model/BaseConfig.d.mts +14 -0
- package/dist/node/AsyncQueryBus/model/BaseConfig.d.mts.map +1 -0
- package/dist/node/AsyncQueryBus/model/BaseConfig.d.ts +14 -0
- package/dist/node/AsyncQueryBus/model/BaseConfig.d.ts.map +1 -0
- package/dist/node/AsyncQueryBus/model/ClientConfig.d.cts +9 -0
- package/dist/node/AsyncQueryBus/model/ClientConfig.d.cts.map +1 -0
- package/dist/node/AsyncQueryBus/model/ClientConfig.d.mts +9 -0
- package/dist/node/AsyncQueryBus/model/ClientConfig.d.mts.map +1 -0
- package/dist/node/AsyncQueryBus/model/ClientConfig.d.ts +9 -0
- package/dist/node/AsyncQueryBus/model/ClientConfig.d.ts.map +1 -0
- package/dist/node/AsyncQueryBus/model/HostConfig.d.cts +13 -0
- package/dist/node/AsyncQueryBus/model/HostConfig.d.cts.map +1 -0
- package/dist/node/AsyncQueryBus/model/HostConfig.d.mts +13 -0
- package/dist/node/AsyncQueryBus/model/HostConfig.d.mts.map +1 -0
- package/dist/node/AsyncQueryBus/model/HostConfig.d.ts +13 -0
- package/dist/node/AsyncQueryBus/model/HostConfig.d.ts.map +1 -0
- package/dist/node/AsyncQueryBus/model/IntersectConfig.d.cts +12 -0
- package/dist/node/AsyncQueryBus/model/IntersectConfig.d.cts.map +1 -0
- package/dist/node/AsyncQueryBus/model/IntersectConfig.d.mts +12 -0
- package/dist/node/AsyncQueryBus/model/IntersectConfig.d.mts.map +1 -0
- package/dist/node/AsyncQueryBus/model/IntersectConfig.d.ts +12 -0
- package/dist/node/AsyncQueryBus/model/IntersectConfig.d.ts.map +1 -0
- package/dist/node/AsyncQueryBus/{Params.d.cts → model/Params.d.cts} +3 -1
- package/dist/node/AsyncQueryBus/model/Params.d.cts.map +1 -0
- package/dist/{browser/AsyncQueryBus → node/AsyncQueryBus/model}/Params.d.mts +3 -1
- package/dist/node/AsyncQueryBus/model/Params.d.mts.map +1 -0
- package/dist/{browser/AsyncQueryBus → node/AsyncQueryBus/model}/Params.d.ts +3 -1
- package/dist/node/AsyncQueryBus/model/Params.d.ts.map +1 -0
- package/dist/node/AsyncQueryBus/model/QueryStatus.d.cts +3 -0
- package/dist/node/AsyncQueryBus/model/QueryStatus.d.cts.map +1 -0
- package/dist/node/AsyncQueryBus/model/QueryStatus.d.mts +3 -0
- package/dist/node/AsyncQueryBus/model/QueryStatus.d.mts.map +1 -0
- package/dist/node/AsyncQueryBus/model/QueryStatus.d.ts +3 -0
- package/dist/node/AsyncQueryBus/model/QueryStatus.d.ts.map +1 -0
- package/dist/node/AsyncQueryBus/model/SearchableStorage.d.cts +15 -0
- package/dist/node/AsyncQueryBus/model/SearchableStorage.d.cts.map +1 -0
- package/dist/node/AsyncQueryBus/model/SearchableStorage.d.mts +15 -0
- package/dist/node/AsyncQueryBus/model/SearchableStorage.d.mts.map +1 -0
- package/dist/node/AsyncQueryBus/model/SearchableStorage.d.ts +15 -0
- package/dist/node/AsyncQueryBus/model/SearchableStorage.d.ts.map +1 -0
- package/dist/node/AsyncQueryBus/model/index.d.cts +8 -0
- package/dist/node/AsyncQueryBus/model/index.d.cts.map +1 -0
- package/dist/node/AsyncQueryBus/model/index.d.mts +8 -0
- package/dist/node/AsyncQueryBus/model/index.d.mts.map +1 -0
- package/dist/node/AsyncQueryBus/model/index.d.ts +8 -0
- package/dist/node/AsyncQueryBus/model/index.d.ts.map +1 -0
- package/dist/node/PubSubBridge.d.cts +9 -24
- package/dist/node/PubSubBridge.d.cts.map +1 -1
- package/dist/node/PubSubBridge.d.mts +9 -24
- package/dist/node/PubSubBridge.d.mts.map +1 -1
- package/dist/node/PubSubBridge.d.ts +9 -24
- package/dist/node/PubSubBridge.d.ts.map +1 -1
- package/dist/node/index.cjs +97 -288
- package/dist/node/index.cjs.map +1 -1
- package/dist/node/index.d.cts +1 -1
- package/dist/node/index.d.cts.map +1 -1
- package/dist/node/index.d.mts +1 -1
- package/dist/node/index.d.mts.map +1 -1
- package/dist/node/index.d.ts +1 -1
- package/dist/node/index.d.ts.map +1 -1
- package/dist/node/index.js +91 -282
- package/dist/node/index.js.map +1 -1
- package/package.json +18 -23
- package/src/AsyncQueryBus/AsyncQueryBusBase.ts +20 -9
- package/src/AsyncQueryBus/AsyncQueryBusClient.ts +1 -2
- package/src/AsyncQueryBus/AsyncQueryBusHost.ts +20 -20
- package/src/AsyncQueryBus/ModuleHost/ModuleHost.ts +1 -1
- package/src/AsyncQueryBus/ModuleProxy/ModuleProxy.ts +3 -3
- package/src/AsyncQueryBus/index.ts +1 -2
- package/src/AsyncQueryBus/model/BaseConfig.ts +16 -0
- package/src/AsyncQueryBus/model/ClientConfig.ts +10 -0
- package/src/AsyncQueryBus/model/HostConfig.ts +15 -0
- package/src/AsyncQueryBus/model/IntersectConfig.ts +13 -0
- package/src/AsyncQueryBus/{Params.ts → model/Params.ts} +3 -1
- package/src/AsyncQueryBus/model/QueryStatus.ts +2 -0
- package/src/AsyncQueryBus/model/SearchableStorage.ts +15 -0
- package/src/AsyncQueryBus/model/index.ts +7 -0
- package/src/PubSubBridge.ts +36 -154
- package/src/index.ts +1 -1
- package/dist/browser/AbstractModuleProxy/AbstractModuleProxy.d.cts +0 -90
- package/dist/browser/AbstractModuleProxy/AbstractModuleProxy.d.cts.map +0 -1
- package/dist/browser/AbstractModuleProxy/AbstractModuleProxy.d.mts +0 -90
- package/dist/browser/AbstractModuleProxy/AbstractModuleProxy.d.mts.map +0 -1
- package/dist/browser/AbstractModuleProxy/AbstractModuleProxy.d.ts +0 -90
- package/dist/browser/AbstractModuleProxy/AbstractModuleProxy.d.ts.map +0 -1
- package/dist/browser/AbstractModuleProxy/index.d.cts +0 -2
- package/dist/browser/AbstractModuleProxy/index.d.cts.map +0 -1
- package/dist/browser/AbstractModuleProxy/index.d.mts +0 -2
- package/dist/browser/AbstractModuleProxy/index.d.mts.map +0 -1
- package/dist/browser/AbstractModuleProxy/index.d.ts +0 -2
- package/dist/browser/AbstractModuleProxy/index.d.ts.map +0 -1
- package/dist/browser/AsyncQueryBus/Config.d.cts +0 -53
- package/dist/browser/AsyncQueryBus/Config.d.cts.map +0 -1
- package/dist/browser/AsyncQueryBus/Config.d.mts +0 -53
- package/dist/browser/AsyncQueryBus/Config.d.mts.map +0 -1
- package/dist/browser/AsyncQueryBus/Config.d.ts +0 -53
- package/dist/browser/AsyncQueryBus/Config.d.ts.map +0 -1
- package/dist/browser/AsyncQueryBus/Params.d.cts.map +0 -1
- package/dist/browser/AsyncQueryBus/Params.d.mts.map +0 -1
- package/dist/browser/AsyncQueryBus/Params.d.ts.map +0 -1
- package/dist/node/AbstractModuleProxy/AbstractModuleProxy.d.cts +0 -90
- package/dist/node/AbstractModuleProxy/AbstractModuleProxy.d.cts.map +0 -1
- package/dist/node/AbstractModuleProxy/AbstractModuleProxy.d.mts +0 -90
- package/dist/node/AbstractModuleProxy/AbstractModuleProxy.d.mts.map +0 -1
- package/dist/node/AbstractModuleProxy/AbstractModuleProxy.d.ts +0 -90
- package/dist/node/AbstractModuleProxy/AbstractModuleProxy.d.ts.map +0 -1
- package/dist/node/AbstractModuleProxy/index.d.cts +0 -2
- package/dist/node/AbstractModuleProxy/index.d.cts.map +0 -1
- package/dist/node/AbstractModuleProxy/index.d.mts +0 -2
- package/dist/node/AbstractModuleProxy/index.d.mts.map +0 -1
- package/dist/node/AbstractModuleProxy/index.d.ts +0 -2
- package/dist/node/AbstractModuleProxy/index.d.ts.map +0 -1
- package/dist/node/AsyncQueryBus/Config.d.cts +0 -53
- package/dist/node/AsyncQueryBus/Config.d.cts.map +0 -1
- package/dist/node/AsyncQueryBus/Config.d.mts +0 -53
- package/dist/node/AsyncQueryBus/Config.d.mts.map +0 -1
- package/dist/node/AsyncQueryBus/Config.d.ts +0 -53
- package/dist/node/AsyncQueryBus/Config.d.ts.map +0 -1
- package/dist/node/AsyncQueryBus/Params.d.cts.map +0 -1
- package/dist/node/AsyncQueryBus/Params.d.mts.map +0 -1
- package/dist/node/AsyncQueryBus/Params.d.ts.map +0 -1
- package/src/AbstractModuleProxy/AbstractModuleProxy.ts +0 -239
- package/src/AbstractModuleProxy/index.ts +0 -1
- package/src/AsyncQueryBus/Config.ts +0 -62
package/dist/browser/index.js
CHANGED
|
@@ -1,162 +1,11 @@
|
|
|
1
1
|
var __defProp = Object.defineProperty;
|
|
2
2
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
3
|
|
|
4
|
-
// src/
|
|
5
|
-
import { assertEx } from "@xylabs/assert";
|
|
6
|
-
import { compact } from "@xylabs/lodash";
|
|
4
|
+
// src/AbstractModuleHost/AbstractModuleHost.ts
|
|
7
5
|
import { Base } from "@xylabs/object";
|
|
8
|
-
|
|
9
|
-
import { QueryBoundWitnessBuilder } from "@xyo-network/boundwitness-builder";
|
|
10
|
-
import { BoundWitnessWrapper } from "@xyo-network/boundwitness-wrapper";
|
|
11
|
-
import { AddressPreviousHashSchema, ModuleAddressQuerySchema, ModuleConfigSchema, ModuleDescribeQuerySchema, ModuleDiscoverQuerySchema, ModuleManifestQuerySchema } from "@xyo-network/module-model";
|
|
12
|
-
import { ModuleErrorSchema } from "@xyo-network/payload-model";
|
|
13
|
-
var AbstractModuleProxy = class extends Base {
|
|
6
|
+
var AbstractModuleHost = class extends Base {
|
|
14
7
|
static {
|
|
15
|
-
__name(this, "
|
|
16
|
-
}
|
|
17
|
-
static requiredQueries = [
|
|
18
|
-
ModuleDiscoverQuerySchema
|
|
19
|
-
];
|
|
20
|
-
eventData = {};
|
|
21
|
-
proxyParams;
|
|
22
|
-
constructor(params) {
|
|
23
|
-
super({
|
|
24
|
-
config: {
|
|
25
|
-
schema: ModuleConfigSchema
|
|
26
|
-
}
|
|
27
|
-
});
|
|
28
|
-
this.proxyParams = params;
|
|
29
|
-
}
|
|
30
|
-
get account() {
|
|
31
|
-
return this.proxyParams.account;
|
|
32
|
-
}
|
|
33
|
-
get address() {
|
|
34
|
-
return this.proxyParams.moduleAddress;
|
|
35
|
-
}
|
|
36
|
-
get config() {
|
|
37
|
-
return this.params.config;
|
|
38
|
-
}
|
|
39
|
-
get downResolver() {
|
|
40
|
-
throw new Error("Unsupported");
|
|
41
|
-
}
|
|
42
|
-
get id() {
|
|
43
|
-
return this.proxyParams.moduleAddress;
|
|
44
|
-
}
|
|
45
|
-
get queries() {
|
|
46
|
-
return this.proxyParams.queries;
|
|
47
|
-
}
|
|
48
|
-
get upResolver() {
|
|
49
|
-
throw new Error("Unsupported");
|
|
50
|
-
}
|
|
51
|
-
static hasRequiredQueries(module) {
|
|
52
|
-
return this.missingRequiredQueries(module).length === 0;
|
|
53
|
-
}
|
|
54
|
-
static missingRequiredQueries(module) {
|
|
55
|
-
const moduleQueries = module.queries;
|
|
56
|
-
return compact(this.requiredQueries.map((query) => {
|
|
57
|
-
return moduleQueries.includes(query) ? null : query;
|
|
58
|
-
}));
|
|
59
|
-
}
|
|
60
|
-
async addressPreviousHash() {
|
|
61
|
-
const queryPayload = {
|
|
62
|
-
schema: ModuleAddressQuerySchema
|
|
63
|
-
};
|
|
64
|
-
return assertEx((await this.sendQuery(queryPayload)).find((payload) => payload.schema === AddressPreviousHashSchema), "Result did not include correct payload");
|
|
65
|
-
}
|
|
66
|
-
clearListeners(_eventNames) {
|
|
67
|
-
throw new Error("Unsupported");
|
|
68
|
-
}
|
|
69
|
-
//TODO: Make ModuleDescription into real payload
|
|
70
|
-
async describe() {
|
|
71
|
-
const queryPayload = {
|
|
72
|
-
schema: ModuleDescribeQuerySchema
|
|
73
|
-
};
|
|
74
|
-
return (await this.sendQuery(queryPayload))[0];
|
|
75
|
-
}
|
|
76
|
-
async discover() {
|
|
77
|
-
const queryPayload = {
|
|
78
|
-
schema: ModuleDiscoverQuerySchema
|
|
79
|
-
};
|
|
80
|
-
return await this.sendQuery(queryPayload);
|
|
81
|
-
}
|
|
82
|
-
emit(_eventName, _eventArgs) {
|
|
83
|
-
throw new Error("Unsupported");
|
|
84
|
-
}
|
|
85
|
-
emitSerial(_eventName, _eventArgs) {
|
|
86
|
-
throw new Error("Unsupported");
|
|
87
|
-
}
|
|
88
|
-
listenerCount(_eventNames) {
|
|
89
|
-
throw new Error("Unsupported");
|
|
90
|
-
}
|
|
91
|
-
async manifest(maxDepth) {
|
|
92
|
-
const queryPayload = {
|
|
93
|
-
schema: ModuleManifestQuerySchema,
|
|
94
|
-
...maxDepth === void 0 ? {} : {
|
|
95
|
-
maxDepth
|
|
96
|
-
}
|
|
97
|
-
};
|
|
98
|
-
return (await this.sendQuery(queryPayload))[0];
|
|
99
|
-
}
|
|
100
|
-
async moduleAddress() {
|
|
101
|
-
const queryPayload = {
|
|
102
|
-
schema: ModuleAddressQuerySchema
|
|
103
|
-
};
|
|
104
|
-
return await this.sendQuery(queryPayload);
|
|
105
|
-
}
|
|
106
|
-
off(_eventNames, _listener) {
|
|
107
|
-
throw new Error("Unsupported");
|
|
108
|
-
}
|
|
109
|
-
offAny(_listener) {
|
|
110
|
-
throw new Error("Unsupported");
|
|
111
|
-
}
|
|
112
|
-
on(_eventNames, _listener) {
|
|
113
|
-
throw new Error("Unsupported");
|
|
114
|
-
}
|
|
115
|
-
onAny(_listener) {
|
|
116
|
-
throw new Error("Unsupported");
|
|
117
|
-
}
|
|
118
|
-
once(_eventName, _listener) {
|
|
119
|
-
throw new Error("Unsupported");
|
|
120
|
-
}
|
|
121
|
-
async previousHash() {
|
|
122
|
-
const queryPayload = {
|
|
123
|
-
schema: ModuleAddressQuerySchema
|
|
124
|
-
};
|
|
125
|
-
return (await this.sendQuery(queryPayload)).pop().previousHash;
|
|
126
|
-
}
|
|
127
|
-
queryable(_query, _payloads) {
|
|
128
|
-
return true;
|
|
129
|
-
}
|
|
130
|
-
resolve(nameOrAddressOrFilter, _options) {
|
|
131
|
-
return typeof nameOrAddressOrFilter === "string" ? void 0 : [];
|
|
132
|
-
}
|
|
133
|
-
state() {
|
|
134
|
-
return [];
|
|
135
|
-
}
|
|
136
|
-
bindQuery(query, payloads, account = this.account) {
|
|
137
|
-
const promise = new PromiseEx(async (resolve) => {
|
|
138
|
-
const result = await this.bindQueryInternal(query, payloads, account);
|
|
139
|
-
resolve?.(result);
|
|
140
|
-
return result;
|
|
141
|
-
}, account);
|
|
142
|
-
return promise;
|
|
143
|
-
}
|
|
144
|
-
async bindQueryInternal(query, payloads, account = this.account) {
|
|
145
|
-
const builder = await new QueryBoundWitnessBuilder().payloads(payloads).query(query);
|
|
146
|
-
const result = await (account ? builder.witness(account) : builder).build();
|
|
147
|
-
return result;
|
|
148
|
-
}
|
|
149
|
-
async filterErrors(result) {
|
|
150
|
-
const wrapper = await BoundWitnessWrapper.wrap(result[0], result[1]);
|
|
151
|
-
return wrapper.payloadsBySchema(ModuleErrorSchema);
|
|
152
|
-
}
|
|
153
|
-
async sendQuery(queryPayload, payloads) {
|
|
154
|
-
const query = await this.bindQuery(queryPayload, payloads);
|
|
155
|
-
const [, resultPayloads, errors] = await this.query(query[0], query[1]);
|
|
156
|
-
if (errors && errors.length > 0) {
|
|
157
|
-
throw errors[0];
|
|
158
|
-
}
|
|
159
|
-
return resultPayloads;
|
|
8
|
+
__name(this, "AbstractModuleHost");
|
|
160
9
|
}
|
|
161
10
|
};
|
|
162
11
|
|
|
@@ -170,7 +19,7 @@ import { PayloadBuilder } from "@xyo-network/payload-builder";
|
|
|
170
19
|
import { LRUCache as LRUCache2 } from "lru-cache";
|
|
171
20
|
|
|
172
21
|
// src/AsyncQueryBus/AsyncQueryBusBase.ts
|
|
173
|
-
import { assertEx
|
|
22
|
+
import { assertEx } from "@xylabs/assert";
|
|
174
23
|
import { Base as Base2 } from "@xylabs/object";
|
|
175
24
|
import { asArchivistInstance } from "@xyo-network/archivist-model";
|
|
176
25
|
import { asDivinerInstance } from "@xyo-network/diviner-model";
|
|
@@ -179,6 +28,7 @@ var AsyncQueryBusBase = class extends Base2 {
|
|
|
179
28
|
static {
|
|
180
29
|
__name(this, "AsyncQueryBusBase");
|
|
181
30
|
}
|
|
31
|
+
_exposedAddresses = /* @__PURE__ */ new Set();
|
|
182
32
|
_lastState;
|
|
183
33
|
_targetConfigs = {};
|
|
184
34
|
_targetQueries = {};
|
|
@@ -205,17 +55,25 @@ var AsyncQueryBusBase = class extends Base2 {
|
|
|
205
55
|
this._lastState = this._lastState ?? new LRUCache(requiredConfig);
|
|
206
56
|
return this._lastState;
|
|
207
57
|
}
|
|
58
|
+
expose(address, validate = true) {
|
|
59
|
+
assertEx(!validate || !this._exposedAddresses.has(address), () => `Address already exposed [${address}]`);
|
|
60
|
+
this._exposedAddresses.add(address);
|
|
61
|
+
}
|
|
208
62
|
async queriesArchivist() {
|
|
209
|
-
return
|
|
63
|
+
return assertEx(asArchivistInstance(await this.resolver.resolve(this.config?.intersect?.queries?.archivist)), () => `Unable to resolve queriesArchivist [${this.config?.intersect?.queries?.archivist}]`);
|
|
210
64
|
}
|
|
211
65
|
async queriesDiviner() {
|
|
212
|
-
return
|
|
66
|
+
return assertEx(asDivinerInstance(await this.resolver.resolve(this.config?.intersect?.queries?.boundWitnessDiviner)), () => `Unable to resolve queriesDiviner [${this.config?.intersect?.queries?.boundWitnessDiviner}]`);
|
|
213
67
|
}
|
|
214
68
|
async responsesArchivist() {
|
|
215
|
-
return
|
|
69
|
+
return assertEx(asArchivistInstance(await this.resolver.resolve(this.config?.intersect?.responses?.archivist)), () => `Unable to resolve responsesArchivist [${this.config?.intersect?.responses?.archivist}]`);
|
|
216
70
|
}
|
|
217
71
|
async responsesDiviner() {
|
|
218
|
-
return
|
|
72
|
+
return assertEx(asDivinerInstance(await this.resolver.resolve(this.config?.intersect?.responses?.boundWitnessDiviner)), () => `Unable to resolve responsesDiviner [${this.config?.intersect?.responses?.boundWitnessDiviner}]`);
|
|
73
|
+
}
|
|
74
|
+
unexpose(address, validate = true) {
|
|
75
|
+
assertEx(!validate || this._exposedAddresses.has(address), () => `Address not exposed [${address}]`);
|
|
76
|
+
this._exposedAddresses.delete(address);
|
|
219
77
|
}
|
|
220
78
|
/**
|
|
221
79
|
* Commit the internal state of the process. This is similar
|
|
@@ -249,7 +107,7 @@ var AsyncQueryBusBase = class extends Base2 {
|
|
|
249
107
|
}
|
|
250
108
|
};
|
|
251
109
|
|
|
252
|
-
// src/AsyncQueryBus/
|
|
110
|
+
// src/AsyncQueryBus/model/QueryStatus.ts
|
|
253
111
|
var Pending = "pending";
|
|
254
112
|
|
|
255
113
|
// src/AsyncQueryBus/AsyncQueryBusClient.ts
|
|
@@ -434,7 +292,7 @@ var AsyncQueryBusClient = class extends AsyncQueryBusBase {
|
|
|
434
292
|
|
|
435
293
|
// src/AsyncQueryBus/AsyncQueryBusHost.ts
|
|
436
294
|
import { containsAll } from "@xylabs/array";
|
|
437
|
-
import { assertEx as
|
|
295
|
+
import { assertEx as assertEx2 } from "@xylabs/assert";
|
|
438
296
|
import { clearTimeoutEx as clearTimeoutEx2, setTimeoutEx as setTimeoutEx2 } from "@xylabs/timer";
|
|
439
297
|
import { isQueryBoundWitnessWithMeta } from "@xyo-network/boundwitness-model";
|
|
440
298
|
import { BoundWitnessDivinerQuerySchema as BoundWitnessDivinerQuerySchema2 } from "@xyo-network/diviner-boundwitness-model";
|
|
@@ -455,7 +313,7 @@ var AsyncQueryBusHost = class extends AsyncQueryBusBase {
|
|
|
455
313
|
return !!this._pollId;
|
|
456
314
|
}
|
|
457
315
|
async listeningModules() {
|
|
458
|
-
const mods = this.config?.listeningModules ? await Promise.all(this.config.listeningModules.map(async (listeningModule) =>
|
|
316
|
+
const mods = this.config?.listeningModules ? await Promise.all(this.config.listeningModules.map(async (listeningModule) => assertEx2(asModuleInstance(await this.resolver.resolve(listeningModule)), () => `Unable to resolve listeningModule [${listeningModule}]`))) : await this.resolver.resolve(void 0, {
|
|
459
317
|
direction: "down"
|
|
460
318
|
});
|
|
461
319
|
return mods;
|
|
@@ -478,38 +336,39 @@ var AsyncQueryBusHost = class extends AsyncQueryBusBase {
|
|
|
478
336
|
const localModuleName = localModule.config.name ?? localModule.address;
|
|
479
337
|
const queryArchivist = await this.queriesArchivist();
|
|
480
338
|
const responseArchivist = await this.responsesArchivist();
|
|
481
|
-
const
|
|
482
|
-
if (
|
|
339
|
+
const queryDestination = query.$meta?.destination;
|
|
340
|
+
if (queryDestination && queryDestination?.includes(localModule.address)) {
|
|
483
341
|
const queryIndex = query.payload_hashes.indexOf(query.query);
|
|
484
342
|
if (queryIndex !== -1) {
|
|
485
343
|
const querySchema = query.payload_schemas[queryIndex];
|
|
486
344
|
if (localModule.queries.includes(querySchema)) {
|
|
487
|
-
const
|
|
488
|
-
const
|
|
489
|
-
const
|
|
490
|
-
if (!containsAll(Object.keys(
|
|
491
|
-
this.logger?.error(`Error processing command ${
|
|
345
|
+
const queryPayloads = await queryArchivist.get(query.payload_hashes);
|
|
346
|
+
const queryPayloadsDict = await PayloadBuilder2.toAllHashMap(queryPayloads);
|
|
347
|
+
const queryHash = (await PayloadBuilder2.build(query)).$hash;
|
|
348
|
+
if (!containsAll(Object.keys(queryPayloadsDict), query.payload_hashes)) {
|
|
349
|
+
this.logger?.error(`Error processing command ${queryHash} for module ${localModuleName}, missing payloads`);
|
|
492
350
|
return;
|
|
493
351
|
}
|
|
494
352
|
try {
|
|
495
|
-
const
|
|
496
|
-
this.logger?.debug(`Issuing
|
|
497
|
-
const response = await localModule.query(query,
|
|
353
|
+
const querySchema2 = queryPayloadsDict[query.query].schema;
|
|
354
|
+
this.logger?.debug(`Issuing query ${querySchema2} (${queryHash}) addressed to module: ${localModuleName}`);
|
|
355
|
+
const response = await localModule.query(query, queryPayloads);
|
|
498
356
|
const [bw, payloads, errors] = response;
|
|
499
|
-
this.logger?.debug(`Replying to
|
|
357
|
+
this.logger?.debug(`Replying to query ${queryHash} addressed to module: ${localModuleName}`);
|
|
500
358
|
const insertResult = await responseArchivist.insert([
|
|
501
359
|
bw,
|
|
502
360
|
...payloads,
|
|
503
361
|
...errors
|
|
504
362
|
]);
|
|
505
363
|
if (insertResult.length === 0) {
|
|
506
|
-
this.logger?.error(`Error replying to
|
|
364
|
+
this.logger?.error(`Error replying to query ${queryHash} addressed to module: ${localModuleName}`);
|
|
507
365
|
}
|
|
508
366
|
if (query?.timestamp) {
|
|
509
367
|
await this.commitState(localModule.address, query.timestamp);
|
|
510
368
|
}
|
|
511
369
|
} catch (error) {
|
|
512
|
-
this.logger?.error(`Error processing
|
|
370
|
+
this.logger?.error(`Error processing query ${queryHash} for module ${localModuleName}: ${error}`);
|
|
371
|
+
console.error(`Error processing query ${queryHash} for module ${localModuleName}: ${error}`);
|
|
513
372
|
}
|
|
514
373
|
}
|
|
515
374
|
}
|
|
@@ -560,37 +419,29 @@ var AsyncQueryBusHost = class extends AsyncQueryBusBase {
|
|
|
560
419
|
}, this.pollFrequencyConfig);
|
|
561
420
|
}
|
|
562
421
|
/**
|
|
563
|
-
* Background process for checking for inbound
|
|
422
|
+
* Background process for checking for inbound queries
|
|
564
423
|
*/
|
|
565
424
|
processIncomingQueries = async () => {
|
|
566
|
-
this.logger?.debug("Checking for inbound
|
|
425
|
+
this.logger?.debug("Checking for inbound queries");
|
|
567
426
|
const localModules = await this.listeningModules();
|
|
568
427
|
await Promise.allSettled(localModules.map(async (localModule) => {
|
|
569
428
|
try {
|
|
570
429
|
const localModuleName = localModule.config.name ?? localModule.address;
|
|
571
|
-
this.logger?.debug(`Checking for inbound
|
|
430
|
+
this.logger?.debug(`Checking for inbound queries to ${localModuleName}`);
|
|
572
431
|
const queries = await this.findQueriesToAddress(localModule.address);
|
|
573
432
|
if (queries.length === 0)
|
|
574
433
|
return;
|
|
575
|
-
this.logger?.debug(`Found
|
|
434
|
+
this.logger?.debug(`Found queries addressed to local module: ${localModuleName}`);
|
|
576
435
|
for (const query of queries) {
|
|
577
436
|
await this.callLocalModule(localModule, query);
|
|
578
437
|
}
|
|
579
438
|
} catch (error) {
|
|
580
|
-
this.logger?.error(`Error processing
|
|
439
|
+
this.logger?.error(`Error processing queries for address ${localModule.address}: ${error}`);
|
|
581
440
|
}
|
|
582
441
|
}));
|
|
583
442
|
};
|
|
584
443
|
};
|
|
585
444
|
|
|
586
|
-
// src/AbstractModuleHost/AbstractModuleHost.ts
|
|
587
|
-
import { Base as Base3 } from "@xylabs/object";
|
|
588
|
-
var AbstractModuleHost = class extends Base3 {
|
|
589
|
-
static {
|
|
590
|
-
__name(this, "AbstractModuleHost");
|
|
591
|
-
}
|
|
592
|
-
};
|
|
593
|
-
|
|
594
445
|
// src/AsyncQueryBus/ModuleHost/ModuleHost.ts
|
|
595
446
|
var AsyncQueryBusModuleHost = class extends AbstractModuleHost {
|
|
596
447
|
static {
|
|
@@ -620,12 +471,13 @@ var AsyncQueryBusModuleHost = class extends AbstractModuleHost {
|
|
|
620
471
|
};
|
|
621
472
|
|
|
622
473
|
// src/AsyncQueryBus/ModuleProxy/ModuleProxy.ts
|
|
474
|
+
import { AbstractModuleProxy } from "@xyo-network/abstract-bridge";
|
|
623
475
|
var AsyncQueryBusModuleProxy = class extends AbstractModuleProxy {
|
|
624
476
|
static {
|
|
625
477
|
__name(this, "AsyncQueryBusModuleProxy");
|
|
626
478
|
}
|
|
627
479
|
async query(query, payloads) {
|
|
628
|
-
return await this.proxyParams.
|
|
480
|
+
return await this.proxyParams.busClient.send(this.address, query, payloads);
|
|
629
481
|
}
|
|
630
482
|
};
|
|
631
483
|
|
|
@@ -636,12 +488,10 @@ var PubSubBridgeSchema = "network.xyo.bridge.pubsub";
|
|
|
636
488
|
var PubSubBridgeConfigSchema = `${PubSubBridgeSchema}.config`;
|
|
637
489
|
|
|
638
490
|
// src/PubSubBridge.ts
|
|
639
|
-
import { assertEx as
|
|
491
|
+
import { assertEx as assertEx3 } from "@xylabs/assert";
|
|
640
492
|
import { AbstractBridge } from "@xyo-network/abstract-bridge";
|
|
641
|
-
import {
|
|
642
|
-
import { creatableModule
|
|
643
|
-
import { isPayloadOfSchemaType } from "@xyo-network/payload-model";
|
|
644
|
-
import { LRUCache as LRUCache3 } from "lru-cache";
|
|
493
|
+
import { Account } from "@xyo-network/account";
|
|
494
|
+
import { creatableModule } from "@xyo-network/module-model";
|
|
645
495
|
function _ts_decorate(decorators, target, key, desc) {
|
|
646
496
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
647
497
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
@@ -664,94 +514,52 @@ var PubSubBridge = class extends AbstractBridge {
|
|
|
664
514
|
_configRootAddress = "";
|
|
665
515
|
_configStateStoreArchivist = "";
|
|
666
516
|
_configStateStoreBoundWitnessDiviner = "";
|
|
667
|
-
|
|
517
|
+
_exposedAddresses = [];
|
|
668
518
|
_lastState;
|
|
669
|
-
_targetConfigs = {};
|
|
670
|
-
_targetQueries = {};
|
|
671
519
|
_busClient;
|
|
672
520
|
_busHost;
|
|
673
|
-
get discoverCache() {
|
|
674
|
-
const config = this.discoverCacheConfig;
|
|
675
|
-
this._discoverCache = this._discoverCache ?? new LRUCache3({
|
|
676
|
-
ttlAutopurge: true,
|
|
677
|
-
...config
|
|
678
|
-
});
|
|
679
|
-
return this._discoverCache;
|
|
680
|
-
}
|
|
681
|
-
get discoverCacheConfig() {
|
|
682
|
-
const discoverCacheConfig = this.config.discoverCache === true ? {} : this.config.discoverCache;
|
|
683
|
-
return {
|
|
684
|
-
max: 100,
|
|
685
|
-
ttl: 1e3 * 60 * 5,
|
|
686
|
-
...discoverCacheConfig
|
|
687
|
-
};
|
|
688
|
-
}
|
|
689
521
|
get moduleName() {
|
|
690
522
|
return `${this.config.name ?? moduleName}`;
|
|
691
523
|
}
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
return true;
|
|
704
|
-
}
|
|
705
|
-
async disconnect() {
|
|
706
|
-
await Promise.resolve();
|
|
707
|
-
this.connected = false;
|
|
708
|
-
return true;
|
|
709
|
-
}
|
|
710
|
-
getRootAddress() {
|
|
711
|
-
return this.rootAddress;
|
|
712
|
-
}
|
|
713
|
-
targetConfig(address) {
|
|
714
|
-
return assertEx4(this._targetConfigs[address], () => `targetConfig not set [${address}]`);
|
|
715
|
-
}
|
|
716
|
-
async targetDiscover(address, _maxDepth) {
|
|
717
|
-
if (!this.connected)
|
|
718
|
-
throw new Error("Not connected");
|
|
719
|
-
const cachedResult = this.discoverCache?.get(address ?? "root ");
|
|
720
|
-
if (cachedResult) {
|
|
721
|
-
return cachedResult;
|
|
524
|
+
async exposeHandler(id, options) {
|
|
525
|
+
const filterOptions = {
|
|
526
|
+
direction: options?.direction
|
|
527
|
+
};
|
|
528
|
+
const module = await super.resolve(id, filterOptions);
|
|
529
|
+
if (module) {
|
|
530
|
+
const host = assertEx3(this.busHost(), "Not configured as a host");
|
|
531
|
+
host.expose(module.address);
|
|
532
|
+
return [
|
|
533
|
+
module.address
|
|
534
|
+
];
|
|
722
535
|
}
|
|
723
|
-
await this.started("throw");
|
|
724
|
-
const addressToDiscover = address ?? await this.getRootAddress();
|
|
725
|
-
this.logger?.debug(`${this.moduleName}: Begin issuing targetDiscover to: ${addressToDiscover}`);
|
|
726
536
|
return [];
|
|
727
537
|
}
|
|
728
|
-
|
|
729
|
-
const
|
|
730
|
-
const
|
|
731
|
-
|
|
732
|
-
|
|
538
|
+
resolveHandler(id, _options) {
|
|
539
|
+
const account = Account.randomSync();
|
|
540
|
+
const params = {
|
|
541
|
+
account,
|
|
542
|
+
busClient: assertEx3(this.busClient(), "Bus client not initialized"),
|
|
543
|
+
moduleAddress: id
|
|
733
544
|
};
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
return
|
|
749
|
-
}
|
|
750
|
-
targetQueryable(_address, _query, _payloads, _queryConfig) {
|
|
751
|
-
return true;
|
|
545
|
+
return new AsyncQueryBusModuleProxy(params);
|
|
546
|
+
}
|
|
547
|
+
async unexposeHandler(id, options) {
|
|
548
|
+
const filterOptions = {
|
|
549
|
+
direction: options?.direction
|
|
550
|
+
};
|
|
551
|
+
const module = await super.resolve(id, filterOptions);
|
|
552
|
+
if (module) {
|
|
553
|
+
const host = assertEx3(this.busHost(), "Not configured as a host");
|
|
554
|
+
host.unexpose(module.address);
|
|
555
|
+
return [
|
|
556
|
+
module.address
|
|
557
|
+
];
|
|
558
|
+
}
|
|
559
|
+
return [];
|
|
752
560
|
}
|
|
753
561
|
busClient() {
|
|
754
|
-
if (!this._busClient) {
|
|
562
|
+
if (!this._busClient && this.config.client) {
|
|
755
563
|
this._busClient = new AsyncQueryBusClient({
|
|
756
564
|
config: this.config.client,
|
|
757
565
|
logger: this.logger,
|
|
@@ -761,7 +569,7 @@ var PubSubBridge = class extends AbstractBridge {
|
|
|
761
569
|
return this._busClient;
|
|
762
570
|
}
|
|
763
571
|
busHost() {
|
|
764
|
-
if (!this._busHost) {
|
|
572
|
+
if (!this._busHost && this.config.host) {
|
|
765
573
|
this._busHost = new AsyncQueryBusHost({
|
|
766
574
|
config: this.config.host,
|
|
767
575
|
logger: this.logger,
|
|
@@ -770,13 +578,12 @@ var PubSubBridge = class extends AbstractBridge {
|
|
|
770
578
|
}
|
|
771
579
|
return this._busHost;
|
|
772
580
|
}
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
return true;
|
|
581
|
+
startHandler() {
|
|
582
|
+
this.busHost()?.start();
|
|
583
|
+
return Promise.resolve(true);
|
|
777
584
|
}
|
|
778
585
|
stopHandler(_timeout) {
|
|
779
|
-
this.busHost()
|
|
586
|
+
this.busHost()?.stop();
|
|
780
587
|
return true;
|
|
781
588
|
}
|
|
782
589
|
};
|
|
@@ -784,7 +591,7 @@ PubSubBridge = _ts_decorate([
|
|
|
784
591
|
creatableModule()
|
|
785
592
|
], PubSubBridge);
|
|
786
593
|
export {
|
|
787
|
-
|
|
594
|
+
AbstractModuleHost,
|
|
788
595
|
AsyncQueryBusClient,
|
|
789
596
|
AsyncQueryBusHost,
|
|
790
597
|
AsyncQueryBusModuleHost,
|