@learncard/credential-library 2.0.5 → 2.1.1

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 (59) hide show
  1. package/README.md +30 -1
  2. package/SOURCES.md +63 -0
  3. package/dist/credential-library.cjs.development.js +1577 -32
  4. package/dist/credential-library.cjs.development.js.map +4 -4
  5. package/dist/credential-library.cjs.production.min.js +3 -3
  6. package/dist/credential-library.cjs.production.min.js.map +4 -4
  7. package/dist/credential-library.esm.js +1563 -18
  8. package/dist/credential-library.esm.js.map +4 -4
  9. package/dist/fixtures/clr/military-comprehensive-record.d.ts +4 -0
  10. package/dist/fixtures/clr/military-comprehensive-record.d.ts.map +1 -0
  11. package/dist/fixtures/clr/mixed-role-portfolio.d.ts +3 -0
  12. package/dist/fixtures/clr/mixed-role-portfolio.d.ts.map +1 -0
  13. package/dist/fixtures/custom/course-enrollment.d.ts +3 -0
  14. package/dist/fixtures/custom/course-enrollment.d.ts.map +1 -0
  15. package/dist/fixtures/custom/exam-accommodation.d.ts +3 -0
  16. package/dist/fixtures/custom/exam-accommodation.d.ts.map +1 -0
  17. package/dist/fixtures/index.d.ts +16 -1
  18. package/dist/fixtures/index.d.ts.map +1 -1
  19. package/dist/fixtures/obv3/food-allergen-facilitator.d.ts +3 -0
  20. package/dist/fixtures/obv3/food-allergen-facilitator.d.ts.map +1 -0
  21. package/dist/fixtures/obv3/food-allergen-practice-fr.d.ts +3 -0
  22. package/dist/fixtures/obv3/food-allergen-practice-fr.d.ts.map +1 -0
  23. package/dist/fixtures/obv3/food-allergen-practice.d.ts +3 -0
  24. package/dist/fixtures/obv3/food-allergen-practice.d.ts.map +1 -0
  25. package/dist/fixtures/obv3/phishing-transfer.d.ts +3 -0
  26. package/dist/fixtures/obv3/phishing-transfer.d.ts.map +1 -0
  27. package/dist/fixtures/obv3/qualification-apprenticeship.d.ts +3 -0
  28. package/dist/fixtures/obv3/qualification-apprenticeship.d.ts.map +1 -0
  29. package/dist/fixtures/obv3/qualification-badge-override.d.ts +3 -0
  30. package/dist/fixtures/obv3/qualification-badge-override.d.ts.map +1 -0
  31. package/dist/fixtures/obv3/qualification-certification.d.ts +3 -0
  32. package/dist/fixtures/obv3/qualification-certification.d.ts.map +1 -0
  33. package/dist/fixtures/obv3/qualification-expired.d.ts +3 -0
  34. package/dist/fixtures/obv3/qualification-expired.d.ts.map +1 -0
  35. package/dist/fixtures/obv3/qualification-journeyman.d.ts +3 -0
  36. package/dist/fixtures/obv3/qualification-journeyman.d.ts.map +1 -0
  37. package/dist/fixtures/obv3/qualification-license.d.ts +3 -0
  38. package/dist/fixtures/obv3/qualification-license.d.ts.map +1 -0
  39. package/dist/fixtures/obv3/qualification-master.d.ts +3 -0
  40. package/dist/fixtures/obv3/qualification-master.d.ts.map +1 -0
  41. package/package.json +7 -6
  42. package/src/__tests__/curated-examples.test.ts +248 -0
  43. package/src/__tests__/issuance.test.ts +35 -0
  44. package/src/fixtures/clr/military-comprehensive-record.ts +155 -0
  45. package/src/fixtures/clr/mixed-role-portfolio.ts +490 -0
  46. package/src/fixtures/custom/course-enrollment.ts +56 -0
  47. package/src/fixtures/custom/exam-accommodation.ts +56 -0
  48. package/src/fixtures/index.ts +49 -0
  49. package/src/fixtures/obv3/food-allergen-facilitator.ts +108 -0
  50. package/src/fixtures/obv3/food-allergen-practice-fr.ts +107 -0
  51. package/src/fixtures/obv3/food-allergen-practice.ts +105 -0
  52. package/src/fixtures/obv3/phishing-transfer.ts +163 -0
  53. package/src/fixtures/obv3/qualification-apprenticeship.ts +58 -0
  54. package/src/fixtures/obv3/qualification-badge-override.ts +64 -0
  55. package/src/fixtures/obv3/qualification-certification.ts +59 -0
  56. package/src/fixtures/obv3/qualification-expired.ts +59 -0
  57. package/src/fixtures/obv3/qualification-journeyman.ts +58 -0
  58. package/src/fixtures/obv3/qualification-license.ts +58 -0
  59. package/src/fixtures/obv3/qualification-master.ts +58 -0
