@bool-ts/core 1.6.11 → 1.6.13

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.
@@ -1,4 +1,4 @@
1
- export { Body, Context, Param, Params, Query, Request, RequestHeader, RequestHeaders, ResponseHeaders } from "./arguments";
1
+ export { Body, Context, Param, Params, Query, Request, RequestHeader, RequestHeaders, ResponseHeaders, RouteModel } from "./arguments";
2
2
  export { Controller } from "./controller";
3
3
  export { Dispatcher } from "./dispatcher";
4
4
  export { Guard } from "./guard";
@@ -1,4 +1,4 @@
1
- export { Body, Context, Param, Params, Query, Request, RequestHeader, RequestHeaders, ResponseHeaders } from "./arguments";
1
+ export { Body, Context, Param, Params, Query, Request, RequestHeader, RequestHeaders, ResponseHeaders, RouteModel } from "./arguments";
2
2
  export { Controller } from "./controller";
3
3
  export { Dispatcher } from "./dispatcher";
4
4
  export { Guard } from "./guard";
@@ -1,9 +1,9 @@
1
1
  import type { THttpMethods } from "../http";
2
- export type TRouteModel<T = unknown> = Readonly<Required<{
2
+ export type TRouteModel<T = unknown> = Readonly<{
3
3
  class: new (...args: Array<any>) => T;
4
4
  funcName: string | symbol;
5
5
  func: (...args: Array<any>) => unknown;
6
- }>>;
6
+ }>;
7
7
  export declare class Route {
8
8
  static rootPattern: string;
9
9
  readonly alias: string;
@@ -46,41 +46,41 @@ export declare class Route {
46
46
  * @param handlers
47
47
  * @returns
48
48
  */
49
- connect(handler: TRouteModel): this | Map<keyof THttpMethods, Readonly<Required<{
49
+ connect(handler: TRouteModel): this | Map<keyof THttpMethods, Readonly<{
50
50
  class: new (...args: Array<any>) => unknown;
51
51
  funcName: string | symbol;
52
52
  func: (...args: Array<any>) => unknown;
53
- }>>>;
53
+ }>>;
54
54
  /**
55
55
  *
56
56
  * @param handlers
57
57
  * @returns
58
58
  */
59
- options(handler: TRouteModel): this | Map<keyof THttpMethods, Readonly<Required<{
59
+ options(handler: TRouteModel): this | Map<keyof THttpMethods, Readonly<{
60
60
  class: new (...args: Array<any>) => unknown;
61
61
  funcName: string | symbol;
62
62
  func: (...args: Array<any>) => unknown;
63
- }>>>;
63
+ }>>;
64
64
  /**
65
65
  *
66
66
  * @param handlers
67
67
  * @returns
68
68
  */
69
- trace(handler: TRouteModel): this | Map<keyof THttpMethods, Readonly<Required<{
69
+ trace(handler: TRouteModel): this | Map<keyof THttpMethods, Readonly<{
70
70
  class: new (...args: Array<any>) => unknown;
71
71
  funcName: string | symbol;
72
72
  func: (...args: Array<any>) => unknown;
73
- }>>>;
73
+ }>>;
74
74
  /**
75
75
  *
76
76
  * @param handlers
77
77
  * @returns
78
78
  */
79
- patch(handler: TRouteModel): this | Map<keyof THttpMethods, Readonly<Required<{
79
+ patch(handler: TRouteModel): this | Map<keyof THttpMethods, Readonly<{
80
80
  class: new (...args: Array<any>) => unknown;
81
81
  funcName: string | symbol;
82
82
  func: (...args: Array<any>) => unknown;
83
- }>>>;
83
+ }>>;
84
84
  /**
85
85
  *
86
86
  * @param handlers
@@ -320,7 +320,7 @@ export const BoolFactory = async (target, options) => {
320
320
  });
321
321
  }
322
322
  context[paramsArgsKey] = result.parameters;
323
- context[routeModelArgsKey] = result;
323
+ context[routeModelArgsKey] = result.model;
324
324
  let responseBody = undefined;
325
325
  // Execute before dispatcher(s)
326
326
  for (let i = 0; i < beforeDispatcherGroup.length; i++) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bool-ts/core",
3
- "version": "1.6.11",
3
+ "version": "1.6.13",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -1,4 +1,15 @@
1
- export { Body, Context, Param, Params, Query, Request, RequestHeader, RequestHeaders, ResponseHeaders } from "./arguments";
1
+ export {
2
+ Body,
3
+ Context,
4
+ Param,
5
+ Params,
6
+ Query,
7
+ Request,
8
+ RequestHeader,
9
+ RequestHeaders,
10
+ ResponseHeaders,
11
+ RouteModel
12
+ } from "./arguments";
2
13
  export { Controller } from "./controller";
3
14
  export { Dispatcher } from "./dispatcher";
4
15
  export { Guard } from "./guard";
@@ -2,13 +2,11 @@
2
2
 
3
3
  import type { THttpMethods } from "../http";
4
4
 
5
- export type TRouteModel<T = unknown> = Readonly<
6
- Required<{
7
- class: new (...args: Array<any>) => T;
8
- funcName: string | symbol;
9
- func: (...args: Array<any>) => unknown;
10
- }>
11
- >;
5
+ export type TRouteModel<T = unknown> = Readonly<{
6
+ class: new (...args: Array<any>) => T;
7
+ funcName: string | symbol;
8
+ func: (...args: Array<any>) => unknown;
9
+ }>;
12
10
 
13
11
  export class Route {
14
12
  public static rootPattern = ":([a-z0-9A-Z_.-]{1,})";
@@ -475,7 +475,7 @@ export const BoolFactory = async (target: new (...args: any[]) => unknown, optio
475
475
  }
476
476
 
477
477
  context[paramsArgsKey] = result.parameters;
478
- context[routeModelArgsKey] = result;
478
+ context[routeModelArgsKey] = result.model;
479
479
 
480
480
  let responseBody = undefined;
481
481