dcql 0.5.0-alpha-20250718124032 → 0.5.0-alpha-20250724114402
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 +995 -1331
- package/dist/index.d.ts +995 -1331
- package/dist/index.js +67 -44
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +67 -44
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
@@ -185,8 +185,11 @@ function isNonEmptyArray(array8) {
|
|
185
185
|
}
|
186
186
|
var vNonEmptyArray = (item) => {
|
187
187
|
return v.pipe(
|
188
|
-
v.array(item),
|
189
|
-
v.custom(
|
188
|
+
v.array(item, (i) => `Expected input to be an array, but received '${i.received}'`),
|
189
|
+
v.custom(
|
190
|
+
(input) => input.length > 0,
|
191
|
+
"Array must be non-empty and have length of at least 1"
|
192
|
+
)
|
190
193
|
);
|
191
194
|
};
|
192
195
|
var vIncludesAll = (subset) => {
|
@@ -261,60 +264,71 @@ var vStringToJson = v.rawTransform(({ dataset, addIssue, NEVER }) => {
|
|
261
264
|
});
|
262
265
|
|
263
266
|
// src/dcql-query/m-dcql-trusted-authorities.ts
|
264
|
-
var getTrustedAuthorityParser = (trustedAuthority) => v2.
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
value: v2.union(
|
271
|
-
trustedAuthority.values.map(
|
272
|
-
(value) => v2.literal(
|
273
|
-
value,
|
274
|
-
(i) => `Expected trusted authority value to be '${value}' but received ${typeof i.input === "string" ? `'${i.input}'` : i.input}`
|
275
|
-
)
|
267
|
+
var getTrustedAuthorityParser = (trustedAuthority) => v2.pipe(
|
268
|
+
v2.object(
|
269
|
+
{
|
270
|
+
type: v2.literal(
|
271
|
+
trustedAuthority.type,
|
272
|
+
(i) => `Expected trusted authority type to be '${trustedAuthority.type}' but received ${typeof i.input === "string" ? `'${i.input}'` : i.input}`
|
276
273
|
),
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
274
|
+
// Some trusted authorities support an array as input type
|
275
|
+
values: v2.pipe(
|
276
|
+
vNonEmptyArray(v2.string()),
|
277
|
+
v2.someItem(
|
278
|
+
(item) => trustedAuthority.values.includes(item),
|
279
|
+
(i) => `Expected one of the trusted authority values to be '${trustedAuthority.values.join("' | '")}' but received '${i.input.join("' , '")}'`
|
280
|
+
)
|
281
|
+
)
|
282
|
+
},
|
283
|
+
`Expected trusted authority object with type '${trustedAuthority.type}' to be defined, but received undefined`
|
284
|
+
),
|
285
|
+
v2.transform(({ values, ...rest }) => ({
|
286
|
+
...rest,
|
287
|
+
value: values.find((value) => trustedAuthority.values.includes(value))
|
288
|
+
}))
|
281
289
|
);
|
282
290
|
var vAuthorityKeyIdentifier = v2.object({
|
283
291
|
type: v2.literal("aki"),
|
284
|
-
|
285
|
-
v2.
|
286
|
-
|
287
|
-
|
288
|
-
|
292
|
+
values: vNonEmptyArray(
|
293
|
+
v2.pipe(
|
294
|
+
v2.string("aki trusted authority value must be a string"),
|
295
|
+
vBase64url,
|
296
|
+
v2.description(
|
297
|
+
"Contains a list of KeyIdentifier entries of the AuthorityKeyIdentifier as defined in Section 4.2.1.1 of [RFC5280], encoded as base64url. The raw byte representation of one of the elements MUST match with the AuthorityKeyIdentifier element of an X.509 certificate in the certificate chain present in the credential (e.g., in the header of an mdoc or SD-JWT). Note that the chain can consist of a single certificate and the credential can include the entire X.509 chain or parts of it."
|
298
|
+
)
|
289
299
|
)
|
290
300
|
)
|
291
301
|
});
|
292
302
|
var vEtsiTrustedList = v2.object({
|
293
303
|
type: v2.literal("etsi_tl"),
|
294
|
-
|
295
|
-
v2.
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
304
|
+
values: vNonEmptyArray(
|
305
|
+
v2.pipe(
|
306
|
+
v2.string("etsi_tl trusted authority value must be a string"),
|
307
|
+
v2.url("etsi_tl trusted authority value must be a valid https url"),
|
308
|
+
v2.check(
|
309
|
+
(url2) => url2.startsWith("http://") || url2.startsWith("https://"),
|
310
|
+
"etsi_tl trusted authority value must be a valid https url"
|
311
|
+
),
|
312
|
+
v2.description(
|
313
|
+
"The identifier of a Trusted List as specified in ETSI TS 119 612 [ETSI.TL]. An ETSI Trusted List contains references to other Trusted Lists, creating a list of trusted lists, or entries for Trust Service Providers with corresponding service description and X.509 Certificates. The trust chain of a matching Credential MUST contain at least one X.509 Certificate that matches one of the entries of the Trusted List or its cascading Trusted Lists."
|
314
|
+
)
|
303
315
|
)
|
304
316
|
)
|
305
317
|
});
|
306
318
|
var vOpenidFederation = v2.object({
|
307
319
|
type: v2.literal("openid_federation"),
|
308
|
-
|
309
|
-
v2.
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
320
|
+
values: vNonEmptyArray(
|
321
|
+
v2.pipe(
|
322
|
+
v2.string("openid_federation trusted authority value must be a string"),
|
323
|
+
v2.url("openid_federation trusted authority value must be a valid https url"),
|
324
|
+
// TODO: should we have a config similar to oid4vc-ts to support http for development?
|
325
|
+
v2.check(
|
326
|
+
(url2) => url2.startsWith("http://") || url2.startsWith("https://"),
|
327
|
+
"openid_federation trusted authority value must be a valid https url"
|
328
|
+
),
|
329
|
+
v2.description(
|
330
|
+
"The Entity Identifier as defined in Section 1 of [OpenID.Federation] that is bound to an entity in a federation. While this Entity Identifier could be any entity in that ecosystem, this entity would usually have the Entity Configuration of a Trust Anchor. A valid trust path, including the given Entity Identifier, must be constructible from a matching credential."
|
331
|
+
)
|
318
332
|
)
|
319
333
|
)
|
320
334
|
});
|
@@ -330,7 +344,7 @@ var DcqlTrustedAuthoritiesQuery;
|
|
330
344
|
)
|
331
345
|
),
|
332
346
|
values: v2.pipe(
|
333
|
-
vNonEmptyArray(authority.entries.
|
347
|
+
vNonEmptyArray(authority.entries.values.item),
|
334
348
|
v2.description(
|
335
349
|
"REQUIRED. An array of strings, where each string (value) contains information specific to the used Trusted Authorities Query type that allows to identify an issuer, trust framework, or a federation that an issuer belongs to."
|
336
350
|
)
|
@@ -1216,7 +1230,16 @@ var DcqlTrustedAuthoritiesResult;
|
|
1216
1230
|
DcqlTrustedAuthoritiesResult2.vTrustedAuthorityEntrySuccessResult = v14.object({
|
1217
1231
|
success: v14.literal(true),
|
1218
1232
|
trusted_authority_index: v14.number(),
|
1219
|
-
|
1233
|
+
// We map from values (multiple options for a credential/query) to value (the matching option)
|
1234
|
+
output: v14.variant(
|
1235
|
+
"type",
|
1236
|
+
DcqlCredentialTrustedAuthority.vModel.options.map(
|
1237
|
+
(o) => v14.object({
|
1238
|
+
type: o.entries.type,
|
1239
|
+
value: o.entries.values.item
|
1240
|
+
})
|
1241
|
+
)
|
1242
|
+
)
|
1220
1243
|
});
|
1221
1244
|
DcqlTrustedAuthoritiesResult2.vTrustedAuthorityEntryFailureResult = v14.object({
|
1222
1245
|
success: v14.literal(false),
|