@twin.org/engine-types 0.0.3-next.2 → 0.0.3-next.21
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/attestation.js +20 -22
- package/dist/es/components/attestation.js.map +1 -1
- package/dist/es/components/auditableItemGraph.js +26 -22
- package/dist/es/components/auditableItemGraph.js.map +1 -1
- package/dist/es/components/auditableItemStream.js +26 -22
- package/dist/es/components/auditableItemStream.js.map +1 -1
- package/dist/es/components/backgroundTask.js +18 -18
- package/dist/es/components/backgroundTask.js.map +1 -1
- package/dist/es/components/blobStorage.js +69 -80
- package/dist/es/components/blobStorage.js.map +1 -1
- package/dist/es/components/contextIdHandler.js +31 -0
- package/dist/es/components/contextIdHandler.js.map +1 -0
- package/dist/es/components/dataProcessing.js +33 -32
- package/dist/es/components/dataProcessing.js.map +1 -1
- package/dist/es/components/dataSpaceConnector.js +26 -25
- package/dist/es/components/dataSpaceConnector.js.map +1 -1
- package/dist/es/components/documentManagement.js +12 -12
- package/dist/es/components/documentManagement.js.map +1 -1
- package/dist/es/components/entityStorage.js +20 -21
- package/dist/es/components/entityStorage.js.map +1 -1
- package/dist/es/components/eventBus.js +19 -27
- package/dist/es/components/eventBus.js.map +1 -1
- package/dist/es/components/faucet.js +18 -18
- package/dist/es/components/faucet.js.map +1 -1
- package/dist/es/components/federatedCatalogue.js +14 -18
- package/dist/es/components/federatedCatalogue.js.map +1 -1
- package/dist/es/components/federatedCatalogueFilter.js +34 -0
- package/dist/es/components/federatedCatalogueFilter.js.map +1 -0
- package/dist/es/components/identity.js +28 -31
- package/dist/es/components/identity.js.map +1 -1
- package/dist/es/components/identityProfile.js +26 -24
- package/dist/es/components/identityProfile.js.map +1 -1
- package/dist/es/components/identityResolver.js +36 -40
- package/dist/es/components/identityResolver.js.map +1 -1
- package/dist/es/components/immutableProof.js +23 -20
- package/dist/es/components/immutableProof.js.map +1 -1
- package/dist/es/components/logging.js +28 -28
- package/dist/es/components/logging.js.map +1 -1
- package/dist/es/components/messaging.js +77 -89
- package/dist/es/components/messaging.js.map +1 -1
- package/dist/es/components/nft.js +33 -33
- package/dist/es/components/nft.js.map +1 -1
- package/dist/es/components/rightsManagementPap.js +17 -17
- package/dist/es/components/rightsManagementPap.js.map +1 -1
- package/dist/es/components/rightsManagementPdp.js +11 -25
- package/dist/es/components/rightsManagementPdp.js.map +1 -1
- package/dist/es/components/rightsManagementPep.js +12 -24
- package/dist/es/components/rightsManagementPep.js.map +1 -1
- package/dist/es/components/rightsManagementPip.js +9 -25
- package/dist/es/components/rightsManagementPip.js.map +1 -1
- package/dist/es/components/rightsManagementPmp.js +10 -10
- package/dist/es/components/rightsManagementPmp.js.map +1 -1
- package/dist/es/components/rightsManagementPnap.js +20 -18
- package/dist/es/components/rightsManagementPnap.js.map +1 -1
- package/dist/es/components/rightsManagementPnp.js +14 -36
- package/dist/es/components/rightsManagementPnp.js.map +1 -1
- package/dist/es/components/rightsManagementPolicyArbiter.js +32 -0
- package/dist/es/components/rightsManagementPolicyArbiter.js.map +1 -0
- package/dist/es/components/rightsManagementPolicyEnforcementProcessor.js +33 -0
- package/dist/es/components/rightsManagementPolicyEnforcementProcessor.js.map +1 -0
- package/dist/es/components/rightsManagementPolicyExecutionAction.js +25 -0
- package/dist/es/components/rightsManagementPolicyExecutionAction.js.map +1 -0
- package/dist/es/components/rightsManagementPolicyInformationSource.js +34 -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/rightsManagementPolicyObligationEnforcer.js +27 -0
- package/dist/es/components/rightsManagementPolicyObligationEnforcer.js.map +1 -0
- package/dist/es/components/rightsManagementPolicyRequester.js +25 -0
- package/dist/es/components/rightsManagementPolicyRequester.js.map +1 -0
- package/dist/es/components/rightsManagementPxp.js +9 -25
- package/dist/es/components/rightsManagementPxp.js.map +1 -1
- package/dist/es/components/synchronisedStorage.js +25 -23
- package/dist/es/components/synchronisedStorage.js.map +1 -1
- package/dist/es/components/taskScheduler.js +10 -10
- package/dist/es/components/taskScheduler.js.map +1 -1
- package/dist/es/components/telemetry.js +29 -32
- package/dist/es/components/telemetry.js.map +1 -1
- package/dist/es/components/tenant.js +12 -11
- package/dist/es/components/tenant.js.map +1 -1
- package/dist/es/components/trust.js +27 -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/components/vault.js +15 -12
- package/dist/es/components/vault.js.map +1 -1
- package/dist/es/components/verifiableStorage.js +32 -34
- package/dist/es/components/verifiableStorage.js.map +1 -1
- package/dist/es/components/wallet.js +23 -24
- package/dist/es/components/wallet.js.map +1 -1
- package/dist/es/index.js +38 -11
- 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/blobStorageConnectorConfig.js.map +1 -1
- package/dist/es/models/config/contextIdHandlerComponentConfig.js +2 -0
- package/dist/es/models/config/contextIdHandlerComponentConfig.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/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/rightsManagementPolicyObligationEnforcerComponentConfig.js +2 -0
- package/dist/es/models/config/rightsManagementPolicyObligationEnforcerComponentConfig.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/{rightsManagementDarpComponentType.js → backgroundTaskComponentType.js} +3 -3
- package/dist/es/models/types/backgroundTaskComponentType.js.map +1 -0
- package/dist/es/models/types/contextIdHandlerComponentType.js +17 -0
- package/dist/es/models/types/contextIdHandlerComponentType.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/rightsManagementPolicyArbiterComponentType.js +17 -0
- package/dist/es/models/types/rightsManagementPolicyArbiterComponentType.js.map +1 -0
- package/dist/es/models/types/rightsManagementPolicyEnforcementProcessorComponentType.js +17 -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/rightsManagementPolicyObligationEnforcerComponentType.js +13 -0
- package/dist/es/models/types/rightsManagementPolicyObligationEnforcerComponentType.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/es/utils/engineTypeHelper.js +19 -1
- package/dist/es/utils/engineTypeHelper.js.map +1 -1
- package/dist/types/components/attestation.d.ts +5 -13
- package/dist/types/components/auditableItemGraph.d.ts +3 -7
- package/dist/types/components/auditableItemStream.d.ts +3 -7
- package/dist/types/components/backgroundTask.d.ts +5 -10
- package/dist/types/components/blobStorage.d.ts +4 -12
- package/dist/types/components/contextIdHandler.d.ts +12 -0
- package/dist/types/components/dataProcessing.d.ts +5 -17
- package/dist/types/components/dataSpaceConnector.d.ts +3 -7
- package/dist/types/components/documentManagement.d.ts +3 -7
- package/dist/types/components/entityStorage.d.ts +3 -7
- package/dist/types/components/eventBus.d.ts +4 -12
- package/dist/types/components/faucet.d.ts +2 -7
- package/dist/types/components/federatedCatalogue.d.ts +3 -7
- package/dist/types/components/federatedCatalogueFilter.d.ts +12 -0
- package/dist/types/components/identity.d.ts +4 -12
- package/dist/types/components/identityProfile.d.ts +4 -12
- package/dist/types/components/identityResolver.d.ts +4 -12
- package/dist/types/components/immutableProof.d.ts +3 -7
- package/dist/types/components/logging.d.ts +4 -12
- package/dist/types/components/messaging.d.ts +7 -27
- package/dist/types/components/nft.d.ts +4 -12
- package/dist/types/components/rightsManagementPap.d.ts +3 -7
- package/dist/types/components/rightsManagementPdp.d.ts +3 -7
- package/dist/types/components/rightsManagementPep.d.ts +3 -7
- package/dist/types/components/rightsManagementPip.d.ts +3 -7
- package/dist/types/components/rightsManagementPmp.d.ts +3 -7
- package/dist/types/components/rightsManagementPnap.d.ts +3 -7
- package/dist/types/components/rightsManagementPnp.d.ts +3 -7
- package/dist/types/components/rightsManagementPolicyArbiter.d.ts +12 -0
- package/dist/types/components/rightsManagementPolicyEnforcementProcessor.d.ts +12 -0
- package/dist/types/components/rightsManagementPolicyExecutionAction.d.ts +12 -0
- package/dist/types/components/rightsManagementPolicyInformationSource.d.ts +12 -0
- package/dist/types/components/rightsManagementPolicyNegotiator.d.ts +12 -0
- package/dist/types/components/rightsManagementPolicyObligationEnforcer.d.ts +12 -0
- package/dist/types/components/rightsManagementPolicyRequester.d.ts +12 -0
- package/dist/types/components/rightsManagementPxp.d.ts +3 -7
- package/dist/types/components/synchronisedStorage.d.ts +3 -7
- package/dist/types/components/taskScheduler.d.ts +3 -7
- package/dist/types/components/telemetry.d.ts +4 -12
- package/dist/types/components/tenant.d.ts +3 -7
- package/dist/types/components/trust.d.ts +12 -0
- package/dist/types/components/trustGenerator.d.ts +12 -0
- package/dist/types/components/trustVerifier.d.ts +12 -0
- package/dist/types/components/vault.d.ts +2 -7
- package/dist/types/components/verifiableStorage.d.ts +4 -12
- package/dist/types/components/wallet.d.ts +2 -7
- package/dist/types/index.d.ts +38 -11
- package/dist/types/models/IEngineConfig.d.ts +57 -12
- package/dist/types/models/config/backgroundTaskComponentConfig.d.ts +9 -0
- package/dist/types/models/config/blobStorageConnectorConfig.d.ts +4 -1
- package/dist/types/models/config/contextIdHandlerComponentConfig.d.ts +11 -0
- package/dist/types/models/config/federatedCatalogueFilterComponentConfig.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 +12 -0
- package/dist/types/models/config/rightsManagementPolicyEnforcementProcessorComponentConfig.d.ts +12 -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/rightsManagementPolicyObligationEnforcerComponentConfig.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/contextIdHandlerComponentType.d.ts +17 -0
- package/dist/types/models/types/federatedCatalogueFilterComponentType.d.ts +13 -0
- package/dist/types/models/types/rightsManagementPolicyArbiterComponentType.d.ts +17 -0
- package/dist/types/models/types/rightsManagementPolicyEnforcementProcessorComponentType.d.ts +17 -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/rightsManagementPolicyObligationEnforcerComponentType.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/dist/types/utils/engineTypeHelper.d.ts +11 -0
- package/docs/changelog.md +330 -0
- package/docs/reference/classes/EngineTypeHelper.md +53 -0
- package/docs/reference/functions/initialiseAttestationComponent.md +2 -2
- package/docs/reference/functions/initialiseAttestationConnector.md +3 -3
- package/docs/reference/functions/initialiseAuditableItemGraphComponent.md +2 -2
- package/docs/reference/functions/initialiseAuditableItemStreamComponent.md +2 -2
- package/docs/reference/functions/initialiseBackgroundTaskComponent.md +31 -0
- package/docs/reference/functions/initialiseBlobStorageComponent.md +2 -2
- package/docs/reference/functions/initialiseBlobStorageConnector.md +2 -2
- package/docs/reference/functions/initialiseContextIdHandlerComponent.md +31 -0
- package/docs/reference/functions/initialiseDataConverterConnector.md +2 -2
- package/docs/reference/functions/initialiseDataExtractorConnector.md +2 -2
- package/docs/reference/functions/initialiseDataProcessingComponent.md +2 -2
- package/docs/reference/functions/initialiseDataSpaceConnectorComponent.md +2 -2
- package/docs/reference/functions/initialiseDocumentManagementComponent.md +2 -2
- package/docs/reference/functions/initialiseEntityStorageComponent.md +2 -2
- package/docs/reference/functions/initialiseEventBusComponent.md +2 -2
- package/docs/reference/functions/initialiseEventBusConnector.md +2 -2
- package/docs/reference/functions/initialiseFaucetConnector.md +2 -2
- package/docs/reference/functions/initialiseFederatedCatalogueComponent.md +2 -2
- package/docs/reference/functions/initialiseFederatedCatalogueFilterComponent.md +31 -0
- package/docs/reference/functions/initialiseIdentityComponent.md +2 -2
- package/docs/reference/functions/initialiseIdentityConnector.md +2 -2
- package/docs/reference/functions/initialiseIdentityProfileComponent.md +2 -2
- package/docs/reference/functions/initialiseIdentityProfileConnector.md +2 -2
- package/docs/reference/functions/initialiseIdentityResolverComponent.md +2 -2
- package/docs/reference/functions/initialiseIdentityResolverConnector.md +2 -2
- package/docs/reference/functions/initialiseImmutableProofComponent.md +2 -2
- package/docs/reference/functions/initialiseLoggingComponent.md +2 -2
- package/docs/reference/functions/initialiseLoggingConnector.md +2 -2
- package/docs/reference/functions/initialiseMessagingAdminComponent.md +2 -2
- package/docs/reference/functions/initialiseMessagingComponent.md +2 -2
- package/docs/reference/functions/initialiseMessagingEmailConnector.md +2 -2
- package/docs/reference/functions/initialiseMessagingPushNotificationConnector.md +2 -2
- package/docs/reference/functions/initialiseMessagingSmsConnector.md +2 -2
- package/docs/reference/functions/initialiseNftComponent.md +2 -2
- package/docs/reference/functions/initialiseNftConnector.md +2 -2
- package/docs/reference/functions/initialiseRightsManagementPapComponent.md +2 -2
- package/docs/reference/functions/initialiseRightsManagementPdpComponent.md +2 -2
- package/docs/reference/functions/initialiseRightsManagementPepComponent.md +2 -2
- package/docs/reference/functions/initialiseRightsManagementPipComponent.md +2 -2
- package/docs/reference/functions/initialiseRightsManagementPmpComponent.md +2 -2
- package/docs/reference/functions/initialiseRightsManagementPnapComponent.md +2 -2
- package/docs/reference/functions/initialiseRightsManagementPnpComponent.md +2 -2
- 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/initialiseRightsManagementPolicyObligationEnforcerComponent.md +31 -0
- package/docs/reference/functions/initialiseRightsManagementPolicyRequesterComponent.md +31 -0
- package/docs/reference/functions/initialiseRightsManagementPxpComponent.md +2 -2
- package/docs/reference/functions/initialiseSynchronisedStorageComponent.md +2 -2
- package/docs/reference/functions/initialiseTaskSchedulerComponent.md +2 -2
- package/docs/reference/functions/initialiseTelemetryComponent.md +2 -2
- package/docs/reference/functions/initialiseTelemetryConnector.md +2 -2
- package/docs/reference/functions/initialiseTenantAdminComponent.md +2 -2
- 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/functions/initialiseVaultConnector.md +2 -2
- package/docs/reference/functions/initialiseVerifiableStorageComponent.md +2 -2
- package/docs/reference/functions/initialiseVerifiableStorageConnector.md +2 -2
- package/docs/reference/functions/initialiseWalletConnector.md +2 -2
- package/docs/reference/index.md +52 -16
- package/docs/reference/interfaces/IEngineConfig.md +66 -12
- package/docs/reference/type-aliases/BackgroundTaskComponentConfig.md +17 -0
- package/docs/reference/type-aliases/BackgroundTaskComponentType.md +5 -0
- package/docs/reference/type-aliases/BlobStorageConnectorConfig.md +1 -1
- package/docs/reference/type-aliases/ContextIdHandlerComponentConfig.md +5 -0
- package/docs/reference/type-aliases/ContextIdHandlerComponentType.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/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 +5 -0
- package/docs/reference/type-aliases/RightsManagementPolicyArbiterComponentType.md +5 -0
- package/docs/reference/type-aliases/RightsManagementPolicyEnforcementProcessorComponentConfig.md +5 -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/RightsManagementPolicyObligationEnforcerComponentConfig.md +17 -0
- package/docs/reference/type-aliases/RightsManagementPolicyObligationEnforcerComponentType.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/ContextIdHandlerComponentType.md +19 -0
- package/docs/reference/variables/FederatedCatalogueFilterComponentType.md +13 -0
- package/docs/reference/variables/RightsManagementPolicyArbiterComponentType.md +19 -0
- package/docs/reference/variables/RightsManagementPolicyEnforcementProcessorComponentType.md +19 -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/RightsManagementPolicyObligationEnforcerComponentType.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 -5
- package/dist/es/components/authenticationGenerator.js +0 -30
- package/dist/es/components/authenticationGenerator.js.map +0 -1
- package/dist/es/components/rightsManagementDap.js +0 -38
- package/dist/es/components/rightsManagementDap.js.map +0 -1
- package/dist/es/components/rightsManagementDarp.js +0 -29
- package/dist/es/components/rightsManagementDarp.js.map +0 -1
- package/dist/es/models/config/authenticationGeneratorComponentConfig.js +0 -2
- package/dist/es/models/config/authenticationGeneratorComponentConfig.js.map +0 -1
- package/dist/es/models/config/backgroundTaskConnectorConfig.js +0 -2
- package/dist/es/models/config/backgroundTaskConnectorConfig.js.map +0 -1
- package/dist/es/models/config/rightsManagementDapComponentConfig.js +0 -2
- package/dist/es/models/config/rightsManagementDapComponentConfig.js.map +0 -1
- package/dist/es/models/config/rightsManagementDarpComponentConfig.js +0 -2
- package/dist/es/models/config/rightsManagementDarpComponentConfig.js.map +0 -1
- package/dist/es/models/types/authenticationGeneratorComponentType.js +0 -13
- package/dist/es/models/types/authenticationGeneratorComponentType.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/es/models/types/rightsManagementDapComponentType.js +0 -17
- package/dist/es/models/types/rightsManagementDapComponentType.js.map +0 -1
- package/dist/es/models/types/rightsManagementDarpComponentType.js.map +0 -1
- package/dist/types/components/authenticationGenerator.d.ts +0 -17
- package/dist/types/components/rightsManagementDap.d.ts +0 -16
- package/dist/types/components/rightsManagementDarp.d.ts +0 -16
- package/dist/types/models/config/authenticationGeneratorComponentConfig.d.ts +0 -9
- package/dist/types/models/config/backgroundTaskConnectorConfig.d.ts +0 -9
- package/dist/types/models/config/rightsManagementDapComponentConfig.d.ts +0 -16
- package/dist/types/models/config/rightsManagementDarpComponentConfig.d.ts +0 -12
- package/dist/types/models/types/authenticationGeneratorComponentType.d.ts +0 -13
- package/dist/types/models/types/backgroundTaskConnectorType.d.ts +0 -13
- package/dist/types/models/types/rightsManagementDapComponentType.d.ts +0 -17
- package/dist/types/models/types/rightsManagementDarpComponentType.d.ts +0 -13
- package/docs/reference/functions/initialiseAuthenticationGeneratorComponent.md +0 -31
- package/docs/reference/functions/initialiseBackgroundTaskConnector.md +0 -31
- package/docs/reference/functions/initialiseRightsManagementDapComponent.md +0 -31
- package/docs/reference/functions/initialiseRightsManagementDarpComponent.md +0 -31
- package/docs/reference/type-aliases/AuthenticationGeneratorComponentConfig.md +0 -17
- package/docs/reference/type-aliases/AuthenticationGeneratorComponentType.md +0 -5
- package/docs/reference/type-aliases/BackgroundTaskConnectorConfig.md +0 -17
- package/docs/reference/type-aliases/BackgroundTaskConnectorType.md +0 -5
- package/docs/reference/type-aliases/RightsManagementDapComponentConfig.md +0 -5
- package/docs/reference/type-aliases/RightsManagementDapComponentType.md +0 -5
- package/docs/reference/type-aliases/RightsManagementDarpComponentConfig.md +0 -23
- package/docs/reference/type-aliases/RightsManagementDarpComponentType.md +0 -5
- package/docs/reference/variables/AuthenticationGeneratorComponentType.md +0 -13
- package/docs/reference/variables/BackgroundTaskConnectorType.md +0 -13
- package/docs/reference/variables/RightsManagementDapComponentType.md +0 -19
- package/docs/reference/variables/RightsManagementDarpComponentType.md +0 -13
|
@@ -6,6 +6,7 @@ import { PolicyNegotiationAdminPointService, initSchema as initSchemaRightsManag
|
|
|
6
6
|
import { PolicyNegotiationAdminPointRestClient } from "@twin.org/rights-management-rest-client";
|
|
7
7
|
import { initialiseEntityStorageConnector } from "./entityStorage.js";
|
|
8
8
|
import { RightsManagementPnapComponentType } from "../models/types/rightsManagementPnapComponentType.js";
|
|
9
|
+
import { EngineTypeHelper } from "../utils/engineTypeHelper.js";
|
|
9
10
|
/**
|
|
10
11
|
* Initialise the rights management PNAP component.
|
|
11
12
|
* @param engineCore The engine core.
|
|
@@ -13,29 +14,30 @@ import { RightsManagementPnapComponentType } from "../models/types/rightsManagem
|
|
|
13
14
|
* @param instanceConfig The instance config.
|
|
14
15
|
* @returns The instance created and the factory for it.
|
|
15
16
|
*/
|
|
16
|
-
export
|
|
17
|
-
let
|
|
18
|
-
let
|
|
17
|
+
export function initialiseRightsManagementPnapComponent(engineCore, context, instanceConfig) {
|
|
18
|
+
let createComponent;
|
|
19
|
+
let instanceTypeName;
|
|
19
20
|
if (instanceConfig.type === RightsManagementPnapComponentType.Service) {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
21
|
+
createComponent = (createConfig) => {
|
|
22
|
+
initSchemaRightsManagementPnap();
|
|
23
|
+
const partitionContextIds = ContextIdHelper.pickKeysFromAvailable(engineCore.getContextIdKeys(), [ContextIdKeys.Node, ContextIdKeys.Tenant]);
|
|
24
|
+
initialiseEntityStorageConnector(engineCore, context, createConfig.options?.policyNegotiationEntityStorageType, "PolicyNegotiation", partitionContextIds);
|
|
25
|
+
return new PolicyNegotiationAdminPointService(EngineTypeHelper.mergeConfig({
|
|
26
|
+
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
27
|
+
taskSchedulerComponentType: engineCore.getRegisteredInstanceType("taskSchedulerComponent"),
|
|
28
|
+
policyInformationPointComponentType: engineCore.getRegisteredInstanceType("rightsManagementPipComponent"),
|
|
29
|
+
partitionContextIds
|
|
30
|
+
}, createConfig.options));
|
|
31
|
+
};
|
|
32
|
+
instanceTypeName = "policy-negotiation-admin-point-service";
|
|
31
33
|
}
|
|
32
34
|
else if (instanceConfig.type === RightsManagementPnapComponentType.RestClient) {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
+
createComponent = (createConfig) => new PolicyNegotiationAdminPointRestClient(EngineTypeHelper.mergeConfig(createConfig.options));
|
|
36
|
+
instanceTypeName = "policy-negotiation-admin-point-rest-client";
|
|
35
37
|
}
|
|
36
38
|
return {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
+
createComponent: createComponent,
|
|
40
|
+
instanceTypeName,
|
|
39
41
|
factory: ComponentFactory
|
|
40
42
|
};
|
|
41
43
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rightsManagementPnap.js","sourceRoot":"","sources":["../../../src/components/rightsManagementPnap.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,gBAAgB,
|
|
1
|
+
{"version":3,"file":"rightsManagementPnap.js","sourceRoot":"","sources":["../../../src/components/rightsManagementPnap.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAQlD,OAAO,EAEN,kCAAkC,EAClC,UAAU,IAAI,8BAA8B,EAC5C,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAE,qCAAqC,EAAE,MAAM,yCAAyC,CAAC;AAChG,OAAO,EAAE,gCAAgC,EAAE,MAAM,oBAAoB,CAAC;AAGtE,OAAO,EAAE,iCAAiC,EAAE,MAAM,sDAAsD,CAAC;AACzG,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAEhE;;;;;;GAMG;AACH,MAAM,UAAU,uCAAuC,CACtD,UAAsC,EACtC,OAA0C,EAC1C,cAAmD;IAEnD,IAAI,eAAe,CAAC;IACpB,IAAI,gBAAgB,CAAC;IAErB,IAAI,cAAc,CAAC,IAAI,KAAK,iCAAiC,CAAC,OAAO,EAAE,CAAC;QACvE,eAAe,GAAG,CAAC,YAAmC,EAAE,EAAE;YACzD,8BAA8B,EAAE,CAAC;YAEjC,MAAM,mBAAmB,GAAG,eAAe,CAAC,qBAAqB,CAChE,UAAU,CAAC,gBAAgB,EAAE,EAC7B,CAAC,aAAa,CAAC,IAAI,EAAE,aAAa,CAAC,MAAM,CAAC,CAC1C,CAAC;YAEF,gCAAgC,CAC/B,UAAU,EACV,OAAO,EACP,YAAY,CAAC,OAAO,EAAE,kCAAkC,uBAExD,mBAAmB,CACnB,CAAC;YAEF,OAAO,IAAI,kCAAkC,CAC5C,gBAAgB,CAAC,WAAW,CAC3B;gBACC,oBAAoB,EAAE,UAAU,CAAC,yBAAyB,CAAC,kBAAkB,CAAC;gBAC9E,0BAA0B,EACzB,UAAU,CAAC,yBAAyB,CAAC,wBAAwB,CAAC;gBAC/D,mCAAmC,EAAE,UAAU,CAAC,yBAAyB,CACxE,8BAA8B,CAC9B;gBACD,mBAAmB;aACnB,EACD,YAAY,CAAC,OAAO,CACpB,CACD,CAAC;QACH,CAAC,CAAC;QACF,gBAAgB,2CAAsD,CAAC;IACxE,CAAC;SAAM,IAAI,cAAc,CAAC,IAAI,KAAK,iCAAiC,CAAC,UAAU,EAAE,CAAC;QACjF,eAAe,GAAG,CAAC,YAAmC,EAAE,EAAE,CACzD,IAAI,qCAAqC,CACxC,gBAAgB,CAAC,WAAW,CAAqC,YAAY,CAAC,OAAO,CAAC,CACtF,CAAC;QACH,gBAAgB,+CAAyD,CAAC;IAC3E,CAAC;IAED,OAAO;QACN,eAAe,EAAE,eAAsE;QACvF,gBAAgB;QAChB,OAAO,EAAE,gBAAgB;KACzB,CAAC;AACH,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { ContextIdHelper, ContextIdKeys } from \"@twin.org/context\";\nimport { ComponentFactory } from \"@twin.org/core\";\nimport type { IComponent } from \"@twin.org/core\";\nimport type {\n\tEngineTypeInitialiserReturn,\n\tIEngineCore,\n\tIEngineCoreContext\n} from \"@twin.org/engine-models\";\nimport { nameof, nameofKebabCase } from \"@twin.org/nameof\";\nimport {\n\ttype PolicyNegotiation,\n\tPolicyNegotiationAdminPointService,\n\tinitSchema as initSchemaRightsManagementPnap\n} from \"@twin.org/rights-management-pnp-service\";\nimport { PolicyNegotiationAdminPointRestClient } from \"@twin.org/rights-management-rest-client\";\nimport { initialiseEntityStorageConnector } from \"./entityStorage.js\";\nimport type { RightsManagementPnapComponentConfig } from \"../models/config/rightsManagementPnapComponentConfig.js\";\nimport type { IEngineConfig } from \"../models/IEngineConfig.js\";\nimport { RightsManagementPnapComponentType } from \"../models/types/rightsManagementPnapComponentType.js\";\nimport { EngineTypeHelper } from \"../utils/engineTypeHelper.js\";\n\n/**\n * Initialise the rights management PNAP 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 function initialiseRightsManagementPnapComponent(\n\tengineCore: IEngineCore<IEngineConfig>,\n\tcontext: IEngineCoreContext<IEngineConfig>,\n\tinstanceConfig: RightsManagementPnapComponentConfig\n): EngineTypeInitialiserReturn<typeof instanceConfig, typeof ComponentFactory> {\n\tlet createComponent;\n\tlet instanceTypeName;\n\n\tif (instanceConfig.type === RightsManagementPnapComponentType.Service) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) => {\n\t\t\tinitSchemaRightsManagementPnap();\n\n\t\t\tconst partitionContextIds = ContextIdHelper.pickKeysFromAvailable(\n\t\t\t\tengineCore.getContextIdKeys(),\n\t\t\t\t[ContextIdKeys.Node, ContextIdKeys.Tenant]\n\t\t\t);\n\n\t\t\tinitialiseEntityStorageConnector(\n\t\t\t\tengineCore,\n\t\t\t\tcontext,\n\t\t\t\tcreateConfig.options?.policyNegotiationEntityStorageType,\n\t\t\t\tnameof<PolicyNegotiation>(),\n\t\t\t\tpartitionContextIds\n\t\t\t);\n\n\t\t\treturn new PolicyNegotiationAdminPointService(\n\t\t\t\tEngineTypeHelper.mergeConfig<(typeof instanceConfig)[\"options\"]>(\n\t\t\t\t\t{\n\t\t\t\t\t\tloggingComponentType: engineCore.getRegisteredInstanceType(\"loggingComponent\"),\n\t\t\t\t\t\ttaskSchedulerComponentType:\n\t\t\t\t\t\t\tengineCore.getRegisteredInstanceType(\"taskSchedulerComponent\"),\n\t\t\t\t\t\tpolicyInformationPointComponentType: engineCore.getRegisteredInstanceType(\n\t\t\t\t\t\t\t\"rightsManagementPipComponent\"\n\t\t\t\t\t\t),\n\t\t\t\t\t\tpartitionContextIds\n\t\t\t\t\t},\n\t\t\t\t\tcreateConfig.options\n\t\t\t\t)\n\t\t\t);\n\t\t};\n\t\tinstanceTypeName = nameofKebabCase(PolicyNegotiationAdminPointService);\n\t} else if (instanceConfig.type === RightsManagementPnapComponentType.RestClient) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) =>\n\t\t\tnew PolicyNegotiationAdminPointRestClient(\n\t\t\t\tEngineTypeHelper.mergeConfig<(typeof instanceConfig)[\"options\"]>(createConfig.options)\n\t\t\t);\n\t\tinstanceTypeName = nameofKebabCase(PolicyNegotiationAdminPointRestClient);\n\t}\n\n\treturn {\n\t\tcreateComponent: createComponent as (createConfig: typeof instanceConfig) => IComponent,\n\t\tinstanceTypeName,\n\t\tfactory: ComponentFactory\n\t};\n}\n"]}
|
|
@@ -1,10 +1,10 @@
|
|
|
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";
|
|
7
|
+
import { EngineTypeHelper } from "../utils/engineTypeHelper.js";
|
|
8
8
|
/**
|
|
9
9
|
* Initialise the rights management PNP component.
|
|
10
10
|
* @param engineCore The engine core.
|
|
@@ -12,49 +12,27 @@ import { RightsManagementPnpComponentType } from "../models/types/rightsManageme
|
|
|
12
12
|
* @param instanceConfig The instance config.
|
|
13
13
|
* @returns The instance created and the factory for it.
|
|
14
14
|
*/
|
|
15
|
-
export
|
|
16
|
-
let
|
|
17
|
-
let
|
|
15
|
+
export function initialiseRightsManagementPnpComponent(engineCore, context, instanceConfig) {
|
|
16
|
+
let createComponent;
|
|
17
|
+
let instanceTypeName;
|
|
18
18
|
if (instanceConfig.type === RightsManagementPnpComponentType.Service) {
|
|
19
|
-
|
|
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
|
-
component = new PolicyNegotiationPointService({
|
|
19
|
+
createComponent = (createConfig) => new PolicyNegotiationPointService(EngineTypeHelper.mergeConfig({
|
|
38
20
|
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
39
21
|
policyNegotiationAdministrationPointComponentType: engineCore.getRegisteredInstanceType("rightsManagementPnapComponent"),
|
|
40
22
|
policyAdministrationPointComponentType: engineCore.getRegisteredInstanceType("rightsManagementPapComponent"),
|
|
41
23
|
policyInformationPointComponentType: engineCore.getRegisteredInstanceType("rightsManagementPipComponent"),
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
requesters: instanceConfig.options?.config?.requesters ?? requesterModules
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
instanceType = "policy-negotiation-point-service";
|
|
24
|
+
trustComponentType: engineCore.getRegisteredInstanceType("trustComponent"),
|
|
25
|
+
policyNegotiationPointRemoteComponentType: engineCore.getRegisteredInstanceType("rightsManagementPnpComponent", ["remote"])
|
|
26
|
+
}, createConfig.options));
|
|
27
|
+
instanceTypeName = "policy-negotiation-point-service";
|
|
50
28
|
}
|
|
51
29
|
else if (instanceConfig.type === RightsManagementPnpComponentType.RestClient) {
|
|
52
|
-
|
|
53
|
-
|
|
30
|
+
createComponent = (createConfig) => new PolicyNegotiationPointRestClient(EngineTypeHelper.mergeConfig(createConfig.options));
|
|
31
|
+
instanceTypeName = "policy-negotiation-point-rest-client";
|
|
54
32
|
}
|
|
55
33
|
return {
|
|
56
|
-
|
|
57
|
-
|
|
34
|
+
createComponent: createComponent,
|
|
35
|
+
instanceTypeName,
|
|
58
36
|
factory: ComponentFactory
|
|
59
37
|
};
|
|
60
38
|
}
|
|
@@ -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;AAOnE,OAAO,EAAE,6BAA6B,EAAE,MAAM,yCAAyC,CAAC;AACxF,OAAO,EAAE,gCAAgC,EAAE,MAAM,yCAAyC,CAAC;AAG3F,OAAO,EAAE,gCAAgC,EAAE,MAAM,qDAAqD,CAAC;AACvG,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAEhE;;;;;;GAMG;AACH,MAAM,UAAU,sCAAsC,CACrD,UAAsC,EACtC,OAA0C,EAC1C,cAAkD;IAElD,IAAI,eAAe,CAAC;IACpB,IAAI,gBAAgB,CAAC;IAErB,IAAI,cAAc,CAAC,IAAI,KAAK,gCAAgC,CAAC,OAAO,EAAE,CAAC;QACtE,eAAe,GAAG,CAAC,YAAmC,EAAE,EAAE,CACzD,IAAI,6BAA6B,CAChC,gBAAgB,CAAC,WAAW,CAC3B;YACC,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,yCAAyC,EAAE,UAAU,CAAC,yBAAyB,CAC9E,8BAA8B,EAC9B,CAAC,QAAQ,CAAC,CACV;SACD,EACD,YAAY,CAAC,OAAO,CACpB,CACD,CAAC;QACH,gBAAgB,qCAAiD,CAAC;IACnE,CAAC;SAAM,IAAI,cAAc,CAAC,IAAI,KAAK,gCAAgC,CAAC,UAAU,EAAE,CAAC;QAChF,eAAe,GAAG,CAAC,YAAmC,EAAE,EAAE,CACzD,IAAI,gCAAgC,CACnC,gBAAgB,CAAC,WAAW,CAAqC,YAAY,CAAC,OAAO,CAAC,CACtF,CAAC;QACH,gBAAgB,yCAAoD,CAAC;IACtE,CAAC;IAED,OAAO;QACN,eAAe,EAAE,eAAsE;QACvF,gBAAgB;QAChB,OAAO,EAAE,gBAAgB;KACzB,CAAC;AACH,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { ComponentFactory, type IComponent } from \"@twin.org/core\";\nimport type {\n\tEngineTypeInitialiserReturn,\n\tIEngineCore,\n\tIEngineCoreContext\n} from \"@twin.org/engine-models\";\nimport { nameofKebabCase } from \"@twin.org/nameof\";\nimport { 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\";\nimport { EngineTypeHelper } from \"../utils/engineTypeHelper.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 function initialiseRightsManagementPnpComponent(\n\tengineCore: IEngineCore<IEngineConfig>,\n\tcontext: IEngineCoreContext<IEngineConfig>,\n\tinstanceConfig: RightsManagementPnpComponentConfig\n): EngineTypeInitialiserReturn<typeof instanceConfig, typeof ComponentFactory> {\n\tlet createComponent;\n\tlet instanceTypeName;\n\n\tif (instanceConfig.type === RightsManagementPnpComponentType.Service) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) =>\n\t\t\tnew PolicyNegotiationPointService(\n\t\t\t\tEngineTypeHelper.mergeConfig<(typeof instanceConfig)[\"options\"]>(\n\t\t\t\t\t{\n\t\t\t\t\t\tloggingComponentType: engineCore.getRegisteredInstanceType(\"loggingComponent\"),\n\t\t\t\t\t\tpolicyNegotiationAdministrationPointComponentType: engineCore.getRegisteredInstanceType(\n\t\t\t\t\t\t\t\"rightsManagementPnapComponent\"\n\t\t\t\t\t\t),\n\t\t\t\t\t\tpolicyAdministrationPointComponentType: engineCore.getRegisteredInstanceType(\n\t\t\t\t\t\t\t\"rightsManagementPapComponent\"\n\t\t\t\t\t\t),\n\t\t\t\t\t\tpolicyInformationPointComponentType: engineCore.getRegisteredInstanceType(\n\t\t\t\t\t\t\t\"rightsManagementPipComponent\"\n\t\t\t\t\t\t),\n\t\t\t\t\t\ttrustComponentType: engineCore.getRegisteredInstanceType(\"trustComponent\"),\n\t\t\t\t\t\tpolicyNegotiationPointRemoteComponentType: engineCore.getRegisteredInstanceType(\n\t\t\t\t\t\t\t\"rightsManagementPnpComponent\",\n\t\t\t\t\t\t\t[\"remote\"]\n\t\t\t\t\t\t)\n\t\t\t\t\t},\n\t\t\t\t\tcreateConfig.options\n\t\t\t\t)\n\t\t\t);\n\t\tinstanceTypeName = nameofKebabCase(PolicyNegotiationPointService);\n\t} else if (instanceConfig.type === RightsManagementPnpComponentType.RestClient) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) =>\n\t\t\tnew PolicyNegotiationPointRestClient(\n\t\t\t\tEngineTypeHelper.mergeConfig<(typeof instanceConfig)[\"options\"]>(createConfig.options)\n\t\t\t);\n\t\tinstanceTypeName = nameofKebabCase(PolicyNegotiationPointRestClient);\n\t}\n\n\treturn {\n\t\tcreateComponent: createComponent as (createConfig: typeof instanceConfig) => IComponent,\n\t\tinstanceTypeName,\n\t\tfactory: ComponentFactory\n\t};\n}\n"]}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { PolicyArbiterFactory } from "@twin.org/rights-management-models";
|
|
2
|
+
import { DefaultPolicyArbiter, PassThroughPolicyArbiter } from "@twin.org/rights-management-plugins";
|
|
3
|
+
import { RightsManagementPolicyArbiterComponentType } from "../models/types/rightsManagementPolicyArbiterComponentType.js";
|
|
4
|
+
import { EngineTypeHelper } from "../utils/engineTypeHelper.js";
|
|
5
|
+
/**
|
|
6
|
+
* Initialise the rights management policy arbiter component.
|
|
7
|
+
* @param engineCore The engine core.
|
|
8
|
+
* @param context The context for the engine.
|
|
9
|
+
* @param instanceConfig The instance config.
|
|
10
|
+
* @returns The instance created and the factory for it.
|
|
11
|
+
*/
|
|
12
|
+
export function initialiseRightsManagementPolicyArbiterComponent(engineCore, context, instanceConfig) {
|
|
13
|
+
let createComponent;
|
|
14
|
+
let instanceTypeName;
|
|
15
|
+
if (instanceConfig.type === RightsManagementPolicyArbiterComponentType.PassThrough) {
|
|
16
|
+
createComponent = (createConfig) => new PassThroughPolicyArbiter(EngineTypeHelper.mergeConfig({ loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent") }, createConfig.options));
|
|
17
|
+
instanceTypeName = "pass-through-policy-arbiter";
|
|
18
|
+
}
|
|
19
|
+
else if (instanceConfig.type === RightsManagementPolicyArbiterComponentType.Default) {
|
|
20
|
+
createComponent = (createConfig) => new DefaultPolicyArbiter(EngineTypeHelper.mergeConfig({
|
|
21
|
+
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
22
|
+
policyAdministrationPointComponentType: engineCore.getRegisteredInstanceType("rightsManagementPapComponent")
|
|
23
|
+
}, createConfig.options));
|
|
24
|
+
instanceTypeName = "default-policy-arbiter";
|
|
25
|
+
}
|
|
26
|
+
return {
|
|
27
|
+
createComponent: createComponent,
|
|
28
|
+
instanceTypeName,
|
|
29
|
+
factory: PolicyArbiterFactory
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=rightsManagementPolicyArbiter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rightsManagementPolicyArbiter.js","sourceRoot":"","sources":["../../../src/components/rightsManagementPolicyArbiter.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAC1E,OAAO,EACN,oBAAoB,EACpB,wBAAwB,EACxB,MAAM,qCAAqC,CAAC;AAG7C,OAAO,EAAE,0CAA0C,EAAE,MAAM,+DAA+D,CAAC;AAC3H,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAEhE;;;;;;GAMG;AACH,MAAM,UAAU,gDAAgD,CAC/D,UAAsC,EACtC,OAA0C,EAC1C,cAA4D;IAE5D,IAAI,eAAe,CAAC;IACpB,IAAI,gBAAgB,CAAC;IAErB,IAAI,cAAc,CAAC,IAAI,KAAK,0CAA0C,CAAC,WAAW,EAAE,CAAC;QACpF,eAAe,GAAG,CAAC,YAAmC,EAAE,EAAE,CACzD,IAAI,wBAAwB,CAC3B,gBAAgB,CAAC,WAAW,CAC3B,EAAE,oBAAoB,EAAE,UAAU,CAAC,yBAAyB,CAAC,kBAAkB,CAAC,EAAE,EAClF,YAAY,CAAC,OAAO,CACpB,CACD,CAAC;QACH,gBAAgB,gCAA4C,CAAC;IAC9D,CAAC;SAAM,IAAI,cAAc,CAAC,IAAI,KAAK,0CAA0C,CAAC,OAAO,EAAE,CAAC;QACvF,eAAe,GAAG,CAAC,YAAmC,EAAE,EAAE,CACzD,IAAI,oBAAoB,CACvB,gBAAgB,CAAC,WAAW,CAC3B;YACC,oBAAoB,EAAE,UAAU,CAAC,yBAAyB,CAAC,kBAAkB,CAAC;YAC9E,sCAAsC,EAAE,UAAU,CAAC,yBAAyB,CAC3E,8BAA8B,CAC9B;SACD,EACD,YAAY,CAAC,OAAO,CACpB,CACD,CAAC;QACH,gBAAgB,2BAAwC,CAAC;IAC1D,CAAC;IAED,OAAO;QACN,eAAe,EAAE,eAAsE;QACvF,gBAAgB;QAChB,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 {\n\tEngineTypeInitialiserReturn,\n\tIEngineCore,\n\tIEngineCoreContext\n} from \"@twin.org/engine-models\";\nimport { nameofKebabCase } from \"@twin.org/nameof\";\nimport { PolicyArbiterFactory } from \"@twin.org/rights-management-models\";\nimport {\n\tDefaultPolicyArbiter,\n\tPassThroughPolicyArbiter\n} 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\";\nimport { EngineTypeHelper } from \"../utils/engineTypeHelper.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 function initialiseRightsManagementPolicyArbiterComponent(\n\tengineCore: IEngineCore<IEngineConfig>,\n\tcontext: IEngineCoreContext<IEngineConfig>,\n\tinstanceConfig: RightsManagementPolicyArbiterComponentConfig\n): EngineTypeInitialiserReturn<typeof instanceConfig, typeof PolicyArbiterFactory> {\n\tlet createComponent;\n\tlet instanceTypeName;\n\n\tif (instanceConfig.type === RightsManagementPolicyArbiterComponentType.PassThrough) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) =>\n\t\t\tnew PassThroughPolicyArbiter(\n\t\t\t\tEngineTypeHelper.mergeConfig<(typeof instanceConfig)[\"options\"]>(\n\t\t\t\t\t{ loggingComponentType: engineCore.getRegisteredInstanceType(\"loggingComponent\") },\n\t\t\t\t\tcreateConfig.options\n\t\t\t\t)\n\t\t\t);\n\t\tinstanceTypeName = nameofKebabCase(PassThroughPolicyArbiter);\n\t} else if (instanceConfig.type === RightsManagementPolicyArbiterComponentType.Default) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) =>\n\t\t\tnew DefaultPolicyArbiter(\n\t\t\t\tEngineTypeHelper.mergeConfig<(typeof instanceConfig)[\"options\"]>(\n\t\t\t\t\t{\n\t\t\t\t\t\tloggingComponentType: engineCore.getRegisteredInstanceType(\"loggingComponent\"),\n\t\t\t\t\t\tpolicyAdministrationPointComponentType: engineCore.getRegisteredInstanceType(\n\t\t\t\t\t\t\t\"rightsManagementPapComponent\"\n\t\t\t\t\t\t)\n\t\t\t\t\t},\n\t\t\t\t\tcreateConfig.options\n\t\t\t\t)\n\t\t\t);\n\t\tinstanceTypeName = nameofKebabCase(DefaultPolicyArbiter);\n\t}\n\n\treturn {\n\t\tcreateComponent: createComponent as (createConfig: typeof instanceConfig) => IComponent,\n\t\tinstanceTypeName,\n\t\tfactory: PolicyArbiterFactory\n\t};\n}\n"]}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { PolicyEnforcementProcessorFactory } from "@twin.org/rights-management-models";
|
|
2
|
+
import { DefaultPolicyEnforcementProcessor, PassThroughPolicyEnforcementProcessor } from "@twin.org/rights-management-plugins";
|
|
3
|
+
import { RightsManagementPolicyEnforcementProcessorComponentType } from "../models/types/rightsManagementPolicyEnforcementProcessorComponentType.js";
|
|
4
|
+
import { EngineTypeHelper } from "../utils/engineTypeHelper.js";
|
|
5
|
+
/**
|
|
6
|
+
* Initialise the rights management policy enforcement processor component.
|
|
7
|
+
* @param engineCore The engine core.
|
|
8
|
+
* @param context The context for the engine.
|
|
9
|
+
* @param instanceConfig The instance config.
|
|
10
|
+
* @returns The instance created and the factory for it.
|
|
11
|
+
*/
|
|
12
|
+
export function initialiseRightsManagementPolicyEnforcementProcessorComponent(engineCore, context, instanceConfig) {
|
|
13
|
+
let createComponent;
|
|
14
|
+
let instanceTypeName;
|
|
15
|
+
if (instanceConfig.type === RightsManagementPolicyEnforcementProcessorComponentType.PassThrough) {
|
|
16
|
+
createComponent = (createConfig) => new PassThroughPolicyEnforcementProcessor(EngineTypeHelper.mergeConfig({
|
|
17
|
+
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent")
|
|
18
|
+
}, createConfig.options));
|
|
19
|
+
instanceTypeName = "pass-through-policy-enforcement-processor";
|
|
20
|
+
}
|
|
21
|
+
else if (instanceConfig.type === RightsManagementPolicyEnforcementProcessorComponentType.Default) {
|
|
22
|
+
createComponent = (createConfig) => new DefaultPolicyEnforcementProcessor(EngineTypeHelper.mergeConfig({
|
|
23
|
+
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent")
|
|
24
|
+
}, createConfig.options));
|
|
25
|
+
instanceTypeName = "default-policy-enforcement-processor";
|
|
26
|
+
}
|
|
27
|
+
return {
|
|
28
|
+
createComponent: createComponent,
|
|
29
|
+
instanceTypeName,
|
|
30
|
+
factory: PolicyEnforcementProcessorFactory
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=rightsManagementPolicyEnforcementProcessor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rightsManagementPolicyEnforcementProcessor.js","sourceRoot":"","sources":["../../../src/components/rightsManagementPolicyEnforcementProcessor.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,iCAAiC,EAAE,MAAM,oCAAoC,CAAC;AACvF,OAAO,EACN,iCAAiC,EACjC,qCAAqC,EACrC,MAAM,qCAAqC,CAAC;AAG7C,OAAO,EAAE,uDAAuD,EAAE,MAAM,4EAA4E,CAAC;AACrJ,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAEhE;;;;;;GAMG;AACH,MAAM,UAAU,6DAA6D,CAC5E,UAAsC,EACtC,OAA0C,EAC1C,cAAyE;IAEzE,IAAI,eAAe,CAAC;IACpB,IAAI,gBAAgB,CAAC;IAErB,IAAI,cAAc,CAAC,IAAI,KAAK,uDAAuD,CAAC,WAAW,EAAE,CAAC;QACjG,eAAe,GAAG,CAAC,YAAmC,EAAE,EAAE,CACzD,IAAI,qCAAqC,CACxC,gBAAgB,CAAC,WAAW,CAC3B;YACC,oBAAoB,EAAE,UAAU,CAAC,yBAAyB,CAAC,kBAAkB,CAAC;SAC9E,EACD,YAAY,CAAC,OAAO,CACpB,CACD,CAAC;QACH,gBAAgB,8CAAyD,CAAC;IAC3E,CAAC;SAAM,IACN,cAAc,CAAC,IAAI,KAAK,uDAAuD,CAAC,OAAO,EACtF,CAAC;QACF,eAAe,GAAG,CAAC,YAAmC,EAAE,EAAE,CACzD,IAAI,iCAAiC,CACpC,gBAAgB,CAAC,WAAW,CAC3B;YACC,oBAAoB,EAAE,UAAU,CAAC,yBAAyB,CAAC,kBAAkB,CAAC;SAC9E,EACD,YAAY,CAAC,OAAO,CACpB,CACD,CAAC;QACH,gBAAgB,yCAAqD,CAAC;IACvE,CAAC;IAED,OAAO;QACN,eAAe,EAAE,eAAsE;QACvF,gBAAgB;QAChB,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 {\n\tEngineTypeInitialiserReturn,\n\tIEngineCore,\n\tIEngineCoreContext\n} from \"@twin.org/engine-models\";\nimport { nameofKebabCase } from \"@twin.org/nameof\";\nimport { PolicyEnforcementProcessorFactory } from \"@twin.org/rights-management-models\";\nimport {\n\tDefaultPolicyEnforcementProcessor,\n\tPassThroughPolicyEnforcementProcessor\n} 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\";\nimport { EngineTypeHelper } from \"../utils/engineTypeHelper.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 function initialiseRightsManagementPolicyEnforcementProcessorComponent(\n\tengineCore: IEngineCore<IEngineConfig>,\n\tcontext: IEngineCoreContext<IEngineConfig>,\n\tinstanceConfig: RightsManagementPolicyEnforcementProcessorComponentConfig\n): EngineTypeInitialiserReturn<typeof instanceConfig, typeof PolicyEnforcementProcessorFactory> {\n\tlet createComponent;\n\tlet instanceTypeName;\n\n\tif (instanceConfig.type === RightsManagementPolicyEnforcementProcessorComponentType.PassThrough) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) =>\n\t\t\tnew PassThroughPolicyEnforcementProcessor(\n\t\t\t\tEngineTypeHelper.mergeConfig<(typeof instanceConfig)[\"options\"]>(\n\t\t\t\t\t{\n\t\t\t\t\t\tloggingComponentType: engineCore.getRegisteredInstanceType(\"loggingComponent\")\n\t\t\t\t\t},\n\t\t\t\t\tcreateConfig.options\n\t\t\t\t)\n\t\t\t);\n\t\tinstanceTypeName = nameofKebabCase(PassThroughPolicyEnforcementProcessor);\n\t} else if (\n\t\tinstanceConfig.type === RightsManagementPolicyEnforcementProcessorComponentType.Default\n\t) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) =>\n\t\t\tnew DefaultPolicyEnforcementProcessor(\n\t\t\t\tEngineTypeHelper.mergeConfig<(typeof instanceConfig)[\"options\"]>(\n\t\t\t\t\t{\n\t\t\t\t\t\tloggingComponentType: engineCore.getRegisteredInstanceType(\"loggingComponent\")\n\t\t\t\t\t},\n\t\t\t\t\tcreateConfig.options\n\t\t\t\t)\n\t\t\t);\n\t\tinstanceTypeName = nameofKebabCase(DefaultPolicyEnforcementProcessor);\n\t}\n\n\treturn {\n\t\tcreateComponent: createComponent as (createConfig: typeof instanceConfig) => IComponent,\n\t\tinstanceTypeName,\n\t\tfactory: PolicyEnforcementProcessorFactory\n\t};\n}\n"]}
|
|
@@ -0,0 +1,25 @@
|
|
|
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
|
+
import { EngineTypeHelper } from "../utils/engineTypeHelper.js";
|
|
5
|
+
/**
|
|
6
|
+
* Initialise the rights management policy execution action component.
|
|
7
|
+
* @param engineCore The engine core.
|
|
8
|
+
* @param context The context for the engine.
|
|
9
|
+
* @param instanceConfig The instance config.
|
|
10
|
+
* @returns The instance created and the factory for it.
|
|
11
|
+
*/
|
|
12
|
+
export function initialiseRightsManagementPolicyExecutionActionComponent(engineCore, context, instanceConfig) {
|
|
13
|
+
let createComponent;
|
|
14
|
+
let instanceTypeName;
|
|
15
|
+
if (instanceConfig.type === RightsManagementPolicyExecutionActionComponentType.Logging) {
|
|
16
|
+
createComponent = (createConfig) => new LoggingPolicyExecutionAction(EngineTypeHelper.mergeConfig({ loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent") }, createConfig.options));
|
|
17
|
+
instanceTypeName = "logging-policy-execution-action";
|
|
18
|
+
}
|
|
19
|
+
return {
|
|
20
|
+
createComponent: createComponent,
|
|
21
|
+
instanceTypeName,
|
|
22
|
+
factory: PolicyExecutionActionFactory
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=rightsManagementPolicyExecutionAction.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rightsManagementPolicyExecutionAction.js","sourceRoot":"","sources":["../../../src/components/rightsManagementPolicyExecutionAction.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,4BAA4B,EAAE,MAAM,oCAAoC,CAAC;AAClF,OAAO,EAAE,4BAA4B,EAAE,MAAM,qCAAqC,CAAC;AAGnF,OAAO,EAAE,kDAAkD,EAAE,MAAM,uEAAuE,CAAC;AAC3I,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAEhE;;;;;;GAMG;AACH,MAAM,UAAU,wDAAwD,CACvE,UAAsC,EACtC,OAA0C,EAC1C,cAAoE;IAEpE,IAAI,eAAe,CAAC;IACpB,IAAI,gBAAgB,CAAC;IAErB,IAAI,cAAc,CAAC,IAAI,KAAK,kDAAkD,CAAC,OAAO,EAAE,CAAC;QACxF,eAAe,GAAG,CAAC,YAAmC,EAAE,EAAE,CACzD,IAAI,4BAA4B,CAC/B,gBAAgB,CAAC,WAAW,CAC3B,EAAE,oBAAoB,EAAE,UAAU,CAAC,yBAAyB,CAAC,kBAAkB,CAAC,EAAE,EAClF,YAAY,CAAC,OAAO,CACpB,CACD,CAAC;QACH,gBAAgB,oCAAgD,CAAC;IAClE,CAAC;IAED,OAAO;QACN,eAAe,EAAE,eAAsE;QACvF,gBAAgB;QAChB,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 {\n\tEngineTypeInitialiserReturn,\n\tIEngineCore,\n\tIEngineCoreContext\n} from \"@twin.org/engine-models\";\nimport { nameofKebabCase } from \"@twin.org/nameof\";\nimport { PolicyExecutionActionFactory } 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\";\nimport { EngineTypeHelper } from \"../utils/engineTypeHelper.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 function initialiseRightsManagementPolicyExecutionActionComponent(\n\tengineCore: IEngineCore<IEngineConfig>,\n\tcontext: IEngineCoreContext<IEngineConfig>,\n\tinstanceConfig: RightsManagementPolicyExecutionActionComponentConfig\n): EngineTypeInitialiserReturn<typeof instanceConfig, typeof PolicyExecutionActionFactory> {\n\tlet createComponent;\n\tlet instanceTypeName;\n\n\tif (instanceConfig.type === RightsManagementPolicyExecutionActionComponentType.Logging) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) =>\n\t\t\tnew LoggingPolicyExecutionAction(\n\t\t\t\tEngineTypeHelper.mergeConfig<(typeof instanceConfig)[\"options\"]>(\n\t\t\t\t\t{ loggingComponentType: engineCore.getRegisteredInstanceType(\"loggingComponent\") },\n\t\t\t\t\tcreateConfig.options\n\t\t\t\t)\n\t\t\t);\n\t\tinstanceTypeName = nameofKebabCase(LoggingPolicyExecutionAction);\n\t}\n\n\treturn {\n\t\tcreateComponent: createComponent as (createConfig: typeof instanceConfig) => IComponent,\n\t\tinstanceTypeName,\n\t\tfactory: PolicyExecutionActionFactory\n\t};\n}\n"]}
|
|
@@ -0,0 +1,34 @@
|
|
|
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
|
+
import { EngineTypeHelper } from "../utils/engineTypeHelper.js";
|
|
5
|
+
/**
|
|
6
|
+
* Initialise the rights management policy information source component.
|
|
7
|
+
* @param engineCore The engine core.
|
|
8
|
+
* @param context The context for the engine.
|
|
9
|
+
* @param instanceConfig The instance config.
|
|
10
|
+
* @returns The instance created and the factory for it.
|
|
11
|
+
*/
|
|
12
|
+
export function initialiseRightsManagementPolicyInformationSourceComponent(engineCore, context, instanceConfig) {
|
|
13
|
+
let createComponent;
|
|
14
|
+
let instanceTypeName;
|
|
15
|
+
if (instanceConfig.type === RightsManagementPolicyInformationSourceComponentType.Identity) {
|
|
16
|
+
createComponent = (createConfig) => new IdentityPolicyInformationSource(EngineTypeHelper.mergeConfig({
|
|
17
|
+
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
18
|
+
identityResolverComponentType: engineCore.getRegisteredInstanceType("identityResolverComponent")
|
|
19
|
+
}, createConfig.options));
|
|
20
|
+
instanceTypeName = "identity-policy-information-source";
|
|
21
|
+
}
|
|
22
|
+
else if (instanceConfig.type === RightsManagementPolicyInformationSourceComponentType.Static) {
|
|
23
|
+
createComponent = (createConfig) => new StaticPolicyInformationSource(EngineTypeHelper.mergeConfig({
|
|
24
|
+
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent")
|
|
25
|
+
}, createConfig.options));
|
|
26
|
+
instanceTypeName = "static-policy-information-source";
|
|
27
|
+
}
|
|
28
|
+
return {
|
|
29
|
+
createComponent: createComponent,
|
|
30
|
+
instanceTypeName,
|
|
31
|
+
factory: PolicyInformationSourceFactory
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=rightsManagementPolicyInformationSource.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rightsManagementPolicyInformationSource.js","sourceRoot":"","sources":["../../../src/components/rightsManagementPolicyInformationSource.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,8BAA8B,EAAE,MAAM,oCAAoC,CAAC;AACpF,OAAO,EACN,+BAA+B,EAC/B,6BAA6B,EAC7B,MAAM,qCAAqC,CAAC;AAG7C,OAAO,EAAE,oDAAoD,EAAE,MAAM,yEAAyE,CAAC;AAC/I,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAEhE;;;;;;GAMG;AACH,MAAM,UAAU,0DAA0D,CACzE,UAAsC,EACtC,OAA0C,EAC1C,cAAsE;IAEtE,IAAI,eAAe,CAAC;IACpB,IAAI,gBAAgB,CAAC;IAErB,IAAI,cAAc,CAAC,IAAI,KAAK,oDAAoD,CAAC,QAAQ,EAAE,CAAC;QAC3F,eAAe,GAAG,CAAC,YAAmC,EAAE,EAAE,CACzD,IAAI,+BAA+B,CAClC,gBAAgB,CAAC,WAAW,CAC3B;YACC,oBAAoB,EAAE,UAAU,CAAC,yBAAyB,CAAC,kBAAkB,CAAC;YAC9E,6BAA6B,EAAE,UAAU,CAAC,yBAAyB,CAClE,2BAA2B,CAC3B;SACD,EACD,YAAY,CAAC,OAAO,CACpB,CACD,CAAC;QACH,gBAAgB,uCAAmD,CAAC;IACrE,CAAC;SAAM,IAAI,cAAc,CAAC,IAAI,KAAK,oDAAoD,CAAC,MAAM,EAAE,CAAC;QAChG,eAAe,GAAG,CAAC,YAAmC,EAAE,EAAE,CACzD,IAAI,6BAA6B,CAChC,gBAAgB,CAAC,WAAW,CAC3B;YACC,oBAAoB,EAAE,UAAU,CAAC,yBAAyB,CAAC,kBAAkB,CAAC;SAC9E,EACD,YAAY,CAAC,OAAO,CACpB,CACD,CAAC;QACH,gBAAgB,qCAAiD,CAAC;IACnE,CAAC;IAED,OAAO;QACN,eAAe,EAAE,eAAsE;QACvF,gBAAgB;QAChB,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 {\n\tEngineTypeInitialiserReturn,\n\tIEngineCore,\n\tIEngineCoreContext\n} from \"@twin.org/engine-models\";\nimport { nameofKebabCase } from \"@twin.org/nameof\";\nimport { PolicyInformationSourceFactory } 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\";\nimport { EngineTypeHelper } from \"../utils/engineTypeHelper.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 function initialiseRightsManagementPolicyInformationSourceComponent(\n\tengineCore: IEngineCore<IEngineConfig>,\n\tcontext: IEngineCoreContext<IEngineConfig>,\n\tinstanceConfig: RightsManagementPolicyInformationSourceComponentConfig\n): EngineTypeInitialiserReturn<typeof instanceConfig, typeof PolicyInformationSourceFactory> {\n\tlet createComponent;\n\tlet instanceTypeName;\n\n\tif (instanceConfig.type === RightsManagementPolicyInformationSourceComponentType.Identity) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) =>\n\t\t\tnew IdentityPolicyInformationSource(\n\t\t\t\tEngineTypeHelper.mergeConfig<(typeof instanceConfig)[\"options\"]>(\n\t\t\t\t\t{\n\t\t\t\t\t\tloggingComponentType: engineCore.getRegisteredInstanceType(\"loggingComponent\"),\n\t\t\t\t\t\tidentityResolverComponentType: engineCore.getRegisteredInstanceType(\n\t\t\t\t\t\t\t\"identityResolverComponent\"\n\t\t\t\t\t\t)\n\t\t\t\t\t},\n\t\t\t\t\tcreateConfig.options\n\t\t\t\t)\n\t\t\t);\n\t\tinstanceTypeName = nameofKebabCase(IdentityPolicyInformationSource);\n\t} else if (instanceConfig.type === RightsManagementPolicyInformationSourceComponentType.Static) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) =>\n\t\t\tnew StaticPolicyInformationSource(\n\t\t\t\tEngineTypeHelper.mergeConfig<(typeof instanceConfig)[\"options\"]>(\n\t\t\t\t\t{\n\t\t\t\t\t\tloggingComponentType: engineCore.getRegisteredInstanceType(\"loggingComponent\")\n\t\t\t\t\t},\n\t\t\t\t\tcreateConfig.options\n\t\t\t\t)\n\t\t\t);\n\t\tinstanceTypeName = nameofKebabCase(StaticPolicyInformationSource);\n\t}\n\n\treturn {\n\t\tcreateComponent: createComponent as (createConfig: typeof instanceConfig) => IComponent,\n\t\tinstanceTypeName,\n\t\tfactory: PolicyInformationSourceFactory\n\t};\n}\n"]}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { PolicyNegotiatorFactory } from "@twin.org/rights-management-models";
|
|
2
|
+
import { PassThroughPolicyNegotiator } from "@twin.org/rights-management-plugins";
|
|
3
|
+
import { RightsManagementPolicyNegotiatorComponentType } from "../models/types/rightsManagementPolicyNegotiatorComponentType.js";
|
|
4
|
+
import { EngineTypeHelper } from "../utils/engineTypeHelper.js";
|
|
5
|
+
/**
|
|
6
|
+
* Initialise the rights management policy negotiator component.
|
|
7
|
+
* @param engineCore The engine core.
|
|
8
|
+
* @param context The context for the engine.
|
|
9
|
+
* @param instanceConfig The instance config.
|
|
10
|
+
* @returns The instance created and the factory for it.
|
|
11
|
+
*/
|
|
12
|
+
export function initialiseRightsManagementPolicyNegotiatorComponent(engineCore, context, instanceConfig) {
|
|
13
|
+
let createComponent;
|
|
14
|
+
let instanceTypeName;
|
|
15
|
+
if (instanceConfig.type === RightsManagementPolicyNegotiatorComponentType.PassThrough) {
|
|
16
|
+
createComponent = (createConfig) => new PassThroughPolicyNegotiator(EngineTypeHelper.mergeConfig({
|
|
17
|
+
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent")
|
|
18
|
+
}, createConfig.options));
|
|
19
|
+
instanceTypeName = "pass-through-policy-negotiator";
|
|
20
|
+
}
|
|
21
|
+
return {
|
|
22
|
+
createComponent: createComponent,
|
|
23
|
+
instanceTypeName,
|
|
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":"AASA,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAC7E,OAAO,EAAE,2BAA2B,EAAE,MAAM,qCAAqC,CAAC;AAGlF,OAAO,EAAE,6CAA6C,EAAE,MAAM,kEAAkE,CAAC;AACjI,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAEhE;;;;;;GAMG;AACH,MAAM,UAAU,mDAAmD,CAClE,UAAsC,EACtC,OAA0C,EAC1C,cAA+D;IAE/D,IAAI,eAAe,CAAC;IACpB,IAAI,gBAAgB,CAAC;IAErB,IAAI,cAAc,CAAC,IAAI,KAAK,6CAA6C,CAAC,WAAW,EAAE,CAAC;QACvF,eAAe,GAAG,CAAC,YAAmC,EAAE,EAAE,CACzD,IAAI,2BAA2B,CAC9B,gBAAgB,CAAC,WAAW,CAC3B;YACC,oBAAoB,EAAE,UAAU,CAAC,yBAAyB,CAAC,kBAAkB,CAAC;SAC9E,EACD,YAAY,CAAC,OAAO,CACpB,CACD,CAAC;QACH,gBAAgB,mCAA+C,CAAC;IACjE,CAAC;IAED,OAAO;QACN,eAAe,EAAE,eAAsE;QACvF,gBAAgB;QAChB,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 {\n\tEngineTypeInitialiserReturn,\n\tIEngineCore,\n\tIEngineCoreContext\n} from \"@twin.org/engine-models\";\nimport { nameofKebabCase } from \"@twin.org/nameof\";\nimport { PolicyNegotiatorFactory } from \"@twin.org/rights-management-models\";\nimport { PassThroughPolicyNegotiator } 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\";\nimport { EngineTypeHelper } from \"../utils/engineTypeHelper.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 function initialiseRightsManagementPolicyNegotiatorComponent(\n\tengineCore: IEngineCore<IEngineConfig>,\n\tcontext: IEngineCoreContext<IEngineConfig>,\n\tinstanceConfig: RightsManagementPolicyNegotiatorComponentConfig\n): EngineTypeInitialiserReturn<typeof instanceConfig, typeof PolicyNegotiatorFactory> {\n\tlet createComponent;\n\tlet instanceTypeName;\n\n\tif (instanceConfig.type === RightsManagementPolicyNegotiatorComponentType.PassThrough) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) =>\n\t\t\tnew PassThroughPolicyNegotiator(\n\t\t\t\tEngineTypeHelper.mergeConfig<(typeof instanceConfig)[\"options\"]>(\n\t\t\t\t\t{\n\t\t\t\t\t\tloggingComponentType: engineCore.getRegisteredInstanceType(\"loggingComponent\")\n\t\t\t\t\t},\n\t\t\t\t\tcreateConfig.options\n\t\t\t\t)\n\t\t\t);\n\t\tinstanceTypeName = nameofKebabCase(PassThroughPolicyNegotiator);\n\t}\n\n\treturn {\n\t\tcreateComponent: createComponent as (createConfig: typeof instanceConfig) => IComponent,\n\t\tinstanceTypeName,\n\t\tfactory: PolicyNegotiatorFactory\n\t};\n}\n"]}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { PolicyObligationEnforcerFactory } from "@twin.org/rights-management-models";
|
|
2
|
+
import { PassThroughPolicyObligationEnforcer } from "@twin.org/rights-management-plugins";
|
|
3
|
+
import { RightsManagementPolicyObligationEnforcerComponentType } from "../models/types/rightsManagementPolicyObligationEnforcerComponentType.js";
|
|
4
|
+
import { EngineTypeHelper } from "../utils/engineTypeHelper.js";
|
|
5
|
+
/**
|
|
6
|
+
* Initialise the rights management policy obligation enforcer component.
|
|
7
|
+
* @param engineCore The engine core.
|
|
8
|
+
* @param context The context for the engine.
|
|
9
|
+
* @param instanceConfig The instance config.
|
|
10
|
+
* @returns The instance created and the factory for it.
|
|
11
|
+
*/
|
|
12
|
+
export function initialiseRightsManagementPolicyObligationEnforcerComponent(engineCore, context, instanceConfig) {
|
|
13
|
+
let createComponent;
|
|
14
|
+
let instanceTypeName;
|
|
15
|
+
if (instanceConfig.type === RightsManagementPolicyObligationEnforcerComponentType.PassThrough) {
|
|
16
|
+
createComponent = (createConfig) => new PassThroughPolicyObligationEnforcer(EngineTypeHelper.mergeConfig({
|
|
17
|
+
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent")
|
|
18
|
+
}, createConfig.options));
|
|
19
|
+
instanceTypeName = "pass-through-policy-obligation-enforcer";
|
|
20
|
+
}
|
|
21
|
+
return {
|
|
22
|
+
createComponent: createComponent,
|
|
23
|
+
instanceTypeName,
|
|
24
|
+
factory: PolicyObligationEnforcerFactory
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=rightsManagementPolicyObligationEnforcer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rightsManagementPolicyObligationEnforcer.js","sourceRoot":"","sources":["../../../src/components/rightsManagementPolicyObligationEnforcer.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,+BAA+B,EAAE,MAAM,oCAAoC,CAAC;AACrF,OAAO,EAAE,mCAAmC,EAAE,MAAM,qCAAqC,CAAC;AAG1F,OAAO,EAAE,qDAAqD,EAAE,MAAM,0EAA0E,CAAC;AACjJ,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAEhE;;;;;;GAMG;AACH,MAAM,UAAU,2DAA2D,CAC1E,UAAsC,EACtC,OAA0C,EAC1C,cAAuE;IAEvE,IAAI,eAAe,CAAC;IACpB,IAAI,gBAAgB,CAAC;IAErB,IAAI,cAAc,CAAC,IAAI,KAAK,qDAAqD,CAAC,WAAW,EAAE,CAAC;QAC/F,eAAe,GAAG,CAAC,YAAmC,EAAE,EAAE,CACzD,IAAI,mCAAmC,CACtC,gBAAgB,CAAC,WAAW,CAC3B;YACC,oBAAoB,EAAE,UAAU,CAAC,yBAAyB,CAAC,kBAAkB,CAAC;SAC9E,EACD,YAAY,CAAC,OAAO,CACpB,CACD,CAAC;QACH,gBAAgB,4CAAuD,CAAC;IACzE,CAAC;IAED,OAAO;QACN,eAAe,EAAE,eAAsE;QACvF,gBAAgB;QAChB,OAAO,EAAE,+BAA+B;KACxC,CAAC;AACH,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IComponent } from \"@twin.org/core\";\nimport type {\n\tEngineTypeInitialiserReturn,\n\tIEngineCore,\n\tIEngineCoreContext\n} from \"@twin.org/engine-models\";\nimport { nameofKebabCase } from \"@twin.org/nameof\";\nimport { PolicyObligationEnforcerFactory } from \"@twin.org/rights-management-models\";\nimport { PassThroughPolicyObligationEnforcer } from \"@twin.org/rights-management-plugins\";\nimport type { RightsManagementPolicyObligationEnforcerComponentConfig } from \"../models/config/rightsManagementPolicyObligationEnforcerComponentConfig.js\";\nimport type { IEngineConfig } from \"../models/IEngineConfig.js\";\nimport { RightsManagementPolicyObligationEnforcerComponentType } from \"../models/types/rightsManagementPolicyObligationEnforcerComponentType.js\";\nimport { EngineTypeHelper } from \"../utils/engineTypeHelper.js\";\n\n/**\n * Initialise the rights management policy obligation enforcer 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 function initialiseRightsManagementPolicyObligationEnforcerComponent(\n\tengineCore: IEngineCore<IEngineConfig>,\n\tcontext: IEngineCoreContext<IEngineConfig>,\n\tinstanceConfig: RightsManagementPolicyObligationEnforcerComponentConfig\n): EngineTypeInitialiserReturn<typeof instanceConfig, typeof PolicyObligationEnforcerFactory> {\n\tlet createComponent;\n\tlet instanceTypeName;\n\n\tif (instanceConfig.type === RightsManagementPolicyObligationEnforcerComponentType.PassThrough) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) =>\n\t\t\tnew PassThroughPolicyObligationEnforcer(\n\t\t\t\tEngineTypeHelper.mergeConfig<(typeof instanceConfig)[\"options\"]>(\n\t\t\t\t\t{\n\t\t\t\t\t\tloggingComponentType: engineCore.getRegisteredInstanceType(\"loggingComponent\")\n\t\t\t\t\t},\n\t\t\t\t\tcreateConfig.options\n\t\t\t\t)\n\t\t\t);\n\t\tinstanceTypeName = nameofKebabCase(PassThroughPolicyObligationEnforcer);\n\t}\n\n\treturn {\n\t\tcreateComponent: createComponent as (createConfig: typeof instanceConfig) => IComponent,\n\t\tinstanceTypeName,\n\t\tfactory: PolicyObligationEnforcerFactory\n\t};\n}\n"]}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { PolicyRequesterFactory } from "@twin.org/rights-management-models";
|
|
2
|
+
import { PassThroughPolicyRequester } from "@twin.org/rights-management-plugins";
|
|
3
|
+
import { RightsManagementPolicyRequesterComponentType } from "../models/types/rightsManagementPolicyRequesterComponentType.js";
|
|
4
|
+
import { EngineTypeHelper } from "../utils/engineTypeHelper.js";
|
|
5
|
+
/**
|
|
6
|
+
* Initialise the rights management policy requester component.
|
|
7
|
+
* @param engineCore The engine core.
|
|
8
|
+
* @param context The context for the engine.
|
|
9
|
+
* @param instanceConfig The instance config.
|
|
10
|
+
* @returns The instance created and the factory for it.
|
|
11
|
+
*/
|
|
12
|
+
export function initialiseRightsManagementPolicyRequesterComponent(engineCore, context, instanceConfig) {
|
|
13
|
+
let createComponent;
|
|
14
|
+
let instanceTypeName;
|
|
15
|
+
if (instanceConfig.type === RightsManagementPolicyRequesterComponentType.PassThrough) {
|
|
16
|
+
createComponent = (createConfig) => new PassThroughPolicyRequester(EngineTypeHelper.mergeConfig({ loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent") }, createConfig.options));
|
|
17
|
+
instanceTypeName = "pass-through-policy-requester";
|
|
18
|
+
}
|
|
19
|
+
return {
|
|
20
|
+
createComponent: createComponent,
|
|
21
|
+
instanceTypeName,
|
|
22
|
+
factory: PolicyRequesterFactory
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=rightsManagementPolicyRequester.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rightsManagementPolicyRequester.js","sourceRoot":"","sources":["../../../src/components/rightsManagementPolicyRequester.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAC5E,OAAO,EAAE,0BAA0B,EAAE,MAAM,qCAAqC,CAAC;AAGjF,OAAO,EAAE,4CAA4C,EAAE,MAAM,iEAAiE,CAAC;AAC/H,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAEhE;;;;;;GAMG;AACH,MAAM,UAAU,kDAAkD,CACjE,UAAsC,EACtC,OAA0C,EAC1C,cAA8D;IAE9D,IAAI,eAAe,CAAC;IACpB,IAAI,gBAAgB,CAAC;IAErB,IAAI,cAAc,CAAC,IAAI,KAAK,4CAA4C,CAAC,WAAW,EAAE,CAAC;QACtF,eAAe,GAAG,CAAC,YAAmC,EAAE,EAAE,CACzD,IAAI,0BAA0B,CAC7B,gBAAgB,CAAC,WAAW,CAC3B,EAAE,oBAAoB,EAAE,UAAU,CAAC,yBAAyB,CAAC,kBAAkB,CAAC,EAAE,EAClF,YAAY,CAAC,OAAO,CACpB,CACD,CAAC;QACH,gBAAgB,kCAA8C,CAAC;IAChE,CAAC;IAED,OAAO;QACN,eAAe,EAAE,eAAsE;QACvF,gBAAgB;QAChB,OAAO,EAAE,sBAAsB;KAC/B,CAAC;AACH,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IComponent } from \"@twin.org/core\";\nimport type {\n\tEngineTypeInitialiserReturn,\n\tIEngineCore,\n\tIEngineCoreContext\n} from \"@twin.org/engine-models\";\nimport { nameofKebabCase } from \"@twin.org/nameof\";\nimport { PolicyRequesterFactory } from \"@twin.org/rights-management-models\";\nimport { PassThroughPolicyRequester } from \"@twin.org/rights-management-plugins\";\nimport type { RightsManagementPolicyRequesterComponentConfig } from \"../models/config/rightsManagementPolicyRequesterComponentConfig.js\";\nimport type { IEngineConfig } from \"../models/IEngineConfig.js\";\nimport { RightsManagementPolicyRequesterComponentType } from \"../models/types/rightsManagementPolicyRequesterComponentType.js\";\nimport { EngineTypeHelper } from \"../utils/engineTypeHelper.js\";\n\n/**\n * Initialise the rights management policy requester 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 function initialiseRightsManagementPolicyRequesterComponent(\n\tengineCore: IEngineCore<IEngineConfig>,\n\tcontext: IEngineCoreContext<IEngineConfig>,\n\tinstanceConfig: RightsManagementPolicyRequesterComponentConfig\n): EngineTypeInitialiserReturn<typeof instanceConfig, typeof PolicyRequesterFactory> {\n\tlet createComponent;\n\tlet instanceTypeName;\n\n\tif (instanceConfig.type === RightsManagementPolicyRequesterComponentType.PassThrough) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) =>\n\t\t\tnew PassThroughPolicyRequester(\n\t\t\t\tEngineTypeHelper.mergeConfig<(typeof instanceConfig)[\"options\"]>(\n\t\t\t\t\t{ loggingComponentType: engineCore.getRegisteredInstanceType(\"loggingComponent\") },\n\t\t\t\t\tcreateConfig.options\n\t\t\t\t)\n\t\t\t);\n\t\tinstanceTypeName = nameofKebabCase(PassThroughPolicyRequester);\n\t}\n\n\treturn {\n\t\tcreateComponent: createComponent as (createConfig: typeof instanceConfig) => IComponent,\n\t\tinstanceTypeName,\n\t\tfactory: PolicyRequesterFactory\n\t};\n}\n"]}
|
|
@@ -1,9 +1,9 @@
|
|
|
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 { PolicyExecutionPointService } from "@twin.org/rights-management-pxp-service";
|
|
6
5
|
import { RightsManagementPxpComponentType } from "../models/types/rightsManagementPxpComponentType.js";
|
|
6
|
+
import { EngineTypeHelper } from "../utils/engineTypeHelper.js";
|
|
7
7
|
/**
|
|
8
8
|
* Initialise the rights management PXP component.
|
|
9
9
|
* @param engineCore The engine core.
|
|
@@ -11,32 +11,16 @@ import { RightsManagementPxpComponentType } from "../models/types/rightsManageme
|
|
|
11
11
|
* @param instanceConfig The instance config.
|
|
12
12
|
* @returns The instance created and the factory for it.
|
|
13
13
|
*/
|
|
14
|
-
export
|
|
15
|
-
let
|
|
16
|
-
let
|
|
14
|
+
export function initialiseRightsManagementPxpComponent(engineCore, context, instanceConfig) {
|
|
15
|
+
let createComponent;
|
|
16
|
+
let instanceTypeName;
|
|
17
17
|
if (instanceConfig.type === RightsManagementPxpComponentType.Service) {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
for (const moduleConfig of instanceConfig.options.actionModulesConfig) {
|
|
21
|
-
modules.push({
|
|
22
|
-
actionId: moduleConfig.id,
|
|
23
|
-
action: await EngineModuleHelper.loadComponent(engineCore, moduleConfig)
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
component = new PolicyExecutionPointService({
|
|
28
|
-
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
29
|
-
...instanceConfig.options,
|
|
30
|
-
config: {
|
|
31
|
-
...instanceConfig.options?.config,
|
|
32
|
-
actions: instanceConfig.options?.config?.actions ?? modules
|
|
33
|
-
}
|
|
34
|
-
});
|
|
35
|
-
instanceType = "policy-execution-point-service";
|
|
18
|
+
createComponent = (createConfig) => new PolicyExecutionPointService(EngineTypeHelper.mergeConfig({ loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent") }, createConfig.options));
|
|
19
|
+
instanceTypeName = "policy-execution-point-service";
|
|
36
20
|
}
|
|
37
21
|
return {
|
|
38
|
-
|
|
39
|
-
|
|
22
|
+
createComponent: createComponent,
|
|
23
|
+
instanceTypeName,
|
|
40
24
|
factory: ComponentFactory
|
|
41
25
|
};
|
|
42
26
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rightsManagementPxp.js","sourceRoot":"","sources":["../../../src/components/rightsManagementPxp.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,gBAAgB,
|
|
1
|
+
{"version":3,"file":"rightsManagementPxp.js","sourceRoot":"","sources":["../../../src/components/rightsManagementPxp.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,gBAAgB,EAAmB,MAAM,gBAAgB,CAAC;AAOnE,OAAO,EAAE,2BAA2B,EAAE,MAAM,yCAAyC,CAAC;AAGtF,OAAO,EAAE,gCAAgC,EAAE,MAAM,qDAAqD,CAAC;AACvG,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAEhE;;;;;;GAMG;AACH,MAAM,UAAU,sCAAsC,CACrD,UAAsC,EACtC,OAA0C,EAC1C,cAAkD;IAElD,IAAI,eAAe,CAAC;IACpB,IAAI,gBAAgB,CAAC;IAErB,IAAI,cAAc,CAAC,IAAI,KAAK,gCAAgC,CAAC,OAAO,EAAE,CAAC;QACtE,eAAe,GAAG,CAAC,YAAmC,EAAE,EAAE,CACzD,IAAI,2BAA2B,CAC9B,gBAAgB,CAAC,WAAW,CAC3B,EAAE,oBAAoB,EAAE,UAAU,CAAC,yBAAyB,CAAC,kBAAkB,CAAC,EAAE,EAClF,YAAY,CAAC,OAAO,CACpB,CACD,CAAC;QACH,gBAAgB,mCAA+C,CAAC;IACjE,CAAC;IAED,OAAO;QACN,eAAe,EAAE,eAAsE;QACvF,gBAAgB;QAChB,OAAO,EAAE,gBAAgB;KACzB,CAAC;AACH,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { ComponentFactory, type IComponent } from \"@twin.org/core\";\nimport type {\n\tEngineTypeInitialiserReturn,\n\tIEngineCore,\n\tIEngineCoreContext\n} from \"@twin.org/engine-models\";\nimport { nameofKebabCase } from \"@twin.org/nameof\";\nimport { PolicyExecutionPointService } from \"@twin.org/rights-management-pxp-service\";\nimport type { RightsManagementPxpComponentConfig } from \"../models/config/rightsManagementPxpComponentConfig.js\";\nimport type { IEngineConfig } from \"../models/IEngineConfig.js\";\nimport { RightsManagementPxpComponentType } from \"../models/types/rightsManagementPxpComponentType.js\";\nimport { EngineTypeHelper } from \"../utils/engineTypeHelper.js\";\n\n/**\n * Initialise the rights management PXP 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 function initialiseRightsManagementPxpComponent(\n\tengineCore: IEngineCore<IEngineConfig>,\n\tcontext: IEngineCoreContext<IEngineConfig>,\n\tinstanceConfig: RightsManagementPxpComponentConfig\n): EngineTypeInitialiserReturn<typeof instanceConfig, typeof ComponentFactory> {\n\tlet createComponent;\n\tlet instanceTypeName;\n\n\tif (instanceConfig.type === RightsManagementPxpComponentType.Service) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) =>\n\t\t\tnew PolicyExecutionPointService(\n\t\t\t\tEngineTypeHelper.mergeConfig<(typeof instanceConfig)[\"options\"]>(\n\t\t\t\t\t{ loggingComponentType: engineCore.getRegisteredInstanceType(\"loggingComponent\") },\n\t\t\t\t\tcreateConfig.options\n\t\t\t\t)\n\t\t\t);\n\t\tinstanceTypeName = nameofKebabCase(PolicyExecutionPointService);\n\t}\n\n\treturn {\n\t\tcreateComponent: createComponent as (createConfig: typeof instanceConfig) => IComponent,\n\t\tinstanceTypeName,\n\t\tfactory: ComponentFactory\n\t};\n}\n"]}
|