@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/node/index.cjs
CHANGED
|
@@ -26,7 +26,7 @@ var __publicField = (obj, key, value) => {
|
|
|
26
26
|
// src/index.ts
|
|
27
27
|
var src_exports = {};
|
|
28
28
|
__export(src_exports, {
|
|
29
|
-
|
|
29
|
+
AbstractModuleHost: () => AbstractModuleHost,
|
|
30
30
|
AsyncQueryBusClient: () => AsyncQueryBusClient,
|
|
31
31
|
AsyncQueryBusHost: () => AsyncQueryBusHost,
|
|
32
32
|
AsyncQueryBusModuleHost: () => AsyncQueryBusModuleHost,
|
|
@@ -38,163 +38,12 @@ __export(src_exports, {
|
|
|
38
38
|
});
|
|
39
39
|
module.exports = __toCommonJS(src_exports);
|
|
40
40
|
|
|
41
|
-
// src/
|
|
42
|
-
var import_assert = require("@xylabs/assert");
|
|
43
|
-
var import_lodash = require("@xylabs/lodash");
|
|
41
|
+
// src/AbstractModuleHost/AbstractModuleHost.ts
|
|
44
42
|
var import_object = require("@xylabs/object");
|
|
45
|
-
var
|
|
46
|
-
var import_boundwitness_builder = require("@xyo-network/boundwitness-builder");
|
|
47
|
-
var import_boundwitness_wrapper = require("@xyo-network/boundwitness-wrapper");
|
|
48
|
-
var import_module_model = require("@xyo-network/module-model");
|
|
49
|
-
var import_payload_model = require("@xyo-network/payload-model");
|
|
50
|
-
var _AbstractModuleProxy = class _AbstractModuleProxy extends import_object.Base {
|
|
51
|
-
eventData = {};
|
|
52
|
-
proxyParams;
|
|
53
|
-
constructor(params) {
|
|
54
|
-
super({
|
|
55
|
-
config: {
|
|
56
|
-
schema: import_module_model.ModuleConfigSchema
|
|
57
|
-
}
|
|
58
|
-
});
|
|
59
|
-
this.proxyParams = params;
|
|
60
|
-
}
|
|
61
|
-
get account() {
|
|
62
|
-
return this.proxyParams.account;
|
|
63
|
-
}
|
|
64
|
-
get address() {
|
|
65
|
-
return this.proxyParams.moduleAddress;
|
|
66
|
-
}
|
|
67
|
-
get config() {
|
|
68
|
-
return this.params.config;
|
|
69
|
-
}
|
|
70
|
-
get downResolver() {
|
|
71
|
-
throw new Error("Unsupported");
|
|
72
|
-
}
|
|
73
|
-
get id() {
|
|
74
|
-
return this.proxyParams.moduleAddress;
|
|
75
|
-
}
|
|
76
|
-
get queries() {
|
|
77
|
-
return this.proxyParams.queries;
|
|
78
|
-
}
|
|
79
|
-
get upResolver() {
|
|
80
|
-
throw new Error("Unsupported");
|
|
81
|
-
}
|
|
82
|
-
static hasRequiredQueries(module2) {
|
|
83
|
-
return this.missingRequiredQueries(module2).length === 0;
|
|
84
|
-
}
|
|
85
|
-
static missingRequiredQueries(module2) {
|
|
86
|
-
const moduleQueries = module2.queries;
|
|
87
|
-
return (0, import_lodash.compact)(this.requiredQueries.map((query) => {
|
|
88
|
-
return moduleQueries.includes(query) ? null : query;
|
|
89
|
-
}));
|
|
90
|
-
}
|
|
91
|
-
async addressPreviousHash() {
|
|
92
|
-
const queryPayload = {
|
|
93
|
-
schema: import_module_model.ModuleAddressQuerySchema
|
|
94
|
-
};
|
|
95
|
-
return (0, import_assert.assertEx)((await this.sendQuery(queryPayload)).find((payload) => payload.schema === import_module_model.AddressPreviousHashSchema), "Result did not include correct payload");
|
|
96
|
-
}
|
|
97
|
-
clearListeners(_eventNames) {
|
|
98
|
-
throw new Error("Unsupported");
|
|
99
|
-
}
|
|
100
|
-
//TODO: Make ModuleDescription into real payload
|
|
101
|
-
async describe() {
|
|
102
|
-
const queryPayload = {
|
|
103
|
-
schema: import_module_model.ModuleDescribeQuerySchema
|
|
104
|
-
};
|
|
105
|
-
return (await this.sendQuery(queryPayload))[0];
|
|
106
|
-
}
|
|
107
|
-
async discover() {
|
|
108
|
-
const queryPayload = {
|
|
109
|
-
schema: import_module_model.ModuleDiscoverQuerySchema
|
|
110
|
-
};
|
|
111
|
-
return await this.sendQuery(queryPayload);
|
|
112
|
-
}
|
|
113
|
-
emit(_eventName, _eventArgs) {
|
|
114
|
-
throw new Error("Unsupported");
|
|
115
|
-
}
|
|
116
|
-
emitSerial(_eventName, _eventArgs) {
|
|
117
|
-
throw new Error("Unsupported");
|
|
118
|
-
}
|
|
119
|
-
listenerCount(_eventNames) {
|
|
120
|
-
throw new Error("Unsupported");
|
|
121
|
-
}
|
|
122
|
-
async manifest(maxDepth) {
|
|
123
|
-
const queryPayload = {
|
|
124
|
-
schema: import_module_model.ModuleManifestQuerySchema,
|
|
125
|
-
...maxDepth === void 0 ? {} : {
|
|
126
|
-
maxDepth
|
|
127
|
-
}
|
|
128
|
-
};
|
|
129
|
-
return (await this.sendQuery(queryPayload))[0];
|
|
130
|
-
}
|
|
131
|
-
async moduleAddress() {
|
|
132
|
-
const queryPayload = {
|
|
133
|
-
schema: import_module_model.ModuleAddressQuerySchema
|
|
134
|
-
};
|
|
135
|
-
return await this.sendQuery(queryPayload);
|
|
136
|
-
}
|
|
137
|
-
off(_eventNames, _listener) {
|
|
138
|
-
throw new Error("Unsupported");
|
|
139
|
-
}
|
|
140
|
-
offAny(_listener) {
|
|
141
|
-
throw new Error("Unsupported");
|
|
142
|
-
}
|
|
143
|
-
on(_eventNames, _listener) {
|
|
144
|
-
throw new Error("Unsupported");
|
|
145
|
-
}
|
|
146
|
-
onAny(_listener) {
|
|
147
|
-
throw new Error("Unsupported");
|
|
148
|
-
}
|
|
149
|
-
once(_eventName, _listener) {
|
|
150
|
-
throw new Error("Unsupported");
|
|
151
|
-
}
|
|
152
|
-
async previousHash() {
|
|
153
|
-
const queryPayload = {
|
|
154
|
-
schema: import_module_model.ModuleAddressQuerySchema
|
|
155
|
-
};
|
|
156
|
-
return (await this.sendQuery(queryPayload)).pop().previousHash;
|
|
157
|
-
}
|
|
158
|
-
queryable(_query, _payloads) {
|
|
159
|
-
return true;
|
|
160
|
-
}
|
|
161
|
-
resolve(nameOrAddressOrFilter, _options) {
|
|
162
|
-
return typeof nameOrAddressOrFilter === "string" ? void 0 : [];
|
|
163
|
-
}
|
|
164
|
-
state() {
|
|
165
|
-
return [];
|
|
166
|
-
}
|
|
167
|
-
bindQuery(query, payloads, account = this.account) {
|
|
168
|
-
const promise = new import_promise.PromiseEx(async (resolve) => {
|
|
169
|
-
const result = await this.bindQueryInternal(query, payloads, account);
|
|
170
|
-
resolve == null ? void 0 : resolve(result);
|
|
171
|
-
return result;
|
|
172
|
-
}, account);
|
|
173
|
-
return promise;
|
|
174
|
-
}
|
|
175
|
-
async bindQueryInternal(query, payloads, account = this.account) {
|
|
176
|
-
const builder = await new import_boundwitness_builder.QueryBoundWitnessBuilder().payloads(payloads).query(query);
|
|
177
|
-
const result = await (account ? builder.witness(account) : builder).build();
|
|
178
|
-
return result;
|
|
179
|
-
}
|
|
180
|
-
async filterErrors(result) {
|
|
181
|
-
const wrapper = await import_boundwitness_wrapper.BoundWitnessWrapper.wrap(result[0], result[1]);
|
|
182
|
-
return wrapper.payloadsBySchema(import_payload_model.ModuleErrorSchema);
|
|
183
|
-
}
|
|
184
|
-
async sendQuery(queryPayload, payloads) {
|
|
185
|
-
const query = await this.bindQuery(queryPayload, payloads);
|
|
186
|
-
const [, resultPayloads, errors] = await this.query(query[0], query[1]);
|
|
187
|
-
if (errors && errors.length > 0) {
|
|
188
|
-
throw errors[0];
|
|
189
|
-
}
|
|
190
|
-
return resultPayloads;
|
|
191
|
-
}
|
|
43
|
+
var _AbstractModuleHost = class _AbstractModuleHost extends import_object.Base {
|
|
192
44
|
};
|
|
193
|
-
__name(
|
|
194
|
-
|
|
195
|
-
import_module_model.ModuleDiscoverQuerySchema
|
|
196
|
-
]);
|
|
197
|
-
var AbstractModuleProxy = _AbstractModuleProxy;
|
|
45
|
+
__name(_AbstractModuleHost, "AbstractModuleHost");
|
|
46
|
+
var AbstractModuleHost = _AbstractModuleHost;
|
|
198
47
|
|
|
199
48
|
// src/AsyncQueryBus/AsyncQueryBusClient.ts
|
|
200
49
|
var import_delay = require("@xylabs/delay");
|
|
@@ -206,12 +55,13 @@ var import_payload_builder = require("@xyo-network/payload-builder");
|
|
|
206
55
|
var import_lru_cache2 = require("lru-cache");
|
|
207
56
|
|
|
208
57
|
// src/AsyncQueryBus/AsyncQueryBusBase.ts
|
|
209
|
-
var
|
|
58
|
+
var import_assert = require("@xylabs/assert");
|
|
210
59
|
var import_object2 = require("@xylabs/object");
|
|
211
60
|
var import_archivist_model = require("@xyo-network/archivist-model");
|
|
212
61
|
var import_diviner_model = require("@xyo-network/diviner-model");
|
|
213
62
|
var import_lru_cache = require("lru-cache");
|
|
214
63
|
var _AsyncQueryBusBase = class _AsyncQueryBusBase extends import_object2.Base {
|
|
64
|
+
_exposedAddresses = /* @__PURE__ */ new Set();
|
|
215
65
|
_lastState;
|
|
216
66
|
_targetConfigs = {};
|
|
217
67
|
_targetQueries = {};
|
|
@@ -239,34 +89,42 @@ var _AsyncQueryBusBase = class _AsyncQueryBusBase extends import_object2.Base {
|
|
|
239
89
|
this._lastState = this._lastState ?? new import_lru_cache.LRUCache(requiredConfig);
|
|
240
90
|
return this._lastState;
|
|
241
91
|
}
|
|
92
|
+
expose(address, validate = true) {
|
|
93
|
+
(0, import_assert.assertEx)(!validate || !this._exposedAddresses.has(address), () => `Address already exposed [${address}]`);
|
|
94
|
+
this._exposedAddresses.add(address);
|
|
95
|
+
}
|
|
242
96
|
async queriesArchivist() {
|
|
243
97
|
var _a, _b, _c;
|
|
244
|
-
return (0,
|
|
98
|
+
return (0, import_assert.assertEx)((0, import_archivist_model.asArchivistInstance)(await this.resolver.resolve((_c = (_b = (_a = this.config) == null ? void 0 : _a.intersect) == null ? void 0 : _b.queries) == null ? void 0 : _c.archivist)), () => {
|
|
245
99
|
var _a2, _b2, _c2;
|
|
246
|
-
return `Unable to resolve queriesArchivist [${(_c2 = (_b2 = (_a2 = this.config) == null ? void 0 : _a2.
|
|
100
|
+
return `Unable to resolve queriesArchivist [${(_c2 = (_b2 = (_a2 = this.config) == null ? void 0 : _a2.intersect) == null ? void 0 : _b2.queries) == null ? void 0 : _c2.archivist}]`;
|
|
247
101
|
});
|
|
248
102
|
}
|
|
249
103
|
async queriesDiviner() {
|
|
250
104
|
var _a, _b, _c;
|
|
251
|
-
return (0,
|
|
105
|
+
return (0, import_assert.assertEx)((0, import_diviner_model.asDivinerInstance)(await this.resolver.resolve((_c = (_b = (_a = this.config) == null ? void 0 : _a.intersect) == null ? void 0 : _b.queries) == null ? void 0 : _c.boundWitnessDiviner)), () => {
|
|
252
106
|
var _a2, _b2, _c2;
|
|
253
|
-
return `Unable to resolve queriesDiviner [${(_c2 = (_b2 = (_a2 = this.config) == null ? void 0 : _a2.
|
|
107
|
+
return `Unable to resolve queriesDiviner [${(_c2 = (_b2 = (_a2 = this.config) == null ? void 0 : _a2.intersect) == null ? void 0 : _b2.queries) == null ? void 0 : _c2.boundWitnessDiviner}]`;
|
|
254
108
|
});
|
|
255
109
|
}
|
|
256
110
|
async responsesArchivist() {
|
|
257
111
|
var _a, _b, _c;
|
|
258
|
-
return (0,
|
|
112
|
+
return (0, import_assert.assertEx)((0, import_archivist_model.asArchivistInstance)(await this.resolver.resolve((_c = (_b = (_a = this.config) == null ? void 0 : _a.intersect) == null ? void 0 : _b.responses) == null ? void 0 : _c.archivist)), () => {
|
|
259
113
|
var _a2, _b2, _c2;
|
|
260
|
-
return `Unable to resolve responsesArchivist [${(_c2 = (_b2 = (_a2 = this.config) == null ? void 0 : _a2.
|
|
114
|
+
return `Unable to resolve responsesArchivist [${(_c2 = (_b2 = (_a2 = this.config) == null ? void 0 : _a2.intersect) == null ? void 0 : _b2.responses) == null ? void 0 : _c2.archivist}]`;
|
|
261
115
|
});
|
|
262
116
|
}
|
|
263
117
|
async responsesDiviner() {
|
|
264
118
|
var _a, _b, _c;
|
|
265
|
-
return (0,
|
|
119
|
+
return (0, import_assert.assertEx)((0, import_diviner_model.asDivinerInstance)(await this.resolver.resolve((_c = (_b = (_a = this.config) == null ? void 0 : _a.intersect) == null ? void 0 : _b.responses) == null ? void 0 : _c.boundWitnessDiviner)), () => {
|
|
266
120
|
var _a2, _b2, _c2;
|
|
267
|
-
return `Unable to resolve responsesDiviner [${(_c2 = (_b2 = (_a2 = this.config) == null ? void 0 : _a2.
|
|
121
|
+
return `Unable to resolve responsesDiviner [${(_c2 = (_b2 = (_a2 = this.config) == null ? void 0 : _a2.intersect) == null ? void 0 : _b2.responses) == null ? void 0 : _c2.boundWitnessDiviner}]`;
|
|
268
122
|
});
|
|
269
123
|
}
|
|
124
|
+
unexpose(address, validate = true) {
|
|
125
|
+
(0, import_assert.assertEx)(!validate || this._exposedAddresses.has(address), () => `Address not exposed [${address}]`);
|
|
126
|
+
this._exposedAddresses.delete(address);
|
|
127
|
+
}
|
|
270
128
|
/**
|
|
271
129
|
* Commit the internal state of the process. This is similar
|
|
272
130
|
* to a transaction completion in a database and should only be called
|
|
@@ -301,7 +159,7 @@ var _AsyncQueryBusBase = class _AsyncQueryBusBase extends import_object2.Base {
|
|
|
301
159
|
__name(_AsyncQueryBusBase, "AsyncQueryBusBase");
|
|
302
160
|
var AsyncQueryBusBase = _AsyncQueryBusBase;
|
|
303
161
|
|
|
304
|
-
// src/AsyncQueryBus/
|
|
162
|
+
// src/AsyncQueryBus/model/QueryStatus.ts
|
|
305
163
|
var Pending = "pending";
|
|
306
164
|
|
|
307
165
|
// src/AsyncQueryBus/AsyncQueryBusClient.ts
|
|
@@ -492,11 +350,11 @@ var AsyncQueryBusClient = _AsyncQueryBusClient;
|
|
|
492
350
|
|
|
493
351
|
// src/AsyncQueryBus/AsyncQueryBusHost.ts
|
|
494
352
|
var import_array = require("@xylabs/array");
|
|
495
|
-
var
|
|
353
|
+
var import_assert2 = require("@xylabs/assert");
|
|
496
354
|
var import_timer2 = require("@xylabs/timer");
|
|
497
355
|
var import_boundwitness_model2 = require("@xyo-network/boundwitness-model");
|
|
498
356
|
var import_diviner_boundwitness_model2 = require("@xyo-network/diviner-boundwitness-model");
|
|
499
|
-
var
|
|
357
|
+
var import_module_model = require("@xyo-network/module-model");
|
|
500
358
|
var import_payload_builder2 = require("@xyo-network/payload-builder");
|
|
501
359
|
var _AsyncQueryBusHost = class _AsyncQueryBusHost extends AsyncQueryBusBase {
|
|
502
360
|
_pollId;
|
|
@@ -512,7 +370,7 @@ var _AsyncQueryBusHost = class _AsyncQueryBusHost extends AsyncQueryBusBase {
|
|
|
512
370
|
}
|
|
513
371
|
async listeningModules() {
|
|
514
372
|
var _a;
|
|
515
|
-
const mods = ((_a = this.config) == null ? void 0 : _a.listeningModules) ? await Promise.all(this.config.listeningModules.map(async (listeningModule) => (0,
|
|
373
|
+
const mods = ((_a = this.config) == null ? void 0 : _a.listeningModules) ? await Promise.all(this.config.listeningModules.map(async (listeningModule) => (0, import_assert2.assertEx)((0, import_module_model.asModuleInstance)(await this.resolver.resolve(listeningModule)), () => `Unable to resolve listeningModule [${listeningModule}]`))) : await this.resolver.resolve(void 0, {
|
|
516
374
|
direction: "down"
|
|
517
375
|
});
|
|
518
376
|
return mods;
|
|
@@ -536,38 +394,39 @@ var _AsyncQueryBusHost = class _AsyncQueryBusHost extends AsyncQueryBusBase {
|
|
|
536
394
|
const localModuleName = localModule.config.name ?? localModule.address;
|
|
537
395
|
const queryArchivist = await this.queriesArchivist();
|
|
538
396
|
const responseArchivist = await this.responsesArchivist();
|
|
539
|
-
const
|
|
540
|
-
if (
|
|
397
|
+
const queryDestination = (_a = query.$meta) == null ? void 0 : _a.destination;
|
|
398
|
+
if (queryDestination && (queryDestination == null ? void 0 : queryDestination.includes(localModule.address))) {
|
|
541
399
|
const queryIndex = query.payload_hashes.indexOf(query.query);
|
|
542
400
|
if (queryIndex !== -1) {
|
|
543
401
|
const querySchema = query.payload_schemas[queryIndex];
|
|
544
402
|
if (localModule.queries.includes(querySchema)) {
|
|
545
|
-
const
|
|
546
|
-
const
|
|
547
|
-
const
|
|
548
|
-
if (!(0, import_array.containsAll)(Object.keys(
|
|
549
|
-
(_b = this.logger) == null ? void 0 : _b.error(`Error processing command ${
|
|
403
|
+
const queryPayloads = await queryArchivist.get(query.payload_hashes);
|
|
404
|
+
const queryPayloadsDict = await import_payload_builder2.PayloadBuilder.toAllHashMap(queryPayloads);
|
|
405
|
+
const queryHash = (await import_payload_builder2.PayloadBuilder.build(query)).$hash;
|
|
406
|
+
if (!(0, import_array.containsAll)(Object.keys(queryPayloadsDict), query.payload_hashes)) {
|
|
407
|
+
(_b = this.logger) == null ? void 0 : _b.error(`Error processing command ${queryHash} for module ${localModuleName}, missing payloads`);
|
|
550
408
|
return;
|
|
551
409
|
}
|
|
552
410
|
try {
|
|
553
|
-
const
|
|
554
|
-
(_c = this.logger) == null ? void 0 : _c.debug(`Issuing
|
|
555
|
-
const response = await localModule.query(query,
|
|
411
|
+
const querySchema2 = queryPayloadsDict[query.query].schema;
|
|
412
|
+
(_c = this.logger) == null ? void 0 : _c.debug(`Issuing query ${querySchema2} (${queryHash}) addressed to module: ${localModuleName}`);
|
|
413
|
+
const response = await localModule.query(query, queryPayloads);
|
|
556
414
|
const [bw, payloads, errors] = response;
|
|
557
|
-
(_d = this.logger) == null ? void 0 : _d.debug(`Replying to
|
|
415
|
+
(_d = this.logger) == null ? void 0 : _d.debug(`Replying to query ${queryHash} addressed to module: ${localModuleName}`);
|
|
558
416
|
const insertResult = await responseArchivist.insert([
|
|
559
417
|
bw,
|
|
560
418
|
...payloads,
|
|
561
419
|
...errors
|
|
562
420
|
]);
|
|
563
421
|
if (insertResult.length === 0) {
|
|
564
|
-
(_e = this.logger) == null ? void 0 : _e.error(`Error replying to
|
|
422
|
+
(_e = this.logger) == null ? void 0 : _e.error(`Error replying to query ${queryHash} addressed to module: ${localModuleName}`);
|
|
565
423
|
}
|
|
566
424
|
if (query == null ? void 0 : query.timestamp) {
|
|
567
425
|
await this.commitState(localModule.address, query.timestamp);
|
|
568
426
|
}
|
|
569
427
|
} catch (error) {
|
|
570
|
-
(_f = this.logger) == null ? void 0 : _f.error(`Error processing
|
|
428
|
+
(_f = this.logger) == null ? void 0 : _f.error(`Error processing query ${queryHash} for module ${localModuleName}: ${error}`);
|
|
429
|
+
console.error(`Error processing query ${queryHash} for module ${localModuleName}: ${error}`);
|
|
571
430
|
}
|
|
572
431
|
}
|
|
573
432
|
}
|
|
@@ -619,26 +478,26 @@ var _AsyncQueryBusHost = class _AsyncQueryBusHost extends AsyncQueryBusBase {
|
|
|
619
478
|
}, this.pollFrequencyConfig);
|
|
620
479
|
}
|
|
621
480
|
/**
|
|
622
|
-
* Background process for checking for inbound
|
|
481
|
+
* Background process for checking for inbound queries
|
|
623
482
|
*/
|
|
624
483
|
processIncomingQueries = async () => {
|
|
625
484
|
var _a;
|
|
626
|
-
(_a = this.logger) == null ? void 0 : _a.debug("Checking for inbound
|
|
485
|
+
(_a = this.logger) == null ? void 0 : _a.debug("Checking for inbound queries");
|
|
627
486
|
const localModules = await this.listeningModules();
|
|
628
487
|
await Promise.allSettled(localModules.map(async (localModule) => {
|
|
629
488
|
var _a2, _b, _c;
|
|
630
489
|
try {
|
|
631
490
|
const localModuleName = localModule.config.name ?? localModule.address;
|
|
632
|
-
(_a2 = this.logger) == null ? void 0 : _a2.debug(`Checking for inbound
|
|
491
|
+
(_a2 = this.logger) == null ? void 0 : _a2.debug(`Checking for inbound queries to ${localModuleName}`);
|
|
633
492
|
const queries = await this.findQueriesToAddress(localModule.address);
|
|
634
493
|
if (queries.length === 0)
|
|
635
494
|
return;
|
|
636
|
-
(_b = this.logger) == null ? void 0 : _b.debug(`Found
|
|
495
|
+
(_b = this.logger) == null ? void 0 : _b.debug(`Found queries addressed to local module: ${localModuleName}`);
|
|
637
496
|
for (const query of queries) {
|
|
638
497
|
await this.callLocalModule(localModule, query);
|
|
639
498
|
}
|
|
640
499
|
} catch (error) {
|
|
641
|
-
(_c = this.logger) == null ? void 0 : _c.error(`Error processing
|
|
500
|
+
(_c = this.logger) == null ? void 0 : _c.error(`Error processing queries for address ${localModule.address}: ${error}`);
|
|
642
501
|
}
|
|
643
502
|
}));
|
|
644
503
|
};
|
|
@@ -646,13 +505,6 @@ var _AsyncQueryBusHost = class _AsyncQueryBusHost extends AsyncQueryBusBase {
|
|
|
646
505
|
__name(_AsyncQueryBusHost, "AsyncQueryBusHost");
|
|
647
506
|
var AsyncQueryBusHost = _AsyncQueryBusHost;
|
|
648
507
|
|
|
649
|
-
// src/AbstractModuleHost/AbstractModuleHost.ts
|
|
650
|
-
var import_object3 = require("@xylabs/object");
|
|
651
|
-
var _AbstractModuleHost = class _AbstractModuleHost extends import_object3.Base {
|
|
652
|
-
};
|
|
653
|
-
__name(_AbstractModuleHost, "AbstractModuleHost");
|
|
654
|
-
var AbstractModuleHost = _AbstractModuleHost;
|
|
655
|
-
|
|
656
508
|
// src/AsyncQueryBus/ModuleHost/ModuleHost.ts
|
|
657
509
|
var _AsyncQueryBusModuleHost = class _AsyncQueryBusModuleHost extends AbstractModuleHost {
|
|
658
510
|
_busHost;
|
|
@@ -683,9 +535,10 @@ __name(_AsyncQueryBusModuleHost, "AsyncQueryBusModuleHost");
|
|
|
683
535
|
var AsyncQueryBusModuleHost = _AsyncQueryBusModuleHost;
|
|
684
536
|
|
|
685
537
|
// src/AsyncQueryBus/ModuleProxy/ModuleProxy.ts
|
|
686
|
-
var
|
|
538
|
+
var import_abstract_bridge = require("@xyo-network/abstract-bridge");
|
|
539
|
+
var _AsyncQueryBusModuleProxy = class _AsyncQueryBusModuleProxy extends import_abstract_bridge.AbstractModuleProxy {
|
|
687
540
|
async query(query, payloads) {
|
|
688
|
-
return await this.proxyParams.
|
|
541
|
+
return await this.proxyParams.busClient.send(this.address, query, payloads);
|
|
689
542
|
}
|
|
690
543
|
};
|
|
691
544
|
__name(_AsyncQueryBusModuleProxy, "AsyncQueryBusModuleProxy");
|
|
@@ -698,12 +551,10 @@ var PubSubBridgeSchema = "network.xyo.bridge.pubsub";
|
|
|
698
551
|
var PubSubBridgeConfigSchema = `${PubSubBridgeSchema}.config`;
|
|
699
552
|
|
|
700
553
|
// src/PubSubBridge.ts
|
|
701
|
-
var
|
|
702
|
-
var
|
|
703
|
-
var
|
|
704
|
-
var
|
|
705
|
-
var import_payload_model2 = require("@xyo-network/payload-model");
|
|
706
|
-
var import_lru_cache3 = require("lru-cache");
|
|
554
|
+
var import_assert3 = require("@xylabs/assert");
|
|
555
|
+
var import_abstract_bridge2 = require("@xyo-network/abstract-bridge");
|
|
556
|
+
var import_account = require("@xyo-network/account");
|
|
557
|
+
var import_module_model2 = require("@xyo-network/module-model");
|
|
707
558
|
function _ts_decorate(decorators, target, key, desc) {
|
|
708
559
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
709
560
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
@@ -716,99 +567,56 @@ function _ts_decorate(decorators, target, key, desc) {
|
|
|
716
567
|
}
|
|
717
568
|
__name(_ts_decorate, "_ts_decorate");
|
|
718
569
|
var moduleName = "PubSubBridge";
|
|
719
|
-
var _PubSubBridge = class _PubSubBridge extends
|
|
570
|
+
var _PubSubBridge = class _PubSubBridge extends import_abstract_bridge2.AbstractBridge {
|
|
720
571
|
_configRootAddress = "";
|
|
721
572
|
_configStateStoreArchivist = "";
|
|
722
573
|
_configStateStoreBoundWitnessDiviner = "";
|
|
723
|
-
|
|
574
|
+
_exposedAddresses = [];
|
|
724
575
|
_lastState;
|
|
725
|
-
_targetConfigs = {};
|
|
726
|
-
_targetQueries = {};
|
|
727
576
|
_busClient;
|
|
728
577
|
_busHost;
|
|
729
|
-
get discoverCache() {
|
|
730
|
-
const config = this.discoverCacheConfig;
|
|
731
|
-
this._discoverCache = this._discoverCache ?? new import_lru_cache3.LRUCache({
|
|
732
|
-
ttlAutopurge: true,
|
|
733
|
-
...config
|
|
734
|
-
});
|
|
735
|
-
return this._discoverCache;
|
|
736
|
-
}
|
|
737
|
-
get discoverCacheConfig() {
|
|
738
|
-
const discoverCacheConfig = this.config.discoverCache === true ? {} : this.config.discoverCache;
|
|
739
|
-
return {
|
|
740
|
-
max: 100,
|
|
741
|
-
ttl: 1e3 * 60 * 5,
|
|
742
|
-
...discoverCacheConfig
|
|
743
|
-
};
|
|
744
|
-
}
|
|
745
578
|
get moduleName() {
|
|
746
579
|
return `${this.config.name ?? moduleName}`;
|
|
747
580
|
}
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
return true;
|
|
760
|
-
}
|
|
761
|
-
async disconnect() {
|
|
762
|
-
await Promise.resolve();
|
|
763
|
-
this.connected = false;
|
|
764
|
-
return true;
|
|
765
|
-
}
|
|
766
|
-
getRootAddress() {
|
|
767
|
-
return this.rootAddress;
|
|
768
|
-
}
|
|
769
|
-
targetConfig(address) {
|
|
770
|
-
return (0, import_assert4.assertEx)(this._targetConfigs[address], () => `targetConfig not set [${address}]`);
|
|
771
|
-
}
|
|
772
|
-
async targetDiscover(address, _maxDepth) {
|
|
773
|
-
var _a, _b;
|
|
774
|
-
if (!this.connected)
|
|
775
|
-
throw new Error("Not connected");
|
|
776
|
-
const cachedResult = (_a = this.discoverCache) == null ? void 0 : _a.get(address ?? "root ");
|
|
777
|
-
if (cachedResult) {
|
|
778
|
-
return cachedResult;
|
|
581
|
+
async exposeHandler(id, options) {
|
|
582
|
+
const filterOptions = {
|
|
583
|
+
direction: options == null ? void 0 : options.direction
|
|
584
|
+
};
|
|
585
|
+
const module2 = await super.resolve(id, filterOptions);
|
|
586
|
+
if (module2) {
|
|
587
|
+
const host = (0, import_assert3.assertEx)(this.busHost(), "Not configured as a host");
|
|
588
|
+
host.expose(module2.address);
|
|
589
|
+
return [
|
|
590
|
+
module2.address
|
|
591
|
+
];
|
|
779
592
|
}
|
|
780
|
-
await this.started("throw");
|
|
781
|
-
const addressToDiscover = address ?? await this.getRootAddress();
|
|
782
|
-
(_b = this.logger) == null ? void 0 : _b.debug(`${this.moduleName}: Begin issuing targetDiscover to: ${addressToDiscover}`);
|
|
783
593
|
return [];
|
|
784
594
|
}
|
|
785
|
-
|
|
786
|
-
const
|
|
787
|
-
const
|
|
788
|
-
|
|
789
|
-
|
|
595
|
+
resolveHandler(id, _options) {
|
|
596
|
+
const account = import_account.Account.randomSync();
|
|
597
|
+
const params = {
|
|
598
|
+
account,
|
|
599
|
+
busClient: (0, import_assert3.assertEx)(this.busClient(), "Bus client not initialized"),
|
|
600
|
+
moduleAddress: id
|
|
790
601
|
};
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
return
|
|
806
|
-
}
|
|
807
|
-
targetQueryable(_address, _query, _payloads, _queryConfig) {
|
|
808
|
-
return true;
|
|
602
|
+
return new AsyncQueryBusModuleProxy(params);
|
|
603
|
+
}
|
|
604
|
+
async unexposeHandler(id, options) {
|
|
605
|
+
const filterOptions = {
|
|
606
|
+
direction: options == null ? void 0 : options.direction
|
|
607
|
+
};
|
|
608
|
+
const module2 = await super.resolve(id, filterOptions);
|
|
609
|
+
if (module2) {
|
|
610
|
+
const host = (0, import_assert3.assertEx)(this.busHost(), "Not configured as a host");
|
|
611
|
+
host.unexpose(module2.address);
|
|
612
|
+
return [
|
|
613
|
+
module2.address
|
|
614
|
+
];
|
|
615
|
+
}
|
|
616
|
+
return [];
|
|
809
617
|
}
|
|
810
618
|
busClient() {
|
|
811
|
-
if (!this._busClient) {
|
|
619
|
+
if (!this._busClient && this.config.client) {
|
|
812
620
|
this._busClient = new AsyncQueryBusClient({
|
|
813
621
|
config: this.config.client,
|
|
814
622
|
logger: this.logger,
|
|
@@ -818,7 +626,7 @@ var _PubSubBridge = class _PubSubBridge extends import_abstract_bridge.AbstractB
|
|
|
818
626
|
return this._busClient;
|
|
819
627
|
}
|
|
820
628
|
busHost() {
|
|
821
|
-
if (!this._busHost) {
|
|
629
|
+
if (!this._busHost && this.config.host) {
|
|
822
630
|
this._busHost = new AsyncQueryBusHost({
|
|
823
631
|
config: this.config.host,
|
|
824
632
|
logger: this.logger,
|
|
@@ -827,13 +635,14 @@ var _PubSubBridge = class _PubSubBridge extends import_abstract_bridge.AbstractB
|
|
|
827
635
|
}
|
|
828
636
|
return this._busHost;
|
|
829
637
|
}
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
this.busHost().start();
|
|
833
|
-
return true;
|
|
638
|
+
startHandler() {
|
|
639
|
+
var _a;
|
|
640
|
+
(_a = this.busHost()) == null ? void 0 : _a.start();
|
|
641
|
+
return Promise.resolve(true);
|
|
834
642
|
}
|
|
835
643
|
stopHandler(_timeout) {
|
|
836
|
-
|
|
644
|
+
var _a;
|
|
645
|
+
(_a = this.busHost()) == null ? void 0 : _a.stop();
|
|
837
646
|
return true;
|
|
838
647
|
}
|
|
839
648
|
};
|
|
@@ -843,11 +652,11 @@ __publicField(_PubSubBridge, "configSchemas", [
|
|
|
843
652
|
]);
|
|
844
653
|
var PubSubBridge = _PubSubBridge;
|
|
845
654
|
PubSubBridge = _ts_decorate([
|
|
846
|
-
(0,
|
|
655
|
+
(0, import_module_model2.creatableModule)()
|
|
847
656
|
], PubSubBridge);
|
|
848
657
|
// Annotate the CommonJS export names for ESM import in node:
|
|
849
658
|
0 && (module.exports = {
|
|
850
|
-
|
|
659
|
+
AbstractModuleHost,
|
|
851
660
|
AsyncQueryBusClient,
|
|
852
661
|
AsyncQueryBusHost,
|
|
853
662
|
AsyncQueryBusModuleHost,
|