UNPKG

@microsoft/useragent-sdk

Version:

SDK for building decentralized identity wallets and enterprise agents.

69 lines (68 loc) 2.42 kB
import { CredentialInput, DataInput, OpenIDInput } from '../types'; import CredentialManifestIssuerOptions from './CredentialManifestIssuerOptions'; /** * Class defining methods and properties for a ClaimManifest object. * based off of the CredentialManifest spec: {@link https://github.com/decentralized-identity/credential-manifest/blob/master/explainer.md} */ export default class CredentialManifest { /** * Name of the credential */ readonly credential?: string; /** * Languages supported for localization */ readonly language?: string[]; /** * the keeper DID whose hub stores the CredentialManifest. */ readonly keeper?: string; /** * Version of the CredentialManifest */ readonly version?: string; /** * preconditions for the manifest. */ readonly preconditions?: any; /** * inputs parameter for manifest. */ readonly inputs?: (CredentialInput | DataInput | OpenIDInput)[]; /** * issuer options for things such as the style of the manifest in the UI. */ issuerOptions?: CredentialManifestIssuerOptions; /** * issuer endpoint */ endpoint: string; /** * Constructs an instance of the CredentialManifest class from a well-formed credential manifest JSON object. */ constructor(credentialManifest: any); /** * Creates a new instance of the CredentialManifest class. */ static create(credential: string, endpoint: string, language: string[], keeper: string, version: string, preconditions: any, inputs: (CredentialInput | DataInput | OpenIDInput)[], issuerOptions: CredentialManifestIssuerOptions): CredentialManifest; /** * serializes the CredentialManifest to JSON. */ toJSON(): { '@context': string; '@type': string; 'endpoint': string; 'credential': string | undefined; 'preconditions': any; 'inputs': (DataInput | CredentialInput | OpenIDInput)[] | undefined; 'issuer_options': CredentialManifestIssuerOptions | undefined; }; /** * Get the keeper did of the CredentialManifest */ getKeeperDid(): string | undefined; /** * Get the input properties of the manifest */ getInputProperties(): (DataInput | CredentialInput | OpenIDInput)[] | undefined; }