diff --git a/package-lock.json b/package-lock.json index b05c7e3..9d4a3e2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -43,7 +43,7 @@ "nodemon": "^3.1.4", "prettier": "^3.0.0", "typescript": "^5.1.6", - "vitest": "^1.2.2" + "vitest": "^1.4.0" }, "engines": { "node": ">=20.0.0", @@ -587,9 +587,9 @@ } }, "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.4.15", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", - "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz", + "integrity": "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==", "dev": true }, "node_modules/@jsdevtools/ono": { @@ -633,9 +633,9 @@ } }, "node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.18.0.tgz", - "integrity": "sha512-Tya6xypR10giZV1XzxmH5wr25VcZSncG0pZIjfePT0OVBvqNEurzValetGNarVrGiq66EBVAFn15iYX4w6FKgQ==", + "version": "4.27.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.27.2.tgz", + "integrity": "sha512-Tj+j7Pyzd15wAdSJswvs5CJzJNV+qqSUcr/aCD+jpQSBtXvGnV0pnrjoc8zFTe9fcKCatkpFpOO7yAzpO998HA==", "cpu": [ "arm" ], @@ -646,9 +646,9 @@ ] }, "node_modules/@rollup/rollup-android-arm64": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.18.0.tgz", - "integrity": "sha512-avCea0RAP03lTsDhEyfy+hpfr85KfyTctMADqHVhLAF3MlIkq83CP8UfAHUssgXTYd+6er6PaAhx/QGv4L1EiA==", + "version": "4.27.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.27.2.tgz", + "integrity": "sha512-xsPeJgh2ThBpUqlLgRfiVYBEf/P1nWlWvReG+aBWfNv3XEBpa6ZCmxSVnxJgLgkNz4IbxpLy64h2gCmAAQLneQ==", "cpu": [ "arm64" ], @@ -659,9 +659,9 @@ ] }, "node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.18.0.tgz", - "integrity": "sha512-IWfdwU7KDSm07Ty0PuA/W2JYoZ4iTj3TUQjkVsO/6U+4I1jN5lcR71ZEvRh52sDOERdnNhhHU57UITXz5jC1/w==", + "version": "4.27.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.27.2.tgz", + "integrity": "sha512-KnXU4m9MywuZFedL35Z3PuwiTSn/yqRIhrEA9j+7OSkji39NzVkgxuxTYg5F8ryGysq4iFADaU5osSizMXhU2A==", "cpu": [ "arm64" ], @@ -672,9 +672,9 @@ ] }, "node_modules/@rollup/rollup-darwin-x64": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.18.0.tgz", - "integrity": "sha512-n2LMsUz7Ynu7DoQrSQkBf8iNrjOGyPLrdSg802vk6XT3FtsgX6JbE8IHRvposskFm9SNxzkLYGSq9QdpLYpRNA==", + "version": "4.27.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.27.2.tgz", + "integrity": "sha512-Hj77A3yTvUeCIx/Vi+4d4IbYhyTwtHj07lVzUgpUq9YpJSEiGJj4vXMKwzJ3w5zp5v3PFvpJNgc/J31smZey6g==", "cpu": [ "x64" ], @@ -684,10 +684,36 @@ "darwin" ] }, + "node_modules/@rollup/rollup-freebsd-arm64": { + "version": "4.27.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.27.2.tgz", + "integrity": "sha512-RjgKf5C3xbn8gxvCm5VgKZ4nn0pRAIe90J0/fdHUsgztd3+Zesb2lm2+r6uX4prV2eUByuxJNdt647/1KPRq5g==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-freebsd-x64": { + "version": "4.27.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.27.2.tgz", + "integrity": "sha512-duq21FoXwQtuws+V9H6UZ+eCBc7fxSpMK1GQINKn3fAyd9DFYKPJNcUhdIKOrMFjLEJgQskoMoiuizMt+dl20g==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ] + }, "node_modules/@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.18.0.tgz", - "integrity": "sha512-C/zbRYRXFjWvz9Z4haRxcTdnkPt1BtCkz+7RtBSuNmKzMzp3ZxdM28Mpccn6pt28/UWUCTXa+b0Mx1k3g6NOMA==", + "version": "4.27.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.27.2.tgz", + "integrity": "sha512-6npqOKEPRZkLrMcvyC/32OzJ2srdPzCylJjiTJT2c0bwwSGm7nz2F9mNQ1WrAqCBZROcQn91Fno+khFhVijmFA==", "cpu": [ "arm" ], @@ -698,9 +724,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm-musleabihf": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.18.0.tgz", - "integrity": "sha512-l3m9ewPgjQSXrUMHg93vt0hYCGnrMOcUpTz6FLtbwljo2HluS4zTXFy2571YQbisTnfTKPZ01u/ukJdQTLGh9A==", + "version": "4.27.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.27.2.tgz", + "integrity": "sha512-V9Xg6eXtgBtHq2jnuQwM/jr2mwe2EycnopO8cbOvpzFuySCGtKlPCI3Hj9xup/pJK5Q0388qfZZy2DqV2J8ftw==", "cpu": [ "arm" ], @@ -711,9 +737,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.18.0.tgz", - "integrity": "sha512-rJ5D47d8WD7J+7STKdCUAgmQk49xuFrRi9pZkWoRD1UeSMakbcepWXPF8ycChBoAqs1pb2wzvbY6Q33WmN2ftw==", + "version": "4.27.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.27.2.tgz", + "integrity": "sha512-uCFX9gtZJoQl2xDTpRdseYuNqyKkuMDtH6zSrBTA28yTfKyjN9hQ2B04N5ynR8ILCoSDOrG/Eg+J2TtJ1e/CSA==", "cpu": [ "arm64" ], @@ -724,9 +750,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-musl": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.18.0.tgz", - "integrity": "sha512-be6Yx37b24ZwxQ+wOQXXLZqpq4jTckJhtGlWGZs68TgdKXJgw54lUUoFYrg6Zs/kjzAQwEwYbp8JxZVzZLRepQ==", + "version": "4.27.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.27.2.tgz", + "integrity": "sha512-/PU9P+7Rkz8JFYDHIi+xzHabOu9qEWR07L5nWLIUsvserrxegZExKCi2jhMZRd0ATdboKylu/K5yAXbp7fYFvA==", "cpu": [ "arm64" ], @@ -737,9 +763,9 @@ ] }, "node_modules/@rollup/rollup-linux-powerpc64le-gnu": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.18.0.tgz", - "integrity": "sha512-hNVMQK+qrA9Todu9+wqrXOHxFiD5YmdEi3paj6vP02Kx1hjd2LLYR2eaN7DsEshg09+9uzWi2W18MJDlG0cxJA==", + "version": "4.27.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.27.2.tgz", + "integrity": "sha512-eCHmol/dT5odMYi/N0R0HC8V8QE40rEpkyje/ZAXJYNNoSfrObOvG/Mn+s1F/FJyB7co7UQZZf6FuWnN6a7f4g==", "cpu": [ "ppc64" ], @@ -750,9 +776,9 @@ ] }, "node_modules/@rollup/rollup-linux-riscv64-gnu": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.18.0.tgz", - "integrity": "sha512-ROCM7i+m1NfdrsmvwSzoxp9HFtmKGHEqu5NNDiZWQtXLA8S5HBCkVvKAxJ8U+CVctHwV2Gb5VUaK7UAkzhDjlg==", + "version": "4.27.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.27.2.tgz", + "integrity": "sha512-DEP3Njr9/ADDln3kNi76PXonLMSSMiCir0VHXxmGSHxCxDfQ70oWjHcJGfiBugzaqmYdTC7Y+8Int6qbnxPBIQ==", "cpu": [ "riscv64" ], @@ -763,9 +789,9 @@ ] }, "node_modules/@rollup/rollup-linux-s390x-gnu": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.18.0.tgz", - "integrity": "sha512-0UyyRHyDN42QL+NbqevXIIUnKA47A+45WyasO+y2bGJ1mhQrfrtXUpTxCOrfxCR4esV3/RLYyucGVPiUsO8xjg==", + "version": "4.27.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.27.2.tgz", + "integrity": "sha512-NHGo5i6IE/PtEPh5m0yw5OmPMpesFnzMIS/lzvN5vknnC1sXM5Z/id5VgcNPgpD+wHmIcuYYgW+Q53v+9s96lQ==", "cpu": [ "s390x" ], @@ -776,9 +802,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.18.0.tgz", - "integrity": "sha512-xuglR2rBVHA5UsI8h8UbX4VJ470PtGCf5Vpswh7p2ukaqBGFTnsfzxUBetoWBWymHMxbIG0Cmx7Y9qDZzr648w==", + "version": "4.27.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.27.2.tgz", + "integrity": "sha512-PaW2DY5Tan+IFvNJGHDmUrORadbe/Ceh8tQxi8cmdQVCCYsLoQo2cuaSj+AU+YRX8M4ivS2vJ9UGaxfuNN7gmg==", "cpu": [ "x64" ], @@ -789,9 +815,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-musl": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.18.0.tgz", - "integrity": "sha512-LKaqQL9osY/ir2geuLVvRRs+utWUNilzdE90TpyoX0eNqPzWjRm14oMEE+YLve4k/NAqCdPkGYDaDF5Sw+xBfg==", + "version": "4.27.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.27.2.tgz", + "integrity": "sha512-dOlWEMg2gI91Qx5I/HYqOD6iqlJspxLcS4Zlg3vjk1srE67z5T2Uz91yg/qA8sY0XcwQrFzWWiZhMNERylLrpQ==", "cpu": [ "x64" ], @@ -802,9 +828,9 @@ ] }, "node_modules/@rollup/rollup-win32-arm64-msvc": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.18.0.tgz", - "integrity": "sha512-7J6TkZQFGo9qBKH0pk2cEVSRhJbL6MtfWxth7Y5YmZs57Pi+4x6c2dStAUvaQkHQLnEQv1jzBUW43GvZW8OFqA==", + "version": "4.27.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.27.2.tgz", + "integrity": "sha512-euMIv/4x5Y2/ImlbGl88mwKNXDsvzbWUlT7DFky76z2keajCtcbAsN9LUdmk31hAoVmJJYSThgdA0EsPeTr1+w==", "cpu": [ "arm64" ], @@ -815,9 +841,9 @@ ] }, "node_modules/@rollup/rollup-win32-ia32-msvc": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.18.0.tgz", - "integrity": "sha512-Txjh+IxBPbkUB9+SXZMpv+b/vnTEtFyfWZgJ6iyCmt2tdx0OF5WhFowLmnh8ENGNpfUlUZkdI//4IEmhwPieNg==", + "version": "4.27.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.27.2.tgz", + "integrity": "sha512-RsnE6LQkUHlkC10RKngtHNLxb7scFykEbEwOFDjr3CeCMG+Rr+cKqlkKc2/wJ1u4u990urRHCbjz31x84PBrSQ==", "cpu": [ "ia32" ], @@ -828,9 +854,9 @@ ] }, "node_modules/@rollup/rollup-win32-x64-msvc": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.18.0.tgz", - "integrity": "sha512-UOo5FdvOL0+eIVTgS4tIdbW+TtnBLWg1YBCcU2KWM7nuNwRz9bksDX1bekJJCpu25N1DVWaCwnT39dVQxzqS8g==", + "version": "4.27.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.27.2.tgz", + "integrity": "sha512-foJM5vv+z2KQmn7emYdDLyTbkoO5bkHZE1oth2tWbQNGW7mX32d46Hz6T0MqXdWS2vBZhaEtHqdy9WYwGfiliA==", "cpu": [ "x64" ], @@ -889,9 +915,9 @@ } }, "node_modules/@types/estree": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz", - "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.6.tgz", + "integrity": "sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==", "dev": true }, "node_modules/@types/express": { @@ -1219,13 +1245,13 @@ } }, "node_modules/@vitest/expect": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-1.2.2.tgz", - "integrity": "sha512-3jpcdPAD7LwHUUiT2pZTj2U82I2Tcgg2oVPvKxhn6mDI2On6tfvPQTjAI4628GUGDZrCm4Zna9iQHm5cEexOAg==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-1.6.0.tgz", + "integrity": "sha512-ixEvFVQjycy/oNgHjqsL6AZCDduC+tflRluaHIzKIsdbzkLn2U/iBnVeJwB6HsIjQBdfMR8Z0tRxKUsvFJEeWQ==", "dev": true, "dependencies": { - "@vitest/spy": "1.2.2", - "@vitest/utils": "1.2.2", + "@vitest/spy": "1.6.0", + "@vitest/utils": "1.6.0", "chai": "^4.3.10" }, "funding": { @@ -1233,12 +1259,12 @@ } }, "node_modules/@vitest/runner": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-1.2.2.tgz", - "integrity": "sha512-JctG7QZ4LSDXr5CsUweFgcpEvrcxOV1Gft7uHrvkQ+fsAVylmWQvnaAr/HDp3LAH1fztGMQZugIheTWjaGzYIg==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-1.6.0.tgz", + "integrity": "sha512-P4xgwPjwesuBiHisAVz/LSSZtDjOTPYZVmNAnpHHSR6ONrf8eCJOFRvUwdHn30F5M1fxhqtl7QZQUk2dprIXAg==", "dev": true, "dependencies": { - "@vitest/utils": "1.2.2", + "@vitest/utils": "1.6.0", "p-limit": "^5.0.0", "pathe": "^1.1.1" }, @@ -1262,9 +1288,9 @@ } }, "node_modules/@vitest/runner/node_modules/yocto-queue": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.0.0.tgz", - "integrity": "sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.1.1.tgz", + "integrity": "sha512-b4JR1PFR10y1mKjhHY9LaGo6tmrgjit7hxVIeAmyMw3jegXR4dhYqLaQF5zMXZxY7tLpMyJeLjr1C4rLmkVe8g==", "dev": true, "engines": { "node": ">=12.20" @@ -1274,9 +1300,9 @@ } }, "node_modules/@vitest/snapshot": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-1.2.2.tgz", - "integrity": "sha512-SmGY4saEw1+bwE1th6S/cZmPxz/Q4JWsl7LvbQIky2tKE35US4gd0Mjzqfr84/4OD0tikGWaWdMja/nWL5NIPA==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-1.6.0.tgz", + "integrity": "sha512-+Hx43f8Chus+DCmygqqfetcAZrDJwvTj0ymqjQq4CvmpKFSTVteEOBzCusu1x2tt4OJcvBflyHUE0DZSLgEMtQ==", "dev": true, "dependencies": { "magic-string": "^0.30.5", @@ -1288,9 +1314,9 @@ } }, "node_modules/@vitest/spy": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-1.2.2.tgz", - "integrity": "sha512-k9Gcahssw8d7X3pSLq3e3XEu/0L78mUkCjivUqCQeXJm9clfXR/Td8+AP+VC1O6fKPIDLcHDTAmBOINVuv6+7g==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-1.6.0.tgz", + "integrity": "sha512-leUTap6B/cqi/bQkXUu6bQV5TZPx7pmMBKBQiI0rJA8c3pB56ZsaTbREnF7CJfmvAS4V2cXIBAh/3rVwrrCYgw==", "dev": true, "dependencies": { "tinyspy": "^2.2.0" @@ -1300,9 +1326,9 @@ } }, "node_modules/@vitest/utils": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-1.2.2.tgz", - "integrity": "sha512-WKITBHLsBHlpjnDQahr+XK6RE7MiAsgrIkr0pGhQ9ygoxBfUeG0lUG5iLlzqjmKSlBv3+j5EGsriBzh+C3Tq9g==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-1.6.0.tgz", + "integrity": "sha512-21cPiuGMoMZwiOHa2i4LXkMkMkCGzA+MVFV70jRwHo95dL4x/ts5GZhML1QWuy7yfp3WzK3lRvZi3JnXTYqrBw==", "dev": true, "dependencies": { "diff-sequences": "^29.6.3", @@ -1628,9 +1654,9 @@ } }, "node_modules/chai": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/chai/-/chai-4.4.1.tgz", - "integrity": "sha512-13sOfMv2+DWduEU+/xbun3LScLoqN17nBeTLUsmDfKdoiC1fr0n9PU4guu4AhRcOVFk/sW8LyZWHuhWtQZiF+g==", + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/chai/-/chai-4.5.0.tgz", + "integrity": "sha512-RITGBfijLkBddZvnn8jdqoTypxvqbOLYQkGGxXzeFjVHvudaPw0HNFD9x928/eUwYWd2dPCugVqspGALTZZQKw==", "dev": true, "dependencies": { "assertion-error": "^1.1.0", @@ -1639,7 +1665,7 @@ "get-func-name": "^2.0.2", "loupe": "^2.3.6", "pathval": "^1.1.1", - "type-detect": "^4.0.8" + "type-detect": "^4.1.0" }, "engines": { "node": ">=4" @@ -1905,9 +1931,9 @@ } }, "node_modules/deep-eql": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-4.1.3.tgz", - "integrity": "sha512-WaEtAOpRA1MQ0eohqZjpGD8zdI0Ovsm8mmFhaDN8dvDZzyoUMcYDnf5Y6iu7HTXxf8JDS23qWa4a+hKCDyOPzw==", + "version": "4.1.4", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-4.1.4.tgz", + "integrity": "sha512-SUwdGfqdKOwxCPeVYjwSyRpJ7Z+fhpwIAtmCUdZIWZ/YP5R9WAsyuSgpLVDi9bjWoN2LXHNss/dk3urXtdQxGg==", "dev": true, "dependencies": { "type-detect": "^4.0.0" @@ -2999,6 +3025,12 @@ "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", "dev": true }, + "node_modules/js-tokens": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-9.0.0.tgz", + "integrity": "sha512-WriZw1luRMlmV3LGJaR6QOJjWwgLUTf89OwT2lUOyjX2dJGBwgmIkbcz+7WFZjrZM635JOIR517++e/67CP9dQ==", + "dev": true + }, "node_modules/js-yaml": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", @@ -3171,15 +3203,12 @@ } }, "node_modules/magic-string": { - "version": "0.30.7", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.7.tgz", - "integrity": "sha512-8vBuFF/I/+OSLRmdf2wwFCJCz+nSn0m6DPvGH1fS/KiQoSaR+sETbov0eIk9KhEKy8CYqIkIAnbohxT/4H0kuA==", + "version": "0.30.12", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.12.tgz", + "integrity": "sha512-Ea8I3sQMVXr8JhN4z+H/d8zwo+tYDgHE9+5G4Wnrwhs0gaK9fXTKx0Tw5Xwsd/bCPTTZNRAdpyzvoeORe9LYpw==", "dev": true, "dependencies": { - "@jridgewell/sourcemap-codec": "^1.4.15" - }, - "engines": { - "node": ">=12" + "@jridgewell/sourcemap-codec": "^1.5.0" } }, "node_modules/media-typer": { @@ -3837,9 +3866,9 @@ } }, "node_modules/picocolors": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", - "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", "dev": true }, "node_modules/picomatch": { @@ -3866,9 +3895,9 @@ } }, "node_modules/postcss": { - "version": "8.4.38", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.38.tgz", - "integrity": "sha512-Wglpdk03BSfXkHoQa3b/oulrotAkwrlLDRSOb9D0bN86FdRyE9lppSp33aHNPgBa0JKCoB+drFLZkQoRRYae5A==", + "version": "8.4.49", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.49.tgz", + "integrity": "sha512-OCVPnIObs4N29kxTjzLfUryOkvZEq+pf8jTF0lg8E7uETuWHA+v7j3c/xJmiqpX450191LlmZfUKkXxkTry7nA==", "dev": true, "funding": [ { @@ -3886,8 +3915,8 @@ ], "dependencies": { "nanoid": "^3.3.7", - "picocolors": "^1.0.0", - "source-map-js": "^1.2.0" + "picocolors": "^1.1.1", + "source-map-js": "^1.2.1" }, "engines": { "node": "^10 || ^12 || >=14" @@ -4095,9 +4124,9 @@ } }, "node_modules/react-is": { - "version": "18.2.0", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.2.0.tgz", - "integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==", + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", + "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", "dev": true }, "node_modules/readable-stream": { @@ -4166,12 +4195,12 @@ } }, "node_modules/rollup": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.18.0.tgz", - "integrity": "sha512-QmJz14PX3rzbJCN1SG4Xe/bAAX2a6NpCP8ab2vfu2GiUr8AQcr2nCV/oEO3yneFarB67zk8ShlIyWb2LGTb3Sg==", + "version": "4.27.2", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.27.2.tgz", + "integrity": "sha512-KreA+PzWmk2yaFmZVwe6GB2uBD86nXl86OsDkt1bJS9p3vqWuEQ6HnJJ+j/mZi/q0920P99/MVRlB4L3crpF5w==", "dev": true, "dependencies": { - "@types/estree": "1.0.5" + "@types/estree": "1.0.6" }, "bin": { "rollup": "dist/bin/rollup" @@ -4181,22 +4210,24 @@ "npm": ">=8.0.0" }, "optionalDependencies": { - "@rollup/rollup-android-arm-eabi": "4.18.0", - "@rollup/rollup-android-arm64": "4.18.0", - "@rollup/rollup-darwin-arm64": "4.18.0", - "@rollup/rollup-darwin-x64": "4.18.0", - "@rollup/rollup-linux-arm-gnueabihf": "4.18.0", - "@rollup/rollup-linux-arm-musleabihf": "4.18.0", - "@rollup/rollup-linux-arm64-gnu": "4.18.0", - "@rollup/rollup-linux-arm64-musl": "4.18.0", - "@rollup/rollup-linux-powerpc64le-gnu": "4.18.0", - "@rollup/rollup-linux-riscv64-gnu": "4.18.0", - "@rollup/rollup-linux-s390x-gnu": "4.18.0", - "@rollup/rollup-linux-x64-gnu": "4.18.0", - "@rollup/rollup-linux-x64-musl": "4.18.0", - "@rollup/rollup-win32-arm64-msvc": "4.18.0", - "@rollup/rollup-win32-ia32-msvc": "4.18.0", - "@rollup/rollup-win32-x64-msvc": "4.18.0", + "@rollup/rollup-android-arm-eabi": "4.27.2", + "@rollup/rollup-android-arm64": "4.27.2", + "@rollup/rollup-darwin-arm64": "4.27.2", + "@rollup/rollup-darwin-x64": "4.27.2", + "@rollup/rollup-freebsd-arm64": "4.27.2", + "@rollup/rollup-freebsd-x64": "4.27.2", + "@rollup/rollup-linux-arm-gnueabihf": "4.27.2", + "@rollup/rollup-linux-arm-musleabihf": "4.27.2", + "@rollup/rollup-linux-arm64-gnu": "4.27.2", + "@rollup/rollup-linux-arm64-musl": "4.27.2", + "@rollup/rollup-linux-powerpc64le-gnu": "4.27.2", + "@rollup/rollup-linux-riscv64-gnu": "4.27.2", + "@rollup/rollup-linux-s390x-gnu": "4.27.2", + "@rollup/rollup-linux-x64-gnu": "4.27.2", + "@rollup/rollup-linux-x64-musl": "4.27.2", + "@rollup/rollup-win32-arm64-msvc": "4.27.2", + "@rollup/rollup-win32-ia32-msvc": "4.27.2", + "@rollup/rollup-win32-x64-msvc": "4.27.2", "fsevents": "~2.3.2" } }, @@ -4431,9 +4462,9 @@ } }, "node_modules/source-map-js": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.0.tgz", - "integrity": "sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", + "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", "dev": true, "engines": { "node": ">=0.10.0" @@ -4533,12 +4564,12 @@ } }, "node_modules/strip-literal": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/strip-literal/-/strip-literal-1.3.0.tgz", - "integrity": "sha512-PugKzOsyXpArk0yWmUwqOZecSO0GH0bPoctLcqNDH9J04pVW3lflYE0ujElBGTloevcxF5MofAOZ7C5l2b+wLg==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/strip-literal/-/strip-literal-2.1.0.tgz", + "integrity": "sha512-Op+UycaUt/8FbN/Z2TWPBLge3jWrP3xj10f3fnYxf052bKuS3EKs1ZQcVGjnEMdsNVAM+plXRdmjrZ/KgG3Skw==", "dev": true, "dependencies": { - "acorn": "^8.10.0" + "js-tokens": "^9.0.0" }, "funding": { "url": "https://github.com/sponsors/antfu" @@ -4638,18 +4669,18 @@ "dev": true }, "node_modules/tinypool": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-0.8.2.tgz", - "integrity": "sha512-SUszKYe5wgsxnNOVlBYO6IC+8VGWdVGZWAqUxp3UErNBtptZvWbwyUOyzNL59zigz2rCA92QiL3wvG+JDSdJdQ==", + "version": "0.8.4", + "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-0.8.4.tgz", + "integrity": "sha512-i11VH5gS6IFeLY3gMBQ00/MmLncVP7JLXOw1vlgkytLmJK7QnEr7NXf0LBdxfmNPAeyetukOk0bOYrJrFGjYJQ==", "dev": true, "engines": { "node": ">=14.0.0" } }, "node_modules/tinyspy": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-2.2.0.tgz", - "integrity": "sha512-d2eda04AN/cPOR89F7Xv5bK/jrQEhmcLFe6HFldoeO9AJtps+fqEnh486vnT/8y4bw38pSyxDcTCAq+Ks2aJTg==", + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-2.2.1.tgz", + "integrity": "sha512-KYad6Vy5VDWV4GH3fjpseMQ/XU2BhIYP7Vzd0LG44qRWm/Yt2WCOTicFdvmgo6gWaqooMQCawTtILVQJupKu7A==", "dev": true, "engines": { "node": ">=14.0.0" @@ -4723,9 +4754,9 @@ } }, "node_modules/type-detect": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", - "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.1.0.tgz", + "integrity": "sha512-Acylog8/luQ8L7il+geoSxhEkazvkslg7PSNKOX59mbB9cOveP5aq9h74Y7YU8yDpJwetzQQrfIwtf4Wp4LKcw==", "dev": true, "engines": { "node": ">=4" @@ -4832,14 +4863,14 @@ } }, "node_modules/vite": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/vite/-/vite-5.3.1.tgz", - "integrity": "sha512-XBmSKRLXLxiaPYamLv3/hnP/KXDai1NDexN0FpkTaZXTfycHvkRHoenpgl/fvuK/kPbB6xAgoyiryAhQNxYmAQ==", + "version": "5.4.11", + "resolved": "https://registry.npmjs.org/vite/-/vite-5.4.11.tgz", + "integrity": "sha512-c7jFQRklXua0mTzneGW9QVyxFjUgwcihC4bXEtujIo2ouWCe1Ajt/amn2PCxYnhYfd5k09JX3SB7OYWFKYqj8Q==", "dev": true, "dependencies": { "esbuild": "^0.21.3", - "postcss": "^8.4.38", - "rollup": "^4.13.0" + "postcss": "^8.4.43", + "rollup": "^4.20.0" }, "bin": { "vite": "bin/vite.js" @@ -4858,6 +4889,7 @@ "less": "*", "lightningcss": "^1.21.0", "sass": "*", + "sass-embedded": "*", "stylus": "*", "sugarss": "*", "terser": "^5.4.0" @@ -4875,6 +4907,9 @@ "sass": { "optional": true }, + "sass-embedded": { + "optional": true + }, "stylus": { "optional": true }, @@ -4887,9 +4922,9 @@ } }, "node_modules/vite-node": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-1.2.2.tgz", - "integrity": "sha512-1as4rDTgVWJO3n1uHmUYqq7nsFgINQ9u+mRcXpjeOMJUmviqNKjcZB7UfRZrlM7MjYXMKpuWp5oGkjaFLnjawg==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-1.6.0.tgz", + "integrity": "sha512-de6HJgzC+TFzOu0NTC4RAIsyf/DY/ibWDYQUcuEA84EMHhcefTUGkjFHKKEJhQN4A+6I0u++kr3l36ZF2d7XRw==", "dev": true, "dependencies": { "cac": "^6.7.14", @@ -4909,18 +4944,17 @@ } }, "node_modules/vitest": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/vitest/-/vitest-1.2.2.tgz", - "integrity": "sha512-d5Ouvrnms3GD9USIK36KG8OZ5bEvKEkITFtnGv56HFaSlbItJuYr7hv2Lkn903+AvRAgSixiamozUVfORUekjw==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-1.6.0.tgz", + "integrity": "sha512-H5r/dN06swuFnzNFhq/dnz37bPXnq8xB2xB5JOVk8K09rUtoeNN+LHWkoQ0A/i3hvbUKKcCei9KpbxqHMLhLLA==", "dev": true, "dependencies": { - "@vitest/expect": "1.2.2", - "@vitest/runner": "1.2.2", - "@vitest/snapshot": "1.2.2", - "@vitest/spy": "1.2.2", - "@vitest/utils": "1.2.2", + "@vitest/expect": "1.6.0", + "@vitest/runner": "1.6.0", + "@vitest/snapshot": "1.6.0", + "@vitest/spy": "1.6.0", + "@vitest/utils": "1.6.0", "acorn-walk": "^8.3.2", - "cac": "^6.7.14", "chai": "^4.3.10", "debug": "^4.3.4", "execa": "^8.0.1", @@ -4929,11 +4963,11 @@ "pathe": "^1.1.1", "picocolors": "^1.0.0", "std-env": "^3.5.0", - "strip-literal": "^1.3.0", + "strip-literal": "^2.0.0", "tinybench": "^2.5.1", - "tinypool": "^0.8.2", + "tinypool": "^0.8.3", "vite": "^5.0.0", - "vite-node": "1.2.2", + "vite-node": "1.6.0", "why-is-node-running": "^2.2.2" }, "bin": { @@ -4948,8 +4982,8 @@ "peerDependencies": { "@edge-runtime/vm": "*", "@types/node": "^18.0.0 || >=20.0.0", - "@vitest/browser": "^1.0.0", - "@vitest/ui": "^1.0.0", + "@vitest/browser": "1.6.0", + "@vitest/ui": "1.6.0", "happy-dom": "*", "jsdom": "*" }, @@ -5419,9 +5453,9 @@ } }, "@jridgewell/sourcemap-codec": { - "version": "1.4.15", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", - "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz", + "integrity": "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==", "dev": true }, "@jsdevtools/ono": { @@ -5456,114 +5490,128 @@ } }, "@rollup/rollup-android-arm-eabi": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.18.0.tgz", - "integrity": "sha512-Tya6xypR10giZV1XzxmH5wr25VcZSncG0pZIjfePT0OVBvqNEurzValetGNarVrGiq66EBVAFn15iYX4w6FKgQ==", + "version": "4.27.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.27.2.tgz", + "integrity": "sha512-Tj+j7Pyzd15wAdSJswvs5CJzJNV+qqSUcr/aCD+jpQSBtXvGnV0pnrjoc8zFTe9fcKCatkpFpOO7yAzpO998HA==", "dev": true, "optional": true }, "@rollup/rollup-android-arm64": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.18.0.tgz", - "integrity": "sha512-avCea0RAP03lTsDhEyfy+hpfr85KfyTctMADqHVhLAF3MlIkq83CP8UfAHUssgXTYd+6er6PaAhx/QGv4L1EiA==", + "version": "4.27.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.27.2.tgz", + "integrity": "sha512-xsPeJgh2ThBpUqlLgRfiVYBEf/P1nWlWvReG+aBWfNv3XEBpa6ZCmxSVnxJgLgkNz4IbxpLy64h2gCmAAQLneQ==", "dev": true, "optional": true }, "@rollup/rollup-darwin-arm64": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.18.0.tgz", - "integrity": "sha512-IWfdwU7KDSm07Ty0PuA/W2JYoZ4iTj3TUQjkVsO/6U+4I1jN5lcR71ZEvRh52sDOERdnNhhHU57UITXz5jC1/w==", + "version": "4.27.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.27.2.tgz", + "integrity": "sha512-KnXU4m9MywuZFedL35Z3PuwiTSn/yqRIhrEA9j+7OSkji39NzVkgxuxTYg5F8ryGysq4iFADaU5osSizMXhU2A==", "dev": true, "optional": true }, "@rollup/rollup-darwin-x64": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.18.0.tgz", - "integrity": "sha512-n2LMsUz7Ynu7DoQrSQkBf8iNrjOGyPLrdSg802vk6XT3FtsgX6JbE8IHRvposskFm9SNxzkLYGSq9QdpLYpRNA==", + "version": "4.27.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.27.2.tgz", + "integrity": "sha512-Hj77A3yTvUeCIx/Vi+4d4IbYhyTwtHj07lVzUgpUq9YpJSEiGJj4vXMKwzJ3w5zp5v3PFvpJNgc/J31smZey6g==", + "dev": true, + "optional": true + }, + "@rollup/rollup-freebsd-arm64": { + "version": "4.27.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.27.2.tgz", + "integrity": "sha512-RjgKf5C3xbn8gxvCm5VgKZ4nn0pRAIe90J0/fdHUsgztd3+Zesb2lm2+r6uX4prV2eUByuxJNdt647/1KPRq5g==", + "dev": true, + "optional": true + }, + "@rollup/rollup-freebsd-x64": { + "version": "4.27.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.27.2.tgz", + "integrity": "sha512-duq21FoXwQtuws+V9H6UZ+eCBc7fxSpMK1GQINKn3fAyd9DFYKPJNcUhdIKOrMFjLEJgQskoMoiuizMt+dl20g==", "dev": true, "optional": true }, "@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.18.0.tgz", - "integrity": "sha512-C/zbRYRXFjWvz9Z4haRxcTdnkPt1BtCkz+7RtBSuNmKzMzp3ZxdM28Mpccn6pt28/UWUCTXa+b0Mx1k3g6NOMA==", + "version": "4.27.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.27.2.tgz", + "integrity": "sha512-6npqOKEPRZkLrMcvyC/32OzJ2srdPzCylJjiTJT2c0bwwSGm7nz2F9mNQ1WrAqCBZROcQn91Fno+khFhVijmFA==", "dev": true, "optional": true }, "@rollup/rollup-linux-arm-musleabihf": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.18.0.tgz", - "integrity": "sha512-l3m9ewPgjQSXrUMHg93vt0hYCGnrMOcUpTz6FLtbwljo2HluS4zTXFy2571YQbisTnfTKPZ01u/ukJdQTLGh9A==", + "version": "4.27.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.27.2.tgz", + "integrity": "sha512-V9Xg6eXtgBtHq2jnuQwM/jr2mwe2EycnopO8cbOvpzFuySCGtKlPCI3Hj9xup/pJK5Q0388qfZZy2DqV2J8ftw==", "dev": true, "optional": true }, "@rollup/rollup-linux-arm64-gnu": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.18.0.tgz", - "integrity": "sha512-rJ5D47d8WD7J+7STKdCUAgmQk49xuFrRi9pZkWoRD1UeSMakbcepWXPF8ycChBoAqs1pb2wzvbY6Q33WmN2ftw==", + "version": "4.27.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.27.2.tgz", + "integrity": "sha512-uCFX9gtZJoQl2xDTpRdseYuNqyKkuMDtH6zSrBTA28yTfKyjN9hQ2B04N5ynR8ILCoSDOrG/Eg+J2TtJ1e/CSA==", "dev": true, "optional": true }, "@rollup/rollup-linux-arm64-musl": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.18.0.tgz", - "integrity": "sha512-be6Yx37b24ZwxQ+wOQXXLZqpq4jTckJhtGlWGZs68TgdKXJgw54lUUoFYrg6Zs/kjzAQwEwYbp8JxZVzZLRepQ==", + "version": "4.27.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.27.2.tgz", + "integrity": "sha512-/PU9P+7Rkz8JFYDHIi+xzHabOu9qEWR07L5nWLIUsvserrxegZExKCi2jhMZRd0ATdboKylu/K5yAXbp7fYFvA==", "dev": true, "optional": true }, "@rollup/rollup-linux-powerpc64le-gnu": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.18.0.tgz", - "integrity": "sha512-hNVMQK+qrA9Todu9+wqrXOHxFiD5YmdEi3paj6vP02Kx1hjd2LLYR2eaN7DsEshg09+9uzWi2W18MJDlG0cxJA==", + "version": "4.27.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.27.2.tgz", + "integrity": "sha512-eCHmol/dT5odMYi/N0R0HC8V8QE40rEpkyje/ZAXJYNNoSfrObOvG/Mn+s1F/FJyB7co7UQZZf6FuWnN6a7f4g==", "dev": true, "optional": true }, "@rollup/rollup-linux-riscv64-gnu": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.18.0.tgz", - "integrity": "sha512-ROCM7i+m1NfdrsmvwSzoxp9HFtmKGHEqu5NNDiZWQtXLA8S5HBCkVvKAxJ8U+CVctHwV2Gb5VUaK7UAkzhDjlg==", + "version": "4.27.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.27.2.tgz", + "integrity": "sha512-DEP3Njr9/ADDln3kNi76PXonLMSSMiCir0VHXxmGSHxCxDfQ70oWjHcJGfiBugzaqmYdTC7Y+8Int6qbnxPBIQ==", "dev": true, "optional": true }, "@rollup/rollup-linux-s390x-gnu": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.18.0.tgz", - "integrity": "sha512-0UyyRHyDN42QL+NbqevXIIUnKA47A+45WyasO+y2bGJ1mhQrfrtXUpTxCOrfxCR4esV3/RLYyucGVPiUsO8xjg==", + "version": "4.27.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.27.2.tgz", + "integrity": "sha512-NHGo5i6IE/PtEPh5m0yw5OmPMpesFnzMIS/lzvN5vknnC1sXM5Z/id5VgcNPgpD+wHmIcuYYgW+Q53v+9s96lQ==", "dev": true, "optional": true }, "@rollup/rollup-linux-x64-gnu": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.18.0.tgz", - "integrity": "sha512-xuglR2rBVHA5UsI8h8UbX4VJ470PtGCf5Vpswh7p2ukaqBGFTnsfzxUBetoWBWymHMxbIG0Cmx7Y9qDZzr648w==", + "version": "4.27.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.27.2.tgz", + "integrity": "sha512-PaW2DY5Tan+IFvNJGHDmUrORadbe/Ceh8tQxi8cmdQVCCYsLoQo2cuaSj+AU+YRX8M4ivS2vJ9UGaxfuNN7gmg==", "dev": true, "optional": true }, "@rollup/rollup-linux-x64-musl": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.18.0.tgz", - "integrity": "sha512-LKaqQL9osY/ir2geuLVvRRs+utWUNilzdE90TpyoX0eNqPzWjRm14oMEE+YLve4k/NAqCdPkGYDaDF5Sw+xBfg==", + "version": "4.27.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.27.2.tgz", + "integrity": "sha512-dOlWEMg2gI91Qx5I/HYqOD6iqlJspxLcS4Zlg3vjk1srE67z5T2Uz91yg/qA8sY0XcwQrFzWWiZhMNERylLrpQ==", "dev": true, "optional": true }, "@rollup/rollup-win32-arm64-msvc": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.18.0.tgz", - "integrity": "sha512-7J6TkZQFGo9qBKH0pk2cEVSRhJbL6MtfWxth7Y5YmZs57Pi+4x6c2dStAUvaQkHQLnEQv1jzBUW43GvZW8OFqA==", + "version": "4.27.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.27.2.tgz", + "integrity": "sha512-euMIv/4x5Y2/ImlbGl88mwKNXDsvzbWUlT7DFky76z2keajCtcbAsN9LUdmk31hAoVmJJYSThgdA0EsPeTr1+w==", "dev": true, "optional": true }, "@rollup/rollup-win32-ia32-msvc": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.18.0.tgz", - "integrity": "sha512-Txjh+IxBPbkUB9+SXZMpv+b/vnTEtFyfWZgJ6iyCmt2tdx0OF5WhFowLmnh8ENGNpfUlUZkdI//4IEmhwPieNg==", + "version": "4.27.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.27.2.tgz", + "integrity": "sha512-RsnE6LQkUHlkC10RKngtHNLxb7scFykEbEwOFDjr3CeCMG+Rr+cKqlkKc2/wJ1u4u990urRHCbjz31x84PBrSQ==", "dev": true, "optional": true }, "@rollup/rollup-win32-x64-msvc": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.18.0.tgz", - "integrity": "sha512-UOo5FdvOL0+eIVTgS4tIdbW+TtnBLWg1YBCcU2KWM7nuNwRz9bksDX1bekJJCpu25N1DVWaCwnT39dVQxzqS8g==", + "version": "4.27.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.27.2.tgz", + "integrity": "sha512-foJM5vv+z2KQmn7emYdDLyTbkoO5bkHZE1oth2tWbQNGW7mX32d46Hz6T0MqXdWS2vBZhaEtHqdy9WYwGfiliA==", "dev": true, "optional": true }, @@ -5616,9 +5664,9 @@ } }, "@types/estree": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz", - "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.6.tgz", + "integrity": "sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==", "dev": true }, "@types/express": { @@ -5857,23 +5905,23 @@ } }, "@vitest/expect": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-1.2.2.tgz", - "integrity": "sha512-3jpcdPAD7LwHUUiT2pZTj2U82I2Tcgg2oVPvKxhn6mDI2On6tfvPQTjAI4628GUGDZrCm4Zna9iQHm5cEexOAg==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-1.6.0.tgz", + "integrity": "sha512-ixEvFVQjycy/oNgHjqsL6AZCDduC+tflRluaHIzKIsdbzkLn2U/iBnVeJwB6HsIjQBdfMR8Z0tRxKUsvFJEeWQ==", "dev": true, "requires": { - "@vitest/spy": "1.2.2", - "@vitest/utils": "1.2.2", + "@vitest/spy": "1.6.0", + "@vitest/utils": "1.6.0", "chai": "^4.3.10" } }, "@vitest/runner": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-1.2.2.tgz", - "integrity": "sha512-JctG7QZ4LSDXr5CsUweFgcpEvrcxOV1Gft7uHrvkQ+fsAVylmWQvnaAr/HDp3LAH1fztGMQZugIheTWjaGzYIg==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-1.6.0.tgz", + "integrity": "sha512-P4xgwPjwesuBiHisAVz/LSSZtDjOTPYZVmNAnpHHSR6ONrf8eCJOFRvUwdHn30F5M1fxhqtl7QZQUk2dprIXAg==", "dev": true, "requires": { - "@vitest/utils": "1.2.2", + "@vitest/utils": "1.6.0", "p-limit": "^5.0.0", "pathe": "^1.1.1" }, @@ -5888,17 +5936,17 @@ } }, "yocto-queue": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.0.0.tgz", - "integrity": "sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.1.1.tgz", + "integrity": "sha512-b4JR1PFR10y1mKjhHY9LaGo6tmrgjit7hxVIeAmyMw3jegXR4dhYqLaQF5zMXZxY7tLpMyJeLjr1C4rLmkVe8g==", "dev": true } } }, "@vitest/snapshot": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-1.2.2.tgz", - "integrity": "sha512-SmGY4saEw1+bwE1th6S/cZmPxz/Q4JWsl7LvbQIky2tKE35US4gd0Mjzqfr84/4OD0tikGWaWdMja/nWL5NIPA==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-1.6.0.tgz", + "integrity": "sha512-+Hx43f8Chus+DCmygqqfetcAZrDJwvTj0ymqjQq4CvmpKFSTVteEOBzCusu1x2tt4OJcvBflyHUE0DZSLgEMtQ==", "dev": true, "requires": { "magic-string": "^0.30.5", @@ -5907,18 +5955,18 @@ } }, "@vitest/spy": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-1.2.2.tgz", - "integrity": "sha512-k9Gcahssw8d7X3pSLq3e3XEu/0L78mUkCjivUqCQeXJm9clfXR/Td8+AP+VC1O6fKPIDLcHDTAmBOINVuv6+7g==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-1.6.0.tgz", + "integrity": "sha512-leUTap6B/cqi/bQkXUu6bQV5TZPx7pmMBKBQiI0rJA8c3pB56ZsaTbREnF7CJfmvAS4V2cXIBAh/3rVwrrCYgw==", "dev": true, "requires": { "tinyspy": "^2.2.0" } }, "@vitest/utils": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-1.2.2.tgz", - "integrity": "sha512-WKITBHLsBHlpjnDQahr+XK6RE7MiAsgrIkr0pGhQ9ygoxBfUeG0lUG5iLlzqjmKSlBv3+j5EGsriBzh+C3Tq9g==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-1.6.0.tgz", + "integrity": "sha512-21cPiuGMoMZwiOHa2i4LXkMkMkCGzA+MVFV70jRwHo95dL4x/ts5GZhML1QWuy7yfp3WzK3lRvZi3JnXTYqrBw==", "dev": true, "requires": { "diff-sequences": "^29.6.3", @@ -6159,9 +6207,9 @@ "dev": true }, "chai": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/chai/-/chai-4.4.1.tgz", - "integrity": "sha512-13sOfMv2+DWduEU+/xbun3LScLoqN17nBeTLUsmDfKdoiC1fr0n9PU4guu4AhRcOVFk/sW8LyZWHuhWtQZiF+g==", + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/chai/-/chai-4.5.0.tgz", + "integrity": "sha512-RITGBfijLkBddZvnn8jdqoTypxvqbOLYQkGGxXzeFjVHvudaPw0HNFD9x928/eUwYWd2dPCugVqspGALTZZQKw==", "dev": true, "requires": { "assertion-error": "^1.1.0", @@ -6170,7 +6218,7 @@ "get-func-name": "^2.0.2", "loupe": "^2.3.6", "pathval": "^1.1.1", - "type-detect": "^4.0.8" + "type-detect": "^4.1.0" } }, "chalk": { @@ -6381,9 +6429,9 @@ } }, "deep-eql": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-4.1.3.tgz", - "integrity": "sha512-WaEtAOpRA1MQ0eohqZjpGD8zdI0Ovsm8mmFhaDN8dvDZzyoUMcYDnf5Y6iu7HTXxf8JDS23qWa4a+hKCDyOPzw==", + "version": "4.1.4", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-4.1.4.tgz", + "integrity": "sha512-SUwdGfqdKOwxCPeVYjwSyRpJ7Z+fhpwIAtmCUdZIWZ/YP5R9WAsyuSgpLVDi9bjWoN2LXHNss/dk3urXtdQxGg==", "dev": true, "requires": { "type-detect": "^4.0.0" @@ -7193,6 +7241,12 @@ "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", "dev": true }, + "js-tokens": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-9.0.0.tgz", + "integrity": "sha512-WriZw1luRMlmV3LGJaR6QOJjWwgLUTf89OwT2lUOyjX2dJGBwgmIkbcz+7WFZjrZM635JOIR517++e/67CP9dQ==", + "dev": true + }, "js-yaml": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", @@ -7340,12 +7394,12 @@ } }, "magic-string": { - "version": "0.30.7", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.7.tgz", - "integrity": "sha512-8vBuFF/I/+OSLRmdf2wwFCJCz+nSn0m6DPvGH1fS/KiQoSaR+sETbov0eIk9KhEKy8CYqIkIAnbohxT/4H0kuA==", + "version": "0.30.12", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.12.tgz", + "integrity": "sha512-Ea8I3sQMVXr8JhN4z+H/d8zwo+tYDgHE9+5G4Wnrwhs0gaK9fXTKx0Tw5Xwsd/bCPTTZNRAdpyzvoeORe9LYpw==", "dev": true, "requires": { - "@jridgewell/sourcemap-codec": "^1.4.15" + "@jridgewell/sourcemap-codec": "^1.5.0" } }, "media-typer": { @@ -7811,9 +7865,9 @@ } }, "picocolors": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", - "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", "dev": true }, "picomatch": { @@ -7834,14 +7888,14 @@ } }, "postcss": { - "version": "8.4.38", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.38.tgz", - "integrity": "sha512-Wglpdk03BSfXkHoQa3b/oulrotAkwrlLDRSOb9D0bN86FdRyE9lppSp33aHNPgBa0JKCoB+drFLZkQoRRYae5A==", + "version": "8.4.49", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.49.tgz", + "integrity": "sha512-OCVPnIObs4N29kxTjzLfUryOkvZEq+pf8jTF0lg8E7uETuWHA+v7j3c/xJmiqpX450191LlmZfUKkXxkTry7nA==", "dev": true, "requires": { "nanoid": "^3.3.7", - "picocolors": "^1.0.0", - "source-map-js": "^1.2.0" + "picocolors": "^1.1.1", + "source-map-js": "^1.2.1" }, "dependencies": { "nanoid": { @@ -7973,9 +8027,9 @@ } }, "react-is": { - "version": "18.2.0", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.2.0.tgz", - "integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==", + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", + "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", "dev": true }, "readable-stream": { @@ -8030,28 +8084,30 @@ } }, "rollup": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.18.0.tgz", - "integrity": "sha512-QmJz14PX3rzbJCN1SG4Xe/bAAX2a6NpCP8ab2vfu2GiUr8AQcr2nCV/oEO3yneFarB67zk8ShlIyWb2LGTb3Sg==", - "dev": true, - "requires": { - "@rollup/rollup-android-arm-eabi": "4.18.0", - "@rollup/rollup-android-arm64": "4.18.0", - "@rollup/rollup-darwin-arm64": "4.18.0", - "@rollup/rollup-darwin-x64": "4.18.0", - "@rollup/rollup-linux-arm-gnueabihf": "4.18.0", - "@rollup/rollup-linux-arm-musleabihf": "4.18.0", - "@rollup/rollup-linux-arm64-gnu": "4.18.0", - "@rollup/rollup-linux-arm64-musl": "4.18.0", - "@rollup/rollup-linux-powerpc64le-gnu": "4.18.0", - "@rollup/rollup-linux-riscv64-gnu": "4.18.0", - "@rollup/rollup-linux-s390x-gnu": "4.18.0", - "@rollup/rollup-linux-x64-gnu": "4.18.0", - "@rollup/rollup-linux-x64-musl": "4.18.0", - "@rollup/rollup-win32-arm64-msvc": "4.18.0", - "@rollup/rollup-win32-ia32-msvc": "4.18.0", - "@rollup/rollup-win32-x64-msvc": "4.18.0", - "@types/estree": "1.0.5", + "version": "4.27.2", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.27.2.tgz", + "integrity": "sha512-KreA+PzWmk2yaFmZVwe6GB2uBD86nXl86OsDkt1bJS9p3vqWuEQ6HnJJ+j/mZi/q0920P99/MVRlB4L3crpF5w==", + "dev": true, + "requires": { + "@rollup/rollup-android-arm-eabi": "4.27.2", + "@rollup/rollup-android-arm64": "4.27.2", + "@rollup/rollup-darwin-arm64": "4.27.2", + "@rollup/rollup-darwin-x64": "4.27.2", + "@rollup/rollup-freebsd-arm64": "4.27.2", + "@rollup/rollup-freebsd-x64": "4.27.2", + "@rollup/rollup-linux-arm-gnueabihf": "4.27.2", + "@rollup/rollup-linux-arm-musleabihf": "4.27.2", + "@rollup/rollup-linux-arm64-gnu": "4.27.2", + "@rollup/rollup-linux-arm64-musl": "4.27.2", + "@rollup/rollup-linux-powerpc64le-gnu": "4.27.2", + "@rollup/rollup-linux-riscv64-gnu": "4.27.2", + "@rollup/rollup-linux-s390x-gnu": "4.27.2", + "@rollup/rollup-linux-x64-gnu": "4.27.2", + "@rollup/rollup-linux-x64-musl": "4.27.2", + "@rollup/rollup-win32-arm64-msvc": "4.27.2", + "@rollup/rollup-win32-ia32-msvc": "4.27.2", + "@rollup/rollup-win32-x64-msvc": "4.27.2", + "@types/estree": "1.0.6", "fsevents": "~2.3.2" } }, @@ -8220,9 +8276,9 @@ "dev": true }, "source-map-js": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.0.tgz", - "integrity": "sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", + "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", "dev": true }, "split2": { @@ -8294,12 +8350,12 @@ "dev": true }, "strip-literal": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/strip-literal/-/strip-literal-1.3.0.tgz", - "integrity": "sha512-PugKzOsyXpArk0yWmUwqOZecSO0GH0bPoctLcqNDH9J04pVW3lflYE0ujElBGTloevcxF5MofAOZ7C5l2b+wLg==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/strip-literal/-/strip-literal-2.1.0.tgz", + "integrity": "sha512-Op+UycaUt/8FbN/Z2TWPBLge3jWrP3xj10f3fnYxf052bKuS3EKs1ZQcVGjnEMdsNVAM+plXRdmjrZ/KgG3Skw==", "dev": true, "requires": { - "acorn": "^8.10.0" + "js-tokens": "^9.0.0" } }, "supports-color": { @@ -8377,15 +8433,15 @@ "dev": true }, "tinypool": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-0.8.2.tgz", - "integrity": "sha512-SUszKYe5wgsxnNOVlBYO6IC+8VGWdVGZWAqUxp3UErNBtptZvWbwyUOyzNL59zigz2rCA92QiL3wvG+JDSdJdQ==", + "version": "0.8.4", + "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-0.8.4.tgz", + "integrity": "sha512-i11VH5gS6IFeLY3gMBQ00/MmLncVP7JLXOw1vlgkytLmJK7QnEr7NXf0LBdxfmNPAeyetukOk0bOYrJrFGjYJQ==", "dev": true }, "tinyspy": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-2.2.0.tgz", - "integrity": "sha512-d2eda04AN/cPOR89F7Xv5bK/jrQEhmcLFe6HFldoeO9AJtps+fqEnh486vnT/8y4bw38pSyxDcTCAq+Ks2aJTg==", + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-2.2.1.tgz", + "integrity": "sha512-KYad6Vy5VDWV4GH3fjpseMQ/XU2BhIYP7Vzd0LG44qRWm/Yt2WCOTicFdvmgo6gWaqooMQCawTtILVQJupKu7A==", "dev": true }, "to-regex-range": { @@ -8438,9 +8494,9 @@ } }, "type-detect": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", - "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.1.0.tgz", + "integrity": "sha512-Acylog8/luQ8L7il+geoSxhEkazvkslg7PSNKOX59mbB9cOveP5aq9h74Y7YU8yDpJwetzQQrfIwtf4Wp4LKcw==", "dev": true }, "type-fest": { @@ -8516,21 +8572,21 @@ "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==" }, "vite": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/vite/-/vite-5.3.1.tgz", - "integrity": "sha512-XBmSKRLXLxiaPYamLv3/hnP/KXDai1NDexN0FpkTaZXTfycHvkRHoenpgl/fvuK/kPbB6xAgoyiryAhQNxYmAQ==", + "version": "5.4.11", + "resolved": "https://registry.npmjs.org/vite/-/vite-5.4.11.tgz", + "integrity": "sha512-c7jFQRklXua0mTzneGW9QVyxFjUgwcihC4bXEtujIo2ouWCe1Ajt/amn2PCxYnhYfd5k09JX3SB7OYWFKYqj8Q==", "dev": true, "requires": { "esbuild": "^0.21.3", "fsevents": "~2.3.3", - "postcss": "^8.4.38", - "rollup": "^4.13.0" + "postcss": "^8.4.43", + "rollup": "^4.20.0" } }, "vite-node": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-1.2.2.tgz", - "integrity": "sha512-1as4rDTgVWJO3n1uHmUYqq7nsFgINQ9u+mRcXpjeOMJUmviqNKjcZB7UfRZrlM7MjYXMKpuWp5oGkjaFLnjawg==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-1.6.0.tgz", + "integrity": "sha512-de6HJgzC+TFzOu0NTC4RAIsyf/DY/ibWDYQUcuEA84EMHhcefTUGkjFHKKEJhQN4A+6I0u++kr3l36ZF2d7XRw==", "dev": true, "requires": { "cac": "^6.7.14", @@ -8541,18 +8597,17 @@ } }, "vitest": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/vitest/-/vitest-1.2.2.tgz", - "integrity": "sha512-d5Ouvrnms3GD9USIK36KG8OZ5bEvKEkITFtnGv56HFaSlbItJuYr7hv2Lkn903+AvRAgSixiamozUVfORUekjw==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-1.6.0.tgz", + "integrity": "sha512-H5r/dN06swuFnzNFhq/dnz37bPXnq8xB2xB5JOVk8K09rUtoeNN+LHWkoQ0A/i3hvbUKKcCei9KpbxqHMLhLLA==", "dev": true, "requires": { - "@vitest/expect": "1.2.2", - "@vitest/runner": "1.2.2", - "@vitest/snapshot": "1.2.2", - "@vitest/spy": "1.2.2", - "@vitest/utils": "1.2.2", + "@vitest/expect": "1.6.0", + "@vitest/runner": "1.6.0", + "@vitest/snapshot": "1.6.0", + "@vitest/spy": "1.6.0", + "@vitest/utils": "1.6.0", "acorn-walk": "^8.3.2", - "cac": "^6.7.14", "chai": "^4.3.10", "debug": "^4.3.4", "execa": "^8.0.1", @@ -8561,11 +8616,11 @@ "pathe": "^1.1.1", "picocolors": "^1.0.0", "std-env": "^3.5.0", - "strip-literal": "^1.3.0", + "strip-literal": "^2.0.0", "tinybench": "^2.5.1", - "tinypool": "^0.8.2", + "tinypool": "^0.8.3", "vite": "^5.0.0", - "vite-node": "1.2.2", + "vite-node": "1.6.0", "why-is-node-running": "^2.2.2" } }, diff --git a/package.json b/package.json index a44f1e2..d692d20 100644 --- a/package.json +++ b/package.json @@ -27,6 +27,7 @@ }, "dependencies": { "@streamparser/json": "^0.0.21", + "ajv": "^6.10.0", "altair-express-middleware": "^5.2.11", "cookie-parser": "^1.4.6", "cors": "^2.8.5", @@ -60,6 +61,6 @@ "nodemon": "^3.1.4", "prettier": "^3.0.0", "typescript": "^5.1.6", - "vitest": "^1.2.2" + "vitest": "^1.4.0" } } diff --git a/src/main.ts b/src/main.ts index fd27de5..fcf3692 100644 --- a/src/main.ts +++ b/src/main.ts @@ -11,6 +11,7 @@ import initHasuraRoutes from './packages/hasura/hasura-events.js'; import initHealthRoutes from './packages/health/health.js'; import initPlanRoutes from './packages/plan/plan.js'; import initSwaggerRoutes from './packages/swagger/swagger.js'; +import initExternalSourceRoutes from './packages/external-source/external-source.js'; import cookieParser from 'cookie-parser'; import { AuthAdapter } from './types/auth.js'; import { NoAuthAdapter } from './packages/auth/adapters/NoAuthAdapter.js'; @@ -48,6 +49,7 @@ async function main(): Promise { initHealthRoutes(app); initHasuraRoutes(app); initPlanRoutes(app); + initExternalSourceRoutes(app); initSwaggerRoutes(app); app.listen(PORT, () => { diff --git a/src/packages/external-source/external-source.ts b/src/packages/external-source/external-source.ts new file mode 100644 index 0000000..162b17f --- /dev/null +++ b/src/packages/external-source/external-source.ts @@ -0,0 +1,530 @@ +import type { Express, Request, Response } from 'express'; +import type { + ExternalSourceTypeInsertInput, + CreateExternalSourceResponse, + ExternalEventTypeInsertInput, + CreateExternalSourceEventTypeResponse, + GetSourceEventTypeAttributeSchemasResponse, + AttributeSchema, + DerivationGroupInsertInput, + ExternalSourceInsertInput, + ExternalSourceRequest, + ExternalEventRequest, +} from '../../types/external-source.js'; +import Ajv from 'ajv'; +import { getEnv } from '../../env.js'; +import getLogger from '../../logger.js'; +import gql from './gql.js'; +import { + attributeSchemaMetaschema, + baseExternalSourceSchema, +} from '../../schemas/external-event-validation-schemata.js'; +import { HasuraError } from '../../types/hasura.js'; +import { auth } from '../auth/middleware.js'; +import rateLimit from 'express-rate-limit'; +import multer from 'multer'; + +const upload = multer({ limits: { fieldSize: 25 * 1024 * 1024 } }); +const logger = getLogger('packages/external-source/external-source'); +const { RATE_LIMITER_LOGIN_MAX, HASURA_API_URL } = getEnv(); +const GQL_API_URL = `${HASURA_API_URL}/v1/graphql`; +const ajv = new Ajv(); +const compiledAttributeMetaschema = ajv.compile(attributeSchemaMetaschema); +const refreshLimiter = rateLimit({ + legacyHeaders: false, + max: RATE_LIMITER_LOGIN_MAX, + standardHeaders: true, + windowMs: 15 * 60 * 1000, // 15 minutes +}); + +export function updateSchemaWithDefs(defs: { event_types: any; source_type: any }): Ajv.ValidateFunction { + + logger.info("SDFSDFDSF") + + // Build if statement + const ifThenElse: { [key: string]: any } = {}; + let ifThenElsePointer = ifThenElse; + const keys = Object.keys(defs.event_types); + + // Handle single event type (don't bother with $defs, just update attributes' properties directly) + if (keys.length === 1) { + const localSchemaCopy = structuredClone(baseExternalSourceSchema); + + const eventTypeName = keys[0]; + const eventTypeSchema = { + ...defs.event_types[eventTypeName], + additionalProperties: false, + }; + const sourceTypeName = Object.keys(defs.source_type)[0]; + const sourceTypeSchema = { + ...defs.source_type[sourceTypeName], + additionalProperties: false, + }; + + localSchemaCopy.properties.events.items.properties.attributes = eventTypeSchema; + localSchemaCopy.properties.events.items.properties.event_type_name = { const: eventTypeName }; + + // Insert def for "source" attributes + localSchemaCopy.properties.source.properties.attributes = sourceTypeSchema; + + const localAjv = new Ajv(); + return localAjv.compile(localSchemaCopy); + } + + // Handle n event types + for (let i = 0; i < keys.length - 1; i++) { + const key = keys[i]; + // Create tree of if/else/then statements to support validating different types + ifThenElsePointer['if'] = { + properties: { + event_type_name: { + const: key, + }, + }, + }; + ifThenElsePointer['then'] = { + properties: { + attributes: { + $ref: `#/$defs/event_types/${key}`, + }, + }, + }; + ifThenElsePointer['else'] = {}; + ifThenElsePointer = ifThenElsePointer['else']; + } + + const key = keys[keys.length - 1]; + ifThenElsePointer['properties'] = { + attributes: { + $ref: `#/$defs/event_types/${key}`, + }, + }; + + const localSchemaCopy = structuredClone(baseExternalSourceSchema); + localSchemaCopy.properties.events.items['if'] = ifThenElse['if']; + localSchemaCopy.properties.events.items['then'] = ifThenElse['then']; + localSchemaCopy.properties.events.items['else'] = ifThenElse['else']; + + // Insert def for "source" attributes + const sourceTypeKey = Object.keys(defs.source_type)[0]; + localSchemaCopy.properties.source.properties.attributes = { $ref: `#/$defs/source_type/${sourceTypeKey}` }; + + // Add defs + localSchemaCopy.$defs = { + event_types: {}, + source_type: { + [sourceTypeKey]: { + ...defs.source_type[sourceTypeKey], + additionalProperties: false, + }, + }, + }; + for (const eventType of keys) { + localSchemaCopy.$defs.event_types[eventType] = { + ...defs.event_types[eventType], + additionalProperties: false, + }; + } + + logger.info(JSON.stringify(localSchemaCopy)); + + // Compile & return full schema with 'defs' added + const localAjv = new Ajv(); + return localAjv.compile(localSchemaCopy); +} + +async function uploadExternalSourceEventTypes(req: Request, res: Response) { + const authorizationHeader = req.get('authorization'); + + const { + body: { event_types, source_types }, + headers: { 'x-hasura-role': roleHeader, 'x-hasura-user-id': userHeader }, + } = req; + + console.log(event_types, source_types) + + let parsedEventTypes: { [x: string]: object } | undefined = undefined; + if (event_types !== undefined) { + parsedEventTypes = JSON.parse(event_types); + } + let parsedSourceTypes: { [x: string]: object } | undefined = undefined; + if (source_types !== undefined) { + parsedSourceTypes = JSON.parse(source_types); + } + + logger.info(`POST /uploadExternalSourceEventTypes: Uploading External Source and Event Types...`); + + const headers: HeadersInit = { + Authorization: authorizationHeader ?? '', + 'Content-Type': 'application/json', + 'x-hasura-role': roleHeader ? `${roleHeader}` : '', + 'x-hasura-user-id': userHeader ? `${userHeader}` : '', + }; + + // Validate uploaded attribute schemas are formatted validly + const metaschema: { [x: string]: object } = {}; + if (parsedEventTypes !== undefined) { + metaschema["event_types"] = parsedEventTypes; + } + if (parsedSourceTypes !== undefined) { + metaschema["source_types"] = parsedSourceTypes; + } + const schemasAreValid: boolean = await compiledAttributeMetaschema(metaschema); + if (!schemasAreValid) { + const errorMsg = `Schema validation failed for uploaded source and event types:\n${JSON.stringify( + compiledAttributeMetaschema.errors, + )}`; + logger.error(`POST /uploadExternalSourceEventTypes: ${errorMsg}`); + res.status(500).send({ message: errorMsg }); + return; + } + + logger.info(`POST /uploadExternalSourceEventTypes: Uploaded attribute schema(s) are VALID`); + + // extract the external sources and event types + const externalSourceTypeInput: ExternalSourceTypeInsertInput[] = []; + const externalEventTypeInput: ExternalEventTypeInsertInput[] = []; + + let eventTypeKeys: string[] = []; + if (parsedEventTypes !== undefined) { + eventTypeKeys = Object.keys(parsedEventTypes); + for (const externalEventType of eventTypeKeys) { + externalEventTypeInput.push({ + attribute_schema: parsedEventTypes[externalEventType], + name: externalEventType, + }); + } + } + + let sourceTypeKeys: string[] = []; + if (parsedSourceTypes !== undefined) { + sourceTypeKeys = Object.keys(parsedSourceTypes); + for (const externalSourceType of sourceTypeKeys) { + externalSourceTypeInput.push({ + attribute_schema: parsedSourceTypes[externalSourceType], + name: externalSourceType, + }); + } + } + + // Run the Hasura migration for creating all types, in one go + const response = await fetch(GQL_API_URL, { + body: JSON.stringify({ + query: gql.CREATE_EXTERNAL_SOURCE_EVENT_TYPES, + variables: { externalEventTypes: externalEventTypeInput, externalSourceTypes: externalSourceTypeInput }, + }), + headers, + method: 'POST', + }); + + const createExternalSourceEventTypesResponse = await response.json(); + if (createExternalSourceEventTypesResponse?.data !== undefined) { + res.json(createExternalSourceEventTypesResponse.data as CreateExternalSourceEventTypeResponse); + } else { + res.json(createExternalSourceEventTypesResponse as HasuraError); + } +} + +async function uploadExternalSource(req: Request, res: Response) { + const authorizationHeader = req.get('authorization'); + + const { + body: { source, events }, + headers: { 'x-hasura-role': roleHeader, 'x-hasura-user-id': userHeader }, + } = req; + + let parsedSource: ExternalSourceRequest; + let parsedExternalEvents: ExternalEventRequest[]; + + try { + parsedSource = JSON.parse(source); + parsedExternalEvents = JSON.parse(events); + } catch (e) { + const errorMsg = `Body of request must be a JSON, with two stringified properties: "source" and "events". Alternatively, parsing may have failed:\n${ + (e as Error).message + }`; + logger.error(`POST /uploadExternalSourceEventTypes: ${errorMsg}`); + res.status(500).send({ + message: errorMsg, + }); + return; + } + const { attributes, derivation_group_name, key, period, source_type_name, valid_at } = parsedSource; + + // Re-package the fields as a JSON object to be parsed + const externalSourceJson = { + events: parsedExternalEvents, + source: { + attributes: attributes, + derivation_group_name: derivation_group_name, + key: key, + period: period, + source_type_name: source_type_name, + valid_at: valid_at, + }, + }; + + const headers: HeadersInit = { + Authorization: authorizationHeader ?? '', + 'Content-Type': 'application/json', + 'x-hasura-role': roleHeader ? `${roleHeader}` : '', + 'x-hasura-user-id': userHeader ? `${userHeader}` : '', + }; + + logger.info(`POST /uploadExternalSource: Uploading External Source: ${key}`); + + // Get the attribute schema for the source's external source type and all contained event types + let eventTypeNames = parsedExternalEvents.map(e => e.event_type_name); + eventTypeNames = eventTypeNames.filter((e, i) => eventTypeNames.indexOf(e) === i); + const attributeSchemas = await fetch(GQL_API_URL, { + body: JSON.stringify({ + query: gql.GET_SOURCE_EVENT_TYPE_ATTRIBUTE_SCHEMAS, + variables: { + externalEventTypes: eventTypeNames, + externalSourceType: source_type_name, + }, + }), + headers, + method: 'POST', + }); + + const attributeSchemaJson = await attributeSchemas.json(); + const { external_event_type, external_source_type } = + attributeSchemaJson.data as GetSourceEventTypeAttributeSchemasResponse; + + if (external_event_type.length === 0 || external_source_type.length === 0) { + const errorMsg = 'The source and/or event types in your source do not exist in the database.'; + logger.error(`POST /uploadExternalSourceEventTypes: ${errorMsg}`); + res.status(500).send({ message: errorMsg }); + return; + } + + const eventTypeNamesMappedToSchemas = external_event_type.reduce( + (acc: Record, eventType: ExternalEventTypeInsertInput) => { + acc[eventType.name] = eventType.attribute_schema; + return acc; + }, + {}, + ); + const sourceTypeNamesMappedToSchemas = external_source_type.reduce( + (acc: Record, sourceType: ExternalSourceTypeInsertInput) => { + acc[sourceType.name] = sourceType.attribute_schema; + return acc; + }, + {}, + ); + + // Assemble megaschema from attribute schemas + const compiledExternalSourceMegaschema: Ajv.ValidateFunction = updateSchemaWithDefs({ + event_types: eventTypeNamesMappedToSchemas, + source_type: sourceTypeNamesMappedToSchemas, + }); + + // Verify that this is a valid external source + const sourceIsValid: boolean = await compiledExternalSourceMegaschema(externalSourceJson); + if (sourceIsValid) { + logger.info(`POST /uploadExternalSource: External Source ${key}'s formatting is valid`); + } else { + const errorMsg = `External Source ${key}'s formatting is invalid:\n${JSON.stringify( + compiledExternalSourceMegaschema.errors, + )}`; + logger.error(`POST /uploadExternalSource: ${errorMsg}`); + res.status(500).send({ message: errorMsg }); + return; + } + + // Run the Hasura migration for creating an external source + const derivationGroupInsert: DerivationGroupInsertInput = { + name: derivation_group_name, + source_type_name: source_type_name, + }; + + const externalSourceInsert: ExternalSourceInsertInput = { + attributes: attributes, + derivation_group_name: derivation_group_name, + end_time: period.end_time, + external_events: { + data: parsedExternalEvents, + }, + key: key, + source_type_name: source_type_name, + start_time: period.start_time, + valid_at: valid_at, + }; + + const response = await fetch(GQL_API_URL, { + body: JSON.stringify({ + query: gql.CREATE_EXTERNAL_SOURCE, + variables: { + derivation_group: derivationGroupInsert, + source: externalSourceInsert, + }, + }), + headers, + method: 'POST', + }); + + const createExternalSourceResponse = await response.json(); + if (createExternalSourceResponse?.data !== undefined) { + res.json(createExternalSourceResponse.data as CreateExternalSourceResponse); + } else { + res.json(createExternalSourceResponse as HasuraError); + } +} + +export default (app: Express) => { + /** + * @swagger + * /uploadExternalSourceEventTypes: + * post: + * security: + * - bearerAuth: [] + * consumes: + * - multipart/form-data + * produces: + * - application/json + * parameters: + * - in: header + * name: x-hasura-role + * schema: + * type: string + * required: false + * requestBody: + * content: + * multipart/form-data: + * schema: + * type: object + * properties: + * event_types: + * description: An object representing the JSON Schema definition(s) for all external event types to be uploaded. + * type: object + * source_types: + * description: An object representing the JSON Schema definition(s) for all external event types to be uploaded. + * type: object + * required: + * - event_types + * - source_types + * responses: + * 200: + * description: Created External Source & Event Types + * content: + * application/json: + * schema: + * properties: + * createExternalEventTypes: + * description: Names of all the event types that were created in this request. + * type: object + * createExternalSourceTypes: + * description: Names of all the source types that were created in this request. + * type: object + * 403: + * description: Unauthorized error + * 401: + * description: Unauthenticated error + * summary: Uploads & validates a combination of External Event & Source types to Hasura. + * tags: + * - Hasura + */ + app.post('/uploadExternalSourceEventTypes', upload.any(), refreshLimiter, auth, uploadExternalSourceEventTypes); + + /** + * @swagger + * /uploadExternalSource: + * post: + * security: + * - bearerAuth: [] + * consumes: + * - multipart/form-data + * produces: + * - application/json + * parameters: + * - in: header + * name: x-hasura-role + * schema: + * type: string + * required: false + * requestBody: + * content: + * multipart/form-data: + * schema: + * type: object + * properties: + * events: + * description: A list of External Events to be uploaded that are contained within the External Source. + * type: array + * items: + * type: object + * properties: + * attributes: + * type: object + * duration: + * type: string + * event_type_name: + * type: string + * key: + * type: string + * start_time: + * type: string + * required: + * - attributes + * - duration + * - event_type_name + * - key + * - start_time + * source: + * description: An object representing the External Source to be uploaded. + * type: object + * properties: + * attributes: + * type: object + * derivation_group_name: + * type: string + * key: + * type: string + * period: + * type: object + * properties: + * end_time: + * type: string + * start_time: + * type: string + * required: + * - end_time + * start_time + * source_type_name: + * type: string + * valid_at: + * type: string + * required: + * - attributes + * - derivation_group_name + * - key + * - period + * - source_type_name + * - valid_at + * required: + * - events + * - source + * responses: + * 200: + * description: Created External Source + * content: + * application/json: + * schema: + * properties: + * createExternalSource: + * type: object + * properties: + * name: + * description: Name of the created External Source + * type: string + * 403: + * description: Unauthorized error + * 401: + * description: Unauthenticated error + * summary: Uploads an External Source to Hasura. + * tags: + * - Hasura + */ + app.post('/uploadExternalSource', upload.any(), refreshLimiter, auth, uploadExternalSource); +}; diff --git a/src/packages/external-source/gql.ts b/src/packages/external-source/gql.ts new file mode 100644 index 0000000..663b46f --- /dev/null +++ b/src/packages/external-source/gql.ts @@ -0,0 +1,76 @@ +export default { + CREATE_EXTERNAL_SOURCE: `#graphql + mutation CreateExternalSource( + $derivation_group: derivation_group_insert_input!, + $source: external_source_insert_input!, + ) { + upsertDerivationGroup: insert_derivation_group_one ( + object: $derivation_group, + on_conflict: { + constraint: derivation_group_pkey + } + ) { + name + } + createExternalSource: insert_external_source_one ( + object: $source + ) { + attributes + derivation_group_name, + end_time, + key, + source_type_name, + start_time, + valid_at, + attributes + } + } + `, + CREATE_EXTERNAL_SOURCE_EVENT_TYPES: `#graphql + mutation UploadAttributeSchemas($externalEventTypes: [external_event_type_insert_input!]!, $externalSourceTypes: [external_source_type_insert_input!]!) { + createExternalEventTypes: insert_external_event_type(objects: $externalEventTypes) { + returning { + name + } + } + createExternalSourceTypes: insert_external_source_type(objects: $externalSourceTypes) { + returning { + name + } + } + } + `, + GET_EXTERNAL_EVENT_TYPES_FOR_SOURCE_TYPE: `#graphql + query ExistingEventTypesForSourceType($sourceType: String!) { + existingEventTypes: external_source_type_allowed_event_types(where: {external_source_type: {_eq: $sourceType}}) { + external_event_type + } + } + `, + GET_EXTERNAL_EVENT_TYPE_ATTRIBUTE_SCHEMA: `#graphql + query GetExternalEventTypeAttributeSchema($name: String!) { + external_event_type_by_pk(name: $name) { + attribute_schema + } + } + `, + GET_EXTERNAL_SOURCE_TYPE_ATTRIBUTE_SCHEMA: `#graphql + query GetExternalSourceTypeAttributeSchema($name: String!) { + external_source_type_by_pk(name: $name) { + attribute_schema + } + } + `, + GET_SOURCE_EVENT_TYPE_ATTRIBUTE_SCHEMAS: `#graphql + query GetSourceEventTypeAttributeSchemas($externalEventTypes: [String!]!, $externalSourceType: String!) { + external_event_type(where: {name: {_in: $externalEventTypes}}) { + name + attribute_schema + } + external_source_type(where: {name: {_eq: $externalSourceType}}) { + name + attribute_schema + } + } + `, +}; diff --git a/src/schemas/external-event-validation-schemata.ts b/src/schemas/external-event-validation-schemata.ts new file mode 100644 index 0000000..5c588ce --- /dev/null +++ b/src/schemas/external-event-validation-schemata.ts @@ -0,0 +1,110 @@ +// a schema that describes the format for the attribute files (which are, themselves, JSON Schema-like) +export const attributeSchemaMetaschema = { + $defs: { + AttributeSchema: { + additionalProperties: false, + patternProperties: { + '^.*$': { + properties: { + attributes: { + additionalProperties: true, + type: 'object', + }, + required: { + items: { type: 'string' }, + type: 'array', + }, + type: { type: 'string' }, + }, + required: ['required', 'properties', 'type'], + type: 'object', + }, + }, + type: 'object', + }, + }, + $schema: 'http://json-schema.org/draft-07/schema', + additionalProperties: false, + anyOf: [ + {required: ['source_types']}, + {required: ['event_types']}, + {required: ['source_types', 'event_types']} + ], + description: 'Schema for the attributes of uploaded source types and/or event types.', + properties: { + event_types: { + $ref: '#/$defs/AttributeSchema', + }, + source_types: { + $ref: '#/$defs/AttributeSchema', + }, + }, + title: 'TypeSpecificationSchema', + type: 'object', +}; + +// the schema that schemas for specific types are integrated with, after pulling them from the database +export const baseExternalSourceSchema: { [key: string]: any } = { + $id: 'source_schema', + $schema: 'http://json-schema.org/draft-07/schema', + additionalProperties: false, + description: + 'The base schema for external sources. Defs and ifs, for specific source/event type attributes, are integrated later.', + properties: { + events: { + items: { + additionalProperties: false, + properties: { + attributes: { + type: 'object', + }, + duration: { type: 'string' }, + event_type_name: { type: 'string' }, + key: { type: 'string' }, + start_time: { type: 'string' }, + }, + required: ['duration', 'event_type_name', 'key', 'attributes', 'start_time'], + type: 'object', + }, + type: 'array', + }, + source: { + additionalProperties: false, + properties: { + attributes: { + type: 'object', // WILL BE REPLACED WITH A $ref + }, + derivation_group_name: { type: 'string' }, + key: { type: 'string' }, + period: { + additionalProperties: false, + properties: { + end_time: { + pattern: + '^(\\d){4}-([0-3][0-9])-([0-9][0-9])T([0-2][0-9]):([0-5][0-9]):([0-5][0-9])(\\+|-)([0-1][0-9]):([0-5][0-9])$', + type: 'string', + }, + start_time: { + pattern: + '^(\\d){4}-([0-3][0-9])-([0-9][0-9])T([0-2][0-9]):([0-5][0-9]):([0-5][0-9])(\\+|-)([0-1][0-9]):([0-5][0-9])$', + type: 'string', + }, + }, + required: ['start_time', 'end_time'], + type: 'object', + }, + source_type_name: { type: 'string' }, + valid_at: { + pattern: + '^(\\d){4}-([0-3][0-9])-([0-9][0-9])T([0-2][0-9]):([0-5][0-9]):([0-5][0-9])(\\+|-)([0-1][0-9]):([0-5][0-9])$', + type: 'string', + }, + }, + required: ['key', 'source_type_name', 'valid_at', 'period', 'attributes'], + type: 'object', + }, + }, + required: ['source', 'events'], + title: 'SourceTypeA', + type: 'object', +}; diff --git a/src/types/external-source.ts b/src/types/external-source.ts new file mode 100644 index 0000000..a66d18d --- /dev/null +++ b/src/types/external-source.ts @@ -0,0 +1,70 @@ +export type DerivationGroupInsertInput = { + name: string; + source_type_name: string; +}; + +export type ExternalSourceTypeInsertInput = { + name: string; + attribute_schema: object; +}; + +export type ExternalEventTypeInsertInput = { + name: string; + attribute_schema: object; +}; + +export type ExternalSourceInsertInput = { + attributes: object; + derivation_group_name: string; + end_time: string; + external_events: { + data: { + start_time: string; + duration: string; + event_type_name: string; + key: string; + }[]; + }; + key: string; + source_type_name: string; + start_time: string; + valid_at: string; +}; + +export type CreateExternalSourceResponse = { + createExternalSource: { name: string }; +}; + +export type CreateExternalSourceEventTypeResponse = { + createExternalEventTypes: { returning: string[] }; + createExternalSourceTypes: { returning: string[] }; +}; + +export type ExternalEventRequest = { + key: string; + event_type_name: string; + start_time: string; + duration: string; + attributes: object; +}; + +export type ExternalSourceRequest = { + attributes: object; + derivation_group_name: string; + key: string; + period: { + end_time: string; + start_time: string; + }; + source_type_name: string; + valid_at: string; +}; + +export type AttributeSchema = { + [x: string]: any; +}; + +export type GetSourceEventTypeAttributeSchemasResponse = { + external_event_type: ExternalEventTypeInsertInput[]; + external_source_type: ExternalSourceTypeInsertInput[]; +}; diff --git a/test/external-source.validation.test.ts b/test/external-source.validation.test.ts new file mode 100644 index 0000000..27d7d3a --- /dev/null +++ b/test/external-source.validation.test.ts @@ -0,0 +1,406 @@ +import Ajv from 'ajv'; +import { describe, expect, test } from 'vitest'; +import { attributeSchemaMetaschema } from '../src/schemas/external-event-validation-schemata'; +import { updateSchemaWithDefs } from '../src/packages/external-source/external-source'; + +const ajv = Ajv(); + +const attributeDefs = { + event_types: { + EventTypeA: { + properties: { + series: { + properties: { + iteration: { type: 'number' }, + make: { type: 'string' }, + type: { type: 'string' }, + }, + required: ['type', 'make', 'iteration'], + type: 'object', + }, + }, + required: ['series'], + type: 'object', + }, + EventTypeB: { + properties: { + projectUser: { + type: 'string', + }, + tick: { + type: 'number', + }, + }, + required: ['projectUser', 'tick'], + type: 'object', + }, + EventTypeC: { + properties: { + aperture: { + type: 'string', + }, + subduration: { + pattern: '^P(?:\\d+Y)?(?:\\d+M)?(?:\\d+D)?T(?:\\d+H)?(?:\\d+M)?(?:\\d+S)?$', + type: 'string', + }, + }, + required: ['aperture', 'subduration'], + type: 'object', + }, + }, + source_types: { + SourceTypeA: { + properties: { + version: { + type: 'number', + }, + wrkcat: { + type: 'string', + }, + }, + required: ['version', 'wrkcat'], + type: 'object', + }, + SourceTypeB: { + properties: { + version: { + type: 'number', + }, + wrkcat: { + type: 'string', + }, + }, + required: ['version', 'wrkcat'], + type: 'object', + }, + }, +}; + +const incorrectAttributeDefs = { + event_types: { + EventTypeA: { + properties: { + series: { + properties: { + iteration: { type: 'number' }, + make: { type: 'string' }, + type: { type: 'string' }, + }, + // "required": ["type", "make", "iteration"], // missing required field (not an issue) + type: 'object', + }, + }, + // "required": ["series"], // missing required field (the issue, only at level patternProperties/sdfdsf/required) + type: 'object', + }, + EventTypeB: { + properties: { + projectUser: { + type: 'string', + }, + tick: { + type: 'number', + }, + }, + required: ['projectUser', 'tick'], + type: 'object', + }, + EventTypeC: { + properties: { + aperture: { + type: 'string', + }, + subduration: { + pattern: '^P(?:\\d+Y)?(?:\\d+M)?(?:\\d+D)?T(?:\\d+H)?(?:\\d+M)?(?:\\d+S)?$', + type: 'string', + }, + }, + required: ['aperture', 'subduration'], + type: 'object', + }, + }, + source_types: { + SourceTypeA: { + properties: { + version: { + type: 'number', + }, + wrkcat: { + type: 'string', + }, + }, + required: ['version', 'wrkcat'], + type: 'object', + }, + SourceTypeB: { + properties: { + version: { + type: 'number', + }, + wrkcat: { + type: 'string', + }, + }, + required: ['version', 'wrkcat'], + type: 'object', + }, + }, +}; + +const correctExternalSource = { + events: [ + { + attributes: { + series: { + iteration: 17, + make: 'alpha', + type: 'A', + }, + }, + duration: '02:00:00', + event_type_name: 'EventTypeA', + key: 'EventTypeA:1/1', + start_time: '2024-01-01T01:35:00+00:00', + }, + { + attributes: { + series: { + iteration: 21, + make: 'beta', + type: 'B', + }, + }, + duration: '02:00:00', + event_type_name: 'EventTypeA', + key: 'EventTypeA:1/2', + start_time: '2024-01-02T11:50:00+00:00', + }, + { + attributes: { + projectUser: 'Jerry', + tick: 18, + }, + duration: '03:40:00', + event_type_name: 'EventTypeB', + key: 'EventTypeB:1/3', + start_time: '2024-01-03T15:20:00+00:00', + }, + ], + source: { + attributes: { + version: 1, + wrkcat: '234', + }, + key: 'SourceTypeA:valid_source_A.json', + period: { + end_time: '2024-01-07T00:00:00+00:00', + start_time: '2024-01-01T00:00:00+00:00', + }, + source_type_name: 'SourceTypeA', + valid_at: '2024-01-01T00:00:00+00:00', + }, +}; + +const incorrectExternalSourceAttributes = { + events: [ + { + attributes: { + series: { + iteration: 17, + make: 'alpha', + type: 'A', + }, + }, + duration: '02:00:00', + event_type_name: 'EventTypeA', + key: 'EventTypeA:1/1', + start_time: '2024-01-01T01:35:00+00:00', + }, + { + attributes: { + series: { + iteration: 21, + make: 'beta', + type: 'B', + }, + }, + duration: '02:00:00', + event_type_name: 'EventTypeA', + key: 'EventTypeA:1/2', + start_time: '2024-01-02T11:50:00+00:00', + }, + { + attributes: { + projectUser: 'Jerry', + tick: 18, + }, + duration: '03:40:00', + event_type_name: 'EventTypeB', + key: 'EventTypeB:1/3', + start_time: '2024-01-03T15:20:00+00:00', + }, + ], + source: { + attributes: { + version: 1, + wrkcat: 234, // <-- wrong type. expecting string. + }, + key: 'SourceTypeA:valid_source_A.json', + period: { + end_time: '2024-01-07T00:00:00+00:00', + start_time: '2024-01-01T00:00:00+00:00', + }, + source_type_name: 'SourceTypeA', + valid_at: '2024-01-01T00:00:00+00:00', + }, +}; + +const incorrectExternalEventAttributes = { + events: [ + { + attributes: { + series: { + iteration: 17, + make: 'alpha', + // "type": "A", <-- missing. + }, + }, + duration: '02:00:00', + event_type_name: 'EventTypeA', + key: 'EventTypeA:1/1', + start_time: '2024-01-01T01:35:00+00:00', + }, + { + attributes: { + series: { + iteration: 21, + make: 'beta', + type: 'B', + }, + }, + duration: '02:00:00', + event_type_name: 'EventTypeA', + key: 'EventTypeA:1/2', + start_time: '2024-01-02T11:50:00+00:00', + }, + { + attributes: { + projectUser: 'Jerry', + tick: 18, + }, + duration: '03:40:00', + event_type_name: 'EventTypeB', + key: 'EventTypeB:1/3', + start_time: '2024-01-03T15:20:00+00:00', + }, + ], + source: { + attributes: { + version: 1, + wrkcat: '234', + }, + key: 'SourceTypeA:valid_source_A.json', + period: { + end_time: '2024-01-07T00:00:00+00:00', + start_time: '2024-01-01T00:00:00+00:00', + }, + source_type_name: 'SourceTypeA', + valid_at: '2024-01-01T00:00:00+00:00', + }, +}; + +describe('validation tests', () => { + // test to verify source/event type file is correctly formatted + test('verify source/event type file is correctly formatted', () => { + // get the validator + const attributeValidator = ajv.compile(attributeSchemaMetaschema); + + // test it against a correct defs/attribute metaschema object + const result = attributeValidator(attributeDefs); + expect(result).toBeTruthy(); + expect(attributeValidator.errors).toBeNull(); + }); + + // test to verify source/event type file is incorrectly formatted + test('verify source/event type file is incorrectly formatted', () => { + // get the validator + const attributeValidator = ajv.compile(attributeSchemaMetaschema); + + // test it against a correct defs/attribute metaschema object + const result = attributeValidator(incorrectAttributeDefs); + expect(result).toBeFalsy(); + + const errors = attributeValidator.errors; + expect(errors?.length).toBe(1); + expect(errors?.at(0)?.schemaPath).toBe('#/$defs/AttributeSchema/patternProperties/%5E.*%24/required'); + expect(errors?.at(0)?.message).toMatch("should have required property 'required'"); + }); + + // test to verify that composition of a base schema with attribute schemas work + test('verify validation functionality of updateSchemaWithDefs', () => { + // transform attributeDefs to match something that might come from hasura (just ONE source type, as we will be constructing a schema for a specific source) + const attributeSchema: { event_types: any; source_type: any } = { + event_types: [], + source_type: {}, + }; + attributeSchema.event_types = attributeDefs.event_types; + attributeSchema.source_type['SourceTypeA'] = attributeDefs.source_types.SourceTypeA; + + // construct a megaschema + const schemaFunctionWithDefs = updateSchemaWithDefs(attributeSchema); + const schema: any = schemaFunctionWithDefs.schema; + expect(schema).toBeTruthy(); + + if (schema) { + // verify it is formatted correctly + expect(Object.keys(schema.$defs.event_types)).toMatchObject(['EventTypeA', 'EventTypeB', 'EventTypeC']); + expect(Object.keys(schema.$defs.source_type)).toMatchObject(['SourceTypeA']); + expect(schema.properties.events.items.else.else.properties.attributes.$ref).toEqual( + '#/$defs/event_types/EventTypeC', + ); + } + }); + + // source testing + describe('validating (and failing) sources', () => { + // transform attributeDefs to match something that might come from hasura (just ONE source type, as we will be constructing a schema for a specific source) + const attributeSchema: { event_types: any; source_type: any } = { + event_types: [], + source_type: {}, + }; + attributeSchema.event_types = attributeDefs.event_types; + attributeSchema.source_type['SourceTypeA'] = attributeDefs.source_types.SourceTypeA; + + // construct a megaschema + const schemaFunctionWithDefs = updateSchemaWithDefs(attributeSchema); + + // test to verify a source's (and all events') attributes are correctly formatted + test('source and event attributes are correct', () => { + const result = schemaFunctionWithDefs(correctExternalSource); + expect(result).toBeTruthy(); + expect(schemaFunctionWithDefs.errors).toBeNull(); + }); + + // test to verify a source's attributes are incorrectly formatted + test('source attributes fail when incorrectly formatted', () => { + const result = schemaFunctionWithDefs(incorrectExternalSourceAttributes); + expect(result).toBeFalsy(); + + const errors = schemaFunctionWithDefs.errors; + expect(errors?.length).toBe(1); + expect(errors?.at(0)?.schemaPath).toBe('#/$defs/source_type/SourceTypeA/properties/wrkcat/type'); + expect(errors?.at(0)?.message).toMatch('should be string'); + }); + + // test to verify an event's attributes are incorrectly formatted + test('event attributes fail when incorrectly formatted', () => { + const result = schemaFunctionWithDefs(incorrectExternalEventAttributes); + expect(result).toBeFalsy(); + + const errors = schemaFunctionWithDefs.errors; + expect(errors?.length).toBe(1); + expect(errors?.at(0)?.schemaPath).toBe('#/$defs/event_types/EventTypeA/properties/series/required'); + expect(errors?.at(0)?.message).toMatch("should have required property 'type'"); + }); + }); +});