@deepkit/http 1.0.1-alpha.59 → 1.0.1-alpha.63

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.
Files changed (144) hide show
  1. package/coverage/clover.xml +1086 -0
  2. package/coverage/coverage-final.json +12 -0
  3. package/coverage/lcov-report/base.css +224 -0
  4. package/coverage/lcov-report/block-navigation.js +79 -0
  5. package/coverage/lcov-report/favicon.png +0 -0
  6. package/coverage/lcov-report/index.html +126 -0
  7. package/coverage/lcov-report/prettify.css +1 -0
  8. package/coverage/lcov-report/prettify.js +2 -0
  9. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  10. package/coverage/lcov-report/sorter.js +170 -0
  11. package/coverage/lcov-report/src/controllers.ts.html +113 -0
  12. package/coverage/lcov-report/src/decorator.ts.html +1280 -0
  13. package/coverage/lcov-report/src/filter.ts.html +734 -0
  14. package/coverage/lcov-report/src/http.ts.html +2192 -0
  15. package/coverage/lcov-report/src/index.html +246 -0
  16. package/coverage/lcov-report/src/kernel.ts.html +260 -0
  17. package/coverage/lcov-report/src/middleware.ts.html +428 -0
  18. package/coverage/lcov-report/src/model.ts.html +937 -0
  19. package/coverage/lcov-report/src/module.config.ts.html +89 -0
  20. package/coverage/lcov-report/src/module.ts.html +245 -0
  21. package/coverage/lcov-report/src/router.ts.html +2318 -0
  22. package/coverage/lcov-report/tests/index.html +111 -0
  23. package/coverage/lcov-report/tests/utils.ts.html +176 -0
  24. package/coverage/lcov.info +2225 -0
  25. package/dist/cjs/index.js +5 -1
  26. package/dist/cjs/index.js.map +1 -1
  27. package/dist/cjs/src/controllers.d.ts +4 -4
  28. package/dist/cjs/src/controllers.js +3 -0
  29. package/dist/cjs/src/controllers.js.map +1 -1
  30. package/dist/cjs/src/decorator.d.ts +29 -94
  31. package/dist/cjs/src/decorator.js +53 -118
  32. package/dist/cjs/src/decorator.js.map +1 -1
  33. package/dist/cjs/src/filter.d.ts +1 -0
  34. package/dist/cjs/src/filter.js +11 -17
  35. package/dist/cjs/src/filter.js.map +1 -1
  36. package/dist/cjs/src/http.d.ts +5 -3
  37. package/dist/cjs/src/http.js +91 -55
  38. package/dist/cjs/src/http.js.map +1 -1
  39. package/dist/cjs/src/kernel.d.ts +3 -3
  40. package/dist/cjs/src/kernel.js +5 -25
  41. package/dist/cjs/src/kernel.js.map +1 -1
  42. package/dist/cjs/src/logger.d.ts +2 -2
  43. package/dist/cjs/src/logger.js +4 -8
  44. package/dist/cjs/src/logger.js.map +1 -1
  45. package/dist/cjs/src/middleware.d.ts +5 -1
  46. package/dist/cjs/src/middleware.js +15 -3
  47. package/dist/cjs/src/middleware.js.map +1 -1
  48. package/dist/cjs/src/model.d.ts +62 -2
  49. package/dist/cjs/src/model.js +101 -26
  50. package/dist/cjs/src/model.js.map +1 -1
  51. package/dist/cjs/src/module.config.d.ts +3 -4
  52. package/dist/cjs/src/module.config.js +8 -6
  53. package/dist/cjs/src/module.config.js.map +1 -1
  54. package/dist/cjs/src/module.d.ts +2 -3
  55. package/dist/cjs/src/module.js +4 -2
  56. package/dist/cjs/src/module.js.map +1 -1
  57. package/dist/cjs/src/router.d.ts +24 -53
  58. package/dist/cjs/src/router.js +140 -159
  59. package/dist/cjs/src/router.js.map +1 -1
  60. package/dist/cjs/src/static-serving.d.ts +1 -0
  61. package/dist/cjs/src/static-serving.js +46 -39
  62. package/dist/cjs/src/static-serving.js.map +1 -1
  63. package/dist/cjs/src/utils.js +1 -0
  64. package/dist/cjs/tests/filter.spec.js +61 -47
  65. package/dist/cjs/tests/filter.spec.js.map +1 -1
  66. package/dist/cjs/tests/middleware.spec.d.ts +1 -1
  67. package/dist/cjs/tests/middleware.spec.js +157 -145
  68. package/dist/cjs/tests/middleware.spec.js.map +1 -1
  69. package/dist/cjs/tests/model.spec.js +4 -4
  70. package/dist/cjs/tests/model.spec.js.map +1 -1
  71. package/dist/cjs/tests/module.spec.js +4 -3
  72. package/dist/cjs/tests/module.spec.js.map +1 -1
  73. package/dist/cjs/tests/router.spec.d.ts +1 -1
  74. package/dist/cjs/tests/router.spec.js +298 -333
  75. package/dist/cjs/tests/router.spec.js.map +1 -1
  76. package/dist/cjs/tests/utils.js +5 -2
  77. package/dist/cjs/tests/utils.js.map +1 -1
  78. package/dist/cjs/tsconfig.tsbuildinfo +1 -1
  79. package/dist/esm/src/controllers.d.ts +4 -4
  80. package/dist/esm/src/controllers.js +3 -0
  81. package/dist/esm/src/controllers.js.map +1 -1
  82. package/dist/esm/src/decorator.d.ts +29 -94
  83. package/dist/esm/src/decorator.js +49 -114
  84. package/dist/esm/src/decorator.js.map +1 -1
  85. package/dist/esm/src/filter.d.ts +1 -0
  86. package/dist/esm/src/filter.js +11 -18
  87. package/dist/esm/src/filter.js.map +1 -1
  88. package/dist/esm/src/http.d.ts +5 -3
  89. package/dist/esm/src/http.js +89 -55
  90. package/dist/esm/src/http.js.map +1 -1
  91. package/dist/esm/src/kernel.d.ts +3 -3
  92. package/dist/esm/src/kernel.js +6 -27
  93. package/dist/esm/src/kernel.js.map +1 -1
  94. package/dist/esm/src/logger.d.ts +2 -2
  95. package/dist/esm/src/logger.js +4 -9
  96. package/dist/esm/src/logger.js.map +1 -1
  97. package/dist/esm/src/middleware.d.ts +5 -1
  98. package/dist/esm/src/middleware.js +12 -0
  99. package/dist/esm/src/middleware.js.map +1 -1
  100. package/dist/esm/src/model.d.ts +62 -2
  101. package/dist/esm/src/model.js +92 -24
  102. package/dist/esm/src/model.js.map +1 -1
  103. package/dist/esm/src/module.config.d.ts +3 -4
  104. package/dist/esm/src/module.config.js +6 -5
  105. package/dist/esm/src/module.config.js.map +1 -1
  106. package/dist/esm/src/module.d.ts +2 -3
  107. package/dist/esm/src/module.js +5 -3
  108. package/dist/esm/src/module.js.map +1 -1
  109. package/dist/esm/src/router.d.ts +24 -53
  110. package/dist/esm/src/router.js +136 -155
  111. package/dist/esm/src/router.js.map +1 -1
  112. package/dist/esm/src/static-serving.d.ts +1 -0
  113. package/dist/esm/src/static-serving.js +39 -32
  114. package/dist/esm/src/static-serving.js.map +1 -1
  115. package/dist/esm/src/utils.js +1 -0
  116. package/dist/esm/tests/filter.spec.js +14 -0
  117. package/dist/esm/tests/filter.spec.js.map +1 -1
  118. package/dist/esm/tests/middleware.spec.d.ts +1 -1
  119. package/dist/esm/tests/middleware.spec.js +60 -48
  120. package/dist/esm/tests/middleware.spec.js.map +1 -1
  121. package/dist/esm/tests/module.spec.js +1 -0
  122. package/dist/esm/tests/module.spec.js.map +1 -1
  123. package/dist/esm/tests/router.spec.d.ts +1 -1
  124. package/dist/esm/tests/router.spec.js +167 -202
  125. package/dist/esm/tests/router.spec.js.map +1 -1
  126. package/dist/esm/tests/utils.js +4 -1
  127. package/dist/esm/tests/utils.js.map +1 -1
  128. package/dist/esm/tsconfig.esm.tsbuildinfo +1 -1
  129. package/package.json +14 -15
  130. package/src/controllers.ts +3 -3
  131. package/src/decorator.ts +42 -131
  132. package/src/filter.ts +0 -2
  133. package/src/http.ts +35 -36
  134. package/src/kernel.ts +4 -5
  135. package/src/logger.ts +2 -4
  136. package/src/middleware.ts +2 -1
  137. package/src/model.ts +80 -8
  138. package/src/module.config.ts +3 -6
  139. package/src/module.ts +2 -2
  140. package/src/router.ts +121 -161
  141. package/src/static-serving.ts +14 -12
  142. package/tests/middleware.spec.ts +0 -1
  143. package/tests/router.spec.ts +131 -133
  144. package/tsconfig.json +2 -1
