@twin.org/engine-types 0.0.2-next.9 → 0.0.3-next.2

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 (552) hide show
  1. package/dist/es/components/attestation.js +60 -0
  2. package/dist/es/components/attestation.js.map +1 -0
  3. package/dist/es/components/auditableItemGraph.js +44 -0
  4. package/dist/es/components/auditableItemGraph.js.map +1 -0
  5. package/dist/es/components/auditableItemStream.js +44 -0
  6. package/dist/es/components/auditableItemStream.js.map +1 -0
  7. package/dist/es/components/authenticationGenerator.js +30 -0
  8. package/dist/es/components/authenticationGenerator.js.map +1 -0
  9. package/dist/es/components/backgroundTask.js +33 -0
  10. package/dist/es/components/backgroundTask.js.map +1 -0
  11. package/dist/es/components/blobStorage.js +143 -0
  12. package/dist/es/components/blobStorage.js.map +1 -0
  13. package/dist/es/components/dataProcessing.js +89 -0
  14. package/dist/es/components/dataProcessing.js.map +1 -0
  15. package/dist/es/components/dataSpaceConnector.js +52 -0
  16. package/dist/es/components/dataSpaceConnector.js.map +1 -0
  17. package/dist/es/components/documentManagement.js +37 -0
  18. package/dist/es/components/documentManagement.js.map +1 -0
  19. package/dist/es/components/entityStorage.js +226 -0
  20. package/dist/es/components/entityStorage.js.map +1 -0
  21. package/dist/es/components/eventBus.js +63 -0
  22. package/dist/es/components/eventBus.js.map +1 -0
  23. package/dist/es/components/faucet.js +41 -0
  24. package/dist/es/components/faucet.js.map +1 -0
  25. package/dist/es/components/federatedCatalogue.js +42 -0
  26. package/dist/es/components/federatedCatalogue.js.map +1 -0
  27. package/dist/es/components/identity.js +75 -0
  28. package/dist/es/components/identity.js.map +1 -0
  29. package/dist/es/components/identityProfile.js +64 -0
  30. package/dist/es/components/identityProfile.js.map +1 -0
  31. package/dist/es/components/identityResolver.js +87 -0
  32. package/dist/es/components/identityResolver.js.map +1 -0
  33. package/dist/es/components/immutableProof.js +44 -0
  34. package/dist/es/components/immutableProof.js.map +1 -0
  35. package/dist/es/components/logging.js +73 -0
  36. package/dist/es/components/logging.js.map +1 -0
  37. package/dist/es/components/messaging.js +177 -0
  38. package/dist/es/components/messaging.js.map +1 -0
  39. package/dist/es/components/nft.js +78 -0
  40. package/dist/es/components/nft.js.map +1 -0
  41. package/dist/es/components/rightsManagementDap.js +38 -0
  42. package/dist/es/components/rightsManagementDap.js.map +1 -0
  43. package/dist/es/components/rightsManagementDarp.js +29 -0
  44. package/dist/es/components/rightsManagementDarp.js.map +1 -0
  45. package/dist/es/components/rightsManagementPap.js +41 -0
  46. package/dist/es/components/rightsManagementPap.js.map +1 -0
  47. package/dist/es/components/rightsManagementPdp.js +46 -0
  48. package/dist/es/components/rightsManagementPdp.js.map +1 -0
  49. package/dist/es/components/rightsManagementPep.js +44 -0
  50. package/dist/es/components/rightsManagementPep.js.map +1 -0
  51. package/dist/es/components/rightsManagementPip.js +43 -0
  52. package/dist/es/components/rightsManagementPip.js.map +1 -0
  53. package/dist/es/components/rightsManagementPmp.js +30 -0
  54. package/dist/es/components/rightsManagementPmp.js.map +1 -0
  55. package/dist/es/components/rightsManagementPnap.js +42 -0
  56. package/dist/es/components/rightsManagementPnap.js.map +1 -0
  57. package/dist/es/components/rightsManagementPnp.js +61 -0
  58. package/dist/es/components/rightsManagementPnp.js.map +1 -0
  59. package/dist/es/components/rightsManagementPxp.js +43 -0
  60. package/dist/es/components/rightsManagementPxp.js.map +1 -0
  61. package/dist/es/components/synchronisedStorage.js +47 -0
  62. package/dist/es/components/synchronisedStorage.js.map +1 -0
  63. package/dist/es/components/taskScheduler.js +27 -0
  64. package/dist/es/components/taskScheduler.js.map +1 -0
  65. package/dist/es/components/telemetry.js +71 -0
  66. package/dist/es/components/telemetry.js.map +1 -0
  67. package/dist/es/components/tenant.js +32 -0
  68. package/dist/es/components/tenant.js.map +1 -0
  69. package/dist/es/components/vault.js +33 -0
  70. package/dist/es/components/vault.js.map +1 -0
  71. package/dist/es/components/verifiableStorage.js +79 -0
  72. package/dist/es/components/verifiableStorage.js.map +1 -0
  73. package/dist/es/components/wallet.js +47 -0
  74. package/dist/es/components/wallet.js.map +1 -0
  75. package/dist/es/index.js +152 -0
  76. package/dist/es/index.js.map +1 -0
  77. package/dist/es/models/IEngineConfig.js +2 -0
  78. package/dist/es/models/IEngineConfig.js.map +1 -0
  79. package/dist/es/models/config/attestationComponentConfig.js +2 -0
  80. package/dist/es/models/config/attestationComponentConfig.js.map +1 -0
  81. package/dist/es/models/config/attestationConnectorConfig.js +2 -0
  82. package/dist/es/models/config/attestationConnectorConfig.js.map +1 -0
  83. package/dist/es/models/config/auditableItemGraphComponentConfig.js +2 -0
  84. package/dist/es/models/config/auditableItemGraphComponentConfig.js.map +1 -0
  85. package/dist/es/models/config/auditableItemStreamComponentConfig.js +2 -0
  86. package/dist/es/models/config/auditableItemStreamComponentConfig.js.map +1 -0
  87. package/dist/es/models/config/authenticationGeneratorComponentConfig.js +2 -0
  88. package/dist/es/models/config/authenticationGeneratorComponentConfig.js.map +1 -0
  89. package/dist/es/models/config/backgroundTaskConnectorConfig.js +2 -0
  90. package/dist/es/models/config/backgroundTaskConnectorConfig.js.map +1 -0
  91. package/dist/es/models/config/blobStorageComponentConfig.js +2 -0
  92. package/dist/es/models/config/blobStorageComponentConfig.js.map +1 -0
  93. package/dist/es/models/config/blobStorageConnectorConfig.js +2 -0
  94. package/dist/es/models/config/blobStorageConnectorConfig.js.map +1 -0
  95. package/dist/es/models/config/dataConverterConnectorConfig.js +2 -0
  96. package/dist/es/models/config/dataConverterConnectorConfig.js.map +1 -0
  97. package/dist/es/models/config/dataExtractorConnectorConfig.js +2 -0
  98. package/dist/es/models/config/dataExtractorConnectorConfig.js.map +1 -0
  99. package/dist/es/models/config/dataProcessingComponentConfig.js +2 -0
  100. package/dist/es/models/config/dataProcessingComponentConfig.js.map +1 -0
  101. package/dist/es/models/config/dataSpaceConnectorComponentConfig.js +2 -0
  102. package/dist/es/models/config/dataSpaceConnectorComponentConfig.js.map +1 -0
  103. package/dist/es/models/config/dltConfig.js +2 -0
  104. package/dist/es/models/config/dltConfig.js.map +1 -0
  105. package/dist/es/models/config/documentManagementComponentConfig.js +2 -0
  106. package/dist/es/models/config/documentManagementComponentConfig.js.map +1 -0
  107. package/dist/es/models/config/entityStorageComponentConfig.js +2 -0
  108. package/dist/es/models/config/entityStorageComponentConfig.js.map +1 -0
  109. package/dist/es/models/config/entityStorageConnectorConfig.js +2 -0
  110. package/dist/es/models/config/entityStorageConnectorConfig.js.map +1 -0
  111. package/dist/es/models/config/eventBusComponentConfig.js +2 -0
  112. package/dist/es/models/config/eventBusComponentConfig.js.map +1 -0
  113. package/dist/es/models/config/eventBusConnectorConfig.js +2 -0
  114. package/dist/es/models/config/eventBusConnectorConfig.js.map +1 -0
  115. package/dist/es/models/config/faucetConnectorConfig.js +2 -0
  116. package/dist/es/models/config/faucetConnectorConfig.js.map +1 -0
  117. package/dist/es/models/config/federatedCatalogueComponentConfig.js +2 -0
  118. package/dist/es/models/config/federatedCatalogueComponentConfig.js.map +1 -0
  119. package/dist/es/models/config/identityComponentConfig.js +2 -0
  120. package/dist/es/models/config/identityComponentConfig.js.map +1 -0
  121. package/dist/es/models/config/identityConnectorConfig.js +2 -0
  122. package/dist/es/models/config/identityConnectorConfig.js.map +1 -0
  123. package/dist/es/models/config/identityProfileComponentConfig.js +2 -0
  124. package/dist/es/models/config/identityProfileComponentConfig.js.map +1 -0
  125. package/dist/es/models/config/identityProfileConnectorConfig.js +2 -0
  126. package/dist/es/models/config/identityProfileConnectorConfig.js.map +1 -0
  127. package/dist/es/models/config/identityResolverComponentConfig.js +2 -0
  128. package/dist/es/models/config/identityResolverComponentConfig.js.map +1 -0
  129. package/dist/es/models/config/identityResolverConnectorConfig.js +2 -0
  130. package/dist/es/models/config/identityResolverConnectorConfig.js.map +1 -0
  131. package/dist/es/models/config/immutableProofComponentConfig.js +2 -0
  132. package/dist/es/models/config/immutableProofComponentConfig.js.map +1 -0
  133. package/dist/es/models/config/loggingComponentConfig.js +2 -0
  134. package/dist/es/models/config/loggingComponentConfig.js.map +1 -0
  135. package/dist/es/models/config/loggingConnectorConfig.js +2 -0
  136. package/dist/es/models/config/loggingConnectorConfig.js.map +1 -0
  137. package/dist/es/models/config/messagingAdminComponentConfig.js +2 -0
  138. package/dist/es/models/config/messagingAdminComponentConfig.js.map +1 -0
  139. package/dist/es/models/config/messagingComponentConfig.js +2 -0
  140. package/dist/es/models/config/messagingComponentConfig.js.map +1 -0
  141. package/dist/es/models/config/messagingEmailConnectorConfig.js +2 -0
  142. package/dist/es/models/config/messagingEmailConnectorConfig.js.map +1 -0
  143. package/dist/es/models/config/messagingPushNotificationConnectorConfig.js +2 -0
  144. package/dist/es/models/config/messagingPushNotificationConnectorConfig.js.map +1 -0
  145. package/dist/es/models/config/messagingSmsConnectorConfig.js +2 -0
  146. package/dist/es/models/config/messagingSmsConnectorConfig.js.map +1 -0
  147. package/dist/es/models/config/nftComponentConfig.js +2 -0
  148. package/dist/es/models/config/nftComponentConfig.js.map +1 -0
  149. package/dist/es/models/config/nftConnectorConfig.js +2 -0
  150. package/dist/es/models/config/nftConnectorConfig.js.map +1 -0
  151. package/dist/es/models/config/rightsManagementDapComponentConfig.js +2 -0
  152. package/dist/es/models/config/rightsManagementDapComponentConfig.js.map +1 -0
  153. package/dist/es/models/config/rightsManagementDarpComponentConfig.js +2 -0
  154. package/dist/es/models/config/rightsManagementDarpComponentConfig.js.map +1 -0
  155. package/dist/es/models/config/rightsManagementPapComponentConfig.js +2 -0
  156. package/dist/es/models/config/rightsManagementPapComponentConfig.js.map +1 -0
  157. package/dist/es/models/config/rightsManagementPdpComponentConfig.js +2 -0
  158. package/dist/es/models/config/rightsManagementPdpComponentConfig.js.map +1 -0
  159. package/dist/es/models/config/rightsManagementPepComponentConfig.js +2 -0
  160. package/dist/es/models/config/rightsManagementPepComponentConfig.js.map +1 -0
  161. package/dist/es/models/config/rightsManagementPipComponentConfig.js +2 -0
  162. package/dist/es/models/config/rightsManagementPipComponentConfig.js.map +1 -0
  163. package/dist/es/models/config/rightsManagementPmpComponentConfig.js +2 -0
  164. package/dist/es/models/config/rightsManagementPmpComponentConfig.js.map +1 -0
  165. package/dist/es/models/config/rightsManagementPnapComponentConfig.js +2 -0
  166. package/dist/es/models/config/rightsManagementPnapComponentConfig.js.map +1 -0
  167. package/dist/es/models/config/rightsManagementPnpComponentConfig.js +2 -0
  168. package/dist/es/models/config/rightsManagementPnpComponentConfig.js.map +1 -0
  169. package/dist/es/models/config/rightsManagementPxpComponentConfig.js +2 -0
  170. package/dist/es/models/config/rightsManagementPxpComponentConfig.js.map +1 -0
  171. package/dist/es/models/config/synchronisedStorageComponentConfig.js +2 -0
  172. package/dist/es/models/config/synchronisedStorageComponentConfig.js.map +1 -0
  173. package/dist/es/models/config/taskSchedulerComponentConfig.js +2 -0
  174. package/dist/es/models/config/taskSchedulerComponentConfig.js.map +1 -0
  175. package/dist/es/models/config/telemetryComponentConfig.js +2 -0
  176. package/dist/es/models/config/telemetryComponentConfig.js.map +1 -0
  177. package/dist/es/models/config/telemetryConnectorConfig.js +2 -0
  178. package/dist/es/models/config/telemetryConnectorConfig.js.map +1 -0
  179. package/dist/es/models/config/tenantAdminComponentConfig.js +2 -0
  180. package/dist/es/models/config/tenantAdminComponentConfig.js.map +1 -0
  181. package/dist/es/models/config/vaultConnectorConfig.js +2 -0
  182. package/dist/es/models/config/vaultConnectorConfig.js.map +1 -0
  183. package/dist/es/models/config/verifiableStorageComponentConfig.js +2 -0
  184. package/dist/es/models/config/verifiableStorageComponentConfig.js.map +1 -0
  185. package/dist/es/models/config/verifiableStorageConnectorConfig.js +2 -0
  186. package/dist/es/models/config/verifiableStorageConnectorConfig.js.map +1 -0
  187. package/dist/es/models/config/walletConnectorConfig.js +2 -0
  188. package/dist/es/models/config/walletConnectorConfig.js.map +1 -0
  189. package/dist/es/models/types/attestationComponentType.js +17 -0
  190. package/dist/es/models/types/attestationComponentType.js.map +1 -0
  191. package/dist/es/models/types/attestationConnectorType.js +13 -0
  192. package/dist/es/models/types/attestationConnectorType.js.map +1 -0
  193. package/dist/es/models/types/auditableItemGraphComponentType.js +17 -0
  194. package/dist/es/models/types/auditableItemGraphComponentType.js.map +1 -0
  195. package/dist/es/models/types/auditableItemStreamComponentType.js +17 -0
  196. package/dist/es/models/types/auditableItemStreamComponentType.js.map +1 -0
  197. package/dist/es/models/types/authenticationGeneratorComponentType.js +13 -0
  198. package/dist/es/models/types/authenticationGeneratorComponentType.js.map +1 -0
  199. package/dist/es/models/types/backgroundTaskConnectorType.js +13 -0
  200. package/dist/es/models/types/backgroundTaskConnectorType.js.map +1 -0
  201. package/dist/es/models/types/blobStorageComponentType.js +17 -0
  202. package/dist/es/models/types/blobStorageComponentType.js.map +1 -0
  203. package/dist/es/models/types/blobStorageConnectorType.js +33 -0
  204. package/dist/es/models/types/blobStorageConnectorType.js.map +1 -0
  205. package/dist/es/models/types/dataConverterConnectorType.js +17 -0
  206. package/dist/es/models/types/dataConverterConnectorType.js.map +1 -0
  207. package/dist/es/models/types/dataExtractorConnectorType.js +13 -0
  208. package/dist/es/models/types/dataExtractorConnectorType.js.map +1 -0
  209. package/dist/es/models/types/dataProcessingComponentType.js +17 -0
  210. package/dist/es/models/types/dataProcessingComponentType.js.map +1 -0
  211. package/dist/es/models/types/dataSpaceConnectorComponentType.js +21 -0
  212. package/dist/es/models/types/dataSpaceConnectorComponentType.js.map +1 -0
  213. package/dist/es/models/types/dltConfigType.js +13 -0
  214. package/dist/es/models/types/dltConfigType.js.map +1 -0
  215. package/dist/es/models/types/documentManagementComponentType.js +17 -0
  216. package/dist/es/models/types/documentManagementComponentType.js.map +1 -0
  217. package/dist/es/models/types/entityStorageComponentType.js +17 -0
  218. package/dist/es/models/types/entityStorageComponentType.js.map +1 -0
  219. package/dist/es/models/types/entityStorageConnectorType.js +49 -0
  220. package/dist/es/models/types/entityStorageConnectorType.js.map +1 -0
  221. package/dist/es/models/types/eventBusComponentType.js +17 -0
  222. package/dist/es/models/types/eventBusComponentType.js.map +1 -0
  223. package/dist/es/models/types/eventBusConnectorType.js +13 -0
  224. package/dist/es/models/types/eventBusConnectorType.js.map +1 -0
  225. package/dist/es/models/types/faucetConnectorType.js +17 -0
  226. package/dist/es/models/types/faucetConnectorType.js.map +1 -0
  227. package/dist/es/models/types/federatedCatalogueComponentType.js +17 -0
  228. package/dist/es/models/types/federatedCatalogueComponentType.js.map +1 -0
  229. package/dist/es/models/types/identityComponentType.js +17 -0
  230. package/dist/es/models/types/identityComponentType.js.map +1 -0
  231. package/dist/es/models/types/identityConnectorType.js +17 -0
  232. package/dist/es/models/types/identityConnectorType.js.map +1 -0
  233. package/dist/es/models/types/identityProfileComponentType.js +17 -0
  234. package/dist/es/models/types/identityProfileComponentType.js.map +1 -0
  235. package/dist/es/models/types/identityProfileConnectorType.js +13 -0
  236. package/dist/es/models/types/identityProfileConnectorType.js.map +1 -0
  237. package/dist/es/models/types/identityResolverComponentType.js +17 -0
  238. package/dist/es/models/types/identityResolverComponentType.js.map +1 -0
  239. package/dist/es/models/types/identityResolverConnectorType.js +21 -0
  240. package/dist/es/models/types/identityResolverConnectorType.js.map +1 -0
  241. package/dist/es/models/types/immutableProofComponentType.js +17 -0
  242. package/dist/es/models/types/immutableProofComponentType.js.map +1 -0
  243. package/dist/es/models/types/loggingComponentType.js +17 -0
  244. package/dist/es/models/types/loggingComponentType.js.map +1 -0
  245. package/dist/es/models/types/loggingConnectorType.js +21 -0
  246. package/dist/es/models/types/loggingConnectorType.js.map +1 -0
  247. package/dist/es/models/types/messagingAdminComponentType.js +13 -0
  248. package/dist/es/models/types/messagingAdminComponentType.js.map +1 -0
  249. package/dist/es/models/types/messagingComponentType.js +13 -0
  250. package/dist/es/models/types/messagingComponentType.js.map +1 -0
  251. package/dist/es/models/types/messagingEmailConnectorType.js +17 -0
  252. package/dist/es/models/types/messagingEmailConnectorType.js.map +1 -0
  253. package/dist/es/models/types/messagingPushNotificationConnectorType.js +17 -0
  254. package/dist/es/models/types/messagingPushNotificationConnectorType.js.map +1 -0
  255. package/dist/es/models/types/messagingSmsConnectorType.js +17 -0
  256. package/dist/es/models/types/messagingSmsConnectorType.js.map +1 -0
  257. package/dist/es/models/types/nftComponentType.js +17 -0
  258. package/dist/es/models/types/nftComponentType.js.map +1 -0
  259. package/dist/es/models/types/nftConnectorType.js +17 -0
  260. package/dist/es/models/types/nftConnectorType.js.map +1 -0
  261. package/dist/es/models/types/rightsManagementDapComponentType.js +17 -0
  262. package/dist/es/models/types/rightsManagementDapComponentType.js.map +1 -0
  263. package/dist/es/models/types/rightsManagementDarpComponentType.js +13 -0
  264. package/dist/es/models/types/rightsManagementDarpComponentType.js.map +1 -0
  265. package/dist/es/models/types/rightsManagementPapComponentType.js +17 -0
  266. package/dist/es/models/types/rightsManagementPapComponentType.js.map +1 -0
  267. package/dist/es/models/types/rightsManagementPdpComponentType.js +13 -0
  268. package/dist/es/models/types/rightsManagementPdpComponentType.js.map +1 -0
  269. package/dist/es/models/types/rightsManagementPepComponentType.js +17 -0
  270. package/dist/es/models/types/rightsManagementPepComponentType.js.map +1 -0
  271. package/dist/es/models/types/rightsManagementPipComponentType.js +13 -0
  272. package/dist/es/models/types/rightsManagementPipComponentType.js.map +1 -0
  273. package/dist/es/models/types/rightsManagementPmpComponentType.js +13 -0
  274. package/dist/es/models/types/rightsManagementPmpComponentType.js.map +1 -0
  275. package/dist/es/models/types/rightsManagementPnapComponentType.js +17 -0
  276. package/dist/es/models/types/rightsManagementPnapComponentType.js.map +1 -0
  277. package/dist/es/models/types/rightsManagementPnpComponentType.js +17 -0
  278. package/dist/es/models/types/rightsManagementPnpComponentType.js.map +1 -0
  279. package/dist/es/models/types/rightsManagementPxpComponentType.js +13 -0
  280. package/dist/es/models/types/rightsManagementPxpComponentType.js.map +1 -0
  281. package/dist/es/models/types/synchronisedStorageComponentType.js +17 -0
  282. package/dist/es/models/types/synchronisedStorageComponentType.js.map +1 -0
  283. package/dist/es/models/types/taskSchedulerComponentType.js +13 -0
  284. package/dist/es/models/types/taskSchedulerComponentType.js.map +1 -0
  285. package/dist/es/models/types/telemetryComponentType.js +17 -0
  286. package/dist/es/models/types/telemetryComponentType.js.map +1 -0
  287. package/dist/es/models/types/telemetryConnectorType.js +13 -0
  288. package/dist/es/models/types/telemetryConnectorType.js.map +1 -0
  289. package/dist/es/models/types/tenantAdminComponentType.js +13 -0
  290. package/dist/es/models/types/tenantAdminComponentType.js.map +1 -0
  291. package/dist/es/models/types/vaultConnectorType.js +17 -0
  292. package/dist/es/models/types/vaultConnectorType.js.map +1 -0
  293. package/dist/es/models/types/verifiableStorageComponentType.js +17 -0
  294. package/dist/es/models/types/verifiableStorageComponentType.js.map +1 -0
  295. package/dist/es/models/types/verifiableStorageConnectorType.js +17 -0
  296. package/dist/es/models/types/verifiableStorageConnectorType.js.map +1 -0
  297. package/dist/es/models/types/walletConnectorType.js +17 -0
  298. package/dist/es/models/types/walletConnectorType.js.map +1 -0
  299. package/dist/es/utils/engineTypeHelper.js +32 -0
  300. package/dist/es/utils/engineTypeHelper.js.map +1 -0
  301. package/dist/types/components/attestation.d.ts +17 -11
  302. package/dist/types/components/auditableItemGraph.d.ts +9 -6
  303. package/dist/types/components/auditableItemStream.d.ts +9 -6
  304. package/dist/types/components/authenticationGenerator.d.ts +17 -0
  305. package/dist/types/components/backgroundTask.d.ts +10 -6
  306. package/dist/types/components/blobStorage.d.ts +17 -11
  307. package/dist/types/components/dataProcessing.d.ts +24 -16
  308. package/dist/types/components/dataSpaceConnector.d.ts +16 -0
  309. package/dist/types/components/documentManagement.d.ts +9 -6
  310. package/dist/types/components/entityStorage.d.ts +12 -8
  311. package/dist/types/components/eventBus.d.ts +17 -11
  312. package/dist/types/components/faucet.d.ts +10 -6
  313. package/dist/types/components/federatedCatalogue.d.ts +9 -6
  314. package/dist/types/components/identity.d.ts +17 -11
  315. package/dist/types/components/identityProfile.d.ts +17 -11
  316. package/dist/types/components/identityResolver.d.ts +17 -11
  317. package/dist/types/components/immutableProof.d.ts +9 -6
  318. package/dist/types/components/logging.d.ts +17 -11
  319. package/dist/types/components/messaging.d.ts +44 -21
  320. package/dist/types/components/nft.d.ts +17 -11
  321. package/dist/types/components/rightsManagementDap.d.ts +16 -0
  322. package/dist/types/components/rightsManagementDarp.d.ts +16 -0
  323. package/dist/types/components/rightsManagementPap.d.ts +9 -6
  324. package/dist/types/components/rightsManagementPdp.d.ts +9 -6
  325. package/dist/types/components/rightsManagementPep.d.ts +9 -6
  326. package/dist/types/components/rightsManagementPip.d.ts +9 -6
  327. package/dist/types/components/rightsManagementPmp.d.ts +9 -6
  328. package/dist/types/components/rightsManagementPnap.d.ts +16 -0
  329. package/dist/types/components/rightsManagementPnp.d.ts +16 -0
  330. package/dist/types/components/rightsManagementPxp.d.ts +9 -6
  331. package/dist/types/components/synchronisedStorage.d.ts +9 -6
  332. package/dist/types/components/taskScheduler.d.ts +9 -6
  333. package/dist/types/components/telemetry.d.ts +17 -11
  334. package/dist/types/components/tenant.d.ts +16 -0
  335. package/dist/types/components/vault.d.ts +10 -6
  336. package/dist/types/components/verifiableStorage.d.ts +17 -11
  337. package/dist/types/components/wallet.d.ts +10 -16
  338. package/dist/types/index.d.ts +149 -128
  339. package/dist/types/models/IEngineConfig.d.ts +85 -50
  340. package/dist/types/models/config/attestationComponentConfig.d.ts +1 -1
  341. package/dist/types/models/config/attestationConnectorConfig.d.ts +1 -1
  342. package/dist/types/models/config/auditableItemGraphComponentConfig.d.ts +1 -1
  343. package/dist/types/models/config/auditableItemStreamComponentConfig.d.ts +1 -1
  344. package/dist/types/models/config/authenticationGeneratorComponentConfig.d.ts +9 -0
  345. package/dist/types/models/config/backgroundTaskConnectorConfig.d.ts +1 -1
  346. package/dist/types/models/config/blobStorageComponentConfig.d.ts +1 -1
  347. package/dist/types/models/config/blobStorageConnectorConfig.d.ts +1 -1
  348. package/dist/types/models/config/dataConverterConnectorConfig.d.ts +1 -1
  349. package/dist/types/models/config/dataExtractorConnectorConfig.d.ts +1 -1
  350. package/dist/types/models/config/dataProcessingComponentConfig.d.ts +1 -1
  351. package/dist/types/models/config/dataSpaceConnectorComponentConfig.d.ts +17 -0
  352. package/dist/types/models/config/dltConfig.d.ts +1 -1
  353. package/dist/types/models/config/documentManagementComponentConfig.d.ts +1 -1
  354. package/dist/types/models/config/entityStorageComponentConfig.d.ts +4 -2
  355. package/dist/types/models/config/entityStorageConnectorConfig.d.ts +1 -1
  356. package/dist/types/models/config/eventBusComponentConfig.d.ts +1 -1
  357. package/dist/types/models/config/eventBusConnectorConfig.d.ts +1 -1
  358. package/dist/types/models/config/faucetConnectorConfig.d.ts +1 -1
  359. package/dist/types/models/config/federatedCatalogueComponentConfig.d.ts +1 -1
  360. package/dist/types/models/config/identityComponentConfig.d.ts +1 -1
  361. package/dist/types/models/config/identityConnectorConfig.d.ts +1 -1
  362. package/dist/types/models/config/identityProfileComponentConfig.d.ts +1 -1
  363. package/dist/types/models/config/identityProfileConnectorConfig.d.ts +1 -1
  364. package/dist/types/models/config/identityResolverComponentConfig.d.ts +1 -1
  365. package/dist/types/models/config/identityResolverConnectorConfig.d.ts +1 -1
  366. package/dist/types/models/config/immutableProofComponentConfig.d.ts +1 -1
  367. package/dist/types/models/config/loggingComponentConfig.d.ts +1 -1
  368. package/dist/types/models/config/loggingConnectorConfig.d.ts +1 -1
  369. package/dist/types/models/config/messagingAdminComponentConfig.d.ts +9 -0
  370. package/dist/types/models/config/messagingComponentConfig.d.ts +1 -1
  371. package/dist/types/models/config/messagingEmailConnectorConfig.d.ts +1 -1
  372. package/dist/types/models/config/messagingPushNotificationConnectorConfig.d.ts +1 -1
  373. package/dist/types/models/config/messagingSmsConnectorConfig.d.ts +1 -1
  374. package/dist/types/models/config/nftComponentConfig.d.ts +1 -1
  375. package/dist/types/models/config/nftConnectorConfig.d.ts +1 -1
  376. package/dist/types/models/config/rightsManagementDapComponentConfig.d.ts +16 -0
  377. package/dist/types/models/config/rightsManagementDarpComponentConfig.d.ts +12 -0
  378. package/dist/types/models/config/rightsManagementPapComponentConfig.d.ts +7 -3
  379. package/dist/types/models/config/rightsManagementPdpComponentConfig.d.ts +6 -3
  380. package/dist/types/models/config/rightsManagementPepComponentConfig.d.ts +6 -3
  381. package/dist/types/models/config/rightsManagementPipComponentConfig.d.ts +6 -3
  382. package/dist/types/models/config/rightsManagementPmpComponentConfig.d.ts +3 -3
  383. package/dist/types/models/config/rightsManagementPnapComponentConfig.d.ts +13 -0
  384. package/dist/types/models/config/rightsManagementPnpComponentConfig.d.ts +17 -0
  385. package/dist/types/models/config/rightsManagementPxpComponentConfig.d.ts +6 -3
  386. package/dist/types/models/config/synchronisedStorageComponentConfig.d.ts +1 -1
  387. package/dist/types/models/config/taskSchedulerComponentConfig.d.ts +1 -1
  388. package/dist/types/models/config/telemetryComponentConfig.d.ts +1 -1
  389. package/dist/types/models/config/telemetryConnectorConfig.d.ts +1 -1
  390. package/dist/types/models/config/tenantAdminComponentConfig.d.ts +9 -0
  391. package/dist/types/models/config/vaultConnectorConfig.d.ts +1 -1
  392. package/dist/types/models/config/verifiableStorageComponentConfig.d.ts +1 -1
  393. package/dist/types/models/config/verifiableStorageConnectorConfig.d.ts +1 -1
  394. package/dist/types/models/config/walletConnectorConfig.d.ts +1 -1
  395. package/dist/types/models/types/authenticationGeneratorComponentType.d.ts +13 -0
  396. package/dist/types/models/types/dataSpaceConnectorComponentType.d.ts +21 -0
  397. package/dist/types/models/types/messagingAdminComponentType.d.ts +13 -0
  398. package/dist/types/models/types/rightsManagementDapComponentType.d.ts +17 -0
  399. package/dist/types/models/types/rightsManagementDarpComponentType.d.ts +13 -0
  400. package/dist/types/models/types/rightsManagementPapComponentType.d.ts +4 -0
  401. package/dist/types/models/types/rightsManagementPepComponentType.d.ts +4 -0
  402. package/dist/types/models/types/rightsManagementPnapComponentType.d.ts +17 -0
  403. package/dist/types/models/types/rightsManagementPnpComponentType.d.ts +17 -0
  404. package/dist/types/models/types/tenantAdminComponentType.d.ts +13 -0
  405. package/dist/types/utils/engineTypeHelper.d.ts +19 -0
  406. package/docs/changelog.md +318 -0
  407. package/docs/reference/classes/EngineTypeHelper.md +61 -0
  408. package/docs/reference/functions/initialiseAttestationComponent.md +3 -13
  409. package/docs/reference/functions/initialiseAttestationConnector.md +3 -13
  410. package/docs/reference/functions/initialiseAuditableItemGraphComponent.md +3 -13
  411. package/docs/reference/functions/initialiseAuditableItemStreamComponent.md +3 -13
  412. package/docs/reference/functions/initialiseAuthenticationGeneratorComponent.md +31 -0
  413. package/docs/reference/functions/initialiseBackgroundTaskConnector.md +3 -13
  414. package/docs/reference/functions/initialiseBlobStorageComponent.md +3 -13
  415. package/docs/reference/functions/initialiseBlobStorageConnector.md +3 -13
  416. package/docs/reference/functions/initialiseDataConverterConnector.md +3 -13
  417. package/docs/reference/functions/initialiseDataExtractorConnector.md +3 -13
  418. package/docs/reference/functions/initialiseDataProcessingComponent.md +3 -13
  419. package/docs/reference/functions/initialiseDataSpaceConnectorComponent.md +31 -0
  420. package/docs/reference/functions/initialiseDocumentManagementComponent.md +3 -13
  421. package/docs/reference/functions/initialiseEntityStorageComponent.md +3 -13
  422. package/docs/reference/functions/initialiseEntityStorageConnector.md +8 -2
  423. package/docs/reference/functions/initialiseEventBusComponent.md +3 -13
  424. package/docs/reference/functions/initialiseEventBusConnector.md +3 -13
  425. package/docs/reference/functions/initialiseFaucetConnector.md +3 -13
  426. package/docs/reference/functions/initialiseFederatedCatalogueComponent.md +3 -13
  427. package/docs/reference/functions/initialiseIdentityComponent.md +3 -13
  428. package/docs/reference/functions/initialiseIdentityConnector.md +3 -13
  429. package/docs/reference/functions/initialiseIdentityProfileComponent.md +3 -13
  430. package/docs/reference/functions/initialiseIdentityProfileConnector.md +3 -13
  431. package/docs/reference/functions/initialiseIdentityResolverComponent.md +3 -13
  432. package/docs/reference/functions/initialiseIdentityResolverConnector.md +3 -13
  433. package/docs/reference/functions/initialiseImmutableProofComponent.md +3 -13
  434. package/docs/reference/functions/initialiseLoggingComponent.md +3 -13
  435. package/docs/reference/functions/initialiseLoggingConnector.md +3 -13
  436. package/docs/reference/functions/initialiseMessagingAdminComponent.md +31 -0
  437. package/docs/reference/functions/initialiseMessagingComponent.md +3 -13
  438. package/docs/reference/functions/initialiseMessagingEmailConnector.md +3 -13
  439. package/docs/reference/functions/initialiseMessagingPushNotificationConnector.md +3 -13
  440. package/docs/reference/functions/initialiseMessagingSmsConnector.md +3 -13
  441. package/docs/reference/functions/initialiseNftComponent.md +3 -13
  442. package/docs/reference/functions/initialiseNftConnector.md +3 -13
  443. package/docs/reference/functions/initialiseRightsManagementDapComponent.md +31 -0
  444. package/docs/reference/functions/initialiseRightsManagementDarpComponent.md +31 -0
  445. package/docs/reference/functions/initialiseRightsManagementPapComponent.md +3 -13
  446. package/docs/reference/functions/initialiseRightsManagementPdpComponent.md +3 -13
  447. package/docs/reference/functions/initialiseRightsManagementPepComponent.md +3 -13
  448. package/docs/reference/functions/initialiseRightsManagementPipComponent.md +3 -13
  449. package/docs/reference/functions/initialiseRightsManagementPmpComponent.md +3 -13
  450. package/docs/reference/functions/initialiseRightsManagementPnapComponent.md +31 -0
  451. package/docs/reference/functions/initialiseRightsManagementPnpComponent.md +31 -0
  452. package/docs/reference/functions/initialiseRightsManagementPxpComponent.md +3 -13
  453. package/docs/reference/functions/initialiseSynchronisedStorageComponent.md +3 -13
  454. package/docs/reference/functions/initialiseTaskSchedulerComponent.md +3 -13
  455. package/docs/reference/functions/initialiseTelemetryComponent.md +3 -13
  456. package/docs/reference/functions/initialiseTelemetryConnector.md +3 -13
  457. package/docs/reference/functions/initialiseTenantAdminComponent.md +31 -0
  458. package/docs/reference/functions/initialiseVaultConnector.md +3 -13
  459. package/docs/reference/functions/initialiseVerifiableStorageComponent.md +3 -13
  460. package/docs/reference/functions/initialiseVerifiableStorageConnector.md +3 -13
  461. package/docs/reference/functions/initialiseWalletConnector.md +3 -13
  462. package/docs/reference/index.md +36 -5
  463. package/docs/reference/interfaces/IEngineConfig.md +45 -3
  464. package/docs/reference/type-aliases/AuthenticationGeneratorComponentConfig.md +17 -0
  465. package/docs/reference/type-aliases/AuthenticationGeneratorComponentType.md +5 -0
  466. package/docs/reference/type-aliases/DataSpaceConnectorComponentConfig.md +5 -0
  467. package/docs/reference/type-aliases/DataSpaceConnectorComponentType.md +5 -0
  468. package/docs/reference/type-aliases/EntityStorageComponentConfig.md +1 -1
  469. package/docs/reference/type-aliases/MessagingAdminComponentConfig.md +17 -0
  470. package/docs/reference/type-aliases/MessagingAdminComponentType.md +5 -0
  471. package/docs/reference/type-aliases/RightsManagementDapComponentConfig.md +5 -0
  472. package/docs/reference/type-aliases/RightsManagementDapComponentType.md +5 -0
  473. package/docs/reference/type-aliases/RightsManagementDarpComponentConfig.md +23 -0
  474. package/docs/reference/type-aliases/RightsManagementDarpComponentType.md +5 -0
  475. package/docs/reference/type-aliases/RightsManagementPapComponentConfig.md +1 -13
  476. package/docs/reference/type-aliases/RightsManagementPdpComponentConfig.md +7 -1
  477. package/docs/reference/type-aliases/RightsManagementPepComponentConfig.md +7 -1
  478. package/docs/reference/type-aliases/RightsManagementPipComponentConfig.md +7 -1
  479. package/docs/reference/type-aliases/RightsManagementPmpComponentConfig.md +1 -1
  480. package/docs/reference/type-aliases/RightsManagementPnapComponentConfig.md +5 -0
  481. package/docs/reference/type-aliases/RightsManagementPnapComponentType.md +5 -0
  482. package/docs/reference/type-aliases/RightsManagementPnpComponentConfig.md +5 -0
  483. package/docs/reference/type-aliases/RightsManagementPnpComponentType.md +5 -0
  484. package/docs/reference/type-aliases/RightsManagementPxpComponentConfig.md +7 -1
  485. package/docs/reference/type-aliases/TenantAdminComponentConfig.md +17 -0
  486. package/docs/reference/type-aliases/TenantAdminComponentType.md +5 -0
  487. package/docs/reference/variables/AttestationComponentType.md +1 -1
  488. package/docs/reference/variables/AttestationConnectorType.md +1 -1
  489. package/docs/reference/variables/AuditableItemGraphComponentType.md +1 -1
  490. package/docs/reference/variables/AuditableItemStreamComponentType.md +1 -1
  491. package/docs/reference/variables/AuthenticationGeneratorComponentType.md +13 -0
  492. package/docs/reference/variables/BackgroundTaskConnectorType.md +1 -1
  493. package/docs/reference/variables/BlobStorageComponentType.md +1 -1
  494. package/docs/reference/variables/BlobStorageConnectorType.md +1 -1
  495. package/docs/reference/variables/DataConverterConnectorType.md +1 -1
  496. package/docs/reference/variables/DataExtractorConnectorType.md +1 -1
  497. package/docs/reference/variables/DataProcessingComponentType.md +1 -1
  498. package/docs/reference/variables/DataSpaceConnectorComponentType.md +25 -0
  499. package/docs/reference/variables/DltConfigType.md +1 -1
  500. package/docs/reference/variables/DocumentManagementComponentType.md +1 -1
  501. package/docs/reference/variables/EntityStorageComponentType.md +1 -1
  502. package/docs/reference/variables/EntityStorageConnectorType.md +1 -1
  503. package/docs/reference/variables/EventBusComponentType.md +1 -1
  504. package/docs/reference/variables/EventBusConnectorType.md +1 -1
  505. package/docs/reference/variables/FaucetConnectorType.md +1 -1
  506. package/docs/reference/variables/FederatedCatalogueComponentType.md +1 -1
  507. package/docs/reference/variables/IdentityComponentType.md +1 -1
  508. package/docs/reference/variables/IdentityConnectorType.md +1 -1
  509. package/docs/reference/variables/IdentityProfileComponentType.md +1 -1
  510. package/docs/reference/variables/IdentityProfileConnectorType.md +1 -1
  511. package/docs/reference/variables/IdentityResolverComponentType.md +1 -1
  512. package/docs/reference/variables/IdentityResolverConnectorType.md +1 -1
  513. package/docs/reference/variables/ImmutableProofComponentType.md +1 -1
  514. package/docs/reference/variables/LoggingComponentType.md +1 -1
  515. package/docs/reference/variables/LoggingConnectorType.md +1 -1
  516. package/docs/reference/variables/MessagingAdminComponentType.md +13 -0
  517. package/docs/reference/variables/MessagingComponentType.md +1 -1
  518. package/docs/reference/variables/MessagingEmailConnectorType.md +1 -1
  519. package/docs/reference/variables/MessagingPushNotificationConnectorType.md +1 -1
  520. package/docs/reference/variables/MessagingSmsConnectorType.md +1 -1
  521. package/docs/reference/variables/NftComponentType.md +1 -1
  522. package/docs/reference/variables/NftConnectorType.md +1 -1
  523. package/docs/reference/variables/{RightsManagementComponentType.md → RightsManagementDapComponentType.md} +4 -4
  524. package/docs/reference/variables/RightsManagementDarpComponentType.md +13 -0
  525. package/docs/reference/variables/RightsManagementPapComponentType.md +7 -1
  526. package/docs/reference/variables/RightsManagementPdpComponentType.md +1 -1
  527. package/docs/reference/variables/RightsManagementPepComponentType.md +7 -1
  528. package/docs/reference/variables/RightsManagementPipComponentType.md +1 -1
  529. package/docs/reference/variables/RightsManagementPmpComponentType.md +1 -1
  530. package/docs/reference/variables/RightsManagementPnapComponentType.md +19 -0
  531. package/docs/reference/variables/RightsManagementPnpComponentType.md +19 -0
  532. package/docs/reference/variables/RightsManagementPxpComponentType.md +1 -1
  533. package/docs/reference/variables/SynchronisedStorageComponentType.md +1 -1
  534. package/docs/reference/variables/TaskSchedulerComponentType.md +1 -1
  535. package/docs/reference/variables/TelemetryComponentType.md +1 -1
  536. package/docs/reference/variables/TelemetryConnectorType.md +1 -1
  537. package/docs/reference/variables/TenantAdminComponentType.md +13 -0
  538. package/docs/reference/variables/VaultConnectorType.md +1 -1
  539. package/docs/reference/variables/VerifiableStorageComponentType.md +1 -1
  540. package/docs/reference/variables/VerifiableStorageConnectorType.md +1 -1
  541. package/docs/reference/variables/WalletConnectorType.md +1 -1
  542. package/locales/en.json +14 -1
  543. package/package.json +30 -9
  544. package/dist/cjs/index.cjs +0 -3224
  545. package/dist/esm/index.mjs +0 -3127
  546. package/dist/types/components/rightsManagement.d.ts +0 -13
  547. package/dist/types/models/config/rightsManagementComponentConfig.d.ts +0 -13
  548. package/dist/types/models/types/rightsManagementComponentType.d.ts +0 -17
  549. package/docs/reference/functions/initialiseRightsManagementComponent.md +0 -41
  550. package/docs/reference/functions/initialiseWalletStorage.md +0 -41
  551. package/docs/reference/type-aliases/RightsManagementComponentConfig.md +0 -5
  552. package/docs/reference/type-aliases/RightsManagementComponentType.md +0 -5
