@credo-ts/anoncreds 0.4.1-alpha.157

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 (417) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +31 -0
  3. package/build/AnonCredsApi.d.ts +97 -0
  4. package/build/AnonCredsApi.js +582 -0
  5. package/build/AnonCredsApi.js.map +1 -0
  6. package/build/AnonCredsApiOptions.d.ts +24 -0
  7. package/build/AnonCredsApiOptions.js +3 -0
  8. package/build/AnonCredsApiOptions.js.map +1 -0
  9. package/build/AnonCredsModule.d.ts +24 -0
  10. package/build/AnonCredsModule.js +56 -0
  11. package/build/AnonCredsModule.js.map +1 -0
  12. package/build/AnonCredsModuleConfig.d.ts +72 -0
  13. package/build/AnonCredsModuleConfig.js +31 -0
  14. package/build/AnonCredsModuleConfig.js.map +1 -0
  15. package/build/anoncreds-rs/AnonCredsDataIntegrityService.d.ts +27 -0
  16. package/build/anoncreds-rs/AnonCredsDataIntegrityService.js +241 -0
  17. package/build/anoncreds-rs/AnonCredsDataIntegrityService.js.map +1 -0
  18. package/build/anoncreds-rs/AnonCredsRsHolderService.d.ts +37 -0
  19. package/build/anoncreds-rs/AnonCredsRsHolderService.js +590 -0
  20. package/build/anoncreds-rs/AnonCredsRsHolderService.js.map +1 -0
  21. package/build/anoncreds-rs/AnonCredsRsIssuerService.d.ts +12 -0
  22. package/build/anoncreds-rs/AnonCredsRsIssuerService.js +253 -0
  23. package/build/anoncreds-rs/AnonCredsRsIssuerService.js.map +1 -0
  24. package/build/anoncreds-rs/AnonCredsRsVerifierService.d.ts +8 -0
  25. package/build/anoncreds-rs/AnonCredsRsVerifierService.js +157 -0
  26. package/build/anoncreds-rs/AnonCredsRsVerifierService.js.map +1 -0
  27. package/build/anoncreds-rs/index.d.ts +3 -0
  28. package/build/anoncreds-rs/index.js +10 -0
  29. package/build/anoncreds-rs/index.js.map +1 -0
  30. package/build/anoncreds-rs/utils.d.ts +23 -0
  31. package/build/anoncreds-rs/utils.js +71 -0
  32. package/build/anoncreds-rs/utils.js.map +1 -0
  33. package/build/error/AnonCredsError.d.ts +6 -0
  34. package/build/error/AnonCredsError.js +11 -0
  35. package/build/error/AnonCredsError.js.map +1 -0
  36. package/build/error/AnonCredsRsError.d.ts +6 -0
  37. package/build/error/AnonCredsRsError.js +11 -0
  38. package/build/error/AnonCredsRsError.js.map +1 -0
  39. package/build/error/AnonCredsStoreRecordError.d.ts +6 -0
  40. package/build/error/AnonCredsStoreRecordError.js +11 -0
  41. package/build/error/AnonCredsStoreRecordError.js.map +1 -0
  42. package/build/error/index.d.ts +3 -0
  43. package/build/error/index.js +20 -0
  44. package/build/error/index.js.map +1 -0
  45. package/build/formats/AnonCredsCredentialFormat.d.ts +79 -0
  46. package/build/formats/AnonCredsCredentialFormat.js +3 -0
  47. package/build/formats/AnonCredsCredentialFormat.js.map +1 -0
  48. package/build/formats/AnonCredsCredentialFormatService.d.ts +80 -0
  49. package/build/formats/AnonCredsCredentialFormatService.js +422 -0
  50. package/build/formats/AnonCredsCredentialFormatService.js.map +1 -0
  51. package/build/formats/AnonCredsProofFormat.d.ts +70 -0
  52. package/build/formats/AnonCredsProofFormat.js +3 -0
  53. package/build/formats/AnonCredsProofFormat.js.map +1 -0
  54. package/build/formats/AnonCredsProofFormatService.d.ts +58 -0
  55. package/build/formats/AnonCredsProofFormatService.js +360 -0
  56. package/build/formats/AnonCredsProofFormatService.js.map +1 -0
  57. package/build/formats/DataIntegrityCredentialFormatService.d.ts +89 -0
  58. package/build/formats/DataIntegrityCredentialFormatService.js +773 -0
  59. package/build/formats/DataIntegrityCredentialFormatService.js.map +1 -0
  60. package/build/formats/LegacyIndyCredentialFormat.d.ts +32 -0
  61. package/build/formats/LegacyIndyCredentialFormat.js +3 -0
  62. package/build/formats/LegacyIndyCredentialFormat.js.map +1 -0
  63. package/build/formats/LegacyIndyCredentialFormatService.d.ts +80 -0
  64. package/build/formats/LegacyIndyCredentialFormatService.js +388 -0
  65. package/build/formats/LegacyIndyCredentialFormatService.js.map +1 -0
  66. package/build/formats/LegacyIndyProofFormat.d.ts +29 -0
  67. package/build/formats/LegacyIndyProofFormat.js +3 -0
  68. package/build/formats/LegacyIndyProofFormat.js.map +1 -0
  69. package/build/formats/LegacyIndyProofFormatService.d.ts +58 -0
  70. package/build/formats/LegacyIndyProofFormatService.js +374 -0
  71. package/build/formats/LegacyIndyProofFormatService.js.map +1 -0
  72. package/build/formats/index.d.ts +9 -0
  73. package/build/formats/index.js +32 -0
  74. package/build/formats/index.js.map +1 -0
  75. package/build/index.d.ts +17 -0
  76. package/build/index.js +46 -0
  77. package/build/index.js.map +1 -0
  78. package/build/models/AnonCredsCredentialProposal.d.ts +62 -0
  79. package/build/models/AnonCredsCredentialProposal.js +81 -0
  80. package/build/models/AnonCredsCredentialProposal.js.map +1 -0
  81. package/build/models/AnonCredsProofRequest.d.ts +27 -0
  82. package/build/models/AnonCredsProofRequest.js +82 -0
  83. package/build/models/AnonCredsProofRequest.js.map +1 -0
  84. package/build/models/AnonCredsRequestedAttribute.d.ts +16 -0
  85. package/build/models/AnonCredsRequestedAttribute.js +56 -0
  86. package/build/models/AnonCredsRequestedAttribute.js.map +1 -0
  87. package/build/models/AnonCredsRequestedPredicate.d.ts +19 -0
  88. package/build/models/AnonCredsRequestedPredicate.js +61 -0
  89. package/build/models/AnonCredsRequestedPredicate.js.map +1 -0
  90. package/build/models/AnonCredsRestriction.d.ts +55 -0
  91. package/build/models/AnonCredsRestriction.js +160 -0
  92. package/build/models/AnonCredsRestriction.js.map +1 -0
  93. package/build/models/AnonCredsRestrictionWrapper.d.ts +4 -0
  94. package/build/models/AnonCredsRestrictionWrapper.js +25 -0
  95. package/build/models/AnonCredsRestrictionWrapper.js.map +1 -0
  96. package/build/models/AnonCredsRevocationInterval.d.ts +5 -0
  97. package/build/models/AnonCredsRevocationInterval.js +33 -0
  98. package/build/models/AnonCredsRevocationInterval.js.map +1 -0
  99. package/build/models/exchange.d.ts +97 -0
  100. package/build/models/exchange.js +5 -0
  101. package/build/models/exchange.js.map +1 -0
  102. package/build/models/index.d.ts +4 -0
  103. package/build/models/index.js +21 -0
  104. package/build/models/index.js.map +1 -0
  105. package/build/models/internal.d.ts +33 -0
  106. package/build/models/internal.js +3 -0
  107. package/build/models/internal.js.map +1 -0
  108. package/build/models/registry.d.ts +39 -0
  109. package/build/models/registry.js +3 -0
  110. package/build/models/registry.js.map +1 -0
  111. package/build/models/utils.d.ts +22 -0
  112. package/build/models/utils.js +3 -0
  113. package/build/models/utils.js.map +1 -0
  114. package/build/protocols/credentials/v1/V1CredentialProtocol.d.ts +162 -0
  115. package/build/protocols/credentials/v1/V1CredentialProtocol.js +943 -0
  116. package/build/protocols/credentials/v1/V1CredentialProtocol.js.map +1 -0
  117. package/build/protocols/credentials/v1/errors/V1CredentialProblemReportError.d.ts +10 -0
  118. package/build/protocols/credentials/v1/errors/V1CredentialProblemReportError.js +18 -0
  119. package/build/protocols/credentials/v1/errors/V1CredentialProblemReportError.js.map +1 -0
  120. package/build/protocols/credentials/v1/errors/index.d.ts +1 -0
  121. package/build/protocols/credentials/v1/errors/index.js +6 -0
  122. package/build/protocols/credentials/v1/errors/index.js.map +1 -0
  123. package/build/protocols/credentials/v1/handlers/V1CredentialAckHandler.d.ts +9 -0
  124. package/build/protocols/credentials/v1/handlers/V1CredentialAckHandler.js +15 -0
  125. package/build/protocols/credentials/v1/handlers/V1CredentialAckHandler.js.map +1 -0
  126. package/build/protocols/credentials/v1/handlers/V1CredentialProblemReportHandler.d.ts +9 -0
  127. package/build/protocols/credentials/v1/handlers/V1CredentialProblemReportHandler.js +15 -0
  128. package/build/protocols/credentials/v1/handlers/V1CredentialProblemReportHandler.js.map +1 -0
  129. package/build/protocols/credentials/v1/handlers/V1IssueCredentialHandler.d.ts +10 -0
  130. package/build/protocols/credentials/v1/handlers/V1IssueCredentialHandler.js +40 -0
  131. package/build/protocols/credentials/v1/handlers/V1IssueCredentialHandler.js.map +1 -0
  132. package/build/protocols/credentials/v1/handlers/V1OfferCredentialHandler.d.ts +10 -0
  133. package/build/protocols/credentials/v1/handlers/V1OfferCredentialHandler.js +33 -0
  134. package/build/protocols/credentials/v1/handlers/V1OfferCredentialHandler.js.map +1 -0
  135. package/build/protocols/credentials/v1/handlers/V1ProposeCredentialHandler.d.ts +10 -0
  136. package/build/protocols/credentials/v1/handlers/V1ProposeCredentialHandler.js +38 -0
  137. package/build/protocols/credentials/v1/handlers/V1ProposeCredentialHandler.js.map +1 -0
  138. package/build/protocols/credentials/v1/handlers/V1RequestCredentialHandler.d.ts +10 -0
  139. package/build/protocols/credentials/v1/handlers/V1RequestCredentialHandler.js +40 -0
  140. package/build/protocols/credentials/v1/handlers/V1RequestCredentialHandler.js.map +1 -0
  141. package/build/protocols/credentials/v1/handlers/index.d.ts +6 -0
  142. package/build/protocols/credentials/v1/handlers/index.js +23 -0
  143. package/build/protocols/credentials/v1/handlers/index.js.map +1 -0
  144. package/build/protocols/credentials/v1/index.d.ts +2 -0
  145. package/build/protocols/credentials/v1/index.js +19 -0
  146. package/build/protocols/credentials/v1/index.js.map +1 -0
  147. package/build/protocols/credentials/v1/messages/V1CredentialAckMessage.d.ts +16 -0
  148. package/build/protocols/credentials/v1/messages/V1CredentialAckMessage.js +34 -0
  149. package/build/protocols/credentials/v1/messages/V1CredentialAckMessage.js.map +1 -0
  150. package/build/protocols/credentials/v1/messages/V1CredentialPreview.d.ts +26 -0
  151. package/build/protocols/credentials/v1/messages/V1CredentialPreview.js +69 -0
  152. package/build/protocols/credentials/v1/messages/V1CredentialPreview.js.map +1 -0
  153. package/build/protocols/credentials/v1/messages/V1CredentialProblemReportMessage.d.ts +16 -0
  154. package/build/protocols/credentials/v1/messages/V1CredentialProblemReportMessage.js +34 -0
  155. package/build/protocols/credentials/v1/messages/V1CredentialProblemReportMessage.js.map +1 -0
  156. package/build/protocols/credentials/v1/messages/V1IssueCredentialMessage.d.ts +19 -0
  157. package/build/protocols/credentials/v1/messages/V1IssueCredentialMessage.js +62 -0
  158. package/build/protocols/credentials/v1/messages/V1IssueCredentialMessage.js.map +1 -0
  159. package/build/protocols/credentials/v1/messages/V1OfferCredentialMessage.d.ts +27 -0
  160. package/build/protocols/credentials/v1/messages/V1OfferCredentialMessage.js +75 -0
  161. package/build/protocols/credentials/v1/messages/V1OfferCredentialMessage.js.map +1 -0
  162. package/build/protocols/credentials/v1/messages/V1ProposeCredentialMessage.d.ts +59 -0
  163. package/build/protocols/credentials/v1/messages/V1ProposeCredentialMessage.js +109 -0
  164. package/build/protocols/credentials/v1/messages/V1ProposeCredentialMessage.js.map +1 -0
  165. package/build/protocols/credentials/v1/messages/V1RequestCredentialMessage.d.ts +19 -0
  166. package/build/protocols/credentials/v1/messages/V1RequestCredentialMessage.js +61 -0
  167. package/build/protocols/credentials/v1/messages/V1RequestCredentialMessage.js.map +1 -0
  168. package/build/protocols/credentials/v1/messages/index.d.ts +7 -0
  169. package/build/protocols/credentials/v1/messages/index.js +24 -0
  170. package/build/protocols/credentials/v1/messages/index.js.map +1 -0
  171. package/build/protocols/index.d.ts +2 -0
  172. package/build/protocols/index.js +19 -0
  173. package/build/protocols/index.js.map +1 -0
  174. package/build/protocols/proofs/v1/V1ProofProtocol.d.ts +50 -0
  175. package/build/protocols/proofs/v1/V1ProofProtocol.js +860 -0
  176. package/build/protocols/proofs/v1/V1ProofProtocol.js.map +1 -0
  177. package/build/protocols/proofs/v1/errors/V1PresentationProblemReportError.d.ts +12 -0
  178. package/build/protocols/proofs/v1/errors/V1PresentationProblemReportError.js +19 -0
  179. package/build/protocols/proofs/v1/errors/V1PresentationProblemReportError.js.map +1 -0
  180. package/build/protocols/proofs/v1/errors/index.d.ts +1 -0
  181. package/build/protocols/proofs/v1/errors/index.js +18 -0
  182. package/build/protocols/proofs/v1/errors/index.js.map +1 -0
  183. package/build/protocols/proofs/v1/handlers/V1PresentationAckHandler.d.ts +9 -0
  184. package/build/protocols/proofs/v1/handlers/V1PresentationAckHandler.js +15 -0
  185. package/build/protocols/proofs/v1/handlers/V1PresentationAckHandler.js.map +1 -0
  186. package/build/protocols/proofs/v1/handlers/V1PresentationHandler.d.ts +10 -0
  187. package/build/protocols/proofs/v1/handlers/V1PresentationHandler.js +40 -0
  188. package/build/protocols/proofs/v1/handlers/V1PresentationHandler.js.map +1 -0
  189. package/build/protocols/proofs/v1/handlers/V1PresentationProblemReportHandler.d.ts +9 -0
  190. package/build/protocols/proofs/v1/handlers/V1PresentationProblemReportHandler.js +15 -0
  191. package/build/protocols/proofs/v1/handlers/V1PresentationProblemReportHandler.js.map +1 -0
  192. package/build/protocols/proofs/v1/handlers/V1ProposePresentationHandler.d.ts +11 -0
  193. package/build/protocols/proofs/v1/handlers/V1ProposePresentationHandler.js +38 -0
  194. package/build/protocols/proofs/v1/handlers/V1ProposePresentationHandler.js.map +1 -0
  195. package/build/protocols/proofs/v1/handlers/V1RequestPresentationHandler.d.ts +10 -0
  196. package/build/protocols/proofs/v1/handlers/V1RequestPresentationHandler.js +35 -0
  197. package/build/protocols/proofs/v1/handlers/V1RequestPresentationHandler.js.map +1 -0
  198. package/build/protocols/proofs/v1/handlers/index.d.ts +5 -0
  199. package/build/protocols/proofs/v1/handlers/index.js +22 -0
  200. package/build/protocols/proofs/v1/handlers/index.js.map +1 -0
  201. package/build/protocols/proofs/v1/index.d.ts +4 -0
  202. package/build/protocols/proofs/v1/index.js +21 -0
  203. package/build/protocols/proofs/v1/index.js.map +1 -0
  204. package/build/protocols/proofs/v1/messages/V1PresentationAckMessage.d.ts +8 -0
  205. package/build/protocols/proofs/v1/messages/V1PresentationAckMessage.js +27 -0
  206. package/build/protocols/proofs/v1/messages/V1PresentationAckMessage.js.map +1 -0
  207. package/build/protocols/proofs/v1/messages/V1PresentationMessage.d.ts +31 -0
  208. package/build/protocols/proofs/v1/messages/V1PresentationMessage.js +67 -0
  209. package/build/protocols/proofs/v1/messages/V1PresentationMessage.js.map +1 -0
  210. package/build/protocols/proofs/v1/messages/V1PresentationProblemReportMessage.d.ts +16 -0
  211. package/build/protocols/proofs/v1/messages/V1PresentationProblemReportMessage.js +34 -0
  212. package/build/protocols/proofs/v1/messages/V1PresentationProblemReportMessage.js.map +1 -0
  213. package/build/protocols/proofs/v1/messages/V1ProposePresentationMessage.d.ts +26 -0
  214. package/build/protocols/proofs/v1/messages/V1ProposePresentationMessage.js +53 -0
  215. package/build/protocols/proofs/v1/messages/V1ProposePresentationMessage.js.map +1 -0
  216. package/build/protocols/proofs/v1/messages/V1RequestPresentationMessage.d.ts +29 -0
  217. package/build/protocols/proofs/v1/messages/V1RequestPresentationMessage.js +65 -0
  218. package/build/protocols/proofs/v1/messages/V1RequestPresentationMessage.js.map +1 -0
  219. package/build/protocols/proofs/v1/messages/index.d.ts +5 -0
  220. package/build/protocols/proofs/v1/messages/index.js +22 -0
  221. package/build/protocols/proofs/v1/messages/index.js.map +1 -0
  222. package/build/protocols/proofs/v1/models/V1PresentationPreview.d.ts +50 -0
  223. package/build/protocols/proofs/v1/models/V1PresentationPreview.js +130 -0
  224. package/build/protocols/proofs/v1/models/V1PresentationPreview.js.map +1 -0
  225. package/build/protocols/proofs/v1/models/index.d.ts +1 -0
  226. package/build/protocols/proofs/v1/models/index.js +18 -0
  227. package/build/protocols/proofs/v1/models/index.js.map +1 -0
  228. package/build/repository/AnonCredsCredentialDefinitionPrivateRecord.d.ts +20 -0
  229. package/build/repository/AnonCredsCredentialDefinitionPrivateRecord.js +22 -0
  230. package/build/repository/AnonCredsCredentialDefinitionPrivateRecord.js.map +1 -0
  231. package/build/repository/AnonCredsCredentialDefinitionPrivateRepository.d.ts +8 -0
  232. package/build/repository/AnonCredsCredentialDefinitionPrivateRepository.js +35 -0
  233. package/build/repository/AnonCredsCredentialDefinitionPrivateRepository.js.map +1 -0
  234. package/build/repository/AnonCredsCredentialDefinitionRecord.d.ts +38 -0
  235. package/build/repository/AnonCredsCredentialDefinitionRecord.js +29 -0
  236. package/build/repository/AnonCredsCredentialDefinitionRecord.js.map +1 -0
  237. package/build/repository/AnonCredsCredentialDefinitionRepository.d.ts +8 -0
  238. package/build/repository/AnonCredsCredentialDefinitionRepository.js +53 -0
  239. package/build/repository/AnonCredsCredentialDefinitionRepository.js.map +1 -0
  240. package/build/repository/AnonCredsCredentialRecord.d.ts +48 -0
  241. package/build/repository/AnonCredsCredentialRecord.js +37 -0
  242. package/build/repository/AnonCredsCredentialRecord.js.map +1 -0
  243. package/build/repository/AnonCredsCredentialRepository.d.ts +10 -0
  244. package/build/repository/AnonCredsCredentialRepository.js +41 -0
  245. package/build/repository/AnonCredsCredentialRepository.js.map +1 -0
  246. package/build/repository/AnonCredsKeyCorrectnessProofRecord.d.ts +20 -0
  247. package/build/repository/AnonCredsKeyCorrectnessProofRecord.js +22 -0
  248. package/build/repository/AnonCredsKeyCorrectnessProofRecord.js.map +1 -0
  249. package/build/repository/AnonCredsKeyCorrectnessProofRepository.d.ts +8 -0
  250. package/build/repository/AnonCredsKeyCorrectnessProofRepository.js +35 -0
  251. package/build/repository/AnonCredsKeyCorrectnessProofRepository.js.map +1 -0
  252. package/build/repository/AnonCredsLinkSecretRecord.d.ts +23 -0
  253. package/build/repository/AnonCredsLinkSecretRecord.js +22 -0
  254. package/build/repository/AnonCredsLinkSecretRecord.js.map +1 -0
  255. package/build/repository/AnonCredsLinkSecretRepository.d.ts +10 -0
  256. package/build/repository/AnonCredsLinkSecretRepository.js +41 -0
  257. package/build/repository/AnonCredsLinkSecretRepository.js.map +1 -0
  258. package/build/repository/AnonCredsRevocationRegistryDefinitionPrivateRecord.d.ts +34 -0
  259. package/build/repository/AnonCredsRevocationRegistryDefinitionPrivateRecord.js +30 -0
  260. package/build/repository/AnonCredsRevocationRegistryDefinitionPrivateRecord.js.map +1 -0
  261. package/build/repository/AnonCredsRevocationRegistryDefinitionPrivateRepository.d.ts +10 -0
  262. package/build/repository/AnonCredsRevocationRegistryDefinitionPrivateRepository.js +38 -0
  263. package/build/repository/AnonCredsRevocationRegistryDefinitionPrivateRepository.js.map +1 -0
  264. package/build/repository/AnonCredsRevocationRegistryDefinitionRecord.d.ts +24 -0
  265. package/build/repository/AnonCredsRevocationRegistryDefinitionRecord.js +22 -0
  266. package/build/repository/AnonCredsRevocationRegistryDefinitionRecord.js.map +1 -0
  267. package/build/repository/AnonCredsRevocationRegistryDefinitionRepository.d.ts +9 -0
  268. package/build/repository/AnonCredsRevocationRegistryDefinitionRepository.js +38 -0
  269. package/build/repository/AnonCredsRevocationRegistryDefinitionRepository.js.map +1 -0
  270. package/build/repository/AnonCredsSchemaRecord.d.ts +38 -0
  271. package/build/repository/AnonCredsSchemaRecord.js +29 -0
  272. package/build/repository/AnonCredsSchemaRecord.js.map +1 -0
  273. package/build/repository/AnonCredsSchemaRepository.d.ts +8 -0
  274. package/build/repository/AnonCredsSchemaRepository.js +53 -0
  275. package/build/repository/AnonCredsSchemaRepository.js.map +1 -0
  276. package/build/repository/anonCredsCredentialDefinitionRecordMetadataTypes.d.ts +9 -0
  277. package/build/repository/anonCredsCredentialDefinitionRecordMetadataTypes.js +9 -0
  278. package/build/repository/anonCredsCredentialDefinitionRecordMetadataTypes.js.map +1 -0
  279. package/build/repository/anonCredsRevocationRegistryDefinitionRecordMetadataTypes.d.ts +9 -0
  280. package/build/repository/anonCredsRevocationRegistryDefinitionRecordMetadataTypes.js +9 -0
  281. package/build/repository/anonCredsRevocationRegistryDefinitionRecordMetadataTypes.js.map +1 -0
  282. package/build/repository/anonCredsSchemaRecordMetadataTypes.d.ts +9 -0
  283. package/build/repository/anonCredsSchemaRecordMetadataTypes.js +9 -0
  284. package/build/repository/anonCredsSchemaRecordMetadataTypes.js.map +1 -0
  285. package/build/repository/index.d.ts +16 -0
  286. package/build/repository/index.js +33 -0
  287. package/build/repository/index.js.map +1 -0
  288. package/build/services/AnonCredsHolderService.d.ts +18 -0
  289. package/build/services/AnonCredsHolderService.js +5 -0
  290. package/build/services/AnonCredsHolderService.js.map +1 -0
  291. package/build/services/AnonCredsHolderServiceOptions.d.ts +99 -0
  292. package/build/services/AnonCredsHolderServiceOptions.js +3 -0
  293. package/build/services/AnonCredsHolderServiceOptions.js.map +1 -0
  294. package/build/services/AnonCredsIssuerService.d.ts +14 -0
  295. package/build/services/AnonCredsIssuerService.js +5 -0
  296. package/build/services/AnonCredsIssuerService.js.map +1 -0
  297. package/build/services/AnonCredsIssuerServiceOptions.d.ts +61 -0
  298. package/build/services/AnonCredsIssuerServiceOptions.js +3 -0
  299. package/build/services/AnonCredsIssuerServiceOptions.js.map +1 -0
  300. package/build/services/AnonCredsVerifierService.d.ts +7 -0
  301. package/build/services/AnonCredsVerifierService.js +5 -0
  302. package/build/services/AnonCredsVerifierService.js.map +1 -0
  303. package/build/services/AnonCredsVerifierServiceOptions.d.ts +25 -0
  304. package/build/services/AnonCredsVerifierServiceOptions.js +3 -0
  305. package/build/services/AnonCredsVerifierServiceOptions.js.map +1 -0
  306. package/build/services/index.d.ts +8 -0
  307. package/build/services/index.js +27 -0
  308. package/build/services/index.js.map +1 -0
  309. package/build/services/registry/AnonCredsRegistry.d.ts +25 -0
  310. package/build/services/registry/AnonCredsRegistry.js +3 -0
  311. package/build/services/registry/AnonCredsRegistry.js.map +1 -0
  312. package/build/services/registry/AnonCredsRegistryService.d.ts +10 -0
  313. package/build/services/registry/AnonCredsRegistryService.js +33 -0
  314. package/build/services/registry/AnonCredsRegistryService.js.map +1 -0
  315. package/build/services/registry/CredentialDefinitionOptions.d.ts +34 -0
  316. package/build/services/registry/CredentialDefinitionOptions.js +3 -0
  317. package/build/services/registry/CredentialDefinitionOptions.js.map +1 -0
  318. package/build/services/registry/RevocationRegistryDefinitionOptions.d.ts +34 -0
  319. package/build/services/registry/RevocationRegistryDefinitionOptions.js +3 -0
  320. package/build/services/registry/RevocationRegistryDefinitionOptions.js.map +1 -0
  321. package/build/services/registry/RevocationStatusListOptions.d.ts +32 -0
  322. package/build/services/registry/RevocationStatusListOptions.js +3 -0
  323. package/build/services/registry/RevocationStatusListOptions.js.map +1 -0
  324. package/build/services/registry/SchemaOptions.d.ts +34 -0
  325. package/build/services/registry/SchemaOptions.js +3 -0
  326. package/build/services/registry/SchemaOptions.js.map +1 -0
  327. package/build/services/registry/base.d.ts +19 -0
  328. package/build/services/registry/base.js +3 -0
  329. package/build/services/registry/base.js.map +1 -0
  330. package/build/services/registry/index.d.ts +7 -0
  331. package/build/services/registry/index.js +23 -0
  332. package/build/services/registry/index.js.map +1 -0
  333. package/build/services/tails/BasicTailsFileService.d.ts +23 -0
  334. package/build/services/tails/BasicTailsFileService.js +65 -0
  335. package/build/services/tails/BasicTailsFileService.js.map +1 -0
  336. package/build/services/tails/TailsFileService.d.ts +42 -0
  337. package/build/services/tails/TailsFileService.js +3 -0
  338. package/build/services/tails/TailsFileService.js.map +1 -0
  339. package/build/services/tails/index.d.ts +2 -0
  340. package/build/services/tails/index.js +19 -0
  341. package/build/services/tails/index.js.map +1 -0
  342. package/build/updates/0.3.1-0.4/credentialDefinition.d.ts +18 -0
  343. package/build/updates/0.3.1-0.4/credentialDefinition.js +57 -0
  344. package/build/updates/0.3.1-0.4/credentialDefinition.js.map +1 -0
  345. package/build/updates/0.3.1-0.4/credentialExchangeRecord.d.ts +69 -0
  346. package/build/updates/0.3.1-0.4/credentialExchangeRecord.js +122 -0
  347. package/build/updates/0.3.1-0.4/credentialExchangeRecord.js.map +1 -0
  348. package/build/updates/0.3.1-0.4/index.d.ts +2 -0
  349. package/build/updates/0.3.1-0.4/index.js +15 -0
  350. package/build/updates/0.3.1-0.4/index.js.map +1 -0
  351. package/build/updates/0.3.1-0.4/linkSecret.d.ts +6 -0
  352. package/build/updates/0.3.1-0.4/linkSecret.js +36 -0
  353. package/build/updates/0.3.1-0.4/linkSecret.js.map +1 -0
  354. package/build/updates/0.3.1-0.4/schema.d.ts +15 -0
  355. package/build/updates/0.3.1-0.4/schema.js +42 -0
  356. package/build/updates/0.3.1-0.4/schema.js.map +1 -0
  357. package/build/updates/0.4-0.5/anonCredsCredentialRecord.d.ts +5 -0
  358. package/build/updates/0.4-0.5/anonCredsCredentialRecord.js +118 -0
  359. package/build/updates/0.4-0.5/anonCredsCredentialRecord.js.map +1 -0
  360. package/build/updates/0.4-0.5/index.d.ts +2 -0
  361. package/build/updates/0.4-0.5/index.js +9 -0
  362. package/build/updates/0.4-0.5/index.js.map +1 -0
  363. package/build/utils/anonCredsObjects.d.ts +26 -0
  364. package/build/utils/anonCredsObjects.js +82 -0
  365. package/build/utils/anonCredsObjects.js.map +1 -0
  366. package/build/utils/areRequestsEqual.d.ts +6 -0
  367. package/build/utils/areRequestsEqual.js +136 -0
  368. package/build/utils/areRequestsEqual.js.map +1 -0
  369. package/build/utils/composeAutoAccept.d.ts +15 -0
  370. package/build/utils/composeAutoAccept.js +27 -0
  371. package/build/utils/composeAutoAccept.js.map +1 -0
  372. package/build/utils/createRequestFromPreview.d.ts +10 -0
  373. package/build/utils/createRequestFromPreview.js +72 -0
  374. package/build/utils/createRequestFromPreview.js.map +1 -0
  375. package/build/utils/credential.d.ts +68 -0
  376. package/build/utils/credential.js +188 -0
  377. package/build/utils/credential.js.map +1 -0
  378. package/build/utils/credentialPreviewAttributes.d.ts +2 -0
  379. package/build/utils/credentialPreviewAttributes.js +25 -0
  380. package/build/utils/credentialPreviewAttributes.js.map +1 -0
  381. package/build/utils/getRevocationRegistries.d.ts +14 -0
  382. package/build/utils/getRevocationRegistries.js +152 -0
  383. package/build/utils/getRevocationRegistries.js.map +1 -0
  384. package/build/utils/hasDuplicateGroupNames.d.ts +2 -0
  385. package/build/utils/hasDuplicateGroupNames.js +23 -0
  386. package/build/utils/hasDuplicateGroupNames.js.map +1 -0
  387. package/build/utils/index.d.ts +16 -0
  388. package/build/utils/index.js +46 -0
  389. package/build/utils/index.js.map +1 -0
  390. package/build/utils/indyIdentifiers.d.ts +66 -0
  391. package/build/utils/indyIdentifiers.js +296 -0
  392. package/build/utils/indyIdentifiers.js.map +1 -0
  393. package/build/utils/isMap.d.ts +5 -0
  394. package/build/utils/isMap.js +18 -0
  395. package/build/utils/isMap.js.map +1 -0
  396. package/build/utils/linkSecret.d.ts +9 -0
  397. package/build/utils/linkSecret.js +44 -0
  398. package/build/utils/linkSecret.js.map +1 -0
  399. package/build/utils/metadata.d.ts +35 -0
  400. package/build/utils/metadata.js +24 -0
  401. package/build/utils/metadata.js.map +1 -0
  402. package/build/utils/proverDid.d.ts +8 -0
  403. package/build/utils/proverDid.js +16 -0
  404. package/build/utils/proverDid.js.map +1 -0
  405. package/build/utils/revocationInterval.d.ts +7 -0
  406. package/build/utils/revocationInterval.js +15 -0
  407. package/build/utils/revocationInterval.js.map +1 -0
  408. package/build/utils/sortRequestedCredentialsMatches.d.ts +8 -0
  409. package/build/utils/sortRequestedCredentialsMatches.js +33 -0
  410. package/build/utils/sortRequestedCredentialsMatches.js.map +1 -0
  411. package/build/utils/timestamp.d.ts +1 -0
  412. package/build/utils/timestamp.js +7 -0
  413. package/build/utils/timestamp.js.map +1 -0
  414. package/build/utils/w3cAnonCredsUtils.d.ts +35 -0
  415. package/build/utils/w3cAnonCredsUtils.js +124 -0
  416. package/build/utils/w3cAnonCredsUtils.js.map +1 -0
  417. package/package.json +47 -0
