@credo-ts/core 0.6.0-pr-2392-20251010173905 → 0.6.0-pr-2457-20251016083534

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 (985) hide show
  1. package/build/agent/Agent.d.mts +1 -1
  2. package/build/agent/Agent.d.mts.map +1 -1
  3. package/build/agent/Agent.d.ts +1 -1
  4. package/build/agent/Agent.d.ts.map +1 -1
  5. package/build/agent/Agent.js +2 -2
  6. package/build/agent/Agent.mjs +2 -2
  7. package/build/agent/Agent.mjs.map +1 -1
  8. package/build/agent/AgentConfig.d.mts +1 -1
  9. package/build/agent/AgentConfig.d.mts.map +1 -1
  10. package/build/agent/AgentConfig.d.ts +1 -1
  11. package/build/agent/AgentConfig.d.ts.map +1 -1
  12. package/build/agent/AgentConfig.mjs.map +1 -1
  13. package/build/agent/AgentModules.d.mts +4 -4
  14. package/build/agent/AgentModules.d.mts.map +1 -1
  15. package/build/agent/AgentModules.d.ts +4 -4
  16. package/build/agent/AgentModules.d.ts.map +1 -1
  17. package/build/agent/AgentModules.mjs.map +1 -1
  18. package/build/agent/BaseAgent.d.mts +4 -4
  19. package/build/agent/BaseAgent.d.ts +4 -4
  20. package/build/agent/BaseAgent.mjs.map +1 -1
  21. package/build/agent/EventEmitter.d.mts +1 -1
  22. package/build/agent/EventEmitter.d.mts.map +1 -1
  23. package/build/agent/EventEmitter.d.ts +1 -1
  24. package/build/agent/EventEmitter.d.ts.map +1 -1
  25. package/build/agent/EventEmitter.mjs.map +1 -1
  26. package/build/agent/context/AgentContext.d.mts.map +1 -1
  27. package/build/agent/context/AgentContext.d.ts.map +1 -1
  28. package/build/agent/context/AgentContext.mjs.map +1 -1
  29. package/build/agent/context/DefaultAgentContextProvider.d.mts.map +1 -1
  30. package/build/agent/context/DefaultAgentContextProvider.d.ts.map +1 -1
  31. package/build/agent/context/DefaultAgentContextProvider.js +1 -1
  32. package/build/agent/context/DefaultAgentContextProvider.mjs +1 -1
  33. package/build/agent/context/DefaultAgentContextProvider.mjs.map +1 -1
  34. package/build/crypto/JwsService.d.mts +5 -5
  35. package/build/crypto/JwsService.d.mts.map +1 -1
  36. package/build/crypto/JwsService.d.ts +5 -5
  37. package/build/crypto/JwsService.d.ts.map +1 -1
  38. package/build/crypto/JwsService.js +3 -3
  39. package/build/crypto/JwsService.mjs +3 -3
  40. package/build/crypto/JwsService.mjs.map +1 -1
  41. package/build/crypto/KmsKeyPair.js +1 -5
  42. package/build/crypto/KmsKeyPair.mjs +1 -2
  43. package/build/crypto/KmsKeyPair.mjs.map +1 -1
  44. package/build/crypto/hashes/Hasher.d.mts +4 -2
  45. package/build/crypto/hashes/Hasher.d.mts.map +1 -1
  46. package/build/crypto/hashes/Hasher.d.ts +4 -2
  47. package/build/crypto/hashes/Hasher.d.ts.map +1 -1
  48. package/build/crypto/hashes/Hasher.js +8 -3
  49. package/build/crypto/hashes/Hasher.mjs +8 -3
  50. package/build/crypto/hashes/Hasher.mjs.map +1 -1
  51. package/build/crypto/hashes/IHash.d.mts +3 -1
  52. package/build/crypto/hashes/IHash.d.mts.map +1 -1
  53. package/build/crypto/hashes/IHash.d.ts +3 -1
  54. package/build/crypto/hashes/IHash.d.ts.map +1 -1
  55. package/build/crypto/hashes/Sha1.d.mts +2 -1
  56. package/build/crypto/hashes/Sha1.d.mts.map +1 -1
  57. package/build/crypto/hashes/Sha1.d.ts +2 -1
  58. package/build/crypto/hashes/Sha1.d.ts.map +1 -1
  59. package/build/crypto/hashes/Sha1.js +3 -3
  60. package/build/crypto/hashes/Sha1.mjs +1 -1
  61. package/build/crypto/hashes/Sha1.mjs.map +1 -1
  62. package/build/crypto/hashes/Sha256.d.mts +2 -1
  63. package/build/crypto/hashes/Sha256.d.mts.map +1 -1
  64. package/build/crypto/hashes/Sha256.d.ts +2 -1
  65. package/build/crypto/hashes/Sha256.d.ts.map +1 -1
  66. package/build/crypto/hashes/Sha256.js +3 -3
  67. package/build/crypto/hashes/Sha256.mjs +1 -1
  68. package/build/crypto/hashes/Sha256.mjs.map +1 -1
  69. package/build/crypto/hashes/Sha384.d.mts +10 -0
  70. package/build/crypto/hashes/Sha384.d.mts.map +1 -0
  71. package/build/crypto/hashes/Sha384.d.ts +10 -0
  72. package/build/crypto/hashes/Sha384.d.ts.map +1 -0
  73. package/build/crypto/hashes/Sha384.js +15 -0
  74. package/build/crypto/hashes/Sha384.mjs +14 -0
  75. package/build/crypto/hashes/Sha384.mjs.map +1 -0
  76. package/build/crypto/hashes/Sha512.d.mts +2 -1
  77. package/build/crypto/hashes/Sha512.d.mts.map +1 -1
  78. package/build/crypto/hashes/Sha512.d.ts +2 -1
  79. package/build/crypto/hashes/Sha512.d.ts.map +1 -1
  80. package/build/crypto/hashes/Sha512.js +3 -3
  81. package/build/crypto/hashes/Sha512.mjs +1 -1
  82. package/build/crypto/hashes/Sha512.mjs.map +1 -1
  83. package/build/crypto/hashes/index.js +1 -0
  84. package/build/crypto/hashes/index.mjs +1 -0
  85. package/build/crypto/index.js +1 -0
  86. package/build/crypto/index.mjs +1 -0
  87. package/build/crypto/jose/jwt/Jwt.d.mts.map +1 -1
  88. package/build/crypto/jose/jwt/Jwt.d.ts.map +1 -1
  89. package/build/crypto/jose/jwt/Jwt.js +1 -1
  90. package/build/crypto/jose/jwt/Jwt.mjs +1 -1
  91. package/build/crypto/jose/jwt/Jwt.mjs.map +1 -1
  92. package/build/crypto/webcrypto/CredoSubtle.d.mts.map +1 -1
  93. package/build/crypto/webcrypto/CredoSubtle.d.ts.map +1 -1
  94. package/build/crypto/webcrypto/CredoSubtle.js +1 -1
  95. package/build/crypto/webcrypto/CredoSubtle.mjs +1 -1
  96. package/build/crypto/webcrypto/CredoSubtle.mjs.map +1 -1
  97. package/build/crypto/webcrypto/CredoWalletWebCrypto.d.mts +7 -7
  98. package/build/crypto/webcrypto/CredoWalletWebCrypto.d.mts.map +1 -1
  99. package/build/crypto/webcrypto/CredoWalletWebCrypto.d.ts +7 -7
  100. package/build/crypto/webcrypto/CredoWalletWebCrypto.d.ts.map +1 -1
  101. package/build/crypto/webcrypto/CredoWalletWebCrypto.js +6 -9
  102. package/build/crypto/webcrypto/CredoWalletWebCrypto.mjs +5 -6
  103. package/build/crypto/webcrypto/CredoWalletWebCrypto.mjs.map +1 -1
  104. package/build/crypto/webcrypto/CredoWebCrypto.d.mts.map +1 -1
  105. package/build/crypto/webcrypto/CredoWebCrypto.d.ts.map +1 -1
  106. package/build/crypto/webcrypto/CredoWebCrypto.js +1 -1
  107. package/build/crypto/webcrypto/CredoWebCrypto.mjs +1 -1
  108. package/build/crypto/webcrypto/CredoWebCrypto.mjs.map +1 -1
  109. package/build/crypto/webcrypto/CredoWebCryptoKey.d.mts.map +1 -1
  110. package/build/crypto/webcrypto/CredoWebCryptoKey.d.ts.map +1 -1
  111. package/build/crypto/webcrypto/CredoWebCryptoKey.mjs.map +1 -1
  112. package/build/crypto/webcrypto/providers/CredoEcdsaProvider.js +4 -2
  113. package/build/crypto/webcrypto/providers/CredoEcdsaProvider.mjs +4 -2
  114. package/build/crypto/webcrypto/providers/CredoEcdsaProvider.mjs.map +1 -1
  115. package/build/crypto/webcrypto/providers/CredoEd25519Provider.js +4 -2
  116. package/build/crypto/webcrypto/providers/CredoEd25519Provider.mjs +4 -2
  117. package/build/crypto/webcrypto/providers/CredoEd25519Provider.mjs.map +1 -1
  118. package/build/crypto/webcrypto/providers/CredoSha1Provider.mjs.map +1 -1
  119. package/build/crypto/webcrypto/providers/CredoSha256Provider.mjs.map +1 -1
  120. package/build/crypto/webcrypto/providers/index.js +1 -1
  121. package/build/crypto/webcrypto/providers/index.mjs +1 -1
  122. package/build/crypto/webcrypto/types.d.mts +2 -1
  123. package/build/crypto/webcrypto/types.d.mts.map +1 -1
  124. package/build/crypto/webcrypto/types.d.ts +2 -1
  125. package/build/crypto/webcrypto/types.d.ts.map +1 -1
  126. package/build/crypto/webcrypto/types.mjs.map +1 -1
  127. package/build/crypto/webcrypto/utils/keyAlgorithmConversion.js +4 -4
  128. package/build/crypto/webcrypto/utils/keyAlgorithmConversion.mjs +4 -4
  129. package/build/crypto/webcrypto/utils/keyAlgorithmConversion.mjs.map +1 -1
  130. package/build/error/index.js +2 -2
  131. package/build/error/index.mjs +2 -2
  132. package/build/index.d.mts +161 -157
  133. package/build/index.d.mts.map +1 -1
  134. package/build/index.d.ts +161 -157
  135. package/build/index.d.ts.map +1 -1
  136. package/build/index.js +67 -62
  137. package/build/index.mjs +66 -62
  138. package/build/index.mjs.map +1 -1
  139. package/build/logger/BaseLogger.mjs.map +1 -1
  140. package/build/logger/ConsoleLogger.mjs.map +1 -1
  141. package/build/logger/Logger.mjs.map +1 -1
  142. package/build/modules/cache/CacheModule.mjs.map +1 -1
  143. package/build/modules/cache/CachedStorageService.mjs.map +1 -1
  144. package/build/modules/cache/InMemoryLruCache.d.mts.map +1 -1
  145. package/build/modules/cache/InMemoryLruCache.d.ts.map +1 -1
  146. package/build/modules/cache/InMemoryLruCache.js +1 -1
  147. package/build/modules/cache/InMemoryLruCache.mjs +1 -1
  148. package/build/modules/cache/InMemoryLruCache.mjs.map +1 -1
  149. package/build/modules/cache/singleContextLruCache/SingleContextLruCacheRecord.d.mts.map +1 -1
  150. package/build/modules/cache/singleContextLruCache/SingleContextLruCacheRecord.d.ts.map +1 -1
  151. package/build/modules/cache/singleContextLruCache/SingleContextLruCacheRecord.mjs.map +1 -1
  152. package/build/modules/cache/singleContextLruCache/SingleContextStorageLruCache.d.mts.map +1 -1
  153. package/build/modules/cache/singleContextLruCache/SingleContextStorageLruCache.d.ts.map +1 -1
  154. package/build/modules/cache/singleContextLruCache/SingleContextStorageLruCache.js +1 -1
  155. package/build/modules/cache/singleContextLruCache/SingleContextStorageLruCache.mjs +1 -1
  156. package/build/modules/cache/singleContextLruCache/SingleContextStorageLruCache.mjs.map +1 -1
  157. package/build/modules/dcql/DcqlModule.d.mts.map +1 -1
  158. package/build/modules/dcql/DcqlModule.d.ts.map +1 -1
  159. package/build/modules/dcql/DcqlModule.mjs.map +1 -1
  160. package/build/modules/dcql/DcqlService.d.mts.map +1 -1
  161. package/build/modules/dcql/DcqlService.d.ts.map +1 -1
  162. package/build/modules/dcql/DcqlService.js +2 -2
  163. package/build/modules/dcql/DcqlService.mjs +2 -2
  164. package/build/modules/dcql/DcqlService.mjs.map +1 -1
  165. package/build/modules/dcql/models/DcqlCredentialsForRequest.d.mts +3 -3
  166. package/build/modules/dcql/models/DcqlCredentialsForRequest.d.ts +3 -3
  167. package/build/modules/dcql/models/index.d.mts +2 -2
  168. package/build/modules/dcql/models/index.d.mts.map +1 -1
  169. package/build/modules/dcql/models/index.d.ts +2 -2
  170. package/build/modules/dcql/models/index.d.ts.map +1 -1
  171. package/build/modules/dcql/utils/DcqlPresentationsToCreate.d.mts +2 -2
  172. package/build/modules/dcql/utils/DcqlPresentationsToCreate.d.ts +2 -2
  173. package/build/modules/dids/DidsApi.d.mts +2 -2
  174. package/build/modules/dids/DidsApi.d.mts.map +1 -1
  175. package/build/modules/dids/DidsApi.d.ts +2 -2
  176. package/build/modules/dids/DidsApi.d.ts.map +1 -1
  177. package/build/modules/dids/DidsApi.js +1 -1
  178. package/build/modules/dids/DidsApi.mjs +1 -1
  179. package/build/modules/dids/DidsApi.mjs.map +1 -1
  180. package/build/modules/dids/DidsModule.d.mts.map +1 -1
  181. package/build/modules/dids/DidsModule.d.ts.map +1 -1
  182. package/build/modules/dids/DidsModule.mjs.map +1 -1
  183. package/build/modules/dids/DidsModuleConfig.js +2 -2
  184. package/build/modules/dids/DidsModuleConfig.mjs +2 -2
  185. package/build/modules/dids/domain/DidDocument.d.mts +1 -1
  186. package/build/modules/dids/domain/DidDocument.d.mts.map +1 -1
  187. package/build/modules/dids/domain/DidDocument.d.ts +1 -1
  188. package/build/modules/dids/domain/DidDocument.d.ts.map +1 -1
  189. package/build/modules/dids/domain/DidDocument.js +6 -6
  190. package/build/modules/dids/domain/DidDocument.mjs +6 -6
  191. package/build/modules/dids/domain/DidDocument.mjs.map +1 -1
  192. package/build/modules/dids/domain/DidDocumentBuilder.d.mts.map +1 -1
  193. package/build/modules/dids/domain/DidDocumentBuilder.d.ts.map +1 -1
  194. package/build/modules/dids/domain/DidDocumentBuilder.mjs.map +1 -1
  195. package/build/modules/dids/domain/index.js +11 -11
  196. package/build/modules/dids/domain/index.mjs +11 -11
  197. package/build/modules/dids/domain/key-type/ed25519.mjs.map +1 -1
  198. package/build/modules/dids/domain/key-type/keyDidJsonWebKey.mjs.map +1 -1
  199. package/build/modules/dids/domain/key-type/keyDidMapping.d.mts +1 -1
  200. package/build/modules/dids/domain/key-type/keyDidMapping.d.mts.map +1 -1
  201. package/build/modules/dids/domain/key-type/keyDidMapping.d.ts +1 -1
  202. package/build/modules/dids/domain/key-type/keyDidMapping.d.ts.map +1 -1
  203. package/build/modules/dids/domain/key-type/keyDidMapping.mjs.map +1 -1
  204. package/build/modules/dids/domain/key-type/secp256k1.js +1 -1
  205. package/build/modules/dids/domain/key-type/secp256k1.mjs +1 -1
  206. package/build/modules/dids/domain/key-type/secp256k1.mjs.map +1 -1
  207. package/build/modules/dids/domain/key-type/x25519.js +1 -1
  208. package/build/modules/dids/domain/key-type/x25519.mjs +1 -1
  209. package/build/modules/dids/domain/key-type/x25519.mjs.map +1 -1
  210. package/build/modules/dids/domain/keyDidDocument.js +1 -1
  211. package/build/modules/dids/domain/keyDidDocument.mjs +1 -1
  212. package/build/modules/dids/domain/keyDidDocument.mjs.map +1 -1
  213. package/build/modules/dids/domain/parse.d.mts.map +1 -1
  214. package/build/modules/dids/domain/parse.d.ts.map +1 -1
  215. package/build/modules/dids/domain/parse.mjs.map +1 -1
  216. package/build/modules/dids/domain/service/DidCommV2Service.d.mts +1 -1
  217. package/build/modules/dids/domain/service/DidCommV2Service.d.mts.map +1 -1
  218. package/build/modules/dids/domain/service/DidCommV2Service.d.ts +1 -1
  219. package/build/modules/dids/domain/service/DidCommV2Service.d.ts.map +1 -1
  220. package/build/modules/dids/domain/service/DidCommV2Service.mjs.map +1 -1
  221. package/build/modules/dids/domain/service/DidDocumentService.mjs.map +1 -1
  222. package/build/modules/dids/domain/verificationMethod/EcdsaSecp256k1VerificationKey2019.d.mts +1 -1
  223. package/build/modules/dids/domain/verificationMethod/EcdsaSecp256k1VerificationKey2019.d.ts +1 -1
  224. package/build/modules/dids/domain/verificationMethod/Ed25519VerificationKey2018.d.mts +1 -1
  225. package/build/modules/dids/domain/verificationMethod/Ed25519VerificationKey2018.d.mts.map +1 -1
  226. package/build/modules/dids/domain/verificationMethod/Ed25519VerificationKey2018.d.ts +1 -1
  227. package/build/modules/dids/domain/verificationMethod/Ed25519VerificationKey2018.d.ts.map +1 -1
  228. package/build/modules/dids/domain/verificationMethod/Ed25519VerificationKey2018.mjs.map +1 -1
  229. package/build/modules/dids/domain/verificationMethod/Ed25519VerificationKey2020.d.mts +1 -1
  230. package/build/modules/dids/domain/verificationMethod/Ed25519VerificationKey2020.d.mts.map +1 -1
  231. package/build/modules/dids/domain/verificationMethod/Ed25519VerificationKey2020.d.ts +1 -1
  232. package/build/modules/dids/domain/verificationMethod/Ed25519VerificationKey2020.d.ts.map +1 -1
  233. package/build/modules/dids/domain/verificationMethod/Ed25519VerificationKey2020.mjs.map +1 -1
  234. package/build/modules/dids/domain/verificationMethod/JsonWebKey2020.d.mts +1 -1
  235. package/build/modules/dids/domain/verificationMethod/JsonWebKey2020.d.mts.map +1 -1
  236. package/build/modules/dids/domain/verificationMethod/JsonWebKey2020.d.ts +1 -1
  237. package/build/modules/dids/domain/verificationMethod/JsonWebKey2020.d.ts.map +1 -1
  238. package/build/modules/dids/domain/verificationMethod/JsonWebKey2020.mjs.map +1 -1
  239. package/build/modules/dids/domain/verificationMethod/Multikey.d.mts +1 -1
  240. package/build/modules/dids/domain/verificationMethod/Multikey.d.mts.map +1 -1
  241. package/build/modules/dids/domain/verificationMethod/Multikey.d.ts +1 -1
  242. package/build/modules/dids/domain/verificationMethod/Multikey.d.ts.map +1 -1
  243. package/build/modules/dids/domain/verificationMethod/Multikey.mjs.map +1 -1
  244. package/build/modules/dids/domain/verificationMethod/VerificationMethodTransformer.d.mts.map +1 -1
  245. package/build/modules/dids/domain/verificationMethod/VerificationMethodTransformer.d.ts.map +1 -1
  246. package/build/modules/dids/domain/verificationMethod/VerificationMethodTransformer.mjs.map +1 -1
  247. package/build/modules/dids/domain/verificationMethod/X25519KeyAgreementKey2019.d.mts +1 -1
  248. package/build/modules/dids/domain/verificationMethod/X25519KeyAgreementKey2019.d.mts.map +1 -1
  249. package/build/modules/dids/domain/verificationMethod/X25519KeyAgreementKey2019.d.ts +1 -1
  250. package/build/modules/dids/domain/verificationMethod/X25519KeyAgreementKey2019.d.ts.map +1 -1
  251. package/build/modules/dids/domain/verificationMethod/X25519KeyAgreementKey2019.mjs.map +1 -1
  252. package/build/modules/dids/domain/verificationMethod/index.js +3 -3
  253. package/build/modules/dids/domain/verificationMethod/index.mjs +3 -3
  254. package/build/modules/dids/findMatchingEd25519Key.d.mts +1 -1
  255. package/build/modules/dids/findMatchingEd25519Key.d.ts +1 -1
  256. package/build/modules/dids/findMatchingEd25519Key.js +1 -1
  257. package/build/modules/dids/findMatchingEd25519Key.mjs +1 -1
  258. package/build/modules/dids/findMatchingEd25519Key.mjs.map +1 -1
  259. package/build/modules/dids/helpers.mjs.map +1 -1
  260. package/build/modules/dids/index.js +15 -15
  261. package/build/modules/dids/index.mjs +15 -15
  262. package/build/modules/dids/methods/index.js +5 -5
  263. package/build/modules/dids/methods/index.mjs +5 -5
  264. package/build/modules/dids/methods/jwk/DidJwk.d.mts +1 -1
  265. package/build/modules/dids/methods/jwk/DidJwk.d.ts +1 -1
  266. package/build/modules/dids/methods/jwk/JwkDidRegistrar.d.mts +2 -2
  267. package/build/modules/dids/methods/jwk/JwkDidRegistrar.d.mts.map +1 -1
  268. package/build/modules/dids/methods/jwk/JwkDidRegistrar.d.ts +2 -2
  269. package/build/modules/dids/methods/jwk/JwkDidRegistrar.d.ts.map +1 -1
  270. package/build/modules/dids/methods/jwk/JwkDidRegistrar.js +1 -1
  271. package/build/modules/dids/methods/jwk/JwkDidRegistrar.mjs +1 -1
  272. package/build/modules/dids/methods/jwk/JwkDidRegistrar.mjs.map +1 -1
  273. package/build/modules/dids/methods/jwk/didJwkDidDocument.js +1 -1
  274. package/build/modules/dids/methods/jwk/didJwkDidDocument.mjs +1 -1
  275. package/build/modules/dids/methods/jwk/didJwkDidDocument.mjs.map +1 -1
  276. package/build/modules/dids/methods/key/DidKey.d.mts +1 -1
  277. package/build/modules/dids/methods/key/DidKey.d.ts +1 -1
  278. package/build/modules/dids/methods/key/KeyDidRegistrar.d.mts +2 -2
  279. package/build/modules/dids/methods/key/KeyDidRegistrar.d.mts.map +1 -1
  280. package/build/modules/dids/methods/key/KeyDidRegistrar.d.ts +2 -2
  281. package/build/modules/dids/methods/key/KeyDidRegistrar.d.ts.map +1 -1
  282. package/build/modules/dids/methods/key/KeyDidRegistrar.js +1 -1
  283. package/build/modules/dids/methods/key/KeyDidRegistrar.mjs +1 -1
  284. package/build/modules/dids/methods/key/KeyDidRegistrar.mjs.map +1 -1
  285. package/build/modules/dids/methods/peer/PeerDidRegistrar.d.mts +2 -2
  286. package/build/modules/dids/methods/peer/PeerDidRegistrar.d.mts.map +1 -1
  287. package/build/modules/dids/methods/peer/PeerDidRegistrar.d.ts +2 -2
  288. package/build/modules/dids/methods/peer/PeerDidRegistrar.d.ts.map +1 -1
  289. package/build/modules/dids/methods/peer/PeerDidRegistrar.mjs.map +1 -1
  290. package/build/modules/dids/methods/peer/PeerDidResolver.d.mts.map +1 -1
  291. package/build/modules/dids/methods/peer/PeerDidResolver.d.ts.map +1 -1
  292. package/build/modules/dids/methods/peer/PeerDidResolver.mjs.map +1 -1
  293. package/build/modules/dids/methods/peer/createPeerDidDocumentFromServices.d.mts +1 -1
  294. package/build/modules/dids/methods/peer/createPeerDidDocumentFromServices.d.mts.map +1 -1
  295. package/build/modules/dids/methods/peer/createPeerDidDocumentFromServices.d.ts +1 -1
  296. package/build/modules/dids/methods/peer/createPeerDidDocumentFromServices.d.ts.map +1 -1
  297. package/build/modules/dids/methods/peer/createPeerDidDocumentFromServices.js +1 -1
  298. package/build/modules/dids/methods/peer/createPeerDidDocumentFromServices.mjs +1 -1
  299. package/build/modules/dids/methods/peer/createPeerDidDocumentFromServices.mjs.map +1 -1
  300. package/build/modules/dids/methods/peer/index.js +1 -1
  301. package/build/modules/dids/methods/peer/index.mjs +1 -1
  302. package/build/modules/dids/methods/peer/peerDidNumAlgo0.mjs.map +1 -1
  303. package/build/modules/dids/methods/peer/peerDidNumAlgo1.js +1 -1
  304. package/build/modules/dids/methods/peer/peerDidNumAlgo1.mjs +1 -1
  305. package/build/modules/dids/methods/peer/peerDidNumAlgo2.js +2 -2
  306. package/build/modules/dids/methods/peer/peerDidNumAlgo2.mjs +2 -2
  307. package/build/modules/dids/methods/peer/peerDidNumAlgo2.mjs.map +1 -1
  308. package/build/modules/dids/methods/peer/peerDidNumAlgo4.js +7 -8
  309. package/build/modules/dids/methods/peer/peerDidNumAlgo4.mjs +4 -4
  310. package/build/modules/dids/methods/peer/peerDidNumAlgo4.mjs.map +1 -1
  311. package/build/modules/dids/methods/web/WebDidResolver.d.mts.map +1 -1
  312. package/build/modules/dids/methods/web/WebDidResolver.d.ts.map +1 -1
  313. package/build/modules/dids/methods/web/WebDidResolver.mjs.map +1 -1
  314. package/build/modules/dids/repository/DidRecord.d.mts.map +1 -1
  315. package/build/modules/dids/repository/DidRecord.d.ts.map +1 -1
  316. package/build/modules/dids/repository/DidRecord.js +1 -1
  317. package/build/modules/dids/repository/DidRecord.mjs +1 -1
  318. package/build/modules/dids/repository/DidRecord.mjs.map +1 -1
  319. package/build/modules/dids/repository/DidRepository.d.mts +3 -3
  320. package/build/modules/dids/repository/DidRepository.d.mts.map +1 -1
  321. package/build/modules/dids/repository/DidRepository.d.ts +3 -3
  322. package/build/modules/dids/repository/DidRepository.d.ts.map +1 -1
  323. package/build/modules/dids/repository/DidRepository.js +1 -1
  324. package/build/modules/dids/repository/DidRepository.mjs +1 -1
  325. package/build/modules/dids/repository/DidRepository.mjs.map +1 -1
  326. package/build/modules/dids/services/DidRegistrarService.d.mts.map +1 -1
  327. package/build/modules/dids/services/DidRegistrarService.d.ts.map +1 -1
  328. package/build/modules/dids/services/DidRegistrarService.mjs.map +1 -1
  329. package/build/modules/dids/services/DidResolverService.d.mts.map +1 -1
  330. package/build/modules/dids/services/DidResolverService.d.ts.map +1 -1
  331. package/build/modules/dids/services/DidResolverService.js +1 -1
  332. package/build/modules/dids/services/DidResolverService.mjs +1 -1
  333. package/build/modules/dids/services/DidResolverService.mjs.map +1 -1
  334. package/build/modules/dif-presentation-exchange/DifPresentationExchangeModule.d.mts.map +1 -1
  335. package/build/modules/dif-presentation-exchange/DifPresentationExchangeModule.d.ts.map +1 -1
  336. package/build/modules/dif-presentation-exchange/DifPresentationExchangeModule.mjs.map +1 -1
  337. package/build/modules/dif-presentation-exchange/DifPresentationExchangeService.d.mts +5 -5
  338. package/build/modules/dif-presentation-exchange/DifPresentationExchangeService.d.mts.map +1 -1
  339. package/build/modules/dif-presentation-exchange/DifPresentationExchangeService.d.ts +5 -5
  340. package/build/modules/dif-presentation-exchange/DifPresentationExchangeService.d.ts.map +1 -1
  341. package/build/modules/dif-presentation-exchange/DifPresentationExchangeService.js +9 -5
  342. package/build/modules/dif-presentation-exchange/DifPresentationExchangeService.mjs +9 -5
  343. package/build/modules/dif-presentation-exchange/DifPresentationExchangeService.mjs.map +1 -1
  344. package/build/modules/dif-presentation-exchange/models/DifPexCredentialsForRequest.d.mts +3 -3
  345. package/build/modules/dif-presentation-exchange/models/DifPexCredentialsForRequest.d.ts +3 -3
  346. package/build/modules/dif-presentation-exchange/models/index.d.mts +4 -4
  347. package/build/modules/dif-presentation-exchange/models/index.d.ts +4 -4
  348. package/build/modules/dif-presentation-exchange/utils/credentialSelection.mjs.map +1 -1
  349. package/build/modules/dif-presentation-exchange/utils/index.js +1 -1
  350. package/build/modules/dif-presentation-exchange/utils/index.mjs +1 -1
  351. package/build/modules/dif-presentation-exchange/utils/presentationSelection.d.mts +5 -5
  352. package/build/modules/dif-presentation-exchange/utils/presentationSelection.d.mts.map +1 -1
  353. package/build/modules/dif-presentation-exchange/utils/presentationSelection.d.ts +5 -5
  354. package/build/modules/dif-presentation-exchange/utils/presentationSelection.d.ts.map +1 -1
  355. package/build/modules/dif-presentation-exchange/utils/presentationSelection.js +1 -1
  356. package/build/modules/dif-presentation-exchange/utils/presentationSelection.mjs +1 -1
  357. package/build/modules/dif-presentation-exchange/utils/presentationSelection.mjs.map +1 -1
  358. package/build/modules/dif-presentation-exchange/utils/presentationsToCreate.mjs.map +1 -1
  359. package/build/modules/dif-presentation-exchange/utils/transform.mjs.map +1 -1
  360. package/build/modules/generic-records/GenericRecordsApi.d.mts +1 -1
  361. package/build/modules/generic-records/GenericRecordsApi.d.mts.map +1 -1
  362. package/build/modules/generic-records/GenericRecordsApi.d.ts +1 -1
  363. package/build/modules/generic-records/GenericRecordsApi.d.ts.map +1 -1
  364. package/build/modules/generic-records/GenericRecordsApi.mjs.map +1 -1
  365. package/build/modules/generic-records/services/GenericRecordService.d.mts.map +1 -1
  366. package/build/modules/generic-records/services/GenericRecordService.d.ts.map +1 -1
  367. package/build/modules/generic-records/services/GenericRecordService.mjs.map +1 -1
  368. package/build/modules/kms/KeyManagementApi.d.mts +7 -7
  369. package/build/modules/kms/KeyManagementApi.d.mts.map +1 -1
  370. package/build/modules/kms/KeyManagementApi.d.ts +7 -7
  371. package/build/modules/kms/KeyManagementApi.d.ts.map +1 -1
  372. package/build/modules/kms/KeyManagementApi.js +7 -7
  373. package/build/modules/kms/KeyManagementApi.mjs +7 -7
  374. package/build/modules/kms/KeyManagementApi.mjs.map +1 -1
  375. package/build/modules/kms/KeyManagementModule.d.mts +2 -2
  376. package/build/modules/kms/KeyManagementModule.d.mts.map +1 -1
  377. package/build/modules/kms/KeyManagementModule.d.ts +2 -2
  378. package/build/modules/kms/KeyManagementModule.d.ts.map +1 -1
  379. package/build/modules/kms/KeyManagementModule.mjs.map +1 -1
  380. package/build/modules/kms/KeyManagementModuleConfig.d.mts +0 -1
  381. package/build/modules/kms/KeyManagementModuleConfig.d.mts.map +1 -1
  382. package/build/modules/kms/KeyManagementModuleConfig.d.ts +0 -1
  383. package/build/modules/kms/KeyManagementModuleConfig.d.ts.map +1 -1
  384. package/build/modules/kms/KeyManagementModuleConfig.js +0 -6
  385. package/build/modules/kms/KeyManagementModuleConfig.mjs +0 -6
  386. package/build/modules/kms/KeyManagementModuleConfig.mjs.map +1 -1
  387. package/build/modules/kms/KeyManagementService.d.mts +6 -6
  388. package/build/modules/kms/KeyManagementService.d.ts +6 -6
  389. package/build/modules/kms/error/KeyManagementKeyNotFoundError.d.mts +1 -1
  390. package/build/modules/kms/error/KeyManagementKeyNotFoundError.d.ts +1 -1
  391. package/build/modules/kms/error/KeyManagementKeyNotFoundError.js +5 -2
  392. package/build/modules/kms/error/KeyManagementKeyNotFoundError.mjs +5 -2
  393. package/build/modules/kms/error/KeyManagementKeyNotFoundError.mjs.map +1 -1
  394. package/build/modules/kms/index.d.mts +25 -25
  395. package/build/modules/kms/index.d.ts +25 -25
  396. package/build/modules/kms/index.js +10 -10
  397. package/build/modules/kms/index.mjs +10 -10
  398. package/build/modules/kms/index.mjs.map +1 -1
  399. package/build/modules/kms/jwk/PublicJwk.d.mts +3 -4
  400. package/build/modules/kms/jwk/PublicJwk.d.mts.map +1 -1
  401. package/build/modules/kms/jwk/PublicJwk.d.ts +3 -4
  402. package/build/modules/kms/jwk/PublicJwk.d.ts.map +1 -1
  403. package/build/modules/kms/jwk/PublicJwk.js +2 -5
  404. package/build/modules/kms/jwk/PublicJwk.mjs +2 -5
  405. package/build/modules/kms/jwk/PublicJwk.mjs.map +1 -1
  406. package/build/modules/kms/jwk/alg/encryption.d.mts +1 -1
  407. package/build/modules/kms/jwk/alg/encryption.d.mts.map +1 -1
  408. package/build/modules/kms/jwk/alg/encryption.d.ts +1 -1
  409. package/build/modules/kms/jwk/alg/encryption.d.ts.map +1 -1
  410. package/build/modules/kms/jwk/alg/encryption.mjs.map +1 -1
  411. package/build/modules/kms/jwk/alg/index.js +1 -1
  412. package/build/modules/kms/jwk/alg/index.mjs +1 -1
  413. package/build/modules/kms/jwk/alg/keyDerivation.d.mts +1 -1
  414. package/build/modules/kms/jwk/alg/keyDerivation.d.mts.map +1 -1
  415. package/build/modules/kms/jwk/alg/keyDerivation.d.ts +1 -1
  416. package/build/modules/kms/jwk/alg/keyDerivation.d.ts.map +1 -1
  417. package/build/modules/kms/jwk/alg/keyDerivation.mjs.map +1 -1
  418. package/build/modules/kms/jwk/alg/signing.d.mts +1 -1
  419. package/build/modules/kms/jwk/alg/signing.d.mts.map +1 -1
  420. package/build/modules/kms/jwk/alg/signing.d.ts +1 -1
  421. package/build/modules/kms/jwk/alg/signing.d.ts.map +1 -1
  422. package/build/modules/kms/jwk/alg/signing.mjs.map +1 -1
  423. package/build/modules/kms/jwk/assertSupported.d.mts +2 -2
  424. package/build/modules/kms/jwk/assertSupported.d.ts +2 -2
  425. package/build/modules/kms/jwk/humanDescription.d.mts.map +1 -1
  426. package/build/modules/kms/jwk/humanDescription.d.ts.map +1 -1
  427. package/build/modules/kms/jwk/humanDescription.mjs.map +1 -1
  428. package/build/modules/kms/jwk/index.js +8 -8
  429. package/build/modules/kms/jwk/index.mjs +8 -8
  430. package/build/modules/kms/jwk/jwkThumbprint.js +2 -2
  431. package/build/modules/kms/jwk/jwkThumbprint.mjs +2 -2
  432. package/build/modules/kms/jwk/jwkThumbprint.mjs.map +1 -1
  433. package/build/modules/kms/jwk/keyOps.d.mts.map +1 -1
  434. package/build/modules/kms/jwk/keyOps.d.ts.map +1 -1
  435. package/build/modules/kms/jwk/keyOps.js +1 -1
  436. package/build/modules/kms/jwk/keyOps.mjs +1 -1
  437. package/build/modules/kms/jwk/keyOps.mjs.map +1 -1
  438. package/build/modules/kms/jwk/knownJwk.d.mts +1 -1
  439. package/build/modules/kms/jwk/knownJwk.d.mts.map +1 -1
  440. package/build/modules/kms/jwk/knownJwk.d.ts +1 -1
  441. package/build/modules/kms/jwk/knownJwk.d.ts.map +1 -1
  442. package/build/modules/kms/jwk/knownJwk.js +1 -1
  443. package/build/modules/kms/jwk/knownJwk.mjs +1 -1
  444. package/build/modules/kms/jwk/knownJwk.mjs.map +1 -1
  445. package/build/modules/kms/jwk/kty/PublicJwk.d.mts +3 -2
  446. package/build/modules/kms/jwk/kty/PublicJwk.d.mts.map +1 -1
  447. package/build/modules/kms/jwk/kty/PublicJwk.d.ts +3 -2
  448. package/build/modules/kms/jwk/kty/PublicJwk.d.ts.map +1 -1
  449. package/build/modules/kms/jwk/kty/ec/P256PublicJwk.d.mts +7 -6
  450. package/build/modules/kms/jwk/kty/ec/P256PublicJwk.d.mts.map +1 -1
  451. package/build/modules/kms/jwk/kty/ec/P256PublicJwk.d.ts +7 -6
  452. package/build/modules/kms/jwk/kty/ec/P256PublicJwk.d.ts.map +1 -1
  453. package/build/modules/kms/jwk/kty/ec/P256PublicJwk.mjs.map +1 -1
  454. package/build/modules/kms/jwk/kty/ec/P384PublicJwk.d.mts +7 -6
  455. package/build/modules/kms/jwk/kty/ec/P384PublicJwk.d.mts.map +1 -1
  456. package/build/modules/kms/jwk/kty/ec/P384PublicJwk.d.ts +7 -6
  457. package/build/modules/kms/jwk/kty/ec/P384PublicJwk.d.ts.map +1 -1
  458. package/build/modules/kms/jwk/kty/ec/P384PublicJwk.mjs.map +1 -1
  459. package/build/modules/kms/jwk/kty/ec/P521PublicJwk.d.mts +7 -6
  460. package/build/modules/kms/jwk/kty/ec/P521PublicJwk.d.mts.map +1 -1
  461. package/build/modules/kms/jwk/kty/ec/P521PublicJwk.d.ts +7 -6
  462. package/build/modules/kms/jwk/kty/ec/P521PublicJwk.d.ts.map +1 -1
  463. package/build/modules/kms/jwk/kty/ec/P521PublicJwk.mjs.map +1 -1
  464. package/build/modules/kms/jwk/kty/ec/Secp256k1PublicJwk.d.mts +7 -6
  465. package/build/modules/kms/jwk/kty/ec/Secp256k1PublicJwk.d.mts.map +1 -1
  466. package/build/modules/kms/jwk/kty/ec/Secp256k1PublicJwk.d.ts +7 -6
  467. package/build/modules/kms/jwk/kty/ec/Secp256k1PublicJwk.d.ts.map +1 -1
  468. package/build/modules/kms/jwk/kty/ec/Secp256k1PublicJwk.mjs.map +1 -1
  469. package/build/modules/kms/jwk/kty/ec/ecPublicKey.mjs.map +1 -1
  470. package/build/modules/kms/jwk/kty/ec/ecSignature.d.mts +3 -2
  471. package/build/modules/kms/jwk/kty/ec/ecSignature.d.mts.map +1 -1
  472. package/build/modules/kms/jwk/kty/ec/ecSignature.d.ts +3 -2
  473. package/build/modules/kms/jwk/kty/ec/ecSignature.d.ts.map +1 -1
  474. package/build/modules/kms/jwk/kty/ec/ecSignature.js +2 -2
  475. package/build/modules/kms/jwk/kty/ec/ecSignature.mjs +2 -2
  476. package/build/modules/kms/jwk/kty/ec/ecSignature.mjs.map +1 -1
  477. package/build/modules/kms/jwk/kty/index.js +1 -1
  478. package/build/modules/kms/jwk/kty/index.mjs +1 -1
  479. package/build/modules/kms/jwk/kty/okp/Ed25519PublicJwk.d.mts +6 -5
  480. package/build/modules/kms/jwk/kty/okp/Ed25519PublicJwk.d.mts.map +1 -1
  481. package/build/modules/kms/jwk/kty/okp/Ed25519PublicJwk.d.ts +6 -5
  482. package/build/modules/kms/jwk/kty/okp/Ed25519PublicJwk.d.ts.map +1 -1
  483. package/build/modules/kms/jwk/kty/okp/Ed25519PublicJwk.mjs.map +1 -1
  484. package/build/modules/kms/jwk/kty/okp/X25519PublicJwk.d.mts +6 -5
  485. package/build/modules/kms/jwk/kty/okp/X25519PublicJwk.d.mts.map +1 -1
  486. package/build/modules/kms/jwk/kty/okp/X25519PublicJwk.d.ts +6 -5
  487. package/build/modules/kms/jwk/kty/okp/X25519PublicJwk.d.ts.map +1 -1
  488. package/build/modules/kms/jwk/kty/okp/X25519PublicJwk.mjs.map +1 -1
  489. package/build/modules/kms/jwk/kty/okp/okpPublicKey.mjs.map +1 -1
  490. package/build/modules/kms/jwk/kty/rsa/RsaPublicJwk.d.mts +8 -7
  491. package/build/modules/kms/jwk/kty/rsa/RsaPublicJwk.d.mts.map +1 -1
  492. package/build/modules/kms/jwk/kty/rsa/RsaPublicJwk.d.ts +8 -7
  493. package/build/modules/kms/jwk/kty/rsa/RsaPublicJwk.d.ts.map +1 -1
  494. package/build/modules/kms/jwk/kty/rsa/RsaPublicJwk.mjs.map +1 -1
  495. package/build/modules/kms/jwk/kty/rsa/rsaPublicKey.mjs.map +1 -1
  496. package/build/modules/kms/options/KmsCreateKeyOptions.d.mts +1 -1
  497. package/build/modules/kms/options/KmsCreateKeyOptions.d.mts.map +1 -1
  498. package/build/modules/kms/options/KmsCreateKeyOptions.d.ts +1 -1
  499. package/build/modules/kms/options/KmsCreateKeyOptions.d.ts.map +1 -1
  500. package/build/modules/kms/options/KmsCreateKeyOptions.mjs.map +1 -1
  501. package/build/modules/kms/options/KmsDecryptOptions.d.mts +169 -168
  502. package/build/modules/kms/options/KmsDecryptOptions.d.mts.map +1 -1
  503. package/build/modules/kms/options/KmsDecryptOptions.d.ts +169 -168
  504. package/build/modules/kms/options/KmsDecryptOptions.d.ts.map +1 -1
  505. package/build/modules/kms/options/KmsDecryptOptions.js +13 -12
  506. package/build/modules/kms/options/KmsDecryptOptions.mjs +13 -12
  507. package/build/modules/kms/options/KmsDecryptOptions.mjs.map +1 -1
  508. package/build/modules/kms/options/KmsEncryptOptions.d.mts +123 -122
  509. package/build/modules/kms/options/KmsEncryptOptions.d.mts.map +1 -1
  510. package/build/modules/kms/options/KmsEncryptOptions.d.ts +123 -122
  511. package/build/modules/kms/options/KmsEncryptOptions.d.ts.map +1 -1
  512. package/build/modules/kms/options/KmsEncryptOptions.js +13 -12
  513. package/build/modules/kms/options/KmsEncryptOptions.mjs +13 -12
  514. package/build/modules/kms/options/KmsEncryptOptions.mjs.map +1 -1
  515. package/build/modules/kms/options/KmsKeyAgreementDecryptOptions.d.mts +49 -48
  516. package/build/modules/kms/options/KmsKeyAgreementDecryptOptions.d.mts.map +1 -1
  517. package/build/modules/kms/options/KmsKeyAgreementDecryptOptions.d.ts +49 -48
  518. package/build/modules/kms/options/KmsKeyAgreementDecryptOptions.d.ts.map +1 -1
  519. package/build/modules/kms/options/KmsKeyAgreementDecryptOptions.js +3 -2
  520. package/build/modules/kms/options/KmsKeyAgreementDecryptOptions.mjs +3 -2
  521. package/build/modules/kms/options/KmsKeyAgreementDecryptOptions.mjs.map +1 -1
  522. package/build/modules/kms/options/KmsKeyAgreementEncryptOptions.d.mts +25 -24
  523. package/build/modules/kms/options/KmsKeyAgreementEncryptOptions.d.mts.map +1 -1
  524. package/build/modules/kms/options/KmsKeyAgreementEncryptOptions.d.ts +25 -24
  525. package/build/modules/kms/options/KmsKeyAgreementEncryptOptions.d.ts.map +1 -1
  526. package/build/modules/kms/options/KmsKeyAgreementEncryptOptions.js +5 -4
  527. package/build/modules/kms/options/KmsKeyAgreementEncryptOptions.mjs +5 -4
  528. package/build/modules/kms/options/KmsKeyAgreementEncryptOptions.mjs.map +1 -1
  529. package/build/modules/kms/options/KmsOperation.d.mts +3 -3
  530. package/build/modules/kms/options/KmsOperation.d.ts +3 -3
  531. package/build/modules/kms/options/KmsOperation.mjs.map +1 -1
  532. package/build/modules/kms/options/KmsSignOptions.d.mts +5 -4
  533. package/build/modules/kms/options/KmsSignOptions.d.mts.map +1 -1
  534. package/build/modules/kms/options/KmsSignOptions.d.ts +5 -4
  535. package/build/modules/kms/options/KmsSignOptions.d.ts.map +1 -1
  536. package/build/modules/kms/options/KmsSignOptions.js +2 -1
  537. package/build/modules/kms/options/KmsSignOptions.mjs +2 -1
  538. package/build/modules/kms/options/KmsSignOptions.mjs.map +1 -1
  539. package/build/modules/kms/options/KmsVerifyOptions.d.mts +7 -6
  540. package/build/modules/kms/options/KmsVerifyOptions.d.mts.map +1 -1
  541. package/build/modules/kms/options/KmsVerifyOptions.d.ts +7 -6
  542. package/build/modules/kms/options/KmsVerifyOptions.d.ts.map +1 -1
  543. package/build/modules/kms/options/KmsVerifyOptions.js +3 -2
  544. package/build/modules/kms/options/KmsVerifyOptions.mjs +3 -2
  545. package/build/modules/kms/options/KmsVerifyOptions.mjs.map +1 -1
  546. package/build/modules/mdoc/Mdoc.d.mts +1 -3
  547. package/build/modules/mdoc/Mdoc.d.mts.map +1 -1
  548. package/build/modules/mdoc/Mdoc.d.ts +1 -3
  549. package/build/modules/mdoc/Mdoc.d.ts.map +1 -1
  550. package/build/modules/mdoc/Mdoc.js +1 -7
  551. package/build/modules/mdoc/Mdoc.mjs +1 -7
  552. package/build/modules/mdoc/Mdoc.mjs.map +1 -1
  553. package/build/modules/mdoc/MdocApi.d.mts +1 -1
  554. package/build/modules/mdoc/MdocApi.d.mts.map +1 -1
  555. package/build/modules/mdoc/MdocApi.d.ts +1 -1
  556. package/build/modules/mdoc/MdocApi.d.ts.map +1 -1
  557. package/build/modules/mdoc/MdocApi.mjs.map +1 -1
  558. package/build/modules/mdoc/MdocContext.js +9 -11
  559. package/build/modules/mdoc/MdocContext.mjs +6 -7
  560. package/build/modules/mdoc/MdocContext.mjs.map +1 -1
  561. package/build/modules/mdoc/MdocDeviceResponse.d.mts +1 -1
  562. package/build/modules/mdoc/MdocDeviceResponse.d.mts.map +1 -1
  563. package/build/modules/mdoc/MdocDeviceResponse.d.ts +1 -1
  564. package/build/modules/mdoc/MdocDeviceResponse.d.ts.map +1 -1
  565. package/build/modules/mdoc/MdocDeviceResponse.mjs.map +1 -1
  566. package/build/modules/mdoc/MdocModule.d.mts.map +1 -1
  567. package/build/modules/mdoc/MdocModule.d.ts.map +1 -1
  568. package/build/modules/mdoc/MdocModule.mjs.map +1 -1
  569. package/build/modules/mdoc/MdocOptions.d.mts +4 -3
  570. package/build/modules/mdoc/MdocOptions.d.mts.map +1 -1
  571. package/build/modules/mdoc/MdocOptions.d.ts +4 -3
  572. package/build/modules/mdoc/MdocOptions.d.ts.map +1 -1
  573. package/build/modules/mdoc/MdocService.d.mts +1 -1
  574. package/build/modules/mdoc/MdocService.d.mts.map +1 -1
  575. package/build/modules/mdoc/MdocService.d.ts +1 -2
  576. package/build/modules/mdoc/MdocService.d.ts.map +1 -1
  577. package/build/modules/mdoc/MdocService.mjs.map +1 -1
  578. package/build/modules/mdoc/index.d.mts +3 -3
  579. package/build/modules/mdoc/index.d.ts +3 -3
  580. package/build/modules/mdoc/repository/MdocRecord.d.mts +1 -1
  581. package/build/modules/mdoc/repository/MdocRecord.d.mts.map +1 -1
  582. package/build/modules/mdoc/repository/MdocRecord.d.ts +1 -1
  583. package/build/modules/mdoc/repository/MdocRecord.d.ts.map +1 -1
  584. package/build/modules/mdoc/repository/MdocRecord.mjs.map +1 -1
  585. package/build/modules/sd-jwt-vc/SdJwtVcApi.d.mts +2 -4
  586. package/build/modules/sd-jwt-vc/SdJwtVcApi.d.mts.map +1 -1
  587. package/build/modules/sd-jwt-vc/SdJwtVcApi.d.ts +2 -4
  588. package/build/modules/sd-jwt-vc/SdJwtVcApi.d.ts.map +1 -1
  589. package/build/modules/sd-jwt-vc/SdJwtVcApi.mjs.map +1 -1
  590. package/build/modules/sd-jwt-vc/SdJwtVcModule.d.mts.map +1 -1
  591. package/build/modules/sd-jwt-vc/SdJwtVcModule.d.ts.map +1 -1
  592. package/build/modules/sd-jwt-vc/SdJwtVcModule.mjs.map +1 -1
  593. package/build/modules/sd-jwt-vc/SdJwtVcOptions.d.mts +5 -1
  594. package/build/modules/sd-jwt-vc/SdJwtVcOptions.d.mts.map +1 -1
  595. package/build/modules/sd-jwt-vc/SdJwtVcOptions.d.ts +5 -1
  596. package/build/modules/sd-jwt-vc/SdJwtVcOptions.d.ts.map +1 -1
  597. package/build/modules/sd-jwt-vc/SdJwtVcService.d.mts +4 -5
  598. package/build/modules/sd-jwt-vc/SdJwtVcService.d.mts.map +1 -1
  599. package/build/modules/sd-jwt-vc/SdJwtVcService.d.ts +4 -5
  600. package/build/modules/sd-jwt-vc/SdJwtVcService.d.ts.map +1 -1
  601. package/build/modules/sd-jwt-vc/SdJwtVcService.js +40 -48
  602. package/build/modules/sd-jwt-vc/SdJwtVcService.mjs +41 -49
  603. package/build/modules/sd-jwt-vc/SdJwtVcService.mjs.map +1 -1
  604. package/build/modules/sd-jwt-vc/decodeSdJwtVc.mjs.map +1 -1
  605. package/build/modules/sd-jwt-vc/disclosureFrame.mjs.map +1 -1
  606. package/build/modules/sd-jwt-vc/index.js +1 -1
  607. package/build/modules/sd-jwt-vc/index.mjs +1 -1
  608. package/build/modules/sd-jwt-vc/repository/SdJwtVcRecord.d.mts +1 -1
  609. package/build/modules/sd-jwt-vc/repository/SdJwtVcRecord.d.mts.map +1 -1
  610. package/build/modules/sd-jwt-vc/repository/SdJwtVcRecord.d.ts +1 -1
  611. package/build/modules/sd-jwt-vc/repository/SdJwtVcRecord.d.ts.map +1 -1
  612. package/build/modules/sd-jwt-vc/repository/SdJwtVcRecord.mjs.map +1 -1
  613. package/build/modules/sd-jwt-vc/repository/SdJwtVcRepository.d.mts +1 -1
  614. package/build/modules/sd-jwt-vc/repository/SdJwtVcRepository.d.ts +1 -1
  615. package/build/modules/sd-jwt-vc/utils.js +1 -1
  616. package/build/modules/sd-jwt-vc/utils.mjs +1 -1
  617. package/build/modules/sd-jwt-vc/utils.mjs.map +1 -1
  618. package/build/modules/vc/W3cCredentialService.d.mts +2 -2
  619. package/build/modules/vc/W3cCredentialService.d.mts.map +1 -1
  620. package/build/modules/vc/W3cCredentialService.d.ts +2 -2
  621. package/build/modules/vc/W3cCredentialService.d.ts.map +1 -1
  622. package/build/modules/vc/W3cCredentialService.mjs.map +1 -1
  623. package/build/modules/vc/W3cCredentialServiceOptions.d.mts +2 -2
  624. package/build/modules/vc/W3cCredentialServiceOptions.d.ts +2 -2
  625. package/build/modules/vc/W3cCredentialsApi.d.mts +1 -1
  626. package/build/modules/vc/W3cCredentialsApi.d.mts.map +1 -1
  627. package/build/modules/vc/W3cCredentialsApi.d.ts +1 -1
  628. package/build/modules/vc/W3cCredentialsApi.d.ts.map +1 -1
  629. package/build/modules/vc/W3cCredentialsApi.mjs.map +1 -1
  630. package/build/modules/vc/W3cCredentialsModule.d.mts.map +1 -1
  631. package/build/modules/vc/W3cCredentialsModule.d.ts.map +1 -1
  632. package/build/modules/vc/W3cCredentialsModule.mjs.map +1 -1
  633. package/build/modules/vc/W3cV2CredentialService.d.mts +3 -3
  634. package/build/modules/vc/W3cV2CredentialService.d.ts +3 -3
  635. package/build/modules/vc/W3cV2CredentialService.js +1 -1
  636. package/build/modules/vc/W3cV2CredentialService.mjs +1 -1
  637. package/build/modules/vc/W3cV2CredentialService.mjs.map +1 -1
  638. package/build/modules/vc/W3cV2CredentialServiceOptions.d.mts +3 -3
  639. package/build/modules/vc/W3cV2CredentialServiceOptions.d.mts.map +1 -1
  640. package/build/modules/vc/W3cV2CredentialServiceOptions.d.ts +3 -3
  641. package/build/modules/vc/W3cV2CredentialServiceOptions.d.ts.map +1 -1
  642. package/build/modules/vc/W3cV2CredentialsApi.d.mts +1 -1
  643. package/build/modules/vc/W3cV2CredentialsApi.d.mts.map +1 -1
  644. package/build/modules/vc/W3cV2CredentialsApi.d.ts +1 -1
  645. package/build/modules/vc/W3cV2CredentialsApi.d.ts.map +1 -1
  646. package/build/modules/vc/W3cV2CredentialsApi.mjs.map +1 -1
  647. package/build/modules/vc/W3cV2CredentialsModule.mjs.map +1 -1
  648. package/build/modules/vc/data-integrity/W3cJsonLdCredentialService.d.mts +2 -2
  649. package/build/modules/vc/data-integrity/W3cJsonLdCredentialService.d.mts.map +1 -1
  650. package/build/modules/vc/data-integrity/W3cJsonLdCredentialService.d.ts +2 -2
  651. package/build/modules/vc/data-integrity/W3cJsonLdCredentialService.d.ts.map +1 -1
  652. package/build/modules/vc/data-integrity/W3cJsonLdCredentialService.js +6 -6
  653. package/build/modules/vc/data-integrity/W3cJsonLdCredentialService.mjs +6 -6
  654. package/build/modules/vc/data-integrity/W3cJsonLdCredentialService.mjs.map +1 -1
  655. package/build/modules/vc/data-integrity/deriveProof.d.mts +1 -1
  656. package/build/modules/vc/data-integrity/deriveProof.d.ts +1 -1
  657. package/build/modules/vc/data-integrity/deriveProof.js +1 -1
  658. package/build/modules/vc/data-integrity/deriveProof.mjs +1 -1
  659. package/build/modules/vc/data-integrity/deriveProof.mjs.map +1 -1
  660. package/build/modules/vc/data-integrity/index.js +8 -8
  661. package/build/modules/vc/data-integrity/index.mjs +8 -8
  662. package/build/modules/vc/data-integrity/jsonldUtil.d.mts.map +1 -1
  663. package/build/modules/vc/data-integrity/jsonldUtil.d.ts.map +1 -1
  664. package/build/modules/vc/data-integrity/jsonldUtil.js +1 -1
  665. package/build/modules/vc/data-integrity/jsonldUtil.mjs +1 -1
  666. package/build/modules/vc/data-integrity/jsonldUtil.mjs.map +1 -1
  667. package/build/modules/vc/data-integrity/libraries/contexts/defaultContexts.js +1 -1
  668. package/build/modules/vc/data-integrity/libraries/contexts/defaultContexts.mjs +1 -1
  669. package/build/modules/vc/data-integrity/libraries/contexts/defaultContexts.mjs.map +1 -1
  670. package/build/modules/vc/data-integrity/libraries/documentLoader.d.mts.map +1 -1
  671. package/build/modules/vc/data-integrity/libraries/documentLoader.d.ts.map +1 -1
  672. package/build/modules/vc/data-integrity/libraries/documentLoader.mjs.map +1 -1
  673. package/build/modules/vc/data-integrity/libraries/index.js +1 -1
  674. package/build/modules/vc/data-integrity/libraries/index.mjs +1 -1
  675. package/build/modules/vc/data-integrity/libraries/jsonld-signatures.d.mts.map +1 -1
  676. package/build/modules/vc/data-integrity/libraries/jsonld-signatures.d.ts.map +1 -1
  677. package/build/modules/vc/data-integrity/libraries/jsonld-signatures.mjs.map +1 -1
  678. package/build/modules/vc/data-integrity/libraries/jsonld.mjs.map +1 -1
  679. package/build/modules/vc/data-integrity/libraries/nativeDocumentLoader.mjs.map +1 -1
  680. package/build/modules/vc/data-integrity/libraries/vc.d.mts.map +1 -1
  681. package/build/modules/vc/data-integrity/libraries/vc.d.ts.map +1 -1
  682. package/build/modules/vc/data-integrity/libraries/vc.js +1 -1
  683. package/build/modules/vc/data-integrity/libraries/vc.mjs +1 -1
  684. package/build/modules/vc/data-integrity/libraries/vc.mjs.map +1 -1
  685. package/build/modules/vc/data-integrity/models/IAnonCredsDataIntegrityService.d.mts +2 -2
  686. package/build/modules/vc/data-integrity/models/IAnonCredsDataIntegrityService.d.ts +2 -2
  687. package/build/modules/vc/data-integrity/models/LdKeyPair.d.mts +5 -4
  688. package/build/modules/vc/data-integrity/models/LdKeyPair.d.mts.map +1 -1
  689. package/build/modules/vc/data-integrity/models/LdKeyPair.d.ts +5 -4
  690. package/build/modules/vc/data-integrity/models/LdKeyPair.d.ts.map +1 -1
  691. package/build/modules/vc/data-integrity/models/LdKeyPair.mjs.map +1 -1
  692. package/build/modules/vc/data-integrity/models/ProofTransformer.mjs.map +1 -1
  693. package/build/modules/vc/data-integrity/models/W3cJsonLdVerifiableCredential.d.mts +2 -2
  694. package/build/modules/vc/data-integrity/models/W3cJsonLdVerifiableCredential.d.mts.map +1 -1
  695. package/build/modules/vc/data-integrity/models/W3cJsonLdVerifiableCredential.d.ts +2 -2
  696. package/build/modules/vc/data-integrity/models/W3cJsonLdVerifiableCredential.d.ts.map +1 -1
  697. package/build/modules/vc/data-integrity/models/W3cJsonLdVerifiableCredential.js +1 -1
  698. package/build/modules/vc/data-integrity/models/W3cJsonLdVerifiableCredential.mjs +1 -1
  699. package/build/modules/vc/data-integrity/models/W3cJsonLdVerifiableCredential.mjs.map +1 -1
  700. package/build/modules/vc/data-integrity/models/W3cJsonLdVerifiablePresentation.d.mts +2 -2
  701. package/build/modules/vc/data-integrity/models/W3cJsonLdVerifiablePresentation.d.mts.map +1 -1
  702. package/build/modules/vc/data-integrity/models/W3cJsonLdVerifiablePresentation.d.ts +2 -2
  703. package/build/modules/vc/data-integrity/models/W3cJsonLdVerifiablePresentation.d.ts.map +1 -1
  704. package/build/modules/vc/data-integrity/models/W3cJsonLdVerifiablePresentation.js +1 -1
  705. package/build/modules/vc/data-integrity/models/W3cJsonLdVerifiablePresentation.mjs +1 -1
  706. package/build/modules/vc/data-integrity/models/W3cJsonLdVerifiablePresentation.mjs.map +1 -1
  707. package/build/modules/vc/data-integrity/models/index.js +2 -2
  708. package/build/modules/vc/data-integrity/models/index.mjs +2 -2
  709. package/build/modules/vc/data-integrity/proof-purposes/CredentialIssuancePurpose.d.mts +1 -1
  710. package/build/modules/vc/data-integrity/proof-purposes/CredentialIssuancePurpose.d.ts +1 -1
  711. package/build/modules/vc/data-integrity/proof-purposes/CredentialIssuancePurpose.mjs.map +1 -1
  712. package/build/modules/vc/data-integrity/signature-suites/JwsLinkedDataSignature.d.mts +3 -2
  713. package/build/modules/vc/data-integrity/signature-suites/JwsLinkedDataSignature.d.mts.map +1 -1
  714. package/build/modules/vc/data-integrity/signature-suites/JwsLinkedDataSignature.d.ts +3 -2
  715. package/build/modules/vc/data-integrity/signature-suites/JwsLinkedDataSignature.d.ts.map +1 -1
  716. package/build/modules/vc/data-integrity/signature-suites/JwsLinkedDataSignature.mjs.map +1 -1
  717. package/build/modules/vc/data-integrity/signature-suites/ed25519/Ed25519Signature2018.d.mts.map +1 -1
  718. package/build/modules/vc/data-integrity/signature-suites/ed25519/Ed25519Signature2018.d.ts.map +1 -1
  719. package/build/modules/vc/data-integrity/signature-suites/ed25519/Ed25519Signature2018.mjs.map +1 -1
  720. package/build/modules/vc/data-integrity/signature-suites/ed25519/Ed25519Signature2020.d.mts +3 -2
  721. package/build/modules/vc/data-integrity/signature-suites/ed25519/Ed25519Signature2020.d.mts.map +1 -1
  722. package/build/modules/vc/data-integrity/signature-suites/ed25519/Ed25519Signature2020.d.ts +3 -2
  723. package/build/modules/vc/data-integrity/signature-suites/ed25519/Ed25519Signature2020.d.ts.map +1 -1
  724. package/build/modules/vc/data-integrity/signature-suites/ed25519/Ed25519Signature2020.mjs.map +1 -1
  725. package/build/modules/vc/index.js +14 -14
  726. package/build/modules/vc/index.mjs +14 -14
  727. package/build/modules/vc/jwt-vc/W3cJwtCredentialService.d.mts +2 -2
  728. package/build/modules/vc/jwt-vc/W3cJwtCredentialService.d.mts.map +1 -1
  729. package/build/modules/vc/jwt-vc/W3cJwtCredentialService.d.ts +2 -2
  730. package/build/modules/vc/jwt-vc/W3cJwtCredentialService.d.ts.map +1 -1
  731. package/build/modules/vc/jwt-vc/W3cJwtCredentialService.js +4 -4
  732. package/build/modules/vc/jwt-vc/W3cJwtCredentialService.mjs +4 -4
  733. package/build/modules/vc/jwt-vc/W3cJwtCredentialService.mjs.map +1 -1
  734. package/build/modules/vc/jwt-vc/W3cJwtVerifiableCredential.d.mts +4 -4
  735. package/build/modules/vc/jwt-vc/W3cJwtVerifiableCredential.d.mts.map +1 -1
  736. package/build/modules/vc/jwt-vc/W3cJwtVerifiableCredential.d.ts +4 -4
  737. package/build/modules/vc/jwt-vc/W3cJwtVerifiableCredential.d.ts.map +1 -1
  738. package/build/modules/vc/jwt-vc/W3cJwtVerifiableCredential.mjs.map +1 -1
  739. package/build/modules/vc/jwt-vc/W3cJwtVerifiablePresentation.d.mts +1 -1
  740. package/build/modules/vc/jwt-vc/W3cJwtVerifiablePresentation.d.mts.map +1 -1
  741. package/build/modules/vc/jwt-vc/W3cJwtVerifiablePresentation.d.ts +1 -1
  742. package/build/modules/vc/jwt-vc/W3cJwtVerifiablePresentation.d.ts.map +1 -1
  743. package/build/modules/vc/jwt-vc/W3cJwtVerifiablePresentation.mjs.map +1 -1
  744. package/build/modules/vc/jwt-vc/W3cV2JwtCredentialService.d.mts +2 -2
  745. package/build/modules/vc/jwt-vc/W3cV2JwtCredentialService.d.ts +2 -2
  746. package/build/modules/vc/jwt-vc/W3cV2JwtCredentialService.js +4 -4
  747. package/build/modules/vc/jwt-vc/W3cV2JwtCredentialService.mjs +4 -4
  748. package/build/modules/vc/jwt-vc/W3cV2JwtCredentialService.mjs.map +1 -1
  749. package/build/modules/vc/jwt-vc/W3cV2JwtVerifiableCredential.d.mts +1 -1
  750. package/build/modules/vc/jwt-vc/W3cV2JwtVerifiableCredential.d.ts +1 -1
  751. package/build/modules/vc/jwt-vc/credentialTransformer.mjs.map +1 -1
  752. package/build/modules/vc/jwt-vc/index.js +1 -1
  753. package/build/modules/vc/jwt-vc/index.mjs +1 -1
  754. package/build/modules/vc/jwt-vc/presentationTransformer.mjs.map +1 -1
  755. package/build/modules/vc/models/credential/W3cCredential.d.mts +3 -3
  756. package/build/modules/vc/models/credential/W3cCredential.d.mts.map +1 -1
  757. package/build/modules/vc/models/credential/W3cCredential.d.ts +3 -3
  758. package/build/modules/vc/models/credential/W3cCredential.d.ts.map +1 -1
  759. package/build/modules/vc/models/credential/W3cCredential.js +1 -1
  760. package/build/modules/vc/models/credential/W3cCredential.mjs +1 -1
  761. package/build/modules/vc/models/credential/W3cCredential.mjs.map +1 -1
  762. package/build/modules/vc/models/credential/W3cCredentialSubject.d.mts.map +1 -1
  763. package/build/modules/vc/models/credential/W3cCredentialSubject.d.ts.map +1 -1
  764. package/build/modules/vc/models/credential/W3cCredentialSubject.mjs.map +1 -1
  765. package/build/modules/vc/models/credential/W3cIssuer.d.mts.map +1 -1
  766. package/build/modules/vc/models/credential/W3cIssuer.d.ts.map +1 -1
  767. package/build/modules/vc/models/credential/W3cIssuer.mjs.map +1 -1
  768. package/build/modules/vc/models/credential/W3cV2Credential.d.mts +1 -1
  769. package/build/modules/vc/models/credential/W3cV2Credential.d.ts +1 -1
  770. package/build/modules/vc/models/credential/W3cV2Credential.js +1 -1
  771. package/build/modules/vc/models/credential/W3cV2Credential.mjs +1 -1
  772. package/build/modules/vc/models/credential/W3cV2Credential.mjs.map +1 -1
  773. package/build/modules/vc/models/credential/W3cV2CredentialSchema.js +2 -2
  774. package/build/modules/vc/models/credential/W3cV2CredentialSchema.mjs +2 -2
  775. package/build/modules/vc/models/credential/W3cV2CredentialSchema.mjs.map +1 -1
  776. package/build/modules/vc/models/credential/W3cV2EnvelopedVerifiableCredential.d.mts +1 -1
  777. package/build/modules/vc/models/credential/W3cV2EnvelopedVerifiableCredential.d.ts +1 -1
  778. package/build/modules/vc/models/credential/W3cV2EnvelopedVerifiableCredential.mjs.map +1 -1
  779. package/build/modules/vc/models/credential/W3cV2Evidence.js +2 -2
  780. package/build/modules/vc/models/credential/W3cV2Evidence.mjs +2 -2
  781. package/build/modules/vc/models/credential/W3cV2Evidence.mjs.map +1 -1
  782. package/build/modules/vc/models/credential/W3cV2Issuer.mjs.map +1 -1
  783. package/build/modules/vc/models/credential/W3cV2LocalizedValue.mjs.map +1 -1
  784. package/build/modules/vc/models/credential/W3cVerifiableCredential.d.mts.map +1 -1
  785. package/build/modules/vc/models/credential/W3cVerifiableCredential.d.ts.map +1 -1
  786. package/build/modules/vc/models/credential/W3cVerifiableCredential.mjs.map +1 -1
  787. package/build/modules/vc/models/credential/index.js +1 -1
  788. package/build/modules/vc/models/credential/index.mjs +1 -1
  789. package/build/modules/vc/models/index.js +1 -1
  790. package/build/modules/vc/models/index.mjs +1 -1
  791. package/build/modules/vc/models/presentation/W3cHolder.d.mts.map +1 -1
  792. package/build/modules/vc/models/presentation/W3cHolder.d.ts.map +1 -1
  793. package/build/modules/vc/models/presentation/W3cHolder.mjs.map +1 -1
  794. package/build/modules/vc/models/presentation/W3cJsonPresentation.d.mts +1 -1
  795. package/build/modules/vc/models/presentation/W3cJsonPresentation.d.ts +1 -1
  796. package/build/modules/vc/models/presentation/W3cPresentation.d.mts +2 -2
  797. package/build/modules/vc/models/presentation/W3cPresentation.d.mts.map +1 -1
  798. package/build/modules/vc/models/presentation/W3cPresentation.d.ts +2 -2
  799. package/build/modules/vc/models/presentation/W3cPresentation.d.ts.map +1 -1
  800. package/build/modules/vc/models/presentation/W3cPresentation.mjs.map +1 -1
  801. package/build/modules/vc/models/presentation/W3cV2EnvelopedVerifiablePresentation.d.mts +2 -2
  802. package/build/modules/vc/models/presentation/W3cV2EnvelopedVerifiablePresentation.d.ts +2 -2
  803. package/build/modules/vc/models/presentation/W3cV2EnvelopedVerifiablePresentation.js +1 -1
  804. package/build/modules/vc/models/presentation/W3cV2EnvelopedVerifiablePresentation.mjs +1 -1
  805. package/build/modules/vc/models/presentation/W3cV2EnvelopedVerifiablePresentation.mjs.map +1 -1
  806. package/build/modules/vc/models/presentation/W3cV2Holder.mjs.map +1 -1
  807. package/build/modules/vc/models/presentation/W3cV2JsonPresentation.d.mts +1 -1
  808. package/build/modules/vc/models/presentation/W3cV2JsonPresentation.d.ts +1 -1
  809. package/build/modules/vc/models/presentation/W3cV2Presentation.d.mts +1 -1
  810. package/build/modules/vc/models/presentation/W3cV2Presentation.d.ts +1 -1
  811. package/build/modules/vc/models/presentation/W3cV2Presentation.js +1 -1
  812. package/build/modules/vc/models/presentation/W3cV2Presentation.mjs +1 -1
  813. package/build/modules/vc/models/presentation/W3cV2VerifiablePresentation.d.mts +1 -1
  814. package/build/modules/vc/models/presentation/W3cV2VerifiablePresentation.d.ts +1 -1
  815. package/build/modules/vc/repository/W3cCredentialRecord.d.mts.map +1 -1
  816. package/build/modules/vc/repository/W3cCredentialRecord.d.ts.map +1 -1
  817. package/build/modules/vc/repository/W3cCredentialRecord.mjs.map +1 -1
  818. package/build/modules/vc/repository/W3cV2CredentialRecord.js +1 -1
  819. package/build/modules/vc/repository/W3cV2CredentialRecord.mjs +1 -1
  820. package/build/modules/vc/repository/W3cV2CredentialRecord.mjs.map +1 -1
  821. package/build/modules/vc/sd-jwt-vc/W3cV2SdJwt.d.mts +2 -2
  822. package/build/modules/vc/sd-jwt-vc/W3cV2SdJwt.d.mts.map +1 -1
  823. package/build/modules/vc/sd-jwt-vc/W3cV2SdJwt.d.ts +2 -2
  824. package/build/modules/vc/sd-jwt-vc/W3cV2SdJwt.d.ts.map +1 -1
  825. package/build/modules/vc/sd-jwt-vc/W3cV2SdJwt.mjs.map +1 -1
  826. package/build/modules/vc/sd-jwt-vc/W3cV2SdJwtCredentialService.d.mts +1 -1
  827. package/build/modules/vc/sd-jwt-vc/W3cV2SdJwtCredentialService.d.ts +1 -1
  828. package/build/modules/vc/sd-jwt-vc/W3cV2SdJwtCredentialService.js +3 -3
  829. package/build/modules/vc/sd-jwt-vc/W3cV2SdJwtCredentialService.mjs +3 -3
  830. package/build/modules/vc/sd-jwt-vc/W3cV2SdJwtCredentialService.mjs.map +1 -1
  831. package/build/modules/vc/sd-jwt-vc/W3cV2SdJwtVerifiableCredential.mjs.map +1 -1
  832. package/build/modules/vc/sd-jwt-vc/W3cV2SdJwtVerifiablePresentation.mjs.map +1 -1
  833. package/build/modules/vc/v2-jwt-utils.js +2 -2
  834. package/build/modules/vc/v2-jwt-utils.mjs +2 -2
  835. package/build/modules/vc/v2-jwt-utils.mjs.map +1 -1
  836. package/build/modules/vc/validators.mjs.map +1 -1
  837. package/build/modules/x509/X509Api.d.mts +1 -1
  838. package/build/modules/x509/X509Api.d.ts +1 -1
  839. package/build/modules/x509/X509Api.js +1 -1
  840. package/build/modules/x509/X509Api.mjs +1 -1
  841. package/build/modules/x509/X509Certificate.d.mts +5 -5
  842. package/build/modules/x509/X509Certificate.d.mts.map +1 -1
  843. package/build/modules/x509/X509Certificate.d.ts +5 -5
  844. package/build/modules/x509/X509Certificate.d.ts.map +1 -1
  845. package/build/modules/x509/X509Certificate.js +4 -7
  846. package/build/modules/x509/X509Certificate.mjs +3 -6
  847. package/build/modules/x509/X509Certificate.mjs.map +1 -1
  848. package/build/modules/x509/X509Module.d.mts.map +1 -1
  849. package/build/modules/x509/X509Module.d.ts.map +1 -1
  850. package/build/modules/x509/X509Module.js +1 -1
  851. package/build/modules/x509/X509Module.mjs +1 -1
  852. package/build/modules/x509/X509Module.mjs.map +1 -1
  853. package/build/modules/x509/X509ModuleConfig.d.mts +2 -2
  854. package/build/modules/x509/X509ModuleConfig.d.ts +2 -2
  855. package/build/modules/x509/X509Service.d.mts +1 -1
  856. package/build/modules/x509/X509Service.d.mts.map +1 -1
  857. package/build/modules/x509/X509Service.d.ts +1 -1
  858. package/build/modules/x509/X509Service.d.ts.map +1 -1
  859. package/build/modules/x509/X509Service.js +4 -4
  860. package/build/modules/x509/X509Service.mjs +3 -3
  861. package/build/modules/x509/X509Service.mjs.map +1 -1
  862. package/build/modules/x509/extraction.d.mts +1 -1
  863. package/build/modules/x509/extraction.d.ts +1 -1
  864. package/build/modules/x509/index.js +3 -3
  865. package/build/modules/x509/index.mjs +3 -3
  866. package/build/modules/x509/utils/extensions.d.mts.map +1 -1
  867. package/build/modules/x509/utils/extensions.d.ts.map +1 -1
  868. package/build/modules/x509/utils/extensions.js +1 -1
  869. package/build/modules/x509/utils/extensions.mjs +1 -1
  870. package/build/modules/x509/utils/extensions.mjs.map +1 -1
  871. package/build/modules/x509/utils/index.js +1 -1
  872. package/build/modules/x509/utils/index.mjs +1 -1
  873. package/build/modules/x509/utils/nameConversion.d.mts.map +1 -1
  874. package/build/modules/x509/utils/nameConversion.d.ts.map +1 -1
  875. package/build/modules/x509/utils/nameConversion.mjs.map +1 -1
  876. package/build/plugins/DependencyManager.d.mts.map +1 -1
  877. package/build/plugins/DependencyManager.d.ts.map +1 -1
  878. package/build/plugins/DependencyManager.mjs.map +1 -1
  879. package/build/storage/BaseRecord.mjs.map +1 -1
  880. package/build/storage/Metadata.mjs.map +1 -1
  881. package/build/storage/Repository.d.mts.map +1 -1
  882. package/build/storage/Repository.d.ts.map +1 -1
  883. package/build/storage/Repository.js +1 -1
  884. package/build/storage/Repository.mjs +1 -1
  885. package/build/storage/Repository.mjs.map +1 -1
  886. package/build/storage/RepositoryEvents.mjs.map +1 -1
  887. package/build/storage/StorageService.d.mts +1 -1
  888. package/build/storage/StorageService.d.ts +1 -1
  889. package/build/storage/index.js +1 -1
  890. package/build/storage/index.mjs +1 -1
  891. package/build/storage/migration/StorageUpdateService.d.mts.map +1 -1
  892. package/build/storage/migration/StorageUpdateService.d.ts.map +1 -1
  893. package/build/storage/migration/StorageUpdateService.js +1 -1
  894. package/build/storage/migration/StorageUpdateService.mjs +1 -1
  895. package/build/storage/migration/StorageUpdateService.mjs.map +1 -1
  896. package/build/storage/migration/UpdateAssistant.d.mts +1 -1
  897. package/build/storage/migration/UpdateAssistant.d.mts.map +1 -1
  898. package/build/storage/migration/UpdateAssistant.d.ts +1 -1
  899. package/build/storage/migration/UpdateAssistant.d.ts.map +1 -1
  900. package/build/storage/migration/UpdateAssistant.js +1 -1
  901. package/build/storage/migration/UpdateAssistant.mjs +1 -1
  902. package/build/storage/migration/UpdateAssistant.mjs.map +1 -1
  903. package/build/storage/migration/index.js +1 -1
  904. package/build/storage/migration/index.mjs +1 -1
  905. package/build/storage/migration/isUpToDate.d.mts.map +1 -1
  906. package/build/storage/migration/isUpToDate.d.ts.map +1 -1
  907. package/build/storage/migration/isUpToDate.js +1 -1
  908. package/build/storage/migration/isUpToDate.mjs +1 -1
  909. package/build/storage/migration/isUpToDate.mjs.map +1 -1
  910. package/build/storage/migration/updates/0.3.1-0.4/cache.mjs.map +1 -1
  911. package/build/storage/migration/updates/0.4-0.5/w3cCredentialRecord.mjs.map +1 -1
  912. package/build/storage/migration/updates.d.mts +1 -1
  913. package/build/storage/migration/updates.d.mts.map +1 -1
  914. package/build/storage/migration/updates.d.ts +1 -1
  915. package/build/storage/migration/updates.d.ts.map +1 -1
  916. package/build/storage/migration/updates.js +4 -4
  917. package/build/storage/migration/updates.mjs +1 -1
  918. package/build/storage/migration/updates.mjs.map +1 -1
  919. package/build/types.d.mts +12 -1
  920. package/build/types.d.mts.map +1 -1
  921. package/build/types.d.ts +12 -1
  922. package/build/types.d.ts.map +1 -1
  923. package/build/types.mjs.map +1 -1
  924. package/build/utils/HashlinkEncoder.d.mts +1 -1
  925. package/build/utils/HashlinkEncoder.d.mts.map +1 -1
  926. package/build/utils/HashlinkEncoder.d.ts +1 -1
  927. package/build/utils/HashlinkEncoder.d.ts.map +1 -1
  928. package/build/utils/HashlinkEncoder.mjs.map +1 -1
  929. package/build/utils/JsonEncoder.d.mts +3 -2
  930. package/build/utils/JsonEncoder.d.mts.map +1 -1
  931. package/build/utils/JsonEncoder.d.ts +3 -2
  932. package/build/utils/JsonEncoder.d.ts.map +1 -1
  933. package/build/utils/JsonEncoder.js +8 -8
  934. package/build/utils/JsonEncoder.mjs +4 -3
  935. package/build/utils/JsonEncoder.mjs.map +1 -1
  936. package/build/utils/JsonTransformer.mjs.map +1 -1
  937. package/build/utils/MessageValidator.mjs.map +1 -1
  938. package/build/utils/MultiBaseEncoder.d.mts +4 -2
  939. package/build/utils/MultiBaseEncoder.d.mts.map +1 -1
  940. package/build/utils/MultiBaseEncoder.d.ts +4 -2
  941. package/build/utils/MultiBaseEncoder.d.ts.map +1 -1
  942. package/build/utils/MultiBaseEncoder.mjs.map +1 -1
  943. package/build/utils/MultiHashEncoder.d.mts +5 -5
  944. package/build/utils/MultiHashEncoder.d.mts.map +1 -1
  945. package/build/utils/MultiHashEncoder.d.ts +5 -5
  946. package/build/utils/MultiHashEncoder.d.ts.map +1 -1
  947. package/build/utils/MultiHashEncoder.js +5 -7
  948. package/build/utils/MultiHashEncoder.mjs +5 -4
  949. package/build/utils/MultiHashEncoder.mjs.map +1 -1
  950. package/build/utils/TypedArrayEncoder.d.mts +12 -9
  951. package/build/utils/TypedArrayEncoder.d.mts.map +1 -1
  952. package/build/utils/TypedArrayEncoder.d.ts +12 -9
  953. package/build/utils/TypedArrayEncoder.d.ts.map +1 -1
  954. package/build/utils/TypedArrayEncoder.js +22 -17
  955. package/build/utils/TypedArrayEncoder.mjs +7 -1
  956. package/build/utils/TypedArrayEncoder.mjs.map +1 -1
  957. package/build/utils/VarintEncoder.js +1 -4
  958. package/build/utils/VarintEncoder.mjs +1 -2
  959. package/build/utils/VarintEncoder.mjs.map +1 -1
  960. package/build/utils/base58.mjs.map +1 -1
  961. package/build/utils/buffer.d.mts +1 -1
  962. package/build/utils/buffer.d.ts +1 -1
  963. package/build/utils/buffer.mjs +1 -1
  964. package/build/utils/deepEquality.mjs.map +1 -1
  965. package/build/utils/index.js +10 -11
  966. package/build/utils/index.mjs +9 -9
  967. package/build/utils/objectEquality.mjs.map +1 -1
  968. package/build/utils/timestamp.d.mts +10 -2
  969. package/build/utils/timestamp.d.mts.map +1 -1
  970. package/build/utils/timestamp.d.ts +10 -2
  971. package/build/utils/timestamp.d.ts.map +1 -1
  972. package/build/utils/timestamp.js +9 -1
  973. package/build/utils/timestamp.mjs +8 -2
  974. package/build/utils/timestamp.mjs.map +1 -1
  975. package/build/utils/transformers.d.mts.map +1 -1
  976. package/build/utils/transformers.d.ts.map +1 -1
  977. package/build/utils/transformers.mjs.map +1 -1
  978. package/build/utils/validators.d.mts.map +1 -1
  979. package/build/utils/validators.d.ts.map +1 -1
  980. package/build/utils/validators.mjs.map +1 -1
  981. package/build/utils/zod.js +2 -0
  982. package/build/utils/zod.mjs +2 -1
  983. package/build/utils/zod.mjs.map +1 -1
  984. package/package.json +25 -25
  985. package/build/utils/buffer.js +0 -5
@@ -1,17 +1,17 @@
1
1
 
2
2
 
3
+ import { DidJwk } from "./jwk/DidJwk.mjs";
4
+ import { JwkDidRegistrar } from "./jwk/JwkDidRegistrar.mjs";
5
+ import { JwkDidResolver } from "./jwk/JwkDidResolver.mjs";
6
+ import "./jwk/index.mjs";
3
7
  import { DidKey } from "./key/DidKey.mjs";
4
8
  import { KeyDidRegistrar } from "./key/KeyDidRegistrar.mjs";
5
9
  import { KeyDidResolver } from "./key/KeyDidResolver.mjs";
6
10
  import "./key/index.mjs";
11
+ import { createPeerDidDocumentFromServices } from "./peer/createPeerDidDocumentFromServices.mjs";
7
12
  import { PeerDidNumAlgo, getAlternativeDidsForPeerDid, getNumAlgoFromPeerDid, isValidPeerDid } from "./peer/didPeer.mjs";
8
13
  import { PeerDidRegistrar } from "./peer/PeerDidRegistrar.mjs";
9
14
  import { PeerDidResolver } from "./peer/PeerDidResolver.mjs";
10
- import { createPeerDidDocumentFromServices } from "./peer/createPeerDidDocumentFromServices.mjs";
11
15
  import "./peer/index.mjs";
