@brown-ds/distribution 0.0.40 → 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'),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.40",
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",