diff --git a/package.json b/package.json index ffef9c2..01d366b 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "@biomejs/biome": "1.9.4", "@commitlint/cli": "^19.5.0", "@commitlint/config-conventional": "^19.5.0", - "@types/node": "^22.8.6", + "@types/node": "^22.9.0", "husky": "^9.1.6", "lint-staged": "^15.2.10", "typescript": "^5.6.3", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a3ef9b3..064a3c6 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -13,13 +13,13 @@ importers: version: 1.9.4 '@commitlint/cli': specifier: ^19.5.0 - version: 19.5.0(@types/node@22.8.6)(typescript@5.6.3) + version: 19.5.0(@types/node@22.9.0)(typescript@5.6.3) '@commitlint/config-conventional': specifier: ^19.5.0 version: 19.5.0 '@types/node': - specifier: ^22.8.6 - version: 22.8.6 + specifier: ^22.9.0 + version: 22.9.0 husky: specifier: ^9.1.6 version: 9.1.6 @@ -31,7 +31,7 @@ importers: version: 5.6.3 vitest: specifier: ^2.1.4 - version: 2.1.4(@types/node@22.8.6) + version: 2.1.4(@types/node@22.9.0) packages: @@ -306,93 +306,93 @@ packages: '@jridgewell/sourcemap-codec@1.5.0': resolution: {integrity: sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==} - '@rollup/rollup-android-arm-eabi@4.24.3': - resolution: {integrity: sha512-ufb2CH2KfBWPJok95frEZZ82LtDl0A6QKTa8MoM+cWwDZvVGl5/jNb79pIhRvAalUu+7LD91VYR0nwRD799HkQ==} + '@rollup/rollup-android-arm-eabi@4.24.4': + resolution: {integrity: sha512-jfUJrFct/hTA0XDM5p/htWKoNNTbDLY0KRwEt6pyOA6k2fmk0WVwl65PdUdJZgzGEHWx+49LilkcSaumQRyNQw==} cpu: [arm] os: [android] - '@rollup/rollup-android-arm64@4.24.3': - resolution: {integrity: sha512-iAHpft/eQk9vkWIV5t22V77d90CRofgR2006UiCjHcHJFVI1E0oBkQIAbz+pLtthFw3hWEmVB4ilxGyBf48i2Q==} + '@rollup/rollup-android-arm64@4.24.4': + resolution: {integrity: sha512-j4nrEO6nHU1nZUuCfRKoCcvh7PIywQPUCBa2UsootTHvTHIoIu2BzueInGJhhvQO/2FTRdNYpf63xsgEqH9IhA==} cpu: [arm64] os: [android] - '@rollup/rollup-darwin-arm64@4.24.3': - resolution: {integrity: sha512-QPW2YmkWLlvqmOa2OwrfqLJqkHm7kJCIMq9kOz40Zo9Ipi40kf9ONG5Sz76zszrmIZZ4hgRIkez69YnTHgEz1w==} + '@rollup/rollup-darwin-arm64@4.24.4': + resolution: {integrity: sha512-GmU/QgGtBTeraKyldC7cDVVvAJEOr3dFLKneez/n7BvX57UdhOqDsVwzU7UOnYA7AAOt+Xb26lk79PldDHgMIQ==} cpu: [arm64] os: [darwin] - '@rollup/rollup-darwin-x64@4.24.3': - resolution: {integrity: sha512-KO0pN5x3+uZm1ZXeIfDqwcvnQ9UEGN8JX5ufhmgH5Lz4ujjZMAnxQygZAVGemFWn+ZZC0FQopruV4lqmGMshow==} + '@rollup/rollup-darwin-x64@4.24.4': + resolution: {integrity: sha512-N6oDBiZCBKlwYcsEPXGDE4g9RoxZLK6vT98M8111cW7VsVJFpNEqvJeIPfsCzbf0XEakPslh72X0gnlMi4Ddgg==} cpu: [x64] os: [darwin] - '@rollup/rollup-freebsd-arm64@4.24.3': - resolution: {integrity: sha512-CsC+ZdIiZCZbBI+aRlWpYJMSWvVssPuWqrDy/zi9YfnatKKSLFCe6fjna1grHuo/nVaHG+kiglpRhyBQYRTK4A==} + '@rollup/rollup-freebsd-arm64@4.24.4': + resolution: {integrity: sha512-py5oNShCCjCyjWXCZNrRGRpjWsF0ic8f4ieBNra5buQz0O/U6mMXCpC1LvrHuhJsNPgRt36tSYMidGzZiJF6mw==} cpu: [arm64] os: [freebsd] - '@rollup/rollup-freebsd-x64@4.24.3': - resolution: {integrity: sha512-F0nqiLThcfKvRQhZEzMIXOQG4EeX61im61VYL1jo4eBxv4aZRmpin6crnBJQ/nWnCsjH5F6J3W6Stdm0mBNqBg==} + '@rollup/rollup-freebsd-x64@4.24.4': + resolution: {integrity: sha512-L7VVVW9FCnTTp4i7KrmHeDsDvjB4++KOBENYtNYAiYl96jeBThFfhP6HVxL74v4SiZEVDH/1ILscR5U9S4ms4g==} cpu: [x64] os: [freebsd] - '@rollup/rollup-linux-arm-gnueabihf@4.24.3': - resolution: {integrity: sha512-KRSFHyE/RdxQ1CSeOIBVIAxStFC/hnBgVcaiCkQaVC+EYDtTe4X7z5tBkFyRoBgUGtB6Xg6t9t2kulnX6wJc6A==} + '@rollup/rollup-linux-arm-gnueabihf@4.24.4': + resolution: {integrity: sha512-10ICosOwYChROdQoQo589N5idQIisxjaFE/PAnX2i0Zr84mY0k9zul1ArH0rnJ/fpgiqfu13TFZR5A5YJLOYZA==} cpu: [arm] os: [linux] - '@rollup/rollup-linux-arm-musleabihf@4.24.3': - resolution: {integrity: sha512-h6Q8MT+e05zP5BxEKz0vi0DhthLdrNEnspdLzkoFqGwnmOzakEHSlXfVyA4HJ322QtFy7biUAVFPvIDEDQa6rw==} + '@rollup/rollup-linux-arm-musleabihf@4.24.4': + resolution: {integrity: sha512-ySAfWs69LYC7QhRDZNKqNhz2UKN8LDfbKSMAEtoEI0jitwfAG2iZwVqGACJT+kfYvvz3/JgsLlcBP+WWoKCLcw==} cpu: [arm] os: [linux] - '@rollup/rollup-linux-arm64-gnu@4.24.3': - resolution: {integrity: sha512-fKElSyXhXIJ9pqiYRqisfirIo2Z5pTTve5K438URf08fsypXrEkVmShkSfM8GJ1aUyvjakT+fn2W7Czlpd/0FQ==} + '@rollup/rollup-linux-arm64-gnu@4.24.4': + resolution: {integrity: sha512-uHYJ0HNOI6pGEeZ/5mgm5arNVTI0nLlmrbdph+pGXpC9tFHFDQmDMOEqkmUObRfosJqpU8RliYoGz06qSdtcjg==} cpu: [arm64] os: [linux] - '@rollup/rollup-linux-arm64-musl@4.24.3': - resolution: {integrity: sha512-YlddZSUk8G0px9/+V9PVilVDC6ydMz7WquxozToozSnfFK6wa6ne1ATUjUvjin09jp34p84milxlY5ikueoenw==} + '@rollup/rollup-linux-arm64-musl@4.24.4': + resolution: {integrity: sha512-38yiWLemQf7aLHDgTg85fh3hW9stJ0Muk7+s6tIkSUOMmi4Xbv5pH/5Bofnsb6spIwD5FJiR+jg71f0CH5OzoA==} cpu: [arm64] os: [linux] - '@rollup/rollup-linux-powerpc64le-gnu@4.24.3': - resolution: {integrity: sha512-yNaWw+GAO8JjVx3s3cMeG5Esz1cKVzz8PkTJSfYzE5u7A+NvGmbVFEHP+BikTIyYWuz0+DX9kaA3pH9Sqxp69g==} + '@rollup/rollup-linux-powerpc64le-gnu@4.24.4': + resolution: {integrity: sha512-q73XUPnkwt9ZNF2xRS4fvneSuaHw2BXuV5rI4cw0fWYVIWIBeDZX7c7FWhFQPNTnE24172K30I+dViWRVD9TwA==} cpu: [ppc64] os: [linux] - '@rollup/rollup-linux-riscv64-gnu@4.24.3': - resolution: {integrity: sha512-lWKNQfsbpv14ZCtM/HkjCTm4oWTKTfxPmr7iPfp3AHSqyoTz5AgLemYkWLwOBWc+XxBbrU9SCokZP0WlBZM9lA==} + '@rollup/rollup-linux-riscv64-gnu@4.24.4': + resolution: {integrity: sha512-Aie/TbmQi6UXokJqDZdmTJuZBCU3QBDA8oTKRGtd4ABi/nHgXICulfg1KI6n9/koDsiDbvHAiQO3YAUNa/7BCw==} cpu: [riscv64] os: [linux] - '@rollup/rollup-linux-s390x-gnu@4.24.3': - resolution: {integrity: sha512-HoojGXTC2CgCcq0Woc/dn12wQUlkNyfH0I1ABK4Ni9YXyFQa86Fkt2Q0nqgLfbhkyfQ6003i3qQk9pLh/SpAYw==} + '@rollup/rollup-linux-s390x-gnu@4.24.4': + resolution: {integrity: sha512-P8MPErVO/y8ohWSP9JY7lLQ8+YMHfTI4bAdtCi3pC2hTeqFJco2jYspzOzTUB8hwUWIIu1xwOrJE11nP+0JFAQ==} cpu: [s390x] os: [linux] - '@rollup/rollup-linux-x64-gnu@4.24.3': - resolution: {integrity: sha512-mnEOh4iE4USSccBOtcrjF5nj+5/zm6NcNhbSEfR3Ot0pxBwvEn5QVUXcuOwwPkapDtGZ6pT02xLoPaNv06w7KQ==} + '@rollup/rollup-linux-x64-gnu@4.24.4': + resolution: {integrity: sha512-K03TljaaoPK5FOyNMZAAEmhlyO49LaE4qCsr0lYHUKyb6QacTNF9pnfPpXnFlFD3TXuFbFbz7tJ51FujUXkXYA==} cpu: [x64] os: [linux] - '@rollup/rollup-linux-x64-musl@4.24.3': - resolution: {integrity: sha512-rMTzawBPimBQkG9NKpNHvquIUTQPzrnPxPbCY1Xt+mFkW7pshvyIS5kYgcf74goxXOQk0CP3EoOC1zcEezKXhw==} + '@rollup/rollup-linux-x64-musl@4.24.4': + resolution: {integrity: sha512-VJYl4xSl/wqG2D5xTYncVWW+26ICV4wubwN9Gs5NrqhJtayikwCXzPL8GDsLnaLU3WwhQ8W02IinYSFJfyo34Q==} cpu: [x64] os: [linux] - '@rollup/rollup-win32-arm64-msvc@4.24.3': - resolution: {integrity: sha512-2lg1CE305xNvnH3SyiKwPVsTVLCg4TmNCF1z7PSHX2uZY2VbUpdkgAllVoISD7JO7zu+YynpWNSKAtOrX3AiuA==} + '@rollup/rollup-win32-arm64-msvc@4.24.4': + resolution: {integrity: sha512-ku2GvtPwQfCqoPFIJCqZ8o7bJcj+Y54cZSr43hHca6jLwAiCbZdBUOrqE6y29QFajNAzzpIOwsckaTFmN6/8TA==} cpu: [arm64] os: [win32] - '@rollup/rollup-win32-ia32-msvc@4.24.3': - resolution: {integrity: sha512-9SjYp1sPyxJsPWuhOCX6F4jUMXGbVVd5obVpoVEi8ClZqo52ViZewA6eFz85y8ezuOA+uJMP5A5zo6Oz4S5rVQ==} + '@rollup/rollup-win32-ia32-msvc@4.24.4': + resolution: {integrity: sha512-V3nCe+eTt/W6UYNr/wGvO1fLpHUrnlirlypZfKCT1fG6hWfqhPgQV/K/mRBXBpxc0eKLIF18pIOFVPh0mqHjlg==} cpu: [ia32] os: [win32] - '@rollup/rollup-win32-x64-msvc@4.24.3': - resolution: {integrity: sha512-HGZgRFFYrMrP3TJlq58nR1xy8zHKId25vhmm5S9jETEfDf6xybPxsavFTJaufe2zgOGYJBskGlj49CwtEuFhWQ==} + '@rollup/rollup-win32-x64-msvc@4.24.4': + resolution: {integrity: sha512-LTw1Dfd0mBIEqUVCxbvTE/LLo+9ZxVC9k99v1v4ahg9Aak6FpqOfNu5kRkeTAn0wphoC4JU7No1/rL+bBCEwhg==} cpu: [x64] os: [win32] @@ -402,8 +402,8 @@ packages: '@types/estree@1.0.6': resolution: {integrity: sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==} - '@types/node@22.8.6': - resolution: {integrity: sha512-tosuJYKrIqjQIlVCM4PEGxOmyg3FCPa/fViuJChnGeEIhjA46oy8FMVoF9su1/v8PNs2a8Q0iFNyOx0uOF91nw==} + '@types/node@22.9.0': + resolution: {integrity: sha512-vuyHg81vvWA1Z1ELfvLko2c8f34gyA0zaic0+Rllc5lbCnbSyuvb2Oxpm6TAUAC/2xZN3QGqxBNggD1nNR2AfQ==} '@vitest/expect@2.1.4': resolution: {integrity: sha512-DOETT0Oh1avie/D/o2sgMHGrzYUFFo3zqESB2Hn70z6QB1HrS2IQ9z5DfyTqU8sg4Bpu13zZe9V4+UTNQlUeQA==} @@ -907,8 +907,8 @@ packages: rfdc@1.4.1: resolution: {integrity: sha512-q1b3N5QkRUWUl7iyylaaj3kOpIT0N2i9MqIEQXP73GVsN9cw3fdx8X63cEmWhJGi2PPCF23Ijp7ktmd39rawIA==} - rollup@4.24.3: - resolution: {integrity: sha512-HBW896xR5HGmoksbi3JBDtmVzWiPAYqp7wip50hjQ67JbDz61nyoMPdqu1DvVW9asYb2M65Z20ZHsyJCMqMyDg==} + rollup@4.24.4: + resolution: {integrity: sha512-vGorVWIsWfX3xbcyAS+I047kFKapHYivmkaT63Smj77XwvLSJos6M1xGqZnBPFQFBRZDOcG1QnYEIxAvTr/HjA==} engines: {node: '>=18.0.0', npm: '>=8.0.0'} hasBin: true @@ -1164,11 +1164,11 @@ snapshots: '@biomejs/cli-win32-x64@1.9.4': optional: true - '@commitlint/cli@19.5.0(@types/node@22.8.6)(typescript@5.6.3)': + '@commitlint/cli@19.5.0(@types/node@22.9.0)(typescript@5.6.3)': dependencies: '@commitlint/format': 19.5.0 '@commitlint/lint': 19.5.0 - '@commitlint/load': 19.5.0(@types/node@22.8.6)(typescript@5.6.3) + '@commitlint/load': 19.5.0(@types/node@22.9.0)(typescript@5.6.3) '@commitlint/read': 19.5.0 '@commitlint/types': 19.5.0 tinyexec: 0.3.1 @@ -1215,7 +1215,7 @@ snapshots: '@commitlint/rules': 19.5.0 '@commitlint/types': 19.5.0 - '@commitlint/load@19.5.0(@types/node@22.8.6)(typescript@5.6.3)': + '@commitlint/load@19.5.0(@types/node@22.9.0)(typescript@5.6.3)': dependencies: '@commitlint/config-validator': 19.5.0 '@commitlint/execute-rule': 19.5.0 @@ -1223,7 +1223,7 @@ snapshots: '@commitlint/types': 19.5.0 chalk: 5.3.0 cosmiconfig: 9.0.0(typescript@5.6.3) - cosmiconfig-typescript-loader: 5.1.0(@types/node@22.8.6)(cosmiconfig@9.0.0(typescript@5.6.3))(typescript@5.6.3) + cosmiconfig-typescript-loader: 5.1.0(@types/node@22.9.0)(cosmiconfig@9.0.0(typescript@5.6.3))(typescript@5.6.3) lodash.isplainobject: 4.0.6 lodash.merge: 4.6.2 lodash.uniq: 4.5.0 @@ -1345,67 +1345,67 @@ snapshots: '@jridgewell/sourcemap-codec@1.5.0': {} - '@rollup/rollup-android-arm-eabi@4.24.3': + '@rollup/rollup-android-arm-eabi@4.24.4': optional: true - '@rollup/rollup-android-arm64@4.24.3': + '@rollup/rollup-android-arm64@4.24.4': optional: true - '@rollup/rollup-darwin-arm64@4.24.3': + '@rollup/rollup-darwin-arm64@4.24.4': optional: true - '@rollup/rollup-darwin-x64@4.24.3': + '@rollup/rollup-darwin-x64@4.24.4': optional: true - '@rollup/rollup-freebsd-arm64@4.24.3': + '@rollup/rollup-freebsd-arm64@4.24.4': optional: true - '@rollup/rollup-freebsd-x64@4.24.3': + '@rollup/rollup-freebsd-x64@4.24.4': optional: true - '@rollup/rollup-linux-arm-gnueabihf@4.24.3': + '@rollup/rollup-linux-arm-gnueabihf@4.24.4': optional: true - '@rollup/rollup-linux-arm-musleabihf@4.24.3': + '@rollup/rollup-linux-arm-musleabihf@4.24.4': optional: true - '@rollup/rollup-linux-arm64-gnu@4.24.3': + '@rollup/rollup-linux-arm64-gnu@4.24.4': optional: true - '@rollup/rollup-linux-arm64-musl@4.24.3': + '@rollup/rollup-linux-arm64-musl@4.24.4': optional: true - '@rollup/rollup-linux-powerpc64le-gnu@4.24.3': + '@rollup/rollup-linux-powerpc64le-gnu@4.24.4': optional: true - '@rollup/rollup-linux-riscv64-gnu@4.24.3': + '@rollup/rollup-linux-riscv64-gnu@4.24.4': optional: true - '@rollup/rollup-linux-s390x-gnu@4.24.3': + '@rollup/rollup-linux-s390x-gnu@4.24.4': optional: true - '@rollup/rollup-linux-x64-gnu@4.24.3': + '@rollup/rollup-linux-x64-gnu@4.24.4': optional: true - '@rollup/rollup-linux-x64-musl@4.24.3': + '@rollup/rollup-linux-x64-musl@4.24.4': optional: true - '@rollup/rollup-win32-arm64-msvc@4.24.3': + '@rollup/rollup-win32-arm64-msvc@4.24.4': optional: true - '@rollup/rollup-win32-ia32-msvc@4.24.3': + '@rollup/rollup-win32-ia32-msvc@4.24.4': optional: true - '@rollup/rollup-win32-x64-msvc@4.24.3': + '@rollup/rollup-win32-x64-msvc@4.24.4': optional: true '@types/conventional-commits-parser@5.0.0': dependencies: - '@types/node': 22.8.6 + '@types/node': 22.9.0 '@types/estree@1.0.6': {} - '@types/node@22.8.6': + '@types/node@22.9.0': dependencies: undici-types: 6.19.8 @@ -1416,13 +1416,13 @@ snapshots: chai: 5.1.2 tinyrainbow: 1.2.0 - '@vitest/mocker@2.1.4(vite@5.4.10(@types/node@22.8.6))': + '@vitest/mocker@2.1.4(vite@5.4.10(@types/node@22.9.0))': dependencies: '@vitest/spy': 2.1.4 estree-walker: 3.0.3 magic-string: 0.30.12 optionalDependencies: - vite: 5.4.10(@types/node@22.8.6) + vite: 5.4.10(@types/node@22.9.0) '@vitest/pretty-format@2.1.4': dependencies: @@ -1546,9 +1546,9 @@ snapshots: meow: 12.1.1 split2: 4.2.0 - cosmiconfig-typescript-loader@5.1.0(@types/node@22.8.6)(cosmiconfig@9.0.0(typescript@5.6.3))(typescript@5.6.3): + cosmiconfig-typescript-loader@5.1.0(@types/node@22.9.0)(cosmiconfig@9.0.0(typescript@5.6.3))(typescript@5.6.3): dependencies: - '@types/node': 22.8.6 + '@types/node': 22.9.0 cosmiconfig: 9.0.0(typescript@5.6.3) jiti: 1.21.6 typescript: 5.6.3 @@ -1873,28 +1873,28 @@ snapshots: rfdc@1.4.1: {} - rollup@4.24.3: + rollup@4.24.4: dependencies: '@types/estree': 1.0.6 optionalDependencies: - '@rollup/rollup-android-arm-eabi': 4.24.3 - '@rollup/rollup-android-arm64': 4.24.3 - '@rollup/rollup-darwin-arm64': 4.24.3 - '@rollup/rollup-darwin-x64': 4.24.3 - '@rollup/rollup-freebsd-arm64': 4.24.3 - '@rollup/rollup-freebsd-x64': 4.24.3 - '@rollup/rollup-linux-arm-gnueabihf': 4.24.3 - '@rollup/rollup-linux-arm-musleabihf': 4.24.3 - '@rollup/rollup-linux-arm64-gnu': 4.24.3 - '@rollup/rollup-linux-arm64-musl': 4.24.3 - '@rollup/rollup-linux-powerpc64le-gnu': 4.24.3 - '@rollup/rollup-linux-riscv64-gnu': 4.24.3 - '@rollup/rollup-linux-s390x-gnu': 4.24.3 - '@rollup/rollup-linux-x64-gnu': 4.24.3 - '@rollup/rollup-linux-x64-musl': 4.24.3 - '@rollup/rollup-win32-arm64-msvc': 4.24.3 - '@rollup/rollup-win32-ia32-msvc': 4.24.3 - '@rollup/rollup-win32-x64-msvc': 4.24.3 + '@rollup/rollup-android-arm-eabi': 4.24.4 + '@rollup/rollup-android-arm64': 4.24.4 + '@rollup/rollup-darwin-arm64': 4.24.4 + '@rollup/rollup-darwin-x64': 4.24.4 + '@rollup/rollup-freebsd-arm64': 4.24.4 + '@rollup/rollup-freebsd-x64': 4.24.4 + '@rollup/rollup-linux-arm-gnueabihf': 4.24.4 + '@rollup/rollup-linux-arm-musleabihf': 4.24.4 + '@rollup/rollup-linux-arm64-gnu': 4.24.4 + '@rollup/rollup-linux-arm64-musl': 4.24.4 + '@rollup/rollup-linux-powerpc64le-gnu': 4.24.4 + '@rollup/rollup-linux-riscv64-gnu': 4.24.4 + '@rollup/rollup-linux-s390x-gnu': 4.24.4 + '@rollup/rollup-linux-x64-gnu': 4.24.4 + '@rollup/rollup-linux-x64-musl': 4.24.4 + '@rollup/rollup-win32-arm64-msvc': 4.24.4 + '@rollup/rollup-win32-ia32-msvc': 4.24.4 + '@rollup/rollup-win32-x64-msvc': 4.24.4 fsevents: 2.3.3 semver@7.6.3: {} @@ -1975,12 +1975,12 @@ snapshots: unicorn-magic@0.1.0: {} - vite-node@2.1.4(@types/node@22.8.6): + vite-node@2.1.4(@types/node@22.9.0): dependencies: cac: 6.7.14 debug: 4.3.7 pathe: 1.1.2 - vite: 5.4.10(@types/node@22.8.6) + vite: 5.4.10(@types/node@22.9.0) transitivePeerDependencies: - '@types/node' - less @@ -1992,19 +1992,19 @@ snapshots: - supports-color - terser - vite@5.4.10(@types/node@22.8.6): + vite@5.4.10(@types/node@22.9.0): dependencies: esbuild: 0.21.5 postcss: 8.4.47 - rollup: 4.24.3 + rollup: 4.24.4 optionalDependencies: - '@types/node': 22.8.6 + '@types/node': 22.9.0 fsevents: 2.3.3 - vitest@2.1.4(@types/node@22.8.6): + vitest@2.1.4(@types/node@22.9.0): dependencies: '@vitest/expect': 2.1.4 - '@vitest/mocker': 2.1.4(vite@5.4.10(@types/node@22.8.6)) + '@vitest/mocker': 2.1.4(vite@5.4.10(@types/node@22.9.0)) '@vitest/pretty-format': 2.1.4 '@vitest/runner': 2.1.4 '@vitest/snapshot': 2.1.4 @@ -2020,11 +2020,11 @@ snapshots: tinyexec: 0.3.1 tinypool: 1.0.1 tinyrainbow: 1.2.0 - vite: 5.4.10(@types/node@22.8.6) - vite-node: 2.1.4(@types/node@22.8.6) + vite: 5.4.10(@types/node@22.9.0) + vite-node: 2.1.4(@types/node@22.9.0) why-is-node-running: 2.3.0 optionalDependencies: - '@types/node': 22.8.6 + '@types/node': 22.9.0 transitivePeerDependencies: - less - lightningcss diff --git a/src/commands/applications/chat.ts b/src/commands/applications/chat.ts index 2bfd9c2..b042f10 100644 --- a/src/commands/applications/chat.ts +++ b/src/commands/applications/chat.ts @@ -8,8 +8,6 @@ import type { SeyfertBaseChoiceableOption, SeyfertBasicOption, SeyfertChoice, - SeyfertNumberOption, - SeyfertStringOption, } from '../..'; import type { Attachment } from '../../builders'; import type { @@ -37,6 +35,7 @@ import type { IgnoreCommand, OnOptionsReturnObject, PassFunction, + SeyfertChannelMap, StopFunction, UsingClient, } from './shared'; @@ -84,17 +83,19 @@ type ContextOptionsAuxInternal< ? Parameters[1]>[0] : NonNullable extends (...args: any) => any ? Parameters>[1]>[0] extends never - ? T extends SeyfertStringOption | SeyfertNumberOption - ? NonNullable extends SeyfertChoice[] - ? NonNullable[number]['value'] - : ReturnOptionsTypes[T['type']] - : ReturnOptionsTypes[T['type']] + ? T extends { channel_types?: infer C } + ? C extends any[] + ? C[number] extends keyof SeyfertChannelMap + ? SeyfertChannelMap[C[number]] + : never + : never + : T extends { choices?: infer C } + ? C extends SeyfertChoice[] + ? C[number]['value'] + : never + : never : Parameters>[1]>[0] - : T extends SeyfertStringOption | SeyfertNumberOption - ? NonNullable extends SeyfertChoice[] - ? NonNullable[number]['value'] - : ReturnOptionsTypes[T['type']] - : ReturnOptionsTypes[T['type']]; + : ReturnOptionsTypes[T['type']]; type ContextOptionsAux = { [K in Exclude>]: ContextOptionsAuxInternal; diff --git a/src/commands/applications/options.ts b/src/commands/applications/options.ts index 9ccbb93..06691a9 100644 --- a/src/commands/applications/options.ts +++ b/src/commands/applications/options.ts @@ -13,11 +13,10 @@ import { type APIApplicationCommandBasicOption, type APIApplicationCommandOptionChoice, ApplicationCommandOptionType, - type ChannelType, } from '../../types'; import type { LocalizationMap } from '../../types/payloads'; import type { CommandContext } from './chatcontext'; -import type { DefaultLocale, MiddlewareContext, OKFunction, StopFunction } from './shared'; +import type { DefaultLocale, MiddlewareContext, OKFunction, SeyfertChannelMap, StopFunction } from './shared'; export interface SeyfertBasicOption { required?: R; @@ -77,7 +76,7 @@ export interface ChoiceableValues { export type ValueCallback< T extends keyof ReturnOptionsTypes, - C = T extends ChoiceableTypes ? SeyfertChoice[] : never, + C = T extends ChoiceableTypes ? SeyfertChoice[] : keyof SeyfertChannelMap, I = any, > = ( data: { @@ -86,9 +85,11 @@ export type ValueCallback< ? C extends SeyfertChoice[] ? C[number]['value'] extends ReturnOptionsTypes[T] ? C[number]['value'] - : ReturnOptionsTypes[T] - : ReturnOptionsTypes[T] - : ReturnOptionsTypes[T]; + : never + : never + : C extends keyof SeyfertChannelMap + ? SeyfertChannelMap[C] + : never; }, ok: OKFunction, fail: StopFunction, @@ -129,8 +130,17 @@ export type SeyfertNumberOption[], R = boolean, VC = n }; export type SeyfertBooleanOption = SeyfertBasicOption; export type SeyfertUserOption = SeyfertBasicOption; -export type SeyfertChannelOption = SeyfertBasicOption & { - channel_types?: ChannelType[]; +export type SeyfertChannelOption = { + required?: R; + value?: ValueCallback; + description: string; + description_localizations?: APIApplicationCommandBasicOption['description_localizations']; + name_localizations?: APIApplicationCommandBasicOption['name_localizations']; + locales?: { + name?: FlatObjectKeys; + description?: FlatObjectKeys; + }; + channel_types?: C[]; }; export type SeyfertRoleOption = SeyfertBasicOption; export type SeyfertMentionableOption = SeyfertBasicOption; @@ -160,6 +170,14 @@ export function createNumberOption< return { ...data, type: ApplicationCommandOptionType.Number } as const; } +export function createChannelOption< + R extends boolean, + C extends keyof SeyfertChannelMap = keyof SeyfertChannelMap, + VC = never, +>(data: SeyfertChannelOption) { + return { ...data, type: ApplicationCommandOptionType.Channel } as const; +} + export function createBooleanOption = SeyfertBooleanOption>( data: T, ) { @@ -170,12 +188,6 @@ export function createUserOption = SeyfertChannelOption>( - data: T, -) { - return { ...data, type: ApplicationCommandOptionType.Channel } as const; -} - export function createRoleOption = SeyfertRoleOption>(data: T) { return { ...data, type: ApplicationCommandOptionType.Role } as const; } diff --git a/src/commands/applications/shared.ts b/src/commands/applications/shared.ts index a89d840..ad3f426 100644 --- a/src/commands/applications/shared.ts +++ b/src/commands/applications/shared.ts @@ -1,6 +1,18 @@ +import type { + CategoryChannelStructure, + DMChannelStructure, + DirectoryChannelStructure, + ForumChannelStructure, + MediaChannelStructure, + NewsChannelStructure, + StageChannelStructure, + TextGuildChannelStructure, + ThreadChannelStructure, + VoiceChannelStructure, +} from '../../client'; import type { BaseClient } from '../../client/base'; import type { IsStrictlyUndefined } from '../../common'; -import type { ChannelType } from '../../types'; +import { ChannelType } from '../../types'; import type { RegisteredMiddlewares } from '../decorators'; export type OKFunction = (value: T) => void; @@ -80,3 +92,19 @@ export enum IgnoreCommand { Slash = 0, Message = 1, } + +export interface SeyfertChannelMap { + [ChannelType.GuildText]: TextGuildChannelStructure; + [ChannelType.DM]: DMChannelStructure; + [ChannelType.GuildVoice]: VoiceChannelStructure; + [ChannelType.GroupDM]: DMChannelStructure; + [ChannelType.GuildCategory]: CategoryChannelStructure; + [ChannelType.GuildAnnouncement]: NewsChannelStructure; + [ChannelType.AnnouncementThread]: ThreadChannelStructure; + [ChannelType.PublicThread]: ThreadChannelStructure; + [ChannelType.PrivateThread]: ThreadChannelStructure; + [ChannelType.GuildStageVoice]: StageChannelStructure; + [ChannelType.GuildDirectory]: DirectoryChannelStructure; + [ChannelType.GuildForum]: ForumChannelStructure; + [ChannelType.GuildMedia]: MediaChannelStructure; +} diff --git a/src/structures/channels.ts b/src/structures/channels.ts index 0939e92..aea63a4 100644 --- a/src/structures/channels.ts +++ b/src/structures/channels.ts @@ -58,7 +58,7 @@ import type { GuildMember } from './GuildMember'; import type { GuildRole } from './GuildRole'; import { DiscordBase } from './extra/DiscordBase'; -export class BaseChannel extends DiscordBase> { +export class BaseNoEditableChannel extends DiscordBase> { declare type: T; constructor(client: UsingClient, data: APIChannelBase) { @@ -84,13 +84,6 @@ export class BaseChannel extends DiscordBase extends DiscordBase extends BaseNoEditableChannel { + edit(body: RESTPatchAPIChannelJSONBody, reason?: string) { + return this.client.channels.edit(this.id, body, { + reason, + guildId: 'guildId' in this ? (this.guildId as string) : '@me', + }); + } +} + interface IChannelTypes { GuildStageVoice: StageChannel; GuildMedia: MediaChannel; @@ -225,7 +227,7 @@ export class BaseGuildChannel extends BaseChannel { } } -export interface MessagesMethods extends BaseChannel {} +export interface MessagesMethods extends BaseNoEditableChannel {} export class MessagesMethods extends DiscordBase { typing() { return this.client.channels.typing(this.id); @@ -467,12 +469,9 @@ export class TextGuildChannel extends BaseGuildChannel { } } -export interface DMChannel extends ObjectToLower, Omit {} +export interface DMChannel extends ObjectToLower, MessagesMethods {} @mix(MessagesMethods) -export class DMChannel extends (BaseChannel as unknown as ToClass< - Omit, 'edit'>, - DMChannel ->) { +export class DMChannel extends BaseNoEditableChannel { declare type: ChannelType.DM; } export interface VoiceChannel