@deepkit/http 1.0.1-alpha.16 → 1.0.1-alpha.160

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 (124) hide show
  1. package/CHANGELOG.md +236 -0
  2. package/dist/cjs/index.d.ts +14 -10
  3. package/dist/cjs/index.js +19 -11
  4. package/dist/cjs/index.js.map +1 -1
  5. package/dist/cjs/src/controllers.d.ts +10 -3
  6. package/dist/cjs/src/controllers.js +7 -3
  7. package/dist/cjs/src/controllers.js.map +1 -1
  8. package/dist/cjs/src/decorator.d.ts +144 -70
  9. package/dist/cjs/src/decorator.js +277 -102
  10. package/dist/cjs/src/decorator.js.map +1 -1
  11. package/dist/cjs/src/filter.d.ts +49 -0
  12. package/dist/cjs/src/filter.js +215 -0
  13. package/dist/cjs/src/filter.js.map +1 -0
  14. package/dist/cjs/src/http-app.d.ts +8 -0
  15. package/dist/cjs/src/http-app.js +16 -0
  16. package/dist/cjs/src/http-app.js.map +1 -0
  17. package/dist/cjs/src/http.d.ts +131 -32
  18. package/dist/cjs/src/http.js +523 -122
  19. package/dist/cjs/src/http.js.map +1 -1
  20. package/dist/cjs/src/kernel.d.ts +50 -9
  21. package/dist/cjs/src/kernel.js +109 -98
  22. package/dist/cjs/src/kernel.js.map +1 -1
  23. package/dist/cjs/src/logger.d.ts +3 -3
  24. package/dist/cjs/src/logger.js +9 -12
  25. package/dist/cjs/src/logger.js.map +1 -1
  26. package/dist/cjs/src/middleware.d.ts +61 -0
  27. package/dist/cjs/src/middleware.js +95 -0
  28. package/dist/cjs/src/middleware.js.map +1 -0
  29. package/dist/cjs/src/model.d.ts +270 -4
  30. package/dist/cjs/src/model.js +401 -3
  31. package/dist/cjs/src/model.js.map +1 -1
  32. package/dist/cjs/src/module.config.d.ts +149 -4
  33. package/dist/cjs/src/module.config.js +11 -6
  34. package/dist/cjs/src/module.config.js.map +1 -1
  35. package/dist/cjs/src/module.d.ts +14 -32
  36. package/dist/cjs/src/module.js +122 -7
  37. package/dist/cjs/src/module.js.map +1 -1
  38. package/dist/cjs/src/request-parser.d.ts +37 -0
  39. package/dist/cjs/src/request-parser.js +382 -0
  40. package/dist/cjs/src/request-parser.js.map +1 -0
  41. package/dist/cjs/src/router.d.ts +174 -75
  42. package/dist/cjs/src/router.js +469 -288
  43. package/dist/cjs/src/router.js.map +1 -1
  44. package/dist/cjs/src/static-serving.d.ts +32 -4
  45. package/dist/cjs/src/static-serving.js +115 -71
  46. package/dist/cjs/src/static-serving.js.map +1 -1
  47. package/dist/cjs/src/utils.js +2 -2
  48. package/dist/cjs/src/utils.js.map +1 -1
  49. package/dist/cjs/tsconfig.tsbuildinfo +1 -2916
  50. package/dist/esm/index.d.ts +14 -10
  51. package/dist/esm/index.js +14 -10
  52. package/dist/esm/index.js.map +1 -1
  53. package/dist/esm/src/controllers.d.ts +10 -3
  54. package/dist/esm/src/controllers.js +7 -3
  55. package/dist/esm/src/controllers.js.map +1 -1
  56. package/dist/esm/src/decorator.d.ts +144 -70
  57. package/dist/esm/src/decorator.js +272 -99
  58. package/dist/esm/src/decorator.js.map +1 -1
  59. package/dist/esm/src/filter.d.ts +49 -0
  60. package/dist/esm/src/filter.js +209 -0
  61. package/dist/esm/src/filter.js.map +1 -0
  62. package/dist/esm/src/http-app.d.ts +8 -0
  63. package/dist/esm/src/http-app.js +12 -0
  64. package/dist/esm/src/http-app.js.map +1 -0
  65. package/dist/esm/src/http.d.ts +131 -32
  66. package/dist/esm/src/http.js +504 -121
  67. package/dist/esm/src/http.js.map +1 -1
  68. package/dist/esm/src/kernel.d.ts +50 -9
  69. package/dist/esm/src/kernel.js +110 -100
  70. package/dist/esm/src/kernel.js.map +1 -1
  71. package/dist/esm/src/logger.d.ts +3 -3
  72. package/dist/esm/src/logger.js +7 -11
  73. package/dist/esm/src/logger.js.map +1 -1
  74. package/dist/esm/src/middleware.d.ts +61 -0
  75. package/dist/esm/src/middleware.js +90 -0
  76. package/dist/esm/src/middleware.js.map +1 -0
  77. package/dist/esm/src/model.d.ts +270 -4
  78. package/dist/esm/src/model.js +357 -1
  79. package/dist/esm/src/model.js.map +1 -1
  80. package/dist/esm/src/module.config.d.ts +149 -4
  81. package/dist/esm/src/module.config.js +9 -5
  82. package/dist/esm/src/module.config.js.map +1 -1
  83. package/dist/esm/src/module.d.ts +14 -32
  84. package/dist/esm/src/module.js +121 -7
  85. package/dist/esm/src/module.js.map +1 -1
  86. package/dist/esm/src/request-parser.d.ts +37 -0
  87. package/dist/esm/src/request-parser.js +372 -0
  88. package/dist/esm/src/request-parser.js.map +1 -0
  89. package/dist/esm/src/router.d.ts +174 -75
  90. package/dist/esm/src/router.js +463 -285
  91. package/dist/esm/src/router.js.map +1 -1
  92. package/dist/esm/src/static-serving.d.ts +32 -4
  93. package/dist/esm/src/static-serving.js +107 -65
  94. package/dist/esm/src/static-serving.js.map +1 -1
  95. package/dist/esm/src/utils.js +1 -0
  96. package/dist/esm/src/utils.js.map +1 -1
  97. package/dist/esm/tsconfig.esm.tsbuildinfo +1 -2916
  98. package/index.ts +14 -10
  99. package/package.json +30 -19
  100. package/src/controllers.ts +4 -3
  101. package/src/decorator.ts +242 -104
  102. package/src/filter.ts +224 -0
  103. package/src/http-app.ts +11 -0
  104. package/src/http.ts +501 -100
  105. package/src/kernel.ts +128 -80
  106. package/src/logger.ts +4 -6
  107. package/src/middleware.ts +116 -0
  108. package/src/model.ts +516 -5
  109. package/src/module.config.ts +168 -5
  110. package/src/module.ts +120 -7
  111. package/src/request-parser.ts +430 -0
  112. package/src/router.ts +546 -317
  113. package/src/static-serving.ts +120 -50
  114. package/src/utils.ts +0 -2
  115. package/tsconfig.esm.json +7 -7
  116. package/tsconfig.json +18 -11
  117. package/tsconfig.spec.json +8 -0
  118. package/dist/cjs/tests/router.spec.d.ts +0 -1
  119. package/dist/cjs/tests/router.spec.js +0 -481
  120. package/dist/cjs/tests/router.spec.js.map +0 -1
  121. package/dist/esm/tests/router.spec.d.ts +0 -1
  122. package/dist/esm/tests/router.spec.js +0 -479
  123. package/dist/esm/tests/router.spec.js.map +0 -1
  124. package/tests/router.spec.ts +0 -347
