@learncard/expiration-plugin 1.2.20 → 1.2.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{expiration-plugin.cjs.development.js → expiration-plugin.cjs.development.cjs} +1 -1
- package/dist/{expiration-plugin.cjs.production.min.js → expiration-plugin.cjs.production.min.cjs} +1 -1
- package/dist/{index.js → index.cjs} +2 -2
- package/dist/index.d.cts +9 -0
- package/package.json +18 -5
- /package/dist/{expiration-plugin.cjs.development.js.map → expiration-plugin.cjs.development.cjs.map} +0 -0
- /package/dist/{expiration-plugin.cjs.production.min.js.map → expiration-plugin.cjs.production.min.cjs.map} +0 -0
package/dist/{expiration-plugin.cjs.production.min.js → expiration-plugin.cjs.production.min.cjs}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use strict";var o=Object.defineProperty;var s=Object.getOwnPropertyDescriptor;var p=Object.getOwnPropertyNames;var x=Object.prototype.hasOwnProperty;var t=(r,e)=>o(r,"name",{value:e,configurable:!0});var l=(r,e)=>{for(var i in e)o(r,i,{get:e[i],enumerable:!0})},d=(r,e,i,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of p(e))!x.call(r,n)&&n!==i&&o(r,n,{get:()=>e[n],enumerable:!(a=s(e,n))||a.enumerable});return r};var m=r=>d(o({},"__esModule",{value:!0}),r);var v={};l(v,{expirationPlugin:()=>f});module.exports=m(v);var f=t(r=>({name:"Expiration",displayName:"Expiration Extension",description:"Adds a check to make sure credentials aren't expired when verifying them",methods:{verifyCredential:t(async(e,i,a)=>{let n=await r.invoke.verifyCredential(i,a);return i.expirationDate&&new Date>new Date(i.expirationDate)?n.errors.push("expiration error: Credential is expired"):i.validFrom&&new Date<new Date(i.validFrom)?n.errors.push("expiration error: Credential is not valid yet"):i.validUntil&&new Date>new Date(i.validUntil)?n.errors.push("expiration error: Credential is no longer valid"):n.checks.push("expiration"),n},"verifyCredential")}}),"expirationPlugin");
|
|
2
|
-
//# sourceMappingURL=expiration-plugin.cjs.production.min.
|
|
2
|
+
//# sourceMappingURL=expiration-plugin.cjs.production.min.cjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
if (process.env.NODE_ENV === 'production') {
|
|
4
|
-
module.exports = require('./expiration-plugin.cjs.production.min.
|
|
4
|
+
module.exports = require('./expiration-plugin.cjs.production.min.cjs');
|
|
5
5
|
} else {
|
|
6
|
-
module.exports = require('./expiration-plugin.cjs.development.
|
|
6
|
+
module.exports = require('./expiration-plugin.cjs.development.cjs');
|
|
7
7
|
}
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { VerifyExtension } from '@learncard/vc-plugin';
|
|
2
|
+
import { LearnCard } from '@learncard/core';
|
|
3
|
+
import { ExpirationPlugin } from './types';
|
|
4
|
+
export * from './types';
|
|
5
|
+
/**
|
|
6
|
+
* @group Plugins
|
|
7
|
+
*/
|
|
8
|
+
export declare const expirationPlugin: (learnCard: LearnCard<any, any, VerifyExtension>) => ExpirationPlugin;
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,9 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@learncard/expiration-plugin",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.21",
|
|
4
4
|
"description": "",
|
|
5
|
-
"
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.cjs",
|
|
6
7
|
"module": "./dist/expiration-plugin.esm.js",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"import": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"default": "./dist/expiration-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
|
],
|
|
@@ -31,12 +44,12 @@
|
|
|
31
44
|
"types": "./dist/index.d.ts",
|
|
32
45
|
"dependencies": {
|
|
33
46
|
"why-is-node-running": "^2.2.2",
|
|
34
|
-
"@learncard/core": "9.4.
|
|
35
|
-
"@learncard/vc-plugin": "^1.5.
|
|
47
|
+
"@learncard/core": "9.4.21",
|
|
48
|
+
"@learncard/vc-plugin": "^1.5.1"
|
|
36
49
|
},
|
|
37
50
|
"sideEffects": false,
|
|
38
51
|
"scripts": {
|
|
39
|
-
"build": "node ./scripts/build.mjs && shx cp ./scripts/mixedEntypoint.js ./dist/index.
|
|
52
|
+
"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",
|
|
40
53
|
"test": "jest --passWithNoTests",
|
|
41
54
|
"test:watch": "jest --watch",
|
|
42
55
|
"test:coverage": "jest --silent --ci --coverage --coverageReporters=\"text\" --coverageReporters=\"text-summary\""
|
/package/dist/{expiration-plugin.cjs.development.js.map → expiration-plugin.cjs.development.cjs.map}
RENAMED
|
File without changes
|
|
File without changes
|