@twin.org/engine-types 0.0.3-next.4 → 0.0.3-next.40

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 (590) hide show
  1. package/README.md +1 -1
  2. package/dist/es/components/attestation.js +20 -24
  3. package/dist/es/components/attestation.js.map +1 -1
  4. package/dist/es/components/auditableItemGraph.js +27 -22
  5. package/dist/es/components/auditableItemGraph.js.map +1 -1
  6. package/dist/es/components/auditableItemStream.js +27 -22
  7. package/dist/es/components/auditableItemStream.js.map +1 -1
  8. package/dist/es/components/automation.js +41 -0
  9. package/dist/es/components/automation.js.map +1 -0
  10. package/dist/es/components/automationAction.js +27 -0
  11. package/dist/es/components/automationAction.js.map +1 -0
  12. package/dist/es/components/backgroundTask.js +18 -18
  13. package/dist/es/components/backgroundTask.js.map +1 -1
  14. package/dist/es/components/blobStorage.js +69 -80
  15. package/dist/es/components/blobStorage.js.map +1 -1
  16. package/dist/es/components/contextIdHandler.js +9 -9
  17. package/dist/es/components/contextIdHandler.js.map +1 -1
  18. package/dist/es/components/dataProcessing.js +33 -32
  19. package/dist/es/components/dataProcessing.js.map +1 -1
  20. package/dist/es/components/dataspaceControlPlane.js +57 -0
  21. package/dist/es/components/dataspaceControlPlane.js.map +1 -0
  22. package/dist/es/components/dataspaceDataPlane.js +62 -0
  23. package/dist/es/components/dataspaceDataPlane.js.map +1 -0
  24. package/dist/es/components/documentManagement.js +12 -11
  25. package/dist/es/components/documentManagement.js.map +1 -1
  26. package/dist/es/components/entityStorage.js +48 -47
  27. package/dist/es/components/entityStorage.js.map +1 -1
  28. package/dist/es/components/eventBus.js +19 -27
  29. package/dist/es/components/eventBus.js.map +1 -1
  30. package/dist/es/components/faucet.js +18 -18
  31. package/dist/es/components/faucet.js.map +1 -1
  32. package/dist/es/components/federatedCatalogue.js +17 -18
  33. package/dist/es/components/federatedCatalogue.js.map +1 -1
  34. package/dist/es/components/federatedCatalogueFilter.js +34 -0
  35. package/dist/es/components/federatedCatalogueFilter.js.map +1 -0
  36. package/dist/es/components/health.js +32 -0
  37. package/dist/es/components/health.js.map +1 -0
  38. package/dist/es/components/identity.js +30 -31
  39. package/dist/es/components/identity.js.map +1 -1
  40. package/dist/es/components/identityProfile.js +26 -24
  41. package/dist/es/components/identityProfile.js.map +1 -1
  42. package/dist/es/components/identityResolver.js +36 -40
  43. package/dist/es/components/identityResolver.js.map +1 -1
  44. package/dist/es/components/immutableProof.js +23 -20
  45. package/dist/es/components/immutableProof.js.map +1 -1
  46. package/dist/es/components/logging.js +28 -28
  47. package/dist/es/components/logging.js.map +1 -1
  48. package/dist/es/components/messaging.js +77 -89
  49. package/dist/es/components/messaging.js.map +1 -1
  50. package/dist/es/components/metricsCollector.js +27 -0
  51. package/dist/es/components/metricsCollector.js.map +1 -0
  52. package/dist/es/components/metricsProducer.js +33 -0
  53. package/dist/es/components/metricsProducer.js.map +1 -0
  54. package/dist/es/components/nft.js +32 -33
  55. package/dist/es/components/nft.js.map +1 -1
  56. package/dist/es/components/notarization.js +77 -0
  57. package/dist/es/components/notarization.js.map +1 -0
  58. package/dist/es/components/rightsManagementPap.js +17 -17
  59. package/dist/es/components/rightsManagementPap.js.map +1 -1
  60. package/dist/es/components/rightsManagementPdp.js +11 -26
  61. package/dist/es/components/rightsManagementPdp.js.map +1 -1
  62. package/dist/es/components/rightsManagementPep.js +12 -24
  63. package/dist/es/components/rightsManagementPep.js.map +1 -1
  64. package/dist/es/components/rightsManagementPip.js +9 -25
  65. package/dist/es/components/rightsManagementPip.js.map +1 -1
  66. package/dist/es/components/rightsManagementPmp.js +10 -10
  67. package/dist/es/components/rightsManagementPmp.js.map +1 -1
  68. package/dist/es/components/rightsManagementPnap.js +21 -18
  69. package/dist/es/components/rightsManagementPnap.js.map +1 -1
  70. package/dist/es/components/rightsManagementPnp.js +15 -36
  71. package/dist/es/components/rightsManagementPnp.js.map +1 -1
  72. package/dist/es/components/rightsManagementPolicyArbiter.js +32 -0
  73. package/dist/es/components/rightsManagementPolicyArbiter.js.map +1 -0
  74. package/dist/es/components/rightsManagementPolicyEnforcementProcessor.js +33 -0
  75. package/dist/es/components/rightsManagementPolicyEnforcementProcessor.js.map +1 -0
  76. package/dist/es/components/rightsManagementPolicyExecutionAction.js +25 -0
  77. package/dist/es/components/rightsManagementPolicyExecutionAction.js.map +1 -0
  78. package/dist/es/components/rightsManagementPolicyInformationSource.js +34 -0
  79. package/dist/es/components/rightsManagementPolicyInformationSource.js.map +1 -0
  80. package/dist/es/components/rightsManagementPolicyNegotiator.js +27 -0
  81. package/dist/es/components/rightsManagementPolicyNegotiator.js.map +1 -0
  82. package/dist/es/components/rightsManagementPolicyObligationEnforcer.js +27 -0
  83. package/dist/es/components/rightsManagementPolicyObligationEnforcer.js.map +1 -0
  84. package/dist/es/components/rightsManagementPolicyRequester.js +25 -0
  85. package/dist/es/components/rightsManagementPolicyRequester.js.map +1 -0
  86. package/dist/es/components/rightsManagementPxp.js +9 -25
  87. package/dist/es/components/rightsManagementPxp.js.map +1 -1
  88. package/dist/es/components/synchronisedStorage.js +25 -23
  89. package/dist/es/components/synchronisedStorage.js.map +1 -1
  90. package/dist/es/components/taskScheduler.js +17 -11
  91. package/dist/es/components/taskScheduler.js.map +1 -1
  92. package/dist/es/components/telemetry.js +46 -32
  93. package/dist/es/components/telemetry.js.map +1 -1
  94. package/dist/es/components/tenant.js +12 -11
  95. package/dist/es/components/tenant.js.map +1 -1
  96. package/dist/es/components/trust.js +27 -0
  97. package/dist/es/components/trust.js.map +1 -0
  98. package/dist/es/components/trustGenerator.js +28 -0
  99. package/dist/es/components/trustGenerator.js.map +1 -0
  100. package/dist/es/components/trustVerifier.js +28 -0
  101. package/dist/es/components/trustVerifier.js.map +1 -0
  102. package/dist/es/components/urlTransformer.js +29 -0
  103. package/dist/es/components/urlTransformer.js.map +1 -0
  104. package/dist/es/components/vault.js +15 -12
  105. package/dist/es/components/vault.js.map +1 -1
  106. package/dist/es/components/verifiableStorage.js +32 -34
  107. package/dist/es/components/verifiableStorage.js.map +1 -1
  108. package/dist/es/components/wallet.js +23 -24
  109. package/dist/es/components/wallet.js.map +1 -1
  110. package/dist/es/index.js +64 -14
  111. package/dist/es/index.js.map +1 -1
  112. package/dist/es/models/IEngineConfig.js.map +1 -1
  113. package/dist/es/models/config/automationActionConfig.js +2 -0
  114. package/dist/es/models/config/automationActionConfig.js.map +1 -0
  115. package/dist/es/models/config/automationComponentConfig.js +2 -0
  116. package/dist/es/models/config/automationComponentConfig.js.map +1 -0
  117. package/dist/es/models/config/backgroundTaskComponentConfig.js +2 -0
  118. package/dist/es/models/config/backgroundTaskComponentConfig.js.map +1 -0
  119. package/dist/es/models/config/blobStorageConnectorConfig.js.map +1 -1
  120. package/dist/es/models/config/dataspaceControlPlaneComponentConfig.js +2 -0
  121. package/dist/es/models/config/dataspaceControlPlaneComponentConfig.js.map +1 -0
  122. package/dist/es/models/config/dataspaceDataPlaneComponentConfig.js +2 -0
  123. package/dist/es/models/config/dataspaceDataPlaneComponentConfig.js.map +1 -0
  124. package/dist/es/models/config/federatedCatalogueFilterComponentConfig.js +2 -0
  125. package/dist/es/models/config/federatedCatalogueFilterComponentConfig.js.map +1 -0
  126. package/dist/es/models/config/healthComponentConfig.js +2 -0
  127. package/dist/es/models/config/healthComponentConfig.js.map +1 -0
  128. package/dist/es/models/config/metricsCollectorComponentConfig.js +2 -0
  129. package/dist/es/models/config/metricsCollectorComponentConfig.js.map +1 -0
  130. package/dist/es/models/config/metricsProducerComponentConfig.js +2 -0
  131. package/dist/es/models/config/metricsProducerComponentConfig.js.map +1 -0
  132. package/dist/es/models/config/notarizationComponentConfig.js +2 -0
  133. package/dist/es/models/config/notarizationComponentConfig.js.map +1 -0
  134. package/dist/es/models/config/notarizationConnectorConfig.js +2 -0
  135. package/dist/es/models/config/notarizationConnectorConfig.js.map +1 -0
  136. package/dist/es/models/config/rightsManagementPdpComponentConfig.js.map +1 -1
  137. package/dist/es/models/config/rightsManagementPepComponentConfig.js.map +1 -1
  138. package/dist/es/models/config/rightsManagementPipComponentConfig.js.map +1 -1
  139. package/dist/es/models/config/rightsManagementPnpComponentConfig.js.map +1 -1
  140. package/dist/es/models/config/rightsManagementPolicyArbiterComponentConfig.js +2 -0
  141. package/dist/es/models/config/rightsManagementPolicyArbiterComponentConfig.js.map +1 -0
  142. package/dist/es/models/config/rightsManagementPolicyEnforcementProcessorComponentConfig.js +2 -0
  143. package/dist/es/models/config/rightsManagementPolicyEnforcementProcessorComponentConfig.js.map +1 -0
  144. package/dist/es/models/config/rightsManagementPolicyExecutionActionComponentConfig.js +2 -0
  145. package/dist/es/models/config/rightsManagementPolicyExecutionActionComponentConfig.js.map +1 -0
  146. package/dist/es/models/config/rightsManagementPolicyInformationSourceComponentConfig.js +2 -0
  147. package/dist/es/models/config/rightsManagementPolicyInformationSourceComponentConfig.js.map +1 -0
  148. package/dist/es/models/config/rightsManagementPolicyNegotiatorComponentConfig.js +2 -0
  149. package/dist/es/models/config/rightsManagementPolicyNegotiatorComponentConfig.js.map +1 -0
  150. package/dist/es/models/config/rightsManagementPolicyObligationEnforcerComponentConfig.js +2 -0
  151. package/dist/es/models/config/rightsManagementPolicyObligationEnforcerComponentConfig.js.map +1 -0
  152. package/dist/es/models/config/rightsManagementPolicyRequesterComponentConfig.js +2 -0
  153. package/dist/es/models/config/rightsManagementPolicyRequesterComponentConfig.js.map +1 -0
  154. package/dist/es/models/config/rightsManagementPxpComponentConfig.js.map +1 -1
  155. package/dist/es/models/config/telemetryConnectorConfig.js.map +1 -1
  156. package/dist/es/models/config/trustComponentConfig.js +2 -0
  157. package/dist/es/models/config/trustComponentConfig.js.map +1 -0
  158. package/dist/es/models/config/trustGeneratorComponentConfig.js +2 -0
  159. package/dist/es/models/config/trustGeneratorComponentConfig.js.map +1 -0
  160. package/dist/es/models/config/trustVerifierComponentConfig.js +2 -0
  161. package/dist/es/models/config/trustVerifierComponentConfig.js.map +1 -0
  162. package/dist/es/models/config/urlTransformerComponentConfig.js +2 -0
  163. package/dist/es/models/config/urlTransformerComponentConfig.js.map +1 -0
  164. package/dist/es/models/types/automationActionType.js +13 -0
  165. package/dist/es/models/types/automationActionType.js.map +1 -0
  166. package/dist/es/models/types/{rightsManagementDapComponentType.js → automationComponentType.js} +4 -4
  167. package/dist/es/models/types/automationComponentType.js.map +1 -0
  168. package/dist/es/models/types/{rightsManagementDarpComponentType.js → backgroundTaskComponentType.js} +3 -3
  169. package/dist/es/models/types/backgroundTaskComponentType.js.map +1 -0
  170. package/dist/es/models/types/dataspaceControlPlaneComponentType.js +17 -0
  171. package/dist/es/models/types/dataspaceControlPlaneComponentType.js.map +1 -0
  172. package/dist/es/models/types/{dataSpaceConnectorComponentType.js → dataspaceDataPlaneComponentType.js} +4 -4
  173. package/dist/es/models/types/dataspaceDataPlaneComponentType.js.map +1 -0
  174. package/dist/es/models/types/federatedCatalogueFilterComponentType.js +13 -0
  175. package/dist/es/models/types/federatedCatalogueFilterComponentType.js.map +1 -0
  176. package/dist/es/models/types/healthComponentType.js +17 -0
  177. package/dist/es/models/types/healthComponentType.js.map +1 -0
  178. package/dist/es/models/types/metricsCollectorComponentType.js +13 -0
  179. package/dist/es/models/types/metricsCollectorComponentType.js.map +1 -0
  180. package/dist/es/models/types/metricsProducerComponentType.js +17 -0
  181. package/dist/es/models/types/metricsProducerComponentType.js.map +1 -0
  182. package/dist/es/models/types/notarizationComponentType.js +17 -0
  183. package/dist/es/models/types/notarizationComponentType.js.map +1 -0
  184. package/dist/es/models/types/notarizationConnectorType.js +17 -0
  185. package/dist/es/models/types/notarizationConnectorType.js.map +1 -0
  186. package/dist/es/models/types/rightsManagementPolicyArbiterComponentType.js +17 -0
  187. package/dist/es/models/types/rightsManagementPolicyArbiterComponentType.js.map +1 -0
  188. package/dist/es/models/types/rightsManagementPolicyEnforcementProcessorComponentType.js +17 -0
  189. package/dist/es/models/types/rightsManagementPolicyEnforcementProcessorComponentType.js.map +1 -0
  190. package/dist/es/models/types/rightsManagementPolicyExecutionActionComponentType.js +13 -0
  191. package/dist/es/models/types/rightsManagementPolicyExecutionActionComponentType.js.map +1 -0
  192. package/dist/es/models/types/rightsManagementPolicyInformationSourceComponentType.js +17 -0
  193. package/dist/es/models/types/rightsManagementPolicyInformationSourceComponentType.js.map +1 -0
  194. package/dist/es/models/types/rightsManagementPolicyNegotiatorComponentType.js +13 -0
  195. package/dist/es/models/types/rightsManagementPolicyNegotiatorComponentType.js.map +1 -0
  196. package/dist/es/models/types/rightsManagementPolicyObligationEnforcerComponentType.js +13 -0
  197. package/dist/es/models/types/rightsManagementPolicyObligationEnforcerComponentType.js.map +1 -0
  198. package/dist/es/models/types/rightsManagementPolicyRequesterComponentType.js +13 -0
  199. package/dist/es/models/types/rightsManagementPolicyRequesterComponentType.js.map +1 -0
  200. package/dist/es/models/types/telemetryConnectorType.js +5 -1
  201. package/dist/es/models/types/telemetryConnectorType.js.map +1 -1
  202. package/dist/es/models/types/trustComponentType.js +13 -0
  203. package/dist/es/models/types/trustComponentType.js.map +1 -0
  204. package/dist/es/models/types/trustGeneratorComponentType.js +13 -0
  205. package/dist/es/models/types/trustGeneratorComponentType.js.map +1 -0
  206. package/dist/es/models/types/trustVerifierComponentType.js +13 -0
  207. package/dist/es/models/types/trustVerifierComponentType.js.map +1 -0
  208. package/dist/es/models/types/urlTransformerComponentType.js +13 -0
  209. package/dist/es/models/types/urlTransformerComponentType.js.map +1 -0
  210. package/dist/es/utils/engineTypeHelper.js +19 -1
  211. package/dist/es/utils/engineTypeHelper.js.map +1 -1
  212. package/dist/types/components/attestation.d.ts +5 -13
  213. package/dist/types/components/auditableItemGraph.d.ts +3 -7
  214. package/dist/types/components/auditableItemStream.d.ts +3 -7
  215. package/dist/types/components/automation.d.ts +12 -0
  216. package/dist/types/components/automationAction.d.ts +12 -0
  217. package/dist/types/components/backgroundTask.d.ts +5 -10
  218. package/dist/types/components/blobStorage.d.ts +4 -12
  219. package/dist/types/components/contextIdHandler.d.ts +3 -7
  220. package/dist/types/components/dataProcessing.d.ts +5 -17
  221. package/dist/types/components/dataspaceControlPlane.d.ts +12 -0
  222. package/dist/types/components/dataspaceDataPlane.d.ts +12 -0
  223. package/dist/types/components/documentManagement.d.ts +3 -7
  224. package/dist/types/components/entityStorage.d.ts +4 -9
  225. package/dist/types/components/eventBus.d.ts +4 -12
  226. package/dist/types/components/faucet.d.ts +2 -7
  227. package/dist/types/components/federatedCatalogue.d.ts +3 -7
  228. package/dist/types/components/federatedCatalogueFilter.d.ts +12 -0
  229. package/dist/types/components/health.d.ts +12 -0
  230. package/dist/types/components/identity.d.ts +4 -12
  231. package/dist/types/components/identityProfile.d.ts +4 -12
  232. package/dist/types/components/identityResolver.d.ts +4 -12
  233. package/dist/types/components/immutableProof.d.ts +3 -7
  234. package/dist/types/components/logging.d.ts +4 -12
  235. package/dist/types/components/messaging.d.ts +7 -27
  236. package/dist/types/components/metricsCollector.d.ts +12 -0
  237. package/dist/types/components/metricsProducer.d.ts +12 -0
  238. package/dist/types/components/nft.d.ts +4 -12
  239. package/dist/types/components/notarization.d.ts +22 -0
  240. package/dist/types/components/rightsManagementPap.d.ts +3 -7
  241. package/dist/types/components/rightsManagementPdp.d.ts +3 -7
  242. package/dist/types/components/rightsManagementPep.d.ts +3 -7
  243. package/dist/types/components/rightsManagementPip.d.ts +3 -7
  244. package/dist/types/components/rightsManagementPmp.d.ts +3 -7
  245. package/dist/types/components/rightsManagementPnap.d.ts +3 -7
  246. package/dist/types/components/rightsManagementPnp.d.ts +3 -7
  247. package/dist/types/components/rightsManagementPolicyArbiter.d.ts +12 -0
  248. package/dist/types/components/rightsManagementPolicyEnforcementProcessor.d.ts +12 -0
  249. package/dist/types/components/rightsManagementPolicyExecutionAction.d.ts +12 -0
  250. package/dist/types/components/rightsManagementPolicyInformationSource.d.ts +12 -0
  251. package/dist/types/components/rightsManagementPolicyNegotiator.d.ts +12 -0
  252. package/dist/types/components/rightsManagementPolicyObligationEnforcer.d.ts +12 -0
  253. package/dist/types/components/rightsManagementPolicyRequester.d.ts +12 -0
  254. package/dist/types/components/rightsManagementPxp.d.ts +3 -7
  255. package/dist/types/components/synchronisedStorage.d.ts +3 -7
  256. package/dist/types/components/taskScheduler.d.ts +3 -7
  257. package/dist/types/components/telemetry.d.ts +4 -12
  258. package/dist/types/components/tenant.d.ts +3 -7
  259. package/dist/types/components/trust.d.ts +12 -0
  260. package/dist/types/components/trustGenerator.d.ts +12 -0
  261. package/dist/types/components/trustVerifier.d.ts +12 -0
  262. package/dist/types/components/urlTransformer.d.ts +12 -0
  263. package/dist/types/components/vault.d.ts +2 -7
  264. package/dist/types/components/verifiableStorage.d.ts +4 -12
  265. package/dist/types/components/wallet.d.ts +2 -7
  266. package/dist/types/index.d.ts +64 -14
  267. package/dist/types/models/IEngineConfig.d.ts +100 -15
  268. package/dist/types/models/config/automationActionConfig.d.ts +9 -0
  269. package/dist/types/models/config/automationComponentConfig.d.ts +13 -0
  270. package/dist/types/models/config/backgroundTaskComponentConfig.d.ts +9 -0
  271. package/dist/types/models/config/blobStorageConnectorConfig.d.ts +4 -1
  272. package/dist/types/models/config/dataspaceControlPlaneComponentConfig.d.ts +13 -0
  273. package/dist/types/models/config/dataspaceDataPlaneComponentConfig.d.ts +17 -0
  274. package/dist/types/models/config/federatedCatalogueFilterComponentConfig.d.ts +9 -0
  275. package/dist/types/models/config/healthComponentConfig.d.ts +13 -0
  276. package/dist/types/models/config/metricsCollectorComponentConfig.d.ts +9 -0
  277. package/dist/types/models/config/metricsProducerComponentConfig.d.ts +12 -0
  278. package/dist/types/models/config/notarizationComponentConfig.d.ts +13 -0
  279. package/dist/types/models/config/notarizationConnectorConfig.d.ts +13 -0
  280. package/dist/types/models/config/rightsManagementPdpComponentConfig.d.ts +1 -4
  281. package/dist/types/models/config/rightsManagementPepComponentConfig.d.ts +1 -4
  282. package/dist/types/models/config/rightsManagementPipComponentConfig.d.ts +1 -4
  283. package/dist/types/models/config/rightsManagementPnpComponentConfig.d.ts +1 -5
  284. package/dist/types/models/config/rightsManagementPolicyArbiterComponentConfig.d.ts +12 -0
  285. package/dist/types/models/config/rightsManagementPolicyEnforcementProcessorComponentConfig.d.ts +12 -0
  286. package/dist/types/models/config/rightsManagementPolicyExecutionActionComponentConfig.d.ts +9 -0
  287. package/dist/types/models/config/rightsManagementPolicyInformationSourceComponentConfig.d.ts +12 -0
  288. package/dist/types/models/config/rightsManagementPolicyNegotiatorComponentConfig.d.ts +9 -0
  289. package/dist/types/models/config/rightsManagementPolicyObligationEnforcerComponentConfig.d.ts +9 -0
  290. package/dist/types/models/config/rightsManagementPolicyRequesterComponentConfig.d.ts +9 -0
  291. package/dist/types/models/config/rightsManagementPxpComponentConfig.d.ts +1 -4
  292. package/dist/types/models/config/telemetryConnectorConfig.d.ts +4 -0
  293. package/dist/types/models/config/trustComponentConfig.d.ts +9 -0
  294. package/dist/types/models/config/trustGeneratorComponentConfig.d.ts +9 -0
  295. package/dist/types/models/config/trustVerifierComponentConfig.d.ts +9 -0
  296. package/dist/types/models/config/urlTransformerComponentConfig.d.ts +9 -0
  297. package/dist/types/models/types/automationActionType.d.ts +13 -0
  298. package/dist/types/models/types/automationComponentType.d.ts +17 -0
  299. package/dist/types/models/types/backgroundTaskComponentType.d.ts +13 -0
  300. package/dist/types/models/types/dataspaceControlPlaneComponentType.d.ts +17 -0
  301. package/dist/types/models/types/dataspaceDataPlaneComponentType.d.ts +21 -0
  302. package/dist/types/models/types/federatedCatalogueFilterComponentType.d.ts +13 -0
  303. package/dist/types/models/types/healthComponentType.d.ts +17 -0
  304. package/dist/types/models/types/metricsCollectorComponentType.d.ts +13 -0
  305. package/dist/types/models/types/metricsProducerComponentType.d.ts +17 -0
  306. package/dist/types/models/types/notarizationComponentType.d.ts +17 -0
  307. package/dist/types/models/types/notarizationConnectorType.d.ts +17 -0
  308. package/dist/types/models/types/rightsManagementPolicyArbiterComponentType.d.ts +17 -0
  309. package/dist/types/models/types/rightsManagementPolicyEnforcementProcessorComponentType.d.ts +17 -0
  310. package/dist/types/models/types/rightsManagementPolicyExecutionActionComponentType.d.ts +13 -0
  311. package/dist/types/models/types/rightsManagementPolicyInformationSourceComponentType.d.ts +17 -0
  312. package/dist/types/models/types/rightsManagementPolicyNegotiatorComponentType.d.ts +13 -0
  313. package/dist/types/models/types/rightsManagementPolicyObligationEnforcerComponentType.d.ts +13 -0
  314. package/dist/types/models/types/rightsManagementPolicyRequesterComponentType.d.ts +13 -0
  315. package/dist/types/models/types/telemetryConnectorType.d.ts +4 -0
  316. package/dist/types/models/types/trustComponentType.d.ts +13 -0
  317. package/dist/types/models/types/trustGeneratorComponentType.d.ts +13 -0
  318. package/dist/types/models/types/trustVerifierComponentType.d.ts +13 -0
  319. package/dist/types/models/types/urlTransformerComponentType.d.ts +13 -0
  320. package/dist/types/utils/engineTypeHelper.d.ts +11 -0
  321. package/docs/changelog.md +783 -148
  322. package/docs/examples.md +74 -1
  323. package/docs/reference/classes/EngineTypeHelper.md +57 -4
  324. package/docs/reference/functions/initialiseAttestationComponent.md +2 -2
  325. package/docs/reference/functions/initialiseAttestationConnector.md +3 -3
  326. package/docs/reference/functions/initialiseAuditableItemGraphComponent.md +2 -2
  327. package/docs/reference/functions/initialiseAuditableItemStreamComponent.md +2 -2
  328. package/docs/reference/functions/initialiseAutomationAction.md +31 -0
  329. package/docs/reference/functions/initialiseAutomationComponent.md +31 -0
  330. package/docs/reference/functions/initialiseBackgroundTaskComponent.md +31 -0
  331. package/docs/reference/functions/initialiseBlobStorageComponent.md +2 -2
  332. package/docs/reference/functions/initialiseBlobStorageConnector.md +2 -2
  333. package/docs/reference/functions/initialiseContextIdHandlerComponent.md +2 -2
  334. package/docs/reference/functions/initialiseDataConverterConnector.md +2 -2
  335. package/docs/reference/functions/initialiseDataExtractorConnector.md +2 -2
  336. package/docs/reference/functions/initialiseDataProcessingComponent.md +2 -2
  337. package/docs/reference/functions/initialiseDataspaceControlPlaneComponent.md +31 -0
  338. package/docs/reference/functions/initialiseDataspaceDataPlaneComponent.md +31 -0
  339. package/docs/reference/functions/initialiseDocumentManagementComponent.md +2 -2
  340. package/docs/reference/functions/initialiseEntityStorageComponent.md +2 -2
  341. package/docs/reference/functions/initialiseEntityStorageConnector.md +4 -6
  342. package/docs/reference/functions/initialiseEventBusComponent.md +2 -2
  343. package/docs/reference/functions/initialiseEventBusConnector.md +2 -2
  344. package/docs/reference/functions/initialiseFaucetConnector.md +2 -2
  345. package/docs/reference/functions/initialiseFederatedCatalogueComponent.md +2 -2
  346. package/docs/reference/functions/initialiseFederatedCatalogueFilterComponent.md +31 -0
  347. package/docs/reference/functions/initialiseHealthComponent.md +31 -0
  348. package/docs/reference/functions/initialiseIdentityComponent.md +2 -2
  349. package/docs/reference/functions/initialiseIdentityConnector.md +2 -2
  350. package/docs/reference/functions/initialiseIdentityProfileComponent.md +2 -2
  351. package/docs/reference/functions/initialiseIdentityProfileConnector.md +2 -2
  352. package/docs/reference/functions/initialiseIdentityResolverComponent.md +2 -2
  353. package/docs/reference/functions/initialiseIdentityResolverConnector.md +2 -2
  354. package/docs/reference/functions/initialiseImmutableProofComponent.md +2 -2
  355. package/docs/reference/functions/initialiseLoggingComponent.md +2 -2
  356. package/docs/reference/functions/initialiseLoggingConnector.md +2 -2
  357. package/docs/reference/functions/initialiseMessagingAdminComponent.md +2 -2
  358. package/docs/reference/functions/initialiseMessagingComponent.md +2 -2
  359. package/docs/reference/functions/initialiseMessagingEmailConnector.md +2 -2
  360. package/docs/reference/functions/initialiseMessagingPushNotificationConnector.md +2 -2
  361. package/docs/reference/functions/initialiseMessagingSmsConnector.md +2 -2
  362. package/docs/reference/functions/initialiseMetricsCollectorComponent.md +31 -0
  363. package/docs/reference/functions/initialiseMetricsProducerComponent.md +31 -0
  364. package/docs/reference/functions/initialiseNftComponent.md +2 -2
  365. package/docs/reference/functions/initialiseNftConnector.md +2 -2
  366. package/docs/reference/functions/initialiseNotarizationComponent.md +31 -0
  367. package/docs/reference/functions/initialiseNotarizationConnector.md +31 -0
  368. package/docs/reference/functions/initialiseRightsManagementPapComponent.md +2 -2
  369. package/docs/reference/functions/initialiseRightsManagementPdpComponent.md +2 -2
  370. package/docs/reference/functions/initialiseRightsManagementPepComponent.md +2 -2
  371. package/docs/reference/functions/initialiseRightsManagementPipComponent.md +2 -2
  372. package/docs/reference/functions/initialiseRightsManagementPmpComponent.md +2 -2
  373. package/docs/reference/functions/initialiseRightsManagementPnapComponent.md +2 -2
  374. package/docs/reference/functions/initialiseRightsManagementPnpComponent.md +2 -2
  375. package/docs/reference/functions/initialiseRightsManagementPolicyArbiterComponent.md +31 -0
  376. package/docs/reference/functions/initialiseRightsManagementPolicyEnforcementProcessorComponent.md +31 -0
  377. package/docs/reference/functions/initialiseRightsManagementPolicyExecutionActionComponent.md +31 -0
  378. package/docs/reference/functions/initialiseRightsManagementPolicyInformationSourceComponent.md +31 -0
  379. package/docs/reference/functions/initialiseRightsManagementPolicyNegotiatorComponent.md +31 -0
  380. package/docs/reference/functions/initialiseRightsManagementPolicyObligationEnforcerComponent.md +31 -0
  381. package/docs/reference/functions/initialiseRightsManagementPolicyRequesterComponent.md +31 -0
  382. package/docs/reference/functions/initialiseRightsManagementPxpComponent.md +2 -2
  383. package/docs/reference/functions/initialiseSynchronisedStorageComponent.md +2 -2
  384. package/docs/reference/functions/initialiseTaskSchedulerComponent.md +2 -2
  385. package/docs/reference/functions/initialiseTelemetryComponent.md +2 -2
  386. package/docs/reference/functions/initialiseTelemetryConnector.md +2 -2
  387. package/docs/reference/functions/initialiseTenantAdminComponent.md +2 -2
  388. package/docs/reference/functions/initialiseTrustComponent.md +31 -0
  389. package/docs/reference/functions/initialiseTrustGeneratorComponent.md +31 -0
  390. package/docs/reference/functions/initialiseTrustVerifierComponent.md +31 -0
  391. package/docs/reference/functions/initialiseUrlTransformerComponent.md +31 -0
  392. package/docs/reference/functions/initialiseVaultConnector.md +2 -2
  393. package/docs/reference/functions/initialiseVerifiableStorageComponent.md +2 -2
  394. package/docs/reference/functions/initialiseVerifiableStorageConnector.md +2 -2
  395. package/docs/reference/functions/initialiseWalletConnector.md +2 -2
  396. package/docs/reference/index.md +88 -20
  397. package/docs/reference/interfaces/IEngineConfig.md +206 -68
  398. package/docs/reference/type-aliases/AttestationConnectorConfig.md +3 -3
  399. package/docs/reference/type-aliases/AutomationActionConfig.md +17 -0
  400. package/docs/reference/type-aliases/AutomationActionType.md +5 -0
  401. package/docs/reference/type-aliases/AutomationComponentConfig.md +5 -0
  402. package/docs/reference/type-aliases/AutomationComponentType.md +5 -0
  403. package/docs/reference/type-aliases/BackgroundTaskComponentConfig.md +17 -0
  404. package/docs/reference/type-aliases/BackgroundTaskComponentType.md +5 -0
  405. package/docs/reference/type-aliases/BlobStorageConnectorConfig.md +1 -1
  406. package/docs/reference/type-aliases/DataExtractorConnectorConfig.md +3 -3
  407. package/docs/reference/type-aliases/DataspaceControlPlaneComponentConfig.md +5 -0
  408. package/docs/reference/type-aliases/DataspaceControlPlaneComponentType.md +5 -0
  409. package/docs/reference/type-aliases/DataspaceDataPlaneComponentConfig.md +5 -0
  410. package/docs/reference/type-aliases/DataspaceDataPlaneComponentType.md +5 -0
  411. package/docs/reference/type-aliases/DltConfig.md +4 -4
  412. package/docs/reference/type-aliases/EventBusConnectorConfig.md +3 -3
  413. package/docs/reference/type-aliases/FederatedCatalogueFilterComponentConfig.md +17 -0
  414. package/docs/reference/type-aliases/FederatedCatalogueFilterComponentType.md +5 -0
  415. package/docs/reference/type-aliases/HealthComponentConfig.md +5 -0
  416. package/docs/reference/type-aliases/HealthComponentType.md +5 -0
  417. package/docs/reference/type-aliases/IdentityProfileConnectorConfig.md +3 -3
  418. package/docs/reference/type-aliases/MessagingAdminComponentConfig.md +3 -3
  419. package/docs/reference/type-aliases/MessagingComponentConfig.md +3 -3
  420. package/docs/reference/type-aliases/MetricsCollectorComponentConfig.md +17 -0
  421. package/docs/reference/type-aliases/MetricsCollectorComponentType.md +5 -0
  422. package/docs/reference/type-aliases/MetricsProducerComponentConfig.md +5 -0
  423. package/docs/reference/type-aliases/MetricsProducerComponentType.md +5 -0
  424. package/docs/reference/type-aliases/NotarizationComponentConfig.md +5 -0
  425. package/docs/reference/type-aliases/NotarizationComponentType.md +5 -0
  426. package/docs/reference/type-aliases/NotarizationConnectorConfig.md +5 -0
  427. package/docs/reference/type-aliases/NotarizationConnectorType.md +5 -0
  428. package/docs/reference/type-aliases/RightsManagementPdpComponentConfig.md +3 -9
  429. package/docs/reference/type-aliases/RightsManagementPepComponentConfig.md +3 -9
  430. package/docs/reference/type-aliases/RightsManagementPipComponentConfig.md +3 -9
  431. package/docs/reference/type-aliases/RightsManagementPmpComponentConfig.md +3 -3
  432. package/docs/reference/type-aliases/RightsManagementPnpComponentConfig.md +1 -1
  433. package/docs/reference/type-aliases/RightsManagementPolicyArbiterComponentConfig.md +5 -0
  434. package/docs/reference/type-aliases/RightsManagementPolicyArbiterComponentType.md +5 -0
  435. package/docs/reference/type-aliases/RightsManagementPolicyEnforcementProcessorComponentConfig.md +5 -0
  436. package/docs/reference/type-aliases/RightsManagementPolicyEnforcementProcessorComponentType.md +5 -0
  437. package/docs/reference/type-aliases/RightsManagementPolicyExecutionActionComponentConfig.md +17 -0
  438. package/docs/reference/type-aliases/RightsManagementPolicyExecutionActionComponentType.md +5 -0
  439. package/docs/reference/type-aliases/RightsManagementPolicyInformationSourceComponentConfig.md +5 -0
  440. package/docs/reference/type-aliases/RightsManagementPolicyInformationSourceComponentType.md +5 -0
  441. package/docs/reference/type-aliases/RightsManagementPolicyNegotiatorComponentConfig.md +17 -0
  442. package/docs/reference/type-aliases/RightsManagementPolicyNegotiatorComponentType.md +5 -0
  443. package/docs/reference/type-aliases/RightsManagementPolicyObligationEnforcerComponentConfig.md +17 -0
  444. package/docs/reference/type-aliases/RightsManagementPolicyObligationEnforcerComponentType.md +5 -0
  445. package/docs/reference/type-aliases/RightsManagementPolicyRequesterComponentConfig.md +17 -0
  446. package/docs/reference/type-aliases/RightsManagementPolicyRequesterComponentType.md +5 -0
  447. package/docs/reference/type-aliases/RightsManagementPxpComponentConfig.md +3 -9
  448. package/docs/reference/type-aliases/TaskSchedulerComponentConfig.md +3 -3
  449. package/docs/reference/type-aliases/TelemetryConnectorConfig.md +1 -13
  450. package/docs/reference/type-aliases/TenantAdminComponentConfig.md +3 -3
  451. package/docs/reference/type-aliases/TrustComponentConfig.md +17 -0
  452. package/docs/reference/type-aliases/TrustComponentType.md +5 -0
  453. package/docs/reference/type-aliases/TrustGeneratorComponentConfig.md +17 -0
  454. package/docs/reference/type-aliases/TrustGeneratorComponentType.md +5 -0
  455. package/docs/reference/type-aliases/TrustVerifierComponentConfig.md +17 -0
  456. package/docs/reference/type-aliases/TrustVerifierComponentType.md +5 -0
  457. package/docs/reference/type-aliases/UrlTransformerComponentConfig.md +17 -0
  458. package/docs/reference/type-aliases/UrlTransformerComponentType.md +5 -0
  459. package/docs/reference/variables/AttestationComponentType.md +2 -2
  460. package/docs/reference/variables/AttestationConnectorType.md +1 -1
  461. package/docs/reference/variables/AuditableItemGraphComponentType.md +2 -2
  462. package/docs/reference/variables/AuditableItemStreamComponentType.md +2 -2
  463. package/docs/reference/variables/AutomationActionType.md +13 -0
  464. package/docs/reference/variables/AutomationComponentType.md +19 -0
  465. package/docs/reference/variables/BackgroundTaskComponentType.md +13 -0
  466. package/docs/reference/variables/BlobStorageComponentType.md +2 -2
  467. package/docs/reference/variables/BlobStorageConnectorType.md +6 -6
  468. package/docs/reference/variables/ContextIdHandlerComponentType.md +2 -2
  469. package/docs/reference/variables/DataConverterConnectorType.md +2 -2
  470. package/docs/reference/variables/DataExtractorConnectorType.md +1 -1
  471. package/docs/reference/variables/DataProcessingComponentType.md +2 -2
  472. package/docs/reference/variables/DataspaceControlPlaneComponentType.md +19 -0
  473. package/docs/reference/variables/{DataSpaceConnectorComponentType.md → DataspaceDataPlaneComponentType.md} +6 -6
  474. package/docs/reference/variables/DltConfigType.md +1 -1
  475. package/docs/reference/variables/DocumentManagementComponentType.md +2 -2
  476. package/docs/reference/variables/EntityStorageComponentType.md +2 -2
  477. package/docs/reference/variables/EntityStorageConnectorType.md +10 -10
  478. package/docs/reference/variables/EventBusComponentType.md +2 -2
  479. package/docs/reference/variables/EventBusConnectorType.md +1 -1
  480. package/docs/reference/variables/FaucetConnectorType.md +2 -2
  481. package/docs/reference/variables/FederatedCatalogueComponentType.md +2 -2
  482. package/docs/reference/variables/FederatedCatalogueFilterComponentType.md +13 -0
  483. package/docs/reference/variables/HealthComponentType.md +19 -0
  484. package/docs/reference/variables/IdentityComponentType.md +2 -2
  485. package/docs/reference/variables/IdentityConnectorType.md +2 -2
  486. package/docs/reference/variables/IdentityProfileComponentType.md +2 -2
  487. package/docs/reference/variables/IdentityProfileConnectorType.md +1 -1
  488. package/docs/reference/variables/IdentityResolverComponentType.md +2 -2
  489. package/docs/reference/variables/IdentityResolverConnectorType.md +3 -3
  490. package/docs/reference/variables/ImmutableProofComponentType.md +2 -2
  491. package/docs/reference/variables/LoggingComponentType.md +2 -2
  492. package/docs/reference/variables/LoggingConnectorType.md +3 -3
  493. package/docs/reference/variables/MessagingAdminComponentType.md +1 -1
  494. package/docs/reference/variables/MessagingComponentType.md +1 -1
  495. package/docs/reference/variables/MessagingEmailConnectorType.md +2 -2
  496. package/docs/reference/variables/MessagingPushNotificationConnectorType.md +2 -2
  497. package/docs/reference/variables/MessagingSmsConnectorType.md +2 -2
  498. package/docs/reference/variables/MetricsCollectorComponentType.md +13 -0
  499. package/docs/reference/variables/MetricsProducerComponentType.md +19 -0
  500. package/docs/reference/variables/NftComponentType.md +2 -2
  501. package/docs/reference/variables/NftConnectorType.md +2 -2
  502. package/docs/reference/variables/NotarizationComponentType.md +19 -0
  503. package/docs/reference/variables/NotarizationConnectorType.md +19 -0
  504. package/docs/reference/variables/RightsManagementPapComponentType.md +2 -2
  505. package/docs/reference/variables/RightsManagementPdpComponentType.md +1 -1
  506. package/docs/reference/variables/RightsManagementPepComponentType.md +2 -2
  507. package/docs/reference/variables/RightsManagementPipComponentType.md +1 -1
  508. package/docs/reference/variables/RightsManagementPmpComponentType.md +1 -1
  509. package/docs/reference/variables/RightsManagementPnapComponentType.md +2 -2
  510. package/docs/reference/variables/RightsManagementPnpComponentType.md +2 -2
  511. package/docs/reference/variables/RightsManagementPolicyArbiterComponentType.md +19 -0
  512. package/docs/reference/variables/RightsManagementPolicyEnforcementProcessorComponentType.md +19 -0
  513. package/docs/reference/variables/RightsManagementPolicyExecutionActionComponentType.md +13 -0
  514. package/docs/reference/variables/RightsManagementPolicyInformationSourceComponentType.md +19 -0
  515. package/docs/reference/variables/RightsManagementPolicyNegotiatorComponentType.md +13 -0
  516. package/docs/reference/variables/RightsManagementPolicyObligationEnforcerComponentType.md +13 -0
  517. package/docs/reference/variables/RightsManagementPolicyRequesterComponentType.md +13 -0
  518. package/docs/reference/variables/RightsManagementPxpComponentType.md +1 -1
  519. package/docs/reference/variables/SynchronisedStorageComponentType.md +2 -2
  520. package/docs/reference/variables/TaskSchedulerComponentType.md +1 -1
  521. package/docs/reference/variables/TelemetryComponentType.md +2 -2
  522. package/docs/reference/variables/TelemetryConnectorType.md +7 -1
  523. package/docs/reference/variables/TenantAdminComponentType.md +1 -1
  524. package/docs/reference/variables/TrustComponentType.md +13 -0
  525. package/docs/reference/variables/TrustGeneratorComponentType.md +13 -0
  526. package/docs/reference/variables/TrustVerifierComponentType.md +13 -0
  527. package/docs/reference/variables/UrlTransformerComponentType.md +13 -0
  528. package/docs/reference/variables/VaultConnectorType.md +2 -2
  529. package/docs/reference/variables/VerifiableStorageComponentType.md +2 -2
  530. package/docs/reference/variables/VerifiableStorageConnectorType.md +2 -2
  531. package/docs/reference/variables/WalletConnectorType.md +2 -2
  532. package/package.json +32 -12
  533. package/dist/es/components/authenticationGenerator.js +0 -30
  534. package/dist/es/components/authenticationGenerator.js.map +0 -1
  535. package/dist/es/components/dataSpaceConnector.js +0 -52
  536. package/dist/es/components/dataSpaceConnector.js.map +0 -1
  537. package/dist/es/components/rightsManagementDap.js +0 -38
  538. package/dist/es/components/rightsManagementDap.js.map +0 -1
  539. package/dist/es/components/rightsManagementDarp.js +0 -29
  540. package/dist/es/components/rightsManagementDarp.js.map +0 -1
  541. package/dist/es/models/config/authenticationGeneratorComponentConfig.js +0 -2
  542. package/dist/es/models/config/authenticationGeneratorComponentConfig.js.map +0 -1
  543. package/dist/es/models/config/backgroundTaskConnectorConfig.js +0 -2
  544. package/dist/es/models/config/backgroundTaskConnectorConfig.js.map +0 -1
  545. package/dist/es/models/config/dataSpaceConnectorComponentConfig.js +0 -2
  546. package/dist/es/models/config/dataSpaceConnectorComponentConfig.js.map +0 -1
  547. package/dist/es/models/config/rightsManagementDapComponentConfig.js +0 -2
  548. package/dist/es/models/config/rightsManagementDapComponentConfig.js.map +0 -1
  549. package/dist/es/models/config/rightsManagementDarpComponentConfig.js +0 -2
  550. package/dist/es/models/config/rightsManagementDarpComponentConfig.js.map +0 -1
  551. package/dist/es/models/types/authenticationGeneratorComponentType.js +0 -13
  552. package/dist/es/models/types/authenticationGeneratorComponentType.js.map +0 -1
  553. package/dist/es/models/types/backgroundTaskConnectorType.js +0 -13
  554. package/dist/es/models/types/backgroundTaskConnectorType.js.map +0 -1
  555. package/dist/es/models/types/dataSpaceConnectorComponentType.js.map +0 -1
  556. package/dist/es/models/types/rightsManagementDapComponentType.js.map +0 -1
  557. package/dist/es/models/types/rightsManagementDarpComponentType.js.map +0 -1
  558. package/dist/types/components/authenticationGenerator.d.ts +0 -17
  559. package/dist/types/components/dataSpaceConnector.d.ts +0 -16
  560. package/dist/types/components/rightsManagementDap.d.ts +0 -16
  561. package/dist/types/components/rightsManagementDarp.d.ts +0 -16
  562. package/dist/types/models/config/authenticationGeneratorComponentConfig.d.ts +0 -9
  563. package/dist/types/models/config/backgroundTaskConnectorConfig.d.ts +0 -9
  564. package/dist/types/models/config/dataSpaceConnectorComponentConfig.d.ts +0 -17
  565. package/dist/types/models/config/rightsManagementDapComponentConfig.d.ts +0 -16
  566. package/dist/types/models/config/rightsManagementDarpComponentConfig.d.ts +0 -12
  567. package/dist/types/models/types/authenticationGeneratorComponentType.d.ts +0 -13
  568. package/dist/types/models/types/backgroundTaskConnectorType.d.ts +0 -13
  569. package/dist/types/models/types/dataSpaceConnectorComponentType.d.ts +0 -21
  570. package/dist/types/models/types/rightsManagementDapComponentType.d.ts +0 -17
  571. package/dist/types/models/types/rightsManagementDarpComponentType.d.ts +0 -13
  572. package/docs/reference/functions/initialiseAuthenticationGeneratorComponent.md +0 -31
  573. package/docs/reference/functions/initialiseBackgroundTaskConnector.md +0 -31
  574. package/docs/reference/functions/initialiseDataSpaceConnectorComponent.md +0 -31
  575. package/docs/reference/functions/initialiseRightsManagementDapComponent.md +0 -31
  576. package/docs/reference/functions/initialiseRightsManagementDarpComponent.md +0 -31
  577. package/docs/reference/type-aliases/AuthenticationGeneratorComponentConfig.md +0 -17
  578. package/docs/reference/type-aliases/AuthenticationGeneratorComponentType.md +0 -5
  579. package/docs/reference/type-aliases/BackgroundTaskConnectorConfig.md +0 -17
  580. package/docs/reference/type-aliases/BackgroundTaskConnectorType.md +0 -5
  581. package/docs/reference/type-aliases/DataSpaceConnectorComponentConfig.md +0 -5
  582. package/docs/reference/type-aliases/DataSpaceConnectorComponentType.md +0 -5
  583. package/docs/reference/type-aliases/RightsManagementDapComponentConfig.md +0 -5
  584. package/docs/reference/type-aliases/RightsManagementDapComponentType.md +0 -5
  585. package/docs/reference/type-aliases/RightsManagementDarpComponentConfig.md +0 -23
  586. package/docs/reference/type-aliases/RightsManagementDarpComponentType.md +0 -5
  587. package/docs/reference/variables/AuthenticationGeneratorComponentType.md +0 -13
  588. package/docs/reference/variables/BackgroundTaskConnectorType.md +0 -13
  589. package/docs/reference/variables/RightsManagementDapComponentType.md +0 -19
  590. package/docs/reference/variables/RightsManagementDarpComponentType.md +0 -13
