@learncard/credential-library 1.0.10 → 1.0.12
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,328 @@
|
|
|
1
|
+
import type { CredentialFixture } from '../../types';
|
|
2
|
+
|
|
3
|
+
export const clrUniversityTranscript: CredentialFixture = {
|
|
4
|
+
id: 'clr/university-transcript',
|
|
5
|
+
name: 'University Academic Transcript',
|
|
6
|
+
description:
|
|
7
|
+
'A CLR v2 comprehensive university transcript with multiple semesters, courses, grades, GPA, and degree conferral. Modeled after real university transcript issuance patterns.',
|
|
8
|
+
spec: 'clr-v2',
|
|
9
|
+
profile: 'learner-record',
|
|
10
|
+
features: ['results', 'associations', 'image'],
|
|
11
|
+
source: 'synthetic',
|
|
12
|
+
signed: false,
|
|
13
|
+
validity: 'valid',
|
|
14
|
+
tags: ['transcript', 'university', 'education', 'grades', 'gpa', 'comprehensive'],
|
|
15
|
+
|
|
16
|
+
credential: {
|
|
17
|
+
'@context': [
|
|
18
|
+
'https://www.w3.org/ns/credentials/v2',
|
|
19
|
+
'https://purl.imsglobal.org/spec/ob/v3p0/context-3.0.3.json',
|
|
20
|
+
'https://purl.imsglobal.org/spec/clr/v2p0/context-2.0.1.json',
|
|
21
|
+
],
|
|
22
|
+
id: 'urn:uuid:8f3a1c2e-5b74-4d09-ae61-9c8f0d2e7b3a',
|
|
23
|
+
type: ['VerifiableCredential', 'ClrCredential'],
|
|
24
|
+
name: 'Official Academic Transcript – Pacific Coast University',
|
|
25
|
+
description:
|
|
26
|
+
'Official academic transcript for the Bachelor of Science in Computer Science program at Pacific Coast University.',
|
|
27
|
+
issuer: {
|
|
28
|
+
id: 'did:web:registrar.pcu-example.edu',
|
|
29
|
+
type: ['Profile'],
|
|
30
|
+
name: 'Pacific Coast University – Office of the Registrar',
|
|
31
|
+
url: 'https://pcu-example.edu',
|
|
32
|
+
image: {
|
|
33
|
+
id: 'https://pcu-example.edu/logo.png',
|
|
34
|
+
type: 'Image',
|
|
35
|
+
caption: 'Pacific Coast University seal',
|
|
36
|
+
},
|
|
37
|
+
email: 'registrar@pcu-example.edu',
|
|
38
|
+
address: {
|
|
39
|
+
type: ['Address'],
|
|
40
|
+
addressCountry: 'USA',
|
|
41
|
+
addressRegion: 'CA',
|
|
42
|
+
addressLocality: 'Santa Cruz',
|
|
43
|
+
streetAddress: '1156 High Street',
|
|
44
|
+
postalCode: '95064',
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
validFrom: '2025-01-15T00:00:00Z',
|
|
48
|
+
credentialSubject: {
|
|
49
|
+
id: 'did:example:student-pcu-20210045',
|
|
50
|
+
type: ['ClrSubject'],
|
|
51
|
+
identifier: [
|
|
52
|
+
{
|
|
53
|
+
type: 'IdentityObject',
|
|
54
|
+
identityHash: 'student20210045@pcu-example.edu',
|
|
55
|
+
identityType: 'emailAddress',
|
|
56
|
+
hashed: false,
|
|
57
|
+
salt: 'not-used',
|
|
58
|
+
},
|
|
59
|
+
],
|
|
60
|
+
verifiableCredential: [
|
|
61
|
+
{
|
|
62
|
+
'@context': [
|
|
63
|
+
'https://www.w3.org/ns/credentials/v2',
|
|
64
|
+
'https://purl.imsglobal.org/spec/ob/v3p0/context-3.0.3.json',
|
|
65
|
+
],
|
|
66
|
+
id: 'urn:uuid:8f3a1c2e-0001-4000-8000-000000000001',
|
|
67
|
+
type: ['VerifiableCredential', 'AchievementCredential'],
|
|
68
|
+
name: 'CS 101 – Introduction to Computer Science',
|
|
69
|
+
issuer: {
|
|
70
|
+
id: 'did:web:registrar.pcu-example.edu',
|
|
71
|
+
type: ['Profile'],
|
|
72
|
+
name: 'Pacific Coast University',
|
|
73
|
+
},
|
|
74
|
+
validFrom: '2021-12-18T00:00:00Z',
|
|
75
|
+
credentialSubject: {
|
|
76
|
+
id: 'did:example:student-pcu-20210045',
|
|
77
|
+
type: ['AchievementSubject'],
|
|
78
|
+
achievement: {
|
|
79
|
+
id: 'https://pcu-example.edu/courses/cs101',
|
|
80
|
+
type: ['Achievement'],
|
|
81
|
+
achievementType: 'Course',
|
|
82
|
+
name: 'Introduction to Computer Science',
|
|
83
|
+
description: 'Fundamental concepts of programming, algorithms, and computational thinking using Python.',
|
|
84
|
+
humanCode: 'CS 101',
|
|
85
|
+
fieldOfStudy: 'Computer Science',
|
|
86
|
+
creator: {
|
|
87
|
+
id: 'https://pcu-example.edu/departments/cs',
|
|
88
|
+
type: ['Profile'],
|
|
89
|
+
name: 'Department of Computer Science',
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
result: [
|
|
93
|
+
{
|
|
94
|
+
type: ['Result'],
|
|
95
|
+
value: 'A',
|
|
96
|
+
resultDescription: 'urn:uuid:8f3a-grade',
|
|
97
|
+
},
|
|
98
|
+
],
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
'@context': [
|
|
103
|
+
'https://www.w3.org/ns/credentials/v2',
|
|
104
|
+
'https://purl.imsglobal.org/spec/ob/v3p0/context-3.0.3.json',
|
|
105
|
+
],
|
|
106
|
+
id: 'urn:uuid:8f3a1c2e-0001-4000-8000-000000000002',
|
|
107
|
+
type: ['VerifiableCredential', 'AchievementCredential'],
|
|
108
|
+
name: 'CS 201 – Data Structures and Algorithms',
|
|
109
|
+
issuer: {
|
|
110
|
+
id: 'did:web:registrar.pcu-example.edu',
|
|
111
|
+
type: ['Profile'],
|
|
112
|
+
name: 'Pacific Coast University',
|
|
113
|
+
},
|
|
114
|
+
validFrom: '2022-05-20T00:00:00Z',
|
|
115
|
+
credentialSubject: {
|
|
116
|
+
id: 'did:example:student-pcu-20210045',
|
|
117
|
+
type: ['AchievementSubject'],
|
|
118
|
+
achievement: {
|
|
119
|
+
id: 'https://pcu-example.edu/courses/cs201',
|
|
120
|
+
type: ['Achievement'],
|
|
121
|
+
achievementType: 'Course',
|
|
122
|
+
name: 'Data Structures and Algorithms',
|
|
123
|
+
description: 'Study of fundamental data structures (arrays, linked lists, trees, graphs, hash tables) and algorithm design, analysis, and complexity.',
|
|
124
|
+
humanCode: 'CS 201',
|
|
125
|
+
fieldOfStudy: 'Computer Science',
|
|
126
|
+
creator: {
|
|
127
|
+
id: 'https://pcu-example.edu/departments/cs',
|
|
128
|
+
type: ['Profile'],
|
|
129
|
+
name: 'Department of Computer Science',
|
|
130
|
+
},
|
|
131
|
+
},
|
|
132
|
+
result: [
|
|
133
|
+
{
|
|
134
|
+
type: ['Result'],
|
|
135
|
+
value: 'A-',
|
|
136
|
+
resultDescription: 'urn:uuid:8f3a-grade',
|
|
137
|
+
},
|
|
138
|
+
],
|
|
139
|
+
},
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
'@context': [
|
|
143
|
+
'https://www.w3.org/ns/credentials/v2',
|
|
144
|
+
'https://purl.imsglobal.org/spec/ob/v3p0/context-3.0.3.json',
|
|
145
|
+
],
|
|
146
|
+
id: 'urn:uuid:8f3a1c2e-0001-4000-8000-000000000003',
|
|
147
|
+
type: ['VerifiableCredential', 'AchievementCredential'],
|
|
148
|
+
name: 'CS 310 – Operating Systems',
|
|
149
|
+
issuer: {
|
|
150
|
+
id: 'did:web:registrar.pcu-example.edu',
|
|
151
|
+
type: ['Profile'],
|
|
152
|
+
name: 'Pacific Coast University',
|
|
153
|
+
},
|
|
154
|
+
validFrom: '2022-12-18T00:00:00Z',
|
|
155
|
+
credentialSubject: {
|
|
156
|
+
id: 'did:example:student-pcu-20210045',
|
|
157
|
+
type: ['AchievementSubject'],
|
|
158
|
+
achievement: {
|
|
159
|
+
id: 'https://pcu-example.edu/courses/cs310',
|
|
160
|
+
type: ['Achievement'],
|
|
161
|
+
achievementType: 'Course',
|
|
162
|
+
name: 'Operating Systems',
|
|
163
|
+
description: 'Process management, memory management, file systems, I/O, and distributed systems. Includes substantial C programming projects.',
|
|
164
|
+
humanCode: 'CS 310',
|
|
165
|
+
fieldOfStudy: 'Computer Science',
|
|
166
|
+
creator: {
|
|
167
|
+
id: 'https://pcu-example.edu/departments/cs',
|
|
168
|
+
type: ['Profile'],
|
|
169
|
+
name: 'Department of Computer Science',
|
|
170
|
+
},
|
|
171
|
+
},
|
|
172
|
+
result: [
|
|
173
|
+
{
|
|
174
|
+
type: ['Result'],
|
|
175
|
+
value: 'B+',
|
|
176
|
+
resultDescription: 'urn:uuid:8f3a-grade',
|
|
177
|
+
},
|
|
178
|
+
],
|
|
179
|
+
},
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
'@context': [
|
|
183
|
+
'https://www.w3.org/ns/credentials/v2',
|
|
184
|
+
'https://purl.imsglobal.org/spec/ob/v3p0/context-3.0.3.json',
|
|
185
|
+
],
|
|
186
|
+
id: 'urn:uuid:8f3a1c2e-0001-4000-8000-000000000004',
|
|
187
|
+
type: ['VerifiableCredential', 'AchievementCredential'],
|
|
188
|
+
name: 'CS 420 – Machine Learning',
|
|
189
|
+
issuer: {
|
|
190
|
+
id: 'did:web:registrar.pcu-example.edu',
|
|
191
|
+
type: ['Profile'],
|
|
192
|
+
name: 'Pacific Coast University',
|
|
193
|
+
},
|
|
194
|
+
validFrom: '2023-05-19T00:00:00Z',
|
|
195
|
+
credentialSubject: {
|
|
196
|
+
id: 'did:example:student-pcu-20210045',
|
|
197
|
+
type: ['AchievementSubject'],
|
|
198
|
+
achievement: {
|
|
199
|
+
id: 'https://pcu-example.edu/courses/cs420',
|
|
200
|
+
type: ['Achievement'],
|
|
201
|
+
achievementType: 'Course',
|
|
202
|
+
name: 'Machine Learning',
|
|
203
|
+
description: 'Supervised and unsupervised learning, deep learning, reinforcement learning. Hands-on projects with PyTorch.',
|
|
204
|
+
humanCode: 'CS 420',
|
|
205
|
+
fieldOfStudy: 'Computer Science',
|
|
206
|
+
creator: {
|
|
207
|
+
id: 'https://pcu-example.edu/departments/cs',
|
|
208
|
+
type: ['Profile'],
|
|
209
|
+
name: 'Department of Computer Science',
|
|
210
|
+
},
|
|
211
|
+
},
|
|
212
|
+
result: [
|
|
213
|
+
{
|
|
214
|
+
type: ['Result'],
|
|
215
|
+
value: 'A',
|
|
216
|
+
resultDescription: 'urn:uuid:8f3a-grade',
|
|
217
|
+
},
|
|
218
|
+
],
|
|
219
|
+
},
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
'@context': [
|
|
223
|
+
'https://www.w3.org/ns/credentials/v2',
|
|
224
|
+
'https://purl.imsglobal.org/spec/ob/v3p0/context-3.0.3.json',
|
|
225
|
+
],
|
|
226
|
+
id: 'urn:uuid:8f3a1c2e-0001-4000-8000-000000000005',
|
|
227
|
+
type: ['VerifiableCredential', 'AchievementCredential'],
|
|
228
|
+
name: 'MATH 210 – Linear Algebra',
|
|
229
|
+
issuer: {
|
|
230
|
+
id: 'did:web:registrar.pcu-example.edu',
|
|
231
|
+
type: ['Profile'],
|
|
232
|
+
name: 'Pacific Coast University',
|
|
233
|
+
},
|
|
234
|
+
validFrom: '2022-05-20T00:00:00Z',
|
|
235
|
+
credentialSubject: {
|
|
236
|
+
id: 'did:example:student-pcu-20210045',
|
|
237
|
+
type: ['AchievementSubject'],
|
|
238
|
+
achievement: {
|
|
239
|
+
id: 'https://pcu-example.edu/courses/math210',
|
|
240
|
+
type: ['Achievement'],
|
|
241
|
+
achievementType: 'Course',
|
|
242
|
+
name: 'Linear Algebra',
|
|
243
|
+
description: 'Vector spaces, linear transformations, eigenvalues, matrix decompositions, and applications.',
|
|
244
|
+
humanCode: 'MATH 210',
|
|
245
|
+
fieldOfStudy: 'Mathematics',
|
|
246
|
+
creator: {
|
|
247
|
+
id: 'https://pcu-example.edu/departments/math',
|
|
248
|
+
type: ['Profile'],
|
|
249
|
+
name: 'Department of Mathematics',
|
|
250
|
+
},
|
|
251
|
+
},
|
|
252
|
+
result: [
|
|
253
|
+
{
|
|
254
|
+
type: ['Result'],
|
|
255
|
+
value: 'B+',
|
|
256
|
+
resultDescription: 'urn:uuid:8f3a-grade',
|
|
257
|
+
},
|
|
258
|
+
],
|
|
259
|
+
},
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
'@context': [
|
|
263
|
+
'https://www.w3.org/ns/credentials/v2',
|
|
264
|
+
'https://purl.imsglobal.org/spec/ob/v3p0/context-3.0.3.json',
|
|
265
|
+
],
|
|
266
|
+
id: 'urn:uuid:8f3a1c2e-0001-4000-8000-000000000006',
|
|
267
|
+
type: ['VerifiableCredential', 'AchievementCredential'],
|
|
268
|
+
name: 'CS 490 – Senior Capstone Project',
|
|
269
|
+
issuer: {
|
|
270
|
+
id: 'did:web:registrar.pcu-example.edu',
|
|
271
|
+
type: ['Profile'],
|
|
272
|
+
name: 'Pacific Coast University',
|
|
273
|
+
},
|
|
274
|
+
validFrom: '2024-12-18T00:00:00Z',
|
|
275
|
+
credentialSubject: {
|
|
276
|
+
id: 'did:example:student-pcu-20210045',
|
|
277
|
+
type: ['AchievementSubject'],
|
|
278
|
+
achievement: {
|
|
279
|
+
id: 'https://pcu-example.edu/courses/cs490',
|
|
280
|
+
type: ['Achievement'],
|
|
281
|
+
achievementType: 'Course',
|
|
282
|
+
name: 'Senior Capstone Project',
|
|
283
|
+
description: 'A year-long team project applying software engineering practices to build a real-world application. Includes requirements gathering, design, implementation, testing, and deployment.',
|
|
284
|
+
humanCode: 'CS 490',
|
|
285
|
+
fieldOfStudy: 'Computer Science',
|
|
286
|
+
creator: {
|
|
287
|
+
id: 'https://pcu-example.edu/departments/cs',
|
|
288
|
+
type: ['Profile'],
|
|
289
|
+
name: 'Department of Computer Science',
|
|
290
|
+
},
|
|
291
|
+
},
|
|
292
|
+
result: [
|
|
293
|
+
{
|
|
294
|
+
type: ['Result'],
|
|
295
|
+
value: 'A',
|
|
296
|
+
resultDescription: 'urn:uuid:8f3a-grade',
|
|
297
|
+
},
|
|
298
|
+
],
|
|
299
|
+
},
|
|
300
|
+
},
|
|
301
|
+
],
|
|
302
|
+
achievement: [
|
|
303
|
+
{
|
|
304
|
+
id: 'https://pcu-example.edu/programs/bs-cs',
|
|
305
|
+
type: ['Achievement'],
|
|
306
|
+
achievementType: 'Degree',
|
|
307
|
+
name: 'Bachelor of Science in Computer Science',
|
|
308
|
+
description: 'A four-year undergraduate program providing comprehensive training in computer science theory, systems, and applications.',
|
|
309
|
+
humanCode: 'BS-CS',
|
|
310
|
+
fieldOfStudy: 'Computer Science',
|
|
311
|
+
creator: {
|
|
312
|
+
id: 'https://pcu-example.edu/departments/cs',
|
|
313
|
+
type: ['Profile'],
|
|
314
|
+
name: 'Department of Computer Science',
|
|
315
|
+
},
|
|
316
|
+
resultDescription: [
|
|
317
|
+
{
|
|
318
|
+
id: 'urn:uuid:8f3a-gpa',
|
|
319
|
+
type: ['ResultDescription'],
|
|
320
|
+
name: 'Cumulative GPA',
|
|
321
|
+
resultType: 'GradePointAverage',
|
|
322
|
+
},
|
|
323
|
+
],
|
|
324
|
+
},
|
|
325
|
+
],
|
|
326
|
+
},
|
|
327
|
+
},
|
|
328
|
+
};
|