@learncard/credential-library 2.1.0 → 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.
@@ -41,6 +41,7 @@ __export(index_exports, {
41
41
  clrEmploymentRecord: () => clrEmploymentRecord,
42
42
  clrGreatPlainsFull: () => clrGreatPlainsFull,
43
43
  clrLicensingRegulatoryRecord: () => clrLicensingRegulatoryRecord,
44
+ clrMilitaryComprehensiveRecord: () => clrMilitaryComprehensiveRecord,
44
45
  clrMilitaryTrainingRecord: () => clrMilitaryTrainingRecord,
45
46
  clrMinimal: () => clrMinimal,
46
47
  clrMixedCareerRecord: () => clrMixedCareerRecord,
@@ -10616,6 +10617,153 @@ var clrMilitaryTrainingRecord = {
10616
10617
  }
10617
10618
  };
10618
10619
 
10620
+ // src/fixtures/clr/military-comprehensive-record.ts
10621
+ var base = structuredClone(clrMilitaryTrainingRecord.credential);
10622
+ var subject = base.credentialSubject;
10623
+ var context = [
10624
+ "https://www.w3.org/ns/credentials/v2",
10625
+ "https://purl.imsglobal.org/spec/ob/v3p0/context-3.0.3.json"
10626
+ ];
10627
+ var issuer = {
10628
+ id: "did:example:meridian-qualifications",
10629
+ type: ["Profile"],
10630
+ name: "Meridian Qualifications Board (Fictional)"
10631
+ };
10632
+ var evaluationIssuer = {
10633
+ id: "did:example:meridian-assessment",
10634
+ type: ["Profile"],
10635
+ name: "Meridian Independent Assessments (Fictional)"
10636
+ };
10637
+ var clrMilitaryComprehensiveRecord = {
10638
+ ...clrMilitaryTrainingRecord,
10639
+ id: "clr/military-comprehensive-record",
10640
+ name: "Military Training and Qualifications \u2014 Comprehensive",
10641
+ description: "Six source-backed children covering training, fieldwork, award, competency, assessment, and qualification with distinct issuers.",
10642
+ tags: [...clrMilitaryTrainingRecord.tags ?? [], "lc-2215"],
10643
+ credential: {
10644
+ ...base,
10645
+ id: "urn:uuid:7293fe71-4b24-4428-9f6f-60923687184c",
10646
+ name: "Military Training and Qualifications \u2014 Comprehensive",
10647
+ credentialSubject: {
10648
+ ...subject,
10649
+ verifiableCredential: [
10650
+ ...subject.verifiableCredential,
10651
+ {
10652
+ "@context": context,
10653
+ id: "urn:uuid:89a65d6b-3d7b-43f9-a545-82979d22b874",
10654
+ type: ["VerifiableCredential", "AchievementCredential"],
10655
+ issuer: evaluationIssuer,
10656
+ validFrom: "2026-03-01T12:00:00Z",
10657
+ credentialSubject: {
10658
+ id: subject.id,
10659
+ type: ["AchievementSubject"],
10660
+ achievement: {
10661
+ id: "urn:uuid:e6b5c726-4f43-4cec-8099-fd5d476c91c0",
10662
+ type: ["Achievement"],
10663
+ achievementType: "Competency",
10664
+ name: "Safe logistics coordination",
10665
+ description: "Demonstrated coordination in a fictional training exercise.",
10666
+ criteria: {
10667
+ narrative: "Explain and demonstrate the supplied safety checklist."
10668
+ },
10669
+ alignment: [
10670
+ {
10671
+ type: ["Alignment"],
10672
+ targetName: "Safe coordination",
10673
+ targetUrl: "https://skills.example/safe-coordination",
10674
+ targetCode: "SAFE-101"
10675
+ }
10676
+ ]
10677
+ }
10678
+ },
10679
+ evidence: [
10680
+ {
10681
+ type: ["Evidence"],
10682
+ name: "Observation notes",
10683
+ narrative: "The learner demonstrated the checklist in a supervised simulation."
10684
+ }
10685
+ ]
10686
+ },
10687
+ {
10688
+ "@context": context,
10689
+ id: "urn:uuid:676e976f-0e91-4c4c-a2d4-1cac83672875",
10690
+ type: ["VerifiableCredential", "AchievementCredential"],
10691
+ issuer: evaluationIssuer,
10692
+ validFrom: "2026-03-02T12:00:00Z",
10693
+ credentialSubject: {
10694
+ id: subject.id,
10695
+ type: ["AchievementSubject"],
10696
+ achievement: {
10697
+ id: "urn:uuid:027361d1-5945-4292-85a6-2d8204b3e876",
10698
+ type: ["Achievement"],
10699
+ achievementType: "Assessment",
10700
+ name: "Coordination knowledge assessment",
10701
+ description: "Synthetic knowledge assessment.",
10702
+ criteria: { narrative: "Answer the scenario questions." },
10703
+ resultDescription: [
10704
+ {
10705
+ id: "urn:uuid:3b6af4be-5b0f-44f1-9d58-a8f8bd1a2877",
10706
+ type: ["ResultDescription"],
10707
+ name: "Knowledge score",
10708
+ resultType: "RawScore",
10709
+ valueMin: "0",
10710
+ valueMax: "100",
10711
+ requiredValue: "70"
10712
+ }
10713
+ ]
10714
+ },
10715
+ result: [
10716
+ {
10717
+ type: ["Result"],
10718
+ resultDescription: "urn:uuid:3b6af4be-5b0f-44f1-9d58-a8f8bd1a2877",
10719
+ value: "86"
10720
+ }
10721
+ ]
10722
+ }
10723
+ },
10724
+ {
10725
+ "@context": context,
10726
+ id: "urn:uuid:492bb221-9dca-46a4-bce1-205537633878",
10727
+ type: ["VerifiableCredential", "AchievementCredential"],
10728
+ issuer,
10729
+ awardedDate: "2026-03-03T12:00:00Z",
10730
+ validFrom: "2026-04-01T12:00:00Z",
10731
+ validUntil: "2027-04-01T12:00:00Z",
10732
+ credentialSubject: {
10733
+ id: subject.id,
10734
+ type: ["AchievementSubject"],
10735
+ licenseNumber: "SYN-LOG-2048",
10736
+ achievement: {
10737
+ id: "urn:uuid:8067ec9d-6fae-41f0-aa5f-6356f7a96879",
10738
+ type: ["Achievement"],
10739
+ achievementType: "License",
10740
+ name: "Simulated logistics qualification",
10741
+ description: "Fictional qualification for display testing only.",
10742
+ criteria: {
10743
+ narrative: "Demonstrate the training objectives and complete the assessment."
10744
+ },
10745
+ otherIdentifier: [
10746
+ {
10747
+ type: "IdentifierEntry",
10748
+ identifier: "SYN-QUAL-48",
10749
+ identifierType: "identifier"
10750
+ }
10751
+ ]
10752
+ }
10753
+ },
10754
+ evidence: [
10755
+ {
10756
+ type: ["Evidence"],
10757
+ name: "Qualification review",
10758
+ narrative: "Synthetic review of training and assessment evidence."
10759
+ }
10760
+ ]
10761
+ }
10762
+ ]
10763
+ }
10764
+ }
10765
+ };
10766
+
10619
10767
  // src/fixtures/clr/professional-organization-record.ts
10620
10768
  var clrProfessionalOrganizationRecord = {
10621
10769
  id: "clr/professional-organization-record",
@@ -24801,9 +24949,9 @@ var buildFinalTranscriptVariant = /* @__PURE__ */ __name((provisional, options =
24801
24949
  if (options.validFrom) final.validFrom = options.validFrom;
24802
24950
  delete final.validUntil;
24803
24951
  delete final.partial;
24804
- const subject = final.credentialSubject;
24805
- if (isRecord(subject) && Array.isArray(subject.verifiableCredential)) {
24806
- subject.verifiableCredential = subject.verifiableCredential.map((nested) => {
24952
+ const subject2 = final.credentialSubject;
24953
+ if (isRecord(subject2) && Array.isArray(subject2.verifiableCredential)) {
24954
+ subject2.verifiableCredential = subject2.verifiableCredential.map((nested) => {
24807
24955
  if (!isRecord(nested)) return nested;
24808
24956
  const next = { ...nested };
24809
24957
  if (typeof next.name === "string") {
@@ -34362,6 +34510,7 @@ var ALL_FIXTURES = [
34362
34510
  clrEmploymentRecord,
34363
34511
  clrTrainingProviderRecord,
34364
34512
  clrMilitaryTrainingRecord,
34513
+ clrMilitaryComprehensiveRecord,
34365
34514
  clrProfessionalOrganizationRecord,
34366
34515
  clrLicensingRegulatoryRecord,
34367
34516
  clrMixedCareerRecord,
@@ -34605,12 +34754,12 @@ var remapUuidReferences = /* @__PURE__ */ __name((value, idMap, preserveSignedCr
34605
34754
  }
34606
34755
  return value;
34607
34756
  }, "remapUuidReferences");
34608
- var patchIssuer = /* @__PURE__ */ __name((issuer, issuerDid) => {
34609
- if (typeof issuer === "string") {
34757
+ var patchIssuer = /* @__PURE__ */ __name((issuer2, issuerDid) => {
34758
+ if (typeof issuer2 === "string") {
34610
34759
  return issuerDid;
34611
34760
  }
34612
- if (issuer && typeof issuer === "object") {
34613
- return { ...issuer, id: issuerDid };
34761
+ if (issuer2 && typeof issuer2 === "object") {
34762
+ return { ...issuer2, id: issuerDid };
34614
34763
  }
34615
34764
  return issuerDid;
34616
34765
  }, "patchIssuer");
@@ -34628,13 +34777,13 @@ var patchCredentialSubject = /* @__PURE__ */ __name((credential, subjectDid) =>
34628
34777
  }
34629
34778
  return patchedCredential;
34630
34779
  }, "patchCredentialSubject");
34631
- var patchSubject = /* @__PURE__ */ __name((subject, subjectDid) => {
34632
- if (Array.isArray(subject)) {
34633
- return subject.map((nestedSubject) => patchSubject(nestedSubject, subjectDid));
34780
+ var patchSubject = /* @__PURE__ */ __name((subject2, subjectDid) => {
34781
+ if (Array.isArray(subject2)) {
34782
+ return subject2.map((nestedSubject) => patchSubject(nestedSubject, subjectDid));
34634
34783
  }
34635
- if (!subject || typeof subject !== "object") return subject;
34784
+ if (!subject2 || typeof subject2 !== "object") return subject2;
34636
34785
  const patchedSubject = {
34637
- ...subject,
34786
+ ...subject2,
34638
34787
  id: subjectDid
34639
34788
  };
34640
34789
  const embeddedCredentials = patchedSubject.verifiableCredential;