vona 5.0.7 → 5.0.9

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 (333) hide show
  1. package/LICENSE +2 -15
  2. package/README.en-US.md +63 -0
  3. package/README.md +63 -1
  4. package/package.json +6 -77
  5. package/README.zh-CN.md +0 -1
  6. package/dist/app/extend/context.d.ts +0 -4
  7. package/dist/app/extend/context.js +0 -152
  8. package/dist/index.d.ts +0 -11
  9. package/dist/index.js +0 -35
  10. package/dist/lib/base/dbTransaction.d.ts +0 -12
  11. package/dist/lib/base/dbTransaction.js +0 -55
  12. package/dist/lib/base/error.d.ts +0 -18
  13. package/dist/lib/base/error.js +0 -70
  14. package/dist/lib/base/model.d.ts +0 -22
  15. package/dist/lib/base/model.js +0 -253
  16. package/dist/lib/bean/_beanLocal_.d.ts +0 -6
  17. package/dist/lib/bean/_beanLocal_.js +0 -16
  18. package/dist/lib/bean/beanBase.d.ts +0 -11
  19. package/dist/lib/bean/beanBase.js +0 -34
  20. package/dist/lib/bean/beanBaseSimple.d.ts +0 -8
  21. package/dist/lib/bean/beanBaseSimple.js +0 -31
  22. package/dist/lib/bean/beanContainer.d.ts +0 -39
  23. package/dist/lib/bean/beanContainer.js +0 -516
  24. package/dist/lib/bean/beanLocal.d.ts +0 -6
  25. package/dist/lib/bean/beanLocal.js +0 -16
  26. package/dist/lib/bean/beanModuleScopeBase.d.ts +0 -10
  27. package/dist/lib/bean/beanModuleScopeBase.js +0 -28
  28. package/dist/lib/bean/beanScopeBase.d.ts +0 -6
  29. package/dist/lib/bean/beanScopeBase.js +0 -19
  30. package/dist/lib/bean/beanScopeScene.d.ts +0 -12
  31. package/dist/lib/bean/beanScopeScene.js +0 -23
  32. package/dist/lib/bean/beanSimple.d.ts +0 -7
  33. package/dist/lib/bean/beanSimple.js +0 -24
  34. package/dist/lib/bean/index.d.ts +0 -8
  35. package/dist/lib/bean/index.js +0 -24
  36. package/dist/lib/bean/resource/config/broadcast.d.ts +0 -7
  37. package/dist/lib/bean/resource/config/broadcast.js +0 -3
  38. package/dist/lib/bean/resource/config/index.d.ts +0 -2
  39. package/dist/lib/bean/resource/config/index.js +0 -18
  40. package/dist/lib/bean/resource/config/middleware.d.ts +0 -9
  41. package/dist/lib/bean/resource/config/middleware.js +0 -3
  42. package/dist/lib/bean/resource/config/startup.d.ts +0 -9
  43. package/dist/lib/bean/resource/config/startup.js +0 -3
  44. package/dist/lib/bean/resource/config/type.d.ts +0 -43
  45. package/dist/lib/bean/resource/config/type.js +0 -3
  46. package/dist/lib/bean/resource/constant/index.d.ts +0 -2
  47. package/dist/lib/bean/resource/constant/index.js +0 -18
  48. package/dist/lib/bean/resource/constant/type.d.ts +0 -2
  49. package/dist/lib/bean/resource/constant/type.js +0 -3
  50. package/dist/lib/bean/resource/entity/entityBase.d.ts +0 -18
  51. package/dist/lib/bean/resource/entity/entityBase.js +0 -20
  52. package/dist/lib/bean/resource/entity/index.d.ts +0 -2
  53. package/dist/lib/bean/resource/entity/index.js +0 -18
  54. package/dist/lib/bean/resource/entity/type.d.ts +0 -4
  55. package/dist/lib/bean/resource/entity/type.js +0 -3
  56. package/dist/lib/bean/resource/error/beanScopeError.d.ts +0 -11
  57. package/dist/lib/bean/resource/error/beanScopeError.js +0 -34
  58. package/dist/lib/bean/resource/error/beanScopeErrorImpl.d.ts +0 -14
  59. package/dist/lib/bean/resource/error/beanScopeErrorImpl.js +0 -35
  60. package/dist/lib/bean/resource/error/errorClass.d.ts +0 -18
  61. package/dist/lib/bean/resource/error/errorClass.js +0 -78
  62. package/dist/lib/bean/resource/error/errorContext.d.ts +0 -38
  63. package/dist/lib/bean/resource/error/errorContext.js +0 -3
  64. package/dist/lib/bean/resource/error/errorGlobal.d.ts +0 -8
  65. package/dist/lib/bean/resource/error/errorGlobal.js +0 -3
  66. package/dist/lib/bean/resource/error/errorInternal.d.ts +0 -67
  67. package/dist/lib/bean/resource/error/errorInternal.js +0 -70
  68. package/dist/lib/bean/resource/error/errorObject.d.ts +0 -5
  69. package/dist/lib/bean/resource/error/errorObject.js +0 -3
  70. package/dist/lib/bean/resource/error/index.d.ts +0 -9
  71. package/dist/lib/bean/resource/error/index.js +0 -25
  72. package/dist/lib/bean/resource/error/type.d.ts +0 -9
  73. package/dist/lib/bean/resource/error/type.js +0 -3
  74. package/dist/lib/bean/resource/index.d.ts +0 -8
  75. package/dist/lib/bean/resource/index.js +0 -24
  76. package/dist/lib/bean/resource/locale/beanScopeLocale.d.ts +0 -11
  77. package/dist/lib/bean/resource/locale/beanScopeLocale.js +0 -33
  78. package/dist/lib/bean/resource/locale/beanScopeLocaleImpl.d.ts +0 -3
  79. package/dist/lib/bean/resource/locale/beanScopeLocaleImpl.js +0 -14
  80. package/dist/lib/bean/resource/locale/index.d.ts +0 -4
  81. package/dist/lib/bean/resource/locale/index.js +0 -20
  82. package/dist/lib/bean/resource/locale/localeCtx.d.ts +0 -8
  83. package/dist/lib/bean/resource/locale/localeCtx.js +0 -63
  84. package/dist/lib/bean/resource/locale/type.d.ts +0 -19
  85. package/dist/lib/bean/resource/locale/type.js +0 -3
  86. package/dist/lib/bean/resource/model/beanModelBase.d.ts +0 -24
  87. package/dist/lib/bean/resource/model/beanModelBase.js +0 -165
  88. package/dist/lib/bean/resource/model/beanModelBaseInner.d.ts +0 -29
  89. package/dist/lib/bean/resource/model/beanModelBaseInner.js +0 -86
  90. package/dist/lib/bean/resource/model/index.d.ts +0 -2
  91. package/dist/lib/bean/resource/model/index.js +0 -18
  92. package/dist/lib/bean/resource/model/type.d.ts +0 -14
  93. package/dist/lib/bean/resource/model/type.js +0 -3
  94. package/dist/lib/bean/resource/route/index.d.ts +0 -2
  95. package/dist/lib/bean/resource/route/index.js +0 -18
  96. package/dist/lib/bean/resource/route/type.d.ts +0 -60
  97. package/dist/lib/bean/resource/route/type.js +0 -3
  98. package/dist/lib/bean/scope/beanScopeBase.d.ts +0 -19
  99. package/dist/lib/bean/scope/beanScopeBase.js +0 -104
  100. package/dist/lib/bean/scope/beanScopeBean.d.ts +0 -10
  101. package/dist/lib/bean/scope/beanScopeBean.js +0 -34
  102. package/dist/lib/bean/scope/beanScopeError.d.ts +0 -11
  103. package/dist/lib/bean/scope/beanScopeError.js +0 -21
  104. package/dist/lib/bean/scope/beanScopeErrorImpl.d.ts +0 -14
  105. package/dist/lib/bean/scope/beanScopeErrorImpl.js +0 -21
  106. package/dist/lib/bean/scope/beanScopeScene.d.ts +0 -12
  107. package/dist/lib/bean/scope/beanScopeScene.js +0 -42
  108. package/dist/lib/bean/scope/index.d.ts +0 -5
  109. package/dist/lib/bean/scope/index.js +0 -21
  110. package/dist/lib/bean/scope/type.d.ts +0 -21
  111. package/dist/lib/bean/scope/type.js +0 -3
  112. package/dist/lib/bean/type.d.ts +0 -17
  113. package/dist/lib/bean/type.js +0 -4
  114. package/dist/lib/core/index.d.ts +0 -5
  115. package/dist/lib/core/index.js +0 -21
  116. package/dist/lib/core/meta.d.ts +0 -68
  117. package/dist/lib/core/meta.js +0 -345
  118. package/dist/lib/core/metaCtx.d.ts +0 -16
  119. package/dist/lib/core/metaCtx.js +0 -71
  120. package/dist/lib/core/metadata.d.ts +0 -12
  121. package/dist/lib/core/metadata.js +0 -52
  122. package/dist/lib/core/resource.d.ts +0 -29
  123. package/dist/lib/core/resource.js +0 -173
  124. package/dist/lib/decorator/class/aop.d.ts +0 -3
  125. package/dist/lib/decorator/class/aop.js +0 -22
  126. package/dist/lib/decorator/class/atom.d.ts +0 -2
  127. package/dist/lib/decorator/class/atom.js +0 -20
  128. package/dist/lib/decorator/class/bean.d.ts +0 -3
  129. package/dist/lib/decorator/class/bean.js +0 -23
  130. package/dist/lib/decorator/class/controller.d.ts +0 -2
  131. package/dist/lib/decorator/class/controller.js +0 -20
  132. package/dist/lib/decorator/class/entity.d.ts +0 -4
  133. package/dist/lib/decorator/class/entity.js +0 -33
  134. package/dist/lib/decorator/class/index.d.ts +0 -11
  135. package/dist/lib/decorator/class/index.js +0 -27
  136. package/dist/lib/decorator/class/local.d.ts +0 -3
  137. package/dist/lib/decorator/class/local.js +0 -23
  138. package/dist/lib/decorator/class/model.d.ts +0 -3
  139. package/dist/lib/decorator/class/model.js +0 -21
  140. package/dist/lib/decorator/class/scope.d.ts +0 -2
  141. package/dist/lib/decorator/class/scope.js +0 -20
  142. package/dist/lib/decorator/class/service.d.ts +0 -2
  143. package/dist/lib/decorator/class/service.js +0 -20
  144. package/dist/lib/decorator/class/use.d.ts +0 -5
  145. package/dist/lib/decorator/class/use.js +0 -43
  146. package/dist/lib/decorator/class/util.d.ts +0 -3
  147. package/dist/lib/decorator/class/util.js +0 -10
  148. package/dist/lib/decorator/class/virtual.d.ts +0 -3
  149. package/dist/lib/decorator/class/virtual.js +0 -24
  150. package/dist/lib/decorator/index.d.ts +0 -7
  151. package/dist/lib/decorator/index.js +0 -23
  152. package/dist/lib/decorator/interface/beanOptions.d.ts +0 -44
  153. package/dist/lib/decorator/interface/beanOptions.js +0 -8
  154. package/dist/lib/decorator/interface/useOptions.d.ts +0 -14
  155. package/dist/lib/decorator/interface/useOptions.js +0 -3
  156. package/dist/lib/decorator/type/constructable.d.ts +0 -2
  157. package/dist/lib/decorator/type/constructable.js +0 -3
  158. package/dist/lib/decorator/type/containerScope.d.ts +0 -2
  159. package/dist/lib/decorator/type/containerScope.js +0 -3
  160. package/dist/lib/decorator/type/injectionScope.d.ts +0 -2
  161. package/dist/lib/decorator/type/injectionScope.js +0 -3
  162. package/dist/lib/error/error.d.ts +0 -18
  163. package/dist/lib/error/error.js +0 -71
  164. package/dist/lib/error/errorClass.d.ts +0 -18
  165. package/dist/lib/error/errorClass.js +0 -72
  166. package/dist/lib/error/errorContext.d.ts +0 -38
  167. package/dist/lib/error/errorContext.js +0 -3
  168. package/dist/lib/error/errorGlobal.d.ts +0 -8
  169. package/dist/lib/error/errorGlobal.js +0 -3
  170. package/dist/lib/error/errorInternal.d.ts +0 -67
  171. package/dist/lib/error/errorInternal.js +0 -70
  172. package/dist/lib/error/errorObject.d.ts +0 -5
  173. package/dist/lib/error/errorObject.js +0 -3
  174. package/dist/lib/error/index.d.ts +0 -5
  175. package/dist/lib/error/index.js +0 -21
  176. package/dist/lib/framework/bootstrap.d.ts +0 -9
  177. package/dist/lib/framework/bootstrap.js +0 -35
  178. package/dist/lib/framework/framework.d.ts +0 -11
  179. package/dist/lib/framework/framework.js +0 -28
  180. package/dist/lib/framework/loader.d.ts +0 -24
  181. package/dist/lib/framework/loader.js +0 -69
  182. package/dist/lib/framework/meta.d.ts +0 -2
  183. package/dist/lib/framework/meta.js +0 -23
  184. package/dist/lib/framework/metaClass.d.ts +0 -2
  185. package/dist/lib/framework/metaClass.js +0 -26
  186. package/dist/lib/framework/moduleInfo.d.ts +0 -3
  187. package/dist/lib/framework/moduleInfo.js +0 -67
  188. package/dist/lib/framework/util.d.ts +0 -4
  189. package/dist/lib/framework/util.js +0 -15
  190. package/dist/lib/module/asset/errors.d.ts +0 -68
  191. package/dist/lib/module/asset/errors.js +0 -69
  192. package/dist/lib/module/bean/index.d.ts +0 -4
  193. package/dist/lib/module/bean/index.js +0 -24
  194. package/dist/lib/module/broadcast/broadcast.d.ts +0 -3
  195. package/dist/lib/module/broadcast/broadcast.js +0 -49
  196. package/dist/lib/module/broadcast/broadcastClient.d.ts +0 -24
  197. package/dist/lib/module/broadcast/broadcastClient.js +0 -91
  198. package/dist/lib/module/cluster/agent.d.ts +0 -3
  199. package/dist/lib/module/cluster/agent.js +0 -22
  200. package/dist/lib/module/cluster/app.d.ts +0 -3
  201. package/dist/lib/module/cluster/app.js +0 -26
  202. package/dist/lib/module/config.d.ts +0 -3
  203. package/dist/lib/module/config.js +0 -67
  204. package/dist/lib/module/constant.d.ts +0 -3
  205. package/dist/lib/module/constant.js +0 -46
  206. package/dist/lib/module/contextPatch.d.ts +0 -3
  207. package/dist/lib/module/contextPatch.js +0 -16
  208. package/dist/lib/module/errors.d.ts +0 -3
  209. package/dist/lib/module/errors.js +0 -49
  210. package/dist/lib/module/index.d.ts +0 -2
  211. package/dist/lib/module/index.js +0 -3
  212. package/dist/lib/module/loader.d.ts +0 -5
  213. package/dist/lib/module/loader.js +0 -73
  214. package/dist/lib/module/locales.d.ts +0 -3
  215. package/dist/lib/module/locales.js +0 -132
  216. package/dist/lib/module/messenger.d.ts +0 -25
  217. package/dist/lib/module/messenger.js +0 -128
  218. package/dist/lib/module/middleware.d.ts +0 -3
  219. package/dist/lib/module/middleware.js +0 -113
  220. package/dist/lib/module/model.d.ts +0 -3
  221. package/dist/lib/module/model.js +0 -47
  222. package/dist/lib/module/module.d.ts +0 -12
  223. package/dist/lib/module/module.js +0 -135
  224. package/dist/lib/module/moduleMeta.d.ts +0 -3
  225. package/dist/lib/module/moduleMeta.js +0 -23
  226. package/dist/lib/module/queue/queue.d.ts +0 -3
  227. package/dist/lib/module/queue/queue.js +0 -59
  228. package/dist/lib/module/queue/queueClient.d.ts +0 -26
  229. package/dist/lib/module/queue/queueClient.js +0 -262
  230. package/dist/lib/module/redis.d.ts +0 -11
  231. package/dist/lib/module/redis.js +0 -46
  232. package/dist/lib/module/reload/development.d.ts +0 -3
  233. package/dist/lib/module/reload/development.js +0 -98
  234. package/dist/lib/module/reload/reload.d.ts +0 -16
  235. package/dist/lib/module/reload/reload.js +0 -113
  236. package/dist/lib/module/reload.d.ts +0 -7
  237. package/dist/lib/module/reload.js +0 -17
  238. package/dist/lib/module/route.d.ts +0 -10
  239. package/dist/lib/module/route.js +0 -239
  240. package/dist/lib/module/schedule.d.ts +0 -3
  241. package/dist/lib/module/schedule.js +0 -129
  242. package/dist/lib/module/service.d.ts +0 -3
  243. package/dist/lib/module/service.js +0 -35
  244. package/dist/lib/module/socketio.d.ts +0 -5
  245. package/dist/lib/module/socketio.js +0 -47
  246. package/dist/lib/module/startup.d.ts +0 -2
  247. package/dist/lib/module/startup.js +0 -134
  248. package/dist/lib/module/version/clear.d.ts +0 -2
  249. package/dist/lib/module/version/clear.js +0 -42
  250. package/dist/lib/module/version/ready.d.ts +0 -6
  251. package/dist/lib/module/version/ready.js +0 -106
  252. package/dist/lib/resource/error/errorClass.d.ts +0 -18
  253. package/dist/lib/resource/error/errorClass.js +0 -72
  254. package/dist/lib/resource/error/errorContext.d.ts +0 -38
  255. package/dist/lib/resource/error/errorContext.js +0 -3
  256. package/dist/lib/resource/error/errorGlobal.d.ts +0 -8
  257. package/dist/lib/resource/error/errorGlobal.js +0 -3
  258. package/dist/lib/resource/error/errorInternal.d.ts +0 -67
  259. package/dist/lib/resource/error/errorInternal.js +0 -70
  260. package/dist/lib/resource/error/errorObject.d.ts +0 -5
  261. package/dist/lib/resource/error/errorObject.js +0 -3
  262. package/dist/lib/resource/error/index.d.ts +0 -5
  263. package/dist/lib/resource/error/index.js +0 -21
  264. package/dist/lib/utils/index.d.ts +0 -2
  265. package/dist/lib/utils/index.js +0 -18
  266. package/dist/lib/utils/isClass.d.ts +0 -2
  267. package/dist/lib/utils/isClass.js +0 -20
  268. package/dist/lib/utils/mockUtil.d.ts +0 -11
  269. package/dist/lib/utils/mockUtil.js +0 -34
  270. package/dist/lib/utils/mockUtilCtx.d.ts +0 -10
  271. package/dist/lib/utils/mockUtilCtx.js +0 -35
  272. package/dist/lib/utils/performAction.d.ts +0 -19
  273. package/dist/lib/utils/performAction.js +0 -137
  274. package/dist/lib/utils/util.d.ts +0 -63
  275. package/dist/lib/utils/util.js +0 -445
  276. package/dist/lib/utils/utilCtx.d.ts +0 -34
  277. package/dist/lib/utils/utilCtx.js +0 -137
  278. package/dist/types/application/app.d.ts +0 -21
  279. package/dist/types/application/app.js +0 -28
  280. package/dist/types/application/index.d.ts +0 -2
  281. package/dist/types/application/index.js +0 -18
  282. package/dist/types/config/appInfo.d.ts +0 -4
  283. package/dist/types/config/appInfo.js +0 -3
  284. package/dist/types/config/config.d.ts +0 -10
  285. package/dist/types/config/config.js +0 -3
  286. package/dist/types/config/development.d.ts +0 -4
  287. package/dist/types/config/development.js +0 -3
  288. package/dist/types/config/index.d.ts +0 -4
  289. package/dist/types/config/index.js +0 -20
  290. package/dist/types/config/locale.d.ts +0 -10
  291. package/dist/types/config/locale.js +0 -7
  292. package/dist/types/context/contextBase.d.ts +0 -21
  293. package/dist/types/context/contextBase.js +0 -3
  294. package/dist/types/context/contextConfig.d.ts +0 -4
  295. package/dist/types/context/contextConfig.js +0 -3
  296. package/dist/types/context/contextError.d.ts +0 -25
  297. package/dist/types/context/contextError.js +0 -3
  298. package/dist/types/context/contextLocale.d.ts +0 -9
  299. package/dist/types/context/contextLocale.js +0 -3
  300. package/dist/types/context/contextOthers.d.ts +0 -4
  301. package/dist/types/context/contextOthers.js +0 -3
  302. package/dist/types/context/contextState.d.ts +0 -8
  303. package/dist/types/context/contextState.js +0 -3
  304. package/dist/types/context/index.d.ts +0 -18
  305. package/dist/types/context/index.js +0 -18
  306. package/dist/types/enum/appEvent.d.ts +0 -5
  307. package/dist/types/enum/appEvent.js +0 -9
  308. package/dist/types/enum/index.d.ts +0 -2
  309. package/dist/types/enum/index.js +0 -18
  310. package/dist/types/index.d.ts +0 -7
  311. package/dist/types/index.js +0 -23
  312. package/dist/types/interface/broadcast.d.ts +0 -5
  313. package/dist/types/interface/broadcast.js +0 -3
  314. package/dist/types/interface/error.d.ts +0 -8
  315. package/dist/types/interface/error.js +0 -3
  316. package/dist/types/interface/index.d.ts +0 -6
  317. package/dist/types/interface/index.js +0 -22
  318. package/dist/types/interface/module.d.ts +0 -32
  319. package/dist/types/interface/module.js +0 -18
  320. package/dist/types/interface/monkey.d.ts +0 -22
  321. package/dist/types/interface/monkey.js +0 -3
  322. package/dist/types/interface/queue.d.ts +0 -29
  323. package/dist/types/interface/queue.js +0 -3
  324. package/dist/types/interface/schedule.d.ts +0 -11
  325. package/dist/types/interface/schedule.js +0 -3
  326. package/dist/types/utils/cast.d.ts +0 -6
  327. package/dist/types/utils/cast.js +0 -8
  328. package/dist/types/utils/index.d.ts +0 -4
  329. package/dist/types/utils/index.js +0 -20
  330. package/dist/types/utils/powerPartial.d.ts +0 -4
  331. package/dist/types/utils/powerPartial.js +0 -3
  332. package/dist/types/utils/type.d.ts +0 -4
  333. package/dist/types/utils/type.js +0 -3
