Built motion from commit 092f8824.|2.5.49
[motion2.git] / server / api / intZohoAccount / intZohoAccount.rpc.js
index 8fef505..341bf54 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcd47=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','ZohoAccount,\x20%s,\x20%s','message','info','result','catch','GetZohoAccount','ZohoAccount','findAll','raw','options','where','limit','include','map','model','attributes','then','ShowZohoAccount','lodash','moment'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0xcd47,0x1c5));var _0x7cd4=function(_0x29d4ed,_0x264f8e){_0x29d4ed=_0x29d4ed-0x0;var _0x21a4a6=_0xcd47[_0x29d4ed];return _0x21a4a6;};'use strict';var _=require(_0x7cd4('0x0'));var util=require('util');var moment=require(_0x7cd4('0x1'));var BPromise=require(_0x7cd4('0x2'));var rs=require(_0x7cd4('0x3'));var fs=require('fs');var Redis=require(_0x7cd4('0x4'));var db=require(_0x7cd4('0x5'))['db'];var utils=require(_0x7cd4('0x6'));var logger=require(_0x7cd4('0x7'))(_0x7cd4('0x8'));var config=require(_0x7cd4('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x7cd4('0xa')][_0x7cd4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x19d371,_0x4c9fcf,_0x176e15){return new BPromise(function(_0x195667,_0x3cc9a5){return client['request'](_0x19d371,_0x176e15)['then'](function(_0x351c92){logger['info']('ZohoAccount,\x20%s,\x20%s',_0x4c9fcf,_0x7cd4('0xc'));logger[_0x7cd4('0xd')](_0x7cd4('0xe'),_0x4c9fcf,_0x7cd4('0xc'),JSON[_0x7cd4('0xf')](_0x351c92));if(_0x351c92[_0x7cd4('0x10')]){if(_0x351c92[_0x7cd4('0x10')]['code']===0x1f4){logger[_0x7cd4('0x10')](_0x7cd4('0x11'),_0x4c9fcf,_0x351c92[_0x7cd4('0x10')][_0x7cd4('0x12')]);return _0x3cc9a5(_0x351c92[_0x7cd4('0x10')][_0x7cd4('0x12')]);}logger[_0x7cd4('0x10')](_0x7cd4('0x11'),_0x4c9fcf,_0x351c92[_0x7cd4('0x10')][_0x7cd4('0x12')]);return _0x195667(_0x351c92[_0x7cd4('0x10')][_0x7cd4('0x12')]);}else{logger[_0x7cd4('0x13')](_0x7cd4('0x11'),_0x4c9fcf,_0x7cd4('0xc'));_0x195667(_0x351c92[_0x7cd4('0x14')][_0x7cd4('0x12')]);}})[_0x7cd4('0x15')](function(_0x129a85){logger[_0x7cd4('0x10')](_0x7cd4('0x11'),_0x4c9fcf,_0x129a85);_0x3cc9a5(_0x129a85);});});}exports[_0x7cd4('0x16')]=function(_0x2774d5){var _0x255ec6=this;return new Promise(function(_0xa3898e,_0x1586ca){return db[_0x7cd4('0x17')][_0x7cd4('0x18')]({'raw':_0x2774d5['options']?_0x2774d5['options'][_0x7cd4('0x19')]===undefined?!![]:![]:!![],'where':_0x2774d5[_0x7cd4('0x1a')]?_0x2774d5[_0x7cd4('0x1a')][_0x7cd4('0x1b')]||null:null,'attributes':_0x2774d5[_0x7cd4('0x1a')]?_0x2774d5['options']['attributes']||null:null,'limit':_0x2774d5[_0x7cd4('0x1a')]?_0x2774d5['options'][_0x7cd4('0x1c')]||null:null,'include':_0x2774d5[_0x7cd4('0x1a')]?_0x2774d5[_0x7cd4('0x1a')][_0x7cd4('0x1d')]?_[_0x7cd4('0x1e')](_0x2774d5[_0x7cd4('0x1a')]['include'],function(_0x2f517a){return{'model':db[_0x2f517a[_0x7cd4('0x1f')]],'as':_0x2f517a['as'],'attributes':_0x2f517a[_0x7cd4('0x20')],'include':_0x2f517a[_0x7cd4('0x1d')]?_[_0x7cd4('0x1e')](_0x2f517a[_0x7cd4('0x1d')],function(_0x42bb10){return{'model':db[_0x42bb10[_0x7cd4('0x1f')]],'as':_0x42bb10['as'],'attributes':_0x42bb10[_0x7cd4('0x20')],'include':_0x42bb10['include']?_[_0x7cd4('0x1e')](_0x42bb10[_0x7cd4('0x1d')],function(_0x300a47){return{'model':db[_0x300a47[_0x7cd4('0x1f')]],'as':_0x300a47['as'],'attributes':_0x300a47[_0x7cd4('0x20')]};}):[]};}):[]};}):[]:[]})[_0x7cd4('0x21')](function(_0x5e34b0){logger[_0x7cd4('0x13')](_0x7cd4('0x16'),_0x2774d5);logger[_0x7cd4('0xd')](_0x7cd4('0x16'),_0x2774d5,JSON['stringify'](_0x5e34b0));_0xa3898e(_0x5e34b0);})[_0x7cd4('0x15')](function(_0x5ba030){logger[_0x7cd4('0x10')](_0x7cd4('0x16'),_0x5ba030['message'],_0x2774d5);_0x1586ca(_0x255ec6[_0x7cd4('0x10')](0x1f4,_0x5ba030[_0x7cd4('0x12')]));});});};exports[_0x7cd4('0x22')]=function(_0x501f2a){var _0x480400=this;return new Promise(function(_0x51424a,_0x437e4f){return db[_0x7cd4('0x17')]['find']({'raw':_0x501f2a['options']?_0x501f2a[_0x7cd4('0x1a')][_0x7cd4('0x19')]===undefined?!![]:![]:!![],'where':_0x501f2a[_0x7cd4('0x1a')]?_0x501f2a['options'][_0x7cd4('0x1b')]||null:null,'attributes':_0x501f2a['options']?_0x501f2a[_0x7cd4('0x1a')][_0x7cd4('0x20')]||null:null,'include':_0x501f2a[_0x7cd4('0x1a')]?_0x501f2a[_0x7cd4('0x1a')]['include']?_[_0x7cd4('0x1e')](_0x501f2a[_0x7cd4('0x1a')][_0x7cd4('0x1d')],function(_0x24f6ad){return{'model':db[_0x24f6ad['model']],'as':_0x24f6ad['as'],'attributes':_0x24f6ad[_0x7cd4('0x20')],'include':_0x24f6ad[_0x7cd4('0x1d')]?_[_0x7cd4('0x1e')](_0x24f6ad['include'],function(_0x1b6da4){return{'model':db[_0x1b6da4[_0x7cd4('0x1f')]],'as':_0x1b6da4['as'],'attributes':_0x1b6da4[_0x7cd4('0x20')],'include':_0x1b6da4[_0x7cd4('0x1d')]?_[_0x7cd4('0x1e')](_0x1b6da4[_0x7cd4('0x1d')],function(_0x1a04b1){return{'model':db[_0x1a04b1[_0x7cd4('0x1f')]],'as':_0x1a04b1['as'],'attributes':_0x1a04b1[_0x7cd4('0x20')]};}):[]};}):[]};}):[]:[]})[_0x7cd4('0x21')](function(_0x18b987){logger['info'](_0x7cd4('0x22'),_0x501f2a);logger[_0x7cd4('0xd')](_0x7cd4('0x22'),_0x501f2a,JSON[_0x7cd4('0xf')](_0x18b987));_0x51424a(_0x18b987);})[_0x7cd4('0x15')](function(_0x349fcb){logger['error'](_0x7cd4('0x22'),_0x349fcb[_0x7cd4('0x12')],_0x501f2a);_0x437e4f(_0x480400[_0x7cd4('0x10')](0x1f4,_0x349fcb[_0x7cd4('0x12')]));});});};
\ No newline at end of file
+var _0x160c=['ShowZohoAccount','util','moment','bluebird','../../config/utils','rpc','../../config/environment','jayson/promise','http','then','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetZohoAccount','ZohoAccount','findAll','options','raw','where','attributes','limit','include','map','model','info'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0x160c,0x181));var _0xc160=function(_0x4194c4,_0x12efd9){_0x4194c4=_0x4194c4-0x0;var _0x4011ed=_0x160c[_0x4194c4];return _0x4011ed;};'use strict';var _=require('lodash');var util=require(_0xc160('0x0'));var moment=require(_0xc160('0x1'));var BPromise=require(_0xc160('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xc160('0x3'));var logger=require('../../config/logger')(_0xc160('0x4'));var config=require(_0xc160('0x5'));var jayson=require(_0xc160('0x6'));var client=jayson['client'][_0xc160('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5dfb45,_0x26e1f4,_0x549651){return new BPromise(function(_0x359ac9,_0x30c90e){return client['request'](_0x5dfb45,_0x549651)[_0xc160('0x8')](function(_0x208643){logger['info'](_0xc160('0x9'),_0x26e1f4,_0xc160('0xa'));logger[_0xc160('0xb')](_0xc160('0xc'),_0x26e1f4,_0xc160('0xa'),JSON[_0xc160('0xd')](_0x208643));if(_0x208643[_0xc160('0xe')]){if(_0x208643[_0xc160('0xe')][_0xc160('0xf')]===0x1f4){logger['error'](_0xc160('0x9'),_0x26e1f4,_0x208643[_0xc160('0xe')]['message']);return _0x30c90e(_0x208643[_0xc160('0xe')][_0xc160('0x10')]);}logger[_0xc160('0xe')]('ZohoAccount,\x20%s,\x20%s',_0x26e1f4,_0x208643[_0xc160('0xe')]['message']);return _0x359ac9(_0x208643[_0xc160('0xe')][_0xc160('0x10')]);}else{logger['info'](_0xc160('0x9'),_0x26e1f4,'request\x20sent');_0x359ac9(_0x208643[_0xc160('0x11')][_0xc160('0x10')]);}})[_0xc160('0x12')](function(_0x5bb074){logger['error'](_0xc160('0x9'),_0x26e1f4,_0x5bb074);_0x30c90e(_0x5bb074);});});}exports[_0xc160('0x13')]=function(_0x6120d5){var _0x54e6e0=this;return new Promise(function(_0x3b7b55,_0x36011c){return db[_0xc160('0x14')][_0xc160('0x15')]({'raw':_0x6120d5['options']?_0x6120d5[_0xc160('0x16')][_0xc160('0x17')]===undefined?!![]:![]:!![],'where':_0x6120d5['options']?_0x6120d5[_0xc160('0x16')][_0xc160('0x18')]||null:null,'attributes':_0x6120d5[_0xc160('0x16')]?_0x6120d5[_0xc160('0x16')][_0xc160('0x19')]||null:null,'limit':_0x6120d5['options']?_0x6120d5[_0xc160('0x16')][_0xc160('0x1a')]||null:null,'include':_0x6120d5[_0xc160('0x16')]?_0x6120d5[_0xc160('0x16')][_0xc160('0x1b')]?_[_0xc160('0x1c')](_0x6120d5[_0xc160('0x16')][_0xc160('0x1b')],function(_0x417ac1){return{'model':db[_0x417ac1[_0xc160('0x1d')]],'as':_0x417ac1['as'],'attributes':_0x417ac1['attributes'],'include':_0x417ac1['include']?_[_0xc160('0x1c')](_0x417ac1['include'],function(_0x7d235e){return{'model':db[_0x7d235e[_0xc160('0x1d')]],'as':_0x7d235e['as'],'attributes':_0x7d235e[_0xc160('0x19')],'include':_0x7d235e['include']?_[_0xc160('0x1c')](_0x7d235e[_0xc160('0x1b')],function(_0x2542f1){return{'model':db[_0x2542f1[_0xc160('0x1d')]],'as':_0x2542f1['as'],'attributes':_0x2542f1[_0xc160('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xba4803){logger[_0xc160('0x1e')](_0xc160('0x13'),_0x6120d5);logger[_0xc160('0xb')](_0xc160('0x13'),_0x6120d5,JSON[_0xc160('0xd')](_0xba4803));_0x3b7b55(_0xba4803);})[_0xc160('0x12')](function(_0x56a004){logger[_0xc160('0xe')](_0xc160('0x13'),_0x56a004[_0xc160('0x10')],_0x6120d5);_0x36011c(_0x54e6e0['error'](0x1f4,_0x56a004['message']));});});};exports[_0xc160('0x1f')]=function(_0x5b0a81){var _0x233cb2=this;return new Promise(function(_0x2ba357,_0x2ba69){return db['ZohoAccount']['find']({'raw':_0x5b0a81['options']?_0x5b0a81['options'][_0xc160('0x17')]===undefined?!![]:![]:!![],'where':_0x5b0a81[_0xc160('0x16')]?_0x5b0a81[_0xc160('0x16')]['where']||null:null,'attributes':_0x5b0a81[_0xc160('0x16')]?_0x5b0a81['options']['attributes']||null:null,'include':_0x5b0a81[_0xc160('0x16')]?_0x5b0a81[_0xc160('0x16')]['include']?_[_0xc160('0x1c')](_0x5b0a81[_0xc160('0x16')][_0xc160('0x1b')],function(_0x16e8e3){return{'model':db[_0x16e8e3[_0xc160('0x1d')]],'as':_0x16e8e3['as'],'attributes':_0x16e8e3[_0xc160('0x19')],'include':_0x16e8e3[_0xc160('0x1b')]?_['map'](_0x16e8e3['include'],function(_0x15cde0){return{'model':db[_0x15cde0['model']],'as':_0x15cde0['as'],'attributes':_0x15cde0[_0xc160('0x19')],'include':_0x15cde0[_0xc160('0x1b')]?_[_0xc160('0x1c')](_0x15cde0[_0xc160('0x1b')],function(_0x631967){return{'model':db[_0x631967['model']],'as':_0x631967['as'],'attributes':_0x631967['attributes']};}):[]};}):[]};}):[]:[]})[_0xc160('0x8')](function(_0x22a295){logger[_0xc160('0x1e')](_0xc160('0x1f'),_0x5b0a81);logger['debug']('ShowZohoAccount',_0x5b0a81,JSON['stringify'](_0x22a295));_0x2ba357(_0x22a295);})[_0xc160('0x12')](function(_0x2e1ca3){logger[_0xc160('0xe')](_0xc160('0x1f'),_0x2e1ca3['message'],_0x5b0a81);_0x2ba69(_0x233cb2[_0xc160('0xe')](0x1f4,_0x2e1ca3[_0xc160('0x10')]));});});};
\ No newline at end of file