@sphereon/ssi-sdk.siopv2-oid4vp-op-auth 0.34.1-feature.SSISDK.44.finish.dcql.314 → 0.34.1-feature.SSISDK.44.finish.dcql.315
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.cjs +10 -15
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +11 -16
- package/dist/index.js.map +1 -1
- package/package.json +19 -19
- package/src/session/OID4VP.ts +15 -23
package/dist/index.cjs
CHANGED
|
@@ -680,26 +680,21 @@ function extractOriginalCredential(credential) {
|
|
|
680
680
|
}
|
|
681
681
|
__name(extractOriginalCredential, "extractOriginalCredential");
|
|
682
682
|
function detectCredentialFormat(credential) {
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
}
|
|
687
|
-
const parts = credential.split(".");
|
|
688
|
-
if (parts.length === 3) {
|
|
683
|
+
const documentFormat = import_ssi_types.CredentialMapper.detectDocumentType(credential);
|
|
684
|
+
switch (documentFormat) {
|
|
685
|
+
case import_ssi_types.DocumentFormat.JWT:
|
|
689
686
|
return "jwt_vc_json";
|
|
690
|
-
|
|
691
|
-
} else if (typeof credential === "object") {
|
|
692
|
-
if ("compactSdJwtVc" in credential) {
|
|
687
|
+
case import_ssi_types.DocumentFormat.SD_JWT_VC:
|
|
693
688
|
return "dc+sd-jwt";
|
|
694
|
-
|
|
695
|
-
if ("@context" in credential || "proof" in credential) {
|
|
689
|
+
case import_ssi_types.DocumentFormat.JSONLD:
|
|
696
690
|
return "ldp_vc";
|
|
697
|
-
|
|
698
|
-
if ("doctype" in credential || "namespaces" in credential) {
|
|
691
|
+
case import_ssi_types.DocumentFormat.MSO_MDOC:
|
|
699
692
|
return "mso_mdoc";
|
|
700
|
-
|
|
693
|
+
case import_ssi_types.DocumentFormat.EIP712:
|
|
694
|
+
return "ldp_vc";
|
|
695
|
+
default:
|
|
696
|
+
return "jwt_vc_json";
|
|
701
697
|
}
|
|
702
|
-
return "jwt_vc_json";
|
|
703
698
|
}
|
|
704
699
|
__name(detectCredentialFormat, "detectCredentialFormat");
|
|
705
700
|
function getIdentifierString(identifier) {
|