@twin.org/engine 0.0.1-next.78 → 0.0.1-next.80

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.
@@ -32,6 +32,7 @@ class Engine extends engineCore.EngineCore {
32
32
  this.addTypeInitialiser("loggingConnector", this._context.config.types.loggingConnector, "@twin.org/engine-types", "initialiseLoggingConnector");
33
33
  this.addTypeInitialiser("loggingComponent", this._context.config.types.loggingComponent, "@twin.org/engine-types", "initialiseLoggingComponent");
34
34
  this.addTypeInitialiser("backgroundTaskConnector", this._context.config.types.backgroundTaskConnector, "@twin.org/engine-types", "initialiseBackgroundTaskConnector");
35
+ this.addTypeInitialiser("taskSchedulerComponent", this._context.config.types.taskSchedulerComponent, "@twin.org/engine-types", "initialiseTaskSchedulerComponent");
35
36
  this.addTypeInitialiser("eventBusConnector", this._context.config.types.eventBusConnector, "@twin.org/engine-types", "initialiseEventBusConnector");
36
37
  this.addTypeInitialiser("eventBusComponent", this._context.config.types.eventBusComponent, "@twin.org/engine-types", "initialiseEventBusComponent");
37
38
  this.addTypeInitialiser("telemetryConnector", this._context.config.types.telemetryConnector, "@twin.org/engine-types", "initialiseTelemetryConnector");
@@ -155,8 +156,8 @@ function buildEngineConfiguration(envVars) {
155
156
  configureAuditableItemStream(coreConfig);
156
157
  configureDocumentManagement(coreConfig);
157
158
  configureFederatedCatalogue(coreConfig, envVars);
158
- configureRightsManagementPap(coreConfig, envVars);
159
159
  configureRightsManagement(coreConfig, envVars);
160
+ configureTaskScheduler(coreConfig, envVars);
160
161
  return coreConfig;
161
162
  }
162
163
  /**
@@ -945,32 +946,34 @@ function configureFederatedCatalogue(coreConfig, envVars) {
945
946
  }
946
947
  }
947
948
  /**
948
- * Configures the rights management PAP.
949
+ * Configures the rights management.
949
950
  * @param coreConfig The core config.
950
951
  * @param envVars The environment variables.
951
952
  */
952
- function configureRightsManagementPap(coreConfig, envVars) {
953
- coreConfig.types.rightsManagementPapComponent ??= [];
954
- coreConfig.types.rightsManagementPapComponent.push({
955
- type: engineTypes.RightsManagementPapComponentType.Service,
956
- options: {
957
- odrlPolicyEntityStorageType: envVars.rightsManagementPapEntityStorageType
958
- }
959
- });
953
+ function configureRightsManagement(coreConfig, envVars) {
954
+ if (core.Coerce.boolean(envVars.rightsManagementEnabled) ?? false) {
955
+ coreConfig.types.rightsManagementPapComponent ??= [];
956
+ coreConfig.types.rightsManagementPapComponent.push({
957
+ type: engineTypes.RightsManagementPapComponentType.Service
958
+ });
959
+ coreConfig.types.rightsManagementComponent ??= [];
960
+ coreConfig.types.rightsManagementComponent.push({
961
+ type: engineTypes.RightsManagementComponentType.Service
962
+ });
963
+ }
960
964
  }
961
965
  /**
962
- * Configures the rights management.
966
+ * Configures the task scheduler.
963
967
  * @param coreConfig The core config.
964
968
  * @param envVars The environment variables.
965
969
  */
966
- function configureRightsManagement(coreConfig, envVars) {
967
- coreConfig.types.rightsManagementComponent ??= [];
968
- coreConfig.types.rightsManagementComponent.push({
969
- type: engineTypes.RightsManagementComponentType.Service,
970
- options: {
971
- papComponentType: envVars.rightsManagementPapComponentType
972
- }
973
- });
970
+ function configureTaskScheduler(coreConfig, envVars) {
971
+ if (core.Coerce.boolean(envVars.taskSchedulerEnabled) ?? true) {
972
+ coreConfig.types.taskSchedulerComponent ??= [];
973
+ coreConfig.types.taskSchedulerComponent.push({
974
+ type: engineTypes.TaskSchedulerComponentType.Default
975
+ });
976
+ }
974
977
  }
975
978
 
976
979
  exports.Engine = Engine;
@@ -1,6 +1,6 @@
1
1
  import { EngineCore } from '@twin.org/engine-core';
2
2
  import { Guards, StringHelper, Is, Coerce } from '@twin.org/core';
3
- import { EntityStorageComponentType, EntityStorageConnectorType, BlobStorageConnectorType, BlobStorageComponentType, VaultConnectorType, LoggingConnectorType, LoggingComponentType, BackgroundTaskConnectorType, EventBusConnectorType, EventBusComponentType, TelemetryConnectorType, TelemetryComponentType, MessagingEmailConnectorType, MessagingSmsConnectorType, MessagingPushNotificationConnectorType, MessagingComponentType, FaucetConnectorType, WalletConnectorType, NftConnectorType, NftComponentType, VerifiableStorageConnectorType, VerifiableStorageComponentType, ImmutableProofComponentType, AuditableItemGraphComponentType, AuditableItemStreamComponentType, IdentityConnectorType, IdentityComponentType, IdentityResolverConnectorType, IdentityResolverComponentType, IdentityProfileConnectorType, IdentityProfileComponentType, AttestationConnectorType, AttestationComponentType, DataConverterConnectorType, DataExtractorConnectorType, DataProcessingComponentType, DocumentManagementComponentType, FederatedCatalogueComponentType, RightsManagementPapComponentType, RightsManagementComponentType } from '@twin.org/engine-types';
3
+ import { EntityStorageComponentType, EntityStorageConnectorType, BlobStorageConnectorType, BlobStorageComponentType, VaultConnectorType, LoggingConnectorType, LoggingComponentType, BackgroundTaskConnectorType, EventBusConnectorType, EventBusComponentType, TelemetryConnectorType, TelemetryComponentType, MessagingEmailConnectorType, MessagingSmsConnectorType, MessagingPushNotificationConnectorType, MessagingComponentType, FaucetConnectorType, WalletConnectorType, NftConnectorType, NftComponentType, VerifiableStorageConnectorType, VerifiableStorageComponentType, ImmutableProofComponentType, AuditableItemGraphComponentType, AuditableItemStreamComponentType, IdentityConnectorType, IdentityComponentType, IdentityResolverConnectorType, IdentityResolverComponentType, IdentityProfileConnectorType, IdentityProfileComponentType, AttestationConnectorType, AttestationComponentType, DataConverterConnectorType, DataExtractorConnectorType, DataProcessingComponentType, DocumentManagementComponentType, FederatedCatalogueComponentType, RightsManagementPapComponentType, RightsManagementComponentType, TaskSchedulerComponentType } from '@twin.org/engine-types';
4
4
  import { EntitySchemaFactory } from '@twin.org/entity';
5
5
  import path from 'node:path';
6
6
 
@@ -30,6 +30,7 @@ class Engine extends EngineCore {
30
30
  this.addTypeInitialiser("loggingConnector", this._context.config.types.loggingConnector, "@twin.org/engine-types", "initialiseLoggingConnector");
31
31
  this.addTypeInitialiser("loggingComponent", this._context.config.types.loggingComponent, "@twin.org/engine-types", "initialiseLoggingComponent");
32
32
  this.addTypeInitialiser("backgroundTaskConnector", this._context.config.types.backgroundTaskConnector, "@twin.org/engine-types", "initialiseBackgroundTaskConnector");
33
+ this.addTypeInitialiser("taskSchedulerComponent", this._context.config.types.taskSchedulerComponent, "@twin.org/engine-types", "initialiseTaskSchedulerComponent");
33
34
  this.addTypeInitialiser("eventBusConnector", this._context.config.types.eventBusConnector, "@twin.org/engine-types", "initialiseEventBusConnector");
34
35
  this.addTypeInitialiser("eventBusComponent", this._context.config.types.eventBusComponent, "@twin.org/engine-types", "initialiseEventBusComponent");
35
36
  this.addTypeInitialiser("telemetryConnector", this._context.config.types.telemetryConnector, "@twin.org/engine-types", "initialiseTelemetryConnector");
@@ -153,8 +154,8 @@ function buildEngineConfiguration(envVars) {
153
154
  configureAuditableItemStream(coreConfig);
154
155
  configureDocumentManagement(coreConfig);
155
156
  configureFederatedCatalogue(coreConfig, envVars);
156
- configureRightsManagementPap(coreConfig, envVars);
157
157
  configureRightsManagement(coreConfig, envVars);
158
+ configureTaskScheduler(coreConfig, envVars);
158
159
  return coreConfig;
159
160
  }
160
161
  /**
@@ -943,32 +944,34 @@ function configureFederatedCatalogue(coreConfig, envVars) {
943
944
  }
944
945
  }
945
946
  /**
946
- * Configures the rights management PAP.
947
+ * Configures the rights management.
947
948
  * @param coreConfig The core config.
948
949
  * @param envVars The environment variables.
949
950
  */
950
- function configureRightsManagementPap(coreConfig, envVars) {
951
- coreConfig.types.rightsManagementPapComponent ??= [];
952
- coreConfig.types.rightsManagementPapComponent.push({
953
- type: RightsManagementPapComponentType.Service,
954
- options: {
955
- odrlPolicyEntityStorageType: envVars.rightsManagementPapEntityStorageType
956
- }
957
- });
951
+ function configureRightsManagement(coreConfig, envVars) {
952
+ if (Coerce.boolean(envVars.rightsManagementEnabled) ?? false) {
953
+ coreConfig.types.rightsManagementPapComponent ??= [];
954
+ coreConfig.types.rightsManagementPapComponent.push({
955
+ type: RightsManagementPapComponentType.Service
956
+ });
957
+ coreConfig.types.rightsManagementComponent ??= [];
958
+ coreConfig.types.rightsManagementComponent.push({
959
+ type: RightsManagementComponentType.Service
960
+ });
961
+ }
958
962
  }
959
963
  /**
960
- * Configures the rights management.
964
+ * Configures the task scheduler.
961
965
  * @param coreConfig The core config.
962
966
  * @param envVars The environment variables.
963
967
  */
964
- function configureRightsManagement(coreConfig, envVars) {
965
- coreConfig.types.rightsManagementComponent ??= [];
966
- coreConfig.types.rightsManagementComponent.push({
967
- type: RightsManagementComponentType.Service,
968
- options: {
969
- papComponentType: envVars.rightsManagementPapComponentType
970
- }
971
- });
968
+ function configureTaskScheduler(coreConfig, envVars) {
969
+ if (Coerce.boolean(envVars.taskSchedulerEnabled) ?? true) {
970
+ coreConfig.types.taskSchedulerComponent ??= [];
971
+ coreConfig.types.taskSchedulerComponent.push({
972
+ type: TaskSchedulerComponentType.Default
973
+ });
974
+ }
972
975
  }
973
976
 
974
977
  export { Engine, EngineConfigHelper, buildEngineConfiguration };
@@ -371,11 +371,11 @@ export interface IEngineEnvironmentVariables {
371
371
  */
372
372
  federatedCatalogueClearingHouseApproverList?: string;
373
373
  /**
374
- * Rights management PAP (Policy Administration Point) entity storage type.
374
+ * Is the rights management enabled, defaults to false.
375
375
  */
376
- rightsManagementPapEntityStorageType?: string;
376
+ rightsManagementEnabled?: string;
377
377
  /**
378
- * Rights management PAP (Policy Administration Point) component type.
378
+ * Is the task scheduler enabled, defaults to true.
379
379
  */
380
- rightsManagementPapComponentType?: string;
380
+ taskSchedulerEnabled?: string;
381
381
  }
package/docs/changelog.md CHANGED
@@ -1,5 +1,35 @@
1
1
  # @twin.org/engine - Changelog
2
2
 
3
+ ## [0.0.1-next.80](https://github.com/twinfoundation/engine/compare/engine-v0.0.1-next.79...engine-v0.0.1-next.80) (2025-06-23)
4
+
5
+
6
+ ### Features
7
+
8
+ * add task scheduler ([0951107](https://github.com/twinfoundation/engine/commit/09511073ad042194a45206303f0ef31d8d6af5db))
9
+
10
+
11
+ ### Dependencies
12
+
13
+ * The following workspace dependencies were updated
14
+ * dependencies
15
+ * @twin.org/engine-core bumped from 0.0.1-next.79 to 0.0.1-next.80
16
+ * @twin.org/engine-types bumped from 0.0.1-next.79 to 0.0.1-next.80
17
+
18
+ ## [0.0.1-next.79](https://github.com/twinfoundation/engine/compare/engine-v0.0.1-next.78...engine-v0.0.1-next.79) (2025-06-18)
19
+
20
+
21
+ ### Features
22
+
23
+ * update rights management config ([d447575](https://github.com/twinfoundation/engine/commit/d447575cd5cdf3cdf1fe92087e90188ec97516f5))
24
+
25
+
26
+ ### Dependencies
27
+
28
+ * The following workspace dependencies were updated
29
+ * dependencies
30
+ * @twin.org/engine-core bumped from 0.0.1-next.78 to 0.0.1-next.79
31
+ * @twin.org/engine-types bumped from 0.0.1-next.78 to 0.0.1-next.79
32
+
3
33
  ## [0.0.1-next.78](https://github.com/twinfoundation/engine/compare/engine-v0.0.1-next.77...engine-v0.0.1-next.78) (2025-06-18)
4
34
 
5
35
 
@@ -740,16 +740,16 @@ Federated catalog clearing house approver list, stringified array of DIDs.
740
740
 
741
741
  ***
742
742
 
743
- ### rightsManagementPapEntityStorageType?
743
+ ### rightsManagementEnabled?
744
744
 
745
- > `optional` **rightsManagementPapEntityStorageType**: `string`
745
+ > `optional` **rightsManagementEnabled**: `string`
746
746
 
747
- Rights management PAP (Policy Administration Point) entity storage type.
747
+ Is the rights management enabled, defaults to false.
748
748
 
749
749
  ***
750
750
 
751
- ### rightsManagementPapComponentType?
751
+ ### taskSchedulerEnabled?
752
752
 
753
- > `optional` **rightsManagementPapComponentType**: `string`
753
+ > `optional` **taskSchedulerEnabled**: `string`
754
754
 
755
- Rights management PAP (Policy Administration Point) component type.
755
+ Is the task scheduler enabled, defaults to true.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twin.org/engine",
3
- "version": "0.0.1-next.78",
3
+ "version": "0.0.1-next.80",
4
4
  "description": "Engine implementation.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -15,8 +15,8 @@
15
15
  },
16
16
  "dependencies": {
17
17
  "@twin.org/core": "next",
18
- "@twin.org/engine-core": "0.0.1-next.78",
19
- "@twin.org/engine-types": "0.0.1-next.78",
18
+ "@twin.org/engine-core": "0.0.1-next.80",
19
+ "@twin.org/engine-types": "0.0.1-next.80",
20
20
  "@twin.org/entity": "next"
21
21
  },
22
22
  "main": "./dist/cjs/index.cjs",