Built motion from commit 85328c08.|2.5.50
[motion2.git] / server / api / intZohoAccount / intZohoAccount.rpc.js
index b982b9a..ac2ddbc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4e7b=['model','map','stringify','ShowZohoAccount','find','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','then','info','request\x20sent','debug','error','code','ZohoAccount,\x20%s,\x20%s','message','result','catch','GetZohoAccount','ZohoAccount','findAll','options','raw','where','attributes','limit','include'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x4e7b,0xf3));var _0xb4e7=function(_0x188019,_0x4b65e2){_0x188019=_0x188019-0x0;var _0x408cd8=_0x4e7b[_0x188019];return _0x408cd8;};'use strict';var _=require(_0xb4e7('0x0'));var util=require(_0xb4e7('0x1'));var moment=require('moment');var BPromise=require(_0xb4e7('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb4e7('0x3'));var db=require(_0xb4e7('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb4e7('0x5'))(_0xb4e7('0x6'));var config=require('../../config/environment');var jayson=require(_0xb4e7('0x7'));var client=jayson[_0xb4e7('0x8')][_0xb4e7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1dcf05,_0x315c27,_0x490b1b){return new BPromise(function(_0x366595,_0x3e621e){return client['request'](_0x1dcf05,_0x490b1b)[_0xb4e7('0xa')](function(_0x472973){logger[_0xb4e7('0xb')]('ZohoAccount,\x20%s,\x20%s',_0x315c27,_0xb4e7('0xc'));logger[_0xb4e7('0xd')]('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x315c27,'request\x20sent',JSON['stringify'](_0x472973));if(_0x472973['error']){if(_0x472973[_0xb4e7('0xe')][_0xb4e7('0xf')]===0x1f4){logger[_0xb4e7('0xe')](_0xb4e7('0x10'),_0x315c27,_0x472973[_0xb4e7('0xe')][_0xb4e7('0x11')]);return _0x3e621e(_0x472973[_0xb4e7('0xe')][_0xb4e7('0x11')]);}logger[_0xb4e7('0xe')](_0xb4e7('0x10'),_0x315c27,_0x472973[_0xb4e7('0xe')][_0xb4e7('0x11')]);return _0x366595(_0x472973[_0xb4e7('0xe')][_0xb4e7('0x11')]);}else{logger['info'](_0xb4e7('0x10'),_0x315c27,_0xb4e7('0xc'));_0x366595(_0x472973[_0xb4e7('0x12')][_0xb4e7('0x11')]);}})[_0xb4e7('0x13')](function(_0x3078a0){logger['error']('ZohoAccount,\x20%s,\x20%s',_0x315c27,_0x3078a0);_0x3e621e(_0x3078a0);});});}exports[_0xb4e7('0x14')]=function(_0xad7516){var _0x451572=this;return new Promise(function(_0x597f39,_0x30f45e){return db[_0xb4e7('0x15')][_0xb4e7('0x16')]({'raw':_0xad7516[_0xb4e7('0x17')]?_0xad7516['options'][_0xb4e7('0x18')]===undefined?!![]:![]:!![],'where':_0xad7516[_0xb4e7('0x17')]?_0xad7516[_0xb4e7('0x17')][_0xb4e7('0x19')]||null:null,'attributes':_0xad7516[_0xb4e7('0x17')]?_0xad7516[_0xb4e7('0x17')][_0xb4e7('0x1a')]||null:null,'limit':_0xad7516[_0xb4e7('0x17')]?_0xad7516[_0xb4e7('0x17')][_0xb4e7('0x1b')]||null:null,'include':_0xad7516[_0xb4e7('0x17')]?_0xad7516['options'][_0xb4e7('0x1c')]?_['map'](_0xad7516[_0xb4e7('0x17')][_0xb4e7('0x1c')],function(_0x30bf0e){return{'model':db[_0x30bf0e[_0xb4e7('0x1d')]],'as':_0x30bf0e['as'],'attributes':_0x30bf0e[_0xb4e7('0x1a')],'include':_0x30bf0e[_0xb4e7('0x1c')]?_[_0xb4e7('0x1e')](_0x30bf0e[_0xb4e7('0x1c')],function(_0x3002e7){return{'model':db[_0x3002e7['model']],'as':_0x3002e7['as'],'attributes':_0x3002e7[_0xb4e7('0x1a')],'include':_0x3002e7[_0xb4e7('0x1c')]?_[_0xb4e7('0x1e')](_0x3002e7[_0xb4e7('0x1c')],function(_0x55cb6f){return{'model':db[_0x55cb6f[_0xb4e7('0x1d')]],'as':_0x55cb6f['as'],'attributes':_0x55cb6f[_0xb4e7('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x21c231){logger['info']('GetZohoAccount',_0xad7516);logger['debug'](_0xb4e7('0x14'),_0xad7516,JSON[_0xb4e7('0x1f')](_0x21c231));_0x597f39(_0x21c231);})[_0xb4e7('0x13')](function(_0x3732ef){logger['error'](_0xb4e7('0x14'),_0x3732ef[_0xb4e7('0x11')],_0xad7516);_0x30f45e(_0x451572[_0xb4e7('0xe')](0x1f4,_0x3732ef[_0xb4e7('0x11')]));});});};exports[_0xb4e7('0x20')]=function(_0x235cdc){var _0x3a946c=this;return new Promise(function(_0x562d1f,_0xa8bea9){return db[_0xb4e7('0x15')][_0xb4e7('0x21')]({'raw':_0x235cdc[_0xb4e7('0x17')]?_0x235cdc[_0xb4e7('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x235cdc['options']?_0x235cdc[_0xb4e7('0x17')][_0xb4e7('0x19')]||null:null,'attributes':_0x235cdc['options']?_0x235cdc[_0xb4e7('0x17')][_0xb4e7('0x1a')]||null:null,'include':_0x235cdc['options']?_0x235cdc['options']['include']?_['map'](_0x235cdc[_0xb4e7('0x17')]['include'],function(_0x140788){return{'model':db[_0x140788[_0xb4e7('0x1d')]],'as':_0x140788['as'],'attributes':_0x140788[_0xb4e7('0x1a')],'include':_0x140788[_0xb4e7('0x1c')]?_[_0xb4e7('0x1e')](_0x140788[_0xb4e7('0x1c')],function(_0x52c854){return{'model':db[_0x52c854[_0xb4e7('0x1d')]],'as':_0x52c854['as'],'attributes':_0x52c854[_0xb4e7('0x1a')],'include':_0x52c854[_0xb4e7('0x1c')]?_['map'](_0x52c854['include'],function(_0x23605e){return{'model':db[_0x23605e[_0xb4e7('0x1d')]],'as':_0x23605e['as'],'attributes':_0x23605e['attributes']};}):[]};}):[]};}):[]:[]})[_0xb4e7('0xa')](function(_0x2e9d5){logger[_0xb4e7('0xb')](_0xb4e7('0x20'),_0x235cdc);logger[_0xb4e7('0xd')](_0xb4e7('0x20'),_0x235cdc,JSON[_0xb4e7('0x1f')](_0x2e9d5));_0x562d1f(_0x2e9d5);})[_0xb4e7('0x13')](function(_0x2684ec){logger[_0xb4e7('0xe')](_0xb4e7('0x20'),_0x2684ec[_0xb4e7('0x11')],_0x235cdc);_0xa8bea9(_0x3a946c[_0xb4e7('0xe')](0x1f4,_0x2684ec[_0xb4e7('0x11')]));});});};
\ No newline at end of file
+var _0x5ae9=['rpc','jayson/promise','client','http','request','then','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','error','ZohoAccount,\x20%s,\x20%s','message','result','catch','GetZohoAccount','ZohoAccount','options','where','attributes','limit','map','include','model','info','stringify','raw','ShowZohoAccount','lodash','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x593385,_0x5e1c24){var _0xcfa35c=function(_0x8fde1b){while(--_0x8fde1b){_0x593385['push'](_0x593385['shift']());}};_0xcfa35c(++_0x5e1c24);}(_0x5ae9,0x19b));var _0x95ae=function(_0x1fe140,_0x19263c){_0x1fe140=_0x1fe140-0x0;var _0x59877c=_0x5ae9[_0x1fe140];return _0x59877c;};'use strict';var _=require(_0x95ae('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x95ae('0x1'));var rs=require(_0x95ae('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x95ae('0x3'))['db'];var utils=require(_0x95ae('0x4'));var logger=require('../../config/logger')(_0x95ae('0x5'));var config=require('../../config/environment');var jayson=require(_0x95ae('0x6'));var client=jayson[_0x95ae('0x7')][_0x95ae('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xec2c41,_0x3c4cda,_0x4df142){return new BPromise(function(_0x588bab,_0x19ba28){return client[_0x95ae('0x9')](_0xec2c41,_0x4df142)[_0x95ae('0xa')](function(_0x25b2ec){logger['info']('ZohoAccount,\x20%s,\x20%s',_0x3c4cda,_0x95ae('0xb'));logger[_0x95ae('0xc')](_0x95ae('0xd'),_0x3c4cda,_0x95ae('0xb'),JSON['stringify'](_0x25b2ec));if(_0x25b2ec['error']){if(_0x25b2ec[_0x95ae('0xe')]['code']===0x1f4){logger[_0x95ae('0xe')](_0x95ae('0xf'),_0x3c4cda,_0x25b2ec['error'][_0x95ae('0x10')]);return _0x19ba28(_0x25b2ec[_0x95ae('0xe')][_0x95ae('0x10')]);}logger['error'](_0x95ae('0xf'),_0x3c4cda,_0x25b2ec[_0x95ae('0xe')][_0x95ae('0x10')]);return _0x588bab(_0x25b2ec['error'][_0x95ae('0x10')]);}else{logger['info'](_0x95ae('0xf'),_0x3c4cda,'request\x20sent');_0x588bab(_0x25b2ec[_0x95ae('0x11')][_0x95ae('0x10')]);}})[_0x95ae('0x12')](function(_0x11e960){logger[_0x95ae('0xe')](_0x95ae('0xf'),_0x3c4cda,_0x11e960);_0x19ba28(_0x11e960);});});}exports[_0x95ae('0x13')]=function(_0x24d5d2){var _0x3e1afc=this;return new Promise(function(_0x47ed05,_0x4ef50f){return db[_0x95ae('0x14')]['findAll']({'raw':_0x24d5d2[_0x95ae('0x15')]?_0x24d5d2[_0x95ae('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x24d5d2['options']?_0x24d5d2[_0x95ae('0x15')][_0x95ae('0x16')]||null:null,'attributes':_0x24d5d2[_0x95ae('0x15')]?_0x24d5d2[_0x95ae('0x15')][_0x95ae('0x17')]||null:null,'limit':_0x24d5d2['options']?_0x24d5d2[_0x95ae('0x15')][_0x95ae('0x18')]||null:null,'include':_0x24d5d2[_0x95ae('0x15')]?_0x24d5d2[_0x95ae('0x15')]['include']?_[_0x95ae('0x19')](_0x24d5d2['options'][_0x95ae('0x1a')],function(_0x59f88a){return{'model':db[_0x59f88a[_0x95ae('0x1b')]],'as':_0x59f88a['as'],'attributes':_0x59f88a[_0x95ae('0x17')],'include':_0x59f88a[_0x95ae('0x1a')]?_['map'](_0x59f88a[_0x95ae('0x1a')],function(_0x25d81c){return{'model':db[_0x25d81c[_0x95ae('0x1b')]],'as':_0x25d81c['as'],'attributes':_0x25d81c[_0x95ae('0x17')],'include':_0x25d81c[_0x95ae('0x1a')]?_['map'](_0x25d81c[_0x95ae('0x1a')],function(_0x4e2436){return{'model':db[_0x4e2436[_0x95ae('0x1b')]],'as':_0x4e2436['as'],'attributes':_0x4e2436[_0x95ae('0x17')]};}):[]};}):[]};}):[]:[]})[_0x95ae('0xa')](function(_0x51ba5d){logger[_0x95ae('0x1c')]('GetZohoAccount',_0x24d5d2);logger[_0x95ae('0xc')](_0x95ae('0x13'),_0x24d5d2,JSON[_0x95ae('0x1d')](_0x51ba5d));_0x47ed05(_0x51ba5d);})[_0x95ae('0x12')](function(_0x4fa625){logger[_0x95ae('0xe')](_0x95ae('0x13'),_0x4fa625[_0x95ae('0x10')],_0x24d5d2);_0x4ef50f(_0x3e1afc['error'](0x1f4,_0x4fa625[_0x95ae('0x10')]));});});};exports['ShowZohoAccount']=function(_0x4c44f4){var _0x4ab2db=this;return new Promise(function(_0x1820b4,_0x1e893e){return db[_0x95ae('0x14')]['find']({'raw':_0x4c44f4[_0x95ae('0x15')]?_0x4c44f4['options'][_0x95ae('0x1e')]===undefined?!![]:![]:!![],'where':_0x4c44f4[_0x95ae('0x15')]?_0x4c44f4['options'][_0x95ae('0x16')]||null:null,'attributes':_0x4c44f4['options']?_0x4c44f4[_0x95ae('0x15')][_0x95ae('0x17')]||null:null,'include':_0x4c44f4['options']?_0x4c44f4[_0x95ae('0x15')][_0x95ae('0x1a')]?_[_0x95ae('0x19')](_0x4c44f4[_0x95ae('0x15')][_0x95ae('0x1a')],function(_0xd0ce8){return{'model':db[_0xd0ce8[_0x95ae('0x1b')]],'as':_0xd0ce8['as'],'attributes':_0xd0ce8['attributes'],'include':_0xd0ce8['include']?_[_0x95ae('0x19')](_0xd0ce8[_0x95ae('0x1a')],function(_0x8ce95d){return{'model':db[_0x8ce95d[_0x95ae('0x1b')]],'as':_0x8ce95d['as'],'attributes':_0x8ce95d[_0x95ae('0x17')],'include':_0x8ce95d['include']?_[_0x95ae('0x19')](_0x8ce95d[_0x95ae('0x1a')],function(_0x5d58f3){return{'model':db[_0x5d58f3[_0x95ae('0x1b')]],'as':_0x5d58f3['as'],'attributes':_0x5d58f3[_0x95ae('0x17')]};}):[]};}):[]};}):[]:[]})[_0x95ae('0xa')](function(_0x4ebdbb){logger[_0x95ae('0x1c')](_0x95ae('0x1f'),_0x4c44f4);logger[_0x95ae('0xc')](_0x95ae('0x1f'),_0x4c44f4,JSON['stringify'](_0x4ebdbb));_0x1820b4(_0x4ebdbb);})[_0x95ae('0x12')](function(_0x50783e){logger[_0x95ae('0xe')](_0x95ae('0x1f'),_0x50783e[_0x95ae('0x10')],_0x4c44f4);_0x1e893e(_0x4ab2db[_0x95ae('0xe')](0x1f4,_0x50783e[_0x95ae('0x10')]));});});};
\ No newline at end of file