@xyo-network/module-model 3.14.1 → 3.14.2

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,37 @@
1
+ import type { Schema } from '@xyo-network/payload-model';
2
+ import type { CreatableModuleFactory, CreatableModuleRegistry, LabeledCreatableModuleFactory } from './CreatableModule/index.ts';
3
+ import type { Labels } from './Labels/index.ts';
4
+ export interface ModuleFactoryLocatorInstance {
5
+ /**
6
+ * The current registry for the module factory
7
+ */
8
+ registry: Readonly<CreatableModuleRegistry>;
9
+ freeze(): void;
10
+ /**
11
+ * Locates a module factory that matches the supplied schema and labels
12
+ * @param schema The config schema for the module
13
+ * @param labels The labels for the module factory
14
+ * @returns A module factory that matches the supplied schema and labels or throws if one is not found
15
+ */
16
+ locate(schema: string, labels?: Labels): CreatableModuleFactory | LabeledCreatableModuleFactory;
17
+ merge(locator: ModuleFactoryLocatorInstance): ModuleFactoryLocatorInstance;
18
+ /**
19
+ * Registers a single module factory (with optional tags) with the locator
20
+ * @param factory The factory to register
21
+ * @param labels The labels for the module factory
22
+ */
23
+ register(factory: CreatableModuleFactory, labels?: Labels, primary?: boolean | Schema | Schema[]): ModuleFactoryLocatorInstance;
24
+ /**
25
+ * Registers multiple module factories with the locator
26
+ * @param factories The factories to register
27
+ */
28
+ registerMany(factories: CreatableModuleFactory[]): ModuleFactoryLocatorInstance;
29
+ /**
30
+ * Tries to locate a module factory that matches the supplied schema and labels
31
+ * @param schema The config schema for the module
32
+ * @param labels The labels for the module factory
33
+ * @returns A module factory that matches the supplied schema and labels or undefined
34
+ */
35
+ tryLocate(schema: string, labels?: Labels): CreatableModuleFactory | LabeledCreatableModuleFactory | undefined;
36
+ }
37
+ //# sourceMappingURL=ModuleFactoryLocatorInstance.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ModuleFactoryLocatorInstance.d.ts","sourceRoot":"","sources":["../../src/ModuleFactoryLocatorInstance.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAA;AAExD,OAAO,KAAK,EACV,sBAAsB,EAAE,uBAAuB,EAAE,6BAA6B,EAC/E,MAAM,4BAA4B,CAAA;AACnC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAE/C,MAAM,WAAW,4BAA4B;IAE3C;;OAEG;IACH,QAAQ,EAAE,QAAQ,CAAC,uBAAuB,CAAC,CAAA;IAE3C,MAAM,IAAI,IAAI,CAAA;IAEd;;;;;OAKG;IACH,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,sBAAsB,GAAG,6BAA6B,CAAA;IAE/F,KAAK,CAAC,OAAO,EAAE,4BAA4B,GAAG,4BAA4B,CAAA;IAE1E;;;;OAIG;IACH,QAAQ,CAAC,OAAO,EAAE,sBAAsB,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,EAAE,GAAG,4BAA4B,CAAA;IAE/H;;;OAGG;IACH,YAAY,CAAC,SAAS,EAAE,sBAAsB,EAAE,GAAG,4BAA4B,CAAA;IAE/E;;;;;OAKG;IACH,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,sBAAsB,GAAG,6BAA6B,GAAG,SAAS,CAAA;CAC/G"}
@@ -8,6 +8,7 @@ export * from './Labels/index.ts';
8
8
  export * from './lib/index.ts';
9
9
  export * from './module/index.ts';
10
10
  export * from './ModuleDescription.ts';
11
+ export * from './ModuleFactoryLocatorInstance.ts';
11
12
  export * from './ModuleIdentifier.ts';
12
13
  export * from './ModuleIdentifierTransformer.ts';
