@sphereon/ssi-types 0.34.1-next.91 → 0.36.0
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 +13 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +45 -35
- package/dist/index.d.ts +45 -35
- package/dist/index.js +13 -1
- package/dist/index.js.map +1 -1
- package/package.json +3 -2
- package/src/index.ts +1 -2
- package/src/mapper/credential-mapper.ts +33 -31
- package/src/types/datastore.ts +6 -0
- package/src/types/index.ts +1 -1
- package/src/types/sd-jwt-vc.ts +1 -3
- package/src/types/vc.ts +40 -0
- package/src/types/vcdm2-sdjwt/index.ts +2 -2
- package/src/types/vcdm2-sdjwt/sd-jwt-vc-config.ts +7 -7
- package/src/types/w3c-vc.ts +2 -3
- package/src/utils/mdoc.ts +4 -4
- package/src/utils/sd-jwt.ts +17 -12
- package/src/utils/vc.ts +1 -1
- package/src/types/dcql.ts +0 -39
package/dist/index.d.cts
CHANGED
|
@@ -472,6 +472,7 @@ declare class CredentialMapper {
|
|
|
472
472
|
* an async hasher implementation, use the decodeSdJwtVcAsync method instead and you can provide the decoded payload to methods
|
|
473
473
|
* instead of the compact SD-JWT.
|
|
474
474
|
*
|
|
475
|
+
* @param credential
|
|
475
476
|
* @param hasher Hasher implementation to use for SD-JWT decoding
|
|
476
477
|
*/
|
|
477
478
|
static decodeVerifiableCredential(credential: OriginalVerifiableCredential, hasher?: HasherSync): JwtDecodedVerifiableCredential | IVerifiableCredential | SdJwtDecodedVerifiableCredential;
|
|
@@ -482,7 +483,8 @@ declare class CredentialMapper {
|
|
|
482
483
|
* an async hasher implementation, use the decodeSdJwtVcAsync method instead and you can provide the decoded payload to methods
|
|
483
484
|
* instead of the compact SD-JWT.
|
|
484
485
|
*
|
|
485
|
-
* @param
|
|
486
|
+
* @param originalPresentation
|
|
487
|
+
* @param opts
|
|
486
488
|
*/
|
|
487
489
|
static toWrappedVerifiablePresentation(originalPresentation: OriginalVerifiablePresentation, opts?: {
|
|
488
490
|
maxTimeSkewInMS?: number;
|
|
@@ -579,7 +581,7 @@ declare enum OriginalType {
|
|
|
579
581
|
MSO_MDOC_DECODED = "mso_mdoc-decoded"
|
|
580
582
|
}
|
|
581
583
|
declare const JWT_PROOF_TYPE_2020 = "JwtProof2020";
|
|
582
|
-
declare
|
|
584
|
+
declare enum DocumentFormat {
|
|
583
585
|
JWT = 0,
|
|
584
586
|
JSONLD = 1,
|
|
585
587
|
SD_JWT_VC = 2,
|
|
@@ -688,7 +690,7 @@ interface IVcdmBaseCredential {
|
|
|
688
690
|
type: string[];
|
|
689
691
|
credentialSchema?: undefined | SingleOrArray<ICredentialSchemaType>;
|
|
690
692
|
issuer: IIssuerId | IIssuer;
|
|
691
|
-
credentialSubject: SingleOrArray<
|
|
693
|
+
credentialSubject: SingleOrArray<ICredentialSubject & AdditionalClaims>;
|
|
692
694
|
id?: string;
|
|
693
695
|
credentialStatus?: SingleOrArray<ICredentialStatus>;
|
|
694
696
|
description?: string;
|
|
@@ -1182,6 +1184,40 @@ type ClaimFormat = CredentialFormat | PresentationFormat;
|
|
|
1182
1184
|
type OriginalVerifiableCredential = W3CVerifiableCredential | JwtDecodedVerifiableCredential | SdJwtDecodedVerifiableCredential | MdocOid4vpIssuerSigned | MdocDocument;
|
|
1183
1185
|
type OriginalVerifiablePresentation = W3CVerifiablePresentation | JwtDecodedVerifiablePresentation | SdJwtDecodedVerifiableCredential | MdocOid4vpMdocVpToken | MdocDeviceResponse;
|
|
1184
1186
|
type Original = OriginalVerifiablePresentation | OriginalVerifiableCredential;
|
|
1187
|
+
type JwtObject = {
|
|
1188
|
+
alg_values: Array<string>;
|
|
1189
|
+
};
|
|
1190
|
+
type LdpObject = {
|
|
1191
|
+
proof_type_values: Array<string>;
|
|
1192
|
+
};
|
|
1193
|
+
type DiObject = {
|
|
1194
|
+
proof_type_values: Array<string>;
|
|
1195
|
+
cryptosuite: Array<string>;
|
|
1196
|
+
};
|
|
1197
|
+
type SdJwtObject = {
|
|
1198
|
+
['sd-jwt_alg_values']?: Array<string>;
|
|
1199
|
+
['kb-jwt_alg_values']?: Array<string>;
|
|
1200
|
+
};
|
|
1201
|
+
type MsoMdocObject = {
|
|
1202
|
+
['issuerauth_alg_values']?: Array<number>;
|
|
1203
|
+
['deviceauth_alg_values']?: Array<number>;
|
|
1204
|
+
};
|
|
1205
|
+
type Format = {
|
|
1206
|
+
jwt?: JwtObject;
|
|
1207
|
+
jwt_vc?: JwtObject;
|
|
1208
|
+
jwt_vc_json?: JwtObject;
|
|
1209
|
+
jwt_vp?: JwtObject;
|
|
1210
|
+
jwt_vp_json?: JwtObject;
|
|
1211
|
+
ldp?: LdpObject;
|
|
1212
|
+
ldp_vc?: LdpObject;
|
|
1213
|
+
ldp_vp?: LdpObject;
|
|
1214
|
+
di?: DiObject;
|
|
1215
|
+
di_vc?: DiObject;
|
|
1216
|
+
di_vp?: DiObject;
|
|
1217
|
+
['vc+sd-jwt']?: SdJwtObject;
|
|
1218
|
+
['dc+sd-jwt']?: SdJwtObject;
|
|
1219
|
+
mso_mdoc?: MsoMdocObject;
|
|
1220
|
+
};
|
|
1185
1221
|
|
|
1186
1222
|
/**
|
|
1187
1223
|
* Represents the metadata associated with a specific SD-JWT VC type.
|
|
@@ -1415,37 +1451,11 @@ interface IMetadataImportArgs {
|
|
|
1415
1451
|
type CWT = string;
|
|
1416
1452
|
type StatusListCredential = W3CVerifiableCredential | CWT;
|
|
1417
1453
|
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
format: string;
|
|
1424
|
-
alg?: string[];
|
|
1425
|
-
claims: DcqlClaim[];
|
|
1426
|
-
meta?: Record<string, any>;
|
|
1427
|
-
}
|
|
1428
|
-
interface DcqlClaim {
|
|
1429
|
-
namespace: string;
|
|
1430
|
-
claim_name: string;
|
|
1431
|
-
filter?: DcqlFilter;
|
|
1432
|
-
}
|
|
1433
|
-
interface DcqlFilter {
|
|
1434
|
-
type: 'string' | 'number' | 'boolean';
|
|
1435
|
-
pattern?: string;
|
|
1436
|
-
minimum?: number;
|
|
1437
|
-
maximum?: number;
|
|
1438
|
-
}
|
|
1439
|
-
interface DcqlPresentationResult {
|
|
1440
|
-
canBeSatisfied: boolean;
|
|
1441
|
-
credential_matches: Record<string, DcqlCredentialMatch>;
|
|
1442
|
-
invalid_matches?: Record<string, DcqlCredentialMatch>;
|
|
1443
|
-
}
|
|
1444
|
-
interface DcqlCredentialMatch {
|
|
1445
|
-
success: boolean;
|
|
1446
|
-
input_credential_index: number;
|
|
1447
|
-
claim_set_index?: number;
|
|
1448
|
-
output: any;
|
|
1454
|
+
declare enum CredentialRole {
|
|
1455
|
+
ISSUER = "ISSUER",
|
|
1456
|
+
VERIFIER = "VERIFIER",
|
|
1457
|
+
HOLDER = "HOLDER",
|
|
1458
|
+
FEDERATION_TRUST_ANCHOR = "FEDERATION_TRUST_ANCHOR"
|
|
1449
1459
|
}
|
|
1450
1460
|
|
|
1451
1461
|
declare enum LogLevel {
|
|
@@ -1635,4 +1645,4 @@ declare class BasicEventEmitter extends EventEmitter {
|
|
|
1635
1645
|
emit(eventName: string, event: BasicEvent<any, any>, ...args: any[]): boolean;
|
|
1636
1646
|
}
|
|
1637
1647
|
|
|
1638
|
-
export { type ActionSubType, ActionType, type AdditionalClaims, type BaseJWK, type BasicEvent, BasicEventEmitter, type BearerTokenArg, type CWT, type ClaimFormat, type CompactJWT, type CompactSdJwtVc, type ConditionWeightedThreshold, type CredentialConstraint, type CredentialEncoding, type CredentialFormat, CredentialMapper, type CredentialProofFormat, type DIDDocument, type DIDDocumentMetadata, type DIDResolutionMetadata, type DIDResolutionOptions, type DIDResolutionResult, type DataModel,
|
|
1648
|
+
export { type ActionSubType, ActionType, type AdditionalClaims, type BaseJWK, type BasicEvent, BasicEventEmitter, type BearerTokenArg, type CWT, type ClaimFormat, type CompactJWT, type CompactSdJwtVc, type ConditionWeightedThreshold, type CredentialConstraint, type CredentialEncoding, type CredentialFormat, CredentialMapper, type CredentialProofFormat, CredentialRole, type DIDDocument, type DIDDocumentMetadata, type DIDResolutionMetadata, type DIDResolutionOptions, type DIDResolutionResult, type DataModel, DefaultActionSubType, type Descriptor, type DeviceSignedJson, type DiObject, DocumentFormat, type DocumentJson, type EventData, EventManager, type Extensible, type Format, type Hasher, type HasherSync, ICoseCurve, type ICoseKeyJson, ICoseKeyOperation, ICoseKeyType, ICoseSignatureAlgorithm, type ICredential, type ICredentialContext, type ICredentialContextType, type ICredentialSchema, type ICredentialSchemaType, type ICredentialStatus, type ICredentialSubject, type IError, type IErrorDetails, type IHasProof, type IIssuer, type IIssuerId, type IMetadataImportArgs, type IParsedDID, type IPresentation, type IProof, IProofPurpose, IProofType, type ISimpleLogger, type IValidationResult, type IValidationResults, type IVcdm2Credential, type IVcdmBaseCredential, type IVerifiableCredential, type IVerifiablePresentation, type IVerifyResult, type IVerifySingleResultItem, type IVerifySingleResultLog, type IVerifyStatusResult, InitiatorType, type IssuerAttributeName, type IssuerSignedItemJson, type IssuerSignedJson, type JWK, JWT_PROOF_TYPE_2020, JoseCurve, type JoseCurveString, JoseKeyOperation, type JoseKeyOperationString, JoseSignatureAlgorithm, type JoseSignatureAlgorithmString, type JsonValue, type JsonWebKey, JwkKeyType, type JwkKeyTypeString, type JwtDecodedVerifiableCredential, type JwtDecodedVerifiablePresentation, type JwtObject, type KeyCapabilitySection, type LanguageValueClaim, type LdpObject, LogLevel, LogMethod, Loggers, LoggingEventType, type MdocDecodedPayload, type MdocDeviceResponse, type MdocDocument, type MdocDocumentJson, type MdocIssuerSigned, type MdocOid4vpIssuerSigned, type MdocOid4vpMdocVpToken, type MetadataType, type MsoMdocObject, ObjectUtils, type Optional, type OrPromise, type Original, OriginalType, type OriginalVerifiableCredential, type OriginalVerifiablePresentation, type PresentationFormat, type PresentationSubmission, type RequireOneOf, type SDJWTVCDM2Config, type SdJwtClaimDisplayMetadata, type SdJwtClaimMetadata, type SdJwtClaimPath, type SdJwtClaimSelectiveDisclosure, type SdJwtCredentialInput, type SdJwtDecodedDisclosure, type SdJwtDecodedVerifiableCredential, type SdJwtDecodedVerifiableCredentialPayload, type SdJwtDisclosure, type SdJwtDisclosureFrame, type SdJwtJsonValue, type SdJwtLogoMetadata, type SdJwtObject, type SdJwtPayload, type SdJwtPresentationFrame, type SdJwtSVGTemplateMetadata, type SdJwtSVGTemplateProperties, type SdJwtSignedVerifiableCredentialPayload, type SdJwtSimpleRenderingMetadata, type SdJwtType, type SdJwtTypeDisplayMetadata, type SdJwtTypeHasher, type SdJwtTypeMetadata, type SdJwtTypeRenderingMetadata, type SdJwtVcKbJwtHeader, type SdJwtVcKbJwtPayload, type SdJwtVcType, type SdJwtVcdm2Payload, type SdJwtVpType, type Service, type ServiceEndpoint, type SimpleLogEvent, type SimpleLogOptions, SimpleLogger, SimpleRecordLogger, type SingleOrArray, type StatusListCredential, StatusListCredentialIdMode, StatusListDriverType, type StatusListFetcher, type StatusListIndexingDirection, StatusListType, type StatusPurpose2021, type StatusValidator, SubSystem, type SubjectAttributeName, System, SystemCorrelationIdType, type TypeAttributeName, type UniformVerifiablePresentation, VCDM_CREDENTIAL_CONTEXT_V1, VCDM_CREDENTIAL_CONTEXT_V2, VCDM_CREDENTIAL_CONTEXT_VERSIONS, type VerificationMethod, type W3CVerifiableCredential, type W3CVerifiablePresentation, type WrappedMdocCredential, type WrappedMdocPresentation, type WrappedSdJwtVerifiableCredential, type WrappedSdJwtVerifiablePresentation, type WrappedVerifiableCredential, type WrappedVerifiablePresentation, type WrappedW3CVerifiableCredential, type WrappedW3CVerifiablePresentation, addVcdmContextIfNeeded, decodeMdocDeviceResponse, decodeMdocIssuerSigned, decodeSdJwtVc, decodeSdJwtVcAsync, defaultHasher, encodeMdocIssuerSigned, getMdocDecodedPayload, isLanguageValueObject, isLanguageValueObjects, isVcdm1Credential, isVcdm2Credential, isWrappedMdocCredential, isWrappedMdocPresentation, isWrappedSdJwtVerifiableCredential, isWrappedSdJwtVerifiablePresentation, isWrappedW3CVerifiableCredential, isWrappedW3CVerifiablePresentation, logOptions, mapLanguageValue, mapLanguageValues, mdocDecodedCredentialToUniformCredential, parseDid, sdJwtDecodedCredentialToUniformCredential, sha256, shaHasher, toLanguageValueObject, toLanguageValueObjects };
|
package/dist/index.d.ts
CHANGED
|
@@ -472,6 +472,7 @@ declare class CredentialMapper {
|
|
|
472
472
|
* an async hasher implementation, use the decodeSdJwtVcAsync method instead and you can provide the decoded payload to methods
|
|
473
473
|
* instead of the compact SD-JWT.
|
|
474
474
|
*
|
|
475
|
+
* @param credential
|
|
475
476
|
* @param hasher Hasher implementation to use for SD-JWT decoding
|
|
476
477
|
*/
|
|
477
478
|
static decodeVerifiableCredential(credential: OriginalVerifiableCredential, hasher?: HasherSync): JwtDecodedVerifiableCredential | IVerifiableCredential | SdJwtDecodedVerifiableCredential;
|
|
@@ -482,7 +483,8 @@ declare class CredentialMapper {
|
|
|
482
483
|
* an async hasher implementation, use the decodeSdJwtVcAsync method instead and you can provide the decoded payload to methods
|
|
483
484
|
* instead of the compact SD-JWT.
|
|
484
485
|
*
|
|
485
|
-
* @param
|
|
486
|
+
* @param originalPresentation
|
|
487
|
+
* @param opts
|
|
486
488
|
*/
|
|
487
489
|
static toWrappedVerifiablePresentation(originalPresentation: OriginalVerifiablePresentation, opts?: {
|
|
488
490
|
maxTimeSkewInMS?: number;
|
|
@@ -579,7 +581,7 @@ declare enum OriginalType {
|
|
|
579
581
|
MSO_MDOC_DECODED = "mso_mdoc-decoded"
|
|
580
582
|
}
|
|
581
583
|
declare const JWT_PROOF_TYPE_2020 = "JwtProof2020";
|
|
582
|
-
declare
|
|
584
|
+
declare enum DocumentFormat {
|
|
583
585
|
JWT = 0,
|
|
584
586
|
JSONLD = 1,
|
|
585
587
|
SD_JWT_VC = 2,
|
|
@@ -688,7 +690,7 @@ interface IVcdmBaseCredential {
|
|
|
688
690
|
type: string[];
|
|
689
691
|
credentialSchema?: undefined | SingleOrArray<ICredentialSchemaType>;
|
|
690
692
|
issuer: IIssuerId | IIssuer;
|
|
691
|
-
credentialSubject: SingleOrArray<
|
|
693
|
+
credentialSubject: SingleOrArray<ICredentialSubject & AdditionalClaims>;
|
|
692
694
|
id?: string;
|
|
693
695
|
credentialStatus?: SingleOrArray<ICredentialStatus>;
|
|
694
696
|
description?: string;
|
|
@@ -1182,6 +1184,40 @@ type ClaimFormat = CredentialFormat | PresentationFormat;
|
|
|
1182
1184
|
type OriginalVerifiableCredential = W3CVerifiableCredential | JwtDecodedVerifiableCredential | SdJwtDecodedVerifiableCredential | MdocOid4vpIssuerSigned | MdocDocument;
|
|
1183
1185
|
type OriginalVerifiablePresentation = W3CVerifiablePresentation | JwtDecodedVerifiablePresentation | SdJwtDecodedVerifiableCredential | MdocOid4vpMdocVpToken | MdocDeviceResponse;
|
|
1184
1186
|
type Original = OriginalVerifiablePresentation | OriginalVerifiableCredential;
|
|
1187
|
+
type JwtObject = {
|
|
1188
|
+
alg_values: Array<string>;
|
|
1189
|
+
};
|
|
1190
|
+
type LdpObject = {
|
|
1191
|
+
proof_type_values: Array<string>;
|
|
1192
|
+
};
|
|
1193
|
+
type DiObject = {
|
|
1194
|
+
proof_type_values: Array<string>;
|
|
1195
|
+
cryptosuite: Array<string>;
|
|
1196
|
+
};
|
|
1197
|
+
type SdJwtObject = {
|
|
1198
|
+
['sd-jwt_alg_values']?: Array<string>;
|
|
1199
|
+
['kb-jwt_alg_values']?: Array<string>;
|
|
1200
|
+
};
|
|
1201
|
+
type MsoMdocObject = {
|
|
1202
|
+
['issuerauth_alg_values']?: Array<number>;
|
|
1203
|
+
['deviceauth_alg_values']?: Array<number>;
|
|
1204
|
+
};
|
|
1205
|
+
type Format = {
|
|
1206
|
+
jwt?: JwtObject;
|
|
1207
|
+
jwt_vc?: JwtObject;
|
|
1208
|
+
jwt_vc_json?: JwtObject;
|
|
1209
|
+
jwt_vp?: JwtObject;
|
|
1210
|
+
jwt_vp_json?: JwtObject;
|
|
1211
|
+
ldp?: LdpObject;
|
|
1212
|
+
ldp_vc?: LdpObject;
|
|
1213
|
+
ldp_vp?: LdpObject;
|
|
1214
|
+
di?: DiObject;
|
|
1215
|
+
di_vc?: DiObject;
|
|
1216
|
+
di_vp?: DiObject;
|
|
1217
|
+
['vc+sd-jwt']?: SdJwtObject;
|
|
1218
|
+
['dc+sd-jwt']?: SdJwtObject;
|
|
1219
|
+
mso_mdoc?: MsoMdocObject;
|
|
1220
|
+
};
|
|
1185
1221
|
|
|
1186
1222
|
/**
|
|
1187
1223
|
* Represents the metadata associated with a specific SD-JWT VC type.
|
|
@@ -1415,37 +1451,11 @@ interface IMetadataImportArgs {
|
|
|
1415
1451
|
type CWT = string;
|
|
1416
1452
|
type StatusListCredential = W3CVerifiableCredential | CWT;
|
|
1417
1453
|
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
format: string;
|
|
1424
|
-
alg?: string[];
|
|
1425
|
-
claims: DcqlClaim[];
|
|
1426
|
-
meta?: Record<string, any>;
|
|
1427
|
-
}
|
|
1428
|
-
interface DcqlClaim {
|
|
1429
|
-
namespace: string;
|
|
1430
|
-
claim_name: string;
|
|
1431
|
-
filter?: DcqlFilter;
|
|
1432
|
-
}
|
|
1433
|
-
interface DcqlFilter {
|
|
1434
|
-
type: 'string' | 'number' | 'boolean';
|
|
1435
|
-
pattern?: string;
|
|
1436
|
-
minimum?: number;
|
|
1437
|
-
maximum?: number;
|
|
1438
|
-
}
|
|
1439
|
-
interface DcqlPresentationResult {
|
|
1440
|
-
canBeSatisfied: boolean;
|
|
1441
|
-
credential_matches: Record<string, DcqlCredentialMatch>;
|
|
1442
|
-
invalid_matches?: Record<string, DcqlCredentialMatch>;
|
|
1443
|
-
}
|
|
1444
|
-
interface DcqlCredentialMatch {
|
|
1445
|
-
success: boolean;
|
|
1446
|
-
input_credential_index: number;
|
|
1447
|
-
claim_set_index?: number;
|
|
1448
|
-
output: any;
|
|
1454
|
+
declare enum CredentialRole {
|
|
1455
|
+
ISSUER = "ISSUER",
|
|
1456
|
+
VERIFIER = "VERIFIER",
|
|
1457
|
+
HOLDER = "HOLDER",
|
|
1458
|
+
FEDERATION_TRUST_ANCHOR = "FEDERATION_TRUST_ANCHOR"
|
|
1449
1459
|
}
|
|
1450
1460
|
|
|
1451
1461
|
declare enum LogLevel {
|
|
@@ -1635,4 +1645,4 @@ declare class BasicEventEmitter extends EventEmitter {
|
|
|
1635
1645
|
emit(eventName: string, event: BasicEvent<any, any>, ...args: any[]): boolean;
|
|
1636
1646
|
}
|
|
1637
1647
|
|
|
1638
|
-
export { type ActionSubType, ActionType, type AdditionalClaims, type BaseJWK, type BasicEvent, BasicEventEmitter, type BearerTokenArg, type CWT, type ClaimFormat, type CompactJWT, type CompactSdJwtVc, type ConditionWeightedThreshold, type CredentialConstraint, type CredentialEncoding, type CredentialFormat, CredentialMapper, type CredentialProofFormat, type DIDDocument, type DIDDocumentMetadata, type DIDResolutionMetadata, type DIDResolutionOptions, type DIDResolutionResult, type DataModel,
|
|
1648
|
+
export { type ActionSubType, ActionType, type AdditionalClaims, type BaseJWK, type BasicEvent, BasicEventEmitter, type BearerTokenArg, type CWT, type ClaimFormat, type CompactJWT, type CompactSdJwtVc, type ConditionWeightedThreshold, type CredentialConstraint, type CredentialEncoding, type CredentialFormat, CredentialMapper, type CredentialProofFormat, CredentialRole, type DIDDocument, type DIDDocumentMetadata, type DIDResolutionMetadata, type DIDResolutionOptions, type DIDResolutionResult, type DataModel, DefaultActionSubType, type Descriptor, type DeviceSignedJson, type DiObject, DocumentFormat, type DocumentJson, type EventData, EventManager, type Extensible, type Format, type Hasher, type HasherSync, ICoseCurve, type ICoseKeyJson, ICoseKeyOperation, ICoseKeyType, ICoseSignatureAlgorithm, type ICredential, type ICredentialContext, type ICredentialContextType, type ICredentialSchema, type ICredentialSchemaType, type ICredentialStatus, type ICredentialSubject, type IError, type IErrorDetails, type IHasProof, type IIssuer, type IIssuerId, type IMetadataImportArgs, type IParsedDID, type IPresentation, type IProof, IProofPurpose, IProofType, type ISimpleLogger, type IValidationResult, type IValidationResults, type IVcdm2Credential, type IVcdmBaseCredential, type IVerifiableCredential, type IVerifiablePresentation, type IVerifyResult, type IVerifySingleResultItem, type IVerifySingleResultLog, type IVerifyStatusResult, InitiatorType, type IssuerAttributeName, type IssuerSignedItemJson, type IssuerSignedJson, type JWK, JWT_PROOF_TYPE_2020, JoseCurve, type JoseCurveString, JoseKeyOperation, type JoseKeyOperationString, JoseSignatureAlgorithm, type JoseSignatureAlgorithmString, type JsonValue, type JsonWebKey, JwkKeyType, type JwkKeyTypeString, type JwtDecodedVerifiableCredential, type JwtDecodedVerifiablePresentation, type JwtObject, type KeyCapabilitySection, type LanguageValueClaim, type LdpObject, LogLevel, LogMethod, Loggers, LoggingEventType, type MdocDecodedPayload, type MdocDeviceResponse, type MdocDocument, type MdocDocumentJson, type MdocIssuerSigned, type MdocOid4vpIssuerSigned, type MdocOid4vpMdocVpToken, type MetadataType, type MsoMdocObject, ObjectUtils, type Optional, type OrPromise, type Original, OriginalType, type OriginalVerifiableCredential, type OriginalVerifiablePresentation, type PresentationFormat, type PresentationSubmission, type RequireOneOf, type SDJWTVCDM2Config, type SdJwtClaimDisplayMetadata, type SdJwtClaimMetadata, type SdJwtClaimPath, type SdJwtClaimSelectiveDisclosure, type SdJwtCredentialInput, type SdJwtDecodedDisclosure, type SdJwtDecodedVerifiableCredential, type SdJwtDecodedVerifiableCredentialPayload, type SdJwtDisclosure, type SdJwtDisclosureFrame, type SdJwtJsonValue, type SdJwtLogoMetadata, type SdJwtObject, type SdJwtPayload, type SdJwtPresentationFrame, type SdJwtSVGTemplateMetadata, type SdJwtSVGTemplateProperties, type SdJwtSignedVerifiableCredentialPayload, type SdJwtSimpleRenderingMetadata, type SdJwtType, type SdJwtTypeDisplayMetadata, type SdJwtTypeHasher, type SdJwtTypeMetadata, type SdJwtTypeRenderingMetadata, type SdJwtVcKbJwtHeader, type SdJwtVcKbJwtPayload, type SdJwtVcType, type SdJwtVcdm2Payload, type SdJwtVpType, type Service, type ServiceEndpoint, type SimpleLogEvent, type SimpleLogOptions, SimpleLogger, SimpleRecordLogger, type SingleOrArray, type StatusListCredential, StatusListCredentialIdMode, StatusListDriverType, type StatusListFetcher, type StatusListIndexingDirection, StatusListType, type StatusPurpose2021, type StatusValidator, SubSystem, type SubjectAttributeName, System, SystemCorrelationIdType, type TypeAttributeName, type UniformVerifiablePresentation, VCDM_CREDENTIAL_CONTEXT_V1, VCDM_CREDENTIAL_CONTEXT_V2, VCDM_CREDENTIAL_CONTEXT_VERSIONS, type VerificationMethod, type W3CVerifiableCredential, type W3CVerifiablePresentation, type WrappedMdocCredential, type WrappedMdocPresentation, type WrappedSdJwtVerifiableCredential, type WrappedSdJwtVerifiablePresentation, type WrappedVerifiableCredential, type WrappedVerifiablePresentation, type WrappedW3CVerifiableCredential, type WrappedW3CVerifiablePresentation, addVcdmContextIfNeeded, decodeMdocDeviceResponse, decodeMdocIssuerSigned, decodeSdJwtVc, decodeSdJwtVcAsync, defaultHasher, encodeMdocIssuerSigned, getMdocDecodedPayload, isLanguageValueObject, isLanguageValueObjects, isVcdm1Credential, isVcdm2Credential, isWrappedMdocCredential, isWrappedMdocPresentation, isWrappedSdJwtVerifiableCredential, isWrappedSdJwtVerifiablePresentation, isWrappedW3CVerifiableCredential, isWrappedW3CVerifiablePresentation, logOptions, mapLanguageValue, mapLanguageValues, mdocDecodedCredentialToUniformCredential, parseDid, sdJwtDecodedCredentialToUniformCredential, sha256, shaHasher, toLanguageValueObject, toLanguageValueObjects };
|
package/dist/index.js
CHANGED
|
@@ -198,6 +198,15 @@ var SimpleRecordLogger = class extends SimpleLogger {
|
|
|
198
198
|
}
|
|
199
199
|
};
|
|
200
200
|
|
|
201
|
+
// src/types/datastore.ts
|
|
202
|
+
var CredentialRole = /* @__PURE__ */ (function(CredentialRole2) {
|
|
203
|
+
CredentialRole2["ISSUER"] = "ISSUER";
|
|
204
|
+
CredentialRole2["VERIFIER"] = "VERIFIER";
|
|
205
|
+
CredentialRole2["HOLDER"] = "HOLDER";
|
|
206
|
+
CredentialRole2["FEDERATION_TRUST_ANCHOR"] = "FEDERATION_TRUST_ANCHOR";
|
|
207
|
+
return CredentialRole2;
|
|
208
|
+
})({});
|
|
209
|
+
|
|
201
210
|
// src/events/index.ts
|
|
202
211
|
import { EventEmitter as EventEmitter2 } from "events";
|
|
203
212
|
var System = /* @__PURE__ */ (function(System2) {
|
|
@@ -995,6 +1004,7 @@ var CredentialMapper = class _CredentialMapper {
|
|
|
995
1004
|
* an async hasher implementation, use the decodeSdJwtVcAsync method instead and you can provide the decoded payload to methods
|
|
996
1005
|
* instead of the compact SD-JWT.
|
|
997
1006
|
*
|
|
1007
|
+
* @param credential
|
|
998
1008
|
* @param hasher Hasher implementation to use for SD-JWT decoding
|
|
999
1009
|
*/
|
|
1000
1010
|
static decodeVerifiableCredential(credential, hasher) {
|
|
@@ -1031,7 +1041,8 @@ var CredentialMapper = class _CredentialMapper {
|
|
|
1031
1041
|
* an async hasher implementation, use the decodeSdJwtVcAsync method instead and you can provide the decoded payload to methods
|
|
1032
1042
|
* instead of the compact SD-JWT.
|
|
1033
1043
|
*
|
|
1034
|
-
* @param
|
|
1044
|
+
* @param originalPresentation
|
|
1045
|
+
* @param opts
|
|
1035
1046
|
*/
|
|
1036
1047
|
static toWrappedVerifiablePresentation(originalPresentation, opts) {
|
|
1037
1048
|
if (_CredentialMapper.isMsoMdocDecodedPresentation(originalPresentation) || _CredentialMapper.isMsoMdocOid4VPEncoded(originalPresentation)) {
|
|
@@ -1712,6 +1723,7 @@ export {
|
|
|
1712
1723
|
ActionType,
|
|
1713
1724
|
BasicEventEmitter,
|
|
1714
1725
|
CredentialMapper,
|
|
1726
|
+
CredentialRole,
|
|
1715
1727
|
DefaultActionSubType,
|
|
1716
1728
|
DocumentFormat,
|
|
1717
1729
|
EventManager,
|