@brown-ds/distribution 0.2.31 → 0.2.32

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.
@@ -6,5 +6,5 @@ Do NOT edit this file directly. Use it as a black box.
6
6
 
7
7
  If you notice any issues with using this file, please contact the TAs.
8
8
  */
9
- const log=require('../util/lo'+'g.js');function normalize(_0x4437e9,_0xbe3374){if(_0x4437e9===null)return{'key':null,'gid':_0xbe3374};else return typeof _0x4437e9==='string'?{'key':_0x4437e9,'gid':_0xbe3374}:_0x4437e9;}function mem(_0x52687e){const _0x451d69={};_0x451d69['gid']=_0x52687e['gid']||'all',_0x451d69['hash']=_0x52687e['hash']||globalThis['distributi'+'on']['util']['id']['naiveHash'];function _0x5b5454(_0xb99429,_0x18cb45){log('[all.mem.g'+'et]\x20config'+'uration:\x20'+JSON['stringify'](_0xb99429)+'\x20context:\x20'+JSON['stringify'](_0x451d69)),_0xb99429=normalize(_0xb99429,_0x451d69['gid']),_0xb99429['gid']=_0xb99429['gid']||_0x451d69['gid'];const _0x7fc148={'service':'mem','method':'get'},_0x10e64b=[_0xb99429];if(!_0xb99429['key']){globalThis['distributi'+'on'][_0x451d69['gid']]['comm']['send'](_0x10e64b,_0x7fc148,(_0x43c4af,_0xbed7d5)=>{const _0x20fbad=Object['values'](_0xbed7d5)['reduce']((_0x83f404,_0x2120d3)=>_0x83f404['concat'](_0x2120d3),[]);_0x18cb45(_0x43c4af,_0x20fbad);});return;}const _0x5e1aa3=_0xb99429['key'];if(_0x5e1aa3===null){_0x18cb45(new TypeError('Configurat'+'ion\x20is\x20nul'+'l'));return;}globalThis['distributi'+'on']['util']['wire']['dispatchMe'+'ssage'](_0x10e64b,_0x7fc148,{'key':_0x5e1aa3},_0x451d69,_0x18cb45);return;return _0x18cb45(new Error('mem.get\x20no'+'t\x20implemen'+'ted'));}function _0x14080e(_0x3382b3,_0x937af6,_0x178af1){log('[all.mem.p'+'ut]\x20state:'+'\x20'+JSON['stringify'](_0x3382b3)+('\x20configura'+'tion:\x20')+JSON['stringify'](_0x937af6)),_0x937af6=_0x937af6||globalThis['distributi'+'on']['util']['id']['getID'](_0x3382b3),_0x937af6=normalize(_0x937af6,_0x451d69['gid']),_0x937af6['gid']=_0x937af6['gid']||_0x451d69['gid'];const _0x5ae404={'service':'mem','method':'put'},_0x3f59e9=[_0x3382b3,_0x937af6],_0x4be0df=_0x937af6['key'];if(_0x4be0df===null){_0x178af1(new TypeError('Configurat'+'ion\x20is\x20nul'+'l'));return;}globalThis['distributi'+'on']['util']['wire']['dispatchMe'+'ssage'](_0x3f59e9,_0x5ae404,{'key':_0x4be0df},_0x451d69,_0x178af1);return;return _0x178af1(new Error('mem.put\x20no'+'t\x20implemen'+'ted'));}function _0x2dfccf(_0x5b6216,_0x398340,_0x1092a7){log('[all.mem.a'+'ppend]\x20sta'+'te:\x20'+JSON['stringify'](_0x5b6216)+('\x20configura'+'tion:\x20')+JSON['stringify'](_0x398340)),_0x398340=_0x398340||globalThis['distributi'+'on']['util']['id']['getID'](_0x5b6216),_0x398340=normalize(_0x398340,_0x451d69['gid']),_0x398340['gid']=_0x398340['gid']||_0x451d69['gid'];const _0x528fd8={'service':'mem','method':'append'},_0x1eb260=[_0x5b6216,_0x398340],_0x26a85c=_0x398340['key'];if(_0x26a85c===null){_0x1092a7(new TypeError('Configurat'+'ion\x20is\x20nul'+'l'));return;}globalThis['distributi'+'on']['util']['wire']['dispatchMe'+'ssage'](_0x1eb260,_0x528fd8,{'key':_0x26a85c},_0x451d69,_0x1092a7);return;return _0x1092a7(new Error('mem.append'+'\x20not\x20imple'+'mented'));}function _0x4cb9a3(_0x2b6242,_0x107b2e){log('[all.mem.d'+'el]\x20config'+'uration:\x20'+JSON['stringify'](_0x2b6242)),_0x2b6242=normalize(_0x2b6242,_0x451d69['gid']),_0x2b6242['gid']=_0x2b6242['gid']||_0x451d69['gid'];const _0x227384={'service':'mem','method':'del'},_0x230988=[_0x2b6242],_0x24b2b4=_0x2b6242['key'];if(_0x24b2b4===null){_0x107b2e(new TypeError('Configurat'+'ion\x20is\x20nul'+'l'));return;}globalThis['distributi'+'on']['util']['wire']['dispatchMe'+'ssage'](_0x230988,_0x227384,{'key':_0x24b2b4},_0x451d69,_0x107b2e);return;return _0x107b2e(new Error('mem.del\x20no'+'t\x20implemen'+'ted'));}function _0x34bd46(_0x291023,_0x495c7b){log('[mem.recon'+'f]\x20configu'+'ration:\x20'+JSON['stringify'](_0x291023)+'\x20gid:\x20'+_0x451d69['gid']),globalThis['distributi'+'on']['local']['groups']['get'](_0x451d69['gid'],(_0x5bc13b,_0x3b1ade)=>{if(!_0x3b1ade){_0x495c7b(_0x5bc13b);return;}globalThis['distributi'+'on']['local']['groups']['put'](_0x451d69['gid'],_0x291023,(_0x1ccccf,_0x1bf0de)=>{globalThis['distributi'+'on'][_0x451d69['gid']]['mem']['get'](null,(_0x3b289c,_0x577a6b)=>{globalThis['distributi'+'on']['local']['groups']['put'](_0x451d69['gid'],_0x3b1ade,(_0x55c74f,_0x288c6e)=>{globalThis['distributi'+'on'][_0x451d69['gid']]['status']['get']('nid',(_0xdebfc,_0x327a63)=>{const _0xaa8d4a=Object['values'](_0x327a63),_0x21d5a4=Object['values'](_0x291023)['map'](_0xc7ae0e=>globalThis['distributi'+'on']['util']['id']['getNID'](_0xc7ae0e));log('[mem.recon'+'f\x20received'+'\x20'+_0x577a6b['length']+('\x20keys\x20from'+'\x20')+_0x327a63['length']+'\x20nodes');let _0x2e3f74=0x937+0x1f43+0x3ae*-0xb;const _0x32c236=()=>{if(_0x2e3f74===_0x577a6b['length'])return _0x495c7b(null);};if(_0x577a6b['length']===-0x2*0x521+-0x1*-0x1053+-0x611*0x1)return _0x495c7b(null);for(const _0xe0a89e of _0x577a6b){const _0x1c9b60=globalThis['distributi'+'on']['util']['id']['getID'](_0xe0a89e),_0x3f565a=_0x451d69['hash'](_0x1c9b60,_0x21d5a4),_0x499c3d=_0x451d69['hash'](_0x1c9b60,_0xaa8d4a);log('[mem.recon'+'f]\x20old\x20nid'+':\x20'+_0x3f565a+'\x20new\x20nid:\x20'+_0x499c3d);if(_0x3f565a===_0x499c3d){_0x2e3f74++,_0x32c236();continue;}const _0x3c052e=_0x291023[_0x3f565a['substring'](-0x7d1+0x1a56+0x1af*-0xb,-0x16cd+0xdf*0x11+-0x1*-0x803)],_0x37fe40=[{'key':_0xe0a89e,'gid':_0x451d69['gid']}],_0xa73bb4={'service':'mem','method':'del','node':_0x3c052e};log('[mem.recon'+'f]\x20deletin'+'g\x20key\x20'+_0xe0a89e+'\x20from\x20'+JSON['stringify'](_0xa73bb4)),globalThis['distributi'+'on']['local']['comm']['send'](_0x37fe40,_0xa73bb4,(_0x35e9a5,_0x7d0985)=>{globalThis['distributi'+'on'][_0x451d69['gid']]['mem']['put'](_0x7d0985,_0xe0a89e,(_0x218854,_0x2cf82d)=>{_0x2e3f74++,_0x32c236();});});}});});});});});return;return _0x495c7b(new Error('mem.reconf'+'\x20not\x20imple'+'mented'));}return{'get':_0x5b5454,'put':_0x14080e,'append':_0x2dfccf,'del':_0x4cb9a3,'reconf':_0x34bd46};}module['exports']=mem;
9
+ const log=require('../util/lo'+'g.js');function normalize(_0x5d2c85,_0x40228b){if(_0x5d2c85===null)return{'key':null,'gid':_0x40228b};else return typeof _0x5d2c85==='string'?{'key':_0x5d2c85,'gid':_0x40228b}:_0x5d2c85;}function mem(_0x3de5ba){const _0x4b04c0={};_0x4b04c0['gid']=_0x3de5ba['gid']||'all',_0x4b04c0['hash']=_0x3de5ba['hash']||globalThis['distributi'+'on']['util']['id']['naiveHash'];function _0x75c519(_0x57d6b6,_0x2bc86b){log('[all.mem.g'+'et]\x20config'+'uration:\x20'+JSON['stringify'](_0x57d6b6)+'\x20context:\x20'+JSON['stringify'](_0x4b04c0)),_0x57d6b6=normalize(_0x57d6b6,_0x4b04c0['gid']),_0x57d6b6['gid']=_0x57d6b6['gid']||_0x4b04c0['gid'];const _0x5e3572={'service':'mem','method':'get'},_0x47c605=[_0x57d6b6];if(!_0x57d6b6['key']){globalThis['distributi'+'on'][_0x4b04c0['gid']]['comm']['send'](_0x47c605,_0x5e3572,(_0x33dc1f,_0x327e0b)=>{const _0xe493e5=Object['values'](_0x327e0b)['reduce']((_0x29968e,_0x506f51)=>_0x29968e['concat'](_0x506f51),[]);_0x2bc86b(_0x33dc1f,_0xe493e5);});return;}const _0x283630=_0x57d6b6['key'];if(_0x283630===null){_0x2bc86b(new TypeError('Configurat'+'ion\x20is\x20nul'+'l'));return;}globalThis['distributi'+'on']['util']['wire']['dispatchMe'+'ssage'](_0x47c605,_0x5e3572,{'key':_0x283630},_0x4b04c0,_0x2bc86b);return;return _0x2bc86b(new Error('mem.get\x20no'+'t\x20implemen'+'ted'));}function _0x25340c(_0x327957,_0x5e1c5a,_0x47e5b1){log('[all.mem.p'+'ut]\x20state:'+'\x20'+JSON['stringify'](_0x327957)+('\x20configura'+'tion:\x20')+JSON['stringify'](_0x5e1c5a)),_0x5e1c5a=_0x5e1c5a||globalThis['distributi'+'on']['util']['id']['getID'](_0x327957),_0x5e1c5a=normalize(_0x5e1c5a,_0x4b04c0['gid']),_0x5e1c5a['gid']=_0x5e1c5a['gid']||_0x4b04c0['gid'];const _0x17bd85={'service':'mem','method':'put'},_0x4b54e2=[_0x327957,_0x5e1c5a],_0xa8e340=_0x5e1c5a['key'];if(_0xa8e340===null){_0x47e5b1(new TypeError('Configurat'+'ion\x20is\x20nul'+'l'));return;}globalThis['distributi'+'on']['util']['wire']['dispatchMe'+'ssage'](_0x4b54e2,_0x17bd85,{'key':_0xa8e340},_0x4b04c0,_0x47e5b1);return;return _0x47e5b1(new Error('mem.put\x20no'+'t\x20implemen'+'ted'));}function _0x19f055(_0xc79fa7,_0x431eb8,_0x564a0c){log('[all.mem.a'+'ppend]\x20sta'+'te:\x20'+JSON['stringify'](_0xc79fa7)+('\x20configura'+'tion:\x20')+JSON['stringify'](_0x431eb8)),_0x431eb8=_0x431eb8||globalThis['distributi'+'on']['util']['id']['getID'](_0xc79fa7),_0x431eb8=normalize(_0x431eb8,_0x4b04c0['gid']),_0x431eb8['gid']=_0x431eb8['gid']||_0x4b04c0['gid'];const _0x1ebb93={'service':'mem','method':'append'},_0x43df89=[_0xc79fa7,_0x431eb8],_0x415ede=_0x431eb8['key'];if(_0x415ede===null){_0x564a0c(new TypeError('Configurat'+'ion\x20is\x20nul'+'l'));return;}globalThis['distributi'+'on']['util']['wire']['dispatchMe'+'ssage'](_0x43df89,_0x1ebb93,{'key':_0x415ede},_0x4b04c0,_0x564a0c);return;return _0x564a0c(new Error('mem.append'+'\x20not\x20imple'+'mented'));}function _0x31695f(_0x2a746c,_0x5deb6b){log('[all.mem.d'+'el]\x20config'+'uration:\x20'+JSON['stringify'](_0x2a746c)),_0x2a746c=normalize(_0x2a746c,_0x4b04c0['gid']),_0x2a746c['gid']=_0x2a746c['gid']||_0x4b04c0['gid'];const _0x2e1c5c={'service':'mem','method':'del'},_0x5575cd=[_0x2a746c],_0x33e2ed=_0x2a746c['key'];if(_0x33e2ed===null){_0x5deb6b(new TypeError('Configurat'+'ion\x20is\x20nul'+'l'));return;}globalThis['distributi'+'on']['util']['wire']['dispatchMe'+'ssage'](_0x5575cd,_0x2e1c5c,{'key':_0x33e2ed},_0x4b04c0,_0x5deb6b);return;return _0x5deb6b(new Error('mem.del\x20no'+'t\x20implemen'+'ted'));}function _0x2c1fbe(_0x4e9e9b,_0x6297c8){log('[mem.recon'+'f]\x20configu'+'ration:\x20'+JSON['stringify'](_0x4e9e9b)+'\x20gid:\x20'+_0x4b04c0['gid']),globalThis['distributi'+'on']['local']['groups']['get'](_0x4b04c0['gid'],(_0x193dee,_0x867a12)=>{if(!_0x867a12){_0x6297c8(_0x193dee);return;}globalThis['distributi'+'on']['local']['groups']['put'](_0x4b04c0['gid'],_0x4e9e9b,(_0x41157d,_0x556015)=>{globalThis['distributi'+'on'][_0x4b04c0['gid']]['mem']['get'](null,(_0x2a2072,_0x32a9d0)=>{globalThis['distributi'+'on']['local']['groups']['put'](_0x4b04c0['gid'],_0x867a12,(_0x307681,_0x5c0002)=>{globalThis['distributi'+'on'][_0x4b04c0['gid']]['status']['get']('nid',(_0x41ffe3,_0x4fa0b7)=>{const _0x53283f=Object['values'](_0x4fa0b7),_0x40f04b=Object['values'](_0x4e9e9b)['map'](_0x583388=>globalThis['distributi'+'on']['util']['id']['getNID'](_0x583388));log('[mem.recon'+'f\x20received'+'\x20'+_0x32a9d0['length']+('\x20keys\x20from'+'\x20')+_0x4fa0b7['length']+'\x20nodes');let _0x46005e=0x1*0xef7+-0x88b+-0x66c;const _0x10a74d=()=>{if(_0x46005e===_0x32a9d0['length'])return _0x6297c8(null);};if(_0x32a9d0['length']===0x2090+-0x1*-0x21da+-0x2135*0x2)return _0x6297c8(null);for(const _0x58c5a5 of _0x32a9d0){const _0x58fa3d=globalThis['distributi'+'on']['util']['id']['getID'](_0x58c5a5),_0x51e8c5=_0x4b04c0['hash'](_0x58fa3d,_0x40f04b),_0x5a2a1e=_0x4b04c0['hash'](_0x58fa3d,_0x53283f);log('[mem.recon'+'f]\x20old\x20nid'+':\x20'+_0x51e8c5+'\x20new\x20nid:\x20'+_0x5a2a1e);if(_0x51e8c5===_0x5a2a1e){_0x46005e++,_0x10a74d();continue;}const _0x563b90=_0x4e9e9b[_0x51e8c5['substring'](-0x27*-0xbd+-0x219*-0x12+-0x162f*0x3,-0xc80+0x98f+0x1*0x2f6)],_0x5c1351=[{'key':_0x58c5a5,'gid':_0x4b04c0['gid']}],_0x39fa58={'service':'mem','method':'del','node':_0x563b90};log('[mem.recon'+'f]\x20deletin'+'g\x20key\x20'+_0x58c5a5+'\x20from\x20'+JSON['stringify'](_0x39fa58)),globalThis['distributi'+'on']['local']['comm']['send'](_0x5c1351,_0x39fa58,(_0x5e38c6,_0x207465)=>{globalThis['distributi'+'on'][_0x4b04c0['gid']]['mem']['put'](_0x207465,_0x58c5a5,(_0x49c4cb,_0xbde5be)=>{_0x46005e++,_0x10a74d();});});}});});});});});return;return _0x6297c8(new Error('mem.reconf'+'\x20not\x20imple'+'mented'));}return{'get':_0x75c519,'put':_0x25340c,'append':_0x19f055,'del':_0x31695f,'reconf':_0x2c1fbe};}module['exports']=mem;
10
10
  /* eslint-enable */