@@ -1,10 +1,14 @@
1
- export * from './src/decorator';
2
- export * from './src/http';
3
- export * from './src/model';
4
- export * from './src/logger';
5
- export * from './src/router';
6
- export * from './src/static-serving';
7
- export * from './src/kernel';
8
- export * from './src/module';
9
- export * from './src/module.config';
10
- export * from './src/controllers';
1
+ export * from './src/decorator.js';
2
+ export * from './src/http.js';
3
+ export * from './src/http-app.js';
4
+ export * from './src/model.js';
5
+ export * from './src/logger.js';
6
+ export * from './src/router.js';
7
+ export * from './src/static-serving.js';
8
+ export * from './src/kernel.js';
9
+ export * from './src/module.js';
10
+ export * from './src/module.config.js';
11
+ export * from './src/controllers.js';
12
+ export * from './src/middleware.js';
13
+ export * from './src/filter.js';
14
+ export * from './src/utils.js';
package/dist/esm/index.js CHANGED
@@ -1,11 +1,15 @@
1
- export * from './src/decorator';
2
- export * from './src/http';
3
- export * from './src/model';
4
- export * from './src/logger';
5
- export * from './src/router';
6
- export * from './src/static-serving';
7
- export * from './src/kernel';
8
- export * from './src/module';
9
- export * from './src/module.config';
10
- export * from './src/controllers';
1
+ export * from './src/decorator.js';
2
+ export * from './src/http.js';
3
+ export * from './src/http-app.js';
4
+ export * from './src/model.js';
5
+ export * from './src/logger.js';
6
+ export * from './src/router.js';
7
+ export * from './src/static-serving.js';
8
+ export * from './src/kernel.js';
9
+ export * from './src/module.js';
10
+ export * from './src/module.config.js';
11
+ export * from './src/controllers.js';
12
+ export * from './src/middleware.js';
13
+ export * from './src/filter.js';
14
+ export * from './src/utils.js';
11
15
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,sBAAsB,CAAC;AACrC,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,yBAAyB,CAAC;AACxC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC"}
@@ -1,6 +1,13 @@
1
1
  import { ClassType } from '@deepkit/core';
