@pagopa/io-react-native-wallet 3.5.0 → 3.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (116) hide show
  1. package/lib/commonjs/credential/issuance/api/IssuerConfig.js +1 -1
  2. package/lib/commonjs/credential/issuance/api/IssuerConfig.js.map +1 -1
  3. package/lib/commonjs/credential/issuance/common/06-verify-and-parse-credential.mdoc.js +8 -3
  4. package/lib/commonjs/credential/issuance/common/06-verify-and-parse-credential.mdoc.js.map +1 -1
  5. package/lib/commonjs/credential/issuance/common/06-verify-and-parse-credential.sdjwt.js +6 -4
  6. package/lib/commonjs/credential/issuance/common/06-verify-and-parse-credential.sdjwt.js.map +1 -1
  7. package/lib/commonjs/credential/issuance/v1.3.3/mappers.js +1 -1
  8. package/lib/commonjs/credential/issuance/v1.3.3/mappers.js.map +1 -1
  9. package/lib/commonjs/credential/status/README.md +15 -13
  10. package/lib/commonjs/credential/status/api/index.js.map +1 -1
  11. package/lib/commonjs/credential/status/api/types.js +27 -0
  12. package/lib/commonjs/credential/status/api/types.js.map +1 -1
  13. package/lib/commonjs/credential/status/v1.3.3/01-status-list.js +26 -22
  14. package/lib/commonjs/credential/status/v1.3.3/01-status-list.js.map +1 -1
  15. package/lib/commonjs/credential/status/v1.3.3/02-verify-and-parse-status-list.js +4 -25
  16. package/lib/commonjs/credential/status/v1.3.3/02-verify-and-parse-status-list.js.map +1 -1
  17. package/lib/commonjs/credential/status/v1.3.3/03-get-status.js +34 -0
  18. package/lib/commonjs/credential/status/v1.3.3/03-get-status.js.map +1 -0
  19. package/lib/commonjs/credential/status/v1.3.3/index.js +4 -1
  20. package/lib/commonjs/credential/status/v1.3.3/index.js.map +1 -1
  21. package/lib/commonjs/credentials-catalogue/api/DigitalCredentialsCatalogue.js +1 -0
  22. package/lib/commonjs/credentials-catalogue/api/DigitalCredentialsCatalogue.js.map +1 -1
  23. package/lib/commonjs/credentials-catalogue/common/get-status-l10n-ids.js +1 -1
  24. package/lib/commonjs/credentials-catalogue/v1.3.3/mappers.js +2 -2
  25. package/lib/commonjs/credentials-catalogue/v1.3.3/mappers.js.map +1 -1
  26. package/lib/commonjs/credentials-catalogue/v1.3.3/types.js +2 -1
  27. package/lib/commonjs/credentials-catalogue/v1.3.3/types.js.map +1 -1
  28. package/lib/commonjs/mdoc/const.js +3 -1
  29. package/lib/commonjs/mdoc/const.js.map +1 -1
  30. package/lib/commonjs/mdoc/utils.js +5 -5
  31. package/lib/commonjs/mdoc/utils.js.map +1 -1
  32. package/lib/module/credential/issuance/api/IssuerConfig.js +1 -1
  33. package/lib/module/credential/issuance/api/IssuerConfig.js.map +1 -1
  34. package/lib/module/credential/issuance/common/06-verify-and-parse-credential.mdoc.js +8 -3
  35. package/lib/module/credential/issuance/common/06-verify-and-parse-credential.mdoc.js.map +1 -1
  36. package/lib/module/credential/issuance/common/06-verify-and-parse-credential.sdjwt.js +6 -4
  37. package/lib/module/credential/issuance/common/06-verify-and-parse-credential.sdjwt.js.map +1 -1
  38. package/lib/module/credential/issuance/v1.3.3/mappers.js +1 -1
  39. package/lib/module/credential/issuance/v1.3.3/mappers.js.map +1 -1
  40. package/lib/module/credential/status/README.md +15 -13
  41. package/lib/module/credential/status/api/index.js +3 -1
  42. package/lib/module/credential/status/api/index.js.map +1 -1
  43. package/lib/module/credential/status/api/types.js +20 -0
  44. package/lib/module/credential/status/api/types.js.map +1 -1
  45. package/lib/module/credential/status/v1.3.3/01-status-list.js +24 -21
  46. package/lib/module/credential/status/v1.3.3/01-status-list.js.map +1 -1
  47. package/lib/module/credential/status/v1.3.3/02-verify-and-parse-status-list.js +5 -26
  48. package/lib/module/credential/status/v1.3.3/02-verify-and-parse-status-list.js.map +1 -1
  49. package/lib/module/credential/status/v1.3.3/03-get-status.js +27 -0
  50. package/lib/module/credential/status/v1.3.3/03-get-status.js.map +1 -0
  51. package/lib/module/credential/status/v1.3.3/index.js +5 -2
  52. package/lib/module/credential/status/v1.3.3/index.js.map +1 -1
  53. package/lib/module/credentials-catalogue/api/DigitalCredentialsCatalogue.js +1 -0
  54. package/lib/module/credentials-catalogue/api/DigitalCredentialsCatalogue.js.map +1 -1
  55. package/lib/module/credentials-catalogue/common/get-status-l10n-ids.js +1 -1
  56. package/lib/module/credentials-catalogue/v1.3.3/mappers.js +2 -2
  57. package/lib/module/credentials-catalogue/v1.3.3/mappers.js.map +1 -1
  58. package/lib/module/credentials-catalogue/v1.3.3/types.js +2 -1
  59. package/lib/module/credentials-catalogue/v1.3.3/types.js.map +1 -1
  60. package/lib/module/mdoc/const.js +1 -0
  61. package/lib/module/mdoc/const.js.map +1 -1
  62. package/lib/module/mdoc/utils.js +6 -6
  63. package/lib/module/mdoc/utils.js.map +1 -1
  64. package/lib/typescript/credential/issuance/api/IssuerConfig.d.ts +2 -2
  65. package/lib/typescript/credential/issuance/common/06-verify-and-parse-credential.mdoc.d.ts.map +1 -1
  66. package/lib/typescript/credential/issuance/common/06-verify-and-parse-credential.sdjwt.d.ts.map +1 -1
  67. package/lib/typescript/credential/issuance/v1.0.0/mappers.d.ts +2 -2
  68. package/lib/typescript/credential/issuance/v1.3.3/mappers.d.ts +2 -2
  69. package/lib/typescript/credential/issuance/v1.3.3/mappers.d.ts.map +1 -1
  70. package/lib/typescript/credential/status/api/index.d.ts +3 -1
  71. package/lib/typescript/credential/status/api/index.d.ts.map +1 -1
  72. package/lib/typescript/credential/status/api/status-assertion.d.ts +1 -1
  73. package/lib/typescript/credential/status/api/status-list.d.ts +27 -9
  74. package/lib/typescript/credential/status/api/status-list.d.ts.map +1 -1
  75. package/lib/typescript/credential/status/api/types.d.ts +20 -0
  76. package/lib/typescript/credential/status/api/types.d.ts.map +1 -1
  77. package/lib/typescript/credential/status/v1.3.3/01-status-list.d.ts +1 -0
  78. package/lib/typescript/credential/status/v1.3.3/01-status-list.d.ts.map +1 -1
  79. package/lib/typescript/credential/status/v1.3.3/02-verify-and-parse-status-list.d.ts.map +1 -1
  80. package/lib/typescript/credential/status/v1.3.3/03-get-status.d.ts +3 -0
  81. package/lib/typescript/credential/status/v1.3.3/03-get-status.d.ts.map +1 -0
  82. package/lib/typescript/credential/status/v1.3.3/index.d.ts.map +1 -1
  83. package/lib/typescript/credentials-catalogue/api/DigitalCredentialsCatalogue.d.ts +2 -0
  84. package/lib/typescript/credentials-catalogue/api/DigitalCredentialsCatalogue.d.ts.map +1 -1
  85. package/lib/typescript/credentials-catalogue/api/index.d.ts +1 -1
  86. package/lib/typescript/credentials-catalogue/common/get-status-l10n-ids.d.ts +1 -1
  87. package/lib/typescript/credentials-catalogue/v1.0.0/mappers.d.ts +1 -0
  88. package/lib/typescript/credentials-catalogue/v1.0.0/mappers.d.ts.map +1 -1
  89. package/lib/typescript/credentials-catalogue/v1.3.3/mappers.d.ts +6 -4
  90. package/lib/typescript/credentials-catalogue/v1.3.3/mappers.d.ts.map +1 -1
  91. package/lib/typescript/credentials-catalogue/v1.3.3/types.d.ts +6 -4
  92. package/lib/typescript/credentials-catalogue/v1.3.3/types.d.ts.map +1 -1
  93. package/lib/typescript/mdoc/const.d.ts +1 -0
  94. package/lib/typescript/mdoc/const.d.ts.map +1 -1
  95. package/lib/typescript/mdoc/utils.d.ts.map +1 -1
  96. package/package.json +6 -6
  97. package/src/credential/issuance/api/IssuerConfig.ts +1 -1
  98. package/src/credential/issuance/common/06-verify-and-parse-credential.mdoc.ts +19 -3
  99. package/src/credential/issuance/common/06-verify-and-parse-credential.sdjwt.ts +14 -4
  100. package/src/credential/issuance/v1.3.3/mappers.ts +1 -1
  101. package/src/credential/status/README.md +15 -13
  102. package/src/credential/status/api/index.ts +3 -1
  103. package/src/credential/status/api/status-assertion.ts +1 -1
  104. package/src/credential/status/api/status-list.ts +35 -12
  105. package/src/credential/status/api/types.ts +27 -0
  106. package/src/credential/status/v1.3.3/01-status-list.ts +30 -18
  107. package/src/credential/status/v1.3.3/02-verify-and-parse-status-list.ts +5 -27
  108. package/src/credential/status/v1.3.3/03-get-status.ts +40 -0
  109. package/src/credential/status/v1.3.3/index.ts +4 -1
  110. package/src/credentials-catalogue/api/DigitalCredentialsCatalogue.ts +1 -0
  111. package/src/credentials-catalogue/api/index.ts +1 -1
  112. package/src/credentials-catalogue/common/get-status-l10n-ids.ts +1 -1
  113. package/src/credentials-catalogue/v1.3.3/mappers.ts +4 -2
  114. package/src/credentials-catalogue/v1.3.3/types.ts +4 -6
  115. package/src/mdoc/const.ts +1 -0
  116. package/src/mdoc/utils.ts +11 -8
