Built motion from commit 753c950e.|2.5.42
[motion2.git] / server / api / squareOdbc / squareOdbc.rpc.js
index 201f151..dc80173 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x02de=['SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSquareOdbc','options','raw','where','attributes','include','map','model','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info'];(function(_0x184d50,_0x1b1c64){var _0x56e8e5=function(_0xda0ea9){while(--_0xda0ea9){_0x184d50['push'](_0x184d50['shift']());}};_0x56e8e5(++_0x1b1c64);}(_0x02de,0x92));var _0xe02d=function(_0x318331,_0xf58c63){_0x318331=_0x318331-0x0;var _0x1679a5=_0x02de[_0x318331];return _0x1679a5;};'use strict';var _=require(_0xe02d('0x0'));var util=require(_0xe02d('0x1'));var moment=require(_0xe02d('0x2'));var BPromise=require(_0xe02d('0x3'));var rs=require(_0xe02d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe02d('0x5'));var logger=require(_0xe02d('0x6'))(_0xe02d('0x7'));var config=require('../../config/environment');var jayson=require(_0xe02d('0x8'));var client=jayson[_0xe02d('0x9')][_0xe02d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4d0493,_0x280523,_0x351e4a){return new BPromise(function(_0x166296,_0x7a6a61){return client[_0xe02d('0xb')](_0x4d0493,_0x351e4a)[_0xe02d('0xc')](function(_0x18f8ed){logger[_0xe02d('0xd')](_0xe02d('0xe'),_0x280523,_0xe02d('0xf'));logger[_0xe02d('0x10')](_0xe02d('0x11'),_0x280523,_0xe02d('0xf'),JSON[_0xe02d('0x12')](_0x18f8ed));if(_0x18f8ed['error']){if(_0x18f8ed[_0xe02d('0x13')][_0xe02d('0x14')]===0x1f4){logger[_0xe02d('0x13')](_0xe02d('0xe'),_0x280523,_0x18f8ed[_0xe02d('0x13')][_0xe02d('0x15')]);return _0x7a6a61(_0x18f8ed['error'][_0xe02d('0x15')]);}logger[_0xe02d('0x13')](_0xe02d('0xe'),_0x280523,_0x18f8ed['error'][_0xe02d('0x15')]);return _0x166296(_0x18f8ed[_0xe02d('0x13')][_0xe02d('0x15')]);}else{logger[_0xe02d('0xd')](_0xe02d('0xe'),_0x280523,_0xe02d('0xf'));_0x166296(_0x18f8ed[_0xe02d('0x16')][_0xe02d('0x15')]);}})[_0xe02d('0x17')](function(_0x5529bc){logger[_0xe02d('0x13')](_0xe02d('0xe'),_0x280523,_0x5529bc);_0x7a6a61(_0x5529bc);});});}exports[_0xe02d('0x18')]=function(_0x11a920){var _0x23ac5a=this;return new Promise(function(_0x262eb0,_0x480076){return db['SquareOdbc']['find']({'raw':_0x11a920[_0xe02d('0x19')]?_0x11a920['options'][_0xe02d('0x1a')]===undefined?!![]:![]:!![],'where':_0x11a920[_0xe02d('0x19')]?_0x11a920[_0xe02d('0x19')][_0xe02d('0x1b')]||null:null,'attributes':_0x11a920[_0xe02d('0x19')]?_0x11a920[_0xe02d('0x19')][_0xe02d('0x1c')]||null:null,'include':_0x11a920[_0xe02d('0x19')]?_0x11a920['options'][_0xe02d('0x1d')]?_[_0xe02d('0x1e')](_0x11a920[_0xe02d('0x19')]['include'],function(_0x31fee2){return{'model':db[_0x31fee2['model']],'as':_0x31fee2['as'],'attributes':_0x31fee2[_0xe02d('0x1c')],'include':_0x31fee2[_0xe02d('0x1d')]?_['map'](_0x31fee2[_0xe02d('0x1d')],function(_0x5774e1){return{'model':db[_0x5774e1[_0xe02d('0x1f')]],'as':_0x5774e1['as'],'attributes':_0x5774e1[_0xe02d('0x1c')],'include':_0x5774e1[_0xe02d('0x1d')]?_[_0xe02d('0x1e')](_0x5774e1['include'],function(_0x2bda3e){return{'model':db[_0x2bda3e['model']],'as':_0x2bda3e['as'],'attributes':_0x2bda3e[_0xe02d('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x152a46){logger[_0xe02d('0xd')](_0xe02d('0x18'),_0x11a920);logger[_0xe02d('0x10')](_0xe02d('0x18'),_0x11a920,JSON[_0xe02d('0x12')](_0x152a46));_0x262eb0(_0x152a46);})[_0xe02d('0x17')](function(_0x5e60bf){logger[_0xe02d('0x13')](_0xe02d('0x18'),_0x5e60bf[_0xe02d('0x15')],_0x11a920);_0x480076(_0x23ac5a[_0xe02d('0x13')](0x1f4,_0x5e60bf[_0xe02d('0x15')]));});});};
\ No newline at end of file
+var _0x07a5=['SquareOdbc','find','options','raw','attributes','map','include','model','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','ShowSquareOdbc'];(function(_0x36b7e7,_0x5724ac){var _0x3e6ca5=function(_0x147dee){while(--_0x147dee){_0x36b7e7['push'](_0x36b7e7['shift']());}};_0x3e6ca5(++_0x5724ac);}(_0x07a5,0x18e));var _0x507a=function(_0x8a654b,_0x4be2f9){_0x8a654b=_0x8a654b-0x0;var _0x94bfbb=_0x07a5[_0x8a654b];return _0x94bfbb;};'use strict';var _=require(_0x507a('0x0'));var util=require(_0x507a('0x1'));var moment=require(_0x507a('0x2'));var BPromise=require('bluebird');var rs=require(_0x507a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x507a('0x4'))['db'];var utils=require(_0x507a('0x5'));var logger=require(_0x507a('0x6'))(_0x507a('0x7'));var config=require(_0x507a('0x8'));var jayson=require(_0x507a('0x9'));var client=jayson['client'][_0x507a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x574e58,_0x4e4b1b,_0x16e04a){return new BPromise(function(_0xc6b536,_0x1ad4bd){return client[_0x507a('0xb')](_0x574e58,_0x16e04a)['then'](function(_0x50c6ab){logger[_0x507a('0xc')](_0x507a('0xd'),_0x4e4b1b,_0x507a('0xe'));logger[_0x507a('0xf')](_0x507a('0x10'),_0x4e4b1b,_0x507a('0xe'),JSON[_0x507a('0x11')](_0x50c6ab));if(_0x50c6ab['error']){if(_0x50c6ab[_0x507a('0x12')]['code']===0x1f4){logger[_0x507a('0x12')](_0x507a('0xd'),_0x4e4b1b,_0x50c6ab[_0x507a('0x12')][_0x507a('0x13')]);return _0x1ad4bd(_0x50c6ab[_0x507a('0x12')][_0x507a('0x13')]);}logger[_0x507a('0x12')](_0x507a('0xd'),_0x4e4b1b,_0x50c6ab[_0x507a('0x12')][_0x507a('0x13')]);return _0xc6b536(_0x50c6ab[_0x507a('0x12')]['message']);}else{logger[_0x507a('0xc')](_0x507a('0xd'),_0x4e4b1b,_0x507a('0xe'));_0xc6b536(_0x50c6ab['result'][_0x507a('0x13')]);}})[_0x507a('0x14')](function(_0x28560a){logger['error'](_0x507a('0xd'),_0x4e4b1b,_0x28560a);_0x1ad4bd(_0x28560a);});});}exports[_0x507a('0x15')]=function(_0x23db91){var _0x4c66e7=this;return new Promise(function(_0x16989c,_0x551a2e){return db[_0x507a('0x16')][_0x507a('0x17')]({'raw':_0x23db91[_0x507a('0x18')]?_0x23db91['options'][_0x507a('0x19')]===undefined?!![]:![]:!![],'where':_0x23db91[_0x507a('0x18')]?_0x23db91['options']['where']||null:null,'attributes':_0x23db91['options']?_0x23db91[_0x507a('0x18')][_0x507a('0x1a')]||null:null,'include':_0x23db91[_0x507a('0x18')]?_0x23db91[_0x507a('0x18')]['include']?_[_0x507a('0x1b')](_0x23db91[_0x507a('0x18')][_0x507a('0x1c')],function(_0x52ef87){return{'model':db[_0x52ef87['model']],'as':_0x52ef87['as'],'attributes':_0x52ef87[_0x507a('0x1a')],'include':_0x52ef87[_0x507a('0x1c')]?_[_0x507a('0x1b')](_0x52ef87[_0x507a('0x1c')],function(_0x5625c4){return{'model':db[_0x5625c4['model']],'as':_0x5625c4['as'],'attributes':_0x5625c4[_0x507a('0x1a')],'include':_0x5625c4[_0x507a('0x1c')]?_[_0x507a('0x1b')](_0x5625c4[_0x507a('0x1c')],function(_0x453348){return{'model':db[_0x453348[_0x507a('0x1d')]],'as':_0x453348['as'],'attributes':_0x453348['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x70843b){logger[_0x507a('0xc')](_0x507a('0x15'),_0x23db91);logger[_0x507a('0xf')](_0x507a('0x15'),_0x23db91,JSON[_0x507a('0x11')](_0x70843b));_0x16989c(_0x70843b);})[_0x507a('0x14')](function(_0x45dc96){logger[_0x507a('0x12')]('ShowSquareOdbc',_0x45dc96['message'],_0x23db91);_0x551a2e(_0x4c66e7[_0x507a('0x12')](0x1f4,_0x45dc96[_0x507a('0x13')]));});});};
\ No newline at end of file