@twin.org/engine-models 0.0.3-next.20 → 0.0.3-next.21

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.
@@ -1 +1 @@
1
- {"version":3,"file":"IEngineCoreTypeConfig.js","sourceRoot":"","sources":["../../../../src/models/config/IEngineCoreTypeConfig.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IEngineCoreTypeBaseConfig } from \"./IEngineCoreTypeBaseConfig.js\";\n\n/**\n * Configuration for the engine core type.\n */\nexport type IEngineCoreTypeConfig<T extends IEngineCoreTypeBaseConfig = IEngineCoreTypeBaseConfig> =\n\tT & {\n\t\t/**\n\t\t * The instance type to override with.\n\t\t */\n\t\toverrideInstanceType?: string;\n\n\t\t/**\n\t\t * Whether this is the default instance.\n\t\t */\n\t\tisDefault?: boolean;\n\n\t\t/**\n\t\t * The features supported by this instance.\n\t\t */\n\t\tfeatures?: string[];\n\n\t\t/**\n\t\t * The path for the REST API.\n\t\t */\n\t\trestPath?: string;\n\n\t\t/**\n\t\t * The options for the REST API route generation.\n\t\t */\n\t\trestOptions?: unknown;\n\n\t\t/**\n\t\t * The path for the socket API.\n\t\t */\n\t\tsocketPath?: string;\n\n\t\t/**\n\t\t * The options for the socket API route generation.\n\t\t */\n\t\tsocketOptions?: unknown;\n\t};\n"]}
1
+ {"version":3,"file":"IEngineCoreTypeConfig.js","sourceRoot":"","sources":["../../../../src/models/config/IEngineCoreTypeConfig.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IEngineCoreTypeBaseConfig } from \"./IEngineCoreTypeBaseConfig.js\";\n\n/**\n * Configuration for the engine core type.\n */\nexport type IEngineCoreTypeConfig<T extends IEngineCoreTypeBaseConfig = IEngineCoreTypeBaseConfig> =\n\tT & {\n\t\t/**\n\t\t * The instance type to override with.\n\t\t */\n\t\toverrideInstanceType?: string;\n\n\t\t/**\n\t\t * Whether this is the default instance.\n\t\t */\n\t\tisDefault?: boolean;\n\n\t\t/**\n\t\t * Whether this is a multi-instance component.\n\t\t */\n\t\tisMultiInstance?: boolean;\n\n\t\t/**\n\t\t * The features supported by this instance.\n\t\t */\n\t\tfeatures?: string[];\n\n\t\t/**\n\t\t * The path for the REST API.\n\t\t */\n\t\trestPath?: string;\n\n\t\t/**\n\t\t * The options for the REST API route generation.\n\t\t */\n\t\trestOptions?: unknown;\n\n\t\t/**\n\t\t * The path for the socket API.\n\t\t */\n\t\tsocketPath?: string;\n\n\t\t/**\n\t\t * The options for the socket API route generation.\n\t\t */\n\t\tsocketOptions?: unknown;\n\t};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"engineTypeInitialiser.js","sourceRoot":"","sources":["../../../src/models/engineTypeInitialiser.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { Factory, IComponent } from \"@twin.org/core\";\nimport type { IEngineCoreTypeBaseConfig } from \"./config/IEngineCoreTypeBaseConfig.js\";\nimport type { IEngineCore } from \"./IEngineCore.js\";\nimport type { IEngineCoreContext } from \"./IEngineCoreContext.js\";\n\n/**\n * Method definition for the engine type initialiser.\n */\nexport type EngineTypeInitialiser<T extends IEngineCoreTypeBaseConfig = IEngineCoreTypeBaseConfig> =\n\t(\n\t\tengineCore: IEngineCore,\n\t\tcontext: IEngineCoreContext,\n\t\tinstanceConfig: T\n\t) => Promise<EngineTypeInitialiserReturn>;\n\n/**\n * Engine type initialiser return type.\n */\nexport interface EngineTypeInitialiserReturn {\n\t/**\n\t * The instance type created.\n\t */\n\tinstanceType?: string;\n\n\t/**\n\t * The factory to store the instance in.\n\t */\n\tfactory?: Factory<unknown>;\n\n\t/**\n\t * The component created.\n\t */\n\tcomponent?: IComponent;\n}\n"]}
1
+ {"version":3,"file":"engineTypeInitialiser.js","sourceRoot":"","sources":["../../../src/models/engineTypeInitialiser.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { Factory, IComponent } from \"@twin.org/core\";\nimport type { IEngineCoreTypeBaseConfig } from \"./config/IEngineCoreTypeBaseConfig.js\";\nimport type { IEngineCore } from \"./IEngineCore.js\";\nimport type { IEngineCoreContext } from \"./IEngineCoreContext.js\";\n\n/**\n * Method definition for the engine type initialiser.\n */\nexport type EngineTypeInitialiser<\n\tT extends IEngineCoreTypeBaseConfig = IEngineCoreTypeBaseConfig,\n\tF = Factory<unknown>\n> = (\n\tengineCore: IEngineCore,\n\tcontext: IEngineCoreContext,\n\tinstanceConfig: T\n) => EngineTypeInitialiserReturn<T, F>;\n\n/**\n * Engine type initialiser return type.\n */\nexport interface EngineTypeInitialiserReturn<\n\tT extends IEngineCoreTypeBaseConfig = IEngineCoreTypeBaseConfig,\n\tF = Factory<unknown>\n> {\n\t/**\n\t * The instance type created.\n\t */\n\tinstanceTypeName?: string;\n\n\t/**\n\t * The factory to store the instance in.\n\t */\n\tfactory?: F;\n\n\t/**\n\t * Create a new component.\n\t */\n\tcreateComponent?: (additionalConfig: T) => IComponent;\n}\n"]}
@@ -11,6 +11,10 @@ export type IEngineCoreTypeConfig<T extends IEngineCoreTypeBaseConfig = IEngineC
11
11
  * Whether this is the default instance.
