@brown-ds/distribution 0.0.24 → 0.0.30
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.
- package/distribution/all/comm.js +1 -1
- package/distribution/all/gossip.js +1 -1
- package/distribution/all/groups.js +1 -1
- package/distribution/all/mem.js +1 -1
- package/distribution/all/mr.js +1 -1
- package/distribution/all/routes.js +1 -1
- package/distribution/all/status.js +1 -1
- package/distribution/all/store.js +1 -1
- package/distribution/local/comm.js +1 -1
- package/distribution/local/gossip.js +1 -1
- package/distribution/local/groups.js +1 -1
- package/distribution/local/mem.js +1 -1
- package/distribution/local/node.js +1 -1
- package/distribution/local/routes.js +1 -1
- package/distribution/local/status.js +1 -1
- package/distribution/local/store.js +1 -1
- package/distribution/util/id.js +1 -1
- package/distribution/util/serialization.js +1 -1
- package/distribution/util/wire.js +1 -1
- package/package.json +1 -1
- package/.eslintrc +0 -33
package/distribution/all/comm.js
CHANGED
|
@@ -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 comm=function(
|
|
9
|
+
const comm=function(_0x48a27e){let _0x21c2c2={};return _0x21c2c2['gid']=_0x48a27e['gid']||'global',{'send':(_0x4fe6d6,_0x556559,_0x13fdcb)=>{global['distributi'+'on']['local']['groups']['get'](_0x21c2c2['gid'],(_0x34177f,_0x3c762b)=>{let _0x43e53a=Object['keys'](_0x3c762b)['length'];if(_0x43e53a===0x23fa+-0x240+-0x21ba){_0x13fdcb(new Error('No\x20nodes\x20f'+'ound'));return;}let _0x153528=0x74a+-0x1d80+0x1636,_0x3fee4c={},_0x3763a9={};for(let _0x41f4cf of Object['keys'](_0x3c762b)){let _0x2774a6=_0x3c762b[_0x41f4cf],_0xed4852={'node':{'ip':_0x2774a6['ip'],'port':_0x2774a6['port']},'service':_0x556559['service'],'method':_0x556559['method']};distribution['local']['comm']['send'](_0x4fe6d6,_0xed4852,(_0x1cd74d,_0x37f5ef)=>{_0x1cd74d?_0x3763a9[_0x41f4cf]=_0x1cd74d:_0x3fee4c[_0x41f4cf]=_0x37f5ef,_0x153528+=0x11b8+-0x1e18+0xc61,_0x153528===_0x43e53a&&_0x13fdcb(_0x3763a9,_0x3fee4c);});}});}};};module['exports']=comm;
|
|
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 id=require('../util/id');
|
|
9
|
+
const id=require('../util/id');let gossip=function(_0x2c092a){let _0x456f42={};return _0x456f42['gid']=_0x2c092a['gid']||'global',_0x456f42['subset']=_0x2c092a['subset']||function(_0x2ce2b9){return Math['ceil'](Math['log'](_0x2ce2b9['length']));},{'send':(_0x1dbbaa,_0x43305d,_0x33fc7b)=>{global['distributi'+'on']['local']['groups']['get'](_0x456f42['gid'],(_0x5a700c,_0x9bf48d)=>{let _0x549350=_0x456f42['subset'](Object['keys'](_0x9bf48d)),_0x55cffa=function(_0x2a3ad1){let _0x5024fe=new Set();while(_0x5024fe['size']<_0x549350){let _0x59c9a0=Math['floor'](Math['random']()*_0x2a3ad1['length']);_0x5024fe['add'](_0x2a3ad1[_0x59c9a0]);}return _0x5024fe;},_0x4c6b65=_0x55cffa(Object['keys'](_0x9bf48d)),_0x63ad61={},_0x412dc8={},_0x25c6f0=-0x6*0x44+-0x23ae+-0x16f*-0x1a;if(_0x1dbbaa['mid']&&_0x1dbbaa['gid']){}else _0x1dbbaa={'message':_0x1dbbaa,'remote':_0x43305d,'mid':id['getMID'](_0x1dbbaa),'gid':_0x456f42['gid']};for(let _0x5dbeca of _0x4c6b65){let _0x5e1c92=_0x9bf48d[_0x5dbeca],_0x504df3={'node':{'ip':_0x5e1c92['ip'],'port':_0x5e1c92['port']},'service':'gossip','method':'recv'};global['distributi'+'on']['local']['comm']['send']([_0x1dbbaa],_0x504df3,(_0x2d60e0,_0x1c5fa0)=>{_0x2d60e0?_0x412dc8[_0x5dbeca]=_0x2d60e0:_0x63ad61[_0x5dbeca]=_0x1c5fa0,_0x25c6f0+=0xf*-0x3a+-0x2*-0x3f1+0x47b*-0x1,_0x25c6f0===_0x549350&&(_0x33fc7b&&_0x33fc7b(_0x412dc8,_0x63ad61));});}});},'at':(_0x2d2245,_0x21fc9b,_0x5ed429)=>{let _0x402bb1=setInterval(_0x21fc9b,_0x2d2245);_0x5ed429&&_0x5ed429(null,_0x402bb1);},'del':(_0x21b20a,_0x1f9bd9)=>{clearInterval(_0x21b20a),_0x1f9bd9&&_0x1f9bd9(null,_0x21b20a);}};};module['exports']=gossip;
|
|
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 groups=function(
|
|
9
|
+
const groups=function(_0x1cd586){let _0x23c429={};return _0x23c429['gid']=_0x1cd586['gid']||'global',{'put':(_0x1992ee,_0x5429e0,_0x328d1d)=>{global['distributi'+'on']['local']['groups']['put'](_0x1992ee,_0x5429e0,(_0x1988b8,_0x39f5d6)=>{_0x1988b8&&_0x328d1d(_0x1988b8),global['distributi'+'on'][_0x23c429['gid']]['comm']['send']([_0x1992ee,_0x5429e0],{'service':'groups','method':'put'},_0x328d1d);});},'del':(_0x80645b,_0x4ea437)=>{global['distributi'+'on'][_0x23c429['gid']]['comm']['send']([_0x80645b],{'service':'groups','method':'del'},_0x4ea437);},'get':(_0x261499,_0x4cef7d)=>{global['distributi'+'on'][_0x23c429['gid']]['comm']['send']([_0x261499],{'service':'groups','method':'get'},_0x4cef7d);},'add':(_0x3a1b60,_0x3a8f14,_0x69145a)=>{global['distributi'+'on']['local']['groups']['add'](_0x3a1b60,_0x3a8f14,(_0x21fb92,_0x3e5761)=>{_0x21fb92&&_0x69145a(_0x21fb92),global['distributi'+'on'][_0x23c429['gid']]['comm']['send']([_0x3a1b60,_0x3a8f14],{'service':'groups','method':'add'},_0x69145a);});},'rem':(_0x4fc17d,_0x2112c4,_0x3f3ff7)=>{global['distributi'+'on']['local']['groups']['rem'](_0x4fc17d,_0x2112c4,(_0x3e5d96,_0x2893c1)=>{_0x3e5d96&&_0x3f3ff7(_0x3e5d96),global['distributi'+'on'][_0x23c429['gid']]['comm']['send']([_0x4fc17d,_0x2112c4],{'service':'groups','method':'rem'},_0x3f3ff7);});}};};module['exports']=groups;
|
|
10
10
|
/* eslint-enable */
|
package/distribution/all/mem.js
CHANGED
|
@@ -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 util=require('../util/ut'+'il'),distribution=global['distributi'+'on'],log=require('../util/lo'+'g');function getNode(
|
|
9
|
+
const util=require('../util/ut'+'il'),distribution=global['distributi'+'on'],log=require('../util/lo'+'g');function getNode(_0x3c6c47,_0x4c93a3,_0x39e89e){typeof _0x4c93a3==='object'&&(_0x4c93a3=_0x4c93a3['key']),distribution[_0x3c6c47['gid']]['status']['get']('nid',(_0x2c6ab6,_0x41332a)=>{let _0x131d42=Object['values'](_0x41332a),_0xcbb2ec=util['id']['getID'](_0x4c93a3),_0x24856f=_0x3c6c47['hash'](_0xcbb2ec,_0x131d42),_0x4c17c2=_0x24856f['substring'](-0x11*0x14c+-0x346*0x5+0x266a,-0x1bfe+-0x8a4+0x24a7);distribution['local']['groups']['get'](_0x3c6c47['gid'],(_0x4b2918,_0x4aaa56)=>{let _0x46762c=_0x4aaa56[_0x4c17c2];log('[mem\x20(getN'+'ode)]\x20conf'+'iguration:'+'\x20'+JSON['stringify'](_0x4c93a3)+'group:\x20'+JSON['stringify'](_0x4aaa56)+'\x20node:\x20'+JSON['stringify'](_0x46762c)+'nid:\x20'+JSON['stringify'](_0x24856f)+'\x20sid:\x20'+JSON['stringify'](_0x4c17c2)),_0x39e89e(_0x46762c);});});}function normalize(_0xc02eee,_0x59c255){let _0x5646d4={};_0xc02eee===null&&(_0xc02eee={});if(typeof _0xc02eee==='string')_0x5646d4['key']=_0xc02eee,_0x5646d4['gid']=_0x59c255,_0x5646d4['action']='put';else typeof _0xc02eee==='object'&&(_0x5646d4['key']=_0xc02eee['key'],_0x5646d4['gid']=_0xc02eee['gid']||_0x59c255,_0x5646d4['action']=_0xc02eee['action']||'put');return _0x5646d4;};const mem=function(_0x254f5a){let _0x20c5aa={};return _0x20c5aa['gid']=_0x254f5a['gid']||'all',_0x20c5aa['hash']=_0x254f5a['hash']||util['id']['naiveHash'],{'get':(_0x592f66,_0x43f7cf)=>{if(!_0x592f66){let _0x3a03ac=[{'key':null,'gid':_0x20c5aa['gid']}];distribution[_0x20c5aa['gid']]['comm']['send'](_0x3a03ac,{'service':'mem','method':'get'},(_0x2fa8fb,_0x1a097b)=>{let _0x483f2e=Object['values'](_0x1a097b)['reduce']((_0x228d71,_0x11d9a7)=>_0x228d71['concat'](_0x11d9a7),[]);_0x43f7cf(_0x2fa8fb,_0x483f2e);});return;}_0x592f66=normalize(_0x592f66,_0x20c5aa['gid']),getNode(_0x20c5aa,_0x592f66,_0x328825=>{let _0x27d18e=[_0x592f66],_0x32bffa={'service':'mem','method':'get','node':_0x328825};log('[all.mem.g'+'et]\x20config'+'uration:\x20'+JSON['stringify'](_0x592f66)+'\x20node:\x20'+JSON['stringify'](global['nodeConfig'])+('\x20target\x20no'+'de:\x20')+JSON['stringify'](_0x328825)),distribution['local']['comm']['send'](_0x27d18e,_0x32bffa,_0x43f7cf);});},'put':(_0x598893,_0x54a0d7,_0x449d37)=>{_0x54a0d7=_0x54a0d7||util['id']['getID'](_0x598893),_0x54a0d7=normalize(_0x54a0d7,_0x20c5aa['gid']),getNode(_0x20c5aa,_0x54a0d7,_0x273ccc=>{let _0x8db966=[_0x598893,_0x54a0d7],_0x2314c8={'service':'mem','method':'put','node':_0x273ccc};log('[all.mem.p'+'ut]\x20state:'+'\x20'+JSON['stringify'](_0x598893)+('configurat'+'ion:\x20')+JSON['stringify'](_0x54a0d7)+('target\x20nod'+'e:\x20')+JSON['stringify'](_0x273ccc)),distribution['local']['comm']['send'](_0x8db966,_0x2314c8,_0x449d37);});},'del':(_0x4139be,_0x41e39c)=>{getNode(_0x20c5aa,_0x4139be,_0xf21c59=>{let _0x114740=[{'key':_0x4139be,'gid':_0x20c5aa['gid']}],_0x3c4b73={'service':'mem','method':'del','node':_0xf21c59};distribution['local']['comm']['send'](_0x114740,_0x3c4b73,_0x41e39c);});},'reconf':(_0x4dad7f,_0x34dfb1)=>{distribution[_0x20c5aa['gid']]['mem']['get'](null,(_0x1894ad,_0x5aea84)=>{distribution[_0x20c5aa['gid']]['status']['get']('nid',(_0x57509b,_0x3c96cd)=>{let _0x2ff3ad=Object['values'](_0x3c96cd),_0x2da451=Object['values'](_0x4dad7f)['map'](_0x16eefd=>util['id']['getNID'](_0x16eefd)),_0x443fc6=0x5f9*0x3+0xf*0x172+0x147*-0x1f;const _0x300ad2=()=>{_0x443fc6===_0x5aea84['length']&&_0x34dfb1();};if(_0x5aea84['length']===0xb8*0x4+0x14fb+-0x17db){_0x34dfb1();return;}for(let _0x4bbd36 of _0x5aea84){let _0x3cdb4e=util['id']['getID'](_0x4bbd36),_0x3c532c=_0x20c5aa['hash'](_0x3cdb4e,_0x2da451),_0x28d8b5=_0x20c5aa['hash'](_0x3cdb4e,_0x2ff3ad);if(_0x3c532c===_0x28d8b5){_0x443fc6++,_0x300ad2();continue;}let _0x44e68c=_0x4dad7f[_0x3c532c['substring'](0x1ece+-0x236+-0x1c98,0x6d+0xbaf+-0xc17)],_0x3161b0=[{'key':_0x4bbd36,'gid':_0x20c5aa['gid']}],_0x3bbfb7={'service':'mem','method':'del','node':_0x44e68c};distribution['local']['comm']['send'](_0x3161b0,_0x3bbfb7,(_0x3c1541,_0x450b49)=>{distribution[_0x20c5aa['gid']]['mem']['put'](_0x450b49,_0x4bbd36,(_0x1b90c1,_0x4f6879)=>{_0x443fc6++,_0x300ad2();});});}});});}};};module['exports']=mem;
|
|
10
10
|
/* eslint-enable */
|
package/distribution/all/mr.js
CHANGED
|
@@ -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 distribution=require('../../dist'+'ribution'),id=distribution['util']['id'],mr=function(
|
|
9
|
+
const distribution=require('../../dist'+'ribution'),id=distribution['util']['id'],mr=function(_0x2c5607={'gid':'all'}){const _0x44318e={};return _0x44318e['gid']=_0x2c5607['gid'],{'exec':(_0x5a012f,_0x1b3ad7)=>{const _0x1d87ed=id['getSID'](_0x5a012f);mrSvc={'mapper':_0x5a012f['map'],'reducer':_0x5a012f['reduce'],'map':function(_0x485fa0,_0x89ec28,_0x2372a3,_0x19556e=function(){}){if(_0x485fa0['length']==0x34a+0x34c+-0x34b*0x2)_0x19556e(null,{});else{let _0x180e3a=[],_0x56344a=-0x699*-0x5+-0x1aef*-0x1+0x1a*-0x24e;_0x485fa0['forEach'](_0x3052fe=>{distribution[_0x89ec28]['store']['get'](_0x3052fe,(_0x9c0d8b,_0x39b495)=>{_0x56344a++;const _0x387897=this['mapper'](_0x3052fe,_0x39b495);Array['isArray'](_0x387897)?_0x180e3a['push'](..._0x387897):_0x180e3a['push'](_0x387897),_0x56344a==_0x485fa0['length']&&distribution['local']['store']['put'](_0x180e3a,_0x2372a3+'_map',(_0x58d765,_0x31d8da)=>{_0x19556e(_0x58d765,_0x180e3a);});});});}},'shuffle':function(_0x3a589f,_0x565717,_0x11c047=function(){}){distribution['local']['store']['get'](_0x565717+'_map',(_0x6ffd8a,_0x5f5728)=>{!_0x6ffd8a?(cnt=0x1a23+0xf*-0x255+0x2*0x46c,_0x5f5728['forEach'](_0x407239=>{const [_0x27d837]=Object['keys'](_0x407239);distribution[_0x3a589f]['mem']['put'](_0x407239[_0x27d837],{'key':_0x27d837,'action':'append'},(_0x125dc6,_0x5053ca)=>{cnt++,cnt==_0x5f5728['length']&&_0x11c047(null,_0x5f5728);});})):_0x11c047(_0x6ffd8a,{});});},'reduce':function(_0x2c8a31,_0x57a7e9,_0x57afe9){distribution['local']['mem']['get']({'key':null,'gid':_0x2c8a31},(_0xc3ab37,_0x4c717d)=>{let _0x16ae98=[],_0x13f74d=-0x170b+-0x13*0x12a+-0xb*-0x41b;_0x4c717d['length']==0x54a*0x5+-0xaf5+-0xf7d&&_0x57afe9(null,null),_0x4c717d['forEach'](_0x56ef42=>distribution['local']['mem']['get']({'key':_0x56ef42,'gid':_0x2c8a31},(_0xec6e23,_0x574eda)=>{let _0x5ccbbb=this['reducer'](_0x56ef42,_0x574eda);_0x16ae98=_0x16ae98['concat'](_0x5ccbbb),_0x13f74d++,_0x13f74d==_0x4c717d['length']&&_0x57afe9(null,_0x16ae98);}));});}};const _0x57a91c=function(_0x3b4078,_0x25bc80){let _0x5e656f={};return Object['keys'](_0x25bc80)['forEach'](_0x549d25=>{_0x5e656f[_0x549d25]=[];}),_0x3b4078['forEach'](_0x57ae52=>{let _0x3898a1=id['getID'](_0x57ae52),_0x1366b4=id['naiveHash'](_0x3898a1,Object['keys'](_0x25bc80));_0x5e656f[_0x1366b4]['push'](_0x57ae52);}),_0x5e656f;};distribution[_0x44318e['gid']]['routes']['put'](mrSvc,'mr-'+_0x1d87ed,(_0x5515f6,_0x3b0c98)=>{distribution['local']['groups']['get'](_0x44318e['gid'],(_0x3bc002,_0x1ede33)=>{let _0x1c35c6=_0x57a91c(_0x5a012f['keys'],_0x1ede33),_0x1c51f9=0x21d2+-0x1449+-0x2b5*0x5;const _0x28d92c=Object['keys'](_0x1ede33)['length'];let _0x49eb71={'service':'mr-'+_0x1d87ed,'method':'map'};for(let _0xb25b00 in _0x1ede33){if(!![]){_0x49eb71['node']=_0x1ede33[_0xb25b00];let _0x17678b=[_0x1c35c6[_0xb25b00],_0x44318e['gid'],_0x1d87ed];distribution['local']['comm']['send'](_0x17678b,_0x49eb71,(_0x470936,_0x6e7838)=>{++_0x1c51f9;if(_0x1c51f9==_0x28d92c){let _0x3b5efb={'service':'mr-'+_0x1d87ed,'method':'shuffle'};distribution[_0x44318e['gid']]['comm']['send']([_0x44318e['gid'],_0x1d87ed],_0x3b5efb,(_0x30fa7a,_0x426326)=>{let _0x350928={'service':'mr-'+_0x1d87ed,'method':'reduce'};distribution[_0x44318e['gid']]['comm']['send']([_0x44318e['gid'],_0x1d87ed],_0x350928,(_0x10098c,_0x21fe13)=>{let _0x1eed2a=[];for(let _0x3d0951 of Object['values'](_0x21fe13)){_0x3d0951!==null&&(_0x1eed2a=_0x1eed2a['concat'](_0x3d0951));}_0x1b3ad7(_0x10098c,_0x1eed2a);return;distribution[_0x44318e['gid']]['routes']['rem']('mr-'+_0x1d87ed,(_0x1dbdd0,_0x2feafd)=>{_0x1b3ad7(null,_0x1eed2a);});});});}});}}});});}};};module['exports']=mr;
|
|
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 routes=function(
|
|
9
|
+
const routes=function(_0x4a10d6){let _0x1ec543={};return _0x1ec543['gid']=_0x4a10d6['gid']||'global',{'put':(_0x5e9850,_0x2d0889,_0x2bec70)=>{global['distributi'+'on'][_0x1ec543['gid']]['comm']['send']([_0x5e9850,_0x2d0889],{'service':'routes','method':'put'},_0x2bec70);},'rem':(_0x153c49,_0x5e95e8)=>{global['distributi'+'on'][_0x1ec543['gid']]['comm']['send']([_0x153c49],{'service':'routes','method':'rem'},_0x5e95e8);}};};module['exports']=routes;
|
|
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 status=function(
|
|
9
|
+
const status=function(_0x10e916){let _0x1a9d7f={};return _0x1a9d7f['gid']=_0x10e916['gid']||'global',{'get':(_0x19080f,_0xa09c20)=>{let _0x37276a=[_0x19080f],_0x24351b={'service':'status','method':'get'};global['distributi'+'on'][_0x1a9d7f['gid']]['comm']['send'](_0x37276a,_0x24351b,(_0x5ee7a3,_0x2fc89d)=>{switch(_0x19080f){case'heapTotal':let _0x476534=Object['values'](_0x2fc89d)['reduce']((_0x2bb271,_0x1c6692)=>{return _0x2bb271+_0x1c6692;},-0x1*0x240a+-0x1400+-0x957*-0x6);_0xa09c20(_0x5ee7a3,_0x476534);break;case'nid':let _0xac85e6=Object['values'](_0x2fc89d)['reduce']((_0x1d7179,_0x2cf423)=>{return _0x1d7179['concat'](_0x2cf423);},[]);_0xa09c20(_0x5ee7a3,_0xac85e6);break;default:_0xa09c20(_0x5ee7a3,_0x2fc89d);break;}});},'spawn':(_0x4dd9f2,_0x3fa0ed)=>{_0x3fa0ed=_0x3fa0ed||function(){},global['distributi'+'on']['local']['status']['spawn'](_0x4dd9f2,(_0x4a0fe6,_0x519888)=>{_0x4a0fe6?_0x3fa0ed(_0x4a0fe6):global['distributi'+'on']['local']['groups']['add'](_0x1a9d7f['gid'],_0x4dd9f2,()=>{_0x3fa0ed(null,_0x519888);}),distribution[_0x1a9d7f['gid']]['comm']['send']([_0x1a9d7f['gid'],_0x4dd9f2],{'service':'groups','method':'add'},()=>{});});},'stop':_0x431cb2=>{distribution[_0x1a9d7f['gid']]['comm']['send']([],{'service':'status','method':'stop'},_0x431cb2);}};};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
|
|
9
|
+
const distribution=global['distributi'+'on'],util=distribution['util'],log=require('../util/lo'+'g');function getNode(_0x3e9e60,_0x4b46f6,_0xe6fefe){distribution[_0x3e9e60['gid']]['status']['get']('nid',(_0x2ae0db,_0x3cfb71)=>{let _0x4fb87d=Object['values'](_0x3cfb71),_0x24b6fd=util['id']['getID'](_0x4b46f6),_0x1e834b=_0x3e9e60['hash'](_0x24b6fd,_0x4fb87d),_0x470dc0=_0x1e834b['substring'](-0x50a*0x3+0x2dd+-0xc41*-0x1,0x6ae*-0x5+-0x1d39+0xfa9*0x4);distribution['local']['groups']['get'](_0x3e9e60['gid'],(_0x21efc1,_0x29fdb0)=>{let _0x2449f7=_0x29fdb0[_0x470dc0];_0xe6fefe(_0x2449f7);});});}const store=function(_0x5dbb60){let _0x57a9ab={};return _0x57a9ab['gid']=_0x5dbb60['gid']||'all',_0x57a9ab['hash']=_0x5dbb60['hash']||util['id']['naiveHash'],{'get':(_0x2e73fd,_0x140ec0)=>{if(!_0x2e73fd){let _0x3a84aa=[{'key':null,'gid':_0x57a9ab['gid']}];distribution[_0x57a9ab['gid']]['comm']['send'](_0x3a84aa,{'service':'store','method':'get'},(_0x2e9aa2,_0x508a89)=>{log('[all.store'+'.get\x20null\x20'+'given\x20as\x20k'+'ey.\x20keys:\x20'+JSON['stringify'](_0x508a89)+'\x20errors:\x20'+JSON['stringify'](_0x2e9aa2));let _0x26371f=Object['values'](_0x508a89)['reduce']((_0xf6566e,_0x50861c)=>_0xf6566e['concat'](_0x50861c),[]);_0x140ec0(_0x2e9aa2,_0x26371f);});return;}getNode(_0x57a9ab,_0x2e73fd,_0x12e128=>{let _0x1bc8e1=[{'key':_0x2e73fd,'gid':_0x57a9ab['gid']}],_0x766431={'service':'store','method':'get','node':_0x12e128};distribution['local']['comm']['send'](_0x1bc8e1,_0x766431,_0x140ec0);});},'put':(_0x2a1326,_0x4b1dfa,_0x43b473)=>{_0x4b1dfa=_0x4b1dfa||util['id']['getID'](_0x2a1326),getNode(_0x57a9ab,_0x4b1dfa,_0x224dfe=>{let _0x50b6dd=[_0x2a1326,{'key':_0x4b1dfa,'gid':_0x57a9ab['gid']}],_0x2ad5bc={'service':'store','method':'put','node':_0x224dfe};log('[all.store'+'.put]:\x20(gi'+'d:\x20'+_0x57a9ab['gid']+')\x20'+JSON['stringify'](_0x2a1326)+'\x20'+JSON['stringify'](_0x4b1dfa)+('\x20target\x20no'+'de:\x20')+JSON['stringify'](_0x224dfe)),distribution['local']['comm']['send'](_0x50b6dd,_0x2ad5bc,_0x43b473);});},'del':(_0x211b98,_0x1c3adb)=>{getNode(_0x57a9ab,_0x211b98,_0xc10d0f=>{let _0x4086af=[{'key':_0x211b98,'gid':_0x57a9ab['gid']}],_0x4a2517={'service':'store','method':'del','node':_0xc10d0f};distribution['local']['comm']['send'](_0x4086af,_0x4a2517,_0x1c3adb);});},'reconf':(_0x18d2f0,_0x44d2a0)=>{distribution[_0x57a9ab['gid']]['store']['get'](null,(_0x14a159,_0x21891d)=>{distribution[_0x57a9ab['gid']]['status']['get']('nid',(_0x4b179c,_0xf55ddb)=>{let _0x4f2ccd=Object['values'](_0xf55ddb),_0x32968b=Object['values'](_0x18d2f0)['map'](_0x5a8956=>util['id']['getNID'](_0x5a8956));log('[store.rec'+'onf\x20receiv'+'ed\x20'+_0x21891d['length']+('\x20keys\x20from'+'\x20')+_0xf55ddb['length']+'\x20nodes');let _0x12bedd=0xd77+-0x2*-0x24+-0xdbf;const _0x4a4318=()=>{_0x12bedd===_0x21891d['length']&&_0x44d2a0();};if(_0x21891d['length']===0xed2+0x1496*0x1+-0x2368){_0x44d2a0();return;}for(let _0x4dc3a9 of _0x21891d){let _0x308386=util['id']['getID'](_0x4dc3a9),_0x30ecd0=_0x57a9ab['hash'](_0x308386,_0x32968b),_0x186048=_0x57a9ab['hash'](_0x308386,_0x4f2ccd);log('[store.rec'+'onf\x20old\x20ni'+'d:\x20'+_0x30ecd0+'\x20new\x20nid:\x20'+_0x186048);if(_0x30ecd0===_0x186048){_0x12bedd++,_0x4a4318();continue;}let _0x7c824=_0x18d2f0[_0x30ecd0['substring'](-0x1*-0xee0+0x399+0x1*-0x1279,-0x686+0x590+0x1*0xfb)],_0x23daca=[{'key':_0x4dc3a9,'gid':_0x57a9ab['gid']}],_0x23d0f6={'service':'store','method':'del','node':_0x7c824};log('[store.rec'+'onf]\x20delet'+'ing\x20key\x20'+_0x4dc3a9+'\x20from\x20'+JSON['stringify'](_0x23d0f6)),distribution['local']['comm']['send'](_0x23daca,_0x23d0f6,(_0x178a05,_0x52192f)=>{distribution[_0x57a9ab['gid']]['store']['put'](_0x52192f,_0x4dc3a9,(_0x5b35e7,_0x491613)=>{_0x12bedd++,_0x4a4318();});});}});});}};};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 http=require('http'),serialization=require('../util/se'+'rializatio'+'n'),log=require('../util/lo'+'g'),comm={};comm['send']=function(
|
|
9
|
+
const http=require('http'),serialization=require('../util/se'+'rializatio'+'n'),log=require('../util/lo'+'g'),comm={};comm['send']=function(_0x20222e,_0x178670,_0x1f7971){log('[comm.send'+']:\x20Sending'+'\x20'+JSON['stringify'](_0x20222e)+'to\x20'+_0x178670['service']+':'+_0x178670['method']+'\x20on\x20'+_0x178670['node']['ip']+':'+_0x178670['node']['port']);if(!_0x20222e instanceof Array)throw new Error('Message\x20mu'+'st\x20be\x20an\x20a'+'rray');let _0x2fbeb0=_0x178670['node'],_0xce7333=_0x178670['service'],_0x4c1e21=_0x178670['method'],_0x52546a=serialization['serialize'](_0x20222e);const _0x2e4d0a={'hostname':_0x2fbeb0['ip'],'port':_0x2fbeb0['port'],'path':'/'+_0xce7333+'/'+_0x4c1e21,'method':'PUT','headers':{'Content-Type':'applicatio'+'n/json','Content-Length':Buffer['byteLength'](_0x52546a)}},_0x3ec78a=http['request'](_0x2e4d0a,_0x5d18a5=>{let _0x152634='';_0x5d18a5['on']('data',function(_0x259772){_0x152634+=_0x259772;}),_0x5d18a5['on']('end',function(){_0x1f7971&&_0x1f7971(...serialization['deserializ'+'e'](_0x152634));}),_0x5d18a5['on']('error',function(_0x14ec87){_0x1f7971&&_0x1f7971(new Error('Error\x20on\x20r'+'esponse'));});});_0x3ec78a['on']('error',function(_0x3199f8){_0x1f7971&&_0x1f7971(new Error(_0x3199f8));}),_0x3ec78a['write'](_0x52546a),_0x3ec78a['end']();},module['exports']=comm;
|
|
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 gossip={},messageStore={'messages':[],'push':function(
|
|
9
|
+
const gossip={},messageStore={'messages':[],'push':function(_0x26d071){N=0x230a+0x55d+-0x285d,messageStore['messages']['push'](_0x26d071),messageStore['messages']['length']>N&&messageStore['messages']['shift']();},'has':function(_0x33111a){return messageStore['messages']['includes'](_0x33111a);}};gossip['recv']=function(_0x8be91c,_0x50c4b2){_0x50c4b2=_0x50c4b2||function(){};let _0x2356f6=_0x8be91c['message'],_0x5839c3=_0x8be91c['remote'],_0x3748be=_0x8be91c['mid'],_0x48d124=_0x8be91c['gid'];if(messageStore['has'](_0x3748be)){_0x50c4b2(new Error('Message\x20al'+'ready\x20rece'+'ived'));return;}global['distributi'+'on'][_0x48d124]['gossip']['send'](_0x8be91c,_0x5839c3),messageStore['push'](_0x3748be),_0x5839c3['node']={'ip':global['nodeConfig']['ip'],'port':global['nodeConfig']['port']},global['distributi'+'on']['local']['comm']['send'](_0x2356f6,_0x5839c3,(_0x38725f,_0x51ae4f)=>{_0x50c4b2(_0x38725f,_0x51ae4f);});},module['exports']=gossip;
|
|
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
|
-
let groupsStore=new Map();groupsStore['all']={};const
|
|
9
|
+
const id=require('../util/id');let groupsStore=new Map();groupsStore['all']={};const groups={};groups['get']=function(_0x548145,_0x553b6a){_0x553b6a=_0x553b6a||function(){},_0x548145 in groupsStore?_0x553b6a(null,groupsStore[_0x548145]):_0x553b6a(new Error('Group\x20'+_0x548145+'\x20not\x20found'));},groups['put']=function(_0x222237,_0x403eb1,_0x5f19f1){_0x403eb1=_0x403eb1||{},typeof _0x222237==='string'&&(_0x222237={'gid':_0x222237}),groupsStore[_0x222237['gid']]=_0x403eb1,Object['keys'](_0x403eb1)['forEach'](_0xf06562=>{groupsStore['all'][id['getSID'](_0x403eb1[_0xf06562])]=_0x403eb1[_0xf06562];}),global['distributi'+'on'][_0x222237['gid']]={},global['distributi'+'on'][_0x222237['gid']]['status']=require('../all/sta'+'tus')(_0x222237),global['distributi'+'on'][_0x222237['gid']]['comm']=require('../all/com'+'m')(_0x222237),global['distributi'+'on'][_0x222237['gid']]['gossip']=require('../all/gos'+'sip')(_0x222237),global['distributi'+'on'][_0x222237['gid']]['groups']=require('../all/gro'+'ups')(_0x222237),global['distributi'+'on'][_0x222237['gid']]['routes']=require('../all/rou'+'tes')(_0x222237),global['distributi'+'on'][_0x222237['gid']]['mem']=require('../all/mem')(_0x222237),global['distributi'+'on'][_0x222237['gid']]['store']=require('../all/sto'+'re')(_0x222237),global['distributi'+'on'][_0x222237['gid']]['mr']=require('../all/mr')(_0x222237),_0x5f19f1(null,_0x403eb1);},groups['del']=function(_0x4a05ae,_0xe732f5){if(_0x4a05ae in groupsStore){let _0x15cebb=groupsStore[_0x4a05ae];delete groupsStore[_0x4a05ae],_0xe732f5(null,_0x15cebb);}else _0xe732f5(new Error('Group\x20'+_0x4a05ae+'\x20not\x20found'));},groups['add']=function(_0x3cd98c,_0x17f119,_0x1be392){_0x1be392=_0x1be392||function(){},_0x3cd98c in groupsStore?(!groupsStore[_0x3cd98c]&&(groupsStore[_0x3cd98c]={}),groupsStore[_0x3cd98c][id['getSID'](_0x17f119)]=_0x17f119,groupsStore['all'][id['getSID'](_0x17f119)]=_0x17f119,_0x1be392&&_0x1be392(null,groupsStore[_0x3cd98c])):_0x1be392&&_0x1be392(new Error('Group\x20'+_0x3cd98c+'\x20not\x20found'));},groups['rem']=function(_0x249426,_0x43fc84,_0x1d472e){_0x1d472e=_0x1d472e||function(){},_0x249426 in groupsStore?(delete groupsStore[_0x249426][_0x43fc84],delete groupsStore['all'][_0x43fc84],_0x1d472e(null,groupsStore[_0x249426])):_0x1d472e(new Error('Group\x20'+_0x249426+'\x20not\x20found'));},module['exports']=groups;
|
|
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 id=require('../util/id'),log=require('../util/lo'+'g'),kvStore={'store':new Map(),'get'(
|
|
9
|
+
const id=require('../util/id'),log=require('../util/lo'+'g'),kvStore={'store':new Map(),'get'(_0x47199d){if(!this['store'][_0x47199d['gid']])return undefined;return this['store'][_0x47199d['gid']][_0x47199d['key']];},'put'(_0x3e896e,_0x29b433){!this['store'][_0x3e896e['gid']]&&(this['store'][_0x3e896e['gid']]=new Map()),this['store'][_0x3e896e['gid']][_0x3e896e['key']]=_0x29b433;},'append'(_0x1e74e1,_0x3f1af2){!this['get'](_0x1e74e1)&&this['put'](_0x1e74e1,[]),!Array['isArray'](this['get'](_0x1e74e1))&&this['put'](_0x1e74e1,[this['get'](_0x1e74e1)]),Array['isArray'](_0x3f1af2)?this['put'](_0x1e74e1,this['get'](_0x1e74e1)['concat'](_0x3f1af2)):this['store'][_0x1e74e1['gid']][_0x1e74e1['key']]['push'](_0x3f1af2);},'del'(_0x48426f){if(!this['store'][_0x48426f['gid']])return undefined;let _0x3feeed=this['store'][_0x48426f['gid']][_0x48426f['key']];return delete this['store'][_0x48426f['gid']][_0x48426f['key']],_0x3feeed;},'toString'(){let _0x46d2ee='';for(let _0x28bf17 in this['store']){_0x46d2ee+=_0x28bf17+':\x20'+JSON['stringify'](this['store'][_0x28bf17]);}return _0x46d2ee;}};function normalize(_0x2fc7d0){let _0x40af61={};_0x2fc7d0===null&&(_0x2fc7d0={});if(typeof _0x2fc7d0==='string')_0x40af61['key']=_0x2fc7d0,_0x40af61['gid']='local',_0x40af61['action']='put';else typeof _0x2fc7d0==='object'&&(_0x40af61['key']=_0x2fc7d0['key'],_0x40af61['gid']=_0x2fc7d0['gid'],_0x40af61['action']=_0x2fc7d0['action']);return _0x40af61;};const mem={};mem['put']=function(_0x365c29,_0x1eecc4,_0x5758ad){log('[mem.put]\x20'+'configurat'+'ion:\x20'+JSON['stringify'](_0x1eecc4)+'state:\x20'+JSON['stringify'](_0x365c29)+'\x20store:\x20'+kvStore['toString']()),_0x5758ad=_0x5758ad||function(){},_0x1eecc4=normalize(_0x1eecc4),_0x1eecc4['key']=_0x1eecc4['key']||id['getID'](_0x365c29),_0x1eecc4['gid']=_0x1eecc4['gid']||'local',_0x1eecc4['action']=_0x1eecc4['action']||'put',kvStore[_0x1eecc4['action']](_0x1eecc4,_0x365c29),log('[mem.put]\x20'+'store\x20(aft'+'er):\x20'+kvStore['toString']()),_0x5758ad&&_0x5758ad(null,_0x365c29);},mem['get']=function(_0x3fae4f,_0x481bad){log('[mem.get]\x20'+'configurat'+'ion:\x20'+JSON['stringify'](_0x3fae4f)+'\x20store:\x20'+kvStore['toString']()),_0x481bad=_0x481bad||function(){},_0x3fae4f=normalize(_0x3fae4f),_0x3fae4f['gid']=_0x3fae4f['gid']||'local';if(!_0x3fae4f['key']){let _0x447c41=kvStore['store'][_0x3fae4f['gid']]||{};_0x447c41=Object['keys'](_0x447c41),_0x481bad(null,_0x447c41);return;}let _0x4edd56=kvStore['get'](_0x3fae4f);_0x4edd56?_0x481bad(null,_0x4edd56):_0x481bad(new Error('Memory\x20key'+'\x20\x22'+_0x3fae4f['key']+('\x22\x20\x0a\x20\x20\x20\x20\x20\x20\x20'+'\x20not\x20found'+'\x20for\x20')+_0x3fae4f['gid']+'\x27s\x20store'));},mem['del']=function(_0x471de6,_0x176fba){_0x176fba=_0x176fba||function(){},_0x471de6=normalize(_0x471de6);let _0x1cda6d=kvStore['del'](_0x471de6);_0x1cda6d?_0x176fba(null,_0x1cda6d):_0x176fba(new Error('Memory\x20key'+'\x20\x22'+_0x471de6['key']+('\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20'+'not\x20found\x20'+'for\x20')+_0x471de6['gid']+'\x27s\x20store'));},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
|
-
const http=require('http'),url=require('url'),log=require('../util/lo'+'g'),serialization=require('../util/se'+'rializatio'+'n');function isValidBody(
|
|
9
|
+
const http=require('http'),url=require('url'),log=require('../util/lo'+'g'),serialization=require('../util/se'+'rializatio'+'n');function isValidBody(_0x3c90ba){error=undefined;if(_0x3c90ba['length']===0x1e00+0x45*0x79+-0x3e9d)return new Error('No\x20body');try{_0x3c90ba=JSON['parse'](_0x3c90ba);}catch(_0x143a6d){return _0x143a6d;}return error;}function endRequest(_0x278750,_0x4a1a1c){_0x278750['end'](serialization['serialize']([_0x4a1a1c]));}const start=function(_0x4f1000){const _0x594358=http['createServ'+'er']((_0x152767,_0x371f1d)=>{if(_0x152767['method']!=='PUT'){_0x371f1d['end'](serialization['serialize'](new Error('Method\x20not'+'\x20allowed!')));return;}const _0x5a24fd=url['parse'](_0x152767['url'])['pathname'],[,_0x26b13c,_0x2bd55b]=_0x5a24fd['split']('/');log('[server]\x20g'+'ot\x20request'+'\x20'+_0x26b13c+':'+_0x2bd55b);let _0x5a5a2a=[];_0x152767['on']('data',_0x36ab9e=>{_0x5a5a2a['push'](_0x36ab9e);}),_0x152767['on']('end',()=>{_0x5a5a2a=Buffer['concat'](_0x5a5a2a)['toString']();let _0x397d30;if(_0x397d30=isValidBody(_0x5a5a2a)){endRequest(_0x371f1d,_0x397d30);return;}_0x5a5a2a=JSON['parse'](_0x5a5a2a),_0x5a5a2a=serialization['deserializ'+'e'](_0x5a5a2a);let _0x381627=_0x5a5a2a;!Array['isArray'](_0x381627)&&endRequest(_0x371f1d,new Error('Invalid\x20ar'+'gument\x20typ'+'e,\x20expecte'+'d\x20array,\x20g'+'ot\x20'+typeof _0x381627));let _0x4805d4=_0x26b13c;global['distributi'+'on']['local']['routes']['get'](_0x4805d4,(_0x251e82,_0x4dbc9e)=>{const _0x1c8904=(_0x41cbed,_0x4b0d9c)=>{_0x371f1d['end'](serialization['serialize']([_0x41cbed,_0x4b0d9c]));};if(_0x251e82){_0x1c8904(_0x251e82);return;}if(!_0x4dbc9e[_0x2bd55b]){_0x1c8904(new Error('Method\x20'+_0x2bd55b+('\x20not\x20found'+'\x20in\x20servic'+'e\x20')+_0x4805d4));return;}log('[server]\x20\x20'+'Calling\x20se'+'rvice:\x20'+_0x4805d4+':'+_0x2bd55b+('\x20with\x20args'+':\x20')+JSON['stringify'](_0x381627));_0x381627['length']===0x7d6+0x263*0x1+0x28e*-0x4&&_0x4dbc9e[_0x2bd55b]['length']===0x661+-0xf20+0x8c2&&_0x381627['push'](undefined);try{_0x4dbc9e[_0x2bd55b](..._0x381627,_0x1c8904);}catch(_0x2e8cd2){_0x1c8904(_0x2e8cd2);}});});});_0x594358['listen'](global['nodeConfig']['port'],global['nodeConfig']['ip'],()=>{log('Server\x20run'+'ning\x20at\x20ht'+'tp://'+global['nodeConfig']['ip']+':'+global['nodeConfig']['port']+'/'),global['distributi'+'on']['node']['server']=_0x594358,_0x4f1000(_0x594358);}),_0x594358['on']('error',_0x2fe70b=>{log('Server\x20err'+'or:\x20'+_0x2fe70b);throw _0x2fe70b;});};module['exports']={'start':start};
|
|
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'),routesStore=new Map(),routes={};routes['get']=function(
|
|
9
|
+
const log=require('../util/lo'+'g'),routesStore=new Map(),routes={};routes['get']=function(_0x5bd4d0,_0x2f5845){log('[routes.ge'+'t]\x20Getting'+'\x20service:\x20'+_0x5bd4d0);if(!_0x2f5845)return;if(_0x5bd4d0 in routesStore){log('[routes.ge'+'t]\x20Found\x20s'+'ervice:\x20'+_0x5bd4d0);let _0x313ffc=routesStore[_0x5bd4d0];_0x2f5845(null,_0x313ffc);}else{const _0x1d001d=global['toLocal']['get'](_0x5bd4d0);_0x1d001d?(log('[routes.ge'+'t]\x20Found\x20R'+'PC:\x20'+_0x5bd4d0),_0x2f5845(null,{'call':_0x1d001d})):_0x2f5845(new Error('Service\x20'+_0x5bd4d0+('\x20not\x20found'+'\x20in\x20routes')));}},routes['put']=function(_0x109678,_0x5898b7,_0x52c330){log('[routes.pu'+'t]\x20Putting'+'\x20service:\x20'+_0x5898b7),routesStore[_0x5898b7]=_0x109678;_0x52c330&&_0x52c330(null,_0x5898b7);;},routes['rem']=function(_0x5a02a7,_0x3d6555){delete routesStore[_0x5a02a7];},module['exports']=routes;
|
|
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 id=require('../util/id'),log=require('../util/lo'+'g'),status={};global['moreStatus']={'sid':id['getSID'](global['nodeConfig']),'nid':id['getNID'](global['nodeConfig']),'counts':0x0},status['get']=function(
|
|
9
|
+
const id=require('../util/id'),log=require('../util/lo'+'g'),status={};global['moreStatus']={'sid':id['getSID'](global['nodeConfig']),'nid':id['getNID'](global['nodeConfig']),'counts':0x0},status['get']=function(_0x353928,_0x131b75){_0x131b75=_0x131b75||function(){};if(_0x353928 in global['nodeConfig'])_0x131b75(null,global['nodeConfig'][_0x353928]);else{if(_0x353928 in moreStatus)_0x131b75(null,moreStatus[_0x353928]);else{if(_0x353928==='heapTotal')_0x131b75(null,process['memoryUsag'+'e']()['heapTotal']);else _0x353928==='heapUsed'?_0x131b75(null,process['memoryUsag'+'e']()['heapUsed']):_0x131b75(new Error('Status\x20key'+'\x20not\x20found'));}}};const path=require('path'),{spawn}=require('child_proc'+'ess'),wire=require('../util/wi'+'re'),createSpawnedCb=function(_0x382ce5,_0x1b9ee4){let _0x6a8275='\x0a\x20\x20\x20\x20let\x20o'+'nStart\x20=\x20'+_0x382ce5['toString']()+(';\x0a\x0a\x20\x20\x20\x20let'+'\x20callbackR'+'PC\x20=\x20')+wire['createRPC'](wire['toAsync'](_0x1b9ee4))['toString']()+(';\x0a\x0a\x20\x20\x20\x20try'+'\x20{\x0a\x20\x20\x20\x20\x20\x20\x20'+'\x20onStart()'+';\x0a\x20\x20\x20\x20\x20\x20\x20\x20'+'callbackRP'+'C(null,\x20gl'+'obal.nodeC'+'onfig,\x20()\x20'+'=>\x20{});\x0a\x20\x20'+'\x20\x20}\x0a\x20\x20\x20\x20ca'+'tch\x20(e)\x20{\x0a'+'\x20\x20\x20\x20\x20\x20\x20\x20ca'+'llbackRPC('+'e,\x20null,\x20('+')\x20=>\x20{});\x0a'+'\x20\x20\x20\x20}\x0a\x20\x20\x20\x20');return new Function(_0x6a8275);};status['spawn']=function(_0x536dc8,_0x1a0f0c){const _0x87060d=_0x536dc8;_0x87060d['onStart']=_0x87060d['onStart']||function(){};if(!_0x87060d['port']||!_0x87060d['ip']){_0x1a0f0c(new Error('Port\x20and\x20I'+'P\x20are\x20requ'+'ired\x20in\x20th'+'e\x20configur'+'ation'));return;}log('[status.sp'+'awn]\x20Spawn'+'ing\x20node\x20w'+'ith\x20config'+'uration:\x20'+JSON['stringify'](_0x87060d)),_0x87060d['onStart']=createSpawnedCb(_0x87060d['onStart'],_0x1a0f0c);const _0x4b01d9=path['join'](__dirname,'../../dist'+'ribution.j'+'s');let _0x464f8c=spawn('node',[_0x4b01d9,'--config',global['distributi'+'on']['util']['serialize'](_0x87060d)],{'detached':!![],'stdio':'inherit'});_0x464f8c;},status['stop']=function(_0x46ba71){_0x46ba71=_0x46ba71||function(){},_0x46ba71(null,global['nodeConfig']),log('[status.st'+'op]\x20Shutti'+'ng\x20down\x20no'+'de'),global['distributi'+'on']['node']['server']['close'](),process['exit'](-0x1*0x1c12+-0x12c6+-0x8*-0x5db);},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 fs=require('fs'),path=require('path'),id=require('../util/id'),serialization=require('../util/se'+'rializatio'+'n'),
|
|
9
|
+
const fs=require('fs'),path=require('path'),id=require('../util/id'),serialization=require('../util/se'+'rializatio'+'n'),log=require('../util/lo'+'g'),baseFolder=path['join'](__dirname,'../../stor'+'e');!fs['existsSync'](baseFolder)&&fs['mkdirSync'](baseFolder);!fs['existsSync'](baseFolder+'/s-'+global['moreStatus']['sid'])&&fs['mkdirSync'](baseFolder+'/s-'+global['moreStatus']['sid']);function normalize(_0x2649f8){let _0x332f66={};_0x2649f8===null&&(_0x2649f8={});if(typeof _0x2649f8==='string')_0x332f66['key']=_0x2649f8,_0x332f66['gid']='local';else typeof _0x2649f8==='object'&&(_0x332f66['key']=_0x2649f8['key'],_0x332f66['gid']=_0x2649f8['gid']);return _0x332f66;};const store={};store['put']=function(_0x4f6c88,_0x5e215c,_0x525bcf){_0x525bcf=_0x525bcf||function(){},_0x5e215c=normalize(_0x5e215c),_0x5e215c['key']=_0x5e215c['key']||id['getID'](_0x4f6c88),_0x5e215c['gid']=_0x5e215c['gid']||'local';let _0x14fdde=serialization['serialize'](_0x4f6c88),_0x1c82d9=Buffer['from'](_0x5e215c['key'])['toString']('base64');_0x1c82d9=baseFolder+'/s-'+global['moreStatus']['sid']+'/'+_0x5e215c['gid']+'-'+_0x1c82d9,log('[store.put'+']\x20configur'+'ation:\x20'+JSON['stringify'](_0x5e215c)+'\x20state:\x20'+JSON['stringify'](_0x4f6c88)+('\x20filename:'+'\x20')+_0x1c82d9),fs['writeFile'](_0x1c82d9,_0x14fdde,_0x29afdb=>{_0x29afdb?_0x525bcf(_0x29afdb):_0x525bcf(null,_0x4f6c88);});},store['get']=function(_0x9cf68f,_0x5d4053){_0x5d4053=_0x5d4053||function(){},_0x9cf68f=normalize(_0x9cf68f),_0x9cf68f['gid']=_0x9cf68f['gid']||'local';if(!_0x9cf68f['key']){fs['readdir'](baseFolder+'/s-'+global['moreStatus']['sid'],(_0x20edbf,_0x145336)=>{if(_0x20edbf)_0x5d4053(_0x20edbf);else{let _0x34823c=[];for(let _0x4ead2d=-0x10*-0x15b+-0x3*-0x8e7+-0x3065;_0x4ead2d<_0x145336['length'];_0x4ead2d++){let _0x339642=_0x145336[_0x4ead2d]['split']('-'),_0x231ca0=_0x339642[-0x5*-0x595+-0x1*0x471+-0x1778];if(_0x231ca0!==_0x9cf68f['gid'])continue;_0x339642=_0x339642[_0x339642['length']-(0x1f06+0x2*0xe5+-0x20cf)],_0x34823c['push'](Buffer['from'](_0x339642,'base64')['toString']());}_0x5d4053(null,_0x34823c);}});return;}let _0x2730b9=Buffer['from'](_0x9cf68f['key'])['toString']('base64');_0x2730b9=baseFolder+'/s-'+global['moreStatus']['sid']+'/'+_0x9cf68f['gid']+'-'+_0x2730b9,log('[store.get'+']\x20configur'+'ation:\x20'+JSON['stringify'](_0x9cf68f)+('\x20filename:'+'\x20')+_0x2730b9),fs['exists'](_0x2730b9,_0x463fe9=>{if(!_0x463fe9){_0x5d4053(new Error('File\x20'+_0x2730b9+('\x20(from\x20key'+'\x20\x27')+_0x9cf68f['key']+('\x27)\x20not\x20fou'+'nd\x20for\x20gro'+'up\x20')+_0x9cf68f['gid']));return;}fs['readFile'](_0x2730b9,(_0x1c1fa6,_0x515946)=>{if(!_0x5d4053)return;_0x1c1fa6?_0x5d4053(_0x1c1fa6):(_0x515946=_0x515946['toString'](),_0x5d4053(null,serialization['deserializ'+'e'](_0x515946)));});});},store['del']=function(_0x21915c,_0x5d2562){_0x5d2562=_0x5d2562||function(){},_0x21915c=normalize(_0x21915c);let _0x56e6d4=Buffer['from'](_0x21915c['key'])['toString']('base64');_0x56e6d4=baseFolder+'/s-'+global['moreStatus']['sid']+'/'+_0x21915c['gid']+'-'+_0x56e6d4,fs['exists'](_0x56e6d4,_0x3cebe4=>{if(!_0x3cebe4){_0x5d2562(new Error('File\x20'+_0x56e6d4+('\x20not\x20found'+'\x20for\x20group'+'\x0a')+_0x21915c['gid']));return;}store['get'](_0x21915c,(_0x210eca,_0x3f35d3)=>{fs['rm'](_0x56e6d4,function(_0x5121b8){_0x5121b8?_0x5d2562(_0x5121b8):_0x5d2562(null,_0x3f35d3);});});});},module['exports']=store;
|
|
10
10
|
/* eslint-enable */
|
package/distribution/util/id.js
CHANGED
|
@@ -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 assert=require('assert');
|
|
9
|
+
const assert=require('assert');let crypto=require('crypto');function getID(_0x5f31f2){const _0x53d207=crypto['createHash']('sha256');return _0x53d207['update'](JSON['stringify'](_0x5f31f2)),_0x53d207['digest']('hex');}function getNID(_0x28fe04){return _0x28fe04={'ip':_0x28fe04['ip'],'port':_0x28fe04['port']},getID(_0x28fe04);}function getSID(_0x21c20a){return getNID(_0x21c20a)['substring'](-0x1dd9+0x6d*0x34+0x7b5*0x1,0x98*0x12+0x1c7e+-0x2729);}function getMID(_0x33aab6){let _0x3e1b97={};return _0x3e1b97['date']=new Date()['getTime'](),_0x3e1b97['mss']=_0x33aab6,getID(_0x3e1b97);}function idToNum(_0x15d192){let _0x1d34f5=parseInt(_0x15d192,0x2*-0xfe5+0x7a8*0x1+-0x13*-0x146);return assert(!isNaN(_0x1d34f5),'idToNum:\x20i'+'d\x20is\x20not\x20i'+'n\x20KID\x20form'+'!'),_0x1d34f5;}function naiveHash(_0x1d5cb4,_0x3f1012){return _0x3f1012['sort'](),_0x3f1012[idToNum(_0x1d5cb4)%_0x3f1012['length']];}function consistentHash(_0x4e5f45,_0x5746ab){const _0x538c24=idToNum(_0x4e5f45),_0x3c7afa=_0x5746ab['map'](_0x1c1f69=>({'id':_0x1c1f69,'hash':idToNum(_0x1c1f69)}));_0x3c7afa['sort']((_0x21fce7,_0x48bc19)=>_0x21fce7['hash']-_0x48bc19['hash']);for(let _0x49d72d of _0x3c7afa){if(_0x538c24<=_0x49d72d['hash'])return _0x49d72d['id'];}return _0x3c7afa[-0x212c+0xdd8*-0x2+0x5*0xc2c]['id'];}function rendezvousHash(_0x453121,_0x15d6f4){let _0x173513=-0x42b+-0x1*0x2425+-0x35c*-0xc,_0x42d640=null;for(let _0x57f925 of _0x15d6f4){let _0x358aec=getID(_0x453121+_0x57f925),_0x49e5b3=idToNum(_0x358aec);_0x49e5b3>_0x173513&&(_0x173513=_0x49e5b3,_0x42d640=_0x57f925);}return _0x42d640;}module['exports']={'getID':getID,'getNID':getNID,'getSID':getSID,'getMID':getMID,'naiveHash':naiveHash,'consistentHash':consistentHash,'rendezvousHash':rendezvousHash};
|
|
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
|
-
|
|
9
|
+
let nativeFunctions={'forward':new Map(),'reverse':new Map()};function createNativeMap(){let _0x78886f=[];function _0x481640(_0x494534,_0x55e734){if(_0x55e734===null||_0x55e734===undefined)return;if(_0x78886f['indexOf'](_0x55e734)!==-(-0x14ce+-0x2018+0x34e7))return;_0x78886f['push'](_0x55e734),Object['getOwnProp'+'ertyNames'](_0x55e734)['forEach'](_0x34f75a=>{if(typeof _0x55e734[_0x34f75a]==='function'){nativeFunctions['forward']['set'](_0x55e734[_0x34f75a],_0x494534+'.'+_0x34f75a),nativeFunctions['reverse']['set'](_0x494534+'.'+_0x34f75a,_0x55e734[_0x34f75a]);return;}typeof _0x55e734[_0x34f75a]==='object'&&_0x78886f['indexOf'](_0x55e734[_0x34f75a])===-(0x1690+-0x726+-0xf69)&&_0x481640(_0x494534+'.'+_0x34f75a,_0x55e734[_0x34f75a]);});}const _0x236e46=require('fs'),_0xc96ba7=require('http'),_0x545d58=require('https'),_0x174b38=require('url'),_0x491993=require('path'),_0x52753b=require('os'),_0x5c6551=require('events'),_0xe98b43=require('stream'),_0x50fa70=require('util'),_0x26706c=require('querystrin'+'g'),_0x30af04=require('zlib'),_0x546c76=require('buffer'),_0x1b3074=require('child_proc'+'ess'),_0x2582fa=require('cluster'),_0xdc8b37=require('dgram'),_0x5895c4=require('dns'),_0x1c3420=require('http2'),_0x456a17=require('v8');_0x481640('globalThis',globalThis),_0x481640('fs',_0x236e46),_0x481640('http',_0xc96ba7),_0x481640('https',_0x545d58),_0x481640('url',_0x174b38),_0x481640('path',_0x491993),_0x481640('os',_0x52753b),_0x481640('events',_0x5c6551),_0x481640('stream',_0xe98b43),_0x481640('util',_0x50fa70),_0x481640('querystrin'+'g',_0x26706c),_0x481640('zlib',_0x30af04),_0x481640('buffer',_0x546c76),_0x481640('child_proc'+'ess',_0x1b3074),_0x481640('cluster',_0x2582fa),_0x481640('dgram',_0xdc8b37),_0x481640('dns',_0x5895c4),_0x481640('http2',_0x1c3420),_0x481640('v8',_0x456a17);}createNativeMap();function decycleObject(_0x5806cb){if(_0x5806cb===null||_0x5806cb===undefined)return _0x5806cb;let _0x41e355=new WeakMap();function _0x13f3f4(_0x2379a7,_0x3a393c){let _0x47d5e2,_0x51c566;if(!(typeof _0x2379a7==='object'&&!(_0x2379a7 instanceof Error)&&!(_0x2379a7 instanceof Date)&&!(_0x2379a7 instanceof Boolean)&&_0x2379a7!==null))return _0x2379a7;_0x47d5e2=_0x41e355['get'](_0x2379a7);if(_0x47d5e2!==undefined)return{'$reference':_0x47d5e2};return _0x41e355['set'](_0x2379a7,_0x3a393c),Array['isArray'](_0x2379a7)?(_0x51c566=[],_0x2379a7['forEach'](function(_0x285e8a,_0x52d14d){let _0x529d34=[..._0x3a393c,_0x52d14d];_0x51c566[_0x52d14d]=_0x13f3f4(_0x285e8a,_0x529d34);})):(_0x51c566={},Object['keys'](_0x2379a7)['forEach'](_0x1286a9=>{let _0xcfe30b=[..._0x3a393c,JSON['stringify'](_0x1286a9)];_0x51c566[_0x1286a9]=_0x13f3f4(_0x2379a7[_0x1286a9],_0xcfe30b);})),_0x51c566;}return _0x13f3f4(_0x5806cb,[]);};function serializeBaseStructure(_0x87c286){return{'type':typeof _0x87c286,'value':_0x87c286['toString']()};}function serializeUndefined(_0x24c99e){return{'type':'undefined','value':''};}function getObjectSubType(_0xe8693d){if(_0xe8693d instanceof Array)return'array';if(_0xe8693d instanceof Date)return'date';if(_0xe8693d instanceof Error)return'error';if(_0xe8693d===null)return'null';return'object';}function serializeObject(_0x20b4da){let _0x4af325=getObjectSubType(_0x20b4da);if(_0x4af325==='null')return{'type':_0x4af325,'value':''};if(_0x4af325==='date')return{'type':_0x4af325,'value':_0x20b4da['toJSON']()};if(_0x4af325==='error')return{'type':_0x4af325,'value':serializeObject({'name':_0x20b4da['name'],'message':_0x20b4da['message'],'cause':_0x20b4da['cause']})};function _0x316e73(_0x6e80b8){return Object['keys'](_0x6e80b8)['length']==-0xb*0x92+0x2287+-0x1c40&&Object['keys'](_0x6e80b8)[-0x13a0+-0xf11+0x22b1]=='$reference';}if(_0x316e73(_0x20b4da))return{'type':'reference','value':_0x20b4da['$reference']};let _0x25922f={};for(const [_0x775ec8,_0x55cc6d]of Object['entries'](_0x20b4da)){_0x25922f[_0x775ec8]=serialize(_0x55cc6d);}return{'type':_0x4af325,'value':_0x25922f};}function serializeFunction(_0x4ec2f8){if(nativeFunctions['forward']['has'](_0x4ec2f8))return{'type':'native','value':nativeFunctions['forward']['get'](_0x4ec2f8)};return{'type':'function','value':_0x4ec2f8['toString']()};}function serialize(_0x4204f2){_0x4204f2=decycleObject(_0x4204f2);let _0x1132d7;switch(typeof _0x4204f2){case'object':_0x1132d7=serializeObject(_0x4204f2);break;case'function':_0x1132d7=serializeFunction(_0x4204f2);break;case'undefined':_0x1132d7=serializeUndefined(_0x4204f2);break;case'number':case'string':case'boolean':_0x1132d7=serializeBaseStructure(_0x4204f2);break;}return JSON['stringify'](_0x1132d7);}function deserializeObject(_0x40faab,_0xc7aa51){for(const [_0xcf3fee,_0x342c6d]of Object['entries'](_0x40faab)){_0xc7aa51[_0xcf3fee]=doSerialize(_0x342c6d,_0xc7aa51);}return _0xc7aa51;}function deserializeArray(_0x29b8ce,_0xfcfd8f){for(const [_0x38d3ae,_0x17951f]of Object['entries'](_0x29b8ce)){_0xfcfd8f[_0x38d3ae]=doSerialize(_0x17951f,_0xfcfd8f);}return _0xfcfd8f;}function deserializeString(_0x3255af){return _0x3255af;}function deserializeNumber(_0x20ef42){return Number(_0x20ef42);}function deserializeFunction(_0x4fdb27){return new Function('return\x20'+_0x4fdb27)();}function deserializeError(_0x5932a0){let _0x41c977=doSerialize(_0x5932a0),_0x2d6377=new Error(_0x41c977['message'],_0x41c977['cause']);return _0x2d6377;}function deserializeReference(_0xae71a9,_0x304212){let _0xb1d769=_0x304212;for(let _0x50fc4e of _0xae71a9){_0x50fc4e=JSON['parse'](_0x50fc4e),_0xb1d769=_0xb1d769[_0x50fc4e];}return _0xb1d769;}function deserializeNative(_0x3f3709){return nativeFunctions['reverse']['get'](_0x3f3709);}function doSerialize(_0x369282,_0x1d6b52=null){let _0x5e7893;if(typeof _0x369282==='object')_0x5e7893=_0x369282;else{if(typeof _0x369282==='string')_0x5e7893=JSON['parse'](_0x369282);else throw new Error('Invalid\x20ar'+'gument\x20typ'+'e:\x20'+typeof _0x369282+'.');}_0x1d6b52===null&&(_0x1d6b52={});switch(_0x5e7893['type']){case'object':_0x1d6b52=deserializeObject(_0x5e7893['value'],{});break;case'array':_0x1d6b52=deserializeArray(_0x5e7893['value'],[]);break;case'function':_0x1d6b52=deserializeFunction(_0x5e7893['value']);break;case'native':_0x1d6b52=deserializeNative(_0x5e7893['value']);break;case'reference':_0x1d6b52=deserializeReference(_0x5e7893['value'],_0x1d6b52);break;case'number':_0x1d6b52=deserializeNumber(_0x5e7893['value']);break;case'string':_0x1d6b52=deserializeString(_0x5e7893['value']);break;case'boolean':_0x1d6b52=_0x5e7893['value']==='true';break;case'date':_0x1d6b52=new Date(_0x5e7893['value']);break;case'error':_0x1d6b52=deserializeError(_0x5e7893['value']);break;case'null':_0x1d6b52=null;break;case'undefined':_0x1d6b52=undefined;break;}return _0x1d6b52;}function deserialize(_0x489291){return doSerialize(_0x489291);}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 id=require('../util/id'),serialization=require('../util/se'+'rializatio'+'n'),log=require('../util/lo'+'g');global['toLocal']=new Map();function createRPC(
|
|
9
|
+
const id=require('../util/id'),serialization=require('../util/se'+'rializatio'+'n'),log=require('../util/lo'+'g');global['toLocal']=new Map();function createRPC(_0x141162){let _0x2f630d=id['getID'](serialization['serialize'](_0x141162));global['toLocal']['set'](_0x2f630d,_0x141162);let _0x495111='\x0a\x20\x20\x20\x20const'+'\x20callback\x20'+'=\x20args.pop'+'();\x0a\x0a\x20\x20\x20\x20l'+'et\x20remote\x20'+'=\x20{node:\x20'+JSON['stringify'](global['nodeConfig'])+(',\x20service:'+'\x20\x27')+_0x2f630d+('\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'+_0x2f630d),new Function('...args',_0x495111);}function toAsync(_0x3e3dd8){log('Converting'+'\x20function\x20'+'to\x20async:\x20'+_0x3e3dd8['name']+':\x20'+_0x3e3dd8['toString']()['replace'](/\n/g,'|'));const _0x5c06dd=(..._0x40612f)=>{const _0x5b2227=_0x40612f['pop']();try{const _0x182ed2=_0x3e3dd8(..._0x40612f);_0x5b2227(null,_0x182ed2);}catch(_0x8bf5d){_0x5b2227(_0x8bf5d);}};return _0x5c06dd['toString']=()=>_0x3e3dd8['toString'](),_0x5c06dd;}module['exports']={'createRPC':createRPC,'toAsync':toAsync};
|
|
10
10
|
/* eslint-enable */
|
package/package.json
CHANGED
package/.eslintrc
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "google",
|
|
3
|
-
"env": {
|
|
4
|
-
"es6": true, // Enable ES6 syntax including new ES6 globals
|
|
5
|
-
"node": true // Adjust based on your environment
|
|
6
|
-
},
|
|
7
|
-
"parserOptions": {
|
|
8
|
-
"ecmaVersion": 2018, // Update ECMAScript version to at least 6 or later for arrow functions
|
|
9
|
-
"sourceType": "script" // Set to "module" if you are using ES6 modules
|
|
10
|
-
},
|
|
11
|
-
"rules": {
|
|
12
|
-
"max-len": "off",
|
|
13
|
-
"no-var": "off", // Allow 'var' for ES5 compatibility
|
|
14
|
-
"prefer-const": "off", // Do not enforce const over let
|
|
15
|
-
"prefer-spread": "off", // Do not enforce spread operator
|
|
16
|
-
"prefer-rest-params": "off", // Do not enforce rest parameters
|
|
17
|
-
"prefer-template": "off", // Do not enforce template literals
|
|
18
|
-
"object-shorthand": "off", // Do not enforce object method shorthand
|
|
19
|
-
"require-jsdoc": "off",
|
|
20
|
-
"guard-for-in": "off",
|
|
21
|
-
"no-restricted-syntax": [
|
|
22
|
-
"error",
|
|
23
|
-
{
|
|
24
|
-
"selector": "ClassDeclaration",
|
|
25
|
-
"message": "Class declarations are not allowed."
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
"selector": "ClassExpression",
|
|
29
|
-
"message": "Class expressions are not allowed."
|
|
30
|
-
}
|
|
31
|
-
]
|
|
32
|
-
}
|
|
33
|
-
}
|