@@ -0,0 +1,296 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getQualifiedDidIndyRevocationRegistryDefinition = exports.isQualifiedRevocationRegistryDefinition = exports.getUnqualifiedDidIndyRevocationRegistryDefinition = exports.isUnqualifiedDidIndyRevocationRegistryDefinition = exports.getQualifiedDidIndyCredentialDefinition = exports.isQualifiedDidIndyCredentialDefinition = exports.getUnqualifiedDidIndyCredentialDefinition = exports.isUnqualifiedDidIndyCredentialDefinition = exports.getQualifiedDidIndySchema = exports.isQualifiedDidIndySchema = exports.getUnqualifiedDidIndySchema = exports.isUnqualifiedDidIndySchema = exports.getQualifiedDidIndyDid = exports.isIndyDid = exports.getUnQualifiedDidIndyDid = exports.getIndyNamespaceFromIndyDid = exports.parseIndyRevocationRegistryId = exports.parseIndyCredentialDefinitionId = exports.parseIndySchemaId = exports.parseIndyDid = exports.isDidIndyRevocationRegistryId = exports.isDidIndyCredentialDefinitionId = exports.isDidIndySchemaId = exports.isUnqualifiedSchemaId = exports.isUnqualifiedRevocationRegistryId = exports.isUnqualifiedCredentialDefinitionId = exports.isUnqualifiedIndyDid = exports.getUnqualifiedRevocationRegistryDefinitionId = exports.getUnqualifiedCredentialDefinitionId = exports.getUnqualifiedSchemaId = exports.didIndyRegex = exports.didIndyRevocationRegistryIdRegex = exports.unqualifiedRevocationRegistryIdRegex = exports.didIndyCredentialDefinitionIdRegex = exports.unqualifiedCredentialDefinitionIdRegex = exports.unqualifiedIndyDidRegex = exports.unqualifiedSchemaVersionRegex = exports.didIndySchemaIdRegex = exports.unqualifiedSchemaIdRegex = void 0;
4
+ const core_1 = require("@credo-ts/core");
5
+ 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/;
6
+ // <namespaceIdentifier>:2:<schemaName>:<schemaVersion>
7
+ exports.unqualifiedSchemaIdRegex = /^([a-zA-Z0-9]{21,22}):2:(.+):([0-9.]+)$/;
8
+ // did:indy:<namespace>:<namespaceIdentifier>/anoncreds/v0/SCHEMA/<schemaName>/<schemaVersion>
9
+ exports.didIndySchemaIdRegex = new RegExp(`^${didIndyAnonCredsBase.source}/SCHEMA/(.+)/([0-9.]+)$`);
10
+ exports.unqualifiedSchemaVersionRegex = /^(\d+\.)?(\d+\.)?(\*|\d+)$/;
11
+ exports.unqualifiedIndyDidRegex = /^(did:sov:)?[a-zA-Z0-9]{21,22}$/;
12
+ // <namespaceIdentifier>:3:CL:<schemaSeqNo>:<tag>
13
+ exports.unqualifiedCredentialDefinitionIdRegex = /^([a-zA-Z0-9]{21,22}):3:CL:([1-9][0-9]*):(.+)$/;
14
+ // did:indy:<namespace>:<namespaceIdentifier>/anoncreds/v0/CLAIM_DEF/<schemaSeqNo>/<tag>
15
+ exports.didIndyCredentialDefinitionIdRegex = new RegExp(`^${didIndyAnonCredsBase.source}/CLAIM_DEF/([1-9][0-9]*)/(.+)$`);
16
+ // <namespaceIdentifier>:4:<namespaceIdentifier>:3:CL:<schemaSeqNo>:<credentialDefinitionTag>:CL_ACCUM:<revocationRegistryTag>
17
+ exports.unqualifiedRevocationRegistryIdRegex = /^([a-zA-Z0-9]{21,22}):4:[a-zA-Z0-9]{21,22}:3:CL:([1-9][0-9]*):(.+):CL_ACCUM:(.+)$/;
18
+ // did:indy:<namespace>:<namespaceIdentifier>/anoncreds/v0/REV_REG_DEF/<schemaSeqNo>/<credentialDefinitionTag>/<revocationRegistryTag>
19
+ exports.didIndyRevocationRegistryIdRegex = new RegExp(`^${didIndyAnonCredsBase.source}/REV_REG_DEF/([1-9][0-9]*)/(.+)/(.+)$`);
20
+ exports.didIndyRegex = /^did:indy:((?:[a-z][_a-z0-9-]*)(?::[a-z][_a-z0-9-]*)?):([1-9A-HJ-NP-Za-km-z]{21,22})$/;
21
+ function getUnqualifiedSchemaId(unqualifiedDid, name, version) {
22
+ return `${unqualifiedDid}:2:${name}:${version}`;
23
+ }
24
+ exports.getUnqualifiedSchemaId = getUnqualifiedSchemaId;
25
+ function getUnqualifiedCredentialDefinitionId(unqualifiedDid, schemaSeqNo, tag) {
26
+ return `${unqualifiedDid}:3:CL:${schemaSeqNo}:${tag}`;
27
+ }
28
+ exports.getUnqualifiedCredentialDefinitionId = getUnqualifiedCredentialDefinitionId;
29
+ // TZQuLp43UcYTdtc3HewcDz:4:TZQuLp43UcYTdtc3HewcDz:3:CL:98158:BaustellenzertifikateNU1:CL_ACCUM:1-100
30
+ function getUnqualifiedRevocationRegistryDefinitionId(unqualifiedDid, schemaSeqNo, credentialDefinitionTag, revocationRegistryTag) {
31
+ return `${unqualifiedDid}:4:${unqualifiedDid}:3:CL:${schemaSeqNo}:${credentialDefinitionTag}:CL_ACCUM:${revocationRegistryTag}`;
32
+ }
33
+ exports.getUnqualifiedRevocationRegistryDefinitionId = getUnqualifiedRevocationRegistryDefinitionId;
34
+ function isUnqualifiedIndyDid(did) {
35
+ return exports.unqualifiedIndyDidRegex.test(did);
36
+ }
37
+ exports.isUnqualifiedIndyDid = isUnqualifiedIndyDid;
38
+ function isUnqualifiedCredentialDefinitionId(credentialDefinitionId) {
39
+ return exports.unqualifiedCredentialDefinitionIdRegex.test(credentialDefinitionId);
40
+ }
41
+ exports.isUnqualifiedCredentialDefinitionId = isUnqualifiedCredentialDefinitionId;
42
+ function isUnqualifiedRevocationRegistryId(revocationRegistryId) {
43
+ return exports.unqualifiedRevocationRegistryIdRegex.test(revocationRegistryId);
44
+ }
45
+ exports.isUnqualifiedRevocationRegistryId = isUnqualifiedRevocationRegistryId;
46
+ function isUnqualifiedSchemaId(schemaId) {
47
+ return exports.unqualifiedSchemaIdRegex.test(schemaId);
48
+ }
49
+ exports.isUnqualifiedSchemaId = isUnqualifiedSchemaId;
50
+ function isDidIndySchemaId(schemaId) {
51
+ return exports.didIndySchemaIdRegex.test(schemaId);
52
+ }
53
+ exports.isDidIndySchemaId = isDidIndySchemaId;
54
+ function isDidIndyCredentialDefinitionId(credentialDefinitionId) {
55
+ return exports.didIndyCredentialDefinitionIdRegex.test(credentialDefinitionId);
56
+ }
57
+ exports.isDidIndyCredentialDefinitionId = isDidIndyCredentialDefinitionId;
58
+ function isDidIndyRevocationRegistryId(revocationRegistryId) {
59
+ return exports.didIndyRevocationRegistryIdRegex.test(revocationRegistryId);
60
+ }
61
+ exports.isDidIndyRevocationRegistryId = isDidIndyRevocationRegistryId;
62
+ function parseIndyDid(did) {
63
+ const match = did.match(exports.didIndyRegex);
64
+ if (match) {
65
+ const [, namespace, namespaceIdentifier] = match;
66
+ return { namespace, namespaceIdentifier };
67
+ }
68
+ else {
69
+ throw new core_1.CredoError(`${did} is not a valid did:indy did`);
70
+ }
71
+ }
72
+ exports.parseIndyDid = parseIndyDid;
73
+ function parseIndySchemaId(schemaId) {
74
+ const didIndyMatch = schemaId.match(exports.didIndySchemaIdRegex);
75
+ if (didIndyMatch) {
76
+ const [, did, namespace, namespaceIdentifier, schemaName, schemaVersion] = didIndyMatch;
77
+ return {
78
+ did,
79
+ namespaceIdentifier,
80
+ schemaName,
81
+ schemaVersion,
82
+ namespace,
83
+ };
84
+ }
85
+ const legacyMatch = schemaId.match(exports.unqualifiedSchemaIdRegex);
86
+ if (legacyMatch) {
87
+ const [, did, schemaName, schemaVersion] = legacyMatch;
88
+ return {
89
+ did,
90
+ namespaceIdentifier: did,
91
+ schemaName,
92
+ schemaVersion,
93
+ };
94
+ }
95
+ throw new Error(`Invalid schema id: ${schemaId}`);
96
+ }
97
+ exports.parseIndySchemaId = parseIndySchemaId;
98
+ function parseIndyCredentialDefinitionId(credentialDefinitionId) {
99
+ const didIndyMatch = credentialDefinitionId.match(exports.didIndyCredentialDefinitionIdRegex);
100
+ if (didIndyMatch) {
101
+ const [, did, namespace, namespaceIdentifier, schemaSeqNo, tag] = didIndyMatch;
102
+ return {
103
+ did,
104
+ namespaceIdentifier,
105
+ schemaSeqNo,
106
+ tag,
107
+ namespace,
108
+ };
109
+ }
110
+ const legacyMatch = credentialDefinitionId.match(exports.unqualifiedCredentialDefinitionIdRegex);
111
+ if (legacyMatch) {
112
+ const [, did, schemaSeqNo, tag] = legacyMatch;
113
+ return {
114
+ did,
115
+ namespaceIdentifier: did,
116
+ schemaSeqNo,
117
+ tag,
118
+ };
119
+ }
120
+ throw new Error(`Invalid credential definition id: ${credentialDefinitionId}`);
121
+ }
122
+ exports.parseIndyCredentialDefinitionId = parseIndyCredentialDefinitionId;
123
+ function parseIndyRevocationRegistryId(revocationRegistryId) {
124
+ const didIndyMatch = revocationRegistryId.match(exports.didIndyRevocationRegistryIdRegex);
125
+ if (didIndyMatch) {
126
+ const [, did, namespace, namespaceIdentifier, schemaSeqNo, credentialDefinitionTag, revocationRegistryTag] = didIndyMatch;
127
+ return {
128
+ did,
129
+ namespaceIdentifier,
130
+ schemaSeqNo,
131
+ credentialDefinitionTag,
132
+ revocationRegistryTag,
133
+ namespace,
134
+ };
135
+ }
136
+ const legacyMatch = revocationRegistryId.match(exports.unqualifiedRevocationRegistryIdRegex);
137
+ if (legacyMatch) {
138
+ const [, did, schemaSeqNo, credentialDefinitionTag, revocationRegistryTag] = legacyMatch;
139
+ return {
140
+ did,
141
+ namespaceIdentifier: did,
142
+ schemaSeqNo,
143
+ credentialDefinitionTag,
144
+ revocationRegistryTag,
145
+ };
146
+ }
147
+ throw new Error(`Invalid revocation registry id: ${revocationRegistryId}`);
148
+ }
149
+ exports.parseIndyRevocationRegistryId = parseIndyRevocationRegistryId;
150
+ function getIndyNamespaceFromIndyDid(identifier) {
151
+ let namespace;
152
+ if (isDidIndySchemaId(identifier)) {
153
+ namespace = parseIndySchemaId(identifier).namespace;
154
+ }
155
+ else if (isDidIndyCredentialDefinitionId(identifier)) {
156
+ namespace = parseIndyCredentialDefinitionId(identifier).namespace;
157
+ }
158
+ else if (isDidIndyRevocationRegistryId(identifier)) {
159
+ namespace = parseIndyRevocationRegistryId(identifier).namespace;
160
+ }
161
+ else {
162
+ namespace = parseIndyDid(identifier).namespace;
163
+ }
164
+ if (!namespace)
165
+ throw new core_1.CredoError(`Cannot get indy namespace of identifier '${identifier}'`);
166
+ return namespace;
167
+ }
168
+ exports.getIndyNamespaceFromIndyDid = getIndyNamespaceFromIndyDid;
169
+ function getUnQualifiedDidIndyDid(identifier) {
170
+ if (isDidIndySchemaId(identifier)) {
171
+ const { schemaName, schemaVersion, namespaceIdentifier } = parseIndySchemaId(identifier);
172
+ return getUnqualifiedSchemaId(namespaceIdentifier, schemaName, schemaVersion);
173
+ }
174
+ else if (isDidIndyCredentialDefinitionId(identifier)) {
175
+ const { schemaSeqNo, tag, namespaceIdentifier } = parseIndyCredentialDefinitionId(identifier);
176
+ return getUnqualifiedCredentialDefinitionId(namespaceIdentifier, schemaSeqNo, tag);
177
+ }
178
+ else if (isDidIndyRevocationRegistryId(identifier)) {
179
+ const { namespaceIdentifier, schemaSeqNo, credentialDefinitionTag, revocationRegistryTag } = parseIndyRevocationRegistryId(identifier);
180
+ return getUnqualifiedRevocationRegistryDefinitionId(namespaceIdentifier, schemaSeqNo, credentialDefinitionTag, revocationRegistryTag);
181
+ }
182
+ const { namespaceIdentifier } = parseIndyDid(identifier);
183
+ return namespaceIdentifier;
184
+ }
185
+ exports.getUnQualifiedDidIndyDid = getUnQualifiedDidIndyDid;
186
+ function isIndyDid(identifier) {
187
+ return identifier.startsWith('did:indy:');
188
+ }
189
+ exports.isIndyDid = isIndyDid;
190
+ function getQualifiedDidIndyDid(identifier, namespace) {
191
+ if (isIndyDid(identifier))
192
+ return identifier;
193
+ if (!namespace || typeof namespace !== 'string') {
194
+ throw new core_1.CredoError('Missing required indy namespace');
195
+ }
196
+ if (isUnqualifiedSchemaId(identifier)) {
197
+ const { namespaceIdentifier, schemaName, schemaVersion } = parseIndySchemaId(identifier);
198
+ const schemaId = `did:indy:${namespace}:${namespaceIdentifier}/anoncreds/v0/SCHEMA/${schemaName}/${schemaVersion}`;
199
+ return schemaId;
200
+ }
201
+ else if (isUnqualifiedCredentialDefinitionId(identifier)) {
202
+ const { namespaceIdentifier, schemaSeqNo, tag } = parseIndyCredentialDefinitionId(identifier);
203
+ const credentialDefinitionId = `did:indy:${namespace}:${namespaceIdentifier}/anoncreds/v0/CLAIM_DEF/${schemaSeqNo}/${tag}`;
204
+ return credentialDefinitionId;
205
+ }
206
+ else if (isUnqualifiedRevocationRegistryId(identifier)) {
207
+ const { namespaceIdentifier, schemaSeqNo, revocationRegistryTag } = parseIndyRevocationRegistryId(identifier);
208
+ const revocationRegistryId = `did:indy:${namespace}:${namespaceIdentifier}/anoncreds/v0/REV_REG_DEF/${schemaSeqNo}/${revocationRegistryTag}`;
209
+ return revocationRegistryId;
210
+ }
211
+ else if (isUnqualifiedIndyDid(identifier)) {
212
+ return `did:indy:${namespace}:${identifier}`;
213
+ }
214
+ else {
215
+ throw new core_1.CredoError(`Cannot created qualified indy identifier for '${identifier}' with namespace '${namespace}'`);
216
+ }
217
+ }
218
+ exports.getQualifiedDidIndyDid = getQualifiedDidIndyDid;
219
+ // -- schema -- //
220
+ function isUnqualifiedDidIndySchema(schema) {
221
+ return isUnqualifiedIndyDid(schema.issuerId);
222
+ }
223
+ exports.isUnqualifiedDidIndySchema = isUnqualifiedDidIndySchema;
224
+ function getUnqualifiedDidIndySchema(schema) {
225
+ if (isUnqualifiedDidIndySchema(schema))
226
+ return Object.assign({}, schema);
227
+ if (!isIndyDid(schema.issuerId)) {
228
+ throw new core_1.CredoError(`IssuerId '${schema.issuerId}' is not a valid qualified did-indy did.`);
229
+ }
230
+ const issuerId = getUnQualifiedDidIndyDid(schema.issuerId);
231
+ return Object.assign(Object.assign({}, schema), { issuerId });
232
+ }
233
+ exports.getUnqualifiedDidIndySchema = getUnqualifiedDidIndySchema;
234
+ function isQualifiedDidIndySchema(schema) {
235
+ return !isUnqualifiedIndyDid(schema.issuerId);
236
+ }
237
+ exports.isQualifiedDidIndySchema = isQualifiedDidIndySchema;
238
+ function getQualifiedDidIndySchema(schema, namespace) {
239
+ if (isQualifiedDidIndySchema(schema))
240
+ return Object.assign({}, schema);
241
+ return Object.assign(Object.assign({}, schema), { issuerId: getQualifiedDidIndyDid(schema.issuerId, namespace) });
242
+ }
243
+ exports.getQualifiedDidIndySchema = getQualifiedDidIndySchema;
244
+ // -- credential definition -- //
245
+ function isUnqualifiedDidIndyCredentialDefinition(anonCredsCredentialDefinition) {
246
+ return (isUnqualifiedIndyDid(anonCredsCredentialDefinition.issuerId) &&
247
+ isUnqualifiedSchemaId(anonCredsCredentialDefinition.schemaId));
248
+ }
249
+ exports.isUnqualifiedDidIndyCredentialDefinition = isUnqualifiedDidIndyCredentialDefinition;
250
+ function getUnqualifiedDidIndyCredentialDefinition(anonCredsCredentialDefinition) {
251
+ if (isUnqualifiedDidIndyCredentialDefinition(anonCredsCredentialDefinition)) {
252
+ return Object.assign({}, anonCredsCredentialDefinition);
253
+ }
254
+ const issuerId = getUnQualifiedDidIndyDid(anonCredsCredentialDefinition.issuerId);
255
+ const schemaId = getUnQualifiedDidIndyDid(anonCredsCredentialDefinition.schemaId);
256
+ return Object.assign(Object.assign({}, anonCredsCredentialDefinition), { issuerId, schemaId });
257
+ }
258
+ exports.getUnqualifiedDidIndyCredentialDefinition = getUnqualifiedDidIndyCredentialDefinition;
259
+ function isQualifiedDidIndyCredentialDefinition(anonCredsCredentialDefinition) {
260
+ return (!isUnqualifiedIndyDid(anonCredsCredentialDefinition.issuerId) &&
261
+ !isUnqualifiedSchemaId(anonCredsCredentialDefinition.schemaId));
262
+ }
263
+ exports.isQualifiedDidIndyCredentialDefinition = isQualifiedDidIndyCredentialDefinition;
264
+ function getQualifiedDidIndyCredentialDefinition(anonCredsCredentialDefinition, namespace) {
265
+ if (isQualifiedDidIndyCredentialDefinition(anonCredsCredentialDefinition))
266
+ return Object.assign({}, anonCredsCredentialDefinition);
267
+ return Object.assign(Object.assign({}, anonCredsCredentialDefinition), { issuerId: getQualifiedDidIndyDid(anonCredsCredentialDefinition.issuerId, namespace), schemaId: getQualifiedDidIndyDid(anonCredsCredentialDefinition.schemaId, namespace) });
268
+ }
269
+ exports.getQualifiedDidIndyCredentialDefinition = getQualifiedDidIndyCredentialDefinition;
270
+ // -- revocation registry definition -- //
271
+ function isUnqualifiedDidIndyRevocationRegistryDefinition(revocationRegistryDefinition) {
272
+ return (isUnqualifiedIndyDid(revocationRegistryDefinition.issuerId) &&
273
+ isUnqualifiedCredentialDefinitionId(revocationRegistryDefinition.credDefId));
274
+ }
275
+ exports.isUnqualifiedDidIndyRevocationRegistryDefinition = isUnqualifiedDidIndyRevocationRegistryDefinition;
276
+ function getUnqualifiedDidIndyRevocationRegistryDefinition(revocationRegistryDefinition) {
277
+ if (isUnqualifiedDidIndyRevocationRegistryDefinition(revocationRegistryDefinition)) {
278
+ return Object.assign({}, revocationRegistryDefinition);
279
+ }
280
+ const issuerId = getUnQualifiedDidIndyDid(revocationRegistryDefinition.issuerId);
281
+ const credDefId = getUnQualifiedDidIndyDid(revocationRegistryDefinition.credDefId);
282
+ return Object.assign(Object.assign({}, revocationRegistryDefinition), { issuerId, credDefId });
283
+ }
284
+ exports.getUnqualifiedDidIndyRevocationRegistryDefinition = getUnqualifiedDidIndyRevocationRegistryDefinition;
285
+ function isQualifiedRevocationRegistryDefinition(revocationRegistryDefinition) {
286
+ return (!isUnqualifiedIndyDid(revocationRegistryDefinition.issuerId) &&
287
+ !isUnqualifiedCredentialDefinitionId(revocationRegistryDefinition.credDefId));
288
+ }
289
+ exports.isQualifiedRevocationRegistryDefinition = isQualifiedRevocationRegistryDefinition;
290
+ function getQualifiedDidIndyRevocationRegistryDefinition(revocationRegistryDefinition, namespace) {
291
+ if (isQualifiedRevocationRegistryDefinition(revocationRegistryDefinition))
292
+ return Object.assign({}, revocationRegistryDefinition);
293
+ return Object.assign(Object.assign({}, revocationRegistryDefinition), { issuerId: getQualifiedDidIndyDid(revocationRegistryDefinition.issuerId, namespace), credDefId: getQualifiedDidIndyDid(revocationRegistryDefinition.credDefId, namespace) });
294
+ }
295
+ exports.getQualifiedDidIndyRevocationRegistryDefinition = getQualifiedDidIndyRevocationRegistryDefinition;
296
+ //# sourceMappingURL=indyIdentifiers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"indyIdentifiers.js","sourceRoot":"","sources":["../../src/utils/indyIdentifiers.ts"],"names":[],"mappings":";;;AAEA,yCAA2C;AAE3C,MAAM,oBAAoB,GACxB,sGAAsG,CAAA;AAExG,uDAAuD;AAC1C,QAAA,wBAAwB,GAAG,yCAAyC,CAAA;AACjF,8FAA8F;AACjF,QAAA,oBAAoB,GAAG,IAAI,MAAM,CAAC,IAAI,oBAAoB,CAAC,MAAM,yBAAyB,CAAC,CAAA;AAE3F,QAAA,6BAA6B,GAAG,4BAA4B,CAAA;AAC5D,QAAA,uBAAuB,GAAG,iCAAiC,CAAA;AAExE,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AC,IACrF;AACH,CAAC;AAXD,0GAWC"}
@@ -0,0 +1,5 @@
1
+ import type { ValidationOptions } from 'class-validator';
2
+ /**
3
+ * Checks if a given value is a Map
4
+ */
5
+ export declare function IsMap(validationOptions?: ValidationOptions): PropertyDecorator;
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.IsMap = void 0;
4
+ const class_validator_1 = require("class-validator");
5
+ /**
6
+ * Checks if a given value is a Map
7
+ */
8
+ function IsMap(validationOptions) {
9
+ return (0, class_validator_1.ValidateBy)({
10
+ name: 'isMap',
11
+ validator: {
12
+ validate: (value) => value instanceof Map,
13
+ defaultMessage: (0, class_validator_1.buildMessage)((eachPrefix) => eachPrefix + '$property must be a Map', validationOptions),
14
+ },
15
+ }, validationOptions);
16
+ }
17
+ exports.IsMap = IsMap;
18
+ //# sourceMappingURL=isMap.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isMap.js","sourceRoot":"","sources":["../../src/utils/isMap.ts"],"names":[],"mappings":";;;AAEA,qDAA0D;AAE1D;;GAEG;AACH,SAAgB,KAAK,CAAC,iBAAqC;IACzD,OAAO,IAAA,4BAAU,EACf;QACE,IAAI,EAAE,OAAO;QACb,SAAS,EAAE;YACT,QAAQ,EAAE,CAAC,KAAc,EAAW,EAAE,CAAC,KAAK,YAAY,GAAG;YAC3D,cAAc,EAAE,IAAA,8BAAY,EAAC,CAAC,UAAU,EAAE,EAAE,CAAC,UAAU,GAAG,yBAAyB,EAAE,iBAAiB,CAAC;SACxG;KACF,EACD,iBAAiB,CAClB,CAAA;AACH,CAAC;AAXD,sBAWC"}
@@ -0,0 +1,9 @@
1
+ import type { AgentContext } from '@credo-ts/core';
2
+ import { AnonCredsLinkSecretRecord } from '../repository';
3
+ export declare function storeLinkSecret(agentContext: AgentContext, options: {
4
+ linkSecretId: string;
5
+ linkSecretValue?: string;
6
+ setAsDefault?: boolean;
7
+ }): Promise<AnonCredsLinkSecretRecord>;
8
+ export declare function assertLinkSecretsMatch(agentContext: AgentContext, linkSecretIds: string[]): string;
9
+ export declare function getLinkSecret(agentContext: AgentContext, linkSecretId: string): Promise<string>;
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getLinkSecret = exports.assertLinkSecretsMatch = exports.storeLinkSecret = void 0;
4
+ const AnonCredsRsError_1 = require("../error/AnonCredsRsError");
5
+ const repository_1 = require("../repository");
6
+ async function storeLinkSecret(agentContext, options) {
7
+ const { linkSecretId, linkSecretValue, setAsDefault } = options;
8
+ const linkSecretRepository = agentContext.dependencyManager.resolve(repository_1.AnonCredsLinkSecretRepository);
9
+ // In some cases we don't have the linkSecretValue. However we still want a record so we know which link secret ids are valid
10
+ const linkSecretRecord = new repository_1.AnonCredsLinkSecretRecord({ linkSecretId, value: linkSecretValue });
11
+ // If it is the first link secret registered, set as default
12
+ const defaultLinkSecretRecord = await linkSecretRepository.findDefault(agentContext);
13
+ if (!defaultLinkSecretRecord || setAsDefault) {
14
+ linkSecretRecord.setTag('isDefault', true);
15
+ }
16
+ // Set the current default link secret as not default
17
+ if (defaultLinkSecretRecord && setAsDefault) {
18
+ defaultLinkSecretRecord.setTag('isDefault', false);
19
+ await linkSecretRepository.update(agentContext, defaultLinkSecretRecord);
20
+ }
21
+ await linkSecretRepository.save(agentContext, linkSecretRecord);
22
+ return linkSecretRecord;
23
+ }
24
+ exports.storeLinkSecret = storeLinkSecret;
25
+ function assertLinkSecretsMatch(agentContext, linkSecretIds) {
26
+ // Get all requested credentials and take linkSecret. If it's not the same for every credential, throw error
27
+ const linkSecretsMatch = linkSecretIds.every((linkSecretId) => linkSecretId === linkSecretIds[0]);
28
+ if (!linkSecretsMatch) {
29
+ throw new AnonCredsRsError_1.AnonCredsRsError('All credentials in a Proof should have been issued using the same Link Secret');
30
+ }
31
+ return linkSecretIds[0];
32
+ }
33
+ exports.assertLinkSecretsMatch = assertLinkSecretsMatch;
34
+ async function getLinkSecret(agentContext, linkSecretId) {
35
+ const linkSecretRecord = await agentContext.dependencyManager
36
+ .resolve(repository_1.AnonCredsLinkSecretRepository)
37
+ .getByLinkSecretId(agentContext, linkSecretId);
38
+ if (!linkSecretRecord.value) {
39
+ throw new AnonCredsRsError_1.AnonCredsRsError('Link Secret value not stored');
40
+ }
41
+ return linkSecretRecord.value;
42
+ }
43
+ exports.getLinkSecret = getLinkSecret;
44
+ //# sourceMappingURL=linkSecret.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"linkSecret.js","sourceRoot":"","sources":["../../src/utils/linkSecret.ts"],"names":[],"mappings":";;;AAEA,gEAA4D;AAC5D,8CAAwF;AAEjF,KAAK,UAAU,eAAe,CACnC,YAA0B,EAC1B,OAAmF;IAEnF,MAAM,EAAE,YAAY,EAAE,eAAe,EAAE,YAAY,EAAE,GAAG,OAAO,CAAA;IAC/D,MAAM,oBAAoB,GAAG,YAAY,CAAC,iBAAiB,CAAC,OAAO,CAAC,0CAA6B,CAAC,CAAA;IAElG,6HAA6H;IAC7H,MAAM,gBAAgB,GAAG,IAAI,sCAAyB,CAAC,EAAE,YAAY,EAAE,KAAK,EAAE,eAAe,EAAE,CAAC,CAAA;IAEhG,4DAA4D;IAC5D,MAAM,uBAAuB,GAAG,MAAM,oBAAoB,CAAC,WAAW,CAAC,YAAY,CAAC,CAAA;IACpF,IAAI,CAAC,uBAAuB,IAAI,YAAY,EAAE;QAC5C,gBAAgB,CAAC,MAAM,CAAC,WAAW,EAAE,IAAI,CAAC,CAAA;KAC3C;IAED,qDAAqD;IACrD,IAAI,uBAAuB,IAAI,YAAY,EAAE;QAC3C,uBAAuB,CAAC,MAAM,CAAC,WAAW,EAAE,KAAK,CAAC,CAAA;QAClD,MAAM,oBAAoB,CAAC,MAAM,CAAC,YAAY,EAAE,uBAAuB,CAAC,CAAA;KACzE;IAED,MAAM,oBAAoB,CAAC,IAAI,CAAC,YAAY,EAAE,gBAAgB,CAAC,CAAA;IAE/D,OAAO,gBAAgB,CAAA;AACzB,CAAC;AAzBD,0CAyBC;AAED,SAAgB,sBAAsB,CAAC,YAA0B,EAAE,aAAuB;IACxF,4GAA4G;IAC5G,MAAM,gBAAgB,GAAG,aAAa,CAAC,KAAK,CAAC,CAAC,YAAY,EAAE,EAAE,CAAC,YAAY,KAAK,aAAa,CAAC,CAAC,CAAC,CAAC,CAAA;IACjG,IAAI,CAAC,gBAAgB,EAAE;QACrB,MAAM,IAAI,mCAAgB,CAAC,+EAA+E,CAAC,CAAA;KAC5G;IAED,OAAO,aAAa,CAAC,CAAC,CAAC,CAAA;AACzB,CAAC;AARD,wDAQC;AAEM,KAAK,UAAU,aAAa,CAAC,YAA0B,EAAE,YAAoB;IAClF,MAAM,gBAAgB,GAAG,MAAM,YAAY,CAAC,iBAAiB;SAC1D,OAAO,CAAC,0CAA6B,CAAC;SACtC,iBAAiB,CAAC,YAAY,EAAE,YAAY,CAAC,CAAA;IAEhD,IAAI,CAAC,gBAAgB,CAAC,KAAK,EAAE;QAC3B,MAAM,IAAI,mCAAgB,CAAC,8BAA8B,CAAC,CAAA;KAC3D;IAED,OAAO,gBAAgB,CAAC,KAAK,CAAA;AAC/B,CAAC;AAVD,sCAUC"}
@@ -0,0 +1,35 @@
1
+ import type { AnonCredsLinkSecretBlindingData } from '../models';
2
+ export interface AnonCredsCredentialMetadata {
3
+ schemaId?: string;
4
+ credentialDefinitionId?: string;
5
+ revocationRegistryId?: string;
6
+ credentialRevocationId?: string;
7
+ }
8
+ export interface AnonCredsCredentialRequestMetadata {
9
+ link_secret_blinding_data: AnonCredsLinkSecretBlindingData;
10
+ link_secret_name: string;
11
+ nonce: string;
12
+ }
13
+ export interface W3cAnonCredsCredentialMetadata {
14
+ methodName: string;
15
+ credentialRevocationId?: string;
16
+ linkSecretId: string;
17
+ }
18
+ /**
19
+ * Metadata key for strong metadata on an AnonCreds credential.
20
+ *
21
+ * MUST be used with {@link AnonCredsCredentialMetadata}
22
+ */
23
+ export declare const AnonCredsCredentialMetadataKey = "_anoncreds/credential";
24
+ /**
25
+ * Metadata key for strong metadata on an AnonCreds credential request.
26
+ *
27
+ * MUST be used with {@link AnonCredsCredentialRequestMetadata}
28
+ */
29
+ export declare const AnonCredsCredentialRequestMetadataKey = "_anoncreds/credentialRequest";
30
+ /**
31
+ * Metadata key for storing the W3C AnonCreds credential metadata.
32
+ *
33
+ * MUST be used with {@link W3cAnonCredsCredentialMetadata}
34
+ */
35
+ export declare const W3cAnonCredsCredentialMetadataKey = "_w3c/anonCredsMetadata";
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.W3cAnonCredsCredentialMetadataKey = exports.AnonCredsCredentialRequestMetadataKey = exports.AnonCredsCredentialMetadataKey = void 0;
4
+ // TODO: we may want to already support multiple credentials in the metadata of a credential
5
+ // record, as that's what the RFCs support. We already need to write a migration script for modules
6
+ /**
7
+ * Metadata key for strong metadata on an AnonCreds credential.
8
+ *
9
+ * MUST be used with {@link AnonCredsCredentialMetadata}
10
+ */
11
+ exports.AnonCredsCredentialMetadataKey = '_anoncreds/credential';
12
+ /**
13
+ * Metadata key for strong metadata on an AnonCreds credential request.
14
+ *
15
+ * MUST be used with {@link AnonCredsCredentialRequestMetadata}
16
+ */
17
+ exports.AnonCredsCredentialRequestMetadataKey = '_anoncreds/credentialRequest';
18
+ /**
19
+ * Metadata key for storing the W3C AnonCreds credential metadata.
20
+ *
21
+ * MUST be used with {@link W3cAnonCredsCredentialMetadata}
22
+ */
23
+ exports.W3cAnonCredsCredentialMetadataKey = '_w3c/anonCredsMetadata';
24
+ //# sourceMappingURL=metadata.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"metadata.js","sourceRoot":"","sources":["../../src/utils/metadata.ts"],"names":[],"mappings":";;;AAqBA,4FAA4F;AAC5F,mGAAmG;AAEnG;;;;GAIG;AACU,QAAA,8BAA8B,GAAG,uBAAuB,CAAA;AAErE;;;;GAIG;AACU,QAAA,qCAAqC,GAAG,8BAA8B,CAAA;AAEnF;;;;GAIG;AACU,QAAA,iCAAiC,GAAG,wBAAwB,CAAA"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * generates a string that adheres to the format of a legacy indy did.
3
+ *
4
+ * This can be used for the `prover_did` property that is required in the legacy anoncreds credential
5
+ * request. This doesn't actually have to be a did, but some frameworks (like ACA-Py) require it to be
6
+ * an unqualified indy did.
7
+ */
8
+ export declare function generateLegacyProverDidLikeString(): string;
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.generateLegacyProverDidLikeString = void 0;
4
+ const core_1 = require("@credo-ts/core");
5
+ /**
6
+ * generates a string that adheres to the format of a legacy indy did.
7
+ *
8
+ * This can be used for the `prover_did` property that is required in the legacy anoncreds credential
9
+ * request. This doesn't actually have to be a did, but some frameworks (like ACA-Py) require it to be
10
+ * an unqualified indy did.
11
+ */
12
+ function generateLegacyProverDidLikeString() {
13
+ return core_1.TypedArrayEncoder.toBase58(core_1.TypedArrayEncoder.fromString(core_1.utils.uuid()).slice(0, 16));
14
+ }
15
+ exports.generateLegacyProverDidLikeString = generateLegacyProverDidLikeString;
16
+ //# sourceMappingURL=proverDid.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"proverDid.js","sourceRoot":"","sources":["../../src/utils/proverDid.ts"],"names":[],"mappings":";;;AAAA,yCAAyD;AAEzD;;;;;;GAMG;AACH,SAAgB,iCAAiC;IAC/C,OAAO,wBAAiB,CAAC,QAAQ,CAAC,wBAAiB,CAAC,UAAU,CAAC,YAAK,CAAC,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAA;AAC5F,CAAC;AAFD,8EAEC"}
@@ -0,0 +1,7 @@
1
+ import type { AnonCredsNonRevokedInterval } from '../models';
2
+ interface BestPracticeNonRevokedInterval {
3
+ from?: number;
4
+ to: number;
5
+ }
6
+ export declare function assertBestPracticeRevocationInterval(revocationInterval: AnonCredsNonRevokedInterval): asserts revocationInterval is BestPracticeNonRevokedInterval;
7
+ export {};
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.assertBestPracticeRevocationInterval = void 0;
4
+ const core_1 = require("@credo-ts/core");
5
+ // Check revocation interval in accordance with https://github.com/hyperledger/aries-rfcs/blob/main/concepts/0441-present-proof-best-practices/README.md#semantics-of-non-revocation-interval-endpoints
6
+ function assertBestPracticeRevocationInterval(revocationInterval) {
7
+ if (!revocationInterval.to) {
8
+ throw new core_1.CredoError(`Presentation requests proof of non-revocation with no 'to' value specified`);
9
+ }
10
+ if ((revocationInterval.from || revocationInterval.from === 0) && revocationInterval.to !== revocationInterval.from) {
11
+ throw new core_1.CredoError(`Presentation requests proof of non-revocation with an interval from: '${revocationInterval.from}' that does not match the interval to: '${revocationInterval.to}', as specified in Aries RFC 0441`);
12
+ }
13
+ }
14
+ exports.assertBestPracticeRevocationInterval = assertBestPracticeRevocationInterval;
15
+ //# sourceMappingURL=revocationInterval.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"revocationInterval.js","sourceRoot":"","sources":["../../src/utils/revocationInterval.ts"],"names":[],"mappings":";;;AAEA,yCAA2C;AAS3C,uMAAuM;AACvM,SAAgB,oCAAoC,CAClD,kBAA+C;IAE/C,IAAI,CAAC,kBAAkB,CAAC,EAAE,EAAE;QAC1B,MAAM,IAAI,iBAAU,CAAC,4EAA4E,CAAC,CAAA;KACnG;IAED,IAAI,CAAC,kBAAkB,CAAC,IAAI,IAAI,kBAAkB,CAAC,IAAI,KAAK,CAAC,CAAC,IAAI,kBAAkB,CAAC,EAAE,KAAK,kBAAkB,CAAC,IAAI,EAAE;QACnH,MAAM,IAAI,iBAAU,CAClB,yEAAyE,kBAAkB,CAAC,IAAI,2CAA2C,kBAAkB,CAAC,EAAE,mCAAmC,CACpM,CAAA;KACF;AACH,CAAC;AAZD,oFAYC"}
@@ -0,0 +1,8 @@
1
+ import type { AnonCredsRequestedAttributeMatch, AnonCredsRequestedPredicateMatch } from '../models';
2
+ /**
3
+ * Sort requested attributes and predicates by `revoked` status. The order is:
4
+ * - first credentials with `revoked` set to undefined, this means no revocation status is needed for the credentials
5
+ * - then credentials with `revoked` set to false, this means the credentials are not revoked
6
+ * - then credentials with `revoked` set to true, this means the credentials are revoked
7
+ */
8
+ export declare function sortRequestedCredentialsMatches<Requested extends Array<AnonCredsRequestedAttributeMatch> | Array<AnonCredsRequestedPredicateMatch>>(credentials: Requested): Requested[number][];
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.sortRequestedCredentialsMatches = void 0;
4
+ /**
5
+ * Sort requested attributes and predicates by `revoked` status. The order is:
6
+ * - first credentials with `revoked` set to undefined, this means no revocation status is needed for the credentials
7
+ * - then credentials with `revoked` set to false, this means the credentials are not revoked
8
+ * - then credentials with `revoked` set to true, this means the credentials are revoked
9
+ */
10
+ function sortRequestedCredentialsMatches(credentials) {
11
+ const staySame = 0;
12
+ const credentialGoUp = -1;
13
+ const credentialGoDown = 1;
14
+ // Clone as sort is in place
15
+ const credentialsClone = [...credentials];
16
+ return credentialsClone.sort((credential, compareTo) => {
17
+ // Nothing needs to happen if values are the same
18
+ if (credential.revoked === compareTo.revoked)
19
+ return staySame;
20
+ // Undefined always is at the top
21
+ if (credential.revoked === undefined)
22
+ return credentialGoUp;
23
+ if (compareTo.revoked === undefined)
24
+ return credentialGoDown;
25
+ // Then revoked
26
+ if (credential.revoked === false)
27
+ return credentialGoUp;
28
+ // It means that compareTo is false and credential is true
29
+ return credentialGoDown;
30
+ });
31
+ }
32
+ exports.sortRequestedCredentialsMatches = sortRequestedCredentialsMatches;
33
+ //# sourceMappingURL=sortRequestedCredentialsMatches.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sortRequestedCredentialsMatches.js","sourceRoot":"","sources":["../../src/utils/sortRequestedCredentialsMatches.ts"],"names":[],"mappings":";;;AAEA;;;;;GAKG;AACH,SAAgB,+BAA+B,CAE7C,WAAsB;IACtB,MAAM,QAAQ,GAAG,CAAC,CAAA;IAClB,MAAM,cAAc,GAAG,CAAC,CAAC,CAAA;IACzB,MAAM,gBAAgB,GAAG,CAAC,CAAA;IAE1B,4BAA4B;IAC5B,MAAM,gBAAgB,GAAG,CAAC,GAAG,WAAW,CAAC,CAAA;IAEzC,OAAO,gBAAgB,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,SAAS,EAAE,EAAE;QACrD,iDAAiD;QACjD,IAAI,UAAU,CAAC,OAAO,KAAK,SAAS,CAAC,OAAO;YAAE,OAAO,QAAQ,CAAA;QAE7D,iCAAiC;QACjC,IAAI,UAAU,CAAC,OAAO,KAAK,SAAS;YAAE,OAAO,cAAc,CAAA;QAC3D,IAAI,SAAS,CAAC,OAAO,KAAK,SAAS;YAAE,OAAO,gBAAgB,CAAA;QAE5D,eAAe;QACf,IAAI,UAAU,CAAC,OAAO,KAAK,KAAK;YAAE,OAAO,cAAc,CAAA;QAEvD,0DAA0D;QAC1D,OAAO,gBAAgB,CAAA;IACzB,CAAC,CAAC,CAAA;AACJ,CAAC;AAxBD,0EAwBC"}
@@ -0,0 +1 @@
1
+ export declare const dateToTimestamp: (date: Date) => number;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.dateToTimestamp = void 0;
4
+ // Timestamps are expressed as Unix epoch time (seconds since 1/1/1970)
5
+ const dateToTimestamp = (date) => Math.floor(date.getTime() / 1000);
6
+ exports.dateToTimestamp = dateToTimestamp;
7
+ //# sourceMappingURL=timestamp.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"timestamp.js","sourceRoot":"","sources":["../../src/utils/timestamp.ts"],"names":[],"mappings":";;;AAAA,uEAAuE;AAChE,MAAM,eAAe,GAAG,CAAC,IAAU,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,CAAA;AAAnE,QAAA,eAAe,mBAAoD"}
@@ -0,0 +1,35 @@
1
+ import type { AnonCredsCredentialInfo, AnonCredsSchema } from '../models';
2
+ import type { AnonCredsCredentialRecord } from '../repository';
3
+ import type { StoreCredentialOptions } from '../services';
4
+ import { W3cCredentialRecord } from '@credo-ts/core';
5
+ export type AnonCredsCredentialTags = {
6
+ anonCredsLinkSecretId: string;
7
+ anonCredsCredentialRevocationId?: string;
8
+ anonCredsMethodName: string;
9
+ [key: `anonCredsAttr::${string}::marker`]: true | undefined;
10
+ [key: `anonCredsAttr::${string}::value`]: string | undefined;
11
+ anonCredsSchemaName: string;
12
+ anonCredsSchemaVersion: string;
13
+ anonCredsSchemaId: string;
14
+ anonCredsSchemaIssuerId: string;
15
+ anonCredsCredentialDefinitionId: string;
16
+ anonCredsRevocationRegistryId?: string;
17
+ anonCredsUnqualifiedIssuerId?: string;
18
+ anonCredsUnqualifiedSchemaId?: string;
19
+ anonCredsUnqualifiedSchemaIssuerId?: string;
20
+ anonCredsUnqualifiedCredentialDefinitionId?: string;
21
+ anonCredsUnqualifiedRevocationRegistryId?: string;
22
+ };
23
+ export declare function getAnoncredsCredentialInfoFromRecord(credentialRecord: W3cCredentialRecord | AnonCredsCredentialRecord): AnonCredsCredentialInfo;
24
+ export declare function getAnonCredsTagsFromRecord(record: W3cCredentialRecord): AnonCredsCredentialTags | undefined;
25
+ export declare function getStoreCredentialOptions(options: StoreCredentialOptions, indyNamespace?: string): StoreCredentialOptions;
26
+ export declare function getW3cRecordAnonCredsTags(options: {
27
+ w3cCredentialRecord: W3cCredentialRecord;
28
+ schemaId: string;
29
+ schema: Omit<AnonCredsSchema, 'attrNames'>;
30
+ credentialDefinitionId: string;
31
+ revocationRegistryId?: string;
32
+ credentialRevocationId?: string;
33
+ linkSecretId: string;
34
+ methodName: string;
35
+ }): AnonCredsCredentialTags;