@morojs/moro 1.8.11 → 1.8.12

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/moro.d.ts CHANGED
@@ -3,7 +3,7 @@ import { HttpRequest, HttpResponse } from './core/http/index.js';
3
3
  import { ModuleConfig } from './types/module.js';
4
4
  import { MoroOptions } from './types/core.js';
5
5
  import { MoroEventBus } from './core/events/index.js';
6
- import { RouteSchema } from './core/routing/index.js';
6
+ import { RouteSchema, StaticBody } from './core/routing/index.js';
7
7
  import { RouteBuilder as UnifiedRouteBuilder } from './core/routing/unified-router.js';
8
8
  import { DocsConfig } from './core/docs/index.js';
9
9
  import { EventEmitter } from 'events';
@@ -30,21 +30,21 @@ export declare class RouteGroup {
30
30
  constructor(prefix: string, app: Moro);
31
31
  private prefixPath;
32
32
  get(path: string): UnifiedRouteBuilder;
33
- get(path: string, handler: (req: HttpRequest, res: HttpResponse) => any, options?: any): this;
33
+ get(path: string, handler: ((req: HttpRequest, res: HttpResponse) => any) | StaticBody, options?: any): this;
34
34
  post(path: string): UnifiedRouteBuilder;
35
- post(path: string, handler: (req: HttpRequest, res: HttpResponse) => any, options?: any): this;
35
+ post(path: string, handler: ((req: HttpRequest, res: HttpResponse) => any) | StaticBody, options?: any): this;
36
36
  put(path: string): UnifiedRouteBuilder;
37
- put(path: string, handler: (req: HttpRequest, res: HttpResponse) => any, options?: any): this;
37
+ put(path: string, handler: ((req: HttpRequest, res: HttpResponse) => any) | StaticBody, options?: any): this;
38
38
  delete(path: string): UnifiedRouteBuilder;
39
- delete(path: string, handler: (req: HttpRequest, res: HttpResponse) => any, options?: any): this;
39
+ delete(path: string, handler: ((req: HttpRequest, res: HttpResponse) => any) | StaticBody, options?: any): this;
40
40
  patch(path: string): UnifiedRouteBuilder;
41
- patch(path: string, handler: (req: HttpRequest, res: HttpResponse) => any, options?: any): this;
41
+ patch(path: string, handler: ((req: HttpRequest, res: HttpResponse) => any) | StaticBody, options?: any): this;
42
42
  head(path: string): UnifiedRouteBuilder;
43
- head(path: string, handler: (req: HttpRequest, res: HttpResponse) => any, options?: any): this;
43
+ head(path: string, handler: ((req: HttpRequest, res: HttpResponse) => any) | StaticBody, options?: any): this;
44
44
  options(path: string): UnifiedRouteBuilder;
45
- options(path: string, handler: (req: HttpRequest, res: HttpResponse) => any, options?: any): this;
45
+ options(path: string, handler: ((req: HttpRequest, res: HttpResponse) => any) | StaticBody, options?: any): this;
46
46
  /** Register a handler for all HTTP methods on the given path (Express-compatible). */
47
- all(path: string, handler: (req: HttpRequest, res: HttpResponse) => any, options?: any): this;
47
+ all(path: string, handler: ((req: HttpRequest, res: HttpResponse) => any) | StaticBody, options?: any): this;
48
48
  group(prefix: string, callback: (group: RouteGroup) => void): this;
49
49
  }
50
50
  export declare class Moro extends EventEmitter {
@@ -112,25 +112,25 @@ export declare class Moro extends EventEmitter {
112
112
  */
113
113
  private getDefaultOptionsFromConfig;
114
114
  get(path: string): UnifiedRouteBuilder;
115
- get(path: string, handler: (req: HttpRequest, res: HttpResponse) => any, options?: any): this;
115
+ get(path: string, handler: ((req: HttpRequest, res: HttpResponse) => any) | StaticBody, options?: any): this;
116
116
  post(path: string): UnifiedRouteBuilder;
117
- post(path: string, handler: (req: HttpRequest, res: HttpResponse) => any, options?: any): this;
117
+ post(path: string, handler: ((req: HttpRequest, res: HttpResponse) => any) | StaticBody, options?: any): this;
118
118
  put(path: string): UnifiedRouteBuilder;
119
- put(path: string, handler: (req: HttpRequest, res: HttpResponse) => any, options?: any): this;
119
+ put(path: string, handler: ((req: HttpRequest, res: HttpResponse) => any) | StaticBody, options?: any): this;
120
120
  delete(path: string): UnifiedRouteBuilder;
121
- delete(path: string, handler: (req: HttpRequest, res: HttpResponse) => any, options?: any): this;
121
+ delete(path: string, handler: ((req: HttpRequest, res: HttpResponse) => any) | StaticBody, options?: any): this;
122
122
  patch(path: string): UnifiedRouteBuilder;
123
- patch(path: string, handler: (req: HttpRequest, res: HttpResponse) => any, options?: any): this;
123
+ patch(path: string, handler: ((req: HttpRequest, res: HttpResponse) => any) | StaticBody, options?: any): this;
124
124
  head(path: string): UnifiedRouteBuilder;
125
- head(path: string, handler: (req: HttpRequest, res: HttpResponse) => any, options?: any): this;
125
+ head(path: string, handler: ((req: HttpRequest, res: HttpResponse) => any) | StaticBody, options?: any): this;
126
126
  options(path: string): UnifiedRouteBuilder;
127
- options(path: string, handler: (req: HttpRequest, res: HttpResponse) => any, options?: any): this;
127
+ options(path: string, handler: ((req: HttpRequest, res: HttpResponse) => any) | StaticBody, options?: any): this;
128
128
  /**
129
129
  * Register a handler for all HTTP methods on the given path (Express-compatible).
130
130
  * Handler is required — unlike the single-method registrations, there's no builder
131
131
  * form since `all()` fans out across methods.
132
132
  */
133
- all(path: string, handler: (req: HttpRequest, res: HttpResponse) => any, options?: any): this;
133
+ all(path: string, handler: ((req: HttpRequest, res: HttpResponse) => any) | StaticBody, options?: any): this;
134
134
  route(schema: RouteSchema): void;
135
135
  group(prefix: string, callback: (group: RouteGroup) => void): this;
136
136
  /**