@pagopa/io-react-native-wallet 0.24.1 → 0.25.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (185) hide show
  1. package/lib/commonjs/client/generated/wallet-provider.js +39 -16
  2. package/lib/commonjs/client/generated/wallet-provider.js.map +1 -1
  3. package/lib/commonjs/client/index.js +25 -10
  4. package/lib/commonjs/client/index.js.map +1 -1
  5. package/lib/commonjs/credential/issuance/03-start-user-authorization.js +1 -1
  6. package/lib/commonjs/credential/issuance/04-complete-user-authorization.js +21 -14
  7. package/lib/commonjs/credential/issuance/04-complete-user-authorization.js.map +1 -1
  8. package/lib/commonjs/credential/issuance/05-authorize-access.js +5 -2
  9. package/lib/commonjs/credential/issuance/05-authorize-access.js.map +1 -1
  10. package/lib/commonjs/credential/issuance/06-obtain-credential.js +26 -17
  11. package/lib/commonjs/credential/issuance/06-obtain-credential.js.map +1 -1
  12. package/lib/commonjs/credential/issuance/README.md +8 -14
  13. package/lib/commonjs/credential/issuance/errors.js +52 -0
  14. package/lib/commonjs/credential/issuance/errors.js.map +1 -0
  15. package/lib/commonjs/credential/issuance/index.js +7 -2
  16. package/lib/commonjs/credential/issuance/index.js.map +1 -1
  17. package/lib/commonjs/credential/issuance/types.js +1 -5
  18. package/lib/commonjs/credential/issuance/types.js.map +1 -1
  19. package/lib/commonjs/credential/presentation/01-start-flow.js +1 -1
  20. package/lib/commonjs/credential/presentation/01-start-flow.js.map +1 -1
  21. package/lib/commonjs/credential/presentation/03-get-request-object.js +2 -2
  22. package/lib/commonjs/credential/presentation/03-get-request-object.js.map +1 -1
  23. package/lib/commonjs/credential/presentation/04-send-authorization-response.js +2 -2
  24. package/lib/commonjs/credential/presentation/04-send-authorization-response.js.map +1 -1
  25. package/lib/commonjs/credential/presentation/errors.js +49 -0
  26. package/lib/commonjs/credential/presentation/errors.js.map +1 -0
  27. package/lib/commonjs/credential/presentation/index.js +5 -0
  28. package/lib/commonjs/credential/presentation/index.js.map +1 -1
  29. package/lib/commonjs/credential/status/02-status-attestation.js +8 -6
  30. package/lib/commonjs/credential/status/02-status-attestation.js.map +1 -1
  31. package/lib/commonjs/credential/status/README.md +5 -2
  32. package/lib/commonjs/credential/status/types.js +1 -14
  33. package/lib/commonjs/credential/status/types.js.map +1 -1
  34. package/lib/commonjs/sd-jwt/errors.js +40 -0
  35. package/lib/commonjs/sd-jwt/errors.js.map +1 -0
  36. package/lib/commonjs/sd-jwt/index.js +8 -4
  37. package/lib/commonjs/sd-jwt/index.js.map +1 -1
  38. package/lib/commonjs/sd-jwt/verifier.js +5 -1
  39. package/lib/commonjs/sd-jwt/verifier.js.map +1 -1
  40. package/lib/commonjs/trust/index.js +2 -2
  41. package/lib/commonjs/trust/index.js.map +1 -1
  42. package/lib/commonjs/utils/decoder.js +3 -1
  43. package/lib/commonjs/utils/decoder.js.map +1 -1
  44. package/lib/commonjs/utils/error-codes.js +51 -0
  45. package/lib/commonjs/utils/error-codes.js.map +1 -0
  46. package/lib/commonjs/utils/errors.js +119 -463
  47. package/lib/commonjs/utils/errors.js.map +1 -1
  48. package/lib/commonjs/utils/misc.js +21 -14
  49. package/lib/commonjs/utils/misc.js.map +1 -1
  50. package/lib/commonjs/utils/par.js +2 -1
  51. package/lib/commonjs/utils/par.js.map +1 -1
  52. package/lib/commonjs/wallet-instance/README.md +26 -5
  53. package/lib/commonjs/wallet-instance/index.js +33 -7
  54. package/lib/commonjs/wallet-instance/index.js.map +1 -1
  55. package/lib/commonjs/wallet-instance-attestation/README.md +8 -2
  56. package/lib/commonjs/wallet-instance-attestation/issuing.js +13 -10
  57. package/lib/commonjs/wallet-instance-attestation/issuing.js.map +1 -1
  58. package/lib/module/client/generated/wallet-provider.js +31 -11
  59. package/lib/module/client/generated/wallet-provider.js.map +1 -1
  60. package/lib/module/client/index.js +22 -8
  61. package/lib/module/client/index.js.map +1 -1
  62. package/lib/module/credential/issuance/03-start-user-authorization.js +1 -1
  63. package/lib/module/credential/issuance/04-complete-user-authorization.js +16 -9
  64. package/lib/module/credential/issuance/04-complete-user-authorization.js.map +1 -1
  65. package/lib/module/credential/issuance/05-authorize-access.js +7 -4
  66. package/lib/module/credential/issuance/05-authorize-access.js.map +1 -1
  67. package/lib/module/credential/issuance/06-obtain-credential.js +29 -20
  68. package/lib/module/credential/issuance/06-obtain-credential.js.map +1 -1
  69. package/lib/module/credential/issuance/README.md +8 -14
  70. package/lib/module/credential/issuance/errors.js +44 -0
  71. package/lib/module/credential/issuance/errors.js.map +1 -0
  72. package/lib/module/credential/issuance/index.js +3 -2
  73. package/lib/module/credential/issuance/index.js.map +1 -1
  74. package/lib/module/credential/issuance/types.js +0 -3
  75. package/lib/module/credential/issuance/types.js.map +1 -1
  76. package/lib/module/credential/presentation/01-start-flow.js +1 -1
  77. package/lib/module/credential/presentation/01-start-flow.js.map +1 -1
  78. package/lib/module/credential/presentation/03-get-request-object.js +3 -3
  79. package/lib/module/credential/presentation/03-get-request-object.js.map +1 -1
  80. package/lib/module/credential/presentation/04-send-authorization-response.js +3 -3
  81. package/lib/module/credential/presentation/04-send-authorization-response.js.map +1 -1
  82. package/lib/module/credential/presentation/errors.js +42 -0
  83. package/lib/module/credential/presentation/errors.js.map +1 -0
  84. package/lib/module/credential/presentation/index.js +2 -1
  85. package/lib/module/credential/presentation/index.js.map +1 -1
  86. package/lib/module/credential/status/02-status-attestation.js +11 -9
  87. package/lib/module/credential/status/02-status-attestation.js.map +1 -1
  88. package/lib/module/credential/status/README.md +5 -2
  89. package/lib/module/credential/status/types.js +0 -12
  90. package/lib/module/credential/status/types.js.map +1 -1
  91. package/lib/module/sd-jwt/errors.js +32 -0
  92. package/lib/module/sd-jwt/errors.js.map +1 -0
  93. package/lib/module/sd-jwt/index.js +5 -5
  94. package/lib/module/sd-jwt/index.js.map +1 -1
  95. package/lib/module/sd-jwt/verifier.js +5 -1
  96. package/lib/module/sd-jwt/verifier.js.map +1 -1
  97. package/lib/module/trust/index.js +3 -3
  98. package/lib/module/trust/index.js.map +1 -1
  99. package/lib/module/utils/decoder.js +3 -1
  100. package/lib/module/utils/decoder.js.map +1 -1
  101. package/lib/module/utils/error-codes.js +43 -0
  102. package/lib/module/utils/error-codes.js.map +1 -0
  103. package/lib/module/utils/errors.js +98 -438
  104. package/lib/module/utils/errors.js.map +1 -1
  105. package/lib/module/utils/misc.js +18 -11
  106. package/lib/module/utils/misc.js.map +1 -1
  107. package/lib/module/utils/par.js +3 -2
  108. package/lib/module/utils/par.js.map +1 -1
  109. package/lib/module/wallet-instance/README.md +26 -5
  110. package/lib/module/wallet-instance/index.js +32 -7
  111. package/lib/module/wallet-instance/index.js.map +1 -1
  112. package/lib/module/wallet-instance-attestation/README.md +8 -2
  113. package/lib/module/wallet-instance-attestation/issuing.js +15 -12
  114. package/lib/module/wallet-instance-attestation/issuing.js.map +1 -1
  115. package/lib/typescript/client/generated/wallet-provider.d.ts +138 -27
  116. package/lib/typescript/client/generated/wallet-provider.d.ts.map +1 -1
  117. package/lib/typescript/client/index.d.ts +7 -1
  118. package/lib/typescript/client/index.d.ts.map +1 -1
  119. package/lib/typescript/credential/issuance/03-start-user-authorization.d.ts +1 -1
  120. package/lib/typescript/credential/issuance/04-complete-user-authorization.d.ts +1 -1
  121. package/lib/typescript/credential/issuance/04-complete-user-authorization.d.ts.map +1 -1
  122. package/lib/typescript/credential/issuance/05-authorize-access.d.ts.map +1 -1
  123. package/lib/typescript/credential/issuance/06-obtain-credential.d.ts.map +1 -1
  124. package/lib/typescript/credential/issuance/errors.d.ts +28 -0
  125. package/lib/typescript/credential/issuance/errors.d.ts.map +1 -0
  126. package/lib/typescript/credential/issuance/index.d.ts +3 -2
  127. package/lib/typescript/credential/issuance/index.d.ts.map +1 -1
  128. package/lib/typescript/credential/issuance/types.d.ts +0 -8
  129. package/lib/typescript/credential/issuance/types.d.ts.map +1 -1
  130. package/lib/typescript/credential/presentation/03-get-request-object.d.ts.map +1 -1
  131. package/lib/typescript/credential/presentation/04-send-authorization-response.d.ts.map +1 -1
  132. package/lib/typescript/credential/presentation/errors.d.ts +25 -0
  133. package/lib/typescript/credential/presentation/errors.d.ts.map +1 -0
  134. package/lib/typescript/credential/presentation/index.d.ts +2 -1
  135. package/lib/typescript/credential/presentation/index.d.ts.map +1 -1
  136. package/lib/typescript/credential/status/02-status-attestation.d.ts.map +1 -1
  137. package/lib/typescript/credential/status/types.d.ts +0 -15
  138. package/lib/typescript/credential/status/types.d.ts.map +1 -1
  139. package/lib/typescript/sd-jwt/errors.d.ts +20 -0
  140. package/lib/typescript/sd-jwt/errors.d.ts.map +1 -0
  141. package/lib/typescript/sd-jwt/index.d.ts +3 -2
  142. package/lib/typescript/sd-jwt/index.d.ts.map +1 -1
  143. package/lib/typescript/utils/error-codes.d.ts +45 -0
  144. package/lib/typescript/utils/error-codes.d.ts.map +1 -0
  145. package/lib/typescript/utils/errors.d.ts +88 -225
  146. package/lib/typescript/utils/errors.d.ts.map +1 -1
  147. package/lib/typescript/utils/misc.d.ts +9 -4
  148. package/lib/typescript/utils/misc.d.ts.map +1 -1
  149. package/lib/typescript/utils/par.d.ts.map +1 -1
  150. package/lib/typescript/wallet-instance/index.d.ts +17 -1
  151. package/lib/typescript/wallet-instance/index.d.ts.map +1 -1
  152. package/lib/typescript/wallet-instance-attestation/issuing.d.ts.map +1 -1
  153. package/lib/typescript/wallet-instance-attestation/types.d.ts +4 -4
  154. package/package.json +1 -1
  155. package/src/client/generated/wallet-provider.ts +43 -13
  156. package/src/client/index.ts +28 -15
  157. package/src/credential/issuance/03-start-user-authorization.ts +1 -1
  158. package/src/credential/issuance/04-complete-user-authorization.ts +21 -21
  159. package/src/credential/issuance/05-authorize-access.ts +7 -4
  160. package/src/credential/issuance/06-obtain-credential.ts +39 -39
  161. package/src/credential/issuance/README.md +8 -14
  162. package/src/credential/issuance/errors.ts +44 -0
  163. package/src/credential/issuance/index.ts +4 -2
  164. package/src/credential/issuance/types.ts +0 -8
  165. package/src/credential/presentation/01-start-flow.ts +1 -1
  166. package/src/credential/presentation/03-get-request-object.ts +3 -3
  167. package/src/credential/presentation/04-send-authorization-response.ts +3 -3
  168. package/src/credential/presentation/errors.ts +41 -0
  169. package/src/credential/presentation/index.ts +2 -0
  170. package/src/credential/status/02-status-attestation.ts +17 -25
  171. package/src/credential/status/README.md +5 -2
  172. package/src/credential/status/types.ts +0 -15
  173. package/src/sd-jwt/errors.ts +39 -0
  174. package/src/sd-jwt/index.ts +5 -8
  175. package/src/sd-jwt/verifier.ts +5 -5
  176. package/src/trust/index.ts +3 -3
  177. package/src/utils/decoder.ts +3 -3
  178. package/src/utils/error-codes.ts +50 -0
  179. package/src/utils/errors.ts +152 -476
  180. package/src/utils/misc.ts +20 -17
  181. package/src/utils/par.ts +3 -2
  182. package/src/wallet-instance/README.md +26 -5
  183. package/src/wallet-instance/index.ts +40 -18
  184. package/src/wallet-instance-attestation/README.md +8 -2
  185. package/src/wallet-instance-attestation/issuing.ts +28 -36
