@credo-ts/anoncreds 0.6.1-pr-2091-20241119140918 → 0.6.1

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 (837) hide show
  1. package/build/AnonCredsApi.d.mts +113 -0
  2. package/build/AnonCredsApi.d.mts.map +1 -0
  3. package/build/AnonCredsApi.mjs +439 -0
  4. package/build/AnonCredsApi.mjs.map +1 -0
  5. package/build/AnonCredsApiOptions.d.mts +28 -0
  6. package/build/AnonCredsApiOptions.d.mts.map +1 -0
  7. package/build/AnonCredsModule.d.mts +29 -0
  8. package/build/AnonCredsModule.d.mts.map +1 -0
  9. package/build/AnonCredsModule.mjs +62 -0
  10. package/build/AnonCredsModule.mjs.map +1 -0
  11. package/build/AnonCredsModuleConfig.d.mts +79 -0
  12. package/build/AnonCredsModuleConfig.d.mts.map +1 -0
  13. package/build/AnonCredsModuleConfig.mjs +31 -0
  14. package/build/AnonCredsModuleConfig.mjs.map +1 -0
  15. package/build/_virtual/_@oxc-project_runtime@0.99.0/helpers/decorate.mjs +10 -0
  16. package/build/_virtual/_@oxc-project_runtime@0.99.0/helpers/decorateMetadata.mjs +7 -0
  17. package/build/_virtual/_@oxc-project_runtime@0.99.0/helpers/decorateParam.mjs +9 -0
  18. package/build/anoncreds-rs/AnonCredsDataIntegrityService.mjs +203 -0
  19. package/build/anoncreds-rs/AnonCredsDataIntegrityService.mjs.map +1 -0
  20. package/build/anoncreds-rs/AnonCredsRsHolderService.mjs +488 -0
  21. package/build/anoncreds-rs/AnonCredsRsHolderService.mjs.map +1 -0
  22. package/build/anoncreds-rs/AnonCredsRsIssuerService.mjs +213 -0
  23. package/build/anoncreds-rs/AnonCredsRsIssuerService.mjs.map +1 -0
  24. package/build/anoncreds-rs/AnonCredsRsVerifierService.mjs +122 -0
  25. package/build/anoncreds-rs/AnonCredsRsVerifierService.mjs.map +1 -0
  26. package/build/anoncreds-rs/index.mjs +3 -0
  27. package/build/anoncreds-rs/utils.mjs +60 -0
  28. package/build/anoncreds-rs/utils.mjs.map +1 -0
  29. package/build/error/AnonCredsError.d.mts +13 -0
  30. package/build/error/AnonCredsError.d.mts.map +1 -0
  31. package/build/error/AnonCredsError.mjs +12 -0
  32. package/build/error/AnonCredsError.mjs.map +1 -0
  33. package/build/error/AnonCredsRsError.d.mts +13 -0
  34. package/build/error/AnonCredsRsError.d.mts.map +1 -0
  35. package/build/error/AnonCredsRsError.mjs +12 -0
  36. package/build/error/AnonCredsRsError.mjs.map +1 -0
  37. package/build/error/AnonCredsStoreRecordError.d.mts +13 -0
  38. package/build/error/AnonCredsStoreRecordError.d.mts.map +1 -0
  39. package/build/error/AnonCredsStoreRecordError.mjs +12 -0
  40. package/build/error/AnonCredsStoreRecordError.mjs.map +1 -0
  41. package/build/error/index.d.mts +3 -0
  42. package/build/error/index.mjs +3 -0
  43. package/build/formats/AnonCredsDidCommCredentialFormat.d.mts +82 -0
  44. package/build/formats/AnonCredsDidCommCredentialFormat.d.mts.map +1 -0
  45. package/build/formats/AnonCredsDidCommCredentialFormatService.d.mts +120 -0
  46. package/build/formats/AnonCredsDidCommCredentialFormatService.d.mts.map +1 -0
  47. package/build/formats/AnonCredsDidCommCredentialFormatService.mjs +331 -0
  48. package/build/formats/AnonCredsDidCommCredentialFormatService.mjs.map +1 -0
  49. package/build/formats/AnonCredsDidCommProofFormat.d.mts +77 -0
  50. package/build/formats/AnonCredsDidCommProofFormat.d.mts.map +1 -0
  51. package/build/formats/AnonCredsDidCommProofFormatService.d.mts +93 -0
  52. package/build/formats/AnonCredsDidCommProofFormatService.d.mts.map +1 -0
  53. package/build/formats/AnonCredsDidCommProofFormatService.mjs +250 -0
  54. package/build/formats/AnonCredsDidCommProofFormatService.mjs.map +1 -0
  55. package/build/formats/DataIntegrityDidCommCredentialFormatService.d.mts +118 -0
  56. package/build/formats/DataIntegrityDidCommCredentialFormatService.d.mts.map +1 -0
  57. package/build/formats/DataIntegrityDidCommCredentialFormatService.mjs +587 -0
  58. package/build/formats/DataIntegrityDidCommCredentialFormatService.mjs.map +1 -0
  59. package/build/formats/LegacyIndyDidCommCredentialFormat.d.mts +38 -0
  60. package/build/formats/LegacyIndyDidCommCredentialFormat.d.mts.map +1 -0
  61. package/build/formats/LegacyIndyDidCommCredentialFormatService.d.mts +122 -0
  62. package/build/formats/LegacyIndyDidCommCredentialFormatService.d.mts.map +1 -0
  63. package/build/formats/LegacyIndyDidCommCredentialFormatService.mjs +309 -0
  64. package/build/formats/LegacyIndyDidCommCredentialFormatService.mjs.map +1 -0
  65. package/build/formats/LegacyIndyDidCommProofFormat.d.mts +36 -0
  66. package/build/formats/LegacyIndyDidCommProofFormat.d.mts.map +1 -0
  67. package/build/formats/LegacyIndyDidCommProofFormatService.d.mts +98 -0
  68. package/build/formats/LegacyIndyDidCommProofFormatService.d.mts.map +1 -0
  69. package/build/formats/LegacyIndyDidCommProofFormatService.mjs +322 -0
  70. package/build/formats/LegacyIndyDidCommProofFormatService.mjs.map +1 -0
  71. package/build/formats/index.d.mts +9 -0
  72. package/build/formats/index.mjs +5 -0
  73. package/build/index.d.mts +86 -0
  74. package/build/index.mjs +69 -0
  75. package/build/models/AnonCredsCredentialProposal.mjs +75 -0
  76. package/build/models/AnonCredsCredentialProposal.mjs.map +1 -0
  77. package/build/models/AnonCredsProofRequest.mjs +62 -0
  78. package/build/models/AnonCredsProofRequest.mjs.map +1 -0
  79. package/build/models/AnonCredsRequestedAttribute.mjs +50 -0
  80. package/build/models/AnonCredsRequestedAttribute.mjs.map +1 -0
  81. package/build/models/AnonCredsRequestedPredicate.mjs +53 -0
  82. package/build/models/AnonCredsRequestedPredicate.mjs.map +1 -0
  83. package/build/models/AnonCredsRestriction.d.mts +29 -0
  84. package/build/models/AnonCredsRestriction.d.mts.map +1 -0
  85. package/build/models/AnonCredsRestriction.mjs +137 -0
  86. package/build/models/AnonCredsRestriction.mjs.map +1 -0
  87. package/build/models/AnonCredsRestrictionWrapper.d.mts +9 -0
  88. package/build/models/AnonCredsRestrictionWrapper.d.mts.map +1 -0
  89. package/build/models/AnonCredsRestrictionWrapper.mjs +18 -0
  90. package/build/models/AnonCredsRestrictionWrapper.mjs.map +1 -0
  91. package/build/models/AnonCredsRevocationInterval.mjs +27 -0
  92. package/build/models/AnonCredsRevocationInterval.mjs.map +1 -0
  93. package/build/models/exchange.d.mts +104 -0
  94. package/build/models/exchange.d.mts.map +1 -0
  95. package/build/models/exchange.mjs +11 -0
  96. package/build/models/exchange.mjs.map +1 -0
  97. package/build/models/index.d.mts +4 -0
  98. package/build/models/index.mjs +2 -0
  99. package/build/models/internal.d.mts +40 -0
  100. package/build/models/internal.d.mts.map +1 -0
  101. package/build/models/registry.d.mts +44 -0
  102. package/build/models/registry.d.mts.map +1 -0
  103. package/build/models/utils.d.mts +27 -0
  104. package/build/models/utils.d.mts.map +1 -0
  105. package/build/protocols/credentials/v1/DidCommCredentialV1Protocol.d.mts +215 -0
  106. package/build/protocols/credentials/v1/DidCommCredentialV1Protocol.d.mts.map +1 -0
  107. package/build/protocols/credentials/v1/DidCommCredentialV1Protocol.mjs +827 -0
  108. package/build/protocols/credentials/v1/DidCommCredentialV1Protocol.mjs.map +1 -0
  109. package/build/protocols/credentials/v1/handlers/DidCommCredentialV1AckHandler.mjs +17 -0
  110. package/build/protocols/credentials/v1/handlers/DidCommCredentialV1AckHandler.mjs.map +1 -0
  111. package/build/protocols/credentials/v1/handlers/DidCommCredentialV1ProblemReportHandler.mjs +17 -0
  112. package/build/protocols/credentials/v1/handlers/DidCommCredentialV1ProblemReportHandler.mjs.map +1 -0
  113. package/build/protocols/credentials/v1/handlers/DidCommIssueCredentialV1Handler.mjs +36 -0
  114. package/build/protocols/credentials/v1/handlers/DidCommIssueCredentialV1Handler.mjs.map +1 -0
  115. package/build/protocols/credentials/v1/handlers/DidCommOfferCredentialV1Handler.mjs +32 -0
  116. package/build/protocols/credentials/v1/handlers/DidCommOfferCredentialV1Handler.mjs.map +1 -0
  117. package/build/protocols/credentials/v1/handlers/DidCommProposeCredentialV1Handler.mjs +35 -0
  118. package/build/protocols/credentials/v1/handlers/DidCommProposeCredentialV1Handler.mjs.map +1 -0
  119. package/build/protocols/credentials/v1/handlers/DidCommRequestCredentialV1Handler.mjs +36 -0
  120. package/build/protocols/credentials/v1/handlers/DidCommRequestCredentialV1Handler.mjs.map +1 -0
  121. package/build/protocols/credentials/v1/handlers/index.mjs +6 -0
  122. package/build/protocols/credentials/v1/index.d.mts +9 -0
  123. package/build/protocols/credentials/v1/index.mjs +9 -0
  124. package/build/protocols/credentials/v1/messages/DidCommCredentialV1AckMessage.d.mts +16 -0
  125. package/build/protocols/credentials/v1/messages/DidCommCredentialV1AckMessage.d.mts.map +1 -0
  126. package/build/protocols/credentials/v1/messages/DidCommCredentialV1AckMessage.mjs +21 -0
  127. package/build/protocols/credentials/v1/messages/DidCommCredentialV1AckMessage.mjs.map +1 -0
  128. package/build/protocols/credentials/v1/messages/DidCommCredentialV1Preview.d.mts +32 -0
  129. package/build/protocols/credentials/v1/messages/DidCommCredentialV1Preview.d.mts.map +1 -0
  130. package/build/protocols/credentials/v1/messages/DidCommCredentialV1Preview.mjs +57 -0
  131. package/build/protocols/credentials/v1/messages/DidCommCredentialV1Preview.mjs.map +1 -0
  132. package/build/protocols/credentials/v1/messages/DidCommCredentialV1ProblemReportMessage.d.mts +16 -0
  133. package/build/protocols/credentials/v1/messages/DidCommCredentialV1ProblemReportMessage.d.mts.map +1 -0
  134. package/build/protocols/credentials/v1/messages/DidCommCredentialV1ProblemReportMessage.mjs +21 -0
  135. package/build/protocols/credentials/v1/messages/DidCommCredentialV1ProblemReportMessage.mjs.map +1 -0
  136. package/build/protocols/credentials/v1/messages/DidCommIssueCredentialV1Message.d.mts +26 -0
  137. package/build/protocols/credentials/v1/messages/DidCommIssueCredentialV1Message.d.mts.map +1 -0
  138. package/build/protocols/credentials/v1/messages/DidCommIssueCredentialV1Message.mjs +46 -0
  139. package/build/protocols/credentials/v1/messages/DidCommIssueCredentialV1Message.mjs.map +1 -0
  140. package/build/protocols/credentials/v1/messages/DidCommOfferCredentialV1Message.d.mts +34 -0
  141. package/build/protocols/credentials/v1/messages/DidCommOfferCredentialV1Message.d.mts.map +1 -0
  142. package/build/protocols/credentials/v1/messages/DidCommOfferCredentialV1Message.mjs +61 -0
  143. package/build/protocols/credentials/v1/messages/DidCommOfferCredentialV1Message.mjs.map +1 -0
  144. package/build/protocols/credentials/v1/messages/DidCommProposeCredentialV1Message.d.mts +64 -0
  145. package/build/protocols/credentials/v1/messages/DidCommProposeCredentialV1Message.d.mts.map +1 -0
  146. package/build/protocols/credentials/v1/messages/DidCommProposeCredentialV1Message.mjs +95 -0
  147. package/build/protocols/credentials/v1/messages/DidCommProposeCredentialV1Message.mjs.map +1 -0
  148. package/build/protocols/credentials/v1/messages/DidCommRequestCredentialV1Message.d.mts +26 -0
  149. package/build/protocols/credentials/v1/messages/DidCommRequestCredentialV1Message.d.mts.map +1 -0
  150. package/build/protocols/credentials/v1/messages/DidCommRequestCredentialV1Message.mjs +46 -0
  151. package/build/protocols/credentials/v1/messages/DidCommRequestCredentialV1Message.mjs.map +1 -0
  152. package/build/protocols/credentials/v1/messages/index.d.mts +7 -0
  153. package/build/protocols/credentials/v1/messages/index.mjs +7 -0
  154. package/build/protocols/index.d.mts +18 -0
  155. package/build/protocols/index.mjs +18 -0
  156. package/build/protocols/proofs/v1/DidCommProofV1Protocol.d.mts +105 -0
  157. package/build/protocols/proofs/v1/DidCommProofV1Protocol.d.mts.map +1 -0
  158. package/build/protocols/proofs/v1/DidCommProofV1Protocol.mjs +723 -0
  159. package/build/protocols/proofs/v1/DidCommProofV1Protocol.mjs.map +1 -0
  160. package/build/protocols/proofs/v1/errors/DidCommPresentationV1ProblemReportError.d.mts +18 -0
  161. package/build/protocols/proofs/v1/errors/DidCommPresentationV1ProblemReportError.d.mts.map +1 -0
  162. package/build/protocols/proofs/v1/errors/DidCommPresentationV1ProblemReportError.mjs +19 -0
  163. package/build/protocols/proofs/v1/errors/DidCommPresentationV1ProblemReportError.mjs.map +1 -0
  164. package/build/protocols/proofs/v1/errors/index.d.mts +1 -0
  165. package/build/protocols/proofs/v1/errors/index.mjs +1 -0
  166. package/build/protocols/proofs/v1/handlers/DidCommPresentationV1AckHandler.mjs +17 -0
  167. package/build/protocols/proofs/v1/handlers/DidCommPresentationV1AckHandler.mjs.map +1 -0
  168. package/build/protocols/proofs/v1/handlers/DidCommPresentationV1Handler.mjs +36 -0
  169. package/build/protocols/proofs/v1/handlers/DidCommPresentationV1Handler.mjs.map +1 -0
  170. package/build/protocols/proofs/v1/handlers/DidCommPresentationV1ProblemReportHandler.mjs +16 -0
  171. package/build/protocols/proofs/v1/handlers/DidCommPresentationV1ProblemReportHandler.mjs.map +1 -0
  172. package/build/protocols/proofs/v1/handlers/DidCommProposePresentationV1Handler.mjs +35 -0
  173. package/build/protocols/proofs/v1/handlers/DidCommProposePresentationV1Handler.mjs.map +1 -0
  174. package/build/protocols/proofs/v1/handlers/DidCommRequestPresentationV1Handler.mjs +32 -0
  175. package/build/protocols/proofs/v1/handlers/DidCommRequestPresentationV1Handler.mjs.map +1 -0
  176. package/build/protocols/proofs/v1/handlers/index.mjs +5 -0
  177. package/build/protocols/proofs/v1/index.d.mts +11 -0
  178. package/build/protocols/proofs/v1/index.mjs +11 -0
  179. package/build/protocols/proofs/v1/messages/DidCommPresentationV1AckMessage.d.mts +12 -0
  180. package/build/protocols/proofs/v1/messages/DidCommPresentationV1AckMessage.d.mts.map +1 -0
  181. package/build/protocols/proofs/v1/messages/DidCommPresentationV1AckMessage.mjs +18 -0
  182. package/build/protocols/proofs/v1/messages/DidCommPresentationV1AckMessage.mjs.map +1 -0
  183. package/build/protocols/proofs/v1/messages/DidCommPresentationV1Message.d.mts +38 -0
  184. package/build/protocols/proofs/v1/messages/DidCommPresentationV1Message.d.mts.map +1 -0
  185. package/build/protocols/proofs/v1/messages/DidCommPresentationV1Message.mjs +52 -0
  186. package/build/protocols/proofs/v1/messages/DidCommPresentationV1Message.mjs.map +1 -0
  187. package/build/protocols/proofs/v1/messages/DidCommPresentationV1ProblemReportMessage.d.mts +16 -0
  188. package/build/protocols/proofs/v1/messages/DidCommPresentationV1ProblemReportMessage.d.mts.map +1 -0
  189. package/build/protocols/proofs/v1/messages/DidCommPresentationV1ProblemReportMessage.mjs +21 -0
  190. package/build/protocols/proofs/v1/messages/DidCommPresentationV1ProblemReportMessage.mjs.map +1 -0
  191. package/build/protocols/proofs/v1/messages/DidCommProposePresentationV1Message.d.mts +32 -0
  192. package/build/protocols/proofs/v1/messages/DidCommProposePresentationV1Message.d.mts.map +1 -0
  193. package/build/protocols/proofs/v1/messages/DidCommProposePresentationV1Message.mjs +44 -0
  194. package/build/protocols/proofs/v1/messages/DidCommProposePresentationV1Message.mjs.map +1 -0
  195. package/build/protocols/proofs/v1/messages/DidCommRequestPresentationV1Message.d.mts +36 -0
  196. package/build/protocols/proofs/v1/messages/DidCommRequestPresentationV1Message.d.mts.map +1 -0
  197. package/build/protocols/proofs/v1/messages/DidCommRequestPresentationV1Message.mjs +50 -0
  198. package/build/protocols/proofs/v1/messages/DidCommRequestPresentationV1Message.mjs.map +1 -0
  199. package/build/protocols/proofs/v1/messages/index.d.mts +5 -0
  200. package/build/protocols/proofs/v1/messages/index.mjs +5 -0
  201. package/build/protocols/proofs/v1/models/DidCommPresentationV1Preview.d.mts +57 -0
  202. package/build/protocols/proofs/v1/models/DidCommPresentationV1Preview.d.mts.map +1 -0
  203. package/build/protocols/proofs/v1/models/DidCommPresentationV1Preview.mjs +113 -0
  204. package/build/protocols/proofs/v1/models/DidCommPresentationV1Preview.mjs.map +1 -0
  205. package/build/protocols/proofs/v1/models/index.d.mts +1 -0
  206. package/build/protocols/proofs/v1/models/index.mjs +1 -0
  207. package/build/repository/AnonCredsCredentialDefinitionPrivateRecord.d.mts +25 -0
  208. package/build/repository/AnonCredsCredentialDefinitionPrivateRecord.d.mts.map +1 -0
  209. package/build/repository/AnonCredsCredentialDefinitionPrivateRecord.mjs +26 -0
  210. package/build/repository/AnonCredsCredentialDefinitionPrivateRecord.mjs.map +1 -0
  211. package/build/repository/AnonCredsCredentialDefinitionPrivateRepository.d.mts +12 -0
  212. package/build/repository/AnonCredsCredentialDefinitionPrivateRepository.d.mts.map +1 -0
  213. package/build/repository/AnonCredsCredentialDefinitionPrivateRepository.mjs +28 -0
  214. package/build/repository/AnonCredsCredentialDefinitionPrivateRepository.mjs.map +1 -0
  215. package/build/repository/AnonCredsCredentialDefinitionRecord.d.mts +44 -0
  216. package/build/repository/AnonCredsCredentialDefinitionRecord.d.mts.map +1 -0
  217. package/build/repository/AnonCredsCredentialDefinitionRecord.mjs +38 -0
  218. package/build/repository/AnonCredsCredentialDefinitionRecord.mjs.map +1 -0
  219. package/build/repository/AnonCredsCredentialDefinitionRepository.d.mts +12 -0
  220. package/build/repository/AnonCredsCredentialDefinitionRepository.d.mts.map +1 -0
  221. package/build/repository/AnonCredsCredentialDefinitionRepository.mjs +28 -0
  222. package/build/repository/AnonCredsCredentialDefinitionRepository.mjs.map +1 -0
  223. package/build/repository/AnonCredsCredentialRecord.d.mts +53 -0
  224. package/build/repository/AnonCredsCredentialRecord.d.mts.map +1 -0
  225. package/build/repository/AnonCredsCredentialRecord.mjs +46 -0
  226. package/build/repository/AnonCredsCredentialRecord.mjs.map +1 -0
  227. package/build/repository/AnonCredsCredentialRepository.d.mts +14 -0
  228. package/build/repository/AnonCredsCredentialRepository.d.mts.map +1 -0
  229. package/build/repository/AnonCredsCredentialRepository.mjs +34 -0
  230. package/build/repository/AnonCredsCredentialRepository.mjs.map +1 -0
  231. package/build/repository/AnonCredsKeyCorrectnessProofRecord.d.mts +25 -0
  232. package/build/repository/AnonCredsKeyCorrectnessProofRecord.d.mts.map +1 -0
  233. package/build/repository/AnonCredsKeyCorrectnessProofRecord.mjs +26 -0
  234. package/build/repository/AnonCredsKeyCorrectnessProofRecord.mjs.map +1 -0
  235. package/build/repository/AnonCredsKeyCorrectnessProofRepository.d.mts +12 -0
  236. package/build/repository/AnonCredsKeyCorrectnessProofRepository.d.mts.map +1 -0
  237. package/build/repository/AnonCredsKeyCorrectnessProofRepository.mjs +28 -0
  238. package/build/repository/AnonCredsKeyCorrectnessProofRepository.mjs.map +1 -0
  239. package/build/repository/AnonCredsLinkSecretRecord.d.mts +28 -0
  240. package/build/repository/AnonCredsLinkSecretRecord.d.mts.map +1 -0
  241. package/build/repository/AnonCredsLinkSecretRecord.mjs +25 -0
  242. package/build/repository/AnonCredsLinkSecretRecord.mjs.map +1 -0
  243. package/build/repository/AnonCredsLinkSecretRepository.d.mts +14 -0
  244. package/build/repository/AnonCredsLinkSecretRepository.d.mts.map +1 -0
  245. package/build/repository/AnonCredsLinkSecretRepository.mjs +34 -0
  246. package/build/repository/AnonCredsLinkSecretRepository.mjs.map +1 -0
  247. package/build/repository/AnonCredsRevocationRegistryDefinitionPrivateRecord.d.mts +37 -0
  248. package/build/repository/AnonCredsRevocationRegistryDefinitionPrivateRecord.d.mts.map +1 -0
  249. package/build/repository/AnonCredsRevocationRegistryDefinitionPrivateRecord.mjs +35 -0
  250. package/build/repository/AnonCredsRevocationRegistryDefinitionPrivateRecord.mjs.map +1 -0
  251. package/build/repository/AnonCredsRevocationRegistryDefinitionPrivateRepository.d.mts +13 -0
  252. package/build/repository/AnonCredsRevocationRegistryDefinitionPrivateRepository.d.mts.map +1 -0
  253. package/build/repository/AnonCredsRevocationRegistryDefinitionPrivateRepository.mjs +34 -0
  254. package/build/repository/AnonCredsRevocationRegistryDefinitionPrivateRepository.mjs.map +1 -0
  255. package/build/repository/AnonCredsRevocationRegistryDefinitionRecord.d.mts +30 -0
  256. package/build/repository/AnonCredsRevocationRegistryDefinitionRecord.d.mts.map +1 -0
  257. package/build/repository/AnonCredsRevocationRegistryDefinitionRecord.mjs +27 -0
  258. package/build/repository/AnonCredsRevocationRegistryDefinitionRecord.mjs.map +1 -0
  259. package/build/repository/AnonCredsRevocationRegistryDefinitionRepository.d.mts +13 -0
  260. package/build/repository/AnonCredsRevocationRegistryDefinitionRepository.d.mts.map +1 -0
  261. package/build/repository/AnonCredsRevocationRegistryDefinitionRepository.mjs +31 -0
  262. package/build/repository/AnonCredsRevocationRegistryDefinitionRepository.mjs.map +1 -0
  263. package/build/repository/AnonCredsSchemaRecord.d.mts +44 -0
  264. package/build/repository/AnonCredsSchemaRecord.d.mts.map +1 -0
  265. package/build/repository/AnonCredsSchemaRecord.mjs +38 -0
  266. package/build/repository/AnonCredsSchemaRecord.mjs.map +1 -0
  267. package/build/repository/AnonCredsSchemaRepository.d.mts +12 -0
  268. package/build/repository/AnonCredsSchemaRepository.d.mts.map +1 -0
  269. package/build/repository/AnonCredsSchemaRepository.mjs +28 -0
  270. package/build/repository/AnonCredsSchemaRepository.mjs.map +1 -0
  271. package/build/repository/anonCredsCredentialDefinitionRecordMetadataTypes.d.mts +14 -0
  272. package/build/repository/anonCredsCredentialDefinitionRecordMetadataTypes.d.mts.map +1 -0
  273. package/build/repository/anonCredsCredentialDefinitionRecordMetadataTypes.mjs +10 -0
  274. package/build/repository/anonCredsCredentialDefinitionRecordMetadataTypes.mjs.map +1 -0
  275. package/build/repository/anonCredsRevocationRegistryDefinitionRecordMetadataTypes.d.mts +14 -0
  276. package/build/repository/anonCredsRevocationRegistryDefinitionRecordMetadataTypes.d.mts.map +1 -0
  277. package/build/repository/anonCredsRevocationRegistryDefinitionRecordMetadataTypes.mjs +10 -0
  278. package/build/repository/anonCredsRevocationRegistryDefinitionRecordMetadataTypes.mjs.map +1 -0
  279. package/build/repository/anonCredsSchemaRecordMetadataTypes.d.mts +14 -0
  280. package/build/repository/anonCredsSchemaRecordMetadataTypes.d.mts.map +1 -0
  281. package/build/repository/index.d.mts +16 -0
  282. package/build/repository/index.mjs +16 -0
  283. package/build/services/AnonCredsHolderService.d.mts +28 -0
  284. package/build/services/AnonCredsHolderService.d.mts.map +1 -0
  285. package/build/services/AnonCredsHolderService.mjs +6 -0
  286. package/build/services/AnonCredsHolderService.mjs.map +1 -0
  287. package/build/services/AnonCredsHolderServiceOptions.d.mts +107 -0
  288. package/build/services/AnonCredsHolderServiceOptions.d.mts.map +1 -0
  289. package/build/services/AnonCredsIssuerService.d.mts +19 -0
  290. package/build/services/AnonCredsIssuerService.d.mts.map +1 -0
  291. package/build/services/AnonCredsIssuerService.mjs +6 -0
  292. package/build/services/AnonCredsIssuerService.mjs.map +1 -0
  293. package/build/services/AnonCredsIssuerServiceOptions.d.mts +66 -0
  294. package/build/services/AnonCredsIssuerServiceOptions.d.mts.map +1 -0
  295. package/build/services/AnonCredsVerifierService.d.mts +12 -0
  296. package/build/services/AnonCredsVerifierService.d.mts.map +1 -0
  297. package/build/services/AnonCredsVerifierService.mjs +6 -0
  298. package/build/services/AnonCredsVerifierService.mjs.map +1 -0
  299. package/build/services/AnonCredsVerifierServiceOptions.d.mts +30 -0
  300. package/build/services/AnonCredsVerifierServiceOptions.d.mts.map +1 -0
  301. package/build/services/index.d.mts +17 -0
  302. package/build/services/index.mjs +7 -0
  303. package/build/services/registry/AnonCredsRegistry.d.mts +43 -0
  304. package/build/services/registry/AnonCredsRegistry.d.mts.map +1 -0
  305. package/build/services/registry/AnonCredsRegistryService.d.mts +27 -0
  306. package/build/services/registry/AnonCredsRegistryService.d.mts.map +1 -0
  307. package/build/services/registry/AnonCredsRegistryService.mjs +226 -0
  308. package/build/services/registry/AnonCredsRegistryService.mjs.map +1 -0
  309. package/build/services/registry/CredentialDefinitionOptions.d.mts +39 -0
  310. package/build/services/registry/CredentialDefinitionOptions.d.mts.map +1 -0
  311. package/build/services/registry/RevocationRegistryDefinitionOptions.d.mts +39 -0
  312. package/build/services/registry/RevocationRegistryDefinitionOptions.d.mts.map +1 -0
  313. package/build/services/registry/RevocationStatusListOptions.d.mts +37 -0
  314. package/build/services/registry/RevocationStatusListOptions.d.mts.map +1 -0
  315. package/build/services/registry/SchemaOptions.d.mts +39 -0
  316. package/build/services/registry/SchemaOptions.d.mts.map +1 -0
  317. package/build/services/registry/base.d.mts +65 -0
  318. package/build/services/registry/base.d.mts.map +1 -0
  319. package/build/services/registry/index.d.mts +7 -0
  320. package/build/services/registry/index.mjs +1 -0
  321. package/build/services/tails/BasicTailsFileService.d.mts +29 -0
  322. package/build/services/tails/BasicTailsFileService.d.mts.map +1 -0
  323. package/build/services/tails/BasicTailsFileService.mjs +52 -0
  324. package/build/services/tails/BasicTailsFileService.mjs.map +1 -0
  325. package/build/services/tails/TailsFileService.d.mts +48 -0
  326. package/build/services/tails/TailsFileService.d.mts.map +1 -0
  327. package/build/services/tails/index.d.mts +2 -0
  328. package/build/services/tails/index.mjs +1 -0
  329. package/build/updates/0.3.1-0.4/credentialDefinition.mjs +49 -0
  330. package/build/updates/0.3.1-0.4/credentialDefinition.mjs.map +1 -0
  331. package/build/updates/0.3.1-0.4/credentialExchangeRecord.mjs +118 -0
  332. package/build/updates/0.3.1-0.4/credentialExchangeRecord.mjs.map +1 -0
  333. package/build/updates/0.3.1-0.4/index.d.mts +7 -0
  334. package/build/updates/0.3.1-0.4/index.d.mts.map +1 -0
  335. package/build/updates/0.3.1-0.4/index.mjs +16 -0
  336. package/build/updates/0.3.1-0.4/index.mjs.map +1 -0
  337. package/build/updates/0.3.1-0.4/linkSecret.mjs +21 -0
  338. package/build/updates/0.3.1-0.4/linkSecret.mjs.map +1 -0
  339. package/build/updates/0.3.1-0.4/schema.mjs +39 -0
  340. package/build/updates/0.3.1-0.4/schema.mjs.map +1 -0
  341. package/build/updates/0.4-0.5/anonCredsCredentialRecord.mjs +126 -0
  342. package/build/updates/0.4-0.5/anonCredsCredentialRecord.mjs.map +1 -0
  343. package/build/updates/0.4-0.5/index.d.mts +7 -0
  344. package/build/updates/0.4-0.5/index.d.mts.map +1 -0
  345. package/build/updates/0.4-0.5/index.mjs +10 -0
  346. package/build/updates/0.4-0.5/index.mjs.map +1 -0
  347. package/build/utils/anonCredsObjects.d.mts +27 -0
  348. package/build/utils/anonCredsObjects.d.mts.map +1 -0
  349. package/build/utils/anonCredsObjects.mjs +57 -0
  350. package/build/utils/anonCredsObjects.mjs.map +1 -0
  351. package/build/utils/areRequestsEqual.d.mts +1 -0
  352. package/build/utils/areRequestsEqual.mjs +86 -0
  353. package/build/utils/areRequestsEqual.mjs.map +1 -0
  354. package/build/utils/bytesToBigint.mjs +11 -0
  355. package/build/utils/bytesToBigint.mjs.map +1 -0
  356. package/build/utils/composeAutoAccept.d.mts +1 -0
  357. package/build/utils/composeAutoAccept.mjs +25 -0
  358. package/build/utils/composeAutoAccept.mjs.map +1 -0
  359. package/build/utils/createRequestFromPreview.d.mts +2 -0
  360. package/build/utils/createRequestFromPreview.mjs +50 -0
  361. package/build/utils/createRequestFromPreview.mjs.map +1 -0
  362. package/build/utils/credential.d.mts +12 -0
  363. package/build/utils/credential.d.mts.map +1 -0
  364. package/build/utils/credential.mjs +119 -0
  365. package/build/utils/credential.mjs.map +1 -0
  366. package/build/utils/credentialPreviewAttributes.d.mts +1 -0
  367. package/build/utils/credentialPreviewAttributes.mjs +21 -0
  368. package/build/utils/credentialPreviewAttributes.mjs.map +1 -0
  369. package/build/utils/getCredentialsForAnonCredsRequest.d.mts +11 -0
  370. package/build/utils/getCredentialsForAnonCredsRequest.d.mts.map +1 -0
  371. package/build/utils/getCredentialsForAnonCredsRequest.mjs +70 -0
  372. package/build/utils/getCredentialsForAnonCredsRequest.mjs.map +1 -0
  373. package/build/utils/getRevocationRegistries.d.mts +4 -0
  374. package/build/utils/getRevocationRegistries.mjs +121 -0
  375. package/build/utils/getRevocationRegistries.mjs.map +1 -0
  376. package/build/utils/hasDuplicateGroupNames.d.mts +1 -0
  377. package/build/utils/hasDuplicateGroupNames.mjs +22 -0
  378. package/build/utils/hasDuplicateGroupNames.mjs.map +1 -0
  379. package/build/utils/index.d.mts +17 -0
  380. package/build/utils/index.mjs +17 -0
  381. package/build/utils/indyIdentifiers.d.mts +71 -0
  382. package/build/utils/indyIdentifiers.d.mts.map +1 -0
  383. package/build/utils/indyIdentifiers.mjs +249 -0
  384. package/build/utils/indyIdentifiers.mjs.map +1 -0
  385. package/build/utils/isMap.d.mts +1 -0
  386. package/build/utils/isMap.mjs +19 -0
  387. package/build/utils/isMap.mjs.map +1 -0
  388. package/build/utils/linkSecret.d.mts +13 -0
  389. package/build/utils/linkSecret.d.mts.map +1 -0
  390. package/build/utils/linkSecret.mjs +35 -0
  391. package/build/utils/linkSecret.mjs.map +1 -0
  392. package/build/utils/metadata.d.mts +30 -0
  393. package/build/utils/metadata.d.mts.map +1 -0
  394. package/build/utils/metadata.mjs +23 -0
  395. package/build/utils/metadata.mjs.map +1 -0
  396. package/build/utils/proofRequest.mjs +10 -0
  397. package/build/utils/proofRequest.mjs.map +1 -0
  398. package/build/utils/proverDid.d.mts +12 -0
  399. package/build/utils/proverDid.d.mts.map +1 -0
  400. package/build/utils/proverDid.mjs +17 -0
  401. package/build/utils/proverDid.mjs.map +1 -0
  402. package/build/utils/revocationInterval.d.mts +12 -0
  403. package/build/utils/revocationInterval.d.mts.map +1 -0
  404. package/build/utils/revocationInterval.mjs +11 -0
  405. package/build/utils/revocationInterval.mjs.map +1 -0
  406. package/build/utils/sortRequestedCredentialsMatches.d.mts +1 -0
  407. package/build/utils/sortRequestedCredentialsMatches.mjs +22 -0
  408. package/build/utils/sortRequestedCredentialsMatches.mjs.map +1 -0
  409. package/build/utils/timestamp.d.mts +5 -0
  410. package/build/utils/timestamp.d.mts.map +1 -0
  411. package/build/utils/timestamp.mjs +6 -0
  412. package/build/utils/timestamp.mjs.map +1 -0
  413. package/build/utils/w3cAnonCredsUtils.d.mts +28 -0
  414. package/build/utils/w3cAnonCredsUtils.d.mts.map +1 -0
  415. package/build/utils/w3cAnonCredsUtils.mjs +101 -0
  416. package/build/utils/w3cAnonCredsUtils.mjs.map +1 -0
  417. package/package.json +20 -21
  418. package/build/AnonCredsApi.d.ts +0 -97
  419. package/build/AnonCredsApi.js +0 -582
  420. package/build/AnonCredsApi.js.map +0 -1
  421. package/build/AnonCredsApiOptions.d.ts +0 -24
  422. package/build/AnonCredsApiOptions.js +0 -3
  423. package/build/AnonCredsApiOptions.js.map +0 -1
  424. package/build/AnonCredsModule.d.ts +0 -24
  425. package/build/AnonCredsModule.js +0 -56
  426. package/build/AnonCredsModule.js.map +0 -1
  427. package/build/AnonCredsModuleConfig.d.ts +0 -72
  428. package/build/AnonCredsModuleConfig.js +0 -31
  429. package/build/AnonCredsModuleConfig.js.map +0 -1
  430. package/build/anoncreds-rs/AnonCredsDataIntegrityService.d.ts +0 -27
  431. package/build/anoncreds-rs/AnonCredsDataIntegrityService.js +0 -241
  432. package/build/anoncreds-rs/AnonCredsDataIntegrityService.js.map +0 -1
  433. package/build/anoncreds-rs/AnonCredsRsHolderService.d.ts +0 -38
  434. package/build/anoncreds-rs/AnonCredsRsHolderService.js +0 -622
  435. package/build/anoncreds-rs/AnonCredsRsHolderService.js.map +0 -1
  436. package/build/anoncreds-rs/AnonCredsRsIssuerService.d.ts +0 -12
  437. package/build/anoncreds-rs/AnonCredsRsIssuerService.js +0 -253
  438. package/build/anoncreds-rs/AnonCredsRsIssuerService.js.map +0 -1
  439. package/build/anoncreds-rs/AnonCredsRsVerifierService.d.ts +0 -8
  440. package/build/anoncreds-rs/AnonCredsRsVerifierService.js +0 -157
  441. package/build/anoncreds-rs/AnonCredsRsVerifierService.js.map +0 -1
  442. package/build/anoncreds-rs/index.d.ts +0 -3
  443. package/build/anoncreds-rs/index.js +0 -10
  444. package/build/anoncreds-rs/index.js.map +0 -1
  445. package/build/anoncreds-rs/utils.d.ts +0 -23
  446. package/build/anoncreds-rs/utils.js +0 -71
  447. package/build/anoncreds-rs/utils.js.map +0 -1
  448. package/build/error/AnonCredsError.d.ts +0 -6
  449. package/build/error/AnonCredsError.js +0 -11
  450. package/build/error/AnonCredsError.js.map +0 -1
  451. package/build/error/AnonCredsRsError.d.ts +0 -6
  452. package/build/error/AnonCredsRsError.js +0 -11
  453. package/build/error/AnonCredsRsError.js.map +0 -1
  454. package/build/error/AnonCredsStoreRecordError.d.ts +0 -6
  455. package/build/error/AnonCredsStoreRecordError.js +0 -11
  456. package/build/error/AnonCredsStoreRecordError.js.map +0 -1
  457. package/build/error/index.d.ts +0 -3
  458. package/build/error/index.js +0 -20
  459. package/build/error/index.js.map +0 -1
  460. package/build/formats/AnonCredsCredentialFormat.d.ts +0 -79
  461. package/build/formats/AnonCredsCredentialFormat.js +0 -3
  462. package/build/formats/AnonCredsCredentialFormat.js.map +0 -1
  463. package/build/formats/AnonCredsCredentialFormatService.d.ts +0 -80
  464. package/build/formats/AnonCredsCredentialFormatService.js +0 -433
  465. package/build/formats/AnonCredsCredentialFormatService.js.map +0 -1
  466. package/build/formats/AnonCredsProofFormat.d.ts +0 -70
  467. package/build/formats/AnonCredsProofFormat.js +0 -3
  468. package/build/formats/AnonCredsProofFormat.js.map +0 -1
  469. package/build/formats/AnonCredsProofFormatService.d.ts +0 -55
  470. package/build/formats/AnonCredsProofFormatService.js +0 -289
  471. package/build/formats/AnonCredsProofFormatService.js.map +0 -1
  472. package/build/formats/DataIntegrityCredentialFormatService.d.ts +0 -89
  473. package/build/formats/DataIntegrityCredentialFormatService.js +0 -773
  474. package/build/formats/DataIntegrityCredentialFormatService.js.map +0 -1
  475. package/build/formats/LegacyIndyCredentialFormat.d.ts +0 -32
  476. package/build/formats/LegacyIndyCredentialFormat.js +0 -3
  477. package/build/formats/LegacyIndyCredentialFormat.js.map +0 -1
  478. package/build/formats/LegacyIndyCredentialFormatService.d.ts +0 -80
  479. package/build/formats/LegacyIndyCredentialFormatService.js +0 -379
  480. package/build/formats/LegacyIndyCredentialFormatService.js.map +0 -1
  481. package/build/formats/LegacyIndyProofFormat.d.ts +0 -29
  482. package/build/formats/LegacyIndyProofFormat.js +0 -3
  483. package/build/formats/LegacyIndyProofFormat.js.map +0 -1
  484. package/build/formats/LegacyIndyProofFormatService.d.ts +0 -58
  485. package/build/formats/LegacyIndyProofFormatService.js +0 -374
  486. package/build/formats/LegacyIndyProofFormatService.js.map +0 -1
  487. package/build/formats/index.d.ts +0 -9
  488. package/build/formats/index.js +0 -32
  489. package/build/formats/index.js.map +0 -1
  490. package/build/index.d.ts +0 -21
  491. package/build/index.js +0 -54
  492. package/build/index.js.map +0 -1
  493. package/build/models/AnonCredsCredentialProposal.d.ts +0 -62
  494. package/build/models/AnonCredsCredentialProposal.js +0 -81
  495. package/build/models/AnonCredsCredentialProposal.js.map +0 -1
  496. package/build/models/AnonCredsProofRequest.d.ts +0 -27
  497. package/build/models/AnonCredsProofRequest.js +0 -82
  498. package/build/models/AnonCredsProofRequest.js.map +0 -1
  499. package/build/models/AnonCredsRequestedAttribute.d.ts +0 -16
  500. package/build/models/AnonCredsRequestedAttribute.js +0 -56
  501. package/build/models/AnonCredsRequestedAttribute.js.map +0 -1
  502. package/build/models/AnonCredsRequestedPredicate.d.ts +0 -19
  503. package/build/models/AnonCredsRequestedPredicate.js +0 -61
  504. package/build/models/AnonCredsRequestedPredicate.js.map +0 -1
  505. package/build/models/AnonCredsRestriction.d.ts +0 -55
  506. package/build/models/AnonCredsRestriction.js +0 -160
  507. package/build/models/AnonCredsRestriction.js.map +0 -1
  508. package/build/models/AnonCredsRestrictionWrapper.d.ts +0 -4
  509. package/build/models/AnonCredsRestrictionWrapper.js +0 -25
  510. package/build/models/AnonCredsRestrictionWrapper.js.map +0 -1
  511. package/build/models/AnonCredsRevocationInterval.d.ts +0 -5
  512. package/build/models/AnonCredsRevocationInterval.js +0 -33
  513. package/build/models/AnonCredsRevocationInterval.js.map +0 -1
  514. package/build/models/exchange.d.ts +0 -99
  515. package/build/models/exchange.js +0 -5
  516. package/build/models/exchange.js.map +0 -1
  517. package/build/models/index.d.ts +0 -4
  518. package/build/models/index.js +0 -21
  519. package/build/models/index.js.map +0 -1
  520. package/build/models/internal.d.ts +0 -35
  521. package/build/models/internal.js +0 -3
  522. package/build/models/internal.js.map +0 -1
  523. package/build/models/registry.d.ts +0 -39
  524. package/build/models/registry.js +0 -3
  525. package/build/models/registry.js.map +0 -1
  526. package/build/models/utils.d.ts +0 -22
  527. package/build/models/utils.js +0 -3
  528. package/build/models/utils.js.map +0 -1
  529. package/build/protocols/credentials/v1/V1CredentialProtocol.d.ts +0 -162
  530. package/build/protocols/credentials/v1/V1CredentialProtocol.js +0 -948
  531. package/build/protocols/credentials/v1/V1CredentialProtocol.js.map +0 -1
  532. package/build/protocols/credentials/v1/errors/V1CredentialProblemReportError.d.ts +0 -10
  533. package/build/protocols/credentials/v1/errors/V1CredentialProblemReportError.js +0 -18
  534. package/build/protocols/credentials/v1/errors/V1CredentialProblemReportError.js.map +0 -1
  535. package/build/protocols/credentials/v1/errors/index.d.ts +0 -1
  536. package/build/protocols/credentials/v1/errors/index.js +0 -6
  537. package/build/protocols/credentials/v1/errors/index.js.map +0 -1
  538. package/build/protocols/credentials/v1/handlers/V1CredentialAckHandler.d.ts +0 -9
  539. package/build/protocols/credentials/v1/handlers/V1CredentialAckHandler.js +0 -15
  540. package/build/protocols/credentials/v1/handlers/V1CredentialAckHandler.js.map +0 -1
  541. package/build/protocols/credentials/v1/handlers/V1CredentialProblemReportHandler.d.ts +0 -9
  542. package/build/protocols/credentials/v1/handlers/V1CredentialProblemReportHandler.js +0 -15
  543. package/build/protocols/credentials/v1/handlers/V1CredentialProblemReportHandler.js.map +0 -1
  544. package/build/protocols/credentials/v1/handlers/V1IssueCredentialHandler.d.ts +0 -10
  545. package/build/protocols/credentials/v1/handlers/V1IssueCredentialHandler.js +0 -40
  546. package/build/protocols/credentials/v1/handlers/V1IssueCredentialHandler.js.map +0 -1
  547. package/build/protocols/credentials/v1/handlers/V1OfferCredentialHandler.d.ts +0 -10
  548. package/build/protocols/credentials/v1/handlers/V1OfferCredentialHandler.js +0 -33
  549. package/build/protocols/credentials/v1/handlers/V1OfferCredentialHandler.js.map +0 -1
  550. package/build/protocols/credentials/v1/handlers/V1ProposeCredentialHandler.d.ts +0 -10
  551. package/build/protocols/credentials/v1/handlers/V1ProposeCredentialHandler.js +0 -38
  552. package/build/protocols/credentials/v1/handlers/V1ProposeCredentialHandler.js.map +0 -1
  553. package/build/protocols/credentials/v1/handlers/V1RequestCredentialHandler.d.ts +0 -10
  554. package/build/protocols/credentials/v1/handlers/V1RequestCredentialHandler.js +0 -40
  555. package/build/protocols/credentials/v1/handlers/V1RequestCredentialHandler.js.map +0 -1
  556. package/build/protocols/credentials/v1/handlers/index.d.ts +0 -6
  557. package/build/protocols/credentials/v1/handlers/index.js +0 -23
  558. package/build/protocols/credentials/v1/handlers/index.js.map +0 -1
  559. package/build/protocols/credentials/v1/index.d.ts +0 -2
  560. package/build/protocols/credentials/v1/index.js +0 -19
  561. package/build/protocols/credentials/v1/index.js.map +0 -1
  562. package/build/protocols/credentials/v1/messages/V1CredentialAckMessage.d.ts +0 -16
  563. package/build/protocols/credentials/v1/messages/V1CredentialAckMessage.js +0 -34
  564. package/build/protocols/credentials/v1/messages/V1CredentialAckMessage.js.map +0 -1
  565. package/build/protocols/credentials/v1/messages/V1CredentialPreview.d.ts +0 -26
  566. package/build/protocols/credentials/v1/messages/V1CredentialPreview.js +0 -69
  567. package/build/protocols/credentials/v1/messages/V1CredentialPreview.js.map +0 -1
  568. package/build/protocols/credentials/v1/messages/V1CredentialProblemReportMessage.d.ts +0 -16
  569. package/build/protocols/credentials/v1/messages/V1CredentialProblemReportMessage.js +0 -34
  570. package/build/protocols/credentials/v1/messages/V1CredentialProblemReportMessage.js.map +0 -1
  571. package/build/protocols/credentials/v1/messages/V1IssueCredentialMessage.d.ts +0 -19
  572. package/build/protocols/credentials/v1/messages/V1IssueCredentialMessage.js +0 -62
  573. package/build/protocols/credentials/v1/messages/V1IssueCredentialMessage.js.map +0 -1
  574. package/build/protocols/credentials/v1/messages/V1OfferCredentialMessage.d.ts +0 -27
  575. package/build/protocols/credentials/v1/messages/V1OfferCredentialMessage.js +0 -75
  576. package/build/protocols/credentials/v1/messages/V1OfferCredentialMessage.js.map +0 -1
  577. package/build/protocols/credentials/v1/messages/V1ProposeCredentialMessage.d.ts +0 -59
  578. package/build/protocols/credentials/v1/messages/V1ProposeCredentialMessage.js +0 -109
  579. package/build/protocols/credentials/v1/messages/V1ProposeCredentialMessage.js.map +0 -1
  580. package/build/protocols/credentials/v1/messages/V1RequestCredentialMessage.d.ts +0 -19
  581. package/build/protocols/credentials/v1/messages/V1RequestCredentialMessage.js +0 -61
  582. package/build/protocols/credentials/v1/messages/V1RequestCredentialMessage.js.map +0 -1
  583. package/build/protocols/credentials/v1/messages/index.d.ts +0 -7
  584. package/build/protocols/credentials/v1/messages/index.js +0 -24
  585. package/build/protocols/credentials/v1/messages/index.js.map +0 -1
  586. package/build/protocols/index.d.ts +0 -2
  587. package/build/protocols/index.js +0 -19
  588. package/build/protocols/index.js.map +0 -1
  589. package/build/protocols/proofs/v1/V1ProofProtocol.d.ts +0 -50
  590. package/build/protocols/proofs/v1/V1ProofProtocol.js +0 -864
  591. package/build/protocols/proofs/v1/V1ProofProtocol.js.map +0 -1
  592. package/build/protocols/proofs/v1/errors/V1PresentationProblemReportError.d.ts +0 -12
  593. package/build/protocols/proofs/v1/errors/V1PresentationProblemReportError.js +0 -19
  594. package/build/protocols/proofs/v1/errors/V1PresentationProblemReportError.js.map +0 -1
  595. package/build/protocols/proofs/v1/errors/index.d.ts +0 -1
  596. package/build/protocols/proofs/v1/errors/index.js +0 -18
  597. package/build/protocols/proofs/v1/errors/index.js.map +0 -1
  598. package/build/protocols/proofs/v1/handlers/V1PresentationAckHandler.d.ts +0 -9
  599. package/build/protocols/proofs/v1/handlers/V1PresentationAckHandler.js +0 -15
  600. package/build/protocols/proofs/v1/handlers/V1PresentationAckHandler.js.map +0 -1
  601. package/build/protocols/proofs/v1/handlers/V1PresentationHandler.d.ts +0 -10
  602. package/build/protocols/proofs/v1/handlers/V1PresentationHandler.js +0 -40
  603. package/build/protocols/proofs/v1/handlers/V1PresentationHandler.js.map +0 -1
  604. package/build/protocols/proofs/v1/handlers/V1PresentationProblemReportHandler.d.ts +0 -9
  605. package/build/protocols/proofs/v1/handlers/V1PresentationProblemReportHandler.js +0 -15
  606. package/build/protocols/proofs/v1/handlers/V1PresentationProblemReportHandler.js.map +0 -1
  607. package/build/protocols/proofs/v1/handlers/V1ProposePresentationHandler.d.ts +0 -11
  608. package/build/protocols/proofs/v1/handlers/V1ProposePresentationHandler.js +0 -38
  609. package/build/protocols/proofs/v1/handlers/V1ProposePresentationHandler.js.map +0 -1
  610. package/build/protocols/proofs/v1/handlers/V1RequestPresentationHandler.d.ts +0 -10
  611. package/build/protocols/proofs/v1/handlers/V1RequestPresentationHandler.js +0 -35
  612. package/build/protocols/proofs/v1/handlers/V1RequestPresentationHandler.js.map +0 -1
  613. package/build/protocols/proofs/v1/handlers/index.d.ts +0 -5
  614. package/build/protocols/proofs/v1/handlers/index.js +0 -22
  615. package/build/protocols/proofs/v1/handlers/index.js.map +0 -1
  616. package/build/protocols/proofs/v1/index.d.ts +0 -4
  617. package/build/protocols/proofs/v1/index.js +0 -21
  618. package/build/protocols/proofs/v1/index.js.map +0 -1
  619. package/build/protocols/proofs/v1/messages/V1PresentationAckMessage.d.ts +0 -8
  620. package/build/protocols/proofs/v1/messages/V1PresentationAckMessage.js +0 -27
  621. package/build/protocols/proofs/v1/messages/V1PresentationAckMessage.js.map +0 -1
  622. package/build/protocols/proofs/v1/messages/V1PresentationMessage.d.ts +0 -31
  623. package/build/protocols/proofs/v1/messages/V1PresentationMessage.js +0 -67
  624. package/build/protocols/proofs/v1/messages/V1PresentationMessage.js.map +0 -1
  625. package/build/protocols/proofs/v1/messages/V1PresentationProblemReportMessage.d.ts +0 -16
  626. package/build/protocols/proofs/v1/messages/V1PresentationProblemReportMessage.js +0 -34
  627. package/build/protocols/proofs/v1/messages/V1PresentationProblemReportMessage.js.map +0 -1
  628. package/build/protocols/proofs/v1/messages/V1ProposePresentationMessage.d.ts +0 -26
  629. package/build/protocols/proofs/v1/messages/V1ProposePresentationMessage.js +0 -53
  630. package/build/protocols/proofs/v1/messages/V1ProposePresentationMessage.js.map +0 -1
  631. package/build/protocols/proofs/v1/messages/V1RequestPresentationMessage.d.ts +0 -29
  632. package/build/protocols/proofs/v1/messages/V1RequestPresentationMessage.js +0 -65
  633. package/build/protocols/proofs/v1/messages/V1RequestPresentationMessage.js.map +0 -1
  634. package/build/protocols/proofs/v1/messages/index.d.ts +0 -5
  635. package/build/protocols/proofs/v1/messages/index.js +0 -22
  636. package/build/protocols/proofs/v1/messages/index.js.map +0 -1
  637. package/build/protocols/proofs/v1/models/V1PresentationPreview.d.ts +0 -50
  638. package/build/protocols/proofs/v1/models/V1PresentationPreview.js +0 -130
  639. package/build/protocols/proofs/v1/models/V1PresentationPreview.js.map +0 -1
  640. package/build/protocols/proofs/v1/models/index.d.ts +0 -1
  641. package/build/protocols/proofs/v1/models/index.js +0 -18
  642. package/build/protocols/proofs/v1/models/index.js.map +0 -1
  643. package/build/repository/AnonCredsCredentialDefinitionPrivateRecord.d.ts +0 -21
  644. package/build/repository/AnonCredsCredentialDefinitionPrivateRecord.js +0 -23
  645. package/build/repository/AnonCredsCredentialDefinitionPrivateRecord.js.map +0 -1
  646. package/build/repository/AnonCredsCredentialDefinitionPrivateRepository.d.ts +0 -8
  647. package/build/repository/AnonCredsCredentialDefinitionPrivateRepository.js +0 -35
  648. package/build/repository/AnonCredsCredentialDefinitionPrivateRepository.js.map +0 -1
  649. package/build/repository/AnonCredsCredentialDefinitionRecord.d.ts +0 -39
  650. package/build/repository/AnonCredsCredentialDefinitionRecord.js +0 -30
  651. package/build/repository/AnonCredsCredentialDefinitionRecord.js.map +0 -1
  652. package/build/repository/AnonCredsCredentialDefinitionRepository.d.ts +0 -8
  653. package/build/repository/AnonCredsCredentialDefinitionRepository.js +0 -53
  654. package/build/repository/AnonCredsCredentialDefinitionRepository.js.map +0 -1
  655. package/build/repository/AnonCredsCredentialRecord.d.ts +0 -48
  656. package/build/repository/AnonCredsCredentialRecord.js +0 -37
  657. package/build/repository/AnonCredsCredentialRecord.js.map +0 -1
  658. package/build/repository/AnonCredsCredentialRepository.d.ts +0 -10
  659. package/build/repository/AnonCredsCredentialRepository.js +0 -41
  660. package/build/repository/AnonCredsCredentialRepository.js.map +0 -1
  661. package/build/repository/AnonCredsKeyCorrectnessProofRecord.d.ts +0 -21
  662. package/build/repository/AnonCredsKeyCorrectnessProofRecord.js +0 -23
  663. package/build/repository/AnonCredsKeyCorrectnessProofRecord.js.map +0 -1
  664. package/build/repository/AnonCredsKeyCorrectnessProofRepository.d.ts +0 -8
  665. package/build/repository/AnonCredsKeyCorrectnessProofRepository.js +0 -35
  666. package/build/repository/AnonCredsKeyCorrectnessProofRepository.js.map +0 -1
  667. package/build/repository/AnonCredsLinkSecretRecord.d.ts +0 -23
  668. package/build/repository/AnonCredsLinkSecretRecord.js +0 -22
  669. package/build/repository/AnonCredsLinkSecretRecord.js.map +0 -1
  670. package/build/repository/AnonCredsLinkSecretRepository.d.ts +0 -10
  671. package/build/repository/AnonCredsLinkSecretRepository.js +0 -41
  672. package/build/repository/AnonCredsLinkSecretRepository.js.map +0 -1
  673. package/build/repository/AnonCredsRevocationRegistryDefinitionPrivateRecord.d.ts +0 -34
  674. package/build/repository/AnonCredsRevocationRegistryDefinitionPrivateRecord.js +0 -30
  675. package/build/repository/AnonCredsRevocationRegistryDefinitionPrivateRecord.js.map +0 -1
  676. package/build/repository/AnonCredsRevocationRegistryDefinitionPrivateRepository.d.ts +0 -10
  677. package/build/repository/AnonCredsRevocationRegistryDefinitionPrivateRepository.js +0 -38
  678. package/build/repository/AnonCredsRevocationRegistryDefinitionPrivateRepository.js.map +0 -1
  679. package/build/repository/AnonCredsRevocationRegistryDefinitionRecord.d.ts +0 -25
  680. package/build/repository/AnonCredsRevocationRegistryDefinitionRecord.js +0 -23
  681. package/build/repository/AnonCredsRevocationRegistryDefinitionRecord.js.map +0 -1
  682. package/build/repository/AnonCredsRevocationRegistryDefinitionRepository.d.ts +0 -9
  683. package/build/repository/AnonCredsRevocationRegistryDefinitionRepository.js +0 -38
  684. package/build/repository/AnonCredsRevocationRegistryDefinitionRepository.js.map +0 -1
  685. package/build/repository/AnonCredsSchemaRecord.d.ts +0 -39
  686. package/build/repository/AnonCredsSchemaRecord.js +0 -30
  687. package/build/repository/AnonCredsSchemaRecord.js.map +0 -1
  688. package/build/repository/AnonCredsSchemaRepository.d.ts +0 -8
  689. package/build/repository/AnonCredsSchemaRepository.js +0 -53
  690. package/build/repository/AnonCredsSchemaRepository.js.map +0 -1
  691. package/build/repository/anonCredsCredentialDefinitionRecordMetadataTypes.d.ts +0 -9
  692. package/build/repository/anonCredsCredentialDefinitionRecordMetadataTypes.js +0 -9
  693. package/build/repository/anonCredsCredentialDefinitionRecordMetadataTypes.js.map +0 -1
  694. package/build/repository/anonCredsRevocationRegistryDefinitionRecordMetadataTypes.d.ts +0 -9
  695. package/build/repository/anonCredsRevocationRegistryDefinitionRecordMetadataTypes.js +0 -9
  696. package/build/repository/anonCredsRevocationRegistryDefinitionRecordMetadataTypes.js.map +0 -1
  697. package/build/repository/anonCredsSchemaRecordMetadataTypes.d.ts +0 -9
  698. package/build/repository/anonCredsSchemaRecordMetadataTypes.js +0 -9
  699. package/build/repository/anonCredsSchemaRecordMetadataTypes.js.map +0 -1
  700. package/build/repository/index.d.ts +0 -16
  701. package/build/repository/index.js +0 -33
  702. package/build/repository/index.js.map +0 -1
  703. package/build/services/AnonCredsHolderService.d.ts +0 -18
  704. package/build/services/AnonCredsHolderService.js +0 -5
  705. package/build/services/AnonCredsHolderService.js.map +0 -1
  706. package/build/services/AnonCredsHolderServiceOptions.d.ts +0 -101
  707. package/build/services/AnonCredsHolderServiceOptions.js +0 -3
  708. package/build/services/AnonCredsHolderServiceOptions.js.map +0 -1
  709. package/build/services/AnonCredsIssuerService.d.ts +0 -14
  710. package/build/services/AnonCredsIssuerService.js +0 -5
  711. package/build/services/AnonCredsIssuerService.js.map +0 -1
  712. package/build/services/AnonCredsIssuerServiceOptions.d.ts +0 -61
  713. package/build/services/AnonCredsIssuerServiceOptions.js +0 -3
  714. package/build/services/AnonCredsIssuerServiceOptions.js.map +0 -1
  715. package/build/services/AnonCredsVerifierService.d.ts +0 -7
  716. package/build/services/AnonCredsVerifierService.js +0 -5
  717. package/build/services/AnonCredsVerifierService.js.map +0 -1
  718. package/build/services/AnonCredsVerifierServiceOptions.d.ts +0 -25
  719. package/build/services/AnonCredsVerifierServiceOptions.js +0 -3
  720. package/build/services/AnonCredsVerifierServiceOptions.js.map +0 -1
  721. package/build/services/index.d.ts +0 -8
  722. package/build/services/index.js +0 -27
  723. package/build/services/index.js.map +0 -1
  724. package/build/services/registry/AnonCredsRegistry.d.ts +0 -25
  725. package/build/services/registry/AnonCredsRegistry.js +0 -3
  726. package/build/services/registry/AnonCredsRegistry.js.map +0 -1
  727. package/build/services/registry/AnonCredsRegistryService.d.ts +0 -10
  728. package/build/services/registry/AnonCredsRegistryService.js +0 -33
  729. package/build/services/registry/AnonCredsRegistryService.js.map +0 -1
  730. package/build/services/registry/CredentialDefinitionOptions.d.ts +0 -34
  731. package/build/services/registry/CredentialDefinitionOptions.js +0 -3
  732. package/build/services/registry/CredentialDefinitionOptions.js.map +0 -1
  733. package/build/services/registry/RevocationRegistryDefinitionOptions.d.ts +0 -34
  734. package/build/services/registry/RevocationRegistryDefinitionOptions.js +0 -3
  735. package/build/services/registry/RevocationRegistryDefinitionOptions.js.map +0 -1
  736. package/build/services/registry/RevocationStatusListOptions.d.ts +0 -32
  737. package/build/services/registry/RevocationStatusListOptions.js +0 -3
  738. package/build/services/registry/RevocationStatusListOptions.js.map +0 -1
  739. package/build/services/registry/SchemaOptions.d.ts +0 -34
  740. package/build/services/registry/SchemaOptions.js +0 -3
  741. package/build/services/registry/SchemaOptions.js.map +0 -1
  742. package/build/services/registry/base.d.ts +0 -19
  743. package/build/services/registry/base.js +0 -3
  744. package/build/services/registry/base.js.map +0 -1
  745. package/build/services/registry/index.d.ts +0 -7
  746. package/build/services/registry/index.js +0 -23
  747. package/build/services/registry/index.js.map +0 -1
  748. package/build/services/tails/BasicTailsFileService.d.ts +0 -23
  749. package/build/services/tails/BasicTailsFileService.js +0 -65
  750. package/build/services/tails/BasicTailsFileService.js.map +0 -1
  751. package/build/services/tails/TailsFileService.d.ts +0 -42
  752. package/build/services/tails/TailsFileService.js +0 -3
  753. package/build/services/tails/TailsFileService.js.map +0 -1
  754. package/build/services/tails/index.d.ts +0 -2
  755. package/build/services/tails/index.js +0 -19
  756. package/build/services/tails/index.js.map +0 -1
  757. package/build/updates/0.3.1-0.4/credentialDefinition.d.ts +0 -18
  758. package/build/updates/0.3.1-0.4/credentialDefinition.js +0 -56
  759. package/build/updates/0.3.1-0.4/credentialDefinition.js.map +0 -1
  760. package/build/updates/0.3.1-0.4/credentialExchangeRecord.d.ts +0 -69
  761. package/build/updates/0.3.1-0.4/credentialExchangeRecord.js +0 -121
  762. package/build/updates/0.3.1-0.4/credentialExchangeRecord.js.map +0 -1
  763. package/build/updates/0.3.1-0.4/index.d.ts +0 -2
  764. package/build/updates/0.3.1-0.4/index.js +0 -14
  765. package/build/updates/0.3.1-0.4/index.js.map +0 -1
  766. package/build/updates/0.3.1-0.4/linkSecret.d.ts +0 -6
  767. package/build/updates/0.3.1-0.4/linkSecret.js +0 -35
  768. package/build/updates/0.3.1-0.4/linkSecret.js.map +0 -1
  769. package/build/updates/0.3.1-0.4/schema.d.ts +0 -15
  770. package/build/updates/0.3.1-0.4/schema.js +0 -41
  771. package/build/updates/0.3.1-0.4/schema.js.map +0 -1
  772. package/build/updates/0.4-0.5/anonCredsCredentialRecord.d.ts +0 -5
  773. package/build/updates/0.4-0.5/anonCredsCredentialRecord.js +0 -149
  774. package/build/updates/0.4-0.5/anonCredsCredentialRecord.js.map +0 -1
  775. package/build/updates/0.4-0.5/index.d.ts +0 -2
  776. package/build/updates/0.4-0.5/index.js +0 -8
  777. package/build/updates/0.4-0.5/index.js.map +0 -1
  778. package/build/utils/anonCredsObjects.d.ts +0 -26
  779. package/build/utils/anonCredsObjects.js +0 -81
  780. package/build/utils/anonCredsObjects.js.map +0 -1
  781. package/build/utils/areRequestsEqual.d.ts +0 -6
  782. package/build/utils/areRequestsEqual.js +0 -135
  783. package/build/utils/areRequestsEqual.js.map +0 -1
  784. package/build/utils/composeAutoAccept.d.ts +0 -15
  785. package/build/utils/composeAutoAccept.js +0 -26
  786. package/build/utils/composeAutoAccept.js.map +0 -1
  787. package/build/utils/createRequestFromPreview.d.ts +0 -10
  788. package/build/utils/createRequestFromPreview.js +0 -71
  789. package/build/utils/createRequestFromPreview.js.map +0 -1
  790. package/build/utils/credential.d.ts +0 -68
  791. package/build/utils/credential.js +0 -188
  792. package/build/utils/credential.js.map +0 -1
  793. package/build/utils/credentialPreviewAttributes.d.ts +0 -2
  794. package/build/utils/credentialPreviewAttributes.js +0 -24
  795. package/build/utils/credentialPreviewAttributes.js.map +0 -1
  796. package/build/utils/getCredentialsForAnonCredsRequest.d.ts +0 -4
  797. package/build/utils/getCredentialsForAnonCredsRequest.js +0 -81
  798. package/build/utils/getCredentialsForAnonCredsRequest.js.map +0 -1
  799. package/build/utils/getRevocationRegistries.d.ts +0 -14
  800. package/build/utils/getRevocationRegistries.js +0 -151
  801. package/build/utils/getRevocationRegistries.js.map +0 -1
  802. package/build/utils/hasDuplicateGroupNames.d.ts +0 -2
  803. package/build/utils/hasDuplicateGroupNames.js +0 -22
  804. package/build/utils/hasDuplicateGroupNames.js.map +0 -1
  805. package/build/utils/index.d.ts +0 -17
  806. package/build/utils/index.js +0 -48
  807. package/build/utils/index.js.map +0 -1
  808. package/build/utils/indyIdentifiers.d.ts +0 -66
  809. package/build/utils/indyIdentifiers.js +0 -298
  810. package/build/utils/indyIdentifiers.js.map +0 -1
  811. package/build/utils/isMap.d.ts +0 -5
  812. package/build/utils/isMap.js +0 -17
  813. package/build/utils/isMap.js.map +0 -1
  814. package/build/utils/linkSecret.d.ts +0 -9
  815. package/build/utils/linkSecret.js +0 -43
  816. package/build/utils/linkSecret.js.map +0 -1
  817. package/build/utils/metadata.d.ts +0 -35
  818. package/build/utils/metadata.js +0 -24
  819. package/build/utils/metadata.js.map +0 -1
  820. package/build/utils/proofRequest.d.ts +0 -2
  821. package/build/utils/proofRequest.js +0 -21
  822. package/build/utils/proofRequest.js.map +0 -1
  823. package/build/utils/proverDid.d.ts +0 -8
  824. package/build/utils/proverDid.js +0 -15
  825. package/build/utils/proverDid.js.map +0 -1
  826. package/build/utils/revocationInterval.d.ts +0 -7
  827. package/build/utils/revocationInterval.js +0 -14
  828. package/build/utils/revocationInterval.js.map +0 -1
  829. package/build/utils/sortRequestedCredentialsMatches.d.ts +0 -8
  830. package/build/utils/sortRequestedCredentialsMatches.js +0 -31
  831. package/build/utils/sortRequestedCredentialsMatches.js.map +0 -1
  832. package/build/utils/timestamp.d.ts +0 -1
  833. package/build/utils/timestamp.js +0 -7
  834. package/build/utils/timestamp.js.map +0 -1
  835. package/build/utils/w3cAnonCredsUtils.d.ts +0 -37
  836. package/build/utils/w3cAnonCredsUtils.js +0 -132
  837. package/build/utils/w3cAnonCredsUtils.js.map +0 -1
