@learncard/vc-templates-plugin 1.1.20 → 1.1.22

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.
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  if (process.env.NODE_ENV === 'production') {
4
- module.exports = require('./vc-templates-plugin.cjs.production.min.js');
4
+ module.exports = require('./vc-templates-plugin.cjs.production.min.cjs');
5
5
  } else {
6
- module.exports = require('./vc-templates-plugin.cjs.development.js');
6
+ module.exports = require('./vc-templates-plugin.cjs.development.cjs');
7
7
  }
@@ -0,0 +1,3 @@
1
+ export { getVCTemplatesPlugin } from './vc-templates';
2
+ export * from './types';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -310,4 +310,4 @@ var getVCTemplatesPlugin = /* @__PURE__ */ __name(() => {
310
310
  }
311
311
  };
312
312
  }, "getVCTemplatesPlugin");
313
- //# sourceMappingURL=vc-templates-plugin.cjs.development.js.map
313
+ //# sourceMappingURL=vc-templates-plugin.cjs.development.cjs.map
@@ -1,2 +1,2 @@
1
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
- //# sourceMappingURL=vc-templates-plugin.cjs.production.min.js.map
2
+ //# sourceMappingURL=vc-templates-plugin.cjs.production.min.cjs.map
package/package.json CHANGED
@@ -1,9 +1,22 @@
1
1
  {
2
2
  "name": "@learncard/vc-templates-plugin",
3
- "version": "1.1.20",
3
+ "version": "1.1.22",
4
4
  "description": "",
5
- "main": "./dist/index.js",
5
+ "type": "module",
6
+ "main": "./dist/index.cjs",
6
7
  "module": "./dist/vc-templates-plugin.esm.js",
8
+ "exports": {
9
+ ".": {
10
+ "import": {
11
+ "types": "./dist/index.d.ts",
12
+ "default": "./dist/vc-templates-plugin.esm.js"
13
+ },
14
+ "require": {
15
+ "types": "./dist/index.d.cts",
16
+ "default": "./dist/index.cjs"
17
+ }
18
+ }
19
+ },
7
20
  "files": [
8
21
  "dist"
9
22
  ],
@@ -30,12 +43,12 @@
30
43
  },
31
44
  "types": "./dist/index.d.ts",
32
45
  "dependencies": {
33
- "@learncard/types": "5.17.0",
34
- "@learncard/core": "9.4.20"
46
+ "@learncard/core": "9.4.22",
47
+ "@learncard/types": "5.17.2"
35
48
  },
36
49
  "sideEffects": false,
37
50
  "scripts": {
38
- "build": "node ./scripts/build.mjs && shx cp ./scripts/mixedEntypoint.js ./dist/index.js && tsc --p tsconfig.json",
51
+ "build": "node ./scripts/build.mjs && shx cp ./scripts/mixedEntypoint.js ./dist/index.cjs && tsc --p tsconfig.json && shx cp ./dist/index.d.ts ./dist/index.d.cts",
39
52
  "test": "jest --passWithNoTests",
40
53
  "test:watch": "jest --watch",
41
54
  "test:coverage": "jest --silent --ci --coverage --coverageReporters=\"text\" --coverageReporters=\"text-summary\""