vona-core 5.0.98 → 5.0.100
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/dist/lib/core/application.d.ts +3 -1
- package/dist/lib/core/application.js +9 -3
- package/dist/lib/framework/createApp.js +1 -0
- package/dist/lib/utils/index.d.ts +1 -0
- package/dist/lib/utils/index.js +1 -0
- package/dist/lib/utils/redis.d.ts +3 -0
- package/dist/lib/utils/redis.js +4 -0
- package/dist/lib/utils/util.js +2 -2
- package/dist/types/application/app.d.ts +1 -0
- package/package.json +1 -1
|
@@ -20,10 +20,12 @@ export declare class VonaApplication extends KoaApplication {
|
|
|
20
20
|
server: Server;
|
|
21
21
|
ctxStorage: VonaAsyncLocalStorage;
|
|
22
22
|
constructor(options: VonaApplicationOptions);
|
|
23
|
+
get name(): string;
|
|
24
|
+
get projectPath(): string;
|
|
25
|
+
get configMeta(): import("@cabloy/module-info").VonaConfigMeta;
|
|
23
26
|
get ctx(): VonaContext;
|
|
24
27
|
/** get specific module's scope */
|
|
25
28
|
scope<K extends TypeBeanScopeRecordKeys>(moduleScope: K): IBeanScopeRecord[K];
|
|
26
|
-
get name(): string;
|
|
27
29
|
createAnonymousContext(req?: any, res?: any): VonaContext;
|
|
28
30
|
close(terminate?: boolean): Promise<void>;
|
|
29
31
|
}
|
|
@@ -43,6 +43,15 @@ export class VonaApplication extends KoaApplication {
|
|
|
43
43
|
// zod
|
|
44
44
|
zodEnhance(this);
|
|
45
45
|
}
|
|
46
|
+
get name() {
|
|
47
|
+
return this.options.name;
|
|
48
|
+
}
|
|
49
|
+
get projectPath() {
|
|
50
|
+
return this.options.projectPath;
|
|
51
|
+
}
|
|
52
|
+
get configMeta() {
|
|
53
|
+
return this.options.configMeta;
|
|
54
|
+
}
|
|
46
55
|
get ctx() {
|
|
47
56
|
return this.currentContext;
|
|
48
57
|
}
|
|
@@ -50,9 +59,6 @@ export class VonaApplication extends KoaApplication {
|
|
|
50
59
|
scope(moduleScope) {
|
|
51
60
|
return this.bean.scope(moduleScope);
|
|
52
61
|
}
|
|
53
|
-
get name() {
|
|
54
|
-
return this.options.name;
|
|
55
|
-
}
|
|
56
62
|
createAnonymousContext(req, res) {
|
|
57
63
|
let request;
|
|
58
64
|
if (req) {
|
package/dist/lib/utils/index.js
CHANGED
package/dist/lib/utils/util.js
CHANGED
|
@@ -17,11 +17,11 @@ export class AppUtil extends BeanSimple {
|
|
|
17
17
|
return this.app.meta.appReadyInstances && this.app.meta.appReadyInstances[instanceName];
|
|
18
18
|
}
|
|
19
19
|
get protocol() {
|
|
20
|
-
const config = this.app.config;
|
|
20
|
+
const config = this.ctx ? this.ctx.config : this.app.config;
|
|
21
21
|
return config.server.serve.protocol || this.ctx?.protocol;
|
|
22
22
|
}
|
|
23
23
|
get host() {
|
|
24
|
-
const config = this.app.config;
|
|
24
|
+
const config = this.ctx ? this.ctx.config : this.app.config;
|
|
25
25
|
return config.server.serve.host || this.ctx?.host;
|
|
26
26
|
}
|
|
27
27
|
getAbsoluteUrl(path) {
|