@stacksjs/bun-router 0.0.2 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-r15a48wc.js → chunk-cjdekj87.js} +536 -98
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +2 -2
- package/dist/index.d.ts +3 -1
- package/dist/index.js +454 -119
- package/package.json +7 -9
- package/dist/auth.d.ts +0 -77
- package/dist/cache/lru-cache.d.ts +0 -88
- package/dist/cache/middleware-memoization.d.ts +0 -101
- package/dist/cache/route-cache-warmer.d.ts +0 -125
- package/dist/cache/sqlite-cache.d.ts +0 -114
- package/dist/cache/streaming-cache.d.ts +0 -86
- package/dist/cli/colors.d.ts +0 -12
- package/dist/cli/index.d.ts +0 -10
- package/dist/cli/middleware.d.ts +0 -31
- package/dist/cli/openapi.d.ts +0 -17
- package/dist/cli/router.d.ts +0 -15
- package/dist/cli/routes.d.ts +0 -30
- package/dist/cli/utils.d.ts +0 -68
- package/dist/config.d.ts +0 -274
- package/dist/container/container.d.ts +0 -141
- package/dist/container/contextual-binding.d.ts +0 -112
- package/dist/container/decorators.d.ts +0 -114
- package/dist/container/service-provider.d.ts +0 -221
- package/dist/development/hot-reload.d.ts +0 -129
- package/dist/development/index.d.ts +0 -144
- package/dist/development/performance-profiler.d.ts +0 -152
- package/dist/development/route-debugger.d.ts +0 -102
- package/dist/development/route-inspector.d.ts +0 -142
- package/dist/development/typescript-utilities.d.ts +0 -116
- package/dist/docs.d.ts +0 -10
- package/dist/errors/circuit-breaker.d.ts +0 -138
- package/dist/errors/error-handler.d.ts +0 -57
- package/dist/errors/error-reporting.d.ts +0 -135
- package/dist/errors/exceptions.d.ts +0 -178
- package/dist/errors/graceful-degradation.d.ts +0 -130
- package/dist/errors/index.d.ts +0 -6
- package/dist/errors/router-errors.d.ts +0 -97
- package/dist/file-serving/static-files.d.ts +0 -98
- package/dist/middleware/auth.d.ts +0 -34
- package/dist/middleware/content_security_policy.d.ts +0 -54
- package/dist/middleware/cors.d.ts +0 -5
- package/dist/middleware/csrf.d.ts +0 -7
- package/dist/middleware/ddos_protection.d.ts +0 -47
- package/dist/middleware/file_security.d.ts +0 -23
- package/dist/middleware/file_upload.d.ts +0 -41
- package/dist/middleware/helmet.d.ts +0 -54
- package/dist/middleware/index.d.ts +0 -55
- package/dist/middleware/input_validation.d.ts +0 -46
- package/dist/middleware/json_body.d.ts +0 -4
- package/dist/middleware/performance_alerting.d.ts +0 -88
- package/dist/middleware/performance_dashboard.d.ts +0 -97
- package/dist/middleware/performance_monitor.d.ts +0 -236
- package/dist/middleware/pipeline.d.ts +0 -90
- package/dist/middleware/rate_limit.d.ts +0 -33
- package/dist/middleware/request_id.d.ts +0 -4
- package/dist/middleware/request_signing.d.ts +0 -96
- package/dist/middleware/request_tracer.d.ts +0 -76
- package/dist/middleware/response_cache.d.ts +0 -90
- package/dist/middleware/security.d.ts +0 -70
- package/dist/middleware/security_suite.d.ts +0 -46
- package/dist/middleware/session.d.ts +0 -7
- package/dist/model-binding/index.d.ts +0 -17
- package/dist/model-binding/model-middleware.d.ts +0 -80
- package/dist/model-binding/model-registry.d.ts +0 -125
- package/dist/model-binding.d.ts +0 -123
- package/dist/model-resolver-factory.d.ts +0 -31
- package/dist/observability/correlation.d.ts +0 -131
- package/dist/observability/health-checks.d.ts +0 -129
- package/dist/observability/index.d.ts +0 -92
- package/dist/observability/integration.d.ts +0 -112
- package/dist/observability/metrics.d.ts +0 -135
- package/dist/observability/tracing.d.ts +0 -112
- package/dist/optimization/bun-utilities.d.ts +0 -106
- package/dist/query-builder-integration.d.ts +0 -24
- package/dist/request/enhanced-request.d.ts +0 -143
- package/dist/request/macros.d.ts +0 -267
- package/dist/response/macros.d.ts +0 -207
- package/dist/response/response-factory.d.ts +0 -93
- package/dist/router/file-based-routing.d.ts +0 -40
- package/dist/router/file-streaming.d.ts +0 -6
- package/dist/router/fluent-router.d.ts +0 -179
- package/dist/router/fluent-routing.d.ts +0 -198
- package/dist/router/group-organization.d.ts +0 -5
- package/dist/router/handler-resolver.d.ts +0 -13
- package/dist/router/http-methods.d.ts +0 -10
- package/dist/router/index.d.ts +0 -114
- package/dist/router/middleware-integration.d.ts +0 -86
- package/dist/router/middleware.d.ts +0 -5
- package/dist/router/model-binding.d.ts +0 -7
- package/dist/router/optimized-route-matching.d.ts +0 -6
- package/dist/router/route-building.d.ts +0 -5
- package/dist/router/route-compiler.d.ts +0 -67
- package/dist/router/route-matching.d.ts +0 -5
- package/dist/router/route-trie.d.ts +0 -69
- package/dist/router/router.d.ts +0 -133
- package/dist/router/server.d.ts +0 -5
- package/dist/router/validation-integration.d.ts +0 -116
- package/dist/router/view-rendering.d.ts +0 -5
- package/dist/router/websocket.d.ts +0 -5
- package/dist/routing/route-caching.d.ts +0 -105
- package/dist/routing/route-throttling.d.ts +0 -112
- package/dist/routing/subdomain-routing.d.ts +0 -159
- package/dist/streaming/index.d.ts +0 -15
- package/dist/streaming/sse-handler.d.ts +0 -81
- package/dist/streaming/stream-handler.d.ts +0 -81
- package/dist/testing/auth-testing.d.ts +0 -107
- package/dist/testing/file-upload-testing.d.ts +0 -139
- package/dist/testing/index.d.ts +0 -10
- package/dist/testing/middleware-testing.d.ts +0 -99
- package/dist/testing/model-binding-testing.d.ts +0 -132
- package/dist/testing/performance-testing.d.ts +0 -202
- package/dist/testing/test-client.d.ts +0 -58
- package/dist/testing/test-request.d.ts +0 -43
- package/dist/testing/test-response.d.ts +0 -45
- package/dist/testing/types.d.ts +0 -206
- package/dist/testing/websocket-testing.d.ts +0 -170
- package/dist/types/controller-types.d.ts +0 -303
- package/dist/types/core.d.ts +0 -526
- package/dist/types/middleware-types.d.ts +0 -315
- package/dist/types/request-response-augmentation.d.ts +0 -373
- package/dist/types/route-inference.d.ts +0 -287
- package/dist/types.d.ts +0 -1620
- package/dist/utils/index.d.ts +0 -1
- package/dist/utils/query-preservation.d.ts +0 -31
- package/dist/utils.d.ts +0 -69
- package/dist/validation/validator.d.ts +0 -169
- package/dist/websocket/clustering.d.ts +0 -114
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
import { Container } from './container';
|
|
2
|
-
import type { ResolutionContext } from './container';
|
|
3
|
-
/**
|
|
4
|
-
* Injectable decorator - marks a class as injectable
|
|
5
|
-
*/
|
|
6
|
-
export declare function Injectable(metadata?: InjectableMetadata): ClassDecorator;
|
|
7
|
-
/**
|
|
8
|
-
* Inject decorator - specifies dependency injection for constructor parameters
|
|
9
|
-
*/
|
|
10
|
-
export declare function Inject(token: string | symbol | Function, options?: {
|
|
11
|
-
optional?: boolean
|
|
12
|
-
tags?: string[]
|
|
13
|
-
when?: (context: ResolutionContext) => boolean
|
|
14
|
-
}): ParameterDecorator;
|
|
15
|
-
/**
|
|
16
|
-
* Optional decorator - marks a dependency as optional
|
|
17
|
-
*/
|
|
18
|
-
export declare function Optional(): ParameterDecorator;
|
|
19
|
-
/**
|
|
20
|
-
* Tagged decorator - injects services with specific tags
|
|
21
|
-
*/
|
|
22
|
-
export declare function Tagged(tag: string): ParameterDecorator;
|
|
23
|
-
/**
|
|
24
|
-
* Controller decorator - marks a class as a controller
|
|
25
|
-
*/
|
|
26
|
-
export declare function Controller(prefix?: string, options?: {
|
|
27
|
-
middleware?: Function[]
|
|
28
|
-
tags?: string[]
|
|
29
|
-
}): ClassDecorator;
|
|
30
|
-
/**
|
|
31
|
-
* HTTP method decorators
|
|
32
|
-
*/
|
|
33
|
-
export declare function Get(path?: string, options?: { middleware?: Function[], tags?: string[] }): MethodDecorator;
|
|
34
|
-
export declare function Post(path?: string, options?: { middleware?: Function[], tags?: string[] }): MethodDecorator;
|
|
35
|
-
export declare function Put(path?: string, options?: { middleware?: Function[], tags?: string[] }): MethodDecorator;
|
|
36
|
-
export declare function Delete(path?: string, options?: { middleware?: Function[], tags?: string[] }): MethodDecorator;
|
|
37
|
-
export declare function Patch(path?: string, options?: { middleware?: Function[], tags?: string[] }): MethodDecorator;
|
|
38
|
-
export declare function Options(path?: string, options?: { middleware?: Function[], tags?: string[] }): MethodDecorator;
|
|
39
|
-
export declare function Head(path?: string, options?: { middleware?: Function[], tags?: string[] }): MethodDecorator;
|
|
40
|
-
/**
|
|
41
|
-
* UseMiddleware decorator - applies middleware to a class or method
|
|
42
|
-
*/
|
|
43
|
-
export declare function UseMiddleware(...middleware: Function[]): ClassDecorator & MethodDecorator;
|
|
44
|
-
/**
|
|
45
|
-
* Parameter decorators for route handlers
|
|
46
|
-
*/
|
|
47
|
-
export declare function Param(key?: string): ParameterDecorator;
|
|
48
|
-
export declare function Query(key?: string): ParameterDecorator;
|
|
49
|
-
export declare function Body(): ParameterDecorator;
|
|
50
|
-
export declare function Header(key?: string): ParameterDecorator;
|
|
51
|
-
export declare function Cookie(key?: string): ParameterDecorator;
|
|
52
|
-
export declare function InjectParam(token: string | symbol | Function): ParameterDecorator;
|
|
53
|
-
// Metadata keys with explicit types
|
|
54
|
-
export declare const INJECTABLE_METADATA_KEY: unique symbol;
|
|
55
|
-
export declare const INJECT_METADATA_KEY: unique symbol;
|
|
56
|
-
export declare const OPTIONAL_METADATA_KEY: unique symbol;
|
|
57
|
-
export declare const TAGGED_METADATA_KEY: unique symbol;
|
|
58
|
-
export declare const CONTROLLER_METADATA_KEY: unique symbol;
|
|
59
|
-
export declare const ROUTE_METADATA_KEY: unique symbol;
|
|
60
|
-
export declare const MIDDLEWARE_METADATA_KEY: unique symbol;
|
|
61
|
-
export declare const PARAM_METADATA_KEY: unique symbol;
|
|
62
|
-
// Export a default instance
|
|
63
|
-
export declare const decoratorContainer: DecoratorContainer;
|
|
64
|
-
// Decorator metadata interfaces
|
|
65
|
-
export declare interface InjectableMetadata {
|
|
66
|
-
token?: string | symbol
|
|
67
|
-
scope?: 'singleton' | 'transient' | 'scoped' | 'request'
|
|
68
|
-
tags?: string[]
|
|
69
|
-
}
|
|
70
|
-
export declare interface InjectMetadata {
|
|
71
|
-
token: string | symbol | Function
|
|
72
|
-
optional?: boolean
|
|
73
|
-
tags?: string[]
|
|
74
|
-
when?: (context: ResolutionContext) => boolean
|
|
75
|
-
}
|
|
76
|
-
export declare interface ControllerMetadata {
|
|
77
|
-
prefix?: string
|
|
78
|
-
middleware?: Function[]
|
|
79
|
-
tags?: string[]
|
|
80
|
-
}
|
|
81
|
-
export declare interface RouteMetadata {
|
|
82
|
-
method: string
|
|
83
|
-
path: string
|
|
84
|
-
middleware?: Function[]
|
|
85
|
-
tags?: string[]
|
|
86
|
-
}
|
|
87
|
-
export declare interface ParamMetadata {
|
|
88
|
-
type: 'param' | 'query' | 'body' | 'header' | 'cookie'
|
|
89
|
-
key?: string
|
|
90
|
-
token?: string | symbol | Function
|
|
91
|
-
optional?: boolean
|
|
92
|
-
transform?: (value: any) => any
|
|
93
|
-
validate?: (value: any) => boolean
|
|
94
|
-
}
|
|
95
|
-
/**
|
|
96
|
-
* Metadata reader utility class
|
|
97
|
-
*/
|
|
98
|
-
export declare class MetadataReader {
|
|
99
|
-
static getInjectableMetadata(target: Function): InjectableMetadata | undefined;
|
|
100
|
-
static getInjectMetadata(target: Function): InjectMetadata[];
|
|
101
|
-
static getOptionalMetadata(target: Function): boolean[];
|
|
102
|
-
static getTaggedMetadata(target: Function): string[];
|
|
103
|
-
static getControllerMetadata(target: Function): ControllerMetadata | undefined;
|
|
104
|
-
static getAllRoutes(target: Function): any[];
|
|
105
|
-
static getMiddlewareMetadata(target: Function, propertyKey?: string | symbol): Function[];
|
|
106
|
-
static getParamMetadata(target: Function, propertyKey: string | symbol): ParamMetadata[];
|
|
107
|
-
}
|
|
108
|
-
/**
|
|
109
|
-
* Modern Decorator Container
|
|
110
|
-
*/
|
|
111
|
-
export declare class DecoratorContainer extends Container {
|
|
112
|
-
registerController(controllerClass: Function): void;
|
|
113
|
-
resolve<T>(token: string | symbol | Function, context?: ResolutionContext): T;
|
|
114
|
-
}
|
|
@@ -1,221 +0,0 @@
|
|
|
1
|
-
import type { BindingBuilder, Container, ResolutionContext } from './container';
|
|
2
|
-
// Service provider interfaces
|
|
3
|
-
export declare interface ServiceProvider {
|
|
4
|
-
register: (container: Container) => void | Promise<void>
|
|
5
|
-
boot?: (container: Container) => void | Promise<void>
|
|
6
|
-
shutdown?: (container: Container) => void | Promise<void>
|
|
7
|
-
name: string
|
|
8
|
-
version?: string
|
|
9
|
-
dependencies?: readonly string[]
|
|
10
|
-
environment?: string[]
|
|
11
|
-
priority?: number
|
|
12
|
-
}
|
|
13
|
-
export declare interface DeferredServiceProvider extends ServiceProvider {
|
|
14
|
-
provides: () => (string | symbol | Function)[]
|
|
15
|
-
isDeferred: () => boolean
|
|
16
|
-
}
|
|
17
|
-
export declare interface ConditionalServiceProvider extends ServiceProvider {
|
|
18
|
-
shouldLoad: (container: Container) => boolean | Promise<boolean>
|
|
19
|
-
}
|
|
20
|
-
// Service provider manager
|
|
21
|
-
export declare interface ServiceProviderManager {
|
|
22
|
-
register: (provider: ServiceProvider) => this
|
|
23
|
-
boot: () => Promise<void>
|
|
24
|
-
shutdown: () => Promise<void>
|
|
25
|
-
getProvider: (name: string) => ServiceProvider | undefined
|
|
26
|
-
getProviders: () => ServiceProvider[]
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Base service provider implementation
|
|
30
|
-
*/
|
|
31
|
-
export declare abstract class BaseServiceProvider implements ServiceProvider {
|
|
32
|
-
abstract readonly name: string;
|
|
33
|
-
readonly version?: string;
|
|
34
|
-
readonly dependencies?: readonly string[];
|
|
35
|
-
readonly environment?: string[];
|
|
36
|
-
readonly priority: number;
|
|
37
|
-
abstract register(container: Container): void | Promise<void>;
|
|
38
|
-
boot(_container: Container): void | Promise<void>;
|
|
39
|
-
shutdown(_container: Container): void | Promise<void>;
|
|
40
|
-
protected singleton<T>(container: Container, token: string | symbol | Function, implementation: new (...args: any[]) => T): void;
|
|
41
|
-
protected transient<T>(container: Container, token: string | symbol | Function, implementation: new (...args: any[]) => T): void;
|
|
42
|
-
protected value<T>(container: Container, token: string | symbol | Function, value: T): void;
|
|
43
|
-
protected factory<T>(container: Container, token: string | symbol | Function, factory: (...args: any[]) => T): void;
|
|
44
|
-
protected when(container: Container, condition: (context: ResolutionContext) => boolean): { bind: <T>(token: string | symbol | Function) => BindingBuilder<T> };
|
|
45
|
-
protected forEnvironment(container: Container, environments: string[]): { bind: <T>(token: string | symbol | Function) => BindingBuilder<T> };
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* Deferred service provider base class
|
|
49
|
-
*/
|
|
50
|
-
export declare abstract class BaseDeferredServiceProvider extends BaseServiceProvider implements DeferredServiceProvider {
|
|
51
|
-
abstract provides(): (string | symbol | Function)[];
|
|
52
|
-
isDeferred(): boolean;
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* Service provider manager implementation
|
|
56
|
-
*/
|
|
57
|
-
export declare class DefaultServiceProviderManager implements ServiceProviderManager {
|
|
58
|
-
private providers: any;
|
|
59
|
-
private deferredProviders: any;
|
|
60
|
-
private loadedProviders: any;
|
|
61
|
-
private bootedProviders: any;
|
|
62
|
-
private container: Container;
|
|
63
|
-
constructor(container: Container);
|
|
64
|
-
register(provider: ServiceProvider): this;
|
|
65
|
-
boot(): Promise<void>;
|
|
66
|
-
shutdown(): Promise<void>;
|
|
67
|
-
getProvider(name: string): ServiceProvider | undefined;
|
|
68
|
-
getProviders(): ServiceProvider[];
|
|
69
|
-
loadDeferredProvider(token: string | symbol | Function): Promise<void>;
|
|
70
|
-
private doRegister(provider: ServiceProvider): void;
|
|
71
|
-
private loadProvider(provider: ServiceProvider): Promise<void>;
|
|
72
|
-
private bootProvider(provider: ServiceProvider): Promise<void>;
|
|
73
|
-
private validateDependencies(providers: ServiceProvider[]): void;
|
|
74
|
-
private isDeferredProvider(provider: ServiceProvider): provider is DeferredServiceProvider;
|
|
75
|
-
private isConditionalProvider(provider: ServiceProvider): provider is ConditionalServiceProvider;
|
|
76
|
-
}
|
|
77
|
-
/**
|
|
78
|
-
* Common service providers
|
|
79
|
-
*/
|
|
80
|
-
/**
|
|
81
|
-
* Configuration service provider
|
|
82
|
-
*/
|
|
83
|
-
export declare class ConfigServiceProvider extends BaseServiceProvider {
|
|
84
|
-
readonly name: any;
|
|
85
|
-
readonly priority: any;
|
|
86
|
-
register(container: Container): void;
|
|
87
|
-
}
|
|
88
|
-
/**
|
|
89
|
-
* Logging service provider
|
|
90
|
-
*/
|
|
91
|
-
export declare class LoggingServiceProvider extends BaseServiceProvider {
|
|
92
|
-
readonly name: any;
|
|
93
|
-
readonly priority: any;
|
|
94
|
-
register(container: Container): void;
|
|
95
|
-
}
|
|
96
|
-
/**
|
|
97
|
-
* Database service provider
|
|
98
|
-
*/
|
|
99
|
-
export declare class DatabaseServiceProvider extends BaseServiceProvider {
|
|
100
|
-
readonly name: any;
|
|
101
|
-
readonly dependencies: any;
|
|
102
|
-
register(container: Container): void;
|
|
103
|
-
boot(container: Container): Promise<void>;
|
|
104
|
-
shutdown(container: Container): Promise<void>;
|
|
105
|
-
}
|
|
106
|
-
/**
|
|
107
|
-
* Cache service provider
|
|
108
|
-
*/
|
|
109
|
-
export declare class CacheServiceProvider extends BaseServiceProvider {
|
|
110
|
-
readonly name: any;
|
|
111
|
-
readonly dependencies: any;
|
|
112
|
-
register(container: Container): void;
|
|
113
|
-
}
|
|
114
|
-
/**
|
|
115
|
-
* Authentication service provider
|
|
116
|
-
*/
|
|
117
|
-
export declare class AuthServiceProvider extends BaseServiceProvider {
|
|
118
|
-
readonly name: any;
|
|
119
|
-
readonly dependencies: any;
|
|
120
|
-
register(container: Container): void;
|
|
121
|
-
}
|
|
122
|
-
/**
|
|
123
|
-
* Validation service provider
|
|
124
|
-
*/
|
|
125
|
-
export declare class ValidationServiceProvider extends BaseServiceProvider {
|
|
126
|
-
readonly name: any;
|
|
127
|
-
register(container: Container): void;
|
|
128
|
-
}
|
|
129
|
-
/**
|
|
130
|
-
* Event service provider (deferred)
|
|
131
|
-
*/
|
|
132
|
-
export declare class EventServiceProvider extends BaseDeferredServiceProvider {
|
|
133
|
-
readonly name: any;
|
|
134
|
-
provides(): (string | symbol | Function)[];
|
|
135
|
-
register(container: Container): void;
|
|
136
|
-
}
|
|
137
|
-
// Mock service classes for demonstration
|
|
138
|
-
declare class ConfigService {
|
|
139
|
-
get(key: string, defaultValue?: any): any;
|
|
140
|
-
}
|
|
141
|
-
declare class Logger {
|
|
142
|
-
private config: any;
|
|
143
|
-
constructor(config: any);
|
|
144
|
-
log(message: string): void;
|
|
145
|
-
}
|
|
146
|
-
declare class ConsoleLogger extends Logger {
|
|
147
|
-
constructor();
|
|
148
|
-
}
|
|
149
|
-
declare class FileLogger extends Logger {
|
|
150
|
-
private filePath: string;
|
|
151
|
-
constructor(filePath: string);
|
|
152
|
-
}
|
|
153
|
-
declare class DatabaseConnection {
|
|
154
|
-
connect(): Promise<void>;
|
|
155
|
-
disconnect(): Promise<void>;
|
|
156
|
-
}
|
|
157
|
-
declare class UserRepository {
|
|
158
|
-
private db: DatabaseConnection;
|
|
159
|
-
constructor(db: DatabaseConnection);
|
|
160
|
-
}
|
|
161
|
-
declare class PostRepository {
|
|
162
|
-
private db: DatabaseConnection;
|
|
163
|
-
constructor(db: DatabaseConnection);
|
|
164
|
-
}
|
|
165
|
-
declare class CacheManager {
|
|
166
|
-
private store: any;
|
|
167
|
-
constructor(store: any);
|
|
168
|
-
}
|
|
169
|
-
declare class MemoryCache {
|
|
170
|
-
private cache: any;
|
|
171
|
-
}
|
|
172
|
-
declare class RedisCache {
|
|
173
|
-
private config: any;
|
|
174
|
-
constructor(config: any);
|
|
175
|
-
}
|
|
176
|
-
declare class AuthService {
|
|
177
|
-
private jwt: JwtService;
|
|
178
|
-
private userRepo: UserRepository;
|
|
179
|
-
constructor(jwt: JwtService, userRepo: UserRepository);
|
|
180
|
-
}
|
|
181
|
-
declare class JwtService {
|
|
182
|
-
private config: ConfigService;
|
|
183
|
-
constructor(config: ConfigService);
|
|
184
|
-
}
|
|
185
|
-
declare class AuthGuard {
|
|
186
|
-
private auth: AuthService;
|
|
187
|
-
constructor(auth: AuthService);
|
|
188
|
-
}
|
|
189
|
-
declare class Validator {
|
|
190
|
-
validate(_data: any, _rules: any): boolean;
|
|
191
|
-
}
|
|
192
|
-
declare class ValidationPipe {
|
|
193
|
-
private validator: Validator;
|
|
194
|
-
constructor(validator: Validator);
|
|
195
|
-
}
|
|
196
|
-
declare class EventBus {
|
|
197
|
-
emit(_event: string, _data: any): void;
|
|
198
|
-
}
|
|
199
|
-
declare class EventDispatcher {
|
|
200
|
-
private bus: EventBus;
|
|
201
|
-
constructor(bus: EventBus);
|
|
202
|
-
}
|
|
203
|
-
export {
|
|
204
|
-
AuthGuard,
|
|
205
|
-
AuthService,
|
|
206
|
-
CacheManager,
|
|
207
|
-
ConfigService,
|
|
208
|
-
ConsoleLogger,
|
|
209
|
-
DatabaseConnection,
|
|
210
|
-
EventBus,
|
|
211
|
-
EventDispatcher,
|
|
212
|
-
FileLogger,
|
|
213
|
-
JwtService,
|
|
214
|
-
Logger,
|
|
215
|
-
MemoryCache,
|
|
216
|
-
PostRepository,
|
|
217
|
-
RedisCache,
|
|
218
|
-
UserRepository,
|
|
219
|
-
ValidationPipe,
|
|
220
|
-
Validator,
|
|
221
|
-
};
|
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Hot reload middleware for preserving server state
|
|
3
|
-
*/
|
|
4
|
-
export declare function createHotReloadMiddleware(hotReload: HotReloadManager): void;
|
|
5
|
-
/**
|
|
6
|
-
* Initialize global hot reload
|
|
7
|
-
*/
|
|
8
|
-
export declare function initializeHotReload(config?: HotReloadConfig): HotReloadManager;
|
|
9
|
-
/**
|
|
10
|
-
* Get global hot reload instance
|
|
11
|
-
*/
|
|
12
|
-
export declare function getHotReload(): HotReloadManager | null;
|
|
13
|
-
/**
|
|
14
|
-
* Hot reload utilities
|
|
15
|
-
*/
|
|
16
|
-
export declare const HotReloadUtils: {
|
|
17
|
-
/**
|
|
18
|
-
* Check if running in hot reload mode
|
|
19
|
-
*/
|
|
20
|
-
isHotReloadEnabled: () => any;
|
|
21
|
-
/**
|
|
22
|
-
* Get current reload count
|
|
23
|
-
*/
|
|
24
|
-
getReloadCount: () => any;
|
|
25
|
-
/**
|
|
26
|
-
* Create hot-reloadable module cache
|
|
27
|
-
*/
|
|
28
|
-
createModuleCache: <T>() => unknown;
|
|
29
|
-
/**
|
|
30
|
-
* Create hot-reloadable configuration
|
|
31
|
-
*/
|
|
32
|
-
createHotConfig: <T>(initialConfig: T, configPath?: string) => { get: ()
|
|
33
|
-
};
|
|
34
|
-
/**
|
|
35
|
-
* Hot reload helpers for common patterns
|
|
36
|
-
*/
|
|
37
|
-
export declare const HotReloadHelpers: {
|
|
38
|
-
/**
|
|
39
|
-
* Create hot-reloadable route handlers
|
|
40
|
-
*/
|
|
41
|
-
createHotHandler: (handlerPath: string) => unknown;
|
|
42
|
-
/**
|
|
43
|
-
* Create hot-reloadable middleware
|
|
44
|
-
*/
|
|
45
|
-
createHotMiddleware: (middlewarePath: string) => unknown;
|
|
46
|
-
/**
|
|
47
|
-
* Create development server with hot reload
|
|
48
|
-
*/
|
|
49
|
-
createDevelopmentServer: (config: { port?: number hostname?: string hotReload?: HotReloadConfig onReload?: () => void } = {}) => unknown
|
|
50
|
-
};
|
|
51
|
-
/**
|
|
52
|
-
* Hot reload decorators for classes and methods
|
|
53
|
-
*/
|
|
54
|
-
export declare const HotReloadDecorators: {
|
|
55
|
-
/**
|
|
56
|
-
* Class decorator for hot-reloadable classes
|
|
57
|
-
*/
|
|
58
|
-
hotReloadable: () => unknown;
|
|
59
|
-
/**
|
|
60
|
-
* Method decorator for hot-reloadable methods
|
|
61
|
-
*/
|
|
62
|
-
hotMethod: (target: any, propertyKey: string, descriptor: PropertyDescriptor) => any
|
|
63
|
-
};
|
|
64
|
-
/**
|
|
65
|
-
* Hot reload factory functions
|
|
66
|
-
*/
|
|
67
|
-
export declare const HotReloadFactory: {
|
|
68
|
-
/**
|
|
69
|
-
* Create development hot reload
|
|
70
|
-
*/
|
|
71
|
-
createDevelopment: () => any;
|
|
72
|
-
/**
|
|
73
|
-
* Create production hot reload (disabled)
|
|
74
|
-
*/
|
|
75
|
-
createProduction: () => any;
|
|
76
|
-
/**
|
|
77
|
-
* Create testing hot reload
|
|
78
|
-
*/
|
|
79
|
-
createTesting: () => any
|
|
80
|
-
};
|
|
81
|
-
export declare interface HotReloadConfig {
|
|
82
|
-
enabled?: boolean
|
|
83
|
-
watchPaths?: string[]
|
|
84
|
-
ignorePaths?: string[]
|
|
85
|
-
extensions?: string[]
|
|
86
|
-
debounceMs?: number
|
|
87
|
-
preserveState?: boolean
|
|
88
|
-
onReload?: (changedFiles: string[]) => void
|
|
89
|
-
onError?: (error: Error) => void
|
|
90
|
-
verbose?: boolean
|
|
91
|
-
}
|
|
92
|
-
export declare interface HotReloadState {
|
|
93
|
-
reloadCount: number
|
|
94
|
-
lastReload: number
|
|
95
|
-
changedFiles: string[]
|
|
96
|
-
preservedState: Record<string, any>
|
|
97
|
-
watchers: Map<string, any>
|
|
98
|
-
}
|
|
99
|
-
/**
|
|
100
|
-
* Hot reload manager for development
|
|
101
|
-
*/
|
|
102
|
-
export declare class HotReloadManager {
|
|
103
|
-
private config: Required<HotReloadConfig>;
|
|
104
|
-
private state: HotReloadState;
|
|
105
|
-
private debounceTimer?: Timer;
|
|
106
|
-
private isReloading: any;
|
|
107
|
-
constructor(config?: HotReloadConfig);
|
|
108
|
-
private initializeState(): void;
|
|
109
|
-
private setupWatchers(): void;
|
|
110
|
-
private handleFileChange(eventType: string, filePath: string): void;
|
|
111
|
-
private shouldIgnoreFile(filePath: string): boolean;
|
|
112
|
-
private shouldWatchFile(filePath: string): boolean;
|
|
113
|
-
private triggerReload(): void;
|
|
114
|
-
preserveState<T>(key: string, value: T): void;
|
|
115
|
-
restoreState<T>(key: string, defaultValue?: T): T | undefined;
|
|
116
|
-
clearState(key?: string): void;
|
|
117
|
-
getStats(): {
|
|
118
|
-
reloadCount: number
|
|
119
|
-
lastReload: number
|
|
120
|
-
uptime: number
|
|
121
|
-
watchedPaths: string[]
|
|
122
|
-
preservedKeys: string[]
|
|
123
|
-
};
|
|
124
|
-
stop(): void;
|
|
125
|
-
}
|
|
126
|
-
declare namespace global {
|
|
127
|
-
var __HOT_RELOAD_STATE__: HotReloadState | undefined;
|
|
128
|
-
var __HOT_RELOAD_PRESERVE__: Record<string, any>;
|
|
129
|
-
}
|
|
@@ -1,144 +0,0 @@
|
|
|
1
|
-
import { PerformanceProfiler, PerformanceProfilingHelpers } from './performance-profiler';
|
|
2
|
-
import { RouteDebugger, RouteDebugHelpers } from './route-debugger';
|
|
3
|
-
import { RouteInspectionHelpers, RouteInspector } from './route-inspector';
|
|
4
|
-
import { TypeScriptHelpers, TypeScriptUtilities } from './typescript-utilities';
|
|
5
|
-
import type { EnhancedRequest } from '../types';
|
|
6
|
-
export type {
|
|
7
|
-
ProfileConfig as ProfilerConfig,
|
|
8
|
-
PerformanceMetrics as ProfilerMetrics,
|
|
9
|
-
RouteProfile as ProfilerRouteProfile,
|
|
10
|
-
} from './performance-profiler';
|
|
11
|
-
export type {
|
|
12
|
-
RouteDebugConfig,
|
|
13
|
-
RouteDebugInfo,
|
|
14
|
-
} from './route-debugger';
|
|
15
|
-
export type {
|
|
16
|
-
RouteAnalysis as InspectorRouteAnalysis,
|
|
17
|
-
RouteMetadata as InspectorRouteMetadata,
|
|
18
|
-
RouteGroup,
|
|
19
|
-
} from './route-inspector';
|
|
20
|
-
export type {
|
|
21
|
-
TypeScriptConfig as TSConfig,
|
|
22
|
-
RouteTypeInfo as TSRouteTypeInfo,
|
|
23
|
-
TypeDefinition as TSTypeDefinition,
|
|
24
|
-
ValidationSchema as TSValidationSchema,
|
|
25
|
-
} from './typescript-utilities';
|
|
26
|
-
/**
|
|
27
|
-
* Development presets for common configurations
|
|
28
|
-
*/
|
|
29
|
-
export declare const DevelopmentPresets: {
|
|
30
|
-
/**
|
|
31
|
-
* Full development mode with all features enabled
|
|
32
|
-
*/
|
|
33
|
-
development: () => any;
|
|
34
|
-
/**
|
|
35
|
-
* Production debugging with minimal overhead
|
|
36
|
-
*/
|
|
37
|
-
production: () => any;
|
|
38
|
-
/**
|
|
39
|
-
* Performance testing configuration
|
|
40
|
-
*/
|
|
41
|
-
performance: () => any;
|
|
42
|
-
/**
|
|
43
|
-
* TypeScript development configuration
|
|
44
|
-
*/
|
|
45
|
-
typescript: () => any
|
|
46
|
-
};
|
|
47
|
-
export declare interface DevelopmentConfig {
|
|
48
|
-
debug?: {
|
|
49
|
-
enabled?: boolean
|
|
50
|
-
logLevel?: 'debug' | 'info' | 'warn' | 'error'
|
|
51
|
-
includeHeaders?: boolean
|
|
52
|
-
includeBody?: boolean
|
|
53
|
-
colorOutput?: boolean
|
|
54
|
-
}
|
|
55
|
-
profiling?: {
|
|
56
|
-
enabled?: boolean
|
|
57
|
-
sampleRate?: number
|
|
58
|
-
includeMemory?: boolean
|
|
59
|
-
includeCpu?: boolean
|
|
60
|
-
}
|
|
61
|
-
inspection?: {
|
|
62
|
-
enabled?: boolean
|
|
63
|
-
trackStats?: boolean
|
|
64
|
-
generateReports?: boolean
|
|
65
|
-
}
|
|
66
|
-
typescript?: {
|
|
67
|
-
generateTypes?: boolean
|
|
68
|
-
validateTypes?: boolean
|
|
69
|
-
generateSchemas?: boolean
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
/**
|
|
73
|
-
* Development tools manager
|
|
74
|
-
*/
|
|
75
|
-
export declare class DevelopmentTools {
|
|
76
|
-
private debugger: RouteDebugger;
|
|
77
|
-
private inspector: RouteInspector;
|
|
78
|
-
private profiler: PerformanceProfiler;
|
|
79
|
-
private tsUtils: TypeScriptUtilities;
|
|
80
|
-
private config: DevelopmentConfig;
|
|
81
|
-
constructor(config?: DevelopmentConfig);
|
|
82
|
-
createMiddleware(): Array<(req: EnhancedRequest, next: () => Promise<Response>) => Promise<Response>>;
|
|
83
|
-
registerRoute(method: string, pattern: string, handler: (...args: any[]) => any, middleware?: ((...args: any[]) => any)[], options?: any): string;
|
|
84
|
-
debug(): {
|
|
85
|
-
listRoutes: typeof RouteInspectionHelpers.listRoutes
|
|
86
|
-
analyzeRoutes: typeof RouteInspectionHelpers.analyzeRoutes
|
|
87
|
-
exportRoutes: typeof RouteInspectionHelpers.exportRoutes
|
|
88
|
-
getDebugSession: (requestId: string) => import('./route-debugger').RouteDebugInfo | undefined
|
|
89
|
-
clearSessions: () => void
|
|
90
|
-
};
|
|
91
|
-
routes(): {
|
|
92
|
-
list: (filter?: any) => import('./route-inspector').RouteMetadata[]
|
|
93
|
-
analyze: () => import('./route-inspector').RouteAnalysis
|
|
94
|
-
export: (format?: 'json' | 'csv' | 'markdown' | 'openapi') => string
|
|
95
|
-
groups: () => import('./route-inspector').RouteGroup[]
|
|
96
|
-
find: (method: string, path: string) => import('./route-inspector').RouteMetadata[]
|
|
97
|
-
};
|
|
98
|
-
profile(): {
|
|
99
|
-
getMetrics: () => import('./performance-profiler').PerformanceMetrics
|
|
100
|
-
getProfiles: (filter?: any) => import('./performance-profiler').RouteProfile[]
|
|
101
|
-
generateReport: () => string
|
|
102
|
-
clear: () => void
|
|
103
|
-
};
|
|
104
|
-
typescript(): {
|
|
105
|
-
generateTypes: () => string
|
|
106
|
-
generateSchemas: () => Record<string, import('./typescript-utilities').ValidationSchema>
|
|
107
|
-
generateOpenAPI: () => any
|
|
108
|
-
generateRouteBuilder: () => string
|
|
109
|
-
validateRequest: (req: EnhancedRequest, routeKey: string) => { valid: boolean, errors: string[], warnings: string[] }
|
|
110
|
-
};
|
|
111
|
-
generateReport(): string;
|
|
112
|
-
clear(): void;
|
|
113
|
-
private createInspectionMiddleware(): void;
|
|
114
|
-
}
|
|
115
|
-
/**
|
|
116
|
-
* Router extension for development tools
|
|
117
|
-
*/
|
|
118
|
-
export declare class DevelopmentRouter {
|
|
119
|
-
private devTools: DevelopmentTools;
|
|
120
|
-
private routes: any;
|
|
121
|
-
constructor(config?: DevelopmentConfig);
|
|
122
|
-
debug(): {
|
|
123
|
-
get: (pattern: string, handler: (...args: any[]) => any) => any
|
|
124
|
-
post: (pattern: string, handler: (...args: any[]) => any) => any
|
|
125
|
-
put: (pattern: string, handler: (...args: any[]) => any) => any
|
|
126
|
-
patch: (pattern: string, handler: (...args: any[]) => any) => any
|
|
127
|
-
delete: (pattern: string, handler: (...args: any[]) => any) => any
|
|
128
|
-
};
|
|
129
|
-
profile(): {
|
|
130
|
-
group: (callback: () => void) => void
|
|
131
|
-
};
|
|
132
|
-
getRoutes(): import('./route-inspector').RouteMetadata[];
|
|
133
|
-
private registerRoute(method: string, pattern: string, handler: (...args: any[]) => any, options?: any): void;
|
|
134
|
-
}
|
|
135
|
-
export {
|
|
136
|
-
PerformanceProfiler,
|
|
137
|
-
PerformanceProfilingHelpers,
|
|
138
|
-
RouteDebugger,
|
|
139
|
-
RouteDebugHelpers,
|
|
140
|
-
RouteInspectionHelpers,
|
|
141
|
-
RouteInspector,
|
|
142
|
-
TypeScriptHelpers,
|
|
143
|
-
TypeScriptUtilities,
|
|
144
|
-
};
|