@@ -1 +1 @@
1
- {"version":3,"file":"immutableProof.js","sourceRoot":"","sources":["../../../src/components/immutableProof.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACv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AC,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,EAAE,MAAM,gBAAgB,CAAC;AAOlD,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;AAC7F,OAAO,EAAE,gBAAgB,EAA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,CAAC;IAED,OAAO;QACN,eAAe,EAAE,eAAsE;QACvF,gBAAgB;QAChB,OAAO,EAAE,gBAAgB;KACzB,CAAC;AACH,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { ContextIdHelper, ContextIdKeys } from \"@twin.org/context\";\nimport { ComponentFactory } from \"@twin.org/core\";\nimport type { IComponent } from \"@twin.org/core\";\nimport type {\n\tEngineTypeInitialiserReturn,\n\tIEngineCore,\n\tIEngineCoreContext\n} from \"@twin.org/engine-models\";\nimport { 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\";\nimport { EngineTypeHelper } from \"../utils/engineTypeHelper.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 function initialiseImmutableProofComponent(\n\tengineCore: IEngineCore<IEngineConfig>,\n\tcontext: IEngineCoreContext<IEngineConfig>,\n\tinstanceConfig: ImmutableProofComponentConfig\n): EngineTypeInitialiserReturn<typeof instanceConfig, typeof ComponentFactory> {\n\tlet createComponent;\n\tlet instanceTypeName;\n\n\tif (instanceConfig.type === ImmutableProofComponentType.Service) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) => {\n\t\t\tinitSchemaImmutableProof();\n\n\t\t\tinitialiseEntityStorageConnector(\n\t\t\t\tengineCore,\n\t\t\t\tcontext,\n\t\t\t\tcreateConfig.options?.immutableProofEntityStorageType,\n\t\t\t\tnameof<ImmutableProof>(),\n\t\t\t\tContextIdHelper.pickKeysFromAvailable(engineCore.getContextIdKeys(), [\n\t\t\t\t\tContextIdKeys.Node,\n\t\t\t\t\tContextIdKeys.Tenant\n\t\t\t\t])\n\t\t\t);\n\t\t\treturn new ImmutableProofService(\n\t\t\t\tEngineTypeHelper.mergeConfig<(typeof instanceConfig)[\"options\"]>(\n\t\t\t\t\t{\n\t\t\t\t\t\tverifiableStorageType: engineCore.getRegisteredInstanceType(\n\t\t\t\t\t\t\t\"verifiableStorageConnector\"\n\t\t\t\t\t\t),\n\t\t\t\t\t\tidentityConnectorType: engineCore.getRegisteredInstanceType(\"identityConnector\"),\n\t\t\t\t\t\tloggingComponentType: engineCore.getRegisteredInstanceType(\"loggingComponent\"),\n\t\t\t\t\t\tbackgroundTaskComponentType:\n\t\t\t\t\t\t\tengineCore.getRegisteredInstanceType(\"backgroundTaskComponent\"),\n\t\t\t\t\t\teventBusComponentType: engineCore.getRegisteredInstanceTypeOptional(\"eventBusComponent\")\n\t\t\t\t\t},\n\t\t\t\t\tcreateConfig.options\n\t\t\t\t)\n\t\t\t);\n\t\t};\n\t\tinstanceTypeName = nameofKebabCase(ImmutableProofService);\n\t} else if (instanceConfig.type === ImmutableProofComponentType.RestClient) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) =>\n\t\t\tnew ImmutableProofRestClient(\n\t\t\t\tEngineTypeHelper.mergeConfig<(typeof instanceConfig)[\"options\"]>(createConfig.options)\n\t\t\t);\n\t\tinstanceTypeName = nameofKebabCase(ImmutableProofRestClient);\n\t}\n\n\treturn {\n\t\tcreateComponent: createComponent as (createConfig: typeof instanceConfig) => IComponent,\n\t\tinstanceTypeName,\n\t\tfactory: ComponentFactory\n\t};\n}\n"]}
@@ -10,6 +10,7 @@ import { LoggingService } from "@twin.org/logging-service";
10
10
  import { initialiseEntityStorageConnector } from "./entityStorage.js";
