@twin.org/engine-core 0.0.3-next.3 → 0.0.3-next.31

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.
@@ -38,7 +38,7 @@ The options for the engine.
38
38
 
39
39
  ## Properties
40
40
 
41
- ### LOGGING\_COMPONENT\_TYPE\_NAME
41
+ ### LOGGING\_COMPONENT\_TYPE\_NAME {#logging_component_type_name}
42
42
 
43
43
  > `readonly` `static` **LOGGING\_COMPONENT\_TYPE\_NAME**: `string` = `"engine-logging-service"`
44
44
 
@@ -46,7 +46,7 @@ Name for the engine logger component, used for direct console logging.
46
46
 
47
47
  ***
48
48
 
49
- ### LOGGING\_CONNECTOR\_TYPE\_NAME
49
+ ### LOGGING\_CONNECTOR\_TYPE\_NAME {#logging_connector_type_name}
50
50
 
51
51
  > `readonly` `static` **LOGGING\_CONNECTOR\_TYPE\_NAME**: `string` = `"engine-logging-connector"`
52
52
 
@@ -54,7 +54,7 @@ Name for the engine logger connector, used for direct console logging.
54
54
 
55
55
  ***
56
56
 
57
- ### CLASS\_NAME
57
+ ### CLASS\_NAME {#class_name}
58
58
 
59
59
  > `readonly` `static` **CLASS\_NAME**: `string`
60
60
 
@@ -62,7 +62,7 @@ Runtime name for the class.
62
62
 
63
63
  ***
64
64
 
65
- ### \_context
65
+ ### \_context {#_context}
66
66
 
67
67
  > `protected` **\_context**: `IEngineCoreContext`\<`C`, `S`\>
68
68
 
@@ -70,23 +70,31 @@ The core context.
70
70
 
71
71
  ***
72
72
 
73
- ### \_contextIdKeys
73
+ ### \_contextIdKeys {#_contextidkeys}
74
74
 
75
- > `protected` `readonly` **\_contextIdKeys**: `string`[]
75
+ > `protected` `readonly` **\_contextIdKeys**: `object`[]
76
76
 
77
77
  The context ID keys.
78
78
 
79
+ #### key
80
+
81
+ > **key**: `string`
82
+
83
+ #### componentFeatures
84
+
85
+ > **componentFeatures**: `string`[]
86
+
79
87
  ***
80
88
 
81
- ### \_contextIds?
89
+ ### \_contextIds? {#_contextids}
82
90
 
83
- > `protected` `optional` **\_contextIds**: `IContextIds`
91
+ > `protected` `optional` **\_contextIds?**: `IContextIds`
84
92
 
85
93
  The context IDs.
86
94
 
87
95
  ## Methods
88
96
 
89
- ### addTypeInitialiser()
97
+ ### addTypeInitialiser() {#addtypeinitialiser}
90
98
 
91
99
  > **addTypeInitialiser**(`type`, `module`, `method`): `void`
92
100
 
@@ -122,9 +130,9 @@ The name of the method to call.
122
130
 
123
131
  ***
124
132
 
125
- ### getTypeConfig()
133
+ ### getTypeConfig() {#gettypeconfig}
126
134
 
127
- > **getTypeConfig**(`type`): `undefined` \| `IEngineCoreTypeConfig`[]
135
+ > **getTypeConfig**(`type`): `IEngineCoreTypeConfig`[] \| `undefined`
128
136
 
129
137
  Get the type config for a specific type.
130
138
 
@@ -138,7 +146,7 @@ The type to get the config for.
138
146
 
139
147
  #### Returns
140
148
 
141
- `undefined` \| `IEngineCoreTypeConfig`[]
149
+ `IEngineCoreTypeConfig`[] \| `undefined`
142
150
 
143
151
  The type config or undefined if not found.
144
152
 
@@ -148,9 +156,9 @@ The type config or undefined if not found.
148
156
 
149
157
  ***
150
158
 
151
- ### addContextIdKey()
159
+ ### addContextIdKey() {#addcontextidkey}
152
160
 
153
- > **addContextIdKey**(`key`): `void`
161
+ > **addContextIdKey**(`key`, `componentFeatures`): `void`
154
162
 
