@pagopa/io-react-native-wallet 1.7.0 → 2.0.0-next.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (438) hide show
  1. package/README.md +47 -1
  2. package/lib/commonjs/client/generated/wallet-provider.js +49 -20
  3. package/lib/commonjs/client/generated/wallet-provider.js.map +1 -1
  4. package/lib/commonjs/credential/index.js +5 -1
  5. package/lib/commonjs/credential/index.js.map +1 -1
  6. package/lib/commonjs/credential/issuance/02-evaluate-issuer-trust.js +27 -0
  7. package/lib/commonjs/credential/issuance/02-evaluate-issuer-trust.js.map +1 -0
  8. package/lib/commonjs/credential/issuance/03-start-user-authorization.js +25 -16
  9. package/lib/commonjs/credential/issuance/03-start-user-authorization.js.map +1 -1
  10. package/lib/commonjs/credential/issuance/04-complete-user-authorization.js +30 -18
  11. package/lib/commonjs/credential/issuance/04-complete-user-authorization.js.map +1 -1
  12. package/lib/commonjs/credential/issuance/05-authorize-access.js +17 -12
  13. package/lib/commonjs/credential/issuance/05-authorize-access.js.map +1 -1
  14. package/lib/commonjs/credential/issuance/06-obtain-credential.js +36 -29
  15. package/lib/commonjs/credential/issuance/06-obtain-credential.js.map +1 -1
  16. package/lib/commonjs/credential/issuance/07-verify-and-parse-credential.js +27 -207
  17. package/lib/commonjs/credential/issuance/07-verify-and-parse-credential.js.map +1 -1
  18. package/lib/commonjs/credential/issuance/README.md +23 -20
  19. package/lib/commonjs/credential/issuance/const.js +1 -1
  20. package/lib/commonjs/credential/issuance/const.js.map +1 -1
  21. package/lib/commonjs/credential/issuance/index.js +3 -3
  22. package/lib/commonjs/credential/issuance/index.js.map +1 -1
  23. package/lib/commonjs/credential/presentation/01-start-flow.js +14 -15
  24. package/lib/commonjs/credential/presentation/01-start-flow.js.map +1 -1
  25. package/lib/commonjs/credential/presentation/02-evaluate-rp-trust.js +6 -4
  26. package/lib/commonjs/credential/presentation/02-evaluate-rp-trust.js.map +1 -1
  27. package/lib/commonjs/credential/presentation/03-get-request-object.js +34 -7
  28. package/lib/commonjs/credential/presentation/03-get-request-object.js.map +1 -1
  29. package/lib/commonjs/credential/presentation/04-retrieve-rp-jwks.js +4 -126
  30. package/lib/commonjs/credential/presentation/04-retrieve-rp-jwks.js.map +1 -1
  31. package/lib/commonjs/credential/presentation/05-verify-request-object.js +80 -25
  32. package/lib/commonjs/credential/presentation/05-verify-request-object.js.map +1 -1
  33. package/lib/commonjs/credential/presentation/06-fetch-presentation-definition.js +6 -30
  34. package/lib/commonjs/credential/presentation/06-fetch-presentation-definition.js.map +1 -1
  35. package/lib/commonjs/credential/presentation/07-evaluate-dcql-query.js +97 -117
  36. package/lib/commonjs/credential/presentation/07-evaluate-dcql-query.js.map +1 -1
  37. package/lib/commonjs/credential/presentation/07-evaluate-input-descriptor.js +86 -191
  38. package/lib/commonjs/credential/presentation/07-evaluate-input-descriptor.js.map +1 -1
  39. package/lib/commonjs/credential/presentation/08-send-authorization-response.js +112 -176
  40. package/lib/commonjs/credential/presentation/08-send-authorization-response.js.map +1 -1
  41. package/lib/commonjs/credential/presentation/README.md +74 -79
  42. package/lib/commonjs/credential/presentation/errors.js +42 -21
  43. package/lib/commonjs/credential/presentation/errors.js.map +1 -1
  44. package/lib/commonjs/credential/presentation/index.js +13 -13
  45. package/lib/commonjs/credential/presentation/index.js.map +1 -1
  46. package/lib/commonjs/credential/presentation/types.js +53 -29
  47. package/lib/commonjs/credential/presentation/types.js.map +1 -1
  48. package/lib/commonjs/credential/status/01-start-flow.js +2 -0
  49. package/lib/commonjs/credential/status/01-start-flow.js.map +1 -0
  50. package/lib/commonjs/credential/status/02-status-attestation.js +73 -0
  51. package/lib/commonjs/credential/status/02-status-attestation.js.map +1 -0
  52. package/lib/commonjs/credential/status/03-verify-and-parse-status-attestation.js +55 -0
  53. package/lib/commonjs/credential/status/03-verify-and-parse-status-attestation.js.map +1 -0
  54. package/lib/commonjs/credential/status/README.md +67 -0
  55. package/lib/commonjs/credential/status/index.js +27 -0
  56. package/lib/commonjs/credential/status/index.js.map +1 -0
  57. package/lib/commonjs/credential/status/types.js +48 -0
  58. package/lib/commonjs/credential/status/types.js.map +1 -0
  59. package/lib/commonjs/credential/trustmark/README.md +62 -0
  60. package/lib/commonjs/credential/trustmark/get-credential-trustmark.js +86 -0
  61. package/lib/commonjs/credential/trustmark/get-credential-trustmark.js.map +1 -0
  62. package/lib/commonjs/credential/trustmark/index.js +13 -0
  63. package/lib/commonjs/credential/trustmark/index.js.map +1 -0
  64. package/lib/commonjs/index.js +5 -1
  65. package/lib/commonjs/index.js.map +1 -1
  66. package/lib/commonjs/pid/sd-jwt/types.js +18 -2
  67. package/lib/commonjs/pid/sd-jwt/types.js.map +1 -1
  68. package/lib/commonjs/sd-jwt/__test__/index.test.js +22 -34
  69. package/lib/commonjs/sd-jwt/__test__/index.test.js.map +1 -1
  70. package/lib/commonjs/sd-jwt/__test__/types.test.js +11 -23
  71. package/lib/commonjs/sd-jwt/__test__/types.test.js.map +1 -1
  72. package/lib/commonjs/sd-jwt/index.js +1 -7
  73. package/lib/commonjs/sd-jwt/index.js.map +1 -1
  74. package/lib/commonjs/sd-jwt/types.js +5 -21
  75. package/lib/commonjs/sd-jwt/types.js.map +1 -1
  76. package/lib/commonjs/{entity/trust → trust}/chain.js +49 -55
  77. package/lib/commonjs/trust/chain.js.map +1 -0
  78. package/lib/commonjs/trust/errors.js +110 -0
  79. package/lib/commonjs/trust/errors.js.map +1 -0
  80. package/lib/commonjs/trust/index.js +282 -0
  81. package/lib/commonjs/trust/index.js.map +1 -0
  82. package/lib/commonjs/{entity/trust → trust}/types.js +27 -47
  83. package/lib/commonjs/trust/types.js.map +1 -0
  84. package/lib/commonjs/trust/utils.js +41 -0
  85. package/lib/commonjs/trust/utils.js.map +1 -0
  86. package/lib/commonjs/utils/crypto.js +5 -112
  87. package/lib/commonjs/utils/crypto.js.map +1 -1
  88. package/lib/commonjs/utils/decoder.js +2 -0
  89. package/lib/commonjs/utils/decoder.js.map +1 -1
  90. package/lib/commonjs/utils/error-codes.js +22 -2
  91. package/lib/commonjs/utils/error-codes.js.map +1 -1
  92. package/lib/commonjs/utils/errors.js +72 -4
  93. package/lib/commonjs/utils/errors.js.map +1 -1
  94. package/lib/commonjs/utils/logging.js +68 -0
  95. package/lib/commonjs/utils/logging.js.map +1 -0
  96. package/lib/commonjs/utils/misc.js +2 -0
  97. package/lib/commonjs/utils/misc.js.map +1 -1
  98. package/lib/commonjs/utils/par.js +17 -10
  99. package/lib/commonjs/utils/par.js.map +1 -1
  100. package/lib/commonjs/utils/string.js +1 -12
  101. package/lib/commonjs/utils/string.js.map +1 -1
  102. package/lib/commonjs/wallet-instance/index.js +14 -0
  103. package/lib/commonjs/wallet-instance/index.js.map +1 -1
  104. package/lib/commonjs/wallet-instance-attestation/README.md +8 -3
  105. package/lib/commonjs/wallet-instance-attestation/issuing.js +15 -8
  106. package/lib/commonjs/wallet-instance-attestation/issuing.js.map +1 -1
  107. package/lib/commonjs/wallet-instance-attestation/types.js +16 -20
  108. package/lib/commonjs/wallet-instance-attestation/types.js.map +1 -1
  109. package/lib/module/client/generated/wallet-provider.js +40 -15
  110. package/lib/module/client/generated/wallet-provider.js.map +1 -1
  111. package/lib/module/credential/index.js +3 -1
  112. package/lib/module/credential/index.js.map +1 -1
  113. package/lib/module/credential/issuance/02-evaluate-issuer-trust.js +20 -0
  114. package/lib/module/credential/issuance/02-evaluate-issuer-trust.js.map +1 -0
  115. package/lib/module/credential/issuance/03-start-user-authorization.js +25 -16
  116. package/lib/module/credential/issuance/03-start-user-authorization.js.map +1 -1
  117. package/lib/module/credential/issuance/04-complete-user-authorization.js +30 -18
  118. package/lib/module/credential/issuance/04-complete-user-authorization.js.map +1 -1
  119. package/lib/module/credential/issuance/05-authorize-access.js +17 -11
  120. package/lib/module/credential/issuance/05-authorize-access.js.map +1 -1
  121. package/lib/module/credential/issuance/06-obtain-credential.js +36 -28
  122. package/lib/module/credential/issuance/06-obtain-credential.js.map +1 -1
  123. package/lib/module/credential/issuance/07-verify-and-parse-credential.js +27 -205
  124. package/lib/module/credential/issuance/07-verify-and-parse-credential.js.map +1 -1
  125. package/lib/module/credential/issuance/README.md +23 -20
  126. package/lib/module/credential/issuance/const.js +1 -1
  127. package/lib/module/credential/issuance/const.js.map +1 -1
  128. package/lib/module/credential/issuance/index.js +2 -2
  129. package/lib/module/credential/issuance/index.js.map +1 -1
  130. package/lib/module/credential/presentation/01-start-flow.js +14 -15
  131. package/lib/module/credential/presentation/01-start-flow.js.map +1 -1
  132. package/lib/module/credential/presentation/02-evaluate-rp-trust.js +5 -3
  133. package/lib/module/credential/presentation/02-evaluate-rp-trust.js.map +1 -1
  134. package/lib/module/credential/presentation/03-get-request-object.js +34 -7
  135. package/lib/module/credential/presentation/03-get-request-object.js.map +1 -1
  136. package/lib/module/credential/presentation/04-retrieve-rp-jwks.js +2 -124
  137. package/lib/module/credential/presentation/04-retrieve-rp-jwks.js.map +1 -1
  138. package/lib/module/credential/presentation/05-verify-request-object.js +78 -23
  139. package/lib/module/credential/presentation/05-verify-request-object.js.map +1 -1
  140. package/lib/module/credential/presentation/06-fetch-presentation-definition.js +6 -30
  141. package/lib/module/credential/presentation/06-fetch-presentation-definition.js.map +1 -1
  142. package/lib/module/credential/presentation/07-evaluate-dcql-query.js +97 -118
  143. package/lib/module/credential/presentation/07-evaluate-dcql-query.js.map +1 -1
  144. package/lib/module/credential/presentation/07-evaluate-input-descriptor.js +83 -186
  145. package/lib/module/credential/presentation/07-evaluate-input-descriptor.js.map +1 -1
  146. package/lib/module/credential/presentation/08-send-authorization-response.js +107 -170
  147. package/lib/module/credential/presentation/08-send-authorization-response.js.map +1 -1
  148. package/lib/module/credential/presentation/README.md +74 -79
  149. package/lib/module/credential/presentation/errors.js +30 -17
  150. package/lib/module/credential/presentation/errors.js.map +1 -1
  151. package/lib/module/credential/presentation/index.js +6 -6
  152. package/lib/module/credential/presentation/index.js.map +1 -1
  153. package/lib/module/credential/presentation/types.js +49 -27
  154. package/lib/module/credential/presentation/types.js.map +1 -1
  155. package/lib/module/credential/status/01-start-flow.js +2 -0
  156. package/lib/module/credential/status/01-start-flow.js.map +1 -0
  157. package/lib/module/credential/status/02-status-attestation.js +66 -0
  158. package/lib/module/credential/status/02-status-attestation.js.map +1 -0
  159. package/lib/module/credential/status/03-verify-and-parse-status-attestation.js +49 -0
  160. package/lib/module/credential/status/03-verify-and-parse-status-attestation.js.map +1 -0
  161. package/lib/module/credential/status/README.md +67 -0
  162. package/lib/module/credential/status/index.js +5 -0
  163. package/lib/module/credential/status/index.js.map +1 -0
  164. package/lib/module/credential/status/types.js +40 -0
  165. package/lib/module/credential/status/types.js.map +1 -0
  166. package/lib/module/credential/trustmark/README.md +62 -0
  167. package/lib/module/credential/trustmark/get-credential-trustmark.js +77 -0
  168. package/lib/module/credential/trustmark/get-credential-trustmark.js.map +1 -0
  169. package/lib/module/credential/trustmark/index.js +3 -0
  170. package/lib/module/credential/trustmark/index.js.map +1 -0
  171. package/lib/module/index.js +3 -1
  172. package/lib/module/index.js.map +1 -1
  173. package/lib/module/pid/sd-jwt/types.js +16 -1
  174. package/lib/module/pid/sd-jwt/types.js.map +1 -1
  175. package/lib/module/sd-jwt/__test__/index.test.js +22 -34
  176. package/lib/module/sd-jwt/__test__/index.test.js.map +1 -1
  177. package/lib/module/sd-jwt/__test__/types.test.js +11 -23
  178. package/lib/module/sd-jwt/__test__/types.test.js.map +1 -1
  179. package/lib/module/sd-jwt/index.js +1 -7
  180. package/lib/module/sd-jwt/index.js.map +1 -1
  181. package/lib/module/sd-jwt/types.js +4 -19
  182. package/lib/module/sd-jwt/types.js.map +1 -1
  183. package/lib/module/trust/chain.js +108 -0
  184. package/lib/module/trust/chain.js.map +1 -0
  185. package/lib/module/trust/errors.js +94 -0
  186. package/lib/module/trust/errors.js.map +1 -0
  187. package/lib/module/trust/index.js +263 -0
  188. package/lib/module/trust/index.js.map +1 -0
  189. package/lib/module/{entity/trust → trust}/types.js +25 -46
  190. package/lib/module/trust/types.js.map +1 -0
  191. package/lib/module/trust/utils.js +33 -0
  192. package/lib/module/trust/utils.js.map +1 -0
  193. package/lib/module/utils/crypto.js +4 -107
  194. package/lib/module/utils/crypto.js.map +1 -1
  195. package/lib/module/utils/decoder.js +3 -0
  196. package/lib/module/utils/decoder.js.map +1 -1
  197. package/lib/module/utils/error-codes.js +20 -1
  198. package/lib/module/utils/error-codes.js.map +1 -1
  199. package/lib/module/utils/errors.js +61 -4
  200. package/lib/module/utils/errors.js.map +1 -1
  201. package/lib/module/utils/logging.js +62 -0
  202. package/lib/module/utils/logging.js.map +1 -0
  203. package/lib/module/utils/misc.js +2 -0
  204. package/lib/module/utils/misc.js.map +1 -1
  205. package/lib/module/utils/par.js +17 -9
  206. package/lib/module/utils/par.js.map +1 -1
  207. package/lib/module/utils/string.js +0 -10
  208. package/lib/module/utils/string.js.map +1 -1
  209. package/lib/module/wallet-instance/index.js +13 -0
  210. package/lib/module/wallet-instance/index.js.map +1 -1
  211. package/lib/module/wallet-instance-attestation/README.md +8 -3
  212. package/lib/module/wallet-instance-attestation/index.js +2 -2
  213. package/lib/module/wallet-instance-attestation/index.js.map +1 -1
  214. package/lib/module/wallet-instance-attestation/issuing.js +16 -9
  215. package/lib/module/wallet-instance-attestation/issuing.js.map +1 -1
  216. package/lib/module/wallet-instance-attestation/types.js +14 -18
  217. package/lib/module/wallet-instance-attestation/types.js.map +1 -1
  218. package/lib/typescript/client/generated/wallet-provider.d.ts +206 -51
  219. package/lib/typescript/client/generated/wallet-provider.d.ts.map +1 -1
  220. package/lib/typescript/credential/index.d.ts +3 -1
  221. package/lib/typescript/credential/index.d.ts.map +1 -1
  222. package/lib/typescript/credential/issuance/01-start-flow.d.ts +1 -1
  223. package/lib/typescript/credential/issuance/02-evaluate-issuer-trust.d.ts +19 -0
  224. package/lib/typescript/credential/issuance/02-evaluate-issuer-trust.d.ts.map +1 -0
  225. package/lib/typescript/credential/issuance/03-start-user-authorization.d.ts +3 -3
  226. package/lib/typescript/credential/issuance/03-start-user-authorization.d.ts.map +1 -1
  227. package/lib/typescript/credential/issuance/04-complete-user-authorization.d.ts +9 -9
  228. package/lib/typescript/credential/issuance/04-complete-user-authorization.d.ts.map +1 -1
  229. package/lib/typescript/credential/issuance/05-authorize-access.d.ts +3 -3
  230. package/lib/typescript/credential/issuance/05-authorize-access.d.ts.map +1 -1
  231. package/lib/typescript/credential/issuance/06-obtain-credential.d.ts +4 -4
  232. package/lib/typescript/credential/issuance/06-obtain-credential.d.ts.map +1 -1
  233. package/lib/typescript/credential/issuance/07-verify-and-parse-credential.d.ts +3 -15
  234. package/lib/typescript/credential/issuance/07-verify-and-parse-credential.d.ts.map +1 -1
  235. package/lib/typescript/credential/issuance/const.d.ts +1 -1
  236. package/lib/typescript/credential/issuance/const.d.ts.map +1 -1
  237. package/lib/typescript/credential/issuance/index.d.ts +3 -3
  238. package/lib/typescript/credential/issuance/index.d.ts.map +1 -1
  239. package/lib/typescript/credential/issuance/types.d.ts +8 -3
  240. package/lib/typescript/credential/issuance/types.d.ts.map +1 -1
  241. package/lib/typescript/credential/presentation/01-start-flow.d.ts +28 -9
  242. package/lib/typescript/credential/presentation/01-start-flow.d.ts.map +1 -1
  243. package/lib/typescript/credential/presentation/02-evaluate-rp-trust.d.ts +2 -1
  244. package/lib/typescript/credential/presentation/02-evaluate-rp-trust.d.ts.map +1 -1
  245. package/lib/typescript/credential/presentation/03-get-request-object.d.ts +7 -5
  246. package/lib/typescript/credential/presentation/03-get-request-object.d.ts.map +1 -1
  247. package/lib/typescript/credential/presentation/04-retrieve-rp-jwks.d.ts +4 -30
  248. package/lib/typescript/credential/presentation/04-retrieve-rp-jwks.d.ts.map +1 -1
  249. package/lib/typescript/credential/presentation/05-verify-request-object.d.ts +17 -4
  250. package/lib/typescript/credential/presentation/05-verify-request-object.d.ts.map +1 -1
  251. package/lib/typescript/credential/presentation/06-fetch-presentation-definition.d.ts +4 -9
  252. package/lib/typescript/credential/presentation/06-fetch-presentation-definition.d.ts.map +1 -1
  253. package/lib/typescript/credential/presentation/07-evaluate-dcql-query.d.ts +13 -12
  254. package/lib/typescript/credential/presentation/07-evaluate-dcql-query.d.ts.map +1 -1
  255. package/lib/typescript/credential/presentation/07-evaluate-input-descriptor.d.ts +40 -42
  256. package/lib/typescript/credential/presentation/07-evaluate-input-descriptor.d.ts.map +1 -1
  257. package/lib/typescript/credential/presentation/08-send-authorization-response.d.ts +30 -43
  258. package/lib/typescript/credential/presentation/08-send-authorization-response.d.ts.map +1 -1
  259. package/lib/typescript/credential/presentation/errors.d.ts +25 -10
  260. package/lib/typescript/credential/presentation/errors.d.ts.map +1 -1
  261. package/lib/typescript/credential/presentation/index.d.ts +7 -8
  262. package/lib/typescript/credential/presentation/index.d.ts.map +1 -1
  263. package/lib/typescript/credential/presentation/types.d.ts +137 -307
  264. package/lib/typescript/credential/presentation/types.d.ts.map +1 -1
  265. package/lib/typescript/credential/status/01-start-flow.d.ts +10 -0
  266. package/lib/typescript/credential/status/01-start-flow.d.ts.map +1 -0
  267. package/lib/typescript/credential/status/02-status-attestation.d.ts +19 -0
  268. package/lib/typescript/credential/status/02-status-attestation.d.ts.map +1 -0
  269. package/lib/typescript/credential/status/03-verify-and-parse-status-attestation.d.ts +24 -0
  270. package/lib/typescript/credential/status/03-verify-and-parse-status-attestation.d.ts.map +1 -0
  271. package/lib/typescript/credential/status/index.d.ts +7 -0
  272. package/lib/typescript/credential/status/index.d.ts.map +1 -0
  273. package/lib/typescript/credential/status/types.d.ts +305 -0
  274. package/lib/typescript/credential/status/types.d.ts.map +1 -0
  275. package/lib/typescript/credential/trustmark/get-credential-trustmark.d.ts +52 -0
  276. package/lib/typescript/credential/trustmark/get-credential-trustmark.d.ts.map +1 -0
  277. package/lib/typescript/credential/trustmark/index.d.ts +4 -0
  278. package/lib/typescript/credential/trustmark/index.d.ts.map +1 -0
  279. package/lib/typescript/index.d.ts +3 -1
  280. package/lib/typescript/index.d.ts.map +1 -1
  281. package/lib/typescript/pid/sd-jwt/types.d.ts +103 -25
  282. package/lib/typescript/pid/sd-jwt/types.d.ts.map +1 -1
  283. package/lib/typescript/sd-jwt/index.d.ts +30 -82
  284. package/lib/typescript/sd-jwt/index.d.ts.map +1 -1
  285. package/lib/typescript/sd-jwt/types.d.ts +29 -134
  286. package/lib/typescript/sd-jwt/types.d.ts.map +1 -1
  287. package/lib/typescript/{entity/trust → trust}/chain.d.ts +5 -10
  288. package/lib/typescript/trust/chain.d.ts.map +1 -0
  289. package/lib/typescript/trust/errors.d.ts +80 -0
  290. package/lib/typescript/trust/errors.d.ts.map +1 -0
  291. package/lib/typescript/{entity/trust → trust}/index.d.ts +211 -186
  292. package/lib/typescript/trust/index.d.ts.map +1 -0
  293. package/lib/typescript/{entity/trust → trust}/types.d.ts +1533 -1120
  294. package/lib/typescript/{entity/trust → trust}/types.d.ts.map +1 -1
  295. package/lib/typescript/trust/utils.d.ts +12 -0
  296. package/lib/typescript/trust/utils.d.ts.map +1 -0
  297. package/lib/typescript/utils/crypto.d.ts +0 -32
  298. package/lib/typescript/utils/crypto.d.ts.map +1 -1
  299. package/lib/typescript/utils/decoder.d.ts.map +1 -1
  300. package/lib/typescript/utils/error-codes.d.ts +20 -0
  301. package/lib/typescript/utils/error-codes.d.ts.map +1 -1
  302. package/lib/typescript/utils/errors.d.ts +55 -10
  303. package/lib/typescript/utils/errors.d.ts.map +1 -1
  304. package/lib/typescript/utils/logging.d.ts +35 -0
  305. package/lib/typescript/utils/logging.d.ts.map +1 -0
  306. package/lib/typescript/utils/misc.d.ts.map +1 -1
  307. package/lib/typescript/utils/par.d.ts +8 -1
  308. package/lib/typescript/utils/par.d.ts.map +1 -1
  309. package/lib/typescript/utils/string.d.ts +0 -7
  310. package/lib/typescript/utils/string.d.ts.map +1 -1
  311. package/lib/typescript/wallet-instance/index.d.ts +8 -0
  312. package/lib/typescript/wallet-instance/index.d.ts.map +1 -1
  313. package/lib/typescript/wallet-instance-attestation/index.d.ts +1 -2
  314. package/lib/typescript/wallet-instance-attestation/index.d.ts.map +1 -1
  315. package/lib/typescript/wallet-instance-attestation/issuing.d.ts +4 -2
  316. package/lib/typescript/wallet-instance-attestation/issuing.d.ts.map +1 -1
  317. package/lib/typescript/wallet-instance-attestation/types.d.ts +78 -120
  318. package/lib/typescript/wallet-instance-attestation/types.d.ts.map +1 -1
  319. package/package.json +8 -9
  320. package/src/client/generated/wallet-provider.ts +52 -17
  321. package/src/credential/index.ts +4 -1
  322. package/src/credential/issuance/01-start-flow.ts +1 -1
  323. package/src/credential/issuance/02-evaluate-issuer-trust.ts +32 -0
  324. package/src/credential/issuance/03-start-user-authorization.ts +48 -22
  325. package/src/credential/issuance/04-complete-user-authorization.ts +74 -18
  326. package/src/credential/issuance/05-authorize-access.ts +29 -11
  327. package/src/credential/issuance/06-obtain-credential.ts +61 -36
  328. package/src/credential/issuance/07-verify-and-parse-credential.ts +37 -264
  329. package/src/credential/issuance/README.md +23 -20
  330. package/src/credential/issuance/const.ts +1 -1
  331. package/src/credential/issuance/index.ts +6 -3
  332. package/src/credential/presentation/01-start-flow.ts +19 -22
  333. package/src/credential/presentation/02-evaluate-rp-trust.ts +5 -4
  334. package/src/credential/presentation/03-get-request-object.ts +36 -8
  335. package/src/credential/presentation/04-retrieve-rp-jwks.ts +6 -148
  336. package/src/credential/presentation/05-verify-request-object.ts +115 -30
  337. package/src/credential/presentation/06-fetch-presentation-definition.ts +5 -35
  338. package/src/credential/presentation/07-evaluate-dcql-query.ts +132 -161
  339. package/src/credential/presentation/07-evaluate-input-descriptor.ts +136 -254
  340. package/src/credential/presentation/08-send-authorization-response.ts +178 -260
  341. package/src/credential/presentation/README.md +74 -79
  342. package/src/credential/presentation/errors.ts +38 -15
  343. package/src/credential/presentation/index.ts +18 -19
  344. package/src/credential/presentation/types.ts +67 -64
  345. package/src/credential/status/01-start-flow.ts +9 -0
  346. package/src/credential/status/02-status-attestation.ts +105 -0
  347. package/src/credential/status/03-verify-and-parse-status-attestation.ts +70 -0
  348. package/src/credential/status/README.md +67 -0
  349. package/src/credential/status/index.ts +22 -0
  350. package/src/credential/status/types.ts +43 -0
  351. package/src/credential/trustmark/README.md +62 -0
  352. package/src/credential/trustmark/get-credential-trustmark.ts +139 -0
  353. package/src/credential/trustmark/index.ts +8 -0
  354. package/src/index.ts +4 -0
  355. package/src/pid/sd-jwt/types.ts +18 -1
  356. package/src/sd-jwt/__test__/index.test.ts +36 -55
  357. package/src/sd-jwt/__test__/types.test.ts +16 -29
  358. package/src/sd-jwt/index.ts +1 -5
  359. package/src/sd-jwt/types.ts +2 -19
  360. package/src/trust/chain.ts +151 -0
  361. package/src/trust/errors.ts +105 -0
  362. package/src/{entity/trust → trust}/index.ts +198 -23
  363. package/src/{entity/trust → trust}/types.ts +24 -37
  364. package/src/trust/utils.ts +35 -0
  365. package/src/utils/crypto.ts +4 -106
  366. package/src/utils/decoder.ts +6 -1
  367. package/src/utils/error-codes.ts +23 -0
  368. package/src/utils/errors.ts +119 -15
  369. package/src/utils/logging.ts +68 -0
  370. package/src/utils/misc.ts +5 -0
  371. package/src/utils/par.ts +19 -6
  372. package/src/utils/string.ts +0 -10
  373. package/src/wallet-instance/index.ts +30 -1
  374. package/src/wallet-instance-attestation/README.md +8 -3
  375. package/src/wallet-instance-attestation/index.ts +2 -2
  376. package/src/wallet-instance-attestation/issuing.ts +33 -12
  377. package/src/wallet-instance-attestation/types.ts +18 -22
  378. package/lib/commonjs/credential/issuance/02-get-issuer-config.js +0 -48
  379. package/lib/commonjs/credential/issuance/02-get-issuer-config.js.map +0 -1
  380. package/lib/commonjs/entity/openid-connect/issuer/index.js +0 -25
  381. package/lib/commonjs/entity/openid-connect/issuer/index.js.map +0 -1
  382. package/lib/commonjs/entity/openid-connect/issuer/types.js +0 -64
  383. package/lib/commonjs/entity/openid-connect/issuer/types.js.map +0 -1
  384. package/lib/commonjs/entity/trust/chain.js.map +0 -1
  385. package/lib/commonjs/entity/trust/index.js +0 -148
  386. package/lib/commonjs/entity/trust/index.js.map +0 -1
  387. package/lib/commonjs/entity/trust/types.js.map +0 -1
  388. package/lib/commonjs/mdoc/converters.js +0 -26
  389. package/lib/commonjs/mdoc/converters.js.map +0 -1
  390. package/lib/commonjs/mdoc/index.js +0 -68
  391. package/lib/commonjs/mdoc/index.js.map +0 -1
  392. package/lib/commonjs/utils/credential/issuance/07-verify-and-parse-credentials-inputs.js +0 -469
  393. package/lib/commonjs/utils/credential/issuance/07-verify-and-parse-credentials-inputs.js.map +0 -1
  394. package/lib/commonjs/utils/credential/issuance/07-verify-and-parse-credentials-utils.js +0 -90
  395. package/lib/commonjs/utils/credential/issuance/07-verify-and-parse-credentials-utils.js.map +0 -1
  396. package/lib/module/credential/issuance/02-get-issuer-config.js +0 -42
  397. package/lib/module/credential/issuance/02-get-issuer-config.js.map +0 -1
  398. package/lib/module/entity/openid-connect/issuer/index.js +0 -20
  399. package/lib/module/entity/openid-connect/issuer/index.js.map +0 -1
  400. package/lib/module/entity/openid-connect/issuer/types.js +0 -48
  401. package/lib/module/entity/openid-connect/issuer/types.js.map +0 -1
  402. package/lib/module/entity/trust/chain.js +0 -113
  403. package/lib/module/entity/trust/chain.js.map +0 -1
  404. package/lib/module/entity/trust/index.js +0 -131
  405. package/lib/module/entity/trust/index.js.map +0 -1
  406. package/lib/module/entity/trust/types.js.map +0 -1
  407. package/lib/module/mdoc/converters.js +0 -20
  408. package/lib/module/mdoc/converters.js.map +0 -1
  409. package/lib/module/mdoc/index.js +0 -60
  410. package/lib/module/mdoc/index.js.map +0 -1
  411. package/lib/module/utils/credential/issuance/07-verify-and-parse-credentials-inputs.js +0 -462
  412. package/lib/module/utils/credential/issuance/07-verify-and-parse-credentials-inputs.js.map +0 -1
  413. package/lib/module/utils/credential/issuance/07-verify-and-parse-credentials-utils.js +0 -83
  414. package/lib/module/utils/credential/issuance/07-verify-and-parse-credentials-utils.js.map +0 -1
  415. package/lib/typescript/credential/issuance/02-get-issuer-config.d.ts +0 -32
  416. package/lib/typescript/credential/issuance/02-get-issuer-config.d.ts.map +0 -1
  417. package/lib/typescript/entity/openid-connect/issuer/index.d.ts +0 -12
  418. package/lib/typescript/entity/openid-connect/issuer/index.d.ts.map +0 -1
  419. package/lib/typescript/entity/openid-connect/issuer/types.d.ts +0 -777
  420. package/lib/typescript/entity/openid-connect/issuer/types.d.ts.map +0 -1
  421. package/lib/typescript/entity/trust/chain.d.ts.map +0 -1
  422. package/lib/typescript/entity/trust/index.d.ts.map +0 -1
  423. package/lib/typescript/mdoc/converters.d.ts +0 -8
  424. package/lib/typescript/mdoc/converters.d.ts.map +0 -1
  425. package/lib/typescript/mdoc/index.d.ts +0 -10
  426. package/lib/typescript/mdoc/index.d.ts.map +0 -1
  427. package/lib/typescript/utils/credential/issuance/07-verify-and-parse-credentials-inputs.d.ts +0 -3
  428. package/lib/typescript/utils/credential/issuance/07-verify-and-parse-credentials-inputs.d.ts.map +0 -1
  429. package/lib/typescript/utils/credential/issuance/07-verify-and-parse-credentials-utils.d.ts +0 -42
  430. package/lib/typescript/utils/credential/issuance/07-verify-and-parse-credentials-utils.d.ts.map +0 -1
  431. package/src/credential/issuance/02-get-issuer-config.ts +0 -67
  432. package/src/entity/openid-connect/issuer/index.ts +0 -27
  433. package/src/entity/openid-connect/issuer/types.ts +0 -76
  434. package/src/entity/trust/chain.ts +0 -154
  435. package/src/mdoc/converters.ts +0 -26
  436. package/src/mdoc/index.ts +0 -95
  437. package/src/utils/credential/issuance/07-verify-and-parse-credentials-inputs.ts +0 -615
  438. package/src/utils/credential/issuance/07-verify-and-parse-credentials-utils.ts +0 -171