@@ -2,16 +2,22 @@ import { IoWalletError, UnexpectedStatusCodeError } from "./errors";
2
2
  import { sha256 } from "js-sha256";
3
3
 
4
4
  /**
5
- * Check if a response is in the expected status, other
5
+ * Check if a response is in the expected status, otherwise throw an error
6
6
  * @param status - The expected status
7
- * @throws {@link UnexpectedStatusCodeError} if the status is different from the one expected
7
+ * @param customError - A custom error compatible with {@link UnexpectedStatusCodeError}
8
+ * @throws UnexpectedStatusCodeError if the status is different from the one expected
8
9
  * @returns The given response object
9
10
  */
10
- export const hasStatus = status => async res => {
11
+ export const hasStatusOrThrow = (status, customError) => async res => {
11
12
  if (res.status !== status) {
12
- const responseBody = await res.text();
13
- throw new UnexpectedStatusCodeError(`Http request failed. Expected ${status}, got ${res.status}, url: ${res.url} with response: ${responseBody}`, res.status, responseBody);
13
+ const ErrorClass = customError ?? UnexpectedStatusCodeError;
14
+ throw new ErrorClass({
15
+ message: `Http request failed. Expected ${status}, got ${res.status}, url: ${res.url}`,
16
+ statusCode: res.status,
17
+ reason: await parseRawHttpResponse(res) // Pass the response body as reason so the original error can surface
18
+ });
14
19
  }
20
+
15
21
  return res;
16
22
  };
17
23
 
@@ -81,11 +87,12 @@ export const createAbortPromiseFromSignal = signal => {
81
87
  };
82
88
  };
83
89
  export const isDefined = x => Boolean(x);
