@xyo-network/bridge-model 2.89.0-rc.8 → 2.89.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/Bridge.d.cts +61 -2
- package/dist/browser/Bridge.d.cts.map +1 -1
- package/dist/browser/Bridge.d.mts +61 -2
- package/dist/browser/Bridge.d.mts.map +1 -1
- package/dist/browser/Bridge.d.ts +61 -2
- package/dist/browser/Bridge.d.ts.map +1 -1
- package/dist/node/Bridge.d.cts +61 -2
- package/dist/node/Bridge.d.cts.map +1 -1
- package/dist/node/Bridge.d.mts +61 -2
- package/dist/node/Bridge.d.mts.map +1 -1
- package/dist/node/Bridge.d.ts +61 -2
- package/dist/node/Bridge.d.ts.map +1 -1
- package/package.json +6 -7
- package/src/Bridge.ts +68 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Promisable } from '@xylabs/promise';
|
|
2
2
|
import { QueryBoundWitness } from '@xyo-network/boundwitness-model';
|
|
3
3
|
import { ModuleManifestPayload } from '@xyo-network/manifest-model';
|
|
4
|
-
import { AnyConfigSchema, ModuleConfig, ModuleEventData, ModuleFilter, ModuleFilterOptions, ModuleInstance, ModuleParams, ModuleQueryResult,
|
|
4
|
+
import { AnyConfigSchema, ModuleConfig, ModuleEventData, ModuleFilter, ModuleFilterOptions, ModuleInstance, ModuleParams, ModuleQueryResult, ModuleResolverInstance } from '@xyo-network/module-model';
|
|
5
5
|
import { Payload, Query } from '@xyo-network/payload-model';
|
|
6
6
|
import { BridgeConfig } from './Config';
|
|
7
7
|
export interface Bridge {
|
|
@@ -12,16 +12,75 @@ export interface Bridge {
|
|
|
12
12
|
export interface BridgeParams<TConfig extends AnyConfigSchema<BridgeConfig> = AnyConfigSchema<BridgeConfig>> extends ModuleParams<TConfig>, ModuleParams<TConfig> {
|
|
13
13
|
}
|
|
14
14
|
export interface BridgeModule<TParams extends BridgeParams = BridgeParams, TEventData extends ModuleEventData = ModuleEventData> extends ModuleInstance<TParams, TEventData> {
|
|
15
|
+
/**
|
|
16
|
+
* Returns the address of the base module that the bridge is connected to. Since discovery can be
|
|
17
|
+
* a recursive process, the root module is the module that the bridge is directly connected to even
|
|
18
|
+
* though its children (through potentially several generations) are also able to be communicated to
|
|
19
|
+
* across the bridge.
|
|
20
|
+
*/
|
|
15
21
|
getRootAddress(): Promisable<string>;
|
|
22
|
+
/**
|
|
23
|
+
* Returns the config for a bridged module
|
|
24
|
+
* @param address Address of the module connected to the bridge
|
|
25
|
+
*/
|
|
16
26
|
targetConfig(address: string): ModuleConfig;
|
|
27
|
+
/**
|
|
28
|
+
* Returns the result of a discover query for a bridged module
|
|
29
|
+
* @param address Address of the module connected to the bridge
|
|
30
|
+
* @param maxDepth
|
|
31
|
+
*/
|
|
17
32
|
targetDiscover(address?: string, maxDepth?: number): Promisable<Payload[]>;
|
|
18
|
-
|
|
33
|
+
/**
|
|
34
|
+
*
|
|
35
|
+
* @param address Address of the module connected to the bridge
|
|
36
|
+
*/
|
|
37
|
+
targetDownResolver(address?: string): ModuleResolverInstance | undefined;
|
|
38
|
+
/**
|
|
39
|
+
* Returns the result of a manifest query for a bridged module
|
|
40
|
+
* @param address Address of the module connected to the bridge
|
|
41
|
+
* @param maxDepth
|
|
42
|
+
*/
|
|
19
43
|
targetManifest(address?: string, maxDepth?: number): Promisable<ModuleManifestPayload>;
|
|
44
|
+
/**
|
|
45
|
+
* Returns the supported queries for a bridged module
|
|
46
|
+
* @param address Address of the module connected to the bridge
|
|
47
|
+
*/
|
|
20
48
|
targetQueries(address: string): string[];
|
|
49
|
+
/**
|
|
50
|
+
* Queries a module connected to the bridge using the supplied query, payloads, and query configuration
|
|
51
|
+
* @param address Address of the module connected to the bridge
|
|
52
|
+
* @param query The query to issue against the address
|
|
53
|
+
* @param payloads The payloads to use in the query
|
|
54
|
+
*/
|
|
21
55
|
targetQuery(address: string, query: Query, payloads?: Payload[]): Promisable<ModuleQueryResult>;
|
|
56
|
+
/**
|
|
57
|
+
* Determines if a bridged module is queryable using the supplied query, payloads, and query configuration
|
|
58
|
+
* @param address Address of the module connected to the bridge
|
|
59
|
+
* @param query The query to issue against the address
|
|
60
|
+
* @param payloads The payloads to use in the query
|
|
61
|
+
* @param queryConfig The query configuration
|
|
62
|
+
*/
|
|
22
63
|
targetQueryable(address: string, query: QueryBoundWitness, payloads?: Payload[], queryConfig?: ModuleConfig): Promisable<boolean>;
|
|
64
|
+
/**
|
|
65
|
+
*
|
|
66
|
+
* @param address Address of the module potentially connected to the bridge
|
|
67
|
+
* @param filter
|
|
68
|
+
* @param options
|
|
69
|
+
*/
|
|
23
70
|
targetResolve(address: string, filter?: ModuleFilter, options?: ModuleFilterOptions): Promisable<ModuleInstance[]>;
|
|
71
|
+
/**
|
|
72
|
+
*
|
|
73
|
+
* @param address Address of the module potentially connected to the bridge
|
|
74
|
+
* @param nameOrAddress
|
|
75
|
+
* @param options
|
|
76
|
+
*/
|
|
24
77
|
targetResolve(address: string, nameOrAddress: string, options?: ModuleFilterOptions): Promisable<ModuleInstance | undefined>;
|
|
78
|
+
/**
|
|
79
|
+
*
|
|
80
|
+
* @param address Address of the module potentially connected to the bridge
|
|
81
|
+
* @param nameOrAddressOrFilter
|
|
82
|
+
* @param options
|
|
83
|
+
*/
|
|
25
84
|
targetResolve(address: string, nameOrAddressOrFilter?: ModuleFilter | string, options?: ModuleFilterOptions): Promisable<ModuleInstance | ModuleInstance[] | undefined>;
|
|
26
85
|
}
|
|
27
86
|
export interface BridgeInstance<TParams extends BridgeParams = BridgeParams, TEventData extends ModuleEventData = ModuleEventData> extends BridgeModule<TParams, TEventData>, Bridge {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Bridge.d.ts","sourceRoot":"","sources":["../../src/Bridge.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAA;AACnE,OAAO,EA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AE,mBAAmB,GAC5B,UAAU,CAAC,cAAc,GAAG,cAAc,EAAE,GAAG,SAAS,CAAC,CAAA;CAC7D;AAED,MAAM,WAAW,cAAc,CAAC,OAAO,SAAS,YAAY,GAAG,YAAY,EAAE,UAAU,SAAS,eAAe,GAAG,eAAe,CAC/H,SAAQ,YAAY,CAAC,OAAO,EAAE,UAAU,CAAC,EACvC,MAAM;CAAG"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Promisable } from '@xylabs/promise';
|
|
2
2
|
import { QueryBoundWitness } from '@xyo-network/boundwitness-model';
|
|
3
3
|
import { ModuleManifestPayload } from '@xyo-network/manifest-model';
|
|
4
|
-
import { AnyConfigSchema, ModuleConfig, ModuleEventData, ModuleFilter, ModuleFilterOptions, ModuleInstance, ModuleParams, ModuleQueryResult,
|
|
4
|
+
import { AnyConfigSchema, ModuleConfig, ModuleEventData, ModuleFilter, ModuleFilterOptions, ModuleInstance, ModuleParams, ModuleQueryResult, ModuleResolverInstance } from '@xyo-network/module-model';
|
|
5
5
|
import { Payload, Query } from '@xyo-network/payload-model';
|
|
6
6
|
import { BridgeConfig } from './Config';
|
|
7
7
|
export interface Bridge {
|
|
@@ -12,16 +12,75 @@ export interface Bridge {
|
|
|
12
12
|
export interface BridgeParams<TConfig extends AnyConfigSchema<BridgeConfig> = AnyConfigSchema<BridgeConfig>> extends ModuleParams<TConfig>, ModuleParams<TConfig> {
|
|
13
13
|
}
|
|
14
14
|
export interface BridgeModule<TParams extends BridgeParams = BridgeParams, TEventData extends ModuleEventData = ModuleEventData> extends ModuleInstance<TParams, TEventData> {
|
|
15
|
+
/**
|
|
16
|
+
* Returns the address of the base module that the bridge is connected to. Since discovery can be
|
|
17
|
+
* a recursive process, the root module is the module that the bridge is directly connected to even
|
|
18
|
+
* though its children (through potentially several generations) are also able to be communicated to
|
|
19
|
+
* across the bridge.
|
|
20
|
+
*/
|
|
15
21
|
getRootAddress(): Promisable<string>;
|
|
22
|
+
/**
|
|
23
|
+
* Returns the config for a bridged module
|
|
24
|
+
* @param address Address of the module connected to the bridge
|
|
25
|
+
*/
|
|
16
26
|
targetConfig(address: string): ModuleConfig;
|
|
27
|
+
/**
|
|
28
|
+
* Returns the result of a discover query for a bridged module
|
|
29
|
+
* @param address Address of the module connected to the bridge
|
|
30
|
+
* @param maxDepth
|
|
31
|
+
*/
|
|
17
32
|
targetDiscover(address?: string, maxDepth?: number): Promisable<Payload[]>;
|
|
18
|
-
|
|
33
|
+
/**
|
|
34
|
+
*
|
|
35
|
+
* @param address Address of the module connected to the bridge
|
|
36
|
+
*/
|
|
37
|
+
targetDownResolver(address?: string): ModuleResolverInstance | undefined;
|
|
38
|
+
/**
|
|
39
|
+
* Returns the result of a manifest query for a bridged module
|
|
40
|
+
* @param address Address of the module connected to the bridge
|
|
41
|
+
* @param maxDepth
|
|
42
|
+
*/
|
|
19
43
|
targetManifest(address?: string, maxDepth?: number): Promisable<ModuleManifestPayload>;
|
|
44
|
+
/**
|
|
45
|
+
* Returns the supported queries for a bridged module
|
|
46
|
+
* @param address Address of the module connected to the bridge
|
|
47
|
+
*/
|
|
20
48
|
targetQueries(address: string): string[];
|
|
49
|
+
/**
|
|
50
|
+
* Queries a module connected to the bridge using the supplied query, payloads, and query configuration
|
|
51
|
+
* @param address Address of the module connected to the bridge
|
|
52
|
+
* @param query The query to issue against the address
|
|
53
|
+
* @param payloads The payloads to use in the query
|
|
54
|
+
*/
|
|
21
55
|
targetQuery(address: string, query: Query, payloads?: Payload[]): Promisable<ModuleQueryResult>;
|
|
56
|
+
/**
|
|
57
|
+
* Determines if a bridged module is queryable using the supplied query, payloads, and query configuration
|
|
58
|
+
* @param address Address of the module connected to the bridge
|
|
59
|
+
* @param query The query to issue against the address
|
|
60
|
+
* @param payloads The payloads to use in the query
|
|
61
|
+
* @param queryConfig The query configuration
|
|
62
|
+
*/
|
|
22
63
|
targetQueryable(address: string, query: QueryBoundWitness, payloads?: Payload[], queryConfig?: ModuleConfig): Promisable<boolean>;
|
|
64
|
+
/**
|
|
65
|
+
*
|
|
66
|
+
* @param address Address of the module potentially connected to the bridge
|
|
67
|
+
* @param filter
|
|
68
|
+
* @param options
|
|
69
|
+
*/
|
|
23
70
|
targetResolve(address: string, filter?: ModuleFilter, options?: ModuleFilterOptions): Promisable<ModuleInstance[]>;
|
|
71
|
+
/**
|
|
72
|
+
*
|
|
73
|
+
* @param address Address of the module potentially connected to the bridge
|
|
74
|
+
* @param nameOrAddress
|
|
75
|
+
* @param options
|
|
76
|
+
*/
|
|
24
77
|
targetResolve(address: string, nameOrAddress: string, options?: ModuleFilterOptions): Promisable<ModuleInstance | undefined>;
|
|
78
|
+
/**
|
|
79
|
+
*
|
|
80
|
+
* @param address Address of the module potentially connected to the bridge
|
|
81
|
+
* @param nameOrAddressOrFilter
|
|
82
|
+
* @param options
|
|
83
|
+
*/
|
|
25
84
|
targetResolve(address: string, nameOrAddressOrFilter?: ModuleFilter | string, options?: ModuleFilterOptions): Promisable<ModuleInstance | ModuleInstance[] | undefined>;
|
|
26
85
|
}
|
|
27
86
|
export interface BridgeInstance<TParams extends BridgeParams = BridgeParams, TEventData extends ModuleEventData = ModuleEventData> extends BridgeModule<TParams, TEventData>, Bridge {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Bridge.d.ts","sourceRoot":"","sources":["../../src/Bridge.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAA;AACnE,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAA;AACnE,OAAO,EACL,eAAe,EACf,YAAY,EACZ,eAAe,EACf,YAAY,EACZ,mBAAmB,EACnB,cAAc,EACd,YAAY,EACZ,iBAAiB,EACjB,
|
|
1
|
+
{"version":3,"file":"Bridge.d.ts","sourceRoot":"","sources":["../../src/Bridge.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAA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/dist/browser/Bridge.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Promisable } from '@xylabs/promise';
|
|
2
2
|
import { QueryBoundWitness } from '@xyo-network/boundwitness-model';
|
|
3
3
|
import { ModuleManifestPayload } from '@xyo-network/manifest-model';
|
|
4
|
-
import { AnyConfigSchema, ModuleConfig, ModuleEventData, ModuleFilter, ModuleFilterOptions, ModuleInstance, ModuleParams, ModuleQueryResult,
|
|
4
|
+
import { AnyConfigSchema, ModuleConfig, ModuleEventData, ModuleFilter, ModuleFilterOptions, ModuleInstance, ModuleParams, ModuleQueryResult, ModuleResolverInstance } from '@xyo-network/module-model';
|
|
5
5
|
import { Payload, Query } from '@xyo-network/payload-model';
|
|
6
6
|
import { BridgeConfig } from './Config';
|
|
7
7
|
export interface Bridge {
|
|
@@ -12,16 +12,75 @@ export interface Bridge {
|
|
|
12
12
|
export interface BridgeParams<TConfig extends AnyConfigSchema<BridgeConfig> = AnyConfigSchema<BridgeConfig>> extends ModuleParams<TConfig>, ModuleParams<TConfig> {
|
|
13
13
|
}
|
|
14
14
|
export interface BridgeModule<TParams extends BridgeParams = BridgeParams, TEventData extends ModuleEventData = ModuleEventData> extends ModuleInstance<TParams, TEventData> {
|
|
15
|
+
/**
|
|
16
|
+
* Returns the address of the base module that the bridge is connected to. Since discovery can be
|
|
17
|
+
* a recursive process, the root module is the module that the bridge is directly connected to even
|
|
18
|
+
* though its children (through potentially several generations) are also able to be communicated to
|
|
19
|
+
* across the bridge.
|
|
20
|
+
*/
|
|
15
21
|
getRootAddress(): Promisable<string>;
|
|
22
|
+
/**
|
|
23
|
+
* Returns the config for a bridged module
|
|
24
|
+
* @param address Address of the module connected to the bridge
|
|
25
|
+
*/
|
|
16
26
|
targetConfig(address: string): ModuleConfig;
|
|
27
|
+
/**
|
|
28
|
+
* Returns the result of a discover query for a bridged module
|
|
29
|
+
* @param address Address of the module connected to the bridge
|
|
30
|
+
* @param maxDepth
|
|
31
|
+
*/
|
|
17
32
|
targetDiscover(address?: string, maxDepth?: number): Promisable<Payload[]>;
|
|
18
|
-
|
|
33
|
+
/**
|
|
34
|
+
*
|
|
35
|
+
* @param address Address of the module connected to the bridge
|
|
36
|
+
*/
|
|
37
|
+
targetDownResolver(address?: string): ModuleResolverInstance | undefined;
|
|
38
|
+
/**
|
|
39
|
+
* Returns the result of a manifest query for a bridged module
|
|
40
|
+
* @param address Address of the module connected to the bridge
|
|
41
|
+
* @param maxDepth
|
|
42
|
+
*/
|
|
19
43
|
targetManifest(address?: string, maxDepth?: number): Promisable<ModuleManifestPayload>;
|
|
44
|
+
/**
|
|
45
|
+
* Returns the supported queries for a bridged module
|
|
46
|
+
* @param address Address of the module connected to the bridge
|
|
47
|
+
*/
|
|
20
48
|
targetQueries(address: string): string[];
|
|
49
|
+
/**
|
|
50
|
+
* Queries a module connected to the bridge using the supplied query, payloads, and query configuration
|
|
51
|
+
* @param address Address of the module connected to the bridge
|
|
52
|
+
* @param query The query to issue against the address
|
|
53
|
+
* @param payloads The payloads to use in the query
|
|
54
|
+
*/
|
|
21
55
|
targetQuery(address: string, query: Query, payloads?: Payload[]): Promisable<ModuleQueryResult>;
|
|
56
|
+
/**
|
|
57
|
+
* Determines if a bridged module is queryable using the supplied query, payloads, and query configuration
|
|
58
|
+
* @param address Address of the module connected to the bridge
|
|
59
|
+
* @param query The query to issue against the address
|
|
60
|
+
* @param payloads The payloads to use in the query
|
|
61
|
+
* @param queryConfig The query configuration
|
|
62
|
+
*/
|
|
22
63
|
targetQueryable(address: string, query: QueryBoundWitness, payloads?: Payload[], queryConfig?: ModuleConfig): Promisable<boolean>;
|
|
64
|
+
/**
|
|
65
|
+
*
|
|
66
|
+
* @param address Address of the module potentially connected to the bridge
|
|
67
|
+
* @param filter
|
|
68
|
+
* @param options
|
|
69
|
+
*/
|
|
23
70
|
targetResolve(address: string, filter?: ModuleFilter, options?: ModuleFilterOptions): Promisable<ModuleInstance[]>;
|
|
71
|
+
/**
|
|
72
|
+
*
|
|
73
|
+
* @param address Address of the module potentially connected to the bridge
|
|
74
|
+
* @param nameOrAddress
|
|
75
|
+
* @param options
|
|
76
|
+
*/
|
|
24
77
|
targetResolve(address: string, nameOrAddress: string, options?: ModuleFilterOptions): Promisable<ModuleInstance | undefined>;
|
|
78
|
+
/**
|
|
79
|
+
*
|
|
80
|
+
* @param address Address of the module potentially connected to the bridge
|
|
81
|
+
* @param nameOrAddressOrFilter
|
|
82
|
+
* @param options
|
|
83
|
+
*/
|
|
25
84
|
targetResolve(address: string, nameOrAddressOrFilter?: ModuleFilter | string, options?: ModuleFilterOptions): Promisable<ModuleInstance | ModuleInstance[] | undefined>;
|
|
26
85
|
}
|
|
27
86
|
export interface BridgeInstance<TParams extends BridgeParams = BridgeParams, TEventData extends ModuleEventData = ModuleEventData> extends BridgeModule<TParams, TEventData>, Bridge {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Bridge.d.ts","sourceRoot":"","sources":["../../src/Bridge.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAA;AACnE,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAA;AACnE,OAAO,EACL,eAAe,EACf,YAAY,EACZ,eAAe,EACf,YAAY,EACZ,mBAAmB,EACnB,cAAc,EACd,YAAY,EACZ,iBAAiB,EACjB,
|
|
1
|
+
{"version":3,"file":"Bridge.d.ts","sourceRoot":"","sources":["../../src/Bridge.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAA;AACnE,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAA;AACnE,OAAO,EACL,eAAe,EACf,YAAY,EACZ,eAAe,EACf,YAAY,EACZ,mBAAmB,EACnB,cAAc,EACd,YAA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ACH,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,CAAC,EAAE,OAAO,EAAE,GAAG,UAAU,CAAC,iBAAiB,CAAC,CAAA;IAE/F;;;;;;OAMG;IACH,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,iBAAiB,EAAE,QAAQ,CAAC,EAAE,OAAO,EAAE,EAAE,WAAW,CAAC,EAAE,YAAY,GAAG,UAAU,CAAC,OAAO,CAAC,CAAA;IAEjI;;;;;OAKG;IACH,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,YAAY,EAAE,OAAO,CAAC,EAAE,mBAAmB,GAAG,UAAU,CAAC,cAAc,EAAE,CAAC,CAAA;IAClH;;;;;OAKG;IACH,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,mBAAmB,GAAG,UAAU,CAAC,cAAc,GAAG,SAAS,CAAC,CAAA;IAC5H;;;;;OAKG;IACH,aAAa,CACX,OAAO,EAAE,MAAM,EACf,qBAAqB,CAAC,EAAE,YAAY,GAAG,MAAM,EAC7C,OAAO,CAAC,EAAE,mBAAmB,GAC5B,UAAU,CAAC,cAAc,GAAG,cAAc,EAAE,GAAG,SAAS,CAAC,CAAA;CAC7D;AAED,MAAM,WAAW,cAAc,CAAC,OAAO,SAAS,YAAY,GAAG,YAAY,EAAE,UAAU,SAAS,eAAe,GAAG,eAAe,CAC/H,SAAQ,YAAY,CAAC,OAAO,EAAE,UAAU,CAAC,EACvC,MAAM;CAAG"}
|
package/dist/node/Bridge.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Promisable } from '@xylabs/promise';
|
|
2
2
|
import { QueryBoundWitness } from '@xyo-network/boundwitness-model';
|
|
3
3
|
import { ModuleManifestPayload } from '@xyo-network/manifest-model';
|
|
4
|
-
import { AnyConfigSchema, ModuleConfig, ModuleEventData, ModuleFilter, ModuleFilterOptions, ModuleInstance, ModuleParams, ModuleQueryResult,
|
|
4
|
+
import { AnyConfigSchema, ModuleConfig, ModuleEventData, ModuleFilter, ModuleFilterOptions, ModuleInstance, ModuleParams, ModuleQueryResult, ModuleResolverInstance } from '@xyo-network/module-model';
|
|
5
5
|
import { Payload, Query } from '@xyo-network/payload-model';
|
|
6
6
|
import { BridgeConfig } from './Config';
|
|
7
7
|
export interface Bridge {
|
|
@@ -12,16 +12,75 @@ export interface Bridge {
|
|
|
12
12
|
export interface BridgeParams<TConfig extends AnyConfigSchema<BridgeConfig> = AnyConfigSchema<BridgeConfig>> extends ModuleParams<TConfig>, ModuleParams<TConfig> {
|
|
13
13
|
}
|
|
14
14
|
export interface BridgeModule<TParams extends BridgeParams = BridgeParams, TEventData extends ModuleEventData = ModuleEventData> extends ModuleInstance<TParams, TEventData> {
|
|
15
|
+
/**
|
|
16
|
+
* Returns the address of the base module that the bridge is connected to. Since discovery can be
|
|
17
|
+
* a recursive process, the root module is the module that the bridge is directly connected to even
|
|
18
|
+
* though its children (through potentially several generations) are also able to be communicated to
|
|
19
|
+
* across the bridge.
|
|
20
|
+
*/
|
|
15
21
|
getRootAddress(): Promisable<string>;
|
|
22
|
+
/**
|
|
23
|
+
* Returns the config for a bridged module
|
|
24
|
+
* @param address Address of the module connected to the bridge
|
|
25
|
+
*/
|
|
16
26
|
targetConfig(address: string): ModuleConfig;
|
|
27
|
+
/**
|
|
28
|
+
* Returns the result of a discover query for a bridged module
|
|
29
|
+
* @param address Address of the module connected to the bridge
|
|
30
|
+
* @param maxDepth
|
|
31
|
+
*/
|
|
17
32
|
targetDiscover(address?: string, maxDepth?: number): Promisable<Payload[]>;
|
|
18
|
-
|
|
33
|
+
/**
|
|
34
|
+
*
|
|
35
|
+
* @param address Address of the module connected to the bridge
|
|
36
|
+
*/
|
|
37
|
+
targetDownResolver(address?: string): ModuleResolverInstance | undefined;
|
|
38
|
+
/**
|
|
39
|
+
* Returns the result of a manifest query for a bridged module
|
|
40
|
+
* @param address Address of the module connected to the bridge
|
|
41
|
+
* @param maxDepth
|
|
42
|
+
*/
|
|
19
43
|
targetManifest(address?: string, maxDepth?: number): Promisable<ModuleManifestPayload>;
|
|
44
|
+
/**
|
|
45
|
+
* Returns the supported queries for a bridged module
|
|
46
|
+
* @param address Address of the module connected to the bridge
|
|
47
|
+
*/
|
|
20
48
|
targetQueries(address: string): string[];
|
|
49
|
+
/**
|
|
50
|
+
* Queries a module connected to the bridge using the supplied query, payloads, and query configuration
|
|
51
|
+
* @param address Address of the module connected to the bridge
|
|
52
|
+
* @param query The query to issue against the address
|
|
53
|
+
* @param payloads The payloads to use in the query
|
|
54
|
+
*/
|
|
21
55
|
targetQuery(address: string, query: Query, payloads?: Payload[]): Promisable<ModuleQueryResult>;
|
|
56
|
+
/**
|
|
57
|
+
* Determines if a bridged module is queryable using the supplied query, payloads, and query configuration
|
|
58
|
+
* @param address Address of the module connected to the bridge
|
|
59
|
+
* @param query The query to issue against the address
|
|
60
|
+
* @param payloads The payloads to use in the query
|
|
61
|
+
* @param queryConfig The query configuration
|
|
62
|
+
*/
|
|
22
63
|
targetQueryable(address: string, query: QueryBoundWitness, payloads?: Payload[], queryConfig?: ModuleConfig): Promisable<boolean>;
|
|
64
|
+
/**
|
|
65
|
+
*
|
|
66
|
+
* @param address Address of the module potentially connected to the bridge
|
|
67
|
+
* @param filter
|
|
68
|
+
* @param options
|
|
69
|
+
*/
|
|
23
70
|
targetResolve(address: string, filter?: ModuleFilter, options?: ModuleFilterOptions): Promisable<ModuleInstance[]>;
|
|
71
|
+
/**
|
|
72
|
+
*
|
|
73
|
+
* @param address Address of the module potentially connected to the bridge
|
|
74
|
+
* @param nameOrAddress
|
|
75
|
+
* @param options
|
|
76
|
+
*/
|
|
24
77
|
targetResolve(address: string, nameOrAddress: string, options?: ModuleFilterOptions): Promisable<ModuleInstance | undefined>;
|
|
78
|
+
/**
|
|
79
|
+
*
|
|
80
|
+
* @param address Address of the module potentially connected to the bridge
|
|
81
|
+
* @param nameOrAddressOrFilter
|
|
82
|
+
* @param options
|
|
83
|
+
*/
|
|
25
84
|
targetResolve(address: string, nameOrAddressOrFilter?: ModuleFilter | string, options?: ModuleFilterOptions): Promisable<ModuleInstance | ModuleInstance[] | undefined>;
|
|
26
85
|
}
|
|
27
86
|
export interface BridgeInstance<TParams extends BridgeParams = BridgeParams, TEventData extends ModuleEventData = ModuleEventData> extends BridgeModule<TParams, TEventData>, Bridge {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Bridge.d.ts","sourceRoot":"","sources":["../../src/Bridge.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAA;AACnE,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAA;AACnE,OAAO,EACL,eAAe,EACf,YAAY,EACZ,eAAe,EACf,YAAY,EACZ,mBAAmB,EACnB,cAAc,EACd,YAAY,EACZ,iBAAiB,EACjB,
|
|
1
|
+
{"version":3,"file":"Bridge.d.ts","sourceRoot":"","sources":["../../src/Bridge.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAA;AACnE,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAA;AACnE,OAAO,EACL,eAAe,EACf,YAAY,EACZ,eAAe,EACf,YAAY,EACZ,mBAAmB,EACnB,cAAc,EACd,YAAY,EACZ,iBAAiB,EACjB,sBAAsB,EACvB,MAAM,2BAA2B,CAAA;AAClC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAA;AAE3D,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAEvC,MAAM,WAAW,MAAM;IACrB,OAAO,EAAE,MAAM,UAAU,CAA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AAC,EAAE,OAAO,EAAE,EAAE,WAAW,CAAC,EAAE,YAAY,GAAG,UAAU,CAAC,OAAO,CAAC,CAAA;IAEjI;;;;;OAKG;IACH,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,YAAY,EAAE,OAAO,CAAC,EAAE,mBAAmB,GAAG,UAAU,CAAC,cAAc,EAAE,CAAC,CAAA;IAClH;;;;;OAKG;IACH,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,mBAAmB,GAAG,UAAU,CAAC,cAAc,GAAG,SAAS,CAAC,CAAA;IAC5H;;;;;OAKG;IACH,aAAa,CACX,OAAO,EAAE,MAAM,EACf,qBAAqB,CAAC,EAAE,YAAY,GAAG,MAAM,EAC7C,OAAO,CAAC,EAAE,mBAAmB,GAC5B,UAAU,CAAC,cAAc,GAAG,cAAc,EAAE,GAAG,SAAS,CAAC,CAAA;CAC7D;AAED,MAAM,WAAW,cAAc,CAAC,OAAO,SAAS,YAAY,GAAG,YAAY,EAAE,UAAU,SAAS,eAAe,GAAG,eAAe,CAC/H,SAAQ,YAAY,CAAC,OAAO,EAAE,UAAU,CAAC,EACvC,MAAM;CAAG"}
|
package/dist/node/Bridge.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Promisable } from '@xylabs/promise';
|
|
2
2
|
import { QueryBoundWitness } from '@xyo-network/boundwitness-model';
|
|
3
3
|
import { ModuleManifestPayload } from '@xyo-network/manifest-model';
|
|
4
|
-
import { AnyConfigSchema, ModuleConfig, ModuleEventData, ModuleFilter, ModuleFilterOptions, ModuleInstance, ModuleParams, ModuleQueryResult,
|
|
4
|
+
import { AnyConfigSchema, ModuleConfig, ModuleEventData, ModuleFilter, ModuleFilterOptions, ModuleInstance, ModuleParams, ModuleQueryResult, ModuleResolverInstance } from '@xyo-network/module-model';
|
|
5
5
|
import { Payload, Query } from '@xyo-network/payload-model';
|
|
6
6
|
import { BridgeConfig } from './Config';
|
|
7
7
|
export interface Bridge {
|
|
@@ -12,16 +12,75 @@ export interface Bridge {
|
|
|
12
12
|
export interface BridgeParams<TConfig extends AnyConfigSchema<BridgeConfig> = AnyConfigSchema<BridgeConfig>> extends ModuleParams<TConfig>, ModuleParams<TConfig> {
|
|
13
13
|
}
|
|
14
14
|
export interface BridgeModule<TParams extends BridgeParams = BridgeParams, TEventData extends ModuleEventData = ModuleEventData> extends ModuleInstance<TParams, TEventData> {
|
|
15
|
+
/**
|
|
16
|
+
* Returns the address of the base module that the bridge is connected to. Since discovery can be
|
|
17
|
+
* a recursive process, the root module is the module that the bridge is directly connected to even
|
|
18
|
+
* though its children (through potentially several generations) are also able to be communicated to
|
|
19
|
+
* across the bridge.
|
|
20
|
+
*/
|
|
15
21
|
getRootAddress(): Promisable<string>;
|
|
22
|
+
/**
|
|
23
|
+
* Returns the config for a bridged module
|
|
24
|
+
* @param address Address of the module connected to the bridge
|
|
25
|
+
*/
|
|
16
26
|
targetConfig(address: string): ModuleConfig;
|
|
27
|
+
/**
|
|
28
|
+
* Returns the result of a discover query for a bridged module
|
|
29
|
+
* @param address Address of the module connected to the bridge
|
|
30
|
+
* @param maxDepth
|
|
31
|
+
*/
|
|
17
32
|
targetDiscover(address?: string, maxDepth?: number): Promisable<Payload[]>;
|
|
18
|
-
|
|
33
|
+
/**
|
|
34
|
+
*
|
|
35
|
+
* @param address Address of the module connected to the bridge
|
|
36
|
+
*/
|
|
37
|
+
targetDownResolver(address?: string): ModuleResolverInstance | undefined;
|
|
38
|
+
/**
|
|
39
|
+
* Returns the result of a manifest query for a bridged module
|
|
40
|
+
* @param address Address of the module connected to the bridge
|
|
41
|
+
* @param maxDepth
|
|
42
|
+
*/
|
|
19
43
|
targetManifest(address?: string, maxDepth?: number): Promisable<ModuleManifestPayload>;
|
|
44
|
+
/**
|
|
45
|
+
* Returns the supported queries for a bridged module
|
|
46
|
+
* @param address Address of the module connected to the bridge
|
|
47
|
+
*/
|
|
20
48
|
targetQueries(address: string): string[];
|
|
49
|
+
/**
|
|
50
|
+
* Queries a module connected to the bridge using the supplied query, payloads, and query configuration
|
|
51
|
+
* @param address Address of the module connected to the bridge
|
|
52
|
+
* @param query The query to issue against the address
|
|
53
|
+
* @param payloads The payloads to use in the query
|
|
54
|
+
*/
|
|
21
55
|
targetQuery(address: string, query: Query, payloads?: Payload[]): Promisable<ModuleQueryResult>;
|
|
56
|
+
/**
|
|
57
|
+
* Determines if a bridged module is queryable using the supplied query, payloads, and query configuration
|
|
58
|
+
* @param address Address of the module connected to the bridge
|
|
59
|
+
* @param query The query to issue against the address
|
|
60
|
+
* @param payloads The payloads to use in the query
|
|
61
|
+
* @param queryConfig The query configuration
|
|
62
|
+
*/
|
|
22
63
|
targetQueryable(address: string, query: QueryBoundWitness, payloads?: Payload[], queryConfig?: ModuleConfig): Promisable<boolean>;
|
|
64
|
+
/**
|
|
65
|
+
*
|
|
66
|
+
* @param address Address of the module potentially connected to the bridge
|
|
67
|
+
* @param filter
|
|
68
|
+
* @param options
|
|
69
|
+
*/
|
|
23
70
|
targetResolve(address: string, filter?: ModuleFilter, options?: ModuleFilterOptions): Promisable<ModuleInstance[]>;
|
|
71
|
+
/**
|
|
72
|
+
*
|
|
73
|
+
* @param address Address of the module potentially connected to the bridge
|
|
74
|
+
* @param nameOrAddress
|
|
75
|
+
* @param options
|
|
76
|
+
*/
|
|
24
77
|
targetResolve(address: string, nameOrAddress: string, options?: ModuleFilterOptions): Promisable<ModuleInstance | undefined>;
|
|
78
|
+
/**
|
|
79
|
+
*
|
|
80
|
+
* @param address Address of the module potentially connected to the bridge
|
|
81
|
+
* @param nameOrAddressOrFilter
|
|
82
|
+
* @param options
|
|
83
|
+
*/
|
|
25
84
|
targetResolve(address: string, nameOrAddressOrFilter?: ModuleFilter | string, options?: ModuleFilterOptions): Promisable<ModuleInstance | ModuleInstance[] | undefined>;
|
|
26
85
|
}
|
|
27
86
|
export interface BridgeInstance<TParams extends BridgeParams = BridgeParams, TEventData extends ModuleEventData = ModuleEventData> extends BridgeModule<TParams, TEventData>, Bridge {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Bridge.d.ts","sourceRoot":"","sources":["../../src/Bridge.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAA;AACnE,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAA;AACnE,OAAO,EACL,eAAe,EACf,YAAY,EACZ,eAAe,EACf,YAAY,EACZ,mBAAmB,EACnB,cAAc,EACd,YAAY,EACZ,iBAAiB,EACjB,
|
|
1
|
+
{"version":3,"file":"Bridge.d.ts","sourceRoot":"","sources":["../../src/Bridge.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAA;AACnE,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAA;AACnE,OAAO,EACL,eAAe,EACf,YAAY,EACZ,eAAe,EACf,YAAY,EACZ,mBAAmB,EACnB,cAAc,EACd,YAAY,EACZ,iBAAiB,EACjB,sBAAsB,EACvB,MAAM,2BAA2B,CAAA;AAClC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAA;AAE3D,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAEvC,MAAM,WAAW,MAAM;IACrB,OAAO,EAAE,MAAM,UAAU,CAAC,OAAO,CAAC,CAAA;IAClC,SAAS,EAAE,OAAO,CAAA;IAClB,UAAU,EAAE,MAAM,UAAU,CAAC,OAAO,CAAC,CAAA;CACtC;AAED,MAAM,WAAW,YAAY,CAAC,OAAO,SAAS,eAAe,CAAC,YAAY,CAAC,GAAG,eAAe,CAAC,YAAY,CAAC,CACzG,SAAQ,YAAY,CAA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EAAE,CAAC,CAAA;IAClH;;;;;OAKG;IACH,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,mBAAmB,GAAG,UAAU,CAAC,cAAc,GAAG,SAAS,CAAC,CAAA;IAC5H;;;;;OAKG;IACH,aAAa,CACX,OAAO,EAAE,MAAM,EACf,qBAAqB,CAAC,EAAE,YAAY,GAAG,MAAM,EAC7C,OAAO,CAAC,EAAE,mBAAmB,GAC5B,UAAU,CAAC,cAAc,GAAG,cAAc,EAAE,GAAG,SAAS,CAAC,CAAA;CAC7D;AAED,MAAM,WAAW,cAAc,CAAC,OAAO,SAAS,YAAY,GAAG,YAAY,EAAE,UAAU,SAAS,eAAe,GAAG,eAAe,CAC/H,SAAQ,YAAY,CAAC,OAAO,EAAE,UAAU,CAAC,EACvC,MAAM;CAAG"}
|
package/dist/node/Bridge.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Promisable } from '@xylabs/promise';
|
|
2
2
|
import { QueryBoundWitness } from '@xyo-network/boundwitness-model';
|
|
3
3
|
import { ModuleManifestPayload } from '@xyo-network/manifest-model';
|
|
4
|
-
import { AnyConfigSchema, ModuleConfig, ModuleEventData, ModuleFilter, ModuleFilterOptions, ModuleInstance, ModuleParams, ModuleQueryResult,
|
|
4
|
+
import { AnyConfigSchema, ModuleConfig, ModuleEventData, ModuleFilter, ModuleFilterOptions, ModuleInstance, ModuleParams, ModuleQueryResult, ModuleResolverInstance } from '@xyo-network/module-model';
|
|
5
5
|
import { Payload, Query } from '@xyo-network/payload-model';
|
|
6
6
|
import { BridgeConfig } from './Config';
|
|
7
7
|
export interface Bridge {
|
|
@@ -12,16 +12,75 @@ export interface Bridge {
|
|
|
12
12
|
export interface BridgeParams<TConfig extends AnyConfigSchema<BridgeConfig> = AnyConfigSchema<BridgeConfig>> extends ModuleParams<TConfig>, ModuleParams<TConfig> {
|
|
13
13
|
}
|
|
14
14
|
export interface BridgeModule<TParams extends BridgeParams = BridgeParams, TEventData extends ModuleEventData = ModuleEventData> extends ModuleInstance<TParams, TEventData> {
|
|
15
|
+
/**
|
|
16
|
+
* Returns the address of the base module that the bridge is connected to. Since discovery can be
|
|
17
|
+
* a recursive process, the root module is the module that the bridge is directly connected to even
|
|
18
|
+
* though its children (through potentially several generations) are also able to be communicated to
|
|
19
|
+
* across the bridge.
|
|
20
|
+
*/
|
|
15
21
|
getRootAddress(): Promisable<string>;
|
|
22
|
+
/**
|
|
23
|
+
* Returns the config for a bridged module
|
|
24
|
+
* @param address Address of the module connected to the bridge
|
|
25
|
+
*/
|
|
16
26
|
targetConfig(address: string): ModuleConfig;
|
|
27
|
+
/**
|
|
28
|
+
* Returns the result of a discover query for a bridged module
|
|
29
|
+
* @param address Address of the module connected to the bridge
|
|
30
|
+
* @param maxDepth
|
|
31
|
+
*/
|
|
17
32
|
targetDiscover(address?: string, maxDepth?: number): Promisable<Payload[]>;
|
|
18
|
-
|
|
33
|
+
/**
|
|
34
|
+
*
|
|
35
|
+
* @param address Address of the module connected to the bridge
|
|
36
|
+
*/
|
|
37
|
+
targetDownResolver(address?: string): ModuleResolverInstance | undefined;
|
|
38
|
+
/**
|
|
39
|
+
* Returns the result of a manifest query for a bridged module
|
|
40
|
+
* @param address Address of the module connected to the bridge
|
|
41
|
+
* @param maxDepth
|
|
42
|
+
*/
|
|
19
43
|
targetManifest(address?: string, maxDepth?: number): Promisable<ModuleManifestPayload>;
|
|
44
|
+
/**
|
|
45
|
+
* Returns the supported queries for a bridged module
|
|
46
|
+
* @param address Address of the module connected to the bridge
|
|
47
|
+
*/
|
|
20
48
|
targetQueries(address: string): string[];
|
|
49
|
+
/**
|
|
50
|
+
* Queries a module connected to the bridge using the supplied query, payloads, and query configuration
|
|
51
|
+
* @param address Address of the module connected to the bridge
|
|
52
|
+
* @param query The query to issue against the address
|
|
53
|
+
* @param payloads The payloads to use in the query
|
|
54
|
+
*/
|
|
21
55
|
targetQuery(address: string, query: Query, payloads?: Payload[]): Promisable<ModuleQueryResult>;
|
|
56
|
+
/**
|
|
57
|
+
* Determines if a bridged module is queryable using the supplied query, payloads, and query configuration
|
|
58
|
+
* @param address Address of the module connected to the bridge
|
|
59
|
+
* @param query The query to issue against the address
|
|
60
|
+
* @param payloads The payloads to use in the query
|
|
61
|
+
* @param queryConfig The query configuration
|
|
62
|
+
*/
|
|
22
63
|
targetQueryable(address: string, query: QueryBoundWitness, payloads?: Payload[], queryConfig?: ModuleConfig): Promisable<boolean>;
|
|
64
|
+
/**
|
|
65
|
+
*
|
|
66
|
+
* @param address Address of the module potentially connected to the bridge
|
|
67
|
+
* @param filter
|
|
68
|
+
* @param options
|
|
69
|
+
*/
|
|
23
70
|
targetResolve(address: string, filter?: ModuleFilter, options?: ModuleFilterOptions): Promisable<ModuleInstance[]>;
|
|
71
|
+
/**
|
|
72
|
+
*
|
|
73
|
+
* @param address Address of the module potentially connected to the bridge
|
|
74
|
+
* @param nameOrAddress
|
|
75
|
+
* @param options
|
|
76
|
+
*/
|
|
24
77
|
targetResolve(address: string, nameOrAddress: string, options?: ModuleFilterOptions): Promisable<ModuleInstance | undefined>;
|
|
78
|
+
/**
|
|
79
|
+
*
|
|
80
|
+
* @param address Address of the module potentially connected to the bridge
|
|
81
|
+
* @param nameOrAddressOrFilter
|
|
82
|
+
* @param options
|
|
83
|
+
*/
|
|
25
84
|
targetResolve(address: string, nameOrAddressOrFilter?: ModuleFilter | string, options?: ModuleFilterOptions): Promisable<ModuleInstance | ModuleInstance[] | undefined>;
|
|
26
85
|
}
|
|
27
86
|
export interface BridgeInstance<TParams extends BridgeParams = BridgeParams, TEventData extends ModuleEventData = ModuleEventData> extends BridgeModule<TParams, TEventData>, Bridge {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Bridge.d.ts","sourceRoot":"","sources":["../../src/Bridge.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC5C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f,qBAAqB,CAAC,EAAE,YAAY,GAAG,MAAM,EAC7C,OAAO,CAAC,EAAE,mBAAmB,GAC5B,UAAU,CAAC,cAAc,GAAG,cAAc,EAAE,GAAG,SAAS,CAAC,CAAA;CAC7D;AAED,MAAM,WAAW,cAAc,CAAC,OAAO,SAAS,YAAY,GAAG,YAAY,EAAE,UAAU,SAAS,eAAe,GAAG,eAAe,CAC/H,SAAQ,YAAY,CAAC,OAAO,EAAE,UAAU,CAAC,EACvC,MAAM;CAAG"}
|
package/package.json
CHANGED
|
@@ -12,10 +12,10 @@
|
|
|
12
12
|
"dependencies": {
|
|
13
13
|
"@xylabs/object": "^2.89.0",
|
|
14
14
|
"@xylabs/promise": "^2.14.0",
|
|
15
|
-
"@xyo-network/boundwitness-model": "~2.89.0
|
|
16
|
-
"@xyo-network/manifest-model": "~2.89.0
|
|
17
|
-
"@xyo-network/module-model": "~2.89.0
|
|
18
|
-
"@xyo-network/payload-model": "~2.89.0
|
|
15
|
+
"@xyo-network/boundwitness-model": "~2.89.0",
|
|
16
|
+
"@xyo-network/manifest-model": "~2.89.0",
|
|
17
|
+
"@xyo-network/module-model": "~2.89.0",
|
|
18
|
+
"@xyo-network/payload-model": "~2.89.0"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
21
|
"@xylabs/ts-scripts-yarn3": "^3.2.42",
|
|
@@ -61,7 +61,6 @@
|
|
|
61
61
|
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js.git"
|
|
62
62
|
},
|
|
63
63
|
"sideEffects": false,
|
|
64
|
-
"version": "2.89.0
|
|
65
|
-
"type": "module"
|
|
66
|
-
"stableVersion": "2.88.3"
|
|
64
|
+
"version": "2.89.0",
|
|
65
|
+
"type": "module"
|
|
67
66
|
}
|
package/src/Bridge.ts
CHANGED
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
ModuleInstance,
|
|
11
11
|
ModuleParams,
|
|
12
12
|
ModuleQueryResult,
|
|
13
|
-
|
|
13
|
+
ModuleResolverInstance,
|
|
14
14
|
} from '@xyo-network/module-model'
|
|
15
15
|
import { Payload, Query } from '@xyo-network/payload-model'
|
|
16
16
|
|
|
@@ -28,17 +28,83 @@ export interface BridgeParams<TConfig extends AnyConfigSchema<BridgeConfig> = An
|
|
|
28
28
|
|
|
29
29
|
export interface BridgeModule<TParams extends BridgeParams = BridgeParams, TEventData extends ModuleEventData = ModuleEventData>
|
|
30
30
|
extends ModuleInstance<TParams, TEventData> {
|
|
31
|
+
/**
|
|
32
|
+
* Returns the address of the base module that the bridge is connected to. Since discovery can be
|
|
33
|
+
* a recursive process, the root module is the module that the bridge is directly connected to even
|
|
34
|
+
* though its children (through potentially several generations) are also able to be communicated to
|
|
35
|
+
* across the bridge.
|
|
36
|
+
*/
|
|
31
37
|
getRootAddress(): Promisable<string>
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Returns the config for a bridged module
|
|
41
|
+
* @param address Address of the module connected to the bridge
|
|
42
|
+
*/
|
|
32
43
|
targetConfig(address: string): ModuleConfig
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Returns the result of a discover query for a bridged module
|
|
47
|
+
* @param address Address of the module connected to the bridge
|
|
48
|
+
* @param maxDepth
|
|
49
|
+
*/
|
|
33
50
|
targetDiscover(address?: string, maxDepth?: number): Promisable<Payload[]>
|
|
34
|
-
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
*
|
|
54
|
+
* @param address Address of the module connected to the bridge
|
|
55
|
+
*/
|
|
56
|
+
targetDownResolver(address?: string): ModuleResolverInstance | undefined
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Returns the result of a manifest query for a bridged module
|
|
60
|
+
* @param address Address of the module connected to the bridge
|
|
61
|
+
* @param maxDepth
|
|
62
|
+
*/
|
|
35
63
|
targetManifest(address?: string, maxDepth?: number): Promisable<ModuleManifestPayload>
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Returns the supported queries for a bridged module
|
|
67
|
+
* @param address Address of the module connected to the bridge
|
|
68
|
+
*/
|
|
36
69
|
targetQueries(address: string): string[]
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Queries a module connected to the bridge using the supplied query, payloads, and query configuration
|
|
73
|
+
* @param address Address of the module connected to the bridge
|
|
74
|
+
* @param query The query to issue against the address
|
|
75
|
+
* @param payloads The payloads to use in the query
|
|
76
|
+
*/
|
|
37
77
|
targetQuery(address: string, query: Query, payloads?: Payload[]): Promisable<ModuleQueryResult>
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Determines if a bridged module is queryable using the supplied query, payloads, and query configuration
|
|
81
|
+
* @param address Address of the module connected to the bridge
|
|
82
|
+
* @param query The query to issue against the address
|
|
83
|
+
* @param payloads The payloads to use in the query
|
|
84
|
+
* @param queryConfig The query configuration
|
|
85
|
+
*/
|
|
38
86
|
targetQueryable(address: string, query: QueryBoundWitness, payloads?: Payload[], queryConfig?: ModuleConfig): Promisable<boolean>
|
|
39
87
|
|
|
88
|
+
/**
|
|
89
|
+
*
|
|
90
|
+
* @param address Address of the module potentially connected to the bridge
|
|
91
|
+
* @param filter
|
|
92
|
+
* @param options
|
|
93
|
+
*/
|
|
40
94
|
targetResolve(address: string, filter?: ModuleFilter, options?: ModuleFilterOptions): Promisable<ModuleInstance[]>
|
|
95
|
+
/**
|
|
96
|
+
*
|
|
97
|
+
* @param address Address of the module potentially connected to the bridge
|
|
98
|
+
* @param nameOrAddress
|
|
99
|
+
* @param options
|
|
100
|
+
*/
|
|
41
101
|
targetResolve(address: string, nameOrAddress: string, options?: ModuleFilterOptions): Promisable<ModuleInstance | undefined>
|
|
102
|
+
/**
|
|
103
|
+
*
|
|
104
|
+
* @param address Address of the module potentially connected to the bridge
|
|
105
|
+
* @param nameOrAddressOrFilter
|
|
106
|
+
* @param options
|
|
107
|
+
*/
|
|
42
108
|
targetResolve(
|
|
43
109
|
address: string,
|
|
44
110
|
nameOrAddressOrFilter?: ModuleFilter | string,
|