@hono-di/core 0.0.7 → 0.0.15
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.
- package/dist/decorators-ClTJ_N9c.d.cts +304 -0
- package/dist/decorators-ClTJ_N9c.d.ts +304 -0
- package/dist/decorators.cjs +76 -54
- package/dist/decorators.d.cts +1 -68
- package/dist/decorators.d.ts +1 -68
- package/dist/decorators.js +76 -54
- package/dist/index.cjs +1160 -301
- package/dist/index.d.cts +520 -7
- package/dist/index.d.ts +520 -7
- package/dist/index.js +1159 -300
- package/package.json +2 -1
- package/dist/core.cjs +0 -1552
- package/dist/core.d.cts +0 -339
- package/dist/core.d.ts +0 -339
- package/dist/core.js +0 -1517
- package/dist/interfaces-4oTuNIHA.d.cts +0 -139
- package/dist/interfaces-4oTuNIHA.d.ts +0 -139
package/dist/decorators.cjs
CHANGED
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
require('reflect-metadata');
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
var __defProp = Object.defineProperty;
|
|
6
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
6
7
|
|
|
7
8
|
// src/constants.ts
|
|
8
9
|
var METADATA_KEYS = {
|
|
@@ -26,15 +27,15 @@ var METADATA_KEYS = {
|
|
|
26
27
|
};
|
|
27
28
|
|
|
28
29
|
// src/injector/scope.ts
|
|
29
|
-
var Scope = /* @__PURE__ */ ((Scope2)
|
|
30
|
+
var Scope = /* @__PURE__ */ (function(Scope2) {
|
|
30
31
|
Scope2[Scope2["DEFAULT"] = 0] = "DEFAULT";
|
|
31
32
|
Scope2[Scope2["TRANSIENT"] = 1] = "TRANSIENT";
|
|
32
33
|
Scope2[Scope2["REQUEST"] = 2] = "REQUEST";
|
|
33
34
|
return Scope2;
|
|
34
|
-
})(
|
|
35
|
+
})({});
|
|
35
36
|
|
|
36
37
|
// src/interfaces.ts
|
|
37
|
-
var RequestMethod = /* @__PURE__ */ ((RequestMethod2)
|
|
38
|
+
var RequestMethod = /* @__PURE__ */ (function(RequestMethod2) {
|
|
38
39
|
RequestMethod2["GET"] = "get";
|
|
39
40
|
RequestMethod2["POST"] = "post";
|
|
40
41
|
RequestMethod2["PUT"] = "put";
|
|
@@ -44,7 +45,7 @@ var RequestMethod = /* @__PURE__ */ ((RequestMethod2) => {
|
|
|
44
45
|
RequestMethod2["OPTIONS"] = "options";
|
|
45
46
|
RequestMethod2["HEAD"] = "head";
|
|
46
47
|
return RequestMethod2;
|
|
47
|
-
})(
|
|
48
|
+
})({});
|
|
48
49
|
|
|
49
50
|
// src/decorators.ts
|
|
50
51
|
function Global() {
|
|
@@ -52,22 +53,28 @@ function Global() {
|
|
|
52
53
|
Reflect.defineMetadata(METADATA_KEYS.GLOBAL, true, target);
|
|
53
54
|
};
|
|
54
55
|
}
|
|
56
|
+
__name(Global, "Global");
|
|
55
57
|
function Module(options) {
|
|
56
58
|
return (target) => {
|
|
57
59
|
Reflect.defineMetadata(METADATA_KEYS.MODULE, options, target);
|
|
58
60
|
};
|
|
59
61
|
}
|
|
62
|
+
__name(Module, "Module");
|
|
60
63
|
function Injectable(options) {
|
|
61
64
|
return (target) => {
|
|
62
|
-
Reflect.defineMetadata(METADATA_KEYS.SCOPE, options?.scope ??
|
|
65
|
+
Reflect.defineMetadata(METADATA_KEYS.SCOPE, options?.scope ?? Scope.DEFAULT, target);
|
|
63
66
|
};
|
|
64
67
|
}
|
|
68
|
+
__name(Injectable, "Injectable");
|
|
65
69
|
function Controller(prefix = "") {
|
|
66
70
|
return (target) => {
|
|
67
|
-
Reflect.defineMetadata(METADATA_KEYS.CONTROLLER, {
|
|
68
|
-
|
|
71
|
+
Reflect.defineMetadata(METADATA_KEYS.CONTROLLER, {
|
|
72
|
+
prefix
|
|
73
|
+
}, target);
|
|
74
|
+
Reflect.defineMetadata(METADATA_KEYS.SCOPE, Scope.DEFAULT, target);
|
|
69
75
|
};
|
|
70
76
|
}
|
|
77
|
+
__name(Controller, "Controller");
|
|
71
78
|
function createRouteDecorator(method) {
|
|
72
79
|
return (path = "/") => {
|
|
73
80
|
return (target, propertyKey, descriptor) => {
|
|
@@ -84,20 +91,22 @@ function createRouteDecorator(method) {
|
|
|
84
91
|
};
|
|
85
92
|
};
|
|
86
93
|
}
|
|
87
|
-
|
|
88
|
-
var
|
|
89
|
-
var
|
|
90
|
-
var
|
|
91
|
-
var
|
|
92
|
-
var
|
|
93
|
-
var
|
|
94
|
-
var
|
|
94
|
+
__name(createRouteDecorator, "createRouteDecorator");
|
|
95
|
+
var Get = createRouteDecorator(RequestMethod.GET);
|
|
96
|
+
var Post = createRouteDecorator(RequestMethod.POST);
|
|
97
|
+
var Put = createRouteDecorator(RequestMethod.PUT);
|
|
98
|
+
var Delete = createRouteDecorator(RequestMethod.DELETE);
|
|
99
|
+
var Patch = createRouteDecorator(RequestMethod.PATCH);
|
|
100
|
+
var Options = createRouteDecorator(RequestMethod.OPTIONS);
|
|
101
|
+
var Head = createRouteDecorator(RequestMethod.HEAD);
|
|
102
|
+
var All = createRouteDecorator(RequestMethod.ALL);
|
|
95
103
|
function Catch(...exceptions) {
|
|
96
104
|
return (target) => {
|
|
97
105
|
Reflect.defineMetadata(METADATA_KEYS.FILTER_CATCH, exceptions, target);
|
|
98
|
-
Reflect.defineMetadata(METADATA_KEYS.SCOPE,
|
|
106
|
+
Reflect.defineMetadata(METADATA_KEYS.SCOPE, Scope.DEFAULT, target);
|
|
99
107
|
};
|
|
100
108
|
}
|
|
109
|
+
__name(Catch, "Catch");
|
|
101
110
|
function UseFilters(...filters) {
|
|
102
111
|
return (target, propertyKey, descriptor) => {
|
|
103
112
|
if (descriptor) {
|
|
@@ -108,6 +117,7 @@ function UseFilters(...filters) {
|
|
|
108
117
|
return target;
|
|
109
118
|
};
|
|
110
119
|
}
|
|
120
|
+
__name(UseFilters, "UseFilters");
|
|
111
121
|
function Inject(token) {
|
|
112
122
|
return (target, propertyKey, parameterIndex) => {
|
|
113
123
|
if (parameterIndex !== void 0) {
|
|
@@ -116,11 +126,15 @@ function Inject(token) {
|
|
|
116
126
|
Reflect.defineMetadata(METADATA_KEYS.INJECTIONS, injections, target);
|
|
117
127
|
} else {
|
|
118
128
|
const properties = Reflect.getMetadata(METADATA_KEYS.PROPERTY_DEPS, target.constructor) || [];
|
|
119
|
-
properties.push({
|
|
129
|
+
properties.push({
|
|
130
|
+
key: propertyKey,
|
|
131
|
+
token
|
|
132
|
+
});
|
|
120
133
|
Reflect.defineMetadata(METADATA_KEYS.PROPERTY_DEPS, properties, target.constructor);
|
|
121
134
|
}
|
|
122
135
|
};
|
|
123
136
|
}
|
|
137
|
+
__name(Inject, "Inject");
|
|
124
138
|
function Optional() {
|
|
125
139
|
return (target, propertyKey, parameterIndex) => {
|
|
126
140
|
if (parameterIndex !== void 0) {
|
|
@@ -134,6 +148,7 @@ function Optional() {
|
|
|
134
148
|
}
|
|
135
149
|
};
|
|
136
150
|
}
|
|
151
|
+
__name(Optional, "Optional");
|
|
137
152
|
function UseGuards(...guards) {
|
|
138
153
|
return (target, propertyKey, descriptor) => {
|
|
139
154
|
if (descriptor) {
|
|
@@ -144,6 +159,7 @@ function UseGuards(...guards) {
|
|
|
144
159
|
return target;
|
|
145
160
|
};
|
|
146
161
|
}
|
|
162
|
+
__name(UseGuards, "UseGuards");
|
|
147
163
|
function UseInterceptors(...interceptors) {
|
|
148
164
|
return (target, propertyKey, descriptor) => {
|
|
149
165
|
if (descriptor) {
|
|
@@ -154,6 +170,7 @@ function UseInterceptors(...interceptors) {
|
|
|
154
170
|
return target;
|
|
155
171
|
};
|
|
156
172
|
}
|
|
173
|
+
__name(UseInterceptors, "UseInterceptors");
|
|
157
174
|
function UsePipes(...pipes) {
|
|
158
175
|
return (target, propertyKey, descriptor) => {
|
|
159
176
|
if (descriptor) {
|
|
@@ -164,7 +181,8 @@ function UsePipes(...pipes) {
|
|
|
164
181
|
return target;
|
|
165
182
|
};
|
|
166
183
|
}
|
|
167
|
-
|
|
184
|
+
__name(UsePipes, "UsePipes");
|
|
185
|
+
var RouteParamtypes = /* @__PURE__ */ (function(RouteParamtypes2) {
|
|
168
186
|
RouteParamtypes2[RouteParamtypes2["REQUEST"] = 0] = "REQUEST";
|
|
169
187
|
RouteParamtypes2[RouteParamtypes2["RESPONSE"] = 1] = "RESPONSE";
|
|
170
188
|
RouteParamtypes2[RouteParamtypes2["NEXT"] = 2] = "NEXT";
|
|
@@ -180,7 +198,7 @@ var RouteParamtypes = /* @__PURE__ */ ((RouteParamtypes2) => {
|
|
|
180
198
|
RouteParamtypes2[RouteParamtypes2["CONTEXT"] = 12] = "CONTEXT";
|
|
181
199
|
RouteParamtypes2[RouteParamtypes2["CUSTOM"] = 13] = "CUSTOM";
|
|
182
200
|
return RouteParamtypes2;
|
|
183
|
-
})(
|
|
201
|
+
})({});
|
|
184
202
|
function assignMetadata(args, paramtype, index, data, ...pipes) {
|
|
185
203
|
return {
|
|
186
204
|
...args,
|
|
@@ -192,53 +210,50 @@ function assignMetadata(args, paramtype, index, data, ...pipes) {
|
|
|
192
210
|
}
|
|
193
211
|
};
|
|
194
212
|
}
|
|
213
|
+
__name(assignMetadata, "assignMetadata");
|
|
195
214
|
function createRouteParamDecorator(paramtype) {
|
|
196
215
|
return (data) => {
|
|
197
216
|
return (target, key, index) => {
|
|
198
217
|
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
|
-
);
|
|
218
|
+
Reflect.defineMetadata(METADATA_KEYS.ROUTE_ARGS_METADATA, assignMetadata(args, paramtype, index, data), target.constructor, key);
|
|
205
219
|
};
|
|
206
220
|
};
|
|
207
221
|
}
|
|
222
|
+
__name(createRouteParamDecorator, "createRouteParamDecorator");
|
|
208
223
|
function createPipesRouteParamDecorator(paramtype) {
|
|
209
224
|
return (data, ...pipes) => {
|
|
210
225
|
return (target, key, index) => {
|
|
211
226
|
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
|
-
);
|
|
227
|
+
Reflect.defineMetadata(METADATA_KEYS.ROUTE_ARGS_METADATA, assignMetadata(args, paramtype, index, data, ...pipes), target.constructor, key);
|
|
218
228
|
};
|
|
219
229
|
};
|
|
220
230
|
}
|
|
221
|
-
|
|
222
|
-
var
|
|
223
|
-
var
|
|
224
|
-
var
|
|
225
|
-
var
|
|
226
|
-
var
|
|
227
|
-
var
|
|
228
|
-
var
|
|
229
|
-
var
|
|
231
|
+
__name(createPipesRouteParamDecorator, "createPipesRouteParamDecorator");
|
|
232
|
+
var Request = createRouteParamDecorator(0);
|
|
233
|
+
var Response = createRouteParamDecorator(1);
|
|
234
|
+
var Next = createRouteParamDecorator(2);
|
|
235
|
+
var Session = createRouteParamDecorator(7);
|
|
236
|
+
var FileParam = createRouteParamDecorator(8);
|
|
237
|
+
var Files = createRouteParamDecorator(9);
|
|
238
|
+
var Ip = createRouteParamDecorator(11);
|
|
239
|
+
var HostParam = createRouteParamDecorator(10);
|
|
240
|
+
var Ctx = createRouteParamDecorator(12);
|
|
230
241
|
function Body(property, ...pipes) {
|
|
231
|
-
return createPipesRouteParamDecorator(3
|
|
242
|
+
return createPipesRouteParamDecorator(3)(property, ...pipes);
|
|
232
243
|
}
|
|
244
|
+
__name(Body, "Body");
|
|
233
245
|
function Query(property, ...pipes) {
|
|
234
|
-
return createPipesRouteParamDecorator(4
|
|
246
|
+
return createPipesRouteParamDecorator(4)(property, ...pipes);
|
|
235
247
|
}
|
|
248
|
+
__name(Query, "Query");
|
|
236
249
|
function Param(property, ...pipes) {
|
|
237
|
-
return createPipesRouteParamDecorator(5
|
|
250
|
+
return createPipesRouteParamDecorator(5)(property, ...pipes);
|
|
238
251
|
}
|
|
252
|
+
__name(Param, "Param");
|
|
239
253
|
function Headers(property, ...pipes) {
|
|
240
|
-
return createPipesRouteParamDecorator(6
|
|
254
|
+
return createPipesRouteParamDecorator(6)(property, ...pipes);
|
|
241
255
|
}
|
|
256
|
+
__name(Headers, "Headers");
|
|
242
257
|
function SetMetadata(metadataKey, metadataValue) {
|
|
243
258
|
return (target, key, descriptor) => {
|
|
244
259
|
if (descriptor) {
|
|
@@ -249,26 +264,36 @@ function SetMetadata(metadataKey, metadataValue) {
|
|
|
249
264
|
return target;
|
|
250
265
|
};
|
|
251
266
|
}
|
|
267
|
+
__name(SetMetadata, "SetMetadata");
|
|
252
268
|
function HttpCode(statusCode) {
|
|
253
269
|
return (target, key, descriptor) => {
|
|
254
270
|
Reflect.defineMetadata(METADATA_KEYS.HTTP_CODE, statusCode, descriptor.value);
|
|
255
271
|
return descriptor;
|
|
256
272
|
};
|
|
257
273
|
}
|
|
274
|
+
__name(HttpCode, "HttpCode");
|
|
258
275
|
function Header(name, value) {
|
|
259
276
|
return (target, key, descriptor) => {
|
|
260
277
|
const headers = Reflect.getMetadata(METADATA_KEYS.HEADERS, descriptor.value) || [];
|
|
261
|
-
headers.push({
|
|
278
|
+
headers.push({
|
|
279
|
+
name,
|
|
280
|
+
value
|
|
281
|
+
});
|
|
262
282
|
Reflect.defineMetadata(METADATA_KEYS.HEADERS, headers, descriptor.value);
|
|
263
283
|
return descriptor;
|
|
264
284
|
};
|
|
265
285
|
}
|
|
286
|
+
__name(Header, "Header");
|
|
266
287
|
function Redirect(url, statusCode = 302) {
|
|
267
288
|
return (target, key, descriptor) => {
|
|
268
|
-
Reflect.defineMetadata(METADATA_KEYS.REDIRECT, {
|
|
289
|
+
Reflect.defineMetadata(METADATA_KEYS.REDIRECT, {
|
|
290
|
+
url,
|
|
291
|
+
statusCode
|
|
292
|
+
}, descriptor.value);
|
|
269
293
|
return descriptor;
|
|
270
294
|
};
|
|
271
295
|
}
|
|
296
|
+
__name(Redirect, "Redirect");
|
|
272
297
|
function applyDecorators(...decorators) {
|
|
273
298
|
return (target, propertyKey, descriptor) => {
|
|
274
299
|
for (const decorator of decorators) {
|
|
@@ -284,20 +309,17 @@ function applyDecorators(...decorators) {
|
|
|
284
309
|
}
|
|
285
310
|
};
|
|
286
311
|
}
|
|
312
|
+
__name(applyDecorators, "applyDecorators");
|
|
287
313
|
function createParamDecorator(factory) {
|
|
288
|
-
const paramtype = 13
|
|
314
|
+
const paramtype = 13;
|
|
289
315
|
return (data) => {
|
|
290
316
|
return (target, key, index) => {
|
|
291
317
|
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
|
-
);
|
|
318
|
+
Reflect.defineMetadata(METADATA_KEYS.ROUTE_ARGS_METADATA, assignMetadata(args, paramtype, index, data, factory), target.constructor, key);
|
|
298
319
|
};
|
|
299
320
|
};
|
|
300
321
|
}
|
|
322
|
+
__name(createParamDecorator, "createParamDecorator");
|
|
301
323
|
|
|
302
324
|
exports.All = All;
|
|
303
325
|
exports.Body = Body;
|
package/dist/decorators.d.cts
CHANGED
|
@@ -1,70 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
export { r as All, Y as Body, s as Catch, l as Controller, X as Ctx, a1 as CustomDecorator, D as Delete, L as FileParam, Q as Files, m as Get, G as Global, q as Head, a3 as Header, $ as Headers, W as HostParam, a2 as HttpCode, t as Inject, k as Injectable, h as InjectableOptions, V as Ip, j as Module, g as ModuleOptions, N as Next, u as Optional, O as Options, _ as Param, p as Patch, n as Post, o as Put, Z as Query, a4 as Redirect, B as Request, f as RequestMethod, J as Response, i as RouteDefinition, y as RouteParamtypes, S as Scope, K as Session, a0 as SetMetadata, U as UseFilters, v as UseGuards, w as UseInterceptors, x as UsePipes, a5 as applyDecorators, z as assignMetadata, a6 as createParamDecorator } from './decorators-ClTJ_N9c.cjs';
|
|
2
2
|
import 'hono';
|
|
3
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 };
|
package/dist/decorators.d.ts
CHANGED
|
@@ -1,70 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
export { r as All, Y as Body, s as Catch, l as Controller, X as Ctx, a1 as CustomDecorator, D as Delete, L as FileParam, Q as Files, m as Get, G as Global, q as Head, a3 as Header, $ as Headers, W as HostParam, a2 as HttpCode, t as Inject, k as Injectable, h as InjectableOptions, V as Ip, j as Module, g as ModuleOptions, N as Next, u as Optional, O as Options, _ as Param, p as Patch, n as Post, o as Put, Z as Query, a4 as Redirect, B as Request, f as RequestMethod, J as Response, i as RouteDefinition, y as RouteParamtypes, S as Scope, K as Session, a0 as SetMetadata, U as UseFilters, v as UseGuards, w as UseInterceptors, x as UsePipes, a5 as applyDecorators, z as assignMetadata, a6 as createParamDecorator } from './decorators-ClTJ_N9c.js';
|
|
2
2
|
import 'hono';
|
|
3
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 };
|