@sphereon/ssi-types 0.34.1-feature.merge.crypto.extensions.modules.39 → 0.34.1-fix.78

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 CHANGED
@@ -100,26 +100,26 @@ module.exports = __toCommonJS(index_exports);
100
100
  // src/logging/index.ts
101
101
  var import_debug = __toESM(require("debug"), 1);
102
102
  var import_events = require("events");
103
- var LogLevel = /* @__PURE__ */ (function(LogLevel2) {
103
+ var LogLevel = /* @__PURE__ */ function(LogLevel2) {
104
104
  LogLevel2[LogLevel2["TRACE"] = 0] = "TRACE";
105
105
  LogLevel2[LogLevel2["DEBUG"] = 1] = "DEBUG";
106
106
  LogLevel2[LogLevel2["INFO"] = 2] = "INFO";
107
107
  LogLevel2[LogLevel2["WARNING"] = 3] = "WARNING";
108
108
  LogLevel2[LogLevel2["ERROR"] = 4] = "ERROR";
109
109
  return LogLevel2;
110
- })({});
111
- var LoggingEventType = /* @__PURE__ */ (function(LoggingEventType2) {
110
+ }({});
111
+ var LoggingEventType = /* @__PURE__ */ function(LoggingEventType2) {
112
112
  LoggingEventType2["AUDIT"] = "audit";
113
113
  LoggingEventType2["ACTIVITY"] = "activity";
114
114
  LoggingEventType2["GENERAL"] = "general";
115
115
  return LoggingEventType2;
116
- })({});
117
- var LogMethod = /* @__PURE__ */ (function(LogMethod2) {
116
+ }({});
117
+ var LogMethod = /* @__PURE__ */ function(LogMethod2) {
118
118
  LogMethod2[LogMethod2["DEBUG_PKG"] = 0] = "DEBUG_PKG";
119
119
  LogMethod2[LogMethod2["CONSOLE"] = 1] = "CONSOLE";
120
120
  LogMethod2[LogMethod2["EVENT"] = 2] = "EVENT";
121
121
  return LogMethod2;
122
- })({});
122
+ }({});
123
123
  function logOptions(opts) {
124
124
  return {
125
125
  namespace: opts?.namespace ?? "sphereon",
@@ -296,7 +296,7 @@ var SimpleRecordLogger = class extends SimpleLogger {
296
296
 
297
297
  // src/events/index.ts
298
298
  var import_events2 = require("events");
299
- var System = /* @__PURE__ */ (function(System2) {
299
+ var System = /* @__PURE__ */ function(System2) {
300
300
  System2["GENERAL"] = "general";
301
301
  System2["KMS"] = "kms";
302
302
  System2["IDENTITY"] = "identity";
@@ -309,8 +309,8 @@ var System = /* @__PURE__ */ (function(System2) {
309
309
  System2["PROFILE"] = "profile";
310
310
  System2["CONTACT"] = "contact";
311
311
  return System2;
312
- })({});
313
- var SubSystem = /* @__PURE__ */ (function(SubSystem2) {
312
+ }({});
313
+ var SubSystem = /* @__PURE__ */ function(SubSystem2) {
314
314
  SubSystem2["KEY"] = "key";
315
315
  SubSystem2["DID_PROVIDER"] = "did_provider";
316
316
  SubSystem2["DID_RESOLVER"] = "did_resolver";
@@ -325,16 +325,16 @@ var SubSystem = /* @__PURE__ */ (function(SubSystem2) {
325
325
  SubSystem2["PROFILE"] = "profile";
326
326
  SubSystem2["API"] = "api";
327
327
  return SubSystem2;
328
- })({});
329
- var ActionType = /* @__PURE__ */ (function(ActionType2) {
328
+ }({});
329
+ var ActionType = /* @__PURE__ */ function(ActionType2) {
330
330
  ActionType2["CREATE"] = "create";
331
331
  ActionType2["READ"] = "read";
332
332
  ActionType2["UPDATE"] = "update";
333
333
  ActionType2["DELETE"] = "delete";
334
334
  ActionType2["EXECUTE"] = "execute";
335
335
  return ActionType2;
336
- })({});
337
- var DefaultActionSubType = /* @__PURE__ */ (function(DefaultActionSubType2) {
336
+ }({});
337
+ var DefaultActionSubType = /* @__PURE__ */ function(DefaultActionSubType2) {
338
338
  DefaultActionSubType2["KEY_GENERATION"] = "Key generation";
339
339
  DefaultActionSubType2["KEY_IMPORT"] = "Key import";
340
340
  DefaultActionSubType2["KEY_PERSISTENCE"] = "Key persistence";
@@ -349,14 +349,14 @@ var DefaultActionSubType = /* @__PURE__ */ (function(DefaultActionSubType2) {
349
349
  DefaultActionSubType2["VC_ISSUE_DECLINE"] = "VC issue decline";
350
350
  DefaultActionSubType2["VC_SHARE_DECLINE"] = "VC share decline";
351
351
  return DefaultActionSubType2;
352
- })({});
353
- var InitiatorType = /* @__PURE__ */ (function(InitiatorType2) {
352
+ }({});
353
+ var InitiatorType = /* @__PURE__ */ function(InitiatorType2) {
354
354
  InitiatorType2["USER"] = "user";
355
355
  InitiatorType2["SYSTEM"] = "system";
356
356
  InitiatorType2["EXTERNAL"] = "external";
357
357
  return InitiatorType2;
358
- })({});
359
- var SystemCorrelationIdType = /* @__PURE__ */ (function(SystemCorrelationIdType2) {
358
+ }({});
359
+ var SystemCorrelationIdType = /* @__PURE__ */ function(SystemCorrelationIdType2) {
360
360
  SystemCorrelationIdType2["DID"] = "did";
361
361
  SystemCorrelationIdType2["URL"] = "url";
362
362
  SystemCorrelationIdType2["EMAIL"] = "email";
@@ -364,7 +364,7 @@ var SystemCorrelationIdType = /* @__PURE__ */ (function(SystemCorrelationIdType2
364
364
  SystemCorrelationIdType2["PHONE"] = "phone";
365
365
  SystemCorrelationIdType2["USER"] = "user";
366
366
  return SystemCorrelationIdType2;
367
- })({});
367
+ }({});
368
368
  var EventManager = class _EventManager {
369
369
  static {
370
370
  __name(this, "EventManager");
@@ -527,12 +527,12 @@ function isWrappedW3CVerifiablePresentation(vp) {
527
527
  return vp.format === "jwt_vp" || vp.format === "ldp_vp";
528
528
  }
529
529
  __name(isWrappedW3CVerifiablePresentation, "isWrappedW3CVerifiablePresentation");
530
- var StatusListType = /* @__PURE__ */ (function(StatusListType2) {
530
+ var StatusListType = /* @__PURE__ */ function(StatusListType2) {
531
531
  StatusListType2["StatusList2021"] = "StatusList2021";
532
532
  StatusListType2["OAuthStatusList"] = "OAuthStatusList";
533
533
  StatusListType2["BitstringStatusList"] = "BitstringStatusList";
534
534
  return StatusListType2;
535
- })({});
535
+ }({});
536
536
  function isVcdmCredential(credential, vcdmType) {
537
537
  if (!credential || typeof credential !== "object") {
538
538
  return false;
@@ -569,7 +569,7 @@ var VCDM_CREDENTIAL_CONTEXT_VERSIONS = [
569
569
  ];
570
570
 
571
571
  // src/utils/did.ts
572
- var IProofPurpose = /* @__PURE__ */ (function(IProofPurpose2) {
572
+ var IProofPurpose = /* @__PURE__ */ function(IProofPurpose2) {
573
573
  IProofPurpose2["verificationMethod"] = "verificationMethod";
574
574
  IProofPurpose2["assertionMethod"] = "assertionMethod";
575
575
  IProofPurpose2["authentication"] = "authentication";
@@ -578,8 +578,8 @@ var IProofPurpose = /* @__PURE__ */ (function(IProofPurpose2) {
578
578
  IProofPurpose2["capabilityInvocation"] = "capabilityInvocation";
579
579
  IProofPurpose2["capabilityDelegation"] = "capabilityDelegation";
580
580
  return IProofPurpose2;
581
- })({});
582
- var IProofType = /* @__PURE__ */ (function(IProofType2) {
581
+ }({});
582
+ var IProofType = /* @__PURE__ */ function(IProofType2) {
583
583
  IProofType2["Ed25519Signature2018"] = "Ed25519Signature2018";
584
584
  IProofType2["Ed25519Signature2020"] = "Ed25519Signature2020";
585
585
  IProofType2["EcdsaSecp256k1Signature2019"] = "EcdsaSecp256k1Signature2019";
@@ -594,7 +594,7 @@ var IProofType = /* @__PURE__ */ (function(IProofType2) {
594
594
  IProofType2["SdJwtProof2024"] = "SdJwtProof2024";
595
595
  IProofType2["MdocProof2024"] = "MsoMdocProof2024";
596
596
  return IProofType2;
597
- })({});
597
+ }({});
598
598
  var parseDid = /* @__PURE__ */ __name((did) => {
599
599
  const parsedDid = parse(did);
600
600
  if (parsedDid === null) {
@@ -893,14 +893,14 @@ var jwtDateToISOString = /* @__PURE__ */ __name(({ jwtClaim, claimName, isRequir
893
893
  }, "jwtDateToISOString");
894
894
 
895
895
  // src/utils/jose.ts
896
- var JwkKeyType = /* @__PURE__ */ (function(JwkKeyType2) {
896
+ var JwkKeyType = /* @__PURE__ */ function(JwkKeyType2) {
897
897
  JwkKeyType2["EC"] = "EC";
898
898
  JwkKeyType2["RSA"] = "RSA";
899
899
  JwkKeyType2["oct"] = "oct";
900
900
  JwkKeyType2["OKP"] = "OKP";
901
901
  return JwkKeyType2;
902
- })({});
903
- var JoseSignatureAlgorithm = /* @__PURE__ */ (function(JoseSignatureAlgorithm2) {
902
+ }({});
903
+ var JoseSignatureAlgorithm = /* @__PURE__ */ function(JoseSignatureAlgorithm2) {
904
904
  JoseSignatureAlgorithm2["RS256"] = "RS256";
905
905
  JoseSignatureAlgorithm2["RS384"] = "RS384";
906
906
  JoseSignatureAlgorithm2["RS512"] = "RS512";
@@ -917,8 +917,8 @@ var JoseSignatureAlgorithm = /* @__PURE__ */ (function(JoseSignatureAlgorithm2)
917
917
  JoseSignatureAlgorithm2["PS512"] = "PS512";
918
918
  JoseSignatureAlgorithm2["none"] = "none";
919
919
  return JoseSignatureAlgorithm2;
920
- })({});
921
- var JoseKeyOperation = /* @__PURE__ */ (function(JoseKeyOperation2) {
920
+ }({});
921
+ var JoseKeyOperation = /* @__PURE__ */ function(JoseKeyOperation2) {
922
922
  JoseKeyOperation2["SIGN"] = "sign";
923
923
  JoseKeyOperation2["VERIFY"] = "verify";
924
924
  JoseKeyOperation2["ENCRYPT"] = "encrypt";
@@ -928,8 +928,8 @@ var JoseKeyOperation = /* @__PURE__ */ (function(JoseKeyOperation2) {
928
928
  JoseKeyOperation2["DERIVE_KEY"] = "deriveKey";
929
929
  JoseKeyOperation2["DERIVE_BITS"] = "deriveBits";
930
930
  return JoseKeyOperation2;
931
- })({});
932
- var JoseCurve = /* @__PURE__ */ (function(JoseCurve2) {
931
+ }({});
932
+ var JoseCurve = /* @__PURE__ */ function(JoseCurve2) {
933
933
  JoseCurve2["P_256"] = "P-256";
934
934
  JoseCurve2["P_384"] = "P-384";
935
935
  JoseCurve2["P_521"] = "P-521";
@@ -940,18 +940,18 @@ var JoseCurve = /* @__PURE__ */ (function(JoseCurve2) {
940
940
  JoseCurve2["Ed448"] = "Ed448";
941
941
  JoseCurve2["secp256k1"] = "secp256k1";
942
942
  return JoseCurve2;
943
- })({});
943
+ }({});
944
944
 
945
945
  // src/utils/cose.ts
946
- var ICoseKeyType = /* @__PURE__ */ (function(ICoseKeyType2) {
946
+ var ICoseKeyType = /* @__PURE__ */ function(ICoseKeyType2) {
947
947
  ICoseKeyType2[ICoseKeyType2["OKP"] = 1] = "OKP";
948
948
  ICoseKeyType2[ICoseKeyType2["EC2"] = 2] = "EC2";
949
949
  ICoseKeyType2[ICoseKeyType2["RSA"] = 3] = "RSA";
950
950
  ICoseKeyType2[ICoseKeyType2["Symmetric"] = 4] = "Symmetric";
951
951
  ICoseKeyType2[ICoseKeyType2["Reserved"] = 0] = "Reserved";
952
952
  return ICoseKeyType2;
953
- })({});
954
- var ICoseSignatureAlgorithm = /* @__PURE__ */ (function(ICoseSignatureAlgorithm2) {
953
+ }({});
954
+ var ICoseSignatureAlgorithm = /* @__PURE__ */ function(ICoseSignatureAlgorithm2) {
955
955
  ICoseSignatureAlgorithm2[ICoseSignatureAlgorithm2["ES256"] = -7] = "ES256";
956
956
  ICoseSignatureAlgorithm2[ICoseSignatureAlgorithm2["ES256K"] = -47] = "ES256K";
957
957
  ICoseSignatureAlgorithm2[ICoseSignatureAlgorithm2["ES384"] = -35] = "ES384";
@@ -965,8 +965,8 @@ var ICoseSignatureAlgorithm = /* @__PURE__ */ (function(ICoseSignatureAlgorithm2
965
965
  ICoseSignatureAlgorithm2[ICoseSignatureAlgorithm2["PS384"] = -38] = "PS384";
966
966
  ICoseSignatureAlgorithm2[ICoseSignatureAlgorithm2["PS512"] = -39] = "PS512";
967
967
  return ICoseSignatureAlgorithm2;
968
- })({});
969
- var ICoseKeyOperation = /* @__PURE__ */ (function(ICoseKeyOperation2) {
968
+ }({});
969
+ var ICoseKeyOperation = /* @__PURE__ */ function(ICoseKeyOperation2) {
970
970
  ICoseKeyOperation2[ICoseKeyOperation2["SIGN"] = 1] = "SIGN";
971
971
  ICoseKeyOperation2[ICoseKeyOperation2["VERIFY"] = 2] = "VERIFY";
972
972
  ICoseKeyOperation2[ICoseKeyOperation2["ENCRYPT"] = 3] = "ENCRYPT";
@@ -978,8 +978,8 @@ var ICoseKeyOperation = /* @__PURE__ */ (function(ICoseKeyOperation2) {
978
978
  ICoseKeyOperation2[ICoseKeyOperation2["MAC_CREATE"] = 9] = "MAC_CREATE";
979
979
  ICoseKeyOperation2[ICoseKeyOperation2["MAC_VERIFY"] = 10] = "MAC_VERIFY";
980
980
  return ICoseKeyOperation2;
981
- })({});
982
- var ICoseCurve = /* @__PURE__ */ (function(ICoseCurve2) {
981
+ }({});
982
+ var ICoseCurve = /* @__PURE__ */ function(ICoseCurve2) {
983
983
  ICoseCurve2[ICoseCurve2["P_256"] = 1] = "P_256";
984
984
  ICoseCurve2[ICoseCurve2["P_384"] = 2] = "P_384";
985
985
  ICoseCurve2[ICoseCurve2["P_521"] = 3] = "P_521";
@@ -989,18 +989,18 @@ var ICoseCurve = /* @__PURE__ */ (function(ICoseCurve2) {
989
989
  ICoseCurve2[ICoseCurve2["Ed448"] = 7] = "Ed448";
990
990
  ICoseCurve2[ICoseCurve2["secp256k1"] = -1] = "secp256k1";
991
991
  return ICoseCurve2;
992
- })({});
992
+ }({});
993
993
 
994
994
  // src/mapper/credential-constraints.ts
995
- var StatusListCredentialIdMode = /* @__PURE__ */ (function(StatusListCredentialIdMode2) {
995
+ var StatusListCredentialIdMode = /* @__PURE__ */ function(StatusListCredentialIdMode2) {
996
996
  StatusListCredentialIdMode2["ISSUANCE"] = "ISSUANCE";
997
997
  StatusListCredentialIdMode2["NEVER"] = "NEVER";
998
998
  return StatusListCredentialIdMode2;
999
- })({});
1000
- var StatusListDriverType = /* @__PURE__ */ (function(StatusListDriverType2) {
999
+ }({});
1000
+ var StatusListDriverType = /* @__PURE__ */ function(StatusListDriverType2) {
1001
1001
  StatusListDriverType2["AGENT_TYPEORM"] = "agent_typeorm";
1002
1002
  return StatusListDriverType2;
1003
- })({});
1003
+ }({});
1004
1004
 
1005
1005
  // src/mapper/credential-mapper.ts
1006
1006
  var import_jwt_decode = require("jwt-decode");
@@ -1136,7 +1136,7 @@ var CredentialMapper = class _CredentialMapper {
1136
1136
  }
1137
1137
  return {
1138
1138
  type: _CredentialMapper.isSdJwtDecodedCredential(originalPresentation) ? "sd-jwt-vc-decoded" : "sd-jwt-vc-encoded",
1139
- format: "vc+sd-jwt",
1139
+ format: "dc+sd-jwt",
1140
1140
  original: originalPresentation,
1141
1141
  presentation: decodedPresentation,
1142
1142
  decoded: decodedPresentation.decodedPayload,
@@ -1230,7 +1230,7 @@ var CredentialMapper = class _CredentialMapper {
1230
1230
  }
1231
1231
  return {
1232
1232
  type: _CredentialMapper.isSdJwtDecodedCredential(verifiableCredential) ? "sd-jwt-vc-decoded" : "sd-jwt-vc-encoded",
1233
- format: "vc+sd-jwt",
1233
+ format: "dc+sd-jwt",
1234
1234
  original: verifiableCredential,
1235
1235
  credential: decodedCredential,
1236
1236
  decoded: decodedCredential.decodedPayload
@@ -1675,14 +1675,14 @@ var CredentialMapper = class _CredentialMapper {
1675
1675
  }
1676
1676
  };
1677
1677
  function isWrappedSdJwtVerifiableCredential(vc) {
1678
- return vc.format === "vc+sd-jwt";
1678
+ return vc.format === "dc+sd-jwt";
1679
1679
  }
1680
1680
  __name(isWrappedSdJwtVerifiableCredential, "isWrappedSdJwtVerifiableCredential");
1681
1681
  function isWrappedSdJwtVerifiablePresentation(vp) {
1682
- return vp.format === "vc+sd-jwt";
1682
+ return vp.format === "dc+sd-jwt";
1683
1683
  }
1684
1684
  __name(isWrappedSdJwtVerifiablePresentation, "isWrappedSdJwtVerifiablePresentation");
1685
- var OriginalType = /* @__PURE__ */ (function(OriginalType2) {
1685
+ var OriginalType = /* @__PURE__ */ function(OriginalType2) {
1686
1686
  OriginalType2["JSONLD"] = "json-ld";
1687
1687
  OriginalType2["JWT_ENCODED"] = "jwt-encoded";
1688
1688
  OriginalType2["JWT_DECODED"] = "jwt-decoded";
@@ -1691,16 +1691,16 @@ var OriginalType = /* @__PURE__ */ (function(OriginalType2) {
1691
1691
  OriginalType2["MSO_MDOC_ENCODED"] = "mso_mdoc-encoded";
1692
1692
  OriginalType2["MSO_MDOC_DECODED"] = "mso_mdoc-decoded";
1693
1693
  return OriginalType2;
1694
- })({});
1694
+ }({});
1695
1695
  var JWT_PROOF_TYPE_2020 = "JwtProof2020";
1696
- var DocumentFormat = /* @__PURE__ */ (function(DocumentFormat2) {
1696
+ var DocumentFormat = /* @__PURE__ */ function(DocumentFormat2) {
1697
1697
  DocumentFormat2[DocumentFormat2["JWT"] = 0] = "JWT";
1698
1698
  DocumentFormat2[DocumentFormat2["JSONLD"] = 1] = "JSONLD";
1699
1699
  DocumentFormat2[DocumentFormat2["SD_JWT_VC"] = 2] = "SD_JWT_VC";
1700
1700
  DocumentFormat2[DocumentFormat2["EIP712"] = 3] = "EIP712";
1701
1701
  DocumentFormat2[DocumentFormat2["MSO_MDOC"] = 4] = "MSO_MDOC";
1702
1702
  return DocumentFormat2;
1703
- })({});
1703
+ }({});
1704
1704
 
1705
1705
  // src/mapper/jsonld-language-values.ts
1706
1706
  var isLanguageValueObject = /* @__PURE__ */ __name((claim) => {