2
+ import { InjectorModule } from '@deepkit/injector';
2
3
  export declare class HttpControllers {
3
- readonly controllers: ClassType[];
4
- constructor(controllers: ClassType[]);
5
- add(controller: ClassType): void;
4
+ readonly controllers: {
5
+ controller: ClassType;
6
+ module: InjectorModule<any>;
7
+ }[];
8
+ constructor(controllers?: {
9
+ controller: ClassType;
10
+ module: InjectorModule<any>;
11
+ }[]);
12
+ add(controller: ClassType, module: InjectorModule<any>): void;
6
13
  }
@@ -1,9 +1,13 @@
1
+ /*@ts-ignore*/
2
+ import { __ΩClassType } from '@deepkit/core';
3
+ import { InjectorModule } from '@deepkit/injector';
1
4
  export class HttpControllers {
2
- constructor(controllers) {
5
+ constructor(controllers = []) {
3
6
  this.controllers = controllers;
4
7
  }
5
- add(controller) {
6
- this.controllers.push(controller);
8
+ add(controller, module) {
9
+ this.controllers.push({ controller, module });
7
10
  }
8
11
  }
12
+ HttpControllers.__type = [() => __ΩClassType, 'controller', () => InjectorModule, 'module', 'controllers', () => [], 'constructor', () => __ΩClassType, () => InjectorModule, 'add', 'HttpControllers', 'PPn!4"P"7#4$MF2%:9>&"0\'Pn(2"P"7)2$"0*5w+'];
9
13
  //# sourceMappingURL=controllers.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"controllers.js","sourceRoot":"","sources":["../../../src/controllers.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,eAAe;IACxB,YAA4B,WAAwB;QAAxB,gBAAW,GAAX,WAAW,CAAa;IACpD,CAAC;IAEM,GAAG,CAAC,UAAqB;QAC5B,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IACtC,CAAC;CACJ"}
1
+ {"version":3,"file":"controllers.js","sourceRoot":"","sources":["../../../src/controllers.ts"],"names":[],"mappings":";6BAA0B,eAAe;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD,MAAM,OAAO,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"}
@@ -1,20 +1,25 @@
1
1
  import { ClassType } from '@deepkit/core';
2
- import { ClassDecoratorResult, PropertyDecoratorResult } from '@deepkit/type';
3
- export interface ControllerOptions {
4
- name: string;
5
- }
6
- declare class HttpController {
2
+ import { ClassDecoratorResult, DecoratorAndFetchSignature, DualDecorator, ExtractApiDataType, ExtractClass, PropertyDecoratorFn, ReceiveType, SerializationOptions, Serializer, Type, UnionToIntersection } from '@deepkit/type';
3
+ import { RouteParameterResolver } from './router.js';
4
+ import { HttpMiddleware, HttpMiddlewareConfig, HttpMiddlewareFn } from './middleware.js';
5
+ type HttpActionMiddleware = (() => HttpMiddlewareConfig) | ClassType<HttpMiddleware> | HttpMiddlewareFn;
6
+ export declare class HttpController {
7
7
  baseUrl: string;
8
- protected actions: Set<HttpAction>;
8
+ actions: Set<HttpAction>;
9
9
  groups: string[];
10
+ middlewares: (() => HttpMiddlewareConfig)[];
11
+ resolverForToken: Map<any, ClassType>;
12
+ resolverForParameterName: Map<string, ClassType>;
13
+ private actionsProcessed;
10
14
  getUrl(action: HttpAction): string;
11
15
  addAction(action: HttpAction): void;
12
16
  getActions(): Set<HttpAction>;
17
+ removeAction(methodName: string): void;
13
18
  getAction(methodName: string): HttpAction;
14
19
  }
15
20
  export declare class HttpActionParameter {
16
21
  name: string;
17
- type?: 'body' | 'query';
22
+ type?: 'body' | 'query' | 'queries';
18
23
  /**
19
24
  * undefined = propertyName, '' === root, else given path
20
25
  */
@@ -26,40 +31,87 @@ export declare class HttpAction {
26
31
  description: string;
27
32
  category: string;
28
33
  path: string;
29
- httpMethod: string;
34
+ httpMethods: string[];
30
35
  methodName: string;
31
36
  groups: string[];
32
- parameterRegularExpressions: {
33
- [name: string]: any;
34
- };
35
- /**
36
- * This is only filled when the user used @http.body() for example on an method argument.
37
- */
38
- parameters: {
39
- [name: string]: HttpActionParameter;
40
- };
37
+ serializer?: Serializer;
38
+ middlewares: (() => HttpMiddlewareConfig)[];
39
+ serializationOptions?: SerializationOptions;
40
+ resolverForToken: Map<any, ClassType>;
41
+ resolverForParameterName: Map<string, ClassType>;
41
42
  /**
42
43
  * An arbitrary data container the user can use to store app specific settings/values.
43
44
  */
44
45
  data: Map<any, any>;
45
- throws: {
46
- errorType: ClassType;
47
- message?: string;
46
+ responses: {
47
+ statusCode: number;
48
+ description: string;
49
+ type?: Type;
48
50
  }[];
49
51
  }
50
- export declare class HttpDecorator {
52
+ export declare class HttpControllerDecorator {
51
53
  t: HttpController;
52
54
  controller(baseUrl?: string): void;
53
- groupAll(...group: string[]): void;
55
+ group(...group: string[]): void;
56
+ middleware(...middlewares: HttpActionMiddleware[]): void;
57
+ /**
58
+ * Adds a parameter resolver for parameters based on the class type. Use .resolveParameterByName() for name-based resolving.
59
+ *
60
+ * ```typescript
61
+ *
62
+ * class UserResolver {
63
+ * resolve(context: RouteParameterResolverContext): any | Promise<any> {
64
+ * return new User();
65
+ * }
66
+ * }
67
+ *
68
+ * @http.resolveParameter(User, UserResolver)
69
+ * class MyController {
70
+ *
71
+ * @http.GET()
72
+ * myAction(user: User) {
73
+ * }
74
+ * }
75
+ *
76
+ * new App({providers: [UserResolver]}).run();
77
+ * ```
78
+ */
79
+ resolveParameter(classType: ClassType | string | any, resolver: ClassType<RouteParameterResolver>): void;
80
+ /**
81
+ * Adds a parameter resolver for parameters based on its name. Use .resolveParameter() for class-based resolving.
82
+ *
83
+ * ```typescript
84
+ *
85
+ * class UserResolver {
86
+ * resolve(context: RouteParameterResolverContext): any | Promise<any> {
87
+ * return new User();
88
+ * }
89
+ * }
90
+ *
91
+ * @http.resolveParameterByName('user', UserResolver)
92
+ * class MyController {
93
+ *
94
+ * @http.GET()
95
+ * myAction(user: User) {
96
+ * }
97
+ * }
98
+ *
99
+ * new App({providers: [UserResolver]}).run();
100
+ * ```
101
+ */
102
+ resolveParameterByName(name: string, resolver: ClassType<RouteParameterResolver>): void;
54
103
  setAction(action: HttpAction): void;
55
104
  }
56
- export declare const httpClass: ClassDecoratorResult<typeof HttpDecorator>;
105
+ export declare const httpClass: ClassDecoratorResult<typeof HttpControllerDecorator>;
106
+ export declare function getActions(target: ClassType): HttpAction[];
57
107
  export declare class HttpActionDecorator {
58
108
  t: HttpAction;
59
- onDecorator(target: ClassType, property: string): void;
109
+ onDecorator(target: ClassType, property: string | undefined, parameterIndexOrDescriptor?: any): void;
60
110
  name(name: string): void;
61
- setParameter(name: string, parameter: HttpActionParameter): void;
62
111
  description(description: string): void;
112
+ serialization(options: SerializationOptions): void;
113
+ serializer(serializer: Serializer): void;
114
+ middleware(...middlewares: HttpActionMiddleware[]): void;
63
115
  /**
64
116
  * Allows to change the HttpAction object and composite multiple properties into one function.
65
117
  *
@@ -91,78 +143,100 @@ export declare class HttpActionDecorator {
91
143
  * assets() {}
92
144
  * }
93
145
  * ```
94
- */
146
+ */
95
147
  data(name: string, value: any): void;
96
148
  category(category: string): void;
97
149
  group(...group: string[]): void;
98
150
  GET(path?: string): void;
151
+ HEAD(path?: string): void;
99
152
  POST(path?: string): void;
100
153
  PUT(path?: string): void;
101
154
  DELETE(path?: string): void;
155
+ OPTIONS(path?: string): void;
156
+ TRACE(path?: string): void;
157
+ PATCH(path?: string): void;
102
158
  ANY(path?: string): void;
103
- throws(errorType: ClassType, message?: string): void;
104
- regexp(parameterName: string, regex: any): void;
105
- }
106
- declare class HttpActionParameterDecorator {
107
- t: HttpActionParameter;
108
- onDecorator(target: ClassType, propertyName?: string, parameterIndex?: number): void;
109
159
  /**
110
- * Marks the argument as body parameter. Data from the client sent in the body
111
- * will be tried to parsed (JSON/form data) and deserialized to the defined type.
112
- * Make sure the class type as a schema assigned.
160
+ * Adds additional information about what HTTP status codes are available in this route.
161
+ * You can add additionally a description and a response body type.
162
+ *
163
+ * The type is used for serialization for responses with the given statusCode.
164
+ *
165
+ * This information is available in Deepkit API console.
166
+ *
167
+ * ```typescript
168
+ *
169
+ * http.GET().response<boolean>(200, 'All ok')
170
+ *
171
+ * interface User {
172
+ * username: string;
173
+ * }
174
+ * http.GET().response<User>(200, 'User object')
175
+ *
176
+ * interface HttpErrorMessage {
177
+ * error: string;
178
+ * }
179
+ * http.GET().response<HttpErrorMessage>(500, 'Error')
180
+ * ```
181
+ */
182
+ response<T>(statusCode: number, description?: string, type?: ReceiveType<T>): void;
183
+ /**
184
+ * Adds a parameter resolver for parameters based on the class type. Use .resolveParameterByName() for name-based resolving.
113
185
  *
114
- * @example
115
186
  * ```typescript
116
- * class MyActionBody {
117
- * @t name!: string;
187
+ *
188
+ * class UserResolver {
189
+ * resolve(context: RouteParameterResolverContext): any | Promise<any> {
190
+ * return new User();
191
+ * }
118
192
  * }
119
193
  *
120
- * class Controller {
194
+ * class MyController {
121
195
  * @http.GET()
122
- * myAction(@http.body() body: MyActionBody) {
123
- * console.log('body', body.name);
196
+ * @http.resolveParameter(User, UserResolver)
197
+ * myAction(user: User) {
124
198
  * }
125
199
  * }
200
+ *
201
+ * new App({providers: [UserResolver]}).run();
126
202
  * ```
127
203
  */
128
- body(): void;
129
- query(path?: string): void;
130
- get optional(): void;
204
+ resolveParameter(classType: ClassType | string | any, resolver: ClassType<RouteParameterResolver>): void;
131
205
  /**
132
- * Marks the argument as query parameter. Data from the query string is parsed
133
- * and deserialized to the defined type.
134
- * Define a `path` if you want to parse a subset of the query string only.
206
+ * Adds a parameter resolver for parameters based on its name. Use .resolveParameter() for class-based resolving.
135
207
  *
136
- * Note: Make sure the defined parameter type has optional properties,
137
- * otherwise it's always required to pass a query string.
138
- *
139
- * @example
140
208
  * ```typescript
141
- * class MyActionQueries {
142
- * @t.optional name?: string;
209
+ *
210
+ * class UserResolver {
211
+ * resolve(context: RouteParameterResolverContext): any | Promise<any> {
212
+ * return new User();
213
+ * }
143
214
  * }
144
215
  *
145
- * class Controller {
146
- * @http.GET('my-action')
147
- * myAction(@http.queries() query: MyActionQueries) {
148
- * console.log('query', query.name);
216
+ * class MyController {
217
+ * @http.GET()
218
+ * @http.resolveParameterByName('user', UserResolver)
219
+ * myAction(user: User) {
149
220
  * }
150
221
  * }
151
222
  *
152
- * // Open via, e.g.
153
- * // -> /my-action?name=Peter
223
+ * new App({providers: [UserResolver]}).run();
154
224
  * ```
155
- *
156
225
  */
157
- queries(path?: string): void;
226
+ resolveParameterByName(name: string, resolver: ClassType<RouteParameterResolver>): void;
158
227
  }
159
- export declare const httpAction: PropertyDecoratorResult<typeof HttpActionDecorator>;
160
- export declare const httpActionParameter: PropertyDecoratorResult<typeof HttpActionParameterDecorator>;
161
- export declare const http: Pick<import("@deepkit/type").FluidDecorator<HttpDecorator, import("@deepkit/type").ClassDecoratorFn> & ((classType: ClassType<any>) => void) & {
162
- _fetch: (classType: ClassType<any>) => HttpController | undefined;
163
- } & import("@deepkit/type").FluidDecorator<HttpActionDecorator, import("@deepkit/type").PropertyDecoratorFn> & ((prototype: object, property: string, parameterIndexOrDescriptor?: any) => void) & {
164
- _fetch: (classType: ClassType<any>, property: string, parameterIndexOrDescriptor?: any) => HttpAction | undefined;
165
- } & import("@deepkit/type").FluidDecorator<HttpActionParameterDecorator, import("@deepkit/type").PropertyDecoratorFn> & {
166
- _fetch: (classType: ClassType<any>, property: string, parameterIndexOrDescriptor?: any) => HttpActionParameter | undefined;
167
- }, "name" | "t" | "onDecorator" | "description" | "data" | "ANY" | "regexp" | "throws" | "body" | "query" | "GET" | "controller" | "groupAll" | "setAction" | "POST" | "PUT" | "DELETE" | "setParameter" | "use" | "category" | "group" | "optional" | "queries">;
228
+ type HttpActionFluidDecorator<T, D extends Function> = {
229
+ [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> & {
230
+ _data: ExtractApiDataType<T>;
231
+ };
232
+ };
233
+ type HttpActionPropertyDecoratorResult = HttpActionFluidDecorator<ExtractClass<typeof HttpActionDecorator>, PropertyDecoratorFn> & DecoratorAndFetchSignature<typeof HttpActionDecorator, PropertyDecoratorFn>;
234
+ export declare const httpAction: HttpActionPropertyDecoratorResult;
235
+ type HttpMerge<U> = {
236
+ [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;
237
+ };
238
+ type MergedHttp<T extends any[]> = HttpMerge<Omit<UnionToIntersection<T[number]>, '_fetch' | 't'>>;
239
+ export type HttpDecorator = PropertyDecoratorFn & HttpActionFluidDecorator<HttpActionDecorator, PropertyDecoratorFn>;
240
+ export declare const http: MergedHttp<[typeof httpClass, typeof httpAction]>;
168
241
  export {};
242
+ export declare type __ΩHttpDecorator = any[];