@@ -0,0 +1,4 @@
1
+ import type { CredentialFixture } from '../../types';
2
+ /** Synthetic unsigned renderer fixture. No real service, rank, or equivalence claims. */
3
+ export declare const clrMilitaryComprehensiveRecord: CredentialFixture;
4
+ //# sourceMappingURL=military-comprehensive-record.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"military-comprehensive-record.d.ts","sourceRoot":"","sources":["../../../src/fixtures/clr/military-comprehensive-record.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAoBrD,yFAAyF;AACzF,eAAO,MAAM,8BAA8B,EAAE,iBAoI5C,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { CredentialFixture } from '../../types';
2
+ export declare const clrMixedRolePortfolio: CredentialFixture;
3
+ //# sourceMappingURL=mixed-role-portfolio.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mixed-role-portfolio.d.ts","sourceRoot":"","sources":["../../../src/fixtures/clr/mixed-role-portfolio.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAGrD,eAAO,MAAM,qBAAqB,EAAE,iBAoenC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { CredentialFixture } from '../../types';
2
+ export declare const customCourseEnrollment: CredentialFixture;
3
+ //# sourceMappingURL=course-enrollment.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"course-enrollment.d.ts","sourceRoot":"","sources":["../../../src/fixtures/custom/course-enrollment.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAGrD,eAAO,MAAM,sBAAsB,EAAE,iBAkDpC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { CredentialFixture } from '../../types';
2
+ export declare const customExamAccommodation: CredentialFixture;
3
+ //# sourceMappingURL=exam-accommodation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"exam-accommodation.d.ts","sourceRoot":"","sources":["../../../src/fixtures/custom/exam-accommodation.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAGrD,eAAO,MAAM,uBAAuB,EAAE,iBAkDrC,CAAC"}
@@ -20,12 +20,20 @@ import { obv3EndorsementCredential } from './obv3/endorsement';
20
20
  import { obv3StudentAfterschoolProgramMentor, obv3StudentEnvironmentBadge, obv3StudentRockClimbingMentor, obv3StudentParkCleanupHelper } from './obv3/student-sample-badges';
21
21
  import { obv3StudentAdditionalCredentials } from './obv3/student-additional-credentials';
22
22
  import { obv3RubricAlignedBadge } from './obv3/rubric-aligned-badge';
23
+ import { obv3QualificationLicense } from './obv3/qualification-license';
24
+ import { obv3QualificationCertification } from './obv3/qualification-certification';
25
+ import { obv3QualificationApprenticeship } from './obv3/qualification-apprenticeship';
26
+ import { obv3QualificationJourneyman } from './obv3/qualification-journeyman';
27
+ import { obv3QualificationMaster } from './obv3/qualification-master';
28
+ import { obv3QualificationExpired } from './obv3/qualification-expired';
29
+ import { obv3QualificationBadgeOverride } from './obv3/qualification-badge-override';
23
30
  import { clrMinimal } from './clr/minimal';
24
31
  import { clrMultiAchievement } from './clr/multi-achievement';
25
32
  import { clrUniversityTranscript } from './clr/university-transcript';
26
33
  import { clrStudentOfficialAcademicTranscript } from './clr/student-official-academic-transcript';
27
34
  import { clrEmploymentRecord } from './clr/employment-record';
28
35
  import { clrTrainingProviderRecord } from './clr/training-provider-record';
36
+ import { clrMilitaryComprehensiveRecord } from './clr/military-comprehensive-record';
29
37
  import { clrMilitaryTrainingRecord } from './clr/military-training-record';
30
38
  import { clrProfessionalOrganizationRecord } from './clr/professional-organization-record';
31
39
  import { clrLicensingRegulatoryRecord } from './clr/licensing-regulatory-record';
@@ -51,7 +59,14 @@ import { clrCompetencyAligned } from './clr/competency-aligned';
51
59
  import { clrAchievementIdAssociations } from './clr/achievement-id-associations';
