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 type { Context, MiddlewareHandler } from 'https://deno.land/x/hono/mod.ts'
|
||||||
import Toucan from 'https://cdn.skypack.dev/toucan-js@2.7.0'
|
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' {
|
declare module 'https://deno.land/x/hono/mod.ts' {
|
||||||
interface ContextVariableMap {
|
interface ContextVariableMap {
|
||||||
|
@ -11,23 +12,13 @@ class MockContext implements ExecutionContext {
|
||||||
passThroughOnException(): void {
|
passThroughOnException(): void {
|
||||||
throw new Error('Method not implemented.')
|
throw new Error('Method not implemented.')
|
||||||
}
|
}
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
async waitUntil(promise: Promise<any>): Promise<void> {
|
async waitUntil(promise: Promise<any>): Promise<void> {
|
||||||
await promise
|
await promise
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export type Options = {
|
export type Options = Omit<ToucanOptions, 'request' | 'context'>
|
||||||
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 const sentry = (
|
export const sentry = (
|
||||||
options?: Options,
|
options?: Options,
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import type { Context, MiddlewareHandler } from 'hono'
|
import type { Context, MiddlewareHandler } from 'hono'
|
||||||
import Toucan from 'toucan-js'
|
import Toucan from 'toucan-js'
|
||||||
|
import type { Options as ToucanOptions } from 'toucan-js'
|
||||||
|
|
||||||
declare module 'hono' {
|
declare module 'hono' {
|
||||||
interface ContextVariableMap {
|
interface ContextVariableMap {
|
||||||
|
@ -11,23 +12,13 @@ class MockContext implements ExecutionContext {
|
||||||
passThroughOnException(): void {
|
passThroughOnException(): void {
|
||||||
throw new Error('Method not implemented.')
|
throw new Error('Method not implemented.')
|
||||||
}
|
}
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
async waitUntil(promise: Promise<any>): Promise<void> {
|
async waitUntil(promise: Promise<any>): Promise<void> {
|
||||||
await promise
|
await promise
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export type Options = {
|
export type Options = Omit<ToucanOptions, 'request' | 'context'>
|
||||||
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 const sentry = (
|
export const sentry = (
|
||||||
options?: Options,
|
options?: Options,
|
||||||
|
|
|
@ -17,7 +17,7 @@ makeThisModuleAnExecutableReplacer(async ({ parsedImportExportStatement, version
|
||||||
...parsedImportExportStatement,
|
...parsedImportExportStatement,
|
||||||
parsedArgument: {
|
parsedArgument: {
|
||||||
type: 'URL',
|
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 {
|
passThroughOnException(): void {
|
||||||
throw new Error('Method not implemented.')
|
throw new Error('Method not implemented.')
|
||||||
}
|
}
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
async waitUntil(promise: Promise<any>): Promise<void> {
|
async waitUntil(promise: Promise<any>): Promise<void> {
|
||||||
await promise
|
await promise
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue