@learncard/did-web-plugin 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,3 @@
1
+ export * from './types';
2
+ export * from './plugin';
3
+ export * from './learnCard';
package/dist/index.js ADDED
@@ -0,0 +1,7 @@
1
+ 'use strict';
2
+
3
+ if (process.env.NODE_ENV === 'production') {
4
+ module.exports = require('./did-web-plugin.cjs.production.min.js');
5
+ } else {
6
+ module.exports = require('./did-web-plugin.cjs.development.js');
7
+ }
@@ -0,0 +1,6 @@
1
+ import { LearnCardFromSeed, AddPlugin } from '@learncard/core';
2
+ import { DidWebPlugin } from './types';
3
+ export type DidWebLearnCard = AddPlugin<LearnCardFromSeed['returnValue'], DidWebPlugin>;
4
+ export declare const initDidWebLearnCard: (_config: LearnCardFromSeed['args'] & {
5
+ didWeb: string;
6
+ }) => Promise<DidWebLearnCard>;
@@ -0,0 +1,7 @@
1
+ import { LearnCard } from '@learncard/core';
2
+ import { DidWebPluginDependentMethods, DidWebPlugin } from './types';
3
+ export * from './types';
4
+ /**
5
+ * @group Plugins
6
+ */
7
+ export declare const getDidWebPlugin: (learnCard: LearnCard<any, 'id', DidWebPluginDependentMethods>, didWeb: string) => Promise<DidWebPlugin>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,13 @@
1
+ import type { DID } from 'dids';
2
+ import { UnsignedVC, VC, VP } from '@learncard/types';
3
+ import { Plugin, ProofOptions } from '@learncard/core';
4
+ /** @group DID Web Plugin */
5
+ export type DidWebPluginDependentMethods = {
6
+ getDIDObject: () => DID;
7
+ getDidAuthVp: (options?: ProofOptions) => Promise<VP | string>;
8
+ issueCredential: (credential: UnsignedVC, signingOptions?: Partial<ProofOptions>) => Promise<VC>;
9
+ };
10
+ /** @group DID Web Plugin */
11
+ export type DidWebPluginMethods = {};
12
+ /** @group DID Web Plugin */
13
+ export type DidWebPlugin = Plugin<'DID Web', 'id', DidWebPluginMethods, 'id', DidWebPluginDependentMethods>;
package/package.json ADDED
@@ -0,0 +1,43 @@
1
+ {
2
+ "name": "@learncard/did-web-plugin",
3
+ "version": "1.0.0",
4
+ "description": "",
5
+ "main": "./dist/index.js",
6
+ "module": "./dist/did-web-plugin.esm.js",
7
+ "files": [
8
+ "dist"
9
+ ],
10
+ "author": "Learning Economy Foundation (www.learningeconomy.io)",
11
+ "license": "MIT",
12
+ "homepage": "https://github.com/WeLibraryOS/LearnCard#readme",
13
+ "repository": {
14
+ "type": "git",
15
+ "url": "git+https://github.com/WeLibraryOS/LearnCard.git"
16
+ },
17
+ "bugs": {
18
+ "url": "https://github.com/WeLibraryOS/LearnCard/issues"
19
+ },
20
+ "devDependencies": {
21
+ "@types/jest": "^29.2.2",
22
+ "@types/node": "^17.0.31",
23
+ "aqu": "0.4.3",
24
+ "dids": "^3.2.0",
25
+ "esbuild": "^0.14.38",
26
+ "esbuild-jest": "^0.5.0",
27
+ "esbuild-plugin-copy": "^1.3.0",
28
+ "jest": "^29.3.0",
29
+ "shx": "^0.3.4",
30
+ "ts-jest": "^29.0.3",
31
+ "@learncard/types": "5.2.3"
32
+ },
33
+ "types": "./dist/index.d.ts",
34
+ "dependencies": {
35
+ "@learncard/core": "8.5.3"
36
+ },
37
+ "scripts": {
38
+ "build": "node ./scripts/build.mjs && shx cp ./scripts/mixedEntypoint.js ./dist/index.js && tsc --p tsconfig.json",
39
+ "test": "jest",
40
+ "test:watch": "jest --watch",
41
+ "test:coverage": "jest --silent --ci --coverage --coverageReporters=\"text\" --coverageReporters=\"text-summary\""
42
+ }
43
+ }