@hono-di/core 0.0.6

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.
@@ -0,0 +1,345 @@
1
+ 'use strict';
2
+
3
+ require('reflect-metadata');
4
+
5
+ // src/decorators.ts
6
+
7
+ // src/constants.ts
8
+ var METADATA_KEYS = {
9
+ MODULE: /* @__PURE__ */ Symbol("module"),
10
+ GLOBAL: /* @__PURE__ */ Symbol("global"),
11
+ CONTROLLER: /* @__PURE__ */ Symbol("controller"),
12
+ ROUTES: /* @__PURE__ */ Symbol("routes"),
13
+ FILTER_CATCH: /* @__PURE__ */ Symbol("filter_catch"),
14
+ USE_FILTERS: /* @__PURE__ */ Symbol("use_filters"),
15
+ USE_PIPES: /* @__PURE__ */ Symbol("use_pipes"),
16
+ USE_GUARDS: /* @__PURE__ */ Symbol("use_guards"),
17
+ USE_INTERCEPTORS: /* @__PURE__ */ Symbol("use_interceptors"),
18
+ ROUTE_ARGS_METADATA: /* @__PURE__ */ Symbol("route_args_metadata"),
19
+ INJECTIONS: /* @__PURE__ */ Symbol("injections"),
20
+ OPTIONAL: /* @__PURE__ */ Symbol("optional"),
21
+ SCOPE: /* @__PURE__ */ Symbol("scope"),
22
+ PROPERTY_DEPS: /* @__PURE__ */ Symbol("property_deps"),
23
+ HTTP_CODE: /* @__PURE__ */ Symbol("http_code"),
24
+ HEADERS: /* @__PURE__ */ Symbol("headers"),
25
+ REDIRECT: /* @__PURE__ */ Symbol("redirect")
26
+ };
27
+
28
+ // src/injector/scope.ts
29
+ var Scope = /* @__PURE__ */ ((Scope2) => {
30
+ Scope2[Scope2["DEFAULT"] = 0] = "DEFAULT";
31
+ Scope2[Scope2["TRANSIENT"] = 1] = "TRANSIENT";
32
+ Scope2[Scope2["REQUEST"] = 2] = "REQUEST";
33
+ return Scope2;
34
+ })(Scope || {});
35
+
36
+ // src/interfaces.ts
37
+ var RequestMethod = /* @__PURE__ */ ((RequestMethod2) => {
38
+ RequestMethod2["GET"] = "get";
39
+ RequestMethod2["POST"] = "post";
40
+ RequestMethod2["PUT"] = "put";
41
+ RequestMethod2["DELETE"] = "delete";
42
+ RequestMethod2["PATCH"] = "patch";
43
+ RequestMethod2["ALL"] = "all";
44
+ RequestMethod2["OPTIONS"] = "options";
45
+ RequestMethod2["HEAD"] = "head";
46
+ return RequestMethod2;
47
+ })(RequestMethod || {});
48
+
49
+ // src/decorators.ts
50
+ function Global() {
51
+ return (target) => {
52
+ Reflect.defineMetadata(METADATA_KEYS.GLOBAL, true, target);
53
+ };
54
+ }
55
+ function Module(options) {
56
+ return (target) => {
57
+ Reflect.defineMetadata(METADATA_KEYS.MODULE, options, target);
58
+ };
59
+ }
60
+ function Injectable(options) {
61
+ return (target) => {
62
+ Reflect.defineMetadata(METADATA_KEYS.SCOPE, options?.scope ?? 0 /* DEFAULT */, target);
63
+ };
64
+ }
65
+ function Controller(prefix = "") {
66
+ return (target) => {
67
+ Reflect.defineMetadata(METADATA_KEYS.CONTROLLER, { prefix }, target);
68
+ Reflect.defineMetadata(METADATA_KEYS.SCOPE, 0 /* DEFAULT */, target);
69
+ };
70
+ }
71
+ function createRouteDecorator(method) {
72
+ return (path = "/") => {
73
+ return (target, propertyKey, descriptor) => {
74
+ if (!Reflect.hasMetadata(METADATA_KEYS.ROUTES, target.constructor)) {
75
+ Reflect.defineMetadata(METADATA_KEYS.ROUTES, [], target.constructor);
76
+ }
77
+ const routes = Reflect.getMetadata(METADATA_KEYS.ROUTES, target.constructor);
78
+ routes.push({
79
+ requestMethod: method,
80
+ path,
81
+ methodName: propertyKey
82
+ });
83
+ Reflect.defineMetadata(METADATA_KEYS.ROUTES, routes, target.constructor);
84
+ };
85
+ };
86
+ }
87
+ var Get = createRouteDecorator("get" /* GET */);
88
+ var Post = createRouteDecorator("post" /* POST */);
89
+ var Put = createRouteDecorator("put" /* PUT */);
90
+ var Delete = createRouteDecorator("delete" /* DELETE */);
91
+ var Patch = createRouteDecorator("patch" /* PATCH */);
92
+ var Options = createRouteDecorator("options" /* OPTIONS */);
93
+ var Head = createRouteDecorator("head" /* HEAD */);
94
+ var All = createRouteDecorator("all" /* ALL */);
95
+ function Catch(...exceptions) {
96
+ return (target) => {
97
+ Reflect.defineMetadata(METADATA_KEYS.FILTER_CATCH, exceptions, target);
98
+ Reflect.defineMetadata(METADATA_KEYS.SCOPE, 0 /* DEFAULT */, target);
99
+ };
100
+ }
101
+ function UseFilters(...filters) {
102
+ return (target, propertyKey, descriptor) => {
103
+ if (descriptor) {
104
+ Reflect.defineMetadata(METADATA_KEYS.USE_FILTERS, filters, descriptor.value);
105
+ return descriptor;
106
+ }
107
+ Reflect.defineMetadata(METADATA_KEYS.USE_FILTERS, filters, target);
108
+ return target;
109
+ };
110
+ }
111
+ function Inject(token) {
112
+ return (target, propertyKey, parameterIndex) => {
113
+ if (parameterIndex !== void 0) {
114
+ const injections = Reflect.getMetadata(METADATA_KEYS.INJECTIONS, target) || [];
115
+ injections[parameterIndex] = token;
116
+ Reflect.defineMetadata(METADATA_KEYS.INJECTIONS, injections, target);
117
+ } else {
118
+ const properties = Reflect.getMetadata(METADATA_KEYS.PROPERTY_DEPS, target.constructor) || [];
119
+ properties.push({ key: propertyKey, token });
120
+ Reflect.defineMetadata(METADATA_KEYS.PROPERTY_DEPS, properties, target.constructor);
121
+ }
122
+ };
123
+ }
124
+ function Optional() {
125
+ return (target, propertyKey, parameterIndex) => {
126
+ if (parameterIndex !== void 0) {
127
+ const optionals = Reflect.getMetadata(METADATA_KEYS.OPTIONAL, target) || [];
128
+ optionals[parameterIndex] = true;
129
+ Reflect.defineMetadata(METADATA_KEYS.OPTIONAL, optionals, target);
130
+ } else {
131
+ const optionalProps = Reflect.getMetadata(METADATA_KEYS.OPTIONAL, target.constructor) || [];
132
+ optionalProps.push(propertyKey);
133
+ Reflect.defineMetadata(METADATA_KEYS.OPTIONAL, optionalProps, target.constructor);
134
+ }
135
+ };
136
+ }
137
+ function UseGuards(...guards) {
138
+ return (target, propertyKey, descriptor) => {
139
+ if (descriptor) {
140
+ Reflect.defineMetadata(METADATA_KEYS.USE_GUARDS, guards, descriptor.value);
141
+ return descriptor;
142
+ }
143
+ Reflect.defineMetadata(METADATA_KEYS.USE_GUARDS, guards, target);
144
+ return target;
145
+ };
146
+ }
147
+ function UseInterceptors(...interceptors) {
148
+ return (target, propertyKey, descriptor) => {
149
+ if (descriptor) {
150
+ Reflect.defineMetadata(METADATA_KEYS.USE_INTERCEPTORS, interceptors, descriptor.value);
151
+ return descriptor;
152
+ }
153
+ Reflect.defineMetadata(METADATA_KEYS.USE_INTERCEPTORS, interceptors, target);
154
+ return target;
155
+ };
156
+ }
157
+ function UsePipes(...pipes) {
158
+ return (target, propertyKey, descriptor) => {
159
+ if (descriptor) {
160
+ Reflect.defineMetadata(METADATA_KEYS.USE_PIPES, pipes, descriptor.value);
161
+ return descriptor;
162
+ }
163
+ Reflect.defineMetadata(METADATA_KEYS.USE_PIPES, pipes, target);
164
+ return target;
165
+ };
166
+ }
167
+ var RouteParamtypes = /* @__PURE__ */ ((RouteParamtypes2) => {
168
+ RouteParamtypes2[RouteParamtypes2["REQUEST"] = 0] = "REQUEST";
169
+ RouteParamtypes2[RouteParamtypes2["RESPONSE"] = 1] = "RESPONSE";
170
+ RouteParamtypes2[RouteParamtypes2["NEXT"] = 2] = "NEXT";
171
+ RouteParamtypes2[RouteParamtypes2["BODY"] = 3] = "BODY";
172
+ RouteParamtypes2[RouteParamtypes2["QUERY"] = 4] = "QUERY";
173
+ RouteParamtypes2[RouteParamtypes2["PARAM"] = 5] = "PARAM";
174
+ RouteParamtypes2[RouteParamtypes2["HEADERS"] = 6] = "HEADERS";
175
+ RouteParamtypes2[RouteParamtypes2["SESSION"] = 7] = "SESSION";
176
+ RouteParamtypes2[RouteParamtypes2["FILE"] = 8] = "FILE";
177
+ RouteParamtypes2[RouteParamtypes2["FILES"] = 9] = "FILES";
178
+ RouteParamtypes2[RouteParamtypes2["HOST"] = 10] = "HOST";
179
+ RouteParamtypes2[RouteParamtypes2["IP"] = 11] = "IP";
180
+ RouteParamtypes2[RouteParamtypes2["CONTEXT"] = 12] = "CONTEXT";
181
+ RouteParamtypes2[RouteParamtypes2["CUSTOM"] = 13] = "CUSTOM";
182
+ return RouteParamtypes2;
183
+ })(RouteParamtypes || {});
184
+ function assignMetadata(args, paramtype, index, data, ...pipes) {
185
+ return {
186
+ ...args,
187
+ [`${paramtype}:${index}`]: {
188
+ index,
189
+ data,
190
+ pipes,
191
+ paramtype
192
+ }
193
+ };
194
+ }
195
+ function createRouteParamDecorator(paramtype) {
196
+ return (data) => {
197
+ return (target, key, index) => {
198
+ const args = Reflect.getMetadata(METADATA_KEYS.ROUTE_ARGS_METADATA, target.constructor, key) || {};
199
+ Reflect.defineMetadata(
200
+ METADATA_KEYS.ROUTE_ARGS_METADATA,
201
+ assignMetadata(args, paramtype, index, data),
202
+ target.constructor,
203
+ key
204
+ );
205
+ };
206
+ };
207
+ }
208
+ function createPipesRouteParamDecorator(paramtype) {
209
+ return (data, ...pipes) => {
210
+ return (target, key, index) => {
211
+ const args = Reflect.getMetadata(METADATA_KEYS.ROUTE_ARGS_METADATA, target.constructor, key) || {};
212
+ Reflect.defineMetadata(
213
+ METADATA_KEYS.ROUTE_ARGS_METADATA,
214
+ assignMetadata(args, paramtype, index, data, ...pipes),
215
+ target.constructor,
216
+ key
217
+ );
218
+ };
219
+ };
220
+ }
221
+ var Request = createRouteParamDecorator(0 /* REQUEST */);
222
+ var Response = createRouteParamDecorator(1 /* RESPONSE */);
223
+ var Next = createRouteParamDecorator(2 /* NEXT */);
224
+ var Session = createRouteParamDecorator(7 /* SESSION */);
225
+ var FileParam = createRouteParamDecorator(8 /* FILE */);
226
+ var Files = createRouteParamDecorator(9 /* FILES */);
227
+ var Ip = createRouteParamDecorator(11 /* IP */);
228
+ var HostParam = createRouteParamDecorator(10 /* HOST */);
229
+ var Ctx = createRouteParamDecorator(12 /* CONTEXT */);
230
+ function Body(property, ...pipes) {
231
+ return createPipesRouteParamDecorator(3 /* BODY */)(property, ...pipes);
232
+ }
233
+ function Query(property, ...pipes) {
234
+ return createPipesRouteParamDecorator(4 /* QUERY */)(property, ...pipes);
235
+ }
236
+ function Param(property, ...pipes) {
237
+ return createPipesRouteParamDecorator(5 /* PARAM */)(property, ...pipes);
238
+ }
239
+ function Headers(property, ...pipes) {
240
+ return createPipesRouteParamDecorator(6 /* HEADERS */)(property, ...pipes);
241
+ }
242
+ function SetMetadata(metadataKey, metadataValue) {
243
+ return (target, key, descriptor) => {
244
+ if (descriptor) {
245
+ Reflect.defineMetadata(metadataKey, metadataValue, descriptor.value);
246
+ return descriptor;
247
+ }
248
+ Reflect.defineMetadata(metadataKey, metadataValue, target);
249
+ return target;
250
+ };
251
+ }
252
+ function HttpCode(statusCode) {
253
+ return (target, key, descriptor) => {
254
+ Reflect.defineMetadata(METADATA_KEYS.HTTP_CODE, statusCode, descriptor.value);
255
+ return descriptor;
256
+ };
257
+ }
258
+ function Header(name, value) {
259
+ return (target, key, descriptor) => {
260
+ const headers = Reflect.getMetadata(METADATA_KEYS.HEADERS, descriptor.value) || [];
261
+ headers.push({ name, value });
262
+ Reflect.defineMetadata(METADATA_KEYS.HEADERS, headers, descriptor.value);
263
+ return descriptor;
264
+ };
265
+ }
266
+ function Redirect(url, statusCode = 302) {
267
+ return (target, key, descriptor) => {
268
+ Reflect.defineMetadata(METADATA_KEYS.REDIRECT, { url, statusCode }, descriptor.value);
269
+ return descriptor;
270
+ };
271
+ }
272
+ function applyDecorators(...decorators) {
273
+ return (target, propertyKey, descriptor) => {
274
+ for (const decorator of decorators) {
275
+ if (target instanceof Function && !descriptor) {
276
+ decorator(target);
277
+ continue;
278
+ }
279
+ if (descriptor) {
280
+ decorator(target, propertyKey, descriptor);
281
+ } else {
282
+ decorator(target, propertyKey);
283
+ }
284
+ }
285
+ };
286
+ }
287
+ function createParamDecorator(factory) {
288
+ const paramtype = 13 /* CUSTOM */;
289
+ return (data) => {
290
+ return (target, key, index) => {
291
+ const args = Reflect.getMetadata(METADATA_KEYS.ROUTE_ARGS_METADATA, target.constructor, key) || {};
292
+ Reflect.defineMetadata(
293
+ METADATA_KEYS.ROUTE_ARGS_METADATA,
294
+ assignMetadata(args, paramtype, index, data, factory),
295
+ target.constructor,
296
+ key
297
+ );
298
+ };
299
+ };
300
+ }
301
+
302
+ exports.All = All;
303
+ exports.Body = Body;
304
+ exports.Catch = Catch;
305
+ exports.Controller = Controller;
306
+ exports.Ctx = Ctx;
307
+ exports.Delete = Delete;
308
+ exports.FileParam = FileParam;
309
+ exports.Files = Files;
310
+ exports.Get = Get;
311
+ exports.Global = Global;
312
+ exports.Head = Head;
313
+ exports.Header = Header;
314
+ exports.Headers = Headers;
315
+ exports.HostParam = HostParam;
316
+ exports.HttpCode = HttpCode;
317
+ exports.Inject = Inject;
318
+ exports.Injectable = Injectable;
319
+ exports.Ip = Ip;
320
+ exports.Module = Module;
321
+ exports.Next = Next;
322
+ exports.Optional = Optional;
323
+ exports.Options = Options;
324
+ exports.Param = Param;
325
+ exports.Patch = Patch;
326
+ exports.Post = Post;
327
+ exports.Put = Put;
328
+ exports.Query = Query;
329
+ exports.Redirect = Redirect;
330
+ exports.Request = Request;
331
+ exports.RequestMethod = RequestMethod;
332
+ exports.Response = Response;
333
+ exports.RouteParamtypes = RouteParamtypes;
334
+ exports.Scope = Scope;
335
+ exports.Session = Session;
336
+ exports.SetMetadata = SetMetadata;
337
+ exports.UseFilters = UseFilters;
338
+ exports.UseGuards = UseGuards;
339
+ exports.UseInterceptors = UseInterceptors;
340
+ exports.UsePipes = UsePipes;
341
+ exports.applyDecorators = applyDecorators;
342
+ exports.assignMetadata = assignMetadata;
343
+ exports.createParamDecorator = createParamDecorator;
344
+ //# sourceMappingURL=decorators.cjs.map
345
+ //# sourceMappingURL=decorators.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/constants.ts","../src/injector/scope.ts","../src/interfaces.ts","../src/decorators.ts"],"names":["Scope","R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,QAAA,EAAU,EAAE,KAAK,UAAA,EAAW,EAAG,WAAW,KAAK,CAAA;AACpF,IAAA,OAAO,UAAA;AAAA,EACX,CAAA;AACJ;AAEO,SAAS,mBAAmB,UAAA,EAAyE;AACxG,EAAA,OAAO,CACH,MAAA,EACA,WAAA,EACA,UAAA,KACC;AACD,IAAA,KAAA,MAAW,aAAa,UAAA,EAAY;AAChC,MAAA,IAAI,MAAA,YAAkB,QAAA,IAAY,CAAC,UAAA,EAAY;AAC3C,QAAC,UAA6B,MAAM,CAAA;AACpC,QAAA;AAAA,MACJ;AACA,MAAA,IAAI,UAAA,EAAY;AACZ,QAAC,SAAA,CAA8B,MAAA,EAAQ,WAAA,EAAc,UAAU,CAAA;AAAA,MACnE,CAAA,MAAO;AACH,QAAC,SAAA,CAAgC,QAAQ,WAAY,CAAA;AAAA,MACzD;AAAA,IACJ;AAAA,EACJ,CAAA;AACJ;AACO,SAAS,qBACZ,OAAA,EACF;AACE,EAAA,MAAM,SAAA,GAAY,EAAA;AAClB,EAAA,OAAO,CAAC,IAAA,KAA2C;AAC/C,IAAA,OAAO,CAAC,MAAA,EAAgB,GAAA,EAAkC,KAAA,KAAkB;AACxE,MAAA,MAAM,IAAA,GAAO,QAAQ,WAAA,CAAY,aAAA,CAAc,qBAAqB,MAAA,CAAO,WAAA,EAAa,GAAsB,CAAA,IAAK,EAAC;AACpH,MAAA,OAAA,CAAQ,cAAA;AAAA,QACJ,aAAA,CAAc,mBAAA;AAAA,QACd,cAAA,CAAe,IAAA,EAAM,SAAA,EAAW,KAAA,EAAO,MAAM,OAAO,CAAA;AAAA,QACpD,MAAA,CAAO,WAAA;AAAA,QACP;AAAA,OACJ;AAAA,IACJ,CAAA;AAAA,EACJ,CAAA;AACJ","file":"decorators.cjs","sourcesContent":["export const METADATA_KEYS = {\n MODULE: Symbol('module'),\n GLOBAL: Symbol('global'),\n CONTROLLER: Symbol('controller'),\n FLUSH_ROLES: Symbol('flush_roles'),\n OPTS: Symbol('opts'),\n PARAMS: Symbol('params'),\n ROUTES: Symbol('routes'),\n FILTER_CATCH: Symbol('filter_catch'),\n FILTER_EXCEPTION: Symbol('filter_exception'),\n USE_FILTERS: Symbol('use_filters'),\n USE_PIPES: Symbol('use_pipes'),\n USE_GUARDS: Symbol('use_guards'),\n USE_INTERCEPTORS: Symbol('use_interceptors'),\n ROUTE_ARGS_METADATA: Symbol('route_args_metadata'),\n INJECTIONS: Symbol('injections'),\n OPTIONAL: Symbol('optional'),\n SCOPE: Symbol('scope'),\n METHOD_INJECTIONS: Symbol('method_injections'),\n METHOD_OPTIONAL: Symbol('method_optional'),\n PROPERTY_DEPS: Symbol('property_deps'),\n HTTP_CODE: Symbol('http_code'),\n HEADERS: Symbol('headers'),\n REDIRECT: Symbol('redirect'),\n};\n","export enum Scope {\n DEFAULT = 0,\n TRANSIENT = 1,\n REQUEST = 2,\n}\n","import type { Context, Hono, HonoRequest, MiddlewareHandler, Next } from 'hono';\nimport type { Observable } from 'rxjs';\n\nimport { Scope } from './injector/scope';\n\nexport enum RequestMethod {\n GET = 'get',\n POST = 'post',\n PUT = 'put',\n DELETE = 'delete',\n PATCH = 'patch',\n ALL = 'all',\n OPTIONS = 'options',\n HEAD = 'head',\n}\n\nexport interface ModuleOptions {\n imports?: Array<Type<any> | DynamicModule | Promise<DynamicModule> | ForwardReference>;\n controllers?: Type<any>[];\n providers?: Provider[];\n exports?: Array<DynamicModule | Promise<DynamicModule> | string | symbol | Provider | ForwardReference | Function>;\n}\n\nexport interface Type<T = any> extends Function {\n new(...args: any[]): T;\n}\n\nexport interface ArgumentsHost {\n getArgs<T extends Array<any> = any[]>(): T;\n getType<TContext extends string = 'http'>(): TContext;\n switchToHttp(): HttpArgumentsHost;\n}\n\nexport interface HttpArgumentsHost {\n getRequest<T extends string = any>(): HonoRequest<T, any>;\n getResponse<T = any>(): Context;\n getNext<T = any>(): Next;\n getContext(): Context; // Hono Context\n}\n\nexport interface ExecutionContext extends ArgumentsHost {\n getClass<T = any>(): Type<T>;\n getHandler(): Function;\n}\n\nexport interface ExceptionFilter<T = any> {\n catch(exception: T, host: ArgumentsHost): void;\n}\n\nexport interface ArgumentMetadata {\n type: 'body' | 'query' | 'param' | 'custom';\n metatype?: Type<any>;\n data?: string;\n}\n\nexport interface PipeTransform<T = any, R = any> {\n transform(value: T, metadata: ArgumentMetadata): R;\n}\n\nexport interface CanActivate {\n canActivate(context: ExecutionContext): boolean | Promise<boolean>;\n}\n\nexport interface CallHandler<T = any> {\n handle(): Observable<T>;\n}\n\nexport interface Interceptor<T = any, R = any> {\n intercept(context: ExecutionContext, next: CallHandler<T>): Observable<R> | Promise<Observable<R>>;\n}\n\nexport interface OnModuleInit {\n onModuleInit(): any;\n}\n\nexport interface OnApplicationBootstrap {\n onApplicationBootstrap(): any;\n}\n\nexport interface OnModuleDestroy {\n onModuleDestroy(): any;\n}\n\nexport interface BeforeApplicationShutdown {\n beforeApplicationShutdown(signal?: string): any;\n}\n\nexport interface OnApplicationShutdown {\n onApplicationShutdown(signal?: string): any;\n}\n\nexport type InjectionToken<T = any> = string | symbol | Type<T> | Function | ForwardReference;\n\nexport type Provider<T = any> =\n | Type<any>\n | ClassProvider<T>\n | ValueProvider<T>\n | FactoryProvider<T>\n | ExistingProvider<T>;\n\nexport interface ClassProvider<T = any> {\n provide: InjectionToken;\n useClass: Type<T>;\n scope?: Scope;\n}\n\nexport interface ValueProvider<T = any> {\n provide: InjectionToken;\n useValue: T;\n}\n\nexport interface FactoryProvider<T = any> {\n provide: InjectionToken;\n useFactory: (...args: any[]) => T | Promise<T>;\n inject?: InjectionToken[];\n scope?: Scope;\n}\n\nexport interface ExistingProvider<T = any> {\n provide: InjectionToken;\n useExisting: InjectionToken;\n}\n\nexport interface DynamicModule extends ModuleOptions {\n module: Type<any>;\n global?: boolean;\n}\n\nexport interface ForwardReference {\n forwardRef: () => Type<any>;\n}\n\nexport interface HonoDiMiddleware {\n use: MiddlewareHandler\n}\n\nexport interface MiddlewareConsumer {\n apply(...middleware: (Type<any> | MiddlewareHandler)[]): MiddlewareConfigProxy;\n}\n\nexport interface MiddlewareConfigProxy {\n exclude(...routes: (string | RouteInfo)[]): MiddlewareConfigProxy;\n forRoutes(...routes: (string | Type<any> | RouteInfo)[]): MiddlewareConsumer;\n}\n\n// Removed import { RequestMethod } from './decorators';\n// Removed import { ModuleOptions } from './decorators';\n\nexport interface RouteInfo {\n path: string;\n method: RequestMethod;\n}\n\nexport interface HonoDiModule {\n configure(consumer: MiddlewareConsumer): void;\n}\n\n\nexport interface IApplication {\n useGlobalFilters(...filters: ExceptionFilter[]): this;\n useGlobalPipes(...pipes: PipeTransform[]): this;\n useGlobalInterceptors(...interceptors: Interceptor[]): this;\n useGlobalGuards(...guards: CanActivate[]): this;\n setGlobalPrefix(prefix: string): this;\n init(): Promise<this>;\n listen(port: number | string, callback?: () => void): Promise<any>;\n getHttpAdapter(): Hono;\n get<TInput = any, TResult = TInput>(typeOrToken: Type<TInput> | string | symbol, options?: { strict?: boolean }): TResult;\n close(): Promise<void>;\n}\n\n","import 'reflect-metadata';\nimport { METADATA_KEYS } from './constants';\nimport { Scope } from './injector/scope';\nimport { RequestMethod } from './interfaces';\nimport type { ModuleOptions, Type, InjectionToken, CanActivate, ExceptionFilter, PipeTransform, Interceptor, ExecutionContext } from './interfaces';\n\nexport { Scope, RequestMethod };\nexport type { ModuleOptions };\n\nexport interface InjectableOptions {\n scope?: Scope;\n}\n\nexport interface RouteDefinition {\n path: string;\n requestMethod: RequestMethod;\n methodName: string;\n}\n\nexport function Global(): ClassDecorator {\n return (target: any) => {\n Reflect.defineMetadata(METADATA_KEYS.GLOBAL, true, target);\n };\n}\n\nexport function Module(options: ModuleOptions): ClassDecorator {\n return (target: any) => {\n Reflect.defineMetadata(METADATA_KEYS.MODULE, options, target);\n };\n}\n\nexport function Injectable(options?: InjectableOptions): ClassDecorator {\n return (target: any) => {\n Reflect.defineMetadata(METADATA_KEYS.SCOPE, options?.scope ?? Scope.DEFAULT, target);\n };\n}\n\nexport function Controller(prefix: string = ''): ClassDecorator {\n return (target: any) => {\n Reflect.defineMetadata(METADATA_KEYS.CONTROLLER, { prefix }, target);\n // Mark as Injectable implicitly\n Reflect.defineMetadata(METADATA_KEYS.SCOPE, Scope.DEFAULT, target);\n };\n}\n\n// Method Decorators\nfunction createRouteDecorator(method: RequestMethod) {\n return (path: string = '/'): MethodDecorator => {\n return (target: Object, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor<any>) => {\n // In case of instance method decorator, target is the prototype\n if (!Reflect.hasMetadata(METADATA_KEYS.ROUTES, target.constructor)) {\n Reflect.defineMetadata(METADATA_KEYS.ROUTES, [], target.constructor);\n }\n\n const routes = Reflect.getMetadata(METADATA_KEYS.ROUTES, target.constructor) as RouteDefinition[];\n\n routes.push({\n requestMethod: method,\n path,\n methodName: propertyKey as string,\n });\n Reflect.defineMetadata(METADATA_KEYS.ROUTES, routes, target.constructor);\n };\n };\n}\n\nexport const Get = createRouteDecorator(RequestMethod.GET);\nexport const Post = createRouteDecorator(RequestMethod.POST);\nexport const Put = createRouteDecorator(RequestMethod.PUT);\nexport const Delete = createRouteDecorator(RequestMethod.DELETE);\nexport const Patch = createRouteDecorator(RequestMethod.PATCH);\nexport const Options = createRouteDecorator(RequestMethod.OPTIONS);\nexport const Head = createRouteDecorator(RequestMethod.HEAD);\nexport const All = createRouteDecorator(RequestMethod.ALL);\n\n// Exception Filters\nexport function Catch(...exceptions: Type<any>[]): ClassDecorator {\n return (target: any) => {\n Reflect.defineMetadata(METADATA_KEYS.FILTER_CATCH, exceptions, target);\n // Mark as Injectable implicitly\n Reflect.defineMetadata(METADATA_KEYS.SCOPE, Scope.DEFAULT, target);\n };\n}\n\nexport function UseFilters(...filters: (Type<ExceptionFilter> | ExceptionFilter)[]): MethodDecorator & ClassDecorator {\n return (\n target: any,\n propertyKey?: string | symbol,\n descriptor?: PropertyDescriptor,\n ) => {\n if (descriptor) {\n // Method decorator\n Reflect.defineMetadata(METADATA_KEYS.USE_FILTERS, filters, descriptor.value);\n return descriptor;\n }\n // Class decorator\n Reflect.defineMetadata(METADATA_KEYS.USE_FILTERS, filters, target);\n return target;\n };\n}\n\nexport function Inject(token: InjectionToken): PropertyDecorator & ParameterDecorator {\n return (target: Object, propertyKey: string | symbol | undefined, parameterIndex?: number) => {\n if (parameterIndex !== undefined) {\n // Parameter decorator\n const injections = Reflect.getMetadata(METADATA_KEYS.INJECTIONS, target) || [];\n injections[parameterIndex] = token;\n Reflect.defineMetadata(METADATA_KEYS.INJECTIONS, injections, target);\n } else {\n // Property decorator\n const properties = Reflect.getMetadata(METADATA_KEYS.PROPERTY_DEPS, target.constructor) || [];\n properties.push({ key: propertyKey, token });\n Reflect.defineMetadata(METADATA_KEYS.PROPERTY_DEPS, properties, target.constructor);\n }\n };\n}\n\nexport function Optional(): PropertyDecorator & ParameterDecorator {\n return (target: Object, propertyKey: string | symbol | undefined, parameterIndex?: number) => {\n if (parameterIndex !== undefined) {\n // Parameter decorator\n const optionals = Reflect.getMetadata(METADATA_KEYS.OPTIONAL, target) || [];\n optionals[parameterIndex] = true;\n Reflect.defineMetadata(METADATA_KEYS.OPTIONAL, optionals, target);\n } else {\n // Property decorator\n const optionalProps = Reflect.getMetadata(METADATA_KEYS.OPTIONAL, target.constructor) || [];\n optionalProps.push(propertyKey);\n Reflect.defineMetadata(METADATA_KEYS.OPTIONAL, optionalProps, target.constructor);\n }\n };\n}\n\nexport function UseGuards(...guards: (Type<CanActivate> | CanActivate)[]): MethodDecorator & ClassDecorator {\n return (target: any, propertyKey?: string | symbol, descriptor?: PropertyDescriptor) => {\n if (descriptor) {\n Reflect.defineMetadata(METADATA_KEYS.USE_GUARDS, guards, descriptor.value);\n return descriptor;\n }\n Reflect.defineMetadata(METADATA_KEYS.USE_GUARDS, guards, target);\n return target;\n };\n}\n\nexport function UseInterceptors(...interceptors: (Type<Interceptor> | Interceptor)[]): MethodDecorator & ClassDecorator {\n return (target: any, propertyKey?: string | symbol, descriptor?: PropertyDescriptor) => {\n if (descriptor) {\n Reflect.defineMetadata(METADATA_KEYS.USE_INTERCEPTORS, interceptors, descriptor.value);\n return descriptor;\n }\n Reflect.defineMetadata(METADATA_KEYS.USE_INTERCEPTORS, interceptors, target);\n return target;\n };\n}\n\nexport function UsePipes(...pipes: (Type<PipeTransform> | PipeTransform)[]): MethodDecorator & ClassDecorator {\n return (target: any, propertyKey?: string | symbol, descriptor?: PropertyDescriptor) => {\n if (descriptor) {\n Reflect.defineMetadata(METADATA_KEYS.USE_PIPES, pipes, descriptor.value);\n return descriptor;\n }\n Reflect.defineMetadata(METADATA_KEYS.USE_PIPES, pipes, target);\n return target;\n };\n}\n\nexport enum RouteParamtypes {\n REQUEST,\n RESPONSE,\n NEXT,\n BODY,\n QUERY,\n PARAM,\n HEADERS,\n SESSION,\n FILE,\n FILES,\n HOST,\n IP,\n CONTEXT,\n CUSTOM,\n}\n\nexport function assignMetadata(args: any, paramtype: RouteParamtypes, index: number, data?: any, ...pipes: any[]) {\n return {\n ...args,\n [`${paramtype}:${index}`]: {\n index,\n data,\n pipes,\n paramtype,\n },\n };\n}\n\nfunction createRouteParamDecorator(paramtype: RouteParamtypes) {\n return (data?: any): ParameterDecorator => {\n return (target: Object, key: string | symbol | undefined, index: number) => {\n const args = Reflect.getMetadata(METADATA_KEYS.ROUTE_ARGS_METADATA, target.constructor, key as string | symbol) || {};\n Reflect.defineMetadata(\n METADATA_KEYS.ROUTE_ARGS_METADATA,\n assignMetadata(args, paramtype, index, data),\n target.constructor,\n key as string | symbol,\n );\n };\n };\n}\n\nfunction createPipesRouteParamDecorator(paramtype: RouteParamtypes) {\n return (data?: any, ...pipes: any[]): ParameterDecorator => {\n return (target: Object, key: string | symbol | undefined, index: number) => {\n const args = Reflect.getMetadata(METADATA_KEYS.ROUTE_ARGS_METADATA, target.constructor, key as string | symbol) || {};\n Reflect.defineMetadata(\n METADATA_KEYS.ROUTE_ARGS_METADATA,\n assignMetadata(args, paramtype, index, data, ...pipes),\n target.constructor,\n key as string | symbol,\n );\n };\n };\n}\n\nexport const Request = createRouteParamDecorator(RouteParamtypes.REQUEST);\nexport const Response = createRouteParamDecorator(RouteParamtypes.RESPONSE);\nexport const Next = createRouteParamDecorator(RouteParamtypes.NEXT);\nexport const Session = createRouteParamDecorator(RouteParamtypes.SESSION);\nexport const FileParam = createRouteParamDecorator(RouteParamtypes.FILE);\nexport const Files = createRouteParamDecorator(RouteParamtypes.FILES);\nexport const Ip = createRouteParamDecorator(RouteParamtypes.IP);\nexport const HostParam = createRouteParamDecorator(RouteParamtypes.HOST);\nexport const Ctx = createRouteParamDecorator(RouteParamtypes.CONTEXT);\n\nexport function Body(property?: string, ...pipes: any[]): ParameterDecorator {\n return createPipesRouteParamDecorator(RouteParamtypes.BODY)(property, ...pipes);\n}\n\nexport function Query(property?: string, ...pipes: any[]): ParameterDecorator {\n return createPipesRouteParamDecorator(RouteParamtypes.QUERY)(property, ...pipes);\n}\n\nexport function Param(property?: string, ...pipes: any[]): ParameterDecorator {\n return createPipesRouteParamDecorator(RouteParamtypes.PARAM)(property, ...pipes);\n}\n\nexport function Headers(property?: string, ...pipes: any[]): ParameterDecorator {\n return createPipesRouteParamDecorator(RouteParamtypes.HEADERS)(property, ...pipes);\n}\n\nexport function SetMetadata<K = any, V = any>(metadataKey: K, metadataValue: V): CustomDecorator<K> {\n return (target: object, key?: string | symbol, descriptor?: any) => {\n if (descriptor) {\n Reflect.defineMetadata(metadataKey, metadataValue, descriptor.value);\n return descriptor;\n }\n Reflect.defineMetadata(metadataKey, metadataValue, target);\n return target;\n };\n}\n\nexport type CustomDecorator<TKey = string> = MethodDecorator & ClassDecorator;\n\nexport function HttpCode(statusCode: number): MethodDecorator {\n return (target: object, key: string | symbol, descriptor: TypedPropertyDescriptor<any>) => {\n Reflect.defineMetadata(METADATA_KEYS.HTTP_CODE, statusCode, descriptor.value);\n return descriptor;\n };\n}\n\nexport function Header(name: string, value: string): MethodDecorator {\n return (target: object, key: string | symbol, descriptor: TypedPropertyDescriptor<any>) => {\n const headers = Reflect.getMetadata(METADATA_KEYS.HEADERS, descriptor.value) || [];\n headers.push({ name, value });\n Reflect.defineMetadata(METADATA_KEYS.HEADERS, headers, descriptor.value);\n return descriptor;\n };\n}\n\nexport function Redirect(url: string, statusCode: number = 302): MethodDecorator {\n return (target: object, key: string | symbol, descriptor: TypedPropertyDescriptor<any>) => {\n Reflect.defineMetadata(METADATA_KEYS.REDIRECT, { url, statusCode }, descriptor.value);\n return descriptor;\n };\n}\n\nexport function applyDecorators(...decorators: Array<ClassDecorator | MethodDecorator | PropertyDecorator>) {\n return <TFunction extends Function, Y>(\n target: object | TFunction,\n propertyKey?: string | symbol,\n descriptor?: TypedPropertyDescriptor<Y>,\n ) => {\n for (const decorator of decorators) {\n if (target instanceof Function && !descriptor) {\n (decorator as ClassDecorator)(target);\n continue;\n }\n if (descriptor) {\n (decorator as MethodDecorator)(target, propertyKey!, descriptor);\n } else {\n (decorator as PropertyDecorator)(target, propertyKey!);\n }\n }\n };\n}\nexport function createParamDecorator<FactoryData = any, Output = any>(\n factory: (data: FactoryData, ctx: ExecutionContext) => Output,\n) {\n const paramtype = RouteParamtypes.CUSTOM;\n return (data?: FactoryData): ParameterDecorator => {\n return (target: Object, key: string | symbol | undefined, index: number) => {\n const args = Reflect.getMetadata(METADATA_KEYS.ROUTE_ARGS_METADATA, target.constructor, key as string | symbol) || {};\n Reflect.defineMetadata(\n METADATA_KEYS.ROUTE_ARGS_METADATA,\n assignMetadata(args, paramtype, index, data, factory),\n target.constructor,\n key as string | symbol,\n );\n };\n };\n}\n"]}
@@ -0,0 +1,70 @@
1
+ import { S as Scope, R as RequestMethod, M as ModuleOptions, T as Type, E as ExceptionFilter, I as InjectionToken, C as CanActivate, a as Interceptor, P as PipeTransform, b as ExecutionContext } from './interfaces-4oTuNIHA.cjs';
2
+ import 'hono';
3
+ import 'rxjs';
4
+
5
+ interface InjectableOptions {
6
+ scope?: Scope;
7
+ }
8
+ interface RouteDefinition {
9
+ path: string;
10
+ requestMethod: RequestMethod;
11
+ methodName: string;
12
+ }
13
+ declare function Global(): ClassDecorator;
14
+ declare function Module(options: ModuleOptions): ClassDecorator;
15
+ declare function Injectable(options?: InjectableOptions): ClassDecorator;
16
+ declare function Controller(prefix?: string): ClassDecorator;
17
+ declare const Get: (path?: string) => MethodDecorator;
18
+ declare const Post: (path?: string) => MethodDecorator;
19
+ declare const Put: (path?: string) => MethodDecorator;
20
+ declare const Delete: (path?: string) => MethodDecorator;
21
+ declare const Patch: (path?: string) => MethodDecorator;
22
+ declare const Options: (path?: string) => MethodDecorator;
23
+ declare const Head: (path?: string) => MethodDecorator;
24
+ declare const All: (path?: string) => MethodDecorator;
25
+ declare function Catch(...exceptions: Type<any>[]): ClassDecorator;
26
+ declare function UseFilters(...filters: (Type<ExceptionFilter> | ExceptionFilter)[]): MethodDecorator & ClassDecorator;
27
+ declare function Inject(token: InjectionToken): PropertyDecorator & ParameterDecorator;
28
+ declare function Optional(): PropertyDecorator & ParameterDecorator;
29
+ declare function UseGuards(...guards: (Type<CanActivate> | CanActivate)[]): MethodDecorator & ClassDecorator;
30
+ declare function UseInterceptors(...interceptors: (Type<Interceptor> | Interceptor)[]): MethodDecorator & ClassDecorator;
31
+ declare function UsePipes(...pipes: (Type<PipeTransform> | PipeTransform)[]): MethodDecorator & ClassDecorator;
32
+ declare enum RouteParamtypes {
33
+ REQUEST = 0,
34
+ RESPONSE = 1,
35
+ NEXT = 2,
36
+ BODY = 3,
37
+ QUERY = 4,
38
+ PARAM = 5,
39
+ HEADERS = 6,
40
+ SESSION = 7,
41
+ FILE = 8,
42
+ FILES = 9,
43
+ HOST = 10,
44
+ IP = 11,
45
+ CONTEXT = 12,
46
+ CUSTOM = 13
47
+ }
48
+ declare function assignMetadata(args: any, paramtype: RouteParamtypes, index: number, data?: any, ...pipes: any[]): any;
49
+ declare const Request: (data?: any) => ParameterDecorator;
50
+ declare const Response: (data?: any) => ParameterDecorator;
51
+ declare const Next: (data?: any) => ParameterDecorator;
52
+ declare const Session: (data?: any) => ParameterDecorator;
53
+ declare const FileParam: (data?: any) => ParameterDecorator;
54
+ declare const Files: (data?: any) => ParameterDecorator;
55
+ declare const Ip: (data?: any) => ParameterDecorator;
56
+ declare const HostParam: (data?: any) => ParameterDecorator;
57
+ declare const Ctx: (data?: any) => ParameterDecorator;
58
+ declare function Body(property?: string, ...pipes: any[]): ParameterDecorator;
59
+ declare function Query(property?: string, ...pipes: any[]): ParameterDecorator;
60
+ declare function Param(property?: string, ...pipes: any[]): ParameterDecorator;
61
+ declare function Headers(property?: string, ...pipes: any[]): ParameterDecorator;
62
+ declare function SetMetadata<K = any, V = any>(metadataKey: K, metadataValue: V): CustomDecorator<K>;
63
+ type CustomDecorator<TKey = string> = MethodDecorator & ClassDecorator;
64
+ declare function HttpCode(statusCode: number): MethodDecorator;
65
+ declare function Header(name: string, value: string): MethodDecorator;
66
+ declare function Redirect(url: string, statusCode?: number): MethodDecorator;
67
+ declare function applyDecorators(...decorators: Array<ClassDecorator | MethodDecorator | PropertyDecorator>): <TFunction extends Function, Y>(target: object | TFunction, propertyKey?: string | symbol, descriptor?: TypedPropertyDescriptor<Y>) => void;
68
+ declare function createParamDecorator<FactoryData = any, Output = any>(factory: (data: FactoryData, ctx: ExecutionContext) => Output): (data?: FactoryData) => ParameterDecorator;
69
+
70
+ export { All, Body, Catch, Controller, Ctx, type CustomDecorator, Delete, FileParam, Files, Get, Global, Head, Header, Headers, HostParam, HttpCode, Inject, Injectable, type InjectableOptions, Ip, Module, ModuleOptions, Next, Optional, Options, Param, Patch, Post, Put, Query, Redirect, Request, RequestMethod, Response, type RouteDefinition, RouteParamtypes, Scope, Session, SetMetadata, UseFilters, UseGuards, UseInterceptors, UsePipes, applyDecorators, assignMetadata, createParamDecorator };
@@ -0,0 +1,70 @@
1
+ import { S as Scope, R as RequestMethod, M as ModuleOptions, T as Type, E as ExceptionFilter, I as InjectionToken, C as CanActivate, a as Interceptor, P as PipeTransform, b as ExecutionContext } from './interfaces-4oTuNIHA.js';
2
+ import 'hono';
3
+ import 'rxjs';
4
+
5
+ interface InjectableOptions {
6
+ scope?: Scope;
7
+ }
8
+ interface RouteDefinition {
9
+ path: string;
10
+ requestMethod: RequestMethod;
11
+ methodName: string;
12
+ }
13
+ declare function Global(): ClassDecorator;
14
+ declare function Module(options: ModuleOptions): ClassDecorator;
15
+ declare function Injectable(options?: InjectableOptions): ClassDecorator;
16
+ declare function Controller(prefix?: string): ClassDecorator;
17
+ declare const Get: (path?: string) => MethodDecorator;
18
+ declare const Post: (path?: string) => MethodDecorator;
19
+ declare const Put: (path?: string) => MethodDecorator;
20
+ declare const Delete: (path?: string) => MethodDecorator;
21
+ declare const Patch: (path?: string) => MethodDecorator;
22
+ declare const Options: (path?: string) => MethodDecorator;
23
+ declare const Head: (path?: string) => MethodDecorator;
24
+ declare const All: (path?: string) => MethodDecorator;
25
+ declare function Catch(...exceptions: Type<any>[]): ClassDecorator;
26
+ declare function UseFilters(...filters: (Type<ExceptionFilter> | ExceptionFilter)[]): MethodDecorator & ClassDecorator;
27
+ declare function Inject(token: InjectionToken): PropertyDecorator & ParameterDecorator;
28
+ declare function Optional(): PropertyDecorator & ParameterDecorator;
29
+ declare function UseGuards(...guards: (Type<CanActivate> | CanActivate)[]): MethodDecorator & ClassDecorator;
30
+ declare function UseInterceptors(...interceptors: (Type<Interceptor> | Interceptor)[]): MethodDecorator & ClassDecorator;
31
+ declare function UsePipes(...pipes: (Type<PipeTransform> | PipeTransform)[]): MethodDecorator & ClassDecorator;
32
+ declare enum RouteParamtypes {
33
+ REQUEST = 0,
34
+ RESPONSE = 1,
35
+ NEXT = 2,
36
+ BODY = 3,
37
+ QUERY = 4,
38
+ PARAM = 5,
39
+ HEADERS = 6,
40
+ SESSION = 7,
41
+ FILE = 8,
42
+ FILES = 9,
43
+ HOST = 10,
44
+ IP = 11,
45
+ CONTEXT = 12,
46
+ CUSTOM = 13
47
+ }
48
+ declare function assignMetadata(args: any, paramtype: RouteParamtypes, index: number, data?: any, ...pipes: any[]): any;
49
+ declare const Request: (data?: any) => ParameterDecorator;
50
+ declare const Response: (data?: any) => ParameterDecorator;
51
+ declare const Next: (data?: any) => ParameterDecorator;
52
+ declare const Session: (data?: any) => ParameterDecorator;
53
+ declare const FileParam: (data?: any) => ParameterDecorator;
54
+ declare const Files: (data?: any) => ParameterDecorator;
55
+ declare const Ip: (data?: any) => ParameterDecorator;
56
+ declare const HostParam: (data?: any) => ParameterDecorator;
57
+ declare const Ctx: (data?: any) => ParameterDecorator;
58
+ declare function Body(property?: string, ...pipes: any[]): ParameterDecorator;
59
+ declare function Query(property?: string, ...pipes: any[]): ParameterDecorator;
60
+ declare function Param(property?: string, ...pipes: any[]): ParameterDecorator;
61
+ declare function Headers(property?: string, ...pipes: any[]): ParameterDecorator;
62
+ declare function SetMetadata<K = any, V = any>(metadataKey: K, metadataValue: V): CustomDecorator<K>;
63
+ type CustomDecorator<TKey = string> = MethodDecorator & ClassDecorator;
64
+ declare function HttpCode(statusCode: number): MethodDecorator;
65
+ declare function Header(name: string, value: string): MethodDecorator;
66
+ declare function Redirect(url: string, statusCode?: number): MethodDecorator;
67
+ declare function applyDecorators(...decorators: Array<ClassDecorator | MethodDecorator | PropertyDecorator>): <TFunction extends Function, Y>(target: object | TFunction, propertyKey?: string | symbol, descriptor?: TypedPropertyDescriptor<Y>) => void;
68
+ declare function createParamDecorator<FactoryData = any, Output = any>(factory: (data: FactoryData, ctx: ExecutionContext) => Output): (data?: FactoryData) => ParameterDecorator;
69
+
70
+ export { All, Body, Catch, Controller, Ctx, type CustomDecorator, Delete, FileParam, Files, Get, Global, Head, Header, Headers, HostParam, HttpCode, Inject, Injectable, type InjectableOptions, Ip, Module, ModuleOptions, Next, Optional, Options, Param, Patch, Post, Put, Query, Redirect, Request, RequestMethod, Response, type RouteDefinition, RouteParamtypes, Scope, Session, SetMetadata, UseFilters, UseGuards, UseInterceptors, UsePipes, applyDecorators, assignMetadata, createParamDecorator };