@twin.org/engine-types 0.0.3-next.22 → 0.0.3-next.23

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,7 +1,9 @@
1
1
  // Copyright 2024 IOTA Stiftung.
2
2
  // SPDX-License-Identifier: Apache-2.0.
3
- import { TaskSchedulerService } from "@twin.org/background-task-scheduler";
3
+ import { initSchema, TaskSchedulerService } from "@twin.org/background-task-scheduler";
4
+ import { ContextIdHelper, ContextIdKeys } from "@twin.org/context";
4
5
  import { ComponentFactory } from "@twin.org/core";
6
+ import { initialiseEntityStorageConnector } from "./entityStorage.js";
5
7
  import { TaskSchedulerComponentType } from "../models/types/taskSchedulerComponentType.js";
6
8
  import { EngineTypeHelper } from "../utils/engineTypeHelper.js";
7
9
  /**
@@ -15,7 +17,11 @@ export function initialiseTaskSchedulerComponent(engineCore, context, instanceCo
15
17
  let createComponent;
16
18
  let instanceTypeName;
17
19
  if (instanceConfig.type === TaskSchedulerComponentType.Service) {
18
- createComponent = (createConfig) => new TaskSchedulerService(EngineTypeHelper.mergeConfig({ loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent") }, createConfig.options));
20
+ createComponent = (createConfig) => {
21
+ initSchema();
22
+ initialiseEntityStorageConnector(engineCore, context, createConfig.options?.scheduledTaskEntityStorageType, "ScheduledTask", ContextIdHelper.pickKeysFromAvailable(engineCore.getContextIdKeys(), [ContextIdKeys.Node]));
23
+ return new TaskSchedulerService(EngineTypeHelper.mergeConfig({ loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent") }, createConfig.options));
24
+ };
19
25
  instanceTypeName = "task-scheduler-service";
20
26
  }
21
27
  return {
@@ -1 +1 @@
1
- {"version":3,"file":"taskScheduler.js","sourceRoot":"","sources":["../../../src/components/taskScheduler.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAC3E,OAAO,EAAE,gBAAgB,EAAmB,MAAM,gBAAgB,CAAC;AASnE,OAAO,EAAE,0BAA0B,EAAE,MAAM,+CAA+C,CAAC;AAC3F,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAEhE;;;;;;GAMG;AACH,MAAM,UAAU,gCAAgC,CAC/C,UAAsC,EACtC,OAA0C,EAC1C,cAA4C;IAE5C,IAAI,eAAe,CAAC;IACpB,IAAI,gBAAgB,CAAC;IAErB,IAAI,cAAc,CAAC,IAAI,KAAK,0BAA0B,CAAC,OAAO,EAAE,CAAC;QAChE,eAAe,GAAG,CAAC,YAAmC,EAAE,EAAE,CACzD,IAAI,oBAAoB,CACvB,gBAAgB,CAAC,WAAW,CAC3B,EAAE,oBAAoB,EAAE,UAAU,CAAC,yBAAyB,CAAC,kBAAkB,CAAC,EAAE,EAClF,YAAY,CAAC,OAAO,CACpB,CACD,CAAC;QACH,gBAAgB,2BAAwC,CAAC;IAC1D,CAAC;IAED,OAAO;QACN,eAAe,EAAE,eAAsE;QACvF,gBAAgB;QAChB,OAAO,EAAE,gBAAgB;KACzB,CAAC;AACH,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { TaskSchedulerService } from \"@twin.org/background-task-scheduler\";\nimport { ComponentFactory, type IComponent } from \"@twin.org/core\";\nimport type {\n\tEngineTypeInitialiserReturn,\n\tIEngineCore,\n\tIEngineCoreContext\n} from \"@twin.org/engine-models\";\nimport { nameofKebabCase } from \"@twin.org/nameof\";\nimport type { TaskSchedulerComponentConfig } from \"../models/config/taskSchedulerComponentConfig.js\";\nimport type { IEngineConfig } from \"../models/IEngineConfig.js\";\nimport { TaskSchedulerComponentType } from \"../models/types/taskSchedulerComponentType.js\";\nimport { EngineTypeHelper } from \"../utils/engineTypeHelper.js\";\n\n/**\n * Initialise a task scheduler.\n * @param engineCore The engine core.\n * @param context The context for the engine.\n * @param instanceConfig The instance config.\n * @returns The instance created and the factory for it.\n */\nexport function initialiseTaskSchedulerComponent(\n\tengineCore: IEngineCore<IEngineConfig>,\n\tcontext: IEngineCoreContext<IEngineConfig>,\n\tinstanceConfig: TaskSchedulerComponentConfig\n): EngineTypeInitialiserReturn<typeof instanceConfig, typeof ComponentFactory> {\n\tlet createComponent;\n\tlet instanceTypeName;\n\n\tif (instanceConfig.type === TaskSchedulerComponentType.Service) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) =>\n\t\t\tnew TaskSchedulerService(\n\t\t\t\tEngineTypeHelper.mergeConfig<(typeof instanceConfig)[\"options\"]>(\n\t\t\t\t\t{ loggingComponentType: engineCore.getRegisteredInstanceType(\"loggingComponent\") },\n\t\t\t\t\tcreateConfig.options\n\t\t\t\t)\n\t\t\t);\n\t\tinstanceTypeName = nameofKebabCase(TaskSchedulerService);\n\t}\n\n\treturn {\n\t\tcreateComponent: createComponent as (createConfig: typeof instanceConfig) => IComponent,\n\t\tinstanceTypeName,\n\t\tfactory: ComponentFactory\n\t};\n}\n"]}
1
+ {"version":3,"file":"taskScheduler.js","sourceRoot":"","sources":["../../../src/components/taskScheduler.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EACN,UAAU,EACV,oBAAoB,EAEpB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAmB,MAAM,gBAAgB,CAAC;AAOnE,OAAO,EAAE,gCAAgC,EAAE,MAAM,oBAAoB,CAAC;AAGtE,OAAO,EAAE,0BAA0B,EAAE,MAAM,+CAA+C,CAAC;AAC3F,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAEhE;;;;;;GAMG;AACH,MAAM,UAAU,gCAAgC,CAC/C,UAAsC,EACtC,OAA0C,EAC1C,cAA4C;IAE5C,IAAI,eAAe,CAAC;IACpB,IAAI,gBAAgB,CAAC;IAErB,IAAI,cAAc,CAAC,IAAI,KAAK,0BAA0B,CAAC,OAAO,EAAE,CAAC;QAChE,eAAe,GAAG,CAAC,YAAmC,EAAE,EAAE;YACzD,UAAU,EAAE,CAAC;YACb,gCAAgC,CAC/B,UAAU,EACV,OAAO,EACP,YAAY,CAAC,OAAO,EAAE,8BAA8B,mBAEpD,eAAe,CAAC,qBAAqB,CAAC,UAAU,CAAC,gBAAgB,EAAE,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,CAC1F,CAAC;YAEF,OAAO,IAAI,oBAAoB,CAC9B,gBAAgB,CAAC,WAAW,CAC3B,EAAE,oBAAoB,EAAE,UAAU,CAAC,yBAAyB,CAAC,kBAAkB,CAAC,EAAE,EAClF,YAAY,CAAC,OAAO,CACpB,CACD,CAAC;QACH,CAAC,CAAC;QACF,gBAAgB,2BAAwC,CAAC;IAC1D,CAAC;IAED,OAAO;QACN,eAAe,EAAE,eAAsE;QACvF,gBAAgB;QAChB,OAAO,EAAE,gBAAgB;KACzB,CAAC;AACH,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport {\n\tinitSchema,\n\tTaskSchedulerService,\n\ttype ScheduledTask\n} from \"@twin.org/background-task-scheduler\";\nimport { ContextIdHelper, ContextIdKeys } from \"@twin.org/context\";\nimport { ComponentFactory, type IComponent } from \"@twin.org/core\";\nimport type {\n\tEngineTypeInitialiserReturn,\n\tIEngineCore,\n\tIEngineCoreContext\n} from \"@twin.org/engine-models\";\nimport { nameof, nameofKebabCase } from \"@twin.org/nameof\";\nimport { initialiseEntityStorageConnector } from \"./entityStorage.js\";\nimport type { TaskSchedulerComponentConfig } from \"../models/config/taskSchedulerComponentConfig.js\";\nimport type { IEngineConfig } from \"../models/IEngineConfig.js\";\nimport { TaskSchedulerComponentType } from \"../models/types/taskSchedulerComponentType.js\";\nimport { EngineTypeHelper } from \"../utils/engineTypeHelper.js\";\n\n/**\n * Initialise a task scheduler.\n * @param engineCore The engine core.\n * @param context The context for the engine.\n * @param instanceConfig The instance config.\n * @returns The instance created and the factory for it.\n */\nexport function initialiseTaskSchedulerComponent(\n\tengineCore: IEngineCore<IEngineConfig>,\n\tcontext: IEngineCoreContext<IEngineConfig>,\n\tinstanceConfig: TaskSchedulerComponentConfig\n): EngineTypeInitialiserReturn<typeof instanceConfig, typeof ComponentFactory> {\n\tlet createComponent;\n\tlet instanceTypeName;\n\n\tif (instanceConfig.type === TaskSchedulerComponentType.Service) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) => {\n\t\t\tinitSchema();\n\t\t\tinitialiseEntityStorageConnector(\n\t\t\t\tengineCore,\n\t\t\t\tcontext,\n\t\t\t\tcreateConfig.options?.scheduledTaskEntityStorageType,\n\t\t\t\tnameof<ScheduledTask>(),\n\t\t\t\tContextIdHelper.pickKeysFromAvailable(engineCore.getContextIdKeys(), [ContextIdKeys.Node])\n\t\t\t);\n\n\t\t\treturn new TaskSchedulerService(\n\t\t\t\tEngineTypeHelper.mergeConfig<(typeof instanceConfig)[\"options\"]>(\n\t\t\t\t\t{ loggingComponentType: engineCore.getRegisteredInstanceType(\"loggingComponent\") },\n\t\t\t\t\tcreateConfig.options\n\t\t\t\t)\n\t\t\t);\n\t\t};\n\t\tinstanceTypeName = nameofKebabCase(TaskSchedulerService);\n\t}\n\n\treturn {\n\t\tcreateComponent: createComponent as (createConfig: typeof instanceConfig) => IComponent,\n\t\tinstanceTypeName,\n\t\tfactory: ComponentFactory\n\t};\n}\n"]}
package/docs/changelog.md CHANGED
@@ -1,5 +1,70 @@
1
1
  # @twin.org/engine-types - Changelog
