@learncard/credential-library 2.1.0 → 2.1.2
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 +161 -12
- package/dist/credential-library.cjs.development.js.map +4 -4
- package/dist/credential-library.cjs.production.min.js +3 -3
- package/dist/credential-library.cjs.production.min.js.map +4 -4
- package/dist/credential-library.esm.js +161 -12
- package/dist/credential-library.esm.js.map +4 -4
- package/dist/fixtures/clr/military-comprehensive-record.d.ts +4 -0
- package/dist/fixtures/clr/military-comprehensive-record.d.ts.map +1 -0
- package/dist/fixtures/index.d.ts +2 -1
- package/dist/fixtures/index.d.ts.map +1 -1
- package/package.json +5 -5
- package/src/fixtures/clr/military-comprehensive-record.ts +155 -0
- package/src/fixtures/index.ts +3 -0
|
@@ -10497,6 +10497,153 @@ var clrMilitaryTrainingRecord = {
|
|
|
10497
10497
|
}
|
|
10498
10498
|
};
|
|
10499
10499
|
|
|
10500
|
+
// src/fixtures/clr/military-comprehensive-record.ts
|
|
10501
|
+
var base = structuredClone(clrMilitaryTrainingRecord.credential);
|
|
10502
|
+
var subject = base.credentialSubject;
|
|
10503
|
+
var context = [
|
|
10504
|
+
"https://www.w3.org/ns/credentials/v2",
|
|
10505
|
+
"https://purl.imsglobal.org/spec/ob/v3p0/context-3.0.3.json"
|
|
10506
|
+
];
|
|
10507
|
+
var issuer = {
|
|
10508
|
+
id: "did:example:meridian-qualifications",
|
|
10509
|
+
type: ["Profile"],
|
|
10510
|
+
name: "Meridian Qualifications Board (Fictional)"
|
|
10511
|
+
};
|
|
10512
|
+
var evaluationIssuer = {
|
|
10513
|
+
id: "did:example:meridian-assessment",
|
|
10514
|
+
type: ["Profile"],
|
|
10515
|
+
name: "Meridian Independent Assessments (Fictional)"
|
|
10516
|
+
};
|
|
10517
|
+
var clrMilitaryComprehensiveRecord = {
|
|
10518
|
+
...clrMilitaryTrainingRecord,
|
|
10519
|
+
id: "clr/military-comprehensive-record",
|
|
10520
|
+
name: "Military Training and Qualifications \u2014 Comprehensive",
|
|
10521
|
+
description: "Six source-backed children covering training, fieldwork, award, competency, assessment, and qualification with distinct issuers.",
|
|
10522
|
+
tags: [...clrMilitaryTrainingRecord.tags ?? [], "lc-2215"],
|
|
10523
|
+
credential: {
|
|
10524
|
+
...base,
|
|
10525
|
+
id: "urn:uuid:7293fe71-4b24-4428-9f6f-60923687184c",
|
|
10526
|
+
name: "Military Training and Qualifications \u2014 Comprehensive",
|
|
10527
|
+
credentialSubject: {
|
|
10528
|
+
...subject,
|
|
10529
|
+
verifiableCredential: [
|
|
10530
|
+
...subject.verifiableCredential,
|
|
10531
|
+
{
|
|
10532
|
+
"@context": context,
|
|
10533
|
+
id: "urn:uuid:89a65d6b-3d7b-43f9-a545-82979d22b874",
|
|
10534
|
+
type: ["VerifiableCredential", "AchievementCredential"],
|
|
10535
|
+
issuer: evaluationIssuer,
|
|
10536
|
+
validFrom: "2026-03-01T12:00:00Z",
|
|
10537
|
+
credentialSubject: {
|
|
10538
|
+
id: subject.id,
|
|
10539
|
+
type: ["AchievementSubject"],
|
|
10540
|
+
achievement: {
|
|
10541
|
+
id: "urn:uuid:e6b5c726-4f43-4cec-8099-fd5d476c91c0",
|
|
10542
|
+
type: ["Achievement"],
|
|
10543
|
+
achievementType: "Competency",
|
|
10544
|
+
name: "Safe logistics coordination",
|
|
10545
|
+
description: "Demonstrated coordination in a fictional training exercise.",
|
|
10546
|
+
criteria: {
|
|
10547
|
+
narrative: "Explain and demonstrate the supplied safety checklist."
|
|
10548
|
+
},
|
|
10549
|
+
alignment: [
|
|
10550
|
+
{
|
|
10551
|
+
type: ["Alignment"],
|
|
10552
|
+
targetName: "Safe coordination",
|
|
10553
|
+
targetUrl: "https://skills.example/safe-coordination",
|
|
10554
|
+
targetCode: "SAFE-101"
|
|
10555
|
+
}
|
|
10556
|
+
]
|
|
10557
|
+
}
|
|
10558
|
+
},
|
|
10559
|
+
evidence: [
|
|
10560
|
+
{
|
|
10561
|
+
type: ["Evidence"],
|
|
10562
|
+
name: "Observation notes",
|
|
10563
|
+
narrative: "The learner demonstrated the checklist in a supervised simulation."
|
|
10564
|
+
}
|
|
10565
|
+
]
|
|
10566
|
+
},
|
|
10567
|
+
{
|
|
10568
|
+
"@context": context,
|
|
10569
|
+
id: "urn:uuid:676e976f-0e91-4c4c-a2d4-1cac83672875",
|
|
10570
|
+
type: ["VerifiableCredential", "AchievementCredential"],
|
|
10571
|
+
issuer: evaluationIssuer,
|
|
10572
|
+
validFrom: "2026-03-02T12:00:00Z",
|
|
10573
|
+
credentialSubject: {
|
|
10574
|
+
id: subject.id,
|
|
10575
|
+
type: ["AchievementSubject"],
|
|
10576
|
+
achievement: {
|
|
10577
|
+
id: "urn:uuid:027361d1-5945-4292-85a6-2d8204b3e876",
|
|
10578
|
+
type: ["Achievement"],
|
|
10579
|
+
achievementType: "Assessment",
|
|
10580
|
+
name: "Coordination knowledge assessment",
|
|
10581
|
+
description: "Synthetic knowledge assessment.",
|
|
10582
|
+
criteria: { narrative: "Answer the scenario questions." },
|
|
10583
|
+
resultDescription: [
|
|
10584
|
+
{
|
|
10585
|
+
id: "urn:uuid:3b6af4be-5b0f-44f1-9d58-a8f8bd1a2877",
|
|
10586
|
+
type: ["ResultDescription"],
|
|
10587
|
+
name: "Knowledge score",
|
|
10588
|
+
resultType: "RawScore",
|
|
10589
|
+
valueMin: "0",
|
|
10590
|
+
valueMax: "100",
|
|
10591
|
+
requiredValue: "70"
|
|
10592
|
+
}
|
|
10593
|
+
]
|
|
10594
|
+
},
|
|
10595
|
+
result: [
|
|
10596
|
+
{
|
|
10597
|
+
type: ["Result"],
|
|
10598
|
+
resultDescription: "urn:uuid:3b6af4be-5b0f-44f1-9d58-a8f8bd1a2877",
|
|
10599
|
+
value: "86"
|
|
10600
|
+
}
|
|
10601
|
+
]
|
|
10602
|
+
}
|
|
10603
|
+
},
|
|
10604
|
+
{
|
|
10605
|
+
"@context": context,
|
|
10606
|
+
id: "urn:uuid:492bb221-9dca-46a4-bce1-205537633878",
|
|
10607
|
+
type: ["VerifiableCredential", "AchievementCredential"],
|
|
10608
|
+
issuer,
|
|
10609
|
+
awardedDate: "2026-03-03T12:00:00Z",
|
|
10610
|
+
validFrom: "2026-04-01T12:00:00Z",
|
|
10611
|
+
validUntil: "2027-04-01T12:00:00Z",
|
|
10612
|
+
credentialSubject: {
|
|
10613
|
+
id: subject.id,
|
|
10614
|
+
type: ["AchievementSubject"],
|
|
10615
|
+
licenseNumber: "SYN-LOG-2048",
|
|
10616
|
+
achievement: {
|
|
10617
|
+
id: "urn:uuid:8067ec9d-6fae-41f0-aa5f-6356f7a96879",
|
|
10618
|
+
type: ["Achievement"],
|
|
10619
|
+
achievementType: "License",
|
|
10620
|
+
name: "Simulated logistics qualification",
|
|
10621
|
+
description: "Fictional qualification for display testing only.",
|
|
10622
|
+
criteria: {
|
|
10623
|
+
narrative: "Demonstrate the training objectives and complete the assessment."
|
|
10624
|
+
},
|
|
10625
|
+
otherIdentifier: [
|
|
10626
|
+
{
|
|
10627
|
+
type: "IdentifierEntry",
|
|
10628
|
+
identifier: "SYN-QUAL-48",
|
|
10629
|
+
identifierType: "identifier"
|
|
10630
|
+
}
|
|
10631
|
+
]
|
|
10632
|
+
}
|
|
10633
|
+
},
|
|
10634
|
+
evidence: [
|
|
10635
|
+
{
|
|
10636
|
+
type: ["Evidence"],
|
|
10637
|
+
name: "Qualification review",
|
|
10638
|
+
narrative: "Synthetic review of training and assessment evidence."
|
|
10639
|
+
}
|
|
10640
|
+
]
|
|
10641
|
+
}
|
|
10642
|
+
]
|
|
10643
|
+
}
|
|
10644
|
+
}
|
|
10645
|
+
};
|
|
10646
|
+
|
|
10500
10647
|
// src/fixtures/clr/professional-organization-record.ts
|
|
10501
10648
|
var clrProfessionalOrganizationRecord = {
|
|
10502
10649
|
id: "clr/professional-organization-record",
|
|
@@ -24682,9 +24829,9 @@ var buildFinalTranscriptVariant = /* @__PURE__ */ __name((provisional, options =
|
|
|
24682
24829
|
if (options.validFrom) final.validFrom = options.validFrom;
|
|
24683
24830
|
delete final.validUntil;
|
|
24684
24831
|
delete final.partial;
|
|
24685
|
-
const
|
|
24686
|
-
if (isRecord(
|
|
24687
|
-
|
|
24832
|
+
const subject2 = final.credentialSubject;
|
|
24833
|
+
if (isRecord(subject2) && Array.isArray(subject2.verifiableCredential)) {
|
|
24834
|
+
subject2.verifiableCredential = subject2.verifiableCredential.map((nested) => {
|
|
24688
24835
|
if (!isRecord(nested)) return nested;
|
|
24689
24836
|
const next = { ...nested };
|
|
24690
24837
|
if (typeof next.name === "string") {
|
|
@@ -34243,6 +34390,7 @@ var ALL_FIXTURES = [
|
|
|
34243
34390
|
clrEmploymentRecord,
|
|
34244
34391
|
clrTrainingProviderRecord,
|
|
34245
34392
|
clrMilitaryTrainingRecord,
|
|
34393
|
+
clrMilitaryComprehensiveRecord,
|
|
34246
34394
|
clrProfessionalOrganizationRecord,
|
|
34247
34395
|
clrLicensingRegulatoryRecord,
|
|
34248
34396
|
clrMixedCareerRecord,
|
|
@@ -34486,12 +34634,12 @@ var remapUuidReferences = /* @__PURE__ */ __name((value, idMap, preserveSignedCr
|
|
|
34486
34634
|
}
|
|
34487
34635
|
return value;
|
|
34488
34636
|
}, "remapUuidReferences");
|
|
34489
|
-
var patchIssuer = /* @__PURE__ */ __name((
|
|
34490
|
-
if (typeof
|
|
34637
|
+
var patchIssuer = /* @__PURE__ */ __name((issuer2, issuerDid) => {
|
|
34638
|
+
if (typeof issuer2 === "string") {
|
|
34491
34639
|
return issuerDid;
|
|
34492
34640
|
}
|
|
34493
|
-
if (
|
|
34494
|
-
return { ...
|
|
34641
|
+
if (issuer2 && typeof issuer2 === "object") {
|
|
34642
|
+
return { ...issuer2, id: issuerDid };
|
|
34495
34643
|
}
|
|
34496
34644
|
return issuerDid;
|
|
34497
34645
|
}, "patchIssuer");
|
|
@@ -34509,13 +34657,13 @@ var patchCredentialSubject = /* @__PURE__ */ __name((credential, subjectDid) =>
|
|
|
34509
34657
|
}
|
|
34510
34658
|
return patchedCredential;
|
|
34511
34659
|
}, "patchCredentialSubject");
|
|
34512
|
-
var patchSubject = /* @__PURE__ */ __name((
|
|
34513
|
-
if (Array.isArray(
|
|
34514
|
-
return
|
|
34660
|
+
var patchSubject = /* @__PURE__ */ __name((subject2, subjectDid) => {
|
|
34661
|
+
if (Array.isArray(subject2)) {
|
|
34662
|
+
return subject2.map((nestedSubject) => patchSubject(nestedSubject, subjectDid));
|
|
34515
34663
|
}
|
|
34516
|
-
if (!
|
|
34664
|
+
if (!subject2 || typeof subject2 !== "object") return subject2;
|
|
34517
34665
|
const patchedSubject = {
|
|
34518
|
-
...
|
|
34666
|
+
...subject2,
|
|
34519
34667
|
id: subjectDid
|
|
34520
34668
|
};
|
|
34521
34669
|
const embeddedCredentials = patchedSubject.verifiableCredential;
|
|
@@ -34963,6 +35111,7 @@ export {
|
|
|
34963
35111
|
clrEmploymentRecord,
|
|
34964
35112
|
clrGreatPlainsFull,
|
|
34965
35113
|
clrLicensingRegulatoryRecord,
|
|
35114
|
+
clrMilitaryComprehensiveRecord,
|
|
34966
35115
|
clrMilitaryTrainingRecord,
|
|
34967
35116
|
clrMinimal,
|
|
34968
35117
|
clrMixedCareerRecord,
|