@@ -1,18 +1,17 @@
1
- import { decode } from "../../sd-jwt";
1
+ import { decode, prepareVpToken } from "../../sd-jwt";
2
+ import { createCryptoContextFor } from "../../utils/crypto";
2
3
  import { JSONPath } from "jsonpath-plus";
3
- import { MissingDataError, CredentialNotFoundError } from "./errors";
4
+ import { CredentialsNotFoundError, MissingDataError } from "./errors";
4
5
  import Ajv from "ajv";
5
- import { CBOR } from "@pagopa/io-react-native-cbor";
6
6
  const ajv = new Ajv({
7
7
  allErrors: true
8
8
  });
9
- export const disclosureWithEncodedToEvaluatedDisclosure = disclosure => {
10
- const [, claimName, claimValue] = disclosure.decoded;
11
- return {
12
- name: claimName,
13
- value: claimValue
14
- };
15
- };
9
+ const INDEX_CLAIM_NAME = 1;
10
+
11
+ /**
12
+ * @deprecated Use `prepareRemotePresentations` from DCQL
13
+ */
14
+
16
15
  /**
17
16
  * Transforms an array of DisclosureWithEncoded objects into a key-value map.
18
17
  * @param disclosures - An array of DisclosureWithEncoded, each containing a decoded property with [?, claimName, claimValue].
@@ -29,22 +28,6 @@ const mapDisclosuresToObject = disclosures => {
29
28
  }, {});
30
29
  };
31
30
 
32
- /**
33
- * Transforms the issuer's namespaces from a CBOR structure into a plain JavaScript object.
34
- *
35
- * @param namespaces - The CBOR-based namespaces object where each key corresponds to a namespace,
36
- * and each value is an array of elements containing identifiers and values.
37
- * @returns A record (plain object) where each key is a namespace, and its value is another object
38
- * mapping element identifiers to their corresponding element values.
39
- */
40
- const mapNamespacesToObject = namespaces => {
41
- return Object.entries(namespaces).reduce((obj, _ref2) => {
42
- let [namespace, elements] = _ref2;
43
- obj[namespace] = Object.fromEntries(elements.map(element => [element.elementIdentifier, element.elementValue]));
44
- return obj;
45
- }, {});
46
- };
47
-
48
31
  /**
49
32
  * Finds a claim within the payload based on provided JSONPath expressions.
50
33
  * @param paths - An array of JSONPath expressions to search for in the payload.
@@ -92,91 +75,10 @@ const extractClaimName = path => {
92
75
  // match[2] corresponds to the second capture group (\w+) inside [""] or ['']
93
76
  return match[1] || match[2];
94
77
  }
95
- throw new Error(`Invalid input format: "${path}". Expected formats are "$.propertyName", "$['propertyName']", or '$["propertyName"]'.`);
96
- };
97
-
98
- /**
99
- * Extracts the namespace and claim name from a path in the following format:
100
- * $['nameSpace']['propertyName']
101
- *
102
- * @param path - The path string containing the claim reference.
103
- * @returns An object with the extracted namespace and claim name.
104
- * @throws An error if the input format is invalid.
105
- */
106
- const extractNamespaceAndClaimName = path => {
107
- const regex = /^\$\[(?:'|")([^'"\]]+)(?:'|")\]\[(?:'|")([^'"\]]+)(?:'|")\]$/;
108
- const match = path.match(regex);
109
- if (match) {
110
- return {
111
- nameSpace: match[1],
112
- propertyName: match[2]
113
- };
114
- }
115
- throw new Error(`Invalid input format: "${path}". Expected format is "$['nameSpace']['propertyName']".`);
116
- };
117
- /**
118
- * Evaluates the input descriptor for an mDoc by verifying that the issuerSigned claims meet
119
- * the constraints defined in the input descriptor. It categorizes disclosures as either required
120
- * or optional based on the field definitions.
121
- *
122
- * @param inputDescriptor - Contains constraints and field definitions specifying required/optional claims.
123
- * @param issuerSigned - Contains the issuerSigned with namespaces and their associated claims.
124
- * @returns An object with two arrays: one for required disclosures and one for optional disclosures.
125
- * @throws MissingDataError - If a required field is missing or if a claim fails JSON Schema validation.
126
- */
127
- export const evaluateInputDescriptorForMdoc = (inputDescriptor, issuerSigned) => {
128
- var _inputDescriptor$cons;
129
- if (!(inputDescriptor !== null && inputDescriptor !== void 0 && (_inputDescriptor$cons = inputDescriptor.constraints) !== null && _inputDescriptor$cons !== void 0 && _inputDescriptor$cons.fields)) {
130
- // No validation, no field are required
131
- return {
132
- requiredDisclosures: [],
133
- optionalDisclosures: []
134
- };
135
- }
136
- const requiredDisclosures = [];
137
- const optionalDisclosures = [];
138
78
 
139
- // Convert issuer's namespaces into an object for easier lookup of claim values.
140
- const namespacesAsPayload = mapNamespacesToObject(issuerSigned.nameSpaces);
141
- const allFieldsValid = inputDescriptor.constraints.fields.every(field => {
142
- const [matchedPath, matchedValue] = findMatchedClaim(field.path, namespacesAsPayload);
79
+ // If the input doesn't match any of the expected formats, return null
143
80
 
144
- // If no matching claim is found, the field is valid only if it's marked as optional.
145
- if (matchedValue === undefined || !matchedPath) {
146
- return field === null || field === void 0 ? void 0 : field.optional;
147
- } else {
148
- // Extract the namespace and property name from the matched path.
149
- const {
150
- nameSpace,
151
- propertyName
152
- } = extractNamespaceAndClaimName(matchedPath);
153
- if (nameSpace && propertyName) {
154
- (field !== null && field !== void 0 && field.optional ? optionalDisclosures : requiredDisclosures).push({
155
- namespace: nameSpace,
156
- name: propertyName,
157
- value: matchedValue
158
- });
159
- }
160
- }
161
- if (field.filter) {
162
- try {
163
- const validateSchema = ajv.compile(field.filter);
164
- if (!validateSchema(matchedValue)) {
165
- throw new MissingDataError(`Claim value "${matchedValue}" for path "${matchedPath}" does not match the provided JSON Schema.`);
166
- }
167
- } catch (error) {
168
- return false;
169
- }
170
- }
171
- return true;
172
- });
173
- if (!allFieldsValid) {
174
- throw new MissingDataError("Credential validation failed: Required fields are missing or do not match the input descriptor.");
175
- }
176
- return {
177
- requiredDisclosures,
178
- optionalDisclosures
179
- };
81
+ throw new Error(`Invalid input format: "${path}". Expected formats are "$.propertyName", "$['propertyName']", or '$["propertyName"]'.`);
180
82
  };
