@celljs/mvc 3.0.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.
Files changed (239) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +1 -0
  3. package/cell.yml +9 -0
  4. package/lib/common/constants.d.ts +2 -0
  5. package/lib/common/constants.d.ts.map +1 -0
  6. package/lib/common/constants.js +5 -0
  7. package/lib/common/constants.js.map +1 -0
  8. package/lib/common/index.d.ts +2 -0
  9. package/lib/common/index.d.ts.map +1 -0
  10. package/lib/common/index.js +18 -0
  11. package/lib/common/index.js.map +1 -0
  12. package/lib/node/annotation/body.d.ts +7 -0
  13. package/lib/node/annotation/body.d.ts.map +1 -0
  14. package/lib/node/annotation/body.js +20 -0
  15. package/lib/node/annotation/body.js.map +1 -0
  16. package/lib/node/annotation/catch.d.ts +10 -0
  17. package/lib/node/annotation/catch.d.ts.map +1 -0
  18. package/lib/node/annotation/catch.js +23 -0
  19. package/lib/node/annotation/catch.js.map +1 -0
  20. package/lib/node/annotation/controller.d.ts +15 -0
  21. package/lib/node/annotation/controller.d.ts.map +1 -0
  22. package/lib/node/annotation/controller.js +35 -0
  23. package/lib/node/annotation/controller.js.map +1 -0
  24. package/lib/node/annotation/cookie.d.ts +16 -0
  25. package/lib/node/annotation/cookie.d.ts.map +1 -0
  26. package/lib/node/annotation/cookie.js +29 -0
  27. package/lib/node/annotation/cookie.js.map +1 -0
  28. package/lib/node/annotation/file.d.ts +3 -0
  29. package/lib/node/annotation/file.d.ts.map +1 -0
  30. package/lib/node/annotation/file.js +10 -0
  31. package/lib/node/annotation/file.js.map +1 -0
  32. package/lib/node/annotation/header.d.ts +16 -0
  33. package/lib/node/annotation/header.d.ts.map +1 -0
  34. package/lib/node/annotation/header.js +29 -0
  35. package/lib/node/annotation/header.js.map +1 -0
  36. package/lib/node/annotation/html.d.ts +3 -0
  37. package/lib/node/annotation/html.d.ts.map +1 -0
  38. package/lib/node/annotation/html.js +10 -0
  39. package/lib/node/annotation/html.js.map +1 -0
  40. package/lib/node/annotation/index.d.ts +17 -0
  41. package/lib/node/annotation/index.d.ts.map +1 -0
  42. package/lib/node/annotation/index.js +33 -0
  43. package/lib/node/annotation/index.js.map +1 -0
  44. package/lib/node/annotation/json.d.ts +3 -0
  45. package/lib/node/annotation/json.d.ts.map +1 -0
  46. package/lib/node/annotation/json.js +10 -0
  47. package/lib/node/annotation/json.js.map +1 -0
  48. package/lib/node/annotation/method.d.ts +24 -0
  49. package/lib/node/annotation/method.d.ts.map +1 -0
  50. package/lib/node/annotation/method.js +54 -0
  51. package/lib/node/annotation/method.js.map +1 -0
  52. package/lib/node/annotation/param.d.ts +7 -0
  53. package/lib/node/annotation/param.d.ts.map +1 -0
  54. package/lib/node/annotation/param.js +20 -0
  55. package/lib/node/annotation/param.js.map +1 -0
  56. package/lib/node/annotation/query.d.ts +7 -0
  57. package/lib/node/annotation/query.d.ts.map +1 -0
  58. package/lib/node/annotation/query.js +20 -0
  59. package/lib/node/annotation/query.js.map +1 -0
  60. package/lib/node/annotation/req.d.ts +6 -0
  61. package/lib/node/annotation/req.d.ts.map +1 -0
  62. package/lib/node/annotation/req.js +18 -0
  63. package/lib/node/annotation/req.js.map +1 -0
  64. package/lib/node/annotation/res.d.ts +6 -0
  65. package/lib/node/annotation/res.d.ts.map +1 -0
  66. package/lib/node/annotation/res.js +18 -0
  67. package/lib/node/annotation/res.js.map +1 -0
  68. package/lib/node/annotation/session.d.ts +16 -0
  69. package/lib/node/annotation/session.d.ts.map +1 -0
  70. package/lib/node/annotation/session.js +29 -0
  71. package/lib/node/annotation/session.js.map +1 -0
  72. package/lib/node/annotation/text.d.ts +3 -0
  73. package/lib/node/annotation/text.d.ts.map +1 -0
  74. package/lib/node/annotation/text.js +10 -0
  75. package/lib/node/annotation/text.js.map +1 -0
  76. package/lib/node/annotation/view.d.ts +13 -0
  77. package/lib/node/annotation/view.d.ts.map +1 -0
  78. package/lib/node/annotation/view.js +15 -0
  79. package/lib/node/annotation/view.js.map +1 -0
  80. package/lib/node/constants.d.ts +18 -0
  81. package/lib/node/constants.d.ts.map +1 -0
  82. package/lib/node/constants.js +21 -0
  83. package/lib/node/constants.js.map +1 -0
  84. package/lib/node/error/error-handler.d.ts +10 -0
  85. package/lib/node/error/error-handler.d.ts.map +1 -0
  86. package/lib/node/error/error-handler.js +42 -0
  87. package/lib/node/error/error-handler.js.map +1 -0
  88. package/lib/node/error/index.d.ts +2 -0
  89. package/lib/node/error/index.d.ts.map +1 -0
  90. package/lib/node/error/index.js +18 -0
  91. package/lib/node/error/index.js.map +1 -0
  92. package/lib/node/handler/handler-adapter.d.ts +22 -0
  93. package/lib/node/handler/handler-adapter.d.ts.map +1 -0
  94. package/lib/node/handler/handler-adapter.js +122 -0
  95. package/lib/node/handler/handler-adapter.js.map +1 -0
  96. package/lib/node/handler/handler-protocol.d.ts +38 -0
  97. package/lib/node/handler/handler-protocol.d.ts.map +1 -0
  98. package/lib/node/handler/handler-protocol.js +7 -0
  99. package/lib/node/handler/handler-protocol.js.map +1 -0
  100. package/lib/node/handler/index.d.ts +6 -0
  101. package/lib/node/handler/index.d.ts.map +1 -0
  102. package/lib/node/handler/index.js +22 -0
  103. package/lib/node/handler/index.js.map +1 -0
  104. package/lib/node/handler/route-builder.d.ts +29 -0
  105. package/lib/node/handler/route-builder.d.ts.map +1 -0
  106. package/lib/node/handler/route-builder.js +117 -0
  107. package/lib/node/handler/route-builder.js.map +1 -0
  108. package/lib/node/handler/route-metadata-matcher.d.ts +9 -0
  109. package/lib/node/handler/route-metadata-matcher.d.ts.map +1 -0
  110. package/lib/node/handler/route-metadata-matcher.js +60 -0
  111. package/lib/node/handler/route-metadata-matcher.js.map +1 -0
  112. package/lib/node/handler/route-provider.d.ts +11 -0
  113. package/lib/node/handler/route-provider.d.ts.map +1 -0
  114. package/lib/node/handler/route-provider.js +44 -0
  115. package/lib/node/handler/route-provider.js.map +1 -0
  116. package/lib/node/index.d.ts +6 -0
  117. package/lib/node/index.d.ts.map +1 -0
  118. package/lib/node/index.js +22 -0
  119. package/lib/node/index.js.map +1 -0
  120. package/lib/node/module.d.ts +4 -0
  121. package/lib/node/module.d.ts.map +1 -0
  122. package/lib/node/module.js +6 -0
  123. package/lib/node/module.js.map +1 -0
  124. package/lib/node/resolver/index.d.ts +8 -0
  125. package/lib/node/resolver/index.d.ts.map +1 -0
  126. package/lib/node/resolver/index.js +24 -0
  127. package/lib/node/resolver/index.js.map +1 -0
  128. package/lib/node/resolver/method-args-resolver-provider.d.ts +8 -0
  129. package/lib/node/resolver/method-args-resolver-provider.d.ts.map +1 -0
  130. package/lib/node/resolver/method-args-resolver-provider.js +35 -0
  131. package/lib/node/resolver/method-args-resolver-provider.js.map +1 -0
  132. package/lib/node/resolver/method-args-resolver.d.ts +35 -0
  133. package/lib/node/resolver/method-args-resolver.d.ts.map +1 -0
  134. package/lib/node/resolver/method-args-resolver.js +152 -0
  135. package/lib/node/resolver/method-args-resolver.js.map +1 -0
  136. package/lib/node/resolver/resolver-protocol.d.ts +15 -0
  137. package/lib/node/resolver/resolver-protocol.d.ts.map +1 -0
  138. package/lib/node/resolver/resolver-protocol.js +7 -0
  139. package/lib/node/resolver/resolver-protocol.js.map +1 -0
  140. package/lib/node/resolver/response-resolver-provider.d.ts +8 -0
  141. package/lib/node/resolver/response-resolver-provider.d.ts.map +1 -0
  142. package/lib/node/resolver/response-resolver-provider.js +35 -0
  143. package/lib/node/resolver/response-resolver-provider.js.map +1 -0
  144. package/lib/node/resolver/response-resolver.d.ts +14 -0
  145. package/lib/node/resolver/response-resolver.d.ts.map +1 -0
  146. package/lib/node/resolver/response-resolver.js +67 -0
  147. package/lib/node/resolver/response-resolver.js.map +1 -0
  148. package/lib/node/resolver/view-resolver-provider.d.ts +8 -0
  149. package/lib/node/resolver/view-resolver-provider.d.ts.map +1 -0
  150. package/lib/node/resolver/view-resolver-provider.js +35 -0
  151. package/lib/node/resolver/view-resolver-provider.js.map +1 -0
  152. package/lib/node/resolver/view-resolver.d.ts +8 -0
  153. package/lib/node/resolver/view-resolver.d.ts.map +1 -0
  154. package/lib/node/resolver/view-resolver.js +44 -0
  155. package/lib/node/resolver/view-resolver.js.map +1 -0
  156. package/lib/node/view/file-view.d.ts +19 -0
  157. package/lib/node/view/file-view.d.ts.map +1 -0
  158. package/lib/node/view/file-view.js +79 -0
  159. package/lib/node/view/file-view.js.map +1 -0
  160. package/lib/node/view/html-view.d.ts +11 -0
  161. package/lib/node/view/html-view.d.ts.map +1 -0
  162. package/lib/node/view/html-view.js +48 -0
  163. package/lib/node/view/html-view.js.map +1 -0
  164. package/lib/node/view/index.d.ts +7 -0
  165. package/lib/node/view/index.d.ts.map +1 -0
  166. package/lib/node/view/index.js +23 -0
  167. package/lib/node/view/index.js.map +1 -0
  168. package/lib/node/view/json-view-template-renderer.d.ts +6 -0
  169. package/lib/node/view/json-view-template-renderer.d.ts.map +1 -0
  170. package/lib/node/view/json-view-template-renderer.js +39 -0
  171. package/lib/node/view/json-view-template-renderer.js.map +1 -0
  172. package/lib/node/view/json-view.d.ts +11 -0
  173. package/lib/node/view/json-view.d.ts.map +1 -0
  174. package/lib/node/view/json-view.js +39 -0
  175. package/lib/node/view/json-view.js.map +1 -0
  176. package/lib/node/view/text-view.d.ts +10 -0
  177. package/lib/node/view/text-view.d.ts.map +1 -0
  178. package/lib/node/view/text-view.js +32 -0
  179. package/lib/node/view/text-view.js.map +1 -0
  180. package/lib/node/view/view-protocol.d.ts +12 -0
  181. package/lib/node/view/view-protocol.d.ts.map +1 -0
  182. package/lib/node/view/view-protocol.js +6 -0
  183. package/lib/node/view/view-protocol.js.map +1 -0
  184. package/lib/node/view/view-provider.d.ts +8 -0
  185. package/lib/node/view/view-provider.d.ts.map +1 -0
  186. package/lib/node/view/view-provider.js +35 -0
  187. package/lib/node/view/view-provider.js.map +1 -0
  188. package/lib/package.spec.d.ts +1 -0
  189. package/lib/package.spec.d.ts.map +1 -0
  190. package/lib/package.spec.js +4 -0
  191. package/lib/package.spec.js.map +1 -0
  192. package/package.json +47 -0
  193. package/src/common/constants.ts +1 -0
  194. package/src/common/index.ts +1 -0
  195. package/src/node/annotation/body.ts +21 -0
  196. package/src/node/annotation/catch.ts +27 -0
  197. package/src/node/annotation/controller.ts +44 -0
  198. package/src/node/annotation/cookie.ts +41 -0
  199. package/src/node/annotation/file.ts +7 -0
  200. package/src/node/annotation/header.ts +41 -0
  201. package/src/node/annotation/html.ts +7 -0
  202. package/src/node/annotation/index.ts +17 -0
  203. package/src/node/annotation/json.ts +7 -0
  204. package/src/node/annotation/method.ts +61 -0
  205. package/src/node/annotation/param.ts +21 -0
  206. package/src/node/annotation/query.ts +21 -0
  207. package/src/node/annotation/req.ts +23 -0
  208. package/src/node/annotation/res.ts +23 -0
  209. package/src/node/annotation/session.ts +41 -0
  210. package/src/node/annotation/text.ts +7 -0
  211. package/src/node/annotation/view.ts +16 -0
  212. package/src/node/constants.ts +17 -0
  213. package/src/node/error/error-handler.ts +27 -0
  214. package/src/node/error/index.ts +1 -0
  215. package/src/node/handler/handler-adapter.ts +100 -0
  216. package/src/node/handler/handler-protocol.ts +62 -0
  217. package/src/node/handler/index.ts +5 -0
  218. package/src/node/handler/route-builder.ts +119 -0
  219. package/src/node/handler/route-metadata-matcher.ts +44 -0
  220. package/src/node/handler/route-provider.ts +27 -0
  221. package/src/node/index.ts +5 -0
  222. package/src/node/module.ts +4 -0
  223. package/src/node/resolver/index.ts +7 -0
  224. package/src/node/resolver/method-args-resolver-provider.ts +21 -0
  225. package/src/node/resolver/method-args-resolver.ts +119 -0
  226. package/src/node/resolver/resolver-protocol.ts +18 -0
  227. package/src/node/resolver/response-resolver-provider.ts +21 -0
  228. package/src/node/resolver/response-resolver.ts +46 -0
  229. package/src/node/resolver/view-resolver-provider.ts +21 -0
  230. package/src/node/resolver/view-resolver.ts +29 -0
  231. package/src/node/view/file-view.ts +68 -0
  232. package/src/node/view/html-view.ts +34 -0
  233. package/src/node/view/index.ts +6 -0
  234. package/src/node/view/json-view-template-renderer.ts +23 -0
  235. package/src/node/view/json-view.ts +26 -0
  236. package/src/node/view/text-view.ts +23 -0
  237. package/src/node/view/view-protocol.ts +14 -0
  238. package/src/node/view/view-provider.ts +21 -0
  239. package/src/package.spec.ts +4 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2019 Cellbang
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1 @@
1
+ # Cell - MVC Component
package/cell.yml ADDED
@@ -0,0 +1,9 @@
1
+ cell:
2
+ mvc:
3
+ path: /*
4
+ defaultViewName: json
5
+ baseFileDir: assets
6
+ mustache:
7
+ cache: false
8
+ baseViewDir: assets/views
9
+
@@ -0,0 +1,2 @@
1
+ export declare const MVC_PATH = "cell.mvc.path";
2
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/common/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,QAAQ,kBAAkB,CAAC"}
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MVC_PATH = void 0;
4
+ exports.MVC_PATH = 'cell.mvc.path';
5
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/common/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,QAAQ,GAAG,eAAe,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from './constants';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC"}
@@ -0,0 +1,18 @@
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);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./constants"), exports);
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA4B"}
@@ -0,0 +1,7 @@
1
+ export interface BodyMetadata {
2
+ name?: string;
3
+ parameterIndex: number;
4
+ }
5
+ export declare function Body(name?: string): ParameterDecorator;
6
+ export declare function applyBodyDecorator(target: any, targetKey: string | symbol | undefined, parameterIndex: number, name?: string): void;
7
+ //# sourceMappingURL=body.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"body.d.ts","sourceRoot":"","sources":["../../../src/node/annotation/body.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,YAAY;IACzB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,cAAc,EAAE,MAAM,CAAC;CAC1B;AAED,wBAAgB,IAAI,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,kBAAkB,CAItD;AAED,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,EAAG,cAAc,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAOpI"}
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.applyBodyDecorator = exports.Body = void 0;
4
+ const constants_1 = require("../constants");
5
+ function Body(name) {
6
+ return (t, tk, i) => {
7
+ applyBodyDecorator(t, tk, i, name);
8
+ };
9
+ }
10
+ exports.Body = Body;
11
+ function applyBodyDecorator(target, targetKey, parameterIndex, name) {
12
+ if (!targetKey) {
13
+ return;
14
+ }
15
+ const metadatas = Reflect.getOwnMetadata(constants_1.METADATA_KEY.controllerBody, target.constructor, targetKey) || [];
16
+ metadatas.push({ name, parameterIndex });
17
+ Reflect.defineMetadata(constants_1.METADATA_KEY.controllerBody, metadatas, target.constructor, targetKey);
18
+ }
19
+ exports.applyBodyDecorator = applyBodyDecorator;
20
+ //# sourceMappingURL=body.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"body.js","sourceRoot":"","sources":["../../../src/node/annotation/body.ts"],"names":[],"mappings":";;;AAAA,4CAA4C;AAO5C,SAAgB,IAAI,CAAC,IAAa;IAC9B,OAAO,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE;QAChB,kBAAkB,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,IAAI,CAAC,CAAC;IACvC,CAAC,CAAC;AACN,CAAC;AAJD,oBAIC;AAED,SAAgB,kBAAkB,CAAC,MAAW,EAAE,SAAsC,EAAG,cAAsB,EAAE,IAAa;IAC1H,IAAI,CAAC,SAAS,EAAE;QACZ,OAAO;KACV;IACD,MAAM,SAAS,GAAmB,OAAO,CAAC,cAAc,CAAC,wBAAY,CAAC,cAAc,EAAE,MAAM,CAAC,WAAW,EAAE,SAAS,CAAC,IAAI,EAAE,CAAC;IAC3H,SAAS,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,cAAc,EAAE,CAAC,CAAC;IACzC,OAAO,CAAC,cAAc,CAAC,wBAAY,CAAC,cAAc,EAAE,SAAS,EAAE,MAAM,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC;AAClG,CAAC;AAPD,gDAOC"}
@@ -0,0 +1,10 @@
1
+ import { ErrorType } from '@celljs/core';
2
+ export interface CatchMetadata {
3
+ errorTypes: ErrorType[];
4
+ target: any;
5
+ key: string | symbol;
6
+ descriptor: TypedPropertyDescriptor<any>;
7
+ }
8
+ export declare function Catch(errorTypes: ErrorType | ErrorType[]): MethodDecorator;
9
+ export declare function applyCatchDecorator(target: any, key: string | symbol, descriptor: TypedPropertyDescriptor<any>, errorTypes: ErrorType[]): void;
10
+ //# sourceMappingURL=catch.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"catch.d.ts","sourceRoot":"","sources":["../../../src/node/annotation/catch.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,MAAM,WAAW,aAAa;IAC1B,UAAU,EAAE,SAAS,EAAE,CAAC;IACxB,MAAM,EAAE,GAAG,CAAC;IACZ,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;IACrB,UAAU,EAAE,uBAAuB,CAAC,GAAG,CAAC,CAAC;CAC5C;AAED,wBAAgB,KAAK,CAAC,UAAU,EAAE,SAAS,GAAG,SAAS,EAAE,GAAG,eAAe,CAI1E;AAED,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,UAAU,EAAE,uBAAuB,CAAC,GAAG,CAAC,EAAE,UAAU,EAAE,SAAS,EAAE,GAAG,IAAI,CAU9I"}
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.applyCatchDecorator = exports.Catch = void 0;
4
+ const constants_1 = require("../constants");
5
+ function Catch(errorTypes) {
6
+ return (t, k, d) => {
7
+ applyCatchDecorator(t, k, d, Array.isArray(errorTypes) ? errorTypes : [errorTypes]);
8
+ };
9
+ }
10
+ exports.Catch = Catch;
11
+ function applyCatchDecorator(target, key, descriptor, errorTypes) {
12
+ const metadata = { errorTypes, target, key, descriptor };
13
+ let metadataList = [];
14
+ if (!Reflect.hasOwnMetadata(constants_1.METADATA_KEY.controllerCatch, target.constructor)) {
15
+ Reflect.defineMetadata(constants_1.METADATA_KEY.controllerCatch, metadataList, target.constructor);
16
+ }
17
+ else {
18
+ metadataList = Reflect.getOwnMetadata(constants_1.METADATA_KEY.controllerCatch, target.constructor);
19
+ }
20
+ metadataList.push(metadata);
21
+ }
22
+ exports.applyCatchDecorator = applyCatchDecorator;
23
+ //# sourceMappingURL=catch.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"catch.js","sourceRoot":"","sources":["../../../src/node/annotation/catch.ts"],"names":[],"mappings":";;;AAAA,4CAA4C;AAU5C,SAAgB,KAAK,CAAC,UAAmC;IACrD,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE;QACf,mBAAmB,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAE,UAAU,CAAE,CAAC,CAAC;IAC1F,CAAC,CAAC;AACN,CAAC;AAJD,sBAIC;AAED,SAAgB,mBAAmB,CAAC,MAAW,EAAE,GAAoB,EAAE,UAAwC,EAAE,UAAuB;IACpI,MAAM,QAAQ,GAAkB,EAAE,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,EAAE,CAAC;IACxE,IAAI,YAAY,GAAoB,EAAE,CAAC;IAEvC,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,wBAAY,CAAC,eAAe,EAAE,MAAM,CAAC,WAAW,CAAC,EAAE;QAC3E,OAAO,CAAC,cAAc,CAAC,wBAAY,CAAC,eAAe,EAAE,YAAY,EAAE,MAAM,CAAC,WAAW,CAAC,CAAC;KAC1F;SAAM;QACH,YAAY,GAAG,OAAO,CAAC,cAAc,CAAC,wBAAY,CAAC,eAAe,EAAE,MAAM,CAAC,WAAW,CAAC,CAAC;KAC3F;IACD,YAAY,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;AAChC,CAAC;AAVD,kDAUC"}
@@ -0,0 +1,15 @@
1
+ import { ComponentOption } from '@celljs/core';
2
+ export declare const CONTROLLER: unique symbol;
3
+ export declare const CONTROLLER_TAG = "Controller";
4
+ export interface ControllerOption extends ComponentOption {
5
+ path?: string;
6
+ }
7
+ export interface ControllerMetadata {
8
+ path: string;
9
+ target: any;
10
+ }
11
+ export declare type PathOrControllerOption = string | ControllerOption;
12
+ export declare function Controller(pathOrOption?: PathOrControllerOption): ClassDecorator;
13
+ export declare function parseControllerOption(target: any, pathOrOption?: PathOrControllerOption): ControllerOption;
14
+ export declare function applyControllerDecorator(option: ControllerOption, target: any): ControllerMetadata;
15
+ //# sourceMappingURL=controller.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"controller.d.ts","sourceRoot":"","sources":["../../../src/node/annotation/controller.ts"],"names":[],"mappings":"AACA,OAAO,EAA0C,eAAe,EAAwB,MAAM,cAAc,CAAC;AAG7G,eAAO,MAAM,UAAU,eAAuB,CAAC;AAE/C,eAAO,MAAM,cAAc,eAAe,CAAC;AAE3C,MAAM,WAAW,gBAAiB,SAAQ,eAAe;IACrD,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,kBAAkB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,GAAG,CAAC;CACf;AAED,oBAAY,sBAAsB,GAAG,MAAM,GAAG,gBAAgB,CAAC;AAE/D,wBAAgB,UAAU,CAAC,YAAY,CAAC,EAAE,sBAAsB,GAAG,cAAc,CAKhF;AAED,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,GAAG,EAAE,YAAY,CAAC,EAAE,sBAAsB,oBAUvF;AAED,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,gBAAgB,EAAE,MAAM,EAAE,GAAG,sBAK7E"}
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.applyControllerDecorator = exports.parseControllerOption = exports.Controller = exports.CONTROLLER_TAG = exports.CONTROLLER = void 0;
4
+ const constants_1 = require("../constants");
5
+ const core_1 = require("@celljs/core");
6
+ const web_1 = require("@celljs/web");
7
+ exports.CONTROLLER = Symbol('Controller');
8
+ exports.CONTROLLER_TAG = 'Controller';
9
+ function Controller(pathOrOption) {
10
+ return function (target) {
11
+ const option = parseControllerOption(target, pathOrOption);
12
+ applyControllerDecorator(option, target);
13
+ };
14
+ }
15
+ exports.Controller = Controller;
16
+ function parseControllerOption(target, pathOrOption) {
17
+ const option = core_1.AnnotationUtil.getValueOrOption(pathOrOption, 'path');
18
+ const parsed = (0, core_1.parseComponentOption)(target, option);
19
+ if (option.proxy === undefined) {
20
+ parsed.proxy = true;
21
+ }
22
+ parsed.sysTags.push(web_1.AOP_POINTCUT, exports.CONTROLLER_TAG);
23
+ parsed.path = parsed.path || '';
24
+ parsed.id.push(exports.CONTROLLER);
25
+ return parsed;
26
+ }
27
+ exports.parseControllerOption = parseControllerOption;
28
+ function applyControllerDecorator(option, target) {
29
+ const metadata = { path: option.path, target };
30
+ Reflect.defineMetadata(constants_1.METADATA_KEY.controller, metadata, target);
31
+ (0, core_1.Component)(option)(target);
32
+ return metadata;
33
+ }
34
+ exports.applyControllerDecorator = applyControllerDecorator;
35
+ //# sourceMappingURL=controller.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"controller.js","sourceRoot":"","sources":["../../../src/node/annotation/controller.ts"],"names":[],"mappings":";;;AAAA,4CAA4C;AAC5C,uCAA6G;AAC7G,qCAA2C;AAE9B,QAAA,UAAU,GAAG,MAAM,CAAC,YAAY,CAAC,CAAC;AAElC,QAAA,cAAc,GAAG,YAAY,CAAC;AAa3C,SAAgB,UAAU,CAAC,YAAqC;IAC5D,OAAO,UAAU,MAAM;QACnB,MAAM,MAAM,GAAG,qBAAqB,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;QAC3D,wBAAwB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7C,CAAC,CAAC;AACN,CAAC;AALD,gCAKC;AAED,SAAgB,qBAAqB,CAAC,MAAW,EAAE,YAAqC;IACpF,MAAM,MAAM,GAAG,qBAAc,CAAC,gBAAgB,CAAmB,YAAY,EAAE,MAAM,CAAC,CAAC;IACvF,MAAM,MAAM,GAAqB,IAAA,2BAAoB,EAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtE,IAAI,MAAM,CAAC,KAAK,KAAK,SAAS,EAAE;QAC5B,MAAM,CAAC,KAAK,GAAG,IAAI,CAAC;KACvB;IACD,MAAM,CAAC,OAAQ,CAAC,IAAI,CAAC,kBAAY,EAAE,sBAAc,CAAC,CAAC;IACnD,MAAM,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,IAAI,EAAE,CAAC;IAC/B,MAAM,CAAC,EAAyB,CAAC,IAAI,CAAC,kBAAU,CAAC,CAAC;IACnD,OAAO,MAAM,CAAC;AAClB,CAAC;AAVD,sDAUC;AAED,SAAgB,wBAAwB,CAAC,MAAwB,EAAE,MAAW;IAC1E,MAAM,QAAQ,GAAuB,EAAE,IAAI,EAAE,MAAM,CAAC,IAAK,EAAE,MAAM,EAAE,CAAC;IACpE,OAAO,CAAC,cAAc,CAAC,wBAAY,CAAC,UAAU,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;IAClE,IAAA,gBAAS,EAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC;IAC1B,OAAO,QAAQ,CAAC;AACpB,CAAC;AALD,4DAKC"}
@@ -0,0 +1,16 @@
1
+ export interface RequestCookieMetadata {
2
+ name?: string;
3
+ parameterIndex: number;
4
+ }
5
+ export interface ResponseCookieMetadata {
6
+ name: string;
7
+ value: string;
8
+ }
9
+ export interface CookieDecorator {
10
+ (name?: string): ParameterDecorator;
11
+ (name: string, value: string): MethodDecorator;
12
+ }
13
+ export declare const Cookie: CookieDecorator;
14
+ export declare function applyRequestCookieDecorator(target: any, targetKey: string | symbol, parameterIndex: number, name?: string): void;
15
+ export declare function applyResponseCookieDecorator(target: any, targetKey: string | symbol, descriptor: PropertyDescriptor, name: string, value: string): void;
16
+ //# sourceMappingURL=cookie.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cookie.d.ts","sourceRoot":"","sources":["../../../src/node/annotation/cookie.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,qBAAqB;IAClC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,cAAc,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,sBAAsB;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,eAAe;IAC5B,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,kBAAkB,CAAC;IACpC,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,eAAe,CAAC;CAElD;AAED,eAAO,MAAM,MAAM,iBAUlB,CAAC;AAEF,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAIhI;AAED,wBAAgB,4BAA4B,CAAC,MAAM,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,EAAE,UAAU,EAAE,kBAAkB,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAIvJ"}
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.applyResponseCookieDecorator = exports.applyRequestCookieDecorator = exports.Cookie = void 0;
4
+ const constants_1 = require("../constants");
5
+ exports.Cookie = function (name, value) {
6
+ if (name && value) {
7
+ return (t, tk, d) => {
8
+ applyResponseCookieDecorator(t, tk, d, name, value);
9
+ };
10
+ }
11
+ else {
12
+ return (t, tk, i) => {
13
+ applyRequestCookieDecorator(t, tk, i, name);
14
+ };
15
+ }
16
+ };
17
+ function applyRequestCookieDecorator(target, targetKey, parameterIndex, name) {
18
+ const metadatas = Reflect.getOwnMetadata(constants_1.METADATA_KEY.controllerRequestCookie, target.constructor, targetKey) || [];
19
+ metadatas.push({ name, parameterIndex });
20
+ Reflect.defineMetadata(constants_1.METADATA_KEY.controllerRequestCookie, metadatas, target.constructor, targetKey);
21
+ }
22
+ exports.applyRequestCookieDecorator = applyRequestCookieDecorator;
23
+ function applyResponseCookieDecorator(target, targetKey, descriptor, name, value) {
24
+ const metadatas = Reflect.getOwnMetadata(constants_1.METADATA_KEY.controllerResponseCookie, target.constructor, targetKey) || [];
25
+ metadatas.push({ name, value });
26
+ Reflect.defineMetadata(constants_1.METADATA_KEY.controllerResponseCookie, metadatas, target.constructor, targetKey);
27
+ }
28
+ exports.applyResponseCookieDecorator = applyResponseCookieDecorator;
29
+ //# sourceMappingURL=cookie.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cookie.js","sourceRoot":"","sources":["../../../src/node/annotation/cookie.ts"],"names":[],"mappings":";;;AAAA,4CAA4C;AAkB/B,QAAA,MAAM,GAAoB,UAAU,IAAa,EAAE,KAAc;IAC1E,IAAI,IAAI,IAAI,KAAK,EAAE;QACf,OAAO,CAAC,CAAM,EAAE,EAAmB,EAAE,CAAqB,EAAE,EAAE;YAC1D,4BAA4B,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;QACxD,CAAC,CAAC;KACL;SAAM;QACH,OAAO,CAAC,CAAM,EAAE,EAAU,EAAE,CAAS,EAAE,EAAE;YACrC,2BAA2B,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,IAAI,CAAC,CAAC;QAChD,CAAC,CAAC;KACL;AACL,CAAC,CAAC;AAEF,SAAgB,2BAA2B,CAAC,MAAW,EAAE,SAA0B,EAAE,cAAsB,EAAE,IAAa;IACtH,MAAM,SAAS,GAA4B,OAAO,CAAC,cAAc,CAAC,wBAAY,CAAC,uBAAuB,EAAE,MAAM,CAAC,WAAW,EAAE,SAAS,CAAC,IAAI,EAAE,CAAC;IAC7I,SAAS,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,cAAc,EAAE,CAAC,CAAC;IACzC,OAAO,CAAC,cAAc,CAAC,wBAAY,CAAC,uBAAuB,EAAE,SAAS,EAAE,MAAM,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC;AAC3G,CAAC;AAJD,kEAIC;AAED,SAAgB,4BAA4B,CAAC,MAAW,EAAE,SAA0B,EAAE,UAA8B,EAAE,IAAY,EAAE,KAAa;IAC7I,MAAM,SAAS,GAA6B,OAAO,CAAC,cAAc,CAAC,wBAAY,CAAC,wBAAwB,EAAE,MAAM,CAAC,WAAW,EAAE,SAAS,CAAC,IAAI,EAAE,CAAC;IAC/I,SAAS,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,KAAK,EAAG,CAAC,CAAC;IACjC,OAAO,CAAC,cAAc,CAAC,wBAAY,CAAC,wBAAwB,EAAE,SAAS,EAAE,MAAM,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC;AAC5G,CAAC;AAJD,oEAIC"}
@@ -0,0 +1,3 @@
1
+ export declare const FILE_VIEW_NAME = "file";
2
+ export declare function File(file?: string): MethodDecorator;
3
+ //# sourceMappingURL=file.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file.d.ts","sourceRoot":"","sources":["../../../src/node/annotation/file.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,cAAc,SAAS,CAAC;AAErC,wBAAgB,IAAI,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,eAAe,CAEnD"}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.File = exports.FILE_VIEW_NAME = void 0;
4
+ const view_1 = require("./view");
5
+ exports.FILE_VIEW_NAME = 'file';
6
+ function File(file) {
7
+ return (0, view_1.View)(exports.FILE_VIEW_NAME, { file });
8
+ }
9
+ exports.File = File;
10
+ //# sourceMappingURL=file.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file.js","sourceRoot":"","sources":["../../../src/node/annotation/file.ts"],"names":[],"mappings":";;;AAAA,iCAA8B;AAEjB,QAAA,cAAc,GAAG,MAAM,CAAC;AAErC,SAAgB,IAAI,CAAC,IAAa;IAC9B,OAAO,IAAA,WAAI,EAAC,sBAAc,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;AAC1C,CAAC;AAFD,oBAEC"}
@@ -0,0 +1,16 @@
1
+ export interface RequestHeaderMetadata {
2
+ name?: string;
3
+ parameterIndex: number;
4
+ }
5
+ export interface ResponseHeaderMetadata {
6
+ name: string;
7
+ value: string;
8
+ }
9
+ export interface HeaderDecorator {
10
+ (name?: string): ParameterDecorator;
11
+ (name: string, value: string): MethodDecorator;
12
+ }
13
+ export declare const Header: HeaderDecorator;
14
+ export declare function applyRequestHeaderDecorator(target: any, targetKey: string | symbol, parameterIndex: number, name?: string): void;
15
+ export declare function applyResponseHeaderDecorator(target: any, targetKey: string | symbol, descriptor: PropertyDescriptor, name: string, value: string): void;
16
+ //# sourceMappingURL=header.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"header.d.ts","sourceRoot":"","sources":["../../../src/node/annotation/header.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,qBAAqB;IAClC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,cAAc,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,sBAAsB;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,eAAe;IAC5B,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,kBAAkB,CAAC;IACpC,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,eAAe,CAAC;CAElD;AAED,eAAO,MAAM,MAAM,iBAUlB,CAAC;AAEF,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAIhI;AAED,wBAAgB,4BAA4B,CAAC,MAAM,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,EAAE,UAAU,EAAE,kBAAkB,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAIvJ"}
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.applyResponseHeaderDecorator = exports.applyRequestHeaderDecorator = exports.Header = void 0;
4
+ const constants_1 = require("../constants");
5
+ exports.Header = function (name, value) {
6
+ if (name && value) {
7
+ return (t, tk, d) => {
8
+ applyResponseHeaderDecorator(t, tk, d, name, value);
9
+ };
10
+ }
11
+ else {
12
+ return (t, tk, i) => {
13
+ applyRequestHeaderDecorator(t, tk, i, name);
14
+ };
15
+ }
16
+ };
17
+ function applyRequestHeaderDecorator(target, targetKey, parameterIndex, name) {
18
+ const metadatas = Reflect.getOwnMetadata(constants_1.METADATA_KEY.controllerRequestHeader, target.constructor, targetKey) || [];
19
+ metadatas.push({ name, parameterIndex });
20
+ Reflect.defineMetadata(constants_1.METADATA_KEY.controllerRequestHeader, metadatas, target.constructor, targetKey);
21
+ }
22
+ exports.applyRequestHeaderDecorator = applyRequestHeaderDecorator;
23
+ function applyResponseHeaderDecorator(target, targetKey, descriptor, name, value) {
24
+ const metadatas = Reflect.getOwnMetadata(constants_1.METADATA_KEY.controllerResponseHeader, target.constructor, targetKey) || [];
25
+ metadatas.push({ name, value });
26
+ Reflect.defineMetadata(constants_1.METADATA_KEY.controllerResponseHeader, metadatas, target.constructor, targetKey);
27
+ }
28
+ exports.applyResponseHeaderDecorator = applyResponseHeaderDecorator;
29
+ //# sourceMappingURL=header.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"header.js","sourceRoot":"","sources":["../../../src/node/annotation/header.ts"],"names":[],"mappings":";;;AAAA,4CAA4C;AAkB/B,QAAA,MAAM,GAAoB,UAAU,IAAa,EAAE,KAAc;IAC1E,IAAI,IAAI,IAAI,KAAK,EAAE;QACf,OAAO,CAAC,CAAM,EAAE,EAAmB,EAAE,CAAqB,EAAE,EAAE;YAC1D,4BAA4B,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;QACxD,CAAC,CAAC;KACL;SAAM;QACH,OAAO,CAAC,CAAM,EAAE,EAAmB,EAAE,CAAS,EAAE,EAAE;YAC9C,2BAA2B,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,IAAI,CAAC,CAAC;QAChD,CAAC,CAAC;KACL;AACL,CAAC,CAAC;AAEF,SAAgB,2BAA2B,CAAC,MAAW,EAAE,SAA0B,EAAE,cAAsB,EAAE,IAAa;IACtH,MAAM,SAAS,GAA4B,OAAO,CAAC,cAAc,CAAC,wBAAY,CAAC,uBAAuB,EAAE,MAAM,CAAC,WAAW,EAAE,SAAS,CAAC,IAAI,EAAE,CAAC;IAC7I,SAAS,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,cAAc,EAAE,CAAC,CAAC;IACzC,OAAO,CAAC,cAAc,CAAC,wBAAY,CAAC,uBAAuB,EAAE,SAAS,EAAE,MAAM,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC;AAC3G,CAAC;AAJD,kEAIC;AAED,SAAgB,4BAA4B,CAAC,MAAW,EAAE,SAA0B,EAAE,UAA8B,EAAE,IAAY,EAAE,KAAa;IAC7I,MAAM,SAAS,GAA6B,OAAO,CAAC,cAAc,CAAC,wBAAY,CAAC,wBAAwB,EAAE,MAAM,CAAC,WAAW,EAAE,SAAS,CAAC,IAAI,EAAE,CAAC;IAC/I,SAAS,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,KAAK,EAAG,CAAC,CAAC;IACjC,OAAO,CAAC,cAAc,CAAC,wBAAY,CAAC,wBAAwB,EAAE,SAAS,EAAE,MAAM,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC;AAC5G,CAAC;AAJD,oEAIC"}
@@ -0,0 +1,3 @@
1
+ export declare const HTML_VIEW_NAME = "html";
2
+ export declare function Html(file?: string): MethodDecorator;
3
+ //# sourceMappingURL=html.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"html.d.ts","sourceRoot":"","sources":["../../../src/node/annotation/html.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,cAAc,SAAS,CAAC;AAErC,wBAAgB,IAAI,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,eAAe,CAEnD"}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Html = exports.HTML_VIEW_NAME = void 0;
4
+ const view_1 = require("./view");
5
+ exports.HTML_VIEW_NAME = 'html';
6
+ function Html(file) {
7
+ return (0, view_1.View)(exports.HTML_VIEW_NAME, { file });
8
+ }
9
+ exports.Html = Html;
10
+ //# sourceMappingURL=html.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"html.js","sourceRoot":"","sources":["../../../src/node/annotation/html.ts"],"names":[],"mappings":";;;AAAA,iCAA8B;AAEjB,QAAA,cAAc,GAAG,MAAM,CAAC;AAErC,SAAgB,IAAI,CAAC,IAAa;IAC9B,OAAO,IAAA,WAAI,EAAC,sBAAc,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;AAC1C,CAAC;AAFD,oBAEC"}
@@ -0,0 +1,17 @@
1
+ export * from './body';
2
+ export * from './controller';
3
+ export * from './header';
4
+ export * from './method';
5
+ export * from './param';
6
+ export * from './query';
7
+ export * from './view';
8
+ export * from './cookie';
9
+ export * from './session';
10
+ export * from './catch';
11
+ export * from './file';
12
+ export * from './text';
13
+ export * from './json';
14
+ export * from './html';
15
+ export * from './req';
16
+ export * from './res';
17
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/node/annotation/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,OAAO,CAAC;AACtB,cAAc,OAAO,CAAC"}
@@ -0,0 +1,33 @@
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);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./body"), exports);
18
+ __exportStar(require("./controller"), exports);
19
+ __exportStar(require("./header"), exports);
20
+ __exportStar(require("./method"), exports);
21
+ __exportStar(require("./param"), exports);
22
+ __exportStar(require("./query"), exports);
23
+ __exportStar(require("./view"), exports);
24
+ __exportStar(require("./cookie"), exports);
25
+ __exportStar(require("./session"), exports);
26
+ __exportStar(require("./catch"), exports);
27
+ __exportStar(require("./file"), exports);
28
+ __exportStar(require("./text"), exports);
29
+ __exportStar(require("./json"), exports);
30
+ __exportStar(require("./html"), exports);
31
+ __exportStar(require("./req"), exports);
32
+ __exportStar(require("./res"), exports);
33
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/node/annotation/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yCAAuB;AACvB,+CAA6B;AAC7B,2CAAyB;AACzB,2CAAyB;AACzB,0CAAwB;AACxB,0CAAwB;AACxB,yCAAuB;AACvB,2CAAyB;AACzB,4CAA0B;AAC1B,0CAAwB;AACxB,yCAAuB;AACvB,yCAAuB;AACvB,yCAAuB;AACvB,yCAAuB;AACvB,wCAAsB;AACtB,wCAAsB"}
@@ -0,0 +1,3 @@
1
+ export declare const JSON_VIEW_NAME = "json";
2
+ export declare function Json(): MethodDecorator;
3
+ //# sourceMappingURL=json.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"json.d.ts","sourceRoot":"","sources":["../../../src/node/annotation/json.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,cAAc,SAAS,CAAC;AAErC,wBAAgB,IAAI,IAAI,eAAe,CAEtC"}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Json = exports.JSON_VIEW_NAME = void 0;
4
+ const view_1 = require("./view");
5
+ exports.JSON_VIEW_NAME = 'json';
6
+ function Json() {
7
+ return (0, view_1.View)(exports.JSON_VIEW_NAME);
8
+ }
9
+ exports.Json = Json;
10
+ //# sourceMappingURL=json.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"json.js","sourceRoot":"","sources":["../../../src/node/annotation/json.ts"],"names":[],"mappings":";;;AAAA,iCAA8B;AAEjB,QAAA,cAAc,GAAG,MAAM,CAAC;AAErC,SAAgB,IAAI;IAChB,OAAO,IAAA,WAAI,EAAC,sBAAc,CAAC,CAAC;AAChC,CAAC;AAFD,oBAEC"}
@@ -0,0 +1,24 @@
1
+ export declare type StrOrRegex = string | RegExp;
2
+ export declare type RouteOptions = StrOrRegex | {
3
+ path: StrOrRegex;
4
+ } | {
5
+ options: Object;
6
+ path: StrOrRegex;
7
+ } & Object;
8
+ export interface MethodMetadata {
9
+ options: RouteOptions;
10
+ target: any;
11
+ method: string;
12
+ key: string | symbol;
13
+ descriptor: TypedPropertyDescriptor<any>;
14
+ }
15
+ export declare function Get(options?: RouteOptions): MethodDecorator;
16
+ export declare function Post(options?: RouteOptions): MethodDecorator;
17
+ export declare function Put(options?: RouteOptions): MethodDecorator;
18
+ export declare function Patch(options?: RouteOptions): MethodDecorator;
19
+ export declare function Head(options?: RouteOptions): MethodDecorator;
20
+ export declare function Delete(options?: RouteOptions): MethodDecorator;
21
+ export declare function Options(options?: RouteOptions): MethodDecorator;
22
+ export declare function All(options?: RouteOptions): MethodDecorator;
23
+ export declare const Method: (options?: RouteOptions, ...methods: string[]) => MethodDecorator;
24
+ //# sourceMappingURL=method.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"method.d.ts","sourceRoot":"","sources":["../../../src/node/annotation/method.ts"],"names":[],"mappings":"AAGA,oBAAY,UAAU,GAAG,MAAM,GAAG,MAAM,CAAC;AACzC,oBAAY,YAAY,GAAG,UAAU,GAAG;IAAE,IAAI,EAAE,UAAU,CAAA;CAAE,GAAG;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,UAAU,CAAA;CAAE,GAAG,MAAM,CAAC;AAE9G,MAAM,WAAW,cAAc;IAC3B,OAAO,EAAE,YAAY,CAAC;IACtB,MAAM,EAAE,GAAG,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;IACrB,UAAU,EAAE,uBAAuB,CAAC,GAAG,CAAC,CAAC;CAC5C;AAED,wBAAgB,GAAG,CAAC,OAAO,CAAC,EAAE,YAAY,GAAG,eAAe,CAE3D;AAED,wBAAgB,IAAI,CAAC,OAAO,CAAC,EAAE,YAAY,GAAG,eAAe,CAE5D;AAED,wBAAgB,GAAG,CAAC,OAAO,CAAC,EAAE,YAAY,GAAG,eAAe,CAE3D;AAED,wBAAgB,KAAK,CAAC,OAAO,CAAC,EAAE,YAAY,GAAG,eAAe,CAE7D;AAED,wBAAgB,IAAI,CAAC,OAAO,CAAC,EAAE,YAAY,GAAG,eAAe,CAE5D;AAED,wBAAgB,MAAM,CAAC,OAAO,CAAC,EAAE,YAAY,GAAG,eAAe,CAE9D;AAED,wBAAgB,OAAO,CAAC,OAAO,CAAC,EAAE,YAAY,GAAG,eAAe,CAE/D;AAED,wBAAgB,GAAG,CAAC,OAAO,CAAC,EAAE,YAAY,GAAG,eAAe,CAE3D;AAED,eAAO,MAAM,MAAM,aAAsB,YAAY,cAAmB,MAAM,EAAE,KAAG,eAclF,CAAC"}
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Method = exports.All = exports.Options = exports.Delete = exports.Head = exports.Patch = exports.Put = exports.Post = exports.Get = void 0;
4
+ const constants_1 = require("../constants");
5
+ const http_1 = require("@celljs/http");
6
+ function Get(options) {
7
+ return (0, exports.Method)(options, http_1.HttpMethod.GET);
8
+ }
9
+ exports.Get = Get;
10
+ function Post(options) {
11
+ return (0, exports.Method)(options, http_1.HttpMethod.POST);
12
+ }
13
+ exports.Post = Post;
14
+ function Put(options) {
15
+ return (0, exports.Method)(options, http_1.HttpMethod.PUT);
16
+ }
17
+ exports.Put = Put;
18
+ function Patch(options) {
19
+ return (0, exports.Method)(options, http_1.HttpMethod.PATCH);
20
+ }
21
+ exports.Patch = Patch;
22
+ function Head(options) {
23
+ return (0, exports.Method)(options, http_1.HttpMethod.HEAD);
24
+ }
25
+ exports.Head = Head;
26
+ function Delete(options) {
27
+ return (0, exports.Method)(options, http_1.HttpMethod.DELETE);
28
+ }
29
+ exports.Delete = Delete;
30
+ function Options(options) {
31
+ return (0, exports.Method)(options, http_1.HttpMethod.OPTIONS);
32
+ }
33
+ exports.Options = Options;
34
+ function All(options) {
35
+ return (0, exports.Method)(options, http_1.HttpMethod.GET, http_1.HttpMethod.DELETE, http_1.HttpMethod.HEAD, http_1.HttpMethod.PATCH, http_1.HttpMethod.POST, http_1.HttpMethod.PUT, http_1.HttpMethod.TRACE, http_1.HttpMethod.OPTIONS);
36
+ }
37
+ exports.All = All;
38
+ const Method = function (options = '', ...methods) {
39
+ return function (target, key, descriptor) {
40
+ let metadataList = [];
41
+ if (!Reflect.hasOwnMetadata(constants_1.METADATA_KEY.controllerMethod, target.constructor)) {
42
+ Reflect.defineMetadata(constants_1.METADATA_KEY.controllerMethod, metadataList, target.constructor);
43
+ }
44
+ else {
45
+ metadataList = Reflect.getOwnMetadata(constants_1.METADATA_KEY.controllerMethod, target.constructor);
46
+ }
47
+ for (const method of methods) {
48
+ const metadata = { options, method, target, key, descriptor };
49
+ metadataList.push(metadata);
50
+ }
51
+ };
52
+ };
53
+ exports.Method = Method;
54
+ //# sourceMappingURL=method.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"method.js","sourceRoot":"","sources":["../../../src/node/annotation/method.ts"],"names":[],"mappings":";;;AAAA,4CAA4C;AAC5C,uCAA0C;AAa1C,SAAgB,GAAG,CAAC,OAAsB;IACtC,OAAO,IAAA,cAAM,EAAC,OAAO,EAAE,iBAAU,CAAC,GAAG,CAAC,CAAC;AAC3C,CAAC;AAFD,kBAEC;AAED,SAAgB,IAAI,CAAC,OAAsB;IACvC,OAAO,IAAA,cAAM,EAAC,OAAO,EAAE,iBAAU,CAAC,IAAI,CAAC,CAAC;AAC5C,CAAC;AAFD,oBAEC;AAED,SAAgB,GAAG,CAAC,OAAsB;IACtC,OAAO,IAAA,cAAM,EAAC,OAAO,EAAE,iBAAU,CAAC,GAAG,CAAC,CAAC;AAC3C,CAAC;AAFD,kBAEC;AAED,SAAgB,KAAK,CAAC,OAAsB;IACxC,OAAO,IAAA,cAAM,EAAC,OAAO,EAAE,iBAAU,CAAC,KAAK,CAAC,CAAC;AAC7C,CAAC;AAFD,sBAEC;AAED,SAAgB,IAAI,CAAC,OAAsB;IACvC,OAAO,IAAA,cAAM,EAAC,OAAO,EAAE,iBAAU,CAAC,IAAI,CAAC,CAAC;AAC5C,CAAC;AAFD,oBAEC;AAED,SAAgB,MAAM,CAAC,OAAsB;IACzC,OAAO,IAAA,cAAM,EAAC,OAAO,EAAE,iBAAU,CAAC,MAAM,CAAC,CAAC;AAC9C,CAAC;AAFD,wBAEC;AAED,SAAgB,OAAO,CAAC,OAAsB;IAC1C,OAAO,IAAA,cAAM,EAAC,OAAO,EAAE,iBAAU,CAAC,OAAO,CAAC,CAAC;AAC/C,CAAC;AAFD,0BAEC;AAED,SAAgB,GAAG,CAAC,OAAsB;IACtC,OAAO,IAAA,cAAM,EAAC,OAAO,EAAE,iBAAU,CAAC,GAAG,EAAE,iBAAU,CAAC,MAAM,EAAE,iBAAU,CAAC,IAAI,EAAE,iBAAU,CAAC,KAAK,EAAE,iBAAU,CAAC,IAAI,EAAE,iBAAU,CAAC,GAAG,EAAE,iBAAU,CAAC,KAAK,EAAE,iBAAU,CAAC,OAAO,CAAC,CAAC;AACxK,CAAC;AAFD,kBAEC;AAEM,MAAM,MAAM,GAAG,UAAU,UAAwB,EAAE,EAAE,GAAG,OAAiB;IAC5E,OAAO,UAAU,MAAM,EAAE,GAAG,EAAE,UAAU;QACpC,IAAI,YAAY,GAAqB,EAAE,CAAC;QAExC,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,wBAAY,CAAC,gBAAgB,EAAE,MAAM,CAAC,WAAW,CAAC,EAAE;YAC5E,OAAO,CAAC,cAAc,CAAC,wBAAY,CAAC,gBAAgB,EAAE,YAAY,EAAE,MAAM,CAAC,WAAW,CAAC,CAAC;SAC3F;aAAM;YACH,YAAY,GAAG,OAAO,CAAC,cAAc,CAAC,wBAAY,CAAC,gBAAgB,EAAE,MAAM,CAAC,WAAW,CAAC,CAAC;SAC5F;QACD,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE;YAC1B,MAAM,QAAQ,GAAmB,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,EAAE,CAAC;YAC9E,YAAY,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;SAC/B;IACL,CAAC,CAAC;AACN,CAAC,CAAC;AAdW,QAAA,MAAM,UAcjB"}
@@ -0,0 +1,7 @@
1
+ export interface ParamMetadata {
2
+ name?: string;
3
+ parameterIndex: number;
4
+ }
5
+ export declare function Param(name?: string): ParameterDecorator;
6
+ export declare function applyParamDecorator(target: any, targetKey: string | symbol | undefined, parameterIndex: number, name?: string): void;
7
+ //# sourceMappingURL=param.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"param.d.ts","sourceRoot":"","sources":["../../../src/node/annotation/param.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,aAAa;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,cAAc,EAAE,MAAM,CAAC;CAC1B;AAED,wBAAgB,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,kBAAkB,CAIvD;AAED,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,EAAE,cAAc,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAOpI"}
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.applyParamDecorator = exports.Param = void 0;
4
+ const constants_1 = require("../constants");
5
+ function Param(name) {
6
+ return (t, tk, i) => {
7
+ applyParamDecorator(t, tk, i, name);
8
+ };
9
+ }
10
+ exports.Param = Param;
11
+ function applyParamDecorator(target, targetKey, parameterIndex, name) {
12
+ if (!targetKey) {
13
+ return;
14
+ }
15
+ const metadatas = Reflect.getOwnMetadata(constants_1.METADATA_KEY.controllerParam, target.constructor, targetKey) || [];
16
+ metadatas.push({ name, parameterIndex });
17
+ Reflect.defineMetadata(constants_1.METADATA_KEY.controllerParam, metadatas, target.constructor, targetKey);
18
+ }
19
+ exports.applyParamDecorator = applyParamDecorator;
20
+ //# sourceMappingURL=param.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"param.js","sourceRoot":"","sources":["../../../src/node/annotation/param.ts"],"names":[],"mappings":";;;AAAA,4CAA4C;AAO5C,SAAgB,KAAK,CAAC,IAAa;IAC/B,OAAO,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE;QAChB,mBAAmB,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,IAAI,CAAC,CAAC;IACxC,CAAC,CAAC;AACN,CAAC;AAJD,sBAIC;AAED,SAAgB,mBAAmB,CAAC,MAAW,EAAE,SAAsC,EAAE,cAAsB,EAAE,IAAa;IAC1H,IAAI,CAAC,SAAS,EAAE;QACZ,OAAO;KACV;IACD,MAAM,SAAS,GAAoB,OAAO,CAAC,cAAc,CAAC,wBAAY,CAAC,eAAe,EAAE,MAAM,CAAC,WAAW,EAAE,SAAS,CAAC,IAAI,EAAE,CAAC;IAC7H,SAAS,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,cAAc,EAAE,CAAC,CAAC;IACzC,OAAO,CAAC,cAAc,CAAC,wBAAY,CAAC,eAAe,EAAE,SAAS,EAAE,MAAM,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC;AACnG,CAAC;AAPD,kDAOC"}
@@ -0,0 +1,7 @@
1
+ export interface QueryMetadata {
2
+ name?: string;
3
+ parameterIndex: number;
4
+ }
5
+ export declare function Query(name?: string): ParameterDecorator;
6
+ export declare function applyQueryDecorator(target: any, targetKey: string | symbol | undefined, parameterIndex: number, name?: string): void;
7
+ //# sourceMappingURL=query.d.ts.map