@learncard/expiration-plugin 1.0.4 → 1.0.5

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,4 +1,3 @@
1
- "use strict";
2
1
  var __defProp = Object.defineProperty;
3
2
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../src/index.ts"],
4
4
  "sourcesContent": ["import { VerifyExtension } from '@learncard/vc-plugin';\nimport { LearnCard } from '@learncard/core';\nimport { ExpirationPlugin } from './types';\n\nexport * from './types';\n\n/**\n * @group Plugins\n */\nexport const expirationPlugin = (\n learnCard: LearnCard<any, any, VerifyExtension>\n): ExpirationPlugin => ({\n name: 'Expiration',\n displayName: 'Expiration Extension',\n description: \"Adds a check to make sure credentials aren't expired when verifying them\",\n methods: {\n verifyCredential: async (_learnCard, credential) => {\n const verificationCheck = await learnCard.invoke.verifyCredential(credential);\n\n if (credential.expirationDate && new Date() > new Date(credential.expirationDate)) {\n verificationCheck.errors.push('expiration error: Credential is expired');\n } else {\n verificationCheck.checks.push('expiration');\n }\n\n return verificationCheck;\n },\n },\n});\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AASO,IAAM,mBAAmB,wBAC5B,eACoB;AAAA,EACpB,MAAM;AAAA,EACN,aAAa;AAAA,EACb,aAAa;AAAA,EACb,SAAS;AAAA,IACL,kBAAkB,OAAO,YAAY,eAAe;AAChD,YAAM,oBAAoB,MAAM,UAAU,OAAO,iBAAiB,UAAU;AAE5E,UAAI,WAAW,kBAAkB,IAAI,KAAK,IAAI,IAAI,KAAK,WAAW,cAAc,GAAG;AAC/E,0BAAkB,OAAO,KAAK,yCAAyC;AAAA,MAC3E,OAAO;AACH,0BAAkB,OAAO,KAAK,YAAY;AAAA,MAC9C;AAEA,aAAO;AAAA,IACX;AAAA,EACJ;AACJ,IAnBgC;",
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AASO,IAAM,mBAAmB,wBAC5B,cACoB;AAAA,EACpB,MAAM;AAAA,EACN,aAAa;AAAA,EACb,aAAa;AAAA,EACb,SAAS;AAAA,IACL,kBAAkB,OAAO,YAAY,eAAe;AAChD,YAAM,oBAAoB,MAAM,UAAU,OAAO,iBAAiB,UAAU;AAE5E,UAAI,WAAW,kBAAkB,IAAI,KAAK,IAAI,IAAI,KAAK,WAAW,cAAc,GAAG;AAC/E,0BAAkB,OAAO,KAAK,yCAAyC;AAAA,MAC3E,OAAO;AACH,0BAAkB,OAAO,KAAK,YAAY;AAAA,MAC9C;AAEA,aAAO;AAAA,IACX;AAAA,EACJ;AACJ,IAnBgC;",
6
6
  "names": []
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var t=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var s=Object.getOwnPropertyNames;var x=Object.prototype.hasOwnProperty;var o=(i,e)=>t(i,"name",{value:e,configurable:!0});var d=(i,e)=>{for(var r in e)t(i,r,{get:e[r],enumerable:!0})},m=(i,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of s(e))!x.call(i,a)&&a!==r&&t(i,a,{get:()=>e[a],enumerable:!(n=p(e,a))||n.enumerable});return i};var f=i=>m(t({},"__esModule",{value:!0}),i);var y={};d(y,{expirationPlugin:()=>c});module.exports=f(y);var c=o(i=>({name:"Expiration",displayName:"Expiration Extension",description:"Adds a check to make sure credentials aren't expired when verifying them",methods:{verifyCredential:async(e,r)=>{let n=await i.invoke.verifyCredential(r);return r.expirationDate&&new Date>new Date(r.expirationDate)?n.errors.push("expiration error: Credential is expired"):n.checks.push("expiration"),n}}}),"expirationPlugin");
1
+ var t=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var s=Object.getOwnPropertyNames;var x=Object.prototype.hasOwnProperty;var o=(i,e)=>t(i,"name",{value:e,configurable:!0});var d=(i,e)=>{for(var r in e)t(i,r,{get:e[r],enumerable:!0})},m=(i,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of s(e))!x.call(i,a)&&a!==r&&t(i,a,{get:()=>e[a],enumerable:!(n=p(e,a))||n.enumerable});return i};var f=i=>m(t({},"__esModule",{value:!0}),i);var y={};d(y,{expirationPlugin:()=>c});module.exports=f(y);var c=o(i=>({name:"Expiration",displayName:"Expiration Extension",description:"Adds a check to make sure credentials aren't expired when verifying them",methods:{verifyCredential:async(e,r)=>{let n=await i.invoke.verifyCredential(r);return r.expirationDate&&new Date>new Date(r.expirationDate)?n.errors.push("expiration error: Credential is expired"):n.checks.push("expiration"),n}}}),"expirationPlugin");
2
2
  //# sourceMappingURL=expiration-plugin.cjs.production.min.js.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../src/index.ts"],
4
4
  "sourcesContent": ["import { VerifyExtension } from '@learncard/vc-plugin';\nimport { LearnCard } from '@learncard/core';\nimport { ExpirationPlugin } from './types';\n\nexport * from './types';\n\n/**\n * @group Plugins\n */\nexport const expirationPlugin = (\n learnCard: LearnCard<any, any, VerifyExtension>\n): ExpirationPlugin => ({\n name: 'Expiration',\n displayName: 'Expiration Extension',\n description: \"Adds a check to make sure credentials aren't expired when verifying them\",\n methods: {\n verifyCredential: async (_learnCard, credential) => {\n const verificationCheck = await learnCard.invoke.verifyCredential(credential);\n\n if (credential.expirationDate && new Date() > new Date(credential.expirationDate)) {\n verificationCheck.errors.push('expiration error: Credential is expired');\n } else {\n verificationCheck.checks.push('expiration');\n }\n\n return verificationCheck;\n },\n },\n});\n"],
5
- "mappings": "4dAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,sBAAAE,IAAA,eAAAC,EAAAH,GASO,IAAMI,EAAmBC,EAC5BC,IACoB,CACpB,KAAM,aACN,YAAa,uBACb,YAAa,2EACb,QAAS,CACL,iBAAkB,MAAOC,EAAYC,IAAe,CAChD,IAAMC,EAAoB,MAAMH,EAAU,OAAO,iBAAiBE,CAAU,EAE5E,OAAIA,EAAW,gBAAkB,IAAI,KAAS,IAAI,KAAKA,EAAW,cAAc,EAC5EC,EAAkB,OAAO,KAAK,yCAAyC,EAEvEA,EAAkB,OAAO,KAAK,YAAY,EAGvCA,CACX,CACJ,CACJ,GAnBgC",
6
- "names": ["src_exports", "__export", "expirationPlugin", "__toCommonJS", "expirationPlugin", "__name", "learnCard", "_learnCard", "credential", "verificationCheck"]
5
+ "mappings": "+cAAA,2DASO,GAAM,GAAmB,EAC5B,GACoB,EACpB,KAAM,aACN,YAAa,uBACb,YAAa,2EACb,QAAS,CACL,iBAAkB,MAAO,EAAY,IAAe,CAChD,GAAM,GAAoB,KAAM,GAAU,OAAO,iBAAiB,CAAU,EAE5E,MAAI,GAAW,gBAAkB,GAAI,MAAS,GAAI,MAAK,EAAW,cAAc,EAC5E,EAAkB,OAAO,KAAK,yCAAyC,EAEvE,EAAkB,OAAO,KAAK,YAAY,EAGvC,CACX,CACJ,CACJ,GAnBgC",
6
+ "names": []
7
7
  }
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../src/index.ts"],
4
4
  "sourcesContent": ["import { VerifyExtension } from '@learncard/vc-plugin';\nimport { LearnCard } from '@learncard/core';\nimport { ExpirationPlugin } from './types';\n\nexport * from './types';\n\n/**\n * @group Plugins\n */\nexport const expirationPlugin = (\n learnCard: LearnCard<any, any, VerifyExtension>\n): ExpirationPlugin => ({\n name: 'Expiration',\n displayName: 'Expiration Extension',\n description: \"Adds a check to make sure credentials aren't expired when verifying them\",\n methods: {\n verifyCredential: async (_learnCard, credential) => {\n const verificationCheck = await learnCard.invoke.verifyCredential(credential);\n\n if (credential.expirationDate && new Date() > new Date(credential.expirationDate)) {\n verificationCheck.errors.push('expiration error: Credential is expired');\n } else {\n verificationCheck.checks.push('expiration');\n }\n\n return verificationCheck;\n },\n },\n});\n"],
5
- "mappings": ";;;;AASO,IAAM,mBAAmB,wBAC5B,eACoB;AAAA,EACpB,MAAM;AAAA,EACN,aAAa;AAAA,EACb,aAAa;AAAA,EACb,SAAS;AAAA,IACL,kBAAkB,OAAO,YAAY,eAAe;AAChD,YAAM,oBAAoB,MAAM,UAAU,OAAO,iBAAiB,UAAU;AAE5E,UAAI,WAAW,kBAAkB,IAAI,KAAK,IAAI,IAAI,KAAK,WAAW,cAAc,GAAG;AAC/E,0BAAkB,OAAO,KAAK,yCAAyC;AAAA,MAC3E,OAAO;AACH,0BAAkB,OAAO,KAAK,YAAY;AAAA,MAC9C;AAEA,aAAO;AAAA,IACX;AAAA,EACJ;AACJ,IAnBgC;",
5
+ "mappings": ";;;;AASO,IAAM,mBAAmB,wBAC5B,cACoB;AAAA,EACpB,MAAM;AAAA,EACN,aAAa;AAAA,EACb,aAAa;AAAA,EACb,SAAS;AAAA,IACL,kBAAkB,OAAO,YAAY,eAAe;AAChD,YAAM,oBAAoB,MAAM,UAAU,OAAO,iBAAiB,UAAU;AAE5E,UAAI,WAAW,kBAAkB,IAAI,KAAK,IAAI,IAAI,KAAK,WAAW,cAAc,GAAG;AAC/E,0BAAkB,OAAO,KAAK,yCAAyC;AAAA,MAC3E,OAAO;AACH,0BAAkB,OAAO,KAAK,YAAY;AAAA,MAC9C;AAEA,aAAO;AAAA,IACX;AAAA,EACJ;AACJ,IAnBgC;",
6
6
  "names": []
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@learncard/expiration-plugin",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "description": "",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/expiration-plugin.esm.js",
@@ -31,8 +31,8 @@
31
31
  "types": "./dist/index.d.ts",
32
32
  "dependencies": {
33
33
  "why-is-node-running": "^2.2.2",
34
- "@learncard/core": "9.0.2",
35
- "@learncard/vc-plugin": "^1.0.4"
34
+ "@learncard/core": "9.0.3",
35
+ "@learncard/vc-plugin": "^1.0.5"
36
36
  },
37
37
  "scripts": {
38
38
  "build": "node ./scripts/build.mjs && shx cp ./scripts/mixedEntypoint.js ./dist/index.js && tsc --p tsconfig.json",