@learncard/credential-library 1.0.13 → 1.0.15
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 +18 -5
- package/dist/credential-library.cjs.development.js.map +2 -2
- package/dist/credential-library.cjs.production.min.js +1 -1
- package/dist/credential-library.cjs.production.min.js.map +2 -2
- package/dist/credential-library.esm.js +18 -5
- package/dist/credential-library.esm.js.map +2 -2
- 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/obv3/endorsement.d.ts.map +1 -1
- package/dist/fixtures/obv3/professional-cert.d.ts.map +1 -1
- package/package.json +4 -4
- 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/obv3/endorsement.ts +1 -0
- package/src/fixtures/obv3/professional-cert.ts +5 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"community-award.d.ts","sourceRoot":"","sources":["../../../src/fixtures/boost/community-award.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAErD,eAAO,MAAM,mBAAmB,EAAE,
|
|
1
|
+
{"version":3,"file":"community-award.d.ts","sourceRoot":"","sources":["../../../src/fixtures/boost/community-award.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAErD,eAAO,MAAM,mBAAmB,EAAE,iBA+FjC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delegate.d.ts","sourceRoot":"","sources":["../../../src/fixtures/boost/delegate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAErD,eAAO,MAAM,aAAa,EAAE,
|
|
1
|
+
{"version":3,"file":"delegate.d.ts","sourceRoot":"","sources":["../../../src/fixtures/boost/delegate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAErD,eAAO,MAAM,aAAa,EAAE,iBA0D3B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"westbridge-full.d.ts","sourceRoot":"","sources":["../../../src/fixtures/clr/westbridge-full.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAErD,eAAO,MAAM,iBAAiB,EAAE,
|
|
1
|
+
{"version":3,"file":"westbridge-full.d.ts","sourceRoot":"","sources":["../../../src/fixtures/clr/westbridge-full.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAErD,eAAO,MAAM,iBAAiB,EAAE,iBAk+E/B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"endorsement.d.ts","sourceRoot":"","sources":["../../../src/fixtures/obv3/endorsement.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAErD,eAAO,MAAM,yBAAyB,EAAE,
|
|
1
|
+
{"version":3,"file":"endorsement.d.ts","sourceRoot":"","sources":["../../../src/fixtures/obv3/endorsement.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAErD,eAAO,MAAM,yBAAyB,EAAE,iBAwDvC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"professional-cert.d.ts","sourceRoot":"","sources":["../../../src/fixtures/obv3/professional-cert.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAErD,eAAO,MAAM,oBAAoB,EAAE,
|
|
1
|
+
{"version":3,"file":"professional-cert.d.ts","sourceRoot":"","sources":["../../../src/fixtures/obv3/professional-cert.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAErD,eAAO,MAAM,oBAAoB,EAAE,iBAsGlC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@learncard/credential-library",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.15",
|
|
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",
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
"url": "https://github.com/learningeconomy/LearnCard/issues"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"@learncard/didkit-plugin": "1.9.
|
|
28
|
-
"@learncard/init": "2.4.
|
|
27
|
+
"@learncard/didkit-plugin": "1.9.9",
|
|
28
|
+
"@learncard/init": "2.4.10",
|
|
29
29
|
"@types/node": "^17.0.38",
|
|
30
30
|
"esbuild": "^0.27.1",
|
|
31
31
|
"shx": "^0.3.4",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"vitest": "^1.6.0"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@learncard/types": "5.
|
|
36
|
+
"@learncard/types": "5.18.1",
|
|
37
37
|
"zod": "4.1.13"
|
|
38
38
|
},
|
|
39
39
|
"types": "./dist/index.d.ts",
|
|
@@ -4,7 +4,7 @@ import { describe, it, expect, beforeAll } from 'vitest';
|
|
|
4
4
|
|
|
5
5
|
import { initLearnCard } from '@learncard/init';
|
|
6
6
|
|
|
7
|
-
import { getAllFixtures, prepareFixture } from '../index';
|
|
7
|
+
import { getAllFixtures, getFixture, prepareFixture } from '../index';
|
|
8
8
|
|
|
9
9
|
import type { CredentialFixture } from '../types';
|
|
10
10
|
|
|
@@ -34,18 +34,36 @@ describe('Credential issuance', () => {
|
|
|
34
34
|
getAllFixtures().filter(f => f.validity === 'valid');
|
|
35
35
|
|
|
36
36
|
describe('issueCredential succeeds for all valid fixtures', () => {
|
|
37
|
-
it.each(
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
37
|
+
it.each(validFixtures().map(f => [f.id, f] as const))(
|
|
38
|
+
'%s',
|
|
39
|
+
async (_id, fixture) => {
|
|
40
|
+
const prepared = prepareFixture(fixture, {
|
|
41
|
+
issuerDid,
|
|
42
|
+
subjectDid: 'did:example:test-subject-123',
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
const signed = await wallet.invoke.issueCredential(prepared);
|
|
46
|
+
|
|
47
|
+
expect(signed).toBeDefined();
|
|
48
|
+
expect((signed as Record<string, unknown>).proof).toBeDefined();
|
|
49
|
+
},
|
|
50
|
+
15_000
|
|
51
|
+
);
|
|
50
52
|
});
|
|
53
|
+
|
|
54
|
+
it('issues the full CLR fixture without remote contexts', async () => {
|
|
55
|
+
const offlineWallet = await initLearnCard({
|
|
56
|
+
seed: 'b'.repeat(64),
|
|
57
|
+
didkit,
|
|
58
|
+
allowRemoteContexts: false,
|
|
59
|
+
});
|
|
60
|
+
const fixture = getFixture('clr/westbridge-full');
|
|
61
|
+
const prepared = prepareFixture(fixture, {
|
|
62
|
+
issuerDid: offlineWallet.id.did(),
|
|
63
|
+
subjectDid: 'did:example:test-subject-123',
|
|
64
|
+
});
|
|
65
|
+
const signed = await offlineWallet.invoke.issueCredential(prepared);
|
|
66
|
+
|
|
67
|
+
expect(signed.proof).toBeDefined();
|
|
68
|
+
}, 30_000);
|
|
51
69
|
});
|
|
@@ -17,6 +17,7 @@ export const boostCommunityAward: CredentialFixture = {
|
|
|
17
17
|
'@context': [
|
|
18
18
|
'https://www.w3.org/ns/credentials/v2',
|
|
19
19
|
'https://purl.imsglobal.org/spec/ob/v3p0/context-3.0.3.json',
|
|
20
|
+
'https://ctx.learncard.com/boosts/1.0.3.json',
|
|
20
21
|
],
|
|
21
22
|
id: 'urn:uuid:d8c4f2a1-3b67-4e89-a1d0-5f9e7c2b8a43',
|
|
22
23
|
type: ['VerifiableCredential', 'OpenBadgeCredential', 'BoostCredential'],
|
|
@@ -53,7 +54,8 @@ export const boostCommunityAward: CredentialFixture = {
|
|
|
53
54
|
type: ['Profile'],
|
|
54
55
|
name: 'LearnCard Community Hub',
|
|
55
56
|
url: 'https://network.learncard.com/organizations/community-hub',
|
|
56
|
-
description:
|
|
57
|
+
description:
|
|
58
|
+
'The LearnCard Community Hub connects learners, educators, and community leaders.',
|
|
57
59
|
},
|
|
58
60
|
tag: [
|
|
59
61
|
'leadership',
|
|
@@ -17,6 +17,7 @@ export const boostDelegate: CredentialFixture = {
|
|
|
17
17
|
'@context': [
|
|
18
18
|
'https://www.w3.org/ns/credentials/v2',
|
|
19
19
|
'https://purl.imsglobal.org/spec/ob/v3p0/context-3.0.3.json',
|
|
20
|
+
'https://ctx.learncard.com/boosts/1.0.3.json',
|
|
20
21
|
],
|
|
21
22
|
id: 'urn:uuid:e7b3d1f4-9a26-4c58-b0d3-8f1e2c7a9b56',
|
|
22
23
|
type: ['VerifiableCredential', 'OpenBadgeCredential', 'BoostCredential'],
|
|
@@ -26,7 +26,9 @@ export const clrWestbridgeFull: CredentialFixture = {
|
|
|
26
26
|
'@context': [
|
|
27
27
|
'https://www.w3.org/ns/credentials/v2',
|
|
28
28
|
'https://purl.imsglobal.org/spec/ob/v3p0/context-3.0.3.json',
|
|
29
|
-
'https://purl.imsglobal.org/spec/clr/v2p0/context
|
|
29
|
+
'https://purl.imsglobal.org/spec/clr/v2p0/context.json',
|
|
30
|
+
'https://purl.imsglobal.org/spec/ob/v3p0/extensions.json',
|
|
31
|
+
{ IssuerPolicy: 'https://westbridge.edu/credentials#IssuerPolicy' },
|
|
30
32
|
],
|
|
31
33
|
id: 'urn:uuid:wb-clr-2025-jordan-reyes-001',
|
|
32
34
|
type: ['VerifiableCredential', 'ClrCredential'],
|
|
@@ -100,6 +102,13 @@ export const clrWestbridgeFull: CredentialFixture = {
|
|
|
100
102
|
},
|
|
101
103
|
],
|
|
102
104
|
credentialSubject: {
|
|
105
|
+
// CLR v2's ClrSubject scoped context omits the Open Badges identifier term.
|
|
106
|
+
'@context': {
|
|
107
|
+
identifier: {
|
|
108
|
+
'@id': 'https://purl.imsglobal.org/spec/vc/ob/vocab.html#identifier',
|
|
109
|
+
'@container': '@set',
|
|
110
|
+
},
|
|
111
|
+
},
|
|
103
112
|
id: 'did:example:wb-student-2025-001',
|
|
104
113
|
type: ['ClrSubject'],
|
|
105
114
|
identifier: [
|
|
@@ -17,6 +17,7 @@ export const obv3EndorsementCredential: CredentialFixture = {
|
|
|
17
17
|
'@context': [
|
|
18
18
|
'https://www.w3.org/ns/credentials/v2',
|
|
19
19
|
'https://purl.imsglobal.org/spec/ob/v3p0/context-3.0.3.json',
|
|
20
|
+
'https://purl.imsglobal.org/spec/ob/v3p0/extensions.json',
|
|
20
21
|
],
|
|
21
22
|
id: 'urn:uuid:a1b2c3d4-5e6f-7a8b-9c0d-1e2f3a4b5c6d',
|
|
22
23
|
type: ['VerifiableCredential', 'EndorsementCredential'],
|
|
@@ -17,6 +17,7 @@ export const obv3ProfessionalCert: CredentialFixture = {
|
|
|
17
17
|
'@context': [
|
|
18
18
|
'https://www.w3.org/ns/credentials/v2',
|
|
19
19
|
'https://purl.imsglobal.org/spec/ob/v3p0/context-3.0.3.json',
|
|
20
|
+
'https://purl.imsglobal.org/spec/ob/v3p0/extensions.json',
|
|
20
21
|
],
|
|
21
22
|
id: 'urn:uuid:b34ca6cd-29d7-4b2f-9e99-4902fd84c5a1',
|
|
22
23
|
type: ['VerifiableCredential', 'OpenBadgeCredential'],
|
|
@@ -60,7 +61,8 @@ export const obv3ProfessionalCert: CredentialFixture = {
|
|
|
60
61
|
{
|
|
61
62
|
type: ['Alignment'],
|
|
62
63
|
targetName: 'Cloud Solutions Architect',
|
|
63
|
-
targetUrl:
|
|
64
|
+
targetUrl:
|
|
65
|
+
'https://credentialengineregistry.org/resources/ce-cloud-arch-001',
|
|
64
66
|
targetDescription:
|
|
65
67
|
'Design and implement cloud infrastructure solutions that meet business requirements.',
|
|
66
68
|
targetFramework: 'Credential Engine Cloud Computing Competency Framework',
|
|
@@ -69,7 +71,8 @@ export const obv3ProfessionalCert: CredentialFixture = {
|
|
|
69
71
|
{
|
|
70
72
|
type: ['Alignment'],
|
|
71
73
|
targetName: 'Information Technology – Cloud Computing',
|
|
72
|
-
targetUrl:
|
|
74
|
+
targetUrl:
|
|
75
|
+
'https://nces.ed.gov/ipeds/cipcode/cipdetail.aspx?y=56&cipid=91456',
|
|
73
76
|
targetDescription: 'CIP Code 11.0902 – Cloud Computing',
|
|
74
77
|
targetFramework: 'Classification of Instructional Programs (CIP)',
|
|
75
78
|
targetType: 'CFItem',
|