@reallyme/codec 0.2.0 → 0.2.2
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/index.d.ts
CHANGED
|
@@ -11,38 +11,44 @@ export { processOperation, processOperationJson } from "./operationContract.js";
|
|
|
11
11
|
export type { ReallyMePemDecodePolicy, ReallyMePemDocument, ReallyMePemEncodeOptions, ReallyMePemLabel, ReallyMePemLineEnding, } from "./pem.js";
|
|
12
12
|
export { REALLYME_CODEC_WASM_EXPORTS, installReallyMeCodecWasmProvider, requireReallyMeCodecWasmProvider, } from "./wasmProvider.js";
|
|
13
13
|
export type { ReallyMeCodecWasmProvider } from "./wasmProvider.js";
|
|
14
|
+
import { base64Decode, base64Encode, base64urlDecode, base64urlDecodeBytes, base64urlEncode, bytesToLowerHex, lowerHexToBytes } from "./baseEncoding.js";
|
|
15
|
+
import { dagCborCodecCode, dagCborComputeCid, dagCborDecode, dagCborEncode, dagCborMultihash, dagCborSha256ContentHash, dagCborVerifyCid, deterministicCborDecode, deterministicCborEncode, isValidCidString, tryParseCid } from "./cbor.js";
|
|
16
|
+
import { canonicalizeJson, canonicalizeJsonText } from "./jcs.js";
|
|
17
|
+
import { base58btcDecode, base58btcEncode, bindingTypeMatchesCodec, multibaseBase58btcEncode, multibaseBase64urlEncode, multibaseDecode, multicodecLookupPrefix, multicodecPrefixForName, multicodecStripPrefix, multicodecTable, multikeyEncode, multikeyParse, requireSupportedMulticodec, validateKeyBinding } from "./multiformat.js";
|
|
18
|
+
import { decodePem, encodePem } from "./pem.js";
|
|
19
|
+
import { processOperation, processOperationJson } from "./operationContract.js";
|
|
14
20
|
export declare const ReallyMeCodec: {
|
|
15
|
-
readonly base64Decode:
|
|
16
|
-
readonly base64Encode:
|
|
17
|
-
readonly base64urlDecode:
|
|
18
|
-
readonly base64urlDecodeBytes:
|
|
19
|
-
readonly base64urlEncode:
|
|
20
|
-
readonly bytesToLowerHex:
|
|
21
|
-
readonly lowerHexToBytes:
|
|
22
|
-
readonly base58btcDecode:
|
|
23
|
-
readonly base58btcEncode:
|
|
24
|
-
readonly bindingTypeMatchesCodec:
|
|
25
|
-
readonly multibaseBase58btcEncode:
|
|
26
|
-
readonly multibaseBase64urlEncode:
|
|
27
|
-
readonly multibaseDecode:
|
|
28
|
-
readonly multicodecLookupPrefix:
|
|
29
|
-
readonly multicodecPrefixForName:
|
|
30
|
-
readonly multicodecStripPrefix:
|
|
31
|
-
readonly multicodecTable:
|
|
32
|
-
readonly multikeyEncode:
|
|
33
|
-
readonly multikeyParse:
|
|
34
|
-
readonly requireSupportedMulticodec:
|
|
35
|
-
readonly validateKeyBinding:
|
|
36
|
-
readonly dagCborCodecCode:
|
|
37
|
-
readonly dagCborComputeCid:
|
|
38
|
-
readonly dagCborDecode:
|
|
39
|
-
readonly dagCborEncode:
|
|
40
|
-
readonly dagCborMultihash:
|
|
41
|
-
readonly dagCborSha256ContentHash:
|
|
42
|
-
readonly dagCborVerifyCid:
|
|
43
|
-
readonly deterministicCborDecode:
|
|
44
|
-
readonly deterministicCborEncode:
|
|
45
|
-
readonly isValidCidString:
|
|
21
|
+
readonly base64Decode: typeof base64Decode;
|
|
22
|
+
readonly base64Encode: typeof base64Encode;
|
|
23
|
+
readonly base64urlDecode: typeof base64urlDecode;
|
|
24
|
+
readonly base64urlDecodeBytes: typeof base64urlDecodeBytes;
|
|
25
|
+
readonly base64urlEncode: typeof base64urlEncode;
|
|
26
|
+
readonly bytesToLowerHex: typeof bytesToLowerHex;
|
|
27
|
+
readonly lowerHexToBytes: typeof lowerHexToBytes;
|
|
28
|
+
readonly base58btcDecode: typeof base58btcDecode;
|
|
29
|
+
readonly base58btcEncode: typeof base58btcEncode;
|
|
30
|
+
readonly bindingTypeMatchesCodec: typeof bindingTypeMatchesCodec;
|
|
31
|
+
readonly multibaseBase58btcEncode: typeof multibaseBase58btcEncode;
|
|
32
|
+
readonly multibaseBase64urlEncode: typeof multibaseBase64urlEncode;
|
|
33
|
+
readonly multibaseDecode: typeof multibaseDecode;
|
|
34
|
+
readonly multicodecLookupPrefix: typeof multicodecLookupPrefix;
|
|
35
|
+
readonly multicodecPrefixForName: typeof multicodecPrefixForName;
|
|
36
|
+
readonly multicodecStripPrefix: typeof multicodecStripPrefix;
|
|
37
|
+
readonly multicodecTable: typeof multicodecTable;
|
|
38
|
+
readonly multikeyEncode: typeof multikeyEncode;
|
|
39
|
+
readonly multikeyParse: typeof multikeyParse;
|
|
40
|
+
readonly requireSupportedMulticodec: typeof requireSupportedMulticodec;
|
|
41
|
+
readonly validateKeyBinding: typeof validateKeyBinding;
|
|
42
|
+
readonly dagCborCodecCode: typeof dagCborCodecCode;
|
|
43
|
+
readonly dagCborComputeCid: typeof dagCborComputeCid;
|
|
44
|
+
readonly dagCborDecode: typeof dagCborDecode;
|
|
45
|
+
readonly dagCborEncode: typeof dagCborEncode;
|
|
46
|
+
readonly dagCborMultihash: typeof dagCborMultihash;
|
|
47
|
+
readonly dagCborSha256ContentHash: typeof dagCborSha256ContentHash;
|
|
48
|
+
readonly dagCborVerifyCid: typeof dagCborVerifyCid;
|
|
49
|
+
readonly deterministicCborDecode: typeof deterministicCborDecode;
|
|
50
|
+
readonly deterministicCborEncode: typeof deterministicCborEncode;
|
|
51
|
+
readonly isValidCidString: typeof isValidCidString;
|
|
46
52
|
readonly ReallyMeDagCbor: {
|
|
47
53
|
readonly null: () => import("./cbor.js").ReallyMeCborValue;
|
|
48
54
|
readonly bool: (value: boolean) => import("./cbor.js").ReallyMeCborValue;
|
|
@@ -68,11 +74,11 @@ export declare const ReallyMeCodec: {
|
|
|
68
74
|
readonly textKey: (value: string) => import("./cbor.js").ReallyMeDeterministicCborMapKey;
|
|
69
75
|
readonly entry: (key: import("./cbor.js").ReallyMeDeterministicCborMapKey, value: import("./cbor.js").ReallyMeDeterministicCborValue) => import("./cbor.js").ReallyMeDeterministicCborMapEntry;
|
|
70
76
|
};
|
|
71
|
-
readonly tryParseCid:
|
|
72
|
-
readonly canonicalizeJson:
|
|
73
|
-
readonly canonicalizeJsonText:
|
|
74
|
-
readonly decodePem:
|
|
75
|
-
readonly encodePem:
|
|
76
|
-
readonly processOperation:
|
|
77
|
-
readonly processOperationJson:
|
|
77
|
+
readonly tryParseCid: typeof tryParseCid;
|
|
78
|
+
readonly canonicalizeJson: typeof canonicalizeJson;
|
|
79
|
+
readonly canonicalizeJsonText: typeof canonicalizeJsonText;
|
|
80
|
+
readonly decodePem: typeof decodePem;
|
|
81
|
+
readonly encodePem: typeof encodePem;
|
|
82
|
+
readonly processOperation: typeof processOperation;
|
|
83
|
+
readonly processOperationJson: typeof processOperationJson;
|
|
78
84
|
};
|
|
@@ -422,7 +422,7 @@ export function validateKeyBinding(binding_type, algorithm, multikey) {
|
|
|
422
422
|
function __wbg_get_imports() {
|
|
423
423
|
const import0 = {
|
|
424
424
|
__proto__: null,
|
|
425
|
-
|
|
425
|
+
__wbg___wbindgen_string_get_d154f1e671052120: function(arg0, arg1) {
|
|
426
426
|
const obj = arg1;
|
|
427
427
|
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
428
428
|
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
@@ -430,40 +430,40 @@ function __wbg_get_imports() {
|
|
|
430
430
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
431
431
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
432
432
|
},
|
|
433
|
-
|
|
433
|
+
__wbg___wbindgen_throw_bb96b2010945f0bc: function(arg0, arg1) {
|
|
434
434
|
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
435
435
|
},
|
|
436
|
-
|
|
436
|
+
__wbg_charCodeAt_ee49a2dd698e4f66: function(arg0, arg1) {
|
|
437
437
|
const ret = arg0.charCodeAt(arg1 >>> 0);
|
|
438
438
|
return ret;
|
|
439
439
|
},
|
|
440
|
-
|
|
440
|
+
__wbg_fill_36c70ae56a83e4f3: function(arg0, arg1, arg2, arg3) {
|
|
441
441
|
const ret = arg0.fill(arg1, arg2 >>> 0, arg3 >>> 0);
|
|
442
442
|
return ret;
|
|
443
443
|
},
|
|
444
|
-
|
|
444
|
+
__wbg_length_36bd29c6848c2144: function(arg0) {
|
|
445
445
|
const ret = arg0.length;
|
|
446
446
|
return ret;
|
|
447
447
|
},
|
|
448
|
-
|
|
448
|
+
__wbg_length_7afd83ae4ddf324f: function(arg0) {
|
|
449
449
|
const ret = arg0.length;
|
|
450
450
|
return ret;
|
|
451
451
|
},
|
|
452
|
-
|
|
452
|
+
__wbg_new_from_slice_3eea173078478cfe: function(arg0, arg1) {
|
|
453
453
|
const ret = new Uint8Array(getArrayU8FromWasm0(arg0, arg1));
|
|
454
454
|
return ret;
|
|
455
455
|
},
|
|
456
|
-
|
|
456
|
+
__wbg_new_with_length_3ffc1c56427c525c: function(arg0) {
|
|
457
457
|
const ret = new Uint8Array(arg0 >>> 0);
|
|
458
458
|
return ret;
|
|
459
459
|
},
|
|
460
|
-
|
|
460
|
+
__wbg_prototypesetcall_de8e0d9553586985: function(arg0, arg1, arg2) {
|
|
461
461
|
Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
|
|
462
462
|
},
|
|
463
|
-
|
|
463
|
+
__wbg_set_862c439a342a8818: function(arg0, arg1, arg2) {
|
|
464
464
|
arg0.set(arg1, arg2 >>> 0);
|
|
465
465
|
},
|
|
466
|
-
|
|
466
|
+
__wbg_subarray_a4cc58201c7359fd: function(arg0, arg1, arg2) {
|
|
467
467
|
const ret = arg0.subarray(arg1 >>> 0, arg2 >>> 0);
|
|
468
468
|
return ret;
|
|
469
469
|
},
|
|
@@ -608,11 +608,15 @@ function __wbg_finalize_init(instance, module) {
|
|
|
608
608
|
|
|
609
609
|
async function __wbg_load(module, imports) {
|
|
610
610
|
if (typeof Response === 'function' && module instanceof Response) {
|
|
611
|
+
if (!module.ok) {
|
|
612
|
+
throw new Error(`failed to fetch Wasm: ${module.status} ${module.statusText} fetching '${module.url}'`);
|
|
613
|
+
}
|
|
614
|
+
|
|
611
615
|
if (typeof WebAssembly.instantiateStreaming === 'function') {
|
|
612
616
|
try {
|
|
613
617
|
return await WebAssembly.instantiateStreaming(module, imports);
|
|
614
618
|
} catch (e) {
|
|
615
|
-
const validResponse =
|
|
619
|
+
const validResponse = expectedResponseType(module.type);
|
|
616
620
|
|
|
617
621
|
if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
|
|
618
622
|
console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reallyme/codec",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "TypeScript facade for the ReallyMe codec WASM package.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -39,11 +39,11 @@
|
|
|
39
39
|
"test": "npm run build && node --test \"test/*.test.mjs\""
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@bufbuild/protobuf": "2.
|
|
42
|
+
"@bufbuild/protobuf": "2.14.1"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"fast-check": "
|
|
46
|
-
"typescript": "
|
|
45
|
+
"fast-check": "4.9.0",
|
|
46
|
+
"typescript": "7.0.2"
|
|
47
47
|
},
|
|
48
48
|
"engines": {
|
|
49
49
|
"node": ">=20.19.0"
|