package/LICENSE CHANGED
@@ -2,20 +2,7 @@ MIT License
2
2
 
3
3
  Copyright (c) 2016-present Vona
4
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
5
 
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
6
+ > Vona 5.0 internal alpha version, still under continuous development, not yet open source, please do not spread it
14
7
 
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.
8
+ > Vona 5.0 内测版,仍在持续开发中,尚未开源,请勿扩散
@@ -0,0 +1,63 @@
1
+ English | [简体中文](./README.md)
2
+
3
+ # What is Vona
4
+
5
+ Vona is an intuitive, elegant and powerful Node.js framework for rapidly developing enterprise applications of any size
6
+
7
+ * Issues: https://github.com/vonajs/vona/issues
8
+ * Discussions: https://github.com/vonajs/vona/discussions
9
+ * Twitter: https://x.com/zhennann2024
10
+ * Bilibili: https://space.bilibili.com/454737998
11
+
12
+ ## Quick Start
13
+
14
+ 1. Clone
15
+
16
+ ``` bash
17
+ git clone git@github.com:cabloy/vona-dev.git vona-dev
18
+ ```
19
+
20
+ 2. Install
21
+
22
+ ``` bash
23
+ $ cp package.original.json package.json
24
+ $ npm run init
25
+ ```
26
+
27
+ 3. .env
28
+
29
+ Modify the `.env` file:
30
+
31
+ ``` bash
32
+ # app
33
+ APP_NAME = Vona
34
+
35
+ # database
36
+
37
+ DATABASE_DEFAULT_CLIENT = 'pg' # pg/mysql
38
+
39
+ DATABASE_CLIENT_PG_HOST = 127.0.0.1
40
+ DATABASE_CLIENT_PG_PORT = 5432
41
+ DATABASE_CLIENT_PG_USER = postgres
42
+ DATABASE_CLIENT_PG_PASSWORD =
43
+ DATABASE_CLIENT_PG_DATABASE = postgres
44
+
45
+ DATABASE_CLIENT_MYSQL_HOST = 127.0.0.1
46
+ DATABASE_CLIENT_MYSQL_PORT = 3306
47
+ DATABASE_CLIENT_MYSQL_USER = root
48
+ DATABASE_CLIENT_MYSQL_PASSWORD =
49
+ DATABASE_CLIENT_MYSQL_DATABASE = mysql
50
+
51
+ # redis
52
+
53
+ REDIS_DEFAULT_HOST = 127.0.0.1
54
+ REDIS_DEFAULT_PORT = 6379
55
+ REDIS_DEFAULT_PASSWORD =
56
+ REDIS_DEFAULT_DB = 0
57
+ ```
58
+
59
+ 4. Start
60
+
61
+ ``` bash
62
+ npm run dev
63
+ ```
package/README.md CHANGED
@@ -1 +1,63 @@
1
- # vona
1
+ 简体中文 | [English](./README.en-US.md)
2
+
3
+ # Vona 是什么
4
+
5
+ Vona 是一款直观、优雅、强大的Node.js框架,用于快速开发任何规模的企业级应用
6
+
7
+ * Issues: https://github.com/vonajs/vona/issues
8
+ * Discussions: https://github.com/vonajs/vona/discussions
9
+ * Twitter: https://x.com/zhennann2024
10
+ * Bilibili: https://space.bilibili.com/454737998
11
+
12
+ ## 快速开始
13
+
14
+ 1. Clone
15
+
16
+ ``` bash
17
+ git clone git@github.com:cabloy/vona-dev.git vona-dev
18
+ ```
19
+
20
+ 2. Install
21
+
22
+ ``` bash
23
+ $ cp package.original.json package.json
24
+ $ npm run init
25
+ ```
26
+
27
+ 3. .env
28
+
29
+ Modify the `.env` file:
30
+
31
+ ``` bash
32
+ # app
33
+ APP_NAME = Vona
34
+
35
+ # database
36
+
37
+ DATABASE_DEFAULT_CLIENT = 'pg' # pg/mysql
38
+
39
+ DATABASE_CLIENT_PG_HOST = 127.0.0.1
40
+ DATABASE_CLIENT_PG_PORT = 5432
41
+ DATABASE_CLIENT_PG_USER = postgres
42
+ DATABASE_CLIENT_PG_PASSWORD =
43
+ DATABASE_CLIENT_PG_DATABASE = postgres
44
+
45
+ DATABASE_CLIENT_MYSQL_HOST = 127.0.0.1
46
+ DATABASE_CLIENT_MYSQL_PORT = 3306
47
+ DATABASE_CLIENT_MYSQL_USER = root
48
+ DATABASE_CLIENT_MYSQL_PASSWORD =
49
+ DATABASE_CLIENT_MYSQL_DATABASE = mysql
50
+
51
+ # redis
52
+
53
+ REDIS_DEFAULT_HOST = 127.0.0.1
54
+ REDIS_DEFAULT_PORT = 6379
55
+ REDIS_DEFAULT_PASSWORD =
56
+ REDIS_DEFAULT_DB = 0
57
+ ```
58
+
59
+ 4. Start
60
+
61
+ ``` bash
62
+ npm run dev
63
+ ```
package/package.json CHANGED
@@ -1,86 +1,15 @@
1
1
  {
2
2
  "name": "vona",
3
- "version": "5.0.7",
3
+ "type": "module",
4
+ "version": "5.0.9",
4
5
  "description": "vona",
5
6
  "publishConfig": {
6
7
  "access": "public"
7
8
  },
8
- "exports": {
9
- ".": {
10
- "types": [
11
- "./src/index.ts",
12
- "./dist/index.d.ts"
13
- ],
14
- "import": "./dist/index.js",
15
- "require": "./dist/index.js",
16
- "default": "./src/index.ts"
17
- },
18
- "./package.json": "./package.json"
19
- },
20
- "files": [
21
- "dist/**/*.js",
22
- "dist/**/*.d.ts"
23
- ],
24
- "scripts": {
25
- "lint": "eslint ."
26
- },
9
+ "author": "zhennann",
27
10
  "keywords": [
28
- "egg",
29
- "egg-born",
11
+ "nodejs",
30
12
  "framework",
31
- "cabloy"
32
- ],
33
- "author": "zhennann",
34
- "dependencies": {
35
- "@cabloy/cluster-reload": "^1.0.7",
36
- "@cabloy/compose": "^1.0.9",
37
- "@cabloy/deps": "^1.0.7",
38
- "@cabloy/dotenv": "^1.0.9",
39
- "@cabloy/egg-socket.io": "^6.0.0",
40
- "@cabloy/ensure-array": "^1.0.8",
41
- "@cabloy/extend": "^3.0.12",
42
- "@cabloy/json5": "^1.0.7",
43
- "@cabloy/koa-static-cache": "^5.1.8",
44
- "@cabloy/localeutil": "^1.0.11",
45
- "@cabloy/module-glob": "^5.1.8",
46
- "@cabloy/module-info": "^1.1.8",
47
- "@cabloy/module-info-pro": "^1.0.16",
48
- "@cabloy/set": "^1.0.7",
49
- "@cabloy/word-utils": "^1.0.2",
50
- "@zhennann/egg-passport": "^2.1.5",
51
- "async": "^3.2.0",
52
- "bottleneck": "^2.19.5",
53
- "bullmq": "^2.3.1",
54
- "chalk": "^3.0.0",
55
- "chokidar": "^3.5.2",
56
- "debounce": "^1.2.0",
57
- "debug": "^4.3.4",
58
- "egg": "^3.17.5",
59
- "egg-born-mock": "^6.0.7",
60
- "egg-cluster": "^2.2.1",
61
- "egg-path-matching": "^1.0.1",
62
- "egg-redis": "^2.4.0",
63
- "egg-security": "^3.0.0",
64
- "fs-extra": "^10.1.0",
65
- "inflation": "^2.0.0",
66
- "ioredis": "^5.3.2",
67
- "is-type-of": "^1.2.0",
68
- "jsonwebtoken": "^9.0.2",
69
- "koa-compose": "^4.1.0",
70
- "koa-jwt2": "^1.0.3",
71
- "mixin-classes": "^1.0.2",
72
- "module-alias": "^2.2.2",
73
- "moment": "^2.24.0",
74
- "passport-oauth2": "^1.6.1",
75
- "raw-body": "2.5.1",
76
- "redlock": "^4.1.0",
77
- "reflect-metadata": "^0.2.2",
78
- "regenerator-runtime": "^0.14.1",
79
- "semver": "^7.3.7",
80
- "socket.io": "^2.3.0",
81
- "supertest": "^4.0.2",
82
- "uuid": "^9.0.1",
83
- "vona-shared": "^1.0.7"
84
- },
85
- "gitHead": "2d40c063c115b230fdbc89f5a78b4412ebd0dfc9"
13
+ "vona"
14
+ ]
86
15
  }
