fix(sentry): fixed sentry options types (#130)

* fix(sentry): fixed sentry options types

* changeset
pull/131/head
Yusuke Wada 2023-08-23 10:57:54 +09:00 committed by GitHub
parent 9f901b971c
commit de2e95a59e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 13 additions and 25 deletions

View File

@ -0,0 +1,5 @@
---
'@hono/sentry': patch
---
fixed sentry options types

View File

@ -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,

View File

@ -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,

View File

@ -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',
},
})
}

View File

@ -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
}