@learncard/did-web-plugin 1.0.55 → 1.0.57
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/did-web-plugin.cjs.development.js +0 -1
- package/dist/did-web-plugin.cjs.development.js.map +2 -2
- package/dist/did-web-plugin.cjs.production.min.js +1 -1
- package/dist/did-web-plugin.cjs.production.min.js.map +3 -3
- package/dist/did-web-plugin.esm.js +0 -1
- package/dist/did-web-plugin.esm.js.map +2 -2
- package/dist/plugin.d.ts.map +1 -1
- package/dist/types.d.ts +2 -9
- package/dist/types.d.ts.map +1 -1
- package/package.json +4 -13
- package/dist/test/index.test.d.ts +0 -2
- package/dist/test/index.test.d.ts.map +0 -1
@@ -27,7 +27,6 @@ module.exports = __toCommonJS(src_exports);
|
|
27
27
|
|
28
28
|
// src/plugin.ts
|
29
29
|
var getDidWebPlugin = /* @__PURE__ */ __name(async (learnCard, didWeb) => {
|
30
|
-
const existingDid = learnCard.id.did();
|
31
30
|
learnCard?.debug?.("Adding DID Web Plugin");
|
32
31
|
if (!didWeb.includes("did:web:")) {
|
33
32
|
throw new Error("Must provide a valid did:web DID into constructor.");
|
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../src/index.ts", "../src/plugin.ts"],
|
4
|
-
"sourcesContent": ["export * from './types';\nexport * from './plugin';\n", "import { LearnCard } from '@learncard/core';\n\nimport { DidWebPluginDependentMethods,
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACQO,IAAM,kBAAkB,8BAC3B,WACA,WACwB;AACxB,
|
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,CAAC,YAAY,WAAW;AACzB,YAAI,CAAC,UAAU,WAAW;AAAO,iBAAO;AAExC,eAAO,UAAU,GAAG,IAAI,MAAM;AAAA,MAClC;AAAA,MACA,SAAS,CAAC,YAAY,cAAc,UAAU,GAAG,QAAQ,SAAS;AAAA,IACtE;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
|
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");
|
2
2
|
//# sourceMappingURL=did-web-plugin.cjs.production.min.js.map
|
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../src/index.ts", "../src/plugin.ts"],
|
4
|
-
"sourcesContent": ["export * from './types';\nexport * from './plugin';\n", "import { LearnCard } from '@learncard/core';\n\nimport { DidWebPluginDependentMethods,
|
5
|
-
"mappings": "4dAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,qBAAAE,IAAA,eAAAC,EAAAH,GCQO,IAAMI,EAAkBC,EAAA,MAC3BC,EACAC,IACwB,
|
6
|
-
"names": ["src_exports", "__export", "getDidWebPlugin", "__toCommonJS", "getDidWebPlugin", "__name", "learnCard", "didWeb", "
|
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,IAAK,CAACC,EAAYC,IACV,CAACA,GAAUA,IAAW,MAAcF,EAEjCD,EAAU,GAAG,IAAIG,CAAM,EAElC,QAAS,CAACD,EAAYE,IAAcJ,EAAU,GAAG,QAAQI,CAAS,CACtE,EACA,QAAS,CAAC,CACd,CACJ,EAxB+B",
|
6
|
+
"names": ["src_exports", "__export", "getDidWebPlugin", "__toCommonJS", "getDidWebPlugin", "__name", "learnCard", "didWeb", "_learnCard", "method", "algorithm"]
|
7
7
|
}
|
@@ -3,7 +3,6 @@ var __name = (target, value) => __defProp(target, "name", { value, configurable:
|
|
3
3
|
|
4
4
|
// src/plugin.ts
|
5
5
|
var getDidWebPlugin = /* @__PURE__ */ __name(async (learnCard, didWeb) => {
|
6
|
-
const existingDid = learnCard.id.did();
|
7
6
|
learnCard?.debug?.("Adding DID Web Plugin");
|
8
7
|
if (!didWeb.includes("did:web:")) {
|
9
8
|
throw new Error("Must provide a valid did:web DID into constructor.");
|
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../src/plugin.ts"],
|
4
|
-
"sourcesContent": ["import { LearnCard } from '@learncard/core';\n\nimport { DidWebPluginDependentMethods,
|
5
|
-
"mappings": ";;;;AAQO,IAAM,kBAAkB,8BAC3B,WACA,WACwB;AACxB,
|
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,CAAC,YAAY,WAAW;AACzB,YAAI,CAAC,UAAU,WAAW;AAAO,iBAAO;AAExC,eAAO,UAAU,GAAG,IAAI,MAAM;AAAA,MAClC;AAAA,MACA,SAAS,CAAC,YAAY,cAAc,UAAU,GAAG,QAAQ,SAAS;AAAA,IACtE;AAAA,IACA,SAAS,CAAC;AAAA,EACd;AACJ,GAxB+B;",
|
6
6
|
"names": []
|
7
7
|
}
|
package/dist/plugin.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,OAAO,EAAE,4BAA4B,
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,OAAO,EAAE,4BAA4B,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACrE,cAAc,SAAS,CAAC;AAExB;;GAEG;AACH,eAAO,MAAM,eAAe,cACb,SAAS,CAAC,GAAG,EAAE,IAAI,EAAE,4BAA4B,CAAC,UACrD,MAAM,KACf,OAAO,CAAC,YAAY,CAqBtB,CAAC"}
|
package/dist/types.d.ts
CHANGED
@@ -1,15 +1,8 @@
|
|
1
|
-
import type { DID } from 'dids';
|
2
|
-
import { UnsignedVC, VC, VP } from '@learncard/types';
|
3
1
|
import { Plugin } from '@learncard/core';
|
4
|
-
import { ProofOptions } from '@learncard/didkit-plugin';
|
5
2
|
/** @group DID Web Plugin */
|
6
|
-
export type DidWebPluginDependentMethods = {
|
7
|
-
getDIDObject: () => DID;
|
8
|
-
getDidAuthVp: (options?: ProofOptions) => Promise<VP | string>;
|
9
|
-
issueCredential: (credential: UnsignedVC, signingOptions?: Partial<ProofOptions>) => Promise<VC>;
|
10
|
-
};
|
3
|
+
export type DidWebPluginDependentMethods = {};
|
11
4
|
/** @group DID Web Plugin */
|
12
5
|
export type DidWebPluginMethods = {};
|
13
6
|
/** @group DID Web Plugin */
|
14
|
-
export type DidWebPlugin = Plugin<'DID Web', 'id'
|
7
|
+
export type DidWebPlugin = Plugin<'DID Web', 'id'>;
|
15
8
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAEzC,4BAA4B;AAC5B,MAAM,MAAM,4BAA4B,GAAG,EAAE,CAAC;AAE9C,4BAA4B;AAC5B,MAAM,MAAM,mBAAmB,GAAG,EAAE,CAAC;AAErC,4BAA4B;AAC5B,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@learncard/did-web-plugin",
|
3
|
-
"version": "1.0.
|
3
|
+
"version": "1.0.57",
|
4
4
|
"description": "",
|
5
5
|
"main": "./dist/index.js",
|
6
6
|
"module": "./dist/did-web-plugin.esm.js",
|
@@ -28,24 +28,15 @@
|
|
28
28
|
"jest": "^29.3.0",
|
29
29
|
"shx": "^0.3.4",
|
30
30
|
"ts-jest": "^29.0.3",
|
31
|
-
"@learncard/types": "5.6.
|
31
|
+
"@learncard/types": "5.6.7"
|
32
32
|
},
|
33
33
|
"types": "./dist/index.d.ts",
|
34
34
|
"dependencies": {
|
35
|
-
"@learncard/
|
36
|
-
"@learncard/core": "9.3.18",
|
37
|
-
"@learncard/didkey-plugin": "1.0.29",
|
38
|
-
"@learncard/didkit-plugin": "^1.5.3",
|
39
|
-
"@learncard/expiration-plugin": "1.1.32",
|
40
|
-
"@learncard/helpers": "1.1.8",
|
41
|
-
"@learncard/learn-card-plugin": "1.1.31",
|
42
|
-
"@learncard/types": "5.6.6",
|
43
|
-
"@learncard/vc-plugin": "1.1.32",
|
44
|
-
"@learncard/vc-templates-plugin": "1.0.39"
|
35
|
+
"@learncard/core": "9.3.20"
|
45
36
|
},
|
46
37
|
"scripts": {
|
47
38
|
"build": "node ./scripts/build.mjs && shx cp ./scripts/mixedEntypoint.js ./dist/index.js && tsc --p tsconfig.json",
|
48
|
-
"test": "jest",
|
39
|
+
"test": "jest --passWithNoTests",
|
49
40
|
"test:watch": "jest --watch",
|
50
41
|
"test:coverage": "jest --silent --ci --coverage --coverageReporters=\"text\" --coverageReporters=\"text-summary\""
|
51
42
|
}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.test.d.ts","sourceRoot":"","sources":["../../src/test/index.test.ts"],"names":[],"mappings":""}
|