Skip to content

Commit

Permalink
fix: Local copy of W3C types
Browse files Browse the repository at this point in the history
  • Loading branch information
simonas-notcat committed Oct 9, 2020
1 parent 1fedaa5 commit 29c6b0e
Show file tree
Hide file tree
Showing 4 changed files with 265 additions and 186 deletions.
77 changes: 73 additions & 4 deletions packages/daf-core/src/types/IMessage.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,87 @@
import { Verifiable, W3CCredential, W3CPresentation } from 'did-jwt-vc'
export { W3CCredential, W3CPresentation }
/**
* Verifiable Credential {@link https://github.com/decentralized-identity/did-jwt-vc}
* @public
*/
export type VerifiableCredential = Verifiable<W3CCredential>
export interface VerifiableCredential {
'@context': string[]
id?: string
type: string[]
issuer: { id: string; [x: string]: any }
issuanceDate: string
expirationDate?: string
credentialSubject: {
id?: string
[x: string]: any
}
credentialStatus?: {
id: string
type: string
}
proof: {
type?: string
[x: string]: any
}
[x: string]: any
}

/**
* Verifiable Presentation {@link https://github.com/decentralized-identity/did-jwt-vc}
* @public
*/
export type VerifiablePresentation = Verifiable<W3CPresentation>
export interface VerifiablePresentation {
id?: string
holder: string
issuanceDate?: string
expirationDate?: string
'@context': string[]
type: string[]
verifier: string[]
verifiableCredential: VerifiableCredential[]
proof: {
type?: string
[x: string]: any
}
[x: string]: any
}


/**
* W3CCredential {@link https://github.com/decentralized-identity/did-jwt-vc}
* @public
*/
export interface W3CCredential {
'@context': string[]
id?: string
type: string[]
issuer: { id: string; [x: string]: any }
issuanceDate: string
expirationDate?: string
credentialSubject: {
id?: string
[x: string]: any
}
credentialStatus?: {
id: string
type: string
}
[x: string]: any
}

/**
* W3CPresentation {@link https://github.com/decentralized-identity/did-jwt-vc}
* @public
*/
export interface W3CPresentation {
id?: string
holder: string
issuanceDate?: string
expirationDate?: string
'@context': string[]
type: string[]
verifier: string[]
verifiableCredential: VerifiableCredential[]
[x: string]: any
}

/**
* Message meta data
Expand Down
Loading

0 comments on commit 29c6b0e

Please sign in to comment.