@sphereon/ssi-types
Advanced tools
Comparing version 0.31.1-next.19 to 0.31.1-next.21
{ | ||
"name": "@sphereon/ssi-types", | ||
"description": "SSI Common Types", | ||
"version": "0.31.1-next.19+310ce612", | ||
"version": "0.31.1-next.21+a02ce00a", | ||
"main": "dist/index.js", | ||
@@ -50,3 +50,3 @@ "types": "dist/index.d.ts", | ||
"nx": {}, | ||
"gitHead": "310ce612242cfec3a9e7de65d8426c39a6553a87" | ||
"gitHead": "a02ce00a789225d926f4a3511acef4da345bf147" | ||
} |
@@ -11,3 +11,3 @@ import * as u8a from 'uint8arrays' | ||
*/ | ||
vct: string; | ||
vct: string | ||
@@ -17,3 +17,3 @@ /** | ||
*/ | ||
name?: string; | ||
name?: string | ||
@@ -23,3 +23,3 @@ /** | ||
*/ | ||
description?: string; | ||
description?: string | ||
@@ -29,3 +29,3 @@ /** | ||
*/ | ||
extends?: string; | ||
extends?: string | ||
@@ -35,3 +35,3 @@ /** | ||
*/ | ||
['extends#integrity']?: string; | ||
['extends#integrity']?: string | ||
@@ -41,3 +41,3 @@ /** | ||
*/ | ||
schema_uri?: string; | ||
schema_uri?: string | ||
@@ -47,3 +47,3 @@ /** | ||
*/ | ||
['schema_uri#integrity']?: string; | ||
['schema_uri#integrity']?: string | ||
@@ -53,3 +53,3 @@ /** | ||
*/ | ||
display?: Array<SdJwtTypeDisplayMetadata>; | ||
display?: Array<SdJwtTypeDisplayMetadata> | ||
@@ -60,3 +60,3 @@ /** | ||
// TODO: | ||
claims?: Array<any>; | ||
claims?: Array<any> | ||
} | ||
@@ -71,3 +71,3 @@ | ||
*/ | ||
lang: string; | ||
lang: string | ||
@@ -77,3 +77,3 @@ /** | ||
*/ | ||
name: string; | ||
name: string | ||
@@ -83,3 +83,3 @@ /** | ||
*/ | ||
description?: string; | ||
description?: string | ||
@@ -89,3 +89,3 @@ /** | ||
*/ | ||
rendering?: SdJwtTypeRenderingMetadata; | ||
rendering?: SdJwtTypeRenderingMetadata | ||
} | ||
@@ -100,3 +100,3 @@ | ||
*/ | ||
simple?: SdJwtSimpleRenderingMetadata; | ||
simple?: SdJwtSimpleRenderingMetadata | ||
@@ -106,3 +106,3 @@ /** | ||
*/ | ||
svg_template?: Array<SdJwtSVGTemplateMetadata>; | ||
svg_template?: Array<SdJwtSVGTemplateMetadata> | ||
} | ||
@@ -117,3 +117,3 @@ | ||
*/ | ||
logo?: SdJwtLogoMetadata; | ||
logo?: SdJwtLogoMetadata | ||
@@ -123,3 +123,3 @@ /** | ||
*/ | ||
background_color?: string; | ||
background_color?: string | ||
@@ -129,3 +129,3 @@ /** | ||
*/ | ||
text_color?: string; | ||
text_color?: string | ||
} | ||
@@ -140,3 +140,3 @@ | ||
*/ | ||
uri: string; | ||
uri: string | ||
@@ -146,3 +146,3 @@ /** | ||
*/ | ||
['uri#integrity']?: string; | ||
['uri#integrity']?: string | ||
@@ -152,3 +152,3 @@ /** | ||
*/ | ||
alt_text?: string; | ||
alt_text?: string | ||
} | ||
@@ -163,3 +163,3 @@ | ||
*/ | ||
uri: string; | ||
uri: string | ||
@@ -169,3 +169,3 @@ /** | ||
*/ | ||
['uri#integrity']?: string; | ||
['uri#integrity']?: string | ||
@@ -175,3 +175,3 @@ /** | ||
*/ | ||
properties?: SdJwtSVGTemplateProperties; | ||
properties?: SdJwtSVGTemplateProperties | ||
} | ||
@@ -186,3 +186,3 @@ | ||
*/ | ||
orientation?: string; | ||
orientation?: string | ||
@@ -192,6 +192,5 @@ /** | ||
*/ | ||
color_scheme?: string; | ||
color_scheme?: string | ||
} | ||
// Helper function to fetch API with error handling | ||
@@ -214,3 +213,3 @@ async function fetchUrlWithErrorHandling(url: string): Promise<Response> { | ||
// Fetch and validate Type Metadata | ||
export async function fetchSdJwtTypeMetadataFromVctUrl(vct: string, opts?: { hasher?: AsyncHasher, integrity?: string }): Promise<SdJwtTypeMetadata> { | ||
export async function fetchSdJwtTypeMetadataFromVctUrl(vct: string, opts?: { hasher?: AsyncHasher; integrity?: string }): Promise<SdJwtTypeMetadata> { | ||
const url = new URL(vct) | ||
@@ -223,3 +222,3 @@ const wellKnownUrl = `${url.origin}/.well-known/vct${url.pathname}` | ||
if (opts?.integrity && opts.hasher) { | ||
if (!await validateIntegrity(metadata, opts.integrity, opts.hasher)) { | ||
if (!(await validateIntegrity(metadata, opts.integrity, opts.hasher))) { | ||
throw new Error('Integrity check failed') | ||
@@ -237,3 +236,2 @@ } | ||
/* | ||
@@ -249,2 +247,1 @@ // Example usage | ||
*/ | ||
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
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
367085