From 8bc703f90a4097a41890923a0b1686cf029faea1 Mon Sep 17 00:00:00 2001 From: Tim Date: Fri, 16 Feb 2024 22:27:25 +1300 Subject: [PATCH] update effect --- package.json | 22 +- pnpm-lock.yaml | 415 +++++++++++++-------------- src/Cache/driver.ts | 10 +- src/Cache/memory.ts | 4 +- src/Cache/memoryTTL.ts | 5 +- src/Cache/prelude.ts | 18 +- src/DiscordGateway/DiscordWS.ts | 7 +- src/DiscordGateway/Shard/identify.ts | 6 +- src/DiscordGateway/Shard/utils.ts | 10 +- src/DiscordGateway/ShardStore.ts | 4 +- src/DiscordGateway/Sharder.ts | 11 +- src/DiscordGateway/WS.ts | 7 +- src/DiscordREST.ts | 41 ++- src/DiscordREST/types.ts | 7 +- src/Interactions/context.ts | 39 +-- src/Interactions/definitions.ts | 47 +-- src/Interactions/gateway.ts | 33 ++- src/Interactions/handlers.ts | 6 +- src/Interactions/utils.ts | 24 +- src/Interactions/webhook.ts | 17 +- src/utils/Effect.ts | 4 +- 21 files changed, 396 insertions(+), 341 deletions(-) diff --git a/package.json b/package.json index 7f86e07..af7c751 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,7 @@ "ws": "^8.16.0" }, "peerDependencies": { - "@effect/platform": "^0.44.0", + "@effect/platform": "^0.45.0", "effect": "^2.3.0" }, "optionalDependencies": { @@ -64,20 +64,20 @@ "@effect/babel-plugin": "^0.2.0", "@effect/build-utils": "^0.7.2", "@effect/language-service": "^0.1.0", - "@effect/platform": "^0.44.0", - "@effect/platform-node": "^0.43.0", + "@effect/platform": "^0.45.3", + "@effect/platform-node": "^0.44.4", "@tim-smart/discord-api-docs-parser": "^0.5.10", "@types/chai": "^4.3.11", - "@types/node": "^20.11.17", + "@types/node": "^20.11.19", "@types/ws": "^8.5.10", - "@typescript-eslint/eslint-plugin": "^6.21.0", - "@typescript-eslint/parser": "^6.21.0", + "@typescript-eslint/eslint-plugin": "^7.0.1", + "@typescript-eslint/parser": "^7.0.1", "@vitejs/plugin-react": "^4.2.1", "@vitest/coverage-v8": "^1.2.2", "babel-plugin-annotate-pure-calls": "^0.4.0", "concurrently": "^8.2.2", - "dotenv": "^16.4.1", - "effect": "^2.3.0", + "dotenv": "^16.4.4", + "effect": "^2.3.6", "eslint": "^8.56.0", "eslint-config-prettier": "^9.1.0", "eslint-import-resolver-typescript": "^3.6.1", @@ -85,16 +85,16 @@ "eslint-plugin-deprecation": "^2.0.0", "eslint-plugin-import": "^2.29.1", "eslint-plugin-prettier": "^5.1.3", - "eslint-plugin-simple-import-sort": "^11.0.0", + "eslint-plugin-simple-import-sort": "^12.0.0", "eslint-plugin-sort-destructure-keys": "^1.5.0", "lerna": "^8.1.2", "madge": "^6.1.0", "prettier": "^3.2.5", "rimraf": "^5.0.5", "ts-node": "^10.9.2", - "tsx": "^4.7.0", + "tsx": "^4.7.1", "typescript": "^5.3.3", - "vite": "^5.1.0", + "vite": "^5.1.3", "vitest": "1.2.2" }, "sideEffects": false, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index fa141f0..20f158a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -55,11 +55,11 @@ devDependencies: specifier: ^0.1.0 version: 0.1.0 '@effect/platform': - specifier: ^0.44.0 - version: 0.44.0(@effect/schema@0.62.0)(effect@2.3.0) + specifier: ^0.45.3 + version: 0.45.3(@effect/schema@0.62.7)(effect@2.3.6) '@effect/platform-node': - specifier: ^0.43.0 - version: 0.43.0(@effect/platform@0.44.0)(effect@2.3.0) + specifier: ^0.44.4 + version: 0.44.4(@effect/platform@0.45.3)(effect@2.3.6) '@tim-smart/discord-api-docs-parser': specifier: ^0.5.10 version: 0.5.10 @@ -67,20 +67,20 @@ devDependencies: specifier: ^4.3.11 version: 4.3.11 '@types/node': - specifier: ^20.11.17 - version: 20.11.17 + specifier: ^20.11.19 + version: 20.11.19 '@types/ws': specifier: ^8.5.10 version: 8.5.10 '@typescript-eslint/eslint-plugin': - specifier: ^6.21.0 - version: 6.21.0(@typescript-eslint/parser@6.21.0)(eslint@8.56.0)(typescript@5.3.3) + specifier: ^7.0.1 + version: 7.0.1(@typescript-eslint/parser@7.0.1)(eslint@8.56.0)(typescript@5.3.3) '@typescript-eslint/parser': - specifier: ^6.21.0 - version: 6.21.0(eslint@8.56.0)(typescript@5.3.3) + specifier: ^7.0.1 + version: 7.0.1(eslint@8.56.0)(typescript@5.3.3) '@vitejs/plugin-react': specifier: ^4.2.1 - version: 4.2.1(vite@5.1.0) + version: 4.2.1(vite@5.1.3) '@vitest/coverage-v8': specifier: ^1.2.2 version: 1.2.2(vitest@1.2.2) @@ -91,11 +91,11 @@ devDependencies: specifier: ^8.2.2 version: 8.2.2 dotenv: - specifier: ^16.4.1 - version: 16.4.1 + specifier: ^16.4.4 + version: 16.4.4 effect: - specifier: ^2.3.0 - version: 2.3.0 + specifier: ^2.3.6 + version: 2.3.6 eslint: specifier: ^8.56.0 version: 8.56.0 @@ -104,7 +104,7 @@ devDependencies: version: 9.1.0(eslint@8.56.0) eslint-import-resolver-typescript: specifier: ^3.6.1 - version: 3.6.1(@typescript-eslint/parser@6.21.0)(eslint-plugin-import@2.29.1)(eslint@8.56.0) + version: 3.6.1(@typescript-eslint/parser@7.0.1)(eslint-plugin-import@2.29.1)(eslint@8.56.0) eslint-plugin-codegen: specifier: 0.23.0 version: 0.23.0(eslint@8.56.0) @@ -113,13 +113,13 @@ devDependencies: version: 2.0.0(eslint@8.56.0)(typescript@5.3.3) eslint-plugin-import: specifier: ^2.29.1 - version: 2.29.1(@typescript-eslint/parser@6.21.0)(eslint-import-resolver-typescript@3.6.1)(eslint@8.56.0) + version: 2.29.1(@typescript-eslint/parser@7.0.1)(eslint-import-resolver-typescript@3.6.1)(eslint@8.56.0) eslint-plugin-prettier: specifier: ^5.1.3 version: 5.1.3(eslint-config-prettier@9.1.0)(eslint@8.56.0)(prettier@3.2.5) eslint-plugin-simple-import-sort: - specifier: ^11.0.0 - version: 11.0.0(eslint@8.56.0) + specifier: ^12.0.0 + version: 12.0.0(eslint@8.56.0) eslint-plugin-sort-destructure-keys: specifier: ^1.5.0 version: 1.5.0(eslint@8.56.0) @@ -137,19 +137,19 @@ devDependencies: version: 5.0.5 ts-node: specifier: ^10.9.2 - version: 10.9.2(@types/node@20.11.17)(typescript@5.3.3) + version: 10.9.2(@types/node@20.11.19)(typescript@5.3.3) tsx: - specifier: ^4.7.0 - version: 4.7.0 + specifier: ^4.7.1 + version: 4.7.1 typescript: specifier: ^5.3.3 version: 5.3.3 vite: - specifier: ^5.1.0 - version: 5.1.0(@types/node@20.11.17) + specifier: ^5.1.3 + version: 5.1.3(@types/node@20.11.19) vitest: specifier: 1.2.2 - version: 1.2.2(@types/node@20.11.17) + version: 1.2.2(@types/node@20.11.19) packages: @@ -694,49 +694,49 @@ packages: resolution: {integrity: sha512-BnlM8LlaqCAYgdRfxlbR7gXGh/FD1scL1fPgNVJEPoOM08od1jtJz+iKhwfaud8TPnnhZR+TED2h5ynjanLeCQ==} dev: true - /@effect/platform-node-shared@0.1.0(@effect/platform@0.44.0)(effect@2.3.0): - resolution: {integrity: sha512-foCPgZ6gCvDO19/R9Dt6RhOqcmPGIV9ObpicIjKDmEXCKOD2gIrOo+KZvbucmCbXE8wzOLyXbStRu5BX+jwv6Q==} + /@effect/platform-node-shared@0.1.11(@effect/platform@0.45.3)(effect@2.3.6): + resolution: {integrity: sha512-+87/biebOBH7Iq79M5+j0R3mvwFr5kBnqwv0zUdAfHSJgus/DjASPgudqEikZJ/nM7FEgOoFsFtDPRAm7P3mrA==} peerDependencies: - '@effect/platform': ^0.44.0 - effect: ^2.3.0 + '@effect/platform': ^0.45.3 + effect: ^2.3.6 dependencies: - '@effect/platform': 0.44.0(@effect/schema@0.62.0)(effect@2.3.0) - effect: 2.3.0 + '@effect/platform': 0.45.3(@effect/schema@0.62.7)(effect@2.3.6) + effect: 2.3.6 multipasta: 0.1.21 dev: true - /@effect/platform-node@0.43.0(@effect/platform@0.44.0)(effect@2.3.0): - resolution: {integrity: sha512-Wl6yK+AeKLIpMUH37VgazhSqa+5Zf6EZQWXpqmqpHXcsw5cyYSSeN7GqBpIuSm1MqJewGbcsQzS7f3LBRrnSkw==} + /@effect/platform-node@0.44.4(@effect/platform@0.45.3)(effect@2.3.6): + resolution: {integrity: sha512-5fgDCNGnWLPc98pfUstwReFYaAcUp6Ag7IYLQV9t1c0G/sHt04/wWgjG3DO667k8aYzie3tyhPaT37moJ3guKQ==} peerDependencies: - '@effect/platform': ^0.44.0 - effect: ^2.3.0 + '@effect/platform': ^0.45.3 + effect: ^2.3.6 dependencies: - '@effect/platform': 0.44.0(@effect/schema@0.62.0)(effect@2.3.0) - '@effect/platform-node-shared': 0.1.0(@effect/platform@0.44.0)(effect@2.3.0) - effect: 2.3.0 + '@effect/platform': 0.45.3(@effect/schema@0.62.7)(effect@2.3.6) + '@effect/platform-node-shared': 0.1.11(@effect/platform@0.45.3)(effect@2.3.6) + effect: 2.3.6 mime: 3.0.0 dev: true - /@effect/platform@0.44.0(@effect/schema@0.62.0)(effect@2.3.0): - resolution: {integrity: sha512-hUYeupB24KQUXqwP0SOEcnyalQCWFvuG5Q1tfiXmc3ufAUy9ao2UJjCmFeP8qsYWg5GZlVpjUPk/87zqzoG+Nw==} + /@effect/platform@0.45.3(@effect/schema@0.62.7)(effect@2.3.6): + resolution: {integrity: sha512-qVginaqVdtKN+OKbGrlAiDGzvO6V1keVFLnjUY4M+YUTmgCVo68Z4OsCKMvD+fwKR5HaqFPqKnZNh+LvlIfW8g==} peerDependencies: - '@effect/schema': ^0.62.0 - effect: ^2.3.0 + '@effect/schema': ^0.62.7 + effect: ^2.3.6 dependencies: - '@effect/schema': 0.62.0(effect@2.3.0)(fast-check@3.15.1) - effect: 2.3.0 + '@effect/schema': 0.62.7(effect@2.3.6)(fast-check@3.15.1) + effect: 2.3.6 find-my-way-ts: 0.1.1 multipasta: 0.1.21 path-browserify: 1.0.1 dev: true - /@effect/schema@0.62.0(effect@2.3.0)(fast-check@3.15.1): - resolution: {integrity: sha512-woPL7gQ4eSoSfI8fbqVRBhKJvZSjdTWT0kvkRyrQ7zTAxFIykVYn3i3j0Y6Fv5Yb6p7TQBAjksrCyq5rb9bQOw==} + /@effect/schema@0.62.7(effect@2.3.6)(fast-check@3.15.1): + resolution: {integrity: sha512-AGrnQDC0hw5VknesZm4zGjY7EkgKwp+5kzMcFlna96MFLaGOGinZiZeldGep7ByNWsa4Bbz9BfEQcr/knqJpjw==} peerDependencies: - effect: ^2.3.0 + effect: ^2.3.6 fast-check: ^3.13.2 dependencies: - effect: 2.3.0 + effect: 2.3.6 fast-check: 3.15.1 dev: true @@ -1047,7 +1047,7 @@ packages: '@jest/schemas': 29.6.3 '@types/istanbul-lib-coverage': 2.0.6 '@types/istanbul-reports': 3.0.4 - '@types/node': 20.11.17 + '@types/node': 20.11.19 '@types/yargs': 17.0.32 chalk: 4.1.2 dev: true @@ -1211,7 +1211,7 @@ packages: engines: {node: '>= 8'} dependencies: '@nodelib/fs.scandir': 2.1.5 - fastq: 1.16.0 + fastq: 1.17.1 dev: true /@npmcli/agent@2.2.1: @@ -1550,104 +1550,104 @@ packages: engines: {node: ^12.20.0 || ^14.18.0 || >=16.0.0} dev: true - /@rollup/rollup-android-arm-eabi@4.9.6: - resolution: {integrity: sha512-MVNXSSYN6QXOulbHpLMKYi60ppyO13W9my1qogeiAqtjb2yR4LSmfU2+POvDkLzhjYLXz9Rf9+9a3zFHW1Lecg==} + /@rollup/rollup-android-arm-eabi@4.11.0: + resolution: {integrity: sha512-BV+u2QSfK3i1o6FucqJh5IK9cjAU6icjFFhvknzFgu472jzl0bBojfDAkJLBEsHFMo+YZg6rthBvBBt8z12IBQ==} cpu: [arm] os: [android] requiresBuild: true dev: true optional: true - /@rollup/rollup-android-arm64@4.9.6: - resolution: {integrity: sha512-T14aNLpqJ5wzKNf5jEDpv5zgyIqcpn1MlwCrUXLrwoADr2RkWA0vOWP4XxbO9aiO3dvMCQICZdKeDrFl7UMClw==} + /@rollup/rollup-android-arm64@4.11.0: + resolution: {integrity: sha512-0ij3iw7sT5jbcdXofWO2NqDNjSVVsf6itcAkV2I6Xsq4+6wjW1A8rViVB67TfBEan7PV2kbLzT8rhOVWLI2YXw==} cpu: [arm64] os: [android] requiresBuild: true dev: true optional: true - /@rollup/rollup-darwin-arm64@4.9.6: - resolution: {integrity: sha512-CqNNAyhRkTbo8VVZ5R85X73H3R5NX9ONnKbXuHisGWC0qRbTTxnF1U4V9NafzJbgGM0sHZpdO83pLPzq8uOZFw==} + /@rollup/rollup-darwin-arm64@4.11.0: + resolution: {integrity: sha512-yPLs6RbbBMupArf6qv1UDk6dzZvlH66z6NLYEwqTU0VHtss1wkI4UYeeMS7TVj5QRVvaNAWYKP0TD/MOeZ76Zg==} cpu: [arm64] os: [darwin] requiresBuild: true dev: true optional: true - /@rollup/rollup-darwin-x64@4.9.6: - resolution: {integrity: sha512-zRDtdJuRvA1dc9Mp6BWYqAsU5oeLixdfUvkTHuiYOHwqYuQ4YgSmi6+/lPvSsqc/I0Omw3DdICx4Tfacdzmhog==} + /@rollup/rollup-darwin-x64@4.11.0: + resolution: {integrity: sha512-OvqIgwaGAwnASzXaZEeoJY3RltOFg+WUbdkdfoluh2iqatd090UeOG3A/h0wNZmE93dDew9tAtXgm3/+U/B6bw==} cpu: [x64] os: [darwin] requiresBuild: true dev: true optional: true - /@rollup/rollup-linux-arm-gnueabihf@4.9.6: - resolution: {integrity: sha512-oNk8YXDDnNyG4qlNb6is1ojTOGL/tRhbbKeE/YuccItzerEZT68Z9gHrY3ROh7axDc974+zYAPxK5SH0j/G+QQ==} + /@rollup/rollup-linux-arm-gnueabihf@4.11.0: + resolution: {integrity: sha512-X17s4hZK3QbRmdAuLd2EE+qwwxL8JxyVupEqAkxKPa/IgX49ZO+vf0ka69gIKsaYeo6c1CuwY3k8trfDtZ9dFg==} cpu: [arm] os: [linux] requiresBuild: true dev: true optional: true - /@rollup/rollup-linux-arm64-gnu@4.9.6: - resolution: {integrity: sha512-Z3O60yxPtuCYobrtzjo0wlmvDdx2qZfeAWTyfOjEDqd08kthDKexLpV97KfAeUXPosENKd8uyJMRDfFMxcYkDQ==} + /@rollup/rollup-linux-arm64-gnu@4.11.0: + resolution: {integrity: sha512-673Lu9EJwxVB9NfYeA4AdNu0FOHz7g9t6N1DmT7bZPn1u6bTF+oZjj+fuxUcrfxWXE0r2jxl5QYMa9cUOj9NFg==} cpu: [arm64] os: [linux] requiresBuild: true dev: true optional: true - /@rollup/rollup-linux-arm64-musl@4.9.6: - resolution: {integrity: sha512-gpiG0qQJNdYEVad+1iAsGAbgAnZ8j07FapmnIAQgODKcOTjLEWM9sRb+MbQyVsYCnA0Im6M6QIq6ax7liws6eQ==} + /@rollup/rollup-linux-arm64-musl@4.11.0: + resolution: {integrity: sha512-yFW2msTAQNpPJaMmh2NpRalr1KXI7ZUjlN6dY/FhWlOclMrZezm5GIhy3cP4Ts2rIAC+IPLAjNibjp1BsxCVGg==} cpu: [arm64] os: [linux] requiresBuild: true dev: true optional: true - /@rollup/rollup-linux-riscv64-gnu@4.9.6: - resolution: {integrity: sha512-+uCOcvVmFUYvVDr27aiyun9WgZk0tXe7ThuzoUTAukZJOwS5MrGbmSlNOhx1j80GdpqbOty05XqSl5w4dQvcOA==} + /@rollup/rollup-linux-riscv64-gnu@4.11.0: + resolution: {integrity: sha512-kKT9XIuhbvYgiA3cPAGntvrBgzhWkGpBMzuk1V12Xuoqg7CI41chye4HU0vLJnGf9MiZzfNh4I7StPeOzOWJfA==} cpu: [riscv64] os: [linux] requiresBuild: true dev: true optional: true - /@rollup/rollup-linux-x64-gnu@4.9.6: - resolution: {integrity: sha512-HUNqM32dGzfBKuaDUBqFB7tP6VMN74eLZ33Q9Y1TBqRDn+qDonkAUyKWwF9BR9unV7QUzffLnz9GrnKvMqC/fw==} + /@rollup/rollup-linux-x64-gnu@4.11.0: + resolution: {integrity: sha512-6q4ESWlyTO+erp1PSCmASac+ixaDv11dBk1fqyIuvIUc/CmRAX2Zk+2qK1FGo5q7kyDcjHCFVwgGFCGIZGVwCA==} cpu: [x64] os: [linux] requiresBuild: true dev: true optional: true - /@rollup/rollup-linux-x64-musl@4.9.6: - resolution: {integrity: sha512-ch7M+9Tr5R4FK40FHQk8VnML0Szi2KRujUgHXd/HjuH9ifH72GUmw6lStZBo3c3GB82vHa0ZoUfjfcM7JiiMrQ==} + /@rollup/rollup-linux-x64-musl@4.11.0: + resolution: {integrity: sha512-vIAQUmXeMLmaDN78HSE4Kh6xqof2e3TJUKr+LPqXWU4NYNON0MDN9h2+t4KHrPAQNmU3w1GxBQ/n01PaWFwa5w==} cpu: [x64] os: [linux] requiresBuild: true dev: true optional: true - /@rollup/rollup-win32-arm64-msvc@4.9.6: - resolution: {integrity: sha512-VD6qnR99dhmTQ1mJhIzXsRcTBvTjbfbGGwKAHcu+52cVl15AC/kplkhxzW/uT0Xl62Y/meBKDZvoJSJN+vTeGA==} + /@rollup/rollup-win32-arm64-msvc@4.11.0: + resolution: {integrity: sha512-LVXo9dDTGPr0nezMdqa1hK4JeoMZ02nstUxGYY/sMIDtTYlli1ZxTXBYAz3vzuuvKO4X6NBETciIh7N9+abT1g==} cpu: [arm64] os: [win32] requiresBuild: true dev: true optional: true - /@rollup/rollup-win32-ia32-msvc@4.9.6: - resolution: {integrity: sha512-J9AFDq/xiRI58eR2NIDfyVmTYGyIZmRcvcAoJ48oDld/NTR8wyiPUu2X/v1navJ+N/FGg68LEbX3Ejd6l8B7MQ==} + /@rollup/rollup-win32-ia32-msvc@4.11.0: + resolution: {integrity: sha512-xZVt6K70Gr3I7nUhug2dN6VRR1ibot3rXqXS3wo+8JP64t7djc3lBFyqO4GiVrhNaAIhUCJtwQ/20dr0h0thmQ==} cpu: [ia32] os: [win32] requiresBuild: true dev: true optional: true - /@rollup/rollup-win32-x64-msvc@4.9.6: - resolution: {integrity: sha512-jqzNLhNDvIZOrt69Ce4UjGRpXJBzhUBzawMwnaDAwyHriki3XollsewxWzOzz+4yOFDkuJHtTsZFwMxhYJWmLQ==} + /@rollup/rollup-win32-x64-msvc@4.11.0: + resolution: {integrity: sha512-f3I7h9oTg79UitEco9/2bzwdciYkWr8pITs3meSDSlr1TdvQ7IxkQaaYN2YqZXX5uZhiYL+VuYDmHwNzhx+HOg==} cpu: [x64] os: [win32] requiresBuild: true @@ -1831,7 +1831,7 @@ packages: requiresBuild: true dependencies: '@types/connect': 3.4.36 - '@types/node': 20.11.17 + '@types/node': 20.11.19 dev: false optional: true @@ -1843,7 +1843,7 @@ packages: resolution: {integrity: sha512-P63Zd/JUGq+PdrM1lv0Wv5SBYeA2+CORvbrXbngriYY0jzLUWfQMQQxOhjONEz/wlHOAxOdY7CY65rgQdTjq2w==} requiresBuild: true dependencies: - '@types/node': 20.11.17 + '@types/node': 20.11.19 dev: false optional: true @@ -1866,7 +1866,7 @@ packages: resolution: {integrity: sha512-ZohaCYTgGFcOP7u6aJOhY9uIZQgZ2vxC2yWoArY+FeDXlqeH66ZVBjgvg+RLVAS/DWNq4Ap9ZXu1+SUQiiWYMg==} requiresBuild: true dependencies: - '@types/node': 20.11.17 + '@types/node': 20.11.19 '@types/qs': 6.9.8 '@types/range-parser': 1.2.5 '@types/send': 0.17.2 @@ -1888,7 +1888,7 @@ packages: resolution: {integrity: sha512-SEYeGAIQIQX8NN6LDKprLjbrd5dARM5EXsd8GI/A5l0apYI1fGMWgPHSe4ZKL4eozlAyI+doUE9XbYS4xCkQ1w==} dependencies: '@types/minimatch': 5.1.2 - '@types/node': 20.11.17 + '@types/node': 20.11.19 dev: true /@types/http-errors@2.0.2: @@ -1970,8 +1970,8 @@ packages: resolution: {integrity: sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ==} dev: true - /@types/node@20.11.17: - resolution: {integrity: sha512-QmgQZGWu1Yw9TDyAP9ZzpFJKynYNeOvwMJmaxABfieQoVoiVOS6MN1WSpqpRcbeA5+RW82kraAVxCCJg+780Qw==} + /@types/node@20.11.19: + resolution: {integrity: sha512-7xMnVEcZFu0DikYjWOlRq7NTPETrm7teqUT2WkQjrTIkEgUyyGdWsj/Zg8bEJt5TNklzbPD1X3fqfsHw3SpapQ==} dependencies: undici-types: 5.26.5 @@ -1995,12 +1995,16 @@ packages: resolution: {integrity: sha512-dn1l8LaMea/IjDoHNd9J52uBbInB796CDffS6VdIxvqYCPSG0V0DzHp76GpaWnlhg88uYyPbXCDIowa86ybd5A==} dev: true + /@types/semver@7.5.7: + resolution: {integrity: sha512-/wdoPq1QqkSj9/QOeKkFquEuPzQbHTWAMPH/PaUMB+JuR31lXhlWXRZ52IpfDYVlDOUBvX09uBrPwxGT1hjNBg==} + dev: true + /@types/send@0.17.2: resolution: {integrity: sha512-aAG6yRf6r0wQ29bkS+x97BIs64ZLxeE/ARwyS6wrldMm3C1MdKwCcnnEwMC1slI8wuxJOpiUH9MioC0A0i+GJw==} requiresBuild: true dependencies: '@types/mime': 1.3.3 - '@types/node': 20.11.17 + '@types/node': 20.11.19 dev: false optional: true @@ -2010,7 +2014,7 @@ packages: dependencies: '@types/http-errors': 2.0.2 '@types/mime': 3.0.2 - '@types/node': 20.11.17 + '@types/node': 20.11.19 dev: false optional: true @@ -2025,7 +2029,7 @@ packages: /@types/ws@8.5.10: resolution: {integrity: sha512-vmQSUcfalpIq0R9q7uTo2lXs6eGIpt9wtnLdMv9LVpIjCA/+ufZRozlVoVelIYixx1ugCBKDhn89vnsEGOCx9A==} dependencies: - '@types/node': 20.11.17 + '@types/node': 20.11.19 dev: true /@types/yargs-parser@21.0.3: @@ -2038,23 +2042,23 @@ packages: '@types/yargs-parser': 21.0.3 dev: true - /@typescript-eslint/eslint-plugin@6.21.0(@typescript-eslint/parser@6.21.0)(eslint@8.56.0)(typescript@5.3.3): - resolution: {integrity: sha512-oy9+hTPCUFpngkEZUSzbf9MxI65wbKFoQYsgPdILTfbUldp5ovUuphZVe4i30emU9M/kP+T64Di0mxl7dSw3MA==} + /@typescript-eslint/eslint-plugin@7.0.1(@typescript-eslint/parser@7.0.1)(eslint@8.56.0)(typescript@5.3.3): + resolution: {integrity: sha512-OLvgeBv3vXlnnJGIAgCLYKjgMEU+wBGj07MQ/nxAaON+3mLzX7mJbhRYrVGiVvFiXtwFlkcBa/TtmglHy0UbzQ==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: - '@typescript-eslint/parser': ^6.0.0 || ^6.0.0-alpha - eslint: ^7.0.0 || ^8.0.0 + '@typescript-eslint/parser': ^7.0.0 + eslint: ^8.56.0 typescript: '*' peerDependenciesMeta: typescript: optional: true dependencies: '@eslint-community/regexpp': 4.10.0 - '@typescript-eslint/parser': 6.21.0(eslint@8.56.0)(typescript@5.3.3) - '@typescript-eslint/scope-manager': 6.21.0 - '@typescript-eslint/type-utils': 6.21.0(eslint@8.56.0)(typescript@5.3.3) - '@typescript-eslint/utils': 6.21.0(eslint@8.56.0)(typescript@5.3.3) - '@typescript-eslint/visitor-keys': 6.21.0 + '@typescript-eslint/parser': 7.0.1(eslint@8.56.0)(typescript@5.3.3) + '@typescript-eslint/scope-manager': 7.0.1 + '@typescript-eslint/type-utils': 7.0.1(eslint@8.56.0)(typescript@5.3.3) + '@typescript-eslint/utils': 7.0.1(eslint@8.56.0)(typescript@5.3.3) + '@typescript-eslint/visitor-keys': 7.0.1 debug: 4.3.4 eslint: 8.56.0 graphemer: 1.4.0 @@ -2067,20 +2071,20 @@ packages: - supports-color dev: true - /@typescript-eslint/parser@6.21.0(eslint@8.56.0)(typescript@5.3.3): - resolution: {integrity: sha512-tbsV1jPne5CkFQCgPBcDOt30ItF7aJoZL997JSF7MhGQqOeT3svWRYxiqlfA5RUdlHN6Fi+EI9bxqbdyAUZjYQ==} + /@typescript-eslint/parser@7.0.1(eslint@8.56.0)(typescript@5.3.3): + resolution: {integrity: sha512-8GcRRZNzaHxKzBPU3tKtFNing571/GwPBeCvmAUw0yBtfE2XVd0zFKJIMSWkHJcPQi0ekxjIts6L/rrZq5cxGQ==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: - eslint: ^7.0.0 || ^8.0.0 + eslint: ^8.56.0 typescript: '*' peerDependenciesMeta: typescript: optional: true dependencies: - '@typescript-eslint/scope-manager': 6.21.0 - '@typescript-eslint/types': 6.21.0 - '@typescript-eslint/typescript-estree': 6.21.0(typescript@5.3.3) - '@typescript-eslint/visitor-keys': 6.21.0 + '@typescript-eslint/scope-manager': 7.0.1 + '@typescript-eslint/types': 7.0.1 + '@typescript-eslint/typescript-estree': 7.0.1(typescript@5.3.3) + '@typescript-eslint/visitor-keys': 7.0.1 debug: 4.3.4 eslint: 8.56.0 typescript: 5.3.3 @@ -2088,14 +2092,6 @@ packages: - supports-color dev: true - /@typescript-eslint/scope-manager@6.21.0: - resolution: {integrity: sha512-OwLUIWZJry80O99zvqXVEioyniJMa+d2GrqpUTqi5/v5D5rOrppJVBPa0yKCblcigC0/aYAzxxqQ1B+DS2RYsg==} - engines: {node: ^16.0.0 || >=18.0.0} - dependencies: - '@typescript-eslint/types': 6.21.0 - '@typescript-eslint/visitor-keys': 6.21.0 - dev: true - /@typescript-eslint/scope-manager@6.8.0: resolution: {integrity: sha512-xe0HNBVwCph7rak+ZHcFD6A+q50SMsFwcmfdjs9Kz4qDh5hWhaPhFjRs/SODEhroBI5Ruyvyz9LfwUJ624O40g==} engines: {node: ^16.0.0 || >=18.0.0} @@ -2104,18 +2100,26 @@ packages: '@typescript-eslint/visitor-keys': 6.8.0 dev: true - /@typescript-eslint/type-utils@6.21.0(eslint@8.56.0)(typescript@5.3.3): - resolution: {integrity: sha512-rZQI7wHfao8qMX3Rd3xqeYSMCL3SoiSQLBATSiVKARdFGCYSRvmViieZjqc58jKgs8Y8i9YvVVhRbHSTA4VBag==} + /@typescript-eslint/scope-manager@7.0.1: + resolution: {integrity: sha512-v7/T7As10g3bcWOOPAcbnMDuvctHzCFYCG/8R4bK4iYzdFqsZTbXGln0cZNVcwQcwewsYU2BJLay8j0/4zOk4w==} + engines: {node: ^16.0.0 || >=18.0.0} + dependencies: + '@typescript-eslint/types': 7.0.1 + '@typescript-eslint/visitor-keys': 7.0.1 + dev: true + + /@typescript-eslint/type-utils@7.0.1(eslint@8.56.0)(typescript@5.3.3): + resolution: {integrity: sha512-YtT9UcstTG5Yqy4xtLiClm1ZpM/pWVGFnkAa90UfdkkZsR1eP2mR/1jbHeYp8Ay1l1JHPyGvoUYR6o3On5Nhmw==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: - eslint: ^7.0.0 || ^8.0.0 + eslint: ^8.56.0 typescript: '*' peerDependenciesMeta: typescript: optional: true dependencies: - '@typescript-eslint/typescript-estree': 6.21.0(typescript@5.3.3) - '@typescript-eslint/utils': 6.21.0(eslint@8.56.0)(typescript@5.3.3) + '@typescript-eslint/typescript-estree': 7.0.1(typescript@5.3.3) + '@typescript-eslint/utils': 7.0.1(eslint@8.56.0)(typescript@5.3.3) debug: 4.3.4 eslint: 8.56.0 ts-api-utils: 1.2.1(typescript@5.3.3) @@ -2134,13 +2138,13 @@ packages: engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dev: true - /@typescript-eslint/types@6.21.0: - resolution: {integrity: sha512-1kFmZ1rOm5epu9NZEZm1kckCDGj5UJEf7P1kliH4LKu/RkwpsfqqGmY2OOcUs18lSlQBKLDYBOGxRVtrMN5lpg==} + /@typescript-eslint/types@6.8.0: + resolution: {integrity: sha512-p5qOxSum7W3k+llc7owEStXlGmSl8FcGvhYt8Vjy7FqEnmkCVlM3P57XQEGj58oqaBWDQXbJDZxwUWMS/EAPNQ==} engines: {node: ^16.0.0 || >=18.0.0} dev: true - /@typescript-eslint/types@6.8.0: - resolution: {integrity: sha512-p5qOxSum7W3k+llc7owEStXlGmSl8FcGvhYt8Vjy7FqEnmkCVlM3P57XQEGj58oqaBWDQXbJDZxwUWMS/EAPNQ==} + /@typescript-eslint/types@7.0.1: + resolution: {integrity: sha512-uJDfmirz4FHib6ENju/7cz9SdMSkeVvJDK3VcMFvf/hAShg8C74FW+06MaQPODHfDJp/z/zHfgawIJRjlu0RLg==} engines: {node: ^16.0.0 || >=18.0.0} dev: true @@ -2186,8 +2190,8 @@ packages: - supports-color dev: true - /@typescript-eslint/typescript-estree@6.21.0(typescript@5.3.3): - resolution: {integrity: sha512-6npJTkZcO+y2/kr+z0hc4HwNfrrP4kNYh57ek7yCNlrBjWQ1Y0OS7jiZTkgumrvkX5HkEKXFZkkdFNkaW2wmUQ==} + /@typescript-eslint/typescript-estree@6.8.0(typescript@5.3.3): + resolution: {integrity: sha512-ISgV0lQ8XgW+mvv5My/+iTUdRmGspducmQcDw5JxznasXNnZn3SKNrTRuMsEXv+V/O+Lw9AGcQCfVaOPCAk/Zg==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: typescript: '*' @@ -2195,12 +2199,11 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/types': 6.21.0 - '@typescript-eslint/visitor-keys': 6.21.0 + '@typescript-eslint/types': 6.8.0 + '@typescript-eslint/visitor-keys': 6.8.0 debug: 4.3.4 globby: 11.1.0 is-glob: 4.0.3 - minimatch: 9.0.3 semver: 7.6.0 ts-api-utils: 1.2.1(typescript@5.3.3) typescript: 5.3.3 @@ -2208,8 +2211,8 @@ packages: - supports-color dev: true - /@typescript-eslint/typescript-estree@6.8.0(typescript@5.3.3): - resolution: {integrity: sha512-ISgV0lQ8XgW+mvv5My/+iTUdRmGspducmQcDw5JxznasXNnZn3SKNrTRuMsEXv+V/O+Lw9AGcQCfVaOPCAk/Zg==} + /@typescript-eslint/typescript-estree@7.0.1(typescript@5.3.3): + resolution: {integrity: sha512-SO9wHb6ph0/FN5OJxH4MiPscGah5wjOd0RRpaLvuBv9g8565Fgu0uMySFEPqwPHiQU90yzJ2FjRYKGrAhS1xig==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: typescript: '*' @@ -2217,11 +2220,12 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/types': 6.8.0 - '@typescript-eslint/visitor-keys': 6.8.0 + '@typescript-eslint/types': 7.0.1 + '@typescript-eslint/visitor-keys': 7.0.1 debug: 4.3.4 globby: 11.1.0 is-glob: 4.0.3 + minimatch: 9.0.3 semver: 7.6.0 ts-api-utils: 1.2.1(typescript@5.3.3) typescript: 5.3.3 @@ -2229,18 +2233,18 @@ packages: - supports-color dev: true - /@typescript-eslint/utils@6.21.0(eslint@8.56.0)(typescript@5.3.3): - resolution: {integrity: sha512-NfWVaC8HP9T8cbKQxHcsJBY5YE1O33+jpMwN45qzWWaPDZgLIbo12toGMWnmhvCpd3sIxkpDw3Wv1B3dYrbDQQ==} + /@typescript-eslint/utils@6.8.0(eslint@8.56.0)(typescript@5.3.3): + resolution: {integrity: sha512-dKs1itdE2qFG4jr0dlYLQVppqTE+Itt7GmIf/vX6CSvsW+3ov8PbWauVKyyfNngokhIO9sKZeRGCUo1+N7U98Q==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: eslint: ^7.0.0 || ^8.0.0 dependencies: '@eslint-community/eslint-utils': 4.4.0(eslint@8.56.0) '@types/json-schema': 7.0.15 - '@types/semver': 7.5.6 - '@typescript-eslint/scope-manager': 6.21.0 - '@typescript-eslint/types': 6.21.0 - '@typescript-eslint/typescript-estree': 6.21.0(typescript@5.3.3) + '@types/semver': 7.5.7 + '@typescript-eslint/scope-manager': 6.8.0 + '@typescript-eslint/types': 6.8.0 + '@typescript-eslint/typescript-estree': 6.8.0(typescript@5.3.3) eslint: 8.56.0 semver: 7.6.0 transitivePeerDependencies: @@ -2248,18 +2252,18 @@ packages: - typescript dev: true - /@typescript-eslint/utils@6.8.0(eslint@8.56.0)(typescript@5.3.3): - resolution: {integrity: sha512-dKs1itdE2qFG4jr0dlYLQVppqTE+Itt7GmIf/vX6CSvsW+3ov8PbWauVKyyfNngokhIO9sKZeRGCUo1+N7U98Q==} + /@typescript-eslint/utils@7.0.1(eslint@8.56.0)(typescript@5.3.3): + resolution: {integrity: sha512-oe4his30JgPbnv+9Vef1h48jm0S6ft4mNwi9wj7bX10joGn07QRfqIqFHoMiajrtoU88cIhXf8ahwgrcbNLgPA==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: - eslint: ^7.0.0 || ^8.0.0 + eslint: ^8.56.0 dependencies: '@eslint-community/eslint-utils': 4.4.0(eslint@8.56.0) '@types/json-schema': 7.0.15 - '@types/semver': 7.5.6 - '@typescript-eslint/scope-manager': 6.8.0 - '@typescript-eslint/types': 6.8.0 - '@typescript-eslint/typescript-estree': 6.8.0(typescript@5.3.3) + '@types/semver': 7.5.7 + '@typescript-eslint/scope-manager': 7.0.1 + '@typescript-eslint/types': 7.0.1 + '@typescript-eslint/typescript-estree': 7.0.1(typescript@5.3.3) eslint: 8.56.0 semver: 7.6.0 transitivePeerDependencies: @@ -2283,19 +2287,19 @@ packages: eslint-visitor-keys: 3.4.3 dev: true - /@typescript-eslint/visitor-keys@6.21.0: - resolution: {integrity: sha512-JJtkDduxLi9bivAB+cYOVMtbkqdPOhZ+ZI5LC47MIRrDV4Yn2o+ZnW10Nkmr28xRpSpdJ6Sm42Hjf2+REYXm0A==} + /@typescript-eslint/visitor-keys@6.8.0: + resolution: {integrity: sha512-oqAnbA7c+pgOhW2OhGvxm0t1BULX5peQI/rLsNDpGM78EebV3C9IGbX5HNZabuZ6UQrYveCLjKo8Iy/lLlBkkg==} engines: {node: ^16.0.0 || >=18.0.0} dependencies: - '@typescript-eslint/types': 6.21.0 + '@typescript-eslint/types': 6.8.0 eslint-visitor-keys: 3.4.3 dev: true - /@typescript-eslint/visitor-keys@6.8.0: - resolution: {integrity: sha512-oqAnbA7c+pgOhW2OhGvxm0t1BULX5peQI/rLsNDpGM78EebV3C9IGbX5HNZabuZ6UQrYveCLjKo8Iy/lLlBkkg==} + /@typescript-eslint/visitor-keys@7.0.1: + resolution: {integrity: sha512-hwAgrOyk++RTXrP4KzCg7zB2U0xt7RUU0ZdMSCsqF3eKUwkdXUMyTb0qdCuji7VIbcpG62kKTU9M1J1c9UpFBw==} engines: {node: ^16.0.0 || >=18.0.0} dependencies: - '@typescript-eslint/types': 6.8.0 + '@typescript-eslint/types': 7.0.1 eslint-visitor-keys: 3.4.3 dev: true @@ -2303,7 +2307,7 @@ packages: resolution: {integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==} dev: true - /@vitejs/plugin-react@4.2.1(vite@5.1.0): + /@vitejs/plugin-react@4.2.1(vite@5.1.3): resolution: {integrity: sha512-oojO9IDc4nCUUi8qIR11KoQm0XFFLIwsRBwHRR4d/88IWghn1y6ckz/bJ8GHDCsYEJee8mDzqtJxh15/cisJNQ==} engines: {node: ^14.18.0 || >=16.0.0} peerDependencies: @@ -2314,7 +2318,7 @@ packages: '@babel/plugin-transform-react-jsx-source': 7.23.3(@babel/core@7.23.9) '@types/babel__core': 7.20.5 react-refresh: 0.14.0 - vite: 5.1.0(@types/node@20.11.17) + vite: 5.1.3(@types/node@20.11.19) transitivePeerDependencies: - supports-color dev: true @@ -2337,7 +2341,7 @@ packages: std-env: 3.7.0 test-exclude: 6.0.0 v8-to-istanbul: 9.2.0 - vitest: 1.2.2(@types/node@20.11.17) + vitest: 1.2.2(@types/node@20.11.19) transitivePeerDependencies: - supports-color dev: true @@ -3584,8 +3588,8 @@ packages: engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} dependencies: is-url: 1.2.4 - postcss: 8.4.33 - postcss-values-parser: 6.0.2(postcss@8.4.33) + postcss: 8.4.35 + postcss-values-parser: 6.0.2(postcss@8.4.35) dev: true /detective-sass@3.0.2: @@ -3742,8 +3746,8 @@ packages: engines: {node: '>=12'} dev: true - /dotenv@16.4.1: - resolution: {integrity: sha512-CjA3y+Dr3FyFDOAMnxZEGtnW9KBR2M0JvvUtXNW+dYJL5ROWxP9DUHCwgFqpMk0OXCc0ljhaNTr2w/kutYIcHQ==} + /dotenv@16.4.4: + resolution: {integrity: sha512-XvPXc8XAQThSjAbY6cQ/9PcBXmFoWuw1sQ3b8HqUCR6ziGXjkTi//kB9SWa2UwqlgdAIuRqAa/9hVljzPehbYg==} engines: {node: '>=12'} dev: true @@ -3760,8 +3764,8 @@ packages: resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==} dev: true - /effect@2.3.0: - resolution: {integrity: sha512-Clz1L1N/Q0pSWVVkbvijvP5IEH2rE9aBlbLXCB0XYiRRrEI/POWYxQcQ3ECcpyQuFaNU2uQoVwsqwFI1MCL1Fg==} + /effect@2.3.6: + resolution: {integrity: sha512-R7Sqjc/6Wg+hZbtotklWunLUe5hoEG/a8SP/4BGydNCbR2DZuc15ZApoZA1gVMcT/PDMN3WHEiVlqLkt+TtdBA==} dev: true /ejs@3.1.9: @@ -4008,7 +4012,7 @@ packages: - supports-color dev: true - /eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@6.21.0)(eslint-plugin-import@2.29.1)(eslint@8.56.0): + /eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@7.0.1)(eslint-plugin-import@2.29.1)(eslint@8.56.0): resolution: {integrity: sha512-xgdptdoi5W3niYeuQxKmzVDTATvLYqhpwmykwsh7f6HIOStGWEIL9iqZgQDF9u9OEzrRwR8no5q2VT+bjAujTg==} engines: {node: ^14.18.0 || >=16.0.0} peerDependencies: @@ -4018,8 +4022,8 @@ packages: debug: 4.3.4 enhanced-resolve: 5.15.0 eslint: 8.56.0 - eslint-module-utils: 2.8.0(@typescript-eslint/parser@6.21.0)(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@8.56.0) - eslint-plugin-import: 2.29.1(@typescript-eslint/parser@6.21.0)(eslint-import-resolver-typescript@3.6.1)(eslint@8.56.0) + eslint-module-utils: 2.8.0(@typescript-eslint/parser@7.0.1)(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@8.56.0) + eslint-plugin-import: 2.29.1(@typescript-eslint/parser@7.0.1)(eslint-import-resolver-typescript@3.6.1)(eslint@8.56.0) fast-glob: 3.3.1 get-tsconfig: 4.7.2 is-core-module: 2.13.0 @@ -4031,7 +4035,7 @@ packages: - supports-color dev: true - /eslint-module-utils@2.8.0(@typescript-eslint/parser@6.21.0)(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@8.56.0): + /eslint-module-utils@2.8.0(@typescript-eslint/parser@7.0.1)(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@8.56.0): resolution: {integrity: sha512-aWajIYfsqCKRDgUfjEXNN/JlrzauMuSEy5sbd7WXbtW3EH6A6MpwEh42c7qD+MqQo9QMJ6fWLAeIJynx0g6OAw==} engines: {node: '>=4'} peerDependencies: @@ -4052,11 +4056,11 @@ packages: eslint-import-resolver-webpack: optional: true dependencies: - '@typescript-eslint/parser': 6.21.0(eslint@8.56.0)(typescript@5.3.3) + '@typescript-eslint/parser': 7.0.1(eslint@8.56.0)(typescript@5.3.3) debug: 3.2.7 eslint: 8.56.0 eslint-import-resolver-node: 0.3.9 - eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/parser@6.21.0)(eslint-plugin-import@2.29.1)(eslint@8.56.0) + eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/parser@7.0.1)(eslint-plugin-import@2.29.1)(eslint@8.56.0) transitivePeerDependencies: - supports-color dev: true @@ -4075,7 +4079,7 @@ packages: '@types/jest': 29.0.0 '@types/js-yaml': 3.12.5 '@types/lodash': 4.14.202 - '@types/node': 20.11.17 + '@types/node': 20.11.19 dedent: 1.5.1 eslint-plugin-markdown: 3.0.1(eslint@8.56.0) expect: 29.7.0 @@ -4108,7 +4112,7 @@ packages: - supports-color dev: true - /eslint-plugin-import@2.29.1(@typescript-eslint/parser@6.21.0)(eslint-import-resolver-typescript@3.6.1)(eslint@8.56.0): + /eslint-plugin-import@2.29.1(@typescript-eslint/parser@7.0.1)(eslint-import-resolver-typescript@3.6.1)(eslint@8.56.0): resolution: {integrity: sha512-BbPC0cuExzhiMo4Ff1BTVwHpjjv28C5R+btTOGaCRC7UEz801up0JadwkeSk5Ued6TG34uaczuVuH6qyy5YUxw==} engines: {node: '>=4'} peerDependencies: @@ -4118,7 +4122,7 @@ packages: '@typescript-eslint/parser': optional: true dependencies: - '@typescript-eslint/parser': 6.21.0(eslint@8.56.0)(typescript@5.3.3) + '@typescript-eslint/parser': 7.0.1(eslint@8.56.0)(typescript@5.3.3) array-includes: 3.1.7 array.prototype.findlastindex: 1.2.3 array.prototype.flat: 1.3.2 @@ -4127,7 +4131,7 @@ packages: doctrine: 2.1.0 eslint: 8.56.0 eslint-import-resolver-node: 0.3.9 - eslint-module-utils: 2.8.0(@typescript-eslint/parser@6.21.0)(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@8.56.0) + eslint-module-utils: 2.8.0(@typescript-eslint/parser@7.0.1)(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@8.56.0) hasown: 2.0.0 is-core-module: 2.13.1 is-glob: 4.0.3 @@ -4176,8 +4180,8 @@ packages: synckit: 0.8.8 dev: true - /eslint-plugin-simple-import-sort@11.0.0(eslint@8.56.0): - resolution: {integrity: sha512-3zxeF/0piwHA7/JlbpOmMJ1/1tc1dSRiir4DwpEnP747alKwZbj5xX+ZxroShMBU6LNDkpquo7FsXHCBc0HgCA==} + /eslint-plugin-simple-import-sort@12.0.0(eslint@8.56.0): + resolution: {integrity: sha512-8o0dVEdAkYap0Cn5kNeklaKcT1nUsa3LITWEuFk3nJifOoD+5JQGoyDUW2W/iPWwBsNBJpyJS9y4je/BgxLcyQ==} peerDependencies: eslint: '>=5.0.0' dependencies: @@ -4421,8 +4425,8 @@ packages: fast-decode-uri-component: 1.0.1 dev: true - /fastq@1.16.0: - resolution: {integrity: sha512-ifCoaXsDrsdkWTtiNJX5uzHDsrck5TzfKKDcuFFTIrrc/BS076qgEIfoIy1VeZqViznfKiysPYTh/QeHtnIsYA==} + /fastq@1.17.1: + resolution: {integrity: sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==} dependencies: reusify: 1.0.4 dev: true @@ -5672,7 +5676,7 @@ packages: engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: '@jest/types': 29.6.3 - '@types/node': 20.11.17 + '@types/node': 20.11.19 chalk: 4.1.2 ci-info: 3.9.0 graceful-fs: 4.2.11 @@ -7316,7 +7320,7 @@ packages: uniq: 1.0.1 dev: true - /postcss-values-parser@6.0.2(postcss@8.4.33): + /postcss-values-parser@6.0.2(postcss@8.4.35): resolution: {integrity: sha512-YLJpK0N1brcNJrs9WatuJFtHaV9q5aAOj+S4DI5S7jgHlRfm0PIbDCAFRYMQD5SHq7Fy6xsDhyutgS0QOAs0qw==} engines: {node: '>=10'} peerDependencies: @@ -7324,19 +7328,10 @@ packages: dependencies: color-name: 1.1.4 is-url-superb: 4.0.0 - postcss: 8.4.33 + postcss: 8.4.35 quote-unquote: 1.0.0 dev: true - /postcss@8.4.33: - resolution: {integrity: sha512-Kkpbhhdjw2qQs2O2DGX+8m5OVqEcbB9HRBvuYM9pgrjEFUg30A9LmXNlTAUj4S9kgtGyrMbTzVjH7E+s5Re2yg==} - engines: {node: ^10 || ^12 || >=14} - dependencies: - nanoid: 3.3.7 - picocolors: 1.0.0 - source-map-js: 1.0.2 - dev: true - /postcss@8.4.35: resolution: {integrity: sha512-u5U8qYpBCpN13BsiEB0CbR1Hhh4Gc0zLFuedrHJKMctHCHAGrMdG0PRM/KErzAL3CU6/eckEtmHNB3x6e3c0vA==} engines: {node: ^10 || ^12 || >=14} @@ -7765,26 +7760,26 @@ packages: glob: 10.3.10 dev: true - /rollup@4.9.6: - resolution: {integrity: sha512-05lzkCS2uASX0CiLFybYfVkwNbKZG5NFQ6Go0VWyogFTXXbR039UVsegViTntkk4OglHBdF54ccApXRRuXRbsg==} + /rollup@4.11.0: + resolution: {integrity: sha512-2xIbaXDXjf3u2tajvA5xROpib7eegJ9Y/uPlSFhXLNpK9ampCczXAhLEb5yLzJyG3LAdI1NWtNjDXiLyniNdjQ==} engines: {node: '>=18.0.0', npm: '>=8.0.0'} hasBin: true dependencies: '@types/estree': 1.0.5 optionalDependencies: - '@rollup/rollup-android-arm-eabi': 4.9.6 - '@rollup/rollup-android-arm64': 4.9.6 - '@rollup/rollup-darwin-arm64': 4.9.6 - '@rollup/rollup-darwin-x64': 4.9.6 - '@rollup/rollup-linux-arm-gnueabihf': 4.9.6 - '@rollup/rollup-linux-arm64-gnu': 4.9.6 - '@rollup/rollup-linux-arm64-musl': 4.9.6 - '@rollup/rollup-linux-riscv64-gnu': 4.9.6 - '@rollup/rollup-linux-x64-gnu': 4.9.6 - '@rollup/rollup-linux-x64-musl': 4.9.6 - '@rollup/rollup-win32-arm64-msvc': 4.9.6 - '@rollup/rollup-win32-ia32-msvc': 4.9.6 - '@rollup/rollup-win32-x64-msvc': 4.9.6 + '@rollup/rollup-android-arm-eabi': 4.11.0 + '@rollup/rollup-android-arm64': 4.11.0 + '@rollup/rollup-darwin-arm64': 4.11.0 + '@rollup/rollup-darwin-x64': 4.11.0 + '@rollup/rollup-linux-arm-gnueabihf': 4.11.0 + '@rollup/rollup-linux-arm64-gnu': 4.11.0 + '@rollup/rollup-linux-arm64-musl': 4.11.0 + '@rollup/rollup-linux-riscv64-gnu': 4.11.0 + '@rollup/rollup-linux-x64-gnu': 4.11.0 + '@rollup/rollup-linux-x64-musl': 4.11.0 + '@rollup/rollup-win32-arm64-msvc': 4.11.0 + '@rollup/rollup-win32-ia32-msvc': 4.11.0 + '@rollup/rollup-win32-x64-msvc': 4.11.0 fsevents: 2.3.3 dev: true @@ -8492,7 +8487,7 @@ packages: engines: {node: '>=14.16'} dev: true - /ts-node@10.9.2(@types/node@20.11.17)(typescript@5.3.3): + /ts-node@10.9.2(@types/node@20.11.19)(typescript@5.3.3): resolution: {integrity: sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==} hasBin: true peerDependencies: @@ -8511,7 +8506,7 @@ packages: '@tsconfig/node12': 1.0.11 '@tsconfig/node14': 1.0.3 '@tsconfig/node16': 1.0.4 - '@types/node': 20.11.17 + '@types/node': 20.11.19 acorn: 8.11.2 acorn-walk: 8.3.1 arg: 4.1.3 @@ -8579,8 +8574,8 @@ packages: typescript: 5.3.3 dev: true - /tsx@4.7.0: - resolution: {integrity: sha512-I+t79RYPlEYlHn9a+KzwrvEwhJg35h/1zHsLC2JXvhC2mdynMv6Zxzvhv5EMV6VF5qJlLlkSnMVvdZV3PSIGcg==} + /tsx@4.7.1: + resolution: {integrity: sha512-8d6VuibXHtlN5E3zFkgY8u4DX7Y3Z27zvvPKVmLon/D4AjuKzarkUBTLDBgj9iTQ0hg5xM7c/mYiRVM+HETf0g==} engines: {node: '>=18.0.0'} hasBin: true dependencies: @@ -8867,7 +8862,7 @@ packages: builtins: 5.0.1 dev: true - /vite-node@1.2.2(@types/node@20.11.17): + /vite-node@1.2.2(@types/node@20.11.19): resolution: {integrity: sha512-1as4rDTgVWJO3n1uHmUYqq7nsFgINQ9u+mRcXpjeOMJUmviqNKjcZB7UfRZrlM7MjYXMKpuWp5oGkjaFLnjawg==} engines: {node: ^18.0.0 || >=20.0.0} hasBin: true @@ -8876,7 +8871,7 @@ packages: debug: 4.3.4 pathe: 1.1.2 picocolors: 1.0.0 - vite: 5.1.0(@types/node@20.11.17) + vite: 5.1.3(@types/node@20.11.19) transitivePeerDependencies: - '@types/node' - less @@ -8888,8 +8883,8 @@ packages: - terser dev: true - /vite@5.1.0(@types/node@20.11.17): - resolution: {integrity: sha512-STmSFzhY4ljuhz14bg9LkMTk3d98IO6DIArnTY6MeBwiD1Za2StcQtz7fzOUnRCqrHSD5+OS2reg4HOz1eoLnw==} + /vite@5.1.3(@types/node@20.11.19): + resolution: {integrity: sha512-UfmUD36DKkqhi/F75RrxvPpry+9+tTkrXfMNZD+SboZqBCMsxKtO52XeGzzuh7ioz+Eo/SYDBbdb0Z7vgcDJew==} engines: {node: ^18.0.0 || >=20.0.0} hasBin: true peerDependencies: @@ -8916,15 +8911,15 @@ packages: terser: optional: true dependencies: - '@types/node': 20.11.17 + '@types/node': 20.11.19 esbuild: 0.19.12 postcss: 8.4.35 - rollup: 4.9.6 + rollup: 4.11.0 optionalDependencies: fsevents: 2.3.3 dev: true - /vitest@1.2.2(@types/node@20.11.17): + /vitest@1.2.2(@types/node@20.11.19): resolution: {integrity: sha512-d5Ouvrnms3GD9USIK36KG8OZ5bEvKEkITFtnGv56HFaSlbItJuYr7hv2Lkn903+AvRAgSixiamozUVfORUekjw==} engines: {node: ^18.0.0 || >=20.0.0} hasBin: true @@ -8949,7 +8944,7 @@ packages: jsdom: optional: true dependencies: - '@types/node': 20.11.17 + '@types/node': 20.11.19 '@vitest/expect': 1.2.2 '@vitest/runner': 1.2.2 '@vitest/snapshot': 1.2.2 @@ -8968,8 +8963,8 @@ packages: strip-literal: 1.3.0 tinybench: 2.6.0 tinypool: 0.8.2 - vite: 5.1.0(@types/node@20.11.17) - vite-node: 1.2.2(@types/node@20.11.17) + vite: 5.1.3(@types/node@20.11.19) + vite-node: 1.2.2(@types/node@20.11.19) why-is-node-running: 2.2.2 transitivePeerDependencies: - less diff --git a/src/Cache/driver.ts b/src/Cache/driver.ts index dd4b183..dc89131 100644 --- a/src/Cache/driver.ts +++ b/src/Cache/driver.ts @@ -16,15 +16,9 @@ export interface ParentCacheDriver { resourceId: string, resource: T, ) => Effect.Effect - delete: ( - parentId: string, - resourceId: string, - ) => Effect.Effect + delete: (parentId: string, resourceId: string) => Effect.Effect parentDelete: (parentId: string) => Effect.Effect - refreshTTL: ( - parentId: string, - resourceId: string, - ) => Effect.Effect + refreshTTL: (parentId: string, resourceId: string) => Effect.Effect readonly run: Effect.Effect } diff --git a/src/Cache/memory.ts b/src/Cache/memory.ts index 2dd0075..f2bfbc7 100644 --- a/src/Cache/memory.ts +++ b/src/Cache/memory.ts @@ -3,7 +3,9 @@ import * as Effect from "effect/Effect" import type { CacheDriver, ParentCacheDriver } from "dfx/Cache/driver" import { createDriver, createParentDriver } from "dfx/Cache/driver" -export const createWithParent = (): Effect.Effect> => +export const createWithParent = (): Effect.Effect< + ParentCacheDriver +> => Effect.sync(() => { const map = new Map>() diff --git a/src/Cache/memoryTTL.ts b/src/Cache/memoryTTL.ts index 2c46561..3e08a4e 100644 --- a/src/Cache/memoryTTL.ts +++ b/src/Cache/memoryTTL.ts @@ -134,8 +134,7 @@ const make = ({ export const create = ( opts: MemoryTTLOpts, -): Effect.Effect> => - Effect.sync(() => make(opts)) +): Effect.Effect> => Effect.sync(() => make(opts)) export const createWithParent = ( opts: MemoryTTLOpts, @@ -218,5 +217,5 @@ export const createWithParent = ( }), run: store.run, - }); + }) }) diff --git a/src/Cache/prelude.ts b/src/Cache/prelude.ts index f6bc37d..7b4f9a6 100644 --- a/src/Cache/prelude.ts +++ b/src/Cache/prelude.ts @@ -160,7 +160,7 @@ export const guilds = ( update: gateway.fromDispatch("GUILD_UPDATE"), remove: Stream.map(gateway.fromDispatch("GUILD_DELETE"), a => a.id), }), - onMiss: id => Effect.flatMap(rest.getGuild(id), r => r.json), + onMiss: id => rest.getGuild(id).json, }), ) }) @@ -209,12 +209,11 @@ export const channels = ( g => g.id, ), }), - onMiss: (_, id) => Effect.flatMap(rest.getChannel(id), r => r.json), + onMiss: (_, id) => rest.getChannel(id).json, onParentMiss: guildId => - rest.getGuildChannels(guildId).pipe( - Effect.flatMap(r => r.json), - Effect.map(a => a.map(a => [a.id, a])), - ), + rest + .getGuildChannels(guildId) + .json.pipe(Effect.map(a => a.map(a => [a.id, a]))), }), ) }) @@ -265,10 +264,9 @@ export const roles = ( }), onMiss: (_, id) => Effect.fail(new CacheMissError("RolesCache", id)), onParentMiss: guildId => - rest.getGuildRoles(guildId).pipe( - Effect.flatMap(r => r.json), - Effect.map(_ => _.map(role => [role.id, role])), - ), + rest + .getGuildRoles(guildId) + .json.pipe(Effect.map(_ => _.map(role => [role.id, role]))), }), ) }) diff --git a/src/DiscordGateway/DiscordWS.ts b/src/DiscordGateway/DiscordWS.ts index 723369c..6be12ac 100644 --- a/src/DiscordGateway/DiscordWS.ts +++ b/src/DiscordGateway/DiscordWS.ts @@ -76,9 +76,10 @@ const make = Effect.gen(function* (_) { export interface DiscordWS { readonly _: unique symbol } -export const DiscordWS = GenericTag>( - "dfx/DiscordGateway/DiscordWS", -) +export const DiscordWS = GenericTag< + DiscordWS, + Effect.Effect.Success +>("dfx/DiscordGateway/DiscordWS") export const DiscordWSLive = Layer.provide( Layer.effect(DiscordWS, make), WSLive, diff --git a/src/DiscordGateway/Shard/identify.ts b/src/DiscordGateway/Shard/identify.ts index 7870b18..809cb97 100644 --- a/src/DiscordGateway/Shard/identify.ts +++ b/src/DiscordGateway/Shard/identify.ts @@ -41,8 +41,10 @@ export const identifyOrResume = ( opts: Options, ready: Ref.Ref>, seq: Ref.Ref>, -): Effect.Effect<| Discord.GatewayPayload -| Discord.GatewayPayload> => +): Effect.Effect< + | Discord.GatewayPayload + | Discord.GatewayPayload +> => Effect.map( Effect.all([Ref.get(ready), Ref.get(seq)]), ([readyEvent, seqNumber]) => diff --git a/src/DiscordGateway/Shard/utils.ts b/src/DiscordGateway/Shard/utils.ts index 616b95a..ea2ae16 100644 --- a/src/DiscordGateway/Shard/utils.ts +++ b/src/DiscordGateway/Shard/utils.ts @@ -26,10 +26,12 @@ const maybeUpdateRef = export const latest = ( f: (p: Discord.GatewayPayload) => Option.Option, -): Effect.Effect>, - (_: Discord.GatewayPayload) => Effect.Effect, -]> => +): Effect.Effect< + readonly [ + Ref.Ref>, + (_: Discord.GatewayPayload) => Effect.Effect, + ] +> => Effect.map( Ref.make>(Option.none()), ref => [ref, maybeUpdateRef(f, ref)] as const, diff --git a/src/DiscordGateway/ShardStore.ts b/src/DiscordGateway/ShardStore.ts index 6c36c78..559c344 100644 --- a/src/DiscordGateway/ShardStore.ts +++ b/src/DiscordGateway/ShardStore.ts @@ -9,9 +9,7 @@ export interface ClaimIdContext { } export interface ShardStoreService { - claimId: ( - ctx: ClaimIdContext, - ) => Effect.Effect> + claimId: (ctx: ClaimIdContext) => Effect.Effect> allClaimed: (totalCount: number) => Effect.Effect heartbeat?: (shardId: number) => Effect.Effect } diff --git a/src/DiscordGateway/Sharder.ts b/src/DiscordGateway/Sharder.ts index 02015d5..ddfa9b9 100644 --- a/src/DiscordGateway/Sharder.ts +++ b/src/DiscordGateway/Sharder.ts @@ -59,10 +59,13 @@ const make = Effect.gen(function* (_) { const takeConfig = pipe( Ref.getAndUpdate(currentCount, _ => _ + 1), Effect.flatMap(claimId), - Effect.map(id => (({ - id, - totalCount - }) as const)), + Effect.map( + id => + ({ + id, + totalCount, + }) as const, + ), ) const spawner = pipe( diff --git a/src/DiscordGateway/WS.ts b/src/DiscordGateway/WS.ts index 0166ce0..8f7be3f 100644 --- a/src/DiscordGateway/WS.ts +++ b/src/DiscordGateway/WS.ts @@ -79,7 +79,7 @@ const waitForOpen = ( ws.addEventListener("open", () => resume(Effect.unit), { once: true, }) - }); + }) }), { onTimeout: () => new WebSocketError("open-timeout"), @@ -87,10 +87,7 @@ const waitForOpen = ( }, ) -const send = ( - ws: globalThis.WebSocket, - take: Effect.Effect, -) => +const send = (ws: globalThis.WebSocket, take: Effect.Effect) => pipe( take, Effect.tap(data => Effect.logTrace(data)), diff --git a/src/DiscordREST.ts b/src/DiscordREST.ts index 194cab6..477ce9c 100644 --- a/src/DiscordREST.ts +++ b/src/DiscordREST.ts @@ -19,6 +19,8 @@ import { import { RateLimiterLive, RateLimiter, RateLimitStore } from "dfx/RateLimit" import * as Discord from "dfx/types" import { LIB_VERSION } from "dfx/version" +import type { Scope } from "effect/Scope" +import * as Effectable from "effect/Effectable" export class DiscordRESTError { readonly _tag = "DiscordRESTError" @@ -155,11 +157,15 @@ const make = Effect.gen(function* (_) { const executor = ( request: Http.request.ClientRequest, - ): Effect.Effect, DiscordRESTError> => + ): Effect.Effect, DiscordRESTError, Scope> => requestRateLimit(request.url, request).pipe( Effect.zipLeft(globalRateLimit), Effect.zipRight( - httpExecutor(request) as Effect.Effect, DiscordRESTError>, + httpExecutor(request) as Effect.Effect< + ResponseWithData, + DiscordRESTError, + Scope + >, ), Effect.tap(response => updateBuckets(request, response)), Effect.catchTag("DiscordRESTError", e => { @@ -239,7 +245,7 @@ const make = Effect.gen(function* (_) { request = Http.request.unsafeJsonBody(request, params) } - return executor(request) + return new RestResponseImpl(executor(request)) }, ) @@ -249,6 +255,33 @@ const make = Effect.gen(function* (_) { } }) +class RestResponseImpl + extends Effectable.Class, DiscordRESTError, Scope> + implements RestResponse +{ + constructor( + readonly response: Effect.Effect< + ResponseWithData, + DiscordRESTError, + Scope + >, + ) { + super() + } + + commit(): Effect.Effect, DiscordRESTError, Scope> { + return this.response + } + + get json() { + return Effect.scoped(Effect.flatMap(this.response, _ => _.json)) + } + + get asUnit() { + return Effect.scoped(this.response) + } +} + export interface DiscordREST { readonly _: unique symbol } @@ -257,7 +290,7 @@ export interface DiscordRESTService extends Discord.Endpoints> { readonly executor: ( request: Http.request.ClientRequest, - ) => Effect.Effect, DiscordRESTError> + ) => Effect.Effect, DiscordRESTError, Scope> } export const DiscordREST = GenericTag( diff --git a/src/DiscordREST/types.ts b/src/DiscordREST/types.ts index 67b771c..06e9e28 100644 --- a/src/DiscordREST/types.ts +++ b/src/DiscordREST/types.ts @@ -1,9 +1,14 @@ import type * as Effect from "effect/Effect" import type * as Http from "@effect/platform/HttpClient" import type { DiscordRESTError } from "dfx/DiscordREST" +import type { Scope } from "effect/Scope" export interface ResponseWithData extends Http.response.ClientResponse { readonly json: Effect.Effect } -export type RestResponse = Effect.Effect, DiscordRESTError> +export interface RestResponse + extends Effect.Effect, DiscordRESTError, Scope> { + readonly json: Effect.Effect + readonly asUnit: Effect.Effect +} diff --git a/src/Interactions/context.ts b/src/Interactions/context.ts index c8ae975..9536b92 100644 --- a/src/Interactions/context.ts +++ b/src/Interactions/context.ts @@ -54,9 +54,10 @@ export interface DiscordSubCommand { export interface SubCommandContext { readonly command: Discord.ApplicationCommandInteractionDataOption } -export const SubCommandContext = GenericTag( - "dfx/Interactions/SubCommandContext", -) +export const SubCommandContext = GenericTag< + DiscordSubCommand, + SubCommandContext +>("dfx/Interactions/SubCommandContext") export class ResolvedDataNotFound { readonly _tag = "ResolvedDataNotFound" @@ -104,21 +105,25 @@ export const handleSubCommands = < >, >( commands: NER, -): Effect.Effect infer E } }, - ] - ? E - : never) -| SubCommandNotFound, | Exclude< - [NER[keyof NER]] extends [ - { [Effect.EffectTypeId]: { _R: (_: never) => infer R } }, +): Effect.Effect< + Discord.InteractionResponse, + | ([NER[keyof NER]] extends [ + { [Effect.EffectTypeId]: { _E: (_: never) => infer E } }, ] - ? R - : never, - SubCommandContext - > -| Discord.Interaction -| Discord.ApplicationCommandDatum> => + ? E + : never) + | SubCommandNotFound, + | Exclude< + [NER[keyof NER]] extends [ + { [Effect.EffectTypeId]: { _R: (_: never) => infer R } }, + ] + ? R + : never, + SubCommandContext + > + | Discord.Interaction + | Discord.ApplicationCommandDatum +> => ApplicationCommand.pipe( Effect.flatMap(data => Effect.mapError( diff --git a/src/Interactions/definitions.ts b/src/Interactions/definitions.ts index e86177a..a786b36 100644 --- a/src/Interactions/definitions.ts +++ b/src/Interactions/definitions.ts @@ -123,13 +123,14 @@ export const autocomplete = ( >(pred as any, handle as any) // ==== Command handler helpers -type DeepReadonly = T extends Array - ? ReadonlyArray> - : T extends Function - ? T - : T extends object - ? DeepReadonlyObject - : T +type DeepReadonly = + T extends Array + ? ReadonlyArray> + : T extends Function + ? T + : T extends object + ? DeepReadonlyObject + : T type DeepReadonlyObject = { readonly [P in keyof T]: DeepReadonly } @@ -173,20 +174,24 @@ export interface CommandHelper { >, >( commands: NER, - ) => Effect.Effect infer E } }, - ] - ? E - : never, | Exclude< - [NER[keyof NER]] extends [ - { [Effect.EffectTypeId]: { _R: (_: never) => infer R } }, - ] - ? R - : never, - SubCommandContext - > - | DiscordInteraction - | DiscordApplicationCommand> + ) => Effect.Effect< + Discord.InteractionResponse, + [NER[keyof NER]] extends [ + { [Effect.EffectTypeId]: { _E: (_: never) => infer E } }, + ] + ? E + : never, + | Exclude< + [NER[keyof NER]] extends [ + { [Effect.EffectTypeId]: { _R: (_: never) => infer R } }, + ] + ? R + : never, + SubCommandContext + > + | DiscordInteraction + | DiscordApplicationCommand + > } export type CommandHandlerFn = ( diff --git a/src/Interactions/gateway.ts b/src/Interactions/gateway.ts index b30eb3e..c4b594a 100644 --- a/src/Interactions/gateway.ts +++ b/src/Interactions/gateway.ts @@ -37,12 +37,20 @@ export const setInteractionsSync = (enabled: boolean) => export const run = ( postHandler: ( - effect: Effect.Effect, + effect: Effect.Effect< + void, + TE | DiscordRESTError | DefinitionNotFound, + R | DiscordREST | DiscordInteraction + >, ) => Effect.Effect, ) => ( ix: InteractionBuilder, - ): Effect.Effect> => + ): Effect.Effect< + never, + E2 | DiscordRESTError | Http.error.ResponseError, + DiscordREST | DiscordGateway | Exclude + > => Effect.gen(function* (_) { const GlobalApplicationCommand = ix.definitions.pipe( Chunk.map(_ => _[0]), @@ -65,8 +73,7 @@ export const run = const rest = yield* _(DiscordREST) const application = yield* _( - rest.getCurrentBotApplicationInformation(), - Effect.flatMap(a => a.json), + rest.getCurrentBotApplicationInformation().json, ) const globalSync = rest.bulkOverwriteGlobalApplicationCommands( @@ -76,20 +83,22 @@ export const run = GlobalApplicationCommand.map(_ => _.command), ), }, - ) + ).asUnit const guildSync = GuildApplicationCommand.length - ? gateway.handleDispatch("GUILD_CREATE", a => - rest.bulkOverwriteGuildApplicationCommands( - application.id, - a.id, - GuildApplicationCommand.map(_ => _.command) as any, - ), + ? gateway.handleDispatch( + "GUILD_CREATE", + a => + rest.bulkOverwriteGuildApplicationCommands( + application.id, + a.id, + GuildApplicationCommand.map(_ => _.command) as any, + ).asUnit, ) : Effect.never const handle = handlers(ix.definitions, (i, r) => - rest.createInteractionResponse(i.id, i.token, r), + rest.createInteractionResponse(i.id, i.token, r).pipe(Effect.scoped), ) const run = gateway.handleDispatch("INTERACTION_CREATE", i => diff --git a/src/Interactions/handlers.ts b/src/Interactions/handlers.ts index f3ab22d..f0e8f7a 100644 --- a/src/Interactions/handlers.ts +++ b/src/Interactions/handlers.ts @@ -12,7 +12,11 @@ export class DefinitionNotFound { constructor(readonly interaction: Discord.Interaction) {} } -type Handler = Effect.Effect +type Handler = Effect.Effect< + A, + E | DefinitionNotFound, + R | Ctx.DiscordInteraction +> export const handlers = ( definitions: Chunk.Chunk< diff --git a/src/Interactions/utils.ts b/src/Interactions/utils.ts index dbe88dc..fe11663 100644 --- a/src/Interactions/utils.ts +++ b/src/Interactions/utils.ts @@ -4,16 +4,14 @@ import * as Ctx from "dfx/Interactions/context" import type * as D from "dfx/Interactions/definitions" import type * as Discord from "dfx/types" -export type DefinitionFlattened = D.InteractionDefinition< - R, - E -> extends infer D - ? { - [K in keyof D]: K extends "handle" - ? (_: Discord.Interaction) => Effect.Effect - : D[K] - } - : never +export type DefinitionFlattened = + D.InteractionDefinition extends infer D + ? { + [K in keyof D]: K extends "handle" + ? (_: Discord.Interaction) => Effect.Effect + : D[K] + } + : never export type DefinitionFlattenedCommand = Extract< DefinitionFlattened, @@ -83,10 +81,10 @@ export const splitDefinitions = ( Chunk.reduce( {} as Record>, (acc, d) => - (({ + ({ ...acc, - [d.command.name]: d - }) as any), + [d.command.name]: d, + }) as any, ), ) diff --git a/src/Interactions/webhook.ts b/src/Interactions/webhook.ts index 0079fd3..e1b6e72 100644 --- a/src/Interactions/webhook.ts +++ b/src/Interactions/webhook.ts @@ -74,9 +74,10 @@ const makeConfig = ({ export interface WebhookConfig { readonly _: unique symbol } -export const WebhookConfig = GenericTag>( - "dfx/Interactions/WebhookConfig", -) +export const WebhookConfig = GenericTag< + WebhookConfig, + ReturnType +>("dfx/Interactions/WebhookConfig") export const layer = (opts: MakeConfigOpts) => Layer.succeed(WebhookConfig, makeConfig(opts)) @@ -122,14 +123,18 @@ const run = ( return ( headers: Headers, body: string, - ): Effect.Effect> => + ): Effect.Effect< + Discord.InteractionResponse, + BadWebhookSignature | WebhookParseError | E | DefinitionNotFound, + WebhookConfig | Exclude + > => Effect.flatMap(fromHeadersAndBody(headers, body), interaction => Effect.provideService( handler[interaction.type](interaction), Interaction, interaction, ), - ); + ) } export interface HandleWebhookOpts { @@ -168,7 +173,7 @@ export const makeHandler = ( handle(headers, body).pipe( Effect.flatMap(success), Effect.catchAllCause(error), - ); + ) } /** diff --git a/src/utils/Effect.ts b/src/utils/Effect.ts index 46552df..4878b46 100644 --- a/src/utils/Effect.ts +++ b/src/utils/Effect.ts @@ -29,7 +29,7 @@ export const subscribeForEachPar = ( return Effect.all([run, Deferred.await(deferred)], { concurrency: "unbounded", discard: true, - }) as Effect.Effect; + }) as Effect.Effect }) export const foreverSwitch = ( @@ -64,6 +64,6 @@ export const foreverSwitch = ( return Effect.all([run, Deferred.await(causeDeferred)], { concurrency: "unbounded", discard: true, - }) as Effect.Effect; + }) as Effect.Effect }), )