@@ -6,5 +6,5 @@ Do NOT edit this file directly. Use it as a black box.
6
6
 
7
7
  If you notice any issues with using this file, please contact the TAs.
8
8
  */
9
- function status(_0x423aac){const _0x41f0a4={};_0x41f0a4['gid']=_0x423aac['gid']||'all';function _0x28bb8a(_0x5996f0,_0x40a397){const _0x45ffcc=[_0x5996f0],_0x321e52={'service':'status','method':'get'};globalThis['distributi'+'on'][_0x41f0a4['gid']]['comm']['send'](_0x45ffcc,_0x321e52,(_0x3ac603,_0x3c8658)=>{switch(_0x5996f0){case'heapTotal':const _0x16d43a=Object['values'](_0x3c8658)['reduce']((_0x36a757,_0x4c9396)=>{return _0x36a757+_0x4c9396;},-0x7f*0x4a+0x19*0x1d+-0x15*-0x19d);return _0x40a397(_0x3ac603,_0x16d43a);break;case'nid':const _0x34ffda=Object['values'](_0x3c8658)['reduce']((_0x27a954,_0x186898)=>{return _0x27a954['concat'](_0x186898);},[]);return _0x40a397(_0x3ac603,_0x34ffda);break;default:return _0x40a397(_0x3ac603,_0x3c8658);break;}});return;_0x40a397(new Error('status.get'+'\x20not\x20imple'+'mented'));}function _0x38df6f(_0x1b0684,_0x2f73ba){globalThis['distributi'+'on']['local']['status']['spawn'](_0x1b0684,(_0x484b26,_0x1ab6fd)=>{globalThis['distributi'+'on'][_0x41f0a4['gid']]['comm']['send']([_0x41f0a4['gid'],_0x1b0684],{'service':'groups','method':'add'},()=>{});if(_0x484b26)return _0x2f73ba(_0x484b26);globalThis['distributi'+'on']['local']['groups']['add'](_0x41f0a4['gid'],_0x1b0684,()=>{return _0x2f73ba(null,_0x1ab6fd);});});return;_0x2f73ba(new Error('status.spa'+'wn\x20not\x20imp'+'lemented'));}function _0x547b3a(_0x4b6742){globalThis['distributi'+'on'][_0x41f0a4['gid']]['comm']['send']([],{'service':'status','method':'stop'},()=>{globalThis['distributi'+'on']['local']['status']['stop'](_0x4b6742);});return;_0x4b6742(new Error('status.sto'+'p\x20not\x20impl'+'emented'));}return{'get':_0x28bb8a,'stop':_0x547b3a,'spawn':_0x38df6f};}module['exports']=status;
9
+ function status(_0x2855a4){const _0x20233d={};_0x20233d['gid']=_0x2855a4['gid']||'all';function _0x150c30(_0x230055,_0x4862e3){const _0x1e63bc=[_0x230055],_0x3d8f9d={'service':'status','method':'get'};globalThis['distributi'+'on'][_0x20233d['gid']]['comm']['send'](_0x1e63bc,_0x3d8f9d,(_0x2b09ad,_0x3ed4ea)=>{switch(_0x230055){case'heapTotal':const _0x1d2b3e=Object['values'](_0x3ed4ea)['reduce']((_0x12dccb,_0x3a36d0)=>{return _0x12dccb+_0x3a36d0;},0x111b+-0x3*-0x917+0x163*-0x20);return _0x4862e3(_0x2b09ad,_0x1d2b3e);break;case'nid':const _0x15c7b0=Object['values'](_0x3ed4ea)['reduce']((_0x19ffd6,_0x42dcbb)=>{return _0x19ffd6['concat'](_0x42dcbb);},[]);return _0x4862e3(_0x2b09ad,_0x15c7b0);break;case'sid':const _0x5aa542=Object['values'](_0x3ed4ea)['reduce']((_0x4b0b86,_0x4fc5d9)=>{return _0x4b0b86['concat'](_0x4fc5d9);},[]);return _0x4862e3(_0x2b09ad,_0x5aa542);break;default:return _0x4862e3(_0x2b09ad,_0x3ed4ea);break;}});return;_0x4862e3(new Error('status.get'+'\x20not\x20imple'+'mented'));}function _0x553797(_0x316830,_0x5bcb66){globalThis['distributi'+'on']['local']['status']['spawn'](_0x316830,(_0x24f381,_0x234bb4)=>{globalThis['distributi'+'on'][_0x20233d['gid']]['comm']['send']([_0x20233d['gid'],_0x316830],{'service':'groups','method':'add'},()=>{});if(_0x24f381)return _0x5bcb66(_0x24f381);globalThis['distributi'+'on']['local']['groups']['add'](_0x20233d['gid'],_0x316830,()=>{return _0x5bcb66(null,_0x234bb4);});});return;_0x5bcb66(new Error('status.spa'+'wn\x20not\x20imp'+'lemented'));}function _0x369f82(_0x35e5dc){globalThis['distributi'+'on'][_0x20233d['gid']]['comm']['send']([],{'service':'status','method':'stop'},()=>{globalThis['distributi'+'on']['local']['status']['stop'](_0x35e5dc);});return;_0x35e5dc(new Error('status.sto'+'p\x20not\x20impl'+'emented'));}return{'get':_0x150c30,'stop':_0x369f82,'spawn':_0x553797};}module['exports']=status;
10
10
  /* eslint-enable */
@@ -6,5 +6,5 @@ Do NOT edit this file directly. Use it as a black box.
6
6
 
7
7
  If you notice any issues with using this file, please contact the TAs.
8
8
  */
9
- const log=require('../util/lo'+'g.js');function getNode(_0x4e8249,_0x45a5d3,_0x412239){const _0x58b897=_0x45a5d3&&typeof _0x45a5d3==='object'?_0x45a5d3['key']:_0x45a5d3;globalThis['distributi'+'on'][_0x4e8249['gid']]['status']['get']('nid',(_0x4699fc,_0x8c6c0e)=>{const _0x39f54a=Object['values'](_0x8c6c0e),_0x55cee8=globalThis['distributi'+'on']['util']['id']['getID'](_0x58b897),_0x3497f6=_0x4e8249['hash'](_0x55cee8,_0x39f54a),_0x15216c=_0x3497f6['substring'](-0x2e*0xe+0x24b+0x39*0x1,-0x2092+0x1a65+0x632);globalThis['distributi'+'on']['local']['groups']['get'](_0x4e8249['gid'],(_0x2b8d28,_0x109948)=>{if(!_0x109948)return _0x412239(_0x2b8d28);else{const _0x24c8a5=_0x109948[_0x15216c];return log('[store\x20(ge'+'tNode)]\x20co'+'nfiguratio'+'n:\x20'+JSON['stringify'](_0x45a5d3)+'group:\x20'+JSON['stringify'](_0x109948)+'\x20node:\x20'+JSON['stringify'](_0x24c8a5)+'nid:\x20'+JSON['stringify'](_0x3497f6)+'\x20sid:\x20'+JSON['stringify'](_0x15216c)),_0x412239(null,_0x24c8a5);}});});}function normalize(_0x14506a,_0xc99f63){if(_0x14506a===null)return{'key':null,'gid':_0xc99f63};else return typeof _0x14506a==='string'?{'key':_0x14506a,'gid':_0xc99f63}:_0x14506a;}function store(_0x587398){const _0x262c29={'gid':_0x587398['gid']||'all','hash':_0x587398['hash']||globalThis['distributi'+'on']['util']['id']['naiveHash'],'subset':_0x587398['subset']};function _0xd35ee(_0x296d2c,_0x583295){if(!_0x296d2c){const _0x43a8d2=[{'key':null,'gid':_0x262c29['gid']}];globalThis['distributi'+'on'][_0x262c29['gid']]['comm']['send'](_0x43a8d2,{'service':'store','method':'get'},(_0x209fbf,_0x59f126)=>{const _0x499f50=Object['values'](_0x59f126)['reduce']((_0x20c333,_0x328dd6)=>_0x20c333['concat'](_0x328dd6),[]);_0x583295(_0x209fbf,_0x499f50);});return;}_0x296d2c=normalize(_0x296d2c,_0x262c29['gid']),getNode(_0x262c29,_0x296d2c,(_0x55e145,_0x16ee7b)=>{if(!_0x16ee7b){_0x583295(_0x55e145);return;}const _0x4d87cf=[_0x296d2c],_0xb01a54={'service':'store','method':'get','node':_0x16ee7b};log('[all.store'+'.get]confi'+'guration:\x20'+JSON['stringify'](_0x296d2c)+'node:\x20'+JSON['stringify'](globalThis['distributi'+'on']['node']['config'])+('\x20target\x20no'+'de:\x20')+JSON['stringify'](_0x16ee7b)),globalThis['distributi'+'on']['local']['comm']['send'](_0x4d87cf,_0xb01a54,_0x583295);});return;return _0x583295(new Error('store.get\x20'+'not\x20implem'+'ented'));}function _0x2f0e55(_0x519d27,_0x57e991,_0x2df51b){_0x57e991=_0x57e991||globalThis['distributi'+'on']['util']['id']['getID'](_0x519d27),_0x57e991=normalize(_0x57e991,_0x262c29['gid']),getNode(_0x262c29,_0x57e991,(_0x28b335,_0x4f35ba)=>{if(!_0x4f35ba){_0x2df51b(_0x28b335);return;}const _0x2edddd=[_0x519d27,_0x57e991],_0x526514={'service':'store','method':'put','node':_0x4f35ba};log('[all.store'+'.put]\x20stat'+'e:\x20'+JSON['stringify'](_0x519d27)+('configurat'+'ion:\x20')+JSON['stringify'](_0x57e991)+('target\x20nod'+'e:\x20')+JSON['stringify'](_0x4f35ba)),globalThis['distributi'+'on']['local']['comm']['send'](_0x2edddd,_0x526514,_0x2df51b);});return;return _0x2df51b(new Error('store.put\x20'+'not\x20implem'+'ented'));}function _0x5cdd05(_0x2f118d,_0x1c3ac3,_0x3ad44b){_0x1c3ac3=_0x1c3ac3||globalThis['distributi'+'on']['util']['id']['getID'](_0x2f118d),_0x1c3ac3=normalize(_0x1c3ac3,_0x262c29['gid']),getNode(_0x262c29,_0x1c3ac3,(_0x2a3a99,_0xe2de4a)=>{if(!_0xe2de4a){_0x3ad44b(_0x2a3a99);return;}const _0x510cc9=[_0x2f118d,_0x1c3ac3],_0x18badd={'service':'store','method':'append','node':_0xe2de4a};log('[all.store'+'.append]\x20s'+'tate:\x20'+JSON['stringify'](_0x2f118d)+('configurat'+'ion:\x20')+JSON['stringify'](_0x1c3ac3)+('target\x20nod'+'e:\x20')+JSON['stringify'](_0xe2de4a)),globalThis['distributi'+'on']['local']['comm']['send'](_0x510cc9,_0x18badd,_0x3ad44b);});return;return _0x3ad44b(new Error('store.appe'+'nd\x20not\x20imp'+'lemented'));}function _0x14ce0c(_0x201c6f,_0x4228c9){getNode(_0x262c29,_0x201c6f,(_0x3a68ef,_0x3f45e2)=>{if(!_0x3f45e2){_0x4228c9(_0x3a68ef);return;}const _0x273cc1=[{'key':_0x201c6f,'gid':_0x262c29['gid']}],_0x18e4a7={'service':'store','method':'del','node':_0x3f45e2};globalThis['distributi'+'on']['local']['comm']['send'](_0x273cc1,_0x18e4a7,_0x4228c9);});return;return _0x4228c9(new Error('store.del\x20'+'not\x20implem'+'ented'));}function _0x522293(_0x259174,_0xb02e11){log('[store.rec'+'onf]\x20confi'+'guration:\x20'+JSON['stringify'](_0x259174)+'\x20gid:\x20'+_0x262c29['gid']),globalThis['distributi'+'on']['local']['groups']['get'](_0x262c29['gid'],(_0x356dfc,_0x478c78)=>{if(!_0x478c78){_0xb02e11(_0x356dfc);return;}globalThis['distributi'+'on']['local']['groups']['put'](_0x262c29['gid'],_0x259174,(_0x35ff4f,_0x2117ff)=>{globalThis['distributi'+'on'][_0x262c29['gid']]['store']['get'](null,(_0x1d69aa,_0x3ed3ac)=>{globalThis['distributi'+'on']['local']['groups']['put'](_0x262c29['gid'],_0x478c78,(_0x42e07d,_0x2fde84)=>{globalThis['distributi'+'on'][_0x262c29['gid']]['status']['get']('nid',(_0x3c01e1,_0x5b2e1d)=>{const _0x3aed75=Object['values'](_0x5b2e1d),_0x4b2e88=Object['values'](_0x259174)['map'](_0x4ca6bc=>globalThis['distributi'+'on']['util']['id']['getNID'](_0x4ca6bc));log('[store.rec'+'onf\x20receiv'+'ed\x20'+_0x3ed3ac['length']+('\x20keys\x20from'+'\x20')+_0x5b2e1d['length']+'\x20nodes');let _0x3047e1=0xd*-0xa3+-0x42c+0xc73;const _0x30884a=()=>{if(_0x3047e1===_0x3ed3ac['length'])return _0xb02e11(null);};if(_0x3ed3ac['length']===-0x1e8+-0x9fd*-0x2+-0x1212)return _0xb02e11(null);for(const _0x359399 of _0x3ed3ac){const _0x542df0=globalThis['distributi'+'on']['util']['id']['getID'](_0x359399),_0x4eb824=_0x262c29['hash'](_0x542df0,_0x4b2e88),_0x470615=_0x262c29['hash'](_0x542df0,_0x3aed75);log('[store.rec'+'onf]\x20old\x20n'+'id:\x20'+_0x4eb824+'\x20new\x20nid:\x20'+_0x470615);if(_0x4eb824===_0x470615){_0x3047e1++,_0x30884a();continue;}const _0x14eec5=_0x259174[_0x4eb824['substring'](-0x266e*0x1+0x1*-0xdc9+0x1*0x3437,0x16a*0xb+0xe*0xa5+-0x188f)],_0x1449e9=[{'key':_0x359399,'gid':_0x262c29['gid']}],_0x1ce999={'service':'store','method':'del','node':_0x14eec5};log('[store.rec'+'onf]\x20delet'+'ing\x20key\x20'+_0x359399+'\x20from\x20'+JSON['stringify'](_0x1ce999)),globalThis['distributi'+'on']['local']['comm']['send'](_0x1449e9,_0x1ce999,(_0x175068,_0x26d649)=>{globalThis['distributi'+'on'][_0x262c29['gid']]['store']['put'](_0x26d649,_0x359399,(_0x4c0f9c,_0x404df2)=>{_0x3047e1++,_0x30884a();});});}});});});});});return;return _0xb02e11(new Error('store.reco'+'nf\x20not\x20imp'+'lemented'));}return{'get':_0xd35ee,'put':_0x2f0e55,'append':_0x5cdd05,'del':_0x14ce0c,'reconf':_0x522293};}module['exports']=store;
9
+ const log=require('../util/lo'+'g.js');function getNode(_0x30afc6,_0x2ee54a,_0x399c14){const _0x316956=_0x2ee54a&&typeof _0x2ee54a==='object'?_0x2ee54a['key']:_0x2ee54a;globalThis['distributi'+'on'][_0x30afc6['gid']]['status']['get']('nid',(_0x8dc737,_0x19d4b9)=>{const _0x2230fd=Object['values'](_0x19d4b9),_0x1120ea=globalThis['distributi'+'on']['util']['id']['getID'](_0x316956),_0x260065=_0x30afc6['hash'](_0x1120ea,_0x2230fd),_0x9f9d59=_0x260065['substring'](0x2438+0x7a8+-0x2be0,-0xd8f*-0x1+0x3*-0x77b+0x8e7);globalThis['distributi'+'on']['local']['groups']['get'](_0x30afc6['gid'],(_0x58187c,_0x22b59d)=>{if(!_0x22b59d)return _0x399c14(_0x58187c);else{const _0x484606=_0x22b59d[_0x9f9d59];return log('[store\x20(ge'+'tNode)]\x20co'+'nfiguratio'+'n:\x20'+JSON['stringify'](_0x2ee54a)+'group:\x20'+JSON['stringify'](_0x22b59d)+'\x20node:\x20'+JSON['stringify'](_0x484606)+'nid:\x20'+JSON['stringify'](_0x260065)+'\x20sid:\x20'+JSON['stringify'](_0x9f9d59)),_0x399c14(null,_0x484606);}});});}function normalize(_0x200d9f,_0x59db03){if(_0x200d9f===null)return{'key':null,'gid':_0x59db03};else return typeof _0x200d9f==='string'?{'key':_0x200d9f,'gid':_0x59db03}:_0x200d9f;}function store(_0x14783b){const _0x520cf5={'gid':_0x14783b['gid']||'all','hash':_0x14783b['hash']||globalThis['distributi'+'on']['util']['id']['naiveHash'],'subset':_0x14783b['subset']};function _0x19433f(_0x374446,_0x5aae10){if(!_0x374446){const _0x14f94c=[{'key':null,'gid':_0x520cf5['gid']}];globalThis['distributi'+'on'][_0x520cf5['gid']]['comm']['send'](_0x14f94c,{'service':'store','method':'get'},(_0x2c5df9,_0x4be9e2)=>{const _0x5ecb38=Object['values'](_0x4be9e2)['reduce']((_0x71704e,_0xca3c29)=>_0x71704e['concat'](_0xca3c29),[]);_0x5aae10(_0x2c5df9,_0x5ecb38);});return;}_0x374446=normalize(_0x374446,_0x520cf5['gid']),getNode(_0x520cf5,_0x374446,(_0x4bf699,_0x24874f)=>{if(!_0x24874f){_0x5aae10(_0x4bf699);return;}const _0x14a143=[_0x374446],_0x33bd29={'service':'store','method':'get','node':_0x24874f};log('[all.store'+'.get]confi'+'guration:\x20'+JSON['stringify'](_0x374446)+'node:\x20'+JSON['stringify'](globalThis['distributi'+'on']['node']['config'])+('\x20target\x20no'+'de:\x20')+JSON['stringify'](_0x24874f)),globalThis['distributi'+'on']['local']['comm']['send'](_0x14a143,_0x33bd29,_0x5aae10);});return;return _0x5aae10(new Error('store.get\x20'+'not\x20implem'+'ented'));}function _0x12fcfe(_0x4ee34c,_0x142ed3,_0x560369){_0x142ed3=_0x142ed3||globalThis['distributi'+'on']['util']['id']['getID'](_0x4ee34c),_0x142ed3=normalize(_0x142ed3,_0x520cf5['gid']),getNode(_0x520cf5,_0x142ed3,(_0xfb2647,_0xc04ae9)=>{if(!_0xc04ae9){_0x560369(_0xfb2647);return;}const _0x200002=[_0x4ee34c,_0x142ed3],_0x25ef6e={'service':'store','method':'put','node':_0xc04ae9};log('[all.store'+'.put]\x20stat'+'e:\x20'+JSON['stringify'](_0x4ee34c)+('configurat'+'ion:\x20')+JSON['stringify'](_0x142ed3)+('target\x20nod'+'e:\x20')+JSON['stringify'](_0xc04ae9)),globalThis['distributi'+'on']['local']['comm']['send'](_0x200002,_0x25ef6e,_0x560369);});return;return _0x560369(new Error('store.put\x20'+'not\x20implem'+'ented'));}function _0x8d1b82(_0x540d0c,_0x17c1af,_0x2f8189){_0x17c1af=_0x17c1af||globalThis['distributi'+'on']['util']['id']['getID'](_0x540d0c),_0x17c1af=normalize(_0x17c1af,_0x520cf5['gid']),getNode(_0x520cf5,_0x17c1af,(_0x245686,_0x10e912)=>{if(!_0x10e912){_0x2f8189(_0x245686);return;}const _0x29ff48=[_0x540d0c,_0x17c1af],_0x2ffc17={'service':'store','method':'append','node':_0x10e912};log('[all.store'+'.append]\x20s'+'tate:\x20'+JSON['stringify'](_0x540d0c)+('configurat'+'ion:\x20')+JSON['stringify'](_0x17c1af)+('target\x20nod'+'e:\x20')+JSON['stringify'](_0x10e912)),globalThis['distributi'+'on']['local']['comm']['send'](_0x29ff48,_0x2ffc17,_0x2f8189);});return;return _0x2f8189(new Error('store.appe'+'nd\x20not\x20imp'+'lemented'));}function _0x4ac88a(_0x2df2cc,_0x35a06b){getNode(_0x520cf5,_0x2df2cc,(_0x1ea970,_0x6dfbf)=>{if(!_0x6dfbf){_0x35a06b(_0x1ea970);return;}const _0x2f4fe9=[{'key':_0x2df2cc,'gid':_0x520cf5['gid']}],_0x42da02={'service':'store','method':'del','node':_0x6dfbf};globalThis['distributi'+'on']['local']['comm']['send'](_0x2f4fe9,_0x42da02,_0x35a06b);});return;return _0x35a06b(new Error('store.del\x20'+'not\x20implem'+'ented'));}function _0x4baae1(_0x313f8b,_0x293e14){log('[store.rec'+'onf]\x20confi'+'guration:\x20'+JSON['stringify'](_0x313f8b)+'\x20gid:\x20'+_0x520cf5['gid']),globalThis['distributi'+'on']['local']['groups']['get'](_0x520cf5['gid'],(_0x317afe,_0x2443f2)=>{if(!_0x2443f2){_0x293e14(_0x317afe);return;}globalThis['distributi'+'on']['local']['groups']['put'](_0x520cf5['gid'],_0x313f8b,(_0x5d4b3a,_0x3519f7)=>{globalThis['distributi'+'on'][_0x520cf5['gid']]['store']['get'](null,(_0x4c42d5,_0x37f598)=>{globalThis['distributi'+'on']['local']['groups']['put'](_0x520cf5['gid'],_0x2443f2,(_0x4655d8,_0x557cc3)=>{globalThis['distributi'+'on'][_0x520cf5['gid']]['status']['get']('nid',(_0x2d307b,_0x4f3d0b)=>{const _0x52cd6c=Object['values'](_0x4f3d0b),_0x2d1f93=Object['values'](_0x313f8b)['map'](_0x18416a=>globalThis['distributi'+'on']['util']['id']['getNID'](_0x18416a));log('[store.rec'+'onf\x20receiv'+'ed\x20'+_0x37f598['length']+('\x20keys\x20from'+'\x20')+_0x4f3d0b['length']+'\x20nodes');let _0x54f3a8=-0x94f*-0x2+0xf8c*-0x1+-0x312;const _0x465627=()=>{if(_0x54f3a8===_0x37f598['length'])return _0x293e14(null);};if(_0x37f598['length']===0x2*-0x395+-0x1c1b+-0x1*-0x2345)return _0x293e14(null);for(const _0x3b9f65 of _0x37f598){const _0x33ccb6=globalThis['distributi'+'on']['util']['id']['getID'](_0x3b9f65),_0x239e73=_0x520cf5['hash'](_0x33ccb6,_0x2d1f93),_0xcc48ae=_0x520cf5['hash'](_0x33ccb6,_0x52cd6c);log('[store.rec'+'onf]\x20old\x20n'+'id:\x20'+_0x239e73+'\x20new\x20nid:\x20'+_0xcc48ae);if(_0x239e73===_0xcc48ae){_0x54f3a8++,_0x465627();continue;}const _0x5de419=_0x313f8b[_0x239e73['substring'](0x5*0x44b+0x17d*0x5+-0x64*0x4a,-0x94c*0x1+-0x3*-0xc4f+0xba*-0x26)],_0x35d262=[{'key':_0x3b9f65,'gid':_0x520cf5['gid']}],_0x29e09b={'service':'store','method':'del','node':_0x5de419};log('[store.rec'+'onf]\x20delet'+'ing\x20key\x20'+_0x3b9f65+'\x20from\x20'+JSON['stringify'](_0x29e09b)),globalThis['distributi'+'on']['local']['comm']['send'](_0x35d262,_0x29e09b,(_0x35f52d,_0x4a0863)=>{globalThis['distributi'+'on'][_0x520cf5['gid']]['store']['put'](_0x4a0863,_0x3b9f65,(_0xdaa56,_0x58d6e7)=>{_0x54f3a8++,_0x465627();});});}});});});});});return;return _0x293e14(new Error('store.reco'+'nf\x20not\x20imp'+'lemented'));}return{'get':_0x19433f,'put':_0x12fcfe,'append':_0x8d1b82,'del':_0x4ac88a,'reconf':_0x4baae1};}module['exports']=store;
10
10
  /* eslint-enable */