84
- export const safeJsonParse = (text, withDefault) => {
85
- try {
86
- return JSON.parse(text);
87
- } catch (_) {
88
- return withDefault ?? null;
89
- }
90
+
91
+ /**
92
+ * Utility function to parse a raw HTTP response as JSON if supported, otherwise as text.
93
+ */
94
+ export const parseRawHttpResponse = response => {
95
+ var _response$headers$get;
96
+ return (_response$headers$get = response.headers.get("content-type")) !== null && _response$headers$get !== void 0 && _response$headers$get.includes("application/json") ? response.json() : response.text();
90
97
  };
91
98
  //# sourceMappingURL=misc.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["IoWalletError","UnexpectedStatusCodeError","sha256","hasStatus","status","res","responseBody","text","url","generateRandomAlphaNumericString","size","Array","from","Math","floor","random","toString","join","until","conditionFunction","timeoutSeconds","Promise","resolve","reject","start","Date","now","poll","undefined","Error","setTimeout","getCredentialHashWithouDiscloures","credential","tildeIndex","indexOf","slice","createAbortPromiseFromSignal","signal","listener","listen","aborted","addEventListener","remove","removeEventListener","isDefined","x","Boolean","safeJsonParse","withDefault","JSON","parse","_"],"sourceRoot":"../../../src","sources":["utils/misc.ts"],"mappings":"AAAA,SAASA,aAAa,EAAEC,yBAAyB,QAAQ,UAAU;AACnE,SAASC,MAAM,QAAQ,WAAW;;AAElC;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,SAAS,GACnBC,MAAc,IACf,MAAOC,GAAa,IAAwB;EAC1C,IAAIA,GAAG,CAACD,MAAM,KAAKA,MAAM,EAAE;IACzB,MAAME,YAAY,GAAG,MAAMD,GAAG,CAACE,IAAI,CAAC,CAAC;IACrC,MAAM,IAAIN,yBAAyB,CAChC,iCAAgCG,MAAO,SAAQC,GAAG,CAACD,MAAO,UAASC,GAAG,CAACG,GAAI,mBAAkBF,YAAa,EAAC,EAC5GD,GAAG,CAACD,MAAM,EACVE,YACF,CAAC;EAC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UAAU,CAACG,KAAK,CAAC,CAAC,EAAEF,UAAU,CAAC,CAAC;AAChD,CAAC;;AAED;AACA;AACA;AACA;AACA,OAAO,MAAMG,4BAA4B,GAAIC,MAAmB,IAAK;EACnE,IAAIC,QAAoB;EACxB,OAAO;IACLC,MAAM,EAAEA,CAAA,KACN,IAAIlB,OAAO,CAAuBC,OAAO,IAAK;MAC5C,IAAIe,MAAM,CAACG,OAAO,EAAE;QAClB,OAAOlB,OAAO,CAAC,mBAAmB,CAAC;MACrC;MACAgB,QAAQ,GAAGA,CAAA,KAAMhB,OAAO,CAAC,mBAAmB,CAAC;MAC7Ce,MAAM,CAACI,gBAAgB,CAAC,OAAO,EAAEH,QAAQ,CAAC;IAC5C,CAAC,CAAC;IACJI,MAAM,EAAEA,CAAA,KAAML,MAAM,CAACM,mBAAmB,CAAC,OAAO,EAAEL,QAAQ;EAC5D,CAAC;AACH,CAAC;AAED,OAAO,MAAMM,SAAS,GAAOC,CAA4B,IACvDC,OAAO,CAACD,CAAC,CAAC;AAEZ,OAAO,MAAME,aAAa,GAAGA,CAAIxC,IAAY,EAAEyC,WAAe,KAAe;EAC3E,IAAI;IACF,OAAOC,IAAI,CAACC,KAAK,CAAC3C,IAAI,CAAC;EACzB,CAAC,CAAC,OAAO4C,CAAC,EAAE;IACV,OAAOH,WAAW,IAAI,IAAI;EAC5B;AACF,CAAC"}
1
+ {"version":3,"names":["IoWalletError","UnexpectedStatusCodeError","sha256","hasStatusOrThrow","status","customError","res","ErrorClass","message","url","statusCode","reason","parseRawHttpResponse","generateRandomAlphaNumericString","size","Array","from","Math","floor","random","toString","join","until","conditionFunction","timeoutSeconds","Promise","resolve","reject","start","Date","now","poll","undefined","Error","setTimeout","getCredentialHashWithouDiscloures","credential","tildeIndex","indexOf","slice","createAbortPromiseFromSignal","signal","listener","listen","aborted","addEventListener","remove","removeEventListener","isDefined","x","Boolean","response","_response$headers$get","headers","get","includes","json","text"],"sourceRoot":"../../../src","sources":["utils/misc.ts"],"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oB,GAC/BuC,QAAkB;EAAA,IAAAC,qBAAA;EAAA,OAElB,CAAAA,qBAAA,GAAAD,QAAQ,CAACE,OAAO,CAACC,GAAG,CAAC,cAAc,CAAC,cAAAF,qBAAA,eAApCA,qBAAA,CAAsCG,QAAQ,CAAC,kBAAkB,CAAC,GAC7DJ,QAAQ,CAACK,IAAI,CAAC,CAAC,GAChBL,QAAQ,CAACM,IAAI,CAAC,CAAC;AAAA"}
@@ -2,8 +2,9 @@ import { sha256ToBase64, SignJWT } from "@pagopa/io-react-native-jwt";
2
2
  import uuid from "react-native-uuid";
3
3
  import * as z from "zod";
4
4
  import * as WalletInstanceAttestation from "../wallet-instance-attestation";
5
- import { generateRandomAlphaNumericString, hasStatus } from "./misc";
5
+ import { generateRandomAlphaNumericString, hasStatusOrThrow } from "./misc";
6
6
  import { createPopToken } from "./pop";
7
+ import { IssuerResponseError } from "./errors";
7
8
  export const AuthorizationDetail = z.object({
8
9
  credential_configuration_id: z.string(),
9
10
  format: z.union([z.literal("vc+sd-jwt"), z.literal("vc+mdoc-cbor")]),
@@ -76,7 +77,7 @@ export const makeParRequest = _ref => {
76
77
  "Content-Type": "application/x-www-form-urlencoded"
77
78
  },
78
79
  body: formBody.toString()
79
- }).then(hasStatus(201)).then(res => res.json()).then(result => result.request_uri);
80
+ }).then(hasStatusOrThrow(201, IssuerResponseError)).then(res => res.json()).then(result => result.request_uri);
80
81
  };
81
82
  };