11
11
  import { LoggingComponentType } from "../models/types/loggingComponentType.js";
12
12
  import { LoggingConnectorType } from "../models/types/loggingConnectorType.js";
13
+ import { EngineTypeHelper } from "../utils/engineTypeHelper.js";
13
14
  /**
14
15
  * Initialise the logging connector.
15
16
  * @param engineCore The engine core.
@@ -17,29 +18,31 @@ import { LoggingConnectorType } from "../models/types/loggingConnectorType.js";
17
18
  * @param instanceConfig The instance config.
18
19
  * @returns The instance created and the factory for it.
19
20
  */
20
- export async function initialiseLoggingConnector(engineCore, context, instanceConfig) {
21
- let component;
22
- let instanceType;
21
+ export function initialiseLoggingConnector(engineCore, context, instanceConfig) {
22
+ let createComponent;
23
+ let instanceTypeName;
23
24
  if (instanceConfig.type === LoggingConnectorType.Console) {
24
- component = new ConsoleLoggingConnector(instanceConfig.options);
25
- instanceType = ConsoleLoggingConnector.NAMESPACE;
25
+ createComponent = (createConfig) => new ConsoleLoggingConnector(EngineTypeHelper.mergeConfig(createConfig.options));
26
+ instanceTypeName = ConsoleLoggingConnector.NAMESPACE;
26
27
  }
27
28
  else if (instanceConfig.type === LoggingConnectorType.EntityStorage) {
28
- initSchemaLogging();
29
- initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.logEntryStorageConnectorType, "LogEntry", ContextIdHelper.pickKeysFromAvailable(engineCore.getContextIdKeys(), [
30
- ContextIdKeys.Node,
31
- ContextIdKeys.Tenant
32
- ]));
33
- component = new EntityStorageLoggingConnector(instanceConfig.options);
34
- instanceType = EntityStorageLoggingConnector.NAMESPACE;
29
+ createComponent = (createConfig) => {
30
+ initSchemaLogging();
31
+ initialiseEntityStorageConnector(engineCore, context, createConfig.options?.logEntryStorageConnectorType, "LogEntry", ContextIdHelper.pickKeysFromAvailable(engineCore.getContextIdKeys(), [
32
+ ContextIdKeys.Node,
33
+ ContextIdKeys.Tenant
34
+ ]));
35
+ return new EntityStorageLoggingConnector(EngineTypeHelper.mergeConfig(createConfig.options));
36
+ };
37
+ instanceTypeName = EntityStorageLoggingConnector.NAMESPACE;
35
38
  }
36
39
  else if (instanceConfig.type === LoggingConnectorType.Multi) {
37
- component = new MultiLoggingConnector(instanceConfig.options);
38
- instanceType = MultiLoggingConnector.NAMESPACE;
40
+ createComponent = (createConfig) => new MultiLoggingConnector(EngineTypeHelper.mergeConfig(createConfig.options));
41
+ instanceTypeName = MultiLoggingConnector.NAMESPACE;
39
42
  }
40
43
  return {
41
- component,
42
- instanceType,
44
+ createComponent: createComponent,
45
+ instanceTypeName,
43
46
  factory: LoggingConnectorFactory
44
47
  };
45
48
  }
