@learncard/expiration-plugin 1.0.4 → 1.0.6
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/expiration-plugin.cjs.development.js +0 -1
- package/dist/expiration-plugin.cjs.development.js.map +1 -1
- package/dist/expiration-plugin.cjs.production.min.js +1 -1
- package/dist/expiration-plugin.cjs.production.min.js.map +2 -2
- package/dist/expiration-plugin.esm.js.map +1 -1
- package/package.json +3 -3
@@ -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": "
|
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
|
-
|
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": "
|
6
|
-
"names": [
|
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,
|
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.
|
3
|
+
"version": "1.0.6",
|
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.
|
35
|
-
"@learncard/vc-plugin": "^1.0.
|
34
|
+
"@learncard/core": "9.0.3",
|
35
|
+
"@learncard/vc-plugin": "^1.0.6"
|
36
36
|
},
|
37
37
|
"scripts": {
|
38
38
|
"build": "node ./scripts/build.mjs && shx cp ./scripts/mixedEntypoint.js ./dist/index.js && tsc --p tsconfig.json",
|