@@ -6,5 +6,5 @@ Do NOT edit this file directly. Use it as a black box.
6
6
 
7
7
  If you notice any issues with using this file, please contact the TAs.
8
8
  */
9
- const log=require('../util/lo'+'g'),kvStore={'store':{},'get'(_0xbf1509){if(!this['store'][_0xbf1509['gid']])return undefined;return this['store'][_0xbf1509['gid']][_0xbf1509['key']];},'put'(_0xab28a4,_0x3aba34){!this['store'][_0xab28a4['gid']]&&(this['store'][_0xab28a4['gid']]={}),this['store'][_0xab28a4['gid']][_0xab28a4['key']]=_0x3aba34;},'append'(_0x4362f4,_0x1cb69c){!this['get'](_0x4362f4)&&this['put'](_0x4362f4,[]),!Array['isArray'](this['get'](_0x4362f4))&&this['put'](_0x4362f4,[this['get'](_0x4362f4)]),Array['isArray'](_0x1cb69c)?this['put'](_0x4362f4,this['get'](_0x4362f4)['concat'](_0x1cb69c)):this['store'][_0x4362f4['gid']][_0x4362f4['key']]['push'](_0x1cb69c);},'del'(_0x53be48){if(!this['store'][_0x53be48['gid']])return undefined;const _0x2acd24=this['store'][_0x53be48['gid']][_0x53be48['key']];return delete this['store'][_0x53be48['gid']][_0x53be48['key']],_0x2acd24;},'toString'(){let _0x1a7bdb='';for(const _0x20b178 in this['store']){_0x1a7bdb+=_0x20b178+':\x20'+JSON['stringify'](this['store'][_0x20b178]);}return _0x1a7bdb;}};function normalize(_0x1b1bf1){if(_0x1b1bf1===null)return{'key':null,'gid':null};else return typeof _0x1b1bf1==='string'?{'key':_0x1b1bf1,'gid':null}:_0x1b1bf1;};function put(_0xc76ba7,_0x815c36,_0xd42bbf){log('[mem.put]\x20'+'configurat'+'ion:\x20'+JSON['stringify'](_0x815c36)+'\x20state:\x20'+JSON['stringify'](_0xc76ba7)+'\x20store:\x20'+kvStore['toString']());let {key:_0x46fc05,gid:_0x58a0a7}=normalize(_0x815c36);_0x46fc05=_0x46fc05||globalThis['distributi'+'on']['util']['id']['getID'](_0xc76ba7),_0x58a0a7=_0x58a0a7||'local',kvStore['put']({'key':_0x46fc05,'gid':_0x58a0a7},_0xc76ba7),log('[mem.put]\x20'+'store\x20(aft'+'er):\x20'+kvStore['toString']());if(_0xd42bbf)return _0xd42bbf(null,_0xc76ba7);return;return _0xd42bbf(new Error('mem.put\x20no'+'t\x20implemen'+'ted'));};function append(_0x473c00,_0x589a9b,_0x106c41){log('[mem.appen'+'d]\x20configu'+'ration:\x20'+JSON['stringify'](_0x589a9b)+'\x20state:\x20'+JSON['stringify'](_0x473c00)+'\x20store:\x20'+kvStore['toString']());let {key:_0x270d21,gid:_0x518f40}=normalize(_0x589a9b);_0x270d21=_0x270d21||globalThis['distributi'+'on']['util']['id']['getID'](_0x473c00),_0x518f40=_0x518f40||'local';if(!_0x270d21)return _0x106c41(new Error('Configurat'+'ion\x20key\x20is'+'\x20required\x20'+'for\x20append'));kvStore['append']({'key':_0x270d21,'gid':_0x518f40},_0x473c00),log('[mem.appen'+'d]\x20store\x20('+'after):\x20'+kvStore['toString']());const _0x3dded9=kvStore['get']({'key':_0x270d21,'gid':_0x518f40});if(_0x106c41)return _0x106c41(null,_0x3dded9);return;return _0x106c41(new Error('mem.append'+'\x20not\x20imple'+'mented'));};function get(_0x1976f9,_0x544523){log('[mem.get]\x20'+'configurat'+'ion:\x20'+JSON['stringify'](_0x1976f9)+'\x20store:\x20'+kvStore['toString']());let {key:_0x451d65,gid:_0x42140e}=normalize(_0x1976f9);_0x42140e=_0x42140e||'local';if(_0x451d65){const _0x5d64f0=kvStore['get']({'key':_0x451d65,'gid':_0x42140e});return _0x5d64f0?_0x544523(null,_0x5d64f0):_0x544523(new Error('Memory\x20key'+'\x20\x22'+_0x451d65+('\x22\x20not\x20foun'+'d\x20for\x20')+_0x42140e+'\x27s\x20store'));}else{let _0x453235=kvStore['store'][_0x42140e]||{};return _0x453235=Object['keys'](_0x453235),_0x544523(null,_0x453235);}return;return _0x544523(new Error('mem.get\x20no'+'t\x20implemen'+'ted'));}function del(_0x562e2f,_0x43a87d){log('[mem.del]\x20'+'configurat'+'ion:\x20'+JSON['stringify'](_0x562e2f)+'\x20store:\x20'+kvStore['toString']());let {key:_0x5c1c6a,gid:_0x57bb89}=normalize(_0x562e2f);_0x57bb89=_0x57bb89||'local';const _0x4ccb01=kvStore['del']({'key':_0x5c1c6a,'gid':_0x57bb89});log('[mem.del]\x20'+'store\x20(aft'+'er):\x20'+kvStore['toString']());return _0x4ccb01?_0x43a87d(null,_0x4ccb01):_0x43a87d(new Error('Memory\x20key'+'\x20\x22'+_0x5c1c6a+('\x22\x20not\x20foun'+'d\x20for\x20')+_0x57bb89+'\x27s\x20store'));return;return _0x43a87d(new Error('mem.del\x20no'+'t\x20implemen'+'ted'));};module['exports']={'put':put,'get':get,'del':del,'append':append};
9
+ const log=require('../util/lo'+'g'),kvStore={'store':{},'get'(_0x490943){if(!this['store'][_0x490943['gid']])return undefined;return this['store'][_0x490943['gid']][_0x490943['key']];},'put'(_0x41f081,_0x7f1f9d){!this['store'][_0x41f081['gid']]&&(this['store'][_0x41f081['gid']]={}),this['store'][_0x41f081['gid']][_0x41f081['key']]=_0x7f1f9d;},'append'(_0x17f50c,_0x5098da){!this['get'](_0x17f50c)&&this['put'](_0x17f50c,[]),!Array['isArray'](this['get'](_0x17f50c))&&this['put'](_0x17f50c,[this['get'](_0x17f50c)]),Array['isArray'](_0x5098da)?this['put'](_0x17f50c,this['get'](_0x17f50c)['concat'](_0x5098da)):this['store'][_0x17f50c['gid']][_0x17f50c['key']]['push'](_0x5098da);},'del'(_0x1c3d27){if(!this['store'][_0x1c3d27['gid']])return undefined;const _0x344fbd=this['store'][_0x1c3d27['gid']][_0x1c3d27['key']];return delete this['store'][_0x1c3d27['gid']][_0x1c3d27['key']],_0x344fbd;},'toString'(){let _0xdbf02d='';for(const _0x46423a in this['store']){_0xdbf02d+=_0x46423a+':\x20'+JSON['stringify'](this['store'][_0x46423a]);}return _0xdbf02d;}};function normalize(_0x5c6e40){if(_0x5c6e40===null)return{'key':null,'gid':null};else return typeof _0x5c6e40==='string'?{'key':_0x5c6e40,'gid':null}:_0x5c6e40;};function put(_0x41cbc4,_0x5445d5,_0x3a5a8b){log('[mem.put]\x20'+'configurat'+'ion:\x20'+JSON['stringify'](_0x5445d5)+'\x20state:\x20'+JSON['stringify'](_0x41cbc4)+'\x20store:\x20'+kvStore['toString']());let {key:_0x474578,gid:_0x5187b2}=normalize(_0x5445d5);_0x474578=_0x474578||globalThis['distributi'+'on']['util']['id']['getID'](_0x41cbc4),_0x5187b2=_0x5187b2||'local',kvStore['put']({'key':_0x474578,'gid':_0x5187b2},_0x41cbc4),log('[mem.put]\x20'+'store\x20(aft'+'er):\x20'+kvStore['toString']());if(_0x3a5a8b)return _0x3a5a8b(null,_0x41cbc4);return;return _0x3a5a8b(new Error('mem.put\x20no'+'t\x20implemen'+'ted'));};function append(_0x1e3d54,_0x16c42d,_0x10ee97){log('[mem.appen'+'d]\x20configu'+'ration:\x20'+JSON['stringify'](_0x16c42d)+'\x20state:\x20'+JSON['stringify'](_0x1e3d54)+'\x20store:\x20'+kvStore['toString']());let {key:_0x5ad385,gid:_0x1324dc}=normalize(_0x16c42d);_0x5ad385=_0x5ad385||globalThis['distributi'+'on']['util']['id']['getID'](_0x1e3d54),_0x1324dc=_0x1324dc||'local';if(!_0x5ad385)return _0x10ee97(new Error('Configurat'+'ion\x20key\x20is'+'\x20required\x20'+'for\x20append'));kvStore['append']({'key':_0x5ad385,'gid':_0x1324dc},_0x1e3d54),log('[mem.appen'+'d]\x20store\x20('+'after):\x20'+kvStore['toString']());const _0x6916b9=kvStore['get']({'key':_0x5ad385,'gid':_0x1324dc});if(_0x10ee97)return _0x10ee97(null,_0x6916b9);return;return _0x10ee97(new Error('mem.append'+'\x20not\x20imple'+'mented'));};function get(_0x281f15,_0x286642){log('[mem.get]\x20'+'configurat'+'ion:\x20'+JSON['stringify'](_0x281f15)+'\x20store:\x20'+kvStore['toString']());let {key:_0x3e5999,gid:_0x390e83}=normalize(_0x281f15);_0x390e83=_0x390e83||'local';if(_0x3e5999){const _0x3835b4=kvStore['get']({'key':_0x3e5999,'gid':_0x390e83});return _0x3835b4?_0x286642(null,_0x3835b4):_0x286642(new Error('Memory\x20key'+'\x20\x22'+_0x3e5999+('\x22\x20not\x20foun'+'d\x20for\x20')+_0x390e83+'\x27s\x20store'));}else{let _0x133ce4=kvStore['store'][_0x390e83]||{};return _0x133ce4=Object['keys'](_0x133ce4),_0x286642(null,_0x133ce4);}return;return _0x286642(new Error('mem.get\x20no'+'t\x20implemen'+'ted'));}function del(_0x531e2b,_0x373c66){log('[mem.del]\x20'+'configurat'+'ion:\x20'+JSON['stringify'](_0x531e2b)+'\x20store:\x20'+kvStore['toString']());let {key:_0x10424e,gid:_0x286333}=normalize(_0x531e2b);_0x286333=_0x286333||'local';const _0x14d102=kvStore['del']({'key':_0x10424e,'gid':_0x286333});log('[mem.del]\x20'+'store\x20(aft'+'er):\x20'+kvStore['toString']());return _0x14d102?_0x373c66(null,_0x14d102):_0x373c66(new Error('Memory\x20key'+'\x20\x22'+_0x10424e+('\x22\x20not\x20foun'+'d\x20for\x20')+_0x286333+'\x27s\x20store'));return;return _0x373c66(new Error('mem.del\x20no'+'t\x20implemen'+'ted'));};module['exports']={'put':put,'get':get,'del':del,'append':append};
10
10
  /* eslint-enable */
