💚 Fix sentry not receiving events

This commit is contained in:
Baptiste Arnaud
2022-12-16 08:39:14 +01:00
parent 92dc797b6c
commit 68de7b720f
75 changed files with 194 additions and 332 deletions

View File

@@ -8,7 +8,6 @@ import AzureADProvider from 'next-auth/providers/azure-ad'
import prisma from '@/lib/prisma'
import { Provider } from 'next-auth/providers'
import { NextApiRequest, NextApiResponse } from 'next'
import { withSentry } from '@sentry/nextjs'
import { CustomAdapter } from './adapter'
import { User } from 'db'
import { env, isNotEmpty } from 'utils'
@@ -194,4 +193,4 @@ const getRequiredGroups = (provider: string): string[] => {
const checkHasGroups = (userGroups: string[], requiredGroups: string[]) =>
userGroups?.some((userGroup) => requiredGroups?.includes(userGroup))
export default withSentry(handler)
export default handler

View File

@@ -1,4 +1,3 @@
import { withSentry } from '@sentry/nextjs'
import prisma from '@/lib/prisma'
import { Credentials } from 'models'
import { NextApiRequest, NextApiResponse } from 'next'
@@ -48,4 +47,4 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => {
return methodNotAllowed(res)
}
export default withSentry(handler)
export default handler

View File

@@ -1,4 +1,3 @@
import { withSentry } from '@sentry/nextjs'
import prisma from '@/lib/prisma'
import { NextApiRequest, NextApiResponse } from 'next'
import { getAuthenticatedUser } from '@/features/auth/api'
@@ -22,4 +21,4 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => {
return methodNotAllowed(res)
}
export default withSentry(handler)
export default handler

View File

@@ -6,7 +6,6 @@ import { stringify } from 'querystring'
import { CredentialsType } from 'models'
import { badRequest, encrypt, notAuthenticated } from 'utils/api'
import { oauth2Client } from '@/lib/googleSheets'
import { withSentry } from '@sentry/nextjs'
import { getAuthenticatedUser } from '@/features/auth/api'
const handler = async (req: NextApiRequest, res: NextApiResponse) => {
@@ -57,4 +56,4 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => {
}
}
export default withSentry(handler)
export default handler

View File

@@ -1,4 +1,3 @@
import { withSentry } from '@sentry/nextjs'
import { oauth2Client } from '@/lib/googleSheets'
import { NextApiRequest, NextApiResponse } from 'next'
@@ -20,4 +19,4 @@ const handler = (req: NextApiRequest, res: NextApiResponse) => {
}
}
export default withSentry(handler)
export default handler

View File

@@ -1,4 +1,3 @@
import { withSentry } from '@sentry/nextjs'
import { CustomDomain } from 'db'
import { got, HTTPError } from 'got'
import prisma from '@/lib/prisma'
@@ -58,4 +57,4 @@ const createDomainOnVercel = (name: string) =>
json: { name },
})
export default withSentry(handler)
export default handler

View File

@@ -1,4 +1,3 @@
import { withSentry } from '@sentry/nextjs'
import prisma from '@/lib/prisma'
import { NextApiRequest, NextApiResponse } from 'next'
import { badRequest, methodNotAllowed, notAuthenticated } from 'utils/api'
@@ -30,4 +29,4 @@ const deleteDomainOnVercel = (name: string) =>
headers: { Authorization: `Bearer ${process.env.VERCEL_TOKEN}` },
})
export default withSentry(handler)
export default handler

View File

@@ -1,4 +1,3 @@
import { withSentry } from '@sentry/nextjs'
import { DashboardFolder, WorkspaceRole } from 'db'
import prisma from '@/lib/prisma'
import { NextApiRequest, NextApiResponse } from 'next'
@@ -51,4 +50,4 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => {
return methodNotAllowed(res)
}
export default withSentry(handler)
export default handler

View File

@@ -1,4 +1,3 @@
import { withSentry } from '@sentry/nextjs'
import { DashboardFolder } from 'db'
import prisma from '@/lib/prisma'
import { NextApiRequest, NextApiResponse } from 'next'
@@ -41,4 +40,4 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => {
return methodNotAllowed(res)
}
export default withSentry(handler)
export default handler

