@anveroapi/cache 0.0.0-stage → 3.0.2

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_0x361027=a0_0x5efd;function a0_0x54ae(){const _0x42924=['4UgYRZo','11334IOEUGD','toString','env','search','10tEGJLH','memory','file','__esModule','1177tseeQH','127.0.0.1','constructor','9056WABXSI','default','defineProperty','cache-manager-ioredis','267580kgMQxZ','827008xzGxAC','/runtime/.cache','apply','40791PnbKJd','6471EUVBuQ','cache-manager-fs-hash','162312AXKXLK','1352ZVPDVM','name','3540078PnaAzl'];a0_0x54ae=function(){return _0x42924;};return a0_0x54ae();}(function(_0x327531,_0x3dc984){const _0x3f5494=a0_0x5efd,_0x49418f=_0x327531();while(!![]){try{const _0xd0281a=parseInt(_0x3f5494(0x141))/0x1*(parseInt(_0x3f5494(0x148))/0x2)+parseInt(_0x3f5494(0x149))/0x3*(parseInt(_0x3f5494(0x145))/0x4)+parseInt(_0x3f5494(0x14d))/0x5*(-parseInt(_0x3f5494(0x147))/0x6)+-parseInt(_0x3f5494(0x13e))/0x7+-parseInt(_0x3f5494(0x139))/0x8*(parseInt(_0x3f5494(0x142))/0x9)+-parseInt(_0x3f5494(0x13d))/0xa+parseInt(_0x3f5494(0x136))/0xb*(parseInt(_0x3f5494(0x144))/0xc);if(_0xd0281a===_0x3dc984)break;else _0x49418f['push'](_0x49418f['shift']());}catch(_0x2b9150){_0x49418f['push'](_0x49418f['shift']());}}}(a0_0x54ae,0xa2d70));const a0_0x39515e=(function(){let _0x4bc488=!![];return function(_0x521615,_0x32748f){const _0x1219a1=_0x4bc488?function(){const _0x394f0=a0_0x5efd;if(_0x32748f){const _0x493287=_0x32748f[_0x394f0(0x140)](_0x521615,arguments);return _0x32748f=null,_0x493287;}}:function(){};return _0x4bc488=![],_0x1219a1;};}()),a0_0x944bf6=a0_0x39515e(this,function(){const _0x55e2ed=a0_0x5efd;return a0_0x944bf6[_0x55e2ed(0x14a)]()[_0x55e2ed(0x14c)]('(((.+)+)+)+$')[_0x55e2ed(0x14a)]()[_0x55e2ed(0x138)](a0_0x944bf6)[_0x55e2ed(0x14c)]('(((.+)+)+)+$');});a0_0x944bf6();function a0_0x5efd(_0x39db9c,_0x303e6d){_0x39db9c=_0x39db9c-0x134;const _0xb9e597=a0_0x54ae();let _0x944bf6=_0xb9e597[_0x39db9c];return _0x944bf6;}'use strict';Object[a0_0x361027(0x13b)](exports,a0_0x361027(0x135),{'value':!![]});const fsStore=require(a0_0x361027(0x143)),redisStore=require(a0_0x361027(0x13c));exports[a0_0x361027(0x13a)]=_0xe04f6f=>{const _0x58c918=a0_0x361027;return{'cache':{'default':_0x58c918(0x134),'stores':{'file':{'store':fsStore,'options':{'subdirs':![],'path':_0xe04f6f['appDir']+_0x58c918(0x13f)+((_0xe04f6f===null||_0xe04f6f===void 0x0?void 0x0:_0xe04f6f[_0x58c918(0x14b)])?'-'+_0xe04f6f[_0x58c918(0x14b)]:'')}},'redis':{'store':redisStore,'options':{'port':0x18eb,'host':_0x58c918(0x137),'password':'','keyPrefix':_0xe04f6f[_0x58c918(0x146)]+':'+((_0xe04f6f===null||_0xe04f6f===void 0x0?void 0x0:_0xe04f6f[_0x58c918(0x14b)])?_0xe04f6f['env']+':':'')}},'memory':{'store':_0x58c918(0x14e),'options':{'max':0x64}}}}};};
@@ -0,0 +1,2 @@
1
+ export declare class CustomConfiguration {
2
+ }
@@ -0,0 +1 @@
1
+ function a1_0x1319(){var _0x35545f=['toString','2723UENomI','./config/config.default','constructor','2xreEsQ','__esModule','9824GxjviZ','753111OAGZdR','search','decorate','(((.+)+)+)+$','apply','function','defineProperty','object','@midwayjs/core','377652MRzyQy','getOwnPropertyDescriptor','5378164YQxjMV','6McMhoR','anvero-api:cache','1582888OBgxwV','10npLFep','length','97905CoLjrr','__decorate','CustomConfiguration','644916jZxSOA'];a1_0x1319=function(){return _0x35545f;};return a1_0x1319();}var a1_0x205917=a1_0x285b;function a1_0x285b(_0x10548f,_0x13d204){_0x10548f=_0x10548f-0xea;var _0x16781f=a1_0x1319();var _0x3a438c=_0x16781f[_0x10548f];return _0x3a438c;}(function(_0x2dd3a7,_0x3074f4){var _0x296316=a1_0x285b,_0x7d1a96=_0x2dd3a7();while(!![]){try{var _0x20fa78=parseInt(_0x296316(0xee))/0x1+-parseInt(_0x296316(0xfe))/0x2*(-parseInt(_0x296316(0xf9))/0x3)+-parseInt(_0x296316(0xf3))/0x4+-parseInt(_0x296316(0xf6))/0x5*(-parseInt(_0x296316(0xf1))/0x6)+-parseInt(_0x296316(0xfb))/0x7*(parseInt(_0x296316(0x100))/0x8)+parseInt(_0x296316(0x101))/0x9*(parseInt(_0x296316(0xf4))/0xa)+parseInt(_0x296316(0xf0))/0xb;if(_0x20fa78===_0x3074f4)break;else _0x7d1a96['push'](_0x7d1a96['shift']());}catch(_0x24c026){_0x7d1a96['push'](_0x7d1a96['shift']());}}}(a1_0x1319,0x4c062));var a1_0x34ed40=(function(){var _0x23f6ce=!![];return function(_0x13399e,_0x175603){var _0x11acba=_0x23f6ce?function(){var _0x5d5e94=a1_0x285b;if(_0x175603){var _0x7c9c7=_0x175603[_0x5d5e94(0x105)](_0x13399e,arguments);return _0x175603=null,_0x7c9c7;}}:function(){};return _0x23f6ce=![],_0x11acba;};}()),a1_0x3a438c=a1_0x34ed40(this,function(){var _0x39c8e5=a1_0x285b;return a1_0x3a438c[_0x39c8e5(0xfa)]()[_0x39c8e5(0x102)](_0x39c8e5(0x104))[_0x39c8e5(0xfa)]()[_0x39c8e5(0xfd)](a1_0x3a438c)[_0x39c8e5(0x102)](_0x39c8e5(0x104));});a1_0x3a438c();'use strict';var __decorate=this&&this[a1_0x205917(0xf7)]||function(_0x48adc7,_0x809310,_0x37365a,_0x3729e4){var _0x3bb617=a1_0x205917,_0x50260b=arguments[_0x3bb617(0xf5)],_0x577acf=_0x50260b<0x3?_0x809310:_0x3729e4===null?_0x3729e4=Object[_0x3bb617(0xef)](_0x809310,_0x37365a):_0x3729e4,_0x3e45d7;if(typeof Reflect===_0x3bb617(0xec)&&typeof Reflect[_0x3bb617(0x103)]===_0x3bb617(0xea))_0x577acf=Reflect[_0x3bb617(0x103)](_0x48adc7,_0x809310,_0x37365a,_0x3729e4);else{for(var _0x1ff9cd=_0x48adc7['length']-0x1;_0x1ff9cd>=0x0;_0x1ff9cd--)if(_0x3e45d7=_0x48adc7[_0x1ff9cd])_0x577acf=(_0x50260b<0x3?_0x3e45d7(_0x577acf):_0x50260b>0x3?_0x3e45d7(_0x809310,_0x37365a,_0x577acf):_0x3e45d7(_0x809310,_0x37365a))||_0x577acf;}return _0x50260b>0x3&&_0x577acf&&Object['defineProperty'](_0x809310,_0x37365a,_0x577acf),_0x577acf;};Object[a1_0x205917(0xeb)](exports,a1_0x205917(0xff),{'value':!![]}),exports[a1_0x205917(0xf8)]=void 0x0;const core_1=require(a1_0x205917(0xed)),ConfigDefault=require(a1_0x205917(0xfc));let CustomConfiguration=class CustomConfiguration{};exports['CustomConfiguration']=CustomConfiguration,exports['CustomConfiguration']=CustomConfiguration=__decorate([(0x0,core_1['Configuration'])({'conflictCheck':![],'namespace':a1_0x205917(0xf2),'importConfigs':[{'default':ConfigDefault}]})],CustomConfiguration);
@@ -0,0 +1 @@
1
+ export declare function Cache(key?: string, ttl?: number): MethodDecorator;
@@ -0,0 +1 @@
1
+ const a2_0x1313e2=a2_0x2c30;(function(_0x4314b8,_0x47d0a4){const _0x14c109=a2_0x2c30,_0x426109=_0x4314b8();while(!![]){try{const _0x2c7620=-parseInt(_0x14c109(0x88))/0x1+-parseInt(_0x14c109(0x76))/0x2+parseInt(_0x14c109(0x79))/0x3*(parseInt(_0x14c109(0x75))/0x4)+parseInt(_0x14c109(0x81))/0x5*(parseInt(_0x14c109(0x73))/0x6)+-parseInt(_0x14c109(0x8f))/0x7+parseInt(_0x14c109(0x87))/0x8+parseInt(_0x14c109(0x74))/0x9*(parseInt(_0x14c109(0x7c))/0xa);if(_0x2c7620===_0x47d0a4)break;else _0x426109['push'](_0x426109['shift']());}catch(_0x1f2f51){_0x426109['push'](_0x426109['shift']());}}}(a2_0x3cf3,0xe02d6));const a2_0x44d8eb=(function(){let _0x86ea65=!![];return function(_0x26d423,_0x1aaf53){const _0x115d8f=_0x86ea65?function(){if(_0x1aaf53){const _0x3fd4d9=_0x1aaf53['apply'](_0x26d423,arguments);return _0x1aaf53=null,_0x3fd4d9;}}:function(){};return _0x86ea65=![],_0x115d8f;};}()),a2_0xf1a7da=a2_0x44d8eb(this,function(){const _0x308e93=a2_0x2c30;return a2_0xf1a7da[_0x308e93(0x7a)]()[_0x308e93(0x8a)](_0x308e93(0x89))['toString']()[_0x308e93(0x7f)](a2_0xf1a7da)['search'](_0x308e93(0x89));});function a2_0x2c30(_0xa88a21,_0x594a4a){_0xa88a21=_0xa88a21-0x73;const _0x4c2c8a=a2_0x3cf3();let _0xf1a7da=_0x4c2c8a[_0xa88a21];return _0xf1a7da;}a2_0xf1a7da();'use strict';function a2_0x3cf3(){const _0x173fbc=['apply','REQUEST_OBJ_CTX_KEY','2482270TrNgMc','set','215868ScDzWx','990837KCWUUm','14604aaskqt','1219944yFahTA','defineProperty','stringify','102xsCzJZ','toString','parse','30ZtzLyx','../service/CacheService','get','constructor','MD5','5MJfiUa','use','value','app','crypto-js','getApplicationContext','13841552lOrHlO','337773ibaYwt','(((.+)+)+)+$','search','__esModule','Cache'];a2_0x3cf3=function(){return _0x173fbc;};return a2_0x3cf3();}Object[a2_0x1313e2(0x77)](exports,a2_0x1313e2(0x8b),{'value':!![]}),exports[a2_0x1313e2(0x8c)]=Cache;const crypto_js_1=require(a2_0x1313e2(0x85)),CacheService_1=require(a2_0x1313e2(0x7d)),core_1=require('@midwayjs/core');function json_encode(_0x5ee414){const _0x4754f3=a2_0x1313e2;try{return JSON[_0x4754f3(0x78)](_0x5ee414);}catch(_0x139057){return undefined;}}function Cache(_0x143f0c,_0xa37aca){return(_0x1f3c5c,_0x47757a,_0x802d96)=>{const _0x4988ce=a2_0x2c30,_0x1f91f1=_0x802d96[_0x4988ce(0x83)];return _0x802d96['value']=async function(..._0x576030){const _0x4b6e40=_0x4988ce;_0x143f0c=(_0x143f0c?''+_0x143f0c:''+(_0x47757a||''))+'.'+(0x0,crypto_js_1[_0x4b6e40(0x80)])(json_encode(_0x576030))[_0x4b6e40(0x7a)]();let _0x4ef6ce=await this[core_1[_0x4b6e40(0x8e)]][_0x4b6e40(0x84)][_0x4b6e40(0x86)]()['getAsync'](CacheService_1['CacheService']),_0x2748cb=await _0x4ef6ce[_0x4b6e40(0x82)]('Method::Decorator')[_0x4b6e40(0x7e)](_0x143f0c);if(_0x2748cb)return JSON[_0x4b6e40(0x7b)](_0x2748cb);else _0x2748cb=await _0x1f91f1[_0x4b6e40(0x8d)](this,[..._0x576030]),await _0x4ef6ce[_0x4b6e40(0x82)]('Method::Decorator')[_0x4b6e40(0x90)](_0x143f0c,JSON[_0x4b6e40(0x78)](_0x2748cb),_0xa37aca);return _0x2748cb;},_0x802d96;};}
@@ -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_0x3d030e=a3_0x4ad4;(function(_0x58e23a,_0x4ac849){var _0x3159d4=a3_0x4ad4,_0x4ff3f6=_0x58e23a();while(!![]){try{var _0x2b59c7=parseInt(_0x3159d4(0x18d))/0x1*(-parseInt(_0x3159d4(0x18e))/0x2)+-parseInt(_0x3159d4(0x18b))/0x3*(parseInt(_0x3159d4(0x183))/0x4)+parseInt(_0x3159d4(0x191))/0x5*(-parseInt(_0x3159d4(0x18f))/0x6)+-parseInt(_0x3159d4(0x180))/0x7*(parseInt(_0x3159d4(0x18a))/0x8)+parseInt(_0x3159d4(0x185))/0x9+parseInt(_0x3159d4(0x192))/0xa+parseInt(_0x3159d4(0x184))/0xb;if(_0x2b59c7===_0x4ac849)break;else _0x4ff3f6['push'](_0x4ff3f6['shift']());}catch(_0x40a531){_0x4ff3f6['push'](_0x4ff3f6['shift']());}}}(a3_0x5371,0x81733));var a3_0x6f07dc=(function(){var _0x186110=!![];return function(_0x5330d1,_0x426e17){var _0x3b661a=_0x186110?function(){var _0x49bd21=a3_0x4ad4;if(_0x426e17){var _0x27b8fb=_0x426e17[_0x49bd21(0x17f)](_0x5330d1,arguments);return _0x426e17=null,_0x27b8fb;}}:function(){};return _0x186110=![],_0x3b661a;};}()),a3_0x1b9830=a3_0x6f07dc(this,function(){var _0x264cbd=a3_0x4ad4;return a3_0x1b9830['toString']()[_0x264cbd(0x181)](_0x264cbd(0x186))[_0x264cbd(0x190)]()['constructor'](a3_0x1b9830)[_0x264cbd(0x181)]('(((.+)+)+)+$');});function a3_0x4ad4(_0x3ebd9b,_0x1877fb){_0x3ebd9b=_0x3ebd9b-0x17c;var _0x45e6bf=a3_0x5371();var _0x1b9830=_0x45e6bf[_0x3ebd9b];return _0x1b9830;}a3_0x1b9830();'use strict';Object[a3_0x3d030e(0x17d)](exports,a3_0x3d030e(0x187),{'value':!![]}),exports[a3_0x3d030e(0x17c)]=exports[a3_0x3d030e(0x17e)]=exports[a3_0x3d030e(0x189)]=void 0x0;var configuration_1=require(a3_0x3d030e(0x182));Object[a3_0x3d030e(0x17d)](exports,a3_0x3d030e(0x189),{'enumerable':!![],'get':function(){return configuration_1['CustomConfiguration'];}});var Cache_1=require(a3_0x3d030e(0x188));function a3_0x5371(){var _0x2ac469=['toString','1465PWWjGX','5933250xusWaN','CacheService','defineProperty','Cache','apply','21igqGzM','search','./configuration','1550492CwvSXQ','28323988uFpKKZ','5533335ajZYKf','(((.+)+)+)+$','__esModule','./decorator/Cache','Configuration','2538280Muzyjw','6AFtqzJ','./service/CacheService','1qjfdJe','1645626Egwyag','14394Dulmzu'];a3_0x5371=function(){return _0x2ac469;};return a3_0x5371();}Object[a3_0x3d030e(0x17d)](exports,a3_0x3d030e(0x17e),{'enumerable':!![],'get':function(){var _0x59d9cf=a3_0x3d030e;return Cache_1[_0x59d9cf(0x17e)];}});var CacheService_1=require(a3_0x3d030e(0x18c));Object[a3_0x3d030e(0x17d)](exports,a3_0x3d030e(0x17c),{'enumerable':!![],'get':function(){var _0x48f232=a3_0x3d030e;return CacheService_1[_0x48f232(0x17c)];}});
@@ -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_0x2f8204=a4_0x2ba8;function a4_0x2ba8(_0x4b6676,_0x1d662c){_0x4b6676=_0x4b6676-0xb1;var _0x3859fc=a4_0x5ec4();var _0x29421b=_0x3859fc[_0x4b6676];return _0x29421b;}(function(_0x125a77,_0x437555){var _0x1eff94=a4_0x2ba8,_0x49b225=_0x125a77();while(!![]){try{var _0x559d5e=-parseInt(_0x1eff94(0xb8))/0x1*(-parseInt(_0x1eff94(0xdb))/0x2)+-parseInt(_0x1eff94(0xc8))/0x3+-parseInt(_0x1eff94(0xe9))/0x4+-parseInt(_0x1eff94(0xd3))/0x5*(parseInt(_0x1eff94(0xb9))/0x6)+parseInt(_0x1eff94(0xd7))/0x7*(-parseInt(_0x1eff94(0xb4))/0x8)+parseInt(_0x1eff94(0xea))/0x9+parseInt(_0x1eff94(0xe7))/0xa;if(_0x559d5e===_0x437555)break;else _0x49b225['push'](_0x49b225['shift']());}catch(_0x6235de){_0x49b225['push'](_0x49b225['shift']());}}}(a4_0x5ec4,0xa1a5d));var a4_0xab2aab=(function(){var _0x559512=!![];return function(_0x1fd017,_0xa7b02a){var _0xc56c19=_0x559512?function(){var _0x33a28d=a4_0x2ba8;if(_0xa7b02a){var _0x2a7205=_0xa7b02a[_0x33a28d(0xb1)](_0x1fd017,arguments);return _0xa7b02a=null,_0x2a7205;}}:function(){};return _0x559512=![],_0xc56c19;};}()),a4_0x29421b=a4_0xab2aab(this,function(){var _0x280d65=a4_0x2ba8;return a4_0x29421b['toString']()[_0x280d65(0xc2)](_0x280d65(0xc0))['toString']()['constructor'](a4_0x29421b)[_0x280d65(0xc2)](_0x280d65(0xc0));});a4_0x29421b();'use strict';var __decorate=this&&this[a4_0x2f8204(0xcf)]||function(_0x187280,_0x24c6a2,_0xd1d010,_0x218e4c){var _0x2a1294=a4_0x2f8204,_0x1ea654=arguments[_0x2a1294(0xd0)],_0x816825=_0x1ea654<0x3?_0x24c6a2:_0x218e4c===null?_0x218e4c=Object['getOwnPropertyDescriptor'](_0x24c6a2,_0xd1d010):_0x218e4c,_0x28cf04;if(typeof Reflect==='object'&&typeof Reflect[_0x2a1294(0xc4)]==='function')_0x816825=Reflect[_0x2a1294(0xc4)](_0x187280,_0x24c6a2,_0xd1d010,_0x218e4c);else{for(var _0x597a0e=_0x187280['length']-0x1;_0x597a0e>=0x0;_0x597a0e--)if(_0x28cf04=_0x187280[_0x597a0e])_0x816825=(_0x1ea654<0x3?_0x28cf04(_0x816825):_0x1ea654>0x3?_0x28cf04(_0x24c6a2,_0xd1d010,_0x816825):_0x28cf04(_0x24c6a2,_0xd1d010))||_0x816825;}return _0x1ea654>0x3&&_0x816825&&Object['defineProperty'](_0x24c6a2,_0xd1d010,_0x816825),_0x816825;},__metadata=this&&this[a4_0x2f8204(0xd9)]||function(_0x513df6,_0x3ef929){var _0x50fbb4=a4_0x2f8204;if(typeof Reflect===_0x50fbb4(0xb6)&&typeof Reflect[_0x50fbb4(0xce)]===_0x50fbb4(0xde))return Reflect[_0x50fbb4(0xce)](_0x513df6,_0x3ef929);};Object['defineProperty'](exports,a4_0x2f8204(0xc1),{'value':!![]}),exports[a4_0x2f8204(0xe8)]=exports['CacheService']=void 0x0,exports['json_encode']=json_encode,exports['json_decode']=json_decode;function a4_0x5ec4(){var _0x4be40e=['CacheService','del','store','(((.+)+)+)+$','__esModule','search','lpop','decorate','prefix','name','map','3758214HWMQwk','hget','config','redis','cache-manager','list','metadata','__decorate','length','getClient','prototype','6002410xHWfoB','clients','stores','cache','21EmBymZ','caching','__metadata','default','1440064XJpkWY','reset','Scope','function','use','filter','shift','stringify','catch','set','options','Singleton','27441880JHwGAv','Cache','4118032AujNIP','8443314hduOpd','apply','get','hdel','686744opdFke','file','object','push','1PqtzrG','6adlMIT','@midwayjs/core','lrange','has'];a4_0x5ec4=function(){return _0x4be40e;};return a4_0x5ec4();}const cacheManager=require(a4_0x2f8204(0xcc)),core_1=require(a4_0x2f8204(0xba));let CacheService=class CacheService{constructor(){var _0x2813b2=a4_0x2f8204;this['cache']=undefined,this[_0x2813b2(0xd4)]=new Map();}[a4_0x2f8204(0xdf)](_0x131144){var _0x38513c=a4_0x2f8204,_0x4e49f0,_0x16c6ca;if(!this[_0x38513c(0xd6)]){const _0x2dc559=((_0x4e49f0=this[_0x38513c(0xca)][_0x38513c(0xd5)])===null||_0x4e49f0===void 0x0?void 0x0:_0x4e49f0[(_0x16c6ca=this[_0x38513c(0xca)])===null||_0x16c6ca===void 0x0?void 0x0:_0x16c6ca[_0x38513c(0xda)]])||this['config'][_0x38513c(0xd5)][_0x38513c(0xb5)];this[_0x38513c(0xd6)]=cacheManager[_0x38513c(0xd8)]({..._0x2dc559[_0x38513c(0xe5)],'store':_0x2dc559[_0x38513c(0xbf)]});}return!this[_0x38513c(0xd4)][_0x38513c(0xbc)](_0x131144)&&this[_0x38513c(0xd4)][_0x38513c(0xe4)](_0x131144,new Cache(_0x131144,this['cache'])),this[_0x38513c(0xd4)][_0x38513c(0xb2)](_0x131144);}async[a4_0x2f8204(0xdc)](){var _0x1ca38a=a4_0x2f8204;return await this[_0x1ca38a(0xd6)][_0x1ca38a(0xdc)]();}};exports[a4_0x2f8204(0xbd)]=CacheService,__decorate([(0x0,core_1['Config'])('cache'),__metadata('design:type',Object)],CacheService[a4_0x2f8204(0xd2)],a4_0x2f8204(0xca),void 0x0),exports['CacheService']=CacheService=__decorate([(0x0,core_1['Provide'])(),(0x0,core_1[a4_0x2f8204(0xdd)])(core_1['ScopeEnum'][a4_0x2f8204(0xe6)])],CacheService);class Cache{constructor(_0x12c843,_0x23c0a6){var _0x232455=a4_0x2f8204;this['cache']=_0x23c0a6,this[_0x232455(0xc5)]=_0x12c843;}async['del'](_0x386f75){var _0x4fe5c0=a4_0x2f8204;return await this[_0x4fe5c0(0xd6)][_0x4fe5c0(0xbe)](this[_0x4fe5c0(0xc5)]+':'+_0x386f75);}async[a4_0x2f8204(0xe4)](_0x5c4641,_0x5b5c98,_0x11bcea){var _0x56df43=a4_0x2f8204,_0x261266,_0x20bd7f;return((_0x20bd7f=(_0x261266=this[_0x56df43(0xd6)])===null||_0x261266===void 0x0?void 0x0:_0x261266['store'])===null||_0x20bd7f===void 0x0?void 0x0:_0x20bd7f[_0x56df43(0xc6)])==_0x56df43(0xcb)?await this[_0x56df43(0xd6)][_0x56df43(0xe4)](this[_0x56df43(0xc5)]+':'+_0x5c4641,_0x5b5c98,{'ttl':_0x11bcea}):await this['cache']['set'](this['prefix']+':'+_0x5c4641,_0x5b5c98,{'ttl':_0x11bcea});}async[a4_0x2f8204(0xb2)](_0x3943b2,_0x2e7810,_0x5edc4a){return new Promise((_0x4ed58a,_0x480e23)=>{var _0x39a550=a4_0x2ba8;this[_0x39a550(0xd6)][_0x39a550(0xb2)](this['prefix']+':'+_0x3943b2,async(_0x327557,_0x2ddcf1)=>{var _0x2f17ba=_0x39a550;_0x327557?_0x480e23(_0x327557):((_0x2ddcf1===undefined||_0x2ddcf1===null)&&(typeof _0x2e7810=='function'?(_0x2ddcf1=await _0x2e7810()[_0x2f17ba(0xe3)](_0x5f2d7c=>_0x480e23(_0x5f2d7c)),typeof _0x2ddcf1!='undefined'&&await this[_0x2f17ba(0xe4)](_0x3943b2,_0x2ddcf1,_0x5edc4a)):_0x2ddcf1=_0x2e7810),_0x4ed58a(_0x2ddcf1));});});}async[a4_0x2f8204(0xb3)](_0xf94d40,_0x37ebf6){var _0x39acd3=a4_0x2f8204;return await this[_0x39acd3(0xbe)](_0xf94d40+'#'+_0x37ebf6);}async['hset'](_0x5acc7c,_0x47e543,_0x1cb3e0,_0x5ba45e){var _0x53a62f=a4_0x2f8204;return await this[_0x53a62f(0xe4)](_0x5acc7c+'#'+_0x47e543,_0x1cb3e0,_0x5ba45e);}async[a4_0x2f8204(0xc9)](_0x243ea7,_0x421893,_0x2e4a91,_0x94824f){return await this['get'](_0x243ea7+'#'+_0x421893,_0x2e4a91,_0x94824f);}[a4_0x2f8204(0xcd)](_0x7ddee9){const _0x2d245a={'all':async()=>{var _0x538f37=a4_0x2ba8,_0x1507cf,_0x1d8d64,_0x40b5ee,_0x1328c8,_0x6752ab;return((_0x1d8d64=(_0x1507cf=this[_0x538f37(0xd6)])===null||_0x1507cf===void 0x0?void 0x0:_0x1507cf[_0x538f37(0xbf)])===null||_0x1d8d64===void 0x0?void 0x0:_0x1d8d64['name'])==_0x538f37(0xcb)?(await((_0x6752ab=(_0x1328c8=(_0x40b5ee=this===null||this===void 0x0?void 0x0:this['cache'])===null||_0x40b5ee===void 0x0?void 0x0:_0x40b5ee[_0x538f37(0xbf)])===null||_0x1328c8===void 0x0?void 0x0:_0x1328c8[_0x538f37(0xd1)]())===null||_0x6752ab===void 0x0?void 0x0:_0x6752ab[_0x538f37(0xbb)](this['prefix']+':'+_0x7ddee9,0x0,-0x1))||[])[_0x538f37(0xc7)](_0x25de58=>json_decode(_0x25de58)):await this['get'](_0x7ddee9,[]);},'pop':async()=>{var _0xde5909=a4_0x2ba8,_0x109e08,_0x341cd8,_0x26b27a,_0x4cd794,_0x40d338;if(((_0x341cd8=(_0x109e08=this[_0xde5909(0xd6)])===null||_0x109e08===void 0x0?void 0x0:_0x109e08[_0xde5909(0xbf)])===null||_0x341cd8===void 0x0?void 0x0:_0x341cd8[_0xde5909(0xc6)])=='redis')return json_decode(await((_0x40d338=(_0x4cd794=(_0x26b27a=this===null||this===void 0x0?void 0x0:this[_0xde5909(0xd6)])===null||_0x26b27a===void 0x0?void 0x0:_0x26b27a[_0xde5909(0xbf)])===null||_0x4cd794===void 0x0?void 0x0:_0x4cd794[_0xde5909(0xd1)]())===null||_0x40d338===void 0x0?void 0x0:_0x40d338[_0xde5909(0xc3)](this[_0xde5909(0xc5)]+':'+_0x7ddee9)));else{let _0x1ca238=await this[_0xde5909(0xb2)](_0x7ddee9,[]),_0x2b28ab=_0x1ca238[_0xde5909(0xe1)]();return await this[_0xde5909(0xe4)](_0x7ddee9,_0x1ca238),_0x2b28ab;}},'push':async(..._0x379cff)=>{var _0x1e2c6e=a4_0x2ba8,_0x4b1909,_0x25ef66,_0x1020bb,_0x5b72b2,_0x4dc30c;const _0x3a57ab=_0x379cff[_0x1e2c6e(0xe0)](_0x33771c=>_0x33771c!==undefined&&_0x33771c!==null);if(((_0x25ef66=(_0x4b1909=this[_0x1e2c6e(0xd6)])===null||_0x4b1909===void 0x0?void 0x0:_0x4b1909[_0x1e2c6e(0xbf)])===null||_0x25ef66===void 0x0?void 0x0:_0x25ef66[_0x1e2c6e(0xc6)])=='redis')return await((_0x4dc30c=(_0x5b72b2=(_0x1020bb=this===null||this===void 0x0?void 0x0:this[_0x1e2c6e(0xd6)])===null||_0x1020bb===void 0x0?void 0x0:_0x1020bb[_0x1e2c6e(0xbf)])===null||_0x5b72b2===void 0x0?void 0x0:_0x5b72b2['getClient']())===null||_0x4dc30c===void 0x0?void 0x0:_0x4dc30c['rpush'](this[_0x1e2c6e(0xc5)]+':'+_0x7ddee9,..._0x3a57ab[_0x1e2c6e(0xc7)](_0x162a0f=>json_encode(_0x162a0f)))),_0x3a57ab;else{let _0x43db5a=await this['get'](_0x7ddee9,[]);return _0x43db5a[_0x1e2c6e(0xb7)](..._0x3a57ab),await this[_0x1e2c6e(0xe4)](_0x7ddee9,_0x43db5a),_0x43db5a;}}};return _0x2d245a;}}exports[a4_0x2f8204(0xe8)]=Cache;function json_encode(_0x3fdbf1){var _0x1ad0e2=a4_0x2f8204;try{return JSON[_0x1ad0e2(0xe2)](_0x3fdbf1);}catch(_0x5780c9){return undefined;}}function json_decode(_0x3b40ea){try{return JSON['parse'](_0x3b40ea);}catch(_0x4b5d17){return undefined;}}
package/package.json CHANGED
@@ -1,6 +1,29 @@
1
1
  {
2
2
  "name": "@anveroapi/cache",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "3.0.2",
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
+ "dependencies": {
14
+ "@midwayjs/core": "^3.17.1",
15
+ "cache-manager": "^3.6.3",
16
+ "cache-manager-fs-hash": "^1.0.0",
17
+ "cache-manager-ioredis": "^2.1.0"
18
+ },
19
+ "devDependencies": {
20
+ "@types/node": "20.10.0",
21
+ "javascript-obfuscator": "^4.0.2",
22
+ "typescript": "~5.9.3"
23
+ },
24
+ "gitHead": "f7d4644d5e0591c4b383021edab6db20d1714880",
25
+ "scripts": {
26
+ "build2": "tsc",
27
+ "build": "tsc && javascript-obfuscator ./dist --output ./dist --config obfuscator.json"
28
+ }
6
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.