@xyo-network/module-factory-locator 4.0.3 → 4.1.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.
@@ -0,0 +1,50 @@
1
+ import * as _xyo_network_module_model from '@xyo-network/module-model';
2
+ import { ModuleFactoryLocatorInstance, CreatableModuleRegistry, Labels, CreatableModuleFactory, LabeledCreatableModuleFactory } from '@xyo-network/module-model';
3
+ import { Schema } from '@xyo-network/payload-model';
4
+
5
+ /**
6
+ * A class which encapsulates the Service Locator Pattern for Module Factories
7
+ */
8
+ declare class ModuleFactoryLocator implements ModuleFactoryLocatorInstance {
9
+ protected readonly _registry: CreatableModuleRegistry;
10
+ private _frozen;
11
+ constructor(_registry?: CreatableModuleRegistry);
12
+ /**
13
+ * The current registry for the module factory
14
+ */
15
+ get registry(): Readonly<CreatableModuleRegistry>;
16
+ static empty(): ModuleFactoryLocator;
17
+ static standard(): ModuleFactoryLocator;
18
+ freeze(): void;
19
+ /**
20
+ * Locates a module factory that matches the supplied schema and labels
21
+ * @param schema The config schema for the module
22
+ * @param labels The labels for the module factory
23
+ * @returns A module factory that matches the supplied schema and labels or throws if one is not found
24
+ */
25
+ locate(schema: string, labels?: Labels): CreatableModuleFactory | LabeledCreatableModuleFactory;
26
+ merge(locator: ModuleFactoryLocatorInstance): ModuleFactoryLocatorInstance;
27
+ /**
28
+ * Registers a single module factory (with optional tags) with the locator
29
+ * @param factory The factory to register
30
+ * @param labels The labels for the module factory
31
+ */
32
+ register(factory: CreatableModuleFactory, labels?: Labels, primary?: boolean | Schema | Schema[]): this;
33
+ /**
34
+ * Registers multiple module factories with the locator
35
+ * @param factories The factories to register
36
+ */
37
+ registerMany(factories: CreatableModuleFactory[]): this;
38
+ /**
39
+ * Tries to locate a module factory that matches the supplied schema and labels
40
+ * @param schema The config schema for the module
41
+ * @param labels The labels for the module factory
42
+ * @returns A module factory that matches the supplied schema and labels or undefined
43
+ */
44
+ tryLocate(schema: string, labels?: Labels): CreatableModuleFactory | LabeledCreatableModuleFactory | undefined;
45
+ }
46
+
47
+ declare const standardCreatableModulesList: (CreatableModuleFactory | LabeledCreatableModuleFactory)[];
48
+ declare const standardCreatableFactories: () => _xyo_network_module_model.CreatableModuleRegistry;
49
+
50
+ export { ModuleFactoryLocator, standardCreatableFactories, standardCreatableModulesList };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xyo-network/module-factory-locator",
3
- "version": "4.0.3",
3
+ "version": "4.1.1",
4
4
  "description": "Primary SDK for using XYO Protocol 2.0",
5
5
  "homepage": "https://xyo.network",
6
6
  "bugs": {
@@ -21,32 +21,32 @@
21
21
  "type": "module",
22
22
  "exports": {
23
23
  ".": {
24
- "types": "./dist/types/index.d.ts",
24
+ "types": "./dist/neutral/index.d.ts",
25
25
  "default": "./dist/neutral/index.mjs"
26
26
  },
27
27
  "./package.json": "./package.json"
28
28
  },
29
29
  "module": "dist/neutral/index.mjs",
30
- "types": "dist/types/index.d.ts",
30
+ "types": "dist/neutral/index.d.ts",
31
31
  "dependencies": {
32
- "@xylabs/assert": "^4.13.4",
33
- "@xyo-network/archivist-memory": "^4.0.3",
34
- "@xyo-network/archivist-view": "^4.0.3",
35
- "@xyo-network/bridge-http": "^4.0.3",
36
- "@xyo-network/diviner-boundwitness-memory": "^4.0.3",
37
- "@xyo-network/diviner-identity": "^4.0.3",
38
- "@xyo-network/diviner-payload-generic": "^4.0.3",
39
- "@xyo-network/diviner-payload-memory": "^4.0.3",
40
- "@xyo-network/module-model": "^4.0.3",
41
- "@xyo-network/node-memory": "^4.0.3",
42
- "@xyo-network/node-view": "^4.0.3",
43
- "@xyo-network/payload-model": "^4.0.3",
44
- "@xyo-network/sentinel-memory": "^4.0.3",
45
- "@xyo-network/witness-adhoc": "^4.0.3"
32
+ "@xylabs/assert": "^4.13.15",
33
+ "@xyo-network/archivist-memory": "^4.1.1",
34
+ "@xyo-network/archivist-view": "^4.1.1",
35
+ "@xyo-network/bridge-http": "^4.1.1",
36
+ "@xyo-network/diviner-boundwitness-memory": "^4.1.1",
37
+ "@xyo-network/diviner-identity": "^4.1.1",
38
+ "@xyo-network/diviner-payload-generic": "^4.1.1",
39
+ "@xyo-network/module-model": "^4.1.1",
40
+ "@xyo-network/node-memory": "^4.1.1",
41
+ "@xyo-network/node-view": "^4.1.1",
42
+ "@xyo-network/payload-model": "^4.1.1",
43
+ "@xyo-network/sentinel-memory": "^4.1.1",
44
+ "@xyo-network/witness-adhoc": "^4.1.1"
46
45
  },
47
46
  "devDependencies": {
48
- "@xylabs/ts-scripts-yarn3": "^6.5.18",
49
- "@xylabs/tsconfig": "^6.5.18",
47
+ "@xylabs/ts-scripts-yarn3": "^7.0.0-rc.23",
48
+ "@xylabs/tsconfig": "^7.0.0-rc.23",
49
+ "@xyo-network/diviner-payload-memory": "^4.1.1",
50
50
  "typescript": "^5.8.3"
51
51
  },
52
52
  "publishConfig": {
@@ -1,3 +0,0 @@
1
- export * from './ModuleFactoryLocator.ts';
2
- export * from './standardCreatableFactories.ts';
3
- //# sourceMappingURL=index.d.ts.map
File without changes