Built motion from commit 980b26c3.|2.6.29
[motion2.git] / server / api / intSugarcrmAccount / intSugarcrmAccount.rpc.js
index 0e04612..1a510fe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5b11=['attributes','include','map','model','debug','stringify','ShowSugarcrmAccount','SugarcrmAccount','find','raw','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','SugarcrmAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetSugarcrmAccount','findAll','options','where'];(function(_0x1caae3,_0x36281c){var _0x2bb89d=function(_0x1aa559){while(--_0x1aa559){_0x1caae3['push'](_0x1caae3['shift']());}};_0x2bb89d(++_0x36281c);}(_0x5b11,0x172));var _0x15b1=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x5b11[_0x4b055c];return _0x4b62bb;};'use strict';var _=require('lodash');var util=require(_0x15b1('0x0'));var moment=require(_0x15b1('0x1'));var BPromise=require(_0x15b1('0x2'));var rs=require(_0x15b1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x15b1('0x4'));var logger=require(_0x15b1('0x5'))(_0x15b1('0x6'));var config=require(_0x15b1('0x7'));var jayson=require(_0x15b1('0x8'));var client=jayson[_0x15b1('0x9')][_0x15b1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x284b38,_0x2655cc,_0x2a3266){return new BPromise(function(_0x3ff400,_0x226323){return client[_0x15b1('0xb')](_0x284b38,_0x2a3266)[_0x15b1('0xc')](function(_0x2fdc32){logger[_0x15b1('0xd')](_0x15b1('0xe'),_0x2655cc,_0x15b1('0xf'));logger['debug'](_0x15b1('0x10'),_0x2655cc,_0x15b1('0xf'),JSON['stringify'](_0x2fdc32));if(_0x2fdc32[_0x15b1('0x11')]){if(_0x2fdc32[_0x15b1('0x11')][_0x15b1('0x12')]===0x1f4){logger[_0x15b1('0x11')](_0x15b1('0xe'),_0x2655cc,_0x2fdc32[_0x15b1('0x11')][_0x15b1('0x13')]);return _0x226323(_0x2fdc32['error']['message']);}logger[_0x15b1('0x11')](_0x15b1('0xe'),_0x2655cc,_0x2fdc32[_0x15b1('0x11')]['message']);return _0x3ff400(_0x2fdc32[_0x15b1('0x11')]['message']);}else{logger[_0x15b1('0xd')](_0x15b1('0xe'),_0x2655cc,'request\x20sent');_0x3ff400(_0x2fdc32[_0x15b1('0x14')]['message']);}})[_0x15b1('0x15')](function(_0x3cab1a){logger[_0x15b1('0x11')](_0x15b1('0xe'),_0x2655cc,_0x3cab1a);_0x226323(_0x3cab1a);});});}exports[_0x15b1('0x16')]=function(_0x33bfd9){var _0x54db06=this;return new Promise(function(_0x294d60,_0x22da06){return db['SugarcrmAccount'][_0x15b1('0x17')]({'raw':_0x33bfd9['options']?_0x33bfd9[_0x15b1('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x33bfd9[_0x15b1('0x18')]?_0x33bfd9[_0x15b1('0x18')][_0x15b1('0x19')]||null:null,'attributes':_0x33bfd9[_0x15b1('0x18')]?_0x33bfd9['options'][_0x15b1('0x1a')]||null:null,'limit':_0x33bfd9[_0x15b1('0x18')]?_0x33bfd9[_0x15b1('0x18')]['limit']||null:null,'include':_0x33bfd9[_0x15b1('0x18')]?_0x33bfd9[_0x15b1('0x18')][_0x15b1('0x1b')]?_[_0x15b1('0x1c')](_0x33bfd9[_0x15b1('0x18')][_0x15b1('0x1b')],function(_0x3667f){return{'model':db[_0x3667f[_0x15b1('0x1d')]],'as':_0x3667f['as'],'attributes':_0x3667f['attributes'],'include':_0x3667f[_0x15b1('0x1b')]?_[_0x15b1('0x1c')](_0x3667f[_0x15b1('0x1b')],function(_0x441c1c){return{'model':db[_0x441c1c['model']],'as':_0x441c1c['as'],'attributes':_0x441c1c[_0x15b1('0x1a')],'include':_0x441c1c[_0x15b1('0x1b')]?_[_0x15b1('0x1c')](_0x441c1c[_0x15b1('0x1b')],function(_0x59d49c){return{'model':db[_0x59d49c[_0x15b1('0x1d')]],'as':_0x59d49c['as'],'attributes':_0x59d49c[_0x15b1('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x15b1('0xc')](function(_0x108b5f){logger[_0x15b1('0xd')](_0x15b1('0x16'),_0x33bfd9);logger[_0x15b1('0x1e')](_0x15b1('0x16'),_0x33bfd9,JSON[_0x15b1('0x1f')](_0x108b5f));_0x294d60(_0x108b5f);})[_0x15b1('0x15')](function(_0x3faa98){logger[_0x15b1('0x11')](_0x15b1('0x16'),_0x3faa98[_0x15b1('0x13')],_0x33bfd9);_0x22da06(_0x54db06['error'](0x1f4,_0x3faa98[_0x15b1('0x13')]));});});};exports[_0x15b1('0x20')]=function(_0xae6ca3){var _0x31a95f=this;return new Promise(function(_0x2d15be,_0x3eda77){return db[_0x15b1('0x21')][_0x15b1('0x22')]({'raw':_0xae6ca3[_0x15b1('0x18')]?_0xae6ca3[_0x15b1('0x18')][_0x15b1('0x23')]===undefined?!![]:![]:!![],'where':_0xae6ca3[_0x15b1('0x18')]?_0xae6ca3[_0x15b1('0x18')]['where']||null:null,'attributes':_0xae6ca3['options']?_0xae6ca3[_0x15b1('0x18')][_0x15b1('0x1a')]||null:null,'include':_0xae6ca3['options']?_0xae6ca3[_0x15b1('0x18')][_0x15b1('0x1b')]?_[_0x15b1('0x1c')](_0xae6ca3[_0x15b1('0x18')]['include'],function(_0x4ba4ea){return{'model':db[_0x4ba4ea['model']],'as':_0x4ba4ea['as'],'attributes':_0x4ba4ea['attributes'],'include':_0x4ba4ea[_0x15b1('0x1b')]?_[_0x15b1('0x1c')](_0x4ba4ea[_0x15b1('0x1b')],function(_0x36d421){return{'model':db[_0x36d421[_0x15b1('0x1d')]],'as':_0x36d421['as'],'attributes':_0x36d421['attributes'],'include':_0x36d421[_0x15b1('0x1b')]?_['map'](_0x36d421['include'],function(_0x1fff2f){return{'model':db[_0x1fff2f[_0x15b1('0x1d')]],'as':_0x1fff2f['as'],'attributes':_0x1fff2f['attributes']};}):[]};}):[]};}):[]:[]})[_0x15b1('0xc')](function(_0x1a735e){logger[_0x15b1('0xd')](_0x15b1('0x20'),_0xae6ca3);logger['debug']('ShowSugarcrmAccount',_0xae6ca3,JSON[_0x15b1('0x1f')](_0x1a735e));_0x2d15be(_0x1a735e);})[_0x15b1('0x15')](function(_0x482ca8){logger['error'](_0x15b1('0x20'),_0x482ca8['message'],_0xae6ca3);_0x3eda77(_0x31a95f['error'](0x1f4,_0x482ca8[_0x15b1('0x13')]));});});};
\ No newline at end of file
+var _0x89cf=['SugarcrmAccount','findAll','options','raw','where','attributes','limit','include','map','model','then','ShowSugarcrmAccount','find','info','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetSugarcrmAccount'];(function(_0x3df21c,_0x4092b6){var _0x5b48d3=function(_0x2364f3){while(--_0x2364f3){_0x3df21c['push'](_0x3df21c['shift']());}};_0x5b48d3(++_0x4092b6);}(_0x89cf,0x1ef));var _0xf89c=function(_0x33e402,_0x670be3){_0x33e402=_0x33e402-0x0;var _0x56f8a0=_0x89cf[_0x33e402];return _0x56f8a0;};'use strict';var _=require(_0xf89c('0x0'));var util=require(_0xf89c('0x1'));var moment=require('moment');var BPromise=require(_0xf89c('0x2'));var rs=require(_0xf89c('0x3'));var fs=require('fs');var Redis=require(_0xf89c('0x4'));var db=require(_0xf89c('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf89c('0x6'))(_0xf89c('0x7'));var config=require(_0xf89c('0x8'));var jayson=require(_0xf89c('0x9'));var client=jayson[_0xf89c('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ab9e0,_0x148cd9,_0x483427){return new BPromise(function(_0x29f8a7,_0x3a6bf6){return client[_0xf89c('0xb')](_0x4ab9e0,_0x483427)['then'](function(_0x7910cb){logger['info'](_0xf89c('0xc'),_0x148cd9,_0xf89c('0xd'));logger[_0xf89c('0xe')](_0xf89c('0xf'),_0x148cd9,'request\x20sent',JSON[_0xf89c('0x10')](_0x7910cb));if(_0x7910cb[_0xf89c('0x11')]){if(_0x7910cb['error'][_0xf89c('0x12')]===0x1f4){logger[_0xf89c('0x11')](_0xf89c('0xc'),_0x148cd9,_0x7910cb[_0xf89c('0x11')]['message']);return _0x3a6bf6(_0x7910cb[_0xf89c('0x11')][_0xf89c('0x13')]);}logger[_0xf89c('0x11')]('SugarcrmAccount,\x20%s,\x20%s',_0x148cd9,_0x7910cb[_0xf89c('0x11')]['message']);return _0x29f8a7(_0x7910cb['error']['message']);}else{logger['info'](_0xf89c('0xc'),_0x148cd9,'request\x20sent');_0x29f8a7(_0x7910cb[_0xf89c('0x14')][_0xf89c('0x13')]);}})[_0xf89c('0x15')](function(_0x5c1775){logger[_0xf89c('0x11')](_0xf89c('0xc'),_0x148cd9,_0x5c1775);_0x3a6bf6(_0x5c1775);});});}exports[_0xf89c('0x16')]=function(_0x324c91){var _0x6f1427=this;return new Promise(function(_0x283bfe,_0x2d858a){return db[_0xf89c('0x17')][_0xf89c('0x18')]({'raw':_0x324c91[_0xf89c('0x19')]?_0x324c91[_0xf89c('0x19')][_0xf89c('0x1a')]===undefined?!![]:![]:!![],'where':_0x324c91[_0xf89c('0x19')]?_0x324c91[_0xf89c('0x19')][_0xf89c('0x1b')]||null:null,'attributes':_0x324c91[_0xf89c('0x19')]?_0x324c91[_0xf89c('0x19')][_0xf89c('0x1c')]||null:null,'limit':_0x324c91[_0xf89c('0x19')]?_0x324c91[_0xf89c('0x19')][_0xf89c('0x1d')]||null:null,'include':_0x324c91[_0xf89c('0x19')]?_0x324c91[_0xf89c('0x19')][_0xf89c('0x1e')]?_[_0xf89c('0x1f')](_0x324c91[_0xf89c('0x19')][_0xf89c('0x1e')],function(_0xb0cdcb){return{'model':db[_0xb0cdcb[_0xf89c('0x20')]],'as':_0xb0cdcb['as'],'attributes':_0xb0cdcb[_0xf89c('0x1c')],'include':_0xb0cdcb['include']?_[_0xf89c('0x1f')](_0xb0cdcb[_0xf89c('0x1e')],function(_0x3b9220){return{'model':db[_0x3b9220[_0xf89c('0x20')]],'as':_0x3b9220['as'],'attributes':_0x3b9220[_0xf89c('0x1c')],'include':_0x3b9220[_0xf89c('0x1e')]?_[_0xf89c('0x1f')](_0x3b9220[_0xf89c('0x1e')],function(_0x55e821){return{'model':db[_0x55e821[_0xf89c('0x20')]],'as':_0x55e821['as'],'attributes':_0x55e821[_0xf89c('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xf89c('0x21')](function(_0xb2d720){logger['info'](_0xf89c('0x16'),_0x324c91);logger[_0xf89c('0xe')](_0xf89c('0x16'),_0x324c91,JSON[_0xf89c('0x10')](_0xb2d720));_0x283bfe(_0xb2d720);})[_0xf89c('0x15')](function(_0x426847){logger[_0xf89c('0x11')](_0xf89c('0x16'),_0x426847[_0xf89c('0x13')],_0x324c91);_0x2d858a(_0x6f1427[_0xf89c('0x11')](0x1f4,_0x426847[_0xf89c('0x13')]));});});};exports[_0xf89c('0x22')]=function(_0x17f752){var _0x1a2557=this;return new Promise(function(_0x518646,_0x4eab06){return db[_0xf89c('0x17')][_0xf89c('0x23')]({'raw':_0x17f752[_0xf89c('0x19')]?_0x17f752[_0xf89c('0x19')][_0xf89c('0x1a')]===undefined?!![]:![]:!![],'where':_0x17f752[_0xf89c('0x19')]?_0x17f752[_0xf89c('0x19')][_0xf89c('0x1b')]||null:null,'attributes':_0x17f752[_0xf89c('0x19')]?_0x17f752[_0xf89c('0x19')]['attributes']||null:null,'include':_0x17f752['options']?_0x17f752[_0xf89c('0x19')][_0xf89c('0x1e')]?_['map'](_0x17f752['options'][_0xf89c('0x1e')],function(_0x2d695f){return{'model':db[_0x2d695f['model']],'as':_0x2d695f['as'],'attributes':_0x2d695f[_0xf89c('0x1c')],'include':_0x2d695f[_0xf89c('0x1e')]?_[_0xf89c('0x1f')](_0x2d695f[_0xf89c('0x1e')],function(_0xe0fd3f){return{'model':db[_0xe0fd3f[_0xf89c('0x20')]],'as':_0xe0fd3f['as'],'attributes':_0xe0fd3f['attributes'],'include':_0xe0fd3f[_0xf89c('0x1e')]?_[_0xf89c('0x1f')](_0xe0fd3f[_0xf89c('0x1e')],function(_0x2b3e62){return{'model':db[_0x2b3e62[_0xf89c('0x20')]],'as':_0x2b3e62['as'],'attributes':_0x2b3e62[_0xf89c('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xf89c('0x21')](function(_0x4dd808){logger[_0xf89c('0x24')](_0xf89c('0x22'),_0x17f752);logger[_0xf89c('0xe')](_0xf89c('0x22'),_0x17f752,JSON['stringify'](_0x4dd808));_0x518646(_0x4dd808);})[_0xf89c('0x15')](function(_0x2ae711){logger[_0xf89c('0x11')](_0xf89c('0x22'),_0x2ae711['message'],_0x17f752);_0x4eab06(_0x1a2557['error'](0x1f4,_0x2ae711[_0xf89c('0x13')]));});});};
\ No newline at end of file