Skip to content

Commit d2a86bb

Browse files
committed
chore: wip
1 parent 2515a07 commit d2a86bb

File tree

16 files changed

+3773
-170
lines changed

16 files changed

+3773
-170
lines changed

package.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,6 @@
6565
"@stacksjs/eslint-config": "^4.14.0-beta.3",
6666
"better-dx": "^0.2.5"
6767
},
68-
"overrides": {
69-
"jiti": "^2.6.1",
70-
"unconfig": "0.3.10"
71-
},
7268
"workspaces": [
7369
"packages/*"
7470
]

packages/bun-router/src/auth.ts

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { EnhancedRequest } from './types'
1+
import type { EnhancedRequest, JwtPayload } from './types'
22

33
// Types
44
export interface JwtVerifyOptions {
@@ -42,17 +42,8 @@ export interface OAuth2Config {
4242
state?: string
4343
}
4444

45-
// JWT Payload interface
46-
export interface JwtPayload {
47-
[key: string]: any
48-
iat: number
49-
exp?: number
50-
nbf?: number
51-
iss?: string
52-
sub?: string
53-
aud?: string | string[]
54-
jti?: string
55-
}
45+
// Re-export JwtPayload from types for backwards compatibility
46+
export type { JwtPayload }
5647

5748
// Base64URL encoding/decoding functions
5849
function base64UrlEncode(str: string): string {

packages/bun-router/src/errors/error-reporting.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export interface ErrorReportingConfig {
1414
environment?: string
1515
release?: string
1616
sampleRate?: number
17-
beforeSend?: (error: RouterException, context: ErrorContext) => RouterException | null
17+
beforeSend?: (error: Error, context: ErrorContext) => Error | null
1818
filters?: {
1919
ignoreErrors?: (string | RegExp)[]
2020
ignoreCodes?: string[]

packages/bun-router/src/errors/exceptions.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
export interface ErrorContext {
88
requestId?: string
9-
userId?: string
9+
userId?: string | number
1010
traceId?: string
1111
spanId?: string
1212
route?: string
@@ -15,7 +15,7 @@ export interface ErrorContext {
1515
userAgent?: string
1616
ip?: string
1717
timestamp?: Date
18-
metadata?: Record<string, any>
18+
metadata?: Record<string, unknown>
1919
}
2020

2121
export interface ErrorDetails {

packages/bun-router/src/errors/graceful-degradation.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,7 @@ export class GracefulDegradationManager {
496496
.replace('{service}', context.serviceName)
497497
.replace('{url}', context.request.url)
498498
.replace('{method}', context.request.method)
499-
.replace('{userId}', context.request.user?.id || 'anonymous')
499+
.replace('{userId}', String(context.request.user?.id || 'anonymous'))
500500
}
501501

502502
private updateMetrics(serviceName: string, success: boolean, responseTime: number): void {

packages/bun-router/src/middleware/input_validation.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ export interface ValidationRule {
77
min?: number
88
max?: number
99
pattern?: RegExp
10-
enum?: any[]
11-
custom?: (value: any) => boolean | string
10+
enum?: unknown[]
11+
custom?: (value: unknown) => boolean | string
1212
sanitize?: boolean
13-
transform?: (value: any) => any
13+
transform?: (value: unknown) => unknown
1414
}
1515

1616
export interface ValidationSchema {
@@ -47,7 +47,7 @@ export default class InputValidation {
4747

4848
this.options = {
4949
enabled: options.enabled ?? validationConfig.enabled ?? true,
50-
schemas: options.schemas ?? validationConfig.schemas ?? {},
50+
schemas: (options.schemas ?? validationConfig.schemas ?? {}) as InputValidationOptions['schemas'],
5151
sanitizeByDefault: options.sanitizeByDefault ?? validationConfig.sanitizeByDefault ?? true,
5252
strictMode: options.strictMode ?? validationConfig.strictMode ?? false,
5353
allowUnknownFields: options.allowUnknownFields ?? validationConfig.allowUnknownFields ?? true,

0 commit comments

Comments
 (0)