@@ -6,5 +6,5 @@ Do NOT edit this file directly. Use it as a black box.
6
6
 
7
7
  If you notice any issues with using this file, please contact the TAs.
8
8
  */
9
- const fs=require('fs'),path=require('path'),log=require('../util/lo'+'g'),baseFolder=path['join'](__dirname,'../../stor'+'e');!fs['existsSync'](baseFolder)&&fs['mkdirSync'](baseFolder);const nodeFolder=path['join'](baseFolder,'s-'+globalThis['distributi'+'on']['util']['id']['getSID'](globalThis['distributi'+'on']['node']['config']));!fs['existsSync'](nodeFolder)&&fs['mkdirSync'](nodeFolder);function normalize(_0x173895){if(_0x173895===null)return{'key':null,'gid':null};else return typeof _0x173895==='string'?{'key':_0x173895,'gid':null}:_0x173895;}function put(_0x5d8678,_0x3f2b2a,_0x4c7881){log('[store.put'+']\x20configur'+'ation:\x20'+JSON['stringify'](_0x3f2b2a)+'\x20state:\x20'+JSON['stringify'](_0x5d8678)),_0x3f2b2a=normalize(_0x3f2b2a),_0x3f2b2a['key']=_0x3f2b2a['key']||globalThis['distributi'+'on']['util']['id']['getID'](_0x5d8678),_0x3f2b2a['gid']=_0x3f2b2a['gid']||'local';const _0x55d57f=globalThis['distributi'+'on']['util']['serialize'](_0x5d8678),_0x413a5c=Buffer['from'](_0x3f2b2a['key'])['toString']('base64'),_0x43d508=path['join'](nodeFolder,_0x3f2b2a['gid']+'-'+_0x413a5c);fs['writeFile'](_0x43d508,_0x55d57f,_0x3d5e4d=>{return _0x3d5e4d?_0x4c7881(_0x3d5e4d):_0x4c7881(null,_0x5d8678);});return;return _0x4c7881(new Error('store.put\x20'+'not\x20implem'+'ented'));}function get(_0x2968d0,_0x5ce40d){log('[store.get'+']\x20configur'+'ation:\x20'+JSON['stringify'](_0x2968d0)),_0x2968d0=normalize(_0x2968d0),_0x2968d0['gid']=_0x2968d0['gid']||'local';if(!_0x2968d0['key']){fs['readdir'](nodeFolder,(_0x5e2fe5,_0x47cd19)=>{if(_0x5e2fe5)return _0x5ce40d(_0x5e2fe5);const _0x112293=[];for(let _0x281063=-0x5ad*-0x1+-0x1153+-0x2a*-0x47;_0x281063<_0x47cd19['length'];_0x281063++){const _0x4a391f=_0x47cd19[_0x281063]['split']('-'),_0x540ef8=_0x4a391f[-0xb1b*0x3+-0x474+0x25c5];if(_0x540ef8!==_0x2968d0['gid'])continue;const _0x51f1df=_0x4a391f[_0x4a391f['length']-(-0x1*0x4f9+-0x236f+0x2869)];_0x112293['push'](Buffer['from'](_0x51f1df,'base64')['toString']());}return _0x5ce40d(null,_0x112293);});return;}const _0x26045e=Buffer['from'](_0x2968d0['key'])['toString']('base64'),_0x279361=path['join'](nodeFolder,_0x2968d0['gid']+'-'+_0x26045e);fs['readFile'](_0x279361,(_0x435cba,_0x3f816d)=>{return _0x435cba?_0x435cba['code']==='ENOENT'?_0x5ce40d(new Error('File\x20'+_0x279361+('\x20(from\x20key'+'\x20\x27')+_0x2968d0['key']+('\x27)\x20not\x20fou'+'nd\x20for\x20gro'+'up\x20')+_0x2968d0['gid'])):_0x5ce40d(_0x435cba):_0x5ce40d(null,globalThis['distributi'+'on']['util']['deserializ'+'e'](_0x3f816d['toString']()));});return;return _0x5ce40d(new Error('store.get\x20'+'not\x20implem'+'ented'));}function del(_0x384bab,_0x1dd0cd){log('[store.del'+']\x20configur'+'ation:\x20'+JSON['stringify'](_0x384bab)),_0x384bab=normalize(_0x384bab),_0x384bab['gid']=_0x384bab['gid']||'local';const _0x1e7596=Buffer['from'](_0x384bab['key'])['toString']('base64'),_0x23451e=path['join'](nodeFolder,_0x384bab['gid']+'-'+_0x1e7596);get(_0x384bab,(_0x19fd95,_0x4541dd)=>{if(_0x19fd95)return _0x1dd0cd(_0x19fd95);fs['rm'](_0x23451e,_0x57d804=>{return _0x57d804?_0x1dd0cd(_0x57d804):_0x1dd0cd(null,_0x4541dd);});});return;return _0x1dd0cd(new Error('store.del\x20'+'not\x20implem'+'ented'));}function append(_0x3200de,_0x428db0,_0xc98a04){log('[store.app'+'end]\x20confi'+'guration:\x20'+JSON['stringify'](_0x428db0)+'\x20state:\x20'+JSON['stringify'](_0x3200de)),_0x428db0=normalize(_0x428db0),_0x428db0['key']=_0x428db0['key']||globalThis['distributi'+'on']['util']['id']['getID'](_0x3200de),_0x428db0['gid']=_0x428db0['gid']||'local';const _0x26cb35=Buffer['from'](_0x428db0['key'])['toString']('base64'),_0x324711=path['join'](nodeFolder,_0x428db0['gid']+'-'+_0x26cb35),_0x2608b4=_0xc16035=>{const _0x352de5=globalThis['distributi'+'on']['util']['serialize'](_0xc16035);fs['writeFile'](_0x324711,_0x352de5,_0x5474f2=>{if(_0x5474f2)return _0xc98a04(_0x5474f2);return _0xc98a04(null,_0xc16035);});};return fs['readFile'](_0x324711,(_0x1031a6,_0x2a8851)=>{if(_0x1031a6){if(_0x1031a6['code']==='ENOENT'){const _0x4adc0e=Array['isArray'](_0x3200de)?_0x3200de:[_0x3200de];return _0x2608b4(_0x4adc0e);}return _0xc98a04(_0x1031a6);}let _0x46b091;try{_0x46b091=globalThis['distributi'+'on']['util']['deserializ'+'e'](_0x2a8851['toString']());}catch(_0x122b8d){return _0xc98a04(_0x122b8d);}!Array['isArray'](_0x46b091)&&(_0x46b091=[_0x46b091]);const _0x5ee081=Array['isArray'](_0x3200de)?_0x46b091['concat'](_0x3200de):_0x46b091['concat']([_0x3200de]);return _0x2608b4(_0x5ee081);}),_0xc98a04(new Error('store.appe'+'nd\x20not\x20imp'+'lemented'));}module['exports']={'put':put,'get':get,'del':del,'append':append};
9
+ const fs=require('fs'),path=require('path'),log=require('../util/lo'+'g'),baseFolder=path['join'](__dirname,'../../stor'+'e');!fs['existsSync'](baseFolder)&&fs['mkdirSync'](baseFolder);const nodeFolder=path['join'](baseFolder,'s-'+globalThis['distributi'+'on']['util']['id']['getSID'](globalThis['distributi'+'on']['node']['config']));!fs['existsSync'](nodeFolder)&&fs['mkdirSync'](nodeFolder);function normalize(_0x2badee){if(_0x2badee===null)return{'key':null,'gid':null};else return typeof _0x2badee==='string'?{'key':_0x2badee,'gid':null}:_0x2badee;}function put(_0x46339e,_0x26458e,_0x2e44ff){log('[store.put'+']\x20configur'+'ation:\x20'+JSON['stringify'](_0x26458e)+'\x20state:\x20'+JSON['stringify'](_0x46339e)),_0x26458e=normalize(_0x26458e),_0x26458e['key']=_0x26458e['key']||globalThis['distributi'+'on']['util']['id']['getID'](_0x46339e),_0x26458e['gid']=_0x26458e['gid']||'local';const _0xe27021=globalThis['distributi'+'on']['util']['serialize'](_0x46339e),_0x1ae4e7=Buffer['from'](_0x26458e['key'])['toString']('base64'),_0x3a6a1f=path['join'](nodeFolder,_0x26458e['gid']+'-'+_0x1ae4e7);fs['writeFile'](_0x3a6a1f,_0xe27021,_0x3e4123=>{return _0x3e4123?_0x2e44ff(_0x3e4123):_0x2e44ff(null,_0x46339e);});return;return _0x2e44ff(new Error('store.put\x20'+'not\x20implem'+'ented'));}function get(_0x3b5a37,_0x2061f6){log('[store.get'+']\x20configur'+'ation:\x20'+JSON['stringify'](_0x3b5a37)),_0x3b5a37=normalize(_0x3b5a37),_0x3b5a37['gid']=_0x3b5a37['gid']||'local';if(!_0x3b5a37['key']){fs['readdir'](nodeFolder,(_0x5669c0,_0x2f0902)=>{if(_0x5669c0)return _0x2061f6(_0x5669c0);const _0x579e45=[];for(let _0x35a615=0xebc+-0x23b*-0xb+-0x2745;_0x35a615<_0x2f0902['length'];_0x35a615++){const _0x28adac=_0x2f0902[_0x35a615]['split']('-'),_0x173ffa=_0x28adac[-0x859*0x1+0x485+0x3d4];if(_0x173ffa!==_0x3b5a37['gid'])continue;const _0x405289=_0x28adac[_0x28adac['length']-(-0xf50+0x1e92*-0x1+0x2de3)];_0x579e45['push'](Buffer['from'](_0x405289,'base64')['toString']());}return _0x2061f6(null,_0x579e45);});return;}const _0x3aade6=Buffer['from'](_0x3b5a37['key'])['toString']('base64'),_0x446187=path['join'](nodeFolder,_0x3b5a37['gid']+'-'+_0x3aade6);fs['readFile'](_0x446187,(_0x399841,_0x23e796)=>{return _0x399841?_0x399841['code']==='ENOENT'?_0x2061f6(new Error('File\x20'+_0x446187+('\x20(from\x20key'+'\x20\x27')+_0x3b5a37['key']+('\x27)\x20not\x20fou'+'nd\x20for\x20gro'+'up\x20')+_0x3b5a37['gid'])):_0x2061f6(_0x399841):_0x2061f6(null,globalThis['distributi'+'on']['util']['deserializ'+'e'](_0x23e796['toString']()));});return;return _0x2061f6(new Error('store.get\x20'+'not\x20implem'+'ented'));}function del(_0x5eca7f,_0xebf973){log('[store.del'+']\x20configur'+'ation:\x20'+JSON['stringify'](_0x5eca7f)),_0x5eca7f=normalize(_0x5eca7f),_0x5eca7f['gid']=_0x5eca7f['gid']||'local';const _0x491781=Buffer['from'](_0x5eca7f['key'])['toString']('base64'),_0x29203c=path['join'](nodeFolder,_0x5eca7f['gid']+'-'+_0x491781);get(_0x5eca7f,(_0x5ebc3d,_0x112ef6)=>{if(_0x5ebc3d)return _0xebf973(_0x5ebc3d);fs['rm'](_0x29203c,_0x1c3629=>{return _0x1c3629?_0xebf973(_0x1c3629):_0xebf973(null,_0x112ef6);});});return;return _0xebf973(new Error('store.del\x20'+'not\x20implem'+'ented'));}function append(_0x98b0ed,_0x4dece0,_0x4434b1){log('[store.app'+'end]\x20confi'+'guration:\x20'+JSON['stringify'](_0x4dece0)+'\x20state:\x20'+JSON['stringify'](_0x98b0ed)),_0x4dece0=normalize(_0x4dece0),_0x4dece0['key']=_0x4dece0['key']||globalThis['distributi'+'on']['util']['id']['getID'](_0x98b0ed),_0x4dece0['gid']=_0x4dece0['gid']||'local';const _0x57c074=Buffer['from'](_0x4dece0['key'])['toString']('base64'),_0x248de5=path['join'](nodeFolder,_0x4dece0['gid']+'-'+_0x57c074),_0x24a0b6=_0x4c3552=>{const _0x477cff=globalThis['distributi'+'on']['util']['serialize'](_0x4c3552);fs['writeFile'](_0x248de5,_0x477cff,_0x316dec=>{if(_0x316dec)return _0x4434b1(_0x316dec);return _0x4434b1(null,_0x4c3552);});};fs['readFile'](_0x248de5,(_0xcbc1bf,_0x178c17)=>{if(_0xcbc1bf){if(_0xcbc1bf['code']==='ENOENT'){const _0x34ace0=Array['isArray'](_0x98b0ed)?_0x98b0ed:[_0x98b0ed];return _0x24a0b6(_0x34ace0);}return _0x4434b1(_0xcbc1bf);}let _0x1e51cd;try{_0x1e51cd=globalThis['distributi'+'on']['util']['deserializ'+'e'](_0x178c17['toString']());}catch(_0x441d7d){return _0x4434b1(_0x441d7d);}!Array['isArray'](_0x1e51cd)&&(_0x1e51cd=[_0x1e51cd]);const _0x24be88=Array['isArray'](_0x98b0ed)?_0x1e51cd['concat'](_0x98b0ed):_0x1e51cd['concat']([_0x98b0ed]);return _0x24a0b6(_0x24be88);});return;return _0x4434b1(new Error('store.appe'+'nd\x20not\x20imp'+'lemented'));}module['exports']={'put':put,'get':get,'del':del,'append':append};
10
10
  /* eslint-enable */
