//#region src/models/ClrCredential.d.ts /** * CLR 2.0 (Comprehensive Learner Record) Credential Types * * A ClrCredential bundles multiple OpenBadgeCredentials into a single * verifiable credential representing a learner's complete achievement record. * * Spec: https://www.imsglobal.org/spec/clr/v2p0 */ /** * The subject of a CLR credential - represents the learner */ interface ClrSubject { id: string; type: 'ClrSubject'; verifiableCredential: VerifiableCredentialReference[]; achievement?: AchievementReference[]; association?: Association[]; } /** * A reference to or embedded verifiable credential */ interface VerifiableCredentialReference { '@context'?: string | string[]; type: string[]; id?: string; issuer: string | { id: string; [key: string]: unknown; }; validFrom?: string; validUntil?: string; credentialSubject: Record; proof?: Record; [key: string]: unknown; } /** * Summary reference to an achievement */ interface AchievementReference { id: string; type: 'Achievement'; name: string; description?: string; achievementType?: string; } /** * Association between credentials in a CLR */ interface Association { type: 'Association'; associationType: AssociationType; sourceCredentialId: string; targetCredentialId: string; } type AssociationType = 'isChildOf' | 'isParentOf' | 'isRelatedTo' | 'replacedBy' | 'precedes' | 'isEqualTo'; /** * Input for creating a CLR credential */ interface ClrCredentialInput { /** Optional credential ID (auto-generated if not provided) */ id?: string; /** The learner's identifier (DID or URL) */ learnerId: string; /** The issuer's profile (DID or profile object) */ issuerProfile: string | { id: string; type?: 'Profile'; name?: string; description?: string; url?: string; image?: string; }; /** Array of OpenBadgeCredentials to include */ verifiableCredentials: VerifiableCredentialReference[]; /** Optional associations between credentials */ associations?: Association[]; /** Verification method for signing */ verificationMethod: string; /** Optional validity dates */ validFrom?: string; validUntil?: string; /** Optional name for the CLR */ name?: string; /** Optional description */ description?: string; } /** * The full CLR credential structure */ interface ClrCredential { '@context': string[]; type: ['VerifiableCredential', 'ClrCredential']; id: string; issuer: string | { id: string; [key: string]: unknown; }; validFrom: string; validUntil?: string; name?: string; description?: string; credentialSubject: ClrSubject; proof?: Record; } /** * Build the @context array for a CLR credential */ declare function buildClrContexts(): string[]; /** * Validate a CLR credential structure */ declare function validateClrCredential(credential: Partial): string[]; //#endregion export { AchievementReference, Association, AssociationType, ClrCredential, ClrCredentialInput, ClrSubject, VerifiableCredentialReference, buildClrContexts, validateClrCredential }; //# sourceMappingURL=ClrCredential.d.mts.map