dcql 2.0.0-alpha-20250916080434 → 2.0.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.
package/dist/index.js DELETED
@@ -1,1559 +0,0 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
-
30
- // src/index.ts
31
- var index_exports = {};
32
- __export(index_exports, {
33
- CredentialSetQuery: () => CredentialSetQuery,
34
- DcqlClaimsQuery: () => DcqlClaimsQuery,
35
- DcqlCredential: () => DcqlCredential,
36
- DcqlCredentialPresentation: () => DcqlCredentialPresentation,
37
- DcqlCredentialQuery: () => DcqlCredentialQuery,
38
- DcqlCredentialSetError: () => DcqlCredentialSetError,
39
- DcqlCredentialTrustedAuthority: () => DcqlCredentialTrustedAuthority,
40
- DcqlError: () => DcqlError,
41
- DcqlInvalidClaimsQueryIdError: () => DcqlInvalidClaimsQueryIdError,
42
- DcqlInvalidPresentationRecordError: () => DcqlInvalidPresentationRecordError,
43
- DcqlMdocCredential: () => DcqlMdocCredential,
44
- DcqlMdocPresentation: () => DcqlMdocPresentation,
45
- DcqlMissingClaimSetParseError: () => DcqlMissingClaimSetParseError,
46
- DcqlNonUniqueCredentialQueryIdsError: () => DcqlNonUniqueCredentialQueryIdsError,
47
- DcqlParseError: () => DcqlParseError,
48
- DcqlPresentation: () => DcqlPresentation,
49
- DcqlPresentationResult: () => DcqlPresentationResult,
50
- DcqlPresentationResultError: () => DcqlPresentationResultError,
51
- DcqlQuery: () => DcqlQuery,
52
- DcqlQueryResult: () => DcqlQueryResult,
53
- DcqlSdJwtVcCredential: () => DcqlSdJwtVcCredential,
54
- DcqlSdJwtVcPresentation: () => DcqlSdJwtVcPresentation,
55
- DcqlTrustedAuthoritiesQuery: () => DcqlTrustedAuthoritiesQuery,
56
- DcqlUndefinedClaimSetIdError: () => DcqlUndefinedClaimSetIdError,
57
- DcqlW3cVcCredential: () => DcqlW3cVcCredential,
58
- DcqlW3cVcPresentation: () => DcqlW3cVcPresentation,
59
- getCauseFromUnknown: () => getCauseFromUnknown,
60
- getDcqlErrorFromUnknown: () => getDcqlErrorFromUnknown,
61
- runDcqlQuery: () => runDcqlQuery
62
- });
63
- module.exports = __toCommonJS(index_exports);
64
-
65
- // src/dcql-error/e-base.ts
66
- function isObject(value) {
67
- return !!value && !Array.isArray(value) && typeof value === "object";
68
- }
69
- var UnknownCauseError = class extends Error {
70
- };
71
- function getCauseFromUnknown(cause) {
72
- if (cause instanceof Error) {
73
- return cause;
74
- }
75
- const type = typeof cause;
76
- if (type === "undefined" || type === "function" || cause === null) {
77
- return void 0;
78
- }
79
- if (type !== "object") {
80
- return new Error(String(cause));
81
- }
82
- if (isObject(cause)) {
83
- const err = new UnknownCauseError();
84
- for (const key in cause) {
85
- err[key] = cause[key];
86
- }
87
- return err;
88
- }
89
- return void 0;
90
- }
91
- var isDcqlError = (cause) => {
92
- if (cause instanceof DcqlError) {
93
- return true;
94
- }
95
- if (cause instanceof Error && cause.name === "DcqlError") {
96
- return true;
97
- }
98
- return false;
99
- };
100
- function getDcqlErrorFromUnknown(cause) {
101
- if (isDcqlError(cause)) {
102
- return cause;
103
- }
104
- const dcqlError = new DcqlError({
105
- code: "INTERNAL_SERVER_ERROR",
106
- cause
107
- });
108
- if (cause instanceof Error && cause.stack) {
109
- dcqlError.stack = cause.stack;
110
- }
111
- return dcqlError;
112
- }
113
- var DcqlError = class extends Error {
114
- constructor(opts) {
115
- const cause = getCauseFromUnknown(opts.cause);
116
- const message = opts.message ?? cause?.message ?? opts.code;
117
- super(message, { cause });
118
- this.code = opts.code;
119
- this.name = "DcqlError";
120
- if (!this.cause) {
121
- this.cause = cause;
122
- }
123
- }
124
- };
125
-
126
- // src/dcql-error/e-dcql.ts
127
- var DcqlCredentialSetError = class extends DcqlError {
128
- constructor(opts) {
129
- super({ code: "BAD_REQUEST", ...opts });
130
- }
131
- };
132
- var DcqlUndefinedClaimSetIdError = class extends DcqlError {
133
- constructor(opts) {
134
- super({ code: "BAD_REQUEST", ...opts });
135
- }
136
- };
137
- var DcqlNonUniqueCredentialQueryIdsError = class extends DcqlError {
138
- constructor(opts) {
139
- super({ code: "BAD_REQUEST", ...opts });
140
- }
141
- };
142
- var DcqlParseError = class extends DcqlError {
143
- constructor(opts) {
144
- super({ code: "PARSE_ERROR", ...opts });
145
- }
146
- };
147
- var DcqlInvalidClaimsQueryIdError = class extends DcqlError {
148
- constructor(opts) {
149
- super({ code: "BAD_REQUEST", ...opts });
150
- }
151
- };
152
- var DcqlMissingClaimSetParseError = class extends DcqlError {
153
- constructor(opts) {
154
- super({ code: "PARSE_ERROR", ...opts });
155
- }
156
- };
157
- var DcqlInvalidPresentationRecordError = class extends DcqlError {
158
- constructor(opts) {
159
- super({ code: "BAD_REQUEST", ...opts });
160
- }
161
- };
162
- var DcqlPresentationResultError = class extends DcqlError {
163
- constructor(opts) {
164
- super({ code: "BAD_REQUEST", ...opts });
165
- }
166
- };
167
-
168
- // src/dcql-presentation/m-dcql-credential-presentation.ts
169
- var v5 = __toESM(require("valibot"));
170
-
171
- // src/u-dcql-credential.ts
172
- var v4 = __toESM(require("valibot"));
173
-
174
- // src/dcql-query/m-dcql-trusted-authorities.ts
175
- var v2 = __toESM(require("valibot"));
176
-
177
- // src/u-dcql.ts
178
- var v = __toESM(require("valibot"));
179
- var idRegex = /^[a-zA-Z0-9_-]+$/;
180
- function asNonEmptyArrayOrUndefined(array8) {
181
- return array8.length > 0 ? array8 : void 0;
182
- }
183
- function isNonEmptyArray(array8) {
184
- return array8.length > 0;
185
- }
186
- var vNonEmptyArray = (item) => {
187
- return v.pipe(
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
- )
193
- );
194
- };
195
- var vIncludesAll = (subset) => {
196
- return v.custom(
197
- (value) => {
198
- if (!Array.isArray(value)) return false;
199
- return subset.every((item) => value.includes(item));
200
- },
201
- `Value must include all of: ${subset.join(", ")}`
202
- );
203
- };
204
- var vIdString = v.pipe(v.string(), v.regex(idRegex), v.nonEmpty());
205
- var vBase64url = v.regex(/^(?:[\w-]{4})*(?:[\w-]{2}(?:==)?|[\w-]{3}=?)?$/iu, "must be base64url");
206
- function isToJsonable(value) {
207
- if (value === null || typeof value !== "object") return false;
208
- const toJsonFn = value.toJson;
209
- return typeof toJsonFn === "function";
210
- }
211
- var vWithJT = (schema) => v.pipe(
212
- v.custom(() => true),
213
- v.rawTransform(({ dataset, addIssue, NEVER }) => {
214
- const result = v.safeParse(schema, dataset.value);
215
- if (result.success) return dataset.value;
216
- if (!isToJsonable(dataset.value)) {
217
- for (const safeParseIssue of result.issues) {
218
- addIssue({
219
- ...safeParseIssue,
220
- expected: safeParseIssue.expected ?? void 0
221
- });
222
- }
223
- return NEVER;
224
- }
225
- let json;
226
- try {
227
- json = dataset.value.toJson();
228
- } catch (error) {
229
- for (const safeParseIssue of result.issues) {
230
- addIssue({
231
- ...safeParseIssue,
232
- expected: safeParseIssue.expected ?? void 0
233
- });
234
- }
235
- addIssue({ message: "Json Transformation failed" });
236
- return NEVER;
237
- }
238
- const safeParseResult = v.safeParse(schema, json);
239
- if (safeParseResult.success) return dataset.value;
240
- for (const safeParseIssue of safeParseResult.issues) {
241
- addIssue({
242
- ...safeParseIssue,
243
- expected: safeParseIssue.expected ?? void 0
244
- });
245
- }
246
- return NEVER;
247
- })
248
- );
249
- var vJsonLiteral = v.union([v.string(), v.number(), v.boolean(), v.null()]);
250
- var vJson = v.lazy(
251
- () => v.union([vJsonLiteral, v.array(vJson), v.record(v.string(), vJson)])
252
- );
253
- var vJsonWithJT = v.lazy(
254
- () => vWithJT(v.union([vJsonLiteral, v.array(vJson), v.record(v.string(), vJson)]))
255
- );
256
- var vJsonRecord = v.record(v.string(), vJson);
257
- var vStringToJson = v.rawTransform(({ dataset, addIssue, NEVER }) => {
258
- try {
259
- return JSON.parse(dataset.value);
260
- } catch (error) {
261
- addIssue({ message: "Invalid JSON" });
262
- return NEVER;
263
- }
264
- });
265
-
266
- // src/dcql-query/m-dcql-trusted-authorities.ts
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}`
273
- ),
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
- }))
289
- );
290
- var vAuthorityKeyIdentifier = v2.object({
291
- type: v2.literal("aki"),
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
- )
299
- )
300
- )
301
- });
302
- var vEtsiTrustedList = v2.object({
303
- type: v2.literal("etsi_tl"),
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
- )
315
- )
316
- )
317
- });
318
- var vOpenidFederation = v2.object({
319
- type: v2.literal("openid_federation"),
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
- )
332
- )
333
- )
334
- });
335
- var vTrustedAuthorities = [vAuthorityKeyIdentifier, vEtsiTrustedList, vOpenidFederation];
336
- var DcqlTrustedAuthoritiesQuery;
337
- ((DcqlTrustedAuthoritiesQuery2) => {
338
- const vTrustedAuthoritiesQuery = vTrustedAuthorities.map(
339
- (authority) => v2.object({
340
- type: v2.pipe(
341
- authority.entries.type,
342
- v2.description(
343
- "REQUIRED. A string uniquely identifying the type of information about the issuer trust framework."
344
- )
345
- ),
346
- values: v2.pipe(
347
- vNonEmptyArray(authority.entries.values.item),
348
- v2.description(
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."
350
- )
351
- )
352
- })
353
- );
354
- DcqlTrustedAuthoritiesQuery2.vModel = v2.variant("type", vTrustedAuthoritiesQuery);
355
- })(DcqlTrustedAuthoritiesQuery || (DcqlTrustedAuthoritiesQuery = {}));
356
- var DcqlCredentialTrustedAuthority;
357
- ((DcqlCredentialTrustedAuthority2) => {
358
- DcqlCredentialTrustedAuthority2.vModel = v2.variant("type", vTrustedAuthorities);
359
- })(DcqlCredentialTrustedAuthority || (DcqlCredentialTrustedAuthority = {}));
360
-
361
- // src/u-model.ts
362
- var v3 = __toESM(require("valibot"));
363
- var ModelDefinition = class {
364
- constructor(input) {
365
- this.input = input;
366
- }
367
- get v() {
368
- return this.input.vModel;
369
- }
370
- parse(input) {
371
- const result = this.safeParse(input);
372
- if (result.success) {
373
- return result.output;
374
- }
375
- return new DcqlParseError({
376
- message: JSON.stringify(result.flattened),
377
- cause: result.error
378
- });
379
- }
380
- safeParse(input) {
381
- const res = v3.safeParse(this.input.vModel, input);
382
- if (res.success) {
383
- return { success: true, output: res.output };
384
- }
385
- return {
386
- success: false,
387
- error: new v3.ValiError(res.issues),
388
- flattened: v3.flatten(res.issues)
389
- };
390
- }
391
- is(input) {
392
- return v3.is(this.v, input);
393
- }
394
- };
395
-
396
- // src/u-dcql-credential.ts
397
- var vCredentialModelBase = v4.object({
398
- authority: v4.optional(DcqlCredentialTrustedAuthority.vModel),
399
- /**
400
- * Indicates support/inclusion of cryptographic holder binding. This will be checked against
401
- * the `require_cryptographic_holder_binding` property from the query.
402
- *
403
- * In the context of a presentation this value means whether the presentation is created
404
- * with cryptographic holder binding. In the context of a credential query this means whether
405
- * the credential supports cryptographic holder binding.
406
- */
407
- cryptographic_holder_binding: v4.pipe(
408
- v4.boolean(),
409
- v4.description(
410
- "Indicates support/inclusion of cryptographic holder binding. This will be checked against the `require_cryptographic_holder_binding` property from the query."
411
- )
412
- )
413
- });
414
- var DcqlMdocCredential;
415
- ((DcqlMdocCredential2) => {
416
- DcqlMdocCredential2.vNamespaces = v4.record(v4.string(), v4.record(v4.string(), v4.unknown()));
417
- DcqlMdocCredential2.vModel = v4.object({
418
- ...vCredentialModelBase.entries,
419
- credential_format: v4.literal("mso_mdoc"),
420
- doctype: v4.string(),
421
- namespaces: DcqlMdocCredential2.vNamespaces
422
- });
423
- DcqlMdocCredential2.model = new ModelDefinition({ vModel: DcqlMdocCredential2.vModel });
424
- })(DcqlMdocCredential || (DcqlMdocCredential = {}));
425
- var DcqlSdJwtVcCredential;
426
- ((DcqlSdJwtVcCredential2) => {
427
- DcqlSdJwtVcCredential2.vClaims = vJsonRecord;
428
- DcqlSdJwtVcCredential2.vModel = v4.object({
429
- ...vCredentialModelBase.entries,
430
- credential_format: v4.picklist(["vc+sd-jwt", "dc+sd-jwt"]),
431
- vct: v4.string(),
432
- claims: DcqlSdJwtVcCredential2.vClaims
433
- });
434
- DcqlSdJwtVcCredential2.model = new ModelDefinition({ vModel: DcqlSdJwtVcCredential2.vModel });
435
- })(DcqlSdJwtVcCredential || (DcqlSdJwtVcCredential = {}));
436
- var DcqlW3cVcCredential;
437
- ((DcqlW3cVcCredential2) => {
438
- DcqlW3cVcCredential2.vClaims = vJsonRecord;
439
- DcqlW3cVcCredential2.vModel = v4.object({
440
- ...vCredentialModelBase.entries,
441
- credential_format: v4.picklist(["ldp_vc", "jwt_vc_json", "vc+sd-jwt"]),
442
- claims: DcqlW3cVcCredential2.vClaims,
443
- type: v4.array(v4.string())
444
- });
445
- DcqlW3cVcCredential2.model = new ModelDefinition({ vModel: DcqlW3cVcCredential2.vModel });
446
- })(DcqlW3cVcCredential || (DcqlW3cVcCredential = {}));
447
- var DcqlCredential;
448
- ((DcqlCredential2) => {
449
- DcqlCredential2.vModel = v4.variant("credential_format", [
450
- DcqlMdocCredential.vModel,
451
- DcqlSdJwtVcCredential.vModel,
452
- DcqlW3cVcCredential.vModel
453
- ]);
454
- DcqlCredential2.model = new ModelDefinition({ vModel: DcqlCredential2.vModel });
455
- })(DcqlCredential || (DcqlCredential = {}));
456
-
457
- // src/dcql-presentation/m-dcql-credential-presentation.ts
458
- var DcqlMdocPresentation;
459
- ((DcqlMdocPresentation2) => {
460
- DcqlMdocPresentation2.vModel = DcqlMdocCredential.vModel;
461
- DcqlMdocPresentation2.model = new ModelDefinition({ vModel: DcqlMdocPresentation2.vModel });
462
- })(DcqlMdocPresentation || (DcqlMdocPresentation = {}));
463
- var DcqlSdJwtVcPresentation;
464
- ((DcqlSdJwtVcPresentation2) => {
465
- DcqlSdJwtVcPresentation2.vModel = DcqlSdJwtVcCredential.vModel;
466
- DcqlSdJwtVcPresentation2.model = new ModelDefinition({ vModel: DcqlSdJwtVcPresentation2.vModel });
467
- })(DcqlSdJwtVcPresentation || (DcqlSdJwtVcPresentation = {}));
468
- var DcqlW3cVcPresentation;
469
- ((DcqlW3cVcPresentation2) => {
470
- DcqlW3cVcPresentation2.vModel = DcqlW3cVcCredential.vModel;
471
- DcqlW3cVcPresentation2.model = new ModelDefinition({ vModel: DcqlW3cVcPresentation2.vModel });
472
- })(DcqlW3cVcPresentation || (DcqlW3cVcPresentation = {}));
473
- var DcqlCredentialPresentation;
474
- ((DcqlCredentialPresentation2) => {
475
- DcqlCredentialPresentation2.model = new ModelDefinition({
476
- vModel: v5.variant("credential_format", [
477
- DcqlMdocPresentation.vModel,
478
- DcqlSdJwtVcPresentation.vModel,
479
- DcqlW3cVcPresentation.vModel
480
- ])
481
- });
482
- })(DcqlCredentialPresentation || (DcqlCredentialPresentation = {}));
483
-
484
- // src/dcql-presentation/m-dcql-presentation-result.ts
485
- var v16 = __toESM(require("valibot"));
486
-
487
- // src/dcql-parser/dcql-claims-query-result.ts
488
- var v7 = __toESM(require("valibot"));
489
-
490
- // src/dcql-query/m-dcql-claims-query.ts
491
- var v6 = __toESM(require("valibot"));
492
- var DcqlClaimsQuery;
493
- ((DcqlClaimsQuery2) => {
494
- DcqlClaimsQuery2.vValue = v6.union([v6.string(), v6.pipe(v6.number(), v6.integer()), v6.boolean()]);
495
- DcqlClaimsQuery2.vPath = v6.union([v6.string(), v6.pipe(v6.number(), v6.integer(), v6.minValue(0)), v6.null()]);
496
- DcqlClaimsQuery2.vW3cSdJwtVc = v6.object({
497
- id: v6.pipe(
498
- v6.optional(vIdString),
499
- v6.description(
500
- "A string identifying the particular claim. The value MUST be a non-empty string consisting of alphanumeric, underscore (_) or hyphen (-) characters. Within the particular claims array, the same id MUST NOT be present more than once."
501
- )
502
- ),
503
- path: v6.pipe(
504
- vNonEmptyArray(DcqlClaimsQuery2.vPath),
505
- v6.description(
506
- "A non-empty array representing a claims path pointer that specifies the path to a claim within the Verifiable Credential."
507
- )
508
- ),
509
- values: v6.pipe(
510
- v6.optional(v6.array(DcqlClaimsQuery2.vValue)),
511
- v6.description(
512
- "An array of strings, integers or boolean values that specifies the expected values of the claim. If the values property is present, the Wallet SHOULD return the claim only if the type and value of the claim both match for at least one of the elements in the array."
513
- )
514
- )
515
- });
516
- const vMdocBase = v6.object({
517
- id: v6.pipe(
518
- v6.optional(vIdString),
519
- v6.description(
520
- "A string identifying the particular claim. The value MUST be a non-empty string consisting of alphanumeric, underscore (_) or hyphen (-) characters. Within the particular claims array, the same id MUST NOT be present more than once."
521
- )
522
- ),
523
- values: v6.pipe(
524
- v6.optional(v6.array(DcqlClaimsQuery2.vValue)),
525
- v6.description(
526
- "An array of strings, integers or boolean values that specifies the expected values of the claim. If the values property is present, the Wallet SHOULD return the claim only if the type and value of the claim both match for at least one of the elements in the array."
527
- )
528
- )
529
- });
530
- DcqlClaimsQuery2.vMdocNamespace = v6.object({
531
- ...vMdocBase.entries,
532
- namespace: v6.pipe(
533
- v6.string(),
534
- v6.description(
535
- "A string that specifies the namespace of the data element within the mdoc, e.g., org.iso.18013.5.1."
536
- )
537
- ),
538
- claim_name: v6.pipe(
539
- v6.string(),
540
- v6.description(
541
- "A string that specifies the data element identifier of the data element within the provided namespace in the mdoc, e.g., first_name."
542
- )
543
- )
544
- });
545
- DcqlClaimsQuery2.vMdocPath = v6.object({
546
- ...vMdocBase.entries,
547
- intent_to_retain: v6.pipe(
548
- v6.optional(v6.boolean()),
549
- v6.description(
550
- "A boolean that is equivalent to `IntentToRetain` variable defined in Section 8.3.2.1.2.1 of [@ISO.18013-5]."
551
- )
552
- ),
553
- path: v6.pipe(
554
- v6.tuple([
555
- v6.pipe(
556
- v6.string(),
557
- v6.description(
558
- "A string that specifies the namespace of the data element within the mdoc, e.g., org.iso.18013.5.1."
559
- )
560
- ),
561
- v6.pipe(
562
- v6.string(),
563
- v6.description(
564
- "A string that specifies the data element identifier of the data element within the provided namespace in the mdoc, e.g., first_name."
565
- )
566
- )
567
- ]),
568
- v6.description(
569
- "An array defining a claims path pointer into an mdoc. It must contain two elements of type string. The first element refers to a namespace and the second element refers to a data element identifier."
570
- )
571
- )
572
- });
573
- DcqlClaimsQuery2.vMdoc = v6.union([DcqlClaimsQuery2.vMdocNamespace, DcqlClaimsQuery2.vMdocPath]);
574
- DcqlClaimsQuery2.vModel = v6.union([DcqlClaimsQuery2.vMdoc, DcqlClaimsQuery2.vW3cSdJwtVc]);
575
- })(DcqlClaimsQuery || (DcqlClaimsQuery = {}));
576
-
577
- // src/util/deep-merge.ts
578
- function deepMerge(source, target) {
579
- let newTarget = target;
580
- if (Object.getPrototypeOf(source) !== Object.prototype && !Array.isArray(source)) {
581
- throw new DcqlError({
582
- message: "source value provided to deepMerge is neither an array or object.",
583
- code: "PARSE_ERROR"
584
- });
585
- }
586
- if (Object.getPrototypeOf(target) !== Object.prototype && !Array.isArray(target)) {
587
- throw new DcqlError({
588
- message: "target value provided to deepMerge is neither an array or object.",
589
- code: "PARSE_ERROR"
590
- });
591
- }
592
- for (const [key, val] of Object.entries(source)) {
593
- if (val !== null && typeof val === "object" && (Object.getPrototypeOf(val) === Object.prototype || Array.isArray(val))) {
594
- const newValue = deepMerge(
595
- val,
596
- newTarget[key] ?? new (Object.getPrototypeOf(val)).constructor()
597
- );
598
- newTarget = setValue(newTarget, key, newValue);
599
- } else if (val != null) {
600
- newTarget = setValue(newTarget, key, val);
601
- }
602
- }
603
- return newTarget;
604
- }
605
- function setValue(target, key, value) {
606
- let newTarget = target;
607
- if (Array.isArray(newTarget)) {
608
- newTarget = [...newTarget];
609
- newTarget[key] = value;
610
- } else if (Object.getPrototypeOf(newTarget) === Object.prototype) {
611
- newTarget = { ...newTarget, [key]: value };
612
- } else {
613
- throw new DcqlError({
614
- message: "Unsupported type for deep merge. Only primitive types or Array and Object are supported",
615
- code: "INTERNAL_SERVER_ERROR"
616
- });
617
- }
618
- return newTarget;
619
- }
620
-
621
- // src/dcql-parser/dcql-claims-query-result.ts
622
- var pathToString = (path) => path.map((item) => typeof item === "string" ? `'${item}'` : `${item}`).join(".");
623
- var getClaimParser = (path, values) => {
624
- if (values) {
625
- return v7.union(
626
- values.map(
627
- (val) => v7.literal(
628
- val,
629
- (i) => `Expected claim ${pathToString(path)} to be ${typeof val === "string" ? `'${val}'` : val} but received ${typeof i.input === "string" ? `'${i.input}'` : i.input}`
630
- )
631
- ),
632
- (i) => `Expected claim ${pathToString(path)} to be ${values.map((v19) => typeof v19 === "string" ? `'${v19}'` : v19).join(" | ")} but received ${typeof i.input === "string" ? `'${i.input}'` : i.input}`
633
- );
634
- }
635
- return v7.pipe(
636
- v7.unknown(),
637
- v7.check((value) => value !== null && value !== void 0, `Expected claim '${path.join("'.'")}' to be defined`)
638
- );
639
- };
640
- var getMdocClaimParser = (claimQuery) => {
641
- const mdocPathQuery = v7.is(DcqlClaimsQuery.vMdocNamespace, claimQuery) ? {
642
- id: claimQuery.id,
643
- path: [claimQuery.namespace, claimQuery.claim_name],
644
- values: claimQuery.values
645
- } : claimQuery;
646
- const namespace = mdocPathQuery.path[0];
647
- const field = mdocPathQuery.path[1];
648
- return v7.object(
649
- {
650
- [namespace]: v7.object(
651
- {
652
- [field]: getClaimParser(mdocPathQuery.path, claimQuery.values)
653
- },
654
- `Expected claim ${pathToString(mdocPathQuery.path)} to be defined`
655
- )
656
- },
657
- `Expected claim ${pathToString(mdocPathQuery.path)} to be defined`
658
- );
659
- };
660
- var getJsonClaimParser = (claimQuery, ctx) => {
661
- const { index, presentation } = ctx;
662
- const pathElement = claimQuery.path[index];
663
- const isLast = index === claimQuery.path.length - 1;
664
- const vClaimParser = getClaimParser(claimQuery.path, claimQuery.values);
665
- if (typeof pathElement === "number") {
666
- const elementParser = isLast ? vClaimParser : getJsonClaimParser(claimQuery, { ...ctx, index: index + 1 });
667
- if (presentation) {
668
- return v7.pipe(
669
- v7.array(v7.any(), `Expected path ${pathToString(claimQuery.path.slice(0, index + 1))} to be an array`),
670
- v7.rawTransform(({ dataset, addIssue }) => {
671
- const issues = [];
672
- for (const item of dataset.value) {
673
- const itemResult = v7.safeParse(elementParser, item);
674
- if (itemResult.success) {
675
- return dataset.value;
676
- }
677
- issues.push(itemResult.issues[0]);
678
- }
679
- addIssue({
680
- ...issues[0],
681
- message: isLast ? issues[0].message : `Expected any element in array ${pathToString(claimQuery.path.slice(0, index + 1))} to match sub requirement but none matched: ${issues[0].message}`
682
- });
683
- return dataset.value;
684
- })
685
- );
686
- }
687
- return v7.pipe(
688
- v7.array(v7.any(), `Expected path ${pathToString(claimQuery.path.slice(0, index + 1))} to be an array`),
689
- v7.rawTransform(({ addIssue, dataset, NEVER }) => {
690
- const result = v7.safeParse(elementParser, dataset.value[pathElement]);
691
- if (!result.success) {
692
- addIssue(result.issues[0]);
693
- return NEVER;
694
- }
695
- return [...dataset.value.slice(0, pathElement).map(() => null), result.output];
696
- })
697
- );
698
- }
699
- if (typeof pathElement === "string") {
700
- return v7.object(
701
- {
702
- [pathElement]: isLast ? vClaimParser : getJsonClaimParser(claimQuery, { ...ctx, index: index + 1 })
703
- },
704
- `Expected claim ${pathToString(claimQuery.path)} to be defined`
705
- );
706
- }
707
- return v7.pipe(
708
- v7.array(v7.any(), `Expected path ${pathToString(claimQuery.path.slice(0, index + 1))} to be an array`),
709
- v7.rawTransform(({ addIssue, dataset, NEVER }) => {
710
- const mapped = dataset.value.map((item) => {
711
- const parsed = v7.safeParse(
712
- isLast ? vClaimParser : getJsonClaimParser(claimQuery, { ...ctx, index: index + 1 }),
713
- item
714
- );
715
- return parsed;
716
- });
717
- if (mapped.every((parsed) => !parsed.success)) {
718
- for (const parsed of mapped) {
719
- for (const issue of parsed.issues) {
720
- addIssue(issue);
721
- }
722
- }
723
- return NEVER;
724
- }
725
- return mapped.map((parsed) => parsed.success ? parsed.output : null);
726
- })
727
- );
728
- };
729
- var runClaimsQuery = (credentialQuery, ctx) => {
730
- if (!credentialQuery.claims) {
731
- return {
732
- success: true,
733
- valid_claims: void 0,
734
- failed_claims: void 0,
735
- valid_claim_sets: [
736
- {
737
- claim_set_index: void 0,
738
- output: {},
739
- success: true,
740
- valid_claim_indexes: void 0
741
- }
742
- ],
743
- failed_claim_sets: void 0
744
- };
745
- }
746
- const failedClaims = [];
747
- const validClaims = [];
748
- for (const [claimIndex, claimQuery] of credentialQuery.claims.entries()) {
749
- const parser = credentialQuery.format === "mso_mdoc" ? getMdocClaimParser(claimQuery) : getJsonClaimParser(claimQuery, {
750
- index: 0,
751
- presentation: ctx.presentation
752
- });
753
- const parseResult = v7.safeParse(
754
- parser,
755
- ctx.credential.credential_format === "mso_mdoc" ? ctx.credential.namespaces : ctx.credential.claims
756
- );
757
- if (parseResult.success) {
758
- validClaims.push({
759
- success: true,
760
- claim_index: claimIndex,
761
- claim_id: claimQuery.id,
762
- output: parseResult.output,
763
- parser
764
- });
765
- } else {
766
- const flattened = v7.flatten(parseResult.issues);
767
- failedClaims.push({
768
- success: false,
769
- issues: flattened.nested ?? flattened,
770
- claim_index: claimIndex,
771
- claim_id: claimQuery.id,
772
- output: parseResult.output,
773
- parser
774
- });
775
- }
776
- }
777
- const failedClaimSets = [];
778
- const validClaimSets = [];
779
- for (const [claimSetIndex, claimSet] of credentialQuery.claim_sets?.entries() ?? [[void 0, void 0]]) {
780
- const claims = claimSet?.map((id) => {
781
- const claim = validClaims.find((claim2) => claim2.claim_id === id) ?? failedClaims.find((claim2) => claim2.claim_id === id);
782
- if (!claim) {
783
- throw new DcqlParseError({
784
- message: `Claim with id '${id}' in query '${credentialQuery.id}' from claim set with index '${claimSetIndex}' not found in claims of claim`
785
- });
786
- }
787
- return claim;
788
- }) ?? [...validClaims, ...failedClaims];
789
- if (claims.every((claim) => claim.success)) {
790
- const output = claims.reduce((merged, claim) => deepMerge(claim.output, merged), {});
791
- validClaimSets.push({
792
- success: true,
793
- claim_set_index: claimSetIndex,
794
- output,
795
- valid_claim_indexes: asNonEmptyArrayOrUndefined(claims.map((claim) => claim.claim_index))
796
- });
797
- } else {
798
- const issues = failedClaims.reduce((merged, claim) => deepMerge(claim.issues, merged), {});
799
- failedClaimSets.push({
800
- success: false,
801
- issues,
802
- claim_set_index: claimSetIndex,
803
- failed_claim_indexes: claims.filter((claim) => !claim.success).map((claim) => claim.claim_index),
804
- valid_claim_indexes: asNonEmptyArrayOrUndefined(
805
- claims.filter((claim) => claim.success).map((claim) => claim.claim_index)
806
- )
807
- });
808
- }
809
- }
810
- if (isNonEmptyArray(validClaimSets)) {
811
- return {
812
- success: true,
813
- failed_claim_sets: asNonEmptyArrayOrUndefined(failedClaimSets),
814
- valid_claim_sets: validClaimSets,
815
- valid_claims: asNonEmptyArrayOrUndefined(validClaims.map(({ parser, ...rest }) => rest)),
816
- failed_claims: asNonEmptyArrayOrUndefined(failedClaims.map(({ parser, ...rest }) => rest))
817
- };
818
- }
819
- return {
820
- success: false,
821
- failed_claim_sets: failedClaimSets,
822
- failed_claims: failedClaims.map(({ parser, ...rest }) => rest),
823
- valid_claims: asNonEmptyArrayOrUndefined(validClaims.map(({ parser, ...rest }) => rest))
824
- };
825
- };
826
-
827
- // src/dcql-parser/dcql-meta-query-result.ts
828
- var v8 = __toESM(require("valibot"));
829
- var getCryptographicHolderBindingValue = (credentialQuery) => v8.object({
830
- cryptographic_holder_binding: credentialQuery.require_cryptographic_holder_binding ? v8.literal(
831
- true,
832
- (i) => `Expected cryptographic_holder_binding to be true (because credential query '${credentialQuery.id}' requires cryptographic holder binding), but received ${i.input}`
833
- ) : v8.boolean()
834
- });
835
- var getMdocMetaParser = (credentialQuery) => {
836
- const vDoctype = credentialQuery.meta?.doctype_value ? v8.literal(
837
- credentialQuery.meta.doctype_value,
838
- (i) => `Expected doctype to be '${credentialQuery.meta?.doctype_value}' but received '${i.input}'`
839
- ) : v8.string("Expected doctype to be defined");
840
- const credentialParser = v8.object({
841
- credential_format: v8.literal(
842
- "mso_mdoc",
843
- (i) => `Expected credential format to be 'mso_mdoc' but received '${i.input}'`
844
- ),
845
- doctype: vDoctype,
846
- ...getCryptographicHolderBindingValue(credentialQuery).entries
847
- });
848
- return credentialParser;
849
- };
850
- var getSdJwtVcMetaParser = (credentialQuery) => {
851
- return v8.object({
852
- credential_format: v8.literal(
853
- credentialQuery.format,
854
- (i) => `Expected credential format to be '${credentialQuery.format}' but received '${i.input}'`
855
- ),
856
- vct: credentialQuery.meta?.vct_values ? v8.picklist(
857
- credentialQuery.meta.vct_values,
858
- (i) => `Expected vct to be '${credentialQuery.meta?.vct_values?.join("' | '")}' but received '${i.input}'`
859
- ) : v8.string("Expected vct to be defined"),
860
- ...getCryptographicHolderBindingValue(credentialQuery).entries
861
- });
862
- };
863
- var getW3cVcMetaParser = (credentialQuery) => {
864
- return v8.object({
865
- credential_format: v8.literal(
866
- credentialQuery.format,
867
- (i) => `Expected credential format to be '${credentialQuery.format}' but received '${i.input}'`
868
- ),
869
- type: credentialQuery.meta?.type_values ? v8.union(
870
- credentialQuery.meta.type_values.map((values) => vIncludesAll(values)),
871
- `Expected type to include all values from one of the following subsets: ${credentialQuery.meta.type_values.map((values) => `[${values.join(", ")}]`).join(" | ")}`
872
- ) : vNonEmptyArray(v8.string()),
873
- ...getCryptographicHolderBindingValue(credentialQuery).entries
874
- });
875
- };
876
- var getMetaParser = (credentialQuery) => {
877
- if (credentialQuery.format === "mso_mdoc") {
878
- return getMdocMetaParser(credentialQuery);
879
- }
880
- if (credentialQuery.format === "dc+sd-jwt") {
881
- return getSdJwtVcMetaParser(credentialQuery);
882
- }
883
- if (credentialQuery.format === "vc+sd-jwt") {
884
- if (credentialQuery.meta && "type_values" in credentialQuery.meta) {
885
- return getW3cVcMetaParser(credentialQuery);
886
- }
887
- return getSdJwtVcMetaParser(credentialQuery);
888
- }
889
- if (credentialQuery.format === "ldp_vc" || credentialQuery.format === "jwt_vc_json") {
890
- return getW3cVcMetaParser(credentialQuery);
891
- }
892
- throw new DcqlError({
893
- code: "NOT_IMPLEMENTED",
894
- message: `Unsupported format '${credentialQuery.format}'`
895
- });
896
- };
897
- var runMetaQuery = (credentialQuery, credential) => {
898
- const metaParser = getMetaParser(credentialQuery);
899
- const parseResult = v8.safeParse(metaParser, credential);
900
- if (!parseResult.success) {
901
- const issues = v8.flatten(parseResult.issues);
902
- return {
903
- success: false,
904
- issues: issues.nested ?? issues,
905
- output: parseResult.output
906
- };
907
- }
908
- return {
909
- success: true,
910
- output: parseResult.output
911
- };
912
- };
913
-
914
- // src/dcql-parser/dcql-trusted-authorities-result.ts
915
- var v9 = __toESM(require("valibot"));
916
- var runTrustedAuthoritiesQuery = (credentialQuery, credential) => {
917
- if (!credentialQuery.trusted_authorities) {
918
- return {
919
- success: true
920
- };
921
- }
922
- const failedTrustedAuthorities = [];
923
- for (const [trustedAuthorityIndex, trustedAuthority] of credentialQuery.trusted_authorities.entries()) {
924
- const trustedAuthorityParser = getTrustedAuthorityParser(trustedAuthority);
925
- const parseResult = v9.safeParse(trustedAuthorityParser, credential.authority);
926
- if (parseResult.success) {
927
- return {
928
- success: true,
929
- valid_trusted_authority: {
930
- success: true,
931
- trusted_authority_index: trustedAuthorityIndex,
932
- output: parseResult.output
933
- },
934
- failed_trusted_authorities: asNonEmptyArrayOrUndefined(failedTrustedAuthorities)
935
- };
936
- }
937
- const issues = v9.flatten(parseResult.issues);
938
- failedTrustedAuthorities.push({
939
- success: false,
940
- trusted_authority_index: trustedAuthorityIndex,
941
- issues: issues.nested ?? issues,
942
- output: parseResult.output
943
- });
944
- }
945
- return {
946
- success: false,
947
- failed_trusted_authorities: failedTrustedAuthorities
948
- };
949
- };
950
-
951
- // src/dcql-parser/dcql-credential-query-result.ts
952
- var runCredentialQuery = (credentialQuery, ctx) => {
953
- const { credentials, presentation } = ctx;
954
- const validCredentials = [];
955
- const failedCredentials = [];
956
- for (const [credentialIndex, credential] of credentials.entries()) {
957
- const trustedAuthorityResult = runTrustedAuthoritiesQuery(credentialQuery, credential);
958
- const claimsResult = runClaimsQuery(credentialQuery, { credential, presentation });
959
- const metaResult = runMetaQuery(credentialQuery, credential);
960
- if (claimsResult.success && trustedAuthorityResult.success && metaResult.success) {
961
- validCredentials.push({
962
- success: true,
963
- input_credential_index: credentialIndex,
964
- trusted_authorities: trustedAuthorityResult,
965
- meta: metaResult,
966
- claims: claimsResult
967
- });
968
- } else {
969
- failedCredentials.push({
970
- success: false,
971
- input_credential_index: credentialIndex,
972
- trusted_authorities: trustedAuthorityResult,
973
- meta: metaResult,
974
- claims: claimsResult
975
- });
976
- }
977
- }
978
- if (isNonEmptyArray(validCredentials)) {
979
- return {
980
- success: true,
981
- credential_query_id: credentialQuery.id,
982
- failed_credentials: asNonEmptyArrayOrUndefined(failedCredentials),
983
- valid_credentials: validCredentials
984
- };
985
- }
986
- return {
987
- success: false,
988
- credential_query_id: credentialQuery.id,
989
- // Can be undefined if no credentials were provided to the query
990
- failed_credentials: asNonEmptyArrayOrUndefined(failedCredentials),
991
- valid_credentials: void 0
992
- };
993
- };
994
-
995
- // src/dcql-query-result/m-dcql-query-result.ts
996
- var v15 = __toESM(require("valibot"));
997
-
998
- // src/dcql-query/m-dcql-credential-query.ts
999
- var v10 = __toESM(require("valibot"));
1000
- var DcqlCredentialQuery;
1001
- ((DcqlCredentialQuery2) => {
1002
- const vBase = v10.object({
1003
- id: v10.pipe(
1004
- v10.string(),
1005
- v10.regex(idRegex),
1006
- v10.description(
1007
- `REQUIRED. A string identifying the Credential in the response and, if provided, the constraints in 'credential_sets'.`
1008
- )
1009
- ),
1010
- require_cryptographic_holder_binding: v10.pipe(
1011
- v10.optional(v10.boolean(), true),
1012
- v10.description(
1013
- "OPTIONAL. A boolean which indicates whether the Verifier requires a Cryptographic Holder Binding proof. The default value is true, i.e., a Verifiable Presentation with Cryptographic Holder Binding is required. If set to false, the Verifier accepts a Credential without Cryptographic Holder Binding proof."
1014
- )
1015
- ),
1016
- multiple: v10.pipe(
1017
- v10.optional(v10.boolean(), false),
1018
- v10.description(
1019
- "OPTIONAL. A boolean which indicates whether multiple Credentials can be returned for this Credential Query. If omitted, the default value is false."
1020
- )
1021
- ),
1022
- claim_sets: v10.pipe(
1023
- v10.optional(vNonEmptyArray(vNonEmptyArray(vIdString))),
1024
- v10.description(
1025
- `OPTIONAL. A non-empty array containing arrays of identifiers for elements in 'claims' that specifies which combinations of 'claims' for the Credential are requested.`
1026
- )
1027
- ),
1028
- trusted_authorities: v10.pipe(
1029
- v10.optional(vNonEmptyArray(DcqlTrustedAuthoritiesQuery.vModel)),
1030
- v10.description(
1031
- "OPTIONAL. A non-empty array of objects as defined in Section 6.1.1 that specifies expected authorities or trust frameworks that certify Issuers, that the Verifier will accept. Every Credential returned by the Wallet SHOULD match at least one of the conditions present in the corresponding trusted_authorities array if present."
1032
- )
1033
- )
1034
- });
1035
- DcqlCredentialQuery2.vMdoc = v10.object({
1036
- ...vBase.entries,
1037
- format: v10.pipe(
1038
- v10.literal("mso_mdoc"),
1039
- v10.description("REQUIRED. A string that specifies the format of the requested Verifiable Credential.")
1040
- ),
1041
- claims: v10.pipe(
1042
- v10.optional(vNonEmptyArray(DcqlClaimsQuery.vMdoc)),
1043
- v10.description("OPTIONAL. A non-empty array of objects as that specifies claims in the requested Credential.")
1044
- ),
1045
- meta: v10.pipe(
1046
- v10.optional(
1047
- v10.object({
1048
- doctype_value: v10.pipe(
1049
- v10.optional(v10.string()),
1050
- v10.description(
1051
- "OPTIONAL. String that specifies an allowed value for the doctype of the requested Verifiable Credential."
1052
- )
1053
- )
1054
- })
1055
- ),
1056
- v10.description(
1057
- "OPTIONAL. An object defining additional properties requested by the Verifier that apply to the metadata and validity data of the Credential."
1058
- )
1059
- )
1060
- });
1061
- DcqlCredentialQuery2.vSdJwtVc = v10.object({
1062
- ...vBase.entries,
1063
- format: v10.pipe(
1064
- v10.picklist(["vc+sd-jwt", "dc+sd-jwt"]),
1065
- v10.description("REQUIRED. A string that specifies the format of the requested Verifiable Credential.")
1066
- ),
1067
- claims: v10.pipe(
1068
- v10.optional(vNonEmptyArray(DcqlClaimsQuery.vW3cSdJwtVc)),
1069
- v10.description("OPTIONAL. A non-empty array of objects as that specifies claims in the requested Credential.")
1070
- ),
1071
- meta: v10.pipe(
1072
- v10.optional(
1073
- v10.pipe(
1074
- v10.object({
1075
- vct_values: v10.optional(v10.array(v10.string()))
1076
- }),
1077
- v10.description(
1078
- "OPTIONAL. An array of strings that specifies allowed values for the type of the requested Verifiable Credential."
1079
- )
1080
- )
1081
- ),
1082
- v10.description(
1083
- "OPTIONAL. An object defining additional properties requested by the Verifier that apply to the metadata and validity data of the Credential."
1084
- )
1085
- )
1086
- });
1087
- DcqlCredentialQuery2.vW3cVc = v10.object({
1088
- ...vBase.entries,
1089
- format: v10.pipe(
1090
- v10.picklist(["jwt_vc_json", "ldp_vc", "vc+sd-jwt"]),
1091
- v10.description("REQUIRED. A string that specifies the format of the requested Verifiable Credential.")
1092
- ),
1093
- claims: v10.pipe(
1094
- v10.optional(vNonEmptyArray(DcqlClaimsQuery.vW3cSdJwtVc)),
1095
- v10.description("OPTIONAL. A non-empty array of objects as that specifies claims in the requested Credential.")
1096
- ),
1097
- meta: v10.pipe(
1098
- v10.pipe(
1099
- v10.object({
1100
- type_values: v10.pipe(
1101
- vNonEmptyArray(vNonEmptyArray(v10.string())),
1102
- v10.description(
1103
- "REQUIRED. An array of string arrays that specifies the fully expanded types (IRIs) after the @context was applied that the Verifier accepts to be presented in the Presentation. Each of the top-level arrays specifies one alternative to match the type values of the Verifiable Credential against. Each inner array specifies a set of fully expanded types that MUST be present in the type property of the Verifiable Credential, regardless of order or the presence of additional types."
1104
- )
1105
- )
1106
- })
1107
- ),
1108
- v10.description(
1109
- "REQUIRED. An object defining additional properties requested by the Verifier that apply to the metadata and validity data of the Credential."
1110
- )
1111
- )
1112
- });
1113
- DcqlCredentialQuery2.vModel = v10.variant("format", [DcqlCredentialQuery2.vMdoc, DcqlCredentialQuery2.vW3cVc, DcqlCredentialQuery2.vSdJwtVc]);
1114
- DcqlCredentialQuery2.validate = (credentialQuery) => {
1115
- claimSetIdsAreDefined(credentialQuery);
1116
- };
1117
- })(DcqlCredentialQuery || (DcqlCredentialQuery = {}));
1118
- var claimSetIdsAreDefined = (credentialQuery) => {
1119
- if (!credentialQuery.claim_sets) return;
1120
- const claimIds = new Set(credentialQuery.claims?.map((claim) => claim.id));
1121
- const undefinedClaims = [];
1122
- for (const claim_set of credentialQuery.claim_sets) {
1123
- for (const claim_id of claim_set) {
1124
- if (!claimIds.has(claim_id)) {
1125
- undefinedClaims.push(claim_id);
1126
- }
1127
- }
1128
- }
1129
- if (undefinedClaims.length > 0) {
1130
- throw new DcqlUndefinedClaimSetIdError({
1131
- message: `Credential set contains undefined credential id${undefinedClaims.length === 0 ? "" : "`s"} '${undefinedClaims.join(", ")}'`
1132
- });
1133
- }
1134
- };
1135
-
1136
- // src/dcql-query/m-dcql-credential-set-query.ts
1137
- var v11 = __toESM(require("valibot"));
1138
- var CredentialSetQuery;
1139
- ((CredentialSetQuery2) => {
1140
- CredentialSetQuery2.vModel = v11.object({
1141
- options: v11.pipe(
1142
- vNonEmptyArray(v11.array(vIdString)),
1143
- v11.description(
1144
- "REQUIRED. A non-empty array, where each value in the array is a list of Credential Query identifiers representing one set of Credentials that satisfies the use case."
1145
- )
1146
- ),
1147
- required: v11.pipe(
1148
- v11.optional(v11.boolean(), true),
1149
- v11.description(
1150
- `OPTIONAL. Boolean which indicates whether this set of Credentials is required to satisfy the particular use case at the Verifier. If omitted, the default value is 'true'.`
1151
- )
1152
- ),
1153
- purpose: v11.pipe(
1154
- v11.optional(v11.union([v11.string(), v11.number(), v11.record(v11.string(), v11.unknown())])),
1155
- v11.description("OPTIONAL. A string, number or object specifying the purpose of the query.")
1156
- )
1157
- });
1158
- })(CredentialSetQuery || (CredentialSetQuery = {}));
1159
-
1160
- // src/dcql-query-result/m-claims-result.ts
1161
- var v12 = __toESM(require("valibot"));
1162
- var DcqlClaimsResult;
1163
- ((DcqlClaimsResult2) => {
1164
- const vClaimsOutput = v12.union([
1165
- DcqlMdocCredential.vModel.entries.namespaces,
1166
- DcqlSdJwtVcCredential.vModel.entries.claims,
1167
- DcqlW3cVcCredential.vModel.entries.claims
1168
- ]);
1169
- DcqlClaimsResult2.vClaimsEntrySuccessResult = v12.object({
1170
- success: v12.literal(true),
1171
- claim_index: v12.number(),
1172
- claim_id: v12.optional(vIdString),
1173
- output: vClaimsOutput
1174
- });
1175
- DcqlClaimsResult2.vClaimsEntryFailureResult = v12.object({
1176
- success: v12.literal(false),
1177
- claim_index: v12.number(),
1178
- claim_id: v12.optional(vIdString),
1179
- issues: v12.record(v12.string(), v12.unknown()),
1180
- output: v12.unknown()
1181
- });
1182
- DcqlClaimsResult2.vClaimSetSuccessResult = v12.object({
1183
- success: v12.literal(true),
1184
- // Undefined in case of no claim set
1185
- claim_set_index: v12.union([v12.number(), v12.undefined()]),
1186
- // We use indexes because if there are no claim sets, the ids can be undefined
1187
- // Can be empty array in case there are no claims
1188
- valid_claim_indexes: v12.optional(vNonEmptyArray(v12.number())),
1189
- failed_claim_indexes: v12.optional(v12.undefined()),
1190
- output: vClaimsOutput
1191
- });
1192
- DcqlClaimsResult2.vClaimSetFailureResult = v12.object({
1193
- success: v12.literal(false),
1194
- // Undefined in case of no claim set
1195
- claim_set_index: v12.union([v12.number(), v12.undefined()]),
1196
- // We use indexes because if there are no claim sets, the ids can be undefined
1197
- valid_claim_indexes: v12.optional(vNonEmptyArray(v12.number())),
1198
- failed_claim_indexes: vNonEmptyArray(v12.number()),
1199
- issues: v12.record(v12.string(), v12.unknown())
1200
- });
1201
- DcqlClaimsResult2.vClaimsSuccessResult = v12.object({
1202
- success: v12.literal(true),
1203
- valid_claims: v12.optional(vNonEmptyArray(DcqlClaimsResult2.vClaimsEntrySuccessResult)),
1204
- failed_claims: v12.optional(vNonEmptyArray(DcqlClaimsResult2.vClaimsEntryFailureResult)),
1205
- valid_claim_sets: vNonEmptyArray(DcqlClaimsResult2.vClaimSetSuccessResult),
1206
- failed_claim_sets: v12.optional(vNonEmptyArray(DcqlClaimsResult2.vClaimSetFailureResult))
1207
- });
1208
- DcqlClaimsResult2.vClaimsFailureResult = v12.object({
1209
- success: v12.literal(false),
1210
- valid_claims: v12.optional(vNonEmptyArray(DcqlClaimsResult2.vClaimsEntrySuccessResult)),
1211
- failed_claims: vNonEmptyArray(DcqlClaimsResult2.vClaimsEntryFailureResult),
1212
- valid_claim_sets: v12.optional(v12.undefined()),
1213
- failed_claim_sets: vNonEmptyArray(DcqlClaimsResult2.vClaimSetFailureResult)
1214
- });
1215
- DcqlClaimsResult2.vModel = v12.union([DcqlClaimsResult2.vClaimsSuccessResult, DcqlClaimsResult2.vClaimsFailureResult]);
1216
- })(DcqlClaimsResult || (DcqlClaimsResult = {}));
1217
-
1218
- // src/dcql-query-result/m-meta-result.ts
1219
- var v13 = __toESM(require("valibot"));
1220
- var DcqlMetaResult;
1221
- ((DcqlMetaResult2) => {
1222
- DcqlMetaResult2.vMetaSuccessResult = v13.object({
1223
- success: v13.literal(true),
1224
- output: v13.variant("credential_format", [
1225
- v13.pick(DcqlSdJwtVcCredential.vModel, ["credential_format", "cryptographic_holder_binding", "vct"]),
1226
- v13.pick(DcqlMdocCredential.vModel, ["credential_format", "cryptographic_holder_binding", "doctype"]),
1227
- v13.pick(DcqlW3cVcCredential.vModel, ["credential_format", "cryptographic_holder_binding", "type"])
1228
- ])
1229
- });
1230
- DcqlMetaResult2.vMetaFailureResult = v13.object({
1231
- success: v13.literal(false),
1232
- issues: v13.record(v13.string(), v13.unknown()),
1233
- output: v13.unknown()
1234
- });
1235
- DcqlMetaResult2.vModel = v13.union([DcqlMetaResult2.vMetaSuccessResult, DcqlMetaResult2.vMetaFailureResult]);
1236
- })(DcqlMetaResult || (DcqlMetaResult = {}));
1237
-
1238
- // src/dcql-query-result/m-trusted-authorities-result.ts
1239
- var v14 = __toESM(require("valibot"));
1240
- var DcqlTrustedAuthoritiesResult;
1241
- ((DcqlTrustedAuthoritiesResult2) => {
1242
- DcqlTrustedAuthoritiesResult2.vTrustedAuthorityEntrySuccessResult = v14.object({
1243
- success: v14.literal(true),
1244
- trusted_authority_index: v14.number(),
1245
- // We map from values (multiple options for a credential/query) to value (the matching option)
1246
- output: v14.variant(
1247
- "type",
1248
- DcqlCredentialTrustedAuthority.vModel.options.map(
1249
- (o) => v14.object({
1250
- type: o.entries.type,
1251
- value: o.entries.values.item
1252
- })
1253
- )
1254
- )
1255
- });
1256
- DcqlTrustedAuthoritiesResult2.vTrustedAuthorityEntryFailureResult = v14.object({
1257
- success: v14.literal(false),
1258
- trusted_authority_index: v14.number(),
1259
- issues: v14.record(v14.string(), v14.unknown()),
1260
- output: v14.unknown()
1261
- });
1262
- DcqlTrustedAuthoritiesResult2.vTrustedAuthoritySuccessResult = v14.union([
1263
- // In this case there is no trusted authority on the query
1264
- v14.object({
1265
- success: v14.literal(true),
1266
- valid_trusted_authority: v14.optional(v14.undefined()),
1267
- failed_trusted_authorities: v14.optional(v14.undefined())
1268
- }),
1269
- v14.object({
1270
- success: v14.literal(true),
1271
- valid_trusted_authority: DcqlTrustedAuthoritiesResult2.vTrustedAuthorityEntrySuccessResult,
1272
- failed_trusted_authorities: v14.optional(vNonEmptyArray(DcqlTrustedAuthoritiesResult2.vTrustedAuthorityEntryFailureResult))
1273
- })
1274
- ]);
1275
- DcqlTrustedAuthoritiesResult2.vTrustedAuthorityFailureResult = v14.object({
1276
- success: v14.literal(false),
1277
- valid_trusted_authority: v14.optional(v14.undefined()),
1278
- failed_trusted_authorities: vNonEmptyArray(DcqlTrustedAuthoritiesResult2.vTrustedAuthorityEntryFailureResult)
1279
- });
1280
- DcqlTrustedAuthoritiesResult2.vModel = v14.union([...DcqlTrustedAuthoritiesResult2.vTrustedAuthoritySuccessResult.options, DcqlTrustedAuthoritiesResult2.vTrustedAuthorityFailureResult]);
1281
- })(DcqlTrustedAuthoritiesResult || (DcqlTrustedAuthoritiesResult = {}));
1282
-
1283
- // src/dcql-query-result/m-dcql-query-result.ts
1284
- var DcqlQueryResult;
1285
- ((DcqlQueryResult2) => {
1286
- DcqlQueryResult2.vCredentialQueryItemCredentialSuccessResult = v15.object({
1287
- success: v15.literal(true),
1288
- input_credential_index: v15.number(),
1289
- trusted_authorities: DcqlTrustedAuthoritiesResult.vTrustedAuthoritySuccessResult,
1290
- // TODO: format specific (we should probably add format to this object, to differentiate?)
1291
- claims: DcqlClaimsResult.vClaimsSuccessResult,
1292
- meta: DcqlMetaResult.vMetaSuccessResult
1293
- });
1294
- DcqlQueryResult2.vCredentialQueryItemCredentialFailureResult = v15.object({
1295
- success: v15.literal(false),
1296
- input_credential_index: v15.number(),
1297
- trusted_authorities: DcqlTrustedAuthoritiesResult.vModel,
1298
- claims: DcqlClaimsResult.vModel,
1299
- meta: DcqlMetaResult.vModel
1300
- });
1301
- DcqlQueryResult2.vCredentialQueryItemResult = v15.union([
1302
- v15.object({
1303
- success: v15.literal(true),
1304
- credential_query_id: vIdString,
1305
- valid_credentials: vNonEmptyArray(DcqlQueryResult2.vCredentialQueryItemCredentialSuccessResult),
1306
- failed_credentials: v15.optional(vNonEmptyArray(DcqlQueryResult2.vCredentialQueryItemCredentialFailureResult))
1307
- }),
1308
- v15.object({
1309
- success: v15.literal(false),
1310
- credential_query_id: vIdString,
1311
- valid_credentials: v15.optional(v15.undefined()),
1312
- failed_credentials: v15.optional(vNonEmptyArray(DcqlQueryResult2.vCredentialQueryItemCredentialFailureResult))
1313
- })
1314
- ]);
1315
- DcqlQueryResult2.vCredentialQueryResult = v15.record(vIdString, DcqlQueryResult2.vCredentialQueryItemResult);
1316
- DcqlQueryResult2.vModel = v15.object({
1317
- credentials: v15.pipe(
1318
- vNonEmptyArray(DcqlCredentialQuery.vModel),
1319
- v15.description(
1320
- "REQUIRED. A non-empty array of Credential Queries that specify the requested Verifiable Credentials."
1321
- )
1322
- ),
1323
- credential_matches: DcqlQueryResult2.vCredentialQueryResult,
1324
- credential_sets: v15.optional(
1325
- v15.pipe(
1326
- vNonEmptyArray(
1327
- v15.object({
1328
- ...CredentialSetQuery.vModel.entries,
1329
- matching_options: v15.union([v15.undefined(), vNonEmptyArray(v15.array(v15.string()))])
1330
- })
1331
- ),
1332
- v15.description(
1333
- "OPTIONAL. A non-empty array of credential set queries that specifies additional constraints on which of the requested Verifiable Credentials to return."
1334
- )
1335
- )
1336
- ),
1337
- can_be_satisfied: v15.boolean()
1338
- });
1339
- })(DcqlQueryResult || (DcqlQueryResult = {}));
1340
-
1341
- // src/dcql-presentation/m-dcql-presentation-result.ts
1342
- var DcqlPresentationResult;
1343
- ((DcqlPresentationResult2) => {
1344
- DcqlPresentationResult2.vModel = v16.omit(DcqlQueryResult.vModel, ["credentials"]);
1345
- DcqlPresentationResult2.parse = (input) => {
1346
- return v16.parse(DcqlPresentationResult2.vModel, input);
1347
- };
1348
- DcqlPresentationResult2.fromDcqlPresentation = (dcqlPresentation, ctx) => {
1349
- const { dcqlQuery } = ctx;
1350
- const queriesResults = Object.entries(dcqlPresentation).map(([credentialQueryId, presentations]) => {
1351
- const credentialQuery = dcqlQuery.credentials.find((c) => c.id === credentialQueryId);
1352
- if (!credentialQuery) {
1353
- throw new DcqlPresentationResultError({
1354
- message: `Query ${credentialQueryId} not found in the dcql query. Cannot validate presentation.`
1355
- });
1356
- }
1357
- if (Array.isArray(presentations)) {
1358
- if (presentations.length === 0) {
1359
- throw new DcqlPresentationResultError({
1360
- message: `Query credential '${credentialQueryId}' is present in the presentations but the value is an empty array. Each entry must at least provide one presentation.`
1361
- });
1362
- }
1363
- if (!credentialQuery.multiple && presentations.length > 1) {
1364
- throw new DcqlPresentationResultError({
1365
- message: `Query credential '${credentialQueryId}' has not enabled 'multiple', but multiple presentations were provided. Only a single presentation is allowed for each query credential when 'multiple' is not enabled on the query.`
1366
- });
1367
- }
1368
- }
1369
- return runCredentialQuery(credentialQuery, {
1370
- presentation: true,
1371
- credentials: presentations ? Array.isArray(presentations) ? presentations : [presentations] : []
1372
- });
1373
- });
1374
- const credentialSetResults = dcqlQuery.credential_sets?.map((set) => {
1375
- const matchingOptions = set.options.filter(
1376
- (option) => option.every(
1377
- (credentialQueryId) => queriesResults.find((result) => result.credential_query_id === credentialQueryId)?.success
1378
- )
1379
- );
1380
- return {
1381
- ...set,
1382
- matching_options: matchingOptions.length > 0 ? matchingOptions : void 0
1383
- };
1384
- });
1385
- const dqclQueryMatched = (
1386
- // We require that all the submitted presentations match with the queries
1387
- // So we must have success for all queries, and we don't allow failed_credentials
1388
- queriesResults.every((result) => result.success && !result.failed_credentials) && (credentialSetResults ? credentialSetResults.every((set) => !set.required || set.matching_options) : (
1389
- // If not credential_sets are used, we require that at least every credential has a match
1390
- dcqlQuery.credentials.every(
1391
- (credentialQuery) => queriesResults.find((result) => result.credential_query_id === credentialQuery.id)?.success
1392
- )
1393
- ))
1394
- );
1395
- return {
1396
- // NOTE: can_be_satisfied is maybe not the best term, because we return false if it can be
1397
- // satisfied, but one of the provided presentations did not match
1398
- can_be_satisfied: dqclQueryMatched,
1399
- credential_sets: credentialSetResults,
1400
- credential_matches: Object.fromEntries(queriesResults.map((result) => [result.credential_query_id, result]))
1401
- };
1402
- };
1403
- DcqlPresentationResult2.validate = (dcqlQueryResult) => {
1404
- if (!dcqlQueryResult.can_be_satisfied) {
1405
- throw new DcqlInvalidPresentationRecordError({
1406
- message: "Invalid Presentation record",
1407
- cause: dcqlQueryResult
1408
- });
1409
- }
1410
- return dcqlQueryResult;
1411
- };
1412
- })(DcqlPresentationResult || (DcqlPresentationResult = {}));
1413
-
1414
- // src/dcql-presentation/m-dcql-presentation.ts
1415
- var v17 = __toESM(require("valibot"));
1416
- var DcqlPresentation;
1417
- ((DcqlPresentation2) => {
1418
- const vPresentationEntry = v17.union([v17.string(), vJsonRecord]);
1419
- DcqlPresentation2.vModel = v17.pipe(
1420
- v17.union([
1421
- v17.record(vIdString, vNonEmptyArray(vPresentationEntry)),
1422
- v17.record(
1423
- vIdString,
1424
- // We support presentation entry directly (not as array) to support older draft of DCQL
1425
- vPresentationEntry
1426
- )
1427
- ]),
1428
- v17.description(
1429
- "REQUIRED. This is a JSON-encoded object containing entries where the key is the id value used for a Credential Query in the DCQL query and the value is an array of one or more Presentations that match the respective Credential Query. When multiple is omitted, or set to false, the array MUST contain only one Presentation. There MUST NOT be any entry in the JSON-encoded object for optional Credential Queries when there are no matching Credentials for the respective Credential Query. Each Presentation is represented as a string or object, depending on the format as defined in Appendix B. The same rules as above apply for encoding the Presentations."
1430
- )
1431
- );
1432
- DcqlPresentation2.parse = (input) => {
1433
- if (typeof input === "string") {
1434
- return v17.parse(v17.pipe(v17.string(), vStringToJson, DcqlPresentation2.vModel), input);
1435
- }
1436
- return v17.parse(DcqlPresentation2.vModel, input);
1437
- };
1438
- DcqlPresentation2.encode = (input) => {
1439
- return JSON.stringify(input);
1440
- };
1441
- })(DcqlPresentation || (DcqlPresentation = {}));
1442
-
1443
- // src/dcql-query-result/run-dcql-query.ts
1444
- var runDcqlQuery = (dcqlQuery, ctx) => {
1445
- const credentialQueriesResults = Object.fromEntries(
1446
- dcqlQuery.credentials.map((credentialQuery) => [credentialQuery.id, runCredentialQuery(credentialQuery, ctx)])
1447
- );
1448
- const credentialSetResults = dcqlQuery.credential_sets?.map((set) => {
1449
- const matchingOptions = set.options.filter(
1450
- (option) => option.every((credentialQueryId) => credentialQueriesResults[credentialQueryId].success)
1451
- );
1452
- return {
1453
- ...set,
1454
- matching_options: matchingOptions.length > 0 ? matchingOptions : void 0
1455
- };
1456
- });
1457
- const dqclQueryMatched = credentialSetResults ? credentialSetResults.every((set) => !set.required || set.matching_options) : (
1458
- // If not credential_sets are used, we require that at least every credential has a match
1459
- dcqlQuery.credentials.every(({ id }) => credentialQueriesResults[id].success === true)
1460
- );
1461
- return {
1462
- ...dcqlQuery,
1463
- can_be_satisfied: dqclQueryMatched,
1464
- credential_matches: credentialQueriesResults,
1465
- credential_sets: credentialSetResults
1466
- };
1467
- };
1468
-
1469
- // src/dcql-query/m-dcql-query.ts
1470
- var v18 = __toESM(require("valibot"));
1471
- var DcqlQuery;
1472
- ((DcqlQuery2) => {
1473
- DcqlQuery2.vModel = v18.object({
1474
- credentials: v18.pipe(
1475
- vNonEmptyArray(DcqlCredentialQuery.vModel),
1476
- v18.description(
1477
- "REQUIRED. A non-empty array of Credential Queries that specify the requested Verifiable Credentials."
1478
- )
1479
- ),
1480
- credential_sets: v18.pipe(
1481
- v18.optional(vNonEmptyArray(CredentialSetQuery.vModel)),
1482
- v18.description(
1483
- "OPTIONAL. A non-empty array of credential set queries that specifies additional constraints on which of the requested Verifiable Credentials to return."
1484
- )
1485
- )
1486
- });
1487
- DcqlQuery2.validate = (dcqlQuery) => {
1488
- validateUniqueCredentialQueryIds(dcqlQuery);
1489
- validateCredentialSets(dcqlQuery);
1490
- dcqlQuery.credentials.forEach(DcqlCredentialQuery.validate);
1491
- };
1492
- DcqlQuery2.query = (dcqlQuery, credentials) => {
1493
- return runDcqlQuery(dcqlQuery, { credentials, presentation: false });
1494
- };
1495
- DcqlQuery2.parse = (input) => {
1496
- return v18.parse(DcqlQuery2.vModel, input);
1497
- };
1498
- })(DcqlQuery || (DcqlQuery = {}));
1499
- var validateUniqueCredentialQueryIds = (query) => {
1500
- const ids = query.credentials.map((c) => c.id);
1501
- const duplicates = ids.filter((id, index) => ids.indexOf(id) !== index);
1502
- if (duplicates.length > 0) {
1503
- throw new DcqlNonUniqueCredentialQueryIdsError({
1504
- message: `Duplicate credential query ids found: ${duplicates.join(", ")}`
1505
- });
1506
- }
1507
- };
1508
- var validateCredentialSets = (query) => {
1509
- if (!query.credential_sets) return;
1510
- const credentialQueryIds = new Set(query.credentials.map((c) => c.id));
1511
- const undefinedCredentialQueryIds = [];
1512
- for (const credential_set of query.credential_sets) {
1513
- for (const credentialSetOption of credential_set.options) {
1514
- for (const credentialQueryId of credentialSetOption) {
1515
- if (!credentialQueryIds.has(credentialQueryId)) {
1516
- undefinedCredentialQueryIds.push(credentialQueryId);
1517
- }
1518
- }
1519
- }
1520
- }
1521
- if (undefinedCredentialQueryIds.length > 0) {
1522
- throw new DcqlCredentialSetError({
1523
- message: `Credential set contains undefined credential id${undefinedCredentialQueryIds.length === 1 ? "" : "`s"} '${undefinedCredentialQueryIds.join(", ")}'`
1524
- });
1525
- }
1526
- };
1527
- // Annotate the CommonJS export names for ESM import in node:
1528
- 0 && (module.exports = {
1529
- CredentialSetQuery,
1530
- DcqlClaimsQuery,
1531
- DcqlCredential,
1532
- DcqlCredentialPresentation,
1533
- DcqlCredentialQuery,
1534
- DcqlCredentialSetError,
1535
- DcqlCredentialTrustedAuthority,
1536
- DcqlError,
1537
- DcqlInvalidClaimsQueryIdError,
1538
- DcqlInvalidPresentationRecordError,
1539
- DcqlMdocCredential,
1540
- DcqlMdocPresentation,
1541
- DcqlMissingClaimSetParseError,
1542
- DcqlNonUniqueCredentialQueryIdsError,
1543
- DcqlParseError,
1544
- DcqlPresentation,
1545
- DcqlPresentationResult,
1546
- DcqlPresentationResultError,
1547
- DcqlQuery,
1548
- DcqlQueryResult,
1549
- DcqlSdJwtVcCredential,
1550
- DcqlSdJwtVcPresentation,
1551
- DcqlTrustedAuthoritiesQuery,
1552
- DcqlUndefinedClaimSetIdError,
1553
- DcqlW3cVcCredential,
1554
- DcqlW3cVcPresentation,
1555
- getCauseFromUnknown,
1556
- getDcqlErrorFromUnknown,
1557
- runDcqlQuery
1558
- });
1559
- //# sourceMappingURL=index.js.map