155
163
  Add a context ID key to the engine.
156
164
 
@@ -162,6 +170,12 @@ Add a context ID key to the engine.
162
170
 
163
171
  The context ID key.
164
172
 
173
+ ##### componentFeatures
174
+
175
+ `string`[]
176
+
177
+ The component features for the context ID handler.
178
+
165
179
  #### Returns
166
180
 
167
181
  `void`
@@ -172,7 +186,7 @@ The context ID key.
172
186
 
173
187
  ***
174
188
 
175
- ### getContextIdKeys()
189
+ ### getContextIdKeys() {#getcontextidkeys}
176
190
 
177
191
  > **getContextIdKeys**(): `string`[]
178
192
 
@@ -190,7 +204,7 @@ The context IDs keys.
190
204
 
191
205
  ***
192
206
 
193
- ### addContextId()
207
+ ### addContextId() {#addcontextid}
194
208
 
195
209
  > **addContextId**(`key`, `value`): `void`
196
210
 
@@ -220,15 +234,15 @@ The context ID value.
220
234
 
221
235
  ***
222
236
 
223
- ### getContextIds()
237
+ ### getContextIds() {#getcontextids}
224
238
 
225
- > **getContextIds**(): `undefined` \| `IContextIds`
239
+ > **getContextIds**(): `IContextIds` \| `undefined`
226
240
 
227
241
  Get the context IDs for the engine.
228
242
 
229
243
  #### Returns
230
244
 
231
- `undefined` \| `IContextIds`
245
+ `IContextIds` \| `undefined`
232
246
 
233
247
  The context IDs or undefined if none are set.
234
248
 
@@ -238,17 +252,25 @@ The context IDs or undefined if none are set.
238
252
 
239
253
  ***
240
254
 
241
- ### start()
255
+ ### start() {#start}
242
256
 
243
- > **start**(): `Promise`\<`boolean`\>
257
+ > **start**(`skipComponentStart?`): `Promise`\<`void`\>
244
258
 
245
259
  Start the engine core.
246
260
 
261
+ #### Parameters
262
+
263
+ ##### skipComponentStart?
264
+
265
+ `boolean`
266
+
267
+ Should the component start be skipped.
268
+
247
269
  #### Returns
248
270
 
249
- `Promise`\<`boolean`\>
271
+ `Promise`\<`void`\>
250
272
 
251
- True if the start was successful.
273
+ Nothing.
252
274
 
253
275
  #### Implementation of
254
276
 
@@ -256,7 +278,7 @@ True if the start was successful.
256
278
 
257
279
  ***
258
280
 
259
- ### stop()
281
+ ### stop() {#stop}
260
282
 
261
283
  > **stop**(): `Promise`\<`void`\>
262
284
 
@@ -274,7 +296,7 @@ Nothing.
274
296
 
275
297
  ***
276
298
 
277
- ### isStarted()
299
+ ### isStarted() {#isstarted}
278
300
 
279
301
  > **isStarted**(): `boolean`
280
302
 
@@ -292,7 +314,7 @@ True if the engine is started.
292
314
 
293
315
  ***
294
316
 
295
- ### isPrimary()
317
+ ### isPrimary() {#isprimary}
296
318
 
297
319
  > **isPrimary**(): `boolean`
298
320
 
@@ -310,7 +332,7 @@ True if the engine is the primary instance.
310
332
 
311
333
  ***
312
334
 
313
- ### isClone()
335
+ ### isClone() {#isclone}
314
336
 
315
337
  > **isClone**(): `boolean`
316
338
 
@@ -328,7 +350,7 @@ True if the engine instance is a clone.
328
350
 
329
351
  ***
330
352
 
331
- ### logInfo()
353
+ ### logInfo() {#loginfo}
332
354
 
333
355
  > **logInfo**(`message`): `Promise`\<`void`\>
334
356
 
@@ -352,7 +374,7 @@ The message to log.
352
374
 
353
375
  ***
354
376
 
355
- ### logError()
377
+ ### logError() {#logerror}
356
378
 
