@hotmeshio/hotmesh
Version:
Serverless Workflow
1 lines • 8.26 kB
JavaScript
const n=b;(function(c,d){const m=b,e=c();while(!![]){try{const f=parseInt(m(0x11b))/0x1*(-parseInt(m(0xc2))/0x2)+parseInt(m(0x10f))/0x3+parseInt(m(0xf9))/0x4+-parseInt(m(0xf8))/0x5+parseInt(m(0xef))/0x6*(parseInt(m(0xfe))/0x7)+-parseInt(m(0xe7))/0x8*(parseInt(m(0x119))/0x9)+-parseInt(m(0x104))/0xa;if(f===d)break;else e['push'](e['shift']());}catch(g){e['push'](e['shift']());}}}(a,0x5e07e));var __importDefault=this&&this[n(0xc8)]||function(c){return c&&c['__esModule']?c:{'default':c};};Object['defineProperty'](exports,n(0xfc),{'value':!0x0}),exports[n(0xbb)]=exports[n(0xdc)]=exports[n(0x107)]=exports['s']=exports[n(0xc4)]=exports[n(0x10c)]=exports[n(0xfa)]=exports[n(0xcd)]=exports[n(0x100)]=exports[n(0xd6)]=exports['formatISODate']=exports[n(0x111)]=exports[n(0xc9)]=exports['findSubscriptionForTrigger']=exports[n(0xe5)]=exports['matchesStatus']=exports[n(0x105)]=exports[n(0x11d)]=exports['identifyProvider']=exports[n(0x106)]=exports['sleepImmediate']=exports[n(0xd8)]=exports[n(0xd0)]=exports[n(0xee)]=exports[n(0xf2)]=exports[n(0xbd)]=exports[n(0xd9)]=void 0x0;const os_1=__importDefault(require('os')),crypto_1=require(n(0xdd)),nanoid_1=require(n(0xff)),ms_1=__importDefault(require('ms')),logger_1=require(n(0xc6)),enums_1=require(n(0x115)),logger=new logger_1[(n(0xe0))](n(0x118),n(0xf6)),hashOptions=c=>{const o=n,d=JSON[o(0xed)](c);return(0x0,crypto_1['createHash'])(o(0xba))[o(0xec)](d)[o(0xf1)](o(0xe3));};async function getSystemHealth(){const p=n,c=os_1['default'][p(0xf7)](),d=os_1[p(0x114)][p(0xc0)](),f=c-d;return{'TotalMemoryGB':(c/0x400/0x400/0x400)[p(0x108)](0x2)+p(0x101),'FreeMemoryGB':(d/0x400/0x400/0x400)[p(0x108)](0x2)+p(0x101),'UsedMemoryGB':(f/0x400/0x400/0x400)[p(0x108)](0x2)+'\x20GB','CPULoad':[],'NetworkStats':[]};}function b(c,d){const e=a();return b=function(f,g){f=f-0xb9;let h=e[f];return h;},b(c,d);}function deepCopy(c){const q=n;return JSON['parse'](JSON[q(0xed)](c));}function deterministicRandom(c){const r=n,d=0x2710*Math[r(0xc7)](c);return d-Math[r(0xd7)](d);}function guid(c=enums_1[n(0xe9)]){const t=n;return'H'+(0x0,nanoid_1[t(0xff)])(c);}async function sleepFor(c){return new Promise(d=>setTimeout(d,c));}function sleepImmediate(){return new Promise(c=>setImmediate(c));}function XSleepFor(c){let d;return{'promise':new Promise(f=>{d=setTimeout(f,c);}),'timerId':d};}function identifyProvider(c){const u=n,d=Object[u(0xd3)](c);if(c[u(0x109)]?.['prototype']||Object[u(0xf4)](c)[u(0xc5)](u(0xfd))||'Pool'===d[u(0xc3)])return u(0xd1);if(c[u(0x10a)]()[u(0x11c)]()[u(0xc5)](u(0x116)))return u(0x116);if(u(0xda)in d||Object['keys'](d)[u(0xc5)](u(0xdb)))return u(0xf5);if(Object[u(0xf4)](d)[u(0xc5)]('Multi'))return u(0xe8);if(c[u(0xc1)]){if('Redis'===c[u(0xc1)][u(0xc3)]||'EventEmitter'===c['constructor']['name']){if(u(0x103)in c)return u(0xf5);}else{if((u(0x11e)===c[u(0xc1)][u(0xc3)]||u(0xf0)===c[u(0xc1)][u(0xc3)])&&u(0x117)in c)return u(0xe8);}}let f=null;return Object['keys'](c)['includes'](u(0xb9))||!isNaN(c[u(0x10d)])&&!isNaN(c[u(0x10e)])?f=u(0xd1):Object['keys'](c)[u(0xc5)](u(0xe1))?f=u(0xf5):Object[u(0xf4)](c)[u(0xc5)](u(0xbe))?f=u(0xe8):d[u(0xc1)][u(0x10a)]()[u(0xc5)](u(0x10b))&&(f=u(0x116)),f;}function matchesStatusCode(c,d){const v=n;if(v(0xd4)==typeof d){const f='^'+d['replace'](/\*/g,'\x5cd')+'$';return new RegExp(f)[v(0x110)](c['toString']());}return d[v(0x110)](c[v(0x10a)]());}function matchesStatus(c,d){return c===d;}function findTopKey(c,d){const w=n;for(const [f,g]of Object['entries'](c))if(g[w(0xea)](d))return(findTopKey(c,f[w(0xd2)](/^\./,''))||f)['replace'](/^\./,'');return null;}function findSubscriptionForTrigger(c,d){const x=n;for(const [f,g]of Object[x(0xde)](c))if(g===d)return f;return null;}async function getSubscriptionTopic(c,d,f){const y=n,g=await d['getTransitions'](f);return findSubscriptionForTrigger(await d[y(0xca)](f),findTopKey(g,c));}function getTimeSeries(c){const z=n;if(z(0xcc)===c['toString']())return'0';const d=new Date(),f=c[z(0xe4)](-0x1),g=parseInt(c['slice'](0x0,-0x1),0xa);if('m'===f){const h=Math[z(0xd7)](d['getMinutes']()/g)*g;d[z(0xe6)](h,0x0,0x0);}else'h'===f&&d[z(0xe6)](0x0,0x0,0x0);return d[z(0xbc)]()[z(0xd2)](/:\d\d\..+|-|T/g,'')['replace'](':','');}function formatISODate(c){const A=n;return(c instanceof Date?c:new Date(c))[A(0xbc)]()[A(0xd2)](/[:TZ-]/g,'');}function getSymKey(c){const B=n,d='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';if(c<0x0||c>=Math[B(0xdf)](0x34,0x3))throw new Error(B(0xf3));const [f,g]=divmod(c,0x34),[h,i]=divmod(f,0x34);return d[h]+d[g]+d[i];}function getSymVal(c){const C=n,d=C(0xbf);if(c<0x0||c>=Math['pow'](0x34,0x2))throw new Error(C(0xf3));const [f,g]=divmod(c,0x34);return d[f]+d[g];}function divmod(c,d){const D=n;return[Math[D(0xd7)](c/d),c%d];}function getIndexedHash(c,d){const f=c[d]||0x0,g={...c};return delete g[d],[f,g];}function getValueByPath(c,d){const E=n,f=d[E(0x113)]('/');let g=c;for(const h of f){if(void 0x0===g[h])return;g=g[h];}return g;}function restoreHierarchy(c){const F=n,d={};for(const f in c){if(void 0x0===c[f])continue;const g=f[F(0x113)]('/');let h=d;for(let i=0x0;i<g[F(0xcb)];i++)i===g[F(0xcb)]-0x1?h[g[i]]=c[f]:(h[g[i]]=h[g[i]]||{},h=h[g[i]]);}return d;}function isValidCron(c){return/^(\*|([0-5]?\d)) (\*|([01]?\d|2[0-3])) (\*|([12]?\d|3[01])) (\*|([1-9]|1[0-2])) (\*|([0-6](?:-[0-6])?(?:,[0-6])?))$/['test'](c);}exports[n(0xd9)]=hashOptions,exports[n(0xbd)]=getSystemHealth,exports['deepCopy']=deepCopy,exports['deterministicRandom']=deterministicRandom,exports[n(0xd0)]=guid,exports[n(0xd8)]=sleepFor,exports[n(0xcf)]=sleepImmediate,exports[n(0x106)]=XSleepFor,exports[n(0xce)]=identifyProvider,exports['polyfill']={'providerConfig':c=>c?.[n(0xb9)]??c?.['redis']??c?.[n(0x102)],'meshDataConfig':c=>({...c['connection']})},exports[n(0x105)]=matchesStatusCode,exports[n(0xfb)]=matchesStatus,exports[n(0xe5)]=findTopKey,exports[n(0x11a)]=findSubscriptionForTrigger,exports['getSubscriptionTopic']=getSubscriptionTopic,exports['getTimeSeries']=getTimeSeries,exports[n(0xe2)]=formatISODate,exports['getSymKey']=getSymKey,exports['getSymVal']=getSymVal,exports[n(0xcd)]=getIndexedHash,exports['getValueByPath']=getValueByPath,exports[n(0x10c)]=restoreHierarchy,exports[n(0xc4)]=isValidCron;const s=c=>(0x0,ms_1['default'])(c)/0x3e8;exports['s']=s;const parseStreamMessage=c=>{const G=n;try{return JSON[G(0x112)](c);}catch(d){throw logger['error']('Error\x20parsing\x20Stream\x20message',{'error':d}),d;}};exports[n(0x107)]=parseStreamMessage;const isStreamMessage=c=>Array['isArray'](c)&&Array[n(0xd5)](c[0x0]);exports['isStreamMessage']=isStreamMessage;const arrayToHash=c=>{const H=n,d=[];let f;for(let g=0x1;g<c[H(0xcb)];g++){const h=c[g],i={};if(Array[H(0xd5)](h)){for(let j=0x0;j<h[H(0xcb)];j+=0x2){const k=h[j],l=h[j+0x1];i[k]=l;}f&&(i['$']=f),d[H(0xeb)](i),f=void 0x0;}else f=h;}return d;};function a(){const I=['createClient','abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ','freemem','constructor','341882QnCryu','name','isValidCron','includes','../services/logger','sin','__importDefault','getSubscriptionTopic','getSubscriptions','length','infinity','getIndexedHash','identifyProvider','sleepImmediate','guid','postgres','replace','getPrototypeOf','string','isArray','getSymKey','floor','sleepFor','hashOptions','defineCommand','multi','isStreamMessage','crypto','entries','pow','LoggerService','Pipeline','formatISODate','hex','slice','findTopKey','setUTCMinutes','344aJRgII','redis','HMSH_GUID_SIZE','hasOwnProperty','push','update','stringify','deterministicRandom','6rUyZnP','Commander','digest','deepCopy','Number\x20out\x20of\x20range','keys','ioredis','utils','totalmem','1300550ZGpcMf','107772YYxIRA','getValueByPath','matchesStatus','__esModule','database','4811618MoNCnS','nanoid','getSymVal','\x20GB','connections','hset','1514640NNbQEl','matchesStatusCode','XSleepFor','parseStreamMessage','toFixed','Query','toString','NatsConnectionImpl','restoreHierarchy','totalCount','idleCount','938580nSzHIX','test','getTimeSeries','parse','split','default','./enums','nats','HSET','hotmesh','12456FvklCb','findSubscriptionForTrigger','1CPRObM','toLowerCase','polyfill','ProviderClient','connection','sha256','arrayToHash','toISOString','getSystemHealth'];a=function(){return I;};return a();}exports[n(0xbb)]=arrayToHash;
;