@learncard/credential-library 2.0.4 → 2.1.0

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.
Files changed (112) hide show
  1. package/README.md +30 -1
  2. package/SOURCES.md +63 -0
  3. package/dist/bundles/index.d.ts +5 -0
  4. package/dist/bundles/index.d.ts.map +1 -0
  5. package/dist/bundles/student.d.ts +3 -0
  6. package/dist/bundles/student.d.ts.map +1 -0
  7. package/dist/bundles/types.d.ts +24 -0
  8. package/dist/bundles/types.d.ts.map +1 -0
  9. package/dist/credential-library.cjs.development.js +12244 -713
  10. package/dist/credential-library.cjs.development.js.map +4 -4
  11. package/dist/credential-library.cjs.production.min.js +11 -1
  12. package/dist/credential-library.cjs.production.min.js.map +4 -4
  13. package/dist/credential-library.esm.js +12242 -709
  14. package/dist/credential-library.esm.js.map +4 -4
  15. package/dist/fixtures/clr/achievement-id-associations.d.ts +3 -0
  16. package/dist/fixtures/clr/achievement-id-associations.d.ts.map +1 -0
  17. package/dist/fixtures/clr/employment-record.d.ts +8 -0
  18. package/dist/fixtures/clr/employment-record.d.ts.map +1 -0
  19. package/dist/fixtures/clr/licensing-regulatory-record.d.ts +8 -0
  20. package/dist/fixtures/clr/licensing-regulatory-record.d.ts.map +1 -0
  21. package/dist/fixtures/clr/military-training-record.d.ts +8 -0
  22. package/dist/fixtures/clr/military-training-record.d.ts.map +1 -0
  23. package/dist/fixtures/clr/mixed-career-record.d.ts +8 -0
  24. package/dist/fixtures/clr/mixed-career-record.d.ts.map +1 -0
  25. package/dist/fixtures/clr/mixed-role-portfolio.d.ts +3 -0
  26. package/dist/fixtures/clr/mixed-role-portfolio.d.ts.map +1 -0
  27. package/dist/fixtures/clr/professional-organization-record.d.ts +8 -0
  28. package/dist/fixtures/clr/professional-organization-record.d.ts.map +1 -0
  29. package/dist/fixtures/clr/student-official-academic-transcript.d.ts +3 -0
  30. package/dist/fixtures/clr/student-official-academic-transcript.d.ts.map +1 -0
  31. package/dist/fixtures/clr/training-provider-record.d.ts +8 -0
  32. package/dist/fixtures/clr/training-provider-record.d.ts.map +1 -0
  33. package/dist/fixtures/custom/course-enrollment.d.ts +3 -0
  34. package/dist/fixtures/custom/course-enrollment.d.ts.map +1 -0
  35. package/dist/fixtures/custom/exam-accommodation.d.ts +3 -0
  36. package/dist/fixtures/custom/exam-accommodation.d.ts.map +1 -0
  37. package/dist/fixtures/index.d.ts +25 -1
  38. package/dist/fixtures/index.d.ts.map +1 -1
  39. package/dist/fixtures/obv3/food-allergen-facilitator.d.ts +3 -0
  40. package/dist/fixtures/obv3/food-allergen-facilitator.d.ts.map +1 -0
  41. package/dist/fixtures/obv3/food-allergen-practice-fr.d.ts +3 -0
  42. package/dist/fixtures/obv3/food-allergen-practice-fr.d.ts.map +1 -0
  43. package/dist/fixtures/obv3/food-allergen-practice.d.ts +3 -0
  44. package/dist/fixtures/obv3/food-allergen-practice.d.ts.map +1 -0
  45. package/dist/fixtures/obv3/phishing-transfer.d.ts +3 -0
  46. package/dist/fixtures/obv3/phishing-transfer.d.ts.map +1 -0
  47. package/dist/fixtures/obv3/qualification-apprenticeship.d.ts +3 -0
  48. package/dist/fixtures/obv3/qualification-apprenticeship.d.ts.map +1 -0
  49. package/dist/fixtures/obv3/qualification-badge-override.d.ts +3 -0
  50. package/dist/fixtures/obv3/qualification-badge-override.d.ts.map +1 -0
  51. package/dist/fixtures/obv3/qualification-certification.d.ts +3 -0
  52. package/dist/fixtures/obv3/qualification-certification.d.ts.map +1 -0
  53. package/dist/fixtures/obv3/qualification-expired.d.ts +3 -0
  54. package/dist/fixtures/obv3/qualification-expired.d.ts.map +1 -0
  55. package/dist/fixtures/obv3/qualification-journeyman.d.ts +3 -0
  56. package/dist/fixtures/obv3/qualification-journeyman.d.ts.map +1 -0
  57. package/dist/fixtures/obv3/qualification-license.d.ts +3 -0
  58. package/dist/fixtures/obv3/qualification-license.d.ts.map +1 -0
  59. package/dist/fixtures/obv3/qualification-master.d.ts +3 -0
  60. package/dist/fixtures/obv3/qualification-master.d.ts.map +1 -0
  61. package/dist/fixtures/obv3/student-additional-credentials.d.ts +3 -0
  62. package/dist/fixtures/obv3/student-additional-credentials.d.ts.map +1 -0
  63. package/dist/fixtures/obv3/student-sample-badges.d.ts +586 -0
  64. package/dist/fixtures/obv3/student-sample-badges.d.ts.map +1 -0
  65. package/dist/index.d.ts +1 -0
  66. package/dist/index.d.ts.map +1 -1
  67. package/dist/prepare.d.ts.map +1 -1
  68. package/package.json +8 -7
  69. package/src/__tests__/bundles.test.ts +234 -0
  70. package/src/__tests__/clr-non-academic.test.ts +220 -0
  71. package/src/__tests__/curated-examples.test.ts +248 -0
  72. package/src/__tests__/issuance.test.ts +35 -0
  73. package/src/__tests__/registry.test.ts +31 -0
  74. package/src/bundles/index.ts +19 -0
  75. package/src/bundles/student.ts +251 -0
  76. package/src/bundles/types.ts +25 -0
  77. package/src/fixtures/clr/README.md +142 -0
  78. package/src/fixtures/clr/achievement-id-associations.ts +342 -0
  79. package/src/fixtures/clr/employment-record.ts +487 -0
  80. package/src/fixtures/clr/licensing-regulatory-record.ts +388 -0
  81. package/src/fixtures/clr/military-training-record.ts +468 -0
  82. package/src/fixtures/clr/mixed-career-record.ts +814 -0
  83. package/src/fixtures/clr/mixed-role-portfolio.ts +490 -0
  84. package/src/fixtures/clr/professional-organization-record.ts +403 -0
  85. package/src/fixtures/clr/student-official-academic-transcript.ts +3202 -0
  86. package/src/fixtures/clr/training-provider-record.ts +510 -0
  87. package/src/fixtures/custom/course-enrollment.ts +56 -0
  88. package/src/fixtures/custom/exam-accommodation.ts +56 -0
  89. package/src/fixtures/index.ts +87 -0
  90. package/src/fixtures/obv3/food-allergen-facilitator.ts +108 -0
  91. package/src/fixtures/obv3/food-allergen-practice-fr.ts +107 -0
  92. package/src/fixtures/obv3/food-allergen-practice.ts +105 -0
  93. package/src/fixtures/obv3/phishing-transfer.ts +163 -0
  94. package/src/fixtures/obv3/qualification-apprenticeship.ts +58 -0
  95. package/src/fixtures/obv3/qualification-badge-override.ts +64 -0
  96. package/src/fixtures/obv3/qualification-certification.ts +59 -0
  97. package/src/fixtures/obv3/qualification-expired.ts +59 -0
  98. package/src/fixtures/obv3/qualification-journeyman.ts +58 -0
  99. package/src/fixtures/obv3/qualification-license.ts +58 -0
  100. package/src/fixtures/obv3/qualification-master.ts +58 -0
  101. package/src/fixtures/obv3/student-additional-credentials.ts +3912 -0
  102. package/src/fixtures/obv3/student-sample-badges.ts +424 -0
  103. package/src/index.ts +2 -0
  104. package/src/prepare.ts +55 -11
  105. package/dist/__tests__/docs-json.test.d.ts +0 -2
  106. package/dist/__tests__/docs-json.test.d.ts.map +0 -1
  107. package/dist/__tests__/issuance.test.d.ts +0 -2
  108. package/dist/__tests__/issuance.test.d.ts.map +0 -1
  109. package/dist/__tests__/registry.test.d.ts +0 -2
  110. package/dist/__tests__/registry.test.d.ts.map +0 -1
  111. package/dist/__tests__/sd-jwt-vc.test.d.ts +0 -2
  112. package/dist/__tests__/sd-jwt-vc.test.d.ts.map +0 -1