357
379
  > **logError**(`error`): `Promise`\<`void`\>
358
380
 
@@ -376,7 +398,7 @@ The error to log.
376
398
 
377
399
  ***
378
400
 
379
- ### getConfig()
401
+ ### getConfig() {#getconfig}
380
402
 
381
403
  > **getConfig**(): `C`
382
404
 
@@ -394,7 +416,7 @@ The config for the engine.
394
416
 
395
417
  ***
396
418
 
397
- ### getState()
419
+ ### getState() {#getstate}
398
420
 
399
421
  > **getState**(): `S`
400
422
 
@@ -412,7 +434,23 @@ The state of the engine.
412
434
 
413
435
  ***
414
436
 
415
- ### getRegisteredInstances()
437
+ ### setStateDirty() {#setstatedirty}
438
+
439
+ > **setStateDirty**(): `void`
440
+
441
+ Set the state to dirty so it gets saved.
442
+
443
+ #### Returns
444
+
445
+ `void`
446
+
447
+ #### Implementation of
448
+
449
+ `IEngineCore.setStateDirty`
450
+
451
+ ***
452
+
453
+ ### getRegisteredInstances() {#getregisteredinstances}
416
454
 
417
455
  > **getRegisteredInstances**(): `object`
418
456
 
@@ -430,7 +468,7 @@ The registered instances.
430
468
 
431
469
  ***
432
470
 
433
- ### getRegisteredInstanceType()
471
+ ### getRegisteredInstanceType() {#getregisteredinstancetype}
434
472
 
435
473
  > **getRegisteredInstanceType**(`componentConnectorType`, `features?`): `string`
436
474
 
@@ -466,9 +504,9 @@ If a matching instance was not found.
466
504
 
467
505
  ***
468
506
 
469
- ### getRegisteredInstanceTypeOptional()
507
+ ### getRegisteredInstanceTypeOptional() {#getregisteredinstancetypeoptional}
470
508
 
471
- > **getRegisteredInstanceTypeOptional**(`componentConnectorType`, `features?`): `undefined` \| `string`
509
+ > **getRegisteredInstanceTypeOptional**(`componentConnectorType`, `features?`): `string` \| `undefined`
472
510
 
473
511
  Get the registered instance type for the component/connector if it exists.
474
512
 
@@ -488,7 +526,7 @@ The requested features of the component, if not specified the default entry will
488
526
 
489
527
  #### Returns
490
528
 
491
- `undefined` \| `string`
529
+ `string` \| `undefined`
492
530
 
493
531
  The instance type matching the criteria if one is registered.
494
532
 
@@ -498,7 +536,7 @@ The instance type matching the criteria if one is registered.
498
536
 
499
537
  ***
500
538
 
501
- ### getCloneData()
539
+ ### getCloneData() {#getclonedata}
502
540
 
503
541
  > **getCloneData**(): `IEngineCoreClone`\<`C`, `S`\>
504
542
 
@@ -516,9 +554,9 @@ The clone data.
516
554
 
517
555
  ***
518
556
 
519
- ### populateClone()
557
+ ### populateClone() {#populateclone}
520
558
 
521
- > **populateClone**(`cloneData`, `silent?`): `void`
559
+ > **populateClone**(`cloneData`, `contextIds?`, `silent?`): `void`
522
560
 
523
561
  Populate the engine from the clone data.
524
562
 
@@ -530,6 +568,12 @@ Populate the engine from the clone data.
530
568
 
531
569
  The clone data to populate from.
532
570
 
571
+ ##### contextIds?
572
+
573
+ `IContextIds`
574
+
575
+ The context IDs to use for the clone.
576
+
533
577
  ##### silent?
534
578
 
535
579
  `boolean`
@@ -14,7 +14,7 @@ Helper class for engine modules.
14
14
 
15
15
  ## Properties
16
16
 
17
- ### CLASS\_NAME
17
+ ### CLASS\_NAME {#class_name}
18
18
 
19
19
  > `readonly` `static` **CLASS\_NAME**: `string`
20
20
 
@@ -22,7 +22,7 @@ Runtime name for the class.
22
22
 
23
23
  ## Methods