82
83
  //# sourceMappingURL=par.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["sha256ToBase64","SignJWT","uuid","z","WalletInstanceAttestation","generateRandomAlphaNumericString","hasStatus","createPopToken","AuthorizationDetail","object","credential_configuration_id","string","format","union","literal","type","AuthorizationDetails","array","makeParRequest","_ref","wiaCryptoContext","appFetch","clientId","codeVerifier","redirectUri","responseMode","parEndpoint","walletInstanceAttestation","authorizationDetails","assertionType","wiaPublicKey","getPublicKey","parUrl","URL","aud","protocol","hostname","iss","decode","payload","cnf","jwk","kid","signedWiaPoP","jti","v4","codeChallengeMethod","codeChallenge","signedJwtForPar","setProtectedHeader","typ","setPayload","response_type","response_mode","client_id","state","code_challenge","code_challenge_method","authorization_details","redirect_uri","client_assertion_type","client_assertion","setIssuedAt","setExpirationTime","sign","formBody","URLSearchParams","request","method","headers","body","toString","then","res","json","result","request_uri"],"sourceRoot":"../../../src","sources":["utils/par.ts"],"mappings":"AAAA,SACEA,cAAc,EAEdC,OAAO,QACF,6BAA6B;AACpC,OAAOC,IAAI,MAAM,mBAAmB;AACpC,OAAO,KAAKC,CAAC,MAAM,KAAK;AACxB,OAAO,KAAKC,yBAAyB,MAAM,gCAAgC;AAC3E,SAASC,gCAAgC,EAAEC,SAAS,QAAQ,QAAQ;AACpE,SAASC,cAAc,QAAQ,OAAO;AAGtC,OAAO,MAAMC,mBAAmB,GAAGL,CAAC,CAACM,MAAM,CAAC;EAC1CC,2BAA2B,EAAEP,CAAC,CAACQ,MAAM,CAAC,CAAC;EACvCC,MAAM,EAAET,CAAC,CAACU,KAAK,CAAC,CAACV,CAAC,CAACW,OAAO,CAAC,WAAW,CAAC,EAAEX,CAAC,CAACW,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC;EACpEC,IAAI,EAAEZ,CAAC,CAACW,OAAO,CAAC,mBAAmB;AACrC,CAAC,CAAC;AAGF,OAAO,MAAME,oBAAoB,GAAGb,CAAC,CAACc,KAAK,CAACT,mBAAmB,CAAC;;AAEhE;AACA;AACA;AACA,OAAO,MAAMU,cAAc,GACzBC,IAAA;EAAA,IAAC;IACCC,gBAAgB;IAChBC;EAIF,CAAC,GAAAF,IAAA;EAAA,OACD,OACEG,QAAgB,EAChBC,YAAoB,EACpBC,WAAmB,EACnBC,YAAoB,EACpBC,WAAmB,EACnBC,yBAAiC,EACjCC,oBAA0C,EAC1CC,aAAqB,KACD;IACpB,MAAMC,YAAY,GAAG,MAAMV,gBAAgB,CAACW,YAAY,CAAC,CAAC;IAE1D,MAAMC,MAAM,GAAG,IAAIC,GAAG,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CAAC,CAAC;;IAET;IACA,IAAIC,QAAQ,GAAG,IAAIC,eAAe,CAAC;MACjCd,aAAa,EAAE,MAAM;MACrBE,SAAS,EAAEhC,QAAQ;MACnBkC,cAAc,EAAET,aAAa;MAC7BU,qBAAqB,EAAE,MAAM;MAC7BU,OAAO,EAAEnB,eAAe;MACxBY,qBAAqB,EAAE/B,aAAa;MACpCgC,gBAAgB,EAAElC,yBAAyB,GAAG,GAAG,GAAGgB;IACtD,CAAC,CAAC;IAEF,OAAO,MAAMtB,QAAQ,CAACK,WAAW,EAAE;MACjC0C,MAAM,EAAE,MAAM;MACdC,OAAO,EAAE;QACP,cAAc,EAAE;MAClB,CAAC;MACDC,IAAI,EAAEL,QAAQ,CAACM,QAAQ,CAAC;IAC1B,CAAC,CAAC,CACCC,IAAI,CAAClE,SAAS,CAAC,GAAG,CAAC,CAAC,CACpBkE,IAAI,CAAEC,GAAG,IAAKA,GAAG,CAACC,IAAI,CAAC,CAAC,CAAC,CACzBF,IAAI,CAAEG,MAAM,IAAKA,MAAM,CAACC,WAAW,CAAC;EACzC,CAAC;AAAA"}
