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.
- package/LICENSE +2 -15
- package/README.en-US.md +63 -0
- package/README.md +63 -1
- package/package.json +6 -77
- package/README.zh-CN.md +0 -1
- package/dist/app/extend/context.d.ts +0 -4
- package/dist/app/extend/context.js +0 -152
- package/dist/index.d.ts +0 -11
- package/dist/index.js +0 -35
- package/dist/lib/base/dbTransaction.d.ts +0 -12
- package/dist/lib/base/dbTransaction.js +0 -55
- package/dist/lib/base/error.d.ts +0 -18
- package/dist/lib/base/error.js +0 -70
- package/dist/lib/base/model.d.ts +0 -22
- package/dist/lib/base/model.js +0 -253
- package/dist/lib/bean/_beanLocal_.d.ts +0 -6
- package/dist/lib/bean/_beanLocal_.js +0 -16
- package/dist/lib/bean/beanBase.d.ts +0 -11
- package/dist/lib/bean/beanBase.js +0 -34
- package/dist/lib/bean/beanBaseSimple.d.ts +0 -8
- package/dist/lib/bean/beanBaseSimple.js +0 -31
- package/dist/lib/bean/beanContainer.d.ts +0 -39
- package/dist/lib/bean/beanContainer.js +0 -516
- package/dist/lib/bean/beanLocal.d.ts +0 -6
- package/dist/lib/bean/beanLocal.js +0 -16
- package/dist/lib/bean/beanModuleScopeBase.d.ts +0 -10
- package/dist/lib/bean/beanModuleScopeBase.js +0 -28
- package/dist/lib/bean/beanScopeBase.d.ts +0 -6
- package/dist/lib/bean/beanScopeBase.js +0 -19
- package/dist/lib/bean/beanScopeScene.d.ts +0 -12
- package/dist/lib/bean/beanScopeScene.js +0 -23
- package/dist/lib/bean/beanSimple.d.ts +0 -7
- package/dist/lib/bean/beanSimple.js +0 -24
- package/dist/lib/bean/index.d.ts +0 -8
- package/dist/lib/bean/index.js +0 -24
- package/dist/lib/bean/resource/config/broadcast.d.ts +0 -7
- package/dist/lib/bean/resource/config/broadcast.js +0 -3
- package/dist/lib/bean/resource/config/index.d.ts +0 -2
- package/dist/lib/bean/resource/config/index.js +0 -18
- package/dist/lib/bean/resource/config/middleware.d.ts +0 -9
- package/dist/lib/bean/resource/config/middleware.js +0 -3
- package/dist/lib/bean/resource/config/startup.d.ts +0 -9
- package/dist/lib/bean/resource/config/startup.js +0 -3
- package/dist/lib/bean/resource/config/type.d.ts +0 -43
- package/dist/lib/bean/resource/config/type.js +0 -3
- package/dist/lib/bean/resource/constant/index.d.ts +0 -2
- package/dist/lib/bean/resource/constant/index.js +0 -18
- package/dist/lib/bean/resource/constant/type.d.ts +0 -2
- package/dist/lib/bean/resource/constant/type.js +0 -3
- package/dist/lib/bean/resource/entity/entityBase.d.ts +0 -18
- package/dist/lib/bean/resource/entity/entityBase.js +0 -20
- package/dist/lib/bean/resource/entity/index.d.ts +0 -2
- package/dist/lib/bean/resource/entity/index.js +0 -18
- package/dist/lib/bean/resource/entity/type.d.ts +0 -4
- package/dist/lib/bean/resource/entity/type.js +0 -3
- package/dist/lib/bean/resource/error/beanScopeError.d.ts +0 -11
- package/dist/lib/bean/resource/error/beanScopeError.js +0 -34
- package/dist/lib/bean/resource/error/beanScopeErrorImpl.d.ts +0 -14
- package/dist/lib/bean/resource/error/beanScopeErrorImpl.js +0 -35
- package/dist/lib/bean/resource/error/errorClass.d.ts +0 -18
- package/dist/lib/bean/resource/error/errorClass.js +0 -78
- package/dist/lib/bean/resource/error/errorContext.d.ts +0 -38
- package/dist/lib/bean/resource/error/errorContext.js +0 -3
- package/dist/lib/bean/resource/error/errorGlobal.d.ts +0 -8
- package/dist/lib/bean/resource/error/errorGlobal.js +0 -3
- package/dist/lib/bean/resource/error/errorInternal.d.ts +0 -67
- package/dist/lib/bean/resource/error/errorInternal.js +0 -70
- package/dist/lib/bean/resource/error/errorObject.d.ts +0 -5
- package/dist/lib/bean/resource/error/errorObject.js +0 -3
- package/dist/lib/bean/resource/error/index.d.ts +0 -9
- package/dist/lib/bean/resource/error/index.js +0 -25
- package/dist/lib/bean/resource/error/type.d.ts +0 -9
- package/dist/lib/bean/resource/error/type.js +0 -3
- package/dist/lib/bean/resource/index.d.ts +0 -8
- package/dist/lib/bean/resource/index.js +0 -24
- package/dist/lib/bean/resource/locale/beanScopeLocale.d.ts +0 -11
- package/dist/lib/bean/resource/locale/beanScopeLocale.js +0 -33
- package/dist/lib/bean/resource/locale/beanScopeLocaleImpl.d.ts +0 -3
- package/dist/lib/bean/resource/locale/beanScopeLocaleImpl.js +0 -14
- package/dist/lib/bean/resource/locale/index.d.ts +0 -4
- package/dist/lib/bean/resource/locale/index.js +0 -20
- package/dist/lib/bean/resource/locale/localeCtx.d.ts +0 -8
- package/dist/lib/bean/resource/locale/localeCtx.js +0 -63
- package/dist/lib/bean/resource/locale/type.d.ts +0 -19
- package/dist/lib/bean/resource/locale/type.js +0 -3
- package/dist/lib/bean/resource/model/beanModelBase.d.ts +0 -24
- package/dist/lib/bean/resource/model/beanModelBase.js +0 -165
- package/dist/lib/bean/resource/model/beanModelBaseInner.d.ts +0 -29
- package/dist/lib/bean/resource/model/beanModelBaseInner.js +0 -86
- package/dist/lib/bean/resource/model/index.d.ts +0 -2
- package/dist/lib/bean/resource/model/index.js +0 -18
- package/dist/lib/bean/resource/model/type.d.ts +0 -14
- package/dist/lib/bean/resource/model/type.js +0 -3
- package/dist/lib/bean/resource/route/index.d.ts +0 -2
- package/dist/lib/bean/resource/route/index.js +0 -18
- package/dist/lib/bean/resource/route/type.d.ts +0 -60
- package/dist/lib/bean/resource/route/type.js +0 -3
- package/dist/lib/bean/scope/beanScopeBase.d.ts +0 -19
- package/dist/lib/bean/scope/beanScopeBase.js +0 -104
- package/dist/lib/bean/scope/beanScopeBean.d.ts +0 -10
- package/dist/lib/bean/scope/beanScopeBean.js +0 -34
- package/dist/lib/bean/scope/beanScopeError.d.ts +0 -11
- package/dist/lib/bean/scope/beanScopeError.js +0 -21
- package/dist/lib/bean/scope/beanScopeErrorImpl.d.ts +0 -14
- package/dist/lib/bean/scope/beanScopeErrorImpl.js +0 -21
- package/dist/lib/bean/scope/beanScopeScene.d.ts +0 -12
- package/dist/lib/bean/scope/beanScopeScene.js +0 -42
- package/dist/lib/bean/scope/index.d.ts +0 -5
- package/dist/lib/bean/scope/index.js +0 -21
- package/dist/lib/bean/scope/type.d.ts +0 -21
- package/dist/lib/bean/scope/type.js +0 -3
- package/dist/lib/bean/type.d.ts +0 -17
- package/dist/lib/bean/type.js +0 -4
- package/dist/lib/core/index.d.ts +0 -5
- package/dist/lib/core/index.js +0 -21
- package/dist/lib/core/meta.d.ts +0 -68
- package/dist/lib/core/meta.js +0 -345
- package/dist/lib/core/metaCtx.d.ts +0 -16
- package/dist/lib/core/metaCtx.js +0 -71
- package/dist/lib/core/metadata.d.ts +0 -12
- package/dist/lib/core/metadata.js +0 -52
- package/dist/lib/core/resource.d.ts +0 -29
- package/dist/lib/core/resource.js +0 -173
- package/dist/lib/decorator/class/aop.d.ts +0 -3
- package/dist/lib/decorator/class/aop.js +0 -22
- package/dist/lib/decorator/class/atom.d.ts +0 -2
- package/dist/lib/decorator/class/atom.js +0 -20
- package/dist/lib/decorator/class/bean.d.ts +0 -3
- package/dist/lib/decorator/class/bean.js +0 -23
- package/dist/lib/decorator/class/controller.d.ts +0 -2
- package/dist/lib/decorator/class/controller.js +0 -20
- package/dist/lib/decorator/class/entity.d.ts +0 -4
- package/dist/lib/decorator/class/entity.js +0 -33
- package/dist/lib/decorator/class/index.d.ts +0 -11
- package/dist/lib/decorator/class/index.js +0 -27
- package/dist/lib/decorator/class/local.d.ts +0 -3
- package/dist/lib/decorator/class/local.js +0 -23
- package/dist/lib/decorator/class/model.d.ts +0 -3
- package/dist/lib/decorator/class/model.js +0 -21
- package/dist/lib/decorator/class/scope.d.ts +0 -2
- package/dist/lib/decorator/class/scope.js +0 -20
- package/dist/lib/decorator/class/service.d.ts +0 -2
- package/dist/lib/decorator/class/service.js +0 -20
- package/dist/lib/decorator/class/use.d.ts +0 -5
- package/dist/lib/decorator/class/use.js +0 -43
- package/dist/lib/decorator/class/util.d.ts +0 -3
- package/dist/lib/decorator/class/util.js +0 -10
- package/dist/lib/decorator/class/virtual.d.ts +0 -3
- package/dist/lib/decorator/class/virtual.js +0 -24
- package/dist/lib/decorator/index.d.ts +0 -7
- package/dist/lib/decorator/index.js +0 -23
- package/dist/lib/decorator/interface/beanOptions.d.ts +0 -44
- package/dist/lib/decorator/interface/beanOptions.js +0 -8
- package/dist/lib/decorator/interface/useOptions.d.ts +0 -14
- package/dist/lib/decorator/interface/useOptions.js +0 -3
- package/dist/lib/decorator/type/constructable.d.ts +0 -2
- package/dist/lib/decorator/type/constructable.js +0 -3
- package/dist/lib/decorator/type/containerScope.d.ts +0 -2
- package/dist/lib/decorator/type/containerScope.js +0 -3
- package/dist/lib/decorator/type/injectionScope.d.ts +0 -2
- package/dist/lib/decorator/type/injectionScope.js +0 -3
- package/dist/lib/error/error.d.ts +0 -18
- package/dist/lib/error/error.js +0 -71
- package/dist/lib/error/errorClass.d.ts +0 -18
- package/dist/lib/error/errorClass.js +0 -72
- package/dist/lib/error/errorContext.d.ts +0 -38
- package/dist/lib/error/errorContext.js +0 -3
- package/dist/lib/error/errorGlobal.d.ts +0 -8
- package/dist/lib/error/errorGlobal.js +0 -3
- package/dist/lib/error/errorInternal.d.ts +0 -67
- package/dist/lib/error/errorInternal.js +0 -70
- package/dist/lib/error/errorObject.d.ts +0 -5
- package/dist/lib/error/errorObject.js +0 -3
- package/dist/lib/error/index.d.ts +0 -5
- package/dist/lib/error/index.js +0 -21
- package/dist/lib/framework/bootstrap.d.ts +0 -9
- package/dist/lib/framework/bootstrap.js +0 -35
- package/dist/lib/framework/framework.d.ts +0 -11
- package/dist/lib/framework/framework.js +0 -28
- package/dist/lib/framework/loader.d.ts +0 -24
- package/dist/lib/framework/loader.js +0 -69
- package/dist/lib/framework/meta.d.ts +0 -2
- package/dist/lib/framework/meta.js +0 -23
- package/dist/lib/framework/metaClass.d.ts +0 -2
- package/dist/lib/framework/metaClass.js +0 -26
- package/dist/lib/framework/moduleInfo.d.ts +0 -3
- package/dist/lib/framework/moduleInfo.js +0 -67
- package/dist/lib/framework/util.d.ts +0 -4
- package/dist/lib/framework/util.js +0 -15
- package/dist/lib/module/asset/errors.d.ts +0 -68
- package/dist/lib/module/asset/errors.js +0 -69
- package/dist/lib/module/bean/index.d.ts +0 -4
- package/dist/lib/module/bean/index.js +0 -24
- package/dist/lib/module/broadcast/broadcast.d.ts +0 -3
- package/dist/lib/module/broadcast/broadcast.js +0 -49
- package/dist/lib/module/broadcast/broadcastClient.d.ts +0 -24
- package/dist/lib/module/broadcast/broadcastClient.js +0 -91
- package/dist/lib/module/cluster/agent.d.ts +0 -3
- package/dist/lib/module/cluster/agent.js +0 -22
- package/dist/lib/module/cluster/app.d.ts +0 -3
- package/dist/lib/module/cluster/app.js +0 -26
- package/dist/lib/module/config.d.ts +0 -3
- package/dist/lib/module/config.js +0 -67
- package/dist/lib/module/constant.d.ts +0 -3
- package/dist/lib/module/constant.js +0 -46
- package/dist/lib/module/contextPatch.d.ts +0 -3
- package/dist/lib/module/contextPatch.js +0 -16
- package/dist/lib/module/errors.d.ts +0 -3
- package/dist/lib/module/errors.js +0 -49
- package/dist/lib/module/index.d.ts +0 -2
- package/dist/lib/module/index.js +0 -3
- package/dist/lib/module/loader.d.ts +0 -5
- package/dist/lib/module/loader.js +0 -73
- package/dist/lib/module/locales.d.ts +0 -3
- package/dist/lib/module/locales.js +0 -132
- package/dist/lib/module/messenger.d.ts +0 -25
- package/dist/lib/module/messenger.js +0 -128
- package/dist/lib/module/middleware.d.ts +0 -3
- package/dist/lib/module/middleware.js +0 -113
- package/dist/lib/module/model.d.ts +0 -3
- package/dist/lib/module/model.js +0 -47
- package/dist/lib/module/module.d.ts +0 -12
- package/dist/lib/module/module.js +0 -135
- package/dist/lib/module/moduleMeta.d.ts +0 -3
- package/dist/lib/module/moduleMeta.js +0 -23
- package/dist/lib/module/queue/queue.d.ts +0 -3
- package/dist/lib/module/queue/queue.js +0 -59
- package/dist/lib/module/queue/queueClient.d.ts +0 -26
- package/dist/lib/module/queue/queueClient.js +0 -262
- package/dist/lib/module/redis.d.ts +0 -11
- package/dist/lib/module/redis.js +0 -46
- package/dist/lib/module/reload/development.d.ts +0 -3
- package/dist/lib/module/reload/development.js +0 -98
- package/dist/lib/module/reload/reload.d.ts +0 -16
- package/dist/lib/module/reload/reload.js +0 -113
- package/dist/lib/module/reload.d.ts +0 -7
- package/dist/lib/module/reload.js +0 -17
- package/dist/lib/module/route.d.ts +0 -10
- package/dist/lib/module/route.js +0 -239
- package/dist/lib/module/schedule.d.ts +0 -3
- package/dist/lib/module/schedule.js +0 -129
- package/dist/lib/module/service.d.ts +0 -3
- package/dist/lib/module/service.js +0 -35
- package/dist/lib/module/socketio.d.ts +0 -5
- package/dist/lib/module/socketio.js +0 -47
- package/dist/lib/module/startup.d.ts +0 -2
- package/dist/lib/module/startup.js +0 -134
- package/dist/lib/module/version/clear.d.ts +0 -2
- package/dist/lib/module/version/clear.js +0 -42
- package/dist/lib/module/version/ready.d.ts +0 -6
- package/dist/lib/module/version/ready.js +0 -106
- package/dist/lib/resource/error/errorClass.d.ts +0 -18
- package/dist/lib/resource/error/errorClass.js +0 -72
- package/dist/lib/resource/error/errorContext.d.ts +0 -38
- package/dist/lib/resource/error/errorContext.js +0 -3
- package/dist/lib/resource/error/errorGlobal.d.ts +0 -8
- package/dist/lib/resource/error/errorGlobal.js +0 -3
- package/dist/lib/resource/error/errorInternal.d.ts +0 -67
- package/dist/lib/resource/error/errorInternal.js +0 -70
- package/dist/lib/resource/error/errorObject.d.ts +0 -5
- package/dist/lib/resource/error/errorObject.js +0 -3
- package/dist/lib/resource/error/index.d.ts +0 -5
- package/dist/lib/resource/error/index.js +0 -21
- package/dist/lib/utils/index.d.ts +0 -2
- package/dist/lib/utils/index.js +0 -18
- package/dist/lib/utils/isClass.d.ts +0 -2
- package/dist/lib/utils/isClass.js +0 -20
- package/dist/lib/utils/mockUtil.d.ts +0 -11
- package/dist/lib/utils/mockUtil.js +0 -34
- package/dist/lib/utils/mockUtilCtx.d.ts +0 -10
- package/dist/lib/utils/mockUtilCtx.js +0 -35
- package/dist/lib/utils/performAction.d.ts +0 -19
- package/dist/lib/utils/performAction.js +0 -137
- package/dist/lib/utils/util.d.ts +0 -63
- package/dist/lib/utils/util.js +0 -445
- package/dist/lib/utils/utilCtx.d.ts +0 -34
- package/dist/lib/utils/utilCtx.js +0 -137
- package/dist/types/application/app.d.ts +0 -21
- package/dist/types/application/app.js +0 -28
- package/dist/types/application/index.d.ts +0 -2
- package/dist/types/application/index.js +0 -18
- package/dist/types/config/appInfo.d.ts +0 -4
- package/dist/types/config/appInfo.js +0 -3
- package/dist/types/config/config.d.ts +0 -10
- package/dist/types/config/config.js +0 -3
- package/dist/types/config/development.d.ts +0 -4
- package/dist/types/config/development.js +0 -3
- package/dist/types/config/index.d.ts +0 -4
- package/dist/types/config/index.js +0 -20
- package/dist/types/config/locale.d.ts +0 -10
- package/dist/types/config/locale.js +0 -7
- package/dist/types/context/contextBase.d.ts +0 -21
- package/dist/types/context/contextBase.js +0 -3
- package/dist/types/context/contextConfig.d.ts +0 -4
- package/dist/types/context/contextConfig.js +0 -3
- package/dist/types/context/contextError.d.ts +0 -25
- package/dist/types/context/contextError.js +0 -3
- package/dist/types/context/contextLocale.d.ts +0 -9
- package/dist/types/context/contextLocale.js +0 -3
- package/dist/types/context/contextOthers.d.ts +0 -4
- package/dist/types/context/contextOthers.js +0 -3
- package/dist/types/context/contextState.d.ts +0 -8
- package/dist/types/context/contextState.js +0 -3
- package/dist/types/context/index.d.ts +0 -18
- package/dist/types/context/index.js +0 -18
- package/dist/types/enum/appEvent.d.ts +0 -5
- package/dist/types/enum/appEvent.js +0 -9
- package/dist/types/enum/index.d.ts +0 -2
- package/dist/types/enum/index.js +0 -18
- package/dist/types/index.d.ts +0 -7
- package/dist/types/index.js +0 -23
- package/dist/types/interface/broadcast.d.ts +0 -5
- package/dist/types/interface/broadcast.js +0 -3
- package/dist/types/interface/error.d.ts +0 -8
- package/dist/types/interface/error.js +0 -3
- package/dist/types/interface/index.d.ts +0 -6
- package/dist/types/interface/index.js +0 -22
- package/dist/types/interface/module.d.ts +0 -32
- package/dist/types/interface/module.js +0 -18
- package/dist/types/interface/monkey.d.ts +0 -22
- package/dist/types/interface/monkey.js +0 -3
- package/dist/types/interface/queue.d.ts +0 -29
- package/dist/types/interface/queue.js +0 -3
- package/dist/types/interface/schedule.d.ts +0 -11
- package/dist/types/interface/schedule.js +0 -3
- package/dist/types/utils/cast.d.ts +0 -6
- package/dist/types/utils/cast.js +0 -8
- package/dist/types/utils/index.d.ts +0 -4
- package/dist/types/utils/index.js +0 -20
- package/dist/types/utils/powerPartial.d.ts +0 -4
- package/dist/types/utils/powerPartial.js +0 -3
- package/dist/types/utils/type.d.ts +0 -4
- package/dist/types/utils/type.js +0 -3
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const metaClass_js_1 = __importDefault(require("./metaClass.js"));
|
|
7
|
-
const util_js_1 = __importDefault(require("./util.js"));
|
|
8
|
-
function default_1(app) {
|
|
9
|
-
// meta
|
|
10
|
-
const meta = {};
|
|
11
|
-
// class
|
|
12
|
-
meta.class = (0, metaClass_js_1.default)();
|
|
13
|
-
// util
|
|
14
|
-
meta.util = (0, util_js_1.default)();
|
|
15
|
-
// env
|
|
16
|
-
meta.isProd = app.meta.isProd;
|
|
17
|
-
meta.isTest = app.meta.isTest;
|
|
18
|
-
meta.isLocal = app.meta.isLocal;
|
|
19
|
-
// meta
|
|
20
|
-
return meta;
|
|
21
|
-
}
|
|
22
|
-
exports.default = default_1;
|
|
23
|
-
//# sourceMappingURL=meta.js.map
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const model_js_1 = require("../base/model.js");
|
|
4
|
-
const beanModuleScopeBase_js_1 = require("../bean/beanModuleScopeBase.js");
|
|
5
|
-
function default_1() {
|
|
6
|
-
const __classes = {};
|
|
7
|
-
const classes = new Proxy(__classes, {
|
|
8
|
-
get(target, prop) {
|
|
9
|
-
return target[prop];
|
|
10
|
-
},
|
|
11
|
-
set(target, prop, value) {
|
|
12
|
-
// only once
|
|
13
|
-
if (!target[prop]) {
|
|
14
|
-
target[prop] = value;
|
|
15
|
-
}
|
|
16
|
-
return true;
|
|
17
|
-
},
|
|
18
|
-
});
|
|
19
|
-
// model
|
|
20
|
-
classes.Model = model_js_1.Model;
|
|
21
|
-
// BeanModuleScopeBase
|
|
22
|
-
classes.BeanModuleScopeBase = beanModuleScopeBase_js_1.BeanModuleScopeBase;
|
|
23
|
-
return classes;
|
|
24
|
-
}
|
|
25
|
-
exports.default = default_1;
|
|
26
|
-
//# sourceMappingURL=metaClass.js.map
|
|
@@ -1,67 +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 module_1 = __importDefault(require("module"));
|
|
30
|
-
const ModuleInfo = __importStar(require("@cabloy/module-info"));
|
|
31
|
-
const meta_js_1 = __importDefault(require("./meta.js"));
|
|
32
|
-
let __patched = false;
|
|
33
|
-
function default_1(app) {
|
|
34
|
-
// only once
|
|
35
|
-
if (__patched)
|
|
36
|
-
return;
|
|
37
|
-
__patched = true;
|
|
38
|
-
// meta
|
|
39
|
-
const meta = (0, meta_js_1.default)(app);
|
|
40
|
-
// compile
|
|
41
|
-
const Module2 = module_1.default;
|
|
42
|
-
const originalCompile = Module2.prototype._compile;
|
|
43
|
-
Module2.prototype._compile = function (...args) {
|
|
44
|
-
const _module = this;
|
|
45
|
-
let _moduleInfo;
|
|
46
|
-
// meta
|
|
47
|
-
Object.defineProperty(_module, 'meta', {
|
|
48
|
-
enumerable: false,
|
|
49
|
-
get() {
|
|
50
|
-
return meta;
|
|
51
|
-
},
|
|
52
|
-
});
|
|
53
|
-
// info
|
|
54
|
-
Object.defineProperty(_module, 'info', {
|
|
55
|
-
enumerable: false,
|
|
56
|
-
get() {
|
|
57
|
-
if (!_moduleInfo) {
|
|
58
|
-
_moduleInfo = ModuleInfo.parseInfoFromPackage(_module.path);
|
|
59
|
-
}
|
|
60
|
-
return _moduleInfo;
|
|
61
|
-
},
|
|
62
|
-
});
|
|
63
|
-
return originalCompile.apply(_module, args);
|
|
64
|
-
};
|
|
65
|
-
}
|
|
66
|
-
exports.default = default_1;
|
|
67
|
-
//# sourceMappingURL=moduleInfo.js.map
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const mixin_classes_1 = __importDefault(require("mixin-classes"));
|
|
7
|
-
function default_1() {
|
|
8
|
-
return {
|
|
9
|
-
mixinClasses(classMain, classesMore, ...args) {
|
|
10
|
-
return (0, mixin_classes_1.default)(classMain, classesMore, ...args);
|
|
11
|
-
},
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
exports.default = default_1;
|
|
15
|
-
//# sourceMappingURL=util.js.map
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
declare const _default: {
|
|
2
|
-
0: string;
|
|
3
|
-
1: string;
|
|
4
|
-
100: string;
|
|
5
|
-
101: string;
|
|
6
|
-
102: string;
|
|
7
|
-
200: string;
|
|
8
|
-
201: string;
|
|
9
|
-
202: string;
|
|
10
|
-
203: string;
|
|
11
|
-
204: string;
|
|
12
|
-
205: string;
|
|
13
|
-
206: string;
|
|
14
|
-
207: string;
|
|
15
|
-
208: string;
|
|
16
|
-
226: string;
|
|
17
|
-
300: string;
|
|
18
|
-
301: string;
|
|
19
|
-
302: string;
|
|
20
|
-
303: string;
|
|
21
|
-
304: string;
|
|
22
|
-
305: string;
|
|
23
|
-
307: string;
|
|
24
|
-
308: string;
|
|
25
|
-
400: string;
|
|
26
|
-
401: string;
|
|
27
|
-
402: string;
|
|
28
|
-
403: string;
|
|
29
|
-
404: string;
|
|
30
|
-
405: string;
|
|
31
|
-
406: string;
|
|
32
|
-
407: string;
|
|
33
|
-
408: string;
|
|
34
|
-
409: string;
|
|
35
|
-
410: string;
|
|
36
|
-
411: string;
|
|
37
|
-
412: string;
|
|
38
|
-
413: string;
|
|
39
|
-
414: string;
|
|
40
|
-
415: string;
|
|
41
|
-
416: string;
|
|
42
|
-
417: string;
|
|
43
|
-
418: string;
|
|
44
|
-
421: string;
|
|
45
|
-
422: string;
|
|
46
|
-
423: string;
|
|
47
|
-
424: string;
|
|
48
|
-
425: string;
|
|
49
|
-
426: string;
|
|
50
|
-
428: string;
|
|
51
|
-
429: string;
|
|
52
|
-
431: string;
|
|
53
|
-
451: string;
|
|
54
|
-
500: string;
|
|
55
|
-
501: string;
|
|
56
|
-
502: string;
|
|
57
|
-
503: string;
|
|
58
|
-
504: string;
|
|
59
|
-
505: string;
|
|
60
|
-
506: string;
|
|
61
|
-
507: string;
|
|
62
|
-
508: string;
|
|
63
|
-
509: string;
|
|
64
|
-
510: string;
|
|
65
|
-
511: string;
|
|
66
|
-
};
|
|
67
|
-
export default _default;
|
|
68
|
-
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.default = {
|
|
4
|
-
0: 'Success',
|
|
5
|
-
1: 'Unknown Error',
|
|
6
|
-
100: 'Continue',
|
|
7
|
-
101: 'Switching Protocols',
|
|
8
|
-
102: 'Processing',
|
|
9
|
-
200: 'OK',
|
|
10
|
-
201: 'Created',
|
|
11
|
-
202: 'Accepted',
|
|
12
|
-
203: 'Non-Authoritative Information',
|
|
13
|
-
204: 'No Content',
|
|
14
|
-
205: 'Reset Content',
|
|
15
|
-
206: 'Partial Content',
|
|
16
|
-
207: 'Multi-Status',
|
|
17
|
-
208: 'Already Reported',
|
|
18
|
-
226: 'IM Used',
|
|
19
|
-
300: 'Multiple Choices',
|
|
20
|
-
301: 'Moved Permanently',
|
|
21
|
-
302: 'Found',
|
|
22
|
-
303: 'See Other',
|
|
23
|
-
304: 'Not Modified',
|
|
24
|
-
305: 'Use Proxy',
|
|
25
|
-
307: 'Temporary Redirect',
|
|
26
|
-
308: 'Permanent Redirect',
|
|
27
|
-
400: 'Bad Request',
|
|
28
|
-
401: 'Unauthorized',
|
|
29
|
-
402: 'Payment Required',
|
|
30
|
-
403: 'Forbidden',
|
|
31
|
-
404: 'Not Found',
|
|
32
|
-
405: 'Method Not Allowed',
|
|
33
|
-
406: 'Not Acceptable',
|
|
34
|
-
407: 'Proxy Authentication Required',
|
|
35
|
-
408: 'Request Timeout',
|
|
36
|
-
409: 'Conflict',
|
|
37
|
-
410: 'Gone',
|
|
38
|
-
411: 'Length Required',
|
|
39
|
-
412: 'Precondition Failed',
|
|
40
|
-
413: 'Payload Too Large',
|
|
41
|
-
414: 'URI Too Long',
|
|
42
|
-
415: 'Unsupported Media Type',
|
|
43
|
-
416: 'Range Not Satisfiable',
|
|
44
|
-
417: 'Expectation Failed',
|
|
45
|
-
418: "I'm a teapot",
|
|
46
|
-
421: 'Misdirected Request',
|
|
47
|
-
422: 'Unprocessable Entity',
|
|
48
|
-
423: 'Locked',
|
|
49
|
-
424: 'Failed Dependency',
|
|
50
|
-
425: 'Unordered Collection',
|
|
51
|
-
426: 'Upgrade Required',
|
|
52
|
-
428: 'Precondition Required',
|
|
53
|
-
429: 'Too Many Requests',
|
|
54
|
-
431: 'Request Header Fields Too Large',
|
|
55
|
-
451: 'Unavailable For Legal Reasons',
|
|
56
|
-
500: 'Internal Server Error',
|
|
57
|
-
501: 'Not Implemented',
|
|
58
|
-
502: 'Bad Gateway',
|
|
59
|
-
503: 'Service Unavailable',
|
|
60
|
-
504: 'Gateway Timeout',
|
|
61
|
-
505: 'HTTP Version Not Supported',
|
|
62
|
-
506: 'Variant Also Negotiates',
|
|
63
|
-
507: 'Insufficient Storage',
|
|
64
|
-
508: 'Loop Detected',
|
|
65
|
-
509: 'Bandwidth Limit Exceeded',
|
|
66
|
-
510: 'Not Extended',
|
|
67
|
-
511: 'Network Authentication Required',
|
|
68
|
-
};
|
|
69
|
-
//# sourceMappingURL=errors.js.map
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.loadBeans = exports.loadBeanContainer = void 0;
|
|
4
|
-
const beanContainer_js_1 = require("../../bean/beanContainer.js");
|
|
5
|
-
function loadBeanContainer(app) {
|
|
6
|
-
app.bean = beanContainer_js_1.BeanContainer.create(app, null);
|
|
7
|
-
}
|
|
8
|
-
exports.loadBeanContainer = loadBeanContainer;
|
|
9
|
-
function loadBeans(app) {
|
|
10
|
-
// patch context
|
|
11
|
-
patchCreateContext();
|
|
12
|
-
function patchCreateContext() {
|
|
13
|
-
const createContext = app.createContext;
|
|
14
|
-
app.createContext = (...args) => {
|
|
15
|
-
const context = createContext.call(app, ...args);
|
|
16
|
-
// not check context.module
|
|
17
|
-
// bean
|
|
18
|
-
context.bean = beanContainer_js_1.BeanContainer.create(app, context);
|
|
19
|
-
return context;
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
exports.loadBeans = loadBeans;
|
|
24
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const broadcastClient_js_1 = require("./broadcastClient.js");
|
|
4
|
-
function default_1(app, modules) {
|
|
5
|
-
// broadcast
|
|
6
|
-
app.meta.broadcast = app.bean._newBean(broadcastClient_js_1.BroadcastClient);
|
|
7
|
-
// all broadcasts
|
|
8
|
-
const ebBroadcasts = (app.meta.broadcasts = {});
|
|
9
|
-
// load broadcasts
|
|
10
|
-
loadBroadcasts();
|
|
11
|
-
function loadBroadcasts() {
|
|
12
|
-
for (const key in modules) {
|
|
13
|
-
const module = modules[key];
|
|
14
|
-
const config = app.meta.configs[module.info.relativeName];
|
|
15
|
-
if (!config.broadcasts)
|
|
16
|
-
continue;
|
|
17
|
-
for (const broadcastKey in config.broadcasts) {
|
|
18
|
-
const broadcastConfig = config.broadcasts[broadcastKey];
|
|
19
|
-
const fullKey = `${broadcastConfig.module || module.info.relativeName}:${broadcastKey}`;
|
|
20
|
-
if (!ebBroadcasts[fullKey])
|
|
21
|
-
ebBroadcasts[fullKey] = [];
|
|
22
|
-
// bean
|
|
23
|
-
const implementationName = broadcastConfig.bean;
|
|
24
|
-
if (!implementationName) {
|
|
25
|
-
throw new Error(`bean not set for broadcast: ${module.info.relativeName}.${broadcastKey}`);
|
|
26
|
-
}
|
|
27
|
-
let bean;
|
|
28
|
-
if (typeof implementationName === 'string') {
|
|
29
|
-
bean = {
|
|
30
|
-
module: module.info.relativeName,
|
|
31
|
-
name: implementationName,
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
else {
|
|
35
|
-
bean = {
|
|
36
|
-
module: implementationName.module || module.info.relativeName,
|
|
37
|
-
name: implementationName.name,
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
ebBroadcasts[fullKey].push({
|
|
41
|
-
bean,
|
|
42
|
-
config: broadcastConfig,
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
exports.default = default_1;
|
|
49
|
-
//# sourceMappingURL=broadcast.js.map
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { BeanSimple } from '../../bean/beanSimple.js';
|
|
2
|
-
export declare class BroadcastClient extends BeanSimple {
|
|
3
|
-
__callerId: string;
|
|
4
|
-
channelName: string | null;
|
|
5
|
-
sub: any;
|
|
6
|
-
pub: any;
|
|
7
|
-
protected __init__(): void;
|
|
8
|
-
emit(info: any): void;
|
|
9
|
-
_performTasks({ __callerId, locale, subdomain, module, broadcastName, data }: {
|
|
10
|
-
__callerId: any;
|
|
11
|
-
locale: any;
|
|
12
|
-
subdomain: any;
|
|
13
|
-
module: any;
|
|
14
|
-
broadcastName: any;
|
|
15
|
-
data: any;
|
|
16
|
-
}): Promise<void>;
|
|
17
|
-
_performTask({ broadcast, context, locale, subdomain }: {
|
|
18
|
-
broadcast: any;
|
|
19
|
-
context: any;
|
|
20
|
-
locale: any;
|
|
21
|
-
subdomain: any;
|
|
22
|
-
}): Promise<any>;
|
|
23
|
-
}
|
|
24
|
-
//# sourceMappingURL=broadcastClient.d.ts.map
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.BroadcastClient = void 0;
|
|
4
|
-
const beanSimple_js_1 = require("../../bean/beanSimple.js");
|
|
5
|
-
class BroadcastClient extends beanSimple_js_1.BeanSimple {
|
|
6
|
-
constructor() {
|
|
7
|
-
super(...arguments);
|
|
8
|
-
Object.defineProperty(this, "__callerId", {
|
|
9
|
-
enumerable: true,
|
|
10
|
-
configurable: true,
|
|
11
|
-
writable: true,
|
|
12
|
-
value: ''
|
|
13
|
-
});
|
|
14
|
-
Object.defineProperty(this, "channelName", {
|
|
15
|
-
enumerable: true,
|
|
16
|
-
configurable: true,
|
|
17
|
-
writable: true,
|
|
18
|
-
value: null
|
|
19
|
-
});
|
|
20
|
-
Object.defineProperty(this, "sub", {
|
|
21
|
-
enumerable: true,
|
|
22
|
-
configurable: true,
|
|
23
|
-
writable: true,
|
|
24
|
-
value: null
|
|
25
|
-
});
|
|
26
|
-
Object.defineProperty(this, "pub", {
|
|
27
|
-
enumerable: true,
|
|
28
|
-
configurable: true,
|
|
29
|
-
writable: true,
|
|
30
|
-
value: null
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
__init__() {
|
|
34
|
-
const app = this.app;
|
|
35
|
-
this.__callerId = app.meta.workerId;
|
|
36
|
-
this.channelName = `broadcast_${this.app.name}:`;
|
|
37
|
-
this.pub = app.redis.get('broadcast').duplicate();
|
|
38
|
-
this.sub = app.redis.get('broadcast').duplicate();
|
|
39
|
-
this.sub.subscribe(this.channelName, function () { });
|
|
40
|
-
this.sub.on('message', (_channel, info) => {
|
|
41
|
-
this._performTasks(JSON.parse(info))
|
|
42
|
-
.then(() => {
|
|
43
|
-
// do nothing
|
|
44
|
-
})
|
|
45
|
-
.catch(err => {
|
|
46
|
-
app.logger.error(err);
|
|
47
|
-
});
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
// { locale, subdomain, module, broadcastName, data }
|
|
51
|
-
emit(info) {
|
|
52
|
-
info.__callerId = this.__callerId;
|
|
53
|
-
this.pub.publish(this.channelName, JSON.stringify(info));
|
|
54
|
-
}
|
|
55
|
-
async _performTasks({ __callerId, locale, subdomain, module, broadcastName, data }) {
|
|
56
|
-
const app = this.app;
|
|
57
|
-
// context
|
|
58
|
-
const context = { data };
|
|
59
|
-
if (__callerId === this.__callerId) {
|
|
60
|
-
context.sameAsCaller = true;
|
|
61
|
-
}
|
|
62
|
-
// broadcasts
|
|
63
|
-
const broadcastArray = app.meta.broadcasts[`${module}:${broadcastName}`];
|
|
64
|
-
if (!broadcastArray)
|
|
65
|
-
return;
|
|
66
|
-
// loop
|
|
67
|
-
for (const broadcast of broadcastArray) {
|
|
68
|
-
await this._performTask({ broadcast, context, locale, subdomain });
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
async _performTask({ broadcast, context, locale, subdomain }) {
|
|
72
|
-
const app = this.app;
|
|
73
|
-
const bean = broadcast.bean;
|
|
74
|
-
// execute as global when broadcast.config.instance === false
|
|
75
|
-
// ignore when instance not started
|
|
76
|
-
const instanceStarted = app.meta.util.instanceStarted(subdomain);
|
|
77
|
-
if (!instanceStarted && broadcast.config.instance !== false)
|
|
78
|
-
return;
|
|
79
|
-
// execute
|
|
80
|
-
return await app.meta.util.executeBean({
|
|
81
|
-
locale,
|
|
82
|
-
subdomain,
|
|
83
|
-
context,
|
|
84
|
-
beanModule: bean.module,
|
|
85
|
-
beanFullName: `${bean.module}.broadcast.${bean.name}`,
|
|
86
|
-
transaction: broadcast.config.transaction,
|
|
87
|
-
});
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
exports.BroadcastClient = BroadcastClient;
|
|
91
|
-
//# sourceMappingURL=broadcastClient.js.map
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const index_js_1 = require("../../../types/index.js");
|
|
4
|
-
function default_1(app) {
|
|
5
|
-
// ready
|
|
6
|
-
let _ready = false;
|
|
7
|
-
const pids = {};
|
|
8
|
-
// messenger
|
|
9
|
-
app.meta.messenger.addProvider({
|
|
10
|
-
name: 'appReady',
|
|
11
|
-
handler: data => {
|
|
12
|
-
pids[data.pid] = true;
|
|
13
|
-
if (!_ready) {
|
|
14
|
-
_ready = true;
|
|
15
|
-
// for agent: event: appReady
|
|
16
|
-
app.emit(index_js_1.EnumAppEvent.AppReady);
|
|
17
|
-
}
|
|
18
|
-
},
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
exports.default = default_1;
|
|
22
|
-
//# sourceMappingURL=agent.js.map
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const ready_js_1 = require("../version/ready.js");
|
|
4
|
-
function default_1(app) {
|
|
5
|
-
const versionReady = app.bean._newBean(ready_js_1.VersionReady);
|
|
6
|
-
// initialize
|
|
7
|
-
versionReady.initialize();
|
|
8
|
-
// eb_clear
|
|
9
|
-
app.messenger.once('eb_clear', async (data) => {
|
|
10
|
-
await app.meta.queue._clearWorkers();
|
|
11
|
-
process.send({ to: 'master', action: 'eb_clear_done', data: { id: data.id } });
|
|
12
|
-
});
|
|
13
|
-
}
|
|
14
|
-
exports.default = default_1;
|
|
15
|
-
// maybe cause some resources initialized more times
|
|
16
|
-
// async function __versionReady(app) {
|
|
17
|
-
// try {
|
|
18
|
-
// await versionReady(app);
|
|
19
|
-
// } catch (err) {
|
|
20
|
-
// console.error(err);
|
|
21
|
-
// setTimeout(async () => {
|
|
22
|
-
// await __versionReady(app);
|
|
23
|
-
// }, app.config.versionReady.retry.timeout);
|
|
24
|
-
// }
|
|
25
|
-
// }
|
|
26
|
-
//# sourceMappingURL=app.js.map
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const extend_1 = require("@cabloy/extend");
|
|
4
|
-
const CTXCONFIG = Symbol.for('Context#__config');
|
|
5
|
-
async function default_1(app, modules) {
|
|
6
|
-
// all configs
|
|
7
|
-
app.meta.configs = {};
|
|
8
|
-
// load configs
|
|
9
|
-
await loadConfigs();
|
|
10
|
-
// patch service
|
|
11
|
-
patchCreateContext();
|
|
12
|
-
function patchCreateContext() {
|
|
13
|
-
const createContext = app.createContext;
|
|
14
|
-
app.createContext = (...args) => {
|
|
15
|
-
const context = createContext.call(app, ...args);
|
|
16
|
-
// maybe /favicon.ico
|
|
17
|
-
if (context.module) {
|
|
18
|
-
Object.defineProperty(context, 'config', {
|
|
19
|
-
enumerable: false,
|
|
20
|
-
get() {
|
|
21
|
-
// check cache
|
|
22
|
-
if (context[CTXCONFIG])
|
|
23
|
-
return context[CTXCONFIG];
|
|
24
|
-
// get
|
|
25
|
-
let useCache;
|
|
26
|
-
let _configs = context.bean.instance.getInstanceConfigs();
|
|
27
|
-
if (!_configs) {
|
|
28
|
-
_configs = app.meta.configs;
|
|
29
|
-
useCache = false;
|
|
30
|
-
}
|
|
31
|
-
else {
|
|
32
|
-
useCache = true;
|
|
33
|
-
}
|
|
34
|
-
const _config = _configs[context.module.info.relativeName];
|
|
35
|
-
_config.module = function (moduleName) {
|
|
36
|
-
return _configs[moduleName];
|
|
37
|
-
};
|
|
38
|
-
if (useCache) {
|
|
39
|
-
context[CTXCONFIG] = _config;
|
|
40
|
-
}
|
|
41
|
-
return _config;
|
|
42
|
-
},
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
return context;
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
async function loadConfigs() {
|
|
49
|
-
for (const key in modules) {
|
|
50
|
-
const module = modules[key];
|
|
51
|
-
const ebConfig = (app.meta.configs[module.info.relativeName] = {});
|
|
52
|
-
// module config
|
|
53
|
-
if (module.resource.config) {
|
|
54
|
-
const config = await module.resource.config(app);
|
|
55
|
-
// configNew is not used by now
|
|
56
|
-
await app.meta.util.monkeyModule(app.meta.appMonkey, app.meta.modulesMonkey, 'configLoaded', module, config);
|
|
57
|
-
(0, extend_1.extend)(true, ebConfig, config);
|
|
58
|
-
}
|
|
59
|
-
// application config
|
|
60
|
-
if (app.config.modules && app.config.modules[module.info.relativeName]) {
|
|
61
|
-
(0, extend_1.extend)(true, ebConfig, app.config.modules[module.info.relativeName]);
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
exports.default = default_1;
|
|
67
|
-
//# sourceMappingURL=config.js.map
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const extend_1 = require("@cabloy/extend");
|
|
4
|
-
function default_1(app, modules) {
|
|
5
|
-
// all constants
|
|
6
|
-
const ebConstants = (app.meta.constants = {});
|
|
7
|
-
// load constants
|
|
8
|
-
loadConstants();
|
|
9
|
-
// patch service
|
|
10
|
-
patchCreateContext();
|
|
11
|
-
function patchCreateContext() {
|
|
12
|
-
const createContext = app.createContext;
|
|
13
|
-
app.createContext = (...args) => {
|
|
14
|
-
const context = createContext.call(app, ...args);
|
|
15
|
-
// maybe /favicon.ico
|
|
16
|
-
if (context.module) {
|
|
17
|
-
// constant
|
|
18
|
-
context.constant = ebConstants[context.module.info.relativeName];
|
|
19
|
-
}
|
|
20
|
-
return context;
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
function loadConstants() {
|
|
24
|
-
for (const key in modules) {
|
|
25
|
-
const module = modules[key];
|
|
26
|
-
const ebConstant = (ebConstants[module.info.relativeName] = {});
|
|
27
|
-
// module constants
|
|
28
|
-
if (module.resource.constants)
|
|
29
|
-
(0, extend_1.extend)(true, ebConstant, module.resource.constants);
|
|
30
|
-
// patchConstant
|
|
31
|
-
patchConstant(ebConstant);
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
function patchConstant(ebConstant) {
|
|
35
|
-
Object.defineProperty(ebConstant, 'module', {
|
|
36
|
-
enumerable: false,
|
|
37
|
-
get() {
|
|
38
|
-
return function (moduleName) {
|
|
39
|
-
return ebConstants[moduleName];
|
|
40
|
-
};
|
|
41
|
-
},
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
exports.default = default_1;
|
|
46
|
-
//# sourceMappingURL=constant.js.map
|