@pagopa/io-react-native-wallet 0.21.0 → 0.22.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (63) hide show
  1. package/lib/commonjs/credential/issuance/06-obtain-credential.js +5 -4
  2. package/lib/commonjs/credential/issuance/06-obtain-credential.js.map +1 -1
  3. package/lib/commonjs/credential/issuance/README.md +7 -5
  4. package/lib/commonjs/credential/issuance/types.js +5 -1
  5. package/lib/commonjs/credential/issuance/types.js.map +1 -1
  6. package/lib/commonjs/credential/status/02-status-attestation.js +4 -3
  7. package/lib/commonjs/credential/status/02-status-attestation.js.map +1 -1
  8. package/lib/commonjs/credential/status/README.md +1 -1
  9. package/lib/commonjs/credential/status/types.js +14 -1
  10. package/lib/commonjs/credential/status/types.js.map +1 -1
  11. package/lib/commonjs/sd-jwt/index.js +3 -1
  12. package/lib/commonjs/sd-jwt/index.js.map +1 -1
  13. package/lib/commonjs/trust/types.js +9 -1
  14. package/lib/commonjs/trust/types.js.map +1 -1
  15. package/lib/commonjs/utils/errors.js +57 -29
  16. package/lib/commonjs/utils/errors.js.map +1 -1
  17. package/lib/commonjs/utils/misc.js +11 -2
  18. package/lib/commonjs/utils/misc.js.map +1 -1
  19. package/lib/module/credential/issuance/06-obtain-credential.js +8 -7
  20. package/lib/module/credential/issuance/06-obtain-credential.js.map +1 -1
  21. package/lib/module/credential/issuance/README.md +7 -5
  22. package/lib/module/credential/issuance/types.js +3 -0
  23. package/lib/module/credential/issuance/types.js.map +1 -1
  24. package/lib/module/credential/status/02-status-attestation.js +7 -6
  25. package/lib/module/credential/status/02-status-attestation.js.map +1 -1
  26. package/lib/module/credential/status/README.md +1 -1
  27. package/lib/module/credential/status/types.js +12 -0
  28. package/lib/module/credential/status/types.js.map +1 -1
  29. package/lib/module/sd-jwt/index.js +3 -2
  30. package/lib/module/sd-jwt/index.js.map +1 -1
  31. package/lib/module/trust/types.js +9 -1
  32. package/lib/module/trust/types.js.map +1 -1
  33. package/lib/module/utils/errors.js +52 -25
  34. package/lib/module/utils/errors.js.map +1 -1
  35. package/lib/module/utils/misc.js +9 -1
  36. package/lib/module/utils/misc.js.map +1 -1
  37. package/lib/typescript/credential/issuance/06-obtain-credential.d.ts.map +1 -1
  38. package/lib/typescript/credential/issuance/types.d.ts +8 -0
  39. package/lib/typescript/credential/issuance/types.d.ts.map +1 -1
  40. package/lib/typescript/credential/status/02-status-attestation.d.ts +1 -1
  41. package/lib/typescript/credential/status/02-status-attestation.d.ts.map +1 -1
  42. package/lib/typescript/credential/status/types.d.ts +15 -0
  43. package/lib/typescript/credential/status/types.d.ts.map +1 -1
  44. package/lib/typescript/sd-jwt/index.d.ts.map +1 -1
  45. package/lib/typescript/trust/index.d.ts +14 -0
  46. package/lib/typescript/trust/index.d.ts.map +1 -1
  47. package/lib/typescript/trust/types.d.ts +194 -0
  48. package/lib/typescript/trust/types.d.ts.map +1 -1
  49. package/lib/typescript/utils/errors.d.ts +31 -14
  50. package/lib/typescript/utils/errors.d.ts.map +1 -1
  51. package/lib/typescript/utils/misc.d.ts +1 -0
  52. package/lib/typescript/utils/misc.d.ts.map +1 -1
  53. package/package.json +4 -3
  54. package/src/credential/issuance/06-obtain-credential.ts +11 -7
  55. package/src/credential/issuance/README.md +7 -5
  56. package/src/credential/issuance/types.ts +8 -0
  57. package/src/credential/status/02-status-attestation.ts +13 -5
  58. package/src/credential/status/README.md +1 -1
  59. package/src/credential/status/types.ts +15 -0
  60. package/src/sd-jwt/index.ts +3 -3
  61. package/src/trust/types.ts +12 -0
  62. package/src/utils/errors.ts +72 -26
  63. package/src/utils/misc.ts +12 -4
