Built motion from commit 67e5df37.|2.0.65
[motion2.git] / server / api / squareProject / squareProject.rpc.js
1 // xCALLY MOTION OBFUSCATOR 2.0.65
2 var _0x3561=['request','info','SquareProject,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','catch','ShowSquareProject','SquareProject','find','options','raw','attributes','include','map','model','then','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x216ac5,_0x326edb){var _0x201979=function(_0x4294e0){while(--_0x4294e0){_0x216ac5['push'](_0x216ac5['shift']());}};_0x201979(++_0x326edb);}(_0x3561,0x94));var _0x1356=function(_0x465b3b,_0x1268e5){_0x465b3b=_0x465b3b-0x0;var _0x36f41c=_0x3561[_0x465b3b];return _0x36f41c;};'use strict';var _=require(_0x1356('0x0'));var util=require('util');var moment=require(_0x1356('0x1'));var BPromise=require(_0x1356('0x2'));var rs=require(_0x1356('0x3'));var fs=require('fs');var db=require(_0x1356('0x4'))['db'];var utils=require(_0x1356('0x5'));var logger=require(_0x1356('0x6'))(_0x1356('0x7'));var config=require(_0x1356('0x8'));var jayson=require(_0x1356('0x9'));var client=jayson[_0x1356('0xa')][_0x1356('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x36e81f,_0x45ac56,_0x4b4527){return new BPromise(function(_0x105aaf,_0x33529f){return client[_0x1356('0xc')](_0x36e81f,_0x4b4527)['then'](function(_0x5e8516){logger[_0x1356('0xd')](_0x1356('0xe'),_0x45ac56,'request\x20sent');logger[_0x1356('0xf')]('SquareProject,\x20%s,\x20%s,\x20%s',_0x45ac56,_0x1356('0x10'),JSON[_0x1356('0x11')](_0x5e8516));if(_0x5e8516['error']){if(_0x5e8516[_0x1356('0x12')][_0x1356('0x13')]===0x1f4){logger['error'](_0x1356('0xe'),_0x45ac56,_0x5e8516[_0x1356('0x12')][_0x1356('0x14')]);return _0x33529f(_0x5e8516[_0x1356('0x12')][_0x1356('0x14')]);}logger[_0x1356('0x12')](_0x1356('0xe'),_0x45ac56,_0x5e8516[_0x1356('0x12')][_0x1356('0x14')]);return _0x105aaf(_0x5e8516[_0x1356('0x12')][_0x1356('0x14')]);}else{logger[_0x1356('0xd')](_0x1356('0xe'),_0x45ac56,'request\x20sent');_0x105aaf(_0x5e8516['result'][_0x1356('0x14')]);}})[_0x1356('0x15')](function(_0x11fdf2){logger['error'](_0x1356('0xe'),_0x45ac56,_0x11fdf2);_0x33529f(_0x11fdf2);});});}exports[_0x1356('0x16')]=function(_0x39f708){var _0x2256e2=this;return new Promise(function(_0xa115de,_0x36655c){return db[_0x1356('0x17')][_0x1356('0x18')]({'raw':_0x39f708[_0x1356('0x19')]?_0x39f708[_0x1356('0x19')][_0x1356('0x1a')]===undefined?!![]:![]:!![],'where':_0x39f708[_0x1356('0x19')]?_0x39f708[_0x1356('0x19')]['where']||null:null,'attributes':_0x39f708[_0x1356('0x19')]?_0x39f708['options'][_0x1356('0x1b')]||null:null,'include':_0x39f708['options']?_0x39f708[_0x1356('0x19')][_0x1356('0x1c')]?_[_0x1356('0x1d')](_0x39f708[_0x1356('0x19')][_0x1356('0x1c')],function(_0x43e3b2){return{'model':db[_0x43e3b2['model']],'as':_0x43e3b2['as'],'attributes':_0x43e3b2[_0x1356('0x1b')],'include':_0x43e3b2[_0x1356('0x1c')]?_['map'](_0x43e3b2[_0x1356('0x1c')],function(_0x13d30b){return{'model':db[_0x13d30b[_0x1356('0x1e')]],'as':_0x13d30b['as'],'attributes':_0x13d30b['attributes'],'include':_0x13d30b[_0x1356('0x1c')]?_[_0x1356('0x1d')](_0x13d30b[_0x1356('0x1c')],function(_0x231e6f){return{'model':db[_0x231e6f['model']],'as':_0x231e6f['as'],'attributes':_0x231e6f['attributes']};}):[]};}):[]};}):[]:[]})[_0x1356('0x1f')](function(_0x50a4b6){logger[_0x1356('0xd')](_0x1356('0x16'),_0x39f708);logger[_0x1356('0xf')](_0x1356('0x16'),_0x39f708,JSON[_0x1356('0x11')](_0x50a4b6));_0xa115de(_0x50a4b6);})['catch'](function(_0xabb5c4){logger[_0x1356('0x12')](_0x1356('0x16'),_0xabb5c4[_0x1356('0x14')],_0x39f708);_0x36655c(_0x2256e2[_0x1356('0x12')](0x1f4,_0xabb5c4[_0x1356('0x14')]));});});};