@qntx/ur 1.1.0 → 2.0.0
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/LICENSE-APACHE +201 -0
- package/README.md +7 -20
- package/dist/index-CcMfgay6.d.mts +54 -0
- package/dist/index-DTjNCWBI.d.mts +228 -0
- package/dist/index.d.mts +45 -166
- package/dist/index.mjs +2 -2
- package/dist/registry.d.mts +201 -0
- package/dist/registry.mjs +899 -0
- package/dist/typed-D-SyraAj.mjs +124 -0
- package/dist/typed.d.mts +3 -59
- package/dist/typed.mjs +3 -146
- package/dist/ur-7Ge3roVh.mjs +1993 -0
- package/package.json +31 -23
- package/dist/rolldown-runtime-D7D4PA-g.mjs +0 -13
- package/dist/type-CSfO9fHL.d.mts +0 -50
- package/dist/ur-C5n_FgVn.mjs +0 -1500
- /package/{LICENSE → LICENSE-MIT} +0 -0
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qntx/ur",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "Uniform Resources (UR)
|
|
3
|
+
"version": "2.0.0",
|
|
4
|
+
"description": "Uniform Resources (UR) for TypeScript: Bytewords, fountain codes, multi-part UR, typed dCBOR, and BCR-2020-006 registry types.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"blockchain-commons",
|
|
7
7
|
"bytewords",
|
|
@@ -10,18 +10,21 @@
|
|
|
10
10
|
"uniform-resources",
|
|
11
11
|
"ur"
|
|
12
12
|
],
|
|
13
|
-
"homepage": "https://github.com/qntx/ur
|
|
13
|
+
"homepage": "https://github.com/qntx/ur#readme",
|
|
14
14
|
"bugs": {
|
|
15
|
-
"url": "https://github.com/qntx/ur
|
|
15
|
+
"url": "https://github.com/qntx/ur/issues"
|
|
16
16
|
},
|
|
17
|
-
"license": "MIT",
|
|
18
|
-
"author": "QuantX <x@qntx.
|
|
17
|
+
"license": "MIT OR Apache-2.0",
|
|
18
|
+
"author": "QuantX <x@qntx.org>",
|
|
19
19
|
"repository": {
|
|
20
20
|
"type": "git",
|
|
21
|
-
"url": "git+https://github.com/qntx/ur.
|
|
21
|
+
"url": "git+https://github.com/qntx/ur.git",
|
|
22
|
+
"directory": "packages/ur"
|
|
22
23
|
},
|
|
23
24
|
"files": [
|
|
24
|
-
"dist"
|
|
25
|
+
"dist",
|
|
26
|
+
"LICENSE-MIT",
|
|
27
|
+
"LICENSE-APACHE"
|
|
25
28
|
],
|
|
26
29
|
"type": "module",
|
|
27
30
|
"sideEffects": false,
|
|
@@ -31,6 +34,11 @@
|
|
|
31
34
|
"import": "./dist/index.mjs",
|
|
32
35
|
"default": "./dist/index.mjs"
|
|
33
36
|
},
|
|
37
|
+
"./registry": {
|
|
38
|
+
"types": "./dist/registry.d.mts",
|
|
39
|
+
"import": "./dist/registry.mjs",
|
|
40
|
+
"default": "./dist/registry.mjs"
|
|
41
|
+
},
|
|
34
42
|
"./typed": {
|
|
35
43
|
"types": "./dist/typed.d.mts",
|
|
36
44
|
"import": "./dist/typed.mjs",
|
|
@@ -45,40 +53,40 @@
|
|
|
45
53
|
"build": "vp pack",
|
|
46
54
|
"dev": "vp pack --watch",
|
|
47
55
|
"test": "vp test",
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"
|
|
56
|
+
"typecheck": "tsc --noEmit && tsc --noEmit -p tsconfig.src.json",
|
|
57
|
+
"check:pkg": "vp pack && publint && attw --pack . --profile esm-only",
|
|
58
|
+
"smoke:hermes": "bun scripts/hermes-smoke.ts",
|
|
59
|
+
"prepublishOnly": "vp run build",
|
|
60
|
+
"bench": "BENCH=1 vp test bench/decoder.bench.ts"
|
|
51
61
|
},
|
|
52
62
|
"dependencies": {
|
|
53
63
|
"@noble/hashes": "^2.4.0"
|
|
54
64
|
},
|
|
55
65
|
"devDependencies": {
|
|
56
|
-
"@
|
|
57
|
-
"@
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
"
|
|
66
|
+
"@arethetypeswrong/cli": "0.18.5",
|
|
67
|
+
"@blockchaincommons/dcbor": "1.0.0-beta.3",
|
|
68
|
+
"@qntx/tsconfig": "1.0.1",
|
|
69
|
+
"@types/node": "26.6.3",
|
|
70
|
+
"publint": "0.3.24",
|
|
71
|
+
"typescript": "7.0.2",
|
|
72
|
+
"vite-plus": "1.0.0"
|
|
62
73
|
},
|
|
63
74
|
"peerDependencies": {
|
|
64
|
-
"@blockchaincommons/dcbor": "1.0.0-beta.
|
|
75
|
+
"@blockchaincommons/dcbor": "1.0.0-beta.3"
|
|
65
76
|
},
|
|
66
77
|
"peerDependenciesMeta": {
|
|
67
78
|
"@blockchaincommons/dcbor": {
|
|
68
79
|
"optional": true
|
|
69
80
|
}
|
|
70
81
|
},
|
|
71
|
-
"overrides": {
|
|
72
|
-
"vite": "npm:@voidzero-dev/vite-plus-core@0.2.8"
|
|
73
|
-
},
|
|
74
82
|
"devEngines": {
|
|
75
83
|
"packageManager": {
|
|
76
84
|
"name": "bun",
|
|
77
|
-
"version": "1.
|
|
85
|
+
"version": "1.4.0",
|
|
78
86
|
"onFail": "ignore"
|
|
79
87
|
}
|
|
80
88
|
},
|
|
81
89
|
"engines": {
|
|
82
|
-
"node": ">=
|
|
90
|
+
"node": ">=20.19.0"
|
|
83
91
|
}
|
|
84
92
|
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
//#region \0rolldown/runtime.js
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __exportAll = (all, no_symbols) => {
|
|
4
|
-
let target = {};
|
|
5
|
-
for (var name in all) __defProp(target, name, {
|
|
6
|
-
get: all[name],
|
|
7
|
-
enumerable: true
|
|
8
|
-
});
|
|
9
|
-
if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
10
|
-
return target;
|
|
11
|
-
};
|
|
12
|
-
//#endregion
|
|
13
|
-
export { __exportAll as t };
|
package/dist/type-CSfO9fHL.d.mts
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
//#region src/error.d.ts
|
|
2
|
-
/** Discriminated error codes for the UR transport stack. */
|
|
3
|
-
type UrErrorCode = "InvalidWord" | "InvalidBytewordsChecksum" | "InvalidBytewordsLength" | "NonAscii" | "EmptyMessage" | "EmptyPart" | "InvalidFragmentLen" | "InvalidSequence" | "InconsistentPart" | "InvalidPadding" | "InvalidMessageChecksum" | "InvalidPartCbor" | "DecoderState" | "SinglePartExhausted" | "ResourceLimit" | "InvalidScheme" | "TypeUnspecified" | "InvalidType" | "InvalidIndices" | "NotSinglePart" | "UnexpectedType" | "CborDecode" | "CborType";
|
|
4
|
-
/** Structured error thrown by the UR stack. */
|
|
5
|
-
declare class UrError extends Error {
|
|
6
|
-
readonly code: UrErrorCode;
|
|
7
|
-
readonly expected?: string;
|
|
8
|
-
readonly found?: string;
|
|
9
|
-
readonly limit?: string;
|
|
10
|
-
constructor(code: UrErrorCode, options?: {
|
|
11
|
-
expected?: string;
|
|
12
|
-
found?: string;
|
|
13
|
-
limit?: string;
|
|
14
|
-
cause?: unknown;
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
/** Fail-closed decoder poison reason. */
|
|
18
|
-
type DecoderPoison = {
|
|
19
|
-
code: "ResourceLimit";
|
|
20
|
-
limit: string;
|
|
21
|
-
} | {
|
|
22
|
-
code: "DecoderState";
|
|
23
|
-
};
|
|
24
|
-
/** Rethrows the stored poison as a {@link UrError}. */
|
|
25
|
-
declare function failPoison(p: DecoderPoison): never;
|
|
26
|
-
//#endregion
|
|
27
|
-
//#region src/fountain/limits.d.ts
|
|
28
|
-
/** Hard limits for adversarial multi-part streams. */
|
|
29
|
-
interface DecoderLimits {
|
|
30
|
-
maxMessageLength: number;
|
|
31
|
-
maxFragmentCount: number;
|
|
32
|
-
maxFragmentDataLength: number;
|
|
33
|
-
maxBufferParts: number;
|
|
34
|
-
maxReceivedParts: number;
|
|
35
|
-
maxUriLen: number;
|
|
36
|
-
}
|
|
37
|
-
/** Production Default; same integers as bcur 1.0. Hosts that need another budget pass `new Decoder({ limits })`. */
|
|
38
|
-
declare const DEFAULT_LIMITS: DecoderLimits;
|
|
39
|
-
//#endregion
|
|
40
|
-
//#region src/ur/type.d.ts
|
|
41
|
-
/** Validated UR type token (stored lowercase, `[a-z0-9-]+`). */
|
|
42
|
-
declare class UrType {
|
|
43
|
-
readonly value: string;
|
|
44
|
-
private constructor();
|
|
45
|
-
static parse(s: string): UrType;
|
|
46
|
-
static bytes(): UrType;
|
|
47
|
-
equals(other: UrType): boolean;
|
|
48
|
-
}
|
|
49
|
-
//#endregion
|
|
50
|
-
export { UrError as a, DecoderPoison as i, DEFAULT_LIMITS as n, UrErrorCode as o, DecoderLimits as r, failPoison as s, UrType as t };
|