@anveroapi/cache 0.0.0-stage → 3.0.0

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.
@@ -0,0 +1,30 @@
1
+ declare const _default: (appinfo: any) => {
2
+ cache: {
3
+ default: string;
4
+ stores: {
5
+ file: {
6
+ store: any;
7
+ options: {
8
+ subdirs: boolean;
9
+ path: string;
10
+ };
11
+ };
12
+ redis: {
13
+ store: any;
14
+ options: {
15
+ port: number;
16
+ host: string;
17
+ password: string;
18
+ keyPrefix: string;
19
+ };
20
+ };
21
+ memory: {
22
+ store: string;
23
+ options: {
24
+ max: number;
25
+ };
26
+ };
27
+ };
28
+ };
29
+ };
30
+ export default _default;
@@ -0,0 +1 @@
1
+ const a0_0x54b581=a0_0x34e9;(function(_0x2781d8,_0x44dd9e){const _0x55a196=a0_0x34e9,_0x41c3ce=_0x2781d8();while(!![]){try{const _0x34a30c=-parseInt(_0x55a196(0x115))/0x1*(parseInt(_0x55a196(0x11f))/0x2)+-parseInt(_0x55a196(0x114))/0x3*(-parseInt(_0x55a196(0x10d))/0x4)+-parseInt(_0x55a196(0x10f))/0x5+-parseInt(_0x55a196(0x120))/0x6*(-parseInt(_0x55a196(0x11e))/0x7)+parseInt(_0x55a196(0x117))/0x8*(-parseInt(_0x55a196(0x111))/0x9)+parseInt(_0x55a196(0x122))/0xa*(-parseInt(_0x55a196(0x124))/0xb)+parseInt(_0x55a196(0x126))/0xc;if(_0x34a30c===_0x44dd9e)break;else _0x41c3ce['push'](_0x41c3ce['shift']());}catch(_0x1c7e2a){_0x41c3ce['push'](_0x41c3ce['shift']());}}}(a0_0x2a3b,0x6322c));function a0_0x34e9(_0x32d2b1,_0x32b331){_0x32d2b1=_0x32d2b1-0x10b;const _0x3b4e5a=a0_0x2a3b();let _0x3e8ed2=_0x3b4e5a[_0x32d2b1];return _0x3e8ed2;}const a0_0x46815d=(function(){let _0x260cf2=!![];return function(_0xa8a6d6,_0x802820){const _0x2588aa=_0x260cf2?function(){const _0x5e871d=a0_0x34e9;if(_0x802820){const _0x30e989=_0x802820[_0x5e871d(0x10e)](_0xa8a6d6,arguments);return _0x802820=null,_0x30e989;}}:function(){};return _0x260cf2=![],_0x2588aa;};}()),a0_0x3e8ed2=a0_0x46815d(this,function(){const _0x1456c7=a0_0x34e9;return a0_0x3e8ed2[_0x1456c7(0x123)]()[_0x1456c7(0x110)](_0x1456c7(0x116))[_0x1456c7(0x123)]()[_0x1456c7(0x121)](a0_0x3e8ed2)[_0x1456c7(0x110)]('(((.+)+)+)+$');});a0_0x3e8ed2();'use strict';function a0_0x2a3b(){const _0x35775e=['16AseLkj','memory','__esModule','name','default','cache-manager-ioredis','/runtime/.cache','7JlxVcX','2VPqvkW','3596676ykJswk','constructor','10kUClIK','toString','7277105XOdred','file','7362312CZoKuJ','127.0.0.1','defineProperty','8DhjuWP','apply','430090HiERVg','search','2359431YNOwjA','appDir','env','805722jTUslU','72169snbEET','(((.+)+)+)+$'];a0_0x2a3b=function(){return _0x35775e;};return a0_0x2a3b();}Object[a0_0x54b581(0x10c)](exports,a0_0x54b581(0x119),{'value':!![]});const fsStore=require('cache-manager-fs-hash'),redisStore=require(a0_0x54b581(0x11c));exports[a0_0x54b581(0x11b)]=_0x24f934=>{const _0x18942d=a0_0x54b581;return{'cache':{'default':_0x18942d(0x125),'stores':{'file':{'store':fsStore,'options':{'subdirs':![],'path':_0x24f934[_0x18942d(0x112)]+_0x18942d(0x11d)+((_0x24f934===null||_0x24f934===void 0x0?void 0x0:_0x24f934[_0x18942d(0x113)])?'-'+_0x24f934[_0x18942d(0x113)]:'')}},'redis':{'store':redisStore,'options':{'port':0x18eb,'host':_0x18942d(0x10b),'password':'','keyPrefix':_0x24f934[_0x18942d(0x11a)]+':'+((_0x24f934===null||_0x24f934===void 0x0?void 0x0:_0x24f934['env'])?_0x24f934[_0x18942d(0x113)]+':':'')}},'memory':{'store':_0x18942d(0x118),'options':{'max':0x64}}}}};};
@@ -0,0 +1,2 @@
1
+ export declare class CustomConfiguration {
2
+ }
@@ -0,0 +1 @@
1
+ var a1_0x4aa188=a1_0x2e55;function a1_0x2e55(_0x1cc452,_0xc3a809){_0x1cc452=_0x1cc452-0x15c;var _0x10a294=a1_0x56ca();var _0x3cccc7=_0x10a294[_0x1cc452];return _0x3cccc7;}(function(_0x4f67e8,_0x4c14c6){var _0x18e38e=a1_0x2e55,_0x2a3717=_0x4f67e8();while(!![]){try{var _0x341c61=parseInt(_0x18e38e(0x168))/0x1*(-parseInt(_0x18e38e(0x16a))/0x2)+parseInt(_0x18e38e(0x161))/0x3*(-parseInt(_0x18e38e(0x16f))/0x4)+-parseInt(_0x18e38e(0x16c))/0x5+parseInt(_0x18e38e(0x164))/0x6+-parseInt(_0x18e38e(0x166))/0x7*(parseInt(_0x18e38e(0x15e))/0x8)+parseInt(_0x18e38e(0x16d))/0x9*(parseInt(_0x18e38e(0x15c))/0xa)+parseInt(_0x18e38e(0x169))/0xb;if(_0x341c61===_0x4c14c6)break;else _0x2a3717['push'](_0x2a3717['shift']());}catch(_0x2637a4){_0x2a3717['push'](_0x2a3717['shift']());}}}(a1_0x56ca,0x980bb));var a1_0x1c1952=(function(){var _0x495b65=!![];return function(_0x52d872,_0xefc7dc){var _0x3db75b=_0x495b65?function(){var _0x2f52b7=a1_0x2e55;if(_0xefc7dc){var _0xb868cf=_0xefc7dc[_0x2f52b7(0x15f)](_0x52d872,arguments);return _0xefc7dc=null,_0xb868cf;}}:function(){};return _0x495b65=![],_0x3db75b;};}()),a1_0x3cccc7=a1_0x1c1952(this,function(){var _0x4c0a39=a1_0x2e55;return a1_0x3cccc7[_0x4c0a39(0x163)]()[_0x4c0a39(0x16b)]('(((.+)+)+)+$')['toString']()[_0x4c0a39(0x172)](a1_0x3cccc7)[_0x4c0a39(0x16b)]('(((.+)+)+)+$');});a1_0x3cccc7();'use strict';var __decorate=this&&this[a1_0x4aa188(0x162)]||function(_0x42899e,_0x1a769a,_0x47f42c,_0x470f83){var _0x1a0bb5=a1_0x4aa188,_0x3392d5=arguments[_0x1a0bb5(0x15d)],_0x1b18f3=_0x3392d5<0x3?_0x1a769a:_0x470f83===null?_0x470f83=Object[_0x1a0bb5(0x16e)](_0x1a769a,_0x47f42c):_0x470f83,_0x15e603;if(typeof Reflect===_0x1a0bb5(0x170)&&typeof Reflect['decorate']==='function')_0x1b18f3=Reflect[_0x1a0bb5(0x171)](_0x42899e,_0x1a769a,_0x47f42c,_0x470f83);else{for(var _0xc62c23=_0x42899e[_0x1a0bb5(0x15d)]-0x1;_0xc62c23>=0x0;_0xc62c23--)if(_0x15e603=_0x42899e[_0xc62c23])_0x1b18f3=(_0x3392d5<0x3?_0x15e603(_0x1b18f3):_0x3392d5>0x3?_0x15e603(_0x1a769a,_0x47f42c,_0x1b18f3):_0x15e603(_0x1a769a,_0x47f42c))||_0x1b18f3;}return _0x3392d5>0x3&&_0x1b18f3&&Object[_0x1a0bb5(0x167)](_0x1a769a,_0x47f42c,_0x1b18f3),_0x1b18f3;};Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports[a1_0x4aa188(0x160)]=void 0x0;const core_1=require(a1_0x4aa188(0x165)),ConfigDefault=require('./config/config.default');function a1_0x56ca(){var _0x17ba72=['21117EWzdpo','__decorate','toString','986742MFlnAS','@midwayjs/core','6139SWVDyX','defineProperty','29emLGLV','28885362dAwjQU','55502WpeFDK','search','1522730GslwMP','1701981ZKpKin','getOwnPropertyDescriptor','664uViQOL','object','decorate','constructor','10zdhYSX','length','720TQqfyP','apply','CustomConfiguration'];a1_0x56ca=function(){return _0x17ba72;};return a1_0x56ca();}let CustomConfiguration=class CustomConfiguration{};exports[a1_0x4aa188(0x160)]=CustomConfiguration,exports[a1_0x4aa188(0x160)]=CustomConfiguration=__decorate([(0x0,core_1['Configuration'])({'conflictCheck':![],'namespace':'anvero-api:cache','importConfigs':[{'default':ConfigDefault}]})],CustomConfiguration);
@@ -0,0 +1 @@
1
+ export declare function Cache(key?: string, ttl?: number): MethodDecorator;
@@ -0,0 +1 @@
1
+ const a2_0x31ec6f=a2_0x5dec;(function(_0x2dc90d,_0x5cecde){const _0x20e11c=a2_0x5dec,_0x584fff=_0x2dc90d();while(!![]){try{const _0x4624ed=-parseInt(_0x20e11c(0xaa))/0x1+-parseInt(_0x20e11c(0xae))/0x2+-parseInt(_0x20e11c(0xa7))/0x3+-parseInt(_0x20e11c(0xa5))/0x4*(-parseInt(_0x20e11c(0xb4))/0x5)+parseInt(_0x20e11c(0xb9))/0x6*(parseInt(_0x20e11c(0xab))/0x7)+-parseInt(_0x20e11c(0xa3))/0x8+parseInt(_0x20e11c(0xaf))/0x9*(parseInt(_0x20e11c(0xb1))/0xa);if(_0x4624ed===_0x5cecde)break;else _0x584fff['push'](_0x584fff['shift']());}catch(_0x2dd036){_0x584fff['push'](_0x584fff['shift']());}}}(a2_0x4a20,0x7a4e2));const a2_0x2a7ded=(function(){let _0x56eae5=!![];return function(_0x48d275,_0x19d39a){const _0x112bb7=_0x56eae5?function(){const _0x349889=a2_0x5dec;if(_0x19d39a){const _0x3e1626=_0x19d39a[_0x349889(0xbe)](_0x48d275,arguments);return _0x19d39a=null,_0x3e1626;}}:function(){};return _0x56eae5=![],_0x112bb7;};}()),a2_0x21017b=a2_0x2a7ded(this,function(){const _0x5d6114=a2_0x5dec;return a2_0x21017b[_0x5d6114(0xa2)]()[_0x5d6114(0xbf)](_0x5d6114(0xba))[_0x5d6114(0xa2)]()[_0x5d6114(0xa8)](a2_0x21017b)[_0x5d6114(0xbf)]('(((.+)+)+)+$');});a2_0x21017b();'use strict';function a2_0x4a20(){const _0x390287=['toString','3007080LXdyjR','@midwayjs/core','4cEpNAz','stringify','1987647sNeJWc','constructor','getAsync','406456DiTjUR','666267WbDuko','__esModule','use','1499922hfcgDt','17846937xbWrBB','get','10MRirkH','../service/CacheService','defineProperty','232765mAvcNf','Method::Decorator','MD5','value','getApplicationContext','42WrNIvf','(((.+)+)+)+$','app','Cache','CacheService','apply','search'];a2_0x4a20=function(){return _0x390287;};return a2_0x4a20();}Object[a2_0x31ec6f(0xb3)](exports,a2_0x31ec6f(0xac),{'value':!![]}),exports[a2_0x31ec6f(0xbc)]=Cache;const crypto_js_1=require('crypto-js'),CacheService_1=require(a2_0x31ec6f(0xb2)),core_1=require(a2_0x31ec6f(0xa4));function a2_0x5dec(_0x25a1f6,_0x6c5b1b){_0x25a1f6=_0x25a1f6-0xa2;const _0x4bea40=a2_0x4a20();let _0x21017b=_0x4bea40[_0x25a1f6];return _0x21017b;}function json_encode(_0xbb755){try{return JSON['stringify'](_0xbb755);}catch(_0x56969a){return undefined;}}function Cache(_0x2cbece,_0x231c38){return(_0x533f57,_0x40803d,_0x2bf11)=>{const _0x1d70b4=a2_0x5dec,_0x349dec=_0x2bf11[_0x1d70b4(0xb7)];return _0x2bf11[_0x1d70b4(0xb7)]=async function(..._0x1480ea){const _0x593c59=_0x1d70b4;_0x2cbece=(_0x2cbece?''+_0x2cbece:''+(_0x40803d||''))+'.'+(0x0,crypto_js_1[_0x593c59(0xb6)])(json_encode(_0x1480ea))[_0x593c59(0xa2)]();let _0x3a811f=await this[core_1['REQUEST_OBJ_CTX_KEY']][_0x593c59(0xbb)][_0x593c59(0xb8)]()[_0x593c59(0xa9)](CacheService_1[_0x593c59(0xbd)]),_0x3aa3f8=await _0x3a811f[_0x593c59(0xad)](_0x593c59(0xb5))[_0x593c59(0xb0)](_0x2cbece);if(_0x3aa3f8)return JSON['parse'](_0x3aa3f8);else _0x3aa3f8=await _0x349dec[_0x593c59(0xbe)](this,[..._0x1480ea]),await _0x3a811f[_0x593c59(0xad)](_0x593c59(0xb5))['set'](_0x2cbece,JSON[_0x593c59(0xa6)](_0x3aa3f8),_0x231c38);return _0x3aa3f8;},_0x2bf11;};}
@@ -0,0 +1,3 @@
1
+ export { CustomConfiguration as Configuration } from './configuration';
2
+ export { Cache } from './decorator/Cache';
3
+ export { CacheService } from "./service/CacheService";
package/dist/index.js ADDED
@@ -0,0 +1 @@
1
+ var a3_0x64b32b=a3_0x5e46;(function(_0x294e51,_0x39c945){var _0x2683a6=a3_0x5e46,_0x5d582c=_0x294e51();while(!![]){try{var _0x4426a7=parseInt(_0x2683a6(0x18c))/0x1+parseInt(_0x2683a6(0x18e))/0x2+-parseInt(_0x2683a6(0x188))/0x3+parseInt(_0x2683a6(0x18d))/0x4*(-parseInt(_0x2683a6(0x196))/0x5)+parseInt(_0x2683a6(0x189))/0x6+-parseInt(_0x2683a6(0x194))/0x7*(parseInt(_0x2683a6(0x193))/0x8)+-parseInt(_0x2683a6(0x18b))/0x9*(-parseInt(_0x2683a6(0x198))/0xa);if(_0x4426a7===_0x39c945)break;else _0x5d582c['push'](_0x5d582c['shift']());}catch(_0x154f97){_0x5d582c['push'](_0x5d582c['shift']());}}}(a3_0x243f,0xaefa6));var a3_0x56a3d1=(function(){var _0x5222d6=!![];return function(_0x287f1c,_0x155300){var _0x2cb4a6=_0x5222d6?function(){var _0xb3806f=a3_0x5e46;if(_0x155300){var _0x47a4a6=_0x155300[_0xb3806f(0x18a)](_0x287f1c,arguments);return _0x155300=null,_0x47a4a6;}}:function(){};return _0x5222d6=![],_0x2cb4a6;};}()),a3_0x1b1e7b=a3_0x56a3d1(this,function(){var _0xa8fd6b=a3_0x5e46;return a3_0x1b1e7b[_0xa8fd6b(0x191)]()['search'](_0xa8fd6b(0x192))[_0xa8fd6b(0x191)]()[_0xa8fd6b(0x187)](a3_0x1b1e7b)[_0xa8fd6b(0x18f)](_0xa8fd6b(0x192));});a3_0x1b1e7b();'use strict';Object[a3_0x64b32b(0x190)](exports,'__esModule',{'value':!![]}),exports[a3_0x64b32b(0x185)]=exports[a3_0x64b32b(0x197)]=exports[a3_0x64b32b(0x199)]=void 0x0;var configuration_1=require(a3_0x64b32b(0x195));Object[a3_0x64b32b(0x190)](exports,a3_0x64b32b(0x199),{'enumerable':!![],'get':function(){return configuration_1['CustomConfiguration'];}});var Cache_1=require(a3_0x64b32b(0x186));Object['defineProperty'](exports,a3_0x64b32b(0x197),{'enumerable':!![],'get':function(){var _0x3dc54b=a3_0x64b32b;return Cache_1[_0x3dc54b(0x197)];}});function a3_0x5e46(_0x5b2b57,_0x3d67ea){_0x5b2b57=_0x5b2b57-0x185;var _0x499358=a3_0x243f();var _0x1b1e7b=_0x499358[_0x5b2b57];return _0x1b1e7b;}var CacheService_1=require('./service/CacheService');Object[a3_0x64b32b(0x190)](exports,a3_0x64b32b(0x185),{'enumerable':!![],'get':function(){var _0x23fab8=a3_0x64b32b;return CacheService_1[_0x23fab8(0x185)];}});function a3_0x243f(){var _0xccdc63=['defineProperty','toString','(((.+)+)+)+$','3637440wQTLkT','21XRYfiB','./configuration','295965femzKN','Cache','30oMkpAz','Configuration','CacheService','./decorator/Cache','constructor','1238196fhnxzp','3802044lKWrPh','apply','4711860mvvxpr','1221421iUZNYD','96yuIluv','976798dDHkUz','search'];a3_0x243f=function(){return _0xccdc63;};return a3_0x243f();}
@@ -0,0 +1,28 @@
1
+ import * as cacheManager from 'cache-manager';
2
+ export declare class CacheService {
3
+ protected config: any;
4
+ protected cache: cacheManager.Cache;
5
+ protected clients: Map<string, Cache>;
6
+ use(registerCache: string): Cache;
7
+ reset(): Promise<any>;
8
+ }
9
+ export declare class Cache {
10
+ readonly prefix: string;
11
+ readonly cache: cacheManager.Cache;
12
+ constructor(prefix: string, cache: cacheManager.Cache);
13
+ del(key: string): Promise<any>;
14
+ set<T>(key: string, value: T, ttl?: number): Promise<T>;
15
+ get<T>(key: string, defaultval?: T): Promise<T>;
16
+ get<T>(key: string, defaultval?: () => Promise<T>, ttl?: number): Promise<T>;
17
+ hdel(key: string, field: string): Promise<any>;
18
+ hset<T>(key: string, field: string, value: T, ttl?: number): Promise<T>;
19
+ hget<T>(key: string, field: string, defaultval?: T): Promise<T>;
20
+ hget<T>(key: string, field: string, defaultval?: () => Promise<T>, ttl?: number): Promise<T>;
21
+ list(key: string): {
22
+ all: () => Promise<any>;
23
+ pop: () => Promise<any>;
24
+ push: (...value: any[]) => Promise<any[]>;
25
+ };
26
+ }
27
+ export declare function json_encode(value: any): string;
28
+ export declare function json_decode(value: string): any;
@@ -0,0 +1 @@
1
+ var a4_0x17bb76=a4_0x2212;(function(_0x18844f,_0x1bc695){var _0x26e638=a4_0x2212,_0x183a19=_0x18844f();while(!![]){try{var _0x417d34=-parseInt(_0x26e638(0x147))/0x1*(-parseInt(_0x26e638(0x113))/0x2)+parseInt(_0x26e638(0x13d))/0x3*(parseInt(_0x26e638(0x12e))/0x4)+-parseInt(_0x26e638(0x126))/0x5+parseInt(_0x26e638(0x13c))/0x6+parseInt(_0x26e638(0x143))/0x7+-parseInt(_0x26e638(0x118))/0x8*(parseInt(_0x26e638(0x122))/0x9)+-parseInt(_0x26e638(0x142))/0xa;if(_0x417d34===_0x1bc695)break;else _0x183a19['push'](_0x183a19['shift']());}catch(_0x331c17){_0x183a19['push'](_0x183a19['shift']());}}}(a4_0x26d8,0x8340b));var a4_0x1381c6=(function(){var _0x209e73=!![];return function(_0x355ef5,_0x18581e){var _0x346619=_0x209e73?function(){var _0x1e6007=a4_0x2212;if(_0x18581e){var _0x29cd1b=_0x18581e[_0x1e6007(0x13b)](_0x355ef5,arguments);return _0x18581e=null,_0x29cd1b;}}:function(){};return _0x209e73=![],_0x346619;};}()),a4_0x136fd9=a4_0x1381c6(this,function(){var _0x47ef06=a4_0x2212;return a4_0x136fd9[_0x47ef06(0x12f)]()[_0x47ef06(0x12b)](_0x47ef06(0x124))[_0x47ef06(0x12f)]()[_0x47ef06(0x144)](a4_0x136fd9)[_0x47ef06(0x12b)]('(((.+)+)+)+$');});a4_0x136fd9();'use strict';var __decorate=this&&this[a4_0x17bb76(0x132)]||function(_0x1e10e6,_0x1aafc5,_0x10d61c,_0x40e67a){var _0x377271=a4_0x17bb76,_0x209b3e=arguments['length'],_0x58f33d=_0x209b3e<0x3?_0x1aafc5:_0x40e67a===null?_0x40e67a=Object[_0x377271(0x123)](_0x1aafc5,_0x10d61c):_0x40e67a,_0x5e9f0b;if(typeof Reflect===_0x377271(0x11c)&&typeof Reflect['decorate']==='function')_0x58f33d=Reflect['decorate'](_0x1e10e6,_0x1aafc5,_0x10d61c,_0x40e67a);else{for(var _0x53556e=_0x1e10e6['length']-0x1;_0x53556e>=0x0;_0x53556e--)if(_0x5e9f0b=_0x1e10e6[_0x53556e])_0x58f33d=(_0x209b3e<0x3?_0x5e9f0b(_0x58f33d):_0x209b3e>0x3?_0x5e9f0b(_0x1aafc5,_0x10d61c,_0x58f33d):_0x5e9f0b(_0x1aafc5,_0x10d61c))||_0x58f33d;}return _0x209b3e>0x3&&_0x58f33d&&Object[_0x377271(0x10e)](_0x1aafc5,_0x10d61c,_0x58f33d),_0x58f33d;},__metadata=this&&this['__metadata']||function(_0x16e888,_0x1d4c12){var _0x255f69=a4_0x17bb76;if(typeof Reflect===_0x255f69(0x11c)&&typeof Reflect[_0x255f69(0x10f)]===_0x255f69(0x137))return Reflect[_0x255f69(0x10f)](_0x16e888,_0x1d4c12);};Object[a4_0x17bb76(0x10e)](exports,a4_0x17bb76(0x112),{'value':!![]}),exports['Cache']=exports['CacheService']=void 0x0,exports['json_encode']=json_encode,exports[a4_0x17bb76(0x136)]=json_decode;const cacheManager=require(a4_0x17bb76(0x125)),core_1=require(a4_0x17bb76(0x146));function a4_0x26d8(){var _0x36e7ad=['__decorate','redis','getClient','Config','json_decode','function','set','map','rpush','apply','507282aUPjxf','2561961ZOCGKd','hdel','push','store','lrange','2620860pxSozu','2730952MfpjVM','constructor','Scope','@midwayjs/core','624903kSwzzB','Provide','defineProperty','metadata','del','options','__esModule','2sGKZBr','design:type','clients','prefix','shift','1424776LmelzR','caching','has','filter','object','stores','reset','hset','CacheService','get','9puhLoe','getOwnPropertyDescriptor','(((.+)+)+)+$','cache-manager','4878895rhgqxO','undefined','Cache','lpop','config','search','cache','ScopeEnum','4MCxtxr','toString','name','Singleton'];a4_0x26d8=function(){return _0x36e7ad;};return a4_0x26d8();}let CacheService=class CacheService{constructor(){var _0x29ad97=a4_0x17bb76;this[_0x29ad97(0x12c)]=undefined,this[_0x29ad97(0x115)]=new Map();}['use'](_0x4fab59){var _0xd52445=a4_0x17bb76,_0x266fc3,_0x21dd18;if(!this[_0xd52445(0x12c)]){const _0x1c8bc8=((_0x266fc3=this[_0xd52445(0x12a)][_0xd52445(0x11d)])===null||_0x266fc3===void 0x0?void 0x0:_0x266fc3[(_0x21dd18=this[_0xd52445(0x12a)])===null||_0x21dd18===void 0x0?void 0x0:_0x21dd18['default']])||this['config'][_0xd52445(0x11d)]['file'];this[_0xd52445(0x12c)]=cacheManager[_0xd52445(0x119)]({..._0x1c8bc8[_0xd52445(0x111)],'store':_0x1c8bc8[_0xd52445(0x140)]});}return!this[_0xd52445(0x115)][_0xd52445(0x11a)](_0x4fab59)&&this['clients'][_0xd52445(0x138)](_0x4fab59,new Cache(_0x4fab59,this[_0xd52445(0x12c)])),this['clients'][_0xd52445(0x121)](_0x4fab59);}async[a4_0x17bb76(0x11e)](){var _0x39711f=a4_0x17bb76;return await this[_0x39711f(0x12c)][_0x39711f(0x11e)]();}};function a4_0x2212(_0x198af4,_0x535235){_0x198af4=_0x198af4-0x10d;var _0x32df85=a4_0x26d8();var _0x136fd9=_0x32df85[_0x198af4];return _0x136fd9;}exports[a4_0x17bb76(0x120)]=CacheService,__decorate([(0x0,core_1[a4_0x17bb76(0x135)])(a4_0x17bb76(0x12c)),__metadata(a4_0x17bb76(0x114),Object)],CacheService['prototype'],a4_0x17bb76(0x12a),void 0x0),exports[a4_0x17bb76(0x120)]=CacheService=__decorate([(0x0,core_1[a4_0x17bb76(0x10d)])(),(0x0,core_1[a4_0x17bb76(0x145)])(core_1[a4_0x17bb76(0x12d)][a4_0x17bb76(0x131)])],CacheService);class Cache{constructor(_0x74d3d9,_0x43b317){var _0x525257=a4_0x17bb76;this[_0x525257(0x12c)]=_0x43b317,this[_0x525257(0x116)]=_0x74d3d9;}async['del'](_0x2bde0d){var _0x38f643=a4_0x17bb76;return await this[_0x38f643(0x12c)][_0x38f643(0x110)](this[_0x38f643(0x116)]+':'+_0x2bde0d);}async[a4_0x17bb76(0x138)](_0x399ba9,_0x3ef41e,_0x59bcee){var _0x1bf129=a4_0x17bb76,_0x25079b,_0xc787f2;return((_0xc787f2=(_0x25079b=this['cache'])===null||_0x25079b===void 0x0?void 0x0:_0x25079b['store'])===null||_0xc787f2===void 0x0?void 0x0:_0xc787f2[_0x1bf129(0x130)])=='redis'?await this['cache']['set'](this[_0x1bf129(0x116)]+':'+_0x399ba9,_0x3ef41e,{'ttl':_0x59bcee}):await this['cache'][_0x1bf129(0x138)](this[_0x1bf129(0x116)]+':'+_0x399ba9,_0x3ef41e,{'ttl':_0x59bcee});}async[a4_0x17bb76(0x121)](_0x1242bb,_0x8a9c8d,_0x535aac){return new Promise((_0x1f1bc3,_0x3daff9)=>{var _0x23737c=a4_0x2212;this[_0x23737c(0x12c)]['get'](this[_0x23737c(0x116)]+':'+_0x1242bb,async(_0x3f94cd,_0x30f3f7)=>{var _0xfccead=_0x23737c;_0x3f94cd?_0x3daff9(_0x3f94cd):((_0x30f3f7===undefined||_0x30f3f7===null)&&(typeof _0x8a9c8d==_0xfccead(0x137)?(_0x30f3f7=await _0x8a9c8d()['catch'](_0x625492=>_0x3daff9(_0x625492)),typeof _0x30f3f7!=_0xfccead(0x127)&&await this['set'](_0x1242bb,_0x30f3f7,_0x535aac)):_0x30f3f7=_0x8a9c8d),_0x1f1bc3(_0x30f3f7));});});}async[a4_0x17bb76(0x13e)](_0x348105,_0x2e1d67){var _0x201c5a=a4_0x17bb76;return await this[_0x201c5a(0x110)](_0x348105+'#'+_0x2e1d67);}async[a4_0x17bb76(0x11f)](_0x1d8521,_0xfaa56b,_0x526896,_0xb751f4){var _0x12c2e4=a4_0x17bb76;return await this[_0x12c2e4(0x138)](_0x1d8521+'#'+_0xfaa56b,_0x526896,_0xb751f4);}async['hget'](_0x2f4b17,_0x368dd8,_0x497777,_0x4c7c8e){var _0x12af0f=a4_0x17bb76;return await this[_0x12af0f(0x121)](_0x2f4b17+'#'+_0x368dd8,_0x497777,_0x4c7c8e);}['list'](_0x35e985){const _0x47b917={'all':async()=>{var _0x1a6286=a4_0x2212,_0x59612d,_0x2d6d93,_0x458a75,_0x537991,_0x3dd008;return((_0x2d6d93=(_0x59612d=this[_0x1a6286(0x12c)])===null||_0x59612d===void 0x0?void 0x0:_0x59612d[_0x1a6286(0x140)])===null||_0x2d6d93===void 0x0?void 0x0:_0x2d6d93[_0x1a6286(0x130)])==_0x1a6286(0x133)?(await((_0x3dd008=(_0x537991=(_0x458a75=this===null||this===void 0x0?void 0x0:this['cache'])===null||_0x458a75===void 0x0?void 0x0:_0x458a75[_0x1a6286(0x140)])===null||_0x537991===void 0x0?void 0x0:_0x537991[_0x1a6286(0x134)]())===null||_0x3dd008===void 0x0?void 0x0:_0x3dd008[_0x1a6286(0x141)](this['prefix']+':'+_0x35e985,0x0,-0x1))||[])[_0x1a6286(0x139)](_0x3b7561=>json_decode(_0x3b7561)):await this[_0x1a6286(0x121)](_0x35e985,[]);},'pop':async()=>{var _0x576829=a4_0x2212,_0x3b1494,_0x5eb803,_0x53d925,_0x4adbcb,_0x499f80;if(((_0x5eb803=(_0x3b1494=this[_0x576829(0x12c)])===null||_0x3b1494===void 0x0?void 0x0:_0x3b1494[_0x576829(0x140)])===null||_0x5eb803===void 0x0?void 0x0:_0x5eb803[_0x576829(0x130)])=='redis')return json_decode(await((_0x499f80=(_0x4adbcb=(_0x53d925=this===null||this===void 0x0?void 0x0:this[_0x576829(0x12c)])===null||_0x53d925===void 0x0?void 0x0:_0x53d925[_0x576829(0x140)])===null||_0x4adbcb===void 0x0?void 0x0:_0x4adbcb[_0x576829(0x134)]())===null||_0x499f80===void 0x0?void 0x0:_0x499f80[_0x576829(0x129)](this['prefix']+':'+_0x35e985)));else{let _0x4c132f=await this[_0x576829(0x121)](_0x35e985,[]),_0x583b51=_0x4c132f[_0x576829(0x117)]();return await this['set'](_0x35e985,_0x4c132f),_0x583b51;}},'push':async(..._0x59b30f)=>{var _0x1b6cf3=a4_0x2212,_0x5ba4aa,_0x1582ac,_0x26ead4,_0x490846,_0x737df4;const _0x56dc9e=_0x59b30f[_0x1b6cf3(0x11b)](_0x31b02a=>_0x31b02a!==undefined&&_0x31b02a!==null);if(((_0x1582ac=(_0x5ba4aa=this[_0x1b6cf3(0x12c)])===null||_0x5ba4aa===void 0x0?void 0x0:_0x5ba4aa[_0x1b6cf3(0x140)])===null||_0x1582ac===void 0x0?void 0x0:_0x1582ac[_0x1b6cf3(0x130)])==_0x1b6cf3(0x133))return await((_0x737df4=(_0x490846=(_0x26ead4=this===null||this===void 0x0?void 0x0:this[_0x1b6cf3(0x12c)])===null||_0x26ead4===void 0x0?void 0x0:_0x26ead4[_0x1b6cf3(0x140)])===null||_0x490846===void 0x0?void 0x0:_0x490846[_0x1b6cf3(0x134)]())===null||_0x737df4===void 0x0?void 0x0:_0x737df4[_0x1b6cf3(0x13a)](this[_0x1b6cf3(0x116)]+':'+_0x35e985,..._0x56dc9e[_0x1b6cf3(0x139)](_0x183135=>json_encode(_0x183135)))),_0x56dc9e;else{let _0x5e1a65=await this[_0x1b6cf3(0x121)](_0x35e985,[]);return _0x5e1a65[_0x1b6cf3(0x13f)](..._0x56dc9e),await this[_0x1b6cf3(0x138)](_0x35e985,_0x5e1a65),_0x5e1a65;}}};return _0x47b917;}}exports[a4_0x17bb76(0x128)]=Cache;function json_encode(_0x420d1c){try{return JSON['stringify'](_0x420d1c);}catch(_0x47cd6f){return undefined;}}function json_decode(_0x17f1af){try{return JSON['parse'](_0x17f1af);}catch(_0x25b744){return undefined;}}
package/package.json CHANGED
@@ -1,6 +1,29 @@
1
- {
2
- "name": "@anveroapi/cache",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
1
+ {
2
+ "name": "@anveroapi/cache",
3
+ "version": "3.0.0",
4
+ "main": "./dist/index.js",
5
+ "license": "MIT",
6
+ "files": [
7
+ "dist"
8
+ ],
9
+ "publishConfig": {
10
+ "access": "public",
11
+ "registry": "https://registry.npmjs.org/"
12
+ },
13
+ "scripts": {
14
+ "build2": "tsc",
15
+ "build": "tsc && javascript-obfuscator ./dist --output ./dist --config obfuscator.json"
16
+ },
17
+ "dependencies": {
18
+ "@midwayjs/core": "^3.17.1",
19
+ "cache-manager": "^3.6.3",
20
+ "cache-manager-fs-hash": "^1.0.0",
21
+ "cache-manager-ioredis": "^2.1.0"
22
+ },
23
+ "devDependencies": {
24
+ "@types/node": "20.10.0",
25
+ "javascript-obfuscator": "^4.0.2",
26
+ "typescript": "~5.9.3"
27
+ },
28
+ "gitHead": "f7d4644d5e0591c4b383021edab6db20d1714880"
29
+ }
package/README.md DELETED
@@ -1,3 +0,0 @@
1
- # Temporary Holding Version
2
-
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.