@deepkit/http 1.0.1-alpha.100

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 (121) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +13 -0
  3. package/dist/.gitkeep +0 -0
  4. package/dist/cjs/index.d.ts +14 -0
  5. package/dist/cjs/index.js +31 -0
  6. package/dist/cjs/index.js.map +1 -0
  7. package/dist/cjs/src/controllers.d.ts +13 -0
  8. package/dist/cjs/src/controllers.js +17 -0
  9. package/dist/cjs/src/controllers.js.map +1 -0
  10. package/dist/cjs/src/decorator.d.ts +241 -0
  11. package/dist/cjs/src/decorator.js +422 -0
  12. package/dist/cjs/src/decorator.js.map +1 -0
  13. package/dist/cjs/src/filter.d.ts +49 -0
  14. package/dist/cjs/src/filter.js +215 -0
  15. package/dist/cjs/src/filter.js.map +1 -0
  16. package/dist/cjs/src/http-app.d.ts +8 -0
  17. package/dist/cjs/src/http-app.js +16 -0
  18. package/dist/cjs/src/http-app.js.map +1 -0
  19. package/dist/cjs/src/http.d.ts +278 -0
  20. package/dist/cjs/src/http.js +878 -0
  21. package/dist/cjs/src/http.js.map +1 -0
  22. package/dist/cjs/src/kernel.d.ts +16 -0
  23. package/dist/cjs/src/kernel.js +79 -0
  24. package/dist/cjs/src/kernel.js.map +1 -0
  25. package/dist/cjs/src/logger.d.ts +7 -0
  26. package/dist/cjs/src/logger.js +34 -0
  27. package/dist/cjs/src/logger.js.map +1 -0
  28. package/dist/cjs/src/middleware.d.ts +61 -0
  29. package/dist/cjs/src/middleware.js +95 -0
  30. package/dist/cjs/src/middleware.js.map +1 -0
  31. package/dist/cjs/src/model.d.ts +165 -0
  32. package/dist/cjs/src/model.js +398 -0
  33. package/dist/cjs/src/model.js.map +1 -0
  34. package/dist/cjs/src/module.config.d.ts +84 -0
  35. package/dist/cjs/src/module.config.js +14 -0
  36. package/dist/cjs/src/module.config.js.map +1 -0
  37. package/dist/cjs/src/module.d.ts +14 -0
  38. package/dist/cjs/src/module.js +124 -0
  39. package/dist/cjs/src/module.js.map +1 -0
  40. package/dist/cjs/src/request-parser.d.ts +36 -0
  41. package/dist/cjs/src/request-parser.js +305 -0
  42. package/dist/cjs/src/request-parser.js.map +1 -0
  43. package/dist/cjs/src/router.d.ts +230 -0
  44. package/dist/cjs/src/router.js +617 -0
  45. package/dist/cjs/src/router.js.map +1 -0
  46. package/dist/cjs/src/static-serving.d.ts +32 -0
  47. package/dist/cjs/src/static-serving.js +157 -0
  48. package/dist/cjs/src/static-serving.js.map +1 -0
  49. package/dist/cjs/src/utils.d.ts +1 -0
  50. package/dist/cjs/src/utils.js +13 -0
  51. package/dist/cjs/src/utils.js.map +1 -0
  52. package/dist/cjs/tsconfig.tsbuildinfo +1 -0
  53. package/dist/esm/index.d.ts +14 -0
  54. package/dist/esm/index.js +15 -0
  55. package/dist/esm/index.js.map +1 -0
  56. package/dist/esm/package.json +1 -0
  57. package/dist/esm/src/controllers.d.ts +13 -0
  58. package/dist/esm/src/controllers.js +13 -0
  59. package/dist/esm/src/controllers.js.map +1 -0
  60. package/dist/esm/src/decorator.d.ts +241 -0
  61. package/dist/esm/src/decorator.js +414 -0
  62. package/dist/esm/src/decorator.js.map +1 -0
  63. package/dist/esm/src/filter.d.ts +49 -0
  64. package/dist/esm/src/filter.js +209 -0
  65. package/dist/esm/src/filter.js.map +1 -0
  66. package/dist/esm/src/http-app.d.ts +8 -0
  67. package/dist/esm/src/http-app.js +12 -0
  68. package/dist/esm/src/http-app.js.map +1 -0
  69. package/dist/esm/src/http.d.ts +278 -0
  70. package/dist/esm/src/http.js +841 -0
  71. package/dist/esm/src/http.js.map +1 -0
  72. package/dist/esm/src/kernel.d.ts +16 -0
  73. package/dist/esm/src/kernel.js +75 -0
  74. package/dist/esm/src/kernel.js.map +1 -0
  75. package/dist/esm/src/logger.d.ts +7 -0
  76. package/dist/esm/src/logger.js +30 -0
  77. package/dist/esm/src/logger.js.map +1 -0
  78. package/dist/esm/src/middleware.d.ts +61 -0
  79. package/dist/esm/src/middleware.js +90 -0
  80. package/dist/esm/src/middleware.js.map +1 -0
  81. package/dist/esm/src/model.d.ts +165 -0
  82. package/dist/esm/src/model.js +363 -0
  83. package/dist/esm/src/model.js.map +1 -0
  84. package/dist/esm/src/module.config.d.ts +84 -0
  85. package/dist/esm/src/module.config.js +10 -0
  86. package/dist/esm/src/module.config.js.map +1 -0
  87. package/dist/esm/src/module.d.ts +14 -0
  88. package/dist/esm/src/module.js +120 -0
  89. package/dist/esm/src/module.js.map +1 -0
  90. package/dist/esm/src/request-parser.d.ts +36 -0
  91. package/dist/esm/src/request-parser.js +295 -0
  92. package/dist/esm/src/request-parser.js.map +1 -0
  93. package/dist/esm/src/router.d.ts +230 -0
  94. package/dist/esm/src/router.js +605 -0
  95. package/dist/esm/src/router.js.map +1 -0
  96. package/dist/esm/src/static-serving.d.ts +32 -0
  97. package/dist/esm/src/static-serving.js +149 -0
  98. package/dist/esm/src/static-serving.js.map +1 -0
  99. package/dist/esm/src/utils.d.ts +1 -0
  100. package/dist/esm/src/utils.js +9 -0
  101. package/dist/esm/src/utils.js.map +1 -0
  102. package/dist/esm/tsconfig.esm.tsbuildinfo +1 -0
  103. package/index.ts +14 -0
  104. package/package.json +67 -0
  105. package/src/controllers.ts +11 -0
  106. package/src/decorator.ts +411 -0
  107. package/src/filter.ts +224 -0
  108. package/src/http-app.ts +11 -0
  109. package/src/http.ts +828 -0
  110. package/src/kernel.ts +79 -0
  111. package/src/logger.ts +20 -0
  112. package/src/middleware.ts +116 -0
  113. package/src/model.ts +392 -0
  114. package/src/module.config.ts +95 -0
  115. package/src/module.ts +116 -0
  116. package/src/request-parser.ts +346 -0
  117. package/src/router.ts +747 -0
  118. package/src/static-serving.ts +153 -0
  119. package/src/utils.ts +5 -0
  120. package/tsconfig.esm.json +36 -0
  121. package/tsconfig.json +53 -0
