@sphereon/ssi-sdk-ext.did-utils
Advanced tools
Comparing version 0.13.1-next.5 to 0.13.1-next.6
@@ -283,2 +283,3 @@ "use strict"; | ||
let resolutionResult; | ||
let origResolutionResult; | ||
let err; | ||
@@ -293,2 +294,8 @@ if (this.resolverResolution) { | ||
} | ||
if (resolutionResult) { | ||
origResolutionResult = resolutionResult; | ||
if (resolutionResult.didDocument === null) { | ||
resolutionResult = undefined; | ||
} | ||
} | ||
if (!resolutionResult && this.localResolution) { | ||
@@ -299,3 +306,5 @@ try { | ||
resolutionResult = toDidResolutionResult(iIdentifier, { did }); | ||
err = undefined; | ||
if (resolutionResult.didDocument) { | ||
err = undefined; | ||
} | ||
} | ||
@@ -308,5 +317,18 @@ catch (error) { | ||
} | ||
if (resolutionResult) { | ||
if (!origResolutionResult) { | ||
origResolutionResult = resolutionResult; | ||
} | ||
if (!resolutionResult.didDocument) { | ||
resolutionResult = undefined; | ||
} | ||
} | ||
if (!resolutionResult && this.uniresolverResolution) { | ||
resolutionResult = yield new did_uni_client_1.UniResolver().resolve(didUrl, options); | ||
err = undefined; | ||
if (!origResolutionResult) { | ||
origResolutionResult = resolutionResult; | ||
} | ||
if (resolutionResult.didDocument) { | ||
err = undefined; | ||
} | ||
} | ||
@@ -317,6 +339,6 @@ if (err) { | ||
} | ||
if (!resolutionResult) { | ||
if (!resolutionResult && !origResolutionResult) { | ||
throw `Could not resolve ${didUrl}. Resolutions tried: online: ${this.resolverResolution}, local: ${this.localResolution}, uni resolver: ${this.uniresolverResolution}`; | ||
} | ||
return resolutionResult; | ||
return resolutionResult !== null && resolutionResult !== void 0 ? resolutionResult : origResolutionResult; | ||
}); | ||
@@ -323,0 +345,0 @@ } |
{ | ||
"name": "@sphereon/ssi-sdk-ext.did-utils", | ||
"description": "DID Utils", | ||
"version": "0.13.1-next.5+91def9c", | ||
"version": "0.13.1-next.6+a678459", | ||
"source": "src/index.ts", | ||
@@ -14,3 +14,3 @@ "main": "dist/index.js", | ||
"@sphereon/did-uni-client": "^0.6.0", | ||
"@sphereon/ssi-sdk-ext.key-utils": "0.13.1-next.5+91def9c", | ||
"@sphereon/ssi-sdk-ext.key-utils": "0.13.1-next.6+a678459", | ||
"@veramo/core": "4.2.0", | ||
@@ -38,3 +38,3 @@ "@veramo/utils": "4.2.0", | ||
"keywords": [], | ||
"gitHead": "91def9c446849521f5e9da5beb07bab6871501d1" | ||
"gitHead": "a678459a74b6b8a39f5b2229e790ca06a346d93e" | ||
} |
@@ -271,2 +271,3 @@ import { UniResolver } from '@sphereon/did-uni-client' | ||
let resolutionResult: DIDResolutionResult | undefined | ||
let origResolutionResult: DIDResolutionResult | undefined | ||
let err: any | ||
@@ -280,2 +281,8 @@ if (this.resolverResolution) { | ||
} | ||
if (resolutionResult) { | ||
origResolutionResult = resolutionResult | ||
if (resolutionResult.didDocument === null) { | ||
resolutionResult = undefined | ||
} | ||
} | ||
if (!resolutionResult && this.localResolution) { | ||
@@ -286,3 +293,5 @@ try { | ||
resolutionResult = toDidResolutionResult(iIdentifier, { did }) | ||
err = undefined | ||
if (resolutionResult.didDocument) { | ||
err = undefined | ||
} | ||
} catch (error: unknown) { | ||
@@ -294,5 +303,18 @@ if (!err) { | ||
} | ||
if (resolutionResult) { | ||
if (!origResolutionResult) { | ||
origResolutionResult = resolutionResult | ||
} | ||
if (!resolutionResult.didDocument) { | ||
resolutionResult = undefined | ||
} | ||
} | ||
if (!resolutionResult && this.uniresolverResolution) { | ||
resolutionResult = await new UniResolver().resolve(didUrl, options) | ||
err = undefined | ||
if (!origResolutionResult) { | ||
origResolutionResult = resolutionResult | ||
} | ||
if (resolutionResult.didDocument) { | ||
err = undefined | ||
} | ||
} | ||
@@ -304,6 +326,6 @@ | ||
} | ||
if (!resolutionResult) { | ||
if (!resolutionResult && !origResolutionResult) { | ||
throw `Could not resolve ${didUrl}. Resolutions tried: online: ${this.resolverResolution}, local: ${this.localResolution}, uni resolver: ${this.uniresolverResolution}` | ||
} | ||
return resolutionResult | ||
return resolutionResult ?? origResolutionResult! | ||
} | ||
@@ -310,0 +332,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
72578
944