vona-module-a-caching 5.0.11 → 5.0.13

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.
@@ -22,24 +22,28 @@ declare module 'vona-module-a-caching' {
22
22
  interface AopMethodCachingClear {
23
23
  get $beanFullName(): 'a-caching.aopMethod.cachingClear';
24
24
  get $onionName(): 'a-caching:cachingClear';
25
+ get $onionOptions(): IAopMethodOptionsCachingClear;
25
26
  }
26
27
  interface AopMethodCachingDel {
27
28
  }
28
29
  interface AopMethodCachingDel {
29
30
  get $beanFullName(): 'a-caching.aopMethod.cachingDel';
30
31
  get $onionName(): 'a-caching:cachingDel';
32
+ get $onionOptions(): IAopMethodOptionsCachingDel;
31
33
  }
32
34
  interface AopMethodCachingGet {
33
35
  }
34
36
  interface AopMethodCachingGet {
35
37
  get $beanFullName(): 'a-caching.aopMethod.cachingGet';
36
38
  get $onionName(): 'a-caching:cachingGet';
39
+ get $onionOptions(): IAopMethodOptionsCachingGet;
37
40
  }
38
41
  interface AopMethodCachingSet {
39
42
  }
40
43
  interface AopMethodCachingSet {
41
44
  get $beanFullName(): 'a-caching.aopMethod.cachingSet';
42
45
  get $onionName(): 'a-caching:cachingSet';
46
+ get $onionOptions(): IAopMethodOptionsCachingSet;
43
47
  }
44
48
  }
45
49
  /** aopMethod: end */
@@ -5,5 +5,5 @@ import { BeanAopMethodBase } from 'vona';
5
5
  export interface IAopMethodOptionsCachingClear extends IDecoratorAopMethodOptions, TypeCachingActionClearOptions {
6
6
  }
7
7
  export declare class AopMethodCachingClear extends BeanAopMethodBase implements IAopMethodExecute {
8
- execute(options: IAopMethodOptionsCachingClear, _args: [], next: Next, _receiver: any, _prop: string): Promise<any>;
8
+ execute(options: IAopMethodOptionsCachingClear, _args: [], next: Next, receiver: any, prop: string): Promise<any>;
9
9
  }
package/dist/index.js CHANGED
@@ -8,7 +8,8 @@ var _dec$4, _dec2$4, _class$4;
8
8
  let AopMethodCachingClear = (_dec$4 = AopMethod(), _dec2$4 = BeanInfo({
9
9
  module: "a-caching"
10
10
  }), _dec$4(_class$4 = _dec2$4(_class$4 = class AopMethodCachingClear extends BeanAopMethodBase {
11
- async execute(options, _args, next, _receiver, _prop) {
11
+ async execute(options, _args, next, receiver, prop) {
12
+ if (!options.cacheName) throw new Error(`Should specify cacheName for caching: ${receiver.$beanFullName}#${prop}`);
12
13
  // next
13
14
  const value = await next();
14
15
  // cache
@@ -79,6 +80,7 @@ let AopMethodCachingDel = (_dec$3 = AopMethod(), _dec2$3 = BeanInfo({
79
80
  module: "a-caching"
80
81
  }), _dec$3(_class$3 = _dec2$3(_class$3 = class AopMethodCachingDel extends BeanAopMethodBase {
81
82
  async execute(options, args, next, receiver, prop) {
83
+ if (!options.cacheName) throw new Error(`Should specify cacheName for caching: ${receiver.$beanFullName}#${prop}`);
82
84
  // next
83
85
  const value = await next();
84
86
  // key
@@ -97,6 +99,7 @@ let AopMethodCachingGet = (_dec$2 = AopMethod(), _dec2$2 = BeanInfo({
97
99
  module: "a-caching"
98
100
  }), _dec$2(_class$2 = _dec2$2(_class$2 = class AopMethodCachingGet extends BeanAopMethodBase {
99
101
  async execute(options, args, next, receiver, prop) {
102
+ if (!options.cacheName) throw new Error(`Should specify cacheName for caching: ${receiver.$beanFullName}#${prop}`);
100
103
  // key
101
104
  const key = combineCachingKey(options, args, receiver, prop);
102
105
  if (!isCachingKeyValid(key)) return next();
@@ -115,6 +118,7 @@ let AopMethodCachingSet = (_dec$1 = AopMethod(), _dec2$1 = BeanInfo({
115
118
  module: "a-caching"
116
119
  }), _dec$1(_class$1 = _dec2$1(_class$1 = class AopMethodCachingSet extends BeanAopMethodBase {
117
120
  async execute(options, args, next, receiver, prop) {
121
+ if (!options.cacheName) throw new Error(`Should specify cacheName for caching: ${receiver.$beanFullName}#${prop}`);
118
122
  // next
119
123
  const value = await next();
120
124
  // key
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "vona-module-a-caching",
3
3
  "type": "module",
4
- "version": "5.0.11",
4
+ "version": "5.0.13",
5
5
  "title": "a-caching",
6
6
  "vonaModule": {
7
7
  "dependencies": {}