@learncard/credential-library 1.0.14 → 1.0.16
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/dist/credential-library.cjs.development.js +227 -21
- package/dist/credential-library.cjs.development.js.map +4 -4
- package/dist/credential-library.cjs.production.min.js +1 -1
- package/dist/credential-library.cjs.production.min.js.map +4 -4
- package/dist/credential-library.esm.js +217 -11
- package/dist/credential-library.esm.js.map +4 -4
- package/dist/fixtures/boost/community-award.d.ts.map +1 -1
- package/dist/fixtures/boost/delegate.d.ts.map +1 -1
- package/dist/fixtures/clr/westbridge-full.d.ts.map +1 -1
- package/dist/fixtures/index.d.ts +2 -1
- package/dist/fixtures/index.d.ts.map +1 -1
- package/dist/fixtures/obv3/endorsement.d.ts.map +1 -1
- package/dist/fixtures/obv3/professional-cert.d.ts.map +1 -1
- package/dist/fixtures/obv3/standalone-full-course.d.ts +3 -0
- package/dist/fixtures/obv3/standalone-full-course.d.ts.map +1 -0
- package/package.json +5 -5
- package/src/__tests__/issuance.test.ts +32 -14
- package/src/fixtures/boost/community-award.ts +3 -1
- package/src/fixtures/boost/delegate.ts +1 -0
- package/src/fixtures/clr/westbridge-full.ts +10 -1
- package/src/fixtures/index.ts +3 -0
- package/src/fixtures/obv3/endorsement.ts +1 -0
- package/src/fixtures/obv3/professional-cert.ts +5 -2
- package/src/fixtures/obv3/standalone-full-course.ts +207 -0
|
@@ -842,7 +842,8 @@ var obv3ProfessionalCert = {
|
|
|
842
842
|
credential: {
|
|
843
843
|
"@context": [
|
|
844
844
|
"https://www.w3.org/ns/credentials/v2",
|
|
845
|
-
"https://purl.imsglobal.org/spec/ob/v3p0/context-3.0.3.json"
|
|
845
|
+
"https://purl.imsglobal.org/spec/ob/v3p0/context-3.0.3.json",
|
|
846
|
+
"https://purl.imsglobal.org/spec/ob/v3p0/extensions.json"
|
|
846
847
|
],
|
|
847
848
|
id: "urn:uuid:b34ca6cd-29d7-4b2f-9e99-4902fd84c5a1",
|
|
848
849
|
type: ["VerifiableCredential", "OpenBadgeCredential"],
|
|
@@ -1161,6 +1162,197 @@ var obv3CourseCompletion = {
|
|
|
1161
1162
|
}
|
|
1162
1163
|
};
|
|
1163
1164
|
|
|
1165
|
+
// src/fixtures/obv3/standalone-full-course.ts
|
|
1166
|
+
import { UnsignedAchievementCredentialValidator as UnsignedAchievementCredentialValidator6 } from "@learncard/types";
|
|
1167
|
+
var obv3StandaloneFullCourse = {
|
|
1168
|
+
id: "obv3/standalone-full-course",
|
|
1169
|
+
name: "Applied Data Ethics and Responsible AI Course Completion",
|
|
1170
|
+
description: "A standalone Open Badges v3 course credential with the academic metadata commonly present on a course nested inside a Comprehensive Learner Record.",
|
|
1171
|
+
spec: "obv3",
|
|
1172
|
+
profile: "course",
|
|
1173
|
+
features: ["image", "evidence", "alignment", "results", "source"],
|
|
1174
|
+
source: "synthetic",
|
|
1175
|
+
signed: false,
|
|
1176
|
+
validity: "valid",
|
|
1177
|
+
validator: UnsignedAchievementCredentialValidator6,
|
|
1178
|
+
tags: ["course", "standalone", "higher-education", "responsible-ai", "full-metadata"],
|
|
1179
|
+
credential: {
|
|
1180
|
+
"@context": [
|
|
1181
|
+
"https://www.w3.org/ns/credentials/v2",
|
|
1182
|
+
"https://purl.imsglobal.org/spec/ob/v3p0/context-3.0.3.json"
|
|
1183
|
+
],
|
|
1184
|
+
id: "urn:uuid:7f1a9b36-91d2-4bd5-a7af-3d8d8e418101",
|
|
1185
|
+
type: ["VerifiableCredential", "AchievementCredential"],
|
|
1186
|
+
name: "Applied Data Ethics and Responsible AI",
|
|
1187
|
+
description: "Recognizes successful completion of a four-credit undergraduate course in ethical data practice and responsible artificial intelligence.",
|
|
1188
|
+
image: {
|
|
1189
|
+
id: "https://aster-ridge.example/credentials/images/data-ethics-course.png",
|
|
1190
|
+
type: "Image",
|
|
1191
|
+
caption: "Applied Data Ethics and Responsible AI course credential"
|
|
1192
|
+
},
|
|
1193
|
+
issuer: {
|
|
1194
|
+
id: "did:web:aster-ridge.example",
|
|
1195
|
+
type: ["Profile"],
|
|
1196
|
+
name: "Aster Ridge Institute",
|
|
1197
|
+
url: "https://aster-ridge.example",
|
|
1198
|
+
description: "A fictional higher education institution focused on technology and public impact.",
|
|
1199
|
+
email: "registrar@aster-ridge.example",
|
|
1200
|
+
image: {
|
|
1201
|
+
id: "https://aster-ridge.example/brand/institute-mark.png",
|
|
1202
|
+
type: "Image",
|
|
1203
|
+
caption: "Aster Ridge Institute mark"
|
|
1204
|
+
}
|
|
1205
|
+
},
|
|
1206
|
+
validFrom: "2026-05-22T16:00:00Z",
|
|
1207
|
+
credentialSubject: {
|
|
1208
|
+
id: "did:example:learner-ari-1087",
|
|
1209
|
+
type: ["AchievementSubject"],
|
|
1210
|
+
activityStartDate: "2026-01-12T08:00:00Z",
|
|
1211
|
+
activityEndDate: "2026-05-18T23:59:59Z",
|
|
1212
|
+
creditsEarned: 4,
|
|
1213
|
+
term: "Spring 2026",
|
|
1214
|
+
narrative: "The learner completed the course requirements, including a team audit of an automated decision system.",
|
|
1215
|
+
source: {
|
|
1216
|
+
id: "https://aster-ridge.example/offices/registrar",
|
|
1217
|
+
type: ["Profile"],
|
|
1218
|
+
name: "Aster Ridge Institute Registrar",
|
|
1219
|
+
url: "https://aster-ridge.example/offices/registrar"
|
|
1220
|
+
},
|
|
1221
|
+
achievement: {
|
|
1222
|
+
id: "https://aster-ridge.example/catalog/courses/DAI-318",
|
|
1223
|
+
type: ["Achievement"],
|
|
1224
|
+
achievementType: "Course",
|
|
1225
|
+
name: "Applied Data Ethics and Responsible AI",
|
|
1226
|
+
description: "An interdisciplinary course covering data governance, algorithmic accountability, bias assessment, privacy, transparency, and responsible deployment of artificial intelligence systems.",
|
|
1227
|
+
humanCode: "DAI-318",
|
|
1228
|
+
fieldOfStudy: "Data Science",
|
|
1229
|
+
creditsAvailable: 4,
|
|
1230
|
+
inLanguage: "en-US",
|
|
1231
|
+
version: "2026.1",
|
|
1232
|
+
criteria: {
|
|
1233
|
+
id: "https://aster-ridge.example/catalog/courses/DAI-318/criteria",
|
|
1234
|
+
narrative: "Complete all seminars and labs, earn at least 70 percent overall, and pass the final algorithmic impact assessment project."
|
|
1235
|
+
},
|
|
1236
|
+
image: {
|
|
1237
|
+
id: "https://aster-ridge.example/credentials/images/data-ethics-course.png",
|
|
1238
|
+
type: "Image",
|
|
1239
|
+
caption: "Applied Data Ethics and Responsible AI course credential"
|
|
1240
|
+
},
|
|
1241
|
+
creator: {
|
|
1242
|
+
id: "https://aster-ridge.example/schools/computing-and-society",
|
|
1243
|
+
type: ["Profile"],
|
|
1244
|
+
name: "School of Computing and Society",
|
|
1245
|
+
url: "https://aster-ridge.example/schools/computing-and-society",
|
|
1246
|
+
description: "The academic unit responsible for the course curriculum and assessment.",
|
|
1247
|
+
parentOrg: {
|
|
1248
|
+
id: "did:web:aster-ridge.example",
|
|
1249
|
+
type: ["Profile"],
|
|
1250
|
+
name: "Aster Ridge Institute"
|
|
1251
|
+
}
|
|
1252
|
+
},
|
|
1253
|
+
otherIdentifier: [
|
|
1254
|
+
{
|
|
1255
|
+
type: "IdentifierEntry",
|
|
1256
|
+
identifier: "ARI-DAI-318-2026-SP",
|
|
1257
|
+
identifierType: "identifier"
|
|
1258
|
+
}
|
|
1259
|
+
],
|
|
1260
|
+
alignment: [
|
|
1261
|
+
{
|
|
1262
|
+
type: ["Alignment"],
|
|
1263
|
+
targetCode: "ARIDF-4.2",
|
|
1264
|
+
targetName: "Evaluate algorithmic bias and disparate impact",
|
|
1265
|
+
targetDescription: "Evaluate automated systems for bias, disparate impact, and limitations in representative data.",
|
|
1266
|
+
targetFramework: "Aster Ridge Data Responsibility Framework",
|
|
1267
|
+
targetType: "CFItem",
|
|
1268
|
+
targetUrl: "https://aster-ridge.example/frameworks/data-responsibility/items/4.2"
|
|
1269
|
+
},
|
|
1270
|
+
{
|
|
1271
|
+
type: ["Alignment"],
|
|
1272
|
+
targetCode: "ARIDF-6.1",
|
|
1273
|
+
targetName: "Design accountable data governance practices",
|
|
1274
|
+
targetDescription: "Design governance practices that document data provenance, consent, oversight, and recourse.",
|
|
1275
|
+
targetFramework: "Aster Ridge Data Responsibility Framework",
|
|
1276
|
+
targetType: "CFItem",
|
|
1277
|
+
targetUrl: "https://aster-ridge.example/frameworks/data-responsibility/items/6.1"
|
|
1278
|
+
}
|
|
1279
|
+
],
|
|
1280
|
+
resultDescription: [
|
|
1281
|
+
{
|
|
1282
|
+
id: "urn:uuid:7f1a9b36-91d2-4bd5-a7af-3d8d8e418103",
|
|
1283
|
+
type: ["ResultDescription"],
|
|
1284
|
+
name: "Final Letter Grade",
|
|
1285
|
+
resultType: "LetterGrade",
|
|
1286
|
+
allowedValue: ["A", "A-", "B+", "B", "B-", "C+", "C", "D", "F"],
|
|
1287
|
+
requiredValue: "C"
|
|
1288
|
+
},
|
|
1289
|
+
{
|
|
1290
|
+
id: "urn:uuid:7f1a9b36-91d2-4bd5-a7af-3d8d8e418104",
|
|
1291
|
+
type: ["ResultDescription"],
|
|
1292
|
+
name: "Final Percentage",
|
|
1293
|
+
resultType: "Percent",
|
|
1294
|
+
valueMin: "0",
|
|
1295
|
+
valueMax: "100",
|
|
1296
|
+
requiredValue: "70"
|
|
1297
|
+
},
|
|
1298
|
+
{
|
|
1299
|
+
id: "urn:uuid:7f1a9b36-91d2-4bd5-a7af-3d8d8e418105",
|
|
1300
|
+
type: ["ResultDescription"],
|
|
1301
|
+
name: "Course Completion Status",
|
|
1302
|
+
resultType: "Status",
|
|
1303
|
+
allowedValue: [
|
|
1304
|
+
"Completed",
|
|
1305
|
+
"Enrolled",
|
|
1306
|
+
"Failed",
|
|
1307
|
+
"InProgress",
|
|
1308
|
+
"OnHold",
|
|
1309
|
+
"Withdrew"
|
|
1310
|
+
]
|
|
1311
|
+
}
|
|
1312
|
+
],
|
|
1313
|
+
tag: [
|
|
1314
|
+
"data-ethics",
|
|
1315
|
+
"responsible-ai",
|
|
1316
|
+
"algorithmic-accountability",
|
|
1317
|
+
"data-governance"
|
|
1318
|
+
]
|
|
1319
|
+
},
|
|
1320
|
+
result: [
|
|
1321
|
+
{
|
|
1322
|
+
type: ["Result"],
|
|
1323
|
+
resultDescription: "urn:uuid:7f1a9b36-91d2-4bd5-a7af-3d8d8e418103",
|
|
1324
|
+
value: "A-"
|
|
1325
|
+
},
|
|
1326
|
+
{
|
|
1327
|
+
type: ["Result"],
|
|
1328
|
+
resultDescription: "urn:uuid:7f1a9b36-91d2-4bd5-a7af-3d8d8e418104",
|
|
1329
|
+
value: "92"
|
|
1330
|
+
},
|
|
1331
|
+
{
|
|
1332
|
+
type: ["Result"],
|
|
1333
|
+
resultDescription: "urn:uuid:7f1a9b36-91d2-4bd5-a7af-3d8d8e418105",
|
|
1334
|
+
status: "Completed"
|
|
1335
|
+
}
|
|
1336
|
+
]
|
|
1337
|
+
},
|
|
1338
|
+
evidence: [
|
|
1339
|
+
{
|
|
1340
|
+
id: "https://aster-ridge.example/records/ari-1087/DAI-318",
|
|
1341
|
+
type: ["Evidence"],
|
|
1342
|
+
name: "Official Course Completion Record",
|
|
1343
|
+
description: "Registrar record confirming the learner earned four credits with a final grade of A-.",
|
|
1344
|
+
narrative: "Course requirements were completed during the Spring 2026 academic term."
|
|
1345
|
+
},
|
|
1346
|
+
{
|
|
1347
|
+
id: "https://aster-ridge.example/showcase/ari-1087/impact-assessment",
|
|
1348
|
+
type: ["Evidence"],
|
|
1349
|
+
name: "Algorithmic Impact Assessment",
|
|
1350
|
+
description: "Final project evaluating fairness, transparency, and governance controls for a fictional automated decision system."
|
|
1351
|
+
}
|
|
1352
|
+
]
|
|
1353
|
+
}
|
|
1354
|
+
};
|
|
1355
|
+
|
|
1164
1356
|
// src/fixtures/obv3/k12-diploma.ts
|
|
1165
1357
|
var obv3K12Diploma = {
|
|
1166
1358
|
id: "obv3/k12-diploma",
|
|
@@ -1262,7 +1454,8 @@ var obv3EndorsementCredential = {
|
|
|
1262
1454
|
credential: {
|
|
1263
1455
|
"@context": [
|
|
1264
1456
|
"https://www.w3.org/ns/credentials/v2",
|
|
1265
|
-
"https://purl.imsglobal.org/spec/ob/v3p0/context-3.0.3.json"
|
|
1457
|
+
"https://purl.imsglobal.org/spec/ob/v3p0/context-3.0.3.json",
|
|
1458
|
+
"https://purl.imsglobal.org/spec/ob/v3p0/extensions.json"
|
|
1266
1459
|
],
|
|
1267
1460
|
id: "urn:uuid:a1b2c3d4-5e6f-7a8b-9c0d-1e2f3a4b5c6d",
|
|
1268
1461
|
type: ["VerifiableCredential", "EndorsementCredential"],
|
|
@@ -1797,7 +1990,7 @@ var clrUniversityTranscript = {
|
|
|
1797
1990
|
};
|
|
1798
1991
|
|
|
1799
1992
|
// src/fixtures/boost/basic.ts
|
|
1800
|
-
import { UnsignedAchievementCredentialValidator as
|
|
1993
|
+
import { UnsignedAchievementCredentialValidator as UnsignedAchievementCredentialValidator7 } from "@learncard/types";
|
|
1801
1994
|
var boostBasic = {
|
|
1802
1995
|
id: "boost/basic",
|
|
1803
1996
|
name: "Basic LearnCard Boost",
|
|
@@ -1808,7 +2001,7 @@ var boostBasic = {
|
|
|
1808
2001
|
source: "synthetic",
|
|
1809
2002
|
signed: false,
|
|
1810
2003
|
validity: "valid",
|
|
1811
|
-
validator:
|
|
2004
|
+
validator: UnsignedAchievementCredentialValidator7,
|
|
1812
2005
|
tags: ["learncard", "boost"],
|
|
1813
2006
|
credential: {
|
|
1814
2007
|
"@context": [
|
|
@@ -1844,7 +2037,7 @@ var boostBasic = {
|
|
|
1844
2037
|
};
|
|
1845
2038
|
|
|
1846
2039
|
// src/fixtures/boost/boost-id.ts
|
|
1847
|
-
import { UnsignedAchievementCredentialValidator as
|
|
2040
|
+
import { UnsignedAchievementCredentialValidator as UnsignedAchievementCredentialValidator8 } from "@learncard/types";
|
|
1848
2041
|
var boostId = {
|
|
1849
2042
|
id: "boost/boost-id",
|
|
1850
2043
|
name: "LearnCard Boost ID",
|
|
@@ -1855,7 +2048,7 @@ var boostId = {
|
|
|
1855
2048
|
source: "synthetic",
|
|
1856
2049
|
signed: false,
|
|
1857
2050
|
validity: "valid",
|
|
1858
|
-
validator:
|
|
2051
|
+
validator: UnsignedAchievementCredentialValidator8,
|
|
1859
2052
|
tags: ["learncard", "boost", "id"],
|
|
1860
2053
|
credential: {
|
|
1861
2054
|
"@context": [
|
|
@@ -1900,7 +2093,7 @@ var boostId = {
|
|
|
1900
2093
|
};
|
|
1901
2094
|
|
|
1902
2095
|
// src/fixtures/boost/with-skills.ts
|
|
1903
|
-
import { UnsignedAchievementCredentialValidator as
|
|
2096
|
+
import { UnsignedAchievementCredentialValidator as UnsignedAchievementCredentialValidator9 } from "@learncard/types";
|
|
1904
2097
|
var boostWithSkills = {
|
|
1905
2098
|
id: "boost/with-skills",
|
|
1906
2099
|
name: "LearnCard Boost with Skills",
|
|
@@ -1911,7 +2104,7 @@ var boostWithSkills = {
|
|
|
1911
2104
|
source: "synthetic",
|
|
1912
2105
|
signed: false,
|
|
1913
2106
|
validity: "valid",
|
|
1914
|
-
validator:
|
|
2107
|
+
validator: UnsignedAchievementCredentialValidator9,
|
|
1915
2108
|
tags: ["learncard", "boost", "skills"],
|
|
1916
2109
|
credential: {
|
|
1917
2110
|
"@context": [
|
|
@@ -1990,7 +2183,8 @@ var boostCommunityAward = {
|
|
|
1990
2183
|
credential: {
|
|
1991
2184
|
"@context": [
|
|
1992
2185
|
"https://www.w3.org/ns/credentials/v2",
|
|
1993
|
-
"https://purl.imsglobal.org/spec/ob/v3p0/context-3.0.3.json"
|
|
2186
|
+
"https://purl.imsglobal.org/spec/ob/v3p0/context-3.0.3.json",
|
|
2187
|
+
"https://ctx.learncard.com/boosts/1.0.3.json"
|
|
1994
2188
|
],
|
|
1995
2189
|
id: "urn:uuid:d8c4f2a1-3b67-4e89-a1d0-5f9e7c2b8a43",
|
|
1996
2190
|
type: ["VerifiableCredential", "OpenBadgeCredential", "BoostCredential"],
|
|
@@ -2079,7 +2273,8 @@ var boostDelegate = {
|
|
|
2079
2273
|
credential: {
|
|
2080
2274
|
"@context": [
|
|
2081
2275
|
"https://www.w3.org/ns/credentials/v2",
|
|
2082
|
-
"https://purl.imsglobal.org/spec/ob/v3p0/context-3.0.3.json"
|
|
2276
|
+
"https://purl.imsglobal.org/spec/ob/v3p0/context-3.0.3.json",
|
|
2277
|
+
"https://ctx.learncard.com/boosts/1.0.3.json"
|
|
2083
2278
|
],
|
|
2084
2279
|
id: "urn:uuid:e7b3d1f4-9a26-4c58-b0d3-8f1e2c7a9b56",
|
|
2085
2280
|
type: ["VerifiableCredential", "OpenBadgeCredential", "BoostCredential"],
|
|
@@ -10841,7 +11036,9 @@ var clrWestbridgeFull = {
|
|
|
10841
11036
|
"@context": [
|
|
10842
11037
|
"https://www.w3.org/ns/credentials/v2",
|
|
10843
11038
|
"https://purl.imsglobal.org/spec/ob/v3p0/context-3.0.3.json",
|
|
10844
|
-
"https://purl.imsglobal.org/spec/clr/v2p0/context
|
|
11039
|
+
"https://purl.imsglobal.org/spec/clr/v2p0/context.json",
|
|
11040
|
+
"https://purl.imsglobal.org/spec/ob/v3p0/extensions.json",
|
|
11041
|
+
{ IssuerPolicy: "https://westbridge.edu/credentials#IssuerPolicy" }
|
|
10845
11042
|
],
|
|
10846
11043
|
id: "urn:uuid:wb-clr-2025-jordan-reyes-001",
|
|
10847
11044
|
type: ["VerifiableCredential", "ClrCredential"],
|
|
@@ -10912,6 +11109,13 @@ var clrWestbridgeFull = {
|
|
|
10912
11109
|
}
|
|
10913
11110
|
],
|
|
10914
11111
|
credentialSubject: {
|
|
11112
|
+
// CLR v2's ClrSubject scoped context omits the Open Badges identifier term.
|
|
11113
|
+
"@context": {
|
|
11114
|
+
identifier: {
|
|
11115
|
+
"@id": "https://purl.imsglobal.org/spec/vc/ob/vocab.html#identifier",
|
|
11116
|
+
"@container": "@set"
|
|
11117
|
+
}
|
|
11118
|
+
},
|
|
10915
11119
|
id: "did:example:wb-student-2025-001",
|
|
10916
11120
|
type: ["ClrSubject"],
|
|
10917
11121
|
identifier: [
|
|
@@ -14053,6 +14257,7 @@ var ALL_FIXTURES = [
|
|
|
14053
14257
|
obv3ProfessionalCert,
|
|
14054
14258
|
obv3MicroCredential,
|
|
14055
14259
|
obv3CourseCompletion,
|
|
14260
|
+
obv3StandaloneFullCourse,
|
|
14056
14261
|
obv3K12Diploma,
|
|
14057
14262
|
obv3EndorsementCredential,
|
|
14058
14263
|
// CLR v2
|
|
@@ -14340,6 +14545,7 @@ export {
|
|
|
14340
14545
|
obv3OneedtechFull,
|
|
14341
14546
|
obv3PlugfestJff2,
|
|
14342
14547
|
obv3ProfessionalCert,
|
|
14548
|
+
obv3StandaloneFullCourse,
|
|
14343
14549
|
obv3WithAlignment,
|
|
14344
14550
|
obv3WithEndorsement,
|
|
14345
14551
|
prepareFixture,
|