ecwt 0.3.0 → 0.3.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/README.md +2 -2
- package/bun.lock +118 -70
- package/dist/main.cjs +64 -51
- package/dist/main.d.cts +2 -19
- package/dist/main.d.mts +2 -19
- package/dist/main.mjs +64 -51
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -18,11 +18,11 @@ ECWT is module for creating and verifying encrypted CBOR Web Tokens. It is desig
|
|
|
18
18
|
ECWT depends on other modules, so you need to install them too.
|
|
19
19
|
|
|
20
20
|
```sh
|
|
21
|
-
|
|
21
|
+
bun install ecwt @kirick/snowflake
|
|
22
22
|
# or
|
|
23
23
|
pnpm install ecwt @kirick/snowflake
|
|
24
24
|
# or
|
|
25
|
-
|
|
25
|
+
npm install ecwt @kirick/snowflake
|
|
26
26
|
```
|
|
27
27
|
|
|
28
28
|
### Some dependencies
|
package/bun.lock
CHANGED
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"typescript": "6.0.2",
|
|
21
21
|
"unplugin-unused": "0.5.7",
|
|
22
22
|
"valibot": "1.4.0",
|
|
23
|
-
"vitest": "4.1.
|
|
23
|
+
"vitest": "4.1.7",
|
|
24
24
|
},
|
|
25
25
|
"peerDependencies": {
|
|
26
26
|
"@kirick/snowflake": "^0.3",
|
|
@@ -80,6 +80,58 @@
|
|
|
80
80
|
|
|
81
81
|
"@es-joy/resolve.exports": ["@es-joy/resolve.exports@1.2.0", "", {}, "sha512-Q9hjxWI5xBM+qW2enxfe8wDKdFWMfd0Z29k5ZJnuBqD/CasY5Zryj09aCA6owbGATWz+39p5uIdaHXpopOcG8g=="],
|
|
82
82
|
|
|
83
|
+
"@esbuild/aix-ppc64": ["@esbuild/aix-ppc64@0.27.7", "", { "os": "aix", "cpu": "ppc64" }, "sha512-EKX3Qwmhz1eMdEJokhALr0YiD0lhQNwDqkPYyPhiSwKrh7/4KRjQc04sZ8db+5DVVnZ1LmbNDI1uAMPEUBnQPg=="],
|
|
84
|
+
|
|
85
|
+
"@esbuild/android-arm": ["@esbuild/android-arm@0.27.7", "", { "os": "android", "cpu": "arm" }, "sha512-jbPXvB4Yj2yBV7HUfE2KHe4GJX51QplCN1pGbYjvsyCZbQmies29EoJbkEc+vYuU5o45AfQn37vZlyXy4YJ8RQ=="],
|
|
86
|
+
|
|
87
|
+
"@esbuild/android-arm64": ["@esbuild/android-arm64@0.27.7", "", { "os": "android", "cpu": "arm64" }, "sha512-62dPZHpIXzvChfvfLJow3q5dDtiNMkwiRzPylSCfriLvZeq0a1bWChrGx/BbUbPwOrsWKMn8idSllklzBy+dgQ=="],
|
|
88
|
+
|
|
89
|
+
"@esbuild/android-x64": ["@esbuild/android-x64@0.27.7", "", { "os": "android", "cpu": "x64" }, "sha512-x5VpMODneVDb70PYV2VQOmIUUiBtY3D3mPBG8NxVk5CogneYhkR7MmM3yR/uMdITLrC1ml/NV1rj4bMJuy9MCg=="],
|
|
90
|
+
|
|
91
|
+
"@esbuild/darwin-arm64": ["@esbuild/darwin-arm64@0.27.7", "", { "os": "darwin", "cpu": "arm64" }, "sha512-5lckdqeuBPlKUwvoCXIgI2D9/ABmPq3Rdp7IfL70393YgaASt7tbju3Ac+ePVi3KDH6N2RqePfHnXkaDtY9fkw=="],
|
|
92
|
+
|
|
93
|
+
"@esbuild/darwin-x64": ["@esbuild/darwin-x64@0.27.7", "", { "os": "darwin", "cpu": "x64" }, "sha512-rYnXrKcXuT7Z+WL5K980jVFdvVKhCHhUwid+dDYQpH+qu+TefcomiMAJpIiC2EM3Rjtq0sO3StMV/+3w3MyyqQ=="],
|
|
94
|
+
|
|
95
|
+
"@esbuild/freebsd-arm64": ["@esbuild/freebsd-arm64@0.27.7", "", { "os": "freebsd", "cpu": "arm64" }, "sha512-B48PqeCsEgOtzME2GbNM2roU29AMTuOIN91dsMO30t+Ydis3z/3Ngoj5hhnsOSSwNzS+6JppqWsuhTp6E82l2w=="],
|
|
96
|
+
|
|
97
|
+
"@esbuild/freebsd-x64": ["@esbuild/freebsd-x64@0.27.7", "", { "os": "freebsd", "cpu": "x64" }, "sha512-jOBDK5XEjA4m5IJK3bpAQF9/Lelu/Z9ZcdhTRLf4cajlB+8VEhFFRjWgfy3M1O4rO2GQ/b2dLwCUGpiF/eATNQ=="],
|
|
98
|
+
|
|
99
|
+
"@esbuild/linux-arm": ["@esbuild/linux-arm@0.27.7", "", { "os": "linux", "cpu": "arm" }, "sha512-RkT/YXYBTSULo3+af8Ib0ykH8u2MBh57o7q/DAs3lTJlyVQkgQvlrPTnjIzzRPQyavxtPtfg0EopvDyIt0j1rA=="],
|
|
100
|
+
|
|
101
|
+
"@esbuild/linux-arm64": ["@esbuild/linux-arm64@0.27.7", "", { "os": "linux", "cpu": "arm64" }, "sha512-RZPHBoxXuNnPQO9rvjh5jdkRmVizktkT7TCDkDmQ0W2SwHInKCAV95GRuvdSvA7w4VMwfCjUiPwDi0ZO6Nfe9A=="],
|
|
102
|
+
|
|
103
|
+
"@esbuild/linux-ia32": ["@esbuild/linux-ia32@0.27.7", "", { "os": "linux", "cpu": "ia32" }, "sha512-GA48aKNkyQDbd3KtkplYWT102C5sn/EZTY4XROkxONgruHPU72l+gW+FfF8tf2cFjeHaRbWpOYa/uRBz/Xq1Pg=="],
|
|
104
|
+
|
|
105
|
+
"@esbuild/linux-loong64": ["@esbuild/linux-loong64@0.27.7", "", { "os": "linux", "cpu": "none" }, "sha512-a4POruNM2oWsD4WKvBSEKGIiWQF8fZOAsycHOt6JBpZ+JN2n2JH9WAv56SOyu9X5IqAjqSIPTaJkqN8F7XOQ5Q=="],
|
|
106
|
+
|
|
107
|
+
"@esbuild/linux-mips64el": ["@esbuild/linux-mips64el@0.27.7", "", { "os": "linux", "cpu": "none" }, "sha512-KabT5I6StirGfIz0FMgl1I+R1H73Gp0ofL9A3nG3i/cYFJzKHhouBV5VWK1CSgKvVaG4q1RNpCTR2LuTVB3fIw=="],
|
|
108
|
+
|
|
109
|
+
"@esbuild/linux-ppc64": ["@esbuild/linux-ppc64@0.27.7", "", { "os": "linux", "cpu": "ppc64" }, "sha512-gRsL4x6wsGHGRqhtI+ifpN/vpOFTQtnbsupUF5R5YTAg+y/lKelYR1hXbnBdzDjGbMYjVJLJTd2OFmMewAgwlQ=="],
|
|
110
|
+
|
|
111
|
+
"@esbuild/linux-riscv64": ["@esbuild/linux-riscv64@0.27.7", "", { "os": "linux", "cpu": "none" }, "sha512-hL25LbxO1QOngGzu2U5xeXtxXcW+/GvMN3ejANqXkxZ/opySAZMrc+9LY/WyjAan41unrR3YrmtTsUpwT66InQ=="],
|
|
112
|
+
|
|
113
|
+
"@esbuild/linux-s390x": ["@esbuild/linux-s390x@0.27.7", "", { "os": "linux", "cpu": "s390x" }, "sha512-2k8go8Ycu1Kb46vEelhu1vqEP+UeRVj2zY1pSuPdgvbd5ykAw82Lrro28vXUrRmzEsUV0NzCf54yARIK8r0fdw=="],
|
|
114
|
+
|
|
115
|
+
"@esbuild/linux-x64": ["@esbuild/linux-x64@0.27.7", "", { "os": "linux", "cpu": "x64" }, "sha512-hzznmADPt+OmsYzw1EE33ccA+HPdIqiCRq7cQeL1Jlq2gb1+OyWBkMCrYGBJ+sxVzve2ZJEVeePbLM2iEIZSxA=="],
|
|
116
|
+
|
|
117
|
+
"@esbuild/netbsd-arm64": ["@esbuild/netbsd-arm64@0.27.7", "", { "os": "none", "cpu": "arm64" }, "sha512-b6pqtrQdigZBwZxAn1UpazEisvwaIDvdbMbmrly7cDTMFnw/+3lVxxCTGOrkPVnsYIosJJXAsILG9XcQS+Yu6w=="],
|
|
118
|
+
|
|
119
|
+
"@esbuild/netbsd-x64": ["@esbuild/netbsd-x64@0.27.7", "", { "os": "none", "cpu": "x64" }, "sha512-OfatkLojr6U+WN5EDYuoQhtM+1xco+/6FSzJJnuWiUw5eVcicbyK3dq5EeV/QHT1uy6GoDhGbFpprUiHUYggrw=="],
|
|
120
|
+
|
|
121
|
+
"@esbuild/openbsd-arm64": ["@esbuild/openbsd-arm64@0.27.7", "", { "os": "openbsd", "cpu": "arm64" }, "sha512-AFuojMQTxAz75Fo8idVcqoQWEHIXFRbOc1TrVcFSgCZtQfSdc1RXgB3tjOn/krRHENUB4j00bfGjyl2mJrU37A=="],
|
|
122
|
+
|
|
123
|
+
"@esbuild/openbsd-x64": ["@esbuild/openbsd-x64@0.27.7", "", { "os": "openbsd", "cpu": "x64" }, "sha512-+A1NJmfM8WNDv5CLVQYJ5PshuRm/4cI6WMZRg1by1GwPIQPCTs1GLEUHwiiQGT5zDdyLiRM/l1G0Pv54gvtKIg=="],
|
|
124
|
+
|
|
125
|
+
"@esbuild/openharmony-arm64": ["@esbuild/openharmony-arm64@0.27.7", "", { "os": "none", "cpu": "arm64" }, "sha512-+KrvYb/C8zA9CU/g0sR6w2RBw7IGc5J2BPnc3dYc5VJxHCSF1yNMxTV5LQ7GuKteQXZtspjFbiuW5/dOj7H4Yw=="],
|
|
126
|
+
|
|
127
|
+
"@esbuild/sunos-x64": ["@esbuild/sunos-x64@0.27.7", "", { "os": "sunos", "cpu": "x64" }, "sha512-ikktIhFBzQNt/QDyOL580ti9+5mL/YZeUPKU2ivGtGjdTYoqz6jObj6nOMfhASpS4GU4Q/Clh1QtxWAvcYKamA=="],
|
|
128
|
+
|
|
129
|
+
"@esbuild/win32-arm64": ["@esbuild/win32-arm64@0.27.7", "", { "os": "win32", "cpu": "arm64" }, "sha512-7yRhbHvPqSpRUV7Q20VuDwbjW5kIMwTHpptuUzV+AA46kiPze5Z7qgt6CLCK3pWFrHeNfDd1VKgyP4O+ng17CA=="],
|
|
130
|
+
|
|
131
|
+
"@esbuild/win32-ia32": ["@esbuild/win32-ia32@0.27.7", "", { "os": "win32", "cpu": "ia32" }, "sha512-SmwKXe6VHIyZYbBLJrhOoCJRB/Z1tckzmgTLfFYOfpMAx63BJEaL9ExI8x7v0oAO3Zh6D/Oi1gVxEYr5oUCFhw=="],
|
|
132
|
+
|
|
133
|
+
"@esbuild/win32-x64": ["@esbuild/win32-x64@0.27.7", "", { "os": "win32", "cpu": "x64" }, "sha512-56hiAJPhwQ1R4i+21FVF7V8kSD5zZTdHcVuRFMW0hn753vVfQN8xlx4uOPT4xoGH0Z/oVATuR82AiqSTDIpaHg=="],
|
|
134
|
+
|
|
83
135
|
"@eslint-community/eslint-utils": ["@eslint-community/eslint-utils@4.9.1", "", { "dependencies": { "eslint-visitor-keys": "^3.4.3" }, "peerDependencies": { "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" } }, "sha512-phrYmNiYppR7znFEdqgfWHXR6NCkZEK7hwWDHZUjit/2/U0r6XvkDl0SYnoM51Hq7FhCGdLDT6zxCCOY1hexsQ=="],
|
|
84
136
|
|
|
85
137
|
"@eslint-community/regexpp": ["@eslint-community/regexpp@4.12.2", "", {}, "sha512-EriSTlt5OC9/7SXkRSCAhfSxxoSUgBm33OH+IkwbdpgoqsSsUg7y3uh+IICI/Qg4BBWr3U2i39RpmycbxMq4ew=="],
|
|
@@ -208,6 +260,56 @@
|
|
|
208
260
|
|
|
209
261
|
"@rolldown/pluginutils": ["@rolldown/pluginutils@1.0.0-rc.17", "", {}, "sha512-n8iosDOt6Ig1UhJ2AYqoIhHWh/isz0xpicHTzpKBeotdVsTEcxsSA/i3EVM7gQAj0rU27OLAxCjzlj15IWY7bg=="],
|
|
210
262
|
|
|
263
|
+
"@rollup/rollup-android-arm-eabi": ["@rollup/rollup-android-arm-eabi@4.60.4", "", { "os": "android", "cpu": "arm" }, "sha512-F5QXMSiFebS9hKZj02XhWLLnRpJ3B3AROP0tWbFBSj+6kCbg5m9j5JoHKd4mmSVy5mS/IMQloYgYxCuJC0fxEQ=="],
|
|
264
|
+
|
|
265
|
+
"@rollup/rollup-android-arm64": ["@rollup/rollup-android-arm64@4.60.4", "", { "os": "android", "cpu": "arm64" }, "sha512-GxxTKApUpzRhof7poWvCJHRF51C67u1R7D6DiluBE8wKU1u5GWE8t+v81JvJYtbawoBFX1hLv5Ei4eVjkWokaw=="],
|
|
266
|
+
|
|
267
|
+
"@rollup/rollup-darwin-arm64": ["@rollup/rollup-darwin-arm64@4.60.4", "", { "os": "darwin", "cpu": "arm64" }, "sha512-tua0TaJxMOB1R0V0RS1jFZ/RpURFDJIOR2A6jWwQeawuFyS4gBW+rntLRaQd0EQ4bd6Vp44Z2rXW+YYDBsj6IA=="],
|
|
268
|
+
|
|
269
|
+
"@rollup/rollup-darwin-x64": ["@rollup/rollup-darwin-x64@4.60.4", "", { "os": "darwin", "cpu": "x64" }, "sha512-CSKq7MsP+5PFIcydhAiR1K0UhEI1A2jWXVKHPCBZ151yOutENwvnPocgVHkivu2kviURtCEB6zUQw0vs8RrhMg=="],
|
|
270
|
+
|
|
271
|
+
"@rollup/rollup-freebsd-arm64": ["@rollup/rollup-freebsd-arm64@4.60.4", "", { "os": "freebsd", "cpu": "arm64" }, "sha512-+O8OkVdyvXMtJEciu2wS/pzm1IxntEEQx3z5TAVy4l32G0etZn+RsA48ARRrFm6Ri8fvqPQfgrvNxSjKAbnd3g=="],
|
|
272
|
+
|
|
273
|
+
"@rollup/rollup-freebsd-x64": ["@rollup/rollup-freebsd-x64@4.60.4", "", { "os": "freebsd", "cpu": "x64" }, "sha512-Iw3oMskH3AfNuhU0MSN7vNbdi4me/NiYo2azqPz/Le16zHSa+3RRmliCMWWQmh4lcndccU40xcJuTYJZxNo/lw=="],
|
|
274
|
+
|
|
275
|
+
"@rollup/rollup-linux-arm-gnueabihf": ["@rollup/rollup-linux-arm-gnueabihf@4.60.4", "", { "os": "linux", "cpu": "arm" }, "sha512-EIPRXTVQpHyF8WOo219AD2yEltPehLTcTMz2fn6JsatLYSzQf00hj3rulF+yauOlF9/FtM2WpkT/hJh/KJFGhA=="],
|
|
276
|
+
|
|
277
|
+
"@rollup/rollup-linux-arm-musleabihf": ["@rollup/rollup-linux-arm-musleabihf@4.60.4", "", { "os": "linux", "cpu": "arm" }, "sha512-J3Yh9PzzF1Ovah2At+lHiGQdsYgArxBbXv/zHfSyaiFQEqvNv7DcW98pCrmdjCZBrqBiKrKKe2V+aaSGWuBe/w=="],
|
|
278
|
+
|
|
279
|
+
"@rollup/rollup-linux-arm64-gnu": ["@rollup/rollup-linux-arm64-gnu@4.60.4", "", { "os": "linux", "cpu": "arm64" }, "sha512-BFDEZMYfUvLn37ONE1yMBojPxnMlTFsdyNoqncT0qFq1mAfllL+ATMMJd8TeuVMiX84s1KbcxcZbXInmcO2mRg=="],
|
|
280
|
+
|
|
281
|
+
"@rollup/rollup-linux-arm64-musl": ["@rollup/rollup-linux-arm64-musl@4.60.4", "", { "os": "linux", "cpu": "arm64" }, "sha512-pc9EYOSlOgdQ2uPl1o9PF6/kLSgaUosia7gOuS8mB69IxJvlclko1MECXysjs5ryez1/5zjYqx3+xYU0TU6R1A=="],
|
|
282
|
+
|
|
283
|
+
"@rollup/rollup-linux-loong64-gnu": ["@rollup/rollup-linux-loong64-gnu@4.60.4", "", { "os": "linux", "cpu": "none" }, "sha512-NxnomyxYerDh5n4iLrNa+sH+Z+U4BMEE46V2PgQ/hoB909i8gV1M5wPojWg9fk1jWpO3IQnOs20K4wyZuFLEFQ=="],
|
|
284
|
+
|
|
285
|
+
"@rollup/rollup-linux-loong64-musl": ["@rollup/rollup-linux-loong64-musl@4.60.4", "", { "os": "linux", "cpu": "none" }, "sha512-nbJnQ8a3z1mtmrwImCYhc6BGpThAyYVRQxw9uKSKG4wR6aAYno9sVjJ0zaZcW9BPJX1GbrDPf+SvdWjgTuDmnw=="],
|
|
286
|
+
|
|
287
|
+
"@rollup/rollup-linux-ppc64-gnu": ["@rollup/rollup-linux-ppc64-gnu@4.60.4", "", { "os": "linux", "cpu": "ppc64" }, "sha512-2EU6acNrQLd8tYvo/LXW535wupT3m6fo7HKo6lr7ktQoItxTyOL1ZCR/GfGCuXl2vR+zmfI6eRXkSemafv+iVg=="],
|
|
288
|
+
|
|
289
|
+
"@rollup/rollup-linux-ppc64-musl": ["@rollup/rollup-linux-ppc64-musl@4.60.4", "", { "os": "linux", "cpu": "ppc64" }, "sha512-WeBtoMuaMxiiIrO2IYP3xs6GMWkJP2C0EoT8beTLkUPmzV1i/UcOSVw1d5r9KBODtHKilG5yFxsGRnBbK3wJ4A=="],
|
|
290
|
+
|
|
291
|
+
"@rollup/rollup-linux-riscv64-gnu": ["@rollup/rollup-linux-riscv64-gnu@4.60.4", "", { "os": "linux", "cpu": "none" }, "sha512-FJHFfqpKUI3A10WrWKiFbBZ7yVbGT4q4B5o1qKFFojqpaYoh9LrQgqWCmmcxQzVSXYtyB5bzkXrYzlHTs21MYA=="],
|
|
292
|
+
|
|
293
|
+
"@rollup/rollup-linux-riscv64-musl": ["@rollup/rollup-linux-riscv64-musl@4.60.4", "", { "os": "linux", "cpu": "none" }, "sha512-mcEl6CUT5IAUmQf1m9FYSmVqCJlpQ8r8eyftFUHG8i9OhY7BkBXSUdnLH5DOf0wCOjcP9v/QO93zpmF1SptCCw=="],
|
|
294
|
+
|
|
295
|
+
"@rollup/rollup-linux-s390x-gnu": ["@rollup/rollup-linux-s390x-gnu@4.60.4", "", { "os": "linux", "cpu": "s390x" }, "sha512-ynt3JxVd2w2buzoKDWIyiV1pJW93xlQic1THVLXilz429oijRpSHivZAgp65KBu+cMcgf1eVVjdnTLvPxgCuoQ=="],
|
|
296
|
+
|
|
297
|
+
"@rollup/rollup-linux-x64-gnu": ["@rollup/rollup-linux-x64-gnu@4.60.4", "", { "os": "linux", "cpu": "x64" }, "sha512-Boiz5+MsaROEWDf+GGEwF8VMHGhlUoQMtIPjOgA5fv4osupqTVnJteQNKJwUcnUog2G55jYXH7KZFFiJe0TEzQ=="],
|
|
298
|
+
|
|
299
|
+
"@rollup/rollup-linux-x64-musl": ["@rollup/rollup-linux-x64-musl@4.60.4", "", { "os": "linux", "cpu": "x64" }, "sha512-+qfSY27qIrFfI/Hom04KYFw3GKZSGU4lXus51wsb5EuySfFlWRwjkKWoE9emgRw/ukoT4Udsj4W/+xxG8VbPKg=="],
|
|
300
|
+
|
|
301
|
+
"@rollup/rollup-openbsd-x64": ["@rollup/rollup-openbsd-x64@4.60.4", "", { "os": "openbsd", "cpu": "x64" }, "sha512-VpTfOPHgVXEBeeR8hZ2O0F3aSso+JDWqTWmTmzcQKted54IAdUVbxE+j/MVxUsKa8L20HJhv3vUezVPoquqWjA=="],
|
|
302
|
+
|
|
303
|
+
"@rollup/rollup-openharmony-arm64": ["@rollup/rollup-openharmony-arm64@4.60.4", "", { "os": "none", "cpu": "arm64" }, "sha512-IPOsh5aRYuLv/nkU51X10Bf75Bsf6+gZdx1X+QP5QM6lIJFHHqbHLG0uJn/hWthzo13UAc2umiUorqZy3axoZg=="],
|
|
304
|
+
|
|
305
|
+
"@rollup/rollup-win32-arm64-msvc": ["@rollup/rollup-win32-arm64-msvc@4.60.4", "", { "os": "win32", "cpu": "arm64" }, "sha512-4QzE9E81OohJ/HKzHhsqU+zcYYojVOXlFMs1DdyMT6qXl/niOH7AVElmmEdUNHHS/oRkc++d5k6Vy85zFs0DEw=="],
|
|
306
|
+
|
|
307
|
+
"@rollup/rollup-win32-ia32-msvc": ["@rollup/rollup-win32-ia32-msvc@4.60.4", "", { "os": "win32", "cpu": "ia32" }, "sha512-zTPgT1YuHHcd+Tmx7h8aml0FWFVelV5N54oHow9SLj+GfoDy/huQ+UV396N/C7KpMDMiPspRktzM1/0r1usYEA=="],
|
|
308
|
+
|
|
309
|
+
"@rollup/rollup-win32-x64-gnu": ["@rollup/rollup-win32-x64-gnu@4.60.4", "", { "os": "win32", "cpu": "x64" }, "sha512-DRS4G7mi9lJxqEDezIkKCaUIKCrLUUDCUaCsTPCi/rtqaC6D/jjwslMQyiDU50Ka0JKpeXeRBFBAXwArY52vBw=="],
|
|
310
|
+
|
|
311
|
+
"@rollup/rollup-win32-x64-msvc": ["@rollup/rollup-win32-x64-msvc@4.60.4", "", { "os": "win32", "cpu": "x64" }, "sha512-QVTUovf40zgTqlFVrKA1uXMVvU2QWEFWfAH8Wdc48IxLvrJMQVMBRjuQyUpzZCDkakImib9eVazbWlC6ksWtJw=="],
|
|
312
|
+
|
|
211
313
|
"@sindresorhus/base62": ["@sindresorhus/base62@1.0.0", "", {}, "sha512-TeheYy0ILzBEI/CO55CP6zJCSdSWeRtGnHy8U8dWSUH4I68iqTsy7HkMktR4xakThc9jotkPQUXT4ITdbV7cHA=="],
|
|
212
314
|
|
|
213
315
|
"@standard-schema/spec": ["@standard-schema/spec@1.1.0", "", {}, "sha512-l2aFy5jALhniG5HgqrD6jXLi/rUWrKvqN/qJx6yoJsgKhblVd+iqqU4RCXavm/jPityDo5TCvKMnpjKnOriy0w=="],
|
|
@@ -250,19 +352,19 @@
|
|
|
250
352
|
|
|
251
353
|
"@typescript-eslint/visitor-keys": ["@typescript-eslint/visitor-keys@8.58.0", "", { "dependencies": { "@typescript-eslint/types": "8.58.0", "eslint-visitor-keys": "^5.0.0" } }, "sha512-XJ9UD9+bbDo4a4epraTwG3TsNPeiB9aShrUneAVXy8q4LuwowN+qu89/6ByLMINqvIMeI9H9hOHQtg/ijrYXzQ=="],
|
|
252
354
|
|
|
253
|
-
"@vitest/expect": ["@vitest/expect@4.1.
|
|
355
|
+
"@vitest/expect": ["@vitest/expect@4.1.7", "", { "dependencies": { "@standard-schema/spec": "^1.1.0", "@types/chai": "^5.2.2", "@vitest/spy": "4.1.7", "@vitest/utils": "4.1.7", "chai": "^6.2.2", "tinyrainbow": "^3.1.0" } }, "sha512-1R+tw0ortHEbZDGMymm+pN7/AFQ/RkFFdtd7EN+VBpynKmLbP8A3rpEXdshBJ7+8hQ9zBJh/i1s0yKNtxAnU7w=="],
|
|
254
356
|
|
|
255
|
-
"@vitest/mocker": ["@vitest/mocker@4.1.
|
|
357
|
+
"@vitest/mocker": ["@vitest/mocker@4.1.7", "", { "dependencies": { "@vitest/spy": "4.1.7", "estree-walker": "^3.0.3", "magic-string": "^0.30.21" }, "peerDependencies": { "msw": "^2.4.9", "vite": "^6.0.0 || ^7.0.0 || ^8.0.0" }, "optionalPeers": ["msw", "vite"] }, "sha512-vY7nuamKgfvpA1Koa3oYIw/k7D6kZnpGyNMZW8loow2bsBYla1TFdqTaXncWdRn4pgwNs+90RhnXhJScDwQeJA=="],
|
|
256
358
|
|
|
257
|
-
"@vitest/pretty-format": ["@vitest/pretty-format@4.1.
|
|
359
|
+
"@vitest/pretty-format": ["@vitest/pretty-format@4.1.7", "", { "dependencies": { "tinyrainbow": "^3.1.0" } }, "sha512-umgCarTOYQWIaDMvGDRZij+6b9oVeLIyJzfN+AS88e0ZOU3QTgNNSTtjQOpcvWr3np1N0j4WgZj+sb3oYBDscw=="],
|
|
258
360
|
|
|
259
|
-
"@vitest/runner": ["@vitest/runner@4.1.
|
|
361
|
+
"@vitest/runner": ["@vitest/runner@4.1.7", "", { "dependencies": { "@vitest/utils": "4.1.7", "pathe": "^2.0.3" } }, "sha512-BapjmAQ2aI78WdMEfeUWivnfVzB+VPGwWRQcJE0OUq7qEeEcBsCSf+0T5iREBNE5nBb4wA5Ya0W6IA+sghdEFw=="],
|
|
260
362
|
|
|
261
|
-
"@vitest/snapshot": ["@vitest/snapshot@4.1.
|
|
363
|
+
"@vitest/snapshot": ["@vitest/snapshot@4.1.7", "", { "dependencies": { "@vitest/pretty-format": "4.1.7", "@vitest/utils": "4.1.7", "magic-string": "^0.30.21", "pathe": "^2.0.3" } }, "sha512-ZacLzja+TmJeZ1h14xW2FB/WpeimUD3haBXQPyJqxvo8jQTmfeA8zv58mtjN2C7EHXZDYVcVYdYmAxjkWVvKCw=="],
|
|
262
364
|
|
|
263
|
-
"@vitest/spy": ["@vitest/spy@4.1.
|
|
365
|
+
"@vitest/spy": ["@vitest/spy@4.1.7", "", {}, "sha512-kbkI5LMWakyuTIvs6fUJ5qdIVb1XVKsYJAT4OJ938cHMROYMSfmoQdZy0aaAnjbbc8F61vkoTqz/Az+/HiIu5Q=="],
|
|
264
366
|
|
|
265
|
-
"@vitest/utils": ["@vitest/utils@4.1.
|
|
367
|
+
"@vitest/utils": ["@vitest/utils@4.1.7", "", { "dependencies": { "@vitest/pretty-format": "4.1.7", "convert-source-map": "^2.0.0", "tinyrainbow": "^3.1.0" } }, "sha512-T532WBu791cBxJlCl6SO+J14l81DQx6uQHm1bQbmCDY7nqlEIgkza/UFnSBNaUtSf41unldDFjdOBYEQC4b5Hw=="],
|
|
266
368
|
|
|
267
369
|
"acorn": ["acorn@8.16.0", "", { "bin": { "acorn": "bin/acorn" } }, "sha512-UVJyE9MttOsBQIDKw1skb9nAwQuR5wuGD3+82K6JgJlm/Y+KI92oNsMNGZCYdDsVtRHSak0pcV5Dno5+4jh9sw=="],
|
|
268
370
|
|
|
@@ -340,6 +442,8 @@
|
|
|
340
442
|
|
|
341
443
|
"es-module-lexer": ["es-module-lexer@2.1.0", "", {}, "sha512-n27zTYMjYu1aj4MjCWzSP7G9r75utsaoc8m61weK+W8JMBGGQybd43GstCXZ3WNmSFtGT9wi59qQTW6mhTR5LQ=="],
|
|
342
444
|
|
|
445
|
+
"esbuild": ["esbuild@0.27.7", "", { "optionalDependencies": { "@esbuild/aix-ppc64": "0.27.7", "@esbuild/android-arm": "0.27.7", "@esbuild/android-arm64": "0.27.7", "@esbuild/android-x64": "0.27.7", "@esbuild/darwin-arm64": "0.27.7", "@esbuild/darwin-x64": "0.27.7", "@esbuild/freebsd-arm64": "0.27.7", "@esbuild/freebsd-x64": "0.27.7", "@esbuild/linux-arm": "0.27.7", "@esbuild/linux-arm64": "0.27.7", "@esbuild/linux-ia32": "0.27.7", "@esbuild/linux-loong64": "0.27.7", "@esbuild/linux-mips64el": "0.27.7", "@esbuild/linux-ppc64": "0.27.7", "@esbuild/linux-riscv64": "0.27.7", "@esbuild/linux-s390x": "0.27.7", "@esbuild/linux-x64": "0.27.7", "@esbuild/netbsd-arm64": "0.27.7", "@esbuild/netbsd-x64": "0.27.7", "@esbuild/openbsd-arm64": "0.27.7", "@esbuild/openbsd-x64": "0.27.7", "@esbuild/openharmony-arm64": "0.27.7", "@esbuild/sunos-x64": "0.27.7", "@esbuild/win32-arm64": "0.27.7", "@esbuild/win32-ia32": "0.27.7", "@esbuild/win32-x64": "0.27.7" }, "bin": { "esbuild": "bin/esbuild" } }, "sha512-IxpibTjyVnmrIQo5aqNpCgoACA/dTKLTlhMHihVHhdkxKyPO1uBBthumT0rdHmcsk9uMonIWS0m4FljWzILh3w=="],
|
|
446
|
+
|
|
343
447
|
"escalade": ["escalade@3.2.0", "", {}, "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA=="],
|
|
344
448
|
|
|
345
449
|
"escape-string-regexp": ["escape-string-regexp@4.0.0", "", {}, "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA=="],
|
|
@@ -448,30 +552,6 @@
|
|
|
448
552
|
|
|
449
553
|
"levn": ["levn@0.4.1", "", { "dependencies": { "prelude-ls": "^1.2.1", "type-check": "~0.4.0" } }, "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ=="],
|
|
450
554
|
|
|
451
|
-
"lightningcss": ["lightningcss@1.32.0", "", { "dependencies": { "detect-libc": "^2.0.3" }, "optionalDependencies": { "lightningcss-android-arm64": "1.32.0", "lightningcss-darwin-arm64": "1.32.0", "lightningcss-darwin-x64": "1.32.0", "lightningcss-freebsd-x64": "1.32.0", "lightningcss-linux-arm-gnueabihf": "1.32.0", "lightningcss-linux-arm64-gnu": "1.32.0", "lightningcss-linux-arm64-musl": "1.32.0", "lightningcss-linux-x64-gnu": "1.32.0", "lightningcss-linux-x64-musl": "1.32.0", "lightningcss-win32-arm64-msvc": "1.32.0", "lightningcss-win32-x64-msvc": "1.32.0" } }, "sha512-NXYBzinNrblfraPGyrbPoD19C1h9lfI/1mzgWYvXUTe414Gz/X1FD2XBZSZM7rRTrMA8JL3OtAaGifrIKhQ5yQ=="],
|
|
452
|
-
|
|
453
|
-
"lightningcss-android-arm64": ["lightningcss-android-arm64@1.32.0", "", { "os": "android", "cpu": "arm64" }, "sha512-YK7/ClTt4kAK0vo6w3X+Pnm0D2cf2vPHbhOXdoNti1Ga0al1P4TBZhwjATvjNwLEBCnKvjJc2jQgHXH0NEwlAg=="],
|
|
454
|
-
|
|
455
|
-
"lightningcss-darwin-arm64": ["lightningcss-darwin-arm64@1.32.0", "", { "os": "darwin", "cpu": "arm64" }, "sha512-RzeG9Ju5bag2Bv1/lwlVJvBE3q6TtXskdZLLCyfg5pt+HLz9BqlICO7LZM7VHNTTn/5PRhHFBSjk5lc4cmscPQ=="],
|
|
456
|
-
|
|
457
|
-
"lightningcss-darwin-x64": ["lightningcss-darwin-x64@1.32.0", "", { "os": "darwin", "cpu": "x64" }, "sha512-U+QsBp2m/s2wqpUYT/6wnlagdZbtZdndSmut/NJqlCcMLTWp5muCrID+K5UJ6jqD2BFshejCYXniPDbNh73V8w=="],
|
|
458
|
-
|
|
459
|
-
"lightningcss-freebsd-x64": ["lightningcss-freebsd-x64@1.32.0", "", { "os": "freebsd", "cpu": "x64" }, "sha512-JCTigedEksZk3tHTTthnMdVfGf61Fky8Ji2E4YjUTEQX14xiy/lTzXnu1vwiZe3bYe0q+SpsSH/CTeDXK6WHig=="],
|
|
460
|
-
|
|
461
|
-
"lightningcss-linux-arm-gnueabihf": ["lightningcss-linux-arm-gnueabihf@1.32.0", "", { "os": "linux", "cpu": "arm" }, "sha512-x6rnnpRa2GL0zQOkt6rts3YDPzduLpWvwAF6EMhXFVZXD4tPrBkEFqzGowzCsIWsPjqSK+tyNEODUBXeeVHSkw=="],
|
|
462
|
-
|
|
463
|
-
"lightningcss-linux-arm64-gnu": ["lightningcss-linux-arm64-gnu@1.32.0", "", { "os": "linux", "cpu": "arm64" }, "sha512-0nnMyoyOLRJXfbMOilaSRcLH3Jw5z9HDNGfT/gwCPgaDjnx0i8w7vBzFLFR1f6CMLKF8gVbebmkUN3fa/kQJpQ=="],
|
|
464
|
-
|
|
465
|
-
"lightningcss-linux-arm64-musl": ["lightningcss-linux-arm64-musl@1.32.0", "", { "os": "linux", "cpu": "arm64" }, "sha512-UpQkoenr4UJEzgVIYpI80lDFvRmPVg6oqboNHfoH4CQIfNA+HOrZ7Mo7KZP02dC6LjghPQJeBsvXhJod/wnIBg=="],
|
|
466
|
-
|
|
467
|
-
"lightningcss-linux-x64-gnu": ["lightningcss-linux-x64-gnu@1.32.0", "", { "os": "linux", "cpu": "x64" }, "sha512-V7Qr52IhZmdKPVr+Vtw8o+WLsQJYCTd8loIfpDaMRWGUZfBOYEJeyJIkqGIDMZPwPx24pUMfwSxxI8phr/MbOA=="],
|
|
468
|
-
|
|
469
|
-
"lightningcss-linux-x64-musl": ["lightningcss-linux-x64-musl@1.32.0", "", { "os": "linux", "cpu": "x64" }, "sha512-bYcLp+Vb0awsiXg/80uCRezCYHNg1/l3mt0gzHnWV9XP1W5sKa5/TCdGWaR/zBM2PeF/HbsQv/j2URNOiVuxWg=="],
|
|
470
|
-
|
|
471
|
-
"lightningcss-win32-arm64-msvc": ["lightningcss-win32-arm64-msvc@1.32.0", "", { "os": "win32", "cpu": "arm64" }, "sha512-8SbC8BR40pS6baCM8sbtYDSwEVQd4JlFTOlaD3gWGHfThTcABnNDBda6eTZeqbofalIJhFx0qKzgHJmcPTnGdw=="],
|
|
472
|
-
|
|
473
|
-
"lightningcss-win32-x64-msvc": ["lightningcss-win32-x64-msvc@1.32.0", "", { "os": "win32", "cpu": "x64" }, "sha512-Amq9B/SoZYdDi1kFrojnoqPLxYhQ4Wo5XiL8EVJrVsB8ARoC1PWW6VGtT0WKCemjy8aC+louJnjS7U18x3b06Q=="],
|
|
474
|
-
|
|
475
555
|
"locate-path": ["locate-path@6.0.0", "", { "dependencies": { "p-locate": "^5.0.0" } }, "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw=="],
|
|
476
556
|
|
|
477
557
|
"lru-cache": ["lru-cache@11.4.0", "", {}, "sha512-W+R+kFL4HgVxONq2bhXPi3bGpzGe/yEhVOp233qw9wCRtgncJ15P3bC+e4zZMu4Cq7d+WAJjXGW0uUkifhcatA=="],
|
|
@@ -550,6 +630,8 @@
|
|
|
550
630
|
|
|
551
631
|
"rolldown-plugin-dts": ["rolldown-plugin-dts@0.23.2", "", { "dependencies": { "@babel/generator": "8.0.0-rc.3", "@babel/helper-validator-identifier": "8.0.0-rc.3", "@babel/parser": "8.0.0-rc.3", "@babel/types": "8.0.0-rc.3", "ast-kit": "^3.0.0-beta.1", "birpc": "^4.0.0", "dts-resolver": "^2.1.3", "get-tsconfig": "^4.13.7", "obug": "^2.1.1", "picomatch": "^4.0.4" }, "peerDependencies": { "@ts-macro/tsc": "^0.3.6", "@typescript/native-preview": ">=7.0.0-dev.20260325.1", "rolldown": "^1.0.0-rc.12", "typescript": "^5.0.0 || ^6.0.0", "vue-tsc": "~3.2.0" }, "optionalPeers": ["@ts-macro/tsc", "@typescript/native-preview", "typescript", "vue-tsc"] }, "sha512-PbSqLawLgZBGcOGT3yqWBGn4cX+wh2nt5FuBGdcMHyOhoukmjbhYAl8NT9sE4U38Cm9tqLOIQeOrvzeayM0DLQ=="],
|
|
552
632
|
|
|
633
|
+
"rollup": ["rollup@4.60.4", "", { "dependencies": { "@types/estree": "1.0.8" }, "optionalDependencies": { "@rollup/rollup-android-arm-eabi": "4.60.4", "@rollup/rollup-android-arm64": "4.60.4", "@rollup/rollup-darwin-arm64": "4.60.4", "@rollup/rollup-darwin-x64": "4.60.4", "@rollup/rollup-freebsd-arm64": "4.60.4", "@rollup/rollup-freebsd-x64": "4.60.4", "@rollup/rollup-linux-arm-gnueabihf": "4.60.4", "@rollup/rollup-linux-arm-musleabihf": "4.60.4", "@rollup/rollup-linux-arm64-gnu": "4.60.4", "@rollup/rollup-linux-arm64-musl": "4.60.4", "@rollup/rollup-linux-loong64-gnu": "4.60.4", "@rollup/rollup-linux-loong64-musl": "4.60.4", "@rollup/rollup-linux-ppc64-gnu": "4.60.4", "@rollup/rollup-linux-ppc64-musl": "4.60.4", "@rollup/rollup-linux-riscv64-gnu": "4.60.4", "@rollup/rollup-linux-riscv64-musl": "4.60.4", "@rollup/rollup-linux-s390x-gnu": "4.60.4", "@rollup/rollup-linux-x64-gnu": "4.60.4", "@rollup/rollup-linux-x64-musl": "4.60.4", "@rollup/rollup-openbsd-x64": "4.60.4", "@rollup/rollup-openharmony-arm64": "4.60.4", "@rollup/rollup-win32-arm64-msvc": "4.60.4", "@rollup/rollup-win32-ia32-msvc": "4.60.4", "@rollup/rollup-win32-x64-gnu": "4.60.4", "@rollup/rollup-win32-x64-msvc": "4.60.4", "fsevents": "~2.3.2" }, "bin": { "rollup": "dist/bin/rollup" } }, "sha512-WHeFSbZYsPu3+bLoNRUuAO+wavNlocOPf3wSHTP7hcFKVnJeWsYlCDbr3mTS14FCizf9ccIxXA8sGL8zKeQN3g=="],
|
|
634
|
+
|
|
553
635
|
"sade": ["sade@1.8.1", "", { "dependencies": { "mri": "^1.1.0" } }, "sha512-xal3CZX1Xlo/k4ApwCFrHVACi9fBqJ7V+mwhBsuf/1IOKbBy098Fex+Wa/5QMubw09pSZ/u8EY8PWgevJsXp1A=="],
|
|
554
636
|
|
|
555
637
|
"semver": ["semver@7.8.0", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-AcM7dV/5ul4EekoQ29Agm5vri8JNqRyj39o0qpX6vDF2GZrtutZl5RwgD1XnZjiTAfncsJhMI48QQH3sN87YNA=="],
|
|
@@ -620,9 +702,9 @@
|
|
|
620
702
|
|
|
621
703
|
"valibot": ["valibot@1.4.0", "", { "peerDependencies": { "typescript": ">=5" }, "optionalPeers": ["typescript"] }, "sha512-iC/x7fVcSyOwlm/VSt7RlHnzNGLGvR9GnxdifUeWoCJo0q4ZZvrVkIHC6faTlkxG47I2Y4UrFquPuVHCrOnrLg=="],
|
|
622
704
|
|
|
623
|
-
"vite": ["vite@
|
|
705
|
+
"vite": ["vite@7.3.3", "", { "dependencies": { "esbuild": "^0.27.0", "fdir": "^6.5.0", "picomatch": "^4.0.3", "postcss": "^8.5.6", "rollup": "^4.43.0", "tinyglobby": "^0.2.15" }, "optionalDependencies": { "fsevents": "~2.3.3" }, "peerDependencies": { "@types/node": "^20.19.0 || >=22.12.0", "jiti": ">=1.21.0", "less": "^4.0.0", "lightningcss": "^1.21.0", "sass": "^1.70.0", "sass-embedded": "^1.70.0", "stylus": ">=0.54.8", "sugarss": "^5.0.0", "terser": "^5.16.0", "tsx": "^4.8.1", "yaml": "^2.4.2" }, "optionalPeers": ["@types/node", "jiti", "less", "lightningcss", "sass", "sass-embedded", "stylus", "sugarss", "terser", "tsx", "yaml"], "bin": { "vite": "bin/vite.js" } }, "sha512-/4XH147Ui7OGTjg3HbdWe5arnZQSbfuRzdr9Ec7TQi5I7R+ir0Rlc9GIvD4v0XZurELqA035KVXJXpR61xhiTA=="],
|
|
624
706
|
|
|
625
|
-
"vitest": ["vitest@4.1.
|
|
707
|
+
"vitest": ["vitest@4.1.7", "", { "dependencies": { "@vitest/expect": "4.1.7", "@vitest/mocker": "4.1.7", "@vitest/pretty-format": "4.1.7", "@vitest/runner": "4.1.7", "@vitest/snapshot": "4.1.7", "@vitest/spy": "4.1.7", "@vitest/utils": "4.1.7", "es-module-lexer": "^2.0.0", "expect-type": "^1.3.0", "magic-string": "^0.30.21", "obug": "^2.1.1", "pathe": "^2.0.3", "picomatch": "^4.0.3", "std-env": "^4.0.0-rc.1", "tinybench": "^2.9.0", "tinyexec": "^1.0.2", "tinyglobby": "^0.2.15", "tinyrainbow": "^3.1.0", "vite": "^6.0.0 || ^7.0.0 || ^8.0.0", "why-is-node-running": "^2.3.0" }, "peerDependencies": { "@edge-runtime/vm": "*", "@opentelemetry/api": "^1.9.0", "@types/node": "^20.0.0 || ^22.0.0 || >=24.0.0", "@vitest/browser-playwright": "4.1.7", "@vitest/browser-preview": "4.1.7", "@vitest/browser-webdriverio": "4.1.7", "@vitest/coverage-istanbul": "4.1.7", "@vitest/coverage-v8": "4.1.7", "@vitest/ui": "4.1.7", "happy-dom": "*", "jsdom": "*" }, "optionalPeers": ["@edge-runtime/vm", "@opentelemetry/api", "@types/node", "@vitest/browser-playwright", "@vitest/browser-preview", "@vitest/browser-webdriverio", "@vitest/coverage-istanbul", "@vitest/coverage-v8", "@vitest/ui", "happy-dom", "jsdom"], "bin": { "vitest": "vitest.mjs" } }, "sha512-flYyaFd2CgoCoU+0UKt3pxksgC+S02iTDN0n3LtqaMeXsI9SBcdNujc2k0DeFLzUn/0k538yNjOSdwgCqcrwJA=="],
|
|
626
708
|
|
|
627
709
|
"vue-eslint-parser": ["vue-eslint-parser@10.4.0", "", { "dependencies": { "debug": "^4.4.0", "eslint-scope": "^8.2.0 || ^9.0.0", "eslint-visitor-keys": "^4.2.0 || ^5.0.0", "espree": "^10.3.0 || ^11.0.0", "esquery": "^1.6.0", "semver": "^7.6.3" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0" } }, "sha512-Vxi9pJdbN3ZnVGLODVtZ7y4Y2kzAAE2Cm0CZ3ZDRvydVYxZ6VrnBhLikBsRS+dpwj4Jv4UCv21PTEwF5rQ9WXg=="],
|
|
628
710
|
|
|
@@ -668,42 +750,8 @@
|
|
|
668
750
|
|
|
669
751
|
"rolldown-plugin-dts/@babel/helper-validator-identifier": ["@babel/helper-validator-identifier@8.0.0-rc.3", "", {}, "sha512-8AWCJ2VJJyDFlGBep5GpaaQ9AAaE/FjAcrqI7jyssYhtL7WGV0DOKpJsQqM037xDbpRLHXsY8TwU7zDma7coOw=="],
|
|
670
752
|
|
|
671
|
-
"
|
|
672
|
-
|
|
673
|
-
"vite/rolldown": ["rolldown@1.0.1", "", { "dependencies": { "@oxc-project/types": "=0.130.0", "@rolldown/pluginutils": "^1.0.0" }, "optionalDependencies": { "@rolldown/binding-android-arm64": "1.0.1", "@rolldown/binding-darwin-arm64": "1.0.1", "@rolldown/binding-darwin-x64": "1.0.1", "@rolldown/binding-freebsd-x64": "1.0.1", "@rolldown/binding-linux-arm-gnueabihf": "1.0.1", "@rolldown/binding-linux-arm64-gnu": "1.0.1", "@rolldown/binding-linux-arm64-musl": "1.0.1", "@rolldown/binding-linux-ppc64-gnu": "1.0.1", "@rolldown/binding-linux-s390x-gnu": "1.0.1", "@rolldown/binding-linux-x64-gnu": "1.0.1", "@rolldown/binding-linux-x64-musl": "1.0.1", "@rolldown/binding-openharmony-arm64": "1.0.1", "@rolldown/binding-wasm32-wasi": "1.0.1", "@rolldown/binding-win32-arm64-msvc": "1.0.1", "@rolldown/binding-win32-x64-msvc": "1.0.1" }, "bin": { "rolldown": "bin/cli.mjs" } }, "sha512-X0KQHljNnEkWNqqiz9zJrGunh1B0HgOxLXvnFpCOcadzcy5qohZ3tqMEUg00vncoRovXuK3ZqCT9KnnKzoInFQ=="],
|
|
674
|
-
|
|
675
|
-
"vite/rolldown/@oxc-project/types": ["@oxc-project/types@0.130.0", "", {}, "sha512-ibD2usx9JRu7f5pu2tMKMI4cpA4NgXJQoYRP4pQ7Pxmn1l6k/53qWtQWZayhYy3X4QZkt90Ot+mJEaeXouio6Q=="],
|
|
676
|
-
|
|
677
|
-
"vite/rolldown/@rolldown/binding-android-arm64": ["@rolldown/binding-android-arm64@1.0.1", "", { "os": "android", "cpu": "arm64" }, "sha512-fJI3I0r3C3Oj/zdBCpaCmBRZYf07xpaq4yCfDDoSFm+beWNzbIl26puW8RraUdugoJw/95zerNOn6jasAhzSmg=="],
|
|
678
|
-
|
|
679
|
-
"vite/rolldown/@rolldown/binding-darwin-arm64": ["@rolldown/binding-darwin-arm64@1.0.1", "", { "os": "darwin", "cpu": "arm64" }, "sha512-cKnAhWEsV7TPcA/5EAteDp6KcJZBQ2G+BqE7zayMMi7kMvwRsbv7WT9aOnn0WNl4SKEIf43vjS31iUPu80nzXg=="],
|
|
680
|
-
|
|
681
|
-
"vite/rolldown/@rolldown/binding-darwin-x64": ["@rolldown/binding-darwin-x64@1.0.1", "", { "os": "darwin", "cpu": "x64" }, "sha512-YKrVwQjIRBPo+5G/u03wGjbdy4q7pyzCe93DK9VJ7zkVmeg8LJ7GbgsiHWdR4xSoe4CAXRD7Bcjgbtr64bkXNg=="],
|
|
682
|
-
|
|
683
|
-
"vite/rolldown/@rolldown/binding-freebsd-x64": ["@rolldown/binding-freebsd-x64@1.0.1", "", { "os": "freebsd", "cpu": "x64" }, "sha512-z/oBsREo46SsFqBwYtFe0kpJeBijAT48O/WXLI4suiCLBkr03RTtTJMCzSdDd2znlh8VJizL09XVkQgk8IZonw=="],
|
|
684
|
-
|
|
685
|
-
"vite/rolldown/@rolldown/binding-linux-arm-gnueabihf": ["@rolldown/binding-linux-arm-gnueabihf@1.0.1", "", { "os": "linux", "cpu": "arm" }, "sha512-ik8q7GM11zxvYxFc2PeDcT6TBvhCQMaUxfph/M5l9sKuTs/Sjg3L+Byw0F7w0ZVLBZmx30P+gG0ECzzN+MFcmQ=="],
|
|
686
|
-
|
|
687
|
-
"vite/rolldown/@rolldown/binding-linux-arm64-gnu": ["@rolldown/binding-linux-arm64-gnu@1.0.1", "", { "os": "linux", "cpu": "arm64" }, "sha512-QoSx2EkyrrdZ6kcyE8stqZ62t0Yra8Fs5ia9lOxJrh6TMQJK7gQKmscdTHf7pOXKREKrVwOtJcQG3qVSfc866A=="],
|
|
753
|
+
"rollup/@types/estree": ["@types/estree@1.0.8", "", {}, "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w=="],
|
|
688
754
|
|
|
689
|
-
"
|
|
690
|
-
|
|
691
|
-
"vite/rolldown/@rolldown/binding-linux-ppc64-gnu": ["@rolldown/binding-linux-ppc64-gnu@1.0.1", "", { "os": "linux", "cpu": "ppc64" }, "sha512-zY1bul7OWr7DFBiJ++wofXvnr8B45ce3QsQUhKrIhXsygAh7bTkwyeM1bi1a2g5C/yC/N8TZyGDEoMfm/l9mpg=="],
|
|
692
|
-
|
|
693
|
-
"vite/rolldown/@rolldown/binding-linux-s390x-gnu": ["@rolldown/binding-linux-s390x-gnu@1.0.1", "", { "os": "linux", "cpu": "s390x" }, "sha512-0frlsT/f4Ft6I7SMESTKnF3cZsdicQn1dCMkF/jT9wDLE+gGoiQfv1nmT9e+s7s/fekvvy6tZM2jHvI2tkbJDQ=="],
|
|
694
|
-
|
|
695
|
-
"vite/rolldown/@rolldown/binding-linux-x64-gnu": ["@rolldown/binding-linux-x64-gnu@1.0.1", "", { "os": "linux", "cpu": "x64" }, "sha512-XABVmGp9Tg0WspTVvwduTc4fpqy6JnAUrSQe6OuyqD/03nI7r0O9OWUkMIwFrjKAIqolvqoA4ZrJppgwE0Gxmw=="],
|
|
696
|
-
|
|
697
|
-
"vite/rolldown/@rolldown/binding-linux-x64-musl": ["@rolldown/binding-linux-x64-musl@1.0.1", "", { "os": "linux", "cpu": "x64" }, "sha512-bV4fzswuzVcKD90o/VM6QqKxnxlDq0g2BISDLNVmxrnhpv1DDbyPhCIjYfvzYLV+MvkKKnQt2Q6AO86SEBULUQ=="],
|
|
698
|
-
|
|
699
|
-
"vite/rolldown/@rolldown/binding-openharmony-arm64": ["@rolldown/binding-openharmony-arm64@1.0.1", "", { "os": "none", "cpu": "arm64" }, "sha512-/Mh0Zhq3OP7fVs0kcQHZP6lZEthMGTaSf8UBQYSFEZDWGXXlEC+nJ6EqenaK2t4LBXMe3A+K/G2BVXXdtOr4PQ=="],
|
|
700
|
-
|
|
701
|
-
"vite/rolldown/@rolldown/binding-wasm32-wasi": ["@rolldown/binding-wasm32-wasi@1.0.1", "", { "dependencies": { "@emnapi/core": "1.10.0", "@emnapi/runtime": "1.10.0", "@napi-rs/wasm-runtime": "^1.1.4" }, "cpu": "none" }, "sha512-+1xc9X45l8ufsBAm6Gjvx2qDRIY9lTVt0cgWNcJ+1gdhXvkbxePA60yRTwSTuXL09CMhyJmjpV7E3NoyxbqFQQ=="],
|
|
702
|
-
|
|
703
|
-
"vite/rolldown/@rolldown/binding-win32-arm64-msvc": ["@rolldown/binding-win32-arm64-msvc@1.0.1", "", { "os": "win32", "cpu": "arm64" }, "sha512-1D+UqZdfnuR+Jy1GgMJwi85bD40H21uNmOPRWQhw4oRSuolZ/B5rixZ45DK2KXOTCvmVCecauWgEhbw8bI7tOw=="],
|
|
704
|
-
|
|
705
|
-
"vite/rolldown/@rolldown/binding-win32-x64-msvc": ["@rolldown/binding-win32-x64-msvc@1.0.1", "", { "os": "win32", "cpu": "x64" }, "sha512-INAycaWuhlOK3wk4mRHGsdgwYWmd9cChdPdE9bwWmy6rn9VqVNYNFGhOdXrofXUxwHIncSiPNb8tNm8knDVIeQ=="],
|
|
706
|
-
|
|
707
|
-
"vite/rolldown/@rolldown/pluginutils": ["@rolldown/pluginutils@1.0.1", "", {}, "sha512-2j9bGt5Jh8hj+vPtgzPtl72j0yRxHAyumoo6TNfAjsLB04UtpSvPbPcDcBMxz7n+9CYB0c1GxQFxYRg2jimqGw=="],
|
|
755
|
+
"unplugin-unused/escape-string-regexp": ["escape-string-regexp@5.0.0", "", {}, "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw=="],
|
|
708
756
|
}
|
|
709
757
|
}
|
package/dist/main.cjs
CHANGED
|
@@ -59,8 +59,8 @@ var Ecwt = class {
|
|
|
59
59
|
snowflake;
|
|
60
60
|
/** Data stored in token. */
|
|
61
61
|
data;
|
|
62
|
-
ecwtFactory;
|
|
63
|
-
ttl_initial;
|
|
62
|
+
#ecwtFactory;
|
|
63
|
+
#ttl_initial;
|
|
64
64
|
/**
|
|
65
65
|
* @param ecwtFactory -
|
|
66
66
|
* @param options -
|
|
@@ -74,28 +74,28 @@ var Ecwt = class {
|
|
|
74
74
|
this.id = options.snowflake.toBase62();
|
|
75
75
|
this.snowflake = options.snowflake;
|
|
76
76
|
this.data = Object.freeze(options.data);
|
|
77
|
-
this
|
|
78
|
-
this
|
|
77
|
+
this.#ecwtFactory = ecwtFactory;
|
|
78
|
+
this.#ttl_initial = options.ttl_initial;
|
|
79
79
|
}
|
|
80
80
|
/**
|
|
81
81
|
* Unix timestamp of token expiration in seconds.
|
|
82
82
|
* @returns -
|
|
83
83
|
*/
|
|
84
84
|
get ts_expired() {
|
|
85
|
-
if (this
|
|
86
|
-
return Math.floor(this.snowflake.timestamp / 1e3) + this
|
|
85
|
+
if (this.#ttl_initial === null) return null;
|
|
86
|
+
return Math.floor(this.snowflake.timestamp / 1e3) + this.#ttl_initial;
|
|
87
87
|
}
|
|
88
88
|
/**
|
|
89
89
|
* Actual time to live in seconds.
|
|
90
90
|
* @returns -
|
|
91
91
|
*/
|
|
92
92
|
getTTL() {
|
|
93
|
-
if (this
|
|
94
|
-
return this
|
|
93
|
+
if (this.#ttl_initial === null) return null;
|
|
94
|
+
return this.#ttl_initial - Math.floor((Date.now() - this.snowflake.timestamp) / 1e3);
|
|
95
95
|
}
|
|
96
96
|
/** Revokes token. */
|
|
97
97
|
revoke() {
|
|
98
|
-
return this
|
|
98
|
+
return this.#ecwtFactory._revoke(this.id, this.snowflake.timestamp, this.#ttl_initial);
|
|
99
99
|
}
|
|
100
100
|
};
|
|
101
101
|
//#endregion
|
|
@@ -105,21 +105,21 @@ const base62 = (0, base_x.default)("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefgh
|
|
|
105
105
|
//#region src/factory.ts
|
|
106
106
|
const REDIS_PREFIX = "@ecwt:";
|
|
107
107
|
var EcwtFactory = class {
|
|
108
|
-
redisClient;
|
|
109
|
-
lruCache;
|
|
110
|
-
snowflakeFactory;
|
|
111
|
-
redis_key_revoked;
|
|
112
|
-
encryption_key;
|
|
113
|
-
validator;
|
|
114
|
-
cborEncoder = null;
|
|
108
|
+
#redisClient;
|
|
109
|
+
#lruCache;
|
|
110
|
+
#snowflakeFactory;
|
|
111
|
+
#redis_key_revoked;
|
|
112
|
+
#encryption_key;
|
|
113
|
+
#validator;
|
|
114
|
+
#cborEncoder = null;
|
|
115
115
|
constructor({ redisClient, lruCache, snowflakeFactory, options }) {
|
|
116
|
-
this
|
|
117
|
-
this
|
|
118
|
-
this
|
|
119
|
-
this
|
|
120
|
-
this
|
|
121
|
-
this
|
|
122
|
-
if (options.senml_key_map) this
|
|
116
|
+
this.#redisClient = redisClient;
|
|
117
|
+
this.#lruCache = lruCache;
|
|
118
|
+
this.#snowflakeFactory = snowflakeFactory;
|
|
119
|
+
this.#redis_key_revoked = `${REDIS_PREFIX}${options.namespace}:revoked`;
|
|
120
|
+
this.#encryption_key = options.key;
|
|
121
|
+
this.#validator = options.validator;
|
|
122
|
+
if (options.senml_key_map) this.#cborEncoder = new cbor_x.Encoder({ keyMap: options.senml_key_map });
|
|
123
123
|
}
|
|
124
124
|
/**
|
|
125
125
|
* Creates new token.
|
|
@@ -130,16 +130,16 @@ var EcwtFactory = class {
|
|
|
130
130
|
* @returns -
|
|
131
131
|
*/
|
|
132
132
|
async create(data, options = {}) {
|
|
133
|
-
if (typeof this
|
|
133
|
+
if (typeof this.#validator === "function") data = this.#validator(data);
|
|
134
134
|
const ttl = options.ttl ?? null;
|
|
135
|
-
const snowflake = await this
|
|
135
|
+
const snowflake = await this.#snowflakeFactory.createSafe();
|
|
136
136
|
const payload = [
|
|
137
137
|
snowflake.toBuffer(),
|
|
138
138
|
ttl,
|
|
139
139
|
data
|
|
140
140
|
];
|
|
141
|
-
const token_raw = this
|
|
142
|
-
const token_encrypted = await evilcrypt.v2.encrypt(token_raw, this
|
|
141
|
+
const token_raw = this.#cborEncoder ? this.#cborEncoder.encode(payload) : (0, cbor_x.encode)(payload);
|
|
142
|
+
const token_encrypted = await evilcrypt.v2.encrypt(token_raw, this.#encryption_key);
|
|
143
143
|
const token = base62.encode(token_encrypted);
|
|
144
144
|
this.setCache(token, {
|
|
145
145
|
snowflake,
|
|
@@ -160,7 +160,7 @@ var EcwtFactory = class {
|
|
|
160
160
|
*/
|
|
161
161
|
setCache(token, cache_value) {
|
|
162
162
|
var _this$lruCache;
|
|
163
|
-
(_this$lruCache = this
|
|
163
|
+
(_this$lruCache = this.#lruCache) === null || _this$lruCache === void 0 || _this$lruCache.set(token, cache_value, cache_value.ttl_initial === null ? void 0 : { ttl: cache_value.ttl_initial * 1e3 });
|
|
164
164
|
}
|
|
165
165
|
/**
|
|
166
166
|
* Parses token.
|
|
@@ -168,26 +168,26 @@ var EcwtFactory = class {
|
|
|
168
168
|
* @returns -
|
|
169
169
|
*/
|
|
170
170
|
async verify(token) {
|
|
171
|
-
var _this$lruCache2
|
|
171
|
+
var _this$lruCache2;
|
|
172
172
|
if (typeof token !== "string") throw new TypeError("Token must be a string.");
|
|
173
173
|
let snowflake;
|
|
174
174
|
let ttl_initial;
|
|
175
175
|
let data;
|
|
176
|
-
const cached_entry = (_this$lruCache2 = this
|
|
176
|
+
const cached_entry = (_this$lruCache2 = this.#lruCache) === null || _this$lruCache2 === void 0 ? void 0 : _this$lruCache2.info(token);
|
|
177
177
|
if (cached_entry === void 0) {
|
|
178
178
|
const token_encrypted = Buffer.from(base62.decode(token));
|
|
179
179
|
let token_raw;
|
|
180
180
|
try {
|
|
181
|
-
token_raw = await (0, evilcrypt.decrypt)(token_encrypted, this
|
|
181
|
+
token_raw = await (0, evilcrypt.decrypt)(token_encrypted, this.#encryption_key);
|
|
182
182
|
} catch {
|
|
183
183
|
throw new EcwtParseError();
|
|
184
184
|
}
|
|
185
|
-
const payload = this
|
|
185
|
+
const payload = this.#cborEncoder ? this.#cborEncoder.decode(token_raw) : (0, cbor_x.decode)(token_raw);
|
|
186
186
|
const [snowflake_buffer] = payload;
|
|
187
187
|
[, ttl_initial, data] = payload;
|
|
188
|
-
snowflake = this
|
|
189
|
-
if (typeof this
|
|
190
|
-
data = this
|
|
188
|
+
snowflake = this.#snowflakeFactory.parse(snowflake_buffer);
|
|
189
|
+
if (typeof this.#validator === "function") try {
|
|
190
|
+
data = this.#validator(data);
|
|
191
191
|
} catch {
|
|
192
192
|
throw new EcwtParseError();
|
|
193
193
|
}
|
|
@@ -204,7 +204,10 @@ var EcwtFactory = class {
|
|
|
204
204
|
data
|
|
205
205
|
});
|
|
206
206
|
if (typeof ttl_initial === "number" && Number.isNaN(ttl_initial) !== true && snowflake.timestamp + ttl_initial * 1e3 < Date.now()) throw new EcwtExpiredError(ecwt);
|
|
207
|
-
if (
|
|
207
|
+
if (this.#redisClient) {
|
|
208
|
+
await this.#migrateExpired();
|
|
209
|
+
if (await this.#redisClient.HEXISTS(this.#redis_key_revoked, ecwt.id)) throw new EcwtRevokedError(ecwt);
|
|
210
|
+
}
|
|
208
211
|
return ecwt;
|
|
209
212
|
}
|
|
210
213
|
/**
|
|
@@ -234,29 +237,39 @@ var EcwtFactory = class {
|
|
|
234
237
|
}
|
|
235
238
|
/**
|
|
236
239
|
* Revokes token.
|
|
240
|
+
* @internal
|
|
237
241
|
* @param token_id -
|
|
238
|
-
* @param
|
|
242
|
+
* @param created_at_ms -
|
|
239
243
|
* @param ttl_initial -
|
|
240
244
|
* @returns -
|
|
241
245
|
*/
|
|
242
|
-
async _revoke(token_id,
|
|
243
|
-
if (this
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
this.redis_key_revoked,
|
|
249
|
-
|
|
250
|
-
"",
|
|
251
|
-
"PX",
|
|
252
|
-
String(ts_ms_expired - Date.now())
|
|
253
|
-
]);
|
|
246
|
+
async _revoke(token_id, created_at_ms, ttl_initial) {
|
|
247
|
+
if (this.#redisClient) {
|
|
248
|
+
await this.#migrateExpired();
|
|
249
|
+
if (ttl_initial === null) await this.#redisClient.HSET(this.#redis_key_revoked, token_id, "");
|
|
250
|
+
else {
|
|
251
|
+
const expires_in_ms = created_at_ms + ttl_initial * 1e3 - Date.now();
|
|
252
|
+
if (expires_in_ms > 0) await this.#redisClient.MULTI().HSET(this.#redis_key_revoked, token_id, "").HPEXPIRE(this.#redis_key_revoked, token_id, expires_in_ms).EXEC();
|
|
253
|
+
}
|
|
254
254
|
} else console.warn("[ecwt] Redis client is not provided. Tokens cannot be revoked.");
|
|
255
255
|
}
|
|
256
|
-
|
|
256
|
+
#migrated = false;
|
|
257
|
+
async #migrateExpired() {
|
|
258
|
+
if (this.#redisClient && !this.#migrated) {
|
|
259
|
+
await this.#redisClient.EVAL("local key = KEYS[1] if redis.call(\"TYPE\", key)[\"ok\"] ~= \"zset\" then return end local key_hash = key .. \":hash\" local ts_now = tonumber(ARGV[1]) local cursor = \"0\" repeat local scan = redis.call(\"ZSCAN\", key, cursor, \"COUNT\", 1000) cursor = scan[1] local items = scan[2] for i = 1, #items, 2 do local field = items[i] local expire_at = tonumber(items[i + 1]) local expire_in = expire_at and expire_at - ts_now redis.call(\"HSET\", key_hash, field, \"\") if expire_in and expire_in > 0 then redis.call(\"HPEXPIRE\", key_hash, expire_in, \"FIELDS\", 1, field) end end until cursor == \"0\" redis.call(\"DEL\", key) redis.call(\"RENAME\", key_hash, key)", {
|
|
260
|
+
keys: [this.#redis_key_revoked],
|
|
261
|
+
arguments: [String(Date.now())]
|
|
262
|
+
});
|
|
263
|
+
this.#migrated = true;
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
/**
|
|
267
|
+
* @internal
|
|
268
|
+
* Purges LRU cache.
|
|
269
|
+
*/
|
|
257
270
|
_purgeCache() {
|
|
258
271
|
var _this$lruCache3;
|
|
259
|
-
(_this$lruCache3 = this
|
|
272
|
+
(_this$lruCache3 = this.#lruCache) === null || _this$lruCache3 === void 0 || _this$lruCache3.clear();
|
|
260
273
|
}
|
|
261
274
|
};
|
|
262
275
|
//#endregion
|
package/dist/main.d.cts
CHANGED
|
@@ -21,13 +21,7 @@ type EcwtFactoryArguments<D extends Record<string, unknown>> = {
|
|
|
21
21
|
};
|
|
22
22
|
};
|
|
23
23
|
declare class EcwtFactory<const D extends Record<string, unknown> = Record<string, unknown>> {
|
|
24
|
-
private
|
|
25
|
-
private lruCache;
|
|
26
|
-
private snowflakeFactory;
|
|
27
|
-
private redis_key_revoked;
|
|
28
|
-
private encryption_key;
|
|
29
|
-
private validator;
|
|
30
|
-
private cborEncoder;
|
|
24
|
+
#private;
|
|
31
25
|
constructor({
|
|
32
26
|
redisClient,
|
|
33
27
|
lruCache,
|
|
@@ -69,20 +63,11 @@ declare class EcwtFactory<const D extends Record<string, unknown> = Record<strin
|
|
|
69
63
|
success: false;
|
|
70
64
|
ecwt: Ecwt<D> | null;
|
|
71
65
|
}>;
|
|
72
|
-
/**
|
|
73
|
-
* Revokes token.
|
|
74
|
-
* @param token_id -
|
|
75
|
-
* @param ts_ms_created -
|
|
76
|
-
* @param ttl_initial -
|
|
77
|
-
* @returns -
|
|
78
|
-
*/
|
|
79
|
-
private _revoke;
|
|
80
|
-
/** Purges LRU cache. */
|
|
81
|
-
private _purgeCache;
|
|
82
66
|
}
|
|
83
67
|
//#endregion
|
|
84
68
|
//#region src/token.d.ts
|
|
85
69
|
declare class Ecwt<const D extends Record<string, unknown> = Record<string, unknown>> {
|
|
70
|
+
#private;
|
|
86
71
|
/** Token string representation. */
|
|
87
72
|
readonly token: string;
|
|
88
73
|
/** Token ID. */
|
|
@@ -91,8 +76,6 @@ declare class Ecwt<const D extends Record<string, unknown> = Record<string, unkn
|
|
|
91
76
|
readonly snowflake: Snowflake;
|
|
92
77
|
/** Data stored in token. */
|
|
93
78
|
readonly data: Readonly<D>;
|
|
94
|
-
private ecwtFactory;
|
|
95
|
-
private ttl_initial;
|
|
96
79
|
/**
|
|
97
80
|
* @param ecwtFactory -
|
|
98
81
|
* @param options -
|
package/dist/main.d.mts
CHANGED
|
@@ -21,13 +21,7 @@ type EcwtFactoryArguments<D extends Record<string, unknown>> = {
|
|
|
21
21
|
};
|
|
22
22
|
};
|
|
23
23
|
declare class EcwtFactory<const D extends Record<string, unknown> = Record<string, unknown>> {
|
|
24
|
-
private
|
|
25
|
-
private lruCache;
|
|
26
|
-
private snowflakeFactory;
|
|
27
|
-
private redis_key_revoked;
|
|
28
|
-
private encryption_key;
|
|
29
|
-
private validator;
|
|
30
|
-
private cborEncoder;
|
|
24
|
+
#private;
|
|
31
25
|
constructor({
|
|
32
26
|
redisClient,
|
|
33
27
|
lruCache,
|
|
@@ -69,20 +63,11 @@ declare class EcwtFactory<const D extends Record<string, unknown> = Record<strin
|
|
|
69
63
|
success: false;
|
|
70
64
|
ecwt: Ecwt<D> | null;
|
|
71
65
|
}>;
|
|
72
|
-
/**
|
|
73
|
-
* Revokes token.
|
|
74
|
-
* @param token_id -
|
|
75
|
-
* @param ts_ms_created -
|
|
76
|
-
* @param ttl_initial -
|
|
77
|
-
* @returns -
|
|
78
|
-
*/
|
|
79
|
-
private _revoke;
|
|
80
|
-
/** Purges LRU cache. */
|
|
81
|
-
private _purgeCache;
|
|
82
66
|
}
|
|
83
67
|
//#endregion
|
|
84
68
|
//#region src/token.d.ts
|
|
85
69
|
declare class Ecwt<const D extends Record<string, unknown> = Record<string, unknown>> {
|
|
70
|
+
#private;
|
|
86
71
|
/** Token string representation. */
|
|
87
72
|
readonly token: string;
|
|
88
73
|
/** Token ID. */
|
|
@@ -91,8 +76,6 @@ declare class Ecwt<const D extends Record<string, unknown> = Record<string, unkn
|
|
|
91
76
|
readonly snowflake: Snowflake;
|
|
92
77
|
/** Data stored in token. */
|
|
93
78
|
readonly data: Readonly<D>;
|
|
94
|
-
private ecwtFactory;
|
|
95
|
-
private ttl_initial;
|
|
96
79
|
/**
|
|
97
80
|
* @param ecwtFactory -
|
|
98
81
|
* @param options -
|
package/dist/main.mjs
CHANGED
|
@@ -35,8 +35,8 @@ var Ecwt = class {
|
|
|
35
35
|
snowflake;
|
|
36
36
|
/** Data stored in token. */
|
|
37
37
|
data;
|
|
38
|
-
ecwtFactory;
|
|
39
|
-
ttl_initial;
|
|
38
|
+
#ecwtFactory;
|
|
39
|
+
#ttl_initial;
|
|
40
40
|
/**
|
|
41
41
|
* @param ecwtFactory -
|
|
42
42
|
* @param options -
|
|
@@ -50,28 +50,28 @@ var Ecwt = class {
|
|
|
50
50
|
this.id = options.snowflake.toBase62();
|
|
51
51
|
this.snowflake = options.snowflake;
|
|
52
52
|
this.data = Object.freeze(options.data);
|
|
53
|
-
this
|
|
54
|
-
this
|
|
53
|
+
this.#ecwtFactory = ecwtFactory;
|
|
54
|
+
this.#ttl_initial = options.ttl_initial;
|
|
55
55
|
}
|
|
56
56
|
/**
|
|
57
57
|
* Unix timestamp of token expiration in seconds.
|
|
58
58
|
* @returns -
|
|
59
59
|
*/
|
|
60
60
|
get ts_expired() {
|
|
61
|
-
if (this
|
|
62
|
-
return Math.floor(this.snowflake.timestamp / 1e3) + this
|
|
61
|
+
if (this.#ttl_initial === null) return null;
|
|
62
|
+
return Math.floor(this.snowflake.timestamp / 1e3) + this.#ttl_initial;
|
|
63
63
|
}
|
|
64
64
|
/**
|
|
65
65
|
* Actual time to live in seconds.
|
|
66
66
|
* @returns -
|
|
67
67
|
*/
|
|
68
68
|
getTTL() {
|
|
69
|
-
if (this
|
|
70
|
-
return this
|
|
69
|
+
if (this.#ttl_initial === null) return null;
|
|
70
|
+
return this.#ttl_initial - Math.floor((Date.now() - this.snowflake.timestamp) / 1e3);
|
|
71
71
|
}
|
|
72
72
|
/** Revokes token. */
|
|
73
73
|
revoke() {
|
|
74
|
-
return this
|
|
74
|
+
return this.#ecwtFactory._revoke(this.id, this.snowflake.timestamp, this.#ttl_initial);
|
|
75
75
|
}
|
|
76
76
|
};
|
|
77
77
|
//#endregion
|
|
@@ -81,21 +81,21 @@ const base62 = basex("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuv
|
|
|
81
81
|
//#region src/factory.ts
|
|
82
82
|
const REDIS_PREFIX = "@ecwt:";
|
|
83
83
|
var EcwtFactory = class {
|
|
84
|
-
redisClient;
|
|
85
|
-
lruCache;
|
|
86
|
-
snowflakeFactory;
|
|
87
|
-
redis_key_revoked;
|
|
88
|
-
encryption_key;
|
|
89
|
-
validator;
|
|
90
|
-
cborEncoder = null;
|
|
84
|
+
#redisClient;
|
|
85
|
+
#lruCache;
|
|
86
|
+
#snowflakeFactory;
|
|
87
|
+
#redis_key_revoked;
|
|
88
|
+
#encryption_key;
|
|
89
|
+
#validator;
|
|
90
|
+
#cborEncoder = null;
|
|
91
91
|
constructor({ redisClient, lruCache, snowflakeFactory, options }) {
|
|
92
|
-
this
|
|
93
|
-
this
|
|
94
|
-
this
|
|
95
|
-
this
|
|
96
|
-
this
|
|
97
|
-
this
|
|
98
|
-
if (options.senml_key_map) this
|
|
92
|
+
this.#redisClient = redisClient;
|
|
93
|
+
this.#lruCache = lruCache;
|
|
94
|
+
this.#snowflakeFactory = snowflakeFactory;
|
|
95
|
+
this.#redis_key_revoked = `${REDIS_PREFIX}${options.namespace}:revoked`;
|
|
96
|
+
this.#encryption_key = options.key;
|
|
97
|
+
this.#validator = options.validator;
|
|
98
|
+
if (options.senml_key_map) this.#cborEncoder = new Encoder({ keyMap: options.senml_key_map });
|
|
99
99
|
}
|
|
100
100
|
/**
|
|
101
101
|
* Creates new token.
|
|
@@ -106,16 +106,16 @@ var EcwtFactory = class {
|
|
|
106
106
|
* @returns -
|
|
107
107
|
*/
|
|
108
108
|
async create(data, options = {}) {
|
|
109
|
-
if (typeof this
|
|
109
|
+
if (typeof this.#validator === "function") data = this.#validator(data);
|
|
110
110
|
const ttl = options.ttl ?? null;
|
|
111
|
-
const snowflake = await this
|
|
111
|
+
const snowflake = await this.#snowflakeFactory.createSafe();
|
|
112
112
|
const payload = [
|
|
113
113
|
snowflake.toBuffer(),
|
|
114
114
|
ttl,
|
|
115
115
|
data
|
|
116
116
|
];
|
|
117
|
-
const token_raw = this
|
|
118
|
-
const token_encrypted = await v2.encrypt(token_raw, this
|
|
117
|
+
const token_raw = this.#cborEncoder ? this.#cborEncoder.encode(payload) : encode(payload);
|
|
118
|
+
const token_encrypted = await v2.encrypt(token_raw, this.#encryption_key);
|
|
119
119
|
const token = base62.encode(token_encrypted);
|
|
120
120
|
this.setCache(token, {
|
|
121
121
|
snowflake,
|
|
@@ -136,7 +136,7 @@ var EcwtFactory = class {
|
|
|
136
136
|
*/
|
|
137
137
|
setCache(token, cache_value) {
|
|
138
138
|
var _this$lruCache;
|
|
139
|
-
(_this$lruCache = this
|
|
139
|
+
(_this$lruCache = this.#lruCache) === null || _this$lruCache === void 0 || _this$lruCache.set(token, cache_value, cache_value.ttl_initial === null ? void 0 : { ttl: cache_value.ttl_initial * 1e3 });
|
|
140
140
|
}
|
|
141
141
|
/**
|
|
142
142
|
* Parses token.
|
|
@@ -144,26 +144,26 @@ var EcwtFactory = class {
|
|
|
144
144
|
* @returns -
|
|
145
145
|
*/
|
|
146
146
|
async verify(token) {
|
|
147
|
-
var _this$lruCache2
|
|
147
|
+
var _this$lruCache2;
|
|
148
148
|
if (typeof token !== "string") throw new TypeError("Token must be a string.");
|
|
149
149
|
let snowflake;
|
|
150
150
|
let ttl_initial;
|
|
151
151
|
let data;
|
|
152
|
-
const cached_entry = (_this$lruCache2 = this
|
|
152
|
+
const cached_entry = (_this$lruCache2 = this.#lruCache) === null || _this$lruCache2 === void 0 ? void 0 : _this$lruCache2.info(token);
|
|
153
153
|
if (cached_entry === void 0) {
|
|
154
154
|
const token_encrypted = Buffer.from(base62.decode(token));
|
|
155
155
|
let token_raw;
|
|
156
156
|
try {
|
|
157
|
-
token_raw = await decrypt(token_encrypted, this
|
|
157
|
+
token_raw = await decrypt(token_encrypted, this.#encryption_key);
|
|
158
158
|
} catch {
|
|
159
159
|
throw new EcwtParseError();
|
|
160
160
|
}
|
|
161
|
-
const payload = this
|
|
161
|
+
const payload = this.#cborEncoder ? this.#cborEncoder.decode(token_raw) : decode(token_raw);
|
|
162
162
|
const [snowflake_buffer] = payload;
|
|
163
163
|
[, ttl_initial, data] = payload;
|
|
164
|
-
snowflake = this
|
|
165
|
-
if (typeof this
|
|
166
|
-
data = this
|
|
164
|
+
snowflake = this.#snowflakeFactory.parse(snowflake_buffer);
|
|
165
|
+
if (typeof this.#validator === "function") try {
|
|
166
|
+
data = this.#validator(data);
|
|
167
167
|
} catch {
|
|
168
168
|
throw new EcwtParseError();
|
|
169
169
|
}
|
|
@@ -180,7 +180,10 @@ var EcwtFactory = class {
|
|
|
180
180
|
data
|
|
181
181
|
});
|
|
182
182
|
if (typeof ttl_initial === "number" && Number.isNaN(ttl_initial) !== true && snowflake.timestamp + ttl_initial * 1e3 < Date.now()) throw new EcwtExpiredError(ecwt);
|
|
183
|
-
if (
|
|
183
|
+
if (this.#redisClient) {
|
|
184
|
+
await this.#migrateExpired();
|
|
185
|
+
if (await this.#redisClient.HEXISTS(this.#redis_key_revoked, ecwt.id)) throw new EcwtRevokedError(ecwt);
|
|
186
|
+
}
|
|
184
187
|
return ecwt;
|
|
185
188
|
}
|
|
186
189
|
/**
|
|
@@ -210,29 +213,39 @@ var EcwtFactory = class {
|
|
|
210
213
|
}
|
|
211
214
|
/**
|
|
212
215
|
* Revokes token.
|
|
216
|
+
* @internal
|
|
213
217
|
* @param token_id -
|
|
214
|
-
* @param
|
|
218
|
+
* @param created_at_ms -
|
|
215
219
|
* @param ttl_initial -
|
|
216
220
|
* @returns -
|
|
217
221
|
*/
|
|
218
|
-
async _revoke(token_id,
|
|
219
|
-
if (this
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
this.redis_key_revoked,
|
|
225
|
-
|
|
226
|
-
"",
|
|
227
|
-
"PX",
|
|
228
|
-
String(ts_ms_expired - Date.now())
|
|
229
|
-
]);
|
|
222
|
+
async _revoke(token_id, created_at_ms, ttl_initial) {
|
|
223
|
+
if (this.#redisClient) {
|
|
224
|
+
await this.#migrateExpired();
|
|
225
|
+
if (ttl_initial === null) await this.#redisClient.HSET(this.#redis_key_revoked, token_id, "");
|
|
226
|
+
else {
|
|
227
|
+
const expires_in_ms = created_at_ms + ttl_initial * 1e3 - Date.now();
|
|
228
|
+
if (expires_in_ms > 0) await this.#redisClient.MULTI().HSET(this.#redis_key_revoked, token_id, "").HPEXPIRE(this.#redis_key_revoked, token_id, expires_in_ms).EXEC();
|
|
229
|
+
}
|
|
230
230
|
} else console.warn("[ecwt] Redis client is not provided. Tokens cannot be revoked.");
|
|
231
231
|
}
|
|
232
|
-
|
|
232
|
+
#migrated = false;
|
|
233
|
+
async #migrateExpired() {
|
|
234
|
+
if (this.#redisClient && !this.#migrated) {
|
|
235
|
+
await this.#redisClient.EVAL("local key = KEYS[1] if redis.call(\"TYPE\", key)[\"ok\"] ~= \"zset\" then return end local key_hash = key .. \":hash\" local ts_now = tonumber(ARGV[1]) local cursor = \"0\" repeat local scan = redis.call(\"ZSCAN\", key, cursor, \"COUNT\", 1000) cursor = scan[1] local items = scan[2] for i = 1, #items, 2 do local field = items[i] local expire_at = tonumber(items[i + 1]) local expire_in = expire_at and expire_at - ts_now redis.call(\"HSET\", key_hash, field, \"\") if expire_in and expire_in > 0 then redis.call(\"HPEXPIRE\", key_hash, expire_in, \"FIELDS\", 1, field) end end until cursor == \"0\" redis.call(\"DEL\", key) redis.call(\"RENAME\", key_hash, key)", {
|
|
236
|
+
keys: [this.#redis_key_revoked],
|
|
237
|
+
arguments: [String(Date.now())]
|
|
238
|
+
});
|
|
239
|
+
this.#migrated = true;
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* @internal
|
|
244
|
+
* Purges LRU cache.
|
|
245
|
+
*/
|
|
233
246
|
_purgeCache() {
|
|
234
247
|
var _this$lruCache3;
|
|
235
|
-
(_this$lruCache3 = this
|
|
248
|
+
(_this$lruCache3 = this.#lruCache) === null || _this$lruCache3 === void 0 || _this$lruCache3.clear();
|
|
236
249
|
}
|
|
237
250
|
};
|
|
238
251
|
//#endregion
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ecwt",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.2",
|
|
4
4
|
"description": "Encrypted CBOR Web Token",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"typescript": "6.0.2",
|
|
43
43
|
"unplugin-unused": "0.5.7",
|
|
44
44
|
"valibot": "1.4.0",
|
|
45
|
-
"vitest": "4.1.
|
|
45
|
+
"vitest": "4.1.7"
|
|
46
46
|
},
|
|
47
47
|
"scripts": {
|
|
48
48
|
"build": "tsdown src/main.ts --format esm --format cjs --dts --publint --unused",
|