@@ -0,0 +1,121 @@
1
+ import { AnonCredsModuleConfig } from "../AnonCredsModuleConfig.mjs";
2
+ import { AnonCredsRegistryService } from "../services/registry/AnonCredsRegistryService.mjs";
3
+ import "../services/index.mjs";
4
+ import { assertBestPracticeRevocationInterval } from "./revocationInterval.mjs";
5
+ import { CredoError } from "@credo-ts/core";
6
+
7
+ //#region src/utils/getRevocationRegistries.ts
8
+ async function getRevocationRegistriesForRequest(agentContext, proofRequest, selectedCredentials) {
9
+ const revocationRegistries = {};
10
+ let updatedSelectedCredentials = selectedCredentials;
11
+ try {
12
+ agentContext.config.logger.debug("Retrieving revocation registries for proof request", {
13
+ proofRequest,
14
+ selectedCredentials
15
+ });
16
+ const referentCredentials = [];
17
+ for (const [referent, selectedCredential] of Object.entries(selectedCredentials.attributes)) referentCredentials.push({
18
+ type: "attributes",
19
+ referent,
20
+ selectedCredential,
21
+ nonRevoked: proofRequest.requested_attributes[referent].non_revoked ?? proofRequest.non_revoked
22
+ });
23
+ for (const [referent, selectedCredential] of Object.entries(selectedCredentials.predicates)) referentCredentials.push({
24
+ type: "predicates",
25
+ referent,
26
+ selectedCredential,
27
+ nonRevoked: proofRequest.requested_predicates[referent].non_revoked ?? proofRequest.non_revoked
28
+ });
29
+ const revocationRegistryPromises = [];
30
+ for (const { referent, selectedCredential, nonRevoked, type } of referentCredentials) {
31
+ if (!selectedCredential.credentialInfo) throw new CredoError(`Credential for referent '${referent} does not have credential info for revocation state creation`);
32
+ const credentialRevocationId = selectedCredential.credentialInfo.credentialRevocationId;
33
+ const revocationRegistryId = selectedCredential.credentialInfo.revocationRegistryId;
34
+ const timestamp = selectedCredential.timestamp;
35
+ if (nonRevoked && credentialRevocationId && revocationRegistryId) {
36
+ agentContext.config.logger.trace(`Presentation is requesting proof of non revocation for referent '${referent}', creating revocation state for credential`, {
37
+ nonRevoked,
38
+ credentialRevocationId,
39
+ revocationRegistryId,
40
+ timestamp
41
+ });
42
+ assertBestPracticeRevocationInterval(nonRevoked);
43
+ const registry = agentContext.dependencyManager.resolve(AnonCredsRegistryService).getRegistryForIdentifier(agentContext, revocationRegistryId);
44
+ const getRevocationRegistry = async () => {
45
+ if (!revocationRegistries[revocationRegistryId]) {
46
+ const { revocationRegistryDefinition, resolutionMetadata } = await registry.getRevocationRegistryDefinition(agentContext, revocationRegistryId);
47
+ if (!revocationRegistryDefinition) throw new CredoError(`Could not retrieve revocation registry definition for revocation registry ${revocationRegistryId}: ${resolutionMetadata.message}`);
48
+ const { tailsFilePath } = await agentContext.dependencyManager.resolve(AnonCredsModuleConfig).tailsFileService.getTailsFile(agentContext, { revocationRegistryDefinition });
49
+ revocationRegistries[revocationRegistryId] = {
50
+ definition: revocationRegistryDefinition,
51
+ tailsFilePath,
52
+ revocationStatusLists: {}
53
+ };
54
+ }
55
+ const timestampToFetch = timestamp ?? nonRevoked.to;
56
+ if (!revocationRegistries[revocationRegistryId].revocationStatusLists[timestampToFetch]) {
57
+ const { revocationStatusList, resolutionMetadata: statusListResolutionMetadata } = await registry.getRevocationStatusList(agentContext, revocationRegistryId, timestampToFetch);
58
+ if (!revocationStatusList) throw new CredoError(`Could not retrieve revocation status list for revocation registry ${revocationRegistryId}: ${statusListResolutionMetadata.message}`);
59
+ revocationRegistries[revocationRegistryId].revocationStatusLists[revocationStatusList.timestamp] = revocationStatusList;
60
+ if (!timestamp) updatedSelectedCredentials = {
61
+ ...updatedSelectedCredentials,
62
+ [type]: {
63
+ ...updatedSelectedCredentials[type],
64
+ [referent]: {
65
+ ...updatedSelectedCredentials[type][referent],
66
+ timestamp: revocationStatusList.timestamp
67
+ }
68
+ }
69
+ };
70
+ }
71
+ };
72
+ revocationRegistryPromises.push(getRevocationRegistry());
73
+ }
74
+ }
75
+ await Promise.all(revocationRegistryPromises);
76
+ agentContext.config.logger.debug("Retrieved revocation registries for proof request", { revocationRegistries });
77
+ return {
78
+ revocationRegistries,
79
+ updatedSelectedCredentials
80
+ };
81
+ } catch (error) {
82
+ agentContext.config.logger.error("Error retrieving revocation registry for proof request", {
83
+ error,
84
+ proofRequest,
85
+ selectedCredentials
86
+ });
87
+ throw error;
88
+ }
89
+ }
90
+ async function getRevocationRegistriesForProof(agentContext, proof) {
91
+ const revocationRegistries = {};
92
+ const revocationRegistryPromises = [];
93
+ for (const identifier of proof.identifiers) {
94
+ const revocationRegistryId = identifier.rev_reg_id;
95
+ const timestamp = identifier.timestamp;
96
+ if (!revocationRegistryId || !timestamp) continue;
97
+ const registry = agentContext.dependencyManager.resolve(AnonCredsRegistryService).getRegistryForIdentifier(agentContext, revocationRegistryId);
98
+ const getRevocationRegistry = async () => {
99
+ if (!revocationRegistries[revocationRegistryId]) {
100
+ const { revocationRegistryDefinition, resolutionMetadata } = await registry.getRevocationRegistryDefinition(agentContext, revocationRegistryId);
101
+ if (!revocationRegistryDefinition) throw new CredoError(`Could not retrieve revocation registry definition for revocation registry ${revocationRegistryId}: ${resolutionMetadata.message}`);
102
+ revocationRegistries[revocationRegistryId] = {
103
+ definition: revocationRegistryDefinition,
104
+ revocationStatusLists: {}
105
+ };
106
+ }
107
+ if (!revocationRegistries[revocationRegistryId].revocationStatusLists[timestamp]) {
108
+ const { revocationStatusList, resolutionMetadata: statusListResolutionMetadata } = await registry.getRevocationStatusList(agentContext, revocationRegistryId, timestamp);
109
+ if (!revocationStatusList) throw new CredoError(`Could not retrieve revocation status list for revocation registry ${revocationRegistryId}: ${statusListResolutionMetadata.message}`);
110
+ revocationRegistries[revocationRegistryId].revocationStatusLists[timestamp] = revocationStatusList;
111
+ }
112
+ };
113
+ revocationRegistryPromises.push(getRevocationRegistry());
114
+ }
115
+ await Promise.all(revocationRegistryPromises);
116
+ return revocationRegistries;
117
+ }
118
+
119
+ //#endregion
120
+ export { getRevocationRegistriesForProof, getRevocationRegistriesForRequest };
121
+ //# sourceMappingURL=getRevocationRegistries.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getRevocationRegistries.mjs","names":["revocationRegistries: CreateProofOptions['revocationRegistries']","revocationRegistries: VerifyProofOptions['revocationRegistries']"],"sources":["../../src/utils/getRevocationRegistries.ts"],"sourcesContent":["import type { AgentContext } from '@credo-ts/core'\nimport { CredoError } from '@credo-ts/core'\nimport { AnonCredsModuleConfig } from '../AnonCredsModuleConfig'\nimport type { AnonCredsProof, AnonCredsProofRequest, AnonCredsSelectedCredentials } from '../models'\nimport type { CreateProofOptions, VerifyProofOptions } from '../services'\nimport { AnonCredsRegistryService } from '../services'\n\nimport { assertBestPracticeRevocationInterval } from './revocationInterval'\n\nexport async function getRevocationRegistriesForRequest(\n agentContext: AgentContext,\n proofRequest: AnonCredsProofRequest,\n selectedCredentials: AnonCredsSelectedCredentials\n) {\n const revocationRegistries: CreateProofOptions['revocationRegistries'] = {}\n\n // NOTE: we don't want to mutate this object, when modifying we need to always deeply clone objects firsts.\n let updatedSelectedCredentials = selectedCredentials\n\n try {\n agentContext.config.logger.debug('Retrieving revocation registries for proof request', {\n proofRequest,\n selectedCredentials,\n })\n\n const referentCredentials = []\n\n // Retrieve information for referents and push to single array\n for (const [referent, selectedCredential] of Object.entries(selectedCredentials.attributes)) {\n referentCredentials.push({\n type: 'attributes' as const,\n referent,\n selectedCredential,\n nonRevoked: proofRequest.requested_attributes[referent].non_revoked ?? proofRequest.non_revoked,\n })\n }\n for (const [referent, selectedCredential] of Object.entries(selectedCredentials.predicates)) {\n referentCredentials.push({\n type: 'predicates' as const,\n referent,\n selectedCredential,\n nonRevoked: proofRequest.requested_predicates[referent].non_revoked ?? proofRequest.non_revoked,\n })\n }\n\n const revocationRegistryPromises = []\n for (const { referent, selectedCredential, nonRevoked, type } of referentCredentials) {\n if (!selectedCredential.credentialInfo) {\n throw new CredoError(\n `Credential for referent '${referent} does not have credential info for revocation state creation`\n )\n }\n\n // Prefer referent-specific revocation interval over global revocation interval\n const credentialRevocationId = selectedCredential.credentialInfo.credentialRevocationId\n const revocationRegistryId = selectedCredential.credentialInfo.revocationRegistryId\n const timestamp = selectedCredential.timestamp\n\n // If revocation interval is present and the credential is revocable then create revocation state\n if (nonRevoked && credentialRevocationId && revocationRegistryId) {\n agentContext.config.logger.trace(\n `Presentation is requesting proof of non revocation for referent '${referent}', creating revocation state for credential`,\n {\n nonRevoked,\n credentialRevocationId,\n revocationRegistryId,\n timestamp,\n }\n )\n\n // Make sure the revocation interval follows best practices from Aries RFC 0441\n assertBestPracticeRevocationInterval(nonRevoked)\n\n const registry = agentContext.dependencyManager\n .resolve(AnonCredsRegistryService)\n .getRegistryForIdentifier(agentContext, revocationRegistryId)\n\n const getRevocationRegistry = async () => {\n // Fetch revocation registry definition if not in revocation registries list yet\n if (!revocationRegistries[revocationRegistryId]) {\n const { revocationRegistryDefinition, resolutionMetadata } = await registry.getRevocationRegistryDefinition(\n agentContext,\n revocationRegistryId\n )\n if (!revocationRegistryDefinition) {\n throw new CredoError(\n `Could not retrieve revocation registry definition for revocation registry ${revocationRegistryId}: ${resolutionMetadata.message}`\n )\n }\n\n const tailsFileService = agentContext.dependencyManager.resolve(AnonCredsModuleConfig).tailsFileService\n const { tailsFilePath } = await tailsFileService.getTailsFile(agentContext, {\n revocationRegistryDefinition,\n })\n\n // const tails = await this.indyUtilitiesService.downloadTails(tailsHash, tailsLocation)\n revocationRegistries[revocationRegistryId] = {\n definition: revocationRegistryDefinition,\n tailsFilePath,\n revocationStatusLists: {},\n }\n }\n\n // In most cases we will have a timestamp, but if it's not defined, we use the nonRevoked.to value\n const timestampToFetch = timestamp ?? nonRevoked.to\n\n // Fetch revocation status list if we don't already have a revocation status list for the given timestamp\n if (!revocationRegistries[revocationRegistryId].revocationStatusLists[timestampToFetch]) {\n const { revocationStatusList, resolutionMetadata: statusListResolutionMetadata } =\n await registry.getRevocationStatusList(agentContext, revocationRegistryId, timestampToFetch)\n\n if (!revocationStatusList) {\n throw new CredoError(\n `Could not retrieve revocation status list for revocation registry ${revocationRegistryId}: ${statusListResolutionMetadata.message}`\n )\n }\n\n revocationRegistries[revocationRegistryId].revocationStatusLists[revocationStatusList.timestamp] =\n revocationStatusList\n\n // If we don't have a timestamp on the selected credential, we set it to the timestamp of the revocation status list\n // this way we know which revocation status list to use when creating the proof.\n if (!timestamp) {\n updatedSelectedCredentials = {\n ...updatedSelectedCredentials,\n [type]: {\n ...updatedSelectedCredentials[type],\n [referent]: {\n ...updatedSelectedCredentials[type][referent],\n timestamp: revocationStatusList.timestamp,\n },\n },\n }\n }\n }\n }\n revocationRegistryPromises.push(getRevocationRegistry())\n }\n }\n // await all revocation registry statuses asynchronously\n await Promise.all(revocationRegistryPromises)\n agentContext.config.logger.debug('Retrieved revocation registries for proof request', {\n revocationRegistries,\n })\n\n return { revocationRegistries, updatedSelectedCredentials }\n } catch (error) {\n agentContext.config.logger.error('Error retrieving revocation registry for proof request', {\n error,\n proofRequest,\n selectedCredentials,\n })\n\n throw error\n }\n}\n\nexport async function getRevocationRegistriesForProof(agentContext: AgentContext, proof: AnonCredsProof) {\n const revocationRegistries: VerifyProofOptions['revocationRegistries'] = {}\n\n const revocationRegistryPromises = []\n for (const identifier of proof.identifiers) {\n const revocationRegistryId = identifier.rev_reg_id\n const timestamp = identifier.timestamp\n\n // Skip if no revocation registry id is present\n if (!revocationRegistryId || !timestamp) continue\n\n const registry = agentContext.dependencyManager\n .resolve(AnonCredsRegistryService)\n .getRegistryForIdentifier(agentContext, revocationRegistryId)\n\n const getRevocationRegistry = async () => {\n // Fetch revocation registry definition if not already fetched\n if (!revocationRegistries[revocationRegistryId]) {\n const { revocationRegistryDefinition, resolutionMetadata } = await registry.getRevocationRegistryDefinition(\n agentContext,\n revocationRegistryId\n )\n if (!revocationRegistryDefinition) {\n throw new CredoError(\n `Could not retrieve revocation registry definition for revocation registry ${revocationRegistryId}: ${resolutionMetadata.message}`\n )\n }\n\n revocationRegistries[revocationRegistryId] = {\n definition: revocationRegistryDefinition,\n revocationStatusLists: {},\n }\n }\n\n // Fetch revocation status list by timestamp if not already fetched\n if (!revocationRegistries[revocationRegistryId].revocationStatusLists[timestamp]) {\n const { revocationStatusList, resolutionMetadata: statusListResolutionMetadata } =\n await registry.getRevocationStatusList(agentContext, revocationRegistryId, timestamp)\n\n if (!revocationStatusList) {\n throw new CredoError(\n `Could not retrieve revocation status list for revocation registry ${revocationRegistryId}: ${statusListResolutionMetadata.message}`\n )\n }\n\n revocationRegistries[revocationRegistryId].revocationStatusLists[timestamp] = revocationStatusList\n }\n }\n revocationRegistryPromises.push(getRevocationRegistry())\n }\n await Promise.all(revocationRegistryPromises)\n return revocationRegistries\n}\n"],"mappings":";;;;;;;AASA,eAAsB,kCACpB,cACA,cACA,qBACA;CACA,MAAMA,uBAAmE,EAAE;CAG3E,IAAI,6BAA6B;AAEjC,KAAI;AACF,eAAa,OAAO,OAAO,MAAM,sDAAsD;GACrF;GACA;GACD,CAAC;EAEF,MAAM,sBAAsB,EAAE;AAG9B,OAAK,MAAM,CAAC,UAAU,uBAAuB,OAAO,QAAQ,oBAAoB,WAAW,CACzF,qBAAoB,KAAK;GACv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SAAS,wBAAwB,cAAc,sBAAsB,UAAU;AAEvF,QAAI,CAAC,qBACH,OAAM,IAAI,WACR,qEAAqE,qBAAqB,IAAI,6BAA6B,UAC5H;AAGH,yBAAqB,sBAAsB,sBAAsB,aAAa;;;AAGlF,6BAA2B,KAAK,uBAAuB,CAAC;;AAE1D,OAAM,QAAQ,IAAI,2BAA2B;AAC7C,QAAO"}
@@ -0,0 +1 @@
1
+ import "../models/index.mjs";
@@ -0,0 +1,22 @@
1
+ import { CredoError } from "@credo-ts/core";
2
+
3
+ //#region src/utils/hasDuplicateGroupNames.ts
4
+ function attributeNamesToArray(proofRequest) {
5
+ return Object.values(proofRequest.requested_attributes).reduce((names, a) => {
6
+ if (a.name) names.push(a.name);
7
+ else if (a.names) names.push(...a.names);
8
+ return names;
9
+ }, []);
10
+ }
11
+ function predicateNamesToArray(proofRequest) {
12
+ return Array.from(new Set(Object.values(proofRequest.requested_predicates).map((a) => a.name)));
13
+ }
14
+ function assertNoDuplicateGroupsNamesInProofRequest(proofRequest) {
15
+ const attributes = attributeNamesToArray(proofRequest);
16
+ const duplicates = predicateNamesToArray(proofRequest).filter((item) => attributes.indexOf(item) !== -1);
17
+ if (duplicates.length > 0) throw new CredoError(`The proof request contains duplicate predicates and attributes: ${duplicates.toString()}`);
18
+ }
19
+
20
+ //#endregion
21
+ export { assertNoDuplicateGroupsNamesInProofRequest };
22
+ //# sourceMappingURL=hasDuplicateGroupNames.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hasDuplicateGroupNames.mjs","names":[],"sources":["../../src/utils/hasDuplicateGroupNames.ts"],"sourcesContent":["import { CredoError } from '@credo-ts/core'\nimport type { AnonCredsProofRequest } from '../models'\n\nfunction attributeNamesToArray(proofRequest: AnonCredsProofRequest) {\n // Attributes can contain either a `name` string value or an `names` string array. We reduce it to a single array\n // containing all attribute names from the requested attributes.\n return Object.values(proofRequest.requested_attributes).reduce<string[]>((names, a) => {\n if (a.name) {\n names.push(a.name)\n } else if (a.names) {\n names.push(...a.names) // Push all names if `a.names` is an array\n }\n return names\n }, [])\n}\n\nfunction predicateNamesToArray(proofRequest: AnonCredsProofRequest) {\n return Array.from(new Set(Object.values(proofRequest.requested_predicates).map((a) => a.name)))\n}\n\n// TODO: This is still not ideal. The requested groups can specify different credentials using restrictions.\nexport function assertNoDuplicateGroupsNamesInProofRequest(proofRequest: AnonCredsProofRequest) {\n const attributes = attributeNamesToArray(proofRequest)\n const predicates = predicateNamesToArray(proofRequest)\n\n const duplicates = predicates.filter((item) => attributes.indexOf(item) !== -1)\n if (duplicates.length > 0) {\n throw new CredoError(`The proof request contains duplicate predicates and attributes: ${duplicates.toString()}`)\n }\n}\n"],"mappings":";;;AAGA,SAAS,sBAAsB,cAAqC;AAGlE,QAAO,OAAO,OAAO,aAAa,qBAAqB,CAAC,QAAkB,OAAO,MAAM;AACrF,MAAI,EAAE,KACJ,OAAM,KAAK,EAAE,KAAK;WACT,EAAE,MACX,OAAM,KAAK,GAAG,EAAE,MAAM;AAExB,SAAO;IACN,EAAE,CAAC;;AAGR,SAAS,sBAAsB,cAAqC;AAClE,QAAO,MAAM,KAAK,IAAI,IAAI,OAAO,OAAO,aAAa,qBAAqB,CAAC,KAAK,MAAM,EAAE,KAAK,CAAC,CAAC;;AAIjG,SAAgB,2CAA2C,cAAqC;CAC9F,MAAM,aAAa,sBAAsB,aAAa;CAGtD,MAAM,aAFa,sBAAsB,aAAa,CAExB,QAAQ,SAAS,WAAW,QAAQ,KAAK,KAAK,GAAG;AAC/E,KAAI,WAAW,SAAS,EACtB,OAAM,IAAI,WAAW,mEAAmE,WAAW,UAAU,GAAG"}
@@ -0,0 +1,17 @@
1
+ import { AnonCredsCredentialValue } from "./credential.mjs";
2
+ import { AnonCredsCredentialMetadata, AnonCredsCredentialMetadataKey, AnonCredsCredentialRequestMetadata, W3cAnonCredsCredentialMetadataKey } from "./metadata.mjs";
3
+ import { fetchCredentialDefinition, fetchRevocationRegistryDefinition, fetchRevocationStatusList, fetchSchema } from "./anonCredsObjects.mjs";
4
+ import "./areRequestsEqual.mjs";
5
+ import "./composeAutoAccept.mjs";
6
+ import "./createRequestFromPreview.mjs";
7
+ import "./credentialPreviewAttributes.mjs";
8
+ import { getCredentialsForAnonCredsProofRequest } from "./getCredentialsForAnonCredsRequest.mjs";
9
+ import "./getRevocationRegistries.mjs";
10
+ import "./hasDuplicateGroupNames.mjs";
11
+ import { unqualifiedCredentialDefinitionIdRegex, unqualifiedIndyDidRegex, unqualifiedSchemaIdRegex, unqualifiedSchemaVersionRegex } from "./indyIdentifiers.mjs";
12
+ import "./isMap.mjs";
13
+ import { storeLinkSecret } from "./linkSecret.mjs";
14
+ import { assertBestPracticeRevocationInterval } from "./revocationInterval.mjs";
15
+ import "./sortRequestedCredentialsMatches.mjs";
16
+ import { dateToTimestamp } from "./timestamp.mjs";
17
+ import "./w3cAnonCredsUtils.mjs";
@@ -0,0 +1,17 @@
1
+ import { unqualifiedCredentialDefinitionIdRegex, unqualifiedIndyDidRegex, unqualifiedSchemaIdRegex, unqualifiedSchemaVersionRegex } from "./indyIdentifiers.mjs";
2
+ import { fetchCredentialDefinition, fetchRevocationRegistryDefinition, fetchRevocationStatusList, fetchSchema } from "./anonCredsObjects.mjs";
3
+ import { areAnonCredsProofRequestsEqual } from "./areRequestsEqual.mjs";
4
+ import { composeCredentialAutoAccept, composeProofAutoAccept } from "./composeAutoAccept.mjs";
5
+ import { createRequestFromPreview } from "./createRequestFromPreview.mjs";
6
+ import { checkValidCredentialValueEncoding } from "./credential.mjs";
7
+ import { areCredentialPreviewAttributesEqual } from "./credentialPreviewAttributes.mjs";
8
+ import { assertBestPracticeRevocationInterval } from "./revocationInterval.mjs";
9
+ import { sortRequestedCredentialsMatches } from "./sortRequestedCredentialsMatches.mjs";
10
+ import { dateToTimestamp } from "./timestamp.mjs";
11
+ import { getCredentialsForAnonCredsProofRequest } from "./getCredentialsForAnonCredsRequest.mjs";
12
+ import { getRevocationRegistriesForProof, getRevocationRegistriesForRequest } from "./getRevocationRegistries.mjs";
13
+ import { assertNoDuplicateGroupsNamesInProofRequest } from "./hasDuplicateGroupNames.mjs";
14
+ import { IsMap } from "./isMap.mjs";
15
+ import { storeLinkSecret } from "./linkSecret.mjs";
16
+ import { AnonCredsCredentialMetadataKey, AnonCredsCredentialRequestMetadataKey, W3cAnonCredsCredentialMetadataKey } from "./metadata.mjs";
17
+ import { getW3cRecordAnonCredsTags } from "./w3cAnonCredsUtils.mjs";
@@ -0,0 +1,71 @@
1
+ import { AnonCredsCredentialDefinition, AnonCredsRevocationRegistryDefinition, AnonCredsSchema } from "../models/registry.mjs";
2
+ import "../models/index.mjs";
3
+
4
+ //#region src/utils/indyIdentifiers.d.ts
5
+ declare const unqualifiedSchemaIdRegex: RegExp;
6
+ declare const didIndySchemaIdRegex: RegExp;
7
+ declare const unqualifiedSchemaVersionRegex: RegExp;
8
+ declare const unqualifiedIndyDidRegex: RegExp;
9
+ declare const unqualifiedCredentialDefinitionIdRegex: RegExp;
10
+ declare const didIndyCredentialDefinitionIdRegex: RegExp;
11
+ declare const unqualifiedRevocationRegistryIdRegex: RegExp;
12
+ declare const didIndyRevocationRegistryIdRegex: RegExp;
13
+ declare const didIndyRegex: RegExp;
14
+ declare function getUnqualifiedSchemaId(unqualifiedDid: string, name: string, version: string): string;
15
+ declare function getUnqualifiedCredentialDefinitionId(unqualifiedDid: string, schemaSeqNo: string | number, tag: string): string;
16
+ declare function getUnqualifiedRevocationRegistryDefinitionId(unqualifiedDid: string, schemaSeqNo: string | number, credentialDefinitionTag: string, revocationRegistryTag: string): string;
17
+ declare function isUnqualifiedIndyDid(did: string): boolean;
18
+ declare function isUnqualifiedCredentialDefinitionId(credentialDefinitionId: string): boolean;
19
+ declare function isUnqualifiedRevocationRegistryId(revocationRegistryId: string): boolean;
20
+ declare function isUnqualifiedSchemaId(schemaId: string): boolean;
21
+ declare function isDidIndySchemaId(schemaId: string): boolean;
22
+ declare function isDidIndyCredentialDefinitionId(credentialDefinitionId: string): boolean;
23
+ declare function isDidIndyRevocationRegistryId(revocationRegistryId: string): boolean;
24
+ declare function parseIndyDid(did: string): {
25
+ namespace: string;
26
+ namespaceIdentifier: string;
27
+ };
28
+ interface ParsedIndySchemaId {
29
+ did: string;
30
+ namespaceIdentifier: string;
31
+ schemaName: string;
32
+ schemaVersion: string;
33
+ namespace?: string;
34
+ }
35
+ declare function parseIndySchemaId(schemaId: string): ParsedIndySchemaId;
36
+ interface ParsedIndyCredentialDefinitionId {
37
+ did: string;
38
+ namespaceIdentifier: string;
39
+ schemaSeqNo: string;
40
+ tag: string;
41
+ namespace?: string;
42
+ }
43
+ declare function parseIndyCredentialDefinitionId(credentialDefinitionId: string): ParsedIndyCredentialDefinitionId;
44
+ interface ParsedIndyRevocationRegistryId {
45
+ did: string;
46
+ namespaceIdentifier: string;
47
+ schemaSeqNo: string;
48
+ credentialDefinitionTag: string;
49
+ revocationRegistryTag: string;
50
+ namespace?: string;
51
+ }
52
+ declare function parseIndyRevocationRegistryId(revocationRegistryId: string): ParsedIndyRevocationRegistryId;
53
+ declare function getIndyNamespaceFromIndyDid(identifier: string): string;
54
+ declare function getUnQualifiedDidIndyDid(identifier: string): string;
55
+ declare function isIndyDid(identifier: string): boolean;
56
+ declare function getQualifiedDidIndyDid(identifier: string, namespace: string): string;
57
+ declare function isUnqualifiedDidIndySchema(schema: AnonCredsSchema): boolean;
58
+ declare function getUnqualifiedDidIndySchema(schema: AnonCredsSchema): AnonCredsSchema;
59
+ declare function isQualifiedDidIndySchema(schema: AnonCredsSchema): boolean;
60
+ declare function getQualifiedDidIndySchema(schema: AnonCredsSchema, namespace: string): AnonCredsSchema;
61
+ declare function isUnqualifiedDidIndyCredentialDefinition(anonCredsCredentialDefinition: AnonCredsCredentialDefinition): boolean;
62
+ declare function getUnqualifiedDidIndyCredentialDefinition(anonCredsCredentialDefinition: AnonCredsCredentialDefinition): AnonCredsCredentialDefinition;
63
+ declare function isQualifiedDidIndyCredentialDefinition(anonCredsCredentialDefinition: AnonCredsCredentialDefinition): boolean;
64
+ declare function getQualifiedDidIndyCredentialDefinition(anonCredsCredentialDefinition: AnonCredsCredentialDefinition, namespace: string): AnonCredsCredentialDefinition;
65
+ declare function isUnqualifiedDidIndyRevocationRegistryDefinition(revocationRegistryDefinition: AnonCredsRevocationRegistryDefinition): boolean;
66
+ declare function getUnqualifiedDidIndyRevocationRegistryDefinition(revocationRegistryDefinition: AnonCredsRevocationRegistryDefinition): AnonCredsRevocationRegistryDefinition;
67
+ declare function isQualifiedRevocationRegistryDefinition(revocationRegistryDefinition: AnonCredsRevocationRegistryDefinition): boolean;
68
+ declare function getQualifiedDidIndyRevocationRegistryDefinition(revocationRegistryDefinition: AnonCredsRevocationRegistryDefinition, namespace: string): AnonCredsRevocationRegistryDefinition;
69
+ //#endregion
70
+ export { didIndyCredentialDefinitionIdRegex, didIndyRegex, didIndyRevocationRegistryIdRegex, didIndySchemaIdRegex, getIndyNamespaceFromIndyDid, getQualifiedDidIndyCredentialDefinition, getQualifiedDidIndyDid, getQualifiedDidIndyRevocationRegistryDefinition, getQualifiedDidIndySchema, getUnQualifiedDidIndyDid, getUnqualifiedCredentialDefinitionId, getUnqualifiedDidIndyCredentialDefinition, getUnqualifiedDidIndyRevocationRegistryDefinition, getUnqualifiedDidIndySchema, getUnqualifiedRevocationRegistryDefinitionId, getUnqualifiedSchemaId, isDidIndyCredentialDefinitionId, isDidIndyRevocationRegistryId, isDidIndySchemaId, isIndyDid, isQualifiedDidIndyCredentialDefinition, isQualifiedDidIndySchema, isQualifiedRevocationRegistryDefinition, isUnqualifiedCredentialDefinitionId, isUnqualifiedDidIndyCredentialDefinition, isUnqualifiedDidIndyRevocationRegistryDefinition, isUnqualifiedDidIndySchema, isUnqualifiedIndyDid, isUnqualifiedRevocationRegistryId, isUnqualifiedSchemaId, parseIndyCredentialDefinitionId, parseIndyDid, parseIndyRevocationRegistryId, parseIndySchemaId, unqualifiedCredentialDefinitionIdRegex, unqualifiedIndyDidRegex, unqualifiedRevocationRegistryIdRegex, unqualifiedSchemaIdRegex, unqualifiedSchemaVersionRegex };
71
+ //# sourceMappingURL=indyIdentifiers.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"indyIdentifiers.d.mts","names":[],"sources":["../../src/utils/indyIdentifiers.ts"],"sourcesContent":[],"mappings":";;;;cAOa,0BAAwB;cAExB,sBAAoB;cAEpB,+BAA6B;AAJ7B,cAKA,uBALwB,EAKD,MAL6C;AAEpE,cAMA,sCAN2F,EAMrD,MANqD;AAE3F,cAMA,kCAN4D,EAM1B,MAN0B;AAC5D,cAUA,oCAV2D,EAUvB,MAVuB;AAG3D,cAUA,gCAVyF,EAUzD,MAVM;AAEtC,cAYA,YAZA,EAYY,MAVxB;AAGY,iBASG,sBAAA,CARqE,cADpC,EACoC,MAAA,EAAA,IAAA,EAAA,MAAA,EAAA,OAAA,EAAA,MAAA,CAAA,EAAA,MAAA;AAExE,iBAUG,oCAAA,CARf,cAAA,EAAA,MAAA,EAAA,WAAA,EAAA,MAAA,GAAA,MAAA,EAAA,GAAA,EAAA,MAAA,CAAA,EAAA,MAAA;AAEY,iBAeG,4CAAA,CAfmG,cAAA,EAAA,MAAA,EAAA,WAAA,EAAA,MAAA,GAAA,MAAA,EAAA,uBAAA,EAAA,MAAA,EAAA,qBAAA,EAAA,MAAA,CAAA,EAAA,MAAA;AAEnG,iBAsBA,oBAAA,CAtBsB,GAAA,EAAA,MAAA,CAAA,EAAA,OAAA;AAItB,iBAsBA,mCAAA,CAtBoC,sBAAA,EAAA,MAAA,CAAA,EAAA,OAAA;AASpC,iBAiBA,iCAAA,CAjB4C,oBAAA,EAAA,MAAA,CAAA,EAAA,OAAA;AAS5C,iBAYA,qBAAA,CAZoB,QAAA,EAAA,MAAA,CAAA,EAAA,OAAA;AAIpB,iBAYA,iBAAA,CAZmC,QAAA,EAAA,MAAA,CAAA,EAAA,OAAA;AAInC,iBAYA,+BAAA,CAZiC,sBAAA,EAAA,MAAA,CAAA,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B"}
@@ -0,0 +1,249 @@
1
+ import { CredoError } from "@credo-ts/core";
2
+
3
+ //#region src/utils/indyIdentifiers.ts
4
+ const didIndyAnonCredsBase = /(did:indy:((?:[a-z][_a-z0-9-]*)(?::[a-z][_a-z0-9-]*)?):([1-9A-HJ-NP-Za-km-z]{21,22}))\/anoncreds\/v0/;
5
+ const unqualifiedSchemaIdRegex = /^([a-zA-Z0-9]{21,22}):2:(.+):([0-9.]+)$/;
6
+ const didIndySchemaIdRegex = /* @__PURE__ */ new RegExp(`^${didIndyAnonCredsBase.source}/SCHEMA/(.+)/([0-9.]+)$`);
7
+ const unqualifiedSchemaVersionRegex = /^(\d+\.)?(\d+\.)?(\*|\d+)$/;
8
+ const unqualifiedIndyDidRegex = /^(did:sov:)?[a-zA-Z0-9]{21,22}$/;
9
+ const unqualifiedCredentialDefinitionIdRegex = /^([a-zA-Z0-9]{21,22}):3:CL:([1-9][0-9]*):(.+)$/;
10
+ const didIndyCredentialDefinitionIdRegex = /* @__PURE__ */ new RegExp(`^${didIndyAnonCredsBase.source}/CLAIM_DEF/([1-9][0-9]*)/(.+)$`);
11
+ const unqualifiedRevocationRegistryIdRegex = /^([a-zA-Z0-9]{21,22}):4:[a-zA-Z0-9]{21,22}:3:CL:([1-9][0-9]*):(.+):CL_ACCUM:(.+)$/;
12
+ const didIndyRevocationRegistryIdRegex = /* @__PURE__ */ new RegExp(`^${didIndyAnonCredsBase.source}/REV_REG_DEF/([1-9][0-9]*)/(.+)/(.+)$`);
13
+ const didIndyRegex = /^did:indy:((?:[a-z][_a-z0-9-]*)(?::[a-z][_a-z0-9-]*)?):([1-9A-HJ-NP-Za-km-z]{21,22})$/;
14
+ function getUnqualifiedSchemaId(unqualifiedDid, name, version) {
15
+ return `${unqualifiedDid}:2:${name}:${version}`;
16
+ }
17
+ function getUnqualifiedCredentialDefinitionId(unqualifiedDid, schemaSeqNo, tag) {
18
+ return `${unqualifiedDid}:3:CL:${schemaSeqNo}:${tag}`;
19
+ }
20
+ function getUnqualifiedRevocationRegistryDefinitionId(unqualifiedDid, schemaSeqNo, credentialDefinitionTag, revocationRegistryTag) {
21
+ return `${unqualifiedDid}:4:${unqualifiedDid}:3:CL:${schemaSeqNo}:${credentialDefinitionTag}:CL_ACCUM:${revocationRegistryTag}`;
22
+ }
23
+ function isUnqualifiedIndyDid(did) {
24
+ return unqualifiedIndyDidRegex.test(did);
25
+ }
26
+ function isUnqualifiedCredentialDefinitionId(credentialDefinitionId) {
27
+ return unqualifiedCredentialDefinitionIdRegex.test(credentialDefinitionId);
28
+ }
29
+ function isUnqualifiedRevocationRegistryId(revocationRegistryId) {
30
+ return unqualifiedRevocationRegistryIdRegex.test(revocationRegistryId);
31
+ }
32
+ function isUnqualifiedSchemaId(schemaId) {
33
+ return unqualifiedSchemaIdRegex.test(schemaId);
34
+ }
35
+ function isDidIndySchemaId(schemaId) {
36
+ return didIndySchemaIdRegex.test(schemaId);
37
+ }
38
+ function isDidIndyCredentialDefinitionId(credentialDefinitionId) {
39
+ return didIndyCredentialDefinitionIdRegex.test(credentialDefinitionId);
40
+ }
41
+ function isDidIndyRevocationRegistryId(revocationRegistryId) {
42
+ return didIndyRevocationRegistryIdRegex.test(revocationRegistryId);
43
+ }
44
+ function parseIndyDid(did) {
45
+ const match = did.match(didIndyRegex);
46
+ if (match) {
47
+ const [, namespace, namespaceIdentifier] = match;
48
+ return {
49
+ namespace,
50
+ namespaceIdentifier
51
+ };
52
+ }
53
+ throw new CredoError(`${did} is not a valid did:indy did`);
54
+ }
55
+ function parseIndySchemaId(schemaId) {
56
+ const didIndyMatch = schemaId.match(didIndySchemaIdRegex);
57
+ if (didIndyMatch) {
58
+ const [, did, namespace, namespaceIdentifier, schemaName, schemaVersion] = didIndyMatch;
59
+ return {
60
+ did,
61
+ namespaceIdentifier,
62
+ schemaName,
63
+ schemaVersion,
64
+ namespace
65
+ };
66
+ }
67
+ const legacyMatch = schemaId.match(unqualifiedSchemaIdRegex);
68
+ if (legacyMatch) {
69
+ const [, did, schemaName, schemaVersion] = legacyMatch;
70
+ return {
71
+ did,
72
+ namespaceIdentifier: did,
73
+ schemaName,
74
+ schemaVersion
75
+ };
76
+ }
77
+ throw new Error(`Invalid schema id: ${schemaId}`);
78
+ }
79
+ function parseIndyCredentialDefinitionId(credentialDefinitionId) {
80
+ const didIndyMatch = credentialDefinitionId.match(didIndyCredentialDefinitionIdRegex);
81
+ if (didIndyMatch) {
82
+ const [, did, namespace, namespaceIdentifier, schemaSeqNo, tag] = didIndyMatch;
83
+ return {
84
+ did,
85
+ namespaceIdentifier,
86
+ schemaSeqNo,
87
+ tag,
88
+ namespace
89
+ };
90
+ }
91
+ const legacyMatch = credentialDefinitionId.match(unqualifiedCredentialDefinitionIdRegex);
92
+ if (legacyMatch) {
93
+ const [, did, schemaSeqNo, tag] = legacyMatch;
94
+ return {
95
+ did,
96
+ namespaceIdentifier: did,
97
+ schemaSeqNo,
98
+ tag
99
+ };
100
+ }
101
+ throw new Error(`Invalid credential definition id: ${credentialDefinitionId}`);
102
+ }
103
+ function parseIndyRevocationRegistryId(revocationRegistryId) {
104
+ const didIndyMatch = revocationRegistryId.match(didIndyRevocationRegistryIdRegex);
105
+ if (didIndyMatch) {
106
+ const [, did, namespace, namespaceIdentifier, schemaSeqNo, credentialDefinitionTag, revocationRegistryTag] = didIndyMatch;
107
+ return {
108
+ did,
109
+ namespaceIdentifier,
110
+ schemaSeqNo,
111
+ credentialDefinitionTag,
112
+ revocationRegistryTag,
113
+ namespace
114
+ };
115
+ }
116
+ const legacyMatch = revocationRegistryId.match(unqualifiedRevocationRegistryIdRegex);
117
+ if (legacyMatch) {
118
+ const [, did, schemaSeqNo, credentialDefinitionTag, revocationRegistryTag] = legacyMatch;
119
+ return {
120
+ did,
121
+ namespaceIdentifier: did,
122
+ schemaSeqNo,
123
+ credentialDefinitionTag,
124
+ revocationRegistryTag
125
+ };
126
+ }
127
+ throw new Error(`Invalid revocation registry id: ${revocationRegistryId}`);
128
+ }
129
+ function getIndyNamespaceFromIndyDid(identifier) {
130
+ let namespace;
131
+ if (isDidIndySchemaId(identifier)) namespace = parseIndySchemaId(identifier).namespace;
132
+ else if (isDidIndyCredentialDefinitionId(identifier)) namespace = parseIndyCredentialDefinitionId(identifier).namespace;
133
+ else if (isDidIndyRevocationRegistryId(identifier)) namespace = parseIndyRevocationRegistryId(identifier).namespace;
134
+ else namespace = parseIndyDid(identifier).namespace;
135
+ if (!namespace) throw new CredoError(`Cannot get indy namespace of identifier '${identifier}'`);
136
+ return namespace;
137
+ }
138
+ function getUnQualifiedDidIndyDid(identifier) {
139
+ if (isUnqualifiedIndyDid(identifier)) return identifier;
140
+ if (isDidIndySchemaId(identifier)) {
141
+ const { schemaName, schemaVersion, namespaceIdentifier: namespaceIdentifier$1 } = parseIndySchemaId(identifier);
142
+ return getUnqualifiedSchemaId(namespaceIdentifier$1, schemaName, schemaVersion);
143
+ }
144
+ if (isDidIndyCredentialDefinitionId(identifier)) {
145
+ const { schemaSeqNo, tag, namespaceIdentifier: namespaceIdentifier$1 } = parseIndyCredentialDefinitionId(identifier);
146
+ return getUnqualifiedCredentialDefinitionId(namespaceIdentifier$1, schemaSeqNo, tag);
147
+ }
148
+ if (isDidIndyRevocationRegistryId(identifier)) {
149
+ const { namespaceIdentifier: namespaceIdentifier$1, schemaSeqNo, credentialDefinitionTag, revocationRegistryTag } = parseIndyRevocationRegistryId(identifier);
150
+ return getUnqualifiedRevocationRegistryDefinitionId(namespaceIdentifier$1, schemaSeqNo, credentialDefinitionTag, revocationRegistryTag);
151
+ }
152
+ const { namespaceIdentifier } = parseIndyDid(identifier);
153
+ return namespaceIdentifier;
154
+ }
155
+ function isIndyDid(identifier) {
156
+ return identifier.startsWith("did:indy:");
157
+ }
158
+ function getQualifiedDidIndyDid(identifier, namespace) {
159
+ if (isIndyDid(identifier)) return identifier;
160
+ if (!namespace || typeof namespace !== "string") throw new CredoError("Missing required indy namespace");
161
+ if (isUnqualifiedSchemaId(identifier)) {
162
+ const { namespaceIdentifier, schemaName, schemaVersion } = parseIndySchemaId(identifier);
163
+ return `did:indy:${namespace}:${namespaceIdentifier}/anoncreds/v0/SCHEMA/${schemaName}/${schemaVersion}`;
164
+ }
165
+ if (isUnqualifiedCredentialDefinitionId(identifier)) {
166
+ const { namespaceIdentifier, schemaSeqNo, tag } = parseIndyCredentialDefinitionId(identifier);
167
+ return `did:indy:${namespace}:${namespaceIdentifier}/anoncreds/v0/CLAIM_DEF/${schemaSeqNo}/${tag}`;
168
+ }
169
+ if (isUnqualifiedRevocationRegistryId(identifier)) {
170
+ const { namespaceIdentifier, schemaSeqNo, credentialDefinitionTag, revocationRegistryTag } = parseIndyRevocationRegistryId(identifier);
171
+ return `did:indy:${namespace}:${namespaceIdentifier}/anoncreds/v0/REV_REG_DEF/${schemaSeqNo}/${credentialDefinitionTag}/${revocationRegistryTag}`;
172
+ }
173
+ if (isUnqualifiedIndyDid(identifier)) return `did:indy:${namespace}:${identifier}`;
174
+ throw new CredoError(`Cannot created qualified indy identifier for '${identifier}' with namespace '${namespace}'`);
175
+ }
176
+ function isUnqualifiedDidIndySchema(schema) {
177
+ return isUnqualifiedIndyDid(schema.issuerId);
178
+ }
179
+ function getUnqualifiedDidIndySchema(schema) {
180
+ if (isUnqualifiedDidIndySchema(schema)) return { ...schema };
181
+ if (!isIndyDid(schema.issuerId)) throw new CredoError(`IssuerId '${schema.issuerId}' is not a valid qualified did-indy did.`);
182
+ const issuerId = getUnQualifiedDidIndyDid(schema.issuerId);
183
+ return {
184
+ ...schema,
185
+ issuerId
186
+ };
187
+ }
188
+ function isQualifiedDidIndySchema(schema) {
189
+ return !isUnqualifiedIndyDid(schema.issuerId);
190
+ }
191
+ function getQualifiedDidIndySchema(schema, namespace) {
192
+ if (isQualifiedDidIndySchema(schema)) return { ...schema };
193
+ return {
194
+ ...schema,
195
+ issuerId: getQualifiedDidIndyDid(schema.issuerId, namespace)
196
+ };
197
+ }
198
+ function isUnqualifiedDidIndyCredentialDefinition(anonCredsCredentialDefinition) {
199
+ return isUnqualifiedIndyDid(anonCredsCredentialDefinition.issuerId) && isUnqualifiedSchemaId(anonCredsCredentialDefinition.schemaId);
200
+ }
201
+ function getUnqualifiedDidIndyCredentialDefinition(anonCredsCredentialDefinition) {
202
+ if (isUnqualifiedDidIndyCredentialDefinition(anonCredsCredentialDefinition)) return { ...anonCredsCredentialDefinition };
203
+ const issuerId = getUnQualifiedDidIndyDid(anonCredsCredentialDefinition.issuerId);
204
+ const schemaId = getUnQualifiedDidIndyDid(anonCredsCredentialDefinition.schemaId);
205
+ return {
206
+ ...anonCredsCredentialDefinition,
207
+ issuerId,
208
+ schemaId
209
+ };
210
+ }
211
+ function isQualifiedDidIndyCredentialDefinition(anonCredsCredentialDefinition) {
212
+ return !isUnqualifiedIndyDid(anonCredsCredentialDefinition.issuerId) && !isUnqualifiedSchemaId(anonCredsCredentialDefinition.schemaId);
213
+ }
214
+ function getQualifiedDidIndyCredentialDefinition(anonCredsCredentialDefinition, namespace) {
215
+ if (isQualifiedDidIndyCredentialDefinition(anonCredsCredentialDefinition)) return { ...anonCredsCredentialDefinition };
216
+ return {
217
+ ...anonCredsCredentialDefinition,
218
+ issuerId: getQualifiedDidIndyDid(anonCredsCredentialDefinition.issuerId, namespace),
219
+ schemaId: getQualifiedDidIndyDid(anonCredsCredentialDefinition.schemaId, namespace)
220
+ };
221
+ }
222
+ function isUnqualifiedDidIndyRevocationRegistryDefinition(revocationRegistryDefinition) {
223
+ return isUnqualifiedIndyDid(revocationRegistryDefinition.issuerId) && isUnqualifiedCredentialDefinitionId(revocationRegistryDefinition.credDefId);
224
+ }
225
+ function getUnqualifiedDidIndyRevocationRegistryDefinition(revocationRegistryDefinition) {
226
+ if (isUnqualifiedDidIndyRevocationRegistryDefinition(revocationRegistryDefinition)) return { ...revocationRegistryDefinition };
227
+ const issuerId = getUnQualifiedDidIndyDid(revocationRegistryDefinition.issuerId);
228
+ const credDefId = getUnQualifiedDidIndyDid(revocationRegistryDefinition.credDefId);
229
+ return {
230
+ ...revocationRegistryDefinition,
231
+ issuerId,
232
+ credDefId
233
+ };
234
+ }
235
+ function isQualifiedRevocationRegistryDefinition(revocationRegistryDefinition) {
236
+ return !isUnqualifiedIndyDid(revocationRegistryDefinition.issuerId) && !isUnqualifiedCredentialDefinitionId(revocationRegistryDefinition.credDefId);
237
+ }
238
+ function getQualifiedDidIndyRevocationRegistryDefinition(revocationRegistryDefinition, namespace) {
239
+ if (isQualifiedRevocationRegistryDefinition(revocationRegistryDefinition)) return { ...revocationRegistryDefinition };
240
+ return {
241
+ ...revocationRegistryDefinition,
242
+ issuerId: getQualifiedDidIndyDid(revocationRegistryDefinition.issuerId, namespace),
243
+ credDefId: getQualifiedDidIndyDid(revocationRegistryDefinition.credDefId, namespace)
244
+ };
245
+ }
246
+
247
+ //#endregion
248
+ export { didIndyCredentialDefinitionIdRegex, didIndyRegex, didIndyRevocationRegistryIdRegex, didIndySchemaIdRegex, getIndyNamespaceFromIndyDid, getQualifiedDidIndyCredentialDefinition, getQualifiedDidIndyDid, getQualifiedDidIndyRevocationRegistryDefinition, getQualifiedDidIndySchema, getUnQualifiedDidIndyDid, getUnqualifiedCredentialDefinitionId, getUnqualifiedDidIndyCredentialDefinition, getUnqualifiedDidIndyRevocationRegistryDefinition, getUnqualifiedDidIndySchema, getUnqualifiedRevocationRegistryDefinitionId, getUnqualifiedSchemaId, isDidIndyCredentialDefinitionId, isDidIndyRevocationRegistryId, isDidIndySchemaId, isIndyDid, isQualifiedDidIndyCredentialDefinition, isQualifiedDidIndySchema, isQualifiedRevocationRegistryDefinition, isUnqualifiedCredentialDefinitionId, isUnqualifiedDidIndyCredentialDefinition, isUnqualifiedDidIndyRevocationRegistryDefinition, isUnqualifiedDidIndySchema, isUnqualifiedIndyDid, isUnqualifiedRevocationRegistryId, isUnqualifiedSchemaId, parseIndyCredentialDefinitionId, parseIndyDid, parseIndyRevocationRegistryId, parseIndySchemaId, unqualifiedCredentialDefinitionIdRegex, unqualifiedIndyDidRegex, unqualifiedRevocationRegistryIdRegex, unqualifiedSchemaIdRegex, unqualifiedSchemaVersionRegex };
249
+ //# sourceMappingURL=indyIdentifiers.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"indyIdentifiers.mjs","names":["namespace: string | undefined","namespaceIdentifier"],"sources":["../../src/utils/indyIdentifiers.ts"],"sourcesContent":["import { CredoError } from '@credo-ts/core'\nimport type { AnonCredsCredentialDefinition, AnonCredsRevocationRegistryDefinition, AnonCredsSchema } from '../models'\n\nconst didIndyAnonCredsBase =\n /(did:indy:((?:[a-z][_a-z0-9-]*)(?::[a-z][_a-z0-9-]*)?):([1-9A-HJ-NP-Za-km-z]{21,22}))\\/anoncreds\\/v0/\n\n// <namespaceIdentifier>:2:<schemaName>:<schemaVersion>\nexport const unqualifiedSchemaIdRegex = /^([a-zA-Z0-9]{21,22}):2:(.+):([0-9.]+)$/\n// did:indy:<namespace>:<namespaceIdentifier>/anoncreds/v0/SCHEMA/<schemaName>/<schemaVersion>\nexport const didIndySchemaIdRegex = new RegExp(`^${didIndyAnonCredsBase.source}/SCHEMA/(.+)/([0-9.]+)$`)\n\nexport const unqualifiedSchemaVersionRegex = /^(\\d+\\.)?(\\d+\\.)?(\\*|\\d+)$/\nexport const unqualifiedIndyDidRegex = /^(did:sov:)?[a-zA-Z0-9]{21,22}$/\n\n// <namespaceIdentifier>:3:CL:<schemaSeqNo>:<tag>\nexport const unqualifiedCredentialDefinitionIdRegex = /^([a-zA-Z0-9]{21,22}):3:CL:([1-9][0-9]*):(.+)$/\n// did:indy:<namespace>:<namespaceIdentifier>/anoncreds/v0/CLAIM_DEF/<schemaSeqNo>/<tag>\nexport const didIndyCredentialDefinitionIdRegex = new RegExp(\n `^${didIndyAnonCredsBase.source}/CLAIM_DEF/([1-9][0-9]*)/(.+)$`\n)\n\n// <namespaceIdentifier>:4:<namespaceIdentifier>:3:CL:<schemaSeqNo>:<credentialDefinitionTag>:CL_ACCUM:<revocationRegistryTag>\nexport const unqualifiedRevocationRegistryIdRegex =\n /^([a-zA-Z0-9]{21,22}):4:[a-zA-Z0-9]{21,22}:3:CL:([1-9][0-9]*):(.+):CL_ACCUM:(.+)$/\n// did:indy:<namespace>:<namespaceIdentifier>/anoncreds/v0/REV_REG_DEF/<schemaSeqNo>/<credentialDefinitionTag>/<revocationRegistryTag>\nexport const didIndyRevocationRegistryIdRegex = new RegExp(\n `^${didIndyAnonCredsBase.source}/REV_REG_DEF/([1-9][0-9]*)/(.+)/(.+)$`\n)\n\nexport const didIndyRegex = /^did:indy:((?:[a-z][_a-z0-9-]*)(?::[a-z][_a-z0-9-]*)?):([1-9A-HJ-NP-Za-km-z]{21,22})$/\n\nexport function getUnqualifiedSchemaId(unqualifiedDid: string, name: string, version: string) {\n return `${unqualifiedDid}:2:${name}:${version}`\n}\n\nexport function getUnqualifiedCredentialDefinitionId(\n unqualifiedDid: string,\n schemaSeqNo: string | number,\n tag: string\n) {\n return `${unqualifiedDid}:3:CL:${schemaSeqNo}:${tag}`\n}\n\n// TZQuLp43UcYTdtc3HewcDz:4:TZQuLp43UcYTdtc3HewcDz:3:CL:98158:BaustellenzertifikateNU1:CL_ACCUM:1-100\nexport function getUnqualifiedRevocationRegistryDefinitionId(\n unqualifiedDid: string,\n schemaSeqNo: string | number,\n credentialDefinitionTag: string,\n revocationRegistryTag: string\n) {\n return `${unqualifiedDid}:4:${unqualifiedDid}:3:CL:${schemaSeqNo}:${credentialDefinitionTag}:CL_ACCUM:${revocationRegistryTag}`\n}\n\nexport function isUnqualifiedIndyDid(did: string) {\n return unqualifiedIndyDidRegex.test(did)\n}\n\nexport function isUnqualifiedCredentialDefinitionId(credentialDefinitionId: string) {\n return unqualifiedCredentialDefinitionIdRegex.test(credentialDefinitionId)\n}\n\nexport function isUnqualifiedRevocationRegistryId(revocationRegistryId: string) {\n return unqualifiedRevocationRegistryIdRegex.test(revocationRegistryId)\n}\n\nexport function isUnqualifiedSchemaId(schemaId: string) {\n return unqualifiedSchemaIdRegex.test(schemaId)\n}\n\nexport function isDidIndySchemaId(schemaId: string) {\n return didIndySchemaIdRegex.test(schemaId)\n}\n\nexport function isDidIndyCredentialDefinitionId(credentialDefinitionId: string) {\n return didIndyCredentialDefinitionIdRegex.test(credentialDefinitionId)\n}\n\nexport function isDidIndyRevocationRegistryId(revocationRegistryId: string) {\n return didIndyRevocationRegistryIdRegex.test(revocationRegistryId)\n}\n\nexport function parseIndyDid(did: string) {\n const match = did.match(didIndyRegex)\n if (match) {\n const [, namespace, namespaceIdentifier] = match\n return { namespace, namespaceIdentifier }\n }\n throw new CredoError(`${did} is not a valid did:indy did`)\n}\n\ninterface ParsedIndySchemaId {\n did: string\n namespaceIdentifier: string\n schemaName: string\n schemaVersion: string\n namespace?: string\n}\n\nexport function parseIndySchemaId(schemaId: string): ParsedIndySchemaId {\n const didIndyMatch = schemaId.match(didIndySchemaIdRegex)\n if (didIndyMatch) {\n const [, did, namespace, namespaceIdentifier, schemaName, schemaVersion] = didIndyMatch\n\n return {\n did,\n namespaceIdentifier,\n schemaName,\n schemaVersion,\n namespace,\n }\n }\n\n const legacyMatch = schemaId.match(unqualifiedSchemaIdRegex)\n if (legacyMatch) {\n const [, did, schemaName, schemaVersion] = legacyMatch\n\n return {\n did,\n namespaceIdentifier: did,\n schemaName,\n schemaVersion,\n }\n }\n\n throw new Error(`Invalid schema id: ${schemaId}`)\n}\n\ninterface ParsedIndyCredentialDefinitionId {\n did: string\n namespaceIdentifier: string\n schemaSeqNo: string\n tag: string\n namespace?: string\n}\n\nexport function parseIndyCredentialDefinitionId(credentialDefinitionId: string): ParsedIndyCredentialDefinitionId {\n const didIndyMatch = credentialDefinitionId.match(didIndyCredentialDefinitionIdRegex)\n if (didIndyMatch) {\n const [, did, namespace, namespaceIdentifier, schemaSeqNo, tag] = didIndyMatch\n\n return {\n did,\n namespaceIdentifier,\n schemaSeqNo,\n tag,\n namespace,\n }\n }\n\n const legacyMatch = credentialDefinitionId.match(unqualifiedCredentialDefinitionIdRegex)\n if (legacyMatch) {\n const [, did, schemaSeqNo, tag] = legacyMatch\n\n return {\n did,\n namespaceIdentifier: did,\n schemaSeqNo,\n tag,\n }\n }\n\n throw new Error(`Invalid credential definition id: ${credentialDefinitionId}`)\n}\n\ninterface ParsedIndyRevocationRegistryId {\n did: string\n namespaceIdentifier: string\n schemaSeqNo: string\n credentialDefinitionTag: string\n revocationRegistryTag: string\n namespace?: string\n}\n\nexport function parseIndyRevocationRegistryId(revocationRegistryId: string): ParsedIndyRevocationRegistryId {\n const didIndyMatch = revocationRegistryId.match(didIndyRevocationRegistryIdRegex)\n if (didIndyMatch) {\n const [, did, namespace, namespaceIdentifier, schemaSeqNo, credentialDefinitionTag, revocationRegistryTag] =\n didIndyMatch\n\n return {\n did,\n namespaceIdentifier,\n schemaSeqNo,\n credentialDefinitionTag,\n revocationRegistryTag,\n namespace,\n }\n }\n\n const legacyMatch = revocationRegistryId.match(unqualifiedRevocationRegistryIdRegex)\n if (legacyMatch) {\n const [, did, schemaSeqNo, credentialDefinitionTag, revocationRegistryTag] = legacyMatch\n\n return {\n did,\n namespaceIdentifier: did,\n schemaSeqNo,\n credentialDefinitionTag,\n revocationRegistryTag,\n }\n }\n\n throw new Error(`Invalid revocation registry id: ${revocationRegistryId}`)\n}\n\nexport function getIndyNamespaceFromIndyDid(identifier: string): string {\n let namespace: string | undefined\n if (isDidIndySchemaId(identifier)) {\n namespace = parseIndySchemaId(identifier).namespace\n } else if (isDidIndyCredentialDefinitionId(identifier)) {\n namespace = parseIndyCredentialDefinitionId(identifier).namespace\n } else if (isDidIndyRevocationRegistryId(identifier)) {\n namespace = parseIndyRevocationRegistryId(identifier).namespace\n } else {\n namespace = parseIndyDid(identifier).namespace\n }\n if (!namespace) throw new CredoError(`Cannot get indy namespace of identifier '${identifier}'`)\n return namespace\n}\n\nexport function getUnQualifiedDidIndyDid(identifier: string): string {\n if (isUnqualifiedIndyDid(identifier)) return identifier\n\n if (isDidIndySchemaId(identifier)) {\n const { schemaName, schemaVersion, namespaceIdentifier } = parseIndySchemaId(identifier)\n return getUnqualifiedSchemaId(namespaceIdentifier, schemaName, schemaVersion)\n }\n if (isDidIndyCredentialDefinitionId(identifier)) {\n const { schemaSeqNo, tag, namespaceIdentifier } = parseIndyCredentialDefinitionId(identifier)\n return getUnqualifiedCredentialDefinitionId(namespaceIdentifier, schemaSeqNo, tag)\n }\n if (isDidIndyRevocationRegistryId(identifier)) {\n const { namespaceIdentifier, schemaSeqNo, credentialDefinitionTag, revocationRegistryTag } =\n parseIndyRevocationRegistryId(identifier)\n return getUnqualifiedRevocationRegistryDefinitionId(\n namespaceIdentifier,\n schemaSeqNo,\n credentialDefinitionTag,\n revocationRegistryTag\n )\n }\n\n const { namespaceIdentifier } = parseIndyDid(identifier)\n return namespaceIdentifier\n}\n\nexport function isIndyDid(identifier: string): boolean {\n return identifier.startsWith('did:indy:')\n}\n\nexport function getQualifiedDidIndyDid(identifier: string, namespace: string): string {\n if (isIndyDid(identifier)) return identifier\n\n if (!namespace || typeof namespace !== 'string') {\n throw new CredoError('Missing required indy namespace')\n }\n\n if (isUnqualifiedSchemaId(identifier)) {\n const { namespaceIdentifier, schemaName, schemaVersion } = parseIndySchemaId(identifier)\n const schemaId = `did:indy:${namespace}:${namespaceIdentifier}/anoncreds/v0/SCHEMA/${schemaName}/${schemaVersion}`\n return schemaId\n }\n if (isUnqualifiedCredentialDefinitionId(identifier)) {\n const { namespaceIdentifier, schemaSeqNo, tag } = parseIndyCredentialDefinitionId(identifier)\n const credentialDefinitionId = `did:indy:${namespace}:${namespaceIdentifier}/anoncreds/v0/CLAIM_DEF/${schemaSeqNo}/${tag}`\n return credentialDefinitionId\n }\n if (isUnqualifiedRevocationRegistryId(identifier)) {\n const { namespaceIdentifier, schemaSeqNo, credentialDefinitionTag, revocationRegistryTag } =\n parseIndyRevocationRegistryId(identifier)\n const revocationRegistryId = `did:indy:${namespace}:${namespaceIdentifier}/anoncreds/v0/REV_REG_DEF/${schemaSeqNo}/${credentialDefinitionTag}/${revocationRegistryTag}`\n return revocationRegistryId\n }\n if (isUnqualifiedIndyDid(identifier)) {\n return `did:indy:${namespace}:${identifier}`\n }\n throw new CredoError(`Cannot created qualified indy identifier for '${identifier}' with namespace '${namespace}'`)\n}\n\n// -- schema -- //\n\nexport function isUnqualifiedDidIndySchema(schema: AnonCredsSchema) {\n return isUnqualifiedIndyDid(schema.issuerId)\n}\n\nexport function getUnqualifiedDidIndySchema(schema: AnonCredsSchema): AnonCredsSchema {\n if (isUnqualifiedDidIndySchema(schema)) return { ...schema }\n if (!isIndyDid(schema.issuerId)) {\n throw new CredoError(`IssuerId '${schema.issuerId}' is not a valid qualified did-indy did.`)\n }\n\n const issuerId = getUnQualifiedDidIndyDid(schema.issuerId)\n return { ...schema, issuerId }\n}\n\nexport function isQualifiedDidIndySchema(schema: AnonCredsSchema) {\n return !isUnqualifiedIndyDid(schema.issuerId)\n}\n\nexport function getQualifiedDidIndySchema(schema: AnonCredsSchema, namespace: string): AnonCredsSchema {\n if (isQualifiedDidIndySchema(schema)) return { ...schema }\n\n return {\n ...schema,\n issuerId: getQualifiedDidIndyDid(schema.issuerId, namespace),\n }\n}\n\n// -- credential definition -- //\n\nexport function isUnqualifiedDidIndyCredentialDefinition(anonCredsCredentialDefinition: AnonCredsCredentialDefinition) {\n return (\n isUnqualifiedIndyDid(anonCredsCredentialDefinition.issuerId) &&\n isUnqualifiedSchemaId(anonCredsCredentialDefinition.schemaId)\n )\n}\n\nexport function getUnqualifiedDidIndyCredentialDefinition(\n anonCredsCredentialDefinition: AnonCredsCredentialDefinition\n): AnonCredsCredentialDefinition {\n if (isUnqualifiedDidIndyCredentialDefinition(anonCredsCredentialDefinition)) {\n return { ...anonCredsCredentialDefinition }\n }\n\n const issuerId = getUnQualifiedDidIndyDid(anonCredsCredentialDefinition.issuerId)\n const schemaId = getUnQualifiedDidIndyDid(anonCredsCredentialDefinition.schemaId)\n\n return { ...anonCredsCredentialDefinition, issuerId, schemaId }\n}\n\nexport function isQualifiedDidIndyCredentialDefinition(anonCredsCredentialDefinition: AnonCredsCredentialDefinition) {\n return (\n !isUnqualifiedIndyDid(anonCredsCredentialDefinition.issuerId) &&\n !isUnqualifiedSchemaId(anonCredsCredentialDefinition.schemaId)\n )\n}\n\nexport function getQualifiedDidIndyCredentialDefinition(\n anonCredsCredentialDefinition: AnonCredsCredentialDefinition,\n namespace: string\n): AnonCredsCredentialDefinition {\n if (isQualifiedDidIndyCredentialDefinition(anonCredsCredentialDefinition)) return { ...anonCredsCredentialDefinition }\n\n return {\n ...anonCredsCredentialDefinition,\n issuerId: getQualifiedDidIndyDid(anonCredsCredentialDefinition.issuerId, namespace),\n schemaId: getQualifiedDidIndyDid(anonCredsCredentialDefinition.schemaId, namespace),\n }\n}\n\n// -- revocation registry definition -- //\n\nexport function isUnqualifiedDidIndyRevocationRegistryDefinition(\n revocationRegistryDefinition: AnonCredsRevocationRegistryDefinition\n) {\n return (\n isUnqualifiedIndyDid(revocationRegistryDefinition.issuerId) &&\n isUnqualifiedCredentialDefinitionId(revocationRegistryDefinition.credDefId)\n )\n}\n\nexport function getUnqualifiedDidIndyRevocationRegistryDefinition(\n revocationRegistryDefinition: AnonCredsRevocationRegistryDefinition\n): AnonCredsRevocationRegistryDefinition {\n if (isUnqualifiedDidIndyRevocationRegistryDefinition(revocationRegistryDefinition)) {\n return { ...revocationRegistryDefinition }\n }\n\n const issuerId = getUnQualifiedDidIndyDid(revocationRegistryDefinition.issuerId)\n const credDefId = getUnQualifiedDidIndyDid(revocationRegistryDefinition.credDefId)\n\n return { ...revocationRegistryDefinition, issuerId, credDefId }\n}\n\nexport function isQualifiedRevocationRegistryDefinition(\n revocationRegistryDefinition: AnonCredsRevocationRegistryDefinition\n) {\n return (\n !isUnqualifiedIndyDid(revocationRegistryDefinition.issuerId) &&\n !isUnqualifiedCredentialDefinitionId(revocationRegistryDefinition.credDefId)\n )\n}\n\nexport function getQualifiedDidIndyRevocationRegistryDefinition(\n revocationRegistryDefinition: AnonCredsRevocationRegistryDefinition,\n namespace: string\n): AnonCredsRevocationRegistryDefinition {\n if (isQualifiedRevocationRegistryDefinition(revocationRegistryDefinition)) return { ...revocationRegistryDefinition }\n\n return {\n ...revocationRegistryDefinition,\n issuerId: getQualifiedDidIndyDid(revocationRegistryDefinition.issuerId, namespace),\n credDefId: getQualifiedDidIndyDid(revocationRegistryDefinition.credDefId, namespace),\n }\n}\n"],"mappings":";;;AAGA,MAAM,uBACJ;AAGF,MAAa,2BAA2B;AAExC,MAAa,uCAAuB,IAAI,OAAO,IAAI,qBAAqB,OAAO,yBAAyB;AAExG,MAAa,gCAAgC;AAC7C,MAAa,0BAA0B;AAGvC,MAAa,yCAAyC;AAEtD,MAAa,qDAAqC,IAAI,OACpD,IAAI,qBAAqB,OAAO,gCACjC;AAGD,MAAa,uCACX;AAEF,MAAa,mDAAmC,IAAI,OAClD,IAAI,qBAAqB,OAAO,uCACjC;AAED,MAAa,eAAe;AAE5B,SAAgB,uBAAuB,gBAAwB,MAAc,SAAiB;AAC5F,QAAO,GAAG,eAAe,KAAK,KAAK,GAAG;;AAGxC,SAAgB,qCACd,gBACA,aACA,KACA;AACA,QAAO,GAAG,eAAe,QAAQ,YAAY,GAAG;;AAIlD,SAAgB,6CACd,gBACA,aACA,yBACA,uBACA;AACA,QAAO,GAAG,eAAe,KAAK,eAAe,QAAQ,YAAY,GAAG,wBAAwB,YAAY;;AAG1G,SAAgB,qBAAqB,KAAa;AAChD,QAAO,wBAAwB,KAAK,IAAI;;AAG1C,SAAgB,oCAAoC,wBAAgC;AAClF,QAAO,uCAAuC,KAAK,uBAAuB;;AAG5E,SAAgB,kCAAkC,sBAA8B;AAC9E,QAAO,qCAAqC,KAAK,qBAAqB;;AAGxE,SAAgB,sBAAsB,UAAkB;AACtD,QAAO,yBAAyB,KAAK,SAAS;;AAGhD,SAAgB,kBAAkB,UAAkB;AAClD,QAAO,qBAAqB,KAAK,SAAS;;AAG5C,SAAgB,gCAAgC,wBAAgC;A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, buildMessage } from "class-validator";
2
+
3
+ //#region src/utils/isMap.ts
4
+ /**
5
+ * Checks if a given value is a Map
6
+ */
7
+ function IsMap(validationOptions) {
8
+ return ValidateBy({
9
+ name: "isMap",
10
+ validator: {
11
+ validate: (value) => value instanceof Map,
12
+ defaultMessage: buildMessage((eachPrefix) => `${eachPrefix}$property must be a Map`, validationOptions)
13
+ }
14
+ }, validationOptions);
15
+ }
16
+
17
+ //#endregion
18
+ export { IsMap };
19
+ //# sourceMappingURL=isMap.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isMap.mjs","names":[],"sources":["../../src/utils/isMap.ts"],"sourcesContent":["import type { ValidationOptions } from 'class-validator'\n\nimport { buildMessage, ValidateBy } from 'class-validator'\n\n/**\n * Checks if a given value is a Map\n */\nexport function IsMap(validationOptions?: ValidationOptions): PropertyDecorator {\n return ValidateBy(\n {\n name: 'isMap',\n validator: {\n validate: (value: unknown): boolean => value instanceof Map,\n defaultMessage: buildMessage((eachPrefix) => `${eachPrefix}$property must be a Map`, validationOptions),\n },\n },\n validationOptions\n )\n}\n"],"mappings":";;;;;;AAOA,SAAgB,MAAM,mBAA0D;AAC9E,QAAO,WACL;EACE,MAAM;EACN,WAAW;GACT,WAAW,UAA4B,iBAAiB;GACxD,gBAAgB,cAAc,eAAe,GAAG,WAAW,0BAA0B,kBAAkB;GACxG;EACF,EACD,kBACD"}
@@ -0,0 +1,13 @@
1
+ import { AnonCredsLinkSecretRecord } from "../repository/AnonCredsLinkSecretRecord.mjs";
2
+ import "../repository/index.mjs";
3
+ import { AgentContext } from "@credo-ts/core";
4
+
5
+ //#region src/utils/linkSecret.d.ts
6
+ declare function storeLinkSecret(agentContext: AgentContext, options: {
7
+ linkSecretId: string;
8
+ linkSecretValue?: string;
9
+ setAsDefault?: boolean;
10
+ }): Promise<AnonCredsLinkSecretRecord>;
11
+ //#endregion
12
+ export { storeLinkSecret };
13
+ //# sourceMappingURL=linkSecret.d.mts.map