From 2bfe9db9b221a9ea11e6a2f90fc8eef4bf9fedd9 Mon Sep 17 00:00:00 2001 From: Andrew Jiang Date: Wed, 11 Sep 2024 21:27:37 -0400 Subject: [PATCH] fix sentry typings --- packages/ui/docs-bundle/sentry.client.config.ts | 5 +---- packages/ui/docs-bundle/sentry.edge.config.ts | 5 +---- packages/ui/docs-bundle/sentry.server.config.ts | 5 +---- 3 files changed, 3 insertions(+), 12 deletions(-) diff --git a/packages/ui/docs-bundle/sentry.client.config.ts b/packages/ui/docs-bundle/sentry.client.config.ts index 780e77fa93..cef2919714 100644 --- a/packages/ui/docs-bundle/sentry.client.config.ts +++ b/packages/ui/docs-bundle/sentry.client.config.ts @@ -43,10 +43,7 @@ Sentry.init({ // This option is required for capturing headers and cookies. sendDefaultPii: true, - beforeSend: (event: Sentry.Event, _: Sentry.EventHint): Sentry.Event | null => { - if ((event.type as string) === "csp" || (event as any)?.csp != null) { - return null; - } + beforeSend: (event: Sentry.ErrorEvent, _: Sentry.EventHint): Sentry.ErrorEvent | null => { // Filter out events from privategpt if (event.request?.url?.includes("privategpt")) { return null; diff --git a/packages/ui/docs-bundle/sentry.edge.config.ts b/packages/ui/docs-bundle/sentry.edge.config.ts index 3072886bba..539835a7b2 100644 --- a/packages/ui/docs-bundle/sentry.edge.config.ts +++ b/packages/ui/docs-bundle/sentry.edge.config.ts @@ -22,10 +22,7 @@ Sentry.init({ spotlight: process.env.NODE_ENV === "development", - beforeSend: (event: Sentry.Event, _: Sentry.EventHint): Sentry.Event | null => { - if ((event.type as string) === "csp" || (event as any)?.csp != null) { - return null; - } + beforeSend: (event: Sentry.ErrorEvent, _: Sentry.EventHint): Sentry.ErrorEvent | null => { // Filter out events from privategpt if (event.request?.url?.includes("privategpt")) { return null; diff --git a/packages/ui/docs-bundle/sentry.server.config.ts b/packages/ui/docs-bundle/sentry.server.config.ts index e59d6e13f5..fc02b339f3 100644 --- a/packages/ui/docs-bundle/sentry.server.config.ts +++ b/packages/ui/docs-bundle/sentry.server.config.ts @@ -21,10 +21,7 @@ Sentry.init({ spotlight: process.env.NODE_ENV === "development", - beforeSend: (event: Sentry.Event, _: Sentry.EventHint): Sentry.Event | null => { - if ((event.type as string) === "csp" || (event as any)?.csp != null) { - return null; - } + beforeSend: (event: Sentry.ErrorEvent, _: Sentry.EventHint): Sentry.ErrorEvent | null => { // Filter out events from privategpt if (event.request?.url?.includes("privategpt")) { return null;