12
16
  import { WebDidResolver } from "./web/WebDidResolver.mjs";
13
17
  import "./web/index.mjs";
14
- import { DidJwk } from "./jwk/DidJwk.mjs";
15
- import { JwkDidRegistrar } from "./jwk/JwkDidRegistrar.mjs";
16
- import { JwkDidResolver } from "./jwk/JwkDidResolver.mjs";
17
- import "./jwk/index.mjs";
@@ -1,5 +1,5 @@
1
- import { DidDocument } from "../../domain/DidDocument.mjs";
2
1
  import { PublicJwk } from "../../../kms/jwk/PublicJwk.mjs";
2
+ import { DidDocument } from "../../domain/DidDocument.mjs";
3
3
 
4
4
  //#region src/modules/dids/methods/jwk/DidJwk.d.ts
5
5
  declare class DidJwk {
@@ -1,5 +1,5 @@
1
- import { DidDocument } from "../../domain/DidDocument.js";
2
1
  import { PublicJwk } from "../../../kms/jwk/PublicJwk.js";
2
+ import { DidDocument } from "../../domain/DidDocument.js";
3
3
 
4
4
  //#region src/modules/dids/methods/jwk/DidJwk.d.ts
5
5
  declare class DidJwk {
@@ -1,8 +1,8 @@
1
+ import { KmsCreateKeyOptions, KmsCreateKeyTypeAssymetric } from "../../../kms/options/KmsCreateKeyOptions.mjs";
2
+ import { XOR } from "../../../../types.mjs";
1
3
  import { DidRegistrar } from "../../domain/DidRegistrar.mjs";
2
4
  import { DidCreateOptions, DidCreateResult, DidDeactivateResult, DidUpdateResult } from "../../types.mjs";
3
5
  import { AgentContext } from "../../../../agent/context/AgentContext.mjs";
4
- import { KmsCreateKeyOptions, KmsCreateKeyTypeAssymetric } from "../../../kms/options/KmsCreateKeyOptions.mjs";
5
- import { XOR } from "../../../../types.mjs";
6
6
 
7
7
  //#region src/modules/dids/methods/jwk/JwkDidRegistrar.d.ts
8
8
  declare class JwkDidRegistrar implements DidRegistrar {
@@ -1 +1 @@
1
- {"version":3,"file":"JwkDidRegistrar.d.mts","names":[],"sources":["../../../../../src/modules/dids/methods/jwk/JwkDidRegistrar.ts"],"sourcesContent":[],"mappings":";;;;;;;cAiBa,eAAA,YAA2B;;uBAGJ,uBAAuB,sBAAsB,QAAQ;YAqFhE,QAAQ;EAxFpB,UAAA,CAAA,CAAA,EAmGgB,OAnGA,CAmGQ,mBAnGR,CAAA;;AAGO,UA4GnB,mBAAA,SAA4B,gBA5GT,CAAA;QAAuB,EAAA,KAAA;KAA8B,CAAA,EAAA,KAAA;aAAR,CAAA,EAAA,KAAA;QAqFhD,CAAA,EAAA,KAAA;;;;;EAxFmB,OAAA,EA0HzC,GA1HyC,CAAA;IA+GnC,SAAA,EAWW,mBAXS,CAWW,0BAXX,CAAA;EAAA,CAAA,EAAA;IAWW,KAAA,EAAA,MAAA;;;AAXH,KAejC,mBAAA,GAfiC,KAAA;AAAgB,KAgBjD,uBAAA,GAhBiD,KAAA"}
1
+ {"version":3,"file":"JwkDidRegistrar.d.mts","names":[],"sources":["../../../../../src/modules/dids/methods/jwk/JwkDidRegistrar.ts"],"sourcesContent":[],"mappings":";;;;;;;cAgBa,eAAA,YAA2B;;uBAGJ,uBAAuB,sBAAsB,QAAQ;YAqFhE,QAAQ;EAxFpB,UAAA,CAAA,CAAA,EAmGgB,OAnGA,CAmGQ,mBAnGR,CAAA;;AAGO,UA4GnB,mBAAA,SAA4B,gBA5GT,CAAA;QAAuB,EAAA,KAAA;KAA8B,CAAA,EAAA,KAAA;aAAR,CAAA,EAAA,KAAA;QAqFhD,CAAA,EAAA,KAAA;;;;;EAxFmB,OAAA,EA0HzC,GA1HyC,CAAA;IA+GnC,SAAA,EAWW,mBAXS,CAWW,0BAXX,CAAA;EAAA,CAAA,EAAA;IAWW,KAAA,EAAA,MAAA;;;AAXH,KAejC,mBAAA,GAfiC,KAAA;AAAgB,KAgBjD,uBAAA,GAhBiD,KAAA"}
@@ -1,8 +1,8 @@
1
+ import { KmsCreateKeyOptions, KmsCreateKeyTypeAssymetric } from "../../../kms/options/KmsCreateKeyOptions.js";
2
+ import { XOR } from "../../../../types.js";
1
3
  import { DidRegistrar } from "../../domain/DidRegistrar.js";
2
4
  import { DidCreateOptions, DidCreateResult, DidDeactivateResult, DidUpdateResult } from "../../types.js";
3
5
  import { AgentContext } from "../../../../agent/context/AgentContext.js";
4
- import { KmsCreateKeyOptions, KmsCreateKeyTypeAssymetric } from "../../../kms/options/KmsCreateKeyOptions.js";
5
- import { XOR } from "../../../../types.js";
6
6
 
7
7
  //#region src/modules/dids/methods/jwk/JwkDidRegistrar.d.ts
8
8
  declare class JwkDidRegistrar implements DidRegistrar {
@@ -1 +1 @@
1
- {"version":3,"file":"JwkDidRegistrar.d.ts","names":[],"sources":["../../../../../src/modules/dids/methods/jwk/JwkDidRegistrar.ts"],"sourcesContent":[],"mappings":";;;;;;;cAiBa,eAAA,YAA2B;;EAA3B,MAAA,CAAA,YAAgB,EAGO,YAHP,EAAA,OAAA,EAG8B,mBAH9B,CAAA,EAGoD,OAHpD,CAG4D,eAH5D,CAAA;EAAA,MAAA,CAAA,CAAA,EAwFJ,OAxFI,CAwFI,eAxFJ,CAAA;YAGO,CAAA,CAAA,EAgGP,OAhGO,CAgGC,mBAhGD,CAAA;;AAAqD,UA4GxE,mBAAA,SAA4B,gBA5G4C,CAAA;QAAR,EAAA,KAAA;KAqFhD,CAAA,EAAA,KAAA;aAAR,CAAA,EAAA,KAAA;QAWY,CAAA,EAAA,KAAA;;;;AAYrC;EAAqC,OAAA,EAW1B,GAX0B,CAAA;IAWW,SAAA,EAApB,mBAAoB,CAAA,0BAAA,CAAA;KAApB;IAAjB,KAAA,EAAA,MAAA;;;AAIC,KAAA,mBAAA,GAAmB,KAAA;AACnB,KAAA,uBAAA,GAAuB,KAAA"}
1
+ {"version":3,"file":"JwkDidRegistrar.d.ts","names":[],"sources":["../../../../../src/modules/dids/methods/jwk/JwkDidRegistrar.ts"],"sourcesContent":[],"mappings":";;;;;;;cAgBa,eAAA,YAA2B;;EAA3B,MAAA,CAAA,YAAgB,EAGO,YAHP,EAAA,OAAA,EAG8B,mBAH9B,CAAA,EAGoD,OAHpD,CAG4D,eAH5D,CAAA;EAAA,MAAA,CAAA,CAAA,EAwFJ,OAxFI,CAwFI,eAxFJ,CAAA;YAGO,CAAA,CAAA,EAgGP,OAhGO,CAgGC,mBAhGD,CAAA;;AAAqD,UA4GxE,mBAAA,SAA4B,gBA5G4C,CAAA;QAAR,EAAA,KAAA;KAqFhD,CAAA,EAAA,KAAA;aAAR,CAAA,EAAA,KAAA;QAWY,CAAA,EAAA,KAAA;;;;AAYrC;EAAqC,OAAA,EAW1B,GAX0B,CAAA;IAWW,SAAA,EAApB,mBAAoB,CAAA,0BAAA,CAAA;KAApB;IAAjB,KAAA,EAAA,MAAA;;;AAIC,KAAA,mBAAA,GAAmB,KAAA;AACnB,KAAA,uBAAA,GAAuB,KAAA"}
@@ -4,10 +4,10 @@ const require_PublicJwk = require('../../../kms/jwk/PublicJwk.js');
4
4
  const require_KeyManagementApi = require('../../../kms/KeyManagementApi.js');
5
5
  require('../../../kms/index.js');
6
6
  const require_DidDocumentRole = require('../../domain/DidDocumentRole.js');
7
+ const require_DidJwk = require('./DidJwk.js');
7
8
  const require_DidRecord = require('../../repository/DidRecord.js');
8
9
  const require_DidRepository = require('../../repository/DidRepository.js');
9
10
  require('../../repository/index.js');
10
- const require_DidJwk = require('./DidJwk.js');
11
11
 
12
12
  //#region src/modules/dids/methods/jwk/JwkDidRegistrar.ts
13
13
  var JwkDidRegistrar = class {
@@ -4,10 +4,10 @@ import { PublicJwk } from "../../../kms/jwk/PublicJwk.mjs";
4
4
  import { KeyManagementApi } from "../../../kms/KeyManagementApi.mjs";
5
5
  import "../../../kms/index.mjs";
6
6
  import { DidDocumentRole } from "../../domain/DidDocumentRole.mjs";
7
+ import { DidJwk } from "./DidJwk.mjs";
7
8
  import { DidRecord } from "../../repository/DidRecord.mjs";
8
9
  import { DidRepository } from "../../repository/DidRepository.mjs";
9
10
  import "../../repository/index.mjs";
10
- import { DidJwk } from "./DidJwk.mjs";
11
11
 
12
12
  //#region src/modules/dids/methods/jwk/JwkDidRegistrar.ts
13
13
  var JwkDidRegistrar = class {
@@ -1 +1 @@
1
- {"version":3,"file":"JwkDidRegistrar.mjs","names":["publicJwk: KmsJwkPublicAsymmetric","keyId: string"],"sources":["../../../../../src/modules/dids/methods/jwk/JwkDidRegistrar.ts"],"sourcesContent":["import type { AgentContext } from '../../../../agent'\nimport type { DidRegistrar } from '../../domain/DidRegistrar'\nimport type { DidCreateOptions, DidCreateResult, DidDeactivateResult, DidUpdateResult } from '../../types'\n\nimport { DidDocumentRole } from '../../domain/DidDocumentRole'\nimport { DidRecord, DidRepository } from '../../repository'\n\nimport type { XOR } from '../../../../types'\nimport {\n KeyManagementApi,\n type KmsCreateKeyOptions,\n type KmsCreateKeyTypeAssymetric,\n type KmsJwkPublicAsymmetric,\n PublicJwk,\n} from '../../../kms'\nimport { DidJwk } from './DidJwk'\n\nexport class JwkDidRegistrar implements DidRegistrar {\n public readonly supportedMethods = ['jwk']\n\n public async create(agentContext: AgentContext, options: JwkDidCreateOptions): Promise<DidCreateResult> {\n const didRepository = agentContext.dependencyManager.resolve(DidRepository)\n\n try {\n let publicJwk: KmsJwkPublicAsymmetric\n let keyId: string\n const kms = agentContext.dependencyManager.resolve(KeyManagementApi)\n\n if (options.options.createKey) {\n const createKeyResult = await kms.createKey(options.options.createKey)\n publicJwk = createKeyResult.publicJwk\n keyId = createKeyResult.keyId\n } else if (options.options.keyId) {\n const _publicJwk = await kms.getPublicKey({ keyId: options.options.keyId })\n keyId = options.options.keyId\n if (!_publicJwk) {\n return {\n didDocumentMetadata: {},\n didRegistrationMetadata: {},\n didState: {\n state: 'failed',\n reason: `notFound: key with key id '${options.options.keyId}' not found`,\n },\n }\n }\n\n if (_publicJwk.kty === 'oct') {\n return {\n didDocumentMetadata: {},\n didRegistrationMetadata: {},\n didState: {\n state: 'failed',\n reason: `notFound: key with key id '${options.options.keyId}' uses unsupported kty 'oct' for did:jwk`,\n },\n }\n }\n\n publicJwk = _publicJwk\n } else {\n return {\n didDocumentMetadata: {},\n didRegistrationMetadata: {},\n didState: {\n state: 'failed',\n reason: 'Missing keyId or createKey',\n },\n }\n }\n\n const didJwk = DidJwk.fromPublicJwk(PublicJwk.fromPublicJwk(publicJwk))\n\n // Save the did so we know we created it and can issue with it\n const didRecord = new DidRecord({\n did: didJwk.did,\n role: DidDocumentRole.Created,\n keys: [\n {\n didDocumentRelativeKeyId: '#0',\n kmsKeyId: keyId,\n },\n ],\n })\n await didRepository.save(agentContext, didRecord)\n\n return {\n didDocumentMetadata: {},\n didRegistrationMetadata: {},\n didState: {\n state: 'finished',\n did: didJwk.did,\n didDocument: didJwk.didDocument,\n },\n }\n } catch (error) {\n return {\n didDocumentMetadata: {},\n didRegistrationMetadata: {},\n didState: {\n state: 'failed',\n reason: `unknownError: ${error.message}`,\n },\n }\n }\n }\n\n public async update(): Promise<DidUpdateResult> {\n return {\n didDocumentMetadata: {},\n didRegistrationMetadata: {},\n didState: {\n state: 'failed',\n reason: 'notSupported: cannot update did:jwk did',\n },\n }\n }\n\n public async deactivate(): Promise<DidDeactivateResult> {\n return {\n didDocumentMetadata: {},\n didRegistrationMetadata: {},\n didState: {\n state: 'failed',\n reason: 'notSupported: cannot deactivate did:jwk did',\n },\n }\n }\n}\n\nexport interface JwkDidCreateOptions extends DidCreateOptions {\n method: 'jwk'\n // For now we don't support creating a did:jwk with a did or did document\n did?: never\n didDocument?: never\n secret?: never\n\n /**\n * You can create a did:jwk based on an existing `keyId`, or provide `createKey` options\n * to create a new key.\n */\n options: XOR<{ createKey: KmsCreateKeyOptions<KmsCreateKeyTypeAssymetric> }, { keyId: string }>\n}\n\n// Update and Deactivate not supported for did:jwk\nexport type JwkDidUpdateOptions = never\nexport type JwkDidDeactivateOptions = never\n"],"mappings":";;;;;;;;;;;;AAiBA,IAAa,kBAAb,MAAqD;;OACnC,mBAAmB,CAAC,MAAM;;CAE1C,MAAa,OAAO,cAA4B,SAAwD;EACtG,MAAM,gBAAgB,aAAa,kBAAkB,QAAQ,cAAc;AAE3E,MAAI;GACF,IAAIA;GACJ,IAAIC;GACJ,MAAM,MAAM,aAAa,kBAAkB,QAAQ,iBAAiB;AAEpE,OAAI,QAAQ,QAAQ,WAAW;IAC7B,MAAM,kBAAkB,MAAM,IAAI,UAAU,QAAQ,QAAQ,UAAU;AACtE,gBAAY,gBAAgB;AAC5B,YAAQ,gBAAgB;cACf,QAAQ,QAAQ,OAAO;IAChC,MAAM,aAAa,MAAM,IAAI,aAAa,EAAE,OAAO,QAAQ,QAAQ,OAAO,CAAC;AAC3E,YAAQ,QAAQ,QAAQ;AACxB,QAAI,CAAC,WACH,QAAO;KACL,qBAAqB,EAAE;KACvB,yBAAyB,EAAE;KAC3B,UAAU;MACR,OAAO;MACP,QAAQ,8BAA8B,QAAQ,QAAQ,MAAM;MAC7D;KACF;AAGH,QAAI,WAAW,QAAQ,MACrB,QAAO;KACL,qBAAqB,EAAE;KACvB,yBAAyB,EAAE;KAC3B,UAAU;MACR,OAAO;MACP,QAAQ,8BAA8B,QAAQ,QAAQ,MAAM;MAC7D;KACF;AAGH,gBAAY;SAEZ,QAAO;IACL,qBAAqB,EAAE;IACvB,yBAAyB,EAAE;IAC3B,UAAU;KACR,OAAO;KACP,QAAQ;KACT;IACF;GAGH,MAAM,SAAS,OAAO,cAAc,UAAU,cAAc,UAAU,CAAC;GAGvE,MAAM,YAAY,IAAI,UAAU;IAC9B,KAAK,OAAO;IACZ,MAAM,gBAAgB;IACtB,MAAM,CACJ;KACE,0BAA0B;KAC1B,UAAU;KACX,CACF;IACF,CAAC;AACF,SAAM,cAAc,KAAK,cAAc,UAAU;AAEjD,UAAO;IACL,qBAAqB,EAAE;IACvB,yBAAyB,EAAE;IAC3B,UAAU;KACR,OAAO;KACP,KAAK,OAAO;KACZ,aAAa,OAAO;KACrB;IACF;WACM,OAAO;AACd,UAAO;IACL,qBAAqB,EAAE;IACvB,yBAAyB,EAAE;IAC3B,UAAU;KACR,OAAO;KACP,QAAQ,iBAAiB,MAAM;KAChC;IACF;;;CAIL,MAAa,SAAmC;AAC9C,SAAO;GACL,qBAAqB,EAAE;GACvB,yBAAyB,EAAE;GAC3B,UAAU;IACR,OAAO;IACP,QAAQ;IACT;GACF;;CAGH,MAAa,aAA2C;AACtD,SAAO;GACL,qBAAqB,EAAE;GACvB,yBAAyB,EAAE;GAC3B,UAAU;IACR,OAAO;IACP,QAAQ;IACT;GACF"}
1
+ {"version":3,"file":"JwkDidRegistrar.mjs","names":["publicJwk: KmsJwkPublicAsymmetric","keyId: string"],"sources":["../../../../../src/modules/dids/methods/jwk/JwkDidRegistrar.ts"],"sourcesContent":["import type { AgentContext } from '../../../../agent'\nimport type { XOR } from '../../../../types'\nimport {\n KeyManagementApi,\n type KmsCreateKeyOptions,\n type KmsCreateKeyTypeAssymetric,\n type KmsJwkPublicAsymmetric,\n PublicJwk,\n} from '../../../kms'\n\nimport { DidDocumentRole } from '../../domain/DidDocumentRole'\nimport type { DidRegistrar } from '../../domain/DidRegistrar'\nimport { DidRecord, DidRepository } from '../../repository'\nimport type { DidCreateOptions, DidCreateResult, DidDeactivateResult, DidUpdateResult } from '../../types'\nimport { DidJwk } from './DidJwk'\n\nexport class JwkDidRegistrar implements DidRegistrar {\n public readonly supportedMethods = ['jwk']\n\n public async create(agentContext: AgentContext, options: JwkDidCreateOptions): Promise<DidCreateResult> {\n const didRepository = agentContext.dependencyManager.resolve(DidRepository)\n\n try {\n let publicJwk: KmsJwkPublicAsymmetric\n let keyId: string\n const kms = agentContext.dependencyManager.resolve(KeyManagementApi)\n\n if (options.options.createKey) {\n const createKeyResult = await kms.createKey(options.options.createKey)\n publicJwk = createKeyResult.publicJwk\n keyId = createKeyResult.keyId\n } else if (options.options.keyId) {\n const _publicJwk = await kms.getPublicKey({ keyId: options.options.keyId })\n keyId = options.options.keyId\n if (!_publicJwk) {\n return {\n didDocumentMetadata: {},\n didRegistrationMetadata: {},\n didState: {\n state: 'failed',\n reason: `notFound: key with key id '${options.options.keyId}' not found`,\n },\n }\n }\n\n if (_publicJwk.kty === 'oct') {\n return {\n didDocumentMetadata: {},\n didRegistrationMetadata: {},\n didState: {\n state: 'failed',\n reason: `notFound: key with key id '${options.options.keyId}' uses unsupported kty 'oct' for did:jwk`,\n },\n }\n }\n\n publicJwk = _publicJwk\n } else {\n return {\n didDocumentMetadata: {},\n didRegistrationMetadata: {},\n didState: {\n state: 'failed',\n reason: 'Missing keyId or createKey',\n },\n }\n }\n\n const didJwk = DidJwk.fromPublicJwk(PublicJwk.fromPublicJwk(publicJwk))\n\n // Save the did so we know we created it and can issue with it\n const didRecord = new DidRecord({\n did: didJwk.did,\n role: DidDocumentRole.Created,\n keys: [\n {\n didDocumentRelativeKeyId: '#0',\n kmsKeyId: keyId,\n },\n ],\n })\n await didRepository.save(agentContext, didRecord)\n\n return {\n didDocumentMetadata: {},\n didRegistrationMetadata: {},\n didState: {\n state: 'finished',\n did: didJwk.did,\n didDocument: didJwk.didDocument,\n },\n }\n } catch (error) {\n return {\n didDocumentMetadata: {},\n didRegistrationMetadata: {},\n didState: {\n state: 'failed',\n reason: `unknownError: ${error.message}`,\n },\n }\n }\n }\n\n public async update(): Promise<DidUpdateResult> {\n return {\n didDocumentMetadata: {},\n didRegistrationMetadata: {},\n didState: {\n state: 'failed',\n reason: 'notSupported: cannot update did:jwk did',\n },\n }\n }\n\n public async deactivate(): Promise<DidDeactivateResult> {\n return {\n didDocumentMetadata: {},\n didRegistrationMetadata: {},\n didState: {\n state: 'failed',\n reason: 'notSupported: cannot deactivate did:jwk did',\n },\n }\n }\n}\n\nexport interface JwkDidCreateOptions extends DidCreateOptions {\n method: 'jwk'\n // For now we don't support creating a did:jwk with a did or did document\n did?: never\n didDocument?: never\n secret?: never\n\n /**\n * You can create a did:jwk based on an existing `keyId`, or provide `createKey` options\n * to create a new key.\n */\n options: XOR<{ createKey: KmsCreateKeyOptions<KmsCreateKeyTypeAssymetric> }, { keyId: string }>\n}\n\n// Update and Deactivate not supported for did:jwk\nexport type JwkDidUpdateOptions = never\nexport type JwkDidDeactivateOptions = never\n"],"mappings":";;;;;;;;;;;;AAgBA,IAAa,kBAAb,MAAqD;;OACnC,mBAAmB,CAAC,MAAM;;CAE1C,MAAa,OAAO,cAA4B,SAAwD;EACtG,MAAM,gBAAgB,aAAa,kBAAkB,QAAQ,cAAc;AAE3E,MAAI;GACF,IAAIA;GACJ,IAAIC;GACJ,MAAM,MAAM,aAAa,kBAAkB,QAAQ,iBAAiB;AAEpE,OAAI,QAAQ,QAAQ,WAAW;IAC7B,MAAM,kBAAkB,MAAM,IAAI,UAAU,QAAQ,QAAQ,UAAU;AACtE,gBAAY,gBAAgB;AAC5B,YAAQ,gBAAgB;cACf,QAAQ,QAAQ,OAAO;IAChC,MAAM,aAAa,MAAM,IAAI,aAAa,EAAE,OAAO,QAAQ,QAAQ,OAAO,CAAC;AAC3E,YAAQ,QAAQ,QAAQ;AACxB,QAAI,CAAC,WACH,QAAO;KACL,qBAAqB,EAAE;KACvB,yBAAyB,EAAE;KAC3B,UAAU;MACR,OAAO;MACP,QAAQ,8BAA8B,QAAQ,QAAQ,MAAM;MAC7D;KACF;AAGH,QAAI,WAAW,QAAQ,MACrB,QAAO;KACL,qBAAqB,EAAE;KACvB,yBAAyB,EAAE;KAC3B,UAAU;MACR,OAAO;MACP,QAAQ,8BAA8B,QAAQ,QAAQ,MAAM;MAC7D;KACF;AAGH,gBAAY;SAEZ,QAAO;IACL,qBAAqB,EAAE;IACvB,yBAAyB,EAAE;IAC3B,UAAU;KACR,OAAO;KACP,QAAQ;KACT;IACF;GAGH,MAAM,SAAS,OAAO,cAAc,UAAU,cAAc,UAAU,CAAC;GAGvE,MAAM,YAAY,IAAI,UAAU;IAC9B,KAAK,OAAO;IACZ,MAAM,gBAAgB;IACtB,MAAM,CACJ;KACE,0BAA0B;KAC1B,UAAU;KACX,CACF;IACF,CAAC;AACF,SAAM,cAAc,KAAK,cAAc,UAAU;AAEjD,UAAO;IACL,qBAAqB,EAAE;IACvB,yBAAyB,EAAE;IAC3B,UAAU;KACR,OAAO;KACP,KAAK,OAAO;KACZ,aAAa,OAAO;KACrB;IACF;WACM,OAAO;AACd,UAAO;IACL,qBAAqB,EAAE;IACvB,yBAAyB,EAAE;IAC3B,UAAU;KACR,OAAO;KACP,QAAQ,iBAAiB,MAAM;KAChC;IACF;;;CAIL,MAAa,SAAmC;AAC9C,SAAO;GACL,qBAAqB,EAAE;GACvB,yBAAyB,EAAE;GAC3B,UAAU;IACR,OAAO;IACP,QAAQ;IACT;GACF;;CAGH,MAAa,aAA2C;AACtD,SAAO;GACL,qBAAqB,EAAE;GACvB,yBAAyB,EAAE;GAC3B,UAAU;IACR,OAAO;IACP,QAAQ;IACT;GACF"}
@@ -2,10 +2,10 @@
2
2
 
3
3
  const require_CredoError = require('../../../../error/CredoError.js');
4
4
  require('../../../../error/index.js');
5
+ const require_constants = require('../../../vc/constants.js');
5
6
  const require_JsonWebKey2020 = require('../../domain/verificationMethod/JsonWebKey2020.js');
6
7
  const require_DidDocumentBuilder = require('../../domain/DidDocumentBuilder.js');
7
8
  require('../../domain/index.js');
8
- const require_constants = require('../../../vc/constants.js');
9
9
 
10
10
  //#region src/modules/dids/methods/jwk/didJwkDidDocument.ts
11
11
  function getDidJwkDocument(didJwk) {
@@ -2,10 +2,10 @@
2
2
 
3
3
  import { CredoError } from "../../../../error/CredoError.mjs";
4
4
  import "../../../../error/index.mjs";
5
+ import { SECURITY_JWS_CONTEXT_URL } from "../../../vc/constants.mjs";
5
6
  import { getJsonWebKey2020 } from "../../domain/verificationMethod/JsonWebKey2020.mjs";
6
7
  import { DidDocumentBuilder } from "../../domain/DidDocumentBuilder.mjs";
7
8
  import "../../domain/index.mjs";
8
- import { SECURITY_JWS_CONTEXT_URL } from "../../../vc/constants.mjs";
9
9
 
10
10
  //#region src/modules/dids/methods/jwk/didJwkDidDocument.ts
11
11
  function getDidJwkDocument(didJwk) {
@@ -1 +1 @@
1
- {"version":3,"file":"didJwkDidDocument.mjs","names":[],"sources":["../../../../../src/modules/dids/methods/jwk/didJwkDidDocument.ts"],"sourcesContent":["import type { DidJwk } from './DidJwk'\n\nimport { CredoError } from '../../../../error'\nimport { SECURITY_JWS_CONTEXT_URL } from '../../../vc/constants'\nimport { DidDocumentBuilder, getJsonWebKey2020 } from '../../domain'\n\nexport function getDidJwkDocument(didJwk: DidJwk) {\n if (!didJwk.allowsEncrypting && !didJwk.allowsSigning) {\n throw new CredoError('At least one of allowsSigning or allowsEncrypting must be enabled')\n }\n\n const verificationMethod = getJsonWebKey2020({\n did: didJwk.did,\n publicJwk: didJwk.publicJwk,\n verificationMethodId: didJwk.verificationMethodId,\n })\n\n const didDocumentBuilder = new DidDocumentBuilder(didJwk.did)\n .addContext(SECURITY_JWS_CONTEXT_URL)\n .addVerificationMethod(verificationMethod)\n\n if (didJwk.allowsSigning) {\n didDocumentBuilder\n .addAuthentication(verificationMethod.id)\n .addAssertionMethod(verificationMethod.id)\n .addCapabilityDelegation(verificationMethod.id)\n .addCapabilityInvocation(verificationMethod.id)\n }\n\n if (didJwk.allowsEncrypting) {\n didDocumentBuilder.addKeyAgreement(verificationMethod.id)\n }\n\n return didDocumentBuilder.build()\n}\n"],"mappings":";;;;;;;;;;AAMA,SAAgB,kBAAkB,QAAgB;AAChD,KAAI,CAAC,OAAO,oBAAoB,CAAC,OAAO,cACtC,OAAM,IAAI,WAAW,oEAAoE;CAG3F,MAAM,qBAAqB,kBAAkB;EAC3C,KAAK,OAAO;EACZ,WAAW,OAAO;EAClB,sBAAsB,OAAO;EAC9B,CAAC;CAEF,MAAM,qBAAqB,IAAI,mBAAmB,OAAO,IAAI,CAC1D,WAAW,yBAAyB,CACpC,sBAAsB,mBAAmB;AAE5C,KAAI,OAAO,cACT,oBACG,kBAAkB,mBAAmB,GAAG,CACxC,mBAAmB,mBAAmB,GAAG,CACzC,wBAAwB,mBAAmB,GAAG,CAC9C,wBAAwB,mBAAmB,GAAG;AAGnD,KAAI,OAAO,iBACT,oBAAmB,gBAAgB,mBAAmB,GAAG;AAG3D,QAAO,mBAAmB,OAAO"}
1
+ {"version":3,"file":"didJwkDidDocument.mjs","names":[],"sources":["../../../../../src/modules/dids/methods/jwk/didJwkDidDocument.ts"],"sourcesContent":["import { CredoError } from '../../../../error'\nimport { SECURITY_JWS_CONTEXT_URL } from '../../../vc/constants'\nimport { DidDocumentBuilder, getJsonWebKey2020 } from '../../domain'\nimport type { DidJwk } from './DidJwk'\n\nexport function getDidJwkDocument(didJwk: DidJwk) {\n if (!didJwk.allowsEncrypting && !didJwk.allowsSigning) {\n throw new CredoError('At least one of allowsSigning or allowsEncrypting must be enabled')\n }\n\n const verificationMethod = getJsonWebKey2020({\n did: didJwk.did,\n publicJwk: didJwk.publicJwk,\n verificationMethodId: didJwk.verificationMethodId,\n })\n\n const didDocumentBuilder = new DidDocumentBuilder(didJwk.did)\n .addContext(SECURITY_JWS_CONTEXT_URL)\n .addVerificationMethod(verificationMethod)\n\n if (didJwk.allowsSigning) {\n didDocumentBuilder\n .addAuthentication(verificationMethod.id)\n .addAssertionMethod(verificationMethod.id)\n .addCapabilityDelegation(verificationMethod.id)\n .addCapabilityInvocation(verificationMethod.id)\n }\n\n if (didJwk.allowsEncrypting) {\n didDocumentBuilder.addKeyAgreement(verificationMethod.id)\n }\n\n return didDocumentBuilder.build()\n}\n"],"mappings":";;;;;;;;;;AAKA,SAAgB,kBAAkB,QAAgB;AAChD,KAAI,CAAC,OAAO,oBAAoB,CAAC,OAAO,cACtC,OAAM,IAAI,WAAW,oEAAoE;CAG3F,MAAM,qBAAqB,kBAAkB;EAC3C,KAAK,OAAO;EACZ,WAAW,OAAO;EAClB,sBAAsB,OAAO;EAC9B,CAAC;CAEF,MAAM,qBAAqB,IAAI,mBAAmB,OAAO,IAAI,CAC1D,WAAW,yBAAyB,CACpC,sBAAsB,mBAAmB;AAE5C,KAAI,OAAO,cACT,oBACG,kBAAkB,mBAAmB,GAAG,CACxC,mBAAmB,mBAAmB,GAAG,CACzC,wBAAwB,mBAAmB,GAAG,CAC9C,wBAAwB,mBAAmB,GAAG;AAGnD,KAAI,OAAO,iBACT,oBAAmB,gBAAgB,mBAAmB,GAAG;AAG3D,QAAO,mBAAmB,OAAO"}
@@ -1,5 +1,5 @@
1
- import { DidDocument } from "../../domain/DidDocument.mjs";
2
1
  import { PublicJwk } from "../../../kms/jwk/PublicJwk.mjs";
2
+ import { DidDocument } from "../../domain/DidDocument.mjs";
3
3
 
4
4
  //#region src/modules/dids/methods/key/DidKey.d.ts
5
5
  declare class DidKey {
@@ -1,5 +1,5 @@
1
- import { DidDocument } from "../../domain/DidDocument.js";
2
1
  import { PublicJwk } from "../../../kms/jwk/PublicJwk.js";
2
+ import { DidDocument } from "../../domain/DidDocument.js";
3
3
 
4
4
  //#region src/modules/dids/methods/key/DidKey.d.ts
5
5
  declare class DidKey {
@@ -1,8 +1,8 @@
1
+ import { KmsCreateKeyOptions, KmsCreateKeyTypeAssymetric } from "../../../kms/options/KmsCreateKeyOptions.mjs";
2
+ import { XOR } from "../../../../types.mjs";
1
3
  import { DidRegistrar } from "../../domain/DidRegistrar.mjs";
2
4
  import { DidCreateOptions, DidCreateResult, DidDeactivateResult, DidUpdateResult } from "../../types.mjs";
3
5
  import { AgentContext } from "../../../../agent/context/AgentContext.mjs";
4
- import { KmsCreateKeyOptions, KmsCreateKeyTypeAssymetric } from "../../../kms/options/KmsCreateKeyOptions.mjs";
5
- import { XOR } from "../../../../types.mjs";
6
6
 
7
7
  //#region src/modules/dids/methods/key/KeyDidRegistrar.d.ts
8
8
  declare class KeyDidRegistrar implements DidRegistrar {
@@ -1 +1 @@
1
- {"version":3,"file":"KeyDidRegistrar.d.mts","names":[],"sources":["../../../../../src/modules/dids/methods/key/KeyDidRegistrar.ts"],"sourcesContent":[],"mappings":";;;;;;;cAgBa,eAAA,YAA2B;;uBAGJ,uBAAuB,sBAAsB,QAAQ;YAiFhE,QAAQ;EApFpB,UAAA,CAAA,CAAA,EA+FgB,OA/FA,CA+FQ,mBA/FR,CAAA;;AAGO,UAwGnB,mBAAA,SAA4B,gBAxGT,CAAA;QAAuB,EAAA,KAAA;KAA8B,CAAA,EAAA,KAAA;aAAR,CAAA,EAAA,KAAA;QAiFhD,CAAA,EAAA,KAAA;;;;;EApFmB,OAAA,EAsHzC,GAtHyC,CAAA;IA2GnC,SAAA,EAWW,mBAXS,CAWW,0BAXX,CAAA;EAAA,CAAA,EAAA;IAWW,KAAA,EAAA,MAAA;;;AAXH,KAejC,mBAAA,GAfiC,KAAA;AAAgB,KAgBjD,uBAAA,GAhBiD,KAAA"}
1
+ {"version":3,"file":"KeyDidRegistrar.d.mts","names":[],"sources":["../../../../../src/modules/dids/methods/key/KeyDidRegistrar.ts"],"sourcesContent":[],"mappings":";;;;;;;cAea,eAAA,YAA2B;;uBAGJ,uBAAuB,sBAAsB,QAAQ;YAiFhE,QAAQ;EApFpB,UAAA,CAAA,CAAA,EA+FgB,OA/FA,CA+FQ,mBA/FR,CAAA;;AAGO,UAwGnB,mBAAA,SAA4B,gBAxGT,CAAA;QAAuB,EAAA,KAAA;KAA8B,CAAA,EAAA,KAAA;aAAR,CAAA,EAAA,KAAA;QAiFhD,CAAA,EAAA,KAAA;;;;;EApFmB,OAAA,EAsHzC,GAtHyC,CAAA;IA2GnC,SAAA,EAWW,mBAXS,CAWW,0BAXX,CAAA;EAAA,CAAA,EAAA;IAWW,KAAA,EAAA,MAAA;;;AAXH,KAejC,mBAAA,GAfiC,KAAA;AAAgB,KAgBjD,uBAAA,GAhBiD,KAAA"}
@@ -1,8 +1,8 @@
1
+ import { KmsCreateKeyOptions, KmsCreateKeyTypeAssymetric } from "../../../kms/options/KmsCreateKeyOptions.js";
2
+ import { XOR } from "../../../../types.js";
1
3
  import { DidRegistrar } from "../../domain/DidRegistrar.js";
2
4
  import { DidCreateOptions, DidCreateResult, DidDeactivateResult, DidUpdateResult } from "../../types.js";
3
5
  import { AgentContext } from "../../../../agent/context/AgentContext.js";
4
- import { KmsCreateKeyOptions, KmsCreateKeyTypeAssymetric } from "../../../kms/options/KmsCreateKeyOptions.js";
5
- import { XOR } from "../../../../types.js";
6
6
 
7
7
  //#region src/modules/dids/methods/key/KeyDidRegistrar.d.ts
8
8
  declare class KeyDidRegistrar implements DidRegistrar {
@@ -1 +1 @@
1
- {"version":3,"file":"KeyDidRegistrar.d.ts","names":[],"sources":["../../../../../src/modules/dids/methods/key/KeyDidRegistrar.ts"],"sourcesContent":[],"mappings":";;;;;;;cAgBa,eAAA,YAA2B;;EAA3B,MAAA,CAAA,YAAgB,EAGO,YAHP,EAAA,OAAA,EAG8B,mBAH9B,CAAA,EAGoD,OAHpD,CAG4D,eAH5D,CAAA;EAAA,MAAA,CAAA,CAAA,EAoFJ,OApFI,CAoFI,eApFJ,CAAA;YAGO,CAAA,CAAA,EA4FP,OA5FO,CA4FC,mBA5FD,CAAA;;AAAqD,UAwGxE,mBAAA,SAA4B,gBAxG4C,CAAA;QAAR,EAAA,KAAA;KAiFhD,CAAA,EAAA,KAAA;aAAR,CAAA,EAAA,KAAA;QAWY,CAAA,EAAA,KAAA;;;;AAYrC;EAAqC,OAAA,EAW1B,GAX0B,CAAA;IAWW,SAAA,EAApB,mBAAoB,CAAA,0BAAA,CAAA;KAApB;IAAjB,KAAA,EAAA,MAAA;;;AAIC,KAAA,mBAAA,GAAmB,KAAA;AACnB,KAAA,uBAAA,GAAuB,KAAA"}
1
+ {"version":3,"file":"KeyDidRegistrar.d.ts","names":[],"sources":["../../../../../src/modules/dids/methods/key/KeyDidRegistrar.ts"],"sourcesContent":[],"mappings":";;;;;;;cAea,eAAA,YAA2B;;EAA3B,MAAA,CAAA,YAAgB,EAGO,YAHP,EAAA,OAAA,EAG8B,mBAH9B,CAAA,EAGoD,OAHpD,CAG4D,eAH5D,CAAA;EAAA,MAAA,CAAA,CAAA,EAoFJ,OApFI,CAoFI,eApFJ,CAAA;YAGO,CAAA,CAAA,EA4FP,OA5FO,CA4FC,mBA5FD,CAAA;;AAAqD,UAwGxE,mBAAA,SAA4B,gBAxG4C,CAAA;QAAR,EAAA,KAAA;KAiFhD,CAAA,EAAA,KAAA;aAAR,CAAA,EAAA,KAAA;QAWY,CAAA,EAAA,KAAA;;;;AAYrC;EAAqC,OAAA,EAW1B,GAX0B,CAAA;IAWW,SAAA,EAApB,mBAAoB,CAAA,0BAAA,CAAA;KAApB;IAAjB,KAAA,EAAA,MAAA;;;AAIC,KAAA,mBAAA,GAAmB,KAAA;AACnB,KAAA,uBAAA,GAAuB,KAAA"}
@@ -4,10 +4,10 @@ const require_PublicJwk = require('../../../kms/jwk/PublicJwk.js');
4
4
  const require_KeyManagementApi = require('../../../kms/KeyManagementApi.js');
5
5
  require('../../../kms/index.js');
6
6
  const require_DidDocumentRole = require('../../domain/DidDocumentRole.js');
7
- const require_DidKey = require('./DidKey.js');
8
7
  const require_DidRecord = require('../../repository/DidRecord.js');
9
8
  const require_DidRepository = require('../../repository/DidRepository.js');
10
9
  require('../../repository/index.js');
10
+ const require_DidKey = require('./DidKey.js');
11
11
 
12
12
  //#region src/modules/dids/methods/key/KeyDidRegistrar.ts
13
13
  var KeyDidRegistrar = class {
@@ -4,10 +4,10 @@ import { PublicJwk } from "../../../kms/jwk/PublicJwk.mjs";
4
4
  import { KeyManagementApi } from "../../../kms/KeyManagementApi.mjs";
5
5
  import "../../../kms/index.mjs";
6
6
  import { DidDocumentRole } from "../../domain/DidDocumentRole.mjs";
7
- import { DidKey } from "./DidKey.mjs";
8
7
  import { DidRecord } from "../../repository/DidRecord.mjs";
9
8
  import { DidRepository } from "../../repository/DidRepository.mjs";
10
9
  import "../../repository/index.mjs";
10
+ import { DidKey } from "./DidKey.mjs";
11
11
 
12
12
  //#region src/modules/dids/methods/key/KeyDidRegistrar.ts
13
13
  var KeyDidRegistrar = class {
@@ -1 +1 @@
1
- {"version":3,"file":"KeyDidRegistrar.mjs","names":["publicJwk: KmsJwkPublicAsymmetric","keyId: string"],"sources":["../../../../../src/modules/dids/methods/key/KeyDidRegistrar.ts"],"sourcesContent":["import type { AgentContext } from '../../../../agent'\nimport type { DidRegistrar } from '../../domain/DidRegistrar'\nimport type { DidCreateOptions, DidCreateResult, DidDeactivateResult, DidUpdateResult } from '../../types'\n\nimport type { XOR } from '../../../../types'\nimport {\n KeyManagementApi,\n type KmsCreateKeyOptions,\n type KmsCreateKeyTypeAssymetric,\n type KmsJwkPublicAsymmetric,\n PublicJwk,\n} from '../../../kms'\nimport { DidDocumentRole } from '../../domain/DidDocumentRole'\nimport { DidRecord, DidRepository } from '../../repository'\nimport { DidKey } from './DidKey'\n\nexport class KeyDidRegistrar implements DidRegistrar {\n public readonly supportedMethods = ['key']\n\n public async create(agentContext: AgentContext, options: KeyDidCreateOptions): Promise<DidCreateResult> {\n const didRepository = agentContext.dependencyManager.resolve(DidRepository)\n\n try {\n let publicJwk: KmsJwkPublicAsymmetric\n let keyId: string\n const kms = agentContext.dependencyManager.resolve(KeyManagementApi)\n\n if (options.options.createKey) {\n const createKeyResult = await kms.createKey(options.options.createKey)\n publicJwk = createKeyResult.publicJwk\n keyId = createKeyResult.keyId\n } else {\n const _publicJwk = await kms.getPublicKey({\n keyId: options.options.keyId,\n })\n keyId = options.options.keyId\n if (!_publicJwk) {\n return {\n didDocumentMetadata: {},\n didRegistrationMetadata: {},\n didState: {\n state: 'failed',\n reason: `notFound: key with key id '${options.options.keyId}' not found`,\n },\n }\n }\n\n if (_publicJwk.kty === 'oct') {\n return {\n didDocumentMetadata: {},\n didRegistrationMetadata: {},\n didState: {\n state: 'failed',\n reason: `notFound: key with key id '${options.options.keyId}' uses unsupported kty 'oct' for did:key`,\n },\n }\n }\n\n publicJwk = _publicJwk\n }\n\n const jwk = PublicJwk.fromPublicJwk(publicJwk)\n const didKey = new DidKey(jwk)\n\n // Save the did so we know we created it and can issue with it\n const didRecord = new DidRecord({\n did: didKey.did,\n role: DidDocumentRole.Created,\n\n keys: [\n {\n didDocumentRelativeKeyId: `#${didKey.publicJwk.fingerprint}`,\n kmsKeyId: keyId,\n },\n ],\n })\n await didRepository.save(agentContext, didRecord)\n\n return {\n didDocumentMetadata: {},\n didRegistrationMetadata: {},\n didState: {\n state: 'finished',\n did: didKey.did,\n didDocument: didKey.didDocument,\n secret: {},\n },\n }\n } catch (error) {\n return {\n didDocumentMetadata: {},\n didRegistrationMetadata: {},\n didState: {\n state: 'failed',\n reason: `unknownError: ${error.message}`,\n },\n }\n }\n }\n\n public async update(): Promise<DidUpdateResult> {\n return {\n didDocumentMetadata: {},\n didRegistrationMetadata: {},\n didState: {\n state: 'failed',\n reason: 'notSupported: cannot update did:key did',\n },\n }\n }\n\n public async deactivate(): Promise<DidDeactivateResult> {\n return {\n didDocumentMetadata: {},\n didRegistrationMetadata: {},\n didState: {\n state: 'failed',\n reason: 'notSupported: cannot deactivate did:key did',\n },\n }\n }\n}\n\nexport interface KeyDidCreateOptions extends DidCreateOptions {\n method: 'key'\n // For now we don't support creating a did:key with a did or did document\n did?: never\n didDocument?: never\n secret?: never\n\n /**\n * You can create a did:key based on an existing `keyId`, or provide `createKey` options\n * to create a new key.\n */\n options: XOR<{ createKey: KmsCreateKeyOptions<KmsCreateKeyTypeAssymetric> }, { keyId: string }>\n}\n\n// Update and Deactivate not supported for did:key\nexport type KeyDidUpdateOptions = never\nexport type KeyDidDeactivateOptions = never\n"],"mappings":";;;;;;;;;;;;AAgBA,IAAa,kBAAb,MAAqD;;OACnC,mBAAmB,CAAC,MAAM;;CAE1C,MAAa,OAAO,cAA4B,SAAwD;EACtG,MAAM,gBAAgB,aAAa,kBAAkB,QAAQ,cAAc;AAE3E,MAAI;GACF,IAAIA;GACJ,IAAIC;GACJ,MAAM,MAAM,aAAa,kBAAkB,QAAQ,iBAAiB;AAEpE,OAAI,QAAQ,QAAQ,WAAW;IAC7B,MAAM,kBAAkB,MAAM,IAAI,UAAU,QAAQ,QAAQ,UAAU;AACtE,gBAAY,gBAAgB;AAC5B,YAAQ,gBAAgB;UACnB;IACL,MAAM,aAAa,MAAM,IAAI,aAAa,EACxC,OAAO,QAAQ,QAAQ,OACxB,CAAC;AACF,YAAQ,QAAQ,QAAQ;AACxB,QAAI,CAAC,WACH,QAAO;KACL,qBAAqB,EAAE;KACvB,yBAAyB,EAAE;KAC3B,UAAU;MACR,OAAO;MACP,QAAQ,8BAA8B,QAAQ,QAAQ,MAAM;MAC7D;KACF;AAGH,QAAI,WAAW,QAAQ,MACrB,QAAO;KACL,qBAAqB,EAAE;KACvB,yBAAyB,EAAE;KAC3B,UAAU;MACR,OAAO;MACP,QAAQ,8BAA8B,QAAQ,QAAQ,MAAM;MAC7D;KACF;AAGH,gBAAY;;GAId,MAAM,SAAS,IAAI,OADP,UAAU,cAAc,UAAU,CAChB;GAG9B,MAAM,YAAY,IAAI,UAAU;IAC9B,KAAK,OAAO;IACZ,MAAM,gBAAgB;IAEtB,MAAM,CACJ;KACE,0BAA0B,IAAI,OAAO,UAAU;KAC/C,UAAU;KACX,CACF;IACF,CAAC;AACF,SAAM,cAAc,KAAK,cAAc,UAAU;AAEjD,UAAO;IACL,qBAAqB,EAAE;IACvB,yBAAyB,EAAE;IAC3B,UAAU;KACR,OAAO;KACP,KAAK,OAAO;KACZ,aAAa,OAAO;KACpB,QAAQ,EAAE;KACX;IACF;WACM,OAAO;AACd,UAAO;IACL,qBAAqB,EAAE;IACvB,yBAAyB,EAAE;IAC3B,UAAU;KACR,OAAO;KACP,QAAQ,iBAAiB,MAAM;KAChC;IACF;;;CAIL,MAAa,SAAmC;AAC9C,SAAO;GACL,qBAAqB,EAAE;GACvB,yBAAyB,EAAE;GAC3B,UAAU;IACR,OAAO;IACP,QAAQ;IACT;GACF;;CAGH,MAAa,aAA2C;AACtD,SAAO;GACL,qBAAqB,EAAE;GACvB,yBAAyB,EAAE;GAC3B,UAAU;IACR,OAAO;IACP,QAAQ;IACT;GACF"}
1
+ {"version":3,"file":"KeyDidRegistrar.mjs","names":["publicJwk: KmsJwkPublicAsymmetric","keyId: string"],"sources":["../../../../../src/modules/dids/methods/key/KeyDidRegistrar.ts"],"sourcesContent":["import type { AgentContext } from '../../../../agent'\nimport type { XOR } from '../../../../types'\nimport {\n KeyManagementApi,\n type KmsCreateKeyOptions,\n type KmsCreateKeyTypeAssymetric,\n type KmsJwkPublicAsymmetric,\n PublicJwk,\n} from '../../../kms'\nimport { DidDocumentRole } from '../../domain/DidDocumentRole'\nimport type { DidRegistrar } from '../../domain/DidRegistrar'\nimport { DidRecord, DidRepository } from '../../repository'\nimport type { DidCreateOptions, DidCreateResult, DidDeactivateResult, DidUpdateResult } from '../../types'\nimport { DidKey } from './DidKey'\n\nexport class KeyDidRegistrar implements DidRegistrar {\n public readonly supportedMethods = ['key']\n\n public async create(agentContext: AgentContext, options: KeyDidCreateOptions): Promise<DidCreateResult> {\n const didRepository = agentContext.dependencyManager.resolve(DidRepository)\n\n try {\n let publicJwk: KmsJwkPublicAsymmetric\n let keyId: string\n const kms = agentContext.dependencyManager.resolve(KeyManagementApi)\n\n if (options.options.createKey) {\n const createKeyResult = await kms.createKey(options.options.createKey)\n publicJwk = createKeyResult.publicJwk\n keyId = createKeyResult.keyId\n } else {\n const _publicJwk = await kms.getPublicKey({\n keyId: options.options.keyId,\n })\n keyId = options.options.keyId\n if (!_publicJwk) {\n return {\n didDocumentMetadata: {},\n didRegistrationMetadata: {},\n didState: {\n state: 'failed',\n reason: `notFound: key with key id '${options.options.keyId}' not found`,\n },\n }\n }\n\n if (_publicJwk.kty === 'oct') {\n return {\n didDocumentMetadata: {},\n didRegistrationMetadata: {},\n didState: {\n state: 'failed',\n reason: `notFound: key with key id '${options.options.keyId}' uses unsupported kty 'oct' for did:key`,\n },\n }\n }\n\n publicJwk = _publicJwk\n }\n\n const jwk = PublicJwk.fromPublicJwk(publicJwk)\n const didKey = new DidKey(jwk)\n\n // Save the did so we know we created it and can issue with it\n const didRecord = new DidRecord({\n did: didKey.did,\n role: DidDocumentRole.Created,\n\n keys: [\n {\n didDocumentRelativeKeyId: `#${didKey.publicJwk.fingerprint}`,\n kmsKeyId: keyId,\n },\n ],\n })\n await didRepository.save(agentContext, didRecord)\n\n return {\n didDocumentMetadata: {},\n didRegistrationMetadata: {},\n didState: {\n state: 'finished',\n did: didKey.did,\n didDocument: didKey.didDocument,\n secret: {},\n },\n }\n } catch (error) {\n return {\n didDocumentMetadata: {},\n didRegistrationMetadata: {},\n didState: {\n state: 'failed',\n reason: `unknownError: ${error.message}`,\n },\n }\n }\n }\n\n public async update(): Promise<DidUpdateResult> {\n return {\n didDocumentMetadata: {},\n didRegistrationMetadata: {},\n didState: {\n state: 'failed',\n reason: 'notSupported: cannot update did:key did',\n },\n }\n }\n\n public async deactivate(): Promise<DidDeactivateResult> {\n return {\n didDocumentMetadata: {},\n didRegistrationMetadata: {},\n didState: {\n state: 'failed',\n reason: 'notSupported: cannot deactivate did:key did',\n },\n }\n }\n}\n\nexport interface KeyDidCreateOptions extends DidCreateOptions {\n method: 'key'\n // For now we don't support creating a did:key with a did or did document\n did?: never\n didDocument?: never\n secret?: never\n\n /**\n * You can create a did:key based on an existing `keyId`, or provide `createKey` options\n * to create a new key.\n */\n options: XOR<{ createKey: KmsCreateKeyOptions<KmsCreateKeyTypeAssymetric> }, { keyId: string }>\n}\n\n// Update and Deactivate not supported for did:key\nexport type KeyDidUpdateOptions = never\nexport type KeyDidDeactivateOptions = never\n"],"mappings":";;;;;;;;;;;;AAeA,IAAa,kBAAb,MAAqD;;OACnC,mBAAmB,CAAC,MAAM;;CAE1C,MAAa,OAAO,cAA4B,SAAwD;EACtG,MAAM,gBAAgB,aAAa,kBAAkB,QAAQ,cAAc;AAE3E,MAAI;GACF,IAAIA;GACJ,IAAIC;GACJ,MAAM,MAAM,aAAa,kBAAkB,QAAQ,iBAAiB;AAEpE,OAAI,QAAQ,QAAQ,WAAW;IAC7B,MAAM,kBAAkB,MAAM,IAAI,UAAU,QAAQ,QAAQ,UAAU;AACtE,gBAAY,gBAAgB;AAC5B,YAAQ,gBAAgB;UACnB;IACL,MAAM,aAAa,MAAM,IAAI,aAAa,EACxC,OAAO,QAAQ,QAAQ,OACxB,CAAC;AACF,YAAQ,QAAQ,QAAQ;AACxB,QAAI,CAAC,WACH,QAAO;KACL,qBAAqB,EAAE;KACvB,yBAAyB,EAAE;KAC3B,UAAU;MACR,OAAO;MACP,QAAQ,8BAA8B,QAAQ,QAAQ,MAAM;MAC7D;KACF;AAGH,QAAI,WAAW,QAAQ,MACrB,QAAO;KACL,qBAAqB,EAAE;KACvB,yBAAyB,EAAE;KAC3B,UAAU;MACR,OAAO;MACP,QAAQ,8BAA8B,QAAQ,QAAQ,MAAM;MAC7D;KACF;AAGH,gBAAY;;GAId,MAAM,SAAS,IAAI,OADP,UAAU,cAAc,UAAU,CAChB;GAG9B,MAAM,YAAY,IAAI,UAAU;IAC9B,KAAK,OAAO;IACZ,MAAM,gBAAgB;IAEtB,MAAM,CACJ;KACE,0BAA0B,IAAI,OAAO,UAAU;KAC/C,UAAU;KACX,CACF;IACF,CAAC;AACF,SAAM,cAAc,KAAK,cAAc,UAAU;AAEjD,UAAO;IACL,qBAAqB,EAAE;IACvB,yBAAyB,EAAE;IAC3B,UAAU;KACR,OAAO;KACP,KAAK,OAAO;KACZ,aAAa,OAAO;KACpB,QAAQ,EAAE;KACX;IACF;WACM,OAAO;AACd,UAAO;IACL,qBAAqB,EAAE;IACvB,yBAAyB,EAAE;IAC3B,UAAU;KACR,OAAO;KACP,QAAQ,iBAAiB,MAAM;KAChC;IACF;;;CAIL,MAAa,SAAmC;AAC9C,SAAO;GACL,qBAAqB,EAAE;GACvB,yBAAyB,EAAE;GAC3B,UAAU;IACR,OAAO;IACP,QAAQ;IACT;GACF;;CAGH,MAAa,aAA2C;AACtD,SAAO;GACL,qBAAqB,EAAE;GACvB,yBAAyB,EAAE;GAC3B,UAAU;IACR,OAAO;IACP,QAAQ;IACT;GACF"}
@@ -1,11 +1,11 @@
1
+ import { KmsCreateKeyOptions, KmsCreateKeyTypeAssymetric } from "../../../kms/options/KmsCreateKeyOptions.mjs";
2
+ import { XOR } from "../../../../types.mjs";
1
3
  import { DidDocument } from "../../domain/DidDocument.mjs";
2
4
  import { DidRegistrar } from "../../domain/DidRegistrar.mjs";
3
5
  import { DidDocumentKey } from "../../DidsApiOptions.mjs";
4
6
  import { DidCreateOptions, DidCreateResult, DidDeactivateResult, DidUpdateResult } from "../../types.mjs";
5
7
  import { PeerDidNumAlgo } from "./didPeer.mjs";
6
8
  import { AgentContext } from "../../../../agent/context/AgentContext.mjs";
7
- import { KmsCreateKeyOptions, KmsCreateKeyTypeAssymetric } from "../../../kms/options/KmsCreateKeyOptions.mjs";
8
- import { XOR } from "../../../../types.mjs";
9
9
 
10
10
  //#region src/modules/dids/methods/peer/PeerDidRegistrar.d.ts
11
11
  declare class PeerDidRegistrar implements DidRegistrar {
@@ -1 +1 @@
1
- {"version":3,"file":"PeerDidRegistrar.d.mts","names":[],"sources":["../../../../../src/modules/dids/methods/peer/PeerDidRegistrar.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;cAmBa,gBAAA,YAA4B;;uBAIvB,uBAEV,+BACA,+BACA,+BACA,+BACH,QAAQ;YA6IY,QAAQ;EAvJpB,UAAA,CAAA,CAAA,EAkKgB,OAlKC,CAkKO,mBAlKP,CAAA;;AAIZ,KA0LN,oBAAA,GACR,4BA3Lc,GA4Ld,4BA5Lc,GA6Ld,4BA7Lc,GA8Ld,4BA9Lc;AAEV,UA8LS,4BAAA,SAAqC,gBA9L9C,CAAA;QACA,EAAA,MAAA;KACA,CAAA,EAAA,KAAA;aACA,CAAA,EAAA,KAAA;SACK,EAAA;IAAR,OAAA,EA+LQ,cAAA,CAAe,sBA/LvB;MAgMC,GAnD2B,CAAA;IAAR,SAAA,EAmDF,mBAnDE,CAmDkB,0BAnDlB,CAAA;KAWY;IAAR,KAAA,EAAA,MAAA;;EAlKwB,MAAA,CAAA,EAAA,KAAA;AA8LrD;AAAgC,UAgBf,4BAAA,SAAqC,gBAhBtB,CAAA;QAC5B,EAAA,MAAA;KACA,CAAA,EAAA,KAAA;aACA,EAgBW,WAhBX;SACA,EAAA;IAA4B,OAAA,EAiBnB,cAAA,CAAe,UAjBI;IAEf;;;;;;IAAqC,IAAA,EAuB5C,cAvB4C,EAAA;EAAgB,CAAA;EAUrD,MAAA,CAAA,EAAA,KAAA;;AAGF,UAeE,4BAAA,SAAqC,gBAfvC,CAAA;QAEF,EAAA,MAAA;KAQH,CAAA,EAAA,KAAA;aAb4C,EAqBvC,WArBuC;EAAgB,OAAA,EAAA;IAkBrD,OAAA,EAKJ,cAAA,CAAe,8BALkB;IAAA;;;;;;IAkB7B,IAAA,EALP,cAKO,EAAA;EAA6B,CAAA;QAG/B,CAAA,EAAA,KAAA;;AAUL,UAbO,4BAAA,SAAqC,gBAa5C,CAAA;QAb4C,EAAA,MAAA;EAAgB,GAAA,CAAA,EAAA,KAAA;EAmB1D,WAAA,EAhBG,WAgBiB;EACpB,OAAA,EAAA;aAfC,cAAA,CAAe;;;;;;;UAQlB;;;;KAME,oBAAA;KACA,wBAAA"}
1
+ {"version":3,"file":"PeerDidRegistrar.d.mts","names":[],"sources":["../../../../../src/modules/dids/methods/peer/PeerDidRegistrar.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;cAgBa,gBAAA,YAA4B;;uBAIvB,uBAEV,+BACA,+BACA,+BACA,+BACH,QAAQ;YA6IY,QAAQ;EAvJpB,UAAA,CAAA,CAAA,EAkKgB,OAlKC,CAkKO,mBAlKP,CAAA;;AAIZ,KA0LN,oBAAA,GACR,4BA3Lc,GA4Ld,4BA5Lc,GA6Ld,4BA7Lc,GA8Ld,4BA9Lc;AAEV,UA8LS,4BAAA,SAAqC,gBA9L9C,CAAA;QACA,EAAA,MAAA;KACA,CAAA,EAAA,KAAA;aACA,CAAA,EAAA,KAAA;SACK,EAAA;IAAR,OAAA,EA+LQ,cAAA,CAAe,sBA/LvB;MAgMC,GAnD2B,CAAA;IAAR,SAAA,EAmDF,mBAnDE,CAmDkB,0BAnDlB,CAAA;KAWY;IAAR,KAAA,EAAA,MAAA;;EAlKwB,MAAA,CAAA,EAAA,KAAA;AA8LrD;AAAgC,UAgBf,4BAAA,SAAqC,gBAhBtB,CAAA;QAC5B,EAAA,MAAA;KACA,CAAA,EAAA,KAAA;aACA,EAgBW,WAhBX;SACA,EAAA;IAA4B,OAAA,EAiBnB,cAAA,CAAe,UAjBI;IAEf;;;;;;IAAqC,IAAA,EAuB5C,cAvB4C,EAAA;EAAgB,CAAA;EAUrD,MAAA,CAAA,EAAA,KAAA;;AAGF,UAeE,4BAAA,SAAqC,gBAfvC,CAAA;QAEF,EAAA,MAAA;KAQH,CAAA,EAAA,KAAA;aAb4C,EAqBvC,WArBuC;EAAgB,OAAA,EAAA;IAkBrD,OAAA,EAKJ,cAAA,CAAe,8BALkB;IAAA;;;;;;IAkB7B,IAAA,EALP,cAKO,EAAA;EAA6B,CAAA;QAG/B,CAAA,EAAA,KAAA;;AAUL,UAbO,4BAAA,SAAqC,gBAa5C,CAAA;QAb4C,EAAA,MAAA;EAAgB,GAAA,CAAA,EAAA,KAAA;EAmB1D,WAAA,EAhBG,WAgBiB;EACpB,OAAA,EAAA;aAfC,cAAA,CAAe;;;;;;;UAQlB;;;;KAME,oBAAA;KACA,wBAAA"}
@@ -1,11 +1,11 @@
1
+ import { KmsCreateKeyOptions, KmsCreateKeyTypeAssymetric } from "../../../kms/options/KmsCreateKeyOptions.js";
2
+ import { XOR } from "../../../../types.js";
1
3
  import { DidDocument } from "../../domain/DidDocument.js";
2
4
  import { DidRegistrar } from "../../domain/DidRegistrar.js";
3
5
  import { DidDocumentKey } from "../../DidsApiOptions.js";
4
6
  import { DidCreateOptions, DidCreateResult, DidDeactivateResult, DidUpdateResult } from "../../types.js";
5
7
  import { PeerDidNumAlgo } from "./didPeer.js";
6
8
  import { AgentContext } from "../../../../agent/context/AgentContext.js";
7
- import { KmsCreateKeyOptions, KmsCreateKeyTypeAssymetric } from "../../../kms/options/KmsCreateKeyOptions.js";
8
- import { XOR } from "../../../../types.js";
9
9
 
10
10
  //#region src/modules/dids/methods/peer/PeerDidRegistrar.d.ts
11
11
  declare class PeerDidRegistrar implements DidRegistrar {
@@ -1 +1 @@
1
- {"version":3,"file":"PeerDidRegistrar.d.ts","names":[],"sources":["../../../../../src/modules/dids/methods/peer/PeerDidRegistrar.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;cAmBa,gBAAA,YAA4B;;EAA5B,MAAA,CAAA,YAAiB,EAIZ,YAJY,EAAA,OAAA,EAMtB,4BANsB,GAOtB,4BAPsB,GAQtB,4BARsB,GAStB,4BATsB,CAAA,EAUzB,OAVyB,CAUjB,eAViB,CAAA;EAAA,MAAA,CAAA,CAAA,EAuJL,OAvJK,CAuJG,eAvJH,CAAA;YAIZ,CAAA,CAAA,EA8JW,OA9JX,CA8JmB,mBA9JnB,CAAA;;AAGV,KAuLI,oBAAA,GACR,4BAxLI,GAyLJ,4BAzLI,GA0LJ,4BA1LI,GA2LJ,4BA3LI;AACA,UA4LS,4BAAA,SAAqC,gBA5L9C,CAAA;QACA,EAAA,MAAA;KACK,CAAA,EAAA,KAAA;aAAR,CAAA,EAAA,KAAA;SA6I4B,EAAA;IAAR,OAAA,EAkDZ,cAAA,CAAe,sBAlDH;MAmDnB,GAxC+B,CAAA;IAAR,SAAA,EAwCN,mBAxCM,CAwCc,0BAxCd,CAAA;KAlKY;IAAY,KAAA,EAAA,MAAA;EA8LzC,CAAA,CAAA;EAAoB,MAAA,CAAA,EAAA,KAAA;;AAE5B,UAca,4BAAA,SAAqC,gBAdlD,CAAA;QACA,EAAA,MAAA;KACA,CAAA,EAAA,KAAA;EAA4B,WAAA,EAejB,WAfiB;EAEf,OAAA,EAAA;IAA6B,OAAA,EAejC,cAAA,CAAe,UAfkB;IAKjC;;;;;;IAKI,IAAA,EAaP,cAbO,EAAA;EAA6B,CAAA;QAG/B,CAAA,EAAA,KAAA;;AAUL,UAKO,4BAAA,SAAqC,gBAL5C,CAAA;QAb4C,EAAA,MAAA;EAAgB,GAAA,CAAA,EAAA,KAAA;EAkBrD,WAAA,EAGF,WAHE;EAA6B,OAAA,EAAA;IAG/B,OAAA,EAEF,cAAA,CAAe,8BAFb;IAEF;;;;AAab;;IAGe,IAAA,EARL,cAQK,EAAA;;QAUL,CAAA,EAAA,KAAA;;AAb4D,UAArD,4BAAA,SAAqC,gBAAgB,CAAA;EAmB1D,MAAA,EAAA,MAAA;EACA,GAAA,CAAA,EAAA,KAAA;eAjBG;;aAEF,cAAA,CAAe;;;;;;;UAQlB;;;;KAME,oBAAA;KACA,wBAAA"}
1
+ {"version":3,"file":"PeerDidRegistrar.d.ts","names":[],"sources":["../../../../../src/modules/dids/methods/peer/PeerDidRegistrar.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;cAgBa,gBAAA,YAA4B;;EAA5B,MAAA,CAAA,YAAiB,EAIZ,YAJY,EAAA,OAAA,EAMtB,4BANsB,GAOtB,4BAPsB,GAQtB,4BARsB,GAStB,4BATsB,CAAA,EAUzB,OAVyB,CAUjB,eAViB,CAAA;EAAA,MAAA,CAAA,CAAA,EAuJL,OAvJK,CAuJG,eAvJH,CAAA;YAIZ,CAAA,CAAA,EA8JW,OA9JX,CA8JmB,mBA9JnB,CAAA;;AAGV,KAuLI,oBAAA,GACR,4BAxLI,GAyLJ,4BAzLI,GA0LJ,4BA1LI,GA2LJ,4BA3LI;AACA,UA4LS,4BAAA,SAAqC,gBA5L9C,CAAA;QACA,EAAA,MAAA;KACK,CAAA,EAAA,KAAA;aAAR,CAAA,EAAA,KAAA;SA6I4B,EAAA;IAAR,OAAA,EAkDZ,cAAA,CAAe,sBAlDH;MAmDnB,GAxC+B,CAAA;IAAR,SAAA,EAwCN,mBAxCM,CAwCc,0BAxCd,CAAA;KAlKY;IAAY,KAAA,EAAA,MAAA;EA8LzC,CAAA,CAAA;EAAoB,MAAA,CAAA,EAAA,KAAA;;AAE5B,UAca,4BAAA,SAAqC,gBAdlD,CAAA;QACA,EAAA,MAAA;KACA,CAAA,EAAA,KAAA;EAA4B,WAAA,EAejB,WAfiB;EAEf,OAAA,EAAA;IAA6B,OAAA,EAejC,cAAA,CAAe,UAfkB;IAKjC;;;;;;IAKI,IAAA,EAaP,cAbO,EAAA;EAA6B,CAAA;QAG/B,CAAA,EAAA,KAAA;;AAUL,UAKO,4BAAA,SAAqC,gBAL5C,CAAA;QAb4C,EAAA,MAAA;EAAgB,GAAA,CAAA,EAAA,KAAA;EAkBrD,WAAA,EAGF,WAHE;EAA6B,OAAA,EAAA;IAG/B,OAAA,EAEF,cAAA,CAAe,8BAFb;IAEF;;;;AAab;;IAGe,IAAA,EARL,cAQK,EAAA;;QAUL,CAAA,EAAA,KAAA;;AAb4D,UAArD,4BAAA,SAAqC,gBAAgB,CAAA;EAmB1D,MAAA,EAAA,MAAA;EACA,GAAA,CAAA,EAAA,KAAA;eAjBG;;aAEF,cAAA,CAAe;;;;;;;UAQlB;;;;KAME,oBAAA;KACA,wBAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"PeerDidRegistrar.mjs","names":["did: string","didDocument: DidDocument","keys: DidDocumentKey[]","publicJwk: PublicJwk"],"sources":["../../../../../src/modules/dids/methods/peer/PeerDidRegistrar.ts"],"sourcesContent":["import type { AgentContext } from '../../../../agent'\n\nimport type { DidRegistrar } from '../../domain/DidRegistrar'\nimport type { DidCreateOptions, DidCreateResult, DidDeactivateResult, DidUpdateResult } from '../../types'\n\nimport { JsonTransformer } from '../../../../utils'\nimport { DidDocument } from '../../domain'\nimport { DidDocumentRole } from '../../domain/DidDocumentRole'\nimport { DidRecord, DidRepository } from '../../repository'\n\nimport type { XOR } from '../../../../types'\nimport { KeyManagementApi, type KmsCreateKeyOptions, type KmsCreateKeyTypeAssymetric, PublicJwk } from '../../../kms'\nimport type { DidDocumentKey } from '../../DidsApiOptions'\nimport { PeerDidNumAlgo, getAlternativeDidsForPeerDid } from './didPeer'\nimport { publicJwkToNumAlgo0DidDocument } from './peerDidNumAlgo0'\nimport { didDocumentJsonToNumAlgo1Did } from './peerDidNumAlgo1'\nimport { didDocumentToNumAlgo2Did } from './peerDidNumAlgo2'\nimport { didDocumentToNumAlgo4Did } from './peerDidNumAlgo4'\n\nexport class PeerDidRegistrar implements DidRegistrar {\n public readonly supportedMethods = ['peer']\n\n public async create(\n agentContext: AgentContext,\n options:\n | PeerDidNumAlgo0CreateOptions\n | PeerDidNumAlgo1CreateOptions\n | PeerDidNumAlgo2CreateOptions\n | PeerDidNumAlgo4CreateOptions\n ): Promise<DidCreateResult> {\n const kms = agentContext.dependencyManager.resolve(KeyManagementApi)\n const didRepository = agentContext.dependencyManager.resolve(DidRepository)\n\n let did: string\n let didDocument: DidDocument\n\n let keys: DidDocumentKey[]\n\n try {\n if (isPeerDidNumAlgo0CreateOptions(options)) {\n let publicJwk: PublicJwk\n\n if (options.options.createKey) {\n const createKeyResult = await kms.createKey(options.options.createKey)\n publicJwk = PublicJwk.fromPublicJwk(createKeyResult.publicJwk)\n keys = [\n {\n didDocumentRelativeKeyId: `#${publicJwk.fingerprint}`,\n kmsKeyId: createKeyResult.keyId,\n },\n ]\n } else {\n const _publicJwk = await kms.getPublicKey({\n keyId: options.options.keyId,\n })\n\n if (!_publicJwk) {\n return {\n didDocumentMetadata: {},\n didRegistrationMetadata: {},\n didState: {\n state: 'failed',\n reason: `notFound: key with key id '${options.options.keyId}' not found`,\n },\n }\n }\n\n if (_publicJwk.kty === 'oct') {\n return {\n didDocumentMetadata: {},\n didRegistrationMetadata: {},\n didState: {\n state: 'failed',\n reason: `notFound: key with key id '${options.options.keyId}' uses unsupported kty 'oct' for did:key`,\n },\n }\n }\n\n publicJwk = PublicJwk.fromPublicJwk(_publicJwk)\n keys = [\n {\n didDocumentRelativeKeyId: `#${publicJwk.fingerprint}`,\n kmsKeyId: options.options.keyId,\n },\n ]\n }\n\n didDocument = publicJwkToNumAlgo0DidDocument(publicJwk)\n did = didDocument.id\n } else if (isPeerDidNumAlgo1CreateOptions(options)) {\n const didDocumentJson = options.didDocument.toJSON()\n did = didDocumentJsonToNumAlgo1Did(didDocumentJson)\n keys = options.options.keys\n\n didDocument = JsonTransformer.fromJSON({ ...didDocumentJson, id: did }, DidDocument)\n } else if (isPeerDidNumAlgo2CreateOptions(options)) {\n const didDocumentJson = options.didDocument.toJSON()\n did = didDocumentToNumAlgo2Did(options.didDocument)\n keys = options.options.keys\n\n didDocument = JsonTransformer.fromJSON({ ...didDocumentJson, id: did }, DidDocument)\n } else if (isPeerDidNumAlgo4CreateOptions(options)) {\n const didDocumentJson = options.didDocument.toJSON()\n keys = options.options.keys\n\n const { longFormDid, shortFormDid } = didDocumentToNumAlgo4Did(options.didDocument)\n\n did = longFormDid\n didDocument = JsonTransformer.fromJSON(\n { ...didDocumentJson, id: longFormDid, alsoKnownAs: [shortFormDid] },\n DidDocument\n )\n } else {\n return {\n didDocumentMetadata: {},\n didRegistrationMetadata: {},\n didState: {\n state: 'failed',\n reason: 'Missing or incorrect numAlgo provided',\n },\n }\n }\n\n if (!keys || keys.length === 0) {\n return {\n didDocumentMetadata: {},\n didRegistrationMetadata: {},\n didState: {\n state: 'failed',\n reason: `Missing required 'keys' linking did document verification method id to the kms key id. Provide at least one key in the create options`,\n },\n }\n }\n\n // Save the did so we know we created it and can use it for didcomm\n const didRecord = new DidRecord({\n did,\n role: DidDocumentRole.Created,\n didDocument: isPeerDidNumAlgo1CreateOptions(options) ? didDocument : undefined,\n keys,\n tags: {\n // We need to save the recipientKeys, so we can find the associated did\n // of a key when we receive a message from another connection.\n recipientKeyFingerprints: didDocument.recipientKeys.map((key) => key.fingerprint),\n alternativeDids: getAlternativeDidsForPeerDid(did),\n },\n })\n await didRepository.save(agentContext, didRecord)\n\n return {\n didDocumentMetadata: {},\n didRegistrationMetadata: {},\n didState: {\n state: 'finished',\n did: didDocument.id,\n didDocument,\n },\n }\n } catch (error) {\n return {\n didDocumentMetadata: {},\n didRegistrationMetadata: {},\n didState: {\n state: 'failed',\n reason: `unknownError: ${error.message}`,\n },\n }\n }\n }\n\n public async update(): Promise<DidUpdateResult> {\n return {\n didDocumentMetadata: {},\n didRegistrationMetadata: {},\n didState: {\n state: 'failed',\n reason: 'notImplemented: updating did:peer not implemented yet',\n },\n }\n }\n\n public async deactivate(): Promise<DidDeactivateResult> {\n return {\n didDocumentMetadata: {},\n didRegistrationMetadata: {},\n didState: {\n state: 'failed',\n reason: 'notImplemented: deactivating did:peer not implemented yet',\n },\n }\n }\n}\n\nfunction isPeerDidNumAlgo1CreateOptions(options: PeerDidCreateOptions): options is PeerDidNumAlgo1CreateOptions {\n return options.options.numAlgo === PeerDidNumAlgo.GenesisDoc\n}\n\nfunction isPeerDidNumAlgo0CreateOptions(options: PeerDidCreateOptions): options is PeerDidNumAlgo0CreateOptions {\n return options.options.numAlgo === PeerDidNumAlgo.InceptionKeyWithoutDoc\n}\n\nfunction isPeerDidNumAlgo2CreateOptions(options: PeerDidCreateOptions): options is PeerDidNumAlgo2CreateOptions {\n return options.options.numAlgo === PeerDidNumAlgo.MultipleInceptionKeyWithoutDoc\n}\n\nfunction isPeerDidNumAlgo4CreateOptions(options: PeerDidCreateOptions): options is PeerDidNumAlgo4CreateOptions {\n return options.options.numAlgo === PeerDidNumAlgo.ShortFormAndLongForm\n}\n\nexport type PeerDidCreateOptions =\n | PeerDidNumAlgo0CreateOptions\n | PeerDidNumAlgo1CreateOptions\n | PeerDidNumAlgo2CreateOptions\n | PeerDidNumAlgo4CreateOptions\n\nexport interface PeerDidNumAlgo0CreateOptions extends DidCreateOptions {\n method: 'peer'\n did?: never\n didDocument?: never\n options: {\n numAlgo: PeerDidNumAlgo.InceptionKeyWithoutDoc\n } & XOR<{ createKey: KmsCreateKeyOptions<KmsCreateKeyTypeAssymetric> }, { keyId: string }>\n secret?: never\n}\n\nexport interface PeerDidNumAlgo1CreateOptions extends DidCreateOptions {\n method: 'peer'\n did?: never\n didDocument: DidDocument\n options: {\n numAlgo: PeerDidNumAlgo.GenesisDoc\n\n /**\n * The linking between the did document keys and the kms keys. If you want to use\n * the DID within Credo you MUST add the key here. All keys must be present in the did\n * document, but not all did document keys must be present in this array, to allow for keys\n * that are not controleld by this agent.\n */\n keys: DidDocumentKey[]\n }\n secret?: never\n}\n\nexport interface PeerDidNumAlgo2CreateOptions extends DidCreateOptions {\n method: 'peer'\n did?: never\n didDocument: DidDocument\n options: {\n numAlgo: PeerDidNumAlgo.MultipleInceptionKeyWithoutDoc\n\n /**\n * The linking between the did document keys and the kms keys. If you want to use\n * the DID within Credo you MUST add the key here. All keys must be present in the did\n * document, but not all did document keys must be present in this array, to allow for keys\n * that are not controleld by this agent.\n */\n keys: DidDocumentKey[]\n }\n secret?: never\n}\n\nexport interface PeerDidNumAlgo4CreateOptions extends DidCreateOptions {\n method: 'peer'\n did?: never\n didDocument: DidDocument\n options: {\n numAlgo: PeerDidNumAlgo.ShortFormAndLongForm\n\n /**\n * The linking between the did document keys and the kms keys. If you want to use\n * the DID within Credo you MUST add the key here. All keys must be present in the did\n * document, but not all did document keys must be present in this array, to allow for keys\n * that are not controleld by this agent.\n */\n keys: DidDocumentKey[]\n }\n secret?: never\n}\n\n// Update and Deactivate not supported for did:peer\nexport type PeerDidUpdateOptions = never\nexport type PeerDidDeactivateOptions = never\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAmBA,IAAa,mBAAb,MAAsD;;OACpC,mBAAmB,CAAC,OAAO;;CAE3C,MAAa,OACX,cACA,SAK0B;EAC1B,MAAM,MAAM,aAAa,kBAAkB,QAAQ,iBAAiB;EACpE,MAAM,gBAAgB,aAAa,kBAAkB,QAAQ,cAAc;EAE3E,IAAIA;EACJ,IAAIC;EAEJ,IAAIC;AAEJ,MAAI;AACF,OAAI,+BAA+B,QAAQ,EAAE;IAC3C,IAAIC;AAEJ,QAAI,QAAQ,QAAQ,WAAW;KAC7B,MAAM,kBAAkB,MAAM,IAAI,UAAU,QAAQ,QAAQ,UAAU;AACtE,iBAAY,UAAU,cAAc,gBAAgB,UAAU;AAC9D,YAAO,CACL;MACE,0BAA0B,IAAI,UAAU;MACxC,UAAU,gBAAgB;MAC3B,CACF;WACI;KACL,MAAM,aAAa,MAAM,IAAI,aAAa,EACxC,OAAO,QAAQ,QAAQ,OACxB,CAAC;AAEF,SAAI,CAAC,WACH,QAAO;MACL,qBAAqB,EAAE;MACvB,yBAAyB,EAAE;MAC3B,UAAU;OACR,OAAO;OACP,QAAQ,8BAA8B,QAAQ,QAAQ,MAAM;OAC7D;MACF;AAGH,SAAI,WAAW,QAAQ,MACrB,QAAO;MACL,qBAAqB,EAAE;MACvB,yBAAyB,EAAE;MAC3B,UAAU;OACR,OAAO;OACP,QAAQ,8BAA8B,QAAQ,QAAQ,MAAM;OAC7D;MACF;AAGH,iBAAY,UAAU,cAAc,WAAW;AAC/C,YAAO,CACL;MACE,0BAA0B,IAAI,UAAU;MACxC,UAAU,QAAQ,QAAQ;MAC3B,CACF;;AAGH,kBAAc,+BAA+B,UAAU;AACvD,UAAM,YAAY;cACT,+BAA+B,QAAQ,EAAE;IAClD,MAAM,kBAAkB,QAAQ,YAAY,QAAQ;AACpD,UAAM,6BAA6B,gBAAgB;AACnD,WAAO,QAAQ,QAAQ;AAEvB,kBAAc,gBAAgB,SAAS;KAAE,GAAG;KAAiB,IAAI;KAAK,EAAE,YAAY;cAC3E,+BAA+B,QAAQ,EAAE;IAClD,MAAM,kBAAkB,QAAQ,YAAY,QAAQ;AACpD,UAAM,yBAAyB,QAAQ,YAAY;AACnD,WAAO,QAAQ,QAAQ;AAEvB,kBAAc,gBAAgB,SAAS;KAAE,GAAG;KAAiB,IAAI;KAAK,EAAE,YAAY;cAC3E,+BAA+B,QAAQ,EAAE;IAClD,MAAM,kBAAkB,QAAQ,YAAY,QAAQ;AACpD,WAAO,QAAQ,QAAQ;IAEvB,MAAM,EAAE,aAAa,iBAAiB,yBAAyB,QAAQ,YAAY;AAEnF,UAAM;AACN,kBAAc,gBAAgB,SAC5B;KAAE,GAAG;KAAiB,IAAI;KAAa,aAAa,CAAC,aAAa;KAAE,EACpE,YACD;SAED,QAAO;IACL,qBAAqB,EAAE;IACvB,yBAAyB,EAAE;IAC3B,UAAU;KACR,OAAO;KACP,QAAQ;KACT;IACF;AAGH,OAAI,CAAC,QAAQ,KAAK,WAAW,EAC3B,QAAO;IACL,qBAAqB,EAAE;IACvB,yBAAyB,EAAE;IAC3B,UAAU;KACR,OAAO;KACP,QAAQ;KACT;IACF;GAIH,MAAM,YAAY,IAAI,UAAU;IAC9B;IACA,MAAM,gBAAgB;IACtB,aAAa,+BAA+B,QAAQ,GAAG,cAAc;IACrE;IACA,MAAM;KAGJ,0BAA0B,YAAY,cAAc,KAAK,QAAQ,IAAI,YAAY;KACjF,iBAAiB,6BAA6B,IAAI;KACnD;IACF,CAAC;AACF,SAAM,cAAc,KAAK,cAAc,UAAU;AAEjD,UAAO;IACL,qBAAqB,EAAE;IACvB,yBAAyB,EAAE;IAC3B,UAAU;KACR,OAAO;KACP,KAAK,YAAY;KACjB;KACD;IACF;WACM,OAAO;AACd,UAAO;IACL,qBAAqB,EAAE;IACvB,yBAAyB,EAAE;IAC3B,UAAU;KACR,OAAO;KACP,QAAQ,iBAAiB,MAAM;KAChC;IACF;;;CAIL,MAAa,SAAmC;AAC9C,SAAO;GACL,qBAAqB,EAAE;GACvB,yBAAyB,EAAE;GAC3B,UAAU;IACR,OAAO;IACP,QAAQ;IACT;GACF;;CAGH,MAAa,aAA2C;AACtD,SAAO;GACL,qBAAqB,EAAE;GACvB,yBAAyB,EAAE;GAC3B,UAAU;IACR,OAAO;IACP,QAAQ;IACT;GACF;;;AAIL,SAAS,+BAA+B,SAAwE;AAC9G,QAAO,QAAQ,QAAQ,YAAY,eAAe;;AAGpD,SAAS,+BAA+B,SAAwE;AAC9G,QAAO,QAAQ,QAAQ,YAAY,eAAe;;AAGpD,SAAS,+BAA+B,SAAwE;AAC9G,QAAO,QAAQ,QAAQ,YAAY,eAAe;;AAGpD,SAAS,+BAA+B,SAAwE;AAC9G,QAAO,QAAQ,QAAQ,YAAY,eAAe"}
1
+ {"version":3,"file":"PeerDidRegistrar.mjs","names":["did: string","didDocument: DidDocument","keys: DidDocumentKey[]","publicJwk: PublicJwk"],"sources":["../../../../../src/modules/dids/methods/peer/PeerDidRegistrar.ts"],"sourcesContent":["import type { AgentContext } from '../../../../agent'\nimport type { XOR } from '../../../../types'\nimport { JsonTransformer } from '../../../../utils'\nimport { KeyManagementApi, type KmsCreateKeyOptions, type KmsCreateKeyTypeAssymetric, PublicJwk } from '../../../kms'\nimport type { DidDocumentKey } from '../../DidsApiOptions'\nimport { DidDocument } from '../../domain'\nimport { DidDocumentRole } from '../../domain/DidDocumentRole'\nimport type { DidRegistrar } from '../../domain/DidRegistrar'\nimport { DidRecord, DidRepository } from '../../repository'\nimport type { DidCreateOptions, DidCreateResult, DidDeactivateResult, DidUpdateResult } from '../../types'\nimport { getAlternativeDidsForPeerDid, PeerDidNumAlgo } from './didPeer'\nimport { publicJwkToNumAlgo0DidDocument } from './peerDidNumAlgo0'\nimport { didDocumentJsonToNumAlgo1Did } from './peerDidNumAlgo1'\nimport { didDocumentToNumAlgo2Did } from './peerDidNumAlgo2'\nimport { didDocumentToNumAlgo4Did } from './peerDidNumAlgo4'\n\nexport class PeerDidRegistrar implements DidRegistrar {\n public readonly supportedMethods = ['peer']\n\n public async create(\n agentContext: AgentContext,\n options:\n | PeerDidNumAlgo0CreateOptions\n | PeerDidNumAlgo1CreateOptions\n | PeerDidNumAlgo2CreateOptions\n | PeerDidNumAlgo4CreateOptions\n ): Promise<DidCreateResult> {\n const kms = agentContext.dependencyManager.resolve(KeyManagementApi)\n const didRepository = agentContext.dependencyManager.resolve(DidRepository)\n\n let did: string\n let didDocument: DidDocument\n\n let keys: DidDocumentKey[]\n\n try {\n if (isPeerDidNumAlgo0CreateOptions(options)) {\n let publicJwk: PublicJwk\n\n if (options.options.createKey) {\n const createKeyResult = await kms.createKey(options.options.createKey)\n publicJwk = PublicJwk.fromPublicJwk(createKeyResult.publicJwk)\n keys = [\n {\n didDocumentRelativeKeyId: `#${publicJwk.fingerprint}`,\n kmsKeyId: createKeyResult.keyId,\n },\n ]\n } else {\n const _publicJwk = await kms.getPublicKey({\n keyId: options.options.keyId,\n })\n\n if (!_publicJwk) {\n return {\n didDocumentMetadata: {},\n didRegistrationMetadata: {},\n didState: {\n state: 'failed',\n reason: `notFound: key with key id '${options.options.keyId}' not found`,\n },\n }\n }\n\n if (_publicJwk.kty === 'oct') {\n return {\n didDocumentMetadata: {},\n didRegistrationMetadata: {},\n didState: {\n state: 'failed',\n reason: `notFound: key with key id '${options.options.keyId}' uses unsupported kty 'oct' for did:key`,\n },\n }\n }\n\n publicJwk = PublicJwk.fromPublicJwk(_publicJwk)\n keys = [\n {\n didDocumentRelativeKeyId: `#${publicJwk.fingerprint}`,\n kmsKeyId: options.options.keyId,\n },\n ]\n }\n\n didDocument = publicJwkToNumAlgo0DidDocument(publicJwk)\n did = didDocument.id\n } else if (isPeerDidNumAlgo1CreateOptions(options)) {\n const didDocumentJson = options.didDocument.toJSON()\n did = didDocumentJsonToNumAlgo1Did(didDocumentJson)\n keys = options.options.keys\n\n didDocument = JsonTransformer.fromJSON({ ...didDocumentJson, id: did }, DidDocument)\n } else if (isPeerDidNumAlgo2CreateOptions(options)) {\n const didDocumentJson = options.didDocument.toJSON()\n did = didDocumentToNumAlgo2Did(options.didDocument)\n keys = options.options.keys\n\n didDocument = JsonTransformer.fromJSON({ ...didDocumentJson, id: did }, DidDocument)\n } else if (isPeerDidNumAlgo4CreateOptions(options)) {\n const didDocumentJson = options.didDocument.toJSON()\n keys = options.options.keys\n\n const { longFormDid, shortFormDid } = didDocumentToNumAlgo4Did(options.didDocument)\n\n did = longFormDid\n didDocument = JsonTransformer.fromJSON(\n { ...didDocumentJson, id: longFormDid, alsoKnownAs: [shortFormDid] },\n DidDocument\n )\n } else {\n return {\n didDocumentMetadata: {},\n didRegistrationMetadata: {},\n didState: {\n state: 'failed',\n reason: 'Missing or incorrect numAlgo provided',\n },\n }\n }\n\n if (!keys || keys.length === 0) {\n return {\n didDocumentMetadata: {},\n didRegistrationMetadata: {},\n didState: {\n state: 'failed',\n reason: `Missing required 'keys' linking did document verification method id to the kms key id. Provide at least one key in the create options`,\n },\n }\n }\n\n // Save the did so we know we created it and can use it for didcomm\n const didRecord = new DidRecord({\n did,\n role: DidDocumentRole.Created,\n didDocument: isPeerDidNumAlgo1CreateOptions(options) ? didDocument : undefined,\n keys,\n tags: {\n // We need to save the recipientKeys, so we can find the associated did\n // of a key when we receive a message from another connection.\n recipientKeyFingerprints: didDocument.recipientKeys.map((key) => key.fingerprint),\n alternativeDids: getAlternativeDidsForPeerDid(did),\n },\n })\n await didRepository.save(agentContext, didRecord)\n\n return {\n didDocumentMetadata: {},\n didRegistrationMetadata: {},\n didState: {\n state: 'finished',\n did: didDocument.id,\n didDocument,\n },\n }\n } catch (error) {\n return {\n didDocumentMetadata: {},\n didRegistrationMetadata: {},\n didState: {\n state: 'failed',\n reason: `unknownError: ${error.message}`,\n },\n }\n }\n }\n\n public async update(): Promise<DidUpdateResult> {\n return {\n didDocumentMetadata: {},\n didRegistrationMetadata: {},\n didState: {\n state: 'failed',\n reason: 'notImplemented: updating did:peer not implemented yet',\n },\n }\n }\n\n public async deactivate(): Promise<DidDeactivateResult> {\n return {\n didDocumentMetadata: {},\n didRegistrationMetadata: {},\n didState: {\n state: 'failed',\n reason: 'notImplemented: deactivating did:peer not implemented yet',\n },\n }\n }\n}\n\nfunction isPeerDidNumAlgo1CreateOptions(options: PeerDidCreateOptions): options is PeerDidNumAlgo1CreateOptions {\n return options.options.numAlgo === PeerDidNumAlgo.GenesisDoc\n}\n\nfunction isPeerDidNumAlgo0CreateOptions(options: PeerDidCreateOptions): options is PeerDidNumAlgo0CreateOptions {\n return options.options.numAlgo === PeerDidNumAlgo.InceptionKeyWithoutDoc\n}\n\nfunction isPeerDidNumAlgo2CreateOptions(options: PeerDidCreateOptions): options is PeerDidNumAlgo2CreateOptions {\n return options.options.numAlgo === PeerDidNumAlgo.MultipleInceptionKeyWithoutDoc\n}\n\nfunction isPeerDidNumAlgo4CreateOptions(options: PeerDidCreateOptions): options is PeerDidNumAlgo4CreateOptions {\n return options.options.numAlgo === PeerDidNumAlgo.ShortFormAndLongForm\n}\n\nexport type PeerDidCreateOptions =\n | PeerDidNumAlgo0CreateOptions\n | PeerDidNumAlgo1CreateOptions\n | PeerDidNumAlgo2CreateOptions\n | PeerDidNumAlgo4CreateOptions\n\nexport interface PeerDidNumAlgo0CreateOptions extends DidCreateOptions {\n method: 'peer'\n did?: never\n didDocument?: never\n options: {\n numAlgo: PeerDidNumAlgo.InceptionKeyWithoutDoc\n } & XOR<{ createKey: KmsCreateKeyOptions<KmsCreateKeyTypeAssymetric> }, { keyId: string }>\n secret?: never\n}\n\nexport interface PeerDidNumAlgo1CreateOptions extends DidCreateOptions {\n method: 'peer'\n did?: never\n didDocument: DidDocument\n options: {\n numAlgo: PeerDidNumAlgo.GenesisDoc\n\n /**\n * The linking between the did document keys and the kms keys. If you want to use\n * the DID within Credo you MUST add the key here. All keys must be present in the did\n * document, but not all did document keys must be present in this array, to allow for keys\n * that are not controleld by this agent.\n */\n keys: DidDocumentKey[]\n }\n secret?: never\n}\n\nexport interface PeerDidNumAlgo2CreateOptions extends DidCreateOptions {\n method: 'peer'\n did?: never\n didDocument: DidDocument\n options: {\n numAlgo: PeerDidNumAlgo.MultipleInceptionKeyWithoutDoc\n\n /**\n * The linking between the did document keys and the kms keys. If you want to use\n * the DID within Credo you MUST add the key here. All keys must be present in the did\n * document, but not all did document keys must be present in this array, to allow for keys\n * that are not controleld by this agent.\n */\n keys: DidDocumentKey[]\n }\n secret?: never\n}\n\nexport interface PeerDidNumAlgo4CreateOptions extends DidCreateOptions {\n method: 'peer'\n did?: never\n didDocument: DidDocument\n options: {\n numAlgo: PeerDidNumAlgo.ShortFormAndLongForm\n\n /**\n * The linking between the did document keys and the kms keys. If you want to use\n * the DID within Credo you MUST add the key here. All keys must be present in the did\n * document, but not all did document keys must be present in this array, to allow for keys\n * that are not controleld by this agent.\n */\n keys: DidDocumentKey[]\n }\n secret?: never\n}\n\n// Update and Deactivate not supported for did:peer\nexport type PeerDidUpdateOptions = never\nexport type PeerDidDeactivateOptions = never\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAgBA,IAAa,mBAAb,MAAsD;;OACpC,mBAAmB,CAAC,OAAO;;CAE3C,MAAa,OACX,cACA,SAK0B;EAC1B,MAAM,MAAM,aAAa,kBAAkB,QAAQ,iBAAiB;EACpE,MAAM,gBAAgB,aAAa,kBAAkB,QAAQ,cAAc;EAE3E,IAAIA;EACJ,IAAIC;EAEJ,IAAIC;AAEJ,MAAI;AACF,OAAI,+BAA+B,QAAQ,EAAE;IAC3C,IAAIC;AAEJ,QAAI,QAAQ,QAAQ,WAAW;KAC7B,MAAM,kBAAkB,MAAM,IAAI,UAAU,QAAQ,QAAQ,UAAU;AACtE,iBAAY,UAAU,cAAc,gBAAgB,UAAU;AAC9D,YAAO,CACL;MACE,0BAA0B,IAAI,UAAU;MACxC,UAAU,gBAAgB;MAC3B,CACF;WACI;KACL,MAAM,aAAa,MAAM,IAAI,aAAa,EACxC,OAAO,QAAQ,QAAQ,OACxB,CAAC;AAEF,SAAI,CAAC,WACH,QAAO;MACL,qBAAqB,EAAE;MACvB,yBAAyB,EAAE;MAC3B,UAAU;OACR,OAAO;OACP,QAAQ,8BAA8B,QAAQ,QAAQ,MAAM;OAC7D;MACF;AAGH,SAAI,WAAW,QAAQ,MACrB,QAAO;MACL,qBAAqB,EAAE;MACvB,yBAAyB,EAAE;MAC3B,UAAU;OACR,OAAO;OACP,QAAQ,8BAA8B,QAAQ,QAAQ,MAAM;OAC7D;MACF;AAGH,iBAAY,UAAU,cAAc,WAAW;AAC/C,YAAO,CACL;MACE,0BAA0B,IAAI,UAAU;MACxC,UAAU,QAAQ,QAAQ;MAC3B,CACF;;AAGH,kBAAc,+BAA+B,UAAU;AACvD,UAAM,YAAY;cACT,+BAA+B,QAAQ,EAAE;IAClD,MAAM,kBAAkB,QAAQ,YAAY,QAAQ;AACpD,UAAM,6BAA6B,gBAAgB;AACnD,WAAO,QAAQ,QAAQ;AAEvB,kBAAc,gBAAgB,SAAS;KAAE,GAAG;KAAiB,IAAI;KAAK,EAAE,YAAY;cAC3E,+BAA+B,QAAQ,EAAE;IAClD,MAAM,kBAAkB,QAAQ,YAAY,QAAQ;AACpD,UAAM,yBAAyB,QAAQ,YAAY;AACnD,WAAO,QAAQ,QAAQ;AAEvB,kBAAc,gBAAgB,SAAS;KAAE,GAAG;KAAiB,IAAI;KAAK,EAAE,YAAY;cAC3E,+BAA+B,QAAQ,EAAE;IAClD,MAAM,kBAAkB,QAAQ,YAAY,QAAQ;AACpD,WAAO,QAAQ,QAAQ;IAEvB,MAAM,EAAE,aAAa,iBAAiB,yBAAyB,QAAQ,YAAY;AAEnF,UAAM;AACN,kBAAc,gBAAgB,SAC5B;KAAE,GAAG;KAAiB,IAAI;KAAa,aAAa,CAAC,aAAa;KAAE,EACpE,YACD;SAED,QAAO;IACL,qBAAqB,EAAE;IACvB,yBAAyB,EAAE;IAC3B,UAAU;KACR,OAAO;KACP,QAAQ;KACT;IACF;AAGH,OAAI,CAAC,QAAQ,KAAK,WAAW,EAC3B,QAAO;IACL,qBAAqB,EAAE;IACvB,yBAAyB,EAAE;IAC3B,UAAU;KACR,OAAO;KACP,QAAQ;KACT;IACF;GAIH,MAAM,YAAY,IAAI,UAAU;IAC9B;IACA,MAAM,gBAAgB;IACtB,aAAa,+BAA+B,QAAQ,GAAG,cAAc;IACrE;IACA,MAAM;KAGJ,0BAA0B,YAAY,cAAc,KAAK,QAAQ,IAAI,YAAY;KACjF,iBAAiB,6BAA6B,IAAI;KACnD;IACF,CAAC;AACF,SAAM,cAAc,KAAK,cAAc,UAAU;AAEjD,UAAO;IACL,qBAAqB,EAAE;IACvB,yBAAyB,EAAE;IAC3B,UAAU;KACR,OAAO;KACP,KAAK,YAAY;KACjB;KACD;IACF;WACM,OAAO;AACd,UAAO;IACL,qBAAqB,EAAE;IACvB,yBAAyB,EAAE;IAC3B,UAAU;KACR,OAAO;KACP,QAAQ,iBAAiB,MAAM;KAChC;IACF;;;CAIL,MAAa,SAAmC;AAC9C,SAAO;GACL,qBAAqB,EAAE;GACvB,yBAAyB,EAAE;GAC3B,UAAU;IACR,OAAO;IACP,QAAQ;IACT;GACF;;CAGH,MAAa,aAA2C;AACtD,SAAO;GACL,qBAAqB,EAAE;GACvB,yBAAyB,EAAE;GAC3B,UAAU;IACR,OAAO;IACP,QAAQ;IACT;GACF;;;AAIL,SAAS,+BAA+B,SAAwE;AAC9G,QAAO,QAAQ,QAAQ,YAAY,eAAe;;AAGpD,SAAS,+BAA+B,SAAwE;AAC9G,QAAO,QAAQ,QAAQ,YAAY,eAAe;;AAGpD,SAAS,+BAA+B,SAAwE;AAC9G,QAAO,QAAQ,QAAQ,YAAY,eAAe;;AAGpD,SAAS,+BAA+B,SAAwE;AAC9G,QAAO,QAAQ,QAAQ,YAAY,eAAe"}
@@ -1 +1 @@
1
- {"version":3,"file":"PeerDidResolver.d.mts","names":[],"sources":["../../../../../src/modules/dids/methods/peer/PeerDidResolver.ts"],"sourcesContent":[],"mappings":";;;;;cAaa,eAAA,YAA2B;;;;AAAxC;EAA6B,SAAA,aAAA,GAAA,KAAA;;;;;EAAsB,SAAA,oBAAA,GAAA,KAAA;wBAcd,4BAA4B,QAAQ"}
1
+ {"version":3,"file":"PeerDidResolver.d.mts","names":[],"sources":["../../../../../src/modules/dids/methods/peer/PeerDidResolver.ts"],"sourcesContent":[],"mappings":";;;;;cAYa,eAAA,YAA2B;;;;AAAxC;EAA6B,SAAA,aAAA,GAAA,KAAA;;;;;EAAsB,SAAA,oBAAA,GAAA,KAAA;wBAcd,4BAA4B,QAAQ"}
@@ -1 +1 @@
1
- {"version":3,"file":"PeerDidResolver.d.ts","names":[],"sources":["../../../../../src/modules/dids/methods/peer/PeerDidResolver.ts"],"sourcesContent":[],"mappings":";;;;;cAaa,eAAA,YAA2B;;EAA3B;;;WAc4D,aAAA,GAAA,KAAA;;;;;;wBAApC,4BAA4B,QAAQ"}
1
+ {"version":3,"file":"PeerDidResolver.d.ts","names":[],"sources":["../../../../../src/modules/dids/methods/peer/PeerDidResolver.ts"],"sourcesContent":[],"mappings":";;;;;cAYa,eAAA,YAA2B;;EAA3B;;;WAc4D,aAAA,GAAA,KAAA;;;;;;wBAApC,4BAA4B,QAAQ"}
@@ -1 +1 @@
1
- {"version":3,"file":"PeerDidResolver.mjs","names":["didDocument: DidDocument"],"sources":["../../../../../src/modules/dids/methods/peer/PeerDidResolver.ts"],"sourcesContent":["import type { AgentContext } from '../../../../agent'\nimport type { DidDocument } from '../../domain'\nimport type { DidResolver } from '../../domain/DidResolver'\nimport type { DidResolutionResult } from '../../types'\n\nimport { CredoError } from '../../../../error'\nimport { DidRepository } from '../../repository'\n\nimport { PeerDidNumAlgo, getNumAlgoFromPeerDid, isValidPeerDid } from './didPeer'\nimport { didToNumAlgo0DidDocument } from './peerDidNumAlgo0'\nimport { didToNumAlgo2DidDocument } from './peerDidNumAlgo2'\nimport { didToNumAlgo4DidDocument, isShortFormDidPeer4 } from './peerDidNumAlgo4'\n\nexport class PeerDidResolver implements DidResolver {\n public readonly supportedMethods = ['peer']\n\n /**\n * No remote resolving done, did document is fetched from storage. To not pollute the cache we don't allow caching\n */\n public readonly allowsCaching = false\n\n /**\n * Did peer records are often server from local did doucment, but it's easier to handle it in\n * the peer did resolver.\n */\n public readonly allowsLocalDidRecord = false\n\n public async resolve(agentContext: AgentContext, did: string): Promise<DidResolutionResult> {\n const didRepository = agentContext.dependencyManager.resolve(DidRepository)\n\n const didDocumentMetadata = {}\n\n try {\n let didDocument: DidDocument\n\n if (!isValidPeerDid(did)) {\n throw new CredoError(`did ${did} is not a valid peer did`)\n }\n\n const numAlgo = getNumAlgoFromPeerDid(did)\n\n // For method 0, generate from did\n if (numAlgo === PeerDidNumAlgo.InceptionKeyWithoutDoc) {\n didDocument = didToNumAlgo0DidDocument(did)\n }\n // For Method 1, retrieve from storage\n else if (numAlgo === PeerDidNumAlgo.GenesisDoc) {\n // We can have multiple did document records stored for a single did (one created and one received). In this case it\n // doesn't matter which one we use, and they should be identical. So we just take the first one.\n const [didDocumentRecord] = await didRepository.findAllByDid(agentContext, did)\n\n if (!didDocumentRecord) {\n throw new CredoError(`No did record found for peer did ${did}.`)\n }\n\n if (!didDocumentRecord.didDocument) {\n throw new CredoError(`Found did record for method 1 peer did (${did}), but no did document.`)\n }\n\n didDocument = didDocumentRecord.didDocument\n }\n // For Method 2, generate from did\n else if (numAlgo === PeerDidNumAlgo.MultipleInceptionKeyWithoutDoc) {\n didDocument = didToNumAlgo2DidDocument(did)\n }\n // For Method 4, if short form is received, attempt to get the didDocument from stored record\n else {\n if (isShortFormDidPeer4(did)) {\n const [didRecord] = await didRepository.findAllByDid(agentContext, did)\n\n if (!didRecord) {\n throw new CredoError(`No did record found for peer did ${did}.`)\n }\n didDocument = didToNumAlgo4DidDocument(didRecord.did)\n } else {\n didDocument = didToNumAlgo4DidDocument(did)\n }\n }\n\n return {\n didDocument,\n didDocumentMetadata,\n didResolutionMetadata: { contentType: 'application/did+ld+json' },\n }\n } catch (error) {\n agentContext.config.logger.error(`Error resolving did '${did}'`, {\n error,\n })\n\n return {\n didDocument: null,\n didDocumentMetadata,\n didResolutionMetadata: {\n error: 'notFound',\n message: `resolver_error: Unable to resolve did '${did}': ${error}`,\n },\n }\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;AAaA,IAAa,kBAAb,MAAoD;;OAClC,mBAAmB,CAAC,OAAO;OAK3B,gBAAgB;OAMhB,uBAAuB;;CAEvC,MAAa,QAAQ,cAA4B,KAA2C;EAC1F,MAAM,gBAAgB,aAAa,kBAAkB,QAAQ,cAAc;EAE3E,MAAM,sBAAsB,EAAE;AAE9B,MAAI;GACF,IAAIA;AAEJ,OAAI,CAAC,eAAe,IAAI,CACtB,OAAM,IAAI,WAAW,OAAO,IAAI,0BAA0B;GAG5D,MAAM,UAAU,sBAAsB,IAAI;AAG1C,OAAI,YAAY,eAAe,uBAC7B,eAAc,yBAAyB,IAAI;YAGpC,YAAY,eAAe,YAAY;IAG9C,MAAM,CAAC,qBAAqB,MAAM,cAAc,aAAa,cAAc,IAAI;AAE/E,QAAI,CAAC,kBACH,OAAM,IAAI,WAAW,oCAAoC,IAAI,GAAG;AAGlE,QAAI,CAAC,kBAAkB,YACrB,OAAM,IAAI,WAAW,2CAA2C,IAAI,yBAAyB;AAG/F,kBAAc,kBAAkB;cAGzB,YAAY,eAAe,+BAClC,eAAc,yBAAyB,IAAI;YAIvC,oBAAoB,IAAI,EAAE;IAC5B,MAAM,CAAC,aAAa,MAAM,cAAc,aAAa,cAAc,IAAI;AAEvE,QAAI,CAAC,UACH,OAAM,IAAI,WAAW,oCAAoC,IAAI,GAAG;AAElE,kBAAc,yBAAyB,UAAU,IAAI;SAErD,eAAc,yBAAyB,IAAI;AAI/C,UAAO;IACL;IACA;IACA,uBAAuB,EAAE,aAAa,2BAA2B;IAClE;WACM,OAAO;AACd,gBAAa,OAAO,OAAO,MAAM,wBAAwB,IAAI,IAAI,EAC/D,OACD,CAAC;AAEF,UAAO;IACL,aAAa;IACb;IACA,uBAAuB;KACrB,OAAO;KACP,SAAS,0CAA0C,IAAI,KAAK;KAC7D;IACF"}
1
+ {"version":3,"file":"PeerDidResolver.mjs","names":["didDocument: DidDocument"],"sources":["../../../../../src/modules/dids/methods/peer/PeerDidResolver.ts"],"sourcesContent":["import type { AgentContext } from '../../../../agent'\nimport { CredoError } from '../../../../error'\nimport type { DidDocument } from '../../domain'\nimport type { DidResolver } from '../../domain/DidResolver'\nimport { DidRepository } from '../../repository'\nimport type { DidResolutionResult } from '../../types'\n\nimport { getNumAlgoFromPeerDid, isValidPeerDid, PeerDidNumAlgo } from './didPeer'\nimport { didToNumAlgo0DidDocument } from './peerDidNumAlgo0'\nimport { didToNumAlgo2DidDocument } from './peerDidNumAlgo2'\nimport { didToNumAlgo4DidDocument, isShortFormDidPeer4 } from './peerDidNumAlgo4'\n\nexport class PeerDidResolver implements DidResolver {\n public readonly supportedMethods = ['peer']\n\n /**\n * No remote resolving done, did document is fetched from storage. To not pollute the cache we don't allow caching\n */\n public readonly allowsCaching = false\n\n /**\n * Did peer records are often server from local did doucment, but it's easier to handle it in\n * the peer did resolver.\n */\n public readonly allowsLocalDidRecord = false\n\n public async resolve(agentContext: AgentContext, did: string): Promise<DidResolutionResult> {\n const didRepository = agentContext.dependencyManager.resolve(DidRepository)\n\n const didDocumentMetadata = {}\n\n try {\n let didDocument: DidDocument\n\n if (!isValidPeerDid(did)) {\n throw new CredoError(`did ${did} is not a valid peer did`)\n }\n\n const numAlgo = getNumAlgoFromPeerDid(did)\n\n // For method 0, generate from did\n if (numAlgo === PeerDidNumAlgo.InceptionKeyWithoutDoc) {\n didDocument = didToNumAlgo0DidDocument(did)\n }\n // For Method 1, retrieve from storage\n else if (numAlgo === PeerDidNumAlgo.GenesisDoc) {\n // We can have multiple did document records stored for a single did (one created and one received). In this case it\n // doesn't matter which one we use, and they should be identical. So we just take the first one.\n const [didDocumentRecord] = await didRepository.findAllByDid(agentContext, did)\n\n if (!didDocumentRecord) {\n throw new CredoError(`No did record found for peer did ${did}.`)\n }\n\n if (!didDocumentRecord.didDocument) {\n throw new CredoError(`Found did record for method 1 peer did (${did}), but no did document.`)\n }\n\n didDocument = didDocumentRecord.didDocument\n }\n // For Method 2, generate from did\n else if (numAlgo === PeerDidNumAlgo.MultipleInceptionKeyWithoutDoc) {\n didDocument = didToNumAlgo2DidDocument(did)\n }\n // For Method 4, if short form is received, attempt to get the didDocument from stored record\n else {\n if (isShortFormDidPeer4(did)) {\n const [didRecord] = await didRepository.findAllByDid(agentContext, did)\n\n if (!didRecord) {\n throw new CredoError(`No did record found for peer did ${did}.`)\n }\n didDocument = didToNumAlgo4DidDocument(didRecord.did)\n } else {\n didDocument = didToNumAlgo4DidDocument(did)\n }\n }\n\n return {\n didDocument,\n didDocumentMetadata,\n didResolutionMetadata: { contentType: 'application/did+ld+json' },\n }\n } catch (error) {\n agentContext.config.logger.error(`Error resolving did '${did}'`, {\n error,\n })\n\n return {\n didDocument: null,\n didDocumentMetadata,\n didResolutionMetadata: {\n error: 'notFound',\n message: `resolver_error: Unable to resolve did '${did}': ${error}`,\n },\n }\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;AAYA,IAAa,kBAAb,MAAoD;;OAClC,mBAAmB,CAAC,OAAO;OAK3B,gBAAgB;OAMhB,uBAAuB;;CAEvC,MAAa,QAAQ,cAA4B,KAA2C;EAC1F,MAAM,gBAAgB,aAAa,kBAAkB,QAAQ,cAAc;EAE3E,MAAM,sBAAsB,EAAE;AAE9B,MAAI;GACF,IAAIA;AAEJ,OAAI,CAAC,eAAe,IAAI,CACtB,OAAM,IAAI,WAAW,OAAO,IAAI,0BAA0B;GAG5D,MAAM,UAAU,sBAAsB,IAAI;AAG1C,OAAI,YAAY,eAAe,uBAC7B,eAAc,yBAAyB,IAAI;YAGpC,YAAY,eAAe,YAAY;IAG9C,MAAM,CAAC,qBAAqB,MAAM,cAAc,aAAa,cAAc,IAAI;AAE/E,QAAI,CAAC,kBACH,OAAM,IAAI,WAAW,oCAAoC,IAAI,GAAG;AAGlE,QAAI,CAAC,kBAAkB,YACrB,OAAM,IAAI,WAAW,2CAA2C,IAAI,yBAAyB;AAG/F,kBAAc,kBAAkB;cAGzB,YAAY,eAAe,+BAClC,eAAc,yBAAyB,IAAI;YAIvC,oBAAoB,IAAI,EAAE;IAC5B,MAAM,CAAC,aAAa,MAAM,cAAc,aAAa,cAAc,IAAI;AAEvE,QAAI,CAAC,UACH,OAAM,IAAI,WAAW,oCAAoC,IAAI,GAAG;AAElE,kBAAc,yBAAyB,UAAU,IAAI;SAErD,eAAc,yBAAyB,IAAI;AAI/C,UAAO;IACL;IACA;IACA,uBAAuB,EAAE,aAAa,2BAA2B;IAClE;WACM,OAAO;AACd,gBAAa,OAAO,OAAO,MAAM,wBAAwB,IAAI,IAAI,EAC/D,OACD,CAAC;AAEF,UAAO;IACL,aAAa;IACb;IACA,uBAAuB;KACrB,OAAO;KACP,SAAS,0CAA0C,IAAI,KAAK;KAC7D;IACF"}
@@ -1,6 +1,6 @@
1
+ import { ResolvedDidCommService } from "../../../../types.mjs";
1
2
  import { DidDocument } from "../../domain/DidDocument.mjs";
2
3
  import { DidDocumentKey } from "../../DidsApiOptions.mjs";
3
- import { ResolvedDidCommService } from "../../../../types.mjs";
4
4
 
5
5
  //#region src/modules/dids/methods/peer/createPeerDidDocumentFromServices.d.ts
6
6
  declare function createPeerDidDocumentFromServices<WithKeys extends boolean>(services: ResolvedDidCommService[], withKeys: WithKeys): {
@@ -1 +1 @@
1
- {"version":3,"file":"createPeerDidDocumentFromServices.d.mts","names":[],"sources":["../../../../../src/modules/dids/methods/peer/createPeerDidDocumentFromServices.ts"],"sourcesContent":[],"mappings":";;;;;iBAWgB,sEACJ,oCACA;eACM;QAAmB,wBAAwB"}
1
+ {"version":3,"file":"createPeerDidDocumentFromServices.d.mts","names":[],"sources":["../../../../../src/modules/dids/methods/peer/createPeerDidDocumentFromServices.ts"],"sourcesContent":[],"mappings":";;;;;iBAUgB,sEACJ,oCACA;eACM;QAAmB,wBAAwB"}
@@ -1,6 +1,6 @@
1
+ import { ResolvedDidCommService } from "../../../../types.js";
1
2
  import { DidDocument } from "../../domain/DidDocument.js";
2
3
  import { DidDocumentKey } from "../../DidsApiOptions.js";
3
- import { ResolvedDidCommService } from "../../../../types.js";
4
4
 
5
5
  //#region src/modules/dids/methods/peer/createPeerDidDocumentFromServices.d.ts
6
6
  declare function createPeerDidDocumentFromServices<WithKeys extends boolean>(services: ResolvedDidCommService[], withKeys: WithKeys): {
@@ -1 +1 @@
1
- {"version":3,"file":"createPeerDidDocumentFromServices.d.ts","names":[],"sources":["../../../../../src/modules/dids/methods/peer/createPeerDidDocumentFromServices.ts"],"sourcesContent":[],"mappings":";;;;;iBAWgB,sEACJ,oCACA;eACM;EAHF,IAAA,EAGqB,QAHrB,SAAA,IAAA,GAG6C,cAHZ,EAAA,GAAA,SAAA;CAAA"}
1
+ {"version":3,"file":"createPeerDidDocumentFromServices.d.ts","names":[],"sources":["../../../../../src/modules/dids/methods/peer/createPeerDidDocumentFromServices.ts"],"sourcesContent":[],"mappings":";;;;;iBAUgB,sEACJ,oCACA;eACM;EAHF,IAAA,EAGqB,QAHrB,SAAA,IAAA,GAG6C,cAHZ,EAAA,GAAA,SAAA;CAAA"}
@@ -3,9 +3,9 @@
3
3
  const require_rolldown_runtime = require('../../../../_virtual/rolldown_runtime.js');
4
4
  const require_PublicJwk = require('../../../kms/jwk/PublicJwk.js');
5
5
  require('../../../kms/index.js');
6
- const require_DidCommV1Service = require('../../domain/service/DidCommV1Service.js');
7
6
  const require_Ed25519VerificationKey2018 = require('../../domain/verificationMethod/Ed25519VerificationKey2018.js');
8
7
  const require_X25519KeyAgreementKey2019 = require('../../domain/verificationMethod/X25519KeyAgreementKey2019.js');
8
+ const require_DidCommV1Service = require('../../domain/service/DidCommV1Service.js');
9
9
  const require_DidDocumentBuilder = require('../../domain/DidDocumentBuilder.js');
10
10
  require('../../domain/index.js');
11
11
  const require_DidKey = require('../key/DidKey.js');
@@ -2,9 +2,9 @@
2
2
 
3
3
  import { PublicJwk } from "../../../kms/jwk/PublicJwk.mjs";
4
4
  import "../../../kms/index.mjs";
5
- import { DidCommV1Service } from "../../domain/service/DidCommV1Service.mjs";
6
5
  import { getEd25519VerificationKey2018 } from "../../domain/verificationMethod/Ed25519VerificationKey2018.mjs";
7
6
  import { getX25519KeyAgreementKey2019 } from "../../domain/verificationMethod/X25519KeyAgreementKey2019.mjs";
7
+ import { DidCommV1Service } from "../../domain/service/DidCommV1Service.mjs";
8
8
  import { DidDocumentBuilder } from "../../domain/DidDocumentBuilder.mjs";
9
9
  import "../../domain/index.mjs";
10
10
  import { DidKey } from "../key/DidKey.mjs";
@@ -1 +1 @@
1
- {"version":3,"file":"createPeerDidDocumentFromServices.mjs","names":["recipientKeyIdMapping: { [fingerprint: string]: string }","keys: DidDocumentKey[]"],"sources":["../../../../../src/modules/dids/methods/peer/createPeerDidDocumentFromServices.ts"],"sourcesContent":["import type { ResolvedDidCommService } from '../../../../types'\n\nimport { convertPublicKeyToX25519 } from '@stablelib/ed25519'\n\nimport { PublicJwk } from '../../../kms'\nimport type { DidDocumentKey } from '../../DidsApiOptions'\nimport { DidDocument, getEd25519VerificationKey2018, getX25519KeyAgreementKey2019 } from '../../domain'\nimport { DidDocumentBuilder } from '../../domain/DidDocumentBuilder'\nimport { DidCommV1Service } from '../../domain/service/DidCommV1Service'\nimport { DidKey } from '../key'\n\nexport function createPeerDidDocumentFromServices<WithKeys extends boolean>(\n services: ResolvedDidCommService[],\n withKeys: WithKeys\n): { didDocument: DidDocument; keys: WithKeys extends true ? DidDocumentKey[] : undefined } {\n const didDocumentBuilder = new DidDocumentBuilder('')\n\n // Keep track of all added key id based on the fingerprint so we can add them to the recipientKeys as references\n const recipientKeyIdMapping: { [fingerprint: string]: string } = {}\n\n const keys: DidDocumentKey[] = []\n\n let keyIndex = 1\n services.forEach((service, index) => {\n // Get the local key reference for each of the recipient keys\n const recipientKeys = service.recipientKeys.map((recipientKey) => {\n // Key already added to the did document\n if (recipientKeyIdMapping[recipientKey.fingerprint]) return recipientKeyIdMapping[recipientKey.fingerprint]\n\n const x25519Key = PublicJwk.fromPublicKey({\n crv: 'X25519',\n kty: 'OKP',\n publicKey: convertPublicKeyToX25519(recipientKey.publicKey.publicKey),\n })\n\n // key ids follow the #key-N pattern to comply with did:peer:2 spec\n const ed25519RelativeVerificationMethodId = `#key-${keyIndex++}`\n const ed25519VerificationMethod = getEd25519VerificationKey2018({\n id: ed25519RelativeVerificationMethodId,\n publicJwk: recipientKey,\n controller: '#id',\n })\n const x25519RelativeVerificationMethodId = `#key-${keyIndex++}`\n const x25519VerificationMethod = getX25519KeyAgreementKey2019({\n id: x25519RelativeVerificationMethodId,\n publicJwk: x25519Key,\n controller: '#id',\n })\n\n recipientKeyIdMapping[recipientKey.fingerprint] = ed25519VerificationMethod.id\n\n // NOTE: both use the same key id as the x25519 key is derived from the ed25519 key\n // This is special for DIDComm v1 and any kms that wants to support DIDComm v1 will have\n // to support both Ed25519 and X25519 operations on a Ed25519 key\n if (withKeys) {\n keys.push({\n didDocumentRelativeKeyId: ed25519RelativeVerificationMethodId,\n kmsKeyId: recipientKey.keyId,\n })\n keys.push({\n didDocumentRelativeKeyId: x25519RelativeVerificationMethodId,\n kmsKeyId: recipientKey.keyId,\n })\n }\n\n // We should not add duplicated keys for services\n didDocumentBuilder.addAuthentication(ed25519VerificationMethod).addKeyAgreement(x25519VerificationMethod)\n\n return recipientKeyIdMapping[recipientKey.fingerprint]\n })\n\n // Transform all routing keys into did:key:xxx#key-id references. This will probably change for didcomm v2\n const routingKeys = service.routingKeys?.map((key) => {\n const didKey = new DidKey(key)\n\n return `${didKey.did}#${key.fingerprint}`\n })\n\n didDocumentBuilder.addService(\n new DidCommV1Service({\n id: service.id,\n priority: index,\n serviceEndpoint: service.serviceEndpoint,\n recipientKeys,\n routingKeys,\n })\n )\n })\n\n return {\n didDocument: didDocumentBuilder.build(),\n keys: (withKeys ? keys : undefined) as WithKeys extends true ? DidDocumentKey[] : undefined,\n }\n}\n"],"mappings":";;;;;;;;;;;;;;AAWA,SAAgB,kCACd,UACA,UAC0F;CAC1F,MAAM,qBAAqB,IAAI,mBAAmB,GAAG;CAGrD,MAAMA,wBAA2D,EAAE;CAEnE,MAAMC,OAAyB,EAAE;CAEjC,IAAI,WAAW;AACf,UAAS,SAAS,SAAS,UAAU;EAEnC,MAAM,gBAAgB,QAAQ,cAAc,KAAK,iBAAiB;AAEhE,OAAI,sBAAsB,aAAa,aAAc,QAAO,sBAAsB,aAAa;GAE/F,MAAM,YAAY,UAAU,cAAc;IACxC,KAAK;IACL,KAAK;IACL,WAAW,yBAAyB,aAAa,UAAU,UAAU;IACtE,CAAC;GAGF,MAAM,sCAAsC,QAAQ;GACpD,MAAM,4BAA4B,8BAA8B;IAC9D,IAAI;IACJ,WAAW;IACX,YAAY;IACb,CAAC;GACF,MAAM,qCAAqC,QAAQ;GACnD,MAAM,2BAA2B,6BAA6B;IAC5D,IAAI;IACJ,WAAW;IACX,YAAY;IACb,CAAC;AAEF,yBAAsB,aAAa,eAAe,0BAA0B;AAK5E,OAAI,UAAU;AACZ,SAAK,KAAK;KACR,0BAA0B;KAC1B,UAAU,aAAa;KACxB,CAAC;AACF,SAAK,KAAK;KACR,0BAA0B;KAC1B,UAAU,aAAa;KACxB,CAAC;;AAIJ,sBAAmB,kBAAkB,0BAA0B,CAAC,gBAAgB,yBAAyB;AAEzG,UAAO,sBAAsB,aAAa;IAC1C;EAGF,MAAM,cAAc,QAAQ,aAAa,KAAK,QAAQ;AAGpD,UAAO,GAFQ,IAAI,OAAO,IAAI,CAEb,IAAI,GAAG,IAAI;IAC5B;AAEF,qBAAmB,WACjB,IAAI,iBAAiB;GACnB,IAAI,QAAQ;GACZ,UAAU;GACV,iBAAiB,QAAQ;GACzB;GACA;GACD,CAAC,CACH;GACD;AAEF,QAAO;EACL,aAAa,mBAAmB,OAAO;EACvC,MAAO,WAAW,OAAO;EAC1B"}
1
+ {"version":3,"file":"createPeerDidDocumentFromServices.mjs","names":["recipientKeyIdMapping: { [fingerprint: string]: string }","keys: DidDocumentKey[]"],"sources":["../../../../../src/modules/dids/methods/peer/createPeerDidDocumentFromServices.ts"],"sourcesContent":["import { convertPublicKeyToX25519 } from '@stablelib/ed25519'\nimport type { ResolvedDidCommService } from '../../../../types'\n\nimport { PublicJwk } from '../../../kms'\nimport type { DidDocumentKey } from '../../DidsApiOptions'\nimport { DidDocument, getEd25519VerificationKey2018, getX25519KeyAgreementKey2019 } from '../../domain'\nimport { DidDocumentBuilder } from '../../domain/DidDocumentBuilder'\nimport { DidCommV1Service } from '../../domain/service/DidCommV1Service'\nimport { DidKey } from '../key'\n\nexport function createPeerDidDocumentFromServices<WithKeys extends boolean>(\n services: ResolvedDidCommService[],\n withKeys: WithKeys\n): { didDocument: DidDocument; keys: WithKeys extends true ? DidDocumentKey[] : undefined } {\n const didDocumentBuilder = new DidDocumentBuilder('')\n\n // Keep track of all added key id based on the fingerprint so we can add them to the recipientKeys as references\n const recipientKeyIdMapping: { [fingerprint: string]: string } = {}\n\n const keys: DidDocumentKey[] = []\n\n let keyIndex = 1\n services.forEach((service, index) => {\n // Get the local key reference for each of the recipient keys\n const recipientKeys = service.recipientKeys.map((recipientKey) => {\n // Key already added to the did document\n if (recipientKeyIdMapping[recipientKey.fingerprint]) return recipientKeyIdMapping[recipientKey.fingerprint]\n\n const x25519Key = PublicJwk.fromPublicKey({\n crv: 'X25519',\n kty: 'OKP',\n publicKey: convertPublicKeyToX25519(recipientKey.publicKey.publicKey),\n })\n\n // key ids follow the #key-N pattern to comply with did:peer:2 spec\n const ed25519RelativeVerificationMethodId = `#key-${keyIndex++}`\n const ed25519VerificationMethod = getEd25519VerificationKey2018({\n id: ed25519RelativeVerificationMethodId,\n publicJwk: recipientKey,\n controller: '#id',\n })\n const x25519RelativeVerificationMethodId = `#key-${keyIndex++}`\n const x25519VerificationMethod = getX25519KeyAgreementKey2019({\n id: x25519RelativeVerificationMethodId,\n publicJwk: x25519Key,\n controller: '#id',\n })\n\n recipientKeyIdMapping[recipientKey.fingerprint] = ed25519VerificationMethod.id\n\n // NOTE: both use the same key id as the x25519 key is derived from the ed25519 key\n // This is special for DIDComm v1 and any kms that wants to support DIDComm v1 will have\n // to support both Ed25519 and X25519 operations on a Ed25519 key\n if (withKeys) {\n keys.push({\n didDocumentRelativeKeyId: ed25519RelativeVerificationMethodId,\n kmsKeyId: recipientKey.keyId,\n })\n keys.push({\n didDocumentRelativeKeyId: x25519RelativeVerificationMethodId,\n kmsKeyId: recipientKey.keyId,\n })\n }\n\n // We should not add duplicated keys for services\n didDocumentBuilder.addAuthentication(ed25519VerificationMethod).addKeyAgreement(x25519VerificationMethod)\n\n return recipientKeyIdMapping[recipientKey.fingerprint]\n })\n\n // Transform all routing keys into did:key:xxx#key-id references. This will probably change for didcomm v2\n const routingKeys = service.routingKeys?.map((key) => {\n const didKey = new DidKey(key)\n\n return `${didKey.did}#${key.fingerprint}`\n })\n\n didDocumentBuilder.addService(\n new DidCommV1Service({\n id: service.id,\n priority: index,\n serviceEndpoint: service.serviceEndpoint,\n recipientKeys,\n routingKeys,\n })\n )\n })\n\n return {\n didDocument: didDocumentBuilder.build(),\n keys: (withKeys ? keys : undefined) as WithKeys extends true ? DidDocumentKey[] : undefined,\n }\n}\n"],"mappings":";;;;;;;;;;;;;;AAUA,SAAgB,kCACd,UACA,UAC0F;CAC1F,MAAM,qBAAqB,IAAI,mBAAmB,GAAG;CAGrD,MAAMA,wBAA2D,EAAE;CAEnE,MAAMC,OAAyB,EAAE;CAEjC,IAAI,WAAW;AACf,UAAS,SAAS,SAAS,UAAU;EAEnC,MAAM,gBAAgB,QAAQ,cAAc,KAAK,iBAAiB;AAEhE,OAAI,sBAAsB,aAAa,aAAc,QAAO,sBAAsB,aAAa;GAE/F,MAAM,YAAY,UAAU,cAAc;IACxC,KAAK;IACL,KAAK;IACL,WAAW,yBAAyB,aAAa,UAAU,UAAU;IACtE,CAAC;GAGF,MAAM,sCAAsC,QAAQ;GACpD,MAAM,4BAA4B,8BAA8B;IAC9D,IAAI;IACJ,WAAW;IACX,YAAY;IACb,CAAC;GACF,MAAM,qCAAqC,QAAQ;GACnD,MAAM,2BAA2B,6BAA6B;IAC5D,IAAI;IACJ,WAAW;IACX,YAAY;IACb,CAAC;AAEF,yBAAsB,aAAa,eAAe,0BAA0B;AAK5E,OAAI,UAAU;AACZ,SAAK,KAAK;KACR,0BAA0B;KAC1B,UAAU,aAAa;KACxB,CAAC;AACF,SAAK,KAAK;KACR,0BAA0B;KAC1B,UAAU,aAAa;KACxB,CAAC;;AAIJ,sBAAmB,kBAAkB,0BAA0B,CAAC,gBAAgB,yBAAyB;AAEzG,UAAO,sBAAsB,aAAa;IAC1C;EAGF,MAAM,cAAc,QAAQ,aAAa,KAAK,QAAQ;AAGpD,UAAO,GAFQ,IAAI,OAAO,IAAI,CAEb,IAAI,GAAG,IAAI;IAC5B;AAEF,qBAAmB,WACjB,IAAI,iBAAiB;GACnB,IAAI,QAAQ;GACZ,UAAU;GACV,iBAAiB,QAAQ;GACzB;GACA;GACD,CAAC,CACH;GACD;AAEF,QAAO;EACL,aAAa,mBAAmB,OAAO;EACvC,MAAO,WAAW,OAAO;EAC1B"}
@@ -1,6 +1,6 @@
1
1
 
2
2
 
3
+ const require_createPeerDidDocumentFromServices = require('./createPeerDidDocumentFromServices.js');
3
4
  const require_didPeer = require('./didPeer.js');
4
5
  const require_PeerDidRegistrar = require('./PeerDidRegistrar.js');
5
6
  const require_PeerDidResolver = require('./PeerDidResolver.js');
6
- const require_createPeerDidDocumentFromServices = require('./createPeerDidDocumentFromServices.js');
@@ -1,6 +1,6 @@
1
1
 
2
2
 
3
+ import { createPeerDidDocumentFromServices } from "./createPeerDidDocumentFromServices.mjs";
3
4
  import { PeerDidNumAlgo, getAlternativeDidsForPeerDid, getNumAlgoFromPeerDid, isValidPeerDid } from "./didPeer.mjs";
4
5
  import { PeerDidRegistrar } from "./PeerDidRegistrar.mjs";
5
6
  import { PeerDidResolver } from "./PeerDidResolver.mjs";
6
- import { createPeerDidDocumentFromServices } from "./createPeerDidDocumentFromServices.mjs";
@@ -1 +1 @@
1
- {"version":3,"file":"peerDidNumAlgo0.mjs","names":[],"sources":["../../../../../src/modules/dids/methods/peer/peerDidNumAlgo0.ts"],"sourcesContent":["import { CredoError } from '../../../../error'\nimport { PublicJwk } from '../../../kms'\nimport { getDidDocumentForPublicJwk } from '../../domain/keyDidDocument'\nimport { parseDid } from '../../domain/parse'\n\nimport { PeerDidNumAlgo, getNumAlgoFromPeerDid, isValidPeerDid } from './didPeer'\n\nexport function publicJwkToNumAlgo0DidDocument(publicJwk: PublicJwk) {\n const did = `did:peer:0${publicJwk.fingerprint}`\n\n return getDidDocumentForPublicJwk(did, publicJwk)\n}\n\nexport function didToNumAlgo0DidDocument(did: string) {\n const parsed = parseDid(did)\n const numAlgo = getNumAlgoFromPeerDid(did)\n\n if (!isValidPeerDid(did)) {\n throw new CredoError(`Invalid peer did '${did}'`)\n }\n\n if (numAlgo !== PeerDidNumAlgo.InceptionKeyWithoutDoc) {\n throw new CredoError(`Invalid numAlgo ${numAlgo}, expected ${PeerDidNumAlgo.InceptionKeyWithoutDoc}`)\n }\n\n const publicJwk = PublicJwk.fromFingerprint(parsed.id.substring(1))\n\n return getDidDocumentForPublicJwk(did, publicJwk)\n}\n"],"mappings":";;;;;;;;;;;AAOA,SAAgB,+BAA+B,WAAsB;AAGnE,QAAO,2BAFK,aAAa,UAAU,eAEI,UAAU;;AAGnD,SAAgB,yBAAyB,KAAa;CACpD,MAAM,SAAS,SAAS,IAAI;CAC5B,MAAM,UAAU,sBAAsB,IAAI;AAE1C,KAAI,CAAC,eAAe,IAAI,CACtB,OAAM,IAAI,WAAW,qBAAqB,IAAI,GAAG;AAGnD,KAAI,YAAY,eAAe,uBAC7B,OAAM,IAAI,WAAW,mBAAmB,QAAQ,aAAa,eAAe,yBAAyB;AAKvG,QAAO,2BAA2B,KAFhB,UAAU,gBAAgB,OAAO,GAAG,UAAU,EAAE,CAAC,CAElB"}
1
+ {"version":3,"file":"peerDidNumAlgo0.mjs","names":[],"sources":["../../../../../src/modules/dids/methods/peer/peerDidNumAlgo0.ts"],"sourcesContent":["import { CredoError } from '../../../../error'\nimport { PublicJwk } from '../../../kms'\nimport { getDidDocumentForPublicJwk } from '../../domain/keyDidDocument'\nimport { parseDid } from '../../domain/parse'\n\nimport { getNumAlgoFromPeerDid, isValidPeerDid, PeerDidNumAlgo } from './didPeer'\n\nexport function publicJwkToNumAlgo0DidDocument(publicJwk: PublicJwk) {\n const did = `did:peer:0${publicJwk.fingerprint}`\n\n return getDidDocumentForPublicJwk(did, publicJwk)\n}\n\nexport function didToNumAlgo0DidDocument(did: string) {\n const parsed = parseDid(did)\n const numAlgo = getNumAlgoFromPeerDid(did)\n\n if (!isValidPeerDid(did)) {\n throw new CredoError(`Invalid peer did '${did}'`)\n }\n\n if (numAlgo !== PeerDidNumAlgo.InceptionKeyWithoutDoc) {\n throw new CredoError(`Invalid numAlgo ${numAlgo}, expected ${PeerDidNumAlgo.InceptionKeyWithoutDoc}`)\n }\n\n const publicJwk = PublicJwk.fromFingerprint(parsed.id.substring(1))\n\n return getDidDocumentForPublicJwk(did, publicJwk)\n}\n"],"mappings":";;;;;;;;;;;AAOA,SAAgB,+BAA+B,WAAsB;AAGnE,QAAO,2BAFK,aAAa,UAAU,eAEI,UAAU;;AAGnD,SAAgB,yBAAyB,KAAa;CACpD,MAAM,SAAS,SAAS,IAAI;CAC5B,MAAM,UAAU,sBAAsB,IAAI;AAE1C,KAAI,CAAC,eAAe,IAAI,CACtB,OAAM,IAAI,WAAW,qBAAqB,IAAI,GAAG;AAGnD,KAAI,YAAY,eAAe,uBAC7B,OAAM,IAAI,WAAW,mBAAmB,QAAQ,aAAa,eAAe,yBAAyB;AAKvG,QAAO,2BAA2B,KAFhB,UAAU,gBAAgB,OAAO,GAAG,UAAU,EAAE,CAAC,CAElB"}
@@ -1,8 +1,8 @@
1
1
 
2
2
 
3
- const require_JsonEncoder = require('../../../../utils/JsonEncoder.js');
4
3
  const require_MultiBaseEncoder = require('../../../../utils/MultiBaseEncoder.js');
5
4
  const require_MultiHashEncoder = require('../../../../utils/MultiHashEncoder.js');
5
+ const require_JsonEncoder = require('../../../../utils/JsonEncoder.js');
6
6
  require('../../../../utils/index.js');
7
7
 
8
8
  //#region src/modules/dids/methods/peer/peerDidNumAlgo1.ts
@@ -1,8 +1,8 @@
1
1
 
2
2
 
3
- import { JsonEncoder } from "../../../../utils/JsonEncoder.mjs";
4
3
  import { MultiBaseEncoder } from "../../../../utils/MultiBaseEncoder.mjs";
5
4
  import { MultiHashEncoder } from "../../../../utils/MultiHashEncoder.mjs";
5
+ import { JsonEncoder } from "../../../../utils/JsonEncoder.mjs";
6
6
  import "../../../../utils/index.mjs";
7
7
 
8
8
  //#region src/modules/dids/methods/peer/peerDidNumAlgo1.ts