summary refs log tree commit diff
path: root/util
diff options
context:
space:
mode:
authorThe Arcane Brony <myrainbowdash949@gmail.com>2021-12-22 17:43:39 +0000
committerThe Arcane Brony <myrainbowdash949@gmail.com>2021-12-22 18:43:39 +0100
commita9a92ff2cb3f9668d7a3d5b025bc20753a4c934c (patch)
treedc98592046563ed486c9a5ebd18d2618d769b59b /util
parentImprove build scripts, strip more fs-extras (diff)
downloadserver-a9a92ff2cb3f9668d7a3d5b025bc20753a4c934c.tar.xz
Add Sentry, fix compile errors
Diffstat (limited to 'util')
-rw-r--r--util/package.json1
-rw-r--r--util/src/entities/BaseClass.ts4
-rw-r--r--util/src/entities/Channel.ts2
-rw-r--r--util/src/entities/Config.ts10
4 files changed, 13 insertions, 4 deletions
diff --git a/util/package.json b/util/package.json
index 0b8423a5..e93eeab4 100644
--- a/util/package.json
+++ b/util/package.json
@@ -39,7 +39,6 @@
 	},
 	"dependencies": {
 		"amqplib": "^0.8.0",
-		"better-sqlite3": "^7.4.3",
 		"form-data": "^4.0.0",
 		"jsonwebtoken": "^8.5.1",
 		"lambert-server": "^1.2.12",
diff --git a/util/src/entities/BaseClass.ts b/util/src/entities/BaseClass.ts
index d20078e5..aabca016 100644
--- a/util/src/entities/BaseClass.ts
+++ b/util/src/entities/BaseClass.ts
@@ -52,12 +52,12 @@ export class BaseClassWithoutId extends BaseEntity {
 
 	static increment<T extends BaseClass>(conditions: FindConditions<T>, propertyPath: string, value: number | string) {
 		const repository = this.getRepository();
-		return repository.increment(conditions, propertyPath, value);
+		return repository.increment(conditions as T, propertyPath, value);
 	}
 
 	static decrement<T extends BaseClass>(conditions: FindConditions<T>, propertyPath: string, value: number | string) {
 		const repository = this.getRepository();
-		return repository.decrement(conditions, propertyPath, value);
+		return repository.decrement(conditions as T, propertyPath, value);
 	}
 }
 
diff --git a/util/src/entities/Channel.ts b/util/src/entities/Channel.ts
index bd2e5a58..4036b5d6 100644
--- a/util/src/entities/Channel.ts
+++ b/util/src/entities/Channel.ts
@@ -203,7 +203,7 @@ export class Channel extends BaseClass {
 
 	static async createDMChannel(recipients: string[], creator_user_id: string, name?: string) {
 		recipients = recipients.unique().filter((x) => x !== creator_user_id);
-		const otherRecipientsUsers = await User.find({ where: recipients.map((x) => ({ id: x })), select: ["id"] });
+		const otherRecipientsUsers = await User.find({ where: recipients.map((x) => ({ id: x })) });
 
 		// TODO: check config for max number of recipients
 		if (otherRecipientsUsers.length !== recipients.length) {
diff --git a/util/src/entities/Config.ts b/util/src/entities/Config.ts
index 2d003c99..31384412 100644
--- a/util/src/entities/Config.ts
+++ b/util/src/entities/Config.ts
@@ -188,6 +188,11 @@ export interface ConfigValue {
 	},
 	metrics: {
 		timeout: number;
+	},
+	sentry: {
+		enabled: boolean;
+		endpoint: string;
+		traceSampleRate: number;
 	}
 }
 
@@ -377,5 +382,10 @@ export const DefaultConfigOptions: ConfigValue = {
 	},
 	metrics: {
 		timeout: 30000
+	},
+	sentry: {
+		enabled: false,
+		endpoint: "",
+		traceSampleRate: 1.0
 	}
 };