@sphereon/ssi-types
Advanced tools
Comparing version 0.9.1-unstable.30 to 0.9.1-unstable.34
@@ -1,2 +0,2 @@ | ||
import { DocumentFormat, ICredential, IPresentation, IVerifiableCredential, IVerifiablePresentation, JwtDecodedVerifiableCredential, JwtDecodedVerifiablePresentation, OriginalVerifiableCredential, OriginalVerifiablePresentation, W3CVerifiableCredential, W3CVerifiablePresentation, WrappedVerifiableCredential, WrappedVerifiablePresentation } from '../types'; | ||
import { DocumentFormat, IPresentation, IVerifiableCredential, IVerifiablePresentation, JwtDecodedVerifiableCredential, JwtDecodedVerifiablePresentation, OriginalVerifiableCredential, OriginalVerifiablePresentation, W3CVerifiableCredential, W3CVerifiablePresentation, WrappedVerifiableCredential, WrappedVerifiablePresentation } from '../types'; | ||
export declare class CredentialMapper { | ||
@@ -29,6 +29,7 @@ static decodeVerifiablePresentation(presentation: OriginalVerifiablePresentation): JwtDecodedVerifiablePresentation | IVerifiablePresentation; | ||
maxTimeSkewInMS?: number; | ||
repairMissingVpContext?: boolean; | ||
}): IVerifiablePresentation; | ||
static jwtEncodedCredentialToUniformCredential(jwt: string, opts?: { | ||
maxTimeSkewInMS?: number; | ||
}): ICredential; | ||
}): IVerifiableCredential; | ||
static jwtDecodedCredentialToUniformCredential(decoded: JwtDecodedVerifiableCredential, opts?: { | ||
@@ -35,0 +36,0 @@ maxTimeSkewInMS?: number; |
@@ -180,3 +180,3 @@ "use strict"; | ||
// At time of writing Velocity Networks does not conform to specification. Adding bare minimum @context section to stop parsers from crashing and whatnot | ||
if (!uniformPresentation['@context']) { | ||
if ((opts === null || opts === void 0 ? void 0 : opts.repairMissingVpContext) && !uniformPresentation['@context']) { | ||
uniformPresentation['@context'] = ['https://www.w3.org/2018/credentials/v1']; | ||
@@ -183,0 +183,0 @@ } |
{ | ||
"name": "@sphereon/ssi-types", | ||
"description": "SSI Common Types", | ||
"version": "0.9.1-unstable.30+f9e10f1", | ||
"version": "0.9.1-unstable.34+0a44ee7", | ||
"main": "dist/index.js", | ||
@@ -40,3 +40,3 @@ "types": "dist/index.d.ts", | ||
], | ||
"gitHead": "f9e10f18b07a49ec535f88e87c93cd69f216d121" | ||
"gitHead": "0a44ee76d7df4f0a1bd0a7aa092ab1f417269f97" | ||
} |
@@ -0,0 +0,0 @@ <!--suppress HtmlDeprecatedAttribute --> |
export * from './types' | ||
export * from './utils' | ||
export * from './mapper' |
import { | ||
DocumentFormat, | ||
ICredential, | ||
IPresentation, | ||
@@ -221,3 +220,6 @@ IProof, | ||
static toUniformPresentation(presentation: OriginalVerifiablePresentation, opts?: { maxTimeSkewInMS?: number }): IVerifiablePresentation { | ||
static toUniformPresentation( | ||
presentation: OriginalVerifiablePresentation, | ||
opts?: { maxTimeSkewInMS?: number; repairMissingVpContext?: boolean } | ||
): IVerifiablePresentation { | ||
const original = presentation | ||
@@ -233,3 +235,3 @@ const decoded = CredentialMapper.decodeVerifiablePresentation(original) | ||
// At time of writing Velocity Networks does not conform to specification. Adding bare minimum @context section to stop parsers from crashing and whatnot | ||
if (!uniformPresentation['@context']) { | ||
if (opts?.repairMissingVpContext && !uniformPresentation['@context']) { | ||
uniformPresentation['@context'] = ['https://www.w3.org/2018/credentials/v1'] | ||
@@ -244,3 +246,3 @@ } | ||
static jwtEncodedCredentialToUniformCredential(jwt: string, opts?: { maxTimeSkewInMS?: number }): ICredential { | ||
static jwtEncodedCredentialToUniformCredential(jwt: string, opts?: { maxTimeSkewInMS?: number }): IVerifiableCredential { | ||
return CredentialMapper.jwtDecodedCredentialToUniformCredential(jwt_decode(jwt), opts) | ||
@@ -247,0 +249,0 @@ } |
export * from './credential-mapper' |
export * from './did' | ||
export * from './pex' | ||
export * from './vc' |
@@ -0,0 +0,0 @@ /** |
export * from './object' |
@@ -0,0 +0,0 @@ export class ObjectUtils { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
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
1531
104305
21677