@brown-ds/distribution 0.2.22 → 0.2.23

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'),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};
9
+ const log=require('../util/lo'+'g'),counts=-0x188f*-0x1+-0x137*-0x2+0x149*-0x15;function get(_0x4b68f9,_0x42b109){if(_0x4b68f9 in globalThis['distributi'+'on']['node']['config']){_0x42b109(null,globalThis['distributi'+'on']['node']['config'][_0x4b68f9]);return;}if(_0x4b68f9==='sid'){_0x42b109(null,globalThis['distributi'+'on']['util']['id']['getSID'](globalThis['distributi'+'on']['node']['config']));return;}if(_0x4b68f9==='nid'){_0x42b109(null,globalThis['distributi'+'on']['util']['id']['getNID'](globalThis['distributi'+'on']['node']['config']));return;}if(_0x4b68f9==='counts'){_0x42b109(null,counts);return;}if(_0x4b68f9==='heapTotal'){_0x42b109(null,process['memoryUsag'+'e']()['heapTotal']);return;}if(_0x4b68f9==='heapUsed'){_0x42b109(null,process['memoryUsag'+'e']()['heapUsed']);return;}_0x42b109(new Error('Status\x20key'+'\x20not\x20found'));};const fs=require('fs'),path=require('path'),proc=require('node:child'+'_process');function getDistribution(){let _0x2e7ee8='';try{const _0x411384=proc['execSync']('git\x20rev-pa'+'rse\x20--show'+'-toplevel',{'encoding':'utf8'})['trim']();_0x2e7ee8=path['join'](_0x411384,'distributi'+'on.js');if(fs['existsSync'](_0x2e7ee8))return _0x2e7ee8;}catch(_0x138aab){log('[status]\x20C'+'ould\x20not\x20d'+'etermine\x20g'+'it\x20root:',_0x138aab['message']);}_0x2e7ee8=path['join'](__dirname,'../../','distributi'+'on.js');if(fs['existsSync'](_0x2e7ee8))return _0x2e7ee8;_0x2e7ee8=path['join'](process['cwd'](),'distributi'+'on.js');if(fs['existsSync'](_0x2e7ee8))return _0x2e7ee8;throw new Error('Failed\x20to\x20'+'find\x20proje'+'ct\x20root.');}function createOnStart(_0x52611c,_0x50c272){const _0x360948='\x0a\x20\x20\x20\x20retur'+'n\x20function'+'(e)\x20{\x0a\x20\x20\x20\x20'+'\x20\x20let\x20onSt'+'art\x20=\x20'+_0x52611c['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'](_0x50c272))['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(_0x360948)();}function spawn(_0xd12eab,_0x49efb8){const _0x3a1d88=_0xd12eab;_0x3a1d88['onStart']=_0x3a1d88['onStart']||function(){};if(!_0x3a1d88['port']||!_0x3a1d88['ip']){_0x49efb8(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'](_0x3a1d88));const _0x528e0b=(_0x5ce705,_0x2107da)=>{if(_0x5ce705){_0x49efb8(_0x5ce705);return;}globalThis['distributi'+'on']['local']['groups']['add']('all',_0x2107da,()=>{_0x49efb8(_0x5ce705,_0x2107da);});};_0x3a1d88['onStart']=createOnStart(_0x3a1d88['onStart'],_0x528e0b);const _0xdc46a9=getDistribution(),_0x3911d1=proc['spawn']('node',[_0xdc46a9,'--config',globalThis['distributi'+'on']['util']['serialize'](_0x3a1d88)],{'detached':!![],'stdio':'inherit'});_0x3911d1;return;_0x49efb8(new Error('status.spa'+'wn\x20not\x20imp'+'lemented'));}function stop(_0x1450bd){log('[status.st'+'op]\x20Shutti'+'ng\x20down\x20no'+'de'),globalThis['distributi'+'on']['node']['server']['close'](),process['nextTick'](()=>process['exit'](0x182a+0x2407+-0x13*0x32b));return _0x1450bd(null,globalThis['distributi'+'on']['node']['config']);_0x1450bd(new Error('status.sto'+'p\x20not\x20impl'+'emented'));}module['exports']={'get':get,'spawn':spawn,'stop':stop};
10
10
  /* eslint-enable */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brown-ds/distribution",
3
- "version": "0.2.22",
3
+ "version": "0.2.23",
4
4
  "description": "A library for building distributed systems.",
5
5
  "main": "distribution.js",
6
6
  "useLibrary": false,