@openid4vc/openid4vp 0.3.0-alpha-20250320210854 → 0.3.0-alpha-20250320222745

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.
package/dist/index.mjs CHANGED
@@ -6,7 +6,7 @@ import { URL as URL2 } from "@openid4vc/utils";
6
6
  import { z as z5 } from "zod";
7
7
 
8
8
  // src/authorization-request/z-authorization-request.ts
9
- import { URL, zHttpsUrl as zHttpsUrl2 } from "@openid4vc/utils";
9
+ import { URL, zHttpsUrl as zHttpsUrl2, zStringToJson } from "@openid4vc/utils";
10
10
  import { z as z4 } from "zod";
11
11
 
12
12
  // src/models/z-client-metadata.ts
@@ -100,17 +100,6 @@ var zClientMetadata = z3.object({
100
100
  }).passthrough();
101
101
 
102
102
  // src/authorization-request/z-authorization-request.ts
103
- var zStringToJson = z4.string().transform((string, ctx) => {
104
- try {
105
- return JSON.parse(string);
106
- } catch (error) {
107
- ctx.addIssue({
108
- code: "custom",
109
- message: "Expected a JSON string, but could not parse the string to JSON"
110
- });
111
- return z4.NEVER;
112
- }
113
- });
114
103
  var zOpenid4vpAuthorizationRequest = z4.object({
115
104
  response_type: z4.literal("vp_token"),
116
105
  client_id: z4.string(),
@@ -1506,6 +1495,7 @@ import { Oauth2ServerErrorResponseError as Oauth2ServerErrorResponseError12 } fr
1506
1495
  import { parseWithErrorHandling as parseWithErrorHandling6 } from "@openid4vc/utils";
1507
1496
 
1508
1497
  // src/authorization-response/z-authorization-response.ts
1498
+ import { zStringToJson as zStringToJson2 } from "@openid4vc/utils";
1509
1499
  import { z as z18 } from "zod";
1510
1500
 
1511
1501
  // src/models/z-pex.ts
@@ -1518,7 +1508,7 @@ var zOpenid4vpAuthorizationResponse = z18.object({
1518
1508
  state: z18.string().optional(),
1519
1509
  id_token: z18.string().optional(),
1520
1510
  vp_token: zVpToken,
1521
- presentation_submission: zPexPresentationSubmission.optional(),
1511
+ presentation_submission: zPexPresentationSubmission.or(zStringToJson2).optional(),
1522
1512
  refresh_token: z18.string().optional(),
1523
1513
  token_type: z18.string().optional(),
1524
1514
  access_token: z18.string().optional(),