Built motion from commit 10af8726.|2.6.34
[motion2.git] / server / api / intZohoAccount / intZohoAccount.rpc.js
index f8e4ae1..6ce538a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa5c1=['util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','ZohoAccount,\x20%s,\x20%s','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ZohoAccount','options','raw','attributes','include','map','model','GetZohoAccount','ShowZohoAccount','find','where','lodash'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa5c1,0x19f));var _0x1a5c=function(_0x270b83,_0x481742){_0x270b83=_0x270b83-0x0;var _0x51da81=_0xa5c1[_0x270b83];return _0x51da81;};'use strict';var _=require(_0x1a5c('0x0'));var util=require(_0x1a5c('0x1'));var moment=require(_0x1a5c('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1a5c('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1a5c('0x4'));var logger=require(_0x1a5c('0x5'))(_0x1a5c('0x6'));var config=require(_0x1a5c('0x7'));var jayson=require(_0x1a5c('0x8'));var client=jayson[_0x1a5c('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x9853,_0x580a2e,_0x438f8f){return new BPromise(function(_0x43a2ed,_0x1702ce){return client['request'](_0x9853,_0x438f8f)[_0x1a5c('0xa')](function(_0x4c0bd2){logger[_0x1a5c('0xb')](_0x1a5c('0xc'),_0x580a2e,'request\x20sent');logger[_0x1a5c('0xd')](_0x1a5c('0xe'),_0x580a2e,'request\x20sent',JSON[_0x1a5c('0xf')](_0x4c0bd2));if(_0x4c0bd2[_0x1a5c('0x10')]){if(_0x4c0bd2[_0x1a5c('0x10')][_0x1a5c('0x11')]===0x1f4){logger[_0x1a5c('0x10')](_0x1a5c('0xc'),_0x580a2e,_0x4c0bd2[_0x1a5c('0x10')]['message']);return _0x1702ce(_0x4c0bd2[_0x1a5c('0x10')][_0x1a5c('0x12')]);}logger['error'](_0x1a5c('0xc'),_0x580a2e,_0x4c0bd2[_0x1a5c('0x10')]['message']);return _0x43a2ed(_0x4c0bd2[_0x1a5c('0x10')][_0x1a5c('0x12')]);}else{logger[_0x1a5c('0xb')](_0x1a5c('0xc'),_0x580a2e,'request\x20sent');_0x43a2ed(_0x4c0bd2[_0x1a5c('0x13')]['message']);}})[_0x1a5c('0x14')](function(_0x44648a){logger[_0x1a5c('0x10')]('ZohoAccount,\x20%s,\x20%s',_0x580a2e,_0x44648a);_0x1702ce(_0x44648a);});});}exports['GetZohoAccount']=function(_0x32e177){var _0x2e6a6f=this;return new Promise(function(_0x18551c,_0xe376f4){return db[_0x1a5c('0x15')]['findAll']({'raw':_0x32e177[_0x1a5c('0x16')]?_0x32e177['options'][_0x1a5c('0x17')]===undefined?!![]:![]:!![],'where':_0x32e177[_0x1a5c('0x16')]?_0x32e177[_0x1a5c('0x16')]['where']||null:null,'attributes':_0x32e177[_0x1a5c('0x16')]?_0x32e177[_0x1a5c('0x16')][_0x1a5c('0x18')]||null:null,'limit':_0x32e177[_0x1a5c('0x16')]?_0x32e177[_0x1a5c('0x16')]['limit']||null:null,'include':_0x32e177[_0x1a5c('0x16')]?_0x32e177[_0x1a5c('0x16')][_0x1a5c('0x19')]?_[_0x1a5c('0x1a')](_0x32e177[_0x1a5c('0x16')][_0x1a5c('0x19')],function(_0x1991f6){return{'model':db[_0x1991f6[_0x1a5c('0x1b')]],'as':_0x1991f6['as'],'attributes':_0x1991f6[_0x1a5c('0x18')],'include':_0x1991f6[_0x1a5c('0x19')]?_[_0x1a5c('0x1a')](_0x1991f6[_0x1a5c('0x19')],function(_0x4c6520){return{'model':db[_0x4c6520[_0x1a5c('0x1b')]],'as':_0x4c6520['as'],'attributes':_0x4c6520['attributes'],'include':_0x4c6520[_0x1a5c('0x19')]?_['map'](_0x4c6520[_0x1a5c('0x19')],function(_0x4323f8){return{'model':db[_0x4323f8[_0x1a5c('0x1b')]],'as':_0x4323f8['as'],'attributes':_0x4323f8[_0x1a5c('0x18')]};}):[]};}):[]};}):[]:[]})[_0x1a5c('0xa')](function(_0x1e5e87){logger[_0x1a5c('0xb')](_0x1a5c('0x1c'),_0x32e177);logger[_0x1a5c('0xd')](_0x1a5c('0x1c'),_0x32e177,JSON[_0x1a5c('0xf')](_0x1e5e87));_0x18551c(_0x1e5e87);})['catch'](function(_0x25950b){logger[_0x1a5c('0x10')](_0x1a5c('0x1c'),_0x25950b[_0x1a5c('0x12')],_0x32e177);_0xe376f4(_0x2e6a6f[_0x1a5c('0x10')](0x1f4,_0x25950b[_0x1a5c('0x12')]));});});};exports[_0x1a5c('0x1d')]=function(_0x1a2bec){var _0xb97acb=this;return new Promise(function(_0x523dfb,_0x243c0c){return db[_0x1a5c('0x15')][_0x1a5c('0x1e')]({'raw':_0x1a2bec[_0x1a5c('0x16')]?_0x1a2bec['options'][_0x1a5c('0x17')]===undefined?!![]:![]:!![],'where':_0x1a2bec[_0x1a5c('0x16')]?_0x1a2bec[_0x1a5c('0x16')][_0x1a5c('0x1f')]||null:null,'attributes':_0x1a2bec[_0x1a5c('0x16')]?_0x1a2bec[_0x1a5c('0x16')][_0x1a5c('0x18')]||null:null,'include':_0x1a2bec['options']?_0x1a2bec[_0x1a5c('0x16')][_0x1a5c('0x19')]?_['map'](_0x1a2bec[_0x1a5c('0x16')][_0x1a5c('0x19')],function(_0xdd89f2){return{'model':db[_0xdd89f2[_0x1a5c('0x1b')]],'as':_0xdd89f2['as'],'attributes':_0xdd89f2['attributes'],'include':_0xdd89f2[_0x1a5c('0x19')]?_[_0x1a5c('0x1a')](_0xdd89f2['include'],function(_0x1f957a){return{'model':db[_0x1f957a[_0x1a5c('0x1b')]],'as':_0x1f957a['as'],'attributes':_0x1f957a[_0x1a5c('0x18')],'include':_0x1f957a[_0x1a5c('0x19')]?_[_0x1a5c('0x1a')](_0x1f957a[_0x1a5c('0x19')],function(_0x38e8cb){return{'model':db[_0x38e8cb[_0x1a5c('0x1b')]],'as':_0x38e8cb['as'],'attributes':_0x38e8cb[_0x1a5c('0x18')]};}):[]};}):[]};}):[]:[]})[_0x1a5c('0xa')](function(_0x515780){logger[_0x1a5c('0xb')](_0x1a5c('0x1d'),_0x1a2bec);logger['debug'](_0x1a5c('0x1d'),_0x1a2bec,JSON[_0x1a5c('0xf')](_0x515780));_0x523dfb(_0x515780);})['catch'](function(_0x4abca8){logger[_0x1a5c('0x10')](_0x1a5c('0x1d'),_0x4abca8[_0x1a5c('0x12')],_0x1a2bec);_0x243c0c(_0xb97acb[_0x1a5c('0x10')](0x1f4,_0x4abca8['message']));});});};
\ No newline at end of file
+var _0x1241=['lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','ZohoAccount','findAll','options','raw','where','limit','include','map','model','attributes','GetZohoAccount','ShowZohoAccount','find','then'];(function(_0x1991a0,_0x1409a9){var _0x4d5775=function(_0x44579b){while(--_0x44579b){_0x1991a0['push'](_0x1991a0['shift']());}};_0x4d5775(++_0x1409a9);}(_0x1241,0xb4));var _0x1124=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1241[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x1124('0x0'));var util=require('util');var moment=require(_0x1124('0x1'));var BPromise=require(_0x1124('0x2'));var rs=require(_0x1124('0x3'));var fs=require('fs');var Redis=require(_0x1124('0x4'));var db=require(_0x1124('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1124('0x6'))(_0x1124('0x7'));var config=require(_0x1124('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x1124('0x9')][_0x1124('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x45200c,_0x3fe52a,_0x52b076){return new BPromise(function(_0x57a179,_0x4cecf6){return client[_0x1124('0xb')](_0x45200c,_0x52b076)['then'](function(_0x159c1c){logger[_0x1124('0xc')](_0x1124('0xd'),_0x3fe52a,_0x1124('0xe'));logger[_0x1124('0xf')](_0x1124('0x10'),_0x3fe52a,'request\x20sent',JSON[_0x1124('0x11')](_0x159c1c));if(_0x159c1c['error']){if(_0x159c1c['error']['code']===0x1f4){logger[_0x1124('0x12')]('ZohoAccount,\x20%s,\x20%s',_0x3fe52a,_0x159c1c['error'][_0x1124('0x13')]);return _0x4cecf6(_0x159c1c[_0x1124('0x12')][_0x1124('0x13')]);}logger['error'](_0x1124('0xd'),_0x3fe52a,_0x159c1c[_0x1124('0x12')][_0x1124('0x13')]);return _0x57a179(_0x159c1c[_0x1124('0x12')]['message']);}else{logger[_0x1124('0xc')](_0x1124('0xd'),_0x3fe52a,_0x1124('0xe'));_0x57a179(_0x159c1c[_0x1124('0x14')][_0x1124('0x13')]);}})[_0x1124('0x15')](function(_0x356c4a){logger[_0x1124('0x12')](_0x1124('0xd'),_0x3fe52a,_0x356c4a);_0x4cecf6(_0x356c4a);});});}exports['GetZohoAccount']=function(_0x5e7506){var _0x20c85e=this;return new Promise(function(_0x55d2e3,_0x5ba192){return db[_0x1124('0x16')][_0x1124('0x17')]({'raw':_0x5e7506[_0x1124('0x18')]?_0x5e7506[_0x1124('0x18')][_0x1124('0x19')]===undefined?!![]:![]:!![],'where':_0x5e7506['options']?_0x5e7506[_0x1124('0x18')][_0x1124('0x1a')]||null:null,'attributes':_0x5e7506[_0x1124('0x18')]?_0x5e7506['options']['attributes']||null:null,'limit':_0x5e7506[_0x1124('0x18')]?_0x5e7506['options'][_0x1124('0x1b')]||null:null,'include':_0x5e7506['options']?_0x5e7506[_0x1124('0x18')][_0x1124('0x1c')]?_[_0x1124('0x1d')](_0x5e7506[_0x1124('0x18')][_0x1124('0x1c')],function(_0x3e98a7){return{'model':db[_0x3e98a7[_0x1124('0x1e')]],'as':_0x3e98a7['as'],'attributes':_0x3e98a7[_0x1124('0x1f')],'include':_0x3e98a7[_0x1124('0x1c')]?_[_0x1124('0x1d')](_0x3e98a7[_0x1124('0x1c')],function(_0x4ff6e6){return{'model':db[_0x4ff6e6['model']],'as':_0x4ff6e6['as'],'attributes':_0x4ff6e6[_0x1124('0x1f')],'include':_0x4ff6e6[_0x1124('0x1c')]?_['map'](_0x4ff6e6[_0x1124('0x1c')],function(_0x54cf47){return{'model':db[_0x54cf47[_0x1124('0x1e')]],'as':_0x54cf47['as'],'attributes':_0x54cf47[_0x1124('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x159f18){logger[_0x1124('0xc')](_0x1124('0x20'),_0x5e7506);logger[_0x1124('0xf')](_0x1124('0x20'),_0x5e7506,JSON['stringify'](_0x159f18));_0x55d2e3(_0x159f18);})[_0x1124('0x15')](function(_0x38dddd){logger['error']('GetZohoAccount',_0x38dddd['message'],_0x5e7506);_0x5ba192(_0x20c85e[_0x1124('0x12')](0x1f4,_0x38dddd['message']));});});};exports[_0x1124('0x21')]=function(_0x3b9742){var _0x35fecd=this;return new Promise(function(_0x30dce3,_0x35df16){return db[_0x1124('0x16')][_0x1124('0x22')]({'raw':_0x3b9742['options']?_0x3b9742[_0x1124('0x18')][_0x1124('0x19')]===undefined?!![]:![]:!![],'where':_0x3b9742['options']?_0x3b9742[_0x1124('0x18')]['where']||null:null,'attributes':_0x3b9742[_0x1124('0x18')]?_0x3b9742[_0x1124('0x18')][_0x1124('0x1f')]||null:null,'include':_0x3b9742['options']?_0x3b9742['options'][_0x1124('0x1c')]?_[_0x1124('0x1d')](_0x3b9742[_0x1124('0x18')][_0x1124('0x1c')],function(_0x35573a){return{'model':db[_0x35573a[_0x1124('0x1e')]],'as':_0x35573a['as'],'attributes':_0x35573a[_0x1124('0x1f')],'include':_0x35573a['include']?_[_0x1124('0x1d')](_0x35573a[_0x1124('0x1c')],function(_0x23442d){return{'model':db[_0x23442d[_0x1124('0x1e')]],'as':_0x23442d['as'],'attributes':_0x23442d[_0x1124('0x1f')],'include':_0x23442d[_0x1124('0x1c')]?_[_0x1124('0x1d')](_0x23442d[_0x1124('0x1c')],function(_0x13c819){return{'model':db[_0x13c819[_0x1124('0x1e')]],'as':_0x13c819['as'],'attributes':_0x13c819[_0x1124('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x1124('0x23')](function(_0xd1829a){logger[_0x1124('0xc')](_0x1124('0x21'),_0x3b9742);logger['debug'](_0x1124('0x21'),_0x3b9742,JSON['stringify'](_0xd1829a));_0x30dce3(_0xd1829a);})['catch'](function(_0x3a1988){logger['error'](_0x1124('0x21'),_0x3a1988[_0x1124('0x13')],_0x3b9742);_0x35df16(_0x35fecd[_0x1124('0x12')](0x1f4,_0x3a1988[_0x1124('0x13')]));});});};
\ No newline at end of file