/** * CLR Credential Types * * Types for the Comprehensive Learner Record (CLR) v2.0 Verifiable Credential model. * Based on the IMS Global CLR v2.0 specification. */ /** * Types of achievements that can be represented in a CLR credential. * * Defined by the IMS Global CLR v2.0 specification. * Custom extensions are supported via the `ext:` prefix. */ export type AchievementType = 'Achievement' | 'ApprenticeshipCertificate' | 'Assessment' | 'Assignment' | 'AssociateDegree' | 'Award' | 'Badge' | 'BachelorDegree' | 'Certificate' | 'CertificateOfCompletion' | 'Certification' | 'CommunityService' | 'Competency' | 'Course' | 'CoCurricular' | 'Degree' | 'Diploma' | 'DoctoralDegree' | 'Fieldwork' | 'GeneralEducationDevelopment' | 'JourneymanCertificate' | 'LearningProgram' | 'License' | 'Membership' | 'ProfessionalDoctorate' | 'QualityAssuranceCredential' | 'MasterCertificate' | 'MasterDegree' | 'MicroCredential' | 'ResearchDoctorate' | 'SecondarySchoolDiploma' | (string & {}); /** * Types of associations between achievements or credentials. */ export type AssociationType = 'exactMatchOf' | 'isChildOf' | 'isParentOf' | 'isPartOf' | 'isPeerOf' | 'isRelatedTo' | 'precedes' | 'replacedBy'; /** * Image reference following the IMS Global Image model. */ export interface ClrImage { /** The URI or Data URI of the image. */ id: string; /** MUST be the IRI 'Image'. */ type: 'Image'; /** The caption for the image. */ caption?: string; } /** * Profile representing an issuer or creator of a credential. * * Used for both the top-level issuer and achievement creators. */ export interface ClrProfile { /** URI identifier for the profile. */ id: string; /** Type identifiers (e.g., ['Profile']). */ type: string[]; /** Display name of the profile. */ name?: string; /** URL of the profile's website. */ url?: string; /** Phone number for the profile. */ phone?: string; /** Description of the profile. */ description?: string; /** Image associated with the profile. */ image?: ClrImage; /** Email address for the profile. */ email?: string; } /** * Cryptographic proof ensuring credential integrity and authenticity. * * Supports DataIntegrityProof, JsonWebSignature2020, and other proof types. */ export interface ClrProof { /** The proof type (e.g., 'DataIntegrityProof', 'JsonWebSignature2020'). */ type: string; /** The purpose of the proof (e.g., 'assertionMethod'). */ proofPurpose: string; /** URI of the verification method used to create the proof. */ verificationMethod: string; /** ISO 8601 datetime when the proof was created. */ created: string; /** The proof value (e.g., base64-encoded signature). */ proofValue: string; /** The cryptographic suite used (e.g., 'eddsa-rdfc-2022'). */ cryptosuite?: string; } /** * Schema reference for validating credentials. */ export interface ClrCredentialSchema { /** URI of the credential schema. */ id: string; /** Schema validator type. */ type: '1EdTechJsonSchemaValidator2019'; } /** * Criteria for earning an achievement. */ export interface AchievementCriteria { /** The URI of a webpage that describes the criteria. */ id?: string; /** A narrative of what is needed to earn the achievement. */ narrative?: string; } /** * An achievement that a learner has earned. * * Represents a competency, course completion, badge, or other accomplishment. */ export interface Achievement { /** URI identifier for the achievement. */ id: string; /** Type identifiers (e.g., ['Achievement']). */ type: string[]; /** Display name of the achievement. */ name: string; /** Description of the achievement. */ description: string; /** Criteria for earning the achievement. */ criteria: AchievementCriteria; /** Image associated with the achievement. */ image?: ClrImage; /** Classification of the achievement. */ achievementType?: AchievementType; /** The profile of the entity that created the achievement. */ creator?: ClrProfile; } /** * Identity object for the credential subject. * * Used to identify the learner, optionally with hashed identity for privacy. */ export interface IdentityObject { /** MUST be 'IdentityObject'. */ type: 'IdentityObject'; /** The identity hash (or plain value if not hashed). */ identityHash: string; /** The type of identity (e.g., 'emailAddress', 'sourcedId'). */ identityType: string; /** Whether the identityHash is hashed. */ hashed: boolean; /** Salt used for hashing, if applicable. */ salt?: string; } /** * Association between two achievements or credentials. */ export interface Association { /** MUST be 'Association'. */ type: 'Association'; /** The type of association. */ associationType: AssociationType; /** URI of the source entity. */ sourceId: string; /** URI of the target entity. */ targetId: string; } /** * Credential subject for a nested verifiable credential. */ export interface NestedCredentialSubject { /** URI identifier for the subject. */ id?: string; } /** * A verifiable credential nested within a CLR. * * Represents individual assertions (e.g., AchievementCredentials, * OpenBadgeCredentials) packaged inside the CLR. */ export interface VerifiableCredential { /** JSON-LD context URIs. */ '@context': string[]; /** URI identifier for the credential. */ id: string; /** Type identifiers (e.g., ['VerifiableCredential', 'AchievementCredential']). */ type: string[]; /** The issuer of this credential. */ issuer: ClrProfile; /** ISO 8601 datetime from which the credential is valid. */ validFrom: string; /** ISO 8601 datetime until which the credential is valid. */ validUntil?: string; /** The subject of the credential. */ credentialSubject: NestedCredentialSubject; /** Cryptographic proofs for this credential. */ proof?: ClrProof[]; } /** * The subject of a CLR credential. * * Contains the learner's identity, achievements, nested credentials, * and associations between them. */ export interface ClrCredentialSubject { /** URI identifier for the credential subject (the learner). */ id?: string; /** Type identifiers (e.g., ['ClrSubject']). */ type: string[]; /** Identity objects for the learner. */ identifier?: IdentityObject[]; /** Achievements earned by the learner. */ achievement?: Achievement[]; /** Individual verifiable credentials packaged in the CLR. */ verifiableCredential: VerifiableCredential[]; /** Associations between achievements or credentials. */ association?: Association[]; } /** * A Comprehensive Learner Record (CLR) v2.0 Verifiable Credential. * * The top-level data structure representing a learner's full set of * achievements issued by one or more learning providers. The platform * acts as the publisher, digitally signing the CLR to ensure authenticity. * * Required fields for upsert: `@context`, `id`, `type`, `issuer`, `name`, * `validFrom`, `credentialSubject`. */ export interface ClrCredential { /** JSON-LD context URIs. */ '@context': string[]; /** URI identifier for the CLR credential. */ id: string; /** Type identifiers (e.g., ['VerifiableCredential', 'ClrCredential']). */ type: string[]; /** The issuer (publisher) of the CLR. */ issuer: ClrProfile; /** Display name of the CLR. */ name: string; /** Description of the CLR. */ description?: string; /** ISO 8601 datetime from which the CLR is valid. */ validFrom: string; /** ISO 8601 datetime until which the CLR is valid. */ validUntil?: string; /** The learner and their achievements/credentials. */ credentialSubject: ClrCredentialSubject; /** Cryptographic proofs added by the platform. */ proof?: ClrProof[]; /** Schema references for credential validation. */ credentialSchema?: ClrCredentialSchema[]; } //# sourceMappingURL=credentials.d.ts.map