From f38d1e18cdbf334c5bcf807829186d6e55a9bf04 Mon Sep 17 00:00:00 2001 From: Steve Date: Thu, 16 May 2024 12:52:01 -0600 Subject: [PATCH] fix: assign correct sentry scoping (#272) Updates sentry to properly create scopes for handling each command, as well as the event based handlers like reactions. Bumps the sentry group with 2 updates in the / directory: [@sentry/node](https://github.com/getsentry/sentry-javascript) and [@sentry/profiling-node](https://github.com/getsentry/sentry-javascript). Updates `@sentry/node` from 7.113.0 to 8.1.0 - [Release notes](https://github.com/getsentry/sentry-javascript/releases) - [Changelog](https://github.com/getsentry/sentry-javascript/blob/develop/CHANGELOG.md) - [Commits](https://github.com/getsentry/sentry-javascript/compare/7.113.0...8.1.0) Updates `@sentry/profiling-node` from 7.113.0 to 8.1.0 - [Release notes](https://github.com/getsentry/sentry-javascript/releases) - [Changelog](https://github.com/getsentry/sentry-javascript/blob/develop/CHANGELOG.md) - [Commits](https://github.com/getsentry/sentry-javascript/compare/7.113.0...8.1.0) --- updated-dependencies: - dependency-name: "@sentry/node" dependency-type: direct:production update-type: version-update:semver-major dependency-group: sentry - dependency-name: "@sentry/profiling-node" dependency-type: direct:production update-type: version-update:semver-major dependency-group: sentry ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- biome.json | 3 +- package.json | 4 +- pnpm-lock.yaml | 830 ++++++++++++++++-- .../edit-settings-command.handler.ts | 8 +- src/commands/signup/signup-command.handler.ts | 5 +- src/commands/signup/signup.service.ts | 104 ++- src/commands/slash-commands.service.ts | 59 +- src/commands/status/status-command.handler.ts | 5 +- src/discord/discord.module.ts | 6 +- src/sentry/sentry.consts.ts | 21 +- src/sheets/sheets.service.ts | 3 +- 11 files changed, 869 insertions(+), 179 deletions(-) diff --git a/biome.json b/biome.json index 06452a81..1a33a218 100644 --- a/biome.json +++ b/biome.json @@ -15,7 +15,8 @@ "style": { "noNonNullAssertion": "off", "useImportType": "off", - "noParameterProperties": "off" + "noParameterProperties": "off", + "noNamespaceImport": "off" }, "suspicious": { "noExplicitAny": "off" diff --git a/package.json b/package.json index d3ee2da0..9dfb9989 100644 --- a/package.json +++ b/package.json @@ -33,8 +33,8 @@ "@nestjs/core": "^10.3.8", "@nestjs/cqrs": "^10.2.7", "@sentry/cli": "^2.31.2", - "@sentry/node": "^7.113.0", - "@sentry/profiling-node": "^7.113.0", + "@sentry/node": "^8.2.1", + "@sentry/profiling-node": "^8.2.1", "class-transformer": "^0.5.1", "class-validator": "^0.14.1", "dayjs": "^1.11.11", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b3fbbd46..0914156e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -27,11 +27,11 @@ importers: specifier: ^2.31.2 version: 2.31.2 '@sentry/node': - specifier: ^7.113.0 - version: 7.113.0 + specifier: ^8.2.1 + version: 8.2.1 '@sentry/profiling-node': - specifier: ^7.113.0 - version: 7.113.0 + specifier: ^8.2.1 + version: 8.2.1 class-transformer: specifier: ^0.5.1 version: 0.5.1 @@ -761,6 +761,186 @@ packages: engines: {node: '>=8.0.0', npm: '>=5.0.0'} hasBin: true + '@opentelemetry/api-logs@0.50.0': + resolution: {integrity: sha512-JdZuKrhOYggqOpUljAq4WWNi5nB10PmgoF0y2CvedLGXd0kSawb/UBnWT8gg1ND3bHCNHStAIVT0ELlxJJRqrA==} + engines: {node: '>=14'} + + '@opentelemetry/api-logs@0.51.1': + resolution: {integrity: sha512-E3skn949Pk1z2XtXu/lxf6QAZpawuTM/IUEXcAzpiUkTd73Hmvw26FiN3cJuTmkpM5hZzHwkomVdtrh/n/zzwA==} + engines: {node: '>=14'} + + '@opentelemetry/api@1.8.0': + resolution: {integrity: sha512-I/s6F7yKUDdtMsoBWXJe8Qz40Tui5vsuKCWJEWVL+5q9sSWRzzx6v2KeNsOBEwd94j0eWkpWCH4yB6rZg9Mf0w==} + engines: {node: '>=8.0.0'} + + '@opentelemetry/context-async-hooks@1.24.1': + resolution: {integrity: sha512-R5r6DO4kgEOVBxFXhXjwospLQkv+sYxwCfjvoZBe7Zm6KKXAV9kDSJhi/D1BweowdZmO+sdbENLs374gER8hpQ==} + engines: {node: '>=14'} + peerDependencies: + '@opentelemetry/api': '>=1.0.0 <1.9.0' + + '@opentelemetry/core@1.23.0': + resolution: {integrity: sha512-hdQ/a9TMzMQF/BO8Cz1juA43/L5YGtCSiKoOHmrTEf7VMDAZgy8ucpWx3eQTnQ3gBloRcWtzvcrMZABC3PTSKQ==} + engines: {node: '>=14'} + peerDependencies: + '@opentelemetry/api': '>=1.0.0 <1.9.0' + + '@opentelemetry/core@1.24.1': + resolution: {integrity: sha512-wMSGfsdmibI88K9wB498zXY04yThPexo8jvwNNlm542HZB7XrrMRBbAyKJqG8qDRJwIBdBrPMi4V9ZPW/sqrcg==} + engines: {node: '>=14'} + peerDependencies: + '@opentelemetry/api': '>=1.0.0 <1.9.0' + + '@opentelemetry/instrumentation-connect@0.36.0': + resolution: {integrity: sha512-k9++bmJZ9zDEs3u3DnKTn2l7QTiNFg3gPx7G9rW0TPnP+xZoBSBTrEcGYBaqflQlrFG23Q58+X1sM2ayWPv5Fg==} + engines: {node: '>=14'} + peerDependencies: + '@opentelemetry/api': ^1.3.0 + + '@opentelemetry/instrumentation-express@0.38.0': + resolution: {integrity: sha512-izId/qcgMgfWV292ZI9b9E7HdV9446vi0Z5zu5fSlt4MF+R6LZXbZLTQAaboJ4Y2+JbtH7apvko1DF93qTFtqw==} + engines: {node: '>=14'} + peerDependencies: + '@opentelemetry/api': ^1.3.0 + + '@opentelemetry/instrumentation-fastify@0.36.1': + resolution: {integrity: sha512-3Nfm43PI0I+3EX+1YbSy6xbDu276R1Dh1tqAk68yd4yirnIh52Kd5B+nJ8CgHA7o3UKakpBjj6vSzi5vNCzJIA==} + engines: {node: '>=14'} + peerDependencies: + '@opentelemetry/api': ^1.3.0 + + '@opentelemetry/instrumentation-graphql@0.40.0': + resolution: {integrity: sha512-LVRdEHWACWOczv2imD+mhUrLMxsEjPPi32vIZJT57zygR5aUiA4em8X3aiGOCycgbMWkIu8xOSGSxdx3JmzN+w==} + engines: {node: '>=14'} + peerDependencies: + '@opentelemetry/api': ^1.3.0 + + '@opentelemetry/instrumentation-hapi@0.38.0': + resolution: {integrity: sha512-ZcOqEuwuutTDYIjhDIStix22ECblG/i9pHje23QGs4Q4YS4RMaZ5hKCoQJxW88Z4K7T53rQkdISmoXFKDV8xMg==} + engines: {node: '>=14'} + peerDependencies: + '@opentelemetry/api': ^1.3.0 + + '@opentelemetry/instrumentation-http@0.51.1': + resolution: {integrity: sha512-6b3nZnFFEz/3xZ6w8bVxctPUWIPWiXuPQ725530JgxnN1cvYFd8CJ75PrHZNjynmzSSnqBkN3ef4R9N+RpMh8Q==} + engines: {node: '>=14'} + peerDependencies: + '@opentelemetry/api': ^1.3.0 + + '@opentelemetry/instrumentation-ioredis@0.40.0': + resolution: {integrity: sha512-Jv/fH7KhpWe4KBirsiqeUJIYrsdR2iu2l4nWhfOlRvaZ+zYIiLEzTQR6QhBbyRoAbU4OuYJzjWusOmmpGBnwng==} + engines: {node: '>=14'} + peerDependencies: + '@opentelemetry/api': ^1.3.0 + + '@opentelemetry/instrumentation-koa@0.40.0': + resolution: {integrity: sha512-dJc3H/bKMcgUYcQpLF+1IbmUKus0e5Fnn/+ru/3voIRHwMADT3rFSUcGLWSczkg68BCgz0vFWGDTvPtcWIFr7A==} + engines: {node: '>=14'} + peerDependencies: + '@opentelemetry/api': ^1.3.0 + + '@opentelemetry/instrumentation-mongodb@0.43.0': + resolution: {integrity: sha512-bMKej7Y76QVUD3l55Q9YqizXybHUzF3pujsBFjqbZrRn2WYqtsDtTUlbCK7fvXNPwFInqZ2KhnTqd0gwo8MzaQ==} + engines: {node: '>=14'} + peerDependencies: + '@opentelemetry/api': ^1.3.0 + + '@opentelemetry/instrumentation-mongoose@0.38.1': + resolution: {integrity: sha512-zaeiasdnRjXe6VhYCBMdkmAVh1S5MmXC/0spet+yqoaViGnYst/DOxPvhwg3yT4Yag5crZNWsVXnA538UjP6Ow==} + engines: {node: '>=14'} + peerDependencies: + '@opentelemetry/api': ^1.3.0 + + '@opentelemetry/instrumentation-mysql2@0.38.1': + resolution: {integrity: sha512-qkpHMgWSDTYVB1vlZ9sspf7l2wdS5DDq/rbIepDwX5BA0N0068JTQqh0CgAh34tdFqSCnWXIhcyOXC2TtRb0sg==} + engines: {node: '>=14'} + peerDependencies: + '@opentelemetry/api': ^1.3.0 + + '@opentelemetry/instrumentation-mysql@0.38.1': + resolution: {integrity: sha512-+iBAawUaTfX/HAlvySwozx0C2B6LBfNPXX1W8Z2On1Uva33AGkw2UjL9XgIg1Pj4eLZ9R4EoJ/aFz+Xj4E/7Fw==} + engines: {node: '>=14'} + peerDependencies: + '@opentelemetry/api': ^1.3.0 + + '@opentelemetry/instrumentation-nestjs-core@0.37.1': + resolution: {integrity: sha512-ebYQjHZEmGHWEALwwDGhSQVLBaurFnuLIkZD5igPXrt7ohfF4lc5/4al1LO+vKc0NHk8SJWStuRueT86ISA8Vg==} + engines: {node: '>=14'} + peerDependencies: + '@opentelemetry/api': ^1.3.0 + + '@opentelemetry/instrumentation-pg@0.41.0': + resolution: {integrity: sha512-BSlhpivzBD77meQNZY9fS4aKgydA8AJBzv2dqvxXFy/Hq64b7HURgw/ztbmwFeYwdF5raZZUifiiNSMLpOJoSA==} + engines: {node: '>=14'} + peerDependencies: + '@opentelemetry/api': ^1.3.0 + + '@opentelemetry/instrumentation@0.43.0': + resolution: {integrity: sha512-S1uHE+sxaepgp+t8lvIDuRgyjJWisAb733198kwQTUc9ZtYQ2V2gmyCtR1x21ePGVLoMiX/NWY7WA290hwkjJQ==} + engines: {node: '>=14'} + peerDependencies: + '@opentelemetry/api': ^1.3.0 + + '@opentelemetry/instrumentation@0.50.0': + resolution: {integrity: sha512-bhGhbJiZKpuu7wTaSak4hyZcFPlnDeuSF/2vglze8B4w2LubcSbbOnkVTzTs5SXtzh4Xz8eRjaNnAm+u2GYufQ==} + engines: {node: '>=14'} + peerDependencies: + '@opentelemetry/api': ^1.3.0 + + '@opentelemetry/instrumentation@0.51.1': + resolution: {integrity: sha512-JIrvhpgqY6437QIqToyozrUG1h5UhwHkaGK/WAX+fkrpyPtc+RO5FkRtUd9BH0MibabHHvqsnBGKfKVijbmp8w==} + engines: {node: '>=14'} + peerDependencies: + '@opentelemetry/api': ^1.3.0 + + '@opentelemetry/redis-common@0.36.2': + resolution: {integrity: sha512-faYX1N0gpLhej/6nyp6bgRjzAKXn5GOEMYY7YhciSfCoITAktLUtQ36d24QEWNA1/WA1y6qQunCe0OhHRkVl9g==} + engines: {node: '>=14'} + + '@opentelemetry/resources@1.23.0': + resolution: {integrity: sha512-iPRLfVfcEQynYGo7e4Di+ti+YQTAY0h5mQEUJcHlU9JOqpb4x965O6PZ+wMcwYVY63G96KtdS86YCM1BF1vQZg==} + engines: {node: '>=14'} + peerDependencies: + '@opentelemetry/api': '>=1.0.0 <1.9.0' + + '@opentelemetry/resources@1.24.1': + resolution: {integrity: sha512-cyv0MwAaPF7O86x5hk3NNgenMObeejZFLJJDVuSeSMIsknlsj3oOZzRv3qSzlwYomXsICfBeFFlxwHQte5mGXQ==} + engines: {node: '>=14'} + peerDependencies: + '@opentelemetry/api': '>=1.0.0 <1.9.0' + + '@opentelemetry/sdk-metrics@1.24.1': + resolution: {integrity: sha512-FrAqCbbGao9iKI+Mgh+OsC9+U2YMoXnlDHe06yH7dvavCKzE3S892dGtX54+WhSFVxHR/TMRVJiK/CV93GR0TQ==} + engines: {node: '>=14'} + peerDependencies: + '@opentelemetry/api': '>=1.3.0 <1.9.0' + + '@opentelemetry/sdk-trace-base@1.23.0': + resolution: {integrity: sha512-PzBmZM8hBomUqvCddF/5Olyyviayka44O5nDWq673np3ctnvwMOvNrsUORZjKja1zJbwEuD9niAGbnVrz3jwRQ==} + engines: {node: '>=14'} + peerDependencies: + '@opentelemetry/api': '>=1.0.0 <1.9.0' + + '@opentelemetry/sdk-trace-base@1.24.1': + resolution: {integrity: sha512-zz+N423IcySgjihl2NfjBf0qw1RWe11XIAWVrTNOSSI6dtSPJiVom2zipFB2AEEtJWpv0Iz6DY6+TjnyTV5pWg==} + engines: {node: '>=14'} + peerDependencies: + '@opentelemetry/api': '>=1.0.0 <1.9.0' + + '@opentelemetry/semantic-conventions@1.23.0': + resolution: {integrity: sha512-MiqFvfOzfR31t8cc74CTP1OZfz7MbqpAnLCra8NqQoaHJX6ncIRTdYOQYBDQ2uFISDq0WY8Y9dDTWvsgzzBYRg==} + engines: {node: '>=14'} + + '@opentelemetry/semantic-conventions@1.24.1': + resolution: {integrity: sha512-VkliWlS4/+GHLLW7J/rVBA00uXus1SWvwFvcUDxDwmFxYfg/2VI6ekwdXS28cjI8Qz2ky2BzG8OUHo+WeYIWqw==} + engines: {node: '>=14'} + + '@opentelemetry/sql-common@0.40.1': + resolution: {integrity: sha512-nSDlnHSqzC3pXn/wZEZVLuAuJ1MYMXPBwtv2qAbCa3847SaHItdE7SzUq/Jtb0KZmh1zfAbNi3AAMjztTT4Ugg==} + engines: {node: '>=14'} + peerDependencies: + '@opentelemetry/api': ^1.1.0 + '@pkgjs/parseargs@0.11.0': resolution: {integrity: sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==} engines: {node: '>=14'} @@ -768,6 +948,9 @@ packages: '@polka/url@1.0.0-next.25': resolution: {integrity: sha512-j7P6Rgr3mmtdkeDGTe0E/aYyWEWVtc5yFXtHCRHs28/jptDEWfaVOc5T7cblqy1XKPPfCxJc/8DwQ5YgLOZOVQ==} + '@prisma/instrumentation@5.13.0': + resolution: {integrity: sha512-MEJX1aWLsEjS+2iheBkEy1LlzQuUruPgKEzA9HPMwzitCoUUK1qn5o+yIphU7wWs47Le/cED0egYQL7y9/rSsA==} + '@protobufjs/aspromise@1.1.2': resolution: {integrity: sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==} @@ -899,10 +1082,6 @@ packages: resolution: {integrity: sha512-BxcYGzgEsdlG0dKAyOm0ehLGm2CafIrfQTZGWgkfKYbj+pNNsorZ7EotuZukc2MT70E0UbppVbtpBrqpzVzjNA==} engines: {node: '>=v14.0.0', npm: '>=7.0.0'} - '@sentry-internal/tracing@7.113.0': - resolution: {integrity: sha512-8MDnYENRMnEfQjvN4gkFYFaaBSiMFSU/6SQZfY9pLI3V105z6JQ4D0PGMAUVowXilwNZVpKNYohE7XByuhEC7Q==} - engines: {node: '>=8'} - '@sentry/cli-darwin@2.31.2': resolution: {integrity: sha512-BHA/JJXj1dlnoZQdK4efRCtHRnbBfzbIZUKAze7oRR1RfNqERI84BVUQeKateD3jWSJXQfEuclIShc61KOpbKw==} engines: {node: '>=10'} @@ -949,30 +1128,36 @@ packages: engines: {node: '>= 10'} hasBin: true - '@sentry/core@7.113.0': - resolution: {integrity: sha512-pg75y3C5PG2+ur27A0Re37YTCEnX0liiEU7EOxWDGutH17x3ySwlYqLQmZsFZTSnvzv7t3MGsNZ8nT5O0746YA==} - engines: {node: '>=8'} + '@sentry/core@8.2.1': + resolution: {integrity: sha512-xHS+DGZodTwXkoqe35UnNR9zWZ7I8pptXGxHntPrNnd/PmXK3ysj4NsRBshtSzDX3gWfwUsMN+vmjrYSwcfYeQ==} + engines: {node: '>=14.18'} - '@sentry/integrations@7.113.0': - resolution: {integrity: sha512-w0sspGBQ+6+V/9bgCkpuM3CGwTYoQEVeTW6iNebFKbtN7MrM3XsGAM9I2cW1jVxFZROqCBPFtd2cs5n0j14aAg==} - engines: {node: '>=8'} - - '@sentry/node@7.113.0': - resolution: {integrity: sha512-Vam4Ia0I9fhVw8GJOzcLP7MiiHJSKl8L9LzLMMLG3+2/dFnDQOyS7sOfk3GqgpwzqPiusP9vFu7CFSX7EMQbTg==} - engines: {node: '>=8'} + '@sentry/node@8.2.1': + resolution: {integrity: sha512-7vQQnn+M6qqqWISwrjOaRGx24g9V2Tz+UvrPOWAsZyPBy3kSkuVFef4gHE1geo6CSXMsVpnWkZ8VKJ9I7PaxPg==} + engines: {node: '>=14.18'} - '@sentry/profiling-node@7.113.0': - resolution: {integrity: sha512-ABEBLNaFwKIDZHPmvlFPCyrhdKkFRYyGeTijKuQ/fU0q81CCNnh+FJphfJTh9Js1afJ9ShFxk2KZNGzipyo8Zw==} - engines: {node: '>=8.0.0'} + '@sentry/opentelemetry@8.2.1': + resolution: {integrity: sha512-VXc6nOwSoP8ofE9gRrQ7Eaec344jxi+36zJnDDRfjtbX1Ah3XoRuQFwhMSS6nTz5leySXLxgYruZTZhj3r2V2A==} + engines: {node: '>=14.18'} + peerDependencies: + '@opentelemetry/api': ^1.8.0 + '@opentelemetry/core': ^1.24.1 + '@opentelemetry/instrumentation': ^0.51.1 + '@opentelemetry/sdk-trace-base': ^1.23.0 + '@opentelemetry/semantic-conventions': ^1.23.0 + + '@sentry/profiling-node@8.2.1': + resolution: {integrity: sha512-oHjKXu8rROlaM1GZHQNyt8lG/58XSD6lUHgxx33IuqUTZjIzise8AB7fE1fzg4+JNFZITag6zzYqrQqPGSN3HQ==} + engines: {node: '>=14.18'} hasBin: true - '@sentry/types@7.113.0': - resolution: {integrity: sha512-PJbTbvkcPu/LuRwwXB1He8m+GjDDLKBtu3lWg5xOZaF5IRdXQU2xwtdXXsjge4PZR00tF7MO7X8ZynTgWbYaew==} - engines: {node: '>=8'} + '@sentry/types@8.2.1': + resolution: {integrity: sha512-22ZuANU6Dj/XSvaGhcmNTKD+6WcMc7Zn5uKd8Oj7YcuME6rOnrU8dPGEVwbGTQkE87mTDjVTDSxl8ipb0L+Eag==} + engines: {node: '>=14.18'} - '@sentry/utils@7.113.0': - resolution: {integrity: sha512-nzKsErwmze1mmEsbW2AwL2oB+I5v6cDEJY4sdfLekA4qZbYZ8pV5iWza6IRl4XfzGTE1qpkZmEjPU9eyo0yvYw==} - engines: {node: '>=8'} + '@sentry/utils@8.2.1': + resolution: {integrity: sha512-qFeiCdo+QUVpwNSwe63LOPEKc8GWmJ051twtV3tfZ62XgUYOOi2C0qC6mliY3+GKiGVV8fQE6S930nM//j7G1w==} + engines: {node: '>=14.18'} '@sideway/address@4.1.5': resolution: {integrity: sha512-IqO/DUQHUkPeixNQ8n0JA6102hT9CmaljNTPmQ1u8MEhBo/R4Q8eKLN/vGZxuebwOroDB4cbpjheD4+/sKFK4Q==} @@ -1077,6 +1262,9 @@ packages: '@tsconfig/node16@1.0.4': resolution: {integrity: sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==} + '@types/accepts@1.3.7': + resolution: {integrity: sha512-Pay9fq2lM2wXPWbteBsRAGiWH2hig4ZE2asK+mm7kUzlxRTfL961rj89I6zV/E3PcIkDqyuBEcMxFT7rccugeQ==} + '@types/body-parser@1.19.2': resolution: {integrity: sha512-ALYone6pm6QmwZoAgeyNksccT9Q4AWZQ6PvfwR37GT6r6FWUPguq6sUmNGSMV2Wr761oQoBxwGGa6DR5o1DC9g==} @@ -1086,9 +1274,21 @@ packages: '@types/connect@3.4.35': resolution: {integrity: sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ==} + '@types/connect@3.4.36': + resolution: {integrity: sha512-P63Zd/JUGq+PdrM1lv0Wv5SBYeA2+CORvbrXbngriYY0jzLUWfQMQQxOhjONEz/wlHOAxOdY7CY65rgQdTjq2w==} + + '@types/connect@3.4.38': + resolution: {integrity: sha512-K6uROf1LD88uDQqJCktA4yzL1YYAK6NgfsI0v/mTgyPKWsX1CnJ0XPSDhViejru1GcRkLWb8RlzFYJRqGUbaug==} + + '@types/content-disposition@0.5.8': + resolution: {integrity: sha512-QVSSvno3dE0MgO76pJhmv4Qyi/j0Yk9pBp0Y7TJ2Tlj+KCgJWY6qX7nnxCOLkZ3VYRSIk1WTxCvwUSdx6CCLdg==} + '@types/conventional-commits-parser@5.0.0': resolution: {integrity: sha512-loB369iXNmAZglwWATL+WRe+CRMmmBPtpolYzIebFaX4YA3x+BEfLqhUAV9WanycKI3TG1IMr5bMJDajDKLlUQ==} + '@types/cookies@0.9.0': + resolution: {integrity: sha512-40Zk8qR147RABiQ7NQnBzWzDcjKzNrntB5BAmeGCb2p/MIyOE+4BVvc17wumsUqUw00bJYqoXFHYygQnEFh4/Q==} + '@types/eslint-scope@3.7.7': resolution: {integrity: sha512-MzMFlSLBqNF2gcHWO0G1vP/YQyfvrxZ0bF+u7mzUdZ1/xK4A4sru+nraZz5i3iEIk1l1uyicaDVTB4QbbEkAYg==} @@ -1104,15 +1304,33 @@ packages: '@types/express@4.17.21': resolution: {integrity: sha512-ejlPM315qwLpaQlQDTjPdsUFSc6ZsP4AN6AlWnogPjQ7CVi7PYF3YVz+CY3jE2pwYf7E/7HlDAN0rV2GxTG0HQ==} + '@types/http-assert@1.5.5': + resolution: {integrity: sha512-4+tE/lwdAahgZT1g30Jkdm9PzFRde0xwxBNUyRsCitRvCQB90iuA2uJYdUnhnANRcqGXaWOGY4FEoxeElNAK2g==} + '@types/http-errors@2.0.1': resolution: {integrity: sha512-/K3ds8TRAfBvi5vfjuz8y6+GiAYBZ0x4tXv1Av6CWBWn0IlADc+ZX9pMq7oU0fNQPnBwIZl3rmeLp6SBApbxSQ==} + '@types/http-errors@2.0.4': + resolution: {integrity: sha512-D0CFMMtydbJAegzOyHjtiKPLlvnm3iTZyZRSZoLq2mRhDdmLfIWOCYPfQJ4cu2erKghU++QvjcUjp/5h7hESpA==} + '@types/json-schema@7.0.15': resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==} '@types/jsonwebtoken@9.0.5': resolution: {integrity: sha512-VRLSGzik+Unrup6BsouBeHsf4d1hOEgYWTm/7Nmw1sXoN1+tRly/Gy/po3yeahnP4jfnQWWAhQAqcNfH7ngOkA==} + '@types/keygrip@1.0.6': + resolution: {integrity: sha512-lZuNAY9xeJt7Bx4t4dx0rYCDqGPW8RXhQZK1td7d4H6E9zYbLoOtjBvfwdTKpsyxQI/2jv+armjX/RW+ZNpXOQ==} + + '@types/koa-compose@3.2.8': + resolution: {integrity: sha512-4Olc63RY+MKvxMwVknCUDhRQX1pFQoBZ/lXcRLP69PQkEpze/0cr8LNqJQe5NFb/b19DWi2a5bTi2VAlQzhJuA==} + + '@types/koa@2.14.0': + resolution: {integrity: sha512-DTDUyznHGNHAl+wd1n0z1jxNajduyTh8R53xoewuerdBzGo6Ogj6F2299BFtrexJw4NtgjsI5SMPCmV9gZwGXA==} + + '@types/koa__router@12.0.3': + resolution: {integrity: sha512-5YUJVv6NwM1z7m6FuYpKfNLTZ932Z6EF6xy2BbtpJSyn13DKNQEkXVffFVSnJHxvwwWh2SAeumpjAYUELqgjyw==} + '@types/long@4.0.2': resolution: {integrity: sha512-MqTGEo5bj5t157U6fA/BiDynNkn0YknVdh48CMPkTSpFTVmvao5UQmm7uEF6xBEo7qIMAlY/JSleYaE6VOdpaA==} @@ -1122,12 +1340,21 @@ packages: '@types/mime@3.0.1': resolution: {integrity: sha512-Y4XFY5VJAuw0FgAqPNd6NNoV44jbq9Bz2L7Rh/J6jLTiHBSBJa9fxqQIvkIld4GsoDOcCbvzOUAbLPsSKKg+uA==} + '@types/mysql@2.15.22': + resolution: {integrity: sha512-wK1pzsJVVAjYCSZWQoWHziQZbNggXFDUEIGf54g4ZM/ERuP86uGdWeKZWMYlqTPMZfHJJvLPyogXGvCOg87yLQ==} + '@types/node@17.0.45': resolution: {integrity: sha512-w+tIMs3rq2afQdsPJlODhoUEKzFP1ayaoyl1CcnwtIlsVe7K7bA1NGm4s3PraqTLlXnbIN84zuBlxBWo1u9BLw==} '@types/node@20.12.12': resolution: {integrity: sha512-eWLDGF/FOSPtAvEqeRAQ4C8LSA7M1I7i0ky1I8U7kD1J5ITyW3AsRhQrKVoWf5pFKZ2kILsEGJhsI9r93PYnOw==} + '@types/pg-pool@2.0.4': + resolution: {integrity: sha512-qZAvkv1K3QbmHHFYSNRYPkRjOWRLBYrL4B9c+wG0GSVGBw0NtJwPcgx/DSddeDJvRGMHCEQ4VMEVfuJ/0gZ3XQ==} + + '@types/pg@8.6.1': + resolution: {integrity: sha512-1Kc4oAGzAl7uqUStZCDvaLFqZrW9qWSjXOmBfdgyBP5La7Us6Mg4GBvRlSoaZMhQF/zSj1C8CtKMBkoiT8eL8w==} + '@types/qs@6.9.7': resolution: {integrity: sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw==} @@ -1143,6 +1370,9 @@ packages: '@types/serve-static@1.15.2': resolution: {integrity: sha512-J2LqtvFYCzaj8pVYKw8klQXrLLk7TBZmQ4ShlcdkELFKGwGMfevMLneMMRkMgZxotOD9wg497LpC7O8PcvAmfw==} + '@types/shimmer@1.0.5': + resolution: {integrity: sha512-9Hp0ObzwwO57DpLFF0InUjUm/II8GmKAvzbefxQTihCb7KI6yc9yzf0nLc4mVdby5N4DRCgQM2wCup9KTieeww==} + '@types/tough-cookie@4.0.5': resolution: {integrity: sha512-/Ad8+nIOV7Rl++6f1BdKxFSMgmoqEoYbHRpPcx3JEfv8VRsQe9Z4mCXeJBzxs7mbHY/XOZZuXlRNfhpVPbs6ZA==} @@ -1245,6 +1475,11 @@ packages: peerDependencies: acorn: ^8 + acorn-import-attributes@1.9.5: + resolution: {integrity: sha512-n02Vykv5uA3eHGM/Z2dQrcD56kL8TyDb2p1+0P83PClMnC/nc+anbQRhIOWnSq4Ke/KvDPrY3C9hDtC/A3eHnQ==} + peerDependencies: + acorn: ^8 + acorn-node@1.8.2: resolution: {integrity: sha512-8mt+fslDufLYntIoPAaIMUe/lrbrehIiwmR3t2k9LljIzoigEPF27eLk2hy8zSGzmR/ogr7zbRKINMo1u0yh5A==} @@ -1481,6 +1716,9 @@ packages: resolution: {integrity: sha512-p3KULyQg4S7NIHixdwbGX+nFHkoBiA4YQmyWtjb8XngSKV124nJmRysgAeujbUVb15vh+RvFUfCPqU7rXk+hZg==} engines: {node: '>=6.0'} + cjs-module-lexer@1.3.1: + resolution: {integrity: sha512-a3KdPAANPbNE4ZUv9h6LckSl9zLsYOP4MBmhIPkRaeyybt+r4UghLvq+xw/YwUcC1gqylCkL4rdVs3Lwupjm4Q==} + class-transformer@0.5.1: resolution: {integrity: sha512-SQa1Ws6hUbfC98vKGxZH3KFY0Y1lm5Zm0SY8XX9zbK7FJCyVEac3ATW0RIpwzW+oOfmHE5PMPufDG9hCfoEOMw==} @@ -2112,6 +2350,10 @@ packages: resolution: {integrity: sha512-1/th4MHjnwncwXsIW6QMzlvYL9kG5e/CpVvLRZe4XPa8TOUNbCELqmvhDmnkNsAjwaG4+I8gJJL0JBvTTLO9qA==} engines: {node: '>= 0.4'} + hasown@2.0.2: + resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==} + engines: {node: '>= 0.4'} + header-case@1.0.1: resolution: {integrity: sha512-i0q9mkOeSuhXw6bGgiQCCBgY/jlZuV/7dZXyZ9c6LcBrqwvT8eT719E9uxE5LiZftdl+z81Ugbg/VvXV4OJOeQ==} @@ -2172,13 +2414,19 @@ packages: resolution: {integrity: sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==} engines: {node: '>= 4'} - immediate@3.0.6: - resolution: {integrity: sha512-XXOFtyqDjNDAQxVfYxuF7g9Il/IbWmmlQg2MYKOH8ExIT1qg6xc4zyS3HaEEATgs1btfzxq15ciUiY7gjSXRGQ==} - import-fresh@3.3.0: resolution: {integrity: sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==} engines: {node: '>=6'} + import-in-the-middle@1.4.2: + resolution: {integrity: sha512-9WOz1Yh/cvO/p69sxRmhyQwrIGGSp7EIdcb+fFNVi7CzQGQB8U1/1XrKVSbEd/GNOAeM0peJtmi7+qphe7NvAw==} + + import-in-the-middle@1.7.1: + resolution: {integrity: sha512-1LrZPDtW+atAxH42S6288qyDFNQ2YCty+2mxEPRtfazH6Z5QwkaBSTS2ods7hnVJioF6rkRfNoA6A/MstpFXLg==} + + import-in-the-middle@1.7.4: + resolution: {integrity: sha512-Lk+qzWmiQuRPPulGQeK5qq0v32k2bHnWrRPFgqyvhw7Kkov5L6MOLOIU3pcWeujc9W4q54Cp3Q2WV16eQkc7Bg==} + import-meta-resolve@4.1.0: resolution: {integrity: sha512-I6fiaX09Xivtk+THaMfAwnA3MVA5Big1WHF1Dfx9hFuvNIWpXnorlkzhcQf6ehrqQiiZECRt1poOAkPmer3ruw==} @@ -2420,9 +2668,6 @@ packages: libphonenumber-js@1.10.57: resolution: {integrity: sha512-OjsEd9y4LgcX+Ig09SbxWqcGESxliDDFNVepFhB9KEsQZTrnk3UdEU+cO0sW1APvLprHstQpS23OQpZ3bwxy6Q==} - lie@3.1.1: - resolution: {integrity: sha512-RiNhHysUjhrDQntfYSfY4MU24coXXdEOgw9WGcKHNeEwffDYbF//u87M1EWaMGzuFoSbqW0C9C6lEEhDOAswfw==} - limiter@1.1.5: resolution: {integrity: sha512-FWWMIEOxz3GwUI4Ts/IvgVy6LPvoMPgjMdQ185nN6psJyBJ4yOpzqm695/h5umdLJg2vW3GR5iG11MAkR2AzJA==} @@ -2441,9 +2686,6 @@ packages: resolution: {integrity: sha512-ok6z3qlYyCDS4ZEU27HaU6x/xZa9Whf8jD4ptH5UZTQYZVYeb9bnZ3ojVhiJNLiXK1Hfc0GNbLXcmZ5plLDDBg==} engines: {node: '>=14'} - localforage@1.10.0: - resolution: {integrity: sha512-14/H1aX7hzBBmmh7sGPd+AOMkkIrHM3Z1PAyGgZigA1H1p5O5ANnMyWzvpAETtG68/dC4pC0ncy3+PPGzXZHPg==} - locate-path@7.2.0: resolution: {integrity: sha512-gvVijfZvn7R+2qyPX8mAuKcFGDf6Nc61GdvGafQsHL0sBIxfKzA+usWn4GFC/bk+QdwPUD4kWFJLhElipq+0VA==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} @@ -2638,6 +2880,9 @@ packages: mlly@1.7.0: resolution: {integrity: sha512-U9SDaXGEREBYQgfejV97coK0UL1r+qnF2SyO9A3qcI8MzKnsIFKHNVEkrDyNncQTKQQumsasmeq84eNMdBfsNQ==} + module-details-from-path@1.0.3: + resolution: {integrity: sha512-ySViT69/76t8VhE1xXHK6Ch4NcDd26gx0MzKXLO+F7NOtnqH68d9zF94nT8ZWSxXh8ELOERsnJO/sWt1xZYw5A==} + mrmime@2.0.0: resolution: {integrity: sha512-eu38+hdgojoyq63s+yTpN4XMBdt5l8HhMhc4VKLO9KM5caLIBvUm4thi7fFaxyTmCKeNnXZ5pAlBwCUnhA09uw==} engines: {node: '>=10'} @@ -2739,6 +2984,10 @@ packages: resolution: {integrity: sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==} engines: {node: '>=12'} + opentelemetry-instrumentation-fetch-node@1.2.0: + resolution: {integrity: sha512-aiSt/4ubOTyb1N5C2ZbGrBvaJOXIZhZvpRPYuUVxQJe27wJZqf/o65iPrqgLcgfeOLaQ8cS2Q+762jrYvniTrA==} + engines: {node: '>18.0.0'} + ora@5.4.1: resolution: {integrity: sha512-5b6Y85tPxZZ7QytO+BQzysW31HJku27cRIlkbAXaNx+BdcVi+LlRFmVXzeF6a7JCwJpyw5c4b+YSVImQIrBpuQ==} engines: {node: '>=10'} @@ -2820,6 +3069,17 @@ packages: pathval@1.1.1: resolution: {integrity: sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==} + pg-int8@1.0.1: + resolution: {integrity: sha512-WCtabS6t3c8SkpDBUlb1kjOs7l66xsGdKpIPZsg4wR+B3+u9UAum2odSsF9tnvxg80h4ZxLWMy4pRjOsFIqQpw==} + engines: {node: '>=4.0.0'} + + pg-protocol@1.6.1: + resolution: {integrity: sha512-jPIlvgoD63hrEuihvIg+tJhoGjUsLPn6poJY9N5CnlPd91c2T18T/9zBtLxZSb1EhYxBRoZJtzScCaWlYLtktg==} + + pg-types@2.2.0: + resolution: {integrity: sha512-qTAAlrEsl8s4OiEQY69wDvcMIdQN6wdz5ojQiOy6YRMuynxenON0O5oCpJI6lshc6scgAY8qvJ2On/p+CXY0GA==} + engines: {node: '>=4'} + picocolors@1.0.0: resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==} @@ -2868,6 +3128,22 @@ packages: resolution: {integrity: sha512-Wglpdk03BSfXkHoQa3b/oulrotAkwrlLDRSOb9D0bN86FdRyE9lppSp33aHNPgBa0JKCoB+drFLZkQoRRYae5A==} engines: {node: ^10 || ^12 || >=14} + postgres-array@2.0.0: + resolution: {integrity: sha512-VpZrUqU5A69eQyW2c5CA1jtLecCsN2U/bD6VilrFDWq5+5UIEVO7nazS3TEcHf1zuPYO/sqGvUvW62g86RXZuA==} + engines: {node: '>=4'} + + postgres-bytea@1.0.0: + resolution: {integrity: sha512-xy3pmLuQqRBZBXDULy7KbaitYqLcmxigw14Q5sj8QBVLqEwXfeybIKVWiqAXTlcvdvb0+xkOtDbfQMOf4lST1w==} + engines: {node: '>=0.10.0'} + + postgres-date@1.0.7: + resolution: {integrity: sha512-suDmjLVQg78nMK2UZ454hAG+OAW+HQPZ6n++TNDUX+L0+uUlLywnoxJKDou51Zm+zTCjrCl0Nq6J9C5hP9vK/Q==} + engines: {node: '>=0.10.0'} + + postgres-interval@1.2.0: + resolution: {integrity: sha512-9ZhXKM/rw350N1ovuWHbGxnGh/SNJ4cnxHiM0rxE4VN41wsg8P8zWn9hv/buK00RP4WvlOyr/RBDiptyxVbkZQ==} + engines: {node: '>=0.10.0'} + prebuild-install@7.1.2: resolution: {integrity: sha512-UnNke3IQb6sgarcZIDU3gbMeTp/9SSU1DAIkil7PrqG1vZlBtY5msYccSKSHDqa3hNg436IXK+SNImReuA1wEQ==} engines: {node: '>=10'} @@ -2967,6 +3243,10 @@ packages: resolution: {integrity: sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==} engines: {node: '>=0.10.0'} + require-in-the-middle@7.3.0: + resolution: {integrity: sha512-nQFEv9gRw6SJAwWD2LrL0NmQvAcO7FBwJbwmr2ttPAacfy0xuiOjE5zt+zM4xDyuyvUaxBi/9gb2SoCyNEVJcw==} + engines: {node: '>=8.6.0'} + resolve-dir@1.0.1: resolution: {integrity: sha512-R7uiTjECzvOsWSfdM0QKFNBVFcK27aHOUwdvK53BcW8zqnGdYp0Fbj82cy54+2A4P2tFM22J5kRfe1R+lM/1yg==} engines: {node: '>=0.10.0'} @@ -3076,6 +3356,9 @@ packages: engines: {node: '>=4'} hasBin: true + shimmer@1.2.1: + resolution: {integrity: sha512-sQTKC1Re/rM6XyFM6fIAGHRPVGvyXfgzIDvzoq608vM+jeyVD0Tu1E6Np0Kc2zAIFWIj963V2800iF/9LPieQw==} + side-channel@1.0.4: resolution: {integrity: sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==} @@ -4313,11 +4596,252 @@ snapshots: transitivePeerDependencies: - encoding + '@opentelemetry/api-logs@0.50.0': + dependencies: + '@opentelemetry/api': 1.8.0 + + '@opentelemetry/api-logs@0.51.1': + dependencies: + '@opentelemetry/api': 1.8.0 + + '@opentelemetry/api@1.8.0': {} + + '@opentelemetry/context-async-hooks@1.24.1(@opentelemetry/api@1.8.0)': + dependencies: + '@opentelemetry/api': 1.8.0 + + '@opentelemetry/core@1.23.0(@opentelemetry/api@1.8.0)': + dependencies: + '@opentelemetry/api': 1.8.0 + '@opentelemetry/semantic-conventions': 1.23.0 + + '@opentelemetry/core@1.24.1(@opentelemetry/api@1.8.0)': + dependencies: + '@opentelemetry/api': 1.8.0 + '@opentelemetry/semantic-conventions': 1.24.1 + + '@opentelemetry/instrumentation-connect@0.36.0(@opentelemetry/api@1.8.0)': + dependencies: + '@opentelemetry/api': 1.8.0 + '@opentelemetry/core': 1.24.1(@opentelemetry/api@1.8.0) + '@opentelemetry/instrumentation': 0.51.1(@opentelemetry/api@1.8.0) + '@opentelemetry/semantic-conventions': 1.24.1 + '@types/connect': 3.4.36 + transitivePeerDependencies: + - supports-color + + '@opentelemetry/instrumentation-express@0.38.0(@opentelemetry/api@1.8.0)': + dependencies: + '@opentelemetry/api': 1.8.0 + '@opentelemetry/core': 1.24.1(@opentelemetry/api@1.8.0) + '@opentelemetry/instrumentation': 0.51.1(@opentelemetry/api@1.8.0) + '@opentelemetry/semantic-conventions': 1.24.1 + transitivePeerDependencies: + - supports-color + + '@opentelemetry/instrumentation-fastify@0.36.1(@opentelemetry/api@1.8.0)': + dependencies: + '@opentelemetry/api': 1.8.0 + '@opentelemetry/core': 1.24.1(@opentelemetry/api@1.8.0) + '@opentelemetry/instrumentation': 0.51.1(@opentelemetry/api@1.8.0) + '@opentelemetry/semantic-conventions': 1.24.1 + transitivePeerDependencies: + - supports-color + + '@opentelemetry/instrumentation-graphql@0.40.0(@opentelemetry/api@1.8.0)': + dependencies: + '@opentelemetry/api': 1.8.0 + '@opentelemetry/instrumentation': 0.51.1(@opentelemetry/api@1.8.0) + transitivePeerDependencies: + - supports-color + + '@opentelemetry/instrumentation-hapi@0.38.0(@opentelemetry/api@1.8.0)': + dependencies: + '@opentelemetry/api': 1.8.0 + '@opentelemetry/core': 1.24.1(@opentelemetry/api@1.8.0) + '@opentelemetry/instrumentation': 0.51.1(@opentelemetry/api@1.8.0) + '@opentelemetry/semantic-conventions': 1.24.1 + transitivePeerDependencies: + - supports-color + + '@opentelemetry/instrumentation-http@0.51.1(@opentelemetry/api@1.8.0)': + dependencies: + '@opentelemetry/api': 1.8.0 + '@opentelemetry/core': 1.24.1(@opentelemetry/api@1.8.0) + '@opentelemetry/instrumentation': 0.51.1(@opentelemetry/api@1.8.0) + '@opentelemetry/semantic-conventions': 1.24.1 + semver: 7.6.2 + transitivePeerDependencies: + - supports-color + + '@opentelemetry/instrumentation-ioredis@0.40.0(@opentelemetry/api@1.8.0)': + dependencies: + '@opentelemetry/api': 1.8.0 + '@opentelemetry/instrumentation': 0.51.1(@opentelemetry/api@1.8.0) + '@opentelemetry/redis-common': 0.36.2 + '@opentelemetry/semantic-conventions': 1.24.1 + transitivePeerDependencies: + - supports-color + + '@opentelemetry/instrumentation-koa@0.40.0(@opentelemetry/api@1.8.0)': + dependencies: + '@opentelemetry/api': 1.8.0 + '@opentelemetry/core': 1.24.1(@opentelemetry/api@1.8.0) + '@opentelemetry/instrumentation': 0.51.1(@opentelemetry/api@1.8.0) + '@opentelemetry/semantic-conventions': 1.24.1 + '@types/koa': 2.14.0 + '@types/koa__router': 12.0.3 + transitivePeerDependencies: + - supports-color + + '@opentelemetry/instrumentation-mongodb@0.43.0(@opentelemetry/api@1.8.0)': + dependencies: + '@opentelemetry/api': 1.8.0 + '@opentelemetry/instrumentation': 0.51.1(@opentelemetry/api@1.8.0) + '@opentelemetry/sdk-metrics': 1.24.1(@opentelemetry/api@1.8.0) + '@opentelemetry/semantic-conventions': 1.24.1 + transitivePeerDependencies: + - supports-color + + '@opentelemetry/instrumentation-mongoose@0.38.1(@opentelemetry/api@1.8.0)': + dependencies: + '@opentelemetry/api': 1.8.0 + '@opentelemetry/core': 1.24.1(@opentelemetry/api@1.8.0) + '@opentelemetry/instrumentation': 0.51.1(@opentelemetry/api@1.8.0) + '@opentelemetry/semantic-conventions': 1.24.1 + transitivePeerDependencies: + - supports-color + + '@opentelemetry/instrumentation-mysql2@0.38.1(@opentelemetry/api@1.8.0)': + dependencies: + '@opentelemetry/api': 1.8.0 + '@opentelemetry/instrumentation': 0.51.1(@opentelemetry/api@1.8.0) + '@opentelemetry/semantic-conventions': 1.24.1 + '@opentelemetry/sql-common': 0.40.1(@opentelemetry/api@1.8.0) + transitivePeerDependencies: + - supports-color + + '@opentelemetry/instrumentation-mysql@0.38.1(@opentelemetry/api@1.8.0)': + dependencies: + '@opentelemetry/api': 1.8.0 + '@opentelemetry/instrumentation': 0.51.1(@opentelemetry/api@1.8.0) + '@opentelemetry/semantic-conventions': 1.24.1 + '@types/mysql': 2.15.22 + transitivePeerDependencies: + - supports-color + + '@opentelemetry/instrumentation-nestjs-core@0.37.1(@opentelemetry/api@1.8.0)': + dependencies: + '@opentelemetry/api': 1.8.0 + '@opentelemetry/instrumentation': 0.51.1(@opentelemetry/api@1.8.0) + '@opentelemetry/semantic-conventions': 1.24.1 + transitivePeerDependencies: + - supports-color + + '@opentelemetry/instrumentation-pg@0.41.0(@opentelemetry/api@1.8.0)': + dependencies: + '@opentelemetry/api': 1.8.0 + '@opentelemetry/instrumentation': 0.51.1(@opentelemetry/api@1.8.0) + '@opentelemetry/semantic-conventions': 1.24.1 + '@opentelemetry/sql-common': 0.40.1(@opentelemetry/api@1.8.0) + '@types/pg': 8.6.1 + '@types/pg-pool': 2.0.4 + transitivePeerDependencies: + - supports-color + + '@opentelemetry/instrumentation@0.43.0(@opentelemetry/api@1.8.0)': + dependencies: + '@opentelemetry/api': 1.8.0 + '@types/shimmer': 1.0.5 + import-in-the-middle: 1.4.2 + require-in-the-middle: 7.3.0 + semver: 7.6.2 + shimmer: 1.2.1 + transitivePeerDependencies: + - supports-color + optional: true + + '@opentelemetry/instrumentation@0.50.0(@opentelemetry/api@1.8.0)': + dependencies: + '@opentelemetry/api': 1.8.0 + '@opentelemetry/api-logs': 0.50.0 + '@types/shimmer': 1.0.5 + import-in-the-middle: 1.7.1 + require-in-the-middle: 7.3.0 + semver: 7.6.2 + shimmer: 1.2.1 + transitivePeerDependencies: + - supports-color + + '@opentelemetry/instrumentation@0.51.1(@opentelemetry/api@1.8.0)': + dependencies: + '@opentelemetry/api': 1.8.0 + '@opentelemetry/api-logs': 0.51.1 + '@types/shimmer': 1.0.5 + import-in-the-middle: 1.7.4 + require-in-the-middle: 7.3.0 + semver: 7.6.2 + shimmer: 1.2.1 + transitivePeerDependencies: + - supports-color + + '@opentelemetry/redis-common@0.36.2': {} + + '@opentelemetry/resources@1.23.0(@opentelemetry/api@1.8.0)': + dependencies: + '@opentelemetry/api': 1.8.0 + '@opentelemetry/core': 1.23.0(@opentelemetry/api@1.8.0) + '@opentelemetry/semantic-conventions': 1.23.0 + + '@opentelemetry/resources@1.24.1(@opentelemetry/api@1.8.0)': + dependencies: + '@opentelemetry/api': 1.8.0 + '@opentelemetry/core': 1.24.1(@opentelemetry/api@1.8.0) + '@opentelemetry/semantic-conventions': 1.24.1 + + '@opentelemetry/sdk-metrics@1.24.1(@opentelemetry/api@1.8.0)': + dependencies: + '@opentelemetry/api': 1.8.0 + '@opentelemetry/core': 1.24.1(@opentelemetry/api@1.8.0) + '@opentelemetry/resources': 1.24.1(@opentelemetry/api@1.8.0) + lodash.merge: 4.6.2 + + '@opentelemetry/sdk-trace-base@1.23.0(@opentelemetry/api@1.8.0)': + dependencies: + '@opentelemetry/api': 1.8.0 + '@opentelemetry/core': 1.23.0(@opentelemetry/api@1.8.0) + '@opentelemetry/resources': 1.23.0(@opentelemetry/api@1.8.0) + '@opentelemetry/semantic-conventions': 1.23.0 + + '@opentelemetry/sdk-trace-base@1.24.1(@opentelemetry/api@1.8.0)': + dependencies: + '@opentelemetry/api': 1.8.0 + '@opentelemetry/core': 1.24.1(@opentelemetry/api@1.8.0) + '@opentelemetry/resources': 1.24.1(@opentelemetry/api@1.8.0) + '@opentelemetry/semantic-conventions': 1.24.1 + + '@opentelemetry/semantic-conventions@1.23.0': {} + + '@opentelemetry/semantic-conventions@1.24.1': {} + + '@opentelemetry/sql-common@0.40.1(@opentelemetry/api@1.8.0)': + dependencies: + '@opentelemetry/api': 1.8.0 + '@opentelemetry/core': 1.24.1(@opentelemetry/api@1.8.0) + '@pkgjs/parseargs@0.11.0': optional: true '@polka/url@1.0.0-next.25': {} + '@prisma/instrumentation@5.13.0': + dependencies: + '@opentelemetry/api': 1.8.0 + '@opentelemetry/instrumentation': 0.50.0(@opentelemetry/api@1.8.0) + '@opentelemetry/sdk-trace-base': 1.23.0(@opentelemetry/api@1.8.0) + transitivePeerDependencies: + - supports-color + '@protobufjs/aspromise@1.1.2': optional: true @@ -4416,12 +4940,6 @@ snapshots: '@sapphire/snowflake@3.5.1': {} - '@sentry-internal/tracing@7.113.0': - dependencies: - '@sentry/core': 7.113.0 - '@sentry/types': 7.113.0 - '@sentry/utils': 7.113.0 - '@sentry/cli-darwin@2.31.2': optional: true @@ -4462,36 +4980,71 @@ snapshots: - encoding - supports-color - '@sentry/core@7.113.0': - dependencies: - '@sentry/types': 7.113.0 - '@sentry/utils': 7.113.0 - - '@sentry/integrations@7.113.0': - dependencies: - '@sentry/core': 7.113.0 - '@sentry/types': 7.113.0 - '@sentry/utils': 7.113.0 - localforage: 1.10.0 + '@sentry/core@8.2.1': + dependencies: + '@sentry/types': 8.2.1 + '@sentry/utils': 8.2.1 + + '@sentry/node@8.2.1': + dependencies: + '@opentelemetry/api': 1.8.0 + '@opentelemetry/context-async-hooks': 1.24.1(@opentelemetry/api@1.8.0) + '@opentelemetry/core': 1.24.1(@opentelemetry/api@1.8.0) + '@opentelemetry/instrumentation': 0.51.1(@opentelemetry/api@1.8.0) + '@opentelemetry/instrumentation-connect': 0.36.0(@opentelemetry/api@1.8.0) + '@opentelemetry/instrumentation-express': 0.38.0(@opentelemetry/api@1.8.0) + '@opentelemetry/instrumentation-fastify': 0.36.1(@opentelemetry/api@1.8.0) + '@opentelemetry/instrumentation-graphql': 0.40.0(@opentelemetry/api@1.8.0) + '@opentelemetry/instrumentation-hapi': 0.38.0(@opentelemetry/api@1.8.0) + '@opentelemetry/instrumentation-http': 0.51.1(@opentelemetry/api@1.8.0) + '@opentelemetry/instrumentation-ioredis': 0.40.0(@opentelemetry/api@1.8.0) + '@opentelemetry/instrumentation-koa': 0.40.0(@opentelemetry/api@1.8.0) + '@opentelemetry/instrumentation-mongodb': 0.43.0(@opentelemetry/api@1.8.0) + '@opentelemetry/instrumentation-mongoose': 0.38.1(@opentelemetry/api@1.8.0) + '@opentelemetry/instrumentation-mysql': 0.38.1(@opentelemetry/api@1.8.0) + '@opentelemetry/instrumentation-mysql2': 0.38.1(@opentelemetry/api@1.8.0) + '@opentelemetry/instrumentation-nestjs-core': 0.37.1(@opentelemetry/api@1.8.0) + '@opentelemetry/instrumentation-pg': 0.41.0(@opentelemetry/api@1.8.0) + '@opentelemetry/resources': 1.24.1(@opentelemetry/api@1.8.0) + '@opentelemetry/sdk-trace-base': 1.24.1(@opentelemetry/api@1.8.0) + '@opentelemetry/semantic-conventions': 1.24.1 + '@prisma/instrumentation': 5.13.0 + '@sentry/core': 8.2.1 + '@sentry/opentelemetry': 8.2.1(@opentelemetry/api@1.8.0)(@opentelemetry/core@1.24.1(@opentelemetry/api@1.8.0))(@opentelemetry/instrumentation@0.51.1(@opentelemetry/api@1.8.0))(@opentelemetry/sdk-trace-base@1.24.1(@opentelemetry/api@1.8.0))(@opentelemetry/semantic-conventions@1.24.1) + '@sentry/types': 8.2.1 + '@sentry/utils': 8.2.1 + optionalDependencies: + opentelemetry-instrumentation-fetch-node: 1.2.0 + transitivePeerDependencies: + - supports-color - '@sentry/node@7.113.0': + '@sentry/opentelemetry@8.2.1(@opentelemetry/api@1.8.0)(@opentelemetry/core@1.24.1(@opentelemetry/api@1.8.0))(@opentelemetry/instrumentation@0.51.1(@opentelemetry/api@1.8.0))(@opentelemetry/sdk-trace-base@1.24.1(@opentelemetry/api@1.8.0))(@opentelemetry/semantic-conventions@1.24.1)': dependencies: - '@sentry-internal/tracing': 7.113.0 - '@sentry/core': 7.113.0 - '@sentry/integrations': 7.113.0 - '@sentry/types': 7.113.0 - '@sentry/utils': 7.113.0 + '@opentelemetry/api': 1.8.0 + '@opentelemetry/core': 1.24.1(@opentelemetry/api@1.8.0) + '@opentelemetry/instrumentation': 0.51.1(@opentelemetry/api@1.8.0) + '@opentelemetry/sdk-trace-base': 1.24.1(@opentelemetry/api@1.8.0) + '@opentelemetry/semantic-conventions': 1.24.1 + '@sentry/core': 8.2.1 + '@sentry/types': 8.2.1 + '@sentry/utils': 8.2.1 - '@sentry/profiling-node@7.113.0': + '@sentry/profiling-node@8.2.1': dependencies: + '@sentry/core': 8.2.1 + '@sentry/node': 8.2.1 + '@sentry/types': 8.2.1 + '@sentry/utils': 8.2.1 detect-libc: 2.0.3 node-abi: 3.62.0 + transitivePeerDependencies: + - supports-color - '@sentry/types@7.113.0': {} + '@sentry/types@8.2.1': {} - '@sentry/utils@7.113.0': + '@sentry/utils@8.2.1': dependencies: - '@sentry/types': 7.113.0 + '@sentry/types': 8.2.1 '@sideway/address@4.1.5': dependencies: @@ -4566,6 +5119,10 @@ snapshots: '@tsconfig/node16@1.0.4': {} + '@types/accepts@1.3.7': + dependencies: + '@types/node': 20.12.12 + '@types/body-parser@1.19.2': dependencies: '@types/connect': 3.4.35 @@ -4578,10 +5135,27 @@ snapshots: dependencies: '@types/node': 20.12.12 + '@types/connect@3.4.36': + dependencies: + '@types/node': 20.12.12 + + '@types/connect@3.4.38': + dependencies: + '@types/node': 20.12.12 + + '@types/content-disposition@0.5.8': {} + '@types/conventional-commits-parser@5.0.0': dependencies: '@types/node': 20.12.12 + '@types/cookies@0.9.0': + dependencies: + '@types/connect': 3.4.38 + '@types/express': 4.17.21 + '@types/keygrip': 1.0.6 + '@types/node': 20.12.12 + '@types/eslint-scope@3.7.7': dependencies: '@types/eslint': 8.44.8 @@ -4608,14 +5182,39 @@ snapshots: '@types/qs': 6.9.7 '@types/serve-static': 1.15.2 + '@types/http-assert@1.5.5': {} + '@types/http-errors@2.0.1': {} + '@types/http-errors@2.0.4': {} + '@types/json-schema@7.0.15': {} '@types/jsonwebtoken@9.0.5': dependencies: '@types/node': 20.12.12 + '@types/keygrip@1.0.6': {} + + '@types/koa-compose@3.2.8': + dependencies: + '@types/koa': 2.14.0 + + '@types/koa@2.14.0': + dependencies: + '@types/accepts': 1.3.7 + '@types/content-disposition': 0.5.8 + '@types/cookies': 0.9.0 + '@types/http-assert': 1.5.5 + '@types/http-errors': 2.0.4 + '@types/keygrip': 1.0.6 + '@types/koa-compose': 3.2.8 + '@types/node': 20.12.12 + + '@types/koa__router@12.0.3': + dependencies: + '@types/koa': 2.14.0 + '@types/long@4.0.2': optional: true @@ -4623,12 +5222,26 @@ snapshots: '@types/mime@3.0.1': {} + '@types/mysql@2.15.22': + dependencies: + '@types/node': 20.12.12 + '@types/node@17.0.45': {} '@types/node@20.12.12': dependencies: undici-types: 5.26.5 + '@types/pg-pool@2.0.4': + dependencies: + '@types/pg': 8.6.1 + + '@types/pg@8.6.1': + dependencies: + '@types/node': 20.12.12 + pg-protocol: 1.6.1 + pg-types: 2.2.0 + '@types/qs@6.9.7': {} '@types/range-parser@1.2.4': {} @@ -4652,6 +5265,8 @@ snapshots: '@types/mime': 3.0.1 '@types/node': 20.12.12 + '@types/shimmer@1.0.5': {} + '@types/tough-cookie@4.0.5': optional: true @@ -4815,6 +5430,10 @@ snapshots: dependencies: acorn: 8.11.3 + acorn-import-attributes@1.9.5(acorn@8.11.3): + dependencies: + acorn: 8.11.3 + acorn-node@1.8.2: dependencies: acorn: 7.4.1 @@ -5067,6 +5686,8 @@ snapshots: chrome-trace-event@1.0.3: {} + cjs-module-lexer@1.3.1: {} + class-transformer@0.5.1: {} class-validator@0.14.1: @@ -5821,6 +6442,10 @@ snapshots: dependencies: function-bind: 1.1.2 + hasown@2.0.2: + dependencies: + function-bind: 1.1.2 + header-case@1.0.1: dependencies: no-case: 2.3.2 @@ -5896,13 +6521,33 @@ snapshots: ignore@5.3.1: {} - immediate@3.0.6: {} - import-fresh@3.3.0: dependencies: parent-module: 1.0.1 resolve-from: 4.0.0 + import-in-the-middle@1.4.2: + dependencies: + acorn: 8.11.3 + acorn-import-assertions: 1.9.0(acorn@8.11.3) + cjs-module-lexer: 1.3.1 + module-details-from-path: 1.0.3 + optional: true + + import-in-the-middle@1.7.1: + dependencies: + acorn: 8.11.3 + acorn-import-assertions: 1.9.0(acorn@8.11.3) + cjs-module-lexer: 1.3.1 + module-details-from-path: 1.0.3 + + import-in-the-middle@1.7.4: + dependencies: + acorn: 8.11.3 + acorn-import-attributes: 1.9.5(acorn@8.11.3) + cjs-module-lexer: 1.3.1 + module-details-from-path: 1.0.3 + import-meta-resolve@4.1.0: {} inflection@1.13.4: {} @@ -6000,7 +6645,7 @@ snapshots: is-core-module@2.13.1: dependencies: - hasown: 2.0.1 + hasown: 2.0.2 is-extglob@2.1.1: {} @@ -6197,10 +6842,6 @@ snapshots: libphonenumber-js@1.10.57: {} - lie@3.1.1: - dependencies: - immediate: 3.0.6 - limiter@1.1.5: {} lines-and-columns@1.2.4: {} @@ -6214,10 +6855,6 @@ snapshots: mlly: 1.7.0 pkg-types: 1.1.1 - localforage@1.10.0: - dependencies: - lie: 3.1.1 - locate-path@7.2.0: dependencies: p-locate: 6.0.0 @@ -6380,6 +7017,8 @@ snapshots: pkg-types: 1.1.1 ufo: 1.5.3 + module-details-from-path@1.0.3: {} + mrmime@2.0.0: {} ms@2.1.2: {} @@ -6407,7 +7046,7 @@ snapshots: node-abi@3.62.0: dependencies: - semver: 7.6.0 + semver: 7.6.2 node-abort-controller@3.1.1: {} @@ -6454,6 +7093,15 @@ snapshots: dependencies: mimic-fn: 4.0.0 + opentelemetry-instrumentation-fetch-node@1.2.0: + dependencies: + '@opentelemetry/api': 1.8.0 + '@opentelemetry/instrumentation': 0.43.0(@opentelemetry/api@1.8.0) + '@opentelemetry/semantic-conventions': 1.24.1 + transitivePeerDependencies: + - supports-color + optional: true + ora@5.4.1: dependencies: bl: 4.1.0 @@ -6534,6 +7182,18 @@ snapshots: pathval@1.1.1: {} + pg-int8@1.0.1: {} + + pg-protocol@1.6.1: {} + + pg-types@2.2.0: + dependencies: + pg-int8: 1.0.1 + postgres-array: 2.0.0 + postgres-bytea: 1.0.0 + postgres-date: 1.0.7 + postgres-interval: 1.2.0 + picocolors@1.0.0: {} picocolors@1.0.1: {} @@ -6608,6 +7268,16 @@ snapshots: picocolors: 1.0.1 source-map-js: 1.2.0 + postgres-array@2.0.0: {} + + postgres-bytea@1.0.0: {} + + postgres-date@1.0.7: {} + + postgres-interval@1.2.0: + dependencies: + xtend: 4.0.2 + prebuild-install@7.1.2: dependencies: detect-libc: 2.0.3 @@ -6722,6 +7392,14 @@ snapshots: require-from-string@2.0.2: {} + require-in-the-middle@7.3.0: + dependencies: + debug: 4.3.4 + module-details-from-path: 1.0.3 + resolve: 1.22.8 + transitivePeerDependencies: + - supports-color + resolve-dir@1.0.1: dependencies: expand-tilde: 2.0.2 @@ -6847,6 +7525,8 @@ snapshots: interpret: 1.4.0 rechoir: 0.6.2 + shimmer@1.2.1: {} + side-channel@1.0.4: dependencies: call-bind: 1.0.7 diff --git a/src/commands/settings/subcommands/edit-settings-command.handler.ts b/src/commands/settings/subcommands/edit-settings-command.handler.ts index 86c15296..2b7dab34 100644 --- a/src/commands/settings/subcommands/edit-settings-command.handler.ts +++ b/src/commands/settings/subcommands/edit-settings-command.handler.ts @@ -40,13 +40,7 @@ class EditSettingsCommandHandler } private handleError(e: unknown, interaction: ChatInputCommandInteraction) { - sentryReport(e, { - userId: interaction.user.id, - extra: { - command: interaction.command?.name, - }, - }); - + sentryReport(e); this.logger.error(e); return interaction.editReply('Something went wrong!'); } diff --git a/src/commands/signup/signup-command.handler.ts b/src/commands/signup/signup-command.handler.ts index 00ae7a0c..2fcf3505 100644 --- a/src/commands/signup/signup-command.handler.ts +++ b/src/commands/signup/signup-command.handler.ts @@ -217,10 +217,7 @@ class SignupCommandHandler implements ICommandHandler { error: unknown, interaction: ChatInputCommandInteraction, ) { - sentryReport(error, { - userId: interaction.user.id, - extra: { command: interaction.command?.name }, - }); + sentryReport(error); this.logger.error(error); diff --git a/src/commands/signup/signup.service.ts b/src/commands/signup/signup.service.ts index 26a0629c..5c348fda 100644 --- a/src/commands/signup/signup.service.ts +++ b/src/commands/signup/signup.service.ts @@ -4,6 +4,7 @@ import { OnApplicationBootstrap, OnModuleDestroy, } from '@nestjs/common'; +import * as Sentry from '@sentry/node'; import { ActionRowBuilder, Colors, @@ -78,33 +79,47 @@ class SignupService implements OnApplicationBootstrap, OnModuleDestroy { mergeMap((group$) => group$.pipe( concatMap(async (event) => { - if (!event.reaction.message.inGuild()) return EMPTY; - - try { - // TODO: dangerous cast to Settings, but know its safe from current usage - // attempts to type it correctly just result in weirdness since all the other fields on the object are optional - const [reaction, user, settings = {} as SettingsDocument] = - await Promise.all([ - hydrateReaction(event.reaction), - hydrateUser(event.user), - this.settingsCollection.getSettings( - event.reaction.message.guildId, - ), - ]); - - // TODO: We can extract the type of the Message to be `Message` since shouldHandleReaction checks if the message is inGuild() - const shouldHandle = await this.shouldHandleReaction( - reaction, - user, - settings, - ); - - return shouldHandle - ? await this.handleReaction(reaction, user, settings) - : EMPTY; - } catch (error) { - this.handleError(error, event.user, event.reaction.message); - } + // TODO: cleanup this anon function + await Sentry.withScope(async (scope) => { + if (!event.reaction.message.inGuild()) { + return EMPTY; + } + + scope.setUser({ + id: event.user.id, + username: event.user.username ?? 'unknown', + }); + + scope.setExtras({ + message: getMessageLink(event.reaction.message), + }); + + try { + // TODO: dangerous cast to Settings, but know its safe from current usage + // attempts to type it correctly just result in weirdness since all the other fields on the object are optional + const [reaction, user, settings = {} as SettingsDocument] = + await Promise.all([ + hydrateReaction(event.reaction), + hydrateUser(event.user), + this.settingsCollection.getSettings( + event.reaction.message.guildId, + ), + ]); + + // TODO: We can extract the type of the Message to be `Message` since shouldHandleReaction checks if the message is inGuild() + const shouldHandle = await this.shouldHandleReaction( + reaction, + user, + settings, + ); + + return shouldHandle + ? await this.handleReaction(reaction, user, settings) + : EMPTY; + } catch (error) { + this.handleError(error, event.user, event.reaction.message); + } + }); }), ), ), @@ -285,20 +300,15 @@ class SignupService implements OnApplicationBootstrap, OnModuleDestroy { user: User | PartialUser, message: Message | PartialMessage, ) { - sentryReport(error, { - userId: user.username || 'unknown', - extra: { message: getMessageLink(message) }, - }); + const scope = Sentry.getCurrentScope(); + scope.setUser({ id: user.username ?? 'unknown' }); + scope.setExtras({ message: getMessageLink(message) }); this.logger.error(error); - const reply = match(error) - .with( - P.instanceOf(DiscordjsError), - ({ code }) => code === DiscordjsErrorCodes.InteractionCollectorError, - () => SIGNUP_MESSAGES.PROG_SELECTION_TIMEOUT, - ) - .otherwise(() => SIGNUP_MESSAGES.GENERIC_APPROVAL_ERROR); + const reply = SIGNUP_MESSAGES.GENERIC_APPROVAL_ERROR; + + scope.captureMessage(reply, 'info'); // TODO: Improve error reporting to better inform user what happened await Promise.all([ @@ -335,7 +345,8 @@ class SignupService implements OnApplicationBootstrap, OnModuleDestroy { try { const reply = await message.awaitMessageComponent({ - time: 60_000, + // time: 60_000 * 2, // 2 minutes + time: 5_000, filter: isSameUserFilter(user), }); @@ -351,10 +362,11 @@ class SignupService implements OnApplicationBootstrap, OnModuleDestroy { await reply.update(SIGNUP_MESSAGES.UNEXPECTED_PROG_SELECTION_ERROR); } catch (error) { - sentryReport(error, { - userId: user.username, - extra: { encounter: signup.encounter, discordId: signup.discordId }, - }); + sentryReport(error, (scope) => + scope.setExtras({ + extra: { encounter: signup.encounter, discordId: signup.discordId }, + }), + ); this.logger.error(error); @@ -393,7 +405,9 @@ class SignupService implements OnApplicationBootstrap, OnModuleDestroy { partyType === PartyType.EARLY_PROG_PARTY || partyType === PartyType.PROG_PARTY; - if (!(role && isValidPartyType)) return; + if (!(role && isValidPartyType)) { + return; + } try { const member = await this.discordService.getGuildMember( @@ -405,7 +419,7 @@ class SignupService implements OnApplicationBootstrap, OnModuleDestroy { await member.roles.add(role); } } catch (e) { - sentryReport(e, { extra: { encounter, discordId } }); + sentryReport(e, (scope) => scope.setExtras({ encounter, discordId })); this.logger.error(e); } } diff --git a/src/commands/slash-commands.service.ts b/src/commands/slash-commands.service.ts index 7d0c7180..540f9f8f 100644 --- a/src/commands/slash-commands.service.ts +++ b/src/commands/slash-commands.service.ts @@ -1,6 +1,7 @@ import { Injectable, Logger } from '@nestjs/common'; import { ConfigService } from '@nestjs/config'; import { CommandBus } from '@nestjs/cqrs'; +import * as Sentry from '@sentry/node'; import { ChatInputCommandInteraction, Client, @@ -38,33 +39,43 @@ class SlashCommandsService { listenToCommands() { this.client.on(Events.InteractionCreate, async (interaction) => { - if (!(interaction.isChatInputCommand() && interaction.inGuild())) return; + await Sentry.withScope(async (scope) => { + if (!(interaction.isChatInputCommand() && interaction.inGuild())) { + return; + } + + scope.setUser({ userId: interaction.user.id }); + scope.setExtras({ + username: interaction.user.username, + command: interaction.commandName, + }); - // TODO: This could be more generic somehow - const command = match(interaction.commandName) - .with(LookupSlashCommand.name, () => new LookupCommand(interaction)) - .with(SignupSlashCommand.name, () => new SignupCommand(interaction)) - .with(StatusSlashCommand.name, () => new StatusCommand(interaction)) - .with(SettingsSlashCommand.name, () => { - const subcommand = interaction.options.getSubcommand(); - return match(subcommand) - .with('edit', () => new EditSettingsCommand(interaction)) - .with('view', () => new ViewSettingsCommand(interaction)) - .run(); - }) - .with( - RemoveSignupSlashCommand.name, - () => new RemoveSignupCommand(interaction), - ) - .otherwise(() => undefined); + // TODO: This could be more generic somehow + const command = match(interaction.commandName) + .with(LookupSlashCommand.name, () => new LookupCommand(interaction)) + .with(SignupSlashCommand.name, () => new SignupCommand(interaction)) + .with(StatusSlashCommand.name, () => new StatusCommand(interaction)) + .with(SettingsSlashCommand.name, () => { + const subcommand = interaction.options.getSubcommand(); + return match(subcommand) + .with('edit', () => new EditSettingsCommand(interaction)) + .with('view', () => new ViewSettingsCommand(interaction)) + .run(); + }) + .with( + RemoveSignupSlashCommand.name, + () => new RemoveSignupCommand(interaction), + ) + .otherwise(() => undefined); - if (command) { - try { - await this.commandBus.execute(command); - } catch (err) { - await this.handleCommandError(err, interaction); + if (command) { + try { + await this.commandBus.execute(command); + } catch (err) { + await this.handleCommandError(err, interaction); + } } - } + }); }); } diff --git a/src/commands/status/status-command.handler.ts b/src/commands/status/status-command.handler.ts index a55f28e8..17b746d5 100644 --- a/src/commands/status/status-command.handler.ts +++ b/src/commands/status/status-command.handler.ts @@ -67,10 +67,7 @@ class StatusCommandHandler implements ICommandHandler { error: unknown, interaction: ChatInputCommandInteraction, ) { - sentryReport(error, { - userId: interaction.user.username, - extra: { command: interaction.command?.name }, - }); + sentryReport(error); this.logger.error(error); diff --git a/src/discord/discord.module.ts b/src/discord/discord.module.ts index 0ffef9d8..e26b2bfe 100644 --- a/src/discord/discord.module.ts +++ b/src/discord/discord.module.ts @@ -5,10 +5,10 @@ import { OnApplicationShutdown, } from '@nestjs/common'; import { ConfigModule, ConfigService } from '@nestjs/config'; +import * as Sentry from '@sentry/node'; import { ActivityType, Client, Events, Options } from 'discord.js'; import { first, firstValueFrom, fromEvent } from 'rxjs'; import { AppConfig } from '../app.config.js'; -import { sentryReport } from '../sentry/sentry.consts.js'; import { INTENTS, PARTIALS } from './discord.consts.js'; import { DISCORD_CLIENT, InjectDiscordClient } from './discord.decorators.js'; import { CacheTime } from './discord.helpers.js'; @@ -59,7 +59,7 @@ import { DiscordService } from './discord.service.js'; const started$ = fromEvent(client, Events.ClientReady).pipe(first()); client.once('error', (error) => { - sentryReport(error); + Sentry.captureException(error); logger.error(error); }); @@ -86,7 +86,7 @@ class DiscordModule implements OnApplicationBootstrap, OnApplicationShutdown { fromEvent(this.client, Events.CacheSweep).subscribe({ next: (msg) => this.logger.log(msg), error: (err) => { - sentryReport(err); + Sentry; this.logger.error(err); }, }); diff --git a/src/sentry/sentry.consts.ts b/src/sentry/sentry.consts.ts index 000e4d06..21cf4b55 100644 --- a/src/sentry/sentry.consts.ts +++ b/src/sentry/sentry.consts.ts @@ -1,16 +1,13 @@ import * as Sentry from '@sentry/node'; -interface ReportOptions { - userId?: string; - extra?: Record; -} +type ScopeFn = (scope: Sentry.Scope) => void; -export const sentryReport = ( - error: unknown, - { userId, extra }: ReportOptions = {}, -) => { - Sentry.withScope((scope) => { - userId && scope.setUser({ id: userId }); - Sentry.captureException(error, { extra }); - }); +/** + * @param error The error to report + * @param scopeFn Optional function to modify the scope before sending the report + */ +export const sentryReport = (error: unknown, scopeFn?: ScopeFn) => { + const scope = Sentry.getCurrentScope(); + scope.captureException(error); + scopeFn?.(scope); }; diff --git a/src/sheets/sheets.service.ts b/src/sheets/sheets.service.ts index f3af1705..453499c5 100644 --- a/src/sheets/sheets.service.ts +++ b/src/sheets/sheets.service.ts @@ -78,8 +78,7 @@ class SheetsService { ); default: { - const msg = `unknown party type: ${partyType} for user: ${signup.discordId}. Not appending to any Google Sheet`; - Sentry.captureMessage(msg); + const msg = `unknown party type: ${partyType} for character: ${signup.character}`; this.logger.warn(msg); } }