@twin.org/engine-types 0.0.3-next.5 → 0.0.3-next.7
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.
- package/dist/es/components/backgroundTask.js +9 -11
- package/dist/es/components/backgroundTask.js.map +1 -1
- package/dist/es/components/dataSpaceConnector.js +1 -1
- package/dist/es/components/dataSpaceConnector.js.map +1 -1
- package/dist/es/components/federatedCatalogue.js +1 -5
- package/dist/es/components/federatedCatalogue.js.map +1 -1
- package/dist/es/components/federatedCatalogueFilter.js +31 -0
- package/dist/es/components/federatedCatalogueFilter.js.map +1 -0
- package/dist/es/components/immutableProof.js +1 -1
- package/dist/es/components/immutableProof.js.map +1 -1
- package/dist/es/components/rightsManagementDap.js +2 -4
- package/dist/es/components/rightsManagementDap.js.map +1 -1
- package/dist/es/components/rightsManagementDarp.js +1 -0
- package/dist/es/components/rightsManagementDarp.js.map +1 -1
- package/dist/es/components/rightsManagementDataAccessHandler.js +27 -0
- package/dist/es/components/rightsManagementDataAccessHandler.js.map +1 -0
- package/dist/es/components/rightsManagementPdp.js +2 -16
- package/dist/es/components/rightsManagementPdp.js.map +1 -1
- package/dist/es/components/rightsManagementPep.js +2 -16
- package/dist/es/components/rightsManagementPep.js.map +1 -1
- package/dist/es/components/rightsManagementPip.js +2 -16
- package/dist/es/components/rightsManagementPip.js.map +1 -1
- package/dist/es/components/rightsManagementPnp.js +3 -23
- package/dist/es/components/rightsManagementPnp.js.map +1 -1
- package/dist/es/components/rightsManagementPolicyArbiter.js +27 -0
- package/dist/es/components/rightsManagementPolicyArbiter.js.map +1 -0
- package/dist/es/components/rightsManagementPolicyEnforcementProcessor.js +27 -0
- package/dist/es/components/rightsManagementPolicyEnforcementProcessor.js.map +1 -0
- package/dist/es/components/rightsManagementPolicyExecutionAction.js +27 -0
- package/dist/es/components/rightsManagementPolicyExecutionAction.js.map +1 -0
- package/dist/es/components/rightsManagementPolicyInformationSource.js +35 -0
- package/dist/es/components/rightsManagementPolicyInformationSource.js.map +1 -0
- package/dist/es/components/rightsManagementPolicyNegotiator.js +27 -0
- package/dist/es/components/rightsManagementPolicyNegotiator.js.map +1 -0
- package/dist/es/components/rightsManagementPolicyRequester.js +27 -0
- package/dist/es/components/rightsManagementPolicyRequester.js.map +1 -0
- package/dist/es/components/rightsManagementPxp.js +2 -16
- package/dist/es/components/rightsManagementPxp.js.map +1 -1
- package/dist/es/components/synchronisedStorage.js +1 -1
- package/dist/es/components/synchronisedStorage.js.map +1 -1
- package/dist/es/components/trust.js +29 -0
- package/dist/es/components/trust.js.map +1 -0
- package/dist/es/components/trustGenerator.js +28 -0
- package/dist/es/components/trustGenerator.js.map +1 -0
- package/dist/es/components/trustVerifier.js +28 -0
- package/dist/es/components/trustVerifier.js.map +1 -0
- package/dist/es/index.js +35 -2
- package/dist/es/index.js.map +1 -1
- package/dist/es/models/IEngineConfig.js.map +1 -1
- package/dist/es/models/config/backgroundTaskComponentConfig.js +2 -0
- package/dist/es/models/config/backgroundTaskComponentConfig.js.map +1 -0
- package/dist/es/models/config/federatedCatalogueFilterComponentConfig.js +2 -0
- package/dist/es/models/config/federatedCatalogueFilterComponentConfig.js.map +1 -0
- package/dist/es/models/config/rightsManagementDarpComponentConfig.js.map +1 -1
- package/dist/es/models/config/rightsManagementDataAccessHandlerComponentConfig.js +2 -0
- package/dist/es/models/config/rightsManagementDataAccessHandlerComponentConfig.js.map +1 -0
- package/dist/es/models/config/rightsManagementPdpComponentConfig.js.map +1 -1
- package/dist/es/models/config/rightsManagementPepComponentConfig.js.map +1 -1
- package/dist/es/models/config/rightsManagementPipComponentConfig.js.map +1 -1
- package/dist/es/models/config/rightsManagementPnpComponentConfig.js.map +1 -1
- package/dist/es/models/config/rightsManagementPolicyArbiterComponentConfig.js +2 -0
- package/dist/es/models/config/rightsManagementPolicyArbiterComponentConfig.js.map +1 -0
- package/dist/es/models/config/rightsManagementPolicyEnforcementProcessorComponentConfig.js +2 -0
- package/dist/es/models/config/rightsManagementPolicyEnforcementProcessorComponentConfig.js.map +1 -0
- package/dist/es/models/config/rightsManagementPolicyExecutionActionComponentConfig.js +2 -0
- package/dist/es/models/config/rightsManagementPolicyExecutionActionComponentConfig.js.map +1 -0
- package/dist/es/models/config/rightsManagementPolicyInformationSourceComponentConfig.js +2 -0
- package/dist/es/models/config/rightsManagementPolicyInformationSourceComponentConfig.js.map +1 -0
- package/dist/es/models/config/rightsManagementPolicyNegotiatorComponentConfig.js +2 -0
- package/dist/es/models/config/rightsManagementPolicyNegotiatorComponentConfig.js.map +1 -0
- package/dist/es/models/config/rightsManagementPolicyRequesterComponentConfig.js +2 -0
- package/dist/es/models/config/rightsManagementPolicyRequesterComponentConfig.js.map +1 -0
- package/dist/es/models/config/rightsManagementPxpComponentConfig.js.map +1 -1
- package/dist/es/models/config/trustComponentConfig.js +2 -0
- package/dist/es/models/config/trustComponentConfig.js.map +1 -0
- package/dist/es/models/config/trustGeneratorComponentConfig.js +2 -0
- package/dist/es/models/config/trustGeneratorComponentConfig.js.map +1 -0
- package/dist/es/models/config/trustVerifierComponentConfig.js +2 -0
- package/dist/es/models/config/trustVerifierComponentConfig.js.map +1 -0
- package/dist/es/models/types/backgroundTaskComponentType.js +13 -0
- package/dist/es/models/types/backgroundTaskComponentType.js.map +1 -0
- package/dist/es/models/types/federatedCatalogueFilterComponentType.js +13 -0
- package/dist/es/models/types/federatedCatalogueFilterComponentType.js.map +1 -0
- package/dist/es/models/types/rightsManagementDataAccessHandlerComponentType.js +13 -0
- package/dist/es/models/types/rightsManagementDataAccessHandlerComponentType.js.map +1 -0
- package/dist/es/models/types/rightsManagementPolicyArbiterComponentType.js +13 -0
- package/dist/es/models/types/rightsManagementPolicyArbiterComponentType.js.map +1 -0
- package/dist/es/models/types/rightsManagementPolicyEnforcementProcessorComponentType.js +13 -0
- package/dist/es/models/types/rightsManagementPolicyEnforcementProcessorComponentType.js.map +1 -0
- package/dist/es/models/types/rightsManagementPolicyExecutionActionComponentType.js +13 -0
- package/dist/es/models/types/rightsManagementPolicyExecutionActionComponentType.js.map +1 -0
- package/dist/es/models/types/rightsManagementPolicyInformationSourceComponentType.js +17 -0
- package/dist/es/models/types/rightsManagementPolicyInformationSourceComponentType.js.map +1 -0
- package/dist/es/models/types/rightsManagementPolicyNegotiatorComponentType.js +13 -0
- package/dist/es/models/types/rightsManagementPolicyNegotiatorComponentType.js.map +1 -0
- package/dist/es/models/types/rightsManagementPolicyRequesterComponentType.js +13 -0
- package/dist/es/models/types/rightsManagementPolicyRequesterComponentType.js.map +1 -0
- package/dist/es/models/types/trustComponentType.js +13 -0
- package/dist/es/models/types/trustComponentType.js.map +1 -0
- package/dist/es/models/types/trustGeneratorComponentType.js +13 -0
- package/dist/es/models/types/trustGeneratorComponentType.js.map +1 -0
- package/dist/es/models/types/trustVerifierComponentType.js +13 -0
- package/dist/es/models/types/trustVerifierComponentType.js.map +1 -0
- package/dist/types/components/backgroundTask.d.ts +5 -6
- package/dist/types/components/federatedCatalogueFilter.d.ts +17 -0
- package/dist/types/components/rightsManagementDataAccessHandler.d.ts +17 -0
- package/dist/types/components/rightsManagementPolicyArbiter.d.ts +17 -0
- package/dist/types/components/rightsManagementPolicyEnforcementProcessor.d.ts +17 -0
- package/dist/types/components/rightsManagementPolicyExecutionAction.d.ts +17 -0
- package/dist/types/components/rightsManagementPolicyInformationSource.d.ts +17 -0
- package/dist/types/components/rightsManagementPolicyNegotiator.d.ts +17 -0
- package/dist/types/components/rightsManagementPolicyRequester.d.ts +17 -0
- package/dist/types/components/trust.d.ts +16 -0
- package/dist/types/components/trustGenerator.d.ts +17 -0
- package/dist/types/components/trustVerifier.d.ts +17 -0
- package/dist/types/index.d.ts +35 -2
- package/dist/types/models/IEngineConfig.d.ts +58 -3
- package/dist/types/models/config/backgroundTaskComponentConfig.d.ts +9 -0
- package/dist/types/models/config/federatedCatalogueFilterComponentConfig.d.ts +9 -0
- package/dist/types/models/config/rightsManagementDarpComponentConfig.d.ts +1 -4
- package/dist/types/models/config/rightsManagementDataAccessHandlerComponentConfig.d.ts +9 -0
- package/dist/types/models/config/rightsManagementPdpComponentConfig.d.ts +1 -4
- package/dist/types/models/config/rightsManagementPepComponentConfig.d.ts +1 -4
- package/dist/types/models/config/rightsManagementPipComponentConfig.d.ts +1 -4
- package/dist/types/models/config/rightsManagementPnpComponentConfig.d.ts +1 -5
- package/dist/types/models/config/rightsManagementPolicyArbiterComponentConfig.d.ts +9 -0
- package/dist/types/models/config/rightsManagementPolicyEnforcementProcessorComponentConfig.d.ts +9 -0
- package/dist/types/models/config/rightsManagementPolicyExecutionActionComponentConfig.d.ts +9 -0
- package/dist/types/models/config/rightsManagementPolicyInformationSourceComponentConfig.d.ts +12 -0
- package/dist/types/models/config/rightsManagementPolicyNegotiatorComponentConfig.d.ts +9 -0
- package/dist/types/models/config/rightsManagementPolicyRequesterComponentConfig.d.ts +9 -0
- package/dist/types/models/config/rightsManagementPxpComponentConfig.d.ts +1 -4
- package/dist/types/models/config/trustComponentConfig.d.ts +9 -0
- package/dist/types/models/config/trustGeneratorComponentConfig.d.ts +9 -0
- package/dist/types/models/config/trustVerifierComponentConfig.d.ts +9 -0
- package/dist/types/models/types/backgroundTaskComponentType.d.ts +13 -0
- package/dist/types/models/types/federatedCatalogueFilterComponentType.d.ts +13 -0
- package/dist/types/models/types/rightsManagementDataAccessHandlerComponentType.d.ts +13 -0
- package/dist/types/models/types/rightsManagementPolicyArbiterComponentType.d.ts +13 -0
- package/dist/types/models/types/rightsManagementPolicyEnforcementProcessorComponentType.d.ts +13 -0
- package/dist/types/models/types/rightsManagementPolicyExecutionActionComponentType.d.ts +13 -0
- package/dist/types/models/types/rightsManagementPolicyInformationSourceComponentType.d.ts +17 -0
- package/dist/types/models/types/rightsManagementPolicyNegotiatorComponentType.d.ts +13 -0
- package/dist/types/models/types/rightsManagementPolicyRequesterComponentType.d.ts +13 -0
- package/dist/types/models/types/trustComponentType.d.ts +13 -0
- package/dist/types/models/types/trustGeneratorComponentType.d.ts +13 -0
- package/dist/types/models/types/trustVerifierComponentType.d.ts +13 -0
- package/docs/changelog.md +30 -0
- package/docs/reference/functions/{initialiseBackgroundTaskConnector.md → initialiseBackgroundTaskComponent.md} +5 -5
- package/docs/reference/functions/initialiseFederatedCatalogueFilterComponent.md +31 -0
- package/docs/reference/functions/initialiseRightsManagementDataAccessHandlerComponent.md +31 -0
- package/docs/reference/functions/initialiseRightsManagementPolicyArbiterComponent.md +31 -0
- package/docs/reference/functions/initialiseRightsManagementPolicyEnforcementProcessorComponent.md +31 -0
- package/docs/reference/functions/initialiseRightsManagementPolicyExecutionActionComponent.md +31 -0
- package/docs/reference/functions/initialiseRightsManagementPolicyInformationSourceComponent.md +31 -0
- package/docs/reference/functions/initialiseRightsManagementPolicyNegotiatorComponent.md +31 -0
- package/docs/reference/functions/initialiseRightsManagementPolicyRequesterComponent.md +31 -0
- package/docs/reference/functions/initialiseTrustComponent.md +31 -0
- package/docs/reference/functions/initialiseTrustGeneratorComponent.md +31 -0
- package/docs/reference/functions/initialiseTrustVerifierComponent.md +31 -0
- package/docs/reference/index.md +48 -4
- package/docs/reference/interfaces/IEngineConfig.md +69 -3
- package/docs/reference/type-aliases/BackgroundTaskComponentConfig.md +17 -0
- package/docs/reference/type-aliases/BackgroundTaskComponentType.md +5 -0
- package/docs/reference/type-aliases/FederatedCatalogueFilterComponentConfig.md +17 -0
- package/docs/reference/type-aliases/FederatedCatalogueFilterComponentType.md +5 -0
- package/docs/reference/type-aliases/RightsManagementDarpComponentConfig.md +1 -7
- package/docs/reference/type-aliases/RightsManagementDataAccessHandlerComponentConfig.md +17 -0
- package/docs/reference/type-aliases/RightsManagementDataAccessHandlerComponentType.md +5 -0
- package/docs/reference/type-aliases/RightsManagementPdpComponentConfig.md +1 -7
- package/docs/reference/type-aliases/RightsManagementPepComponentConfig.md +1 -7
- package/docs/reference/type-aliases/RightsManagementPipComponentConfig.md +1 -7
- package/docs/reference/type-aliases/RightsManagementPnpComponentConfig.md +1 -1
- package/docs/reference/type-aliases/RightsManagementPolicyArbiterComponentConfig.md +17 -0
- package/docs/reference/type-aliases/RightsManagementPolicyArbiterComponentType.md +5 -0
- package/docs/reference/type-aliases/RightsManagementPolicyEnforcementProcessorComponentConfig.md +17 -0
- package/docs/reference/type-aliases/RightsManagementPolicyEnforcementProcessorComponentType.md +5 -0
- package/docs/reference/type-aliases/RightsManagementPolicyExecutionActionComponentConfig.md +17 -0
- package/docs/reference/type-aliases/RightsManagementPolicyExecutionActionComponentType.md +5 -0
- package/docs/reference/type-aliases/RightsManagementPolicyInformationSourceComponentConfig.md +5 -0
- package/docs/reference/type-aliases/RightsManagementPolicyInformationSourceComponentType.md +5 -0
- package/docs/reference/type-aliases/RightsManagementPolicyNegotiatorComponentConfig.md +17 -0
- package/docs/reference/type-aliases/RightsManagementPolicyNegotiatorComponentType.md +5 -0
- package/docs/reference/type-aliases/RightsManagementPolicyRequesterComponentConfig.md +17 -0
- package/docs/reference/type-aliases/RightsManagementPolicyRequesterComponentType.md +5 -0
- package/docs/reference/type-aliases/RightsManagementPxpComponentConfig.md +1 -7
- package/docs/reference/type-aliases/TrustComponentConfig.md +17 -0
- package/docs/reference/type-aliases/TrustComponentType.md +5 -0
- package/docs/reference/type-aliases/TrustGeneratorComponentConfig.md +17 -0
- package/docs/reference/type-aliases/TrustGeneratorComponentType.md +5 -0
- package/docs/reference/type-aliases/TrustVerifierComponentConfig.md +17 -0
- package/docs/reference/type-aliases/TrustVerifierComponentType.md +5 -0
- package/docs/reference/variables/BackgroundTaskComponentType.md +13 -0
- package/docs/reference/variables/FederatedCatalogueFilterComponentType.md +13 -0
- package/docs/reference/variables/RightsManagementDataAccessHandlerComponentType.md +13 -0
- package/docs/reference/variables/RightsManagementPolicyArbiterComponentType.md +13 -0
- package/docs/reference/variables/RightsManagementPolicyEnforcementProcessorComponentType.md +13 -0
- package/docs/reference/variables/RightsManagementPolicyExecutionActionComponentType.md +13 -0
- package/docs/reference/variables/RightsManagementPolicyInformationSourceComponentType.md +19 -0
- package/docs/reference/variables/RightsManagementPolicyNegotiatorComponentType.md +13 -0
- package/docs/reference/variables/RightsManagementPolicyRequesterComponentType.md +13 -0
- package/docs/reference/variables/TrustComponentType.md +13 -0
- package/docs/reference/variables/TrustGeneratorComponentType.md +13 -0
- package/docs/reference/variables/TrustVerifierComponentType.md +13 -0
- package/package.json +10 -4
- package/dist/es/models/config/backgroundTaskConnectorConfig.js +0 -2
- package/dist/es/models/config/backgroundTaskConnectorConfig.js.map +0 -1
- package/dist/es/models/types/backgroundTaskConnectorType.js +0 -13
- package/dist/es/models/types/backgroundTaskConnectorType.js.map +0 -1
- package/dist/types/models/config/backgroundTaskConnectorConfig.d.ts +0 -9
- package/dist/types/models/types/backgroundTaskConnectorType.d.ts +0 -13
- package/docs/reference/type-aliases/BackgroundTaskConnectorConfig.md +0 -17
- package/docs/reference/type-aliases/BackgroundTaskConnectorType.md +0 -5
- package/docs/reference/variables/BackgroundTaskConnectorType.md +0 -13
|
@@ -1,33 +1,31 @@
|
|
|
1
|
-
|
|
2
|
-
// SPDX-License-Identifier: Apache-2.0.
|
|
3
|
-
import { EntityStorageBackgroundTaskConnector, initSchema } from "@twin.org/background-task-connector-entity-storage";
|
|
4
|
-
import { BackgroundTaskConnectorFactory } from "@twin.org/background-task-models";
|
|
1
|
+
import { BackgroundTaskService, initSchema } from "@twin.org/background-task-service";
|
|
5
2
|
import { ContextIdHelper, ContextIdKeys } from "@twin.org/context";
|
|
3
|
+
import { ComponentFactory } from "@twin.org/core";
|
|
6
4
|
import { initialiseEntityStorageConnector } from "./entityStorage.js";
|
|
7
|
-
import {
|
|
5
|
+
import { BackgroundTaskComponentType } from "../models/types/backgroundTaskComponentType.js";
|
|
8
6
|
/**
|
|
9
|
-
* Initialise a background task
|
|
7
|
+
* Initialise a background task component.
|
|
10
8
|
* @param engineCore The engine core.
|
|
11
9
|
* @param context The context for the engine.
|
|
12
10
|
* @param instanceConfig The instance config.
|
|
13
11
|
* @returns The instance created and the factory for it.
|
|
14
12
|
*/
|
|
15
|
-
export async function
|
|
13
|
+
export async function initialiseBackgroundTaskComponent(engineCore, context, instanceConfig) {
|
|
16
14
|
let component;
|
|
17
15
|
let instanceType;
|
|
18
|
-
if (instanceConfig.type ===
|
|
16
|
+
if (instanceConfig.type === BackgroundTaskComponentType.Service) {
|
|
19
17
|
initSchema();
|
|
20
18
|
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.backgroundTaskEntityStorageType, "BackgroundTask", ContextIdHelper.pickKeysFromAvailable(engineCore.getContextIdKeys(), [ContextIdKeys.Node]));
|
|
21
|
-
component = new
|
|
19
|
+
component = new BackgroundTaskService({
|
|
22
20
|
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
23
21
|
...instanceConfig.options
|
|
24
22
|
});
|
|
25
|
-
instanceType =
|
|
23
|
+
instanceType = "background-task-service";
|
|
26
24
|
}
|
|
27
25
|
return {
|
|
28
26
|
component,
|
|
29
27
|
instanceType,
|
|
30
|
-
factory:
|
|
28
|
+
factory: ComponentFactory
|
|
31
29
|
};
|
|
32
30
|
}
|
|
33
31
|
//# sourceMappingURL=backgroundTask.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"backgroundTask.js","sourceRoot":"","sources":["../../../src/components/backgroundTask.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"backgroundTask.js","sourceRoot":"","sources":["../../../src/components/backgroundTask.ts"],"names":[],"mappings":"AAGA,OAAO,EACN,qBAAqB,EACrB,UAAU,EAEV,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAmB,MAAM,gBAAgB,CAAC;AAGnE,OAAO,EAAE,gCAAgC,EAAE,MAAM,oBAAoB,CAAC;AAGtE,OAAO,EAAE,2BAA2B,EAAE,MAAM,gDAAgD,CAAC;AAE7F;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,iCAAiC,CACtD,UAAsC,EACtC,OAA0C,EAC1C,cAA6C;IAM7C,IAAI,SAA+C,CAAC;IACpD,IAAI,YAAgC,CAAC;IAErC,IAAI,cAAc,CAAC,IAAI,KAAK,2BAA2B,CAAC,OAAO,EAAE,CAAC;QACjE,UAAU,EAAE,CAAC;QACb,gCAAgC,CAC/B,UAAU,EACV,OAAO,EACP,cAAc,CAAC,OAAO,EAAE,+BAA+B,oBAEvD,eAAe,CAAC,qBAAqB,CAAC,UAAU,CAAC,gBAAgB,EAAE,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,CAC1F,CAAC;QACF,SAAS,GAAG,IAAI,qBAAqB,CAAC;YACrC,oBAAoB,EAAE,UAAU,CAAC,yBAAyB,CAAC,kBAAkB,CAAC;YAC9E,GAAG,cAAc,CAAC,OAAO;SACzB,CAAC,CAAC;QACH,YAAY,4BAAyC,CAAC;IACvD,CAAC;IAED,OAAO;QACN,SAAS;QACT,YAAY;QACZ,OAAO,EAAE,gBAAgB;KACzB,CAAC;AACH,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IBackgroundTaskComponent } from \"@twin.org/background-task-models\";\nimport {\n\tBackgroundTaskService,\n\tinitSchema,\n\ttype BackgroundTask\n} from \"@twin.org/background-task-service\";\nimport { ContextIdHelper, ContextIdKeys } from \"@twin.org/context\";\nimport { ComponentFactory, type IComponent } from \"@twin.org/core\";\nimport type { IEngineCore, IEngineCoreContext } from \"@twin.org/engine-models\";\nimport { nameof, nameofKebabCase } from \"@twin.org/nameof\";\nimport { initialiseEntityStorageConnector } from \"./entityStorage.js\";\nimport type { BackgroundTaskComponentConfig } from \"../models/config/backgroundTaskComponentConfig.js\";\nimport type { IEngineConfig } from \"../models/IEngineConfig.js\";\nimport { BackgroundTaskComponentType } from \"../models/types/backgroundTaskComponentType.js\";\n\n/**\n * Initialise a background task component.\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 async function initialiseBackgroundTaskComponent(\n\tengineCore: IEngineCore<IEngineConfig>,\n\tcontext: IEngineCoreContext<IEngineConfig>,\n\tinstanceConfig: BackgroundTaskComponentConfig\n): Promise<{\n\tinstanceType?: string;\n\tfactory?: typeof ComponentFactory;\n\tcomponent?: IComponent;\n}> {\n\tlet component: IBackgroundTaskComponent | undefined;\n\tlet instanceType: string | undefined;\n\n\tif (instanceConfig.type === BackgroundTaskComponentType.Service) {\n\t\tinitSchema();\n\t\tinitialiseEntityStorageConnector(\n\t\t\tengineCore,\n\t\t\tcontext,\n\t\t\tinstanceConfig.options?.backgroundTaskEntityStorageType,\n\t\t\tnameof<BackgroundTask>(),\n\t\t\tContextIdHelper.pickKeysFromAvailable(engineCore.getContextIdKeys(), [ContextIdKeys.Node])\n\t\t);\n\t\tcomponent = new BackgroundTaskService({\n\t\t\tloggingComponentType: engineCore.getRegisteredInstanceType(\"loggingComponent\"),\n\t\t\t...instanceConfig.options\n\t\t});\n\t\tinstanceType = nameofKebabCase(BackgroundTaskService);\n\t}\n\n\treturn {\n\t\tcomponent,\n\t\tinstanceType,\n\t\tfactory: ComponentFactory\n\t};\n}\n"]}
|
|
@@ -24,7 +24,7 @@ export async function initialiseDataSpaceConnectorComponent(engineCore, context,
|
|
|
24
24
|
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.activityTaskEntityStorageType, "ActivityTask", partitionContextIds);
|
|
25
25
|
component = new DataSpaceConnectorService({
|
|
26
26
|
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
27
|
-
|
|
27
|
+
backgroundTaskComponentType: engineCore.getRegisteredInstanceType("backgroundTaskComponent"),
|
|
28
28
|
taskSchedulerComponentType: engineCore.getRegisteredInstanceType("taskSchedulerComponent"),
|
|
29
29
|
federatedCatalogueComponentType: engineCore.getRegisteredInstanceType("federatedCatalogueComponent"),
|
|
30
30
|
partitionContextIds,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dataSpaceConnector.js","sourceRoot":"","sources":["../../../src/components/dataSpaceConnector.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAmB,MAAM,gBAAgB,CAAC;AAEnE,OAAO,EAAE,4BAA4B,EAAE,MAAM,4CAA4C,CAAC;AAC1F,OAAO,EAGN,yBAAyB,EACzB,UAAU,IAAI,4BAA4B,EAC1C,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAAE,8BAA8B,EAAE,MAAM,8CAA8C,CAAC;AAG9F,OAAO,EAAE,gCAAgC,EAAE,MAAM,oBAAoB,CAAC;AAGtE,OAAO,EAAE,+BAA+B,EAAE,MAAM,oDAAoD,CAAC;AAErG;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,qCAAqC,CAC1D,UAAsC,EACtC,OAA0C,EAC1C,cAAiD;IAMjD,IAAI,SAA0C,CAAC;IAC/C,IAAI,YAAgC,CAAC;IAErC,IAAI,cAAc,CAAC,IAAI,KAAK,+BAA+B,CAAC,OAAO,EAAE,CAAC;QACrE,4BAA4B,EAAE,CAAC;QAE/B,MAAM,mBAAmB,GAAG,eAAe,CAAC,qBAAqB,CAChE,UAAU,CAAC,gBAAgB,EAAE,EAC7B,CAAC,aAAa,CAAC,IAAI,EAAE,aAAa,CAAC,MAAM,CAAC,CAC1C,CAAC;QAEF,gCAAgC,CAC/B,UAAU,EACV,OAAO,EACP,cAAc,CAAC,OAAO,EAAE,4BAA4B,wBAEpD,mBAAmB,CACnB,CAAC;QACF,gCAAgC,CAC/B,UAAU,EACV,OAAO,EACP,cAAc,CAAC,OAAO,EAAE,6BAA6B,kBAErD,mBAAmB,CACnB,CAAC;QACF,SAAS,GAAG,IAAI,yBAAyB,CAAC;YACzC,oBAAoB,EAAE,UAAU,CAAC,yBAAyB,CAAC,kBAAkB,CAAC;YAC9E,2BAA2B,EAAE,UAAU,CAAC,yBAAyB,CAAC,yBAAyB,CAAC;YAC5F,0BAA0B,EAAE,UAAU,CAAC,yBAAyB,CAAC,wBAAwB,CAAC;YAC1F,+BAA+B,EAAE,UAAU,CAAC,yBAAyB,CACpE,6BAA6B,CAC7B;YACD,mBAAmB;YACnB,GAAG,cAAc,CAAC,OAAO;SACzB,CAAC,CAAC;QACH,YAAY,iCAA6C,CAAC;IAC3D,CAAC;SAAM,IAAI,cAAc,CAAC,IAAI,KAAK,+BAA+B,CAAC,UAAU,EAAE,CAAC;QAC/E,SAAS,GAAG,IAAI,4BAA4B,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;QACrE,YAAY,qCAAgD,CAAC;IAC9D,CAAC;SAAM,IAAI,cAAc,CAAC,IAAI,KAAK,+BAA+B,CAAC,YAAY,EAAE,CAAC;QACjF,SAAS,GAAG,IAAI,8BAA8B,CAAC;YAC9C,oBAAoB,EAAE,UAAU,CAAC,yBAAyB,CAAC,kBAAkB,CAAC;YAC9E,GAAG,cAAc,CAAC,OAAO;SACzB,CAAC,CAAC;QACH,YAAY,uCAAkD,CAAC;IAChE,CAAC;IAED,OAAO;QACN,SAAS;QACT,YAAY;QACZ,OAAO,EAAE,gBAAgB;KACzB,CAAC;AACH,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { ContextIdHelper, ContextIdKeys } from \"@twin.org/context\";\nimport { ComponentFactory, type IComponent } from \"@twin.org/core\";\nimport type { IDataSpaceConnector } from \"@twin.org/data-space-connector-models\";\nimport { DataSpaceConnectorRestClient } from \"@twin.org/data-space-connector-rest-client\";\nimport {\n\ttype ActivityLogDetails,\n\ttype ActivityTask,\n\tDataSpaceConnectorService,\n\tinitSchema as initSchemaDataSpaceConnector\n} from \"@twin.org/data-space-connector-service\";\nimport { DataSpaceConnectorSocketClient } from \"@twin.org/data-space-connector-socket-client\";\nimport type { IEngineCore, IEngineCoreContext } from \"@twin.org/engine-models\";\nimport { nameof, nameofKebabCase } from \"@twin.org/nameof\";\nimport { initialiseEntityStorageConnector } from \"./entityStorage.js\";\nimport type { DataSpaceConnectorComponentConfig } from \"../models/config/dataSpaceConnectorComponentConfig.js\";\nimport type { IEngineConfig } from \"../models/IEngineConfig.js\";\nimport { DataSpaceConnectorComponentType } from \"../models/types/dataSpaceConnectorComponentType.js\";\n\n/**\n * Initialise the data space connector component.\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 async function initialiseDataSpaceConnectorComponent(\n\tengineCore: IEngineCore<IEngineConfig>,\n\tcontext: IEngineCoreContext<IEngineConfig>,\n\tinstanceConfig: DataSpaceConnectorComponentConfig\n): Promise<{\n\tinstanceType?: string;\n\tfactory?: typeof ComponentFactory;\n\tcomponent?: IComponent;\n}> {\n\tlet component: IDataSpaceConnector | undefined;\n\tlet instanceType: string | undefined;\n\n\tif (instanceConfig.type === DataSpaceConnectorComponentType.Service) {\n\t\tinitSchemaDataSpaceConnector();\n\n\t\tconst partitionContextIds = ContextIdHelper.pickKeysFromAvailable(\n\t\t\tengineCore.getContextIdKeys(),\n\t\t\t[ContextIdKeys.Node, ContextIdKeys.Tenant]\n\t\t);\n\n\t\tinitialiseEntityStorageConnector(\n\t\t\tengineCore,\n\t\t\tcontext,\n\t\t\tinstanceConfig.options?.activityLogEntityStorageType,\n\t\t\tnameof<ActivityLogDetails>(),\n\t\t\tpartitionContextIds\n\t\t);\n\t\tinitialiseEntityStorageConnector(\n\t\t\tengineCore,\n\t\t\tcontext,\n\t\t\tinstanceConfig.options?.activityTaskEntityStorageType,\n\t\t\tnameof<ActivityTask>(),\n\t\t\tpartitionContextIds\n\t\t);\n\t\tcomponent = new DataSpaceConnectorService({\n\t\t\tloggingComponentType: engineCore.getRegisteredInstanceType(\"loggingComponent\"),\n\t\t\
|
|
1
|
+
{"version":3,"file":"dataSpaceConnector.js","sourceRoot":"","sources":["../../../src/components/dataSpaceConnector.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAmB,MAAM,gBAAgB,CAAC;AAEnE,OAAO,EAAE,4BAA4B,EAAE,MAAM,4CAA4C,CAAC;AAC1F,OAAO,EAGN,yBAAyB,EACzB,UAAU,IAAI,4BAA4B,EAC1C,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAAE,8BAA8B,EAAE,MAAM,8CAA8C,CAAC;AAG9F,OAAO,EAAE,gCAAgC,EAAE,MAAM,oBAAoB,CAAC;AAGtE,OAAO,EAAE,+BAA+B,EAAE,MAAM,oDAAoD,CAAC;AAErG;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,qCAAqC,CAC1D,UAAsC,EACtC,OAA0C,EAC1C,cAAiD;IAMjD,IAAI,SAA0C,CAAC;IAC/C,IAAI,YAAgC,CAAC;IAErC,IAAI,cAAc,CAAC,IAAI,KAAK,+BAA+B,CAAC,OAAO,EAAE,CAAC;QACrE,4BAA4B,EAAE,CAAC;QAE/B,MAAM,mBAAmB,GAAG,eAAe,CAAC,qBAAqB,CAChE,UAAU,CAAC,gBAAgB,EAAE,EAC7B,CAAC,aAAa,CAAC,IAAI,EAAE,aAAa,CAAC,MAAM,CAAC,CAC1C,CAAC;QAEF,gCAAgC,CAC/B,UAAU,EACV,OAAO,EACP,cAAc,CAAC,OAAO,EAAE,4BAA4B,wBAEpD,mBAAmB,CACnB,CAAC;QACF,gCAAgC,CAC/B,UAAU,EACV,OAAO,EACP,cAAc,CAAC,OAAO,EAAE,6BAA6B,kBAErD,mBAAmB,CACnB,CAAC;QACF,SAAS,GAAG,IAAI,yBAAyB,CAAC;YACzC,oBAAoB,EAAE,UAAU,CAAC,yBAAyB,CAAC,kBAAkB,CAAC;YAC9E,2BAA2B,EAAE,UAAU,CAAC,yBAAyB,CAAC,yBAAyB,CAAC;YAC5F,0BAA0B,EAAE,UAAU,CAAC,yBAAyB,CAAC,wBAAwB,CAAC;YAC1F,+BAA+B,EAAE,UAAU,CAAC,yBAAyB,CACpE,6BAA6B,CAC7B;YACD,mBAAmB;YACnB,GAAG,cAAc,CAAC,OAAO;SACzB,CAAC,CAAC;QACH,YAAY,iCAA6C,CAAC;IAC3D,CAAC;SAAM,IAAI,cAAc,CAAC,IAAI,KAAK,+BAA+B,CAAC,UAAU,EAAE,CAAC;QAC/E,SAAS,GAAG,IAAI,4BAA4B,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;QACrE,YAAY,qCAAgD,CAAC;IAC9D,CAAC;SAAM,IAAI,cAAc,CAAC,IAAI,KAAK,+BAA+B,CAAC,YAAY,EAAE,CAAC;QACjF,SAAS,GAAG,IAAI,8BAA8B,CAAC;YAC9C,oBAAoB,EAAE,UAAU,CAAC,yBAAyB,CAAC,kBAAkB,CAAC;YAC9E,GAAG,cAAc,CAAC,OAAO;SACzB,CAAC,CAAC;QACH,YAAY,uCAAkD,CAAC;IAChE,CAAC;IAED,OAAO;QACN,SAAS;QACT,YAAY;QACZ,OAAO,EAAE,gBAAgB;KACzB,CAAC;AACH,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { ContextIdHelper, ContextIdKeys } from \"@twin.org/context\";\nimport { ComponentFactory, type IComponent } from \"@twin.org/core\";\nimport type { IDataSpaceConnector } from \"@twin.org/data-space-connector-models\";\nimport { DataSpaceConnectorRestClient } from \"@twin.org/data-space-connector-rest-client\";\nimport {\n\ttype ActivityLogDetails,\n\ttype ActivityTask,\n\tDataSpaceConnectorService,\n\tinitSchema as initSchemaDataSpaceConnector\n} from \"@twin.org/data-space-connector-service\";\nimport { DataSpaceConnectorSocketClient } from \"@twin.org/data-space-connector-socket-client\";\nimport type { IEngineCore, IEngineCoreContext } from \"@twin.org/engine-models\";\nimport { nameof, nameofKebabCase } from \"@twin.org/nameof\";\nimport { initialiseEntityStorageConnector } from \"./entityStorage.js\";\nimport type { DataSpaceConnectorComponentConfig } from \"../models/config/dataSpaceConnectorComponentConfig.js\";\nimport type { IEngineConfig } from \"../models/IEngineConfig.js\";\nimport { DataSpaceConnectorComponentType } from \"../models/types/dataSpaceConnectorComponentType.js\";\n\n/**\n * Initialise the data space connector component.\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 async function initialiseDataSpaceConnectorComponent(\n\tengineCore: IEngineCore<IEngineConfig>,\n\tcontext: IEngineCoreContext<IEngineConfig>,\n\tinstanceConfig: DataSpaceConnectorComponentConfig\n): Promise<{\n\tinstanceType?: string;\n\tfactory?: typeof ComponentFactory;\n\tcomponent?: IComponent;\n}> {\n\tlet component: IDataSpaceConnector | undefined;\n\tlet instanceType: string | undefined;\n\n\tif (instanceConfig.type === DataSpaceConnectorComponentType.Service) {\n\t\tinitSchemaDataSpaceConnector();\n\n\t\tconst partitionContextIds = ContextIdHelper.pickKeysFromAvailable(\n\t\t\tengineCore.getContextIdKeys(),\n\t\t\t[ContextIdKeys.Node, ContextIdKeys.Tenant]\n\t\t);\n\n\t\tinitialiseEntityStorageConnector(\n\t\t\tengineCore,\n\t\t\tcontext,\n\t\t\tinstanceConfig.options?.activityLogEntityStorageType,\n\t\t\tnameof<ActivityLogDetails>(),\n\t\t\tpartitionContextIds\n\t\t);\n\t\tinitialiseEntityStorageConnector(\n\t\t\tengineCore,\n\t\t\tcontext,\n\t\t\tinstanceConfig.options?.activityTaskEntityStorageType,\n\t\t\tnameof<ActivityTask>(),\n\t\t\tpartitionContextIds\n\t\t);\n\t\tcomponent = new DataSpaceConnectorService({\n\t\t\tloggingComponentType: engineCore.getRegisteredInstanceType(\"loggingComponent\"),\n\t\t\tbackgroundTaskComponentType: engineCore.getRegisteredInstanceType(\"backgroundTaskComponent\"),\n\t\t\ttaskSchedulerComponentType: engineCore.getRegisteredInstanceType(\"taskSchedulerComponent\"),\n\t\t\tfederatedCatalogueComponentType: engineCore.getRegisteredInstanceType(\n\t\t\t\t\"federatedCatalogueComponent\"\n\t\t\t),\n\t\t\tpartitionContextIds,\n\t\t\t...instanceConfig.options\n\t\t});\n\t\tinstanceType = nameofKebabCase(DataSpaceConnectorService);\n\t} else if (instanceConfig.type === DataSpaceConnectorComponentType.RestClient) {\n\t\tcomponent = new DataSpaceConnectorRestClient(instanceConfig.options);\n\t\tinstanceType = nameofKebabCase(DataSpaceConnectorRestClient);\n\t} else if (instanceConfig.type === DataSpaceConnectorComponentType.SocketClient) {\n\t\tcomponent = new DataSpaceConnectorSocketClient({\n\t\t\tloggingComponentType: engineCore.getRegisteredInstanceType(\"loggingComponent\"),\n\t\t\t...instanceConfig.options\n\t\t});\n\t\tinstanceType = nameofKebabCase(DataSpaceConnectorSocketClient);\n\t}\n\n\treturn {\n\t\tcomponent,\n\t\tinstanceType,\n\t\tfactory: ComponentFactory\n\t};\n}\n"]}
|
|
@@ -18,13 +18,9 @@ export async function initialiseFederatedCatalogueComponent(engineCore, context,
|
|
|
18
18
|
let instanceType;
|
|
19
19
|
if (instanceConfig.type === FederatedCatalogueComponentType.Service) {
|
|
20
20
|
initSchemaFederatedCatalogue();
|
|
21
|
-
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.
|
|
22
|
-
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.participantEntityStorageType, "ParticipantEntry", ContextIdHelper.pickKeysFromAvailable(engineCore.getContextIdKeys(), [ContextIdKeys.Node]));
|
|
23
|
-
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.serviceOfferingEntityStorageType, "ServiceOfferingEntry", ContextIdHelper.pickKeysFromAvailable(engineCore.getContextIdKeys(), [ContextIdKeys.Node]));
|
|
24
|
-
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.dataSpaceConnectorStorageType, "DataSpaceConnectorEntry", ContextIdHelper.pickKeysFromAvailable(engineCore.getContextIdKeys(), [ContextIdKeys.Node]));
|
|
21
|
+
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.datasetStorageConnectorType, "Dataset", ContextIdHelper.pickKeysFromAvailable(engineCore.getContextIdKeys(), [ContextIdKeys.Node]));
|
|
25
22
|
component = new FederatedCatalogueService({
|
|
26
23
|
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
27
|
-
identityResolverComponentType: engineCore.getRegisteredInstanceType("identityResolverComponent"),
|
|
28
24
|
...instanceConfig.options
|
|
29
25
|
});
|
|
30
26
|
instanceType = "federated-catalogue-service";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"federatedCatalogue.js","sourceRoot":"","sources":["../../../src/components/federatedCatalogue.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAmB,MAAM,gBAAgB,CAAC;AAGnE,OAAO,EAAE,4BAA4B,EAAE,MAAM,2CAA2C,CAAC;AACzF,OAAO,
|
|
1
|
+
{"version":3,"file":"federatedCatalogue.js","sourceRoot":"","sources":["../../../src/components/federatedCatalogue.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAmB,MAAM,gBAAgB,CAAC;AAGnE,OAAO,EAAE,4BAA4B,EAAE,MAAM,2CAA2C,CAAC;AACzF,OAAO,EAEN,yBAAyB,EACzB,UAAU,IAAI,4BAA4B,EAC1C,MAAM,uCAAuC,CAAC;AAE/C,OAAO,EAAE,gCAAgC,EAAE,MAAM,oBAAoB,CAAC;AAGtE,OAAO,EAAE,+BAA+B,EAAE,MAAM,oDAAoD,CAAC;AAErG;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,qCAAqC,CAC1D,UAAsC,EACtC,OAA0C,EAC1C,cAAiD;IAMjD,IAAI,SAAmD,CAAC;IACxD,IAAI,YAAgC,CAAC;IAErC,IAAI,cAAc,CAAC,IAAI,KAAK,+BAA+B,CAAC,OAAO,EAAE,CAAC;QACrE,4BAA4B,EAAE,CAAC;QAE/B,gCAAgC,CAC/B,UAAU,EACV,OAAO,EACP,cAAc,CAAC,OAAO,EAAE,2BAA2B,aAEnD,eAAe,CAAC,qBAAqB,CAAC,UAAU,CAAC,gBAAgB,EAAE,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,CAC1F,CAAC;QAEF,SAAS,GAAG,IAAI,yBAAyB,CAAC;YACzC,oBAAoB,EAAE,UAAU,CAAC,yBAAyB,CAAC,kBAAkB,CAAC;YAC9E,GAAG,cAAc,CAAC,OAAO;SACzB,CAAC,CAAC;QACH,YAAY,gCAA6C,CAAC;IAC3D,CAAC;SAAM,IAAI,cAAc,CAAC,IAAI,KAAK,+BAA+B,CAAC,UAAU,EAAE,CAAC;QAC/E,SAAS,GAAG,IAAI,4BAA4B,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;QACrE,YAAY,oCAAgD,CAAC;IAC9D,CAAC;IAED,OAAO;QACN,SAAS;QACT,YAAY;QAEZ,OAAO,EAAE,gBAAgB;KACzB,CAAC;AACH,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { ContextIdHelper, ContextIdKeys } from \"@twin.org/context\";\nimport { ComponentFactory, type IComponent } from \"@twin.org/core\";\nimport type { IEngineCore, IEngineCoreContext } from \"@twin.org/engine-models\";\nimport type { IFederatedCatalogueComponent } from \"@twin.org/federated-catalogue-models\";\nimport { FederatedCatalogueRestClient } from \"@twin.org/federated-catalogue-rest-client\";\nimport {\n\ttype Dataset,\n\tFederatedCatalogueService,\n\tinitSchema as initSchemaFederatedCatalogue\n} from \"@twin.org/federated-catalogue-service\";\nimport { nameof, nameofKebabCase } from \"@twin.org/nameof\";\nimport { initialiseEntityStorageConnector } from \"./entityStorage.js\";\nimport type { FederatedCatalogueComponentConfig } from \"../models/config/federatedCatalogueComponentConfig.js\";\nimport type { IEngineConfig } from \"../models/IEngineConfig.js\";\nimport { FederatedCatalogueComponentType } from \"../models/types/federatedCatalogueComponentType.js\";\n\n/**\n * Initialise the federated catalogue component.\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 async function initialiseFederatedCatalogueComponent(\n\tengineCore: IEngineCore<IEngineConfig>,\n\tcontext: IEngineCoreContext<IEngineConfig>,\n\tinstanceConfig: FederatedCatalogueComponentConfig\n): Promise<{\n\tinstanceType?: string;\n\tfactory?: typeof ComponentFactory;\n\tcomponent?: IComponent;\n}> {\n\tlet component: IFederatedCatalogueComponent | undefined;\n\tlet instanceType: string | undefined;\n\n\tif (instanceConfig.type === FederatedCatalogueComponentType.Service) {\n\t\tinitSchemaFederatedCatalogue();\n\n\t\tinitialiseEntityStorageConnector(\n\t\t\tengineCore,\n\t\t\tcontext,\n\t\t\tinstanceConfig.options?.datasetStorageConnectorType,\n\t\t\tnameof<Dataset>(),\n\t\t\tContextIdHelper.pickKeysFromAvailable(engineCore.getContextIdKeys(), [ContextIdKeys.Node])\n\t\t);\n\n\t\tcomponent = new FederatedCatalogueService({\n\t\t\tloggingComponentType: engineCore.getRegisteredInstanceType(\"loggingComponent\"),\n\t\t\t...instanceConfig.options\n\t\t});\n\t\tinstanceType = nameofKebabCase(FederatedCatalogueService);\n\t} else if (instanceConfig.type === FederatedCatalogueComponentType.RestClient) {\n\t\tcomponent = new FederatedCatalogueRestClient(instanceConfig.options);\n\t\tinstanceType = nameofKebabCase(FederatedCatalogueRestClient);\n\t}\n\n\treturn {\n\t\tcomponent,\n\t\tinstanceType,\n\n\t\tfactory: ComponentFactory\n\t};\n}\n"]}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// Copyright 2024 IOTA Stiftung.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
3
|
+
import { ContextIdHelper, ContextIdKeys } from "@twin.org/context";
|
|
4
|
+
import { FilterByExample } from "@twin.org/federated-catalogue-filters";
|
|
5
|
+
import { FederatedCatalogueFilterFactory } from "@twin.org/federated-catalogue-models";
|
|
6
|
+
import { initSchema as initSchemaFederatedCatalogue } from "@twin.org/federated-catalogue-service";
|
|
7
|
+
import { initialiseEntityStorageConnector } from "./entityStorage.js";
|
|
8
|
+
import { FederatedCatalogueFilterComponentType } from "../models/types/federatedCatalogueFilterComponentType.js";
|
|
9
|
+
/**
|
|
10
|
+
* Initialise the federated catalogue filter component.
|
|
11
|
+
* @param engineCore The engine core.
|
|
12
|
+
* @param context The context for the engine.
|
|
13
|
+
* @param instanceConfig The instance config.
|
|
14
|
+
* @returns The instance created and the factory for it.
|
|
15
|
+
*/
|
|
16
|
+
export async function initialiseFederatedCatalogueFilterComponent(engineCore, context, instanceConfig) {
|
|
17
|
+
let component;
|
|
18
|
+
let instanceType;
|
|
19
|
+
if (instanceConfig.type === FederatedCatalogueFilterComponentType.FilterByExample) {
|
|
20
|
+
initSchemaFederatedCatalogue();
|
|
21
|
+
initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.datasetStorageConnectorType, "Dataset", ContextIdHelper.pickKeysFromAvailable(engineCore.getContextIdKeys(), [ContextIdKeys.Node]));
|
|
22
|
+
component = new FilterByExample(instanceConfig.options);
|
|
23
|
+
instanceType = "FilterByExample";
|
|
24
|
+
}
|
|
25
|
+
return {
|
|
26
|
+
component,
|
|
27
|
+
instanceType,
|
|
28
|
+
factory: FederatedCatalogueFilterFactory
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=federatedCatalogueFilter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"federatedCatalogueFilter.js","sourceRoot":"","sources":["../../../src/components/federatedCatalogueFilter.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAGnE,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AACxE,OAAO,EACN,+BAA+B,EAE/B,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAEN,UAAU,IAAI,4BAA4B,EAC1C,MAAM,uCAAuC,CAAC;AAE/C,OAAO,EAAE,gCAAgC,EAAE,MAAM,oBAAoB,CAAC;AAGtE,OAAO,EAAE,qCAAqC,EAAE,MAAM,0DAA0D,CAAC;AAEjH;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,2CAA2C,CAChE,UAAsC,EACtC,OAA0C,EAC1C,cAAuD;IAMvD,IAAI,SAAgD,CAAC;IACrD,IAAI,YAAgC,CAAC;IAErC,IAAI,cAAc,CAAC,IAAI,KAAK,qCAAqC,CAAC,eAAe,EAAE,CAAC;QACnF,4BAA4B,EAAE,CAAC;QAE/B,gCAAgC,CAC/B,UAAU,EACV,OAAO,EACP,cAAc,CAAC,OAAO,EAAE,2BAA2B,aAEnD,eAAe,CAAC,qBAAqB,CAAC,UAAU,CAAC,gBAAgB,EAAE,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,CAC1F,CAAC;QAEF,SAAS,GAAG,IAAI,eAAe,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;QACxD,YAAY,oBAA0B,CAAC;IACxC,CAAC;IAED,OAAO;QACN,SAAS;QACT,YAAY;QACZ,OAAO,EAAE,+BAA+B;KACxC,CAAC;AACH,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { ContextIdHelper, ContextIdKeys } from \"@twin.org/context\";\nimport type { IComponent } from \"@twin.org/core\";\nimport type { IEngineCore, IEngineCoreContext } from \"@twin.org/engine-models\";\nimport { FilterByExample } from \"@twin.org/federated-catalogue-filters\";\nimport {\n\tFederatedCatalogueFilterFactory,\n\ttype IFederatedCatalogueFilter\n} from \"@twin.org/federated-catalogue-models\";\nimport {\n\ttype Dataset,\n\tinitSchema as initSchemaFederatedCatalogue\n} from \"@twin.org/federated-catalogue-service\";\nimport { nameof } from \"@twin.org/nameof\";\nimport { initialiseEntityStorageConnector } from \"./entityStorage.js\";\nimport type { FederatedCatalogueFilterComponentConfig } from \"../models/config/federatedCatalogueFilterComponentConfig.js\";\nimport type { IEngineConfig } from \"../models/IEngineConfig.js\";\nimport { FederatedCatalogueFilterComponentType } from \"../models/types/federatedCatalogueFilterComponentType.js\";\n\n/**\n * Initialise the federated catalogue filter component.\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 async function initialiseFederatedCatalogueFilterComponent(\n\tengineCore: IEngineCore<IEngineConfig>,\n\tcontext: IEngineCoreContext<IEngineConfig>,\n\tinstanceConfig: FederatedCatalogueFilterComponentConfig\n): Promise<{\n\tinstanceType?: string;\n\tfactory?: typeof FederatedCatalogueFilterFactory;\n\tcomponent?: IComponent;\n}> {\n\tlet component: IFederatedCatalogueFilter | undefined;\n\tlet instanceType: string | undefined;\n\n\tif (instanceConfig.type === FederatedCatalogueFilterComponentType.FilterByExample) {\n\t\tinitSchemaFederatedCatalogue();\n\n\t\tinitialiseEntityStorageConnector(\n\t\t\tengineCore,\n\t\t\tcontext,\n\t\t\tinstanceConfig.options?.datasetStorageConnectorType,\n\t\t\tnameof<Dataset>(),\n\t\t\tContextIdHelper.pickKeysFromAvailable(engineCore.getContextIdKeys(), [ContextIdKeys.Node])\n\t\t);\n\n\t\tcomponent = new FilterByExample(instanceConfig.options);\n\t\tinstanceType = nameof(FilterByExample);\n\t}\n\n\treturn {\n\t\tcomponent,\n\t\tinstanceType,\n\t\tfactory: FederatedCatalogueFilterFactory\n\t};\n}\n"]}
|
|
@@ -25,7 +25,7 @@ export async function initialiseImmutableProofComponent(engineCore, context, ins
|
|
|
25
25
|
component = new ImmutableProofService({
|
|
26
26
|
verifiableStorageType: engineCore.getRegisteredInstanceType("verifiableStorageConnector"),
|
|
27
27
|
identityConnectorType: engineCore.getRegisteredInstanceType("identityConnector"),
|
|
28
|
-
|
|
28
|
+
backgroundTaskComponentType: engineCore.getRegisteredInstanceType("backgroundTaskComponent"),
|
|
29
29
|
eventBusComponentType: engineCore.getRegisteredInstanceTypeOptional("eventBusComponent"),
|
|
30
30
|
...instanceConfig.options
|
|
31
31
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"immutableProof.js","sourceRoot":"","sources":["../../../src/components/immutableProof.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAmB,MAAM,gBAAgB,CAAC;AAGnE,OAAO,EAAE,wBAAwB,EAAE,MAAM,uCAAuC,CAAC;AACjF,OAAO,EAEN,qBAAqB,EACrB,UAAU,IAAI,wBAAwB,EACtC,MAAM,mCAAmC,CAAC;AAE3C,OAAO,EAAE,gCAAgC,EAAE,MAAM,oBAAoB,CAAC;AAGtE,OAAO,EAAE,2BAA2B,EAAE,MAAM,gDAAgD,CAAC;AAE7F;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,iCAAiC,CACtD,UAAsC,EACtC,OAA0C,EAC1C,cAA6C;IAM7C,IAAI,SAA+C,CAAC;IACpD,IAAI,YAAgC,CAAC;IAErC,IAAI,cAAc,CAAC,IAAI,KAAK,2BAA2B,CAAC,OAAO,EAAE,CAAC;QACjE,wBAAwB,EAAE,CAAC;QAE3B,gCAAgC,CAC/B,UAAU,EACV,OAAO,EACP,cAAc,CAAC,OAAO,EAAE,+BAA+B,oBAEvD,eAAe,CAAC,qBAAqB,CAAC,UAAU,CAAC,gBAAgB,EAAE,EAAE;YACpE,aAAa,CAAC,IAAI;YAClB,aAAa,CAAC,MAAM;SACpB,CAAC,CACF,CAAC;QAEF,SAAS,GAAG,IAAI,qBAAqB,CAAC;YACrC,qBAAqB,EAAE,UAAU,CAAC,yBAAyB,CAAC,4BAA4B,CAAC;YACzF,qBAAqB,EAAE,UAAU,CAAC,yBAAyB,CAAC,mBAAmB,CAAC;YAChF,2BAA2B,EAAE,UAAU,CAAC,yBAAyB,CAAC,yBAAyB,CAAC;YAC5F,qBAAqB,EAAE,UAAU,CAAC,iCAAiC,CAAC,mBAAmB,CAAC;YACxF,GAAG,cAAc,CAAC,OAAO;SACzB,CAAC,CAAC;QACH,YAAY,4BAAyC,CAAC;IACvD,CAAC;SAAM,IAAI,cAAc,CAAC,IAAI,KAAK,2BAA2B,CAAC,UAAU,EAAE,CAAC;QAC3E,SAAS,GAAG,IAAI,wBAAwB,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;QACjE,YAAY,gCAA4C,CAAC;IAC1D,CAAC;IAED,OAAO;QACN,SAAS;QACT,YAAY;QACZ,OAAO,EAAE,gBAAgB;KACzB,CAAC;AACH,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { ContextIdHelper, ContextIdKeys } from \"@twin.org/context\";\nimport { ComponentFactory, type IComponent } from \"@twin.org/core\";\nimport type { IEngineCore, IEngineCoreContext } from \"@twin.org/engine-models\";\nimport type { IImmutableProofComponent } from \"@twin.org/immutable-proof-models\";\nimport { ImmutableProofRestClient } from \"@twin.org/immutable-proof-rest-client\";\nimport {\n\ttype ImmutableProof,\n\tImmutableProofService,\n\tinitSchema as initSchemaImmutableProof\n} from \"@twin.org/immutable-proof-service\";\nimport { nameof, nameofKebabCase } from \"@twin.org/nameof\";\nimport { initialiseEntityStorageConnector } from \"./entityStorage.js\";\nimport type { ImmutableProofComponentConfig } from \"../models/config/immutableProofComponentConfig.js\";\nimport type { IEngineConfig } from \"../models/IEngineConfig.js\";\nimport { ImmutableProofComponentType } from \"../models/types/immutableProofComponentType.js\";\n\n/**\n * Initialise the immutable proof component.\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 async function initialiseImmutableProofComponent(\n\tengineCore: IEngineCore<IEngineConfig>,\n\tcontext: IEngineCoreContext<IEngineConfig>,\n\tinstanceConfig: ImmutableProofComponentConfig\n): Promise<{\n\tinstanceType?: string;\n\tfactory?: typeof ComponentFactory;\n\tcomponent?: IComponent;\n}> {\n\tlet component: IImmutableProofComponent | undefined;\n\tlet instanceType: string | undefined;\n\n\tif (instanceConfig.type === ImmutableProofComponentType.Service) {\n\t\tinitSchemaImmutableProof();\n\n\t\tinitialiseEntityStorageConnector(\n\t\t\tengineCore,\n\t\t\tcontext,\n\t\t\tinstanceConfig.options?.immutableProofEntityStorageType,\n\t\t\tnameof<ImmutableProof>(),\n\t\t\tContextIdHelper.pickKeysFromAvailable(engineCore.getContextIdKeys(), [\n\t\t\t\tContextIdKeys.Node,\n\t\t\t\tContextIdKeys.Tenant\n\t\t\t])\n\t\t);\n\n\t\tcomponent = new ImmutableProofService({\n\t\t\tverifiableStorageType: engineCore.getRegisteredInstanceType(\"verifiableStorageConnector\"),\n\t\t\tidentityConnectorType: engineCore.getRegisteredInstanceType(\"identityConnector\"),\n\t\t\
|
|
1
|
+
{"version":3,"file":"immutableProof.js","sourceRoot":"","sources":["../../../src/components/immutableProof.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAmB,MAAM,gBAAgB,CAAC;AAGnE,OAAO,EAAE,wBAAwB,EAAE,MAAM,uCAAuC,CAAC;AACjF,OAAO,EAEN,qBAAqB,EACrB,UAAU,IAAI,wBAAwB,EACtC,MAAM,mCAAmC,CAAC;AAE3C,OAAO,EAAE,gCAAgC,EAAE,MAAM,oBAAoB,CAAC;AAGtE,OAAO,EAAE,2BAA2B,EAAE,MAAM,gDAAgD,CAAC;AAE7F;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,iCAAiC,CACtD,UAAsC,EACtC,OAA0C,EAC1C,cAA6C;IAM7C,IAAI,SAA+C,CAAC;IACpD,IAAI,YAAgC,CAAC;IAErC,IAAI,cAAc,CAAC,IAAI,KAAK,2BAA2B,CAAC,OAAO,EAAE,CAAC;QACjE,wBAAwB,EAAE,CAAC;QAE3B,gCAAgC,CAC/B,UAAU,EACV,OAAO,EACP,cAAc,CAAC,OAAO,EAAE,+BAA+B,oBAEvD,eAAe,CAAC,qBAAqB,CAAC,UAAU,CAAC,gBAAgB,EAAE,EAAE;YACpE,aAAa,CAAC,IAAI;YAClB,aAAa,CAAC,MAAM;SACpB,CAAC,CACF,CAAC;QAEF,SAAS,GAAG,IAAI,qBAAqB,CAAC;YACrC,qBAAqB,EAAE,UAAU,CAAC,yBAAyB,CAAC,4BAA4B,CAAC;YACzF,qBAAqB,EAAE,UAAU,CAAC,yBAAyB,CAAC,mBAAmB,CAAC;YAChF,2BAA2B,EAAE,UAAU,CAAC,yBAAyB,CAAC,yBAAyB,CAAC;YAC5F,qBAAqB,EAAE,UAAU,CAAC,iCAAiC,CAAC,mBAAmB,CAAC;YACxF,GAAG,cAAc,CAAC,OAAO;SACzB,CAAC,CAAC;QACH,YAAY,4BAAyC,CAAC;IACvD,CAAC;SAAM,IAAI,cAAc,CAAC,IAAI,KAAK,2BAA2B,CAAC,UAAU,EAAE,CAAC;QAC3E,SAAS,GAAG,IAAI,wBAAwB,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;QACjE,YAAY,gCAA4C,CAAC;IAC1D,CAAC;IAED,OAAO;QACN,SAAS;QACT,YAAY;QACZ,OAAO,EAAE,gBAAgB;KACzB,CAAC;AACH,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { ContextIdHelper, ContextIdKeys } from \"@twin.org/context\";\nimport { ComponentFactory, type IComponent } from \"@twin.org/core\";\nimport type { IEngineCore, IEngineCoreContext } from \"@twin.org/engine-models\";\nimport type { IImmutableProofComponent } from \"@twin.org/immutable-proof-models\";\nimport { ImmutableProofRestClient } from \"@twin.org/immutable-proof-rest-client\";\nimport {\n\ttype ImmutableProof,\n\tImmutableProofService,\n\tinitSchema as initSchemaImmutableProof\n} from \"@twin.org/immutable-proof-service\";\nimport { nameof, nameofKebabCase } from \"@twin.org/nameof\";\nimport { initialiseEntityStorageConnector } from \"./entityStorage.js\";\nimport type { ImmutableProofComponentConfig } from \"../models/config/immutableProofComponentConfig.js\";\nimport type { IEngineConfig } from \"../models/IEngineConfig.js\";\nimport { ImmutableProofComponentType } from \"../models/types/immutableProofComponentType.js\";\n\n/**\n * Initialise the immutable proof component.\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 async function initialiseImmutableProofComponent(\n\tengineCore: IEngineCore<IEngineConfig>,\n\tcontext: IEngineCoreContext<IEngineConfig>,\n\tinstanceConfig: ImmutableProofComponentConfig\n): Promise<{\n\tinstanceType?: string;\n\tfactory?: typeof ComponentFactory;\n\tcomponent?: IComponent;\n}> {\n\tlet component: IImmutableProofComponent | undefined;\n\tlet instanceType: string | undefined;\n\n\tif (instanceConfig.type === ImmutableProofComponentType.Service) {\n\t\tinitSchemaImmutableProof();\n\n\t\tinitialiseEntityStorageConnector(\n\t\t\tengineCore,\n\t\t\tcontext,\n\t\t\tinstanceConfig.options?.immutableProofEntityStorageType,\n\t\t\tnameof<ImmutableProof>(),\n\t\t\tContextIdHelper.pickKeysFromAvailable(engineCore.getContextIdKeys(), [\n\t\t\t\tContextIdKeys.Node,\n\t\t\t\tContextIdKeys.Tenant\n\t\t\t])\n\t\t);\n\n\t\tcomponent = new ImmutableProofService({\n\t\t\tverifiableStorageType: engineCore.getRegisteredInstanceType(\"verifiableStorageConnector\"),\n\t\t\tidentityConnectorType: engineCore.getRegisteredInstanceType(\"identityConnector\"),\n\t\t\tbackgroundTaskComponentType: engineCore.getRegisteredInstanceType(\"backgroundTaskComponent\"),\n\t\t\teventBusComponentType: engineCore.getRegisteredInstanceTypeOptional(\"eventBusComponent\"),\n\t\t\t...instanceConfig.options\n\t\t});\n\t\tinstanceType = nameofKebabCase(ImmutableProofService);\n\t} else if (instanceConfig.type === ImmutableProofComponentType.RestClient) {\n\t\tcomponent = new ImmutableProofRestClient(instanceConfig.options);\n\t\tinstanceType = nameofKebabCase(ImmutableProofRestClient);\n\t}\n\n\treturn {\n\t\tcomponent,\n\t\tinstanceType,\n\t\tfactory: ComponentFactory\n\t};\n}\n"]}
|
|
@@ -18,10 +18,8 @@ export async function initialiseRightsManagementDapComponent(engineCore, context
|
|
|
18
18
|
component = new DataAccessPointService({
|
|
19
19
|
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
20
20
|
policyEnforcementPointComponentType: engineCore.getRegisteredInstanceType("rightsManagementPepComponent"),
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
...instanceConfig.options?.config
|
|
24
|
-
}
|
|
21
|
+
trustComponentType: engineCore.getRegisteredInstanceType("trustComponent"),
|
|
22
|
+
...instanceConfig.options
|
|
25
23
|
});
|
|
26
24
|
instanceType = "data-access-point-service";
|
|
27
25
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rightsManagementDap.js","sourceRoot":"","sources":["../../../src/components/rightsManagementDap.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,gBAAgB,EAAmB,MAAM,gBAAgB,CAAC;AAGnE,OAAO,EAAE,sBAAsB,EAAE,MAAM,yCAAyC,CAAC;AAEjF,OAAO,EAAE,yBAAyB,EAAE,MAAM,yCAAyC,CAAC;AAGpF,OAAO,EAAE,gCAAgC,EAAE,MAAM,qDAAqD,CAAC;AAEvG;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,sCAAsC,CAC3D,UAAsC,EACtC,OAA0C,EAC1C,cAAkD;IAMlD,IAAI,SAAgD,CAAC;IACrD,IAAI,YAAgC,CAAC;IAErC,IAAI,cAAc,CAAC,IAAI,KAAK,gCAAgC,CAAC,OAAO,EAAE,CAAC;QACtE,SAAS,GAAG,IAAI,sBAAsB,CAAC;YACtC,oBAAoB,EAAE,UAAU,CAAC,yBAAyB,CAAC,kBAAkB,CAAC;YAC9E,mCAAmC,EAAE,UAAU,CAAC,yBAAyB,CACxE,8BAA8B,CAC9B;YACD,
|
|
1
|
+
{"version":3,"file":"rightsManagementDap.js","sourceRoot":"","sources":["../../../src/components/rightsManagementDap.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,gBAAgB,EAAmB,MAAM,gBAAgB,CAAC;AAGnE,OAAO,EAAE,sBAAsB,EAAE,MAAM,yCAAyC,CAAC;AAEjF,OAAO,EAAE,yBAAyB,EAAE,MAAM,yCAAyC,CAAC;AAGpF,OAAO,EAAE,gCAAgC,EAAE,MAAM,qDAAqD,CAAC;AAEvG;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,sCAAsC,CAC3D,UAAsC,EACtC,OAA0C,EAC1C,cAAkD;IAMlD,IAAI,SAAgD,CAAC;IACrD,IAAI,YAAgC,CAAC;IAErC,IAAI,cAAc,CAAC,IAAI,KAAK,gCAAgC,CAAC,OAAO,EAAE,CAAC;QACtE,SAAS,GAAG,IAAI,sBAAsB,CAAC;YACtC,oBAAoB,EAAE,UAAU,CAAC,yBAAyB,CAAC,kBAAkB,CAAC;YAC9E,mCAAmC,EAAE,UAAU,CAAC,yBAAyB,CACxE,8BAA8B,CAC9B;YACD,kBAAkB,EAAE,UAAU,CAAC,yBAAyB,CAAC,gBAAgB,CAAC;YAC1E,GAAG,cAAc,CAAC,OAAO;SACzB,CAAC,CAAC;QACH,YAAY,8BAA0C,CAAC;IACxD,CAAC;SAAM,IAAI,cAAc,CAAC,IAAI,KAAK,gCAAgC,CAAC,UAAU,EAAE,CAAC;QAChF,SAAS,GAAG,IAAI,yBAAyB,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;QAClE,YAAY,kCAA6C,CAAC;IAC3D,CAAC;IAED,OAAO;QACN,SAAS;QACT,YAAY;QACZ,OAAO,EAAE,gBAAgB;KACzB,CAAC;AACH,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { ComponentFactory, type IComponent } from \"@twin.org/core\";\nimport type { IEngineCore, IEngineCoreContext } from \"@twin.org/engine-models\";\nimport { nameofKebabCase } from \"@twin.org/nameof\";\nimport { DataAccessPointService } from \"@twin.org/rights-management-dap-service\";\nimport type { IDataAccessPointComponent } from \"@twin.org/rights-management-models\";\nimport { DataAccessPointRestClient } from \"@twin.org/rights-management-rest-client\";\nimport type { RightsManagementDapComponentConfig } from \"../models/config/rightsManagementDapComponentConfig.js\";\nimport type { IEngineConfig } from \"../models/IEngineConfig.js\";\nimport { RightsManagementDapComponentType } from \"../models/types/rightsManagementDapComponentType.js\";\n\n/**\n * Initialise the rights management DAP component.\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 async function initialiseRightsManagementDapComponent(\n\tengineCore: IEngineCore<IEngineConfig>,\n\tcontext: IEngineCoreContext<IEngineConfig>,\n\tinstanceConfig: RightsManagementDapComponentConfig\n): Promise<{\n\tinstanceType?: string;\n\tfactory?: typeof ComponentFactory;\n\tcomponent?: IComponent;\n}> {\n\tlet component: IDataAccessPointComponent | undefined;\n\tlet instanceType: string | undefined;\n\n\tif (instanceConfig.type === RightsManagementDapComponentType.Service) {\n\t\tcomponent = new DataAccessPointService({\n\t\t\tloggingComponentType: engineCore.getRegisteredInstanceType(\"loggingComponent\"),\n\t\t\tpolicyEnforcementPointComponentType: engineCore.getRegisteredInstanceType(\n\t\t\t\t\"rightsManagementPepComponent\"\n\t\t\t),\n\t\t\ttrustComponentType: engineCore.getRegisteredInstanceType(\"trustComponent\"),\n\t\t\t...instanceConfig.options\n\t\t});\n\t\tinstanceType = nameofKebabCase(DataAccessPointService);\n\t} else if (instanceConfig.type === RightsManagementDapComponentType.RestClient) {\n\t\tcomponent = new DataAccessPointRestClient(instanceConfig.options);\n\t\tinstanceType = nameofKebabCase(DataAccessPointRestClient);\n\t}\n\n\treturn {\n\t\tcomponent,\n\t\tinstanceType,\n\t\tfactory: ComponentFactory\n\t};\n}\n"]}
|
|
@@ -16,6 +16,7 @@ export async function initialiseRightsManagementDarpComponent(engineCore, contex
|
|
|
16
16
|
if (instanceConfig.type === RightsManagementDarpComponentType.Service) {
|
|
17
17
|
component = new DataAccessRequestPointService({
|
|
18
18
|
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
19
|
+
trustComponentType: engineCore.getRegisteredInstanceType("trustComponent"),
|
|
19
20
|
...instanceConfig.options
|
|
20
21
|
});
|
|
21
22
|
instanceType = "data-access-request-point-service";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rightsManagementDarp.js","sourceRoot":"","sources":["../../../src/components/rightsManagementDarp.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,gBAAgB,EAAmB,MAAM,gBAAgB,CAAC;AAGnE,OAAO,EAAE,6BAA6B,EAAE,MAAM,yCAAyC,CAAC;AAIxF,OAAO,EAAE,iCAAiC,EAAE,MAAM,sDAAsD,CAAC;AAEzG;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,uCAAuC,CAC5D,UAAsC,EACtC,OAA0C,EAC1C,cAAmD;IAMnD,IAAI,SAAuD,CAAC;IAC5D,IAAI,YAAgC,CAAC;IAErC,IAAI,cAAc,CAAC,IAAI,KAAK,iCAAiC,CAAC,OAAO,EAAE,CAAC;QACvE,SAAS,GAAG,IAAI,6BAA6B,CAAC;YAC7C,oBAAoB,EAAE,UAAU,CAAC,yBAAyB,CAAC,kBAAkB,CAAC;YAC9E,GAAG,cAAc,CAAC,OAAO;SACzB,CAAC,CAAC;QACH,YAAY,sCAAiD,CAAC;IAC/D,CAAC;IAED,OAAO;QACN,SAAS;QACT,YAAY;QACZ,OAAO,EAAE,gBAAgB;KACzB,CAAC;AACH,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { ComponentFactory, type IComponent } from \"@twin.org/core\";\nimport type { IEngineCore, IEngineCoreContext } from \"@twin.org/engine-models\";\nimport { nameofKebabCase } from \"@twin.org/nameof\";\nimport { DataAccessRequestPointService } from \"@twin.org/rights-management-dap-service\";\nimport type { IDataAccessRequestPointComponent } from \"@twin.org/rights-management-models\";\nimport type { RightsManagementDarpComponentConfig } from \"../models/config/rightsManagementDarpComponentConfig.js\";\nimport type { IEngineConfig } from \"../models/IEngineConfig.js\";\nimport { RightsManagementDarpComponentType } from \"../models/types/rightsManagementDarpComponentType.js\";\n\n/**\n * Initialise the rights management DARP component.\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 async function initialiseRightsManagementDarpComponent(\n\tengineCore: IEngineCore<IEngineConfig>,\n\tcontext: IEngineCoreContext<IEngineConfig>,\n\tinstanceConfig: RightsManagementDarpComponentConfig\n): Promise<{\n\tinstanceType?: string;\n\tfactory?: typeof ComponentFactory;\n\tcomponent?: IComponent;\n}> {\n\tlet component: IDataAccessRequestPointComponent | undefined;\n\tlet instanceType: string | undefined;\n\n\tif (instanceConfig.type === RightsManagementDarpComponentType.Service) {\n\t\tcomponent = new DataAccessRequestPointService({\n\t\t\tloggingComponentType: engineCore.getRegisteredInstanceType(\"loggingComponent\"),\n\t\t\t...instanceConfig.options\n\t\t});\n\t\tinstanceType = nameofKebabCase(DataAccessRequestPointService);\n\t}\n\n\treturn {\n\t\tcomponent,\n\t\tinstanceType,\n\t\tfactory: ComponentFactory\n\t};\n}\n"]}
|
|
1
|
+
{"version":3,"file":"rightsManagementDarp.js","sourceRoot":"","sources":["../../../src/components/rightsManagementDarp.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,gBAAgB,EAAmB,MAAM,gBAAgB,CAAC;AAGnE,OAAO,EAAE,6BAA6B,EAAE,MAAM,yCAAyC,CAAC;AAIxF,OAAO,EAAE,iCAAiC,EAAE,MAAM,sDAAsD,CAAC;AAEzG;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,uCAAuC,CAC5D,UAAsC,EACtC,OAA0C,EAC1C,cAAmD;IAMnD,IAAI,SAAuD,CAAC;IAC5D,IAAI,YAAgC,CAAC;IAErC,IAAI,cAAc,CAAC,IAAI,KAAK,iCAAiC,CAAC,OAAO,EAAE,CAAC;QACvE,SAAS,GAAG,IAAI,6BAA6B,CAAC;YAC7C,oBAAoB,EAAE,UAAU,CAAC,yBAAyB,CAAC,kBAAkB,CAAC;YAC9E,kBAAkB,EAAE,UAAU,CAAC,yBAAyB,CAAC,gBAAgB,CAAC;YAC1E,GAAG,cAAc,CAAC,OAAO;SACzB,CAAC,CAAC;QACH,YAAY,sCAAiD,CAAC;IAC/D,CAAC;IAED,OAAO;QACN,SAAS;QACT,YAAY;QACZ,OAAO,EAAE,gBAAgB;KACzB,CAAC;AACH,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { ComponentFactory, type IComponent } from \"@twin.org/core\";\nimport type { IEngineCore, IEngineCoreContext } from \"@twin.org/engine-models\";\nimport { nameofKebabCase } from \"@twin.org/nameof\";\nimport { DataAccessRequestPointService } from \"@twin.org/rights-management-dap-service\";\nimport type { IDataAccessRequestPointComponent } from \"@twin.org/rights-management-models\";\nimport type { RightsManagementDarpComponentConfig } from \"../models/config/rightsManagementDarpComponentConfig.js\";\nimport type { IEngineConfig } from \"../models/IEngineConfig.js\";\nimport { RightsManagementDarpComponentType } from \"../models/types/rightsManagementDarpComponentType.js\";\n\n/**\n * Initialise the rights management DARP component.\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 async function initialiseRightsManagementDarpComponent(\n\tengineCore: IEngineCore<IEngineConfig>,\n\tcontext: IEngineCoreContext<IEngineConfig>,\n\tinstanceConfig: RightsManagementDarpComponentConfig\n): Promise<{\n\tinstanceType?: string;\n\tfactory?: typeof ComponentFactory;\n\tcomponent?: IComponent;\n}> {\n\tlet component: IDataAccessRequestPointComponent | undefined;\n\tlet instanceType: string | undefined;\n\n\tif (instanceConfig.type === RightsManagementDarpComponentType.Service) {\n\t\tcomponent = new DataAccessRequestPointService({\n\t\t\tloggingComponentType: engineCore.getRegisteredInstanceType(\"loggingComponent\"),\n\t\t\ttrustComponentType: engineCore.getRegisteredInstanceType(\"trustComponent\"),\n\t\t\t...instanceConfig.options\n\t\t});\n\t\tinstanceType = nameofKebabCase(DataAccessRequestPointService);\n\t}\n\n\treturn {\n\t\tcomponent,\n\t\tinstanceType,\n\t\tfactory: ComponentFactory\n\t};\n}\n"]}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { DataAccessHandlerFactory } from "@twin.org/rights-management-models";
|
|
2
|
+
import { ExampleDataAccessHandler } from "@twin.org/rights-management-plugins";
|
|
3
|
+
import { RightsManagementDataAccessHandlerComponentType } from "../models/types/rightsManagementDataAccessHandlerComponentType.js";
|
|
4
|
+
/**
|
|
5
|
+
* Initialise the rights management data access handler component.
|
|
6
|
+
* @param engineCore The engine core.
|
|
7
|
+
* @param context The context for the engine.
|
|
8
|
+
* @param instanceConfig The instance config.
|
|
9
|
+
* @returns The instance created and the factory for it.
|
|
10
|
+
*/
|
|
11
|
+
export async function initialiseRightsManagementDataAccessHandlerComponent(engineCore, context, instanceConfig) {
|
|
12
|
+
let component;
|
|
13
|
+
let instanceType;
|
|
14
|
+
if (instanceConfig.type === RightsManagementDataAccessHandlerComponentType.Example) {
|
|
15
|
+
component = new ExampleDataAccessHandler({
|
|
16
|
+
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
17
|
+
...instanceConfig.options
|
|
18
|
+
});
|
|
19
|
+
instanceType = "example-data-access-handler";
|
|
20
|
+
}
|
|
21
|
+
return {
|
|
22
|
+
component,
|
|
23
|
+
instanceType,
|
|
24
|
+
factory: DataAccessHandlerFactory
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=rightsManagementDataAccessHandler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rightsManagementDataAccessHandler.js","sourceRoot":"","sources":["../../../src/components/rightsManagementDataAccessHandler.ts"],"names":[],"mappings":"AAKA,OAAO,EAEN,wBAAwB,EACxB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,wBAAwB,EAAE,MAAM,qCAAqC,CAAC;AAG/E,OAAO,EAAE,8CAA8C,EAAE,MAAM,mEAAmE,CAAC;AAEnI;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,oDAAoD,CACzE,UAAsC,EACtC,OAA0C,EAC1C,cAAgE;IAMhE,IAAI,SAAyC,CAAC;IAC9C,IAAI,YAAgC,CAAC;IAErC,IAAI,cAAc,CAAC,IAAI,KAAK,8CAA8C,CAAC,OAAO,EAAE,CAAC;QACpF,SAAS,GAAG,IAAI,wBAAwB,CAAC;YACxC,oBAAoB,EAAE,UAAU,CAAC,yBAAyB,CAAC,kBAAkB,CAAC;YAC9E,GAAG,cAAc,CAAC,OAAO;SACzB,CAAC,CAAC;QACH,YAAY,gCAA4C,CAAC;IAC1D,CAAC;IAED,OAAO;QACN,SAAS;QACT,YAAY;QACZ,OAAO,EAAE,wBAAwB;KACjC,CAAC;AACH,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IComponent } from \"@twin.org/core\";\nimport type { IEngineCore, IEngineCoreContext } from \"@twin.org/engine-models\";\nimport { nameofKebabCase } from \"@twin.org/nameof\";\nimport {\n\ttype IDataAccessHandler,\n\tDataAccessHandlerFactory\n} from \"@twin.org/rights-management-models\";\nimport { ExampleDataAccessHandler } from \"@twin.org/rights-management-plugins\";\nimport type { RightsManagementDataAccessHandlerComponentConfig } from \"../models/config/rightsManagementDataAccessHandlerComponentConfig.js\";\nimport type { IEngineConfig } from \"../models/IEngineConfig.js\";\nimport { RightsManagementDataAccessHandlerComponentType } from \"../models/types/rightsManagementDataAccessHandlerComponentType.js\";\n\n/**\n * Initialise the rights management data access handler component.\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 async function initialiseRightsManagementDataAccessHandlerComponent(\n\tengineCore: IEngineCore<IEngineConfig>,\n\tcontext: IEngineCoreContext<IEngineConfig>,\n\tinstanceConfig: RightsManagementDataAccessHandlerComponentConfig\n): Promise<{\n\tinstanceType?: string;\n\tfactory?: typeof DataAccessHandlerFactory;\n\tcomponent?: IComponent;\n}> {\n\tlet component: IDataAccessHandler | undefined;\n\tlet instanceType: string | undefined;\n\n\tif (instanceConfig.type === RightsManagementDataAccessHandlerComponentType.Example) {\n\t\tcomponent = new ExampleDataAccessHandler({\n\t\t\tloggingComponentType: engineCore.getRegisteredInstanceType(\"loggingComponent\"),\n\t\t\t...instanceConfig.options\n\t\t});\n\t\tinstanceType = nameofKebabCase(ExampleDataAccessHandler);\n\t}\n\n\treturn {\n\t\tcomponent,\n\t\tinstanceType,\n\t\tfactory: DataAccessHandlerFactory\n\t};\n}\n"]}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
// Copyright 2024 IOTA Stiftung.
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0.
|
|
3
|
-
import { ComponentFactory
|
|
4
|
-
import { EngineModuleHelper } from "@twin.org/engine-core";
|
|
3
|
+
import { ComponentFactory } from "@twin.org/core";
|
|
5
4
|
import { PolicyDecisionPointService } from "@twin.org/rights-management-pdp-service";
|
|
6
5
|
import { RightsManagementPdpComponentType } from "../models/types/rightsManagementPdpComponentType.js";
|
|
7
6
|
/**
|
|
@@ -15,25 +14,12 @@ export async function initialiseRightsManagementPdpComponent(engineCore, context
|
|
|
15
14
|
let component;
|
|
16
15
|
let instanceType;
|
|
17
16
|
if (instanceConfig.type === RightsManagementPdpComponentType.Service) {
|
|
18
|
-
const arbiterModules = [];
|
|
19
|
-
if (Is.arrayValue(instanceConfig.options?.arbiterModulesConfig)) {
|
|
20
|
-
for (const moduleConfig of instanceConfig.options.arbiterModulesConfig) {
|
|
21
|
-
arbiterModules.push({
|
|
22
|
-
arbiterId: moduleConfig.id,
|
|
23
|
-
arbiter: await EngineModuleHelper.loadComponent(engineCore, moduleConfig)
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
17
|
component = new PolicyDecisionPointService({
|
|
28
18
|
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
29
19
|
policyInformationPointComponentType: engineCore.getRegisteredInstanceType("rightsManagementPipComponent"),
|
|
30
20
|
policyManagementPointComponentType: engineCore.getRegisteredInstanceType("rightsManagementPmpComponent"),
|
|
31
21
|
policyExecutionPointComponentType: engineCore.getRegisteredInstanceType("rightsManagementPxpComponent"),
|
|
32
|
-
...instanceConfig.options
|
|
33
|
-
config: {
|
|
34
|
-
...instanceConfig.options?.config,
|
|
35
|
-
arbiters: instanceConfig.options?.config?.arbiters ?? arbiterModules
|
|
36
|
-
}
|
|
22
|
+
...instanceConfig.options
|
|
37
23
|
});
|
|
38
24
|
instanceType = "policy-decision-point-service";
|
|
39
25
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rightsManagementPdp.js","sourceRoot":"","sources":["../../../src/components/rightsManagementPdp.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,gBAAgB,
|
|
1
|
+
{"version":3,"file":"rightsManagementPdp.js","sourceRoot":"","sources":["../../../src/components/rightsManagementPdp.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,gBAAgB,EAAmB,MAAM,gBAAgB,CAAC;AAInE,OAAO,EAAE,0BAA0B,EAAE,MAAM,yCAAyC,CAAC;AAGrF,OAAO,EAAE,gCAAgC,EAAE,MAAM,qDAAqD,CAAC;AAEvG;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,sCAAsC,CAC3D,UAAsC,EACtC,OAA0C,EAC1C,cAAkD;IAMlD,IAAI,SAAoD,CAAC;IACzD,IAAI,YAAgC,CAAC;IAErC,IAAI,cAAc,CAAC,IAAI,KAAK,gCAAgC,CAAC,OAAO,EAAE,CAAC;QACtE,SAAS,GAAG,IAAI,0BAA0B,CAAC;YAC1C,oBAAoB,EAAE,UAAU,CAAC,yBAAyB,CAAC,kBAAkB,CAAC;YAC9E,mCAAmC,EAAE,UAAU,CAAC,yBAAyB,CACxE,8BAA8B,CAC9B;YACD,kCAAkC,EAAE,UAAU,CAAC,yBAAyB,CACvE,8BAA8B,CAC9B;YACD,iCAAiC,EAAE,UAAU,CAAC,yBAAyB,CACtE,8BAA8B,CAC9B;YACD,GAAG,cAAc,CAAC,OAAO;SACzB,CAAC,CAAC;QACH,YAAY,kCAA8C,CAAC;IAC5D,CAAC;IAED,OAAO;QACN,SAAS;QACT,YAAY;QACZ,OAAO,EAAE,gBAAgB;KACzB,CAAC;AACH,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { ComponentFactory, type IComponent } from \"@twin.org/core\";\nimport type { IEngineCore, IEngineCoreContext } from \"@twin.org/engine-models\";\nimport { nameofKebabCase } from \"@twin.org/nameof\";\nimport type { IPolicyDecisionPointComponent } from \"@twin.org/rights-management-models\";\nimport { PolicyDecisionPointService } from \"@twin.org/rights-management-pdp-service\";\nimport type { RightsManagementPdpComponentConfig } from \"../models/config/rightsManagementPdpComponentConfig.js\";\nimport type { IEngineConfig } from \"../models/IEngineConfig.js\";\nimport { RightsManagementPdpComponentType } from \"../models/types/rightsManagementPdpComponentType.js\";\n\n/**\n * Initialise the rights management PDP component.\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 async function initialiseRightsManagementPdpComponent(\n\tengineCore: IEngineCore<IEngineConfig>,\n\tcontext: IEngineCoreContext<IEngineConfig>,\n\tinstanceConfig: RightsManagementPdpComponentConfig\n): Promise<{\n\tinstanceType?: string;\n\tfactory?: typeof ComponentFactory;\n\tcomponent?: IComponent;\n}> {\n\tlet component: IPolicyDecisionPointComponent | undefined;\n\tlet instanceType: string | undefined;\n\n\tif (instanceConfig.type === RightsManagementPdpComponentType.Service) {\n\t\tcomponent = new PolicyDecisionPointService({\n\t\t\tloggingComponentType: engineCore.getRegisteredInstanceType(\"loggingComponent\"),\n\t\t\tpolicyInformationPointComponentType: engineCore.getRegisteredInstanceType(\n\t\t\t\t\"rightsManagementPipComponent\"\n\t\t\t),\n\t\t\tpolicyManagementPointComponentType: engineCore.getRegisteredInstanceType(\n\t\t\t\t\"rightsManagementPmpComponent\"\n\t\t\t),\n\t\t\tpolicyExecutionPointComponentType: engineCore.getRegisteredInstanceType(\n\t\t\t\t\"rightsManagementPxpComponent\"\n\t\t\t),\n\t\t\t...instanceConfig.options\n\t\t});\n\t\tinstanceType = nameofKebabCase(PolicyDecisionPointService);\n\t}\n\n\treturn {\n\t\tcomponent,\n\t\tinstanceType,\n\t\tfactory: ComponentFactory\n\t};\n}\n"]}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
// Copyright 2024 IOTA Stiftung.
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0.
|
|
3
|
-
import { ComponentFactory
|
|
4
|
-
import { EngineModuleHelper } from "@twin.org/engine-core";
|
|
3
|
+
import { ComponentFactory } from "@twin.org/core";
|
|
5
4
|
import { PolicyEnforcementPointService } from "@twin.org/rights-management-pep-service";
|
|
6
5
|
import { RightsManagementPepComponentType } from "../models/types/rightsManagementPepComponentType.js";
|
|
7
6
|
/**
|
|
@@ -15,23 +14,10 @@ export async function initialiseRightsManagementPepComponent(engineCore, context
|
|
|
15
14
|
let component;
|
|
16
15
|
let instanceType;
|
|
17
16
|
if (instanceConfig.type === RightsManagementPepComponentType.Service) {
|
|
18
|
-
const processorModules = [];
|
|
19
|
-
if (Is.arrayValue(instanceConfig.options?.processorModulesConfig)) {
|
|
20
|
-
for (const moduleConfig of instanceConfig.options.processorModulesConfig) {
|
|
21
|
-
processorModules.push({
|
|
22
|
-
processorId: moduleConfig.id,
|
|
23
|
-
processor: await EngineModuleHelper.loadComponent(engineCore, moduleConfig)
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
17
|
component = new PolicyEnforcementPointService({
|
|
28
18
|
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
29
19
|
policyDecisionPointComponentType: engineCore.getRegisteredInstanceType("rightsManagementPdpComponent"),
|
|
30
|
-
...instanceConfig.options
|
|
31
|
-
config: {
|
|
32
|
-
...instanceConfig.options?.config,
|
|
33
|
-
processors: instanceConfig.options?.config?.processors ?? processorModules
|
|
34
|
-
}
|
|
20
|
+
...instanceConfig.options
|
|
35
21
|
});
|
|
36
22
|
instanceType = "policy-enforcement-point-service";
|
|
37
23
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rightsManagementPep.js","sourceRoot":"","sources":["../../../src/components/rightsManagementPep.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,gBAAgB,
|
|
1
|
+
{"version":3,"file":"rightsManagementPep.js","sourceRoot":"","sources":["../../../src/components/rightsManagementPep.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,gBAAgB,EAAmB,MAAM,gBAAgB,CAAC;AAInE,OAAO,EAAE,6BAA6B,EAAE,MAAM,yCAAyC,CAAC;AAGxF,OAAO,EAAE,gCAAgC,EAAE,MAAM,qDAAqD,CAAC;AAEvG;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,sCAAsC,CAC3D,UAAsC,EACtC,OAA0C,EAC1C,cAAkD;IAMlD,IAAI,SAAuD,CAAC;IAC5D,IAAI,YAAgC,CAAC;IAErC,IAAI,cAAc,CAAC,IAAI,KAAK,gCAAgC,CAAC,OAAO,EAAE,CAAC;QACtE,SAAS,GAAG,IAAI,6BAA6B,CAAC;YAC7C,oBAAoB,EAAE,UAAU,CAAC,yBAAyB,CAAC,kBAAkB,CAAC;YAC9E,gCAAgC,EAAE,UAAU,CAAC,yBAAyB,CACrE,8BAA8B,CAC9B;YACD,GAAG,cAAc,CAAC,OAAO;SACzB,CAAC,CAAC;QACH,YAAY,qCAAiD,CAAC;IAC/D,CAAC;IAED,OAAO;QACN,SAAS;QACT,YAAY;QACZ,OAAO,EAAE,gBAAgB;KACzB,CAAC;AACH,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { ComponentFactory, type IComponent } from \"@twin.org/core\";\nimport type { IEngineCore, IEngineCoreContext } from \"@twin.org/engine-models\";\nimport { nameofKebabCase } from \"@twin.org/nameof\";\nimport type { IPolicyEnforcementPointComponent } from \"@twin.org/rights-management-models\";\nimport { PolicyEnforcementPointService } from \"@twin.org/rights-management-pep-service\";\nimport type { RightsManagementPepComponentConfig } from \"../models/config/rightsManagementPepComponentConfig.js\";\nimport type { IEngineConfig } from \"../models/IEngineConfig.js\";\nimport { RightsManagementPepComponentType } from \"../models/types/rightsManagementPepComponentType.js\";\n\n/**\n * Initialise the rights management PEP component.\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 async function initialiseRightsManagementPepComponent(\n\tengineCore: IEngineCore<IEngineConfig>,\n\tcontext: IEngineCoreContext<IEngineConfig>,\n\tinstanceConfig: RightsManagementPepComponentConfig\n): Promise<{\n\tinstanceType?: string;\n\tfactory?: typeof ComponentFactory;\n\tcomponent?: IComponent;\n}> {\n\tlet component: IPolicyEnforcementPointComponent | undefined;\n\tlet instanceType: string | undefined;\n\n\tif (instanceConfig.type === RightsManagementPepComponentType.Service) {\n\t\tcomponent = new PolicyEnforcementPointService({\n\t\t\tloggingComponentType: engineCore.getRegisteredInstanceType(\"loggingComponent\"),\n\t\t\tpolicyDecisionPointComponentType: engineCore.getRegisteredInstanceType(\n\t\t\t\t\"rightsManagementPdpComponent\"\n\t\t\t),\n\t\t\t...instanceConfig.options\n\t\t});\n\t\tinstanceType = nameofKebabCase(PolicyEnforcementPointService);\n\t}\n\n\treturn {\n\t\tcomponent,\n\t\tinstanceType,\n\t\tfactory: ComponentFactory\n\t};\n}\n"]}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
// Copyright 2024 IOTA Stiftung.
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0.
|
|
3
|
-
import { ComponentFactory
|
|
4
|
-
import { EngineModuleHelper } from "@twin.org/engine-core";
|
|
3
|
+
import { ComponentFactory } from "@twin.org/core";
|
|
5
4
|
import { PolicyInformationPointService } from "@twin.org/rights-management-pip-service";
|
|
6
5
|
import { RightsManagementPipComponentType } from "../models/types/rightsManagementPipComponentType.js";
|
|
7
6
|
/**
|
|
@@ -15,22 +14,9 @@ export async function initialiseRightsManagementPipComponent(engineCore, context
|
|
|
15
14
|
let component;
|
|
16
15
|
let instanceType;
|
|
17
16
|
if (instanceConfig.type === RightsManagementPipComponentType.Service) {
|
|
18
|
-
const informationSourceModules = [];
|
|
19
|
-
if (Is.arrayValue(instanceConfig.options?.informationModulesConfig)) {
|
|
20
|
-
for (const moduleConfig of instanceConfig.options.informationModulesConfig) {
|
|
21
|
-
informationSourceModules.push({
|
|
22
|
-
sourceId: moduleConfig.id,
|
|
23
|
-
source: await EngineModuleHelper.loadComponent(engineCore, moduleConfig)
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
17
|
component = new PolicyInformationPointService({
|
|
28
18
|
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
29
|
-
...instanceConfig.options
|
|
30
|
-
config: {
|
|
31
|
-
...instanceConfig.options?.config,
|
|
32
|
-
sources: instanceConfig.options?.config?.sources ?? informationSourceModules
|
|
33
|
-
}
|
|
19
|
+
...instanceConfig.options
|
|
34
20
|
});
|
|
35
21
|
instanceType = "policy-information-point-service";
|
|
36
22
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rightsManagementPip.js","sourceRoot":"","sources":["../../../src/components/rightsManagementPip.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,gBAAgB,
|
|
1
|
+
{"version":3,"file":"rightsManagementPip.js","sourceRoot":"","sources":["../../../src/components/rightsManagementPip.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,gBAAgB,EAAmB,MAAM,gBAAgB,CAAC;AAInE,OAAO,EAAE,6BAA6B,EAAE,MAAM,yCAAyC,CAAC;AAGxF,OAAO,EAAE,gCAAgC,EAAE,MAAM,qDAAqD,CAAC;AAEvG;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,sCAAsC,CAC3D,UAAsC,EACtC,OAA0C,EAC1C,cAAkD;IAMlD,IAAI,SAAuD,CAAC;IAC5D,IAAI,YAAgC,CAAC;IAErC,IAAI,cAAc,CAAC,IAAI,KAAK,gCAAgC,CAAC,OAAO,EAAE,CAAC;QACtE,SAAS,GAAG,IAAI,6BAA6B,CAAC;YAC7C,oBAAoB,EAAE,UAAU,CAAC,yBAAyB,CAAC,kBAAkB,CAAC;YAC9E,GAAG,cAAc,CAAC,OAAO;SACzB,CAAC,CAAC;QACH,YAAY,qCAAiD,CAAC;IAC/D,CAAC;IAED,OAAO;QACN,SAAS;QACT,YAAY;QACZ,OAAO,EAAE,gBAAgB;KACzB,CAAC;AACH,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { ComponentFactory, type IComponent } from \"@twin.org/core\";\nimport type { IEngineCore, IEngineCoreContext } from \"@twin.org/engine-models\";\nimport { nameofKebabCase } from \"@twin.org/nameof\";\nimport type { IPolicyInformationPointComponent } from \"@twin.org/rights-management-models\";\nimport { PolicyInformationPointService } from \"@twin.org/rights-management-pip-service\";\nimport type { RightsManagementPipComponentConfig } from \"../models/config/rightsManagementPipComponentConfig.js\";\nimport type { IEngineConfig } from \"../models/IEngineConfig.js\";\nimport { RightsManagementPipComponentType } from \"../models/types/rightsManagementPipComponentType.js\";\n\n/**\n * Initialise the rights management PIP component.\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 async function initialiseRightsManagementPipComponent(\n\tengineCore: IEngineCore<IEngineConfig>,\n\tcontext: IEngineCoreContext<IEngineConfig>,\n\tinstanceConfig: RightsManagementPipComponentConfig\n): Promise<{\n\tinstanceType?: string;\n\tfactory?: typeof ComponentFactory;\n\tcomponent?: IComponent;\n}> {\n\tlet component: IPolicyInformationPointComponent | undefined;\n\tlet instanceType: string | undefined;\n\n\tif (instanceConfig.type === RightsManagementPipComponentType.Service) {\n\t\tcomponent = new PolicyInformationPointService({\n\t\t\tloggingComponentType: engineCore.getRegisteredInstanceType(\"loggingComponent\"),\n\t\t\t...instanceConfig.options\n\t\t});\n\t\tinstanceType = nameofKebabCase(PolicyInformationPointService);\n\t}\n\n\treturn {\n\t\tcomponent,\n\t\tinstanceType,\n\t\tfactory: ComponentFactory\n\t};\n}\n"]}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
// Copyright 2024 IOTA Stiftung.
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0.
|
|
3
|
-
import { ComponentFactory
|
|
4
|
-
import { EngineModuleHelper } from "@twin.org/engine-core";
|
|
3
|
+
import { ComponentFactory } from "@twin.org/core";
|
|
5
4
|
import { PolicyNegotiationPointService } from "@twin.org/rights-management-pnp-service";
|
|
6
5
|
import { PolicyNegotiationPointRestClient } from "@twin.org/rights-management-rest-client";
|
|
7
6
|
import { RightsManagementPnpComponentType } from "../models/types/rightsManagementPnpComponentType.js";
|
|
@@ -16,34 +15,15 @@ export async function initialiseRightsManagementPnpComponent(engineCore, context
|
|
|
16
15
|
let component;
|
|
17
16
|
let instanceType;
|
|
18
17
|
if (instanceConfig.type === RightsManagementPnpComponentType.Service) {
|
|
19
|
-
const negotiatorModules = [];
|
|
20
|
-
if (Is.arrayValue(instanceConfig.options?.negotiatorModulesConfig)) {
|
|
21
|
-
for (const moduleConfig of instanceConfig.options.negotiatorModulesConfig) {
|
|
22
|
-
negotiatorModules.push({
|
|
23
|
-
negotiatorId: moduleConfig.id,
|
|
24
|
-
negotiator: await EngineModuleHelper.loadComponent(engineCore, moduleConfig)
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
const requesterModules = [];
|
|
29
|
-
if (Is.arrayValue(instanceConfig.options?.requesterModulesConfig)) {
|
|
30
|
-
for (const moduleConfig of instanceConfig.options.requesterModulesConfig) {
|
|
31
|
-
requesterModules.push({
|
|
32
|
-
requesterId: moduleConfig.id,
|
|
33
|
-
requester: await EngineModuleHelper.loadComponent(engineCore, moduleConfig)
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
18
|
component = new PolicyNegotiationPointService({
|
|
38
19
|
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
39
20
|
policyNegotiationAdministrationPointComponentType: engineCore.getRegisteredInstanceType("rightsManagementPnapComponent"),
|
|
40
21
|
policyAdministrationPointComponentType: engineCore.getRegisteredInstanceType("rightsManagementPapComponent"),
|
|
41
22
|
policyInformationPointComponentType: engineCore.getRegisteredInstanceType("rightsManagementPipComponent"),
|
|
23
|
+
trustComponentType: engineCore.getRegisteredInstanceType("trustComponent"),
|
|
42
24
|
...instanceConfig.options,
|
|
43
25
|
config: {
|
|
44
|
-
...instanceConfig.options?.config
|
|
45
|
-
negotiators: instanceConfig.options?.config?.negotiators ?? negotiatorModules,
|
|
46
|
-
requesters: instanceConfig.options?.config?.requesters ?? requesterModules
|
|
26
|
+
...instanceConfig.options?.config
|
|
47
27
|
}
|
|
48
28
|
});
|
|
49
29
|
instanceType = "policy-negotiation-point-service";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rightsManagementPnp.js","sourceRoot":"","sources":["../../../src/components/rightsManagementPnp.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,gBAAgB,
|
|
1
|
+
{"version":3,"file":"rightsManagementPnp.js","sourceRoot":"","sources":["../../../src/components/rightsManagementPnp.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,gBAAgB,EAAmB,MAAM,gBAAgB,CAAC;AAInE,OAAO,EAAE,6BAA6B,EAAE,MAAM,yCAAyC,CAAC;AACxF,OAAO,EAAE,gCAAgC,EAAE,MAAM,yCAAyC,CAAC;AAG3F,OAAO,EAAE,gCAAgC,EAAE,MAAM,qDAAqD,CAAC;AAEvG;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,sCAAsC,CAC3D,UAAsC,EACtC,OAA0C,EAC1C,cAAkD;IAMlD,IAAI,SAAuD,CAAC;IAC5D,IAAI,YAAgC,CAAC;IAErC,IAAI,cAAc,CAAC,IAAI,KAAK,gCAAgC,CAAC,OAAO,EAAE,CAAC;QACtE,SAAS,GAAG,IAAI,6BAA6B,CAAC;YAC7C,oBAAoB,EAAE,UAAU,CAAC,yBAAyB,CAAC,kBAAkB,CAAC;YAC9E,iDAAiD,EAAE,UAAU,CAAC,yBAAyB,CACtF,+BAA+B,CAC/B;YACD,sCAAsC,EAAE,UAAU,CAAC,yBAAyB,CAC3E,8BAA8B,CAC9B;YACD,mCAAmC,EAAE,UAAU,CAAC,yBAAyB,CACxE,8BAA8B,CAC9B;YACD,kBAAkB,EAAE,UAAU,CAAC,yBAAyB,CAAC,gBAAgB,CAAC;YAC1E,GAAG,cAAc,CAAC,OAAO;YACzB,MAAM,EAAE;gBACP,GAAG,cAAc,CAAC,OAAO,EAAE,MAAM;aACjC;SACD,CAAC,CAAC;QACH,YAAY,qCAAiD,CAAC;IAC/D,CAAC;SAAM,IAAI,cAAc,CAAC,IAAI,KAAK,gCAAgC,CAAC,UAAU,EAAE,CAAC;QAChF,SAAS,GAAG,IAAI,gCAAgC,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;QACzE,YAAY,yCAAoD,CAAC;IAClE,CAAC;IAED,OAAO;QACN,SAAS;QACT,YAAY;QACZ,OAAO,EAAE,gBAAgB;KACzB,CAAC;AACH,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { ComponentFactory, type IComponent } from \"@twin.org/core\";\nimport type { IEngineCore, IEngineCoreContext } from \"@twin.org/engine-models\";\nimport { nameofKebabCase } from \"@twin.org/nameof\";\nimport type { IPolicyNegotiationPointComponent } from \"@twin.org/rights-management-models\";\nimport { PolicyNegotiationPointService } from \"@twin.org/rights-management-pnp-service\";\nimport { PolicyNegotiationPointRestClient } from \"@twin.org/rights-management-rest-client\";\nimport type { RightsManagementPnpComponentConfig } from \"../models/config/rightsManagementPnpComponentConfig.js\";\nimport type { IEngineConfig } from \"../models/IEngineConfig.js\";\nimport { RightsManagementPnpComponentType } from \"../models/types/rightsManagementPnpComponentType.js\";\n\n/**\n * Initialise the rights management PNP component.\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 async function initialiseRightsManagementPnpComponent(\n\tengineCore: IEngineCore<IEngineConfig>,\n\tcontext: IEngineCoreContext<IEngineConfig>,\n\tinstanceConfig: RightsManagementPnpComponentConfig\n): Promise<{\n\tinstanceType?: string;\n\tfactory?: typeof ComponentFactory;\n\tcomponent?: IComponent;\n}> {\n\tlet component: IPolicyNegotiationPointComponent | undefined;\n\tlet instanceType: string | undefined;\n\n\tif (instanceConfig.type === RightsManagementPnpComponentType.Service) {\n\t\tcomponent = new PolicyNegotiationPointService({\n\t\t\tloggingComponentType: engineCore.getRegisteredInstanceType(\"loggingComponent\"),\n\t\t\tpolicyNegotiationAdministrationPointComponentType: engineCore.getRegisteredInstanceType(\n\t\t\t\t\"rightsManagementPnapComponent\"\n\t\t\t),\n\t\t\tpolicyAdministrationPointComponentType: engineCore.getRegisteredInstanceType(\n\t\t\t\t\"rightsManagementPapComponent\"\n\t\t\t),\n\t\t\tpolicyInformationPointComponentType: engineCore.getRegisteredInstanceType(\n\t\t\t\t\"rightsManagementPipComponent\"\n\t\t\t),\n\t\t\ttrustComponentType: engineCore.getRegisteredInstanceType(\"trustComponent\"),\n\t\t\t...instanceConfig.options,\n\t\t\tconfig: {\n\t\t\t\t...instanceConfig.options?.config\n\t\t\t}\n\t\t});\n\t\tinstanceType = nameofKebabCase(PolicyNegotiationPointService);\n\t} else if (instanceConfig.type === RightsManagementPnpComponentType.RestClient) {\n\t\tcomponent = new PolicyNegotiationPointRestClient(instanceConfig.options);\n\t\tinstanceType = nameofKebabCase(PolicyNegotiationPointRestClient);\n\t}\n\n\treturn {\n\t\tcomponent,\n\t\tinstanceType,\n\t\tfactory: ComponentFactory\n\t};\n}\n"]}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { PolicyArbiterFactory } from "@twin.org/rights-management-models";
|
|
2
|
+
import { ExamplePolicyArbiter } from "@twin.org/rights-management-plugins";
|
|
3
|
+
import { RightsManagementPolicyArbiterComponentType } from "../models/types/rightsManagementPolicyArbiterComponentType.js";
|
|
4
|
+
/**
|
|
5
|
+
* Initialise the rights management policy arbiter component.
|
|
6
|
+
* @param engineCore The engine core.
|
|
7
|
+
* @param context The context for the engine.
|
|
8
|
+
* @param instanceConfig The instance config.
|
|
9
|
+
* @returns The instance created and the factory for it.
|
|
10
|
+
*/
|
|
11
|
+
export async function initialiseRightsManagementPolicyArbiterComponent(engineCore, context, instanceConfig) {
|
|
12
|
+
let component;
|
|
13
|
+
let instanceType;
|
|
14
|
+
if (instanceConfig.type === RightsManagementPolicyArbiterComponentType.Example) {
|
|
15
|
+
component = new ExamplePolicyArbiter({
|
|
16
|
+
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
17
|
+
...instanceConfig.options
|
|
18
|
+
});
|
|
19
|
+
instanceType = "example-policy-arbiter";
|
|
20
|
+
}
|
|
21
|
+
return {
|
|
22
|
+
component,
|
|
23
|
+
instanceType,
|
|
24
|
+
factory: PolicyArbiterFactory
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=rightsManagementPolicyArbiter.js.map
|