Built motion from commit (unavailable).|2.5.9
[motion2.git] / server / api / intZohoAccount / intZohoAccount.rpc.js
index 510f3b0..a9c5a96 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x02b4=['../../config/logger','rpc','client','http','then','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','ZohoAccount','findAll','options','where','attributes','limit','map','model','include','info','GetZohoAccount','ShowZohoAccount','find','raw','util','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0xd09668,_0x1435b2){var _0x68726=function(_0x54a030){while(--_0x54a030){_0xd09668['push'](_0xd09668['shift']());}};_0x68726(++_0x1435b2);}(_0x02b4,0x144));var _0x402b=function(_0x1ff77b,_0x391cc7){_0x1ff77b=_0x1ff77b-0x0;var _0x4e31ff=_0x02b4[_0x1ff77b];return _0x4e31ff;};'use strict';var _=require('lodash');var util=require(_0x402b('0x0'));var moment=require(_0x402b('0x1'));var BPromise=require(_0x402b('0x2'));var rs=require(_0x402b('0x3'));var fs=require('fs');var Redis=require(_0x402b('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x402b('0x5'));var logger=require(_0x402b('0x6'))(_0x402b('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x402b('0x8')][_0x402b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4b6b92,_0xea92c7,_0x2f0776){return new BPromise(function(_0x4fb6e8,_0x337f54){return client['request'](_0x4b6b92,_0x2f0776)[_0x402b('0xa')](function(_0x5bb006){logger['info'](_0x402b('0xb'),_0xea92c7,_0x402b('0xc'));logger[_0x402b('0xd')]('ZohoAccount,\x20%s,\x20%s,\x20%s',_0xea92c7,_0x402b('0xc'),JSON[_0x402b('0xe')](_0x5bb006));if(_0x5bb006[_0x402b('0xf')]){if(_0x5bb006[_0x402b('0xf')][_0x402b('0x10')]===0x1f4){logger['error']('ZohoAccount,\x20%s,\x20%s',_0xea92c7,_0x5bb006[_0x402b('0xf')][_0x402b('0x11')]);return _0x337f54(_0x5bb006['error'][_0x402b('0x11')]);}logger[_0x402b('0xf')](_0x402b('0xb'),_0xea92c7,_0x5bb006[_0x402b('0xf')][_0x402b('0x11')]);return _0x4fb6e8(_0x5bb006[_0x402b('0xf')][_0x402b('0x11')]);}else{logger['info']('ZohoAccount,\x20%s,\x20%s',_0xea92c7,_0x402b('0xc'));_0x4fb6e8(_0x5bb006['result'][_0x402b('0x11')]);}})[_0x402b('0x12')](function(_0x5a0201){logger['error'](_0x402b('0xb'),_0xea92c7,_0x5a0201);_0x337f54(_0x5a0201);});});}exports['GetZohoAccount']=function(_0x141355){var _0x5004ff=this;return new Promise(function(_0x4d8270,_0x4c7e3d){return db[_0x402b('0x13')][_0x402b('0x14')]({'raw':_0x141355['options']?_0x141355['options']['raw']===undefined?!![]:![]:!![],'where':_0x141355[_0x402b('0x15')]?_0x141355['options'][_0x402b('0x16')]||null:null,'attributes':_0x141355[_0x402b('0x15')]?_0x141355[_0x402b('0x15')][_0x402b('0x17')]||null:null,'limit':_0x141355[_0x402b('0x15')]?_0x141355[_0x402b('0x15')][_0x402b('0x18')]||null:null,'include':_0x141355[_0x402b('0x15')]?_0x141355['options']['include']?_[_0x402b('0x19')](_0x141355[_0x402b('0x15')]['include'],function(_0xcee887){return{'model':db[_0xcee887[_0x402b('0x1a')]],'as':_0xcee887['as'],'attributes':_0xcee887[_0x402b('0x17')],'include':_0xcee887['include']?_[_0x402b('0x19')](_0xcee887[_0x402b('0x1b')],function(_0x1ffef1){return{'model':db[_0x1ffef1[_0x402b('0x1a')]],'as':_0x1ffef1['as'],'attributes':_0x1ffef1[_0x402b('0x17')],'include':_0x1ffef1[_0x402b('0x1b')]?_[_0x402b('0x19')](_0x1ffef1['include'],function(_0x4d0c01){return{'model':db[_0x4d0c01['model']],'as':_0x4d0c01['as'],'attributes':_0x4d0c01['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x335dae){logger[_0x402b('0x1c')]('GetZohoAccount',_0x141355);logger['debug'](_0x402b('0x1d'),_0x141355,JSON[_0x402b('0xe')](_0x335dae));_0x4d8270(_0x335dae);})['catch'](function(_0x40ab8c){logger[_0x402b('0xf')](_0x402b('0x1d'),_0x40ab8c[_0x402b('0x11')],_0x141355);_0x4c7e3d(_0x5004ff[_0x402b('0xf')](0x1f4,_0x40ab8c['message']));});});};exports[_0x402b('0x1e')]=function(_0x3d67e7){var _0x1761c8=this;return new Promise(function(_0x4530bf,_0x19b81f){return db[_0x402b('0x13')][_0x402b('0x1f')]({'raw':_0x3d67e7[_0x402b('0x15')]?_0x3d67e7['options'][_0x402b('0x20')]===undefined?!![]:![]:!![],'where':_0x3d67e7[_0x402b('0x15')]?_0x3d67e7[_0x402b('0x15')]['where']||null:null,'attributes':_0x3d67e7[_0x402b('0x15')]?_0x3d67e7[_0x402b('0x15')][_0x402b('0x17')]||null:null,'include':_0x3d67e7[_0x402b('0x15')]?_0x3d67e7[_0x402b('0x15')][_0x402b('0x1b')]?_['map'](_0x3d67e7[_0x402b('0x15')][_0x402b('0x1b')],function(_0x9ec15a){return{'model':db[_0x9ec15a[_0x402b('0x1a')]],'as':_0x9ec15a['as'],'attributes':_0x9ec15a['attributes'],'include':_0x9ec15a[_0x402b('0x1b')]?_['map'](_0x9ec15a['include'],function(_0x3779ab){return{'model':db[_0x3779ab[_0x402b('0x1a')]],'as':_0x3779ab['as'],'attributes':_0x3779ab[_0x402b('0x17')],'include':_0x3779ab[_0x402b('0x1b')]?_[_0x402b('0x19')](_0x3779ab[_0x402b('0x1b')],function(_0x53be38){return{'model':db[_0x53be38['model']],'as':_0x53be38['as'],'attributes':_0x53be38[_0x402b('0x17')]};}):[]};}):[]};}):[]:[]})[_0x402b('0xa')](function(_0x1f48bd){logger[_0x402b('0x1c')]('ShowZohoAccount',_0x3d67e7);logger['debug'](_0x402b('0x1e'),_0x3d67e7,JSON[_0x402b('0xe')](_0x1f48bd));_0x4530bf(_0x1f48bd);})['catch'](function(_0x51151e){logger[_0x402b('0xf')]('ShowZohoAccount',_0x51151e[_0x402b('0x11')],_0x3d67e7);_0x19b81f(_0x1761c8[_0x402b('0xf')](0x1f4,_0x51151e[_0x402b('0x11')]));});});};
\ No newline at end of file
+var _0x31df=['find','ShowZohoAccount','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','findAll','options','raw','limit','include','map','attributes','model','GetZohoAccount','ZohoAccount'];(function(_0x2b9e8a,_0x7b21d4){var _0x520e67=function(_0x22bce8){while(--_0x22bce8){_0x2b9e8a['push'](_0x2b9e8a['shift']());}};_0x520e67(++_0x7b21d4);}(_0x31df,0x13d));var _0xf31d=function(_0x137853,_0x42a3b2){_0x137853=_0x137853-0x0;var _0x4bf8a5=_0x31df[_0x137853];return _0x4bf8a5;};'use strict';var _=require(_0xf31d('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf31d('0x1'));var rs=require(_0xf31d('0x2'));var fs=require('fs');var Redis=require(_0xf31d('0x3'));var db=require(_0xf31d('0x4'))['db'];var utils=require(_0xf31d('0x5'));var logger=require('../../config/logger')(_0xf31d('0x6'));var config=require(_0xf31d('0x7'));var jayson=require(_0xf31d('0x8'));var client=jayson[_0xf31d('0x9')][_0xf31d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3fba84,_0x20ecf2,_0x2c73d3){return new BPromise(function(_0x196c2b,_0xb1922e){return client['request'](_0x3fba84,_0x2c73d3)[_0xf31d('0xb')](function(_0x21a6d4){logger[_0xf31d('0xc')](_0xf31d('0xd'),_0x20ecf2,_0xf31d('0xe'));logger[_0xf31d('0xf')](_0xf31d('0x10'),_0x20ecf2,_0xf31d('0xe'),JSON[_0xf31d('0x11')](_0x21a6d4));if(_0x21a6d4[_0xf31d('0x12')]){if(_0x21a6d4[_0xf31d('0x12')][_0xf31d('0x13')]===0x1f4){logger[_0xf31d('0x12')](_0xf31d('0xd'),_0x20ecf2,_0x21a6d4[_0xf31d('0x12')][_0xf31d('0x14')]);return _0xb1922e(_0x21a6d4[_0xf31d('0x12')][_0xf31d('0x14')]);}logger[_0xf31d('0x12')](_0xf31d('0xd'),_0x20ecf2,_0x21a6d4['error'][_0xf31d('0x14')]);return _0x196c2b(_0x21a6d4['error'][_0xf31d('0x14')]);}else{logger[_0xf31d('0xc')](_0xf31d('0xd'),_0x20ecf2,'request\x20sent');_0x196c2b(_0x21a6d4[_0xf31d('0x15')][_0xf31d('0x14')]);}})[_0xf31d('0x16')](function(_0x599acf){logger[_0xf31d('0x12')]('ZohoAccount,\x20%s,\x20%s',_0x20ecf2,_0x599acf);_0xb1922e(_0x599acf);});});}exports['GetZohoAccount']=function(_0x1edc5e){var _0x14d783=this;return new Promise(function(_0x14db81,_0x54cc93){return db['ZohoAccount'][_0xf31d('0x17')]({'raw':_0x1edc5e['options']?_0x1edc5e[_0xf31d('0x18')][_0xf31d('0x19')]===undefined?!![]:![]:!![],'where':_0x1edc5e[_0xf31d('0x18')]?_0x1edc5e[_0xf31d('0x18')]['where']||null:null,'attributes':_0x1edc5e['options']?_0x1edc5e['options']['attributes']||null:null,'limit':_0x1edc5e[_0xf31d('0x18')]?_0x1edc5e[_0xf31d('0x18')][_0xf31d('0x1a')]||null:null,'include':_0x1edc5e[_0xf31d('0x18')]?_0x1edc5e[_0xf31d('0x18')][_0xf31d('0x1b')]?_[_0xf31d('0x1c')](_0x1edc5e[_0xf31d('0x18')][_0xf31d('0x1b')],function(_0x45ceed){return{'model':db[_0x45ceed['model']],'as':_0x45ceed['as'],'attributes':_0x45ceed[_0xf31d('0x1d')],'include':_0x45ceed[_0xf31d('0x1b')]?_[_0xf31d('0x1c')](_0x45ceed['include'],function(_0x3418ff){return{'model':db[_0x3418ff[_0xf31d('0x1e')]],'as':_0x3418ff['as'],'attributes':_0x3418ff[_0xf31d('0x1d')],'include':_0x3418ff[_0xf31d('0x1b')]?_[_0xf31d('0x1c')](_0x3418ff['include'],function(_0x5c27f3){return{'model':db[_0x5c27f3[_0xf31d('0x1e')]],'as':_0x5c27f3['as'],'attributes':_0x5c27f3[_0xf31d('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xf31d('0xb')](function(_0x2b5337){logger['info'](_0xf31d('0x1f'),_0x1edc5e);logger[_0xf31d('0xf')]('GetZohoAccount',_0x1edc5e,JSON['stringify'](_0x2b5337));_0x14db81(_0x2b5337);})['catch'](function(_0x452465){logger[_0xf31d('0x12')](_0xf31d('0x1f'),_0x452465[_0xf31d('0x14')],_0x1edc5e);_0x54cc93(_0x14d783[_0xf31d('0x12')](0x1f4,_0x452465['message']));});});};exports['ShowZohoAccount']=function(_0x1d7a96){var _0xa77d95=this;return new Promise(function(_0x299ce2,_0x59b3b5){return db[_0xf31d('0x20')][_0xf31d('0x21')]({'raw':_0x1d7a96[_0xf31d('0x18')]?_0x1d7a96[_0xf31d('0x18')][_0xf31d('0x19')]===undefined?!![]:![]:!![],'where':_0x1d7a96['options']?_0x1d7a96[_0xf31d('0x18')]['where']||null:null,'attributes':_0x1d7a96[_0xf31d('0x18')]?_0x1d7a96[_0xf31d('0x18')]['attributes']||null:null,'include':_0x1d7a96[_0xf31d('0x18')]?_0x1d7a96[_0xf31d('0x18')]['include']?_[_0xf31d('0x1c')](_0x1d7a96[_0xf31d('0x18')][_0xf31d('0x1b')],function(_0x25d16b){return{'model':db[_0x25d16b[_0xf31d('0x1e')]],'as':_0x25d16b['as'],'attributes':_0x25d16b['attributes'],'include':_0x25d16b['include']?_['map'](_0x25d16b[_0xf31d('0x1b')],function(_0x18f352){return{'model':db[_0x18f352[_0xf31d('0x1e')]],'as':_0x18f352['as'],'attributes':_0x18f352[_0xf31d('0x1d')],'include':_0x18f352[_0xf31d('0x1b')]?_[_0xf31d('0x1c')](_0x18f352['include'],function(_0x42b993){return{'model':db[_0x42b993[_0xf31d('0x1e')]],'as':_0x42b993['as'],'attributes':_0x42b993[_0xf31d('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xf31d('0xb')](function(_0x5ccb90){logger[_0xf31d('0xc')](_0xf31d('0x22'),_0x1d7a96);logger[_0xf31d('0xf')](_0xf31d('0x22'),_0x1d7a96,JSON[_0xf31d('0x11')](_0x5ccb90));_0x299ce2(_0x5ccb90);})[_0xf31d('0x16')](function(_0x4dc4cd){logger['error'](_0xf31d('0x22'),_0x4dc4cd[_0xf31d('0x14')],_0x1d7a96);_0x59b3b5(_0xa77d95[_0xf31d('0x12')](0x1f4,_0x4dc4cd['message']));});});};
\ No newline at end of file