24
24
 
25
- ### loadComponent()
25
+ ### loadComponent() {#loadcomponent}
26
26
 
27
27
  > `static` **loadComponent**\<`T`\>(`engineCore`, `engineModuleConfig`): `Promise`\<`T`\>
28
28
 
@@ -16,7 +16,7 @@ Store state in a file.
16
16
 
17
17
  ### Constructor
18
18
 
19
- > **new FileStateStorage**\<`S`\>(`filename`, `readonlyMode`): `FileStateStorage`\<`S`\>
19
+ > **new FileStateStorage**\<`S`\>(`filename`, `readonlyMode?`): `FileStateStorage`\<`S`\>
20
20
 
21
21
  Create a new instance of FileStateStorage.
22
22
 
@@ -28,7 +28,7 @@ Create a new instance of FileStateStorage.
28
28
 
29
29
  The filename to store the state.
30
30
 
31
- ##### readonlyMode
31
+ ##### readonlyMode?
32
32
 
33
33
  `boolean` = `false`
34
34
 
@@ -40,7 +40,7 @@ Whether the file is in read-only mode.
40
40
 
41
41
  ## Properties
42
42
 
43
- ### CLASS\_NAME
43
+ ### CLASS\_NAME {#class_name}
44
44
 
45
45
  > `readonly` `static` **CLASS\_NAME**: `string`
46
46
 
@@ -48,9 +48,9 @@ Runtime name for the class.
48
48
 
49
49
  ## Methods
50
50
 
51
- ### load()
51
+ ### load() {#load}
52
52
 
53
- > **load**(`engineCore`): `Promise`\<`undefined` \| `S`\>
53
+ > **load**(`engineCore`): `Promise`\<`S` \| `undefined`\>
54
54
 
55
55
  Method for loading the state.
56
56
 
@@ -64,7 +64,7 @@ The engine core to load the state for.
64
64
 
65
65
  #### Returns
66
66
 
67
- `Promise`\<`undefined` \| `S`\>
67
+ `Promise`\<`S` \| `undefined`\>
68
68
 
69
69
  The state of the engine or undefined if it doesn't exist.
70
70
 
@@ -74,7 +74,7 @@ The state of the engine or undefined if it doesn't exist.
74
74
 
75
75
  ***
76
76
 
77
- ### save()
77
+ ### save() {#save}
78
78
 
79
79
  > **save**(`engineCore`, `state`): `Promise`\<`void`\>
80
80
 
@@ -16,13 +16,13 @@ Store state in memory.
16
16
 
17
17
  ### Constructor
18
18
 
19
- > **new MemoryStateStorage**\<`S`\>(`readonlyMode`, `state?`): `MemoryStateStorage`\<`S`\>
19
+ > **new MemoryStateStorage**\<`S`\>(`readonlyMode?`, `state?`): `MemoryStateStorage`\<`S`\>
20
20
 
21
21
  Create a new instance of MemoryStateStorage.
22
22
 
23
23
  #### Parameters
24
24
 
25
- ##### readonlyMode
25
+ ##### readonlyMode?
26
26
 
27
27
  `boolean` = `false`
28
28
 
@@ -40,7 +40,7 @@ The initial state.
40
40
 
41
41
  ## Properties
42
42
 
43
- ### CLASS\_NAME
43
+ ### CLASS\_NAME {#class_name}
44
44
 
45
45
  > `readonly` `static` **CLASS\_NAME**: `string`
46
46
 
@@ -48,9 +48,9 @@ Runtime name for the class.
48
48
 
49
49
  ## Methods
50
50
 
51
- ### load()
51
+ ### load() {#load}
52
52
 
53
- > **load**(`engineCore`): `Promise`\<`undefined` \| `S`\>
53
+ > **load**(`engineCore`): `Promise`\<`S` \| `undefined`\>
54
54
 
55
55
  Method for loading the state.
56
56
 
@@ -64,7 +64,7 @@ The engine core to load the state for.
64
64
 
65
65
  #### Returns
66
66
 
67
- `Promise`\<`undefined` \| `S`\>
67
+ `Promise`\<`S` \| `undefined`\>
68
68
 
