@xyo-network/module-factory-locator 5.3.25 → 5.3.27
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/README.md +354 -10
- package/package.json +31 -39
package/README.md
CHANGED
|
@@ -1,23 +1,367 @@
|
|
|
1
|
+
[![logo][]](https://xyo.network)
|
|
2
|
+
|
|
1
3
|
# @xyo-network/module-factory-locator
|
|
2
4
|
|
|
3
|
-
[![
|
|
5
|
+
[![npm][npm-badge]][npm-link]
|
|
6
|
+
[![license][license-badge]][license-link]
|
|
7
|
+
|
|
8
|
+
> Primary SDK for using XYO Protocol 2.0
|
|
9
|
+
|
|
10
|
+
## Install
|
|
11
|
+
|
|
12
|
+
Using npm:
|
|
13
|
+
|
|
14
|
+
```sh
|
|
15
|
+
npm install {{name}}
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Using yarn:
|
|
19
|
+
|
|
20
|
+
```sh
|
|
21
|
+
yarn add {{name}}
|
|
22
|
+
```
|
|
4
23
|
|
|
5
|
-
|
|
24
|
+
Using pnpm:
|
|
6
25
|
|
|
7
|
-
|
|
26
|
+
```sh
|
|
27
|
+
pnpm add {{name}}
|
|
28
|
+
```
|
|
8
29
|
|
|
9
|
-
|
|
30
|
+
Using bun:
|
|
10
31
|
|
|
11
|
-
|
|
32
|
+
```sh
|
|
33
|
+
bun add {{name}}
|
|
34
|
+
```
|
|
12
35
|
|
|
13
|
-
Part of [sdk-xyo-client-js](https://www.npmjs.com/package/@xyo-network/sdk-xyo-client-js)
|
|
14
36
|
|
|
15
37
|
## License
|
|
16
38
|
|
|
17
|
-
|
|
39
|
+
See the [LICENSE](LICENSE) file for license rights and limitations (LGPL-3.0-only).
|
|
40
|
+
|
|
41
|
+
## Reference
|
|
42
|
+
|
|
43
|
+
### packages
|
|
44
|
+
|
|
45
|
+
### modules
|
|
46
|
+
|
|
47
|
+
### packages
|
|
48
|
+
|
|
49
|
+
### module
|
|
50
|
+
|
|
51
|
+
### packages
|
|
52
|
+
|
|
53
|
+
### locator
|
|
54
|
+
|
|
55
|
+
### .temp-typedoc
|
|
56
|
+
|
|
57
|
+
### classes
|
|
58
|
+
|
|
59
|
+
### <a id="ModuleFactoryLocator"></a>ModuleFactoryLocator
|
|
60
|
+
|
|
61
|
+
[**@xyo-network/module-factory-locator**](#../README)
|
|
62
|
+
|
|
63
|
+
***
|
|
64
|
+
|
|
65
|
+
A class which encapsulates the Service Locator Pattern for Module Factories
|
|
66
|
+
|
|
67
|
+
## Implements
|
|
68
|
+
|
|
69
|
+
- `ModuleFactoryLocatorInstance`
|
|
70
|
+
|
|
71
|
+
## Constructors
|
|
72
|
+
|
|
73
|
+
### Constructor
|
|
74
|
+
|
|
75
|
+
```ts
|
|
76
|
+
new ModuleFactoryLocator(_registry?): ModuleFactoryLocator;
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### Parameters
|
|
80
|
+
|
|
81
|
+
#### \_registry?
|
|
82
|
+
|
|
83
|
+
`CreatableModuleRegistry` = `...`
|
|
84
|
+
|
|
85
|
+
### Returns
|
|
86
|
+
|
|
87
|
+
`ModuleFactoryLocator`
|
|
88
|
+
|
|
89
|
+
## Properties
|
|
90
|
+
|
|
91
|
+
### \_registry
|
|
92
|
+
|
|
93
|
+
```ts
|
|
94
|
+
protected readonly _registry: CreatableModuleRegistry;
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## Accessors
|
|
98
|
+
|
|
99
|
+
### registry
|
|
100
|
+
|
|
101
|
+
### Get Signature
|
|
102
|
+
|
|
103
|
+
```ts
|
|
104
|
+
get registry(): Readonly<CreatableModuleRegistry>;
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
The current registry for the module factory
|
|
108
|
+
|
|
109
|
+
#### Returns
|
|
110
|
+
|
|
111
|
+
`Readonly`\<`CreatableModuleRegistry`\>
|
|
112
|
+
|
|
113
|
+
### Implementation of
|
|
114
|
+
|
|
115
|
+
```ts
|
|
116
|
+
ModuleFactoryLocatorInstance.registry
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
## Methods
|
|
120
|
+
|
|
121
|
+
### empty()
|
|
122
|
+
|
|
123
|
+
```ts
|
|
124
|
+
static empty(): ModuleFactoryLocator;
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
### Returns
|
|
128
|
+
|
|
129
|
+
`ModuleFactoryLocator`
|
|
130
|
+
|
|
131
|
+
***
|
|
132
|
+
|
|
133
|
+
### standard()
|
|
134
|
+
|
|
135
|
+
```ts
|
|
136
|
+
static standard(): ModuleFactoryLocator;
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
### Returns
|
|
140
|
+
|
|
141
|
+
`ModuleFactoryLocator`
|
|
142
|
+
|
|
143
|
+
***
|
|
144
|
+
|
|
145
|
+
### freeze()
|
|
146
|
+
|
|
147
|
+
```ts
|
|
148
|
+
freeze(): void;
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
### Returns
|
|
152
|
+
|
|
153
|
+
`void`
|
|
154
|
+
|
|
155
|
+
### Implementation of
|
|
156
|
+
|
|
157
|
+
```ts
|
|
158
|
+
ModuleFactoryLocatorInstance.freeze
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
***
|
|
162
|
+
|
|
163
|
+
### locate()
|
|
164
|
+
|
|
165
|
+
```ts
|
|
166
|
+
locate(schema, labels?):
|
|
167
|
+
| CreatableModuleFactory<CreatableModuleInstance<QueryableModuleParams<AnyConfigSchema<ModuleConfig>>, ModuleEventData<object>>>
|
|
168
|
+
| LabeledCreatableModuleFactory;
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
Locates a module factory that matches the supplied schema and labels
|
|
172
|
+
|
|
173
|
+
### Parameters
|
|
174
|
+
|
|
175
|
+
#### schema
|
|
176
|
+
|
|
177
|
+
`Schema`
|
|
178
|
+
|
|
179
|
+
The config schema for the module
|
|
180
|
+
|
|
181
|
+
#### labels?
|
|
182
|
+
|
|
183
|
+
`Labels`
|
|
184
|
+
|
|
185
|
+
The labels for the module factory
|
|
186
|
+
|
|
187
|
+
### Returns
|
|
188
|
+
|
|
189
|
+
\| `CreatableModuleFactory`\<`CreatableModuleInstance`\<`QueryableModuleParams`\<`AnyConfigSchema`\<`ModuleConfig`\>\>, `ModuleEventData`\<`object`\>\>\>
|
|
190
|
+
\| `LabeledCreatableModuleFactory`
|
|
191
|
+
|
|
192
|
+
A module factory that matches the supplied schema and labels or throws if one is not found
|
|
193
|
+
|
|
194
|
+
### Implementation of
|
|
195
|
+
|
|
196
|
+
```ts
|
|
197
|
+
ModuleFactoryLocatorInstance.locate
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
***
|
|
201
|
+
|
|
202
|
+
### merge()
|
|
203
|
+
|
|
204
|
+
```ts
|
|
205
|
+
merge(locator): ModuleFactoryLocatorInstance;
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
### Parameters
|
|
209
|
+
|
|
210
|
+
#### locator
|
|
211
|
+
|
|
212
|
+
`ModuleFactoryLocatorInstance`
|
|
213
|
+
|
|
214
|
+
### Returns
|
|
215
|
+
|
|
216
|
+
`ModuleFactoryLocatorInstance`
|
|
217
|
+
|
|
218
|
+
### Implementation of
|
|
219
|
+
|
|
220
|
+
```ts
|
|
221
|
+
ModuleFactoryLocatorInstance.merge
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
***
|
|
225
|
+
|
|
226
|
+
### register()
|
|
227
|
+
|
|
228
|
+
```ts
|
|
229
|
+
register(
|
|
230
|
+
factory,
|
|
231
|
+
labels?,
|
|
232
|
+
primary?): this;
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
Registers a single module factory (with optional tags) with the locator
|
|
236
|
+
|
|
237
|
+
### Parameters
|
|
238
|
+
|
|
239
|
+
#### factory
|
|
240
|
+
|
|
241
|
+
`CreatableModuleFactory`
|
|
242
|
+
|
|
243
|
+
The factory to register
|
|
244
|
+
|
|
245
|
+
#### labels?
|
|
246
|
+
|
|
247
|
+
`Labels`
|
|
248
|
+
|
|
249
|
+
The labels for the module factory
|
|
250
|
+
|
|
251
|
+
#### primary?
|
|
252
|
+
|
|
253
|
+
`boolean` \| `Schema` \| `Schema`[]
|
|
254
|
+
|
|
255
|
+
### Returns
|
|
256
|
+
|
|
257
|
+
`this`
|
|
258
|
+
|
|
259
|
+
### Implementation of
|
|
260
|
+
|
|
261
|
+
```ts
|
|
262
|
+
ModuleFactoryLocatorInstance.register
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
***
|
|
266
|
+
|
|
267
|
+
### registerMany()
|
|
268
|
+
|
|
269
|
+
```ts
|
|
270
|
+
registerMany(factories): this;
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
Registers multiple module factories with the locator
|
|
274
|
+
|
|
275
|
+
### Parameters
|
|
276
|
+
|
|
277
|
+
#### factories
|
|
278
|
+
|
|
279
|
+
`CreatableModuleFactory`\<`CreatableModuleInstance`\<`QueryableModuleParams`\<`AnyConfigSchema`\<`ModuleConfig`\>\>, `ModuleEventData`\<`object`\>\>\>[]
|
|
280
|
+
|
|
281
|
+
The factories to register
|
|
282
|
+
|
|
283
|
+
### Returns
|
|
284
|
+
|
|
285
|
+
`this`
|
|
286
|
+
|
|
287
|
+
### Implementation of
|
|
288
|
+
|
|
289
|
+
```ts
|
|
290
|
+
ModuleFactoryLocatorInstance.registerMany
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
***
|
|
294
|
+
|
|
295
|
+
### tryLocate()
|
|
296
|
+
|
|
297
|
+
```ts
|
|
298
|
+
tryLocate(schema, labels?):
|
|
299
|
+
| CreatableModuleFactory<CreatableModuleInstance<QueryableModuleParams<AnyConfigSchema<ModuleConfig>>, ModuleEventData<object>>>
|
|
300
|
+
| LabeledCreatableModuleFactory
|
|
301
|
+
| undefined;
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
Tries to locate a module factory that matches the supplied schema and labels
|
|
305
|
+
|
|
306
|
+
### Parameters
|
|
307
|
+
|
|
308
|
+
#### schema
|
|
309
|
+
|
|
310
|
+
`Schema`
|
|
311
|
+
|
|
312
|
+
The config schema for the module
|
|
313
|
+
|
|
314
|
+
#### labels?
|
|
315
|
+
|
|
316
|
+
`Labels`
|
|
317
|
+
|
|
318
|
+
The labels for the module factory
|
|
319
|
+
|
|
320
|
+
### Returns
|
|
321
|
+
|
|
322
|
+
\| `CreatableModuleFactory`\<`CreatableModuleInstance`\<`QueryableModuleParams`\<`AnyConfigSchema`\<`ModuleConfig`\>\>, `ModuleEventData`\<`object`\>\>\>
|
|
323
|
+
\| `LabeledCreatableModuleFactory`
|
|
324
|
+
\| `undefined`
|
|
325
|
+
|
|
326
|
+
A module factory that matches the supplied schema and labels or undefined
|
|
327
|
+
|
|
328
|
+
### Implementation of
|
|
329
|
+
|
|
330
|
+
```ts
|
|
331
|
+
ModuleFactoryLocatorInstance.tryLocate
|
|
332
|
+
```
|
|
333
|
+
|
|
334
|
+
### functions
|
|
335
|
+
|
|
336
|
+
### <a id="standardCreatableFactories"></a>standardCreatableFactories
|
|
337
|
+
|
|
338
|
+
[**@xyo-network/module-factory-locator**](#../README)
|
|
339
|
+
|
|
340
|
+
***
|
|
341
|
+
|
|
342
|
+
```ts
|
|
343
|
+
function standardCreatableFactories(): CreatableModuleRegistry;
|
|
344
|
+
```
|
|
345
|
+
|
|
346
|
+
## Returns
|
|
347
|
+
|
|
348
|
+
`CreatableModuleRegistry`
|
|
349
|
+
|
|
350
|
+
### variables
|
|
351
|
+
|
|
352
|
+
### <a id="standardCreatableModulesList"></a>standardCreatableModulesList
|
|
353
|
+
|
|
354
|
+
[**@xyo-network/module-factory-locator**](#../README)
|
|
355
|
+
|
|
356
|
+
***
|
|
18
357
|
|
|
19
|
-
|
|
358
|
+
```ts
|
|
359
|
+
const standardCreatableModulesList: (CreatableModuleFactory | LabeledCreatableModuleFactory)[];
|
|
360
|
+
```
|
|
20
361
|
|
|
21
|
-
[Made with 🔥 and ❄️ by XYO](https://xyo.network)
|
|
22
362
|
|
|
23
|
-
[logo]: https://cdn.xy.company/img/brand/XYO_full_colored.png
|
|
363
|
+
[logo]: https://cdn.xy.company/img/brand/XYO_full_colored.png
|
|
364
|
+
[npm-badge]: https://img.shields.io/npm/v/@xyo-network/module-factory-locator.svg
|
|
365
|
+
[npm-link]: https://www.npmjs.com/package/@xyo-network/module-factory-locator
|
|
366
|
+
[license-badge]: https://img.shields.io/npm/l/@xyo-network/module-factory-locator.svg
|
|
367
|
+
[license-link]: https://github.com/xylabs/sdk-js/blob/main/LICENSE
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xyo-network/module-factory-locator",
|
|
3
|
-
"version": "5.3.
|
|
3
|
+
"version": "5.3.27",
|
|
4
4
|
"description": "Primary SDK for using XYO Protocol 2.0",
|
|
5
5
|
"homepage": "https://xyo.network",
|
|
6
6
|
"bugs": {
|
|
@@ -22,11 +22,11 @@
|
|
|
22
22
|
"exports": {
|
|
23
23
|
".": {
|
|
24
24
|
"types": "./dist/neutral/index.d.ts",
|
|
25
|
+
"import": "./dist/neutral/index.mjs",
|
|
25
26
|
"default": "./dist/neutral/index.mjs"
|
|
26
27
|
},
|
|
27
28
|
"./package.json": "./package.json"
|
|
28
29
|
},
|
|
29
|
-
"module": "dist/neutral/index.mjs",
|
|
30
30
|
"types": "dist/neutral/index.d.ts",
|
|
31
31
|
"files": [
|
|
32
32
|
"dist",
|
|
@@ -36,52 +36,44 @@
|
|
|
36
36
|
"README.md"
|
|
37
37
|
],
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@xyo-network/archivist-view": "~5.3.
|
|
40
|
-
"@xyo-network/
|
|
41
|
-
"@xyo-network/
|
|
42
|
-
"@xyo-network/diviner-
|
|
43
|
-
"@xyo-network/
|
|
44
|
-
"@xyo-network/diviner-payload-generic": "~5.3.
|
|
45
|
-
"@xyo-network/node-memory": "~5.3.
|
|
46
|
-
"@xyo-network/node-view": "~5.3.
|
|
47
|
-
"@xyo-network/payload-model": "~5.3.
|
|
48
|
-
"@xyo-network/sentinel-memory": "~5.3.
|
|
49
|
-
"@xyo-network/
|
|
50
|
-
"@xyo-network/
|
|
39
|
+
"@xyo-network/archivist-view": "~5.3.27",
|
|
40
|
+
"@xyo-network/archivist-memory": "~5.3.27",
|
|
41
|
+
"@xyo-network/bridge-http": "~5.3.27",
|
|
42
|
+
"@xyo-network/diviner-boundwitness-memory": "~5.3.27",
|
|
43
|
+
"@xyo-network/diviner-identity": "~5.3.27",
|
|
44
|
+
"@xyo-network/diviner-payload-generic": "~5.3.27",
|
|
45
|
+
"@xyo-network/node-memory": "~5.3.27",
|
|
46
|
+
"@xyo-network/node-view": "~5.3.27",
|
|
47
|
+
"@xyo-network/payload-model": "~5.3.27",
|
|
48
|
+
"@xyo-network/sentinel-memory": "~5.3.27",
|
|
49
|
+
"@xyo-network/module-model": "~5.3.27",
|
|
50
|
+
"@xyo-network/witness-adhoc": "~5.3.27"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@opentelemetry/api": "^1.9.1",
|
|
54
|
-
"@
|
|
55
|
-
"@xylabs/
|
|
56
|
-
"@xylabs/ts-scripts-
|
|
57
|
-
"@xylabs/
|
|
58
|
-
"@xylabs/tsconfig": "~7.6.16",
|
|
59
|
-
"acorn": "^8.16.0",
|
|
54
|
+
"@xylabs/sdk-js": "^5.0.94",
|
|
55
|
+
"@xylabs/ts-scripts-common": "~7.7.15",
|
|
56
|
+
"@xylabs/ts-scripts-pnpm": "~7.7.15",
|
|
57
|
+
"@xylabs/tsconfig": "~7.7.15",
|
|
60
58
|
"axios": "^1.14.0",
|
|
61
|
-
"esbuild": "^0.28.0",
|
|
62
59
|
"ethers": "^6.16.0",
|
|
63
|
-
"tslib": "^2.8.1",
|
|
64
60
|
"typescript": "~5.9.3",
|
|
65
61
|
"zod": "^4.3.6",
|
|
66
|
-
"@xyo-network/archivist-memory": "~5.3.
|
|
67
|
-
"@xyo-network/archivist-view": "~5.3.
|
|
68
|
-
"@xyo-network/
|
|
69
|
-
"@xyo-network/diviner-
|
|
70
|
-
"@xyo-network/diviner-identity": "~5.3.
|
|
71
|
-
"@xyo-network/
|
|
72
|
-
"@xyo-network/
|
|
73
|
-
"@xyo-network/
|
|
74
|
-
"@xyo-network/
|
|
75
|
-
"@xyo-network/
|
|
76
|
-
"@xyo-network/
|
|
77
|
-
"@xyo-network/witness-adhoc": "~5.3.
|
|
62
|
+
"@xyo-network/archivist-memory": "~5.3.27",
|
|
63
|
+
"@xyo-network/archivist-view": "~5.3.27",
|
|
64
|
+
"@xyo-network/diviner-boundwitness-memory": "~5.3.27",
|
|
65
|
+
"@xyo-network/diviner-payload-generic": "~5.3.27",
|
|
66
|
+
"@xyo-network/diviner-identity": "~5.3.27",
|
|
67
|
+
"@xyo-network/bridge-http": "~5.3.27",
|
|
68
|
+
"@xyo-network/node-memory": "~5.3.27",
|
|
69
|
+
"@xyo-network/module-model": "~5.3.27",
|
|
70
|
+
"@xyo-network/node-view": "~5.3.27",
|
|
71
|
+
"@xyo-network/payload-model": "~5.3.27",
|
|
72
|
+
"@xyo-network/sentinel-memory": "~5.3.27",
|
|
73
|
+
"@xyo-network/witness-adhoc": "~5.3.27"
|
|
78
74
|
},
|
|
79
75
|
"peerDependencies": {
|
|
80
|
-
"@xylabs/sdk-js": "^5"
|
|
81
|
-
"axios": "^1",
|
|
82
|
-
"ethers": "^6",
|
|
83
|
-
"tslib": "^2.8.1",
|
|
84
|
-
"zod": "^4"
|
|
76
|
+
"@xylabs/sdk-js": "^5"
|
|
85
77
|
},
|
|
86
78
|
"publishConfig": {
|
|
87
79
|
"access": "public"
|