52
60
  import { clrProvisionalTranscript, buildFinalTranscriptVariant, REFRESH_SERVICE_INLINE_CONTEXT } from './clr/provisional-transcript';
53
61
  import { clrDemoIsdDiplomaAssessments } from './clr/demo-isd-diploma-assessments';
62
+ import { obv3FoodAllergenPractice } from './obv3/food-allergen-practice';
63
+ import { obv3FoodAllergenFacilitator } from './obv3/food-allergen-facilitator';
64
+ import { obv3FoodAllergenPracticeFr } from './obv3/food-allergen-practice-fr';
65
+ import { obv3PhishingTransfer } from './obv3/phishing-transfer';
66
+ import { customCourseEnrollment } from './custom/course-enrollment';
67
+ import { customExamAccommodation } from './custom/exam-accommodation';
68
+ import { clrMixedRolePortfolio } from './clr/mixed-role-portfolio';
54
69
  import { sdJwtVcCourseCompletion } from './sd-jwt-vc/course-completion';
55
70
  export declare const ALL_FIXTURES: LibraryFixture[];
56
- export { vcV1Basic, vcV1WithStatus, vcV2Basic, vcV2WithEvidence, vcV2MultipleSubjects, vcV2RenderMethodExample, obv3MinimalBadge, obv3FullBadge, obv3WithAlignment, obv3WithEndorsement, obv3PlugfestJff2, clrMinimal, clrMultiAchievement, boostBasic, boostId, boostWithSkills, invalidMissingContext, invalidEmptyType, invalidMissingIssuer, clrNdStudentTranscript, obv3OneedtechFull, obv3ProfessionalCert, obv3MicroCredential, obv3CourseCompletion, obv3StandaloneFullCourse, obv3K12Diploma, obv3EndorsementCredential, obv3StudentAfterschoolProgramMentor, obv3StudentEnvironmentBadge, obv3StudentRockClimbingMentor, obv3StudentParkCleanupHelper, obv3StudentAdditionalCredentials, obv3RubricAlignedBadge, clrUniversityTranscript, clrStudentOfficialAcademicTranscript, clrEmploymentRecord, clrTrainingProviderRecord, clrMilitaryTrainingRecord, clrProfessionalOrganizationRecord, clrLicensingRegulatoryRecord, clrMixedCareerRecord, boostCommunityAward, boostDelegate, vcV1AlumniCredential, vcV2EmploymentCredential, vcV2EducationDegree, vcV2DigitalId, vcV2MembershipCredential, vcV2LicenseCredential, clrGreatPlainsFull, clrWestbridgeFull, clrCompetencyAligned, clrAchievementIdAssociations, clrProvisionalTranscript, buildFinalTranscriptVariant, REFRESH_SERVICE_INLINE_CONTEXT, clrDemoIsdDiplomaAssessments, sdJwtVcCourseCompletion, };
71
+ export { vcV1Basic, vcV1WithStatus, vcV2Basic, vcV2WithEvidence, vcV2MultipleSubjects, vcV2RenderMethodExample, obv3MinimalBadge, obv3FullBadge, obv3WithAlignment, obv3WithEndorsement, obv3PlugfestJff2, clrMinimal, clrMultiAchievement, boostBasic, boostId, boostWithSkills, invalidMissingContext, invalidEmptyType, invalidMissingIssuer, clrNdStudentTranscript, obv3OneedtechFull, obv3ProfessionalCert, obv3QualificationLicense, obv3QualificationCertification, obv3QualificationApprenticeship, obv3QualificationJourneyman, obv3QualificationMaster, obv3QualificationExpired, obv3QualificationBadgeOverride, obv3MicroCredential, obv3CourseCompletion, obv3StandaloneFullCourse, obv3K12Diploma, obv3EndorsementCredential, obv3StudentAfterschoolProgramMentor, obv3StudentEnvironmentBadge, obv3StudentRockClimbingMentor, obv3StudentParkCleanupHelper, obv3StudentAdditionalCredentials, obv3RubricAlignedBadge, clrUniversityTranscript, clrStudentOfficialAcademicTranscript, clrEmploymentRecord, clrTrainingProviderRecord, clrMilitaryTrainingRecord, clrMilitaryComprehensiveRecord, clrProfessionalOrganizationRecord, clrLicensingRegulatoryRecord, clrMixedCareerRecord, boostCommunityAward, boostDelegate, vcV1AlumniCredential, vcV2EmploymentCredential, vcV2EducationDegree, vcV2DigitalId, vcV2MembershipCredential, vcV2LicenseCredential, clrGreatPlainsFull, clrWestbridgeFull, clrCompetencyAligned, clrAchievementIdAssociations, clrProvisionalTranscript, buildFinalTranscriptVariant, REFRESH_SERVICE_INLINE_CONTEXT, clrDemoIsdDiplomaAssessments, obv3FoodAllergenPractice, obv3FoodAllergenFacilitator, obv3FoodAllergenPracticeFr, obv3PhishingTransfer, customCourseEnrollment, customExamAccommodation, clrMixedRolePortfolio, sdJwtVcCourseCompletion, };
57
72
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRo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EAC9B,4BAA4B,EAC5B,wBAAwB,EACxB,2BAA2B,EAC3B,0BAA0B,EAC1B,oBAAoB,EACpB,sBAAsB,EACtB,uBAAuB,EACvB,qBAAqB,EACrB,uBAAuB,GAC1B,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { CredentialFixture } from '../../types';
2
+ export declare const obv3FoodAllergenFacilitator: CredentialFixture;
3
+ //# sourceMappingURL=food-allergen-facilitator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"food-allergen-facilitator.d.ts","sourceRoot":"","sources":["../../../src/fixtures/obv3/food-allergen-facilitator.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAGrD,eAAO,MAAM,2BAA2B,EAAE,iBAsGzC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { CredentialFixture } from '../../types';
2
+ export declare const obv3FoodAllergenPracticeFr: CredentialFixture;
3
+ //# sourceMappingURL=food-allergen-practice-fr.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"food-allergen-practice-fr.d.ts","sourceRoot":"","sources":["../../../src/fixtures/obv3/food-allergen-practice-fr.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAGrD,eAAO,MAAM,0BAA0B,EAAE,iBAqGxC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { CredentialFixture } from '../../types';
2
+ export declare const obv3FoodAllergenPractice: CredentialFixture;
3
+ //# sourceMappingURL=food-allergen-practice.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"food-allergen-practice.d.ts","sourceRoot":"","sources":["../../../src/fixtures/obv3/food-allergen-practice.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAGrD,eAAO,MAAM,wBAAwB,EAAE,iBAmGtC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { CredentialFixture } from '../../types';
2
+ export declare const obv3PhishingTransfer: CredentialFixture;
3
+ //# sourceMappingURL=phishing-transfer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"phishing-transfer.d.ts","sourceRoot":"","sources":["../../../src/fixtures/obv3/phishing-transfer.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAGrD,eAAO,MAAM,oBAAoB,EAAE,iBA6JlC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { CredentialFixture } from '../../types';
2
+ export declare const obv3QualificationApprenticeship: CredentialFixture;
3
+ //# sourceMappingURL=qualification-apprenticeship.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"qualification-apprenticeship.d.ts","sourceRoot":"","sources":["../../../src/fixtures/obv3/qualification-apprenticeship.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAErD,eAAO,MAAM,+BAA+B,EAAE,iBAsD7C,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { CredentialFixture } from '../../types';
2
+ export declare const obv3QualificationBadgeOverride: CredentialFixture;
3
+ //# sourceMappingURL=qualification-badge-override.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"qualification-badge-override.d.ts","sourceRoot":"","sources":["../../../src/fixtures/obv3/qualification-badge-override.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAErD,eAAO,MAAM,8BAA8B,EAAE,iBA4D5C,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { CredentialFixture } from '../../types';
2
+ export declare const obv3QualificationCertification: CredentialFixture;
3
+ //# sourceMappingURL=qualification-certification.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"qualification-certification.d.ts","sourceRoot":"","sources":["../../../src/fixtures/obv3/qualification-certification.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAErD,eAAO,MAAM,8BAA8B,EAAE,iBAuD5C,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { CredentialFixture } from '../../types';
2
+ export declare const obv3QualificationExpired: CredentialFixture;
3
+ //# sourceMappingURL=qualification-expired.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"qualification-expired.d.ts","sourceRoot":"","sources":["../../../src/fixtures/obv3/qualification-expired.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAErD,eAAO,MAAM,wBAAwB,EAAE,iBAuDtC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { CredentialFixture } from '../../types';
2
+ export declare const obv3QualificationJourneyman: CredentialFixture;
3
+ //# sourceMappingURL=qualification-journeyman.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"qualification-journeyman.d.ts","sourceRoot":"","sources":["../../../src/fixtures/obv3/qualification-journeyman.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAErD,eAAO,MAAM,2BAA2B,EAAE,iBAsDzC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { CredentialFixture } from '../../types';
2
+ export declare const obv3QualificationLicense: CredentialFixture;
3
+ //# sourceMappingURL=qualification-license.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"qualification-license.d.ts","sourceRoot":"","sources":["../../../src/fixtures/obv3/qualification-license.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAErD,eAAO,MAAM,wBAAwB,EAAE,iBAsDtC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { CredentialFixture } from '../../types';
2
+ export declare const obv3QualificationMaster: CredentialFixture;
3
+ //# sourceMappingURL=qualification-master.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"qualification-master.d.ts","sourceRoot":"","sources":["../../../src/fixtures/obv3/qualification-master.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAErD,eAAO,MAAM,uBAAuB,EAAE,iBAsDrC,CAAC"}
package/package.json CHANGED
@@ -1,12 +1,13 @@
1
1
  {
2
2
  "name": "@learncard/credential-library",
3
- "version": "2.0.5",
3
+ "version": "2.1.1",
4
4
  "description": "Comprehensive library of Verifiable Credential fixtures for testing, development, and regression prevention across the VC ecosystem",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/credential-library.esm.js",
7
7
  "files": [
8
8
  "dist",
9
- "src"
9
+ "src",
10
+ "SOURCES.md"
10
11
  ],
11
12
  "scripts": {
12
13
  "build": "node ./scripts/build.mjs && shx cp ./scripts/mixedEntypoint.js ./dist/index.js && tsc --p tsconfig.build.json",
@@ -26,8 +27,8 @@
26
27
  "url": "https://github.com/learningeconomy/LearnCard/issues"
27
28
  },
28
29
  "devDependencies": {
29
- "@learncard/didkit-plugin": "1.10.2",
30
- "@learncard/init": "2.5.1",
30
+ "@learncard/didkit-plugin": "1.10.3",
31
+ "@learncard/init": "2.5.3",
31
32
  "@types/node": "^17.0.38",
32
33
  "esbuild": "^0.27.1",
33
34
  "jose": "^5.9.6",
@@ -36,8 +37,8 @@
36
37
  "vitest": "4.1.11"
37
38
  },
38
39
  "dependencies": {
39
- "@learncard/sd-jwt-vc-plugin": "0.2.15",
40
- "@learncard/types": "5.22.0",
40
+ "@learncard/sd-jwt-vc-plugin": "0.2.16",
41
+ "@learncard/types": "5.23.0",
41
42
  "@sd-jwt/sd-jwt-vc": "^0.19.0",
42
43
  "zod": "4.1.13"
43
44
  },
@@ -0,0 +1,248 @@
1
+ import { describe, expect, it } from 'vitest';
2
+ import { UnsignedAchievementCredentialValidator } from '@learncard/types';
3
+
4
+ import {
5
+ ALL_FIXTURES,
6
+ obv3FoodAllergenPractice,
7
+ obv3FoodAllergenFacilitator,
8
+ obv3FoodAllergenPracticeFr,
9
+ obv3PhishingTransfer,
10
+ customCourseEnrollment,
11
+ customExamAccommodation,
12
+ clrMixedRolePortfolio,
13
+ } from '../fixtures';
14
+ import { prepareFixture } from '../prepare';
15
+
16
+ type JsonRecord = Record<string, unknown>;
17
+
18
+ const asRecord = (value: unknown): JsonRecord => {
19
+ if (!value || typeof value !== 'object' || Array.isArray(value)) {
20
+ throw new Error('Expected a credential object');
21
+ }
22
+ return value as JsonRecord;
23
+ };
24
+ const asRecords = (value: unknown): JsonRecord[] => {
25
+ if (!Array.isArray(value)) throw new Error('Expected a credential array');
26
+ return value.map(asRecord);
27
+ };
28
+ const subjectOf = (credential: JsonRecord): JsonRecord => asRecord(credential.credentialSubject);
29
+ const achievementOf = (credential: JsonRecord): JsonRecord =>
30
+ asRecord(subjectOf(credential).achievement);
31
+
32
+ const fixtures = [
33
+ obv3FoodAllergenPractice,
34
+ obv3FoodAllergenFacilitator,
35
+ obv3FoodAllergenPracticeFr,
36
+ obv3PhishingTransfer,
37
+ customCourseEnrollment,
38
+ customExamAccommodation,
39
+ clrMixedRolePortfolio,
40
+ ];
41
+
42
+ const expectResultReferences = (credential: JsonRecord): void => {
43
+ const descriptions = asRecords(achievementOf(credential).resultDescription);
44
+ const byId = new Map(descriptions.map(description => [description.id, description]));
45
+ expect(byId.size).toBe(descriptions.length);
46
+ for (const result of asRecords(subjectOf(credential).result)) {
47
+ const description = byId.get(result.resultDescription);
48
+ expect(description).toBeDefined();
49
+ if (!description) throw new Error('Missing result description');
50
+ if (result.achievedLevel || description.requiredLevel) {
51
+ const levels = asRecords(description.rubricCriterionLevel);
52
+ if (result.achievedLevel) {
53
+ expect(levels.some(level => level.id === result.achievedLevel)).toBe(true);
54
+ }
55
+ if (description.requiredLevel) {
56
+ expect(levels.some(level => level.id === description.requiredLevel)).toBe(true);
57
+ }
58
+ }
59
+ }
60
+ };
61
+
62
+ describe('Curated example coverage', () => {
63
+ it.each(fixtures)('$id is registered once, validated, and unsigned', fixture => {
64
+ expect(ALL_FIXTURES.filter(entry => entry.id === fixture.id)).toEqual([fixture]);
65
+ expect(fixture.source).toBe('synthetic');
66
+ expect(fixture.signed).toBe(false);
67
+ expect(fixture.validity).toBe('valid');
68
+ expect(fixture.validator).toBeDefined();
69
+ expect(fixture.validator?.safeParse(fixture.credential).success).toBe(true);
70
+ expect(fixture.credential.proof).toBeUndefined();
71
+ });
72
+
73
+ it('uses named issuer profiles while preserving shared and distinct issuer groups', () => {
74
+ const issuers = fixtures.map(fixture => asRecord(fixture.credential.issuer));
75
+ for (const issuer of issuers) {
76
+ expect(issuer.id).toMatch(/^did:/);
77
+ expect(issuer.type).toEqual(['Profile']);
78
+ expect(issuer.name).toBeTruthy();
79
+ expect(issuer.name).not.toMatch(/^https?:/);
80
+ }
81
+ expect(new Set(issuers.map(issuer => issuer.id)).size).toBe(5);
82
+ expect(obv3FoodAllergenPracticeFr.credential.issuer).toEqual(
83
+ obv3FoodAllergenPractice.credential.issuer
84
+ );
85
+ expect(obv3FoodAllergenFacilitator.credential.issuer).toEqual(
86
+ obv3FoodAllergenPractice.credential.issuer
87
+ );
88
+ for (const child of asRecords(
89
+ subjectOf(clrMixedRolePortfolio.credential).verifiableCredential
90
+ )) {
91
+ expect(child.issuer).toEqual(clrMixedRolePortfolio.credential.issuer);
92
+ }
93
+ });
94
+
95
+ it.each([obv3FoodAllergenPractice, obv3FoodAllergenPracticeFr])(
96
+ '$id expresses RubricScore within the declared range',
97
+ fixture => {
98
+ const subject = subjectOf(fixture.credential);
99
+ const [description] = asRecords(achievementOf(fixture.credential).resultDescription);
100
+ const [result] = asRecords(subject.result);
101
+ expect(description.resultType).toBe('RubricScore');
102
+ expect(description).toMatchObject({ valueMin: '0', valueMax: '4', requiredValue: '3' });
103
+ expect(result).toMatchObject({ value: '4', status: 'Completed' });
104
+ expect(Number(result.value)).toBeGreaterThanOrEqual(Number(description.requiredValue));
105
+ expect(Number(result.value)).toBeLessThanOrEqual(Number(description.valueMax));
106
+ expect(subject.role).toBe('learner');
107
+ expectResultReferences(fixture.credential);
108
+ }
109
+ );
110
+
111
+ it('keeps French text, scoring, alignment, and counterpart identities consistent', () => {
112
+ const english = achievementOf(obv3FoodAllergenPractice.credential);
113
+ const french = achievementOf(obv3FoodAllergenPracticeFr.credential);
114
+ expect(french.inLanguage).toBe('fr');
115
+ expect(french.name).toContain('Prévention');
116
+ expect(asRecord(french.criteria).narrative).toContain('Repère');
117
+ expect(french.alignment).toEqual(english.alignment);
118
+ const [englishScore] = asRecords(english.resultDescription);
119
+ const [frenchScore] = asRecords(french.resultDescription);
120
+ expect(frenchScore).toMatchObject({
121
+ resultType: englishScore.resultType,
122
+ valueMin: englishScore.valueMin,
123
+ valueMax: englishScore.valueMax,
124
+ requiredValue: englishScore.requiredValue,
125
+ });
126
+ expect(french.id).not.toBe(english.id);
127
+ expect(frenchScore.id).not.toBe(englishScore.id);
128
+ expect(obv3FoodAllergenPracticeFr.credential.id).not.toBe(
129
+ obv3FoodAllergenPractice.credential.id
130
+ );
131
+ expect(subjectOf(obv3FoodAllergenPracticeFr.credential).id).toBe(
132
+ subjectOf(obv3FoodAllergenPractice.credential).id
133
+ );
134
+ });
135
+
136
+ it('assesses the matched facilitator as an instructor, separately from learner practice', () => {
137
+ const instructor = subjectOf(obv3FoodAllergenFacilitator.credential);
138
+ const learner = subjectOf(obv3FoodAllergenPractice.credential);
139
+ const achievement = asRecord(instructor.achievement);
140
+ expect(instructor.id).toBe(learner.id);
141
+ expect(instructor.role).toBe('instructor');
142
+ expect(achievement.description).toContain('Assesses teaching performance');
143
+ expect(asRecords(achievement.alignment).map(alignment => alignment.targetName)).toEqual([
144
+ 'Instructing',
145
+ ]);
146
+ expect(asRecords(achievement.resultDescription)[0].resultType).toBe('PerformanceLevel');
147
+ expectResultReferences(obv3FoodAllergenFacilitator.credential);
148
+ });
149
+
150
+ it('preserves achieved-level-only and raw-score branches in the same project', () => {
151
+ const [level, score] = asRecords(subjectOf(obv3PhishingTransfer.credential).result);
152
+ expect(level.achievedLevel).toBeDefined();
153
+ expect(level).not.toHaveProperty('value');
154
+ expect(score.value).toBe('9');
155
+ expect(score).not.toHaveProperty('achievedLevel');
156
+ expect(
157
+ asRecords(achievementOf(obv3PhishingTransfer.credential).resultDescription).map(
158
+ description => description.resultType
159
+ )
160
+ ).toEqual(['RubricCriterionLevel', 'RawScore']);
161
+ expectResultReferences(obv3PhishingTransfer.credential);
162
+ });
163
+
164
+ it.each([customCourseEnrollment, customExamAccommodation])(
165
+ '$id remains a custom administrative claim with no achievement',
166
+ fixture => {
167
+ const subject = subjectOf(fixture.credential);
168
+ expect(fixture.spec).toBe('custom');
169
+ expect(fixture.profile).toBe('generic');
170
+ expect(subject.designation).toBeDefined();
171
+ expect(subject.claimRole).toBeDefined();
172
+ expect(subject.claimScope).toBeDefined();
173
+ expect(subject).not.toHaveProperty('achievement');
174
+ expect(subject).not.toHaveProperty('result');
175
+ expect(subject).not.toHaveProperty('diagnosis');
176
+ const context = fixture.credential['@context'];
177
+ expect(Array.isArray(context)).toBe(true);
178
+ if (!Array.isArray(context)) throw new Error('Expected inline context');
179
+ const terms = asRecord(context[1]);
180
+ expect(terms[fixture.credential.type[1]]).toBeDefined();
181
+ }
182
+ );
183
+
184
+ it('keeps mixed CLR roles, mirrored definitions, and canonical achievement references', () => {
185
+ expect(clrMixedRolePortfolio.credential['@context']).toEqual([
186
+ 'https://www.w3.org/ns/credentials/v2',
187
+ 'https://purl.imsglobal.org/spec/clr/v2p0/context.json',
188
+ 'https://purl.imsglobal.org/spec/ob/v3p0/context-3.0.3.json',
189
+ ]);
190
+ const subject = subjectOf(clrMixedRolePortfolio.credential);
191
+ const children = asRecords(subject.verifiableCredential);
192
+ expect(children).toHaveLength(3);
193
+ expect(new Set(children.map(child => child.id)).size).toBe(3);
194
+ expect(children.map(child => subjectOf(child).role)).toEqual([
195
+ 'learner',
196
+ 'learner',
197
+ 'instructor',
198
+ ]);
199
+ expect(subject.achievement).toEqual(children.map(achievementOf));
200
+ const achievementIds = new Set(children.map(child => achievementOf(child).id));
201
+ const credentialIds = new Set(children.map(child => child.id));
202
+ for (const association of asRecords(subject.association)) {
203
+ expect(association.type).toBe('Association');
204
+ expect(achievementIds.has(association.sourceId)).toBe(true);
205
+ expect(achievementIds.has(association.targetId)).toBe(true);
206
+ expect(credentialIds.has(association.sourceId)).toBe(false);
207
+ expect(credentialIds.has(association.targetId)).toBe(false);
208
+ }
209
+ for (const child of children) {
210
+ expect(subjectOf(child).id).toBe(subject.id);
211
+ expect(child.proof).toBeUndefined();
212
+ expect(UnsignedAchievementCredentialValidator.safeParse(child).success).toBe(true);
213
+ expectResultReferences(child);
214
+ }
215
+ });
216
+
217
+ it('prepares CLR children together without changing source data or child issuer claims', () => {
218
+ const before = JSON.stringify(clrMixedRolePortfolio.credential);
219
+ const originalSubject = subjectOf(clrMixedRolePortfolio.credential);
220
+ const originalChildren = asRecords(originalSubject.verifiableCredential);
221
+ const prepared = prepareFixture(clrMixedRolePortfolio, {
222
+ issuerDid: 'did:example:portfolio-test-issuer',
223
+ subjectDid: 'did:example:portfolio-test-subject',
224
+ validFrom: '2026-10-04T12:00:00Z',
225
+ freshIds: true,
226
+ });
227
+ expect(asRecord(prepared.issuer).id).toBe('did:example:portfolio-test-issuer');
228
+ expect(asRecord(prepared.issuer).name).toBe(
229
+ asRecord(clrMixedRolePortfolio.credential.issuer).name
230
+ );
231
+ expect(prepared.validFrom).toBe('2026-10-04T12:00:00Z');
232
+ const subject = subjectOf(prepared);
233
+ expect(subject.id).toBe('did:example:portfolio-test-subject');
234
+ expect(prepared.id).not.toBe(clrMixedRolePortfolio.credential.id);
235
+ const children = asRecords(subject.verifiableCredential);
236
+ for (const [index, child] of children.entries()) {
237
+ expect(subjectOf(child).id).toBe(subject.id);
238
+ expect(child.id).not.toBe(originalChildren[index].id);
239
+ expect(child.issuer).toEqual(originalChildren[index].issuer);
240
+ expect(child.validFrom).toBe(originalChildren[index].validFrom);
241
+ expect(child.proof).toBeUndefined();
242
+ expectResultReferences(child);
243
+ }
244
+ expect(subject.achievement).toEqual(children.map(achievementOf));
245
+ expect(subject.association).toEqual(originalSubject.association);
246
+ expect(JSON.stringify(clrMixedRolePortfolio.credential)).toBe(before);
247
+ });
248
+ });
@@ -60,6 +60,41 @@ describe('Credential issuance', () => {
60
60
  );
61
61
  });
