@carno.js/core 0.2.11 → 1.0.2

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 (314) hide show
  1. package/LICENSE +673 -673
  2. package/README.md +188 -0
  3. package/dist/Carno.js +272 -333
  4. package/dist/Carno.mjs +268 -0
  5. package/dist/DefaultRoutes.js +51 -0
  6. package/dist/DefaultRoutes.mjs +34 -0
  7. package/dist/bun/index.js +183 -0
  8. package/dist/bun/index.js.map +86 -0
  9. package/dist/cache/CacheDriver.js +13 -0
  10. package/dist/cache/CacheDriver.mjs +0 -0
  11. package/dist/cache/CacheService.js +113 -0
  12. package/dist/cache/CacheService.mjs +93 -0
  13. package/dist/cache/MemoryDriver.js +66 -0
  14. package/dist/cache/MemoryDriver.mjs +46 -0
  15. package/dist/cache/RedisDriver.js +81 -0
  16. package/dist/cache/RedisDriver.mjs +61 -0
  17. package/dist/compiler/JITCompiler.js +111 -0
  18. package/dist/compiler/JITCompiler.mjs +89 -0
  19. package/dist/container/Container.js +99 -0
  20. package/dist/container/Container.mjs +78 -0
  21. package/dist/context/Context.js +97 -0
  22. package/dist/context/Context.mjs +77 -0
  23. package/dist/cors/CorsHandler.js +90 -0
  24. package/dist/cors/CorsHandler.mjs +68 -0
  25. package/dist/decorators/Controller.js +42 -0
  26. package/dist/decorators/Controller.mjs +22 -0
  27. package/dist/decorators/Inject.js +30 -0
  28. package/dist/decorators/Inject.mjs +10 -0
  29. package/dist/decorators/Middleware.js +35 -0
  30. package/dist/decorators/Middleware.mjs +15 -0
  31. package/dist/decorators/Service.js +31 -0
  32. package/dist/decorators/Service.mjs +12 -0
  33. package/dist/decorators/methods.js +60 -0
  34. package/dist/decorators/methods.mjs +34 -0
  35. package/dist/decorators/params.js +63 -0
  36. package/dist/decorators/params.mjs +37 -0
  37. package/dist/events/Lifecycle.js +69 -0
  38. package/dist/events/Lifecycle.mjs +41 -0
  39. package/dist/exceptions/HttpException.js +112 -26
  40. package/dist/exceptions/HttpException.mjs +82 -0
  41. package/dist/index.js +129 -31
  42. package/dist/index.mjs +94 -0
  43. package/dist/metadata.js +34 -0
  44. package/dist/metadata.mjs +9 -0
  45. package/dist/middleware/CarnoMiddleware.js +13 -0
  46. package/dist/middleware/CarnoMiddleware.mjs +0 -0
  47. package/dist/router/RadixRouter.js +121 -0
  48. package/dist/router/RadixRouter.mjs +101 -0
  49. package/dist/testing/TestHarness.js +81 -0
  50. package/dist/testing/TestHarness.mjs +60 -0
  51. package/dist/utils/Metadata.js +53 -0
  52. package/dist/utils/Metadata.mjs +31 -0
  53. package/dist/validation/ValibotAdapter.js +67 -0
  54. package/dist/validation/ValibotAdapter.mjs +48 -0
  55. package/dist/validation/ValidatorAdapter.js +35 -19
  56. package/dist/validation/ValidatorAdapter.mjs +14 -0
  57. package/dist/validation/ZodAdapter.js +80 -0
  58. package/dist/validation/ZodAdapter.mjs +59 -0
  59. package/package.json +21 -63
  60. package/src/Carno.ts +605 -0
  61. package/src/DefaultRoutes.ts +34 -0
  62. package/src/cache/CacheDriver.ts +50 -0
  63. package/src/cache/CacheService.ts +139 -0
  64. package/src/cache/MemoryDriver.ts +104 -0
  65. package/src/cache/RedisDriver.ts +116 -0
  66. package/src/compiler/JITCompiler.ts +167 -0
  67. package/src/container/Container.ts +168 -0
  68. package/src/context/Context.ts +128 -0
  69. package/src/cors/CorsHandler.ts +145 -0
  70. package/src/decorators/Controller.ts +63 -0
  71. package/src/decorators/Inject.ts +16 -0
  72. package/src/decorators/Middleware.ts +22 -0
  73. package/src/decorators/Service.ts +18 -0
  74. package/src/decorators/methods.ts +58 -0
  75. package/src/decorators/params.ts +47 -0
  76. package/src/events/Lifecycle.ts +97 -0
  77. package/src/exceptions/HttpException.ts +99 -0
  78. package/src/index.ts +92 -0
  79. package/src/metadata.ts +46 -0
  80. package/src/middleware/CarnoMiddleware.ts +14 -0
  81. package/src/router/RadixRouter.ts +225 -0
  82. package/src/testing/TestHarness.ts +177 -0
  83. package/src/utils/Metadata.ts +43 -0
  84. package/src/validation/ValibotAdapter.ts +95 -0
  85. package/src/validation/ValidatorAdapter.ts +69 -0
  86. package/src/validation/ZodAdapter.ts +102 -0
  87. package/dist/Carno.d.ts +0 -75
  88. package/dist/cache/bento-cache.driver.d.ts +0 -13
  89. package/dist/cache/bento-cache.driver.js +0 -55
  90. package/dist/cache/cache.service.d.ts +0 -8
  91. package/dist/cache/cache.service.js +0 -6
  92. package/dist/commons/decorators/Injectable.decorator.d.ts +0 -20
  93. package/dist/commons/decorators/Injectable.decorator.js +0 -33
  94. package/dist/commons/decorators/controller.decorator.d.ts +0 -8
  95. package/dist/commons/decorators/controller.decorator.js +0 -22
  96. package/dist/commons/decorators/http.decorators.d.ts +0 -13
  97. package/dist/commons/decorators/http.decorators.js +0 -63
  98. package/dist/commons/decorators/index.d.ts +0 -6
  99. package/dist/commons/decorators/index.js +0 -22
  100. package/dist/commons/decorators/inject.decorator.d.ts +0 -1
  101. package/dist/commons/decorators/inject.decorator.js +0 -5
  102. package/dist/commons/decorators/middleware.decorator.d.ts +0 -2
  103. package/dist/commons/decorators/middleware.decorator.js +0 -30
  104. package/dist/commons/decorators/service.decorator.d.ts +0 -2
  105. package/dist/commons/decorators/service.decorator.js +0 -7
  106. package/dist/commons/decorators/validation.decorator.d.ts +0 -32
  107. package/dist/commons/decorators/validation.decorator.js +0 -40
  108. package/dist/commons/http-code.enum.d.ts +0 -50
  109. package/dist/commons/http-code.enum.js +0 -54
  110. package/dist/commons/index.d.ts +0 -3
  111. package/dist/commons/index.js +0 -19
  112. package/dist/commons/registries/ProviderControl.d.ts +0 -77
  113. package/dist/commons/registries/ProviderControl.js +0 -112
  114. package/dist/commons/registries/ProviderRegistry.d.ts +0 -7
  115. package/dist/commons/registries/ProviderRegistry.js +0 -20
  116. package/dist/constants.d.ts +0 -8
  117. package/dist/constants.js +0 -11
  118. package/dist/container/ContainerConfiguration.d.ts +0 -45
  119. package/dist/container/ContainerConfiguration.js +0 -121
  120. package/dist/container/DependencyResolver.d.ts +0 -20
  121. package/dist/container/DependencyResolver.js +0 -85
  122. package/dist/container/InjectorService.d.ts +0 -58
  123. package/dist/container/InjectorService.js +0 -286
  124. package/dist/container/MethodInvoker.d.ts +0 -21
  125. package/dist/container/MethodInvoker.js +0 -83
  126. package/dist/container/RouteResolver.d.ts +0 -27
  127. package/dist/container/RouteResolver.js +0 -173
  128. package/dist/container/container.d.ts +0 -41
  129. package/dist/container/container.js +0 -71
  130. package/dist/container/createContainer.d.ts +0 -3
  131. package/dist/container/createContainer.js +0 -12
  132. package/dist/container/createInjector.d.ts +0 -2
  133. package/dist/container/createInjector.js +0 -7
  134. package/dist/container/index.d.ts +0 -6
  135. package/dist/container/index.js +0 -22
  136. package/dist/container/middleware.resolver.d.ts +0 -9
  137. package/dist/container/middleware.resolver.js +0 -35
  138. package/dist/default-routes-carno.d.ts +0 -3
  139. package/dist/default-routes-carno.js +0 -29
  140. package/dist/domain/BaseContext.d.ts +0 -15
  141. package/dist/domain/BaseContext.js +0 -2
  142. package/dist/domain/CarnoClosure.d.ts +0 -1
  143. package/dist/domain/CarnoClosure.js +0 -2
  144. package/dist/domain/CarnoMiddleware.d.ts +0 -5
  145. package/dist/domain/CarnoMiddleware.js +0 -2
  146. package/dist/domain/Context.d.ts +0 -58
  147. package/dist/domain/Context.js +0 -188
  148. package/dist/domain/FastContext.d.ts +0 -34
  149. package/dist/domain/FastContext.js +0 -59
  150. package/dist/domain/LocalsContainer.d.ts +0 -4
  151. package/dist/domain/LocalsContainer.js +0 -10
  152. package/dist/domain/Metadata.d.ts +0 -449
  153. package/dist/domain/Metadata.js +0 -511
  154. package/dist/domain/cors-config.d.ts +0 -12
  155. package/dist/domain/cors-config.js +0 -18
  156. package/dist/domain/cors-headers-cache.d.ts +0 -17
  157. package/dist/domain/cors-headers-cache.js +0 -101
  158. package/dist/domain/http-method.d.ts +0 -7
  159. package/dist/domain/http-method.js +0 -11
  160. package/dist/domain/index.d.ts +0 -10
  161. package/dist/domain/index.js +0 -26
  162. package/dist/domain/provider-scope.d.ts +0 -5
  163. package/dist/domain/provider-scope.js +0 -9
  164. package/dist/domain/provider-type.d.ts +0 -6
  165. package/dist/domain/provider-type.js +0 -10
  166. package/dist/domain/provider.d.ts +0 -37
  167. package/dist/domain/provider.js +0 -70
  168. package/dist/events/hooks.decorator.d.ts +0 -3
  169. package/dist/events/hooks.decorator.js +0 -29
  170. package/dist/events/index.d.ts +0 -2
  171. package/dist/events/index.js +0 -18
  172. package/dist/events/on-event.d.ts +0 -13
  173. package/dist/events/on-event.js +0 -11
  174. package/dist/exceptions/HttpException.d.ts +0 -9
  175. package/dist/exceptions/index.d.ts +0 -1
  176. package/dist/exceptions/index.js +0 -17
  177. package/dist/index.d.ts +0 -16
  178. package/dist/route/CompiledRoute.d.ts +0 -23
  179. package/dist/route/CompiledRoute.js +0 -9
  180. package/dist/route/FastPathExecutor.d.ts +0 -12
  181. package/dist/route/FastPathExecutor.js +0 -50
  182. package/dist/route/JITCompiler.d.ts +0 -28
  183. package/dist/route/JITCompiler.js +0 -245
  184. package/dist/route/Matcher.d.ts +0 -11
  185. package/dist/route/Matcher.js +0 -48
  186. package/dist/route/ParamResolverFactory.d.ts +0 -14
  187. package/dist/route/ParamResolverFactory.js +0 -49
  188. package/dist/route/RouteCompiler.d.ts +0 -28
  189. package/dist/route/RouteCompiler.js +0 -157
  190. package/dist/route/RouteExecutor.d.ts +0 -12
  191. package/dist/route/RouteExecutor.js +0 -84
  192. package/dist/route/memoirist.d.ts +0 -31
  193. package/dist/route/memoirist.js +0 -373
  194. package/dist/services/logger.service.d.ts +0 -23
  195. package/dist/services/logger.service.js +0 -47
  196. package/dist/testing/core-testing.d.ts +0 -24
  197. package/dist/testing/core-testing.js +0 -102
  198. package/dist/testing/index.d.ts +0 -1
  199. package/dist/testing/index.js +0 -17
  200. package/dist/utils/ValidationCache.d.ts +0 -5
  201. package/dist/utils/ValidationCache.js +0 -35
  202. package/dist/utils/ancestorOf.d.ts +0 -2
  203. package/dist/utils/ancestorOf.js +0 -10
  204. package/dist/utils/ancestorsOf.d.ts +0 -6
  205. package/dist/utils/ancestorsOf.js +0 -20
  206. package/dist/utils/classOf.d.ts +0 -13
  207. package/dist/utils/classOf.js +0 -21
  208. package/dist/utils/cleanObject.d.ts +0 -6
  209. package/dist/utils/cleanObject.js +0 -22
  210. package/dist/utils/constructorOf.d.ts +0 -11
  211. package/dist/utils/constructorOf.js +0 -18
  212. package/dist/utils/createInstance.d.ts +0 -1
  213. package/dist/utils/createInstance.js +0 -7
  214. package/dist/utils/decoratorTypeOf.d.ts +0 -11
  215. package/dist/utils/decoratorTypeOf.js +0 -32
  216. package/dist/utils/deepClone.d.ts +0 -6
  217. package/dist/utils/deepClone.js +0 -63
  218. package/dist/utils/deepMerge.d.ts +0 -9
  219. package/dist/utils/deepMerge.js +0 -62
  220. package/dist/utils/descriptorOf.d.ts +0 -8
  221. package/dist/utils/descriptorOf.js +0 -16
  222. package/dist/utils/formatValidationErrors.d.ts +0 -5
  223. package/dist/utils/formatValidationErrors.js +0 -80
  224. package/dist/utils/getClassOrSymbol.d.ts +0 -1
  225. package/dist/utils/getClassOrSymbol.js +0 -8
  226. package/dist/utils/getConstructorArgNames.d.ts +0 -1
  227. package/dist/utils/getConstructorArgNames.js +0 -12
  228. package/dist/utils/getMethodArgTypes.d.ts +0 -1
  229. package/dist/utils/getMethodArgTypes.js +0 -9
  230. package/dist/utils/getValue.d.ts +0 -32
  231. package/dist/utils/getValue.js +0 -47
  232. package/dist/utils/hasJsonMethod.d.ts +0 -1
  233. package/dist/utils/hasJsonMethod.js +0 -6
  234. package/dist/utils/index.d.ts +0 -15
  235. package/dist/utils/index.js +0 -31
  236. package/dist/utils/isArray.d.ts +0 -13
  237. package/dist/utils/isArray.js +0 -21
  238. package/dist/utils/isArrowFn.d.ts +0 -1
  239. package/dist/utils/isArrowFn.js +0 -7
  240. package/dist/utils/isBoolean.d.ts +0 -7
  241. package/dist/utils/isBoolean.js +0 -15
  242. package/dist/utils/isBuffer.d.ts +0 -7
  243. package/dist/utils/isBuffer.js +0 -19
  244. package/dist/utils/isClass.d.ts +0 -1
  245. package/dist/utils/isClass.js +0 -26
  246. package/dist/utils/isCollection.d.ts +0 -6
  247. package/dist/utils/isCollection.js +0 -20
  248. package/dist/utils/isDate.d.ts +0 -6
  249. package/dist/utils/isDate.js +0 -11
  250. package/dist/utils/isEmpty.d.ts +0 -6
  251. package/dist/utils/isEmpty.js +0 -12
  252. package/dist/utils/isFunction.d.ts +0 -1
  253. package/dist/utils/isFunction.js +0 -6
  254. package/dist/utils/isInheritedFrom.d.ts +0 -1
  255. package/dist/utils/isInheritedFrom.js +0 -24
  256. package/dist/utils/isMomentObject.d.ts +0 -1
  257. package/dist/utils/isMomentObject.js +0 -6
  258. package/dist/utils/isMongooseObject.d.ts +0 -2
  259. package/dist/utils/isMongooseObject.js +0 -11
  260. package/dist/utils/isNil.d.ts +0 -1
  261. package/dist/utils/isNil.js +0 -6
  262. package/dist/utils/isNumber.d.ts +0 -7
  263. package/dist/utils/isNumber.js +0 -15
  264. package/dist/utils/isObject.d.ts +0 -1
  265. package/dist/utils/isObject.js +0 -6
  266. package/dist/utils/isObservable.d.ts +0 -1
  267. package/dist/utils/isObservable.js +0 -6
  268. package/dist/utils/isPlainObject.d.ts +0 -7
  269. package/dist/utils/isPlainObject.js +0 -16
  270. package/dist/utils/isPrimitive.d.ts +0 -14
  271. package/dist/utils/isPrimitive.js +0 -28
  272. package/dist/utils/isPrimitiveType.d.ts +0 -1
  273. package/dist/utils/isPrimitiveType.js +0 -11
  274. package/dist/utils/isPromise.d.ts +0 -7
  275. package/dist/utils/isPromise.js +0 -14
  276. package/dist/utils/isProtectedKey.d.ts +0 -5
  277. package/dist/utils/isProtectedKey.js +0 -10
  278. package/dist/utils/isRegExp.d.ts +0 -1
  279. package/dist/utils/isRegExp.js +0 -6
  280. package/dist/utils/isRequestScope.d.ts +0 -11
  281. package/dist/utils/isRequestScope.js +0 -23
  282. package/dist/utils/isSerializable.d.ts +0 -1
  283. package/dist/utils/isSerializable.js +0 -11
  284. package/dist/utils/isStream.d.ts +0 -1
  285. package/dist/utils/isStream.js +0 -6
  286. package/dist/utils/isString.d.ts +0 -6
  287. package/dist/utils/isString.js +0 -14
  288. package/dist/utils/isSymbol.d.ts +0 -6
  289. package/dist/utils/isSymbol.js +0 -14
  290. package/dist/utils/methodsOf.d.ts +0 -9
  291. package/dist/utils/methodsOf.js +0 -24
  292. package/dist/utils/nameOf.d.ts +0 -14
  293. package/dist/utils/nameOf.js +0 -31
  294. package/dist/utils/objectKeys.d.ts +0 -1
  295. package/dist/utils/objectKeys.js +0 -7
  296. package/dist/utils/primitiveOf.d.ts +0 -1
  297. package/dist/utils/primitiveOf.js +0 -18
  298. package/dist/utils/prototypeOf.d.ts +0 -6
  299. package/dist/utils/prototypeOf.js +0 -12
  300. package/dist/utils/setValue.d.ts +0 -1
  301. package/dist/utils/setValue.js +0 -32
  302. package/dist/utils/toMap.d.ts +0 -3
  303. package/dist/utils/toMap.js +0 -34
  304. package/dist/utils/toStringConstructor.d.ts +0 -1
  305. package/dist/utils/toStringConstructor.js +0 -10
  306. package/dist/validation/ValidatorAdapter.d.ts +0 -66
  307. package/dist/validation/adapters/ClassValidatorAdapter.d.ts +0 -23
  308. package/dist/validation/adapters/ClassValidatorAdapter.js +0 -47
  309. package/dist/validation/adapters/ZodAdapter.d.ts +0 -14
  310. package/dist/validation/adapters/ZodAdapter.js +0 -56
  311. package/dist/validation/adapters/index.d.ts +0 -4
  312. package/dist/validation/adapters/index.js +0 -7
  313. package/dist/validation/index.d.ts +0 -3
  314. package/dist/validation/index.js +0 -20
