@pagopa/io-react-native-wallet 0.9.1 → 0.10.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (85) hide show
  1. package/lib/commonjs/credential/issuance/06-obtain-credential.js +2 -34
  2. package/lib/commonjs/credential/issuance/06-obtain-credential.js.map +1 -1
  3. package/lib/commonjs/credential/issuance/07-verify-and-parse-credential.js +169 -0
  4. package/lib/commonjs/credential/issuance/07-verify-and-parse-credential.js.map +1 -0
  5. package/lib/commonjs/credential/issuance/08-confirm-credential.js +6 -0
  6. package/lib/commonjs/credential/issuance/08-confirm-credential.js.map +1 -0
  7. package/lib/commonjs/credential/issuance/const.js +6 -1
  8. package/lib/commonjs/credential/issuance/const.js.map +1 -1
  9. package/lib/commonjs/credential/issuance/index.js +7 -0
  10. package/lib/commonjs/credential/issuance/index.js.map +1 -1
  11. package/lib/commonjs/credential/presentation/01-start-flow.js +1 -1
  12. package/lib/commonjs/credential/presentation/01-start-flow.js.map +1 -1
  13. package/lib/commonjs/index.js +3 -1
  14. package/lib/commonjs/index.js.map +1 -1
  15. package/lib/commonjs/sd-jwt/__test__/index.test.js +33 -1
  16. package/lib/commonjs/sd-jwt/__test__/index.test.js.map +1 -1
  17. package/lib/commonjs/sd-jwt/index.js +15 -6
  18. package/lib/commonjs/sd-jwt/index.js.map +1 -1
  19. package/lib/commonjs/sd-jwt/types.js +1 -1
  20. package/lib/commonjs/trust/types.js +5 -0
  21. package/lib/commonjs/trust/types.js.map +1 -1
  22. package/lib/commonjs/utils/misc.js +2 -2
  23. package/lib/commonjs/utils/misc.js.map +1 -1
  24. package/lib/module/credential/issuance/06-obtain-credential.js +3 -34
  25. package/lib/module/credential/issuance/06-obtain-credential.js.map +1 -1
  26. package/lib/module/credential/issuance/07-verify-and-parse-credential.js +163 -0
  27. package/lib/module/credential/issuance/07-verify-and-parse-credential.js.map +1 -0
  28. package/lib/module/credential/issuance/08-confirm-credential.js +2 -0
  29. package/lib/module/credential/issuance/08-confirm-credential.js.map +1 -0
  30. package/lib/module/credential/issuance/const.js +2 -0
  31. package/lib/module/credential/issuance/const.js.map +1 -1
  32. package/lib/module/credential/issuance/index.js +2 -1
  33. package/lib/module/credential/issuance/index.js.map +1 -1
  34. package/lib/module/credential/presentation/01-start-flow.js +1 -1
  35. package/lib/module/credential/presentation/01-start-flow.js.map +1 -1
  36. package/lib/module/index.js +2 -1
  37. package/lib/module/index.js.map +1 -1
  38. package/lib/module/sd-jwt/__test__/index.test.js +33 -1
  39. package/lib/module/sd-jwt/__test__/index.test.js.map +1 -1
  40. package/lib/module/sd-jwt/index.js +10 -6
  41. package/lib/module/sd-jwt/index.js.map +1 -1
  42. package/lib/module/sd-jwt/types.js +1 -1
  43. package/lib/module/trust/types.js +5 -0
  44. package/lib/module/trust/types.js.map +1 -1
  45. package/lib/module/utils/misc.js +2 -2
  46. package/lib/module/utils/misc.js.map +1 -1
  47. package/lib/typescript/credential/issuance/01-start-flow.d.ts +2 -2
  48. package/lib/typescript/credential/issuance/01-start-flow.d.ts.map +1 -1
  49. package/lib/typescript/credential/issuance/06-obtain-credential.d.ts +2 -1
  50. package/lib/typescript/credential/issuance/06-obtain-credential.d.ts.map +1 -1
  51. package/lib/typescript/credential/issuance/07-verify-and-parse-credential.d.ts +36 -0
  52. package/lib/typescript/credential/issuance/07-verify-and-parse-credential.d.ts.map +1 -0
  53. package/lib/typescript/credential/issuance/08-confirm-credential.d.ts +11 -0
  54. package/lib/typescript/credential/issuance/08-confirm-credential.d.ts.map +1 -0
  55. package/lib/typescript/credential/issuance/const.d.ts +3 -0
  56. package/lib/typescript/credential/issuance/const.d.ts.map +1 -1
  57. package/lib/typescript/credential/issuance/index.d.ts +4 -3
  58. package/lib/typescript/credential/issuance/index.d.ts.map +1 -1
  59. package/lib/typescript/credential/presentation/01-start-flow.d.ts +2 -2
  60. package/lib/typescript/credential/presentation/01-start-flow.d.ts.map +1 -1
  61. package/lib/typescript/index.d.ts +2 -1
  62. package/lib/typescript/index.d.ts.map +1 -1
  63. package/lib/typescript/sd-jwt/index.d.ts +222 -5
  64. package/lib/typescript/sd-jwt/index.d.ts.map +1 -1
  65. package/lib/typescript/sd-jwt/types.d.ts +1 -1
  66. package/lib/typescript/trust/index.d.ts +8 -0
  67. package/lib/typescript/trust/index.d.ts.map +1 -1
  68. package/lib/typescript/trust/types.d.ts +232 -0
  69. package/lib/typescript/trust/types.d.ts.map +1 -1
  70. package/lib/typescript/utils/misc.d.ts +2 -2
  71. package/lib/typescript/utils/misc.d.ts.map +1 -1
  72. package/package.json +2 -2
  73. package/src/credential/issuance/01-start-flow.ts +2 -2
  74. package/src/credential/issuance/06-obtain-credential.ts +3 -51
  75. package/src/credential/issuance/07-verify-and-parse-credential.ts +229 -0
  76. package/src/credential/issuance/08-confirm-credential.ts +14 -0
  77. package/src/credential/issuance/const.ts +6 -0
  78. package/src/credential/issuance/index.ts +7 -1
  79. package/src/credential/presentation/01-start-flow.ts +3 -3
  80. package/src/index.ts +2 -0
  81. package/src/sd-jwt/__test__/index.test.ts +32 -1
  82. package/src/sd-jwt/index.ts +14 -8
  83. package/src/sd-jwt/types.ts +1 -1
  84. package/src/trust/types.ts +4 -0
  85. package/src/utils/misc.ts +6 -2
package/src/utils/misc.ts CHANGED
@@ -7,10 +7,12 @@ import { IoWalletError } from "./errors";
7
7
  */
8
8
  export const hasStatus =
9
9
  (status: number) =>
10
- (res: Response): Response => {
10
+ async (res: Response): Promise<Response> => {
11
11
  if (res.status !== status) {
12
12
  throw new IoWalletError(
13
- `Http request failed. Expected ${status}, got ${res.status}, url: ${res.url}`
13
+ `Http request failed. Expected ${status}, got ${res.status}, url: ${
14
+ res.url
15
+ } with response: ${await res.text()}`
14
16
  );
15
17
  }
16
18
  return res;
@@ -20,4 +22,6 @@ export const hasStatus =
20
22
  // helpful to bind the input of a function to the output of another
21
23
  export type Out<FN> = FN extends (...args: any[]) => Promise<any>
22
24
  ? Awaited<ReturnType<FN>>
25
+ : FN extends (...args: any[]) => any
26
+ ? ReturnType<FN>
23
27
  : never;