@learncard/vc-templates-plugin 1.0.54 → 1.0.55

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.
@@ -132,7 +132,7 @@ var VC_TEMPLATES = {
132
132
  "@context": [
133
133
  "https://www.w3.org/ns/credentials/v2",
134
134
  "https://purl.imsglobal.org/spec/ob/v3p0/context-3.0.3.json",
135
- "https://ctx.learncard.com/boosts/1.0.0.json"
135
+ "https://ctx.learncard.com/boosts/1.0.1.json"
136
136
  ],
137
137
  type: ["VerifiableCredential", "OpenBadgeCredential", "BoostCredential"],
138
138
  id: `urn:uuid:${crypto.randomUUID()}`,
@@ -186,7 +186,7 @@ var VC_TEMPLATES = {
186
186
  "@context": [
187
187
  "https://www.w3.org/ns/credentials/v2",
188
188
  "https://purl.imsglobal.org/spec/ob/v3p0/context-3.0.3.json",
189
- "https://ctx.learncard.com/boosts/1.0.0.json",
189
+ "https://ctx.learncard.com/boosts/1.0.1.json",
190
190
  "https://ctx.learncard.com/boostIDs/1.0.0.json"
191
191
  ],
192
192
  type: ["VerifiableCredential", "OpenBadgeCredential", "BoostCredential", "BoostID"],
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/index.ts", "../src/templates.ts", "../src/vc-templates.ts"],
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/2018/credentials/v1'],\n id: `urn:uuid:${crypto.randomUUID()}`,\n type: ['VerifiableCredential'],\n issuer: did,\n 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 } = {},\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.0.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 },\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 } = {},\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.0.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 },\n },\n ...(address\n ? {\n address: {\n type: ['Address'],\n ...address,\n ...(address.geo ? { geo: { type: ['GeoCoordinates'], ...address.geo } } : {}),\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"],
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/2018/credentials/v1'],\n id: `urn:uuid:${crypto.randomUUID()}`,\n type: ['VerifiableCredential'],\n issuer: did,\n 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 } = {},\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.1.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 },\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 } = {},\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.1.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 },\n },\n ...(address\n ? {\n address: {\n type: ['Address'],\n ...address,\n ...(address.geo ? { geo: { type: ['GeoCoordinates'], ...address.geo } } : {}),\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
5
  "mappings": ";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACKO,IAAM,eAET;AAAA,EACA,OAAO,CACH;AAAA,IACI,MAAM;AAAA,IACN,UAAU;AAAA,IACV,eAAe;AAAA,EACnB,IAAI,CAAC,GACL,YACE;AAAA,IACF,YAAY,CAAC,wCAAwC;AAAA,IACrD,IAAI,YAAY,OAAO,WAAW;AAAA,IAClC,MAAM,CAAC,sBAAsB;AAAA,IAC7B,QA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AAQ;AAAA,UACR,sBAAsB;AAAA,QAC1B;AAAA,MACJ;AAAA,IACJ;AAAA,EACJ;AACJ,GAxCoC;",
6
6
  "names": []
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var c=Object.defineProperty;var U=Object.getOwnPropertyDescriptor;var V=Object.getOwnPropertyNames;var A=Object.prototype.hasOwnProperty;var x=(t,e)=>c(t,"name",{value:e,configurable:!0});var I=(t,e)=>{for(var i in e)c(t,i,{get:e[i],enumerable:!0})},F=(t,e,i,d)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of V(e))!A.call(t,a)&&a!==i&&c(t,a,{get:()=>e[a],enumerable:!(d=U(e,a))||d.enumerable});return t};var j=t=>F(c({},"__esModule",{value:!0}),t);var S={};I(S,{getVCTemplatesPlugin:()=>C});module.exports=j(S);var v={basic:({did:t="did:example:d23dd687a7dc6787646f2eb98d0",subject:e="did:example:d23dd687a7dc6787646f2eb98d0",issuanceDate:i="2020-08-19T21:41:50Z"}={},d)=>({"@context":["https://www.w3.org/2018/credentials/v1"],id:`urn:uuid:${d.randomUUID()}`,type:["VerifiableCredential"],issuer:t,issuanceDate:i,credentialSubject:{id:e}}),achievement:({did:t="did:example:d23dd687a7dc6787646f2eb98d0",subject:e="did:example:d23dd687a7dc6787646f2eb98d0",name:i="Teamwork Badge",achievementName:d="Teamwork",description:a="This badge recognizes the development of the capacity to collaborate within a group environment.",criteriaNarrative:n="Team members are nominated for this badge by their peers and recognized upon review by Example Corp management.",issuanceDate:o="2020-08-19T21:41:50Z"}={},r)=>({"@context":["https://www.w3.org/ns/credentials/v2","https://purl.imsglobal.org/spec/ob/v3p0/context-3.0.3.json"],id:`urn:uuid:${r.randomUUID()}`,type:["VerifiableCredential","OpenBadgeCredential"],issuer:{id:t},validFrom:o,name:i,credentialSubject:{id:e,type:["AchievementSubject"],achievement:{id:`urn:uuid:${r.randomUUID()}`,type:["Achievement"],criteria:{narrative:n},description:a,name:d}}}),jff2:({did:t="did:example:d23dd687a7dc6787646f2eb98d0",subject:e="did:example:d23dd687a7dc6787646f2eb98d0",issuanceDate:i="2020-08-19T21:41:50Z"}={},d)=>({"@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:${d.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:i,credentialSubject:{type:["AchievementSubject"],id:e,achievement:{id:`urn:uuid:${d.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"}}}}),boost:({did:t="did:example:d23dd687a7dc6787646f2eb98d0",subject:e="did:example:d23dd687a7dc6787646f2eb98d0",issuanceDate:i="2020-08-19T21:41:50Z",expirationDate:d,boostName:a="Example Boost",boostImage:n,achievementId:o,achievementType:r="Influencer",achievementName:m="Awesome Badge",achievementDescription:p="Awesome People Earn Awesome Badge",achievementNarrative:u="Earned by being awesome.",achievementImage:g="",attachments:s,display:b,familyTitles:w,skills:h,groupID:f=""}={},l)=>({"@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.0.json"],type:["VerifiableCredential","OpenBadgeCredential","BoostCredential"],id:`urn:uuid:${l.randomUUID()}`,issuer:{id:t},validFrom:i,...d&&{validUntil:d},name:a,credentialSubject:{id:e,type:["AchievementSubject"],achievement:{id:o??`urn:uuid:${l.randomUUID()}`,type:["Achievement"],achievementType:r,name:m,description:p,image:g,criteria:{narrative:u}}},display:b,familyTitles:w,image:n,attachments:s,skills:h,groupID:f}),boostID:({did:t="did:example:d23dd687a7dc6787646f2eb98d0",subject:e="did:example:d23dd687a7dc6787646f2eb98d0",issuanceDate:i="2020-08-19T21:41:50Z",expirationDate:d,boostName:a="Example Boost",boostImage:n,achievementId:o,achievementType:r="Influencer",achievementName:m="Awesome Badge",achievementDescription:p="Awesome People Earn Awesome Badge",achievementNarrative:u="Earned by being awesome.",achievementImage:g="",address:s,attachments:b,skills:w,display:h,familyTitles:f,boostID:l,groupID:T=""}={},y)=>({"@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.0.json","https://ctx.learncard.com/boostIDs/1.0.0.json"],type:["VerifiableCredential","OpenBadgeCredential","BoostCredential","BoostID"],id:`urn:uuid:${y.randomUUID()}`,issuer:{id:t},validFrom:i,...d&&{validUntil:d},name:a,credentialSubject:{id:e,type:["AchievementSubject"],achievement:{id:o??`urn:uuid:${y.randomUUID()}`,type:["Achievement"],achievementType:r,name:m,description:p,image:g,criteria:{narrative:u}}},...s?{address:{type:["Address"],...s,...s.geo?{geo:{type:["GeoCoordinates"],...s.geo}}:{}}}:{},display:h,familyTitles:f,image:n,attachments:b,skills:w,boostID:l,groupID:T}),delegate:({did:t="did:example:d23dd687a7dc6787646f2eb98d0",subject:e="did:example:d23dd687a7dc6787646f2eb98d0",issuanceDate:i=new Date().toISOString(),access:d=["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:i,credentialSubject:{id:e},permissions:{statementAccess:d}})};var C=x(()=>({name:"VC Templates",displayName:"VC Templates",description:"Allows for the easy creation of VCs and VPs based on predefined templates",methods:{newCredential:(t,e={type:"basic"})=>{let i=e.did||t.id.did();if(!i)throw new Error("Could not get issuer did!");let d={did:i,subject:"did:example:d23dd687a7dc6787646f2eb98d0",issuanceDate:new Date().toISOString()},{type:a="basic",...n}=e;if(!(a in v))throw new Error("Invalid Test VC Type!");return v[a]({...d,...n},t.invoke.crypto())},newPresentation:async(t,e,i={})=>{let d=i?.did||t.id.did();if(!d)throw new Error("Could not get issuer did!");return{"@context":["https://www.w3.org/ns/credentials/v2"],type:["VerifiablePresentation"],holder:d,verifiableCredential:e}}}}),"getVCTemplatesPlugin");
1
+ "use strict";var c=Object.defineProperty;var U=Object.getOwnPropertyDescriptor;var V=Object.getOwnPropertyNames;var A=Object.prototype.hasOwnProperty;var x=(t,e)=>c(t,"name",{value:e,configurable:!0});var I=(t,e)=>{for(var i in e)c(t,i,{get:e[i],enumerable:!0})},F=(t,e,i,d)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of V(e))!A.call(t,a)&&a!==i&&c(t,a,{get:()=>e[a],enumerable:!(d=U(e,a))||d.enumerable});return t};var j=t=>F(c({},"__esModule",{value:!0}),t);var S={};I(S,{getVCTemplatesPlugin:()=>C});module.exports=j(S);var v={basic:({did:t="did:example:d23dd687a7dc6787646f2eb98d0",subject:e="did:example:d23dd687a7dc6787646f2eb98d0",issuanceDate:i="2020-08-19T21:41:50Z"}={},d)=>({"@context":["https://www.w3.org/2018/credentials/v1"],id:`urn:uuid:${d.randomUUID()}`,type:["VerifiableCredential"],issuer:t,issuanceDate:i,credentialSubject:{id:e}}),achievement:({did:t="did:example:d23dd687a7dc6787646f2eb98d0",subject:e="did:example:d23dd687a7dc6787646f2eb98d0",name:i="Teamwork Badge",achievementName:d="Teamwork",description:a="This badge recognizes the development of the capacity to collaborate within a group environment.",criteriaNarrative:n="Team members are nominated for this badge by their peers and recognized upon review by Example Corp management.",issuanceDate:o="2020-08-19T21:41:50Z"}={},r)=>({"@context":["https://www.w3.org/ns/credentials/v2","https://purl.imsglobal.org/spec/ob/v3p0/context-3.0.3.json"],id:`urn:uuid:${r.randomUUID()}`,type:["VerifiableCredential","OpenBadgeCredential"],issuer:{id:t},validFrom:o,name:i,credentialSubject:{id:e,type:["AchievementSubject"],achievement:{id:`urn:uuid:${r.randomUUID()}`,type:["Achievement"],criteria:{narrative:n},description:a,name:d}}}),jff2:({did:t="did:example:d23dd687a7dc6787646f2eb98d0",subject:e="did:example:d23dd687a7dc6787646f2eb98d0",issuanceDate:i="2020-08-19T21:41:50Z"}={},d)=>({"@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:${d.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:i,credentialSubject:{type:["AchievementSubject"],id:e,achievement:{id:`urn:uuid:${d.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"}}}}),boost:({did:t="did:example:d23dd687a7dc6787646f2eb98d0",subject:e="did:example:d23dd687a7dc6787646f2eb98d0",issuanceDate:i="2020-08-19T21:41:50Z",expirationDate:d,boostName:a="Example Boost",boostImage:n,achievementId:o,achievementType:r="Influencer",achievementName:m="Awesome Badge",achievementDescription:p="Awesome People Earn Awesome Badge",achievementNarrative:u="Earned by being awesome.",achievementImage:g="",attachments:s,display:b,familyTitles:w,skills:h,groupID:f=""}={},l)=>({"@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.1.json"],type:["VerifiableCredential","OpenBadgeCredential","BoostCredential"],id:`urn:uuid:${l.randomUUID()}`,issuer:{id:t},validFrom:i,...d&&{validUntil:d},name:a,credentialSubject:{id:e,type:["AchievementSubject"],achievement:{id:o??`urn:uuid:${l.randomUUID()}`,type:["Achievement"],achievementType:r,name:m,description:p,image:g,criteria:{narrative:u}}},display:b,familyTitles:w,image:n,attachments:s,skills:h,groupID:f}),boostID:({did:t="did:example:d23dd687a7dc6787646f2eb98d0",subject:e="did:example:d23dd687a7dc6787646f2eb98d0",issuanceDate:i="2020-08-19T21:41:50Z",expirationDate:d,boostName:a="Example Boost",boostImage:n,achievementId:o,achievementType:r="Influencer",achievementName:m="Awesome Badge",achievementDescription:p="Awesome People Earn Awesome Badge",achievementNarrative:u="Earned by being awesome.",achievementImage:g="",address:s,attachments:b,skills:w,display:h,familyTitles:f,boostID:l,groupID:T=""}={},y)=>({"@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.1.json","https://ctx.learncard.com/boostIDs/1.0.0.json"],type:["VerifiableCredential","OpenBadgeCredential","BoostCredential","BoostID"],id:`urn:uuid:${y.randomUUID()}`,issuer:{id:t},validFrom:i,...d&&{validUntil:d},name:a,credentialSubject:{id:e,type:["AchievementSubject"],achievement:{id:o??`urn:uuid:${y.randomUUID()}`,type:["Achievement"],achievementType:r,name:m,description:p,image:g,criteria:{narrative:u}}},...s?{address:{type:["Address"],...s,...s.geo?{geo:{type:["GeoCoordinates"],...s.geo}}:{}}}:{},display:h,familyTitles:f,image:n,attachments:b,skills:w,boostID:l,groupID:T}),delegate:({did:t="did:example:d23dd687a7dc6787646f2eb98d0",subject:e="did:example:d23dd687a7dc6787646f2eb98d0",issuanceDate:i=new Date().toISOString(),access:d=["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:i,credentialSubject:{id:e},permissions:{statementAccess:d}})};var C=x(()=>({name:"VC Templates",displayName:"VC Templates",description:"Allows for the easy creation of VCs and VPs based on predefined templates",methods:{newCredential:(t,e={type:"basic"})=>{let i=e.did||t.id.did();if(!i)throw new Error("Could not get issuer did!");let d={did:i,subject:"did:example:d23dd687a7dc6787646f2eb98d0",issuanceDate:new Date().toISOString()},{type:a="basic",...n}=e;if(!(a in v))throw new Error("Invalid Test VC Type!");return v[a]({...d,...n},t.invoke.crypto())},newPresentation:async(t,e,i={})=>{let d=i?.did||t.id.did();if(!d)throw new Error("Could not get issuer did!");return{"@context":["https://www.w3.org/ns/credentials/v2"],type:["VerifiablePresentation"],holder:d,verifiableCredential:e}}}}),"getVCTemplatesPlugin");
2
2
  //# sourceMappingURL=vc-templates-plugin.cjs.production.min.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/index.ts", "../src/templates.ts", "../src/vc-templates.ts"],
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/2018/credentials/v1'],\n id: `urn:uuid:${crypto.randomUUID()}`,\n type: ['VerifiableCredential'],\n issuer: did,\n 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 } = {},\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.0.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 },\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 } = {},\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.0.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 },\n },\n ...(address\n ? {\n address: {\n type: ['Address'],\n ...address,\n ...(address.geo ? { geo: { type: ['GeoCoordinates'], ...address.geo } } : {}),\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"],
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/2018/credentials/v1'],\n id: `urn:uuid:${crypto.randomUUID()}`,\n type: ['VerifiableCredential'],\n issuer: did,\n 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 } = {},\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.1.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 },\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 } = {},\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.1.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 },\n },\n ...(address\n ? {\n address: {\n type: ['Address'],\n ...address,\n ...(address.geo ? { geo: { type: ['GeoCoordinates'], ...address.geo } } : {}),\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
5
  "mappings": "4dAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,0BAAAE,IAAA,eAAAC,EAAAH,GCKO,IAAMI,EAET,CACA,MAAO,CACH,CACI,IAAAC,EAAM,0CACN,QAAAC,EAAU,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AACC,EAAYC,EAAO,CAAE,KAAM,OAAQ,IAAM,CACrD,IAAMC,EAAMD,EAAK,KAAOD,EAAW,GAAG,IAAI,EAE1C,GAAI,CAACE,EAAK,MAAM,IAAI,MAAM,2BAA2B,EAErD,IAAMC,EAAW,CACb,IAAAD,EACA,QAAS,0CACT,aAAc,IAAI,KAAK,EAAE,YAAY,CACzC,EAEM,CAAE,KAAAE,EAAO,WAAYC,CAAa,EAAIJ,EAE5C,GAAI,EAAEG,KAAQE,GAAe,MAAM,IAAI,MAAM,uBAAuB,EAEpE,OAAOA,EAAaF,GAChB,CAAE,GAAGD,EAAU,GAAGE,CAAa,EAC/BL,EAAW,OAAO,OAAO,CAC7B,CACJ,EACA,gBAAiB,MAAOA,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,CACJ,CACJ,GAvCgC",
6
6
  "names": ["src_exports", "__export", "getVCTemplatesPlugin", "__toCommonJS", "VC_TEMPLATES", "did", "subject", "issuanceDate", "crypto", "name", "achievementName", "description", "criteriaNarrative", "expirationDate", "boostName", "boostImage", "achievementId", "achievementType", "achievementDescription", "achievementNarrative", "achievementImage", "attachments", "display", "familyTitles", "skills", "groupID", "address", "boostID", "access", "getVCTemplatesPlugin", "__name", "_learnCard", "args", "did", "defaults", "type", "functionArgs", "VC_TEMPLATES", "credential"]
7
7
  }
@@ -108,7 +108,7 @@ var VC_TEMPLATES = {
108
108
  "@context": [
109
109
  "https://www.w3.org/ns/credentials/v2",
110
110
  "https://purl.imsglobal.org/spec/ob/v3p0/context-3.0.3.json",
111
- "https://ctx.learncard.com/boosts/1.0.0.json"
111
+ "https://ctx.learncard.com/boosts/1.0.1.json"
112
112
  ],
113
113
  type: ["VerifiableCredential", "OpenBadgeCredential", "BoostCredential"],
114
114
  id: `urn:uuid:${crypto.randomUUID()}`,
@@ -162,7 +162,7 @@ var VC_TEMPLATES = {
162
162
  "@context": [
163
163
  "https://www.w3.org/ns/credentials/v2",
164
164
  "https://purl.imsglobal.org/spec/ob/v3p0/context-3.0.3.json",
165
- "https://ctx.learncard.com/boosts/1.0.0.json",
165
+ "https://ctx.learncard.com/boosts/1.0.1.json",
166
166
  "https://ctx.learncard.com/boostIDs/1.0.0.json"
167
167
  ],
168
168
  type: ["VerifiableCredential", "OpenBadgeCredential", "BoostCredential", "BoostID"],
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/templates.ts", "../src/vc-templates.ts"],
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/2018/credentials/v1'],\n id: `urn:uuid:${crypto.randomUUID()}`,\n type: ['VerifiableCredential'],\n issuer: did,\n 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 } = {},\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.0.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 },\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 } = {},\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.0.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 },\n },\n ...(address\n ? {\n address: {\n type: ['Address'],\n ...address,\n ...(address.geo ? { geo: { type: ['GeoCoordinates'], ...address.geo } } : {}),\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"],
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/2018/credentials/v1'],\n id: `urn:uuid:${crypto.randomUUID()}`,\n type: ['VerifiableCredential'],\n issuer: did,\n 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 } = {},\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.1.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 },\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 } = {},\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.1.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 },\n },\n ...(address\n ? {\n address: {\n type: ['Address'],\n ...address,\n ...(address.geo ? { geo: { type: ['GeoCoordinates'], ...address.geo } } : {}),\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
5
  "mappings": ";;;;AAKO,IAAM,eAET;AAAA,EACA,OAAO,CACH;AAAA,IACI,MAAM;AAAA,IACN,UAAU;AAAA,IACV,eAAe;AAAA,EACnB,IAAI,CAAC,GACL,YACE;AAAA,IACF,YAAY,CAAC,wCAAwC;AAAA,IACrD,IAAI,YAAY,OAAO,WAAW;AAAA,IAClC,MAAM,CAAC,sBAAsB;AAAA,IAC7B,QAAQ;AAAA,IACR;AAAA,IACA,mBAAmB,EAAE,IAAI,QAAQ;AAAA,EACrC;AAAA,EACA,aAAa,CACT;AAAA,IACI,MAAM;AAAA,IACN,UAAU;AAAA,IACV,OAAO;AAAA,IACP,kBAAkB;AAAA,IAClB,cAAc;AAAA,IACd,oBAAoB;AAAA,IACpB,eAAe;AAAA,EACnB,IAAI,CAAC,GACL,YACiC;AAAA,IACjC,YAAY;AAAA,MACR;AAAA,MACA;AAAA,IACJ;AAAA,IACA,IAAI,YAAY,OAAO,WAAW;AAAA,IAClC,MAAM,CAAC,wBAAwB,qBAAqB;AAAA,IACpD,QAAQ,EAAE,IAAI,IAAI;AAAA,IAClB,WAAW;AAAA,IACX;AAAA,IACA,mBAAmB;AAAA,MAC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;AAAA,IACb,aAAa;AAAA,IACb,SAAS;AAAA,MACL,eAAe,CAAC,YAAY,OAAO,EAAE,MAAM,QAAQ,MAAM;AACrD,cAAM,MAAM,KAAK,OAAO,WAAW,GAAG,IAAI;AAE1C,YAAI,CAAC;AAAK,gBAAM,IAAI,MAAM,2BAA2B;AAErD,cAAM,WAAW;AAAA,UACb;AAAA,UACA,SAAS;AAAA,UACT,cAAc,IAAI,KAAK,EAAE,YAAY;AAAA,QACzC;AAEA,cAAM,EAAE,OAAO,YAAY,aAAa,IAAI;AAE5C,YAAI,EAAE,QAAQ;AAAe,gBAAM,IAAI,MAAM,uBAAuB;AAEpE,eAAO,aAAa;AAAA,UAChB,EAAE,GAAG,UAAU,GAAG,aAAa;AAAA,UAC/B,WAAW,OAAO,OAAO;AAAA,QAC7B;AAAA,MACJ;AAAA,MACA,iBAAiB,OAAO,YAAY,YAAY,OAAO,CAAC,MAAM;AAC1D,cAAM,MAAM,MAAM,OAAO,WAAW,GAAG,IAAI;AAE3C,YAAI,CAAC;AAAK,gBAAM,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;AAAA,IACJ;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.0.54",
3
+ "version": "1.0.55",
4
4
  "description": "",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/vc-templates-plugin.esm.js",
@@ -30,8 +30,8 @@
30
30
  },
31
31
  "types": "./dist/index.d.ts",
32
32
  "dependencies": {
33
- "@learncard/types": "5.8.0",
34
- "@learncard/core": "9.3.31"
33
+ "@learncard/core": "9.3.31",
34
+ "@learncard/types": "5.8.0"
35
35
  },
36
36
  "scripts": {
37
37
  "build": "node ./scripts/build.mjs && shx cp ./scripts/mixedEntypoint.js ./dist/index.js && tsc --p tsconfig.json",