vona-core 5.0.71 → 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.
@@ -311,7 +311,8 @@ export class BeanContainer {
311
311
  return Reflect.get(target, prop, receiver);
312
312
  }
313
313
  // aop chains
314
- const _aopChainsProp = this._getAopChainsProp(beanFullName, prop, undefined, 'method', prop);
314
+ const methodNameMagic = '__method__';
315
+ const _aopChainsProp = this._getAopChainsProp(beanFullName, prop, methodNameMagic, 'method', prop);
315
316
  if (!_aopChainsProp)
316
317
  return Reflect.get(target, prop, receiver);
317
318
  // proxy
@@ -424,7 +425,7 @@ export class BeanContainer {
424
425
  }
425
426
  chains.push([aopKey, fn]);
426
427
  }
427
- else if (methodNameMagic && aop[methodNameMagic]) {
428
+ if (methodNameMagic && aop[methodNameMagic]) {
428
429
  if (!__isLifeCycleMethod(methodName)) {
429
430
  let fn;
430
431
  if (methodType === 'get') {
@@ -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.71",
4
+ "version": "5.0.73",
5
5
  "description": "vona",
6
6
  "publishConfig": {
7
7
  "access": "public"