@twin.org/engine-types 0.0.3-next.5 → 0.0.3-next.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (214) hide show
  1. package/dist/es/components/backgroundTask.js +9 -11
  2. package/dist/es/components/backgroundTask.js.map +1 -1
  3. package/dist/es/components/dataSpaceConnector.js +1 -1
  4. package/dist/es/components/dataSpaceConnector.js.map +1 -1
  5. package/dist/es/components/federatedCatalogue.js +1 -5
  6. package/dist/es/components/federatedCatalogue.js.map +1 -1
  7. package/dist/es/components/federatedCatalogueFilter.js +31 -0
  8. package/dist/es/components/federatedCatalogueFilter.js.map +1 -0
  9. package/dist/es/components/immutableProof.js +1 -1
  10. package/dist/es/components/immutableProof.js.map +1 -1
  11. package/dist/es/components/rightsManagementDap.js +2 -4
  12. package/dist/es/components/rightsManagementDap.js.map +1 -1
  13. package/dist/es/components/rightsManagementDarp.js +1 -0
  14. package/dist/es/components/rightsManagementDarp.js.map +1 -1
  15. package/dist/es/components/rightsManagementDataAccessHandler.js +27 -0
  16. package/dist/es/components/rightsManagementDataAccessHandler.js.map +1 -0
  17. package/dist/es/components/rightsManagementPdp.js +2 -16
  18. package/dist/es/components/rightsManagementPdp.js.map +1 -1
  19. package/dist/es/components/rightsManagementPep.js +2 -16
  20. package/dist/es/components/rightsManagementPep.js.map +1 -1
  21. package/dist/es/components/rightsManagementPip.js +2 -16
  22. package/dist/es/components/rightsManagementPip.js.map +1 -1
  23. package/dist/es/components/rightsManagementPnp.js +3 -23
  24. package/dist/es/components/rightsManagementPnp.js.map +1 -1
  25. package/dist/es/components/rightsManagementPolicyArbiter.js +27 -0
  26. package/dist/es/components/rightsManagementPolicyArbiter.js.map +1 -0
  27. package/dist/es/components/rightsManagementPolicyEnforcementProcessor.js +27 -0
  28. package/dist/es/components/rightsManagementPolicyEnforcementProcessor.js.map +1 -0
  29. package/dist/es/components/rightsManagementPolicyExecutionAction.js +27 -0
  30. package/dist/es/components/rightsManagementPolicyExecutionAction.js.map +1 -0
  31. package/dist/es/components/rightsManagementPolicyInformationSource.js +35 -0
  32. package/dist/es/components/rightsManagementPolicyInformationSource.js.map +1 -0
  33. package/dist/es/components/rightsManagementPolicyNegotiator.js +27 -0
  34. package/dist/es/components/rightsManagementPolicyNegotiator.js.map +1 -0
  35. package/dist/es/components/rightsManagementPolicyRequester.js +27 -0
  36. package/dist/es/components/rightsManagementPolicyRequester.js.map +1 -0
  37. package/dist/es/components/rightsManagementPxp.js +2 -16
  38. package/dist/es/components/rightsManagementPxp.js.map +1 -1
  39. package/dist/es/components/synchronisedStorage.js +1 -1
  40. package/dist/es/components/synchronisedStorage.js.map +1 -1
  41. package/dist/es/components/trust.js +29 -0
  42. package/dist/es/components/trust.js.map +1 -0
  43. package/dist/es/components/trustGenerator.js +28 -0
  44. package/dist/es/components/trustGenerator.js.map +1 -0
  45. package/dist/es/components/trustVerifier.js +28 -0
  46. package/dist/es/components/trustVerifier.js.map +1 -0
  47. package/dist/es/index.js +35 -2
  48. package/dist/es/index.js.map +1 -1
  49. package/dist/es/models/IEngineConfig.js.map +1 -1
  50. package/dist/es/models/config/backgroundTaskComponentConfig.js +2 -0
  51. package/dist/es/models/config/backgroundTaskComponentConfig.js.map +1 -0
  52. package/dist/es/models/config/federatedCatalogueFilterComponentConfig.js +2 -0
  53. package/dist/es/models/config/federatedCatalogueFilterComponentConfig.js.map +1 -0
  54. package/dist/es/models/config/rightsManagementDarpComponentConfig.js.map +1 -1
  55. package/dist/es/models/config/rightsManagementDataAccessHandlerComponentConfig.js +2 -0
  56. package/dist/es/models/config/rightsManagementDataAccessHandlerComponentConfig.js.map +1 -0
  57. package/dist/es/models/config/rightsManagementPdpComponentConfig.js.map +1 -1
  58. package/dist/es/models/config/rightsManagementPepComponentConfig.js.map +1 -1
  59. package/dist/es/models/config/rightsManagementPipComponentConfig.js.map +1 -1
  60. package/dist/es/models/config/rightsManagementPnpComponentConfig.js.map +1 -1
  61. package/dist/es/models/config/rightsManagementPolicyArbiterComponentConfig.js +2 -0
  62. package/dist/es/models/config/rightsManagementPolicyArbiterComponentConfig.js.map +1 -0
  63. package/dist/es/models/config/rightsManagementPolicyEnforcementProcessorComponentConfig.js +2 -0
  64. package/dist/es/models/config/rightsManagementPolicyEnforcementProcessorComponentConfig.js.map +1 -0
  65. package/dist/es/models/config/rightsManagementPolicyExecutionActionComponentConfig.js +2 -0
  66. package/dist/es/models/config/rightsManagementPolicyExecutionActionComponentConfig.js.map +1 -0
  67. package/dist/es/models/config/rightsManagementPolicyInformationSourceComponentConfig.js +2 -0
  68. package/dist/es/models/config/rightsManagementPolicyInformationSourceComponentConfig.js.map +1 -0
  69. package/dist/es/models/config/rightsManagementPolicyNegotiatorComponentConfig.js +2 -0
  70. package/dist/es/models/config/rightsManagementPolicyNegotiatorComponentConfig.js.map +1 -0
  71. package/dist/es/models/config/rightsManagementPolicyRequesterComponentConfig.js +2 -0
  72. package/dist/es/models/config/rightsManagementPolicyRequesterComponentConfig.js.map +1 -0
  73. package/dist/es/models/config/rightsManagementPxpComponentConfig.js.map +1 -1
  74. package/dist/es/models/config/trustComponentConfig.js +2 -0
  75. package/dist/es/models/config/trustComponentConfig.js.map +1 -0
  76. package/dist/es/models/config/trustGeneratorComponentConfig.js +2 -0
  77. package/dist/es/models/config/trustGeneratorComponentConfig.js.map +1 -0
  78. package/dist/es/models/config/trustVerifierComponentConfig.js +2 -0
  79. package/dist/es/models/config/trustVerifierComponentConfig.js.map +1 -0
  80. package/dist/es/models/types/backgroundTaskComponentType.js +13 -0
  81. package/dist/es/models/types/backgroundTaskComponentType.js.map +1 -0
  82. package/dist/es/models/types/federatedCatalogueFilterComponentType.js +13 -0
  83. package/dist/es/models/types/federatedCatalogueFilterComponentType.js.map +1 -0
  84. package/dist/es/models/types/rightsManagementDataAccessHandlerComponentType.js +13 -0
  85. package/dist/es/models/types/rightsManagementDataAccessHandlerComponentType.js.map +1 -0
  86. package/dist/es/models/types/rightsManagementPolicyArbiterComponentType.js +13 -0
  87. package/dist/es/models/types/rightsManagementPolicyArbiterComponentType.js.map +1 -0
  88. package/dist/es/models/types/rightsManagementPolicyEnforcementProcessorComponentType.js +13 -0
  89. package/dist/es/models/types/rightsManagementPolicyEnforcementProcessorComponentType.js.map +1 -0
  90. package/dist/es/models/types/rightsManagementPolicyExecutionActionComponentType.js +13 -0
  91. package/dist/es/models/types/rightsManagementPolicyExecutionActionComponentType.js.map +1 -0
  92. package/dist/es/models/types/rightsManagementPolicyInformationSourceComponentType.js +17 -0
  93. package/dist/es/models/types/rightsManagementPolicyInformationSourceComponentType.js.map +1 -0
  94. package/dist/es/models/types/rightsManagementPolicyNegotiatorComponentType.js +13 -0
  95. package/dist/es/models/types/rightsManagementPolicyNegotiatorComponentType.js.map +1 -0
  96. package/dist/es/models/types/rightsManagementPolicyRequesterComponentType.js +13 -0
  97. package/dist/es/models/types/rightsManagementPolicyRequesterComponentType.js.map +1 -0
  98. package/dist/es/models/types/trustComponentType.js +13 -0
  99. package/dist/es/models/types/trustComponentType.js.map +1 -0
  100. package/dist/es/models/types/trustGeneratorComponentType.js +13 -0
  101. package/dist/es/models/types/trustGeneratorComponentType.js.map +1 -0
  102. package/dist/es/models/types/trustVerifierComponentType.js +13 -0
  103. package/dist/es/models/types/trustVerifierComponentType.js.map +1 -0
  104. package/dist/types/components/backgroundTask.d.ts +5 -6
  105. package/dist/types/components/federatedCatalogueFilter.d.ts +17 -0
  106. package/dist/types/components/rightsManagementDataAccessHandler.d.ts +17 -0
  107. package/dist/types/components/rightsManagementPolicyArbiter.d.ts +17 -0
  108. package/dist/types/components/rightsManagementPolicyEnforcementProcessor.d.ts +17 -0
  109. package/dist/types/components/rightsManagementPolicyExecutionAction.d.ts +17 -0
  110. package/dist/types/components/rightsManagementPolicyInformationSource.d.ts +17 -0
  111. package/dist/types/components/rightsManagementPolicyNegotiator.d.ts +17 -0
  112. package/dist/types/components/rightsManagementPolicyRequester.d.ts +17 -0
  113. package/dist/types/components/trust.d.ts +16 -0
  114. package/dist/types/components/trustGenerator.d.ts +17 -0
  115. package/dist/types/components/trustVerifier.d.ts +17 -0
  116. package/dist/types/index.d.ts +35 -2
  117. package/dist/types/models/IEngineConfig.d.ts +58 -3
  118. package/dist/types/models/config/backgroundTaskComponentConfig.d.ts +9 -0
  119. package/dist/types/models/config/federatedCatalogueFilterComponentConfig.d.ts +9 -0
  120. package/dist/types/models/config/rightsManagementDarpComponentConfig.d.ts +1 -4
  121. package/dist/types/models/config/rightsManagementDataAccessHandlerComponentConfig.d.ts +9 -0
  122. package/dist/types/models/config/rightsManagementPdpComponentConfig.d.ts +1 -4
  123. package/dist/types/models/config/rightsManagementPepComponentConfig.d.ts +1 -4
  124. package/dist/types/models/config/rightsManagementPipComponentConfig.d.ts +1 -4
  125. package/dist/types/models/config/rightsManagementPnpComponentConfig.d.ts +1 -5
  126. package/dist/types/models/config/rightsManagementPolicyArbiterComponentConfig.d.ts +9 -0
  127. package/dist/types/models/config/rightsManagementPolicyEnforcementProcessorComponentConfig.d.ts +9 -0
  128. package/dist/types/models/config/rightsManagementPolicyExecutionActionComponentConfig.d.ts +9 -0
  129. package/dist/types/models/config/rightsManagementPolicyInformationSourceComponentConfig.d.ts +12 -0
  130. package/dist/types/models/config/rightsManagementPolicyNegotiatorComponentConfig.d.ts +9 -0
  131. package/dist/types/models/config/rightsManagementPolicyRequesterComponentConfig.d.ts +9 -0
  132. package/dist/types/models/config/rightsManagementPxpComponentConfig.d.ts +1 -4
  133. package/dist/types/models/config/trustComponentConfig.d.ts +9 -0
  134. package/dist/types/models/config/trustGeneratorComponentConfig.d.ts +9 -0
  135. package/dist/types/models/config/trustVerifierComponentConfig.d.ts +9 -0
  136. package/dist/types/models/types/backgroundTaskComponentType.d.ts +13 -0
  137. package/dist/types/models/types/federatedCatalogueFilterComponentType.d.ts +13 -0
  138. package/dist/types/models/types/rightsManagementDataAccessHandlerComponentType.d.ts +13 -0
  139. package/dist/types/models/types/rightsManagementPolicyArbiterComponentType.d.ts +13 -0
  140. package/dist/types/models/types/rightsManagementPolicyEnforcementProcessorComponentType.d.ts +13 -0
  141. package/dist/types/models/types/rightsManagementPolicyExecutionActionComponentType.d.ts +13 -0
  142. package/dist/types/models/types/rightsManagementPolicyInformationSourceComponentType.d.ts +17 -0
  143. package/dist/types/models/types/rightsManagementPolicyNegotiatorComponentType.d.ts +13 -0
  144. package/dist/types/models/types/rightsManagementPolicyRequesterComponentType.d.ts +13 -0
  145. package/dist/types/models/types/trustComponentType.d.ts +13 -0
  146. package/dist/types/models/types/trustGeneratorComponentType.d.ts +13 -0
  147. package/dist/types/models/types/trustVerifierComponentType.d.ts +13 -0
  148. package/docs/changelog.md +30 -0
  149. package/docs/reference/functions/{initialiseBackgroundTaskConnector.md → initialiseBackgroundTaskComponent.md} +5 -5
  150. package/docs/reference/functions/initialiseFederatedCatalogueFilterComponent.md +31 -0
  151. package/docs/reference/functions/initialiseRightsManagementDataAccessHandlerComponent.md +31 -0
  152. package/docs/reference/functions/initialiseRightsManagementPolicyArbiterComponent.md +31 -0
  153. package/docs/reference/functions/initialiseRightsManagementPolicyEnforcementProcessorComponent.md +31 -0
  154. package/docs/reference/functions/initialiseRightsManagementPolicyExecutionActionComponent.md +31 -0
  155. package/docs/reference/functions/initialiseRightsManagementPolicyInformationSourceComponent.md +31 -0
  156. package/docs/reference/functions/initialiseRightsManagementPolicyNegotiatorComponent.md +31 -0
  157. package/docs/reference/functions/initialiseRightsManagementPolicyRequesterComponent.md +31 -0
  158. package/docs/reference/functions/initialiseTrustComponent.md +31 -0
  159. package/docs/reference/functions/initialiseTrustGeneratorComponent.md +31 -0
  160. package/docs/reference/functions/initialiseTrustVerifierComponent.md +31 -0
  161. package/docs/reference/index.md +48 -4
  162. package/docs/reference/interfaces/IEngineConfig.md +69 -3
  163. package/docs/reference/type-aliases/BackgroundTaskComponentConfig.md +17 -0
  164. package/docs/reference/type-aliases/BackgroundTaskComponentType.md +5 -0
  165. package/docs/reference/type-aliases/FederatedCatalogueFilterComponentConfig.md +17 -0
  166. package/docs/reference/type-aliases/FederatedCatalogueFilterComponentType.md +5 -0
  167. package/docs/reference/type-aliases/RightsManagementDarpComponentConfig.md +1 -7
  168. package/docs/reference/type-aliases/RightsManagementDataAccessHandlerComponentConfig.md +17 -0
  169. package/docs/reference/type-aliases/RightsManagementDataAccessHandlerComponentType.md +5 -0
  170. package/docs/reference/type-aliases/RightsManagementPdpComponentConfig.md +1 -7
  171. package/docs/reference/type-aliases/RightsManagementPepComponentConfig.md +1 -7
  172. package/docs/reference/type-aliases/RightsManagementPipComponentConfig.md +1 -7
  173. package/docs/reference/type-aliases/RightsManagementPnpComponentConfig.md +1 -1
  174. package/docs/reference/type-aliases/RightsManagementPolicyArbiterComponentConfig.md +17 -0
  175. package/docs/reference/type-aliases/RightsManagementPolicyArbiterComponentType.md +5 -0
  176. package/docs/reference/type-aliases/RightsManagementPolicyEnforcementProcessorComponentConfig.md +17 -0
  177. package/docs/reference/type-aliases/RightsManagementPolicyEnforcementProcessorComponentType.md +5 -0
  178. package/docs/reference/type-aliases/RightsManagementPolicyExecutionActionComponentConfig.md +17 -0
  179. package/docs/reference/type-aliases/RightsManagementPolicyExecutionActionComponentType.md +5 -0
  180. package/docs/reference/type-aliases/RightsManagementPolicyInformationSourceComponentConfig.md +5 -0
  181. package/docs/reference/type-aliases/RightsManagementPolicyInformationSourceComponentType.md +5 -0
  182. package/docs/reference/type-aliases/RightsManagementPolicyNegotiatorComponentConfig.md +17 -0
  183. package/docs/reference/type-aliases/RightsManagementPolicyNegotiatorComponentType.md +5 -0
  184. package/docs/reference/type-aliases/RightsManagementPolicyRequesterComponentConfig.md +17 -0
  185. package/docs/reference/type-aliases/RightsManagementPolicyRequesterComponentType.md +5 -0
  186. package/docs/reference/type-aliases/RightsManagementPxpComponentConfig.md +1 -7
  187. package/docs/reference/type-aliases/TrustComponentConfig.md +17 -0
  188. package/docs/reference/type-aliases/TrustComponentType.md +5 -0
  189. package/docs/reference/type-aliases/TrustGeneratorComponentConfig.md +17 -0
  190. package/docs/reference/type-aliases/TrustGeneratorComponentType.md +5 -0
  191. package/docs/reference/type-aliases/TrustVerifierComponentConfig.md +17 -0
  192. package/docs/reference/type-aliases/TrustVerifierComponentType.md +5 -0
  193. package/docs/reference/variables/BackgroundTaskComponentType.md +13 -0
  194. package/docs/reference/variables/FederatedCatalogueFilterComponentType.md +13 -0
  195. package/docs/reference/variables/RightsManagementDataAccessHandlerComponentType.md +13 -0
  196. package/docs/reference/variables/RightsManagementPolicyArbiterComponentType.md +13 -0
  197. package/docs/reference/variables/RightsManagementPolicyEnforcementProcessorComponentType.md +13 -0
  198. package/docs/reference/variables/RightsManagementPolicyExecutionActionComponentType.md +13 -0
  199. package/docs/reference/variables/RightsManagementPolicyInformationSourceComponentType.md +19 -0
  200. package/docs/reference/variables/RightsManagementPolicyNegotiatorComponentType.md +13 -0
  201. package/docs/reference/variables/RightsManagementPolicyRequesterComponentType.md +13 -0
  202. package/docs/reference/variables/TrustComponentType.md +13 -0
  203. package/docs/reference/variables/TrustGeneratorComponentType.md +13 -0
  204. package/docs/reference/variables/TrustVerifierComponentType.md +13 -0
  205. package/package.json +10 -4
  206. package/dist/es/models/config/backgroundTaskConnectorConfig.js +0 -2
  207. package/dist/es/models/config/backgroundTaskConnectorConfig.js.map +0 -1
  208. package/dist/es/models/types/backgroundTaskConnectorType.js +0 -13
  209. package/dist/es/models/types/backgroundTaskConnectorType.js.map +0 -1
  210. package/dist/types/models/config/backgroundTaskConnectorConfig.d.ts +0 -9
  211. package/dist/types/models/types/backgroundTaskConnectorType.d.ts +0 -13
  212. package/docs/reference/type-aliases/BackgroundTaskConnectorConfig.md +0 -17
  213. package/docs/reference/type-aliases/BackgroundTaskConnectorType.md +0 -5
  214. package/docs/reference/variables/BackgroundTaskConnectorType.md +0 -13
