@learncard/credential-library 1.0.10 → 1.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +104 -98
- package/package.json +49 -39
- package/src/__tests__/issuance.test.ts +51 -0
- package/src/__tests__/registry.test.ts +457 -0
- package/src/fixtures/boost/basic.ts +50 -0
- package/src/fixtures/boost/boost-id.ts +59 -0
- package/src/fixtures/boost/community-award.ts +96 -0
- package/src/fixtures/boost/delegate.ts +60 -0
- package/src/fixtures/boost/with-skills.ts +80 -0
- package/src/fixtures/clr/competency-aligned.ts +737 -0
- package/src/fixtures/clr/great-plains-full.ts +7841 -0
- package/src/fixtures/clr/minimal.ts +53 -0
- package/src/fixtures/clr/multi-achievement.ts +125 -0
- package/src/fixtures/clr/nd-student-transcript.ts +411 -0
- package/src/fixtures/clr/university-transcript.ts +328 -0
- package/src/fixtures/clr/westbridge-full.ts +2524 -0
- package/src/fixtures/index.ts +159 -0
- package/src/fixtures/invalid/empty-type.ts +27 -0
- package/src/fixtures/invalid/missing-context.ts +27 -0
- package/src/fixtures/invalid/missing-issuer.ts +27 -0
- package/src/fixtures/obv3/1edtech-full.ts +237 -0
- package/src/fixtures/obv3/course-completion.ts +82 -0
- package/src/fixtures/obv3/endorsement.ts +58 -0
- package/src/fixtures/obv3/full-badge.ts +121 -0
- package/src/fixtures/obv3/k12-diploma.ts +92 -0
- package/src/fixtures/obv3/micro-credential.ts +170 -0
- package/src/fixtures/obv3/minimal-badge.ts +40 -0
- package/src/fixtures/obv3/plugfest-jff2.ts +57 -0
- package/src/fixtures/obv3/professional-cert.ts +102 -0
- package/src/fixtures/obv3/with-alignment.ts +62 -0
- package/src/fixtures/obv3/with-endorsement.ts +62 -0
- package/src/fixtures/render-method/render-method-example.ts +45 -0
- package/src/fixtures/vc-v1/alumni-credential.ts +37 -0
- package/src/fixtures/vc-v1/basic.ts +27 -0
- package/src/fixtures/vc-v1/with-status.ts +44 -0
- package/src/fixtures/vc-v2/basic.ts +27 -0
- package/src/fixtures/vc-v2/digital-id.ts +78 -0
- package/src/fixtures/vc-v2/education-degree.ts +77 -0
- package/src/fixtures/vc-v2/employment-credential.ts +64 -0
- package/src/fixtures/vc-v2/license-credential.ts +79 -0
- package/src/fixtures/vc-v2/membership-credential.ts +62 -0
- package/src/fixtures/vc-v2/multiple-subjects.ts +39 -0
- package/src/fixtures/vc-v2/with-evidence.ts +50 -0
- package/src/index.ts +45 -0
- package/src/prepare.ts +212 -0
- package/src/registry.ts +209 -0
- package/src/types.ts +164 -0
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { UnsignedClrCredentialValidator } from '@learncard/types';
|
|
2
|
+
|
|
3
|
+
import type { CredentialFixture } from '../../types';
|
|
4
|
+
|
|
5
|
+
export const clrMinimal: CredentialFixture = {
|
|
6
|
+
id: 'clr/minimal',
|
|
7
|
+
name: 'Minimal CLR v2 Credential',
|
|
8
|
+
description:
|
|
9
|
+
'Minimal Comprehensive Learner Record v2 wrapping a single achievement, per 1EdTech CLR Standard',
|
|
10
|
+
spec: 'clr-v2',
|
|
11
|
+
profile: 'learner-record',
|
|
12
|
+
features: [],
|
|
13
|
+
source: 'spec-example',
|
|
14
|
+
signed: false,
|
|
15
|
+
validity: 'valid',
|
|
16
|
+
validator: UnsignedClrCredentialValidator,
|
|
17
|
+
|
|
18
|
+
credential: {
|
|
19
|
+
'@context': [
|
|
20
|
+
'https://www.w3.org/ns/credentials/v2',
|
|
21
|
+
'https://purl.imsglobal.org/spec/ob/v3p0/context-3.0.3.json',
|
|
22
|
+
'https://purl.imsglobal.org/spec/clr/v2p0/context.json',
|
|
23
|
+
],
|
|
24
|
+
id: 'urn:uuid:f6a7b8c9-0006-4000-8000-000000000001',
|
|
25
|
+
type: ['VerifiableCredential', 'ClrCredential'],
|
|
26
|
+
name: 'Academic Record — Spring 2024',
|
|
27
|
+
issuer: {
|
|
28
|
+
id: 'did:example:stateuniversity',
|
|
29
|
+
type: ['Profile'],
|
|
30
|
+
name: 'State University',
|
|
31
|
+
},
|
|
32
|
+
validFrom: '2024-06-15T00:00:00Z',
|
|
33
|
+
credentialSubject: {
|
|
34
|
+
id: 'did:example:student101',
|
|
35
|
+
type: ['ClrSubject'],
|
|
36
|
+
achievement: [
|
|
37
|
+
{
|
|
38
|
+
id: 'urn:uuid:f6a7b8c9-0006-4000-8000-000000000002',
|
|
39
|
+
type: ['Achievement'],
|
|
40
|
+
achievementType: 'Course',
|
|
41
|
+
name: 'Introduction to Psychology',
|
|
42
|
+
description: 'Survey course covering major psychological theories and research methods.',
|
|
43
|
+
criteria: {
|
|
44
|
+
narrative: 'Complete coursework and pass final exam.',
|
|
45
|
+
},
|
|
46
|
+
humanCode: 'PSY-101',
|
|
47
|
+
fieldOfStudy: 'Psychology',
|
|
48
|
+
creditsAvailable: 3,
|
|
49
|
+
},
|
|
50
|
+
],
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
};
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { UnsignedClrCredentialValidator } from '@learncard/types';
|
|
2
|
+
|
|
3
|
+
import type { CredentialFixture } from '../../types';
|
|
4
|
+
|
|
5
|
+
export const clrMultiAchievement: CredentialFixture = {
|
|
6
|
+
id: 'clr/multi-achievement',
|
|
7
|
+
name: 'CLR v2 with Multiple Achievements and Associations',
|
|
8
|
+
description:
|
|
9
|
+
'Comprehensive Learner Record with multiple achievements linked by associations, demonstrating the full CLR data model',
|
|
10
|
+
spec: 'clr-v2',
|
|
11
|
+
profile: 'learner-record',
|
|
12
|
+
features: ['associations', 'alignment'],
|
|
13
|
+
source: 'synthetic',
|
|
14
|
+
signed: false,
|
|
15
|
+
validity: 'valid',
|
|
16
|
+
validator: UnsignedClrCredentialValidator,
|
|
17
|
+
tags: ['comprehensive'],
|
|
18
|
+
|
|
19
|
+
credential: {
|
|
20
|
+
'@context': [
|
|
21
|
+
'https://www.w3.org/ns/credentials/v2',
|
|
22
|
+
'https://purl.imsglobal.org/spec/ob/v3p0/context-3.0.3.json',
|
|
23
|
+
'https://purl.imsglobal.org/spec/clr/v2p0/context.json',
|
|
24
|
+
],
|
|
25
|
+
id: 'urn:uuid:a7b8c9d0-0007-4000-8000-000000000001',
|
|
26
|
+
type: ['VerifiableCredential', 'ClrCredential'],
|
|
27
|
+
name: 'Associate of Science — Computer Science',
|
|
28
|
+
description: 'Full academic transcript for the AS in Computer Science program.',
|
|
29
|
+
issuer: {
|
|
30
|
+
id: 'did:example:communitycollegeXYZ',
|
|
31
|
+
type: ['Profile'],
|
|
32
|
+
name: 'Community College XYZ',
|
|
33
|
+
url: 'https://ccxyz.example.edu',
|
|
34
|
+
},
|
|
35
|
+
validFrom: '2024-12-20T00:00:00Z',
|
|
36
|
+
credentialSubject: {
|
|
37
|
+
id: 'did:example:student202',
|
|
38
|
+
type: ['ClrSubject'],
|
|
39
|
+
achievement: [
|
|
40
|
+
{
|
|
41
|
+
id: 'urn:uuid:a7b8c9d0-0007-4000-8000-000000000010',
|
|
42
|
+
type: ['Achievement'],
|
|
43
|
+
achievementType: 'Course',
|
|
44
|
+
name: 'Programming I',
|
|
45
|
+
description: 'Introduction to programming using Python.',
|
|
46
|
+
humanCode: 'CS-110',
|
|
47
|
+
fieldOfStudy: 'Computer Science',
|
|
48
|
+
creditsAvailable: 4,
|
|
49
|
+
criteria: { narrative: 'Complete all labs and pass final project.' },
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
id: 'urn:uuid:a7b8c9d0-0007-4000-8000-000000000011',
|
|
53
|
+
type: ['Achievement'],
|
|
54
|
+
achievementType: 'Course',
|
|
55
|
+
name: 'Programming II',
|
|
56
|
+
description: 'Data structures and algorithms in Python.',
|
|
57
|
+
humanCode: 'CS-210',
|
|
58
|
+
fieldOfStudy: 'Computer Science',
|
|
59
|
+
creditsAvailable: 4,
|
|
60
|
+
criteria: { narrative: 'Complete all labs and pass the final exam.' },
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
id: 'urn:uuid:a7b8c9d0-0007-4000-8000-000000000012',
|
|
64
|
+
type: ['Achievement'],
|
|
65
|
+
achievementType: 'Course',
|
|
66
|
+
name: 'Calculus I',
|
|
67
|
+
description: 'Limits, derivatives, and integrals.',
|
|
68
|
+
humanCode: 'MATH-151',
|
|
69
|
+
fieldOfStudy: 'Mathematics',
|
|
70
|
+
creditsAvailable: 4,
|
|
71
|
+
criteria: { narrative: 'Pass midterm and final exams with 60%+.' },
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
id: 'urn:uuid:a7b8c9d0-0007-4000-8000-000000000013',
|
|
75
|
+
type: ['Achievement'],
|
|
76
|
+
achievementType: 'AssociateDegree',
|
|
77
|
+
name: 'Associate of Science in Computer Science',
|
|
78
|
+
description: 'Two-year degree program in computer science.',
|
|
79
|
+
humanCode: 'AS-CS',
|
|
80
|
+
fieldOfStudy: 'Computer Science',
|
|
81
|
+
creditsAvailable: 60,
|
|
82
|
+
criteria: {
|
|
83
|
+
narrative:
|
|
84
|
+
'Complete all required courses with a cumulative GPA of 2.0 or higher.',
|
|
85
|
+
},
|
|
86
|
+
alignment: [
|
|
87
|
+
{
|
|
88
|
+
type: ['Alignment'],
|
|
89
|
+
targetName: 'Computer Science',
|
|
90
|
+
targetUrl: 'https://nces.ed.gov/cip/110101',
|
|
91
|
+
targetType: 'CTDL',
|
|
92
|
+
targetFramework: 'CIP',
|
|
93
|
+
},
|
|
94
|
+
],
|
|
95
|
+
},
|
|
96
|
+
],
|
|
97
|
+
association: [
|
|
98
|
+
{
|
|
99
|
+
type: ['Association'],
|
|
100
|
+
associationType: 'isChildOf',
|
|
101
|
+
targetId: 'urn:uuid:a7b8c9d0-0007-4000-8000-000000000013',
|
|
102
|
+
sourceId: 'urn:uuid:a7b8c9d0-0007-4000-8000-000000000010',
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
type: ['Association'],
|
|
106
|
+
associationType: 'isChildOf',
|
|
107
|
+
targetId: 'urn:uuid:a7b8c9d0-0007-4000-8000-000000000013',
|
|
108
|
+
sourceId: 'urn:uuid:a7b8c9d0-0007-4000-8000-000000000011',
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
type: ['Association'],
|
|
112
|
+
associationType: 'isChildOf',
|
|
113
|
+
targetId: 'urn:uuid:a7b8c9d0-0007-4000-8000-000000000013',
|
|
114
|
+
sourceId: 'urn:uuid:a7b8c9d0-0007-4000-8000-000000000012',
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
type: ['Association'],
|
|
118
|
+
associationType: 'precedes',
|
|
119
|
+
targetId: 'urn:uuid:a7b8c9d0-0007-4000-8000-000000000011',
|
|
120
|
+
sourceId: 'urn:uuid:a7b8c9d0-0007-4000-8000-000000000010',
|
|
121
|
+
},
|
|
122
|
+
],
|
|
123
|
+
},
|
|
124
|
+
},
|
|
125
|
+
};
|