/* eslint-disable */ export enum EventCategory { DID = 'DID', VC = 'VC', VP = 'VP', APPLICATION = 'APPLICATION', } export enum EventComponent { AffinityWalletExpoSDK = 'AffinityWalletExpoSDK', // legacy support; to be removed in the future AffinidiRegistry = 'AffinidiRegistry', AffinidiBrowserSDK = 'AffinidiBrowserWalletSDK', AffinidiExpoSDK = 'AffinidiExpoWalletSDK', AffinidiReactNativeSDK = 'AffinidiReactNativeWalletSDK', AffinidiCloudAPI = 'AffinidiCloudWalletAPI', AffinidiOnboarding = 'AffinidiOnboarding', AffinidiCommon = 'AffinidiCommon', AffinidiCore = 'AffinidiCore', AffinidiRevocation = 'AffinidiRevocation', // TODO: application-level component should be retired eventually AffinidiCaregiver = 'AffinidiCaregiver', AffinidiHealthPassVerifier = 'AffinidiHealthPassVerifier', AffinidiSffIssuer = 'AffinidiSffIssuer', AffinidiVaultMigrationService = 'AffinidiVaultMigrationService', NotImplemented = 'NotImplemented', // temp fallback value for new components (should be implemented eventually) } export enum EventName { DID_CREATED = 'Did Created', DID_UPDATED = 'Did Updated', VC_VERIFIED = 'VC Verified', VC_VERIFIED_PER_PARTY = 'VC Verified per party', VC_SAVED = 'VC Saved', VC_SIGNED = 'VC Signed', VC_REVOKED = 'VC Revoked', VC_ISSUE_INITIATED = 'VC Issue Initiated', SHARED_MESSAGE_CREATED = 'Shared Message Created', VP_SIGNED = 'VP Signed', VP_VERIFIED = 'VP Verified', VP_SIGNED_JWT = 'VP Signed JWT', VP_VERIFIED_JWT = 'VP Verified JWT', USER_ONBOARDED = 'User Onboarded', BLOOM_VAULT_READ = 'User Read from Bloom-vault', BLOOM_VAULT_WRITE = 'User Write to Bloom-vault', } export enum VerificationInvalidReason { REVOKED = 'VC/VP has been revoked', HOLDER_MISMATCHED = 'Given holder doesn\'t match the VC/VP holder', JWT_EXPIRED = 'JWT token is expired', JWT_INVALID_SIGNATURE = 'JWT token signature is invalid', JWT_NONCE_MISMATCHED = 'JWT token nonce doesn\'t match', JWT_VERIFIER_MISMATCHED = 'The verifier who verified the VP is not the one who requested for it', JWT_HOLDER_MISMATCHED = 'The holder who sent the VP is not the one specified by verifier in the original request', ERROR = 'An error occurred during verification (refer to the error message for details)', } export class VerificationMetadata { isValid: boolean invalidReason?: VerificationInvalidReason errorMessage?: string } export class VcMetadata { vcType: string[] // can have multiple vc types verification?: VerificationMetadata data?: any // actual context will depend on vcType } export type VpMetadata = Omit export type EventMetadata = VcMetadata | VpMetadata // | DidMetadata | IssuerMetadata | etc. export class EventInput { name: EventName category: EventCategory subCategory: string // TODO: should be enum component: EventComponent link: string secondaryLink?: string metadata?: EventMetadata } export class SafeTravelEventInput { apiKey: string createdAt: Date eventId: string credentialId?: string credentialType?: string credentialProvider?: string credentialVerifyResult?: any ruleCheckResult?: any isPassed?: boolean error?: any }