View File

@@ -37,4 +37,4 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => {
}
}
export default withSentry(handler)
export default handler

View File

@@ -28,4 +28,4 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => {
return methodNotAllowed(res)
}
export default withSentry(handler)
export default handler

View File

@@ -46,4 +46,4 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => {
return methodNotAllowed(res)
}
export default withSentry(handler)
export default handler

View File

@@ -1,4 +1,3 @@
import { withSentry } from '@sentry/nextjs'
import { NextApiRequest, NextApiResponse } from 'next'
import { methodNotAllowed } from 'utils/api'
@@ -9,4 +8,4 @@ const handler = (req: NextApiRequest, res: NextApiResponse) => {
return methodNotAllowed(res)
}
export default withSentry(handler)
export default handler

View File

@@ -1,4 +1,3 @@
import { withSentry } from '@sentry/nextjs'
import { NextApiRequest, NextApiResponse } from 'next'
import { methodNotAllowed } from 'utils/api'
@@ -24,4 +23,4 @@ const handler = (req: NextApiRequest, res: NextApiResponse) => {
return methodNotAllowed(res)
}
export default withSentry(handler)
export default handler

View File

@@ -1,4 +1,3 @@
import { withSentry } from '@sentry/nextjs'
import prisma from '@/lib/prisma'
import { NextApiRequest, NextApiResponse } from 'next'
import { badRequest, methodNotAllowed, notAuthenticated } from 'utils/api'
@@ -16,4 +15,4 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => {
return methodNotAllowed(res)
}
export default withSentry(handler)
export default handler

View File

@@ -1,4 +1,3 @@
import { withSentry } from '@sentry/nextjs'
import prisma from '@/lib/prisma'
import { InputBlockType, PublicTypebot } from 'models'
import { NextApiRequest, NextApiResponse } from 'next'
@@ -39,4 +38,4 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => {
}
}
export default withSentry(handler)
export default handler

View File

@@ -1,4 +1,3 @@
import { withSentry } from '@sentry/nextjs'
import prisma from '@/lib/prisma'
import { InputBlockType, PublicTypebot } from 'models'
import { NextApiRequest, NextApiResponse } from 'next'
@@ -47,4 +46,4 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => {
return methodNotAllowed(res)
}
export default withSentry(handler)
export default handler

View File

@@ -1,4 +1,3 @@
import { withSentry } from '@sentry/nextjs'
import { NextApiRequest, NextApiResponse } from 'next'
import { getAuthenticatedUser } from '@/features/auth/api'
import {
@@ -36,4 +35,4 @@ const handler = async (
return methodNotAllowed(res)
}
export default withSentry(handler)
export default handler

View File

@@ -6,7 +6,6 @@ import {
notAuthenticated,
} from 'utils/api'
import Stripe from 'stripe'
import { withSentry } from '@sentry/nextjs'
import { getAuthenticatedUser } from '@/features/auth/api'
import prisma from '@/lib/prisma'
import { WorkspaceRole } from 'db'
@@ -39,4 +38,4 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => {
return methodNotAllowed(res)
}
export default withSentry(handler)
export default handler

View File

@@ -1,4 +1,3 @@
import { withSentry } from '@sentry/nextjs'
import { Plan } from 'db'
import prisma from '@/lib/prisma'
import { NextApiRequest, NextApiResponse } from 'next'
@@ -58,4 +57,4 @@ const createCheckoutSession = async (userId: string) => {
})
}
export default withSentry(handler)
export default handler

View File

@@ -6,7 +6,6 @@ import {
notAuthenticated,
} from 'utils/api'
import Stripe from 'stripe'
import { withSentry } from '@sentry/nextjs'
import { getAuthenticatedUser } from '@/features/auth/api'
import prisma from '@/lib/prisma'
import { WorkspaceRole } from 'db'
@@ -46,4 +45,4 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => {
return methodNotAllowed(res)
}
export default withSentry(handler)
export default handler

View File

