@xyo-network/bridge-model 2.73.4 → 2.74.1
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/Bridge.d.mts +25 -0
- package/dist/Bridge.d.mts.map +1 -0
- package/dist/Bridge.d.ts +25 -0
- package/dist/Bridge.d.ts.map +1 -0
- package/dist/Config.d.mts +14 -0
- package/dist/Config.d.mts.map +1 -0
- package/dist/Config.d.ts +14 -0
- package/dist/Config.d.ts.map +1 -0
- package/dist/Queries/Connect.d.mts +8 -0
- package/dist/Queries/Connect.d.mts.map +1 -0
- package/dist/Queries/Connect.d.ts +8 -0
- package/dist/Queries/Connect.d.ts.map +1 -0
- package/dist/Queries/Connected.d.mts +7 -0
- package/dist/Queries/Connected.d.mts.map +1 -0
- package/dist/Queries/Connected.d.ts +7 -0
- package/dist/Queries/Connected.d.ts.map +1 -0
- package/dist/Queries/Disconnect.d.mts +8 -0
- package/dist/Queries/Disconnect.d.mts.map +1 -0
- package/dist/Queries/Disconnect.d.ts +8 -0
- package/dist/Queries/Disconnect.d.ts.map +1 -0
- package/dist/Queries/index.d.mts +12 -0
- package/dist/Queries/index.d.mts.map +1 -0
- package/dist/Queries/index.d.ts +12 -0
- package/dist/Queries/index.d.ts.map +1 -0
- package/dist/docs.json +14521 -14557
- package/dist/index.d.mts +5 -266
- package/dist/index.d.mts.map +1 -0
- package/dist/index.d.ts +5 -266
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/typeChecks.d.mts +198 -0
- package/dist/typeChecks.d.mts.map +1 -0
- package/dist/typeChecks.d.ts +198 -0
- package/dist/typeChecks.d.ts.map +1 -0
- package/package.json +10 -16
- package/src/typeChecks.ts +1 -1
- package/tsup.config.ts +0 -16
package/dist/index.d.mts
CHANGED
|
@@ -1,266 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import { Promisable } from '@xyo-network/promise';
|
|
7
|
-
import * as _xyo_network_core from '@xyo-network/core';
|
|
8
|
-
import { WithAdditional } from '@xyo-network/core';
|
|
9
|
-
import { ModuleConfig } from '@xyo-network/module';
|
|
10
|
-
import * as _xyo_network_wallet_model from '@xyo-network/wallet-model';
|
|
11
|
-
import * as _xyo_network_account_model from '@xyo-network/account-model';
|
|
12
|
-
import * as _xyo_network_object_identity from '@xyo-network/object-identity';
|
|
13
|
-
|
|
14
|
-
type BridgeConfigSchema = 'network.xyo.bridge.config';
|
|
15
|
-
declare const BridgeConfigSchema: BridgeConfigSchema;
|
|
16
|
-
interface CacheConfig {
|
|
17
|
-
max?: number;
|
|
18
|
-
ttl?: number;
|
|
19
|
-
}
|
|
20
|
-
type BridgeConfig<TConfig extends Payload | undefined = undefined> = ModuleConfig<WithAdditional<{
|
|
21
|
-
discoverCache?: CacheConfig | true;
|
|
22
|
-
schema: TConfig extends Payload ? TConfig['schema'] : BridgeConfigSchema;
|
|
23
|
-
}, TConfig>>;
|
|
24
|
-
|
|
25
|
-
interface Bridge {
|
|
26
|
-
connect: () => Promisable<boolean>;
|
|
27
|
-
connected: boolean;
|
|
28
|
-
disconnect: () => Promisable<boolean>;
|
|
29
|
-
}
|
|
30
|
-
type BridgeParams<TConfig extends AnyConfigSchema<BridgeConfig> = AnyConfigSchema<BridgeConfig>> = ModuleParams<TConfig>;
|
|
31
|
-
interface BridgeModule<TParams extends BridgeParams = BridgeParams, TEventData extends ModuleEventData = ModuleEventData> extends ModuleInstance<TParams, TEventData> {
|
|
32
|
-
getRootAddress(): Promisable<string>;
|
|
33
|
-
targetConfig(address: string): ModuleConfig$1;
|
|
34
|
-
targetDiscover(address?: string): Promisable<Payload[]>;
|
|
35
|
-
targetDownResolver(address?: string): ModuleResolver | undefined;
|
|
36
|
-
targetQueries(address: string): string[];
|
|
37
|
-
targetQuery(address: string, query: Query, payloads?: Payload[]): Promisable<ModuleQueryResult>;
|
|
38
|
-
targetQueryable(address: string, query: QueryBoundWitness, payloads?: Payload[], queryConfig?: ModuleConfig$1): Promisable<boolean>;
|
|
39
|
-
targetResolve(address: string, filter?: ModuleFilter, options?: ModuleFilterOptions): Promisable<ModuleInstance[]>;
|
|
40
|
-
targetResolve(address: string, nameOrAddress: string, options?: ModuleFilterOptions): Promisable<ModuleInstance | undefined>;
|
|
41
|
-
targetResolve(address: string, nameOrAddressOrFilter?: ModuleFilter | string, options?: ModuleFilterOptions): Promisable<ModuleInstance | ModuleInstance[] | undefined>;
|
|
42
|
-
}
|
|
43
|
-
type BridgeInstance<TParams extends BridgeParams = BridgeParams, TEventData extends ModuleEventData = ModuleEventData> = BridgeModule<TParams, TEventData> & Bridge;
|
|
44
|
-
|
|
45
|
-
type BridgeConnectQuerySchema = 'network.xyo.query.bridge.connect';
|
|
46
|
-
declare const BridgeConnectQuerySchema: BridgeConnectQuerySchema;
|
|
47
|
-
type BridgeConnectQuery = Query<{
|
|
48
|
-
schema: BridgeConnectQuerySchema;
|
|
49
|
-
uri?: string;
|
|
50
|
-
}>;
|
|
51
|
-
|
|
52
|
-
type BridgeConnectedQuerySchema = 'network.xyo.query.bridge.connected';
|
|
53
|
-
declare const BridgeConnectedQuerySchema: BridgeConnectedQuerySchema;
|
|
54
|
-
type BridgeConnectedQuery = Query<{
|
|
55
|
-
schema: BridgeConnectedQuerySchema;
|
|
56
|
-
}>;
|
|
57
|
-
|
|
58
|
-
type BridgeDisconnectQuerySchema = 'network.xyo.query.bridge.disconnect';
|
|
59
|
-
declare const BridgeDisconnectQuerySchema: BridgeDisconnectQuerySchema;
|
|
60
|
-
type BridgeDisconnectQuery = Query<{
|
|
61
|
-
schema: BridgeDisconnectQuerySchema;
|
|
62
|
-
uri?: string;
|
|
63
|
-
}>;
|
|
64
|
-
|
|
65
|
-
type BridgeQueryBase = BridgeConnectQuery | BridgeDisconnectQuery | BridgeConnectedQuery;
|
|
66
|
-
type BridgeModuleQueries = ModuleQueryBase | BridgeQueryBase;
|
|
67
|
-
type BridgeQuery<T extends Query | void = void> = ModuleQuery<T extends Query ? BridgeQueryBase | T : BridgeQueryBase>;
|
|
68
|
-
|
|
69
|
-
declare const isBridgeInstance: _xyo_network_object_identity.ObjectTypeCheck<BridgeInstance>;
|
|
70
|
-
declare const isBridgeModule: _xyo_network_module_model.ModuleTypeCheck<BridgeModule<_xyo_network_core.BaseParamsFields & {
|
|
71
|
-
account?: _xyo_network_account_model.AccountInstance | "random" | undefined;
|
|
72
|
-
config: _xyo_network_payload_model.SchemaFields & _xyo_network_payload_model.PayloadFields & {
|
|
73
|
-
accountDerivationPath?: string | undefined;
|
|
74
|
-
readonly archivist?: _xyo_network_module_model.ArchivistModuleConfig | undefined;
|
|
75
|
-
readonly name?: string | undefined;
|
|
76
|
-
readonly paging?: Record<string, {
|
|
77
|
-
size?: number | undefined;
|
|
78
|
-
}> | undefined;
|
|
79
|
-
readonly schema: string;
|
|
80
|
-
readonly security?: {
|
|
81
|
-
readonly allowAnonymous?: boolean | undefined;
|
|
82
|
-
readonly allowed?: Record<string, (string | _xyo_network_module_model.CosigningAddressSet)[]> | undefined;
|
|
83
|
-
readonly disallowed?: Record<string, string[]> | undefined;
|
|
84
|
-
} | undefined;
|
|
85
|
-
readonly sign?: boolean | undefined;
|
|
86
|
-
readonly storeQueries?: boolean | undefined;
|
|
87
|
-
readonly timestamp?: boolean | undefined;
|
|
88
|
-
} & Omit<Omit<_xyo_network_payload_model.SchemaFields & _xyo_network_payload_model.PayloadFields & {
|
|
89
|
-
accountDerivationPath?: string | undefined;
|
|
90
|
-
readonly archivist?: _xyo_network_module_model.ArchivistModuleConfig | undefined;
|
|
91
|
-
readonly name?: string | undefined;
|
|
92
|
-
readonly paging?: Record<string, {
|
|
93
|
-
size?: number | undefined;
|
|
94
|
-
}> | undefined;
|
|
95
|
-
readonly schema: "network.xyo.bridge.config";
|
|
96
|
-
readonly security?: {
|
|
97
|
-
readonly allowAnonymous?: boolean | undefined;
|
|
98
|
-
readonly allowed?: Record<string, (string | _xyo_network_module_model.CosigningAddressSet)[]> | undefined;
|
|
99
|
-
readonly disallowed?: Record<string, string[]> | undefined;
|
|
100
|
-
} | undefined;
|
|
101
|
-
readonly sign?: boolean | undefined;
|
|
102
|
-
readonly storeQueries?: boolean | undefined;
|
|
103
|
-
readonly timestamp?: boolean | undefined;
|
|
104
|
-
} & Omit<{
|
|
105
|
-
discoverCache?: true | CacheConfig | undefined;
|
|
106
|
-
schema: "network.xyo.bridge.config";
|
|
107
|
-
}, "schema"> & {
|
|
108
|
-
schema: "network.xyo.bridge.config";
|
|
109
|
-
}, "schema"> & {
|
|
110
|
-
schema: string;
|
|
111
|
-
}, "schema"> & {
|
|
112
|
-
schema: string;
|
|
113
|
-
};
|
|
114
|
-
ephemeralQueryAccountEnabled?: boolean | undefined;
|
|
115
|
-
wallet?: _xyo_network_wallet_model.WalletInstance | undefined;
|
|
116
|
-
}, _xyo_network_module_model.ModuleEventData<object>>>;
|
|
117
|
-
declare const asBridgeModule: {
|
|
118
|
-
(obj: any, config?: _xyo_network_object_identity.ObjectTypeConfig | undefined): BridgeModule<_xyo_network_core.BaseParamsFields & {
|
|
119
|
-
account?: _xyo_network_account_model.AccountInstance | "random" | undefined;
|
|
120
|
-
config: _xyo_network_payload_model.SchemaFields & _xyo_network_payload_model.PayloadFields & {
|
|
121
|
-
accountDerivationPath?: string | undefined;
|
|
122
|
-
readonly archivist?: _xyo_network_module_model.ArchivistModuleConfig | undefined;
|
|
123
|
-
readonly name?: string | undefined;
|
|
124
|
-
readonly paging?: Record<string, {
|
|
125
|
-
size?: number | undefined;
|
|
126
|
-
}> | undefined;
|
|
127
|
-
readonly schema: string;
|
|
128
|
-
readonly security?: {
|
|
129
|
-
readonly allowAnonymous?: boolean | undefined;
|
|
130
|
-
readonly allowed?: Record<string, (string | _xyo_network_module_model.CosigningAddressSet)[]> | undefined;
|
|
131
|
-
readonly disallowed?: Record<string, string[]> | undefined;
|
|
132
|
-
} | undefined;
|
|
133
|
-
readonly sign?: boolean | undefined;
|
|
134
|
-
readonly storeQueries?: boolean | undefined;
|
|
135
|
-
readonly timestamp?: boolean | undefined;
|
|
136
|
-
} & Omit<Omit<_xyo_network_payload_model.SchemaFields & _xyo_network_payload_model.PayloadFields & {
|
|
137
|
-
accountDerivationPath?: string | undefined;
|
|
138
|
-
readonly archivist?: _xyo_network_module_model.ArchivistModuleConfig | undefined;
|
|
139
|
-
readonly name?: string | undefined;
|
|
140
|
-
readonly paging?: Record<string, {
|
|
141
|
-
size?: number | undefined;
|
|
142
|
-
}> | undefined;
|
|
143
|
-
readonly schema: "network.xyo.bridge.config";
|
|
144
|
-
readonly security?: {
|
|
145
|
-
readonly allowAnonymous?: boolean | undefined;
|
|
146
|
-
readonly allowed?: Record<string, (string | _xyo_network_module_model.CosigningAddressSet)[]> | undefined;
|
|
147
|
-
readonly disallowed?: Record<string, string[]> | undefined;
|
|
148
|
-
} | undefined;
|
|
149
|
-
readonly sign?: boolean | undefined;
|
|
150
|
-
readonly storeQueries?: boolean | undefined;
|
|
151
|
-
readonly timestamp?: boolean | undefined;
|
|
152
|
-
} & Omit<{
|
|
153
|
-
discoverCache?: true | CacheConfig | undefined;
|
|
154
|
-
schema: "network.xyo.bridge.config";
|
|
155
|
-
}, "schema"> & {
|
|
156
|
-
schema: "network.xyo.bridge.config";
|
|
157
|
-
}, "schema"> & {
|
|
158
|
-
schema: string;
|
|
159
|
-
}, "schema"> & {
|
|
160
|
-
schema: string;
|
|
161
|
-
};
|
|
162
|
-
ephemeralQueryAccountEnabled?: boolean | undefined;
|
|
163
|
-
wallet?: _xyo_network_wallet_model.WalletInstance | undefined;
|
|
164
|
-
}, _xyo_network_module_model.ModuleEventData<object>> | undefined;
|
|
165
|
-
(obj: any, assert: string | (() => string), config?: _xyo_network_object_identity.ObjectTypeConfig | undefined): BridgeModule<_xyo_network_core.BaseParamsFields & {
|
|
166
|
-
account?: _xyo_network_account_model.AccountInstance | "random" | undefined;
|
|
167
|
-
config: _xyo_network_payload_model.SchemaFields & _xyo_network_payload_model.PayloadFields & {
|
|
168
|
-
accountDerivationPath?: string | undefined;
|
|
169
|
-
readonly archivist?: _xyo_network_module_model.ArchivistModuleConfig | undefined;
|
|
170
|
-
readonly name?: string | undefined;
|
|
171
|
-
readonly paging?: Record<string, {
|
|
172
|
-
size?: number | undefined;
|
|
173
|
-
}> | undefined;
|
|
174
|
-
readonly schema: string;
|
|
175
|
-
readonly security?: {
|
|
176
|
-
readonly allowAnonymous?: boolean | undefined;
|
|
177
|
-
readonly allowed?: Record<string, (string | _xyo_network_module_model.CosigningAddressSet)[]> | undefined;
|
|
178
|
-
readonly disallowed?: Record<string, string[]> | undefined;
|
|
179
|
-
} | undefined;
|
|
180
|
-
readonly sign?: boolean | undefined;
|
|
181
|
-
readonly storeQueries?: boolean | undefined;
|
|
182
|
-
readonly timestamp?: boolean | undefined;
|
|
183
|
-
} & Omit<Omit<_xyo_network_payload_model.SchemaFields & _xyo_network_payload_model.PayloadFields & {
|
|
184
|
-
accountDerivationPath?: string | undefined;
|
|
185
|
-
readonly archivist?: _xyo_network_module_model.ArchivistModuleConfig | undefined;
|
|
186
|
-
readonly name?: string | undefined;
|
|
187
|
-
readonly paging?: Record<string, {
|
|
188
|
-
size?: number | undefined;
|
|
189
|
-
}> | undefined;
|
|
190
|
-
readonly schema: "network.xyo.bridge.config";
|
|
191
|
-
readonly security?: {
|
|
192
|
-
readonly allowAnonymous?: boolean | undefined;
|
|
193
|
-
readonly allowed?: Record<string, (string | _xyo_network_module_model.CosigningAddressSet)[]> | undefined;
|
|
194
|
-
readonly disallowed?: Record<string, string[]> | undefined;
|
|
195
|
-
} | undefined;
|
|
196
|
-
readonly sign?: boolean | undefined;
|
|
197
|
-
readonly storeQueries?: boolean | undefined;
|
|
198
|
-
readonly timestamp?: boolean | undefined;
|
|
199
|
-
} & Omit<{
|
|
200
|
-
discoverCache?: true | CacheConfig | undefined;
|
|
201
|
-
schema: "network.xyo.bridge.config";
|
|
202
|
-
}, "schema"> & {
|
|
203
|
-
schema: "network.xyo.bridge.config";
|
|
204
|
-
}, "schema"> & {
|
|
205
|
-
schema: string;
|
|
206
|
-
}, "schema"> & {
|
|
207
|
-
schema: string;
|
|
208
|
-
};
|
|
209
|
-
ephemeralQueryAccountEnabled?: boolean | undefined;
|
|
210
|
-
wallet?: _xyo_network_wallet_model.WalletInstance | undefined;
|
|
211
|
-
}, _xyo_network_module_model.ModuleEventData<object>>;
|
|
212
|
-
};
|
|
213
|
-
declare const asBridgeInstance: {
|
|
214
|
-
(obj: any, config?: _xyo_network_object_identity.ObjectTypeConfig | undefined): BridgeInstance | undefined;
|
|
215
|
-
(obj: any, assert: string | (() => string), config?: _xyo_network_object_identity.ObjectTypeConfig | undefined): BridgeInstance;
|
|
216
|
-
};
|
|
217
|
-
declare const withBridgeModule: <R>(module: any, closure: (module: BridgeModule<_xyo_network_core.BaseParamsFields & {
|
|
218
|
-
account?: _xyo_network_account_model.AccountInstance | "random" | undefined;
|
|
219
|
-
config: _xyo_network_payload_model.SchemaFields & _xyo_network_payload_model.PayloadFields & {
|
|
220
|
-
accountDerivationPath?: string | undefined;
|
|
221
|
-
readonly archivist?: _xyo_network_module_model.ArchivistModuleConfig | undefined;
|
|
222
|
-
readonly name?: string | undefined;
|
|
223
|
-
readonly paging?: Record<string, {
|
|
224
|
-
size?: number | undefined;
|
|
225
|
-
}> | undefined;
|
|
226
|
-
readonly schema: string;
|
|
227
|
-
readonly security?: {
|
|
228
|
-
readonly allowAnonymous?: boolean | undefined;
|
|
229
|
-
readonly allowed?: Record<string, (string | _xyo_network_module_model.CosigningAddressSet)[]> | undefined;
|
|
230
|
-
readonly disallowed?: Record<string, string[]> | undefined;
|
|
231
|
-
} | undefined;
|
|
232
|
-
readonly sign?: boolean | undefined;
|
|
233
|
-
readonly storeQueries?: boolean | undefined;
|
|
234
|
-
readonly timestamp?: boolean | undefined;
|
|
235
|
-
} & Omit<Omit<_xyo_network_payload_model.SchemaFields & _xyo_network_payload_model.PayloadFields & {
|
|
236
|
-
accountDerivationPath?: string | undefined;
|
|
237
|
-
readonly archivist?: _xyo_network_module_model.ArchivistModuleConfig | undefined;
|
|
238
|
-
readonly name?: string | undefined;
|
|
239
|
-
readonly paging?: Record<string, {
|
|
240
|
-
size?: number | undefined;
|
|
241
|
-
}> | undefined;
|
|
242
|
-
readonly schema: "network.xyo.bridge.config";
|
|
243
|
-
readonly security?: {
|
|
244
|
-
readonly allowAnonymous?: boolean | undefined;
|
|
245
|
-
readonly allowed?: Record<string, (string | _xyo_network_module_model.CosigningAddressSet)[]> | undefined;
|
|
246
|
-
readonly disallowed?: Record<string, string[]> | undefined;
|
|
247
|
-
} | undefined;
|
|
248
|
-
readonly sign?: boolean | undefined;
|
|
249
|
-
readonly storeQueries?: boolean | undefined;
|
|
250
|
-
readonly timestamp?: boolean | undefined;
|
|
251
|
-
} & Omit<{
|
|
252
|
-
discoverCache?: true | CacheConfig | undefined;
|
|
253
|
-
schema: "network.xyo.bridge.config";
|
|
254
|
-
}, "schema"> & {
|
|
255
|
-
schema: "network.xyo.bridge.config";
|
|
256
|
-
}, "schema"> & {
|
|
257
|
-
schema: string;
|
|
258
|
-
}, "schema"> & {
|
|
259
|
-
schema: string;
|
|
260
|
-
};
|
|
261
|
-
ephemeralQueryAccountEnabled?: boolean | undefined;
|
|
262
|
-
wallet?: _xyo_network_wallet_model.WalletInstance | undefined;
|
|
263
|
-
}, _xyo_network_module_model.ModuleEventData<object>>) => R) => R | undefined;
|
|
264
|
-
declare const withBridgeInstance: <R>(module: any, closure: (module: BridgeInstance) => R) => R | undefined;
|
|
265
|
-
|
|
266
|
-
export { Bridge, BridgeConfig, BridgeConfigSchema, BridgeConnectQuery, BridgeConnectQuerySchema, BridgeConnectedQuery, BridgeConnectedQuerySchema, BridgeDisconnectQuery, BridgeDisconnectQuerySchema, BridgeInstance, BridgeModule, BridgeModuleQueries, BridgeParams, BridgeQuery, BridgeQueryBase, CacheConfig, asBridgeInstance, asBridgeModule, isBridgeInstance, isBridgeModule, withBridgeInstance, withBridgeModule };
|
|
1
|
+
export * from './Bridge';
|
|
2
|
+
export * from './Config';
|
|
3
|
+
export * from './Queries';
|
|
4
|
+
export * from './typeChecks';
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA;AACzB,cAAc,cAAc,CAAA"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,266 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import { Promisable } from '@xyo-network/promise';
|
|
7
|
-
import * as _xyo_network_core from '@xyo-network/core';
|
|
8
|
-
import { WithAdditional } from '@xyo-network/core';
|
|
9
|
-
import { ModuleConfig } from '@xyo-network/module';
|
|
10
|
-
import * as _xyo_network_wallet_model from '@xyo-network/wallet-model';
|
|
11
|
-
import * as _xyo_network_account_model from '@xyo-network/account-model';
|
|
12
|
-
import * as _xyo_network_object_identity from '@xyo-network/object-identity';
|
|
13
|
-
|
|
14
|
-
type BridgeConfigSchema = 'network.xyo.bridge.config';
|
|
15
|
-
declare const BridgeConfigSchema: BridgeConfigSchema;
|
|
16
|
-
interface CacheConfig {
|
|
17
|
-
max?: number;
|
|
18
|
-
ttl?: number;
|
|
19
|
-
}
|
|
20
|
-
type BridgeConfig<TConfig extends Payload | undefined = undefined> = ModuleConfig<WithAdditional<{
|
|
21
|
-
discoverCache?: CacheConfig | true;
|
|
22
|
-
schema: TConfig extends Payload ? TConfig['schema'] : BridgeConfigSchema;
|
|
23
|
-
}, TConfig>>;
|
|
24
|
-
|
|
25
|
-
interface Bridge {
|
|
26
|
-
connect: () => Promisable<boolean>;
|
|
27
|
-
connected: boolean;
|
|
28
|
-
disconnect: () => Promisable<boolean>;
|
|
29
|
-
}
|
|
30
|
-
type BridgeParams<TConfig extends AnyConfigSchema<BridgeConfig> = AnyConfigSchema<BridgeConfig>> = ModuleParams<TConfig>;
|
|
31
|
-
interface BridgeModule<TParams extends BridgeParams = BridgeParams, TEventData extends ModuleEventData = ModuleEventData> extends ModuleInstance<TParams, TEventData> {
|
|
32
|
-
getRootAddress(): Promisable<string>;
|
|
33
|
-
targetConfig(address: string): ModuleConfig$1;
|
|
34
|
-
targetDiscover(address?: string): Promisable<Payload[]>;
|
|
35
|
-
targetDownResolver(address?: string): ModuleResolver | undefined;
|
|
36
|
-
targetQueries(address: string): string[];
|
|
37
|
-
targetQuery(address: string, query: Query, payloads?: Payload[]): Promisable<ModuleQueryResult>;
|
|
38
|
-
targetQueryable(address: string, query: QueryBoundWitness, payloads?: Payload[], queryConfig?: ModuleConfig$1): Promisable<boolean>;
|
|
39
|
-
targetResolve(address: string, filter?: ModuleFilter, options?: ModuleFilterOptions): Promisable<ModuleInstance[]>;
|
|
40
|
-
targetResolve(address: string, nameOrAddress: string, options?: ModuleFilterOptions): Promisable<ModuleInstance | undefined>;
|
|
41
|
-
targetResolve(address: string, nameOrAddressOrFilter?: ModuleFilter | string, options?: ModuleFilterOptions): Promisable<ModuleInstance | ModuleInstance[] | undefined>;
|
|
42
|
-
}
|
|
43
|
-
type BridgeInstance<TParams extends BridgeParams = BridgeParams, TEventData extends ModuleEventData = ModuleEventData> = BridgeModule<TParams, TEventData> & Bridge;
|
|
44
|
-
|
|
45
|
-
type BridgeConnectQuerySchema = 'network.xyo.query.bridge.connect';
|
|
46
|
-
declare const BridgeConnectQuerySchema: BridgeConnectQuerySchema;
|
|
47
|
-
type BridgeConnectQuery = Query<{
|
|
48
|
-
schema: BridgeConnectQuerySchema;
|
|
49
|
-
uri?: string;
|
|
50
|
-
}>;
|
|
51
|
-
|
|
52
|
-
type BridgeConnectedQuerySchema = 'network.xyo.query.bridge.connected';
|
|
53
|
-
declare const BridgeConnectedQuerySchema: BridgeConnectedQuerySchema;
|
|
54
|
-
type BridgeConnectedQuery = Query<{
|
|
55
|
-
schema: BridgeConnectedQuerySchema;
|
|
56
|
-
}>;
|
|
57
|
-
|
|
58
|
-
type BridgeDisconnectQuerySchema = 'network.xyo.query.bridge.disconnect';
|
|
59
|
-
declare const BridgeDisconnectQuerySchema: BridgeDisconnectQuerySchema;
|
|
60
|
-
type BridgeDisconnectQuery = Query<{
|
|
61
|
-
schema: BridgeDisconnectQuerySchema;
|
|
62
|
-
uri?: string;
|
|
63
|
-
}>;
|
|
64
|
-
|
|
65
|
-
type BridgeQueryBase = BridgeConnectQuery | BridgeDisconnectQuery | BridgeConnectedQuery;
|
|
66
|
-
type BridgeModuleQueries = ModuleQueryBase | BridgeQueryBase;
|
|
67
|
-
type BridgeQuery<T extends Query | void = void> = ModuleQuery<T extends Query ? BridgeQueryBase | T : BridgeQueryBase>;
|
|
68
|
-
|
|
69
|
-
declare const isBridgeInstance: _xyo_network_object_identity.ObjectTypeCheck<BridgeInstance>;
|
|
70
|
-
declare const isBridgeModule: _xyo_network_module_model.ModuleTypeCheck<BridgeModule<_xyo_network_core.BaseParamsFields & {
|
|
71
|
-
account?: _xyo_network_account_model.AccountInstance | "random" | undefined;
|
|
72
|
-
config: _xyo_network_payload_model.SchemaFields & _xyo_network_payload_model.PayloadFields & {
|
|
73
|
-
accountDerivationPath?: string | undefined;
|
|
74
|
-
readonly archivist?: _xyo_network_module_model.ArchivistModuleConfig | undefined;
|
|
75
|
-
readonly name?: string | undefined;
|
|
76
|
-
readonly paging?: Record<string, {
|
|
77
|
-
size?: number | undefined;
|
|
78
|
-
}> | undefined;
|
|
79
|
-
readonly schema: string;
|
|
80
|
-
readonly security?: {
|
|
81
|
-
readonly allowAnonymous?: boolean | undefined;
|
|
82
|
-
readonly allowed?: Record<string, (string | _xyo_network_module_model.CosigningAddressSet)[]> | undefined;
|
|
83
|
-
readonly disallowed?: Record<string, string[]> | undefined;
|
|
84
|
-
} | undefined;
|
|
85
|
-
readonly sign?: boolean | undefined;
|
|
86
|
-
readonly storeQueries?: boolean | undefined;
|
|
87
|
-
readonly timestamp?: boolean | undefined;
|
|
88
|
-
} & Omit<Omit<_xyo_network_payload_model.SchemaFields & _xyo_network_payload_model.PayloadFields & {
|
|
89
|
-
accountDerivationPath?: string | undefined;
|
|
90
|
-
readonly archivist?: _xyo_network_module_model.ArchivistModuleConfig | undefined;
|
|
91
|
-
readonly name?: string | undefined;
|
|
92
|
-
readonly paging?: Record<string, {
|
|
93
|
-
size?: number | undefined;
|
|
94
|
-
}> | undefined;
|
|
95
|
-
readonly schema: "network.xyo.bridge.config";
|
|
96
|
-
readonly security?: {
|
|
97
|
-
readonly allowAnonymous?: boolean | undefined;
|
|
98
|
-
readonly allowed?: Record<string, (string | _xyo_network_module_model.CosigningAddressSet)[]> | undefined;
|
|
99
|
-
readonly disallowed?: Record<string, string[]> | undefined;
|
|
100
|
-
} | undefined;
|
|
101
|
-
readonly sign?: boolean | undefined;
|
|
102
|
-
readonly storeQueries?: boolean | undefined;
|
|
103
|
-
readonly timestamp?: boolean | undefined;
|
|
104
|
-
} & Omit<{
|
|
105
|
-
discoverCache?: true | CacheConfig | undefined;
|
|
106
|
-
schema: "network.xyo.bridge.config";
|
|
107
|
-
}, "schema"> & {
|
|
108
|
-
schema: "network.xyo.bridge.config";
|
|
109
|
-
}, "schema"> & {
|
|
110
|
-
schema: string;
|
|
111
|
-
}, "schema"> & {
|
|
112
|
-
schema: string;
|
|
113
|
-
};
|
|
114
|
-
ephemeralQueryAccountEnabled?: boolean | undefined;
|
|
115
|
-
wallet?: _xyo_network_wallet_model.WalletInstance | undefined;
|
|
116
|
-
}, _xyo_network_module_model.ModuleEventData<object>>>;
|
|
117
|
-
declare const asBridgeModule: {
|
|
118
|
-
(obj: any, config?: _xyo_network_object_identity.ObjectTypeConfig | undefined): BridgeModule<_xyo_network_core.BaseParamsFields & {
|
|
119
|
-
account?: _xyo_network_account_model.AccountInstance | "random" | undefined;
|
|
120
|
-
config: _xyo_network_payload_model.SchemaFields & _xyo_network_payload_model.PayloadFields & {
|
|
121
|
-
accountDerivationPath?: string | undefined;
|
|
122
|
-
readonly archivist?: _xyo_network_module_model.ArchivistModuleConfig | undefined;
|
|
123
|
-
readonly name?: string | undefined;
|
|
124
|
-
readonly paging?: Record<string, {
|
|
125
|
-
size?: number | undefined;
|
|
126
|
-
}> | undefined;
|
|
127
|
-
readonly schema: string;
|
|
128
|
-
readonly security?: {
|
|
129
|
-
readonly allowAnonymous?: boolean | undefined;
|
|
130
|
-
readonly allowed?: Record<string, (string | _xyo_network_module_model.CosigningAddressSet)[]> | undefined;
|
|
131
|
-
readonly disallowed?: Record<string, string[]> | undefined;
|
|
132
|
-
} | undefined;
|
|
133
|
-
readonly sign?: boolean | undefined;
|
|
134
|
-
readonly storeQueries?: boolean | undefined;
|
|
135
|
-
readonly timestamp?: boolean | undefined;
|
|
136
|
-
} & Omit<Omit<_xyo_network_payload_model.SchemaFields & _xyo_network_payload_model.PayloadFields & {
|
|
137
|
-
accountDerivationPath?: string | undefined;
|
|
138
|
-
readonly archivist?: _xyo_network_module_model.ArchivistModuleConfig | undefined;
|
|
139
|
-
readonly name?: string | undefined;
|
|
140
|
-
readonly paging?: Record<string, {
|
|
141
|
-
size?: number | undefined;
|
|
142
|
-
}> | undefined;
|
|
143
|
-
readonly schema: "network.xyo.bridge.config";
|
|
144
|
-
readonly security?: {
|
|
145
|
-
readonly allowAnonymous?: boolean | undefined;
|
|
146
|
-
readonly allowed?: Record<string, (string | _xyo_network_module_model.CosigningAddressSet)[]> | undefined;
|
|
147
|
-
readonly disallowed?: Record<string, string[]> | undefined;
|
|
148
|
-
} | undefined;
|
|
149
|
-
readonly sign?: boolean | undefined;
|
|
150
|
-
readonly storeQueries?: boolean | undefined;
|
|
151
|
-
readonly timestamp?: boolean | undefined;
|
|
152
|
-
} & Omit<{
|
|
153
|
-
discoverCache?: true | CacheConfig | undefined;
|
|
154
|
-
schema: "network.xyo.bridge.config";
|
|
155
|
-
}, "schema"> & {
|
|
156
|
-
schema: "network.xyo.bridge.config";
|
|
157
|
-
}, "schema"> & {
|
|
158
|
-
schema: string;
|
|
159
|
-
}, "schema"> & {
|
|
160
|
-
schema: string;
|
|
161
|
-
};
|
|
162
|
-
ephemeralQueryAccountEnabled?: boolean | undefined;
|
|
163
|
-
wallet?: _xyo_network_wallet_model.WalletInstance | undefined;
|
|
164
|
-
}, _xyo_network_module_model.ModuleEventData<object>> | undefined;
|
|
165
|
-
(obj: any, assert: string | (() => string), config?: _xyo_network_object_identity.ObjectTypeConfig | undefined): BridgeModule<_xyo_network_core.BaseParamsFields & {
|
|
166
|
-
account?: _xyo_network_account_model.AccountInstance | "random" | undefined;
|
|
167
|
-
config: _xyo_network_payload_model.SchemaFields & _xyo_network_payload_model.PayloadFields & {
|
|
168
|
-
accountDerivationPath?: string | undefined;
|
|
169
|
-
readonly archivist?: _xyo_network_module_model.ArchivistModuleConfig | undefined;
|
|
170
|
-
readonly name?: string | undefined;
|
|
171
|
-
readonly paging?: Record<string, {
|
|
172
|
-
size?: number | undefined;
|
|
173
|
-
}> | undefined;
|
|
174
|
-
readonly schema: string;
|
|
175
|
-
readonly security?: {
|
|
176
|
-
readonly allowAnonymous?: boolean | undefined;
|
|
177
|
-
readonly allowed?: Record<string, (string | _xyo_network_module_model.CosigningAddressSet)[]> | undefined;
|
|
178
|
-
readonly disallowed?: Record<string, string[]> | undefined;
|
|
179
|
-
} | undefined;
|
|
180
|
-
readonly sign?: boolean | undefined;
|
|
181
|
-
readonly storeQueries?: boolean | undefined;
|
|
182
|
-
readonly timestamp?: boolean | undefined;
|
|
183
|
-
} & Omit<Omit<_xyo_network_payload_model.SchemaFields & _xyo_network_payload_model.PayloadFields & {
|
|
184
|
-
accountDerivationPath?: string | undefined;
|
|
185
|
-
readonly archivist?: _xyo_network_module_model.ArchivistModuleConfig | undefined;
|
|
186
|
-
readonly name?: string | undefined;
|
|
187
|
-
readonly paging?: Record<string, {
|
|
188
|
-
size?: number | undefined;
|
|
189
|
-
}> | undefined;
|
|
190
|
-
readonly schema: "network.xyo.bridge.config";
|
|
191
|
-
readonly security?: {
|
|
192
|
-
readonly allowAnonymous?: boolean | undefined;
|
|
193
|
-
readonly allowed?: Record<string, (string | _xyo_network_module_model.CosigningAddressSet)[]> | undefined;
|
|
194
|
-
readonly disallowed?: Record<string, string[]> | undefined;
|
|
195
|
-
} | undefined;
|
|
196
|
-
readonly sign?: boolean | undefined;
|
|
197
|
-
readonly storeQueries?: boolean | undefined;
|
|
198
|
-
readonly timestamp?: boolean | undefined;
|
|
199
|
-
} & Omit<{
|
|
200
|
-
discoverCache?: true | CacheConfig | undefined;
|
|
201
|
-
schema: "network.xyo.bridge.config";
|
|
202
|
-
}, "schema"> & {
|
|
203
|
-
schema: "network.xyo.bridge.config";
|
|
204
|
-
}, "schema"> & {
|
|
205
|
-
schema: string;
|
|
206
|
-
}, "schema"> & {
|
|
207
|
-
schema: string;
|
|
208
|
-
};
|
|
209
|
-
ephemeralQueryAccountEnabled?: boolean | undefined;
|
|
210
|
-
wallet?: _xyo_network_wallet_model.WalletInstance | undefined;
|
|
211
|
-
}, _xyo_network_module_model.ModuleEventData<object>>;
|
|
212
|
-
};
|
|
213
|
-
declare const asBridgeInstance: {
|
|
214
|
-
(obj: any, config?: _xyo_network_object_identity.ObjectTypeConfig | undefined): BridgeInstance | undefined;
|
|
215
|
-
(obj: any, assert: string | (() => string), config?: _xyo_network_object_identity.ObjectTypeConfig | undefined): BridgeInstance;
|
|
216
|
-
};
|
|
217
|
-
declare const withBridgeModule: <R>(module: any, closure: (module: BridgeModule<_xyo_network_core.BaseParamsFields & {
|
|
218
|
-
account?: _xyo_network_account_model.AccountInstance | "random" | undefined;
|
|
219
|
-
config: _xyo_network_payload_model.SchemaFields & _xyo_network_payload_model.PayloadFields & {
|
|
220
|
-
accountDerivationPath?: string | undefined;
|
|
221
|
-
readonly archivist?: _xyo_network_module_model.ArchivistModuleConfig | undefined;
|
|
222
|
-
readonly name?: string | undefined;
|
|
223
|
-
readonly paging?: Record<string, {
|
|
224
|
-
size?: number | undefined;
|
|
225
|
-
}> | undefined;
|
|
226
|
-
readonly schema: string;
|
|
227
|
-
readonly security?: {
|
|
228
|
-
readonly allowAnonymous?: boolean | undefined;
|
|
229
|
-
readonly allowed?: Record<string, (string | _xyo_network_module_model.CosigningAddressSet)[]> | undefined;
|
|
230
|
-
readonly disallowed?: Record<string, string[]> | undefined;
|
|
231
|
-
} | undefined;
|
|
232
|
-
readonly sign?: boolean | undefined;
|
|
233
|
-
readonly storeQueries?: boolean | undefined;
|
|
234
|
-
readonly timestamp?: boolean | undefined;
|
|
235
|
-
} & Omit<Omit<_xyo_network_payload_model.SchemaFields & _xyo_network_payload_model.PayloadFields & {
|
|
236
|
-
accountDerivationPath?: string | undefined;
|
|
237
|
-
readonly archivist?: _xyo_network_module_model.ArchivistModuleConfig | undefined;
|
|
238
|
-
readonly name?: string | undefined;
|
|
239
|
-
readonly paging?: Record<string, {
|
|
240
|
-
size?: number | undefined;
|
|
241
|
-
}> | undefined;
|
|
242
|
-
readonly schema: "network.xyo.bridge.config";
|
|
243
|
-
readonly security?: {
|
|
244
|
-
readonly allowAnonymous?: boolean | undefined;
|
|
245
|
-
readonly allowed?: Record<string, (string | _xyo_network_module_model.CosigningAddressSet)[]> | undefined;
|
|
246
|
-
readonly disallowed?: Record<string, string[]> | undefined;
|
|
247
|
-
} | undefined;
|
|
248
|
-
readonly sign?: boolean | undefined;
|
|
249
|
-
readonly storeQueries?: boolean | undefined;
|
|
250
|
-
readonly timestamp?: boolean | undefined;
|
|
251
|
-
} & Omit<{
|
|
252
|
-
discoverCache?: true | CacheConfig | undefined;
|
|
253
|
-
schema: "network.xyo.bridge.config";
|
|
254
|
-
}, "schema"> & {
|
|
255
|
-
schema: "network.xyo.bridge.config";
|
|
256
|
-
}, "schema"> & {
|
|
257
|
-
schema: string;
|
|
258
|
-
}, "schema"> & {
|
|
259
|
-
schema: string;
|
|
260
|
-
};
|
|
261
|
-
ephemeralQueryAccountEnabled?: boolean | undefined;
|
|
262
|
-
wallet?: _xyo_network_wallet_model.WalletInstance | undefined;
|
|
263
|
-
}, _xyo_network_module_model.ModuleEventData<object>>) => R) => R | undefined;
|
|
264
|
-
declare const withBridgeInstance: <R>(module: any, closure: (module: BridgeInstance) => R) => R | undefined;
|
|
265
|
-
|
|
266
|
-
export { Bridge, BridgeConfig, BridgeConfigSchema, BridgeConnectQuery, BridgeConnectQuerySchema, BridgeConnectedQuery, BridgeConnectedQuerySchema, BridgeDisconnectQuery, BridgeDisconnectQuerySchema, BridgeInstance, BridgeModule, BridgeModuleQueries, BridgeParams, BridgeQuery, BridgeQueryBase, CacheConfig, asBridgeInstance, asBridgeModule, isBridgeInstance, isBridgeModule, withBridgeInstance, withBridgeModule };
|
|
1
|
+
export * from './Bridge';
|
|
2
|
+
export * from './Config';
|
|
3
|
+
export * from './Queries';
|
|
4
|
+
export * from './typeChecks';
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA;AACzB,cAAc,cAAc,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -47,7 +47,7 @@ var BridgeDisconnectQuerySchema = "network.xyo.query.bridge.disconnect";
|
|
|
47
47
|
|
|
48
48
|
// src/typeChecks.ts
|
|
49
49
|
var import_module_model = require("@xyo-network/module-model");
|
|
50
|
-
var
|
|
50
|
+
var import_object = require("@xyo-network/object");
|
|
51
51
|
var isBridgeInstance = new import_module_model.IsInstanceFactory().create(
|
|
52
52
|
{
|
|
53
53
|
connect: "function",
|
|
@@ -56,8 +56,8 @@ var isBridgeInstance = new import_module_model.IsInstanceFactory().create(
|
|
|
56
56
|
[import_module_model.isModuleInstance]
|
|
57
57
|
);
|
|
58
58
|
var isBridgeModule = new import_module_model.IsModuleFactory().create([BridgeConnectQuerySchema, BridgeDisconnectQuerySchema]);
|
|
59
|
-
var asBridgeModule =
|
|
60
|
-
var asBridgeInstance =
|
|
59
|
+
var asBridgeModule = import_object.AsObjectFactory.create(isBridgeModule);
|
|
60
|
+
var asBridgeInstance = import_object.AsObjectFactory.create(isBridgeInstance);
|
|
61
61
|
var withBridgeModule = import_module_model.WithFactory.create(isBridgeModule);
|
|
62
62
|
var withBridgeInstance = import_module_model.WithFactory.create(isBridgeInstance);
|
|
63
63
|
// Annotate the CommonJS export names for ESM import in node:
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/Config.ts","../src/Queries/Connect.ts","../src/Queries/Connected.ts","../src/Queries/Disconnect.ts","../src/typeChecks.ts"],"sourcesContent":["export * from './Bridge'\nexport * from './Config'\nexport * from './Queries'\nexport * from './typeChecks'\n","import { WithAdditional } from '@xyo-network/core'\nimport { ModuleConfig } from '@xyo-network/module'\nimport { Payload } from '@xyo-network/payload-model'\n\nexport type BridgeConfigSchema = 'network.xyo.bridge.config'\nexport const BridgeConfigSchema: BridgeConfigSchema = 'network.xyo.bridge.config'\n\nexport interface CacheConfig {\n max?: number\n ttl?: number\n}\n\nexport type BridgeConfig<TConfig extends Payload | undefined = undefined> = ModuleConfig<\n WithAdditional<\n {\n discoverCache?: CacheConfig | true\n schema: TConfig extends Payload ? TConfig['schema'] : BridgeConfigSchema\n },\n TConfig\n >\n>\n","import { Query } from '@xyo-network/payload-model'\n\nexport type BridgeConnectQuerySchema = 'network.xyo.query.bridge.connect'\nexport const BridgeConnectQuerySchema: BridgeConnectQuerySchema = 'network.xyo.query.bridge.connect'\n\nexport type BridgeConnectQuery = Query<{\n schema: BridgeConnectQuerySchema\n uri?: string\n}>\n","import { Query } from '@xyo-network/payload-model'\n\nexport type BridgeConnectedQuerySchema = 'network.xyo.query.bridge.connected'\nexport const BridgeConnectedQuerySchema: BridgeConnectedQuerySchema = 'network.xyo.query.bridge.connected'\n\nexport type BridgeConnectedQuery = Query<{\n schema: BridgeConnectedQuerySchema\n}>\n","import { Query } from '@xyo-network/payload-model'\n\nexport type BridgeDisconnectQuerySchema = 'network.xyo.query.bridge.disconnect'\nexport const BridgeDisconnectQuerySchema: BridgeDisconnectQuerySchema = 'network.xyo.query.bridge.disconnect'\n\nexport type BridgeDisconnectQuery = Query<{\n schema: BridgeDisconnectQuerySchema\n uri?: string\n}>\n","import { IsInstanceFactory, IsModuleFactory, isModuleInstance, WithFactory } from '@xyo-network/module-model'\nimport { AsObjectFactory } from '@xyo-network/object
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/Config.ts","../src/Queries/Connect.ts","../src/Queries/Connected.ts","../src/Queries/Disconnect.ts","../src/typeChecks.ts"],"sourcesContent":["export * from './Bridge'\nexport * from './Config'\nexport * from './Queries'\nexport * from './typeChecks'\n","import { WithAdditional } from '@xyo-network/core'\nimport { ModuleConfig } from '@xyo-network/module'\nimport { Payload } from '@xyo-network/payload-model'\n\nexport type BridgeConfigSchema = 'network.xyo.bridge.config'\nexport const BridgeConfigSchema: BridgeConfigSchema = 'network.xyo.bridge.config'\n\nexport interface CacheConfig {\n max?: number\n ttl?: number\n}\n\nexport type BridgeConfig<TConfig extends Payload | undefined = undefined> = ModuleConfig<\n WithAdditional<\n {\n discoverCache?: CacheConfig | true\n schema: TConfig extends Payload ? TConfig['schema'] : BridgeConfigSchema\n },\n TConfig\n >\n>\n","import { Query } from '@xyo-network/payload-model'\n\nexport type BridgeConnectQuerySchema = 'network.xyo.query.bridge.connect'\nexport const BridgeConnectQuerySchema: BridgeConnectQuerySchema = 'network.xyo.query.bridge.connect'\n\nexport type BridgeConnectQuery = Query<{\n schema: BridgeConnectQuerySchema\n uri?: string\n}>\n","import { Query } from '@xyo-network/payload-model'\n\nexport type BridgeConnectedQuerySchema = 'network.xyo.query.bridge.connected'\nexport const BridgeConnectedQuerySchema: BridgeConnectedQuerySchema = 'network.xyo.query.bridge.connected'\n\nexport type BridgeConnectedQuery = Query<{\n schema: BridgeConnectedQuerySchema\n}>\n","import { Query } from '@xyo-network/payload-model'\n\nexport type BridgeDisconnectQuerySchema = 'network.xyo.query.bridge.disconnect'\nexport const BridgeDisconnectQuerySchema: BridgeDisconnectQuerySchema = 'network.xyo.query.bridge.disconnect'\n\nexport type BridgeDisconnectQuery = Query<{\n schema: BridgeDisconnectQuerySchema\n uri?: string\n}>\n","import { IsInstanceFactory, IsModuleFactory, isModuleInstance, WithFactory } from '@xyo-network/module-model'\nimport { AsObjectFactory } from '@xyo-network/object'\n\nimport { BridgeInstance, BridgeModule } from './Bridge'\nimport { BridgeConnectQuerySchema, BridgeDisconnectQuerySchema } from './Queries'\n\nexport const isBridgeInstance = new IsInstanceFactory<BridgeInstance>().create(\n {\n connect: 'function',\n disconnect: 'function',\n },\n [isModuleInstance],\n)\nexport const isBridgeModule = new IsModuleFactory<BridgeModule>().create([BridgeConnectQuerySchema, BridgeDisconnectQuerySchema])\n\nexport const asBridgeModule = AsObjectFactory.create(isBridgeModule)\nexport const asBridgeInstance = AsObjectFactory.create(isBridgeInstance)\nexport const withBridgeModule = WithFactory.create(isBridgeModule)\nexport const withBridgeInstance = WithFactory.create(isBridgeInstance)\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACKO,IAAM,qBAAyC;;;ACF/C,IAAM,2BAAqD;;;ACA3D,IAAM,6BAAyD;;;ACA/D,IAAM,8BAA2D;;;ACHxE,0BAAkF;AAClF,oBAAgC;AAKzB,IAAM,mBAAmB,IAAI,sCAAkC,EAAE;AAAA,EACtE;AAAA,IACE,SAAS;AAAA,IACT,YAAY;AAAA,EACd;AAAA,EACA,CAAC,oCAAgB;AACnB;AACO,IAAM,iBAAiB,IAAI,oCAA8B,EAAE,OAAO,CAAC,0BAA0B,2BAA2B,CAAC;AAEzH,IAAM,iBAAiB,8BAAgB,OAAO,cAAc;AAC5D,IAAM,mBAAmB,8BAAgB,OAAO,gBAAgB;AAChE,IAAM,mBAAmB,gCAAY,OAAO,cAAc;AAC1D,IAAM,qBAAqB,gCAAY,OAAO,gBAAgB;","names":[]}
|
package/dist/index.mjs
CHANGED
|
@@ -12,7 +12,7 @@ var BridgeDisconnectQuerySchema = "network.xyo.query.bridge.disconnect";
|
|
|
12
12
|
|
|
13
13
|
// src/typeChecks.ts
|
|
14
14
|
import { IsInstanceFactory, IsModuleFactory, isModuleInstance, WithFactory } from "@xyo-network/module-model";
|
|
15
|
-
import { AsObjectFactory } from "@xyo-network/object
|
|
15
|
+
import { AsObjectFactory } from "@xyo-network/object";
|
|
16
16
|
var isBridgeInstance = new IsInstanceFactory().create(
|
|
17
17
|
{
|
|
18
18
|
connect: "function",
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/Config.ts","../src/Queries/Connect.ts","../src/Queries/Connected.ts","../src/Queries/Disconnect.ts","../src/typeChecks.ts"],"sourcesContent":["import { WithAdditional } from '@xyo-network/core'\nimport { ModuleConfig } from '@xyo-network/module'\nimport { Payload } from '@xyo-network/payload-model'\n\nexport type BridgeConfigSchema = 'network.xyo.bridge.config'\nexport const BridgeConfigSchema: BridgeConfigSchema = 'network.xyo.bridge.config'\n\nexport interface CacheConfig {\n max?: number\n ttl?: number\n}\n\nexport type BridgeConfig<TConfig extends Payload | undefined = undefined> = ModuleConfig<\n WithAdditional<\n {\n discoverCache?: CacheConfig | true\n schema: TConfig extends Payload ? TConfig['schema'] : BridgeConfigSchema\n },\n TConfig\n >\n>\n","import { Query } from '@xyo-network/payload-model'\n\nexport type BridgeConnectQuerySchema = 'network.xyo.query.bridge.connect'\nexport const BridgeConnectQuerySchema: BridgeConnectQuerySchema = 'network.xyo.query.bridge.connect'\n\nexport type BridgeConnectQuery = Query<{\n schema: BridgeConnectQuerySchema\n uri?: string\n}>\n","import { Query } from '@xyo-network/payload-model'\n\nexport type BridgeConnectedQuerySchema = 'network.xyo.query.bridge.connected'\nexport const BridgeConnectedQuerySchema: BridgeConnectedQuerySchema = 'network.xyo.query.bridge.connected'\n\nexport type BridgeConnectedQuery = Query<{\n schema: BridgeConnectedQuerySchema\n}>\n","import { Query } from '@xyo-network/payload-model'\n\nexport type BridgeDisconnectQuerySchema = 'network.xyo.query.bridge.disconnect'\nexport const BridgeDisconnectQuerySchema: BridgeDisconnectQuerySchema = 'network.xyo.query.bridge.disconnect'\n\nexport type BridgeDisconnectQuery = Query<{\n schema: BridgeDisconnectQuerySchema\n uri?: string\n}>\n","import { IsInstanceFactory, IsModuleFactory, isModuleInstance, WithFactory } from '@xyo-network/module-model'\nimport { AsObjectFactory } from '@xyo-network/object
|
|
1
|
+
{"version":3,"sources":["../src/Config.ts","../src/Queries/Connect.ts","../src/Queries/Connected.ts","../src/Queries/Disconnect.ts","../src/typeChecks.ts"],"sourcesContent":["import { WithAdditional } from '@xyo-network/core'\nimport { ModuleConfig } from '@xyo-network/module'\nimport { Payload } from '@xyo-network/payload-model'\n\nexport type BridgeConfigSchema = 'network.xyo.bridge.config'\nexport const BridgeConfigSchema: BridgeConfigSchema = 'network.xyo.bridge.config'\n\nexport interface CacheConfig {\n max?: number\n ttl?: number\n}\n\nexport type BridgeConfig<TConfig extends Payload | undefined = undefined> = ModuleConfig<\n WithAdditional<\n {\n discoverCache?: CacheConfig | true\n schema: TConfig extends Payload ? TConfig['schema'] : BridgeConfigSchema\n },\n TConfig\n >\n>\n","import { Query } from '@xyo-network/payload-model'\n\nexport type BridgeConnectQuerySchema = 'network.xyo.query.bridge.connect'\nexport const BridgeConnectQuerySchema: BridgeConnectQuerySchema = 'network.xyo.query.bridge.connect'\n\nexport type BridgeConnectQuery = Query<{\n schema: BridgeConnectQuerySchema\n uri?: string\n}>\n","import { Query } from '@xyo-network/payload-model'\n\nexport type BridgeConnectedQuerySchema = 'network.xyo.query.bridge.connected'\nexport const BridgeConnectedQuerySchema: BridgeConnectedQuerySchema = 'network.xyo.query.bridge.connected'\n\nexport type BridgeConnectedQuery = Query<{\n schema: BridgeConnectedQuerySchema\n}>\n","import { Query } from '@xyo-network/payload-model'\n\nexport type BridgeDisconnectQuerySchema = 'network.xyo.query.bridge.disconnect'\nexport const BridgeDisconnectQuerySchema: BridgeDisconnectQuerySchema = 'network.xyo.query.bridge.disconnect'\n\nexport type BridgeDisconnectQuery = Query<{\n schema: BridgeDisconnectQuerySchema\n uri?: string\n}>\n","import { IsInstanceFactory, IsModuleFactory, isModuleInstance, WithFactory } from '@xyo-network/module-model'\nimport { AsObjectFactory } from '@xyo-network/object'\n\nimport { BridgeInstance, BridgeModule } from './Bridge'\nimport { BridgeConnectQuerySchema, BridgeDisconnectQuerySchema } from './Queries'\n\nexport const isBridgeInstance = new IsInstanceFactory<BridgeInstance>().create(\n {\n connect: 'function',\n disconnect: 'function',\n },\n [isModuleInstance],\n)\nexport const isBridgeModule = new IsModuleFactory<BridgeModule>().create([BridgeConnectQuerySchema, BridgeDisconnectQuerySchema])\n\nexport const asBridgeModule = AsObjectFactory.create(isBridgeModule)\nexport const asBridgeInstance = AsObjectFactory.create(isBridgeInstance)\nexport const withBridgeModule = WithFactory.create(isBridgeModule)\nexport const withBridgeInstance = WithFactory.create(isBridgeInstance)\n"],"mappings":";AAKO,IAAM,qBAAyC;;;ACF/C,IAAM,2BAAqD;;;ACA3D,IAAM,6BAAyD;;;ACA/D,IAAM,8BAA2D;;;ACHxE,SAAS,mBAAmB,iBAAiB,kBAAkB,mBAAmB;AAClF,SAAS,uBAAuB;AAKzB,IAAM,mBAAmB,IAAI,kBAAkC,EAAE;AAAA,EACtE;AAAA,IACE,SAAS;AAAA,IACT,YAAY;AAAA,EACd;AAAA,EACA,CAAC,gBAAgB;AACnB;AACO,IAAM,iBAAiB,IAAI,gBAA8B,EAAE,OAAO,CAAC,0BAA0B,2BAA2B,CAAC;AAEzH,IAAM,iBAAiB,gBAAgB,OAAO,cAAc;AAC5D,IAAM,mBAAmB,gBAAgB,OAAO,gBAAgB;AAChE,IAAM,mBAAmB,YAAY,OAAO,cAAc;AAC1D,IAAM,qBAAqB,YAAY,OAAO,gBAAgB;","names":[]}
|