package/README.zh-CN.md DELETED
@@ -1 +0,0 @@
1
- # vona
@@ -1,4 +0,0 @@
1
- import { ContextBase } from '../../types/context/contextBase.js';
2
- declare const context: ContextBase;
3
- export default context;
4
- //# sourceMappingURL=context.d.ts.map
@@ -1,152 +0,0 @@
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 raw_body_1 = __importDefault(require("raw-body"));
30
- const inflation_1 = __importDefault(require("inflation"));
31
- const ModuleInfo = __importStar(require("@cabloy/module-info"));
32
- const metaCtx_js_1 = require("../../lib/core/metaCtx.js");
33
- const cast_js_1 = require("../../types/utils/cast.js");
34
- const MODULE = Symbol.for('Context#__module');
35
- const META = Symbol.for('Context#__meta');
36
- const INNERACCESS = Symbol.for('Context#__inneraccess');
37
- const SUBDOMAIN = Symbol.for('Context#__subdomain');
38
- const CTXCALLER = Symbol.for('Context#__ctxcaller');
39
- const TAILCALLBACKS = Symbol.for('Context#__tailcallbacks');
40
- const DBLEVEL = Symbol.for('Context#__dblevel');
41
- const context = {
42
- get module() {
43
- const self = (0, cast_js_1.Cast)(this);
44
- if (this[MODULE] === undefined) {
45
- const url = self.req.url || '';
46
- let info;
47
- if (url.indexOf('/api/static/public/') === 0) {
48
- info = null;
49
- }
50
- else {
51
- info = ModuleInfo.parseInfo(ModuleInfo.parseName(url));
52
- }
53
- if (!info) {
54
- info = ModuleInfo.parseInfo('a-base');
55
- }
56
- if (info) {
57
- const module = self.app.meta.modules[info.relativeName];
58
- // should not throw error, because the url maybe not valid
59
- // if (!module) throw new Error(`module not found: ${info.relativeName}`);
60
- this[MODULE] = module || null;
61
- }
62
- else {
63
- this[MODULE] = null;
64
- }
65
- }
66
- return this[MODULE];
67
- },
68
- get meta() {
69
- const self = (0, cast_js_1.Cast)(this);
70
- if (!this[META]) {
71
- this[META] = self.bean._newBean(metaCtx_js_1.CtxMeta);
72
- }
73
- return this[META];
74
- },
75
- get innerAccess() {
76
- return this[INNERACCESS];
77
- },
78
- set innerAccess(value) {
79
- this[INNERACCESS] = value;
80
- },
81
- get dbLevel() {
82
- return this[DBLEVEL] || 0;
83
- },
84
- set dbLevel(value) {
85
- this[DBLEVEL] = value;
86
- },
87
- get subdomain() {
88
- const self = (0, cast_js_1.Cast)(this);
89
- return typeof this[SUBDOMAIN] === 'undefined' ? self.subdomains.join('.') : this[SUBDOMAIN];
90
- },
91
- set subdomain(value) {
92
- this[SUBDOMAIN] = value;
93
- },
94
- get ctxCaller() {
95
- return this[CTXCALLER];
96
- },
97
- set ctxCaller(value) {
98
- // ctxCaller
99
- this[CTXCALLER] = value;
100
- // innerAccess
101
- this.innerAccess = true;
102
- // transaction
103
- (0, cast_js_1.Cast)(this).dbMeta = value.dbMeta;
104
- // dbLevel
105
- this.dbLevel = value.dbLevel;
106
- },
107
- get cache() {
108
- const self = (0, cast_js_1.Cast)(this);
109
- return self.bean._getBean('cache');
110
- },
111
- tail(cb) {
112
- if (!(0, cast_js_1.Cast)(this).dbMeta.master) {
113
- this.ctxCaller.tail(cb);
114
- }
115
- else {
116
- this.tailCallbacks.push(cb);
117
- }
118
- },
119
- async tailDone() {
120
- while (true) {
121
- const cb = this.tailCallbacks.shift();
122
- if (!cb)
123
- break;
124
- await cb();
125
- // try {
126
- // await cb();
127
- // } catch (err) {
128
- // this.app.logger.error(err);
129
- // }
130
- }
131
- },
132
- get tailCallbacks() {
133
- if (!this[TAILCALLBACKS]) {
134
- this[TAILCALLBACKS] = [];
135
- }
136
- return this[TAILCALLBACKS];
137
- },
138
- successMore(list, index, size) {
139
- const self = (0, cast_js_1.Cast)(this);
140
- self.success({
141
- list,
142
- index: index + list.length,
143
- finished: size === -1 || size === 0 || list.length < size,
144
- });
145
- },
146
- async getPayload(options) {
147
- const self = (0, cast_js_1.Cast)(this);
148
- return await (0, raw_body_1.default)((0, inflation_1.default)(self.req), options);
149
- },
150
- };
151
- exports.default = context;
152
- //# sourceMappingURL=context.js.map
package/dist/index.d.ts DELETED
@@ -1,11 +0,0 @@
1
- import '@cabloy/set';
2
- import '@cabloy/json5';
3
- import 'regenerator-runtime';
4
- export * from './types/index.js';
5
- export * from './lib/bean/index.js';
6
- export * from './lib/core/index.js';
7
- export * from './lib/decorator/index.js';
8
- export * from './lib/module/index.js';
9
- export * from './lib/framework/framework.js';
10
- export * from './lib/utils/index.js';
11
- //# sourceMappingURL=index.d.ts.map
package/dist/index.js DELETED
@@ -1,35 +0,0 @@
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
- var __importDefault = (this && this.__importDefault) || function (mod) {
17
- return (mod && mod.__esModule) ? mod : { "default": mod };
18
- };
19
- Object.defineProperty(exports, "__esModule", { value: true });
20
- require("@cabloy/set");
21
- require("@cabloy/json5");
22
- require("regenerator-runtime");
23
- const module_alias_1 = __importDefault(require("module-alias"));
24
- const cluster_reload_1 = __importDefault(require("@cabloy/cluster-reload"));
25
- const master_js_1 = __importDefault(require("egg-cluster/lib/master.js"));
26
- module_alias_1.default.addAlias('koa-static-cache', '@cabloy/koa-static-cache');
27
- master_js_1.default.prototype.onReload = cluster_reload_1.default;
28
- __exportStar(require("./types/index.js"), exports);
29
- __exportStar(require("./lib/bean/index.js"), exports);
30
- __exportStar(require("./lib/core/index.js"), exports);
31
- __exportStar(require("./lib/decorator/index.js"), exports);
32
- __exportStar(require("./lib/module/index.js"), exports);
33
- __exportStar(require("./lib/framework/framework.js"), exports);
34
- __exportStar(require("./lib/utils/index.js"), exports);
35
- //# sourceMappingURL=index.js.map
@@ -1,12 +0,0 @@
1
- import { CabloyContext } from '../../types/index.js';
2
- export default class DbTransaction {
3
- _ctx: CabloyContext;
4
- _transactionCounter: number;
5
- _connection: any;
6
- constructor(ctx: any);
7
- get inTransaction(): boolean;
8
- get connection(): any;
9
- set connection(value: any);
10
- begin(fn: any): Promise<any>;
11
- }
12
- //# sourceMappingURL=dbTransaction.d.ts.map
@@ -1,55 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- class DbTransaction {
4
- constructor(ctx) {
5
- this._ctx = ctx;
6
- this._transactionCounter = 0;
7
- this._connection = null;
8
- }
9
- get inTransaction() {
10
- return this._transactionCounter > 0;
11
- }
12
- get connection() {
13
- return this._connection;
14
- }
15
- set connection(value) {
16
- this._connection = value;
17
- }
18
- async begin(fn) {
19
- let res;
20
- const db = this._ctx.meta.util.getDbOriginal();
21
- try {
22
- if (++this._transactionCounter === 1) {
23
- this._connection = await db.beginTransaction();
24
- }
25
- }
26
- catch (err) {
27
- this._transactionCounter--;
28
- throw err;
29
- }
30
- try {
31
- res = await fn();
32
- }
33
- catch (err) {
34
- if (--this._transactionCounter === 0) {
35
- await this._connection.rollback();
36
- this._connection = null;
37
- }
38
- throw err;
39
- }
40
- try {
41
- if (--this._transactionCounter === 0) {
42
- await this._connection.commit();
43
- this._connection = null;
44
- }
45
- }
46
- catch (err) {
47
- await this._connection.rollback();
48
- this._connection = null;
49
- throw err;
50
- }
51
- return res;
52
- }
53
- }
54
- exports.default = DbTransaction;
55
- //# sourceMappingURL=dbTransaction.js.map
@@ -1,18 +0,0 @@
1
- import { BeanSimple } from '../bean/beanSimple.js';
2
- export declare class ErrorClass extends BeanSimple {
3
- ebErrors: any;
4
- constructor(ebErrors: any);
5
- success(module: any, data: any, code: any, ...args: any[]): void;
6
- fail(module: any, code: any, ...args: any[]): void;
7
- throw(module: any, code: any, ...args: any[]): void;
8
- parseFail(module: any, code: any, ...args: any[]): any;
9
- parseSuccess(module: any, code: any, ...args: any[]): {
10
- code: any;
11
- message: null;
12
- };
13
- parseCode(module: any, codeDefault: any, code: any, ...args: any[]): {
14
- code: any;
15
- message: null;
16
- };
17
- }
18
- //# sourceMappingURL=error.d.ts.map
@@ -1,70 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ErrorClass = void 0;
4
- const beanSimple_js_1 = require("../bean/beanSimple.js");
5
- class ErrorClass extends beanSimple_js_1.BeanSimple {
6
- constructor(ebErrors) {
7
- super();
8
- this.ebErrors = ebErrors;
9
- }
10
- // data,code/message,args
11
- success(module, data, code, ...args) {
12
- const body = this.parseSuccess(module, code, ...args);
13
- this.ctx.response.status = 200;
14
- this.ctx.response.type = 'application/json';
15
- this.ctx.response.body = { code: 0, message: body.message, data };
16
- }
17
- // code/message,args
18
- fail(module, code, ...args) {
19
- const body = this.parseFail(module, code, ...args);
20
- this.ctx.response.status = 200;
21
- this.ctx.response.type = 'application/json';
22
- this.ctx.response.body = { code: __combineErrorCode(module, body.code), message: body.message }; // body maybe Error
23
- }
24
- // code/message,args
25
- throw(module, code, ...args) {
26
- const body = this.parseFail(module, code, ...args);
27
- const err = new Error();
28
- err.code = __combineErrorCode(module, body.code);
29
- err.message = body.message;
30
- if (body.code < 500)
31
- err.status = body.code;
32
- throw err;
33
- }
34
- // code/message,args
35
- parseFail(module, code, ...args) {
36
- if (typeof code === 'object')
37
- return code;
38
- return this.parseCode(module, 1, code, ...args);
39
- }
40
- // code/message,args
41
- parseSuccess(module, code, ...args) {
42
- return this.parseCode(module, 0, code, ...args);
43
- }
44
- // parseCode
45
- parseCode(module, codeDefault, code, ...args) {
46
- const ebError = this.ebErrors[module];
47
- let message = null;
48
- if (code === undefined || code === null || code === '') {
49
- code = codeDefault;
50
- }
51
- else if (typeof code === 'string') {
52
- message = this.ctx.text(code, ...args);
53
- code = codeDefault;
54
- }
55
- else {
56
- message = this.ctx.text(ebError[code], ...args);
57
- }
58
- if (!message) {
59
- message = this.ctx.text(ebError[codeDefault]);
60
- }
61
- return { code, message };
62
- }
63
- }
64
- exports.ErrorClass = ErrorClass;
65
- function __combineErrorCode(module, code) {
66
- if (code <= 1000)
67
- return code;
68
- return module ? `${module}:${code}` : code;
69
- }
70
- //# sourceMappingURL=error.js.map
@@ -1,22 +0,0 @@
1
- import { BeanSimple } from '../bean/beanSimple.js';
2
- export declare class Model extends BeanSimple {
3
- table: string;
4
- options: any;
5
- constructor({ table, options }: {
6
- table: any;
7
- options?: {} | undefined;
8
- });
9
- get disableDeleted(): any;
10
- get disableInstance(): any;
11
- columns(tableName?: string): Promise<any>;
12
- columnsClear(tableName: any): any;
13
- columnsClearAll(): boolean;
14
- prepareData(item: any): Promise<{}>;
15
- default(data: any): Promise<any>;
16
- _coerceTypeOfDefault(column: any): any;
17
- create(data: any, ...args: any[]): Promise<any>;
18
- write(data: any, ...args: any[]): Promise<any>;
19
- _rowCheck(row: any): void;
20
- _insertRowsCheck(rows: any): void;
21
- }
22
- //# sourceMappingURL=model.d.ts.map