Built motion from commit fade34fd.|2.5.41
[motion2.git] / server / api / intZohoAccount / intZohoAccount.rpc.js
index 2592636..fb7e3c1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdeb3=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','GetZohoAccount','ZohoAccount','options','where','limit','include','map','model','attributes','debug','catch','ShowZohoAccount','raw','util','moment','bluebird'];(function(_0x1d85b2,_0x4803c5){var _0x465d32=function(_0x18d6ab){while(--_0x18d6ab){_0x1d85b2['push'](_0x1d85b2['shift']());}};_0x465d32(++_0x4803c5);}(_0xdeb3,0xb7));var _0x3deb=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xdeb3[_0x167cc1];return _0x10bc4b;};'use strict';var _=require('lodash');var util=require(_0x3deb('0x0'));var moment=require(_0x3deb('0x1'));var BPromise=require(_0x3deb('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3deb('0x3'))['db'];var utils=require(_0x3deb('0x4'));var logger=require(_0x3deb('0x5'))(_0x3deb('0x6'));var config=require(_0x3deb('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x3deb('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x469e98,_0x5455e4,_0x37db86){return new BPromise(function(_0x1bf486,_0x3e983a){return client[_0x3deb('0x9')](_0x469e98,_0x37db86)[_0x3deb('0xa')](function(_0x1a4974){logger[_0x3deb('0xb')](_0x3deb('0xc'),_0x5455e4,_0x3deb('0xd'));logger['debug']('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x5455e4,_0x3deb('0xd'),JSON[_0x3deb('0xe')](_0x1a4974));if(_0x1a4974[_0x3deb('0xf')]){if(_0x1a4974['error'][_0x3deb('0x10')]===0x1f4){logger[_0x3deb('0xf')](_0x3deb('0xc'),_0x5455e4,_0x1a4974[_0x3deb('0xf')]['message']);return _0x3e983a(_0x1a4974['error']['message']);}logger[_0x3deb('0xf')](_0x3deb('0xc'),_0x5455e4,_0x1a4974[_0x3deb('0xf')]['message']);return _0x1bf486(_0x1a4974[_0x3deb('0xf')][_0x3deb('0x11')]);}else{logger['info'](_0x3deb('0xc'),_0x5455e4,_0x3deb('0xd'));_0x1bf486(_0x1a4974['result'][_0x3deb('0x11')]);}})['catch'](function(_0x465f33){logger['error']('ZohoAccount,\x20%s,\x20%s',_0x5455e4,_0x465f33);_0x3e983a(_0x465f33);});});}exports[_0x3deb('0x12')]=function(_0x23c4b9){var _0xd036ad=this;return new Promise(function(_0x9ba4f,_0x8b65f){return db[_0x3deb('0x13')]['findAll']({'raw':_0x23c4b9[_0x3deb('0x14')]?_0x23c4b9[_0x3deb('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x23c4b9[_0x3deb('0x14')]?_0x23c4b9[_0x3deb('0x14')][_0x3deb('0x15')]||null:null,'attributes':_0x23c4b9[_0x3deb('0x14')]?_0x23c4b9[_0x3deb('0x14')]['attributes']||null:null,'limit':_0x23c4b9[_0x3deb('0x14')]?_0x23c4b9[_0x3deb('0x14')][_0x3deb('0x16')]||null:null,'include':_0x23c4b9[_0x3deb('0x14')]?_0x23c4b9[_0x3deb('0x14')][_0x3deb('0x17')]?_[_0x3deb('0x18')](_0x23c4b9[_0x3deb('0x14')][_0x3deb('0x17')],function(_0x487283){return{'model':db[_0x487283[_0x3deb('0x19')]],'as':_0x487283['as'],'attributes':_0x487283['attributes'],'include':_0x487283[_0x3deb('0x17')]?_[_0x3deb('0x18')](_0x487283[_0x3deb('0x17')],function(_0x392fec){return{'model':db[_0x392fec[_0x3deb('0x19')]],'as':_0x392fec['as'],'attributes':_0x392fec[_0x3deb('0x1a')],'include':_0x392fec[_0x3deb('0x17')]?_[_0x3deb('0x18')](_0x392fec[_0x3deb('0x17')],function(_0x2789cd){return{'model':db[_0x2789cd[_0x3deb('0x19')]],'as':_0x2789cd['as'],'attributes':_0x2789cd[_0x3deb('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x3deb('0xa')](function(_0x1ffbd3){logger[_0x3deb('0xb')](_0x3deb('0x12'),_0x23c4b9);logger[_0x3deb('0x1b')](_0x3deb('0x12'),_0x23c4b9,JSON[_0x3deb('0xe')](_0x1ffbd3));_0x9ba4f(_0x1ffbd3);})[_0x3deb('0x1c')](function(_0x4c72c7){logger[_0x3deb('0xf')](_0x3deb('0x12'),_0x4c72c7['message'],_0x23c4b9);_0x8b65f(_0xd036ad[_0x3deb('0xf')](0x1f4,_0x4c72c7['message']));});});};exports[_0x3deb('0x1d')]=function(_0x346abf){var _0x13b79f=this;return new Promise(function(_0x48e3aa,_0x1a017e){return db[_0x3deb('0x13')]['find']({'raw':_0x346abf[_0x3deb('0x14')]?_0x346abf[_0x3deb('0x14')][_0x3deb('0x1e')]===undefined?!![]:![]:!![],'where':_0x346abf[_0x3deb('0x14')]?_0x346abf[_0x3deb('0x14')][_0x3deb('0x15')]||null:null,'attributes':_0x346abf[_0x3deb('0x14')]?_0x346abf[_0x3deb('0x14')]['attributes']||null:null,'include':_0x346abf[_0x3deb('0x14')]?_0x346abf[_0x3deb('0x14')][_0x3deb('0x17')]?_[_0x3deb('0x18')](_0x346abf[_0x3deb('0x14')][_0x3deb('0x17')],function(_0x2cae74){return{'model':db[_0x2cae74[_0x3deb('0x19')]],'as':_0x2cae74['as'],'attributes':_0x2cae74[_0x3deb('0x1a')],'include':_0x2cae74[_0x3deb('0x17')]?_[_0x3deb('0x18')](_0x2cae74[_0x3deb('0x17')],function(_0x1da3a0){return{'model':db[_0x1da3a0[_0x3deb('0x19')]],'as':_0x1da3a0['as'],'attributes':_0x1da3a0[_0x3deb('0x1a')],'include':_0x1da3a0[_0x3deb('0x17')]?_[_0x3deb('0x18')](_0x1da3a0[_0x3deb('0x17')],function(_0x16a6ff){return{'model':db[_0x16a6ff['model']],'as':_0x16a6ff['as'],'attributes':_0x16a6ff[_0x3deb('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x3deb('0xa')](function(_0x390610){logger[_0x3deb('0xb')]('ShowZohoAccount',_0x346abf);logger[_0x3deb('0x1b')](_0x3deb('0x1d'),_0x346abf,JSON[_0x3deb('0xe')](_0x390610));_0x48e3aa(_0x390610);})[_0x3deb('0x1c')](function(_0x27c214){logger['error']('ShowZohoAccount',_0x27c214[_0x3deb('0x11')],_0x346abf);_0x1a017e(_0x13b79f[_0x3deb('0xf')](0x1f4,_0x27c214[_0x3deb('0x11')]));});});};
\ No newline at end of file
+var _0x1c9a=['limit','include','map','attributes','model','ShowZohoAccount','find','where','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','ZohoAccount,\x20%s,\x20%s','message','result','catch','GetZohoAccount','ZohoAccount','findAll','options','raw'];(function(_0x3dae6c,_0x4c8a6f){var _0x4b8004=function(_0x4ffb5d){while(--_0x4ffb5d){_0x3dae6c['push'](_0x3dae6c['shift']());}};_0x4b8004(++_0x4c8a6f);}(_0x1c9a,0x98));var _0xa1c9=function(_0xa97b50,_0x478681){_0xa97b50=_0xa97b50-0x0;var _0x2c5075=_0x1c9a[_0xa97b50];return _0x2c5075;};'use strict';var _=require(_0xa1c9('0x0'));var util=require('util');var moment=require(_0xa1c9('0x1'));var BPromise=require('bluebird');var rs=require(_0xa1c9('0x2'));var fs=require('fs');var Redis=require(_0xa1c9('0x3'));var db=require(_0xa1c9('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa1c9('0x5'))(_0xa1c9('0x6'));var config=require(_0xa1c9('0x7'));var jayson=require(_0xa1c9('0x8'));var client=jayson['client'][_0xa1c9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5448f2,_0x222624,_0x463c9c){return new BPromise(function(_0x3f07c2,_0x5059df){return client[_0xa1c9('0xa')](_0x5448f2,_0x463c9c)[_0xa1c9('0xb')](function(_0x24136d){logger[_0xa1c9('0xc')]('ZohoAccount,\x20%s,\x20%s',_0x222624,_0xa1c9('0xd'));logger[_0xa1c9('0xe')](_0xa1c9('0xf'),_0x222624,_0xa1c9('0xd'),JSON[_0xa1c9('0x10')](_0x24136d));if(_0x24136d[_0xa1c9('0x11')]){if(_0x24136d[_0xa1c9('0x11')][_0xa1c9('0x12')]===0x1f4){logger[_0xa1c9('0x11')](_0xa1c9('0x13'),_0x222624,_0x24136d['error'][_0xa1c9('0x14')]);return _0x5059df(_0x24136d[_0xa1c9('0x11')][_0xa1c9('0x14')]);}logger[_0xa1c9('0x11')](_0xa1c9('0x13'),_0x222624,_0x24136d['error'][_0xa1c9('0x14')]);return _0x3f07c2(_0x24136d[_0xa1c9('0x11')][_0xa1c9('0x14')]);}else{logger[_0xa1c9('0xc')](_0xa1c9('0x13'),_0x222624,_0xa1c9('0xd'));_0x3f07c2(_0x24136d[_0xa1c9('0x15')][_0xa1c9('0x14')]);}})[_0xa1c9('0x16')](function(_0x373f5d){logger['error'](_0xa1c9('0x13'),_0x222624,_0x373f5d);_0x5059df(_0x373f5d);});});}exports[_0xa1c9('0x17')]=function(_0x224ae4){var _0x50db9b=this;return new Promise(function(_0x2fb81e,_0x5ab911){return db[_0xa1c9('0x18')][_0xa1c9('0x19')]({'raw':_0x224ae4[_0xa1c9('0x1a')]?_0x224ae4['options'][_0xa1c9('0x1b')]===undefined?!![]:![]:!![],'where':_0x224ae4[_0xa1c9('0x1a')]?_0x224ae4[_0xa1c9('0x1a')]['where']||null:null,'attributes':_0x224ae4[_0xa1c9('0x1a')]?_0x224ae4[_0xa1c9('0x1a')]['attributes']||null:null,'limit':_0x224ae4[_0xa1c9('0x1a')]?_0x224ae4[_0xa1c9('0x1a')][_0xa1c9('0x1c')]||null:null,'include':_0x224ae4['options']?_0x224ae4[_0xa1c9('0x1a')][_0xa1c9('0x1d')]?_[_0xa1c9('0x1e')](_0x224ae4[_0xa1c9('0x1a')][_0xa1c9('0x1d')],function(_0x4a0a0c){return{'model':db[_0x4a0a0c['model']],'as':_0x4a0a0c['as'],'attributes':_0x4a0a0c[_0xa1c9('0x1f')],'include':_0x4a0a0c['include']?_[_0xa1c9('0x1e')](_0x4a0a0c[_0xa1c9('0x1d')],function(_0x1c6f37){return{'model':db[_0x1c6f37[_0xa1c9('0x20')]],'as':_0x1c6f37['as'],'attributes':_0x1c6f37[_0xa1c9('0x1f')],'include':_0x1c6f37['include']?_[_0xa1c9('0x1e')](_0x1c6f37[_0xa1c9('0x1d')],function(_0x20cbe1){return{'model':db[_0x20cbe1['model']],'as':_0x20cbe1['as'],'attributes':_0x20cbe1[_0xa1c9('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xa1c9('0xb')](function(_0x1ca443){logger['info'](_0xa1c9('0x17'),_0x224ae4);logger[_0xa1c9('0xe')]('GetZohoAccount',_0x224ae4,JSON[_0xa1c9('0x10')](_0x1ca443));_0x2fb81e(_0x1ca443);})['catch'](function(_0xdf6d0c){logger[_0xa1c9('0x11')](_0xa1c9('0x17'),_0xdf6d0c[_0xa1c9('0x14')],_0x224ae4);_0x5ab911(_0x50db9b[_0xa1c9('0x11')](0x1f4,_0xdf6d0c[_0xa1c9('0x14')]));});});};exports[_0xa1c9('0x21')]=function(_0x58b900){var _0x5648b8=this;return new Promise(function(_0x4d23cd,_0x1c7038){return db[_0xa1c9('0x18')][_0xa1c9('0x22')]({'raw':_0x58b900[_0xa1c9('0x1a')]?_0x58b900[_0xa1c9('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x58b900['options']?_0x58b900['options'][_0xa1c9('0x23')]||null:null,'attributes':_0x58b900[_0xa1c9('0x1a')]?_0x58b900[_0xa1c9('0x1a')][_0xa1c9('0x1f')]||null:null,'include':_0x58b900[_0xa1c9('0x1a')]?_0x58b900[_0xa1c9('0x1a')][_0xa1c9('0x1d')]?_['map'](_0x58b900[_0xa1c9('0x1a')]['include'],function(_0x1b8707){return{'model':db[_0x1b8707['model']],'as':_0x1b8707['as'],'attributes':_0x1b8707[_0xa1c9('0x1f')],'include':_0x1b8707[_0xa1c9('0x1d')]?_[_0xa1c9('0x1e')](_0x1b8707['include'],function(_0x39818f){return{'model':db[_0x39818f[_0xa1c9('0x20')]],'as':_0x39818f['as'],'attributes':_0x39818f[_0xa1c9('0x1f')],'include':_0x39818f[_0xa1c9('0x1d')]?_['map'](_0x39818f['include'],function(_0x1f1612){return{'model':db[_0x1f1612[_0xa1c9('0x20')]],'as':_0x1f1612['as'],'attributes':_0x1f1612[_0xa1c9('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xa1c9('0xb')](function(_0x1c0cce){logger[_0xa1c9('0xc')](_0xa1c9('0x21'),_0x58b900);logger[_0xa1c9('0xe')](_0xa1c9('0x21'),_0x58b900,JSON[_0xa1c9('0x10')](_0x1c0cce));_0x4d23cd(_0x1c0cce);})['catch'](function(_0x3e6ec0){logger[_0xa1c9('0x11')](_0xa1c9('0x21'),_0x3e6ec0[_0xa1c9('0x14')],_0x58b900);_0x1c7038(_0x5648b8[_0xa1c9('0x11')](0x1f4,_0x3e6ec0[_0xa1c9('0x14')]));});});};
\ No newline at end of file