@openid4vc/openid4vp 0.3.0-alpha-20251017121147 → 0.3.0-alpha-20251017122507
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.d.mts +1908 -30646
- package/dist/index.d.ts +1909 -30647
- package/dist/index.js +37 -37
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +37 -37
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -217,27 +217,27 @@ const zJarmClientMetadataParsed = zJarmClientMetadata.transform((client_metadata
|
|
|
217
217
|
//#region src/models/z-vp-formats-supported.ts
|
|
218
218
|
const zVpFormatsSupported = zod.z.object({
|
|
219
219
|
"dc+sd-jwt": zod.z.optional(zod.z.object({
|
|
220
|
-
"sd-jwt_alg_values": zod.z.optional(zod.z.
|
|
221
|
-
"kb-jwt_alg_values": zod.z.optional(zod.z.
|
|
222
|
-
}).
|
|
223
|
-
jwt_vc_json: zod.z.optional(zod.z.object({ alg_values: zod.z.optional(zod.z.
|
|
220
|
+
"sd-jwt_alg_values": zod.z.optional(zod.z.tuple([zod.z.string()], zod.z.string())),
|
|
221
|
+
"kb-jwt_alg_values": zod.z.optional(zod.z.tuple([zod.z.string()], zod.z.string()))
|
|
222
|
+
}).loose()),
|
|
223
|
+
jwt_vc_json: zod.z.optional(zod.z.object({ alg_values: zod.z.optional(zod.z.tuple([zod.z.string()], zod.z.string())) }).loose()),
|
|
224
224
|
ldp_vc: zod.z.optional(zod.z.object({
|
|
225
|
-
proof_type_values: zod.z.optional(zod.z.
|
|
226
|
-
cryptosuite_values: zod.z.optional(zod.z.
|
|
227
|
-
}).
|
|
225
|
+
proof_type_values: zod.z.optional(zod.z.tuple([zod.z.string()], zod.z.string())),
|
|
226
|
+
cryptosuite_values: zod.z.optional(zod.z.tuple([zod.z.string()], zod.z.string()))
|
|
227
|
+
}).loose()),
|
|
228
228
|
mso_mdoc: zod.z.optional(zod.z.object({
|
|
229
|
-
issuer_signed_alg_values: zod.z.optional(zod.z.
|
|
230
|
-
device_signed_alg_values: zod.z.optional(zod.z.
|
|
231
|
-
issuerauth_alg_values: zod.z.optional(zod.z.
|
|
232
|
-
deviceauth_alg_values: zod.z.optional(zod.z.
|
|
233
|
-
}).
|
|
234
|
-
}).
|
|
235
|
-
const zLegacyVpFormats = zod.z.record(zod.z.string(), zod.z.object({ alg_values_supported: zod.z.optional(zod.z.array(zod.z.string())) }).
|
|
229
|
+
issuer_signed_alg_values: zod.z.optional(zod.z.tuple([zod.z.number()], zod.z.number())),
|
|
230
|
+
device_signed_alg_values: zod.z.optional(zod.z.tuple([zod.z.number()], zod.z.number())),
|
|
231
|
+
issuerauth_alg_values: zod.z.optional(zod.z.tuple([zod.z.number()], zod.z.number())),
|
|
232
|
+
deviceauth_alg_values: zod.z.optional(zod.z.tuple([zod.z.number()], zod.z.number()))
|
|
233
|
+
}).loose())
|
|
234
|
+
}).loose().catchall(zod.z.object({}).loose());
|
|
235
|
+
const zLegacyVpFormats = zod.z.record(zod.z.string(), zod.z.object({ alg_values_supported: zod.z.optional(zod.z.array(zod.z.string())) }).loose());
|
|
236
236
|
|
|
237
237
|
//#endregion
|
|
238
238
|
//#region src/models/z-client-metadata.ts
|
|
239
239
|
const zClientMetadata = zod.z.object({
|
|
240
|
-
jwks_uri: zod.z.
|
|
240
|
+
jwks_uri: zod.z.url().optional(),
|
|
241
241
|
jwks: zod.z.optional(__openid4vc_oauth2.zJwkSet),
|
|
242
242
|
vp_formats: zod.z.optional(zLegacyVpFormats),
|
|
243
243
|
vp_formats_supported: zod.z.optional(zVpFormatsSupported),
|
|
@@ -245,13 +245,13 @@ const zClientMetadata = zod.z.object({
|
|
|
245
245
|
...zJarmClientMetadata.shape,
|
|
246
246
|
logo_uri: __openid4vc_utils.zHttpsUrl.optional(),
|
|
247
247
|
client_name: zod.z.string().optional()
|
|
248
|
-
}).
|
|
248
|
+
}).loose();
|
|
249
249
|
|
|
250
250
|
//#endregion
|
|
251
251
|
//#region src/models/z-verifier-attestations.ts
|
|
252
252
|
const zVerifierAttestation = zod.default.object({
|
|
253
253
|
format: zod.default.string(),
|
|
254
|
-
data: zod.default.record(zod.default.unknown()).or(zod.default.string()),
|
|
254
|
+
data: zod.default.record(zod.default.string(), zod.default.unknown()).or(zod.default.string()),
|
|
255
255
|
credential_ids: zod.default.array(zod.default.string()).optional()
|
|
256
256
|
});
|
|
257
257
|
const zVerifierAttestations = zod.default.array(zVerifierAttestation);
|
|
@@ -269,14 +269,14 @@ const zOpenid4vpAuthorizationRequest = zod.z.object({
|
|
|
269
269
|
nonce: zod.z.string(),
|
|
270
270
|
wallet_nonce: zod.z.string().optional(),
|
|
271
271
|
scope: zod.z.string().optional(),
|
|
272
|
-
presentation_definition: zod.z.record(zod.z.any()).or(__openid4vc_utils.zStringToJson).optional(),
|
|
272
|
+
presentation_definition: zod.z.record(zod.z.string(), zod.z.any()).or(__openid4vc_utils.zStringToJson).optional(),
|
|
273
273
|
presentation_definition_uri: __openid4vc_utils.zHttpsUrl.optional(),
|
|
274
|
-
dcql_query: zod.z.record(zod.z.any()).or(__openid4vc_utils.zStringToJson).optional(),
|
|
274
|
+
dcql_query: zod.z.record(zod.z.string(), zod.z.any()).or(__openid4vc_utils.zStringToJson).optional(),
|
|
275
275
|
client_metadata: zClientMetadata.optional(),
|
|
276
276
|
client_metadata_uri: __openid4vc_utils.zHttpsUrl.optional(),
|
|
277
277
|
state: zod.z.string().optional(),
|
|
278
|
-
transaction_data: zod.z.array(zod.z.
|
|
279
|
-
trust_chain: zod.z.
|
|
278
|
+
transaction_data: zod.z.array(zod.z.base64url()).optional(),
|
|
279
|
+
trust_chain: zod.z.tuple([zod.z.string()], zod.z.string()).optional(),
|
|
280
280
|
client_id_scheme: zod.z.enum([
|
|
281
281
|
"pre-registered",
|
|
282
282
|
"redirect_uri",
|
|
@@ -289,15 +289,15 @@ const zOpenid4vpAuthorizationRequest = zod.z.object({
|
|
|
289
289
|
]).optional(),
|
|
290
290
|
verifier_attestations: zVerifierAttestations.optional(),
|
|
291
291
|
verifier_info: zVerifierAttestations.optional()
|
|
292
|
-
}).
|
|
293
|
-
const zOpenid4vpAuthorizationRequestFromUriParams = zod.z.
|
|
292
|
+
}).loose();
|
|
293
|
+
const zOpenid4vpAuthorizationRequestFromUriParams = zod.z.url().transform((url) => Object.fromEntries(new __openid4vc_utils.URL(url).searchParams)).pipe(zod.z.object({
|
|
294
294
|
presentation_definition: __openid4vc_utils.zStringToJson.optional(),
|
|
295
295
|
client_metadata: __openid4vc_utils.zStringToJson.optional(),
|
|
296
296
|
dcql_query: __openid4vc_utils.zStringToJson.optional(),
|
|
297
297
|
transaction_data: __openid4vc_utils.zStringToJson.optional(),
|
|
298
298
|
verifier_attestations: __openid4vc_utils.zStringToJson.optional(),
|
|
299
299
|
verifier_info: __openid4vc_utils.zStringToJson.optional()
|
|
300
|
-
}).
|
|
300
|
+
}).loose());
|
|
301
301
|
|
|
302
302
|
//#endregion
|
|
303
303
|
//#region src/authorization-request/z-authorization-request-dc-api.ts
|
|
@@ -414,7 +414,7 @@ const zJarAuthorizationRequest = zod.z.object({
|
|
|
414
414
|
request_uri: zod.z.optional(__openid4vc_utils.zHttpsUrl),
|
|
415
415
|
request_uri_method: zod.z.optional(zod.z.string()),
|
|
416
416
|
client_id: zod.z.optional(zod.z.string())
|
|
417
|
-
}).
|
|
417
|
+
}).loose();
|
|
418
418
|
function validateJarRequestParams(options) {
|
|
419
419
|
const { jarRequestParams } = options;
|
|
420
420
|
if (jarRequestParams.request && jarRequestParams.request_uri) throw new __openid4vc_oauth2.Oauth2ServerErrorResponseError({
|
|
@@ -883,7 +883,7 @@ async function fetchJarRequestObject(options) {
|
|
|
883
883
|
const zJarRequestObjectPayload = zod.z.object({
|
|
884
884
|
...__openid4vc_oauth2.zJwtPayload.shape,
|
|
885
885
|
client_id: zod.z.string()
|
|
886
|
-
}).
|
|
886
|
+
}).loose();
|
|
887
887
|
|
|
888
888
|
//#endregion
|
|
889
889
|
//#region src/jar/handle-jar-request/verify-jar-request.ts
|
|
@@ -1031,9 +1031,9 @@ async function verifyJarRequestObject(options) {
|
|
|
1031
1031
|
//#region src/transaction-data/z-transaction-data.ts
|
|
1032
1032
|
const zTransactionEntry = zod.z.object({
|
|
1033
1033
|
type: zod.z.string(),
|
|
1034
|
-
credential_ids: zod.z.
|
|
1035
|
-
transaction_data_hashes_alg: zod.z.
|
|
1036
|
-
}).
|
|
1034
|
+
credential_ids: zod.z.tuple([zod.z.string()], zod.z.string()),
|
|
1035
|
+
transaction_data_hashes_alg: zod.z.tuple([zod.z.string()], zod.z.string()).optional()
|
|
1036
|
+
}).loose();
|
|
1037
1037
|
const zTransactionData = zod.z.array(zTransactionEntry);
|
|
1038
1038
|
|
|
1039
1039
|
//#endregion
|
|
@@ -1316,14 +1316,14 @@ async function createOpenid4vpAuthorizationResponse(options) {
|
|
|
1316
1316
|
|
|
1317
1317
|
//#endregion
|
|
1318
1318
|
//#region src/models/z-pex.ts
|
|
1319
|
-
const zPexPresentationDefinition = zod.z.record(zod.z.any());
|
|
1320
|
-
const zPexPresentationSubmission = zod.z.record(zod.z.any());
|
|
1319
|
+
const zPexPresentationDefinition = zod.z.record(zod.z.string(), zod.z.any());
|
|
1320
|
+
const zPexPresentationSubmission = zod.z.record(zod.z.string(), zod.z.any());
|
|
1321
1321
|
|
|
1322
1322
|
//#endregion
|
|
1323
1323
|
//#region src/vp-token/z-vp-token.ts
|
|
1324
|
-
const zVpTokenPresentationEntry = zod.z.union([zod.z.string(), zod.z.record(zod.z.any())], { message: "vp_token presentation entry must be string or object" });
|
|
1325
|
-
const zVpTokenPex = zod.z.union([zVpTokenPresentationEntry, zod.z.
|
|
1326
|
-
const zVpTokenDcql = zod.z.record(zod.z.union([zod.z.
|
|
1324
|
+
const zVpTokenPresentationEntry = zod.z.union([zod.z.string(), zod.z.record(zod.z.string(), zod.z.any())], { message: "vp_token presentation entry must be string or object" });
|
|
1325
|
+
const zVpTokenPex = zod.z.union([zVpTokenPresentationEntry, zod.z.tuple([zVpTokenPresentationEntry], zVpTokenPresentationEntry, "Must have at least entry in vp_token array")], { message: "pex vp_token must be a string, object or non-empty array of strings and objects" });
|
|
1326
|
+
const zVpTokenDcql = zod.z.record(zod.z.string(), zod.z.union([zod.z.tuple([zVpTokenPresentationEntry], zVpTokenPresentationEntry), zVpTokenPresentationEntry]), { message: "dcql vp_token must be an object with keys referencing the dcql credential query id, and values a non-empty array of strings and objects, or string, or object" });
|
|
1327
1327
|
const zVpToken = zVpTokenDcql.or(zVpTokenPex);
|
|
1328
1328
|
|
|
1329
1329
|
//#endregion
|
|
@@ -1337,7 +1337,7 @@ const zOpenid4vpAuthorizationResponse = zod.z.object({
|
|
|
1337
1337
|
token_type: zod.z.string().optional(),
|
|
1338
1338
|
access_token: zod.z.string().optional(),
|
|
1339
1339
|
expires_in: zod.z.coerce.number().optional()
|
|
1340
|
-
}).
|
|
1340
|
+
}).loose();
|
|
1341
1341
|
|
|
1342
1342
|
//#endregion
|
|
1343
1343
|
//#region src/authorization-response/parse-authorization-response-payload.ts
|
|
@@ -1360,11 +1360,11 @@ const zJarmAuthorizationResponse = zod.z.object({
|
|
|
1360
1360
|
exp: true
|
|
1361
1361
|
}).required().shape,
|
|
1362
1362
|
state: zod.z.optional(zod.z.string())
|
|
1363
|
-
}).
|
|
1363
|
+
}).loose();
|
|
1364
1364
|
const zJarmAuthorizationResponseEncryptedOnly = zod.z.object({
|
|
1365
1365
|
...__openid4vc_oauth2.zJwtPayload.shape,
|
|
1366
1366
|
state: zod.z.optional(zod.z.string())
|
|
1367
|
-
}).
|
|
1367
|
+
}).loose();
|
|
1368
1368
|
|
|
1369
1369
|
//#endregion
|
|
1370
1370
|
//#region src/jarm/jarm-authorization-response/jarm-validate-authorization-response.ts
|