@@ -50,23 +53,20 @@ export async function initialiseLoggingConnector(engineCore, context, instanceCo
50
53
  * @param instanceConfig The instance config.
51
54
  * @returns The instance created and the factory for it.
52
55
  */
53
- export async function initialiseLoggingComponent(engineCore, context, instanceConfig) {
54
- let component;
55
- let instanceType;
56
+ export function initialiseLoggingComponent(engineCore, context, instanceConfig) {
57
+ let createComponent;
58
+ let instanceTypeName;
56
59
  if (instanceConfig.type === LoggingComponentType.Service) {
57
- component = new LoggingService({
58
- loggingConnectorType: engineCore.getRegisteredInstanceType("loggingConnector"),
59
- ...instanceConfig.options
60
- });
61
- instanceType = "logging-service";
60
+ createComponent = (createConfig) => new LoggingService(EngineTypeHelper.mergeConfig({ loggingConnectorType: engineCore.getRegisteredInstanceType("loggingConnector") }, createConfig.options));
61
+ instanceTypeName = "logging-service";
62
62
  }
63
63
  else if (instanceConfig.type === LoggingComponentType.RestClient) {
64
- component = new LoggingRestClient(instanceConfig.options);
65
- instanceType = "logging-rest-client";
64
+ createComponent = (createConfig) => new LoggingRestClient(EngineTypeHelper.mergeConfig(createConfig.options));
65
+ instanceTypeName = "logging-rest-client";
66
66
  }
67
67
  return {
68
- component,
69
- instanceType,
68
+ createComponent: createComponent,
69
+ instanceTypeName,
70
70
  factory: ComponentFactory
71
71
  };
72
72
  }
@@ -1 +1 @@
1
- {"version":3,"file":"logging.js","sourceRoot":"","sources":["../../../src/components/logging.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,eAAe,EAAE,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6BAA6B,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;QACtE,YAAY,GAAG,6BAA6B,CAAC,SAAS,CAAC;IACxD,CAAC;SAAM,IAAI,cAAc,CAAC,IAAI,KAAK,oBAAoB,CAAC,KAAK,EAAE,CAAC;QAC/D,SAAS,GAAG,IAAI,qBAAqB,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;QAC9D,YAAY,GAAG,qBAAqB,CAAC,SAAS,CAAC;IAChD,CAAC;IAED,OAAO;QACN,SAAS;QACT,YAAY;QACZ,OAAO,EAAE,uBAAuB;KAChC,CAAC;AACH,CAAC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,0BAA0B,CAC/C,UAAsC,EACtC,OAA0C,EAC1C,cAAsC;IAMtC,IAAI,SAAwC,CAAC;IAC7C,IAAI,YAAgC,CAAC;IAErC,IAAI,cAAc,CAAC,IAAI,KAAK,oBAAoB,CAAC,OAAO,EAAE,CAAC;QAC1D,SAAS,GAAG,IAAI,cAAc,CAAC;YAC9B,oBAAoB,EAAE,UAAU,CAAC,yBAAyB,CAAC,kBAAkB,CAAC;YAC9E,GAAG,cAAc,CAAC,OAAO;SACzB,CAAC,CAAC;QACH,YAAY,oBAAkC,CAAC;IAChD,CAAC;SAAM,IAAI,cAAc,CAAC,IAAI,KAAK,oBAAoB,CAAC,UAAU,EAAE,CAAC;QACpE,SAAS,GAAG,IAAI,iBAAiB,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;QAC1D,YAAY,wBAAqC,CAAC;IACnD,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 { ConsoleLoggingConnector } from \"@twin.org/logging-connector-console\";\nimport {\n\tEntityStorageLoggingConnector,\n\tinitSchema as initSchemaLogging,\n\ttype LogEntry\n} from \"@twin.org/logging-connector-entity-storage\";\nimport {\n\tLoggingConnectorFactory,\n\tMultiLoggingConnector,\n\ttype ILoggingComponent,\n\ttype ILoggingConnector\n} from \"@twin.org/logging-models\";\nimport { LoggingRestClient } from \"@twin.org/logging-rest-client\";\nimport { LoggingService } from \"@twin.org/logging-service\";\nimport { nameof, nameofKebabCase } from \"@twin.org/nameof\";\nimport { initialiseEntityStorageConnector } from \"./entityStorage.js\";\nimport type { LoggingComponentConfig } from \"../models/config/loggingComponentConfig.js\";\nimport type { LoggingConnectorConfig } from \"../models/config/loggingConnectorConfig.js\";\nimport type { IEngineConfig } from \"../models/IEngineConfig.js\";\nimport { LoggingComponentType } from \"../models/types/loggingComponentType.js\";\nimport { LoggingConnectorType } from \"../models/types/loggingConnectorType.js\";\n\n/**\n * Initialise the logging connector.\n * @param engineCore The engine core.\n * @param context The engine core context.\n * @param instanceConfig The instance config.\n * @returns The instance created and the factory for it.\n */\nexport async function initialiseLoggingConnector(\n\tengineCore: IEngineCore<IEngineConfig>,\n\tcontext: IEngineCoreContext<IEngineConfig>,\n\tinstanceConfig: LoggingConnectorConfig\n): Promise<{\n\tinstanceType?: string;\n\tfactory?: typeof LoggingConnectorFactory;\n\tcomponent?: IComponent;\n}> {\n\tlet component: ILoggingConnector | undefined;\n\tlet instanceType: string | undefined;\n\n\tif (instanceConfig.type === LoggingConnectorType.Console) {\n\t\tcomponent = new ConsoleLoggingConnector(instanceConfig.options);\n\t\tinstanceType = ConsoleLoggingConnector.NAMESPACE;\n\t} else if (instanceConfig.type === LoggingConnectorType.EntityStorage) {\n\t\tinitSchemaLogging();\n\t\tinitialiseEntityStorageConnector(\n\t\t\tengineCore,\n\t\t\tcontext,\n\t\t\tinstanceConfig.options?.logEntryStorageConnectorType,\n\t\t\tnameof<LogEntry>(),\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\t\tcomponent = new EntityStorageLoggingConnector(instanceConfig.options);\n\t\tinstanceType = EntityStorageLoggingConnector.NAMESPACE;\n\t} else if (instanceConfig.type === LoggingConnectorType.Multi) {\n\t\tcomponent = new MultiLoggingConnector(instanceConfig.options);\n\t\tinstanceType = MultiLoggingConnector.NAMESPACE;\n\t}\n\n\treturn {\n\t\tcomponent,\n\t\tinstanceType,\n\t\tfactory: LoggingConnectorFactory\n\t};\n}\n\n/**\n * Initialise the logging 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 initialiseLoggingComponent(\n\tengineCore: IEngineCore<IEngineConfig>,\n\tcontext: IEngineCoreContext<IEngineConfig>,\n\tinstanceConfig: LoggingComponentConfig\n): Promise<{\n\tinstanceType?: string;\n\tfactory?: typeof ComponentFactory;\n\tcomponent?: IComponent;\n}> {\n\tlet component: ILoggingComponent | undefined;\n\tlet instanceType: string | undefined;\n\n\tif (instanceConfig.type === LoggingComponentType.Service) {\n\t\tcomponent = new LoggingService({\n\t\t\tloggingConnectorType: engineCore.getRegisteredInstanceType(\"loggingConnector\"),\n\t\t\t...instanceConfig.options\n\t\t});\n\t\tinstanceType = nameofKebabCase(LoggingService);\n\t} else if (instanceConfig.type === LoggingComponentType.RestClient) {\n\t\tcomponent = new LoggingRestClient(instanceConfig.options);\n\t\tinstanceType = nameofKebabCase(LoggingRestClient);\n\t}\n\n\treturn {\n\t\tcomponent,\n\t\tinstanceType,\n\t\tfactory: ComponentFactory\n\t};\n}\n"]}
1
+ {"version":3,"file":"logging.js","sourceRoot":"","sources":["../../../src/components/logging.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,mB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B,CAAC,WAAW,CAAqC,YAAY,CAAC,OAAO,CAAC,CACtF,CAAC;QACH,gBAAgB,wBAAqC,CAAC;IACvD,CAAC;IAED,OAAO;QACN,eAAe,EAAE,eAAsE;QACvF,gBAAgB;QAChB,OAAO,EAAE,gBAAgB;KACzB,CAAC;AACH,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { ContextIdHelper, ContextIdKeys } from \"@twin.org/context\";\nimport { ComponentFactory, type IComponent } from \"@twin.org/core\";\nimport type {\n\tEngineTypeInitialiserReturn,\n\tIEngineCore,\n\tIEngineCoreContext\n} from \"@twin.org/engine-models\";\nimport { ConsoleLoggingConnector } from \"@twin.org/logging-connector-console\";\nimport {\n\tEntityStorageLoggingConnector,\n\tinitSchema as initSchemaLogging,\n\ttype LogEntry\n} from \"@twin.org/logging-connector-entity-storage\";\nimport { LoggingConnectorFactory, MultiLoggingConnector } from \"@twin.org/logging-models\";\nimport { LoggingRestClient } from \"@twin.org/logging-rest-client\";\nimport { LoggingService } from \"@twin.org/logging-service\";\nimport { nameof, nameofKebabCase } from \"@twin.org/nameof\";\nimport { initialiseEntityStorageConnector } from \"./entityStorage.js\";\nimport type { LoggingComponentConfig } from \"../models/config/loggingComponentConfig.js\";\nimport type { LoggingConnectorConfig } from \"../models/config/loggingConnectorConfig.js\";\nimport type { IEngineConfig } from \"../models/IEngineConfig.js\";\nimport { LoggingComponentType } from \"../models/types/loggingComponentType.js\";\nimport { LoggingConnectorType } from \"../models/types/loggingConnectorType.js\";\nimport { EngineTypeHelper } from \"../utils/engineTypeHelper.js\";\n\n/**\n * Initialise the logging connector.\n * @param engineCore The engine core.\n * @param context The engine core context.\n * @param instanceConfig The instance config.\n * @returns The instance created and the factory for it.\n */\nexport function initialiseLoggingConnector(\n\tengineCore: IEngineCore<IEngineConfig>,\n\tcontext: IEngineCoreContext<IEngineConfig>,\n\tinstanceConfig: LoggingConnectorConfig\n): EngineTypeInitialiserReturn<typeof instanceConfig, typeof LoggingConnectorFactory> {\n\tlet createComponent;\n\tlet instanceTypeName;\n\n\tif (instanceConfig.type === LoggingConnectorType.Console) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) =>\n\t\t\tnew ConsoleLoggingConnector(\n\t\t\t\tEngineTypeHelper.mergeConfig<(typeof instanceConfig)[\"options\"]>(createConfig.options)\n\t\t\t);\n\t\tinstanceTypeName = ConsoleLoggingConnector.NAMESPACE;\n\t} else if (instanceConfig.type === LoggingConnectorType.EntityStorage) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) => {\n\t\t\tinitSchemaLogging();\n\t\t\tinitialiseEntityStorageConnector(\n\t\t\t\tengineCore,\n\t\t\t\tcontext,\n\t\t\t\tcreateConfig.options?.logEntryStorageConnectorType,\n\t\t\t\tnameof<LogEntry>(),\n\t\t\t\tContextIdHelper.pickKeysFromAvailable(engineCore.getContextIdKeys(), [\n\t\t\t\t\tContextIdKeys.Node,\n\t\t\t\t\tContextIdKeys.Tenant\n\t\t\t\t])\n\t\t\t);\n\t\t\treturn new EntityStorageLoggingConnector(\n\t\t\t\tEngineTypeHelper.mergeConfig<(typeof instanceConfig)[\"options\"]>(createConfig.options)\n\t\t\t);\n\t\t};\n\t\tinstanceTypeName = EntityStorageLoggingConnector.NAMESPACE;\n\t} else if (instanceConfig.type === LoggingConnectorType.Multi) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) =>\n\t\t\tnew MultiLoggingConnector(\n\t\t\t\tEngineTypeHelper.mergeConfig<(typeof instanceConfig)[\"options\"]>(createConfig.options)\n\t\t\t);\n\t\tinstanceTypeName = MultiLoggingConnector.NAMESPACE;\n\t}\n\n\treturn {\n\t\tcreateComponent: createComponent as (createConfig: typeof instanceConfig) => IComponent,\n\t\tinstanceTypeName,\n\t\tfactory: LoggingConnectorFactory\n\t};\n}\n\n/**\n * Initialise the logging component.\n * @param engineCore The engine core.\n * @param context The context for the engine.\n * @param instanceConfig The instance config.\n * @returns The instance created and the factory for it.\n */\nexport function initialiseLoggingComponent(\n\tengineCore: IEngineCore<IEngineConfig>,\n\tcontext: IEngineCoreContext<IEngineConfig>,\n\tinstanceConfig: LoggingComponentConfig\n): EngineTypeInitialiserReturn<typeof instanceConfig, typeof ComponentFactory> {\n\tlet createComponent;\n\tlet instanceTypeName;\n\n\tif (instanceConfig.type === LoggingComponentType.Service) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) =>\n\t\t\tnew LoggingService(\n\t\t\t\tEngineTypeHelper.mergeConfig<(typeof instanceConfig)[\"options\"]>(\n\t\t\t\t\t{ loggingConnectorType: engineCore.getRegisteredInstanceType(\"loggingConnector\") },\n\t\t\t\t\tcreateConfig.options\n\t\t\t\t)\n\t\t\t);\n\t\tinstanceTypeName = nameofKebabCase(LoggingService);\n\t} else if (instanceConfig.type === LoggingComponentType.RestClient) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) =>\n\t\t\tnew LoggingRestClient(\n\t\t\t\tEngineTypeHelper.mergeConfig<(typeof instanceConfig)[\"options\"]>(createConfig.options)\n\t\t\t);\n\t\tinstanceTypeName = nameofKebabCase(LoggingRestClient);\n\t}\n\n\treturn {\n\t\tcreateComponent: createComponent as (createConfig: typeof instanceConfig) => IComponent,\n\t\tinstanceTypeName,\n\t\tfactory: ComponentFactory\n\t};\n}\n"]}
@@ -12,6 +12,7 @@ import { MessagingComponentType } from "../models/types/messagingComponentType.j
12
12
  import { MessagingEmailConnectorType } from "../models/types/messagingEmailConnectorType.js";
13
13
  import { MessagingPushNotificationConnectorType } from "../models/types/messagingPushNotificationConnectorType.js";
14
14
  import { MessagingSmsConnectorType } from "../models/types/messagingSmsConnectorType.js";
15
+ import { EngineTypeHelper } from "../utils/engineTypeHelper.js";
15
16
  /**
16
17
  * Initialise a messaging email connector.
17
18
  * @param engineCore The engine core.
@@ -19,31 +20,27 @@ import { MessagingSmsConnectorType } from "../models/types/messagingSmsConnector
19
20
  * @param instanceConfig The instance config.
20
21
  * @returns The instance created and the factory for it.
21
22
  */
22
- export async function initialiseMessagingEmailConnector(engineCore, context, instanceConfig) {
23
- let component;
24
- let instanceType;
23
+ export function initialiseMessagingEmailConnector(engineCore, context, instanceConfig) {
24
+ let createComponent;
25
+ let instanceTypeName;
25
26
  if (instanceConfig.type === MessagingEmailConnectorType.EntityStorage) {
26
- initSchema({ email: true, sms: false, pushNotification: false });
27
- initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.messagingEmailEntryStorageConnectorType, "EmailEntry", ContextIdHelper.pickKeysFromAvailable(engineCore.getContextIdKeys(), [
28
- ContextIdKeys.Node,
29
- ContextIdKeys.Tenant
30
- ]));
31
- component = new EntityStorageMessagingEmailConnector({
32
- loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
33
- ...instanceConfig.options
34
- });
35
- instanceType = EntityStorageMessagingEmailConnector.NAMESPACE;
27
+ createComponent = (createConfig) => {
28
+ initSchema({ email: true, sms: false, pushNotification: false });
29
+ initialiseEntityStorageConnector(engineCore, context, createConfig.options?.messagingEmailEntryStorageConnectorType, "EmailEntry", ContextIdHelper.pickKeysFromAvailable(engineCore.getContextIdKeys(), [
30
+ ContextIdKeys.Node,
31
+ ContextIdKeys.Tenant
32
+ ]));
33
+ return new EntityStorageMessagingEmailConnector(EngineTypeHelper.mergeConfig({ loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent") }, createConfig.options));
34
+ };
35
+ instanceTypeName = EntityStorageMessagingEmailConnector.NAMESPACE;
36
36
  }
37
37
  else if (instanceConfig.type === MessagingEmailConnectorType.Aws) {
38
- component = new AwsMessagingEmailConnector({
39
- loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
40
- ...instanceConfig.options
41
- });
42
- instanceType = AwsMessagingEmailConnector.NAMESPACE;
38
+ createComponent = (createConfig) => new AwsMessagingEmailConnector(EngineTypeHelper.mergeConfig({ loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent") }, createConfig.options));
39
+ instanceTypeName = AwsMessagingEmailConnector.NAMESPACE;
43
40
  }
44
41
  return {
45
- component,
46
- instanceType,
42
+ createComponent: createComponent,
43
+ instanceTypeName,
47
44
  factory: MessagingEmailConnectorFactory
48
45
  };
49
46
  }
@@ -54,32 +51,28 @@ export async function initialiseMessagingEmailConnector(engineCore, context, ins
54
51
  * @param instanceConfig The instance config.
55
52
  * @returns The instance created and the factory for it.
56
53
  */
57
- export async function initialiseMessagingSmsConnector(engineCore, context, instanceConfig) {
58
- let connector;
59
- let instanceType;
54
+ export function initialiseMessagingSmsConnector(engineCore, context, instanceConfig) {
55
+ let createComponent;
56
+ let instanceTypeName;
60
57
  if (instanceConfig.type === MessagingSmsConnectorType.EntityStorage) {
61
- initSchema({ email: false, sms: true, pushNotification: false });
62
- initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.messagingSmsEntryStorageConnectorType, "SmsEntry", ContextIdHelper.pickKeysFromAvailable(engineCore.getContextIdKeys(), [
63
- ContextIdKeys.Node,
64
- ContextIdKeys.Tenant
65
- ]));
66
- connector = new EntityStorageMessagingSmsConnector({
67
- loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
68
- ...instanceConfig.options
69
- });
70
- instanceType = EntityStorageMessagingSmsConnector.NAMESPACE;
58
+ createComponent = (createConfig) => {
59
+ initSchema({ email: false, sms: true, pushNotification: false });
60
+ initialiseEntityStorageConnector(engineCore, context, createConfig.options?.messagingSmsEntryStorageConnectorType, "SmsEntry", ContextIdHelper.pickKeysFromAvailable(engineCore.getContextIdKeys(), [
61
+ ContextIdKeys.Node,
62
+ ContextIdKeys.Tenant
63
+ ]));
64
+ return new EntityStorageMessagingSmsConnector(EngineTypeHelper.mergeConfig({ loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent") }, createConfig.options));
65
+ };
66
+ instanceTypeName = EntityStorageMessagingSmsConnector.NAMESPACE;
71
67
  }
72
68
  else if (instanceConfig.type === MessagingSmsConnectorType.Aws) {
73
- connector = new AwsMessagingSmsConnector({
74
- loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
75
- ...instanceConfig.options
76
- });
77
- instanceType = AwsMessagingSmsConnector.NAMESPACE;
69
+ createComponent = (createConfig) => new AwsMessagingSmsConnector(EngineTypeHelper.mergeConfig({ loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent") }, createConfig.options));
70
+ instanceTypeName = AwsMessagingSmsConnector.NAMESPACE;
78
71
  }
79
72
  return {
80
- instanceType,
81
- factory: MessagingSmsConnectorFactory,
82
- component: connector
73
+ createComponent: createComponent,
74
+ instanceTypeName,
75
+ factory: MessagingSmsConnectorFactory
83
76
  };
84
77
  }
85
78
  /**
@@ -89,35 +82,31 @@ export async function initialiseMessagingSmsConnector(engineCore, context, insta
89
82
  * @param instanceConfig The instance config.
90
83
  * @returns The instance created and the factory for it.
91
84
  */
92
- export async function initialiseMessagingPushNotificationConnector(engineCore, context, instanceConfig) {
93
- let component;
94
- let instanceType;
85
+ export function initialiseMessagingPushNotificationConnector(engineCore, context, instanceConfig) {
86
+ let createComponent;
87
+ let instanceTypeName;
95
88
  if (instanceConfig.type === MessagingPushNotificationConnectorType.EntityStorage) {
96
- initSchema({ email: false, sms: false, pushNotification: true });
97
- initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.messagingDeviceEntryStorageConnectorType, "PushNotificationDeviceEntry", ContextIdHelper.pickKeysFromAvailable(engineCore.getContextIdKeys(), [
98
- ContextIdKeys.Node,
99
- ContextIdKeys.Tenant
100
- ]));
101
- initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.messagingMessageEntryStorageConnectorType, "PushNotificationMessageEntry", ContextIdHelper.pickKeysFromAvailable(engineCore.getContextIdKeys(), [
102
- ContextIdKeys.Node,
103
- ContextIdKeys.Tenant
104
- ]));
105
- component = new EntityStorageMessagingPushNotificationConnector({
106
- loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
107
- ...instanceConfig.options
108
- });
109
- instanceType = EntityStorageMessagingPushNotificationConnector.NAMESPACE;
89
+ createComponent = (createConfig) => {
90
+ initSchema({ email: false, sms: false, pushNotification: true });
91
+ initialiseEntityStorageConnector(engineCore, context, createConfig.options?.messagingDeviceEntryStorageConnectorType, "PushNotificationDeviceEntry", ContextIdHelper.pickKeysFromAvailable(engineCore.getContextIdKeys(), [
92
+ ContextIdKeys.Node,
93
+ ContextIdKeys.Tenant
94
+ ]));
95
+ initialiseEntityStorageConnector(engineCore, context, createConfig.options?.messagingMessageEntryStorageConnectorType, "PushNotificationMessageEntry", ContextIdHelper.pickKeysFromAvailable(engineCore.getContextIdKeys(), [
96
+ ContextIdKeys.Node,
97
+ ContextIdKeys.Tenant
98
+ ]));
99
+ return new EntityStorageMessagingPushNotificationConnector(EngineTypeHelper.mergeConfig({ loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent") }, createConfig.options));
100
+ };
101
+ instanceTypeName = EntityStorageMessagingPushNotificationConnector.NAMESPACE;
110
102
  }
111
103
  else if (instanceConfig.type === MessagingPushNotificationConnectorType.Aws) {
112
- component = new AwsMessagingPushNotificationConnector({
113
- loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
114
- ...instanceConfig.options
115
- });
116
- instanceType = AwsMessagingPushNotificationConnector.NAMESPACE;
104
+ createComponent = (createConfig) => new AwsMessagingPushNotificationConnector(EngineTypeHelper.mergeConfig({ loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent") }, createConfig.options));
105
+ instanceTypeName = AwsMessagingPushNotificationConnector.NAMESPACE;
117
106
  }
118
107
  return {
119
- component,
120
- instanceType,
108
+ createComponent: createComponent,
109
+ instanceTypeName,
121
110
  factory: MessagingPushNotificationsConnectorFactory
122
111
  };
123
112
  }
@@ -128,22 +117,21 @@ export async function initialiseMessagingPushNotificationConnector(engineCore, c
128
117
  * @param instanceConfig The instance config.
129
118
  * @returns The instance created and the factory for it.
130
119
  */
131
- export async function initialiseMessagingComponent(engineCore, context, instanceConfig) {
132
- let component;
133
- let instanceType;
120
+ export function initialiseMessagingComponent(engineCore, context, instanceConfig) {
121
+ let createComponent;
122
+ let instanceTypeName;
134
123
  if (instanceConfig.type === MessagingComponentType.Service) {
135
- component = new MessagingService({
124
+ createComponent = (createConfig) => new MessagingService(EngineTypeHelper.mergeConfig({
136
125
  messagingEmailConnectorType: engineCore.getRegisteredInstanceTypeOptional("messagingEmailConnector"),
137
126
  messagingSmsConnectorType: engineCore.getRegisteredInstanceTypeOptional("messagingSmsConnector"),
138
127
  messagingPushNotificationConnectorType: engineCore.getRegisteredInstanceTypeOptional("messagingNotificationConnector"),
139
- messagingAdminComponentType: engineCore.getRegisteredInstanceTypeOptional("messagingAdminComponent"),
140
- ...instanceConfig.options
141
- });
142
- instanceType = "messaging-service";
128
+ messagingAdminComponentType: engineCore.getRegisteredInstanceTypeOptional("messagingAdminComponent")
129
+ }, createConfig.options));
130
+ instanceTypeName = "messaging-service";
143
131
  }
144
132
  return {
145
- component,
146
- instanceType,
133
+ createComponent,
134
+ instanceTypeName,
147
135
  factory: ComponentFactory
148
136
  };
149
137
  }
@@ -154,23 +142,23 @@ export async function initialiseMessagingComponent(engineCore, context, instance
154
142
  * @param instanceConfig The instance config.
155
143
  * @returns The instance created and the factory for it.
156
144
  */
157
- export async function initialiseMessagingAdminComponent(engineCore, context, instanceConfig) {
158
- let component;
159
- let instanceType;
145
+ export function initialiseMessagingAdminComponent(engineCore, context, instanceConfig) {
146
+ let createComponent;
147
+ let instanceTypeName;
160
148
  if (instanceConfig.type === MessagingAdminComponentType.Service) {
161
- initSchemaMessagingService();
162
- initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.templateEntryStorageConnectorType, "TemplateEntry", ContextIdHelper.pickKeysFromAvailable(engineCore.getContextIdKeys(), [
163
- ContextIdKeys.Node,
164
- ContextIdKeys.Tenant
165
- ]));
166
- component = new MessagingAdminService({
167
- ...instanceConfig.options
168
- });
169
- instanceType = "messaging-admin-service";
149
+ createComponent = (createConfig) => {
150
+ initSchemaMessagingService();
151
+ initialiseEntityStorageConnector(engineCore, context, createConfig.options?.templateEntryStorageConnectorType, "TemplateEntry", ContextIdHelper.pickKeysFromAvailable(engineCore.getContextIdKeys(), [
152
+ ContextIdKeys.Node,
153
+ ContextIdKeys.Tenant
154
+ ]));
155
+ return new MessagingAdminService(EngineTypeHelper.mergeConfig(createConfig.options));
156
+ };
157
+ instanceTypeName = "messaging-admin-service";
170
158
  }
171
159
  return {
172
- component,
173
- instanceType,
160
+ createComponent,
161
+ instanceTypeName,
174
162
  factory: ComponentFactory
175
163
  };
176
164
  }
@@ -1 +1 @@
1
- {"version":3,"file":"messaging.js","sourceRoot":"","sources":["../../../src/components/messaging.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,EACN,0BAA0B,EAC1B,qCAAqC,EACrC,wBAAwB,EACxB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAEN,oCAAoC,EACpC,+CAA+C,EAC/C,kCAAkC,EAClC,UAAU,EAIV,MAAM,8CAA8C,CAAC;AACtD,OAAO,EAMN,8BAA8B,EAC9B,0CAA0C,EAC1C,4BAA4B,EAC5B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACN,UAAU,IAAI,0BAA0B,EACxC,qBAAqB,EACrB,gBAAgB,EAEhB,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAAE,gCAAgC,EAAE,MAAM,oBAAoB,CAAC;AAOtE,OAAO,EAAE,2BAA2B,EAAE,MAAM,gDAAgD,CAAC;AAC7F,OAAO,EAAE,sBAAsB,EAAE,MAAM,2CAA2C,CAAC;AACnF,OAAO,EAAE,2BAA2B,EAAE,MAAM,gDAAgD,CAAC;AAC7F,OAAO,EAAE,sCAAsC,EAAE,MAAM,2DAA2D,CAAC;AACnH,OAAO,EAAE,yBAAyB,EAAE,MAAM,8CAA8C,CAA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import { ContextIdHelper, ContextIdKeys } from \"@twin.org/context\";\nimport { ComponentFactory, type IComponent } from \"@twin.org/core\";\nimport type { IEngineCore, IEngineCoreContext } from \"@twin.org/engine-models\";\nimport {\n\tAwsMessagingEmailConnector,\n\tAwsMessagingPushNotificationConnector,\n\tAwsMessagingSmsConnector\n} from \"@twin.org/messaging-connector-aws\";\nimport {\n\ttype EmailEntry,\n\tEntityStorageMessagingEmailConnector,\n\tEntityStorageMessagingPushNotificationConnector,\n\tEntityStorageMessagingSmsConnector,\n\tinitSchema,\n\ttype PushNotificationDeviceEntry,\n\ttype PushNotificationMessageEntry,\n\ttype SmsEntry\n} from \"@twin.org/messaging-connector-entity-storage\";\nimport {\n\ttype IMessagingAdminComponent,\n\ttype IMessagingComponent,\n\ttype IMessagingEmailConnector,\n\ttype IMessagingPushNotificationsConnector,\n\ttype IMessagingSmsConnector,\n\tMessagingEmailConnectorFactory,\n\tMessagingPushNotificationsConnectorFactory,\n\tMessagingSmsConnectorFactory\n} from \"@twin.org/messaging-models\";\nimport {\n\tinitSchema as initSchemaMessagingService,\n\tMessagingAdminService,\n\tMessagingService,\n\ttype TemplateEntry\n} from \"@twin.org/messaging-service\";\nimport { nameof, nameofKebabCase } from \"@twin.org/nameof\";\nimport { initialiseEntityStorageConnector } from \"./entityStorage.js\";\nimport type { MessagingAdminComponentConfig } from \"../models/config/messagingAdminComponentConfig.js\";\nimport type { MessagingComponentConfig } from \"../models/config/messagingComponentConfig.js\";\nimport type { MessagingEmailConnectorConfig } from \"../models/config/messagingEmailConnectorConfig.js\";\nimport type { MessagingPushNotificationConnectorConfig } from \"../models/config/messagingPushNotificationConnectorConfig.js\";\nimport type { MessagingSmsConnectorConfig } from \"../models/config/messagingSmsConnectorConfig.js\";\nimport type { IEngineConfig } from \"../models/IEngineConfig.js\";\nimport { MessagingAdminComponentType } from \"../models/types/messagingAdminComponentType.js\";\nimport { MessagingComponentType } from \"../models/types/messagingComponentType.js\";\nimport { MessagingEmailConnectorType } from \"../models/types/messagingEmailConnectorType.js\";\nimport { MessagingPushNotificationConnectorType } from \"../models/types/messagingPushNotificationConnectorType.js\";\nimport { MessagingSmsConnectorType } from \"../models/types/messagingSmsConnectorType.js\";\n\n/**\n * Initialise a messaging email 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 initialiseMessagingEmailConnector(\n\tengineCore: IEngineCore<IEngineConfig>,\n\tcontext: IEngineCoreContext<IEngineConfig>,\n\tinstanceConfig: MessagingEmailConnectorConfig\n): Promise<{\n\tinstanceType?: string;\n\tfactory?: typeof MessagingEmailConnectorFactory;\n\tcomponent?: IComponent;\n}> {\n\tlet component: IMessagingEmailConnector | undefined;\n\tlet instanceType: string | undefined;\n\n\tif (instanceConfig.type === MessagingEmailConnectorType.EntityStorage) {\n\t\tinitSchema({ email: true, sms: false, pushNotification: false });\n\t\tinitialiseEntityStorageConnector(\n\t\t\tengineCore,\n\t\t\tcontext,\n\t\t\tinstanceConfig.options?.messagingEmailEntryStorageConnectorType,\n\t\t\tnameof<EmailEntry>(),\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\t\tcomponent = new EntityStorageMessagingEmailConnector({\n\t\t\tloggingComponentType: engineCore.getRegisteredInstanceType(\"loggingComponent\"),\n\t\t\t...instanceConfig.options\n\t\t});\n\t\tinstanceType = EntityStorageMessagingEmailConnector.NAMESPACE;\n\t} else if (instanceConfig.type === MessagingEmailConnectorType.Aws) {\n\t\tcomponent = new AwsMessagingEmailConnector({\n\t\t\tloggingComponentType: engineCore.getRegisteredInstanceType(\"loggingComponent\"),\n\t\t\t...instanceConfig.options\n\t\t});\n\t\tinstanceType = AwsMessagingEmailConnector.NAMESPACE;\n\t}\n\n\treturn {\n\t\tcomponent,\n\t\tinstanceType,\n\t\tfactory: MessagingEmailConnectorFactory\n\t};\n}\n\n/**\n * Initialise a messaging sms 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 initialiseMessagingSmsConnector(\n\tengineCore: IEngineCore<IEngineConfig>,\n\tcontext: IEngineCoreContext<IEngineConfig>,\n\tinstanceConfig: MessagingSmsConnectorConfig\n): Promise<{\n\tinstanceType?: string;\n\tfactory?: typeof MessagingSmsConnectorFactory;\n\tcomponent?: IComponent;\n}> {\n\tlet connector: IMessagingSmsConnector | undefined;\n\tlet instanceType: string | undefined;\n\n\tif (instanceConfig.type === MessagingSmsConnectorType.EntityStorage) {\n\t\tinitSchema({ email: false, sms: true, pushNotification: false });\n\t\tinitialiseEntityStorageConnector(\n\t\t\tengineCore,\n\t\t\tcontext,\n\t\t\tinstanceConfig.options?.messagingSmsEntryStorageConnectorType,\n\t\t\tnameof<SmsEntry>(),\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\t\tconnector = new EntityStorageMessagingSmsConnector({\n\t\t\tloggingComponentType: engineCore.getRegisteredInstanceType(\"loggingComponent\"),\n\t\t\t...instanceConfig.options\n\t\t});\n\t\tinstanceType = EntityStorageMessagingSmsConnector.NAMESPACE;\n\t} else if (instanceConfig.type === MessagingSmsConnectorType.Aws) {\n\t\tconnector = new AwsMessagingSmsConnector({\n\t\t\tloggingComponentType: engineCore.getRegisteredInstanceType(\"loggingComponent\"),\n\t\t\t...instanceConfig.options\n\t\t});\n\t\tinstanceType = AwsMessagingSmsConnector.NAMESPACE;\n\t}\n\n\treturn {\n\t\tinstanceType,\n\t\tfactory: MessagingSmsConnectorFactory,\n\t\tcomponent: connector\n\t};\n}\n\n/**\n * Initialise a messaging push notification 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 initialiseMessagingPushNotificationConnector(\n\tengineCore: IEngineCore<IEngineConfig>,\n\tcontext: IEngineCoreContext<IEngineConfig>,\n\tinstanceConfig: MessagingPushNotificationConnectorConfig\n): Promise<{\n\tinstanceType?: string;\n\tfactory?: typeof MessagingPushNotificationsConnectorFactory;\n\tcomponent?: IComponent;\n}> {\n\tlet component: IMessagingPushNotificationsConnector | undefined;\n\tlet instanceType: string | undefined;\n\n\tif (instanceConfig.type === MessagingPushNotificationConnectorType.EntityStorage) {\n\t\tinitSchema({ email: false, sms: false, pushNotification: true });\n\t\tinitialiseEntityStorageConnector(\n\t\t\tengineCore,\n\t\t\tcontext,\n\t\t\tinstanceConfig.options?.messagingDeviceEntryStorageConnectorType,\n\t\t\tnameof<PushNotificationDeviceEntry>(),\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\t\tinitialiseEntityStorageConnector(\n\t\t\tengineCore,\n\t\t\tcontext,\n\t\t\tinstanceConfig.options?.messagingMessageEntryStorageConnectorType,\n\t\t\tnameof<PushNotificationMessageEntry>(),\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\t\tcomponent = new EntityStorageMessagingPushNotificationConnector({\n\t\t\tloggingComponentType: engineCore.getRegisteredInstanceType(\"loggingComponent\"),\n\t\t\t...instanceConfig.options\n\t\t});\n\t\tinstanceType = EntityStorageMessagingPushNotificationConnector.NAMESPACE;\n\t} else if (instanceConfig.type === MessagingPushNotificationConnectorType.Aws) {\n\t\tcomponent = new AwsMessagingPushNotificationConnector({\n\t\t\tloggingComponentType: engineCore.getRegisteredInstanceType(\"loggingComponent\"),\n\t\t\t...instanceConfig.options\n\t\t});\n\t\tinstanceType = AwsMessagingPushNotificationConnector.NAMESPACE;\n\t}\n\n\treturn {\n\t\tcomponent,\n\t\tinstanceType,\n\t\tfactory: MessagingPushNotificationsConnectorFactory\n\t};\n}\n\n/**\n * Initialise the messaging 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 initialiseMessagingComponent(\n\tengineCore: IEngineCore<IEngineConfig>,\n\tcontext: IEngineCoreContext<IEngineConfig>,\n\tinstanceConfig: MessagingComponentConfig\n): Promise<{\n\tinstanceType?: string;\n\tfactory?: typeof ComponentFactory;\n\tcomponent?: IComponent;\n}> {\n\tlet component: IMessagingComponent | undefined;\n\tlet instanceType: string | undefined;\n\n\tif (instanceConfig.type === MessagingComponentType.Service) {\n\t\tcomponent = new MessagingService({\n\t\t\tmessagingEmailConnectorType:\n\t\t\t\tengineCore.getRegisteredInstanceTypeOptional(\"messagingEmailConnector\"),\n\t\t\tmessagingSmsConnectorType:\n\t\t\t\tengineCore.getRegisteredInstanceTypeOptional(\"messagingSmsConnector\"),\n\t\t\tmessagingPushNotificationConnectorType: engineCore.getRegisteredInstanceTypeOptional(\n\t\t\t\t\"messagingNotificationConnector\"\n\t\t\t),\n\t\t\tmessagingAdminComponentType:\n\t\t\t\tengineCore.getRegisteredInstanceTypeOptional(\"messagingAdminComponent\"),\n\t\t\t...instanceConfig.options\n\t\t});\n\t\tinstanceType = nameofKebabCase(MessagingService);\n\t}\n\n\treturn {\n\t\tcomponent,\n\t\tinstanceType,\n\t\tfactory: ComponentFactory\n\t};\n}\n\n/**\n * Initialise the messaging admin 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 initialiseMessagingAdminComponent(\n\tengineCore: IEngineCore<IEngineConfig>,\n\tcontext: IEngineCoreContext<IEngineConfig>,\n\tinstanceConfig: MessagingAdminComponentConfig\n): Promise<{\n\tinstanceType?: string;\n\tfactory?: typeof ComponentFactory;\n\tcomponent?: IComponent;\n}> {\n\tlet component: IMessagingAdminComponent | undefined;\n\tlet instanceType: string | undefined;\n\n\tif (instanceConfig.type === MessagingAdminComponentType.Service) {\n\t\tinitSchemaMessagingService();\n\n\t\tinitialiseEntityStorageConnector(\n\t\t\tengineCore,\n\t\t\tcontext,\n\t\t\tinstanceConfig.options?.templateEntryStorageConnectorType,\n\t\t\tnameof<TemplateEntry>(),\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 MessagingAdminService({\n\t\t\t...instanceConfig.options\n\t\t});\n\t\tinstanceType = nameofKebabCase(MessagingAdminService);\n\t}\n\n\treturn {\n\t\tcomponent,\n\t\tinstanceType,\n\t\tfactory: ComponentFactory\n\t};\n}\n"]}
1
+ {"version":3,"file":"messaging.js","sourceRoot":"","sources":["../../../src/components/messaging.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAEnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAMlD,OAAO,EACN,0BAA0B,EAC1B,qCAAqC,EACrC,wBAAwB,EACxB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAEN,oCAAoC,EACpC,+CAA+C,EAC/C,kCAAkC,EAClC,UAAU,EAIV,MAAM,8CAA8C,CAAC;AACtD,OAAO,EACN,8BAA8B,EAC9B,0CAA0C,EAC1C,4BAA4B,EAC5B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACN,UAAU,IAAI,0BAA0B,EACxC,qBAAqB,EACrB,gBAAgB,EAEhB,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAAE,gCAAgC,EAAE,MAAM,oBAAoB,CAAC;AAOtE,OAAO,EAAE,2BAA2B,EAAE,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AAO,EAAE,gBAAgB;KACzB,CAAC;AACH,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,iCAAiC,CAChD,UAAsC,EACtC,OAA0C,EAC1C,cAA6C;IAE7C,IAAI,eAAe,CAAC;IACpB,IAAI,gBAAgB,CAAC;IAErB,IAAI,cAAc,CAAC,IAAI,KAAK,2BAA2B,CAAC,OAAO,EAAE,CAAC;QACjE,eAAe,GAAG,CAAC,YAAmC,EAAE,EAAE;YACzD,0BAA0B,EAAE,CAAC;YAE7B,gCAAgC,CAC/B,UAAU,EACV,OAAO,EACP,YAAY,CAAC,OAAO,EAAE,iCAAiC,mBAEvD,eAAe,CAAC,qBAAqB,CAAC,UAAU,CAAC,gBAAgB,EAAE,EAAE;gBACpE,aAAa,CAAC,IAAI;gBAClB,aAAa,CAAC,MAAM;aACpB,CAAC,CACF,CAAC;YACF,OAAO,IAAI,qBAAqB,CAC/B,gBAAgB,CAAC,WAAW,CAAqC,YAAY,CAAC,OAAO,CAAC,CACtF,CAAC;QACH,CAAC,CAAC;QACF,gBAAgB,4BAAyC,CAAC;IAC3D,CAAC;IAED,OAAO;QACN,eAAe;QACf,gBAAgB;QAChB,OAAO,EAAE,gBAAgB;KACzB,CAAC;AACH,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { ContextIdHelper, ContextIdKeys } from \"@twin.org/context\";\nimport type { IComponent } from \"@twin.org/core\";\nimport { ComponentFactory } from \"@twin.org/core\";\nimport type {\n\tEngineTypeInitialiserReturn,\n\tIEngineCore,\n\tIEngineCoreContext\n} from \"@twin.org/engine-models\";\nimport {\n\tAwsMessagingEmailConnector,\n\tAwsMessagingPushNotificationConnector,\n\tAwsMessagingSmsConnector\n} from \"@twin.org/messaging-connector-aws\";\nimport {\n\ttype EmailEntry,\n\tEntityStorageMessagingEmailConnector,\n\tEntityStorageMessagingPushNotificationConnector,\n\tEntityStorageMessagingSmsConnector,\n\tinitSchema,\n\ttype PushNotificationDeviceEntry,\n\ttype PushNotificationMessageEntry,\n\ttype SmsEntry\n} from \"@twin.org/messaging-connector-entity-storage\";\nimport {\n\tMessagingEmailConnectorFactory,\n\tMessagingPushNotificationsConnectorFactory,\n\tMessagingSmsConnectorFactory\n} from \"@twin.org/messaging-models\";\nimport {\n\tinitSchema as initSchemaMessagingService,\n\tMessagingAdminService,\n\tMessagingService,\n\ttype TemplateEntry\n} from \"@twin.org/messaging-service\";\nimport { nameof, nameofKebabCase } from \"@twin.org/nameof\";\nimport { initialiseEntityStorageConnector } from \"./entityStorage.js\";\nimport type { MessagingAdminComponentConfig } from \"../models/config/messagingAdminComponentConfig.js\";\nimport type { MessagingComponentConfig } from \"../models/config/messagingComponentConfig.js\";\nimport type { MessagingEmailConnectorConfig } from \"../models/config/messagingEmailConnectorConfig.js\";\nimport type { MessagingPushNotificationConnectorConfig } from \"../models/config/messagingPushNotificationConnectorConfig.js\";\nimport type { MessagingSmsConnectorConfig } from \"../models/config/messagingSmsConnectorConfig.js\";\nimport type { IEngineConfig } from \"../models/IEngineConfig.js\";\nimport { MessagingAdminComponentType } from \"../models/types/messagingAdminComponentType.js\";\nimport { MessagingComponentType } from \"../models/types/messagingComponentType.js\";\nimport { MessagingEmailConnectorType } from \"../models/types/messagingEmailConnectorType.js\";\nimport { MessagingPushNotificationConnectorType } from \"../models/types/messagingPushNotificationConnectorType.js\";\nimport { MessagingSmsConnectorType } from \"../models/types/messagingSmsConnectorType.js\";\nimport { EngineTypeHelper } from \"../utils/engineTypeHelper.js\";\n\n/**\n * Initialise a messaging email 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 function initialiseMessagingEmailConnector(\n\tengineCore: IEngineCore<IEngineConfig>,\n\tcontext: IEngineCoreContext<IEngineConfig>,\n\tinstanceConfig: MessagingEmailConnectorConfig\n): EngineTypeInitialiserReturn<typeof instanceConfig, typeof MessagingEmailConnectorFactory> {\n\tlet createComponent;\n\tlet instanceTypeName;\n\n\tif (instanceConfig.type === MessagingEmailConnectorType.EntityStorage) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) => {\n\t\t\tinitSchema({ email: true, sms: false, pushNotification: false });\n\t\t\tinitialiseEntityStorageConnector(\n\t\t\t\tengineCore,\n\t\t\t\tcontext,\n\t\t\t\tcreateConfig.options?.messagingEmailEntryStorageConnectorType,\n\t\t\t\tnameof<EmailEntry>(),\n\t\t\t\tContextIdHelper.pickKeysFromAvailable(engineCore.getContextIdKeys(), [\n\t\t\t\t\tContextIdKeys.Node,\n\t\t\t\t\tContextIdKeys.Tenant\n\t\t\t\t])\n\t\t\t);\n\t\t\treturn new EntityStorageMessagingEmailConnector(\n\t\t\t\tEngineTypeHelper.mergeConfig<(typeof instanceConfig)[\"options\"]>(\n\t\t\t\t\t{ loggingComponentType: engineCore.getRegisteredInstanceType(\"loggingComponent\") },\n\t\t\t\t\tcreateConfig.options\n\t\t\t\t)\n\t\t\t);\n\t\t};\n\t\tinstanceTypeName = EntityStorageMessagingEmailConnector.NAMESPACE;\n\t} else if (instanceConfig.type === MessagingEmailConnectorType.Aws) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) =>\n\t\t\tnew AwsMessagingEmailConnector(\n\t\t\t\tEngineTypeHelper.mergeConfig<(typeof instanceConfig)[\"options\"]>(\n\t\t\t\t\t{ loggingComponentType: engineCore.getRegisteredInstanceType(\"loggingComponent\") },\n\t\t\t\t\tcreateConfig.options\n\t\t\t\t)\n\t\t\t);\n\t\tinstanceTypeName = AwsMessagingEmailConnector.NAMESPACE;\n\t}\n\n\treturn {\n\t\tcreateComponent: createComponent as (createConfig: typeof instanceConfig) => IComponent,\n\t\tinstanceTypeName,\n\t\tfactory: MessagingEmailConnectorFactory\n\t};\n}\n\n/**\n * Initialise a messaging sms 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 function initialiseMessagingSmsConnector(\n\tengineCore: IEngineCore<IEngineConfig>,\n\tcontext: IEngineCoreContext<IEngineConfig>,\n\tinstanceConfig: MessagingSmsConnectorConfig\n): EngineTypeInitialiserReturn<typeof instanceConfig, typeof MessagingSmsConnectorFactory> {\n\tlet createComponent;\n\tlet instanceTypeName;\n\n\tif (instanceConfig.type === MessagingSmsConnectorType.EntityStorage) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) => {\n\t\t\tinitSchema({ email: false, sms: true, pushNotification: false });\n\t\t\tinitialiseEntityStorageConnector(\n\t\t\t\tengineCore,\n\t\t\t\tcontext,\n\t\t\t\tcreateConfig.options?.messagingSmsEntryStorageConnectorType,\n\t\t\t\tnameof<SmsEntry>(),\n\t\t\t\tContextIdHelper.pickKeysFromAvailable(engineCore.getContextIdKeys(), [\n\t\t\t\t\tContextIdKeys.Node,\n\t\t\t\t\tContextIdKeys.Tenant\n\t\t\t\t])\n\t\t\t);\n\t\t\treturn new EntityStorageMessagingSmsConnector(\n\t\t\t\tEngineTypeHelper.mergeConfig<(typeof instanceConfig)[\"options\"]>(\n\t\t\t\t\t{ loggingComponentType: engineCore.getRegisteredInstanceType(\"loggingComponent\") },\n\t\t\t\t\tcreateConfig.options\n\t\t\t\t)\n\t\t\t);\n\t\t};\n\t\tinstanceTypeName = EntityStorageMessagingSmsConnector.NAMESPACE;\n\t} else if (instanceConfig.type === MessagingSmsConnectorType.Aws) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) =>\n\t\t\tnew AwsMessagingSmsConnector(\n\t\t\t\tEngineTypeHelper.mergeConfig<(typeof instanceConfig)[\"options\"]>(\n\t\t\t\t\t{ loggingComponentType: engineCore.getRegisteredInstanceType(\"loggingComponent\") },\n\t\t\t\t\tcreateConfig.options\n\t\t\t\t)\n\t\t\t);\n\t\tinstanceTypeName = AwsMessagingSmsConnector.NAMESPACE;\n\t}\n\n\treturn {\n\t\tcreateComponent: createComponent as (createConfig: typeof instanceConfig) => IComponent,\n\t\tinstanceTypeName,\n\t\tfactory: MessagingSmsConnectorFactory\n\t};\n}\n\n/**\n * Initialise a messaging push notification 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 function initialiseMessagingPushNotificationConnector(\n\tengineCore: IEngineCore<IEngineConfig>,\n\tcontext: IEngineCoreContext<IEngineConfig>,\n\tinstanceConfig: MessagingPushNotificationConnectorConfig\n): EngineTypeInitialiserReturn<\n\ttypeof instanceConfig,\n\ttypeof MessagingPushNotificationsConnectorFactory\n> {\n\tlet createComponent;\n\tlet instanceTypeName;\n\n\tif (instanceConfig.type === MessagingPushNotificationConnectorType.EntityStorage) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) => {\n\t\t\tinitSchema({ email: false, sms: false, pushNotification: true });\n\t\t\tinitialiseEntityStorageConnector(\n\t\t\t\tengineCore,\n\t\t\t\tcontext,\n\t\t\t\tcreateConfig.options?.messagingDeviceEntryStorageConnectorType,\n\t\t\t\tnameof<PushNotificationDeviceEntry>(),\n\t\t\t\tContextIdHelper.pickKeysFromAvailable(engineCore.getContextIdKeys(), [\n\t\t\t\t\tContextIdKeys.Node,\n\t\t\t\t\tContextIdKeys.Tenant\n\t\t\t\t])\n\t\t\t);\n\t\t\tinitialiseEntityStorageConnector(\n\t\t\t\tengineCore,\n\t\t\t\tcontext,\n\t\t\t\tcreateConfig.options?.messagingMessageEntryStorageConnectorType,\n\t\t\t\tnameof<PushNotificationMessageEntry>(),\n\t\t\t\tContextIdHelper.pickKeysFromAvailable(engineCore.getContextIdKeys(), [\n\t\t\t\t\tContextIdKeys.Node,\n\t\t\t\t\tContextIdKeys.Tenant\n\t\t\t\t])\n\t\t\t);\n\t\t\treturn new EntityStorageMessagingPushNotificationConnector(\n\t\t\t\tEngineTypeHelper.mergeConfig<(typeof instanceConfig)[\"options\"]>(\n\t\t\t\t\t{ loggingComponentType: engineCore.getRegisteredInstanceType(\"loggingComponent\") },\n\t\t\t\t\tcreateConfig.options\n\t\t\t\t)\n\t\t\t);\n\t\t};\n\t\tinstanceTypeName = EntityStorageMessagingPushNotificationConnector.NAMESPACE;\n\t} else if (instanceConfig.type === MessagingPushNotificationConnectorType.Aws) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) =>\n\t\t\tnew AwsMessagingPushNotificationConnector(\n\t\t\t\tEngineTypeHelper.mergeConfig<(typeof instanceConfig)[\"options\"]>(\n\t\t\t\t\t{ loggingComponentType: engineCore.getRegisteredInstanceType(\"loggingComponent\") },\n\t\t\t\t\tcreateConfig.options\n\t\t\t\t)\n\t\t\t);\n\t\tinstanceTypeName = AwsMessagingPushNotificationConnector.NAMESPACE;\n\t}\n\n\treturn {\n\t\tcreateComponent: createComponent as (createConfig: typeof instanceConfig) => IComponent,\n\t\tinstanceTypeName,\n\t\tfactory: MessagingPushNotificationsConnectorFactory\n\t};\n}\n\n/**\n * Initialise the messaging component.\n * @param engineCore The engine core.\n * @param context The context for the engine.\n * @param instanceConfig The instance config.\n * @returns The instance created and the factory for it.\n */\nexport function initialiseMessagingComponent(\n\tengineCore: IEngineCore<IEngineConfig>,\n\tcontext: IEngineCoreContext<IEngineConfig>,\n\tinstanceConfig: MessagingComponentConfig\n): EngineTypeInitialiserReturn<typeof instanceConfig, typeof ComponentFactory> {\n\tlet createComponent;\n\tlet instanceTypeName;\n\n\tif (instanceConfig.type === MessagingComponentType.Service) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) =>\n\t\t\tnew MessagingService(\n\t\t\t\tEngineTypeHelper.mergeConfig<(typeof instanceConfig)[\"options\"]>(\n\t\t\t\t\t{\n\t\t\t\t\t\tmessagingEmailConnectorType:\n\t\t\t\t\t\t\tengineCore.getRegisteredInstanceTypeOptional(\"messagingEmailConnector\"),\n\t\t\t\t\t\tmessagingSmsConnectorType:\n\t\t\t\t\t\t\tengineCore.getRegisteredInstanceTypeOptional(\"messagingSmsConnector\"),\n\t\t\t\t\t\tmessagingPushNotificationConnectorType: engineCore.getRegisteredInstanceTypeOptional(\n\t\t\t\t\t\t\t\"messagingNotificationConnector\"\n\t\t\t\t\t\t),\n\t\t\t\t\t\tmessagingAdminComponentType:\n\t\t\t\t\t\t\tengineCore.getRegisteredInstanceTypeOptional(\"messagingAdminComponent\")\n\t\t\t\t\t},\n\t\t\t\t\tcreateConfig.options\n\t\t\t\t)\n\t\t\t);\n\t\tinstanceTypeName = nameofKebabCase(MessagingService);\n\t}\n\n\treturn {\n\t\tcreateComponent,\n\t\tinstanceTypeName,\n\t\tfactory: ComponentFactory\n\t};\n}\n\n/**\n * Initialise the messaging admin component.\n * @param engineCore The engine core.\n * @param context The context for the engine.\n * @param instanceConfig The instance config.\n * @returns The instance created and the factory for it.\n */\nexport function initialiseMessagingAdminComponent(\n\tengineCore: IEngineCore<IEngineConfig>,\n\tcontext: IEngineCoreContext<IEngineConfig>,\n\tinstanceConfig: MessagingAdminComponentConfig\n): EngineTypeInitialiserReturn<MessagingAdminComponentConfig, typeof ComponentFactory> {\n\tlet createComponent;\n\tlet instanceTypeName;\n\n\tif (instanceConfig.type === MessagingAdminComponentType.Service) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) => {\n\t\t\tinitSchemaMessagingService();\n\n\t\t\tinitialiseEntityStorageConnector(\n\t\t\t\tengineCore,\n\t\t\t\tcontext,\n\t\t\t\tcreateConfig.options?.templateEntryStorageConnectorType,\n\t\t\t\tnameof<TemplateEntry>(),\n\t\t\t\tContextIdHelper.pickKeysFromAvailable(engineCore.getContextIdKeys(), [\n\t\t\t\t\tContextIdKeys.Node,\n\t\t\t\t\tContextIdKeys.Tenant\n\t\t\t\t])\n\t\t\t);\n\t\t\treturn new MessagingAdminService(\n\t\t\t\tEngineTypeHelper.mergeConfig<(typeof instanceConfig)[\"options\"]>(createConfig.options)\n\t\t\t);\n\t\t};\n\t\tinstanceTypeName = nameofKebabCase(MessagingAdminService);\n\t}\n\n\treturn {\n\t\tcreateComponent,\n\t\tinstanceTypeName,\n\t\tfactory: ComponentFactory\n\t};\n}\n"]}
@@ -0,0 +1,27 @@
1
+ // Copyright 2026 IOTA Stiftung.
2
+ // SPDX-License-Identifier: Apache-2.0.
3
+ import { ComponentFactory } from "@twin.org/core";
4
+ import { MetricsCollectorService } from "@twin.org/telemetry-service";
5
+ import { MetricsCollectorComponentType } from "../models/types/metricsCollectorComponentType.js";
6
+ import { EngineTypeHelper } from "../utils/engineTypeHelper.js";
7
+ /**
8
+ * Initialise the metrics collector orchestrator component.
9
+ * @param engineCore The engine core.
10
+ * @param context The context for the engine.
11
+ * @param instanceConfig The instance config.
12
+ * @returns The instance created and the factory for it.
13
+ */
14
+ export function initialiseMetricsCollectorComponent(engineCore, context, instanceConfig) {
15
+ let createComponent;
16
+ let instanceTypeName;
17
+ if (instanceConfig.type === MetricsCollectorComponentType.Service) {
18
+ createComponent = (createConfig) => new MetricsCollectorService(EngineTypeHelper.mergeConfig(createConfig.options));
19
+ instanceTypeName = "metrics-collector-service";
20
+ }
21
+ return {
22
+ createComponent,
23
+ instanceTypeName,
24
+ factory: ComponentFactory
25
+ };
26
+ }
27
+ //# sourceMappingURL=metricsCollector.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"metricsCollector.js","sourceRoot":"","sources":["../../../src/components/metricsCollector.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAOlD,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAGtE,OAAO,EAAE,6BAA6B,EAAE,MAAM,kDAAkD,CAAC;AACjG,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAEhE;;;;;;GAMG;AACH,MAAM,UAAU,mCAAmC,CAClD,UAAsC,EACtC,OAA0C,EAC1C,cAA+C;IAE/C,IAAI,eAAe,CAAC;IACpB,IAAI,gBAAgB,CAAC;IAErB,IAAI,cAAc,CAAC,IAAI,KAAK,6BAA6B,CAAC,OAAO,EAAE,CAAC;QACnE,eAAe,GAAG,CAAC,YAAmC,EAAE,EAAE,CACzD,IAAI,uBAAuB,CAC1B,gBAAgB,CAAC,WAAW,CAAqC,YAAY,CAAC,OAAO,CAAC,CACtF,CAAC;QACH,gBAAgB,8BAA2C,CAAC;IAC7D,CAAC;IAED,OAAO;QACN,eAAe;QACf,gBAAgB;QAChB,OAAO,EAAE,gBAAgB;KACzB,CAAC;AACH,CAAC","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { ComponentFactory } from \"@twin.org/core\";\nimport type {\n\tEngineTypeInitialiserReturn,\n\tIEngineCore,\n\tIEngineCoreContext\n} from \"@twin.org/engine-models\";\nimport { nameofKebabCase } from \"@twin.org/nameof\";\nimport { MetricsCollectorService } from \"@twin.org/telemetry-service\";\nimport type { MetricsCollectorComponentConfig } from \"../models/config/metricsCollectorComponentConfig.js\";\nimport type { IEngineConfig } from \"../models/IEngineConfig.js\";\nimport { MetricsCollectorComponentType } from \"../models/types/metricsCollectorComponentType.js\";\nimport { EngineTypeHelper } from \"../utils/engineTypeHelper.js\";\n\n/**\n * Initialise the metrics collector orchestrator component.\n * @param engineCore The engine core.\n * @param context The context for the engine.\n * @param instanceConfig The instance config.\n * @returns The instance created and the factory for it.\n */\nexport function initialiseMetricsCollectorComponent(\n\tengineCore: IEngineCore<IEngineConfig>,\n\tcontext: IEngineCoreContext<IEngineConfig>,\n\tinstanceConfig: MetricsCollectorComponentConfig\n): EngineTypeInitialiserReturn<typeof instanceConfig, typeof ComponentFactory> {\n\tlet createComponent;\n\tlet instanceTypeName;\n\n\tif (instanceConfig.type === MetricsCollectorComponentType.Service) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) =>\n\t\t\tnew MetricsCollectorService(\n\t\t\t\tEngineTypeHelper.mergeConfig<(typeof instanceConfig)[\"options\"]>(createConfig.options)\n\t\t\t);\n\t\tinstanceTypeName = nameofKebabCase(MetricsCollectorService);\n\t}\n\n\treturn {\n\t\tcreateComponent,\n\t\tinstanceTypeName,\n\t\tfactory: ComponentFactory\n\t};\n}\n"]}
@@ -0,0 +1,33 @@
1
+ import { MetricsProducerFactory } from "@twin.org/telemetry-models";
2
+ import { ProcessMetricsProducer, SystemMetricsProducer } from "@twin.org/telemetry-producers";
3
+ import { MetricsProducerComponentType } from "../models/types/metricsProducerComponentType.js";
4
+ import { EngineTypeHelper } from "../utils/engineTypeHelper.js";
5
+ /**
6
+ * Initialise a metrics producer.
7
+ * @param engineCore The engine core.
8
+ * @param context The context for the engine.
9
+ * @param instanceConfig The instance config.
10
+ * @returns The instance created and the factory for it.
11
+ */
12
+ export function initialiseMetricsProducerComponent(engineCore, context, instanceConfig) {
13
+ let createComponent;
14
+ let instanceTypeName;
15
+ if (instanceConfig.type === MetricsProducerComponentType.System) {
16
+ createComponent = (createConfig) => new SystemMetricsProducer(EngineTypeHelper.mergeConfig({
17
+ telemetryComponentType: engineCore.getRegisteredInstanceType("telemetryComponent")
18
+ }, createConfig.options));
19
+ instanceTypeName = "system-metrics-producer";
20
+ }
21
+ else if (instanceConfig.type === MetricsProducerComponentType.Process) {
22
+ createComponent = (createConfig) => new ProcessMetricsProducer(EngineTypeHelper.mergeConfig({
23
+ telemetryComponentType: engineCore.getRegisteredInstanceType("telemetryComponent")
24
+ }, createConfig.options));
25
+ instanceTypeName = "process-metrics-producer";
26
+ }
27
+ return {
28
+ createComponent: createComponent,
29
+ instanceTypeName,
30
+ factory: MetricsProducerFactory
31
+ };
32
+ }
33
+ //# sourceMappingURL=metricsProducer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"metricsProducer.js","sourceRoot":"","sources":["../../../src/components/metricsProducer.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAG9F,OAAO,EAAE,4BAA4B,EAAE,MAAM,iDAAiD,CAAC;AAC/F,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAEhE;;;;;;GAMG;AACH,MAAM,UAAU,kCAAkC,CACjD,UAAsC,EACtC,OAA0C,EAC1C,cAA8C;IAE9C,IAAI,eAAe,CAAC;IACpB,IAAI,gBAAgB,CAAC;IAErB,IAAI,cAAc,CAAC,IAAI,KAAK,4BAA4B,CAAC,MAAM,EAAE,CAAC;QACjE,eAAe,GAAG,CAAC,YAAmC,EAAE,EAAE,CACzD,IAAI,qBAAqB,CACxB,gBAAgB,CAAC,WAAW,CAC3B;YACC,sBAAsB,EAAE,UAAU,CAAC,yBAAyB,CAAC,oBAAoB,CAAC;SAClF,EACD,YAAY,CAAC,OAAO,CACpB,CACD,CAAC;QACH,gBAAgB,4BAAyC,CAAC;IAC3D,CAAC;SAAM,IAAI,cAAc,CAAC,IAAI,KAAK,4BAA4B,CAAC,OAAO,EAAE,CAAC;QACzE,eAAe,GAAG,CAAC,YAAmC,EAAE,EAAE,CACzD,IAAI,sBAAsB,CACzB,gBAAgB,CAAC,WAAW,CAC3B;YACC,sBAAsB,EAAE,UAAU,CAAC,yBAAyB,CAAC,oBAAoB,CAAC;SAClF,EACD,YAAY,CAAC,OAAO,CACpB,CACD,CAAC;QACH,gBAAgB,6BAA0C,CAAC;IAC5D,CAAC;IAED,OAAO;QACN,eAAe,EAAE,eAAsE;QACvF,gBAAgB;QAChB,OAAO,EAAE,sBAAsB;KAC/B,CAAC;AACH,CAAC","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IComponent } from \"@twin.org/core\";\nimport type {\n\tEngineTypeInitialiserReturn,\n\tIEngineCore,\n\tIEngineCoreContext\n} from \"@twin.org/engine-models\";\nimport { nameofKebabCase } from \"@twin.org/nameof\";\nimport { MetricsProducerFactory } from \"@twin.org/telemetry-models\";\nimport { ProcessMetricsProducer, SystemMetricsProducer } from \"@twin.org/telemetry-producers\";\nimport type { MetricsProducerComponentConfig } from \"../models/config/metricsProducerComponentConfig.js\";\nimport type { IEngineConfig } from \"../models/IEngineConfig.js\";\nimport { MetricsProducerComponentType } from \"../models/types/metricsProducerComponentType.js\";\nimport { EngineTypeHelper } from \"../utils/engineTypeHelper.js\";\n\n/**\n * Initialise a metrics producer.\n * @param engineCore The engine core.\n * @param context The context for the engine.\n * @param instanceConfig The instance config.\n * @returns The instance created and the factory for it.\n */\nexport function initialiseMetricsProducerComponent(\n\tengineCore: IEngineCore<IEngineConfig>,\n\tcontext: IEngineCoreContext<IEngineConfig>,\n\tinstanceConfig: MetricsProducerComponentConfig\n): EngineTypeInitialiserReturn<typeof instanceConfig, typeof MetricsProducerFactory> {\n\tlet createComponent;\n\tlet instanceTypeName;\n\n\tif (instanceConfig.type === MetricsProducerComponentType.System) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) =>\n\t\t\tnew SystemMetricsProducer(\n\t\t\t\tEngineTypeHelper.mergeConfig<(typeof instanceConfig)[\"options\"]>(\n\t\t\t\t\t{\n\t\t\t\t\t\ttelemetryComponentType: engineCore.getRegisteredInstanceType(\"telemetryComponent\")\n\t\t\t\t\t},\n\t\t\t\t\tcreateConfig.options\n\t\t\t\t)\n\t\t\t);\n\t\tinstanceTypeName = nameofKebabCase(SystemMetricsProducer);\n\t} else if (instanceConfig.type === MetricsProducerComponentType.Process) {\n\t\tcreateComponent = (createConfig: typeof instanceConfig) =>\n\t\t\tnew ProcessMetricsProducer(\n\t\t\t\tEngineTypeHelper.mergeConfig<(typeof instanceConfig)[\"options\"]>(\n\t\t\t\t\t{\n\t\t\t\t\t\ttelemetryComponentType: engineCore.getRegisteredInstanceType(\"telemetryComponent\")\n\t\t\t\t\t},\n\t\t\t\t\tcreateConfig.options\n\t\t\t\t)\n\t\t\t);\n\t\tinstanceTypeName = nameofKebabCase(ProcessMetricsProducer);\n\t}\n\n\treturn {\n\t\tcreateComponent: createComponent as (createConfig: typeof instanceConfig) => IComponent,\n\t\tinstanceTypeName,\n\t\tfactory: MetricsProducerFactory\n\t};\n}\n"]}