@@ -7,7 +7,6 @@ import {
notAuthenticated,
} from 'utils/api'
import Stripe from 'stripe'
import { withSentry } from '@sentry/nextjs'
import { getAuthenticatedUser } from '@/features/auth/api'
import prisma from '@/lib/prisma'
import { Plan, WorkspaceRole } from 'db'
@@ -258,4 +257,4 @@ const parseSubscriptionItems = (
: []
)
export default withSentry(handler)
export default handler

View File

@@ -4,7 +4,6 @@ import Stripe from 'stripe'
import Cors from 'micro-cors'
import { buffer } from 'micro'
import prisma from '@/lib/prisma'
import { withSentry } from '@sentry/nextjs'
import { Plan } from 'db'
if (!process.env.STRIPE_SECRET_KEY || !process.env.STRIPE_WEBHOOK_SECRET)
@@ -128,4 +127,4 @@ const webhookHandler = async (req: NextApiRequest, res: NextApiResponse) => {
return methodNotAllowed(res)
}
export default withSentry(cors(webhookHandler as any))
export default cors(webhookHandler as any)

View File

@@ -1,4 +1,3 @@
import { withSentry } from '@sentry/nextjs'
import { Plan, WorkspaceRole } from 'db'
import prisma from '@/lib/prisma'
import { NextApiRequest, NextApiResponse } from 'next'
@@ -111,4 +110,4 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => {
}
}
export default withSentry(handler)
export default handler

View File

@@ -1,4 +1,3 @@
import { withSentry } from '@sentry/nextjs'
import { CollaborationType } from 'db'
import prisma from '@/lib/prisma'
import { NextApiRequest, NextApiResponse } from 'next'
@@ -87,4 +86,4 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => {
return methodNotAllowed(res)
}
export default withSentry(handler)
export default handler

View File

@@ -2,7 +2,6 @@ import { PublicTypebot } from 'models'
import prisma from '@/lib/prisma'
import { NextApiRequest, NextApiResponse } from 'next'
import { methodNotAllowed, notAuthenticated } from 'utils/api'
import { withSentry } from '@sentry/nextjs'
import { getAuthenticatedUser } from '@/features/auth/api'
import { canReadTypebots } from '@/utils/api/dbRules'
@@ -35,4 +34,4 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => {
return methodNotAllowed(res)
}
export default withSentry(handler)
export default handler

View File

@@ -1,4 +1,3 @@
import { withSentry } from '@sentry/nextjs'
import prisma from '@/lib/prisma'
import { Stats } from 'models'
import { NextApiRequest, NextApiResponse } from 'next'
@@ -47,4 +46,4 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => {
return methodNotAllowed(res)
}
export default withSentry(handler)
export default handler

View File

@@ -1,4 +1,3 @@
import { withSentry } from '@sentry/nextjs'
import prisma from '@/lib/prisma'
import { NextApiRequest, NextApiResponse } from 'next'
import { canReadTypebots } from '@/utils/api/dbRules'
@@ -20,4 +19,4 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => {
methodNotAllowed(res)
}
export default withSentry(handler)
export default handler

View File

@@ -1,4 +1,3 @@
import { withSentry } from '@sentry/nextjs'
import prisma from '@/lib/prisma'
import { NextApiRequest, NextApiResponse } from 'next'
import { canReadTypebots } from '@/utils/api/dbRules'
@@ -21,4 +20,4 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => {
methodNotAllowed(res)
}
export default withSentry(handler)
export default handler

View File

@@ -1,4 +1,3 @@
import { withSentry } from '@sentry/nextjs'
import prisma from '@/lib/prisma'
import { NextApiRequest, NextApiResponse } from 'next'
import { canEditGuests } from '@/utils/api/dbRules'
@@ -31,4 +30,4 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => {
methodNotAllowed(res)
}
export default withSentry(handler)
export default handler

View File

@@ -1,4 +1,3 @@
import { withSentry } from '@sentry/nextjs'
import { CollaborationType, WorkspaceRole } from 'db'
import prisma from '@/lib/prisma'
import { NextApiRequest, NextApiResponse } from 'next'
@@ -82,4 +81,4 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => {
methodNotAllowed(res)
}
export default withSentry(handler)
export default handler

View File

