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,68 @@
|
|
|
1
|
+
import { AppMockUtil } from '../utils/mockUtil.js';
|
|
2
|
+
import { AppReload } from '../module/reload/reload.js';
|
|
3
|
+
import { AppUtil } from '../utils/util.js';
|
|
4
|
+
import { BeanSimple } from '../bean/beanSimple.js';
|
|
5
|
+
import { AppMessenger } from '../module/messenger.js';
|
|
6
|
+
import { IMonkeyApp, IMonkeySystem } from '../../types/interface/monkey.js';
|
|
7
|
+
import { AppRouter } from '../module/route.js';
|
|
8
|
+
import { AppLimiter, AppRedlock } from '../module/redis.js';
|
|
9
|
+
import { QueueClient } from '../module/queue/queueClient.js';
|
|
10
|
+
import { BroadcastClient } from '../module/broadcast/broadcastClient.js';
|
|
11
|
+
import { VonaContext, IModule, IModuleMeta, ISuite, TypeModuleResourceLocaleModules, TypeModuleResourceLocales } from '../../types/index.js';
|
|
12
|
+
import { AppResource } from './resource.js';
|
|
13
|
+
import { AppMetadata } from './metadata.js';
|
|
14
|
+
import { VonaMetaFlavor, VonaMetaMode } from 'vona-shared';
|
|
15
|
+
export declare class AppMeta extends BeanSimple {
|
|
16
|
+
workerId: string;
|
|
17
|
+
inApp: boolean;
|
|
18
|
+
inAgent: boolean;
|
|
19
|
+
isProd: boolean;
|
|
20
|
+
isTest: boolean;
|
|
21
|
+
isLocal: boolean;
|
|
22
|
+
flavor: VonaMetaFlavor;
|
|
23
|
+
mode: VonaMetaMode;
|
|
24
|
+
util: AppUtil;
|
|
25
|
+
mockUtil: AppMockUtil;
|
|
26
|
+
reload: AppReload;
|
|
27
|
+
messenger: AppMessenger;
|
|
28
|
+
appMonkey?: IMonkeyApp & IMonkeySystem;
|
|
29
|
+
router: AppRouter;
|
|
30
|
+
limiter: AppLimiter;
|
|
31
|
+
redlock: AppRedlock;
|
|
32
|
+
queue: QueueClient;
|
|
33
|
+
broadcast: BroadcastClient;
|
|
34
|
+
resource: AppResource;
|
|
35
|
+
metadata: AppMetadata;
|
|
36
|
+
suites: Record<string, ISuite>;
|
|
37
|
+
modules: Record<string, IModule>;
|
|
38
|
+
modulesArray: IModule[];
|
|
39
|
+
modulesMonkey: Record<string, IModule>;
|
|
40
|
+
configs: Record<string, any>;
|
|
41
|
+
constants: Record<string, any>;
|
|
42
|
+
metas: Record<string, IModuleMeta>;
|
|
43
|
+
locales: TypeModuleResourceLocales;
|
|
44
|
+
localeModules: TypeModuleResourceLocaleModules;
|
|
45
|
+
middlewares: any[];
|
|
46
|
+
middlewaresNormal: Record<string, any>;
|
|
47
|
+
middlewaresGlobal: any[];
|
|
48
|
+
middlewaresSocketIoConnection: any[];
|
|
49
|
+
middlewaresSocketIoPacket: any[];
|
|
50
|
+
queues: Record<string, any>;
|
|
51
|
+
broadcasts: Record<string, any>;
|
|
52
|
+
schedules: Record<string, any>;
|
|
53
|
+
appReady: boolean;
|
|
54
|
+
appReadyInstances: Record<string, any>;
|
|
55
|
+
__versionReady: boolean;
|
|
56
|
+
__versionReadyError: Error;
|
|
57
|
+
_loadQueueWorkers: ({ subdomain }: {
|
|
58
|
+
subdomain: string;
|
|
59
|
+
}) => void;
|
|
60
|
+
_loadSchedules: ({ ctx }: {
|
|
61
|
+
ctx: VonaContext;
|
|
62
|
+
}) => Promise<void>;
|
|
63
|
+
_runSchedule: (context: any) => Promise<any>;
|
|
64
|
+
checkAppReady: () => Promise<boolean>;
|
|
65
|
+
protected __init__(): void;
|
|
66
|
+
prepareEnv(): void;
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=meta.d.ts.map
|
|
@@ -0,0 +1,345 @@
|
|
|
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.AppMeta = void 0;
|
|
27
|
+
const uuid = __importStar(require("uuid"));
|
|
28
|
+
const mockUtil_js_1 = require("../utils/mockUtil.js");
|
|
29
|
+
const reload_js_1 = require("../module/reload/reload.js");
|
|
30
|
+
const util_js_1 = require("../utils/util.js");
|
|
31
|
+
const beanSimple_js_1 = require("../bean/beanSimple.js");
|
|
32
|
+
const resource_js_1 = require("./resource.js");
|
|
33
|
+
const metadata_js_1 = require("./metadata.js");
|
|
34
|
+
class AppMeta extends beanSimple_js_1.BeanSimple {
|
|
35
|
+
constructor() {
|
|
36
|
+
super(...arguments);
|
|
37
|
+
Object.defineProperty(this, "workerId", {
|
|
38
|
+
enumerable: true,
|
|
39
|
+
configurable: true,
|
|
40
|
+
writable: true,
|
|
41
|
+
value: void 0
|
|
42
|
+
});
|
|
43
|
+
Object.defineProperty(this, "inApp", {
|
|
44
|
+
enumerable: true,
|
|
45
|
+
configurable: true,
|
|
46
|
+
writable: true,
|
|
47
|
+
value: void 0
|
|
48
|
+
});
|
|
49
|
+
Object.defineProperty(this, "inAgent", {
|
|
50
|
+
enumerable: true,
|
|
51
|
+
configurable: true,
|
|
52
|
+
writable: true,
|
|
53
|
+
value: void 0
|
|
54
|
+
});
|
|
55
|
+
Object.defineProperty(this, "isProd", {
|
|
56
|
+
enumerable: true,
|
|
57
|
+
configurable: true,
|
|
58
|
+
writable: true,
|
|
59
|
+
value: void 0
|
|
60
|
+
});
|
|
61
|
+
Object.defineProperty(this, "isTest", {
|
|
62
|
+
enumerable: true,
|
|
63
|
+
configurable: true,
|
|
64
|
+
writable: true,
|
|
65
|
+
value: void 0
|
|
66
|
+
});
|
|
67
|
+
Object.defineProperty(this, "isLocal", {
|
|
68
|
+
enumerable: true,
|
|
69
|
+
configurable: true,
|
|
70
|
+
writable: true,
|
|
71
|
+
value: void 0
|
|
72
|
+
});
|
|
73
|
+
Object.defineProperty(this, "flavor", {
|
|
74
|
+
enumerable: true,
|
|
75
|
+
configurable: true,
|
|
76
|
+
writable: true,
|
|
77
|
+
value: void 0
|
|
78
|
+
});
|
|
79
|
+
Object.defineProperty(this, "mode", {
|
|
80
|
+
enumerable: true,
|
|
81
|
+
configurable: true,
|
|
82
|
+
writable: true,
|
|
83
|
+
value: void 0
|
|
84
|
+
});
|
|
85
|
+
Object.defineProperty(this, "util", {
|
|
86
|
+
enumerable: true,
|
|
87
|
+
configurable: true,
|
|
88
|
+
writable: true,
|
|
89
|
+
value: void 0
|
|
90
|
+
});
|
|
91
|
+
Object.defineProperty(this, "mockUtil", {
|
|
92
|
+
enumerable: true,
|
|
93
|
+
configurable: true,
|
|
94
|
+
writable: true,
|
|
95
|
+
value: void 0
|
|
96
|
+
});
|
|
97
|
+
Object.defineProperty(this, "reload", {
|
|
98
|
+
enumerable: true,
|
|
99
|
+
configurable: true,
|
|
100
|
+
writable: true,
|
|
101
|
+
value: void 0
|
|
102
|
+
});
|
|
103
|
+
Object.defineProperty(this, "messenger", {
|
|
104
|
+
enumerable: true,
|
|
105
|
+
configurable: true,
|
|
106
|
+
writable: true,
|
|
107
|
+
value: void 0
|
|
108
|
+
});
|
|
109
|
+
Object.defineProperty(this, "appMonkey", {
|
|
110
|
+
enumerable: true,
|
|
111
|
+
configurable: true,
|
|
112
|
+
writable: true,
|
|
113
|
+
value: void 0
|
|
114
|
+
});
|
|
115
|
+
Object.defineProperty(this, "router", {
|
|
116
|
+
enumerable: true,
|
|
117
|
+
configurable: true,
|
|
118
|
+
writable: true,
|
|
119
|
+
value: void 0
|
|
120
|
+
});
|
|
121
|
+
Object.defineProperty(this, "limiter", {
|
|
122
|
+
enumerable: true,
|
|
123
|
+
configurable: true,
|
|
124
|
+
writable: true,
|
|
125
|
+
value: void 0
|
|
126
|
+
});
|
|
127
|
+
Object.defineProperty(this, "redlock", {
|
|
128
|
+
enumerable: true,
|
|
129
|
+
configurable: true,
|
|
130
|
+
writable: true,
|
|
131
|
+
value: void 0
|
|
132
|
+
});
|
|
133
|
+
Object.defineProperty(this, "queue", {
|
|
134
|
+
enumerable: true,
|
|
135
|
+
configurable: true,
|
|
136
|
+
writable: true,
|
|
137
|
+
value: void 0
|
|
138
|
+
});
|
|
139
|
+
Object.defineProperty(this, "broadcast", {
|
|
140
|
+
enumerable: true,
|
|
141
|
+
configurable: true,
|
|
142
|
+
writable: true,
|
|
143
|
+
value: void 0
|
|
144
|
+
});
|
|
145
|
+
//
|
|
146
|
+
Object.defineProperty(this, "resource", {
|
|
147
|
+
enumerable: true,
|
|
148
|
+
configurable: true,
|
|
149
|
+
writable: true,
|
|
150
|
+
value: void 0
|
|
151
|
+
});
|
|
152
|
+
Object.defineProperty(this, "metadata", {
|
|
153
|
+
enumerable: true,
|
|
154
|
+
configurable: true,
|
|
155
|
+
writable: true,
|
|
156
|
+
value: void 0
|
|
157
|
+
});
|
|
158
|
+
//
|
|
159
|
+
Object.defineProperty(this, "suites", {
|
|
160
|
+
enumerable: true,
|
|
161
|
+
configurable: true,
|
|
162
|
+
writable: true,
|
|
163
|
+
value: void 0
|
|
164
|
+
});
|
|
165
|
+
Object.defineProperty(this, "modules", {
|
|
166
|
+
enumerable: true,
|
|
167
|
+
configurable: true,
|
|
168
|
+
writable: true,
|
|
169
|
+
value: void 0
|
|
170
|
+
});
|
|
171
|
+
Object.defineProperty(this, "modulesArray", {
|
|
172
|
+
enumerable: true,
|
|
173
|
+
configurable: true,
|
|
174
|
+
writable: true,
|
|
175
|
+
value: void 0
|
|
176
|
+
});
|
|
177
|
+
Object.defineProperty(this, "modulesMonkey", {
|
|
178
|
+
enumerable: true,
|
|
179
|
+
configurable: true,
|
|
180
|
+
writable: true,
|
|
181
|
+
value: void 0
|
|
182
|
+
});
|
|
183
|
+
//
|
|
184
|
+
Object.defineProperty(this, "configs", {
|
|
185
|
+
enumerable: true,
|
|
186
|
+
configurable: true,
|
|
187
|
+
writable: true,
|
|
188
|
+
value: void 0
|
|
189
|
+
});
|
|
190
|
+
Object.defineProperty(this, "constants", {
|
|
191
|
+
enumerable: true,
|
|
192
|
+
configurable: true,
|
|
193
|
+
writable: true,
|
|
194
|
+
value: void 0
|
|
195
|
+
});
|
|
196
|
+
Object.defineProperty(this, "metas", {
|
|
197
|
+
enumerable: true,
|
|
198
|
+
configurable: true,
|
|
199
|
+
writable: true,
|
|
200
|
+
value: void 0
|
|
201
|
+
});
|
|
202
|
+
Object.defineProperty(this, "locales", {
|
|
203
|
+
enumerable: true,
|
|
204
|
+
configurable: true,
|
|
205
|
+
writable: true,
|
|
206
|
+
value: void 0
|
|
207
|
+
});
|
|
208
|
+
Object.defineProperty(this, "localeModules", {
|
|
209
|
+
enumerable: true,
|
|
210
|
+
configurable: true,
|
|
211
|
+
writable: true,
|
|
212
|
+
value: void 0
|
|
213
|
+
});
|
|
214
|
+
//
|
|
215
|
+
Object.defineProperty(this, "middlewares", {
|
|
216
|
+
enumerable: true,
|
|
217
|
+
configurable: true,
|
|
218
|
+
writable: true,
|
|
219
|
+
value: void 0
|
|
220
|
+
});
|
|
221
|
+
Object.defineProperty(this, "middlewaresNormal", {
|
|
222
|
+
enumerable: true,
|
|
223
|
+
configurable: true,
|
|
224
|
+
writable: true,
|
|
225
|
+
value: void 0
|
|
226
|
+
});
|
|
227
|
+
Object.defineProperty(this, "middlewaresGlobal", {
|
|
228
|
+
enumerable: true,
|
|
229
|
+
configurable: true,
|
|
230
|
+
writable: true,
|
|
231
|
+
value: void 0
|
|
232
|
+
});
|
|
233
|
+
Object.defineProperty(this, "middlewaresSocketIoConnection", {
|
|
234
|
+
enumerable: true,
|
|
235
|
+
configurable: true,
|
|
236
|
+
writable: true,
|
|
237
|
+
value: void 0
|
|
238
|
+
});
|
|
239
|
+
Object.defineProperty(this, "middlewaresSocketIoPacket", {
|
|
240
|
+
enumerable: true,
|
|
241
|
+
configurable: true,
|
|
242
|
+
writable: true,
|
|
243
|
+
value: void 0
|
|
244
|
+
});
|
|
245
|
+
//
|
|
246
|
+
Object.defineProperty(this, "queues", {
|
|
247
|
+
enumerable: true,
|
|
248
|
+
configurable: true,
|
|
249
|
+
writable: true,
|
|
250
|
+
value: void 0
|
|
251
|
+
});
|
|
252
|
+
Object.defineProperty(this, "broadcasts", {
|
|
253
|
+
enumerable: true,
|
|
254
|
+
configurable: true,
|
|
255
|
+
writable: true,
|
|
256
|
+
value: void 0
|
|
257
|
+
});
|
|
258
|
+
Object.defineProperty(this, "schedules", {
|
|
259
|
+
enumerable: true,
|
|
260
|
+
configurable: true,
|
|
261
|
+
writable: true,
|
|
262
|
+
value: void 0
|
|
263
|
+
});
|
|
264
|
+
//
|
|
265
|
+
Object.defineProperty(this, "appReady", {
|
|
266
|
+
enumerable: true,
|
|
267
|
+
configurable: true,
|
|
268
|
+
writable: true,
|
|
269
|
+
value: void 0
|
|
270
|
+
});
|
|
271
|
+
Object.defineProperty(this, "appReadyInstances", {
|
|
272
|
+
enumerable: true,
|
|
273
|
+
configurable: true,
|
|
274
|
+
writable: true,
|
|
275
|
+
value: void 0
|
|
276
|
+
});
|
|
277
|
+
//
|
|
278
|
+
Object.defineProperty(this, "__versionReady", {
|
|
279
|
+
enumerable: true,
|
|
280
|
+
configurable: true,
|
|
281
|
+
writable: true,
|
|
282
|
+
value: void 0
|
|
283
|
+
});
|
|
284
|
+
Object.defineProperty(this, "__versionReadyError", {
|
|
285
|
+
enumerable: true,
|
|
286
|
+
configurable: true,
|
|
287
|
+
writable: true,
|
|
288
|
+
value: void 0
|
|
289
|
+
});
|
|
290
|
+
//
|
|
291
|
+
Object.defineProperty(this, "_loadQueueWorkers", {
|
|
292
|
+
enumerable: true,
|
|
293
|
+
configurable: true,
|
|
294
|
+
writable: true,
|
|
295
|
+
value: void 0
|
|
296
|
+
});
|
|
297
|
+
Object.defineProperty(this, "_loadSchedules", {
|
|
298
|
+
enumerable: true,
|
|
299
|
+
configurable: true,
|
|
300
|
+
writable: true,
|
|
301
|
+
value: void 0
|
|
302
|
+
});
|
|
303
|
+
Object.defineProperty(this, "_runSchedule", {
|
|
304
|
+
enumerable: true,
|
|
305
|
+
configurable: true,
|
|
306
|
+
writable: true,
|
|
307
|
+
value: void 0
|
|
308
|
+
});
|
|
309
|
+
Object.defineProperty(this, "checkAppReady", {
|
|
310
|
+
enumerable: true,
|
|
311
|
+
configurable: true,
|
|
312
|
+
writable: true,
|
|
313
|
+
value: void 0
|
|
314
|
+
});
|
|
315
|
+
}
|
|
316
|
+
__init__() {
|
|
317
|
+
// workerId
|
|
318
|
+
this.workerId = uuid.v4();
|
|
319
|
+
// app or agent
|
|
320
|
+
this.inApp = this.app.type === 'application';
|
|
321
|
+
this.inAgent = this.app.type === 'agent';
|
|
322
|
+
// env
|
|
323
|
+
this.prepareEnv();
|
|
324
|
+
// util
|
|
325
|
+
this.util = this.app.bean._newBean(util_js_1.AppUtil);
|
|
326
|
+
// mockUtil
|
|
327
|
+
this.mockUtil = this.app.bean._newBean(mockUtil_js_1.AppMockUtil);
|
|
328
|
+
// reload
|
|
329
|
+
this.reload = this.app.bean._newBean(reload_js_1.AppReload);
|
|
330
|
+
// resource
|
|
331
|
+
this.resource = resource_js_1.appResource;
|
|
332
|
+
this.resource.app = this.app;
|
|
333
|
+
// metadata
|
|
334
|
+
this.metadata = metadata_js_1.appMetadata;
|
|
335
|
+
}
|
|
336
|
+
prepareEnv() {
|
|
337
|
+
this.isProd = this.app.config.env === 'prod';
|
|
338
|
+
this.isTest = this.app.config.env === 'unittest' || this.app.config.env === 'test';
|
|
339
|
+
this.isLocal = this.app.config.env === 'local';
|
|
340
|
+
this.flavor = this.app.options.flavor || process.env.META_FLAVOR || 'normal';
|
|
341
|
+
this.mode = this.app.config.env;
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
exports.AppMeta = AppMeta;
|
|
345
|
+
//# sourceMappingURL=meta.js.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { CtxUtil } from '../utils/utilCtx.js';
|
|
2
|
+
import { CtxMockUtil } from '../utils/mockUtilCtx.js';
|
|
3
|
+
import { BeanSimple } from '../bean/beanSimple.js';
|
|
4
|
+
import { CtxLocale } from '../bean/resource/locale/localeCtx.js';
|
|
5
|
+
import { IModuleLocaleText } from '../bean/index.js';
|
|
6
|
+
export declare class CtxMeta extends BeanSimple {
|
|
7
|
+
util: CtxUtil;
|
|
8
|
+
mockUtil: CtxMockUtil;
|
|
9
|
+
locale: CtxLocale;
|
|
10
|
+
text: IModuleLocaleText;
|
|
11
|
+
/** dynamic middleware options */
|
|
12
|
+
middlewares: Record<string, any>;
|
|
13
|
+
protected __init__(): void;
|
|
14
|
+
getMiddlewareOptions(middlewareName: any): any;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=metaCtx.d.ts.map
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CtxMeta = void 0;
|
|
4
|
+
const extend_1 = require("@cabloy/extend");
|
|
5
|
+
const utilCtx_js_1 = require("../utils/utilCtx.js");
|
|
6
|
+
const mockUtilCtx_js_1 = require("../utils/mockUtilCtx.js");
|
|
7
|
+
const beanSimple_js_1 = require("../bean/beanSimple.js");
|
|
8
|
+
const localeCtx_js_1 = require("../bean/resource/locale/localeCtx.js");
|
|
9
|
+
class CtxMeta extends beanSimple_js_1.BeanSimple {
|
|
10
|
+
constructor() {
|
|
11
|
+
super(...arguments);
|
|
12
|
+
Object.defineProperty(this, "util", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
configurable: true,
|
|
15
|
+
writable: true,
|
|
16
|
+
value: void 0
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(this, "mockUtil", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
configurable: true,
|
|
21
|
+
writable: true,
|
|
22
|
+
value: void 0
|
|
23
|
+
});
|
|
24
|
+
Object.defineProperty(this, "locale", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
configurable: true,
|
|
27
|
+
writable: true,
|
|
28
|
+
value: void 0
|
|
29
|
+
});
|
|
30
|
+
Object.defineProperty(this, "text", {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
configurable: true,
|
|
33
|
+
writable: true,
|
|
34
|
+
value: void 0
|
|
35
|
+
});
|
|
36
|
+
/** dynamic middleware options */
|
|
37
|
+
Object.defineProperty(this, "middlewares", {
|
|
38
|
+
enumerable: true,
|
|
39
|
+
configurable: true,
|
|
40
|
+
writable: true,
|
|
41
|
+
value: void 0
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
__init__() {
|
|
45
|
+
// util
|
|
46
|
+
this.util = this.ctx.bean._newBean(utilCtx_js_1.CtxUtil);
|
|
47
|
+
// mockUtil
|
|
48
|
+
this.mockUtil = this.ctx.bean._newBean(mockUtilCtx_js_1.CtxMockUtil);
|
|
49
|
+
// locale
|
|
50
|
+
this.locale = this.ctx.bean._newBean(localeCtx_js_1.CtxLocale);
|
|
51
|
+
// text
|
|
52
|
+
this.text = this.locale.createLocaleText();
|
|
53
|
+
}
|
|
54
|
+
getMiddlewareOptions(middlewareName) {
|
|
55
|
+
const item = this.app.meta.middlewaresNormal[middlewareName];
|
|
56
|
+
// config options
|
|
57
|
+
const config = this.ctx.config.module(item.module);
|
|
58
|
+
const optionsConfig = config.middlewares ? config.middlewares[item.name] : null;
|
|
59
|
+
// route options
|
|
60
|
+
const route = this.ctx.route.route;
|
|
61
|
+
const optionsRoute = route.meta ? route.meta[item.name] : null;
|
|
62
|
+
// dynamic options
|
|
63
|
+
const optionsDynamic = this.middlewares[item.name];
|
|
64
|
+
// final options
|
|
65
|
+
const options = (0, extend_1.extend)(true, {}, optionsConfig, optionsRoute, optionsDynamic);
|
|
66
|
+
// ok
|
|
67
|
+
return options;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
exports.CtxMeta = CtxMeta;
|
|
71
|
+
//# sourceMappingURL=metaCtx.js.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import 'reflect-metadata';
|
|
2
|
+
export type MetadataKey = symbol | string;
|
|
3
|
+
export declare class AppMetadata {
|
|
4
|
+
defineMetadata<V>(metadataKey: MetadataKey, metadataValue: V, target: object): void;
|
|
5
|
+
getOwnMetadata<V>(metadataKey: MetadataKey, target: object): V | undefined;
|
|
6
|
+
getMetadata<V>(metadataKey: MetadataKey, target: object, prop?: MetadataKey): V | undefined;
|
|
7
|
+
getOwnMetadataArray<Entry>(metadataKey: MetadataKey, target: object): Array<Entry>;
|
|
8
|
+
getOwnMetadataMap<K extends PropertyKey, V>(metadataKey: MetadataKey, target: any): Record<K, V>;
|
|
9
|
+
getDesignType(target: object, prop?: MetadataKey): unknown;
|
|
10
|
+
}
|
|
11
|
+
export declare const appMetadata: AppMetadata;
|
|
12
|
+
//# sourceMappingURL=metadata.d.ts.map
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.appMetadata = exports.AppMetadata = void 0;
|
|
4
|
+
require("reflect-metadata");
|
|
5
|
+
class AppMetadata {
|
|
6
|
+
defineMetadata(metadataKey, metadataValue, target) {
|
|
7
|
+
Reflect.defineMetadata(metadataKey, metadataValue, target);
|
|
8
|
+
}
|
|
9
|
+
getOwnMetadata(metadataKey, target) {
|
|
10
|
+
return Reflect.getOwnMetadata(metadataKey, target);
|
|
11
|
+
}
|
|
12
|
+
getMetadata(metadataKey, target, prop) {
|
|
13
|
+
if (prop) {
|
|
14
|
+
return Reflect.getMetadata(metadataKey, target, prop);
|
|
15
|
+
}
|
|
16
|
+
return Reflect.getMetadata(metadataKey, target);
|
|
17
|
+
}
|
|
18
|
+
getOwnMetadataArray(metadataKey, target) {
|
|
19
|
+
let own = this.getOwnMetadata(metadataKey, target);
|
|
20
|
+
if (!own) {
|
|
21
|
+
const parent = this.getMetadata(metadataKey, target);
|
|
22
|
+
if (parent) {
|
|
23
|
+
own = parent.slice();
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
own = [];
|
|
27
|
+
}
|
|
28
|
+
this.defineMetadata(metadataKey, own, target);
|
|
29
|
+
}
|
|
30
|
+
return own;
|
|
31
|
+
}
|
|
32
|
+
getOwnMetadataMap(metadataKey, target) {
|
|
33
|
+
let own = this.getOwnMetadata(metadataKey, target);
|
|
34
|
+
if (!own) {
|
|
35
|
+
const parent = this.getMetadata(metadataKey, target);
|
|
36
|
+
if (parent) {
|
|
37
|
+
own = Object.assign({}, parent);
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
own = {};
|
|
41
|
+
}
|
|
42
|
+
this.defineMetadata(metadataKey, own, target);
|
|
43
|
+
}
|
|
44
|
+
return own;
|
|
45
|
+
}
|
|
46
|
+
getDesignType(target, prop) {
|
|
47
|
+
return this.getMetadata('design:type', target, prop);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
exports.AppMetadata = AppMetadata;
|
|
51
|
+
exports.appMetadata = new AppMetadata();
|
|
52
|
+
//# sourceMappingURL=metadata.js.map
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Constructable, IDecoratorBeanOptionsBase, IDecoratorUseOptionsBase } from '../decorator/index.js';
|
|
2
|
+
import { MetadataKey } from './metadata.js';
|
|
3
|
+
import { IBeanRecord } from '../bean/type.js';
|
|
4
|
+
import { BeanSimple } from '../bean/beanSimple.js';
|
|
5
|
+
export declare const DecoratorBeanFullName: unique symbol;
|
|
6
|
+
export declare const DecoratorUse: unique symbol;
|
|
7
|
+
export declare class AppResource extends BeanSimple {
|
|
8
|
+
beans: Record<string, IDecoratorBeanOptionsBase>;
|
|
9
|
+
aops: Record<string, IDecoratorBeanOptionsBase>;
|
|
10
|
+
aopsArray: IDecoratorBeanOptionsBase[];
|
|
11
|
+
addUse(target: object, options: IDecoratorUseOptionsBase): void;
|
|
12
|
+
getUses(target: object): Record<MetadataKey, IDecoratorUseOptionsBase> | undefined;
|
|
13
|
+
addAop<T>(options: Partial<IDecoratorBeanOptionsBase<T>>): IDecoratorBeanOptionsBase<unknown>;
|
|
14
|
+
findAopsMatched<T>(A: Constructable<T>): string[] | undefined;
|
|
15
|
+
findAopsMatched<K extends keyof IBeanRecord>(beanFullName: K): string[] | undefined;
|
|
16
|
+
findAopsMatched(beanFullName: string): string[] | undefined;
|
|
17
|
+
addBean(options: Partial<IDecoratorBeanOptionsBase>): IDecoratorBeanOptionsBase<unknown>;
|
|
18
|
+
getBeanFullName<T>(A: Constructable<T>): string | undefined;
|
|
19
|
+
getBean<T>(A: Constructable<T>): IDecoratorBeanOptionsBase<T> | undefined;
|
|
20
|
+
getBean<K extends keyof IBeanRecord>(beanFullName: K): IDecoratorBeanOptionsBase<IBeanRecord[K]> | undefined;
|
|
21
|
+
getBean<T>(beanFullName: string): IDecoratorBeanOptionsBase<T> | undefined;
|
|
22
|
+
_parseBeanName<T>(beanClass: Constructable<T>, scene?: string, name?: string): string;
|
|
23
|
+
_parseModuleBelong(module: any, beanClass: any, virtual: any): any;
|
|
24
|
+
_getModuleBelong<T>(A: Constructable<T>): string;
|
|
25
|
+
_getModuleBelong<K extends keyof IBeanRecord>(beanFullName: K): string;
|
|
26
|
+
_getModuleBelong(beanFullName: string): string;
|
|
27
|
+
}
|
|
28
|
+
export declare const appResource: AppResource;
|
|
29
|
+
//# sourceMappingURL=resource.d.ts.map
|