@kagal/taistamp 0.1.2 → 0.2.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/README.md +214 -53
- package/dist/_chunks/time.d.mts +144 -0
- package/dist/_chunks/time.mjs +68 -0
- package/dist/_chunks/time.mjs.map +1 -0
- package/dist/index.api.json +2094 -1546
- package/dist/index.d.mts +66 -83
- package/dist/index.d.ts +66 -83
- package/dist/index.mjs +52 -72
- package/dist/index.mjs.map +1 -1
- package/dist/utils.api.json +825 -0
- package/dist/utils.d.mts +29 -0
- package/dist/utils.d.ts +29 -0
- package/dist/utils.mjs +2 -0
- package/package.json +9 -5
package/dist/utils.d.mts
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { TAI64N_CONTENT_LENGTH, TAI64N_CONTENT_TYPE, TAI64N_EPOCH_HI, TAI64N_HEADER_KEY_SELECTOR, TAI64N_HEADER_LEAP_SECONDS, TAI64N_HEADER_NONCE, TAI64N_HEADER_SIGNATURE, TAI64N_LABEL_LENGTH, TAI64N_LABEL_PATTERN, TAI64N_PATH, TAI64_EPOCH_HI, fromUTC, now, tai64nLabel, tai64nLabelFromUTC, tai64nLabelToUTC } from "./_chunks/time.mjs";
|
|
2
|
+
import { Bytes } from "@kagal/ed25519-secret";
|
|
3
|
+
/**
|
|
4
|
+
* sf-binary item per RFC 9651 §3.3.5: standard base64
|
|
5
|
+
* with `=` padding, wrapped in a leading and trailing
|
|
6
|
+
* colon. The empty payload (`::`) is valid sf-binary;
|
|
7
|
+
* consumers impose their own length bounds. The
|
|
8
|
+
* alphabet contains no `,`, so a duplicated field
|
|
9
|
+
* (joined by the Web `Headers` API with `,`) fails the
|
|
10
|
+
* same check.
|
|
11
|
+
*/
|
|
12
|
+
declare const SF_BINARY_PATTERN: RegExp;
|
|
13
|
+
/**
|
|
14
|
+
* Encode bytes as an sf-binary item (RFC 9651 §3.3.5):
|
|
15
|
+
* standard base64 wrapped in colons. The output
|
|
16
|
+
* satisfies {@link SF_BINARY_PATTERN} and round-trips
|
|
17
|
+
* through {@link decodeSFBinary}.
|
|
18
|
+
*/
|
|
19
|
+
declare const encodeSFBinary: (bytes: Readonly<Uint8Array>) => string;
|
|
20
|
+
/**
|
|
21
|
+
* Decode an sf-binary item back into bytes. Enforces
|
|
22
|
+
* the full RFC 9651 §3.3.5 syntax: throws `TypeError`
|
|
23
|
+
* when `value` does not satisfy
|
|
24
|
+
* {@link SF_BINARY_PATTERN}; the thrown message is
|
|
25
|
+
* optionally prefixed `<context>: `.
|
|
26
|
+
*/
|
|
27
|
+
declare const decodeSFBinary: (value: string, context?: string) => Bytes;
|
|
28
|
+
export { SF_BINARY_PATTERN, TAI64N_CONTENT_LENGTH, TAI64N_CONTENT_TYPE, TAI64N_EPOCH_HI, TAI64N_HEADER_KEY_SELECTOR, TAI64N_HEADER_LEAP_SECONDS, TAI64N_HEADER_NONCE, TAI64N_HEADER_SIGNATURE, TAI64N_LABEL_LENGTH, TAI64N_LABEL_PATTERN, TAI64N_PATH, TAI64_EPOCH_HI, decodeSFBinary, encodeSFBinary, fromUTC, now, tai64nLabel, tai64nLabelFromUTC, tai64nLabelToUTC };
|
|
29
|
+
//# sourceMappingURL=utils.d.mts.map
|
package/dist/utils.d.ts
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { TAI64N_CONTENT_LENGTH, TAI64N_CONTENT_TYPE, TAI64N_EPOCH_HI, TAI64N_HEADER_KEY_SELECTOR, TAI64N_HEADER_LEAP_SECONDS, TAI64N_HEADER_NONCE, TAI64N_HEADER_SIGNATURE, TAI64N_LABEL_LENGTH, TAI64N_LABEL_PATTERN, TAI64N_PATH, TAI64_EPOCH_HI, fromUTC, now, tai64nLabel, tai64nLabelFromUTC, tai64nLabelToUTC } from "./_chunks/time.mjs";
|
|
2
|
+
import { Bytes } from "@kagal/ed25519-secret";
|
|
3
|
+
/**
|
|
4
|
+
* sf-binary item per RFC 9651 §3.3.5: standard base64
|
|
5
|
+
* with `=` padding, wrapped in a leading and trailing
|
|
6
|
+
* colon. The empty payload (`::`) is valid sf-binary;
|
|
7
|
+
* consumers impose their own length bounds. The
|
|
8
|
+
* alphabet contains no `,`, so a duplicated field
|
|
9
|
+
* (joined by the Web `Headers` API with `,`) fails the
|
|
10
|
+
* same check.
|
|
11
|
+
*/
|
|
12
|
+
declare const SF_BINARY_PATTERN: RegExp;
|
|
13
|
+
/**
|
|
14
|
+
* Encode bytes as an sf-binary item (RFC 9651 §3.3.5):
|
|
15
|
+
* standard base64 wrapped in colons. The output
|
|
16
|
+
* satisfies {@link SF_BINARY_PATTERN} and round-trips
|
|
17
|
+
* through {@link decodeSFBinary}.
|
|
18
|
+
*/
|
|
19
|
+
declare const encodeSFBinary: (bytes: Readonly<Uint8Array>) => string;
|
|
20
|
+
/**
|
|
21
|
+
* Decode an sf-binary item back into bytes. Enforces
|
|
22
|
+
* the full RFC 9651 §3.3.5 syntax: throws `TypeError`
|
|
23
|
+
* when `value` does not satisfy
|
|
24
|
+
* {@link SF_BINARY_PATTERN}; the thrown message is
|
|
25
|
+
* optionally prefixed `<context>: `.
|
|
26
|
+
*/
|
|
27
|
+
declare const decodeSFBinary: (value: string, context?: string) => Bytes;
|
|
28
|
+
export { SF_BINARY_PATTERN, TAI64N_CONTENT_LENGTH, TAI64N_CONTENT_TYPE, TAI64N_EPOCH_HI, TAI64N_HEADER_KEY_SELECTOR, TAI64N_HEADER_LEAP_SECONDS, TAI64N_HEADER_NONCE, TAI64N_HEADER_SIGNATURE, TAI64N_LABEL_LENGTH, TAI64N_LABEL_PATTERN, TAI64N_PATH, TAI64_EPOCH_HI, decodeSFBinary, encodeSFBinary, fromUTC, now, tai64nLabel, tai64nLabelFromUTC, tai64nLabelToUTC };
|
|
29
|
+
//# sourceMappingURL=utils.d.mts.map
|
package/dist/utils.mjs
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { SF_BINARY_PATTERN, TAI64N_CONTENT_LENGTH, TAI64N_CONTENT_TYPE, TAI64N_EPOCH_HI, TAI64N_HEADER_KEY_SELECTOR, TAI64N_HEADER_LEAP_SECONDS, TAI64N_HEADER_NONCE, TAI64N_HEADER_SIGNATURE, TAI64N_LABEL_LENGTH, TAI64N_LABEL_PATTERN, TAI64N_PATH, TAI64_EPOCH_HI, decodeSFBinary, encodeSFBinary, fromUTC, now, tai64nLabel, tai64nLabelFromUTC, tai64nLabelToUTC } from "./_chunks/time.mjs";
|
|
2
|
+
export { SF_BINARY_PATTERN, TAI64N_CONTENT_LENGTH, TAI64N_CONTENT_TYPE, TAI64N_EPOCH_HI, TAI64N_HEADER_KEY_SELECTOR, TAI64N_HEADER_LEAP_SECONDS, TAI64N_HEADER_NONCE, TAI64N_HEADER_SIGNATURE, TAI64N_LABEL_LENGTH, TAI64N_LABEL_PATTERN, TAI64N_PATH, TAI64_EPOCH_HI, decodeSFBinary, encodeSFBinary, fromUTC, now, tai64nLabel, tai64nLabelFromUTC, tai64nLabelToUTC };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kagal/taistamp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Signed TAI64N timestamps over HTTP",
|
|
6
6
|
"author": "Apptly Software Ltd <oss@apptly.co>",
|
|
@@ -35,25 +35,29 @@
|
|
|
35
35
|
".": {
|
|
36
36
|
"types": "./dist/index.d.mts",
|
|
37
37
|
"default": "./dist/index.mjs"
|
|
38
|
+
},
|
|
39
|
+
"./utils": {
|
|
40
|
+
"types": "./dist/utils.d.mts",
|
|
41
|
+
"default": "./dist/utils.mjs"
|
|
38
42
|
}
|
|
39
43
|
},
|
|
40
44
|
"files": [
|
|
41
45
|
"dist"
|
|
42
46
|
],
|
|
43
47
|
"dependencies": {
|
|
44
|
-
"@kagal/ed25519-secret": "^0.3.
|
|
48
|
+
"@kagal/ed25519-secret": "^0.3.2"
|
|
45
49
|
},
|
|
46
50
|
"devDependencies": {
|
|
47
51
|
"@cloudflare/vitest-pool-workers": "^0.13.1",
|
|
48
52
|
"@cloudflare/workers-types": "^4.20260514.1",
|
|
49
|
-
"@kagal/build-tsdoc": "^0.2.
|
|
53
|
+
"@kagal/build-tsdoc": "^0.2.1",
|
|
50
54
|
"@kagal/cross-test": "^0.1.3",
|
|
51
55
|
"@noble/ed25519": "^3.1.0",
|
|
52
56
|
"@poupe/eslint-config": "^0.9.3",
|
|
53
57
|
"@types/node": "^20.19.41",
|
|
54
58
|
"@vitest/coverage-istanbul": "^4.1.8",
|
|
55
59
|
"eslint": "^9.39.4",
|
|
56
|
-
"npm-run-all2": "^9.0.
|
|
60
|
+
"npm-run-all2": "^9.0.2",
|
|
57
61
|
"obuild": "^0.4.36",
|
|
58
62
|
"publint": "^0.3.21",
|
|
59
63
|
"rimraf": "^6.1.3",
|
|
@@ -76,7 +80,7 @@
|
|
|
76
80
|
"lint": "eslint --fix .",
|
|
77
81
|
"lint:_pkg-pr-new": "eslint --fix package.json",
|
|
78
82
|
"lint:check": "eslint .",
|
|
79
|
-
"precommit": "run-s dev:prepare lint type-check build test",
|
|
83
|
+
"precommit": "run-s dev:prepare lint type-check build test test:compat",
|
|
80
84
|
"publint": "publint",
|
|
81
85
|
"publish:maybe": "npm view ${npm_package_name}@${npm_package_version} version 2>/dev/null && echo \"${npm_package_name}@${npm_package_version} already published\" || pnpm publish",
|
|
82
86
|
"test": "vitest run",
|