@@ -1,4 +1,3 @@
import { withSentry } from '@sentry/nextjs'
import { Invitation } from 'db'
import prisma from '@/lib/prisma'
import { NextApiRequest, NextApiResponse } from 'next'
@@ -35,4 +34,4 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => {
methodNotAllowed(res)
}
export default withSentry(handler)
export default handler

View File

@@ -1,4 +1,3 @@
import { withSentry } from '@sentry/nextjs'
import prisma from '@/lib/prisma'
import { defaultWebhookAttributes } from 'models'
import { NextApiRequest, NextApiResponse } from 'next'
@@ -24,4 +23,4 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => {
methodNotAllowed(res)
}
export default withSentry(handler)
export default handler

View File

@@ -1,4 +1,3 @@
import { withSentry } from '@sentry/nextjs'
import prisma from '@/lib/prisma'
import { NextApiRequest, NextApiResponse } from 'next'
import { getAuthenticatedUser } from '@/features/auth/api'
@@ -20,4 +19,4 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => {
return methodNotAllowed(res)
}
export default withSentry(handler)
export default handler

View File

@@ -1,4 +1,3 @@
import { withSentry } from '@sentry/nextjs'
import prisma from '@/lib/prisma'
import { NextApiRequest, NextApiResponse } from 'next'
import { getAuthenticatedUser } from '@/features/auth/api'
@@ -37,4 +36,4 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => {
methodNotAllowed(res)
}
export default withSentry(handler)
export default handler

View File

@@ -1,4 +1,3 @@
import { withSentry } from '@sentry/nextjs'
import prisma from '@/lib/prisma'
import { NextApiRequest, NextApiResponse } from 'next'
import { getAuthenticatedUser } from '@/features/auth/api'
@@ -18,4 +17,4 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => {
methodNotAllowed(res)
}
export default withSentry(handler)
export default handler

View File

@@ -1,4 +1,3 @@
import { withSentry } from '@sentry/nextjs'
import { CollaborationType } from 'db'
import prisma from '@/lib/prisma'
import { NextApiRequest, NextApiResponse } from 'next'
@@ -68,4 +67,4 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => {
methodNotAllowed(res)
}
export default withSentry(handler)
export default handler

View File

@@ -1,4 +1,3 @@
import { withSentry } from '@sentry/nextjs'
import { Workspace, WorkspaceInvitation, WorkspaceRole } from 'db'
import prisma from '@/lib/prisma'
import { NextApiRequest, NextApiResponse } from 'next'
@@ -74,4 +73,4 @@ const checkIfSeatsLimitReached = async (workspace: Workspace) => {
return existingMembersCount >= getSeatsLimit(workspace)
}
export default withSentry(handler)
export default handler

View File

@@ -1,4 +1,3 @@
import { withSentry } from '@sentry/nextjs'
import { WorkspaceInvitation, WorkspaceRole } from 'db'
import prisma from '@/lib/prisma'
import { NextApiRequest, NextApiResponse } from 'next'
@@ -36,4 +35,4 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => {
methodNotAllowed(res)
}
export default withSentry(handler)
export default handler

View File

@@ -1,4 +1,3 @@
import { withSentry } from '@sentry/nextjs'
import prisma from '@/lib/prisma'
import { NextApiRequest, NextApiResponse } from 'next'
import { getAuthenticatedUser } from '@/features/auth/api'
@@ -39,4 +38,4 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => {
methodNotAllowed(res)
}
export default withSentry(handler)
export default handler

View File

@@ -1,4 +1,3 @@
import { withSentry } from '@sentry/nextjs'
import { MemberInWorkspace, WorkspaceRole } from 'db'
import prisma from '@/lib/prisma'
import { NextApiRequest, NextApiResponse } from 'next'
@@ -45,4 +44,4 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => {
methodNotAllowed(res)
}
export default withSentry(handler)
export default handler

View File

@@ -1,4 +1,3 @@
import { withSentry } from '@sentry/nextjs'
import prisma from '@/lib/prisma'
import { NextApiRequest, NextApiResponse } from 'next'
import { getAuthenticatedUser } from '@/features/auth/api'
@@ -60,4 +59,4 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => {
methodNotAllowed(res)
}
export default withSentry(handler)
export default handler