Built motion from commit (unavailable).|2.5.0
[motion2.git] / server / api / intSugarcrmAccount / intSugarcrmAccount.rpc.js
index 8d58b04..d8a4a18 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf634=['include','map','model','GetSugarcrmAccount','catch','ShowSugarcrmAccount','raw','util','moment','bluebird','ioredis','../../config/utils','rpc','client','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','SugarcrmAccount','findAll','options','where','attributes','limit'];(function(_0xc2d1dc,_0x56b390){var _0x4ea771=function(_0x1dc261){while(--_0x1dc261){_0xc2d1dc['push'](_0xc2d1dc['shift']());}};_0x4ea771(++_0x56b390);}(_0xf634,0xf7));var _0x4f63=function(_0x3c356c,_0x3f3bec){_0x3c356c=_0x3c356c-0x0;var _0x512812=_0xf634[_0x3c356c];return _0x512812;};'use strict';var _=require('lodash');var util=require(_0x4f63('0x0'));var moment=require(_0x4f63('0x1'));var BPromise=require(_0x4f63('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4f63('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4f63('0x4'));var logger=require('../../config/logger')(_0x4f63('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4f63('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4064e3,_0xd95e42,_0xc0dddd){return new BPromise(function(_0x5db5a2,_0xd35b2d){return client['request'](_0x4064e3,_0xc0dddd)[_0x4f63('0x7')](function(_0xffded7){logger[_0x4f63('0x8')](_0x4f63('0x9'),_0xd95e42,_0x4f63('0xa'));logger[_0x4f63('0xb')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0xd95e42,_0x4f63('0xa'),JSON[_0x4f63('0xc')](_0xffded7));if(_0xffded7[_0x4f63('0xd')]){if(_0xffded7['error'][_0x4f63('0xe')]===0x1f4){logger[_0x4f63('0xd')](_0x4f63('0x9'),_0xd95e42,_0xffded7[_0x4f63('0xd')][_0x4f63('0xf')]);return _0xd35b2d(_0xffded7[_0x4f63('0xd')]['message']);}logger[_0x4f63('0xd')](_0x4f63('0x9'),_0xd95e42,_0xffded7[_0x4f63('0xd')][_0x4f63('0xf')]);return _0x5db5a2(_0xffded7[_0x4f63('0xd')][_0x4f63('0xf')]);}else{logger[_0x4f63('0x8')](_0x4f63('0x9'),_0xd95e42,_0x4f63('0xa'));_0x5db5a2(_0xffded7[_0x4f63('0x10')][_0x4f63('0xf')]);}})['catch'](function(_0x4b6166){logger[_0x4f63('0xd')](_0x4f63('0x9'),_0xd95e42,_0x4b6166);_0xd35b2d(_0x4b6166);});});}exports['GetSugarcrmAccount']=function(_0x4c9094){var _0x2dcf81=this;return new Promise(function(_0x110b3b,_0x11eca4){return db[_0x4f63('0x11')][_0x4f63('0x12')]({'raw':_0x4c9094['options']?_0x4c9094[_0x4f63('0x13')]['raw']===undefined?!![]:![]:!![],'where':_0x4c9094[_0x4f63('0x13')]?_0x4c9094[_0x4f63('0x13')][_0x4f63('0x14')]||null:null,'attributes':_0x4c9094[_0x4f63('0x13')]?_0x4c9094['options'][_0x4f63('0x15')]||null:null,'limit':_0x4c9094[_0x4f63('0x13')]?_0x4c9094[_0x4f63('0x13')][_0x4f63('0x16')]||null:null,'include':_0x4c9094[_0x4f63('0x13')]?_0x4c9094['options'][_0x4f63('0x17')]?_['map'](_0x4c9094[_0x4f63('0x13')]['include'],function(_0x154e7b){return{'model':db[_0x154e7b['model']],'as':_0x154e7b['as'],'attributes':_0x154e7b[_0x4f63('0x15')],'include':_0x154e7b[_0x4f63('0x17')]?_['map'](_0x154e7b['include'],function(_0x43d54b){return{'model':db[_0x43d54b['model']],'as':_0x43d54b['as'],'attributes':_0x43d54b['attributes'],'include':_0x43d54b['include']?_[_0x4f63('0x18')](_0x43d54b[_0x4f63('0x17')],function(_0xfec797){return{'model':db[_0xfec797[_0x4f63('0x19')]],'as':_0xfec797['as'],'attributes':_0xfec797[_0x4f63('0x15')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3dffc1){logger[_0x4f63('0x8')](_0x4f63('0x1a'),_0x4c9094);logger[_0x4f63('0xb')](_0x4f63('0x1a'),_0x4c9094,JSON[_0x4f63('0xc')](_0x3dffc1));_0x110b3b(_0x3dffc1);})[_0x4f63('0x1b')](function(_0x57b93e){logger[_0x4f63('0xd')](_0x4f63('0x1a'),_0x57b93e[_0x4f63('0xf')],_0x4c9094);_0x11eca4(_0x2dcf81[_0x4f63('0xd')](0x1f4,_0x57b93e['message']));});});};exports[_0x4f63('0x1c')]=function(_0x15569a){var _0x3bf614=this;return new Promise(function(_0x3a91e3,_0x5a522c){return db[_0x4f63('0x11')]['find']({'raw':_0x15569a[_0x4f63('0x13')]?_0x15569a[_0x4f63('0x13')][_0x4f63('0x1d')]===undefined?!![]:![]:!![],'where':_0x15569a[_0x4f63('0x13')]?_0x15569a[_0x4f63('0x13')]['where']||null:null,'attributes':_0x15569a[_0x4f63('0x13')]?_0x15569a[_0x4f63('0x13')][_0x4f63('0x15')]||null:null,'include':_0x15569a[_0x4f63('0x13')]?_0x15569a[_0x4f63('0x13')]['include']?_['map'](_0x15569a[_0x4f63('0x13')][_0x4f63('0x17')],function(_0x25959b){return{'model':db[_0x25959b['model']],'as':_0x25959b['as'],'attributes':_0x25959b[_0x4f63('0x15')],'include':_0x25959b['include']?_['map'](_0x25959b[_0x4f63('0x17')],function(_0x429b8e){return{'model':db[_0x429b8e[_0x4f63('0x19')]],'as':_0x429b8e['as'],'attributes':_0x429b8e['attributes'],'include':_0x429b8e[_0x4f63('0x17')]?_[_0x4f63('0x18')](_0x429b8e[_0x4f63('0x17')],function(_0x4af723){return{'model':db[_0x4af723[_0x4f63('0x19')]],'as':_0x4af723['as'],'attributes':_0x4af723[_0x4f63('0x15')]};}):[]};}):[]};}):[]:[]})[_0x4f63('0x7')](function(_0x46b726){logger[_0x4f63('0x8')]('ShowSugarcrmAccount',_0x15569a);logger[_0x4f63('0xb')](_0x4f63('0x1c'),_0x15569a,JSON['stringify'](_0x46b726));_0x3a91e3(_0x46b726);})[_0x4f63('0x1b')](function(_0x229118){logger[_0x4f63('0xd')](_0x4f63('0x1c'),_0x229118[_0x4f63('0xf')],_0x15569a);_0x5a522c(_0x3bf614[_0x4f63('0xd')](0x1f4,_0x229118[_0x4f63('0xf')]));});});};
\ No newline at end of file
+var _0x0922=['message','SugarcrmAccount,\x20%s,\x20%s','result','catch','GetSugarcrmAccount','SugarcrmAccount','findAll','options','raw','where','limit','include','map','model','attributes','debug','ShowSugarcrmAccount','lodash','moment','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','SugarcrmAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x20845e,_0x211e78){var _0x28cf2b=function(_0x31d613){while(--_0x31d613){_0x20845e['push'](_0x20845e['shift']());}};_0x28cf2b(++_0x211e78);}(_0x0922,0xb6));var _0x2092=function(_0x1ccbcc,_0x5c948b){_0x1ccbcc=_0x1ccbcc-0x0;var _0x1e873f=_0x0922[_0x1ccbcc];return _0x1e873f;};'use strict';var _=require(_0x2092('0x0'));var util=require('util');var moment=require(_0x2092('0x1'));var BPromise=require('bluebird');var rs=require(_0x2092('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x2092('0x3'));var logger=require(_0x2092('0x4'))(_0x2092('0x5'));var config=require('../../config/environment');var jayson=require(_0x2092('0x6'));var client=jayson[_0x2092('0x7')][_0x2092('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3bf65e,_0x5c9242,_0x5e3a19){return new BPromise(function(_0x10215a,_0x210b95){return client['request'](_0x3bf65e,_0x5e3a19)[_0x2092('0x9')](function(_0x10ff6d){logger[_0x2092('0xa')]('SugarcrmAccount,\x20%s,\x20%s',_0x5c9242,'request\x20sent');logger['debug'](_0x2092('0xb'),_0x5c9242,_0x2092('0xc'),JSON[_0x2092('0xd')](_0x10ff6d));if(_0x10ff6d[_0x2092('0xe')]){if(_0x10ff6d[_0x2092('0xe')][_0x2092('0xf')]===0x1f4){logger[_0x2092('0xe')]('SugarcrmAccount,\x20%s,\x20%s',_0x5c9242,_0x10ff6d[_0x2092('0xe')]['message']);return _0x210b95(_0x10ff6d[_0x2092('0xe')][_0x2092('0x10')]);}logger[_0x2092('0xe')](_0x2092('0x11'),_0x5c9242,_0x10ff6d[_0x2092('0xe')]['message']);return _0x10215a(_0x10ff6d[_0x2092('0xe')][_0x2092('0x10')]);}else{logger[_0x2092('0xa')](_0x2092('0x11'),_0x5c9242,_0x2092('0xc'));_0x10215a(_0x10ff6d[_0x2092('0x12')][_0x2092('0x10')]);}})[_0x2092('0x13')](function(_0x39ac6e){logger[_0x2092('0xe')](_0x2092('0x11'),_0x5c9242,_0x39ac6e);_0x210b95(_0x39ac6e);});});}exports[_0x2092('0x14')]=function(_0x3783f3){var _0x85fa11=this;return new Promise(function(_0x3c7bd3,_0x355264){return db[_0x2092('0x15')][_0x2092('0x16')]({'raw':_0x3783f3[_0x2092('0x17')]?_0x3783f3[_0x2092('0x17')][_0x2092('0x18')]===undefined?!![]:![]:!![],'where':_0x3783f3[_0x2092('0x17')]?_0x3783f3[_0x2092('0x17')][_0x2092('0x19')]||null:null,'attributes':_0x3783f3[_0x2092('0x17')]?_0x3783f3['options']['attributes']||null:null,'limit':_0x3783f3[_0x2092('0x17')]?_0x3783f3[_0x2092('0x17')][_0x2092('0x1a')]||null:null,'include':_0x3783f3[_0x2092('0x17')]?_0x3783f3[_0x2092('0x17')][_0x2092('0x1b')]?_[_0x2092('0x1c')](_0x3783f3['options'][_0x2092('0x1b')],function(_0x2d5719){return{'model':db[_0x2d5719[_0x2092('0x1d')]],'as':_0x2d5719['as'],'attributes':_0x2d5719[_0x2092('0x1e')],'include':_0x2d5719[_0x2092('0x1b')]?_[_0x2092('0x1c')](_0x2d5719[_0x2092('0x1b')],function(_0x44149f){return{'model':db[_0x44149f[_0x2092('0x1d')]],'as':_0x44149f['as'],'attributes':_0x44149f[_0x2092('0x1e')],'include':_0x44149f[_0x2092('0x1b')]?_[_0x2092('0x1c')](_0x44149f[_0x2092('0x1b')],function(_0x40bccc){return{'model':db[_0x40bccc[_0x2092('0x1d')]],'as':_0x40bccc['as'],'attributes':_0x40bccc[_0x2092('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x174f0c){logger[_0x2092('0xa')](_0x2092('0x14'),_0x3783f3);logger[_0x2092('0x1f')]('GetSugarcrmAccount',_0x3783f3,JSON[_0x2092('0xd')](_0x174f0c));_0x3c7bd3(_0x174f0c);})[_0x2092('0x13')](function(_0x30d0ad){logger[_0x2092('0xe')](_0x2092('0x14'),_0x30d0ad[_0x2092('0x10')],_0x3783f3);_0x355264(_0x85fa11[_0x2092('0xe')](0x1f4,_0x30d0ad[_0x2092('0x10')]));});});};exports['ShowSugarcrmAccount']=function(_0x53aae1){var _0x2ebc78=this;return new Promise(function(_0x20d736,_0x369050){return db[_0x2092('0x15')]['find']({'raw':_0x53aae1[_0x2092('0x17')]?_0x53aae1[_0x2092('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x53aae1[_0x2092('0x17')]?_0x53aae1['options']['where']||null:null,'attributes':_0x53aae1[_0x2092('0x17')]?_0x53aae1[_0x2092('0x17')]['attributes']||null:null,'include':_0x53aae1['options']?_0x53aae1[_0x2092('0x17')][_0x2092('0x1b')]?_[_0x2092('0x1c')](_0x53aae1[_0x2092('0x17')]['include'],function(_0x55dc4b){return{'model':db[_0x55dc4b['model']],'as':_0x55dc4b['as'],'attributes':_0x55dc4b[_0x2092('0x1e')],'include':_0x55dc4b['include']?_[_0x2092('0x1c')](_0x55dc4b[_0x2092('0x1b')],function(_0x439ddb){return{'model':db[_0x439ddb[_0x2092('0x1d')]],'as':_0x439ddb['as'],'attributes':_0x439ddb[_0x2092('0x1e')],'include':_0x439ddb[_0x2092('0x1b')]?_[_0x2092('0x1c')](_0x439ddb['include'],function(_0xdbfa9){return{'model':db[_0xdbfa9[_0x2092('0x1d')]],'as':_0xdbfa9['as'],'attributes':_0xdbfa9[_0x2092('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x177218){logger[_0x2092('0xa')](_0x2092('0x20'),_0x53aae1);logger['debug'](_0x2092('0x20'),_0x53aae1,JSON['stringify'](_0x177218));_0x20d736(_0x177218);})['catch'](function(_0x48684f){logger[_0x2092('0xe')]('ShowSugarcrmAccount',_0x48684f[_0x2092('0x10')],_0x53aae1);_0x369050(_0x2ebc78[_0x2092('0xe')](0x1f4,_0x48684f['message']));});});};
\ No newline at end of file