@stacksjs/bun-router 0.0.27 → 0.1.0
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/chunk-0gjq8ttx.js +14 -0
- package/dist/chunk-0t5vz87j.js +35 -0
- package/dist/chunk-30rkn2ym.js +2 -0
- package/dist/chunk-38cmrard.js +2 -0
- package/dist/chunk-3qna6dwd.js +2 -0
- package/dist/chunk-4d5fmta0.js +2 -0
- package/dist/chunk-4x3b4b4q.js +2 -0
- package/dist/chunk-5be9x5cq.js +3 -0
- package/dist/chunk-5mxby3fd.js +1654 -0
- package/dist/chunk-5n0ckcmc.js +3 -0
- package/dist/chunk-5ncn73tp.js +3 -0
- package/dist/chunk-5s0pnsd6.js +12 -0
- package/dist/chunk-5s1pr62n.js +3 -0
- package/dist/chunk-67wgad4f.js +60 -0
- package/dist/chunk-6bbmkwng.js +3 -0
- package/dist/chunk-6s1kbajm.js +7851 -0
- package/dist/chunk-6sjvhy5f.js +3 -0
- package/dist/chunk-6xed4va1.js +2 -0
- package/dist/chunk-73k79n7q.js +15413 -0
- package/dist/chunk-748n6ydj.js +2 -0
- package/dist/chunk-7qnxdedn.js +321 -0
- package/dist/chunk-7rsf8tes.js +898 -0
- package/dist/chunk-8aspmtf1.js +2 -0
- package/dist/chunk-8wpj3fqe.js +351 -0
- package/dist/chunk-8yfdg595.js +2 -0
- package/dist/chunk-90eze7av.js +3 -0
- package/dist/chunk-9805tt8n.js +341 -0
- package/dist/chunk-9dvwyej7.js +2 -0
- package/dist/chunk-9ght4n4r.js +216 -0
- package/dist/chunk-a2w45krb.js +2 -0
- package/dist/chunk-a3wahyg7.js +3 -0
- package/dist/chunk-a547f2ab.js +48 -0
- package/dist/chunk-bqdycvtc.js +2 -0
- package/dist/chunk-brpgjyqg.js +3 -0
- package/dist/chunk-cd03rk3x.js +2 -0
- package/dist/chunk-csfrpsp7.js +185 -0
- package/dist/chunk-ct0m17q5.js +2 -0
- package/dist/chunk-dhbvvr5h.js +2 -0
- package/dist/chunk-dhptcsya.js +943 -0
- package/dist/chunk-dq93zag9.js +2 -0
- package/dist/chunk-dxg045wj.js +5 -0
- package/dist/chunk-e3qej0jr.js +4 -0
- package/dist/chunk-edrtesh7.js +2 -0
- package/dist/chunk-ejcws37w.js +2 -0
- package/dist/chunk-ex5fkjah.js +397 -0
- package/dist/chunk-ex890p45.js +51 -0
- package/dist/chunk-f69cpnhw.js +2 -0
- package/dist/chunk-fjf53b44.js +2 -0
- package/dist/chunk-fjzye4qj.js +2 -0
- package/dist/chunk-gfd23b6t.js +2 -0
- package/dist/chunk-habv0vef.js +12 -0
- package/dist/chunk-hmgedrmr.js +11 -0
- package/dist/chunk-hz6fc788.js +2 -0
- package/dist/chunk-jff6j9y3.js +10 -0
- package/dist/chunk-jmeb7n8k.js +70 -0
- package/dist/chunk-jrf5a2ap.js +2 -0
- package/dist/chunk-jy2jhcpy.js +246 -0
- package/dist/chunk-kc659vhx.js +4 -0
- package/dist/chunk-kjtjbcq4.js +71 -0
- package/dist/chunk-krkchy8v.js +4 -0
- package/dist/chunk-kxp888dn.js +4540 -0
- package/dist/chunk-m249t3je.js +3 -0
- package/dist/chunk-m9yabnjx.js +2 -0
- package/dist/chunk-mekrq9wd.js +2 -0
- package/dist/chunk-mmxv535f.js +82 -0
- package/dist/chunk-mypn7jss.js +2 -0
- package/dist/chunk-n18x1k3c.js +2 -0
- package/dist/chunk-nkddjzsa.js +2 -0
- package/dist/chunk-pjmhqmr9.js +2 -0
- package/dist/chunk-qyrnsaq1.js +2 -0
- package/dist/chunk-r19ff2qm.js +62 -0
- package/dist/chunk-r338fssq.js +2 -0
- package/dist/chunk-s36z58x2.js +29 -0
- package/dist/chunk-s3dn1kwx.js +231 -0
- package/dist/chunk-s79dd325.js +471 -0
- package/dist/chunk-sw0chtw4.js +4 -0
- package/dist/chunk-ta38j9em.js +2 -0
- package/dist/chunk-tpfgntwj.js +4211 -0
- package/dist/chunk-vr10sbbh.js +3 -0
- package/dist/chunk-vsh4390q.js +358 -0
- package/dist/chunk-vv3gb1m5.js +84 -0
- package/dist/chunk-vw8rwv6e.js +2 -0
- package/dist/chunk-w4r464v5.js +288 -0
- package/dist/chunk-wcrqs5z9.js +2 -0
- package/dist/chunk-x6d1rmwa.js +2 -0
- package/dist/chunk-x7ft15zz.js +2 -0
- package/dist/chunk-x8trwn7j.js +3 -0
- package/dist/chunk-xg9xscqz.js +1 -0
- package/dist/chunk-xhepdj1f.js +2 -0
- package/dist/chunk-xv2em0q4.js +4 -0
- package/dist/chunk-ypw6g0te.js +2 -0
- package/dist/chunk-z8szsm21.js +2 -0
- package/dist/chunk-zetqzgf3.js +194 -0
- package/dist/chunk-zfbh14qe.js +2 -0
- package/dist/chunk-zhx0hxdd.js +28 -0
- package/dist/cli.js +67 -3240
- package/dist/container/index.js +1 -321
- package/dist/index.js +80 -13987
- package/package.json +1 -1
- package/dist/chunk-1ahs68ys.js +0 -18
- package/dist/chunk-cgptvjdf.js +0 -18131
- package/dist/chunk-g3ybefhg.js +0 -1923
package/dist/container/index.js
CHANGED
|
@@ -1,322 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import {
|
|
3
|
-
AuthGuard,
|
|
4
|
-
AuthService,
|
|
5
|
-
AuthServiceProvider,
|
|
6
|
-
BaseDeferredServiceProvider,
|
|
7
|
-
BaseServiceProvider,
|
|
8
|
-
BindingBuilder,
|
|
9
|
-
BindingConditions,
|
|
10
|
-
CacheManager,
|
|
11
|
-
CacheServiceProvider,
|
|
12
|
-
ConfigService,
|
|
13
|
-
ConfigServiceProvider,
|
|
14
|
-
ConsoleLogger,
|
|
15
|
-
Container,
|
|
16
|
-
ContextualContainer,
|
|
17
|
-
DatabaseConnection,
|
|
18
|
-
DatabaseServiceProvider,
|
|
19
|
-
DefaultContextualBindingBuilder,
|
|
20
|
-
DefaultServiceProviderManager,
|
|
21
|
-
EnvironmentManager,
|
|
22
|
-
EnvironmentPresets,
|
|
23
|
-
EventBus,
|
|
24
|
-
EventDispatcher,
|
|
25
|
-
EventServiceProvider,
|
|
26
|
-
FileLogger,
|
|
27
|
-
INJECTABLE_METADATA_KEY,
|
|
28
|
-
INJECT_METADATA_KEY,
|
|
29
|
-
JwtService,
|
|
30
|
-
Logger,
|
|
31
|
-
LoggingServiceProvider,
|
|
32
|
-
MemoryCache,
|
|
33
|
-
OPTIONAL_METADATA_KEY,
|
|
34
|
-
PostRepository,
|
|
35
|
-
RedisCache,
|
|
36
|
-
TAGGED_METADATA_KEY,
|
|
37
|
-
UserRepository,
|
|
38
|
-
ValidationPipe,
|
|
39
|
-
ValidationServiceProvider,
|
|
40
|
-
Validator,
|
|
41
|
-
createContainer,
|
|
42
|
-
getContainer,
|
|
43
|
-
setContainer
|
|
44
|
-
} from "../chunk-g3ybefhg.js";
|
|
45
|
-
import"../chunk-1ahs68ys.js";
|
|
46
|
-
// src/container/decorators.ts
|
|
47
|
-
var CONTROLLER_METADATA_KEY = Symbol("controller");
|
|
48
|
-
var ROUTE_METADATA_KEY = Symbol("route");
|
|
49
|
-
var MIDDLEWARE_METADATA_KEY = Symbol("middleware");
|
|
50
|
-
var PARAM_METADATA_KEY = Symbol("param");
|
|
51
|
-
function Injectable(metadata = {}) {
|
|
52
|
-
return (target) => {
|
|
53
|
-
target[INJECTABLE_METADATA_KEY] = metadata;
|
|
54
|
-
return target;
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
function Inject(token, options) {
|
|
58
|
-
return function(target, _propertyKey, parameterIndex) {
|
|
59
|
-
const classConstructor = target.constructor === Function ? target : target.constructor;
|
|
60
|
-
if (!classConstructor[INJECT_METADATA_KEY]) {
|
|
61
|
-
classConstructor[INJECT_METADATA_KEY] = [];
|
|
62
|
-
}
|
|
63
|
-
const metadata = {
|
|
64
|
-
token,
|
|
65
|
-
optional: options?.optional,
|
|
66
|
-
tags: options?.tags,
|
|
67
|
-
when: options?.when
|
|
68
|
-
};
|
|
69
|
-
classConstructor[INJECT_METADATA_KEY][parameterIndex] = metadata;
|
|
70
|
-
};
|
|
71
|
-
}
|
|
72
|
-
function Optional() {
|
|
73
|
-
return (target, _propertyKey, parameterIndex) => {
|
|
74
|
-
if (!target[OPTIONAL_METADATA_KEY]) {
|
|
75
|
-
target[OPTIONAL_METADATA_KEY] = [];
|
|
76
|
-
}
|
|
77
|
-
target[OPTIONAL_METADATA_KEY][parameterIndex] = true;
|
|
78
|
-
};
|
|
79
|
-
}
|
|
80
|
-
function Tagged(tag) {
|
|
81
|
-
return function(target, _propertyKey, parameterIndex) {
|
|
82
|
-
if (!target[TAGGED_METADATA_KEY]) {
|
|
83
|
-
target[TAGGED_METADATA_KEY] = [];
|
|
84
|
-
}
|
|
85
|
-
target[TAGGED_METADATA_KEY][parameterIndex] = tag;
|
|
86
|
-
};
|
|
87
|
-
}
|
|
88
|
-
function Controller(prefix, options) {
|
|
89
|
-
return function(target) {
|
|
90
|
-
const metadata = {
|
|
91
|
-
prefix: prefix || "",
|
|
92
|
-
middleware: options?.middleware || [],
|
|
93
|
-
tags: options?.tags || []
|
|
94
|
-
};
|
|
95
|
-
target[CONTROLLER_METADATA_KEY] = metadata;
|
|
96
|
-
return target;
|
|
97
|
-
};
|
|
98
|
-
}
|
|
99
|
-
function Get(path = "", options) {
|
|
100
|
-
return createRouteDecorator("GET", path, options);
|
|
101
|
-
}
|
|
102
|
-
function Post(path = "", options) {
|
|
103
|
-
return createRouteDecorator("POST", path, options);
|
|
104
|
-
}
|
|
105
|
-
function Put(path = "", options) {
|
|
106
|
-
return createRouteDecorator("PUT", path, options);
|
|
107
|
-
}
|
|
108
|
-
function Delete(path = "", options) {
|
|
109
|
-
return createRouteDecorator("DELETE", path, options);
|
|
110
|
-
}
|
|
111
|
-
function Patch(path = "", options) {
|
|
112
|
-
return createRouteDecorator("PATCH", path, options);
|
|
113
|
-
}
|
|
114
|
-
function Options(path = "", options) {
|
|
115
|
-
return createRouteDecorator("OPTIONS", path, options);
|
|
116
|
-
}
|
|
117
|
-
function Head(path = "", options) {
|
|
118
|
-
return createRouteDecorator("HEAD", path, options);
|
|
119
|
-
}
|
|
120
|
-
function createRouteDecorator(method, path, options) {
|
|
121
|
-
return function(target, propertyKey, descriptor) {
|
|
122
|
-
if (!target.constructor[ROUTE_METADATA_KEY]) {
|
|
123
|
-
target.constructor[ROUTE_METADATA_KEY] = [];
|
|
124
|
-
}
|
|
125
|
-
const metadata = {
|
|
126
|
-
method,
|
|
127
|
-
path,
|
|
128
|
-
middleware: options?.middleware || [],
|
|
129
|
-
tags: options?.tags || []
|
|
130
|
-
};
|
|
131
|
-
target.constructor[ROUTE_METADATA_KEY].push({
|
|
132
|
-
...metadata,
|
|
133
|
-
propertyKey,
|
|
134
|
-
handler: descriptor.value
|
|
135
|
-
});
|
|
136
|
-
return descriptor;
|
|
137
|
-
};
|
|
138
|
-
}
|
|
139
|
-
function UseMiddleware(...middleware) {
|
|
140
|
-
return function(target, propertyKey, descriptor) {
|
|
141
|
-
if (propertyKey && descriptor) {
|
|
142
|
-
if (!target.constructor[MIDDLEWARE_METADATA_KEY]) {
|
|
143
|
-
target.constructor[MIDDLEWARE_METADATA_KEY] = new Map;
|
|
144
|
-
}
|
|
145
|
-
target.constructor[MIDDLEWARE_METADATA_KEY].set(propertyKey, middleware);
|
|
146
|
-
} else {
|
|
147
|
-
target[MIDDLEWARE_METADATA_KEY] = middleware;
|
|
148
|
-
}
|
|
149
|
-
return descriptor || target;
|
|
150
|
-
};
|
|
151
|
-
}
|
|
152
|
-
function Param(key) {
|
|
153
|
-
return createParamDecorator("param", key);
|
|
154
|
-
}
|
|
155
|
-
function Query(key) {
|
|
156
|
-
return createParamDecorator("query", key);
|
|
157
|
-
}
|
|
158
|
-
function Body() {
|
|
159
|
-
return createParamDecorator("body");
|
|
160
|
-
}
|
|
161
|
-
function Header(key) {
|
|
162
|
-
return createParamDecorator("header", key);
|
|
163
|
-
}
|
|
164
|
-
function Cookie(key) {
|
|
165
|
-
return createParamDecorator("cookie", key);
|
|
166
|
-
}
|
|
167
|
-
function InjectParam(token) {
|
|
168
|
-
return createParamDecorator("param", undefined, token);
|
|
169
|
-
}
|
|
170
|
-
function createParamDecorator(type, key, token) {
|
|
171
|
-
return function(target, propertyKey, parameterIndex) {
|
|
172
|
-
if (!target.constructor[PARAM_METADATA_KEY]) {
|
|
173
|
-
target.constructor[PARAM_METADATA_KEY] = new Map;
|
|
174
|
-
}
|
|
175
|
-
if (!target.constructor[PARAM_METADATA_KEY].has(propertyKey)) {
|
|
176
|
-
target.constructor[PARAM_METADATA_KEY].set(propertyKey, []);
|
|
177
|
-
}
|
|
178
|
-
const metadata = {
|
|
179
|
-
type,
|
|
180
|
-
key,
|
|
181
|
-
token
|
|
182
|
-
};
|
|
183
|
-
target.constructor[PARAM_METADATA_KEY].get(propertyKey)[parameterIndex] = metadata;
|
|
184
|
-
};
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
class MetadataReader {
|
|
188
|
-
static getInjectableMetadata(target) {
|
|
189
|
-
return target[INJECTABLE_METADATA_KEY];
|
|
190
|
-
}
|
|
191
|
-
static getInjectMetadata(target) {
|
|
192
|
-
return target[INJECT_METADATA_KEY] || [];
|
|
193
|
-
}
|
|
194
|
-
static getOptionalMetadata(target) {
|
|
195
|
-
return target[OPTIONAL_METADATA_KEY] || [];
|
|
196
|
-
}
|
|
197
|
-
static getTaggedMetadata(target) {
|
|
198
|
-
return target[TAGGED_METADATA_KEY] || [];
|
|
199
|
-
}
|
|
200
|
-
static getControllerMetadata(target) {
|
|
201
|
-
return target[CONTROLLER_METADATA_KEY];
|
|
202
|
-
}
|
|
203
|
-
static getAllRoutes(target) {
|
|
204
|
-
return target[ROUTE_METADATA_KEY] || [];
|
|
205
|
-
}
|
|
206
|
-
static getMiddlewareMetadata(target, propertyKey) {
|
|
207
|
-
if (propertyKey) {
|
|
208
|
-
const methodMiddleware = target[MIDDLEWARE_METADATA_KEY]?.get(propertyKey);
|
|
209
|
-
return methodMiddleware || [];
|
|
210
|
-
}
|
|
211
|
-
return target[MIDDLEWARE_METADATA_KEY] || [];
|
|
212
|
-
}
|
|
213
|
-
static getParamMetadata(target, propertyKey) {
|
|
214
|
-
return target[PARAM_METADATA_KEY]?.get(propertyKey) || [];
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
class DecoratorContainer extends Container {
|
|
219
|
-
registerController(controllerClass) {
|
|
220
|
-
const metadata = MetadataReader.getControllerMetadata(controllerClass);
|
|
221
|
-
if (!metadata) {
|
|
222
|
-
throw new Error(`Class ${controllerClass.name} is not decorated with @Controller`);
|
|
223
|
-
}
|
|
224
|
-
this.singleton(controllerClass, controllerClass);
|
|
225
|
-
const routes = MetadataReader.getAllRoutes(controllerClass);
|
|
226
|
-
for (const _route of routes) {}
|
|
227
|
-
}
|
|
228
|
-
resolve(token, context) {
|
|
229
|
-
if (typeof token === "function") {
|
|
230
|
-
const metadata = MetadataReader.getInjectableMetadata(token);
|
|
231
|
-
if (metadata) {
|
|
232
|
-
try {
|
|
233
|
-
return super.resolve(token, context);
|
|
234
|
-
} catch {
|
|
235
|
-
const scope = metadata.scope || "transient";
|
|
236
|
-
switch (scope) {
|
|
237
|
-
case "singleton":
|
|
238
|
-
this.singleton(token, token);
|
|
239
|
-
break;
|
|
240
|
-
case "transient":
|
|
241
|
-
this.transient(token, token);
|
|
242
|
-
break;
|
|
243
|
-
default:
|
|
244
|
-
this.transient(token, token);
|
|
245
|
-
}
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
return super.resolve(token, context);
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
var decoratorContainer = new DecoratorContainer;
|
|
253
|
-
export {
|
|
254
|
-
setContainer,
|
|
255
|
-
getContainer,
|
|
256
|
-
decoratorContainer,
|
|
257
|
-
createContainer,
|
|
258
|
-
Validator,
|
|
259
|
-
ValidationServiceProvider,
|
|
260
|
-
ValidationPipe,
|
|
261
|
-
UserRepository,
|
|
262
|
-
UseMiddleware,
|
|
263
|
-
Tagged,
|
|
264
|
-
TAGGED_METADATA_KEY,
|
|
265
|
-
RedisCache,
|
|
266
|
-
ROUTE_METADATA_KEY,
|
|
267
|
-
Query,
|
|
268
|
-
Put,
|
|
269
|
-
PostRepository,
|
|
270
|
-
Post,
|
|
271
|
-
Patch,
|
|
272
|
-
Param,
|
|
273
|
-
PARAM_METADATA_KEY,
|
|
274
|
-
Options,
|
|
275
|
-
Optional,
|
|
276
|
-
OPTIONAL_METADATA_KEY,
|
|
277
|
-
MetadataReader,
|
|
278
|
-
MemoryCache,
|
|
279
|
-
MIDDLEWARE_METADATA_KEY,
|
|
280
|
-
LoggingServiceProvider,
|
|
281
|
-
Logger,
|
|
282
|
-
JwtService,
|
|
283
|
-
Injectable,
|
|
284
|
-
InjectParam,
|
|
285
|
-
Inject,
|
|
286
|
-
INJECT_METADATA_KEY,
|
|
287
|
-
INJECTABLE_METADATA_KEY,
|
|
288
|
-
Header,
|
|
289
|
-
Head,
|
|
290
|
-
Get,
|
|
291
|
-
FileLogger,
|
|
292
|
-
EventServiceProvider,
|
|
293
|
-
EventDispatcher,
|
|
294
|
-
EventBus,
|
|
295
|
-
EnvironmentPresets,
|
|
296
|
-
EnvironmentManager,
|
|
297
|
-
Delete,
|
|
298
|
-
DefaultServiceProviderManager,
|
|
299
|
-
DefaultContextualBindingBuilder,
|
|
300
|
-
DecoratorContainer,
|
|
301
|
-
DatabaseServiceProvider,
|
|
302
|
-
DatabaseConnection,
|
|
303
|
-
Container as DIContainer,
|
|
304
|
-
Cookie,
|
|
305
|
-
Controller,
|
|
306
|
-
ContextualContainer,
|
|
307
|
-
Container,
|
|
308
|
-
ConsoleLogger,
|
|
309
|
-
ConfigServiceProvider,
|
|
310
|
-
ConfigService,
|
|
311
|
-
CacheServiceProvider,
|
|
312
|
-
CacheManager,
|
|
313
|
-
CONTROLLER_METADATA_KEY,
|
|
314
|
-
Body,
|
|
315
|
-
BindingConditions,
|
|
316
|
-
BindingBuilder,
|
|
317
|
-
BaseServiceProvider,
|
|
318
|
-
BaseDeferredServiceProvider,
|
|
319
|
-
AuthServiceProvider,
|
|
320
|
-
AuthService,
|
|
321
|
-
AuthGuard
|
|
322
|
-
};
|
|
2
|
+
import{$r as Oj,Ar as e,Br as t,Cr as jj,Dr as qj,Er as zj,Fr as Fj,Gr as Hj,Hr as Qj,Ir as Sj,Jr as Vj,Kr as Xj,Lr as Zj,Mr as $j,Nr as bj,Or as vj,Pr as Bj,Qr as wj,Rr as Uj,Sr as fj,Tr as Wj,Ur as Jj,Vr as Gj,Wr as uj,Xr as Nj,Yr as xj,Zr as Pj,_r as Lj,as as hj,bs as Cj,cs as Ij,qr as f,rr as b,sr as v,tr as B,ur as G,vr as E,wr as A,xr as o,yr as a,zr as r}from"../chunk-mmxv535f.js";import"../chunk-a3wahyg7.js";var W=Symbol("controller"),w=Symbol("route"),V=Symbol("middleware"),S=Symbol("param");function u(j={}){return(q)=>{return q[f]=j,q}}function N(j,q){return function(z,F,Q){let H=z.constructor===Function?z:z.constructor;if(!H[b])H[b]=[];let $={token:j,optional:q?.optional,tags:q?.tags,when:q?.when};H[b][Q]=$}}function x(){return(j,q,z)=>{if(!j[v])j[v]=[];j[v][z]=!0}}function P(j){return function(q,z,F){if(!q[B])q[B]=[];q[B][F]=j}}function L(j,q){return function(z){let F={prefix:j||"",middleware:q?.middleware||[],tags:q?.tags||[]};return z[W]=F,z}}function O(j="",q){return X("GET",j,q)}function h(j="",q){return X("POST",j,q)}function C(j="",q){return X("PUT",j,q)}function I(j="",q){return X("DELETE",j,q)}function m(j="",q){return X("PATCH",j,q)}function R(j="",q){return X("OPTIONS",j,q)}function k(j="",q){return X("HEAD",j,q)}function X(j,q,z){return function(F,Q,H){if(!F.constructor[w])F.constructor[w]=[];let $={method:j,path:q,middleware:z?.middleware||[],tags:z?.tags||[]};return F.constructor[w].push({...$,propertyKey:Q,handler:H.value}),H}}function Y(...j){return function(q,z,F){if(z&&F){if(!q.constructor[V])q.constructor[V]=new Map;q.constructor[V].set(z,j)}else q[V]=j;return F||q}}function l(j){return Z("param",j)}function y(j){return Z("query",j)}function d(){return Z("body")}function K(j){return Z("header",j)}function M(j){return Z("cookie",j)}function i(j){return Z("param",void 0,j)}function Z(j,q,z){return function(F,Q,H){if(!F.constructor[S])F.constructor[S]=new Map;if(!F.constructor[S].has(Q))F.constructor[S].set(Q,[]);let $={type:j,key:q,token:z};F.constructor[S].get(Q)[H]=$}}class U{static getInjectableMetadata(j){return j[f]}static getInjectMetadata(j){return j[b]||[]}static getOptionalMetadata(j){return j[v]||[]}static getTaggedMetadata(j){return j[B]||[]}static getControllerMetadata(j){return j[W]}static getAllRoutes(j){return j[w]||[]}static getMiddlewareMetadata(j,q){if(q)return j[V]?.get(q)||[];return j[V]||[]}static getParamMetadata(j,q){return j[S]?.get(q)||[]}}class J extends G{registerController(j){if(!U.getControllerMetadata(j))throw Error(`Class ${j.name} is not decorated with @Controller`);this.singleton(j,j);let z=U.getAllRoutes(j);for(let F of z);}resolve(j,q){if(typeof j==="function"){let z=U.getInjectableMetadata(j);if(z)try{return super.resolve(j,q)}catch{switch(z.scope||"transient"){case"singleton":this.singleton(j,j);break;case"transient":this.transient(j,j);break;default:this.transient(j,j)}}}return super.resolve(j,q)}}var c=new J;export{o as setContainer,A as getContainer,c as decoratorContainer,a as createContainer,Oj as Validator,$j as ValidationServiceProvider,hj as ValidationPipe,Wj as UserRepository,Y as UseMiddleware,P as Tagged,B as TAGGED_METADATA_KEY,Nj as RedisCache,w as ROUTE_METADATA_KEY,y as Query,C as Put,Jj as PostRepository,h as Post,m as Patch,l as Param,S as PARAM_METADATA_KEY,R as Options,x as Optional,v as OPTIONAL_METADATA_KEY,U as MetadataReader,uj as MemoryCache,V as MIDDLEWARE_METADATA_KEY,Sj as LoggingServiceProvider,Bj as Logger,Pj as JwtService,u as Injectable,i as InjectParam,N as Inject,b as INJECT_METADATA_KEY,f as INJECTABLE_METADATA_KEY,K as Header,k as Head,O as Get,Uj as FileLogger,bj as EventServiceProvider,Ij as EventDispatcher,Cj as EventBus,jj as EnvironmentPresets,r as EnvironmentManager,I as Delete,Hj as DefaultServiceProviderManager,e as DefaultContextualBindingBuilder,J as DecoratorContainer,Vj as DatabaseServiceProvider,fj as DatabaseConnection,G as DIContainer,M as Cookie,L as Controller,t as ContextualContainer,G as Container,wj as ConsoleLogger,Qj as ConfigServiceProvider,vj as ConfigService,Xj as CacheServiceProvider,Gj as CacheManager,W as CONTROLLER_METADATA_KEY,d as Body,qj as BindingConditions,E as BindingBuilder,zj as BaseServiceProvider,Fj as BaseDeferredServiceProvider,Zj as AuthServiceProvider,xj as AuthService,Lj as AuthGuard};
|