@learncard/expiration-plugin 1.2.19 → 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.
@@ -44,4 +44,4 @@ var expirationPlugin = /* @__PURE__ */ __name((learnCard) => ({
44
44
  }, "verifyCredential")
45
45
  }
46
46
  }), "expirationPlugin");
47
- //# sourceMappingURL=expiration-plugin.cjs.development.js.map
47
+ //# sourceMappingURL=expiration-plugin.cjs.development.cjs.map
@@ -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.js.map
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.js');
4
+ module.exports = require('./expiration-plugin.cjs.production.min.cjs');
5
5
  } else {
6
- module.exports = require('./expiration-plugin.cjs.development.js');
6
+ module.exports = require('./expiration-plugin.cjs.development.cjs');
7
7
  }
@@ -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.19",
3
+ "version": "1.2.21",
4
4
  "description": "",
5
- "main": "./dist/index.js",
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.19",
35
- "@learncard/vc-plugin": "^1.4.15"
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.js && tsc --p tsconfig.json",
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\""