@@ -116,6 +116,7 @@ export declare const DigitalCredential: z.ZodObject<{
116
116
  logo_uri: z.ZodOptional<z.ZodString>;
117
117
  user_information: z.ZodOptional<z.ZodString>;
118
118
  }, z.core.$strip>>;
119
+ parent_credentials: z.ZodOptional<z.ZodArray<z.ZodString>>;
119
120
  formats: z.ZodOptional<z.ZodArray<z.ZodObject<{
120
121
  configuration_id: z.ZodString;
121
122
  format: z.ZodEnum<{
@@ -270,6 +271,7 @@ export declare const DigitalCredentialsCatalogue: z.ZodObject<{
270
271
  logo_uri: z.ZodOptional<z.ZodString>;
271
272
  user_information: z.ZodOptional<z.ZodString>;
272
273
  }, z.core.$strip>>;
274
+ parent_credentials: z.ZodOptional<z.ZodArray<z.ZodString>>;
273
275
  formats: z.ZodOptional<z.ZodArray<z.ZodObject<{
274
276
  configuration_id: z.ZodString;
275
277
  format: z.ZodEnum<{
@@ -1 +1 @@
1
- {"version":3,"file":"DigitalCredentialsCatalogue.d.ts","sourceRoot":"","sources":["../../../../src/credentials-catalogue/api/DigitalCredentialsCatalogue.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAGzB,eAAO,MAAM,gBAAgB;;;;;iBAK3B,CAAC;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAEhE;;;GAGG;AACH,MAAM,MAAM,qBAAqB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,E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AAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAElE,QAAA,MAAM,eAAe;;;iBAGnB,CAAC;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAE9D,QAAA,MAAM,aAAa;;;;iBAIjB,CAAC;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AAE1D,QAAA,MAAM,cAAc;;;;;;;;;iBAKlB,CAAC;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAE5D,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;iBAOnB,CAAC;AACH,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,QAAQ,CAAC,CAAC;AAEhD,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAQtC,CAAC;AACH,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAC/C,OAAO,2BAA2B,CACnC,CAAC"}
@@ -38,7 +38,7 @@ export interface CredentialsCatalogueApi {
38
38
  * Given a statusBit (e.g. "0x00", "0x0B") and a DigitalCredential from the
39
39
  * catalogue, returns the matching l10n IDs or undefined if not found.
40
40
  * The comparison is case-insensitive to handle uppercase statusBit values
41
- * returned by verifyAndParseStatusList against lowercase keys in the catalogue.
41
+ * returned by getStatus against lowercase keys in the catalogue.
42
42
  *
43
43
  * @since 1.0.0
44
44
  */
@@ -3,7 +3,7 @@ import { type CredentialsCatalogueApi } from "../api";
3
3
  * Given a statusBit (e.g. "0x00", "0x0B") and a DigitalCredential from the
4
4
  * catalogue, returns the matching l10n IDs or undefined if not found.
5
5
  * The comparison is case-insensitive to handle uppercase statusBit values
6
- * returned by verifyAndParseStatusList against lowercase keys in the catalogue.
6
+ * returned by getStatus against lowercase keys in the catalogue.
7
7
  */
8
8
  export declare const getStatusL10nIds: CredentialsCatalogueApi["getStatusL10nIds"];
9
9
  //# sourceMappingURL=get-status-l10n-ids.d.ts.map
@@ -67,6 +67,7 @@ export declare const mapToCredentialsCatalogue: (input: unknown) => {
67
67
  } | undefined;
68
68
  domains?: string[] | undefined;
69
69
  classes?: string[] | undefined;
70
+ parent_credentials?: string[] | undefined;
70
71
  formats?: {
71
72
  configuration_id: string;
72
73
  format: "dc+sd-jwt" | "mso_mdoc";
@@ -1 +1 @@
1
- {"version":3,"file":"mappers.d.ts","sourceRoot":"","sources":["../../../../src/credentials-catalogue/v1.0.0/mappers.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwBrC,CAAC"}
1
+ {"version":3,"file":"mappers.d.ts","sourceRoot":"","sources":["../../../../src/credentials-catalogue/v1.0.0/mappers.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwBrC,CAAC"}
@@ -72,10 +72,6 @@ export declare const mapToCredentialsCatalogue: (input: [{
72
72
  deferred_flow: boolean;
73
73
  } | undefined;
74
74
  }[];
75
- authentic_sources: {
76
- id: string;
77
- dataset_id: string;
78
- }[];
79
75
  restriction_policy?: {
80
76
  presentation_flows: {
81
77
  remote: boolean;
@@ -90,6 +86,11 @@ export declare const mapToCredentialsCatalogue: (input: [{
90
86
  } | undefined;
91
87
  domains?: string[] | undefined;
92
88
  classes?: string[] | undefined;
89
+ authentic_sources?: {
90
+ id: string;
91
+ dataset_id: string;
92
+ }[] | undefined;
93
+ parent_credentials?: string[] | undefined;
93
94
  }[];
94
95
  iat: number;
95
96
  exp: number;
@@ -264,6 +265,7 @@ export declare const mapToCredentialsCatalogue: (input: [{
264
265
  } | undefined;
265
266
  domains?: string[] | undefined;
266
267
  classes?: string[] | undefined;
268
+ parent_credentials?: string[] | undefined;
267
269
  formats?: {
268
270
  configuration_id: string;
269
271
  format: "dc+sd-jwt" | "mso_mdoc";
@@ -1 +1 @@
1
- {"version":3,"file":"mappers.d.ts","sourceRoot":"","sources":["../../../../src/credentials-catalogue/v1.3.3/mappers.ts"],"names":[],"mappings":"AAgBA,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkFrC,CAAC"}
1
+ {"version":3,"file":"mappers.d.ts","sourceRoot":"","sources":["../../../../src/credentials-catalogue/v1.3.3/mappers.ts"],"names":[],"mappings":"AAgBA,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoFrC,CAAC"}
@@ -112,10 +112,11 @@ export declare const DigitalCredential: z.ZodObject<{
112
112
  deferred_flow: z.ZodBoolean;
113
113
  }, z.core.$strip>>;
114
114
  }, z.core.$strip>>;
115
- authentic_sources: z.ZodArray<z.ZodObject<{
115
+ authentic_sources: z.ZodOptional<z.ZodArray<z.ZodObject<{
116
116
  id: z.ZodString;
117
117
  dataset_id: z.ZodString;
118
- }, z.core.$strip>>;
118
+ }, z.core.$strip>>>;
119
+ parent_credentials: z.ZodOptional<z.ZodArray<z.ZodString>>;
119
120
  }, z.core.$strip>;
120
121
  /**
121
122
  * Schema registry, available at a dedicated endpoint.
@@ -276,10 +277,11 @@ export declare const DigitalCredentialsCatalogueJwt: z.ZodObject<{
276
277
  deferred_flow: z.ZodBoolean;
277
278
  }, z.core.$strip>>;
278
279
  }, z.core.$strip>>;
279
- authentic_sources: z.ZodArray<z.ZodObject<{
280
+ authentic_sources: z.ZodOptional<z.ZodArray<z.ZodObject<{
280
281
  id: z.ZodString;
281
282
  dataset_id: z.ZodString;
282
- }, z.core.$strip>>;
283
+ }, z.core.$strip>>>;
284
+ parent_credentials: z.ZodOptional<z.ZodArray<z.ZodString>>;
283
285
  }, z.core.$strip>>;
284
286
  iat: z.ZodNumber;
285
287
  exp: z.ZodNumber;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/credentials-catalogue/v1.3.3/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAmCzB,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAuB1B,CAAC;AACH,MAAM,MAAM,eAAe,GA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,CAAC;AA6BxE;;;;GAIG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;iBAgB3B,CAAC;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC"}
@@ -1,2 +1,3 @@
1
1
  export declare const MDOC_DEFAULT_NAMESPACE = "org.iso.18013.5.1";
2
+ export declare const MDOC_VERIFICATION_IDENTIFIER = "verification";
2
3
  //# sourceMappingURL=const.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"const.d.ts","sourceRoot":"","sources":["../../../src/mdoc/const.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,sBAAsB,sBAAsB,CAAC"}
1
+ {"version":3,"file":"const.d.ts","sourceRoot":"","sources":["../../../src/mdoc/const.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,sBAAsB,sBAAsB,CAAC;AAC1D,eAAO,MAAM,4BAA4B,iBAAiB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/mdoc/utils.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAGzC;;;;GAIG;AACH,eAAO,MAAM,2BAA2B,GAAI,WAAW,MAAM,EAAE,KAAK,MAAM,WACnD,CAAC;AAExB;;;;;;;GAOG;AACH,eAAO,MAAM,mCAAmC,GAC9C,kBAAkB,GAAG,CACnB,WAAW,CAAC,0BAA0B,CAAC,CACxC,CAAC,kBAAkB,CAAC;;;aAQtB,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe,GAAU,OAAO,MAAM;;;cAQlD,CAAC"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/mdoc/utils.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAGzC;;;;GAIG;AACH,eAAO,MAAM,2BAA2B,GAAI,WAAW,MAAM,EAAE,KAAK,MAAM,WACnD,CAAC;AAExB;;;;;;;GAOG;AACH,eAAO,MAAM,mCAAmC,GAC9C,kBAAkB,GAAG,CACnB,WAAW,CAAC,0BAA0B,CAAC,CACxC,CAAC,kBAAkB,CAAC;;;aAStB,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe,GAAU,OAAO,MAAM;;;cAUlD,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pagopa/io-react-native-wallet",
3
- "version": "3.5.0",
3
+ "version": "3.6.0",
4
4
  "description": "Provide data structures, helpers and API for IO Wallet",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",
@@ -140,11 +140,11 @@
140
140
  ]
141
141
  },
142
142
  "dependencies": {
143
- "@pagopa/io-wallet-oauth2": "1.5.2",
144
- "@pagopa/io-wallet-oid-federation": "1.5.2",
145
- "@pagopa/io-wallet-oid4vci": "1.5.2",
146
- "@pagopa/io-wallet-oid4vp": "1.5.2",
147
- "@pagopa/io-wallet-utils": "1.5.2",
143
+ "@pagopa/io-wallet-oauth2": "1.5.3",
144
+ "@pagopa/io-wallet-oid-federation": "1.5.3",
145
+ "@pagopa/io-wallet-oid4vci": "1.5.3",
146
+ "@pagopa/io-wallet-oid4vp": "1.5.3",
147
+ "@pagopa/io-wallet-utils": "1.5.3",
148
148
  "@sd-jwt/core": "^0.19.0",
149
149
  "@sd-jwt/crypto-nodejs": "^0.19.0",
150
150
  "@sd-jwt/jwt-status-list": "^0.19.0",
@@ -9,7 +9,7 @@ const DisplayConfig = z.object({
9
9
 
10
10
  const ClaimConfig = z.object({
11
11
  path: z.array(z.union([z.string(), z.number(), z.null()])),
12
- display: z.array(DisplayConfig),
12
+ display: z.array(DisplayConfig).optional(),
13
13
  });
14
14
 
15
15
  const IssuanceErrorSupported = z.object({
@@ -13,6 +13,12 @@ import type { IssuanceApi, IssuerConfig, ParsedCredential } from "../api";
13
13
  type CredentialConf =
14
14
  IssuerConfig["credential_configurations_supported"][string];
15
15
 
16
+ type ClaimConfig = CredentialConf["claims"][number];
17
+
18
+ type DisplayableClaim = Omit<ClaimConfig, "display"> & {
19
+ display: NonNullable<ClaimConfig["display"]>;
20
+ };
21
+
16
22
  type DecodedMDocCredential = Out<typeof verifyMdoc> & {
17
23
  issuerSigned: CBOR.IssuerSigned;
18
24
  };
@@ -75,7 +81,13 @@ const parseCredentialMDoc = (
75
81
  throw new IoWalletError("Missing claims in the credential subject");
76
82
  }
77
83
 
78
- const attrDefinitions = credentialConfig.claims.map<
84
+ // Claims without display property (such as `iat`, `exp`, `iss`, etc.)
85
+ // must be ignored as they are not meant to be displayed to the user.
86
+ const displayableClaims = credentialConfig.claims.filter(
87
+ (c) => c.display !== undefined
88
+ ) as DisplayableClaim[];
89
+
90
+ const attrDefinitions = displayableClaims.map<
79
91
  [string, string, { name: string; locale: string }[]]
80
92
  >(({ path: [namespace, attribute], display }) => [
81
93
  namespace as string,
@@ -183,7 +195,11 @@ export const verifyAndParseCredentialMDoc: IssuanceApi["verifyAndParseCredential
183
195
  issuerConf,
184
196
  credential,
185
197
  credentialConfigurationId,
186
- { credentialCryptoContext, ignoreMissingAttributes },
198
+ {
199
+ credentialCryptoContext,
200
+ ignoreMissingAttributes,
201
+ includeUndefinedAttributes,
202
+ },
187
203
  x509CertRoot
188
204
  ) => {
189
205
  if (!x509CertRoot) {
@@ -204,7 +220,7 @@ export const verifyAndParseCredentialMDoc: IssuanceApi["verifyAndParseCredential
204
220
  credentialConfig,
205
221
  decoded,
206
222
  ignoreMissingAttributes,
207
- ignoreMissingAttributes
223
+ includeUndefinedAttributes
208
224
  );
209
225
 
210
226
  const { signed, validUntil } =
@@ -18,6 +18,12 @@ import type { IssuanceApi, IssuerConfig, ParsedCredential } from "../api";
18
18
  type CredentialConf =
19
19
  IssuerConfig["credential_configurations_supported"][string];
20
20
 
21
+ type ClaimConfig = CredentialConf["claims"][number];
22
+
23
+ type DisplayableClaim = Omit<ClaimConfig, "display"> & {
24
+ display: NonNullable<ClaimConfig["display"]>;
25
+ };
26
+
21
27
  /**
22
28
  * Parse a Sd-Jwt credential according to the issuer configuration
23
29
  * @param credentialConfig - the list of supported credentials, as defined in the issuer configuration with their claims metadata
@@ -32,13 +38,17 @@ const parseCredentialSdJwt = (
32
38
  ignoreMissingAttributes: boolean = false,
33
39
  includeUndefinedAttributes: boolean = false
34
40
  ): ParsedCredential => {
35
- const claimsMetadata = credentialConfig.claims || [];
41
+ // Claims without display property (such as `iat`, `exp`, `iss`, etc.)
42
+ // must be ignored as they are not meant to be displayed to the user.
43
+ const displayableClaims = (credentialConfig.claims || []).filter(
44
+ (c) => c.display !== undefined
45
+ ) as DisplayableClaim[];
36
46
 
37
47
  // Check that all mandatory attributes defined in the issuer configuration are present in the credential
38
48
  if (!ignoreMissingAttributes) {
39
49
  const missingPaths: string[] = [];
40
50
  const rootKeysToVerify = new Set(
41
- claimsMetadata
51
+ displayableClaims
42
52
  .map((c) => c.path[0])
43
53
  .filter((p): p is string => typeof p === "string")
44
54
  );
@@ -64,7 +74,7 @@ const parseCredentialSdJwt = (
64
74
  const getDisplayNames = (
65
75
  path: (string | number | null)[]
66
76
  ): Record<string, string> | undefined => {
67
- const match = claimsMetadata.find((c) => isPathEqual(c.path, path));
77
+ const match = displayableClaims.find((c) => isPathEqual(c.path, path));
68
78
  if (!match) return undefined;
69
79
 
70
80
  const nameMap: Record<string, string> = {};
@@ -99,7 +109,7 @@ const parseCredentialSdJwt = (
99
109
 
100
110
  // Identify unique keys in config at this level
101
111
  const configKeysAtThisLevel: (string | number)[] = [];
102
- for (const claim of claimsMetadata) {
112
+ for (const claim of displayableClaims) {
103
113
  // Check if the claim path starts with the current path
104
114
  if (isPrefixOf(currentPath, claim.path)) {
105
115
  const nextPart = claim.path[currentPath.length];
@@ -25,7 +25,7 @@ const mapCredentialConfigurationsSupported = (
25
25
  claims:
26
26
  config.credential_metadata.claims?.map((claim) => ({
27
27
  path: claim.path,
28
- display: claim.display ?? [],
28
+ display: claim.display,
29
29
  })) ?? [],
30
30
  };
31
31
  return acc;
@@ -31,8 +31,10 @@ graph TD;
31
31
  1[verifyAndParseStatusAssertion]
32
32
  2[getStatusList]
33
33
  3[verifyAndParseStatusList]
34
+ 4[getStatus]
34
35
  0 --> 1
35
36
  2 --> 3
37
+ 3 --> 4
36
38
  ```
37
39
 
38
40
  ## Mapped results
@@ -104,24 +106,24 @@ const credentialIssuerUrl = "https://issuer.example.com";
104
106
 
105
107
  const { issuerConf } = await wallet.CredentialIssuance.evaluateIssuerTrust(credentialIssuerUrl);
106
108
 
107
- // Get the status list
108
- const res = await wallet.CredentialStatus.statusList.get(
109
- credential,
110
- format,
109
+ // Get the status list token and credential reference index
110
+ const { statusList: statusListJwt, idx } =
111
+ await wallet.CredentialStatus.statusList.get(credential, format);
112
+
113
+ // Verify and parse the status list token
114
+ const statusList = await wallet.CredentialStatus.statusList.verifyAndParse(
115
+ issuerConf.keys,
116
+ statusListJwt,
111
117
  );
112
118
 
113
- // Verify and parse the status list response to get the credential status
114
- const { status, statusBit } =
115
- await wallet.CredentialStatus.statusList.verifyAndParse(
116
- issuerConf.keys,
117
- res
118
- );
119
+ // Read the credential status from the decoded status list
120
+ const { status, rawStatus } = wallet.CredentialStatus.statusList.getStatus(statusList, idx);
119
121
 
120
122
  return {
121
- statusList: res.statusList,
123
+ statusList,
122
124
  status,
123
- statusBit,
125
+ rawStatus,
124
126
  };
125
127
  ```
126
128
 
127
- </details>
129
+ </details>
@@ -12,7 +12,9 @@ interface UnsupportedApi {
12
12
  *
13
13
  * @example
14
14
  * if (CredentialStatus.statusList.isSupported) {
15
- * const statusList = await CredentialStatus.statusList.get(credential, format)
15
+ * const { statusList: statusListJwt, idx } = await CredentialStatus.statusList.get(credential, format)
16
+ * const statusList = await CredentialStatus.statusList.verifyAndParse(keys, statusListJwt)
17
+ * const status = CredentialStatus.statusList.getStatus(statusList, idx)
16
18
  * }
17
19
  */
18
20
  export interface CredentialStatusApi {
@@ -38,7 +38,7 @@ export interface StatusAssertionApi {
38
38
  * - The assertion is correctly signed;
39
39
  * - It's bound to the given key.
40
40
  * @since 1.0.0
41
- * @deprecated since 1.3.3 - Use `statusList.verifyAndParse`
41
+ * @deprecated since 1.3.3 - Use `statusList.get`, `statusList.verifyAndParse` and `statusList.getStatus`
42
42
  *
43
43
  * @param issuerConf The Issuer configuration returned by `evaluateIssuerTrust`
44
44
  * @param statusAssertion The encoded status assertion returned by `statusAssertion.get`
@@ -1,12 +1,12 @@
1
- import type { Out } from "../../../utils/misc";
2
1
  import type { CredentialFormat } from "../../../credential/issuance/api";
3
2
  import type { JWK } from "../../../utils/jwk";
3
+ import type { StatusList } from "./types";
4
4
 
5
5
  export interface StatusListApi {
6
6
  isSupported: true;
7
7
 
8
8
  /**
9
- * Get the status list from the credential. This function fetches the list
9
+ * Get the status list token referenced by a credential. This function fetches the list
10
10
  * from the uri found in the credential's `status` claim.
11
11
  * @example
12
12
  * {
@@ -21,7 +21,7 @@ export interface StatusListApi {
21
21
  * @param credential The credential to get the status list for
22
22
  * @param format The credential format
23
23
  * @param context.appFetch Optional fetch function to use for the network request
24
- * @returns The raw status list, the index of the credential and other metadata
24
+ * @returns The encoded status list token with its credential reference metadata
25
25
  */
26
26
  get(
27
27
  credential: string,
@@ -37,17 +37,40 @@ export interface StatusListApi {
37
37
  }>;
38
38
 
39
39
  /**
40
- * Verifies the signature of a status list and extract the status at the specified index.
40
+ * Get a status list token from its uri.
41
+ * @since 1.3.3
42
+ * @param uri The status list uri
43
+ * @param context.appFetch Optional fetch function to use for the network request
44
+ * @returns The encoded status list token
45
+ */
46
+ getByUri(
47
+ uri: string,
48
+ context?: {
49
+ appFetch?: GlobalFetch["fetch"];
50
+ }
51
+ ): Promise<string>;
52
+
53
+ /**
54
+ * Verifies the signature of a status list token and parses its payload.
41
55
  * @since 1.3.3
42
56
  * @param keys The JSON Web Key Set to verify the status list signature
43
- * @param statusListParams The raw status list, the index to read and other metadata
44
- * @return The status of the credential and the raw status bit in hexadecimal format (e.g. "0x01")
57
+ * @param statusList The encoded status list token
58
+ * @returns The decoded status list payload
45
59
  */
46
- verifyAndParse(
47
- keys: JWK[],
48
- statusListParams: Out<StatusListApi["get"]>
49
- ): Promise<{
50
- statusBit: string;
60
+ verifyAndParse(keys: JWK[], statusList: string): Promise<StatusList>;
61
+
62
+ /**
63
+ * Extracts the status at the specified index from a decoded status list.
64
+ * @since 1.3.3
65
+ * @param statusList The decoded status list
66
+ * @param idx The index to read
67
+ * @return The status of the credential and the raw status in hexadecimal format (e.g. "0x01")
68
+ */
69
+ getStatus(
70
+ statusList: StatusList["status_list"],
71
+ idx: number
72
+ ): {
73
+ rawStatus: string;
51
74
  status: string;
52
- }>;
75
+ };
53
76
  }
@@ -1,3 +1,6 @@
1
+ import { z } from "zod";
2
+ import { UnixTime } from "../../../utils/zod";
3
+
1
4
  /**
2
5
  * Common type for a parsed Status Assertion
3
6
  */
@@ -13,3 +16,27 @@ export type ParsedStatusAssertion = {
13
16
  description: string;
14
17
  };
15
18
  };
19
+
20
+ const StatusListBits = z.union([
21
+ z.literal(1),
22
+ z.literal(2),
23
+ z.literal(4),
24
+ z.literal(8),
25
+ ]);
26
+
27
+ export type StatusListContent = z.infer<typeof StatusListContent>;
28
+ export const StatusListContent = z.object({
29
+ bits: StatusListBits,
30
+ lst: z.string().min(1),
31
+ aggregation_uri: z.url().optional(),
32
+ });
33
+
34
+ export type StatusList = z.infer<typeof StatusList>;
35
+ export const StatusList = z.object({
36
+ sub: z.url(),
37
+ iat: UnixTime,
38
+ iss: z.url().optional(),
39
+ exp: UnixTime.optional(),
40
+ ttl: z.number().positive().optional(),
41
+ status_list: StatusListContent,
42
+ });
@@ -32,25 +32,26 @@ const getStatusListEntry = async (
32
32
  return statusListEntry;
33
33
  };
34
34
 
35
- export const getStatusList: StatusListApi["get"] = async (
36
- credential,
37
- format,
35
+ const fetchStatusList = (
36
+ uri: string,
37
+ appFetch: GlobalFetch["fetch"],
38
+ options: { cacheDisabled?: boolean } = {}
39
+ ) =>
40
+ appFetch(uri, {
41
+ headers: {
42
+ Accept: "application/statuslist+jwt",
43
+ ...(options.cacheDisabled && { "Cache-Control": "no-cache" }),
44
+ },
45
+ })
46
+ .then(hasStatusOrThrow(200))
47
+ .then((response) => response.text());
48
+
49
+ export const getStatusListByUri: StatusListApi["getByUri"] = async (
50
+ uri,
38
51
  { appFetch = fetch } = {}
39
52
  ) => {
40
- const { uri, idx } = await getStatusListEntry(credential, format);
41
-
42
- const fetchStatusList = (options: { cacheDisabled?: boolean } = {}) =>
43
- appFetch(uri, {
44
- headers: {
45
- Accept: "application/statuslist+jwt",
46
- ...(options.cacheDisabled && { "Cache-Control": "no-cache" }),
47
- },
48
- })
49
- .then(hasStatusOrThrow(200))
50
- .then((response) => response.text());
51
-
52
53
  // When the HTTP response includes cache headers, fetch will return a cached response and the JWT might be expired
53
- let statusList = await fetchStatusList();
54
+ let statusList = await fetchStatusList(uri, appFetch);
54
55
  const decoded = decodeJwt(statusList);
55
56
 
56
57
  const { exp } = decoded.payload;
@@ -58,7 +59,18 @@ export const getStatusList: StatusListApi["get"] = async (
58
59
  // If the status list JWT is expired, try to fetch it again bypassing the HTTP cache.
59
60
  // If it is still expired after the refetch, `verifyAndParseStatusList` will throw.
60
61
  if (exp && exp < Math.floor(Date.now() / 1000)) {
61
- statusList = await fetchStatusList({ cacheDisabled: true });
62
+ statusList = await fetchStatusList(uri, appFetch, { cacheDisabled: true });
62
63
  }
63
- return { statusList, uri, idx, format: "jwt" };
64
+
65
+ return statusList;
66
+ };
67
+
68
+ export const getStatusList: StatusListApi["get"] = async (
69
+ credential,
70
+ format,
71
+ context
72
+ ) => {
73
+ const { uri, idx } = await getStatusListEntry(credential, format);
74
+ const statusList = await getStatusListByUri(uri, context);
75
+ return { uri, idx, statusList, format: "jwt" };
64
76
  };
@@ -1,33 +1,11 @@
1
- import { verify } from "@pagopa/io-react-native-jwt";
2
- import { getListFromStatusListJWT } from "@sd-jwt/jwt-status-list";
1
+ import { decode as decodeJwt, verify } from "@pagopa/io-react-native-jwt";
3
2
  import type { StatusListApi } from "../api/status-list";
4
-
5
- /**
6
- * Mapping of status bits to their corresponding meaning as defined in the specification.
7
- * @see https://italia.github.io/eid-wallet-it-docs/releases/1.3.3/en/credential-revocation.html#token-status-lists
8
- */
9
- const CredentialStatusMap = {
10
- 0x00: "VALID",
11
- 0x01: "INVALID",
12
- 0x02: "SUSPENDED",
13
- 0x03: "UPDATE",
14
- 0x0b: "ATTRIBUTE_UPDATE",
15
- } as const;
16
-
17
- type CredentialStatusBit = keyof typeof CredentialStatusMap;
3
+ import { StatusList } from "../api/types";
18
4
 
19
5
  export const verifyAndParseStatusList: StatusListApi["verifyAndParse"] = async (
20
6
  keys,
21
- { statusList: rawStatusList, idx }
7
+ statusList
22
8
  ) => {
23
- await verify(rawStatusList, keys);
24
-
25
- const statusList = getListFromStatusListJWT(rawStatusList);
26
- const statusBit = statusList.getStatus(idx) as CredentialStatusBit;
27
- const status = CredentialStatusMap[statusBit];
28
-
29
- return {
30
- status,
31
- statusBit: `0x${statusBit.toString(16).padStart(2, "0").toUpperCase()}`,
32
- };
9
+ await verify(statusList, keys);
10
+ return StatusList.parse(decodeJwt(statusList).payload);
33
11
  };
@@ -0,0 +1,40 @@
1
+ import { StatusList as JwtStatusList } from "@sd-jwt/jwt-status-list";
2
+ import { IoWalletError } from "../../../utils/errors";
3
+ import type { StatusListApi } from "../api/status-list";
4
+
5
+ /**
6
+ * Mapping of status bits to their corresponding meaning as defined in the specification.
7
+ * @see https://italia.github.io/eid-wallet-it-docs/releases/1.3.3/en/credential-revocation.html#token-status-lists
8
+ */
9
+ const CredentialStatusMap = {
10
+ 0x00: "VALID",
11
+ 0x01: "INVALID",
12
+ 0x02: "SUSPENDED",
13
+ 0x03: "UPDATE",
14
+ 0x0b: "ATTRIBUTE_UPDATE",
15
+ } as const;
16
+
17
+ type CredentialStatusBit = keyof typeof CredentialStatusMap;
18
+
19
+ const formatStatusBit = (statusBit: number) =>
20
+ `0x${statusBit.toString(16).padStart(2, "0").toUpperCase()}`;
21
+
22
+ export const getStatus: StatusListApi["getStatus"] = (statusList, idx) => {
23
+ const decodedStatusList = JwtStatusList.decompressStatusList(
24
+ statusList.lst,
25
+ statusList.bits
26
+ );
27
+ const statusBit = decodedStatusList.getStatus(idx) as CredentialStatusBit;
28
+ const status = CredentialStatusMap[statusBit];
29
+
30
+ if (!status) {
31
+ throw new IoWalletError(
32
+ `Unsupported credential status bit: ${formatStatusBit(statusBit)}`
33
+ );
34
+ }
35
+
36
+ return {
37
+ status,
38
+ rawStatus: formatStatusBit(statusBit),
39
+ };
40
+ };
@@ -1,6 +1,7 @@
1
1
  import type { CredentialStatusApi } from "../api";
2
- import { getStatusList } from "./01-status-list";
2
+ import { getStatusList, getStatusListByUri } from "./01-status-list";
3
3
  import { verifyAndParseStatusList } from "./02-verify-and-parse-status-list";
4
+ import { getStatus } from "./03-get-status";
4
5
 
5
6
  export const CredentialStatus: CredentialStatusApi = {
6
7
  statusAssertion: {
@@ -9,6 +10,8 @@ export const CredentialStatus: CredentialStatusApi = {
9
10
  statusList: {
10
11
  isSupported: true,
11
12
  get: getStatusList,
13
+ getByUri: getStatusListByUri,
12
14
  verifyAndParse: verifyAndParseStatusList,
15
+ getStatus,
13
16
  },
14
17
  };
@@ -115,6 +115,7 @@ export const DigitalCredential = z.object({
115
115
  purposes: z.array(z.union([z.string(), CredentialPurpose])),
116
116
  issuers: z.array(CredentialIssuer),
117
117
  authentic_sources: z.array(AuthenticSource),
118
+ parent_credentials: z.array(z.string()).optional(),
118
119
  formats: z.array(CredentialFormat).optional(),
119
120
  // claims: z.array(Claim), // TODO: [SIW-3978] Should we keep claims?
120
121
  });