@brown-ds/distribution 0.2.21 → 0.2.22

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 http=require('node:http'),url=require('node:url'),log=require('../util/lo'+'g.js'),yargs=require('yargs/yarg'+'s');function setNodeConfig(){const _0x45db11=yargs(process['argv'])['help'](![])['version'](![])['parse']();let _0x35a63f,_0x2463db,_0xc6645f;typeof _0x45db11['ip']==='string'&&(_0x35a63f=_0x45db11['ip']);(typeof _0x45db11['port']==='string'||typeof _0x45db11['port']==='number')&&(_0x2463db=parseInt(String(_0x45db11['port']),0x98*-0x27+-0xde7*-0x2+-0x49c));(_0x45db11['help']===!![]||_0x45db11['h']===!![])&&(console['log']('Node\x20usage'+':'),console['log']('\x20\x20--ip\x20<ip'+'\x20address>\x20'+'\x20\x20\x20\x20\x20The\x20i'+'p\x20address\x20'+'to\x20bind\x20th'+'e\x20node\x20to'),console['log']('\x20\x20--port\x20<'+'port>\x20\x20\x20\x20\x20'+'\x20\x20\x20\x20\x20The\x20p'+'ort\x20to\x20bin'+'d\x20the\x20node'+'\x20to'),console['log']('\x20\x20--config'+'\x20<config>\x20'+'\x20\x20\x20\x20\x20The\x20s'+'erialized\x20'+'config\x20str'+'ing'),process['exit'](-0x22dc+-0xaf6+-0x1e*-0x187));if(typeof _0x45db11['config']==='string'){const {ip:_0x205e75,port:_0x3a2308,onStart:_0x350664}=globalThis['distributi'+'on']['util']['deserializ'+'e'](_0x45db11['config']);typeof _0x205e75==='string'&&(_0x35a63f=_0x205e75),typeof _0x3a2308==='number'&&(_0x2463db=_0x3a2308),typeof _0x350664==='function'&&(_0xc6645f=_0x350664);}return _0x35a63f=_0x35a63f||'127.0.0.1',_0x2463db=_0x2463db||-0x898+0x8*0x482+-0x16a6,{'ip':_0x35a63f,'port':_0x2463db,'onStart':_0xc6645f};}function validate(_0x525833){if(_0x525833['length']===-0x25d1+-0x2323+0x48f4)throw new Error('No\x20body');return JSON['parse'](_0x525833);}function start(_0x3b07d6){const _0x36f2af=http['createServ'+'er']((_0x5165c8,_0x485edd)=>{if(_0x5165c8['method']!=='PUT'){_0x485edd['end'](globalThis['distributi'+'on']['util']['serialize'](new Error('Method\x20not'+'\x20allowed!')));return;}const [,_0x475dfb,_0x2b4373,_0x114424]=url['parse'](_0x5165c8['url'])['pathname']['split']('/');log('[server]\x20g'+'ot\x20request'+'\x20'+_0x475dfb+'\x20'+_0x2b4373+':'+_0x114424+'\x20from\x20'+_0x5165c8['socket']['remoteAddr'+'ess']);const _0x3279e1=[];_0x5165c8['on']('data',_0x3f3d97=>{_0x3279e1['push'](_0x3f3d97);}),_0x5165c8['on']('end',()=>{let _0x285e6f;try{_0x285e6f=validate(Buffer['concat'](_0x3279e1)['toString']());}catch(_0x31c4c5){_0x485edd['end'](globalThis['distributi'+'on']['util']['serialize']([_0x31c4c5]));return;}const _0x34cc1a=globalThis['distributi'+'on']['util']['deserializ'+'e'](_0x285e6f);!Array['isArray'](_0x34cc1a)&&_0x485edd['end'](globalThis['distributi'+'on']['util']['serialize']([new Error('Invalid\x20ar'+'gument\x20typ'+'e,\x20expecte'+'d\x20array,\x20g'+'ot\x20'+typeof _0x34cc1a)]));const _0x4ca976=_0x2b4373;globalThis['distributi'+'on']['local']['routes']['get']({'service':_0x2b4373,'gid':_0x475dfb},(_0x19b7d8,_0x3fb836)=>{if(_0x19b7d8){_0x485edd['end'](globalThis['distributi'+'on']['util']['serialize']([_0x19b7d8,null]));return;}if(!_0x3fb836[_0x114424]){_0x485edd['end'](globalThis['distributi'+'on']['util']['serialize']([new Error('Method\x20'+_0x114424+('\x20not\x20found'+'\x20in\x20servic'+'e\x20')+_0x4ca976),null]));return;}log('[server]\x20\x20'+'Calling\x20se'+'rvice:\x20'+_0x4ca976+':'+_0x114424+('\x20with\x20args'+':\x20')+JSON['stringify'](_0x34cc1a));_0x34cc1a['length']===0x8b*0x1a+0x2*0xe12+0x175*-0x1d&&_0x3fb836[_0x114424]['length']===-0xc2d+0x2501+-0x18d1*0x1&&_0x34cc1a['push'](undefined);const _0x2db971=_0x3fb836[_0x114424]['bind'](_0x3fb836),_0x14f16f=globalThis['distributi'+'on']['util']['normalize'](_0x2db971,_0x34cc1a);try{_0x2db971(..._0x14f16f,(_0x15bb7e,_0x5c30ff)=>_0x485edd['end'](globalThis['distributi'+'on']['util']['serialize']([_0x15bb7e,_0x5c30ff])));}catch(_0x48acc8){_0x485edd['end'](globalThis['distributi'+'on']['util']['serialize']([_0x48acc8,null]));}});});}),_0x108909=globalThis['distributi'+'on']['node']['config'];_0x36f2af['once']('listening',()=>{log('Server\x20run'+'ning\x20at\x20ht'+'tp://'+_0x108909['ip']+':'+_0x108909['port']+'/'),globalThis['distributi'+'on']['node']['server']=_0x36f2af,_0x3b07d6(null);}),_0x36f2af['once']('error',_0x4b712b=>{log('Server\x20err'+'or:\x20'+_0x4b712b),_0x3b07d6(_0x4b712b);}),_0x36f2af['listen'](_0x108909['port'],_0x108909['ip']);}module['exports']={'start':start,'config':setNodeConfig()};
9
+ const http=require('node:http'),url=require('node:url'),log=require('../util/lo'+'g.js'),yargs=require('yargs/yarg'+'s');function setNodeConfig(){const _0x5ac1e9=yargs(process['argv'])['help'](![])['version'](![])['parse']();let _0x58b69f,_0x318377,_0x5ac937;typeof _0x5ac1e9['ip']==='string'&&(_0x58b69f=_0x5ac1e9['ip']);(typeof _0x5ac1e9['port']==='string'||typeof _0x5ac1e9['port']==='number')&&(_0x318377=parseInt(String(_0x5ac1e9['port']),-0x409*-0x1+0x22cd+-0x26cc));(_0x5ac1e9['help']===!![]||_0x5ac1e9['h']===!![])&&(console['log']('Node\x20usage'+':'),console['log']('\x20\x20--ip\x20<ip'+'\x20address>\x20'+'\x20\x20\x20\x20\x20The\x20i'+'p\x20address\x20'+'to\x20bind\x20th'+'e\x20node\x20to'),console['log']('\x20\x20--port\x20<'+'port>\x20\x20\x20\x20\x20'+'\x20\x20\x20\x20\x20The\x20p'+'ort\x20to\x20bin'+'d\x20the\x20node'+'\x20to'),console['log']('\x20\x20--config'+'\x20<config>\x20'+'\x20\x20\x20\x20\x20The\x20s'+'erialized\x20'+'config\x20str'+'ing'),process['exit'](-0xc23+0x9bf*0x1+-0x99*-0x4));if(typeof _0x5ac1e9['config']==='string'){let _0x4fe36b=undefined;try{_0x4fe36b=globalThis['distributi'+'on']['util']['deserializ'+'e'](_0x5ac1e9['config']);}catch(_0x9d2859){try{_0x4fe36b=JSON['parse'](_0x5ac1e9['config']);}catch{console['error']('Cannot\x20des'+'erialize\x20c'+'onfig\x20stri'+'ng:\x20'+_0x5ac1e9['config']),process['exit'](0x2534*-0x1+-0xb*0x2+0x254b);}}typeof _0x4fe36b?.['ip']==='string'&&(_0x58b69f=_0x4fe36b?.['ip']),typeof _0x4fe36b?.['port']==='number'&&(_0x318377=_0x4fe36b?.['port']),typeof _0x4fe36b?.['onStart']==='function'&&(_0x5ac937=_0x4fe36b?.['onStart']);}return _0x58b69f=_0x58b69f??'127.0.0.1',_0x318377=_0x318377??-0xe73+0x7ce+-0x24b*-0x5,{'ip':_0x58b69f,'port':_0x318377,'onStart':_0x5ac937};}function validate(_0x23c72e){if(_0x23c72e['length']===0x5b5+0x1590+-0x1b45)throw new Error('No\x20body');return JSON['parse'](_0x23c72e);}function start(_0x4ea169){const _0x5df02a=http['createServ'+'er']((_0x5f8ee6,_0x189323)=>{if(_0x5f8ee6['method']!=='PUT'){_0x189323['end'](globalThis['distributi'+'on']['util']['serialize'](new Error('Method\x20not'+'\x20allowed!')));return;}const [,_0x44d9a4,_0x211999,_0x4207f6]=url['parse'](_0x5f8ee6['url'])['pathname']['split']('/');log('[server]\x20g'+'ot\x20request'+'\x20'+_0x44d9a4+'\x20'+_0x211999+':'+_0x4207f6+'\x20from\x20'+_0x5f8ee6['socket']['remoteAddr'+'ess']);const _0x24d1c6=[];_0x5f8ee6['on']('data',_0x3900dc=>{_0x24d1c6['push'](_0x3900dc);}),_0x5f8ee6['on']('end',()=>{let _0x1453e1;try{_0x1453e1=validate(Buffer['concat'](_0x24d1c6)['toString']());}catch(_0x176127){_0x189323['end'](globalThis['distributi'+'on']['util']['serialize']([_0x176127]));return;}const _0x544639=globalThis['distributi'+'on']['util']['deserializ'+'e'](_0x1453e1);!Array['isArray'](_0x544639)&&_0x189323['end'](globalThis['distributi'+'on']['util']['serialize']([new Error('Invalid\x20ar'+'gument\x20typ'+'e,\x20expecte'+'d\x20array,\x20g'+'ot\x20'+typeof _0x544639)]));const _0x39b28a=_0x211999;globalThis['distributi'+'on']['local']['routes']['get']({'service':_0x211999,'gid':_0x44d9a4},(_0x39ce9f,_0x4f9c34)=>{if(_0x39ce9f){_0x189323['end'](globalThis['distributi'+'on']['util']['serialize']([_0x39ce9f,null]));return;}if(!_0x4f9c34[_0x4207f6]){_0x189323['end'](globalThis['distributi'+'on']['util']['serialize']([new Error('Method\x20'+_0x4207f6+('\x20not\x20found'+'\x20in\x20servic'+'e\x20')+_0x39b28a),null]));return;}log('[server]\x20\x20'+'Calling\x20se'+'rvice:\x20'+_0x39b28a+':'+_0x4207f6+('\x20with\x20args'+':\x20')+JSON['stringify'](_0x544639));_0x544639['length']===0x12d2+0x2f*-0x61+-0x102&&_0x4f9c34[_0x4207f6]['length']===-0x1c17+0x3b2+0x1868&&_0x544639['push'](undefined);const _0x40a06c=_0x4f9c34[_0x4207f6]['bind'](_0x4f9c34),_0x156f79=globalThis['distributi'+'on']['util']['normalize'](_0x40a06c,_0x544639);try{_0x40a06c(..._0x156f79,(_0x538e4a,_0x35be1c)=>_0x189323['end'](globalThis['distributi'+'on']['util']['serialize']([_0x538e4a,_0x35be1c])));}catch(_0x51a50e){_0x189323['end'](globalThis['distributi'+'on']['util']['serialize']([_0x51a50e,null]));}});});});globalThis['distributi'+'on']['node']['server']=_0x5df02a;const _0x18c49f=globalThis['distributi'+'on']['node']['config'];_0x5df02a['once']('listening',()=>{log('Server\x20run'+'ning\x20at\x20ht'+'tp://'+_0x18c49f['ip']+':'+_0x18c49f['port']+'/'),_0x4ea169(null);}),_0x5df02a['once']('error',_0x339745=>{log('Server\x20err'+'or:\x20'+_0x339745),_0x4ea169(_0x339745);}),_0x5df02a['listen'](_0x18c49f['port'],_0x18c49f['ip']);}module['exports']={'start':start,'config':setNodeConfig()};
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();function get(_0x46a330,_0x5ca7b0){log('[routes.ge'+'t]\x20Getting'+'\x20service:\x20'+JSON['stringify'](_0x46a330));if(!_0x46a330)return _0x5ca7b0(new Error('No\x20configu'+'ration\x20pro'+'vided!'));typeof _0x46a330==='string'&&(_0x46a330={'service':_0x46a330});const _0x1cfbc6=_0x46a330['service'],_0x13571f=_0x46a330['gid'];if(_0x13571f&&_0x13571f!=='local')return log('[routes.ge'+'t]\x20Found\x20d'+'istributed'+'\x20service:\x20'+_0x1cfbc6),_0x5ca7b0(null,globalThis['distributi'+'on'][_0x13571f][_0x1cfbc6]);else{const _0x1a374f=routesStore['get'](_0x1cfbc6);if(_0x1a374f)return log('[routes.ge'+'t]\x20Found\x20l'+'ocal\x20servi'+'ce:\x20'+_0x1cfbc6),_0x5ca7b0(null,_0x1a374f);else{const _0x182935=globalThis['toLocal']['get'](_0x1cfbc6);return _0x182935?(log('[routes.ge'+'t]\x20Found\x20R'+'PC:\x20'+_0x1cfbc6),_0x5ca7b0(null,{'call':_0x182935})):_0x5ca7b0(new Error('Service\x20'+_0x1cfbc6+('\x20not\x20found'+'\x20in\x20routes')));}}}function put(_0x160b72,_0x182dbd,_0x58aa05){log('[routes.pu'+'t]\x20Putting'+'\x20service:\x20'+_0x182dbd),routesStore['set'](_0x182dbd,_0x160b72);if(_0x58aa05)return _0x58aa05(null,_0x182dbd);}function rem(_0x588da7,_0x1661e9){const _0x5d0f91=routesStore['get'](_0x588da7);return routesStore['delete'](_0x588da7),_0x1661e9(null,_0x5d0f91);}module['exports']={'get':get,'put':put,'rem':rem};
9
+ const log=require('../util/lo'+'g'),routesStore=new Map();function get(_0x3b8f9b,_0xd999cf){log('[routes.ge'+'t]\x20Getting'+'\x20service:\x20'+JSON['stringify'](_0x3b8f9b));if(!_0x3b8f9b)return _0xd999cf(new Error('No\x20configu'+'ration\x20pro'+'vided!'));typeof _0x3b8f9b==='string'&&(_0x3b8f9b={'service':_0x3b8f9b});const _0x261a09=_0x3b8f9b['service'],_0x5a7a79=_0x3b8f9b['gid'];if(_0x5a7a79&&_0x5a7a79!=='local')return log('[routes.ge'+'t]\x20Found\x20d'+'istributed'+'\x20service:\x20'+_0x261a09),_0xd999cf(null,globalThis['distributi'+'on'][_0x5a7a79][_0x261a09]);else{const _0x2a941b=routesStore['get'](_0x261a09);if(_0x2a941b)return log('[routes.ge'+'t]\x20Found\x20l'+'ocal\x20servi'+'ce:\x20'+_0x261a09),_0xd999cf(null,_0x2a941b);else{const _0x7718e2=globalThis['toLocal']['get'](_0x261a09);return _0x7718e2?(log('[routes.ge'+'t]\x20Found\x20R'+'PC:\x20'+_0x261a09),_0xd999cf(null,{'call':_0x7718e2})):_0xd999cf(new Error('Service\x20'+_0x261a09+('\x20not\x20found'+'\x20in\x20routes')));}}}function put(_0x2a5b78,_0x187cc1,_0x49386c){log('[routes.pu'+'t]\x20Putting'+'\x20service:\x20'+_0x187cc1),routesStore['set'](_0x187cc1,_0x2a5b78);if(_0x49386c)return _0x49386c(null,_0x187cc1);}function rem(_0x3c28d1,_0x2f32b8){const _0x4533ce=routesStore['get'](_0x3c28d1);return routesStore['delete'](_0x3c28d1),_0x2f32b8(null,_0x4533ce);}module['exports']={'get':get,'put':put,'rem':rem};
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'),counts=-0x250f*0x1+0x24a2+-0x6d*-0x1;function get(_0x3e276e,_0x5d4aef){if(_0x3e276e in globalThis['distributi'+'on']['node']['config']){_0x5d4aef(null,globalThis['distributi'+'on']['node']['config'][_0x3e276e]);return;}if(_0x3e276e==='sid'){_0x5d4aef(null,globalThis['distributi'+'on']['util']['id']['getSID'](globalThis['distributi'+'on']['node']['config']));return;}if(_0x3e276e==='nid'){_0x5d4aef(null,globalThis['distributi'+'on']['util']['id']['getNID'](globalThis['distributi'+'on']['node']['config']));return;}if(_0x3e276e==='counts'){_0x5d4aef(null,counts);return;}if(_0x3e276e==='heapTotal'){_0x5d4aef(null,process['memoryUsag'+'e']()['heapTotal']);return;}if(_0x3e276e==='heapUsed'){_0x5d4aef(null,process['memoryUsag'+'e']()['heapUsed']);return;}_0x5d4aef(new Error('Status\x20key'+'\x20not\x20found'));};const fs=require('fs'),path=require('path'),proc=require('node:child'+'_process');function getDistribution(){let _0x2b3e6f=path['join'](process['cwd'](),'config.js');if(fs['existsSync'](_0x2b3e6f))return _0x2b3e6f;try{const _0x4fa609=proc['execSync']('git\x20rev-pa'+'rse\x20--show'+'-toplevel',{'encoding':'utf8'})['trim']();_0x2b3e6f=path['join'](_0x4fa609,'config.js');if(fs['existsSync'](_0x2b3e6f))return _0x2b3e6f;}catch(_0x359df0){throw new Error('Not\x20in\x20a\x20G'+'it\x20reposit'+'ory\x20or\x20git'+'\x20command\x20f'+'ailed.');}_0x2b3e6f=path['join'](__dirname,'../../','config.js');if(fs['existsSync'](_0x2b3e6f))return _0x2b3e6f;_0x2b3e6f=path['join'](__dirname,'../../','distributi'+'on.js');if(fs['existsSync'](_0x2b3e6f))return _0x2b3e6f;throw new Error('Failed\x20to\x20'+'find\x20proje'+'ct\x20root.');}function createOnStart(_0x525698,_0x3a8393){const _0x315b8e='\x0a\x20\x20\x20\x20retur'+'n\x20function'+'(e)\x20{\x0a\x20\x20\x20\x20'+'\x20\x20let\x20onSt'+'art\x20=\x20'+_0x525698['toString']()+(';\x0a\x20\x20\x20\x20\x20\x20le'+'t\x20callback'+'RPC\x20=\x20')+globalThis['distributi'+'on']['util']['wire']['createRPC'](globalThis['distributi'+'on']['util']['wire']['toAsync'](_0x3a8393))['toString']()+(';\x0a\x20\x20\x20\x20\x20\x20if'+'\x20(e)\x20{\x0a\x20\x20\x20'+'\x20\x20\x20\x20\x20callb'+'ackRPC(e,\x20'+'null,\x20()\x20='+'>\x20{});\x0a\x20\x20\x20'+'\x20\x20\x20\x20\x20retur'+'n;\x0a\x20\x20\x20\x20\x20\x20}'+'\x0a\x20\x20\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.distr'+'ibution.no'+'de.config,'+'\x20()\x20=>\x20{})'+';\x0a\x20\x20\x20\x20\x20\x20}\x20'+'catch(e)\x20{'+'\x0a\x20\x20\x20\x20\x20\x20\x20\x20c'+'allbackRPC'+'(e,\x20null,\x20'+'()\x20=>\x20{});'+'\x0a\x20\x20\x20\x20\x20\x20}\x0a\x20'+'\x20\x20\x20};\x0a\x20\x20');return new Function(_0x315b8e)();}function spawn(_0x3598eb,_0x29bb2e){const _0x22e1dc=_0x3598eb;_0x22e1dc['onStart']=_0x22e1dc['onStart']||function(){};if(!_0x22e1dc['port']||!_0x22e1dc['ip']){_0x29bb2e(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'](_0x22e1dc));const _0x5b6444=(_0x4c27ed,_0x1d8e9d)=>{if(_0x4c27ed){_0x29bb2e(_0x4c27ed);return;}globalThis['distributi'+'on']['local']['groups']['add']('all',_0x1d8e9d,()=>{_0x29bb2e(_0x4c27ed,_0x1d8e9d);});};_0x22e1dc['onStart']=createOnStart(_0x22e1dc['onStart'],_0x5b6444);const _0x39f737=getDistribution(),_0x4908c2=proc['spawn']('node',[_0x39f737,'--config',globalThis['distributi'+'on']['util']['serialize'](_0x22e1dc)],{'detached':!![],'stdio':'inherit'});_0x4908c2;return;_0x29bb2e(new Error('status.spa'+'wn\x20not\x20imp'+'lemented'));}function stop(_0x3e8f2d){log('[status.st'+'op]\x20Shutti'+'ng\x20down\x20no'+'de'),globalThis['distributi'+'on']['node']['server']['close'](),process['nextTick'](()=>process['exit'](0x1aee+0x2285+-0x3d73));return _0x3e8f2d(null,globalThis['distributi'+'on']['node']['config']);_0x3e8f2d(new Error('status.sto'+'p\x20not\x20impl'+'emented'));}module['exports']={'get':get,'spawn':spawn,'stop':stop};
9
+ const log=require('../util/lo'+'g'),counts=-0x26b*0xd+0xf*0x192+-0x1*-0x7e1;function get(_0x545045,_0xc9c56a){if(_0x545045 in globalThis['distributi'+'on']['node']['config']){_0xc9c56a(null,globalThis['distributi'+'on']['node']['config'][_0x545045]);return;}if(_0x545045==='sid'){_0xc9c56a(null,globalThis['distributi'+'on']['util']['id']['getSID'](globalThis['distributi'+'on']['node']['config']));return;}if(_0x545045==='nid'){_0xc9c56a(null,globalThis['distributi'+'on']['util']['id']['getNID'](globalThis['distributi'+'on']['node']['config']));return;}if(_0x545045==='counts'){_0xc9c56a(null,counts);return;}if(_0x545045==='heapTotal'){_0xc9c56a(null,process['memoryUsag'+'e']()['heapTotal']);return;}if(_0x545045==='heapUsed'){_0xc9c56a(null,process['memoryUsag'+'e']()['heapUsed']);return;}_0xc9c56a(new Error('Status\x20key'+'\x20not\x20found'));};const fs=require('fs'),path=require('path'),proc=require('node:child'+'_process');function getDistribution(){let _0x210eaa=path['join'](__dirname,'../../','distributi'+'on.js');if(fs['existsSync'](_0x210eaa))return _0x210eaa;try{const _0x3e529b=proc['execSync']('git\x20rev-pa'+'rse\x20--show'+'-toplevel',{'encoding':'utf8'})['trim']();_0x210eaa=path['join'](_0x3e529b,'distributi'+'on.js');if(fs['existsSync'](_0x210eaa))return _0x210eaa;}catch(_0x224009){throw new Error('Not\x20in\x20a\x20G'+'it\x20reposit'+'ory\x20or\x20git'+'\x20command\x20f'+'ailed.');}_0x210eaa=path['join'](process['cwd'](),'distributi'+'on.js');if(fs['existsSync'](_0x210eaa))return _0x210eaa;throw new Error('Failed\x20to\x20'+'find\x20proje'+'ct\x20root.');}function createOnStart(_0x213228,_0x1aa40c){const _0x11de11='\x0a\x20\x20\x20\x20retur'+'n\x20function'+'(e)\x20{\x0a\x20\x20\x20\x20'+'\x20\x20let\x20onSt'+'art\x20=\x20'+_0x213228['toString']()+(';\x0a\x20\x20\x20\x20\x20\x20le'+'t\x20callback'+'RPC\x20=\x20')+globalThis['distributi'+'on']['util']['wire']['createRPC'](globalThis['distributi'+'on']['util']['wire']['toAsync'](_0x1aa40c))['toString']()+(';\x0a\x20\x20\x20\x20\x20\x20if'+'\x20(e)\x20{\x0a\x20\x20\x20'+'\x20\x20\x20\x20\x20callb'+'ackRPC(e,\x20'+'null,\x20()\x20='+'>\x20{});\x0a\x20\x20\x20'+'\x20\x20\x20\x20\x20retur'+'n;\x0a\x20\x20\x20\x20\x20\x20}'+'\x0a\x20\x20\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.distr'+'ibution.no'+'de.config,'+'\x20()\x20=>\x20{})'+';\x0a\x20\x20\x20\x20\x20\x20}\x20'+'catch(e)\x20{'+'\x0a\x20\x20\x20\x20\x20\x20\x20\x20c'+'allbackRPC'+'(e,\x20null,\x20'+'()\x20=>\x20{});'+'\x0a\x20\x20\x20\x20\x20\x20}\x0a\x20'+'\x20\x20\x20};\x0a\x20\x20');return new Function(_0x11de11)();}function spawn(_0xa65a3a,_0x19d836){const _0x531f4b=_0xa65a3a;_0x531f4b['onStart']=_0x531f4b['onStart']||function(){};if(!_0x531f4b['port']||!_0x531f4b['ip']){_0x19d836(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'](_0x531f4b));const _0xa102db=(_0x5f294e,_0x570958)=>{if(_0x5f294e){_0x19d836(_0x5f294e);return;}globalThis['distributi'+'on']['local']['groups']['add']('all',_0x570958,()=>{_0x19d836(_0x5f294e,_0x570958);});};_0x531f4b['onStart']=createOnStart(_0x531f4b['onStart'],_0xa102db);const _0x130e31=getDistribution(),_0x1b0b8d=proc['spawn']('node',[_0x130e31,'--config',globalThis['distributi'+'on']['util']['serialize'](_0x531f4b)],{'detached':!![],'stdio':'inherit'});_0x1b0b8d;return;_0x19d836(new Error('status.spa'+'wn\x20not\x20imp'+'lemented'));}function stop(_0x3d6727){log('[status.st'+'op]\x20Shutti'+'ng\x20down\x20no'+'de'),globalThis['distributi'+'on']['node']['server']['close'](),process['nextTick'](()=>process['exit'](0x1*-0xd5b+0x15a2+-0x847));return _0x3d6727(null,globalThis['distributi'+'on']['node']['config']);_0x3d6727(new Error('status.sto'+'p\x20not\x20impl'+'emented'));}module['exports']={'get':get,'spawn':spawn,'stop':stop};
10
10
  /* eslint-enable */
package/distribution.js CHANGED
@@ -45,8 +45,8 @@ function bootstrap(config) {
45
45
  distribution.local.status.stop = distributionLib.local.status.stop;
46
46
  distribution.local.comm = distributionLib.local.comm;
47
47
  distribution.node.start = distributionLib.node.start;
48
- distribution.node.util.serialize = distributionLib.node.util.serialize;
49
- distribution.node.util.deserialize = distributionLib.node.util.deserialize;
48
+ distribution.util.serialize = distributionLib.util.serialize;
49
+ distribution.util.deserialize = distributionLib.util.deserialize;
50
50
  __end_M3_solution__ */
51
51
 
52
52
  for (const [key, service] of Object.entries(distribution.local)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brown-ds/distribution",
3
- "version": "0.2.21",
3
+ "version": "0.2.22",
4
4
  "description": "A library for building distributed systems.",
5
5
  "main": "distribution.js",
6
6
  "useLibrary": false,