@@ -1,3224 +0,0 @@
1
- 'use strict';
2
-
3
- var attestationConnectorNft = require('@twin.org/attestation-connector-nft');
4
- var attestationModels = require('@twin.org/attestation-models');
5
- var attestationRestClient = require('@twin.org/attestation-rest-client');
6
- var attestationService = require('@twin.org/attestation-service');
7
- var core = require('@twin.org/core');
8
- var auditableItemGraphRestClient = require('@twin.org/auditable-item-graph-rest-client');
9
- var auditableItemGraphService = require('@twin.org/auditable-item-graph-service');
10
- var path = require('node:path');
11
- var entityStorageConnectorCosmosdb = require('@twin.org/entity-storage-connector-cosmosdb');
12
- var entityStorageConnectorDynamodb = require('@twin.org/entity-storage-connector-dynamodb');
13
- var entityStorageConnectorFile = require('@twin.org/entity-storage-connector-file');
14
- var entityStorageConnectorGcpFirestore = require('@twin.org/entity-storage-connector-gcp-firestore');
15
- var entityStorageConnectorMemory = require('@twin.org/entity-storage-connector-memory');
16
- var entityStorageConnectorMongodb = require('@twin.org/entity-storage-connector-mongodb');
17
- var entityStorageConnectorMysql = require('@twin.org/entity-storage-connector-mysql');
18
- var entityStorageConnectorPostgresql = require('@twin.org/entity-storage-connector-postgresql');
19
- var entityStorageConnectorScylladb = require('@twin.org/entity-storage-connector-scylladb');
20
- var entityStorageConnectorSynchronised = require('@twin.org/entity-storage-connector-synchronised');
21
- var entityStorageModels = require('@twin.org/entity-storage-models');
22
- var entityStorageRestClient = require('@twin.org/entity-storage-rest-client');
23
- var entityStorageService = require('@twin.org/entity-storage-service');
24
- var auditableItemStreamRestClient = require('@twin.org/auditable-item-stream-rest-client');
25
- var auditableItemStreamService = require('@twin.org/auditable-item-stream-service');
26
- var backgroundTaskConnectorEntityStorage = require('@twin.org/background-task-connector-entity-storage');
27
- var backgroundTaskModels = require('@twin.org/background-task-models');
28
- var blobStorageConnectorAwsS3 = require('@twin.org/blob-storage-connector-aws-s3');
29
- var blobStorageConnectorAzure = require('@twin.org/blob-storage-connector-azure');
30
- var blobStorageConnectorFile = require('@twin.org/blob-storage-connector-file');
31
- var blobStorageConnectorGcp = require('@twin.org/blob-storage-connector-gcp');
32
- var blobStorageConnectorIpfs = require('@twin.org/blob-storage-connector-ipfs');
33
- var blobStorageConnectorMemory = require('@twin.org/blob-storage-connector-memory');
34
- var blobStorageModels = require('@twin.org/blob-storage-models');
35
- var blobStorageRestClient = require('@twin.org/blob-storage-rest-client');
36
- var blobStorageService = require('@twin.org/blob-storage-service');
37
- var dataProcessingConverters = require('@twin.org/data-processing-converters');
38
- var dataProcessingExtractors = require('@twin.org/data-processing-extractors');
39
- var dataProcessingModels = require('@twin.org/data-processing-models');
40
- var dataProcessingRestClient = require('@twin.org/data-processing-rest-client');
41
- var dataProcessingService = require('@twin.org/data-processing-service');
42
- var documentManagementRestClient = require('@twin.org/document-management-rest-client');
43
- var documentManagementService = require('@twin.org/document-management-service');
44
- var eventBusConnectorLocal = require('@twin.org/event-bus-connector-local');
45
- var eventBusModels = require('@twin.org/event-bus-models');
46
- var eventBusService = require('@twin.org/event-bus-service');
47
- var eventBusSocketClient = require('@twin.org/event-bus-socket-client');
48
- var walletConnectorEntityStorage = require('@twin.org/wallet-connector-entity-storage');
49
- var walletConnectorIota = require('@twin.org/wallet-connector-iota');
50
- var walletModels = require('@twin.org/wallet-models');
51
- var federatedCatalogueRestClient = require('@twin.org/federated-catalogue-rest-client');
52
- var federatedCatalogueService = require('@twin.org/federated-catalogue-service');
53
- var identityConnectorEntityStorage = require('@twin.org/identity-connector-entity-storage');
54
- var identityConnectorIota = require('@twin.org/identity-connector-iota');
55
- var identityModels = require('@twin.org/identity-models');
56
- var identityRestClient = require('@twin.org/identity-rest-client');
57
- var identityService = require('@twin.org/identity-service');
58
- var identityConnectorUniversal = require('@twin.org/identity-connector-universal');
59
- var immutableProofRestClient = require('@twin.org/immutable-proof-rest-client');
60
- var immutableProofService = require('@twin.org/immutable-proof-service');
61
- var loggingConnectorConsole = require('@twin.org/logging-connector-console');
62
- var loggingConnectorEntityStorage = require('@twin.org/logging-connector-entity-storage');
63
- var loggingModels = require('@twin.org/logging-models');
64
- var loggingRestClient = require('@twin.org/logging-rest-client');
65
- var loggingService = require('@twin.org/logging-service');
66
- var messagingConnectorAws = require('@twin.org/messaging-connector-aws');
67
- var messagingConnectorEntityStorage = require('@twin.org/messaging-connector-entity-storage');
68
- var messagingModels = require('@twin.org/messaging-models');
69
- var messagingService = require('@twin.org/messaging-service');
70
- var nftConnectorEntityStorage = require('@twin.org/nft-connector-entity-storage');
71
- var nftConnectorIota = require('@twin.org/nft-connector-iota');
72
- var nftModels = require('@twin.org/nft-models');
73
- var nftRestClient = require('@twin.org/nft-rest-client');
74
- var nftService = require('@twin.org/nft-service');
75
- var rightsManagementRestClient = require('@twin.org/rights-management-rest-client');
76
- var rightsManagementService = require('@twin.org/rights-management-service');
77
- var rightsManagementPapService = require('@twin.org/rights-management-pap-service');
78
- var rightsManagementPdpService = require('@twin.org/rights-management-pdp-service');
79
- var rightsManagementPepService = require('@twin.org/rights-management-pep-service');
80
- var rightsManagementPipService = require('@twin.org/rights-management-pip-service');
81
- var rightsManagementPmpService = require('@twin.org/rights-management-pmp-service');
82
- var rightsManagementPxpService = require('@twin.org/rights-management-pxp-service');
83
- var synchronisedStorageRestClient = require('@twin.org/synchronised-storage-rest-client');
84
- var synchronisedStorageService = require('@twin.org/synchronised-storage-service');
85
- var backgroundTaskScheduler = require('@twin.org/background-task-scheduler');
86
- var telemetryConnectorEntityStorage = require('@twin.org/telemetry-connector-entity-storage');
87
- var telemetryModels = require('@twin.org/telemetry-models');
88
- var telemetryRestClient = require('@twin.org/telemetry-rest-client');
89
- var telemetryService = require('@twin.org/telemetry-service');
90
- var vaultConnectorEntityStorage = require('@twin.org/vault-connector-entity-storage');
91
- var vaultConnectorHashicorp = require('@twin.org/vault-connector-hashicorp');
92
- var vaultModels = require('@twin.org/vault-models');
93
- var verifiableStorageConnectorEntityStorage = require('@twin.org/verifiable-storage-connector-entity-storage');
94
- var verifiableStorageConnectorIota = require('@twin.org/verifiable-storage-connector-iota');
95
- var verifiableStorageModels = require('@twin.org/verifiable-storage-models');
96
- var verifiableStorageRestClient = require('@twin.org/verifiable-storage-rest-client');
97
- var verifiableStorageService = require('@twin.org/verifiable-storage-service');
98
-
99
- // Copyright 2024 IOTA Stiftung.
100
- // SPDX-License-Identifier: Apache-2.0.
101
- /**
102
- * Attestation component types.
103
- */
104
- // eslint-disable-next-line @typescript-eslint/naming-convention
105
- const AttestationComponentType = {
106
- /**
107
- * Service.
108
- */
109
- Service: "service",
110
- /**
111
- * REST client.
112
- */
113
- RestClient: "rest-client"
114
- };
115
-
116
- // Copyright 2024 IOTA Stiftung.
117
- // SPDX-License-Identifier: Apache-2.0.
118
- /**
119
- * Attestation connector types.
120
- */
121
- // eslint-disable-next-line @typescript-eslint/naming-convention
122
- const AttestationConnectorType = {
123
- /**
124
- * NFT.
125
- */
126
- Nft: "nft"
127
- };
128
-
129
- // Copyright 2024 IOTA Stiftung.
130
- // SPDX-License-Identifier: Apache-2.0.
131
- /**
132
- * Initialise the attestation connector.
133
- * @param engineCore The engine core.
134
- * @param context The context for the engine.
135
- * @param instanceConfig The instance config.
136
- * @param overrideInstanceType The instance type to override the default.
137
- * @returns The name of the instance created.
138
- * @throws GeneralError if the connector type is unknown.
139
- */
140
- function initialiseAttestationConnector(engineCore, context, instanceConfig, overrideInstanceType) {
141
- engineCore.logInfo(core.I18n.formatMessage("engineCore.configuring", {
142
- element: `Attestation Connector: ${instanceConfig.type}`
143
- }));
144
- const type = instanceConfig.type;
145
- let connector;
146
- let instanceType;
147
- if (type === AttestationConnectorType.Nft) {
148
- connector = new attestationConnectorNft.NftAttestationConnector({
149
- identityConnectorType: engineCore.getRegisteredInstanceType("identityConnector"),
150
- nftConnectorType: engineCore.getRegisteredInstanceType("nftConnector"),
151
- ...instanceConfig.options
152
- });
153
- instanceType = attestationConnectorNft.NftAttestationConnector.NAMESPACE;
154
- }
155
- else {
156
- throw new core.GeneralError("engineCore", "connectorUnknownType", {
157
- type,
158
- connectorType: "attestationConnector"
159
- });
160
- }
161
- const finalInstanceType = overrideInstanceType ?? instanceType;
162
- context.componentInstances.push({
163
- instanceType: finalInstanceType,
164
- component: connector
165
- });
166
- attestationModels.AttestationConnectorFactory.register(finalInstanceType, () => connector);
167
- return finalInstanceType;
168
- }
169
- /**
170
- * Initialise the attestation component.
171
- * @param engineCore The engine core.
172
- * @param context The context for the engine.
173
- * @param instanceConfig The instance config.
174
- * @param overrideInstanceType The instance type to override the default.
175
- * @returns The name of the instance created.
176
- * @throws GeneralError if the component type is unknown.
177
- */
178
- function initialiseAttestationComponent(engineCore, context, instanceConfig, overrideInstanceType) {
179
- engineCore.logInfo(core.I18n.formatMessage("engineCore.configuring", {
180
- element: `Attestation Component: ${instanceConfig.type}`
181
- }));
182
- const type = instanceConfig.type;
183
- let component;
184
- let instanceType;
185
- if (type === AttestationComponentType.Service) {
186
- component = new attestationService.AttestationService({
187
- ...instanceConfig.options
188
- });
189
- instanceType = core.StringHelper.kebabCase("AttestationService");
190
- }
191
- else if (type === AttestationComponentType.RestClient) {
192
- component = new attestationRestClient.AttestationClient(instanceConfig.options);
193
- instanceType = core.StringHelper.kebabCase("AttestationClient");
194
- }
195
- else {
196
- throw new core.GeneralError("engineCore", "componentUnknownType", {
197
- type,
198
- componentType: "attestationComponent"
199
- });
200
- }
201
- const finalInstanceType = overrideInstanceType ?? instanceType;
202
- context.componentInstances.push({
203
- instanceType: finalInstanceType,
204
- component
205
- });
206
- core.ComponentFactory.register(finalInstanceType, () => component);
207
- return finalInstanceType;
208
- }
209
-
210
- // Copyright 2024 IOTA Stiftung.
211
- // SPDX-License-Identifier: Apache-2.0.
212
- /**
213
- * Entity storage component types.
214
- */
215
- // eslint-disable-next-line @typescript-eslint/naming-convention
216
- const EntityStorageComponentType = {
217
- /**
218
- * Service.
219
- */
220
- Service: "service",
221
- /**
222
- * REST client.
223
- */
224
- RestClient: "rest-client"
225
- };
226
-
227
- // Copyright 2024 IOTA Stiftung.
228
- // SPDX-License-Identifier: Apache-2.0.
229
- /**
230
- * Entity storage connector types.
231
- */
232
- // eslint-disable-next-line @typescript-eslint/naming-convention
233
- const EntityStorageConnectorType = {
234
- /**
235
- * Use storage.
236
- */
237
- File: "file",
238
- /**
239
- * Memory.
240
- */
241
- Memory: "memory",
242
- /**
243
- * ScyllaDb.
244
- */
245
- ScyllaDb: "scylladb",
246
- /**
247
- * AWS DynamoDB.
248
- */
249
- AwsDynamoDb: "aws-dynamodb",
250
- /**
251
- * Azure CosmosDB.
252
- */
253
- AzureCosmosDb: "azure-cosmosdb",
254
- /**
255
- * GCP Firestore.
256
- */
257
- GcpFirestoreDb: "gcp-firestoredb",
258
- /**
259
- * MySqlDb.
260
- */
261
- MySqlDb: "mysql",
262
- /**
263
- * MongoDb.
264
- */
265
- MongoDb: "mongodb",
266
- /**
267
- * Postgre SQL.
268
- */
269
- PostgreSql: "postgresql",
270
- /**
271
- * Synchronised.
272
- */
273
- Synchronised: "synchronised"
274
- };
275
-
276
- // Copyright 2024 IOTA Stiftung.
277
- // SPDX-License-Identifier: Apache-2.0.
278
- /**
279
- * Initialise the entity storage connector.
280
- * @param engineCore The engine core.
281
- * @param context The context for the engine.
282
- * @param typeCustom Override the type of connector to use instead of default configuration.
283
- * @param schema The schema for the entity storage.
284
- * @returns The name of the instance type that was created.
285
- * @throws GeneralError if the connector type is unknown.
286
- */
287
- function initialiseEntityStorageConnector(engineCore, context, typeCustom, schema) {
288
- const instanceName = core.StringHelper.kebabCase(schema);
289
- if (!entityStorageModels.EntityStorageConnectorFactory.hasName(instanceName)) {
290
- let entityStorageConfig;
291
- if (core.Is.stringValue(typeCustom)) {
292
- // A custom type has been specified, so look it up
293
- entityStorageConfig = context.config.types.entityStorageConnector?.find(c => c.type === typeCustom || c.overrideInstanceType === typeCustom);
294
- if (core.Is.empty(entityStorageConfig)) {
295
- throw new core.GeneralError("engineCore", "entityStorageCustomMissing", {
296
- typeCustom,
297
- storageName: instanceName
298
- });
299
- }
300
- }
301
- else {
302
- // The default entity storage method is either the one with the isDefault flag set
303
- // or pick the first one if no default is set.
304
- entityStorageConfig =
305
- context.config.types.entityStorageConnector?.find(c => c.isDefault ?? false) ??
306
- context.config.types.entityStorageConnector?.[0];
307
- if (core.Is.empty(entityStorageConfig)) {
308
- throw new core.GeneralError("engineCore", "entityStorageMissing", {
309
- storageName: instanceName
310
- });
311
- }
312
- }
313
- const type = entityStorageConfig.type;
314
- let entityStorageConnector;
315
- engineCore.logInfo(core.I18n.formatMessage("engineCore.configuringEntityStorage", {
316
- element: "Entity Storage",
317
- storageName: instanceName,
318
- storageType: type
319
- }));
320
- if (type === EntityStorageConnectorType.Memory) {
321
- entityStorageConnector = new entityStorageConnectorMemory.MemoryEntityStorageConnector({
322
- entitySchema: schema
323
- });
324
- }
325
- else if (type === EntityStorageConnectorType.File) {
326
- entityStorageConnector = new entityStorageConnectorFile.FileEntityStorageConnector({
327
- entitySchema: schema,
328
- ...entityStorageConfig.options,
329
- config: {
330
- ...entityStorageConfig.options.config,
331
- directory: path.join(entityStorageConfig.options.config.directory, `${entityStorageConfig.options.folderPrefix ?? ""}${instanceName}`)
332
- }
333
- });
334
- }
335
- else if (type === EntityStorageConnectorType.AwsDynamoDb) {
336
- entityStorageConnector = new entityStorageConnectorDynamodb.DynamoDbEntityStorageConnector({
337
- entitySchema: schema,
338
- ...entityStorageConfig.options,
339
- config: {
340
- ...entityStorageConfig.options.config,
341
- tableName: `${entityStorageConfig.options.tablePrefix ?? ""}${instanceName}`
342
- }
343
- });
344
- }
345
- else if (type === EntityStorageConnectorType.AzureCosmosDb) {
346
- entityStorageConnector = new entityStorageConnectorCosmosdb.CosmosDbEntityStorageConnector({
347
- entitySchema: schema,
348
- ...entityStorageConfig.options,
349
- config: {
350
- ...entityStorageConfig.options.config,
351
- containerId: `${entityStorageConfig.options.tablePrefix ?? ""}${instanceName}`
352
- }
353
- });
354
- }
355
- else if (type === EntityStorageConnectorType.GcpFirestoreDb) {
356
- entityStorageConnector = new entityStorageConnectorGcpFirestore.FirestoreEntityStorageConnector({
357
- entitySchema: schema,
358
- ...entityStorageConfig.options,
359
- config: {
360
- ...entityStorageConfig.options.config,
361
- collectionName: `${entityStorageConfig.options.tablePrefix ?? ""}${instanceName}`
362
- }
363
- });
364
- }
365
- else if (type === EntityStorageConnectorType.ScyllaDb) {
366
- entityStorageConnector = new entityStorageConnectorScylladb.ScyllaDBTableConnector({
367
- entitySchema: schema,
368
- ...entityStorageConfig.options,
369
- config: {
370
- ...entityStorageConfig.options.config,
371
- tableName: `${entityStorageConfig.options.tablePrefix ?? ""}${instanceName}`
372
- }
373
- });
374
- }
375
- else if (type === EntityStorageConnectorType.MySqlDb) {
376
- entityStorageConnector = new entityStorageConnectorMysql.MySqlEntityStorageConnector({
377
- entitySchema: schema,
378
- ...entityStorageConfig.options,
379
- config: {
380
- ...entityStorageConfig.options.config,
381
- tableName: `${entityStorageConfig.options.tablePrefix ?? ""}${instanceName}`
382
- }
383
- });
384
- }
385
- else if (type === EntityStorageConnectorType.MongoDb) {
386
- entityStorageConnector = new entityStorageConnectorMongodb.MongoDbEntityStorageConnector({
387
- entitySchema: schema,
388
- ...entityStorageConfig.options,
389
- config: {
390
- ...entityStorageConfig.options.config,
391
- collection: `${entityStorageConfig.options.tablePrefix ?? ""}${instanceName}`
392
- }
393
- });
394
- }
395
- else if (type === EntityStorageConnectorType.PostgreSql) {
396
- entityStorageConnector = new entityStorageConnectorPostgresql.PostgreSqlEntityStorageConnector({
397
- entitySchema: schema,
398
- ...entityStorageConfig.options,
399
- config: {
400
- ...entityStorageConfig.options.config,
401
- tableName: `${entityStorageConfig.options.tablePrefix ?? ""}${instanceName}`
402
- }
403
- });
404
- }
405
- else if (type === EntityStorageConnectorType.Synchronised) {
406
- // Create the entity storage that is wrapped by the synchronised connector
407
- // by removing the custom type it will default to the standard storage
408
- // mechanism for entity storage
409
- const wrappedInstanceName = initialiseEntityStorageConnector(engineCore, context, undefined, schema);
410
- // Use the wrapped instance name as the entity storage connector type
411
- // for the synchronised connector
412
- entityStorageConnector = new entityStorageConnectorSynchronised.SynchronisedEntityStorageConnector({
413
- entitySchema: schema,
414
- ...entityStorageConfig.options,
415
- entityStorageConnectorType: wrappedInstanceName,
416
- eventBusComponentType: engineCore.getRegisteredInstanceType("eventBusComponent"),
417
- config: {
418
- ...entityStorageConfig.options.config
419
- }
420
- });
421
- }
422
- else {
423
- throw new core.GeneralError("engineCore", "connectorUnknownType", {
424
- type,
425
- connectorType: "entityStorageConnector"
426
- });
427
- }
428
- context.componentInstances.push({
429
- instanceType: instanceName,
430
- component: entityStorageConnector
431
- });
432
- entityStorageModels.EntityStorageConnectorFactory.register(instanceName, () => entityStorageConnector);
433
- }
434
- return instanceName;
435
- }
436
- /**
437
- * Initialise the entity storage connector.
438
- * @param engineCore The engine core.
439
- * @param context The context for the engine.
440
- * @param instanceConfig The instance config.
441
- * @param overrideInstanceType The instance type to override the default.
442
- * @returns The name of the instance created.
443
- * @throws GeneralError if the connector type is unknown.
444
- */
445
- function initialiseEntityStorageComponent(engineCore, context, instanceConfig, overrideInstanceType) {
446
- engineCore.logInfo(core.I18n.formatMessage("engineCore.configuring", {
447
- element: `Entity Storage Component: ${instanceConfig.type}`
448
- }));
449
- const type = instanceConfig.type;
450
- let component;
451
- let instanceType;
452
- if (type === EntityStorageComponentType.Service) {
453
- const kebabName = core.StringHelper.kebabCase(instanceConfig.options.entityStorageType);
454
- // See if there is a custom entity storage for this type, otherwise just use the default one.
455
- const hasCustom = context.config.types.entityStorageConnector?.some(c => c.type === kebabName || c.overrideInstanceType === kebabName);
456
- initialiseEntityStorageConnector(engineCore, context, hasCustom ? kebabName : undefined, instanceConfig.options.entityStorageType);
457
- component = new entityStorageService.EntityStorageService({
458
- entityStorageType: kebabName,
459
- config: {
460
- ...instanceConfig.options.config
461
- }
462
- });
463
- instanceType = core.StringHelper.kebabCase(instanceConfig.options.entityStorageType);
464
- }
465
- else if (type === EntityStorageComponentType.RestClient) {
466
- const kebabName = core.StringHelper.kebabCase(instanceConfig.options.entityStorageType);
467
- component = new entityStorageRestClient.EntityStorageClient({
468
- pathPrefix: kebabName,
469
- ...instanceConfig.options
470
- });
471
- instanceType = `${core.StringHelper.kebabCase("EntityStorageClient")}-${kebabName}`;
472
- }
473
- else {
474
- throw new core.GeneralError("engineCore", "componentUnknownType", {
475
- type,
476
- serviceType: "entityStorageComponent"
477
- });
478
- }
479
- const finalInstanceType = overrideInstanceType ?? instanceType;
480
- context.componentInstances.push({
481
- instanceType: finalInstanceType,
482
- component
483
- });
484
- core.ComponentFactory.register(finalInstanceType, () => component);
485
- return finalInstanceType;
486
- }
487
-
488
- // Copyright 2024 IOTA Stiftung.
489
- // SPDX-License-Identifier: Apache-2.0.
490
- /**
491
- * Auditable item graph component types.
492
- */
493
- // eslint-disable-next-line @typescript-eslint/naming-convention
494
- const AuditableItemGraphComponentType = {
495
- /**
496
- * Service.
497
- */
498
- Service: "service",
499
- /**
500
- * REST client.
501
- */
502
- RestClient: "rest-client"
503
- };
504
-
505
- /**
506
- * Initialise the auditable item graph component.
507
- * @param engineCore The engine core.
508
- * @param context The context for the engine.
509
- * @param instanceConfig The instance config.
510
- * @param overrideInstanceType The instance type to override the default.
511
- * @returns The name of the instance created.
512
- * @throws GeneralError if the component type is unknown.
513
- */
514
- function initialiseAuditableItemGraphComponent(engineCore, context, instanceConfig, overrideInstanceType) {
515
- engineCore.logInfo(core.I18n.formatMessage("engineCore.configuring", {
516
- element: `Auditable Item Graph Component: ${instanceConfig.type}`
517
- }));
518
- const type = instanceConfig.type;
519
- let component;
520
- let instanceType;
521
- if (type === AuditableItemGraphComponentType.Service) {
522
- auditableItemGraphService.initSchema();
523
- initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.vertexEntityStorageType, "AuditableItemGraphVertex");
524
- initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.changesetEntityStorageType, "AuditableItemGraphChangeset");
525
- component = new auditableItemGraphService.AuditableItemGraphService({
526
- immutableProofComponentType: engineCore.getRegisteredInstanceType("immutableProofComponent"),
527
- eventBusComponentType: engineCore.getRegisteredInstanceTypeOptional("eventBusComponent"),
528
- ...instanceConfig.options
529
- });
530
- instanceType = core.StringHelper.kebabCase("AuditableItemGraphService");
531
- }
532
- else if (type === AuditableItemGraphComponentType.RestClient) {
533
- component = new auditableItemGraphRestClient.AuditableItemGraphClient(instanceConfig.options);
534
- instanceType = core.StringHelper.kebabCase("AuditableItemGraphClient");
535
- }
536
- else {
537
- throw new core.GeneralError("engineCore", "componentUnknownType", {
538
- type,
539
- componentType: "auditableItemGraphComponent"
540
- });
541
- }
542
- const finalInstanceType = overrideInstanceType ?? instanceType;
543
- context.componentInstances.push({
544
- instanceType: finalInstanceType,
545
- component
546
- });
547
- core.ComponentFactory.register(finalInstanceType, () => component);
548
- return finalInstanceType;
549
- }
550
-
551
- // Copyright 2024 IOTA Stiftung.
552
- // SPDX-License-Identifier: Apache-2.0.
553
- /**
554
- * Auditable item stream component types.
555
- */
556
- // eslint-disable-next-line @typescript-eslint/naming-convention
557
- const AuditableItemStreamComponentType = {
558
- /**
559
- * Service.
560
- */
561
- Service: "service",
562
- /**
563
- * REST client.
564
- */
565
- RestClient: "rest-client"
566
- };
567
-
568
- /**
569
- * Initialise the auditable item stream component.
570
- * @param engineCore The engine core.
571
- * @param context The context for the engine.
572
- * @param instanceConfig The instance config.
573
- * @param overrideInstanceType The instance type to override the default.
574
- * @returns The name of the instance created.
575
- * @throws GeneralError if the component type is unknown.
576
- */
577
- function initialiseAuditableItemStreamComponent(engineCore, context, instanceConfig, overrideInstanceType) {
578
- engineCore.logInfo(core.I18n.formatMessage("engineCore.configuring", {
579
- element: `Auditable Item Stream Component: ${instanceConfig.type}`
580
- }));
581
- const type = instanceConfig.type;
582
- let component;
583
- let instanceType;
584
- if (type === AuditableItemStreamComponentType.Service) {
585
- auditableItemStreamService.initSchema();
586
- initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.streamEntityStorageType, "AuditableItemStream");
587
- initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.streamEntryEntityStorageType, "AuditableItemStreamEntry");
588
- component = new auditableItemStreamService.AuditableItemStreamService({
589
- immutableProofComponentType: engineCore.getRegisteredInstanceType("immutableProofComponent"),
590
- eventBusComponentType: engineCore.getRegisteredInstanceTypeOptional("eventBusComponent"),
591
- ...instanceConfig.options
592
- });
593
- instanceType = core.StringHelper.kebabCase("AuditableItemStreamService");
594
- }
595
- else if (type === AuditableItemStreamComponentType.RestClient) {
596
- component = new auditableItemStreamRestClient.AuditableItemStreamClient(instanceConfig.options);
597
- instanceType = core.StringHelper.kebabCase("AuditableItemStreamClient");
598
- }
599
- else {
600
- throw new core.GeneralError("engineCore", "componentUnknownType", {
601
- type,
602
- componentType: "auditableItemStreamComponent"
603
- });
604
- }
605
- const finalInstanceType = overrideInstanceType ?? instanceType;
606
- context.componentInstances.push({
607
- instanceType: finalInstanceType,
608
- component
609
- });
610
- core.ComponentFactory.register(finalInstanceType, () => component);
611
- return finalInstanceType;
612
- }
613
-
614
- // Copyright 2024 IOTA Stiftung.
615
- // SPDX-License-Identifier: Apache-2.0.
616
- /**
617
- * Background task connector types.
618
- */
619
- // eslint-disable-next-line @typescript-eslint/naming-convention
620
- const BackgroundTaskConnectorType = {
621
- /**
622
- * Entity storage.
623
- */
624
- EntityStorage: "entity-storage"
625
- };
626
-
627
- // Copyright 2024 IOTA Stiftung.
628
- // SPDX-License-Identifier: Apache-2.0.
629
- /**
630
- * Initialise a background task connector.
631
- * @param engineCore The engine core.
632
- * @param context The context for the engine.
633
- * @param instanceConfig The instance config.
634
- * @param overrideInstanceType The instance type to override the default.
635
- * @returns The name of the instance created.
636
- * @throws GeneralError if the connector type is unknown.
637
- */
638
- function initialiseBackgroundTaskConnector(engineCore, context, instanceConfig, overrideInstanceType) {
639
- engineCore.logInfo(core.I18n.formatMessage("engineCore.configuring", {
640
- element: `Background Task Connector: ${instanceConfig.type}`
641
- }));
642
- const type = instanceConfig.type;
643
- let connector;
644
- let instanceType;
645
- if (type === BackgroundTaskConnectorType.EntityStorage) {
646
- backgroundTaskConnectorEntityStorage.initSchema();
647
- initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.backgroundTaskEntityStorageType, "BackgroundTask");
648
- connector = new backgroundTaskConnectorEntityStorage.EntityStorageBackgroundTaskConnector({
649
- loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
650
- ...instanceConfig.options
651
- });
652
- instanceType = backgroundTaskConnectorEntityStorage.EntityStorageBackgroundTaskConnector.NAMESPACE;
653
- }
654
- else {
655
- throw new core.GeneralError("engineCore", "connectorUnknownType", {
656
- type,
657
- connectorType: "backgroundTaskConnector"
658
- });
659
- }
660
- const finalInstanceType = overrideInstanceType ?? instanceType;
661
- context.componentInstances.push({ instanceType: finalInstanceType, component: connector });
662
- backgroundTaskModels.BackgroundTaskConnectorFactory.register(finalInstanceType, () => connector);
663
- return finalInstanceType;
664
- }
665
-
666
- // Copyright 2024 IOTA Stiftung.
667
- // SPDX-License-Identifier: Apache-2.0.
668
- /**
669
- * Blob storage component types.
670
- */
671
- // eslint-disable-next-line @typescript-eslint/naming-convention
672
- const BlobStorageComponentType = {
673
- /**
674
- * Service.
675
- */
676
- Service: "service",
677
- /**
678
- * REST client.
679
- */
680
- RestClient: "rest-client"
681
- };
682
-
683
- // Copyright 2024 IOTA Stiftung.
684
- // SPDX-License-Identifier: Apache-2.0.
685
- /**
686
- * Blob storage connector types.
687
- */
688
- // eslint-disable-next-line @typescript-eslint/naming-convention
689
- const BlobStorageConnectorType = {
690
- /**
691
- * File storage.
692
- */
693
- File: "file",
694
- /**
695
- * Memory.
696
- */
697
- Memory: "memory",
698
- /**
699
- * IPFS.
700
- */
701
- Ipfs: "ipfs",
702
- /**
703
- * AWS S3.
704
- */
705
- AwsS3: "aws-s3",
706
- /**
707
- * Azure Storage.
708
- */
709
- AzureStorage: "azure-storage",
710
- /**
711
- * GCP Storage.
712
- */
713
- GcpStorage: "gcp-storage"
714
- };
715
-
716
- // Copyright 2024 IOTA Stiftung.
717
- // SPDX-License-Identifier: Apache-2.0.
718
- /**
719
- * Initialise the blob storage connector.
720
- * @param engineCore The engine core.
721
- * @param context The context for the engine.
722
- * @param instanceConfig The instance config.
723
- * @param overrideInstanceType The instance type to override the default.
724
- * @returns The name of the instance created.
725
- * @throws GeneralError if the connector type is unknown.
726
- */
727
- function initialiseBlobStorageConnector(engineCore, context, instanceConfig, overrideInstanceType) {
728
- engineCore.logInfo(core.I18n.formatMessage("engineCore.configuring", {
729
- element: `Blob Storage Connector: ${instanceConfig.type}`
730
- }));
731
- const type = instanceConfig.type;
732
- let connector;
733
- let instanceType;
734
- if (type === BlobStorageConnectorType.Ipfs) {
735
- connector = new blobStorageConnectorIpfs.IpfsBlobStorageConnector(instanceConfig.options);
736
- instanceType = blobStorageConnectorIpfs.IpfsBlobStorageConnector.NAMESPACE;
737
- }
738
- else if (type === BlobStorageConnectorType.File) {
739
- connector = new blobStorageConnectorFile.FileBlobStorageConnector({
740
- ...instanceConfig.options,
741
- config: {
742
- ...instanceConfig.options.config,
743
- directory: core.Is.stringValue(instanceConfig.options.storagePrefix)
744
- ? path.join(instanceConfig.options.config.directory, instanceConfig.options.storagePrefix)
745
- : instanceConfig.options.config.directory
746
- }
747
- });
748
- instanceType = blobStorageConnectorFile.FileBlobStorageConnector.NAMESPACE;
749
- }
750
- else if (type === BlobStorageConnectorType.Memory) {
751
- connector = new blobStorageConnectorMemory.MemoryBlobStorageConnector();
752
- instanceType = blobStorageConnectorMemory.MemoryBlobStorageConnector.NAMESPACE;
753
- }
754
- else if (type === BlobStorageConnectorType.AwsS3) {
755
- connector = new blobStorageConnectorAwsS3.S3BlobStorageConnector({
756
- ...instanceConfig.options,
757
- config: {
758
- ...instanceConfig.options.config,
759
- bucketName: `${instanceConfig.options.storagePrefix ?? ""}${instanceConfig.options.config.bucketName}`
760
- }
761
- });
762
- instanceType = blobStorageConnectorAwsS3.S3BlobStorageConnector.NAMESPACE;
763
- }
764
- else if (type === BlobStorageConnectorType.GcpStorage) {
765
- connector = new blobStorageConnectorGcp.GcpBlobStorageConnector({
766
- ...instanceConfig.options,
767
- config: {
768
- ...instanceConfig.options.config,
769
- bucketName: `${instanceConfig.options.storagePrefix ?? ""}${instanceConfig.options.config.bucketName}`
770
- }
771
- });
772
- instanceType = blobStorageConnectorGcp.GcpBlobStorageConnector.NAMESPACE;
773
- }
774
- else if (type === BlobStorageConnectorType.AzureStorage) {
775
- connector = new blobStorageConnectorAzure.AzureBlobStorageConnector({
776
- ...instanceConfig.options,
777
- config: {
778
- ...instanceConfig.options.config,
779
- containerName: `${instanceConfig.options.storagePrefix ?? ""}${instanceConfig.options.config.containerName}`
780
- }
781
- });
782
- instanceType = blobStorageConnectorAzure.AzureBlobStorageConnector.NAMESPACE;
783
- }
784
- else {
785
- throw new core.GeneralError("engineCore", "connectorUnknownType", {
786
- type,
787
- connectorType: "blobStorageConnector"
788
- });
789
- }
790
- const finalInstanceType = overrideInstanceType ?? instanceType;
791
- context.componentInstances.push({
792
- instanceType: finalInstanceType,
793
- component: connector
794
- });
795
- blobStorageModels.BlobStorageConnectorFactory.register(finalInstanceType, () => connector);
796
- return finalInstanceType;
797
- }
798
- /**
799
- * Initialise the blob storage component.
800
- * @param engineCore The engine core.
801
- * @param context The context for the engine.
802
- * @param instanceConfig The instance config.
803
- * @param overrideInstanceType The instance type to override the default.
804
- * @returns The name of the instance created.
805
- * @throws GeneralError if the component type is unknown.
806
- */
807
- function initialiseBlobStorageComponent(engineCore, context, instanceConfig, overrideInstanceType) {
808
- engineCore.logInfo(core.I18n.formatMessage("engineCore.configuring", {
809
- element: `Blob Storage Component: ${instanceConfig.type}`
810
- }));
811
- const type = instanceConfig.type;
812
- let component;
813
- let instanceType;
814
- if (type === BlobStorageComponentType.Service) {
815
- blobStorageService.initSchema();
816
- initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.entryEntityStorageType, "BlobStorageEntry");
817
- component = new blobStorageService.BlobStorageService({
818
- vaultConnectorType: engineCore.getRegisteredInstanceType("vaultConnector"),
819
- ...instanceConfig.options
820
- });
821
- instanceType = core.StringHelper.kebabCase("BlobStorageService");
822
- }
823
- else if (type === BlobStorageComponentType.RestClient) {
824
- component = new blobStorageRestClient.BlobStorageClient(instanceConfig.options);
825
- instanceType = core.StringHelper.kebabCase("BlobStorageClient");
826
- }
827
- else {
828
- throw new core.GeneralError("engineCore", "componentUnknownType", {
829
- type,
830
- componentType: "blobStorageComponent"
831
- });
832
- }
833
- const finalInstanceType = overrideInstanceType ?? instanceType;
834
- context.componentInstances.push({
835
- instanceType: finalInstanceType,
836
- component
837
- });
838
- core.ComponentFactory.register(finalInstanceType, () => component);
839
- return finalInstanceType;
840
- }
841
-
842
- // Copyright 2024 IOTA Stiftung.
843
- // SPDX-License-Identifier: Apache-2.0.
844
- /**
845
- * Data converter connector types.
846
- */
847
- // eslint-disable-next-line @typescript-eslint/naming-convention
848
- const DataConverterConnectorType = {
849
- /**
850
- * JSON.
851
- */
852
- Json: "json",
853
- /**
854
- * Xml.
855
- */
856
- Xml: "xml"
857
- };
858
-
859
- // Copyright 2024 IOTA Stiftung.
860
- // SPDX-License-Identifier: Apache-2.0.
861
- /**
862
- * Data extractor connector types.
863
- */
864
- // eslint-disable-next-line @typescript-eslint/naming-convention
865
- const DataExtractorConnectorType = {
866
- /**
867
- * JSON Path.
868
- */
869
- JsonPath: "json-path"
870
- };
871
-
872
- // Copyright 2024 IOTA Stiftung.
873
- // SPDX-License-Identifier: Apache-2.0.
874
- /**
875
- * Data processing component types.
876
- */
877
- // eslint-disable-next-line @typescript-eslint/naming-convention
878
- const DataProcessingComponentType = {
879
- /**
880
- * Service.
881
- */
882
- Service: "service",
883
- /**
884
- * REST client.
885
- */
886
- RestClient: "rest-client"
887
- };
888
-
889
- // Copyright 2024 IOTA Stiftung.
890
- // SPDX-License-Identifier: Apache-2.0.
891
- /**
892
- * Initialise the data converter connector.
893
- * @param engineCore The engine core.
894
- * @param context The context for the engine.
895
- * @param instanceConfig The instance config.
896
- * @param overrideInstanceType The instance type to override the default.
897
- * @returns The name of the instance created.
898
- * @throws GeneralError if the connector type is unknown.
899
- */
900
- function initialiseDataConverterConnector(engineCore, context, instanceConfig, overrideInstanceType) {
901
- engineCore.logInfo(core.I18n.formatMessage("engineCore.configuring", {
902
- element: `Data Converter Connector: ${instanceConfig.type}`
903
- }));
904
- const type = instanceConfig.type;
905
- let connector;
906
- let instanceType;
907
- if (type === DataConverterConnectorType.Json) {
908
- connector = new dataProcessingConverters.JsonConverterConnector();
909
- instanceType = dataProcessingConverters.JsonConverterConnector.NAMESPACE;
910
- }
911
- else if (type === DataConverterConnectorType.Xml) {
912
- connector = new dataProcessingConverters.XmlConverterConnector();
913
- instanceType = dataProcessingConverters.XmlConverterConnector.NAMESPACE;
914
- }
915
- else {
916
- throw new core.GeneralError("engineCore", "connectorUnknownType", {
917
- type,
918
- connectorType: "dataConverterConnector"
919
- });
920
- }
921
- const finalInstanceType = overrideInstanceType ?? instanceType;
922
- context.componentInstances.push({
923
- instanceType: finalInstanceType,
924
- component: connector
925
- });
926
- dataProcessingModels.DataConverterConnectorFactory.register(finalInstanceType, () => connector);
927
- return finalInstanceType;
928
- }
929
- /**
930
- * Initialise the data extractor connector.
931
- * @param engineCore The engine core.
932
- * @param context The context for the engine.
933
- * @param instanceConfig The instance config.
934
- * @param overrideInstanceType The instance type to override the default.
935
- * @returns The name of the instance created.
936
- * @throws GeneralError if the connector type is unknown.
937
- */
938
- function initialiseDataExtractorConnector(engineCore, context, instanceConfig, overrideInstanceType) {
939
- engineCore.logInfo(core.I18n.formatMessage("engineCore.configuring", {
940
- element: `Data Extractor Connector: ${instanceConfig.type}`
941
- }));
942
- const type = instanceConfig.type;
943
- let connector;
944
- let instanceType;
945
- if (type === DataExtractorConnectorType.JsonPath) {
946
- connector = new dataProcessingExtractors.JsonPathExtractorConnector();
947
- instanceType = dataProcessingExtractors.JsonPathExtractorConnector.NAMESPACE;
948
- }
949
- else {
950
- throw new core.GeneralError("engineCore", "connectorUnknownType", {
951
- type,
952
- connectorType: "dataExtractorConnector"
953
- });
954
- }
955
- const finalInstanceType = overrideInstanceType ?? instanceType;
956
- context.componentInstances.push({
957
- instanceType: finalInstanceType,
958
- component: connector
959
- });
960
- dataProcessingModels.DataExtractorConnectorFactory.register(finalInstanceType, () => connector);
961
- return finalInstanceType;
962
- }
963
- /**
964
- * Initialise the data processing component.
965
- * @param engineCore The engine core.
966
- * @param context The context for the engine.
967
- * @param instanceConfig The instance config.
968
- * @param overrideInstanceType The instance type to override the default.
969
- * @returns The name of the instance created.
970
- * @throws GeneralError if the component type is unknown.
971
- */
972
- function initialiseDataProcessingComponent(engineCore, context, instanceConfig, overrideInstanceType) {
973
- engineCore.logInfo(core.I18n.formatMessage("engineCore.configuring", {
974
- element: `Data Processing Component: ${instanceConfig.type}`
975
- }));
976
- const type = instanceConfig.type;
977
- let component;
978
- let instanceType;
979
- if (type === DataProcessingComponentType.Service) {
980
- dataProcessingService.initSchema();
981
- initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.extractionRuleGroupStorageConnectorType, "ExtractionRuleGroup");
982
- component = new dataProcessingService.DataProcessingService({
983
- ...instanceConfig.options
984
- });
985
- instanceType = core.StringHelper.kebabCase("DataProcessingService");
986
- }
987
- else if (type === DataProcessingComponentType.RestClient) {
988
- component = new dataProcessingRestClient.DataProcessingClient(instanceConfig.options);
989
- instanceType = core.StringHelper.kebabCase("DataProcessingClient");
990
- }
991
- else {
992
- throw new core.GeneralError("engineCore", "componentUnknownType", {
993
- type,
994
- componentType: "dataProcessingComponent"
995
- });
996
- }
997
- const finalInstanceType = overrideInstanceType ?? instanceType;
998
- context.componentInstances.push({
999
- instanceType: finalInstanceType,
1000
- component
1001
- });
1002
- core.ComponentFactory.register(finalInstanceType, () => component);
1003
- return finalInstanceType;
1004
- }
1005
-
1006
- // Copyright 2024 IOTA Stiftung.
1007
- // SPDX-License-Identifier: Apache-2.0.
1008
- /**
1009
- * Document management component types.
1010
- */
1011
- // eslint-disable-next-line @typescript-eslint/naming-convention
1012
- const DocumentManagementComponentType = {
1013
- /**
1014
- * Service.
1015
- */
1016
- Service: "service",
1017
- /**
1018
- * REST client.
1019
- */
1020
- RestClient: "rest-client"
1021
- };
1022
-
1023
- // Copyright 2024 IOTA Stiftung.
1024
- // SPDX-License-Identifier: Apache-2.0.
1025
- /**
1026
- * Initialise the document management component.
1027
- * @param engineCore The engine core.
1028
- * @param context The context for the engine.
1029
- * @param instanceConfig The instance config.
1030
- * @param overrideInstanceType The instance type to override the default.
1031
- * @returns The name of the instance created.
1032
- * @throws GeneralError if the component type is unknown.
1033
- */
1034
- function initialiseDocumentManagementComponent(engineCore, context, instanceConfig, overrideInstanceType) {
1035
- engineCore.logInfo(core.I18n.formatMessage("engineCore.configuring", {
1036
- element: `Document Management Component: ${instanceConfig.type}`
1037
- }));
1038
- const type = instanceConfig.type;
1039
- let component;
1040
- let instanceType;
1041
- if (type === DocumentManagementComponentType.Service) {
1042
- component = new documentManagementService.DocumentManagementService({
1043
- auditableItemGraphComponentType: engineCore.getRegisteredInstanceType("auditableItemGraphComponent"),
1044
- blobStorageComponentType: engineCore.getRegisteredInstanceType("blobStorageComponent"),
1045
- attestationComponentType: engineCore.getRegisteredInstanceType("attestationComponent"),
1046
- dataProcessingComponentType: engineCore.getRegisteredInstanceType("dataProcessingComponent"),
1047
- ...instanceConfig.options
1048
- });
1049
- instanceType = core.StringHelper.kebabCase("DocumentManagementService");
1050
- }
1051
- else if (type === DocumentManagementComponentType.RestClient) {
1052
- component = new documentManagementRestClient.DocumentManagementClient(instanceConfig.options);
1053
- instanceType = core.StringHelper.kebabCase("DocumentManagementClient");
1054
- }
1055
- else {
1056
- throw new core.GeneralError("engineCore", "componentUnknownType", {
1057
- type,
1058
- componentType: "documentManagementComponent"
1059
- });
1060
- }
1061
- const finalInstanceType = overrideInstanceType ?? instanceType;
1062
- context.componentInstances.push({
1063
- instanceType: finalInstanceType,
1064
- component
1065
- });
1066
- core.ComponentFactory.register(finalInstanceType, () => component);
1067
- return finalInstanceType;
1068
- }
1069
-
1070
- // Copyright 2024 IOTA Stiftung.
1071
- // SPDX-License-Identifier: Apache-2.0.
1072
- /**
1073
- * Event bus component types.
1074
- */
1075
- // eslint-disable-next-line @typescript-eslint/naming-convention
1076
- const EventBusComponentType = {
1077
- /**
1078
- * Service.
1079
- */
1080
- Service: "service",
1081
- /**
1082
- * Socket client.
1083
- */
1084
- SocketClient: "socket-client"
1085
- };
1086
-
1087
- // Copyright 2024 IOTA Stiftung.
1088
- // SPDX-License-Identifier: Apache-2.0.
1089
- /**
1090
- * Event bus connector types.
1091
- */
1092
- // eslint-disable-next-line @typescript-eslint/naming-convention
1093
- const EventBusConnectorType = {
1094
- /**
1095
- * Local.
1096
- */
1097
- Local: "local"
1098
- };
1099
-
1100
- // Copyright 2024 IOTA Stiftung.
1101
- // SPDX-License-Identifier: Apache-2.0.
1102
- /**
1103
- * Initialise a event bus connector.
1104
- * @param engineCore The engine core.
1105
- * @param context The context for the engine.
1106
- * @param instanceConfig The instance config.
1107
- * @param overrideInstanceType The instance type to override the default.
1108
- * @returns The name of the instance created.
1109
- * @throws GeneralError if the connector type is unknown.
1110
- */
1111
- function initialiseEventBusConnector(engineCore, context, instanceConfig, overrideInstanceType) {
1112
- engineCore.logInfo(core.I18n.formatMessage("engineCore.configuring", {
1113
- element: `Event Bus Connector: ${instanceConfig.type}`
1114
- }));
1115
- const type = instanceConfig.type;
1116
- let connector;
1117
- let instanceType;
1118
- if (type === EventBusConnectorType.Local) {
1119
- connector = new eventBusConnectorLocal.LocalEventBusConnector({
1120
- loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
1121
- ...instanceConfig.options
1122
- });
1123
- instanceType = eventBusConnectorLocal.LocalEventBusConnector.NAMESPACE;
1124
- }
1125
- else {
1126
- throw new core.GeneralError("engineCore", "connectorUnknownType", {
1127
- type,
1128
- connectorType: "eventBusConnector"
1129
- });
1130
- }
1131
- const finalInstanceType = overrideInstanceType ?? instanceType;
1132
- context.componentInstances.push({ instanceType: finalInstanceType, component: connector });
1133
- eventBusModels.EventBusConnectorFactory.register(finalInstanceType, () => connector);
1134
- return finalInstanceType;
1135
- }
1136
- /**
1137
- * Initialise the event bus component.
1138
- * @param engineCore The engine core.
1139
- * @param context The context for the engine.
1140
- * @param instanceConfig The instance config.
1141
- * @param overrideInstanceType The instance type to override the default.
1142
- * @returns The name of the instance created.
1143
- * @throws GeneralError if the component type is unknown.
1144
- */
1145
- function initialiseEventBusComponent(engineCore, context, instanceConfig, overrideInstanceType) {
1146
- engineCore.logInfo(core.I18n.formatMessage("engineCore.configuring", {
1147
- element: `Event Bus Component: ${instanceConfig.type}`
1148
- }));
1149
- const type = instanceConfig.type;
1150
- let component;
1151
- let instanceType;
1152
- if (type === EventBusComponentType.Service) {
1153
- component = new eventBusService.EventBusService({
1154
- eventBusConnectorType: engineCore.getRegisteredInstanceType("eventBusConnector"),
1155
- ...instanceConfig.options
1156
- });
1157
- instanceType = core.StringHelper.kebabCase("EventBusService");
1158
- }
1159
- else if (type === EventBusComponentType.SocketClient) {
1160
- component = new eventBusSocketClient.EventBusSocketClient({
1161
- loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
1162
- ...instanceConfig.options
1163
- });
1164
- instanceType = core.StringHelper.kebabCase("EventBusSocketClient");
1165
- }
1166
- else {
1167
- throw new core.GeneralError("engineCore", "componentUnknownType", {
1168
- type,
1169
- componentType: "EventBusComponent"
1170
- });
1171
- }
1172
- const finalInstanceType = overrideInstanceType ?? instanceType;
1173
- context.componentInstances.push({ instanceType: finalInstanceType, component });
1174
- core.ComponentFactory.register(finalInstanceType, () => component);
1175
- return finalInstanceType;
1176
- }
1177
-
1178
- // Copyright 2024 IOTA Stiftung.
1179
- // SPDX-License-Identifier: Apache-2.0.
1180
- /**
1181
- * Faucet connector types.
1182
- */
1183
- // eslint-disable-next-line @typescript-eslint/naming-convention
1184
- const FaucetConnectorType = {
1185
- /**
1186
- * Entity storage.
1187
- */
1188
- EntityStorage: "entity-storage",
1189
- /**
1190
- * IOTA.
1191
- */
1192
- Iota: "iota"
1193
- };
1194
-
1195
- // Copyright 2024 IOTA Stiftung.
1196
- // SPDX-License-Identifier: Apache-2.0.
1197
- /**
1198
- * Initialise a faucet connector.
1199
- * @param engineCore The engine core.
1200
- * @param context The context for the engine.
1201
- * @param instanceConfig The instance config.
1202
- * @param overrideInstanceType The instance type to override the default.
1203
- * @returns The name of the instance created.
1204
- * @throws GeneralError if the connector type is unknown.
1205
- */
1206
- function initialiseFaucetConnector(engineCore, context, instanceConfig, overrideInstanceType) {
1207
- engineCore.logInfo(core.I18n.formatMessage("engineCore.configuring", {
1208
- element: `Faucet Connector: ${instanceConfig.type}`
1209
- }));
1210
- const type = instanceConfig.type;
1211
- let connector;
1212
- let instanceType;
1213
- if (type === FaucetConnectorType.Iota) {
1214
- const defaultConfigType = engineCore.getRegisteredInstanceType("dltConfig");
1215
- const dltConfig = context.config.types.dltConfig?.find(dlt => dlt.type === defaultConfigType);
1216
- connector = new walletConnectorIota.IotaFaucetConnector({
1217
- ...instanceConfig.options,
1218
- config: {
1219
- ...dltConfig?.options?.config,
1220
- ...instanceConfig.options.config
1221
- }
1222
- });
1223
- instanceType = walletConnectorIota.IotaFaucetConnector.NAMESPACE;
1224
- }
1225
- else if (type === FaucetConnectorType.EntityStorage) {
1226
- connector = new walletConnectorEntityStorage.EntityStorageFaucetConnector(instanceConfig.options);
1227
- instanceType = walletConnectorEntityStorage.EntityStorageFaucetConnector.NAMESPACE;
1228
- }
1229
- else {
1230
- throw new core.GeneralError("engineCore", "connectorUnknownType", {
1231
- type,
1232
- connectorType: "faucetConnector"
1233
- });
1234
- }
1235
- const finalInstanceType = overrideInstanceType ?? instanceType;
1236
- context.componentInstances.push({
1237
- instanceType: finalInstanceType,
1238
- component: connector
1239
- });
1240
- walletModels.FaucetConnectorFactory.register(finalInstanceType, () => connector);
1241
- return finalInstanceType;
1242
- }
1243
-
1244
- // Copyright 2024 IOTA Stiftung.
1245
- // SPDX-License-Identifier: Apache-2.0.
1246
- /**
1247
- * Federated catalogue component types.
1248
- */
1249
- // eslint-disable-next-line @typescript-eslint/naming-convention
1250
- const FederatedCatalogueComponentType = {
1251
- /**
1252
- * Service.
1253
- */
1254
- Service: "service",
1255
- /**
1256
- * REST client.
1257
- */
1258
- RestClient: "rest-client"
1259
- };
1260
-
1261
- // Copyright 2024 IOTA Stiftung.
1262
- // SPDX-License-Identifier: Apache-2.0.
1263
- /**
1264
- * Initialise the federated catalogue component.
1265
- * @param engineCore The engine core.
1266
- * @param context The context for the engine.
1267
- * @param instanceConfig The instance config.
1268
- * @param overrideInstanceType The instance type to override the default.
1269
- * @returns The name of the instance created.
1270
- * @throws GeneralError if the component type is unknown.
1271
- */
1272
- function initialiseFederatedCatalogueComponent(engineCore, context, instanceConfig, overrideInstanceType) {
1273
- engineCore.logInfo(core.I18n.formatMessage("engineCore.configuring", {
1274
- element: `Federated Catalogue Component: ${instanceConfig.type}`
1275
- }));
1276
- const type = instanceConfig.type;
1277
- let component;
1278
- let instanceType;
1279
- if (type === FederatedCatalogueComponentType.Service) {
1280
- federatedCatalogueService.initSchema();
1281
- initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.dataResourceEntityStorageType, "DataResourceEntry");
1282
- initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.participantEntityStorageType, "ParticipantEntry");
1283
- initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.serviceOfferingEntityStorageType, "ServiceOfferingEntry");
1284
- initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.dataSpaceConnectorStorageType, "DataSpaceConnectorEntry");
1285
- component = new federatedCatalogueService.FederatedCatalogueService({
1286
- loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
1287
- identityResolverComponentType: engineCore.getRegisteredInstanceType("identityResolverComponent"),
1288
- ...instanceConfig.options
1289
- });
1290
- instanceType = core.StringHelper.kebabCase("FederatedCatalogueService");
1291
- }
1292
- else if (type === FederatedCatalogueComponentType.RestClient) {
1293
- component = new federatedCatalogueRestClient.FederatedCatalogueClient(instanceConfig.options);
1294
- instanceType = core.StringHelper.kebabCase("FederatedCatalogueClient");
1295
- }
1296
- else {
1297
- throw new core.GeneralError("engineCore", "componentUnknownType", {
1298
- type,
1299
- componentType: "FederatedCatalogueComponent"
1300
- });
1301
- }
1302
- const finalInstanceType = overrideInstanceType ?? instanceType;
1303
- context.componentInstances.push({
1304
- instanceType: finalInstanceType,
1305
- component
1306
- });
1307
- core.ComponentFactory.register(finalInstanceType, () => component);
1308
- return finalInstanceType;
1309
- }
1310
-
1311
- // Copyright 2024 IOTA Stiftung.
1312
- // SPDX-License-Identifier: Apache-2.0.
1313
- /**
1314
- * Identity component types.
1315
- */
1316
- // eslint-disable-next-line @typescript-eslint/naming-convention
1317
- const IdentityComponentType = {
1318
- /**
1319
- * Service.
1320
- */
1321
- Service: "service",
1322
- /**
1323
- * REST client.
1324
- */
1325
- RestClient: "rest-client"
1326
- };
1327
-
1328
- // Copyright 2024 IOTA Stiftung.
1329
- // SPDX-License-Identifier: Apache-2.0.
1330
- /**
1331
- * Identity connector types.
1332
- */
1333
- // eslint-disable-next-line @typescript-eslint/naming-convention
1334
- const IdentityConnectorType = {
1335
- /**
1336
- * Entity storage.
1337
- */
1338
- EntityStorage: "entity-storage",
1339
- /**
1340
- * IOTA.
1341
- */
1342
- Iota: "iota"
1343
- };
1344
-
1345
- // Copyright 2024 IOTA Stiftung.
1346
- // SPDX-License-Identifier: Apache-2.0.
1347
- /**
1348
- * Initialise the identity connector.
1349
- * @param engineCore The engine core.
1350
- * @param context The context for the engine.
1351
- * @param instanceConfig The instance config.
1352
- * @param overrideInstanceType The instance type to override the default.
1353
- * @returns The name of the instance created.
1354
- * @throws GeneralError if the connector type is unknown.
1355
- */
1356
- function initialiseIdentityConnector(engineCore, context, instanceConfig, overrideInstanceType) {
1357
- engineCore.logInfo(core.I18n.formatMessage("engineCore.configuring", {
1358
- element: `Identity Connector: ${instanceConfig.type}`
1359
- }));
1360
- const type = instanceConfig.type;
1361
- let connector;
1362
- let instanceType;
1363
- if (type === IdentityConnectorType.Iota) {
1364
- const defaultConfigType = engineCore.getRegisteredInstanceType("dltConfig");
1365
- const dltConfig = context.config.types.dltConfig?.find(dlt => dlt.type === defaultConfigType);
1366
- connector = new identityConnectorIota.IotaIdentityConnector({
1367
- vaultConnectorType: engineCore.getRegisteredInstanceType("vaultConnector"),
1368
- ...instanceConfig.options,
1369
- config: {
1370
- ...dltConfig?.options?.config,
1371
- ...instanceConfig.options.config
1372
- }
1373
- });
1374
- instanceType = identityConnectorIota.IotaIdentityConnector.NAMESPACE;
1375
- }
1376
- else if (type === IdentityConnectorType.EntityStorage) {
1377
- identityConnectorEntityStorage.initSchema({ includeProfile: false });
1378
- initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.didDocumentEntityStorageType, "IdentityDocument");
1379
- connector = new identityConnectorEntityStorage.EntityStorageIdentityConnector({
1380
- vaultConnectorType: engineCore.getRegisteredInstanceType("vaultConnector"),
1381
- ...instanceConfig.options
1382
- });
1383
- instanceType = identityConnectorEntityStorage.EntityStorageIdentityConnector.NAMESPACE;
1384
- }
1385
- else {
1386
- throw new core.GeneralError("engineCore", "connectorUnknownType", {
1387
- type,
1388
- connectorType: "identityConnector"
1389
- });
1390
- }
1391
- const finalInstanceType = overrideInstanceType ?? instanceType;
1392
- context.componentInstances.push({ instanceType: finalInstanceType, component: connector });
1393
- identityModels.IdentityConnectorFactory.register(finalInstanceType, () => connector);
1394
- return finalInstanceType;
1395
- }
1396
- /**
1397
- * Initialise the identity component.
1398
- * @param engineCore The engine core.
1399
- * @param context The context for the engine.
1400
- * @param instanceConfig The instance config.
1401
- * @param overrideInstanceType The instance type to override the default.
1402
- * @returns The name of the instance created.
1403
- * @throws GeneralError if the component type is unknown.
1404
- */
1405
- function initialiseIdentityComponent(engineCore, context, instanceConfig, overrideInstanceType) {
1406
- engineCore.logInfo(core.I18n.formatMessage("engineCore.configuring", {
1407
- element: `Identity Component: ${instanceConfig.type}`
1408
- }));
1409
- const type = instanceConfig.type;
1410
- let component;
1411
- let instanceType;
1412
- if (type === IdentityComponentType.Service) {
1413
- component = new identityService.IdentityService(instanceConfig.options);
1414
- instanceType = core.StringHelper.kebabCase("IdentityService");
1415
- }
1416
- else if (type === IdentityComponentType.RestClient) {
1417
- component = new identityRestClient.IdentityClient(instanceConfig.options);
1418
- instanceType = core.StringHelper.kebabCase("IdentityClient");
1419
- }
1420
- else {
1421
- throw new core.GeneralError("engineCore", "componentUnknownType", {
1422
- type,
1423
- componentType: "identityComponent"
1424
- });
1425
- }
1426
- const finalInstanceType = overrideInstanceType ?? instanceType;
1427
- context.componentInstances.push({ instanceType: finalInstanceType, component });
1428
- core.ComponentFactory.register(finalInstanceType, () => component);
1429
- return finalInstanceType;
1430
- }
1431
-
1432
- // Copyright 2024 IOTA Stiftung.
1433
- // SPDX-License-Identifier: Apache-2.0.
1434
- /**
1435
- * Identity profile component types.
1436
- */
1437
- // eslint-disable-next-line @typescript-eslint/naming-convention
1438
- const IdentityProfileComponentType = {
1439
- /**
1440
- * Service.
1441
- */
1442
- Service: "service",
1443
- /**
1444
- * REST client.
1445
- */
1446
- RestClient: "rest-client"
1447
- };
1448
-
1449
- // Copyright 2024 IOTA Stiftung.
1450
- // SPDX-License-Identifier: Apache-2.0.
1451
- /**
1452
- * Identity profile connector types.
1453
- */
1454
- // eslint-disable-next-line @typescript-eslint/naming-convention
1455
- const IdentityProfileConnectorType = {
1456
- /**
1457
- * Entity storage.
1458
- */
1459
- EntityStorage: "entity-storage"
1460
- };
1461
-
1462
- // Copyright 2024 IOTA Stiftung.
1463
- // SPDX-License-Identifier: Apache-2.0.
1464
- /**
1465
- * Initialise the identity profile connector.
1466
- * @param engineCore The engine core.
1467
- * @param context The context for the engine.
1468
- * @param instanceConfig The instance config.
1469
- * @param overrideInstanceType The instance type to override the default.
1470
- * @returns The name of the instance created.
1471
- * @throws GeneralError if the connector type is unknown.
1472
- */
1473
- function initialiseIdentityProfileConnector(engineCore, context, instanceConfig, overrideInstanceType) {
1474
- engineCore.logInfo(core.I18n.formatMessage("engineCore.configuring", {
1475
- element: `Identity Profile Connector: ${instanceConfig.type}`
1476
- }));
1477
- const type = instanceConfig.type;
1478
- let connector;
1479
- let instanceType;
1480
- if (type === IdentityProfileConnectorType.EntityStorage) {
1481
- identityConnectorEntityStorage.initSchema({ includeDocument: false });
1482
- initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.profileEntityStorageType, "IdentityProfile");
1483
- connector = new identityConnectorEntityStorage.EntityStorageIdentityProfileConnector(instanceConfig.options);
1484
- instanceType = identityConnectorEntityStorage.EntityStorageIdentityProfileConnector.NAMESPACE;
1485
- }
1486
- else {
1487
- throw new core.GeneralError("engineCore", "connectorUnknownType", {
1488
- type,
1489
- serviceType: "identityProfile"
1490
- });
1491
- }
1492
- const finalInstanceType = overrideInstanceType ?? instanceType;
1493
- context.componentInstances.push({
1494
- instanceType: finalInstanceType,
1495
- component: connector
1496
- });
1497
- identityModels.IdentityProfileConnectorFactory.register(finalInstanceType, () => connector);
1498
- return finalInstanceType;
1499
- }
1500
- /**
1501
- * Initialise the identity profile component.
1502
- * @param engineCore The engine core.
1503
- * @param context The context for the engine.
1504
- * @param instanceConfig The instance config.
1505
- * @param overrideInstanceType The instance type to override the default.
1506
- * @returns The name of the instance created.
1507
- * @throws GeneralError if the component type is unknown.
1508
- */
1509
- function initialiseIdentityProfileComponent(engineCore, context, instanceConfig, overrideInstanceType) {
1510
- engineCore.logInfo(core.I18n.formatMessage("engineCore.configuring", {
1511
- element: `Identity Profile Component: ${instanceConfig.type}`
1512
- }));
1513
- const type = instanceConfig.type;
1514
- let component;
1515
- let instanceType;
1516
- if (type === IdentityProfileComponentType.Service) {
1517
- component = new identityService.IdentityProfileService({
1518
- profileEntityConnectorType: engineCore.getRegisteredInstanceType("identityProfileConnector"),
1519
- ...instanceConfig.options
1520
- });
1521
- instanceType = core.StringHelper.kebabCase("IdentityProfileService");
1522
- }
1523
- else if (type === IdentityProfileComponentType.RestClient) {
1524
- component = new identityRestClient.IdentityProfileClient(instanceConfig.options);
1525
- instanceType = core.StringHelper.kebabCase("IdentityProfileClient");
1526
- }
1527
- else {
1528
- throw new core.GeneralError("engineCore", "componentUnknownType", {
1529
- type,
1530
- componentType: "identityProfileComponent"
1531
- });
1532
- }
1533
- const finalInstanceType = overrideInstanceType ?? instanceType;
1534
- context.componentInstances.push({
1535
- instanceType: finalInstanceType,
1536
- component
1537
- });
1538
- core.ComponentFactory.register(finalInstanceType, () => component);
1539
- return finalInstanceType;
1540
- }
1541
-
1542
- // Copyright 2024 IOTA Stiftung.
1543
- // SPDX-License-Identifier: Apache-2.0.
1544
- /**
1545
- * Identity resolver component types.
1546
- */
1547
- // eslint-disable-next-line @typescript-eslint/naming-convention
1548
- const IdentityResolverComponentType = {
1549
- /**
1550
- * Service.
1551
- */
1552
- Service: "service",
1553
- /**
1554
- * REST client.
1555
- */
1556
- RestClient: "rest-client"
1557
- };
1558
-
1559
- // Copyright 2024 IOTA Stiftung.
1560
- // SPDX-License-Identifier: Apache-2.0.
1561
- /**
1562
- * Identity resolver connector types.
1563
- */
1564
- // eslint-disable-next-line @typescript-eslint/naming-convention
1565
- const IdentityResolverConnectorType = {
1566
- /**
1567
- * Entity storage.
1568
- */
1569
- EntityStorage: "entity-storage",
1570
- /**
1571
- * IOTA.
1572
- */
1573
- Iota: "iota",
1574
- /**
1575
- * Universal.
1576
- */
1577
- Universal: "universal"
1578
- };
1579
-
1580
- // Copyright 2024 IOTA Stiftung.
1581
- // SPDX-License-Identifier: Apache-2.0.
1582
- /**
1583
- * Initialise the identity resolver connector.
1584
- * @param engineCore The engine core.
1585
- * @param context The context for the engine.
1586
- * @param instanceConfig The instance config.
1587
- * @param overrideInstanceType The instance type to override the default.
1588
- * @returns The name of the instance created.
1589
- * @throws GeneralError if the connector type is unknown.
1590
- */
1591
- function initialiseIdentityResolverConnector(engineCore, context, instanceConfig, overrideInstanceType) {
1592
- engineCore.logInfo(core.I18n.formatMessage("engineCore.configuring", {
1593
- element: `Identity Resolver Connector: ${instanceConfig.type}`
1594
- }));
1595
- const type = instanceConfig.type;
1596
- let connector;
1597
- let instanceType;
1598
- if (type === IdentityResolverConnectorType.Iota) {
1599
- const defaultConfigType = engineCore.getRegisteredInstanceType("dltConfig");
1600
- const dltConfig = context.config.types.dltConfig?.find(dlt => dlt.type === defaultConfigType);
1601
- connector = new identityConnectorIota.IotaIdentityResolverConnector({
1602
- ...instanceConfig.options,
1603
- config: {
1604
- ...dltConfig?.options?.config,
1605
- ...instanceConfig.options.config
1606
- }
1607
- });
1608
- instanceType = identityConnectorIota.IotaIdentityResolverConnector.NAMESPACE;
1609
- }
1610
- else if (type === IdentityResolverConnectorType.EntityStorage) {
1611
- identityConnectorEntityStorage.initSchema({ includeProfile: false });
1612
- initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.didDocumentEntityStorageType, "IdentityDocument");
1613
- connector = new identityConnectorEntityStorage.EntityStorageIdentityResolverConnector({
1614
- vaultConnectorType: engineCore.getRegisteredInstanceType("vaultConnector"),
1615
- ...instanceConfig.options
1616
- });
1617
- instanceType = identityConnectorEntityStorage.EntityStorageIdentityResolverConnector.NAMESPACE;
1618
- }
1619
- else if (type === IdentityResolverConnectorType.Universal) {
1620
- connector = new identityConnectorUniversal.UniversalResolverConnector({
1621
- ...instanceConfig.options
1622
- });
1623
- instanceType = identityConnectorUniversal.UniversalResolverConnector.NAMESPACE;
1624
- }
1625
- else {
1626
- throw new core.GeneralError("engineCore", "connectorUnknownType", {
1627
- type,
1628
- connectorType: "identityResolverConnector"
1629
- });
1630
- }
1631
- const finalInstanceType = overrideInstanceType ?? instanceType;
1632
- context.componentInstances.push({ instanceType: finalInstanceType, component: connector });
1633
- identityModels.IdentityResolverConnectorFactory.register(finalInstanceType, () => connector);
1634
- return finalInstanceType;
1635
- }
1636
- /**
1637
- * Initialise the identity resolver component.
1638
- * @param engineCore The engine core.
1639
- * @param context The context for the engine.
1640
- * @param instanceConfig The instance config.
1641
- * @param overrideInstanceType The instance type to override the default.
1642
- * @returns The name of the instance created.
1643
- * @throws GeneralError if the component type is unknown.
1644
- */
1645
- function initialiseIdentityResolverComponent(engineCore, context, instanceConfig, overrideInstanceType) {
1646
- engineCore.logInfo(core.I18n.formatMessage("engineCore.configuring", {
1647
- element: `Identity Resolver Component: ${instanceConfig.type}`
1648
- }));
1649
- const type = instanceConfig.type;
1650
- let component;
1651
- let instanceType;
1652
- if (type === IdentityResolverComponentType.Service) {
1653
- const defaultIdentityResolverType = engineCore.getRegisteredInstanceType("identityResolverConnector");
1654
- component = new identityService.IdentityResolverService({
1655
- fallbackResolverConnectorType: defaultIdentityResolverType !== IdentityResolverConnectorType.Universal
1656
- ? IdentityResolverConnectorType.Universal
1657
- : undefined,
1658
- ...instanceConfig.options
1659
- });
1660
- instanceType = core.StringHelper.kebabCase("IdentityResolverService");
1661
- }
1662
- else if (type === IdentityResolverComponentType.RestClient) {
1663
- component = new identityRestClient.IdentityResolverClient(instanceConfig.options);
1664
- instanceType = core.StringHelper.kebabCase("IdentityResolverClient");
1665
- }
1666
- else {
1667
- throw new core.GeneralError("engineCore", "componentUnknownType", {
1668
- type,
1669
- componentType: "identityResolverComponent"
1670
- });
1671
- }
1672
- const finalInstanceType = overrideInstanceType ?? instanceType;
1673
- context.componentInstances.push({ instanceType: finalInstanceType, component });
1674
- core.ComponentFactory.register(finalInstanceType, () => component);
1675
- return finalInstanceType;
1676
- }
1677
-
1678
- // Copyright 2024 IOTA Stiftung.
1679
- // SPDX-License-Identifier: Apache-2.0.
1680
- /**
1681
- * Immutable proof component types.
1682
- */
1683
- // eslint-disable-next-line @typescript-eslint/naming-convention
1684
- const ImmutableProofComponentType = {
1685
- /**
1686
- * Service.
1687
- */
1688
- Service: "service",
1689
- /**
1690
- * REST client.
1691
- */
1692
- RestClient: "rest-client"
1693
- };
1694
-
1695
- // Copyright 2024 IOTA Stiftung.
1696
- // SPDX-License-Identifier: Apache-2.0.
1697
- /**
1698
- * Initialise the immutable proof component.
1699
- * @param engineCore The engine core.
1700
- * @param context The context for the engine.
1701
- * @param instanceConfig The instance config.
1702
- * @param overrideInstanceType The instance type to override the default.
1703
- * @returns The name of the instance created.
1704
- * @throws GeneralError if the component type is unknown.
1705
- */
1706
- function initialiseImmutableProofComponent(engineCore, context, instanceConfig, overrideInstanceType) {
1707
- engineCore.logInfo(core.I18n.formatMessage("engineCore.configuring", {
1708
- element: `Immutable Proof Component: ${instanceConfig.type}`
1709
- }));
1710
- const type = instanceConfig.type;
1711
- let component;
1712
- let instanceType;
1713
- if (type === ImmutableProofComponentType.Service) {
1714
- immutableProofService.initSchema();
1715
- initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.immutableProofEntityStorageType, "ImmutableProof");
1716
- component = new immutableProofService.ImmutableProofService({
1717
- verifiableStorageType: engineCore.getRegisteredInstanceType("verifiableStorageConnector"),
1718
- identityConnectorType: engineCore.getRegisteredInstanceType("identityConnector"),
1719
- backgroundTaskConnectorType: engineCore.getRegisteredInstanceType("backgroundTaskConnector"),
1720
- eventBusComponentType: engineCore.getRegisteredInstanceTypeOptional("eventBusComponent"),
1721
- ...instanceConfig.options
1722
- });
1723
- instanceType = core.StringHelper.kebabCase("ImmutableProofService");
1724
- }
1725
- else if (type === ImmutableProofComponentType.RestClient) {
1726
- component = new immutableProofRestClient.ImmutableProofClient(instanceConfig.options);
1727
- instanceType = core.StringHelper.kebabCase("ImmutableProofClient");
1728
- }
1729
- else {
1730
- throw new core.GeneralError("engineCore", "componentUnknownType", {
1731
- type,
1732
- componentType: "immutableProofComponent"
1733
- });
1734
- }
1735
- const finalInstanceType = overrideInstanceType ?? instanceType;
1736
- context.componentInstances.push({
1737
- instanceType: finalInstanceType,
1738
- component
1739
- });
1740
- core.ComponentFactory.register(finalInstanceType, () => component);
1741
- return finalInstanceType;
1742
- }
1743
-
1744
- // Copyright 2024 IOTA Stiftung.
1745
- // SPDX-License-Identifier: Apache-2.0.
1746
- /**
1747
- * Logging component types.
1748
- */
1749
- // eslint-disable-next-line @typescript-eslint/naming-convention
1750
- const LoggingComponentType = {
1751
- /**
1752
- * Service.
1753
- */
1754
- Service: "service",
1755
- /**
1756
- * REST client.
1757
- */
1758
- RestClient: "rest-client"
1759
- };
1760
-
1761
- // Copyright 2024 IOTA Stiftung.
1762
- // SPDX-License-Identifier: Apache-2.0.
1763
- /**
1764
- * Logging connector types.
1765
- */
1766
- // eslint-disable-next-line @typescript-eslint/naming-convention
1767
- const LoggingConnectorType = {
1768
- /**
1769
- * Entity storage.
1770
- */
1771
- EntityStorage: "entity-storage",
1772
- /**
1773
- * Console.
1774
- */
1775
- Console: "console",
1776
- /**
1777
- * Multi combines other loggers.
1778
- */
1779
- Multi: "multi"
1780
- };
1781
-
1782
- // Copyright 2024 IOTA Stiftung.
1783
- // SPDX-License-Identifier: Apache-2.0.
1784
- /**
1785
- * Initialise the logging connector.
1786
- * @param engineCore The engine core.
1787
- * @param context The engine core context.
1788
- * @param instanceConfig The instance config.
1789
- * @param overrideInstanceType The instance type to override the default.
1790
- * @returns The name of the instance created.
1791
- * @throws GeneralError if the connector type is unknown.
1792
- */
1793
- function initialiseLoggingConnector(engineCore, context, instanceConfig, overrideInstanceType) {
1794
- engineCore.logInfo(core.I18n.formatMessage("engineCore.configuring", {
1795
- element: `Logging Connector: ${instanceConfig.type}`
1796
- }));
1797
- const type = instanceConfig.type;
1798
- let connector;
1799
- let instanceType;
1800
- if (type === LoggingConnectorType.Console) {
1801
- connector = new loggingConnectorConsole.ConsoleLoggingConnector(instanceConfig.options);
1802
- instanceType = loggingConnectorConsole.ConsoleLoggingConnector.NAMESPACE;
1803
- }
1804
- else if (type === LoggingConnectorType.EntityStorage) {
1805
- loggingConnectorEntityStorage.initSchema();
1806
- initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.logEntryStorageConnectorType, "LogEntry");
1807
- connector = new loggingConnectorEntityStorage.EntityStorageLoggingConnector(instanceConfig.options);
1808
- instanceType = loggingConnectorEntityStorage.EntityStorageLoggingConnector.NAMESPACE;
1809
- }
1810
- else if (type === LoggingConnectorType.Multi) {
1811
- connector = new loggingModels.MultiLoggingConnector(instanceConfig.options);
1812
- instanceType = loggingModels.MultiLoggingConnector.NAMESPACE;
1813
- }
1814
- else {
1815
- throw new core.GeneralError("engineCore", "connectorUnknownType", {
1816
- type,
1817
- connectorType: "loggingConnector"
1818
- });
1819
- }
1820
- const finalInstanceType = overrideInstanceType ?? instanceType;
1821
- context.componentInstances.push({ instanceType: finalInstanceType, component: connector });
1822
- loggingModels.LoggingConnectorFactory.register(finalInstanceType, () => connector);
1823
- return finalInstanceType;
1824
- }
1825
- /**
1826
- * Initialise the logging component.
1827
- * @param engineCore The engine core.
1828
- * @param context The context for the engine.
1829
- * @param instanceConfig The instance config.
1830
- * @param overrideInstanceType The instance type to override the default.
1831
- * @returns The name of the instance created.
1832
- * @throws GeneralError if the component type is unknown.
1833
- */
1834
- function initialiseLoggingComponent(engineCore, context, instanceConfig, overrideInstanceType) {
1835
- engineCore.logInfo(core.I18n.formatMessage("engineCore.configuring", {
1836
- element: `Logging Component: ${instanceConfig.type}`
1837
- }));
1838
- const type = instanceConfig.type;
1839
- let component;
1840
- let instanceType;
1841
- if (type === LoggingComponentType.Service) {
1842
- component = new loggingService.LoggingService({
1843
- loggingConnectorType: engineCore.getRegisteredInstanceType("loggingConnector"),
1844
- ...instanceConfig.options
1845
- });
1846
- instanceType = core.StringHelper.kebabCase("LoggingService");
1847
- }
1848
- else if (type === LoggingComponentType.RestClient) {
1849
- component = new loggingRestClient.LoggingClient(instanceConfig.options);
1850
- instanceType = core.StringHelper.kebabCase("LoggingClient");
1851
- }
1852
- else {
1853
- throw new core.GeneralError("engineCore", "componentUnknownType", {
1854
- type,
1855
- componentType: "loggingComponent"
1856
- });
1857
- }
1858
- const finalInstanceType = overrideInstanceType ?? instanceType;
1859
- context.componentInstances.push({ instanceType: finalInstanceType, component });
1860
- core.ComponentFactory.register(finalInstanceType, () => component);
1861
- return finalInstanceType;
1862
- }
1863
-
1864
- // Copyright 2024 IOTA Stiftung.
1865
- // SPDX-License-Identifier: Apache-2.0.
1866
- /**
1867
- * Messaging component types.
1868
- */
1869
- // eslint-disable-next-line @typescript-eslint/naming-convention
1870
- const MessagingComponentType = {
1871
- /**
1872
- * Service.
1873
- */
1874
- Service: "service"
1875
- };
1876
-
1877
- // Copyright 2024 IOTA Stiftung.
1878
- // SPDX-License-Identifier: Apache-2.0.
1879
- /**
1880
- * Messaging email connector types.
1881
- */
1882
- // eslint-disable-next-line @typescript-eslint/naming-convention
1883
- const MessagingEmailConnectorType = {
1884
- /**
1885
- * Entity storage.
1886
- */
1887
- EntityStorage: "entity-storage",
1888
- /**
1889
- * AWS.
1890
- */
1891
- Aws: "aws"
1892
- };
1893
-
1894
- // Copyright 2024 IOTA Stiftung.
1895
- // SPDX-License-Identifier: Apache-2.0.
1896
- /**
1897
- * Messaging push notification connector types.
1898
- */
1899
- // eslint-disable-next-line @typescript-eslint/naming-convention
1900
- const MessagingPushNotificationConnectorType = {
1901
- /**
1902
- * Entity storage.
1903
- */
1904
- EntityStorage: "entity-storage",
1905
- /**
1906
- * AWS.
1907
- */
1908
- Aws: "aws"
1909
- };
1910
-
1911
- // Copyright 2024 IOTA Stiftung.
1912
- // SPDX-License-Identifier: Apache-2.0.
1913
- /**
1914
- * Messaging sms connector types.
1915
- */
1916
- // eslint-disable-next-line @typescript-eslint/naming-convention
1917
- const MessagingSmsConnectorType = {
1918
- /**
1919
- * Entity storage.
1920
- */
1921
- EntityStorage: "entity-storage",
1922
- /**
1923
- * AWS.
1924
- */
1925
- Aws: "aws"
1926
- };
1927
-
1928
- // Copyright 2024 IOTA Stiftung.
1929
- // SPDX-License-Identifier: Apache-2.0.
1930
- /**
1931
- * Initialise a messaging email connector.
1932
- * @param engineCore The engine core.
1933
- * @param context The context for the engine.
1934
- * @param instanceConfig The instance config.
1935
- * @param overrideInstanceType The instance type to override the default.
1936
- * @returns The name of the instance created.
1937
- * @throws GeneralError if the connector type is unknown.
1938
- */
1939
- function initialiseMessagingEmailConnector(engineCore, context, instanceConfig, overrideInstanceType) {
1940
- engineCore.logInfo(core.I18n.formatMessage("engineCore.configuring", {
1941
- element: `Messaging Email Connector: ${instanceConfig.type}`
1942
- }));
1943
- const type = instanceConfig.type;
1944
- let connector;
1945
- let instanceType;
1946
- if (type === MessagingEmailConnectorType.EntityStorage) {
1947
- messagingConnectorEntityStorage.initSchema({ email: true, sms: false, pushNotification: false });
1948
- initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.messagingEmailEntryStorageConnectorType, "EmailEntry");
1949
- connector = new messagingConnectorEntityStorage.EntityStorageMessagingEmailConnector({
1950
- loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
1951
- ...instanceConfig.options
1952
- });
1953
- instanceType = messagingConnectorEntityStorage.EntityStorageMessagingEmailConnector.NAMESPACE;
1954
- }
1955
- else if (type === MessagingEmailConnectorType.Aws) {
1956
- connector = new messagingConnectorAws.AwsMessagingEmailConnector({
1957
- loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
1958
- ...instanceConfig.options
1959
- });
1960
- instanceType = messagingConnectorAws.AwsMessagingEmailConnector.NAMESPACE;
1961
- }
1962
- else {
1963
- throw new core.GeneralError("engineCore", "connectorUnknownType", {
1964
- type,
1965
- connectorType: "messagingEmailConnector"
1966
- });
1967
- }
1968
- const finalInstanceType = overrideInstanceType ?? instanceType;
1969
- context.componentInstances.push({ instanceType: finalInstanceType, component: connector });
1970
- messagingModels.MessagingEmailConnectorFactory.register(finalInstanceType, () => connector);
1971
- return finalInstanceType;
1972
- }
1973
- /**
1974
- * Initialise a messaging sms connector.
1975
- * @param engineCore The engine core.
1976
- * @param context The context for the engine.
1977
- * @param instanceConfig The instance config.
1978
- * @param overrideInstanceType The instance type to override the default.
1979
- * @returns The name of the instance created.
1980
- * @throws GeneralError if the connector type is unknown.
1981
- */
1982
- function initialiseMessagingSmsConnector(engineCore, context, instanceConfig, overrideInstanceType) {
1983
- engineCore.logInfo(core.I18n.formatMessage("engineCore.configuring", {
1984
- element: `Messaging SMS Connector: ${instanceConfig.type}`
1985
- }));
1986
- const type = instanceConfig.type;
1987
- let connector;
1988
- let instanceType;
1989
- if (type === MessagingSmsConnectorType.EntityStorage) {
1990
- messagingConnectorEntityStorage.initSchema({ email: false, sms: true, pushNotification: false });
1991
- initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.messagingSmsEntryStorageConnectorType, "SmsEntry");
1992
- connector = new messagingConnectorEntityStorage.EntityStorageMessagingSmsConnector({
1993
- loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
1994
- ...instanceConfig.options
1995
- });
1996
- instanceType = messagingConnectorEntityStorage.EntityStorageMessagingSmsConnector.NAMESPACE;
1997
- }
1998
- else if (type === MessagingSmsConnectorType.Aws) {
1999
- connector = new messagingConnectorAws.AwsMessagingSmsConnector({
2000
- loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
2001
- ...instanceConfig.options
2002
- });
2003
- instanceType = messagingConnectorAws.AwsMessagingSmsConnector.NAMESPACE;
2004
- }
2005
- else {
2006
- throw new core.GeneralError("engineCore", "connectorUnknownType", {
2007
- type,
2008
- connectorType: "messagingSmsConnector"
2009
- });
2010
- }
2011
- const finalInstanceType = overrideInstanceType ?? instanceType;
2012
- context.componentInstances.push({ instanceType: finalInstanceType, component: connector });
2013
- messagingModels.MessagingSmsConnectorFactory.register(finalInstanceType, () => connector);
2014
- return finalInstanceType;
2015
- }
2016
- /**
2017
- * Initialise a messaging push notification connector.
2018
- * @param engineCore The engine core.
2019
- * @param context The context for the engine.
2020
- * @param instanceConfig The instance config.
2021
- * @param overrideInstanceType The instance type to override the default.
2022
- * @returns The name of the instance created.
2023
- * @throws GeneralError if the connector type is unknown.
2024
- */
2025
- function initialiseMessagingPushNotificationConnector(engineCore, context, instanceConfig, overrideInstanceType) {
2026
- engineCore.logInfo(core.I18n.formatMessage("engineCore.configuring", {
2027
- element: `Messaging Push Notification Connector: ${instanceConfig.type}`
2028
- }));
2029
- const type = instanceConfig.type;
2030
- let connector;
2031
- let instanceType;
2032
- if (type === MessagingPushNotificationConnectorType.EntityStorage) {
2033
- messagingConnectorEntityStorage.initSchema({ email: false, sms: false, pushNotification: true });
2034
- initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.messagingDeviceEntryStorageConnectorType, "PushNotificationDeviceEntry");
2035
- initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.messagingMessageEntryStorageConnectorType, "PushNotificationMessageEntry");
2036
- connector = new messagingConnectorEntityStorage.EntityStorageMessagingPushNotificationConnector({
2037
- loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
2038
- ...instanceConfig.options
2039
- });
2040
- instanceType = messagingConnectorEntityStorage.EntityStorageMessagingPushNotificationConnector.NAMESPACE;
2041
- }
2042
- else if (type === MessagingPushNotificationConnectorType.Aws) {
2043
- connector = new messagingConnectorAws.AwsMessagingPushNotificationConnector({
2044
- loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
2045
- ...instanceConfig.options
2046
- });
2047
- instanceType = messagingConnectorAws.AwsMessagingPushNotificationConnector.NAMESPACE;
2048
- }
2049
- else {
2050
- throw new core.GeneralError("engineCore", "connectorUnknownType", {
2051
- type,
2052
- connectorType: "messagingPushNotificationConnector"
2053
- });
2054
- }
2055
- const finalInstanceType = overrideInstanceType ?? instanceType;
2056
- context.componentInstances.push({ instanceType: finalInstanceType, component: connector });
2057
- messagingModels.MessagingPushNotificationsConnectorFactory.register(finalInstanceType, () => connector);
2058
- return finalInstanceType;
2059
- }
2060
- /**
2061
- * Initialise the messaging component.
2062
- * @param engineCore The engine core.
2063
- * @param context The context for the engine.
2064
- * @param instanceConfig The instance config.
2065
- * @param overrideInstanceType The instance type to override the default.
2066
- * @returns The name of the instance created.
2067
- * @throws GeneralError if the component type is unknown.
2068
- */
2069
- function initialiseMessagingComponent(engineCore, context, instanceConfig, overrideInstanceType) {
2070
- engineCore.logInfo(core.I18n.formatMessage("engineCore.configuring", {
2071
- element: `Messaging Component: ${instanceConfig.type}`
2072
- }));
2073
- const type = instanceConfig.type;
2074
- let component;
2075
- let instanceType;
2076
- if (type === MessagingComponentType.Service) {
2077
- messagingService.initSchema();
2078
- initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.templateEntryStorageConnectorType, "TemplateEntry");
2079
- component = new messagingService.MessagingService({
2080
- messagingEmailConnectorType: engineCore.getRegisteredInstanceTypeOptional("messagingEmailConnector"),
2081
- messagingSmsConnectorType: engineCore.getRegisteredInstanceTypeOptional("messagingSmsConnector"),
2082
- messagingPushNotificationConnectorType: engineCore.getRegisteredInstanceTypeOptional("messagingNotificationConnector"),
2083
- ...instanceConfig.options
2084
- });
2085
- instanceType = core.StringHelper.kebabCase("MessagingService");
2086
- }
2087
- else {
2088
- throw new core.GeneralError("engineCore", "componentUnknownType", {
2089
- type,
2090
- componentType: "messagingComponent"
2091
- });
2092
- }
2093
- const finalInstanceType = overrideInstanceType ?? instanceType;
2094
- context.componentInstances.push({ instanceType: finalInstanceType, component });
2095
- core.ComponentFactory.register(finalInstanceType, () => component);
2096
- return finalInstanceType;
2097
- }
2098
-
2099
- // Copyright 2024 IOTA Stiftung.
2100
- // SPDX-License-Identifier: Apache-2.0.
2101
- /**
2102
- * NFT component types.
2103
- */
2104
- // eslint-disable-next-line @typescript-eslint/naming-convention
2105
- const NftComponentType = {
2106
- /**
2107
- * Service.
2108
- */
2109
- Service: "service",
2110
- /**
2111
- * REST client.
2112
- */
2113
- RestClient: "rest-client"
2114
- };
2115
-
2116
- // Copyright 2024 IOTA Stiftung.
2117
- // SPDX-License-Identifier: Apache-2.0.
2118
- /**
2119
- * NFT connector types.
2120
- */
2121
- // eslint-disable-next-line @typescript-eslint/naming-convention
2122
- const NftConnectorType = {
2123
- /**
2124
- * Entity storage.
2125
- */
2126
- EntityStorage: "entity-storage",
2127
- /**
2128
- * IOTA.
2129
- */
2130
- Iota: "iota"
2131
- };
2132
-
2133
- // Copyright 2024 IOTA Stiftung.
2134
- // SPDX-License-Identifier: Apache-2.0.
2135
- /**
2136
- * Initialise the NFT connector.
2137
- * @param engineCore The engine core.
2138
- * @param context The context for the engine.
2139
- * @param instanceConfig The instance config.
2140
- * @param overrideInstanceType The instance type to override the default.
2141
- * @returns The name of the instance created.
2142
- * @throws GeneralError if the connector type is unknown.
2143
- */
2144
- function initialiseNftConnector(engineCore, context, instanceConfig, overrideInstanceType) {
2145
- engineCore.logInfo(core.I18n.formatMessage("engineCore.configuring", {
2146
- element: `NFT Connector: ${instanceConfig.type}`
2147
- }));
2148
- const type = instanceConfig.type;
2149
- let connector;
2150
- let instanceType;
2151
- if (type === NftConnectorType.EntityStorage) {
2152
- nftConnectorEntityStorage.initSchema();
2153
- initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.nftEntityStorageType, "Nft");
2154
- connector = new nftConnectorEntityStorage.EntityStorageNftConnector(instanceConfig.options);
2155
- instanceType = nftConnectorEntityStorage.EntityStorageNftConnector.NAMESPACE;
2156
- }
2157
- else if (type === NftConnectorType.Iota) {
2158
- connector = new nftConnectorIota.IotaNftConnector({
2159
- vaultConnectorType: engineCore.getRegisteredInstanceType("vaultConnector"),
2160
- walletConnectorType: engineCore.getRegisteredInstanceType("walletConnector"),
2161
- ...instanceConfig.options
2162
- });
2163
- instanceType = nftConnectorIota.IotaNftConnector.NAMESPACE;
2164
- }
2165
- else {
2166
- throw new core.GeneralError("engineCore", "connectorUnknownType", {
2167
- type,
2168
- connectorType: "nftConnector"
2169
- });
2170
- }
2171
- const finalInstanceType = overrideInstanceType ?? instanceType;
2172
- context.componentInstances.push({
2173
- instanceType: finalInstanceType,
2174
- component: connector
2175
- });
2176
- nftModels.NftConnectorFactory.register(finalInstanceType, () => connector);
2177
- return finalInstanceType;
2178
- }
2179
- /**
2180
- * Initialise the NFT component.
2181
- * @param engineCore The engine core.
2182
- * @param context The context for the engine.
2183
- * @param instanceConfig The instance config.
2184
- * @param overrideInstanceType The instance type to override the default.
2185
- * @returns The name of the instance created.
2186
- * @throws GeneralError if the component type is unknown.
2187
- */
2188
- function initialiseNftComponent(engineCore, context, instanceConfig, overrideInstanceType) {
2189
- engineCore.logInfo(core.I18n.formatMessage("engineCore.configuring", {
2190
- element: `Nft Storage Component: ${instanceConfig.type}`
2191
- }));
2192
- const type = instanceConfig.type;
2193
- let component;
2194
- let instanceType;
2195
- if (type === NftComponentType.Service) {
2196
- component = new nftService.NftService(instanceConfig.options);
2197
- instanceType = core.StringHelper.kebabCase("NftService");
2198
- }
2199
- else if (type === NftComponentType.RestClient) {
2200
- component = new nftRestClient.NftClient(instanceConfig.options);
2201
- instanceType = core.StringHelper.kebabCase("NftClient");
2202
- }
2203
- else {
2204
- throw new core.GeneralError("engineCore", "componentUnknownType", {
2205
- type,
2206
- componentType: "nftComponent"
2207
- });
2208
- }
2209
- const finalInstanceType = overrideInstanceType ?? instanceType;
2210
- context.componentInstances.push({
2211
- instanceType: finalInstanceType,
2212
- component
2213
- });
2214
- core.ComponentFactory.register(finalInstanceType, () => component);
2215
- return finalInstanceType;
2216
- }
2217
-
2218
- // Copyright 2024 IOTA Stiftung.
2219
- // SPDX-License-Identifier: Apache-2.0.
2220
- /**
2221
- * Rights management component types.
2222
- */
2223
- // eslint-disable-next-line @typescript-eslint/naming-convention
2224
- const RightsManagementComponentType = {
2225
- /**
2226
- * Service.
2227
- */
2228
- Service: "service",
2229
- /**
2230
- * REST client.
2231
- */
2232
- RestClient: "rest-client"
2233
- };
2234
-
2235
- // Copyright 2024 IOTA Stiftung.
2236
- // SPDX-License-Identifier: Apache-2.0.
2237
- /**
2238
- * Initialise the rights management component.
2239
- * @param engineCore The engine core.
2240
- * @param context The context for the engine.
2241
- * @param instanceConfig The instance config.
2242
- * @param overrideInstanceType The instance type to override the default.
2243
- * @returns The name of the instance created.
2244
- * @throws GeneralError if the component type is unknown.
2245
- */
2246
- function initialiseRightsManagementComponent(engineCore, context, instanceConfig, overrideInstanceType) {
2247
- engineCore.logInfo(core.I18n.formatMessage("engineCore.configuring", {
2248
- element: `Rights Management Component: ${instanceConfig.type}`
2249
- }));
2250
- const type = instanceConfig.type;
2251
- let component;
2252
- let instanceType;
2253
- if (type === RightsManagementComponentType.Service) {
2254
- component = new rightsManagementService.RightsManagementService({
2255
- policyAdministrationPointComponentType: engineCore.getRegisteredInstanceType("rightsManagementPapComponent"),
2256
- policyEnforcementPointComponentType: engineCore.getRegisteredInstanceType("rightsManagementPepComponent"),
2257
- ...instanceConfig.options
2258
- });
2259
- instanceType = core.StringHelper.kebabCase("RightsManagementService");
2260
- }
2261
- else if (type === RightsManagementComponentType.RestClient) {
2262
- component = new rightsManagementRestClient.RightsManagementClient(instanceConfig.options);
2263
- instanceType = core.StringHelper.kebabCase("RightsManagementClient");
2264
- }
2265
- else {
2266
- throw new core.GeneralError("engineCore", "componentUnknownType", {
2267
- type,
2268
- componentType: "RightsManagementComponent"
2269
- });
2270
- }
2271
- const finalInstanceType = overrideInstanceType ?? instanceType;
2272
- context.componentInstances.push({
2273
- instanceType: finalInstanceType,
2274
- component
2275
- });
2276
- core.ComponentFactory.register(finalInstanceType, () => component);
2277
- return finalInstanceType;
2278
- }
2279
-
2280
- // Copyright 2024 IOTA Stiftung.
2281
- // SPDX-License-Identifier: Apache-2.0.
2282
- /**
2283
- * Rights management PAP component types.
2284
- */
2285
- // eslint-disable-next-line @typescript-eslint/naming-convention
2286
- const RightsManagementPapComponentType = {
2287
- /**
2288
- * Service.
2289
- */
2290
- Service: "service"
2291
- };
2292
-
2293
- // Copyright 2024 IOTA Stiftung.
2294
- // SPDX-License-Identifier: Apache-2.0.
2295
- /**
2296
- * Initialise the rights management PAP component.
2297
- * @param engineCore The engine core.
2298
- * @param context The context for the engine.
2299
- * @param instanceConfig The instance config.
2300
- * @param overrideInstanceType The instance type to override the default.
2301
- * @returns The name of the instance created.
2302
- * @throws GeneralError if the component type is unknown.
2303
- */
2304
- function initialiseRightsManagementPapComponent(engineCore, context, instanceConfig, overrideInstanceType) {
2305
- engineCore.logInfo(core.I18n.formatMessage("engineCore.configuring", {
2306
- element: `Rights Management PAP Component: ${instanceConfig.type}`
2307
- }));
2308
- const type = instanceConfig.type;
2309
- let component;
2310
- let instanceType;
2311
- if (type === RightsManagementPapComponentType.Service) {
2312
- rightsManagementPapService.initSchema();
2313
- initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.odrlPolicyEntityStorageType, "OdrlPolicy");
2314
- component = new rightsManagementPapService.PolicyAdministrationPointService({
2315
- loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
2316
- ...instanceConfig.options
2317
- });
2318
- instanceType = core.StringHelper.kebabCase("PolicyAdministrationPointService");
2319
- }
2320
- else {
2321
- throw new core.GeneralError("engineCore", "componentUnknownType", {
2322
- type,
2323
- componentType: "RightsManagementPapComponent"
2324
- });
2325
- }
2326
- const finalInstanceType = overrideInstanceType ?? instanceType;
2327
- context.componentInstances.push({
2328
- instanceType: finalInstanceType,
2329
- component
2330
- });
2331
- core.ComponentFactory.register(finalInstanceType, () => component);
2332
- return finalInstanceType;
2333
- }
2334
-
2335
- // Copyright 2024 IOTA Stiftung.
2336
- // SPDX-License-Identifier: Apache-2.0.
2337
- /**
2338
- * Rights management PDP component types.
2339
- */
2340
- // eslint-disable-next-line @typescript-eslint/naming-convention
2341
- const RightsManagementPdpComponentType = {
2342
- /**
2343
- * Service.
2344
- */
2345
- Service: "service"
2346
- };
2347
-
2348
- // Copyright 2024 IOTA Stiftung.
2349
- // SPDX-License-Identifier: Apache-2.0.
2350
- /**
2351
- * Initialise the rights management PDP component.
2352
- * @param engineCore The engine core.
2353
- * @param context The context for the engine.
2354
- * @param instanceConfig The instance config.
2355
- * @param overrideInstanceType The instance type to override the default.
2356
- * @returns The name of the instance created.
2357
- * @throws GeneralError if the component type is unknown.
2358
- */
2359
- function initialiseRightsManagementPdpComponent(engineCore, context, instanceConfig, overrideInstanceType) {
2360
- engineCore.logInfo(core.I18n.formatMessage("engineCore.configuring", {
2361
- element: `Rights Management PDP Component: ${instanceConfig.type}`
2362
- }));
2363
- const type = instanceConfig.type;
2364
- let component;
2365
- let instanceType;
2366
- if (type === RightsManagementPdpComponentType.Service) {
2367
- component = new rightsManagementPdpService.PolicyDecisionPointService({
2368
- loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
2369
- policyInformationPointComponentType: engineCore.getRegisteredInstanceType("rightsManagementPipComponent"),
2370
- policyManagementPointComponentType: engineCore.getRegisteredInstanceType("rightsManagementPmpComponent"),
2371
- policyExecutionPointComponentType: engineCore.getRegisteredInstanceType("rightsManagementPxpComponent"),
2372
- ...instanceConfig.options
2373
- });
2374
- instanceType = core.StringHelper.kebabCase("PolicyDecisionPointService");
2375
- }
2376
- else {
2377
- throw new core.GeneralError("engineCore", "componentUnknownType", {
2378
- type,
2379
- componentType: "RightsManagementPdpComponent"
2380
- });
2381
- }
2382
- const finalInstanceType = overrideInstanceType ?? instanceType;
2383
- context.componentInstances.push({
2384
- instanceType: finalInstanceType,
2385
- component
2386
- });
2387
- core.ComponentFactory.register(finalInstanceType, () => component);
2388
- return finalInstanceType;
2389
- }
2390
-
2391
- // Copyright 2024 IOTA Stiftung.
2392
- // SPDX-License-Identifier: Apache-2.0.
2393
- /**
2394
- * Rights management PEP component types.
2395
- */
2396
- // eslint-disable-next-line @typescript-eslint/naming-convention
2397
- const RightsManagementPepComponentType = {
2398
- /**
2399
- * Service.
2400
- */
2401
- Service: "service"
2402
- };
2403
-
2404
- // Copyright 2024 IOTA Stiftung.
2405
- // SPDX-License-Identifier: Apache-2.0.
2406
- /**
2407
- * Initialise the rights management PEP component.
2408
- * @param engineCore The engine core.
2409
- * @param context The context for the engine.
2410
- * @param instanceConfig The instance config.
2411
- * @param overrideInstanceType The instance type to override the default.
2412
- * @returns The name of the instance created.
2413
- * @throws GeneralError if the component type is unknown.
2414
- */
2415
- function initialiseRightsManagementPepComponent(engineCore, context, instanceConfig, overrideInstanceType) {
2416
- engineCore.logInfo(core.I18n.formatMessage("engineCore.configuring", {
2417
- element: `Rights Management PEP Component: ${instanceConfig.type}`
2418
- }));
2419
- const type = instanceConfig.type;
2420
- let component;
2421
- let instanceType;
2422
- if (type === RightsManagementPepComponentType.Service) {
2423
- component = new rightsManagementPepService.PolicyEnforcementPointService({
2424
- loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
2425
- policyDecisionPointComponentType: engineCore.getRegisteredInstanceType("rightsManagementPdpComponent"),
2426
- ...instanceConfig.options
2427
- });
2428
- instanceType = core.StringHelper.kebabCase("PolicyEnforcementPointService");
2429
- }
2430
- else {
2431
- throw new core.GeneralError("engineCore", "componentUnknownType", {
2432
- type,
2433
- componentType: "RightsManagementPepComponent"
2434
- });
2435
- }
2436
- const finalInstanceType = overrideInstanceType ?? instanceType;
2437
- context.componentInstances.push({
2438
- instanceType: finalInstanceType,
2439
- component
2440
- });
2441
- core.ComponentFactory.register(finalInstanceType, () => component);
2442
- return finalInstanceType;
2443
- }
2444
-
2445
- // Copyright 2024 IOTA Stiftung.
2446
- // SPDX-License-Identifier: Apache-2.0.
2447
- /**
2448
- * Rights management PIP component types.
2449
- */
2450
- // eslint-disable-next-line @typescript-eslint/naming-convention
2451
- const RightsManagementPipComponentType = {
2452
- /**
2453
- * Service.
2454
- */
2455
- Service: "service"
2456
- };
2457
-
2458
- // Copyright 2024 IOTA Stiftung.
2459
- // SPDX-License-Identifier: Apache-2.0.
2460
- /**
2461
- * Initialise the rights management PIP component.
2462
- * @param engineCore The engine core.
2463
- * @param context The context for the engine.
2464
- * @param instanceConfig The instance config.
2465
- * @param overrideInstanceType The instance type to override the default.
2466
- * @returns The name of the instance created.
2467
- * @throws GeneralError if the component type is unknown.
2468
- */
2469
- function initialiseRightsManagementPipComponent(engineCore, context, instanceConfig, overrideInstanceType) {
2470
- engineCore.logInfo(core.I18n.formatMessage("engineCore.configuring", {
2471
- element: `Rights Management PIP Component: ${instanceConfig.type}`
2472
- }));
2473
- const type = instanceConfig.type;
2474
- let component;
2475
- let instanceType;
2476
- if (type === RightsManagementPipComponentType.Service) {
2477
- component = new rightsManagementPipService.PolicyInformationPointService({
2478
- loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
2479
- ...instanceConfig.options
2480
- });
2481
- instanceType = core.StringHelper.kebabCase("PolicyInformationPointService");
2482
- }
2483
- else {
2484
- throw new core.GeneralError("engineCore", "componentUnknownType", {
2485
- type,
2486
- componentType: "RightsManagementPipComponent"
2487
- });
2488
- }
2489
- const finalInstanceType = overrideInstanceType ?? instanceType;
2490
- context.componentInstances.push({
2491
- instanceType: finalInstanceType,
2492
- component
2493
- });
2494
- core.ComponentFactory.register(finalInstanceType, () => component);
2495
- return finalInstanceType;
2496
- }
2497
-
2498
- // Copyright 2024 IOTA Stiftung.
2499
- // SPDX-License-Identifier: Apache-2.0.
2500
- /**
2501
- * Rights management PMP component types.
2502
- */
2503
- // eslint-disable-next-line @typescript-eslint/naming-convention
2504
- const RightsManagementPmpComponentType = {
2505
- /**
2506
- * Service.
2507
- */
2508
- Service: "service"
2509
- };
2510
-
2511
- // Copyright 2024 IOTA Stiftung.
2512
- // SPDX-License-Identifier: Apache-2.0.
2513
- /**
2514
- * Initialise the rights management PMP component.
2515
- * @param engineCore The engine core.
2516
- * @param context The context for the engine.
2517
- * @param instanceConfig The instance config.
2518
- * @param overrideInstanceType The instance type to override the default.
2519
- * @returns The name of the instance created.
2520
- * @throws GeneralError if the component type is unknown.
2521
- */
2522
- function initialiseRightsManagementPmpComponent(engineCore, context, instanceConfig, overrideInstanceType) {
2523
- engineCore.logInfo(core.I18n.formatMessage("engineCore.configuring", {
2524
- element: `Rights Management PMP Component: ${instanceConfig.type}`
2525
- }));
2526
- const type = instanceConfig.type;
2527
- let component;
2528
- let instanceType;
2529
- if (type === RightsManagementPmpComponentType.Service) {
2530
- component = new rightsManagementPmpService.PolicyManagementPointService({
2531
- loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
2532
- policyAdministrationPointComponentType: engineCore.getRegisteredInstanceType("rightsManagementPapComponent"),
2533
- ...instanceConfig.options
2534
- });
2535
- instanceType = core.StringHelper.kebabCase("PolicyManagementPointService");
2536
- }
2537
- else {
2538
- throw new core.GeneralError("engineCore", "componentUnknownType", {
2539
- type,
2540
- componentType: "RightsManagementPmpComponent"
2541
- });
2542
- }
2543
- const finalInstanceType = overrideInstanceType ?? instanceType;
2544
- context.componentInstances.push({
2545
- instanceType: finalInstanceType,
2546
- component
2547
- });
2548
- core.ComponentFactory.register(finalInstanceType, () => component);
2549
- return finalInstanceType;
2550
- }
2551
-
2552
- // Copyright 2024 IOTA Stiftung.
2553
- // SPDX-License-Identifier: Apache-2.0.
2554
- /**
2555
- * Rights management PXP component types.
2556
- */
2557
- // eslint-disable-next-line @typescript-eslint/naming-convention
2558
- const RightsManagementPxpComponentType = {
2559
- /**
2560
- * Service.
2561
- */
2562
- Service: "service"
2563
- };
2564
-
2565
- // Copyright 2024 IOTA Stiftung.
2566
- // SPDX-License-Identifier: Apache-2.0.
2567
- /**
2568
- * Initialise the rights management PXP component.
2569
- * @param engineCore The engine core.
2570
- * @param context The context for the engine.
2571
- * @param instanceConfig The instance config.
2572
- * @param overrideInstanceType The instance type to override the default.
2573
- * @returns The name of the instance created.
2574
- * @throws GeneralError if the component type is unknown.
2575
- */
2576
- function initialiseRightsManagementPxpComponent(engineCore, context, instanceConfig, overrideInstanceType) {
2577
- engineCore.logInfo(core.I18n.formatMessage("engineCore.configuring", {
2578
- element: `Rights Management PXP Component: ${instanceConfig.type}`
2579
- }));
2580
- const type = instanceConfig.type;
2581
- let component;
2582
- let instanceType;
2583
- if (type === RightsManagementPxpComponentType.Service) {
2584
- component = new rightsManagementPxpService.PolicyExecutionPointService({
2585
- loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
2586
- ...instanceConfig.options
2587
- });
2588
- instanceType = core.StringHelper.kebabCase("PolicyExecutionPointService");
2589
- }
2590
- else {
2591
- throw new core.GeneralError("engineCore", "componentUnknownType", {
2592
- type,
2593
- componentType: "RightsManagementPxpComponent"
2594
- });
2595
- }
2596
- const finalInstanceType = overrideInstanceType ?? instanceType;
2597
- context.componentInstances.push({
2598
- instanceType: finalInstanceType,
2599
- component
2600
- });
2601
- core.ComponentFactory.register(finalInstanceType, () => component);
2602
- return finalInstanceType;
2603
- }
2604
-
2605
- // Copyright 2024 IOTA Stiftung.
2606
- // SPDX-License-Identifier: Apache-2.0.
2607
- /**
2608
- * Synchronised storage component types.
2609
- */
2610
- // eslint-disable-next-line @typescript-eslint/naming-convention
2611
- const SynchronisedStorageComponentType = {
2612
- /**
2613
- * Service.
2614
- */
2615
- Service: "service",
2616
- /**
2617
- * REST client.
2618
- */
2619
- RestClient: "rest-client"
2620
- };
2621
-
2622
- // Copyright 2024 IOTA Stiftung.
2623
- // SPDX-License-Identifier: Apache-2.0.
2624
- /**
2625
- * Initialise the synchronised storage component.
2626
- * @param engineCore The engine core.
2627
- * @param context The context for the engine.
2628
- * @param instanceConfig The instance config.
2629
- * @param overrideInstanceType The instance type to override the default.
2630
- * @returns The name of the instance created.
2631
- * @throws GeneralError if the component type is unknown.
2632
- */
2633
- function initialiseSynchronisedStorageComponent(engineCore, context, instanceConfig, overrideInstanceType) {
2634
- engineCore.logInfo(core.I18n.formatMessage("engineCore.configuring", {
2635
- element: `Synchronised Storage Component: ${instanceConfig.type}`
2636
- }));
2637
- const type = instanceConfig.type;
2638
- let component;
2639
- let instanceType;
2640
- if (type === SynchronisedStorageComponentType.Service) {
2641
- synchronisedStorageService.initSchema();
2642
- initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.syncSnapshotStorageConnectorType, "SyncSnapshotEntry");
2643
- component = new synchronisedStorageService.SynchronisedStorageService({
2644
- loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
2645
- eventBusComponentType: engineCore.getRegisteredInstanceType("eventBusComponent"),
2646
- vaultConnectorType: engineCore.getRegisteredInstanceType("vaultConnector"),
2647
- verifiableStorageConnectorType: engineCore.getRegisteredInstanceType("verifiableStorageConnector"),
2648
- identityConnectorType: engineCore.getRegisteredInstanceType("identityConnector"),
2649
- taskSchedulerComponentType: engineCore.getRegisteredInstanceType("taskSchedulerComponent"),
2650
- trustedSynchronisedStorageComponentType: engineCore.getRegisteredInstanceTypeOptional("synchronisedStorageComponent", ["trusted"]),
2651
- blobStorageConnectorType: engineCore.getRegisteredInstanceType("blobStorageConnector", [
2652
- "public"
2653
- ]),
2654
- ...instanceConfig.options
2655
- });
2656
- instanceType = core.StringHelper.kebabCase("SynchronisedStorageService");
2657
- }
2658
- else if (type === SynchronisedStorageComponentType.RestClient) {
2659
- component = new synchronisedStorageRestClient.SynchronisedStorageClient(instanceConfig.options);
2660
- instanceType = core.StringHelper.kebabCase("SynchronisedStorageClient");
2661
- }
2662
- else {
2663
- throw new core.GeneralError("engineCore", "componentUnknownType", {
2664
- type,
2665
- componentType: "SynchronisedStorageComponent"
2666
- });
2667
- }
2668
- const finalInstanceType = overrideInstanceType ?? instanceType;
2669
- context.componentInstances.push({
2670
- instanceType: finalInstanceType,
2671
- component
2672
- });
2673
- core.ComponentFactory.register(finalInstanceType, () => component);
2674
- return finalInstanceType;
2675
- }
2676
-
2677
- // Copyright 2024 IOTA Stiftung.
2678
- // SPDX-License-Identifier: Apache-2.0.
2679
- /**
2680
- * Task scheduler component types.
2681
- */
2682
- // eslint-disable-next-line @typescript-eslint/naming-convention
2683
- const TaskSchedulerComponentType = {
2684
- /**
2685
- * Task scheduler.
2686
- */
2687
- Service: "service"
2688
- };
2689
-
2690
- /**
2691
- * Initialise a task scheduler.
2692
- * @param engineCore The engine core.
2693
- * @param context The context for the engine.
2694
- * @param instanceConfig The instance config.
2695
- * @param overrideInstanceType The instance type to override the default.
2696
- * @returns The name of the instance created.
2697
- * @throws GeneralError if the connector type is unknown.
2698
- */
2699
- function initialiseTaskSchedulerComponent(engineCore, context, instanceConfig, overrideInstanceType) {
2700
- engineCore.logInfo(core.I18n.formatMessage("engineCore.configuring", {
2701
- element: `Task Scheduler: ${instanceConfig.type}`
2702
- }));
2703
- const type = instanceConfig.type;
2704
- let component;
2705
- let instanceType;
2706
- if (type === TaskSchedulerComponentType.Service) {
2707
- component = new backgroundTaskScheduler.TaskSchedulerService({
2708
- loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
2709
- ...instanceConfig.options
2710
- });
2711
- instanceType = core.StringHelper.kebabCase("TaskSchedulerService");
2712
- }
2713
- else {
2714
- throw new core.GeneralError("engineCore", "componentUnknownType", {
2715
- type,
2716
- componentType: "taskSchedulerComponent"
2717
- });
2718
- }
2719
- const finalInstanceType = overrideInstanceType ?? instanceType;
2720
- context.componentInstances.push({
2721
- instanceType: finalInstanceType,
2722
- component
2723
- });
2724
- core.ComponentFactory.register(finalInstanceType, () => component);
2725
- return finalInstanceType;
2726
- }
2727
-
2728
- // Copyright 2024 IOTA Stiftung.
2729
- // SPDX-License-Identifier: Apache-2.0.
2730
- /**
2731
- * Telemetry component types.
2732
- */
2733
- // eslint-disable-next-line @typescript-eslint/naming-convention
2734
- const TelemetryComponentType = {
2735
- /**
2736
- * Service.
2737
- */
2738
- Service: "service",
2739
- /**
2740
- * REST client.
2741
- */
2742
- RestClient: "rest-client"
2743
- };
2744
-
2745
- // Copyright 2024 IOTA Stiftung.
2746
- // SPDX-License-Identifier: Apache-2.0.
2747
- /**
2748
- * Telemetry connector types.
2749
- */
2750
- // eslint-disable-next-line @typescript-eslint/naming-convention
2751
- const TelemetryConnectorType = {
2752
- /**
2753
- * Entity storage.
2754
- */
2755
- EntityStorage: "entity-storage"
2756
- };
2757
-
2758
- // Copyright 2024 IOTA Stiftung.
2759
- // SPDX-License-Identifier: Apache-2.0.
2760
- /**
2761
- * Initialise a telemetry connector.
2762
- * @param engineCore The engine core.
2763
- * @param context The context for the engine.
2764
- * @param instanceConfig The instance config.
2765
- * @param overrideInstanceType The instance type to override the default.
2766
- * @returns The name of the instance created.
2767
- * @throws GeneralError if the connector type is unknown.
2768
- */
2769
- function initialiseTelemetryConnector(engineCore, context, instanceConfig, overrideInstanceType) {
2770
- engineCore.logInfo(core.I18n.formatMessage("engineCore.configuring", {
2771
- element: `Telemetry Connector: ${instanceConfig.type}`
2772
- }));
2773
- const type = instanceConfig.type;
2774
- let connector;
2775
- let instanceType;
2776
- if (type === TelemetryConnectorType.EntityStorage) {
2777
- telemetryConnectorEntityStorage.initSchema();
2778
- initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.telemetryMetricStorageConnectorType, "TelemetryMetric");
2779
- initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.telemetryMetricValueStorageConnectorType, "TelemetryMetricValue");
2780
- connector = new telemetryConnectorEntityStorage.EntityStorageTelemetryConnector({
2781
- loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
2782
- ...instanceConfig.options
2783
- });
2784
- instanceType = telemetryConnectorEntityStorage.EntityStorageTelemetryConnector.NAMESPACE;
2785
- }
2786
- else {
2787
- throw new core.GeneralError("engineCore", "connectorUnknownType", {
2788
- type,
2789
- connectorType: "telemetryConnector"
2790
- });
2791
- }
2792
- const finalInstanceType = overrideInstanceType ?? instanceType;
2793
- context.componentInstances.push({ instanceType: finalInstanceType, component: connector });
2794
- telemetryModels.TelemetryConnectorFactory.register(finalInstanceType, () => connector);
2795
- return finalInstanceType;
2796
- }
2797
- /**
2798
- * Initialise the telemetry component.
2799
- * @param engineCore The engine core.
2800
- * @param context The context for the engine.
2801
- * @param instanceConfig The instance config.
2802
- * @param overrideInstanceType The instance type to override the default.
2803
- * @returns The name of the instance created.
2804
- * @throws GeneralError if the component type is unknown.
2805
- */
2806
- function initialiseTelemetryComponent(engineCore, context, instanceConfig, overrideInstanceType) {
2807
- engineCore.logInfo(core.I18n.formatMessage("engineCore.configuring", {
2808
- element: `Telemetry Component: ${instanceConfig.type}`
2809
- }));
2810
- const type = instanceConfig.type;
2811
- let component;
2812
- let instanceType;
2813
- if (type === TelemetryComponentType.Service) {
2814
- component = new telemetryService.TelemetryService({
2815
- telemetryConnectorType: engineCore.getRegisteredInstanceType("telemetryConnector"),
2816
- ...instanceConfig.options
2817
- });
2818
- instanceType = core.StringHelper.kebabCase("TelemetryService");
2819
- }
2820
- else if (type === TelemetryComponentType.RestClient) {
2821
- component = new telemetryRestClient.TelemetryClient(instanceConfig.options);
2822
- instanceType = core.StringHelper.kebabCase("TelemetryClient");
2823
- }
2824
- else {
2825
- throw new core.GeneralError("engineCore", "componentUnknownType", {
2826
- type,
2827
- componentType: "telemetryComponent"
2828
- });
2829
- }
2830
- const finalInstanceType = overrideInstanceType ?? instanceType;
2831
- context.componentInstances.push({ instanceType: finalInstanceType, component });
2832
- core.ComponentFactory.register(finalInstanceType, () => component);
2833
- return finalInstanceType;
2834
- }
2835
-
2836
- // Copyright 2024 IOTA Stiftung.
2837
- // SPDX-License-Identifier: Apache-2.0.
2838
- /**
2839
- * Vault connector types.
2840
- */
2841
- // eslint-disable-next-line @typescript-eslint/naming-convention
2842
- const VaultConnectorType = {
2843
- /**
2844
- * Entity storage.
2845
- */
2846
- EntityStorage: "entity-storage",
2847
- /**
2848
- * Hashicorp.
2849
- */
2850
- Hashicorp: "hashicorp"
2851
- };
2852
-
2853
- // Copyright 2024 IOTA Stiftung.
2854
- // SPDX-License-Identifier: Apache-2.0.
2855
- /**
2856
- * Initialise the vault connector.
2857
- * @param engineCore The engine core.
2858
- * @param context The context for the engine.
2859
- * @param instanceConfig The instance config.
2860
- * @param overrideInstanceType The instance type to override the default.
2861
- * @returns The name of the instance created.
2862
- * @throws GeneralError if the connector type is unknown.
2863
- */
2864
- function initialiseVaultConnector(engineCore, context, instanceConfig, overrideInstanceType) {
2865
- engineCore.logInfo(core.I18n.formatMessage("engineCore.configuring", {
2866
- element: `Vault Connector: ${instanceConfig.type}`
2867
- }));
2868
- const type = instanceConfig.type;
2869
- let connector;
2870
- let instanceType;
2871
- if (type === VaultConnectorType.EntityStorage) {
2872
- vaultConnectorEntityStorage.initSchema();
2873
- initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.vaultKeyEntityStorageType, "VaultKey");
2874
- initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.vaultSecretEntityStorageType, "VaultSecret");
2875
- connector = new vaultConnectorEntityStorage.EntityStorageVaultConnector(instanceConfig.options);
2876
- instanceType = vaultConnectorEntityStorage.EntityStorageVaultConnector.NAMESPACE;
2877
- }
2878
- else if (type === VaultConnectorType.Hashicorp) {
2879
- connector = new vaultConnectorHashicorp.HashicorpVaultConnector(instanceConfig.options);
2880
- instanceType = vaultConnectorHashicorp.HashicorpVaultConnector.NAMESPACE;
2881
- }
2882
- else {
2883
- throw new core.GeneralError("engineCore", "connectorUnknownType", {
2884
- type,
2885
- connectorType: "vaultConnector"
2886
- });
2887
- }
2888
- const finalInstanceType = overrideInstanceType ?? instanceType;
2889
- context.componentInstances.push({ instanceType: finalInstanceType, component: connector });
2890
- vaultModels.VaultConnectorFactory.register(finalInstanceType, () => connector);
2891
- return finalInstanceType;
2892
- }
2893
-
2894
- // Copyright 2024 IOTA Stiftung.
2895
- // SPDX-License-Identifier: Apache-2.0.
2896
- /**
2897
- * Verifiable storage component types.
2898
- */
2899
- // eslint-disable-next-line @typescript-eslint/naming-convention
2900
- const VerifiableStorageComponentType = {
2901
- /**
2902
- * Service.
2903
- */
2904
- Service: "service",
2905
- /**
2906
- * REST client.
2907
- */
2908
- RestClient: "rest-client"
2909
- };
2910
-
2911
- // Copyright 2024 IOTA Stiftung.
2912
- // SPDX-License-Identifier: Apache-2.0.
2913
- /**
2914
- * Verifiable storage connector types.
2915
- */
2916
- // eslint-disable-next-line @typescript-eslint/naming-convention
2917
- const VerifiableStorageConnectorType = {
2918
- /**
2919
- * Entity storage.
2920
- */
2921
- EntityStorage: "entity-storage",
2922
- /**
2923
- * IOTA.
2924
- */
2925
- Iota: "iota"
2926
- };
2927
-
2928
- // Copyright 2024 IOTA Stiftung.
2929
- // SPDX-License-Identifier: Apache-2.0.
2930
- /**
2931
- * Initialise the verifiable storage connector.
2932
- * @param engineCore The engine core.
2933
- * @param context The context for the engine.
2934
- * @param instanceConfig The instance config.
2935
- * @param overrideInstanceType The instance type to override the default.
2936
- * @returns The name of the instance created.
2937
- * @throws GeneralError if the connector type is unknown.
2938
- */
2939
- function initialiseVerifiableStorageConnector(engineCore, context, instanceConfig, overrideInstanceType) {
2940
- engineCore.logInfo(core.I18n.formatMessage("engineCore.configuring", {
2941
- element: `Verifiable Storage Connector: ${instanceConfig.type}`
2942
- }));
2943
- const type = instanceConfig.type;
2944
- let connector;
2945
- let instanceType;
2946
- if (type === VerifiableStorageConnectorType.Iota) {
2947
- const defaultConfigType = engineCore.getRegisteredInstanceType("dltConfig");
2948
- const dltConfig = context.config.types.dltConfig?.find(dlt => dlt.type === defaultConfigType);
2949
- connector = new verifiableStorageConnectorIota.IotaVerifiableStorageConnector({
2950
- vaultConnectorType: engineCore.getRegisteredInstanceType("vaultConnector"),
2951
- ...instanceConfig.options,
2952
- config: {
2953
- ...dltConfig?.options?.config,
2954
- ...instanceConfig.options.config
2955
- }
2956
- });
2957
- instanceType = verifiableStorageConnectorIota.IotaVerifiableStorageConnector.NAMESPACE;
2958
- }
2959
- else if (type === VerifiableStorageConnectorType.EntityStorage) {
2960
- verifiableStorageConnectorEntityStorage.initSchema();
2961
- initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.verifiableStorageEntityStorageType, "VerifiableItem");
2962
- connector = new verifiableStorageConnectorEntityStorage.EntityStorageVerifiableStorageConnector(instanceConfig.options);
2963
- instanceType = verifiableStorageConnectorEntityStorage.EntityStorageVerifiableStorageConnector.NAMESPACE;
2964
- }
2965
- else {
2966
- throw new core.GeneralError("engineCore", "connectorUnknownType", {
2967
- type,
2968
- connectorType: "verifiableStorageConnector"
2969
- });
2970
- }
2971
- const finalInstanceType = overrideInstanceType ?? instanceType;
2972
- context.componentInstances.push({
2973
- instanceType: finalInstanceType,
2974
- component: connector
2975
- });
2976
- verifiableStorageModels.VerifiableStorageConnectorFactory.register(finalInstanceType, () => connector);
2977
- return finalInstanceType;
2978
- }
2979
- /**
2980
- * Initialise the verifiable storage component.
2981
- * @param engineCore The engine core.
2982
- * @param context The context for the engine.
2983
- * @param instanceConfig The instance config.
2984
- * @param overrideInstanceType The instance type to override the default.
2985
- * @returns The name of the instance created.
2986
- * @throws GeneralError if the component type is unknown.
2987
- */
2988
- function initialiseVerifiableStorageComponent(engineCore, context, instanceConfig, overrideInstanceType) {
2989
- engineCore.logInfo(core.I18n.formatMessage("engineCore.configuring", {
2990
- element: `Verifiable Storage Component: ${instanceConfig.type}`
2991
- }));
2992
- const type = instanceConfig.type;
2993
- let component;
2994
- let instanceType;
2995
- if (type === VerifiableStorageComponentType.Service) {
2996
- component = new verifiableStorageService.VerifiableStorageService({
2997
- ...instanceConfig.options
2998
- });
2999
- instanceType = core.StringHelper.kebabCase("VerifiableStorageService");
3000
- }
3001
- else if (type === VerifiableStorageComponentType.RestClient) {
3002
- component = new verifiableStorageRestClient.VerifiableStorageClient(instanceConfig.options);
3003
- instanceType = core.StringHelper.kebabCase("VerifiableStorageClient");
3004
- }
3005
- else {
3006
- throw new core.GeneralError("engineCore", "componentUnknownType", {
3007
- type,
3008
- componentType: "verifiableStorageComponent"
3009
- });
3010
- }
3011
- const finalInstanceType = overrideInstanceType ?? instanceType;
3012
- context.componentInstances.push({
3013
- instanceType: finalInstanceType,
3014
- component
3015
- });
3016
- core.ComponentFactory.register(finalInstanceType, () => component);
3017
- return finalInstanceType;
3018
- }
3019
-
3020
- // Copyright 2024 IOTA Stiftung.
3021
- // SPDX-License-Identifier: Apache-2.0.
3022
- /**
3023
- * Wallet connector types.
3024
- */
3025
- // eslint-disable-next-line @typescript-eslint/naming-convention
3026
- const WalletConnectorType = {
3027
- /**
3028
- * Entity storage.
3029
- */
3030
- EntityStorage: "entity-storage",
3031
- /**
3032
- * IOTA.
3033
- */
3034
- Iota: "iota"
3035
- };
3036
-
3037
- // Copyright 2024 IOTA Stiftung.
3038
- // SPDX-License-Identifier: Apache-2.0.
3039
- /**
3040
- * Initialise a wallet connector.
3041
- * @param engineCore The engine core.
3042
- * @param context The context for the node.
3043
- * @param instanceConfig The instance config.
3044
- * @param overrideInstanceType The instance type to override the default.
3045
- * @returns The name of the instance created.
3046
- * @throws GeneralError if the connector type is unknown.
3047
- */
3048
- function initialiseWalletConnector(engineCore, context, instanceConfig, overrideInstanceType) {
3049
- engineCore.logInfo(core.I18n.formatMessage("engineCore.configuring", {
3050
- element: `Wallet Connector: ${instanceConfig.type}`
3051
- }));
3052
- const type = instanceConfig.type;
3053
- let connector;
3054
- let instanceType;
3055
- if (type === WalletConnectorType.Iota) {
3056
- const defaultConfigType = engineCore.getRegisteredInstanceType("dltConfig");
3057
- const dltConfig = context.config.types.dltConfig?.find(dlt => dlt.type === defaultConfigType);
3058
- connector = new walletConnectorIota.IotaWalletConnector({
3059
- vaultConnectorType: engineCore.getRegisteredInstanceType("vaultConnector"),
3060
- faucetConnectorType: engineCore.getRegisteredInstanceType("faucetConnector"),
3061
- ...instanceConfig.options,
3062
- config: {
3063
- ...dltConfig?.options?.config,
3064
- ...instanceConfig.options.config
3065
- }
3066
- });
3067
- instanceType = walletConnectorIota.IotaWalletConnector.NAMESPACE;
3068
- }
3069
- else if (type === WalletConnectorType.EntityStorage) {
3070
- connector = new walletConnectorEntityStorage.EntityStorageWalletConnector({
3071
- vaultConnectorType: engineCore.getRegisteredInstanceType("vaultConnector"),
3072
- faucetConnectorType: engineCore.getRegisteredInstanceType("faucetConnector"),
3073
- ...instanceConfig.options
3074
- });
3075
- instanceType = walletConnectorEntityStorage.EntityStorageWalletConnector.NAMESPACE;
3076
- }
3077
- else {
3078
- throw new core.GeneralError("engineCore", "connectorUnknownType", {
3079
- type,
3080
- connectorType: "walletConnector"
3081
- });
3082
- }
3083
- const finalInstanceType = overrideInstanceType ?? instanceType;
3084
- context.componentInstances.push({
3085
- instanceType: finalInstanceType,
3086
- component: connector
3087
- });
3088
- walletModels.WalletConnectorFactory.register(finalInstanceType, () => connector);
3089
- return finalInstanceType;
3090
- }
3091
- /**
3092
- * Initialise the wallet storage.
3093
- * @param engineCore The engine core.
3094
- * @param context The context for the engine.
3095
- * @param instanceConfig The instance config.
3096
- * @param overrideInstanceType The instance type to override the default.
3097
- * @returns Nothing.
3098
- * @throws GeneralError if the connector type is unknown.
3099
- */
3100
- function initialiseWalletStorage(engineCore, context, instanceConfig, overrideInstanceType) {
3101
- const type = instanceConfig.type;
3102
- if (type === WalletConnectorType.Iota) ;
3103
- else if (type === WalletConnectorType.EntityStorage) {
3104
- walletConnectorEntityStorage.initSchema();
3105
- initialiseEntityStorageConnector(engineCore, context, instanceConfig.options?.walletAddressEntityStorageType, "WalletAddress");
3106
- }
3107
- else {
3108
- throw new core.GeneralError("engineCore", "connectorUnknownType", {
3109
- type,
3110
- connectorType: "walletConnector"
3111
- });
3112
- }
3113
- return undefined;
3114
- }
3115
-
3116
- // Copyright 2024 IOTA Stiftung.
3117
- // SPDX-License-Identifier: Apache-2.0.
3118
- /**
3119
- * DLT config types.
3120
- */
3121
- // eslint-disable-next-line @typescript-eslint/naming-convention
3122
- const DltConfigType = {
3123
- /**
3124
- * IOTA.
3125
- */
3126
- Iota: "iota"
3127
- };
3128
-
3129
- exports.AttestationComponentType = AttestationComponentType;
3130
- exports.AttestationConnectorType = AttestationConnectorType;
3131
- exports.AuditableItemGraphComponentType = AuditableItemGraphComponentType;
3132
- exports.AuditableItemStreamComponentType = AuditableItemStreamComponentType;
3133
- exports.BackgroundTaskConnectorType = BackgroundTaskConnectorType;
3134
- exports.BlobStorageComponentType = BlobStorageComponentType;
3135
- exports.BlobStorageConnectorType = BlobStorageConnectorType;
3136
- exports.DataConverterConnectorType = DataConverterConnectorType;
3137
- exports.DataExtractorConnectorType = DataExtractorConnectorType;
3138
- exports.DataProcessingComponentType = DataProcessingComponentType;
3139
- exports.DltConfigType = DltConfigType;
3140
- exports.DocumentManagementComponentType = DocumentManagementComponentType;
3141
- exports.EntityStorageComponentType = EntityStorageComponentType;
3142
- exports.EntityStorageConnectorType = EntityStorageConnectorType;
3143
- exports.EventBusComponentType = EventBusComponentType;
3144
- exports.EventBusConnectorType = EventBusConnectorType;
3145
- exports.FaucetConnectorType = FaucetConnectorType;
3146
- exports.FederatedCatalogueComponentType = FederatedCatalogueComponentType;
3147
- exports.IdentityComponentType = IdentityComponentType;
3148
- exports.IdentityConnectorType = IdentityConnectorType;
3149
- exports.IdentityProfileComponentType = IdentityProfileComponentType;
3150
- exports.IdentityProfileConnectorType = IdentityProfileConnectorType;
3151
- exports.IdentityResolverComponentType = IdentityResolverComponentType;
3152
- exports.IdentityResolverConnectorType = IdentityResolverConnectorType;
3153
- exports.ImmutableProofComponentType = ImmutableProofComponentType;
3154
- exports.LoggingComponentType = LoggingComponentType;
3155
- exports.LoggingConnectorType = LoggingConnectorType;
3156
- exports.MessagingComponentType = MessagingComponentType;
3157
- exports.MessagingEmailConnectorType = MessagingEmailConnectorType;
3158
- exports.MessagingPushNotificationConnectorType = MessagingPushNotificationConnectorType;
3159
- exports.MessagingSmsConnectorType = MessagingSmsConnectorType;
3160
- exports.NftComponentType = NftComponentType;
3161
- exports.NftConnectorType = NftConnectorType;
3162
- exports.RightsManagementComponentType = RightsManagementComponentType;
3163
- exports.RightsManagementPapComponentType = RightsManagementPapComponentType;
3164
- exports.RightsManagementPdpComponentType = RightsManagementPdpComponentType;
3165
- exports.RightsManagementPepComponentType = RightsManagementPepComponentType;
3166
- exports.RightsManagementPipComponentType = RightsManagementPipComponentType;
3167
- exports.RightsManagementPmpComponentType = RightsManagementPmpComponentType;
3168
- exports.RightsManagementPxpComponentType = RightsManagementPxpComponentType;
3169
- exports.SynchronisedStorageComponentType = SynchronisedStorageComponentType;
3170
- exports.TaskSchedulerComponentType = TaskSchedulerComponentType;
3171
- exports.TelemetryComponentType = TelemetryComponentType;
3172
- exports.TelemetryConnectorType = TelemetryConnectorType;
3173
- exports.VaultConnectorType = VaultConnectorType;
3174
- exports.VerifiableStorageComponentType = VerifiableStorageComponentType;
3175
- exports.VerifiableStorageConnectorType = VerifiableStorageConnectorType;
3176
- exports.WalletConnectorType = WalletConnectorType;
3177
- exports.initialiseAttestationComponent = initialiseAttestationComponent;
3178
- exports.initialiseAttestationConnector = initialiseAttestationConnector;
3179
- exports.initialiseAuditableItemGraphComponent = initialiseAuditableItemGraphComponent;
3180
- exports.initialiseAuditableItemStreamComponent = initialiseAuditableItemStreamComponent;
3181
- exports.initialiseBackgroundTaskConnector = initialiseBackgroundTaskConnector;
3182
- exports.initialiseBlobStorageComponent = initialiseBlobStorageComponent;
3183
- exports.initialiseBlobStorageConnector = initialiseBlobStorageConnector;
3184
- exports.initialiseDataConverterConnector = initialiseDataConverterConnector;
3185
- exports.initialiseDataExtractorConnector = initialiseDataExtractorConnector;
3186
- exports.initialiseDataProcessingComponent = initialiseDataProcessingComponent;
3187
- exports.initialiseDocumentManagementComponent = initialiseDocumentManagementComponent;
3188
- exports.initialiseEntityStorageComponent = initialiseEntityStorageComponent;
3189
- exports.initialiseEntityStorageConnector = initialiseEntityStorageConnector;
3190
- exports.initialiseEventBusComponent = initialiseEventBusComponent;
3191
- exports.initialiseEventBusConnector = initialiseEventBusConnector;
3192
- exports.initialiseFaucetConnector = initialiseFaucetConnector;
3193
- exports.initialiseFederatedCatalogueComponent = initialiseFederatedCatalogueComponent;
3194
- exports.initialiseIdentityComponent = initialiseIdentityComponent;
3195
- exports.initialiseIdentityConnector = initialiseIdentityConnector;
3196
- exports.initialiseIdentityProfileComponent = initialiseIdentityProfileComponent;
3197
- exports.initialiseIdentityProfileConnector = initialiseIdentityProfileConnector;
3198
- exports.initialiseIdentityResolverComponent = initialiseIdentityResolverComponent;
3199
- exports.initialiseIdentityResolverConnector = initialiseIdentityResolverConnector;
3200
- exports.initialiseImmutableProofComponent = initialiseImmutableProofComponent;
3201
- exports.initialiseLoggingComponent = initialiseLoggingComponent;
3202
- exports.initialiseLoggingConnector = initialiseLoggingConnector;
3203
- exports.initialiseMessagingComponent = initialiseMessagingComponent;
3204
- exports.initialiseMessagingEmailConnector = initialiseMessagingEmailConnector;
3205
- exports.initialiseMessagingPushNotificationConnector = initialiseMessagingPushNotificationConnector;
3206
- exports.initialiseMessagingSmsConnector = initialiseMessagingSmsConnector;
3207
- exports.initialiseNftComponent = initialiseNftComponent;
3208
- exports.initialiseNftConnector = initialiseNftConnector;
3209
- exports.initialiseRightsManagementComponent = initialiseRightsManagementComponent;
3210
- exports.initialiseRightsManagementPapComponent = initialiseRightsManagementPapComponent;
3211
- exports.initialiseRightsManagementPdpComponent = initialiseRightsManagementPdpComponent;
3212
- exports.initialiseRightsManagementPepComponent = initialiseRightsManagementPepComponent;
3213
- exports.initialiseRightsManagementPipComponent = initialiseRightsManagementPipComponent;
3214
- exports.initialiseRightsManagementPmpComponent = initialiseRightsManagementPmpComponent;
3215
- exports.initialiseRightsManagementPxpComponent = initialiseRightsManagementPxpComponent;
3216
- exports.initialiseSynchronisedStorageComponent = initialiseSynchronisedStorageComponent;
3217
- exports.initialiseTaskSchedulerComponent = initialiseTaskSchedulerComponent;
3218
- exports.initialiseTelemetryComponent = initialiseTelemetryComponent;
3219
- exports.initialiseTelemetryConnector = initialiseTelemetryConnector;
3220
- exports.initialiseVaultConnector = initialiseVaultConnector;
3221
- exports.initialiseVerifiableStorageComponent = initialiseVerifiableStorageComponent;
3222
- exports.initialiseVerifiableStorageConnector = initialiseVerifiableStorageConnector;
3223
- exports.initialiseWalletConnector = initialiseWalletConnector;
3224
- exports.initialiseWalletStorage = initialiseWalletStorage;