Built motion from commit a8c4dd89.|2.6.33
[motion2.git] / server / api / intSugarcrmAccount / intSugarcrmAccount.rpc.js
index 6cf1f0e..19434f4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf71b=['request','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','SugarcrmAccount','options','raw','attributes','limit','include','model','map','then','GetSugarcrmAccount','ShowSugarcrmAccount','where','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x404d7b,_0x5097c6){var _0x35c939=function(_0x444213){while(--_0x444213){_0x404d7b['push'](_0x404d7b['shift']());}};_0x35c939(++_0x5097c6);}(_0xf71b,0xa3));var _0xbf71=function(_0x5b79fb,_0x5396fe){_0x5b79fb=_0x5b79fb-0x0;var _0x263d12=_0xf71b[_0x5b79fb];return _0x263d12;};'use strict';var _=require(_0xbf71('0x0'));var util=require('util');var moment=require(_0xbf71('0x1'));var BPromise=require(_0xbf71('0x2'));var rs=require(_0xbf71('0x3'));var fs=require('fs');var Redis=require(_0xbf71('0x4'));var db=require(_0xbf71('0x5'))['db'];var utils=require(_0xbf71('0x6'));var logger=require(_0xbf71('0x7'))('rpc');var config=require(_0xbf71('0x8'));var jayson=require(_0xbf71('0x9'));var client=jayson[_0xbf71('0xa')][_0xbf71('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4d34f9,_0x51a166,_0x6ce79e){return new BPromise(function(_0x102973,_0x11a2db){return client[_0xbf71('0xc')](_0x4d34f9,_0x6ce79e)['then'](function(_0x49b834){logger[_0xbf71('0xd')](_0xbf71('0xe'),_0x51a166,_0xbf71('0xf'));logger[_0xbf71('0x10')](_0xbf71('0x11'),_0x51a166,_0xbf71('0xf'),JSON[_0xbf71('0x12')](_0x49b834));if(_0x49b834['error']){if(_0x49b834['error']['code']===0x1f4){logger[_0xbf71('0x13')](_0xbf71('0xe'),_0x51a166,_0x49b834[_0xbf71('0x13')][_0xbf71('0x14')]);return _0x11a2db(_0x49b834[_0xbf71('0x13')]['message']);}logger[_0xbf71('0x13')](_0xbf71('0xe'),_0x51a166,_0x49b834[_0xbf71('0x13')][_0xbf71('0x14')]);return _0x102973(_0x49b834['error'][_0xbf71('0x14')]);}else{logger[_0xbf71('0xd')]('SugarcrmAccount,\x20%s,\x20%s',_0x51a166,_0xbf71('0xf'));_0x102973(_0x49b834[_0xbf71('0x15')]['message']);}})[_0xbf71('0x16')](function(_0x252109){logger['error'](_0xbf71('0xe'),_0x51a166,_0x252109);_0x11a2db(_0x252109);});});}exports['GetSugarcrmAccount']=function(_0x277d1a){var _0xa4d078=this;return new Promise(function(_0x3b56d0,_0x5450a8){return db[_0xbf71('0x17')]['findAll']({'raw':_0x277d1a[_0xbf71('0x18')]?_0x277d1a['options'][_0xbf71('0x19')]===undefined?!![]:![]:!![],'where':_0x277d1a['options']?_0x277d1a[_0xbf71('0x18')]['where']||null:null,'attributes':_0x277d1a[_0xbf71('0x18')]?_0x277d1a[_0xbf71('0x18')][_0xbf71('0x1a')]||null:null,'limit':_0x277d1a[_0xbf71('0x18')]?_0x277d1a[_0xbf71('0x18')][_0xbf71('0x1b')]||null:null,'include':_0x277d1a[_0xbf71('0x18')]?_0x277d1a['options'][_0xbf71('0x1c')]?_['map'](_0x277d1a['options'][_0xbf71('0x1c')],function(_0x5277e5){return{'model':db[_0x5277e5[_0xbf71('0x1d')]],'as':_0x5277e5['as'],'attributes':_0x5277e5[_0xbf71('0x1a')],'include':_0x5277e5[_0xbf71('0x1c')]?_['map'](_0x5277e5[_0xbf71('0x1c')],function(_0x34214d){return{'model':db[_0x34214d['model']],'as':_0x34214d['as'],'attributes':_0x34214d[_0xbf71('0x1a')],'include':_0x34214d[_0xbf71('0x1c')]?_[_0xbf71('0x1e')](_0x34214d[_0xbf71('0x1c')],function(_0x2c1723){return{'model':db[_0x2c1723['model']],'as':_0x2c1723['as'],'attributes':_0x2c1723[_0xbf71('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xbf71('0x1f')](function(_0x5da3e8){logger[_0xbf71('0xd')]('GetSugarcrmAccount',_0x277d1a);logger['debug'](_0xbf71('0x20'),_0x277d1a,JSON[_0xbf71('0x12')](_0x5da3e8));_0x3b56d0(_0x5da3e8);})[_0xbf71('0x16')](function(_0xdcb53c){logger['error'](_0xbf71('0x20'),_0xdcb53c[_0xbf71('0x14')],_0x277d1a);_0x5450a8(_0xa4d078[_0xbf71('0x13')](0x1f4,_0xdcb53c['message']));});});};exports[_0xbf71('0x21')]=function(_0x22cd46){var _0x2aee41=this;return new Promise(function(_0x2fd281,_0x30ab5b){return db[_0xbf71('0x17')]['find']({'raw':_0x22cd46[_0xbf71('0x18')]?_0x22cd46[_0xbf71('0x18')][_0xbf71('0x19')]===undefined?!![]:![]:!![],'where':_0x22cd46[_0xbf71('0x18')]?_0x22cd46['options'][_0xbf71('0x22')]||null:null,'attributes':_0x22cd46[_0xbf71('0x18')]?_0x22cd46[_0xbf71('0x18')][_0xbf71('0x1a')]||null:null,'include':_0x22cd46[_0xbf71('0x18')]?_0x22cd46['options'][_0xbf71('0x1c')]?_[_0xbf71('0x1e')](_0x22cd46['options'][_0xbf71('0x1c')],function(_0xbc1330){return{'model':db[_0xbc1330['model']],'as':_0xbc1330['as'],'attributes':_0xbc1330[_0xbf71('0x1a')],'include':_0xbc1330['include']?_['map'](_0xbc1330[_0xbf71('0x1c')],function(_0x10ed5b){return{'model':db[_0x10ed5b[_0xbf71('0x1d')]],'as':_0x10ed5b['as'],'attributes':_0x10ed5b[_0xbf71('0x1a')],'include':_0x10ed5b['include']?_[_0xbf71('0x1e')](_0x10ed5b[_0xbf71('0x1c')],function(_0x3c1793){return{'model':db[_0x3c1793['model']],'as':_0x3c1793['as'],'attributes':_0x3c1793['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x46d2f5){logger['info'](_0xbf71('0x21'),_0x22cd46);logger[_0xbf71('0x10')]('ShowSugarcrmAccount',_0x22cd46,JSON['stringify'](_0x46d2f5));_0x2fd281(_0x46d2f5);})[_0xbf71('0x16')](function(_0x4c1383){logger[_0xbf71('0x13')](_0xbf71('0x21'),_0x4c1383[_0xbf71('0x14')],_0x22cd46);_0x30ab5b(_0x2aee41[_0xbf71('0x13')](0x1f4,_0x4c1383[_0xbf71('0x14')]));});});};
\ No newline at end of file
+var _0xa0f5=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','error','message','result','catch','GetSugarcrmAccount','SugarcrmAccount','findAll','options','raw','where','attributes','include','map','model','stringify','ShowSugarcrmAccount','find','moment'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0xa0f5,0x180));var _0x5a0f=function(_0x593d08,_0x124ecc){_0x593d08=_0x593d08-0x0;var _0x48eab9=_0xa0f5[_0x593d08];return _0x48eab9;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x5a0f('0x0'));var BPromise=require(_0x5a0f('0x1'));var rs=require(_0x5a0f('0x2'));var fs=require('fs');var Redis=require(_0x5a0f('0x3'));var db=require(_0x5a0f('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x5a0f('0x5'))(_0x5a0f('0x6'));var config=require(_0x5a0f('0x7'));var jayson=require(_0x5a0f('0x8'));var client=jayson[_0x5a0f('0x9')][_0x5a0f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf59e12,_0x5d1ac3,_0x405011){return new BPromise(function(_0x351637,_0x38c5fc){return client[_0x5a0f('0xb')](_0xf59e12,_0x405011)[_0x5a0f('0xc')](function(_0x3b1afe){logger[_0x5a0f('0xd')](_0x5a0f('0xe'),_0x5d1ac3,_0x5a0f('0xf'));logger[_0x5a0f('0x10')](_0x5a0f('0x11'),_0x5d1ac3,_0x5a0f('0xf'),JSON['stringify'](_0x3b1afe));if(_0x3b1afe[_0x5a0f('0x12')]){if(_0x3b1afe[_0x5a0f('0x12')]['code']===0x1f4){logger[_0x5a0f('0x12')](_0x5a0f('0xe'),_0x5d1ac3,_0x3b1afe['error'][_0x5a0f('0x13')]);return _0x38c5fc(_0x3b1afe[_0x5a0f('0x12')][_0x5a0f('0x13')]);}logger[_0x5a0f('0x12')](_0x5a0f('0xe'),_0x5d1ac3,_0x3b1afe['error'][_0x5a0f('0x13')]);return _0x351637(_0x3b1afe[_0x5a0f('0x12')][_0x5a0f('0x13')]);}else{logger['info'](_0x5a0f('0xe'),_0x5d1ac3,_0x5a0f('0xf'));_0x351637(_0x3b1afe[_0x5a0f('0x14')][_0x5a0f('0x13')]);}})[_0x5a0f('0x15')](function(_0x273494){logger[_0x5a0f('0x12')](_0x5a0f('0xe'),_0x5d1ac3,_0x273494);_0x38c5fc(_0x273494);});});}exports[_0x5a0f('0x16')]=function(_0x3b19f3){var _0x4f9090=this;return new Promise(function(_0x3620c8,_0x4432b9){return db[_0x5a0f('0x17')][_0x5a0f('0x18')]({'raw':_0x3b19f3[_0x5a0f('0x19')]?_0x3b19f3[_0x5a0f('0x19')][_0x5a0f('0x1a')]===undefined?!![]:![]:!![],'where':_0x3b19f3[_0x5a0f('0x19')]?_0x3b19f3[_0x5a0f('0x19')][_0x5a0f('0x1b')]||null:null,'attributes':_0x3b19f3[_0x5a0f('0x19')]?_0x3b19f3[_0x5a0f('0x19')][_0x5a0f('0x1c')]||null:null,'limit':_0x3b19f3[_0x5a0f('0x19')]?_0x3b19f3[_0x5a0f('0x19')]['limit']||null:null,'include':_0x3b19f3[_0x5a0f('0x19')]?_0x3b19f3['options'][_0x5a0f('0x1d')]?_['map'](_0x3b19f3['options'][_0x5a0f('0x1d')],function(_0xac811b){return{'model':db[_0xac811b['model']],'as':_0xac811b['as'],'attributes':_0xac811b[_0x5a0f('0x1c')],'include':_0xac811b[_0x5a0f('0x1d')]?_[_0x5a0f('0x1e')](_0xac811b[_0x5a0f('0x1d')],function(_0x2832b2){return{'model':db[_0x2832b2['model']],'as':_0x2832b2['as'],'attributes':_0x2832b2[_0x5a0f('0x1c')],'include':_0x2832b2[_0x5a0f('0x1d')]?_['map'](_0x2832b2[_0x5a0f('0x1d')],function(_0x16f5d3){return{'model':db[_0x16f5d3[_0x5a0f('0x1f')]],'as':_0x16f5d3['as'],'attributes':_0x16f5d3[_0x5a0f('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x42b0cf){logger[_0x5a0f('0xd')](_0x5a0f('0x16'),_0x3b19f3);logger[_0x5a0f('0x10')](_0x5a0f('0x16'),_0x3b19f3,JSON[_0x5a0f('0x20')](_0x42b0cf));_0x3620c8(_0x42b0cf);})['catch'](function(_0x241525){logger['error'](_0x5a0f('0x16'),_0x241525[_0x5a0f('0x13')],_0x3b19f3);_0x4432b9(_0x4f9090[_0x5a0f('0x12')](0x1f4,_0x241525[_0x5a0f('0x13')]));});});};exports[_0x5a0f('0x21')]=function(_0x10680c){var _0x4fee69=this;return new Promise(function(_0x3fbc85,_0x5dfb86){return db[_0x5a0f('0x17')][_0x5a0f('0x22')]({'raw':_0x10680c[_0x5a0f('0x19')]?_0x10680c[_0x5a0f('0x19')][_0x5a0f('0x1a')]===undefined?!![]:![]:!![],'where':_0x10680c['options']?_0x10680c[_0x5a0f('0x19')]['where']||null:null,'attributes':_0x10680c[_0x5a0f('0x19')]?_0x10680c['options']['attributes']||null:null,'include':_0x10680c[_0x5a0f('0x19')]?_0x10680c[_0x5a0f('0x19')][_0x5a0f('0x1d')]?_[_0x5a0f('0x1e')](_0x10680c[_0x5a0f('0x19')][_0x5a0f('0x1d')],function(_0x320674){return{'model':db[_0x320674['model']],'as':_0x320674['as'],'attributes':_0x320674['attributes'],'include':_0x320674[_0x5a0f('0x1d')]?_['map'](_0x320674[_0x5a0f('0x1d')],function(_0x158d43){return{'model':db[_0x158d43[_0x5a0f('0x1f')]],'as':_0x158d43['as'],'attributes':_0x158d43[_0x5a0f('0x1c')],'include':_0x158d43['include']?_[_0x5a0f('0x1e')](_0x158d43[_0x5a0f('0x1d')],function(_0x1fb82d){return{'model':db[_0x1fb82d[_0x5a0f('0x1f')]],'as':_0x1fb82d['as'],'attributes':_0x1fb82d[_0x5a0f('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x5a0f('0xc')](function(_0x2ed3d4){logger[_0x5a0f('0xd')](_0x5a0f('0x21'),_0x10680c);logger['debug'](_0x5a0f('0x21'),_0x10680c,JSON[_0x5a0f('0x20')](_0x2ed3d4));_0x3fbc85(_0x2ed3d4);})[_0x5a0f('0x15')](function(_0x758655){logger[_0x5a0f('0x12')](_0x5a0f('0x21'),_0x758655[_0x5a0f('0x13')],_0x10680c);_0x5dfb86(_0x4fee69[_0x5a0f('0x12')](0x1f4,_0x758655[_0x5a0f('0x13')]));});});};
\ No newline at end of file