2
2
 
3
+ ## [0.0.3-next.23](https://github.com/twinfoundation/engine/compare/engine-types-v0.0.3-next.22...engine-types-v0.0.3-next.23) (2026-02-23)
4
+
5
+
6
+ ### Features
7
+
8
+ * add auth admin component ([201cd06](https://github.com/twinfoundation/engine/commit/201cd061be83afccb5a6b06856ffe7cf8db7d6b3))
9
+ * add context id features ([#51](https://github.com/twinfoundation/engine/issues/51)) ([eaef180](https://github.com/twinfoundation/engine/commit/eaef1807397a907bc7655ef1545a151a710ca2f1))
10
+ * add data processing component to doc management component ([2e4920f](https://github.com/twinfoundation/engine/commit/2e4920fb0626060dd6c570bc2bc7357fa8605ff0))
11
+ * add data space connector ([a824d99](https://github.com/twinfoundation/engine/commit/a824d9931faeaa8115e01f8e7545b802d0e7ac70))
12
+ * add engine type helper for config lookups ([a20a398](https://github.com/twinfoundation/engine/commit/a20a3987016c48351178ab8410bc05b0fba0f2c1))
13
+ * add engine type helper for config lookups ([7d5eeef](https://github.com/twinfoundation/engine/commit/7d5eeefd3e7b9daab1ba20e2fb6b1ebfec178aec))
14
+ * add entity storage to task scheduler ([da4dc0f](https://github.com/twinfoundation/engine/commit/da4dc0f26ee4d506d35cd267144c8300a8b52f90))
15
+ * add fed cat filters ([a52cbf1](https://github.com/twinfoundation/engine/commit/a52cbf1eaf85e6cad61de9ea9448932fb5ae0f43))
16
+ * add federated catalogue ([1b15dd0](https://github.com/twinfoundation/engine/commit/1b15dd059a11446457651c411a73145fab37f025))
17
+ * add hosting component ([#70](https://github.com/twinfoundation/engine/issues/70)) ([2ab0dec](https://github.com/twinfoundation/engine/commit/2ab0dec8fdb979395c639b73f394a40a0dd7e55a))
18
+ * add latest rights management components ([2d305c8](https://github.com/twinfoundation/engine/commit/2d305c8c85c77bb4f5694c76422db4a11efc1a40))
19
+ * add mimeTypeProcessors and disableNodeIdentity ([bb7e81e](https://github.com/twinfoundation/engine/commit/bb7e81e2036fe042068a5645ec59b22e20d33aad))
20
+ * add rest clients as components ([c6f956a](https://github.com/twinfoundation/engine/commit/c6f956afe4fc22cd552174539c92a109448dc242))
21
+ * add rights management modules ([e02cadc](https://github.com/twinfoundation/engine/commit/e02cadc840d242fe16a73ab41ba61376c7467e50))
22
+ * add rights management negotiation ([84ef46b](https://github.com/twinfoundation/engine/commit/84ef46bff110611a19512793425c8c873ee2a590))
23
+ * add synchronised storage support ([5142e34](https://github.com/twinfoundation/engine/commit/5142e3488f09195cf9f48a9c6c6d1014231a4c2c))
24
+ * add task scheduler ([0951107](https://github.com/twinfoundation/engine/commit/09511073ad042194a45206303f0ef31d8d6af5db))
25
+ * add trust and rights management plugins ([eea0807](https://github.com/twinfoundation/engine/commit/eea0807601833220bd9fd8605b5e4383fbc0ebae))
26
+ * add validate-locales ([b92ea09](https://github.com/twinfoundation/engine/commit/b92ea09dbcfe35225271a51f24d231f59e2d363e))
27
+ * attestation no longer requires wallet connector ([772caa8](https://github.com/twinfoundation/engine/commit/772caa87c09691a746550f490291cdcf284b0e0e))
28
+ * close already started components on startup error ([a55a117](https://github.com/twinfoundation/engine/commit/a55a117a508998288c8ae804e732fc6085cb22fa))
29
+ * context id handlers repopulated after engine clone ([9712e32](https://github.com/twinfoundation/engine/commit/9712e328f4607f5b2c82355c394c61bde0ee39bf))
30
+ * eslint migration to flat config ([6b978da](https://github.com/twinfoundation/engine/commit/6b978daf777a615d7758b63c3df57d5a376f6dfb))
31
+ * improve startup error handling ([#65](https://github.com/twinfoundation/engine/issues/65)) ([5b2d1c5](https://github.com/twinfoundation/engine/commit/5b2d1c539cf5484afa85e294d6d6c18f24ef8274))
32
+ * inject logging into immutable proof ([#60](https://github.com/twinfoundation/engine/issues/60)) ([8d0bc86](https://github.com/twinfoundation/engine/commit/8d0bc86c01502e9c9031471834ee3da824c18b27))
33
+ * iota rebased release ([474d92b](https://github.com/twinfoundation/engine/commit/474d92b352f4ccc431a4f138afee2ee89824664d))
34
+ * modifying the engine to run the new services ([#10](https://github.com/twinfoundation/engine/issues/10)) ([6f7141f](https://github.com/twinfoundation/engine/commit/6f7141fe0a6d05c725066b274bcc18b5490e580b))
35
+ * multi instance component support ([#83](https://github.com/twinfoundation/engine/issues/83)) ([6012b50](https://github.com/twinfoundation/engine/commit/6012b50959df5af893f05516d42eea2e0800b31a))
36
+ * override type initialisers with new registrations ([5b4ff56](https://github.com/twinfoundation/engine/commit/5b4ff561d06b6513c870a72bb20ba23c0653cfe8))
37
+ * regular dependencies ([c95095f](https://github.com/twinfoundation/engine/commit/c95095f6644dc55665108e6749caa2a4187020b8))
38
+ * remove additional identity auth components ([409b2e6](https://github.com/twinfoundation/engine/commit/409b2e6a5a543d0795b01916349b39922afb6d88))
39
+ * remove authentication generator components ([#67](https://github.com/twinfoundation/engine/issues/67)) ([62f7984](https://github.com/twinfoundation/engine/commit/62f798468f567fdbf648401aa0dc51cda871c913))
40
+ * remove dap and darp ([d568c4f](https://github.com/twinfoundation/engine/commit/d568c4fc58a3159378e1d65f93228ae84f34a31d))
41
+ * simplify config building ([732c871](https://github.com/twinfoundation/engine/commit/732c871c5aca236759168f4bc15aeffd98a330a8))
42
+ * standardised engine logging naming ([0dbf857](https://github.com/twinfoundation/engine/commit/0dbf857587641f86ddf010143519d0e8333489ff))
43
+ * switch to devDeps ([32832ac](https://github.com/twinfoundation/engine/commit/32832acd934e1e5569474281a527c9b118d30732))
44
+ * update dependencies ([034adac](https://github.com/twinfoundation/engine/commit/034adac97b177d8df9775da92f0cc0dbdfc8ab55))
45
+ * update dependencies ([97c9f64](https://github.com/twinfoundation/engine/commit/97c9f64b6ef096963bcc5de338a2a9e99bdc1a11))
46
+ * update framework core ([acc0f8d](https://github.com/twinfoundation/engine/commit/acc0f8d455a4b8ec47f1da643139fa0f07775fa6))
47
+ * update rights management and add authentication generators ([f728a1e](https://github.com/twinfoundation/engine/commit/f728a1efea15ada8d10cfbe17cafe7e2b252f527))
48
+ * update rights management components ([#74](https://github.com/twinfoundation/engine/issues/74)) ([be94ba8](https://github.com/twinfoundation/engine/commit/be94ba837999c586266a7c73228689566ec9876b))
49
+ * update rights management dependencies ([14d06fb](https://github.com/twinfoundation/engine/commit/14d06fb6604ad04e4094da7b51b61a01a0280b8b))
50
+ * upgrade framework components ([efd52e8](https://github.com/twinfoundation/engine/commit/efd52e80564fff29c3897bfa09b6305b3a322812))
51
+ * use peer dependencies ([69dd744](https://github.com/twinfoundation/engine/commit/69dd7449010b8e6f5f35e7fad201ad4c1cab400c))
52
+ * use shared store mechanism ([#2](https://github.com/twinfoundation/engine/issues/2)) ([9eed8d7](https://github.com/twinfoundation/engine/commit/9eed8d7766388479b42f03e2542fe761f2156408))
53
+
54
+
55
+ ### Bug Fixes
56
+
57
+ * make sure stop is called even if start is not implemented ([ece2b9d](https://github.com/twinfoundation/engine/commit/ece2b9de5c6dff2b5ccf2a3115c1a7328a330125))
58
+ * missing dependency ([e8147fb](https://github.com/twinfoundation/engine/commit/e8147fbd66248efd86877ece23022f2dd58c950a))
59
+
60
+
61
+ ### Dependencies
62
+
63
+ * The following workspace dependencies were updated
64
+ * dependencies
65
+ * @twin.org/engine-core bumped from 0.0.3-next.22 to 0.0.3-next.23
66
+ * @twin.org/engine-models bumped from 0.0.3-next.22 to 0.0.3-next.23
67
+
3
68
  ## [0.0.3-next.22](https://github.com/twinfoundation/engine/compare/engine-types-v0.0.3-next.21...engine-types-v0.0.3-next.22) (2026-02-23)
4
69
 
5
70
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twin.org/engine-types",
3
- "version": "0.0.3-next.22",
3
+ "version": "0.0.3-next.23",
4
4
  "description": "Types to use in an engine.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -54,8 +54,8 @@
54
54
  "@twin.org/document-management-models": "next",
55
55
  "@twin.org/document-management-rest-client": "next",
56
56
  "@twin.org/document-management-service": "next",
57
- "@twin.org/engine-core": "0.0.3-next.22",
58
- "@twin.org/engine-models": "0.0.3-next.22",
57
+ "@twin.org/engine-core": "0.0.3-next.23",
58
+ "@twin.org/engine-models": "0.0.3-next.23",
59
59
  "@twin.org/entity": "next",
60
60
  "@twin.org/entity-storage-connector-cosmosdb": "next",
61
61
  "@twin.org/entity-storage-connector-dynamodb": "next",