@@ -6,5 +6,5 @@ Do NOT edit this file directly. Use it as a black box.
6
6
 
7
7
  If you notice any issues with using this file, please contact the TAs.
8
8
  */
9
- const nativeFunctions={'forward':new Map(),'reverse':new Map()};function createNativeMap(){const _0x35dfa6=[];function _0x5a4e60(_0x676140,_0x31d35a){if(_0x31d35a===null||_0x31d35a===undefined)return;if(_0x35dfa6['indexOf'](_0x31d35a)!==-(0xdff*-0x2+0x23a6+0x7a7*-0x1))return;_0x35dfa6['push'](_0x31d35a),Object['getOwnProp'+'ertyNames'](_0x31d35a)['forEach'](_0x4beb5a=>{if(typeof _0x31d35a[_0x4beb5a]==='function'){nativeFunctions['forward']['set'](_0x31d35a[_0x4beb5a],_0x676140+'.'+_0x4beb5a),nativeFunctions['reverse']['set'](_0x676140+'.'+_0x4beb5a,_0x31d35a[_0x4beb5a]);return;}typeof _0x31d35a[_0x4beb5a]==='object'&&_0x35dfa6['indexOf'](_0x31d35a[_0x4beb5a])===-(-0x2012*-0x1+0x946+-0x1*0x2957)&&_0x5a4e60(_0x676140+'.'+_0x4beb5a,_0x31d35a[_0x4beb5a]);});}for(const _0x421636 of require('repl')['_builtinLi'+'bs']){if(['wasi','sys','punycode','crypto']['includes'](_0x421636))continue;const _0x48e8d2=require(_0x421636);_0x5a4e60(_0x421636,_0x48e8d2);}}createNativeMap();function decycleObject(_0x185a9b){if(_0x185a9b===null||_0x185a9b===undefined)return _0x185a9b;const _0x30b92a=new WeakMap();function _0x3a1587(_0x32a59b,_0x31516b){let _0x40e0bf;if(!(typeof _0x32a59b==='object'&&!(_0x32a59b instanceof Error)&&!(_0x32a59b instanceof Date)&&!(_0x32a59b instanceof Boolean)&&_0x32a59b!==null))return _0x32a59b;const _0x10ceb8=_0x30b92a['get'](_0x32a59b);if(_0x10ceb8!==undefined)return{'$reference':_0x10ceb8};return _0x30b92a['set'](_0x32a59b,_0x31516b),Array['isArray'](_0x32a59b)?(_0x40e0bf=[],_0x32a59b['forEach'](function(_0x5d28b5,_0x162321){const _0x2ab30c=[..._0x31516b,_0x162321];_0x40e0bf[_0x162321]=_0x3a1587(_0x5d28b5,_0x2ab30c);})):(_0x40e0bf={},Object['keys'](_0x32a59b)['forEach'](_0x1fd335=>{const _0x63fa97=[..._0x31516b,JSON['stringify'](_0x1fd335)];_0x40e0bf[_0x1fd335]=_0x3a1587(_0x32a59b[_0x1fd335],_0x63fa97);})),_0x40e0bf;}return _0x3a1587(_0x185a9b,[]);}function serializeBaseStructure(_0x34ac8a){return{'type':typeof _0x34ac8a,'value':_0x34ac8a['toString']()};}function serializeBigInt(_0x30fb24){return{'type':'bigint','value':_0x30fb24['toString']()};}function serializeUndefined(_0x8d1ff2){return{'type':'undefined','value':''};}function serializeObject(_0x3edd79){if(_0x3edd79===null)return{'type':'null','value':''};else{if(_0x3edd79 instanceof Date)return{'type':'date','value':_0x3edd79['toJSON']()};else{if(_0x3edd79 instanceof Error)return{'type':'error','value':serializeObject({'name':_0x3edd79['name'],'message':_0x3edd79['message'],'cause':_0x3edd79['cause']})};}}if(_0x3edd79['$reference']!==undefined&&Object['keys'](_0x3edd79)['length']===-0x1*0x15cf+0x1c19+-0x1*0x649)return{'type':'reference','value':_0x3edd79['$reference']};const _0x1b6fdc=Object['fromEntrie'+'s'](Object['entries'](_0x3edd79)['map'](([_0x490e53,_0x53d409])=>{const _0x5a87ce=serialize(_0x53d409);return[_0x490e53,JSON['parse'](_0x5a87ce)];}));return{'type':_0x3edd79 instanceof Array?'array':'object','value':_0x1b6fdc};}function serializeFunction(_0x5438a1){const _0x18c8c0=nativeFunctions['forward']['get'](_0x5438a1);return _0x18c8c0===undefined?{'type':'function','value':_0x5438a1['toString']()}:{'type':'native','value':_0x18c8c0};}function serialize(_0x1b9faf){_0x1b9faf=decycleObject(_0x1b9faf);let _0x414e6f;switch(typeof _0x1b9faf){case'object':_0x414e6f=serializeObject(_0x1b9faf);break;case'function':_0x414e6f=serializeFunction(_0x1b9faf);break;case'undefined':_0x414e6f=serializeUndefined(_0x1b9faf);break;case'number':case'string':case'boolean':_0x414e6f=serializeBaseStructure(_0x1b9faf);break;case'bigint':_0x414e6f=serializeBigInt(_0x1b9faf);break;}return JSON['stringify'](_0x414e6f);}function deserializeObject(_0x4a0d3a,_0x2612d6){for(const [_0x2de30b,_0x346dac]of Object['entries'](_0x4a0d3a)){_0x2612d6[_0x2de30b]=doSerialize(_0x346dac,_0x2612d6);}return _0x2612d6;}function deserializeArray(_0x5dfb6f,_0x5b0823){for(const [_0x134191,_0x3dc79b]of Object['entries'](_0x5dfb6f)){_0x5b0823[Number(_0x134191)]=doSerialize(_0x3dc79b,_0x5b0823);}return _0x5b0823;}function deserializeString(_0x355e7f){return _0x355e7f;}function deserializeNumber(_0x19d683){return Number(_0x19d683);}function deserializeFunction(_0x3ef33a){return new Function('return\x20'+_0x3ef33a)();}function deserializeError(_0x48cbb4){const _0x16a8ea=doSerialize(_0x48cbb4),_0x104047=new Error(_0x16a8ea['message'],_0x16a8ea['cause']);return _0x104047;}function deserializeReference(_0x2acfd1,_0x42b8d0){let _0x1ac3e0=_0x42b8d0;for(const _0x2c43f8 of _0x2acfd1){_0x1ac3e0=_0x1ac3e0[JSON['parse'](_0x2c43f8)];}return _0x1ac3e0;}function deserializeNative(_0x472aad){const _0x23dcbc=nativeFunctions['reverse']['get'](_0x472aad);if(_0x23dcbc===undefined)throw Error('Function\x20n'+'ot\x20found\x20i'+'n\x20native\x20f'+'unction\x20ma'+'p');return _0x23dcbc;}function deserializeReferences(_0x2ab907,_0x4fe960){if(typeof _0x2ab907!=='object'||_0x2ab907===null)return _0x2ab907;if(_0x2ab907['type']==='reference')return deserializeReference(_0x2ab907['value'],_0x4fe960);if(Array['isArray'](_0x2ab907))for(let _0x2c962b=-0xf7d+-0x3*-0x26f+0x830;_0x2c962b<_0x2ab907['length'];_0x2c962b++){_0x2ab907[_0x2c962b]=deserializeReferences(_0x2ab907[_0x2c962b],_0x4fe960);}else for(const [_0x36b720,_0x427176]of Object['entries'](_0x2ab907)){_0x2ab907[_0x36b720]=deserializeReferences(_0x427176,_0x4fe960);}return _0x2ab907;}function doSerialize(_0x52f3be,_0x239fb1=null){let _0x2cee1e;if(typeof _0x52f3be==='object')_0x2cee1e=_0x52f3be;else{if(typeof _0x52f3be==='string')_0x2cee1e=JSON['parse'](_0x52f3be);else throw new Error('Invalid\x20ar'+'gument\x20typ'+'e:\x20'+typeof _0x52f3be+'.');}_0x239fb1===null&&(_0x239fb1={});switch(_0x2cee1e['type']){case'object':return deserializeObject(_0x2cee1e['value'],{});case'array':return deserializeArray(_0x2cee1e['value'],[]);case'function':return deserializeFunction(_0x2cee1e['value']);case'native':return deserializeNative(_0x2cee1e['value']);case'reference':return _0x2cee1e;case'number':return deserializeNumber(_0x2cee1e['value']);case'string':return deserializeString(_0x2cee1e['value']);case'boolean':return _0x2cee1e['value']==='true';case'bigint':return BigInt(_0x2cee1e['value']);case'date':return new Date(_0x2cee1e['value']);case'error':return deserializeError(_0x2cee1e['value']);case'null':return null;case'undefined':return undefined;default:throw new Error('Invalid\x20se'+'rialized\x20o'+'bject\x20type');}}function deserialize(_0x28bcf3){if(typeof _0x28bcf3!=='string')throw new Error('Invalid\x20ar'+'gument\x20typ'+'e:\x20'+typeof _0x28bcf3+'.');const _0x43b7d7=doSerialize(_0x28bcf3);return deserializeReferences(_0x43b7d7,_0x43b7d7),_0x43b7d7;}module['exports']={'serialize':serialize,'deserialize':deserialize};
9
+ const nativeFunctions={'forward':new Map(),'reverse':new Map()};function createNativeMap(){const _0x164178=[];function _0x221c6b(_0x487b4f,_0x1db5ae){if(_0x1db5ae===null||_0x1db5ae===undefined)return;if(_0x164178['indexOf'](_0x1db5ae)!==-(-0x25e6+-0x155*0xf+0x39e2))return;_0x164178['push'](_0x1db5ae),Object['getOwnProp'+'ertyNames'](_0x1db5ae)['forEach'](_0x5af9ac=>{if(typeof _0x1db5ae[_0x5af9ac]==='function'){nativeFunctions['forward']['set'](_0x1db5ae[_0x5af9ac],_0x487b4f+'.'+_0x5af9ac),nativeFunctions['reverse']['set'](_0x487b4f+'.'+_0x5af9ac,_0x1db5ae[_0x5af9ac]);return;}typeof _0x1db5ae[_0x5af9ac]==='object'&&_0x164178['indexOf'](_0x1db5ae[_0x5af9ac])===-(-0x228e*0x1+-0x5d0+0x285f)&&_0x221c6b(_0x487b4f+'.'+_0x5af9ac,_0x1db5ae[_0x5af9ac]);});}for(const _0x2fd67d of require('repl')['_builtinLi'+'bs']){if(['wasi','sys','punycode','crypto']['includes'](_0x2fd67d))continue;const _0x1e7037=require(_0x2fd67d);_0x221c6b(_0x2fd67d,_0x1e7037);}}createNativeMap();function decycleObject(_0x21aecc){if(_0x21aecc===null||_0x21aecc===undefined)return _0x21aecc;const _0x32baf2=new WeakMap();function _0x7fe6c0(_0x20d751,_0x21c2c9){let _0x28e4d4;if(!(typeof _0x20d751==='object'&&!(_0x20d751 instanceof Error)&&!(_0x20d751 instanceof Date)&&!(_0x20d751 instanceof Boolean)&&_0x20d751!==null))return _0x20d751;const _0x52e6e6=_0x32baf2['get'](_0x20d751);if(_0x52e6e6!==undefined)return{'$reference':_0x52e6e6};return _0x32baf2['set'](_0x20d751,_0x21c2c9),Array['isArray'](_0x20d751)?(_0x28e4d4=[],_0x20d751['forEach'](function(_0x9b0f5d,_0x16535e){const _0x8bafd1=[..._0x21c2c9,_0x16535e];_0x28e4d4[_0x16535e]=_0x7fe6c0(_0x9b0f5d,_0x8bafd1);})):(_0x28e4d4={},Object['keys'](_0x20d751)['forEach'](_0x3ff09a=>{const _0x435cce=[..._0x21c2c9,JSON['stringify'](_0x3ff09a)];_0x28e4d4[_0x3ff09a]=_0x7fe6c0(_0x20d751[_0x3ff09a],_0x435cce);})),_0x28e4d4;}return _0x7fe6c0(_0x21aecc,[]);}function serializeBaseStructure(_0x37ef23){return{'type':typeof _0x37ef23,'value':_0x37ef23['toString']()};}function serializeBigInt(_0x2c05d5){return{'type':'bigint','value':_0x2c05d5['toString']()};}function serializeUndefined(_0x538837){return{'type':'undefined','value':''};}function serializeObject(_0x5d46ea){if(_0x5d46ea===null)return{'type':'null','value':''};else{if(_0x5d46ea instanceof Date)return{'type':'date','value':_0x5d46ea['toJSON']()};else{if(_0x5d46ea instanceof Error)return{'type':'error','value':serializeObject({'name':_0x5d46ea['name'],'message':_0x5d46ea['message'],'cause':_0x5d46ea['cause']})};}}if(_0x5d46ea['$reference']!==undefined&&Object['keys'](_0x5d46ea)['length']===0x132+-0x191a+0x17e9)return{'type':'reference','value':_0x5d46ea['$reference']};const _0x21595b=Object['fromEntrie'+'s'](Object['entries'](_0x5d46ea)['map'](([_0xb7b85e,_0x3573b9])=>{const _0xede808=serialize(_0x3573b9);return[_0xb7b85e,JSON['parse'](_0xede808)];}));return{'type':_0x5d46ea instanceof Array?'array':'object','value':_0x21595b};}function serializeFunction(_0x480fed){const _0x316507=nativeFunctions['forward']['get'](_0x480fed);return _0x316507===undefined?{'type':'function','value':_0x480fed['toString']()}:{'type':'native','value':_0x316507};}function serialize(_0x433a59){_0x433a59=decycleObject(_0x433a59);let _0x33ef51;switch(typeof _0x433a59){case'object':_0x33ef51=serializeObject(_0x433a59);break;case'function':_0x33ef51=serializeFunction(_0x433a59);break;case'undefined':_0x33ef51=serializeUndefined(_0x433a59);break;case'number':case'string':case'boolean':_0x33ef51=serializeBaseStructure(_0x433a59);break;case'bigint':_0x33ef51=serializeBigInt(_0x433a59);break;}return JSON['stringify'](_0x33ef51);}function deserializeObject(_0x527ff1,_0x42ee51){for(const [_0x1f2cf1,_0x2dfd16]of Object['entries'](_0x527ff1)){_0x42ee51[_0x1f2cf1]=doSerialize(_0x2dfd16,_0x42ee51);}return _0x42ee51;}function deserializeArray(_0x140ec7,_0x18a9d8){for(const [_0xdf5c8e,_0x572b3e]of Object['entries'](_0x140ec7)){_0x18a9d8[Number(_0xdf5c8e)]=doSerialize(_0x572b3e,_0x18a9d8);}return _0x18a9d8;}function deserializeString(_0x29ba21){return _0x29ba21;}function deserializeNumber(_0x243099){return Number(_0x243099);}function deserializeFunction(_0x860ff0){return new Function('return\x20'+_0x860ff0)();}function deserializeError(_0x490678){const _0x5bbd89=doSerialize(_0x490678),_0x17d34d=new Error(_0x5bbd89['message'],_0x5bbd89['cause']);return _0x17d34d;}function deserializeReference(_0x57dd50,_0x197ca1){let _0x324395=_0x197ca1;for(const _0x22cded of _0x57dd50){_0x324395=_0x324395[JSON['parse'](_0x22cded)];}return _0x324395;}function deserializeNative(_0x124c24){const _0x4f69ff=nativeFunctions['reverse']['get'](_0x124c24);if(_0x4f69ff===undefined)throw Error('Function\x20n'+'ot\x20found\x20i'+'n\x20native\x20f'+'unction\x20ma'+'p');return _0x4f69ff;}function deserializeReferences(_0x25efc1,_0x1a1857){if(typeof _0x25efc1!=='object'||_0x25efc1===null)return _0x25efc1;if(_0x25efc1['type']==='reference')return deserializeReference(_0x25efc1['value'],_0x1a1857);if(Array['isArray'](_0x25efc1))for(let _0x3d7be3=-0x243d+-0xcb3*0x1+0x74*0x6c;_0x3d7be3<_0x25efc1['length'];_0x3d7be3++){_0x25efc1[_0x3d7be3]=deserializeReferences(_0x25efc1[_0x3d7be3],_0x1a1857);}else for(const [_0xfee1ff,_0x3090c5]of Object['entries'](_0x25efc1)){_0x25efc1[_0xfee1ff]=deserializeReferences(_0x3090c5,_0x1a1857);}return _0x25efc1;}function doSerialize(_0x2acb65,_0x53cfb9=null){let _0x4bf04b;if(typeof _0x2acb65==='object')_0x4bf04b=_0x2acb65;else{if(typeof _0x2acb65==='string')_0x4bf04b=JSON['parse'](_0x2acb65);else throw new Error('Invalid\x20ar'+'gument\x20typ'+'e:\x20'+typeof _0x2acb65+'.');}_0x53cfb9===null&&(_0x53cfb9={});switch(_0x4bf04b['type']){case'object':return deserializeObject(_0x4bf04b['value'],{});case'array':return deserializeArray(_0x4bf04b['value'],[]);case'function':return deserializeFunction(_0x4bf04b['value']);case'native':return deserializeNative(_0x4bf04b['value']);case'reference':return _0x4bf04b;case'number':return deserializeNumber(_0x4bf04b['value']);case'string':return deserializeString(_0x4bf04b['value']);case'boolean':return _0x4bf04b['value']==='true';case'bigint':return BigInt(_0x4bf04b['value']);case'date':return new Date(_0x4bf04b['value']);case'error':return deserializeError(_0x4bf04b['value']);case'null':return null;case'undefined':return undefined;default:throw new Error('Invalid\x20se'+'rialized\x20o'+'bject\x20type');}}function deserialize(_0x13f335){if(typeof _0x13f335!=='string')throw new Error('Invalid\x20ar'+'gument\x20typ'+'e:\x20'+typeof _0x13f335+'.');const _0x3c86f0=doSerialize(_0x13f335);return deserializeReferences(_0x3c86f0,_0x3c86f0),_0x3c86f0;}module['exports']={'serialize':serialize,'deserialize':deserialize};
10
10
  /* eslint-enable */