69
69
  The state of the engine or undefined if it doesn't exist.
70
70
 
@@ -74,7 +74,7 @@ The state of the engine or undefined if it doesn't exist.
74
74
 
75
75
  ***
76
76
 
77
- ### save()
77
+ ### save() {#save}
78
78
 
79
79
  > **save**(`engineCore`, `state`): `Promise`\<`void`\>
80
80
 
@@ -14,33 +14,33 @@ The options for creating engine core.
14
14
 
15
15
  ## Properties
16
16
 
17
- ### config?
17
+ ### config? {#config}
18
18
 
19
- > `optional` **config**: `C`
19
+ > `optional` **config?**: `C`
20
20
 
21
21
  The engine core config.
22
22
 
23
23
  ***
24
24
 
25
- ### stateStorage?
25
+ ### stateStorage? {#statestorage}
26
26
 
27
- > `optional` **stateStorage**: `IEngineStateStorage`\<`S`\>
27
+ > `optional` **stateStorage?**: `IEngineStateStorage`\<`S`\>
28
28
 
29
29
  The state storage component.
30
30
 
31
31
  ***
32
32
 
33
- ### skipBootstrap?
33
+ ### skipBootstrap? {#skipbootstrap}
34
34
 
35
- > `optional` **skipBootstrap**: `boolean`
35
+ > `optional` **skipBootstrap?**: `boolean`
36
36
 
37
37
  Skip the bootstrap process, useful for additional engine instances.
38
38
 
39
39
  ***
40
40
 
41
- ### populateTypeInitialisers()?
41
+ ### populateTypeInitialisers? {#populatetypeinitialisers}
42
42
 
43
- > `optional` **populateTypeInitialisers**: (`engineCore`, `context`) => `void`
43
+ > `optional` **populateTypeInitialisers?**: (`engineCore`, `context`) => `void`
44
44
 
45
45
  Populate the type initialisers for the engine.
46
46
 
@@ -60,9 +60,9 @@ Populate the type initialisers for the engine.
60
60
 
61
61
  ***
62
62
 
63
- ### customBootstrap()?
63
+ ### customBootstrap? {#custombootstrap}
64
64
 
65
- > `optional` **customBootstrap**: (`engineCore`, `context`) => `Promise`\<`void`\>
65
+ > `optional` **customBootstrap?**: (`engineCore`, `context`) => `Promise`\<`void`\>
66
66
 
67
67
  Custom bootstrap method for the engine.
68
68
 
package/locales/en.json CHANGED
@@ -5,7 +5,8 @@
5
5
  "bootstrapFailed": "Failed to bootstrap component type \"{className}\" with instance type \"{instanceType}\"",
6
6
  "componentStartFailed": "Failed to start component type \"{className}\" with instance type \"{instanceType}\"",
7
7
  "componentStopFailed": "Failed to stop component type \"{className}\" with instance type \"{instanceType}\"",
8
- "instanceTypeNotFound": "Instance type not found for \"{type}\" with features \"{features}\""
8
+ "instanceTypeNotFound": "Instance type not found for \"{type}\"",
9
+ "instanceTypeNotFoundWithFeatures": "Instance type not found for \"{type}\" with features \"{features}\""
9
10
  },
10
11
  "fileStateStorage": {
11
12
  "failedLoading": "Failed to load file state storage from \"{filename}\"",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@twin.org/engine-core",
3
- "version": "0.0.3-next.3",
4
- "description": "Engine core.",
3
+ "version": "0.0.3-next.31",
4
+ "description": "Core runtime lifecycle and state orchestration for engine instances.",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+https://github.com/twinfoundation/engine.git",
@@ -18,7 +18,7 @@
18
18
  "@twin.org/core": "next",
19
19
  "@twin.org/crypto": "next",
20
20
  "@twin.org/data-core": "next",
21
- "@twin.org/engine-models": "0.0.3-next.3",
21
+ "@twin.org/engine-models": "0.0.3-next.31",
22
22
  "@twin.org/entity": "next",
23
23
  "@twin.org/logging-connector-console": "next",
24
24
  "@twin.org/logging-models": "next",