fix(sentry): fixed sentry options types (#130)
* fix(sentry): fixed sentry options types * changesetpull/131/head
parent
9f901b971c
commit
de2e95a59e
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
'@hono/sentry': patch
|
||||
---
|
||||
|
||||
fixed sentry options types
|
|
@ -1,5 +1,6 @@
|
|||
import type { Context, MiddlewareHandler } from 'https://deno.land/x/hono/mod.ts'
|
||||
import Toucan from 'https://cdn.skypack.dev/toucan-js@2.7.0'
|
||||
import type { Options as ToucanOptions } from 'https://cdn.skypack.dev/toucan-js@2.7.0'
|
||||
|
||||
declare module 'https://deno.land/x/hono/mod.ts' {
|
||||
interface ContextVariableMap {
|
||||
|
@ -11,23 +12,13 @@ class MockContext implements ExecutionContext {
|
|||
passThroughOnException(): void {
|
||||
throw new Error('Method not implemented.')
|
||||
}
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
async waitUntil(promise: Promise<any>): Promise<void> {
|
||||
await promise
|
||||
}
|
||||
}
|
||||
|
||||
export type Options = {
|
||||
dsn?: string
|
||||
allowedCookies?: string[] | RegExp
|
||||
allowedHeaders?: string[] | RegExp
|
||||
allowedSearchParams?: string[] | RegExp
|
||||
attachStacktrace?: boolean
|
||||
debug?: boolean
|
||||
environment?: string
|
||||
maxBreadcrumbs?: number
|
||||
pkg?: Record<string, any>
|
||||
release?: string
|
||||
}
|
||||
export type Options = Omit<ToucanOptions, 'request' | 'context'>
|
||||
|
||||
export const sentry = (
|
||||
options?: Options,
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import type { Context, MiddlewareHandler } from 'hono'
|
||||
import Toucan from 'toucan-js'
|
||||
import type { Options as ToucanOptions } from 'toucan-js'
|
||||
|
||||
declare module 'hono' {
|
||||
interface ContextVariableMap {
|
||||
|
@ -11,23 +12,13 @@ class MockContext implements ExecutionContext {
|
|||
passThroughOnException(): void {
|
||||
throw new Error('Method not implemented.')
|
||||
}
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
async waitUntil(promise: Promise<any>): Promise<void> {
|
||||
await promise
|
||||
}
|
||||
}
|
||||
|
||||
export type Options = {
|
||||
dsn?: string
|
||||
allowedCookies?: string[] | RegExp
|
||||
allowedHeaders?: string[] | RegExp
|
||||
allowedSearchParams?: string[] | RegExp
|
||||
attachStacktrace?: boolean
|
||||
debug?: boolean
|
||||
environment?: string
|
||||
maxBreadcrumbs?: number
|
||||
pkg?: Record<string, any>
|
||||
release?: string
|
||||
}
|
||||
export type Options = Omit<ToucanOptions, 'request' | 'context'>
|
||||
|
||||
export const sentry = (
|
||||
options?: Options,
|
||||
|
|
|
@ -17,7 +17,7 @@ makeThisModuleAnExecutableReplacer(async ({ parsedImportExportStatement, version
|
|||
...parsedImportExportStatement,
|
||||
parsedArgument: {
|
||||
type: 'URL',
|
||||
url: `https://deno.land/x/hono/mod.ts`,
|
||||
url: 'https://deno.land/x/hono/mod.ts',
|
||||
},
|
||||
})
|
||||
}
|
||||
|
|
|
@ -6,6 +6,7 @@ class Context implements ExecutionContext {
|
|||
passThroughOnException(): void {
|
||||
throw new Error('Method not implemented.')
|
||||
}
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
async waitUntil(promise: Promise<any>): Promise<void> {
|
||||
await promise
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue