vona 1.0.0 → 5.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +1 -1
- package/README.zh-CN.md +1 -0
- package/dist/app/extend/context.d.ts +4 -0
- package/dist/app/extend/context.js +152 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +35 -0
- package/dist/lib/base/dbTransaction.d.ts +12 -0
- package/dist/lib/base/dbTransaction.js +55 -0
- package/dist/lib/base/error.d.ts +18 -0
- package/dist/lib/base/error.js +70 -0
- package/dist/lib/base/model.d.ts +22 -0
- package/dist/lib/base/model.js +253 -0
- package/dist/lib/bean/_beanLocal_.d.ts +6 -0
- package/dist/lib/bean/_beanLocal_.js +16 -0
- package/dist/lib/bean/beanBase.d.ts +11 -0
- package/dist/lib/bean/beanBase.js +34 -0
- package/dist/lib/bean/beanBaseSimple.d.ts +8 -0
- package/dist/lib/bean/beanBaseSimple.js +31 -0
- package/dist/lib/bean/beanContainer.d.ts +39 -0
- package/dist/lib/bean/beanContainer.js +516 -0
- package/dist/lib/bean/beanLocal.d.ts +6 -0
- package/dist/lib/bean/beanLocal.js +16 -0
- package/dist/lib/bean/beanModuleScopeBase.d.ts +10 -0
- package/dist/lib/bean/beanModuleScopeBase.js +28 -0
- package/dist/lib/bean/beanScopeBase.d.ts +6 -0
- package/dist/lib/bean/beanScopeBase.js +19 -0
- package/dist/lib/bean/beanScopeScene.d.ts +12 -0
- package/dist/lib/bean/beanScopeScene.js +23 -0
- package/dist/lib/bean/beanSimple.d.ts +7 -0
- package/dist/lib/bean/beanSimple.js +24 -0
- package/dist/lib/bean/index.d.ts +8 -0
- package/dist/lib/bean/index.js +24 -0
- package/dist/lib/bean/resource/config/broadcast.d.ts +7 -0
- package/dist/lib/bean/resource/config/broadcast.js +3 -0
- package/dist/lib/bean/resource/config/index.d.ts +2 -0
- package/dist/lib/bean/resource/config/index.js +18 -0
- package/dist/lib/bean/resource/config/middleware.d.ts +9 -0
- package/dist/lib/bean/resource/config/middleware.js +3 -0
- package/dist/lib/bean/resource/config/startup.d.ts +9 -0
- package/dist/lib/bean/resource/config/startup.js +3 -0
- package/dist/lib/bean/resource/config/type.d.ts +43 -0
- package/dist/lib/bean/resource/config/type.js +3 -0
- package/dist/lib/bean/resource/constant/index.d.ts +2 -0
- package/dist/lib/bean/resource/constant/index.js +18 -0
- package/dist/lib/bean/resource/constant/type.d.ts +2 -0
- package/dist/lib/bean/resource/constant/type.js +3 -0
- package/dist/lib/bean/resource/entity/entityBase.d.ts +18 -0
- package/dist/lib/bean/resource/entity/entityBase.js +20 -0
- package/dist/lib/bean/resource/entity/index.d.ts +2 -0
- package/dist/lib/bean/resource/entity/index.js +18 -0
- package/dist/lib/bean/resource/entity/type.d.ts +4 -0
- package/dist/lib/bean/resource/entity/type.js +3 -0
- package/dist/lib/bean/resource/error/beanScopeError.d.ts +11 -0
- package/dist/lib/bean/resource/error/beanScopeError.js +34 -0
- package/dist/lib/bean/resource/error/beanScopeErrorImpl.d.ts +14 -0
- package/dist/lib/bean/resource/error/beanScopeErrorImpl.js +35 -0
- package/dist/lib/bean/resource/error/errorClass.d.ts +18 -0
- package/dist/lib/bean/resource/error/errorClass.js +78 -0
- package/dist/lib/bean/resource/error/errorContext.d.ts +38 -0
- package/dist/lib/bean/resource/error/errorContext.js +3 -0
- package/dist/lib/bean/resource/error/errorGlobal.d.ts +8 -0
- package/dist/lib/bean/resource/error/errorGlobal.js +3 -0
- package/dist/lib/bean/resource/error/errorInternal.d.ts +67 -0
- package/dist/lib/bean/resource/error/errorInternal.js +70 -0
- package/dist/lib/bean/resource/error/errorObject.d.ts +5 -0
- package/dist/lib/bean/resource/error/errorObject.js +3 -0
- package/dist/lib/bean/resource/error/index.d.ts +9 -0
- package/dist/lib/bean/resource/error/index.js +25 -0
- package/dist/lib/bean/resource/error/type.d.ts +9 -0
- package/dist/lib/bean/resource/error/type.js +3 -0
- package/dist/lib/bean/resource/index.d.ts +8 -0
- package/dist/lib/bean/resource/index.js +24 -0
- package/dist/lib/bean/resource/locale/beanScopeLocale.d.ts +11 -0
- package/dist/lib/bean/resource/locale/beanScopeLocale.js +33 -0
- package/dist/lib/bean/resource/locale/beanScopeLocaleImpl.d.ts +3 -0
- package/dist/lib/bean/resource/locale/beanScopeLocaleImpl.js +14 -0
- package/dist/lib/bean/resource/locale/index.d.ts +4 -0
- package/dist/lib/bean/resource/locale/index.js +20 -0
- package/dist/lib/bean/resource/locale/localeCtx.d.ts +8 -0
- package/dist/lib/bean/resource/locale/localeCtx.js +63 -0
- package/dist/lib/bean/resource/locale/type.d.ts +19 -0
- package/dist/lib/bean/resource/locale/type.js +3 -0
- package/dist/lib/bean/resource/model/beanModelBase.d.ts +24 -0
- package/dist/lib/bean/resource/model/beanModelBase.js +165 -0
- package/dist/lib/bean/resource/model/beanModelBaseInner.d.ts +29 -0
- package/dist/lib/bean/resource/model/beanModelBaseInner.js +86 -0
- package/dist/lib/bean/resource/model/index.d.ts +2 -0
- package/dist/lib/bean/resource/model/index.js +18 -0
- package/dist/lib/bean/resource/model/type.d.ts +14 -0
- package/dist/lib/bean/resource/model/type.js +3 -0
- package/dist/lib/bean/resource/route/index.d.ts +2 -0
- package/dist/lib/bean/resource/route/index.js +18 -0
- package/dist/lib/bean/resource/route/type.d.ts +60 -0
- package/dist/lib/bean/resource/route/type.js +3 -0
- package/dist/lib/bean/scope/beanScopeBase.d.ts +19 -0
- package/dist/lib/bean/scope/beanScopeBase.js +104 -0
- package/dist/lib/bean/scope/beanScopeBean.d.ts +10 -0
- package/dist/lib/bean/scope/beanScopeBean.js +34 -0
- package/dist/lib/bean/scope/beanScopeError.d.ts +11 -0
- package/dist/lib/bean/scope/beanScopeError.js +21 -0
- package/dist/lib/bean/scope/beanScopeErrorImpl.d.ts +14 -0
- package/dist/lib/bean/scope/beanScopeErrorImpl.js +21 -0
- package/dist/lib/bean/scope/beanScopeScene.d.ts +12 -0
- package/dist/lib/bean/scope/beanScopeScene.js +42 -0
- package/dist/lib/bean/scope/index.d.ts +5 -0
- package/dist/lib/bean/scope/index.js +21 -0
- package/dist/lib/bean/scope/type.d.ts +21 -0
- package/dist/lib/bean/scope/type.js +3 -0
- package/dist/lib/bean/type.d.ts +17 -0
- package/dist/lib/bean/type.js +4 -0
- package/dist/lib/core/index.d.ts +5 -0
- package/dist/lib/core/index.js +21 -0
- package/dist/lib/core/meta.d.ts +68 -0
- package/dist/lib/core/meta.js +345 -0
- package/dist/lib/core/metaCtx.d.ts +16 -0
- package/dist/lib/core/metaCtx.js +71 -0
- package/dist/lib/core/metadata.d.ts +12 -0
- package/dist/lib/core/metadata.js +52 -0
- package/dist/lib/core/resource.d.ts +29 -0
- package/dist/lib/core/resource.js +173 -0
- package/dist/lib/decorator/class/aop.d.ts +3 -0
- package/dist/lib/decorator/class/aop.js +22 -0
- package/dist/lib/decorator/class/atom.d.ts +2 -0
- package/dist/lib/decorator/class/atom.js +20 -0
- package/dist/lib/decorator/class/bean.d.ts +3 -0
- package/dist/lib/decorator/class/bean.js +23 -0
- package/dist/lib/decorator/class/controller.d.ts +2 -0
- package/dist/lib/decorator/class/controller.js +20 -0
- package/dist/lib/decorator/class/entity.d.ts +4 -0
- package/dist/lib/decorator/class/entity.js +33 -0
- package/dist/lib/decorator/class/index.d.ts +11 -0
- package/dist/lib/decorator/class/index.js +27 -0
- package/dist/lib/decorator/class/local.d.ts +3 -0
- package/dist/lib/decorator/class/local.js +23 -0
- package/dist/lib/decorator/class/model.d.ts +3 -0
- package/dist/lib/decorator/class/model.js +21 -0
- package/dist/lib/decorator/class/scope.d.ts +2 -0
- package/dist/lib/decorator/class/scope.js +20 -0
- package/dist/lib/decorator/class/service.d.ts +2 -0
- package/dist/lib/decorator/class/service.js +20 -0
- package/dist/lib/decorator/class/use.d.ts +5 -0
- package/dist/lib/decorator/class/use.js +43 -0
- package/dist/lib/decorator/class/util.d.ts +3 -0
- package/dist/lib/decorator/class/util.js +10 -0
- package/dist/lib/decorator/class/virtual.d.ts +3 -0
- package/dist/lib/decorator/class/virtual.js +24 -0
- package/dist/lib/decorator/index.d.ts +7 -0
- package/dist/lib/decorator/index.js +23 -0
- package/dist/lib/decorator/interface/beanOptions.d.ts +44 -0
- package/dist/lib/decorator/interface/beanOptions.js +8 -0
- package/dist/lib/decorator/interface/useOptions.d.ts +14 -0
- package/dist/lib/decorator/interface/useOptions.js +3 -0
- package/dist/lib/decorator/type/constructable.d.ts +2 -0
- package/dist/lib/decorator/type/constructable.js +3 -0
- package/dist/lib/decorator/type/containerScope.d.ts +2 -0
- package/dist/lib/decorator/type/containerScope.js +3 -0
- package/dist/lib/decorator/type/injectionScope.d.ts +2 -0
- package/dist/lib/decorator/type/injectionScope.js +3 -0
- package/dist/lib/error/error.d.ts +18 -0
- package/dist/lib/error/error.js +71 -0
- package/dist/lib/error/errorClass.d.ts +18 -0
- package/dist/lib/error/errorClass.js +72 -0
- package/dist/lib/error/errorContext.d.ts +38 -0
- package/dist/lib/error/errorContext.js +3 -0
- package/dist/lib/error/errorGlobal.d.ts +8 -0
- package/dist/lib/error/errorGlobal.js +3 -0
- package/dist/lib/error/errorInternal.d.ts +67 -0
- package/dist/lib/error/errorInternal.js +70 -0
- package/dist/lib/error/errorObject.d.ts +5 -0
- package/dist/lib/error/errorObject.js +3 -0
- package/dist/lib/error/index.d.ts +5 -0
- package/dist/lib/error/index.js +21 -0
- package/dist/lib/framework/bootstrap.d.ts +9 -0
- package/dist/lib/framework/bootstrap.js +35 -0
- package/dist/lib/framework/framework.d.ts +11 -0
- package/dist/lib/framework/framework.js +28 -0
- package/dist/lib/framework/loader.d.ts +24 -0
- package/dist/lib/framework/loader.js +69 -0
- package/dist/lib/framework/meta.d.ts +2 -0
- package/dist/lib/framework/meta.js +23 -0
- package/dist/lib/framework/metaClass.d.ts +2 -0
- package/dist/lib/framework/metaClass.js +26 -0
- package/dist/lib/framework/moduleInfo.d.ts +3 -0
- package/dist/lib/framework/moduleInfo.js +67 -0
- package/dist/lib/framework/util.d.ts +4 -0
- package/dist/lib/framework/util.js +15 -0
- package/dist/lib/module/asset/errors.d.ts +68 -0
- package/dist/lib/module/asset/errors.js +69 -0
- package/dist/lib/module/bean/index.d.ts +4 -0
- package/dist/lib/module/bean/index.js +24 -0
- package/dist/lib/module/broadcast/broadcast.d.ts +3 -0
- package/dist/lib/module/broadcast/broadcast.js +49 -0
- package/dist/lib/module/broadcast/broadcastClient.d.ts +24 -0
- package/dist/lib/module/broadcast/broadcastClient.js +91 -0
- package/dist/lib/module/cluster/agent.d.ts +3 -0
- package/dist/lib/module/cluster/agent.js +22 -0
- package/dist/lib/module/cluster/app.d.ts +3 -0
- package/dist/lib/module/cluster/app.js +26 -0
- package/dist/lib/module/config.d.ts +3 -0
- package/dist/lib/module/config.js +67 -0
- package/dist/lib/module/constant.d.ts +3 -0
- package/dist/lib/module/constant.js +46 -0
- package/dist/lib/module/contextPatch.d.ts +3 -0
- package/dist/lib/module/contextPatch.js +16 -0
- package/dist/lib/module/errors.d.ts +3 -0
- package/dist/lib/module/errors.js +49 -0
- package/dist/lib/module/index.d.ts +2 -0
- package/dist/lib/module/index.js +3 -0
- package/dist/lib/module/loader.d.ts +5 -0
- package/dist/lib/module/loader.js +73 -0
- package/dist/lib/module/locales.d.ts +3 -0
- package/dist/lib/module/locales.js +132 -0
- package/dist/lib/module/messenger.d.ts +25 -0
- package/dist/lib/module/messenger.js +128 -0
- package/dist/lib/module/middleware.d.ts +3 -0
- package/dist/lib/module/middleware.js +113 -0
- package/dist/lib/module/model.d.ts +3 -0
- package/dist/lib/module/model.js +47 -0
- package/dist/lib/module/module.d.ts +12 -0
- package/dist/lib/module/module.js +135 -0
- package/dist/lib/module/moduleMeta.d.ts +3 -0
- package/dist/lib/module/moduleMeta.js +23 -0
- package/dist/lib/module/queue/queue.d.ts +3 -0
- package/dist/lib/module/queue/queue.js +59 -0
- package/dist/lib/module/queue/queueClient.d.ts +26 -0
- package/dist/lib/module/queue/queueClient.js +262 -0
- package/dist/lib/module/redis.d.ts +11 -0
- package/dist/lib/module/redis.js +46 -0
- package/dist/lib/module/reload/development.d.ts +3 -0
- package/dist/lib/module/reload/development.js +98 -0
- package/dist/lib/module/reload/reload.d.ts +16 -0
- package/dist/lib/module/reload/reload.js +113 -0
- package/dist/lib/module/reload.d.ts +7 -0
- package/dist/lib/module/reload.js +17 -0
- package/dist/lib/module/route.d.ts +10 -0
- package/dist/lib/module/route.js +239 -0
- package/dist/lib/module/schedule.d.ts +3 -0
- package/dist/lib/module/schedule.js +129 -0
- package/dist/lib/module/service.d.ts +3 -0
- package/dist/lib/module/service.js +35 -0
- package/dist/lib/module/socketio.d.ts +5 -0
- package/dist/lib/module/socketio.js +47 -0
- package/dist/lib/module/startup.d.ts +2 -0
- package/dist/lib/module/startup.js +134 -0
- package/dist/lib/module/version/clear.d.ts +2 -0
- package/dist/lib/module/version/clear.js +42 -0
- package/dist/lib/module/version/ready.d.ts +6 -0
- package/dist/lib/module/version/ready.js +106 -0
- package/dist/lib/resource/error/errorClass.d.ts +18 -0
- package/dist/lib/resource/error/errorClass.js +72 -0
- package/dist/lib/resource/error/errorContext.d.ts +38 -0
- package/dist/lib/resource/error/errorContext.js +3 -0
- package/dist/lib/resource/error/errorGlobal.d.ts +8 -0
- package/dist/lib/resource/error/errorGlobal.js +3 -0
- package/dist/lib/resource/error/errorInternal.d.ts +67 -0
- package/dist/lib/resource/error/errorInternal.js +70 -0
- package/dist/lib/resource/error/errorObject.d.ts +5 -0
- package/dist/lib/resource/error/errorObject.js +3 -0
- package/dist/lib/resource/error/index.d.ts +5 -0
- package/dist/lib/resource/error/index.js +21 -0
- package/dist/lib/utils/index.d.ts +2 -0
- package/dist/lib/utils/index.js +18 -0
- package/dist/lib/utils/isClass.d.ts +2 -0
- package/dist/lib/utils/isClass.js +20 -0
- package/dist/lib/utils/mockUtil.d.ts +11 -0
- package/dist/lib/utils/mockUtil.js +34 -0
- package/dist/lib/utils/mockUtilCtx.d.ts +10 -0
- package/dist/lib/utils/mockUtilCtx.js +35 -0
- package/dist/lib/utils/performAction.d.ts +19 -0
- package/dist/lib/utils/performAction.js +137 -0
- package/dist/lib/utils/util.d.ts +63 -0
- package/dist/lib/utils/util.js +445 -0
- package/dist/lib/utils/utilCtx.d.ts +34 -0
- package/dist/lib/utils/utilCtx.js +137 -0
- package/dist/types/application/app.d.ts +21 -0
- package/dist/types/application/app.js +28 -0
- package/dist/types/application/index.d.ts +2 -0
- package/dist/types/application/index.js +18 -0
- package/dist/types/config/appInfo.d.ts +4 -0
- package/dist/types/config/appInfo.js +3 -0
- package/dist/types/config/config.d.ts +10 -0
- package/dist/types/config/config.js +3 -0
- package/dist/types/config/development.d.ts +4 -0
- package/dist/types/config/development.js +3 -0
- package/dist/types/config/index.d.ts +4 -0
- package/dist/types/config/index.js +20 -0
- package/dist/types/config/locale.d.ts +10 -0
- package/dist/types/config/locale.js +7 -0
- package/dist/types/context/contextBase.d.ts +21 -0
- package/dist/types/context/contextBase.js +3 -0
- package/dist/types/context/contextConfig.d.ts +4 -0
- package/dist/types/context/contextConfig.js +3 -0
- package/dist/types/context/contextError.d.ts +25 -0
- package/dist/types/context/contextError.js +3 -0
- package/dist/types/context/contextLocale.d.ts +9 -0
- package/dist/types/context/contextLocale.js +3 -0
- package/dist/types/context/contextOthers.d.ts +4 -0
- package/dist/types/context/contextOthers.js +3 -0
- package/dist/types/context/contextState.d.ts +8 -0
- package/dist/types/context/contextState.js +3 -0
- package/dist/types/context/index.d.ts +18 -0
- package/dist/types/context/index.js +18 -0
- package/dist/types/enum/appEvent.d.ts +5 -0
- package/dist/types/enum/appEvent.js +9 -0
- package/dist/types/enum/index.d.ts +2 -0
- package/dist/types/enum/index.js +18 -0
- package/dist/types/index.d.ts +7 -0
- package/dist/types/index.js +23 -0
- package/dist/types/interface/broadcast.d.ts +5 -0
- package/dist/types/interface/broadcast.js +3 -0
- package/dist/types/interface/error.d.ts +8 -0
- package/dist/types/interface/error.js +3 -0
- package/dist/types/interface/index.d.ts +6 -0
- package/dist/types/interface/index.js +22 -0
- package/dist/types/interface/module.d.ts +32 -0
- package/dist/types/interface/module.js +18 -0
- package/dist/types/interface/monkey.d.ts +22 -0
- package/dist/types/interface/monkey.js +3 -0
- package/dist/types/interface/queue.d.ts +29 -0
- package/dist/types/interface/queue.js +3 -0
- package/dist/types/interface/schedule.d.ts +11 -0
- package/dist/types/interface/schedule.js +3 -0
- package/dist/types/utils/cast.d.ts +6 -0
- package/dist/types/utils/cast.js +8 -0
- package/dist/types/utils/index.d.ts +4 -0
- package/dist/types/utils/index.js +20 -0
- package/dist/types/utils/powerPartial.d.ts +4 -0
- package/dist/types/utils/powerPartial.js +3 -0
- package/dist/types/utils/type.d.ts +4 -0
- package/dist/types/utils/type.js +3 -0
- package/package.json +62 -14
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
export declare const errorsInternal: {
|
|
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
|
+
//# sourceMappingURL=errorInternal.d.ts.map
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.errorsInternal = void 0;
|
|
4
|
+
exports.errorsInternal = {
|
|
5
|
+
0: 'Success',
|
|
6
|
+
1: 'Unknown Error',
|
|
7
|
+
100: 'Continue',
|
|
8
|
+
101: 'Switching Protocols',
|
|
9
|
+
102: 'Processing',
|
|
10
|
+
200: 'OK',
|
|
11
|
+
201: 'Created',
|
|
12
|
+
202: 'Accepted',
|
|
13
|
+
203: 'Non-Authoritative Information',
|
|
14
|
+
204: 'No Content',
|
|
15
|
+
205: 'Reset Content',
|
|
16
|
+
206: 'Partial Content',
|
|
17
|
+
207: 'Multi-Status',
|
|
18
|
+
208: 'Already Reported',
|
|
19
|
+
226: 'IM Used',
|
|
20
|
+
300: 'Multiple Choices',
|
|
21
|
+
301: 'Moved Permanently',
|
|
22
|
+
302: 'Found',
|
|
23
|
+
303: 'See Other',
|
|
24
|
+
304: 'Not Modified',
|
|
25
|
+
305: 'Use Proxy',
|
|
26
|
+
307: 'Temporary Redirect',
|
|
27
|
+
308: 'Permanent Redirect',
|
|
28
|
+
400: 'Bad Request',
|
|
29
|
+
401: 'Unauthorized',
|
|
30
|
+
402: 'Payment Required',
|
|
31
|
+
403: 'Forbidden',
|
|
32
|
+
404: 'Not Found',
|
|
33
|
+
405: 'Method Not Allowed',
|
|
34
|
+
406: 'Not Acceptable',
|
|
35
|
+
407: 'Proxy Authentication Required',
|
|
36
|
+
408: 'Request Timeout',
|
|
37
|
+
409: 'Conflict',
|
|
38
|
+
410: 'Gone',
|
|
39
|
+
411: 'Length Required',
|
|
40
|
+
412: 'Precondition Failed',
|
|
41
|
+
413: 'Payload Too Large',
|
|
42
|
+
414: 'URI Too Long',
|
|
43
|
+
415: 'Unsupported Media Type',
|
|
44
|
+
416: 'Range Not Satisfiable',
|
|
45
|
+
417: 'Expectation Failed',
|
|
46
|
+
418: "I'm a teapot",
|
|
47
|
+
421: 'Misdirected Request',
|
|
48
|
+
422: 'Unprocessable Entity',
|
|
49
|
+
423: 'Locked',
|
|
50
|
+
424: 'Failed Dependency',
|
|
51
|
+
425: 'Unordered Collection',
|
|
52
|
+
426: 'Upgrade Required',
|
|
53
|
+
428: 'Precondition Required',
|
|
54
|
+
429: 'Too Many Requests',
|
|
55
|
+
431: 'Request Header Fields Too Large',
|
|
56
|
+
451: 'Unavailable For Legal Reasons',
|
|
57
|
+
500: 'Internal Server Error',
|
|
58
|
+
501: 'Not Implemented',
|
|
59
|
+
502: 'Bad Gateway',
|
|
60
|
+
503: 'Service Unavailable',
|
|
61
|
+
504: 'Gateway Timeout',
|
|
62
|
+
505: 'HTTP Version Not Supported',
|
|
63
|
+
506: 'Variant Also Negotiates',
|
|
64
|
+
507: 'Insufficient Storage',
|
|
65
|
+
508: 'Loop Detected',
|
|
66
|
+
509: 'Bandwidth Limit Exceeded',
|
|
67
|
+
510: 'Not Extended',
|
|
68
|
+
511: 'Network Authentication Required',
|
|
69
|
+
};
|
|
70
|
+
//# sourceMappingURL=errorInternal.js.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from './beanScopeError.js';
|
|
2
|
+
export * from './beanScopeErrorImpl.js';
|
|
3
|
+
export * from './errorClass.js';
|
|
4
|
+
export * from './errorContext.js';
|
|
5
|
+
export * from './errorGlobal.js';
|
|
6
|
+
export * from './errorInternal.js';
|
|
7
|
+
export * from './errorObject.js';
|
|
8
|
+
export * from './type.js';
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,25 @@
|
|
|
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("./beanScopeError.js"), exports);
|
|
18
|
+
__exportStar(require("./beanScopeErrorImpl.js"), exports);
|
|
19
|
+
__exportStar(require("./errorClass.js"), exports);
|
|
20
|
+
__exportStar(require("./errorContext.js"), exports);
|
|
21
|
+
__exportStar(require("./errorGlobal.js"), exports);
|
|
22
|
+
__exportStar(require("./errorInternal.js"), exports);
|
|
23
|
+
__exportStar(require("./errorObject.js"), exports);
|
|
24
|
+
__exportStar(require("./type.js"), exports);
|
|
25
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IErrorObject } from './errorObject.js';
|
|
2
|
+
export interface IModuleError {
|
|
3
|
+
throw(...args: any[]): never;
|
|
4
|
+
parseFail(...args: any[]): IErrorObject;
|
|
5
|
+
}
|
|
6
|
+
export type TypeModuleErrors<T> = {
|
|
7
|
+
[prop in string & keyof T]: IModuleError;
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=type.d.ts.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from './config/index.js';
|
|
2
|
+
export * from './constant/index.js';
|
|
3
|
+
export * from './entity/index.js';
|
|
4
|
+
export * from './error/index.js';
|
|
5
|
+
export * from './locale/index.js';
|
|
6
|
+
export * from './model/index.js';
|
|
7
|
+
export * from './route/index.js';
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,24 @@
|
|
|
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("./config/index.js"), exports);
|
|
18
|
+
__exportStar(require("./constant/index.js"), exports);
|
|
19
|
+
__exportStar(require("./entity/index.js"), exports);
|
|
20
|
+
__exportStar(require("./error/index.js"), exports);
|
|
21
|
+
__exportStar(require("./locale/index.js"), exports);
|
|
22
|
+
__exportStar(require("./model/index.js"), exports);
|
|
23
|
+
__exportStar(require("./route/index.js"), exports);
|
|
24
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { IModuleLocale } from './type.js';
|
|
2
|
+
import { BeanSimple } from '../../beanSimple.js';
|
|
3
|
+
declare const BeanModuleScope: unique symbol;
|
|
4
|
+
export declare class BeanScopeLocale extends BeanSimple {
|
|
5
|
+
private [BeanModuleScope];
|
|
6
|
+
private __instances;
|
|
7
|
+
constructor(moduleScope: any);
|
|
8
|
+
protected __get__(prop: string): IModuleLocale;
|
|
9
|
+
}
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=beanScopeLocale.d.ts.map
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var _a;
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.BeanScopeLocale = void 0;
|
|
5
|
+
const beanSimple_js_1 = require("../../beanSimple.js");
|
|
6
|
+
const BeanModuleScope = Symbol('BeanScopeLocale#ModuleScope');
|
|
7
|
+
class BeanScopeLocale extends beanSimple_js_1.BeanSimple {
|
|
8
|
+
constructor(moduleScope) {
|
|
9
|
+
super();
|
|
10
|
+
Object.defineProperty(this, _a, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
configurable: true,
|
|
13
|
+
writable: true,
|
|
14
|
+
value: void 0
|
|
15
|
+
});
|
|
16
|
+
Object.defineProperty(this, "__instances", {
|
|
17
|
+
enumerable: true,
|
|
18
|
+
configurable: true,
|
|
19
|
+
writable: true,
|
|
20
|
+
value: {}
|
|
21
|
+
});
|
|
22
|
+
this[BeanModuleScope] = moduleScope;
|
|
23
|
+
}
|
|
24
|
+
__get__(prop) {
|
|
25
|
+
if (!this.__instances[prop]) {
|
|
26
|
+
this.__instances[prop] = this.ctx.meta.locale.createScopeLocaleText(this[BeanModuleScope], prop);
|
|
27
|
+
}
|
|
28
|
+
return this.__instances[prop];
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
exports.BeanScopeLocale = BeanScopeLocale;
|
|
32
|
+
_a = BeanModuleScope;
|
|
33
|
+
//# sourceMappingURL=beanScopeLocale.js.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BeanScopeLocaleImpl = void 0;
|
|
4
|
+
function BeanScopeLocaleImpl(ctx, moduleScope, text) {
|
|
5
|
+
const getText = function (...args) {
|
|
6
|
+
return ctx.textModule(moduleScope, text, ...args);
|
|
7
|
+
};
|
|
8
|
+
getText.locale = function (locale, ...args) {
|
|
9
|
+
return ctx.textModule.locale(moduleScope, locale, text, ...args);
|
|
10
|
+
};
|
|
11
|
+
return getText;
|
|
12
|
+
}
|
|
13
|
+
exports.BeanScopeLocaleImpl = BeanScopeLocaleImpl;
|
|
14
|
+
//# sourceMappingURL=beanScopeLocaleImpl.js.map
|
|
@@ -0,0 +1,20 @@
|
|
|
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("./beanScopeLocale.js"), exports);
|
|
18
|
+
__exportStar(require("./localeCtx.js"), exports);
|
|
19
|
+
__exportStar(require("./type.js"), exports);
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { BeanSimple } from '../../beanSimple.js';
|
|
2
|
+
import { ILocalInfos } from './type.js';
|
|
3
|
+
export declare class CtxLocale extends BeanSimple {
|
|
4
|
+
get locale(): string;
|
|
5
|
+
set locale(value: string);
|
|
6
|
+
getText<T extends keyof ILocalInfos>(moduleScope: string | undefined, locale: T | undefined, key: string, ...args: any[]): string;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=localeCtx.d.ts.map
|
|
@@ -0,0 +1,63 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.CtxLocale = void 0;
|
|
27
|
+
const localeutil = __importStar(require("@cabloy/localeutil"));
|
|
28
|
+
const beanSimple_js_1 = require("../../beanSimple.js");
|
|
29
|
+
class CtxLocale extends beanSimple_js_1.BeanSimple {
|
|
30
|
+
get locale() {
|
|
31
|
+
return this.ctx.locale || this.app.config.i18n.defaultLocale;
|
|
32
|
+
}
|
|
33
|
+
set locale(value) {
|
|
34
|
+
this.ctx.locale = value;
|
|
35
|
+
}
|
|
36
|
+
/** @internal */
|
|
37
|
+
createLocaleText(moduleScope) {
|
|
38
|
+
const self = this;
|
|
39
|
+
const getText = function (text, ...args) {
|
|
40
|
+
return self.getText(moduleScope, undefined, text, ...args);
|
|
41
|
+
};
|
|
42
|
+
getText.locale = function (locale, text, ...args) {
|
|
43
|
+
return self.getText(moduleScope, locale, text, ...args);
|
|
44
|
+
};
|
|
45
|
+
return getText;
|
|
46
|
+
}
|
|
47
|
+
/** @internal */
|
|
48
|
+
createScopeLocaleText(moduleScope, text) {
|
|
49
|
+
const self = this;
|
|
50
|
+
const getText = function (...args) {
|
|
51
|
+
return self.getText(moduleScope, undefined, text, ...args);
|
|
52
|
+
};
|
|
53
|
+
getText.locale = function (locale, ...args) {
|
|
54
|
+
return self.getText(moduleScope, locale, text, ...args);
|
|
55
|
+
};
|
|
56
|
+
return getText;
|
|
57
|
+
}
|
|
58
|
+
getText(moduleScope, locale, key, ...args) {
|
|
59
|
+
return localeutil.getLocaleText(moduleScope ? this.app.meta.localeModules[moduleScope] : undefined, this.app.meta.locales, locale || this.locale, key, ...args);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
exports.CtxLocale = CtxLocale;
|
|
63
|
+
//# sourceMappingURL=localeCtx.js.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface IModuleLocale {
|
|
2
|
+
(...args: any[]): string;
|
|
3
|
+
locale: <T extends keyof ILocalInfos>(locale: T, ...args: any[]) => string;
|
|
4
|
+
}
|
|
5
|
+
export interface IModuleLocaleText {
|
|
6
|
+
(text: string, ...args: any[]): string;
|
|
7
|
+
locale: <T extends keyof ILocalInfos>(locale: T, text: string, ...args: any[]) => string;
|
|
8
|
+
}
|
|
9
|
+
export type TypeModuleLocales<T> = {
|
|
10
|
+
[prop in string & keyof T]: IModuleLocale;
|
|
11
|
+
};
|
|
12
|
+
export type TypeLocaleBase = 'en-us';
|
|
13
|
+
export interface ILocalInfo {
|
|
14
|
+
}
|
|
15
|
+
export interface ILocalInfos {
|
|
16
|
+
'en-us': ILocalInfo;
|
|
17
|
+
'zh-cn': ILocalInfo;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=type.d.ts.map
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { BeanModelBaseInner } from './beanModelBaseInner.js';
|
|
2
|
+
export declare class BeanModelBase extends BeanModelBaseInner {
|
|
3
|
+
get __cacheName(): {
|
|
4
|
+
module: string;
|
|
5
|
+
name: string;
|
|
6
|
+
};
|
|
7
|
+
get __cacheKeyAux(): string | undefined;
|
|
8
|
+
get __cacheNotKey(): boolean;
|
|
9
|
+
mget(ids: any): Promise<any>;
|
|
10
|
+
get(where: any, ...args: any[]): Promise<any>;
|
|
11
|
+
update(where: any, ...args: any[]): Promise<void>;
|
|
12
|
+
delete(where: any, ...args: any[]): Promise<void>;
|
|
13
|
+
__mget_select(keys: any): Promise<any[]>;
|
|
14
|
+
__get_notkey(where: any, ...args: any[]): any;
|
|
15
|
+
__get_key(where: any, ...args: any[]): Promise<any>;
|
|
16
|
+
__checkCacheKeyValid(where: any): boolean;
|
|
17
|
+
__checkCacheNotKeyDataValid(where: any, data: any): boolean;
|
|
18
|
+
__deleteCache_key(where: any): Promise<void>;
|
|
19
|
+
__deleteCache_notkey(where: any): Promise<void>;
|
|
20
|
+
__getCacheInstance(): any;
|
|
21
|
+
clearCache(): Promise<void>;
|
|
22
|
+
__cacheExists(): boolean;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=beanModelBase.d.ts.map
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BeanModelBase = void 0;
|
|
4
|
+
const beanModelBaseInner_js_1 = require("./beanModelBaseInner.js");
|
|
5
|
+
class BeanModelBase extends beanModelBaseInner_js_1.BeanModelBaseInner {
|
|
6
|
+
get __cacheName() {
|
|
7
|
+
const cache = this.options.cache || { module: '', name: '' };
|
|
8
|
+
const moduleName = cache.module || this.moduleBelong;
|
|
9
|
+
const cacheName = cache.name || this.__beanOptions?.name;
|
|
10
|
+
return { module: moduleName, name: `model:${cacheName}` };
|
|
11
|
+
}
|
|
12
|
+
get __cacheKeyAux() {
|
|
13
|
+
return this.options.cacheKeyAux;
|
|
14
|
+
}
|
|
15
|
+
get __cacheNotKey() {
|
|
16
|
+
return this.options.cacheNotKey !== false;
|
|
17
|
+
}
|
|
18
|
+
async mget(ids) {
|
|
19
|
+
if (!this.__cacheExists()) {
|
|
20
|
+
return await this.__mget_select(ids);
|
|
21
|
+
}
|
|
22
|
+
// cache
|
|
23
|
+
const cache = this.__getCacheInstance();
|
|
24
|
+
return await cache.mget(ids, {
|
|
25
|
+
fn_mget: async (keys) => {
|
|
26
|
+
return await this.__mget_select(keys);
|
|
27
|
+
},
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
async get(where, ...args) {
|
|
31
|
+
if (!this.__cacheExists()) {
|
|
32
|
+
return await super.get(where, ...args);
|
|
33
|
+
}
|
|
34
|
+
if (where.id && typeof where.id === 'object') {
|
|
35
|
+
// for example: id: { op: '<', val: flowNodeId },
|
|
36
|
+
return await super.get(where, ...args);
|
|
37
|
+
}
|
|
38
|
+
if (!this.__checkCacheKeyValid(where)) {
|
|
39
|
+
if (this.__cacheNotKey) {
|
|
40
|
+
return await this.__get_notkey(where, ...args);
|
|
41
|
+
}
|
|
42
|
+
return await super.get(where, ...args);
|
|
43
|
+
}
|
|
44
|
+
return await this.__get_key(where, ...args);
|
|
45
|
+
}
|
|
46
|
+
async update(where, ...args) {
|
|
47
|
+
if (!this.__cacheExists()) {
|
|
48
|
+
return await super.update(where, ...args);
|
|
49
|
+
}
|
|
50
|
+
const res = await super.update(where, ...args);
|
|
51
|
+
await this.__deleteCache_key(where);
|
|
52
|
+
return res;
|
|
53
|
+
}
|
|
54
|
+
async delete(where, ...args) {
|
|
55
|
+
if (!this.__cacheExists()) {
|
|
56
|
+
return await super.delete(where, ...args);
|
|
57
|
+
}
|
|
58
|
+
const res = await super.delete(where, ...args);
|
|
59
|
+
await this.__deleteCache_key(where);
|
|
60
|
+
return res;
|
|
61
|
+
}
|
|
62
|
+
async __mget_select(keys) {
|
|
63
|
+
const items = await this.select({
|
|
64
|
+
where: {
|
|
65
|
+
id: keys,
|
|
66
|
+
},
|
|
67
|
+
});
|
|
68
|
+
items.sort((a, b) => {
|
|
69
|
+
const indexA = keys.indexOf(a.id);
|
|
70
|
+
const indexB = keys.indexOf(b.id);
|
|
71
|
+
return indexA - indexB;
|
|
72
|
+
});
|
|
73
|
+
return items;
|
|
74
|
+
}
|
|
75
|
+
async __get_notkey(where, ...args) {
|
|
76
|
+
// cache
|
|
77
|
+
const cache = this.__getCacheInstance();
|
|
78
|
+
const data = await cache.get(where, {
|
|
79
|
+
fn_get: async () => {
|
|
80
|
+
return await super.get(where, { columns: ['id'] });
|
|
81
|
+
},
|
|
82
|
+
ignoreNull: true,
|
|
83
|
+
});
|
|
84
|
+
if (!data)
|
|
85
|
+
return data;
|
|
86
|
+
// check if exists and valid
|
|
87
|
+
const data2 = await this.__get_key({ id: data.id }, ...args);
|
|
88
|
+
if (data2 && this.__checkCacheNotKeyDataValid(where, data2)) {
|
|
89
|
+
return data2;
|
|
90
|
+
}
|
|
91
|
+
// delete cache
|
|
92
|
+
await this.__deleteCache_notkey(where);
|
|
93
|
+
// get again
|
|
94
|
+
return await this.__get_notkey(where, ...args);
|
|
95
|
+
}
|
|
96
|
+
async __get_key(where, ...args) {
|
|
97
|
+
// cache
|
|
98
|
+
const cache = this.__getCacheInstance();
|
|
99
|
+
return await cache.get(where.id, {
|
|
100
|
+
fn_get: async () => {
|
|
101
|
+
// where: maybe contain aux key
|
|
102
|
+
return await super.get(where, ...args);
|
|
103
|
+
},
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
__checkCacheKeyValid(where) {
|
|
107
|
+
let keys = Object.keys(where);
|
|
108
|
+
if (this.__cacheKeyAux) {
|
|
109
|
+
keys = keys.filter(item => item !== this.__cacheKeyAux);
|
|
110
|
+
}
|
|
111
|
+
return keys.length === 1 && keys[0] === 'id';
|
|
112
|
+
}
|
|
113
|
+
__checkCacheNotKeyDataValid(where, data) {
|
|
114
|
+
for (const key in where) {
|
|
115
|
+
const a = where[key];
|
|
116
|
+
const b = data[key];
|
|
117
|
+
if (typeof a === 'string' || typeof b === 'string') {
|
|
118
|
+
if (String(a).toLowerCase() !== String(b).toLowerCase())
|
|
119
|
+
return false;
|
|
120
|
+
}
|
|
121
|
+
else if (typeof a === 'boolean' || typeof b === 'boolean') {
|
|
122
|
+
if (Boolean(a) !== Boolean(b))
|
|
123
|
+
return false;
|
|
124
|
+
}
|
|
125
|
+
else if (a === null || a === undefined || b === null || b === undefined) {
|
|
126
|
+
if ((a || null) !== (b || null))
|
|
127
|
+
return false;
|
|
128
|
+
}
|
|
129
|
+
else {
|
|
130
|
+
if (a !== b)
|
|
131
|
+
return false;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
return true;
|
|
135
|
+
}
|
|
136
|
+
async __deleteCache_key(where) {
|
|
137
|
+
if (!where.id)
|
|
138
|
+
return;
|
|
139
|
+
const cache = this.__getCacheInstance();
|
|
140
|
+
await cache.del(where.id);
|
|
141
|
+
}
|
|
142
|
+
async __deleteCache_notkey(where) {
|
|
143
|
+
const cache = this.__getCacheInstance();
|
|
144
|
+
await cache.del(where);
|
|
145
|
+
}
|
|
146
|
+
__getCacheInstance() {
|
|
147
|
+
return this.ctx.bean.summer.getCache(this.__cacheName);
|
|
148
|
+
}
|
|
149
|
+
async clearCache() {
|
|
150
|
+
if (!this.__cacheExists())
|
|
151
|
+
return;
|
|
152
|
+
await this.ctx.bean.summer.clear(this.__cacheName);
|
|
153
|
+
}
|
|
154
|
+
__cacheExists() {
|
|
155
|
+
if (!this.__cacheName)
|
|
156
|
+
return false;
|
|
157
|
+
const cachaBase = this.ctx.bean.summer._findCacheBase({
|
|
158
|
+
module: this.__cacheName.module,
|
|
159
|
+
name: this.__cacheName.name,
|
|
160
|
+
});
|
|
161
|
+
return !!cachaBase && cachaBase.enable !== false;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
exports.BeanModelBase = BeanModelBase;
|
|
165
|
+
//# sourceMappingURL=beanModelBase.js.map
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { BeanBase } from '../../beanBase.js';
|
|
2
|
+
import { IModelOptions } from './type.js';
|
|
3
|
+
import { IDecoratorModelOptions } from '../../../decorator/index.js';
|
|
4
|
+
export declare class BeanModelBaseInner extends BeanBase {
|
|
5
|
+
protected get __beanOptions(): import("../../../decorator/index.js").IDecoratorBeanOptionsBase<unknown> | undefined;
|
|
6
|
+
protected get __modelOptions(): IDecoratorModelOptions;
|
|
7
|
+
get table(): string;
|
|
8
|
+
get options(): IModelOptions;
|
|
9
|
+
get disableDeleted(): any;
|
|
10
|
+
get disableInstance(): any;
|
|
11
|
+
columns(_tableName?: string): Promise<any>;
|
|
12
|
+
columnsClear(_tableName: any): void;
|
|
13
|
+
columnsClearAll(): void;
|
|
14
|
+
prepareData(_item: any): Promise<void>;
|
|
15
|
+
default<T = any>(_data?: T): Promise<T>;
|
|
16
|
+
create(_data: any, ..._args: any[]): Promise<number>;
|
|
17
|
+
write(_data: any, ..._args: any[]): Promise<void>;
|
|
18
|
+
query(..._args: any[]): Promise<void>;
|
|
19
|
+
queryOne(..._args: any[]): Promise<any>;
|
|
20
|
+
select(..._args: any[]): Promise<any[]>;
|
|
21
|
+
count(..._args: any[]): Promise<number>;
|
|
22
|
+
get(..._args: any[]): Promise<void>;
|
|
23
|
+
insert(..._args: any[]): Promise<{
|
|
24
|
+
insertId: number;
|
|
25
|
+
}>;
|
|
26
|
+
update(..._args: any[]): Promise<void>;
|
|
27
|
+
delete(..._args: any[]): Promise<void>;
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=beanModelBaseInner.d.ts.map
|