@nmshd/transport 1.0.0

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 (497) hide show
  1. package/LICENSE +1 -0
  2. package/README.md +18 -0
  3. package/dist/TransportBuildInformation.d.ts +13 -0
  4. package/dist/TransportBuildInformation.js +25 -0
  5. package/dist/TransportBuildInformation.js.map +1 -0
  6. package/dist/core/CoreCrypto.d.ts +108 -0
  7. package/dist/core/CoreCrypto.js +205 -0
  8. package/dist/core/CoreCrypto.js.map +1 -0
  9. package/dist/core/CoreError.d.ts +18 -0
  10. package/dist/core/CoreError.js +63 -0
  11. package/dist/core/CoreError.js.map +1 -0
  12. package/dist/core/CoreIdHelper.d.ts +9 -0
  13. package/dist/core/CoreIdHelper.js +23 -0
  14. package/dist/core/CoreIdHelper.js.map +1 -0
  15. package/dist/core/CoreIds.d.ts +9 -0
  16. package/dist/core/CoreIds.js +14 -0
  17. package/dist/core/CoreIds.js.map +1 -0
  18. package/dist/core/CoreSerializable.d.ts +18 -0
  19. package/dist/core/CoreSerializable.js +44 -0
  20. package/dist/core/CoreSerializable.js.map +1 -0
  21. package/dist/core/CoreSerializableAsync.d.ts +18 -0
  22. package/dist/core/CoreSerializableAsync.js +44 -0
  23. package/dist/core/CoreSerializableAsync.js.map +1 -0
  24. package/dist/core/CoreSynchronizable.d.ts +11 -0
  25. package/dist/core/CoreSynchronizable.js +30 -0
  26. package/dist/core/CoreSynchronizable.js.map +1 -0
  27. package/dist/core/CoreUtil.d.ts +6 -0
  28. package/dist/core/CoreUtil.js +38 -0
  29. package/dist/core/CoreUtil.js.map +1 -0
  30. package/dist/core/DbCollectionNames.d.ts +11 -0
  31. package/dist/core/DbCollectionNames.js +16 -0
  32. package/dist/core/DbCollectionNames.js.map +1 -0
  33. package/dist/core/ICacheable.d.ts +4 -0
  34. package/dist/core/ICacheable.js +14 -0
  35. package/dist/core/ICacheable.js.map +1 -0
  36. package/dist/core/Transport.d.ts +47 -0
  37. package/dist/core/Transport.js +71 -0
  38. package/dist/core/Transport.js.map +1 -0
  39. package/dist/core/TransportContext.d.ts +8 -0
  40. package/dist/core/TransportContext.js +29 -0
  41. package/dist/core/TransportContext.js.map +1 -0
  42. package/dist/core/TransportController.d.ts +51 -0
  43. package/dist/core/TransportController.js +99 -0
  44. package/dist/core/TransportController.js.map +1 -0
  45. package/dist/core/TransportErrors.d.ts +125 -0
  46. package/dist/core/TransportErrors.js +255 -0
  47. package/dist/core/TransportErrors.js.map +1 -0
  48. package/dist/core/TransportLoggerFactory.d.ts +7 -0
  49. package/dist/core/TransportLoggerFactory.js +23 -0
  50. package/dist/core/TransportLoggerFactory.js.map +1 -0
  51. package/dist/core/backbone/AuthClient.d.ts +17 -0
  52. package/dist/core/backbone/AuthClient.js +47 -0
  53. package/dist/core/backbone/AuthClient.js.map +1 -0
  54. package/dist/core/backbone/Authenticator.d.ts +16 -0
  55. package/dist/core/backbone/Authenticator.js +62 -0
  56. package/dist/core/backbone/Authenticator.js.map +1 -0
  57. package/dist/core/backbone/BackboneIds.d.ts +11 -0
  58. package/dist/core/backbone/BackboneIds.js +16 -0
  59. package/dist/core/backbone/BackboneIds.js.map +1 -0
  60. package/dist/core/backbone/ClientResult.d.ts +19 -0
  61. package/dist/core/backbone/ClientResult.js +58 -0
  62. package/dist/core/backbone/ClientResult.js.map +1 -0
  63. package/dist/core/backbone/Paginator.d.ts +17 -0
  64. package/dist/core/backbone/Paginator.js +44 -0
  65. package/dist/core/backbone/Paginator.js.map +1 -0
  66. package/dist/core/backbone/PlatformError.d.ts +9 -0
  67. package/dist/core/backbone/PlatformError.js +3 -0
  68. package/dist/core/backbone/PlatformError.js.map +1 -0
  69. package/dist/core/backbone/PlatformParameters.d.ts +6 -0
  70. package/dist/core/backbone/PlatformParameters.js +3 -0
  71. package/dist/core/backbone/PlatformParameters.js.map +1 -0
  72. package/dist/core/backbone/PlatformResponse.d.ts +16 -0
  73. package/dist/core/backbone/PlatformResponse.js +3 -0
  74. package/dist/core/backbone/PlatformResponse.js.map +1 -0
  75. package/dist/core/backbone/RESTClient.d.ts +46 -0
  76. package/dist/core/backbone/RESTClient.js +425 -0
  77. package/dist/core/backbone/RESTClient.js.map +1 -0
  78. package/dist/core/backbone/RESTClientAuthenticate.d.ts +23 -0
  79. package/dist/core/backbone/RESTClientAuthenticate.js +72 -0
  80. package/dist/core/backbone/RESTClientAuthenticate.js.map +1 -0
  81. package/dist/core/backbone/RequestError.d.ts +24 -0
  82. package/dist/core/backbone/RequestError.js +101 -0
  83. package/dist/core/backbone/RequestError.js.map +1 -0
  84. package/dist/core/backbone/index.d.ts +6 -0
  85. package/dist/core/backbone/index.js +19 -0
  86. package/dist/core/backbone/index.js.map +1 -0
  87. package/dist/core/index.d.ts +16 -0
  88. package/dist/core/index.js +29 -0
  89. package/dist/core/index.js.map +1 -0
  90. package/dist/core/logging/logExecutionTime.d.ts +26 -0
  91. package/dist/core/logging/logExecutionTime.js +58 -0
  92. package/dist/core/logging/logExecutionTime.js.map +1 -0
  93. package/dist/core/types/CoreAddress.d.ts +15 -0
  94. package/dist/core/types/CoreAddress.js +56 -0
  95. package/dist/core/types/CoreAddress.js.map +1 -0
  96. package/dist/core/types/CoreDate.d.ts +37 -0
  97. package/dist/core/types/CoreDate.js +156 -0
  98. package/dist/core/types/CoreDate.js.map +1 -0
  99. package/dist/core/types/CoreHash.d.ts +37 -0
  100. package/dist/core/types/CoreHash.js +75 -0
  101. package/dist/core/types/CoreHash.js.map +1 -0
  102. package/dist/core/types/CoreId.d.ts +16 -0
  103. package/dist/core/types/CoreId.js +57 -0
  104. package/dist/core/types/CoreId.js.map +1 -0
  105. package/dist/core/types/TransportVersion.d.ts +4 -0
  106. package/dist/core/types/TransportVersion.js +9 -0
  107. package/dist/core/types/TransportVersion.js.map +1 -0
  108. package/dist/core/types/index.d.ts +5 -0
  109. package/dist/core/types/index.js +18 -0
  110. package/dist/core/types/index.js.map +1 -0
  111. package/dist/index.d.ts +3 -0
  112. package/dist/index.js +16 -0
  113. package/dist/index.js.map +1 -0
  114. package/dist/modules/accounts/AccountController.d.ts +77 -0
  115. package/dist/modules/accounts/AccountController.js +337 -0
  116. package/dist/modules/accounts/AccountController.js.map +1 -0
  117. package/dist/modules/accounts/IdentityController.d.ts +21 -0
  118. package/dist/modules/accounts/IdentityController.js +67 -0
  119. package/dist/modules/accounts/IdentityController.js.map +1 -0
  120. package/dist/modules/accounts/IdentityUtil.d.ts +6 -0
  121. package/dist/modules/accounts/IdentityUtil.js +56 -0
  122. package/dist/modules/accounts/IdentityUtil.js.map +1 -0
  123. package/dist/modules/accounts/backbone/IdentityClient.d.ts +23 -0
  124. package/dist/modules/accounts/backbone/IdentityClient.js +15 -0
  125. package/dist/modules/accounts/backbone/IdentityClient.js.map +1 -0
  126. package/dist/modules/accounts/data/Identity.d.ts +34 -0
  127. package/dist/modules/accounts/data/Identity.js +69 -0
  128. package/dist/modules/accounts/data/Identity.js.map +1 -0
  129. package/dist/modules/accounts/data/IdentitySecretCredentials.d.ts +16 -0
  130. package/dist/modules/accounts/data/IdentitySecretCredentials.js +47 -0
  131. package/dist/modules/accounts/data/IdentitySecretCredentials.js.map +1 -0
  132. package/dist/modules/certificates/CertificateController.d.ts +14 -0
  133. package/dist/modules/certificates/CertificateController.js +20 -0
  134. package/dist/modules/certificates/CertificateController.js.map +1 -0
  135. package/dist/modules/certificates/CertificateIssuer.d.ts +27 -0
  136. package/dist/modules/certificates/CertificateIssuer.js +42 -0
  137. package/dist/modules/certificates/CertificateIssuer.js.map +1 -0
  138. package/dist/modules/certificates/CertificateValidator.d.ts +14 -0
  139. package/dist/modules/certificates/CertificateValidator.js +20 -0
  140. package/dist/modules/certificates/CertificateValidator.js.map +1 -0
  141. package/dist/modules/certificates/data/Certificate.d.ts +34 -0
  142. package/dist/modules/certificates/data/Certificate.js +65 -0
  143. package/dist/modules/certificates/data/Certificate.js.map +1 -0
  144. package/dist/modules/certificates/data/CertificateConstraint.d.ts +10 -0
  145. package/dist/modules/certificates/data/CertificateConstraint.js +28 -0
  146. package/dist/modules/certificates/data/CertificateConstraint.js.map +1 -0
  147. package/dist/modules/certificates/data/CertificateContent.d.ts +28 -0
  148. package/dist/modules/certificates/data/CertificateContent.js +70 -0
  149. package/dist/modules/certificates/data/CertificateContent.js.map +1 -0
  150. package/dist/modules/certificates/data/CertificateItem.d.ts +11 -0
  151. package/dist/modules/certificates/data/CertificateItem.js +29 -0
  152. package/dist/modules/certificates/data/CertificateItem.js.map +1 -0
  153. package/dist/modules/certificates/data/constraints/CertificateBorderConstraint.d.ts +29 -0
  154. package/dist/modules/certificates/data/constraints/CertificateBorderConstraint.js +57 -0
  155. package/dist/modules/certificates/data/constraints/CertificateBorderConstraint.js.map +1 -0
  156. package/dist/modules/certificates/data/constraints/CertificateCityConstraint.d.ts +31 -0
  157. package/dist/modules/certificates/data/constraints/CertificateCityConstraint.js +60 -0
  158. package/dist/modules/certificates/data/constraints/CertificateCityConstraint.js.map +1 -0
  159. package/dist/modules/certificates/data/constraints/CertificateIdentityConstraint.d.ts +9 -0
  160. package/dist/modules/certificates/data/constraints/CertificateIdentityConstraint.js +31 -0
  161. package/dist/modules/certificates/data/constraints/CertificateIdentityConstraint.js.map +1 -0
  162. package/dist/modules/certificates/data/constraints/CertificateTimeConstraint.d.ts +16 -0
  163. package/dist/modules/certificates/data/constraints/CertificateTimeConstraint.js +41 -0
  164. package/dist/modules/certificates/data/constraints/CertificateTimeConstraint.js.map +1 -0
  165. package/dist/modules/certificates/data/items/CertificateAuthorizationItem.d.ts +17 -0
  166. package/dist/modules/certificates/data/items/CertificateAuthorizationItem.js +39 -0
  167. package/dist/modules/certificates/data/items/CertificateAuthorizationItem.js.map +1 -0
  168. package/dist/modules/certificates/data/items/CertificateDelegateItem.d.ts +18 -0
  169. package/dist/modules/certificates/data/items/CertificateDelegateItem.js +46 -0
  170. package/dist/modules/certificates/data/items/CertificateDelegateItem.js.map +1 -0
  171. package/dist/modules/certificates/data/items/CertificatePrivateAttributeItem.d.ts +19 -0
  172. package/dist/modules/certificates/data/items/CertificatePrivateAttributeItem.js +42 -0
  173. package/dist/modules/certificates/data/items/CertificatePrivateAttributeItem.js.map +1 -0
  174. package/dist/modules/certificates/data/items/CertificatePrivateAttributeItemSource.d.ts +25 -0
  175. package/dist/modules/certificates/data/items/CertificatePrivateAttributeItemSource.js +55 -0
  176. package/dist/modules/certificates/data/items/CertificatePrivateAttributeItemSource.js.map +1 -0
  177. package/dist/modules/certificates/data/items/CertificatePublicAttributeItem.d.ts +14 -0
  178. package/dist/modules/certificates/data/items/CertificatePublicAttributeItem.js +39 -0
  179. package/dist/modules/certificates/data/items/CertificatePublicAttributeItem.js.map +1 -0
  180. package/dist/modules/certificates/data/items/CertificateRoleItem.d.ts +16 -0
  181. package/dist/modules/certificates/data/items/CertificateRoleItem.js +38 -0
  182. package/dist/modules/certificates/data/items/CertificateRoleItem.js.map +1 -0
  183. package/dist/modules/challenges/ChallengeController.d.ts +16 -0
  184. package/dist/modules/challenges/ChallengeController.js +123 -0
  185. package/dist/modules/challenges/ChallengeController.js.map +1 -0
  186. package/dist/modules/challenges/backbone/ChallengeAuthClient.d.ts +18 -0
  187. package/dist/modules/challenges/backbone/ChallengeAuthClient.js +14 -0
  188. package/dist/modules/challenges/backbone/ChallengeAuthClient.js.map +1 -0
  189. package/dist/modules/challenges/backbone/ChallengeClient.d.ts +6 -0
  190. package/dist/modules/challenges/backbone/ChallengeClient.js +11 -0
  191. package/dist/modules/challenges/backbone/ChallengeClient.js.map +1 -0
  192. package/dist/modules/challenges/data/Challenge.d.ts +22 -0
  193. package/dist/modules/challenges/data/Challenge.js +59 -0
  194. package/dist/modules/challenges/data/Challenge.js.map +1 -0
  195. package/dist/modules/challenges/data/ChallengeSigned.d.ts +18 -0
  196. package/dist/modules/challenges/data/ChallengeSigned.js +50 -0
  197. package/dist/modules/challenges/data/ChallengeSigned.js.map +1 -0
  198. package/dist/modules/devices/DeviceController.d.ts +27 -0
  199. package/dist/modules/devices/DeviceController.js +120 -0
  200. package/dist/modules/devices/DeviceController.js.map +1 -0
  201. package/dist/modules/devices/DeviceSecretController.d.ts +36 -0
  202. package/dist/modules/devices/DeviceSecretController.js +163 -0
  203. package/dist/modules/devices/DeviceSecretController.js.map +1 -0
  204. package/dist/modules/devices/DevicesController.d.ts +20 -0
  205. package/dist/modules/devices/DevicesController.js +96 -0
  206. package/dist/modules/devices/DevicesController.js.map +1 -0
  207. package/dist/modules/devices/backbone/BackbonePostDevices.d.ts +11 -0
  208. package/dist/modules/devices/backbone/BackbonePostDevices.js +3 -0
  209. package/dist/modules/devices/backbone/BackbonePostDevices.js.map +1 -0
  210. package/dist/modules/devices/backbone/DeviceAuthClient.d.ts +18 -0
  211. package/dist/modules/devices/backbone/DeviceAuthClient.js +21 -0
  212. package/dist/modules/devices/backbone/DeviceAuthClient.js.map +1 -0
  213. package/dist/modules/devices/backbone/DeviceClient.d.ts +7 -0
  214. package/dist/modules/devices/backbone/DeviceClient.js +15 -0
  215. package/dist/modules/devices/backbone/DeviceClient.js.map +1 -0
  216. package/dist/modules/devices/local/Device.d.ts +46 -0
  217. package/dist/modules/devices/local/Device.js +115 -0
  218. package/dist/modules/devices/local/Device.js.map +1 -0
  219. package/dist/modules/devices/local/DeviceSecretCredentials.d.ts +12 -0
  220. package/dist/modules/devices/local/DeviceSecretCredentials.js +40 -0
  221. package/dist/modules/devices/local/DeviceSecretCredentials.js.map +1 -0
  222. package/dist/modules/devices/local/SendDeviceParameters.d.ts +13 -0
  223. package/dist/modules/devices/local/SendDeviceParameters.js +43 -0
  224. package/dist/modules/devices/local/SendDeviceParameters.js.map +1 -0
  225. package/dist/modules/devices/transmission/DeviceSharedSecret.d.ts +33 -0
  226. package/dist/modules/devices/transmission/DeviceSharedSecret.js +90 -0
  227. package/dist/modules/devices/transmission/DeviceSharedSecret.js.map +1 -0
  228. package/dist/modules/files/FileController.d.ts +25 -0
  229. package/dist/modules/files/FileController.js +196 -0
  230. package/dist/modules/files/FileController.js.map +1 -0
  231. package/dist/modules/files/backbone/BackboneGetFiles.d.ts +21 -0
  232. package/dist/modules/files/backbone/BackboneGetFiles.js +3 -0
  233. package/dist/modules/files/backbone/BackboneGetFiles.js.map +1 -0
  234. package/dist/modules/files/backbone/BackbonePostFiles.d.ts +25 -0
  235. package/dist/modules/files/backbone/BackbonePostFiles.js +3 -0
  236. package/dist/modules/files/backbone/BackbonePostFiles.js.map +1 -0
  237. package/dist/modules/files/backbone/FileClient.d.ts +12 -0
  238. package/dist/modules/files/backbone/FileClient.js +23 -0
  239. package/dist/modules/files/backbone/FileClient.js.map +1 -0
  240. package/dist/modules/files/local/CachedFile.d.ts +47 -0
  241. package/dist/modules/files/local/CachedFile.js +140 -0
  242. package/dist/modules/files/local/CachedFile.js.map +1 -0
  243. package/dist/modules/files/local/File.d.ts +27 -0
  244. package/dist/modules/files/local/File.js +88 -0
  245. package/dist/modules/files/local/File.js.map +1 -0
  246. package/dist/modules/files/local/SendFileParameters.d.ts +23 -0
  247. package/dist/modules/files/local/SendFileParameters.js +65 -0
  248. package/dist/modules/files/local/SendFileParameters.js.map +1 -0
  249. package/dist/modules/files/transmission/FileMetadata.d.ts +24 -0
  250. package/dist/modules/files/transmission/FileMetadata.js +69 -0
  251. package/dist/modules/files/transmission/FileMetadata.js.map +1 -0
  252. package/dist/modules/files/transmission/FileReference.d.ts +15 -0
  253. package/dist/modules/files/transmission/FileReference.js +66 -0
  254. package/dist/modules/files/transmission/FileReference.js.map +1 -0
  255. package/dist/modules/index.d.ts +110 -0
  256. package/dist/modules/index.js +123 -0
  257. package/dist/modules/index.js.map +1 -0
  258. package/dist/modules/messages/MessageController.d.ts +29 -0
  259. package/dist/modules/messages/MessageController.js +316 -0
  260. package/dist/modules/messages/MessageController.js.map +1 -0
  261. package/dist/modules/messages/backbone/BackboneGetMessages.d.ts +25 -0
  262. package/dist/modules/messages/backbone/BackboneGetMessages.js +3 -0
  263. package/dist/modules/messages/backbone/BackboneGetMessages.js.map +1 -0
  264. package/dist/modules/messages/backbone/BackbonePostMessages.d.ts +16 -0
  265. package/dist/modules/messages/backbone/BackbonePostMessages.js +3 -0
  266. package/dist/modules/messages/backbone/BackbonePostMessages.js.map +1 -0
  267. package/dist/modules/messages/backbone/MessageClient.d.ts +12 -0
  268. package/dist/modules/messages/backbone/MessageClient.js +23 -0
  269. package/dist/modules/messages/backbone/MessageClient.js.map +1 -0
  270. package/dist/modules/messages/local/CachedMessage.d.ts +23 -0
  271. package/dist/modules/messages/local/CachedMessage.js +67 -0
  272. package/dist/modules/messages/local/CachedMessage.js.map +1 -0
  273. package/dist/modules/messages/local/Message.d.ts +26 -0
  274. package/dist/modules/messages/local/Message.js +87 -0
  275. package/dist/modules/messages/local/Message.js.map +1 -0
  276. package/dist/modules/messages/local/SendMessageParameters.d.ts +15 -0
  277. package/dist/modules/messages/local/SendMessageParameters.js +44 -0
  278. package/dist/modules/messages/local/SendMessageParameters.js.map +1 -0
  279. package/dist/modules/messages/transmission/MessageEnvelope.d.ts +24 -0
  280. package/dist/modules/messages/transmission/MessageEnvelope.js +81 -0
  281. package/dist/modules/messages/transmission/MessageEnvelope.js.map +1 -0
  282. package/dist/modules/messages/transmission/MessageEnvelopeRecipient.d.ts +16 -0
  283. package/dist/modules/messages/transmission/MessageEnvelopeRecipient.js +47 -0
  284. package/dist/modules/messages/transmission/MessageEnvelopeRecipient.js.map +1 -0
  285. package/dist/modules/messages/transmission/MessagePlain.d.ts +29 -0
  286. package/dist/modules/messages/transmission/MessagePlain.js +68 -0
  287. package/dist/modules/messages/transmission/MessagePlain.js.map +1 -0
  288. package/dist/modules/messages/transmission/MessageSignature.d.ts +11 -0
  289. package/dist/modules/messages/transmission/MessageSignature.js +36 -0
  290. package/dist/modules/messages/transmission/MessageSignature.js.map +1 -0
  291. package/dist/modules/messages/transmission/MessageSigned.d.ts +15 -0
  292. package/dist/modules/messages/transmission/MessageSigned.js +43 -0
  293. package/dist/modules/messages/transmission/MessageSigned.js.map +1 -0
  294. package/dist/modules/relationshipTemplates/RelationshipTemplateController.d.ts +26 -0
  295. package/dist/modules/relationshipTemplates/RelationshipTemplateController.js +156 -0
  296. package/dist/modules/relationshipTemplates/RelationshipTemplateController.js.map +1 -0
  297. package/dist/modules/relationshipTemplates/backbone/BackboneGetRelationshipTemplates.d.ts +17 -0
  298. package/dist/modules/relationshipTemplates/backbone/BackboneGetRelationshipTemplates.js +3 -0
  299. package/dist/modules/relationshipTemplates/backbone/BackboneGetRelationshipTemplates.js.map +1 -0
  300. package/dist/modules/relationshipTemplates/backbone/BackbonePostRelationshipTemplates.d.ts +9 -0
  301. package/dist/modules/relationshipTemplates/backbone/BackbonePostRelationshipTemplates.js +3 -0
  302. package/dist/modules/relationshipTemplates/backbone/BackbonePostRelationshipTemplates.js.map +1 -0
  303. package/dist/modules/relationshipTemplates/backbone/RelationshipTemplateClient.d.ts +11 -0
  304. package/dist/modules/relationshipTemplates/backbone/RelationshipTemplateClient.js +20 -0
  305. package/dist/modules/relationshipTemplates/backbone/RelationshipTemplateClient.js.map +1 -0
  306. package/dist/modules/relationshipTemplates/local/CachedRelationshipTemplate.d.ts +29 -0
  307. package/dist/modules/relationshipTemplates/local/CachedRelationshipTemplate.js +80 -0
  308. package/dist/modules/relationshipTemplates/local/CachedRelationshipTemplate.js.map +1 -0
  309. package/dist/modules/relationshipTemplates/local/RelationshipTemplate.d.ts +26 -0
  310. package/dist/modules/relationshipTemplates/local/RelationshipTemplate.js +85 -0
  311. package/dist/modules/relationshipTemplates/local/RelationshipTemplate.js.map +1 -0
  312. package/dist/modules/relationshipTemplates/local/SendRelationshipTemplateParameters.d.ts +14 -0
  313. package/dist/modules/relationshipTemplates/local/SendRelationshipTemplateParameters.js +44 -0
  314. package/dist/modules/relationshipTemplates/local/SendRelationshipTemplateParameters.js.map +1 -0
  315. package/dist/modules/relationshipTemplates/transmission/RelationshipTemplateContent.d.ts +16 -0
  316. package/dist/modules/relationshipTemplates/transmission/RelationshipTemplateContent.js +45 -0
  317. package/dist/modules/relationshipTemplates/transmission/RelationshipTemplateContent.js.map +1 -0
  318. package/dist/modules/relationshipTemplates/transmission/RelationshipTemplatePublicKey.d.ts +19 -0
  319. package/dist/modules/relationshipTemplates/transmission/RelationshipTemplatePublicKey.js +61 -0
  320. package/dist/modules/relationshipTemplates/transmission/RelationshipTemplatePublicKey.js.map +1 -0
  321. package/dist/modules/relationshipTemplates/transmission/RelationshipTemplateSigned.d.ts +12 -0
  322. package/dist/modules/relationshipTemplates/transmission/RelationshipTemplateSigned.js +39 -0
  323. package/dist/modules/relationshipTemplates/transmission/RelationshipTemplateSigned.js.map +1 -0
  324. package/dist/modules/relationships/RelationshipSecretController.d.ts +31 -0
  325. package/dist/modules/relationships/RelationshipSecretController.js +161 -0
  326. package/dist/modules/relationships/RelationshipSecretController.js.map +1 -0
  327. package/dist/modules/relationships/RelationshipsController.d.ts +47 -0
  328. package/dist/modules/relationships/RelationshipsController.js +472 -0
  329. package/dist/modules/relationships/RelationshipsController.js.map +1 -0
  330. package/dist/modules/relationships/backbone/BackboneGetRelationships.d.ts +18 -0
  331. package/dist/modules/relationships/backbone/BackboneGetRelationships.js +3 -0
  332. package/dist/modules/relationships/backbone/BackboneGetRelationships.js.map +1 -0
  333. package/dist/modules/relationships/backbone/BackboneGetRelationshipsChanges.d.ts +23 -0
  334. package/dist/modules/relationships/backbone/BackboneGetRelationshipsChanges.js +3 -0
  335. package/dist/modules/relationships/backbone/BackboneGetRelationshipsChanges.js.map +1 -0
  336. package/dist/modules/relationships/backbone/BackbonePostRelationshipsChanges.d.ts +8 -0
  337. package/dist/modules/relationships/backbone/BackbonePostRelationshipsChanges.js +3 -0
  338. package/dist/modules/relationships/backbone/BackbonePostRelationshipsChanges.js.map +1 -0
  339. package/dist/modules/relationships/backbone/RelationshipClient.d.ts +17 -0
  340. package/dist/modules/relationships/backbone/RelationshipClient.js +42 -0
  341. package/dist/modules/relationships/backbone/RelationshipClient.js.map +1 -0
  342. package/dist/modules/relationships/local/CachedRelationship.d.ts +18 -0
  343. package/dist/modules/relationships/local/CachedRelationship.js +53 -0
  344. package/dist/modules/relationships/local/CachedRelationship.js.map +1 -0
  345. package/dist/modules/relationships/local/Relationship.d.ts +37 -0
  346. package/dist/modules/relationships/local/Relationship.js +140 -0
  347. package/dist/modules/relationships/local/Relationship.js.map +1 -0
  348. package/dist/modules/relationships/local/SendRelationshipParameters.d.ts +13 -0
  349. package/dist/modules/relationships/local/SendRelationshipParameters.js +39 -0
  350. package/dist/modules/relationships/local/SendRelationshipParameters.js.map +1 -0
  351. package/dist/modules/relationships/transmission/RelationshipStatus.d.ts +8 -0
  352. package/dist/modules/relationships/transmission/RelationshipStatus.js +13 -0
  353. package/dist/modules/relationships/transmission/RelationshipStatus.js.map +1 -0
  354. package/dist/modules/relationships/transmission/changes/RelationshipChange.d.ts +27 -0
  355. package/dist/modules/relationships/transmission/changes/RelationshipChange.js +72 -0
  356. package/dist/modules/relationships/transmission/changes/RelationshipChange.js.map +1 -0
  357. package/dist/modules/relationships/transmission/changes/RelationshipChangeRequest.d.ts +20 -0
  358. package/dist/modules/relationships/transmission/changes/RelationshipChangeRequest.js +53 -0
  359. package/dist/modules/relationships/transmission/changes/RelationshipChangeRequest.js.map +1 -0
  360. package/dist/modules/relationships/transmission/changes/RelationshipChangeResponse.d.ts +20 -0
  361. package/dist/modules/relationships/transmission/changes/RelationshipChangeResponse.js +53 -0
  362. package/dist/modules/relationships/transmission/changes/RelationshipChangeResponse.js.map +1 -0
  363. package/dist/modules/relationships/transmission/changes/RelationshipChangeStatus.d.ts +6 -0
  364. package/dist/modules/relationships/transmission/changes/RelationshipChangeStatus.js +11 -0
  365. package/dist/modules/relationships/transmission/changes/RelationshipChangeStatus.js.map +1 -0
  366. package/dist/modules/relationships/transmission/changes/RelationshipChangeType.d.ts +5 -0
  367. package/dist/modules/relationships/transmission/changes/RelationshipChangeType.js +10 -0
  368. package/dist/modules/relationships/transmission/changes/RelationshipChangeType.js.map +1 -0
  369. package/dist/modules/relationships/transmission/requests/RelationshipCreationChangeRequestCipher.d.ts +13 -0
  370. package/dist/modules/relationships/transmission/requests/RelationshipCreationChangeRequestCipher.js +42 -0
  371. package/dist/modules/relationships/transmission/requests/RelationshipCreationChangeRequestCipher.js.map +1 -0
  372. package/dist/modules/relationships/transmission/requests/RelationshipCreationChangeRequestContent.d.ts +15 -0
  373. package/dist/modules/relationships/transmission/requests/RelationshipCreationChangeRequestContent.js +44 -0
  374. package/dist/modules/relationships/transmission/requests/RelationshipCreationChangeRequestContent.js.map +1 -0
  375. package/dist/modules/relationships/transmission/requests/RelationshipCreationChangeRequestSigned.d.ts +14 -0
  376. package/dist/modules/relationships/transmission/requests/RelationshipCreationChangeRequestSigned.js +44 -0
  377. package/dist/modules/relationships/transmission/requests/RelationshipCreationChangeRequestSigned.js.map +1 -0
  378. package/dist/modules/relationships/transmission/responses/RelationshipCreationChangeResponseCipher.d.ts +13 -0
  379. package/dist/modules/relationships/transmission/responses/RelationshipCreationChangeResponseCipher.js +42 -0
  380. package/dist/modules/relationships/transmission/responses/RelationshipCreationChangeResponseCipher.js.map +1 -0
  381. package/dist/modules/relationships/transmission/responses/RelationshipCreationChangeResponseContent.d.ts +12 -0
  382. package/dist/modules/relationships/transmission/responses/RelationshipCreationChangeResponseContent.js +38 -0
  383. package/dist/modules/relationships/transmission/responses/RelationshipCreationChangeResponseContent.js.map +1 -0
  384. package/dist/modules/relationships/transmission/responses/RelationshipCreationChangeResponseSigned.d.ts +14 -0
  385. package/dist/modules/relationships/transmission/responses/RelationshipCreationChangeResponseSigned.js +44 -0
  386. package/dist/modules/relationships/transmission/responses/RelationshipCreationChangeResponseSigned.js.map +1 -0
  387. package/dist/modules/secrets/SecretController.d.ts +39 -0
  388. package/dist/modules/secrets/SecretController.js +168 -0
  389. package/dist/modules/secrets/SecretController.js.map +1 -0
  390. package/dist/modules/secrets/data/SecretContainerCipher.d.ts +25 -0
  391. package/dist/modules/secrets/data/SecretContainerCipher.js +87 -0
  392. package/dist/modules/secrets/data/SecretContainerCipher.js.map +1 -0
  393. package/dist/modules/secrets/data/SecretContainerPlain.d.ts +25 -0
  394. package/dist/modules/secrets/data/SecretContainerPlain.js +76 -0
  395. package/dist/modules/secrets/data/SecretContainerPlain.js.map +1 -0
  396. package/dist/modules/sync/ChangedItems.d.ts +9 -0
  397. package/dist/modules/sync/ChangedItems.js +17 -0
  398. package/dist/modules/sync/ChangedItems.js.map +1 -0
  399. package/dist/modules/sync/DatawalletModificationMapper.d.ts +7 -0
  400. package/dist/modules/sync/DatawalletModificationMapper.js +62 -0
  401. package/dist/modules/sync/DatawalletModificationMapper.js.map +1 -0
  402. package/dist/modules/sync/DatawalletModificationsProcessor.d.ts +21 -0
  403. package/dist/modules/sync/DatawalletModificationsProcessor.js +111 -0
  404. package/dist/modules/sync/DatawalletModificationsProcessor.js.map +1 -0
  405. package/dist/modules/sync/ExternalEventsProcessor.d.ts +19 -0
  406. package/dist/modules/sync/ExternalEventsProcessor.js +83 -0
  407. package/dist/modules/sync/ExternalEventsProcessor.js.map +1 -0
  408. package/dist/modules/sync/SyncController.d.ts +37 -0
  409. package/dist/modules/sync/SyncController.js +214 -0
  410. package/dist/modules/sync/SyncController.js.map +1 -0
  411. package/dist/modules/sync/SynchronizedCollection.d.ts +18 -0
  412. package/dist/modules/sync/SynchronizedCollection.js +163 -0
  413. package/dist/modules/sync/SynchronizedCollection.js.map +1 -0
  414. package/dist/modules/sync/WhatToSync.d.ts +1 -0
  415. package/dist/modules/sync/WhatToSync.js +3 -0
  416. package/dist/modules/sync/WhatToSync.js.map +1 -0
  417. package/dist/modules/sync/backbone/BackboneDatawalletModification.d.ts +11 -0
  418. package/dist/modules/sync/backbone/BackboneDatawalletModification.js +3 -0
  419. package/dist/modules/sync/backbone/BackboneDatawalletModification.js.map +1 -0
  420. package/dist/modules/sync/backbone/BackboneExternalEvent.d.ts +8 -0
  421. package/dist/modules/sync/backbone/BackboneExternalEvent.js +3 -0
  422. package/dist/modules/sync/backbone/BackboneExternalEvent.js.map +1 -0
  423. package/dist/modules/sync/backbone/BackboneSyncRun.d.ts +9 -0
  424. package/dist/modules/sync/backbone/BackboneSyncRun.js +3 -0
  425. package/dist/modules/sync/backbone/BackboneSyncRun.js.map +1 -0
  426. package/dist/modules/sync/backbone/CreateDatawalletModifications.d.ts +19 -0
  427. package/dist/modules/sync/backbone/CreateDatawalletModifications.js +3 -0
  428. package/dist/modules/sync/backbone/CreateDatawalletModifications.js.map +1 -0
  429. package/dist/modules/sync/backbone/FinalizeSyncRun.d.ts +23 -0
  430. package/dist/modules/sync/backbone/FinalizeSyncRun.js +3 -0
  431. package/dist/modules/sync/backbone/FinalizeSyncRun.js.map +1 -0
  432. package/dist/modules/sync/backbone/GetDatawalletModifications.d.ts +3 -0
  433. package/dist/modules/sync/backbone/GetDatawalletModifications.js +3 -0
  434. package/dist/modules/sync/backbone/GetDatawalletModifications.js.map +1 -0
  435. package/dist/modules/sync/backbone/StartSyncRun.d.ts +9 -0
  436. package/dist/modules/sync/backbone/StartSyncRun.js +9 -0
  437. package/dist/modules/sync/backbone/StartSyncRun.js.map +1 -0
  438. package/dist/modules/sync/backbone/SyncClient.d.ts +15 -0
  439. package/dist/modules/sync/backbone/SyncClient.js +23 -0
  440. package/dist/modules/sync/backbone/SyncClient.js.map +1 -0
  441. package/dist/modules/sync/local/DatawalletModification.d.ts +30 -0
  442. package/dist/modules/sync/local/DatawalletModification.js +71 -0
  443. package/dist/modules/sync/local/DatawalletModification.js.map +1 -0
  444. package/dist/modules/tokens/AnonymousTokenController.d.ts +11 -0
  445. package/dist/modules/tokens/AnonymousTokenController.js +47 -0
  446. package/dist/modules/tokens/AnonymousTokenController.js.map +1 -0
  447. package/dist/modules/tokens/TokenController.d.ts +24 -0
  448. package/dist/modules/tokens/TokenController.js +137 -0
  449. package/dist/modules/tokens/TokenController.js.map +1 -0
  450. package/dist/modules/tokens/backbone/AnonymousTokenClient.d.ts +6 -0
  451. package/dist/modules/tokens/backbone/AnonymousTokenClient.js +11 -0
  452. package/dist/modules/tokens/backbone/AnonymousTokenClient.js.map +1 -0
  453. package/dist/modules/tokens/backbone/BackboneGetTokens.d.ts +11 -0
  454. package/dist/modules/tokens/backbone/BackboneGetTokens.js +3 -0
  455. package/dist/modules/tokens/backbone/BackboneGetTokens.js.map +1 -0
  456. package/dist/modules/tokens/backbone/BackbonePostTokens.d.ts +9 -0
  457. package/dist/modules/tokens/backbone/BackbonePostTokens.js +3 -0
  458. package/dist/modules/tokens/backbone/BackbonePostTokens.js.map +1 -0
  459. package/dist/modules/tokens/backbone/TokenClient.d.ts +11 -0
  460. package/dist/modules/tokens/backbone/TokenClient.js +20 -0
  461. package/dist/modules/tokens/backbone/TokenClient.js.map +1 -0
  462. package/dist/modules/tokens/local/CachedToken.d.ts +18 -0
  463. package/dist/modules/tokens/local/CachedToken.js +53 -0
  464. package/dist/modules/tokens/local/CachedToken.js.map +1 -0
  465. package/dist/modules/tokens/local/SendTokenParameters.d.ts +14 -0
  466. package/dist/modules/tokens/local/SendTokenParameters.js +43 -0
  467. package/dist/modules/tokens/local/SendTokenParameters.js.map +1 -0
  468. package/dist/modules/tokens/local/Token.d.ts +28 -0
  469. package/dist/modules/tokens/local/Token.js +91 -0
  470. package/dist/modules/tokens/local/Token.js.map +1 -0
  471. package/dist/modules/tokens/transmission/TokenContentDeviceSharedSecret.d.ts +10 -0
  472. package/dist/modules/tokens/transmission/TokenContentDeviceSharedSecret.js +34 -0
  473. package/dist/modules/tokens/transmission/TokenContentDeviceSharedSecret.js.map +1 -0
  474. package/dist/modules/tokens/transmission/TokenContentFile.d.ts +12 -0
  475. package/dist/modules/tokens/transmission/TokenContentFile.js +39 -0
  476. package/dist/modules/tokens/transmission/TokenContentFile.js.map +1 -0
  477. package/dist/modules/tokens/transmission/TokenContentRelationshipTemplate.d.ts +12 -0
  478. package/dist/modules/tokens/transmission/TokenContentRelationshipTemplate.js +39 -0
  479. package/dist/modules/tokens/transmission/TokenContentRelationshipTemplate.js.map +1 -0
  480. package/dist/modules/tokens/transmission/TokenReference.d.ts +14 -0
  481. package/dist/modules/tokens/transmission/TokenReference.js +71 -0
  482. package/dist/modules/tokens/transmission/TokenReference.js.map +1 -0
  483. package/dist/util/PasswordGenerator.d.ts +28 -0
  484. package/dist/util/PasswordGenerator.js +179 -0
  485. package/dist/util/PasswordGenerator.js.map +1 -0
  486. package/dist/util/Random.d.ts +50 -0
  487. package/dist/util/Random.js +129 -0
  488. package/dist/util/Random.js.map +1 -0
  489. package/dist/util/index.d.ts +2 -0
  490. package/dist/util/index.js +15 -0
  491. package/dist/util/index.js.map +1 -0
  492. package/lib-web/nmshd.transport.js +54733 -0
  493. package/lib-web/nmshd.transport.js.map +1 -0
  494. package/lib-web/nmshd.transport.min.js +3 -0
  495. package/lib-web/nmshd.transport.min.js.map +1 -0
  496. package/package.json +109 -0
  497. package/ui5.yaml +9 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RelationshipTemplate.js","sourceRoot":"","sources":["../../../../src/modules/relationshipTemplates/local/RelationshipTemplate.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,kDAA8D;AAC9D,0CAAiE;AACjE,uDAAyC;AACzC,wCAAuE;AACvE,2DAAkE;AAClE,6EAAsG;AAYtG,IAAa,oBAAoB,4BAAjC,MAAa,oBAAqB,SAAQ,yBAAkB;IAA5D;;QACoB,wBAAmB,GAAG;YAClC,OAAO;YACP,UAAU;YACV,IAAA,yBAAM,EAAuB,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;YAChD,IAAA,yBAAM,EAAuB,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC;SAC/C,CAAA;QAEe,uBAAkB,GAAG;YACjC,IAAA,yBAAM,EAAuB,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC;YAC/C,IAAA,yBAAM,EAAuB,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,kBAAk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AS,GAAE;8BACgB,mBAAQ;gEAAA;AAnC3B,oBAAoB;IADhC,IAAA,gBAAI,EAAC,sBAAsB,CAAC;GAChB,oBAAoB,CAwDhC;AAxDY,oDAAoB"}
