@xyo-network/bridge-abstract 3.7.2 → 3.8.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/neutral/index.d.ts +433 -5
- package/dist/neutral/index.mjs +3 -3
- package/dist/neutral/index.mjs.map +1 -1
- package/package.json +26 -26
- package/src/AbstractBridge.ts +1 -1
- package/src/AbstractModuleProxy/AbstractModuleProxy.ts +3 -3
- package/dist/neutral/AbstractBridge.d.ts +0 -33
- package/dist/neutral/AbstractBridge.d.ts.map +0 -1
- package/dist/neutral/AbstractBridgeModuleResolver.d.ts +0 -23
- package/dist/neutral/AbstractBridgeModuleResolver.d.ts.map +0 -1
- package/dist/neutral/AbstractModuleProxy/AbstractModuleProxy.d.ts +0 -139
- package/dist/neutral/AbstractModuleProxy/AbstractModuleProxy.d.ts.map +0 -1
- package/dist/neutral/AbstractModuleProxy/ModuleProxyResolver.d.ts +0 -247
- package/dist/neutral/AbstractModuleProxy/ModuleProxyResolver.d.ts.map +0 -1
- package/dist/neutral/AbstractModuleProxy/index.d.ts +0 -3
- package/dist/neutral/AbstractModuleProxy/index.d.ts.map +0 -1
- package/dist/neutral/index.d.ts.map +0 -1
- package/dist/neutral/wrapModuleWithType.d.ts +0 -5
- package/dist/neutral/wrapModuleWithType.d.ts.map +0 -1
package/dist/neutral/index.d.ts
CHANGED
|
@@ -1,5 +1,433 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { Address } from '@xylabs/hex';
|
|
2
|
+
import { Promisable } from '@xylabs/promise';
|
|
3
|
+
import { ArchivistInstance } from '@xyo-network/archivist-model';
|
|
4
|
+
import { QueryBoundWitness } from '@xyo-network/boundwitness-model';
|
|
5
|
+
import { BridgeParams, BridgeModuleEventData, AttachableBridgeInstance, BridgeExposeOptions, BridgeUnexposeOptions, QuerySendFinishedEventArgs, QuerySendStartedEventArgs, BridgeInstance } from '@xyo-network/bridge-model';
|
|
6
|
+
import { AbstractModuleInstance } from '@xyo-network/module-abstract';
|
|
7
|
+
import * as _xyo_network_module_model from '@xyo-network/module-model';
|
|
8
|
+
import { ModuleInstance, ModuleResolverInstance, ModuleIdentifier, ModuleFilterOptions, ModuleQueryHandlerResult, ModuleParams, ModuleConfigSchema, ArchivingModuleConfig, ModuleResolver, ModuleName, Module, AddressPreviousHashPayload, ModuleQueryResult, ModuleIdentifierTransformer, ObjectFilterOptions, CacheConfig } from '@xyo-network/module-model';
|
|
9
|
+
import * as _xyo_network_payload_model from '@xyo-network/payload-model';
|
|
10
|
+
import { Schema, Payload, ModuleError } from '@xyo-network/payload-model';
|
|
11
|
+
import { AccountInstance } from '@xyo-network/account-model';
|
|
12
|
+
import { ModuleResolverParams, CompositeModuleResolver } from '@xyo-network/module-resolver';
|
|
13
|
+
import * as _xylabs_object from '@xylabs/object';
|
|
14
|
+
import * as _xylabs_logger from '@xylabs/logger';
|
|
15
|
+
import { ModuleManifestPayload } from '@xyo-network/manifest-model';
|
|
16
|
+
import * as _xyo_network_account from '@xyo-network/account';
|
|
17
|
+
import { ModuleWrapper } from '@xyo-network/module-wrapper';
|
|
18
|
+
|
|
19
|
+
declare abstract class AbstractBridge<TParams extends BridgeParams = BridgeParams> extends AbstractModuleInstance<TParams, BridgeModuleEventData> implements AttachableBridgeInstance<TParams, BridgeModuleEventData> {
|
|
20
|
+
static readonly configSchemas: Schema[];
|
|
21
|
+
static readonly defaultConfigSchema: Schema;
|
|
22
|
+
static readonly uniqueName: string;
|
|
23
|
+
protected _roots?: ModuleInstance[];
|
|
24
|
+
get allowNameResolution(): boolean;
|
|
25
|
+
get discoverRoots(): false | "start" | "lazy";
|
|
26
|
+
get queries(): string[];
|
|
27
|
+
get resolver(): Promisable<ModuleResolverInstance>;
|
|
28
|
+
expose(id: ModuleIdentifier, options?: BridgeExposeOptions | undefined): Promise<ModuleInstance[]>;
|
|
29
|
+
exposed(): Promise<Address[]>;
|
|
30
|
+
resolve(): Promise<ModuleInstance[]>;
|
|
31
|
+
resolve<T extends ModuleInstance = ModuleInstance>(all: '*', options?: ModuleFilterOptions<T>): Promise<T[]>;
|
|
32
|
+
resolve<T extends ModuleInstance = ModuleInstance>(id: ModuleIdentifier, options?: ModuleFilterOptions<T>): Promise<T | undefined>;
|
|
33
|
+
startHandler(): Promise<boolean>;
|
|
34
|
+
unexpose(id: ModuleIdentifier, options?: BridgeUnexposeOptions | undefined): Promise<Address[]>;
|
|
35
|
+
protected queryHandler<T extends QueryBoundWitness = QueryBoundWitness>(query: T, payloads?: Payload[]): Promise<ModuleQueryHandlerResult>;
|
|
36
|
+
protected resolveArchivingArchivists(): Promise<ArchivistInstance[]>;
|
|
37
|
+
abstract exposeHandler(address: Address, options?: BridgeExposeOptions | undefined): Promisable<ModuleInstance[]>;
|
|
38
|
+
abstract exposedHandler(): Promisable<Address[]>;
|
|
39
|
+
abstract getRoots(force?: boolean): Promise<ModuleInstance[]>;
|
|
40
|
+
abstract unexposeHandler(address: Address, options?: BridgeUnexposeOptions | undefined): Promisable<ModuleInstance[]>;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
type ModuleProxyParams = ModuleParams<{
|
|
44
|
+
schema: ModuleConfigSchema;
|
|
45
|
+
}, {
|
|
46
|
+
account: AccountInstance;
|
|
47
|
+
archiving?: ArchivingModuleConfig['archiving'] & {
|
|
48
|
+
resolveArchivists: () => Promise<ArchivistInstance[]>;
|
|
49
|
+
};
|
|
50
|
+
host: ModuleResolver;
|
|
51
|
+
manifest?: ModuleManifestPayload;
|
|
52
|
+
moduleAddress: Address;
|
|
53
|
+
onQuerySendFinished?: (args: Omit<QuerySendFinishedEventArgs, 'mod'>) => void;
|
|
54
|
+
onQuerySendStarted?: (args: Omit<QuerySendStartedEventArgs, 'mod'>) => void;
|
|
55
|
+
state?: Payload[];
|
|
56
|
+
}>;
|
|
57
|
+
declare abstract class AbstractModuleProxy<TWrappedModule extends ModuleInstance = ModuleInstance, TParams extends Omit<ModuleProxyParams, 'config'> & {
|
|
58
|
+
config: TWrappedModule['config'];
|
|
59
|
+
} = Omit<ModuleProxyParams, 'config'> & {
|
|
60
|
+
config: TWrappedModule['config'];
|
|
61
|
+
}> extends AbstractModuleInstance<TParams, TWrappedModule['eventData']> implements ModuleInstance<TParams, TWrappedModule['eventData']> {
|
|
62
|
+
static readonly requiredQueries: string[];
|
|
63
|
+
protected _config?: ModuleInstance['config'];
|
|
64
|
+
protected _publicChildren?: ModuleInstance[];
|
|
65
|
+
protected _state: Payload[] | undefined;
|
|
66
|
+
protected _stateInProcess: boolean;
|
|
67
|
+
private _spamTrap;
|
|
68
|
+
constructor(params: TParams);
|
|
69
|
+
get address(): Lowercase<string>;
|
|
70
|
+
get archiving(): ArchivingModuleConfig['archiving'] | undefined;
|
|
71
|
+
get config(): _xylabs_object.DeepRestrictToStringKeys<{
|
|
72
|
+
schema: _xyo_network_payload_model.Schema;
|
|
73
|
+
readonly archiving?: {
|
|
74
|
+
readonly archivists?: string[] | undefined;
|
|
75
|
+
readonly queries?: string[] | undefined;
|
|
76
|
+
} | undefined;
|
|
77
|
+
readonly allowedQueries?: string[] | undefined;
|
|
78
|
+
readonly archivist?: _xyo_network_module_model.ModuleIdentifier | undefined;
|
|
79
|
+
readonly consoleLogger?: _xylabs_logger.LogLevel | undefined;
|
|
80
|
+
readonly labels?: {
|
|
81
|
+
[x: string]: string | undefined;
|
|
82
|
+
} | undefined;
|
|
83
|
+
readonly name?: ModuleName | undefined;
|
|
84
|
+
readonly paging?: {
|
|
85
|
+
[x: string]: {
|
|
86
|
+
size?: number | undefined;
|
|
87
|
+
};
|
|
88
|
+
} | undefined;
|
|
89
|
+
readonly retry?: {
|
|
90
|
+
backoff?: number | undefined;
|
|
91
|
+
interval?: number | undefined;
|
|
92
|
+
retries?: number | undefined;
|
|
93
|
+
} | undefined;
|
|
94
|
+
readonly security?: {
|
|
95
|
+
readonly allowAnonymous?: boolean | undefined;
|
|
96
|
+
readonly allowed?: {
|
|
97
|
+
[x: string]: (Lowercase<string> | Lowercase<string>[])[];
|
|
98
|
+
} | undefined;
|
|
99
|
+
readonly disallowed?: {
|
|
100
|
+
[x: string]: Lowercase<string>[];
|
|
101
|
+
} | undefined;
|
|
102
|
+
} | undefined;
|
|
103
|
+
readonly sign?: boolean | undefined;
|
|
104
|
+
readonly storeQueries?: boolean | undefined;
|
|
105
|
+
readonly timestamp?: boolean | undefined;
|
|
106
|
+
}>;
|
|
107
|
+
get queries(): string[];
|
|
108
|
+
static hasRequiredQueries(mod: Module): boolean;
|
|
109
|
+
static missingRequiredQueries(mod: Module): string[];
|
|
110
|
+
addressPreviousHash(): Promise<AddressPreviousHashPayload>;
|
|
111
|
+
childAddressByName(name: ModuleName): Address | undefined;
|
|
112
|
+
childAddressMap(): Promise<Record<Address, ModuleName | null>>;
|
|
113
|
+
manifest(maxDepth?: number): Promise<ModuleManifestPayload>;
|
|
114
|
+
moduleAddress(): Promise<AddressPreviousHashPayload[]>;
|
|
115
|
+
previousHash(): Promise<string | undefined>;
|
|
116
|
+
publicChildren(): Promise<ModuleInstance<_xylabs_object.BaseParamsFields & {
|
|
117
|
+
account?: AccountInstance | "random";
|
|
118
|
+
addToResolvers?: boolean;
|
|
119
|
+
additionalSigners?: AccountInstance[];
|
|
120
|
+
allowNameResolution?: boolean;
|
|
121
|
+
config: _xylabs_object.DeepRestrictToStringKeys<{
|
|
122
|
+
schema: _xyo_network_payload_model.Schema;
|
|
123
|
+
readonly archiving?: {
|
|
124
|
+
readonly archivists?: string[] | undefined;
|
|
125
|
+
readonly queries?: string[] | undefined;
|
|
126
|
+
} | undefined;
|
|
127
|
+
readonly allowedQueries?: string[] | undefined;
|
|
128
|
+
readonly archivist?: _xyo_network_module_model.ModuleIdentifier | undefined;
|
|
129
|
+
readonly consoleLogger?: _xylabs_logger.LogLevel | undefined;
|
|
130
|
+
readonly labels?: {
|
|
131
|
+
[x: string]: string | undefined;
|
|
132
|
+
} | undefined;
|
|
133
|
+
readonly name?: ModuleName | undefined;
|
|
134
|
+
readonly paging?: {
|
|
135
|
+
[x: string]: {
|
|
136
|
+
size?: number | undefined;
|
|
137
|
+
};
|
|
138
|
+
} | undefined;
|
|
139
|
+
readonly retry?: {
|
|
140
|
+
backoff?: number | undefined;
|
|
141
|
+
interval?: number | undefined;
|
|
142
|
+
retries?: number | undefined;
|
|
143
|
+
} | undefined;
|
|
144
|
+
readonly security?: {
|
|
145
|
+
readonly allowAnonymous?: boolean | undefined;
|
|
146
|
+
readonly allowed?: {
|
|
147
|
+
[x: string]: (Lowercase<string> | Lowercase<string>[])[];
|
|
148
|
+
} | undefined;
|
|
149
|
+
readonly disallowed?: {
|
|
150
|
+
[x: string]: Lowercase<string>[];
|
|
151
|
+
} | undefined;
|
|
152
|
+
} | undefined;
|
|
153
|
+
readonly sign?: boolean | undefined;
|
|
154
|
+
readonly storeQueries?: boolean | undefined;
|
|
155
|
+
readonly timestamp?: boolean | undefined;
|
|
156
|
+
}>;
|
|
157
|
+
ephemeralQueryAccountEnabled?: boolean;
|
|
158
|
+
moduleIdentifierTransformers?: _xyo_network_module_model.ModuleIdentifierTransformer[];
|
|
159
|
+
}, _xyo_network_module_model.ModuleEventData<object>>[]>;
|
|
160
|
+
query<T extends QueryBoundWitness = QueryBoundWitness>(query: T, payloads?: Payload[]): Promise<ModuleQueryResult>;
|
|
161
|
+
queryHandler<T extends QueryBoundWitness = QueryBoundWitness>(_query: T, _payloads?: Payload[], _queryConfig?: TWrappedModule['params']['config']): Promise<ModuleQueryHandlerResult>;
|
|
162
|
+
queryable<T extends QueryBoundWitness = QueryBoundWitness>(_query: T, _payloads?: Payload[], _queryConfig?: TWrappedModule['params']['config']): Promise<boolean>;
|
|
163
|
+
resolveArchivingArchivists(): Promise<ArchivistInstance[]>;
|
|
164
|
+
setConfig(config: TWrappedModule['params']['config']): void;
|
|
165
|
+
setState(state: Payload[]): void;
|
|
166
|
+
startHandler(): Promise<boolean>;
|
|
167
|
+
state(): Promise<Payload[]>;
|
|
168
|
+
protected filterErrors(result: ModuleQueryResult): ModuleError[];
|
|
169
|
+
private checkSpam;
|
|
170
|
+
abstract proxyQueryHandler<T extends QueryBoundWitness = QueryBoundWitness>(query: T, payloads?: Payload[]): Promise<ModuleQueryResult>;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
interface ModuleProxyResolverOptions {
|
|
174
|
+
childAddressMap: Record<Address, ModuleName | null>;
|
|
175
|
+
childManifests?: Record<Address, ModuleManifestPayload>;
|
|
176
|
+
childStates?: Record<Address, ModuleManifestPayload>;
|
|
177
|
+
host: ModuleResolver;
|
|
178
|
+
mod: ModuleInstance;
|
|
179
|
+
moduleIdentifierTransformers?: ModuleIdentifierTransformer[];
|
|
180
|
+
}
|
|
181
|
+
declare class ModuleProxyResolver<T extends ModuleProxyResolverOptions = ModuleProxyResolverOptions> implements ModuleResolverInstance {
|
|
182
|
+
private options;
|
|
183
|
+
private downResolver;
|
|
184
|
+
constructor(options: T);
|
|
185
|
+
get priority(): 0;
|
|
186
|
+
get root(): ModuleInstance<_xylabs_object.BaseParamsFields & {
|
|
187
|
+
account?: _xyo_network_account.AccountInstance | "random";
|
|
188
|
+
addToResolvers?: boolean;
|
|
189
|
+
additionalSigners?: _xyo_network_account.AccountInstance[];
|
|
190
|
+
allowNameResolution?: boolean;
|
|
191
|
+
config: _xylabs_object.DeepRestrictToStringKeys<{
|
|
192
|
+
schema: _xyo_network_payload_model.Schema;
|
|
193
|
+
readonly archiving?: {
|
|
194
|
+
readonly archivists?: string[] | undefined;
|
|
195
|
+
readonly queries?: string[] | undefined;
|
|
196
|
+
} | undefined;
|
|
197
|
+
readonly allowedQueries?: string[] | undefined;
|
|
198
|
+
readonly archivist?: ModuleIdentifier | undefined;
|
|
199
|
+
readonly consoleLogger?: _xylabs_logger.LogLevel | undefined;
|
|
200
|
+
readonly labels?: {
|
|
201
|
+
[x: string]: string | undefined;
|
|
202
|
+
} | undefined;
|
|
203
|
+
readonly name?: ModuleName | undefined;
|
|
204
|
+
readonly paging?: {
|
|
205
|
+
[x: string]: {
|
|
206
|
+
size?: number | undefined;
|
|
207
|
+
};
|
|
208
|
+
} | undefined;
|
|
209
|
+
readonly retry?: {
|
|
210
|
+
backoff?: number | undefined;
|
|
211
|
+
interval?: number | undefined;
|
|
212
|
+
retries?: number | undefined;
|
|
213
|
+
} | undefined;
|
|
214
|
+
readonly security?: {
|
|
215
|
+
readonly allowAnonymous?: boolean | undefined;
|
|
216
|
+
readonly allowed?: {
|
|
217
|
+
[x: string]: (Lowercase<string> | Lowercase<string>[])[];
|
|
218
|
+
} | undefined;
|
|
219
|
+
readonly disallowed?: {
|
|
220
|
+
[x: string]: Lowercase<string>[];
|
|
221
|
+
} | undefined;
|
|
222
|
+
} | undefined;
|
|
223
|
+
readonly sign?: boolean | undefined;
|
|
224
|
+
readonly storeQueries?: boolean | undefined;
|
|
225
|
+
readonly timestamp?: boolean | undefined;
|
|
226
|
+
}>;
|
|
227
|
+
ephemeralQueryAccountEnabled?: boolean;
|
|
228
|
+
moduleIdentifierTransformers?: ModuleIdentifierTransformer[];
|
|
229
|
+
}, _xyo_network_module_model.ModuleEventData<object>>;
|
|
230
|
+
protected get childAddressMap(): Record<Lowercase<string>, string | null>;
|
|
231
|
+
protected get host(): ModuleResolver<ModuleInstance<_xylabs_object.BaseParamsFields & {
|
|
232
|
+
account?: _xyo_network_account.AccountInstance | "random";
|
|
233
|
+
addToResolvers?: boolean;
|
|
234
|
+
additionalSigners?: _xyo_network_account.AccountInstance[];
|
|
235
|
+
allowNameResolution?: boolean;
|
|
236
|
+
config: _xylabs_object.DeepRestrictToStringKeys<{
|
|
237
|
+
schema: _xyo_network_payload_model.Schema;
|
|
238
|
+
readonly archiving?: {
|
|
239
|
+
readonly archivists?: string[] | undefined;
|
|
240
|
+
readonly queries?: string[] | undefined;
|
|
241
|
+
} | undefined;
|
|
242
|
+
readonly allowedQueries?: string[] | undefined;
|
|
243
|
+
readonly archivist?: ModuleIdentifier | undefined;
|
|
244
|
+
readonly consoleLogger?: _xylabs_logger.LogLevel | undefined;
|
|
245
|
+
readonly labels?: {
|
|
246
|
+
[x: string]: string | undefined;
|
|
247
|
+
} | undefined;
|
|
248
|
+
readonly name?: ModuleName | undefined;
|
|
249
|
+
readonly paging?: {
|
|
250
|
+
[x: string]: {
|
|
251
|
+
size?: number | undefined;
|
|
252
|
+
};
|
|
253
|
+
} | undefined;
|
|
254
|
+
readonly retry?: {
|
|
255
|
+
backoff?: number | undefined;
|
|
256
|
+
interval?: number | undefined;
|
|
257
|
+
retries?: number | undefined;
|
|
258
|
+
} | undefined;
|
|
259
|
+
readonly security?: {
|
|
260
|
+
readonly allowAnonymous?: boolean | undefined;
|
|
261
|
+
readonly allowed?: {
|
|
262
|
+
[x: string]: (Lowercase<string> | Lowercase<string>[])[];
|
|
263
|
+
} | undefined;
|
|
264
|
+
readonly disallowed?: {
|
|
265
|
+
[x: string]: Lowercase<string>[];
|
|
266
|
+
} | undefined;
|
|
267
|
+
} | undefined;
|
|
268
|
+
readonly sign?: boolean | undefined;
|
|
269
|
+
readonly storeQueries?: boolean | undefined;
|
|
270
|
+
readonly timestamp?: boolean | undefined;
|
|
271
|
+
}>;
|
|
272
|
+
ephemeralQueryAccountEnabled?: boolean;
|
|
273
|
+
moduleIdentifierTransformers?: ModuleIdentifierTransformer[];
|
|
274
|
+
}, _xyo_network_module_model.ModuleEventData<object>>>;
|
|
275
|
+
protected get mod(): ModuleInstance<_xylabs_object.BaseParamsFields & {
|
|
276
|
+
account?: _xyo_network_account.AccountInstance | "random";
|
|
277
|
+
addToResolvers?: boolean;
|
|
278
|
+
additionalSigners?: _xyo_network_account.AccountInstance[];
|
|
279
|
+
allowNameResolution?: boolean;
|
|
280
|
+
config: _xylabs_object.DeepRestrictToStringKeys<{
|
|
281
|
+
schema: _xyo_network_payload_model.Schema;
|
|
282
|
+
readonly archiving?: {
|
|
283
|
+
readonly archivists?: string[] | undefined;
|
|
284
|
+
readonly queries?: string[] | undefined;
|
|
285
|
+
} | undefined;
|
|
286
|
+
readonly allowedQueries?: string[] | undefined;
|
|
287
|
+
readonly archivist?: ModuleIdentifier | undefined;
|
|
288
|
+
readonly consoleLogger?: _xylabs_logger.LogLevel | undefined;
|
|
289
|
+
readonly labels?: {
|
|
290
|
+
[x: string]: string | undefined;
|
|
291
|
+
} | undefined;
|
|
292
|
+
readonly name?: ModuleName | undefined;
|
|
293
|
+
readonly paging?: {
|
|
294
|
+
[x: string]: {
|
|
295
|
+
size?: number | undefined;
|
|
296
|
+
};
|
|
297
|
+
} | undefined;
|
|
298
|
+
readonly retry?: {
|
|
299
|
+
backoff?: number | undefined;
|
|
300
|
+
interval?: number | undefined;
|
|
301
|
+
retries?: number | undefined;
|
|
302
|
+
} | undefined;
|
|
303
|
+
readonly security?: {
|
|
304
|
+
readonly allowAnonymous?: boolean | undefined;
|
|
305
|
+
readonly allowed?: {
|
|
306
|
+
[x: string]: (Lowercase<string> | Lowercase<string>[])[];
|
|
307
|
+
} | undefined;
|
|
308
|
+
readonly disallowed?: {
|
|
309
|
+
[x: string]: Lowercase<string>[];
|
|
310
|
+
} | undefined;
|
|
311
|
+
} | undefined;
|
|
312
|
+
readonly sign?: boolean | undefined;
|
|
313
|
+
readonly storeQueries?: boolean | undefined;
|
|
314
|
+
readonly timestamp?: boolean | undefined;
|
|
315
|
+
}>;
|
|
316
|
+
ephemeralQueryAccountEnabled?: boolean;
|
|
317
|
+
moduleIdentifierTransformers?: ModuleIdentifierTransformer[];
|
|
318
|
+
}, _xyo_network_module_model.ModuleEventData<object>>;
|
|
319
|
+
addResolver(_resolver: ModuleResolver): this;
|
|
320
|
+
childManifest(address: Address): _xylabs_object.DeepRestrictToStringKeys<{
|
|
321
|
+
schema: "network.xyo.module.manifest";
|
|
322
|
+
config: {
|
|
323
|
+
accountPath?: string | undefined;
|
|
324
|
+
features?: string[] | undefined;
|
|
325
|
+
labels?: {
|
|
326
|
+
[x: string]: string | undefined;
|
|
327
|
+
} | undefined;
|
|
328
|
+
language?: string | undefined;
|
|
329
|
+
name: string;
|
|
330
|
+
os?: string | undefined;
|
|
331
|
+
schema: string;
|
|
332
|
+
};
|
|
333
|
+
lazyStart?: boolean | undefined;
|
|
334
|
+
status?: {
|
|
335
|
+
address: Address;
|
|
336
|
+
children?: {
|
|
337
|
+
[x: Lowercase<string>]: string | null;
|
|
338
|
+
} | undefined;
|
|
339
|
+
} | undefined;
|
|
340
|
+
description?: string | undefined;
|
|
341
|
+
}> | _xylabs_object.DeepRestrictToStringKeys<{
|
|
342
|
+
schema: "network.xyo.node.manifest";
|
|
343
|
+
config: {
|
|
344
|
+
accountPath?: string | undefined;
|
|
345
|
+
features?: string[] | undefined;
|
|
346
|
+
labels?: {
|
|
347
|
+
[x: string]: string | undefined;
|
|
348
|
+
} | undefined;
|
|
349
|
+
language?: string | undefined;
|
|
350
|
+
name: string;
|
|
351
|
+
os?: string | undefined;
|
|
352
|
+
schema: string;
|
|
353
|
+
};
|
|
354
|
+
lazyStart?: boolean | undefined;
|
|
355
|
+
status?: {
|
|
356
|
+
address: Address;
|
|
357
|
+
children?: {
|
|
358
|
+
[x: Lowercase<string>]: string | null;
|
|
359
|
+
} | undefined;
|
|
360
|
+
} | undefined;
|
|
361
|
+
description?: string | undefined;
|
|
362
|
+
}> | undefined;
|
|
363
|
+
childState(address: Address): _xylabs_object.DeepRestrictToStringKeys<{
|
|
364
|
+
schema: "network.xyo.module.manifest";
|
|
365
|
+
config: {
|
|
366
|
+
accountPath?: string | undefined;
|
|
367
|
+
features?: string[] | undefined;
|
|
368
|
+
labels?: {
|
|
369
|
+
[x: string]: string | undefined;
|
|
370
|
+
} | undefined;
|
|
371
|
+
language?: string | undefined;
|
|
372
|
+
name: string;
|
|
373
|
+
os?: string | undefined;
|
|
374
|
+
schema: string;
|
|
375
|
+
};
|
|
376
|
+
lazyStart?: boolean | undefined;
|
|
377
|
+
status?: {
|
|
378
|
+
address: Address;
|
|
379
|
+
children?: {
|
|
380
|
+
[x: Lowercase<string>]: string | null;
|
|
381
|
+
} | undefined;
|
|
382
|
+
} | undefined;
|
|
383
|
+
description?: string | undefined;
|
|
384
|
+
}> | _xylabs_object.DeepRestrictToStringKeys<{
|
|
385
|
+
schema: "network.xyo.node.manifest";
|
|
386
|
+
config: {
|
|
387
|
+
accountPath?: string | undefined;
|
|
388
|
+
features?: string[] | undefined;
|
|
389
|
+
labels?: {
|
|
390
|
+
[x: string]: string | undefined;
|
|
391
|
+
} | undefined;
|
|
392
|
+
language?: string | undefined;
|
|
393
|
+
name: string;
|
|
394
|
+
os?: string | undefined;
|
|
395
|
+
schema: string;
|
|
396
|
+
};
|
|
397
|
+
lazyStart?: boolean | undefined;
|
|
398
|
+
status?: {
|
|
399
|
+
address: Address;
|
|
400
|
+
children?: {
|
|
401
|
+
[x: Lowercase<string>]: string | null;
|
|
402
|
+
} | undefined;
|
|
403
|
+
} | undefined;
|
|
404
|
+
description?: string | undefined;
|
|
405
|
+
}> | undefined;
|
|
406
|
+
removeResolver(_resolver: ModuleResolver): this;
|
|
407
|
+
resolve(): Promise<ModuleInstance[]>;
|
|
408
|
+
resolve<T extends ModuleInstance = ModuleInstance>(all: '*', options?: ModuleFilterOptions<T>): Promise<T[]>;
|
|
409
|
+
resolve<T extends ModuleInstance = ModuleInstance>(id: ModuleIdentifier, options?: ModuleFilterOptions<T>): Promise<T | undefined>;
|
|
410
|
+
resolveIdentifier(id: ModuleIdentifier, _options?: ObjectFilterOptions): Promisable<Address | undefined>;
|
|
411
|
+
resolvePrivate<T extends ModuleInstance = ModuleInstance>(all: '*', options?: ObjectFilterOptions<T>): Promise<T[]>;
|
|
412
|
+
resolvePrivate<T extends ModuleInstance = ModuleInstance>(id: ModuleIdentifier, options?: ObjectFilterOptions<T>): Promise<T | undefined>;
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
interface BridgeModuleResolverParams extends ModuleResolverParams {
|
|
416
|
+
additionalSigners?: AccountInstance[];
|
|
417
|
+
archiving?: ArchivingModuleConfig['archiving'] & {
|
|
418
|
+
resolveArchivists: () => Promise<ArchivistInstance[]>;
|
|
419
|
+
};
|
|
420
|
+
bridge: BridgeInstance;
|
|
421
|
+
cacheConfig?: CacheConfig;
|
|
422
|
+
onQuerySendFinished?: (args: Omit<QuerySendFinishedEventArgs, 'mod'>) => void;
|
|
423
|
+
onQuerySendStarted?: (args: Omit<QuerySendStartedEventArgs, 'mod'>) => void;
|
|
424
|
+
wrapperAccount: AccountInstance;
|
|
425
|
+
}
|
|
426
|
+
declare abstract class AbstractBridgeModuleResolver<TParams extends BridgeModuleResolverParams = BridgeModuleResolverParams, TProxyParams extends ModuleProxyParams = ModuleProxyParams> extends CompositeModuleResolver<TParams> {
|
|
427
|
+
get priority(): 0;
|
|
428
|
+
resolveHandler<T extends ModuleInstance = ModuleInstance>(id: ModuleIdentifier, options?: ModuleFilterOptions<T>, _params?: Partial<TProxyParams>): Promise<T[]>;
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
declare const wrapModuleWithType: (mod: Module, account: AccountInstance) => ModuleWrapper;
|
|
432
|
+
|
|
433
|
+
export { AbstractBridge, AbstractBridgeModuleResolver, AbstractModuleProxy, type BridgeModuleResolverParams, type ModuleProxyParams, ModuleProxyResolver, type ModuleProxyResolverOptions, wrapModuleWithType };
|
package/dist/neutral/index.mjs
CHANGED
|
@@ -89,7 +89,7 @@ var AbstractBridge = class _AbstractBridge extends AbstractModuleInstance {
|
|
|
89
89
|
return modules.map((mod) => mod.address);
|
|
90
90
|
}
|
|
91
91
|
async queryHandler(query, payloads) {
|
|
92
|
-
const wrapper =
|
|
92
|
+
const wrapper = QueryBoundWitnessWrapper.parseQuery(query, payloads);
|
|
93
93
|
const queryPayload = await wrapper.getQuery();
|
|
94
94
|
const resultPayloads = [];
|
|
95
95
|
switch (queryPayload.schema) {
|
|
@@ -490,8 +490,8 @@ var AbstractModuleProxy = class _AbstractModuleProxy extends AbstractModuleInsta
|
|
|
490
490
|
}
|
|
491
491
|
return this._state;
|
|
492
492
|
}
|
|
493
|
-
|
|
494
|
-
const wrapper =
|
|
493
|
+
filterErrors(result) {
|
|
494
|
+
const wrapper = BoundWitnessWrapper.wrap(result[0], result[1]);
|
|
495
495
|
return wrapper.payloadsBySchema(ModuleErrorSchema);
|
|
496
496
|
}
|
|
497
497
|
// this checks and warns if we are getting spammed by the same query
|