Skip to content

Commit

Permalink
refactor: deleted the type NameAndLocaleExtended and modified NameAnd…
Browse files Browse the repository at this point in the history
…Locale

Signed-off-by: sksadjad <[email protected]>
  • Loading branch information
sksadjad committed Apr 6, 2023
1 parent a0253c2 commit 60cd3d4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
9 changes: 4 additions & 5 deletions packages/common/lib/types/Generic.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,16 @@ export enum CredentialFormatEnum {
export interface NameAndLocale {
name?: string;
locale?: string;
[key: string]: unknown;
}

export type NameAndLocaleExtended = NameAndLocale & { [key: string]: unknown };

export interface LogoAndColor {
logo?: CredentialLogo;
background_color?: string;
text_color?: string;
}

export type Display = NameAndLocaleExtended & LogoAndColor;
export type Display = NameAndLocale & LogoAndColor;

export interface IssuerMetadata {
credential_endpoint: string;
Expand All @@ -40,7 +39,7 @@ export interface IssuerMetadata {
credential_issuer: string; // REQUIRED. The URL of the Credential Issuer, the Wallet is requested to obtain one or more Credentials from.
authorization_server?: string;
token_endpoint?: string;
display?: NameAndLocaleExtended[];
display?: Display[];
}

export interface CredentialIssuerMetadataSupportedCredentials {
Expand Down Expand Up @@ -163,7 +162,7 @@ export type IssuerCredentialSubjectDisplay = CredentialSubjectDisplay & Record<s
export interface CredentialSubjectDisplay {
mandatory?: boolean;
value_type?: string;
display?: NameAndLocaleExtended[];
display?: Display[];
order?: string[]; // An array of claims.display.name values that lists them in the order they should be displayed by the Wallet.
}

Expand Down
4 changes: 2 additions & 2 deletions packages/common/lib/types/OpenID4VCIServerMetadata.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { CredentialFormat } from '@sphereon/ssi-types';

import { Display, IssuerCredentialSubject, NameAndLocaleExtended } from './Generic.types';
import { Display, IssuerCredentialSubject } from './Generic.types';
import { OAuth2ASMetadata } from './OAuth2ASMetadata';

// https://openid.net/specs/openid-4-verifiable-credential-issuance-1_0.html#section-11.2
Expand All @@ -17,7 +17,7 @@ export interface OpenID4VCIServerMetadata {
export type Oauth2ASWithOID4VCIMetadata = OAuth2ASMetadata & OpenID4VCIServerMetadata;

export interface CredentialIssuer {
display?: NameAndLocaleExtended; //OPTIONAL. An array of objects, where each object contains display properties of a Credential issuer for a certain language. Below is a non-exhaustive list of valid parameters that MAY be included:
display?: Display; //OPTIONAL. An array of objects, where each object contains display properties of a Credential issuer for a certain language. Below is a non-exhaustive list of valid parameters that MAY be included:
}

// https://openid.net/specs/openid-4-verifiable-credential-issuance-1_0.html#name-credential-metadata-object
Expand Down

0 comments on commit 60cd3d4

Please sign in to comment.