@@ -95,8 +95,8 @@ const obtainCredential = async (issuerConf, accessToken, clientId, credentialDef
95
95
  * Handle the credential error by mapping it to a custom exception.
96
96
  * If the error is not an instance of {@link UnexpectedStatusCodeError}, it is thrown as is.
97
97
  * @param e - The error to be handled
98
- * @throws {@link StatusAttestationError} if the status code is different from 404
99
- * @throws {@link StatusAttestationInvalid} if the status code is 404 (meaning the credential is invalid)
98
+ * @throws {@link CredentialRequestError} if the status code is different from 404
99
+ * @throws {@link CredentialInvalidStatusError} if the status code is 404 (meaning the credential is invalid)
100
100
  */
101
101
  exports.obtainCredential = obtainCredential;
102
102
  const handleObtainCredentialError = e => {
@@ -109,8 +109,9 @@ const handleObtainCredentialError = e => {
109
109
  if (e.statusCode === 201) {
110
110
  throw new _errors.CredentialIssuingNotSynchronousError("This credential cannot be issued synchronously. It will be available at a later time.", e.message);
111
111
  }
112
- if (e.statusCode === 404) {
113
- throw new _errors.CredentialNotEntitledError("Invalid status found for the given credential", e.message);
112
+ if ([403, 404].includes(e.statusCode)) {
113
+ const maybeError = _types.CredentialIssuanceFailureResponse.safeParse((0, _misc.safeJsonParse)(e.responseBody));
114
+ throw new _errors.CredentialInvalidStatusError("Invalid status found for the given credential", maybeError.success ? maybeError.data.error : "unknown", e.message);
114
115
  }
115
116
  throw new _errors.CredentialRequestError(`Unable to obtain the requested credential [response status code: ${e.statusCode}]`, e.message);
116
117
  };
@@ -1 +1 @@
1
- {"version":3,"names":["_ioReactNativeJwt","require","_misc","_errors","_types","_dpop","_reactNativeUuid","_interopRequireDefault","obj","__esModule","default","createNonceProof","nonce","issuer","audience","ctx","jwk","getPublicKey","SignJWT","setPayload","setProtectedHeader","typ","setAudience","setIssuer","setIssuedAt","setExpirationTime","sign","exports","obtainCredential","issuerConf","accessToken","clientId","credentialDefinition","context","credentialCryptoContext","appFetch","fetch","dPopCryptoContext","credentialUrl","openid_credential_issuer","credential_endpoint","signedNonceProof","c_nonce","constainsCredentialDefinition","authorization_details","some","c","credential_configuration_id","format","type","ValidationFailed","credentialRequestFormBody","credential_definition","proof","jwt","proof_type","tokenRequestSignedDPop","createDPopToken","htm","htu","jti","uuid","v4","ath","sha256ToBase64","access_token","credentialRes","method","headers","DPoP","Authorization","token_type","body","JSON","stringify","then","hasStatus","res","json","CredentialResponse","safeParse","catch","handleObtainCredentialError","success","error","message","data","e","UnexpectedStatusCodeError","statusCode","CredentialIssuingNotSynchronousError","CredentialNotEntitledError","CredentialRequestError"],"sourceRoot":"../../../../src","sources":["credential/issuance/06-obtain-credential.ts"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AAOA,IAAAC,KAAA,GAAAD,OAAA;AAEA,IAAAE,OAAA,GAAAF,OAAA;AAOA,IAAAG,MAAA,GAAAH,OAAA;AAEA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,gBAAA,GAAAC,sBAAA,CAAAN,OAAA;AAAqC,SAAAM,uBAAAC,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAc9B,MAAMG,gBAAgB,GAAG,MAAAA,CAC9BC,KAAa,EACbC,MAAc,EACdC,QAAgB,EAChBC,GAAkB,KACE;EACpB,MAAMC,GAAG,GAAG,MAAMD,GAAG,CAACE,YAAY,CAAC,CAAC;EACpC,OAAO,IAAIC,yBAAO,CAACH,GAAG,CAAC,CACpBI,UAAU,CAAC;IACVP;EACF,CAAC,CAAC,CACDQ,kBAAkB,CAAC;IAClBC,GAAG,EAAE,sBAAsB;IAC3BL;EACF,CAAC,CAAC,CACDM,WAAW,CAACR,QAAQ,CAAC,CACrBS,SAAS,CAACV,MAAM,CAAC,CACjBW,WAAW,CAAC,CAAC,CACbC,iBAAiB,CAAC,MAAM,CAAC,CACzBC,IAAI,CAAC,CAAC;AACX,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAfAC,OAAA,CAAAhB,gBAAA,GAAAA,gBAAA;AAgBO,MAAMiB,gBAAkC,GAAG,MAAAA,CAChDC,UAAU,EACVC,WAAW,EACXC,QAAQ,EACRC,oBAAoB,EACpBC,OAAO,KACJ;EACH,MAAM;IACJC,uBAAuB;IACvBC,QAAQ,GAAGC,KAAK;IAChBC;EACF,CAAC,GAAGJ,OAAO;EAEX,MAAMK,aAAa,GAAGT,UAAU,CAACU,wBAAwB,CA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YAAa;IACvE,CAAC;IACDO,IAAI,EAAEC,IAAI,CAACC,SAAS,CAACvB,yBAAyB;EAChD,CAAC,CAAC,CACCwB,IAAI,CAAC,IAAAC,eAAS,EAAC,GAAG,CAAC,CAAC,CACpBD,IAAI,CAAEE,GAAG,IAAKA,GAAG,CAACC,IAAI,CAAC,CAAC,CAAC,CACzBH,IAAI,CAAEH,IAAI,IAAKO,yBAAkB,CAACC,SAAS,CAACR,IAAI,CAAC,CAAC,CAClDS,KAAK,CAACC,2BAA2B,CAAC;EAErC,IAAI,CAAChB,aAAa,CAACiB,OAAO,EAAE;IAC1B,MAAM,IAAIjC,wBAAgB,CAACgB,aAAa,CAACkB,KAAK,CAACC,OAAO,CAAC;EACzD;EAEA,OAAOnB,aAAa,CAACoB,IAAI;AAC3B,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AANA3D,OAAA,CAAAC,gBAAA,GAAAA,gBAAA;AAOA,MAAMsD,2BAA2B,GAAIK,CAAU,IAAK;EAClD,IAAI,EAAEA,CAAC,YAAYC,iCAAyB,CAAC,EAAE;IAC7C,MAAMD,CAAC;EACT;;EAEA;EACA;EACA,IAAIA,CAAC,CAACE,UAAU,KAAK,GAAG,EAAE;IACxB,MAAM,IAAIC,4CAAoC,CAC5C,uFAAuF,EACvFH,CAAC,CAACF,OACJ,CAAC;EACH;EAEA,IAAIE,CAAC,CAACE,UAAU,KAAK,GAAG,EAAE;IACxB,MAAM,IAAIE,kCAA0B,CAClC,+CAA+C,EAC/CJ,CAAC,CAACF,OACJ,CAAC;EACH;EAEA,MAAM,IAAIO,8BAAsB,CAC7B,oEAAmEL,CAAC,CAACE,UAAW,GAAE,EACnFF,CAAC,CAACF,OACJ,CAAC;AACH,CAAC"}
1
+ {"version":3,"names":["_ioReactNativeJwt","require","_misc","_errors","_types","_dpop","_reactNativeUuid","_interopRequireDefault","obj","__esModule","default","createNonceProof","nonce","issuer","audience","ctx","jwk","getPublicKey","SignJWT","setPayload","setProtectedHeader","typ","setAudience","setIssuer","setIssuedAt","setExpirationTime","sign","exports","obtainCredential","issuerConf","accessToken","clientId","credentialDefinition","context","credentialCryptoContext","appFetch","fetch","dPopCryptoContext","credentialUrl","openid_credential_issuer","credential_endpoint","signedNonceProof","c_nonce","constainsCredentialDefinition","authorization_details","some","c","credential_configuration_id","format","type","ValidationFailed","credentialRequestFormBody","credential_definition","proof","jwt","proof_type","tokenRequestSignedDPop","createDPopToken","htm","htu","jti","uuid","v4","ath","sha256ToBase64","access_token","credentialRes","method","headers","DPoP","Authorization","token_type","body","JSON","stringify","then","hasStatus","res","json","CredentialResponse","safeParse","catch","handleObtainCredentialError","success","error","message","data","e","UnexpectedStatusCodeError","statusCode","CredentialIssuingNotSynchronousError","includes","maybeError","CredentialIssuanceFailureResponse","safeJsonParse","responseBody","CredentialInvalidStatusError","CredentialRequestError"],"sourceRoot":"../../../../src","sources":["credential/issuance/06-obtain-credential.ts"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AAOA,IAAAC,KAAA,GAAAD,OAAA;AAEA,IAAAE,OAAA,GAAAF,OAAA;AAOA,IAAAG,MAAA,GAAAH,OAAA;AAEA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,gBAAA,GAAAC,sBAAA,CAAAN,OAAA;AAAqC,SAAAM,uBAAAC,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAc9B,MAAMG,gBAAgB,GAAG,MAAAA,CAC9BC,KAAa,EACbC,MAAc,EACdC,QAAgB,EAChBC,GAAkB,KACE;EACpB,MAAMC,GAAG,GAAG,MAAMD,GAAG,CAACE,YAAY,CAAC,CAAC;EACpC,OAAO,IAAIC,yBAAO,CAACH,GAAG,CAAC,CACpBI,UAAU,CAAC;IACVP;EACF,CAAC,CAAC,CACDQ,kBAAkB,CAAC;IAClBC,GAAG,EAAE,sBAAsB;IAC3BL;EACF,CAAC,CAAC,CACD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IAAIA,CAAC,CAACE,UAAU,KAAK,GAAG,EAAE;IACxB,MAAM,IAAIC,4CAAoC,CAC5C,uFAAuF,EACvFH,CAAC,CAACF,OACJ,CAAC;EACH;EAEA,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,CAACM,QAAQ,CAACJ,CAAC,CAACE,UAAU,CAAC,EAAE;IACrC,MAAMG,UAAU,GAAGC,wCAAiC,CAACb,SAAS,CAC5D,IAAAc,mBAAa,EAACP,CAAC,CAACQ,YAAY,CAC9B,CAAC;IACD,MAAM,IAAIC,oCAA4B,CACpC,+CAA+C,EAC/CJ,UAAU,CAACT,OAAO,GAAGS,UAAU,CAACN,IAAI,CAACF,KAAK,GAAG,SAAS,EACtDG,CAAC,CAACF,OACJ,CAAC;EACH;EAEA,MAAM,IAAIY,8BAAsB,CAC7B,oEAAmEV,CAAC,CAACE,UAAW,GAAE,EACnFF,CAAC,CAACF,OACJ,CAAC;AACH,CAAC"}
@@ -43,14 +43,16 @@ graph TD;
43
43
 
44
44
  A `201 Created` response is returned by the credential issuer when the request has been queued because the credential cannot be issued synchronously. The consumer should try to obtain the credential at a later time.
45
45
 
46
- ### 404 Not Found (CredentialNotEntitledError)
46
+ Although `201 Created` is not considered an error, it is mapped as an error in this context in order to handle the case where the credential issuance is not synchronous.
47
+ This allows keeping the flow consistent and handle the case where the credential is not immediately available.
47
48
 
48
- A `404 Not Found` response is returned by the credential issuer when the authenticated user is not entitled to receive the requested credential.
49
+ ### 403 Forbidden (CredentialInvalidStatusError)
49
50
 
50
- ### 201 Created (CredentialIssuingNotSynchronousError)
51
+ A `403 Forbidden` response is returned by the credential issuer when the requested credential has an invalid status. It might contain more details in the `errorCode` property.
51
52
 
52
- Although `201 Created` is not considered an error, it is mapped as an error in this context in order to handle the case where the credential issuance is not synchronous.
53
- This allows keeping the flow consistent and handle the case where the credential is not immediately available.
53
+ ### 404 Not Found (CredentialInvalidStatusError)
54
+
55
+ A `404 Not Found` response is returned by the credential issuer when the authenticated user is not entitled to receive the requested credential. It might contain more details in the `errorCode` property.
54
56
 
55
57
  ## Strong authentication for eID issuance (Query Mode)
56
58
 
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.TokenResponse = exports.ResponseUriResultShape = exports.CredentialResponse = void 0;
6
+ exports.TokenResponse = exports.ResponseUriResultShape = exports.CredentialResponse = exports.CredentialIssuanceFailureResponse = void 0;
7
7
  var _par = require("../../utils/par");
8
8
  var z = _interopRequireWildcard(require("zod"));
9
9
  var _const = require("./const");
@@ -33,4 +33,8 @@ const ResponseUriResultShape = z.object({
33
33
  redirect_uri: z.string()
34
34
  });
35
35
  exports.ResponseUriResultShape = ResponseUriResultShape;
36
+ const CredentialIssuanceFailureResponse = z.object({
37
+ error: z.string()
38
+ });
39
+ exports.CredentialIssuanceFailureResponse = CredentialIssuanceFailureResponse;
36
40
  //# sourceMappingURL=types.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_par","require","z","_interopRequireWildcard","_const","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","TokenResponse","object","access_token","string","authorization_details","array","AuthorizationDetail","c_nonce","c_nonce_expires_in","number","expires_in","token_type","exports","CredentialResponse","credential","format","SupportedCredentialFormat","ResponseUriResultShape","redirect_uri"],"sourceRoot":"../../../../src","sources":["credential/issuance/types.ts"],"mappings":";;;;;;AAAA,IAAAA,IAAA,GAAAC,OAAA;AACA,IAAAC,CAAA,GAAAC,uBAAA,CAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AAAoD,SAAAI,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gB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U,EAAEnC,CAAC,CAACkC,MAAM,CAAC,CAAC;EACtBE,UAAU,EAAEpC,CAAC,CAAC4B,MAAM,CAAC;AACvB,CAAC,CAAC;AAACS,OAAA,CAAAZ,aAAA,GAAAA,aAAA;AAII,MAAMa,kBAAkB,GAAGtC,CAAC,CAAC0B,MAAM,CAAC;EACzCM,OAAO,EAAEhC,CAAC,CAAC4B,MAAM,CAAC,CAAC;EACnBK,kBAAkB,EAAEjC,CAAC,CAACkC,MAAM,CAAC,CAAC;EAC9BK,UAAU,EAAEvC,CAAC,CAAC4B,MAAM,CAAC,CAAC;EACtBY,MAAM,EAAEC;AACV,CAAC,CAAC;;AAEF;AACA;AACA;AAFAJ,OAAA,CAAAC,kBAAA,GAAAA,kBAAA;AAGO,MAAMI,sBAAsB,GAAG1C,CAAC,CAAC0B,MAAM,CAAC;EAC7CiB,YAAY,EAAE3C,CAAC,CAAC4B,MAAM,CAAC;AACzB,CAAC,CAAC;AAACS,OAAA,CAAAK,sBAAA,GAAAA,sBAAA"}
1
+ {"version":3,"names":["_par","require","z","_interopRequireWildcard","_const","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","TokenResponse","object","access_token","string","authorization_details","array","AuthorizationDetail","c_nonce","c_nonce_expires_in","number","expires_in","token_type","exports","CredentialResponse","credential","format","SupportedCredentialFormat","ResponseUriResultShape","redirect_uri","CredentialIssuanceFailureResponse","error"],"sourceRoot":"../../../../src","sources":["credential/issuance/types.ts"],"mappings":";;;;;;AAAA,IAAAA,IAAA,GAAAC,OAAA;AACA,IAAAC,CAAA,GAAAC,uBAAA,CAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AAAoD,SAAAI,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OA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,kBAAkB,EAAEjC,CAAC,CAACkC,MAAM,CAAC,CAAC;EAC9BC,UAAU,EAAEnC,CAAC,CAACkC,MAAM,CAAC,CAAC;EACtBE,UAAU,EAAEpC,CAAC,CAAC4B,MAAM,CAAC;AACvB,CAAC,CAAC;AAACS,OAAA,CAAAZ,aAAA,GAAAA,aAAA;AAII,MAAMa,kBAAkB,GAAGtC,CAAC,CAAC0B,MAAM,CAAC;EACzCM,OAAO,EAAEhC,CAAC,CAAC4B,MAAM,CAAC,CAAC;EACnBK,kBAAkB,EAAEjC,CAAC,CAACkC,MAAM,CAAC,CAAC;EAC9BK,UAAU,EAAEvC,CAAC,CAAC4B,MAAM,CAAC,CAAC;EACtBY,MAAM,EAAEC;AACV,CAAC,CAAC;;AAEF;AACA;AACA;AAFAJ,OAAA,CAAAC,kBAAA,GAAAA,kBAAA;AAGO,MAAMI,sBAAsB,GAAG1C,CAAC,CAAC0B,MAAM,CAAC;EAC7CiB,YAAY,EAAE3C,CAAC,CAAC4B,MAAM,CAAC;AACzB,CAAC,CAAC;AAACS,OAAA,CAAAK,sBAAA,GAAAA,sBAAA;AAII,MAAME,iCAAiC,GAAG5C,CAAC,CAAC0B,MAAM,CAAC;EACxDmB,KAAK,EAAE7C,CAAC,CAAC4B,MAAM,CAAC;AAClB,CAAC,CAAC;AAACS,OAAA,CAAAO,iCAAA,GAAAA,iCAAA"}
@@ -17,7 +17,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
17
17
  * @param credential - The credential to be verified
18
18
  * @param credentialCryptoContext - The credential's crypto context
19
19
  * @param context.appFetch (optional) fetch api implementation. Default: built-in fetch
20
- * @throws {@link StatusAttestationInvalid} if the status attestation is invalid and thus the credential is not valid
20
+ * @throws {@link CredentialInvalidStatusError} if the status attestation is invalid and thus the credential is not valid
21
21
  * @throws {@link StatusAttestationError} if an error occurs during the status attestation
22
22
  * @returns The credential status attestation
23
23
  */
@@ -56,7 +56,7 @@ const statusAttestation = async function (issuerConf, credential, credentialCryp
56
56
  * If the error is not an instance of {@link UnexpectedStatusCodeError}, it is thrown as is.
57
57
  * @param e - The error to be handled
58
58
  * @throws {@link StatusAttestationError} if the status code is different from 404
59
- * @throws {@link StatusAttestationInvalid} if the status code is 404 (meaning the credential is invalid)
59
+ * @throws {@link CredentialInvalidStatusError} if the status code is 404 (meaning the credential is invalid)
60
60
  */
61
61
  exports.statusAttestation = statusAttestation;
62
62
  const handleStatusAttestationError = e => {
@@ -64,7 +64,8 @@ const handleStatusAttestationError = e => {
64
64
  throw e;
65
65
  }
66
66
  if (e.statusCode === 404) {
67
- throw new _errors.StatusAttestationInvalid("Invalid status found for the given credential", e.message);
67
+ const maybeError = _types.InvalidStatusAttestationResponse.safeParse((0, _misc.safeJsonParse)(e.responseBody));
68
+ throw new _errors.CredentialInvalidStatusError("Invalid status found for the given credential", maybeError.success ? maybeError.data.error : "unknown", e.message);
68
69
  }
69
70
  throw new _errors.StatusAttestationError(`Unable to obtain the status attestation for the given credential [response status code: ${e.statusCode}]`, e.message);
70
71
  };
@@ -1 +1 @@
1
- {"version":3,"names":["_misc","require","_ioReactNativeJwt","_reactNativeUuid","_interopRequireDefault","_types","_errors","obj","__esModule","default","statusAttestation","issuerConf","credential","credentialCryptoContext","appFetch","arguments","length","undefined","fetch","jwk","getPublicKey","credentialHash","getCredentialHashWithouDiscloures","statusAttUrl","openid_credential_issuer","status_attestation_endpoint","credentialPop","SignJWT","setPayload","aud","jti","uuid","v4","toString","credential_hash","credential_hash_alg","setProtectedHeader","alg","typ","kid","setIssuedAt","setExpirationTime","sign","body","credential_pop","result","method","headers","JSON","stringify","then","hasStatus","raw","json","StatusAttestationResponse","parse","catch","handleStatusAttestationError","status_attestation","exports","e","UnexpectedStatusCodeError","statusCode","StatusAttestationInvalid","message","StatusAttestationError"],"sourceRoot":"../../../../src","sources":["credential/status/02-status-attestation.ts"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAMA,IAAAC,iBAAA,GAA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E;IAC1CuB,MAAM,EAAE,MAAM;IACdC,OAAO,EAAE;MACP,cAAc,EAAE;IAClB,CAAC;IACDJ,IAAI,EAAEK,IAAI,CAACC,SAAS,CAACN,IAAI;EAC3B,CAAC,CAAC,CACCO,IAAI,CAAC,IAAAC,eAAS,EAAC,GAAG,CAAC,CAAC,CACpBD,IAAI,CAAEE,GAAG,IAAKA,GAAG,CAACC,IAAI,CAAC,CAAC,CAAC,CACzBH,IAAI,CAAEG,IAAI,IAAKC,gCAAyB,CAACC,KAAK,CAACF,IAAI,CAAC,CAAC,CACrDG,KAAK,CAACC,4BAA4B,CAAC;EAEtC,OAAO;IAAE/C,iBAAiB,EAAEmC,MAAM,CAACa;EAAmB,CAAC;AACzD,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AANAC,OAAA,CAAAjD,iBAAA,GAAAA,iBAAA;AAOA,MAAM+C,4BAA4B,GAAIG,CAAU,IAAK;EACnD,IAAI,EAAEA,CAAC,YAAYC,iCAAyB,CAAC,EAAE;IAC7C,MAAMD,CAAC;EACT;EAEA,IAAIA,CAAC,CAACE,UAAU,KAAK,GAAG,EAAE;IACxB,MAAM,IAAIC,gCAAwB,CAChC,+CAA+C,EAC/CH,CAAC,CAACI,OACJ,CAAC;EACH;EAEA,MAAM,IAAIC,8BAAsB,CAC7B,2FAA0FL,CAAC,CAACE,UAAW,GAAE,EAC1GF,CAAC,CAACI,OACJ,CAAC;AACH,CAAC"}
1
+ {"version":3,"names":["_misc","require","_ioReactNativeJwt","_reactNativeUuid","_interopRequireDefault","_types","_errors","obj","__esModule","default","statusAttestation","issuerConf","credential","credentialCryptoContext","appFetch","arguments","length","undefined","fetch","jwk","getPublicKey","credentialHash","getCredentialHashWithouDiscloures","statusAttUrl","openid_credential_issuer","status_attestation_endpoint","credentialPop","SignJWT","setPayload","aud","jti","uuid","v4","toString","credential_hash","credential_hash_alg","setProtectedHeader","alg","typ","kid","setIssuedAt","setExpirationTime","sign","body","credential_pop","result","method","headers","JSON","stringify","then","hasStatus","raw","json","StatusAttestationResponse","parse","catch","handleStatusAttestationError","status_attestation","exports","e","UnexpectedStatusCodeError","statusCode","maybeError","InvalidStatusAttestationResponse","safeParse","safeJsonParse","responseBody","CredentialInvalidStatusError","success","data","error","message","StatusAttestationError"],"sourceRoot":"../../../../src","sources":["credential/status/02-status-attestation.ts"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAOA,IAAAC,iBAAA,GAAAD,OAAA;AACA,IAAAE,gBAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AAIA,IAAAK,OAAA,GAAAL,OAAA;AAI4B,SAAAG,uBAAAG,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAW5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMG,iBAAoC,GAAG,eAAAA,CAClDC,UAAU,EACVC,UAAU,EACVC,uBAAuB,EAEpB;EAAA,IADHC,QAA8B,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAGG,KAAK;EAEtC,MAAMC,GAAG,GAAG,MAAMN,uBAAuB,CAACO,YAAY,CAAC,CAAC;EACxD,MAAMC,cAAc,GAAG,MAAM,IAAAC,uCAAiC,EAACV,UAAU,CAAC;EAC1E,MAAMW,YAAY,GAChBZ,UAAU,CAACa,wBAAwB,CAACC,2BAA2B;EACjE,MAAMC,aAAa,GAAG,MAAM,IAAIC,yBAAO,CAACd,uBAAuB,CAAC,CAC7De,UAAU,CAAC;IACVC,GAAG,EAAEN,YAAY;IACjBO,GAAG,EAAEC,wBAAI,CAACC,EAAE,CAAC,CAAC,CAACC,QAAQ,CAAC,CAAC;IACzBC,eAAe,EAAEb,cAAc;IAC/Bc,mBAAmB,EAAE;EACvB,CAAC,CAAC,CACDC,kBAAkB,CAAC;IAClB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C,CAACY,OACJ,CAAC;EACH;EAEA,MAAM,IAAIC,8BAAsB,CAC7B,2FAA0Fb,CAAC,CAACE,UAAW,GAAE,EAC1GF,CAAC,CAACY,OACJ,CAAC;AACH,CAAC"}
@@ -18,7 +18,7 @@ graph TD;
18
18
 
19
19
  ## Mapped results
20
20
 
21
- ### 404 Not Found (StatusAttestationInvalid)
21
+ ### 404 Not Found (CredentialInvalidStatusError)
22
22
 
23
23
  A `404 Not Found` response is returned by the credential issuer when the status attestation is invalid.
24
24
 
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.StatusAttestationResponse = exports.ParsedStatusAttestation = void 0;
6
+ exports.StatusAttestationResponse = exports.ParsedStatusAttestation = exports.InvalidStatusAttestationResponse = void 0;
7
7
  var _types = require("../../sd-jwt/types");
8
8
  var _jwk = require("../../utils/jwk");
9
9
  var z = _interopRequireWildcard(require("zod"));
@@ -44,5 +44,18 @@ const ParsedStatusAttestation = z.object({
44
44
  iat: _types.UnixTime
45
45
  })
46
46
  });
47
+
48
+ /**
49
+ * Shape from parsing a status attestation response in case of error.
50
+ */
47
51
  exports.ParsedStatusAttestation = ParsedStatusAttestation;
52
+ const InvalidStatusAttestationResponse = z.object({
53
+ error: z.string()
54
+ });
55
+
56
+ /**
57
+ * Type from parsing a status attestation response in case of error.
58
+ * Inferred from {@link InvalidStatusAttestationResponse}.
59
+ */
60
+ exports.InvalidStatusAttestationResponse = InvalidStatusAttestationResponse;
48
61
  //# sourceMappingURL=types.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_types","require","_jwk","z","_interopRequireWildcard","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","StatusAttestationResponse","object","status_attestation","string","exports","ParsedStatusAttestation","header","typ","literal","alg","kid","optional","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AA,IAAAA,KAAA,CAAAa,GAAA,CAAAhB,GAAA,EAAAM,MAAA,YAAAA,MAAA;AAEzB;AACA;AACA;AACO,MAAMW,yBAAyB,GAAGxB,CAAC,CAACyB,MAAM,CAAC;EAChDC,kBAAkB,EAAE1B,CAAC,CAAC2B,MAAM,CAAC;AAC/B,CAAC,CAAC;;AAEF;AACA;AACA;AACA;;AAKA;AACA;AACA;AAFAC,OAAA,CAAAJ,yBAAA,GAAAA,yBAAA;AAKA;AACA;AACA;AACO,MAAMK,uBAAuB,GAAG7B,CAAC,CAACyB,MAAM,CAAC;EAC9CK,MAAM,EAAE9B,CAAC,CAACyB,MAAM,CAAC;IACfM,GAAG,EAAE/B,CAAC,CAACgC,OAAO,CAAC,wBAAwB,CAAC;IACxCC,GAAG,EAAEjC,CAAC,CAAC2B,MAAM,CAAC,CAAC;IACfO,GAAG,EAAElC,CAAC,CAAC2B,MAAM,CAAC,CAAC,CAACQ,QAAQ,CAAC;EAC3B,CAAC,CAAC;EACFC,OAAO,EAAEpC,CAAC,CAACyB,MAAM,CAAC;IAChBY,mBAAmB,EAAErC,CAAC,CAAC2B,MAAM,CAAC,CAAC;IAC/BW,eAAe,EAAEtC,CAAC,CAAC2B,MAAM,CAAC,CAAC;IAC3BY,GAAG,EAAEvC,CAAC,CAACyB,MAAM,CAAC;MACZe,GAAG,EAAEC;IACP,CAAC,CAAC;IACFC,GAAG,EAAEC,eAAQ;IACbC,GAAG,EAAED;EACP,CAAC;AACH,CAAC,CAAC;AAACf,OAAA,CAAAC,uBAAA,GAAAA,uBAAA"}
1
+ {"version":3,"names":["_types","require","_jwk","z","_interopRequireWildcard","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","StatusAttestationResponse","object","status_attestation","string","exports","ParsedStatusAttestation","header","typ","literal","alg","kid","optional","payload","credential_hash_alg","credential_hash","cnf","jwk","JWK","exp","UnixTime","iat","InvalidStatusAttestationResponse","error"],"sourceRoot":"../../../../src","sources":["credential/status/types.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,IAAA,GAAAD,OAAA;AACA,IAAAE,CAAA,GAAAC,uBAAA,CAAAH,OAAA;AAAyB,SAAAI,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAF,wBAAAM,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAG,KAAA,GAAAR,wBAAA,CAAAC,WAAA,OAAAO,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAJ,GAAA,YAAAG,KAAA,CAAAE,GAAA,CAAAL,GAAA,SAAAM,MAAA,WAAAC,qBAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,GAAA,IAAAX,GAAA,QAAAW,GAAA,kBAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAd,GAAA,EAAAW,GAAA,SAAAI,IAAA,GAAAR,qBAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAV,GAAA,EAAAW,GAAA,cAAAI,IAAA,KAAAA,IAAA,CAAAV,GAAA,IAAAU,IAAA,CAAAC,GAAA,KAAAR,MAAA,CAAAC,cAAA,CAAAH,MAAA,EAAAK,GAAA,EAAAI,IAAA,YAAAT,MAAA,CAAAK,GAAA,IAAAX,GAAA,CAAAW,GAAA,SAAAL,MAAA,CAAAJ,OAAA,GAAA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= require("@pagopa/io-react-native-jwt");
14
14
  var _types = require("./types");
15
15
  var _verifier = require("./verifier");
16
16
  var _errors = require("../utils/errors");
17
+ var _jsBase = require("js-base64");
17
18
  const decodeDisclosure = encoded => {
18
- const decoded = _types.Disclosure.parse(JSON.parse((0, _ioReactNativeJwt.decodeBase64)(encoded)));
19
+ const utf8String = _jsBase.Base64.decode(encoded); // Decode Base64 into UTF-8 string
20
+ const decoded = _types.Disclosure.parse(JSON.parse(utf8String));
19
21
  return {
20
22
  decoded,
21
23
  encoded
@@ -1 +1 @@
1
- {"version":3,"names":["_ioReactNativeJwt","require","_types","_verifier","_errors","decodeDisclosure","encoded","decoded","Disclosure","parse","JSON","decodeBase64","decode","token","customSchema","slice","rawSdJwt","rawDisclosures","split","decodedJwt","decodeJwt","parser","SdJwt4VC","sdJwt","header","protectedHeader","payload","disclosures","map","exports","disclose","claims","paths","Promise","all","claim","disclosure","find","_ref","name","ClaimsNotFoundBetweenDislosures","hash","sha256ToBase64","_sd","includes","index","indexOf","path","ClaimsNotFoundInToken","filteredDisclosures","filter","d","disclosedToken","join","verify","publicKey","verifyJwt","verifyDisclosure"],"sourceRoot":"../../../src","sources":["sd-jwt/index.ts"],"mappings":";;;;;;;;;;;;AAEA,IAAAA,iBAAA,GAAAC,OAAA;AAKA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AAEA,IAAAG,OAAA,GAAAH,OAAA;AAKA,MAAMI,gBAAgB,GAAIC,OAAe,IAA4B;EACnE,MAAMC,OAAO,GAAGC,iBAAU,CAACC,KAAK,CAACC,IAAI,CAACD,KAAK,CAAC,IAAAE,8BAAY,EAACL,OAAO,CAAC,CAAC,CAAC;EACnE,OAAO;IAAEC,OAAO;IAAED;EAAQ,CAAC;AAC7B,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMM,MAAM,GAAGA,CACpBC,KAAa,EACbC,YAA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,CAACE,QAAQ,GAAG,EAAE,CAAC,GAAGH,KAAK,CAACK,KAAK,CAAC,GAAG,CAAC;EACxC,MAAMX,OAAO,GAAGK,MAAM,CAACC,KAAK,EAAEC,YAAY,CAAC;;EAE3C;EACA,MAAM,IAAA0C,wBAAS,EAACxC,QAAQ,EAAEuC,SAAS,CAAC;;EAEpC;EACA,MAAMxB,MAAM,GAAG,CAAC,GAAGxB,OAAO,CAACgB,KAAK,CAACG,OAAO,CAACiB,GAAG,CAAC;EAE7C,MAAMV,OAAO,CAACC,GAAG,CACf3B,OAAO,CAACoB,WAAW,CAACC,GAAG,CACrB,MAAOQ,UAAU,IAAK,MAAM,IAAAqB,0BAAgB,EAACrB,UAAU,EAAEL,MAAM,CACjE,CACF,CAAC;EAED,OAAO;IACLR,KAAK,EAAEhB,OAAO,CAACgB,KAAK;IACpBI,WAAW,EAAEpB,OAAO,CAACoB,WAAW,CAACC,GAAG,CAAEuB,CAAC,IAAKA,CAAC,CAAC5C,OAAO;EACvD,CAAC;AACH,CAAC;AAACsB,OAAA,CAAAyB,MAAA,GAAAA,MAAA"}
1
+ {"version":3,"names":["_ioReactNativeJwt","require","_types","_verifier","_errors","_jsBase","decodeDisclosure","encoded","utf8String","Base64","decode","decoded","Disclosure","parse","JSON","token","customSchema","slice","rawSdJwt","rawDisclosures","split","decodedJwt","decodeJwt","parser","SdJwt4VC","sdJwt","header","protectedHeader","payload","disclosures","map","exports","disclose","claims","paths","Promise","all","claim","disclosure","find","_ref","name","ClaimsNotFoundBetweenDislosures","hash","sha256ToBase64","_sd","includes","index","indexOf","path","ClaimsNotFoundInToken","filteredDisclosures","filter","d","disclosedToken","join","verify","publicKey","verifyJwt","verifyDisclosure"],"sourceRoot":"../../../src","sources":["sd-jwt/index.ts"],"mappings":";;;;;;;;;;;;AAEA,IAAAA,iBAAA,GAAAC,OAAA;AAGA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AAEA,IAAAG,OAAA,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ACL,IAAI,CAAC;EAC9B,CAAC,CAAC;;EAEF;EACA,MAAMa,cAAc,GAAG,CAACpC,QAAQ,EAAE,GAAGiC,mBAAmB,CAAC,CAACI,IAAI,CAAC,GAAG,CAAC;EAEnE,OAAO;IAAExC,KAAK,EAAEuC,cAAc;IAAEpB;EAAM,CAAC;AACzC,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAfAH,OAAA,CAAAC,QAAA,GAAAA,QAAA;AAgBO,MAAMwB,MAAM,GAAG,MAAAA,CACpBzC,KAAa,EACb0C,SAAsB,EACtBzC,YAAgB,KAC8C;EAC9D;EACA,MAAM,CAACE,QAAQ,GAAG,EAAE,CAAC,GAAGH,KAAK,CAACK,KAAK,CAAC,GAAG,CAAC;EACxC,MAAMT,OAAO,GAAGD,MAAM,CAACK,KAAK,EAAEC,YAAY,CAAC;;EAE3C;EACA,MAAM,IAAA0C,wBAAS,EAACxC,QAAQ,EAAEuC,SAAS,CAAC;;EAEpC;EACA,MAAMxB,MAAM,GAAG,CAAC,GAAGtB,OAAO,CAACc,KAAK,CAACG,OAAO,CAACiB,GAAG,CAAC;EAE7C,MAAMV,OAAO,CAACC,GAAG,CACfzB,OAAO,CAACkB,WAAW,CAACC,GAAG,CACrB,MAAOQ,UAAU,IAAK,MAAM,IAAAqB,0BAAgB,EAACrB,UAAU,EAAEL,MAAM,CACjE,CACF,CAAC;EAED,OAAO;IACLR,KAAK,EAAEd,OAAO,CAACc,KAAK;IACpBI,WAAW,EAAElB,OAAO,CAACkB,WAAW,CAACC,GAAG,CAAEuB,CAAC,IAAKA,CAAC,CAAC1C,OAAO;EACvD,CAAC;AACH,CAAC;AAACoB,OAAA,CAAAyB,MAAA,GAAAA,MAAA"}
@@ -58,6 +58,13 @@ const ClaimsMetadata = z.record(z.object({
58
58
  locale: z.string()
59
59
  }))
60
60
  }));
61
+ const IssuanceErrorSupported = z.object({
62
+ display: z.array(z.object({
63
+ title: z.string(),
64
+ description: z.string(),
65
+ locale: z.string()
66
+ }))
67
+ });
61
68
 
62
69
  // Metadata for a credentia which is supported by a Issuer
63
70
 
@@ -69,7 +76,8 @@ const SupportedCredentialMetadata = z.object({
69
76
  // TODO [SIW-1268]: should not be optional
70
77
  cryptographic_binding_methods_supported: z.array(z.string()),
71
78
  credential_signing_alg_values_supported: z.array(z.string()),
72
- authentic_source: z.string().optional()
79
+ authentic_source: z.string().optional(),
80
+ issuance_errors_supported: z.record(IssuanceErrorSupported).optional()
73
81
  });
74
82
  const EntityStatement = z.object({
75
83
  header: z.object({
@@ -1 +1 @@
1
- {"version":3,"names":["_types","require","_jwk","z","_interopRequireWildcard","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","TrustMark","object","id","string","trust_mark","exports","RelyingPartyMetadata","application_type","optional","client_id","client_name","jwks","keys","array","JWK","contacts","CredentialDisplayMetadata","name","locale","logo","url","alt_text","background_color","text_color","CredentialIssuerDisplayMetadata","ClaimsMetadata","record","value_type","display","SupportedCredentialMetadata","format","union","literal","scope","claims","cryptographic_binding_methods_supported","credential_signing_alg_values_supported","authentic_source","EntityStatement","header","typ","alg","kid","payload","iss","sub","trust_marks","iat","number","exp","EntityConfigurationHeader","FederationEntityMetadata","federation_fetch_endpoint","federation_list_endpoint","federation_resolve_endpoint","federation_trust_mark_status_endpoint","federation_trust_mark_list_endpoint","organization_name","homepage_uri","policy_uri","logo_uri","passthrough","BaseEntityConfiguration","UnixTime","authority_hints","metadata","federation_entity","TrustAnchorEntityConfiguration","CredentialIssuerEntityConfiguration","and","openid_credential_issuer","credential_issuer","credential_endpoint","revocation_endpoint","status_attestation_endpoint","credential_configurations_supported","oauth_authorization_server","authorization_endpoint","pushed_authorization_request_endpoint","dpop_signing_alg_values_supported","token_endpoint","introspection_endpoint","client_registration_types_supported","code_challenge_methods_supported","authorization_details_types_supported","acr_values_supported","grant_types_supported","issuer","scopes_supported","request_parameter_supported","boolean","request_uri_parameter_supported","response_types_supported","response_modes_supported","subject_types_supported","token_endpoint_auth_methods_supported","token_endpoint_auth_signing_alg_values_supported","request_object_signing_alg_values_supported","wallet_relying_party","RelyingPartyEntityConfiguration","WalletProviderEntityConfiguration","wallet_provider","aal_values_supported","EntityConfiguration","description"],"sourceRoot":"../../../src","sources":["trust/types.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,IAAA,GAAAD,OAAA;AACA,IAAAE,CAAA,GAAAC,uBAAA,CAAAH,OAAA;AAAyB,SAAAI,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAF,wBAAAM,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAG,KAAA,GAAAR,wBAAA,CAAAC,WAAA,OAAAO,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAJ,GAAA,YAAAG,KAAA,CAAAE,GAAA,CAAAL,GAAA,SAAAM,MAAA,WAAAC,qBAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,GAAA,IAAAX,GAAA,QAAAW,GAAA,kBAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAd,GAAA,EAAAW,GAAA,SAAAI,IAAA,GAAAR,qBAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAV,GAAA,EAAAW,GAAA,cAAAI,IA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CAAC;UAAEW,IAAI,EAAEpC,CAAC,CAACqC,KAAK,CAACC,QAAG;QAAE,CAAC;MACvC,CAAC,CAAC,CACD+C,WAAW,CAAC;IACjB,CAAC;EACH,CAAC;AACH,CAAC,CACH,CAAC;;AAED;AAAAxD,OAAA,CAAA+F,iCAAA,GAAAA,iCAAA;AAEO,MAAMG,mBAAmB,GAAG/H,CAAC,CAACuD,KAAK,CACxC,CACEqE,iCAAiC,EACjChC,mCAAmC,EACnCD,8BAA8B,EAC9BgC,+BAA+B,CAChC,EACD;EACEK,WAAW,EAAE;AACf,CACF,CAAC;AAACnG,OAAA,CAAAkG,mBAAA,GAAAA,mBAAA"}
1
+ {"version":3,"names":["_types","require","_jwk","z","_interopRequireWildcard","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","TrustMark","object","id","string","trust_mark","exports","RelyingPartyMetadata","application_type","optional","client_id","client_name","jwks","keys","array","JWK","contacts","CredentialDisplayMetadata","name","locale","logo","url","alt_text","background_color","text_color","CredentialIssuerDisplayMetadata","ClaimsMetadata","record","value_type","display","IssuanceErrorSupported","title","description","SupportedCredentialMetadata","format","union","literal","scope","claims","cryptographic_binding_methods_supported","credential_signing_alg_values_supported","authentic_source","issuance_errors_supported","EntityStatement","header","typ","alg","kid","payload","iss","sub","trust_marks","iat","number","exp","EntityConfigurationHeader","FederationEntityMetadata","federation_fetch_endpoint","federation_list_endpoint","federation_resolve_endpoint","federation_trust_mark_status_endpoint","federation_trust_mark_list_endpoint","organization_name","homepage_uri","policy_uri","logo_uri","passthrough","BaseEntityConfiguration","UnixTime","authority_hints","metadata","federation_entity","TrustAnchorEntityConfiguration","CredentialIssuerEntityConfiguration","and","openid_credential_issuer","credential_issuer","credential_endpoint","revocation_endpoint","status_attestation_endpoint","credential_configurations_supported","oauth_authorization_server","authorization_endpoint","pushed_authorization_request_endpoint","dpop_signing_alg_values_supported","token_endpoint","introspection_endpoint","client_registration_types_supported","code_challenge_methods_supported","authorization_details_types_supported","acr_values_supported","grant_types_supported","issuer","scopes_supported","request_parameter_supported","boolean","request_uri_parameter_supported","response_types_supported","response_modes_supported","subject_types_supported","token_endpoint_auth_methods_supported","token_endpoint_auth_signing_alg_values_supported","request_object_signing_alg_values_supported","wallet_relying_party","RelyingPartyEntityConfiguration","WalletProviderEntityConfiguration","wallet_provider","aal_values_supported","EntityConfiguration"],"sourceRoot":"../../../src","sources":["trust/types.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,IAAA,GAAAD,OAAA;AACA,IAAAE,CAAA,GAAAC,uBAAA,CAAAH,OAAA;AAAyB,SAAAI,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAF,wBAAAM,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAG,KAAA,GAAAR,wBAAA,CAAAC,WAAA,OAAAO,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAJ,GAAA,YAAAG,KAAA,CAAAE,GAAA,CAAAL,GAAA,SAAAM,MAAA,WAAAC,qBAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,GAAA,IAAAX,GAAA,QAAAW,GAAA,kBAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAd,GAAA,EAAAW,GAAA,SAAAI,IAAA,GAAAR,qBAAA,GAAAC,MAAA,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AAc,EAAE5G,CAAC,CAAC2B,MAAM,CAAC,CAAC;QAC1BuG,oBAAoB,EAAElI,CAAC,CAACqC,KAAK,CAACrC,CAAC,CAAC2B,MAAM,CAAC,CAAC,CAAC,CAACK,QAAQ,CAAC,CAAC;QACpDkF,qBAAqB,EAAElH,CAAC,CAACqC,KAAK,CAACrC,CAAC,CAAC2B,MAAM,CAAC,CAAC,CAAC;QAC1CgG,qCAAqC,EAAE3H,CAAC,CAACqC,KAAK,CAACrC,CAAC,CAAC2B,MAAM,CAAC,CAAC,CAAC;QAC1DiG,gDAAgD,EAAE5H,CAAC,CAACqC,KAAK,CACvDrC,CAAC,CAAC2B,MAAM,CAAC,CACX,CAAC;QACDQ,IAAI,EAAEnC,CAAC,CAACyB,MAAM,CAAC;UAAEW,IAAI,EAAEpC,CAAC,CAACqC,KAAK,CAACC,QAAG;QAAE,CAAC;MACvC,CAAC,CAAC,CACDmD,WAAW,CAAC;IACjB,CAAC;EACH,CAAC;AACH,CAAC,CACH,CAAC;;AAED;AAAA5D,OAAA,CAAAmG,iCAAA,GAAAA,iCAAA;AAEO,MAAMG,mBAAmB,GAAGnI,CAAC,CAAC0D,KAAK,CACxC,CACEsE,iCAAiC,EACjChC,mCAAmC,EACnCD,8BAA8B,EAC9BgC,+BAA+B,CAChC,EACD;EACExE,WAAW,EAAE;AACf,CACF,CAAC;AAAC1B,OAAA,CAAAsG,mBAAA,GAAAA,mBAAA"}
@@ -3,7 +3,9 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.serializeAttrs = exports.WalletProviderResponseError = exports.WalletInstanceRevokedError = exports.WalletInstanceNotFoundError = exports.WalletInstanceIntegrityFailedError = exports.WalletInstanceCreationIntegrityError = exports.WalletInstanceCreationError = exports.WalletInstanceAttestationIssuingError = exports.ValidationFailed = exports.UnexpectedStatusCodeError = exports.StatusAttestationInvalid = exports.StatusAttestationError = exports.PidMetadataError = exports.PidIssuingError = exports.OperationAbortedError = exports.NoSuitableKeysFoundInEntityConfiguration = exports.IoWalletError = exports.CredentialRequestError = exports.CredentialNotEntitledError = exports.CredentialIssuingNotSynchronousError = exports.ClaimsNotFoundInToken = exports.ClaimsNotFoundBetweenDislosures = exports.AuthorizationIdpError = exports.AuthorizationError = exports.AuthRequestDecodeError = void 0;
6
+ exports.WalletProviderResponseError = exports.WalletInstanceRevokedError = exports.WalletInstanceNotFoundError = exports.WalletInstanceIntegrityFailedError = exports.WalletInstanceCreationIntegrityError = exports.WalletInstanceCreationError = exports.WalletInstanceAttestationIssuingError = exports.ValidationFailed = exports.UnexpectedStatusCodeError = exports.StatusAttestationError = exports.PidMetadataError = exports.PidIssuingError = exports.OperationAbortedError = exports.NoSuitableKeysFoundInEntityConfiguration = exports.IoWalletError = exports.CredentialRequestError = exports.CredentialIssuingNotSynchronousError = exports.CredentialInvalidStatusError = exports.ClaimsNotFoundInToken = exports.ClaimsNotFoundBetweenDislosures = exports.AuthorizationIdpError = exports.AuthorizationError = exports.AuthRequestDecodeError = void 0;
7
+ exports.extractErrorMessageFromIssuerConf = extractErrorMessageFromIssuerConf;
8
+ exports.serializeAttrs = void 0;
7
9
  /**
8
10
  * utility to format a set of attributes into an error message string
9
11
  *
@@ -60,12 +62,15 @@ class UnexpectedStatusCodeError extends IoWalletError {
60
62
 
61
63
  /** HTTP status code */
62
64
 
63
- constructor(message, statusCode) {
65
+ /** The stringified response body, useful to process the error response */
66
+
67
+ constructor(message, statusCode, responseBody) {
64
68
  super(serializeAttrs({
65
69
  message,
66
70
  statusCode: statusCode.toString()
67
71
  }));
68
72
  this.statusCode = statusCode;
73
+ this.responseBody = responseBody;
69
74
  }
70
75
  }
71
76
  /**
@@ -448,20 +453,27 @@ class OperationAbortedError extends IoWalletError {
448
453
  }
449
454
 
450
455
  /**
451
- * Error subclass thrown when the status attestation for a credential is invalid.
456
+ * Error subclass thrown when a credential status is invalid, either during issuance or when requesting a status attestation.
452
457
  */
453
458
  exports.OperationAbortedError = OperationAbortedError;
454
- class StatusAttestationInvalid extends IoWalletError {
459
+ class CredentialInvalidStatusError extends IoWalletError {
455
460
  static get code() {
456
- return "ERR_STATUS_ATTESTATION_INVALID";
461
+ return "ERR_CREDENTIAL_INVALID_STATUS";
457
462
  }
458
- code = "ERR_STATUS_ATTESTATION_INVALID";
459
- constructor(message) {
460
- let reason = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "unspecified";
463
+ code = "ERR_CREDENTIAL_INVALID_STATUS";
464
+
465
+ /**
466
+ * The error code that should be mapped with one of the `issuance_errors_supported` in the EC.
467
+ */
468
+
469
+ constructor(message, errorCode) {
470
+ let reason = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "unspecified";
461
471
  super(serializeAttrs({
462
472
  message,
473
+ errorCode,
463
474
  reason
464
475
  }));
476
+ this.errorCode = errorCode;
465
477
  this.reason = reason;
466
478
  }
467
479
  }
@@ -469,7 +481,7 @@ class StatusAttestationInvalid extends IoWalletError {
469
481
  /**
470
482
  * Error subclass thrown when an error occurs while obtaining a status attestation for a credential.
471
483
  */
472
- exports.StatusAttestationInvalid = StatusAttestationInvalid;
484
+ exports.CredentialInvalidStatusError = CredentialInvalidStatusError;
473
485
  class StatusAttestationError extends IoWalletError {
474
486
  static get code() {
475
487
  return "ERR_STATUS_ATTESTATION_ERROR";
@@ -485,29 +497,10 @@ class StatusAttestationError extends IoWalletError {
485
497
  }
486
498
  }
487
499
 
488
- /**
489
- * Error subclass thrown when the the user is not entitled to receive the requested credential.
490
- */
491
- exports.StatusAttestationError = StatusAttestationError;
492
- class CredentialNotEntitledError extends IoWalletError {
493
- static get code() {
494
- return "CREDENTIAL_NOT_ENTITLED_ERROR";
495
- }
496
- code = "CREDENTIAL_NOT_ENTITLED_ERROR";
497
- constructor(message) {
498
- let reason = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "unspecified";
499
- super(serializeAttrs({
500
- message,
501
- reason
502
- }));
503
- this.reason = reason;
504
- }
505
- }
506
-
507
500
  /**
508
501
  * Error subclass thrown when an error occurs while requesting a credential.
509
502
  */
510
- exports.CredentialNotEntitledError = CredentialNotEntitledError;
503
+ exports.StatusAttestationError = StatusAttestationError;
511
504
  class CredentialRequestError extends IoWalletError {
512
505
  static get code() {
513
506
  return "CREDENTIAL_REQUEST_ERROR";
@@ -542,4 +535,39 @@ class CredentialIssuingNotSynchronousError extends IoWalletError {
542
535
  }
543
536
  }
544
537
  exports.CredentialIssuingNotSynchronousError = CredentialIssuingNotSynchronousError;
538
+ /**
539
+ * Function to extract the error message from the Entity Configuration's supported error codes.
540
+ * @param errorCode The error code to map to a meaningful message
541
+ * @param params.issuerConf The entity configuration for credentials
542
+ * @param params.credentialType The type of credential the error belongs to
543
+ * @returns A localized error {@link LocalizedIssuanceError} or undefined
544
+ * @throws {Error} When no credential config is found
545
+ */
546
+ function extractErrorMessageFromIssuerConf(errorCode, _ref2) {
547
+ let {
548
+ issuerConf,
549
+ credentialType
550
+ } = _ref2;
551
+ const credentialConfiguration = issuerConf.openid_credential_issuer.credential_configurations_supported[credentialType];
552
+ if (!credentialConfiguration) {
553
+ throw new Error(`No configuration found for ${credentialType} in the provided EC`);
554
+ }
555
+ const {
556
+ issuance_errors_supported
557
+ } = credentialConfiguration;
558
+ if (!(issuance_errors_supported !== null && issuance_errors_supported !== void 0 && issuance_errors_supported[errorCode])) {
559
+ return undefined;
560
+ }
561
+ const localesList = issuance_errors_supported[errorCode].display;
562
+ return localesList.reduce((acc, _ref3) => {
563
+ let {
564
+ locale,
565
+ ...rest
566
+ } = _ref3;
567
+ return {
568
+ ...acc,
569
+ [locale]: rest
570
+ };
571
+ }, {});
572
+ }
545
573
  //# sourceMappingURL=errors.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["serializeAttrs","attrs","Object","entries","map","_ref","k","v","Array","isArray","join","_","exports","IoWalletError","Error","code","constructor","message","_Error$captureStackTr","name","captureStackTrace","call","UnexpectedStatusCodeError","statusCode","toString","ValidationFailed","claim","arguments","length","undefined","reason","WalletInstanceAttestationIssuingError","AuthRequestDecodeError","PidIssuingError","ClaimsNotFoundBetweenDislosures","claims","c","ClaimsNotFoundInToken","NoSuitableKeysFoundInEntityConfiguration","scenario","PidMetadataError","WalletProviderResponseError","WalletInstanceRevokedError","WalletInstanceNotFoundError","WalletInstanceIntegrityFailedError","WalletInstanceCreationError","WalletInstanceCreationIntegrityError","AuthorizationError","AuthorizationIdpError","error","errorDescription","OperationAbortedError","operation","StatusAttestationInvalid","StatusAttestationError","CredentialNotEntitledError","CredentialRequestError","CredentialIssuingNotSynchronousError"],"sourceRoot":"../../../src","sources":["utils/errors.ts"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMA,cAAc,GACzBC,KAAsC,IAEtCC,MAAM,CAACC,OAAO,CAACF,KAAK,CAAC,CAClBG,GAAG,CAACC,IAAA;EAAA,IAAC,CAACC,CAAC,EAAEC,CAAC,CAAC,GAAAF,IAAA;EAAA,OAAK,CAACC,CAAC,EAAEE,KAAK,CAACC,OAAO,CAACF,CAAC,CAAC,GAAI,IAAGA,CAAC,CAACG,IAAI,CAAC,IAAI,CAAE,GAAE,GAAGH,CAAC,CAAC;AAAA,EAAC,CAChEH,GAAG,CAAEO,CAAC,IAAKA,CAAC,CAACD,IAAI,CAAC,GAAG,CAAC,CAAC,CACvBA,IAAI,CAAC,GAAG,CAAC;;AAEd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAVAE,OAAA,CAAAZ,cAAA,GAAAA,cAAA;AAWO,MAAMa,aAAa,SAASC,KAAK,CAAC;EACvC;EACA,WAAWC,IAAIA,CAAA,EAAW;IACxB,OAAO,uBAAuB;EAChC;;EAEA;EACAA,IAAI,GAAW,uBAAuB;EAEtCC,WAAWA,CAACC,OAAgB,EAAE;IAAA,IAAAC,qBAAA;IAC5B,KAAK,CAACD,OAAO,CAAC;IACd,IAAI,CAACE,IAAI,GAAG,IAAI,CAACH,WAAW,CA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;EAEAA,IAAI,GAAG,0CAA0C;EAIjDC,WAAWA,CAACC,OAAe,EAAkC;IAAA,IAAhCa,MAAc,GAAAH,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,aAAa;IACzD,KAAK,CAAC3B,cAAc,CAAC;MAAEiB,OAAO;MAAEa;IAAO,CAAC,CAAC,CAAC;IAC1C,IAAI,CAACA,MAAM,GAAGA,MAAM;EACtB;AACF;AAAClB,OAAA,CAAA6C,oCAAA,GAAAA,oCAAA"}
1
+ {"version":3,"names":["serializeAttrs","attrs","Object","entries","map","_ref","k","v","Array","isArray","join","_","exports","IoWalletError","Error","code","constructor","message","_Error$captureStackTr","name","captureStackTrace","call","UnexpectedStatusCodeError","statusCode","responseBody","toString","ValidationFailed","claim","arguments","length","undefined","reason","WalletInstanceAttestationIssuingError","AuthRequestDecodeError","PidIssuingError","ClaimsNotFoundBetweenDislosures","claims","c","ClaimsNotFoundInToken","NoSuitableKeysFoundInEntityConfiguration","scenario","PidMetadataError","WalletProviderResponseError","WalletInstanceRevokedError","WalletInstanceNotFoundError","WalletInstanceIntegrityFailedError","WalletInstanceCreationError","WalletInstanceCreationIntegrityError","AuthorizationError","AuthorizationIdpError","error","errorDescription","OperationAbortedError","operation","CredentialInvalidStatusError","errorCode","StatusAttestationError","CredentialRequestError","CredentialIssuingNotSynchronousError","extractErrorMessageFromIssuerConf","_ref2","issuerConf","credentialType","credentialConfiguration","openid_credential_issuer","credential_configurations_supported","issuance_errors_supported","localesList","display","reduce","acc","_ref3","locale","rest"],"sourceRoot":"../../../src","sources":["utils/errors.ts"],"mappings":";;;;;;;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMA,cAAc,GACzBC,KAAsC,IAEtCC,MAAM,CAACC,OAAO,CAACF,KAAK,CAAC,CAClBG,GAAG,CAACC,IAAA;EAAA,IAAC,CAACC,CAAC,EAAEC,CAAC,CAAC,GAAAF,IAAA;E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EAEjE,OAAOD,WAAW,CAACE,MAAM,CACvB,CAACC,GAAG,EAAAC,KAAA;IAAA,IAAE;MAAEC,MAAM;MAAE,GAAGC;IAAK,CAAC,GAAAF,KAAA;IAAA,OAAM;MAAE,GAAGD,GAAG;MAAE,CAACE,MAAM,GAAGC;IAAK,CAAC;EAAA,CAAC,EAC1D,CAAC,CACH,CAAC;AACH"}
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.until = exports.isDefined = exports.hasStatus = exports.getCredentialHashWithouDiscloures = exports.generateRandomAlphaNumericString = exports.createAbortPromiseFromSignal = void 0;
6
+ exports.until = exports.safeJsonParse = exports.isDefined = exports.hasStatus = exports.getCredentialHashWithouDiscloures = exports.generateRandomAlphaNumericString = exports.createAbortPromiseFromSignal = void 0;
7
7
  var _errors = require("./errors");
8
8
  var _jsSha = require("js-sha256");
9
9
  /**
@@ -14,7 +14,8 @@ var _jsSha = require("js-sha256");
14
14
  */
15
15
  const hasStatus = status => async res => {
16
16
  if (res.status !== status) {
17
- throw new _errors.UnexpectedStatusCodeError(`Http request failed. Expected ${status}, got ${res.status}, url: ${res.url} with response: ${await res.text()}`, res.status);
17
+ const responseBody = await res.text();
18
+ throw new _errors.UnexpectedStatusCodeError(`Http request failed. Expected ${status}, got ${res.status}, url: ${res.url} with response: ${responseBody}`, res.status, responseBody);
18
19
  }
19
20
  return res;
20
21
  };
@@ -91,4 +92,12 @@ const createAbortPromiseFromSignal = signal => {
91
92
  exports.createAbortPromiseFromSignal = createAbortPromiseFromSignal;
92
93
  const isDefined = x => Boolean(x);
93
94
  exports.isDefined = isDefined;
95
+ const safeJsonParse = (text, withDefault) => {
96
+ try {
97
+ return JSON.parse(text);
98
+ } catch (_) {
99
+ return withDefault ?? null;
100
+ }
101
+ };
102
+ exports.safeJsonParse = safeJsonParse;
94
103
  //# sourceMappingURL=misc.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_errors","require","_jsSha","hasStatus","status","res","UnexpectedStatusCodeError","url","text","exports","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","IoWalletError","sha256","slice","createAbortPromiseFromSignal","signal","listener","listen","aborted","addEventListener","remove","removeEventListener","isDefined","x","Boolean"],"sourceRoot":"../../../src","sources":["utils/misc.ts"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACO,MAAME,SAAS,GACnBC,MAAc,IACf,MAAOC,GAAa,IAAwB;EAC1C,IAAIA,GAAG,CAACD,MAAM,KAAKA,MAAM,EAAE;IACzB,MAAM,IAAIE,iCAAyB,CAChC,iCAAgCF,MAAO,SAAQC,GAAG,CAACD,MAAO,UACzDC,GAAG,CAACE,GACL,mBAAkB,MAAMF,GAAG,CAACG,IAAI,CAAC,CAAE,EAAC,EACrCH,GAAG,CAACD,MACN,CAAC;EACH;EACA,OAAOC,GAAG;AACZ,CAAC;;AAEH;AACA;AAAAI,OAAA,CAAAN,SAAA,GAAAA,SAAA;AAOA;AACA;AACA;AACA;AACA;AACO,MAAMO,gCAAgC,GAAIC,IAAY,IAC3DC,KAAK,CAACC,IAAI,CAACD,KAAK,CAACD,IAAI,CAAC,EAAE,MACtBG,IAAI,CAACC,KAAK,CAACD,IAAI,CAACE,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC,CAACC,QAAQ,CAAC,EAAE,CAC5C,CAAC,CAACC,IAAI,CAAC,EAAE,CAAC;;AAEZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAVAT,OAAA,CAAAC,gCAAA,GAAAA,gCAAA;AAWO,MAAMS,KAAK,GAAGA,CACnBC,iBAAgC,EAChCC,cAAuB,KAEvB,IAAIC,OAAO,CAAO,C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7CiB,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;AAAChC,OAAA,CAAA8B,4BAAA,GAAAA,4BAAA;AAEK,MAAMQ,SAAS,GAAOC,CAA4B,IACvDC,OAAO,CAACD,CAAC,CAAC;AAACvC,OAAA,CAAAsC,SAAA,GAAAA,SAAA"}
1
+ {"version":3,"names":["_errors","require","_jsSha","hasStatus","status","res","responseBody","text","UnexpectedStatusCodeError","url","exports","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","IoWalletError","sha256","slice","createAbortPromiseFromSignal","signal","listener","listen","aborted","addEventListener","remove","removeEventListener","isDefined","x","Boolean","safeJsonParse","withDefault","JSON","parse","_"],"sourceRoot":"../../../src","sources":["utils/misc.ts"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACO,MAAME,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,IAAIC,iCAAyB,CAChC,iCAAgCJ,MAAO,SAAQC,GAAG,CAACD,MAAO,UAASC,GAAG,CAACI,GAAI,mBAAkBH,YAAa,EAAC,EAC5GD,GAAG,CAACD,MAAM,EACVE,YACF,CAAC;EACH;EACA,OAAOD,GAAG;AACZ,CAAC;;AAEH;AACA;AAAAK,OAAA,CAAAP,SAAA,GAAAA,SAAA;AAOA;AACA;A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