@learncard/didkit-plugin 1.9.7 → 1.9.9
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/didkit/didkit_wasm.d.ts +29 -29
- package/dist/didkit/didkit_wasm.js +540 -517
- package/dist/didkit/didkit_wasm_bg.wasm +0 -0
- package/dist/didkit/didkit_wasm_bg.wasm.d.ts +3 -3
- package/dist/didkit/index.d.ts +9 -0
- package/dist/didkit/index.d.ts.map +1 -1
- package/dist/didkit-plugin.cjs.development.cjs +336 -326
- package/dist/didkit-plugin.cjs.development.cjs.map +2 -2
- package/dist/didkit-plugin.cjs.production.min.cjs +2 -2
- package/dist/didkit-plugin.cjs.production.min.cjs.map +3 -3
- package/dist/didkit-plugin.esm.js +336 -326
- package/dist/didkit-plugin.esm.js.map +2 -2
- package/dist/didkit_wasm.d.ts +29 -29
- package/dist/didkit_wasm.js +540 -517
- package/dist/didkit_wasm_bg.wasm +0 -0
- package/dist/didkit_wasm_bg.wasm.d.ts +3 -3
- package/package.json +3 -3
- package/src/didkit/index.ts +12 -3
- package/src/didkit/pkg/didkit_wasm.d.ts +29 -29
- package/src/didkit/pkg/didkit_wasm.js +540 -517
- package/src/didkit/pkg/didkit_wasm_bg.wasm +0 -0
- package/src/didkit/pkg/didkit_wasm_bg.wasm.d.ts +3 -3
package/dist/didkit_wasm_bg.wasm
CHANGED
|
Binary file
|
|
@@ -44,8 +44,8 @@ export const __wbindgen_exn_store: (a: number) => void;
|
|
|
44
44
|
export const __externref_table_alloc: () => number;
|
|
45
45
|
export const __wbindgen_export_4: WebAssembly.Table;
|
|
46
46
|
export const __wbindgen_export_5: WebAssembly.Table;
|
|
47
|
-
export const __externref_table_dealloc: (a: number) => void;
|
|
48
47
|
export const __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
49
|
-
export const
|
|
50
|
-
export const
|
|
48
|
+
export const __externref_table_dealloc: (a: number) => void;
|
|
49
|
+
export const closure4206_externref_shim: (a: number, b: number, c: any) => void;
|
|
50
|
+
export const closure4605_externref_shim: (a: number, b: number, c: any, d: any) => void;
|
|
51
51
|
export const __wbindgen_start: () => void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@learncard/didkit-plugin",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.9",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -60,8 +60,8 @@
|
|
|
60
60
|
},
|
|
61
61
|
"types": "./dist/index.d.ts",
|
|
62
62
|
"dependencies": {
|
|
63
|
-
"@learncard/core": "9.4.
|
|
64
|
-
"@learncard/types": "5.
|
|
63
|
+
"@learncard/core": "9.4.29",
|
|
64
|
+
"@learncard/types": "5.18.1"
|
|
65
65
|
},
|
|
66
66
|
"sideEffects": false
|
|
67
67
|
}
|
package/src/didkit/index.ts
CHANGED
|
@@ -2,12 +2,21 @@ import _init, { InitInput } from './pkg/didkit_wasm';
|
|
|
2
2
|
|
|
3
3
|
export * from './pkg/didkit_wasm';
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* Version-locked with `./pkg/didkit_wasm_bg.wasm`: the glue in `./pkg` only declares the imports
|
|
7
|
+
* of the binary it was generated from, so both must be published together or consumers relying on
|
|
8
|
+
* this default fail to instantiate with a `LinkError`.
|
|
9
|
+
*
|
|
10
|
+
* Kept as a standalone constant so `scripts/set-default-wasm-url.mjs` can rewrite it regardless of
|
|
11
|
+
* how Prettier wraps the `init` signature. Do not inline it back into the parameter list.
|
|
12
|
+
*/
|
|
13
|
+
export const DEFAULT_DIDKIT_WASM_URL =
|
|
14
|
+
'https://assets.learncard.ai/didkit/sha256-60efb6027699fda135db0d817f7a541bbd660ae88bec9cbec9796feeb3740b96/didkit_wasm_bg.wasm';
|
|
15
|
+
|
|
5
16
|
let initialized = false;
|
|
6
17
|
let generating = false; // Mutex flag to allow first init call to acquire a lock
|
|
7
18
|
|
|
8
|
-
export const init = async (
|
|
9
|
-
arg: InitInput | Promise<InitInput> = 'https://cdn.filestackcontent.com/6v059q3KQlmXd6XoVPyC'
|
|
10
|
-
) => {
|
|
19
|
+
export const init = async (arg: InitInput | Promise<InitInput> = DEFAULT_DIDKIT_WASM_URL) => {
|
|
11
20
|
// Do not return until we are done generating!
|
|
12
21
|
while (generating) await new Promise(res => setTimeout(res, 250));
|
|
13
22
|
|
|
@@ -1,40 +1,40 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
|
+
export function getVersion(): string;
|
|
4
|
+
export function completeIssuePresentation(presentation: string, preparation: string, signature: string): Promise<any>;
|
|
5
|
+
export function verifyPresentation(vp: string, proof_options: string, context_map: string): Promise<any>;
|
|
6
|
+
export function DIDAuth(holder: string, linked_data_proof_options: string, key: string, context_map: string): Promise<any>;
|
|
7
|
+
export function verifyInvocation(invocation: string, delegation: string): Promise<any>;
|
|
8
|
+
export function contextLoader(url: string): Promise<any>;
|
|
9
|
+
export function JWKFromTezos(tz: string): Promise<any>;
|
|
10
|
+
export function delegateCapability(capability: string, linked_data_proof_options: string, parents: string, key: string): Promise<any>;
|
|
11
|
+
export function prepareDelegateCapability(capability: string, linked_data_proof_options: string, parents: string, public_key: string): Promise<any>;
|
|
12
|
+
export function completeDelegateCapability(capability: string, preparation: string, signature: string): Promise<any>;
|
|
13
|
+
export function verifyDelegation(delegation: string): Promise<any>;
|
|
14
|
+
export function invokeCapability(invocation: string, target_id: string, linked_data_proof_options: string, key: string): Promise<any>;
|
|
15
|
+
export function prepareInvokeCapability(invocation: string, target_id: string, linked_data_proof_options: string, public_key: string): Promise<any>;
|
|
16
|
+
export function completeInvokeCapability(invocation: string, preparation: string, signature: string): Promise<any>;
|
|
3
17
|
export function verifyInvocationSignature(invocation: string): Promise<any>;
|
|
18
|
+
export function clearCache(): Promise<any>;
|
|
19
|
+
export function didResolver(did: string, input_metadata: string): Promise<any>;
|
|
20
|
+
export function resolveDID(did: string, input_metadata: string): Promise<any>;
|
|
4
21
|
export function keyToDID(method_pattern: string, jwk: string): string;
|
|
5
|
-
export function completeDelegateCapability(capability: string, preparation: string, signature: string): Promise<any>;
|
|
6
22
|
export function keyToVerificationMethod(method_pattern: string, jwk: string): Promise<any>;
|
|
23
|
+
export function didToVerificationMethod(did: string): Promise<any>;
|
|
24
|
+
export function issueCredential(credential: string, proof_options: string, key: string, context_map: string): Promise<any>;
|
|
7
25
|
export function prepareIssueCredential(credential: string, linked_data_proof_options: string, public_key: string): Promise<any>;
|
|
8
|
-
export function invokeCapability(invocation: string, target_id: string, linked_data_proof_options: string, key: string): Promise<any>;
|
|
9
|
-
export function generateSecp256k1KeyFromBytes(bytes: Uint8Array): string;
|
|
10
26
|
export function completeIssueCredential(credential: string, preparation: string, signature: string): Promise<any>;
|
|
11
|
-
export function
|
|
12
|
-
export function
|
|
13
|
-
export function prepareDelegateCapability(capability: string, linked_data_proof_options: string, parents: string, public_key: string): Promise<any>;
|
|
14
|
-
export function createDagJwe(cleartext: any, recipients: string[]): Promise<any>;
|
|
15
|
-
export function completeInvokeCapability(invocation: string, preparation: string, signature: string): Promise<any>;
|
|
16
|
-
export function verifyDelegation(delegation: string): Promise<any>;
|
|
17
|
-
export function didToVerificationMethod(did: string): Promise<any>;
|
|
18
|
-
export function verifyPresentation(vp: string, proof_options: string, context_map: string): Promise<any>;
|
|
27
|
+
export function verifyCredential(vc: string, proof_options: string, context_map: string): Promise<any>;
|
|
28
|
+
export function issuePresentation(presentation: string, proof_options: string, key: string, context_map: string): Promise<any>;
|
|
19
29
|
export function prepareIssuePresentation(presentation: string, linked_data_proof_options: string, public_key: string): Promise<any>;
|
|
20
|
-
export function issueCredential(credential: string, proof_options: string, key: string, context_map: string): Promise<any>;
|
|
21
|
-
export function didResolver(did: string, input_metadata: string): Promise<any>;
|
|
22
|
-
export function createJwe(cleartext: string, recipients: string[]): Promise<any>;
|
|
23
|
-
export function prepareInvokeCapability(invocation: string, target_id: string, linked_data_proof_options: string, public_key: string): Promise<any>;
|
|
24
|
-
export function decryptJwe(jwe: string, jwks: string[]): Promise<any>;
|
|
25
|
-
export function JWKFromTezos(tz: string): Promise<any>;
|
|
26
30
|
export function generateEd25519Key(): string;
|
|
27
|
-
export function issuePresentation(presentation: string, proof_options: string, key: string, context_map: string): Promise<any>;
|
|
28
|
-
export function clearCache(): Promise<any>;
|
|
29
|
-
export function verifyCredential(vc: string, proof_options: string, context_map: string): Promise<any>;
|
|
30
|
-
export function resolveDID(did: string, input_metadata: string): Promise<any>;
|
|
31
|
-
export function contextLoader(url: string): Promise<any>;
|
|
32
|
-
export function verifyInvocation(invocation: string, delegation: string): Promise<any>;
|
|
33
31
|
export function generateEd25519KeyFromBytes(bytes: Uint8Array): string;
|
|
32
|
+
export function generateSecp256k1Key(): string;
|
|
33
|
+
export function generateSecp256k1KeyFromBytes(bytes: Uint8Array): string;
|
|
34
|
+
export function createJwe(cleartext: string, recipients: string[]): Promise<any>;
|
|
35
|
+
export function decryptJwe(jwe: string, jwks: string[]): Promise<any>;
|
|
36
|
+
export function createDagJwe(cleartext: any, recipients: string[]): Promise<any>;
|
|
34
37
|
export function decryptDagJwe(jwe: string, jwks: string[]): Promise<any>;
|
|
35
|
-
export function DIDAuth(holder: string, linked_data_proof_options: string, key: string, context_map: string): Promise<any>;
|
|
36
|
-
export function completeIssuePresentation(presentation: string, preparation: string, signature: string): Promise<any>;
|
|
37
|
-
export function getVersion(): string;
|
|
38
38
|
|
|
39
39
|
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
40
40
|
|
|
@@ -83,10 +83,10 @@ export interface InitOutput {
|
|
|
83
83
|
readonly __externref_table_alloc: () => number;
|
|
84
84
|
readonly __wbindgen_export_4: WebAssembly.Table;
|
|
85
85
|
readonly __wbindgen_export_5: WebAssembly.Table;
|
|
86
|
-
readonly __externref_table_dealloc: (a: number) => void;
|
|
87
86
|
readonly __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
88
|
-
readonly
|
|
89
|
-
readonly
|
|
87
|
+
readonly __externref_table_dealloc: (a: number) => void;
|
|
88
|
+
readonly closure4206_externref_shim: (a: number, b: number, c: any) => void;
|
|
89
|
+
readonly closure4605_externref_shim: (a: number, b: number, c: any, d: any) => void;
|
|
90
90
|
readonly __wbindgen_start: () => void;
|
|
91
91
|
}
|
|
92
92
|
|