@learncard/did-web-plugin 1.0.81 → 1.1.1
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/README.md +2 -2
- package/dist/did-web-plugin.cjs.development.js +7 -8
- package/dist/did-web-plugin.cjs.development.js.map +1 -1
- package/dist/did-web-plugin.cjs.production.min.js +1 -1
- package/dist/did-web-plugin.cjs.production.min.js.map +2 -2
- package/dist/did-web-plugin.esm.js +4 -5
- package/dist/did-web-plugin.esm.js.map +1 -1
- package/package.json +7 -7
package/README.md
CHANGED
|
@@ -15,13 +15,13 @@ https://docs.learncard.com
|
|
|
15
15
|
## Install
|
|
16
16
|
|
|
17
17
|
```bash
|
|
18
|
-
pnpm i @learncard/
|
|
18
|
+
pnpm i @learncard/init @learncard/did-web-plugin
|
|
19
19
|
```
|
|
20
20
|
|
|
21
21
|
## Usage
|
|
22
22
|
|
|
23
23
|
```ts
|
|
24
|
-
import { initLearnCard } from '@learncard/
|
|
24
|
+
import { initLearnCard } from '@learncard/init';
|
|
25
25
|
import { getDidWebPlugin } from '@learncard/did-web-plugin';
|
|
26
26
|
|
|
27
27
|
const emptyLearnCard = await initLearnCard();
|
|
@@ -19,11 +19,11 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
19
19
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
20
|
|
|
21
21
|
// src/index.ts
|
|
22
|
-
var
|
|
23
|
-
__export(
|
|
22
|
+
var index_exports = {};
|
|
23
|
+
__export(index_exports, {
|
|
24
24
|
getDidWebPlugin: () => getDidWebPlugin
|
|
25
25
|
});
|
|
26
|
-
module.exports = __toCommonJS(
|
|
26
|
+
module.exports = __toCommonJS(index_exports);
|
|
27
27
|
|
|
28
28
|
// src/plugin.ts
|
|
29
29
|
var getDidWebPlugin = /* @__PURE__ */ __name(async (learnCard, didWeb) => {
|
|
@@ -36,12 +36,11 @@ var getDidWebPlugin = /* @__PURE__ */ __name(async (learnCard, didWeb) => {
|
|
|
36
36
|
displayName: "DID Web",
|
|
37
37
|
description: "The LearnCard DID Web Plugin is a plugin for adding did-web support to a LearnCard agent for signing VCs.",
|
|
38
38
|
id: {
|
|
39
|
-
did: (_learnCard, method) => {
|
|
40
|
-
if (!method || method === "web")
|
|
41
|
-
return didWeb;
|
|
39
|
+
did: /* @__PURE__ */ __name((_learnCard, method) => {
|
|
40
|
+
if (!method || method === "web") return didWeb;
|
|
42
41
|
return learnCard.id.did(method);
|
|
43
|
-
},
|
|
44
|
-
keypair: (_learnCard, algorithm) => learnCard.id.keypair(algorithm)
|
|
42
|
+
}, "did"),
|
|
43
|
+
keypair: /* @__PURE__ */ __name((_learnCard, algorithm) => learnCard.id.keypair(algorithm), "keypair")
|
|
45
44
|
},
|
|
46
45
|
methods: {}
|
|
47
46
|
};
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/index.ts", "../src/plugin.ts"],
|
|
4
4
|
"sourcesContent": ["export * from './types';\nexport * from './plugin';\n", "import { LearnCard } from '@learncard/core';\n\nimport { DidWebPluginDependentMethods, DidWebPlugin } from './types';\nexport * from './types';\n\n/**\n * @group Plugins\n */\nexport const getDidWebPlugin = async (\n learnCard: LearnCard<any, 'id', DidWebPluginDependentMethods>,\n didWeb: string\n): Promise<DidWebPlugin> => {\n learnCard?.debug?.('Adding DID Web Plugin');\n if (!didWeb.includes('did:web:')) {\n throw new Error('Must provide a valid did:web DID into constructor.');\n }\n\n return {\n name: 'DID Web',\n displayName: 'DID Web',\n description:\n 'The LearnCard DID Web Plugin is a plugin for adding did-web support to a LearnCard agent for signing VCs.',\n id: {\n did: (_learnCard, method) => {\n if (!method || method === 'web') return didWeb;\n\n return learnCard.id.did(method);\n },\n keypair: (_learnCard, algorithm) => learnCard.id.keypair(algorithm),\n },\n methods: {},\n };\n};\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACQO,IAAM,kBAAkB,8BAC3B,WACA,WACwB;AACxB,aAAW,QAAQ,uBAAuB;AAC1C,MAAI,CAAC,OAAO,SAAS,UAAU,GAAG;AAC9B,UAAM,IAAI,MAAM,oDAAoD;AAAA,EACxE;AAEA,SAAO;AAAA,IACH,MAAM;AAAA,IACN,aAAa;AAAA,IACb,aACI;AAAA,IACJ,IAAI;AAAA,MACA,KAAK,
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACQO,IAAM,kBAAkB,8BAC3B,WACA,WACwB;AACxB,aAAW,QAAQ,uBAAuB;AAC1C,MAAI,CAAC,OAAO,SAAS,UAAU,GAAG;AAC9B,UAAM,IAAI,MAAM,oDAAoD;AAAA,EACxE;AAEA,SAAO;AAAA,IACH,MAAM;AAAA,IACN,aAAa;AAAA,IACb,aACI;AAAA,IACJ,IAAI;AAAA,MACA,KAAK,wBAAC,YAAY,WAAW;AACzB,YAAI,CAAC,UAAU,WAAW,MAAO,QAAO;AAExC,eAAO,UAAU,GAAG,IAAI,MAAM;AAAA,MAClC,GAJK;AAAA,MAKL,SAAS,wBAAC,YAAY,cAAc,UAAU,GAAG,QAAQ,SAAS,GAAzD;AAAA,IACb;AAAA,IACA,SAAS,CAAC;AAAA,EACd;AACJ,GAxB+B;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var o=Object.defineProperty;var a=Object.getOwnPropertyDescriptor;var D=Object.getOwnPropertyNames;var g=Object.prototype.hasOwnProperty;var t=(i,e)=>o(i,"name",{value:e,configurable:!0});var p=(i,e)=>{for(var d in e)o(i,d,{get:e[d],enumerable:!0})},s=(i,e,d,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of D(e))!g.call(i,n)&&n!==d&&o(i,n,{get:()=>e[n],enumerable:!(r=a(e,n))||r.enumerable});return i};var u=i=>s(o({},"__esModule",{value:!0}),i);var l={};p(l,{getDidWebPlugin:()=>b});module.exports=u(l);var b=t(async(i,e)=>{if(i?.debug?.("Adding DID Web Plugin"),!e.includes("did:web:"))throw new Error("Must provide a valid did:web DID into constructor.");return{name:"DID Web",displayName:"DID Web",description:"The LearnCard DID Web Plugin is a plugin for adding did-web support to a LearnCard agent for signing VCs.",id:{did:(d,r)=>!r||r==="web"?e:i.id.did(r),keypair:(d,r)=>i.id.keypair(r)},methods:{}}},"getDidWebPlugin");
|
|
1
|
+
"use strict";var o=Object.defineProperty;var a=Object.getOwnPropertyDescriptor;var D=Object.getOwnPropertyNames;var g=Object.prototype.hasOwnProperty;var t=(i,e)=>o(i,"name",{value:e,configurable:!0});var p=(i,e)=>{for(var d in e)o(i,d,{get:e[d],enumerable:!0})},s=(i,e,d,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of D(e))!g.call(i,n)&&n!==d&&o(i,n,{get:()=>e[n],enumerable:!(r=a(e,n))||r.enumerable});return i};var u=i=>s(o({},"__esModule",{value:!0}),i);var l={};p(l,{getDidWebPlugin:()=>b});module.exports=u(l);var b=t(async(i,e)=>{if(i?.debug?.("Adding DID Web Plugin"),!e.includes("did:web:"))throw new Error("Must provide a valid did:web DID into constructor.");return{name:"DID Web",displayName:"DID Web",description:"The LearnCard DID Web Plugin is a plugin for adding did-web support to a LearnCard agent for signing VCs.",id:{did:t((d,r)=>!r||r==="web"?e:i.id.did(r),"did"),keypair:t((d,r)=>i.id.keypair(r),"keypair")},methods:{}}},"getDidWebPlugin");
|
|
2
2
|
//# sourceMappingURL=did-web-plugin.cjs.production.min.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/index.ts", "../src/plugin.ts"],
|
|
4
4
|
"sourcesContent": ["export * from './types';\nexport * from './plugin';\n", "import { LearnCard } from '@learncard/core';\n\nimport { DidWebPluginDependentMethods, DidWebPlugin } from './types';\nexport * from './types';\n\n/**\n * @group Plugins\n */\nexport const getDidWebPlugin = async (\n learnCard: LearnCard<any, 'id', DidWebPluginDependentMethods>,\n didWeb: string\n): Promise<DidWebPlugin> => {\n learnCard?.debug?.('Adding DID Web Plugin');\n if (!didWeb.includes('did:web:')) {\n throw new Error('Must provide a valid did:web DID into constructor.');\n }\n\n return {\n name: 'DID Web',\n displayName: 'DID Web',\n description:\n 'The LearnCard DID Web Plugin is a plugin for adding did-web support to a LearnCard agent for signing VCs.',\n id: {\n did: (_learnCard, method) => {\n if (!method || method === 'web') return didWeb;\n\n return learnCard.id.did(method);\n },\n keypair: (_learnCard, algorithm) => learnCard.id.keypair(algorithm),\n },\n methods: {},\n };\n};\n"],
|
|
5
|
-
"mappings": "4dAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,qBAAAE,IAAA,eAAAC,EAAAH,GCQO,IAAMI,EAAkBC,EAAA,MAC3BC,EACAC,IACwB,CAExB,GADAD,GAAW,QAAQ,uBAAuB,EACtC,CAACC,EAAO,SAAS,UAAU,EAC3B,MAAM,IAAI,MAAM,oDAAoD,EAGxE,MAAO,CACH,KAAM,UACN,YAAa,UACb,YACI,4GACJ,GAAI,CACA,
|
|
6
|
-
"names": ["
|
|
5
|
+
"mappings": "4dAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,qBAAAE,IAAA,eAAAC,EAAAH,GCQO,IAAMI,EAAkBC,EAAA,MAC3BC,EACAC,IACwB,CAExB,GADAD,GAAW,QAAQ,uBAAuB,EACtC,CAACC,EAAO,SAAS,UAAU,EAC3B,MAAM,IAAI,MAAM,oDAAoD,EAGxE,MAAO,CACH,KAAM,UACN,YAAa,UACb,YACI,4GACJ,GAAI,CACA,IAAKF,EAAA,CAACG,EAAYC,IACV,CAACA,GAAUA,IAAW,MAAcF,EAEjCD,EAAU,GAAG,IAAIG,CAAM,EAH7B,OAKL,QAASJ,EAAA,CAACG,EAAYE,IAAcJ,EAAU,GAAG,QAAQI,CAAS,EAAzD,UACb,EACA,QAAS,CAAC,CACd,CACJ,EAxB+B",
|
|
6
|
+
"names": ["index_exports", "__export", "getDidWebPlugin", "__toCommonJS", "getDidWebPlugin", "__name", "learnCard", "didWeb", "_learnCard", "method", "algorithm"]
|
|
7
7
|
}
|
|
@@ -12,12 +12,11 @@ var getDidWebPlugin = /* @__PURE__ */ __name(async (learnCard, didWeb) => {
|
|
|
12
12
|
displayName: "DID Web",
|
|
13
13
|
description: "The LearnCard DID Web Plugin is a plugin for adding did-web support to a LearnCard agent for signing VCs.",
|
|
14
14
|
id: {
|
|
15
|
-
did: (_learnCard, method) => {
|
|
16
|
-
if (!method || method === "web")
|
|
17
|
-
return didWeb;
|
|
15
|
+
did: /* @__PURE__ */ __name((_learnCard, method) => {
|
|
16
|
+
if (!method || method === "web") return didWeb;
|
|
18
17
|
return learnCard.id.did(method);
|
|
19
|
-
},
|
|
20
|
-
keypair: (_learnCard, algorithm) => learnCard.id.keypair(algorithm)
|
|
18
|
+
}, "did"),
|
|
19
|
+
keypair: /* @__PURE__ */ __name((_learnCard, algorithm) => learnCard.id.keypair(algorithm), "keypair")
|
|
21
20
|
},
|
|
22
21
|
methods: {}
|
|
23
22
|
};
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/plugin.ts"],
|
|
4
4
|
"sourcesContent": ["import { LearnCard } from '@learncard/core';\n\nimport { DidWebPluginDependentMethods, DidWebPlugin } from './types';\nexport * from './types';\n\n/**\n * @group Plugins\n */\nexport const getDidWebPlugin = async (\n learnCard: LearnCard<any, 'id', DidWebPluginDependentMethods>,\n didWeb: string\n): Promise<DidWebPlugin> => {\n learnCard?.debug?.('Adding DID Web Plugin');\n if (!didWeb.includes('did:web:')) {\n throw new Error('Must provide a valid did:web DID into constructor.');\n }\n\n return {\n name: 'DID Web',\n displayName: 'DID Web',\n description:\n 'The LearnCard DID Web Plugin is a plugin for adding did-web support to a LearnCard agent for signing VCs.',\n id: {\n did: (_learnCard, method) => {\n if (!method || method === 'web') return didWeb;\n\n return learnCard.id.did(method);\n },\n keypair: (_learnCard, algorithm) => learnCard.id.keypair(algorithm),\n },\n methods: {},\n };\n};\n"],
|
|
5
|
-
"mappings": ";;;;AAQO,IAAM,kBAAkB,8BAC3B,WACA,WACwB;AACxB,aAAW,QAAQ,uBAAuB;AAC1C,MAAI,CAAC,OAAO,SAAS,UAAU,GAAG;AAC9B,UAAM,IAAI,MAAM,oDAAoD;AAAA,EACxE;AAEA,SAAO;AAAA,IACH,MAAM;AAAA,IACN,aAAa;AAAA,IACb,aACI;AAAA,IACJ,IAAI;AAAA,MACA,KAAK,
|
|
5
|
+
"mappings": ";;;;AAQO,IAAM,kBAAkB,8BAC3B,WACA,WACwB;AACxB,aAAW,QAAQ,uBAAuB;AAC1C,MAAI,CAAC,OAAO,SAAS,UAAU,GAAG;AAC9B,UAAM,IAAI,MAAM,oDAAoD;AAAA,EACxE;AAEA,SAAO;AAAA,IACH,MAAM;AAAA,IACN,aAAa;AAAA,IACb,aACI;AAAA,IACJ,IAAI;AAAA,MACA,KAAK,wBAAC,YAAY,WAAW;AACzB,YAAI,CAAC,UAAU,WAAW,MAAO,QAAO;AAExC,eAAO,UAAU,GAAG,IAAI,MAAM;AAAA,MAClC,GAJK;AAAA,MAKL,SAAS,wBAAC,YAAY,cAAc,UAAU,GAAG,QAAQ,SAAS,GAAzD;AAAA,IACb;AAAA,IACA,SAAS,CAAC;AAAA,EACd;AACJ,GAxB+B;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@learncard/did-web-plugin",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/did-web-plugin.esm.js",
|
|
@@ -9,30 +9,30 @@
|
|
|
9
9
|
],
|
|
10
10
|
"author": "Learning Economy Foundation (www.learningeconomy.io)",
|
|
11
11
|
"license": "MIT",
|
|
12
|
-
"homepage": "https://github.com/
|
|
12
|
+
"homepage": "https://github.com/learningeconomy/LearnCard/tree/main/packages/plugins/did-web-plugin/README.md",
|
|
13
13
|
"repository": {
|
|
14
14
|
"type": "git",
|
|
15
|
-
"url": "
|
|
15
|
+
"url": "https://github.com/learningeconomy/LearnCard"
|
|
16
16
|
},
|
|
17
17
|
"bugs": {
|
|
18
|
-
"url": "https://github.com/
|
|
18
|
+
"url": "https://github.com/learningeconomy/LearnCard/issues"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
21
|
"@types/jest": "^29.2.2",
|
|
22
22
|
"@types/node": "^17.0.31",
|
|
23
23
|
"aqu": "0.4.3",
|
|
24
24
|
"dids": "^3.2.0",
|
|
25
|
-
"esbuild": "^0.
|
|
25
|
+
"esbuild": "^0.27.1",
|
|
26
26
|
"esbuild-jest": "^0.5.0",
|
|
27
27
|
"esbuild-plugin-copy": "^1.3.0",
|
|
28
28
|
"jest": "^29.3.0",
|
|
29
29
|
"shx": "^0.3.4",
|
|
30
30
|
"ts-jest": "^29.0.3",
|
|
31
|
-
"@learncard/types": "5.
|
|
31
|
+
"@learncard/types": "5.11.0"
|
|
32
32
|
},
|
|
33
33
|
"types": "./dist/index.d.ts",
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@learncard/core": "9.
|
|
35
|
+
"@learncard/core": "9.4.1"
|
|
36
36
|
},
|
|
37
37
|
"scripts": {
|
|
38
38
|
"build": "node ./scripts/build.mjs && shx cp ./scripts/mixedEntypoint.js ./dist/index.js && tsc --p tsconfig.json",
|