62
62
 
63
+ describe('curated examples issue without remote contexts', () => {
64
+ // A deterministic, in-memory test identity; no account or persistent key writes.
65
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
66
+ let offlineWallet: any;
67
+
68
+ beforeAll(async () => {
69
+ offlineWallet = await initLearnCard({
70
+ seed: 'd'.repeat(64),
71
+ didkit,
72
+ allowRemoteContexts: false,
73
+ });
74
+ }, 30_000);
75
+
76
+ it.each([
77
+ 'obv3/food-allergen-practice',
78
+ 'obv3/food-allergen-facilitator',
79
+ 'obv3/food-allergen-practice-fr',
80
+ 'obv3/phishing-transfer',
81
+ 'custom/course-enrollment',
82
+ 'custom/exam-accommodation',
83
+ 'clr/mixed-role-portfolio',
84
+ ])(
85
+ '%s',
86
+ async id => {
87
+ const prepared = prepareFixture(getFixture(id), {
88
+ issuerDid: offlineWallet.id.did(),
89
+ subjectDid: 'did:example:curated-test-subject',
90
+ });
91
+ const signed = await offlineWallet.invoke.issueCredential(prepared);
92
+ expect(signed.proof).toBeDefined();
93
+ },
94
+ 15_000
95
+ );
96
+ });
97
+
63
98
  it('issues the full CLR fixture without remote contexts', async () => {
64
99
  const offlineWallet = await initLearnCard({
65
100
  seed: 'b'.repeat(64),