Built motion from commit c116dc8b.|2.6.30
[motion2.git] / server / api / intZohoAccount / intZohoAccount.rpc.js
index f4b0302..288cc9f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6faf=['model','ShowZohoAccount','ZohoAccount','find','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','http','request','then','ZohoAccount,\x20%s,\x20%s','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','info','request\x20sent','result','catch','GetZohoAccount','findAll','options','raw','where','attributes','limit','map','include'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6faf,0xf9));var _0xf6fa=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6faf[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0xf6fa('0x0'));var moment=require(_0xf6fa('0x1'));var BPromise=require(_0xf6fa('0x2'));var rs=require(_0xf6fa('0x3'));var fs=require('fs');var Redis=require(_0xf6fa('0x4'));var db=require(_0xf6fa('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf6fa('0x6'))('rpc');var config=require(_0xf6fa('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xf6fa('0x8')][_0xf6fa('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1f93f1,_0x1ac55e,_0x2de713){return new BPromise(function(_0x4e1b3c,_0x3f4d3f){return client[_0xf6fa('0xa')](_0x1f93f1,_0x2de713)[_0xf6fa('0xb')](function(_0x585633){logger['info'](_0xf6fa('0xc'),_0x1ac55e,'request\x20sent');logger[_0xf6fa('0xd')](_0xf6fa('0xe'),_0x1ac55e,'request\x20sent',JSON[_0xf6fa('0xf')](_0x585633));if(_0x585633['error']){if(_0x585633[_0xf6fa('0x10')]['code']===0x1f4){logger['error']('ZohoAccount,\x20%s,\x20%s',_0x1ac55e,_0x585633[_0xf6fa('0x10')][_0xf6fa('0x11')]);return _0x3f4d3f(_0x585633[_0xf6fa('0x10')][_0xf6fa('0x11')]);}logger[_0xf6fa('0x10')](_0xf6fa('0xc'),_0x1ac55e,_0x585633[_0xf6fa('0x10')][_0xf6fa('0x11')]);return _0x4e1b3c(_0x585633[_0xf6fa('0x10')][_0xf6fa('0x11')]);}else{logger[_0xf6fa('0x12')]('ZohoAccount,\x20%s,\x20%s',_0x1ac55e,_0xf6fa('0x13'));_0x4e1b3c(_0x585633[_0xf6fa('0x14')]['message']);}})[_0xf6fa('0x15')](function(_0x476eeb){logger[_0xf6fa('0x10')]('ZohoAccount,\x20%s,\x20%s',_0x1ac55e,_0x476eeb);_0x3f4d3f(_0x476eeb);});});}exports[_0xf6fa('0x16')]=function(_0x98737b){var _0x8dd910=this;return new Promise(function(_0x18b839,_0x3cb498){return db['ZohoAccount'][_0xf6fa('0x17')]({'raw':_0x98737b['options']?_0x98737b[_0xf6fa('0x18')][_0xf6fa('0x19')]===undefined?!![]:![]:!![],'where':_0x98737b[_0xf6fa('0x18')]?_0x98737b['options'][_0xf6fa('0x1a')]||null:null,'attributes':_0x98737b[_0xf6fa('0x18')]?_0x98737b[_0xf6fa('0x18')][_0xf6fa('0x1b')]||null:null,'limit':_0x98737b[_0xf6fa('0x18')]?_0x98737b[_0xf6fa('0x18')][_0xf6fa('0x1c')]||null:null,'include':_0x98737b[_0xf6fa('0x18')]?_0x98737b['options']['include']?_[_0xf6fa('0x1d')](_0x98737b['options'][_0xf6fa('0x1e')],function(_0x4c7b29){return{'model':db[_0x4c7b29['model']],'as':_0x4c7b29['as'],'attributes':_0x4c7b29['attributes'],'include':_0x4c7b29['include']?_['map'](_0x4c7b29[_0xf6fa('0x1e')],function(_0x1eb180){return{'model':db[_0x1eb180[_0xf6fa('0x1f')]],'as':_0x1eb180['as'],'attributes':_0x1eb180[_0xf6fa('0x1b')],'include':_0x1eb180[_0xf6fa('0x1e')]?_[_0xf6fa('0x1d')](_0x1eb180[_0xf6fa('0x1e')],function(_0x488601){return{'model':db[_0x488601[_0xf6fa('0x1f')]],'as':_0x488601['as'],'attributes':_0x488601[_0xf6fa('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xf6fa('0xb')](function(_0x4f7e0a){logger[_0xf6fa('0x12')](_0xf6fa('0x16'),_0x98737b);logger[_0xf6fa('0xd')](_0xf6fa('0x16'),_0x98737b,JSON[_0xf6fa('0xf')](_0x4f7e0a));_0x18b839(_0x4f7e0a);})[_0xf6fa('0x15')](function(_0x1034b0){logger['error'](_0xf6fa('0x16'),_0x1034b0[_0xf6fa('0x11')],_0x98737b);_0x3cb498(_0x8dd910[_0xf6fa('0x10')](0x1f4,_0x1034b0['message']));});});};exports[_0xf6fa('0x20')]=function(_0x2bb9d5){var _0x759ee7=this;return new Promise(function(_0x49a566,_0x3a9ec2){return db[_0xf6fa('0x21')][_0xf6fa('0x22')]({'raw':_0x2bb9d5['options']?_0x2bb9d5['options'][_0xf6fa('0x19')]===undefined?!![]:![]:!![],'where':_0x2bb9d5[_0xf6fa('0x18')]?_0x2bb9d5[_0xf6fa('0x18')][_0xf6fa('0x1a')]||null:null,'attributes':_0x2bb9d5[_0xf6fa('0x18')]?_0x2bb9d5[_0xf6fa('0x18')][_0xf6fa('0x1b')]||null:null,'include':_0x2bb9d5[_0xf6fa('0x18')]?_0x2bb9d5[_0xf6fa('0x18')]['include']?_[_0xf6fa('0x1d')](_0x2bb9d5[_0xf6fa('0x18')][_0xf6fa('0x1e')],function(_0x5c81ac){return{'model':db[_0x5c81ac[_0xf6fa('0x1f')]],'as':_0x5c81ac['as'],'attributes':_0x5c81ac[_0xf6fa('0x1b')],'include':_0x5c81ac['include']?_[_0xf6fa('0x1d')](_0x5c81ac[_0xf6fa('0x1e')],function(_0x3437b3){return{'model':db[_0x3437b3[_0xf6fa('0x1f')]],'as':_0x3437b3['as'],'attributes':_0x3437b3[_0xf6fa('0x1b')],'include':_0x3437b3[_0xf6fa('0x1e')]?_[_0xf6fa('0x1d')](_0x3437b3['include'],function(_0x21e788){return{'model':db[_0x21e788[_0xf6fa('0x1f')]],'as':_0x21e788['as'],'attributes':_0x21e788[_0xf6fa('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xf6fa('0xb')](function(_0xebab8d){logger[_0xf6fa('0x12')](_0xf6fa('0x20'),_0x2bb9d5);logger[_0xf6fa('0xd')](_0xf6fa('0x20'),_0x2bb9d5,JSON[_0xf6fa('0xf')](_0xebab8d));_0x49a566(_0xebab8d);})[_0xf6fa('0x15')](function(_0x6eb965){logger[_0xf6fa('0x10')]('ShowZohoAccount',_0x6eb965['message'],_0x2bb9d5);_0x3a9ec2(_0x759ee7[_0xf6fa('0x10')](0x1f4,_0x6eb965['message']));});});};
\ No newline at end of file
+var _0xb2af=['limit','include','map','attributes','model','ShowZohoAccount','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetZohoAccount','ZohoAccount','options','raw'];(function(_0x1c7d16,_0x329f04){var _0x57cffa=function(_0x4bb5a8){while(--_0x4bb5a8){_0x1c7d16['push'](_0x1c7d16['shift']());}};_0x57cffa(++_0x329f04);}(_0xb2af,0xd2));var _0xfb2a=function(_0x3b3b06,_0x1a4d84){_0x3b3b06=_0x3b3b06-0x0;var _0x5ee3a0=_0xb2af[_0x3b3b06];return _0x5ee3a0;};'use strict';var _=require(_0xfb2a('0x0'));var util=require(_0xfb2a('0x1'));var moment=require(_0xfb2a('0x2'));var BPromise=require(_0xfb2a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfb2a('0x4'));var db=require(_0xfb2a('0x5'))['db'];var utils=require(_0xfb2a('0x6'));var logger=require(_0xfb2a('0x7'))(_0xfb2a('0x8'));var config=require('../../config/environment');var jayson=require(_0xfb2a('0x9'));var client=jayson[_0xfb2a('0xa')][_0xfb2a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x55cf25,_0x715404,_0x3e20de){return new BPromise(function(_0x1f3315,_0x55bb4e){return client[_0xfb2a('0xc')](_0x55cf25,_0x3e20de)[_0xfb2a('0xd')](function(_0x3d3333){logger[_0xfb2a('0xe')](_0xfb2a('0xf'),_0x715404,_0xfb2a('0x10'));logger[_0xfb2a('0x11')](_0xfb2a('0x12'),_0x715404,_0xfb2a('0x10'),JSON[_0xfb2a('0x13')](_0x3d3333));if(_0x3d3333[_0xfb2a('0x14')]){if(_0x3d3333[_0xfb2a('0x14')]['code']===0x1f4){logger['error']('ZohoAccount,\x20%s,\x20%s',_0x715404,_0x3d3333[_0xfb2a('0x14')][_0xfb2a('0x15')]);return _0x55bb4e(_0x3d3333[_0xfb2a('0x14')][_0xfb2a('0x15')]);}logger['error'](_0xfb2a('0xf'),_0x715404,_0x3d3333['error']['message']);return _0x1f3315(_0x3d3333[_0xfb2a('0x14')]['message']);}else{logger['info'](_0xfb2a('0xf'),_0x715404,_0xfb2a('0x10'));_0x1f3315(_0x3d3333[_0xfb2a('0x16')][_0xfb2a('0x15')]);}})[_0xfb2a('0x17')](function(_0xc85abf){logger[_0xfb2a('0x14')](_0xfb2a('0xf'),_0x715404,_0xc85abf);_0x55bb4e(_0xc85abf);});});}exports[_0xfb2a('0x18')]=function(_0x52743a){var _0x1cdaa7=this;return new Promise(function(_0xb5ff5c,_0x288a32){return db[_0xfb2a('0x19')]['findAll']({'raw':_0x52743a[_0xfb2a('0x1a')]?_0x52743a['options'][_0xfb2a('0x1b')]===undefined?!![]:![]:!![],'where':_0x52743a[_0xfb2a('0x1a')]?_0x52743a[_0xfb2a('0x1a')]['where']||null:null,'attributes':_0x52743a['options']?_0x52743a['options']['attributes']||null:null,'limit':_0x52743a[_0xfb2a('0x1a')]?_0x52743a[_0xfb2a('0x1a')][_0xfb2a('0x1c')]||null:null,'include':_0x52743a[_0xfb2a('0x1a')]?_0x52743a[_0xfb2a('0x1a')][_0xfb2a('0x1d')]?_[_0xfb2a('0x1e')](_0x52743a[_0xfb2a('0x1a')][_0xfb2a('0x1d')],function(_0x351489){return{'model':db[_0x351489['model']],'as':_0x351489['as'],'attributes':_0x351489[_0xfb2a('0x1f')],'include':_0x351489['include']?_[_0xfb2a('0x1e')](_0x351489[_0xfb2a('0x1d')],function(_0x5726b3){return{'model':db[_0x5726b3[_0xfb2a('0x20')]],'as':_0x5726b3['as'],'attributes':_0x5726b3[_0xfb2a('0x1f')],'include':_0x5726b3['include']?_[_0xfb2a('0x1e')](_0x5726b3[_0xfb2a('0x1d')],function(_0x4cdb14){return{'model':db[_0x4cdb14[_0xfb2a('0x20')]],'as':_0x4cdb14['as'],'attributes':_0x4cdb14[_0xfb2a('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xfb2a('0xd')](function(_0x38a7fa){logger[_0xfb2a('0xe')](_0xfb2a('0x18'),_0x52743a);logger[_0xfb2a('0x11')](_0xfb2a('0x18'),_0x52743a,JSON[_0xfb2a('0x13')](_0x38a7fa));_0xb5ff5c(_0x38a7fa);})[_0xfb2a('0x17')](function(_0x4b79e5){logger[_0xfb2a('0x14')](_0xfb2a('0x18'),_0x4b79e5[_0xfb2a('0x15')],_0x52743a);_0x288a32(_0x1cdaa7[_0xfb2a('0x14')](0x1f4,_0x4b79e5[_0xfb2a('0x15')]));});});};exports[_0xfb2a('0x21')]=function(_0x2cecb){var _0x3042fb=this;return new Promise(function(_0x5dcbff,_0x225e04){return db['ZohoAccount']['find']({'raw':_0x2cecb[_0xfb2a('0x1a')]?_0x2cecb[_0xfb2a('0x1a')][_0xfb2a('0x1b')]===undefined?!![]:![]:!![],'where':_0x2cecb['options']?_0x2cecb[_0xfb2a('0x1a')]['where']||null:null,'attributes':_0x2cecb[_0xfb2a('0x1a')]?_0x2cecb[_0xfb2a('0x1a')][_0xfb2a('0x1f')]||null:null,'include':_0x2cecb[_0xfb2a('0x1a')]?_0x2cecb[_0xfb2a('0x1a')][_0xfb2a('0x1d')]?_['map'](_0x2cecb['options'][_0xfb2a('0x1d')],function(_0x158497){return{'model':db[_0x158497['model']],'as':_0x158497['as'],'attributes':_0x158497['attributes'],'include':_0x158497[_0xfb2a('0x1d')]?_[_0xfb2a('0x1e')](_0x158497[_0xfb2a('0x1d')],function(_0x299c87){return{'model':db[_0x299c87[_0xfb2a('0x20')]],'as':_0x299c87['as'],'attributes':_0x299c87[_0xfb2a('0x1f')],'include':_0x299c87['include']?_[_0xfb2a('0x1e')](_0x299c87[_0xfb2a('0x1d')],function(_0x1554d3){return{'model':db[_0x1554d3[_0xfb2a('0x20')]],'as':_0x1554d3['as'],'attributes':_0x1554d3[_0xfb2a('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xfb2a('0xd')](function(_0x3d64a5){logger[_0xfb2a('0xe')](_0xfb2a('0x21'),_0x2cecb);logger[_0xfb2a('0x11')](_0xfb2a('0x21'),_0x2cecb,JSON[_0xfb2a('0x13')](_0x3d64a5));_0x5dcbff(_0x3d64a5);})[_0xfb2a('0x17')](function(_0x17bb29){logger[_0xfb2a('0x14')](_0xfb2a('0x21'),_0x17bb29[_0xfb2a('0x15')],_0x2cecb);_0x225e04(_0x3042fb[_0xfb2a('0x14')](0x1f4,_0x17bb29[_0xfb2a('0x15')]));});});};
\ No newline at end of file