1
+ {"version":3,"names":["sha256ToBase64","SignJWT","uuid","z","WalletInstanceAttestation","generateRandomAlphaNumericString","hasStatusOrThrow","createPopToken","IssuerResponseError","AuthorizationDetail","object","credential_configuration_id","string","format","union","literal","type","AuthorizationDetails","array","makeParRequest","_ref","wiaCryptoContext","appFetch","clientId","codeVerifier","redirectUri","responseMode","parEndpoint","walletInstanceAttestation","authorizationDetails","assertionType","wiaPublicKey","getPublicKey","parUrl","URL","aud","protocol","hostname","iss","decode","payload","cnf","jwk","kid","signedWiaPoP","jti","v4","codeChallengeMethod","codeChallenge","signedJwtForPar","setProtectedHeader","typ","setPayload","response_type","response_mode","client_id","state","code_challenge","code_challenge_method","authorization_details","redirect_uri","client_assertion_type","client_assertion","setIssuedAt","setExpirationTime","sign","formBody","URLSearchParams","request","method","headers","body","toString","then","res","json","result","request_uri"],"sourceRoot":"../../../src","sources":["ut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EAAEnB,eAAe;MACxBY,qBAAqB,EAAE/B,aAAa;MACpCgC,gBAAgB,EAAElC,yBAAyB,GAAG,GAAG,GAAGgB;IACtD,CAAC,CAAC;IAEF,OAAO,MAAMtB,QAAQ,CAACK,WAAW,EAAE;MACjC0C,MAAM,EAAE,MAAM;MACdC,OAAO,EAAE;QACP,cAAc,EAAE;MAClB,CAAC;MACDC,IAAI,EAAEL,QAAQ,CAACM,QAAQ,CAAC;IAC1B,CAAC,CAAC,CACCC,IAAI,CAACnE,gBAAgB,CAAC,GAAG,EAAEE,mBAAmB,CAAC,CAAC,CAChDiE,IAAI,CAAEC,GAAG,IAAKA,GAAG,CAACC,IAAI,CAAC,CAAC,CAAC,CACzBF,IAAI,CAAEG,MAAM,IAAKA,MAAM,CAACC,WAAW,CAAC;EACzC,CAAC;AAAA"}
@@ -6,7 +6,8 @@ The suggested way to implement this service is to use [io-react-native-integrity
6
6
 
7
7
  The following methods are available:
8
8
  - `createWalletInstance` creates a new wallet instance;
9
- - `revokeCurrentWalletInstance` revokes the currently valid wallet instance of the user who made the request.
9
+ - `revokeWalletInstance` revokes a wallet instance by ID;
10
+ - `getWalletInstanceStatus` fetches the status of a wallet instance by ID without the need to require an attestation.
10
11
 
11
12
  Examples are provided as follows:
12
13
 
@@ -35,12 +36,29 @@ return integrityKeyTag;
35
36
 
36
37
  The returned `integrityKeyTag` is supposed to be stored and used to verify the integrity of the device in the future when using an `IntegrityContext` object. It must be regenerated if another wallet instance is created.
37
38
 
38
- ### Wallet instance revocation
39
+ ### Wallet Instance revocation
40
+
41
+ Revoke a Wallet Instance by ID. The ID matches the hardware/integrity key tag used for creation.
42
+
43
+ ```ts
44
+ const { WALLET_PROVIDER_BASE_URL } = env;
45
+
46
+ await WalletInstance.revokeWalletInstance({
47
+ id: "495e5bec-b93f-4fd7-952a-94b27233abdb"
48
+ walletProviderBaseUrl: WALLET_PROVIDER_BASE_URL,
49
+ appFetch,
50
+ });
51
+
52
+ ```
53
+ ### Wallet Instance status
54
+
55
+ Get the status of a Wallet Instance by ID. The ID matches the hardware/integrity key tag used for creation.
39
56
 
40
57
  ```ts
41
58
  const { WALLET_PROVIDER_BASE_URL } = env;
42
59
 
43
- await WalletInstance.revokeCurrentWalletInstance({
60
+ const status = await WalletInstance.getWalletInstanceStatus({
61
+ id: "495e5bec-b93f-4fd7-952a-94b27233abdb"
44
62
  walletProviderBaseUrl: WALLET_PROVIDER_BASE_URL,
45
63
  appFetch,
46
64
  });
@@ -48,6 +66,9 @@ await WalletInstance.revokeCurrentWalletInstance({
48
66
 
49
67
  ## Mapped results
50
68
 
51
- ### 409 Conflict (WalletInstanceCreationIntegrityError)
69
+ The following errors are mapped to a `WalletProviderResponseError` with specific codes.
52
70
 
53
- A `409 Conflict` response is returned by the wallet provider when an integrity check fails.
71
+ |HTTP Status|Error Code|Description|
72
+ |-----------|----------|-----------|
73
+ |`409 Conflict`|`ERR_IO_WALLET_INSTANCE_INTEGRITY_FAILED`|This response is returned by the wallet provider when an integrity check fails.|
74
+ |`*`|`ERR_IO_WALLET_PROVIDER_GENERIC_ERROR`|This is a generic error code to map unexpected errors that occurred when interacting with the Wallet Provider.|
@@ -1,5 +1,5 @@
1
1
  import { getWalletProviderClient } from "../client";
2
- import { WalletInstanceCreationError, WalletInstanceCreationIntegrityError, WalletProviderResponseError } from "../utils/errors";
2
+ import { ResponseErrorBuilder, WalletProviderResponseError, WalletProviderResponseErrorCodes } from "../utils/errors";
3
3
  export async function createWalletInstance(context) {
4
4
  const {
5
5
  integrityContext
@@ -25,17 +25,42 @@ const handleCreateWalletInstanceError = e => {
25
25
  if (!(e instanceof WalletProviderResponseError)) {
26
26
  throw e;
27
27
  }
28
- if (e.statusCode === 409) {
29
- throw new WalletInstanceCreationIntegrityError("Unable to get an attestation for a Wallet Instance that failed the integrity check", e.claim, e.reason);
30
- }
31
- throw new WalletInstanceCreationError(`Unable to obtain wallet instance attestation [response status code: ${e.statusCode}]`, e.claim, e.reason);
28
+ throw new ResponseErrorBuilder(WalletProviderResponseError).handle(409, {
29
+ code: WalletProviderResponseErrorCodes.WalletInstanceIntegrityFailed,
30
+ message: "Unable to create a wallet instance with a device that failed the integrity check"
31
+ }).handle("*", {
32
+ code: WalletProviderResponseErrorCodes.WalletInstanceCreationFailed,
33
+ message: "Unable to create wallet instance"
34
+ }).buildFrom(e);
32
35
  };
33
- export async function revokeCurrentWalletInstance(context) {
36
+
37
+ /**
38
+ * Revoke a Wallet Instance by ID.
39
+ * @param context.id The Wallet Instance ID. It matches the hardware key tag used for creation.
40
+ */
41
+ export async function revokeWalletInstance(context) {
34
42
  const api = getWalletProviderClient(context);
35
- await api.put("/wallet-instances/current/status", {
43
+ await api.put("/wallet-instances/{id}/status", {
44
+ path: {
45
+ id: context.id
46
+ },
36
47
  body: {
37
48
  status: "REVOKED"
38
49
  }
39
50
  });
40
51
  }
52
+
53
+ /**
54
+ * Get the status of a Wallet Instance by ID.
55
+ * @param context.id The Wallet Instance ID. It matches the hardware key tag used for creation.
56
+ * @returns Details on the status of the Wallet Instance
57
+ */
58
+ export async function getWalletInstanceStatus(context) {
59
+ const api = getWalletProviderClient(context);
60
+ return api.get("/wallet-instances/{id}/status", {
61
+ path: {
62
+ id: context.id
63
+ }
64
+ });
65
+ }
41
66
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["getWalletProviderClient","WalletInstanceCreationError","WalletInstanceCreationIntegrityError","WalletProviderResponseError","createWalletInstance","context","integrityContext","api","challenge","get","then","response","nonce","keyAttestation","getAttestation","hardwareKeyTag","getHardwareKeyTag","post","body","key_attestation","hardware_key_tag","catch","handleCreateWalletInstanceError","e","statusCode","claim","reason","revokeCurrentWalletInstance","put","status"],"sourceRoot":"../../../src","sources":["wallet-instance/index.ts"],"mappings":"AAAA,SAASA,uBAAuB,QAAQ,WAAW;AAEnD,SACEC,2BAA2B,EAC3BC,oCAAoC,EACpCC,2BAA2B,QACtB,iBAAiB;AAExB,OAAO,eAAeC,oBAAoBA,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CAAC;AACJ"}
1
+ {"version":3,"names":["getWalletProviderClient","ResponseErrorBuilder","WalletProviderResponseError","WalletProviderResponseErrorCodes","createWalletInstance","context","integrityContext","api","challenge","get","then","response","nonce","keyAttestation","getAttestation","hardwareKeyTag","getHardwareKeyTag","post","body","key_attestation","hardware_key_tag","catch","handleCreateWalletInstanceError","e","handle","code","WalletInstanceIntegrityFailed","message","WalletInstanceCreationFailed","buildFrom","revokeWalletInstance","put","path","id","status","getWalletInstanceStatus"],"sourceRoot":"../../../src","sources":["wallet-instance/index.ts"],"mappings":"AAAA,SAASA,uBAAuB,QAAQ,WAAW;AACnD,SACEC,oBAAoB,EACpBC,2BAA2B,EAC3BC,gCAAgC,QAC3B,iBAAiB;AAIxB,OAAO,eAAeC,oBAAoBA,CAACC,OAI1C,EAAE;EACD,MAAM;IAAEC;EAAiB,CAAC,GAAGD,OAAO;EAEpC,MAAME,GAAG,GAAGP,uBAAuB,CAACK,OAAO,CAAC;;EAE5C;EACA,MAAMG,SAAS,GAAG,MAAMD,GAAG,CAACE,GAAG,CAAC,QAAQ,CAAC,CAACC,IAAI,CAAEC,QAAQ,IAAKA,QAAQ,CAACC,KAAK,CAAC;EAE5E,MAAMC,cAAc,GAAG,MAAMP,gBAAgB,CAACQ,cAAc,CAACN,SAAS,CAAC;EACvE,MAAMO,cAAc,GAAGT,gBAAgB,CAACU,iBAAiB,CAAC,CAAC;;EAE3D;EACA,MAAMT,GAAG,CACNU,IAAI,CAAC,mBAAmB,EAAE;IACzBC,IAAI,EAAE;MACJV,SAAS;MACTW,eAAe,EAAEN,cAAc;MAC/BO,gBAAgB,EAAEL;IACpB;EACF,CAAC,CAAC,CACDM,KAAK,CAACC,+BAA+B,CAAC;EAEzC,OAAOP,cAAc;AACvB;AAEA,MAAMO,+BAA+B,GAAIC,CAAU,IAAK;EACtD,IAAI,EAAEA,CAAC,YAAYrB,2BAA2B,CAAC,EAAE;IAC/C,MAAMqB,CAAC;EACT;EAEA,MAAM,IAAItB,oBAAoB,CAACC,2BAA2B,CAAC,CACxDsB,MAAM,CAAC,GAAG,EAAE;IACXC,IAAI,EAAEtB,gCAAgC,CAACuB,6BAA6B;IACpEC,OAAO,EACL;EACJ,CAAC,CAAC,CACDH,MAAM,CAAC,GAAG,EAAE;IACXC,IAAI,EAAEtB,gCAAgC,CAACyB,4BAA4B;IACnED,OAAO,EAAE;EACX,CAAC,CAAC,CACDE,SAAS,CAACN,CAAC,CAAC;AACjB,CAAC;;AAED;AACA;AACA;AACA;AACA,OAAO,eAAeO,oBAAoBA,CAACzB,OAI1C,EAAiB;EAChB,MAAME,GAAG,GAAGP,uBAAuB,CAACK,OAAO,CAAC;EAE5C,MAAME,GAAG,CAACwB,GAAG,CAAC,+BAA+B,EAAE;IAC7CC,IAAI,EAAE;MAAEC,EAAE,EAAE5B,OAAO,CAAC4B;IAAG,CAAC;IACxBf,IAAI,EAAE;MAAEgB,MAAM,EAAE;IAAU;EAC5B,CAAC,CAAC;AACJ;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,eAAeC,uBAAuBA,CAAC9B,OAI7C,EAA+B;EAC9B,MAAME,GAAG,GAAGP,uBAAuB,CAACK,OAAO,CAAC;EAE5C,OAAOE,GAAG,CAACE,GAAG,CAAC,+BAA+B,EAAE;IAC9CuB,IAAI,EAAE;MAAEC,EAAE,EAAE5B,OAAO,CAAC4B;IAAG;EACzB,CAAC,CAAC;AACJ"}
@@ -36,6 +36,12 @@ The returned `issuedAttestation` is supposed to be stored and used for any futur
36
36
 
37
37
  ## Mapped results
38
38
 
39
- ### 409 Conflict (WalletInstanceIntegrityFailedError)
39
+ The following errors are mapped to a `WalletProviderResponseError` with specific codes.
40
+
41
+ |HTTP Status|Error Code|Description|
42
+ |-----------|----------|-----------|
43
+ |`403 Forbidden`|`ERR_IO_WALLET_INSTANCE_REVOKED`|This response is returned by the wallet provider when the wallet instance has been revoked.|
44
+ |`404 Not Found`|`ERR_IO_WALLET_INSTANCE_NOT_FOUND`|This response is returned by the wallet provider when the wallet instance does not exist.|
45
+ |`409 Conflict`|`ERR_IO_WALLET_INSTANCE_INTEGRITY_FAILED`|This response is returned by the wallet provider when an integrity check fails.|
46
+ |`*`|`ERR_IO_WALLET_PROVIDER_GENERIC_ERROR`|This is a generic error code to map unexpected errors that occurred when interacting with the Wallet Provider.|
40
47
 
41
- A `409 Conflict` response is returned by the wallet provider when an integrity check fails.
@@ -1,7 +1,7 @@
1
1
  import { SignJWT, thumbprint } from "@pagopa/io-react-native-jwt";
2
- import { JWK, fixBase64EncodingOnKey } from "../utils/jwk";
2
+ import { fixBase64EncodingOnKey, JWK } from "../utils/jwk";
3
3
  import { getWalletProviderClient } from "../client";
4
- import { WalletProviderResponseError, WalletInstanceRevokedError, WalletInstanceNotFoundError, WalletInstanceAttestationIssuingError, WalletInstanceIntegrityFailedError } from "../utils/errors";
4
+ import { ResponseErrorBuilder, WalletProviderResponseError, WalletProviderResponseErrorCodes } from "../utils/errors";
5
5
  import { TokenResponse } from "./types";
6
6
 
7
7
  /**
@@ -87,15 +87,18 @@ const handleAttestationCreationError = e => {
87
87
  if (!(e instanceof WalletProviderResponseError)) {
88
88
  throw e;
89
89
  }
90
- if (e.statusCode === 403) {
91
- throw new WalletInstanceRevokedError("Unable to get an attestation for a revoked Wallet Instance", e.claim, e.reason);
92
- }
93
- if (e.statusCode === 404) {
94
- throw new WalletInstanceNotFoundError("Unable to get an attestation for a Wallet Instance that does not exist", e.claim, e.reason);
95
- }
96
- if (e.statusCode === 409) {
97
- throw new WalletInstanceIntegrityFailedError("Unable to get an attestation for a Wallet Instance that failed the integrity check", e.claim, e.reason);
98
- }
99
- throw new WalletInstanceAttestationIssuingError(`Unable to obtain wallet instance attestation [response status code: ${e.statusCode}]`, e.claim, e.reason);
90
+ throw new ResponseErrorBuilder(WalletProviderResponseError).handle(403, {
91
+ code: WalletProviderResponseErrorCodes.WalletInstanceRevoked,
92
+ message: "Unable to get an attestation for a revoked Wallet Instance"
93
+ }).handle(404, {
94
+ code: WalletProviderResponseErrorCodes.WalletInstanceNotFound,
95
+ message: "Unable to get an attestation for a Wallet Instance that does not exist"
96
+ }).handle(409, {
97
+ code: WalletProviderResponseErrorCodes.WalletInstanceIntegrityFailed,
98
+ message: "Unable to get an attestation for a Wallet Instance that failed the integrity check"
99
+ }).handle("*", {
100
+ code: WalletProviderResponseErrorCodes.WalletInstanceAttestationIssuingFailed,
101
+ message: "Unable to obtain wallet instance attestation"
102
+ }).buildFrom(e);
100
103
  };
101
104
  //# sourceMappingURL=issuing.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["SignJWT","thumbprint","JWK","fixBase64EncodingOnKey","getWalletProviderClient","WalletProviderResponseError","WalletInstanceRevokedError","WalletInstanceNotFoundError","WalletInstanceAttestationIssuingError","WalletInstanceIntegrityFailedError","TokenResponse","getAttestationRequest","challenge","wiaCryptoContext","integrityContext","walletProviderBaseUrl","jwk","getPublicKey","parsedJwk","parse","keyThumbprint","publicKey","kid","clientData","jwk_thumbprint","hardwareKeyTag","getHardwareKeyTag","signature","authenticatorData","getHardwareSignatureWithAuthData","JSON","stringify","setPayload","iss","sub","hardware_signature","integrity_assertion","hardware_key_tag","cnf","setProtectedHeader","typ","setIssuedAt","setExpirationTime","sign","getAttestation","_ref","appFetch","fetch","api","get","then","response","nonce","signedAttestationRequest","tokenResponse","post","body","grant_type","assertion","result","catch","handleAttestationCreationError","wallet_attestation","e","statusCode","claim","reason"],"sourceRoot":"../../../src","sources":["wallet-instance-attestation/issuing.ts"],"mappings":"AACA,SAASA,OAAO,EAAEC,UAAU,QAAQ,6BAA6B;AACjE,SAASC,GAAG,EAAEC,sBAAsB,QAAQ,cAAc;AAC1D,SAASC,uBAAuB,QAAQ,WAAW;AAEnD,SACEC,2BAA2B,EAC3BC,0BAA0B,EAC1BC,2BAA2B,EAC3BC,qCAAqC,EACrCC,kCAAkC,QAC7B,iBAAiB;AACxB,SAASC,aAAa,QAAQ,SAAS;;AAEvC;AACA;AACA;AACA;AACA;AACA;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AK,GAAG,EAAE;IACxB,MAAM,IAAIvD,kCAAkC,CAC1C,oFAAoF,EACpFsD,CAAC,CAACE,KAAK,EACPF,CAAC,CAACG,MACJ,CAAC;EACH;EAEA,MAAM,IAAI1D,qCAAqC,CAC5C,uEAAsEuD,CAAC,CAACC,UAAW,GAAE,EACtFD,CAAC,CAACE,KAAK,EACPF,CAAC,CAACG,MACJ,CAAC;AACH,CAAC"}
1
+ {"version":3,"names":["SignJWT","thumbprint","fixBase64EncodingOnKey","JWK","getWalletProviderClient","ResponseErrorBuilder","WalletProviderResponseError","WalletProviderResponseErrorCodes","TokenResponse","getAttestationRequest","challenge","wiaCryptoContext","integrityContext","walletProviderBaseUrl","jwk","getPublicKey","parsedJwk","parse","keyThumbprint","publicKey","kid","clientData","jwk_thumbprint","hardwareKeyTag","getHardwareKeyTag","signature","authenticatorData","getHardwareSignatureWithAuthData","JSON","stringify","setPayload","iss","sub","hardware_signature","integrity_assertion","hardware_key_tag","cnf","setProtectedHeader","typ","setIssuedAt","setExpirationTime","sign","getAttestation","_ref","appFetch","fetch","api","get","then","response","nonce","signedAttestationRequest","tokenResponse","post","body","grant_type","assertion","result","catch","handleAttestationCreationError","wallet_attestation","e","handle","code","WalletInstanceRevoked","message","WalletInstanceNotFound","WalletInstanceIntegrityFailed","WalletInstanceAttestationIssuingFailed","buildFrom"],"sourceRoot":"../../../src","sources":["wallet-instance-attestation/issuing.ts"],"mappings":"AAAA,SAEEA,OAAO,EACPC,UAAU,QACL,6BAA6B;AACpC,SAASC,sBAAsB,EAAEC,GAAG,QAAQ,cAAc;AAC1D,SAASC,uBAAuB,QAAQ,WAAW;AAEnD,SACEC,oBAAoB,EACpBC,2BAA2B,EAC3BC,gCAAgC,QAC3B,iBAAiB;AACxB,SAASC,aAAa,QAAQ,SAAS;;AAEvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,eAAeC,qBAAqBA,CACzCC,SAAiB,EACjBC,gBAA+B,EAC/BC,gBAA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ExD,gCAAgC,CAAC6D,sCAAsC;IAC7EH,OAAO,EAAE;EACX,CAAC,CAAC,CACDI,SAAS,CAACR,CAAC,CAAC;AACjB,CAAC"}
@@ -60,14 +60,30 @@ export declare const ProblemDetail: z.ZodObject<{
60
60
  detail?: string | undefined;
61
61
  instance?: string | undefined;
62
62
  }>;
63
- export type SetCurrentWalletInstanceStatusBody = z.infer<typeof SetCurrentWalletInstanceStatusBody>;
64
- export declare const SetCurrentWalletInstanceStatusBody: z.ZodObject<{
63
+ export type SetWalletInstanceStatusBody = z.infer<typeof SetWalletInstanceStatusBody>;
64
+ export declare const SetWalletInstanceStatusBody: z.ZodObject<{
65
65
  status: z.ZodLiteral<"REVOKED">;
66
66
  }, "strip", z.ZodTypeAny, {
67
67
  status: "REVOKED";
68
68
  }, {
69
69
  status: "REVOKED";
70
70
  }>;
71
+ export type RevocationReason = z.infer<typeof RevocationReason>;
72
+ export declare const RevocationReason: z.ZodUnion<[z.ZodLiteral<"CERTIFICATE_REVOKED_BY_ISSUER">, z.ZodLiteral<"NEW_WALLET_INSTANCE_CREATED">, z.ZodLiteral<"REVOKED_BY_USER">]>;
73
+ export type WalletInstanceData = z.infer<typeof WalletInstanceData>;
74
+ export declare const WalletInstanceData: z.ZodObject<{
75
+ id: z.ZodString;
76
+ is_revoked: z.ZodBoolean;
77
+ revocation_reason: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"CERTIFICATE_REVOKED_BY_ISSUER">, z.ZodLiteral<"NEW_WALLET_INSTANCE_CREATED">, z.ZodLiteral<"REVOKED_BY_USER">]>, z.ZodUndefined]>>;
78
+ }, "strip", z.ZodTypeAny, {
79
+ id: string;
80
+ is_revoked: boolean;
81
+ revocation_reason?: "CERTIFICATE_REVOKED_BY_ISSUER" | "NEW_WALLET_INSTANCE_CREATED" | "REVOKED_BY_USER" | undefined;
82
+ }, {
83
+ id: string;
84
+ is_revoked: boolean;
85
+ revocation_reason?: "CERTIFICATE_REVOKED_BY_ISSUER" | "NEW_WALLET_INSTANCE_CREATED" | "REVOKED_BY_USER" | undefined;
86
+ }>;
71
87
  export type get_GetNonce = typeof get_GetNonce;
72
88
  export declare const get_GetNonce: {
73
89
  method: z.ZodLiteral<"GET">;
@@ -114,45 +130,53 @@ export declare const post_CreateWalletInstance: {
114
130
  }>;
115
131
  response: z.ZodUnknown;
116
132
  };
117
- export type post_CreateWalletAttestation = typeof post_CreateWalletAttestation;
118
- export declare const post_CreateWalletAttestation: {
119
- method: z.ZodLiteral<"POST">;
120
- path: z.ZodLiteral<"/token">;
133
+ export type get_GetWalletInstanceStatus = typeof get_GetWalletInstanceStatus;
134
+ export declare const get_GetWalletInstanceStatus: {
135
+ method: z.ZodLiteral<"GET">;
136
+ path: z.ZodLiteral<"/wallet-instances/{id}/status">;
121
137
  parameters: z.ZodObject<{
122
- body: z.ZodObject<{
123
- grant_type: z.ZodLiteral<"urn:ietf:params:oauth:grant-type:jwt-bearer">;
124
- assertion: z.ZodString;
138
+ path: z.ZodObject<{
139
+ id: z.ZodString;
125
140
  }, "strip", z.ZodTypeAny, {
126
- grant_type: "urn:ietf:params:oauth:grant-type:jwt-bearer";
127
- assertion: string;
141
+ id: string;
128
142
  }, {
129
- grant_type: "urn:ietf:params:oauth:grant-type:jwt-bearer";
130
- assertion: string;
143
+ id: string;
131
144
  }>;
132
145
  }, "strip", z.ZodTypeAny, {
133
- body: {
134
- grant_type: "urn:ietf:params:oauth:grant-type:jwt-bearer";
135
- assertion: string;
146
+ path: {
147
+ id: string;
136
148
  };
137
149
  }, {
138
- body: {
139
- grant_type: "urn:ietf:params:oauth:grant-type:jwt-bearer";
140
- assertion: string;
150
+ path: {
151
+ id: string;
141
152
  };
142
153
  }>;
143
154
  response: z.ZodObject<{
144
- wallet_attestation: z.ZodString;
155
+ id: z.ZodString;
156
+ is_revoked: z.ZodBoolean;
157
+ revocation_reason: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"CERTIFICATE_REVOKED_BY_ISSUER">, z.ZodLiteral<"NEW_WALLET_INSTANCE_CREATED">, z.ZodLiteral<"REVOKED_BY_USER">]>, z.ZodUndefined]>>;
145
158
  }, "strip", z.ZodTypeAny, {
146
- wallet_attestation: string;
159
+ id: string;
160
+ is_revoked: boolean;
161
+ revocation_reason?: "CERTIFICATE_REVOKED_BY_ISSUER" | "NEW_WALLET_INSTANCE_CREATED" | "REVOKED_BY_USER" | undefined;
147
162
  }, {
148
- wallet_attestation: string;
163
+ id: string;
164
+ is_revoked: boolean;
165
+ revocation_reason?: "CERTIFICATE_REVOKED_BY_ISSUER" | "NEW_WALLET_INSTANCE_CREATED" | "REVOKED_BY_USER" | undefined;
149
166
  }>;
150
167
  };
151
- export type put_SetCurrentWalletInstanceStatus = typeof put_SetCurrentWalletInstanceStatus;
152
- export declare const put_SetCurrentWalletInstanceStatus: {
168
+ export type put_SetWalletInstanceStatus = typeof put_SetWalletInstanceStatus;
169
+ export declare const put_SetWalletInstanceStatus: {
153
170
  method: z.ZodLiteral<"PUT">;
154
- path: z.ZodLiteral<"/wallet-instances/current/status">;
171
+ path: z.ZodLiteral<"/wallet-instances/{id}/status">;
155
172
  parameters: z.ZodObject<{
173
+ path: z.ZodObject<{
174
+ id: z.ZodString;
175
+ }, "strip", z.ZodTypeAny, {
176
+ id: string;
177
+ }, {
178
+ id: string;
179
+ }>;
156
180
  body: z.ZodObject<{
157
181
  status: z.ZodLiteral<"REVOKED">;
158
182
  }, "strip", z.ZodTypeAny, {
@@ -161,16 +185,56 @@ export declare const put_SetCurrentWalletInstanceStatus: {
161
185
  status: "REVOKED";
162
186
  }>;
163
187
  }, "strip", z.ZodTypeAny, {
188
+ path: {
189
+ id: string;
190
+ };
164
191
  body: {
165
192
  status: "REVOKED";
166
193
  };
167
194
  }, {
195
+ path: {
196
+ id: string;
197
+ };
168
198
  body: {
169
199
  status: "REVOKED";
170
200
  };
171
201
  }>;
172
202
  response: z.ZodUnknown;
173
203
  };
204
+ export type post_CreateWalletAttestation = typeof post_CreateWalletAttestation;
205
+ export declare const post_CreateWalletAttestation: {
206
+ method: z.ZodLiteral<"POST">;
207
+ path: z.ZodLiteral<"/token">;
208
+ parameters: z.ZodObject<{
209
+ body: z.ZodObject<{
210
+ grant_type: z.ZodLiteral<"urn:ietf:params:oauth:grant-type:jwt-bearer">;
211
+ assertion: z.ZodString;
212
+ }, "strip", z.ZodTypeAny, {
213
+ grant_type: "urn:ietf:params:oauth:grant-type:jwt-bearer";
214
+ assertion: string;
215
+ }, {
216
+ grant_type: "urn:ietf:params:oauth:grant-type:jwt-bearer";
217
+ assertion: string;
218
+ }>;
219
+ }, "strip", z.ZodTypeAny, {
220
+ body: {
221
+ grant_type: "urn:ietf:params:oauth:grant-type:jwt-bearer";
222
+ assertion: string;
223
+ };
224
+ }, {
225
+ body: {
226
+ grant_type: "urn:ietf:params:oauth:grant-type:jwt-bearer";
227
+ assertion: string;
228
+ };
229
+ }>;
230
+ response: z.ZodObject<{
231
+ wallet_attestation: z.ZodString;
232
+ }, "strip", z.ZodTypeAny, {
233
+ wallet_attestation: string;
234
+ }, {
235
+ wallet_attestation: string;
236
+ }>;
237
+ };
174
238
  export declare const EndpointByMethod: {
175
239
  get: {
176
240
  "/nonce": {
@@ -185,6 +249,40 @@ export declare const EndpointByMethod: {
185
249
  nonce: string;
186
250
  }>;
187
251
  };
252
+ "/wallet-instances/{id}/status": {
253
+ method: z.ZodLiteral<"GET">;
254
+ path: z.ZodLiteral<"/wallet-instances/{id}/status">;
255
+ parameters: z.ZodObject<{
256
+ path: z.ZodObject<{
257
+ id: z.ZodString;
258
+ }, "strip", z.ZodTypeAny, {
259
+ id: string;
260
+ }, {
261
+ id: string;
262
+ }>;
263
+ }, "strip", z.ZodTypeAny, {
264
+ path: {
265
+ id: string;
266
+ };
267
+ }, {
268
+ path: {
269
+ id: string;
270
+ };
271
+ }>;
272
+ response: z.ZodObject<{
273
+ id: z.ZodString;
274
+ is_revoked: z.ZodBoolean;
275
+ revocation_reason: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"CERTIFICATE_REVOKED_BY_ISSUER">, z.ZodLiteral<"NEW_WALLET_INSTANCE_CREATED">, z.ZodLiteral<"REVOKED_BY_USER">]>, z.ZodUndefined]>>;
276
+ }, "strip", z.ZodTypeAny, {
277
+ id: string;
278
+ is_revoked: boolean;
279
+ revocation_reason?: "CERTIFICATE_REVOKED_BY_ISSUER" | "NEW_WALLET_INSTANCE_CREATED" | "REVOKED_BY_USER" | undefined;
280
+ }, {
281
+ id: string;
282
+ is_revoked: boolean;
283
+ revocation_reason?: "CERTIFICATE_REVOKED_BY_ISSUER" | "NEW_WALLET_INSTANCE_CREATED" | "REVOKED_BY_USER" | undefined;
284
+ }>;
285
+ };
188
286
  };
189
287
  post: {
190
288
  "/wallet-instances": {
@@ -254,10 +352,17 @@ export declare const EndpointByMethod: {
254
352
  };
255
353
  };
256
354
  put: {
257
- "/wallet-instances/current/status": {
355
+ "/wallet-instances/{id}/status": {
258
356
  method: z.ZodLiteral<"PUT">;
259
- path: z.ZodLiteral<"/wallet-instances/current/status">;
357
+ path: z.ZodLiteral<"/wallet-instances/{id}/status">;
260
358
  parameters: z.ZodObject<{
359
+ path: z.ZodObject<{
360
+ id: z.ZodString;
361
+ }, "strip", z.ZodTypeAny, {
362
+ id: string;
363
+ }, {
364
+ id: string;
365
+ }>;
261
366
  body: z.ZodObject<{
262
367
  status: z.ZodLiteral<"REVOKED">;
263
368
  }, "strip", z.ZodTypeAny, {
@@ -266,10 +371,16 @@ export declare const EndpointByMethod: {
266
371
  status: "REVOKED";
267
372
  }>;
268
373
  }, "strip", z.ZodTypeAny, {
374
+ path: {
375
+ id: string;
376
+ };
269
377
  body: {
270
378
  status: "REVOKED";
271
379
  };
272
380
  }, {
381
+ path: {
382
+ id: string;
383
+ };
273
384
  body: {
274
385
  status: "REVOKED";
275
386
  };
@@ -1 +1 @@
1
- {"version":3,"file":"wallet-provider.d.ts","sourceRoot":"","sources":["../../../../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AAE,SAAS,SAAS,aAAa,CAAC,IAAI,CAAC,EAC1E,IAAI,EAAE,IAAI,EACV,GAAG,MAAM,EAAE,gBAAgB,CAAC,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC,CAAC,GAC5D,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,CAAC;IAM1C,GAAG,CAAC,IAAI,SAAS,MAAM,YAAY,EAAE,SAAS,SAAS,YAAY,CAAC,IAAI,CAAC,EACvE,IAAI,EAAE,IAAI,EACV,GAAG,MAAM,EAAE,gBAAgB,CAAC,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC,CAAC,GAC5D,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,CAAC;CAI3C;AAED,wBAAgB,eAAe,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,MAAM,aAEjE;;AAED;;;;;;;;EAQE"}
@@ -1,7 +1,13 @@
1
- import { ApiClient as WalletProviderApiClient } from "./generated/wallet-provider";
1
+ import { ApiClient as WalletProviderApiClient, type EndpointParameters } from "./generated/wallet-provider";
2
2
  export type WalletProviderClient = WalletProviderApiClient;
3
3
  export declare const getWalletProviderClient: (context: {
4
4
  walletProviderBaseUrl: string;
5
5
  appFetch?: GlobalFetch["fetch"];
6
6
  }) => WalletProviderApiClient;
7
+ /**
8
+ * Function to interpolate the url when the request includes path params.
9
+ * The client generator expects the literal name of the param in the url
10
+ * and passes the actual values in a separate object.
11
+ */
12
+ export declare const interpolateUrl: (url: string, params?: EndpointParameters) => string;
7
13
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/client/index.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,SAAS,IAAI,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAEnF,MAAM,MAAM,oBAAoB,GAAG,uBAAuB,CAAC;AAuB3D,eAAO,MAAM,uBAAuB,YAAa;IAC/C,qBAAqB,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;CACjC,4BAsBA,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/client/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAGL,SAAS,IAAI,uBAAuB,EACpC,KAAK,kBAAkB,EACxB,MAAM,6BAA6B,CAAC;AAErC,MAAM,MAAM,oBAAoB,GAAG,uBAAuB,CAAC;AAwB3D,eAAO,MAAM,uBAAuB,YAAa;IAC/C,qBAAqB,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;CACjC,4BAgBA,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,cAAc,QAAS,MAAM,WAAW,kBAAkB,WAStE,CAAC"}
@@ -16,7 +16,7 @@ export type StartUserAuthorization = (issuerConf: Out<EvaluateIssuerTrust>["issu
16
16
  }>;
17
17
  /**
18
18
  * WARNING: This function must be called after {@link evaluateIssuerTrust} and {@link startFlow}. The next steam is {@link compeUserAuthorizationWithQueryMode} or {@link compeUserAuthorizationWithFormPostJwtMode}
19
- * Creates and sends a PAR request to the /as/par endpoint of the authroization server.
19
+ * Creates and sends a PAR request to the /as/par endpoint of the authorization server.
20
20
  * This starts the authentication flow to obtain an access token.
21
21
  * This token enables the Wallet Instance to request a digital credential from the Credential Endpoint of the Credential Issuer.
22
22
  * This is an HTTP POST request containing the Wallet Instance identifier (client id), the code challenge and challenge method as specified by PKCE according to RFC 9126
@@ -73,5 +73,5 @@ export declare const completeUserAuthorizationWithFormPostJwtMode: CompleteUserA
73
73
  * @param authRes the authorization response to be parsed
74
74
  * @returns the authorization result which contains code, state and iss
75
75
  */
76
- export declare const parseAuthroizationResponse: (authRes: unknown) => AuthorizationResult;
76
+ export declare const parseAuthorizationResponse: (authRes: unknown) => AuthorizationResult;
77
77
  //# sourceMappingURL=04-complete-user-authorization.d.ts.map