package/dist/cjs/index.js CHANGED
@@ -1,7 +1,11 @@
1
1
  "use strict";
2
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
3
  if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
5
9
  }) : (function(o, m, k, k2) {
6
10
  if (k2 === undefined) k2 = k;
7
11
  o[k2] = m[k];
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,kDAAgC;AAChC,6CAA2B;AAC3B,8CAA4B;AAC5B,+CAA6B;AAC7B,+CAA6B;AAC7B,uDAAqC;AACrC,+CAA6B;AAC7B,+CAA6B;AAC7B,sDAAoC;AACpC,oDAAkC;AAClC,mDAAiC;AACjC,+CAA6B;AAC7B,8CAA4B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kDAAgC;AAChC,6CAA2B;AAC3B,8CAA4B;AAC5B,+CAA6B;AAC7B,+CAA6B;AAC7B,uDAAqC;AACrC,+CAA6B;AAC7B,+CAA6B;AAC7B,sDAAoC;AACpC,oDAAkC;AAClC,mDAAiC;AACjC,+CAA6B;AAC7B,8CAA4B"}
@@ -1,13 +1,13 @@
1
1
  import { ClassType } from '@deepkit/core';
2
- import { AppModule } from '@deepkit/app';
2
+ import { InjectorModule } from '@deepkit/injector';
3
3
  export declare class HttpControllers {
4
4
  readonly controllers: {
5
5
  controller: ClassType;
6
- module: AppModule<any>;
6
+ module: InjectorModule<any>;
7
7
  }[];
8
8
  constructor(controllers?: {
9
9
  controller: ClassType;
10
- module: AppModule<any>;
10
+ module: InjectorModule<any>;
11
11
  }[]);
12
- add(controller: ClassType, module: AppModule<any>): void;
12
+ add(controller: ClassType, module: InjectorModule<any>): void;
13
13
  }
@@ -1,6 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.HttpControllers = void 0;
4
+ var { __ΩClassType } = require('@deepkit/core');
5
+ const injector_1 = require("@deepkit/injector");
4
6
  class HttpControllers {
5
7
  constructor(controllers = []) {
6
8
  this.controllers = controllers;
@@ -10,4 +12,5 @@ class HttpControllers {
10
12
  }
11
13
  }
12
14
  exports.HttpControllers = HttpControllers;
15
+ HttpControllers.__type = [() => __ΩClassType, 'controller', () => injector_1.InjectorModule, 'module', 'controllers', () => [], 'constructor', () => __ΩClassType, () => injector_1.InjectorModule, 'add', 'PPn!4"P"7#4$MF2%:>&"0\'Pn(2"P"7)2$"0*5'];
13
16
  //# sourceMappingURL=controllers.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"controllers.js","sourceRoot":"","sources":["../../../src/controllers.ts"],"names":[],"mappings":";;;AAGA,MAAa,eAAe;IACxB,YAA4B,cAAiE,EAAE;QAAnE,gBAAW,GAAX,WAAW,CAAwD;IAC/F,CAAC;IAEM,GAAG,CAAC,UAAqB,EAAE,MAAsB;QACpD,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,EAAC,UAAU,EAAE,MAAM,EAAC,CAAC,CAAC;IAChD,CAAC;CACJ;AAPD,0CAOC"}
1
+ {"version":3,"file":"controllers.js","sourceRoot":"","sources":["../../../src/controllers.ts"],"names":[],"mappings":";;;+BAA0B,eAAe;AACzC,gDAAmD;AAEnD,MAAa,eAAe;IACxB,YAA4B,cAAsE,EAAE;QAAxE,gBAAW,GAAX,WAAW,CAA6D;IACpG,CAAC;IAEM,GAAG,CAAC,UAAqB,EAAE,MAA2B;QACzD,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,EAAC,UAAU,EAAE,MAAM,EAAC,CAAC,CAAC;IAChD,CAAC;;AANL,0CAOC"}
@@ -1,10 +1,7 @@
1
1
  import { ClassType } from '@deepkit/core';
2
- import { ClassDecoratorResult, ClassSchema, FieldDecoratorResult, JitConverterOptions, PropertyDecoratorResult, PropertySchema, Serializer } from '@deepkit/type';
2
+ import { ClassDecoratorResult, DecoratorAndFetchSignature, DualDecorator, ExtractApiDataType, ExtractClass, PropertyDecoratorFn, ReceiveType, SerializationOptions, Serializer, Type, UnionToIntersection } from '@deepkit/type';
3
3
  import { RouteParameterResolver } from './router';
4
4
  import { HttpMiddleware, HttpMiddlewareConfig, HttpMiddlewareFn } from './middleware';
5
- export interface ControllerOptions {
6
- name: string;
7
- }
8
5
  declare type HttpActionMiddleware = (() => HttpMiddlewareConfig) | ClassType<HttpMiddleware> | HttpMiddlewareFn;
9
6
  declare class HttpController {
10
7
  baseUrl: string;
@@ -38,18 +35,9 @@ export declare class HttpAction {
38
35
  groups: string[];
39
36
  serializer?: Serializer;
40
37
  middlewares: (() => HttpMiddlewareConfig)[];
41
- serializationOptions?: JitConverterOptions;
42
- parameterRegularExpressions: {
43
- [name: string]: any;
44
- };
38
+ serializationOptions?: SerializationOptions;
45
39
  resolverForToken: Map<any, ClassType>;
46
40
  resolverForParameterName: Map<string, ClassType>;
47
- /**
48
- * This is only filled when the user used @http.body() for example on an method argument.
49
- */
50
- parameters: {
51
- [name: string]: HttpActionParameter;
52
- };
53
41
  /**
54
42
  * An arbitrary data container the user can use to store app specific settings/values.
55
43
  */
@@ -57,7 +45,7 @@ export declare class HttpAction {
57
45
  responses: {
58
46
  statusCode: number;
59
47
  description: string;
60
- type?: PropertySchema;
48
+ type?: Type;
61
49
  }[];
62
50
  }
63
51
  export declare class HttpDecorator {
@@ -116,11 +104,10 @@ export declare class HttpDecorator {
116
104
  export declare const httpClass: ClassDecoratorResult<typeof HttpDecorator>;
117
105
  export declare class HttpActionDecorator {
118
106
  t: HttpAction;
119
- onDecorator(target: ClassType, property: string): void;
107
+ onDecorator(target: ClassType, property: string | undefined, parameterIndexOrDescriptor?: any): void;
120
108
  name(name: string): void;
121
- setParameter(name: string, parameter: HttpActionParameter): void;
122
109
  description(description: string): void;
123
- serialization(options: JitConverterOptions): void;
110
+ serialization(options: SerializationOptions): void;
124
111
  serializer(serializer: Serializer): void;
125
112
  middleware(...middlewares: HttpActionMiddleware[]): void;
126
113
  /**
@@ -169,29 +156,28 @@ export declare class HttpActionDecorator {
169
156
  ANY(path?: string): void;
170
157
  /**
171
158
  * Adds additional information about what HTTP status codes are available in this route.
172
- * You can add additionally a description and a class type.
173
- *
174
- * The class type is used for serialization for responses with the given statusCode.
159
+ * You can add additionally a description and a response body type.
175
160
  *
176
- * Those information are available in Deepkit API console.
161
+ * The type is used for serialization for responses with the given statusCode.
177
162
  *
178
- * classType can be a schema, class, or deepkit/type t.
163
+ * This information is available in Deepkit API console.
179
164
  *
180
165
  * ```typescript
181
166
  *
182
- * @http.GET().response(200, 'All ok', t.boolean)
167
+ * @http.GET().response<boolean>(200, 'All ok')
183
168
  *
184
- * class User {
185
- * @t username: string = '';
169
+ * interface User {
170
+ * username: string;
186
171
  * }
187
- * @http.GET().response(200, 'User object', User)
172
+ * @http.GET().response<User>(200, 'User object')
188
173
  *
189
- *
190
- * const error = t.schema({error: t.string});
191
- * @http.GET().response(500, 'Error', error)
174
+ * interface HttpErrorMessage {
175
+ * error: string;
176
+ * }
177
+ * @http.GET().response<HttpErrorMessage>(500, 'Error')
192
178
  * ```
193
179
  */
194
- response(statusCode: number, description?: string, classType?: FieldDecoratorResult<any> | ClassType | ClassSchema): void;
180
+ response<T>(statusCode: number, description?: string, type?: ReceiveType<T>): void;
195
181
  /**
196
182
  * Adds a parameter resolver for parameters based on the class type. Use .resolveParameterByName() for name-based resolving.
197
183
  *
@@ -236,68 +222,17 @@ export declare class HttpActionDecorator {
236
222
  * ```
237
223
  */
238
224
  resolveParameterByName(name: string, resolver: ClassType<RouteParameterResolver>): void;
239
- regexp(parameterName: string, regex: any): void;
240
225
  }
241
- declare class HttpActionParameterDecorator {
242
- t: HttpActionParameter;
243
- onDecorator(target: ClassType, propertyName?: string, parameterIndex?: number): void;
244
- /**
245
- * Marks the argument as body parameter. Data from the client sent in the body
246
- * will be tried to parsed (JSON/form data) and deserialized to the defined type.
247
- * Make sure the class type as a schema assigned.
248
- *
249
- * @example
250
- * ```typescript
251
- * class MyActionBody {
252
- * @t name!: string;
253
- * }
254
- *
255
- * class Controller {
256
- * @http.GET()
257
- * myAction(@http.body() body: MyActionBody) {
258
- * console.log('body', body.name);
259
- * }
260
- * }
261
- * ```
262
- */
263
- body(): void;
264
- query(path?: string): void;
265
- get optional(): void;
266
- /**
267
- * Marks the argument as query parameter. Data from the query string is parsed
268
- * and deserialized to the defined type.
269
- * Define a `path` if you want to parse a subset of the query string only.
270
- *
271
- * Note: Make sure the defined parameter type has optional properties,
272
- * otherwise it's always required to pass a query string.
273
- *
274
- * @example
275
- * ```typescript
276
- * class MyActionQueries {
277
- * @t.optional name?: string;
278
- * }
279
- *
280
- * class Controller {
281
- * @http.GET('my-action')
282
- * myAction(@http.queries() query: MyActionQueries) {
283
- * console.log('query', query.name);
284
- * }
285
- * }
286
- *
287
- * // Open via, e.g.
288
- * // -> /my-action?name=Peter
289
- * ```
290
- *
291
- */
292
- queries(path?: string): void;
293
- }
294
- export declare const httpAction: PropertyDecoratorResult<typeof HttpActionDecorator>;
295
- export declare const httpActionParameter: PropertyDecoratorResult<typeof HttpActionParameterDecorator>;
296
- export declare const http: import("@deepkit/type").Merge<Omit<import("@deepkit/type").FluidDecorator<HttpDecorator, import("@deepkit/type").ClassDecoratorFn> & ((classType: import("@deepkit/core").AbstractClassType<any>) => void) & {
297
- _fetch: (classType: ClassType<any>) => HttpController | undefined;
298
- } & import("@deepkit/type").FluidDecorator<HttpActionDecorator, import("@deepkit/type").PropertyDecoratorFn> & ((prototype: object, property: string, parameterIndexOrDescriptor?: any) => void) & {
299
- _fetch: (classType: ClassType<any>, property: string, parameterIndexOrDescriptor?: any) => HttpAction | undefined;
300
- } & import("@deepkit/type").FluidDecorator<HttpActionParameterDecorator, import("@deepkit/type").PropertyDecoratorFn> & {
301
- _fetch: (classType: ClassType<any>, property: string, parameterIndexOrDescriptor?: any) => HttpActionParameter | undefined;
302
- }, "t" | "_fetch">>;
226
+ declare type HttpActionFluidDecorator<T, D extends Function> = {
227
+ [name in keyof T]: name extends 'response' ? <T2>(statusCode: number, description?: string, type?: ReceiveType<T2>) => D & HttpActionFluidDecorator<T, D> : T[name] extends (...args: infer K) => any ? (...args: K) => D & HttpActionFluidDecorator<T, D> : D & HttpActionFluidDecorator<T, D> & {
228
+ _data: ExtractApiDataType<T>;
229
+ };
230
+ };
231
+ declare type HttpActionPropertyDecoratorResult = HttpActionFluidDecorator<ExtractClass<typeof HttpActionDecorator>, PropertyDecoratorFn> & DecoratorAndFetchSignature<typeof HttpActionDecorator, PropertyDecoratorFn>;
232
+ export declare const httpAction: HttpActionPropertyDecoratorResult;
233
+ declare type HttpMerge<U> = {
234
+ [K in keyof U]: K extends 'response' ? <T2>(statusCode: number, description?: string, type?: ReceiveType<T2>) => PropertyDecoratorFn & U : U[K] extends ((...a: infer A) => infer R) ? R extends DualDecorator ? (...a: A) => PropertyDecoratorFn & R & U : (...a: A) => R : never;
235
+ };
236
+ declare type MergedHttp<T extends any[]> = HttpMerge<Omit<UnionToIntersection<T[number]>, '_fetch' | 't'>>;
237
+ export declare const http: MergedHttp<[typeof httpClass, typeof httpAction]>;
303
238
  export {};
@@ -1,4 +1,21 @@
1
1
  "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.http = exports.httpAction = exports.HttpActionDecorator = exports.httpClass = exports.HttpDecorator = exports.HttpAction = exports.HttpActionParameter = void 0;
4
+ var { __ΩClassType } = require('@deepkit/core');
5
+ var { __ΩSerializationOptions } = require('@deepkit/type');
6
+ var { __ΩRouteParameterResolver } = require('./router');
7
+ var { __ΩReceiveType } = require('@deepkit/type');
8
+ var { __ΩHttpMiddleware } = require('./middleware');
9
+ var { __ΩHttpMiddlewareFn } = require('./middleware');
10
+ var { __ΩExtractApiDataType } = require('@deepkit/type');
11
+ var { __ΩExtractClass } = require('@deepkit/type');
12
+ var { __ΩPropertyDecoratorFn } = require('@deepkit/type');
13
+ var { __ΩDecoratorAndFetchSignature } = require('@deepkit/type');
14
+ var { __ΩDualDecorator } = require('@deepkit/type');
15
+ var { __ΩUnionToIntersection } = require('@deepkit/type');
16
+ var __ΩPick = ['T', 'K', 'l+e#!e"!fRb!b"Pde""N#!'];
17
+ var __ΩExclude = ['T', 'U', 'l6!Re$!RPe#!e$"qk#%QRb!b"Pde"!p)'];
18
+ var __ΩOmit = ['T', 'K', () => __ΩPick, () => __ΩExclude, 'b!b"e!!e!!ge!"o$#o##'];
2
19
  /*
3
20
  * Deepkit Framework
4
21
  * Copyright (C) 2021 Deepkit UG, Marc J. Schmidt
@@ -8,14 +25,14 @@
8
25
  *
9
26
  * You should have received a copy of the MIT License along with this program.
10
27
  */
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.http = exports.httpActionParameter = exports.httpAction = exports.HttpActionDecorator = exports.httpClass = exports.HttpDecorator = exports.HttpAction = exports.HttpActionParameter = void 0;
13
28
  const core_1 = require("@deepkit/core");
14
29
  const type_1 = require("@deepkit/type");
15
30
  const middleware_1 = require("./middleware");
31
+ var __ΩHttpActionMiddleware = [() => middleware_1.HttpMiddlewareConfig, '', () => __ΩClassType, () => __ΩHttpMiddleware, () => __ΩHttpMiddlewareFn, 'PPP7!/"n$o#"n%J'];
16
32
  function isMiddlewareClassTypeOrFn(v) {
17
- return core_1.isClass(v) || !type_1.isDecoratorContext(middleware_1.httpMiddleware, v);
33
+ return (0, core_1.isClass)(v) || !(0, type_1.isDecoratorContext)(middleware_1.httpMiddleware, v);
18
34
  }
35
+ isMiddlewareClassTypeOrFn.__type = [() => __ΩHttpActionMiddleware, 'v', 'isMiddlewareClassTypeOrFn', 'Pn!2"!/#'];
19
36
  class HttpController {
20
37
  constructor() {
21
38
  this.baseUrl = '';
@@ -26,7 +43,7 @@ class HttpController {
26
43
  this.resolverForParameterName = new Map();
27
44
  }
28
45
  getUrl(action) {
29
- return core_1.urlJoin('/', this.baseUrl, action.path);
46
+ return (0, core_1.urlJoin)('/', this.baseUrl, action.path);
30
47
  }
31
48
  addAction(action) {
32
49
  this.actions.add(action);
@@ -51,6 +68,7 @@ class HttpController {
51
68
  throw new Error(`No action with methodName ${methodName} found`);
52
69
  }
53
70
  }
71
+ HttpController.__type = ['baseUrl', function () { return ''; }, 'groups', function () { return []; }, () => middleware_1.HttpMiddlewareConfig, '', 'middlewares', function () { return []; }, () => __ΩClassType, 'resolverForToken', function () { return new Map(); }, () => __ΩClassType, 'resolverForParameterName', function () { return new Map(); }, () => HttpAction, 'action', 'getUrl', () => HttpAction, 'addAction', () => HttpAction, 'getActions', 'methodName', 'removeAction', () => HttpAction, 'getAction', '&3!>"&F3#>$PP7%/&F3\'>("n)E3*>+&n,E3->.PP7/20&01PP7220"03PP74D05P&26$07P&26P78095'];
54
72
  class HttpActionParameter {
55
73
  constructor() {
56
74
  this.name = '';
@@ -58,6 +76,7 @@ class HttpActionParameter {
58
76
  }
59
77
  }
60
78
  exports.HttpActionParameter = HttpActionParameter;
79
+ HttpActionParameter.__type = ['name', function () { return ''; }, "body", "query", "queries", 'type', 'typePath', 'optional', function () { return false; }, '&3!>"P.#.$.%J3&8&3\'8)3(>)5'];
61
80
  class HttpAction {
62
81
  constructor() {
63
82
  this.name = '';
@@ -68,13 +87,8 @@ class HttpAction {
68
87
  this.methodName = '';
69
88
  this.groups = [];
70
89
  this.middlewares = [];
71
- this.parameterRegularExpressions = {};
72
90
  this.resolverForToken = new Map();
73
91
  this.resolverForParameterName = new Map();
74
- /**
75
- * This is only filled when the user used @http.body() for example on an method argument.
76
- */
77
- this.parameters = {};
78
92
  /**
79
93
  * An arbitrary data container the user can use to store app specific settings/values.
80
94
  */
@@ -83,6 +97,7 @@ class HttpAction {
83
97
  }
84
98
  }
85
99
  exports.HttpAction = HttpAction;
100
+ HttpAction.__type = ['name', function () { return ''; }, 'description', function () { return ''; }, 'category', function () { return ''; }, 'path', function () { return ''; }, 'httpMethods', function () { return []; }, 'methodName', function () { return ''; }, 'groups', function () { return []; }, () => type_1.Serializer, 'serializer', () => middleware_1.HttpMiddlewareConfig, '', 'middlewares', function () { return []; }, () => __ΩSerializationOptions, 'serializationOptions', () => __ΩClassType, 'resolverForToken', function () { return new Map(); }, () => __ΩClassType, 'resolverForParameterName', function () { return new Map(); }, 'statusCode', 'type', 'responses', function () { return []; }, '&3!>"&3#>$&3%>&&3\'>(&F3)>*&3+>,&F3->.P7/308PP71/2F33>4n5368"n7E38>9&n:E3;><P\'4=&4#"4>8MF3?>@5'];
86
101
  class HttpDecorator {
87
102
  constructor() {
88
103
  this.t = new HttpController;
@@ -94,7 +109,7 @@ class HttpDecorator {
94
109
  this.t.groups.push(...group);
95
110
  }
96
111
  middleware(...middlewares) {
97
- this.t.middlewares.push(...middlewares.map(v => isMiddlewareClassTypeOrFn(v) ? middleware_1.httpMiddleware.for(v) : v));
112
+ this.t.middlewares.push(...middlewares.map(Object.assign(v => isMiddlewareClassTypeOrFn(v) ? middleware_1.httpMiddleware.for(v) : v, { __type: ['v', '', 'P"2!"/"'] })));
98
113
  }
99
114
  /**
100
115
  * Adds a parameter resolver for parameters based on the class type. Use .resolveParameterByName() for name-based resolving.
@@ -151,21 +166,21 @@ class HttpDecorator {
151
166
  }
152
167
  }
153
168
  exports.HttpDecorator = HttpDecorator;
154
- exports.httpClass = type_1.createClassDecoratorContext(HttpDecorator);
169
+ HttpDecorator.__type = ['baseUrl', () => "", 'controller', 'group', () => __ΩHttpActionMiddleware, 'middlewares', 'middleware', () => __ΩClassType, 'classType', () => __ΩClassType, () => __ΩRouteParameterResolver, 'resolver', 'resolveParameter', 'name', () => __ΩClassType, () => __ΩRouteParameterResolver, 'resolveParameterByName', () => HttpAction, 'action', 'setAction', 'P&2!>""0#P&@2$"0$Pn%@2&"0\'PPn(&"J2)n+o*"2,"0-P&2.n0o/"2,"01PP7223"045'];
170
+ exports.httpClass = (0, type_1.createClassDecoratorContext)(HttpDecorator);
155
171
  class HttpActionDecorator {
156
172
  constructor() {
157
173
  this.t = new HttpAction;
158
174
  }
159
- onDecorator(target, property) {
175
+ onDecorator(target, property, parameterIndexOrDescriptor) {
176
+ if (!property)
177
+ return;
160
178
  this.t.methodName = property;
161
179
  exports.httpClass.setAction(this.t)(target);
162
180
  }
163
181
  name(name) {
164
182
  this.t.name = name;
165
183
  }
166
- setParameter(name, parameter) {
167
- this.t.parameters[name] = parameter;
168
- }
169
184
  description(description) {
170
185
  this.t.description = description;
171
186
  }
@@ -176,7 +191,7 @@ class HttpActionDecorator {
176
191
  this.t.serializer = serializer;
177
192
  }
178
193
  middleware(...middlewares) {
179
- this.t.middlewares.push(...middlewares.map(v => isMiddlewareClassTypeOrFn(v) ? middleware_1.httpMiddleware.for(v) : v));
194
+ this.t.middlewares.push(...middlewares.map(Object.assign(v => isMiddlewareClassTypeOrFn(v) ? middleware_1.httpMiddleware.for(v) : v, { __type: ['v', '', 'P"2!"/"'] })));
180
195
  }
181
196
  /**
182
197
  * Allows to change the HttpAction object and composite multiple properties into one function.
@@ -247,12 +262,12 @@ class HttpActionDecorator {
247
262
  this.t.path = path;
248
263
  }
249
264
  OPTIONS(path = '') {
250
- this.t.httpMethods.push('HEAD');
265
+ this.t.httpMethods.push('OPTIONS');
251
266
  if (path)
252
267
  this.t.path = path;
253
268
  }
254
269
  TRACE(path = '') {
255
- this.t.httpMethods.push('HEAD');
270
+ this.t.httpMethods.push('TRACE');
256
271
  if (path)
257
272
  this.t.path = path;
258
273
  }
@@ -268,31 +283,29 @@ class HttpActionDecorator {
268
283
  }
269
284
  /**
270
285
  * Adds additional information about what HTTP status codes are available in this route.
271
- * You can add additionally a description and a class type.
272
- *
273
- * The class type is used for serialization for responses with the given statusCode.
286
+ * You can add additionally a description and a response body type.
274
287
  *
275
- * Those information are available in Deepkit API console.
288
+ * The type is used for serialization for responses with the given statusCode.
276
289
  *
277
- * classType can be a schema, class, or deepkit/type t.
290
+ * This information is available in Deepkit API console.
278
291
  *
279
292
  * ```typescript
280
293
  *
281
- * @http.GET().response(200, 'All ok', t.boolean)
294
+ * @http.GET().response<boolean>(200, 'All ok')
282
295
  *
283
- * class User {
284
- * @t username: string = '';
296
+ * interface User {
297
+ * username: string;
285
298
  * }
286
- * @http.GET().response(200, 'User object', User)
287
- *
299
+ * @http.GET().response<User>(200, 'User object')
288
300
  *
289
- * const error = t.schema({error: t.string});
290
- * @http.GET().response(500, 'Error', error)
301
+ * interface HttpErrorMessage {
302
+ * error: string;
303
+ * }
304
+ * @http.GET().response<HttpErrorMessage>(500, 'Error')
291
305
  * ```
292
306
  */
293
- response(statusCode, description = '', classType) {
294
- const type = classType ? (type_1.isFieldDecorator(classType) ? classType.buildPropertySchema() : type_1.t.type(type_1.getClassSchema(classType)).buildPropertySchema()) : undefined;
295
- this.t.responses.push({ statusCode, description, type });
307
+ response(statusCode, description = '', type) {
308
+ this.t.responses.push({ statusCode, description, type: type ? (0, type_1.resolveReceiveType)(type) : undefined });
296
309
  }
297
310
  /**
298
311
  * Adds a parameter resolver for parameters based on the class type. Use .resolveParameterByName() for name-based resolving.
@@ -342,91 +355,13 @@ class HttpActionDecorator {
342
355
  resolveParameterByName(name, resolver) {
343
356
  this.t.resolverForParameterName.set(name, resolver);
344
357
  }
345
- regexp(parameterName, regex) {
346
- this.t.parameterRegularExpressions[parameterName] = regex;
347
- }
348
358
  }
349
359
  exports.HttpActionDecorator = HttpActionDecorator;
350
- class HttpActionParameterDecorator {
351
- constructor() {
352
- this.t = new HttpActionParameter();
353
- }
354
- onDecorator(target, propertyName, parameterIndex) {
355
- if (!propertyName)
356
- throw new Error('@http action parameter decorator can only be used on method arguments.');
357
- if (parameterIndex === undefined)
358
- throw new Error('@http action parameter decorator can only be used on method arguments.');
359
- const schema = type_1.getClassSchema(target);
360
- const property = schema.getMethodProperties(propertyName)[parameterIndex];
361
- this.t.name = property.name;
362
- if (this.t.typePath === undefined) {
363
- this.t.typePath = property.name;
364
- }
365
- exports.httpAction.setParameter(property.name, this.t)(target.prototype, propertyName);
366
- }
367
- /**
368
- * Marks the argument as body parameter. Data from the client sent in the body
369
- * will be tried to parsed (JSON/form data) and deserialized to the defined type.
370
- * Make sure the class type as a schema assigned.
371
- *
372
- * @example
373
- * ```typescript
374
- * class MyActionBody {
375
- * @t name!: string;
376
- * }
377
- *
378
- * class Controller {
379
- * @http.GET()
380
- * myAction(@http.body() body: MyActionBody) {
381
- * console.log('body', body.name);
382
- * }
383
- * }
384
- * ```
385
- */
386
- body() {
387
- this.t.type = 'body';
388
- this.t.typePath = ''; //root
389
- }
390
- query(path) {
391
- this.t.typePath = path; //undefined === propertyName
392
- this.t.type = 'query';
393
- }
394
- get optional() {
395
- this.t.optional = true;
396
- return;
397
- }
398
- /**
399
- * Marks the argument as query parameter. Data from the query string is parsed
400
- * and deserialized to the defined type.
401
- * Define a `path` if you want to parse a subset of the query string only.
402
- *
403
- * Note: Make sure the defined parameter type has optional properties,
404
- * otherwise it's always required to pass a query string.
405
- *
406
- * @example
407
- * ```typescript
408
- * class MyActionQueries {
409
- * @t.optional name?: string;
410
- * }
411
- *
412
- * class Controller {
413
- * @http.GET('my-action')
414
- * myAction(@http.queries() query: MyActionQueries) {
415
- * console.log('query', query.name);
416
- * }
417
- * }
418
- *
419
- * // Open via, e.g.
420
- * // -> /my-action?name=Peter
421
- * ```
422
- *
423
- */
424
- queries(path = '') {
425
- this.t.typePath = path; //'' === root
426
- this.t.type = 'queries';
427
- }
428
- }
429
- exports.httpAction = type_1.createPropertyDecoratorContext(HttpActionDecorator);
430
- exports.httpActionParameter = type_1.createPropertyDecoratorContext(HttpActionParameterDecorator);
431
- exports.http = type_1.mergeDecorator(exports.httpClass, exports.httpAction, exports.httpActionParameter);
360
+ HttpActionDecorator.__type = [() => __ΩClassType, 'target', 'property', 'parameterIndexOrDescriptor', 'onDecorator', 'name', 'description', () => __ΩSerializationOptions, 'options', 'serialization', () => type_1.Serializer, 'serializer', () => __ΩHttpActionMiddleware, 'middlewares', 'middleware', () => HttpAction, 'action', '', 'use', 'value', 'data', 'category', 'group', 'path', () => "", 'GET', () => "", 'HEAD', () => "", 'POST', () => "", 'PUT', () => "", 'DELETE', () => "", 'OPTIONS', () => "", 'TRACE', () => "", 'PATCH', () => "", 'ANY', 'statusCode', () => "", () => __ΩReceiveType, 'type', 'response', () => __ΩClassType, 'classType', () => __ΩClassType, () => __ΩRouteParameterResolver, 'resolver', 'resolveParameter', () => __ΩClassType, () => __ΩRouteParameterResolver, 'resolveParameterByName', 'Pn!2"P&-J2#"2$8"0%P&2&"0&P&2\'"0\'Pn(2)"0*PP7+2,"0,Pn-@2."0/PPP7021$/223"03P&2&"24"05P&26"06P&@27"07P&28>9"0:P&28>;"0<P&28>="0>P&28>?"0@P&28>A"0BP&28>C"0DP&28>E"0FP&28>G"0HP&28>I"0JP\'2K&2\'>L"oM"2N8"0OPPnP&"J2QnSoR"2T"0UP&2&nWoV"2T"0X5'];
361
+ var __ΩHttpActionFluidDecorator = ['T', 'D', "response", 'statusCode', 'description', () => __ΩReceiveType, 'type', 0, '', 'args', 0, 0, () => __ΩExtractApiDataType, '_data', 'l\u00A1P\'2$&2%8"o&"2\'8Pe)"e)!e)"o(#K/)RPe#!@2*Pe+"e+!e+"o+#K/)RPe*"e*!e*"o,#Pe+!o-"4.MKRPde(!e%!fPh"!@2*"/)qkC[QRPe#!.#qk#tQRPde#!p\u008DRb!b"Pde"!gN\u0099!'];
362
+ var __ΩHttpActionPropertyDecoratorResult = [() => __ΩHttpActionFluidDecorator, () => __ΩExtractClass, () => HttpActionDecorator, () => __ΩPropertyDecoratorFn, () => __ΩDecoratorAndFetchSignature, () => HttpActionDecorator, () => __ΩPropertyDecoratorFn, 'Pi#o""n$o!#i&n\'o%#K'];
363
+ exports.httpAction = (0, type_1.createPropertyDecoratorContext)(HttpActionDecorator);
364
+ var __ΩHttpMerge = ['U', "response", 'statusCode', 'description', () => __ΩReceiveType, 'type', () => __ΩPropertyDecoratorFn, '', 'a', () => __ΩDualDecorator, () => __ΩPropertyDecoratorFn, 'l\u00A3P\'2#&2$8"o%"2&8Pn\'e)!K/(RPe\'!@2)Pn+e&!e/!K/(RPe\'!@2)e%!/(RPe#!n*qk<PQRPde#"p]R!RPdde(!e%!fPh"!@2)h""/(qkiqQRPe#!."qk#sQRPde#!p\u008FRb!Pde"!gN\u009B!'];
365
+ var __ΩMergedHttp = ['T', () => __ΩHttpMerge, () => __ΩOmit, () => __ΩUnionToIntersection, "_fetch", "t", 'b!e!!\'fo$"P.%.&Jo##o""'];
366
+ exports.http = (0, type_1.mergeDecorator)(exports.httpClass, exports.httpAction);
432
367
  //# sourceMappingURL=decorator.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"decorator.js","sourceRoot":"","sources":["../../../src/decorator.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;;AAEH,wCAA4D;AAC5D,wCAeuB;AAEvB,6CAAsG;AAQtG,SAAS,yBAAyB,CAAC,CAAuB;IACtD,OAAO,cAAO,CAAC,CAAC,CAAC,IAAI,CAAC,yBAAkB,CAAC,2BAAc,EAAE,CAAC,CAAC,CAAC;AAChE,CAAC;AAED,MAAM,cAAc;IAApB;QACI,YAAO,GAAW,EAAE,CAAC;QACrB,YAAO,GAAG,IAAI,GAAG,EAAc,CAAC;QAChC,WAAM,GAAa,EAAE,CAAC;QAEtB,gBAAW,GAAmC,EAAE,CAAC;QAEjD,qBAAgB,GAAwB,IAAI,GAAG,EAAE,CAAC;QAClD,6BAAwB,GAA2B,IAAI,GAAG,EAAE,CAAC;IA8BjE,CAAC;IA5BG,MAAM,CAAC,MAAkB;QACrB,OAAO,cAAO,CAAC,GAAG,EAAE,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;IACnD,CAAC;IAED,SAAS,CAAC,MAAkB;QACxB,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IAC7B,CAAC;IAED,UAAU;QACN,KAAK,MAAM,CAAC,IAAI,IAAI,CAAC,OAAO,EAAE;YAC1B,KAAK,MAAM,CAAC,IAAI,IAAI,CAAC,MAAM,EAAE;gBACzB,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC;oBAAE,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;aAC/C;SACJ;QAED,OAAO,IAAI,CAAC,OAAO,CAAC;IACxB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,WAAW,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,IAAA,yBAAkB,EAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC;IAC1G,CAAC;IAED;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,gBAAgB,CAAC,SAAmC,EAAE,QAA2C;QAC7F,IAAI,CAAC,CAAC,CAAC,gBAAgB,CAAC,GAAG,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;IACrD,CAAC;IAED;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,sBAAsB,CAAC,IAAY,EAAE,QAA2C;QAC5E,IAAI,CAAC,CAAC,CAAC,wBAAwB,CAAC,GAAG,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IACxD,CAAC;;AApML,kDAqMC;;;;AAUY,QAAA,UAAU,GAAsC,IAAA,qCAA8B,EAAC,mBAAmB,CAAC,CAAC;;;AAMpG,QAAA,IAAI,GAAsD,IAAA,qBAAc,EAAC,iBAAS,EAAE,kBAAU,CAA6D,CAAC"}
@@ -46,3 +46,4 @@ export declare class HttpRouteFilter {
46
46
  forModuleClasses(...moduleClasses: ClassType<AppModule<any>>[]): this;
47
47
  excludeModuleClasses(...moduleClasses: ClassType<AppModule<any>>[]): this;
48
48
  }
49
+ export declare type __ΩHttpRouteFilterRoute = any[];
@@ -1,17 +1,11 @@
1
1
  "use strict";
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
- var __metadata = (this && this.__metadata) || function (k, v) {
9
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
- };
11
2
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.HttpRouteFilter = exports.HttpRouterFilterResolver = exports.HttpRouteFilterModel = void 0;
3
+ exports.HttpRouteFilter = exports.HttpRouterFilterResolver = exports.HttpRouteFilterModel = exports.__ΩHttpRouteFilterRoute = void 0;
4
+ var { __ΩClassType } = require('@deepkit/core');
5
+ const app_1 = require("@deepkit/app");
13
6
  const router_1 = require("./router");
14
- const injector_1 = require("@deepkit/injector");
7
+ var __ΩHttpRouteFilterRoute = ['path', 'pathRegExp', "GET", "HEAD", "POST", "PATCH", "PUT", "DELETE", "OPTIONS", "TRACE", 'httpMethod', 'category', 'group', 'P&4!8A4"8P.#.$.%.&.\'.(.).*J4+8&4,8&4-8M'];
8
+ exports.__ΩHttpRouteFilterRoute = __ΩHttpRouteFilterRoute;
15
9
  class HttpRouteFilterModel {
16
10
  constructor() {
17
11
  this.controllers = [];
@@ -37,6 +31,7 @@ class HttpRouteFilterModel {
37
31
  }
38
32
  }
39
33
  exports.HttpRouteFilterModel = HttpRouteFilterModel;
34
+ HttpRouteFilterModel.__type = [() => __ΩClassType, 'controllers', function () { return []; }, () => __ΩClassType, 'excludeControllers', function () { return []; }, () => __ΩHttpRouteFilterRoute, 'routes', function () { return []; }, () => __ΩHttpRouteFilterRoute, 'excludeRoutes', function () { return []; }, 'routeNames', function () { return []; }, 'excludeRouteNames', function () { return []; }, () => app_1.AppModule, 'modules', function () { return []; }, () => app_1.AppModule, 'excludeModules', function () { return []; }, () => __ΩClassType, () => app_1.AppModule, 'moduleClasses', function () { return []; }, () => __ΩClassType, () => app_1.AppModule, 'excludeModuleClasses', function () { return []; }, 'reset', 'n!F3">#n$F3%>&n\'F3(>)n*F3+>,&F3->.&F3/>0P"71F32>3P"74F35>6P"78o7"F39>:P"7<o;"F3=>>P"0?5'];
40
35
  function match(routeConfig, route) {
41
36
  if (route.httpMethod && routeConfig.httpMethods.includes(route.httpMethod))
42
37
  return true;
@@ -52,7 +47,8 @@ function match(routeConfig, route) {
52
47
  }
53
48
  return false;
54
49
  }
55
- let HttpRouterFilterResolver = class HttpRouterFilterResolver {
50
+ match.__type = [() => router_1.RouteConfig, 'routeConfig', () => __ΩHttpRouteFilterRoute, 'route', 'match', 'PP7!2"n#2$)/%'];
51
+ class HttpRouterFilterResolver {
56
52
  constructor(router) {
57
53
  this.router = router;
58
54
  }
@@ -152,12 +148,9 @@ let HttpRouterFilterResolver = class HttpRouterFilterResolver {
152
148
  }
153
149
  return result;
154
150
  }
155
- };
156
- HttpRouterFilterResolver = __decorate([
157
- injector_1.injectable,
158
- __metadata("design:paramtypes", [router_1.Router])
159
- ], HttpRouterFilterResolver);
151
+ }
160
152
  exports.HttpRouterFilterResolver = HttpRouterFilterResolver;
153
+ HttpRouterFilterResolver.__type = [() => router_1.Router, 'router', 'constructor', () => HttpRouteFilterModel, 'filter', () => router_1.RouteConfig, 'resolve', 'PP7!2"<"0#PP7$2%P7&F0\'5'];
161
154
  /**
162
155
  * A class to describe a filter for routes.
163
156
  */
@@ -211,4 +204,5 @@ class HttpRouteFilter {
211
204
  }
212
205
  }
213
206
  exports.HttpRouteFilter = HttpRouteFilter;
207
+ HttpRouteFilter.__type = ['reset', () => __ΩClassType, 'controllers', 'forControllers', () => __ΩClassType, 'excludeControllers', () => __ΩHttpRouteFilterRoute, 'routes', 'forRoutes', () => __ΩHttpRouteFilterRoute, 'excludeRoutes', 'names', 'forRouteNames', 'excludeRouteNames', () => app_1.AppModule, 'modules', 'forModules', () => app_1.AppModule, 'excludeModules', () => __ΩClassType, () => app_1.AppModule, 'moduleClasses', 'forModuleClasses', () => __ΩClassType, () => app_1.AppModule, 'excludeModuleClasses', 'P!0!Pn"@2#!0$Pn%@2#!0&Pn\'@2(!0)Pn*@2(!0+P&@2,!0-P&@2,!0.PP"7/@20!01PP"72@20!03PP"75o4"@26!07PP"79o8"@26!0:5'];
214
208
  //# sourceMappingURL=filter.js.map