@brown-ds/distribution 0.0.39 → 0.0.41

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 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;
9
+ const groups=function(_0x3d6e23){let _0x539a05={};return _0x539a05['gid']=_0x3d6e23['gid']||'global',{'put':(_0x3bd42f,_0x142d63,_0x2c6680)=>{global['distributi'+'on'][_0x539a05['gid']]['comm']['send']([_0x3bd42f,_0x142d63],{'service':'groups','method':'put'},_0x2c6680);},'del':(_0x3e1894,_0x10dbe6)=>{global['distributi'+'on'][_0x539a05['gid']]['comm']['send']([_0x3e1894],{'service':'groups','method':'del'},_0x10dbe6);},'get':(_0x51b365,_0x2f5287)=>{global['distributi'+'on'][_0x539a05['gid']]['comm']['send']([_0x51b365],{'service':'groups','method':'get'},_0x2f5287);},'add':(_0x1c572c,_0x3f97c9,_0x52f43a)=>{global['distributi'+'on'][_0x539a05['gid']]['comm']['send']([_0x1c572c,_0x3f97c9],{'service':'groups','method':'add'},_0x52f43a);},'rem':(_0x5ca29b,_0x315e62,_0x5eb9a2)=>{global['distributi'+'on'][_0x539a05['gid']]['comm']['send']([_0x5ca29b,_0x315e62],{'service':'groups','method':'rem'},_0x5eb9a2);}};};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 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;
9
+ const log=require('../util/lo'+'g'),routesStore=new Map(),routes={};routes['get']=function(_0x54cf11,_0x9f8b89){log('[routes.ge'+'t]\x20Getting'+'\x20service:\x20'+_0x54cf11);if(!_0x9f8b89)return;if(_0x54cf11 in routesStore){log('[routes.ge'+'t]\x20Found\x20s'+'ervice:\x20'+_0x54cf11);let _0x496928=routesStore[_0x54cf11];_0x9f8b89(null,_0x496928);}else{const _0x47bcb1=global['toLocal']['get'](_0x54cf11);_0x47bcb1?(log('[routes.ge'+'t]\x20Found\x20R'+'PC:\x20'+_0x54cf11),_0x9f8b89(null,{'call':_0x47bcb1})):_0x9f8b89(new Error('Service\x20'+_0x54cf11+('\x20not\x20found'+'\x20in\x20routes')));}},routes['put']=function(_0x2a8029,_0x44cb25,_0x27e418){log('[routes.pu'+'t]\x20Putting'+'\x20service:\x20'+_0x44cb25),routesStore[_0x44cb25]=_0x2a8029;_0x27e418&&_0x27e418(null,_0x44cb25);;},routes['rem']=function(_0x384448,_0x7a207b){const _0x491714=routesStore[_0x384448];delete routesStore[_0x384448],_0x7a207b(null,_0x491714);},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(_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;
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(_0x7619b7,_0x473632){_0x473632=_0x473632||function(){};if(_0x7619b7 in global['nodeConfig'])_0x473632(null,global['nodeConfig'][_0x7619b7]);else{if(_0x7619b7 in moreStatus)_0x473632(null,moreStatus[_0x7619b7]);else{if(_0x7619b7==='heapTotal')_0x473632(null,process['memoryUsag'+'e']()['heapTotal']);else _0x7619b7==='heapUsed'?_0x473632(null,process['memoryUsag'+'e']()['heapUsed']):_0x473632(new Error('Status\x20key'+'\x20not\x20found'));}}};const path=require('path'),{spawn}=require('child_proc'+'ess'),wire=require('../util/wi'+'re'),createSpawnedCb=function(_0x557908,_0x2e82f0){let _0x6ce769='\x0a\x20\x20\x20\x20let\x20o'+'nStart\x20=\x20'+_0x557908['toString']()+(';\x0a\x0a\x20\x20\x20\x20let'+'\x20callbackR'+'PC\x20=\x20')+wire['createRPC'](wire['toAsync'](_0x2e82f0))['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(_0x6ce769);};status['spawn']=function(_0x572632,_0xb8c0e){const _0x189c6d=_0x572632;_0x189c6d['onStart']=_0x189c6d['onStart']||function(){};if(!_0x189c6d['port']||!_0x189c6d['ip']){_0xb8c0e(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'](_0x189c6d)),_0x189c6d['onStart']=createSpawnedCb(_0x189c6d['onStart'],_0xb8c0e);const _0x548ee3=path['join'](__dirname,'../../dist'+'ribution.j'+'s');let _0x24e7f3=spawn('node',[_0x548ee3,'--config',global['distributi'+'on']['util']['serialize'](_0x189c6d)],{'detached':!![],'stdio':'inherit'});_0x24e7f3;},status['stop']=function(_0x3569c7){_0x3569c7=_0x3569c7||function(){},_0x3569c7(null,global['nodeConfig']),log('[status.st'+'op]\x20Shutti'+'ng\x20down\x20no'+'de'),global['distributi'+'on']['node']['server']['close'](),process['exit'](-0xcb5*0x3+0x115f+0x14c0);},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 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};
9
+ const log=require('../util/lo'+'g'),id=require('../util/id'),serialization=require('../util/se'+'rializatio'+'n');global['toLocal']=new Map();function createRPC(_0x3fc100){let _0x569f9d=id['getID'](serialization['serialize'](_0x3fc100));global['toLocal']['set'](_0x569f9d,_0x3fc100);let _0x26b8d3='\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')+_0x569f9d+('\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'+_0x569f9d),new Function('...args',_0x26b8d3);}function toAsync(_0x3514dc){log('Converting'+'\x20function\x20'+'to\x20async:\x20'+_0x3514dc['name']+':\x20'+_0x3514dc['toString']()['replace'](/\n/g,'|'));const _0x51cb4e=(..._0x41d44d)=>{const _0x10d035=_0x41d44d['pop']();try{const _0x4b6b5c=_0x3514dc(..._0x41d44d);_0x10d035(null,_0x4b6b5c);}catch(_0x3e3ac5){_0x10d035(_0x3e3ac5);}};return _0x51cb4e['toString']=()=>_0x3514dc['toString'](),_0x51cb4e;}module['exports']={'createRPC':createRPC,'toAsync':toAsync};
10
10
  /* eslint-enable */
package/distribution.js CHANGED
@@ -51,8 +51,6 @@ distribution.util = require('./distribution/util/util.js');
51
51
  distribution.local = require('./distribution/local/local.js');
52
52
  distribution.node = require('./distribution/local/node.js');
53
53
 
54
- distribution.util.groups = require('./distribution/all/groups.js');
55
-
56
54
  for (let key in distribution.local) {
57
55
  distribution.local.routes.put(distribution.local[key], key);
58
56
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brown-ds/distribution",
3
- "version": "0.0.39",
3
+ "version": "0.0.41",
4
4
  "description": "A library for building distributed systems.",
5
5
  "main": "distribution.js",
6
6
  "useLibrary": false,
@@ -14,9 +14,10 @@
14
14
  "jest": "^27.4.7"
15
15
  },
16
16
  "scripts": {
17
+ "pretest": "./scripts/pretest.sh",
17
18
  "test": "jest --maxWorkers=1",
18
19
  "build": "./scripts/publish.sh",
19
- "lint": "eslint --ignore-path .gitignore --config .eslintrc ."
20
+ "lint": "eslint --ignore-path .gitignore --config .eslintrc . --fix"
20
21
  },
21
22
  "author": "",
22
23
  "license": "ISC",