@twin.org/engine-types 0.0.3-next.6 → 0.0.3-next.8
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/dataSpaceConnector.js +0 -1
- package/dist/es/components/dataSpaceConnector.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 +30 -0
- package/dist/es/index.js.map +1 -1
- package/dist/es/models/IEngineConfig.js.map +1 -1
- 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/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/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 +30 -0
- package/dist/types/models/IEngineConfig.d.ts +50 -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/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/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 +40 -0
- package/docs/reference/interfaces/IEngineConfig.md +60 -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/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 +8 -3
|
@@ -26,7 +26,6 @@ export async function initialiseDataSpaceConnectorComponent(engineCore, context,
|
|
|
26
26
|
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
27
27
|
backgroundTaskComponentType: engineCore.getRegisteredInstanceType("backgroundTaskComponent"),
|
|
28
28
|
taskSchedulerComponentType: engineCore.getRegisteredInstanceType("taskSchedulerComponent"),
|
|
29
|
-
federatedCatalogueComponentType: engineCore.getRegisteredInstanceType("federatedCatalogueComponent"),
|
|
30
29
|
partitionContextIds,
|
|
31
30
|
...instanceConfig.options
|
|
32
31
|
});
|
|
@@ -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
|
|
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,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\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,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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rightsManagementPolicyArbiter.js","sourceRoot":"","sources":["../../../src/components/rightsManagementPolicyArbiter.ts"],"names":[],"mappings":"AAKA,OAAO,EAAuB,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAC/F,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAG3E,OAAO,EAAE,0CAA0C,EAAE,MAAM,+DAA+D,CAAC;AAE3H;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,gDAAgD,CACrE,UAAsC,EACtC,OAA0C,EAC1C,cAA4D;IAM5D,IAAI,SAAqC,CAAC;IAC1C,IAAI,YAAgC,CAAC;IAErC,IAAI,cAAc,CAAC,IAAI,KAAK,0CAA0C,CAAC,OAAO,EAAE,CAAC;QAChF,SAAS,GAAG,IAAI,oBAAoB,CAAC;YACpC,oBAAoB,EAAE,UAAU,CAAC,yBAAyB,CAAC,kBAAkB,CAAC;YAC9E,GAAG,cAAc,CAAC,OAAO;SACzB,CAAC,CAAC;QACH,YAAY,2BAAwC,CAAC;IACtD,CAAC;IAED,OAAO;QACN,SAAS;QACT,YAAY;QACZ,OAAO,EAAE,oBAAoB;KAC7B,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 { type IPolicyArbiter, PolicyArbiterFactory } from \"@twin.org/rights-management-models\";\nimport { ExamplePolicyArbiter } from \"@twin.org/rights-management-plugins\";\nimport type { RightsManagementPolicyArbiterComponentConfig } from \"../models/config/rightsManagementPolicyArbiterComponentConfig.js\";\nimport type { IEngineConfig } from \"../models/IEngineConfig.js\";\nimport { RightsManagementPolicyArbiterComponentType } from \"../models/types/rightsManagementPolicyArbiterComponentType.js\";\n\n/**\n * Initialise the rights management policy arbiter 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 initialiseRightsManagementPolicyArbiterComponent(\n\tengineCore: IEngineCore<IEngineConfig>,\n\tcontext: IEngineCoreContext<IEngineConfig>,\n\tinstanceConfig: RightsManagementPolicyArbiterComponentConfig\n): Promise<{\n\tinstanceType?: string;\n\tfactory?: typeof PolicyArbiterFactory;\n\tcomponent?: IComponent;\n}> {\n\tlet component: IPolicyArbiter | undefined;\n\tlet instanceType: string | undefined;\n\n\tif (instanceConfig.type === RightsManagementPolicyArbiterComponentType.Example) {\n\t\tcomponent = new ExamplePolicyArbiter({\n\t\t\tloggingComponentType: engineCore.getRegisteredInstanceType(\"loggingComponent\"),\n\t\t\t...instanceConfig.options\n\t\t});\n\t\tinstanceType = nameofKebabCase(ExamplePolicyArbiter);\n\t}\n\n\treturn {\n\t\tcomponent,\n\t\tinstanceType,\n\t\tfactory: PolicyArbiterFactory\n\t};\n}\n"]}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { PolicyEnforcementProcessorFactory } from "@twin.org/rights-management-models";
|
|
2
|
+
import { ExamplePolicyEnforcementProcessor } from "@twin.org/rights-management-plugins";
|
|
3
|
+
import { RightsManagementPolicyEnforcementProcessorComponentType } from "../models/types/rightsManagementPolicyEnforcementProcessorComponentType.js";
|
|
4
|
+
/**
|
|
5
|
+
* Initialise the rights management policy enforcement processor 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 initialiseRightsManagementPolicyEnforcementProcessorComponent(engineCore, context, instanceConfig) {
|
|
12
|
+
let component;
|
|
13
|
+
let instanceType;
|
|
14
|
+
if (instanceConfig.type === RightsManagementPolicyEnforcementProcessorComponentType.Example) {
|
|
15
|
+
component = new ExamplePolicyEnforcementProcessor({
|
|
16
|
+
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
17
|
+
...instanceConfig.options
|
|
18
|
+
});
|
|
19
|
+
instanceType = "example-policy-enforcement-processor";
|
|
20
|
+
}
|
|
21
|
+
return {
|
|
22
|
+
component,
|
|
23
|
+
instanceType,
|
|
24
|
+
factory: PolicyEnforcementProcessorFactory
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=rightsManagementPolicyEnforcementProcessor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rightsManagementPolicyEnforcementProcessor.js","sourceRoot":"","sources":["../../../src/components/rightsManagementPolicyEnforcementProcessor.ts"],"names":[],"mappings":"AAKA,OAAO,EAEN,iCAAiC,EACjC,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,iCAAiC,EAAE,MAAM,qCAAqC,CAAC;AAGxF,OAAO,EAAE,uDAAuD,EAAE,MAAM,4EAA4E,CAAC;AAErJ;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,6DAA6D,CAClF,UAAsC,EACtC,OAA0C,EAC1C,cAAyE;IAMzE,IAAI,SAAkD,CAAC;IACvD,IAAI,YAAgC,CAAC;IAErC,IAAI,cAAc,CAAC,IAAI,KAAK,uDAAuD,CAAC,OAAO,EAAE,CAAC;QAC7F,SAAS,GAAG,IAAI,iCAAiC,CAAC;YACjD,oBAAoB,EAAE,UAAU,CAAC,yBAAyB,CAAC,kBAAkB,CAAC;YAC9E,GAAG,cAAc,CAAC,OAAO;SACzB,CAAC,CAAC;QACH,YAAY,yCAAqD,CAAC;IACnE,CAAC;IAED,OAAO;QACN,SAAS;QACT,YAAY;QACZ,OAAO,EAAE,iCAAiC;KAC1C,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 IPolicyEnforcementProcessor,\n\tPolicyEnforcementProcessorFactory\n} from \"@twin.org/rights-management-models\";\nimport { ExamplePolicyEnforcementProcessor } from \"@twin.org/rights-management-plugins\";\nimport type { RightsManagementPolicyEnforcementProcessorComponentConfig } from \"../models/config/rightsManagementPolicyEnforcementProcessorComponentConfig.js\";\nimport type { IEngineConfig } from \"../models/IEngineConfig.js\";\nimport { RightsManagementPolicyEnforcementProcessorComponentType } from \"../models/types/rightsManagementPolicyEnforcementProcessorComponentType.js\";\n\n/**\n * Initialise the rights management policy enforcement processor 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 initialiseRightsManagementPolicyEnforcementProcessorComponent(\n\tengineCore: IEngineCore<IEngineConfig>,\n\tcontext: IEngineCoreContext<IEngineConfig>,\n\tinstanceConfig: RightsManagementPolicyEnforcementProcessorComponentConfig\n): Promise<{\n\tinstanceType?: string;\n\tfactory?: typeof PolicyEnforcementProcessorFactory;\n\tcomponent?: IComponent;\n}> {\n\tlet component: IPolicyEnforcementProcessor | undefined;\n\tlet instanceType: string | undefined;\n\n\tif (instanceConfig.type === RightsManagementPolicyEnforcementProcessorComponentType.Example) {\n\t\tcomponent = new ExamplePolicyEnforcementProcessor({\n\t\t\tloggingComponentType: engineCore.getRegisteredInstanceType(\"loggingComponent\"),\n\t\t\t...instanceConfig.options\n\t\t});\n\t\tinstanceType = nameofKebabCase(ExamplePolicyEnforcementProcessor);\n\t}\n\n\treturn {\n\t\tcomponent,\n\t\tinstanceType,\n\t\tfactory: PolicyEnforcementProcessorFactory\n\t};\n}\n"]}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { PolicyExecutionActionFactory } from "@twin.org/rights-management-models";
|
|
2
|
+
import { LoggingPolicyExecutionAction } from "@twin.org/rights-management-plugins";
|
|
3
|
+
import { RightsManagementPolicyExecutionActionComponentType } from "../models/types/rightsManagementPolicyExecutionActionComponentType.js";
|
|
4
|
+
/**
|
|
5
|
+
* Initialise the rights management policy execution action 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 initialiseRightsManagementPolicyExecutionActionComponent(engineCore, context, instanceConfig) {
|
|
12
|
+
let component;
|
|
13
|
+
let instanceType;
|
|
14
|
+
if (instanceConfig.type === RightsManagementPolicyExecutionActionComponentType.Logging) {
|
|
15
|
+
component = new LoggingPolicyExecutionAction({
|
|
16
|
+
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
17
|
+
...instanceConfig.options
|
|
18
|
+
});
|
|
19
|
+
instanceType = "logging-policy-execution-action";
|
|
20
|
+
}
|
|
21
|
+
return {
|
|
22
|
+
component,
|
|
23
|
+
instanceType,
|
|
24
|
+
factory: PolicyExecutionActionFactory
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=rightsManagementPolicyExecutionAction.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rightsManagementPolicyExecutionAction.js","sourceRoot":"","sources":["../../../src/components/rightsManagementPolicyExecutionAction.ts"],"names":[],"mappings":"AAKA,OAAO,EAEN,4BAA4B,EAC5B,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,4BAA4B,EAAE,MAAM,qCAAqC,CAAC;AAGnF,OAAO,EAAE,kDAAkD,EAAE,MAAM,uEAAuE,CAAC;AAE3I;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,wDAAwD,CAC7E,UAAsC,EACtC,OAA0C,EAC1C,cAAoE;IAMpE,IAAI,SAA6C,CAAC;IAClD,IAAI,YAAgC,CAAC;IAErC,IAAI,cAAc,CAAC,IAAI,KAAK,kDAAkD,CAAC,OAAO,EAAE,CAAC;QACxF,SAAS,GAAG,IAAI,4BAA4B,CAAC;YAC5C,oBAAoB,EAAE,UAAU,CAAC,yBAAyB,CAAC,kBAAkB,CAAC;YAC9E,GAAG,cAAc,CAAC,OAAO;SACzB,CAAC,CAAC;QACH,YAAY,oCAAgD,CAAC;IAC9D,CAAC;IAED,OAAO;QACN,SAAS;QACT,YAAY;QACZ,OAAO,EAAE,4BAA4B;KACrC,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 IPolicyExecutionAction,\n\tPolicyExecutionActionFactory\n} from \"@twin.org/rights-management-models\";\nimport { LoggingPolicyExecutionAction } from \"@twin.org/rights-management-plugins\";\nimport type { RightsManagementPolicyExecutionActionComponentConfig } from \"../models/config/rightsManagementPolicyExecutionActionComponentConfig.js\";\nimport type { IEngineConfig } from \"../models/IEngineConfig.js\";\nimport { RightsManagementPolicyExecutionActionComponentType } from \"../models/types/rightsManagementPolicyExecutionActionComponentType.js\";\n\n/**\n * Initialise the rights management policy execution action 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 initialiseRightsManagementPolicyExecutionActionComponent(\n\tengineCore: IEngineCore<IEngineConfig>,\n\tcontext: IEngineCoreContext<IEngineConfig>,\n\tinstanceConfig: RightsManagementPolicyExecutionActionComponentConfig\n): Promise<{\n\tinstanceType?: string;\n\tfactory?: typeof PolicyExecutionActionFactory;\n\tcomponent?: IComponent;\n}> {\n\tlet component: IPolicyExecutionAction | undefined;\n\tlet instanceType: string | undefined;\n\n\tif (instanceConfig.type === RightsManagementPolicyExecutionActionComponentType.Logging) {\n\t\tcomponent = new LoggingPolicyExecutionAction({\n\t\t\tloggingComponentType: engineCore.getRegisteredInstanceType(\"loggingComponent\"),\n\t\t\t...instanceConfig.options\n\t\t});\n\t\tinstanceType = nameofKebabCase(LoggingPolicyExecutionAction);\n\t}\n\n\treturn {\n\t\tcomponent,\n\t\tinstanceType,\n\t\tfactory: PolicyExecutionActionFactory\n\t};\n}\n"]}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { PolicyInformationSourceFactory } from "@twin.org/rights-management-models";
|
|
2
|
+
import { IdentityPolicyInformationSource, StaticPolicyInformationSource } from "@twin.org/rights-management-plugins";
|
|
3
|
+
import { RightsManagementPolicyInformationSourceComponentType } from "../models/types/rightsManagementPolicyInformationSourceComponentType.js";
|
|
4
|
+
/**
|
|
5
|
+
* Initialise the rights management policy information source 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 initialiseRightsManagementPolicyInformationSourceComponent(engineCore, context, instanceConfig) {
|
|
12
|
+
let component;
|
|
13
|
+
let instanceType;
|
|
14
|
+
if (instanceConfig.type === RightsManagementPolicyInformationSourceComponentType.Identity) {
|
|
15
|
+
component = new IdentityPolicyInformationSource({
|
|
16
|
+
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
17
|
+
identityResolverComponentType: engineCore.getRegisteredInstanceType("identityResolverComponent"),
|
|
18
|
+
...instanceConfig.options
|
|
19
|
+
});
|
|
20
|
+
instanceType = "identity-policy-information-source";
|
|
21
|
+
}
|
|
22
|
+
else if (instanceConfig.type === RightsManagementPolicyInformationSourceComponentType.Static) {
|
|
23
|
+
component = new StaticPolicyInformationSource({
|
|
24
|
+
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
25
|
+
...instanceConfig.options
|
|
26
|
+
});
|
|
27
|
+
instanceType = "static-policy-information-source";
|
|
28
|
+
}
|
|
29
|
+
return {
|
|
30
|
+
component,
|
|
31
|
+
instanceType,
|
|
32
|
+
factory: PolicyInformationSourceFactory
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=rightsManagementPolicyInformationSource.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rightsManagementPolicyInformationSource.js","sourceRoot":"","sources":["../../../src/components/rightsManagementPolicyInformationSource.ts"],"names":[],"mappings":"AAKA,OAAO,EAEN,8BAA8B,EAC9B,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EACN,+BAA+B,EAC/B,6BAA6B,EAC7B,MAAM,qCAAqC,CAAC;AAG7C,OAAO,EAAE,oDAAoD,EAAE,MAAM,yEAAyE,CAAC;AAE/I;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,0DAA0D,CAC/E,UAAsC,EACtC,OAA0C,EAC1C,cAAsE;IAMtE,IAAI,SAA+C,CAAC;IACpD,IAAI,YAAgC,CAAC;IAErC,IAAI,cAAc,CAAC,IAAI,KAAK,oDAAoD,CAAC,QAAQ,EAAE,CAAC;QAC3F,SAAS,GAAG,IAAI,+BAA+B,CAAC;YAC/C,oBAAoB,EAAE,UAAU,CAAC,yBAAyB,CAAC,kBAAkB,CAAC;YAC9E,6BAA6B,EAAE,UAAU,CAAC,yBAAyB,CAClE,2BAA2B,CAC3B;YACD,GAAG,cAAc,CAAC,OAAO;SACzB,CAAC,CAAC;QACH,YAAY,uCAAmD,CAAC;IACjE,CAAC;SAAM,IAAI,cAAc,CAAC,IAAI,KAAK,oDAAoD,CAAC,MAAM,EAAE,CAAC;QAChG,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,8BAA8B;KACvC,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 IPolicyInformationSource,\n\tPolicyInformationSourceFactory\n} from \"@twin.org/rights-management-models\";\nimport {\n\tIdentityPolicyInformationSource,\n\tStaticPolicyInformationSource\n} from \"@twin.org/rights-management-plugins\";\nimport type { RightsManagementPolicyInformationSourceComponentConfig } from \"../models/config/rightsManagementPolicyInformationSourceComponentConfig.js\";\nimport type { IEngineConfig } from \"../models/IEngineConfig.js\";\nimport { RightsManagementPolicyInformationSourceComponentType } from \"../models/types/rightsManagementPolicyInformationSourceComponentType.js\";\n\n/**\n * Initialise the rights management policy information source 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 initialiseRightsManagementPolicyInformationSourceComponent(\n\tengineCore: IEngineCore<IEngineConfig>,\n\tcontext: IEngineCoreContext<IEngineConfig>,\n\tinstanceConfig: RightsManagementPolicyInformationSourceComponentConfig\n): Promise<{\n\tinstanceType?: string;\n\tfactory?: typeof PolicyInformationSourceFactory;\n\tcomponent?: IComponent;\n}> {\n\tlet component: IPolicyInformationSource | undefined;\n\tlet instanceType: string | undefined;\n\n\tif (instanceConfig.type === RightsManagementPolicyInformationSourceComponentType.Identity) {\n\t\tcomponent = new IdentityPolicyInformationSource({\n\t\t\tloggingComponentType: engineCore.getRegisteredInstanceType(\"loggingComponent\"),\n\t\t\tidentityResolverComponentType: engineCore.getRegisteredInstanceType(\n\t\t\t\t\"identityResolverComponent\"\n\t\t\t),\n\t\t\t...instanceConfig.options\n\t\t});\n\t\tinstanceType = nameofKebabCase(IdentityPolicyInformationSource);\n\t} else if (instanceConfig.type === RightsManagementPolicyInformationSourceComponentType.Static) {\n\t\tcomponent = new StaticPolicyInformationSource({\n\t\t\tloggingComponentType: engineCore.getRegisteredInstanceType(\"loggingComponent\"),\n\t\t\t...instanceConfig.options\n\t\t});\n\t\tinstanceType = nameofKebabCase(StaticPolicyInformationSource);\n\t}\n\n\treturn {\n\t\tcomponent,\n\t\tinstanceType,\n\t\tfactory: PolicyInformationSourceFactory\n\t};\n}\n"]}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { PolicyNegotiatorFactory } from "@twin.org/rights-management-models";
|
|
2
|
+
import { ExamplePolicyNegotiator } from "@twin.org/rights-management-plugins";
|
|
3
|
+
import { RightsManagementPolicyNegotiatorComponentType } from "../models/types/rightsManagementPolicyNegotiatorComponentType.js";
|
|
4
|
+
/**
|
|
5
|
+
* Initialise the rights management policy negotiator 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 initialiseRightsManagementPolicyNegotiatorComponent(engineCore, context, instanceConfig) {
|
|
12
|
+
let component;
|
|
13
|
+
let instanceType;
|
|
14
|
+
if (instanceConfig.type === RightsManagementPolicyNegotiatorComponentType.Example) {
|
|
15
|
+
component = new ExamplePolicyNegotiator({
|
|
16
|
+
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
17
|
+
...instanceConfig.options
|
|
18
|
+
});
|
|
19
|
+
instanceType = "example-policy-negotiator";
|
|
20
|
+
}
|
|
21
|
+
return {
|
|
22
|
+
component,
|
|
23
|
+
instanceType,
|
|
24
|
+
factory: PolicyNegotiatorFactory
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=rightsManagementPolicyNegotiator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rightsManagementPolicyNegotiator.js","sourceRoot":"","sources":["../../../src/components/rightsManagementPolicyNegotiator.ts"],"names":[],"mappings":"AAKA,OAAO,EAEN,uBAAuB,EACvB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAC;AAG9E,OAAO,EAAE,6CAA6C,EAAE,MAAM,kEAAkE,CAAC;AAEjI;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,mDAAmD,CACxE,UAAsC,EACtC,OAA0C,EAC1C,cAA+D;IAM/D,IAAI,SAAwC,CAAC;IAC7C,IAAI,YAAgC,CAAC;IAErC,IAAI,cAAc,CAAC,IAAI,KAAK,6CAA6C,CAAC,OAAO,EAAE,CAAC;QACnF,SAAS,GAAG,IAAI,uBAAuB,CAAC;YACvC,oBAAoB,EAAE,UAAU,CAAC,yBAAyB,CAAC,kBAAkB,CAAC;YAC9E,GAAG,cAAc,CAAC,OAAO;SACzB,CAAC,CAAC;QACH,YAAY,8BAA2C,CAAC;IACzD,CAAC;IAED,OAAO;QACN,SAAS;QACT,YAAY;QACZ,OAAO,EAAE,uBAAuB;KAChC,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 IPolicyNegotiator,\n\tPolicyNegotiatorFactory\n} from \"@twin.org/rights-management-models\";\nimport { ExamplePolicyNegotiator } from \"@twin.org/rights-management-plugins\";\nimport type { RightsManagementPolicyNegotiatorComponentConfig } from \"../models/config/rightsManagementPolicyNegotiatorComponentConfig.js\";\nimport type { IEngineConfig } from \"../models/IEngineConfig.js\";\nimport { RightsManagementPolicyNegotiatorComponentType } from \"../models/types/rightsManagementPolicyNegotiatorComponentType.js\";\n\n/**\n * Initialise the rights management policy negotiator 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 initialiseRightsManagementPolicyNegotiatorComponent(\n\tengineCore: IEngineCore<IEngineConfig>,\n\tcontext: IEngineCoreContext<IEngineConfig>,\n\tinstanceConfig: RightsManagementPolicyNegotiatorComponentConfig\n): Promise<{\n\tinstanceType?: string;\n\tfactory?: typeof PolicyNegotiatorFactory;\n\tcomponent?: IComponent;\n}> {\n\tlet component: IPolicyNegotiator | undefined;\n\tlet instanceType: string | undefined;\n\n\tif (instanceConfig.type === RightsManagementPolicyNegotiatorComponentType.Example) {\n\t\tcomponent = new ExamplePolicyNegotiator({\n\t\t\tloggingComponentType: engineCore.getRegisteredInstanceType(\"loggingComponent\"),\n\t\t\t...instanceConfig.options\n\t\t});\n\t\tinstanceType = nameofKebabCase(ExamplePolicyNegotiator);\n\t}\n\n\treturn {\n\t\tcomponent,\n\t\tinstanceType,\n\t\tfactory: PolicyNegotiatorFactory\n\t};\n}\n"]}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { PolicyRequesterFactory } from "@twin.org/rights-management-models";
|
|
2
|
+
import { ExamplePolicyRequester } from "@twin.org/rights-management-plugins";
|
|
3
|
+
import { RightsManagementPolicyRequesterComponentType } from "../models/types/rightsManagementPolicyRequesterComponentType.js";
|
|
4
|
+
/**
|
|
5
|
+
* Initialise the rights management policy requester 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 initialiseRightsManagementPolicyRequesterComponent(engineCore, context, instanceConfig) {
|
|
12
|
+
let component;
|
|
13
|
+
let instanceType;
|
|
14
|
+
if (instanceConfig.type === RightsManagementPolicyRequesterComponentType.Example) {
|
|
15
|
+
component = new ExamplePolicyRequester({
|
|
16
|
+
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
17
|
+
...instanceConfig.options
|
|
18
|
+
});
|
|
19
|
+
instanceType = "example-policy-requester";
|
|
20
|
+
}
|
|
21
|
+
return {
|
|
22
|
+
component,
|
|
23
|
+
instanceType,
|
|
24
|
+
factory: PolicyRequesterFactory
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=rightsManagementPolicyRequester.js.map
|