@@ -1,33 +1,31 @@
1
- // Copyright 2024 IOTA Stiftung.
2
- // SPDX-License-Identifier: Apache-2.0.
3
- import { EntityStorageBackgroundTaskConnector, initSchema } from "@twin.org/background-task-connector-entity-storage";
4
- import { BackgroundTaskConnectorFactory } from "@twin.org/background-task-models";
1
+ import { BackgroundTaskService, initSchema } from "@twin.org/background-task-service";
5
2
  import { ContextIdHelper, ContextIdKeys } from "@twin.org/context";
3
+ import { ComponentFactory } from "@twin.org/core";
6
4
  import { initialiseEntityStorageConnector } from "./entityStorage.js";
7
- import { BackgroundTaskConnectorType } from "../models/types/backgroundTaskConnectorType.js";
5
+ import { BackgroundTaskComponentType } from "../models/types/backgroundTaskComponentType.js";
8
6
  /**
9
- * Initialise a background task connector.
7
+ * Initialise a background task component.
10
8
  * @param engineCore The engine core.
11
9
  * @param context The context for the engine.
12
10
  * @param instanceConfig The instance config.
13
11
  * @returns The instance created and the factory for it.
14
12
  */
15
- export async function initialiseBackgroundTaskConnector(engineCore, context, instanceConfig) {
13
+ export async function initialiseBackgroundTaskComponent(engineCore, context, instanceConfig) {
16
14
  let component;
17
15
  let instanceType;
18
- if (instanceConfig.type === BackgroundTaskConnectorType.EntityStorage) {
16
+ if (instanceConfig.type === BackgroundTaskComponentType.Service) {
19
17
  initSchema();
20
18
  initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.backgroundTaskEntityStorageType, "BackgroundTask", ContextIdHelper.pickKeysFromAvailable(engineCore.getContextIdKeys(), [ContextIdKeys.Node]));
21
- component = new EntityStorageBackgroundTaskConnector({
19
+ component = new BackgroundTaskService({
22
20
  loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
23
21
  ...instanceConfig.options
24
22
  });
25
- instanceType = EntityStorageBackgroundTaskConnector.NAMESPACE;
23
+ instanceType = "background-task-service";
26
24
  }
27
25
  return {
28
26
  component,
29
27
  instanceType,
30
- factory: BackgroundTaskConnectorFactory
28
+ factory: ComponentFactory
31
29
  };
32
30
  }
33
31
  //# sourceMappingURL=backgroundTask.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"backgroundTask.js","sourceRoot":"","sources":["../../../src/components/backgroundTask.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EACN,oCAAoC,EACpC,UAAU,EAEV,MAAM,oDAAoD,CAAC;AAC5D,OAAO,EACN,8BAA8B,EAE9B,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAInE,OAAO,EAAE,gCAAgC,EAAE,MAAM,oBAAoB,CAAC;AAGtE,OAAO,EAAE,2BAA2B,EAAE,MAAM,gDAAgD,CAAC;AAE7F;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,iCAAiC,CACtD,UAAsC,EACtC,OAA0C,EAC1C,cAA6C;IAM7C,IAAI,SAA+C,CAAC;IACpD,IAAI,YAAgC,CAAC;IAErC,IAAI,cAAc,CAAC,IAAI,KAAK,2BAA2B,CAAC,aAAa,EAAE,CAAC;QACvE,UAAU,EAAE,CAAC;QACb,gCAAgC,CAC/B,UAAU,EACV,OAAO,EACP,cAAc,CAAC,OAAO,EAAE,+BAA+B,oBAEvD,eAAe,CAAC,qBAAqB,CAAC,UAAU,CAAC,gBAAgB,EAAE,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,CAC1F,CAAC;QACF,SAAS,GAAG,IAAI,oCAAoC,CAAC;YACpD,oBAAoB,EAAE,UAAU,CAAC,yBAAyB,CAAC,kBAAkB,CAAC;YAC9E,GAAG,cAAc,CAAC,OAAO;SACzB,CAAC,CAAC;QACH,YAAY,GAAG,oCAAoC,CAAC,SAAS,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 {\n\tEntityStorageBackgroundTaskConnector,\n\tinitSchema,\n\ttype BackgroundTask\n} from \"@twin.org/background-task-connector-entity-storage\";\nimport {\n\tBackgroundTaskConnectorFactory,\n\ttype IBackgroundTaskConnector\n} from \"@twin.org/background-task-models\";\nimport { ContextIdHelper, ContextIdKeys } from \"@twin.org/context\";\nimport type { IComponent } from \"@twin.org/core\";\nimport type { IEngineCore, IEngineCoreContext } from \"@twin.org/engine-models\";\nimport { nameof } from \"@twin.org/nameof\";\nimport { initialiseEntityStorageConnector } from \"./entityStorage.js\";\nimport type { BackgroundTaskConnectorConfig } from \"../models/config/backgroundTaskConnectorConfig.js\";\nimport type { IEngineConfig } from \"../models/IEngineConfig.js\";\nimport { BackgroundTaskConnectorType } from \"../models/types/backgroundTaskConnectorType.js\";\n\n/**\n * Initialise a background task connector.\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 initialiseBackgroundTaskConnector(\n\tengineCore: IEngineCore<IEngineConfig>,\n\tcontext: IEngineCoreContext<IEngineConfig>,\n\tinstanceConfig: BackgroundTaskConnectorConfig\n): Promise<{\n\tinstanceType?: string;\n\tfactory?: typeof BackgroundTaskConnectorFactory;\n\tcomponent?: IComponent;\n}> {\n\tlet component: IBackgroundTaskConnector | undefined;\n\tlet instanceType: string | undefined;\n\n\tif (instanceConfig.type === BackgroundTaskConnectorType.EntityStorage) {\n\t\tinitSchema();\n\t\tinitialiseEntityStorageConnector(\n\t\t\tengineCore,\n\t\t\tcontext,\n\t\t\tinstanceConfig.options?.backgroundTaskEntityStorageType,\n\t\t\tnameof<BackgroundTask>(),\n\t\t\tContextIdHelper.pickKeysFromAvailable(engineCore.getContextIdKeys(), [ContextIdKeys.Node])\n\t\t);\n\t\tcomponent = new EntityStorageBackgroundTaskConnector({\n\t\t\tloggingComponentType: engineCore.getRegisteredInstanceType(\"loggingComponent\"),\n\t\t\t...instanceConfig.options\n\t\t});\n\t\tinstanceType = EntityStorageBackgroundTaskConnector.NAMESPACE;\n\t}\n\n\treturn {\n\t\tcomponent,\n\t\tinstanceType,\n\t\tfactory: BackgroundTaskConnectorFactory\n\t};\n}\n"]}
1
+ {"version":3,"file":"backgroundTask.js","sourceRoot":"","sources":["../../../src/components/backgroundTask.ts"],"names":[],"mappings":"AAGA,OAAO,EACN,qBAAqB,EACrB,UAAU,EAEV,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAmB,MAAM,gBAAgB,CAAC;AAGnE,OAAO,EAAE,gCAAgC,EAAE,MAAM,oBAAoB,CAAC;AAGtE,OAAO,EAAE,2BAA2B,EAAE,MAAM,gDAAgD,CAAC;AAE7F;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,iCAAiC,CACtD,UAAsC,EACtC,OAA0C,EAC1C,cAA6C;IAM7C,IAAI,SAA+C,CAAC;IACpD,IAAI,YAAgC,CAAC;IAErC,IAAI,cAAc,CAAC,IAAI,KAAK,2BAA2B,CAAC,OAAO,EAAE,CAAC;QACjE,UAAU,EAAE,CAAC;QACb,gCAAgC,CAC/B,UAAU,EACV,OAAO,EACP,cAAc,CAAC,OAAO,EAAE,+BAA+B,oBAEvD,eAAe,CAAC,qBAAqB,CAAC,UAAU,CAAC,gBAAgB,EAAE,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,CAC1F,CAAC;QACF,SAAS,GAAG,IAAI,qBAAqB,CAAC;YACrC,oBAAoB,EAAE,UAAU,CAAC,yBAAyB,CAAC,kBAAkB,CAAC;YAC9E,GAAG,cAAc,CAAC,OAAO;SACzB,CAAC,CAAC;QACH,YAAY,4BAAyC,CAAC;IACvD,CAAC;IAED,OAAO;QACN,SAAS;QACT,YAAY;QACZ,OAAO,EAAE,gBAAgB;KACzB,CAAC;AACH,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IBackgroundTaskComponent } from \"@twin.org/background-task-models\";\nimport {\n\tBackgroundTaskService,\n\tinitSchema,\n\ttype BackgroundTask\n} from \"@twin.org/background-task-service\";\nimport { ContextIdHelper, ContextIdKeys } from \"@twin.org/context\";\nimport { ComponentFactory, type IComponent } from \"@twin.org/core\";\nimport type { IEngineCore, IEngineCoreContext } from \"@twin.org/engine-models\";\nimport { nameof, nameofKebabCase } from \"@twin.org/nameof\";\nimport { initialiseEntityStorageConnector } from \"./entityStorage.js\";\nimport type { BackgroundTaskComponentConfig } from \"../models/config/backgroundTaskComponentConfig.js\";\nimport type { IEngineConfig } from \"../models/IEngineConfig.js\";\nimport { BackgroundTaskComponentType } from \"../models/types/backgroundTaskComponentType.js\";\n\n/**\n * Initialise a background task component.\n * @param engineCore The engine core.\n * @param context The context for the engine.\n * @param instanceConfig The instance config.\n * @returns The instance created and the factory for it.\n */\nexport async function initialiseBackgroundTaskComponent(\n\tengineCore: IEngineCore<IEngineConfig>,\n\tcontext: IEngineCoreContext<IEngineConfig>,\n\tinstanceConfig: BackgroundTaskComponentConfig\n): Promise<{\n\tinstanceType?: string;\n\tfactory?: typeof ComponentFactory;\n\tcomponent?: IComponent;\n}> {\n\tlet component: IBackgroundTaskComponent | undefined;\n\tlet instanceType: string | undefined;\n\n\tif (instanceConfig.type === BackgroundTaskComponentType.Service) {\n\t\tinitSchema();\n\t\tinitialiseEntityStorageConnector(\n\t\t\tengineCore,\n\t\t\tcontext,\n\t\t\tinstanceConfig.options?.backgroundTaskEntityStorageType,\n\t\t\tnameof<BackgroundTask>(),\n\t\t\tContextIdHelper.pickKeysFromAvailable(engineCore.getContextIdKeys(), [ContextIdKeys.Node])\n\t\t);\n\t\tcomponent = new BackgroundTaskService({\n\t\t\tloggingComponentType: engineCore.getRegisteredInstanceType(\"loggingComponent\"),\n\t\t\t...instanceConfig.options\n\t\t});\n\t\tinstanceType = nameofKebabCase(BackgroundTaskService);\n\t}\n\n\treturn {\n\t\tcomponent,\n\t\tinstanceType,\n\t\tfactory: ComponentFactory\n\t};\n}\n"]}
@@ -24,7 +24,7 @@ export async function initialiseDataSpaceConnectorComponent(engineCore, context,
24
24
  initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.activityTaskEntityStorageType, "ActivityTask", partitionContextIds);
25
25
  component = new DataSpaceConnectorService({
26
26
  loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
27
- backgroundTaskConnectorType: engineCore.getRegisteredInstanceType("backgroundTaskConnector"),
27
+ backgroundTaskComponentType: engineCore.getRegisteredInstanceType("backgroundTaskComponent"),
28
28
  taskSchedulerComponentType: engineCore.getRegisteredInstanceType("taskSchedulerComponent"),
29
29
  federatedCatalogueComponentType: engineCore.getRegisteredInstanceType("federatedCatalogueComponent"),
30
30
  partitionContextIds,
@@ -1 +1 @@
1
- {"version":3,"file":"dataSpaceConnector.js","sourceRoot":"","sources":["../../../src/components/dataSpaceConnector.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAmB,MAAM,gBAAgB,CAAC;AAEnE,OAAO,EAAE,4BAA4B,EAAE,MAAM,4CAA4C,CAAC;AAC1F,OAAO,EAGN,yBAAyB,EACzB,UAAU,IAAI,4BAA4B,EAC1C,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAAE,8BAA8B,EAAE,MAAM,8CAA8C,CAAC;AAG9F,OAAO,EAAE,gCAAgC,EAAE,MAAM,oBAAoB,CAAC;AAGtE,OAAO,EAAE,+BAA+B,EAAE,MAAM,oDAAoD,CAAC;AAErG;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,qCAAqC,CAC1D,UAAsC,EACtC,OAA0C,EAC1C,cAAiD;IAMjD,IAAI,SAA0C,CAAC;IAC/C,IAAI,YAAgC,CAAC;IAErC,IAAI,cAAc,CAAC,IAAI,KAAK,+BAA+B,CAAC,OAAO,EAAE,CAAC;QACrE,4BAA4B,EAAE,CAAC;QAE/B,MAAM,mBAAmB,GAAG,eAAe,CAAC,qBAAqB,CAChE,UAAU,CAAC,gBAAgB,EAAE,EAC7B,CAAC,aAAa,CAAC,IAAI,EAAE,aAAa,CAAC,MAAM,CAAC,CAC1C,CAAC;QAEF,gCAAgC,CAC/B,UAAU,EACV,OAAO,EACP,cAAc,CAAC,OAAO,EAAE,4BAA4B,wBAEpD,mBAAmB,CACnB,CAAC;QACF,gCAAgC,CAC/B,UAAU,EACV,OAAO,EACP,cAAc,CAAC,OAAO,EAAE,6BAA6B,kBAErD,mBAAmB,CACnB,CAAC;QACF,SAAS,GAAG,IAAI,yBAAyB,CAAC;YACzC,oBAAoB,EAAE,UAAU,CAAC,yBAAyB,CAAC,kBAAkB,CAAC;YAC9E,2BAA2B,EAAE,UAAU,CAAC,yBAAyB,CAAC,yBAAyB,CAAC;YAC5F,0BAA0B,EAAE,UAAU,CAAC,yBAAyB,CAAC,wBAAwB,CAAC;YAC1F,+BAA+B,EAAE,UAAU,CAAC,yBAAyB,CACpE,6BAA6B,CAC7B;YACD,mBAAmB;YACnB,GAAG,cAAc,CAAC,OAAO;SACzB,CAAC,CAAC;QACH,YAAY,iCAA6C,CAAC;IAC3D,CAAC;SAAM,IAAI,cAAc,CAAC,IAAI,KAAK,+BAA+B,CAAC,UAAU,EAAE,CAAC;QAC/E,SAAS,GAAG,IAAI,4BAA4B,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;QACrE,YAAY,qCAAgD,CAAC;IAC9D,CAAC;SAAM,IAAI,cAAc,CAAC,IAAI,KAAK,+BAA+B,CAAC,YAAY,EAAE,CAAC;QACjF,SAAS,GAAG,IAAI,8BAA8B,CAAC;YAC9C,oBAAoB,EAAE,UAAU,CAAC,yBAAyB,CAAC,kBAAkB,CAAC;YAC9E,GAAG,cAAc,CAAC,OAAO;SACzB,CAAC,CAAC;QACH,YAAY,uCAAkD,CAAC;IAChE,CAAC;IAED,OAAO;QACN,SAAS;QACT,YAAY;QACZ,OAAO,EAAE,gBAAgB;KACzB,CAAC;AACH,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { ContextIdHelper, ContextIdKeys } from \"@twin.org/context\";\nimport { ComponentFactory, type IComponent } from \"@twin.org/core\";\nimport type { IDataSpaceConnector } from \"@twin.org/data-space-connector-models\";\nimport { DataSpaceConnectorRestClient } from \"@twin.org/data-space-connector-rest-client\";\nimport {\n\ttype ActivityLogDetails,\n\ttype ActivityTask,\n\tDataSpaceConnectorService,\n\tinitSchema as initSchemaDataSpaceConnector\n} from \"@twin.org/data-space-connector-service\";\nimport { DataSpaceConnectorSocketClient } from \"@twin.org/data-space-connector-socket-client\";\nimport type { IEngineCore, IEngineCoreContext } from \"@twin.org/engine-models\";\nimport { nameof, nameofKebabCase } from \"@twin.org/nameof\";\nimport { initialiseEntityStorageConnector } from \"./entityStorage.js\";\nimport type { DataSpaceConnectorComponentConfig } from \"../models/config/dataSpaceConnectorComponentConfig.js\";\nimport type { IEngineConfig } from \"../models/IEngineConfig.js\";\nimport { DataSpaceConnectorComponentType } from \"../models/types/dataSpaceConnectorComponentType.js\";\n\n/**\n * Initialise the data space connector component.\n * @param engineCore The engine core.\n * @param context The context for the engine.\n * @param instanceConfig The instance config.\n * @returns The instance created and the factory for it.\n */\nexport async function initialiseDataSpaceConnectorComponent(\n\tengineCore: IEngineCore<IEngineConfig>,\n\tcontext: IEngineCoreContext<IEngineConfig>,\n\tinstanceConfig: DataSpaceConnectorComponentConfig\n): Promise<{\n\tinstanceType?: string;\n\tfactory?: typeof ComponentFactory;\n\tcomponent?: IComponent;\n}> {\n\tlet component: IDataSpaceConnector | undefined;\n\tlet instanceType: string | undefined;\n\n\tif (instanceConfig.type === DataSpaceConnectorComponentType.Service) {\n\t\tinitSchemaDataSpaceConnector();\n\n\t\tconst partitionContextIds = ContextIdHelper.pickKeysFromAvailable(\n\t\t\tengineCore.getContextIdKeys(),\n\t\t\t[ContextIdKeys.Node, ContextIdKeys.Tenant]\n\t\t);\n\n\t\tinitialiseEntityStorageConnector(\n\t\t\tengineCore,\n\t\t\tcontext,\n\t\t\tinstanceConfig.options?.activityLogEntityStorageType,\n\t\t\tnameof<ActivityLogDetails>(),\n\t\t\tpartitionContextIds\n\t\t);\n\t\tinitialiseEntityStorageConnector(\n\t\t\tengineCore,\n\t\t\tcontext,\n\t\t\tinstanceConfig.options?.activityTaskEntityStorageType,\n\t\t\tnameof<ActivityTask>(),\n\t\t\tpartitionContextIds\n\t\t);\n\t\tcomponent = new DataSpaceConnectorService({\n\t\t\tloggingComponentType: engineCore.getRegisteredInstanceType(\"loggingComponent\"),\n\t\t\tbackgroundTaskConnectorType: engineCore.getRegisteredInstanceType(\"backgroundTaskConnector\"),\n\t\t\ttaskSchedulerComponentType: engineCore.getRegisteredInstanceType(\"taskSchedulerComponent\"),\n\t\t\tfederatedCatalogueComponentType: engineCore.getRegisteredInstanceType(\n\t\t\t\t\"federatedCatalogueComponent\"\n\t\t\t),\n\t\t\tpartitionContextIds,\n\t\t\t...instanceConfig.options\n\t\t});\n\t\tinstanceType = nameofKebabCase(DataSpaceConnectorService);\n\t} else if (instanceConfig.type === DataSpaceConnectorComponentType.RestClient) {\n\t\tcomponent = new DataSpaceConnectorRestClient(instanceConfig.options);\n\t\tinstanceType = nameofKebabCase(DataSpaceConnectorRestClient);\n\t} else if (instanceConfig.type === DataSpaceConnectorComponentType.SocketClient) {\n\t\tcomponent = new DataSpaceConnectorSocketClient({\n\t\t\tloggingComponentType: engineCore.getRegisteredInstanceType(\"loggingComponent\"),\n\t\t\t...instanceConfig.options\n\t\t});\n\t\tinstanceType = nameofKebabCase(DataSpaceConnectorSocketClient);\n\t}\n\n\treturn {\n\t\tcomponent,\n\t\tinstanceType,\n\t\tfactory: ComponentFactory\n\t};\n}\n"]}
1
+ {"version":3,"file":"dataSpaceConnector.js","sourceRoot":"","sources":["../../../src/components/dataSpaceConnector.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAmB,MAAM,gBAAgB,CAAC;AAEnE,OAAO,EAAE,4BAA4B,EAAE,MAAM,4CAA4C,CAAC;AAC1F,OAAO,EAGN,yBAAyB,EACzB,UAAU,IAAI,4BAA4B,EAC1C,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAAE,8BAA8B,EAAE,MAAM,8CAA8C,CAAC;AAG9F,OAAO,EAAE,gCAAgC,EAAE,MAAM,oBAAoB,CAAC;AAGtE,OAAO,EAAE,+BAA+B,EAAE,MAAM,oDAAoD,CAAC;AAErG;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,qCAAqC,CAC1D,UAAsC,EACtC,OAA0C,EAC1C,cAAiD;IAMjD,IAAI,SAA0C,CAAC;IAC/C,IAAI,YAAgC,CAAC;IAErC,IAAI,cAAc,CAAC,IAAI,KAAK,+BAA+B,CAAC,OAAO,EAAE,CAAC;QACrE,4BAA4B,EAAE,CAAC;QAE/B,MAAM,mBAAmB,GAAG,eAAe,CAAC,qBAAqB,CAChE,UAAU,CAAC,gBAAgB,EAAE,EAC7B,CAAC,aAAa,CAAC,IAAI,EAAE,aAAa,CAAC,MAAM,CAAC,CAC1C,CAAC;QAEF,gCAAgC,CAC/B,UAAU,EACV,OAAO,EACP,cAAc,CAAC,OAAO,EAAE,4BAA4B,wBAEpD,mBAAmB,CACnB,CAAC;QACF,gCAAgC,CAC/B,UAAU,EACV,OAAO,EACP,cAAc,CAAC,OAAO,EAAE,6BAA6B,kBAErD,mBAAmB,CACnB,CAAC;QACF,SAAS,GAAG,IAAI,yBAAyB,CAAC;YACzC,oBAAoB,EAAE,UAAU,CAAC,yBAAyB,CAAC,kBAAkB,CAAC;YAC9E,2BAA2B,EAAE,UAAU,CAAC,yBAAyB,CAAC,yBAAyB,CAAC;YAC5F,0BAA0B,EAAE,UAAU,CAAC,yBAAyB,CAAC,wBAAwB,CAAC;YAC1F,+BAA+B,EAAE,UAAU,CAAC,yBAAyB,CACpE,6BAA6B,CAC7B;YACD,mBAAmB;YACnB,GAAG,cAAc,CAAC,OAAO;SACzB,CAAC,CAAC;QACH,YAAY,iCAA6C,CAAC;IAC3D,CAAC;SAAM,IAAI,cAAc,CAAC,IAAI,KAAK,+BAA+B,CAAC,UAAU,EAAE,CAAC;QAC/E,SAAS,GAAG,IAAI,4BAA4B,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;QACrE,YAAY,qCAAgD,CAAC;IAC9D,CAAC;SAAM,IAAI,cAAc,CAAC,IAAI,KAAK,+BAA+B,CAAC,YAAY,EAAE,CAAC;QACjF,SAAS,GAAG,IAAI,8BAA8B,CAAC;YAC9C,oBAAoB,EAAE,UAAU,CAAC,yBAAyB,CAAC,kBAAkB,CAAC;YAC9E,GAAG,cAAc,CAAC,OAAO;SACzB,CAAC,CAAC;QACH,YAAY,uCAAkD,CAAC;IAChE,CAAC;IAED,OAAO;QACN,SAAS;QACT,YAAY;QACZ,OAAO,EAAE,gBAAgB;KACzB,CAAC;AACH,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { ContextIdHelper, ContextIdKeys } from \"@twin.org/context\";\nimport { ComponentFactory, type IComponent } from \"@twin.org/core\";\nimport type { IDataSpaceConnector } from \"@twin.org/data-space-connector-models\";\nimport { DataSpaceConnectorRestClient } from \"@twin.org/data-space-connector-rest-client\";\nimport {\n\ttype ActivityLogDetails,\n\ttype ActivityTask,\n\tDataSpaceConnectorService,\n\tinitSchema as initSchemaDataSpaceConnector\n} from \"@twin.org/data-space-connector-service\";\nimport { DataSpaceConnectorSocketClient } from \"@twin.org/data-space-connector-socket-client\";\nimport type { IEngineCore, IEngineCoreContext } from \"@twin.org/engine-models\";\nimport { nameof, nameofKebabCase } from \"@twin.org/nameof\";\nimport { initialiseEntityStorageConnector } from \"./entityStorage.js\";\nimport type { DataSpaceConnectorComponentConfig } from \"../models/config/dataSpaceConnectorComponentConfig.js\";\nimport type { IEngineConfig } from \"../models/IEngineConfig.js\";\nimport { DataSpaceConnectorComponentType } from \"../models/types/dataSpaceConnectorComponentType.js\";\n\n/**\n * Initialise the data space connector component.\n * @param engineCore The engine core.\n * @param context The context for the engine.\n * @param instanceConfig The instance config.\n * @returns The instance created and the factory for it.\n */\nexport async function initialiseDataSpaceConnectorComponent(\n\tengineCore: IEngineCore<IEngineConfig>,\n\tcontext: IEngineCoreContext<IEngineConfig>,\n\tinstanceConfig: DataSpaceConnectorComponentConfig\n): Promise<{\n\tinstanceType?: string;\n\tfactory?: typeof ComponentFactory;\n\tcomponent?: IComponent;\n}> {\n\tlet component: IDataSpaceConnector | undefined;\n\tlet instanceType: string | undefined;\n\n\tif (instanceConfig.type === DataSpaceConnectorComponentType.Service) {\n\t\tinitSchemaDataSpaceConnector();\n\n\t\tconst partitionContextIds = ContextIdHelper.pickKeysFromAvailable(\n\t\t\tengineCore.getContextIdKeys(),\n\t\t\t[ContextIdKeys.Node, ContextIdKeys.Tenant]\n\t\t);\n\n\t\tinitialiseEntityStorageConnector(\n\t\t\tengineCore,\n\t\t\tcontext,\n\t\t\tinstanceConfig.options?.activityLogEntityStorageType,\n\t\t\tnameof<ActivityLogDetails>(),\n\t\t\tpartitionContextIds\n\t\t);\n\t\tinitialiseEntityStorageConnector(\n\t\t\tengineCore,\n\t\t\tcontext,\n\t\t\tinstanceConfig.options?.activityTaskEntityStorageType,\n\t\t\tnameof<ActivityTask>(),\n\t\t\tpartitionContextIds\n\t\t);\n\t\tcomponent = new DataSpaceConnectorService({\n\t\t\tloggingComponentType: engineCore.getRegisteredInstanceType(\"loggingComponent\"),\n\t\t\tbackgroundTaskComponentType: engineCore.getRegisteredInstanceType(\"backgroundTaskComponent\"),\n\t\t\ttaskSchedulerComponentType: engineCore.getRegisteredInstanceType(\"taskSchedulerComponent\"),\n\t\t\tfederatedCatalogueComponentType: engineCore.getRegisteredInstanceType(\n\t\t\t\t\"federatedCatalogueComponent\"\n\t\t\t),\n\t\t\tpartitionContextIds,\n\t\t\t...instanceConfig.options\n\t\t});\n\t\tinstanceType = nameofKebabCase(DataSpaceConnectorService);\n\t} else if (instanceConfig.type === DataSpaceConnectorComponentType.RestClient) {\n\t\tcomponent = new DataSpaceConnectorRestClient(instanceConfig.options);\n\t\tinstanceType = nameofKebabCase(DataSpaceConnectorRestClient);\n\t} else if (instanceConfig.type === DataSpaceConnectorComponentType.SocketClient) {\n\t\tcomponent = new DataSpaceConnectorSocketClient({\n\t\t\tloggingComponentType: engineCore.getRegisteredInstanceType(\"loggingComponent\"),\n\t\t\t...instanceConfig.options\n\t\t});\n\t\tinstanceType = nameofKebabCase(DataSpaceConnectorSocketClient);\n\t}\n\n\treturn {\n\t\tcomponent,\n\t\tinstanceType,\n\t\tfactory: ComponentFactory\n\t};\n}\n"]}
@@ -18,13 +18,9 @@ export async function initialiseFederatedCatalogueComponent(engineCore, context,
18
18
  let instanceType;
19
19
  if (instanceConfig.type === FederatedCatalogueComponentType.Service) {
20
20
  initSchemaFederatedCatalogue();
21
- initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.dataResourceEntityStorageType, "DataResourceEntry", ContextIdHelper.pickKeysFromAvailable(engineCore.getContextIdKeys(), [ContextIdKeys.Node]));
22
- initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.participantEntityStorageType, "ParticipantEntry", ContextIdHelper.pickKeysFromAvailable(engineCore.getContextIdKeys(), [ContextIdKeys.Node]));
23
- initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.serviceOfferingEntityStorageType, "ServiceOfferingEntry", ContextIdHelper.pickKeysFromAvailable(engineCore.getContextIdKeys(), [ContextIdKeys.Node]));
24
- initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.dataSpaceConnectorStorageType, "DataSpaceConnectorEntry", ContextIdHelper.pickKeysFromAvailable(engineCore.getContextIdKeys(), [ContextIdKeys.Node]));
21
+ initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.datasetStorageConnectorType, "Dataset", ContextIdHelper.pickKeysFromAvailable(engineCore.getContextIdKeys(), [ContextIdKeys.Node]));
25
22
  component = new FederatedCatalogueService({
26
23
  loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
27
- identityResolverComponentType: engineCore.getRegisteredInstanceType("identityResolverComponent"),
28
24
  ...instanceConfig.options
29
25
  });
30
26
  instanceType = "federated-catalogue-service";
@@ -1 +1 @@
1
- {"version":3,"file":"federatedCatalogue.js","sourceRoot":"","sources":["../../../src/components/federatedCatalogue.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAmB,MAAM,gBAAgB,CAAC;AAGnE,OAAO,EAAE,4BAA4B,EAAE,MAAM,2CAA2C,CAAC;AACzF,OAAO,EAGN,yBAAyB,EACzB,UAAU,IAAI,4BAA4B,EAG1C,MAAM,uCAAuC,CAAC;AAE/C,OAAO,EAAE,gCAAgC,EAAE,MAAM,oBAAoB,CAAC;AAGtE,OAAO,EAAE,+BAA+B,EAAE,MAAM,oDAAoD,CAAC;AAErG;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,qCAAqC,CAC1D,UAAsC,EACtC,OAA0C,EAC1C,cAAiD;IAMjD,IAAI,SAAmD,CAAC;IACxD,IAAI,YAAgC,CAAC;IAErC,IAAI,cAAc,CAAC,IAAI,KAAK,+BAA+B,CAAC,OAAO,EAAE,CAAC;QACrE,4BAA4B,EAAE,CAAC;QAE/B,gCAAgC,CAC/B,UAAU,EACV,OAAO,EACP,cAAc,CAAC,OAAO,EAAE,6BAA6B,uBAErD,eAAe,CAAC,qBAAqB,CAAC,UAAU,CAAC,gBAAgB,EAAE,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,CAC1F,CAAC;QACF,gCAAgC,CAC/B,UAAU,EACV,OAAO,EACP,cAAc,CAAC,OAAO,EAAE,4BAA4B,sBAEpD,eAAe,CAAC,qBAAqB,CAAC,UAAU,CAAC,gBAAgB,EAAE,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,CAC1F,CAAC;QACF,gCAAgC,CAC/B,UAAU,EACV,OAAO,EACP,cAAc,CAAC,OAAO,EAAE,gCAAgC,0BAExD,eAAe,CAAC,qBAAqB,CAAC,UAAU,CAAC,gBAAgB,EAAE,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,CAC1F,CAAC;QACF,gCAAgC,CAC/B,UAAU,EACV,OAAO,EACP,cAAc,CAAC,OAAO,EAAE,6BAA6B,6BAErD,eAAe,CAAC,qBAAqB,CAAC,UAAU,CAAC,gBAAgB,EAAE,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,CAC1F,CAAC;QAEF,SAAS,GAAG,IAAI,yBAAyB,CAAC;YACzC,oBAAoB,EAAE,UAAU,CAAC,yBAAyB,CAAC,kBAAkB,CAAC;YAC9E,6BAA6B,EAAE,UAAU,CAAC,yBAAyB,CAClE,2BAA2B,CAC3B;YACD,GAAG,cAAc,CAAC,OAAO;SACzB,CAAC,CAAC;QACH,YAAY,gCAA6C,CAAC;IAC3D,CAAC;SAAM,IAAI,cAAc,CAAC,IAAI,KAAK,+BAA+B,CAAC,UAAU,EAAE,CAAC;QAC/E,SAAS,GAAG,IAAI,4BAA4B,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;QACrE,YAAY,oCAAgD,CAAC;IAC9D,CAAC;IAED,OAAO;QACN,SAAS;QACT,YAAY;QACZ,OAAO,EAAE,gBAAgB;KACzB,CAAC;AACH,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { ContextIdHelper, ContextIdKeys } from \"@twin.org/context\";\nimport { ComponentFactory, type IComponent } from \"@twin.org/core\";\nimport type { IEngineCore, IEngineCoreContext } from \"@twin.org/engine-models\";\nimport type { IFederatedCatalogueComponent } from \"@twin.org/federated-catalogue-models\";\nimport { FederatedCatalogueRestClient } from \"@twin.org/federated-catalogue-rest-client\";\nimport {\n\ttype DataResourceEntry,\n\ttype DataSpaceConnectorEntry,\n\tFederatedCatalogueService,\n\tinitSchema as initSchemaFederatedCatalogue,\n\ttype ParticipantEntry,\n\ttype ServiceOfferingEntry\n} from \"@twin.org/federated-catalogue-service\";\nimport { nameof, nameofKebabCase } from \"@twin.org/nameof\";\nimport { initialiseEntityStorageConnector } from \"./entityStorage.js\";\nimport type { FederatedCatalogueComponentConfig } from \"../models/config/federatedCatalogueComponentConfig.js\";\nimport type { IEngineConfig } from \"../models/IEngineConfig.js\";\nimport { FederatedCatalogueComponentType } from \"../models/types/federatedCatalogueComponentType.js\";\n\n/**\n * Initialise the federated catalogue component.\n * @param engineCore The engine core.\n * @param context The context for the engine.\n * @param instanceConfig The instance config.\n * @returns The instance created and the factory for it.\n */\nexport async function initialiseFederatedCatalogueComponent(\n\tengineCore: IEngineCore<IEngineConfig>,\n\tcontext: IEngineCoreContext<IEngineConfig>,\n\tinstanceConfig: FederatedCatalogueComponentConfig\n): Promise<{\n\tinstanceType?: string;\n\tfactory?: typeof ComponentFactory;\n\tcomponent?: IComponent;\n}> {\n\tlet component: IFederatedCatalogueComponent | undefined;\n\tlet instanceType: string | undefined;\n\n\tif (instanceConfig.type === FederatedCatalogueComponentType.Service) {\n\t\tinitSchemaFederatedCatalogue();\n\n\t\tinitialiseEntityStorageConnector(\n\t\t\tengineCore,\n\t\t\tcontext,\n\t\t\tinstanceConfig.options?.dataResourceEntityStorageType,\n\t\t\tnameof<DataResourceEntry>(),\n\t\t\tContextIdHelper.pickKeysFromAvailable(engineCore.getContextIdKeys(), [ContextIdKeys.Node])\n\t\t);\n\t\tinitialiseEntityStorageConnector(\n\t\t\tengineCore,\n\t\t\tcontext,\n\t\t\tinstanceConfig.options?.participantEntityStorageType,\n\t\t\tnameof<ParticipantEntry>(),\n\t\t\tContextIdHelper.pickKeysFromAvailable(engineCore.getContextIdKeys(), [ContextIdKeys.Node])\n\t\t);\n\t\tinitialiseEntityStorageConnector(\n\t\t\tengineCore,\n\t\t\tcontext,\n\t\t\tinstanceConfig.options?.serviceOfferingEntityStorageType,\n\t\t\tnameof<ServiceOfferingEntry>(),\n\t\t\tContextIdHelper.pickKeysFromAvailable(engineCore.getContextIdKeys(), [ContextIdKeys.Node])\n\t\t);\n\t\tinitialiseEntityStorageConnector(\n\t\t\tengineCore,\n\t\t\tcontext,\n\t\t\tinstanceConfig.options?.dataSpaceConnectorStorageType,\n\t\t\tnameof<DataSpaceConnectorEntry>(),\n\t\t\tContextIdHelper.pickKeysFromAvailable(engineCore.getContextIdKeys(), [ContextIdKeys.Node])\n\t\t);\n\n\t\tcomponent = new FederatedCatalogueService({\n\t\t\tloggingComponentType: engineCore.getRegisteredInstanceType(\"loggingComponent\"),\n\t\t\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(FederatedCatalogueService);\n\t} else if (instanceConfig.type === FederatedCatalogueComponentType.RestClient) {\n\t\tcomponent = new FederatedCatalogueRestClient(instanceConfig.options);\n\t\tinstanceType = nameofKebabCase(FederatedCatalogueRestClient);\n\t}\n\n\treturn {\n\t\tcomponent,\n\t\tinstanceType,\n\t\tfactory: ComponentFactory\n\t};\n}\n"]}
1
+ {"version":3,"file":"federatedCatalogue.js","sourceRoot":"","sources":["../../../src/components/federatedCatalogue.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAmB,MAAM,gBAAgB,CAAC;AAGnE,OAAO,EAAE,4BAA4B,EAAE,MAAM,2CAA2C,CAAC;AACzF,OAAO,EAEN,yBAAyB,EACzB,UAAU,IAAI,4BAA4B,EAC1C,MAAM,uCAAuC,CAAC;AAE/C,OAAO,EAAE,gCAAgC,EAAE,MAAM,oBAAoB,CAAC;AAGtE,OAAO,EAAE,+BAA+B,EAAE,MAAM,oDAAoD,CAAC;AAErG;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,qCAAqC,CAC1D,UAAsC,EACtC,OAA0C,EAC1C,cAAiD;IAMjD,IAAI,SAAmD,CAAC;IACxD,IAAI,YAAgC,CAAC;IAErC,IAAI,cAAc,CAAC,IAAI,KAAK,+BAA+B,CAAC,OAAO,EAAE,CAAC;QACrE,4BAA4B,EAAE,CAAC;QAE/B,gCAAgC,CAC/B,UAAU,EACV,OAAO,EACP,cAAc,CAAC,OAAO,EAAE,2BAA2B,aAEnD,eAAe,CAAC,qBAAqB,CAAC,UAAU,CAAC,gBAAgB,EAAE,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,CAC1F,CAAC;QAEF,SAAS,GAAG,IAAI,yBAAyB,CAAC;YACzC,oBAAoB,EAAE,UAAU,CAAC,yBAAyB,CAAC,kBAAkB,CAAC;YAC9E,GAAG,cAAc,CAAC,OAAO;SACzB,CAAC,CAAC;QACH,YAAY,gCAA6C,CAAC;IAC3D,CAAC;SAAM,IAAI,cAAc,CAAC,IAAI,KAAK,+BAA+B,CAAC,UAAU,EAAE,CAAC;QAC/E,SAAS,GAAG,IAAI,4BAA4B,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;QACrE,YAAY,oCAAgD,CAAC;IAC9D,CAAC;IAED,OAAO;QACN,SAAS;QACT,YAAY;QAEZ,OAAO,EAAE,gBAAgB;KACzB,CAAC;AACH,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { ContextIdHelper, ContextIdKeys } from \"@twin.org/context\";\nimport { ComponentFactory, type IComponent } from \"@twin.org/core\";\nimport type { IEngineCore, IEngineCoreContext } from \"@twin.org/engine-models\";\nimport type { IFederatedCatalogueComponent } from \"@twin.org/federated-catalogue-models\";\nimport { FederatedCatalogueRestClient } from \"@twin.org/federated-catalogue-rest-client\";\nimport {\n\ttype Dataset,\n\tFederatedCatalogueService,\n\tinitSchema as initSchemaFederatedCatalogue\n} from \"@twin.org/federated-catalogue-service\";\nimport { nameof, nameofKebabCase } from \"@twin.org/nameof\";\nimport { initialiseEntityStorageConnector } from \"./entityStorage.js\";\nimport type { FederatedCatalogueComponentConfig } from \"../models/config/federatedCatalogueComponentConfig.js\";\nimport type { IEngineConfig } from \"../models/IEngineConfig.js\";\nimport { FederatedCatalogueComponentType } from \"../models/types/federatedCatalogueComponentType.js\";\n\n/**\n * Initialise the federated catalogue component.\n * @param engineCore The engine core.\n * @param context The context for the engine.\n * @param instanceConfig The instance config.\n * @returns The instance created and the factory for it.\n */\nexport async function initialiseFederatedCatalogueComponent(\n\tengineCore: IEngineCore<IEngineConfig>,\n\tcontext: IEngineCoreContext<IEngineConfig>,\n\tinstanceConfig: FederatedCatalogueComponentConfig\n): Promise<{\n\tinstanceType?: string;\n\tfactory?: typeof ComponentFactory;\n\tcomponent?: IComponent;\n}> {\n\tlet component: IFederatedCatalogueComponent | undefined;\n\tlet instanceType: string | undefined;\n\n\tif (instanceConfig.type === FederatedCatalogueComponentType.Service) {\n\t\tinitSchemaFederatedCatalogue();\n\n\t\tinitialiseEntityStorageConnector(\n\t\t\tengineCore,\n\t\t\tcontext,\n\t\t\tinstanceConfig.options?.datasetStorageConnectorType,\n\t\t\tnameof<Dataset>(),\n\t\t\tContextIdHelper.pickKeysFromAvailable(engineCore.getContextIdKeys(), [ContextIdKeys.Node])\n\t\t);\n\n\t\tcomponent = new FederatedCatalogueService({\n\t\t\tloggingComponentType: engineCore.getRegisteredInstanceType(\"loggingComponent\"),\n\t\t\t...instanceConfig.options\n\t\t});\n\t\tinstanceType = nameofKebabCase(FederatedCatalogueService);\n\t} else if (instanceConfig.type === FederatedCatalogueComponentType.RestClient) {\n\t\tcomponent = new FederatedCatalogueRestClient(instanceConfig.options);\n\t\tinstanceType = nameofKebabCase(FederatedCatalogueRestClient);\n\t}\n\n\treturn {\n\t\tcomponent,\n\t\tinstanceType,\n\n\t\tfactory: ComponentFactory\n\t};\n}\n"]}
@@ -0,0 +1,31 @@
1
+ // Copyright 2024 IOTA Stiftung.
2
+ // SPDX-License-Identifier: Apache-2.0.
3
+ import { ContextIdHelper, ContextIdKeys } from "@twin.org/context";
4
+ import { FilterByExample } from "@twin.org/federated-catalogue-filters";
5
+ import { FederatedCatalogueFilterFactory } from "@twin.org/federated-catalogue-models";
6
+ import { initSchema as initSchemaFederatedCatalogue } from "@twin.org/federated-catalogue-service";
7
+ import { initialiseEntityStorageConnector } from "./entityStorage.js";
8
+ import { FederatedCatalogueFilterComponentType } from "../models/types/federatedCatalogueFilterComponentType.js";
9
+ /**
10
+ * Initialise the federated catalogue filter component.
11
+ * @param engineCore The engine core.
12
+ * @param context The context for the engine.
13
+ * @param instanceConfig The instance config.
14
+ * @returns The instance created and the factory for it.
15
+ */
16
+ export async function initialiseFederatedCatalogueFilterComponent(engineCore, context, instanceConfig) {
17
+ let component;
18
+ let instanceType;
19
+ if (instanceConfig.type === FederatedCatalogueFilterComponentType.FilterByExample) {
20
+ initSchemaFederatedCatalogue();
21
+ initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.datasetStorageConnectorType, "Dataset", ContextIdHelper.pickKeysFromAvailable(engineCore.getContextIdKeys(), [ContextIdKeys.Node]));
22
+ component = new FilterByExample(instanceConfig.options);
23
+ instanceType = "FilterByExample";
24
+ }
25
+ return {
26
+ component,
27
+ instanceType,
28
+ factory: FederatedCatalogueFilterFactory
29
+ };
30
+ }
31
+ //# sourceMappingURL=federatedCatalogueFilter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"federatedCatalogueFilter.js","sourceRoot":"","sources":["../../../src/components/federatedCatalogueFilter.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAGnE,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AACxE,OAAO,EACN,+BAA+B,EAE/B,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAEN,UAAU,IAAI,4BAA4B,EAC1C,MAAM,uCAAuC,CAAC;AAE/C,OAAO,EAAE,gCAAgC,EAAE,MAAM,oBAAoB,CAAC;AAGtE,OAAO,EAAE,qCAAqC,EAAE,MAAM,0DAA0D,CAAC;AAEjH;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,2CAA2C,CAChE,UAAsC,EACtC,OAA0C,EAC1C,cAAuD;IAMvD,IAAI,SAAgD,CAAC;IACrD,IAAI,YAAgC,CAAC;IAErC,IAAI,cAAc,CAAC,IAAI,KAAK,qCAAqC,CAAC,eAAe,EAAE,CAAC;QACnF,4BAA4B,EAAE,CAAC;QAE/B,gCAAgC,CAC/B,UAAU,EACV,OAAO,EACP,cAAc,CAAC,OAAO,EAAE,2BAA2B,aAEnD,eAAe,CAAC,qBAAqB,CAAC,UAAU,CAAC,gBAAgB,EAAE,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,CAC1F,CAAC;QAEF,SAAS,GAAG,IAAI,eAAe,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;QACxD,YAAY,oBAA0B,CAAC;IACxC,CAAC;IAED,OAAO;QACN,SAAS;QACT,YAAY;QACZ,OAAO,EAAE,+BAA+B;KACxC,CAAC;AACH,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { ContextIdHelper, ContextIdKeys } from \"@twin.org/context\";\nimport type { IComponent } from \"@twin.org/core\";\nimport type { IEngineCore, IEngineCoreContext } from \"@twin.org/engine-models\";\nimport { FilterByExample } from \"@twin.org/federated-catalogue-filters\";\nimport {\n\tFederatedCatalogueFilterFactory,\n\ttype IFederatedCatalogueFilter\n} from \"@twin.org/federated-catalogue-models\";\nimport {\n\ttype Dataset,\n\tinitSchema as initSchemaFederatedCatalogue\n} from \"@twin.org/federated-catalogue-service\";\nimport { nameof } from \"@twin.org/nameof\";\nimport { initialiseEntityStorageConnector } from \"./entityStorage.js\";\nimport type { FederatedCatalogueFilterComponentConfig } from \"../models/config/federatedCatalogueFilterComponentConfig.js\";\nimport type { IEngineConfig } from \"../models/IEngineConfig.js\";\nimport { FederatedCatalogueFilterComponentType } from \"../models/types/federatedCatalogueFilterComponentType.js\";\n\n/**\n * Initialise the federated catalogue filter component.\n * @param engineCore The engine core.\n * @param context The context for the engine.\n * @param instanceConfig The instance config.\n * @returns The instance created and the factory for it.\n */\nexport async function initialiseFederatedCatalogueFilterComponent(\n\tengineCore: IEngineCore<IEngineConfig>,\n\tcontext: IEngineCoreContext<IEngineConfig>,\n\tinstanceConfig: FederatedCatalogueFilterComponentConfig\n): Promise<{\n\tinstanceType?: string;\n\tfactory?: typeof FederatedCatalogueFilterFactory;\n\tcomponent?: IComponent;\n}> {\n\tlet component: IFederatedCatalogueFilter | undefined;\n\tlet instanceType: string | undefined;\n\n\tif (instanceConfig.type === FederatedCatalogueFilterComponentType.FilterByExample) {\n\t\tinitSchemaFederatedCatalogue();\n\n\t\tinitialiseEntityStorageConnector(\n\t\t\tengineCore,\n\t\t\tcontext,\n\t\t\tinstanceConfig.options?.datasetStorageConnectorType,\n\t\t\tnameof<Dataset>(),\n\t\t\tContextIdHelper.pickKeysFromAvailable(engineCore.getContextIdKeys(), [ContextIdKeys.Node])\n\t\t);\n\n\t\tcomponent = new FilterByExample(instanceConfig.options);\n\t\tinstanceType = nameof(FilterByExample);\n\t}\n\n\treturn {\n\t\tcomponent,\n\t\tinstanceType,\n\t\tfactory: FederatedCatalogueFilterFactory\n\t};\n}\n"]}
@@ -25,7 +25,7 @@ export async function initialiseImmutableProofComponent(engineCore, context, ins
25
25
  component = new ImmutableProofService({
26
26
  verifiableStorageType: engineCore.getRegisteredInstanceType("verifiableStorageConnector"),
27
27
  identityConnectorType: engineCore.getRegisteredInstanceType("identityConnector"),
28
- backgroundTaskConnectorType: engineCore.getRegisteredInstanceType("backgroundTaskConnector"),
28
+ backgroundTaskComponentType: engineCore.getRegisteredInstanceType("backgroundTaskComponent"),
29
29
  eventBusComponentType: engineCore.getRegisteredInstanceTypeOptional("eventBusComponent"),
30
30
  ...instanceConfig.options
31
31
  });
@@ -1 +1 @@
1
- {"version":3,"file":"immutableProof.js","sourceRoot":"","sources":["../../../src/components/immutableProof.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAmB,MAAM,gBAAgB,CAAC;AAGnE,OAAO,EAAE,wBAAwB,EAAE,MAAM,uCAAuC,CAAC;AACjF,OAAO,EAEN,qBAAqB,EACrB,UAAU,IAAI,wBAAwB,EACtC,MAAM,mCAAmC,CAAC;AAE3C,OAAO,EAAE,gCAAgC,EAAE,MAAM,oBAAoB,CAAC;AAGtE,OAAO,EAAE,2BAA2B,EAAE,MAAM,gDAAgD,CAAC;AAE7F;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,iCAAiC,CACtD,UAAsC,EACtC,OAA0C,EAC1C,cAA6C;IAM7C,IAAI,SAA+C,CAAC;IACpD,IAAI,YAAgC,CAAC;IAErC,IAAI,cAAc,CAAC,IAAI,KAAK,2BAA2B,CAAC,OAAO,EAAE,CAAC;QACjE,wBAAwB,EAAE,CAAC;QAE3B,gCAAgC,CAC/B,UAAU,EACV,OAAO,EACP,cAAc,CAAC,OAAO,EAAE,+BAA+B,oBAEvD,eAAe,CAAC,qBAAqB,CAAC,UAAU,CAAC,gBAAgB,EAAE,EAAE;YACpE,aAAa,CAAC,IAAI;YAClB,aAAa,CAAC,MAAM;SACpB,CAAC,CACF,CAAC;QAEF,SAAS,GAAG,IAAI,qBAAqB,CAAC;YACrC,qBAAqB,EAAE,UAAU,CAAC,yBAAyB,CAAC,4BAA4B,CAAC;YACzF,qBAAqB,EAAE,UAAU,CAAC,yBAAyB,CAAC,mBAAmB,CAAC;YAChF,2BAA2B,EAAE,UAAU,CAAC,yBAAyB,CAAC,yBAAyB,CAAC;YAC5F,qBAAqB,EAAE,UAAU,CAAC,iCAAiC,CAAC,mBAAmB,CAAC;YACxF,GAAG,cAAc,CAAC,OAAO;SACzB,CAAC,CAAC;QACH,YAAY,4BAAyC,CAAC;IACvD,CAAC;SAAM,IAAI,cAAc,CAAC,IAAI,KAAK,2BAA2B,CAAC,UAAU,EAAE,CAAC;QAC3E,SAAS,GAAG,IAAI,wBAAwB,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;QACjE,YAAY,gCAA4C,CAAC;IAC1D,CAAC;IAED,OAAO;QACN,SAAS;QACT,YAAY;QACZ,OAAO,EAAE,gBAAgB;KACzB,CAAC;AACH,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { ContextIdHelper, ContextIdKeys } from \"@twin.org/context\";\nimport { ComponentFactory, type IComponent } from \"@twin.org/core\";\nimport type { IEngineCore, IEngineCoreContext } from \"@twin.org/engine-models\";\nimport type { IImmutableProofComponent } from \"@twin.org/immutable-proof-models\";\nimport { ImmutableProofRestClient } from \"@twin.org/immutable-proof-rest-client\";\nimport {\n\ttype ImmutableProof,\n\tImmutableProofService,\n\tinitSchema as initSchemaImmutableProof\n} from \"@twin.org/immutable-proof-service\";\nimport { nameof, nameofKebabCase } from \"@twin.org/nameof\";\nimport { initialiseEntityStorageConnector } from \"./entityStorage.js\";\nimport type { ImmutableProofComponentConfig } from \"../models/config/immutableProofComponentConfig.js\";\nimport type { IEngineConfig } from \"../models/IEngineConfig.js\";\nimport { ImmutableProofComponentType } from \"../models/types/immutableProofComponentType.js\";\n\n/**\n * Initialise the immutable proof component.\n * @param engineCore The engine core.\n * @param context The context for the engine.\n * @param instanceConfig The instance config.\n * @returns The instance created and the factory for it.\n */\nexport async function initialiseImmutableProofComponent(\n\tengineCore: IEngineCore<IEngineConfig>,\n\tcontext: IEngineCoreContext<IEngineConfig>,\n\tinstanceConfig: ImmutableProofComponentConfig\n): Promise<{\n\tinstanceType?: string;\n\tfactory?: typeof ComponentFactory;\n\tcomponent?: IComponent;\n}> {\n\tlet component: IImmutableProofComponent | undefined;\n\tlet instanceType: string | undefined;\n\n\tif (instanceConfig.type === ImmutableProofComponentType.Service) {\n\t\tinitSchemaImmutableProof();\n\n\t\tinitialiseEntityStorageConnector(\n\t\t\tengineCore,\n\t\t\tcontext,\n\t\t\tinstanceConfig.options?.immutableProofEntityStorageType,\n\t\t\tnameof<ImmutableProof>(),\n\t\t\tContextIdHelper.pickKeysFromAvailable(engineCore.getContextIdKeys(), [\n\t\t\t\tContextIdKeys.Node,\n\t\t\t\tContextIdKeys.Tenant\n\t\t\t])\n\t\t);\n\n\t\tcomponent = new ImmutableProofService({\n\t\t\tverifiableStorageType: engineCore.getRegisteredInstanceType(\"verifiableStorageConnector\"),\n\t\t\tidentityConnectorType: engineCore.getRegisteredInstanceType(\"identityConnector\"),\n\t\t\tbackgroundTaskConnectorType: engineCore.getRegisteredInstanceType(\"backgroundTaskConnector\"),\n\t\t\teventBusComponentType: engineCore.getRegisteredInstanceTypeOptional(\"eventBusComponent\"),\n\t\t\t...instanceConfig.options\n\t\t});\n\t\tinstanceType = nameofKebabCase(ImmutableProofService);\n\t} else if (instanceConfig.type === ImmutableProofComponentType.RestClient) {\n\t\tcomponent = new ImmutableProofRestClient(instanceConfig.options);\n\t\tinstanceType = nameofKebabCase(ImmutableProofRestClient);\n\t}\n\n\treturn {\n\t\tcomponent,\n\t\tinstanceType,\n\t\tfactory: ComponentFactory\n\t};\n}\n"]}
1
+ {"version":3,"file":"immutableProof.js","sourceRoot":"","sources":["../../../src/components/immutableProof.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAmB,MAAM,gBAAgB,CAAC;AAGnE,OAAO,EAAE,wBAAwB,EAAE,MAAM,uCAAuC,CAAC;AACjF,OAAO,EAEN,qBAAqB,EACrB,UAAU,IAAI,wBAAwB,EACtC,MAAM,mCAAmC,CAAC;AAE3C,OAAO,EAAE,gCAAgC,EAAE,MAAM,oBAAoB,CAAC;AAGtE,OAAO,EAAE,2BAA2B,EAAE,MAAM,gDAAgD,CAAC;AAE7F;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,iCAAiC,CACtD,UAAsC,EACtC,OAA0C,EAC1C,cAA6C;IAM7C,IAAI,SAA+C,CAAC;IACpD,IAAI,YAAgC,CAAC;IAErC,IAAI,cAAc,CAAC,IAAI,KAAK,2BAA2B,CAAC,OAAO,EAAE,CAAC;QACjE,wBAAwB,EAAE,CAAC;QAE3B,gCAAgC,CAC/B,UAAU,EACV,OAAO,EACP,cAAc,CAAC,OAAO,EAAE,+BAA+B,oBAEvD,eAAe,CAAC,qBAAqB,CAAC,UAAU,CAAC,gBAAgB,EAAE,EAAE;YACpE,aAAa,CAAC,IAAI;YAClB,aAAa,CAAC,MAAM;SACpB,CAAC,CACF,CAAC;QAEF,SAAS,GAAG,IAAI,qBAAqB,CAAC;YACrC,qBAAqB,EAAE,UAAU,CAAC,yBAAyB,CAAC,4BAA4B,CAAC;YACzF,qBAAqB,EAAE,UAAU,CAAC,yBAAyB,CAAC,mBAAmB,CAAC;YAChF,2BAA2B,EAAE,UAAU,CAAC,yBAAyB,CAAC,yBAAyB,CAAC;YAC5F,qBAAqB,EAAE,UAAU,CAAC,iCAAiC,CAAC,mBAAmB,CAAC;YACxF,GAAG,cAAc,CAAC,OAAO;SACzB,CAAC,CAAC;QACH,YAAY,4BAAyC,CAAC;IACvD,CAAC;SAAM,IAAI,cAAc,CAAC,IAAI,KAAK,2BAA2B,CAAC,UAAU,EAAE,CAAC;QAC3E,SAAS,GAAG,IAAI,wBAAwB,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;QACjE,YAAY,gCAA4C,CAAC;IAC1D,CAAC;IAED,OAAO;QACN,SAAS;QACT,YAAY;QACZ,OAAO,EAAE,gBAAgB;KACzB,CAAC;AACH,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { ContextIdHelper, ContextIdKeys } from \"@twin.org/context\";\nimport { ComponentFactory, type IComponent } from \"@twin.org/core\";\nimport type { IEngineCore, IEngineCoreContext } from \"@twin.org/engine-models\";\nimport type { IImmutableProofComponent } from \"@twin.org/immutable-proof-models\";\nimport { ImmutableProofRestClient } from \"@twin.org/immutable-proof-rest-client\";\nimport {\n\ttype ImmutableProof,\n\tImmutableProofService,\n\tinitSchema as initSchemaImmutableProof\n} from \"@twin.org/immutable-proof-service\";\nimport { nameof, nameofKebabCase } from \"@twin.org/nameof\";\nimport { initialiseEntityStorageConnector } from \"./entityStorage.js\";\nimport type { ImmutableProofComponentConfig } from \"../models/config/immutableProofComponentConfig.js\";\nimport type { IEngineConfig } from \"../models/IEngineConfig.js\";\nimport { ImmutableProofComponentType } from \"../models/types/immutableProofComponentType.js\";\n\n/**\n * Initialise the immutable proof component.\n * @param engineCore The engine core.\n * @param context The context for the engine.\n * @param instanceConfig The instance config.\n * @returns The instance created and the factory for it.\n */\nexport async function initialiseImmutableProofComponent(\n\tengineCore: IEngineCore<IEngineConfig>,\n\tcontext: IEngineCoreContext<IEngineConfig>,\n\tinstanceConfig: ImmutableProofComponentConfig\n): Promise<{\n\tinstanceType?: string;\n\tfactory?: typeof ComponentFactory;\n\tcomponent?: IComponent;\n}> {\n\tlet component: IImmutableProofComponent | undefined;\n\tlet instanceType: string | undefined;\n\n\tif (instanceConfig.type === ImmutableProofComponentType.Service) {\n\t\tinitSchemaImmutableProof();\n\n\t\tinitialiseEntityStorageConnector(\n\t\t\tengineCore,\n\t\t\tcontext,\n\t\t\tinstanceConfig.options?.immutableProofEntityStorageType,\n\t\t\tnameof<ImmutableProof>(),\n\t\t\tContextIdHelper.pickKeysFromAvailable(engineCore.getContextIdKeys(), [\n\t\t\t\tContextIdKeys.Node,\n\t\t\t\tContextIdKeys.Tenant\n\t\t\t])\n\t\t);\n\n\t\tcomponent = new ImmutableProofService({\n\t\t\tverifiableStorageType: engineCore.getRegisteredInstanceType(\"verifiableStorageConnector\"),\n\t\t\tidentityConnectorType: engineCore.getRegisteredInstanceType(\"identityConnector\"),\n\t\t\tbackgroundTaskComponentType: engineCore.getRegisteredInstanceType(\"backgroundTaskComponent\"),\n\t\t\teventBusComponentType: engineCore.getRegisteredInstanceTypeOptional(\"eventBusComponent\"),\n\t\t\t...instanceConfig.options\n\t\t});\n\t\tinstanceType = nameofKebabCase(ImmutableProofService);\n\t} else if (instanceConfig.type === ImmutableProofComponentType.RestClient) {\n\t\tcomponent = new ImmutableProofRestClient(instanceConfig.options);\n\t\tinstanceType = nameofKebabCase(ImmutableProofRestClient);\n\t}\n\n\treturn {\n\t\tcomponent,\n\t\tinstanceType,\n\t\tfactory: ComponentFactory\n\t};\n}\n"]}
@@ -18,10 +18,8 @@ export async function initialiseRightsManagementDapComponent(engineCore, context
18
18
  component = new DataAccessPointService({
19
19
  loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
20
20
  policyEnforcementPointComponentType: engineCore.getRegisteredInstanceType("rightsManagementPepComponent"),
21
- ...instanceConfig.options,
22
- config: {
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,GAAG,cAAc,CAAC,OAAO;YACzB,MAAM,EAAE;gBACP,GAAG,cAAc,CAAC,OAAO,EAAE,MAAM;aACjC;SACD,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\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(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"]}
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, Is } from "@twin.org/core";
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,EAAE,EAAE,EAAmB,MAAM,gBAAgB,CAAC;AACvE,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAO3D,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,MAAM,cAAc,GAAqD,EAAE,CAAC;QAC5E,IAAI,EAAE,CAAC,UAAU,CAAC,cAAc,CAAC,OAAO,EAAE,oBAAoB,CAAC,EAAE,CAAC;YACjE,KAAK,MAAM,YAAY,IAAI,cAAc,CAAC,OAAO,CAAC,oBAAoB,EAAE,CAAC;gBACxE,cAAc,CAAC,IAAI,CAAC;oBACnB,SAAS,EAAE,YAAY,CAAC,EAAE;oBAC1B,OAAO,EAAE,MAAM,kBAAkB,CAAC,aAAa,CAAC,UAAU,EAAE,YAAY,CAAC;iBACzE,CAAC,CAAC;YACJ,CAAC;QACF,CAAC;QAED,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;YACzB,MAAM,EAAE;gBACP,GAAG,cAAc,CAAC,OAAO,EAAE,MAAM;gBACjC,QAAQ,EAAE,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,IAAI,cAAc;aACpE;SACD,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, Is, type IComponent } from \"@twin.org/core\";\nimport { EngineModuleHelper } from \"@twin.org/engine-core\";\nimport type { IEngineCore, IEngineCoreContext } from \"@twin.org/engine-models\";\nimport { nameofKebabCase } from \"@twin.org/nameof\";\nimport type {\n\tIPolicyArbiter,\n\tIPolicyDecisionPointComponent\n} 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\tconst arbiterModules: { arbiterId: string; arbiter: IPolicyArbiter }[] = [];\n\t\tif (Is.arrayValue(instanceConfig.options?.arbiterModulesConfig)) {\n\t\t\tfor (const moduleConfig of instanceConfig.options.arbiterModulesConfig) {\n\t\t\t\tarbiterModules.push({\n\t\t\t\t\tarbiterId: moduleConfig.id,\n\t\t\t\t\tarbiter: await EngineModuleHelper.loadComponent(engineCore, moduleConfig)\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\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\tconfig: {\n\t\t\t\t...instanceConfig.options?.config,\n\t\t\t\tarbiters: instanceConfig.options?.config?.arbiters ?? arbiterModules\n\t\t\t}\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
+ {"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, Is } from "@twin.org/core";
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,EAAE,EAAE,EAAmB,MAAM,gBAAgB,CAAC;AACvE,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAO3D,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,MAAM,gBAAgB,GAAsE,EAAE,CAAC;QAC/F,IAAI,EAAE,CAAC,UAAU,CAAC,cAAc,CAAC,OAAO,EAAE,sBAAsB,CAAC,EAAE,CAAC;YACnE,KAAK,MAAM,YAAY,IAAI,cAAc,CAAC,OAAO,CAAC,sBAAsB,EAAE,CAAC;gBAC1E,gBAAgB,CAAC,IAAI,CAAC;oBACrB,WAAW,EAAE,YAAY,CAAC,EAAE;oBAC5B,SAAS,EAAE,MAAM,kBAAkB,CAAC,aAAa,CAAC,UAAU,EAAE,YAAY,CAAC;iBAC3E,CAAC,CAAC;YACJ,CAAC;QACF,CAAC;QAED,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;YACzB,MAAM,EAAE;gBACP,GAAG,cAAc,CAAC,OAAO,EAAE,MAAM;gBACjC,UAAU,EAAE,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,IAAI,gBAAgB;aAC1E;SACD,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, Is, type IComponent } from \"@twin.org/core\";\nimport { EngineModuleHelper } from \"@twin.org/engine-core\";\nimport type { IEngineCore, IEngineCoreContext } from \"@twin.org/engine-models\";\nimport { nameofKebabCase } from \"@twin.org/nameof\";\nimport type {\n\tIPolicyEnforcementPointComponent,\n\tIPolicyEnforcementProcessor\n} 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\tconst processorModules: { processorId: string; processor: IPolicyEnforcementProcessor }[] = [];\n\t\tif (Is.arrayValue(instanceConfig.options?.processorModulesConfig)) {\n\t\t\tfor (const moduleConfig of instanceConfig.options.processorModulesConfig) {\n\t\t\t\tprocessorModules.push({\n\t\t\t\t\tprocessorId: moduleConfig.id,\n\t\t\t\t\tprocessor: await EngineModuleHelper.loadComponent(engineCore, moduleConfig)\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\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\tconfig: {\n\t\t\t\t...instanceConfig.options?.config,\n\t\t\t\tprocessors: instanceConfig.options?.config?.processors ?? processorModules\n\t\t\t}\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
+ {"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, Is } from "@twin.org/core";
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,EAAE,EAAE,EAAmB,MAAM,gBAAgB,CAAC;AACvE,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAO3D,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,MAAM,wBAAwB,GAA6D,EAAE,CAAC;QAC9F,IAAI,EAAE,CAAC,UAAU,CAAC,cAAc,CAAC,OAAO,EAAE,wBAAwB,CAAC,EAAE,CAAC;YACrE,KAAK,MAAM,YAAY,IAAI,cAAc,CAAC,OAAO,CAAC,wBAAwB,EAAE,CAAC;gBAC5E,wBAAwB,CAAC,IAAI,CAAC;oBAC7B,QAAQ,EAAE,YAAY,CAAC,EAAE;oBACzB,MAAM,EAAE,MAAM,kBAAkB,CAAC,aAAa,CAAC,UAAU,EAAE,YAAY,CAAC;iBACxE,CAAC,CAAC;YACJ,CAAC;QACF,CAAC;QAED,SAAS,GAAG,IAAI,6BAA6B,CAAC;YAC7C,oBAAoB,EAAE,UAAU,CAAC,yBAAyB,CAAC,kBAAkB,CAAC;YAC9E,GAAG,cAAc,CAAC,OAAO;YACzB,MAAM,EAAE;gBACP,GAAG,cAAc,CAAC,OAAO,EAAE,MAAM;gBACjC,OAAO,EAAE,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,IAAI,wBAAwB;aAC5E;SACD,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, Is, type IComponent } from \"@twin.org/core\";\nimport { EngineModuleHelper } from \"@twin.org/engine-core\";\nimport type { IEngineCore, IEngineCoreContext } from \"@twin.org/engine-models\";\nimport { nameofKebabCase } from \"@twin.org/nameof\";\nimport type {\n\tIPolicyInformationPointComponent,\n\tIPolicyInformationSource\n} 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\tconst informationSourceModules: { sourceId: string; source: IPolicyInformationSource }[] = [];\n\t\tif (Is.arrayValue(instanceConfig.options?.informationModulesConfig)) {\n\t\t\tfor (const moduleConfig of instanceConfig.options.informationModulesConfig) {\n\t\t\t\tinformationSourceModules.push({\n\t\t\t\t\tsourceId: moduleConfig.id,\n\t\t\t\t\tsource: await EngineModuleHelper.loadComponent(engineCore, moduleConfig)\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\tcomponent = new PolicyInformationPointService({\n\t\t\tloggingComponentType: engineCore.getRegisteredInstanceType(\"loggingComponent\"),\n\t\t\t...instanceConfig.options,\n\t\t\tconfig: {\n\t\t\t\t...instanceConfig.options?.config,\n\t\t\t\tsources: instanceConfig.options?.config?.sources ?? informationSourceModules\n\t\t\t}\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
+ {"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, Is } from "@twin.org/core";
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,EAAE,EAAE,EAAmB,MAAM,gBAAgB,CAAC;AACvE,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAQ3D,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,MAAM,iBAAiB,GAA8D,EAAE,CAAC;QACxF,IAAI,EAAE,CAAC,UAAU,CAAC,cAAc,CAAC,OAAO,EAAE,uBAAuB,CAAC,EAAE,CAAC;YACpE,KAAK,MAAM,YAAY,IAAI,cAAc,CAAC,OAAO,CAAC,uBAAuB,EAAE,CAAC;gBAC3E,iBAAiB,CAAC,IAAI,CAAC;oBACtB,YAAY,EAAE,YAAY,CAAC,EAAE;oBAC7B,UAAU,EAAE,MAAM,kBAAkB,CAAC,aAAa,CAAC,UAAU,EAAE,YAAY,CAAC;iBAC5E,CAAC,CAAC;YACJ,CAAC;QACF,CAAC;QAED,MAAM,gBAAgB,GAA2D,EAAE,CAAC;QACpF,IAAI,EAAE,CAAC,UAAU,CAAC,cAAc,CAAC,OAAO,EAAE,sBAAsB,CAAC,EAAE,CAAC;YACnE,KAAK,MAAM,YAAY,IAAI,cAAc,CAAC,OAAO,CAAC,sBAAsB,EAAE,CAAC;gBAC1E,gBAAgB,CAAC,IAAI,CAAC;oBACrB,WAAW,EAAE,YAAY,CAAC,EAAE;oBAC5B,SAAS,EAAE,MAAM,kBAAkB,CAAC,aAAa,CAAC,UAAU,EAAE,YAAY,CAAC;iBAC3E,CAAC,CAAC;YACJ,CAAC;QACF,CAAC;QAED,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,GAAG,cAAc,CAAC,OAAO;YACzB,MAAM,EAAE;gBACP,GAAG,cAAc,CAAC,OAAO,EAAE,MAAM;gBACjC,WAAW,EAAE,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,WAAW,IAAI,iBAAiB;gBAC7E,UAAU,EAAE,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,IAAI,gBAAgB;aAC1E;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, Is, type IComponent } from \"@twin.org/core\";\nimport { EngineModuleHelper } from \"@twin.org/engine-core\";\nimport type { IEngineCore, IEngineCoreContext } from \"@twin.org/engine-models\";\nimport { nameofKebabCase } from \"@twin.org/nameof\";\nimport type {\n\tIPolicyNegotiationPointComponent,\n\tIPolicyNegotiator,\n\tIPolicyRequester\n} 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\tconst negotiatorModules: { negotiatorId: string; negotiator: IPolicyNegotiator }[] = [];\n\t\tif (Is.arrayValue(instanceConfig.options?.negotiatorModulesConfig)) {\n\t\t\tfor (const moduleConfig of instanceConfig.options.negotiatorModulesConfig) {\n\t\t\t\tnegotiatorModules.push({\n\t\t\t\t\tnegotiatorId: moduleConfig.id,\n\t\t\t\t\tnegotiator: await EngineModuleHelper.loadComponent(engineCore, moduleConfig)\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\tconst requesterModules: { requesterId: string; requester: IPolicyRequester }[] = [];\n\t\tif (Is.arrayValue(instanceConfig.options?.requesterModulesConfig)) {\n\t\t\tfor (const moduleConfig of instanceConfig.options.requesterModulesConfig) {\n\t\t\t\trequesterModules.push({\n\t\t\t\t\trequesterId: moduleConfig.id,\n\t\t\t\t\trequester: await EngineModuleHelper.loadComponent(engineCore, moduleConfig)\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\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\t...instanceConfig.options,\n\t\t\tconfig: {\n\t\t\t\t...instanceConfig.options?.config,\n\t\t\t\tnegotiators: instanceConfig.options?.config?.negotiators ?? negotiatorModules,\n\t\t\t\trequesters: instanceConfig.options?.config?.requesters ?? requesterModules\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"]}
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