@learncard/didkit-plugin 1.1.1 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/didkit/didkit_wasm.d.ts +17 -12
- package/dist/didkit/didkit_wasm.js +63 -48
- package/dist/didkit/didkit_wasm_bg.wasm +0 -0
- package/dist/didkit/didkit_wasm_bg.wasm.d.ts +7 -7
- package/dist/didkit-plugin.cjs.development.js +119 -60
- package/dist/didkit-plugin.cjs.development.js.map +3 -3
- package/dist/didkit-plugin.cjs.production.min.js +2 -2
- package/dist/didkit-plugin.cjs.production.min.js.map +3 -3
- package/dist/didkit-plugin.esm.js +119 -60
- package/dist/didkit-plugin.esm.js.map +3 -3
- package/dist/didkit_wasm.d.ts +17 -12
- package/dist/didkit_wasm.js +63 -48
- package/dist/didkit_wasm_bg.wasm +0 -0
- package/dist/didkit_wasm_bg.wasm.d.ts +7 -7
- package/dist/helpers.d.ts +3 -0
- package/dist/plugin.d.ts +2 -2
- package/dist/types.d.ts +1 -1
- package/package.json +2 -2
package/dist/didkit_wasm.js
CHANGED
@@ -205,7 +205,7 @@ function makeMutClosure(arg0, arg1, dtor, f) {
|
|
205
205
|
return real;
|
206
206
|
}
|
207
207
|
function __wbg_adapter_26(arg0, arg1, arg2) {
|
208
|
-
wasm.
|
208
|
+
wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hae32635367f5810e(arg0, arg1, addHeapObject(arg2));
|
209
209
|
}
|
210
210
|
|
211
211
|
/**
|
@@ -443,16 +443,19 @@ export function didToVerificationMethod(did) {
|
|
443
443
|
* @param {string} credential
|
444
444
|
* @param {string} proof_options
|
445
445
|
* @param {string} key
|
446
|
+
* @param {string} context_map
|
446
447
|
* @returns {Promise<any>}
|
447
448
|
*/
|
448
|
-
export function issueCredential(credential, proof_options, key) {
|
449
|
+
export function issueCredential(credential, proof_options, key, context_map) {
|
449
450
|
const ptr0 = passStringToWasm0(credential, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
450
451
|
const len0 = WASM_VECTOR_LEN;
|
451
452
|
const ptr1 = passStringToWasm0(proof_options, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
452
453
|
const len1 = WASM_VECTOR_LEN;
|
453
454
|
const ptr2 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
454
455
|
const len2 = WASM_VECTOR_LEN;
|
455
|
-
const
|
456
|
+
const ptr3 = passStringToWasm0(context_map, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
457
|
+
const len3 = WASM_VECTOR_LEN;
|
458
|
+
const ret = wasm.issueCredential(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
|
456
459
|
return takeObject(ret);
|
457
460
|
}
|
458
461
|
|
@@ -493,14 +496,17 @@ export function completeIssueCredential(credential, preparation, signature) {
|
|
493
496
|
/**
|
494
497
|
* @param {string} vc
|
495
498
|
* @param {string} proof_options
|
499
|
+
* @param {string} context_map
|
496
500
|
* @returns {Promise<any>}
|
497
501
|
*/
|
498
|
-
export function verifyCredential(vc, proof_options) {
|
502
|
+
export function verifyCredential(vc, proof_options, context_map) {
|
499
503
|
const ptr0 = passStringToWasm0(vc, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
500
504
|
const len0 = WASM_VECTOR_LEN;
|
501
505
|
const ptr1 = passStringToWasm0(proof_options, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
502
506
|
const len1 = WASM_VECTOR_LEN;
|
503
|
-
const
|
507
|
+
const ptr2 = passStringToWasm0(context_map, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
508
|
+
const len2 = WASM_VECTOR_LEN;
|
509
|
+
const ret = wasm.verifyCredential(ptr0, len0, ptr1, len1, ptr2, len2);
|
504
510
|
return takeObject(ret);
|
505
511
|
}
|
506
512
|
|
@@ -508,16 +514,19 @@ export function verifyCredential(vc, proof_options) {
|
|
508
514
|
* @param {string} presentation
|
509
515
|
* @param {string} proof_options
|
510
516
|
* @param {string} key
|
517
|
+
* @param {string} context_map
|
511
518
|
* @returns {Promise<any>}
|
512
519
|
*/
|
513
|
-
export function issuePresentation(presentation, proof_options, key) {
|
520
|
+
export function issuePresentation(presentation, proof_options, key, context_map) {
|
514
521
|
const ptr0 = passStringToWasm0(presentation, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
515
522
|
const len0 = WASM_VECTOR_LEN;
|
516
523
|
const ptr1 = passStringToWasm0(proof_options, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
517
524
|
const len1 = WASM_VECTOR_LEN;
|
518
525
|
const ptr2 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
519
526
|
const len2 = WASM_VECTOR_LEN;
|
520
|
-
const
|
527
|
+
const ptr3 = passStringToWasm0(context_map, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
528
|
+
const len3 = WASM_VECTOR_LEN;
|
529
|
+
const ret = wasm.issuePresentation(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
|
521
530
|
return takeObject(ret);
|
522
531
|
}
|
523
532
|
|
@@ -558,14 +567,17 @@ export function completeIssuePresentation(presentation, preparation, signature)
|
|
558
567
|
/**
|
559
568
|
* @param {string} vp
|
560
569
|
* @param {string} proof_options
|
570
|
+
* @param {string} context_map
|
561
571
|
* @returns {Promise<any>}
|
562
572
|
*/
|
563
|
-
export function verifyPresentation(vp, proof_options) {
|
573
|
+
export function verifyPresentation(vp, proof_options, context_map) {
|
564
574
|
const ptr0 = passStringToWasm0(vp, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
565
575
|
const len0 = WASM_VECTOR_LEN;
|
566
576
|
const ptr1 = passStringToWasm0(proof_options, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
567
577
|
const len1 = WASM_VECTOR_LEN;
|
568
|
-
const
|
578
|
+
const ptr2 = passStringToWasm0(context_map, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
579
|
+
const len2 = WASM_VECTOR_LEN;
|
580
|
+
const ret = wasm.verifyPresentation(ptr0, len0, ptr1, len1, ptr2, len2);
|
569
581
|
return takeObject(ret);
|
570
582
|
}
|
571
583
|
|
@@ -573,16 +585,19 @@ export function verifyPresentation(vp, proof_options) {
|
|
573
585
|
* @param {string} holder
|
574
586
|
* @param {string} linked_data_proof_options
|
575
587
|
* @param {string} key
|
588
|
+
* @param {string} context_map
|
576
589
|
* @returns {Promise<any>}
|
577
590
|
*/
|
578
|
-
export function DIDAuth(holder, linked_data_proof_options, key) {
|
591
|
+
export function DIDAuth(holder, linked_data_proof_options, key, context_map) {
|
579
592
|
const ptr0 = passStringToWasm0(holder, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
580
593
|
const len0 = WASM_VECTOR_LEN;
|
581
594
|
const ptr1 = passStringToWasm0(linked_data_proof_options, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
582
595
|
const len1 = WASM_VECTOR_LEN;
|
583
596
|
const ptr2 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
584
597
|
const len2 = WASM_VECTOR_LEN;
|
585
|
-
const
|
598
|
+
const ptr3 = passStringToWasm0(context_map, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
599
|
+
const len3 = WASM_VECTOR_LEN;
|
600
|
+
const ret = wasm.DIDAuth(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
|
586
601
|
return takeObject(ret);
|
587
602
|
}
|
588
603
|
|
@@ -771,7 +786,7 @@ function getArrayU8FromWasm0(ptr, len) {
|
|
771
786
|
return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len);
|
772
787
|
}
|
773
788
|
function __wbg_adapter_139(arg0, arg1, arg2, arg3) {
|
774
|
-
wasm.
|
789
|
+
wasm.wasm_bindgen__convert__closures__invoke2_mut__h6e6bc1a8c3634b3b(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
|
775
790
|
}
|
776
791
|
|
777
792
|
async function __wbg_load(module, imports) {
|
@@ -824,36 +839,18 @@ function __wbg_get_imports() {
|
|
824
839
|
const ret = false;
|
825
840
|
return ret;
|
826
841
|
};
|
827
|
-
imports.wbg.__wbindgen_object_clone_ref = function(arg0) {
|
828
|
-
const ret = getObject(arg0);
|
829
|
-
return addHeapObject(ret);
|
830
|
-
};
|
831
842
|
imports.wbg.__wbg_fetch_57429b87be3dcc33 = function(arg0) {
|
832
843
|
const ret = fetch(getObject(arg0));
|
833
844
|
return addHeapObject(ret);
|
834
845
|
};
|
835
|
-
imports.wbg.
|
836
|
-
const ret = getObject(arg0)
|
837
|
-
return addHeapObject(ret);
|
838
|
-
};
|
839
|
-
imports.wbg.__wbg_signal_4bd18fb489af2d4c = function(arg0) {
|
840
|
-
const ret = getObject(arg0).signal;
|
846
|
+
imports.wbg.__wbindgen_object_clone_ref = function(arg0) {
|
847
|
+
const ret = getObject(arg0);
|
841
848
|
return addHeapObject(ret);
|
842
849
|
};
|
843
|
-
imports.wbg.
|
844
|
-
const ret =
|
850
|
+
imports.wbg.__wbg_fetch_8eaf01857a5bb21f = function(arg0, arg1) {
|
851
|
+
const ret = getObject(arg0).fetch(getObject(arg1));
|
845
852
|
return addHeapObject(ret);
|
846
|
-
}, arguments) };
|
847
|
-
imports.wbg.__wbg_abort_654b796176d117aa = function(arg0) {
|
848
|
-
getObject(arg0).abort();
|
849
853
|
};
|
850
|
-
imports.wbg.__wbg_new_1eead62f64ca15ce = function() { return handleError(function () {
|
851
|
-
const ret = new Headers();
|
852
|
-
return addHeapObject(ret);
|
853
|
-
}, arguments) };
|
854
|
-
imports.wbg.__wbg_append_fda9e3432e3e88da = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
|
855
|
-
getObject(arg0).append(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
|
856
|
-
}, arguments) };
|
857
854
|
imports.wbg.__wbg_instanceof_Response_fc4327dbfcdf5ced = function(arg0) {
|
858
855
|
let result;
|
859
856
|
try {
|
@@ -883,6 +880,10 @@ function __wbg_get_imports() {
|
|
883
880
|
const ret = getObject(arg0).arrayBuffer();
|
884
881
|
return addHeapObject(ret);
|
885
882
|
}, arguments) };
|
883
|
+
imports.wbg.__wbg_now_0cfdc90c97d0c24b = function(arg0) {
|
884
|
+
const ret = getObject(arg0).now();
|
885
|
+
return ret;
|
886
|
+
};
|
886
887
|
imports.wbg.__wbg_newwithstrandinit_cad5cd6038c7ff5d = function() { return handleError(function (arg0, arg1, arg2) {
|
887
888
|
const ret = new Request(getStringFromWasm0(arg0, arg1), getObject(arg2));
|
888
889
|
return addHeapObject(ret);
|
@@ -895,16 +896,24 @@ function __wbg_get_imports() {
|
|
895
896
|
getInt32Memory0()[arg0 / 4 + 1] = len1;
|
896
897
|
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
|
897
898
|
};
|
898
|
-
imports.wbg.
|
899
|
-
const ret = getObject(arg0).
|
900
|
-
return ret;
|
901
|
-
};
|
902
|
-
imports.wbg.__wbg_randomFillSync_85b3f4c52c56c313 = function(arg0, arg1, arg2) {
|
903
|
-
getObject(arg0).randomFillSync(getArrayU8FromWasm0(arg1, arg2));
|
899
|
+
imports.wbg.__wbg_signal_4bd18fb489af2d4c = function(arg0) {
|
900
|
+
const ret = getObject(arg0).signal;
|
901
|
+
return addHeapObject(ret);
|
904
902
|
};
|
905
|
-
imports.wbg.
|
906
|
-
|
903
|
+
imports.wbg.__wbg_new_55c9955722952374 = function() { return handleError(function () {
|
904
|
+
const ret = new AbortController();
|
905
|
+
return addHeapObject(ret);
|
906
|
+
}, arguments) };
|
907
|
+
imports.wbg.__wbg_abort_654b796176d117aa = function(arg0) {
|
908
|
+
getObject(arg0).abort();
|
907
909
|
};
|
910
|
+
imports.wbg.__wbg_new_1eead62f64ca15ce = function() { return handleError(function () {
|
911
|
+
const ret = new Headers();
|
912
|
+
return addHeapObject(ret);
|
913
|
+
}, arguments) };
|
914
|
+
imports.wbg.__wbg_append_fda9e3432e3e88da = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
|
915
|
+
getObject(arg0).append(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
|
916
|
+
}, arguments) };
|
908
917
|
imports.wbg.__wbg_self_7eede1f4488bf346 = function() { return handleError(function () {
|
909
918
|
const ret = self.self;
|
910
919
|
return addHeapObject(ret);
|
@@ -933,6 +942,12 @@ function __wbg_get_imports() {
|
|
933
942
|
const ret = getObject(arg0).getRandomValues;
|
934
943
|
return addHeapObject(ret);
|
935
944
|
};
|
945
|
+
imports.wbg.__wbg_getRandomValues_cd175915511f705e = function(arg0, arg1) {
|
946
|
+
getObject(arg0).getRandomValues(getObject(arg1));
|
947
|
+
};
|
948
|
+
imports.wbg.__wbg_randomFillSync_85b3f4c52c56c313 = function(arg0, arg1, arg2) {
|
949
|
+
getObject(arg0).randomFillSync(getArrayU8FromWasm0(arg1, arg2));
|
950
|
+
};
|
936
951
|
imports.wbg.__wbg_crypto_c48a774b022d20ac = function(arg0) {
|
937
952
|
const ret = getObject(arg0).crypto;
|
938
953
|
return addHeapObject(ret);
|
@@ -1097,6 +1112,10 @@ function __wbg_get_imports() {
|
|
1097
1112
|
const ret = getObject(arg0).subarray(arg1 >>> 0, arg2 >>> 0);
|
1098
1113
|
return addHeapObject(ret);
|
1099
1114
|
};
|
1115
|
+
imports.wbg.__wbg_stringify_e25465938f3f611f = function() { return handleError(function (arg0) {
|
1116
|
+
const ret = JSON.stringify(getObject(arg0));
|
1117
|
+
return addHeapObject(ret);
|
1118
|
+
}, arguments) };
|
1100
1119
|
imports.wbg.__wbg_has_c5fcd020291e56b8 = function() { return handleError(function (arg0, arg1) {
|
1101
1120
|
const ret = Reflect.has(getObject(arg0), getObject(arg1));
|
1102
1121
|
return ret;
|
@@ -1105,10 +1124,6 @@ function __wbg_get_imports() {
|
|
1105
1124
|
const ret = Reflect.set(getObject(arg0), getObject(arg1), getObject(arg2));
|
1106
1125
|
return ret;
|
1107
1126
|
}, arguments) };
|
1108
|
-
imports.wbg.__wbg_stringify_e25465938f3f611f = function() { return handleError(function (arg0) {
|
1109
|
-
const ret = JSON.stringify(getObject(arg0));
|
1110
|
-
return addHeapObject(ret);
|
1111
|
-
}, arguments) };
|
1112
1127
|
imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
|
1113
1128
|
const ret = debugString(getObject(arg1));
|
1114
1129
|
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
@@ -1123,8 +1138,8 @@ function __wbg_get_imports() {
|
|
1123
1138
|
const ret = wasm.memory;
|
1124
1139
|
return addHeapObject(ret);
|
1125
1140
|
};
|
1126
|
-
imports.wbg.
|
1127
|
-
const ret = makeMutClosure(arg0, arg1,
|
1141
|
+
imports.wbg.__wbindgen_closure_wrapper12794 = function(arg0, arg1, arg2) {
|
1142
|
+
const ret = makeMutClosure(arg0, arg1, 3868, __wbg_adapter_26);
|
1128
1143
|
return addHeapObject(ret);
|
1129
1144
|
};
|
1130
1145
|
|
package/dist/didkit_wasm_bg.wasm
CHANGED
Binary file
|
@@ -11,15 +11,15 @@ export function generateSecp256k1KeyFromBytes(a: number, b: number, c: number):
|
|
11
11
|
export function keyToDID(a: number, b: number, c: number, d: number, e: number): void;
|
12
12
|
export function keyToVerificationMethod(a: number, b: number, c: number, d: number): number;
|
13
13
|
export function didToVerificationMethod(a: number, b: number): number;
|
14
|
-
export function issueCredential(a: number, b: number, c: number, d: number, e: number, f: number): number;
|
14
|
+
export function issueCredential(a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number): number;
|
15
15
|
export function prepareIssueCredential(a: number, b: number, c: number, d: number, e: number, f: number): number;
|
16
16
|
export function completeIssueCredential(a: number, b: number, c: number, d: number, e: number, f: number): number;
|
17
|
-
export function verifyCredential(a: number, b: number, c: number, d: number): number;
|
18
|
-
export function issuePresentation(a: number, b: number, c: number, d: number, e: number, f: number): number;
|
17
|
+
export function verifyCredential(a: number, b: number, c: number, d: number, e: number, f: number): number;
|
18
|
+
export function issuePresentation(a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number): number;
|
19
19
|
export function prepareIssuePresentation(a: number, b: number, c: number, d: number, e: number, f: number): number;
|
20
20
|
export function completeIssuePresentation(a: number, b: number, c: number, d: number, e: number, f: number): number;
|
21
|
-
export function verifyPresentation(a: number, b: number, c: number, d: number): number;
|
22
|
-
export function DIDAuth(a: number, b: number, c: number, d: number, e: number, f: number): number;
|
21
|
+
export function verifyPresentation(a: number, b: number, c: number, d: number, e: number, f: number): number;
|
22
|
+
export function DIDAuth(a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number): number;
|
23
23
|
export function JWKFromTezos(a: number, b: number): number;
|
24
24
|
export function delegateCapability(a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number): number;
|
25
25
|
export function prepareDelegateCapability(a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number): number;
|
@@ -36,8 +36,8 @@ export function didkit_error_code(): number;
|
|
36
36
|
export function __wbindgen_malloc(a: number, b: number): number;
|
37
37
|
export function __wbindgen_realloc(a: number, b: number, c: number, d: number): number;
|
38
38
|
export const __wbindgen_export_2: WebAssembly.Table;
|
39
|
-
export function
|
39
|
+
export function _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hae32635367f5810e(a: number, b: number, c: number): void;
|
40
40
|
export function __wbindgen_add_to_stack_pointer(a: number): number;
|
41
41
|
export function __wbindgen_free(a: number, b: number, c: number): void;
|
42
42
|
export function __wbindgen_exn_store(a: number): void;
|
43
|
-
export function
|
43
|
+
export function wasm_bindgen__convert__closures__invoke2_mut__h6e6bc1a8c3634b3b(a: number, b: number, c: number, d: number): void;
|
@@ -0,0 +1,3 @@
|
|
1
|
+
import { LearnCard } from '@learncard/core';
|
2
|
+
export declare const getContextURIs: (jsonld: Record<string, any>) => string[];
|
3
|
+
export declare const getDocumentMap: (learnCard: LearnCard<any, 'context'>, obj: Record<string, any>, allowRemoteContexts?: boolean) => Promise<Record<string, string>>;
|
package/dist/plugin.d.ts
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
import { InitInput } from './didkit/index';
|
2
2
|
import { DIDKitPlugin } from './types';
|
3
3
|
/**
|
4
|
-
|
4
|
+
j
|
5
5
|
* @group Plugins
|
6
6
|
*/
|
7
|
-
export declare const getDidKitPlugin: (input?: InitInput | Promise<InitInput
|
7
|
+
export declare const getDidKitPlugin: (input?: InitInput | Promise<InitInput>, allowRemoteContexts?: boolean) => Promise<DIDKitPlugin>;
|
package/dist/types.d.ts
CHANGED
@@ -37,4 +37,4 @@ export type DidkitPluginMethods = {
|
|
37
37
|
didResolver: (did: string, inputMetadata?: InputMetadata) => Promise<DIDResolutionResult>;
|
38
38
|
};
|
39
39
|
/** @group DIDKit Plugin */
|
40
|
-
export type DIDKitPlugin = Plugin<'DIDKit',
|
40
|
+
export type DIDKitPlugin = Plugin<'DIDKit', 'context', DidkitPluginMethods>;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@learncard/didkit-plugin",
|
3
|
-
"version": "1.
|
3
|
+
"version": "1.2.0",
|
4
4
|
"description": "",
|
5
5
|
"main": "./dist/index.js",
|
6
6
|
"module": "./dist/didkit-plugin.esm.js",
|
@@ -31,7 +31,7 @@
|
|
31
31
|
},
|
32
32
|
"types": "./dist/index.d.ts",
|
33
33
|
"dependencies": {
|
34
|
-
"@learncard/core": "9.0
|
34
|
+
"@learncard/core": "9.1.0",
|
35
35
|
"@learncard/types": "5.3.2"
|
36
36
|
},
|
37
37
|
"scripts": {
|