Built motion from commit 52c8a02d.|2.6.29
[motion2.git] / server / api / intZohoAccount / intZohoAccount.rpc.js
index a990683..f4b0302 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd386=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','catch','GetZohoAccount','ZohoAccount','findAll','options','raw','where','limit','include','attributes','map','model','ShowZohoAccount','find','then','lodash','util','moment','randomstring'];(function(_0x51d71a,_0x596fda){var _0xff01f1=function(_0x30480f){while(--_0x30480f){_0x51d71a['push'](_0x51d71a['shift']());}};_0xff01f1(++_0x596fda);}(_0xd386,0x10c));var _0x6d38=function(_0x3813ad,_0x2eff01){_0x3813ad=_0x3813ad-0x0;var _0x16ed55=_0xd386[_0x3813ad];return _0x16ed55;};'use strict';var _=require(_0x6d38('0x0'));var util=require(_0x6d38('0x1'));var moment=require(_0x6d38('0x2'));var BPromise=require('bluebird');var rs=require(_0x6d38('0x3'));var fs=require('fs');var Redis=require(_0x6d38('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6d38('0x5'));var logger=require(_0x6d38('0x6'))(_0x6d38('0x7'));var config=require(_0x6d38('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x6d38('0x9')][_0x6d38('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1b2038,_0x83823e,_0x2b742c){return new BPromise(function(_0x44ef4e,_0x49d71a){return client[_0x6d38('0xb')](_0x1b2038,_0x2b742c)['then'](function(_0x274898){logger['info'](_0x6d38('0xc'),_0x83823e,_0x6d38('0xd'));logger[_0x6d38('0xe')]('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x83823e,_0x6d38('0xd'),JSON[_0x6d38('0xf')](_0x274898));if(_0x274898[_0x6d38('0x10')]){if(_0x274898['error']['code']===0x1f4){logger['error'](_0x6d38('0xc'),_0x83823e,_0x274898[_0x6d38('0x10')][_0x6d38('0x11')]);return _0x49d71a(_0x274898[_0x6d38('0x10')][_0x6d38('0x11')]);}logger['error'](_0x6d38('0xc'),_0x83823e,_0x274898[_0x6d38('0x10')][_0x6d38('0x11')]);return _0x44ef4e(_0x274898[_0x6d38('0x10')][_0x6d38('0x11')]);}else{logger[_0x6d38('0x12')](_0x6d38('0xc'),_0x83823e,'request\x20sent');_0x44ef4e(_0x274898['result']['message']);}})[_0x6d38('0x13')](function(_0x46e7d7){logger[_0x6d38('0x10')](_0x6d38('0xc'),_0x83823e,_0x46e7d7);_0x49d71a(_0x46e7d7);});});}exports[_0x6d38('0x14')]=function(_0x11298c){var _0x5dcd45=this;return new Promise(function(_0x278829,_0xffcf23){return db[_0x6d38('0x15')][_0x6d38('0x16')]({'raw':_0x11298c[_0x6d38('0x17')]?_0x11298c[_0x6d38('0x17')][_0x6d38('0x18')]===undefined?!![]:![]:!![],'where':_0x11298c[_0x6d38('0x17')]?_0x11298c['options'][_0x6d38('0x19')]||null:null,'attributes':_0x11298c[_0x6d38('0x17')]?_0x11298c['options']['attributes']||null:null,'limit':_0x11298c[_0x6d38('0x17')]?_0x11298c[_0x6d38('0x17')][_0x6d38('0x1a')]||null:null,'include':_0x11298c[_0x6d38('0x17')]?_0x11298c['options'][_0x6d38('0x1b')]?_['map'](_0x11298c[_0x6d38('0x17')]['include'],function(_0x473895){return{'model':db[_0x473895['model']],'as':_0x473895['as'],'attributes':_0x473895[_0x6d38('0x1c')],'include':_0x473895[_0x6d38('0x1b')]?_[_0x6d38('0x1d')](_0x473895[_0x6d38('0x1b')],function(_0x3c777a){return{'model':db[_0x3c777a['model']],'as':_0x3c777a['as'],'attributes':_0x3c777a['attributes'],'include':_0x3c777a[_0x6d38('0x1b')]?_[_0x6d38('0x1d')](_0x3c777a['include'],function(_0x4f2769){return{'model':db[_0x4f2769[_0x6d38('0x1e')]],'as':_0x4f2769['as'],'attributes':_0x4f2769['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3a41f8){logger[_0x6d38('0x12')](_0x6d38('0x14'),_0x11298c);logger[_0x6d38('0xe')](_0x6d38('0x14'),_0x11298c,JSON[_0x6d38('0xf')](_0x3a41f8));_0x278829(_0x3a41f8);})['catch'](function(_0x3e62cf){logger['error'](_0x6d38('0x14'),_0x3e62cf['message'],_0x11298c);_0xffcf23(_0x5dcd45[_0x6d38('0x10')](0x1f4,_0x3e62cf['message']));});});};exports[_0x6d38('0x1f')]=function(_0x471f08){var _0x503658=this;return new Promise(function(_0x4863b1,_0x1824f4){return db[_0x6d38('0x15')][_0x6d38('0x20')]({'raw':_0x471f08[_0x6d38('0x17')]?_0x471f08[_0x6d38('0x17')][_0x6d38('0x18')]===undefined?!![]:![]:!![],'where':_0x471f08['options']?_0x471f08['options'][_0x6d38('0x19')]||null:null,'attributes':_0x471f08['options']?_0x471f08[_0x6d38('0x17')]['attributes']||null:null,'include':_0x471f08[_0x6d38('0x17')]?_0x471f08[_0x6d38('0x17')][_0x6d38('0x1b')]?_['map'](_0x471f08[_0x6d38('0x17')][_0x6d38('0x1b')],function(_0xfc85c3){return{'model':db[_0xfc85c3[_0x6d38('0x1e')]],'as':_0xfc85c3['as'],'attributes':_0xfc85c3[_0x6d38('0x1c')],'include':_0xfc85c3[_0x6d38('0x1b')]?_[_0x6d38('0x1d')](_0xfc85c3[_0x6d38('0x1b')],function(_0x197b3f){return{'model':db[_0x197b3f['model']],'as':_0x197b3f['as'],'attributes':_0x197b3f[_0x6d38('0x1c')],'include':_0x197b3f[_0x6d38('0x1b')]?_[_0x6d38('0x1d')](_0x197b3f['include'],function(_0x4f5350){return{'model':db[_0x4f5350[_0x6d38('0x1e')]],'as':_0x4f5350['as'],'attributes':_0x4f5350['attributes']};}):[]};}):[]};}):[]:[]})[_0x6d38('0x21')](function(_0x41cb07){logger[_0x6d38('0x12')](_0x6d38('0x1f'),_0x471f08);logger['debug'](_0x6d38('0x1f'),_0x471f08,JSON['stringify'](_0x41cb07));_0x4863b1(_0x41cb07);})['catch'](function(_0x3fefe3){logger[_0x6d38('0x10')]('ShowZohoAccount',_0x3fefe3['message'],_0x471f08);_0x1824f4(_0x503658[_0x6d38('0x10')](0x1f4,_0x3fefe3[_0x6d38('0x11')]));});});};
\ No newline at end of file
+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