181
83
 
182
84
  /**
@@ -187,27 +89,30 @@ export const evaluateInputDescriptorForMdoc = (inputDescriptor, issuerSigned) =>
187
89
  * - Validates whether required fields are present (unless marked optional)
188
90
  * and match any specified JSONPath.
189
91
  * - If a field includes a JSON Schema filter, validates the claim value against that schema.
92
+ * - Enforces `limit_disclosure` rules by returning only disclosures, required and optional, matching the specified fields
93
+ * if set to "required". Otherwise also return the array unrequestedDisclosures with disclosures which can be passed for a particular use case.
190
94
  * - Throws an error if a required field is invalid or missing.
191
95
  *
192
96
  * @param inputDescriptor - Describes constraints (fields, filters, etc.) that must be satisfied.
193
97
  * @param payloadCredential - The credential payload to check against.
194
98
  * @param disclosures - An array of DisclosureWithEncoded objects representing selective disclosures.
195
- * @returns An object with two arrays: one for required disclosures and one for optional disclosures.
99
+ * @returns A filtered list of disclosures satisfying the descriptor constraints, or throws an error if not.
196
100
  * @throws Will throw an error if any required constraint fails or if JSONPath lookups are invalid.
197
101
  */
198
102
  export const evaluateInputDescriptorForSdJwt4VC = (inputDescriptor, payloadCredential, disclosures) => {
199
- var _inputDescriptor$cons2;
200
- if (!(inputDescriptor !== null && inputDescriptor !== void 0 && (_inputDescriptor$cons2 = inputDescriptor.constraints) !== null && _inputDescriptor$cons2 !== void 0 && _inputDescriptor$cons2.fields)) {
103
+ var _inputDescriptor$cons;
104
+ if (!(inputDescriptor !== null && inputDescriptor !== void 0 && (_inputDescriptor$cons = inputDescriptor.constraints) !== null && _inputDescriptor$cons !== void 0 && _inputDescriptor$cons.fields)) {
201
105
  // No validation, all field are optional
202
106
  return {
203
107
  requiredDisclosures: [],
204
- optionalDisclosures: []
108
+ optionalDisclosures: [],
109
+ unrequestedDisclosures: disclosures
205
110
  };
206
111
  }
207
- const requiredDisclosures = [];
208
- const optionalDisclosures = [];
112
+ const requiredClaimNames = [];
113
+ const optionalClaimNames = [];
209
114
 
210
- // Transform disclosures into an object for easier lookup of claim values.
115
+ // Transform disclosures to find claim using JSONPath
211
116
  const disclosuresAsPayload = mapDisclosuresToObject(disclosures);
212
117
 
213
118
  // For each field, we need at least one matching path
@@ -227,10 +132,7 @@ export const evaluateInputDescriptorForSdJwt4VC = (inputDescriptor, payloadCrede
227
132
  // if match a disclouse we save which is required or optional
228
133
  const claimName = extractClaimName(matchedPath);
229
134
  if (claimName) {
230
- (field !== null && field !== void 0 && field.optional ? optionalDisclosures : requiredDisclosures).push({
231
- value: matchedValue,
232
- name: claimName
233
- });
135
+ (field !== null && field !== void 0 && field.optional ? optionalClaimNames : requiredClaimNames).push(claimName);
234
136
  }
235
137
  }
236
138
 
@@ -254,12 +156,19 @@ export const evaluateInputDescriptorForSdJwt4VC = (inputDescriptor, payloadCrede
254
156
  if (!allFieldsValid) {
255
157
  throw new MissingDataError("Credential validation failed: Required fields are missing or do not match the input descriptor.");
256
158
  }
159
+
160
+ // Categorizes disclosures into required and optional based on claim names and disclosure constraints.
161
+
162
+ const requiredDisclosures = disclosures.filter(disclosure => requiredClaimNames.includes(disclosure.decoded[INDEX_CLAIM_NAME]));
163
+ const optionalDisclosures = disclosures.filter(disclosure => optionalClaimNames.includes(disclosure.decoded[INDEX_CLAIM_NAME]));
164
+ const isNotLimitDisclosure = !(inputDescriptor.constraints.limit_disclosure === "required");
165
+ const unrequestedDisclosures = isNotLimitDisclosure ? disclosures.filter(disclosure => !optionalClaimNames.includes(disclosure.decoded[INDEX_CLAIM_NAME]) && !requiredClaimNames.includes(disclosure.decoded[INDEX_CLAIM_NAME])) : [];
257
166
  return {
258
167
  requiredDisclosures,
259
- optionalDisclosures
168
+ optionalDisclosures,
169
+ unrequestedDisclosures
260
170
  };
261
171
  };
262
-
263
172
  /**
264
173
  * Finds the first credential that satisfies the input descriptor constraints.
265
174
  * @param inputDescriptor The input descriptor to evaluate.
@@ -285,34 +194,10 @@ export const findCredentialSdJwt = (inputDescriptor, decodedSdJwtCredentials) =>
285
194
  continue;
286
195
  }
287
196
  }
288
- throw new CredentialNotFoundError("None of the vc+sd-jwt credentials satisfy the requirements.");
289
- };
290
-
291
- /**
292
- * Finds the first credential that satisfies the input descriptor constraints.
293
- * @param inputDescriptor The input descriptor to evaluate.
294
- * @param decodedMdocCredentials An array of decoded MDOC credentials.
295
- * @returns An object containing the matched evaluation, keyTag, and credential.
296
- */
297
- export const findCredentialMDoc = (inputDescriptor, decodedMDocCredentials) => {
298
- for (const {
299
- keyTag,
300
- credential,
301
- issuerSigned
302
- } of decodedMDocCredentials) {
303
- try {
304
- const evaluatedDisclosure = evaluateInputDescriptorForMdoc(inputDescriptor, issuerSigned);
305
- return {
306
- matchedEvaluation: evaluatedDisclosure,
307
- matchedKeyTag: keyTag,
308
- matchedCredential: credential
309
- };
310
- } catch {
311
- // skip to next credential
312
- continue;
313
- }
314
- }
315
- throw new CredentialNotFoundError("None of the mso_mdoc credentials satisfy the requirements.");
197
+ throw new CredentialsNotFoundError([{
198
+ id: "",
199
+ reason: "None of the vc+sd-jwt credentials satisfy the requirements."
200
+ }]);
316
201
  };
317
202
 
318
203
  /**
@@ -325,15 +210,14 @@ export const findCredentialMDoc = (inputDescriptor, decodedMDocCredentials) => {
325
210
  *
326
211
  * @param inputDescriptors - An array of input descriptors.
327
212
  * @param credentialsSdJwt - An array of tuples containing keyTag and SD-JWT credential.
328
- * @param credentialsMdoc - An array of tuples containing keyTag and MDOC credential.
329
213
  * @returns An array of objects, each containing the evaluated disclosures,
330
214
  * the input descriptor, the credential, and the keyTag.
331
215
  * @throws {CredentialNotFoundError} When the credential format is unsupported.
332
216
  */
333
- export const evaluateInputDescriptors = async (inputDescriptors, credentialsSdJwt, credentialsMdoc) => {
217
+ export const evaluateInputDescriptors = async (inputDescriptors, credentialsSdJwt) => {
334
218
  // We need decode SD-JWT credentials for evaluation
335
- const decodedSdJwtCredentials = (credentialsSdJwt === null || credentialsSdJwt === void 0 ? void 0 : credentialsSdJwt.map(_ref3 => {
336
- let [, keyTag, credential] = _ref3;
219
+ const decodedSdJwtCredentials = (credentialsSdJwt === null || credentialsSdJwt === void 0 ? void 0 : credentialsSdJwt.map(_ref2 => {
220
+ let [keyTag, credential] = _ref2;
337
221
  const {
338
222
  sdJwt,
339
223
  disclosures
@@ -345,31 +229,20 @@ export const evaluateInputDescriptors = async (inputDescriptors, credentialsSdJw
345
229
  disclosures
346
230
  };
347
231
  })) || [];
348
-
349
- // We need decode Mdoc credentials for evaluation
350
- const decodedMdocCredentials = (await Promise.all(credentialsMdoc === null || credentialsMdoc === void 0 ? void 0 : credentialsMdoc.map(async _ref4 => {
351
- let [, keyTag, credential] = _ref4;
352
- const issuerSigned = await CBOR.decodeIssuerSigned(credential);
353
- if (!issuerSigned) {
354
- throw new CredentialNotFoundError("mso_mdoc credential is not present.");
355
- }
356
- return {
357
- keyTag,
358
- credential,
359
- issuerSigned
360
- };
361
- }))) || [];
362
- const results = Promise.all(inputDescriptors.map(async descriptor => {
363
- var _descriptor$format, _descriptor$format2;
364
- if ((_descriptor$format = descriptor.format) !== null && _descriptor$format !== void 0 && _descriptor$format.mso_mdoc) {
365
- if (!credentialsMdoc.length) {
366
- throw new CredentialNotFoundError("mso_mdoc credential is not supported.");
232
+ return Promise.all(inputDescriptors.map(async descriptor => {
233
+ var _descriptor$format;
234
+ if ((_descriptor$format = descriptor.format) !== null && _descriptor$format !== void 0 && _descriptor$format["vc+sd-jwt"]) {
235
+ if (!decodedSdJwtCredentials.length) {
236
+ throw new CredentialsNotFoundError([{
237
+ id: descriptor.id,
238
+ reason: "vc+sd-jwt credential is not supported."
239
+ }]);
367
240
  }
368
241
  const {
369
242
  matchedEvaluation,
370
243
  matchedKeyTag,
371
244
  matchedCredential
372
- } = findCredentialMDoc(descriptor, decodedMdocCredentials);
245
+ } = findCredentialSdJwt(descriptor, decodedSdJwtCredentials);
373
246
  return {
374
247
  evaluatedDisclosure: matchedEvaluation,
375
248
  inputDescriptor: descriptor,
@@ -377,24 +250,48 @@ export const evaluateInputDescriptors = async (inputDescriptors, credentialsSdJw
377
250
  keyTag: matchedKeyTag
378
251
  };
379
252
  }
253
+ throw new CredentialsNotFoundError([{
254
+ id: descriptor.id,
255
+ reason: `${descriptor.format} format is not supported.`
256
+ }]);
257
+ }));
258
+ };
259
+
260
+ /**
261
+ * Prepares remote presentations for a set of credentials based on input descriptors.
262
+ *
263
+ * For each credential and its corresponding input descriptor, this function:
264
+ * - Validates the credential format.
265
+ * - Generates a verifiable presentation token (vpToken) using the provided nonce and client identifier.
266
+ *
267
+ * @deprecated Use `prepareRemotePresentations` from DCQL
268
+ *
269
+ * @param credentialAndDescriptors - An array containing objects with requested claims,
270
+ * input descriptor, credential, and keyTag.
271
+ * @param nonce - A unique nonce for the verifiable presentation token.
272
+ * @param client_id - The client identifier.
273
+ * @returns A promise that resolves to an array of RemotePresentation objects.
274
+ * @throws {CredentialNotFoundError} When the credential format is unsupported.
275
+ */
276
+ export const prepareLegacyRemotePresentations = async (credentialAndDescriptors, nonce, client_id) => {
277
+ return Promise.all(credentialAndDescriptors.map(async item => {
278
+ var _descriptor$format2;
279
+ const descriptor = item.inputDescriptor;
380
280
  if ((_descriptor$format2 = descriptor.format) !== null && _descriptor$format2 !== void 0 && _descriptor$format2["vc+sd-jwt"]) {
381
- if (!decodedSdJwtCredentials.length) {
382
- throw new CredentialNotFoundError("vc+sd-jwt credential is not supported.");
383
- }
384
281
  const {
385
- matchedEvaluation,
386
- matchedKeyTag,
387
- matchedCredential
388
- } = findCredentialSdJwt(descriptor, decodedSdJwtCredentials);
282
+ vp_token
283
+ } = await prepareVpToken(nonce, client_id, [item.credential, item.requestedClaims, createCryptoContextFor(item.keyTag)]);
389
284
  return {
390
- evaluatedDisclosure: matchedEvaluation,
285
+ requestedClaims: item.requestedClaims,
391
286
  inputDescriptor: descriptor,
392
- credential: matchedCredential,
393
- keyTag: matchedKeyTag
287
+ vpToken: vp_token,
288
+ format: "vc+sd-jwt"
394
289
  };
395
290
  }
396
- throw new CredentialNotFoundError(`${descriptor.format} format is not supported.`);
291
+ throw new CredentialsNotFoundError([{
292
+ id: descriptor.id,
293
+ reason: `${descriptor.format} format is not supported.`
294
+ }]);
397
295
  }));
398
- return results;
399
296
  };
400
297
  //# sourceMappingURL=07-evaluate-input-descriptor.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["decode","JSONPath","MissingDataError","CredentialNotFoundError","Ajv","CBOR","ajv","allErrors","disclosureWithEncodedToEvaluatedDisclosure","disclosure","claimName","claimValue","decoded","name","value","mapDisclosuresToObject","disclosures","reduce","obj","_ref","mapNamespacesToObject","namespaces","Object","entries","_ref2","namespace","elements","fromEntries","map","element","elementIdentifier","elementValue","findMatchedClaim","paths","payload","matchedPath","matchedValue","some","singlePath","result","path","json","length","error","extractClaimName","regex","match","Error","extractNamespaceAndClaimName","nameSpace","propertyName","evaluateInputDescriptorForMdoc","inputDescriptor","issuerSigned","_inputDescriptor$cons","constraints","fields","requiredDisclosures","optionalDisclosures","namespacesAsPayload","nameSpaces","allFieldsValid","every","field","undefined","optional","push","filter","validateSchema","compile","evaluateInputDescriptorForSdJwt4VC","payloadCredential","_inputDescriptor$cons2","disclosuresAsPayload","findCredentialSdJwt","decodedSdJwtCredentials","keyTag","credential","sdJwt","evaluatedDisclosure","matchedEvaluation","matchedKeyTag","matchedCredential","findCredentialMDoc","decodedMDocCredentials","evaluateInputDescriptors","inputDescriptors","credentialsSdJwt","credentialsMdoc","_ref3","decodedMdocCredentials","Promise","all","_ref4","decodeIssuerSigned","results","descriptor","_descriptor$format","_descriptor$format2","format","mso_mdoc"],"sourceRoot":"../../../../src","sources":["credential/presentation/07-evaluate-input-descriptor.ts"],"mappings":"AACA,SAASA,MAAM,QAAQ,cAAc;AAErC,SAASC,QAAQ,QAAQ,eAAe;AACxC,SAASC,gBAAgB,EAAEC,uBAAuB,QAAQ,UAAU;AACpE,OAAOC,GAAG,MAAM,KAAK;AACrB,SAASC,IAAI,QAAQ,8BAA8B;AAEnD,MAAMC,GAAG,GAAG,IAAIF,GAAG,CAAC;EAAEG,SAAS,EAAE;AAAK,CAAC,CAAC;AA+BxC,OAAO,MAAMC,0CAA0C,GACrDC,UAAiC,IACT;EACxB,MAAM,GAAGC,SAAS,EAAEC,UAAU,CAAC,GAAGF,UAAU,CAACG,OAAO;EACpD,OAAO;IACLC,IAAI,EAAEH,SAAS;IACfI,KAAK,EAAEH;EACT,CAAC;AACH,CAAC;AAeD;AACA;AACA;AACA;AACA;AACA,MAAMI,sBAAsB,GAC1BC,WAAoC,IACR;EAC5B,OAAOA,WAAW,CAACC,MAAM,CACvB,CAACC,GAAG,EAAAC,IAAA,KAAkB;IAAA,IAAhB;MAAEP;IAAQ,CAAC,GAAAO,IAAA;IACf,MAAM,GAAGT,SAAS,EAAEC,UAAU,CAAC,GAAGC,OAAO;IACzCM,GAAG,CAACR,SAAS,CAAC,GAAGC,UAAU;IAC3B,OAAOO,GAAG;EACZ,CAAC,EACD,CAAC,CACH,CAAC;AACH,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAME,qBAAqB,GACzBC,UAA2C,IACf;EAC5B,OAAOC,MAAM,CAACC,OAAO,CAACF,UAAU,CAAC,CAACJ,MAAM,CACtC,CAACC,GAAG,EAAAM,KAAA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,CAAC9C,MAAM,EAAE;QAC3B,MAAM,IAAIvC,uBAAuB,CAC/B,uCACF,CAAC;MACH;MAEA,MAAM;QAAE6E,iBAAiB;QAAEC,aAAa;QAAEC;MAAkB,CAAC,GAC3DC,kBAAkB,CAACa,UAAU,EAAEN,sBAAsB,CAAC;MAExD,OAAO;QACLX,mBAAmB,EAAEC,iBAAiB;QACtC5B,eAAe,EAAE4C,UAAU;QAC3BnB,UAAU,EAAEK,iBAAiB;QAC7BN,MAAM,EAAEK;MACV,CAAC;IACH;IAEA,KAAAiB,mBAAA,GAAIF,UAAU,CAACG,MAAM,cAAAD,mBAAA,eAAjBA,mBAAA,CAAoB,WAAW,CAAC,EAAE;MACpC,IAAI,CAACvB,uBAAuB,CAACjC,MAAM,EAAE;QACnC,MAAM,IAAIvC,uBAAuB,CAC/B,wCACF,CAAC;MACH;MAEA,MAAM;QAAE6E,iBAAiB;QAAEC,aAAa;QAAEC;MAAkB,CAAC,GAC3DR,mBAAmB,CAACsB,UAAU,EAAErB,uBAAuB,CAAC;MAE1D,OAAO;QACLI,mBAAmB,EAAEC,iBAAiB;QACtC5B,eAAe,EAAE4C,UAAU;QAC3BnB,UAAU,EAAEK,iBAAiB;QAC7BN,MAAM,EAAEK;MACV,CAAC;IACH;IAEA,MAAM,IAAI9E,uBAAuB,CAC9B,GAAE6F,UAAU,CAACG,MAAO,2BACvB,CAAC;EACH,CAAC,CACH,CAAC;EAED,OAAOJ,OAAO;AAChB,CAAC"}
1
+ {"version":3,"names":["decode","prepareVpToken","createCryptoContextFor","JSONPath","CredentialsNotFoundError","MissingDataError","Ajv","ajv","allErrors","INDEX_CLAIM_NAME","mapDisclosuresToObject","disclosures","reduce","obj","_ref","decoded","claimName","claimValue","findMatchedClaim","paths","payload","matchedPath","matchedValue","some","singlePath","result","path","json","length","error","extractClaimName","regex","match","Error","evaluateInputDescriptorForSdJwt4VC","inputDescriptor","payloadCredential","_inputDescriptor$cons","constraints","fields","requiredDisclosures","optionalDisclosures","unrequestedDisclosures","requiredClaimNames","optionalClaimNames","disclosuresAsPayload","allFieldsValid","every","field","optional","push","filter","validateSchema","compile","disclosure","includes","isNotLimitDisclosure","limit_disclosure","findCredentialSdJwt","decodedSdJwtCredentials","keyTag","credential","sdJwt","evaluatedDisclosure","matchedEvaluation","matchedKeyTag","matchedCredential","id","reason","evaluateInputDescriptors","inputDescriptors","credentialsSdJwt","map","_ref2","Promise","all","descriptor","_descriptor$format","format","prepareLegacyRemotePresentations","credentialAndDescriptors","nonce","client_id","item","_descriptor$format2","vp_token","requestedClaims","vpToken"],"sourceRoot":"../../../../src","sources":["credential/presentation/07-evaluate-input-descriptor.ts"],"mappings":"AAEA,SAASA,MAAM,EAAEC,cAAc,QAAQ,cAAc;AACrD,SAASC,sBAAsB,QAAQ,oBAAoB;AAC3D,SAASC,QAAQ,QAAQ,eAAe;AACxC,SAASC,wBAAwB,EAAEC,gBAAgB,QAAQ,UAAU;AACrE,OAAOC,GAAG,MAAM,KAAK;AAErB,MAAMC,GAAG,GAAG,IAAID,GAAG,CAAC;EAAEE,SAAS,EAAE;AAAK,CAAC,CAAC;AACxC,MAAMC,gBAAgB,GAAG,CAAC;;AA0B1B;AACA;AACA;;AAYA;AACA;AACA;AACA;AACA;AACA,MAAMC,sBAAsB,GAC1BC,WAAoC,IACR;EAC5B,OAAOA,WAAW,CAACC,MAAM,CACvB,CAACC,GAAG,EAAAC,IAAA,KAAkB;IAAA,IAAhB;MAAEC;IAAQ,CAAC,GAAAD,IAAA;IACf,MAAM,GAAGE,SAAS,EAAEC,UAAU,CAAC,GAAGF,OAAO;IACzCF,GAAG,CAACG,SAAS,CAAC,GAAGC,UAAU;IAC3B,OAAOJ,GAAG;EACZ,CAAC,EACD,CAAC,CACH,CAAC;AACH,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA,MAAMK,gBAAgB,GAAGA,CACvBC,KAAe,EACfC,OAAY,KACW;EACvB,IAAIC,WAAW;EACf,IAAIC,YAAY;EAChBH,K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