vona 1.0.0 → 5.0.4

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 (326) hide show
  1. package/LICENSE.en-US +3 -0
  2. package/README.md +1 -1
  3. package/README.zh-CN.md +1 -0
  4. package/dist/app/extend/context.d.ts +4 -0
  5. package/dist/app/extend/context.js +152 -0
  6. package/dist/index.d.ts +11 -0
  7. package/dist/index.js +35 -0
  8. package/dist/lib/base/dbTransaction.d.ts +12 -0
  9. package/dist/lib/base/dbTransaction.js +55 -0
  10. package/dist/lib/base/error.d.ts +18 -0
  11. package/dist/lib/base/error.js +70 -0
  12. package/dist/lib/base/model.d.ts +22 -0
  13. package/dist/lib/base/model.js +253 -0
  14. package/dist/lib/bean/_beanLocal_.d.ts +6 -0
  15. package/dist/lib/bean/_beanLocal_.js +16 -0
  16. package/dist/lib/bean/beanBase.d.ts +11 -0
  17. package/dist/lib/bean/beanBase.js +34 -0
  18. package/dist/lib/bean/beanBaseSimple.d.ts +8 -0
  19. package/dist/lib/bean/beanBaseSimple.js +31 -0
  20. package/dist/lib/bean/beanContainer.d.ts +39 -0
  21. package/dist/lib/bean/beanContainer.js +514 -0
  22. package/dist/lib/bean/beanLocal.d.ts +6 -0
  23. package/dist/lib/bean/beanLocal.js +16 -0
  24. package/dist/lib/bean/beanModuleScopeBase.d.ts +10 -0
  25. package/dist/lib/bean/beanModuleScopeBase.js +28 -0
  26. package/dist/lib/bean/beanScopeBase.d.ts +6 -0
  27. package/dist/lib/bean/beanScopeBase.js +19 -0
  28. package/dist/lib/bean/beanScopeScene.d.ts +12 -0
  29. package/dist/lib/bean/beanScopeScene.js +23 -0
  30. package/dist/lib/bean/beanSimple.d.ts +7 -0
  31. package/dist/lib/bean/beanSimple.js +24 -0
  32. package/dist/lib/bean/index.d.ts +8 -0
  33. package/dist/lib/bean/index.js +24 -0
  34. package/dist/lib/bean/resource/config/broadcast.d.ts +7 -0
  35. package/dist/lib/bean/resource/config/broadcast.js +3 -0
  36. package/dist/lib/bean/resource/config/index.d.ts +2 -0
  37. package/dist/lib/bean/resource/config/index.js +18 -0
  38. package/dist/lib/bean/resource/config/middleware.d.ts +9 -0
  39. package/dist/lib/bean/resource/config/middleware.js +3 -0
  40. package/dist/lib/bean/resource/config/startup.d.ts +9 -0
  41. package/dist/lib/bean/resource/config/startup.js +3 -0
  42. package/dist/lib/bean/resource/config/type.d.ts +43 -0
  43. package/dist/lib/bean/resource/config/type.js +3 -0
  44. package/dist/lib/bean/resource/constant/index.d.ts +2 -0
  45. package/dist/lib/bean/resource/constant/index.js +18 -0
  46. package/dist/lib/bean/resource/constant/type.d.ts +2 -0
  47. package/dist/lib/bean/resource/constant/type.js +3 -0
  48. package/dist/lib/bean/resource/entity/entityBase.d.ts +21 -0
  49. package/dist/lib/bean/resource/entity/entityBase.js +20 -0
  50. package/dist/lib/bean/resource/entity/index.d.ts +2 -0
  51. package/dist/lib/bean/resource/entity/index.js +18 -0
  52. package/dist/lib/bean/resource/error/beanScopeError.d.ts +11 -0
  53. package/dist/lib/bean/resource/error/beanScopeError.js +34 -0
  54. package/dist/lib/bean/resource/error/beanScopeErrorImpl.d.ts +14 -0
  55. package/dist/lib/bean/resource/error/beanScopeErrorImpl.js +35 -0
  56. package/dist/lib/bean/resource/error/errorClass.d.ts +18 -0
  57. package/dist/lib/bean/resource/error/errorClass.js +78 -0
  58. package/dist/lib/bean/resource/error/errorContext.d.ts +38 -0
  59. package/dist/lib/bean/resource/error/errorContext.js +3 -0
  60. package/dist/lib/bean/resource/error/errorGlobal.d.ts +8 -0
  61. package/dist/lib/bean/resource/error/errorGlobal.js +3 -0
  62. package/dist/lib/bean/resource/error/errorInternal.d.ts +67 -0
  63. package/dist/lib/bean/resource/error/errorInternal.js +70 -0
  64. package/dist/lib/bean/resource/error/errorObject.d.ts +5 -0
  65. package/dist/lib/bean/resource/error/errorObject.js +3 -0
  66. package/dist/lib/bean/resource/error/index.d.ts +9 -0
  67. package/dist/lib/bean/resource/error/index.js +25 -0
  68. package/dist/lib/bean/resource/error/type.d.ts +9 -0
  69. package/dist/lib/bean/resource/error/type.js +3 -0
  70. package/dist/lib/bean/resource/index.d.ts +8 -0
  71. package/dist/lib/bean/resource/index.js +24 -0
  72. package/dist/lib/bean/resource/locale/beanScopeLocale.d.ts +11 -0
  73. package/dist/lib/bean/resource/locale/beanScopeLocale.js +33 -0
  74. package/dist/lib/bean/resource/locale/beanScopeLocaleImpl.d.ts +3 -0
  75. package/dist/lib/bean/resource/locale/beanScopeLocaleImpl.js +14 -0
  76. package/dist/lib/bean/resource/locale/index.d.ts +4 -0
  77. package/dist/lib/bean/resource/locale/index.js +20 -0
  78. package/dist/lib/bean/resource/locale/localeCtx.d.ts +8 -0
  79. package/dist/lib/bean/resource/locale/localeCtx.js +63 -0
  80. package/dist/lib/bean/resource/locale/type.d.ts +19 -0
  81. package/dist/lib/bean/resource/locale/type.js +3 -0
  82. package/dist/lib/bean/resource/model/beanModelBase.d.ts +24 -0
  83. package/dist/lib/bean/resource/model/beanModelBase.js +165 -0
  84. package/dist/lib/bean/resource/model/beanModelBaseInner.d.ts +29 -0
  85. package/dist/lib/bean/resource/model/beanModelBaseInner.js +86 -0
  86. package/dist/lib/bean/resource/model/index.d.ts +2 -0
  87. package/dist/lib/bean/resource/model/index.js +18 -0
  88. package/dist/lib/bean/resource/model/type.d.ts +12 -0
  89. package/dist/lib/bean/resource/model/type.js +3 -0
  90. package/dist/lib/bean/resource/route/index.d.ts +2 -0
  91. package/dist/lib/bean/resource/route/index.js +18 -0
  92. package/dist/lib/bean/resource/route/type.d.ts +60 -0
  93. package/dist/lib/bean/resource/route/type.js +3 -0
  94. package/dist/lib/bean/scope/beanScopeBase.d.ts +19 -0
  95. package/dist/lib/bean/scope/beanScopeBase.js +104 -0
  96. package/dist/lib/bean/scope/beanScopeBean.d.ts +10 -0
  97. package/dist/lib/bean/scope/beanScopeBean.js +34 -0
  98. package/dist/lib/bean/scope/beanScopeError.d.ts +11 -0
  99. package/dist/lib/bean/scope/beanScopeError.js +21 -0
  100. package/dist/lib/bean/scope/beanScopeErrorImpl.d.ts +14 -0
  101. package/dist/lib/bean/scope/beanScopeErrorImpl.js +21 -0
  102. package/dist/lib/bean/scope/beanScopeScene.d.ts +12 -0
  103. package/dist/lib/bean/scope/beanScopeScene.js +42 -0
  104. package/dist/lib/bean/scope/index.d.ts +5 -0
  105. package/dist/lib/bean/scope/index.js +21 -0
  106. package/dist/lib/bean/scope/type.d.ts +21 -0
  107. package/dist/lib/bean/scope/type.js +3 -0
  108. package/dist/lib/bean/type.d.ts +17 -0
  109. package/dist/lib/bean/type.js +4 -0
  110. package/dist/lib/core/index.d.ts +5 -0
  111. package/dist/lib/core/index.js +21 -0
  112. package/dist/lib/core/meta.d.ts +65 -0
  113. package/dist/lib/core/meta.js +335 -0
  114. package/dist/lib/core/metaCtx.d.ts +16 -0
  115. package/dist/lib/core/metaCtx.js +71 -0
  116. package/dist/lib/core/metadata.d.ts +12 -0
  117. package/dist/lib/core/metadata.js +52 -0
  118. package/dist/lib/core/resource.d.ts +29 -0
  119. package/dist/lib/core/resource.js +172 -0
  120. package/dist/lib/decorator/class/aop.d.ts +3 -0
  121. package/dist/lib/decorator/class/aop.js +23 -0
  122. package/dist/lib/decorator/class/atom.d.ts +3 -0
  123. package/dist/lib/decorator/class/atom.js +22 -0
  124. package/dist/lib/decorator/class/bean.d.ts +3 -0
  125. package/dist/lib/decorator/class/bean.js +23 -0
  126. package/dist/lib/decorator/class/controller.d.ts +3 -0
  127. package/dist/lib/decorator/class/controller.js +22 -0
  128. package/dist/lib/decorator/class/index.d.ts +10 -0
  129. package/dist/lib/decorator/class/index.js +26 -0
  130. package/dist/lib/decorator/class/local.d.ts +3 -0
  131. package/dist/lib/decorator/class/local.js +23 -0
  132. package/dist/lib/decorator/class/model.d.ts +3 -0
  133. package/dist/lib/decorator/class/model.js +28 -0
  134. package/dist/lib/decorator/class/scope.d.ts +2 -0
  135. package/dist/lib/decorator/class/scope.js +20 -0
  136. package/dist/lib/decorator/class/service.d.ts +3 -0
  137. package/dist/lib/decorator/class/service.js +23 -0
  138. package/dist/lib/decorator/class/use.d.ts +5 -0
  139. package/dist/lib/decorator/class/use.js +43 -0
  140. package/dist/lib/decorator/class/util.d.ts +3 -0
  141. package/dist/lib/decorator/class/util.js +10 -0
  142. package/dist/lib/decorator/class/virtual.d.ts +3 -0
  143. package/dist/lib/decorator/class/virtual.js +24 -0
  144. package/dist/lib/decorator/index.d.ts +7 -0
  145. package/dist/lib/decorator/index.js +23 -0
  146. package/dist/lib/decorator/interface/beanOptions.d.ts +55 -0
  147. package/dist/lib/decorator/interface/beanOptions.js +8 -0
  148. package/dist/lib/decorator/interface/useOptions.d.ts +14 -0
  149. package/dist/lib/decorator/interface/useOptions.js +3 -0
  150. package/dist/lib/decorator/type/constructable.d.ts +2 -0
  151. package/dist/lib/decorator/type/constructable.js +3 -0
  152. package/dist/lib/decorator/type/containerScope.d.ts +2 -0
  153. package/dist/lib/decorator/type/containerScope.js +3 -0
  154. package/dist/lib/decorator/type/injectionScope.d.ts +2 -0
  155. package/dist/lib/decorator/type/injectionScope.js +3 -0
  156. package/dist/lib/error/error.d.ts +18 -0
  157. package/dist/lib/error/error.js +71 -0
  158. package/dist/lib/error/errorClass.d.ts +18 -0
  159. package/dist/lib/error/errorClass.js +72 -0
  160. package/dist/lib/error/errorContext.d.ts +38 -0
  161. package/dist/lib/error/errorContext.js +3 -0
  162. package/dist/lib/error/errorGlobal.d.ts +8 -0
  163. package/dist/lib/error/errorGlobal.js +3 -0
  164. package/dist/lib/error/errorInternal.d.ts +67 -0
  165. package/dist/lib/error/errorInternal.js +70 -0
  166. package/dist/lib/error/errorObject.d.ts +5 -0
  167. package/dist/lib/error/errorObject.js +3 -0
  168. package/dist/lib/error/index.d.ts +5 -0
  169. package/dist/lib/error/index.js +21 -0
  170. package/dist/lib/framework/bootstrap.d.ts +9 -0
  171. package/dist/lib/framework/bootstrap.js +35 -0
  172. package/dist/lib/framework/framework.d.ts +11 -0
  173. package/dist/lib/framework/framework.js +28 -0
  174. package/dist/lib/framework/loader.d.ts +21 -0
  175. package/dist/lib/framework/loader.js +57 -0
  176. package/dist/lib/framework/meta.d.ts +2 -0
  177. package/dist/lib/framework/meta.js +23 -0
  178. package/dist/lib/framework/metaClass.d.ts +2 -0
  179. package/dist/lib/framework/metaClass.js +26 -0
  180. package/dist/lib/framework/moduleInfo.d.ts +3 -0
  181. package/dist/lib/framework/moduleInfo.js +67 -0
  182. package/dist/lib/framework/util.d.ts +4 -0
  183. package/dist/lib/framework/util.js +15 -0
  184. package/dist/lib/module/asset/errors.d.ts +68 -0
  185. package/dist/lib/module/asset/errors.js +69 -0
  186. package/dist/lib/module/bean/index.d.ts +4 -0
  187. package/dist/lib/module/bean/index.js +24 -0
  188. package/dist/lib/module/broadcast/broadcast.d.ts +3 -0
  189. package/dist/lib/module/broadcast/broadcast.js +49 -0
  190. package/dist/lib/module/broadcast/broadcastClient.d.ts +24 -0
  191. package/dist/lib/module/broadcast/broadcastClient.js +91 -0
  192. package/dist/lib/module/cluster/agent.d.ts +3 -0
  193. package/dist/lib/module/cluster/agent.js +22 -0
  194. package/dist/lib/module/cluster/app.d.ts +3 -0
  195. package/dist/lib/module/cluster/app.js +26 -0
  196. package/dist/lib/module/config.d.ts +3 -0
  197. package/dist/lib/module/config.js +67 -0
  198. package/dist/lib/module/constant.d.ts +3 -0
  199. package/dist/lib/module/constant.js +46 -0
  200. package/dist/lib/module/contextPatch.d.ts +3 -0
  201. package/dist/lib/module/contextPatch.js +16 -0
  202. package/dist/lib/module/errors.d.ts +3 -0
  203. package/dist/lib/module/errors.js +49 -0
  204. package/dist/lib/module/index.d.ts +2 -0
  205. package/dist/lib/module/index.js +3 -0
  206. package/dist/lib/module/loader.d.ts +5 -0
  207. package/dist/lib/module/loader.js +73 -0
  208. package/dist/lib/module/locales.d.ts +3 -0
  209. package/dist/lib/module/locales.js +132 -0
  210. package/dist/lib/module/messenger.d.ts +25 -0
  211. package/dist/lib/module/messenger.js +128 -0
  212. package/dist/lib/module/middleware.d.ts +3 -0
  213. package/dist/lib/module/middleware.js +113 -0
  214. package/dist/lib/module/model.d.ts +3 -0
  215. package/dist/lib/module/model.js +47 -0
  216. package/dist/lib/module/module.d.ts +12 -0
  217. package/dist/lib/module/module.js +134 -0
  218. package/dist/lib/module/moduleMeta.d.ts +3 -0
  219. package/dist/lib/module/moduleMeta.js +26 -0
  220. package/dist/lib/module/queue/queue.d.ts +3 -0
  221. package/dist/lib/module/queue/queue.js +59 -0
  222. package/dist/lib/module/queue/queueClient.d.ts +26 -0
  223. package/dist/lib/module/queue/queueClient.js +262 -0
  224. package/dist/lib/module/redis.d.ts +11 -0
  225. package/dist/lib/module/redis.js +46 -0
  226. package/dist/lib/module/reload/development.d.ts +3 -0
  227. package/dist/lib/module/reload/development.js +98 -0
  228. package/dist/lib/module/reload/reload.d.ts +16 -0
  229. package/dist/lib/module/reload/reload.js +113 -0
  230. package/dist/lib/module/reload.d.ts +7 -0
  231. package/dist/lib/module/reload.js +17 -0
  232. package/dist/lib/module/route.d.ts +10 -0
  233. package/dist/lib/module/route.js +239 -0
  234. package/dist/lib/module/schedule.d.ts +3 -0
  235. package/dist/lib/module/schedule.js +129 -0
  236. package/dist/lib/module/service.d.ts +3 -0
  237. package/dist/lib/module/service.js +35 -0
  238. package/dist/lib/module/socketio.d.ts +5 -0
  239. package/dist/lib/module/socketio.js +47 -0
  240. package/dist/lib/module/startup.d.ts +2 -0
  241. package/dist/lib/module/startup.js +134 -0
  242. package/dist/lib/module/version/clear.d.ts +2 -0
  243. package/dist/lib/module/version/clear.js +42 -0
  244. package/dist/lib/module/version/ready.d.ts +6 -0
  245. package/dist/lib/module/version/ready.js +106 -0
  246. package/dist/lib/resource/error/errorClass.d.ts +18 -0
  247. package/dist/lib/resource/error/errorClass.js +72 -0
  248. package/dist/lib/resource/error/errorContext.d.ts +38 -0
  249. package/dist/lib/resource/error/errorContext.js +3 -0
  250. package/dist/lib/resource/error/errorGlobal.d.ts +8 -0
  251. package/dist/lib/resource/error/errorGlobal.js +3 -0
  252. package/dist/lib/resource/error/errorInternal.d.ts +67 -0
  253. package/dist/lib/resource/error/errorInternal.js +70 -0
  254. package/dist/lib/resource/error/errorObject.d.ts +5 -0
  255. package/dist/lib/resource/error/errorObject.js +3 -0
  256. package/dist/lib/resource/error/index.d.ts +5 -0
  257. package/dist/lib/resource/error/index.js +21 -0
  258. package/dist/lib/utils/index.d.ts +2 -0
  259. package/dist/lib/utils/index.js +18 -0
  260. package/dist/lib/utils/isClass.d.ts +2 -0
  261. package/dist/lib/utils/isClass.js +20 -0
  262. package/dist/lib/utils/mockUtil.d.ts +11 -0
  263. package/dist/lib/utils/mockUtil.js +34 -0
  264. package/dist/lib/utils/mockUtilCtx.d.ts +10 -0
  265. package/dist/lib/utils/mockUtilCtx.js +35 -0
  266. package/dist/lib/utils/performAction.d.ts +19 -0
  267. package/dist/lib/utils/performAction.js +137 -0
  268. package/dist/lib/utils/util.d.ts +63 -0
  269. package/dist/lib/utils/util.js +445 -0
  270. package/dist/lib/utils/utilCtx.d.ts +34 -0
  271. package/dist/lib/utils/utilCtx.js +137 -0
  272. package/dist/types/application/app.d.ts +19 -0
  273. package/dist/types/application/app.js +28 -0
  274. package/dist/types/application/index.d.ts +2 -0
  275. package/dist/types/application/index.js +18 -0
  276. package/dist/types/config/appInfo.d.ts +4 -0
  277. package/dist/types/config/appInfo.js +3 -0
  278. package/dist/types/config/config.d.ts +10 -0
  279. package/dist/types/config/config.js +3 -0
  280. package/dist/types/config/development.d.ts +4 -0
  281. package/dist/types/config/development.js +3 -0
  282. package/dist/types/config/index.d.ts +4 -0
  283. package/dist/types/config/index.js +20 -0
  284. package/dist/types/config/locale.d.ts +10 -0
  285. package/dist/types/config/locale.js +7 -0
  286. package/dist/types/context/contextBase.d.ts +21 -0
  287. package/dist/types/context/contextBase.js +3 -0
  288. package/dist/types/context/contextConfig.d.ts +4 -0
  289. package/dist/types/context/contextConfig.js +3 -0
  290. package/dist/types/context/contextError.d.ts +25 -0
  291. package/dist/types/context/contextError.js +3 -0
  292. package/dist/types/context/contextLocale.d.ts +9 -0
  293. package/dist/types/context/contextLocale.js +3 -0
  294. package/dist/types/context/contextOthers.d.ts +4 -0
  295. package/dist/types/context/contextOthers.js +3 -0
  296. package/dist/types/context/contextState.d.ts +8 -0
  297. package/dist/types/context/contextState.js +3 -0
  298. package/dist/types/context/index.d.ts +18 -0
  299. package/dist/types/context/index.js +18 -0
  300. package/dist/types/enum/appEvent.d.ts +5 -0
  301. package/dist/types/enum/appEvent.js +9 -0
  302. package/dist/types/enum/index.d.ts +2 -0
  303. package/dist/types/enum/index.js +18 -0
  304. package/dist/types/index.d.ts +7 -0
  305. package/dist/types/index.js +23 -0
  306. package/dist/types/interface/broadcast.d.ts +5 -0
  307. package/dist/types/interface/broadcast.js +3 -0
  308. package/dist/types/interface/error.d.ts +8 -0
  309. package/dist/types/interface/error.js +3 -0
  310. package/dist/types/interface/index.d.ts +6 -0
  311. package/dist/types/interface/index.js +22 -0
  312. package/dist/types/interface/module.d.ts +32 -0
  313. package/dist/types/interface/module.js +18 -0
  314. package/dist/types/interface/monkey.d.ts +25 -0
  315. package/dist/types/interface/monkey.js +3 -0
  316. package/dist/types/interface/queue.d.ts +29 -0
  317. package/dist/types/interface/queue.js +3 -0
  318. package/dist/types/interface/schedule.d.ts +11 -0
  319. package/dist/types/interface/schedule.js +3 -0
  320. package/dist/types/utils/cast.d.ts +6 -0
  321. package/dist/types/utils/cast.js +8 -0
  322. package/dist/types/utils/index.d.ts +3 -0
  323. package/dist/types/utils/index.js +19 -0
  324. package/dist/types/utils/powerPartial.d.ts +4 -0
  325. package/dist/types/utils/powerPartial.js +3 -0
  326. package/package.json +61 -14
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const model_js_1 = require("../base/model.js");
4
+ const beanModuleScopeBase_js_1 = require("../bean/beanModuleScopeBase.js");
5
+ function default_1() {
6
+ const __classes = {};
7
+ const classes = new Proxy(__classes, {
8
+ get(target, prop) {
9
+ return target[prop];
10
+ },
11
+ set(target, prop, value) {
12
+ // only once
13
+ if (!target[prop]) {
14
+ target[prop] = value;
15
+ }
16
+ return true;
17
+ },
18
+ });
19
+ // model
20
+ classes.Model = model_js_1.Model;
21
+ // BeanModuleScopeBase
22
+ classes.BeanModuleScopeBase = beanModuleScopeBase_js_1.BeanModuleScopeBase;
23
+ return classes;
24
+ }
25
+ exports.default = default_1;
26
+ //# sourceMappingURL=metaClass.js.map
@@ -0,0 +1,3 @@
1
+ import { CabloyApplication } from '../../types/index.js';
2
+ export default function (app: CabloyApplication): void;
3
+ //# sourceMappingURL=moduleInfo.d.ts.map
@@ -0,0 +1,67 @@
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ var __importDefault = (this && this.__importDefault) || function (mod) {
26
+ return (mod && mod.__esModule) ? mod : { "default": mod };
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ const module_1 = __importDefault(require("module"));
30
+ const ModuleInfo = __importStar(require("@cabloy/module-info"));
31
+ const meta_js_1 = __importDefault(require("./meta.js"));
32
+ let __patched = false;
33
+ function default_1(app) {
34
+ // only once
35
+ if (__patched)
36
+ return;
37
+ __patched = true;
38
+ // meta
39
+ const meta = (0, meta_js_1.default)(app);
40
+ // compile
41
+ const Module2 = module_1.default;
42
+ const originalCompile = Module2.prototype._compile;
43
+ Module2.prototype._compile = function (...args) {
44
+ const _module = this;
45
+ let _moduleInfo;
46
+ // meta
47
+ Object.defineProperty(_module, 'meta', {
48
+ enumerable: false,
49
+ get() {
50
+ return meta;
51
+ },
52
+ });
53
+ // info
54
+ Object.defineProperty(_module, 'info', {
55
+ enumerable: false,
56
+ get() {
57
+ if (!_moduleInfo) {
58
+ _moduleInfo = ModuleInfo.parseInfoFromPackage(_module.path);
59
+ }
60
+ return _moduleInfo;
61
+ },
62
+ });
63
+ return originalCompile.apply(_module, args);
64
+ };
65
+ }
66
+ exports.default = default_1;
67
+ //# sourceMappingURL=moduleInfo.js.map
@@ -0,0 +1,4 @@
1
+ export default function (): {
2
+ mixinClasses(classMain: any, classesMore: any, ...args: any[]): any;
3
+ };
4
+ //# sourceMappingURL=util.d.ts.map
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const mixin_classes_1 = __importDefault(require("mixin-classes"));
7
+ function default_1() {
8
+ return {
9
+ mixinClasses(classMain, classesMore, ...args) {
10
+ return (0, mixin_classes_1.default)(classMain, classesMore, ...args);
11
+ },
12
+ };
13
+ }
14
+ exports.default = default_1;
15
+ //# sourceMappingURL=util.js.map
@@ -0,0 +1,68 @@
1
+ declare const _default: {
2
+ 0: string;
3
+ 1: string;
4
+ 100: string;
5
+ 101: string;
6
+ 102: string;
7
+ 200: string;
8
+ 201: string;
9
+ 202: string;
10
+ 203: string;
11
+ 204: string;
12
+ 205: string;
13
+ 206: string;
14
+ 207: string;
15
+ 208: string;
16
+ 226: string;
17
+ 300: string;
18
+ 301: string;
19
+ 302: string;
20
+ 303: string;
21
+ 304: string;
22
+ 305: string;
23
+ 307: string;
24
+ 308: string;
25
+ 400: string;
26
+ 401: string;
27
+ 402: string;
28
+ 403: string;
29
+ 404: string;
30
+ 405: string;
31
+ 406: string;
32
+ 407: string;
33
+ 408: string;
34
+ 409: string;
35
+ 410: string;
36
+ 411: string;
37
+ 412: string;
38
+ 413: string;
39
+ 414: string;
40
+ 415: string;
41
+ 416: string;
42
+ 417: string;
43
+ 418: string;
44
+ 421: string;
45
+ 422: string;
46
+ 423: string;
47
+ 424: string;
48
+ 425: string;
49
+ 426: string;
50
+ 428: string;
51
+ 429: string;
52
+ 431: string;
53
+ 451: string;
54
+ 500: string;
55
+ 501: string;
56
+ 502: string;
57
+ 503: string;
58
+ 504: string;
59
+ 505: string;
60
+ 506: string;
61
+ 507: string;
62
+ 508: string;
63
+ 509: string;
64
+ 510: string;
65
+ 511: string;
66
+ };
67
+ export default _default;
68
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1,69 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = {
4
+ 0: 'Success',
5
+ 1: 'Unknown Error',
6
+ 100: 'Continue',
7
+ 101: 'Switching Protocols',
8
+ 102: 'Processing',
9
+ 200: 'OK',
10
+ 201: 'Created',
11
+ 202: 'Accepted',
12
+ 203: 'Non-Authoritative Information',
13
+ 204: 'No Content',
14
+ 205: 'Reset Content',
15
+ 206: 'Partial Content',
16
+ 207: 'Multi-Status',
17
+ 208: 'Already Reported',
18
+ 226: 'IM Used',
19
+ 300: 'Multiple Choices',
20
+ 301: 'Moved Permanently',
21
+ 302: 'Found',
22
+ 303: 'See Other',
23
+ 304: 'Not Modified',
24
+ 305: 'Use Proxy',
25
+ 307: 'Temporary Redirect',
26
+ 308: 'Permanent Redirect',
27
+ 400: 'Bad Request',
28
+ 401: 'Unauthorized',
29
+ 402: 'Payment Required',
30
+ 403: 'Forbidden',
31
+ 404: 'Not Found',
32
+ 405: 'Method Not Allowed',
33
+ 406: 'Not Acceptable',
34
+ 407: 'Proxy Authentication Required',
35
+ 408: 'Request Timeout',
36
+ 409: 'Conflict',
37
+ 410: 'Gone',
38
+ 411: 'Length Required',
39
+ 412: 'Precondition Failed',
40
+ 413: 'Payload Too Large',
41
+ 414: 'URI Too Long',
42
+ 415: 'Unsupported Media Type',
43
+ 416: 'Range Not Satisfiable',
44
+ 417: 'Expectation Failed',
45
+ 418: "I'm a teapot",
46
+ 421: 'Misdirected Request',
47
+ 422: 'Unprocessable Entity',
48
+ 423: 'Locked',
49
+ 424: 'Failed Dependency',
50
+ 425: 'Unordered Collection',
51
+ 426: 'Upgrade Required',
52
+ 428: 'Precondition Required',
53
+ 429: 'Too Many Requests',
54
+ 431: 'Request Header Fields Too Large',
55
+ 451: 'Unavailable For Legal Reasons',
56
+ 500: 'Internal Server Error',
57
+ 501: 'Not Implemented',
58
+ 502: 'Bad Gateway',
59
+ 503: 'Service Unavailable',
60
+ 504: 'Gateway Timeout',
61
+ 505: 'HTTP Version Not Supported',
62
+ 506: 'Variant Also Negotiates',
63
+ 507: 'Insufficient Storage',
64
+ 508: 'Loop Detected',
65
+ 509: 'Bandwidth Limit Exceeded',
66
+ 510: 'Not Extended',
67
+ 511: 'Network Authentication Required',
68
+ };
69
+ //# sourceMappingURL=errors.js.map
@@ -0,0 +1,4 @@
1
+ import { VonaApplication } from '../../../types/index.js';
2
+ export declare function loadBeanContainer(app: VonaApplication): void;
3
+ export declare function loadBeans(app: VonaApplication): void;
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.loadBeans = exports.loadBeanContainer = void 0;
4
+ const beanContainer_js_1 = require("../../bean/beanContainer.js");
5
+ function loadBeanContainer(app) {
6
+ app.bean = beanContainer_js_1.BeanContainer.create(app, null);
7
+ }
8
+ exports.loadBeanContainer = loadBeanContainer;
9
+ function loadBeans(app) {
10
+ // patch context
11
+ patchCreateContext();
12
+ function patchCreateContext() {
13
+ const createContext = app.createContext;
14
+ app.createContext = (...args) => {
15
+ const context = createContext.call(app, ...args);
16
+ // not check context.module
17
+ // bean
18
+ context.bean = beanContainer_js_1.BeanContainer.create(app, context);
19
+ return context;
20
+ };
21
+ }
22
+ }
23
+ exports.loadBeans = loadBeans;
24
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,3 @@
1
+ import { VonaApplication } from '../../../types/index.js';
2
+ export default function (app: VonaApplication, modules: any): void;
3
+ //# sourceMappingURL=broadcast.d.ts.map
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const broadcastClient_js_1 = require("./broadcastClient.js");
4
+ function default_1(app, modules) {
5
+ // broadcast
6
+ app.meta.broadcast = app.bean._newBean(broadcastClient_js_1.BroadcastClient);
7
+ // all broadcasts
8
+ const ebBroadcasts = (app.meta.broadcasts = {});
9
+ // load broadcasts
10
+ loadBroadcasts();
11
+ function loadBroadcasts() {
12
+ for (const key in modules) {
13
+ const module = modules[key];
14
+ const config = app.meta.configs[module.info.relativeName];
15
+ if (!config.broadcasts)
16
+ continue;
17
+ for (const broadcastKey in config.broadcasts) {
18
+ const broadcastConfig = config.broadcasts[broadcastKey];
19
+ const fullKey = `${broadcastConfig.module || module.info.relativeName}:${broadcastKey}`;
20
+ if (!ebBroadcasts[fullKey])
21
+ ebBroadcasts[fullKey] = [];
22
+ // bean
23
+ const implementationName = broadcastConfig.bean;
24
+ if (!implementationName) {
25
+ throw new Error(`bean not set for broadcast: ${module.info.relativeName}.${broadcastKey}`);
26
+ }
27
+ let bean;
28
+ if (typeof implementationName === 'string') {
29
+ bean = {
30
+ module: module.info.relativeName,
31
+ name: implementationName,
32
+ };
33
+ }
34
+ else {
35
+ bean = {
36
+ module: implementationName.module || module.info.relativeName,
37
+ name: implementationName.name,
38
+ };
39
+ }
40
+ ebBroadcasts[fullKey].push({
41
+ bean,
42
+ config: broadcastConfig,
43
+ });
44
+ }
45
+ }
46
+ }
47
+ }
48
+ exports.default = default_1;
49
+ //# sourceMappingURL=broadcast.js.map
@@ -0,0 +1,24 @@
1
+ import { BeanSimple } from '../../bean/beanSimple.js';
2
+ export declare class BroadcastClient extends BeanSimple {
3
+ __callerId: string;
4
+ channelName: string | null;
5
+ sub: any;
6
+ pub: any;
7
+ protected __init__(): void;
8
+ emit(info: any): void;
9
+ _performTasks({ __callerId, locale, subdomain, module, broadcastName, data }: {
10
+ __callerId: any;
11
+ locale: any;
12
+ subdomain: any;
13
+ module: any;
14
+ broadcastName: any;
15
+ data: any;
16
+ }): Promise<void>;
17
+ _performTask({ broadcast, context, locale, subdomain }: {
18
+ broadcast: any;
19
+ context: any;
20
+ locale: any;
21
+ subdomain: any;
22
+ }): Promise<any>;
23
+ }
24
+ //# sourceMappingURL=broadcastClient.d.ts.map
@@ -0,0 +1,91 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BroadcastClient = void 0;
4
+ const beanSimple_js_1 = require("../../bean/beanSimple.js");
5
+ class BroadcastClient extends beanSimple_js_1.BeanSimple {
6
+ constructor() {
7
+ super(...arguments);
8
+ Object.defineProperty(this, "__callerId", {
9
+ enumerable: true,
10
+ configurable: true,
11
+ writable: true,
12
+ value: ''
13
+ });
14
+ Object.defineProperty(this, "channelName", {
15
+ enumerable: true,
16
+ configurable: true,
17
+ writable: true,
18
+ value: null
19
+ });
20
+ Object.defineProperty(this, "sub", {
21
+ enumerable: true,
22
+ configurable: true,
23
+ writable: true,
24
+ value: null
25
+ });
26
+ Object.defineProperty(this, "pub", {
27
+ enumerable: true,
28
+ configurable: true,
29
+ writable: true,
30
+ value: null
31
+ });
32
+ }
33
+ __init__() {
34
+ const app = this.app;
35
+ this.__callerId = app.meta.workerId;
36
+ this.channelName = `broadcast_${this.app.name}:`;
37
+ this.pub = app.redis.get('broadcast').duplicate();
38
+ this.sub = app.redis.get('broadcast').duplicate();
39
+ this.sub.subscribe(this.channelName, function () { });
40
+ this.sub.on('message', (_channel, info) => {
41
+ this._performTasks(JSON.parse(info))
42
+ .then(() => {
43
+ // do nothing
44
+ })
45
+ .catch(err => {
46
+ app.logger.error(err);
47
+ });
48
+ });
49
+ }
50
+ // { locale, subdomain, module, broadcastName, data }
51
+ emit(info) {
52
+ info.__callerId = this.__callerId;
53
+ this.pub.publish(this.channelName, JSON.stringify(info));
54
+ }
55
+ async _performTasks({ __callerId, locale, subdomain, module, broadcastName, data }) {
56
+ const app = this.app;
57
+ // context
58
+ const context = { data };
59
+ if (__callerId === this.__callerId) {
60
+ context.sameAsCaller = true;
61
+ }
62
+ // broadcasts
63
+ const broadcastArray = app.meta.broadcasts[`${module}:${broadcastName}`];
64
+ if (!broadcastArray)
65
+ return;
66
+ // loop
67
+ for (const broadcast of broadcastArray) {
68
+ await this._performTask({ broadcast, context, locale, subdomain });
69
+ }
70
+ }
71
+ async _performTask({ broadcast, context, locale, subdomain }) {
72
+ const app = this.app;
73
+ const bean = broadcast.bean;
74
+ // execute as global when broadcast.config.instance === false
75
+ // ignore when instance not started
76
+ const instanceStarted = app.meta.util.instanceStarted(subdomain);
77
+ if (!instanceStarted && broadcast.config.instance !== false)
78
+ return;
79
+ // execute
80
+ return await app.meta.util.executeBean({
81
+ locale,
82
+ subdomain,
83
+ context,
84
+ beanModule: bean.module,
85
+ beanFullName: `${bean.module}.broadcast.${bean.name}`,
86
+ transaction: broadcast.config.transaction,
87
+ });
88
+ }
89
+ }
90
+ exports.BroadcastClient = BroadcastClient;
91
+ //# sourceMappingURL=broadcastClient.js.map
@@ -0,0 +1,3 @@
1
+ import { VonaApplication } from '../../../types/index.js';
2
+ export default function (app: VonaApplication): void;
3
+ //# sourceMappingURL=agent.d.ts.map
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const index_js_1 = require("../../../types/index.js");
4
+ function default_1(app) {
5
+ // ready
6
+ let _ready = false;
7
+ const pids = {};
8
+ // messenger
9
+ app.meta.messenger.addProvider({
10
+ name: 'appReady',
11
+ handler: data => {
12
+ pids[data.pid] = true;
13
+ if (!_ready) {
14
+ _ready = true;
15
+ // for agent: event: appReady
16
+ app.emit(index_js_1.EnumAppEvent.AppReady);
17
+ }
18
+ },
19
+ });
20
+ }
21
+ exports.default = default_1;
22
+ //# sourceMappingURL=agent.js.map
@@ -0,0 +1,3 @@
1
+ import { VonaApplication } from '../../../types/index.js';
2
+ export default function (app: VonaApplication): void;
3
+ //# sourceMappingURL=app.d.ts.map
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const ready_js_1 = require("../version/ready.js");
4
+ function default_1(app) {
5
+ const versionReady = app.bean._newBean(ready_js_1.VersionReady);
6
+ // initialize
7
+ versionReady.initialize();
8
+ // eb_clear
9
+ app.messenger.once('eb_clear', async (data) => {
10
+ await app.meta.queue._clearWorkers();
11
+ process.send({ to: 'master', action: 'eb_clear_done', data: { id: data.id } });
12
+ });
13
+ }
14
+ exports.default = default_1;
15
+ // maybe cause some resources initialized more times
16
+ // async function __versionReady(app) {
17
+ // try {
18
+ // await versionReady(app);
19
+ // } catch (err) {
20
+ // console.error(err);
21
+ // setTimeout(async () => {
22
+ // await __versionReady(app);
23
+ // }, app.config.versionReady.retry.timeout);
24
+ // }
25
+ // }
26
+ //# sourceMappingURL=app.js.map
@@ -0,0 +1,3 @@
1
+ import { VonaApplication, IModule } from '../../types/index.js';
2
+ export default function (app: VonaApplication, modules: Record<string, IModule>): Promise<void>;
3
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1,67 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const extend_1 = require("@cabloy/extend");
4
+ const CTXCONFIG = Symbol.for('Context#__config');
5
+ async function default_1(app, modules) {
6
+ // all configs
7
+ app.meta.configs = {};
8
+ // load configs
9
+ await loadConfigs();
10
+ // patch service
11
+ patchCreateContext();
12
+ function patchCreateContext() {
13
+ const createContext = app.createContext;
14
+ app.createContext = (...args) => {
15
+ const context = createContext.call(app, ...args);
16
+ // maybe /favicon.ico
17
+ if (context.module) {
18
+ Object.defineProperty(context, 'config', {
19
+ enumerable: false,
20
+ get() {
21
+ // check cache
22
+ if (context[CTXCONFIG])
23
+ return context[CTXCONFIG];
24
+ // get
25
+ let useCache;
26
+ let _configs = context.bean.instance.getInstanceConfigs();
27
+ if (!_configs) {
28
+ _configs = app.meta.configs;
29
+ useCache = false;
30
+ }
31
+ else {
32
+ useCache = true;
33
+ }
34
+ const _config = _configs[context.module.info.relativeName];
35
+ _config.module = function (moduleName) {
36
+ return _configs[moduleName];
37
+ };
38
+ if (useCache) {
39
+ context[CTXCONFIG] = _config;
40
+ }
41
+ return _config;
42
+ },
43
+ });
44
+ }
45
+ return context;
46
+ };
47
+ }
48
+ async function loadConfigs() {
49
+ for (const key in modules) {
50
+ const module = modules[key];
51
+ const ebConfig = (app.meta.configs[module.info.relativeName] = {});
52
+ // module config
53
+ if (module.resource.config) {
54
+ const config = await module.resource.config(app);
55
+ // configNew is not used by now
56
+ await app.meta.util.monkeyModule(app.meta.appMonkey, app.meta.modulesMonkey, 'configLoaded', module, config);
57
+ (0, extend_1.extend)(true, ebConfig, config);
58
+ }
59
+ // application config
60
+ if (app.config.modules && app.config.modules[module.info.relativeName]) {
61
+ (0, extend_1.extend)(true, ebConfig, app.config.modules[module.info.relativeName]);
62
+ }
63
+ }
64
+ }
65
+ }
66
+ exports.default = default_1;
67
+ //# sourceMappingURL=config.js.map
@@ -0,0 +1,3 @@
1
+ import { VonaApplication, IModule } from '../../types/index.js';
2
+ export default function (app: VonaApplication, modules: Record<string, IModule>): void;
3
+ //# sourceMappingURL=constant.d.ts.map
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const extend_1 = require("@cabloy/extend");
4
+ function default_1(app, modules) {
5
+ // all constants
6
+ const ebConstants = (app.meta.constants = {});
7
+ // load constants
8
+ loadConstants();
9
+ // patch service
10
+ patchCreateContext();
11
+ function patchCreateContext() {
12
+ const createContext = app.createContext;
13
+ app.createContext = (...args) => {
14
+ const context = createContext.call(app, ...args);
15
+ // maybe /favicon.ico
16
+ if (context.module) {
17
+ // constant
18
+ context.constant = ebConstants[context.module.info.relativeName];
19
+ }
20
+ return context;
21
+ };
22
+ }
23
+ function loadConstants() {
24
+ for (const key in modules) {
25
+ const module = modules[key];
26
+ const ebConstant = (ebConstants[module.info.relativeName] = {});
27
+ // module constants
28
+ if (module.resource.constants)
29
+ (0, extend_1.extend)(true, ebConstant, module.resource.constants);
30
+ // patchConstant
31
+ patchConstant(ebConstant);
32
+ }
33
+ }
34
+ function patchConstant(ebConstant) {
35
+ Object.defineProperty(ebConstant, 'module', {
36
+ enumerable: false,
37
+ get() {
38
+ return function (moduleName) {
39
+ return ebConstants[moduleName];
40
+ };
41
+ },
42
+ });
43
+ }
44
+ }
45
+ exports.default = default_1;
46
+ //# sourceMappingURL=constant.js.map
@@ -0,0 +1,3 @@
1
+ import { VonaApplication } from '../../types/index.js';
2
+ export default function (app: VonaApplication): void;
3
+ //# sourceMappingURL=contextPatch.d.ts.map
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ function default_1(app) {
4
+ // patch context
5
+ patchCreateContext();
6
+ function patchCreateContext() {
7
+ const createContext = app.createContext;
8
+ app.createContext = (...args) => {
9
+ const context = createContext.call(app, ...args);
10
+ app.meta.util.monkeyModule(app.meta.appMonkey, app.meta.modulesArray, 'createContext', undefined, context);
11
+ return context;
12
+ };
13
+ }
14
+ }
15
+ exports.default = default_1;
16
+ //# sourceMappingURL=contextPatch.js.map
@@ -0,0 +1,3 @@
1
+ import { VonaApplication, IModule } from '../../types/index.js';
2
+ export default function (app: VonaApplication, modules: Record<string, IModule>): void;
3
+ //# sourceMappingURL=errors.d.ts.map