@learncard/vc-templates-plugin 1.0.71 → 1.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/vc-templates-plugin.cjs.development.js +24 -27
- package/dist/vc-templates-plugin.cjs.development.js.map +1 -1
- package/dist/vc-templates-plugin.cjs.production.min.js +1 -1
- package/dist/vc-templates-plugin.cjs.production.min.js.map +2 -2
- package/dist/vc-templates-plugin.esm.js +21 -24
- package/dist/vc-templates-plugin.esm.js.map +1 -1
- package/package.json +7 -7
|
@@ -19,15 +19,15 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
19
19
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
20
|
|
|
21
21
|
// src/index.ts
|
|
22
|
-
var
|
|
23
|
-
__export(
|
|
22
|
+
var index_exports = {};
|
|
23
|
+
__export(index_exports, {
|
|
24
24
|
getVCTemplatesPlugin: () => getVCTemplatesPlugin
|
|
25
25
|
});
|
|
26
|
-
module.exports = __toCommonJS(
|
|
26
|
+
module.exports = __toCommonJS(index_exports);
|
|
27
27
|
|
|
28
28
|
// src/templates.ts
|
|
29
29
|
var VC_TEMPLATES = {
|
|
30
|
-
basic: ({
|
|
30
|
+
basic: /* @__PURE__ */ __name(({
|
|
31
31
|
did = "did:example:d23dd687a7dc6787646f2eb98d0",
|
|
32
32
|
subject = "did:example:d23dd687a7dc6787646f2eb98d0",
|
|
33
33
|
issuanceDate = "2020-08-19T21:41:50Z"
|
|
@@ -38,8 +38,8 @@ var VC_TEMPLATES = {
|
|
|
38
38
|
issuer: did,
|
|
39
39
|
validFrom: issuanceDate,
|
|
40
40
|
credentialSubject: { id: subject }
|
|
41
|
-
}),
|
|
42
|
-
achievement: ({
|
|
41
|
+
}), "basic"),
|
|
42
|
+
achievement: /* @__PURE__ */ __name(({
|
|
43
43
|
did = "did:example:d23dd687a7dc6787646f2eb98d0",
|
|
44
44
|
subject = "did:example:d23dd687a7dc6787646f2eb98d0",
|
|
45
45
|
name = "Teamwork Badge",
|
|
@@ -68,8 +68,8 @@ var VC_TEMPLATES = {
|
|
|
68
68
|
name: achievementName
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
|
-
}),
|
|
72
|
-
jff2: ({
|
|
71
|
+
}), "achievement"),
|
|
72
|
+
jff2: /* @__PURE__ */ __name(({
|
|
73
73
|
did = "did:example:d23dd687a7dc6787646f2eb98d0",
|
|
74
74
|
subject = "did:example:d23dd687a7dc6787646f2eb98d0",
|
|
75
75
|
issuanceDate = "2020-08-19T21:41:50Z"
|
|
@@ -109,8 +109,8 @@ var VC_TEMPLATES = {
|
|
|
109
109
|
}
|
|
110
110
|
}
|
|
111
111
|
}
|
|
112
|
-
}),
|
|
113
|
-
boost: ({
|
|
112
|
+
}), "jff2"),
|
|
113
|
+
boost: /* @__PURE__ */ __name(({
|
|
114
114
|
did = "did:example:d23dd687a7dc6787646f2eb98d0",
|
|
115
115
|
subject = "did:example:d23dd687a7dc6787646f2eb98d0",
|
|
116
116
|
issuanceDate = "2020-08-19T21:41:50Z",
|
|
@@ -176,8 +176,8 @@ var VC_TEMPLATES = {
|
|
|
176
176
|
attachments,
|
|
177
177
|
skills,
|
|
178
178
|
groupID
|
|
179
|
-
}),
|
|
180
|
-
boostID: ({
|
|
179
|
+
}), "boost"),
|
|
180
|
+
boostID: /* @__PURE__ */ __name(({
|
|
181
181
|
did = "did:example:d23dd687a7dc6787646f2eb98d0",
|
|
182
182
|
subject = "did:example:d23dd687a7dc6787646f2eb98d0",
|
|
183
183
|
issuanceDate = "2020-08-19T21:41:50Z",
|
|
@@ -255,11 +255,11 @@ var VC_TEMPLATES = {
|
|
|
255
255
|
skills,
|
|
256
256
|
boostID,
|
|
257
257
|
groupID
|
|
258
|
-
}),
|
|
259
|
-
delegate: ({
|
|
258
|
+
}), "boostID"),
|
|
259
|
+
delegate: /* @__PURE__ */ __name(({
|
|
260
260
|
did = "did:example:d23dd687a7dc6787646f2eb98d0",
|
|
261
261
|
subject = "did:example:d23dd687a7dc6787646f2eb98d0",
|
|
262
|
-
issuanceDate = new Date().toISOString(),
|
|
262
|
+
issuanceDate = (/* @__PURE__ */ new Date()).toISOString(),
|
|
263
263
|
access = ["read"]
|
|
264
264
|
} = {}, crypto) => ({
|
|
265
265
|
"@context": [
|
|
@@ -272,7 +272,7 @@ var VC_TEMPLATES = {
|
|
|
272
272
|
validFrom: issuanceDate,
|
|
273
273
|
credentialSubject: { id: subject },
|
|
274
274
|
permissions: { statementAccess: access }
|
|
275
|
-
})
|
|
275
|
+
}), "delegate")
|
|
276
276
|
};
|
|
277
277
|
|
|
278
278
|
// src/vc-templates.ts
|
|
@@ -282,34 +282,31 @@ var getVCTemplatesPlugin = /* @__PURE__ */ __name(() => {
|
|
|
282
282
|
displayName: "VC Templates",
|
|
283
283
|
description: "Allows for the easy creation of VCs and VPs based on predefined templates",
|
|
284
284
|
methods: {
|
|
285
|
-
newCredential: (_learnCard, args = { type: "basic" }) => {
|
|
285
|
+
newCredential: /* @__PURE__ */ __name((_learnCard, args = { type: "basic" }) => {
|
|
286
286
|
const did = args.did || _learnCard.id.did();
|
|
287
|
-
if (!did)
|
|
288
|
-
throw new Error("Could not get issuer did!");
|
|
287
|
+
if (!did) throw new Error("Could not get issuer did!");
|
|
289
288
|
const defaults = {
|
|
290
289
|
did,
|
|
291
290
|
subject: "did:example:d23dd687a7dc6787646f2eb98d0",
|
|
292
|
-
issuanceDate: new Date().toISOString()
|
|
291
|
+
issuanceDate: (/* @__PURE__ */ new Date()).toISOString()
|
|
293
292
|
};
|
|
294
293
|
const { type = "basic", ...functionArgs } = args;
|
|
295
|
-
if (!(type in VC_TEMPLATES))
|
|
296
|
-
throw new Error("Invalid Test VC Type!");
|
|
294
|
+
if (!(type in VC_TEMPLATES)) throw new Error("Invalid Test VC Type!");
|
|
297
295
|
return VC_TEMPLATES[type](
|
|
298
296
|
{ ...defaults, ...functionArgs },
|
|
299
297
|
_learnCard.invoke.crypto()
|
|
300
298
|
);
|
|
301
|
-
},
|
|
302
|
-
newPresentation: async (_learnCard, credential, args = {}) => {
|
|
299
|
+
}, "newCredential"),
|
|
300
|
+
newPresentation: /* @__PURE__ */ __name(async (_learnCard, credential, args = {}) => {
|
|
303
301
|
const did = args?.did || _learnCard.id.did();
|
|
304
|
-
if (!did)
|
|
305
|
-
throw new Error("Could not get issuer did!");
|
|
302
|
+
if (!did) throw new Error("Could not get issuer did!");
|
|
306
303
|
return {
|
|
307
304
|
"@context": ["https://www.w3.org/ns/credentials/v2"],
|
|
308
305
|
type: ["VerifiablePresentation"],
|
|
309
306
|
holder: did,
|
|
310
307
|
verifiableCredential: credential
|
|
311
308
|
};
|
|
312
|
-
}
|
|
309
|
+
}, "newPresentation")
|
|
313
310
|
}
|
|
314
311
|
};
|
|
315
312
|
}, "getVCTemplatesPlugin");
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/index.ts", "../src/templates.ts", "../src/vc-templates.ts"],
|
|
4
4
|
"sourcesContent": ["export { getVCTemplatesPlugin } from './vc-templates';\nexport * from './types';\n", "import { UnsignedVC, UnsignedAchievementCredential } from '@learncard/types';\n\nimport { VcTemplates } from './types';\n\n/** @group VC Templates Plugin */\nexport const VC_TEMPLATES: {\n [Key in keyof VcTemplates]: (args: VcTemplates[Key], crypto: Crypto) => UnsignedVC;\n} = {\n basic: (\n {\n did = 'did:example:d23dd687a7dc6787646f2eb98d0',\n subject = 'did:example:d23dd687a7dc6787646f2eb98d0',\n issuanceDate = '2020-08-19T21:41:50Z',\n } = {},\n crypto\n ) => ({\n '@context': ['https://www.w3.org/ns/credentials/v2'],\n id: `urn:uuid:${crypto.randomUUID()}`,\n type: ['VerifiableCredential'],\n issuer: did,\n validFrom: issuanceDate,\n credentialSubject: { id: subject },\n }),\n achievement: (\n {\n did = 'did:example:d23dd687a7dc6787646f2eb98d0',\n subject = 'did:example:d23dd687a7dc6787646f2eb98d0',\n name = 'Teamwork Badge',\n achievementName = 'Teamwork',\n description = 'This badge recognizes the development of the capacity to collaborate within a group environment.',\n criteriaNarrative = 'Team members are nominated for this badge by their peers and recognized upon review by Example Corp management.',\n issuanceDate = '2020-08-19T21:41:50Z',\n } = {},\n crypto\n ): UnsignedAchievementCredential => ({\n '@context': [\n 'https://www.w3.org/ns/credentials/v2',\n 'https://purl.imsglobal.org/spec/ob/v3p0/context-3.0.3.json',\n ],\n id: `urn:uuid:${crypto.randomUUID()}`,\n type: ['VerifiableCredential', 'OpenBadgeCredential'],\n issuer: { id: did },\n validFrom: issuanceDate,\n name,\n credentialSubject: {\n id: subject,\n type: ['AchievementSubject'],\n achievement: {\n id: `urn:uuid:${crypto.randomUUID()}`,\n type: ['Achievement'],\n criteria: { narrative: criteriaNarrative },\n description,\n name: achievementName,\n },\n },\n }),\n jff2: (\n {\n did = 'did:example:d23dd687a7dc6787646f2eb98d0',\n subject = 'did:example:d23dd687a7dc6787646f2eb98d0',\n issuanceDate = '2020-08-19T21:41:50Z',\n } = {},\n crypto\n ) => ({\n '@context': [\n 'https://www.w3.org/2018/credentials/v1',\n 'https://purl.imsglobal.org/spec/ob/v3p0/context.json',\n 'https://w3id.org/security/suites/ed25519-2020/v1',\n ],\n id: `urn:uuid:${crypto.randomUUID()}`,\n type: ['VerifiableCredential', 'OpenBadgeCredential'],\n name: 'JFF x vc-edu PlugFest 2 Interoperability',\n issuer: {\n type: ['Profile'],\n id: did,\n name: 'Jobs for the Future (JFF)',\n image: {\n id: 'https://w3c-ccg.github.io/vc-ed/plugfest-1-2022/images/JFF_LogoLockup.png',\n type: 'Image',\n },\n },\n issuanceDate: issuanceDate,\n credentialSubject: {\n type: ['AchievementSubject'],\n id: subject,\n achievement: {\n id: `urn:uuid:${crypto.randomUUID()}`,\n type: ['Achievement'],\n name: 'JFF x vc-edu PlugFest 2 Interoperability',\n description:\n 'This credential solution supports the use of OBv3 and w3c Verifiable Credentials and is interoperable with at least two other solutions. This was demonstrated successfully during JFF x vc-edu PlugFest 2.',\n criteria: {\n narrative:\n 'Solutions providers earned this badge by demonstrating interoperability between multiple providers based on the OBv3 candidate final standard, with some additional required fields. Credential issuers earning this badge successfully issued a credential into at least two wallets. Wallet implementers earning this badge successfully displayed credentials issued by at least two different credential issuers.',\n },\n image: {\n id: 'https://w3c-ccg.github.io/vc-ed/plugfest-2-2022/images/JFF-VC-EDU-PLUGFEST2-badge-image.png',\n type: 'Image',\n },\n },\n },\n }),\n boost: (\n {\n did = 'did:example:d23dd687a7dc6787646f2eb98d0',\n subject = 'did:example:d23dd687a7dc6787646f2eb98d0',\n issuanceDate = '2020-08-19T21:41:50Z',\n expirationDate,\n boostName = 'Example Boost',\n boostImage,\n achievementId,\n achievementType = 'Influencer',\n achievementName = 'Awesome Badge',\n achievementDescription = 'Awesome People Earn Awesome Badge',\n achievementNarrative = 'Earned by being awesome.',\n achievementImage = '',\n attachments,\n display,\n familyTitles,\n skills,\n groupID = '',\n evidence = [],\n alignment,\n source,\n } = {},\n crypto\n ) => ({\n '@context': [\n 'https://www.w3.org/ns/credentials/v2',\n 'https://purl.imsglobal.org/spec/ob/v3p0/context-3.0.3.json',\n 'https://ctx.learncard.com/boosts/1.0.3.json',\n ],\n type: ['VerifiableCredential', 'OpenBadgeCredential', 'BoostCredential'],\n id: `urn:uuid:${crypto.randomUUID()}`,\n issuer: { id: did },\n validFrom: issuanceDate,\n ...(expirationDate && { validUntil: expirationDate }),\n name: boostName,\n credentialSubject: {\n id: subject,\n type: ['AchievementSubject'],\n achievement: {\n id: achievementId ?? `urn:uuid:${crypto.randomUUID()}`,\n type: ['Achievement'],\n achievementType: achievementType,\n name: achievementName,\n description: achievementDescription,\n image: achievementImage,\n criteria: {\n narrative: achievementNarrative,\n },\n ...(alignment && { alignment }),\n },\n ...(source && { source }),\n },\n ...(Array.isArray(evidence) &&\n evidence.length > 0 && {\n evidence: evidence.map(e => ({\n ...e,\n type: e.type?.includes('EvidenceFile')\n ? e.type\n : [\n 'Evidence',\n 'EvidenceFile',\n ...(e.type?.filter(t => t !== 'Evidence') || []),\n ],\n })),\n }),\n display,\n familyTitles,\n image: boostImage,\n attachments,\n skills,\n groupID,\n }),\n boostID: (\n {\n did = 'did:example:d23dd687a7dc6787646f2eb98d0',\n subject = 'did:example:d23dd687a7dc6787646f2eb98d0',\n issuanceDate = '2020-08-19T21:41:50Z',\n expirationDate,\n boostName = 'Example Boost',\n boostImage,\n achievementId,\n achievementType = 'Influencer',\n achievementName = 'Awesome Badge',\n achievementDescription = 'Awesome People Earn Awesome Badge',\n achievementNarrative = 'Earned by being awesome.',\n achievementImage = '',\n address,\n attachments,\n skills,\n display,\n familyTitles,\n boostID,\n groupID = '',\n evidence = [],\n alignment,\n source,\n } = {},\n crypto\n ) => ({\n '@context': [\n 'https://www.w3.org/ns/credentials/v2',\n 'https://purl.imsglobal.org/spec/ob/v3p0/context-3.0.3.json',\n 'https://ctx.learncard.com/boosts/1.0.3.json',\n 'https://ctx.learncard.com/boostIDs/1.0.0.json',\n ],\n type: ['VerifiableCredential', 'OpenBadgeCredential', 'BoostCredential', 'BoostID'],\n id: `urn:uuid:${crypto.randomUUID()}`,\n issuer: { id: did },\n validFrom: issuanceDate,\n ...(expirationDate && { validUntil: expirationDate }),\n name: boostName,\n credentialSubject: {\n id: subject,\n type: ['AchievementSubject'],\n achievement: {\n id: achievementId ?? `urn:uuid:${crypto.randomUUID()}`,\n type: ['Achievement'],\n achievementType: achievementType,\n name: achievementName,\n description: achievementDescription,\n image: achievementImage,\n criteria: {\n narrative: achievementNarrative,\n },\n ...(alignment && { alignment }),\n },\n ...(source && { source }),\n },\n ...(Array.isArray(evidence) && evidence.length > 0 && { evidence }),\n ...(address\n ? {\n address: {\n type: ['Address'],\n ...address,\n ...(address.geo ? { geo: { type: ['GeoCoordinates'], ...address.geo } } : {}),\n },\n }\n : {}),\n ...(Array.isArray(evidence) &&\n evidence.length > 0 && {\n evidence: evidence.map(e => ({\n ...e,\n type: e.type?.includes('EvidenceFile')\n ? e.type\n : [\n 'Evidence',\n 'EvidenceFile',\n ...(e.type?.filter(t => t !== 'Evidence') || []),\n ],\n })),\n }),\n display,\n familyTitles,\n image: boostImage,\n attachments,\n skills,\n boostID,\n groupID,\n }),\n delegate: (\n {\n did = 'did:example:d23dd687a7dc6787646f2eb98d0',\n subject = 'did:example:d23dd687a7dc6787646f2eb98d0',\n issuanceDate = new Date().toISOString(),\n access = ['read'],\n } = {},\n crypto\n ) => ({\n '@context': [\n 'https://www.w3.org/ns/credentials/v2',\n 'https://ctx.learncard.com/delegates/1.0.0.json',\n ],\n type: ['VerifiableCredential', 'DelegateCredential'],\n id: `urn:uuid:${crypto.randomUUID()}`,\n issuer: { id: did },\n validFrom: issuanceDate,\n credentialSubject: { id: subject },\n permissions: { statementAccess: access },\n }),\n};\n", "import { VC_TEMPLATES } from './templates';\n\nimport { VCTemplatePlugin } from './types';\n\n/**\n * @group Plugins\n */\nexport const getVCTemplatesPlugin = (): VCTemplatePlugin => {\n return {\n name: 'VC Templates',\n displayName: 'VC Templates',\n description: 'Allows for the easy creation of VCs and VPs based on predefined templates',\n methods: {\n newCredential: (_learnCard, args = { type: 'basic' }) => {\n const did = args.did || _learnCard.id.did();\n\n if (!did) throw new Error('Could not get issuer did!');\n\n const defaults = {\n did,\n subject: 'did:example:d23dd687a7dc6787646f2eb98d0',\n issuanceDate: new Date().toISOString(),\n };\n\n const { type = 'basic', ...functionArgs } = args;\n\n if (!(type in VC_TEMPLATES)) throw new Error('Invalid Test VC Type!');\n\n return VC_TEMPLATES[type](\n { ...defaults, ...functionArgs },\n _learnCard.invoke.crypto()\n );\n },\n newPresentation: async (_learnCard, credential, args = {}) => {\n const did = args?.did || _learnCard.id.did();\n\n if (!did) throw new Error('Could not get issuer did!');\n\n return {\n '@context': ['https://www.w3.org/ns/credentials/v2'],\n type: ['VerifiablePresentation'],\n holder: did,\n verifiableCredential: credential,\n };\n },\n },\n };\n};\n"],
|
|
5
|
-
"mappings": ";;;;;;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AAiB,8BAAO,YAAY,YAAY,OAAO,CAAC,MAAM;AAC1D,cAAM,MAAM,MAAM,OAAO,WAAW,GAAG,IAAI;AAE3C,YAAI,CAAC,IAAK,OAAM,IAAI,MAAM,2BAA2B;AAErD,eAAO;AAAA,UACH,YAAY,CAAC,sCAAsC;AAAA,UACnD,MAAM,CAAC,wBAAwB;AAAA,UAC/B,QAAQ;AAAA,UACR,sBAAsB;AAAA,QAC1B;AAAA,MACJ,GAXiB;AAAA,IAYrB;AAAA,EACJ;AACJ,GAxCoC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var w=Object.defineProperty;var I=Object.getOwnPropertyDescriptor;var j=Object.getOwnPropertyNames;var S=Object.prototype.hasOwnProperty;var n=(t,e)=>w(t,"name",{value:e,configurable:!0});var D=(t,e)=>{for(var d in e)w(t,d,{get:e[d],enumerable:!0})},B=(t,e,d,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of j(e))!S.call(t,a)&&a!==d&&w(t,a,{get:()=>e[a],enumerable:!(i=I(e,a))||i.enumerable});return t};var P=t=>B(w({},"__esModule",{value:!0}),t);var $={};D($,{getVCTemplatesPlugin:()=>V});module.exports=P($);var F={basic:n(({did:t="did:example:d23dd687a7dc6787646f2eb98d0",subject:e="did:example:d23dd687a7dc6787646f2eb98d0",issuanceDate:d="2020-08-19T21:41:50Z"}={},i)=>({"@context":["https://www.w3.org/ns/credentials/v2"],id:`urn:uuid:${i.randomUUID()}`,type:["VerifiableCredential"],issuer:t,validFrom:d,credentialSubject:{id:e}}),"basic"),achievement:n(({did:t="did:example:d23dd687a7dc6787646f2eb98d0",subject:e="did:example:d23dd687a7dc6787646f2eb98d0",name:d="Teamwork Badge",achievementName:i="Teamwork",description:a="This badge recognizes the development of the capacity to collaborate within a group environment.",criteriaNarrative:s="Team members are nominated for this badge by their peers and recognized upon review by Example Corp management.",issuanceDate:p="2020-08-19T21:41:50Z"}={},l)=>({"@context":["https://www.w3.org/ns/credentials/v2","https://purl.imsglobal.org/spec/ob/v3p0/context-3.0.3.json"],id:`urn:uuid:${l.randomUUID()}`,type:["VerifiableCredential","OpenBadgeCredential"],issuer:{id:t},validFrom:p,name:d,credentialSubject:{id:e,type:["AchievementSubject"],achievement:{id:`urn:uuid:${l.randomUUID()}`,type:["Achievement"],criteria:{narrative:s},description:a,name:i}}}),"achievement"),jff2:n(({did:t="did:example:d23dd687a7dc6787646f2eb98d0",subject:e="did:example:d23dd687a7dc6787646f2eb98d0",issuanceDate:d="2020-08-19T21:41:50Z"}={},i)=>({"@context":["https://www.w3.org/2018/credentials/v1","https://purl.imsglobal.org/spec/ob/v3p0/context.json","https://w3id.org/security/suites/ed25519-2020/v1"],id:`urn:uuid:${i.randomUUID()}`,type:["VerifiableCredential","OpenBadgeCredential"],name:"JFF x vc-edu PlugFest 2 Interoperability",issuer:{type:["Profile"],id:t,name:"Jobs for the Future (JFF)",image:{id:"https://w3c-ccg.github.io/vc-ed/plugfest-1-2022/images/JFF_LogoLockup.png",type:"Image"}},issuanceDate:d,credentialSubject:{type:["AchievementSubject"],id:e,achievement:{id:`urn:uuid:${i.randomUUID()}`,type:["Achievement"],name:"JFF x vc-edu PlugFest 2 Interoperability",description:"This credential solution supports the use of OBv3 and w3c Verifiable Credentials and is interoperable with at least two other solutions. This was demonstrated successfully during JFF x vc-edu PlugFest 2.",criteria:{narrative:"Solutions providers earned this badge by demonstrating interoperability between multiple providers based on the OBv3 candidate final standard, with some additional required fields. Credential issuers earning this badge successfully issued a credential into at least two wallets. Wallet implementers earning this badge successfully displayed credentials issued by at least two different credential issuers."},image:{id:"https://w3c-ccg.github.io/vc-ed/plugfest-2-2022/images/JFF-VC-EDU-PLUGFEST2-badge-image.png",type:"Image"}}}}),"jff2"),boost:n(({did:t="did:example:d23dd687a7dc6787646f2eb98d0",subject:e="did:example:d23dd687a7dc6787646f2eb98d0",issuanceDate:d="2020-08-19T21:41:50Z",expirationDate:i,boostName:a="Example Boost",boostImage:s,achievementId:p,achievementType:l="Influencer",achievementName:y="Awesome Badge",achievementDescription:v="Awesome People Earn Awesome Badge",achievementNarrative:f="Earned by being awesome.",achievementImage:x="",attachments:c,display:C,familyTitles:T,skills:A,groupID:U="",evidence:m=[],alignment:g,source:r}={},u)=>({"@context":["https://www.w3.org/ns/credentials/v2","https://purl.imsglobal.org/spec/ob/v3p0/context-3.0.3.json","https://ctx.learncard.com/boosts/1.0.3.json"],type:["VerifiableCredential","OpenBadgeCredential","BoostCredential"],id:`urn:uuid:${u.randomUUID()}`,issuer:{id:t},validFrom:d,...i&&{validUntil:i},name:a,credentialSubject:{id:e,type:["AchievementSubject"],achievement:{id:p??`urn:uuid:${u.randomUUID()}`,type:["Achievement"],achievementType:l,name:y,description:v,image:x,criteria:{narrative:f},...g&&{alignment:g}},...r&&{source:r}},...Array.isArray(m)&&m.length>0&&{evidence:m.map(o=>({...o,type:o.type?.includes("EvidenceFile")?o.type:["Evidence","EvidenceFile",...o.type?.filter(b=>b!=="Evidence")||[]]}))},display:C,familyTitles:T,image:s,attachments:c,skills:A,groupID:U}),"boost"),boostID:n(({did:t="did:example:d23dd687a7dc6787646f2eb98d0",subject:e="did:example:d23dd687a7dc6787646f2eb98d0",issuanceDate:d="2020-08-19T21:41:50Z",expirationDate:i,boostName:a="Example Boost",boostImage:s,achievementId:p,achievementType:l="Influencer",achievementName:y="Awesome Badge",achievementDescription:v="Awesome People Earn Awesome Badge",achievementNarrative:f="Earned by being awesome.",achievementImage:x="",address:c,attachments:C,skills:T,display:A,familyTitles:U,boostID:m,groupID:g="",evidence:r=[],alignment:u,source:o}={},b)=>({"@context":["https://www.w3.org/ns/credentials/v2","https://purl.imsglobal.org/spec/ob/v3p0/context-3.0.3.json","https://ctx.learncard.com/boosts/1.0.3.json","https://ctx.learncard.com/boostIDs/1.0.0.json"],type:["VerifiableCredential","OpenBadgeCredential","BoostCredential","BoostID"],id:`urn:uuid:${b.randomUUID()}`,issuer:{id:t},validFrom:d,...i&&{validUntil:i},name:a,credentialSubject:{id:e,type:["AchievementSubject"],achievement:{id:p??`urn:uuid:${b.randomUUID()}`,type:["Achievement"],achievementType:l,name:y,description:v,image:x,criteria:{narrative:f},...u&&{alignment:u}},...o&&{source:o}},...Array.isArray(r)&&r.length>0&&{evidence:r},...c?{address:{type:["Address"],...c,...c.geo?{geo:{type:["GeoCoordinates"],...c.geo}}:{}}}:{},...Array.isArray(r)&&r.length>0&&{evidence:r.map(h=>({...h,type:h.type?.includes("EvidenceFile")?h.type:["Evidence","EvidenceFile",...h.type?.filter(E=>E!=="Evidence")||[]]}))},display:A,familyTitles:U,image:s,attachments:C,skills:T,boostID:m,groupID:g}),"boostID"),delegate:n(({did:t="did:example:d23dd687a7dc6787646f2eb98d0",subject:e="did:example:d23dd687a7dc6787646f2eb98d0",issuanceDate:d=new Date().toISOString(),access:i=["read"]}={},a)=>({"@context":["https://www.w3.org/ns/credentials/v2","https://ctx.learncard.com/delegates/1.0.0.json"],type:["VerifiableCredential","DelegateCredential"],id:`urn:uuid:${a.randomUUID()}`,issuer:{id:t},validFrom:d,credentialSubject:{id:e},permissions:{statementAccess:i}}),"delegate")};var V=n(()=>({name:"VC Templates",displayName:"VC Templates",description:"Allows for the easy creation of VCs and VPs based on predefined templates",methods:{newCredential:n((t,e={type:"basic"})=>{let d=e.did||t.id.did();if(!d)throw new Error("Could not get issuer did!");let i={did:d,subject:"did:example:d23dd687a7dc6787646f2eb98d0",issuanceDate:new Date().toISOString()},{type:a="basic",...s}=e;if(!(a in F))throw new Error("Invalid Test VC Type!");return F[a]({...i,...s},t.invoke.crypto())},"newCredential"),newPresentation:n(async(t,e,d={})=>{let i=d?.did||t.id.did();if(!i)throw new Error("Could not get issuer did!");return{"@context":["https://www.w3.org/ns/credentials/v2"],type:["VerifiablePresentation"],holder:i,verifiableCredential:e}},"newPresentation")}}),"getVCTemplatesPlugin");
|
|
2
2
|
//# sourceMappingURL=vc-templates-plugin.cjs.production.min.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/index.ts", "../src/templates.ts", "../src/vc-templates.ts"],
|
|
4
4
|
"sourcesContent": ["export { getVCTemplatesPlugin } from './vc-templates';\nexport * from './types';\n", "import { UnsignedVC, UnsignedAchievementCredential } from '@learncard/types';\n\nimport { VcTemplates } from './types';\n\n/** @group VC Templates Plugin */\nexport const VC_TEMPLATES: {\n [Key in keyof VcTemplates]: (args: VcTemplates[Key], crypto: Crypto) => UnsignedVC;\n} = {\n basic: (\n {\n did = 'did:example:d23dd687a7dc6787646f2eb98d0',\n subject = 'did:example:d23dd687a7dc6787646f2eb98d0',\n issuanceDate = '2020-08-19T21:41:50Z',\n } = {},\n crypto\n ) => ({\n '@context': ['https://www.w3.org/ns/credentials/v2'],\n id: `urn:uuid:${crypto.randomUUID()}`,\n type: ['VerifiableCredential'],\n issuer: did,\n validFrom: issuanceDate,\n credentialSubject: { id: subject },\n }),\n achievement: (\n {\n did = 'did:example:d23dd687a7dc6787646f2eb98d0',\n subject = 'did:example:d23dd687a7dc6787646f2eb98d0',\n name = 'Teamwork Badge',\n achievementName = 'Teamwork',\n description = 'This badge recognizes the development of the capacity to collaborate within a group environment.',\n criteriaNarrative = 'Team members are nominated for this badge by their peers and recognized upon review by Example Corp management.',\n issuanceDate = '2020-08-19T21:41:50Z',\n } = {},\n crypto\n ): UnsignedAchievementCredential => ({\n '@context': [\n 'https://www.w3.org/ns/credentials/v2',\n 'https://purl.imsglobal.org/spec/ob/v3p0/context-3.0.3.json',\n ],\n id: `urn:uuid:${crypto.randomUUID()}`,\n type: ['VerifiableCredential', 'OpenBadgeCredential'],\n issuer: { id: did },\n validFrom: issuanceDate,\n name,\n credentialSubject: {\n id: subject,\n type: ['AchievementSubject'],\n achievement: {\n id: `urn:uuid:${crypto.randomUUID()}`,\n type: ['Achievement'],\n criteria: { narrative: criteriaNarrative },\n description,\n name: achievementName,\n },\n },\n }),\n jff2: (\n {\n did = 'did:example:d23dd687a7dc6787646f2eb98d0',\n subject = 'did:example:d23dd687a7dc6787646f2eb98d0',\n issuanceDate = '2020-08-19T21:41:50Z',\n } = {},\n crypto\n ) => ({\n '@context': [\n 'https://www.w3.org/2018/credentials/v1',\n 'https://purl.imsglobal.org/spec/ob/v3p0/context.json',\n 'https://w3id.org/security/suites/ed25519-2020/v1',\n ],\n id: `urn:uuid:${crypto.randomUUID()}`,\n type: ['VerifiableCredential', 'OpenBadgeCredential'],\n name: 'JFF x vc-edu PlugFest 2 Interoperability',\n issuer: {\n type: ['Profile'],\n id: did,\n name: 'Jobs for the Future (JFF)',\n image: {\n id: 'https://w3c-ccg.github.io/vc-ed/plugfest-1-2022/images/JFF_LogoLockup.png',\n type: 'Image',\n },\n },\n issuanceDate: issuanceDate,\n credentialSubject: {\n type: ['AchievementSubject'],\n id: subject,\n achievement: {\n id: `urn:uuid:${crypto.randomUUID()}`,\n type: ['Achievement'],\n name: 'JFF x vc-edu PlugFest 2 Interoperability',\n description:\n 'This credential solution supports the use of OBv3 and w3c Verifiable Credentials and is interoperable with at least two other solutions. This was demonstrated successfully during JFF x vc-edu PlugFest 2.',\n criteria: {\n narrative:\n 'Solutions providers earned this badge by demonstrating interoperability between multiple providers based on the OBv3 candidate final standard, with some additional required fields. Credential issuers earning this badge successfully issued a credential into at least two wallets. Wallet implementers earning this badge successfully displayed credentials issued by at least two different credential issuers.',\n },\n image: {\n id: 'https://w3c-ccg.github.io/vc-ed/plugfest-2-2022/images/JFF-VC-EDU-PLUGFEST2-badge-image.png',\n type: 'Image',\n },\n },\n },\n }),\n boost: (\n {\n did = 'did:example:d23dd687a7dc6787646f2eb98d0',\n subject = 'did:example:d23dd687a7dc6787646f2eb98d0',\n issuanceDate = '2020-08-19T21:41:50Z',\n expirationDate,\n boostName = 'Example Boost',\n boostImage,\n achievementId,\n achievementType = 'Influencer',\n achievementName = 'Awesome Badge',\n achievementDescription = 'Awesome People Earn Awesome Badge',\n achievementNarrative = 'Earned by being awesome.',\n achievementImage = '',\n attachments,\n display,\n familyTitles,\n skills,\n groupID = '',\n evidence = [],\n alignment,\n source,\n } = {},\n crypto\n ) => ({\n '@context': [\n 'https://www.w3.org/ns/credentials/v2',\n 'https://purl.imsglobal.org/spec/ob/v3p0/context-3.0.3.json',\n 'https://ctx.learncard.com/boosts/1.0.3.json',\n ],\n type: ['VerifiableCredential', 'OpenBadgeCredential', 'BoostCredential'],\n id: `urn:uuid:${crypto.randomUUID()}`,\n issuer: { id: did },\n validFrom: issuanceDate,\n ...(expirationDate && { validUntil: expirationDate }),\n name: boostName,\n credentialSubject: {\n id: subject,\n type: ['AchievementSubject'],\n achievement: {\n id: achievementId ?? `urn:uuid:${crypto.randomUUID()}`,\n type: ['Achievement'],\n achievementType: achievementType,\n name: achievementName,\n description: achievementDescription,\n image: achievementImage,\n criteria: {\n narrative: achievementNarrative,\n },\n ...(alignment && { alignment }),\n },\n ...(source && { source }),\n },\n ...(Array.isArray(evidence) &&\n evidence.length > 0 && {\n evidence: evidence.map(e => ({\n ...e,\n type: e.type?.includes('EvidenceFile')\n ? e.type\n : [\n 'Evidence',\n 'EvidenceFile',\n ...(e.type?.filter(t => t !== 'Evidence') || []),\n ],\n })),\n }),\n display,\n familyTitles,\n image: boostImage,\n attachments,\n skills,\n groupID,\n }),\n boostID: (\n {\n did = 'did:example:d23dd687a7dc6787646f2eb98d0',\n subject = 'did:example:d23dd687a7dc6787646f2eb98d0',\n issuanceDate = '2020-08-19T21:41:50Z',\n expirationDate,\n boostName = 'Example Boost',\n boostImage,\n achievementId,\n achievementType = 'Influencer',\n achievementName = 'Awesome Badge',\n achievementDescription = 'Awesome People Earn Awesome Badge',\n achievementNarrative = 'Earned by being awesome.',\n achievementImage = '',\n address,\n attachments,\n skills,\n display,\n familyTitles,\n boostID,\n groupID = '',\n evidence = [],\n alignment,\n source,\n } = {},\n crypto\n ) => ({\n '@context': [\n 'https://www.w3.org/ns/credentials/v2',\n 'https://purl.imsglobal.org/spec/ob/v3p0/context-3.0.3.json',\n 'https://ctx.learncard.com/boosts/1.0.3.json',\n 'https://ctx.learncard.com/boostIDs/1.0.0.json',\n ],\n type: ['VerifiableCredential', 'OpenBadgeCredential', 'BoostCredential', 'BoostID'],\n id: `urn:uuid:${crypto.randomUUID()}`,\n issuer: { id: did },\n validFrom: issuanceDate,\n ...(expirationDate && { validUntil: expirationDate }),\n name: boostName,\n credentialSubject: {\n id: subject,\n type: ['AchievementSubject'],\n achievement: {\n id: achievementId ?? `urn:uuid:${crypto.randomUUID()}`,\n type: ['Achievement'],\n achievementType: achievementType,\n name: achievementName,\n description: achievementDescription,\n image: achievementImage,\n criteria: {\n narrative: achievementNarrative,\n },\n ...(alignment && { alignment }),\n },\n ...(source && { source }),\n },\n ...(Array.isArray(evidence) && evidence.length > 0 && { evidence }),\n ...(address\n ? {\n address: {\n type: ['Address'],\n ...address,\n ...(address.geo ? { geo: { type: ['GeoCoordinates'], ...address.geo } } : {}),\n },\n }\n : {}),\n ...(Array.isArray(evidence) &&\n evidence.length > 0 && {\n evidence: evidence.map(e => ({\n ...e,\n type: e.type?.includes('EvidenceFile')\n ? e.type\n : [\n 'Evidence',\n 'EvidenceFile',\n ...(e.type?.filter(t => t !== 'Evidence') || []),\n ],\n })),\n }),\n display,\n familyTitles,\n image: boostImage,\n attachments,\n skills,\n boostID,\n groupID,\n }),\n delegate: (\n {\n did = 'did:example:d23dd687a7dc6787646f2eb98d0',\n subject = 'did:example:d23dd687a7dc6787646f2eb98d0',\n issuanceDate = new Date().toISOString(),\n access = ['read'],\n } = {},\n crypto\n ) => ({\n '@context': [\n 'https://www.w3.org/ns/credentials/v2',\n 'https://ctx.learncard.com/delegates/1.0.0.json',\n ],\n type: ['VerifiableCredential', 'DelegateCredential'],\n id: `urn:uuid:${crypto.randomUUID()}`,\n issuer: { id: did },\n validFrom: issuanceDate,\n credentialSubject: { id: subject },\n permissions: { statementAccess: access },\n }),\n};\n", "import { VC_TEMPLATES } from './templates';\n\nimport { VCTemplatePlugin } from './types';\n\n/**\n * @group Plugins\n */\nexport const getVCTemplatesPlugin = (): VCTemplatePlugin => {\n return {\n name: 'VC Templates',\n displayName: 'VC Templates',\n description: 'Allows for the easy creation of VCs and VPs based on predefined templates',\n methods: {\n newCredential: (_learnCard, args = { type: 'basic' }) => {\n const did = args.did || _learnCard.id.did();\n\n if (!did) throw new Error('Could not get issuer did!');\n\n const defaults = {\n did,\n subject: 'did:example:d23dd687a7dc6787646f2eb98d0',\n issuanceDate: new Date().toISOString(),\n };\n\n const { type = 'basic', ...functionArgs } = args;\n\n if (!(type in VC_TEMPLATES)) throw new Error('Invalid Test VC Type!');\n\n return VC_TEMPLATES[type](\n { ...defaults, ...functionArgs },\n _learnCard.invoke.crypto()\n );\n },\n newPresentation: async (_learnCard, credential, args = {}) => {\n const did = args?.did || _learnCard.id.did();\n\n if (!did) throw new Error('Could not get issuer did!');\n\n return {\n '@context': ['https://www.w3.org/ns/credentials/v2'],\n type: ['VerifiablePresentation'],\n holder: did,\n verifiableCredential: credential,\n };\n },\n },\n };\n};\n"],
|
|
5
|
-
"mappings": "4dAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,0BAAAE,IAAA,eAAAC,EAAAH,GCKO,IAAMI,EAET,CACA,
|
|
6
|
-
"names": ["
|
|
5
|
+
"mappings": "4dAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,0BAAAE,IAAA,eAAAC,EAAAH,GCKO,IAAMI,EAET,CACA,MAAOC,EAAA,CACH,CACI,IAAAC,EAAM,0CACN,QAAAC,EAAU,0CACV,aAAAC,EAAe,sBACnB,EAAI,CAAC,EACLC,KACE,CACF,WAAY,CAAC,sCAAsC,EACnD,GAAI,YAAYA,EAAO,WAAW,CAAC,GACnC,KAAM,CAAC,sBAAsB,EAC7B,OAAQH,EACR,UAAWE,EACX,kBAAmB,CAAE,GAAID,CAAQ,CACrC,GAdO,SAeP,YAAaF,EAAA,CACT,CACI,IAA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AAA,MAAOC,EAAYO,EAAYN,EAAO,CAAC,IAAM,CAC1D,IAAMC,EAAMD,GAAM,KAAOD,EAAW,GAAG,IAAI,EAE3C,GAAI,CAACE,EAAK,MAAM,IAAI,MAAM,2BAA2B,EAErD,MAAO,CACH,WAAY,CAAC,sCAAsC,EACnD,KAAM,CAAC,wBAAwB,EAC/B,OAAQA,EACR,qBAAsBK,CAC1B,CACJ,EAXiB,kBAYrB,CACJ,GAvCgC",
|
|
6
|
+
"names": ["index_exports", "__export", "getVCTemplatesPlugin", "__toCommonJS", "VC_TEMPLATES", "__name", "did", "subject", "issuanceDate", "crypto", "name", "achievementName", "description", "criteriaNarrative", "expirationDate", "boostName", "boostImage", "achievementId", "achievementType", "achievementDescription", "achievementNarrative", "achievementImage", "attachments", "display", "familyTitles", "skills", "groupID", "evidence", "alignment", "source", "e", "t", "address", "boostID", "access", "getVCTemplatesPlugin", "__name", "_learnCard", "args", "did", "defaults", "type", "functionArgs", "VC_TEMPLATES", "credential"]
|
|
7
7
|
}
|
|
@@ -3,7 +3,7 @@ var __name = (target, value) => __defProp(target, "name", { value, configurable:
|
|
|
3
3
|
|
|
4
4
|
// src/templates.ts
|
|
5
5
|
var VC_TEMPLATES = {
|
|
6
|
-
basic: ({
|
|
6
|
+
basic: /* @__PURE__ */ __name(({
|
|
7
7
|
did = "did:example:d23dd687a7dc6787646f2eb98d0",
|
|
8
8
|
subject = "did:example:d23dd687a7dc6787646f2eb98d0",
|
|
9
9
|
issuanceDate = "2020-08-19T21:41:50Z"
|
|
@@ -14,8 +14,8 @@ var VC_TEMPLATES = {
|
|
|
14
14
|
issuer: did,
|
|
15
15
|
validFrom: issuanceDate,
|
|
16
16
|
credentialSubject: { id: subject }
|
|
17
|
-
}),
|
|
18
|
-
achievement: ({
|
|
17
|
+
}), "basic"),
|
|
18
|
+
achievement: /* @__PURE__ */ __name(({
|
|
19
19
|
did = "did:example:d23dd687a7dc6787646f2eb98d0",
|
|
20
20
|
subject = "did:example:d23dd687a7dc6787646f2eb98d0",
|
|
21
21
|
name = "Teamwork Badge",
|
|
@@ -44,8 +44,8 @@ var VC_TEMPLATES = {
|
|
|
44
44
|
name: achievementName
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
|
-
}),
|
|
48
|
-
jff2: ({
|
|
47
|
+
}), "achievement"),
|
|
48
|
+
jff2: /* @__PURE__ */ __name(({
|
|
49
49
|
did = "did:example:d23dd687a7dc6787646f2eb98d0",
|
|
50
50
|
subject = "did:example:d23dd687a7dc6787646f2eb98d0",
|
|
51
51
|
issuanceDate = "2020-08-19T21:41:50Z"
|
|
@@ -85,8 +85,8 @@ var VC_TEMPLATES = {
|
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
|
-
}),
|
|
89
|
-
boost: ({
|
|
88
|
+
}), "jff2"),
|
|
89
|
+
boost: /* @__PURE__ */ __name(({
|
|
90
90
|
did = "did:example:d23dd687a7dc6787646f2eb98d0",
|
|
91
91
|
subject = "did:example:d23dd687a7dc6787646f2eb98d0",
|
|
92
92
|
issuanceDate = "2020-08-19T21:41:50Z",
|
|
@@ -152,8 +152,8 @@ var VC_TEMPLATES = {
|
|
|
152
152
|
attachments,
|
|
153
153
|
skills,
|
|
154
154
|
groupID
|
|
155
|
-
}),
|
|
156
|
-
boostID: ({
|
|
155
|
+
}), "boost"),
|
|
156
|
+
boostID: /* @__PURE__ */ __name(({
|
|
157
157
|
did = "did:example:d23dd687a7dc6787646f2eb98d0",
|
|
158
158
|
subject = "did:example:d23dd687a7dc6787646f2eb98d0",
|
|
159
159
|
issuanceDate = "2020-08-19T21:41:50Z",
|
|
@@ -231,11 +231,11 @@ var VC_TEMPLATES = {
|
|
|
231
231
|
skills,
|
|
232
232
|
boostID,
|
|
233
233
|
groupID
|
|
234
|
-
}),
|
|
235
|
-
delegate: ({
|
|
234
|
+
}), "boostID"),
|
|
235
|
+
delegate: /* @__PURE__ */ __name(({
|
|
236
236
|
did = "did:example:d23dd687a7dc6787646f2eb98d0",
|
|
237
237
|
subject = "did:example:d23dd687a7dc6787646f2eb98d0",
|
|
238
|
-
issuanceDate = new Date().toISOString(),
|
|
238
|
+
issuanceDate = (/* @__PURE__ */ new Date()).toISOString(),
|
|
239
239
|
access = ["read"]
|
|
240
240
|
} = {}, crypto) => ({
|
|
241
241
|
"@context": [
|
|
@@ -248,7 +248,7 @@ var VC_TEMPLATES = {
|
|
|
248
248
|
validFrom: issuanceDate,
|
|
249
249
|
credentialSubject: { id: subject },
|
|
250
250
|
permissions: { statementAccess: access }
|
|
251
|
-
})
|
|
251
|
+
}), "delegate")
|
|
252
252
|
};
|
|
253
253
|
|
|
254
254
|
// src/vc-templates.ts
|
|
@@ -258,34 +258,31 @@ var getVCTemplatesPlugin = /* @__PURE__ */ __name(() => {
|
|
|
258
258
|
displayName: "VC Templates",
|
|
259
259
|
description: "Allows for the easy creation of VCs and VPs based on predefined templates",
|
|
260
260
|
methods: {
|
|
261
|
-
newCredential: (_learnCard, args = { type: "basic" }) => {
|
|
261
|
+
newCredential: /* @__PURE__ */ __name((_learnCard, args = { type: "basic" }) => {
|
|
262
262
|
const did = args.did || _learnCard.id.did();
|
|
263
|
-
if (!did)
|
|
264
|
-
throw new Error("Could not get issuer did!");
|
|
263
|
+
if (!did) throw new Error("Could not get issuer did!");
|
|
265
264
|
const defaults = {
|
|
266
265
|
did,
|
|
267
266
|
subject: "did:example:d23dd687a7dc6787646f2eb98d0",
|
|
268
|
-
issuanceDate: new Date().toISOString()
|
|
267
|
+
issuanceDate: (/* @__PURE__ */ new Date()).toISOString()
|
|
269
268
|
};
|
|
270
269
|
const { type = "basic", ...functionArgs } = args;
|
|
271
|
-
if (!(type in VC_TEMPLATES))
|
|
272
|
-
throw new Error("Invalid Test VC Type!");
|
|
270
|
+
if (!(type in VC_TEMPLATES)) throw new Error("Invalid Test VC Type!");
|
|
273
271
|
return VC_TEMPLATES[type](
|
|
274
272
|
{ ...defaults, ...functionArgs },
|
|
275
273
|
_learnCard.invoke.crypto()
|
|
276
274
|
);
|
|
277
|
-
},
|
|
278
|
-
newPresentation: async (_learnCard, credential, args = {}) => {
|
|
275
|
+
}, "newCredential"),
|
|
276
|
+
newPresentation: /* @__PURE__ */ __name(async (_learnCard, credential, args = {}) => {
|
|
279
277
|
const did = args?.did || _learnCard.id.did();
|
|
280
|
-
if (!did)
|
|
281
|
-
throw new Error("Could not get issuer did!");
|
|
278
|
+
if (!did) throw new Error("Could not get issuer did!");
|
|
282
279
|
return {
|
|
283
280
|
"@context": ["https://www.w3.org/ns/credentials/v2"],
|
|
284
281
|
type: ["VerifiablePresentation"],
|
|
285
282
|
holder: did,
|
|
286
283
|
verifiableCredential: credential
|
|
287
284
|
};
|
|
288
|
-
}
|
|
285
|
+
}, "newPresentation")
|
|
289
286
|
}
|
|
290
287
|
};
|
|
291
288
|
}, "getVCTemplatesPlugin");
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/templates.ts", "../src/vc-templates.ts"],
|
|
4
4
|
"sourcesContent": ["import { UnsignedVC, UnsignedAchievementCredential } from '@learncard/types';\n\nimport { VcTemplates } from './types';\n\n/** @group VC Templates Plugin */\nexport const VC_TEMPLATES: {\n [Key in keyof VcTemplates]: (args: VcTemplates[Key], crypto: Crypto) => UnsignedVC;\n} = {\n basic: (\n {\n did = 'did:example:d23dd687a7dc6787646f2eb98d0',\n subject = 'did:example:d23dd687a7dc6787646f2eb98d0',\n issuanceDate = '2020-08-19T21:41:50Z',\n } = {},\n crypto\n ) => ({\n '@context': ['https://www.w3.org/ns/credentials/v2'],\n id: `urn:uuid:${crypto.randomUUID()}`,\n type: ['VerifiableCredential'],\n issuer: did,\n validFrom: issuanceDate,\n credentialSubject: { id: subject },\n }),\n achievement: (\n {\n did = 'did:example:d23dd687a7dc6787646f2eb98d0',\n subject = 'did:example:d23dd687a7dc6787646f2eb98d0',\n name = 'Teamwork Badge',\n achievementName = 'Teamwork',\n description = 'This badge recognizes the development of the capacity to collaborate within a group environment.',\n criteriaNarrative = 'Team members are nominated for this badge by their peers and recognized upon review by Example Corp management.',\n issuanceDate = '2020-08-19T21:41:50Z',\n } = {},\n crypto\n ): UnsignedAchievementCredential => ({\n '@context': [\n 'https://www.w3.org/ns/credentials/v2',\n 'https://purl.imsglobal.org/spec/ob/v3p0/context-3.0.3.json',\n ],\n id: `urn:uuid:${crypto.randomUUID()}`,\n type: ['VerifiableCredential', 'OpenBadgeCredential'],\n issuer: { id: did },\n validFrom: issuanceDate,\n name,\n credentialSubject: {\n id: subject,\n type: ['AchievementSubject'],\n achievement: {\n id: `urn:uuid:${crypto.randomUUID()}`,\n type: ['Achievement'],\n criteria: { narrative: criteriaNarrative },\n description,\n name: achievementName,\n },\n },\n }),\n jff2: (\n {\n did = 'did:example:d23dd687a7dc6787646f2eb98d0',\n subject = 'did:example:d23dd687a7dc6787646f2eb98d0',\n issuanceDate = '2020-08-19T21:41:50Z',\n } = {},\n crypto\n ) => ({\n '@context': [\n 'https://www.w3.org/2018/credentials/v1',\n 'https://purl.imsglobal.org/spec/ob/v3p0/context.json',\n 'https://w3id.org/security/suites/ed25519-2020/v1',\n ],\n id: `urn:uuid:${crypto.randomUUID()}`,\n type: ['VerifiableCredential', 'OpenBadgeCredential'],\n name: 'JFF x vc-edu PlugFest 2 Interoperability',\n issuer: {\n type: ['Profile'],\n id: did,\n name: 'Jobs for the Future (JFF)',\n image: {\n id: 'https://w3c-ccg.github.io/vc-ed/plugfest-1-2022/images/JFF_LogoLockup.png',\n type: 'Image',\n },\n },\n issuanceDate: issuanceDate,\n credentialSubject: {\n type: ['AchievementSubject'],\n id: subject,\n achievement: {\n id: `urn:uuid:${crypto.randomUUID()}`,\n type: ['Achievement'],\n name: 'JFF x vc-edu PlugFest 2 Interoperability',\n description:\n 'This credential solution supports the use of OBv3 and w3c Verifiable Credentials and is interoperable with at least two other solutions. This was demonstrated successfully during JFF x vc-edu PlugFest 2.',\n criteria: {\n narrative:\n 'Solutions providers earned this badge by demonstrating interoperability between multiple providers based on the OBv3 candidate final standard, with some additional required fields. Credential issuers earning this badge successfully issued a credential into at least two wallets. Wallet implementers earning this badge successfully displayed credentials issued by at least two different credential issuers.',\n },\n image: {\n id: 'https://w3c-ccg.github.io/vc-ed/plugfest-2-2022/images/JFF-VC-EDU-PLUGFEST2-badge-image.png',\n type: 'Image',\n },\n },\n },\n }),\n boost: (\n {\n did = 'did:example:d23dd687a7dc6787646f2eb98d0',\n subject = 'did:example:d23dd687a7dc6787646f2eb98d0',\n issuanceDate = '2020-08-19T21:41:50Z',\n expirationDate,\n boostName = 'Example Boost',\n boostImage,\n achievementId,\n achievementType = 'Influencer',\n achievementName = 'Awesome Badge',\n achievementDescription = 'Awesome People Earn Awesome Badge',\n achievementNarrative = 'Earned by being awesome.',\n achievementImage = '',\n attachments,\n display,\n familyTitles,\n skills,\n groupID = '',\n evidence = [],\n alignment,\n source,\n } = {},\n crypto\n ) => ({\n '@context': [\n 'https://www.w3.org/ns/credentials/v2',\n 'https://purl.imsglobal.org/spec/ob/v3p0/context-3.0.3.json',\n 'https://ctx.learncard.com/boosts/1.0.3.json',\n ],\n type: ['VerifiableCredential', 'OpenBadgeCredential', 'BoostCredential'],\n id: `urn:uuid:${crypto.randomUUID()}`,\n issuer: { id: did },\n validFrom: issuanceDate,\n ...(expirationDate && { validUntil: expirationDate }),\n name: boostName,\n credentialSubject: {\n id: subject,\n type: ['AchievementSubject'],\n achievement: {\n id: achievementId ?? `urn:uuid:${crypto.randomUUID()}`,\n type: ['Achievement'],\n achievementType: achievementType,\n name: achievementName,\n description: achievementDescription,\n image: achievementImage,\n criteria: {\n narrative: achievementNarrative,\n },\n ...(alignment && { alignment }),\n },\n ...(source && { source }),\n },\n ...(Array.isArray(evidence) &&\n evidence.length > 0 && {\n evidence: evidence.map(e => ({\n ...e,\n type: e.type?.includes('EvidenceFile')\n ? e.type\n : [\n 'Evidence',\n 'EvidenceFile',\n ...(e.type?.filter(t => t !== 'Evidence') || []),\n ],\n })),\n }),\n display,\n familyTitles,\n image: boostImage,\n attachments,\n skills,\n groupID,\n }),\n boostID: (\n {\n did = 'did:example:d23dd687a7dc6787646f2eb98d0',\n subject = 'did:example:d23dd687a7dc6787646f2eb98d0',\n issuanceDate = '2020-08-19T21:41:50Z',\n expirationDate,\n boostName = 'Example Boost',\n boostImage,\n achievementId,\n achievementType = 'Influencer',\n achievementName = 'Awesome Badge',\n achievementDescription = 'Awesome People Earn Awesome Badge',\n achievementNarrative = 'Earned by being awesome.',\n achievementImage = '',\n address,\n attachments,\n skills,\n display,\n familyTitles,\n boostID,\n groupID = '',\n evidence = [],\n alignment,\n source,\n } = {},\n crypto\n ) => ({\n '@context': [\n 'https://www.w3.org/ns/credentials/v2',\n 'https://purl.imsglobal.org/spec/ob/v3p0/context-3.0.3.json',\n 'https://ctx.learncard.com/boosts/1.0.3.json',\n 'https://ctx.learncard.com/boostIDs/1.0.0.json',\n ],\n type: ['VerifiableCredential', 'OpenBadgeCredential', 'BoostCredential', 'BoostID'],\n id: `urn:uuid:${crypto.randomUUID()}`,\n issuer: { id: did },\n validFrom: issuanceDate,\n ...(expirationDate && { validUntil: expirationDate }),\n name: boostName,\n credentialSubject: {\n id: subject,\n type: ['AchievementSubject'],\n achievement: {\n id: achievementId ?? `urn:uuid:${crypto.randomUUID()}`,\n type: ['Achievement'],\n achievementType: achievementType,\n name: achievementName,\n description: achievementDescription,\n image: achievementImage,\n criteria: {\n narrative: achievementNarrative,\n },\n ...(alignment && { alignment }),\n },\n ...(source && { source }),\n },\n ...(Array.isArray(evidence) && evidence.length > 0 && { evidence }),\n ...(address\n ? {\n address: {\n type: ['Address'],\n ...address,\n ...(address.geo ? { geo: { type: ['GeoCoordinates'], ...address.geo } } : {}),\n },\n }\n : {}),\n ...(Array.isArray(evidence) &&\n evidence.length > 0 && {\n evidence: evidence.map(e => ({\n ...e,\n type: e.type?.includes('EvidenceFile')\n ? e.type\n : [\n 'Evidence',\n 'EvidenceFile',\n ...(e.type?.filter(t => t !== 'Evidence') || []),\n ],\n })),\n }),\n display,\n familyTitles,\n image: boostImage,\n attachments,\n skills,\n boostID,\n groupID,\n }),\n delegate: (\n {\n did = 'did:example:d23dd687a7dc6787646f2eb98d0',\n subject = 'did:example:d23dd687a7dc6787646f2eb98d0',\n issuanceDate = new Date().toISOString(),\n access = ['read'],\n } = {},\n crypto\n ) => ({\n '@context': [\n 'https://www.w3.org/ns/credentials/v2',\n 'https://ctx.learncard.com/delegates/1.0.0.json',\n ],\n type: ['VerifiableCredential', 'DelegateCredential'],\n id: `urn:uuid:${crypto.randomUUID()}`,\n issuer: { id: did },\n validFrom: issuanceDate,\n credentialSubject: { id: subject },\n permissions: { statementAccess: access },\n }),\n};\n", "import { VC_TEMPLATES } from './templates';\n\nimport { VCTemplatePlugin } from './types';\n\n/**\n * @group Plugins\n */\nexport const getVCTemplatesPlugin = (): VCTemplatePlugin => {\n return {\n name: 'VC Templates',\n displayName: 'VC Templates',\n description: 'Allows for the easy creation of VCs and VPs based on predefined templates',\n methods: {\n newCredential: (_learnCard, args = { type: 'basic' }) => {\n const did = args.did || _learnCard.id.did();\n\n if (!did) throw new Error('Could not get issuer did!');\n\n const defaults = {\n did,\n subject: 'did:example:d23dd687a7dc6787646f2eb98d0',\n issuanceDate: new Date().toISOString(),\n };\n\n const { type = 'basic', ...functionArgs } = args;\n\n if (!(type in VC_TEMPLATES)) throw new Error('Invalid Test VC Type!');\n\n return VC_TEMPLATES[type](\n { ...defaults, ...functionArgs },\n _learnCard.invoke.crypto()\n );\n },\n newPresentation: async (_learnCard, credential, args = {}) => {\n const did = args?.did || _learnCard.id.did();\n\n if (!did) throw new Error('Could not get issuer did!');\n\n return {\n '@context': ['https://www.w3.org/ns/credentials/v2'],\n type: ['VerifiablePresentation'],\n holder: did,\n verifiableCredential: credential,\n };\n },\n },\n };\n};\n"],
|
|
5
|
-
"mappings": ";;;;AAKO,IAAM,eAET;AAAA,EACA,OAAO,
|
|
5
|
+
"mappings": ";;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A,UACH,YAAY,CAAC,sCAAsC;AAAA,UACnD,MAAM,CAAC,wBAAwB;AAAA,UAC/B,QAAQ;AAAA,UACR,sBAAsB;AAAA,QAC1B;AAAA,MACJ,GAXiB;AAAA,IAYrB;AAAA,EACJ;AACJ,GAxCoC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@learncard/vc-templates-plugin",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.2",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/vc-templates-plugin.esm.js",
|
|
@@ -9,19 +9,19 @@
|
|
|
9
9
|
],
|
|
10
10
|
"author": "Learning Economy Foundation (www.learningeconomy.io)",
|
|
11
11
|
"license": "MIT",
|
|
12
|
-
"homepage": "https://github.com/
|
|
12
|
+
"homepage": "https://github.com/learningeconomy/LearnCard/tree/main/packages/plugins/vc-templates/README.md",
|
|
13
13
|
"repository": {
|
|
14
14
|
"type": "git",
|
|
15
|
-
"url": "
|
|
15
|
+
"url": "https://github.com/learningeconomy/LearnCard"
|
|
16
16
|
},
|
|
17
17
|
"bugs": {
|
|
18
|
-
"url": "https://github.com/
|
|
18
|
+
"url": "https://github.com/learningeconomy/LearnCard/issues"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
21
|
"@types/jest": "^29.2.2",
|
|
22
22
|
"@types/node": "^17.0.31",
|
|
23
23
|
"aqu": "0.4.3",
|
|
24
|
-
"esbuild": "^0.
|
|
24
|
+
"esbuild": "^0.27.1",
|
|
25
25
|
"esbuild-jest": "^0.5.0",
|
|
26
26
|
"esbuild-plugin-copy": "^1.3.0",
|
|
27
27
|
"jest": "^29.3.0",
|
|
@@ -30,8 +30,8 @@
|
|
|
30
30
|
},
|
|
31
31
|
"types": "./dist/index.d.ts",
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@learncard/core": "9.
|
|
34
|
-
"@learncard/types": "5.
|
|
33
|
+
"@learncard/core": "9.4.2",
|
|
34
|
+
"@learncard/types": "5.11.1"
|
|
35
35
|
},
|
|
36
36
|
"scripts": {
|
|
37
37
|
"build": "node ./scripts/build.mjs && shx cp ./scripts/mixedEntypoint.js ./dist/index.js && tsc --p tsconfig.json",
|