vona-core 5.0.72 → 5.0.73

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.
@@ -3,6 +3,7 @@ import type { VonaApplicationOptions } from '../../types/application/app.ts';
3
3
  import type { VonaConfig } from '../../types/config/config.ts';
4
4
  import type { VonaContext } from '../../types/context/index.ts';
5
5
  import type { ApplicationError } from '../bean/resource/error/errorApplication.ts';
6
+ import type { IBeanScopeRecord, TypeBeanScopeRecordKeys } from '../bean/type.ts';
6
7
  import KoaApplication from 'koa';
7
8
  import { BeanContainer } from '../bean/beanContainer.ts';
8
9
  import { AppUtil } from '../utils/util.ts';
@@ -20,6 +21,8 @@ export declare class VonaApplication extends KoaApplication {
20
21
  ctxStorage: VonaAsyncLocalStorage;
21
22
  constructor(options: VonaApplicationOptions);
22
23
  get ctx(): VonaContext;
24
+ /** get specific module's scope */
25
+ scope<K extends TypeBeanScopeRecordKeys>(moduleScope: K): IBeanScopeRecord[K];
23
26
  get name(): string;
24
27
  createAnonymousContext(req?: any, res?: any): VonaContext;
25
28
  close(terminate?: boolean): Promise<void>;
@@ -46,6 +46,10 @@ export class VonaApplication extends KoaApplication {
46
46
  get ctx() {
47
47
  return this.currentContext;
48
48
  }
49
+ // scope<T>(moduleScope: string): T;
50
+ scope(moduleScope) {
51
+ return this.bean.scope(moduleScope);
52
+ }
49
53
  get name() {
50
54
  return this.options.name;
51
55
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "vona-core",
3
3
  "type": "module",
4
- "version": "5.0.72",
4
+ "version": "5.0.73",
5
5
  "description": "vona",
6
6
  "publishConfig": {
7
7
  "access": "public"