@@ -0,0 +1,14 @@
1
+ import { ISerializableAsync, SerializableAsync } from "@js-soft/ts-serval";
2
+ import { CoreDate, CoreSerializableAsync, ICoreSerializableAsync } from "../../../core";
3
+ export interface ISendRelationshipTemplateParameters extends ICoreSerializableAsync {
4
+ content: ISerializableAsync;
5
+ expiresAt: CoreDate;
6
+ maxNumberOfRelationships?: number;
7
+ }
8
+ export declare class SendRelationshipTemplateParameters extends CoreSerializableAsync implements ISendRelationshipTemplateParameters {
9
+ content: SerializableAsync;
10
+ expiresAt: CoreDate;
11
+ maxNumberOfRelationships?: number;
12
+ static from(value: ISendRelationshipTemplateParameters): Promise<SendRelationshipTemplateParameters>;
13
+ static deserialize(value: string): Promise<SendRelationshipTemplateParameters>;
14
+ }
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var SendRelationshipTemplateParameters_1;
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ exports.SendRelationshipTemplateParameters = void 0;
14
+ const ts_serval_1 = require("@js-soft/ts-serval");
15
+ const core_1 = require("../../../core");
16
+ const CachedRelationshipTemplate_1 = require("./CachedRelationshipTemplate");
17
+ let SendRelationshipTemplateParameters = SendRelationshipTemplateParameters_1 = class SendRelationshipTemplateParameters extends core_1.CoreSerializableAsync {
18
+ static async from(value) {
19
+ return await super.fromT(value, SendRelationshipTemplateParameters_1);
20
+ }
21
+ static async deserialize(value) {
22
+ return await super.deserializeT(value, SendRelationshipTemplateParameters_1);
23
+ }
24
+ };
25
+ __decorate([
26
+ (0, ts_serval_1.validate)(),
27
+ (0, ts_serval_1.serialize)(),
28
+ __metadata("design:type", ts_serval_1.SerializableAsync)
29
+ ], SendRelationshipTemplateParameters.prototype, "content", void 0);
30
+ __decorate([
31
+ (0, ts_serval_1.validate)(),
32
+ (0, ts_serval_1.serialize)(),
33
+ __metadata("design:type", core_1.CoreDate)
34
+ ], SendRelationshipTemplateParameters.prototype, "expiresAt", void 0);
35
+ __decorate([
36
+ (0, ts_serval_1.validate)({ nullable: true, customValidator: CachedRelationshipTemplate_1.CachedRelationshipTemplate.validateMaxNumberOfRelationships }),
37
+ (0, ts_serval_1.serialize)(),
38
+ __metadata("design:type", Number)
39
+ ], SendRelationshipTemplateParameters.prototype, "maxNumberOfRelationships", void 0);
40
+ SendRelationshipTemplateParameters = SendRelationshipTemplateParameters_1 = __decorate([
41
+ (0, ts_serval_1.type)("SendRelationshipTemplateParameters")
42
+ ], SendRelationshipTemplateParameters);
43
+ exports.SendRelationshipTemplateParameters = SendRelationshipTemplateParameters;
44
+ //# sourceMappingURL=SendRelationshipTemplateParameters.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SendRelationshipTemplateParameters.js","sourceRoot":"","sources":["../../../../src/modules/relationshipTemplates/local/SendRelationshipTemplateParameters.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,kDAAqG;AACrG,wCAAuF;AACvF,6EAAyE;AASzE,IAAa,kCAAkC,0CAA/C,MAAa,kCACT,SAAQ,4BAAqB;IAetB,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,KAA0C;QAC/D,OAAO,MAAM,KAAK,CAAC,KAAK,CAAC,KAAK,EAAE,oCAAkC,CAAC,CAAA;IACvE,CAAC;IAEM,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,KAAa;QACzC,OAAO,MAAM,KAAK,CAAC,YAAY,CAAC,KAAK,EAAE,oCAAkC,CAAC,CAAA;IAC9E,CAAC;CACJ,CAAA;AAjBG;IAFC,IAAA,oBAAQ,GAAE;IACV,IAAA,qBAAS,GAAE;8BACI,6BAAiB;mEAAA;AAIjC;IAFC,IAAA,oBAAQ,GAAE;IACV,IAAA,qBAAS,GAAE;8BACM,eAAQ;qEAAA;AAI1B;IAFC,IAAA,oBAAQ,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,eAAe,EAAE,uDAA0B,CAAC,gCAAgC,EAAE,CAAC;IAC1G,IAAA,qBAAS,GAAE;;oFAC4B;AAd/B,kCAAkC;IAD9C,IAAA,gBAAI,EAAC,oCAAoC,CAAC;GAC9B,kCAAkC,CAuB9C;AAvBY,gFAAkC"}
@@ -0,0 +1,16 @@
1
+ import { ISerializableAsync, SerializableAsync } from "@js-soft/ts-serval";
2
+ import { CoreSerializableAsync, ICoreSerializableAsync } from "../../../core";
3
+ import { Identity, IIdentity } from "../../accounts/data/Identity";
4
+ import { IRelationshipTemplatePublicKey, RelationshipTemplatePublicKey } from "./RelationshipTemplatePublicKey";
5
+ export interface IRelationshipTemplateContent extends ICoreSerializableAsync {
6
+ identity: IIdentity;
7
+ templateKey: IRelationshipTemplatePublicKey;
8
+ content: ISerializableAsync;
9
+ }
10
+ export declare class RelationshipTemplateContent extends CoreSerializableAsync implements IRelationshipTemplateContent {
11
+ identity: Identity;
12
+ templateKey: RelationshipTemplatePublicKey;
13
+ content: SerializableAsync;
14
+ static from(value: IRelationshipTemplateContent): Promise<RelationshipTemplateContent>;
15
+ static deserialize(value: string): Promise<RelationshipTemplateContent>;
16
+ }
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var RelationshipTemplateContent_1;
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ exports.RelationshipTemplateContent = void 0;
14
+ const ts_serval_1 = require("@js-soft/ts-serval");
15
+ const core_1 = require("../../../core");
16
+ const Identity_1 = require("../../accounts/data/Identity");
17
+ const RelationshipTemplatePublicKey_1 = require("./RelationshipTemplatePublicKey");
18
+ let RelationshipTemplateContent = RelationshipTemplateContent_1 = class RelationshipTemplateContent extends core_1.CoreSerializableAsync {
19
+ static async from(value) {
20
+ return await super.fromT(value, RelationshipTemplateContent_1);
21
+ }
22
+ static async deserialize(value) {
23
+ return await super.deserializeT(value, RelationshipTemplateContent_1);
24
+ }
25
+ };
26
+ __decorate([
27
+ (0, ts_serval_1.validate)(),
28
+ (0, ts_serval_1.serialize)(),
29
+ __metadata("design:type", Identity_1.Identity)
30
+ ], RelationshipTemplateContent.prototype, "identity", void 0);
31
+ __decorate([
32
+ (0, ts_serval_1.validate)(),
33
+ (0, ts_serval_1.serialize)(),
34
+ __metadata("design:type", RelationshipTemplatePublicKey_1.RelationshipTemplatePublicKey)
35
+ ], RelationshipTemplateContent.prototype, "templateKey", void 0);
36
+ __decorate([
37
+ (0, ts_serval_1.validate)(),
38
+ (0, ts_serval_1.serialize)(),
39
+ __metadata("design:type", ts_serval_1.SerializableAsync)
40
+ ], RelationshipTemplateContent.prototype, "content", void 0);
41
+ RelationshipTemplateContent = RelationshipTemplateContent_1 = __decorate([
42
+ (0, ts_serval_1.type)("RelationshipTemplateContent")
43
+ ], RelationshipTemplateContent);
44
+ exports.RelationshipTemplateContent = RelationshipTemplateContent;
45
+ //# sourceMappingURL=RelationshipTemplateContent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RelationshipTemplateContent.js","sourceRoot":"","sources":["../../../../src/modules/relationshipTemplates/transmission/RelationshipTemplateContent.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,kDAAqG;AACrG,wCAA6E;AAC7E,2DAAkE;AAClE,mFAA+G;AAS/G,IAAa,2BAA2B,mCAAxC,MAAa,2BAA4B,SAAQ,4BAAqB;IAa3D,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,KAAmC;QACxD,OAAO,MAAM,KAAK,CAAC,KAAK,CAAC,KAAK,EAAE,6BAA2B,CAAC,CAAA;IAChE,CAAC;IAEM,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,KAAa;QACzC,OAAO,MAAM,KAAK,CAAC,YAAY,CAAC,KAAK,EAAE,6BAA2B,CAAC,CAAA;IACvE,CAAC;CACJ,CAAA;AAjBG;IAFC,IAAA,oBAAQ,GAAE;IACV,IAAA,qBAAS,GAAE;8BACK,mBAAQ;6DAAA;AAIzB;IAFC,IAAA,oBAAQ,GAAE;IACV,IAAA,qBAAS,GAAE;8BACQ,6DAA6B;gEAAA;AAIjD;IAFC,IAAA,oBAAQ,GAAE;IACV,IAAA,qBAAS,GAAE;8BACI,6BAAiB;4DAAA;AAXxB,2BAA2B;IADvC,IAAA,gBAAI,EAAC,6BAA6B,CAAC;GACvB,2BAA2B,CAoBvC;AApBY,kEAA2B"}
@@ -0,0 +1,19 @@
1
+ import { ISerialized } from "@js-soft/ts-serval";
2
+ import { CoreBuffer, CryptoExchangeAlgorithm, CryptoExchangePublicKey, ICryptoExchangePublicKey, ICryptoExchangePublicKeySerialized } from "@nmshd/crypto";
3
+ import { CoreId, ICoreId } from "../../../core";
4
+ export interface IRelationshipTemplatePublicKey extends ICryptoExchangePublicKey {
5
+ id: ICoreId;
6
+ }
7
+ export interface IRelationshipTemplatePublicKeySerialized extends ICryptoExchangePublicKeySerialized, ISerialized {
8
+ id: string;
9
+ }
10
+ export declare class RelationshipTemplatePublicKey extends CryptoExchangePublicKey implements IRelationshipTemplatePublicKey {
11
+ id: CoreId;
12
+ constructor(id: CoreId, algorithm: CryptoExchangeAlgorithm, publicKey: CoreBuffer);
13
+ toJSON(verbose?: boolean): IRelationshipTemplatePublicKeySerialized;
14
+ toBase64(): string;
15
+ serialize(verbose?: boolean): string;
16
+ static fromJSON(value: IRelationshipTemplatePublicKeySerialized): Promise<RelationshipTemplatePublicKey>;
17
+ static from(value: IRelationshipTemplatePublicKey): Promise<RelationshipTemplatePublicKey>;
18
+ static deserialize(value: string): Promise<RelationshipTemplatePublicKey>;
19
+ }
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var RelationshipTemplatePublicKey_1;
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ exports.RelationshipTemplatePublicKey = void 0;
14
+ const ts_serval_1 = require("@js-soft/ts-serval");
15
+ const crypto_1 = require("@nmshd/crypto");
16
+ const core_1 = require("../../../core");
17
+ let RelationshipTemplatePublicKey = RelationshipTemplatePublicKey_1 = class RelationshipTemplatePublicKey extends crypto_1.CryptoExchangePublicKey {
18
+ constructor(id, algorithm, publicKey) {
19
+ super(algorithm, publicKey);
20
+ this.id = id;
21
+ }
22
+ toJSON(verbose = true) {
23
+ const obj = {
24
+ id: this.id.toString(),
25
+ pub: this.publicKey.toBase64URL(),
26
+ alg: this.algorithm
27
+ };
28
+ if (verbose) {
29
+ obj["@type"] = "RelationshipTemplatePublicKey";
30
+ }
31
+ return obj;
32
+ }
33
+ toBase64() {
34
+ return crypto_1.CoreBuffer.utf8_base64(this.serialize());
35
+ }
36
+ serialize(verbose = true) {
37
+ return JSON.stringify(this.toJSON(verbose));
38
+ }
39
+ static async fromJSON(value) {
40
+ const key = await crypto_1.CryptoExchangePublicKey.fromJSON(value);
41
+ return new RelationshipTemplatePublicKey_1(core_1.CoreId.from(value.id), key.algorithm, key.publicKey);
42
+ }
43
+ static from(value) {
44
+ return Promise.resolve(new RelationshipTemplatePublicKey_1(core_1.CoreId.from(value.id), value.algorithm, value.publicKey));
45
+ }
46
+ static async deserialize(value) {
47
+ const obj = JSON.parse(value);
48
+ return await this.fromJSON(obj);
49
+ }
50
+ };
51
+ __decorate([
52
+ (0, ts_serval_1.serialize)({ enforceString: true }),
53
+ (0, ts_serval_1.validate)(),
54
+ __metadata("design:type", core_1.CoreId)
55
+ ], RelationshipTemplatePublicKey.prototype, "id", void 0);
56
+ RelationshipTemplatePublicKey = RelationshipTemplatePublicKey_1 = __decorate([
57
+ (0, ts_serval_1.type)("RelationshipTemplatePublicKey"),
58
+ __metadata("design:paramtypes", [core_1.CoreId, Number, crypto_1.CoreBuffer])
59
+ ], RelationshipTemplatePublicKey);
60
+ exports.RelationshipTemplatePublicKey = RelationshipTemplatePublicKey;
61
+ //# sourceMappingURL=RelationshipTemplatePublicKey.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RelationshipTemplatePublicKey.js","sourceRoot":"","sources":["../../../../src/modules/relationshipTemplates/transmission/RelationshipT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AAC,aAAM,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,SAAS,EAAE,KAAK,CAAC,SAAS,CAAC,CAC7F,CAAA;IACL,CAAC;IAEM,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,KAAa;QACzC,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;QAC7B,OAAO,MAAM,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAA;IACnC,CAAC;CACJ,CAAA;AA7CG;IAFC,IAAA,qBAAS,EAAC,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC;IAClC,IAAA,oBAAQ,GAAE;8BACA,aAAM;yDAAA;AAHR,6BAA6B;IADzC,IAAA,gBAAI,EAAC,+BAA+B,CAAC;qCAMX,aAAM,UAAiD,mBAAU;GAL/E,6BAA6B,CAgDzC;AAhDY,sEAA6B"}
@@ -0,0 +1,12 @@
1
+ import { CryptoSignature, ICryptoSignature } from "@nmshd/crypto";
2
+ import { CoreSerializableAsync, ICoreSerializableAsync } from "../../../core";
3
+ export interface IRelationshipTemplateSigned extends ICoreSerializableAsync {
4
+ serializedTemplate: string;
5
+ deviceSignature: ICryptoSignature;
6
+ }
7
+ export declare class RelationshipTemplateSigned extends CoreSerializableAsync implements IRelationshipTemplateSigned {
8
+ serializedTemplate: string;
9
+ deviceSignature: CryptoSignature;
10
+ static from(value: IRelationshipTemplateSigned): Promise<RelationshipTemplateSigned>;
11
+ static deserialize(value: string): Promise<RelationshipTemplateSigned>;
12
+ }
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var RelationshipTemplateSigned_1;
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ exports.RelationshipTemplateSigned = void 0;
14
+ const ts_serval_1 = require("@js-soft/ts-serval");
15
+ const crypto_1 = require("@nmshd/crypto");
16
+ const core_1 = require("../../../core");
17
+ let RelationshipTemplateSigned = RelationshipTemplateSigned_1 = class RelationshipTemplateSigned extends core_1.CoreSerializableAsync {
18
+ static async from(value) {
19
+ return await super.fromT(value, RelationshipTemplateSigned_1);
20
+ }
21
+ static async deserialize(value) {
22
+ return await super.deserializeT(value, RelationshipTemplateSigned_1);
23
+ }
24
+ };
25
+ __decorate([
26
+ (0, ts_serval_1.validate)(),
27
+ (0, ts_serval_1.serialize)(),
28
+ __metadata("design:type", String)
29
+ ], RelationshipTemplateSigned.prototype, "serializedTemplate", void 0);
30
+ __decorate([
31
+ (0, ts_serval_1.validate)(),
32
+ (0, ts_serval_1.serialize)(),
33
+ __metadata("design:type", crypto_1.CryptoSignature)
34
+ ], RelationshipTemplateSigned.prototype, "deviceSignature", void 0);
35
+ RelationshipTemplateSigned = RelationshipTemplateSigned_1 = __decorate([
36
+ (0, ts_serval_1.type)("RelationshipTemplateSigned")
37
+ ], RelationshipTemplateSigned);
38
+ exports.RelationshipTemplateSigned = RelationshipTemplateSigned;
39
+ //# sourceMappingURL=RelationshipTemplateSigned.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RelationshipTemplateSigned.js","sourceRoot":"","sources":["../../../../src/modules/relationshipTemplates/transmission/RelationshipTemplateSigned.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,kDAA8D;AAC9D,0CAAiE;AACjE,wCAA6E;AAQ7E,IAAa,0BAA0B,kCAAvC,MAAa,0BAA2B,SAAQ,4BAAqB;IAS1D,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,KAAkC;QACvD,OAAO,MAAM,KAAK,CAAC,KAAK,CAAC,KAAK,EAAE,4BAA0B,CAAC,CAAA;IAC/D,CAAC;IAEM,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,KAAa;QACzC,OAAO,MAAM,KAAK,CAAC,YAAY,CAAC,KAAK,EAAE,4BAA0B,CAAC,CAAA;IACtE,CAAC;CACJ,CAAA;AAbG;IAFC,IAAA,oBAAQ,GAAE;IACV,IAAA,qBAAS,GAAE;;sEACqB;AAIjC;IAFC,IAAA,oBAAQ,GAAE;IACV,IAAA,qBAAS,GAAE;8BACY,wBAAe;mEAAA;AAP9B,0BAA0B;IADtC,IAAA,gBAAI,EAAC,4BAA4B,CAAC;GACtB,0BAA0B,CAgBtC;AAhBY,gEAA0B"}
@@ -0,0 +1,31 @@
1
+ import { Serializable, SerializableAsync } from "@js-soft/ts-serval";
2
+ import { CoreBuffer, CryptoCipher, CryptoRelationshipPublicRequest, CryptoRelationshipPublicResponse, CryptoSecretKey, CryptoSignature, CryptoSignaturePublicKey } from "@nmshd/crypto";
3
+ import { CoreId } from "../../core";
4
+ import { AccountController } from "../accounts/AccountController";
5
+ import { Identity } from "../accounts/data/Identity";
6
+ import { CachedRelationshipTemplate } from "../relationshipTemplates/local/CachedRelationshipTemplate";
7
+ import { RelationshipTemplatePublicKey } from "../relationshipTemplates/transmission/RelationshipTemplatePublicKey";
8
+ import { SecretContainerCipher } from "../secrets/data/SecretContainerCipher";
9
+ import { SecretController } from "../secrets/SecretController";
10
+ export declare class RelationshipSecretController extends SecretController {
11
+ private readonly cache;
12
+ constructor(parent: AccountController);
13
+ private getSecret;
14
+ createRequestorSecrets(template: CachedRelationshipTemplate, relationshipSecretId: CoreId): Promise<CryptoRelationshipPublicRequest>;
15
+ createTemplatorSecrets(relationshipSecretId: CoreId, template: CachedRelationshipTemplate, publicRequestCrypto: CryptoRelationshipPublicRequest): Promise<SecretContainerCipher>;
16
+ getPublicResponse(relationshipSecretId: CoreId): Promise<CryptoRelationshipPublicResponse>;
17
+ convertSecrets(relationshipSecretId: CoreId, response: CryptoRelationshipPublicResponse): Promise<SecretContainerCipher>;
18
+ deleteSecretForRequest(peerIdentity: Identity): Promise<boolean>;
19
+ decryptTemplate(cipher: CryptoCipher, secretKey: CryptoSecretKey): Promise<CoreBuffer>;
20
+ verifyTemplate(buffer: CoreBuffer, signature: CryptoSignature, templatorDeviceKey: CryptoSignaturePublicKey): Promise<boolean>;
21
+ encryptRequest(relationshipSecretId: CoreId, content: SerializableAsync | Serializable | string | CoreBuffer): Promise<CryptoCipher>;
22
+ encrypt(relationshipSecretId: CoreId, content: SerializableAsync | Serializable | string): Promise<CryptoCipher>;
23
+ decryptRequest(relationshipSecretId: CoreId, cipher: CryptoCipher): Promise<CoreBuffer>;
24
+ createTemplateKey(): Promise<RelationshipTemplatePublicKey>;
25
+ decryptPeer(relationshipSecretId: CoreId, cipher: CryptoCipher, omitCounterCheck?: boolean): Promise<CoreBuffer>;
26
+ hasCryptoRelationshipSecrets(relationshipSecretId: CoreId): Promise<boolean>;
27
+ decryptOwn(relationshipSecretId: CoreId, cipher: CryptoCipher): Promise<CoreBuffer>;
28
+ sign(relationshipSecretId: CoreId, content: SerializableAsync | Serializable | string | CoreBuffer): Promise<CryptoSignature>;
29
+ verifyOwn(relationshipSecretId: CoreId, content: SerializableAsync | Serializable | string | CoreBuffer, signature: CryptoSignature): Promise<boolean>;
30
+ verifyPeer(relationshipSecretId: CoreId, content: SerializableAsync | Serializable | string | CoreBuffer, signature: CryptoSignature): Promise<boolean>;
31
+ }
@@ -0,0 +1,161 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RelationshipSecretController = void 0;
4
+ const crypto_1 = require("@nmshd/crypto");
5
+ const core_1 = require("../../core");
6
+ const CoreIds_1 = require("../../core/CoreIds");
7
+ const CoreUtil_1 = require("../../core/CoreUtil");
8
+ const TransportErrors_1 = require("../../core/TransportErrors");
9
+ const RelationshipTemplatePublicKey_1 = require("../relationshipTemplates/transmission/RelationshipTemplatePublicKey");
10
+ const SecretController_1 = require("../secrets/SecretController");
11
+ class RelationshipSecretController extends SecretController_1.SecretController {
12
+ constructor(parent) {
13
+ super(parent, core_1.ControllerName.RelationshipSecret);
14
+ this.cache = new Map();
15
+ }
16
+ async getSecret(relationshipSecretId) {
17
+ const secretIdAsString = relationshipSecretId.toString();
18
+ const cachedSecrets = this.cache.get(relationshipSecretId);
19
+ if (cachedSecrets) {
20
+ return cachedSecrets;
21
+ }
22
+ const secretContainer = await this.loadActiveSecretByName(secretIdAsString);
23
+ if (!secretContainer) {
24
+ throw TransportErrors_1.TransportErrors.general
25
+ .recordNotFound("CryptoRelationshipRequestSecrets | CryptoRelationshipSecrets", secretIdAsString)
26
+ .logWith(this._log);
27
+ }
28
+ if (!(secretContainer.secret instanceof crypto_1.CryptoRelationshipRequestSecrets) &&
29
+ !(secretContainer.secret instanceof crypto_1.CryptoRelationshipSecrets)) {
30
+ throw TransportErrors_1.TransportErrors.secrets.wrongSecretType(secretIdAsString).logWith(this._log);
31
+ }
32
+ const secret = secretContainer.secret;
33
+ this.cache.set(relationshipSecretId, secret);
34
+ return secret;
35
+ }
36
+ async createRequestorSecrets(template, relationshipSecretId) {
37
+ const secrets = await crypto_1.CryptoRelationshipRequestSecrets.fromPeer(template.templateKey, template.identity.publicKey);
38
+ await this.storeSecret(secrets, relationshipSecretId.toString(), "");
39
+ const publicRequest = await secrets.toPublicRequest();
40
+ return publicRequest;
41
+ }
42
+ async createTemplatorSecrets(relationshipSecretId, template, publicRequestCrypto) {
43
+ const templateKeyId = template.templateKey.id.toString();
44
+ const exchangeKeypairContainer = await this.loadActiveSecretByName(templateKeyId);
45
+ if (!exchangeKeypairContainer) {
46
+ throw TransportErrors_1.TransportErrors.general.recordNotFound(crypto_1.CryptoExchangeKeypair, templateKeyId).logWith(this._log);
47
+ }
48
+ if (!(exchangeKeypairContainer.secret instanceof crypto_1.CryptoExchangeKeypair)) {
49
+ throw TransportErrors_1.TransportErrors.secrets.wrongSecretType(templateKeyId).logWith(this._log);
50
+ }
51
+ const exchangeKeypair = exchangeKeypairContainer.secret;
52
+ const secrets = await crypto_1.CryptoRelationshipSecrets.fromRelationshipRequest(publicRequestCrypto, exchangeKeypair);
53
+ const secretContainer = await this.storeSecret(secrets, relationshipSecretId.toString());
54
+ return secretContainer;
55
+ }
56
+ async getPublicResponse(relationshipSecretId) {
57
+ const secret = await this.loadActiveSecretByName(relationshipSecretId.toString());
58
+ if (!secret) {
59
+ throw TransportErrors_1.TransportErrors.general
60
+ .recordNotFound(crypto_1.CryptoRelationshipSecrets, relationshipSecretId.toString())
61
+ .logWith(this._log);
62
+ }
63
+ if (!(secret.secret instanceof crypto_1.CryptoRelationshipSecrets)) {
64
+ throw TransportErrors_1.TransportErrors.secrets.wrongSecretType(secret.id.toString()).logWith(this._log);
65
+ }
66
+ const publicResponse = await secret.secret.toPublicResponse();
67
+ return publicResponse;
68
+ }
69
+ async convertSecrets(relationshipSecretId, response) {
70
+ const request = await this.getSecret(relationshipSecretId);
71
+ if (request instanceof crypto_1.CryptoRelationshipSecrets) {
72
+ throw TransportErrors_1.TransportErrors.secrets.wrongSecretType().logWith(this._log);
73
+ }
74
+ const secrets = await crypto_1.CryptoRelationshipSecrets.fromRelationshipResponse(response, request);
75
+ const container = await this.succeedSecretWithName(secrets, relationshipSecretId.toString());
76
+ this.cache.set(relationshipSecretId, secrets);
77
+ return container;
78
+ }
79
+ async deleteSecretForRequest(peerIdentity) {
80
+ const secret = await this.loadActiveSecretByName(`request_to_${peerIdentity.address}`);
81
+ if (!secret) {
82
+ return false;
83
+ }
84
+ return await this.deleteSecretById(secret.id);
85
+ }
86
+ async decryptTemplate(cipher, secretKey) {
87
+ const decrypted = await core_1.CoreCrypto.decrypt(cipher, secretKey);
88
+ return decrypted;
89
+ }
90
+ async verifyTemplate(buffer, signature, templatorDeviceKey) {
91
+ return await core_1.CoreCrypto.verify(buffer, signature, templatorDeviceKey);
92
+ }
93
+ async encryptRequest(relationshipSecretId, content) {
94
+ const buffer = CoreUtil_1.CoreUtil.toBuffer(content);
95
+ const secrets = await this.getSecret(relationshipSecretId);
96
+ if (!(secrets instanceof crypto_1.CryptoRelationshipRequestSecrets)) {
97
+ throw TransportErrors_1.TransportErrors.secrets.wrongSecretType(secrets.id).logWith(this._log);
98
+ }
99
+ return await secrets.encryptRequest(buffer);
100
+ }
101
+ async encrypt(relationshipSecretId, content) {
102
+ const buffer = CoreUtil_1.CoreUtil.toBuffer(content);
103
+ const secrets = await this.getSecret(relationshipSecretId);
104
+ if (!(secrets instanceof crypto_1.CryptoRelationshipSecrets)) {
105
+ throw TransportErrors_1.TransportErrors.secrets.wrongSecretType(secrets.id).logWith(this._log);
106
+ }
107
+ return await secrets.encrypt(buffer);
108
+ }
109
+ async decryptRequest(relationshipSecretId, cipher) {
110
+ const secrets = await this.getSecret(relationshipSecretId);
111
+ if (!(secrets instanceof crypto_1.CryptoRelationshipRequestSecrets) && !(secrets instanceof crypto_1.CryptoRelationshipSecrets)) {
112
+ throw TransportErrors_1.TransportErrors.secrets.wrongSecretType(relationshipSecretId.toString()).logWith(this._log);
113
+ }
114
+ return await secrets.decryptRequest(cipher);
115
+ }
116
+ async createTemplateKey() {
117
+ const templateKeyId = await CoreIds_1.TransportIds.relationshipTemplateKey.generate();
118
+ const key = await this.createExchangeKey(`${templateKeyId.toString()}`);
119
+ const publicKey = key[0];
120
+ return new RelationshipTemplatePublicKey_1.RelationshipTemplatePublicKey(templateKeyId, publicKey.algorithm, publicKey.publicKey);
121
+ }
122
+ async decryptPeer(relationshipSecretId, cipher, omitCounterCheck = false) {
123
+ const secrets = await this.getSecret(relationshipSecretId);
124
+ if (!(secrets instanceof crypto_1.CryptoRelationshipSecrets)) {
125
+ throw TransportErrors_1.TransportErrors.secrets.wrongSecretType(secrets.id).logWith(this._log);
126
+ }
127
+ return await secrets.decryptPeer(cipher, omitCounterCheck);
128
+ }
129
+ async hasCryptoRelationshipSecrets(relationshipSecretId) {
130
+ const secrets = await this.getSecret(relationshipSecretId);
131
+ return secrets instanceof crypto_1.CryptoRelationshipSecrets;
132
+ }
133
+ async decryptOwn(relationshipSecretId, cipher) {
134
+ const secrets = await this.getSecret(relationshipSecretId);
135
+ if (!(secrets instanceof crypto_1.CryptoRelationshipSecrets)) {
136
+ throw TransportErrors_1.TransportErrors.secrets.wrongSecretType(secrets.id).logWith(this._log);
137
+ }
138
+ return await secrets.decryptOwn(cipher);
139
+ }
140
+ async sign(relationshipSecretId, content) {
141
+ const bufferToSign = CoreUtil_1.CoreUtil.toBuffer(content);
142
+ const secrets = await this.getSecret(relationshipSecretId);
143
+ return await secrets.sign(bufferToSign);
144
+ }
145
+ async verifyOwn(relationshipSecretId, content, signature) {
146
+ const bufferToVerify = CoreUtil_1.CoreUtil.toBuffer(content);
147
+ const secrets = await this.getSecret(relationshipSecretId);
148
+ return await secrets.verifyOwn(bufferToVerify, signature);
149
+ }
150
+ async verifyPeer(relationshipSecretId, content, signature) {
151
+ const bufferToVerify = CoreUtil_1.CoreUtil.toBuffer(content);
152
+ const secrets = await this.getSecret(relationshipSecretId);
153
+ if (secrets instanceof crypto_1.CryptoRelationshipRequestSecrets) {
154
+ throw TransportErrors_1.TransportErrors.secrets.wrongSecretType(secrets.id).logWith(this._log);
155
+ }
156
+ const valid = await secrets.verifyPeer(bufferToVerify, signature);
157
+ return valid;
158
+ }
159
+ }
160
+ exports.RelationshipSecretController = RelationshipSecretController;
161
+ //# sourceMappingURL=RelationshipSecretController.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RelationshipSecretController.js","sourceRoot":"","sources":["../../../src/modules/relationships/RelationshipSecretController.ts"],"names":[],"mappings":";;;AACA,0CAWsB;AACtB,qCAA+D;AAC/D,gDAAiD;AACjD,kDAA8C;AAC9C,gEAA4D;AAI5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AAM,OAAO,CAAC,SAAS,CAAC,cAAc,EAAE,SAAS,CAAC,CAAA;IAC7D,CAAC;IAEM,KAAK,CAAC,UAAU,CACnB,oBAA4B,EAC5B,OAA+D,EAC/D,SAA0B;QAE1B,MAAM,cAAc,GAAG,mBAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAA;QAEjD,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,oBAAoB,CAAC,CAAA;QAC1D,IAAI,OAAO,YAAY,yCAAgC,EAAE;YACrD,MAAM,iCAAe,CAAC,OAAO,CAAC,eAAe,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;SAC/E;QAED,MAAM,KAAK,GAAG,MAAM,OAAO,CAAC,UAAU,CAAC,cAAc,EAAE,SAAS,CAAC,CAAA;QACjE,OAAO,KAAK,CAAA;IAChB,CAAC;CACJ;AA5OD,oEA4OC"}
@@ -0,0 +1,47 @@
1
+ import { ISerializableAsync } from "@js-soft/ts-serval";
2
+ import { CoreBuffer, CryptoSignature } from "@nmshd/crypto";
3
+ import { CoreAddress, CoreId, ICoreSerializable, TransportController } from "../../core";
4
+ import { AccountController } from "../accounts/AccountController";
5
+ import { BackboneGetRelationshipsChangesResponse } from "./backbone/BackboneGetRelationshipsChanges";
6
+ import { Relationship } from "./local/Relationship";
7
+ import { ISendRelationshipParameters } from "./local/SendRelationshipParameters";
8
+ import { RelationshipSecretController } from "./RelationshipSecretController";
9
+ import { RelationshipChange } from "./transmission/changes/RelationshipChange";
10
+ import { RelationshipStatus } from "./transmission/RelationshipStatus";
11
+ export declare class RelationshipsController extends TransportController {
12
+ private client;
13
+ private relationships;
14
+ private readonly secrets;
15
+ constructor(parent: AccountController, secrets: RelationshipSecretController);
16
+ init(): Promise<this>;
17
+ getRelationships(query?: any): Promise<Relationship[]>;
18
+ updateCache(ids: string[]): Promise<Relationship[]>;
19
+ private updateCacheOfExistingRelationshipInDb;
20
+ getRelationshipToIdentity(address: CoreAddress, status?: RelationshipStatus): Promise<Relationship | undefined>;
21
+ getActiveRelationshipToIdentity(address: CoreAddress): Promise<Relationship | undefined>;
22
+ getRelationship(id: CoreId): Promise<Relationship | undefined>;
23
+ sign(relationship: Relationship, content: CoreBuffer): Promise<CryptoSignature>;
24
+ verify(relationship: Relationship, content: CoreBuffer, signature: CryptoSignature): Promise<boolean>;
25
+ verifyIdentity(relationship: Relationship, content: CoreBuffer, signature: CryptoSignature): Promise<boolean>;
26
+ sendRelationship(parameters: ISendRelationshipParameters): Promise<Relationship>;
27
+ setRelationshipMetadata(idOrRelationship: CoreId | Relationship, metadata: ISerializableAsync): Promise<Relationship>;
28
+ requestTermination(): void;
29
+ acceptChange(change: RelationshipChange, content?: ICoreSerializable): Promise<Relationship>;
30
+ rejectChange(change: RelationshipChange, content?: ICoreSerializable): Promise<Relationship>;
31
+ revokeChange(change: RelationshipChange, content?: ICoreSerializable): Promise<Relationship>;
32
+ private updateCacheOfRelationship;
33
+ private prepareRequest;
34
+ applyChangeById(changeId: string): Promise<Relationship | undefined>;
35
+ applyChange(change: BackboneGetRelationshipsChangesResponse): Promise<Relationship | undefined>;
36
+ private applyCreationChange;
37
+ private parseCreationChange;
38
+ private decryptCreationChangeRequest;
39
+ private decryptCreationChangeResponse;
40
+ private updatePendingRelationshipWithPeerResponse;
41
+ private createNewRelationshipByIncomingCreationChange;
42
+ private applyTerminationChange;
43
+ private applyTerminationCancellationChange;
44
+ private completeChange;
45
+ private encryptRevokeContent;
46
+ private encryptAcceptRejectContent;
47
+ }