12
12
  */
13
13
  isDefault?: boolean;
14
+ /**
15
+ * Whether this is a multi-instance component.
16
+ */
17
+ isMultiInstance?: boolean;
14
18
  /**
15
19
  * The features supported by this instance.
16
20
  */
@@ -5,21 +5,21 @@ import type { IEngineCoreContext } from "./IEngineCoreContext.js";
5
5
  /**
6
6
  * Method definition for the engine type initialiser.
7
7
  */
8
- export type EngineTypeInitialiser<T extends IEngineCoreTypeBaseConfig = IEngineCoreTypeBaseConfig> = (engineCore: IEngineCore, context: IEngineCoreContext, instanceConfig: T) => Promise<EngineTypeInitialiserReturn>;
8
+ export type EngineTypeInitialiser<T extends IEngineCoreTypeBaseConfig = IEngineCoreTypeBaseConfig, F = Factory<unknown>> = (engineCore: IEngineCore, context: IEngineCoreContext, instanceConfig: T) => EngineTypeInitialiserReturn<T, F>;
9
9
  /**
10
10
  * Engine type initialiser return type.
11
11
  */
12
- export interface EngineTypeInitialiserReturn {
12
+ export interface EngineTypeInitialiserReturn<T extends IEngineCoreTypeBaseConfig = IEngineCoreTypeBaseConfig, F = Factory<unknown>> {
13
13
  /**
14
14
  * The instance type created.
15
15
  */
16
- instanceType?: string;
16
+ instanceTypeName?: string;
17
17
  /**
18
18
  * The factory to store the instance in.
19
19
  */
20
- factory?: Factory<unknown>;
20
+ factory?: F;
21
21
  /**
22
- * The component created.
22
+ * Create a new component.
23
23
  */
24
- component?: IComponent;
24
+ createComponent?: (additionalConfig: T) => IComponent;
25
25
  }
package/docs/changelog.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # @twin.org/engine-models - Changelog
2
2
 
3
+ ## [0.0.3-next.21](https://github.com/twinfoundation/engine/compare/engine-models-v0.0.3-next.20...engine-models-v0.0.3-next.21) (2026-02-13)
4
+
5
+
6
+ ### Features
7
+
8
+ * multi instance component support ([#83](https://github.com/twinfoundation/engine/issues/83)) ([6012b50](https://github.com/twinfoundation/engine/commit/6012b50959df5af893f05516d42eea2e0800b31a))
9
+
3
10
  ## [0.0.3-next.20](https://github.com/twinfoundation/engine/compare/engine-models-v0.0.3-next.19...engine-models-v0.0.3-next.20) (2026-02-06)
4
11
 
5
12
 
@@ -1,12 +1,22 @@
1
- # Interface: EngineTypeInitialiserReturn
1
+ # Interface: EngineTypeInitialiserReturn\<T, F\>
2
2
 
3
3
  Engine type initialiser return type.
4
4
 
5
+ ## Type Parameters
6
+
7
+ ### T
8
+
9
+ `T` *extends* [`IEngineCoreTypeBaseConfig`](IEngineCoreTypeBaseConfig.md) = [`IEngineCoreTypeBaseConfig`](IEngineCoreTypeBaseConfig.md)
10
+
11
+ ### F
12
+
13
+ `F` = `Factory`\<`unknown`\>
14
+
5
15
  ## Properties
6
16
 
7
- ### instanceType?
17
+ ### instanceTypeName?
8
18
 
9
- > `optional` **instanceType**: `string`
19
+ > `optional` **instanceTypeName**: `string`
10
20
 
11
21
  The instance type created.
12
22
 
@@ -14,14 +24,24 @@ The instance type created.
14
24
 
15
25
  ### factory?
16
26
 
17
- > `optional` **factory**: `Factory`\<`unknown`\>
27
+ > `optional` **factory**: `F`
18
28
 
19
29
  The factory to store the instance in.
20
30
 
21
31
  ***
22
32
 
23
- ### component?
33
+ ### createComponent()?
34
+
35
+ > `optional` **createComponent**: (`additionalConfig`) => `IComponent`
36
+
37
+ Create a new component.
38
+
39
+ #### Parameters
40
+
41
+ ##### additionalConfig
42
+
43
+ `T`
24
44
 
25
- > `optional` **component**: `IComponent`
45
+ #### Returns
26
46
 
27
- The component created.
47
+ `IComponent`
@@ -1,6 +1,6 @@
1
- # Type Alias: EngineTypeInitialiser()\<T\>
1
+ # Type Alias: EngineTypeInitialiser()\<T, F\>
2
2
 
3
- > **EngineTypeInitialiser**\<`T`\> = (`engineCore`, `context`, `instanceConfig`) => `Promise`\<[`EngineTypeInitialiserReturn`](../interfaces/EngineTypeInitialiserReturn.md)\>
3
+ > **EngineTypeInitialiser**\<`T`, `F`\> = (`engineCore`, `context`, `instanceConfig`) => [`EngineTypeInitialiserReturn`](../interfaces/EngineTypeInitialiserReturn.md)\<`T`, `F`\>
4
4
 
5
5
  Method definition for the engine type initialiser.
6
6
 
@@ -10,6 +10,10 @@ Method definition for the engine type initialiser.
10
10
 
11
11
  `T` *extends* [`IEngineCoreTypeBaseConfig`](../interfaces/IEngineCoreTypeBaseConfig.md) = [`IEngineCoreTypeBaseConfig`](../interfaces/IEngineCoreTypeBaseConfig.md)
12
12
 
13
+ ### F
14
+
15
+ `F` = `Factory`\<`unknown`\>
16
+
13
17
  ## Parameters
14
18
 
15
19
  ### engineCore
@@ -26,4 +30,4 @@ Method definition for the engine type initialiser.
26
30
 
27
31
  ## Returns
28
32
 
29
- `Promise`\<[`EngineTypeInitialiserReturn`](../interfaces/EngineTypeInitialiserReturn.md)\>
33
+ [`EngineTypeInitialiserReturn`](../interfaces/EngineTypeInitialiserReturn.md)\<`T`, `F`\>
@@ -18,6 +18,12 @@ The instance type to override with.
18
18
 
19
19
  Whether this is the default instance.
20
20
 
21
+ ### isMultiInstance?
22
+
23
+ > `optional` **isMultiInstance**: `boolean`
24
+
25
+ Whether this is a multi-instance component.
26
+
21
27
  ### features?
22
28
 
23
29
  > `optional` **features**: `string`[]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twin.org/engine-models",
3
- "version": "0.0.3-next.20",
3
+ "version": "0.0.3-next.21",
4
4
  "description": "Models which define the structure of the engine.",
5
5
  "repository": {
6
6
  "type": "git",