package/README.md CHANGED
@@ -209,6 +209,18 @@ their `kind`, reserved ID/spec pairing, and materialization template remain expl
209
209
 
210
210
  See the [Credential Viewer README](../../examples/credential-viewer/README.md) for details.
211
211
 
212
+ ### Practice and administrative examples
213
+
214
+ Seven curated examples exercise RubricScore (`obv3/food-allergen-practice`),
215
+ matched instructor scope (`obv3/food-allergen-facilitator`), French text
216
+ (`obv3/food-allergen-practice-fr`), combined level-only and raw-score results
217
+ (`obv3/phishing-transfer`), enrollment and accommodation claims without an
218
+ achievement (`custom/course-enrollment`, `custom/exam-accommodation`), and mixed
219
+ roles with canonical scalar CLR associations (`clr/mixed-role-portfolio`).
220
+ They use the usual metadata and tag filters; all are unsigned templates. See
221
+ [source provenance and attribution](./SOURCES.md) for the adapted corpus and
222
+ alignment licenses.
223
+
212
224
  ## Fixture Metadata
213
225
 
214
226
  `kind` identifies the fixture's runtime shape: W3C VC fixtures use
@@ -251,7 +263,7 @@ See the [Credential Viewer README](../../examples/credential-viewer/README.md) f
251
263
  - `vc-v2/membership-credential` — Professional association membership
