Built motion from commit (unavailable).|2.5.25
[motion2.git] / server / api / intSugarcrmAccount / intSugarcrmAccount.rpc.js
index 8381b6c..0545263 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcd97=['code','message','result','catch','SugarcrmAccount','findAll','options','raw','where','attributes','limit','include','map','model','GetSugarcrmAccount','stringify','ShowSugarcrmAccount','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','error'];(function(_0x371587,_0x5f146c){var _0x216d17=function(_0x2d0c91){while(--_0x2d0c91){_0x371587['push'](_0x371587['shift']());}};_0x216d17(++_0x5f146c);}(_0xcd97,0xbb));var _0x7cd9=function(_0x4e5969,_0x59d73e){_0x4e5969=_0x4e5969-0x0;var _0x59d7ce=_0xcd97[_0x4e5969];return _0x59d7ce;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x7cd9('0x0'));var BPromise=require(_0x7cd9('0x1'));var rs=require(_0x7cd9('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7cd9('0x3'))['db'];var utils=require(_0x7cd9('0x4'));var logger=require(_0x7cd9('0x5'))(_0x7cd9('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x7cd9('0x7')][_0x7cd9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x560707,_0x39da59,_0x50250d){return new BPromise(function(_0x58380c,_0x31ae74){return client[_0x7cd9('0x9')](_0x560707,_0x50250d)[_0x7cd9('0xa')](function(_0x3ff245){logger[_0x7cd9('0xb')](_0x7cd9('0xc'),_0x39da59,_0x7cd9('0xd'));logger[_0x7cd9('0xe')](_0x7cd9('0xf'),_0x39da59,_0x7cd9('0xd'),JSON['stringify'](_0x3ff245));if(_0x3ff245[_0x7cd9('0x10')]){if(_0x3ff245['error'][_0x7cd9('0x11')]===0x1f4){logger[_0x7cd9('0x10')]('SugarcrmAccount,\x20%s,\x20%s',_0x39da59,_0x3ff245[_0x7cd9('0x10')]['message']);return _0x31ae74(_0x3ff245[_0x7cd9('0x10')][_0x7cd9('0x12')]);}logger[_0x7cd9('0x10')](_0x7cd9('0xc'),_0x39da59,_0x3ff245[_0x7cd9('0x10')][_0x7cd9('0x12')]);return _0x58380c(_0x3ff245['error']['message']);}else{logger['info']('SugarcrmAccount,\x20%s,\x20%s',_0x39da59,_0x7cd9('0xd'));_0x58380c(_0x3ff245[_0x7cd9('0x13')]['message']);}})[_0x7cd9('0x14')](function(_0x67bf9f){logger['error'](_0x7cd9('0xc'),_0x39da59,_0x67bf9f);_0x31ae74(_0x67bf9f);});});}exports['GetSugarcrmAccount']=function(_0x3e940a){var _0x47e59c=this;return new Promise(function(_0x116ce9,_0x2b4be3){return db[_0x7cd9('0x15')][_0x7cd9('0x16')]({'raw':_0x3e940a[_0x7cd9('0x17')]?_0x3e940a[_0x7cd9('0x17')][_0x7cd9('0x18')]===undefined?!![]:![]:!![],'where':_0x3e940a[_0x7cd9('0x17')]?_0x3e940a[_0x7cd9('0x17')][_0x7cd9('0x19')]||null:null,'attributes':_0x3e940a[_0x7cd9('0x17')]?_0x3e940a[_0x7cd9('0x17')][_0x7cd9('0x1a')]||null:null,'limit':_0x3e940a[_0x7cd9('0x17')]?_0x3e940a[_0x7cd9('0x17')][_0x7cd9('0x1b')]||null:null,'include':_0x3e940a[_0x7cd9('0x17')]?_0x3e940a[_0x7cd9('0x17')][_0x7cd9('0x1c')]?_[_0x7cd9('0x1d')](_0x3e940a['options'][_0x7cd9('0x1c')],function(_0x42b7de){return{'model':db[_0x42b7de[_0x7cd9('0x1e')]],'as':_0x42b7de['as'],'attributes':_0x42b7de[_0x7cd9('0x1a')],'include':_0x42b7de['include']?_[_0x7cd9('0x1d')](_0x42b7de[_0x7cd9('0x1c')],function(_0x509171){return{'model':db[_0x509171[_0x7cd9('0x1e')]],'as':_0x509171['as'],'attributes':_0x509171[_0x7cd9('0x1a')],'include':_0x509171['include']?_[_0x7cd9('0x1d')](_0x509171[_0x7cd9('0x1c')],function(_0x52ad92){return{'model':db[_0x52ad92[_0x7cd9('0x1e')]],'as':_0x52ad92['as'],'attributes':_0x52ad92[_0x7cd9('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x7cd9('0xa')](function(_0x224790){logger[_0x7cd9('0xb')](_0x7cd9('0x1f'),_0x3e940a);logger[_0x7cd9('0xe')]('GetSugarcrmAccount',_0x3e940a,JSON[_0x7cd9('0x20')](_0x224790));_0x116ce9(_0x224790);})['catch'](function(_0x1d8ae8){logger[_0x7cd9('0x10')]('GetSugarcrmAccount',_0x1d8ae8[_0x7cd9('0x12')],_0x3e940a);_0x2b4be3(_0x47e59c[_0x7cd9('0x10')](0x1f4,_0x1d8ae8[_0x7cd9('0x12')]));});});};exports[_0x7cd9('0x21')]=function(_0x512114){var _0x2d101b=this;return new Promise(function(_0x1e1d5b,_0x1c0186){return db['SugarcrmAccount']['find']({'raw':_0x512114[_0x7cd9('0x17')]?_0x512114[_0x7cd9('0x17')][_0x7cd9('0x18')]===undefined?!![]:![]:!![],'where':_0x512114['options']?_0x512114['options'][_0x7cd9('0x19')]||null:null,'attributes':_0x512114[_0x7cd9('0x17')]?_0x512114[_0x7cd9('0x17')][_0x7cd9('0x1a')]||null:null,'include':_0x512114['options']?_0x512114[_0x7cd9('0x17')][_0x7cd9('0x1c')]?_[_0x7cd9('0x1d')](_0x512114['options']['include'],function(_0x1e305f){return{'model':db[_0x1e305f[_0x7cd9('0x1e')]],'as':_0x1e305f['as'],'attributes':_0x1e305f['attributes'],'include':_0x1e305f[_0x7cd9('0x1c')]?_[_0x7cd9('0x1d')](_0x1e305f['include'],function(_0x23be7a){return{'model':db[_0x23be7a[_0x7cd9('0x1e')]],'as':_0x23be7a['as'],'attributes':_0x23be7a[_0x7cd9('0x1a')],'include':_0x23be7a[_0x7cd9('0x1c')]?_['map'](_0x23be7a['include'],function(_0x2c5297){return{'model':db[_0x2c5297[_0x7cd9('0x1e')]],'as':_0x2c5297['as'],'attributes':_0x2c5297['attributes']};}):[]};}):[]};}):[]:[]})[_0x7cd9('0xa')](function(_0x504a33){logger[_0x7cd9('0xb')](_0x7cd9('0x21'),_0x512114);logger[_0x7cd9('0xe')](_0x7cd9('0x21'),_0x512114,JSON[_0x7cd9('0x20')](_0x504a33));_0x1e1d5b(_0x504a33);})[_0x7cd9('0x14')](function(_0x18e719){logger[_0x7cd9('0x10')](_0x7cd9('0x21'),_0x18e719['message'],_0x512114);_0x1c0186(_0x2d101b['error'](0x1f4,_0x18e719['message']));});});};
\ No newline at end of file
+var _0xdd88=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','stringify','error','SugarcrmAccount,\x20%s,\x20%s','message','info','request\x20sent','GetSugarcrmAccount','findAll','options','raw','where','limit','map','model','include','attributes','then','debug','ShowSugarcrmAccount','SugarcrmAccount','find','catch','lodash','util'];(function(_0x14bbdc,_0x3828fa){var _0x18aa19=function(_0x4bf890){while(--_0x4bf890){_0x14bbdc['push'](_0x14bbdc['shift']());}};_0x18aa19(++_0x3828fa);}(_0xdd88,0xa8));var _0x8dd8=function(_0x59f962,_0x62fc73){_0x59f962=_0x59f962-0x0;var _0x23808f=_0xdd88[_0x59f962];return _0x23808f;};'use strict';var _=require(_0x8dd8('0x0'));var util=require(_0x8dd8('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x8dd8('0x2'));var fs=require('fs');var Redis=require(_0x8dd8('0x3'));var db=require(_0x8dd8('0x4'))['db'];var utils=require(_0x8dd8('0x5'));var logger=require(_0x8dd8('0x6'))(_0x8dd8('0x7'));var config=require(_0x8dd8('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x8dd8('0x9')][_0x8dd8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x37c861,_0x22974d,_0x1713f5){return new BPromise(function(_0xf346af,_0x5d7eac){return client[_0x8dd8('0xb')](_0x37c861,_0x1713f5)['then'](function(_0x1b4287){logger['info']('SugarcrmAccount,\x20%s,\x20%s',_0x22974d,'request\x20sent');logger['debug']('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x22974d,'request\x20sent',JSON[_0x8dd8('0xc')](_0x1b4287));if(_0x1b4287[_0x8dd8('0xd')]){if(_0x1b4287['error']['code']===0x1f4){logger[_0x8dd8('0xd')](_0x8dd8('0xe'),_0x22974d,_0x1b4287[_0x8dd8('0xd')][_0x8dd8('0xf')]);return _0x5d7eac(_0x1b4287[_0x8dd8('0xd')]['message']);}logger[_0x8dd8('0xd')]('SugarcrmAccount,\x20%s,\x20%s',_0x22974d,_0x1b4287[_0x8dd8('0xd')][_0x8dd8('0xf')]);return _0xf346af(_0x1b4287[_0x8dd8('0xd')][_0x8dd8('0xf')]);}else{logger[_0x8dd8('0x10')](_0x8dd8('0xe'),_0x22974d,_0x8dd8('0x11'));_0xf346af(_0x1b4287['result'][_0x8dd8('0xf')]);}})['catch'](function(_0x53b064){logger[_0x8dd8('0xd')](_0x8dd8('0xe'),_0x22974d,_0x53b064);_0x5d7eac(_0x53b064);});});}exports[_0x8dd8('0x12')]=function(_0xe6bc87){var _0x49c83f=this;return new Promise(function(_0x1d020b,_0x2e4987){return db['SugarcrmAccount'][_0x8dd8('0x13')]({'raw':_0xe6bc87[_0x8dd8('0x14')]?_0xe6bc87[_0x8dd8('0x14')][_0x8dd8('0x15')]===undefined?!![]:![]:!![],'where':_0xe6bc87[_0x8dd8('0x14')]?_0xe6bc87['options'][_0x8dd8('0x16')]||null:null,'attributes':_0xe6bc87['options']?_0xe6bc87['options']['attributes']||null:null,'limit':_0xe6bc87[_0x8dd8('0x14')]?_0xe6bc87['options'][_0x8dd8('0x17')]||null:null,'include':_0xe6bc87['options']?_0xe6bc87[_0x8dd8('0x14')]['include']?_[_0x8dd8('0x18')](_0xe6bc87['options']['include'],function(_0x593609){return{'model':db[_0x593609[_0x8dd8('0x19')]],'as':_0x593609['as'],'attributes':_0x593609['attributes'],'include':_0x593609['include']?_[_0x8dd8('0x18')](_0x593609[_0x8dd8('0x1a')],function(_0x8b98b9){return{'model':db[_0x8b98b9['model']],'as':_0x8b98b9['as'],'attributes':_0x8b98b9[_0x8dd8('0x1b')],'include':_0x8b98b9[_0x8dd8('0x1a')]?_['map'](_0x8b98b9[_0x8dd8('0x1a')],function(_0x3fb373){return{'model':db[_0x3fb373[_0x8dd8('0x19')]],'as':_0x3fb373['as'],'attributes':_0x3fb373[_0x8dd8('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x8dd8('0x1c')](function(_0x1908a5){logger[_0x8dd8('0x10')](_0x8dd8('0x12'),_0xe6bc87);logger[_0x8dd8('0x1d')](_0x8dd8('0x12'),_0xe6bc87,JSON['stringify'](_0x1908a5));_0x1d020b(_0x1908a5);})['catch'](function(_0x190856){logger[_0x8dd8('0xd')]('GetSugarcrmAccount',_0x190856[_0x8dd8('0xf')],_0xe6bc87);_0x2e4987(_0x49c83f[_0x8dd8('0xd')](0x1f4,_0x190856['message']));});});};exports[_0x8dd8('0x1e')]=function(_0x5b3837){var _0x12b53f=this;return new Promise(function(_0x223937,_0x3a5221){return db[_0x8dd8('0x1f')][_0x8dd8('0x20')]({'raw':_0x5b3837[_0x8dd8('0x14')]?_0x5b3837[_0x8dd8('0x14')][_0x8dd8('0x15')]===undefined?!![]:![]:!![],'where':_0x5b3837[_0x8dd8('0x14')]?_0x5b3837[_0x8dd8('0x14')][_0x8dd8('0x16')]||null:null,'attributes':_0x5b3837[_0x8dd8('0x14')]?_0x5b3837[_0x8dd8('0x14')]['attributes']||null:null,'include':_0x5b3837['options']?_0x5b3837[_0x8dd8('0x14')][_0x8dd8('0x1a')]?_[_0x8dd8('0x18')](_0x5b3837['options']['include'],function(_0x49b699){return{'model':db[_0x49b699[_0x8dd8('0x19')]],'as':_0x49b699['as'],'attributes':_0x49b699[_0x8dd8('0x1b')],'include':_0x49b699[_0x8dd8('0x1a')]?_[_0x8dd8('0x18')](_0x49b699[_0x8dd8('0x1a')],function(_0x53d2de){return{'model':db[_0x53d2de[_0x8dd8('0x19')]],'as':_0x53d2de['as'],'attributes':_0x53d2de[_0x8dd8('0x1b')],'include':_0x53d2de[_0x8dd8('0x1a')]?_['map'](_0x53d2de[_0x8dd8('0x1a')],function(_0x24470f){return{'model':db[_0x24470f[_0x8dd8('0x19')]],'as':_0x24470f['as'],'attributes':_0x24470f[_0x8dd8('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x8dd8('0x1c')](function(_0xafce69){logger[_0x8dd8('0x10')](_0x8dd8('0x1e'),_0x5b3837);logger[_0x8dd8('0x1d')]('ShowSugarcrmAccount',_0x5b3837,JSON[_0x8dd8('0xc')](_0xafce69));_0x223937(_0xafce69);})[_0x8dd8('0x21')](function(_0x20bc96){logger[_0x8dd8('0xd')]('ShowSugarcrmAccount',_0x20bc96[_0x8dd8('0xf')],_0x5b3837);_0x3a5221(_0x12b53f[_0x8dd8('0xd')](0x1f4,_0x20bc96[_0x8dd8('0xf')]));});});};
\ No newline at end of file