@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 +1 @@
1
- {"version":3,"file":"nameConversion.d.ts","names":[],"sources":["../../../../src/modules/x509/utils/nameConversion.ts"],"sourcesContent":[],"mappings":";;;cAIa,6BAA8B"}
1
+ {"version":3,"file":"nameConversion.d.ts","names":[],"sources":["../../../../src/modules/x509/utils/nameConversion.ts"],"sourcesContent":[],"mappings":";;;cAGa,6BAA8B"}
@@ -1 +1 @@
1
- {"version":3,"file":"nameConversion.mjs","names":[],"sources":["../../../../src/modules/x509/utils/nameConversion.ts"],"sourcesContent":["import type { X509CertificateIssuerAndSubjectOptions } from '../X509ServiceOptions'\n\nimport { X509Error } from '../X509Error'\n\nexport const convertName = (name: string | X509CertificateIssuerAndSubjectOptions) => {\n if (typeof name === 'string') return name\n\n let nameBuilder = ''\n\n if (name.commonName) nameBuilder = nameBuilder.concat(`CN=${name.commonName}, `)\n if (name.countryName) nameBuilder = nameBuilder.concat(`C=${name.countryName}, `)\n if (name.organizationalUnit) nameBuilder = nameBuilder.concat(`OU=${name.organizationalUnit}, `)\n if (name.stateOrProvinceName) nameBuilder = nameBuilder.concat(`S=${name.stateOrProvinceName}, `)\n\n if (nameBuilder.length === 0) {\n throw new X509Error('Provided name object has no entries. Could not generate an issuer/subject name')\n }\n\n // Remove the trailing `, `\n return nameBuilder.slice(0, nameBuilder.length - 2)\n}\n"],"mappings":";;;;;AAIA,MAAa,eAAe,SAA0D;AACpF,KAAI,OAAO,SAAS,SAAU,QAAO;CAErC,IAAI,cAAc;AAElB,KAAI,KAAK,WAAY,eAAc,YAAY,OAAO,MAAM,KAAK,WAAW,IAAI;AAChF,KAAI,KAAK,YAAa,eAAc,YAAY,OAAO,KAAK,KAAK,YAAY,IAAI;AACjF,KAAI,KAAK,mBAAoB,eAAc,YAAY,OAAO,MAAM,KAAK,mBAAmB,IAAI;AAChG,KAAI,KAAK,oBAAqB,eAAc,YAAY,OAAO,KAAK,KAAK,oBAAoB,IAAI;AAEjG,KAAI,YAAY,WAAW,EACzB,OAAM,IAAI,UAAU,iFAAiF;AAIvG,QAAO,YAAY,MAAM,GAAG,YAAY,SAAS,EAAE"}
1
+ {"version":3,"file":"nameConversion.mjs","names":[],"sources":["../../../../src/modules/x509/utils/nameConversion.ts"],"sourcesContent":["import { X509Error } from '../X509Error'\nimport type { X509CertificateIssuerAndSubjectOptions } from '../X509ServiceOptions'\n\nexport const convertName = (name: string | X509CertificateIssuerAndSubjectOptions) => {\n if (typeof name === 'string') return name\n\n let nameBuilder = ''\n\n if (name.commonName) nameBuilder = nameBuilder.concat(`CN=${name.commonName}, `)\n if (name.countryName) nameBuilder = nameBuilder.concat(`C=${name.countryName}, `)\n if (name.organizationalUnit) nameBuilder = nameBuilder.concat(`OU=${name.organizationalUnit}, `)\n if (name.stateOrProvinceName) nameBuilder = nameBuilder.concat(`S=${name.stateOrProvinceName}, `)\n\n if (nameBuilder.length === 0) {\n throw new X509Error('Provided name object has no entries. Could not generate an issuer/subject name')\n }\n\n // Remove the trailing `, `\n return nameBuilder.slice(0, nameBuilder.length - 2)\n}\n"],"mappings":";;;;;AAGA,MAAa,eAAe,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AA,CAAA,KAAA,EAfpB,cAeoB,CAfL,CAeK,CAAA,CAAA,EAfA,CAeA;kBAAyC,CAAA,CAAA,CAAA,CAAA,KAAA,EAXpD,cAWoD,CAXrC,CAWqC,CAAA,EAAA,QAAA,EAXvB,CAWuB,CAAA,EAAA,IAAA;cAAZ,CAAA,CAAA,CAAA,CAAA,KAAA,EAP5C,cAO4C,CAP7B,CAO6B,CAAA,EAAA,SAAA,CAAA,EAAA,OAAA,CAAA,EAAA,OAAA;uBAWxD,CAAA,IAAA,GAAA,CAAA,CAAA,KAAA,EAb2B,WAa3B,CAbuC,CAavC,CAAA,CAAA,EAAA,IAAA;EAAA,qBAAA,CAAA,IAAA,GAAA,CAAA,CAAA,KAAA,EAX2B,cAW3B,CAX0C,CAW1C,CAAA,EAAA,QAAA,EAXwD,WAWxD,CAXoE,CAWpE,CAAA,CAAA,EAAA,IAAA;;;;iBAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"DependencyManager.mjs","names":["rootContainer","container"],"sources":["../../src/plugins/DependencyManager.ts"],"sourcesContent":["import type { DependencyContainer } from 'tsyringe'\nimport type { AgentContext } from '../agent'\nimport type { ModulesMap } from '../agent/AgentModules'\nimport type { Constructor } from '../utils/mixins'\n\nimport { type InjectionToken, Lifecycle, container as rootContainer } from 'tsyringe'\n\nimport { CredoError } from '../error'\n\nexport type { InjectionToken }\n\nexport class DependencyManager {\n public readonly container: DependencyContainer\n public readonly registeredModules: ModulesMap\n\n /**\n * @internal\n */\n public constructor(\n container: DependencyContainer = rootContainer.createChildContainer(),\n registeredModules: ModulesMap = {}\n ) {\n this.container = container\n this.registeredModules = registeredModules\n }\n\n /**\n * @internal\n */\n public registerModules(modules: ModulesMap) {\n for (const [moduleKey, module] of Object.entries(modules)) {\n if (this.registeredModules[moduleKey]) {\n throw new CredoError(\n `Module with key ${moduleKey} has already been registered. Only a single module can be registered with the same key.`\n )\n }\n\n this.registeredModules[moduleKey] = module\n if (module.api) {\n this.registerContextScoped(module.api)\n }\n try {\n module.register(this)\n } catch (error) {\n throw new CredoError(`Cannot register ${moduleKey}: ${error}`)\n }\n }\n }\n\n /**\n * @internal\n */\n public async initializeModules(agentContext: AgentContext) {\n if (agentContext.dependencyManager.container !== this.container) {\n throw new CredoError(\n `Method 'initializeModule' called on DependencyManager different from the agent context for which 'initializeModule' is called. Make sure to call 'initializeModule' on the DependencyManager associated with the agent context.`\n )\n }\n\n for (const [moduleName, module] of Object.entries(this.registeredModules)) {\n try {\n await module.initialize?.(agentContext)\n } catch (error) {\n throw new CredoError(\n `Error during call to 'initialize' method in module '${moduleName}' for agent context '${agentContext.contextCorrelationId}'.`,\n { cause: error }\n )\n }\n }\n }\n\n /**\n * @internal\n */\n public async shutdownModules(agentContext: AgentContext) {\n if (agentContext.dependencyManager.container !== this.container) {\n throw new CredoError(\n `Method 'shutdownModules' called on DependencyManager different from the agent context for which 'shutdownModules' is called. Make sure to call 'shutdownModules' on the DependencyManager associated with the agent context.`\n )\n }\n\n for (const [moduleName, module] of Object.entries(this.registeredModules)) {\n try {\n await module.shutdown?.(agentContext)\n } catch (error) {\n throw new CredoError(\n `Error during call to 'shutdown' method in module '${moduleName}' for agent context '${agentContext.contextCorrelationId}'.`,\n { cause: error }\n )\n }\n }\n }\n\n /**\n * @internal\n */\n public async initializeAgentContext(agentContext: AgentContext) {\n if (agentContext.dependencyManager.container !== this.container) {\n throw new CredoError(\n `Method 'initializeAgentContext' called on DependencyManager different from the agent context for which 'initializeAgentContext' is called. Make sure to call 'initializeAgentContext' on the DependencyManager associated with the agent context.`\n )\n }\n\n for (const [moduleName, module] of Object.entries(this.registeredModules)) {\n try {\n await module.onInitializeContext?.(agentContext)\n } catch (error) {\n throw new CredoError(\n `Error during call to 'onInitializeContext' method in module '${moduleName}' for agent context '${agentContext.contextCorrelationId}'.`,\n { cause: error }\n )\n }\n }\n }\n\n /**\n * @internal\n */\n public async deleteAgentContext(agentContext: AgentContext) {\n if (agentContext.dependencyManager.container !== this.container) {\n throw new CredoError(\n `Method 'deleteAgentContext' called on DependencyManager different from the agent context for which 'deleteAgentContext' is called. Make sure to call 'deleteAgentContext' on the DependencyManager associated with the agent context.`\n )\n }\n\n try {\n for (const [moduleName, module] of Object.entries(this.registeredModules)) {\n try {\n await module.onDeleteContext?.(agentContext)\n } catch (error) {\n throw new CredoError(\n `Error during call to 'onDeleteContext' method in module '${moduleName}' for agent context '${agentContext.contextCorrelationId}'.`,\n { cause: error }\n )\n }\n }\n } finally {\n await this.container.dispose()\n }\n }\n\n /**\n * @internal\n */\n public async provisionAgentContext(agentContext: AgentContext) {\n if (agentContext.dependencyManager.container !== this.container) {\n throw new CredoError(\n `Method 'provisionAgentContext' called on DependencyManager different from the agent context for which 'provisionAgentContext' is called. Make sure to call 'provisionAgentContext' on the DependencyManager associated with the agent context.`\n )\n }\n\n for (const [moduleName, module] of Object.entries(this.registeredModules)) {\n try {\n await module.onProvisionContext?.(agentContext)\n } catch (error) {\n throw new CredoError(\n `Error during call to 'onProvisionContext' method in module '${moduleName}' for agent context '${agentContext.contextCorrelationId}'.`,\n { cause: error }\n )\n }\n }\n\n return agentContext\n }\n\n /**\n * @internal\n */\n public async closeAgentContext(agentContext: AgentContext) {\n if (agentContext.dependencyManager.container !== this.container) {\n throw new CredoError(\n `Method 'closeAgentContext' called on DependencyManager different from the agent context for which 'closeAgentContext' is called. Make sure to call 'closeAgentContext' on the DependencyManager associated with the agent context.`\n )\n }\n\n try {\n for (const [moduleName, module] of Object.entries(this.registeredModules)) {\n try {\n await module.onCloseContext?.(agentContext)\n } catch (error) {\n throw new CredoError(\n `Error during call to 'onCloseContext' method in module '${moduleName}' for agent context '${agentContext.contextCorrelationId}'.`,\n { cause: error }\n )\n }\n }\n } finally {\n // NOTE: we support reinitialization of the root agent so we can't dispose of the agent context\n if (!agentContext.isRootAgentContext) {\n await this.container.dispose()\n }\n }\n }\n\n public registerSingleton<T>(from: InjectionToken<T>, to: InjectionToken<T>): void\n public registerSingleton<T>(token: Constructor<T>): void\n // biome-ignore lint/suspicious/noExplicitAny: <explanation>\n public registerSingleton<T = any>(fromOrToken: InjectionToken<T> | Constructor<T>, to?: any) {\n this.container.registerSingleton(fromOrToken, to)\n }\n\n public resolve<T>(token: InjectionToken<T>): T {\n return this.container.resolve(token)\n }\n\n public registerInstance<T>(token: InjectionToken<T>, instance: T) {\n this.container.registerInstance(token, instance)\n }\n\n public isRegistered<T>(token: InjectionToken<T>, recursive = false): boolean {\n return this.container.isRegistered(token, recursive)\n }\n\n // biome-ignore lint/suspicious/noExplicitAny: <explanation>\n public registerContextScoped<T = any>(token: Constructor<T>): void\n // biome-ignore lint/suspicious/noExplicitAny: <explanation>\n public registerContextScoped<T = any>(token: InjectionToken<T>, provider: Constructor<T>): void\n\n // biome-ignore lint/suspicious/noExplicitAny: <explanation>\n public registerContextScoped(token: any, provider?: any) {\n if (provider) this.container.register(token, provider, { lifecycle: Lifecycle.ContainerScoped })\n else this.container.register(token, token, { lifecycle: Lifecycle.ContainerScoped })\n }\n\n /**\n * @internal\n */\n public createChild() {\n return new DependencyManager(this.container.createChildContainer(), this.registeredModules)\n }\n}\n"],"mappings":";;;;;;;AAWA,IAAa,oBAAb,MAAa,kBAAkB;;;;CAO7B,AAAO,YACL,cAAiCA,UAAc,sBAAsB,EACrE,oBAAgC,EAAE,EAClC;AACA,OAAK,YAAYC;AACjB,OAAK,oBAAoB;;;;;CAM3B,AAAO,gBAAgB,SAAqB;AAC1C,OAAK,MAAM,CAAC,WAAW,WAAW,OAAO,QAAQ,QAAQ,EAAE;AACzD,OAAI,KAAK,kBAAkB,WACzB,OAAM,IAAI,WACR,mBAAmB,UAAU,yFAC9B;AAGH,QAAK,kBAAkB,aAAa;AACpC,OAAI,OAAO,IACT,MAAK,sBAAsB,OAAO,IAAI;AAExC,OAAI;AACF,WAAO,SAAS,KAAK;YACd,OAAO;AACd,UAAM,IAAI,WAAW,mBAAmB,UAAU,IAAI,QAAQ;;;;;;;CAQpE,MAAa,kBAAkB,cAA4B;AAC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c;AACnB,SAAO,IAAI,kBAAkB,KAAK,UAAU,sBAAsB,EAAE,KAAK,kBAAkB"}
1
+ {"version":3,"file":"DependencyManager.mjs","names":["rootContainer","container"],"sources":["../../src/plugins/DependencyManager.ts"],"sourcesContent":["import type { DependencyContainer } from 'tsyringe'\nimport { type InjectionToken, Lifecycle, container as rootContainer } from 'tsyringe'\nimport type { AgentContext } from '../agent'\nimport type { ModulesMap } from '../agent/AgentModules'\nimport { CredoError } from '../error'\nimport type { Constructor } from '../utils/mixins'\n\nexport type { InjectionToken }\n\nexport class DependencyManager {\n public readonly container: DependencyContainer\n public readonly registeredModules: ModulesMap\n\n /**\n * @internal\n */\n public constructor(\n container: DependencyContainer = rootContainer.createChildContainer(),\n registeredModules: ModulesMap = {}\n ) {\n this.container = container\n this.registeredModules = registeredModules\n }\n\n /**\n * @internal\n */\n public registerModules(modules: ModulesMap) {\n for (const [moduleKey, module] of Object.entries(modules)) {\n if (this.registeredModules[moduleKey]) {\n throw new CredoError(\n `Module with key ${moduleKey} has already been registered. Only a single module can be registered with the same key.`\n )\n }\n\n this.registeredModules[moduleKey] = module\n if (module.api) {\n this.registerContextScoped(module.api)\n }\n try {\n module.register(this)\n } catch (error) {\n throw new CredoError(`Cannot register ${moduleKey}: ${error}`)\n }\n }\n }\n\n /**\n * @internal\n */\n public async initializeModules(agentContext: AgentContext) {\n if (agentContext.dependencyManager.container !== this.container) {\n throw new CredoError(\n `Method 'initializeModule' called on DependencyManager different from the agent context for which 'initializeModule' is called. Make sure to call 'initializeModule' on the DependencyManager associated with the agent context.`\n )\n }\n\n for (const [moduleName, module] of Object.entries(this.registeredModules)) {\n try {\n await module.initialize?.(agentContext)\n } catch (error) {\n throw new CredoError(\n `Error during call to 'initialize' method in module '${moduleName}' for agent context '${agentContext.contextCorrelationId}'.`,\n { cause: error }\n )\n }\n }\n }\n\n /**\n * @internal\n */\n public async shutdownModules(agentContext: AgentContext) {\n if (agentContext.dependencyManager.container !== this.container) {\n throw new CredoError(\n `Method 'shutdownModules' called on DependencyManager different from the agent context for which 'shutdownModules' is called. Make sure to call 'shutdownModules' on the DependencyManager associated with the agent context.`\n )\n }\n\n for (const [moduleName, module] of Object.entries(this.registeredModules)) {\n try {\n await module.shutdown?.(agentContext)\n } catch (error) {\n throw new CredoError(\n `Error during call to 'shutdown' method in module '${moduleName}' for agent context '${agentContext.contextCorrelationId}'.`,\n { cause: error }\n )\n }\n }\n }\n\n /**\n * @internal\n */\n public async initializeAgentContext(agentContext: AgentContext) {\n if (agentContext.dependencyManager.container !== this.container) {\n throw new CredoError(\n `Method 'initializeAgentContext' called on DependencyManager different from the agent context for which 'initializeAgentContext' is called. Make sure to call 'initializeAgentContext' on the DependencyManager associated with the agent context.`\n )\n }\n\n for (const [moduleName, module] of Object.entries(this.registeredModules)) {\n try {\n await module.onInitializeContext?.(agentContext)\n } catch (error) {\n throw new CredoError(\n `Error during call to 'onInitializeContext' method in module '${moduleName}' for agent context '${agentContext.contextCorrelationId}'.`,\n { cause: error }\n )\n }\n }\n }\n\n /**\n * @internal\n */\n public async deleteAgentContext(agentContext: AgentContext) {\n if (agentContext.dependencyManager.container !== this.container) {\n throw new CredoError(\n `Method 'deleteAgentContext' called on DependencyManager different from the agent context for which 'deleteAgentContext' is called. Make sure to call 'deleteAgentContext' on the DependencyManager associated with the agent context.`\n )\n }\n\n try {\n for (const [moduleName, module] of Object.entries(this.registeredModules)) {\n try {\n await module.onDeleteContext?.(agentContext)\n } catch (error) {\n throw new CredoError(\n `Error during call to 'onDeleteContext' method in module '${moduleName}' for agent context '${agentContext.contextCorrelationId}'.`,\n { cause: error }\n )\n }\n }\n } finally {\n await this.container.dispose()\n }\n }\n\n /**\n * @internal\n */\n public async provisionAgentContext(agentContext: AgentContext) {\n if (agentContext.dependencyManager.container !== this.container) {\n throw new CredoError(\n `Method 'provisionAgentContext' called on DependencyManager different from the agent context for which 'provisionAgentContext' is called. Make sure to call 'provisionAgentContext' on the DependencyManager associated with the agent context.`\n )\n }\n\n for (const [moduleName, module] of Object.entries(this.registeredModules)) {\n try {\n await module.onProvisionContext?.(agentContext)\n } catch (error) {\n throw new CredoError(\n `Error during call to 'onProvisionContext' method in module '${moduleName}' for agent context '${agentContext.contextCorrelationId}'.`,\n { cause: error }\n )\n }\n }\n\n return agentContext\n }\n\n /**\n * @internal\n */\n public async closeAgentContext(agentContext: AgentContext) {\n if (agentContext.dependencyManager.container !== this.container) {\n throw new CredoError(\n `Method 'closeAgentContext' called on DependencyManager different from the agent context for which 'closeAgentContext' is called. Make sure to call 'closeAgentContext' on the DependencyManager associated with the agent context.`\n )\n }\n\n try {\n for (const [moduleName, module] of Object.entries(this.registeredModules)) {\n try {\n await module.onCloseContext?.(agentContext)\n } catch (error) {\n throw new CredoError(\n `Error during call to 'onCloseContext' method in module '${moduleName}' for agent context '${agentContext.contextCorrelationId}'.`,\n { cause: error }\n )\n }\n }\n } finally {\n // NOTE: we support reinitialization of the root agent so we can't dispose of the agent context\n if (!agentContext.isRootAgentContext) {\n await this.container.dispose()\n }\n }\n }\n\n public registerSingleton<T>(from: InjectionToken<T>, to: InjectionToken<T>): void\n public registerSingleton<T>(token: Constructor<T>): void\n // biome-ignore lint/suspicious/noExplicitAny: no explanation\n public registerSingleton<T = any>(fromOrToken: InjectionToken<T> | Constructor<T>, to?: any) {\n this.container.registerSingleton(fromOrToken, to)\n }\n\n public resolve<T>(token: InjectionToken<T>): T {\n return this.container.resolve(token)\n }\n\n public registerInstance<T>(token: InjectionToken<T>, instance: T) {\n this.container.registerInstance(token, instance)\n }\n\n public isRegistered<T>(token: InjectionToken<T>, recursive = false): boolean {\n return this.container.isRegistered(token, recursive)\n }\n\n // biome-ignore lint/suspicious/noExplicitAny: no explanation\n public registerContextScoped<T = any>(token: Constructor<T>): void\n // biome-ignore lint/suspicious/noExplicitAny: no explanation\n public registerContextScoped<T = any>(token: InjectionToken<T>, provider: Constructor<T>): void\n\n // biome-ignore lint/suspicious/noExplicitAny: no explanation\n public registerContextScoped(token: any, provider?: any) {\n if (provider) this.container.register(token, provider, { lifecycle: Lifecycle.ContainerScoped })\n else this.container.register(token, token, { lifecycle: Lifecycle.ContainerScoped })\n }\n\n /**\n * @internal\n */\n public createChild() {\n return new DependencyManager(this.container.createChildContainer(), this.registeredModules)\n }\n}\n"],"mappings":";;;;;;;AASA,IAAa,oBAAb,MAAa,kBAAkB;;;;CAO7B,AAAO,YACL,cAAiCA,UAAc,sBAAsB,EACrE,oBAAgC,EAAE,EAClC;AACA,OAAK,YAAYC;AACjB,OAAK,oBAAoB;;;;;CAM3B,AAAO,gBAAgB,SAAqB;AAC1C,OAAK,MAAM,CAAC,WAAW,WAAW,OAAO,QAAQ,QAAQ,EAAE;AACzD,OAAI,KAAK,kBAAkB,WACzB,OAAM,IAAI,WACR,mBAAmB,UAAU,yFAC9B;AAGH,QAAK,kBAAkB,aAAa;AACpC,OAAI,OAAO,IACT,MAAK,sBAAsB,OAAO,IAAI;AAExC,OAAI;AACF,WAAO,SAAS,KAAK;YACd,OAAO;AACd,UAAM,IAAI,WAAW,mBAAmB,UAAU,IAAI,QAAQ;;;;;;;CAQpE,MAAa,kBAAkB,cAA4B;AACzD,MAAI,aAAa,kBAAkB,cAAc,KAAK,UACpD,OAAM,IAAI,WACR,kOACD;AAGH,OAAK,MAAM,CAAC,YAAY,WAAW,OAAO,QAAQ,KAAK,kBAAkB,CACvE,KAAI;AACF,SAAM,OAAO,aAAa,aAAa;WAChC,OAAO;AACd,SAAM,IAAI,WACR,uDAAuD,WAAW,uBAAuB,aAAa,qBAAqB,KAC3H,EAAE,OAAO,OAAO,CACjB;;;;;;CAQP,MAAa,gBAAgB,cAA4B;AACvD,MAAI,aAAa,kBAAkB,cAAc,KAAK,UACpD,OAAM,IAAI,WACR,+NACD;AAGH,OAAK,MAAM,CAAC,YAAY,WAAW,OAAO,QAAQ,KAAK,kBAAkB,CACvE,KAAI;AACF,SAAM,OAAO,WAAW,aAAa;WAC9B,OAAO;AACd,SAAM,IAAI,WACR,qD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CACvE,KAAI;AACF,UAAM,OAAO,iBAAiB,aAAa;YACpC,OAAO;AACd,UAAM,IAAI,WACR,2DAA2D,WAAW,uBAAuB,aAAa,qBAAqB,KAC/H,EAAE,OAAO,OAAO,CACjB;;YAGG;AAER,OAAI,CAAC,aAAa,mBAChB,OAAM,KAAK,UAAU,SAAS;;;CAQpC,AAAO,kBAA2B,aAAiD,IAAU;AAC3F,OAAK,UAAU,kBAAkB,aAAa,GAAG;;CAGnD,AAAO,QAAW,OAA6B;AAC7C,SAAO,KAAK,UAAU,QAAQ,MAAM;;CAGtC,AAAO,iBAAoB,OAA0B,UAAa;AAChE,OAAK,UAAU,iBAAiB,OAAO,SAAS;;CAGlD,AAAO,aAAgB,OAA0B,YAAY,OAAgB;AAC3E,SAAO,KAAK,UAAU,aAAa,OAAO,UAAU;;CAStD,AAAO,sBAAsB,OAAY,UAAgB;AACvD,MAAI,SAAU,MAAK,UAAU,SAAS,OAAO,UAAU,EAAE,WAAW,UAAU,iBAAiB,CAAC;MAC3F,MAAK,UAAU,SAAS,OAAO,OAAO,EAAE,WAAW,UAAU,iBAAiB,CAAC;;;;;CAMtF,AAAO,cAAc;AACnB,SAAO,IAAI,kBAAkB,KAAK,UAAU,sBAAsB,EAAE,KAAK,kBAAkB"}
@@ -1 +1 @@
1
- {"version":3,"file":"BaseRecord.mjs","names":[],"sources":["../../src/storage/BaseRecord.ts"],"sourcesContent":["import { Exclude } from 'class-transformer'\n\nimport { JsonTransformer } from '../utils/JsonTransformer'\nimport { DateTransformer, MetadataTransformer } from '../utils/transformers'\n\nimport { Metadata } from './Metadata'\n\nexport type TagValue = string | boolean | undefined | Array<string> | null\nexport type TagsBase = {\n [key: string]: TagValue\n [key: number]: never\n}\n\nexport type Tags<DefaultTags extends TagsBase, CustomTags extends TagsBase> = CustomTags & DefaultTags\n\nexport type RecordTags<Record extends BaseRecord> = ReturnType<Record['getTags']>\n\n// The BaseRecord requires a DefaultTags and CustomTags type, but we want to be\n// able to use the BaseRecord without specifying these types. If we don't specify\n// these types, the default TagsBase will be used, but this is not compatible\n// with records that have specified a custom type.\n// biome-ignore lint/suspicious/noExplicitAny: <explanation>\nexport type BaseRecordAny = BaseRecord<any, any, any>\n\nexport abstract class BaseRecord<\n DefaultTags extends TagsBase = TagsBase,\n CustomTags extends TagsBase = TagsBase,\n // We want an empty object, as Record<string, unknown> will make typescript\n // not infer the types correctly\n // biome-ignore lint/complexity/noBannedTypes: <explanation>\n MetadataValues = {},\n> {\n protected _tags: CustomTags & TagsBase = {} as CustomTags & TagsBase\n\n public id!: string\n\n @DateTransformer()\n public createdAt!: Date\n\n @DateTransformer()\n public updatedAt?: Date\n\n @Exclude()\n public readonly type = BaseRecord.type\n public static readonly type: string = 'BaseRecord'\n\n @Exclude()\n public readonly allowCache = BaseRecord.allowCache\n public static readonly allowCache: boolean = false\n\n /** @inheritdoc {Metadata#Metadata} */\n @MetadataTransformer()\n public metadata: Metadata<MetadataValues> = new Metadata({})\n\n /**\n * Get all tags. This is includes custom and default tags\n * @returns tags object\n */\n public abstract getTags(): Tags<DefaultTags, CustomTags>\n\n /**\n * Set the value for a tag\n * @param name name of the tag\n * @param value value of the tag\n */\n public setTag(name: keyof CustomTags | (string & {}), value: CustomTags[keyof CustomTags]) {\n this._tags[name] = value as (typeof this._tags)[string]\n }\n\n /**\n * Get the value for a tag\n * @param name name of the tag\n * @returns The tag value, or undefined if not found\n */\n public getTag(name: keyof CustomTags | keyof DefaultTags | (string & {})) {\n return this.getTags()[name]\n }\n\n /**\n * Set custom tags. This will merge the tags object with passed in tag properties\n *\n * @param tags the tags to set\n */\n public setTags(tags: Partial<CustomTags | TagsBase>) {\n this._tags = {\n ...this._tags,\n ...tags,\n } as typeof this._tags\n }\n\n /**\n * Replace tags. This will replace the whole tags object.\n * Default tags will still be overridden when retrieving tags\n *\n * @param tags the tags to set\n */\n public replaceTags(tags: CustomTags & Partial<TagsBase>) {\n this._tags = tags\n }\n\n public toJSON(): Record<string, unknown> {\n return JsonTransformer.toJSON(this)\n }\n\n /**\n * Clones the record.\n */\n public clone() {\n return JsonTransformer.clone(this)\n }\n}\n"],"mappings":";;;;;;;;;;;AAwBA,IAAsB,aAAtB,MAAsB,WAOpB;;OACU,QAA+B,EAAE;OAW3B,OAAO,WAAW;OAIlB,aAAa,WAAW;OAKjC,WAAqC,IAAI,SAAS,EAAE,CAAC;;;;;;;CAa5D,AAAO,OAAO,MAAwC,OAAqC;AACzF,OAAK,MAAM,QAAQ;;;;;;;CAQrB,AAAO,OAAO,MAA4D;AACxE,SAAO,KAAK,SAAS,CAAC;;;;;;;CAQxB,AAAO,QAAQ,MAAsC;AACnD,OAAK,QAAQ;GACX,GAAG,KAAK;GACR,GAAG;GACJ;;;;;;;;CASH,AAAO,YAAY,MAAsC;AACvD,OAAK,QAAQ;;CAGf,AAAO,SAAkC;AACvC,SAAO,gBAAgB,OAAO,KAAK;;;;;CAMrC,AAAO,QAAQ;AACb,SAAO,gBAAgB,MAAM,KAAK;;;WAhEb,OAAe;WAIf,aAAsB;YAZ5C,iBAAiB;YAGjB,iBAAiB;YAGjB,SAAS;YAIT,SAAS;YAKT,qBAAqB"}
1
+ {"version":3,"file":"BaseRecord.mjs","names":[],"sources":["../../src/storage/BaseRecord.ts"],"sourcesContent":["import { Exclude } from 'class-transformer'\n\nimport { JsonTransformer } from '../utils/JsonTransformer'\nimport { DateTransformer, MetadataTransformer } from '../utils/transformers'\n\nimport { Metadata } from './Metadata'\n\nexport type TagValue = string | boolean | undefined | Array<string> | null\nexport type TagsBase = {\n [key: string]: TagValue\n [key: number]: never\n}\n\nexport type Tags<DefaultTags extends TagsBase, CustomTags extends TagsBase> = CustomTags & DefaultTags\n\nexport type RecordTags<Record extends BaseRecord> = ReturnType<Record['getTags']>\n\n// The BaseRecord requires a DefaultTags and CustomTags type, but we want to be\n// able to use the BaseRecord without specifying these types. If we don't specify\n// these types, the default TagsBase will be used, but this is not compatible\n// with records that have specified a custom type.\n// biome-ignore lint/suspicious/noExplicitAny: no explanation\nexport type BaseRecordAny = BaseRecord<any, any, any>\n\nexport abstract class BaseRecord<\n DefaultTags extends TagsBase = TagsBase,\n CustomTags extends TagsBase = TagsBase,\n // We want an empty object, as Record<string, unknown> will make typescript\n // not infer the types correctly\n // biome-ignore lint/complexity/noBannedTypes: no explanation\n MetadataValues = {},\n> {\n protected _tags: CustomTags & TagsBase = {} as CustomTags & TagsBase\n\n public id!: string\n\n @DateTransformer()\n public createdAt!: Date\n\n @DateTransformer()\n public updatedAt?: Date\n\n @Exclude()\n public readonly type = BaseRecord.type\n public static readonly type: string = 'BaseRecord'\n\n @Exclude()\n public readonly allowCache = BaseRecord.allowCache\n public static readonly allowCache: boolean = false\n\n /** @inheritdoc {Metadata#Metadata} */\n @MetadataTransformer()\n public metadata: Metadata<MetadataValues> = new Metadata({})\n\n /**\n * Get all tags. This is includes custom and default tags\n * @returns tags object\n */\n public abstract getTags(): Tags<DefaultTags, CustomTags>\n\n /**\n * Set the value for a tag\n * @param name name of the tag\n * @param value value of the tag\n */\n public setTag(name: keyof CustomTags | (string & {}), value: CustomTags[keyof CustomTags]) {\n this._tags[name] = value as (typeof this._tags)[string]\n }\n\n /**\n * Get the value for a tag\n * @param name name of the tag\n * @returns The tag value, or undefined if not found\n */\n public getTag(name: keyof CustomTags | keyof DefaultTags | (string & {})) {\n return this.getTags()[name]\n }\n\n /**\n * Set custom tags. This will merge the tags object with passed in tag properties\n *\n * @param tags the tags to set\n */\n public setTags(tags: Partial<CustomTags | TagsBase>) {\n this._tags = {\n ...this._tags,\n ...tags,\n } as typeof this._tags\n }\n\n /**\n * Replace tags. This will replace the whole tags object.\n * Default tags will still be overridden when retrieving tags\n *\n * @param tags the tags to set\n */\n public replaceTags(tags: CustomTags & Partial<TagsBase>) {\n this._tags = tags\n }\n\n public toJSON(): Record<string, unknown> {\n return JsonTransformer.toJSON(this)\n }\n\n /**\n * Clones the record.\n */\n public clone() {\n return JsonTransformer.clone(this)\n }\n}\n"],"mappings":";;;;;;;;;;;AAwBA,IAAsB,aAAtB,MAAsB,WAOpB;;OACU,QAA+B,EAAE;OAW3B,OAAO,WAAW;OAIlB,aAAa,WAAW;OAKjC,WAAqC,IAAI,SAAS,EAAE,CAAC;;;;;;;CAa5D,AAAO,OAAO,MAAwC,OAAqC;AACzF,OAAK,MAAM,QAAQ;;;;;;;CAQrB,AAAO,OAAO,MAA4D;AACxE,SAAO,KAAK,SAAS,CAAC;;;;;;;CAQxB,AAAO,QAAQ,MAAsC;AACnD,OAAK,QAAQ;GACX,GAAG,KAAK;GACR,GAAG;GACJ;;;;;;;;CASH,AAAO,YAAY,MAAsC;AACvD,OAAK,QAAQ;;CAGf,AAAO,SAAkC;AACvC,SAAO,gBAAgB,OAAO,KAAK;;;;;CAMrC,AAAO,QAAQ;AACb,SAAO,gBAAgB,MAAM,KAAK;;;WAhEb,OAAe;WAIf,aAAsB;YAZ5C,iBAAiB;YAGjB,iBAAiB;YAGjB,SAAS;YAIT,SAAS;YAKT,qBAAqB"}
@@ -1 +1 @@
1
- {"version":3,"file":"Metadata.mjs","names":[],"sources":["../../src/storage/Metadata.ts"],"sourcesContent":["// Any is used to prevent frustrating TS errors if we just want to store arbitrary json data\n// biome-ignore lint/suspicious/noExplicitAny: <explanation>\ntype MetadataValue = Record<string, any>\n\nexport type MetadataBase = {\n [key: string]: MetadataValue\n}\n\n/**\n * Metadata access class to get, set (create and update), add (append to a record) and delete metadata on any record.\n *\n * set will override the previous value if it already exists\n *\n * note: To add persistence to these records, you have to update the record in the correct repository\n *\n * @example\n *\n * ```ts\n * connectionRecord.metadata.set('foo', { bar: 'baz' }) connectionRepository.update(connectionRecord)\n * ```\n */\nexport class Metadata<MetadataTypes> {\n public readonly data: MetadataBase\n\n public constructor(data: MetadataBase) {\n this.data = data\n }\n\n /**\n * Gets the value by key in the metadata\n *\n * Any extension of the `BaseRecord` can implement their own typed metadata\n *\n * @param key the key to retrieve the metadata by\n * @returns the value saved in the key value pair\n * @returns null when the key could not be found\n */\n public get<Value extends MetadataValue, Key extends string = string>(\n key: Key\n ): (Key extends keyof MetadataTypes ? MetadataTypes[Key] : Value) | null {\n return (this.data[key] as Key extends keyof MetadataTypes ? MetadataTypes[Key] : Value) ?? null\n }\n\n /**\n * Will set, or override, a key-value pair on the metadata\n *\n * @param key the key to set the metadata by\n * @param value the value to set in the metadata\n */\n public set<Value extends MetadataValue, Key extends string = string>(\n key: Key,\n value: Key extends keyof MetadataTypes ? MetadataTypes[Key] : Value\n ): void {\n this.data[key] = value as MetadataValue\n }\n\n /**\n * Adds a record to a metadata key\n *\n * @param key the key to add the metadata at\n * @param value the value to add in the metadata\n */\n public add<Value extends MetadataValue, Key extends string = string>(\n key: Key,\n value: Partial<Key extends keyof MetadataTypes ? MetadataTypes[Key] : Value>\n ): void {\n this.data[key] = {\n ...this.data[key],\n ...value,\n }\n }\n\n /**\n * Retrieves all the metadata for a record\n *\n * @returns all the metadata that exists on the record\n */\n public get keys(): string[] {\n return Object.keys(this.data)\n }\n\n /**\n * Will delete the key value pair in the metadata\n *\n * @param key the key to delete the data by\n */\n public delete<Key extends string = string>(key: Key): void {\n delete this.data[key]\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAqBA,IAAa,WAAb,MAAqC;CAGnC,AAAO,YAAY,MAAoB;AACrC,OAAK,OAAO;;;;;;;;;;;CAYd,AAAO,IACL,KACuE;AACvE,SAAQ,KAAK,KAAK,QAAyE;;;;;;;;CAS7F,AAAO,IACL,KACA,OACM;AACN,OAAK,KAAK,OAAO;;;;;;;;CASnB,AAAO,IACL,KACA,OACM;AACN,OAAK,KAAK,OAAO;GACf,GAAG,KAAK,KAAK;GACb,GAAG;GACJ;;;;;;;CAQH,IAAW,OAAiB;AAC1B,SAAO,OAAO,KAAK,KAAK,KAAK;;;;;;;CAQ/B,AAAO,OAAoC,KAAgB;AACzD,SAAO,KAAK,KAAK"}
1
+ {"version":3,"file":"Metadata.mjs","names":[],"sources":["../../src/storage/Metadata.ts"],"sourcesContent":["// Any is used to prevent frustrating TS errors if we just want to store arbitrary json data\n// biome-ignore lint/suspicious/noExplicitAny: no explanation\ntype MetadataValue = Record<string, any>\n\nexport type MetadataBase = {\n [key: string]: MetadataValue\n}\n\n/**\n * Metadata access class to get, set (create and update), add (append to a record) and delete metadata on any record.\n *\n * set will override the previous value if it already exists\n *\n * note: To add persistence to these records, you have to update the record in the correct repository\n *\n * @example\n *\n * ```ts\n * connectionRecord.metadata.set('foo', { bar: 'baz' }) connectionRepository.update(connectionRecord)\n * ```\n */\nexport class Metadata<MetadataTypes> {\n public readonly data: MetadataBase\n\n public constructor(data: MetadataBase) {\n this.data = data\n }\n\n /**\n * Gets the value by key in the metadata\n *\n * Any extension of the `BaseRecord` can implement their own typed metadata\n *\n * @param key the key to retrieve the metadata by\n * @returns the value saved in the key value pair\n * @returns null when the key could not be found\n */\n public get<Value extends MetadataValue, Key extends string = string>(\n key: Key\n ): (Key extends keyof MetadataTypes ? MetadataTypes[Key] : Value) | null {\n return (this.data[key] as Key extends keyof MetadataTypes ? MetadataTypes[Key] : Value) ?? null\n }\n\n /**\n * Will set, or override, a key-value pair on the metadata\n *\n * @param key the key to set the metadata by\n * @param value the value to set in the metadata\n */\n public set<Value extends MetadataValue, Key extends string = string>(\n key: Key,\n value: Key extends keyof MetadataTypes ? MetadataTypes[Key] : Value\n ): void {\n this.data[key] = value as MetadataValue\n }\n\n /**\n * Adds a record to a metadata key\n *\n * @param key the key to add the metadata at\n * @param value the value to add in the metadata\n */\n public add<Value extends MetadataValue, Key extends string = string>(\n key: Key,\n value: Partial<Key extends keyof MetadataTypes ? MetadataTypes[Key] : Value>\n ): void {\n this.data[key] = {\n ...this.data[key],\n ...value,\n }\n }\n\n /**\n * Retrieves all the metadata for a record\n *\n * @returns all the metadata that exists on the record\n */\n public get keys(): string[] {\n return Object.keys(this.data)\n }\n\n /**\n * Will delete the key value pair in the metadata\n *\n * @param key the key to delete the data by\n */\n public delete<Key extends string = string>(key: Key): void {\n delete this.data[key]\n }\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,EAAA,MAAA,EAqBqB,CArBrB,CAAA,EAqByB,OArBzB,CAAA,IAAA,CAAA;;QACjB,CAAA,YAAA,EAiCkB,YAjClB,EAAA,MAAA,EAiCwC,CAjCxC,CAAA,EAiC4C,OAjC5C,CAAA,IAAA,CAAA;;QAoBsC,CAAA,YAAA,EA0BpB,YA1BoB,EAAA,MAAA,EA0BE,CA1BF,CAAA,EA0BM,OA1BN,CAAA,IAAA,CAAA;;;;;;YA0BE,CAAA,YAAA,EAiBlB,YAjBkB,EAAA,EAAA,EAAA,MAAA,CAAA,EAiBS,OAjBT,CAAA,IAAA,CAAA;;SAiBlB,CAAA,YAAA,EAYH,YAZG,EAAA,EAAA,EAAA,MAAA,CAAA,EAYwB,OAZxB,CAYgC,CAZhC,CAAA;;;;;;UAqBiC,CAAA,YAAA,EAAnC,YAAmC,EAAA,EAAA,EAAA,MAAA,CAAA,EAAR,OAAQ,CAAA,CAAA,GAAA,IAAA,CAAA;;QAWrC,CAAA,YAAA,EAAA,YAAA,CAAA,EAAe,OAAf,CAAuB,CAAvB,EAAA,CAAA;;aAAe,CAAA,YAAA,EAKV,YALU,EAAA,KAAA,EAKW,KALX,CAKiB,CALjB,CAAA,EAAA,YAAA,CAAA,EAKoC,YALpC,CAAA,EAKmD,OALnD,CAK2D,CAL3D,EAAA,CAAA;;;;;;;;;mBAmBxC,CAAA,YAAA,EADO,YACP,EAAA,KAAA,EAAA,KAAA,CAAM,CAAN,CAAA,EAAA;IAAA;IAAA,EAAA;IACL,QAAA,CAAA,EAAA,MAAA;MACD,OAAQ,CAAA,CAAA,GAAA,IAAA,CAAA;;;;;;;;iCAsCiC,qBAAqB,MAAM,KAAK,QAAQ"}
@@ -1,7 +1,7 @@
1
1
 
2
2
 
3
- const require_RecordNotFoundError = require('../error/RecordNotFoundError.js');
4
3
  const require_RecordDuplicateError = require('../error/RecordDuplicateError.js');
4
+ const require_RecordNotFoundError = require('../error/RecordNotFoundError.js');
5
5
  require('../error/index.js');
6
6
  const require_JsonTransformer = require('../utils/JsonTransformer.js');
7
7
  require('../utils/index.js');
@@ -1,7 +1,7 @@
1
1
 
2
2
 
3
- import { RecordNotFoundError } from "../error/RecordNotFoundError.mjs";
4
3
  import { RecordDuplicateError } from "../error/RecordDuplicateError.mjs";
4
+ import { RecordNotFoundError } from "../error/RecordNotFoundError.mjs";
5
5
  import "../error/index.mjs";
6
6
  import { JsonTransformer } from "../utils/JsonTransformer.mjs";
7
7
  import "../utils/index.mjs";
@@ -1 +1 @@
1
- {"version":3,"file":"Repository.mjs","names":[],"sources":["../../src/storage/Repository.ts"],"sourcesContent":["import type { AgentContext } from '../agent'\nimport type { EventEmitter } from '../agent/EventEmitter'\nimport type { BaseRecord } from './BaseRecord'\nimport type { RecordDeletedEvent, RecordSavedEvent, RecordUpdatedEvent } from './RepositoryEvents'\nimport type { BaseRecordConstructor, Query, QueryOptions, StorageService } from './StorageService'\n\nimport { RecordDuplicateError, RecordNotFoundError } from '../error'\nimport { CacheModuleConfig } from '../modules/cache/CacheModuleConfig'\nimport { CachedStorageService } from '../modules/cache/CachedStorageService'\nimport { JsonTransformer } from '../utils'\nimport { RepositoryEventTypes } from './RepositoryEvents'\n\n// biome-ignore lint/suspicious/noExplicitAny: <explanation>\nexport class Repository<T extends BaseRecord<any, any, any>> {\n private storageService: StorageService<T>\n private recordClass: BaseRecordConstructor<T>\n private eventEmitter: EventEmitter\n\n public constructor(\n recordClass: BaseRecordConstructor<T>,\n storageService: StorageService<T>,\n eventEmitter: EventEmitter\n ) {\n this.recordClass = recordClass\n this.storageService = storageService\n this.eventEmitter = eventEmitter\n }\n\n private getStorageService(agentContext: AgentContext): StorageService<T> {\n try {\n if (agentContext.dependencyManager.isRegistered(CachedStorageService, true)) {\n return agentContext.resolve(CachedStorageService<T>)\n }\n\n return this.storageService\n } catch {\n return this.storageService\n }\n }\n\n /** @inheritDoc {StorageService#save} */\n public async save(agentContext: AgentContext, record: T): Promise<void> {\n await this.getStorageService(agentContext).save(agentContext, record)\n\n this.eventEmitter.emit<RecordSavedEvent<T>>(agentContext, {\n type: RepositoryEventTypes.RecordSaved,\n payload: {\n // Record in event should be static\n record: record.clone(),\n },\n })\n }\n\n /** @inheritDoc {StorageService#update} */\n public async update(agentContext: AgentContext, record: T): Promise<void> {\n await this.getStorageService(agentContext).update(agentContext, record)\n\n this.eventEmitter.emit<RecordUpdatedEvent<T>>(agentContext, {\n type: RepositoryEventTypes.RecordUpdated,\n payload: {\n // Record in event should be static\n record: record.clone(),\n },\n })\n }\n\n /** @inheritDoc {StorageService#delete} */\n public async delete(agentContext: AgentContext, record: T): Promise<void> {\n await this.getStorageService(agentContext).delete(agentContext, record)\n\n this.eventEmitter.emit<RecordDeletedEvent<T>>(agentContext, {\n type: RepositoryEventTypes.RecordDeleted,\n payload: {\n // Record in event should be static\n record: record.clone(),\n },\n })\n }\n\n /**\n * Delete record by id. Throws {RecordNotFoundError} if no record is found\n * @param id the id of the record to delete\n * @returns\n */\n public async deleteById(agentContext: AgentContext, id: string): Promise<void> {\n await this.getStorageService(agentContext).deleteById(agentContext, this.recordClass, id)\n\n this.eventEmitter.emit<RecordDeletedEvent<T>>(agentContext, {\n type: RepositoryEventTypes.RecordDeleted,\n payload: {\n record: { id, type: this.recordClass.type },\n },\n })\n }\n\n /** @inheritDoc {StorageService#getById} */\n public async getById(agentContext: AgentContext, id: string): Promise<T> {\n return this.getStorageService(agentContext).getById(agentContext, this.recordClass, id)\n }\n\n /**\n * Find record by id. Returns null if no record is found\n * @param id the id of the record to retrieve\n * @returns\n */\n public async findById(agentContext: AgentContext, id: string): Promise<T | null> {\n try {\n return await this.getStorageService(agentContext).getById(agentContext, this.recordClass, id)\n } catch (error) {\n if (error instanceof RecordNotFoundError) return null\n\n throw error\n }\n }\n\n /** @inheritDoc {StorageService#getAll} */\n public async getAll(agentContext: AgentContext): Promise<T[]> {\n return this.getStorageService(agentContext).getAll(agentContext, this.recordClass)\n }\n\n /** @inheritDoc {StorageService#findByQuery} */\n public async findByQuery(agentContext: AgentContext, query: Query<T>, queryOptions?: QueryOptions): Promise<T[]> {\n return this.getStorageService(agentContext).findByQuery(agentContext, this.recordClass, query, queryOptions)\n }\n\n /**\n * Find a single record by query. Returns null if not found.\n * @param query the query\n * @param cacheKey optional cache key to use for caching. By default query results are not cached, but if a cache key is provided\n * as well as the record allows caching and the agent has a cached storage service enabled it will use the cache.\n * @returns the record, or null if not found\n * @throws {RecordDuplicateError} if multiple records are found for the given query\n */\n public async findSingleByQuery(\n agentContext: AgentContext,\n query: Query<T>,\n { cacheKey }: { cacheKey?: string } = {}\n ): Promise<T | null> {\n const cache = agentContext.resolve(CacheModuleConfig)\n const useCacheStorage = cache.useCachedStorageService ?? false\n\n if (useCacheStorage && cacheKey) {\n const recordId = (await cache?.cache.get<string>(agentContext, cacheKey)) ?? null\n if (recordId !== null) {\n const recordJson = await cache?.cache.get<T>(agentContext, recordId)\n if (recordJson) return JsonTransformer.fromJSON(recordJson, this.recordClass)\n }\n }\n\n const records = await this.findByQuery(agentContext, query)\n if (records.length > 1) {\n throw new RecordDuplicateError(`Multiple records found for given query '${JSON.stringify(query)}'`, {\n recordType: this.recordClass.type,\n })\n }\n\n if (records.length < 1) {\n return null\n }\n\n if (useCacheStorage && cacheKey) {\n await cache?.cache.set(agentContext, cacheKey, records[0].id)\n await cache?.cache.set(agentContext, records[0].id, records[0].toJSON())\n }\n\n return records[0]\n }\n\n /**\n * Find a single record by query. Throws if not found\n * @param query the query\n * @returns the record\n * @throws {RecordDuplicateError} if multiple records are found for the given query\n * @throws {RecordNotFoundError} if no record is found for the given query\n */\n public async getSingleByQuery(agentContext: AgentContext, query: Query<T>): Promise<T> {\n const record = await this.findSingleByQuery(agentContext, query)\n\n if (!record) {\n throw new RecordNotFoundError(`No record found for given query '${JSON.stringify(query)}'`, {\n recordType: this.recordClass.type,\n })\n }\n\n return record\n }\n}\n"],"mappings":";;;;;;;;;;;;AAaA,IAAa,aAAb,MAA6D;CAK3D,AAAO,YACL,aACA,gB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,MAAI,CAAC,OACH,OAAM,IAAI,oBAAoB,oCAAoC,KAAK,UAAU,MAAM,CAAC,IAAI,EAC1F,YAAY,KAAK,YAAY,MAC9B,CAAC;AAGJ,SAAO"}
1
+ {"version":3,"file":"Repository.mjs","names":[],"sources":["../../src/storage/Repository.ts"],"sourcesContent":["import type { AgentContext } from '../agent'\nimport type { EventEmitter } from '../agent/EventEmitter'\nimport { RecordDuplicateError, RecordNotFoundError } from '../error'\nimport { CachedStorageService } from '../modules/cache/CachedStorageService'\nimport { CacheModuleConfig } from '../modules/cache/CacheModuleConfig'\nimport { JsonTransformer } from '../utils'\nimport type { BaseRecord } from './BaseRecord'\nimport type { RecordDeletedEvent, RecordSavedEvent, RecordUpdatedEvent } from './RepositoryEvents'\nimport { RepositoryEventTypes } from './RepositoryEvents'\nimport type { BaseRecordConstructor, Query, QueryOptions, StorageService } from './StorageService'\n\n// biome-ignore lint/suspicious/noExplicitAny: no explanation\nexport class Repository<T extends BaseRecord<any, any, any>> {\n private storageService: StorageService<T>\n private recordClass: BaseRecordConstructor<T>\n private eventEmitter: EventEmitter\n\n public constructor(\n recordClass: BaseRecordConstructor<T>,\n storageService: StorageService<T>,\n eventEmitter: EventEmitter\n ) {\n this.recordClass = recordClass\n this.storageService = storageService\n this.eventEmitter = eventEmitter\n }\n\n private getStorageService(agentContext: AgentContext): StorageService<T> {\n try {\n if (agentContext.dependencyManager.isRegistered(CachedStorageService, true)) {\n return agentContext.resolve(CachedStorageService<T>)\n }\n\n return this.storageService\n } catch {\n return this.storageService\n }\n }\n\n /** @inheritDoc {StorageService#save} */\n public async save(agentContext: AgentContext, record: T): Promise<void> {\n await this.getStorageService(agentContext).save(agentContext, record)\n\n this.eventEmitter.emit<RecordSavedEvent<T>>(agentContext, {\n type: RepositoryEventTypes.RecordSaved,\n payload: {\n // Record in event should be static\n record: record.clone(),\n },\n })\n }\n\n /** @inheritDoc {StorageService#update} */\n public async update(agentContext: AgentContext, record: T): Promise<void> {\n await this.getStorageService(agentContext).update(agentContext, record)\n\n this.eventEmitter.emit<RecordUpdatedEvent<T>>(agentContext, {\n type: RepositoryEventTypes.RecordUpdated,\n payload: {\n // Record in event should be static\n record: record.clone(),\n },\n })\n }\n\n /** @inheritDoc {StorageService#delete} */\n public async delete(agentContext: AgentContext, record: T): Promise<void> {\n await this.getStorageService(agentContext).delete(agentContext, record)\n\n this.eventEmitter.emit<RecordDeletedEvent<T>>(agentContext, {\n type: RepositoryEventTypes.RecordDeleted,\n payload: {\n // Record in event should be static\n record: record.clone(),\n },\n })\n }\n\n /**\n * Delete record by id. Throws {RecordNotFoundError} if no record is found\n * @param id the id of the record to delete\n * @returns\n */\n public async deleteById(agentContext: AgentContext, id: string): Promise<void> {\n await this.getStorageService(agentContext).deleteById(agentContext, this.recordClass, id)\n\n this.eventEmitter.emit<RecordDeletedEvent<T>>(agentContext, {\n type: RepositoryEventTypes.RecordDeleted,\n payload: {\n record: { id, type: this.recordClass.type },\n },\n })\n }\n\n /** @inheritDoc {StorageService#getById} */\n public async getById(agentContext: AgentContext, id: string): Promise<T> {\n return this.getStorageService(agentContext).getById(agentContext, this.recordClass, id)\n }\n\n /**\n * Find record by id. Returns null if no record is found\n * @param id the id of the record to retrieve\n * @returns\n */\n public async findById(agentContext: AgentContext, id: string): Promise<T | null> {\n try {\n return await this.getStorageService(agentContext).getById(agentContext, this.recordClass, id)\n } catch (error) {\n if (error instanceof RecordNotFoundError) return null\n\n throw error\n }\n }\n\n /** @inheritDoc {StorageService#getAll} */\n public async getAll(agentContext: AgentContext): Promise<T[]> {\n return this.getStorageService(agentContext).getAll(agentContext, this.recordClass)\n }\n\n /** @inheritDoc {StorageService#findByQuery} */\n public async findByQuery(agentContext: AgentContext, query: Query<T>, queryOptions?: QueryOptions): Promise<T[]> {\n return this.getStorageService(agentContext).findByQuery(agentContext, this.recordClass, query, queryOptions)\n }\n\n /**\n * Find a single record by query. Returns null if not found.\n * @param query the query\n * @param cacheKey optional cache key to use for caching. By default query results are not cached, but if a cache key is provided\n * as well as the record allows caching and the agent has a cached storage service enabled it will use the cache.\n * @returns the record, or null if not found\n * @throws {RecordDuplicateError} if multiple records are found for the given query\n */\n public async findSingleByQuery(\n agentContext: AgentContext,\n query: Query<T>,\n { cacheKey }: { cacheKey?: string } = {}\n ): Promise<T | null> {\n const cache = agentContext.resolve(CacheModuleConfig)\n const useCacheStorage = cache.useCachedStorageService ?? false\n\n if (useCacheStorage && cacheKey) {\n const recordId = (await cache?.cache.get<string>(agentContext, cacheKey)) ?? null\n if (recordId !== null) {\n const recordJson = await cache?.cache.get<T>(agentContext, recordId)\n if (recordJson) return JsonTransformer.fromJSON(recordJson, this.recordClass)\n }\n }\n\n const records = await this.findByQuery(agentContext, query)\n if (records.length > 1) {\n throw new RecordDuplicateError(`Multiple records found for given query '${JSON.stringify(query)}'`, {\n recordType: this.recordClass.type,\n })\n }\n\n if (records.length < 1) {\n return null\n }\n\n if (useCacheStorage && cacheKey) {\n await cache?.cache.set(agentContext, cacheKey, records[0].id)\n await cache?.cache.set(agentContext, records[0].id, records[0].toJSON())\n }\n\n return records[0]\n }\n\n /**\n * Find a single record by query. Throws if not found\n * @param query the query\n * @returns the record\n * @throws {RecordDuplicateError} if multiple records are found for the given query\n * @throws {RecordNotFoundError} if no record is found for the given query\n */\n public async getSingleByQuery(agentContext: AgentContext, query: Query<T>): Promise<T> {\n const record = await this.findSingleByQuery(agentContext, query)\n\n if (!record) {\n throw new RecordNotFoundError(`No record found for given query '${JSON.stringify(query)}'`, {\n recordType: this.recordClass.type,\n })\n }\n\n return record\n }\n}\n"],"mappings":";;;;;;;;;;;;AAYA,IAAa,aAAb,MAA6D;CAK3D,AAAO,YACL,aACA,gBACA,cACA;AACA,OAAK,cAAc;AACnB,OAAK,iBAAiB;AACtB,OAAK,eAAe;;CAGtB,AAAQ,kBAAkB,cAA+C;AACvE,MAAI;AACF,OAAI,aAAa,kBAAkB,aAAa,sBAAsB,KAAK,CACzE,QAAO,aAAa,QAAQ,qBAA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sources":["../../src/storage/RepositoryEvents.ts"],"sourcesContent":["import type { BaseEvent } from '../agent/Events'\nimport type { BaseRecord } from './BaseRecord'\n\nexport enum RepositoryEventTypes {\n RecordSaved = 'RecordSaved',\n RecordUpdated = 'RecordUpdated',\n RecordDeleted = 'RecordDeleted',\n}\n\n// biome-ignore lint/suspicious/noExplicitAny: <explanation>\nexport interface RecordSavedEvent<T extends BaseRecord<any, any, any>> extends BaseEvent {\n type: typeof RepositoryEventTypes.RecordSaved\n payload: {\n record: T\n }\n}\n\n// biome-ignore lint/suspicious/noExplicitAny: <explanation>\nexport interface RecordUpdatedEvent<T extends BaseRecord<any, any, any>> extends BaseEvent {\n type: typeof RepositoryEventTypes.RecordUpdated\n payload: {\n record: T\n }\n}\n\n// biome-ignore lint/suspicious/noExplicitAny: <explanation>\nexport interface RecordDeletedEvent<T extends BaseRecord<any, any, any>> extends BaseEvent {\n type: typeof RepositoryEventTypes.RecordDeleted\n payload: {\n record: T | { id: string; type: string }\n }\n}\n"],"mappings":";;;AAGA,IAAY,wEAAL;AACL;AACA;AACA"}
1
+ {"version":3,"file":"RepositoryEvents.mjs","names":[],"sources":["../../src/storage/RepositoryEvents.ts"],"sourcesContent":["import type { BaseEvent } from '../agent/Events'\nimport type { BaseRecord } from './BaseRecord'\n\nexport enum RepositoryEventTypes {\n RecordSaved = 'RecordSaved',\n RecordUpdated = 'RecordUpdated',\n RecordDeleted = 'RecordDeleted',\n}\n\n// biome-ignore lint/suspicious/noExplicitAny: no explanation\nexport interface RecordSavedEvent<T extends BaseRecord<any, any, any>> extends BaseEvent {\n type: typeof RepositoryEventTypes.RecordSaved\n payload: {\n record: T\n }\n}\n\n// biome-ignore lint/suspicious/noExplicitAny: no explanation\nexport interface RecordUpdatedEvent<T extends BaseRecord<any, any, any>> extends BaseEvent {\n type: typeof RepositoryEventTypes.RecordUpdated\n payload: {\n record: T\n }\n}\n\n// biome-ignore lint/suspicious/noExplicitAny: no explanation\nexport interface RecordDeletedEvent<T extends BaseRecord<any, any, any>> extends BaseEvent {\n type: typeof RepositoryEventTypes.RecordDeleted\n payload: {\n record: T | { id: string; type: string }\n }\n}\n"],"mappings":";;;AAGA,IAAY,wEAAL;AACL;AACA;AACA"}
@@ -1,5 +1,5 @@
1
- import { Constructor } from "../utils/mixins.mjs";
2
1
  import { BaseRecord, TagsBase } from "./BaseRecord.mjs";
2
+ import { Constructor } from "../utils/mixins.mjs";
3
3
  import { AgentContext } from "../agent/context/AgentContext.mjs";
4
4
 
5
5
  //#region src/storage/StorageService.d.ts
@@ -1,5 +1,5 @@
1
- import { Constructor } from "../utils/mixins.js";
2
1
  import { BaseRecord, TagsBase } from "./BaseRecord.js";
2
+ import { Constructor } from "../utils/mixins.js";
3
3
  import { AgentContext } from "../agent/context/AgentContext.js";
4
4
 
5
5
  //#region src/storage/StorageService.d.ts
@@ -1,8 +1,8 @@
1
1
 
2
2
 
3
+ const require_isUpToDate = require('./migration/isUpToDate.js');
3
4
  const require_StorageVersionRecord = require('./migration/repository/StorageVersionRecord.js');
4
5
  const require_StorageVersionRepository = require('./migration/repository/StorageVersionRepository.js');
5
- const require_isUpToDate = require('./migration/isUpToDate.js');
6
6
  const require_StorageUpdateService = require('./migration/StorageUpdateService.js');
7
7
  const require_UpdateAssistant = require('./migration/UpdateAssistant.js');
8
8
  require('./migration/index.js');
@@ -1,8 +1,8 @@
1
1
 
2
2
 
3
+ import { isStorageUpToDate } from "./migration/isUpToDate.mjs";
3
4
  import { StorageVersionRecord } from "./migration/repository/StorageVersionRecord.mjs";
4
5
  import { StorageVersionRepository } from "./migration/repository/StorageVersionRepository.mjs";
5
- import { isStorageUpToDate } from "./migration/isUpToDate.mjs";
6
6
  import { StorageUpdateService } from "./migration/StorageUpdateService.mjs";
7
7
  import { UpdateAssistant } from "./migration/UpdateAssistant.mjs";
8
8
  import "./migration/index.mjs";
@@ -1 +1 @@
1
- {"version":3,"file":"StorageUpdateService.d.mts","names":[],"sources":["../../../src/storage/migration/StorageUpdateService.ts"],"sourcesContent":[],"mappings":";;;;;;;;cAca,oBAAA;;;sBAKgC,kCACf;EANjB,UAAA,CAAA,YAAoB,EAYO,YAZP,EAAA,eAAA,CAAA,EAYuC,eAZvC,CAAA,EAYsD,OAZtD,CAAA,OAAA,CAAA;EAAA,uBAAA,CAAA,YAAA,EAiBoB,YAjBpB,CAAA,EAiBgC,OAjBhC,CAAA,OAAA,CAAA;0BAKY,CAAA,YAAA,EAqBS,YArBT,CAAA,EAqBwB,OArBxB,CAqBgC,aArBhC,CAAA;aACf,uBAAA,CAAA,CAAA,EAAA,KAAA;0BAMU,CAAA,YAAA,EAwBc,YAxBd,EAAA,cAAA,EAwB4C,aAxB5C,CAAA,EAwByD,OAxBzD,CAAA,IAAA,CAAA;;;;;;;yBAc6B,CAAA,YAAA,EAsChB,YAtCgB,CAAA,EAsCJ,OAtCI,CAsCJ,oBAtCI,CAAA"}
1
+ {"version":3,"file":"StorageUpdateService.d.mts","names":[],"sources":["../../../src/storage/migration/StorageUpdateService.ts"],"sourcesContent":[],"mappings":";;;;;;;;cAYa,oBAAA;;;sBAKgC,kCACf;EANjB,UAAA,CAAA,YAAoB,EAYO,YAZP,EAAA,eAAA,CAAA,EAYuC,eAZvC,CAAA,EAYsD,OAZtD,CAAA,OAAA,CAAA;EAAA,uBAAA,CAAA,YAAA,EAiBoB,YAjBpB,CAAA,EAiBgC,OAjBhC,CAAA,OAAA,CAAA;0BAKY,CAAA,YAAA,EAqBS,YArBT,CAAA,EAqBwB,OArBxB,CAqBgC,aArBhC,CAAA;aACf,uBAAA,CAAA,CAAA,EAAA,KAAA;0BAMU,CAAA,YAAA,EAwBc,YAxBd,EAAA,cAAA,EAwB4C,aAxB5C,CAAA,EAwByD,OAxBzD,CAAA,IAAA,CAAA;;;;;;;yBAc6B,CAAA,YAAA,EAsChB,YAtCgB,CAAA,EAsCJ,OAtCI,CAsCJ,oBAtCI,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"StorageUpdateService.d.ts","names":[],"sources":["../../../src/storage/migration/StorageUpdateService.ts"],"sourcesContent":[],"mappings":";;;;;;;;cAca,oBAAA;;EAAA,QAAA,wBAAoB;EAAA,WAAA,CAAA,MAAA,EAKY,MALZ,EAAA,wBAAA,EAMH,wBANG;YAKY,CAAA,YAAA,EAOL,YAPK,EAAA,eAAA,CAAA,EAO2B,eAP3B,CAAA,EAO0C,OAP1C,CAAA,OAAA,CAAA;yBACf,CAAA,YAAA,EAWuB,YAXvB,CAAA,EAWmC,OAXnC,CAAA,OAAA,CAAA;0BAMU,CAAA,YAAA,EAcc,YAdd,CAAA,EAc6B,OAd7B,CAcqC,aAdrC,CAAA;aAAgC,uBAAA,CAAA,CAAA,EAAA,KAAA;0BAAe,CAAA,YAAA,EAwBjC,YAxBiC,EAAA,cAAA,EAwBH,aAxBG,CAAA,EAwBU,OAxBV,CAAA,IAAA,CAAA;;;;;;;yBAwBH,CAAA,YAAA,EA4B/B,YA5B+B,CAAA,EA4BnB,OA5BmB,CA4BnB,oBA5BmB,CAAA"}
1
+ {"version":3,"file":"StorageUpdateService.d.ts","names":[],"sources":["../../../src/storage/migration/StorageUpdateService.ts"],"sourcesContent":[],"mappings":";;;;;;;;cAYa,oBAAA;;EAAA,QAAA,wBAAoB;EAAA,WAAA,CAAA,MAAA,EAKY,MALZ,EAAA,wBAAA,EAMH,wBANG;YAKY,CAAA,YAAA,EAOL,YAPK,EAAA,eAAA,CAAA,EAO2B,eAP3B,CAAA,EAO0C,OAP1C,CAAA,OAAA,CAAA;yBACf,CAAA,YAAA,EAWuB,YAXvB,CAAA,EAWmC,OAXnC,CAAA,OAAA,CAAA;0BAMU,CAAA,YAAA,EAcc,YAdd,CAAA,EAc6B,OAd7B,CAcqC,aAdrC,CAAA;aAAgC,uBAAA,CAAA,CAAA,EAAA,KAAA;0BAAe,CAAA,YAAA,EAwBjC,YAxBiC,EAAA,cAAA,EAwBH,aAxBG,CAAA,EAwBU,OAxBV,CAAA,IAAA,CAAA;;;;;;;yBAwBH,CAAA,YAAA,EA4B/B,YA5B+B,CAAA,EA4BnB,OA5BmB,CA4BnB,oBA5BmB,CAAA"}
@@ -7,9 +7,9 @@ const require_decorateMetadata = require('../../_virtual/_@oxc-project_runtime@0
7
7
  const require_decorate = require('../../_virtual/_@oxc-project_runtime@0.94.0/helpers/decorate.js');
8
8
  const require_decorateParam = require('../../_virtual/_@oxc-project_runtime@0.94.0/helpers/decorateParam.js');
9
9
  const require_updates = require('./updates.js');
10
+ const require_isUpToDate = require('./isUpToDate.js');
10
11
  const require_StorageVersionRecord = require('./repository/StorageVersionRecord.js');
11
12
  const require_StorageVersionRepository = require('./repository/StorageVersionRepository.js');
12
- const require_isUpToDate = require('./isUpToDate.js');
13
13
  let tsyringe = require("tsyringe");
14
14
  tsyringe = require_rolldown_runtime.__toESM(tsyringe);
15
15
 
@@ -6,9 +6,9 @@ import { __decorateMetadata } from "../../_virtual/_@oxc-project_runtime@0.94.0/
6
6
  import { __decorate } from "../../_virtual/_@oxc-project_runtime@0.94.0/helpers/decorate.mjs";
7
7
  import { __decorateParam } from "../../_virtual/_@oxc-project_runtime@0.94.0/helpers/decorateParam.mjs";
8
8
  import { CURRENT_FRAMEWORK_STORAGE_VERSION, INITIAL_STORAGE_VERSION } from "./updates.mjs";
9
+ import { isStorageUpToDate } from "./isUpToDate.mjs";
9
10
  import { StorageVersionRecord } from "./repository/StorageVersionRecord.mjs";
10
11
  import { StorageVersionRepository } from "./repository/StorageVersionRepository.mjs";
11
- import { isStorageUpToDate } from "./isUpToDate.mjs";
12
12
 
13
13
  //#region src/storage/migration/StorageUpdateService.ts
14
14
  var _ref;
@@ -1 +1 @@
1
- {"version":3,"file":"StorageUpdateService.mjs","names":["StorageUpdateService","logger: Logger"],"sources":["../../../src/storage/migration/StorageUpdateService.ts"],"sourcesContent":["import type { AgentContext } from '../../agent'\nimport type { VersionString } from '../../utils/version'\nimport type { UpdateToVersion } from './updates'\n\nimport { InjectionSymbols } from '../../constants'\nimport type { Logger } from '../../logger'\nimport { inject, injectable } from '../../plugins'\n\nimport { isStorageUpToDate } from './isUpToDate'\nimport { StorageVersionRecord } from './repository/StorageVersionRecord'\nimport { StorageVersionRepository } from './repository/StorageVersionRepository'\nimport { CURRENT_FRAMEWORK_STORAGE_VERSION, INITIAL_STORAGE_VERSION } from './updates'\n\n@injectable()\nexport class StorageUpdateService {\n private logger: Logger\n private storageVersionRepository: StorageVersionRepository\n\n public constructor(\n @inject(InjectionSymbols.Logger) logger: Logger,\n storageVersionRepository: StorageVersionRepository\n ) {\n this.logger = logger\n this.storageVersionRepository = storageVersionRepository\n }\n\n public async isUpToDate(agentContext: AgentContext, updateToVersion?: UpdateToVersion) {\n const currentStorageVersion = await this.getCurrentStorageVersion(agentContext)\n return isStorageUpToDate(currentStorageVersion, updateToVersion)\n }\n\n public async hasStorageVersionRecord(agentContext: AgentContext) {\n const storageVersionRecord = await this.storageVersionRepository.findById(\n agentContext,\n StorageVersionRecord.storageVersionRecordId\n )\n\n return storageVersionRecord !== null\n }\n\n public async getCurrentStorageVersion(agentContext: AgentContext): Promise<VersionString> {\n const storageVersionRecord = await this.getStorageVersionRecord(agentContext)\n\n return storageVersionRecord.storageVersion\n }\n\n public static get frameworkStorageVersion() {\n return CURRENT_FRAMEWORK_STORAGE_VERSION\n }\n\n public async setCurrentStorageVersion(agentContext: AgentContext, storageVersion: VersionString) {\n this.logger.debug(`Setting current agent storage version to ${storageVersion}`)\n const storageVersionRecord = await this.storageVersionRepository.findById(\n agentContext,\n StorageVersionRecord.storageVersionRecordId\n )\n\n if (!storageVersionRecord) {\n this.logger.trace('Storage upgrade record does not exist yet. Creating.')\n await this.storageVersionRepository.save(\n agentContext,\n new StorageVersionRecord({\n storageVersion,\n })\n )\n } else {\n this.logger.trace('Storage upgrade record already exists. Updating.')\n storageVersionRecord.storageVersion = storageVersion\n await this.storageVersionRepository.update(agentContext, storageVersionRecord)\n }\n }\n\n /**\n * Retrieve the update record, creating it if it doesn't exist already.\n *\n * The storageVersion will be set to the INITIAL_STORAGE_VERSION if it doesn't exist yet,\n * as we can assume the wallet was created before the update record existed\n */\n public async getStorageVersionRecord(agentContext: AgentContext) {\n let storageVersionRecord = await this.storageVersionRepository.findById(\n agentContext,\n StorageVersionRecord.storageVersionRecordId\n )\n\n if (!storageVersionRecord) {\n storageVersionRecord = new StorageVersionRecord({\n storageVersion: INITIAL_STORAGE_VERSION,\n })\n await this.storageVersionRepository.save(agentContext, storageVersionRecord)\n }\n\n return storageVersionRecord\n }\n}\n"],"mappings":";;;;;;;;;;;;;;AAcO,iCAAMA,uBAAqB;CAIhC,AAAO,YACL,AAAiCC,QACjC,0BACA;AACA,OAAK,SAAS;AACd,OAAK,2BAA2B;;CAGlC,MAAa,WAAW,cAA4B,iBAAmC;AAErF,SAAO,kBADuB,MAAM,KAAK,yBAAyB,aAAa,EAC/B,gBAAgB;;CAGlE,MAAa,wBAAwB,cAA4B;AAM/D,SAL6B,MAAM,KAAK,yBAAyB,SAC/D,cACA,qBAAqB,uBACtB,KAE+B;;CAGlC,MAAa,yBAAyB,cAAoD;AAGxF,UAF6B,MAAM,KAAK,wBAAwB,aAAa,EAEjD;;CAG9B,WAAkB,0BAA0B;AAC1C,SAAO;;CAGT,MAAa,yBAAyB,cAA4B,gBAA+B;AAC/F,OAAK,OAAO,MAAM,4CAA4C,iBAAiB;EAC/E,MAAM,uBAAuB,MAAM,KAAK,yBAAyB,SAC/D,cACA,qBAAqB,uBACtB;AAED,MAAI,CAAC,sBAAsB;AACzB,QAAK,OAAO,MAAM,uDAAuD;AACzE,SAAM,KAAK,yBAAyB,KAClC,cACA,IAAI,qBAAqB,EACvB,gBACD,CAAC,CACH;SACI;AACL,QAAK,OAAO,MAAM,mDAAmD;AACrE,wBAAqB,iBAAiB;AACtC,SAAM,KAAK,yBAAyB,OAAO,cAAc,qBAAqB;;;;;;;;;CAUlF,MAAa,wBAAwB,cAA4B;EAC/D,IAAI,uBAAuB,MAAM,KAAK,yBAAyB,SAC7D,cACA,qBAAqB,uBACtB;AAED,MAAI,CAAC,sBAAsB;AACzB,0BAAuB,IAAI,qBAAqB,EAC9C,gBAAgB,yBACjB,CAAC;AACF,SAAM,KAAK,yBAAyB,KAAK,cAAc,qBAAqB;;AAG9E,SAAO;;;;CA9EV,YAAY;oBAMR,OAAO,iBAAiB,OAAO"}
1
+ {"version":3,"file":"StorageUpdateService.mjs","names":["StorageUpdateService","logger: Logger"],"sources":["../../../src/storage/migration/StorageUpdateService.ts"],"sourcesContent":["import type { AgentContext } from '../../agent'\nimport { InjectionSymbols } from '../../constants'\nimport type { Logger } from '../../logger'\nimport { inject, injectable } from '../../plugins'\nimport type { VersionString } from '../../utils/version'\nimport { isStorageUpToDate } from './isUpToDate'\nimport { StorageVersionRecord } from './repository/StorageVersionRecord'\nimport { StorageVersionRepository } from './repository/StorageVersionRepository'\nimport type { UpdateToVersion } from './updates'\nimport { CURRENT_FRAMEWORK_STORAGE_VERSION, INITIAL_STORAGE_VERSION } from './updates'\n\n@injectable()\nexport class StorageUpdateService {\n private logger: Logger\n private storageVersionRepository: StorageVersionRepository\n\n public constructor(\n @inject(InjectionSymbols.Logger) logger: Logger,\n storageVersionRepository: StorageVersionRepository\n ) {\n this.logger = logger\n this.storageVersionRepository = storageVersionRepository\n }\n\n public async isUpToDate(agentContext: AgentContext, updateToVersion?: UpdateToVersion) {\n const currentStorageVersion = await this.getCurrentStorageVersion(agentContext)\n return isStorageUpToDate(currentStorageVersion, updateToVersion)\n }\n\n public async hasStorageVersionRecord(agentContext: AgentContext) {\n const storageVersionRecord = await this.storageVersionRepository.findById(\n agentContext,\n StorageVersionRecord.storageVersionRecordId\n )\n\n return storageVersionRecord !== null\n }\n\n public async getCurrentStorageVersion(agentContext: AgentContext): Promise<VersionString> {\n const storageVersionRecord = await this.getStorageVersionRecord(agentContext)\n\n return storageVersionRecord.storageVersion\n }\n\n public static get frameworkStorageVersion() {\n return CURRENT_FRAMEWORK_STORAGE_VERSION\n }\n\n public async setCurrentStorageVersion(agentContext: AgentContext, storageVersion: VersionString) {\n this.logger.debug(`Setting current agent storage version to ${storageVersion}`)\n const storageVersionRecord = await this.storageVersionRepository.findById(\n agentContext,\n StorageVersionRecord.storageVersionRecordId\n )\n\n if (!storageVersionRecord) {\n this.logger.trace('Storage upgrade record does not exist yet. Creating.')\n await this.storageVersionRepository.save(\n agentContext,\n new StorageVersionRecord({\n storageVersion,\n })\n )\n } else {\n this.logger.trace('Storage upgrade record already exists. Updating.')\n storageVersionRecord.storageVersion = storageVersion\n await this.storageVersionRepository.update(agentContext, storageVersionRecord)\n }\n }\n\n /**\n * Retrieve the update record, creating it if it doesn't exist already.\n *\n * The storageVersion will be set to the INITIAL_STORAGE_VERSION if it doesn't exist yet,\n * as we can assume the wallet was created before the update record existed\n */\n public async getStorageVersionRecord(agentContext: AgentContext) {\n let storageVersionRecord = await this.storageVersionRepository.findById(\n agentContext,\n StorageVersionRecord.storageVersionRecordId\n )\n\n if (!storageVersionRecord) {\n storageVersionRecord = new StorageVersionRecord({\n storageVersion: INITIAL_STORAGE_VERSION,\n })\n await this.storageVersionRepository.save(agentContext, storageVersionRecord)\n }\n\n return storageVersionRecord\n }\n}\n"],"mappings":";;;;;;;;;;;;;;AAYO,iCAAMA,uBAAqB;CAIhC,AAAO,YACL,AAAiCC,QACjC,0BACA;AACA,OAAK,SAAS;AACd,OAAK,2BAA2B;;CAGlC,MAAa,WAAW,cAA4B,iBAAmC;AAErF,SAAO,kBADuB,MAAM,KAAK,yBAAyB,aAAa,EAC/B,gBAAgB;;CAGlE,MAAa,wBAAwB,cAA4B;AAM/D,SAL6B,MAAM,KAAK,yBAAyB,SAC/D,cACA,qBAAqB,uBACtB,KAE+B;;CAGlC,MAAa,yBAAyB,cAAoD;AAGxF,UAF6B,MAAM,KAAK,wBAAwB,aAAa,EAEjD;;CAG9B,WAAkB,0BAA0B;AAC1C,SAAO;;CAGT,MAAa,yBAAyB,cAA4B,gBAA+B;AAC/F,OAAK,OAAO,MAAM,4CAA4C,iBAAiB;EAC/E,MAAM,uBAAuB,MAAM,KAAK,yBAAyB,SAC/D,cACA,qBAAqB,uBACtB;AAED,MAAI,CAAC,sBAAsB;AACzB,QAAK,OAAO,MAAM,uDAAuD;AACzE,SAAM,KAAK,yBAAyB,KAClC,cACA,IAAI,qBAAqB,EACvB,gBACD,CAAC,CACH;SACI;AACL,QAAK,OAAO,MAAM,mDAAmD;AACrE,wBAAqB,iBAAiB;AACtC,SAAM,KAAK,yBAAyB,OAAO,cAAc,qBAAqB;;;;;;;;;CAUlF,MAAa,wBAAwB,cAA4B;EAC/D,IAAI,uBAAuB,MAAM,KAAK,yBAAyB,SAC7D,cACA,qBAAqB,uBACtB;AAED,MAAI,CAAC,sBAAsB;AACzB,0BAAuB,IAAI,qBAAqB,EAC9C,gBAAgB,yBACjB,CAAC;AACF,SAAM,KAAK,yBAAyB,KAAK,cAAc,qBAAqB;;AAG9E,SAAO;;;;CA9EV,YAAY;oBAMR,OAAO,iBAAiB,OAAO"}
@@ -1,7 +1,7 @@
1
1
  import { BaseAgent } from "../../agent/BaseAgent.mjs";
2
2
  import { VersionString } from "../../utils/version.mjs";
3
- import { updateV0_3ToV0_3_1 } from "./updates/0.3-0.3.1/index.mjs";
4
3
  import { updateV0_3_1ToV0_4 } from "./updates/0.3.1-0.4/index.mjs";
4
+ import { updateV0_3ToV0_3_1 } from "./updates/0.3-0.3.1/index.mjs";
5
5
  import { updateV0_4ToV0_5 } from "./updates/0.4-0.5/index.mjs";
6
6
  import { UpdateConfig, UpdateToVersion } from "./updates.mjs";
7
7
 
@@ -1 +1 @@
1
- {"version":3,"file":"UpdateAssistant.d.mts","names":[],"sources":["../../../src/storage/migration/UpdateAssistant.ts"],"sourcesContent":[],"mappings":";;;;;;;;UAWiB,4BAAA;oBACG;;cAIP,8BAA8B,iBAAiB;;;;qBAKhC,sBAAqB;EAVhC,UAAA,CAAA,CAAA,EAiBQ,OAjBR,CAAA,IAAA,CAAA;EAKJ,UAAA,CAAA,eAAe,CA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AAe,SAAA,WAAA,EAAA,KAAA;IAAA,SAAA,SAAA,EAAA,KAAA;IAIf,SAAA,QAAA,EAAA,GAAA,GAAA,IAAA;MAQA;IAAe,SAAA,WAAA,EAAA,KAAA;;8BAAA;MAAA;IAkD3B,SAAA,WAAA,EAAA,OAAA;IAA4B,SAAA,SAAA,EAAA,KAAA;IAAA,SAAA,QAAA,EAAA,yBAAA;;;;;;mBAA5B,+BAA4B"}
@@ -1,7 +1,7 @@
1
1
  import { BaseAgent } from "../../agent/BaseAgent.js";
2
2
  import { VersionString } from "../../utils/version.js";
3
- import { updateV0_3ToV0_3_1 } from "./updates/0.3-0.3.1/index.js";
4
3
  import { updateV0_3_1ToV0_4 } from "./updates/0.3.1-0.4/index.js";
4
+ import { updateV0_3ToV0_3_1 } from "./updates/0.3-0.3.1/index.js";
5
5
  import { updateV0_4ToV0_5 } from "./updates/0.4-0.5/index.js";
6
6
  import { UpdateConfig, UpdateToVersion } from "./updates.js";
7
7
 
@@ -1 +1 @@
1
- {"version":3,"file":"UpdateAssistant.d.ts","names":[],"sources":["../../../src/storage/migration/UpdateAssistant.ts"],"sourcesContent":[],"mappings":";;;;;;;;UAWiB,4BAAA;oBACG;;cAIP,8BAA8B,iBAAiB;;;EAL3C,QAAA,YAAA;EAKJ,WAAA,CAAA,KAAA,EAKe,KALA,EAAA,YAAA,CAAA,EAKqB,YALrB;EAAA,UAAA,CAAA,CAAA,EAYH,OAZG,CAAA,IAAA,CAAA;YAAe,CAAA,eAAA,CAAA,EAkBC,eAlBD,CAAA,EAkBgB,OAlBhB,CAAA,OAAA,CAAA;+BAAiB,CAAA,CAAA,EAsBhB,OAtBgB,CAkBD,aAAA,CAlBC;aAKhC,uBAAA,CAAA,CAAA,EAAA,KAAA;kBAAqB,CAAA,SAAA,CAAA,EAyBL,eAzBK,CAAA,EAyBU,OAzBV,CAAA,CAAA;IAOxB,SAAA,WAAA,EAAA,KAAA;IAMmB,SAAA,SAAA,EAAA,KAAA;IAAe,SAAA,QAAA,EAAA,GAAA,GAAA,IAAA;MAAA;IAIf,SAAA,WAAA,EAAA,KAAA;IAQA,SAAA,SAAA,EAAA,KAAA;IAAe,SAAA,QAAA,EAAA,GAAA,GAAA,IAAA;;;IAAA,SAAA,SAAA,EAAA,OAAA;IAkD3B,SAAA,QAAA,EAAA,OAlD2B,kBAkD3B;MAA4B;IAAA,SAAA,WAAA,EAAA,OAAA;;;;;;;;mBAA5B,+BAA4B"}
1
+ {"version":3,"file":"UpdateAssistant.d.ts","names":[],"sources":["../../../src/storage/migration/UpdateAssistant.ts"],"sourcesContent":[],"mappings":";;;;;;;;UAUiB,4BAAA;oBACG;;cAIP,8BAA8B,iBAAiB;;;EAL3C,QAAA,YAAA;EAKJ,WAAA,CAAA,KAAA,EAKe,KALA,EAAA,YAAA,CAAA,EAKqB,YALrB;EAAA,UAAA,CAAA,CAAA,EAYH,OAZG,CAAA,IAAA,CAAA;YAAe,CAAA,eAAA,CAAA,EAkBC,eAlBD,CAAA,EAkBgB,OAlBhB,CAAA,OAAA,CAAA;+BAAiB,CAAA,CAAA,EAsBhB,OAtBgB,CAkBD,aAAA,CAlBC;aAKhC,uBAAA,CAAA,CAAA,EAAA,KAAA;kBAAqB,CAAA,SAAA,CAAA,EAyBL,eAzBK,CAAA,EAyBU,OAzBV,CAAA,CAAA;IAOxB,SAAA,WAAA,EAAA,KAAA;IAMmB,SAAA,SAAA,EAAA,KAAA;IAAe,SAAA,QAAA,EAAA,GAAA,GAAA,IAAA;MAAA;IAIf,SAAA,WAAA,EAAA,KAAA;IAQA,SAAA,SAAA,EAAA,KAAA;IAAe,SAAA,QAAA,EAAA,GAAA,GAAA,IAAA;;;IAAA,SAAA,SAAA,EAAA,OAAA;IAkD3B,SAAA,QAAA,EAAA,OAlD2B,kBAkD3B;MAA4B;IAAA,SAAA,WAAA,EAAA,OAAA;;;;;;;;mBAA5B,+BAA4B"}
@@ -2,8 +2,8 @@
2
2
 
3
3
  const require_CredoError = require('../../error/CredoError.js');
4
4
  require('../../error/index.js');
5
- const require_updates = require('./updates.js');
6
5
  const require_version = require('../../utils/version.js');
6
+ const require_updates = require('./updates.js');
7
7
  const require_StorageUpdateService = require('./StorageUpdateService.js');
8
8
  const require_StorageUpdateError = require('./error/StorageUpdateError.js');
9
9
 
@@ -2,8 +2,8 @@
2
2
 
3
3
  import { CredoError } from "../../error/CredoError.mjs";
4
4
  import "../../error/index.mjs";
5
- import { CURRENT_FRAMEWORK_STORAGE_VERSION, DEFAULT_UPDATE_CONFIG, supportedUpdates } from "./updates.mjs";
6
5
  import { isFirstVersionEqualToSecond, isFirstVersionHigherThanSecond, parseVersionString } from "../../utils/version.mjs";
6
+ import { CURRENT_FRAMEWORK_STORAGE_VERSION, DEFAULT_UPDATE_CONFIG, supportedUpdates } from "./updates.mjs";
7
7
  import { StorageUpdateService } from "./StorageUpdateService.mjs";
8
8
  import { StorageUpdateError } from "./error/StorageUpdateError.mjs";
9
9
 
@@ -1 +1 @@
1
- {"version":3,"file":"UpdateAssistant.mjs","names":["modulesWithUpdate: Array<{ module: Module; update: Update }>"],"sources":["../../../src/storage/migration/UpdateAssistant.ts"],"sourcesContent":["import type { BaseAgent } from '../../agent/BaseAgent'\nimport type { Module } from '../../plugins'\nimport type { Update, UpdateConfig, UpdateToVersion } from './updates'\n\nimport { CredoError } from '../../error'\nimport { isFirstVersionEqualToSecond, isFirstVersionHigherThanSecond, parseVersionString } from '../../utils/version'\n\nimport { StorageUpdateService } from './StorageUpdateService'\nimport { StorageUpdateError } from './error/StorageUpdateError'\nimport { CURRENT_FRAMEWORK_STORAGE_VERSION, DEFAULT_UPDATE_CONFIG, supportedUpdates } from './updates'\n\nexport interface UpdateAssistantUpdateOptions {\n updateToVersion?: UpdateToVersion\n}\n\n// biome-ignore lint/suspicious/noExplicitAny: <explanation>\nexport class UpdateAssistant<Agent extends BaseAgent<any> = BaseAgent> {\n private agent: Agent\n private storageUpdateService: StorageUpdateService\n private updateConfig: UpdateConfig\n\n public constructor(agent: Agent, updateConfig: UpdateConfig = DEFAULT_UPDATE_CONFIG) {\n this.agent = agent\n this.updateConfig = updateConfig\n\n this.storageUpdateService = this.agent.dependencyManager.resolve(StorageUpdateService)\n }\n\n public async initialize() {\n if (this.agent.isInitialized) {\n throw new CredoError(\"Can't initialize UpdateAssistant after agent is initialized\")\n }\n }\n\n public async isUpToDate(updateToVersion?: UpdateToVersion) {\n return this.storageUpdateService.isUpToDate(this.agent.context, updateToVersion)\n }\n\n public async getCurrentAgentStorageVersion() {\n return this.storageUpdateService.getCurrentStorageVersion(this.agent.context)\n }\n\n public static get frameworkStorageVersion() {\n return CURRENT_FRAMEWORK_STORAGE_VERSION\n }\n\n public async getNeededUpdates(toVersion?: UpdateToVersion) {\n const currentStorageVersion = parseVersionString(\n await this.storageUpdateService.getCurrentStorageVersion(this.agent.context)\n )\n\n const parsedToVersion = toVersion ? parseVersionString(toVersion) : undefined\n\n // If the current storage version is higher or equal to the toVersion, we can't update, so return empty array\n if (\n parsedToVersion &&\n (isFirstVersionHigherThanSecond(currentStorageVersion, parsedToVersion) ||\n isFirstVersionEqualToSecond(currentStorageVersion, parsedToVersion))\n ) {\n return []\n }\n\n // Filter updates. We don't want older updates we already applied\n // or aren't needed because the wallet was created after the update script was made\n const neededUpdates = supportedUpdates.filter((update) => {\n const updateToVersion = parseVersionString(update.toVersion)\n\n // If the update toVersion is higher than the wanted toVersion, we skip the update\n if (parsedToVersion && isFirstVersionHigherThanSecond(updateToVersion, parsedToVersion)) {\n return false\n }\n\n // if an update toVersion is higher than currentStorageVersion we want to to include the update\n return isFirstVersionHigherThanSecond(updateToVersion, currentStorageVersion)\n })\n\n // The current storage version is too old to update\n if (\n neededUpdates.length > 0 &&\n isFirstVersionHigherThanSecond(parseVersionString(neededUpdates[0].fromVersion), currentStorageVersion)\n ) {\n throw new CredoError(\n `First fromVersion is higher than current storage version. You need to use an older version of the framework to update to at least version ${neededUpdates[0].fromVersion}`\n )\n }\n\n const lastUpdateToVersion = neededUpdates.length > 0 ? neededUpdates[neededUpdates.length - 1].toVersion : undefined\n if (toVersion && lastUpdateToVersion && lastUpdateToVersion !== toVersion) {\n throw new CredoError(\n `No update found for toVersion ${toVersion}. Make sure the toVersion is a valid version you can update to`\n )\n }\n\n return neededUpdates\n }\n\n public async update(options?: UpdateAssistantUpdateOptions) {\n const updateIdentifier = Date.now().toString()\n const updateToVersion = options?.updateToVersion\n\n try {\n this.agent.config.logger.info(`Starting update of agent storage with updateIdentifier ${updateIdentifier}`)\n const neededUpdates = await this.getNeededUpdates(updateToVersion)\n\n const currentStorageVersion = parseVersionString(\n await this.storageUpdateService.getCurrentStorageVersion(this.agent.context)\n )\n const parsedToVersion = updateToVersion ? parseVersionString(updateToVersion) : undefined\n\n // If the current storage version is higher or equal to the toVersion, we can't update.\n if (\n parsedToVersion &&\n (isFirstVersionHigherThanSecond(currentStorageVersion, parsedToVersion) ||\n isFirstVersionEqualToSecond(currentStorageVersion, parsedToVersion))\n ) {\n throw new StorageUpdateError(\n `Can't update to version ${updateToVersion} because it is lower or equal to the current agent storage version ${currentStorageVersion[0]}.${currentStorageVersion[1]}}`\n )\n }\n\n if (neededUpdates.length === 0) {\n this.agent.config.logger.info('No update needed. Agent storage is up to date.')\n return\n }\n\n const fromVersion = neededUpdates[0].fromVersion\n const toVersion = neededUpdates[neededUpdates.length - 1].toVersion\n\n this.agent.config.logger.info(\n `Starting update process. Total of ${neededUpdates.length} update(s) will be applied to update the agent storage from version ${fromVersion} to version ${toVersion}`\n )\n\n try {\n for (const update of neededUpdates) {\n const registeredModules = Object.values(this.agent.dependencyManager.registeredModules)\n const modulesWithUpdate: Array<{ module: Module; update: Update }> = []\n\n // Filter modules that have an update script for the current update\n for (const registeredModule of registeredModules) {\n const moduleUpdate = registeredModule.updates?.find(\n (module) => module.fromVersion === update.fromVersion && module.toVersion === update.toVersion\n )\n\n if (moduleUpdate) {\n modulesWithUpdate.push({\n module: registeredModule,\n update: moduleUpdate,\n })\n }\n }\n\n this.agent.config.logger.info(\n `Starting update of agent storage from version ${update.fromVersion} to version ${update.toVersion}. Found ${modulesWithUpdate.length} extension module(s) with update scripts`\n )\n await update.doUpdate(this.agent)\n\n this.agent.config.logger.info(\n `Finished update of core agent storage from version ${update.fromVersion} to version ${update.toVersion}. Starting update of extension modules`\n )\n\n for (const moduleWithUpdate of modulesWithUpdate) {\n this.agent.config.logger.info(\n `Starting update of extension module ${moduleWithUpdate.module.constructor.name} from version ${moduleWithUpdate.update.fromVersion} to version ${moduleWithUpdate.update.toVersion}`\n )\n await moduleWithUpdate.update.doUpdate(this.agent, this.updateConfig)\n this.agent.config.logger.info(\n `Finished update of extension module ${moduleWithUpdate.module.constructor.name} from version ${moduleWithUpdate.update.fromVersion} to version ${moduleWithUpdate.update.toVersion}`\n )\n }\n\n // Update the framework version in storage\n await this.storageUpdateService.setCurrentStorageVersion(this.agent.context, update.toVersion)\n this.agent.config.logger.info(\n `Successfully updated agent storage from version ${update.fromVersion} to version ${update.toVersion}`\n )\n }\n } catch (error) {\n this.agent.config.logger.fatal('An error occurred while updating the wallet.', {\n error,\n })\n\n throw error\n }\n } catch (error) {\n this.agent.config.logger.error(`Error updating storage (updateIdentifier: ${updateIdentifier})`, {\n cause: error,\n })\n\n throw new StorageUpdateError(`Error updating storage (updateIdentifier: ${updateIdentifier}): ${error.message}`, {\n cause: error,\n })\n }\n\n return updateIdentifier\n }\n}\n"],"mappings":";;;;;;;;;;AAgBA,IAAa,kBAAb,MAAuE;CAKrE,AAAO,YAAY,OAAc,eAA6B,uBAAuB;AACnF,OAAK,QAAQ;AACb,OAAK,eAAe;AAEpB,OAAK,uBAAuB,KAAK,MAAM,kBAAkB,QAAQ,qBAAqB;;CAGxF,MAAa,aAAa;AACxB,MAAI,KAAK,MAAM,cACb,OAAM,IAAI,WAAW,8DAA8D;;CAIvF,MAAa,WAAW,iBAAmC;AACzD,SAAO,KAAK,qBAAqB,WAAW,KAAK,MAAM,SAAS,gBAAgB;;CAGlF,MAAa,gCAAgC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AO,YAC3K;;AAIH,WAAM,KAAK,qBAAqB,yBAAyB,KAAK,MAAM,SAAS,OAAO,UAAU;AAC9F,UAAK,MAAM,OAAO,OAAO,KACvB,mDAAmD,OAAO,YAAY,cAAc,OAAO,YAC5F;;YAEI,OAAO;AACd,SAAK,MAAM,OAAO,OAAO,MAAM,gDAAgD,EAC7E,OACD,CAAC;AAEF,UAAM;;WAED,OAAO;AACd,QAAK,MAAM,OAAO,OAAO,MAAM,6CAA6C,iBAAiB,IAAI,EAC/F,OAAO,OACR,CAAC;AAEF,SAAM,IAAI,mBAAmB,6CAA6C,iBAAiB,KAAK,MAAM,WAAW,EAC/G,OAAO,OACR,CAAC;;AAGJ,SAAO"}
1
+ {"version":3,"file":"UpdateAssistant.mjs","names":["modulesWithUpdate: Array<{ module: Module; update: Update }>"],"sources":["../../../src/storage/migration/UpdateAssistant.ts"],"sourcesContent":["import type { BaseAgent } from '../../agent/BaseAgent'\nimport { CredoError } from '../../error'\nimport type { Module } from '../../plugins'\nimport { isFirstVersionEqualToSecond, isFirstVersionHigherThanSecond, parseVersionString } from '../../utils/version'\nimport { StorageUpdateError } from './error/StorageUpdateError'\n\nimport { StorageUpdateService } from './StorageUpdateService'\nimport type { Update, UpdateConfig, UpdateToVersion } from './updates'\nimport { CURRENT_FRAMEWORK_STORAGE_VERSION, DEFAULT_UPDATE_CONFIG, supportedUpdates } from './updates'\n\nexport interface UpdateAssistantUpdateOptions {\n updateToVersion?: UpdateToVersion\n}\n\n// biome-ignore lint/suspicious/noExplicitAny: no explanation\nexport class UpdateAssistant<Agent extends BaseAgent<any> = BaseAgent> {\n private agent: Agent\n private storageUpdateService: StorageUpdateService\n private updateConfig: UpdateConfig\n\n public constructor(agent: Agent, updateConfig: UpdateConfig = DEFAULT_UPDATE_CONFIG) {\n this.agent = agent\n this.updateConfig = updateConfig\n\n this.storageUpdateService = this.agent.dependencyManager.resolve(StorageUpdateService)\n }\n\n public async initialize() {\n if (this.agent.isInitialized) {\n throw new CredoError(\"Can't initialize UpdateAssistant after agent is initialized\")\n }\n }\n\n public async isUpToDate(updateToVersion?: UpdateToVersion) {\n return this.storageUpdateService.isUpToDate(this.agent.context, updateToVersion)\n }\n\n public async getCurrentAgentStorageVersion() {\n return this.storageUpdateService.getCurrentStorageVersion(this.agent.context)\n }\n\n public static get frameworkStorageVersion() {\n return CURRENT_FRAMEWORK_STORAGE_VERSION\n }\n\n public async getNeededUpdates(toVersion?: UpdateToVersion) {\n const currentStorageVersion = parseVersionString(\n await this.storageUpdateService.getCurrentStorageVersion(this.agent.context)\n )\n\n const parsedToVersion = toVersion ? parseVersionString(toVersion) : undefined\n\n // If the current storage version is higher or equal to the toVersion, we can't update, so return empty array\n if (\n parsedToVersion &&\n (isFirstVersionHigherThanSecond(currentStorageVersion, parsedToVersion) ||\n isFirstVersionEqualToSecond(currentStorageVersion, parsedToVersion))\n ) {\n return []\n }\n\n // Filter updates. We don't want older updates we already applied\n // or aren't needed because the wallet was created after the update script was made\n const neededUpdates = supportedUpdates.filter((update) => {\n const updateToVersion = parseVersionString(update.toVersion)\n\n // If the update toVersion is higher than the wanted toVersion, we skip the update\n if (parsedToVersion && isFirstVersionHigherThanSecond(updateToVersion, parsedToVersion)) {\n return false\n }\n\n // if an update toVersion is higher than currentStorageVersion we want to to include the update\n return isFirstVersionHigherThanSecond(updateToVersion, currentStorageVersion)\n })\n\n // The current storage version is too old to update\n if (\n neededUpdates.length > 0 &&\n isFirstVersionHigherThanSecond(parseVersionString(neededUpdates[0].fromVersion), currentStorageVersion)\n ) {\n throw new CredoError(\n `First fromVersion is higher than current storage version. You need to use an older version of the framework to update to at least version ${neededUpdates[0].fromVersion}`\n )\n }\n\n const lastUpdateToVersion = neededUpdates.length > 0 ? neededUpdates[neededUpdates.length - 1].toVersion : undefined\n if (toVersion && lastUpdateToVersion && lastUpdateToVersion !== toVersion) {\n throw new CredoError(\n `No update found for toVersion ${toVersion}. Make sure the toVersion is a valid version you can update to`\n )\n }\n\n return neededUpdates\n }\n\n public async update(options?: UpdateAssistantUpdateOptions) {\n const updateIdentifier = Date.now().toString()\n const updateToVersion = options?.updateToVersion\n\n try {\n this.agent.config.logger.info(`Starting update of agent storage with updateIdentifier ${updateIdentifier}`)\n const neededUpdates = await this.getNeededUpdates(updateToVersion)\n\n const currentStorageVersion = parseVersionString(\n await this.storageUpdateService.getCurrentStorageVersion(this.agent.context)\n )\n const parsedToVersion = updateToVersion ? parseVersionString(updateToVersion) : undefined\n\n // If the current storage version is higher or equal to the toVersion, we can't update.\n if (\n parsedToVersion &&\n (isFirstVersionHigherThanSecond(currentStorageVersion, parsedToVersion) ||\n isFirstVersionEqualToSecond(currentStorageVersion, parsedToVersion))\n ) {\n throw new StorageUpdateError(\n `Can't update to version ${updateToVersion} because it is lower or equal to the current agent storage version ${currentStorageVersion[0]}.${currentStorageVersion[1]}}`\n )\n }\n\n if (neededUpdates.length === 0) {\n this.agent.config.logger.info('No update needed. Agent storage is up to date.')\n return\n }\n\n const fromVersion = neededUpdates[0].fromVersion\n const toVersion = neededUpdates[neededUpdates.length - 1].toVersion\n\n this.agent.config.logger.info(\n `Starting update process. Total of ${neededUpdates.length} update(s) will be applied to update the agent storage from version ${fromVersion} to version ${toVersion}`\n )\n\n try {\n for (const update of neededUpdates) {\n const registeredModules = Object.values(this.agent.dependencyManager.registeredModules)\n const modulesWithUpdate: Array<{ module: Module; update: Update }> = []\n\n // Filter modules that have an update script for the current update\n for (const registeredModule of registeredModules) {\n const moduleUpdate = registeredModule.updates?.find(\n (module) => module.fromVersion === update.fromVersion && module.toVersion === update.toVersion\n )\n\n if (moduleUpdate) {\n modulesWithUpdate.push({\n module: registeredModule,\n update: moduleUpdate,\n })\n }\n }\n\n this.agent.config.logger.info(\n `Starting update of agent storage from version ${update.fromVersion} to version ${update.toVersion}. Found ${modulesWithUpdate.length} extension module(s) with update scripts`\n )\n await update.doUpdate(this.agent)\n\n this.agent.config.logger.info(\n `Finished update of core agent storage from version ${update.fromVersion} to version ${update.toVersion}. Starting update of extension modules`\n )\n\n for (const moduleWithUpdate of modulesWithUpdate) {\n this.agent.config.logger.info(\n `Starting update of extension module ${moduleWithUpdate.module.constructor.name} from version ${moduleWithUpdate.update.fromVersion} to version ${moduleWithUpdate.update.toVersion}`\n )\n await moduleWithUpdate.update.doUpdate(this.agent, this.updateConfig)\n this.agent.config.logger.info(\n `Finished update of extension module ${moduleWithUpdate.module.constructor.name} from version ${moduleWithUpdate.update.fromVersion} to version ${moduleWithUpdate.update.toVersion}`\n )\n }\n\n // Update the framework version in storage\n await this.storageUpdateService.setCurrentStorageVersion(this.agent.context, update.toVersion)\n this.agent.config.logger.info(\n `Successfully updated agent storage from version ${update.fromVersion} to version ${update.toVersion}`\n )\n }\n } catch (error) {\n this.agent.config.logger.fatal('An error occurred while updating the wallet.', {\n error,\n })\n\n throw error\n }\n } catch (error) {\n this.agent.config.logger.error(`Error updating storage (updateIdentifier: ${updateIdentifier})`, {\n cause: error,\n })\n\n throw new StorageUpdateError(`Error updating storage (updateIdentifier: ${updateIdentifier}): ${error.message}`, {\n cause: error,\n })\n }\n\n return updateIdentifier\n }\n}\n"],"mappings":";;;;;;;;;;AAeA,IAAa,kBAAb,MAAuE;CAKrE,AAAO,YAAY,OAAc,eAA6B,uBAAuB;AACnF,OAAK,QAAQ;AACb,OAAK,eAAe;AAEpB,OAAK,uBAAuB,KAAK,MAAM,kBAAkB,QAAQ,qBAAqB;;CAGxF,MAAa,aAAa;AACxB,MAAI,KAAK,MAAM,cACb,OAAM,IAAI,WAAW,8DAA8D;;CAIvF,MAAa,WAAW,iBAAmC;AACzD,SAAO,KAAK,qBAAqB,WAAW,KAAK,MAAM,SAAS,gBAAgB;;CAGlF,MAAa,gCAAgC;AAC3C,SAAO,KAAK,qBAAqB,yBAAyB,KAAK,MAAM,QAAQ;;CAG/E,WAAkB,0BAA0B;AAC1C,SAAO;;CAGT,MAAa,iBAAiB,WAA6B;EACzD,MAAM,wBAAwB,mBAC5B,MAAM,KAAK,qBAA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ACd,SAAK,MAAM,OAAO,OAAO,MAAM,gDAAgD,EAC7E,OACD,CAAC;AAEF,UAAM;;WAED,OAAO;AACd,QAAK,MAAM,OAAO,OAAO,MAAM,6CAA6C,iBAAiB,IAAI,EAC/F,OAAO,OACR,CAAC;AAEF,SAAM,IAAI,mBAAmB,6CAA6C,iBAAiB,KAAK,MAAM,WAAW,EAC/G,OAAO,OACR,CAAC;;AAGJ,SAAO"}
@@ -1,7 +1,7 @@
1
1
 
2
2
 
3
+ const require_isUpToDate = require('./isUpToDate.js');
3
4
  const require_StorageVersionRecord = require('./repository/StorageVersionRecord.js');
4
5
  const require_StorageVersionRepository = require('./repository/StorageVersionRepository.js');
5
- const require_isUpToDate = require('./isUpToDate.js');
6
6
  const require_StorageUpdateService = require('./StorageUpdateService.js');
7
7
  const require_UpdateAssistant = require('./UpdateAssistant.js');
@@ -1,7 +1,7 @@
1
1
 
2
2
 
3
+ import { isStorageUpToDate } from "./isUpToDate.mjs";
3
4
  import { StorageVersionRecord } from "./repository/StorageVersionRecord.mjs";
4
5
  import { StorageVersionRepository } from "./repository/StorageVersionRepository.mjs";
5
- import { isStorageUpToDate } from "./isUpToDate.mjs";
6
6
  import { StorageUpdateService } from "./StorageUpdateService.mjs";
7
7
  import { UpdateAssistant } from "./UpdateAssistant.mjs";
@@ -1 +1 @@
1
- {"version":3,"file":"isUpToDate.d.mts","names":[],"sources":["../../../src/storage/migration/isUpToDate.ts"],"sourcesContent":[],"mappings":";;;;iBAOgB,iBAAA,iBAAkC,iCAAiC"}
1
+ {"version":3,"file":"isUpToDate.d.mts","names":[],"sources":["../../../src/storage/migration/isUpToDate.ts"],"sourcesContent":[],"mappings":";;;;iBAMgB,iBAAA,iBAAkC,iCAAiC"}
@@ -1 +1 @@
1
- {"version":3,"file":"isUpToDate.d.ts","names":[],"sources":["../../../src/storage/migration/isUpToDate.ts"],"sourcesContent":[],"mappings":";;;;iBAOgB,iBAAA,iBAAkC,iCAAiC"}
1
+ {"version":3,"file":"isUpToDate.d.ts","names":[],"sources":["../../../src/storage/migration/isUpToDate.ts"],"sourcesContent":[],"mappings":";;;;iBAMgB,iBAAA,iBAAkC,iCAAiC"}
@@ -1,7 +1,7 @@
1
1
 
2
2
 
3
- const require_updates = require('./updates.js');
4
3
  const require_version = require('../../utils/version.js');
4
+ const require_updates = require('./updates.js');
5
5
 
6
6
  //#region src/storage/migration/isUpToDate.ts
7
7
  function isStorageUpToDate(storageVersion, updateToVersion) {
@@ -1,7 +1,7 @@
1
1
 
2
2
 
3
- import { CURRENT_FRAMEWORK_STORAGE_VERSION } from "./updates.mjs";
4
3
  import { isFirstVersionEqualToSecond, isFirstVersionHigherThanSecond, parseVersionString } from "../../utils/version.mjs";
4
+ import { CURRENT_FRAMEWORK_STORAGE_VERSION } from "./updates.mjs";
5
5
 
6
6
  //#region src/storage/migration/isUpToDate.ts
7
7
  function isStorageUpToDate(storageVersion, updateToVersion) {
@@ -1 +1 @@
1
- {"version":3,"file":"isUpToDate.mjs","names":[],"sources":["../../../src/storage/migration/isUpToDate.ts"],"sourcesContent":["import type { VersionString } from '../../utils/version'\nimport type { UpdateToVersion } from './updates'\n\nimport { isFirstVersionEqualToSecond, isFirstVersionHigherThanSecond, parseVersionString } from '../../utils/version'\n\nimport { CURRENT_FRAMEWORK_STORAGE_VERSION } from './updates'\n\nexport function isStorageUpToDate(storageVersion: VersionString, updateToVersion?: UpdateToVersion) {\n const currentStorageVersion = parseVersionString(storageVersion)\n const compareToVersion = parseVersionString(updateToVersion ?? CURRENT_FRAMEWORK_STORAGE_VERSION)\n\n const isUpToDate =\n isFirstVersionEqualToSecond(currentStorageVersion, compareToVersion) ||\n isFirstVersionHigherThanSecond(currentStorageVersion, compareToVersion)\n\n return isUpToDate\n}\n"],"mappings":";;;;;;AAOA,SAAgB,kBAAkB,gBAA+B,iBAAmC;CAClG,MAAM,wBAAwB,mBAAmB,eAAe;CAChE,MAAM,mBAAmB,mBAAmB,mBAAmB,kCAAkC;AAMjG,QAHE,4BAA4B,uBAAuB,iBAAiB,IACpE,+BAA+B,uBAAuB,iBAAiB"}
1
+ {"version":3,"file":"isUpToDate.mjs","names":[],"sources":["../../../src/storage/migration/isUpToDate.ts"],"sourcesContent":["import type { VersionString } from '../../utils/version'\nimport { isFirstVersionEqualToSecond, isFirstVersionHigherThanSecond, parseVersionString } from '../../utils/version'\nimport type { UpdateToVersion } from './updates'\n\nimport { CURRENT_FRAMEWORK_STORAGE_VERSION } from './updates'\n\nexport function isStorageUpToDate(storageVersion: VersionString, updateToVersion?: UpdateToVersion) {\n const currentStorageVersion = parseVersionString(storageVersion)\n const compareToVersion = parseVersionString(updateToVersion ?? CURRENT_FRAMEWORK_STORAGE_VERSION)\n\n const isUpToDate =\n isFirstVersionEqualToSecond(currentStorageVersion, compareToVersion) ||\n isFirstVersionHigherThanSecond(currentStorageVersion, compareToVersion)\n\n return isUpToDate\n}\n"],"mappings":";;;;;;AAMA,SAAgB,kBAAkB,gBAA+B,iBAAmC;CAClG,MAAM,wBAAwB,mBAAmB,eAAe;CAChE,MAAM,mBAAmB,mBAAmB,mBAAmB,kCAAkC;AAMjG,QAHE,4BAA4B,uBAAuB,iBAAiB,IACpE,+BAA+B,uBAAuB,iBAAiB"}
@@ -1 +1 @@
1
- {"version":3,"file":"cache.mjs","names":[],"sources":["../../../../../src/storage/migration/updates/0.3.1-0.4/cache.ts"],"sourcesContent":["import type { BaseAgent } from '../../../../agent/BaseAgent'\nimport type { StorageService } from '../../../StorageService'\n\nimport { InjectionSymbols } from '../../../../constants'\nimport { BaseRecord } from '../../../BaseRecord'\n\n/**\n * removes the all cache records as used in 0.3.0, as they have been updated to use the new cache interface.\n */\nexport async function migrateCacheToV0_4<Agent extends BaseAgent>(agent: Agent) {\n agent.config.logger.info('Removing 0.3 cache records from storage')\n\n const storageService = agent.dependencyManager.resolve<StorageService<BaseRecord>>(InjectionSymbols.StorageService)\n\n agent.config.logger.debug('Fetching all cache records')\n const records = await storageService.getAll(agent.context, CacheRecord)\n\n for (const record of records) {\n agent.config.logger.debug(`Removing cache record with id ${record.id}`)\n await storageService.deleteById(agent.context, CacheRecord, record.id)\n agent.config.logger.debug(`Successfully removed cache record with id ${record.id}`)\n }\n}\n\nclass CacheRecord extends BaseRecord {\n public static readonly type = 'CacheRecord'\n public readonly type = CacheRecord.type\n\n public getTags() {\n return this._tags\n }\n}\n"],"mappings":";;;;;;;;;AASA,eAAsB,mBAA4C,OAAc;AAC9E,OAAM,OAAO,OAAO,KAAK,0CAA0C;CAEnE,MAAM,iBAAiB,MAAM,kBAAkB,QAAoC,iBAAiB,eAAe;AAEnH,OAAM,OAAO,OAAO,MAAM,6BAA6B;CACvD,MAAM,UAAU,MAAM,eAAe,OAAO,MAAM,SAAS,YAAY;AAEvE,MAAK,MAAM,UAAU,SAAS;AAC5B,QAAM,OAAO,OAAO,MAAM,iCAAiC,OAAO,KAAK;AACvE,QAAM,eAAe,WAAW,MAAM,SAAS,aAAa,OAAO,GAAG;AACtE,QAAM,OAAO,OAAO,MAAM,6CAA6C,OAAO,KAAK;;;AAIvF,IAAM,cAAN,MAAM,oBAAoB,WAAW;;;OAEnB,OAAO,YAAY;;CAEnC,AAAO,UAAU;AACf,SAAO,KAAK;;;YAJS,OAAO"}
1
+ {"version":3,"file":"cache.mjs","names":[],"sources":["../../../../../src/storage/migration/updates/0.3.1-0.4/cache.ts"],"sourcesContent":["import type { BaseAgent } from '../../../../agent/BaseAgent'\nimport { InjectionSymbols } from '../../../../constants'\nimport { BaseRecord } from '../../../BaseRecord'\nimport type { StorageService } from '../../../StorageService'\n\n/**\n * removes the all cache records as used in 0.3.0, as they have been updated to use the new cache interface.\n */\nexport async function migrateCacheToV0_4<Agent extends BaseAgent>(agent: Agent) {\n agent.config.logger.info('Removing 0.3 cache records from storage')\n\n const storageService = agent.dependencyManager.resolve<StorageService<BaseRecord>>(InjectionSymbols.StorageService)\n\n agent.config.logger.debug('Fetching all cache records')\n const records = await storageService.getAll(agent.context, CacheRecord)\n\n for (const record of records) {\n agent.config.logger.debug(`Removing cache record with id ${record.id}`)\n await storageService.deleteById(agent.context, CacheRecord, record.id)\n agent.config.logger.debug(`Successfully removed cache record with id ${record.id}`)\n }\n}\n\nclass CacheRecord extends BaseRecord {\n public static readonly type = 'CacheRecord'\n public readonly type = CacheRecord.type\n\n public getTags() {\n return this._tags\n }\n}\n"],"mappings":";;;;;;;;;AAQA,eAAsB,mBAA4C,OAAc;AAC9E,OAAM,OAAO,OAAO,KAAK,0CAA0C;CAEnE,MAAM,iBAAiB,MAAM,kBAAkB,QAAoC,iBAAiB,eAAe;AAEnH,OAAM,OAAO,OAAO,MAAM,6BAA6B;CACvD,MAAM,UAAU,MAAM,eAAe,OAAO,MAAM,SAAS,YAAY;AAEvE,MAAK,MAAM,UAAU,SAAS;AAC5B,QAAM,OAAO,OAAO,MAAM,iCAAiC,OAAO,KAAK;AACvE,QAAM,eAAe,WAAW,MAAM,SAAS,aAAa,OAAO,GAAG;AACtE,QAAM,OAAO,OAAO,MAAM,6CAA6C,OAAO,KAAK;;;AAIvF,IAAM,cAAN,MAAM,oBAAoB,WAAW;;;OAEnB,OAAO,YAAY;;CAEnC,AAAO,UAAU;AACf,SAAO,KAAK;;;YAJS,OAAO"}
@@ -1 +1 @@
1
- {"version":3,"file":"w3cCredentialRecord.mjs","names":[],"sources":["../../../../../src/storage/migration/updates/0.4-0.5/w3cCredentialRecord.ts"],"sourcesContent":["import type { BaseAgent } from '../../../../agent/BaseAgent'\nimport type { W3cCredentialRecord } from '../../../../modules/vc/repository'\n\nimport { W3cJsonLdVerifiableCredential } from '../../../../modules/vc'\nimport { W3cJsonLdCredentialService } from '../../../../modules/vc/data-integrity/W3cJsonLdCredentialService'\nimport { W3cCredentialRepository } from '../../../../modules/vc/repository'\n\n/**\n * Re-saves the w3c credential records to add the new 'types' tag.\n */\nexport async function migrateW3cCredentialRecordToV0_5<Agent extends BaseAgent>(agent: Agent) {\n agent.config.logger.info('Migration w3c credential records records to storage version 0.5')\n\n const w3cCredentialRepository = agent.dependencyManager.resolve(W3cCredentialRepository)\n\n agent.config.logger.debug('Fetching all w3c credential records from storage')\n const records = await w3cCredentialRepository.getAll(agent.context)\n\n agent.config.logger.debug(`Found a total of ${records.length} w3c credential records to update.`)\n\n for (const record of records) {\n agent.config.logger.debug(\n `Updating w3c credential record with id ${record.id} to add 'types' tag and fix 'expandedTypes' tag for storage version 0.5`\n )\n\n await fixIncorrectExpandedTypesWithAskarStorage(agent, record)\n\n // Save updated record\n await w3cCredentialRepository.update(agent.context, record)\n\n agent.config.logger.debug(`Successfully migrated w3c credential record with id ${record.id} to storage version 0.5`)\n }\n}\n\n/**\n * Up until 0.5.0 the AskarStorageService contained a bug where a non-computed (so manually set on record) array tag values that contained a : in the value\n * would be incorrectly parsed back from an askar tag to a tag on a record. This would only cause problems for the storage if the record was re-saved and not\n * computed. The following would happen:\n * - Create record with non-computed tag, e.g. expandedTypes that contains a value with a : in it\n * - Save record. The tag is correctly set in Askar as `expandedTypes:https://example.com'\n * - Read record. The tag is correctly read from Askar as `expandedTypes:https://example.com'. However the transformation would result in the tag value on the record being set to `https'.\n * - Save record. The non-computed (important, as otherwise the correct computed value would overwrite the incorrect value before storing) tag value is now set to `https' instead of `https://example.com'\n *\n * This function checks if any of the values for expandedTypes is `https` and if so, re-calculates the correct value and sets it on the record.\n *\n * NOTE: This function needs to resolve the context of a W3cCredentialRecord to be able to correctly calculate the expanded types.\n * To not brick a wallet that has no internet when updating, the storage update will allow the resolving of the expanded types to fail.\n * If this is the case, at a later point the expanded types will need to be recalculated and set on the record.\n *\n * If w3c credential records are never re-saved this shouldn't be a problem though. By default w3c credential records are not re-saved,\n * and so it only applies if you have implemented a custom flow that re-saves w3c credential records (e.g. if you add metadata).\n */\nexport async function fixIncorrectExpandedTypesWithAskarStorage<Agent extends BaseAgent>(\n agent: Agent,\n w3cCredentialRecord: W3cCredentialRecord\n) {\n // We don't store the expanded types for JWT credentials (should we? As you can have jwt_vc with json-ld)\n if (!(w3cCredentialRecord.credential instanceof W3cJsonLdVerifiableCredential)) return\n\n const expandedTypes = (w3cCredentialRecord.getTag('expandedTypes') ?? []) as string[]\n\n // Check if one of the values is `https`\n const hasInvalidType = expandedTypes.some((type) => type === 'https')\n\n if (!hasInvalidType) return\n\n agent.context.config.logger.info(\n `W3c credential record with id '${w3cCredentialRecord.id}' contains invalid expanded types. Recalculating...`\n )\n const w3cJsonLdCredentialService = agent.dependencyManager.resolve(W3cJsonLdCredentialService)\n\n try {\n // JsonLd credentials need expanded types to be stored.\n const newExpandedTypes = await w3cJsonLdCredentialService.getExpandedTypesForCredential(\n agent.context,\n w3cCredentialRecord.credential\n )\n\n w3cCredentialRecord.setTag('expandedTypes', newExpandedTypes)\n agent.context.config.logger.info(\n `Successfully recalculated expanded types for w3c credential record with id ${w3cCredentialRecord.id} to ${newExpandedTypes} and set it on the record.`\n )\n } catch (_error) {\n agent.context.config.logger.error(\n `Retrieving expandedTypes fro w3c credential record with id ${w3cCredentialRecord.id} failed. To not brick the wallet, the storage update will not fail. Make sure to recalculate the expanded types at a later point. This is probably due to a missing internet connection. See https://credo.js.org/guides/updating/versions/0.4-to-0.5 for more information.`\n )\n }\n}\n"],"mappings":";;;;;;;;;;;;AAUA,eAAsB,iCAA0D,OAAc;AAC5F,OAAM,OAAO,OAAO,KAAK,kEAAkE;CAE3F,MAAM,0BAA0B,MAAM,kBAAkB,QAAQ,wBAAwB;AAExF,OAAM,OAAO,OAAO,MAAM,mDAAmD;CAC7E,MAAM,UAAU,MAAM,wBAAwB,OAAO,MAAM,QAAQ;AAEnE,OAAM,OAAO,OAAO,MAAM,oBAAoB,QAAQ,OAAO,oCAAoC;AAEjG,MAAK,MAAM,UAAU,SAAS;AAC5B,QAAM,OAAO,OAAO,MAClB,0CAA0C,OAAO,GAAG,yEACrD;AAED,QAAM,0CAA0C,OAAO,OAAO;AAG9D,QAAM,wBAAwB,OAAO,MAAM,SAAS,OAAO;AAE3D,QAAM,OAAO,OAAO,MAAM,uDAAuD,OAAO,GAAG,yBAAyB;;;;;;;;;;;;;;;;;;;;;AAsBxH,eAAsB,0CACpB,OACA,qBACA;AAEA,KAAI,EAAE,oBAAoB,sBAAsB,+BAAgC;AAOhF,KAAI,EALmB,oBAAoB,OAAO,gBAAgB,IAAI,EAAE,EAGnC,MAAM,SAAS,SAAS,QAAQ,CAEhD;AAErB,OAAM,QAAQ,OAAO,OAAO,KAC1B,kCAAkC,oBAAoB,GAAG,qDAC1D;CACD,MAAM,6BAA6B,MAAM,kBAAkB,QAAQ,2BAA2B;AAE9F,KAAI;EAEF,MAAM,mBAAmB,MAAM,2BAA2B,8BACxD,MAAM,SACN,oBAAoB,WACrB;AAED,sBAAoB,OAAO,iBAAiB,iBAAiB;AAC7D,QAAM,QAAQ,OAAO,OAAO,KAC1B,8EAA8E,oBAAoB,GAAG,MAAM,iBAAiB,4BAC7H;UACM,QAAQ;AACf,QAAM,QAAQ,OAAO,OAAO,MAC1B,8DAA8D,oBAAoB,GAAG,6QACtF"}
1
+ {"version":3,"file":"w3cCredentialRecord.mjs","names":[],"sources":["../../../../../src/storage/migration/updates/0.4-0.5/w3cCredentialRecord.ts"],"sourcesContent":["import type { BaseAgent } from '../../../../agent/BaseAgent'\nimport { W3cJsonLdVerifiableCredential } from '../../../../modules/vc'\nimport { W3cJsonLdCredentialService } from '../../../../modules/vc/data-integrity/W3cJsonLdCredentialService'\nimport type { W3cCredentialRecord } from '../../../../modules/vc/repository'\nimport { W3cCredentialRepository } from '../../../../modules/vc/repository'\n\n/**\n * Re-saves the w3c credential records to add the new 'types' tag.\n */\nexport async function migrateW3cCredentialRecordToV0_5<Agent extends BaseAgent>(agent: Agent) {\n agent.config.logger.info('Migration w3c credential records records to storage version 0.5')\n\n const w3cCredentialRepository = agent.dependencyManager.resolve(W3cCredentialRepository)\n\n agent.config.logger.debug('Fetching all w3c credential records from storage')\n const records = await w3cCredentialRepository.getAll(agent.context)\n\n agent.config.logger.debug(`Found a total of ${records.length} w3c credential records to update.`)\n\n for (const record of records) {\n agent.config.logger.debug(\n `Updating w3c credential record with id ${record.id} to add 'types' tag and fix 'expandedTypes' tag for storage version 0.5`\n )\n\n await fixIncorrectExpandedTypesWithAskarStorage(agent, record)\n\n // Save updated record\n await w3cCredentialRepository.update(agent.context, record)\n\n agent.config.logger.debug(`Successfully migrated w3c credential record with id ${record.id} to storage version 0.5`)\n }\n}\n\n/**\n * Up until 0.5.0 the AskarStorageService contained a bug where a non-computed (so manually set on record) array tag values that contained a : in the value\n * would be incorrectly parsed back from an askar tag to a tag on a record. This would only cause problems for the storage if the record was re-saved and not\n * computed. The following would happen:\n * - Create record with non-computed tag, e.g. expandedTypes that contains a value with a : in it\n * - Save record. The tag is correctly set in Askar as `expandedTypes:https://example.com'\n * - Read record. The tag is correctly read from Askar as `expandedTypes:https://example.com'. However the transformation would result in the tag value on the record being set to `https'.\n * - Save record. The non-computed (important, as otherwise the correct computed value would overwrite the incorrect value before storing) tag value is now set to `https' instead of `https://example.com'\n *\n * This function checks if any of the values for expandedTypes is `https` and if so, re-calculates the correct value and sets it on the record.\n *\n * NOTE: This function needs to resolve the context of a W3cCredentialRecord to be able to correctly calculate the expanded types.\n * To not brick a wallet that has no internet when updating, the storage update will allow the resolving of the expanded types to fail.\n * If this is the case, at a later point the expanded types will need to be recalculated and set on the record.\n *\n * If w3c credential records are never re-saved this shouldn't be a problem though. By default w3c credential records are not re-saved,\n * and so it only applies if you have implemented a custom flow that re-saves w3c credential records (e.g. if you add metadata).\n */\nexport async function fixIncorrectExpandedTypesWithAskarStorage<Agent extends BaseAgent>(\n agent: Agent,\n w3cCredentialRecord: W3cCredentialRecord\n) {\n // We don't store the expanded types for JWT credentials (should we? As you can have jwt_vc with json-ld)\n if (!(w3cCredentialRecord.credential instanceof W3cJsonLdVerifiableCredential)) return\n\n const expandedTypes = (w3cCredentialRecord.getTag('expandedTypes') ?? []) as string[]\n\n // Check if one of the values is `https`\n const hasInvalidType = expandedTypes.some((type) => type === 'https')\n\n if (!hasInvalidType) return\n\n agent.context.config.logger.info(\n `W3c credential record with id '${w3cCredentialRecord.id}' contains invalid expanded types. Recalculating...`\n )\n const w3cJsonLdCredentialService = agent.dependencyManager.resolve(W3cJsonLdCredentialService)\n\n try {\n // JsonLd credentials need expanded types to be stored.\n const newExpandedTypes = await w3cJsonLdCredentialService.getExpandedTypesForCredential(\n agent.context,\n w3cCredentialRecord.credential\n )\n\n w3cCredentialRecord.setTag('expandedTypes', newExpandedTypes)\n agent.context.config.logger.info(\n `Successfully recalculated expanded types for w3c credential record with id ${w3cCredentialRecord.id} to ${newExpandedTypes} and set it on the record.`\n )\n } catch (_error) {\n agent.context.config.logger.error(\n `Retrieving expandedTypes fro w3c credential record with id ${w3cCredentialRecord.id} failed. To not brick the wallet, the storage update will not fail. Make sure to recalculate the expanded types at a later point. This is probably due to a missing internet connection. See https://credo.js.org/guides/updating/versions/0.4-to-0.5 for more information.`\n )\n }\n}\n"],"mappings":";;;;;;;;;;;;AASA,eAAsB,iCAA0D,OAAc;AAC5F,OAAM,OAAO,OAAO,KAAK,kEAAkE;CAE3F,MAAM,0BAA0B,MAAM,kBAAkB,QAAQ,wBAAwB;AAExF,OAAM,OAAO,OAAO,MAAM,mDAAmD;CAC7E,MAAM,UAAU,MAAM,wBAAwB,OAAO,MAAM,QAAQ;AAEnE,OAAM,OAAO,OAAO,MAAM,oBAAoB,QAAQ,OAAO,oCAAoC;AAEjG,MAAK,MAAM,UAAU,SAAS;AAC5B,QAAM,OAAO,OAAO,MAClB,0CAA0C,OAAO,GAAG,yEACrD;AAED,QAAM,0CAA0C,OAAO,OAAO;AAG9D,QAAM,wBAAwB,OAAO,MAAM,SAAS,OAAO;AAE3D,QAAM,OAAO,OAAO,MAAM,uDAAuD,OAAO,GAAG,yBAAyB;;;;;;;;;;;;;;;;;;;;;AAsBxH,eAAsB,0CACpB,OACA,qBACA;AAEA,KAAI,EAAE,oBAAoB,sBAAsB,+BAAgC;AAOhF,KAAI,EALmB,oBAAoB,OAAO,gBAAgB,IAAI,EAAE,EAGnC,MAAM,SAAS,SAAS,QAAQ,CAEhD;AAErB,OAAM,QAAQ,OAAO,OAAO,KAC1B,kCAAkC,oBAAoB,GAAG,qDAC1D;CACD,MAAM,6BAA6B,MAAM,kBAAkB,QAAQ,2BAA2B;AAE9F,KAAI;EAEF,MAAM,mBAAmB,MAAM,2BAA2B,8BACxD,MAAM,SACN,oBAAoB,WACrB;AAED,sBAAoB,OAAO,iBAAiB,iBAAiB;AAC7D,QAAM,QAAQ,OAAO,OAAO,KAC1B,8EAA8E,oBAAoB,GAAG,MAAM,iBAAiB,4BAC7H;UACM,QAAQ;AACf,QAAM,QAAQ,OAAO,OAAO,MAC1B,8DAA8D,oBAAoB,GAAG,6QACtF"}
@@ -1,7 +1,7 @@
1
1
  import { BaseAgent } from "../../agent/BaseAgent.mjs";
2
2
  import { VersionString } from "../../utils/version.mjs";
3
- import { updateV0_3ToV0_3_1 } from "./updates/0.3-0.3.1/index.mjs";
4
3
  import { updateV0_3_1ToV0_4 } from "./updates/0.3.1-0.4/index.mjs";
4
+ import { updateV0_3ToV0_3_1 } from "./updates/0.3-0.3.1/index.mjs";
5
5
  import { updateV0_4ToV0_5 } from "./updates/0.4-0.5/index.mjs";
6
6
 
7
7
  //#region src/storage/migration/updates.d.ts