@@ -0,0 +1,241 @@
1
+ import { ClassType } from '@deepkit/core';
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
+ declare type HttpActionMiddleware = (() => HttpMiddlewareConfig) | ClassType<HttpMiddleware> | HttpMiddlewareFn;
6
+ export declare class HttpController {
7
+ baseUrl: string;
8
+ actions: Set<HttpAction>;
9
+ groups: string[];
10
+ middlewares: (() => HttpMiddlewareConfig)[];
11
+ resolverForToken: Map<any, ClassType>;
12
+ resolverForParameterName: Map<string, ClassType>;
13
+ private actionsProcessed;
14
+ getUrl(action: HttpAction): string;
15
+ addAction(action: HttpAction): void;
16
+ getActions(): Set<HttpAction>;
17
+ removeAction(methodName: string): void;
18
+ getAction(methodName: string): HttpAction;
19
+ }
20
+ export declare class HttpActionParameter {
21
+ name: string;
22
+ type?: 'body' | 'query' | 'queries';
23
+ /**
24
+ * undefined = propertyName, '' === root, else given path
25
+ */
26
+ typePath?: string;
27
+ optional: boolean;
28
+ }
29
+ export declare class HttpAction {
30
+ name: string;
31
+ description: string;
32
+ category: string;
33
+ path: string;
34
+ httpMethods: string[];
35
+ methodName: string;
36
+ groups: string[];
37
+ serializer?: Serializer;
38
+ middlewares: (() => HttpMiddlewareConfig)[];
39
+ serializationOptions?: SerializationOptions;
40
+ resolverForToken: Map<any, ClassType>;
41
+ resolverForParameterName: Map<string, ClassType>;
42
+ /**
43
+ * An arbitrary data container the user can use to store app specific settings/values.
44
+ */
45
+ data: Map<any, any>;
46
+ responses: {
47
+ statusCode: number;
48
+ description: string;
49
+ type?: Type;
50
+ }[];
51
+ }
52
+ export declare class HttpControllerDecorator {
53
+ t: HttpController;
54
+ controller(baseUrl?: 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;
103
+ setAction(action: HttpAction): void;
104
+ }
105
+ export declare const httpClass: ClassDecoratorResult<typeof HttpControllerDecorator>;
106
+ export declare class HttpActionDecorator {
107
+ t: HttpAction;
108
+ onDecorator(target: ClassType, property: string | undefined, parameterIndexOrDescriptor?: any): void;
109
+ name(name: string): void;
110
+ description(description: string): void;
111
+ serialization(options: SerializationOptions): void;
112
+ serializer(serializer: Serializer): void;
113
+ middleware(...middlewares: HttpActionMiddleware[]): void;
114
+ /**
115
+ * Allows to change the HttpAction object and composite multiple properties into one function.
116
+ *
117
+ * @example
118
+ * ```typescript
119
+ * const authGroup = Symbol('authGroup');
120
+ *
121
+ * function authGroup(group: 'admin' | 'user') {
122
+ * return (action: HttpAction) => {
123
+ * action.data.set(authGroup, group);
124
+ * };
125
+ * }
126
+ *
127
+ * class My Controller {
128
+ * @http.GET('/assets').use(authGroup('admin'))
129
+ * assets() {}
130
+ * }
131
+ * ```
132
+ */
133
+ use(use: (action: HttpAction) => void): void;
134
+ /**
135
+ * Arbitrary value container that can be read in RouterParameterResolver and all
136
+ * HTTP workflow events (like authentication).
137
+ *
138
+ * @example
139
+ * ```typescript
140
+ * class My Controller {
141
+ * @http.GET('/assets').data('authGroup', 'admin')
142
+ * assets() {}
143
+ * }
144
+ * ```
145
+ */
146
+ data(name: string, value: any): void;
147
+ category(category: string): void;
148
+ group(...group: string[]): void;
149
+ GET(path?: string): void;
150
+ HEAD(path?: string): void;
151
+ POST(path?: string): void;
152
+ PUT(path?: string): void;
153
+ DELETE(path?: string): void;
154
+ OPTIONS(path?: string): void;
155
+ TRACE(path?: string): void;
156
+ PATCH(path?: string): void;
157
+ ANY(path?: string): void;
158
+ /**
159
+ * Adds additional information about what HTTP status codes are available in this route.
160
+ * You can add additionally a description and a response body type.
161
+ *
162
+ * The type is used for serialization for responses with the given statusCode.
163
+ *
164
+ * This information is available in Deepkit API console.
165
+ *
166
+ * ```typescript
167
+ *
168
+ * http.GET().response<boolean>(200, 'All ok')
169
+ *
170
+ * interface User {
171
+ * username: string;
172
+ * }
173
+ * http.GET().response<User>(200, 'User object')
174
+ *
175
+ * interface HttpErrorMessage {
176
+ * error: string;
177
+ * }
178
+ * http.GET().response<HttpErrorMessage>(500, 'Error')
179
+ * ```
180
+ */
181
+ response<T>(statusCode: number, description?: string, type?: ReceiveType<T>): void;
182
+ /**
183
+ * Adds a parameter resolver for parameters based on the class type. Use .resolveParameterByName() for name-based resolving.
184
+ *
185
+ * ```typescript
186
+ *
187
+ * class UserResolver {
188
+ * resolve(context: RouteParameterResolverContext): any | Promise<any> {
189
+ * return new User();
190
+ * }
191
+ * }
192
+ *
193
+ * class MyController {
194
+ * @http.GET()
195
+ * @http.resolveParameter(User, UserResolver)
196
+ * myAction(user: User) {
197
+ * }
198
+ * }
199
+ *
200
+ * new App({providers: [UserResolver]}).run();
201
+ * ```
202
+ */
203
+ resolveParameter(classType: ClassType | string | any, resolver: ClassType<RouteParameterResolver>): void;
204
+ /**
205
+ * Adds a parameter resolver for parameters based on its name. Use .resolveParameter() for class-based resolving.
206
+ *
207
+ * ```typescript
208
+ *
209
+ * class UserResolver {
210
+ * resolve(context: RouteParameterResolverContext): any | Promise<any> {
211
+ * return new User();
212
+ * }
213
+ * }
214
+ *
215
+ * class MyController {
216
+ * @http.GET()
217
+ * @http.resolveParameterByName('user', UserResolver)
218
+ * myAction(user: User) {
219
+ * }
220
+ * }
221
+ *
222
+ * new App({providers: [UserResolver]}).run();
223
+ * ```
224
+ */
225
+ resolveParameterByName(name: string, resolver: ClassType<RouteParameterResolver>): void;
226
+ }
227
+ declare type HttpActionFluidDecorator<T, D extends Function> = {
228
+ [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> & {
229
+ _data: ExtractApiDataType<T>;
230
+ };
231
+ };
232
+ declare type HttpActionPropertyDecoratorResult = HttpActionFluidDecorator<ExtractClass<typeof HttpActionDecorator>, PropertyDecoratorFn> & DecoratorAndFetchSignature<typeof HttpActionDecorator, PropertyDecoratorFn>;
233
+ export declare const httpAction: HttpActionPropertyDecoratorResult;
234
+ declare type HttpMerge<U> = {
235
+ [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;
236
+ };
237
+ declare type MergedHttp<T extends any[]> = HttpMerge<Omit<UnionToIntersection<T[number]>, '_fetch' | 't'>>;
238
+ export declare type HttpDecorator = PropertyDecoratorFn & HttpActionFluidDecorator<HttpActionDecorator, PropertyDecoratorFn>;
239
+ export declare const http: MergedHttp<[typeof httpClass, typeof httpAction]>;
240
+ export {};
241
+ export declare type __ΩHttpDecorator = any[];
@@ -0,0 +1,414 @@
1
+ /*@ts-ignore*/
2
+ import { __ΩClassType as __ΩClassType } from '@deepkit/core';
3
+ /*@ts-ignore*/
4
+ import { __ΩSerializationOptions as __ΩSerializationOptions } from '@deepkit/type';
5
+ /*@ts-ignore*/
6
+ import { __ΩRouteParameterResolver as __ΩRouteParameterResolver } from './router.js';
7
+ /*@ts-ignore*/
8
+ import { __ΩReceiveType as __ΩReceiveType } from '@deepkit/type';
9
+ /*@ts-ignore*/
10
+ import { __ΩHttpMiddleware as __ΩHttpMiddleware } from './middleware.js';
11
+ /*@ts-ignore*/
12
+ import { __ΩHttpMiddlewareFn as __ΩHttpMiddlewareFn } from './middleware.js';
13
+ /*@ts-ignore*/
14
+ import { __ΩExtractApiDataType as __ΩExtractApiDataType } from '@deepkit/type';
15
+ /*@ts-ignore*/
16
+ import { __ΩExtractClass as __ΩExtractClass } from '@deepkit/type';
17
+ /*@ts-ignore*/
18
+ import { __ΩPropertyDecoratorFn as __ΩPropertyDecoratorFn } from '@deepkit/type';
19
+ /*@ts-ignore*/
20
+ import { __ΩDecoratorAndFetchSignature as __ΩDecoratorAndFetchSignature } from '@deepkit/type';
21
+ /*@ts-ignore*/
22
+ import { __ΩDualDecorator as __ΩDualDecorator } from '@deepkit/type';
23
+ /*@ts-ignore*/
24
+ import { __ΩUnionToIntersection as __ΩUnionToIntersection } from '@deepkit/type';
25
+ function __assignType(fn, args) {
26
+ fn.__type = args;
27
+ return fn;
28
+ }
29
+ const __ΩPick = ['T', 'K', 'l+e#!e"!fRb!b"Pde""N#!'];
30
+ const __ΩExclude = ['T', 'U', 'l6!Re$!RPe#!e$"qk#%QRb!b"Pde"!p)'];
31
+ const __ΩOmit = ['T', 'K', () => __ΩPick, () => __ΩExclude, 'b!b"e!!e!!ge!"o$#o##'];
32
+ /*
33
+ * Deepkit Framework
34
+ * Copyright (C) 2021 Deepkit UG, Marc J. Schmidt
35
+ *
36
+ * This program is free software: you can redistribute it and/or modify
37
+ * it under the terms of the MIT License.
38
+ *
39
+ * You should have received a copy of the MIT License along with this program.
40
+ */
41
+ import { isClass, urlJoin } from '@deepkit/core';
42
+ import { createClassDecoratorContext, createPropertyDecoratorContext, isDecoratorContext, mergeDecorator, resolveReceiveType, Serializer } from '@deepkit/type';
43
+ import { httpMiddleware, HttpMiddlewareConfig } from './middleware.js';
44
+ const __ΩHttpActionMiddleware = [() => HttpMiddlewareConfig, '', () => __ΩClassType, () => __ΩHttpMiddleware, () => __ΩHttpMiddlewareFn, 'PPP7!/"n$o#"n%J'];
45
+ function isMiddlewareClassTypeOrFn(v) {
46
+ return isClass(v) || !isDecoratorContext(httpMiddleware, v);
47
+ }
48
+ isMiddlewareClassTypeOrFn.__type = [() => __ΩHttpActionMiddleware, 'v', 'isMiddlewareClassTypeOrFn', 'Pn!2"!/#'];
49
+ export class HttpController {
50
+ constructor() {
51
+ this.baseUrl = '';
52
+ this.actions = (Set.Ω = [[() => HttpAction, 'P7!']], new Set());
53
+ this.groups = [];
54
+ this.middlewares = [];
55
+ this.resolverForToken = new Map();
56
+ this.resolverForParameterName = new Map();
57
+ this.actionsProcessed = (Set.Ω = [[() => HttpAction, 'P7!']], new Set());
58
+ }
59
+ getUrl(action) {
60
+ return urlJoin('/', this.baseUrl, action.path);
61
+ }
62
+ addAction(action) {
63
+ this.actions.add(action);
64
+ }
65
+ getActions() {
66
+ for (const action of this.actions) {
67
+ if (!this.actionsProcessed.has(action)) {
68
+ action.groups = [
69
+ ...this.groups,
70
+ ...action.groups.filter(__assignType((g) => !this.groups.includes(g), ['g', '', 'P"2!"/"'])),
71
+ ];
72
+ this.actionsProcessed.add(action);
73
+ }
74
+ }
75
+ return this.actions;
76
+ }
77
+ removeAction(methodName) {
78
+ const action = this.getAction(methodName);
79
+ this.actions.delete(action);
80
+ this.actionsProcessed.delete(action);
81
+ }
82
+ getAction(methodName) {
83
+ for (const a of this.getActions()) {
84
+ if (a.methodName === methodName)
85
+ return a;
86
+ }
87
+ throw new Error(`No action with methodName ${methodName} found`);
88
+ }
89
+ }
90
+ HttpController.__type = ['baseUrl', function () { return ''; }, 'groups', function () { return []; }, () => 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'];
91
+ export class HttpActionParameter {
92
+ constructor() {
93
+ this.name = '';
94
+ this.optional = false;
95
+ }
96
+ }
97
+ HttpActionParameter.__type = ['name', function () { return ''; }, "body", "query", "queries", 'type', 'typePath', 'optional', function () { return false; }, '&3!>"P.#.$.%J3&8&3\'8)3(>)5'];
98
+ export class HttpAction {
99
+ constructor() {
100
+ this.name = '';
101
+ this.description = '';
102
+ this.category = '';
103
+ this.path = '';
104
+ this.httpMethods = [];
105
+ this.methodName = '';
106
+ this.groups = [];
107
+ this.middlewares = [];
108
+ this.resolverForToken = new Map();
109
+ this.resolverForParameterName = new Map();
110
+ /**
111
+ * An arbitrary data container the user can use to store app specific settings/values.
112
+ */
113
+ this.data = (Map.Ω = [['"'], ['"']], new Map());
114
+ this.responses = [];
115
+ }
116
+ }
117
+ HttpAction.__type = ['name', function () { return ''; }, 'description', function () { return ''; }, 'category', function () { return ''; }, 'path', function () { return ''; }, 'httpMethods', function () { return []; }, 'methodName', function () { return ''; }, 'groups', function () { return []; }, () => Serializer, 'serializer', () => 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'];
118
+ export class HttpControllerDecorator {
119
+ constructor() {
120
+ this.t = new HttpController;
121
+ }
122
+ controller(baseUrl = '') {
123
+ this.t.baseUrl = baseUrl;
124
+ }
125
+ group(...group) {
126
+ this.t.groups.push(...group);
127
+ }
128
+ middleware(...middlewares) {
129
+ this.t.middlewares.push(...middlewares.map(__assignType(v => isMiddlewareClassTypeOrFn(v) ? httpMiddleware.for(v) : v, ['v', '', 'P"2!"/"'])));
130
+ }
131
+ /**
132
+ * Adds a parameter resolver for parameters based on the class type. Use .resolveParameterByName() for name-based resolving.
133
+ *
134
+ * ```typescript
135
+ *
136
+ * class UserResolver {
137
+ * resolve(context: RouteParameterResolverContext): any | Promise<any> {
138
+ * return new User();
139
+ * }
140
+ * }
141
+ *
142
+ * @http.resolveParameter(User, UserResolver)
143
+ * class MyController {
144
+ *
145
+ * @http.GET()
146
+ * myAction(user: User) {
147
+ * }
148
+ * }
149
+ *
150
+ * new App({providers: [UserResolver]}).run();
151
+ * ```
152
+ */
153
+ resolveParameter(classType, resolver) {
154
+ this.t.resolverForToken.set(classType, resolver);
155
+ }
156
+ /**
157
+ * Adds a parameter resolver for parameters based on its name. Use .resolveParameter() for class-based resolving.
158
+ *
159
+ * ```typescript
160
+ *
161
+ * class UserResolver {
162
+ * resolve(context: RouteParameterResolverContext): any | Promise<any> {
163
+ * return new User();
164
+ * }
165
+ * }
166
+ *
167
+ * @http.resolveParameterByName('user', UserResolver)
168
+ * class MyController {
169
+ *
170
+ * @http.GET()
171
+ * myAction(user: User) {
172
+ * }
173
+ * }
174
+ *
175
+ * new App({providers: [UserResolver]}).run();
176
+ * ```
177
+ */
178
+ resolveParameterByName(name, resolver) {
179
+ this.t.resolverForParameterName.set(name, resolver);
180
+ }
181
+ setAction(action) {
182
+ this.t.addAction(action);
183
+ }
184
+ }
185
+ HttpControllerDecorator.__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'];
186
+ export const httpClass = createClassDecoratorContext(HttpControllerDecorator);
187
+ export class HttpActionDecorator {
188
+ constructor() {
189
+ this.t = new HttpAction;
190
+ }
191
+ onDecorator(target, property, parameterIndexOrDescriptor) {
192
+ if (!property)
193
+ return;
194
+ if (target === Object)
195
+ return;
196
+ this.t.methodName = property;
197
+ httpClass.setAction(this.t)(target);
198
+ }
199
+ name(name) {
200
+ this.t.name = name;
201
+ }
202
+ description(description) {
203
+ this.t.description = description;
204
+ }
205
+ serialization(options) {
206
+ this.t.serializationOptions = options;
207
+ }
208
+ serializer(serializer) {
209
+ this.t.serializer = serializer;
210
+ }
211
+ middleware(...middlewares) {
212
+ this.t.middlewares.push(...middlewares.map(__assignType(v => isMiddlewareClassTypeOrFn(v) ? httpMiddleware.for(v) : v, ['v', '', 'P"2!"/"'])));
213
+ }
214
+ /**
215
+ * Allows to change the HttpAction object and composite multiple properties into one function.
216
+ *
217
+ * @example
218
+ * ```typescript
219
+ * const authGroup = Symbol('authGroup');
220
+ *
221
+ * function authGroup(group: 'admin' | 'user') {
222
+ * return (action: HttpAction) => {
223
+ * action.data.set(authGroup, group);
224
+ * };
225
+ * }
226
+ *
227
+ * class My Controller {
228
+ * @http.GET('/assets').use(authGroup('admin'))
229
+ * assets() {}
230
+ * }
231
+ * ```
232
+ */
233
+ use(use) {
234
+ use(this.t);
235
+ }
236
+ /**
237
+ * Arbitrary value container that can be read in RouterParameterResolver and all
238
+ * HTTP workflow events (like authentication).
239
+ *
240
+ * @example
241
+ * ```typescript
242
+ * class My Controller {
243
+ * @http.GET('/assets').data('authGroup', 'admin')
244
+ * assets() {}
245
+ * }
246
+ * ```
247
+ */
248
+ data(name, value) {
249
+ this.t.data.set(name, value);
250
+ }
251
+ category(category) {
252
+ this.t.category = category;
253
+ }
254
+ group(...group) {
255
+ this.t.groups.push(...group);
256
+ }
257
+ GET(path = '') {
258
+ this.t.httpMethods.push('GET');
259
+ if (path)
260
+ this.t.path = path;
261
+ }
262
+ HEAD(path = '') {
263
+ this.t.httpMethods.push('HEAD');
264
+ if (path)
265
+ this.t.path = path;
266
+ }
267
+ POST(path = '') {
268
+ this.t.httpMethods.push('POST');
269
+ if (path)
270
+ this.t.path = path;
271
+ }
272
+ PUT(path = '') {
273
+ this.t.httpMethods.push('PUT');
274
+ if (path)
275
+ this.t.path = path;
276
+ }
277
+ DELETE(path = '') {
278
+ this.t.httpMethods.push('DELETE');
279
+ if (path)
280
+ this.t.path = path;
281
+ }
282
+ OPTIONS(path = '') {
283
+ this.t.httpMethods.push('OPTIONS');
284
+ if (path)
285
+ this.t.path = path;
286
+ }
287
+ TRACE(path = '') {
288
+ this.t.httpMethods.push('TRACE');
289
+ if (path)
290
+ this.t.path = path;
291
+ }
292
+ PATCH(path = '') {
293
+ this.t.httpMethods.push('PATCH');
294
+ if (path)
295
+ this.t.path = path;
296
+ }
297
+ ANY(path = '') {
298
+ this.t.httpMethods = [];
299
+ if (path)
300
+ this.t.path = path;
301
+ }
302
+ /**
303
+ * Adds additional information about what HTTP status codes are available in this route.
304
+ * You can add additionally a description and a response body type.
305
+ *
306
+ * The type is used for serialization for responses with the given statusCode.
307
+ *
308
+ * This information is available in Deepkit API console.
309
+ *
310
+ * ```typescript
311
+ *
312
+ * http.GET().response<boolean>(200, 'All ok')
313
+ *
314
+ * interface User {
315
+ * username: string;
316
+ * }
317
+ * http.GET().response<User>(200, 'User object')
318
+ *
319
+ * interface HttpErrorMessage {
320
+ * error: string;
321
+ * }
322
+ * http.GET().response<HttpErrorMessage>(500, 'Error')
323
+ * ```
324
+ */
325
+ response(statusCode, description, type) {
326
+ var _a;
327
+ if (description === void 0) { description = ''; }
328
+ if (type === void 0) { type = (_a = this.
329
+ /**
330
+ * Adds additional information about what HTTP status codes are available in this route.
331
+ * You can add additionally a description and a response body type.
332
+ *
333
+ * The type is used for serialization for responses with the given statusCode.
334
+ *
335
+ * This information is available in Deepkit API console.
336
+ *
337
+ * ```typescript
338
+ *
339
+ * http.GET().response<boolean>(200, 'All ok')
340
+ *
341
+ * interface User {
342
+ * username: string;
343
+ * }
344
+ * http.GET().response<User>(200, 'User object')
345
+ *
346
+ * interface HttpErrorMessage {
347
+ * error: string;
348
+ * }
349
+ * http.GET().response<HttpErrorMessage>(500, 'Error')
350
+ * ```
351
+ */
352
+ response.Ω) === null || _a === void 0 ? void 0 : _a[0]; }
353
+ this.response.Ω = undefined;
354
+ this.t.responses.push({ statusCode, description, type: type ? resolveReceiveType(type) : undefined });
355
+ }
356
+ /**
357
+ * Adds a parameter resolver for parameters based on the class type. Use .resolveParameterByName() for name-based resolving.
358
+ *
359
+ * ```typescript
360
+ *
361
+ * class UserResolver {
362
+ * resolve(context: RouteParameterResolverContext): any | Promise<any> {
363
+ * return new User();
364
+ * }
365
+ * }
366
+ *
367
+ * class MyController {
368
+ * @http.GET()
369
+ * @http.resolveParameter(User, UserResolver)
370
+ * myAction(user: User) {
371
+ * }
372
+ * }
373
+ *
374
+ * new App({providers: [UserResolver]}).run();
375
+ * ```
376
+ */
377
+ resolveParameter(classType, resolver) {
378
+ this.t.resolverForToken.set(classType, resolver);
379
+ }
380
+ /**
381
+ * Adds a parameter resolver for parameters based on its name. Use .resolveParameter() for class-based resolving.
382
+ *
383
+ * ```typescript
384
+ *
385
+ * class UserResolver {
386
+ * resolve(context: RouteParameterResolverContext): any | Promise<any> {
387
+ * return new User();
388
+ * }
389
+ * }
390
+ *
391
+ * class MyController {
392
+ * @http.GET()
393
+ * @http.resolveParameterByName('user', UserResolver)
394
+ * myAction(user: User) {
395
+ * }
396
+ * }
397
+ *
398
+ * new App({providers: [UserResolver]}).run();
399
+ * ```
400
+ */
401
+ resolveParameterByName(name, resolver) {
402
+ this.t.resolverForParameterName.set(name, resolver);
403
+ }
404
+ }
405
+ HttpActionDecorator.__type = [() => __ΩClassType, 'target', 'property', 'parameterIndexOrDescriptor', 'onDecorator', 'name', 'description', () => __ΩSerializationOptions, 'options', 'serialization', () => 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'];
406
+ const __ΩHttpActionFluidDecorator = ['T', 'D', "response", 'statusCode', 'description', () => __ΩReceiveType, 'type', () => __ΩHttpActionFluidDecorator, '', 'args', () => __ΩHttpActionFluidDecorator, () => __ΩHttpActionFluidDecorator, () => __Ω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!'];
407
+ const __ΩHttpActionPropertyDecoratorResult = [() => __ΩHttpActionFluidDecorator, () => __ΩExtractClass, () => HttpActionDecorator, () => __ΩPropertyDecoratorFn, () => __ΩDecoratorAndFetchSignature, () => HttpActionDecorator, () => __ΩPropertyDecoratorFn, 'Pi#o""n$o!#i&n\'o%#K'];
408
+ export const httpAction = createPropertyDecoratorContext(HttpActionDecorator);
409
+ const __Ω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!'];
410
+ const __ΩMergedHttp = ['T', () => __ΩHttpMerge, () => __ΩOmit, () => __ΩUnionToIntersection, "_fetch", "t", 'b!e!!\'fo$"P.%.&Jo##o""'];
411
+ const __ΩHttpDecorator = [() => __ΩPropertyDecoratorFn, () => __ΩHttpActionFluidDecorator, () => HttpActionDecorator, () => __ΩPropertyDecoratorFn, 'Pn!P7#n$o"#K'];
412
+ export { __ΩHttpDecorator as __ΩHttpDecorator };
413
+ export const http = mergeDecorator(httpClass, httpAction);
414
+ //# sourceMappingURL=decorator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"decorator.js","sourceRoot":"","sources":["../../../src/decorator.ts"],"names":[],"mappings":";6CAU4C,eAAe;;mEAkBpD,eAAe;;uEACiB,aAAa;;iDAD7C,eAAe;;uDAEiE,iBAAiB;;2DAAjB,iBAAiB;;+DAFjG,eAAe;;mDAAf,eAAe;;iEAAf,eAAe;;+EAAf,eAAe;;qDAAf,eAAe;;iEAAf,eAAe;;;;;;;;AA5BtB;;;;;;;;GAQG;A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