dvlprsh-dcql-test 0.1.8

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/CHANGELOG.md ADDED
@@ -0,0 +1,37 @@
1
+ # Change Log
2
+
3
+ All notable changes to this project will be documented in this file.
4
+ See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
+
6
+ ## [0.1.8](https://github.com/hopae-official/Verifiable-Digital-Credentials/compare/v0.1.7...v0.1.8) (2025-06-15)
7
+
8
+ **Note:** Version bump only for package @vdcs/dcql
9
+
10
+
11
+
12
+
13
+
14
+ ## [0.1.7](https://github.com/hopae-official/Verifiable-Digital-Credentials/compare/v0.1.6...v0.1.7) (2025-06-15)
15
+
16
+ **Note:** Version bump only for package @vdcs/dcql
17
+
18
+
19
+
20
+
21
+
22
+ ## [0.1.6](https://github.com/hopae-official/Verifiable-Digital-Credentials/compare/v0.1.5...v0.1.6) (2025-06-15)
23
+
24
+ **Note:** Version bump only for package @vdcs/dcql
25
+
26
+
27
+
28
+
29
+
30
+ ## [0.1.4](https://github.com/hopae-official/Verifiable-Digital-Credentials/compare/v0.1.2...v0.1.4) (2025-06-08)
31
+
32
+
33
+ ### Features
34
+
35
+ * add dcql match feature ([#116](https://github.com/hopae-official/Verifiable-Digital-Credentials/issues/116)) ([952ff48](https://github.com/hopae-official/Verifiable-Digital-Credentials/commit/952ff48f4adc5908552e2737f025e8a48142cea3))
36
+ * add dcql serialization feature ([#103](https://github.com/hopae-official/Verifiable-Digital-Credentials/issues/103)) ([887e3c1](https://github.com/hopae-official/Verifiable-Digital-Credentials/commit/887e3c1c59eacb01a5d1c30db6ab32f8b89756ba))
37
+ * implement SdJwtVcCredential query parse ([#114](https://github.com/hopae-official/Verifiable-Digital-Credentials/issues/114)) ([51778d1](https://github.com/hopae-official/Verifiable-Digital-Credentials/commit/51778d1ff7c5877bbf88b0b80533db9ddd46d9ce))
@@ -0,0 +1,135 @@
1
+ type Format = 'dc+sd-jwt' | 'ldp_vc' | 'jwt_vc_json';
2
+ type TrustedAuthority = {
3
+ type: 'aki' | 'etsi_tl' | 'openid_federation';
4
+ value: string[];
5
+ };
6
+ type Credential = {
7
+ id: string;
8
+ format: Format;
9
+ /** optional, default is false */
10
+ multiple?: boolean;
11
+ meta?: {
12
+ vct_values: string[];
13
+ } | {
14
+ doctype_value: string;
15
+ };
16
+ trusted_authorities?: TrustedAuthority[];
17
+ /** optional, default is true */
18
+ require_cryptographic_holder_binding?: boolean;
19
+ claims?: Claims[];
20
+ claim_sets?: ClaimSet[];
21
+ };
22
+ type CredentialIds = Array<string>;
23
+ type CredentialSet = {
24
+ options: CredentialIds[];
25
+ purpose?: string;
26
+ /** optional, default is true */
27
+ required?: boolean;
28
+ };
29
+ type rawDCQL = {
30
+ credentials: Credential[];
31
+ credential_sets?: CredentialSet[];
32
+ };
33
+ type Claims = {
34
+ /** optional, but if claim_sets is present, it is required */
35
+ id?: string;
36
+ path: Array<string | number | null>;
37
+ value?: Array<number | string | boolean>;
38
+ };
39
+ type ClaimSet = string[];
40
+ type SdJwtVcCredentialQuery = Credential & {
41
+ format: 'dc+sd-jwt';
42
+ meta: {
43
+ vct_values: string[];
44
+ };
45
+ };
46
+ type MatchResult = {
47
+ match: false;
48
+ matchedClaims?: undefined;
49
+ } | {
50
+ match: true;
51
+ matchedClaims: Claims[];
52
+ };
53
+
54
+ /**
55
+ * This class represent a credential
56
+ *
57
+ *
58
+ */
59
+ declare abstract class CredentialBase {
60
+ abstract serialize(): Credential;
61
+ abstract match(data: Record<string, unknown>): MatchResult;
62
+ }
63
+
64
+ /**
65
+ * This class represent DCQL query data structure
66
+ */
67
+ declare class DCQL {
68
+ private _credentials;
69
+ private _credential_sets?;
70
+ constructor({ credentials, credential_sets, }: {
71
+ credentials?: CredentialBase[];
72
+ credential_sets?: CredentialSet[];
73
+ });
74
+ addCredential(credential: CredentialBase): this;
75
+ addCredentialSet(credential_set: CredentialSet): this;
76
+ serialize(): rawDCQL;
77
+ static parse(raw: rawDCQL): DCQL;
78
+ /**
79
+ * Match credentials against an array of data records according to section 6.4.2 rules.
80
+ *
81
+ * If credential_sets is not provided, all credentials in credentials are requested.
82
+ * Otherwise, the Verifier requests credentials satisfying:
83
+ * - All required credential sets (where required is true or omitted)
84
+ * - Optionally, any other credential sets
85
+ *
86
+ * @param dataRecords Array of data records to match against
87
+ * @returns Object containing match result and matched credentials with their claims
88
+ */
89
+ match(dataRecords: Record<string, unknown>[]): {
90
+ match: boolean;
91
+ matchedCredentials?: Array<{
92
+ credential: Record<string, unknown>;
93
+ matchedClaims: Claims[];
94
+ dataIndex: number;
95
+ }>;
96
+ };
97
+ /**
98
+ * Check if a credential set is satisfied by the matched credential IDs
99
+ * A credential set is satisfied if at least one of its options is satisfied
100
+ */
101
+ private isCredentialSetSatisfied;
102
+ }
103
+
104
+ declare class SdJwtVcCredential implements CredentialBase {
105
+ readonly id: string;
106
+ readonly vct_values: string[];
107
+ private _multiple?;
108
+ private _trusted_authorities?;
109
+ private _require_cryptographic_holder_binding?;
110
+ private _claims?;
111
+ private _claim_sets?;
112
+ constructor(id: string, vct_values: string[], options?: {
113
+ multiple?: boolean;
114
+ trusted_authorities?: TrustedAuthority[];
115
+ require_cryptographic_holder_binding?: boolean;
116
+ claims?: Claims[];
117
+ claim_sets?: ClaimSet[];
118
+ });
119
+ setMultiple(multiple: boolean): this;
120
+ setTrustedAuthorities(trusted_authorities: TrustedAuthority[]): this;
121
+ setRequireCryptographicHolderBinding(require_cryptographic_holder_binding: boolean): this;
122
+ setClaims(claims: Claims[]): this;
123
+ setClaimSets(claim_sets: ClaimSet[]): this;
124
+ serialize(): Credential;
125
+ match(data: Record<string, unknown>): MatchResult;
126
+ /**
127
+ * Helper method to check if a specific claim matches against the data
128
+ * Implements semantics for JSON-based credentials as specified in section 7.1
129
+ */
130
+ private matchClaim;
131
+ static parseSdJwtCredential(c: Credential): CredentialBase;
132
+ private static validateCredential;
133
+ }
134
+
135
+ export { type ClaimSet, type Claims, type Credential, CredentialBase, type CredentialIds, type CredentialSet, DCQL, type Format, type MatchResult, SdJwtVcCredential, type SdJwtVcCredentialQuery, type TrustedAuthority, type rawDCQL };
@@ -0,0 +1,135 @@
1
+ type Format = 'dc+sd-jwt' | 'ldp_vc' | 'jwt_vc_json';
2
+ type TrustedAuthority = {
3
+ type: 'aki' | 'etsi_tl' | 'openid_federation';
4
+ value: string[];
5
+ };
6
+ type Credential = {
7
+ id: string;
8
+ format: Format;
9
+ /** optional, default is false */
10
+ multiple?: boolean;
11
+ meta?: {
12
+ vct_values: string[];
13
+ } | {
14
+ doctype_value: string;
15
+ };
16
+ trusted_authorities?: TrustedAuthority[];
17
+ /** optional, default is true */
18
+ require_cryptographic_holder_binding?: boolean;
19
+ claims?: Claims[];
20
+ claim_sets?: ClaimSet[];
21
+ };
22
+ type CredentialIds = Array<string>;
23
+ type CredentialSet = {
24
+ options: CredentialIds[];
25
+ purpose?: string;
26
+ /** optional, default is true */
27
+ required?: boolean;
28
+ };
29
+ type rawDCQL = {
30
+ credentials: Credential[];
31
+ credential_sets?: CredentialSet[];
32
+ };
33
+ type Claims = {
34
+ /** optional, but if claim_sets is present, it is required */
35
+ id?: string;
36
+ path: Array<string | number | null>;
37
+ value?: Array<number | string | boolean>;
38
+ };
39
+ type ClaimSet = string[];
40
+ type SdJwtVcCredentialQuery = Credential & {
41
+ format: 'dc+sd-jwt';
42
+ meta: {
43
+ vct_values: string[];
44
+ };
45
+ };
46
+ type MatchResult = {
47
+ match: false;
48
+ matchedClaims?: undefined;
49
+ } | {
50
+ match: true;
51
+ matchedClaims: Claims[];
52
+ };
53
+
54
+ /**
55
+ * This class represent a credential
56
+ *
57
+ *
58
+ */
59
+ declare abstract class CredentialBase {
60
+ abstract serialize(): Credential;
61
+ abstract match(data: Record<string, unknown>): MatchResult;
62
+ }
63
+
64
+ /**
65
+ * This class represent DCQL query data structure
66
+ */
67
+ declare class DCQL {
68
+ private _credentials;
69
+ private _credential_sets?;
70
+ constructor({ credentials, credential_sets, }: {
71
+ credentials?: CredentialBase[];
72
+ credential_sets?: CredentialSet[];
73
+ });
74
+ addCredential(credential: CredentialBase): this;
75
+ addCredentialSet(credential_set: CredentialSet): this;
76
+ serialize(): rawDCQL;
77
+ static parse(raw: rawDCQL): DCQL;
78
+ /**
79
+ * Match credentials against an array of data records according to section 6.4.2 rules.
80
+ *
81
+ * If credential_sets is not provided, all credentials in credentials are requested.
82
+ * Otherwise, the Verifier requests credentials satisfying:
83
+ * - All required credential sets (where required is true or omitted)
84
+ * - Optionally, any other credential sets
85
+ *
86
+ * @param dataRecords Array of data records to match against
87
+ * @returns Object containing match result and matched credentials with their claims
88
+ */
89
+ match(dataRecords: Record<string, unknown>[]): {
90
+ match: boolean;
91
+ matchedCredentials?: Array<{
92
+ credential: Record<string, unknown>;
93
+ matchedClaims: Claims[];
94
+ dataIndex: number;
95
+ }>;
96
+ };
97
+ /**
98
+ * Check if a credential set is satisfied by the matched credential IDs
99
+ * A credential set is satisfied if at least one of its options is satisfied
100
+ */
101
+ private isCredentialSetSatisfied;
102
+ }
103
+
104
+ declare class SdJwtVcCredential implements CredentialBase {
105
+ readonly id: string;
106
+ readonly vct_values: string[];
107
+ private _multiple?;
108
+ private _trusted_authorities?;
109
+ private _require_cryptographic_holder_binding?;
110
+ private _claims?;
111
+ private _claim_sets?;
112
+ constructor(id: string, vct_values: string[], options?: {
113
+ multiple?: boolean;
114
+ trusted_authorities?: TrustedAuthority[];
115
+ require_cryptographic_holder_binding?: boolean;
116
+ claims?: Claims[];
117
+ claim_sets?: ClaimSet[];
118
+ });
119
+ setMultiple(multiple: boolean): this;
120
+ setTrustedAuthorities(trusted_authorities: TrustedAuthority[]): this;
121
+ setRequireCryptographicHolderBinding(require_cryptographic_holder_binding: boolean): this;
122
+ setClaims(claims: Claims[]): this;
123
+ setClaimSets(claim_sets: ClaimSet[]): this;
124
+ serialize(): Credential;
125
+ match(data: Record<string, unknown>): MatchResult;
126
+ /**
127
+ * Helper method to check if a specific claim matches against the data
128
+ * Implements semantics for JSON-based credentials as specified in section 7.1
129
+ */
130
+ private matchClaim;
131
+ static parseSdJwtCredential(c: Credential): CredentialBase;
132
+ private static validateCredential;
133
+ }
134
+
135
+ export { type ClaimSet, type Claims, type Credential, CredentialBase, type CredentialIds, type CredentialSet, DCQL, type Format, type MatchResult, SdJwtVcCredential, type SdJwtVcCredentialQuery, type TrustedAuthority, type rawDCQL };
package/dist/index.js ADDED
@@ -0,0 +1,341 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
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 __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
21
+ var __publicField = (obj, key, value) => {
22
+ __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
23
+ return value;
24
+ };
25
+
26
+ // src/index.ts
27
+ var src_exports = {};
28
+ __export(src_exports, {
29
+ CredentialBase: () => CredentialBase,
30
+ DCQL: () => DCQL,
31
+ SdJwtVcCredential: () => SdJwtVcCredential
32
+ });
33
+ module.exports = __toCommonJS(src_exports);
34
+
35
+ // src/match.ts
36
+ var pathMatch = /* @__PURE__ */ __name((path, data) => {
37
+ let selectedElements = [
38
+ data
39
+ ];
40
+ for (const component of path) {
41
+ const nextSelectedElements = [];
42
+ for (const element of selectedElements) {
43
+ if (typeof component === "string") {
44
+ if (element === null || typeof element !== "object" || Array.isArray(element)) {
45
+ throw new Error("Path component requires object but found non-object element");
46
+ }
47
+ if (component in element) {
48
+ nextSelectedElements.push(element[component]);
49
+ }
50
+ } else if (component === null) {
51
+ if (element === null || !Array.isArray(element)) {
52
+ throw new Error("Null path component requires array but found non-array element");
53
+ }
54
+ nextSelectedElements.push(...element);
55
+ } else if (typeof component === "number" && component >= 0 && Number.isInteger(component)) {
56
+ if (element === null || !Array.isArray(element)) {
57
+ throw new Error("Numeric path component requires array but found non-array element");
58
+ }
59
+ if (component < element.length) {
60
+ nextSelectedElements.push(element[component]);
61
+ }
62
+ } else {
63
+ throw new Error(`Invalid path component: ${component}`);
64
+ }
65
+ }
66
+ if (nextSelectedElements.length === 0) {
67
+ throw new Error("No elements selected after processing path component");
68
+ }
69
+ selectedElements = nextSelectedElements;
70
+ }
71
+ return selectedElements;
72
+ }, "pathMatch");
73
+
74
+ // src/credentials/sdjwtvc.credential.ts
75
+ var _SdJwtVcCredential = class _SdJwtVcCredential {
76
+ constructor(id, vct_values, options) {
77
+ __publicField(this, "id");
78
+ __publicField(this, "vct_values");
79
+ __publicField(this, "_multiple");
80
+ __publicField(this, "_trusted_authorities");
81
+ __publicField(this, "_require_cryptographic_holder_binding");
82
+ __publicField(this, "_claims");
83
+ __publicField(this, "_claim_sets");
84
+ this.id = id;
85
+ this.vct_values = vct_values;
86
+ if (options) {
87
+ this._multiple = options.multiple;
88
+ this._trusted_authorities = options.trusted_authorities;
89
+ this._require_cryptographic_holder_binding = options.require_cryptographic_holder_binding;
90
+ this._claims = options.claims;
91
+ this._claim_sets = options.claim_sets;
92
+ }
93
+ }
94
+ setMultiple(multiple) {
95
+ this._multiple = multiple;
96
+ return this;
97
+ }
98
+ setTrustedAuthorities(trusted_authorities) {
99
+ this._trusted_authorities = trusted_authorities;
100
+ return this;
101
+ }
102
+ setRequireCryptographicHolderBinding(require_cryptographic_holder_binding) {
103
+ this._require_cryptographic_holder_binding = require_cryptographic_holder_binding;
104
+ return this;
105
+ }
106
+ setClaims(claims) {
107
+ this._claims = claims;
108
+ return this;
109
+ }
110
+ setClaimSets(claim_sets) {
111
+ if (!this._claims || this._claims.length === 0) {
112
+ throw new Error("Claims must be set before claim sets");
113
+ }
114
+ if (!this._claims.every((c) => c.id !== void 0)) {
115
+ throw new Error("Claims must not have an id before claim sets");
116
+ }
117
+ this._claim_sets = claim_sets;
118
+ return this;
119
+ }
120
+ serialize() {
121
+ return {
122
+ id: this.id,
123
+ format: "dc+sd-jwt",
124
+ meta: {
125
+ vct_values: this.vct_values
126
+ },
127
+ multiple: this._multiple,
128
+ trusted_authorities: this._trusted_authorities,
129
+ require_cryptographic_holder_binding: this._require_cryptographic_holder_binding,
130
+ claims: this._claims,
131
+ claim_sets: this._claim_sets
132
+ };
133
+ }
134
+ match(data) {
135
+ if (data["vct"] !== void 0 && !this.vct_values.includes(data["vct"])) {
136
+ return {
137
+ match: false
138
+ };
139
+ }
140
+ if (!this._claims || this._claims.length === 0) {
141
+ return {
142
+ match: true,
143
+ matchedClaims: []
144
+ };
145
+ }
146
+ if (this._claim_sets && this._claim_sets.length > 0) {
147
+ for (const claimSet of this._claim_sets) {
148
+ const claimsInSet = this._claims.filter((claim) => claim.id !== void 0 && claimSet.includes(claim.id));
149
+ const allClaimsMatch = claimsInSet.every((claim) => this.matchClaim(claim, data));
150
+ if (allClaimsMatch && claimsInSet.length > 0) {
151
+ return {
152
+ match: true,
153
+ matchedClaims: claimsInSet
154
+ };
155
+ }
156
+ }
157
+ return {
158
+ match: false
159
+ };
160
+ } else {
161
+ const satisfiableClaims = this._claims.every((claim) => this.matchClaim(claim, data));
162
+ if (satisfiableClaims) {
163
+ return {
164
+ match: true,
165
+ matchedClaims: this._claims
166
+ };
167
+ }
168
+ }
169
+ return {
170
+ match: false
171
+ };
172
+ }
173
+ /**
174
+ * Helper method to check if a specific claim matches against the data
175
+ * Implements semantics for JSON-based credentials as specified in section 7.1
176
+ */
177
+ matchClaim(claim, data) {
178
+ try {
179
+ const selectedElements = pathMatch(claim.path, data);
180
+ if (selectedElements.length === 0) {
181
+ return false;
182
+ }
183
+ if (!claim.value || claim.value.length === 0) {
184
+ return true;
185
+ }
186
+ return selectedElements.some((element) => claim.value.some((val) => val === element));
187
+ } catch (error) {
188
+ return false;
189
+ }
190
+ }
191
+ static parseSdJwtCredential(c) {
192
+ if (!this.validateCredential(c)) {
193
+ throw new Error("Invalid credential");
194
+ }
195
+ const sdJwtVcCredential = new _SdJwtVcCredential(c.id, c.meta.vct_values, {
196
+ multiple: c.multiple,
197
+ trusted_authorities: c.trusted_authorities,
198
+ require_cryptographic_holder_binding: c.require_cryptographic_holder_binding,
199
+ claims: c.claims,
200
+ claim_sets: c.claim_sets
201
+ });
202
+ return sdJwtVcCredential;
203
+ }
204
+ static validateCredential(c) {
205
+ if (c.format !== "dc+sd-jwt") {
206
+ throw new Error("Invalid credential format");
207
+ }
208
+ if (!c.meta || !("vct_values" in c.meta)) {
209
+ throw new Error("Invalid credential meta");
210
+ }
211
+ return true;
212
+ }
213
+ };
214
+ __name(_SdJwtVcCredential, "SdJwtVcCredential");
215
+ var SdJwtVcCredential = _SdJwtVcCredential;
216
+
217
+ // src/dcql.ts
218
+ var _DCQL = class _DCQL {
219
+ constructor({ credentials, credential_sets }) {
220
+ __publicField(this, "_credentials", []);
221
+ __publicField(this, "_credential_sets");
222
+ this._credentials = credentials ?? [];
223
+ this._credential_sets = credential_sets;
224
+ }
225
+ addCredential(credential) {
226
+ this._credentials.push(credential);
227
+ return this;
228
+ }
229
+ addCredentialSet(credential_set) {
230
+ if (!this._credential_sets) {
231
+ this._credential_sets = [];
232
+ }
233
+ this._credential_sets.push(credential_set);
234
+ return this;
235
+ }
236
+ serialize() {
237
+ return {
238
+ credentials: this._credentials.map((c) => c.serialize()),
239
+ credential_sets: this._credential_sets
240
+ };
241
+ }
242
+ static parse(raw) {
243
+ const credentials = raw.credentials.map((c) => {
244
+ if (c.format === "dc+sd-jwt") {
245
+ return SdJwtVcCredential.parseSdJwtCredential(c);
246
+ }
247
+ throw new Error("Invalid credential format");
248
+ });
249
+ return new _DCQL({
250
+ credentials,
251
+ credential_sets: raw.credential_sets
252
+ });
253
+ }
254
+ /**
255
+ * Match credentials against an array of data records according to section 6.4.2 rules.
256
+ *
257
+ * If credential_sets is not provided, all credentials in credentials are requested.
258
+ * Otherwise, the Verifier requests credentials satisfying:
259
+ * - All required credential sets (where required is true or omitted)
260
+ * - Optionally, any other credential sets
261
+ *
262
+ * @param dataRecords Array of data records to match against
263
+ * @returns Object containing match result and matched credentials with their claims
264
+ */
265
+ match(dataRecords) {
266
+ if (this._credentials.length === 0) {
267
+ return {
268
+ match: false
269
+ };
270
+ }
271
+ const allMatches = [];
272
+ this._credentials.forEach((credential) => {
273
+ dataRecords.forEach((data, index) => {
274
+ const result = credential.match(data);
275
+ if (result.match) {
276
+ allMatches.push({
277
+ credential: data,
278
+ dcqlCredential: credential,
279
+ matchedClaims: result.matchedClaims,
280
+ dataIndex: index
281
+ });
282
+ }
283
+ });
284
+ });
285
+ if (allMatches.length === 0) {
286
+ return {
287
+ match: false
288
+ };
289
+ }
290
+ if (!this._credential_sets || this._credential_sets.length === 0) {
291
+ return {
292
+ match: true,
293
+ matchedCredentials: allMatches
294
+ };
295
+ }
296
+ const matchedIds = new Set(allMatches.map((match) => {
297
+ const serialized = match.dcqlCredential.serialize();
298
+ return serialized.id;
299
+ }));
300
+ const requiredSets = this._credential_sets.filter((set) => set.required === void 0 || set.required === true);
301
+ const satisfiedRequiredSets = requiredSets.every((set) => this.isCredentialSetSatisfied(set, matchedIds));
302
+ if (!satisfiedRequiredSets) {
303
+ return {
304
+ match: false
305
+ };
306
+ }
307
+ return {
308
+ match: true,
309
+ matchedCredentials: allMatches.map((matches) => {
310
+ return {
311
+ credential: matches.credential,
312
+ matchedClaims: matches.matchedClaims,
313
+ dataIndex: matches.dataIndex
314
+ };
315
+ })
316
+ };
317
+ }
318
+ /**
319
+ * Check if a credential set is satisfied by the matched credential IDs
320
+ * A credential set is satisfied if at least one of its options is satisfied
321
+ */
322
+ isCredentialSetSatisfied(set, matchedIds) {
323
+ return set.options.some((option) => {
324
+ return option.every((credentialId) => matchedIds.has(credentialId));
325
+ });
326
+ }
327
+ };
328
+ __name(_DCQL, "DCQL");
329
+ var DCQL = _DCQL;
330
+
331
+ // src/credentials/credential.ts
332
+ var _CredentialBase = class _CredentialBase {
333
+ };
334
+ __name(_CredentialBase, "CredentialBase");
335
+ var CredentialBase = _CredentialBase;
336
+ // Annotate the CommonJS export names for ESM import in node:
337
+ 0 && (module.exports = {
338
+ CredentialBase,
339
+ DCQL,
340
+ SdJwtVcCredential
341
+ });