diff --git a/.eslintrc.js b/.eslintrc.cjs similarity index 92% rename from .eslintrc.js rename to .eslintrc.cjs index ea7ab501..d236343d 100644 --- a/.eslintrc.js +++ b/.eslintrc.cjs @@ -1,6 +1,7 @@ module.exports = { root: true, parser: "@typescript-eslint/parser", + parserOptions: { sourceType: "module" }, plugins: ["@typescript-eslint"], extends: [ "eslint:recommended", diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index da53751b..66e506f6 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -20,7 +20,7 @@ jobs: # TODO: see if we need to do anything special to cache docker images - uses: actions/setup-node@v3 with: - node-version: 20 + node-version: 22 cache: npm - name: Login to GitHub Container Registry diff --git a/README.md b/README.md index 7c2d7cba..08262ef1 100644 --- a/README.md +++ b/README.md @@ -7,3 +7,78 @@ Useful saved commands, auto-moderation tools, and more, for the Reactiflux serve Contact @vcarl (`@vcarl#7694` in Discord) for help getting into the test server. See [the contributing guide](./CONTRIBUTING.md) for specific instructions. + +## Testing deployment + +You must have a working `.env` file that enables you to run the bot locally. With the values in `.env`, create a `reactibot-env` secret in your local minikube cluster. Everything must be provided a value, but it's okay if some of them are just random strings. + +```sh +kubectl create secret generic reactibot-env \ + --from-literal=DISCORD_HASH= \ + --from-literal=DISCORD_PUBLIC_KEY= \ + --from-literal=DISCORD_APP_ID= \ + --from-literal=GUILD_ID= \ + --from-literal=OPENAI_KEY='' \ + --from-literal=GH_READ_TOKEN='' \ + --from-literal=AMPLITUDE_KEY='' +``` + +(you can delete this secret with `kubectl delete secret reactibot-env`) + +### Locally + +Set up kubectl and minikube locally. It's kinda hard. + +Start up a local Docker image registry. + +```sh +docker run -d -p 5000:5000 --name registry registry:2.7 +``` + +`-d` means this will run in "detached mode", so it will exit without logs after pulling required images and starting. You can view logs for it with `docker logs -f registry`. + +Create a file, `k8s-context`, in the project root, alongside the Dockerfile, with an IMAGE variable for kubectl to use. + +```sh +echo IMAGE=reactibot:latest > k8s-context +``` + +Run a docker build and tag it. We need to retrieve the image ID of the build we run, which complicates the command. + +```sh +docker build . -t reactibot +docker tag $(docker images reactibot:latest | tr -s ' ' | cut -f3 -d' ' | tail -n 1) localhost:5000/reactibot +``` + +Run a local deploy. + +```sh +kubectl apply -k . +``` + +If it doesn't deploy correctly (e.g. `kubectl get pods` shows a status other than success), you can debug it with `kubectl describe pod reactibot-deployment` + +### Testing with GHCR + +I actually couldn't get a local registry working so I fell back on using ghcr.io, GitHub container registry. + +Create a file, `k8s-context`, in the project root, alongside the Dockerfile, with an IMAGE variable for kubectl to use. + +```sh +echo IMAGE=ghcr.io//reactibot:test > k8s-context +``` + +Run a docker build, tag it, and push to the registry. We need to retrieve the image ID of the build we run, which complicates the command. + +```sh +docker build . -t /reactibot:test +docker tag $(docker images /reactibot:test | tr -s ' ' | cut -f3 -d' ' | tail -n 1) ghcr.io//reactibot:test +``` + +Run a local deploy. + +```sh +kubectl apply -k . +``` + +If it doesn't deploy correctly (e.g. `kubectl get pods` shows a status other than success), you can debug it with `kubectl describe pod reactibot-deployment` diff --git a/package-lock.json b/package-lock.json index 2016e663..c7fbf613 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,10 +9,15 @@ "version": "1.0.0", "license": "MIT", "dependencies": { + "@fastify/cors": "^10.0.1", + "@fastify/helmet": "^13.0.0", + "@fastify/rate-limit": "^10.2.1", + "@fastify/swagger": "^9.4.0", "date-fns": "3.6.0", "dedent": "1.5.3", "discord.js": "14.15.3", "dotenv": "16.4.5", + "fastify": "^5.2.0", "gists": "2.0.0", "lru-cache": "10.2.2", "node-cron": "3.0.3", @@ -20,6 +25,8 @@ "open-graph-scraper": "6.5.2", "openai": "4.55.5", "pdf2pic": "3.1.1", + "pino": "^9.6.0", + "pino-pretty": "^13.0.0", "query-string": "7.1.3", "uuid": "9.0.1" }, @@ -36,11 +43,12 @@ "npm-run-all": "4.1.5", "prettier": "3.3.1", "ts-node": "10.9.2", - "typescript": "5.4.5", + "tsx": "^4.19.2", + "typescript": "^5.7.3", "vitest": "1.6.0" }, "engines": { - "node": ">=20.0.0" + "node": ">=22.0.0" } }, "node_modules/@cspotcode/source-map-support": { @@ -462,6 +470,23 @@ "node": ">=12" } }, + "node_modules/@esbuild/openbsd-arm64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.23.1.tgz", + "integrity": "sha512-3x37szhLexNA4bXhLrCC/LImN/YtWis6WXr1VESlfVtVeoFJBRINPJ3f0a/6LV8zpikqoUg4hyXw0sFBt5Cr+Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, "node_modules/@esbuild/openbsd-x64": { "version": "0.21.5", "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.21.5.tgz", @@ -620,6 +645,107 @@ "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, + "node_modules/@fastify/ajv-compiler": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@fastify/ajv-compiler/-/ajv-compiler-4.0.1.tgz", + "integrity": "sha512-DxrBdgsjNLP0YM6W5Hd6/Fmj43S8zMKiFJYgi+Ri3htTGAowPVG/tG1wpnWLMjufEnehRivUCKZ1pLDIoZdTuw==", + "license": "MIT", + "dependencies": { + "ajv": "^8.12.0", + "ajv-formats": "^3.0.1", + "fast-uri": "^3.0.0" + } + }, + "node_modules/@fastify/ajv-compiler/node_modules/ajv": { + "version": "8.17.1", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz", + "integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==", + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.3", + "fast-uri": "^3.0.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/@fastify/ajv-compiler/node_modules/json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "license": "MIT" + }, + "node_modules/@fastify/cors": { + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/@fastify/cors/-/cors-10.0.1.tgz", + "integrity": "sha512-O8JIf6448uQbOgzSkCqhClw6gFTAqrdfeA6R3fc/3gwTJGUp7gl8/3tbNB+6INuu4RmgVOq99BmvdGbtu5pgOA==", + "license": "MIT", + "dependencies": { + "fastify-plugin": "^5.0.0", + "mnemonist": "0.39.8" + } + }, + "node_modules/@fastify/error": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@fastify/error/-/error-4.0.0.tgz", + "integrity": "sha512-OO/SA8As24JtT1usTUTKgGH7uLvhfwZPwlptRi2Dp5P4KKmJI3gvsZ8MIHnNwDs4sLf/aai5LzTyl66xr7qMxA==", + "license": "MIT" + }, + "node_modules/@fastify/fast-json-stringify-compiler": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@fastify/fast-json-stringify-compiler/-/fast-json-stringify-compiler-5.0.1.tgz", + "integrity": "sha512-f2d3JExJgFE3UbdFcpPwqNUEoHWmt8pAKf8f+9YuLESdefA0WgqxeT6DrGL4Yrf/9ihXNSKOqpjEmurV405meA==", + "license": "MIT", + "dependencies": { + "fast-json-stringify": "^6.0.0" + } + }, + "node_modules/@fastify/helmet": { + "version": "13.0.0", + "resolved": "https://registry.npmjs.org/@fastify/helmet/-/helmet-13.0.0.tgz", + "integrity": "sha512-7Ksj/9UDelZ9VhUUzVkBMRRzSSiX71T/ICT5+3m2GHmrWgnARu8OlE7ZaR7DjZhZjWzUWACst4oLjNdPSkVslw==", + "license": "MIT", + "dependencies": { + "fastify-plugin": "^5.0.0", + "helmet": "^8.0.0" + } + }, + "node_modules/@fastify/merge-json-schemas": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@fastify/merge-json-schemas/-/merge-json-schemas-0.1.1.tgz", + "integrity": "sha512-fERDVz7topgNjtXsJTTW1JKLy0rhuLRcquYqNR9rF7OcVpCa2OVW49ZPDIhaRRCaUuvVxI+N416xUoF76HNSXA==", + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.3" + } + }, + "node_modules/@fastify/rate-limit": { + "version": "10.2.1", + "resolved": "https://registry.npmjs.org/@fastify/rate-limit/-/rate-limit-10.2.1.tgz", + "integrity": "sha512-6rM4MXBtz9j6i9ChAVNz8ZA2yzSTGswIR3XvIbzHpe7JUWvbL7NJylFO12n7zKWfl3rEpOYiKogD98scl8SMGQ==", + "license": "MIT", + "dependencies": { + "@lukeed/ms": "^2.0.2", + "fastify-plugin": "^5.0.0", + "toad-cache": "^3.7.0" + } + }, + "node_modules/@fastify/swagger": { + "version": "9.4.0", + "resolved": "https://registry.npmjs.org/@fastify/swagger/-/swagger-9.4.0.tgz", + "integrity": "sha512-3hF7asqyNfu41aeDA/ATlIG0RY4XizgaDqPR0nc1Unt3EiXWjkVMiELLaH5WZKNvB4BA/5Wovxdin7N4ii7YHw==", + "license": "MIT", + "dependencies": { + "fastify-plugin": "^5.0.0", + "json-schema-resolver": "^2.0.0", + "openapi-types": "^12.1.3", + "rfdc": "^1.3.1", + "yaml": "^2.4.2" + } + }, "node_modules/@humanwhocodes/config-array": { "version": "0.11.14", "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.14.tgz", @@ -714,6 +840,15 @@ "@jridgewell/sourcemap-codec": "^1.4.10" } }, + "node_modules/@lukeed/ms": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@lukeed/ms/-/ms-2.0.2.tgz", + "integrity": "sha512-9I2Zn6+NJLfaGoz9jN3lpwDgAYvfGeNYdbAIjJOqzs4Tpc+VU3Jqq4IofSUBKajiDS8k9fZIg18/z13mpk1bsA==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", @@ -1370,6 +1505,12 @@ "node": ">=6.5" } }, + "node_modules/abstract-logging": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/abstract-logging/-/abstract-logging-2.0.1.tgz", + "integrity": "sha512-2BjRTZxTPvheOvGbBslFSYOUkr+SjPtOnrLP33f+VIWLzezQpZcqVg7ja3L4dBXmzzgwT+a029jRx5PCi3JuiA==", + "license": "MIT" + }, "node_modules/acorn": { "version": "8.12.1", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.12.1.tgz", @@ -1430,6 +1571,45 @@ "url": "https://github.com/sponsors/epoberezkin" } }, + "node_modules/ajv-formats": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/ajv-formats/-/ajv-formats-3.0.1.tgz", + "integrity": "sha512-8iUql50EUR+uUcdRQ3HDqa6EVyo3docL8g5WJ3FNcWmu62IbkGUue/pEyLBW8VGKKucTPgqeks4fIU1DA4yowQ==", + "license": "MIT", + "dependencies": { + "ajv": "^8.0.0" + }, + "peerDependencies": { + "ajv": "^8.0.0" + }, + "peerDependenciesMeta": { + "ajv": { + "optional": true + } + } + }, + "node_modules/ajv-formats/node_modules/ajv": { + "version": "8.17.1", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz", + "integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==", + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.3", + "fast-uri": "^3.0.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/ajv-formats/node_modules/json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "license": "MIT" + }, "node_modules/ansi-regex": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", @@ -1550,6 +1730,15 @@ "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" }, + "node_modules/atomic-sleep": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/atomic-sleep/-/atomic-sleep-1.0.0.tgz", + "integrity": "sha512-kNOjDqAh7px0XWNI+4QbzoiR/nTkHAWNud2uvnJquD1/x5a7EQZMJT0AczqK0Qn67oY/TTQ1LbUKajZpp3I9tQ==", + "license": "MIT", + "engines": { + "node": ">=8.0.0" + } + }, "node_modules/available-typed-arrays": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz", @@ -1565,6 +1754,16 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/avvio": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/avvio/-/avvio-9.1.0.tgz", + "integrity": "sha512-fYASnYi600CsH/j9EQov7lECAniYiBFiiAtBNuZYLA2leLe9qOvZzqYHFjtIj6gD2VMoMLP14834LFWvr4IfDw==", + "license": "MIT", + "dependencies": { + "@fastify/error": "^4.0.0", + "fastq": "^1.17.1" + } + }, "node_modules/balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", @@ -1798,6 +1997,12 @@ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, + "node_modules/colorette": { + "version": "2.0.20", + "resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.20.tgz", + "integrity": "sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==", + "license": "MIT" + }, "node_modules/combined-stream": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", @@ -1821,6 +2026,15 @@ "integrity": "sha512-uJcB/FKZtBMCJpK8MQji6bJHgu1tixKPxRLeGkNzBoOZzpnZUJm0jm2/sBDWcuBx1dYgxV4JU+g5hmNxCyAmdA==", "dev": true }, + "node_modules/cookie": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-1.0.2.tgz", + "integrity": "sha512-9Kr/j4O16ISv8zBBhJoi4bXOYNTkFLOqSL3UDB0njXxCXNezjeyVrJyGOWtgfs/q2km1gwBcfH8q1yEGoMYunA==", + "license": "MIT", + "engines": { + "node": ">=18" + } + }, "node_modules/create-require": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", @@ -1927,11 +2141,19 @@ "url": "https://github.com/sponsors/kossnocorp" } }, + "node_modules/dateformat": { + "version": "4.6.3", + "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-4.6.3.tgz", + "integrity": "sha512-2P0p0pFGzHS5EMnhdxQi7aJN+iMheud0UhG4dlE1DLAlvL8JHjJJTX/CSm4JXwV0Ka5nGk3zC5mcb5bUQUxxMA==", + "license": "MIT", + "engines": { + "node": "*" + } + }, "node_modules/debug": { "version": "4.3.6", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.6.tgz", "integrity": "sha512-O/09Bd4Z1fBrU4VzkhFqVgpPzaGbw6Sm9FEkBT1A/YBXQFGuuSxa1dN2nxgxS34JmKXqYx8CZAwEVoJFImUXIg==", - "dev": true, "dependencies": { "ms": "2.1.2" }, @@ -2181,6 +2403,15 @@ "node": ">=0.10.0" } }, + "node_modules/end-of-stream": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", + "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", + "license": "MIT", + "dependencies": { + "once": "^1.4.0" + } + }, "node_modules/entities": { "version": "4.5.0", "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", @@ -2589,6 +2820,18 @@ "url": "https://github.com/sindresorhus/execa?sponsor=1" } }, + "node_modules/fast-copy": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/fast-copy/-/fast-copy-3.0.2.tgz", + "integrity": "sha512-dl0O9Vhju8IrcLndv2eU4ldt1ftXMqqfgN4H1cpmGV7P6jeB9FwpN9a2c8DPGE1Ys88rNUJVYDHq73CGAGOPfQ==", + "license": "MIT" + }, + "node_modules/fast-decode-uri-component": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/fast-decode-uri-component/-/fast-decode-uri-component-1.0.1.tgz", + "integrity": "sha512-WKgKWg5eUxvRZGwW8FvfbaH7AXSh2cL+3j5fMGzUMCxWBJ3dV3a7Wz8y2f/uQ0e3B6WmodD3oS54jTQ9HVTIIg==", + "license": "MIT" + }, "node_modules/fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", @@ -2628,17 +2871,134 @@ "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", "dev": true }, + "node_modules/fast-json-stringify": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/fast-json-stringify/-/fast-json-stringify-6.0.0.tgz", + "integrity": "sha512-FGMKZwniMTgZh7zQp9b6XnBVxUmKVahQLQeRQHqwYmPDqDhcEKZ3BaQsxelFFI5PY7nN71OEeiL47/zUWcYe1A==", + "license": "MIT", + "dependencies": { + "@fastify/merge-json-schemas": "^0.1.1", + "ajv": "^8.12.0", + "ajv-formats": "^3.0.1", + "fast-deep-equal": "^3.1.3", + "fast-uri": "^2.3.0", + "json-schema-ref-resolver": "^1.0.1", + "rfdc": "^1.2.0" + } + }, + "node_modules/fast-json-stringify/node_modules/ajv": { + "version": "8.17.1", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz", + "integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==", + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.3", + "fast-uri": "^3.0.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/fast-json-stringify/node_modules/ajv/node_modules/fast-uri": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.0.3.tgz", + "integrity": "sha512-aLrHthzCjH5He4Z2H9YZ+v6Ujb9ocRuW6ZzkJQOrTxleEijANq4v1TsaPaVG1PZcuurEzrLcWRyYBYXD5cEiaw==", + "license": "BSD-3-Clause" + }, + "node_modules/fast-json-stringify/node_modules/fast-uri": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-2.4.0.tgz", + "integrity": "sha512-ypuAmmMKInk5q7XcepxlnUWDLWv4GFtaJqAzWKqn62IpQ3pejtr5dTVbt3vwqVaMKmkNR55sTT+CqUKIaT21BA==", + "license": "MIT" + }, + "node_modules/fast-json-stringify/node_modules/json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "license": "MIT" + }, "node_modules/fast-levenshtein": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", "dev": true }, + "node_modules/fast-querystring": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/fast-querystring/-/fast-querystring-1.1.2.tgz", + "integrity": "sha512-g6KuKWmFXc0fID8WWH0jit4g0AGBoJhCkJMb1RmbsSEUNvQ+ZC8D6CUZ+GtF8nMzSPXnhiePyyqqipzNNEnHjg==", + "license": "MIT", + "dependencies": { + "fast-decode-uri-component": "^1.0.1" + } + }, + "node_modules/fast-redact": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/fast-redact/-/fast-redact-3.5.0.tgz", + "integrity": "sha512-dwsoQlS7h9hMeYUq1W++23NDcBLV4KqONnITDV9DjfS3q1SgDGVrBdvvTLUotWtPSD7asWDV9/CmsZPy8Hf70A==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/fast-safe-stringify": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.1.1.tgz", + "integrity": "sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA==", + "license": "MIT" + }, + "node_modules/fast-uri": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.0.3.tgz", + "integrity": "sha512-aLrHthzCjH5He4Z2H9YZ+v6Ujb9ocRuW6ZzkJQOrTxleEijANq4v1TsaPaVG1PZcuurEzrLcWRyYBYXD5cEiaw==", + "license": "BSD-3-Clause" + }, + "node_modules/fastify": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/fastify/-/fastify-5.2.0.tgz", + "integrity": "sha512-3s+Qt5S14Eq5dCpnE0FxTp3z4xKChI83ZnMv+k0FwX+VUoZrgCFoLAxpfdi/vT4y6Mk+g7aAMt9pgXDoZmkefQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "MIT", + "dependencies": { + "@fastify/ajv-compiler": "^4.0.0", + "@fastify/error": "^4.0.0", + "@fastify/fast-json-stringify-compiler": "^5.0.0", + "abstract-logging": "^2.0.1", + "avvio": "^9.0.0", + "fast-json-stringify": "^6.0.0", + "find-my-way": "^9.0.0", + "light-my-request": "^6.0.0", + "pino": "^9.0.0", + "process-warning": "^4.0.0", + "proxy-addr": "^2.0.7", + "rfdc": "^1.3.1", + "secure-json-parse": "^3.0.1", + "semver": "^7.6.0", + "toad-cache": "^3.7.0" + } + }, + "node_modules/fastify-plugin": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/fastify-plugin/-/fastify-plugin-5.0.1.tgz", + "integrity": "sha512-HCxs+YnRaWzCl+cWRYFnHmeRFyR5GVnJTAaCJQiYzQSDwK9MgJdyAsuL3nh0EWRCYMgQ5MeziymvmAhUHYHDUQ==", + "license": "MIT" + }, "node_modules/fastq": { "version": "1.17.1", "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz", "integrity": "sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==", - "dev": true, "dependencies": { "reusify": "^1.0.4" } @@ -2675,6 +3035,20 @@ "node": ">=0.10.0" } }, + "node_modules/find-my-way": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/find-my-way/-/find-my-way-9.1.0.tgz", + "integrity": "sha512-Y5jIsuYR4BwWDYYQ2A/RWWE6gD8a0FMgtU+HOq1WKku+Cwdz8M1v8wcAmRXXM1/iqtoqg06v+LjAxMYbCjViMw==", + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.3", + "fast-querystring": "^1.0.0", + "safe-regex2": "^4.0.0" + }, + "engines": { + "node": ">=14" + } + }, "node_modules/find-up": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", @@ -2750,6 +3124,15 @@ "node": ">= 12.20" } }, + "node_modules/forwarded": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", + "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", @@ -2861,6 +3244,19 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/get-tsconfig": { + "version": "4.8.1", + "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.8.1.tgz", + "integrity": "sha512-k9PN+cFBmaLWtVz29SkUoqU5O0slLuHJXt/2P+tMVFT+phsSGXGkp9t3rQIqdz0e+06EHNGs3oM6ZX1s2zHxRg==", + "dev": true, + "license": "MIT", + "dependencies": { + "resolve-pkg-maps": "^1.0.0" + }, + "funding": { + "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1" + } + }, "node_modules/get-value": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/get-value/-/get-value-3.0.1.tgz", @@ -3156,6 +3552,21 @@ "node": ">= 0.4" } }, + "node_modules/helmet": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/helmet/-/helmet-8.0.0.tgz", + "integrity": "sha512-VyusHLEIIO5mjQPUI1wpOAEu+wl6Q0998jzTxqUYGE45xCIcAxy3MsbEK/yyJUJ3ADeMoB6MornPH6GMWAf+Pw==", + "license": "MIT", + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/help-me": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/help-me/-/help-me-5.0.0.tgz", + "integrity": "sha512-7xgomUX6ADmcYzFik0HzAxh/73YlKR9bmFzf51CZwR+b6YtzU2m0u49hQCqV6SvlqIqsaxovfwdvbnsw3b/zpg==", + "license": "MIT" + }, "node_modules/hosted-git-info": { "version": "2.8.9", "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", @@ -3279,6 +3690,15 @@ "node": ">= 0.4" } }, + "node_modules/ipaddr.js": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", + "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", + "license": "MIT", + "engines": { + "node": ">= 0.10" + } + }, "node_modules/is-array-buffer": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.4.tgz", @@ -3583,6 +4003,15 @@ "node": ">=0.10.0" } }, + "node_modules/joycon": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/joycon/-/joycon-3.1.1.tgz", + "integrity": "sha512-34wB/Y7MW7bzjKRjUKTa46I2Z7eV62Rkhva+KkopW7Qvv/OSWBqvkSY7vusOPrNuZcUG3tApvdVgNB8POj3SPw==", + "license": "MIT", + "engines": { + "node": ">=10" + } + }, "node_modules/js-tokens": { "version": "9.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-9.0.0.tgz", @@ -3613,6 +4042,32 @@ "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", "dev": true }, + "node_modules/json-schema-ref-resolver": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-schema-ref-resolver/-/json-schema-ref-resolver-1.0.1.tgz", + "integrity": "sha512-EJAj1pgHc1hxF6vo2Z3s69fMjO1INq6eGHXZ8Z6wCQeldCuwxGK9Sxf4/cScGn3FZubCVUehfWtcDM/PLteCQw==", + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.3" + } + }, + "node_modules/json-schema-resolver": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/json-schema-resolver/-/json-schema-resolver-2.0.0.tgz", + "integrity": "sha512-pJ4XLQP4Q9HTxl6RVDLJ8Cyh1uitSs0CzDBAz1uoJ4sRD/Bk7cFSXL1FUXDW3zJ7YnfliJx6eu8Jn283bpZ4Yg==", + "license": "MIT", + "dependencies": { + "debug": "^4.1.1", + "rfdc": "^1.1.4", + "uri-js": "^4.2.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/Eomm/json-schema-resolver?sponsor=1" + } + }, "node_modules/json-schema-traverse": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", @@ -3647,6 +4102,17 @@ "node": ">= 0.8.0" } }, + "node_modules/light-my-request": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/light-my-request/-/light-my-request-6.4.0.tgz", + "integrity": "sha512-U0UONITz4GVQodMPoygnqJan2RYfhyLsCzFBakJHWNfiQKyHzvp38YOxxLGs8lIDPwR6ngd4gmuZJQQJtRBu/A==", + "license": "BSD-3-Clause", + "dependencies": { + "cookie": "^1.0.1", + "process-warning": "^4.0.0", + "set-cookie-parser": "^2.6.0" + } + }, "node_modules/load-json-file": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", @@ -3829,6 +4295,15 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/mlly": { "version": "1.7.1", "resolved": "https://registry.npmjs.org/mlly/-/mlly-1.7.1.tgz", @@ -3841,6 +4316,15 @@ "ufo": "^1.5.3" } }, + "node_modules/mnemonist": { + "version": "0.39.8", + "resolved": "https://registry.npmjs.org/mnemonist/-/mnemonist-0.39.8.tgz", + "integrity": "sha512-vyWo2K3fjrUw8YeeZ1zF0fy6Mu59RHokURlld8ymdUPjMlD9EC9ov1/YPqTgqRvUN9nTr3Gqfz29LYAmu0PHPQ==", + "license": "MIT", + "dependencies": { + "obliterator": "^2.0.1" + } + }, "node_modules/ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", @@ -4318,11 +4802,25 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/obliterator": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/obliterator/-/obliterator-2.0.4.tgz", + "integrity": "sha512-lgHwxlxV1qIg1Eap7LgIeoBWIMFibOjbrYPIPJZcI1mmGAI2m3lNYpK12Y+GBdPQ0U1hRwSord7GIaawz962qQ==", + "license": "MIT" + }, + "node_modules/on-exit-leak-free": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/on-exit-leak-free/-/on-exit-leak-free-2.1.2.tgz", + "integrity": "sha512-0eJJY6hXLGf1udHwfNftBqH+g73EU4B504nZeKpz1sYRKafAghwxEJunB2O7rDZkL4PGfsMVnTXZ2EjibbqcsA==", + "license": "MIT", + "engines": { + "node": ">=14.0.0" + } + }, "node_modules/once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", - "dev": true, "dependencies": { "wrappy": "1" } @@ -4409,6 +4907,12 @@ "undici-types": "~5.26.4" } }, + "node_modules/openapi-types": { + "version": "12.1.3", + "resolved": "https://registry.npmjs.org/openapi-types/-/openapi-types-12.1.3.tgz", + "integrity": "sha512-N4YtSYJqghVu4iek2ZUvcN/0aqH1kRDuNqzcycDxhOUpg7GdvLa2F3DgS6yBNhInhv2r/6I0Flkn7CqL8+nIcw==", + "license": "MIT" + }, "node_modules/optionator": { "version": "0.9.4", "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", @@ -4645,15 +5149,82 @@ "node": ">=4" } }, - "node_modules/pkg-types": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-1.1.3.tgz", - "integrity": "sha512-+JrgthZG6m3ckicaOB74TwQ+tBWsFl3qVQg7mN8ulwSOElJ7gBhKzj2VkCPnZ4NlF6kEquYU+RIYNVAvzd54UA==", - "dev": true, + "node_modules/pino": { + "version": "9.6.0", + "resolved": "https://registry.npmjs.org/pino/-/pino-9.6.0.tgz", + "integrity": "sha512-i85pKRCt4qMjZ1+L7sy2Ag4t1atFcdbEt76+7iRJn1g2BvsnRMGu9p8pivl9fs63M2kF/A0OacFZhTub+m/qMg==", + "license": "MIT", "dependencies": { - "confbox": "^0.1.7", - "mlly": "^1.7.1", - "pathe": "^1.1.2" + "atomic-sleep": "^1.0.0", + "fast-redact": "^3.1.1", + "on-exit-leak-free": "^2.1.0", + "pino-abstract-transport": "^2.0.0", + "pino-std-serializers": "^7.0.0", + "process-warning": "^4.0.0", + "quick-format-unescaped": "^4.0.3", + "real-require": "^0.2.0", + "safe-stable-stringify": "^2.3.1", + "sonic-boom": "^4.0.1", + "thread-stream": "^3.0.0" + }, + "bin": { + "pino": "bin.js" + } + }, + "node_modules/pino-abstract-transport": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/pino-abstract-transport/-/pino-abstract-transport-2.0.0.tgz", + "integrity": "sha512-F63x5tizV6WCh4R6RHyi2Ml+M70DNRXt/+HANowMflpgGFMAym/VKm6G7ZOQRjqN7XbGxK1Lg9t6ZrtzOaivMw==", + "license": "MIT", + "dependencies": { + "split2": "^4.0.0" + } + }, + "node_modules/pino-pretty": { + "version": "13.0.0", + "resolved": "https://registry.npmjs.org/pino-pretty/-/pino-pretty-13.0.0.tgz", + "integrity": "sha512-cQBBIVG3YajgoUjo1FdKVRX6t9XPxwB9lcNJVD5GCnNM4Y6T12YYx8c6zEejxQsU0wrg9TwmDulcE9LR7qcJqA==", + "license": "MIT", + "dependencies": { + "colorette": "^2.0.7", + "dateformat": "^4.6.3", + "fast-copy": "^3.0.2", + "fast-safe-stringify": "^2.1.1", + "help-me": "^5.0.0", + "joycon": "^3.1.1", + "minimist": "^1.2.6", + "on-exit-leak-free": "^2.1.0", + "pino-abstract-transport": "^2.0.0", + "pump": "^3.0.0", + "secure-json-parse": "^2.4.0", + "sonic-boom": "^4.0.1", + "strip-json-comments": "^3.1.1" + }, + "bin": { + "pino-pretty": "bin.js" + } + }, + "node_modules/pino-pretty/node_modules/secure-json-parse": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/secure-json-parse/-/secure-json-parse-2.7.0.tgz", + "integrity": "sha512-6aU+Rwsezw7VR8/nyvKTx8QpWH9FrcYiXXlqC4z5d5XQBDRqtbfsRjnwGyqbi3gddNtWHuEk9OANUotL26qKUw==", + "license": "BSD-3-Clause" + }, + "node_modules/pino-std-serializers": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/pino-std-serializers/-/pino-std-serializers-7.0.0.tgz", + "integrity": "sha512-e906FRY0+tV27iq4juKzSYPbUj2do2X2JX4EzSca1631EB2QJQUqGbDuERal7LCtOpxl6x3+nvo9NPZcmjkiFA==", + "license": "MIT" + }, + "node_modules/pkg-types": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-1.1.3.tgz", + "integrity": "sha512-+JrgthZG6m3ckicaOB74TwQ+tBWsFl3qVQg7mN8ulwSOElJ7gBhKzj2VkCPnZ4NlF6kEquYU+RIYNVAvzd54UA==", + "dev": true, + "dependencies": { + "confbox": "^0.1.7", + "mlly": "^1.7.1", + "pathe": "^1.1.2" } }, "node_modules/possible-typed-array-names": { @@ -4743,6 +5314,25 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, + "node_modules/process-warning": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/process-warning/-/process-warning-4.0.0.tgz", + "integrity": "sha512-/MyYDxttz7DfGMMHiysAsFE4qF+pQYAA8ziO/3NcRVrQ5fSk+Mns4QZA/oRPFzvcqNoVJXQNWNAsdwBXLUkQKw==", + "license": "MIT" + }, + "node_modules/proxy-addr": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", + "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", + "license": "MIT", + "dependencies": { + "forwarded": "0.2.0", + "ipaddr.js": "1.9.1" + }, + "engines": { + "node": ">= 0.10" + } + }, "node_modules/pseudomap": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", @@ -4754,11 +5344,20 @@ "integrity": "sha512-77DZwxQmxKnu3aR542U+X8FypNzbfJ+C5XQDk3uWjWxn6151aIMGthWYRXTqT1E5oJvg+ljaa2OJi+VfvCOQ8w==", "dev": true }, + "node_modules/pump": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.2.tgz", + "integrity": "sha512-tUPXtzlGM8FE3P0ZL6DVs/3P58k9nk8/jZeQCurTJylQA8qFYzHFfhBJkuqyE0FifOsQ0uKWekiZ5g8wtr28cw==", + "license": "MIT", + "dependencies": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, "node_modules/punycode": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", - "dev": true, "engines": { "node": ">=6" } @@ -4814,6 +5413,12 @@ } ] }, + "node_modules/quick-format-unescaped": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/quick-format-unescaped/-/quick-format-unescaped-4.0.4.tgz", + "integrity": "sha512-tYC1Q1hgyRuHgloV/YXs2w15unPVh8qfu/qCTfhTYamaw7fyhumKa2yGpdSo87vY32rIclj+4fWYQXUMs9EHvg==", + "license": "MIT" + }, "node_modules/react-is": { "version": "18.3.1", "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", @@ -4858,6 +5463,15 @@ "node": ">=8.10.0" } }, + "node_modules/real-require": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/real-require/-/real-require-0.2.0.tgz", + "integrity": "sha512-57frrGM/OCTLqLOAh0mhVA9VBMHd+9U7Zb2THMGdBUoZVOtGbJzjxsYGDJ3A9AYYCP4hn6y1TVbaOfzWtm5GFg==", + "license": "MIT", + "engines": { + "node": ">= 12.13.0" + } + }, "node_modules/regexp.prototype.flags": { "version": "1.5.2", "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.2.tgz", @@ -4876,6 +5490,15 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/resolve": { "version": "1.22.8", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", @@ -4902,16 +5525,40 @@ "node": ">=4" } }, + "node_modules/resolve-pkg-maps": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz", + "integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1" + } + }, + "node_modules/ret": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/ret/-/ret-0.5.0.tgz", + "integrity": "sha512-I1XxrZSQ+oErkRR4jYbAyEEu2I0avBvvMM5JN+6EBprOGRCs63ENqZ3vjavq8fBw2+62G5LF5XelKwuJpcvcxw==", + "license": "MIT", + "engines": { + "node": ">=10" + } + }, "node_modules/reusify": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", - "dev": true, "engines": { "iojs": ">=1.0.0", "node": ">=0.10.0" } }, + "node_modules/rfdc": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/rfdc/-/rfdc-1.4.1.tgz", + "integrity": "sha512-q1b3N5QkRUWUl7iyylaaj3kOpIT0N2i9MqIEQXP73GVsN9cw3fdx8X63cEmWhJGi2PPCF23Ijp7ktmd39rawIA==", + "license": "MIT" + }, "node_modules/rimraf": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", @@ -5021,6 +5668,34 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/safe-regex2": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/safe-regex2/-/safe-regex2-4.0.1.tgz", + "integrity": "sha512-goqsB+bSlOmVX+CiFX2PFc1OV88j5jvBqIM+DgqrucHnUguAUNtiNOs+aTadq2NqsLQ+TQ3UEVG3gtSFcdlkCg==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "MIT", + "dependencies": { + "ret": "~0.5.0" + } + }, + "node_modules/safe-stable-stringify": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/safe-stable-stringify/-/safe-stable-stringify-2.5.0.tgz", + "integrity": "sha512-b3rppTKm9T+PsVCBEOUR46GWI7fdOs00VKZ1+9c1EWDaDMvjQc6tUwuFyIprgGgTcWoVHSKrU8H31ZHA2e0RHA==", + "license": "MIT", + "engines": { + "node": ">=10" + } + }, "node_modules/safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", @@ -5031,11 +5706,16 @@ "resolved": "https://registry.npmjs.org/sax/-/sax-1.4.1.tgz", "integrity": "sha512-+aWOz7yVScEGoKNd4PA10LZ8sk0A/z5+nXQG5giUO5rprX9jgYsTdov9qCchZiPIZezbZH+jRut8nPodFAX4Jg==" }, + "node_modules/secure-json-parse": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/secure-json-parse/-/secure-json-parse-3.0.1.tgz", + "integrity": "sha512-9QR7G96th4QJ2+dJwvZB+JoXyt8PN+DbEjOr6kL2/JU4KH8Eb2sFdU+gt8EDdzWDWoWH0uocDdfCoFzdVSixUA==", + "license": "BSD-3-Clause" + }, "node_modules/semver": { "version": "7.6.3", "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", - "dev": true, "bin": { "semver": "bin/semver.js" }, @@ -5043,6 +5723,12 @@ "node": ">=10" } }, + "node_modules/set-cookie-parser": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/set-cookie-parser/-/set-cookie-parser-2.7.1.tgz", + "integrity": "sha512-IOc8uWeOZgnb3ptbCURJWNjWUPcO3ZnTTdzsurqERrP6nPyv+paC55vJM0LpOlT2ne+Ix+9+CRG1MNLlyZ4GjQ==", + "license": "MIT" + }, "node_modules/set-function-length": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", @@ -5160,6 +5846,15 @@ "node": ">=8" } }, + "node_modules/sonic-boom": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/sonic-boom/-/sonic-boom-4.2.0.tgz", + "integrity": "sha512-INb7TM37/mAcsGmc9hyyI6+QR3rR1zVRu36B0NeGXKnOOLiZOfER5SA+N7X7k3yUYRzLWafduTDvJAfDswwEww==", + "license": "MIT", + "dependencies": { + "atomic-sleep": "^1.0.0" + } + }, "node_modules/source-map-js": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.0.tgz", @@ -5209,6 +5904,15 @@ "node": ">=6" } }, + "node_modules/split2": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/split2/-/split2-4.2.0.tgz", + "integrity": "sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg==", + "license": "ISC", + "engines": { + "node": ">= 10.x" + } + }, "node_modules/stackback": { "version": "0.0.2", "resolved": "https://registry.npmjs.org/stackback/-/stackback-0.0.2.tgz", @@ -5333,7 +6037,6 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", - "dev": true, "engines": { "node": ">=8" }, @@ -5383,6 +6086,15 @@ "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", "dev": true }, + "node_modules/thread-stream": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/thread-stream/-/thread-stream-3.1.0.tgz", + "integrity": "sha512-OqyPZ9u96VohAyMfJykzmivOrY2wfMSf3C5TtFJVgN+Hm6aj+voFhlK+kZEIv2FBh1X6Xp3DlnCOfEQ3B2J86A==", + "license": "MIT", + "dependencies": { + "real-require": "^0.2.0" + } + }, "node_modules/tinybench": { "version": "2.9.0", "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.9.0.tgz", @@ -5419,6 +6131,15 @@ "node": ">=8.0" } }, + "node_modules/toad-cache": { + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/toad-cache/-/toad-cache-3.7.0.tgz", + "integrity": "sha512-/m8M+2BJUpoJdgAHoG+baCwBT+tf2VraSfkBgl0Y00qIWt41DJ8R5B8nsEw0I58YwF5IZH6z24/2TobDKnqSWw==", + "license": "MIT", + "engines": { + "node": ">=12" + } + }, "node_modules/touch": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/touch/-/touch-3.1.1.tgz", @@ -5498,6 +6219,457 @@ "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==" }, + "node_modules/tsx": { + "version": "4.19.2", + "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.19.2.tgz", + "integrity": "sha512-pOUl6Vo2LUq/bSa8S5q7b91cgNSjctn9ugq/+Mvow99qW6x/UZYwzxy/3NmqoT66eHYfCVvFvACC58UBPFf28g==", + "dev": true, + "license": "MIT", + "dependencies": { + "esbuild": "~0.23.0", + "get-tsconfig": "^4.7.5" + }, + "bin": { + "tsx": "dist/cli.mjs" + }, + "engines": { + "node": ">=18.0.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + } + }, + "node_modules/tsx/node_modules/@esbuild/aix-ppc64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.23.1.tgz", + "integrity": "sha512-6VhYk1diRqrhBAqpJEdjASR/+WVRtfjpqKuNw11cLiaWpAT/Uu+nokB+UJnevzy/P9C/ty6AOe0dwueMrGh/iQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsx/node_modules/@esbuild/android-arm": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.23.1.tgz", + "integrity": "sha512-uz6/tEy2IFm9RYOyvKl88zdzZfwEfKZmnX9Cj1BHjeSGNuGLuMD1kR8y5bteYmwqKm1tj8m4cb/aKEorr6fHWQ==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsx/node_modules/@esbuild/android-arm64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.23.1.tgz", + "integrity": "sha512-xw50ipykXcLstLeWH7WRdQuysJqejuAGPd30vd1i5zSyKK3WE+ijzHmLKxdiCMtH1pHz78rOg0BKSYOSB/2Khw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsx/node_modules/@esbuild/android-x64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.23.1.tgz", + "integrity": "sha512-nlN9B69St9BwUoB+jkyU090bru8L0NA3yFvAd7k8dNsVH8bi9a8cUAUSEcEEgTp2z3dbEDGJGfP6VUnkQnlReg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsx/node_modules/@esbuild/darwin-arm64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.23.1.tgz", + "integrity": "sha512-YsS2e3Wtgnw7Wq53XXBLcV6JhRsEq8hkfg91ESVadIrzr9wO6jJDMZnCQbHm1Guc5t/CdDiFSSfWP58FNuvT3Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsx/node_modules/@esbuild/darwin-x64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.23.1.tgz", + "integrity": "sha512-aClqdgTDVPSEGgoCS8QDG37Gu8yc9lTHNAQlsztQ6ENetKEO//b8y31MMu2ZaPbn4kVsIABzVLXYLhCGekGDqw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsx/node_modules/@esbuild/freebsd-arm64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.23.1.tgz", + "integrity": "sha512-h1k6yS8/pN/NHlMl5+v4XPfikhJulk4G+tKGFIOwURBSFzE8bixw1ebjluLOjfwtLqY0kewfjLSrO6tN2MgIhA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsx/node_modules/@esbuild/freebsd-x64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.23.1.tgz", + "integrity": "sha512-lK1eJeyk1ZX8UklqFd/3A60UuZ/6UVfGT2LuGo3Wp4/z7eRTRYY+0xOu2kpClP+vMTi9wKOfXi2vjUpO1Ro76g==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-arm": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.23.1.tgz", + "integrity": "sha512-CXXkzgn+dXAPs3WBwE+Kvnrf4WECwBdfjfeYHpMeVxWE0EceB6vhWGShs6wi0IYEqMSIzdOF1XjQ/Mkm5d7ZdQ==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-arm64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.23.1.tgz", + "integrity": "sha512-/93bf2yxencYDnItMYV/v116zff6UyTjo4EtEQjUBeGiVpMmffDNUyD9UN2zV+V3LRV3/on4xdZ26NKzn6754g==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-ia32": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.23.1.tgz", + "integrity": "sha512-VTN4EuOHwXEkXzX5nTvVY4s7E/Krz7COC8xkftbbKRYAl96vPiUssGkeMELQMOnLOJ8k3BY1+ZY52tttZnHcXQ==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-loong64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.23.1.tgz", + "integrity": "sha512-Vx09LzEoBa5zDnieH8LSMRToj7ir/Jeq0Gu6qJ/1GcBq9GkfoEAoXvLiW1U9J1qE/Y/Oyaq33w5p2ZWrNNHNEw==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-mips64el": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.23.1.tgz", + "integrity": "sha512-nrFzzMQ7W4WRLNUOU5dlWAqa6yVeI0P78WKGUo7lg2HShq/yx+UYkeNSE0SSfSure0SqgnsxPvmAUu/vu0E+3Q==", + "cpu": [ + "mips64el" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-ppc64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.23.1.tgz", + "integrity": "sha512-dKN8fgVqd0vUIjxuJI6P/9SSSe/mB9rvA98CSH2sJnlZ/OCZWO1DJvxj8jvKTfYUdGfcq2dDxoKaC6bHuTlgcw==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-riscv64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.23.1.tgz", + "integrity": "sha512-5AV4Pzp80fhHL83JM6LoA6pTQVWgB1HovMBsLQ9OZWLDqVY8MVobBXNSmAJi//Csh6tcY7e7Lny2Hg1tElMjIA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-s390x": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.23.1.tgz", + "integrity": "sha512-9ygs73tuFCe6f6m/Tb+9LtYxWR4c9yg7zjt2cYkjDbDpV/xVn+68cQxMXCjUpYwEkze2RcU/rMnfIXNRFmSoDw==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-x64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.23.1.tgz", + "integrity": "sha512-EV6+ovTsEXCPAp58g2dD68LxoP/wK5pRvgy0J/HxPGB009omFPv3Yet0HiaqvrIrgPTBuC6wCH1LTOY91EO5hQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsx/node_modules/@esbuild/netbsd-x64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.23.1.tgz", + "integrity": "sha512-aevEkCNu7KlPRpYLjwmdcuNz6bDFiE7Z8XC4CPqExjTvrHugh28QzUXVOZtiYghciKUacNktqxdpymplil1beA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsx/node_modules/@esbuild/openbsd-x64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.23.1.tgz", + "integrity": "sha512-aY2gMmKmPhxfU+0EdnN+XNtGbjfQgwZj43k8G3fyrDM/UdZww6xrWxmDkuz2eCZchqVeABjV5BpildOrUbBTqA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsx/node_modules/@esbuild/sunos-x64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.23.1.tgz", + "integrity": "sha512-RBRT2gqEl0IKQABT4XTj78tpk9v7ehp+mazn2HbUeZl1YMdaGAQqhapjGTCe7uw7y0frDi4gS0uHzhvpFuI1sA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsx/node_modules/@esbuild/win32-arm64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.23.1.tgz", + "integrity": "sha512-4O+gPR5rEBe2FpKOVyiJ7wNDPA8nGzDuJ6gN4okSA1gEOYZ67N8JPk58tkWtdtPeLz7lBnY6I5L3jdsr3S+A6A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsx/node_modules/@esbuild/win32-ia32": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.23.1.tgz", + "integrity": "sha512-BcaL0Vn6QwCwre3Y717nVHZbAa4UBEigzFm6VdsVdT/MbZ38xoj1X9HPkZhbmaBGUD1W8vxAfffbDe8bA6AKnQ==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsx/node_modules/@esbuild/win32-x64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.23.1.tgz", + "integrity": "sha512-BHpFFeslkWrXWyUPnbKm+xYYVYruCinGcftSBaa8zoF9hZO4BcSCFUvHVTtzpIY6YzUnYtuEhZ+C9iEXjxnasg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsx/node_modules/esbuild": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.23.1.tgz", + "integrity": "sha512-VVNz/9Sa0bs5SELtn3f7qhJCDPCF5oMEl5cO9/SSinpE9hbPVvxbd572HH5AKiP7WD8INO53GgfDDhRjkylHEg==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.23.1", + "@esbuild/android-arm": "0.23.1", + "@esbuild/android-arm64": "0.23.1", + "@esbuild/android-x64": "0.23.1", + "@esbuild/darwin-arm64": "0.23.1", + "@esbuild/darwin-x64": "0.23.1", + "@esbuild/freebsd-arm64": "0.23.1", + "@esbuild/freebsd-x64": "0.23.1", + "@esbuild/linux-arm": "0.23.1", + "@esbuild/linux-arm64": "0.23.1", + "@esbuild/linux-ia32": "0.23.1", + "@esbuild/linux-loong64": "0.23.1", + "@esbuild/linux-mips64el": "0.23.1", + "@esbuild/linux-ppc64": "0.23.1", + "@esbuild/linux-riscv64": "0.23.1", + "@esbuild/linux-s390x": "0.23.1", + "@esbuild/linux-x64": "0.23.1", + "@esbuild/netbsd-x64": "0.23.1", + "@esbuild/openbsd-arm64": "0.23.1", + "@esbuild/openbsd-x64": "0.23.1", + "@esbuild/sunos-x64": "0.23.1", + "@esbuild/win32-arm64": "0.23.1", + "@esbuild/win32-ia32": "0.23.1", + "@esbuild/win32-x64": "0.23.1" + } + }, "node_modules/type-check": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", @@ -5605,10 +6777,11 @@ } }, "node_modules/typescript": { - "version": "5.4.5", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.5.tgz", - "integrity": "sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==", + "version": "5.7.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.7.3.tgz", + "integrity": "sha512-84MVSjMEHP+FQRPy3pX9sTVV/INIex71s9TL2Gm5FG/WG1SqXeKyZ0k7/blY/4FdOzI12CBy1vGc4og/eus0fw==", "dev": true, + "license": "Apache-2.0", "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -5661,7 +6834,6 @@ "version": "4.4.1", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", - "dev": true, "dependencies": { "punycode": "^2.1.0" } @@ -5986,8 +7158,7 @@ "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", - "dev": true + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" }, "node_modules/ws": { "version": "8.18.0", @@ -6022,6 +7193,18 @@ "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", "integrity": "sha512-ncTzHV7NvsQZkYe1DW7cbDLm0YpzHmZF5r/iyP3ZnQtMiJ+pjzisCiMNI+Sj+xQF5pXhSHxSB3uDbsBTzY/c2A==" }, + "node_modules/yaml": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.6.1.tgz", + "integrity": "sha512-7r0XPzioN/Q9kXBro/XPnA6kznR73DHq+GXh5ON7ZozRO6aMjbmiBuKste2wslTFkC5d1dw0GooOCepZXJ2SAg==", + "license": "ISC", + "bin": { + "yaml": "bin.mjs" + }, + "engines": { + "node": ">= 14" + } + }, "node_modules/yn": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", diff --git a/package.json b/package.json index 90f58add..71e73ee6 100644 --- a/package.json +++ b/package.json @@ -3,12 +3,13 @@ "version": "1.0.0", "description": "Source code of Reactibot, utilized at Reactiflux server", "private": true, + "type": "module", "scripts": { "start": "node dist/index.js", "dev": "npm-run-all --parallel 'dev:*'", - "dev:bot": "nodemon -r dotenv/config ./src/index.ts", + "dev:bot": "tsx --watch ./src/index.ts", "dev:test": "vitest", - "build": "tsc", + "build": "tsc -b", "test": "npm-run-all -c --parallel 'test:*'", "test:vitest": "vitest --run", "test:lint": "eslint --ext js,ts . && prettier --check .", @@ -20,10 +21,15 @@ }, "license": "MIT", "dependencies": { + "@fastify/cors": "^10.0.1", + "@fastify/helmet": "^13.0.0", + "@fastify/rate-limit": "^10.2.1", + "@fastify/swagger": "^9.4.0", "date-fns": "3.6.0", "dedent": "1.5.3", "discord.js": "14.15.3", "dotenv": "16.4.5", + "fastify": "^5.2.0", "gists": "2.0.0", "lru-cache": "10.2.2", "node-cron": "3.0.3", @@ -31,6 +37,8 @@ "open-graph-scraper": "6.5.2", "openai": "4.55.5", "pdf2pic": "3.1.1", + "pino": "^9.6.0", + "pino-pretty": "^13.0.0", "query-string": "7.1.3", "uuid": "9.0.1" }, @@ -47,13 +55,14 @@ "npm-run-all": "4.1.5", "prettier": "3.3.1", "ts-node": "10.9.2", - "typescript": "5.4.5", + "tsx": "^4.19.2", + "typescript": "^5.7.3", "vitest": "1.6.0" }, "prettier": { "trailingComma": "all" }, "engines": { - "node": ">=20.0.0" + "node": ">=22.0.0" } } diff --git a/src/constants/channels.ts b/src/constants/channels.ts index 052c8a87..a55c99d4 100644 --- a/src/constants/channels.ts +++ b/src/constants/channels.ts @@ -1,5 +1,5 @@ import { ChannelType, Client, TextChannel } from "discord.js"; -import { guildId, isProd } from "../helpers/env"; +import { guildId, isProd } from "../helpers/env.js"; const LOCAL_CHANNELS: Record = { helpReact: "926931785219207301", diff --git a/src/features/autoban.ts b/src/features/autoban.ts index ce2ff36c..2b6e538e 100644 --- a/src/features/autoban.ts +++ b/src/features/autoban.ts @@ -1,4 +1,4 @@ -import { ChannelHandlers } from "../types"; +import type { ChannelHandlers } from "../types/index.d.ts"; const tags = [ "http://discord.amazingsexdating.com", diff --git a/src/features/autothread.ts b/src/features/autothread.ts index ca2f2cbd..bfc84e4e 100644 --- a/src/features/autothread.ts +++ b/src/features/autothread.ts @@ -1,16 +1,16 @@ import { differenceInHours } from "date-fns"; import { ChannelType, Client, MessageType } from "discord.js"; -import { CHANNELS } from "../constants/channels"; +import { CHANNELS } from "../constants/channels.js"; import { constructDiscordLink, fetchReactionMembers, isHelpful, isStaff, -} from "../helpers/discord"; -import { sleep } from "../helpers/misc"; -import { ChannelHandlers } from "../types"; -import { threadStats } from "../features/stats"; -import { createNewThreadName } from "../helpers/threads"; +} from "../helpers/discord.js"; +import { sleep } from "../helpers/misc.js"; +import type { ChannelHandlers } from "../types/index.d.ts"; +import { threadStats } from "../features/stats.js"; +import { createNewThreadName } from "../helpers/threads.js"; const CHECKS = ["☑️", "✔️", "✅"]; const IDLE_TIMEOUT = 72; diff --git a/src/features/book-list.ts b/src/features/book-list.ts index 2f184534..3fe0b880 100644 --- a/src/features/book-list.ts +++ b/src/features/book-list.ts @@ -1,6 +1,6 @@ import { SlashCommandBuilder } from "discord.js"; -import { SlashCommand } from "../helpers/discord"; -import { og } from "../helpers/og-tags"; +import { SlashCommand } from "../helpers/discord.js"; +import { og } from "../helpers/og-tags.js"; const fetchMetadata = async ({ title, diff --git a/src/features/codeblock.js b/src/features/codeblock.js index 02745fda..522fc7c7 100644 --- a/src/features/codeblock.js +++ b/src/features/codeblock.js @@ -1,5 +1,5 @@ import Gists from "gists"; -import { gitHubToken } from "../helpers/env"; +import { gitHubToken } from "../helpers/env.js"; const gists = new Gists({ token: gitHubToken, diff --git a/src/features/commands.ts b/src/features/commands.ts index 36abfcf7..ab78ac0a 100644 --- a/src/features/commands.ts +++ b/src/features/commands.ts @@ -7,14 +7,14 @@ import { Message, TextChannel, } from "discord.js"; -import cooldown from "./cooldown"; -import { ChannelHandlers } from "../types"; -import { isStaff } from "../helpers/discord"; +import cooldown from "./cooldown.js"; +import type { ChannelHandlers } from "../types/index.d.ts"; +import { isStaff } from "../helpers/discord.js"; import { extractSearchKey, getReactDocsContent, getReactDocsSearchKey, -} from "../helpers/react-docs"; +} from "../helpers/react-docs.js"; import dedent from "dedent"; export const EMBED_COLOR = 7506394; diff --git a/src/features/debug-events.ts b/src/features/debug-events.ts index cdd2c65b..1960970e 100644 --- a/src/features/debug-events.ts +++ b/src/features/debug-events.ts @@ -6,8 +6,8 @@ import { ClientEvents, SlashCommandBuilder, } from "discord.js"; -import { isProd } from "../helpers/env"; -import { SlashCommand } from "../helpers/discord"; +import { isProd } from "../helpers/env.js"; +import { SlashCommand } from "../helpers/discord.js"; type DebugEvent = { eventId: keyof ClientEvents; diff --git a/src/features/emojiMod.ts b/src/features/emojiMod.ts index 5f825b4e..445e7408 100644 --- a/src/features/emojiMod.ts +++ b/src/features/emojiMod.ts @@ -6,17 +6,21 @@ import { EmbedType, ChannelType, } from "discord.js"; -import cooldown from "./cooldown"; -import { ChannelHandlers } from "../types"; -import { ReportReasons, reportUser, truncateMessage } from "../helpers/modLog"; +import cooldown from "./cooldown.js"; +import type { ChannelHandlers } from "../types/index.d.ts"; +import { + ReportReasons, + reportUser, + truncateMessage, +} from "../helpers/modLog.js"; import { createPrivateThreadFromMessage, fetchReactionMembers, isStaff, isStaffOrHelpful, -} from "../helpers/discord"; -import { partition } from "../helpers/array"; -import { EMBED_COLOR } from "./commands"; +} from "../helpers/discord.js"; +import { partition } from "../helpers/array.js"; +import { EMBED_COLOR } from "./commands.js"; const config = { // This is how many ️️warning reactions a post must get until it's considered an official warning diff --git a/src/features/jobs-moderation.ts b/src/features/jobs-moderation.ts index a5b7dd05..c59500a7 100644 --- a/src/features/jobs-moderation.ts +++ b/src/features/jobs-moderation.ts @@ -10,11 +10,11 @@ import { TextChannel, ThreadChannel, } from "discord.js"; -import { CHANNELS } from "../constants/channels"; -import { SlashCommand, isStaff } from "../helpers/discord"; -import { ReportReasons, reportUser } from "../helpers/modLog"; -import validate from "./jobs-moderation/validate"; -import { parseContent } from "./jobs-moderation/parse-content"; +import { CHANNELS } from "../constants/channels.js"; +import { SlashCommand, isStaff } from "../helpers/discord.js"; +import { ReportReasons, reportUser } from "../helpers/modLog.js"; +import validate from "./jobs-moderation/validate.js"; +import { parseContent } from "./jobs-moderation/parse-content.js"; import { loadJobs, purgeMember, @@ -24,14 +24,14 @@ import { trackModeratedMessage, failedTooFrequent, deleteAgedPosts, -} from "./jobs-moderation/job-mod-helpers"; -import { getValidationMessage } from "./jobs-moderation/validation-messages"; -import { FREQUENCY, scheduleTask } from "../helpers/schedule"; +} from "./jobs-moderation/job-mod-helpers.js"; +import { getValidationMessage } from "./jobs-moderation/validation-messages.js"; +import { FREQUENCY, scheduleTask } from "../helpers/schedule.js"; import { POST_FAILURE_REASONS, PostFailures, PostType, -} from "../types/jobs-moderation"; +} from "../types/jobs-moderation.js"; const REPOST_THRESHOLD = 10; // minutes diff --git a/src/features/jobs-moderation/job-mod-helpers.ts b/src/features/jobs-moderation/job-mod-helpers.ts index b249fa17..b3a9faa2 100644 --- a/src/features/jobs-moderation/job-mod-helpers.ts +++ b/src/features/jobs-moderation/job-mod-helpers.ts @@ -12,10 +12,10 @@ import { Snowflake, TextChannel, } from "discord.js"; -import { constructDiscordLink, isStaff } from "../../helpers/discord"; -import { partition } from "../../helpers/array"; -import { ReportReasons, reportUser } from "../../helpers/modLog"; -import { parseContent } from "./parse-content"; +import { constructDiscordLink, isStaff } from "../../helpers/discord.js"; +import { partition } from "../../helpers/array.js"; +import { ReportReasons, reportUser } from "../../helpers/modLog.js"; +import { parseContent } from "./parse-content.js"; import { POST_FAILURE_REASONS, PostFailureInconsistentType, @@ -30,7 +30,7 @@ import { PostType, PostFailureLinkRequired, CircumventedRules, -} from "../../types/jobs-moderation"; +} from "../../types/jobs-moderation.js"; export const failedCircumventedRules = ( e: PostFailures, diff --git a/src/features/jobs-moderation/parse-content.test.ts b/src/features/jobs-moderation/parse-content.test.ts index a845f21f..36baa527 100644 --- a/src/features/jobs-moderation/parse-content.test.ts +++ b/src/features/jobs-moderation/parse-content.test.ts @@ -1,6 +1,6 @@ import { describe, expect, expectTypeOf, it } from "vitest"; -import { parseContent } from "./parse-content"; -import { PostType } from "../../types/jobs-moderation"; +import { parseContent } from "./parse-content.js"; +import { PostType } from "../../types/jobs-moderation.js"; describe("parseContent", () => { describe("tags", () => { diff --git a/src/features/jobs-moderation/parse-content.ts b/src/features/jobs-moderation/parse-content.ts index 12236a43..81a7cbd8 100644 --- a/src/features/jobs-moderation/parse-content.ts +++ b/src/features/jobs-moderation/parse-content.ts @@ -1,5 +1,5 @@ -import { simplifyString } from "../../helpers/string"; -import { Post, PostType } from "../../types/jobs-moderation"; +import { simplifyString } from "../../helpers/string.js"; +import { Post, PostType } from "../../types/jobs-moderation.js"; type SimplifiedTag = string; type StandardTag = string; diff --git a/src/features/jobs-moderation/validate.test.ts b/src/features/jobs-moderation/validate.test.ts index a7eb7528..d3e5eeb1 100644 --- a/src/features/jobs-moderation/validate.test.ts +++ b/src/features/jobs-moderation/validate.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from "vitest"; -import { PostType, POST_FAILURE_REASONS } from "../../types/jobs-moderation"; -import { links, formatting } from "./validate"; +import { PostType, POST_FAILURE_REASONS } from "../../types/jobs-moderation.js"; +import { links, formatting } from "./validate.js"; const makePost = (type: PostType, description: string) => [ { tags: [type], description }, diff --git a/src/features/jobs-moderation/validate.ts b/src/features/jobs-moderation/validate.ts index 86ac1a14..aa1e0704 100644 --- a/src/features/jobs-moderation/validate.ts +++ b/src/features/jobs-moderation/validate.ts @@ -1,16 +1,16 @@ import { Message, MessageType } from "discord.js"; -import { getLastPostAge } from "./job-mod-helpers"; +import { getLastPostAge } from "./job-mod-helpers.js"; -import { countLines } from "../../helpers/string"; -import { extractEmoji } from "../../helpers/string"; -import { parseContent } from "./parse-content"; +import { countLines } from "../../helpers/string.js"; +import { extractEmoji } from "../../helpers/string.js"; +import { parseContent } from "./parse-content.js"; import { JobPostValidator, POST_FAILURE_REASONS, PostFailures, PostType, -} from "../../types/jobs-moderation"; +} from "../../types/jobs-moderation.js"; const validate = (posts: ReturnType, message: Message) => { const errors: PostFailures[] = []; diff --git a/src/features/jobs-moderation/validation-messages.ts b/src/features/jobs-moderation/validation-messages.ts index 1af36348..3e42bff6 100644 --- a/src/features/jobs-moderation/validation-messages.ts +++ b/src/features/jobs-moderation/validation-messages.ts @@ -5,7 +5,7 @@ import { PostFailureTooFrequent, PostFailureTooLong, PostFailureTooManyLines, -} from "../../types/jobs-moderation"; +} from "../../types/jobs-moderation.js"; import { failedCircumventedRules, failedMissingType, @@ -17,7 +17,7 @@ import { failedTooLong, failedTooManyGaps, failedLinkRequired, -} from "./job-mod-helpers"; +} from "./job-mod-helpers.js"; const ValidationMessages = { [POST_FAILURE_REASONS.circumventedRules]: (e: CircumventedRules) => diff --git a/src/features/log.ts b/src/features/log.ts index 777b26b1..71ede815 100644 --- a/src/features/log.ts +++ b/src/features/log.ts @@ -1,5 +1,5 @@ import { ChannelType, Client } from "discord.js"; -import { CHANNELS } from "../constants/channels"; +import { CHANNELS } from "../constants/channels.js"; type Logger = (type: string, text: string) => void; diff --git a/src/features/looking-for-group.ts b/src/features/looking-for-group.ts index 754f7811..12657fa8 100644 --- a/src/features/looking-for-group.ts +++ b/src/features/looking-for-group.ts @@ -8,8 +8,8 @@ import { ButtonBuilder, ButtonStyle, } from "discord.js"; -import { CHANNELS } from "../constants/channels"; -import { EMBED_COLOR } from "./commands"; +import { CHANNELS } from "../constants/channels.js"; +import { EMBED_COLOR } from "./commands.js"; const LOCK_POST = "lock-post"; diff --git a/src/features/mdn.ts b/src/features/mdn.ts index dc4ef4f7..54d1c219 100644 --- a/src/features/mdn.ts +++ b/src/features/mdn.ts @@ -1,5 +1,5 @@ import { SlashCommandBuilder } from "discord.js"; -import { SlashCommand } from "../helpers/discord"; +import { SlashCommand } from "../helpers/discord.js"; const SOURCE_LINK = "-# [source]()"; diff --git a/src/features/mod-activity.ts b/src/features/mod-activity.ts index d887a443..1912be13 100644 --- a/src/features/mod-activity.ts +++ b/src/features/mod-activity.ts @@ -4,7 +4,7 @@ import { GuildMember, PartialGuildMember, } from "discord.js"; -import { logger } from "./log"; +import { logger } from "./log.js"; const guildMemberTimeoutHandler = ( oldMember: GuildMember | PartialGuildMember, diff --git a/src/features/promotion-threads.ts b/src/features/promotion-threads.ts index 7a2700c8..b57387f9 100644 --- a/src/features/promotion-threads.ts +++ b/src/features/promotion-threads.ts @@ -1,6 +1,6 @@ import ogs from "open-graph-scraper"; -import { ChannelHandlers } from "../types"; -import { threadStats } from "../features/stats"; +import type { ChannelHandlers } from "../types/index.d.ts"; +import { threadStats } from "../features/stats.js"; import { format } from "date-fns"; import fetch from "node-fetch"; import { ChannelType } from "discord.js"; @@ -36,6 +36,7 @@ const promotionThread: ChannelHandlers = { } } else { try { + // @ts-expect-error OGS types suck const { result, error } = await ogs({ url: firstLink }); if (error) { console.log("[DEBUG] Erorr when fetching og tags: ", error); diff --git a/src/features/resume-review.ts b/src/features/resume-review.ts index 28e2f607..2f50b842 100644 --- a/src/features/resume-review.ts +++ b/src/features/resume-review.ts @@ -5,11 +5,11 @@ import { ButtonStyle, Message, } from "discord.js"; -import { CHANNELS } from "../constants/channels"; -import { createAttachmentBuilderFromURL } from "../helpers/generate-pdf"; -import { ChannelHandlers } from "../types"; -import cooldown from "./cooldown"; -import { logger } from "./log"; +import { CHANNELS } from "../constants/channels.js"; +import { createAttachmentBuilderFromURL } from "../helpers/generate-pdf.js"; +import type { ChannelHandlers } from "../types/index.d.ts"; +import cooldown from "./cooldown.js"; +import { logger } from "./log.js"; const PDF_CONTENT_TYPE = "application/pdf"; const FIVE_MINUTES_IN_SECONDS = 60 * 5; diff --git a/src/features/resume.ts b/src/features/resume.ts index 12837fbd..50742351 100644 --- a/src/features/resume.ts +++ b/src/features/resume.ts @@ -7,17 +7,17 @@ import { Message, } from "discord.js"; import OpenAI from "openai"; -import { CHANNELS } from "../constants/channels"; -import { openAiKey } from "../helpers/env"; -import { logger } from "./log"; -import { EMBED_COLOR } from "./commands"; +import { CHANNELS } from "../constants/channels.js"; +import { openAiKey } from "../helpers/env.js"; +import { logger } from "./log.js"; +import { EMBED_COLOR } from "./commands.js"; import { DELETE_COMMAND, findResumeAttachment, REVIEW_COMMAND, -} from "./resume-review"; -import { constructDiscordLink } from "../helpers/discord"; -import { retry } from "./retry"; +} from "./resume-review.js"; +import { constructDiscordLink } from "../helpers/discord.js"; +import { retry } from "./retry.js"; const openai = new OpenAI({ apiKey: openAiKey, diff --git a/src/features/scheduled-messages.ts b/src/features/scheduled-messages.ts index b9ecee77..09908c84 100644 --- a/src/features/scheduled-messages.ts +++ b/src/features/scheduled-messages.ts @@ -1,8 +1,12 @@ import type * as discord from "discord.js"; -import { guildId as defaultGuildId } from "../helpers/env"; -import { CHANNELS } from "../constants/channels"; -import { logger } from "./log"; -import { FREQUENCY, scheduleTask, SPECIFIED_TIMES } from "../helpers/schedule"; +import { guildId as defaultGuildId } from "../helpers/env.js"; +import { CHANNELS } from "../constants/channels.js"; +import { logger } from "./log.js"; +import { + FREQUENCY, + scheduleTask, + SPECIFIED_TIMES, +} from "../helpers/schedule.js"; import { ChannelType } from "discord.js"; type MessageConfig = { diff --git a/src/features/stats.ts b/src/features/stats.ts index 05343451..9ce42a50 100644 --- a/src/features/stats.ts +++ b/src/features/stats.ts @@ -1,9 +1,9 @@ import fetch from "node-fetch"; import queryString from "query-string"; import { ChannelType, Client } from "discord.js"; -import { amplitudeKey } from "../helpers/env"; -import { difference } from "../helpers/sets"; -import { mapAppliedTagsToTagNames } from "../helpers/discord"; +import { amplitudeKey } from "../helpers/env.js"; +import { difference } from "../helpers/sets.js"; +import { mapAppliedTagsToTagNames } from "../helpers/discord.js"; type AmplitudeValue = string | number | boolean; type EmitEventData = Record; diff --git a/src/features/troll.ts b/src/features/troll.ts index 94c55dce..ad3dfc98 100644 --- a/src/features/troll.ts +++ b/src/features/troll.ts @@ -1,6 +1,6 @@ import { ChannelType } from "discord.js"; -import { isStaff } from "../helpers/discord"; -import { ChannelHandlers } from "../types"; +import { isStaff } from "../helpers/discord.js"; +import type { ChannelHandlers } from "../types/index.d.ts"; const troll: ChannelHandlers = { handleMessage: async ({ msg, bot }) => { diff --git a/src/features/tsplay.ts b/src/features/tsplay.ts index c42bc34b..2fd35b8a 100644 --- a/src/features/tsplay.ts +++ b/src/features/tsplay.ts @@ -1,6 +1,6 @@ -import { bot } from ".."; -import { ChannelHandlers } from "../types"; -import { EMBED_COLOR } from "./commands"; +import { bot } from "../index.js"; +import type { ChannelHandlers } from "../types/index.js"; +import { EMBED_COLOR } from "./commands.js"; const DELETE_EMOJI = "🗑️"; diff --git a/src/features/voice-activity.ts b/src/features/voice-activity.ts index b9ace9c1..3ee3c343 100644 --- a/src/features/voice-activity.ts +++ b/src/features/voice-activity.ts @@ -4,9 +4,9 @@ import { VoiceBasedChannel, VoiceChannel, } from "discord.js"; -import { channelLog, logger } from "./log"; -import { scheduleTask } from "../helpers/schedule"; -import { CHANNELS } from "../constants/channels"; +import { channelLog, logger } from "./log.js"; +import { scheduleTask } from "../helpers/schedule.js"; +import { CHANNELS } from "../constants/channels.js"; const voiceChannelJoinTimestamps: Record> = {}; diff --git a/src/helpers/array.test.ts b/src/helpers/array.test.ts index 75a7599f..b82d73d5 100644 --- a/src/helpers/array.test.ts +++ b/src/helpers/array.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from "vitest"; -import { partition } from "./array"; +import { partition } from "./array.js"; describe("partition", () => { it("matches regular emoji", () => { diff --git a/src/helpers/deploy-commands.ts b/src/helpers/deploy-commands.ts index 1dd27048..1ecd327d 100644 --- a/src/helpers/deploy-commands.ts +++ b/src/helpers/deploy-commands.ts @@ -12,8 +12,8 @@ import { SlashCommand, UserContextCommand, calculateChangedCommands, -} from "./discord"; -import { applicationId, isProd, discordToken } from "./env"; +} from "./discord.js"; +import { applicationId, isProd, discordToken } from "./env.js"; export const rest = new REST({ version: "10" }).setToken(discordToken); diff --git a/src/helpers/generate-pdf.ts b/src/helpers/generate-pdf.ts index 974c8d8d..f08d2441 100644 --- a/src/helpers/generate-pdf.ts +++ b/src/helpers/generate-pdf.ts @@ -1,7 +1,7 @@ import { AttachmentBuilder } from "discord.js"; import fetch from "node-fetch"; import { fromBase64 } from "pdf2pic"; -import { Options } from "pdf2pic/dist/types/options"; +import type { Options } from "pdf2pic/dist/types/options.js"; const defaultOptions = { density: 200, diff --git a/src/helpers/modLog.ts b/src/helpers/modLog.ts index 97b47fa6..9d6dd117 100644 --- a/src/helpers/modLog.ts +++ b/src/helpers/modLog.ts @@ -4,14 +4,14 @@ import { MessageCreateOptions, MessagePayload, } from "discord.js"; -import { modRoleId } from "../constants"; +import { modRoleId } from "../constants.js"; import { constructDiscordLink, escapeDisruptiveContent, quoteMessageContent, -} from "./discord"; -import { simplifyString } from "../helpers/string"; -import { CHANNELS, getChannel } from "../constants/channels"; +} from "./discord.js"; +import { simplifyString } from "../helpers/string.js"; +import { CHANNELS, getChannel } from "../constants/channels.js"; export const modLog = async ( message: string | MessagePayload | MessageCreateOptions, diff --git a/src/helpers/og-tags.ts b/src/helpers/og-tags.ts index d5577e3d..223a70c0 100644 --- a/src/helpers/og-tags.ts +++ b/src/helpers/og-tags.ts @@ -1,9 +1,14 @@ -import OGS from "open-graph-scraper"; +import OGS from "open-graph-scraper/dist/index.js"; +import type { ErrorResult, SuccessResult } from "open-graph-scraper"; +import type { OpenGraphScraperOptions } from "open-graph-scraper/dist/lib/types.js"; -export const og = async (options: Parameters[0]) => { +export const og = async ( + options: OpenGraphScraperOptions, +): Promise => { try { + // @ts-expect-error because OGS types are shitty return await OGS(options); } catch (e) { - return e as Awaited>; + return e as ErrorResult; } }; diff --git a/src/helpers/react-docs.test.ts b/src/helpers/react-docs.test.ts index b147665f..608d403d 100644 --- a/src/helpers/react-docs.test.ts +++ b/src/helpers/react-docs.test.ts @@ -1,5 +1,5 @@ import { describe, expect, test } from "vitest"; -import { extractSearchKey, getReactDocsSearchKey } from "./react-docs"; +import { extractSearchKey, getReactDocsSearchKey } from "./react-docs.js"; describe("React documentation command", () => { test.each([ diff --git a/src/helpers/react-docs.ts b/src/helpers/react-docs.ts index bdd196eb..e6d2718a 100644 --- a/src/helpers/react-docs.ts +++ b/src/helpers/react-docs.ts @@ -1,5 +1,5 @@ import fetch from "node-fetch"; -import { gitHubReadToken } from "./env"; +import { gitHubReadToken } from "./env.js"; const LOOKUP_REGEX = /\s*(.*?)\s*<\/Intro>/gs; const LINK_REGEX = /\[([^\]]+)\]\((?!https?:\/\/)([^)]+)\)/g; diff --git a/src/helpers/string.test.ts b/src/helpers/string.test.ts index bcb86ec9..f7f4b223 100644 --- a/src/helpers/string.test.ts +++ b/src/helpers/string.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from "vitest"; -import { countLines, extractEmoji } from "./string"; +import { countLines, extractEmoji } from "./string.js"; describe("extractEmoji", () => { it("matches regular emoji", () => { @@ -23,8 +23,11 @@ describe("extractEmoji", () => { expect(extractEmoji("Chuỗi kiểm tra và không có gì")).toEqual([]); }); it("doesn’t match funky invisible Unicode characters", () => { - // eslint-disable-next-line no-irregular-whitespace - expect(extractEmoji(`   
`)).toEqual([]); + expect( + // eslint-disable-next-line no-irregular-whitespace + extractEmoji(`    +`), + ).toEqual([]); }); }); diff --git a/src/index.ts b/src/index.ts index 0387f8e0..aef62462 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,4 +1,6 @@ -import discord, { +import "dotenv/config"; +import { + Client, Message, MessageReaction, User, @@ -9,34 +11,37 @@ import discord, { IntentsBitField, } from "discord.js"; -import { logger, channelLog } from "./features/log"; +import { logger, channelLog } from "./features/log.js"; // import codeblock from './features/codeblock'; -import jobsMod, { resetJobCacheCommand } from "./features/jobs-moderation"; -import { resumeResources } from "./features/resume"; -import { lookingForGroup } from "./features/looking-for-group"; -import autoban from "./features/autoban"; -import commands from "./features/commands"; -import setupStats from "./features/stats"; -import emojiMod from "./features/emojiMod"; -import promotionThread from "./features/promotion-threads"; -import autothread, { cleanupThreads } from "./features/autothread"; -import voiceActivity from "./features/voice-activity"; - -import { ChannelHandlers } from "./types"; -import { scheduleMessages } from "./features/scheduled-messages"; -import tsPlaygroundLinkShortener from "./features/tsplay"; -import { CHANNELS, initCachedChannels } from "./constants/channels"; -import { scheduleTask } from "./helpers/schedule"; -import { discordToken, isProd } from "./helpers/env"; -import { registerCommand, deployCommands } from "./helpers/deploy-commands"; -import resumeReviewPdf from "./features/resume-review"; -import troll from "./features/troll"; -import { modActivity } from "./features/mod-activity"; -import { debugEventButtonHandler, debugEvents } from "./features/debug-events"; -import { recommendBookCommand } from "./features/book-list"; -import { mdnSearch } from "./features/mdn"; - -export const bot = new discord.Client({ +import jobsMod, { resetJobCacheCommand } from "./features/jobs-moderation.js"; +import { resumeResources } from "./features/resume.js"; +import { lookingForGroup } from "./features/looking-for-group.js"; +import autoban from "./features/autoban.js"; +import commands from "./features/commands.js"; +import setupStats from "./features/stats.js"; +import emojiMod from "./features/emojiMod.js"; +import promotionThread from "./features/promotion-threads.js"; +import autothread, { cleanupThreads } from "./features/autothread.js"; +import voiceActivity from "./features/voice-activity.js"; + +import type { ChannelHandlers } from "./types/index.js"; +import { scheduleMessages } from "./features/scheduled-messages.js"; +import tsPlaygroundLinkShortener from "./features/tsplay.js"; +import { CHANNELS, initCachedChannels } from "./constants/channels.js"; +import { scheduleTask } from "./helpers/schedule.js"; +import { discordToken, isProd } from "./helpers/env.js"; +import { registerCommand, deployCommands } from "./helpers/deploy-commands.js"; +import resumeReviewPdf from "./features/resume-review.js"; +import troll from "./features/troll.js"; +import { modActivity } from "./features/mod-activity.js"; +import { + debugEventButtonHandler, + debugEvents, +} from "./features/debug-events.js"; +import { recommendBookCommand } from "./features/book-list.js"; +import { mdnSearch } from "./features/mdn.js"; + +export const bot = new Client({ intents: [ IntentsBitField.Flags.Guilds, IntentsBitField.Flags.GuildMembers, diff --git a/src/types/index.ts b/src/types/index.d.ts similarity index 100% rename from src/types/index.ts rename to src/types/index.d.ts diff --git a/tsconfig.json b/tsconfig.json index a4cff8ff..17a1277c 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,12 +1,13 @@ { "compilerOptions": { - "target": "ES2020", - "module": "commonjs", + "target": "ES2022", + "module": "Node16", "sourceMap": true, "outDir": "dist", + "skipLibCheck": true, "strict": true, "allowJs": false, - "moduleResolution": "node", + "moduleResolution": "node16", "esModuleInterop": true, "forceConsistentCasingInFileNames": true },