13
14
  export * from './ModuleParams.ts';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA;AAC1B,cAAc,mBAAmB,CAAA;AACjC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,mBAAmB,CAAA;AACjC,cAAc,yBAAyB,CAAA;AACvC,cAAc,qBAAqB,CAAA;AACnC,cAAc,mBAAmB,CAAA;AACjC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,mBAAmB,CAAA;AACjC,cAAc,wBAAwB,CAAA;AACtC,cAAc,uBAAuB,CAAA;AACrC,cAAc,kCAAkC,CAAA;AAChD,cAAc,mBAAmB,CAAA;AACjC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,wBAAwB,CAAA;AACtC,cAAc,oBAAoB,CAAA;AAClC,cAAc,oBAAoB,CAAA;AAClC,cAAc,0BAA0B,CAAA;AACxC,cAAc,iBAAiB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA;AAC1B,cAAc,mBAAmB,CAAA;AACjC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,mBAAmB,CAAA;AACjC,cAAc,yBAAyB,CAAA;AACvC,cAAc,qBAAqB,CAAA;AACnC,cAAc,mBAAmB,CAAA;AACjC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,mBAAmB,CAAA;AACjC,cAAc,wBAAwB,CAAA;AACtC,cAAc,mCAAmC,CAAA;AACjD,cAAc,uBAAuB,CAAA;AACrC,cAAc,kCAAkC,CAAA;AAChD,cAAc,mBAAmB,CAAA;AACjC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,wBAAwB,CAAA;AACtC,cAAc,oBAAoB,CAAA;AAClC,cAAc,oBAAoB,CAAA;AAClC,cAAc,0BAA0B,CAAA;AACxC,cAAc,iBAAiB,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xyo-network/module-model",
3
- "version": "3.14.1",
3
+ "version": "3.14.2",
4
4
  "description": "Primary SDK for using XYO Protocol 2.0",
5
5
  "homepage": "https://xyo.network",
6
6
  "bugs": {
@@ -38,11 +38,11 @@
38
38
  "@xylabs/promise": "^4.8.7",
39
39
  "@xylabs/retry": "^4.8.7",
40
40
  "@xylabs/typeof": "^4.8.7",
41
- "@xyo-network/account-model": "^3.14.1",
42
- "@xyo-network/boundwitness-model": "^3.14.1",
43
- "@xyo-network/manifest-model": "^3.14.1",
44
- "@xyo-network/module-events": "^3.14.1",
45
- "@xyo-network/payload-model": "^3.14.1"
41
+ "@xyo-network/account-model": "^3.14.2",
42
+ "@xyo-network/boundwitness-model": "^3.14.2",
43
+ "@xyo-network/manifest-model": "^3.14.2",
44
+ "@xyo-network/module-events": "^3.14.2",
45
+ "@xyo-network/payload-model": "^3.14.2"
46
46
  },
47
47
  "devDependencies": {
48
48
  "@xylabs/ts-scripts-yarn3": "^6.3.5",
@@ -0,0 +1,47 @@
1
+ import type { Schema } from '@xyo-network/payload-model'
2
+
3
+ import type {
4
+ CreatableModuleFactory, CreatableModuleRegistry, LabeledCreatableModuleFactory,
5
+ } from './CreatableModule/index.ts'
6
+ import type { Labels } from './Labels/index.ts'
7
+
8
+ export interface ModuleFactoryLocatorInstance {
9
+
10
+ /**
11
+ * The current registry for the module factory
12
+ */
13
+ registry: Readonly<CreatableModuleRegistry>
14
+
15
+ freeze(): void
16
+
17
+ /**
18
+ * Locates a module factory that matches the supplied schema and labels
19
+ * @param schema The config schema for the module
20
+ * @param labels The labels for the module factory
21
+ * @returns A module factory that matches the supplied schema and labels or throws if one is not found
22
+ */
23
+ locate(schema: string, labels?: Labels): CreatableModuleFactory | LabeledCreatableModuleFactory
24
+
25
+ merge(locator: ModuleFactoryLocatorInstance): ModuleFactoryLocatorInstance
26
+
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[]): ModuleFactoryLocatorInstance
33
+
34
+ /**
35
+ * Registers multiple module factories with the locator
36
+ * @param factories The factories to register
37
+ */
38
+ registerMany(factories: CreatableModuleFactory[]): ModuleFactoryLocatorInstance
39
+
40
+ /**
41
+ * Tries to locate a module factory that matches the supplied schema and labels
42
+ * @param schema The config schema for the module
43
+ * @param labels The labels for the module factory
44
+ * @returns A module factory that matches the supplied schema and labels or undefined
45
+ */
46
+ tryLocate(schema: string, labels?: Labels): CreatableModuleFactory | LabeledCreatableModuleFactory | undefined
47
+ }
package/src/index.ts CHANGED
@@ -8,6 +8,7 @@ export * from './Labels/index.ts'
8
8
  export * from './lib/index.ts'
9
9
  export * from './module/index.ts'
10
10
  export * from './ModuleDescription.ts'
11
+ export * from './ModuleFactoryLocatorInstance.ts'
11
12
  export * from './ModuleIdentifier.ts'
12
13
  export * from './ModuleIdentifierTransformer.ts'
13
14
  export * from './ModuleParams.ts'