@@ -6,5 +6,5 @@ Do NOT edit this file directly. Use it as a black box.
6
6
 
7
7
  If you notice any issues with using this file, please contact the TAs.
8
8
  */
9
- const log=require('../util/lo'+'g.js');globalThis['toLocal']=new Map();function createRPC(_0x5a49bc){const _0xd49be6=globalThis['distributi'+'on']['util']['id']['getID'](globalThis['distributi'+'on']['util']['serialize'](_0x5a49bc));globalThis['toLocal']['set'](_0xd49be6,_0x5a49bc);let _0x5b135b='\x0a\x20\x20\x20\x20const'+'\x20callback\x20'+'=\x20args.pop'+'();\x0a\x0a\x20\x20\x20\x20l'+'et\x20remote\x20'+'=\x20{node:\x20'+JSON['stringify'](globalThis['distributi'+'on']['node']['config'])+(',\x20service:'+'\x20\x27')+_0xd49be6+('\x27,\x20method:'+'\x20\x27call\x27};\x0a'+'\x20\x20\x20\x20let\x20me'+'ssage\x20=\x20ar'+'gs;\x0a\x0a\x20\x20\x20\x20d'+'istributio'+'n.local.co'+'mm.send(me'+'ssage,\x20rem'+'ote,\x20(erro'+'r,\x20respons'+'e)\x20=>\x20{\x0a\x20\x20'+'\x20\x20\x20\x20if\x20(er'+'ror)\x20{\x0a\x20\x20\x20'+'\x20\x20\x20\x20\x20callb'+'ack(error)'+';\x0a\x20\x20\x20\x20\x20\x20}\x20'+'else\x20{\x0a\x20\x20\x20'+'\x20\x20\x20\x20\x20callb'+'ack(null,\x20'+'response);'+'\x0a\x20\x20\x20\x20\x20\x20}\x0a\x20'+'\x20\x20\x20});\x0a\x20\x20');return log('Created\x20RP'+'C\x20with\x20id:'+'\x20'+_0xd49be6),new Function('...args',_0x5b135b);}function toAsync(_0x452d3c){log('Converting'+'\x20function\x20'+'to\x20async:\x20'+_0x452d3c['name']+':\x20'+_0x452d3c['toString']()['replace'](/\n/g,'|'));const _0x435fd5=(..._0x1a3ffa)=>{const _0x5d5c1b=_0x1a3ffa['pop']();try{const _0xa98c6b=_0x452d3c(..._0x1a3ffa);return _0x5d5c1b(null,_0xa98c6b);}catch(_0x3447e7){return _0x5d5c1b(_0x3447e7);}};return _0x435fd5['toString']=()=>_0x452d3c['toString'](),_0x435fd5;}function dispatchMessage(_0x1b7acb,_0xc332d7,{key:_0x3f2260},_0xab9960,_0x2d849a){globalThis['distributi'+'on'][_0xab9960['gid']]['status']['get']('nid',(_0x41504c,_0x5e270a)=>{const _0x27ad58=Object['values'](_0x5e270a),_0x494ea5=globalThis['distributi'+'on']['util']['id']['getID'](_0x3f2260),_0x437604=_0xab9960['hash'](_0x494ea5,_0x27ad58),_0xdd0985=_0x437604['substring'](0x1153+0x10d6+-0x2229,-0x1f*0xc9+-0x1*-0x168b+0x1d1);globalThis['distributi'+'on']['local']['groups']['get'](_0xab9960['gid'],(_0x2aee21,_0x481548)=>{if(_0x481548){const _0x512fe4=_0x481548[_0xdd0985];globalThis['distributi'+'on']['local']['comm']['send'](_0x1b7acb,{..._0xc332d7,'node':_0x512fe4},_0x2d849a);}else return _0x2d849a(_0x2aee21);});});}module['exports']={'createRPC':createRPC,'toAsync':toAsync,'dispatchMessage':dispatchMessage};
9
+ const log=require('../util/lo'+'g.js');globalThis['toLocal']=new Map();function createRPC(_0x4d2a9b){const _0x144604=globalThis['distributi'+'on']['util']['id']['getID'](globalThis['distributi'+'on']['util']['serialize'](_0x4d2a9b));globalThis['toLocal']['set'](_0x144604,_0x4d2a9b);let _0x73c7f4='\x0a\x20\x20\x20\x20const'+'\x20callback\x20'+'=\x20args.pop'+'();\x0a\x0a\x20\x20\x20\x20l'+'et\x20remote\x20'+'=\x20{node:\x20'+JSON['stringify'](globalThis['distributi'+'on']['node']['config'])+(',\x20service:'+'\x20\x27')+_0x144604+('\x27,\x20method:'+'\x20\x27call\x27};\x0a'+'\x20\x20\x20\x20let\x20me'+'ssage\x20=\x20ar'+'gs;\x0a\x0a\x20\x20\x20\x20d'+'istributio'+'n.local.co'+'mm.send(me'+'ssage,\x20rem'+'ote,\x20(erro'+'r,\x20respons'+'e)\x20=>\x20{\x0a\x20\x20'+'\x20\x20\x20\x20if\x20(er'+'ror)\x20{\x0a\x20\x20\x20'+'\x20\x20\x20\x20\x20callb'+'ack(error)'+';\x0a\x20\x20\x20\x20\x20\x20}\x20'+'else\x20{\x0a\x20\x20\x20'+'\x20\x20\x20\x20\x20callb'+'ack(null,\x20'+'response);'+'\x0a\x20\x20\x20\x20\x20\x20}\x0a\x20'+'\x20\x20\x20});\x0a\x20\x20');return log('Created\x20RP'+'C\x20with\x20id:'+'\x20'+_0x144604),new Function('...args',_0x73c7f4);}function toAsync(_0x3e8a82){log('Converting'+'\x20function\x20'+'to\x20async:\x20'+_0x3e8a82['name']+':\x20'+_0x3e8a82['toString']()['replace'](/\n/g,'|'));const _0x215433=(..._0x4c5175)=>{const _0x3c60f6=_0x4c5175['pop']();try{const _0x1277ef=_0x3e8a82(..._0x4c5175);return _0x3c60f6(null,_0x1277ef);}catch(_0x5c8845){return _0x3c60f6(_0x5c8845);}};return _0x215433['toString']=()=>_0x3e8a82['toString'](),_0x215433;}function dispatchMessage(_0x18869b,_0x4845ac,{key:_0x37ac02},_0x32a048,_0x58581d){globalThis['distributi'+'on'][_0x32a048['gid']]['status']['get']('nid',(_0x30046d,_0x3aca81)=>{const _0x5ad82a=Object['values'](_0x3aca81),_0x1396e3=globalThis['distributi'+'on']['util']['id']['getID'](_0x37ac02),_0x115a9c=_0x32a048['hash'](_0x1396e3,_0x5ad82a),_0x327b03=_0x115a9c['substring'](0x4d*-0x1b+-0xd13*0x2+0x2245,-0x682+0x3f*0x49+0x30*-0x3d);globalThis['distributi'+'on']['local']['groups']['get'](_0x32a048['gid'],(_0x37f1ad,_0x55b29d)=>{if(_0x55b29d){const _0x4815ff=_0x55b29d[_0x327b03];globalThis['distributi'+'on']['local']['comm']['send'](_0x18869b,{..._0x4845ac,'node':_0x4815ff},_0x58581d);}else return _0x58581d(_0x37f1ad);});});}module['exports']={'createRPC':createRPC,'toAsync':toAsync,'dispatchMessage':dispatchMessage};
10
10
  /* eslint-enable */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brown-ds/distribution",
3
- "version": "0.2.31",
3
+ "version": "0.2.32",
4
4
  "description": "A library for building distributed systems.",
5
5
  "main": "distribution.js",
6
6
  "useLibrary": false,