252
264
  - `vc-v2/license-credential` — Professional nursing license
253
265
 
254
- ### Open Badges v3 (12)
266
+ ### Open Badges v3
255
267
 
256
268
  - `obv3/minimal-badge` — Minimal OBv3 achievement credential
257
269
  - `obv3/full-badge` — Full-featured badge with image, evidence, alignment, results, expiration
@@ -266,6 +278,23 @@ See the [Credential Viewer README](../../examples/credential-viewer/README.md) f
266
278
  - `obv3/endorsement-credential` — Program accreditation endorsement
267
279
  - `obv3/rubric-aligned-badge` — Open Skills Alignment result with rubric levels and CTDL alignment
268
280
 
281
+ #### Qualifications (LC-2111)
282
+
283
+ All seven are synthetic OBv3 credentials, searchable with the `lc-2111` tag in the [credential viewer](../../examples/credential-viewer/README.md#testing-qualifications-lc-2111):
284
+
285
+ - `obv3/qualification-license` — Professional electrical license
286
+ - `obv3/qualification-certification` — Project management certification
287
+ - `obv3/qualification-apprenticeship` — Electrical apprenticeship certificate
288
+ - `obv3/qualification-journeyman` — Journeyman electrician certificate
289
+ - `obv3/qualification-master` — Master electrician certificate
290
+ - `obv3/qualification-expired` — Safety certification expired on January 1, 2024
291
+ - `obv3/qualification-badge-override` — Certification with explicit `display.displayType: 'badge'`
292
+
293
+ The expired credential is structurally valid and remains in **Select All Valid**. Enable **Keep fixture dates (including expired credentials)** in the viewer when issuing or sending it; default preparation refreshes historical expiration dates.
294
+
295
+ Each fixture includes themed artwork in both `credential.image` and `credentialSubject.achievement.image`. The unmodified illustrations are by [OpenMoji](https://openmoji.org/), licensed under [CC BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0/); image captions retain the attribution. These are remotely hosted SVGs and require network access to load. Reissue or resend fixtures to see new artwork—previously issued credentials are not modified.
296
+
297
+
269
298
  ### CLR v2 (4)
270
299
 
271
300
  - `clr/minimal` — Minimal Comprehensive Learner Record
package/SOURCES.md ADDED
@@ -0,0 +1,63 @@
1
+ # Curated example sources
2
+
3
+ The following seven unsigned examples are adapted from the FrenchFry Unsigned VC
4
+ Library v1 (ZIP version 2, SHA-256
5
+ `7b8fc95babb339f029d07fb132e93efd5f67a7296afc0a725ccfb6f6856cd748`).
6
+ The corpus was generated by its `scripts/generate.py`; these examples are authored
7
+ scenarios, not records of real assessments. Their metadata uses the existing
8
+ `source: 'synthetic'`, `signed: false` convention. `validity: 'valid'` describes
9
+ structural validity of an unsigned template, not verified issuance or authenticity.
10
+
11
+ | Fixture | Original credential UUID | Coverage |
12
+ | -------------------------------- | -------------------------------------- | ----------------------------------------------------------- |
13
+ | `obv3/food-allergen-practice` | `7cc497f9-092a-5ea2-8cdb-7a2e60c25e68` | RubricScore with observed practice |
14
+ | `obv3/food-allergen-facilitator` | `04adda59-747f-5d5b-b287-1a9b1943b2ba` | Teaching scope on the same topic |
15
+ | `obv3/food-allergen-practice-fr` | `14adf3a3-43d2-5271-90be-9812f906deef` | French text with the same scoring structure and alignment |
16
+ | `obv3/phishing-transfer` | `670ef7c6-b8de-532c-9667-9817a0c942e8` | Achieved-level-only and raw-score results together |
17
+ | `custom/course-enrollment` | `6ea43ad2-3fb5-55dd-aee8-6380b7ec0725` | Enrollment without completion or assessed attainment |
18
+ | `custom/exam-accommodation` | `0e341ee2-6006-51b9-a559-62d7ac21a4e1` | Accommodation without diagnosis or assessed attainment |
19
+ | `clr/mixed-role-portfolio` | `47213155-4246-5f73-bcf4-54776e488e21` | Three mixed-role children and canonical scalar associations |
20
+
21
+ Presentation text is shortened and issuer names follow the package's example
22
+ conventions. Administrative examples use distinct custom types with inline
23
+ JSON-LD mappings. The CLR uses the cached `context.json` URL, following the other
24
+ CLR fixtures. Credential UUIDs and reserved example-domain identifiers remain
25
+ deterministic; `prepareFixture` makes fresh UUIDs when requested. The CLR's
26
+ achievement list mirrors child definitions and does not add awards. No corpus
27
+ evaluation labels, other payloads, generator, or shared generation templates are
28
+ imported. The French example is a counterpart, not a second independent scoring
29
+ case.
30
+
31
+ Issuer profiles reuse existing fictional examples: Cedar Technical Training
32
+ (`clr/training-provider-record`), Tech Academy (`obv3/full-badge`), Community College
33
+ XYZ (`clr/multi-achievement`), Metropolis University – Office of the Registrar
34
+ (`vc-v2/education-degree`), and State University (`obv3/micro-credential`). The five
35
+ issuer groups remain distinct; the CLR and its three children share the Community
36
+ College XYZ profile. Administrative contexts define the profile and URL terms
37
+ without adding achievement claims. These display profiles do not assert issuer
38
+ trust or verification, and the original corpus release is unchanged.
39
+
40
+ ## Licenses and attribution
41
+
42
+ Authored corpus scenario text and fixture bodies are dedicated under
43
+ [CC0 1.0](https://creativecommons.org/publicdomain/zero/1.0/), excluding third-party
44
+ material. TypeScript wrappers and package code follow the repository's MIT license.
45
+
46
+ Alignment labels and descriptions retain their source identifiers:
47
+
48
+ - **O\*NET:** Instructing and Critical Thinking, from the O*NET 31.0 Database,
49
+ U.S. Department of Labor, Employment and Training Administration (USDOL/ETA).
50
+ Used under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/).
51
+ [Source and prescribed credit](https://www.onetcenter.org/license_db.html).
52
+ O*NET® is a trademark of USDOL/ETA. The scenario mappings and JSON representation
53
+ are adaptations; USDOL/ETA has not approved, endorsed, or tested them.
54
+ - **ESCO:** Food safety principles and statistics, developed by the
55
+ European Commission's Directorate-General for Employment, Social Affairs and
56
+ Inclusion; dataset v1.2.0 was requested by the source corpus. Labels and
57
+ descriptions are used under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/).
58
+ [Attribution and third-party notices](https://esco.ec.europa.eu/uk/node/456).
59
+ Scenario mappings and JSON representation are adaptations and do not imply
60
+ European Commission endorsement.
61
+
62
+ W3C and 1EdTech contexts are referenced by URL, not copied or relicensed here.
63
+ No CASE framework content is included in these seven examples.
@@ -0,0 +1,5 @@
1
+ import type { CredentialBundle } from './types';
2
+ export declare const getBundle: (id: string) => CredentialBundle;
3
+ export { studentBundle } from './student';
4
+ export type { CredentialBundle, CredentialBundleEntry, CredentialBundleIssuer } from './types';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/bundles/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAOhD,eAAO,MAAM,SAAS,GAAI,IAAI,MAAM,KAAG,gBAQtC,CAAC;AAEF,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,YAAY,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { CredentialBundle } from './types';
2
+ export declare const studentBundle: CredentialBundle;
3
+ //# sourceMappingURL=student.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"student.d.ts","sourceRoot":"","sources":["../../src/bundles/student.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAA0B,MAAM,SAAS,CAAC;AA+ExE,eAAO,MAAM,aAAa,EAAE,gBA2K3B,CAAC"}
@@ -0,0 +1,24 @@
1
+ export interface CredentialBundleIssuer {
2
+ /** Namespaced profile ID created and owned by the sample seeder. */
3
+ profileId: `sample-${string}`;
4
+ /** Issuer name shown on the rendered credential. */
5
+ displayName: string;
6
+ /** Optional issuer avatar copied to the safe sample profile. */
7
+ image?: string;
8
+ }
9
+ export interface CredentialBundleEntry {
10
+ fixtureId: string;
11
+ /** Shift the fixture's issue date relative to the seed run. */
12
+ validFromOffsetDays: number;
13
+ /** Safe sample issuer used when publishing this credential. */
14
+ issuer: CredentialBundleIssuer;
15
+ /** Override the credential's display name after fixture preparation. */
16
+ name?: string;
17
+ }
18
+ export interface CredentialBundle {
19
+ id: string;
20
+ displayName: string;
21
+ blurb: string;
22
+ entries: readonly CredentialBundleEntry[];
23
+ }
24
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/bundles/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,sBAAsB;IACnC,oEAAoE;IACpE,SAAS,EAAE,UAAU,MAAM,EAAE,CAAC;IAC9B,oDAAoD;IACpD,WAAW,EAAE,MAAM,CAAC;IACpB,gEAAgE;IAChE,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,qBAAqB;IAClC,SAAS,EAAE,MAAM,CAAC;IAClB,+DAA+D;IAC/D,mBAAmB,EAAE,MAAM,CAAC;IAC5B,+DAA+D;IAC/D,MAAM,EAAE,sBAAsB,CAAC;IAC/B,wEAAwE;IACxE,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,gBAAgB;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,SAAS,qBAAqB,EAAE,CAAC;CAC7C"}