From 3bbddfa5ae7fc43bfbe742f1ea9aa305a050e7ca Mon Sep 17 00:00:00 2001 From: Sagar Khole Date: Fri, 3 Jul 2026 09:37:48 +0530 Subject: [PATCH 1/2] fix(dcql): resolve ldp_vc query filtering and json-ld serialization errors Signed-off-by: Sagar Khole --- ...02+fix: export defaultDocumentLoader.patch | 60 ++++++++++++++----- .../@digitalcredentials+jsonld+9.0.0.patch | 14 +++++ 2 files changed, 58 insertions(+), 16 deletions(-) create mode 100644 patches/@digitalcredentials+jsonld+9.0.0.patch diff --git a/patches/@credo-ts+core+0.6.2+002+fix: export defaultDocumentLoader.patch b/patches/@credo-ts+core+0.6.2+002+fix: export defaultDocumentLoader.patch index 81c03cb3..4acbdd30 100644 --- a/patches/@credo-ts+core+0.6.2+002+fix: export defaultDocumentLoader.patch +++ b/patches/@credo-ts+core+0.6.2+002+fix: export defaultDocumentLoader.patch @@ -1,3 +1,16 @@ +diff --git a/node_modules/@credo-ts/core/build/modules/dcql/DcqlService.mjs b/node_modules/@credo-ts/core/build/modules/dcql/DcqlService.mjs +index 08f7602..41315a4 100644 +--- a/node_modules/@credo-ts/core/build/modules/dcql/DcqlService.mjs ++++ b/node_modules/@credo-ts/core/build/modules/dcql/DcqlService.mjs +@@ -79,7 +79,7 @@ let DcqlService = class DcqlService { + if (formats.has("ldp_vc")) { + const w3cRecords = await w3cCredentialRepository.findByQuery(agentContext, { + claimFormat: ClaimFormat.LdpVc, +- $or: dcqlQuery.credentials.flatMap((c) => c.format === "jwt_vc_json" ? c.meta.type_values : []).map((typeValues) => ({ expandedTypes: typeValues })) ++ $or: dcqlQuery.credentials.flatMap((c) => c.format === "ldp_vc" ? c.meta.type_values : []).map((typeValues) => ({ expandedTypes: typeValues })) + }); + allRecords.push(...w3cRecords); + } diff --git a/node_modules/@credo-ts/core/build/modules/vc/data-integrity/libraries/documentLoader.d.mts b/node_modules/@credo-ts/core/build/modules/vc/data-integrity/libraries/documentLoader.d.mts index 195af1d..30d1638 100644 --- a/node_modules/@credo-ts/core/build/modules/vc/data-integrity/libraries/documentLoader.d.mts @@ -9,19 +22,34 @@ index 195af1d..30d1638 100644 +export declare function defaultDocumentLoader(agentContext: AgentContext): DocumentLoader; //# sourceMappingURL=documentLoader.d.mts.map \ No newline at end of file -diff --git a/node_modules/@credo-ts/core/package.json b/node_modules/@credo-ts/core/package.json -index 8198ea2..5d23e62 100644 ---- a/node_modules/@credo-ts/core/package.json -+++ b/node_modules/@credo-ts/core/package.json -@@ -7,6 +7,11 @@ - "import": "./build/modules/kms/index.mjs", - "require": "./build/modules/kms/index.mjs", - "types": "./build/modules/kms/index.d.mts" -+ }, -+ "./build/modules/vc/data-integrity/libraries/documentLoader.mjs": { -+ "import": "./build/modules/vc/data-integrity/libraries/documentLoader.mjs", -+ "require": "./build/modules/vc/data-integrity/libraries/documentLoader.mjs", -+ "types": "./build/modules/vc/data-integrity/libraries/documentLoader.d.mts" - } - }, - "version": "0.6.2", +diff --git a/node_modules/@credo-ts/core/build/modules/vc/models/credential/W3cCredential.mjs b/node_modules/@credo-ts/core/build/modules/vc/models/credential/W3cCredential.mjs +index 6b5f0fa..88229b8 100644 +--- a/node_modules/@credo-ts/core/build/modules/vc/models/credential/W3cCredential.mjs ++++ b/node_modules/@credo-ts/core/build/modules/vc/models/credential/W3cCredential.mjs +@@ -21,11 +21,11 @@ var W3cCredential = class W3cCredential { + constructor(options) { + if (options) { + this.context = options.context ?? [CREDENTIALS_CONTEXT_V1_URL]; +- this.id = options.id; ++ if (options.id !== undefined) this.id = options.id; + this.type = options.type || ["VerifiableCredential"]; + this.issuer = typeof options.issuer === "string" || options.issuer instanceof W3cIssuer ? options.issuer : new W3cIssuer(options.issuer); + this.issuanceDate = options.issuanceDate; +- this.expirationDate = options.expirationDate; ++ if (options.expirationDate !== undefined) this.expirationDate = options.expirationDate; + this.credentialSubject = mapSingleOrArray(options.credentialSubject, (subject) => subject instanceof W3cCredentialSubject ? subject : new W3cCredentialSubject(subject)); + if (options.credentialStatus) this.credentialStatus = options.credentialStatus instanceof W3cCredentialStatus ? options.credentialStatus : new W3cCredentialStatus(options.credentialStatus); + if (options.credentialSchema) this.credentialSchema = mapSingleOrArray(options.credentialSchema, (schema) => schema instanceof W3cCredentialSchema ? schema : new W3cCredentialSchema(schema)); +diff --git a/node_modules/@credo-ts/core/build/modules/vc/models/presentation/W3cPresentation.mjs b/node_modules/@credo-ts/core/build/modules/vc/models/presentation/W3cPresentation.mjs +index 626062a..c88156d 100644 +--- a/node_modules/@credo-ts/core/build/modules/vc/models/presentation/W3cPresentation.mjs ++++ b/node_modules/@credo-ts/core/build/modules/vc/models/presentation/W3cPresentation.mjs +@@ -19,7 +19,7 @@ var _ref, _ref2; + var W3cPresentation = class { + constructor(options) { + if (options) { +- this.id = options.id; ++ if (options.id !== undefined) this.id = options.id; + this.context = options.context ?? [CREDENTIALS_CONTEXT_V1_URL]; + this.type = options.type ?? [VERIFIABLE_PRESENTATION_TYPE]; + this.verifiableCredential = options.verifiableCredential; diff --git a/patches/@digitalcredentials+jsonld+9.0.0.patch b/patches/@digitalcredentials+jsonld+9.0.0.patch new file mode 100644 index 00000000..99d4afbf --- /dev/null +++ b/patches/@digitalcredentials+jsonld+9.0.0.patch @@ -0,0 +1,14 @@ +diff --git a/node_modules/@digitalcredentials/jsonld/lib/expand.js b/node_modules/@digitalcredentials/jsonld/lib/expand.js +index dc52fc6..be9f56e 100644 +--- a/node_modules/@digitalcredentials/jsonld/lib/expand.js ++++ b/node_modules/@digitalcredentials/jsonld/lib/expand.js +@@ -475,6 +475,9 @@ async function _expandObject({ + + for(const key of keys) { + let value = element[key]; ++ if(value === undefined) { ++ continue; ++ } + let expandedValue; + + // skip @context From 660dd5acd0ab451c9aa358050322e2cd5ad13731 Mon Sep 17 00:00:00 2001 From: Sagar Khole Date: Fri, 3 Jul 2026 09:56:00 +0530 Subject: [PATCH 2/2] fix(dcql): resolve ldp_vc query filtering and json-ld serialization errors Signed-off-by: Sagar Khole --- ...-change-version-string-type-import-esm-export-interface.patch} | 0 ...redo-ts+core+0.6.2+002-fix-export-defaultDocumentLoader.patch} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename patches/{@credo-ts+core+0.6.2+001+fix: change version string type-import esm-export interface.patch => @credo-ts+core+0.6.2+001-fix-change-version-string-type-import-esm-export-interface.patch} (100%) rename patches/{@credo-ts+core+0.6.2+002+fix: export defaultDocumentLoader.patch => @credo-ts+core+0.6.2+002-fix-export-defaultDocumentLoader.patch} (100%) diff --git a/patches/@credo-ts+core+0.6.2+001+fix: change version string type-import esm-export interface.patch b/patches/@credo-ts+core+0.6.2+001-fix-change-version-string-type-import-esm-export-interface.patch similarity index 100% rename from patches/@credo-ts+core+0.6.2+001+fix: change version string type-import esm-export interface.patch rename to patches/@credo-ts+core+0.6.2+001-fix-change-version-string-type-import-esm-export-interface.patch diff --git a/patches/@credo-ts+core+0.6.2+002+fix: export defaultDocumentLoader.patch b/patches/@credo-ts+core+0.6.2+002-fix-export-defaultDocumentLoader.patch similarity index 100% rename from patches/@credo-ts+core+0.6.2+002+fix: export defaultDocumentLoader.patch rename to patches/@credo-ts+core+0.6.2+002-fix-export-defaultDocumentLoader.patch