Skip to content

Commit

Permalink
bugsnag update
Browse files Browse the repository at this point in the history
  • Loading branch information
LarmuseauNiels committed Apr 27, 2023
1 parent ae6c146 commit 0322458
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 22 deletions.
2 changes: 2 additions & 0 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { Islander } from "./islander/islander";
import { AchievementsModule } from "./islander/AchievementsModule";
import { WebApi } from "./modules/WebApi";
import Bugsnag from "@bugsnag/js";
import BugsnagPluginExpress from "@bugsnag/plugin-express";

const fs = require("fs");
const {
Expand Down Expand Up @@ -70,6 +71,7 @@ class FpgClient extends Client {

Bugsnag.start({
apiKey: process.env.BUGSNAG_API_KEY,
plugins: [BugsnagPluginExpress],
appVersion: process.env.CAPROVER_GIT_COMMIT_SHA.slice(0, 7),
});
global.bugsnag = Bugsnag;
Expand Down
2 changes: 1 addition & 1 deletion modules/ApiFunctions/MemberEndPoints.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export function memberEndPoints(app) {
.findMany({
take: 25,
where: {
ID: user.id,
userid: user.id,
},
orderBy: {
Timestamp: "desc",
Expand Down
3 changes: 3 additions & 0 deletions modules/WebApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const prompt = "consent";

export class WebApi {
constructor() {
const middleware = global.client.bugsnag.getPlugin("express");
passport.use(
new DiscordStrategy(
{
Expand All @@ -36,10 +37,12 @@ export class WebApi {
}
)
);
app.use(middleware.requestHandler);
app.use(cors());
app.use(passport.initialize());
app.use(bodyParser.urlencoded({ extended: false }));
app.use(bodyParser.json());
app.use(middleware.errorHandler);

//auth test
app.get(
Expand Down
30 changes: 20 additions & 10 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"author": "",
"license": "ISC",
"dependencies": {
"@bugsnag/js": "^7.20.0",
"@bugsnag/js": "^7.20.2",
"@bugsnag/plugin-express": "^7.19.0",
"@napi-rs/canvas": "^0.1.29",
"@prisma/client": "^4.12.0",
"@types/passport": "^1.0.12",
Expand Down
27 changes: 17 additions & 10 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
# yarn lockfile v1


"@bugsnag/browser@^7.20.0":
version "7.20.0"
resolved "https://registry.npmjs.org/@bugsnag/browser/-/browser-7.20.0.tgz"
integrity sha512-LzZWI6q5cWYQSXvfJDcSl287d2xXESVn0L20lK+K5nwo/jXcK9IVZr9L+CYZ40HVXaC9jOmQbqZ18hsbO2QNIw==
"@bugsnag/browser@^7.20.2":
version "7.20.2"
resolved "https://registry.npmjs.org/@bugsnag/browser/-/browser-7.20.2.tgz"
integrity sha512-4J4s53ZpYr3hHA+QjxUjOI6U+A8+XuUVH45UshE87Jp2Y4mV8ML2DovejqJS8J8yjdbnh2z1Wtg/v3WUNt4ayQ==
dependencies:
"@bugsnag/core" "^7.19.0"

"@bugsnag/core@^7.19.0":
"@bugsnag/core@^7.0.0", "@bugsnag/core@^7.19.0":
version "7.19.0"
resolved "https://registry.npmjs.org/@bugsnag/core/-/core-7.19.0.tgz"
integrity sha512-2KGwdaLD9PhR7Wk7xPi3jGuGsKTatc/28U4TOZIDU3CgC2QhGjubwiXSECel5gwxhZ3jACKcMKSV2ovHhv1NrA==
Expand All @@ -25,12 +25,12 @@
resolved "https://registry.npmjs.org/@bugsnag/cuid/-/cuid-3.0.2.tgz"
integrity sha512-cIwzC93r3PQ/INeuwtZwkZIG2K8WWN0rRLZQhu+mr48Ay+i6sEki4GYfTsflse7hZ1BeDWrNb/Q9vgY3B31xHQ==

"@bugsnag/js@^7.20.0":
version "7.20.0"
resolved "https://registry.npmjs.org/@bugsnag/js/-/js-7.20.0.tgz"
integrity sha512-lhUUSOveE8fP10RagAINqBmuH+eoOpyUOiTN1WRkjHUevWG0LZjRRUWEGN3AA+ZyTphmC6ljd2qE3/64qfOSGQ==
"@bugsnag/js@^7.20.2":
version "7.20.2"
resolved "https://registry.npmjs.org/@bugsnag/js/-/js-7.20.2.tgz"
integrity sha512-Q08k0h0h6NFwFGkFmib39Uln2WpvJdqT1EGF1JlyYiGW03Y+VopVb9r37pZrRrN9IY08mxaIEO8la5xeaWAs6A==
dependencies:
"@bugsnag/browser" "^7.20.0"
"@bugsnag/browser" "^7.20.2"
"@bugsnag/node" "^7.19.0"

"@bugsnag/node@^7.19.0":
Expand All @@ -45,6 +45,13 @@
pump "^3.0.0"
stack-generator "^2.0.3"

"@bugsnag/plugin-express@^7.19.0":
version "7.19.0"
resolved "https://registry.npmjs.org/@bugsnag/plugin-express/-/plugin-express-7.19.0.tgz"
integrity sha512-2nygX1M6QgLGNLGlYArwI3RN2lL1b4MImeOH7ijGhiKdiEGEDtfnwHWoEZ9S/yBRBrA5iLXxo+agxk3RZ0NZkg==
dependencies:
iserror "^0.0.2"

"@bugsnag/safe-json-stringify@^6.0.0":
version "6.0.0"
resolved "https://registry.npmjs.org/@bugsnag/safe-json-stringify/-/safe-json-stringify-6.0.0.tgz"
Expand Down

0 comments on commit 0322458

Please sign in to comment.