@sphereon/ssi-types 0.34.1-feature.SSISDK.50.98 → 0.34.1-feature.SSISDK.50.type.refactor.142

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
@@ -101,26 +101,26 @@ module.exports = __toCommonJS(index_exports);
101
101
  // src/logging/index.ts
102
102
  var import_debug = __toESM(require("debug"), 1);
103
103
  var import_events = require("events");
104
- var LogLevel = /* @__PURE__ */ function(LogLevel2) {
104
+ var LogLevel = /* @__PURE__ */ (function(LogLevel2) {
105
105
  LogLevel2[LogLevel2["TRACE"] = 0] = "TRACE";
106
106
  LogLevel2[LogLevel2["DEBUG"] = 1] = "DEBUG";
107
107
  LogLevel2[LogLevel2["INFO"] = 2] = "INFO";
108
108
  LogLevel2[LogLevel2["WARNING"] = 3] = "WARNING";
109
109
  LogLevel2[LogLevel2["ERROR"] = 4] = "ERROR";
110
110
  return LogLevel2;
111
- }({});
112
- var LoggingEventType = /* @__PURE__ */ function(LoggingEventType2) {
111
+ })({});
112
+ var LoggingEventType = /* @__PURE__ */ (function(LoggingEventType2) {
113
113
  LoggingEventType2["AUDIT"] = "audit";
114
114
  LoggingEventType2["ACTIVITY"] = "activity";
115
115
  LoggingEventType2["GENERAL"] = "general";
116
116
  return LoggingEventType2;
117
- }({});
118
- var LogMethod = /* @__PURE__ */ function(LogMethod2) {
117
+ })({});
118
+ var LogMethod = /* @__PURE__ */ (function(LogMethod2) {
119
119
  LogMethod2[LogMethod2["DEBUG_PKG"] = 0] = "DEBUG_PKG";
120
120
  LogMethod2[LogMethod2["CONSOLE"] = 1] = "CONSOLE";
121
121
  LogMethod2[LogMethod2["EVENT"] = 2] = "EVENT";
122
122
  return LogMethod2;
123
- }({});
123
+ })({});
124
124
  function logOptions(opts) {
125
125
  return {
126
126
  namespace: opts?.namespace ?? "sphereon",
@@ -296,17 +296,17 @@ var SimpleRecordLogger = class extends SimpleLogger {
296
296
  };
297
297
 
298
298
  // src/types/datastore.ts
299
- var CredentialRole = /* @__PURE__ */ function(CredentialRole2) {
299
+ var CredentialRole = /* @__PURE__ */ (function(CredentialRole2) {
300
300
  CredentialRole2["ISSUER"] = "ISSUER";
301
301
  CredentialRole2["VERIFIER"] = "VERIFIER";
302
302
  CredentialRole2["HOLDER"] = "HOLDER";
303
303
  CredentialRole2["FEDERATION_TRUST_ANCHOR"] = "FEDERATION_TRUST_ANCHOR";
304
304
  return CredentialRole2;
305
- }({});
305
+ })({});
306
306
 
307
307
  // src/events/index.ts
308
308
  var import_events2 = require("events");
309
- var System = /* @__PURE__ */ function(System2) {
309
+ var System = /* @__PURE__ */ (function(System2) {
310
310
  System2["GENERAL"] = "general";
311
311
  System2["KMS"] = "kms";
312
312
  System2["IDENTITY"] = "identity";
@@ -319,8 +319,8 @@ var System = /* @__PURE__ */ function(System2) {
319
319
  System2["PROFILE"] = "profile";
320
320
  System2["CONTACT"] = "contact";
321
321
  return System2;
322
- }({});
323
- var SubSystem = /* @__PURE__ */ function(SubSystem2) {
322
+ })({});
323
+ var SubSystem = /* @__PURE__ */ (function(SubSystem2) {
324
324
  SubSystem2["KEY"] = "key";
325
325
  SubSystem2["DID_PROVIDER"] = "did_provider";
326
326
  SubSystem2["DID_RESOLVER"] = "did_resolver";
@@ -335,16 +335,16 @@ var SubSystem = /* @__PURE__ */ function(SubSystem2) {
335
335
  SubSystem2["PROFILE"] = "profile";
336
336
  SubSystem2["API"] = "api";
337
337
  return SubSystem2;
338
- }({});
339
- var ActionType = /* @__PURE__ */ function(ActionType2) {
338
+ })({});
339
+ var ActionType = /* @__PURE__ */ (function(ActionType2) {
340
340
  ActionType2["CREATE"] = "create";
341
341
  ActionType2["READ"] = "read";
342
342
  ActionType2["UPDATE"] = "update";
343
343
  ActionType2["DELETE"] = "delete";
344
344
  ActionType2["EXECUTE"] = "execute";
345
345
  return ActionType2;
346
- }({});
347
- var DefaultActionSubType = /* @__PURE__ */ function(DefaultActionSubType2) {
346
+ })({});
347
+ var DefaultActionSubType = /* @__PURE__ */ (function(DefaultActionSubType2) {
348
348
  DefaultActionSubType2["KEY_GENERATION"] = "Key generation";
349
349
  DefaultActionSubType2["KEY_IMPORT"] = "Key import";
350
350
  DefaultActionSubType2["KEY_PERSISTENCE"] = "Key persistence";
@@ -359,14 +359,14 @@ var DefaultActionSubType = /* @__PURE__ */ function(DefaultActionSubType2) {
359
359
  DefaultActionSubType2["VC_ISSUE_DECLINE"] = "VC issue decline";
360
360
  DefaultActionSubType2["VC_SHARE_DECLINE"] = "VC share decline";
361
361
  return DefaultActionSubType2;
362
- }({});
363
- var InitiatorType = /* @__PURE__ */ function(InitiatorType2) {
362
+ })({});
363
+ var InitiatorType = /* @__PURE__ */ (function(InitiatorType2) {
364
364
  InitiatorType2["USER"] = "user";
365
365
  InitiatorType2["SYSTEM"] = "system";
366
366
  InitiatorType2["EXTERNAL"] = "external";
367
367
  return InitiatorType2;
368
- }({});
369
- var SystemCorrelationIdType = /* @__PURE__ */ function(SystemCorrelationIdType2) {
368
+ })({});
369
+ var SystemCorrelationIdType = /* @__PURE__ */ (function(SystemCorrelationIdType2) {
370
370
  SystemCorrelationIdType2["DID"] = "did";
371
371
  SystemCorrelationIdType2["URL"] = "url";
372
372
  SystemCorrelationIdType2["EMAIL"] = "email";
@@ -374,7 +374,7 @@ var SystemCorrelationIdType = /* @__PURE__ */ function(SystemCorrelationIdType2)
374
374
  SystemCorrelationIdType2["PHONE"] = "phone";
375
375
  SystemCorrelationIdType2["USER"] = "user";
376
376
  return SystemCorrelationIdType2;
377
- }({});
377
+ })({});
378
378
  var EventManager = class _EventManager {
379
379
  static {
380
380
  __name(this, "EventManager");
@@ -537,12 +537,12 @@ function isWrappedW3CVerifiablePresentation(vp) {
537
537
  return vp.format === "jwt_vp" || vp.format === "ldp_vp";
538
538
  }
539
539
  __name(isWrappedW3CVerifiablePresentation, "isWrappedW3CVerifiablePresentation");
540
- var StatusListType = /* @__PURE__ */ function(StatusListType2) {
540
+ var StatusListType = /* @__PURE__ */ (function(StatusListType2) {
541
541
  StatusListType2["StatusList2021"] = "StatusList2021";
542
542
  StatusListType2["OAuthStatusList"] = "OAuthStatusList";
543
543
  StatusListType2["BitstringStatusList"] = "BitstringStatusList";
544
544
  return StatusListType2;
545
- }({});
545
+ })({});
546
546
  function isVcdmCredential(credential, vcdmType) {
547
547
  if (!credential || typeof credential !== "object") {
548
548
  return false;
@@ -579,7 +579,7 @@ var VCDM_CREDENTIAL_CONTEXT_VERSIONS = [
579
579
  ];
580
580
 
581
581
  // src/utils/did.ts
582
- var IProofPurpose = /* @__PURE__ */ function(IProofPurpose2) {
582
+ var IProofPurpose = /* @__PURE__ */ (function(IProofPurpose2) {
583
583
  IProofPurpose2["verificationMethod"] = "verificationMethod";
584
584
  IProofPurpose2["assertionMethod"] = "assertionMethod";
585
585
  IProofPurpose2["authentication"] = "authentication";
@@ -588,8 +588,8 @@ var IProofPurpose = /* @__PURE__ */ function(IProofPurpose2) {
588
588
  IProofPurpose2["capabilityInvocation"] = "capabilityInvocation";
589
589
  IProofPurpose2["capabilityDelegation"] = "capabilityDelegation";
590
590
  return IProofPurpose2;
591
- }({});
592
- var IProofType = /* @__PURE__ */ function(IProofType2) {
591
+ })({});
592
+ var IProofType = /* @__PURE__ */ (function(IProofType2) {
593
593
  IProofType2["Ed25519Signature2018"] = "Ed25519Signature2018";
594
594
  IProofType2["Ed25519Signature2020"] = "Ed25519Signature2020";
595
595
  IProofType2["EcdsaSecp256k1Signature2019"] = "EcdsaSecp256k1Signature2019";
@@ -604,7 +604,7 @@ var IProofType = /* @__PURE__ */ function(IProofType2) {
604
604
  IProofType2["SdJwtProof2024"] = "SdJwtProof2024";
605
605
  IProofType2["MdocProof2024"] = "MsoMdocProof2024";
606
606
  return IProofType2;
607
- }({});
607
+ })({});
608
608
  var parseDid = /* @__PURE__ */ __name((did) => {
609
609
  const parsedDid = parse(did);
610
610
  if (parsedDid === null) {
@@ -929,14 +929,14 @@ var jwtDateToISOString = /* @__PURE__ */ __name(({ jwtClaim, claimName, isRequir
929
929
  }, "jwtDateToISOString");
930
930
 
931
931
  // src/utils/jose.ts
932
- var JwkKeyType = /* @__PURE__ */ function(JwkKeyType2) {
932
+ var JwkKeyType = /* @__PURE__ */ (function(JwkKeyType2) {
933
933
  JwkKeyType2["EC"] = "EC";
934
934
  JwkKeyType2["RSA"] = "RSA";
935
935
  JwkKeyType2["oct"] = "oct";
936
936
  JwkKeyType2["OKP"] = "OKP";
937
937
  return JwkKeyType2;
938
- }({});
939
- var JoseSignatureAlgorithm = /* @__PURE__ */ function(JoseSignatureAlgorithm2) {
938
+ })({});
939
+ var JoseSignatureAlgorithm = /* @__PURE__ */ (function(JoseSignatureAlgorithm2) {
940
940
  JoseSignatureAlgorithm2["RS256"] = "RS256";
941
941
  JoseSignatureAlgorithm2["RS384"] = "RS384";
942
942
  JoseSignatureAlgorithm2["RS512"] = "RS512";
@@ -953,8 +953,8 @@ var JoseSignatureAlgorithm = /* @__PURE__ */ function(JoseSignatureAlgorithm2) {
953
953
  JoseSignatureAlgorithm2["PS512"] = "PS512";
954
954
  JoseSignatureAlgorithm2["none"] = "none";
955
955
  return JoseSignatureAlgorithm2;
956
- }({});
957
- var JoseKeyOperation = /* @__PURE__ */ function(JoseKeyOperation2) {
956
+ })({});
957
+ var JoseKeyOperation = /* @__PURE__ */ (function(JoseKeyOperation2) {
958
958
  JoseKeyOperation2["SIGN"] = "sign";
959
959
  JoseKeyOperation2["VERIFY"] = "verify";
960
960
  JoseKeyOperation2["ENCRYPT"] = "encrypt";
@@ -964,8 +964,8 @@ var JoseKeyOperation = /* @__PURE__ */ function(JoseKeyOperation2) {
964
964
  JoseKeyOperation2["DERIVE_KEY"] = "deriveKey";
965
965
  JoseKeyOperation2["DERIVE_BITS"] = "deriveBits";
966
966
  return JoseKeyOperation2;
967
- }({});
968
- var JoseCurve = /* @__PURE__ */ function(JoseCurve2) {
967
+ })({});
968
+ var JoseCurve = /* @__PURE__ */ (function(JoseCurve2) {
969
969
  JoseCurve2["P_256"] = "P-256";
970
970
  JoseCurve2["P_384"] = "P-384";
971
971
  JoseCurve2["P_521"] = "P-521";
@@ -976,18 +976,18 @@ var JoseCurve = /* @__PURE__ */ function(JoseCurve2) {
976
976
  JoseCurve2["Ed448"] = "Ed448";
977
977
  JoseCurve2["secp256k1"] = "secp256k1";
978
978
  return JoseCurve2;
979
- }({});
979
+ })({});
980
980
 
981
981
  // src/utils/cose.ts
982
- var ICoseKeyType = /* @__PURE__ */ function(ICoseKeyType2) {
982
+ var ICoseKeyType = /* @__PURE__ */ (function(ICoseKeyType2) {
983
983
  ICoseKeyType2[ICoseKeyType2["OKP"] = 1] = "OKP";
984
984
  ICoseKeyType2[ICoseKeyType2["EC2"] = 2] = "EC2";
985
985
  ICoseKeyType2[ICoseKeyType2["RSA"] = 3] = "RSA";
986
986
  ICoseKeyType2[ICoseKeyType2["Symmetric"] = 4] = "Symmetric";
987
987
  ICoseKeyType2[ICoseKeyType2["Reserved"] = 0] = "Reserved";
988
988
  return ICoseKeyType2;
989
- }({});
990
- var ICoseSignatureAlgorithm = /* @__PURE__ */ function(ICoseSignatureAlgorithm2) {
989
+ })({});
990
+ var ICoseSignatureAlgorithm = /* @__PURE__ */ (function(ICoseSignatureAlgorithm2) {
991
991
  ICoseSignatureAlgorithm2[ICoseSignatureAlgorithm2["ES256"] = -7] = "ES256";
992
992
  ICoseSignatureAlgorithm2[ICoseSignatureAlgorithm2["ES256K"] = -47] = "ES256K";
993
993
  ICoseSignatureAlgorithm2[ICoseSignatureAlgorithm2["ES384"] = -35] = "ES384";
@@ -1001,8 +1001,8 @@ var ICoseSignatureAlgorithm = /* @__PURE__ */ function(ICoseSignatureAlgorithm2)
1001
1001
  ICoseSignatureAlgorithm2[ICoseSignatureAlgorithm2["PS384"] = -38] = "PS384";
1002
1002
  ICoseSignatureAlgorithm2[ICoseSignatureAlgorithm2["PS512"] = -39] = "PS512";
1003
1003
  return ICoseSignatureAlgorithm2;
1004
- }({});
1005
- var ICoseKeyOperation = /* @__PURE__ */ function(ICoseKeyOperation2) {
1004
+ })({});
1005
+ var ICoseKeyOperation = /* @__PURE__ */ (function(ICoseKeyOperation2) {
1006
1006
  ICoseKeyOperation2[ICoseKeyOperation2["SIGN"] = 1] = "SIGN";
1007
1007
  ICoseKeyOperation2[ICoseKeyOperation2["VERIFY"] = 2] = "VERIFY";
1008
1008
  ICoseKeyOperation2[ICoseKeyOperation2["ENCRYPT"] = 3] = "ENCRYPT";
@@ -1014,8 +1014,8 @@ var ICoseKeyOperation = /* @__PURE__ */ function(ICoseKeyOperation2) {
1014
1014
  ICoseKeyOperation2[ICoseKeyOperation2["MAC_CREATE"] = 9] = "MAC_CREATE";
1015
1015
  ICoseKeyOperation2[ICoseKeyOperation2["MAC_VERIFY"] = 10] = "MAC_VERIFY";
1016
1016
  return ICoseKeyOperation2;
1017
- }({});
1018
- var ICoseCurve = /* @__PURE__ */ function(ICoseCurve2) {
1017
+ })({});
1018
+ var ICoseCurve = /* @__PURE__ */ (function(ICoseCurve2) {
1019
1019
  ICoseCurve2[ICoseCurve2["P_256"] = 1] = "P_256";
1020
1020
  ICoseCurve2[ICoseCurve2["P_384"] = 2] = "P_384";
1021
1021
  ICoseCurve2[ICoseCurve2["P_521"] = 3] = "P_521";
@@ -1025,18 +1025,18 @@ var ICoseCurve = /* @__PURE__ */ function(ICoseCurve2) {
1025
1025
  ICoseCurve2[ICoseCurve2["Ed448"] = 7] = "Ed448";
1026
1026
  ICoseCurve2[ICoseCurve2["secp256k1"] = -1] = "secp256k1";
1027
1027
  return ICoseCurve2;
1028
- }({});
1028
+ })({});
1029
1029
 
1030
1030
  // src/mapper/credential-constraints.ts
1031
- var StatusListCredentialIdMode = /* @__PURE__ */ function(StatusListCredentialIdMode2) {
1031
+ var StatusListCredentialIdMode = /* @__PURE__ */ (function(StatusListCredentialIdMode2) {
1032
1032
  StatusListCredentialIdMode2["ISSUANCE"] = "ISSUANCE";
1033
1033
  StatusListCredentialIdMode2["NEVER"] = "NEVER";
1034
1034
  return StatusListCredentialIdMode2;
1035
- }({});
1036
- var StatusListDriverType = /* @__PURE__ */ function(StatusListDriverType2) {
1035
+ })({});
1036
+ var StatusListDriverType = /* @__PURE__ */ (function(StatusListDriverType2) {
1037
1037
  StatusListDriverType2["AGENT_TYPEORM"] = "agent_typeorm";
1038
1038
  return StatusListDriverType2;
1039
- }({});
1039
+ })({});
1040
1040
 
1041
1041
  // src/mapper/credential-mapper.ts
1042
1042
  var import_jwt_decode = require("jwt-decode");
@@ -1725,7 +1725,7 @@ function isWrappedSdJwtVerifiablePresentation(vp) {
1725
1725
  return vp.format === "dc+sd-jwt";
1726
1726
  }
1727
1727
  __name(isWrappedSdJwtVerifiablePresentation, "isWrappedSdJwtVerifiablePresentation");
1728
- var OriginalType = /* @__PURE__ */ function(OriginalType2) {
1728
+ var OriginalType = /* @__PURE__ */ (function(OriginalType2) {
1729
1729
  OriginalType2["JSONLD"] = "json-ld";
1730
1730
  OriginalType2["JWT_ENCODED"] = "jwt-encoded";
1731
1731
  OriginalType2["JWT_DECODED"] = "jwt-decoded";
@@ -1734,16 +1734,16 @@ var OriginalType = /* @__PURE__ */ function(OriginalType2) {
1734
1734
  OriginalType2["MSO_MDOC_ENCODED"] = "mso_mdoc-encoded";
1735
1735
  OriginalType2["MSO_MDOC_DECODED"] = "mso_mdoc-decoded";
1736
1736
  return OriginalType2;
1737
- }({});
1737
+ })({});
1738
1738
  var JWT_PROOF_TYPE_2020 = "JwtProof2020";
1739
- var DocumentFormat = /* @__PURE__ */ function(DocumentFormat2) {
1739
+ var DocumentFormat = /* @__PURE__ */ (function(DocumentFormat2) {
1740
1740
  DocumentFormat2[DocumentFormat2["JWT"] = 0] = "JWT";
1741
1741
  DocumentFormat2[DocumentFormat2["JSONLD"] = 1] = "JSONLD";
1742
1742
  DocumentFormat2[DocumentFormat2["SD_JWT_VC"] = 2] = "SD_JWT_VC";
1743
1743
  DocumentFormat2[DocumentFormat2["EIP712"] = 3] = "EIP712";
1744
1744
  DocumentFormat2[DocumentFormat2["MSO_MDOC"] = 4] = "MSO_MDOC";
1745
1745
  return DocumentFormat2;
1746
- }({});
1746
+ })({});
1747
1747
 
1748
1748
  // src/mapper/jsonld-language-values.ts
1749
1749
  var isLanguageValueObject = /* @__PURE__ */ __name((claim) => {