package/dist/index.js CHANGED
@@ -1,32 +1,130 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: !0 });
8
+ }, __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from == "object" || typeof from == "function")
10
+ for (let key of __getOwnPropNames(from))
11
+ !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
12
+ return to;
15
13
  };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./commons"), exports);
18
- __exportStar(require("./container"), exports);
19
- __exportStar(require("./domain"), exports);
20
- __exportStar(require("./route/Matcher"), exports);
21
- __exportStar(require("./route/RouteExecutor"), exports);
22
- __exportStar(require("./exceptions"), exports);
23
- __exportStar(require("./Carno"), exports);
24
- __exportStar(require("./events"), exports);
25
- __exportStar(require("./constants"), exports);
26
- __exportStar(require("./utils"), exports);
27
- __exportStar(require("./default-routes-carno"), exports);
28
- __exportStar(require("./services/logger.service"), exports);
29
- __exportStar(require("./cache/cache.service"), exports);
30
- __exportStar(require("./cache/bento-cache.driver"), exports);
31
- __exportStar(require("./testing"), exports);
32
- __exportStar(require("./validation"), exports);
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
15
+ var index_exports = {};
16
+ __export(index_exports, {
17
+ BadRequestException: () => import_HttpException.BadRequestException,
18
+ Body: () => import_params.Body,
19
+ CacheService: () => import_CacheService.CacheService,
20
+ Carno: () => import_Carno.Carno,
21
+ ConflictException: () => import_HttpException.ConflictException,
22
+ Container: () => import_Container.Container,
23
+ Context: () => import_Context.Context,
24
+ Controller: () => import_Controller.Controller,
25
+ CorsHandler: () => import_CorsHandler.CorsHandler,
26
+ Ctx: () => import_params.Ctx,
27
+ Delete: () => import_methods.Delete,
28
+ EventType: () => import_Lifecycle.EventType,
29
+ ForbiddenException: () => import_HttpException.ForbiddenException,
30
+ Get: () => import_methods.Get,
31
+ Head: () => import_methods.Head,
32
+ Header: () => import_params.Header,
33
+ HttpException: () => import_HttpException.HttpException,
34
+ Inject: () => import_Inject.Inject,
35
+ InternalServerErrorException: () => import_HttpException.InternalServerErrorException,
36
+ Locals: () => import_params.Locals,
37
+ MemoryDriver: () => import_MemoryDriver.MemoryDriver,
38
+ Metadata: () => import_Metadata.Metadata,
39
+ MethodNotAllowedException: () => import_HttpException.MethodNotAllowedException,
40
+ Middleware: () => import_Middleware.Use,
41
+ NotFoundException: () => import_HttpException.NotFoundException,
42
+ OnApplicationBoot: () => import_Lifecycle.OnApplicationBoot,
43
+ OnApplicationInit: () => import_Lifecycle.OnApplicationInit,
44
+ OnApplicationShutdown: () => import_Lifecycle.OnApplicationShutdown,
45
+ Options: () => import_methods.Options,
46
+ Param: () => import_params.Param,
47
+ Patch: () => import_methods.Patch,
48
+ Post: () => import_methods.Post,
49
+ Put: () => import_methods.Put,
50
+ Query: () => import_params.Query,
51
+ RadixRouter: () => import_RadixRouter.RadixRouter,
52
+ RedisDriver: () => import_RedisDriver.RedisDriver,
53
+ Req: () => import_params.Req,
54
+ Schema: () => import_ValidatorAdapter.Schema,
55
+ Scope: () => import_Container.Scope,
56
+ Service: () => import_Service.Service,
57
+ ServiceUnavailableException: () => import_HttpException.ServiceUnavailableException,
58
+ TooManyRequestsException: () => import_HttpException.TooManyRequestsException,
59
+ UnauthorizedException: () => import_HttpException.UnauthorizedException,
60
+ UnprocessableEntityException: () => import_HttpException.UnprocessableEntityException,
61
+ Use: () => import_Middleware.Use,
62
+ VALIDATION_SCHEMA: () => import_ValidatorAdapter.VALIDATION_SCHEMA,
63
+ ValibotAdapter: () => import_ValibotAdapter.ValibotAdapter,
64
+ ValidationException: () => import_ZodAdapter.ValidationException,
65
+ ZodAdapter: () => import_ZodAdapter.ZodAdapter,
66
+ createTestHarness: () => import_TestHarness.createTestHarness,
67
+ getSchema: () => import_ValidatorAdapter.getSchema,
68
+ isObject: () => import_Metadata.isObject,
69
+ isString: () => import_Metadata.isString,
70
+ withTestApp: () => import_TestHarness.withTestApp
71
+ });
72
+ module.exports = __toCommonJS(index_exports);
73
+ var import_Carno = require('./Carno.js'), import_Context = require('./context/Context.js'), import_Controller = require('./decorators/Controller.js'), import_methods = require('./decorators/methods.js'), import_params = require('./decorators/params.js'), import_Middleware = require('./decorators/Middleware.js'), import_Service = require('./decorators/Service.js'), import_Inject = require('./decorators/Inject.js'), import_Container = require('./container/Container.js'), import_RadixRouter = require('./router/RadixRouter.js'), import_CorsHandler = require('./cors/CorsHandler.js'), import_ValidatorAdapter = require('./validation/ValidatorAdapter.js'), import_ZodAdapter = require('./validation/ZodAdapter.js'), import_ValibotAdapter = require('./validation/ValibotAdapter.js'), import_HttpException = require('./exceptions/HttpException.js'), import_Lifecycle = require('./events/Lifecycle.js'), import_CacheService = require('./cache/CacheService.js'), import_MemoryDriver = require('./cache/MemoryDriver.js'), import_RedisDriver = require('./cache/RedisDriver.js'), import_TestHarness = require('./testing/TestHarness.js'), import_Metadata = require('./utils/Metadata.js');
74
+ // Annotate the CommonJS export names for ESM import in node:
75
+ 0 && (module.exports = {
76
+ BadRequestException,
77
+ Body,
78
+ CacheService,
79
+ Carno,
80
+ ConflictException,
81
+ Container,
82
+ Context,
83
+ Controller,
84
+ CorsHandler,
85
+ Ctx,
86
+ Delete,
87
+ EventType,
88
+ ForbiddenException,
89
+ Get,
90
+ Head,
91
+ Header,
92
+ HttpException,
93
+ Inject,
94
+ InternalServerErrorException,
95
+ Locals,
96
+ MemoryDriver,
97
+ Metadata,
98
+ MethodNotAllowedException,
99
+ Middleware,
100
+ NotFoundException,
101
+ OnApplicationBoot,
102
+ OnApplicationInit,
103
+ OnApplicationShutdown,
104
+ Options,
105
+ Param,
106
+ Patch,
107
+ Post,
108
+ Put,
109
+ Query,
110
+ RadixRouter,
111
+ RedisDriver,
112
+ Req,
113
+ Schema,
114
+ Scope,
115
+ Service,
116
+ ServiceUnavailableException,
117
+ TooManyRequestsException,
118
+ UnauthorizedException,
119
+ UnprocessableEntityException,
120
+ Use,
121
+ VALIDATION_SCHEMA,
122
+ ValibotAdapter,
123
+ ValidationException,
124
+ ZodAdapter,
125
+ createTestHarness,
126
+ getSchema,
127
+ isObject,
128
+ isString,
129
+ withTestApp
130
+ });
package/dist/index.mjs ADDED
@@ -0,0 +1,94 @@
1
+ import { Carno } from "./Carno.mjs";
2
+ import { Context } from "./context/Context.mjs";
3
+ import { Controller } from "./decorators/Controller.mjs";
4
+ import { Get, Post, Put, Delete, Patch, Head, Options } from "./decorators/methods.mjs";
5
+ import { Param, Query, Body, Header, Req, Ctx, Locals } from "./decorators/params.mjs";
6
+ import { Use, Use as Use2 } from "./decorators/Middleware.mjs";
7
+ import { Service } from "./decorators/Service.mjs";
8
+ import { Inject } from "./decorators/Inject.mjs";
9
+ import { Container, Scope } from "./container/Container.mjs";
10
+ import { RadixRouter } from "./router/RadixRouter.mjs";
11
+ import { CorsHandler } from "./cors/CorsHandler.mjs";
12
+ import { Schema, getSchema, VALIDATION_SCHEMA } from "./validation/ValidatorAdapter.mjs";
13
+ import { ZodAdapter, ValidationException } from "./validation/ZodAdapter.mjs";
14
+ import { ValibotAdapter } from "./validation/ValibotAdapter.mjs";
15
+ import {
16
+ HttpException,
17
+ BadRequestException,
18
+ UnauthorizedException,
19
+ ForbiddenException,
20
+ NotFoundException,
21
+ MethodNotAllowedException,
22
+ ConflictException,
23
+ UnprocessableEntityException,
24
+ TooManyRequestsException,
25
+ InternalServerErrorException,
26
+ ServiceUnavailableException
27
+ } from "./exceptions/HttpException.mjs";
28
+ import {
29
+ EventType,
30
+ OnApplicationInit,
31
+ OnApplicationBoot,
32
+ OnApplicationShutdown
33
+ } from "./events/Lifecycle.mjs";
34
+ import { CacheService } from "./cache/CacheService.mjs";
35
+ import { MemoryDriver } from "./cache/MemoryDriver.mjs";
36
+ import { RedisDriver } from "./cache/RedisDriver.mjs";
37
+ import { createTestHarness, withTestApp } from "./testing/TestHarness.mjs";
38
+ import { Metadata, isObject, isString } from "./utils/Metadata.mjs";
39
+ export {
40
+ BadRequestException,
41
+ Body,
42
+ CacheService,
43
+ Carno,
44
+ ConflictException,
45
+ Container,
46
+ Context,
47
+ Controller,
48
+ CorsHandler,
49
+ Ctx,
50
+ Delete,
51
+ EventType,
52
+ ForbiddenException,
53
+ Get,
54
+ Head,
55
+ Header,
56
+ HttpException,
57
+ Inject,
58
+ InternalServerErrorException,
59
+ Locals,
60
+ MemoryDriver,
61
+ Metadata,
62
+ MethodNotAllowedException,
63
+ Use2 as Middleware,
64
+ NotFoundException,
65
+ OnApplicationBoot,
66
+ OnApplicationInit,
67
+ OnApplicationShutdown,
68
+ Options,
69
+ Param,
70
+ Patch,
71
+ Post,
72
+ Put,
73
+ Query,
74
+ RadixRouter,
75
+ RedisDriver,
76
+ Req,
77
+ Schema,
78
+ Scope,
79
+ Service,
80
+ ServiceUnavailableException,
81
+ TooManyRequestsException,
82
+ UnauthorizedException,
83
+ UnprocessableEntityException,
84
+ Use,
85
+ VALIDATION_SCHEMA,
86
+ ValibotAdapter,
87
+ ValidationException,
88
+ ZodAdapter,
89
+ createTestHarness,
90
+ getSchema,
91
+ isObject,
92
+ isString,
93
+ withTestApp
94
+ };
@@ -0,0 +1,34 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: !0 });
8
+ }, __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from == "object" || typeof from == "function")
10
+ for (let key of __getOwnPropNames(from))
11
+ !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
12
+ return to;
13
+ };
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
15
+ var metadata_exports = {};
16
+ __export(metadata_exports, {
17
+ CONTROLLER_META: () => CONTROLLER_META,
18
+ INJECT_META: () => INJECT_META,
19
+ MIDDLEWARE_META: () => MIDDLEWARE_META,
20
+ PARAMS_META: () => PARAMS_META,
21
+ ROUTES_META: () => ROUTES_META,
22
+ SERVICE_META: () => SERVICE_META
23
+ });
24
+ module.exports = __toCommonJS(metadata_exports);
25
+ const CONTROLLER_META = /* @__PURE__ */ Symbol("turbo:controller"), ROUTES_META = /* @__PURE__ */ Symbol("turbo:routes"), PARAMS_META = /* @__PURE__ */ Symbol("turbo:params"), MIDDLEWARE_META = /* @__PURE__ */ Symbol("turbo:middleware"), SERVICE_META = /* @__PURE__ */ Symbol("turbo:service"), INJECT_META = /* @__PURE__ */ Symbol("turbo:inject");
26
+ // Annotate the CommonJS export names for ESM import in node:
27
+ 0 && (module.exports = {
28
+ CONTROLLER_META,
29
+ INJECT_META,
30
+ MIDDLEWARE_META,
31
+ PARAMS_META,
32
+ ROUTES_META,
33
+ SERVICE_META
34
+ });
@@ -0,0 +1,9 @@
1
+ const CONTROLLER_META = /* @__PURE__ */ Symbol("turbo:controller"), ROUTES_META = /* @__PURE__ */ Symbol("turbo:routes"), PARAMS_META = /* @__PURE__ */ Symbol("turbo:params"), MIDDLEWARE_META = /* @__PURE__ */ Symbol("turbo:middleware"), SERVICE_META = /* @__PURE__ */ Symbol("turbo:service"), INJECT_META = /* @__PURE__ */ Symbol("turbo:inject");
2
+ export {
3
+ CONTROLLER_META,
4
+ INJECT_META,
5
+ MIDDLEWARE_META,
6
+ PARAMS_META,
7
+ ROUTES_META,
8
+ SERVICE_META
9
+ };
@@ -0,0 +1,13 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __copyProps = (to, from, except, desc) => {
6
+ if (from && typeof from == "object" || typeof from == "function")
7
+ for (let key of __getOwnPropNames(from))
8
+ !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
9
+ return to;
10
+ };
11
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
12
+ var CarnoMiddleware_exports = {};
13
+ module.exports = __toCommonJS(CarnoMiddleware_exports);
File without changes
@@ -0,0 +1,121 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: !0 });
8
+ }, __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from == "object" || typeof from == "function")
10
+ for (let key of __getOwnPropNames(from))
11
+ !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
12
+ return to;
13
+ };
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
15
+ var RadixRouter_exports = {};
16
+ __export(RadixRouter_exports, {
17
+ RadixRouter: () => RadixRouter
18
+ });
19
+ module.exports = __toCommonJS(RadixRouter_exports);
20
+ const EMPTY_PARAMS = Object.freeze({});
21
+ function createNode(part) {
22
+ return {
23
+ part,
24
+ store: null,
25
+ children: null,
26
+ paramChild: null,
27
+ wildcardStore: null
28
+ };
29
+ }
30
+ class RadixRouter {
31
+ constructor() {
32
+ this.roots = {};
33
+ }
34
+ add(method, path, store) {
35
+ path === "" && (path = "/"), path[0] !== "/" && (path = "/" + path);
36
+ const isWildcard = path.endsWith("*");
37
+ isWildcard && (path = path.slice(0, -1));
38
+ let node = this.roots[method];
39
+ node || (node = this.roots[method] = createNode("/"));
40
+ let i = 0;
41
+ const len = path.length;
42
+ for (; i < len; ) {
43
+ if (path.charCodeAt(i) === 58) {
44
+ const paramStart = i + 1;
45
+ let paramEnd = paramStart;
46
+ for (; paramEnd < len && path.charCodeAt(paramEnd) !== 47; )
47
+ paramEnd++;
48
+ const paramName = path.slice(paramStart, paramEnd);
49
+ if (node.paramChild || (node.paramChild = { name: paramName, store: null, child: null }), paramEnd >= len) {
50
+ node.paramChild.store = store;
51
+ return;
52
+ }
53
+ node.paramChild.child || (node.paramChild.child = createNode(path.slice(paramEnd))), node = node.paramChild.child, i = paramEnd;
54
+ continue;
55
+ }
56
+ let segmentEnd = i;
57
+ for (; segmentEnd < len && path.charCodeAt(segmentEnd) !== 47 && path.charCodeAt(segmentEnd) !== 58; )
58
+ segmentEnd++;
59
+ segmentEnd < len && path.charCodeAt(segmentEnd) === 47 && segmentEnd++;
60
+ const segment = path.slice(i, segmentEnd);
61
+ if (segment === node.part) {
62
+ i = segmentEnd;
63
+ continue;
64
+ }
65
+ node.children || (node.children = /* @__PURE__ */ new Map());
66
+ const firstChar = segment.charCodeAt(0);
67
+ let child = node.children.get(firstChar);
68
+ child || (child = createNode(segment), node.children.set(firstChar, child)), node = child, i = segmentEnd;
69
+ }
70
+ isWildcard ? node.wildcardStore = store : node.store = store;
71
+ }
72
+ find(method, path) {
73
+ const root = this.roots[method];
74
+ return root ? this.matchPath(root, path, 0, path.length) : null;
75
+ }
76
+ matchPath(node, path, start, len) {
77
+ const partLen = node.part.length, end = start + partLen;
78
+ if (partLen > 1) {
79
+ if (end > len) return null;
80
+ for (let i = 1, j = start + 1; i < partLen; i++, j++)
81
+ if (node.part.charCodeAt(i) !== path.charCodeAt(j))
82
+ return null;
83
+ }
84
+ if (end === len)
85
+ return node.store !== null ? { store: node.store, params: EMPTY_PARAMS } : node.wildcardStore !== null ? { store: node.wildcardStore, params: { "*": "" } } : null;
86
+ if (node.children) {
87
+ const child = node.children.get(path.charCodeAt(end));
88
+ if (child) {
89
+ const result = this.matchPath(child, path, end, len);
90
+ if (result) return result;
91
+ }
92
+ }
93
+ if (node.paramChild) {
94
+ const param = node.paramChild;
95
+ let paramEnd = end;
96
+ for (; paramEnd < len && path.charCodeAt(paramEnd) !== 47; )
97
+ paramEnd++;
98
+ if (paramEnd === end) return null;
99
+ const paramValue = path.slice(end, paramEnd);
100
+ if (paramEnd >= len) {
101
+ if (param.store !== null)
102
+ return {
103
+ store: param.store,
104
+ params: { [param.name]: paramValue }
105
+ };
106
+ } else if (param.child) {
107
+ const result = this.matchPath(param.child, path, paramEnd, len);
108
+ if (result)
109
+ return result.params === EMPTY_PARAMS ? result.params = { [param.name]: paramValue } : result.params[param.name] = paramValue, result;
110
+ }
111
+ }
112
+ return node.wildcardStore !== null ? {
113
+ store: node.wildcardStore,
114
+ params: { "*": path.slice(end) }
115
+ } : null;
116
+ }
117
+ }
118
+ // Annotate the CommonJS export names for ESM import in node:
119
+ 0 && (module.exports = {
120
+ RadixRouter
121
+ });
@@ -0,0 +1,101 @@
1
+ const EMPTY_PARAMS = Object.freeze({});
2
+ function createNode(part) {
3
+ return {
4
+ part,
5
+ store: null,
6
+ children: null,
7
+ paramChild: null,
8
+ wildcardStore: null
9
+ };
10
+ }
11
+ class RadixRouter {
12
+ constructor() {
13
+ this.roots = {};
14
+ }
15
+ add(method, path, store) {
16
+ path === "" && (path = "/"), path[0] !== "/" && (path = "/" + path);
17
+ const isWildcard = path.endsWith("*");
18
+ isWildcard && (path = path.slice(0, -1));
19
+ let node = this.roots[method];
20
+ node || (node = this.roots[method] = createNode("/"));
21
+ let i = 0;
22
+ const len = path.length;
23
+ for (; i < len; ) {
24
+ if (path.charCodeAt(i) === 58) {
25
+ const paramStart = i + 1;
26
+ let paramEnd = paramStart;
27
+ for (; paramEnd < len && path.charCodeAt(paramEnd) !== 47; )
28
+ paramEnd++;
29
+ const paramName = path.slice(paramStart, paramEnd);
30
+ if (node.paramChild || (node.paramChild = { name: paramName, store: null, child: null }), paramEnd >= len) {
31
+ node.paramChild.store = store;
32
+ return;
33
+ }
34
+ node.paramChild.child || (node.paramChild.child = createNode(path.slice(paramEnd))), node = node.paramChild.child, i = paramEnd;
35
+ continue;
36
+ }
37
+ let segmentEnd = i;
38
+ for (; segmentEnd < len && path.charCodeAt(segmentEnd) !== 47 && path.charCodeAt(segmentEnd) !== 58; )
39
+ segmentEnd++;
40
+ segmentEnd < len && path.charCodeAt(segmentEnd) === 47 && segmentEnd++;
41
+ const segment = path.slice(i, segmentEnd);
42
+ if (segment === node.part) {
43
+ i = segmentEnd;
44
+ continue;
45
+ }
46
+ node.children || (node.children = /* @__PURE__ */ new Map());
47
+ const firstChar = segment.charCodeAt(0);
48
+ let child = node.children.get(firstChar);
49
+ child || (child = createNode(segment), node.children.set(firstChar, child)), node = child, i = segmentEnd;
50
+ }
51
+ isWildcard ? node.wildcardStore = store : node.store = store;
52
+ }
53
+ find(method, path) {
54
+ const root = this.roots[method];
55
+ return root ? this.matchPath(root, path, 0, path.length) : null;
56
+ }
57
+ matchPath(node, path, start, len) {
58
+ const partLen = node.part.length, end = start + partLen;
59
+ if (partLen > 1) {
60
+ if (end > len) return null;
61
+ for (let i = 1, j = start + 1; i < partLen; i++, j++)
62
+ if (node.part.charCodeAt(i) !== path.charCodeAt(j))
63
+ return null;
64
+ }
65
+ if (end === len)
66
+ return node.store !== null ? { store: node.store, params: EMPTY_PARAMS } : node.wildcardStore !== null ? { store: node.wildcardStore, params: { "*": "" } } : null;
67
+ if (node.children) {
68
+ const child = node.children.get(path.charCodeAt(end));
69
+ if (child) {
70
+ const result = this.matchPath(child, path, end, len);
71
+ if (result) return result;
72
+ }
73
+ }
74
+ if (node.paramChild) {
75
+ const param = node.paramChild;
76
+ let paramEnd = end;
77
+ for (; paramEnd < len && path.charCodeAt(paramEnd) !== 47; )
78
+ paramEnd++;
79
+ if (paramEnd === end) return null;
80
+ const paramValue = path.slice(end, paramEnd);
81
+ if (paramEnd >= len) {
82
+ if (param.store !== null)
83
+ return {
84
+ store: param.store,
85
+ params: { [param.name]: paramValue }
86
+ };
87
+ } else if (param.child) {
88
+ const result = this.matchPath(param.child, path, paramEnd, len);
89
+ if (result)
90
+ return result.params === EMPTY_PARAMS ? result.params = { [param.name]: paramValue } : result.params[param.name] = paramValue, result;
91
+ }
92
+ }
93
+ return node.wildcardStore !== null ? {
94
+ store: node.wildcardStore,
95
+ params: { "*": path.slice(end) }
96
+ } : null;
97
+ }
98
+ }
99
+ export {
100
+ RadixRouter
101
+ };
@@ -0,0 +1,81 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: !0 });
8
+ }, __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from == "object" || typeof from == "function")
10
+ for (let key of __getOwnPropNames(from))
11
+ !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
12
+ return to;
13
+ };
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
15
+ var TestHarness_exports = {};
16
+ __export(TestHarness_exports, {
17
+ createTestHarness: () => createTestHarness,
18
+ withTestApp: () => withTestApp
19
+ });
20
+ module.exports = __toCommonJS(TestHarness_exports);
21
+ var import_Carno = require('../Carno.js');
22
+ async function createTestHarness(options = {}) {
23
+ const config = {
24
+ ...options.config,
25
+ disableStartupLog: !0
26
+ }, app = new import_Carno.Carno(config);
27
+ options.controllers && app.controllers(options.controllers), options.services && app.services(options.services);
28
+ const port = resolvePort(options);
29
+ let server;
30
+ shouldListen(options.listen) && (app.listen(port), server = app.server);
31
+ const actualPort = server?.port ?? port, container = app.container, baseUrl = `http://127.0.0.1:${actualPort}`, request = async (path, init) => {
32
+ if (!server)
33
+ throw new Error("Server not running. Set listen: true in options.");
34
+ const url = path.startsWith("http") ? path : `${baseUrl}${path.startsWith("/") ? path : "/" + path}`;
35
+ return fetch(url, init);
36
+ };
37
+ return {
38
+ app,
39
+ container,
40
+ server,
41
+ port: actualPort,
42
+ resolve: (token) => container.get(token),
43
+ request,
44
+ get: (path, init) => request(path, { ...init, method: "GET" }),
45
+ post: (path, body, init) => request(path, {
46
+ ...init,
47
+ method: "POST",
48
+ body: body ? JSON.stringify(body) : void 0,
49
+ headers: { "Content-Type": "application/json", ...init?.headers }
50
+ }),
51
+ put: (path, body, init) => request(path, {
52
+ ...init,
53
+ method: "PUT",
54
+ body: body ? JSON.stringify(body) : void 0,
55
+ headers: { "Content-Type": "application/json", ...init?.headers }
56
+ }),
57
+ delete: (path, init) => request(path, { ...init, method: "DELETE" }),
58
+ close: async () => {
59
+ app.stop();
60
+ }
61
+ };
62
+ }
63
+ async function withTestApp(routine, options = {}) {
64
+ const harness = await createTestHarness(options);
65
+ try {
66
+ await routine(harness);
67
+ } finally {
68
+ await harness.close();
69
+ }
70
+ }
71
+ function shouldListen(value) {
72
+ return typeof value == "number" || !!value;
73
+ }
74
+ function resolvePort(options) {
75
+ return typeof options.listen == "number" ? options.listen : typeof options.port == "number" ? options.port : 0;
76
+ }
77
+ // Annotate the CommonJS export names for ESM import in node:
78
+ 0 && (module.exports = {
79
+ createTestHarness,
80
+ withTestApp
81
+ });