@xyo-network/bridge-pub-sub 2.91.2 → 2.91.3
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 +1 -1
- package/dist/browser/AsyncQueryBus/AsyncQueryBusBase.d.cts.map +1 -1
- package/dist/browser/AsyncQueryBus/AsyncQueryBusBase.d.mts +1 -1
- package/dist/browser/AsyncQueryBus/AsyncQueryBusBase.d.mts.map +1 -1
- package/dist/browser/AsyncQueryBus/AsyncQueryBusBase.d.ts +1 -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 +1 -1
- package/dist/browser/AsyncQueryBus/AsyncQueryBusHost.d.cts.map +1 -1
- package/dist/browser/AsyncQueryBus/AsyncQueryBusHost.d.mts +1 -1
- package/dist/browser/AsyncQueryBus/AsyncQueryBusHost.d.mts.map +1 -1
- package/dist/browser/AsyncQueryBus/AsyncQueryBusHost.d.ts +1 -1
- 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 +1 -1
- package/dist/browser/AsyncQueryBus/ModuleProxy/ModuleProxy.d.cts.map +1 -1
- package/dist/browser/AsyncQueryBus/ModuleProxy/ModuleProxy.d.mts +1 -1
- package/dist/browser/AsyncQueryBus/ModuleProxy/ModuleProxy.d.mts.map +1 -1
- package/dist/browser/AsyncQueryBus/ModuleProxy/ModuleProxy.d.ts +1 -1
- 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 +10 -15
- package/dist/browser/PubSubBridge.d.cts.map +1 -1
- package/dist/browser/PubSubBridge.d.mts +10 -15
- package/dist/browser/PubSubBridge.d.mts.map +1 -1
- package/dist/browser/PubSubBridge.d.ts +10 -15
- package/dist/browser/PubSubBridge.d.ts.map +1 -1
- package/dist/browser/index.cjs +47 -65
- package/dist/browser/index.cjs.map +1 -1
- package/dist/browser/index.js +48 -66
- package/dist/browser/index.js.map +1 -1
- package/dist/node/AsyncQueryBus/AsyncQueryBusBase.d.cts +1 -1
- package/dist/node/AsyncQueryBus/AsyncQueryBusBase.d.cts.map +1 -1
- package/dist/node/AsyncQueryBus/AsyncQueryBusBase.d.mts +1 -1
- package/dist/node/AsyncQueryBus/AsyncQueryBusBase.d.mts.map +1 -1
- package/dist/node/AsyncQueryBus/AsyncQueryBusBase.d.ts +1 -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 +1 -1
- package/dist/node/AsyncQueryBus/AsyncQueryBusHost.d.cts.map +1 -1
- package/dist/node/AsyncQueryBus/AsyncQueryBusHost.d.mts +1 -1
- package/dist/node/AsyncQueryBus/AsyncQueryBusHost.d.mts.map +1 -1
- package/dist/node/AsyncQueryBus/AsyncQueryBusHost.d.ts +1 -1
- 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 +1 -1
- package/dist/node/AsyncQueryBus/ModuleProxy/ModuleProxy.d.cts.map +1 -1
- package/dist/node/AsyncQueryBus/ModuleProxy/ModuleProxy.d.mts +1 -1
- package/dist/node/AsyncQueryBus/ModuleProxy/ModuleProxy.d.mts.map +1 -1
- package/dist/node/AsyncQueryBus/ModuleProxy/ModuleProxy.d.ts +1 -1
- 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 +10 -15
- package/dist/node/PubSubBridge.d.cts.map +1 -1
- package/dist/node/PubSubBridge.d.mts +10 -15
- package/dist/node/PubSubBridge.d.mts.map +1 -1
- package/dist/node/PubSubBridge.d.ts +10 -15
- package/dist/node/PubSubBridge.d.ts.map +1 -1
- package/dist/node/index.cjs +53 -70
- package/dist/node/index.cjs.map +1 -1
- package/dist/node/index.js +54 -71
- package/dist/node/index.js.map +1 -1
- package/package.json +30 -30
- package/src/AsyncQueryBus/AsyncQueryBusBase.ts +9 -9
- package/src/AsyncQueryBus/AsyncQueryBusClient.ts +1 -2
- package/src/AsyncQueryBus/AsyncQueryBusHost.ts +1 -1
- package/src/AsyncQueryBus/ModuleHost/ModuleHost.ts +1 -1
- package/src/AsyncQueryBus/ModuleProxy/ModuleProxy.ts +2 -2
- 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 +57 -117
- 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/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/AsyncQueryBus/Config.ts +0 -62
package/package.json
CHANGED
|
@@ -10,40 +10,40 @@
|
|
|
10
10
|
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/issues"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@xylabs/array": "^3.0.
|
|
14
|
-
"@xylabs/assert": "^3.0.
|
|
15
|
-
"@xylabs/delay": "^3.0.
|
|
16
|
-
"@xylabs/forget": "^3.0.
|
|
17
|
-
"@xylabs/hex": "^3.0.
|
|
18
|
-
"@xylabs/lodash": "^3.0.
|
|
19
|
-
"@xylabs/object": "^3.0.
|
|
20
|
-
"@xylabs/promise": "^3.0.
|
|
21
|
-
"@xylabs/timer": "^3.0.
|
|
22
|
-
"@xyo-network/abstract-bridge": "~2.91.
|
|
23
|
-
"@xyo-network/account-model": "~2.91.
|
|
24
|
-
"@xyo-network/archivist-model": "~2.91.
|
|
25
|
-
"@xyo-network/boundwitness-builder": "~2.91.
|
|
26
|
-
"@xyo-network/boundwitness-model": "~2.91.
|
|
27
|
-
"@xyo-network/boundwitness-wrapper": "~2.91.
|
|
28
|
-
"@xyo-network/bridge-model": "~2.91.
|
|
29
|
-
"@xyo-network/diviner-boundwitness-model": "~2.91.
|
|
30
|
-
"@xyo-network/diviner-model": "~2.91.
|
|
31
|
-
"@xyo-network/manifest-model": "~2.91.
|
|
32
|
-
"@xyo-network/module-events": "~2.91.
|
|
33
|
-
"@xyo-network/module-model": "~2.91.
|
|
34
|
-
"@xyo-network/payload-builder": "~2.91.
|
|
35
|
-
"@xyo-network/payload-model": "~2.91.
|
|
13
|
+
"@xylabs/array": "^3.0.5",
|
|
14
|
+
"@xylabs/assert": "^3.0.5",
|
|
15
|
+
"@xylabs/delay": "^3.0.5",
|
|
16
|
+
"@xylabs/forget": "^3.0.5",
|
|
17
|
+
"@xylabs/hex": "^3.0.5",
|
|
18
|
+
"@xylabs/lodash": "^3.0.5",
|
|
19
|
+
"@xylabs/object": "^3.0.5",
|
|
20
|
+
"@xylabs/promise": "^3.0.5",
|
|
21
|
+
"@xylabs/timer": "^3.0.5",
|
|
22
|
+
"@xyo-network/abstract-bridge": "~2.91.3",
|
|
23
|
+
"@xyo-network/account-model": "~2.91.3",
|
|
24
|
+
"@xyo-network/archivist-model": "~2.91.3",
|
|
25
|
+
"@xyo-network/boundwitness-builder": "~2.91.3",
|
|
26
|
+
"@xyo-network/boundwitness-model": "~2.91.3",
|
|
27
|
+
"@xyo-network/boundwitness-wrapper": "~2.91.3",
|
|
28
|
+
"@xyo-network/bridge-model": "~2.91.3",
|
|
29
|
+
"@xyo-network/diviner-boundwitness-model": "~2.91.3",
|
|
30
|
+
"@xyo-network/diviner-model": "~2.91.3",
|
|
31
|
+
"@xyo-network/manifest-model": "~2.91.3",
|
|
32
|
+
"@xyo-network/module-events": "~2.91.3",
|
|
33
|
+
"@xyo-network/module-model": "~2.91.3",
|
|
34
|
+
"@xyo-network/payload-builder": "~2.91.3",
|
|
35
|
+
"@xyo-network/payload-model": "~2.91.3",
|
|
36
36
|
"lru-cache": "^10.2.0"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@xylabs/ts-scripts-yarn3": "^3.4.1",
|
|
40
40
|
"@xylabs/tsconfig": "^3.4.1",
|
|
41
|
-
"@xyo-network/account": "~2.91.
|
|
42
|
-
"@xyo-network/archivist-memory": "~2.91.
|
|
43
|
-
"@xyo-network/boundwitness-builder": "~2.91.
|
|
44
|
-
"@xyo-network/diviner-boundwitness-memory": "~2.91.
|
|
45
|
-
"@xyo-network/module-abstract": "~2.91.
|
|
46
|
-
"@xyo-network/node-memory": "~2.91.
|
|
41
|
+
"@xyo-network/account": "~2.91.3",
|
|
42
|
+
"@xyo-network/archivist-memory": "~2.91.3",
|
|
43
|
+
"@xyo-network/boundwitness-builder": "~2.91.3",
|
|
44
|
+
"@xyo-network/diviner-boundwitness-memory": "~2.91.3",
|
|
45
|
+
"@xyo-network/module-abstract": "~2.91.3",
|
|
46
|
+
"@xyo-network/node-memory": "~2.91.3",
|
|
47
47
|
"typescript": "^5.3.3"
|
|
48
48
|
},
|
|
49
49
|
"description": "Primary SDK for using XYO Protocol 2.0",
|
|
@@ -85,6 +85,6 @@
|
|
|
85
85
|
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js.git"
|
|
86
86
|
},
|
|
87
87
|
"sideEffects": false,
|
|
88
|
-
"version": "2.91.
|
|
88
|
+
"version": "2.91.3",
|
|
89
89
|
"type": "module"
|
|
90
90
|
}
|
|
@@ -8,7 +8,7 @@ import { asDivinerInstance, DivinerInstance } from '@xyo-network/diviner-model'
|
|
|
8
8
|
import { ModuleConfig } from '@xyo-network/module-model'
|
|
9
9
|
import { LRUCache } from 'lru-cache'
|
|
10
10
|
|
|
11
|
-
import { AsyncQueryBusParams } from './
|
|
11
|
+
import { AsyncQueryBusParams } from './model'
|
|
12
12
|
|
|
13
13
|
export class AsyncQueryBusBase<TParams extends AsyncQueryBusParams = AsyncQueryBusParams> extends Base<TParams> {
|
|
14
14
|
protected _lastState?: LRUCache<Address, number>
|
|
@@ -42,29 +42,29 @@ export class AsyncQueryBusBase<TParams extends AsyncQueryBusParams = AsyncQueryB
|
|
|
42
42
|
|
|
43
43
|
async queriesArchivist() {
|
|
44
44
|
return assertEx(
|
|
45
|
-
asArchivistInstance(await this.resolver.resolve(this.config?.
|
|
46
|
-
() => `Unable to resolve queriesArchivist [${this.config?.
|
|
45
|
+
asArchivistInstance(await this.resolver.resolve(this.config?.intersect?.queries?.archivist)),
|
|
46
|
+
() => `Unable to resolve queriesArchivist [${this.config?.intersect?.queries?.archivist}]`,
|
|
47
47
|
)
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
async queriesDiviner() {
|
|
51
51
|
return assertEx(
|
|
52
|
-
asDivinerInstance(await this.resolver.resolve(this.config?.
|
|
53
|
-
() => `Unable to resolve queriesDiviner [${this.config?.
|
|
52
|
+
asDivinerInstance(await this.resolver.resolve(this.config?.intersect?.queries?.boundWitnessDiviner)),
|
|
53
|
+
() => `Unable to resolve queriesDiviner [${this.config?.intersect?.queries?.boundWitnessDiviner}]`,
|
|
54
54
|
) as DivinerInstance<BoundWitnessDivinerParams, BoundWitnessDivinerQueryPayload, QueryBoundWitness>
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
async responsesArchivist() {
|
|
58
58
|
return assertEx(
|
|
59
|
-
asArchivistInstance(await this.resolver.resolve(this.config?.
|
|
60
|
-
() => `Unable to resolve responsesArchivist [${this.config?.
|
|
59
|
+
asArchivistInstance(await this.resolver.resolve(this.config?.intersect?.responses?.archivist)),
|
|
60
|
+
() => `Unable to resolve responsesArchivist [${this.config?.intersect?.responses?.archivist}]`,
|
|
61
61
|
)
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
async responsesDiviner() {
|
|
65
65
|
return assertEx(
|
|
66
|
-
asDivinerInstance(await this.resolver.resolve(this.config?.
|
|
67
|
-
() => `Unable to resolve responsesDiviner [${this.config?.
|
|
66
|
+
asDivinerInstance(await this.resolver.resolve(this.config?.intersect?.responses?.boundWitnessDiviner)),
|
|
67
|
+
() => `Unable to resolve responsesDiviner [${this.config?.intersect?.responses?.boundWitnessDiviner}]`,
|
|
68
68
|
) as DivinerInstance<BoundWitnessDivinerParams, BoundWitnessDivinerQueryPayload, BoundWitness>
|
|
69
69
|
}
|
|
70
70
|
|
|
@@ -11,8 +11,7 @@ import { ModuleError, Payload, PayloadWithMeta, WithMeta } from '@xyo-network/pa
|
|
|
11
11
|
import { LRUCache } from 'lru-cache'
|
|
12
12
|
|
|
13
13
|
import { AsyncQueryBusBase } from './AsyncQueryBusBase'
|
|
14
|
-
import { Pending } from './
|
|
15
|
-
import { AsyncQueryBusClientParams } from './Params'
|
|
14
|
+
import { AsyncQueryBusClientParams, Pending } from './model'
|
|
16
15
|
|
|
17
16
|
export class AsyncQueryBusClient<TParams extends AsyncQueryBusClientParams = AsyncQueryBusClientParams> extends AsyncQueryBusBase<TParams> {
|
|
18
17
|
protected _queryCache?: LRUCache<Address, Pending | ModuleQueryResult>
|
|
@@ -9,7 +9,7 @@ import { PayloadBuilder } from '@xyo-network/payload-builder'
|
|
|
9
9
|
import { WithMeta } from '@xyo-network/payload-model'
|
|
10
10
|
|
|
11
11
|
import { AsyncQueryBusBase } from './AsyncQueryBusBase'
|
|
12
|
-
import { AsyncQueryBusHostParams } from './
|
|
12
|
+
import { AsyncQueryBusHostParams } from './model'
|
|
13
13
|
|
|
14
14
|
export class AsyncQueryBusHost<TParams extends AsyncQueryBusHostParams = AsyncQueryBusHostParams> extends AsyncQueryBusBase<TParams> {
|
|
15
15
|
private _pollId?: string
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AbstractModuleHost, ModuleHostParams } from '../../AbstractModuleHost'
|
|
2
2
|
import { AsyncQueryBusHost } from '../AsyncQueryBusHost'
|
|
3
|
-
import { AsyncQueryBusHostConfig } from '../
|
|
3
|
+
import { AsyncQueryBusHostConfig } from '../model/HostConfig'
|
|
4
4
|
|
|
5
5
|
export type AsyncQueryBusModuleHostParams = ModuleHostParams & {
|
|
6
6
|
config: AsyncQueryBusHostConfig
|
|
@@ -6,7 +6,7 @@ import { AbstractModuleProxy, ModuleProxyParams } from '../../AbstractModuleProx
|
|
|
6
6
|
import { AsyncQueryBusClient } from '../AsyncQueryBusClient'
|
|
7
7
|
|
|
8
8
|
export type AsyncQueryBusModuleProxyParams = ModuleProxyParams & {
|
|
9
|
-
|
|
9
|
+
busClient: AsyncQueryBusClient
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
export class AsyncQueryBusModuleProxy<TWrappedModule extends Module = Module>
|
|
@@ -14,6 +14,6 @@ export class AsyncQueryBusModuleProxy<TWrappedModule extends Module = Module>
|
|
|
14
14
|
implements ModuleInstance<TWrappedModule['params'], TWrappedModule['eventData']>
|
|
15
15
|
{
|
|
16
16
|
async query<T extends QueryBoundWitness = QueryBoundWitness>(query: T, payloads?: Payload[]): Promise<ModuleQueryResult> {
|
|
17
|
-
return await this.proxyParams.
|
|
17
|
+
return await this.proxyParams.busClient.send(this.address, query, payloads)
|
|
18
18
|
}
|
|
19
19
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { AsyncQueryBusIntersectConfig } from './IntersectConfig'
|
|
2
|
+
import { SearchableStorage } from './SearchableStorage'
|
|
3
|
+
|
|
4
|
+
export interface AsyncQueryBusBaseConfig {
|
|
5
|
+
intersect?: AsyncQueryBusIntersectConfig
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* How often to poll for new queries/responses
|
|
9
|
+
*/
|
|
10
|
+
pollFrequency?: number
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Where the archivist should persist its internal state
|
|
14
|
+
*/
|
|
15
|
+
stateStore?: SearchableStorage
|
|
16
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { CacheConfig } from '@xyo-network/bridge-model'
|
|
2
|
+
|
|
3
|
+
import { AsyncQueryBusBaseConfig } from './BaseConfig'
|
|
4
|
+
|
|
5
|
+
export interface AsyncQueryBusClientConfig extends AsyncQueryBusBaseConfig {
|
|
6
|
+
/**
|
|
7
|
+
* Configuration for intermediary response storage
|
|
8
|
+
*/
|
|
9
|
+
queryCache?: CacheConfig | true
|
|
10
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { AsyncQueryBusBaseConfig } from './BaseConfig'
|
|
2
|
+
|
|
3
|
+
export interface AsyncQueryBusHostConfig extends AsyncQueryBusBaseConfig {
|
|
4
|
+
/**
|
|
5
|
+
* Modules that should be exposed via this host
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
listeningModules?: string[]
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* How many queries to process at once when retrieving queries
|
|
12
|
+
* for an address
|
|
13
|
+
*/
|
|
14
|
+
perAddressBatchQueryLimit?: number
|
|
15
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { SearchableStorage } from './SearchableStorage'
|
|
2
|
+
|
|
3
|
+
export interface AsyncQueryBusIntersectConfig {
|
|
4
|
+
/**
|
|
5
|
+
* Configuration for intermediary query storage
|
|
6
|
+
*/
|
|
7
|
+
queries?: SearchableStorage
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Configuration for intermediary response storage
|
|
11
|
+
*/
|
|
12
|
+
responses?: SearchableStorage
|
|
13
|
+
}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { BaseParams } from '@xylabs/object'
|
|
2
2
|
import { ModuleResolver } from '@xyo-network/module-model'
|
|
3
3
|
|
|
4
|
-
import { AsyncQueryBusBaseConfig
|
|
4
|
+
import { AsyncQueryBusBaseConfig } from './BaseConfig'
|
|
5
|
+
import { AsyncQueryBusClientConfig } from './ClientConfig'
|
|
6
|
+
import { AsyncQueryBusHostConfig } from './HostConfig'
|
|
5
7
|
|
|
6
8
|
export type AsyncQueryBusParams<TConfig extends AsyncQueryBusBaseConfig = AsyncQueryBusBaseConfig> = BaseParams<{
|
|
7
9
|
config?: TConfig
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ModuleIdentifier } from '@xyo-network/module-model'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Configuration for searchable storage of local state
|
|
5
|
+
*/
|
|
6
|
+
export interface SearchableStorage {
|
|
7
|
+
/**
|
|
8
|
+
* Name/Address of the archivist where intermediate communications are stored
|
|
9
|
+
*/
|
|
10
|
+
archivist: ModuleIdentifier
|
|
11
|
+
/**
|
|
12
|
+
* Name/Address of the diviner where intermediate communications are filtered
|
|
13
|
+
*/
|
|
14
|
+
boundWitnessDiviner: ModuleIdentifier
|
|
15
|
+
}
|
package/src/PubSubBridge.ts
CHANGED
|
@@ -1,21 +1,35 @@
|
|
|
1
1
|
import { assertEx } from '@xylabs/assert'
|
|
2
|
-
import {
|
|
2
|
+
import { forget } from '@xylabs/forget'
|
|
3
|
+
import { Address, isAddress } from '@xylabs/hex'
|
|
4
|
+
import { compact } from '@xylabs/lodash'
|
|
5
|
+
import { Promisable } from '@xylabs/promise'
|
|
3
6
|
import { AbstractBridge } from '@xyo-network/abstract-bridge'
|
|
7
|
+
import { Account } from '@xyo-network/account'
|
|
4
8
|
import { QueryBoundWitness } from '@xyo-network/boundwitness-model'
|
|
5
|
-
import { BridgeModule
|
|
9
|
+
import { BridgeModule } from '@xyo-network/bridge-model'
|
|
6
10
|
import { ModuleManifestPayload, ModuleManifestPayloadSchema } from '@xyo-network/manifest-model'
|
|
7
11
|
import {
|
|
8
12
|
creatableModule,
|
|
9
13
|
ModuleConfig,
|
|
14
|
+
ModuleConfigSchema,
|
|
10
15
|
ModuleEventData,
|
|
11
|
-
|
|
12
|
-
|
|
16
|
+
ModuleFilter,
|
|
17
|
+
ModuleFilterOptions,
|
|
18
|
+
ModuleIdentifier,
|
|
19
|
+
ModuleInstance,
|
|
13
20
|
ModuleQueryResult,
|
|
14
21
|
} from '@xyo-network/module-model'
|
|
15
|
-
import {
|
|
22
|
+
import { NodeAttachQuerySchema } from '@xyo-network/node-model'
|
|
23
|
+
import { Payload } from '@xyo-network/payload-model'
|
|
16
24
|
import { LRUCache } from 'lru-cache'
|
|
17
25
|
|
|
18
|
-
import {
|
|
26
|
+
import {
|
|
27
|
+
AsyncQueryBusClient,
|
|
28
|
+
AsyncQueryBusClientParams,
|
|
29
|
+
AsyncQueryBusHost,
|
|
30
|
+
AsyncQueryBusModuleProxy,
|
|
31
|
+
AsyncQueryBusModuleProxyParams,
|
|
32
|
+
} from './AsyncQueryBus'
|
|
19
33
|
import { PubSubBridgeConfigSchema } from './Config'
|
|
20
34
|
import { PubSubBridgeParams } from './Params'
|
|
21
35
|
|
|
@@ -31,25 +45,11 @@ export class PubSubBridge<TParams extends PubSubBridgeParams = PubSubBridgeParam
|
|
|
31
45
|
protected _configRootAddress: Address = ''
|
|
32
46
|
protected _configStateStoreArchivist: string = ''
|
|
33
47
|
protected _configStateStoreBoundWitnessDiviner: string = ''
|
|
34
|
-
protected _discoverCache?: LRUCache<string, Payload[]>
|
|
35
48
|
protected _lastState?: LRUCache<string, number>
|
|
36
|
-
protected _targetConfigs: Record<string, ModuleConfig> = {}
|
|
37
|
-
protected _targetQueries: Record<string, string[]> = {}
|
|
38
49
|
|
|
39
50
|
private _busClient?: AsyncQueryBusClient
|
|
40
51
|
private _busHost?: AsyncQueryBusHost
|
|
41
52
|
|
|
42
|
-
get discoverCache() {
|
|
43
|
-
const config = this.discoverCacheConfig
|
|
44
|
-
this._discoverCache = this._discoverCache ?? new LRUCache<string, Payload[]>({ ttlAutopurge: true, ...config })
|
|
45
|
-
return this._discoverCache
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
get discoverCacheConfig(): LRUCache.Options<string, Payload[], unknown> {
|
|
49
|
-
const discoverCacheConfig: CacheConfig | undefined = this.config.discoverCache === true ? {} : this.config.discoverCache
|
|
50
|
-
return { max: 100, ttl: 1000 * 60 * 5, ...discoverCacheConfig }
|
|
51
|
-
}
|
|
52
|
-
|
|
53
53
|
protected get moduleName() {
|
|
54
54
|
return `${this.config.name ?? moduleName}`
|
|
55
55
|
}
|
|
@@ -58,49 +58,9 @@ export class PubSubBridge<TParams extends PubSubBridgeParams = PubSubBridgeParam
|
|
|
58
58
|
return this._configRootAddress
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
-
// protected get stateStoreArchivistConfig() {
|
|
62
|
-
// return this._configStateStoreArchivist
|
|
63
|
-
// }
|
|
64
|
-
|
|
65
|
-
// protected get stateStoreBoundWitnessDivinerConfig() {
|
|
66
|
-
// return this._configStateStoreBoundWitnessDiviner
|
|
67
|
-
// }
|
|
68
|
-
|
|
69
61
|
connect() {
|
|
70
|
-
//await super.startHandler()
|
|
71
62
|
this.connected = true
|
|
72
|
-
return
|
|
73
|
-
// const rootTargetDownResolver = this.targetDownResolver()
|
|
74
|
-
// if (rootTargetDownResolver) {
|
|
75
|
-
// this.downResolver.addResolver(rootTargetDownResolver)
|
|
76
|
-
// await this.targetDiscover(this.rootAddress)
|
|
77
|
-
|
|
78
|
-
// const childAddresses = await rootTargetDownResolver.getRemoteAddresses()
|
|
79
|
-
|
|
80
|
-
// const children = compact(
|
|
81
|
-
// await Promise.all(
|
|
82
|
-
// childAddresses.map(async (address) => {
|
|
83
|
-
// const resolved = await rootTargetDownResolver.resolve({ address: [address] })
|
|
84
|
-
// return resolved[0]
|
|
85
|
-
// }),
|
|
86
|
-
// ),
|
|
87
|
-
// )
|
|
88
|
-
|
|
89
|
-
// // Discover all to load cache
|
|
90
|
-
// await Promise.all(children.map((child) => assertEx(child.discover())))
|
|
91
|
-
|
|
92
|
-
// const parentNodes = await this.upResolver.resolve({ query: [[NodeAttachQuerySchema]] })
|
|
93
|
-
// //notify parents of child modules
|
|
94
|
-
// //TODO: this needs to be thought through. If this the correct direction for data flow and how do we 'un-attach'?
|
|
95
|
-
// for (const node of parentNodes) for (const child of children) forget(node.emit('moduleAttached', { module: child }))
|
|
96
|
-
// // console.log(`Started HTTP Bridge in ${Date.now() - start}ms`)
|
|
97
|
-
// this.connected = true
|
|
98
|
-
|
|
99
|
-
// return true
|
|
100
|
-
// } else {
|
|
101
|
-
// this.connected = false
|
|
102
|
-
// return false
|
|
103
|
-
// }
|
|
63
|
+
return this.connected
|
|
104
64
|
}
|
|
105
65
|
|
|
106
66
|
async disconnect(): Promise<boolean> {
|
|
@@ -113,69 +73,49 @@ export class PubSubBridge<TParams extends PubSubBridgeParams = PubSubBridgeParam
|
|
|
113
73
|
return this.rootAddress
|
|
114
74
|
}
|
|
115
75
|
|
|
116
|
-
override
|
|
117
|
-
|
|
76
|
+
override async resolve<T extends ModuleInstance = ModuleInstance>(filter?: ModuleFilter<T>, options?: ModuleFilterOptions<T>): Promise<T[]>
|
|
77
|
+
override async resolve<T extends ModuleInstance = ModuleInstance>(id: ModuleIdentifier, options?: ModuleFilterOptions<T>): Promise<T | undefined>
|
|
78
|
+
override async resolve<T extends ModuleInstance = ModuleInstance>(
|
|
79
|
+
idOrFilter?: ModuleFilter<T> | ModuleIdentifier,
|
|
80
|
+
_options?: ModuleFilterOptions<T>,
|
|
81
|
+
): Promise<T | T[] | undefined> {
|
|
82
|
+
if (idOrFilter === undefined) {
|
|
83
|
+
return []
|
|
84
|
+
}
|
|
85
|
+
if (typeof idOrFilter === 'string') {
|
|
86
|
+
const upResolve = await this.upResolver.resolve<T>(idOrFilter)
|
|
87
|
+
if (upResolve) return upResolve
|
|
88
|
+
assertEx(!isAddress(idOrFilter), 'Name resolutions not supported')
|
|
89
|
+
const params: AsyncQueryBusModuleProxyParams = {
|
|
90
|
+
account: Account.randomSync(),
|
|
91
|
+
busClient: assertEx(this.busClient(), 'Bus client not initialized'),
|
|
92
|
+
moduleAddress: idOrFilter as Address,
|
|
93
|
+
queries: [],
|
|
94
|
+
}
|
|
95
|
+
// eslint-disable-next-line unicorn/no-useless-promise-resolve-reject
|
|
96
|
+
return await Promise.resolve(new AsyncQueryBusModuleProxy<T>(params) as unknown as T)
|
|
97
|
+
} else {
|
|
98
|
+
throw new TypeError('Filter not Supported')
|
|
99
|
+
}
|
|
118
100
|
}
|
|
119
101
|
|
|
120
|
-
override
|
|
121
|
-
|
|
122
|
-
//if caching, return cached result if exists
|
|
123
|
-
const cachedResult = this.discoverCache?.get(address ?? 'root ')
|
|
124
|
-
if (cachedResult) {
|
|
125
|
-
return cachedResult
|
|
126
|
-
}
|
|
127
|
-
await this.started('throw')
|
|
128
|
-
const addressToDiscover = address ?? (await this.getRootAddress())
|
|
129
|
-
this.logger?.debug(`${this.moduleName}: Begin issuing targetDiscover to: ${addressToDiscover}`)
|
|
130
|
-
// const queryPayload: ModuleDiscoverQuery = { maxDepth, schema: ModuleDiscoverQuerySchema }
|
|
131
|
-
// const boundQuery = await this.bindQuery(queryPayload)
|
|
132
|
-
// const discover = assertEx(await this.targetQuery(addressToDiscover, boundQuery[0], boundQuery[1]), () => `Unable to resolve [${address}]`)[1]
|
|
133
|
-
// this._targetQueries[addressToDiscover] = compact(
|
|
134
|
-
// discover?.map((payload) => {
|
|
135
|
-
// if (payload.schema === QuerySchema) {
|
|
136
|
-
// const schemaPayload = payload as QueryPayload
|
|
137
|
-
// return schemaPayload.query
|
|
138
|
-
// } else {
|
|
139
|
-
// return null
|
|
140
|
-
// }
|
|
141
|
-
// }) ?? [],
|
|
142
|
-
// )
|
|
143
|
-
// const targetConfigSchema = assertEx(
|
|
144
|
-
// discover.find(isPayloadOfSchemaType<WithMeta<ConfigPayload>>(ConfigSchema)),
|
|
145
|
-
// () => `Discover did not return a [${ConfigSchema}] payload`,
|
|
146
|
-
// ).config
|
|
147
|
-
|
|
148
|
-
// this._targetConfigs[addressToDiscover] = assertEx(
|
|
149
|
-
// discover.find(isPayloadOfSchemaType(targetConfigSchema)) as ModuleConfig,
|
|
150
|
-
// () => `Discover did not return a [${targetConfigSchema}] payload`,
|
|
151
|
-
// )
|
|
152
|
-
// if caching, set entry
|
|
153
|
-
// this.discoverCache?.set(address ?? 'root', discover)
|
|
154
|
-
// return discover
|
|
155
|
-
return []
|
|
102
|
+
override targetConfig(_address: Address): ModuleConfig {
|
|
103
|
+
return { schema: ModuleConfigSchema }
|
|
156
104
|
}
|
|
157
105
|
|
|
158
|
-
override
|
|
159
|
-
|
|
160
|
-
const queryPayload: ModuleManifestQuery = { maxDepth, schema: ModuleManifestQuerySchema }
|
|
161
|
-
const boundQuery = await this.bindQuery(queryPayload)
|
|
162
|
-
const manifest = assertEx(await this.targetQuery(addressToCall, boundQuery[0], boundQuery[1]), () => `Unable to resolve [${address}]`)[1]
|
|
163
|
-
return assertEx(
|
|
164
|
-
manifest.find(isPayloadOfSchemaType<WithMeta<ModuleManifestPayload>>(ModuleManifestPayloadSchema)),
|
|
165
|
-
'Did not receive manifest',
|
|
166
|
-
) as ModuleManifestPayload
|
|
106
|
+
override targetManifest(_address: Address, _maxDepth?: number | undefined): Promisable<ModuleManifestPayload> {
|
|
107
|
+
return { config: { name: '', schema: ModuleConfigSchema }, schema: ModuleManifestPayloadSchema }
|
|
167
108
|
}
|
|
168
109
|
|
|
169
|
-
override targetQueries(
|
|
170
|
-
|
|
171
|
-
return assertEx(this._targetQueries[address], () => `targetQueries not set [${address}]`)
|
|
110
|
+
override targetQueries(_address: Address): string[] {
|
|
111
|
+
return []
|
|
172
112
|
}
|
|
173
113
|
|
|
174
114
|
override async targetQuery(address: Address, query: QueryBoundWitness, payloads?: Payload[] | undefined): Promise<ModuleQueryResult> {
|
|
175
115
|
if (!this.connected) throw new Error('Not connected')
|
|
176
116
|
await this.started('throw')
|
|
177
|
-
const bus = this.busClient()
|
|
178
|
-
return bus
|
|
117
|
+
const bus = assertEx(this.busClient(), 'Client not configured')
|
|
118
|
+
return bus?.send(address, query, payloads)
|
|
179
119
|
}
|
|
180
120
|
|
|
181
121
|
override targetQueryable(_address: Address, _query: QueryBoundWitness, _payloads?: Payload[], _queryConfig?: ModuleConfig): boolean {
|
|
@@ -183,7 +123,7 @@ export class PubSubBridge<TParams extends PubSubBridgeParams = PubSubBridgeParam
|
|
|
183
123
|
}
|
|
184
124
|
|
|
185
125
|
protected busClient() {
|
|
186
|
-
if (!this._busClient) {
|
|
126
|
+
if (!this._busClient && this.config.client) {
|
|
187
127
|
this._busClient = new AsyncQueryBusClient({
|
|
188
128
|
config: this.config.client,
|
|
189
129
|
logger: this.logger,
|
|
@@ -194,7 +134,7 @@ export class PubSubBridge<TParams extends PubSubBridgeParams = PubSubBridgeParam
|
|
|
194
134
|
}
|
|
195
135
|
|
|
196
136
|
protected busHost() {
|
|
197
|
-
if (!this._busHost) {
|
|
137
|
+
if (!this._busHost && this.config.host) {
|
|
198
138
|
this._busHost = new AsyncQueryBusHost({
|
|
199
139
|
config: this.config.host,
|
|
200
140
|
logger: this.logger,
|
|
@@ -206,12 +146,12 @@ export class PubSubBridge<TParams extends PubSubBridgeParams = PubSubBridgeParam
|
|
|
206
146
|
|
|
207
147
|
protected override async startHandler(): Promise<boolean> {
|
|
208
148
|
await Promise.resolve(this.connect())
|
|
209
|
-
this.busHost()
|
|
149
|
+
this.busHost()?.start()
|
|
210
150
|
return true
|
|
211
151
|
}
|
|
212
152
|
|
|
213
153
|
protected override stopHandler(_timeout?: number | undefined) {
|
|
214
|
-
this.busHost()
|
|
154
|
+
this.busHost()?.stop()
|
|
215
155
|
return true
|
|
216
156
|
}
|
|
217
157
|
}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { CacheConfig } from '@xyo-network/bridge-model';
|
|
2
|
-
import { ModuleIdentifier } from '@xyo-network/module-model';
|
|
3
|
-
export declare const Pending: "pending";
|
|
4
|
-
export type Pending = typeof Pending;
|
|
5
|
-
/**
|
|
6
|
-
* Configuration for searchable storage of local state
|
|
7
|
-
*/
|
|
8
|
-
export interface SearchableStorage {
|
|
9
|
-
/**
|
|
10
|
-
* Name/Address of the archivist where intermediate communications are stored
|
|
11
|
-
*/
|
|
12
|
-
archivist: ModuleIdentifier;
|
|
13
|
-
/**
|
|
14
|
-
* Name/Address of the diviner where intermediate communications are filtered
|
|
15
|
-
*/
|
|
16
|
-
boundWitnessDiviner: ModuleIdentifier;
|
|
17
|
-
}
|
|
18
|
-
export interface AsyncQueryBusClearingHouseConfig {
|
|
19
|
-
/**
|
|
20
|
-
* Configuration for intermediary query storage
|
|
21
|
-
*/
|
|
22
|
-
queries?: SearchableStorage;
|
|
23
|
-
/**
|
|
24
|
-
* Configuration for intermediary response storage
|
|
25
|
-
*/
|
|
26
|
-
responses?: SearchableStorage;
|
|
27
|
-
}
|
|
28
|
-
export interface AsyncQueryBusBaseConfig {
|
|
29
|
-
clearingHouse?: AsyncQueryBusClearingHouseConfig;
|
|
30
|
-
/**
|
|
31
|
-
* How often to poll for new queries/responses
|
|
32
|
-
*/
|
|
33
|
-
pollFrequency?: number;
|
|
34
|
-
/**
|
|
35
|
-
* Where the archivist should persist its internal state
|
|
36
|
-
*/
|
|
37
|
-
stateStore?: SearchableStorage;
|
|
38
|
-
}
|
|
39
|
-
export interface AsyncQueryBusClientConfig extends AsyncQueryBusBaseConfig {
|
|
40
|
-
/**
|
|
41
|
-
* Configuration for intermediary response storage
|
|
42
|
-
*/
|
|
43
|
-
queryCache?: CacheConfig | true;
|
|
44
|
-
}
|
|
45
|
-
export interface AsyncQueryBusHostConfig extends AsyncQueryBusBaseConfig {
|
|
46
|
-
listeningModules?: string[];
|
|
47
|
-
/**
|
|
48
|
-
* How many queries to process at once when retrieving queries
|
|
49
|
-
* for an address
|
|
50
|
-
*/
|
|
51
|
-
perAddressBatchQueryLimit?: number;
|
|
52
|
-
}
|
|
53
|
-
//# sourceMappingURL=Config.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Config.d.ts","sourceRoot":"","sources":["../../../src/AsyncQueryBus/Config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAA;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAA;AAE5D,eAAO,MAAM,OAAO,WAAqB,CAAA;AACzC,MAAM,MAAM,OAAO,GAAG,OAAO,OAAO,CAAA;AAEpC;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,SAAS,EAAE,gBAAgB,CAAA;IAC3B;;OAEG;IACH,mBAAmB,EAAE,gBAAgB,CAAA;CACtC;AAED,MAAM,WAAW,gCAAgC;IAC/C;;OAEG;IACH,OAAO,CAAC,EAAE,iBAAiB,CAAA;IAE3B;;OAEG;IACH,SAAS,CAAC,EAAE,iBAAiB,CAAA;CAC9B;AAED,MAAM,WAAW,uBAAuB;IACtC,aAAa,CAAC,EAAE,gCAAgC,CAAA;IAEhD;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAA;IAEtB;;OAEG;IACH,UAAU,CAAC,EAAE,iBAAiB,CAAA;CAC/B;AAED,MAAM,WAAW,yBAA0B,SAAQ,uBAAuB;IACxE;;OAEG;IACH,UAAU,CAAC,EAAE,WAAW,GAAG,IAAI,CAAA;CAChC;AAED,MAAM,WAAW,uBAAwB,SAAQ,uBAAuB;IACtE,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAA;IAE3B;;;OAGG;IACH,yBAAyB,CAAC,EAAE,MAAM,CAAA;CACnC"}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { CacheConfig } from '@xyo-network/bridge-model';
|
|
2
|
-
import { ModuleIdentifier } from '@xyo-network/module-model';
|
|
3
|
-
export declare const Pending: "pending";
|
|
4
|
-
export type Pending = typeof Pending;
|
|
5
|
-
/**
|
|
6
|
-
* Configuration for searchable storage of local state
|
|
7
|
-
*/
|
|
8
|
-
export interface SearchableStorage {
|
|
9
|
-
/**
|
|
10
|
-
* Name/Address of the archivist where intermediate communications are stored
|
|
11
|
-
*/
|
|
12
|
-
archivist: ModuleIdentifier;
|
|
13
|
-
/**
|
|
14
|
-
* Name/Address of the diviner where intermediate communications are filtered
|
|
15
|
-
*/
|
|
16
|
-
boundWitnessDiviner: ModuleIdentifier;
|
|
17
|
-
}
|
|
18
|
-
export interface AsyncQueryBusClearingHouseConfig {
|
|
19
|
-
/**
|
|
20
|
-
* Configuration for intermediary query storage
|
|
21
|
-
*/
|
|
22
|
-
queries?: SearchableStorage;
|
|
23
|
-
/**
|
|
24
|
-
* Configuration for intermediary response storage
|
|
25
|
-
*/
|
|
26
|
-
responses?: SearchableStorage;
|
|
27
|
-
}
|
|
28
|
-
export interface AsyncQueryBusBaseConfig {
|
|
29
|
-
clearingHouse?: AsyncQueryBusClearingHouseConfig;
|
|
30
|
-
/**
|
|
31
|
-
* How often to poll for new queries/responses
|
|
32
|
-
*/
|
|
33
|
-
pollFrequency?: number;
|
|
34
|
-
/**
|
|
35
|
-
* Where the archivist should persist its internal state
|
|
36
|
-
*/
|
|
37
|
-
stateStore?: SearchableStorage;
|
|
38
|
-
}
|
|
39
|
-
export interface AsyncQueryBusClientConfig extends AsyncQueryBusBaseConfig {
|
|
40
|
-
/**
|
|
41
|
-
* Configuration for intermediary response storage
|
|
42
|
-
*/
|
|
43
|
-
queryCache?: CacheConfig | true;
|
|
44
|
-
}
|
|
45
|
-
export interface AsyncQueryBusHostConfig extends AsyncQueryBusBaseConfig {
|
|
46
|
-
listeningModules?: string[];
|
|
47
|
-
/**
|
|
48
|
-
* How many queries to process at once when retrieving queries
|
|
49
|
-
* for an address
|
|
50
|
-
*/
|
|
51
|
-
perAddressBatchQueryLimit?: number;
|
|
52
|
-
}
|
|
53
|
-
//# sourceMappingURL=Config.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Config.d.ts","sourceRoot":"","sources":["../../../src/AsyncQueryBus/Config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAA;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAA;AAE5D,eAAO,MAAM,OAAO,WAAqB,CAAA;AACzC,MAAM,MAAM,OAAO,GAAG,OAAO,OAAO,CAAA;AAEpC;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,SAAS,EAAE,gBAAgB,CAAA;IAC3B;;OAEG;IACH,mBAAmB,EAAE,gBAAgB,CAAA;CACtC;AAED,MAAM,WAAW,gCAAgC;IAC/C;;OAEG;IACH,OAAO,CAAC,EAAE,iBAAiB,CAAA;IAE3B;;OAEG;IACH,SAAS,CAAC,EAAE,iBAAiB,CAAA;CAC9B;AAED,MAAM,WAAW,uBAAuB;IACtC,aAAa,CAAC,EAAE,gCAAgC,CAAA;IAEhD;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAA;IAEtB;;OAEG;IACH,UAAU,CAAC,EAAE,iBAAiB,CAAA;CAC/B;AAED,MAAM,WAAW,yBAA0B,SAAQ,uBAAuB;IACxE;;OAEG;IACH,UAAU,CAAC,EAAE,WAAW,GAAG,IAAI,CAAA;CAChC;AAED,MAAM,WAAW,uBAAwB,SAAQ,uBAAuB;IACtE,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAA;IAE3B;;;OAGG;IACH,yBAAyB,CAAC,EAAE,MAAM,CAAA;CACnC"}
|