Built motion from commit (unavailable).|2.5.30
[motion2.git] / server / api / intSugarcrmAccount / intSugarcrmAccount.rpc.js
index f821a07..30fc972 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5739=['find','raw','where','then','ShowSugarcrmAccount','lodash','util','moment','bluebird','randomstring','../../config/logger','rpc','jayson/promise','http','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetSugarcrmAccount','options','attributes','include','map','model'];(function(_0x1eb14e,_0x197c39){var _0x8d4e56=function(_0x49b06f){while(--_0x49b06f){_0x1eb14e['push'](_0x1eb14e['shift']());}};_0x8d4e56(++_0x197c39);}(_0x5739,0xfd));var _0x9573=function(_0x4f98e0,_0x54bfe4){_0x4f98e0=_0x4f98e0-0x0;var _0x4f5a14=_0x5739[_0x4f98e0];return _0x4f5a14;};'use strict';var _=require(_0x9573('0x0'));var util=require(_0x9573('0x1'));var moment=require(_0x9573('0x2'));var BPromise=require(_0x9573('0x3'));var rs=require(_0x9573('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x9573('0x5'))(_0x9573('0x6'));var config=require('../../config/environment');var jayson=require(_0x9573('0x7'));var client=jayson['client'][_0x9573('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xf8182a,_0xea13c0,_0x4f50c6){return new BPromise(function(_0x4f08f1,_0x4304aa){return client['request'](_0xf8182a,_0x4f50c6)['then'](function(_0x514120){logger['info'](_0x9573('0x9'),_0xea13c0,_0x9573('0xa'));logger[_0x9573('0xb')](_0x9573('0xc'),_0xea13c0,_0x9573('0xa'),JSON[_0x9573('0xd')](_0x514120));if(_0x514120[_0x9573('0xe')]){if(_0x514120[_0x9573('0xe')][_0x9573('0xf')]===0x1f4){logger['error'](_0x9573('0x9'),_0xea13c0,_0x514120[_0x9573('0xe')][_0x9573('0x10')]);return _0x4304aa(_0x514120[_0x9573('0xe')][_0x9573('0x10')]);}logger[_0x9573('0xe')](_0x9573('0x9'),_0xea13c0,_0x514120[_0x9573('0xe')][_0x9573('0x10')]);return _0x4f08f1(_0x514120['error'][_0x9573('0x10')]);}else{logger[_0x9573('0x11')](_0x9573('0x9'),_0xea13c0,_0x9573('0xa'));_0x4f08f1(_0x514120[_0x9573('0x12')][_0x9573('0x10')]);}})[_0x9573('0x13')](function(_0x28a05){logger[_0x9573('0xe')](_0x9573('0x9'),_0xea13c0,_0x28a05);_0x4304aa(_0x28a05);});});}exports[_0x9573('0x14')]=function(_0x372365){var _0x485683=this;return new Promise(function(_0x308c48,_0xd6675e){return db['SugarcrmAccount']['findAll']({'raw':_0x372365[_0x9573('0x15')]?_0x372365['options']['raw']===undefined?!![]:![]:!![],'where':_0x372365[_0x9573('0x15')]?_0x372365[_0x9573('0x15')]['where']||null:null,'attributes':_0x372365[_0x9573('0x15')]?_0x372365['options'][_0x9573('0x16')]||null:null,'limit':_0x372365['options']?_0x372365[_0x9573('0x15')]['limit']||null:null,'include':_0x372365['options']?_0x372365[_0x9573('0x15')][_0x9573('0x17')]?_['map'](_0x372365[_0x9573('0x15')]['include'],function(_0x22ed5d){return{'model':db[_0x22ed5d['model']],'as':_0x22ed5d['as'],'attributes':_0x22ed5d[_0x9573('0x16')],'include':_0x22ed5d[_0x9573('0x17')]?_[_0x9573('0x18')](_0x22ed5d[_0x9573('0x17')],function(_0x572855){return{'model':db[_0x572855[_0x9573('0x19')]],'as':_0x572855['as'],'attributes':_0x572855[_0x9573('0x16')],'include':_0x572855[_0x9573('0x17')]?_[_0x9573('0x18')](_0x572855[_0x9573('0x17')],function(_0x4dfc9f){return{'model':db[_0x4dfc9f[_0x9573('0x19')]],'as':_0x4dfc9f['as'],'attributes':_0x4dfc9f['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x10ec54){logger[_0x9573('0x11')](_0x9573('0x14'),_0x372365);logger[_0x9573('0xb')](_0x9573('0x14'),_0x372365,JSON[_0x9573('0xd')](_0x10ec54));_0x308c48(_0x10ec54);})[_0x9573('0x13')](function(_0x5ec64d){logger['error'](_0x9573('0x14'),_0x5ec64d[_0x9573('0x10')],_0x372365);_0xd6675e(_0x485683['error'](0x1f4,_0x5ec64d[_0x9573('0x10')]));});});};exports['ShowSugarcrmAccount']=function(_0x52810c){var _0x34829b=this;return new Promise(function(_0x193679,_0x5e8e14){return db['SugarcrmAccount'][_0x9573('0x1a')]({'raw':_0x52810c[_0x9573('0x15')]?_0x52810c[_0x9573('0x15')][_0x9573('0x1b')]===undefined?!![]:![]:!![],'where':_0x52810c[_0x9573('0x15')]?_0x52810c[_0x9573('0x15')][_0x9573('0x1c')]||null:null,'attributes':_0x52810c['options']?_0x52810c['options'][_0x9573('0x16')]||null:null,'include':_0x52810c[_0x9573('0x15')]?_0x52810c[_0x9573('0x15')][_0x9573('0x17')]?_[_0x9573('0x18')](_0x52810c[_0x9573('0x15')][_0x9573('0x17')],function(_0x116f59){return{'model':db[_0x116f59[_0x9573('0x19')]],'as':_0x116f59['as'],'attributes':_0x116f59['attributes'],'include':_0x116f59[_0x9573('0x17')]?_[_0x9573('0x18')](_0x116f59['include'],function(_0x309e54){return{'model':db[_0x309e54[_0x9573('0x19')]],'as':_0x309e54['as'],'attributes':_0x309e54[_0x9573('0x16')],'include':_0x309e54[_0x9573('0x17')]?_[_0x9573('0x18')](_0x309e54[_0x9573('0x17')],function(_0x6bd84c){return{'model':db[_0x6bd84c[_0x9573('0x19')]],'as':_0x6bd84c['as'],'attributes':_0x6bd84c[_0x9573('0x16')]};}):[]};}):[]};}):[]:[]})[_0x9573('0x1d')](function(_0x367a5b){logger[_0x9573('0x11')](_0x9573('0x1e'),_0x52810c);logger[_0x9573('0xb')]('ShowSugarcrmAccount',_0x52810c,JSON[_0x9573('0xd')](_0x367a5b));_0x193679(_0x367a5b);})[_0x9573('0x13')](function(_0x3d1cb1){logger[_0x9573('0xe')](_0x9573('0x1e'),_0x3d1cb1[_0x9573('0x10')],_0x52810c);_0x5e8e14(_0x34829b[_0x9573('0xe')](0x1f4,_0x3d1cb1[_0x9573('0x10')]));});});};
\ No newline at end of file
+var _0x6a82=['where','attributes','include','model','map','then','stringify','ShowSugarcrmAccount','raw','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','SugarcrmAccount,\x20%s,\x20%s','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','GetSugarcrmAccount','SugarcrmAccount','findAll','options'];(function(_0x57dd0e,_0x1cc750){var _0x167f7d=function(_0x2b8be7){while(--_0x2b8be7){_0x57dd0e['push'](_0x57dd0e['shift']());}};_0x167f7d(++_0x1cc750);}(_0x6a82,0x1f3));var _0x26a8=function(_0x5ebf3c,_0xc16d1e){_0x5ebf3c=_0x5ebf3c-0x0;var _0x3289a2=_0x6a82[_0x5ebf3c];return _0x3289a2;};'use strict';var _=require(_0x26a8('0x0'));var util=require(_0x26a8('0x1'));var moment=require('moment');var BPromise=require(_0x26a8('0x2'));var rs=require(_0x26a8('0x3'));var fs=require('fs');var Redis=require(_0x26a8('0x4'));var db=require(_0x26a8('0x5'))['db'];var utils=require(_0x26a8('0x6'));var logger=require(_0x26a8('0x7'))(_0x26a8('0x8'));var config=require(_0x26a8('0x9'));var jayson=require(_0x26a8('0xa'));var client=jayson[_0x26a8('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1ed6df,_0x127b9d,_0x350458){return new BPromise(function(_0x33e04e,_0x133d37){return client[_0x26a8('0xc')](_0x1ed6df,_0x350458)['then'](function(_0x2263f4){logger['info'](_0x26a8('0xd'),_0x127b9d,'request\x20sent');logger[_0x26a8('0xe')](_0x26a8('0xf'),_0x127b9d,'request\x20sent',JSON['stringify'](_0x2263f4));if(_0x2263f4[_0x26a8('0x10')]){if(_0x2263f4[_0x26a8('0x10')][_0x26a8('0x11')]===0x1f4){logger[_0x26a8('0x10')]('SugarcrmAccount,\x20%s,\x20%s',_0x127b9d,_0x2263f4[_0x26a8('0x10')][_0x26a8('0x12')]);return _0x133d37(_0x2263f4['error'][_0x26a8('0x12')]);}logger[_0x26a8('0x10')]('SugarcrmAccount,\x20%s,\x20%s',_0x127b9d,_0x2263f4[_0x26a8('0x10')][_0x26a8('0x12')]);return _0x33e04e(_0x2263f4[_0x26a8('0x10')]['message']);}else{logger[_0x26a8('0x13')](_0x26a8('0xd'),_0x127b9d,'request\x20sent');_0x33e04e(_0x2263f4[_0x26a8('0x14')][_0x26a8('0x12')]);}})[_0x26a8('0x15')](function(_0x53918a){logger[_0x26a8('0x10')]('SugarcrmAccount,\x20%s,\x20%s',_0x127b9d,_0x53918a);_0x133d37(_0x53918a);});});}exports[_0x26a8('0x16')]=function(_0x4ad1fb){var _0x59c554=this;return new Promise(function(_0x530e02,_0x3b2bd1){return db[_0x26a8('0x17')][_0x26a8('0x18')]({'raw':_0x4ad1fb[_0x26a8('0x19')]?_0x4ad1fb[_0x26a8('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x4ad1fb['options']?_0x4ad1fb[_0x26a8('0x19')][_0x26a8('0x1a')]||null:null,'attributes':_0x4ad1fb[_0x26a8('0x19')]?_0x4ad1fb['options'][_0x26a8('0x1b')]||null:null,'limit':_0x4ad1fb['options']?_0x4ad1fb[_0x26a8('0x19')]['limit']||null:null,'include':_0x4ad1fb[_0x26a8('0x19')]?_0x4ad1fb[_0x26a8('0x19')][_0x26a8('0x1c')]?_['map'](_0x4ad1fb[_0x26a8('0x19')][_0x26a8('0x1c')],function(_0x3971c8){return{'model':db[_0x3971c8[_0x26a8('0x1d')]],'as':_0x3971c8['as'],'attributes':_0x3971c8[_0x26a8('0x1b')],'include':_0x3971c8[_0x26a8('0x1c')]?_[_0x26a8('0x1e')](_0x3971c8[_0x26a8('0x1c')],function(_0x4f9bf4){return{'model':db[_0x4f9bf4['model']],'as':_0x4f9bf4['as'],'attributes':_0x4f9bf4[_0x26a8('0x1b')],'include':_0x4f9bf4[_0x26a8('0x1c')]?_['map'](_0x4f9bf4['include'],function(_0x3b1989){return{'model':db[_0x3b1989['model']],'as':_0x3b1989['as'],'attributes':_0x3b1989['attributes']};}):[]};}):[]};}):[]:[]})[_0x26a8('0x1f')](function(_0x381573){logger['info'](_0x26a8('0x16'),_0x4ad1fb);logger[_0x26a8('0xe')]('GetSugarcrmAccount',_0x4ad1fb,JSON[_0x26a8('0x20')](_0x381573));_0x530e02(_0x381573);})['catch'](function(_0x5a8573){logger[_0x26a8('0x10')](_0x26a8('0x16'),_0x5a8573[_0x26a8('0x12')],_0x4ad1fb);_0x3b2bd1(_0x59c554['error'](0x1f4,_0x5a8573['message']));});});};exports[_0x26a8('0x21')]=function(_0x49ba3a){var _0x2b709b=this;return new Promise(function(_0x3304bf,_0x5e301f){return db[_0x26a8('0x17')]['find']({'raw':_0x49ba3a[_0x26a8('0x19')]?_0x49ba3a[_0x26a8('0x19')][_0x26a8('0x22')]===undefined?!![]:![]:!![],'where':_0x49ba3a[_0x26a8('0x19')]?_0x49ba3a[_0x26a8('0x19')][_0x26a8('0x1a')]||null:null,'attributes':_0x49ba3a[_0x26a8('0x19')]?_0x49ba3a[_0x26a8('0x19')][_0x26a8('0x1b')]||null:null,'include':_0x49ba3a['options']?_0x49ba3a['options'][_0x26a8('0x1c')]?_[_0x26a8('0x1e')](_0x49ba3a['options'][_0x26a8('0x1c')],function(_0x23fef4){return{'model':db[_0x23fef4['model']],'as':_0x23fef4['as'],'attributes':_0x23fef4['attributes'],'include':_0x23fef4[_0x26a8('0x1c')]?_[_0x26a8('0x1e')](_0x23fef4[_0x26a8('0x1c')],function(_0x6b6c6){return{'model':db[_0x6b6c6[_0x26a8('0x1d')]],'as':_0x6b6c6['as'],'attributes':_0x6b6c6[_0x26a8('0x1b')],'include':_0x6b6c6[_0x26a8('0x1c')]?_[_0x26a8('0x1e')](_0x6b6c6[_0x26a8('0x1c')],function(_0x4d29cb){return{'model':db[_0x4d29cb[_0x26a8('0x1d')]],'as':_0x4d29cb['as'],'attributes':_0x4d29cb[_0x26a8('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x26a8('0x1f')](function(_0x4faf12){logger['info'](_0x26a8('0x21'),_0x49ba3a);logger['debug'](_0x26a8('0x21'),_0x49ba3a,JSON[_0x26a8('0x20')](_0x4faf12));_0x3304bf(_0x4faf12);})[_0x26a8('0x15')](function(_0x446560){logger[_0x26a8('0x10')]('ShowSugarcrmAccount',_0x446560['message'],_0x49ba3a);_0x5e301f(_0x2b709b['error'](0x1f4,_0x446560[_0x26a8('0x12')]));});});};
\ No newline at end of file