Built motion from commit 6a0adb95.|2.6.31
[motion2.git] / server / api / intSugarcrmAccount / intSugarcrmAccount.rpc.js
index a8e01f1..42392bf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2602=['include','map','model','debug','stringify','ShowSugarcrmAccount','find','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','SugarcrmAccount,\x20%s,\x20%s,\x20%s','error','message','catch','GetSugarcrmAccount','SugarcrmAccount','findAll','options','where','attributes'];(function(_0x2b672f,_0xe4bca4){var _0x2eabbe=function(_0x4f290e){while(--_0x4f290e){_0x2b672f['push'](_0x2b672f['shift']());}};_0x2eabbe(++_0xe4bca4);}(_0x2602,0x127));var _0x2260=function(_0x56a8b8,_0x344ea3){_0x56a8b8=_0x56a8b8-0x0;var _0x353df1=_0x2602[_0x56a8b8];return _0x353df1;};'use strict';var _=require(_0x2260('0x0'));var util=require(_0x2260('0x1'));var moment=require(_0x2260('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2260('0x3'));var db=require(_0x2260('0x4'))['db'];var utils=require(_0x2260('0x5'));var logger=require(_0x2260('0x6'))('rpc');var config=require(_0x2260('0x7'));var jayson=require(_0x2260('0x8'));var client=jayson[_0x2260('0x9')][_0x2260('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x18a3e9,_0x4e2265,_0x34566c){return new BPromise(function(_0x10ea00,_0x47555c){return client['request'](_0x18a3e9,_0x34566c)[_0x2260('0xb')](function(_0x1701ec){logger[_0x2260('0xc')](_0x2260('0xd'),_0x4e2265,_0x2260('0xe'));logger['debug'](_0x2260('0xf'),_0x4e2265,_0x2260('0xe'),JSON['stringify'](_0x1701ec));if(_0x1701ec[_0x2260('0x10')]){if(_0x1701ec[_0x2260('0x10')]['code']===0x1f4){logger[_0x2260('0x10')](_0x2260('0xd'),_0x4e2265,_0x1701ec[_0x2260('0x10')][_0x2260('0x11')]);return _0x47555c(_0x1701ec[_0x2260('0x10')][_0x2260('0x11')]);}logger['error'](_0x2260('0xd'),_0x4e2265,_0x1701ec['error']['message']);return _0x10ea00(_0x1701ec[_0x2260('0x10')]['message']);}else{logger[_0x2260('0xc')](_0x2260('0xd'),_0x4e2265,_0x2260('0xe'));_0x10ea00(_0x1701ec['result'][_0x2260('0x11')]);}})[_0x2260('0x12')](function(_0x187ed8){logger[_0x2260('0x10')](_0x2260('0xd'),_0x4e2265,_0x187ed8);_0x47555c(_0x187ed8);});});}exports[_0x2260('0x13')]=function(_0x1f1e0d){var _0x4c2251=this;return new Promise(function(_0x3ba843,_0x149f72){return db[_0x2260('0x14')][_0x2260('0x15')]({'raw':_0x1f1e0d[_0x2260('0x16')]?_0x1f1e0d[_0x2260('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x1f1e0d[_0x2260('0x16')]?_0x1f1e0d[_0x2260('0x16')][_0x2260('0x17')]||null:null,'attributes':_0x1f1e0d[_0x2260('0x16')]?_0x1f1e0d['options'][_0x2260('0x18')]||null:null,'limit':_0x1f1e0d['options']?_0x1f1e0d[_0x2260('0x16')]['limit']||null:null,'include':_0x1f1e0d[_0x2260('0x16')]?_0x1f1e0d[_0x2260('0x16')][_0x2260('0x19')]?_[_0x2260('0x1a')](_0x1f1e0d[_0x2260('0x16')]['include'],function(_0x1e2ae7){return{'model':db[_0x1e2ae7[_0x2260('0x1b')]],'as':_0x1e2ae7['as'],'attributes':_0x1e2ae7[_0x2260('0x18')],'include':_0x1e2ae7[_0x2260('0x19')]?_['map'](_0x1e2ae7[_0x2260('0x19')],function(_0x45d84d){return{'model':db[_0x45d84d[_0x2260('0x1b')]],'as':_0x45d84d['as'],'attributes':_0x45d84d['attributes'],'include':_0x45d84d[_0x2260('0x19')]?_[_0x2260('0x1a')](_0x45d84d[_0x2260('0x19')],function(_0x5d41ba){return{'model':db[_0x5d41ba['model']],'as':_0x5d41ba['as'],'attributes':_0x5d41ba[_0x2260('0x18')]};}):[]};}):[]};}):[]:[]})[_0x2260('0xb')](function(_0x4bad1d){logger[_0x2260('0xc')]('GetSugarcrmAccount',_0x1f1e0d);logger[_0x2260('0x1c')](_0x2260('0x13'),_0x1f1e0d,JSON[_0x2260('0x1d')](_0x4bad1d));_0x3ba843(_0x4bad1d);})[_0x2260('0x12')](function(_0x32326b){logger[_0x2260('0x10')](_0x2260('0x13'),_0x32326b[_0x2260('0x11')],_0x1f1e0d);_0x149f72(_0x4c2251[_0x2260('0x10')](0x1f4,_0x32326b[_0x2260('0x11')]));});});};exports[_0x2260('0x1e')]=function(_0x4b60a9){var _0x40420f=this;return new Promise(function(_0x5565b,_0x1850a5){return db[_0x2260('0x14')][_0x2260('0x1f')]({'raw':_0x4b60a9[_0x2260('0x16')]?_0x4b60a9[_0x2260('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x4b60a9[_0x2260('0x16')]?_0x4b60a9[_0x2260('0x16')][_0x2260('0x17')]||null:null,'attributes':_0x4b60a9['options']?_0x4b60a9[_0x2260('0x16')][_0x2260('0x18')]||null:null,'include':_0x4b60a9[_0x2260('0x16')]?_0x4b60a9[_0x2260('0x16')][_0x2260('0x19')]?_[_0x2260('0x1a')](_0x4b60a9['options']['include'],function(_0x58ab5b){return{'model':db[_0x58ab5b['model']],'as':_0x58ab5b['as'],'attributes':_0x58ab5b[_0x2260('0x18')],'include':_0x58ab5b[_0x2260('0x19')]?_[_0x2260('0x1a')](_0x58ab5b[_0x2260('0x19')],function(_0x420b11){return{'model':db[_0x420b11['model']],'as':_0x420b11['as'],'attributes':_0x420b11[_0x2260('0x18')],'include':_0x420b11[_0x2260('0x19')]?_[_0x2260('0x1a')](_0x420b11[_0x2260('0x19')],function(_0x1e82fa){return{'model':db[_0x1e82fa[_0x2260('0x1b')]],'as':_0x1e82fa['as'],'attributes':_0x1e82fa['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5cb4dd){logger[_0x2260('0xc')]('ShowSugarcrmAccount',_0x4b60a9);logger['debug'](_0x2260('0x1e'),_0x4b60a9,JSON[_0x2260('0x1d')](_0x5cb4dd));_0x5565b(_0x5cb4dd);})[_0x2260('0x12')](function(_0x22c007){logger[_0x2260('0x10')](_0x2260('0x1e'),_0x22c007['message'],_0x4b60a9);_0x1850a5(_0x40420f['error'](0x1f4,_0x22c007[_0x2260('0x11')]));});});};
\ No newline at end of file
+var _0x6b15=['where','attributes','limit','include','map','model','find','then','ShowSugarcrmAccount','stringify','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','error','code','SugarcrmAccount,\x20%s,\x20%s','message','result','catch','GetSugarcrmAccount','SugarcrmAccount','findAll','options','raw'];(function(_0x5b78e8,_0x55096b){var _0xf2c321=function(_0x4e0cff){while(--_0x4e0cff){_0x5b78e8['push'](_0x5b78e8['shift']());}};_0xf2c321(++_0x55096b);}(_0x6b15,0x132));var _0x56b1=function(_0x155038,_0x91f83e){_0x155038=_0x155038-0x0;var _0x1a6685=_0x6b15[_0x155038];return _0x1a6685;};'use strict';var _=require('lodash');var util=require(_0x56b1('0x0'));var moment=require(_0x56b1('0x1'));var BPromise=require(_0x56b1('0x2'));var rs=require(_0x56b1('0x3'));var fs=require('fs');var Redis=require(_0x56b1('0x4'));var db=require(_0x56b1('0x5'))['db'];var utils=require(_0x56b1('0x6'));var logger=require(_0x56b1('0x7'))(_0x56b1('0x8'));var config=require(_0x56b1('0x9'));var jayson=require(_0x56b1('0xa'));var client=jayson[_0x56b1('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0xae3304,_0x2a626c,_0x2b2cf7){return new BPromise(function(_0x5bf0ab,_0x52ecc6){return client['request'](_0xae3304,_0x2b2cf7)['then'](function(_0x5a5056){logger[_0x56b1('0xc')]('SugarcrmAccount,\x20%s,\x20%s',_0x2a626c,_0x56b1('0xd'));logger[_0x56b1('0xe')](_0x56b1('0xf'),_0x2a626c,_0x56b1('0xd'),JSON['stringify'](_0x5a5056));if(_0x5a5056[_0x56b1('0x10')]){if(_0x5a5056[_0x56b1('0x10')][_0x56b1('0x11')]===0x1f4){logger[_0x56b1('0x10')](_0x56b1('0x12'),_0x2a626c,_0x5a5056[_0x56b1('0x10')][_0x56b1('0x13')]);return _0x52ecc6(_0x5a5056[_0x56b1('0x10')][_0x56b1('0x13')]);}logger[_0x56b1('0x10')](_0x56b1('0x12'),_0x2a626c,_0x5a5056['error'][_0x56b1('0x13')]);return _0x5bf0ab(_0x5a5056['error'][_0x56b1('0x13')]);}else{logger[_0x56b1('0xc')]('SugarcrmAccount,\x20%s,\x20%s',_0x2a626c,_0x56b1('0xd'));_0x5bf0ab(_0x5a5056[_0x56b1('0x14')][_0x56b1('0x13')]);}})[_0x56b1('0x15')](function(_0x362e94){logger['error']('SugarcrmAccount,\x20%s,\x20%s',_0x2a626c,_0x362e94);_0x52ecc6(_0x362e94);});});}exports[_0x56b1('0x16')]=function(_0x869eeb){var _0x57c0dc=this;return new Promise(function(_0x1abc38,_0xea9c46){return db[_0x56b1('0x17')][_0x56b1('0x18')]({'raw':_0x869eeb[_0x56b1('0x19')]?_0x869eeb[_0x56b1('0x19')][_0x56b1('0x1a')]===undefined?!![]:![]:!![],'where':_0x869eeb['options']?_0x869eeb['options'][_0x56b1('0x1b')]||null:null,'attributes':_0x869eeb['options']?_0x869eeb['options'][_0x56b1('0x1c')]||null:null,'limit':_0x869eeb[_0x56b1('0x19')]?_0x869eeb[_0x56b1('0x19')][_0x56b1('0x1d')]||null:null,'include':_0x869eeb[_0x56b1('0x19')]?_0x869eeb[_0x56b1('0x19')][_0x56b1('0x1e')]?_[_0x56b1('0x1f')](_0x869eeb[_0x56b1('0x19')][_0x56b1('0x1e')],function(_0x3ffb95){return{'model':db[_0x3ffb95[_0x56b1('0x20')]],'as':_0x3ffb95['as'],'attributes':_0x3ffb95[_0x56b1('0x1c')],'include':_0x3ffb95[_0x56b1('0x1e')]?_[_0x56b1('0x1f')](_0x3ffb95[_0x56b1('0x1e')],function(_0x9630f8){return{'model':db[_0x9630f8['model']],'as':_0x9630f8['as'],'attributes':_0x9630f8[_0x56b1('0x1c')],'include':_0x9630f8['include']?_[_0x56b1('0x1f')](_0x9630f8[_0x56b1('0x1e')],function(_0x3f9d63){return{'model':db[_0x3f9d63[_0x56b1('0x20')]],'as':_0x3f9d63['as'],'attributes':_0x3f9d63[_0x56b1('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x16f7a1){logger[_0x56b1('0xc')](_0x56b1('0x16'),_0x869eeb);logger[_0x56b1('0xe')](_0x56b1('0x16'),_0x869eeb,JSON['stringify'](_0x16f7a1));_0x1abc38(_0x16f7a1);})[_0x56b1('0x15')](function(_0x3320a7){logger['error'](_0x56b1('0x16'),_0x3320a7['message'],_0x869eeb);_0xea9c46(_0x57c0dc[_0x56b1('0x10')](0x1f4,_0x3320a7[_0x56b1('0x13')]));});});};exports['ShowSugarcrmAccount']=function(_0x2aa468){var _0x961a2d=this;return new Promise(function(_0x282b33,_0x3f129c){return db[_0x56b1('0x17')][_0x56b1('0x21')]({'raw':_0x2aa468[_0x56b1('0x19')]?_0x2aa468[_0x56b1('0x19')][_0x56b1('0x1a')]===undefined?!![]:![]:!![],'where':_0x2aa468[_0x56b1('0x19')]?_0x2aa468['options'][_0x56b1('0x1b')]||null:null,'attributes':_0x2aa468['options']?_0x2aa468['options'][_0x56b1('0x1c')]||null:null,'include':_0x2aa468[_0x56b1('0x19')]?_0x2aa468['options']['include']?_[_0x56b1('0x1f')](_0x2aa468[_0x56b1('0x19')][_0x56b1('0x1e')],function(_0x55c629){return{'model':db[_0x55c629[_0x56b1('0x20')]],'as':_0x55c629['as'],'attributes':_0x55c629[_0x56b1('0x1c')],'include':_0x55c629[_0x56b1('0x1e')]?_[_0x56b1('0x1f')](_0x55c629[_0x56b1('0x1e')],function(_0x267e28){return{'model':db[_0x267e28[_0x56b1('0x20')]],'as':_0x267e28['as'],'attributes':_0x267e28['attributes'],'include':_0x267e28[_0x56b1('0x1e')]?_['map'](_0x267e28[_0x56b1('0x1e')],function(_0x3beea2){return{'model':db[_0x3beea2[_0x56b1('0x20')]],'as':_0x3beea2['as'],'attributes':_0x3beea2[_0x56b1('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x56b1('0x22')](function(_0x274b8b){logger[_0x56b1('0xc')]('ShowSugarcrmAccount',_0x2aa468);logger[_0x56b1('0xe')](_0x56b1('0x23'),_0x2aa468,JSON[_0x56b1('0x24')](_0x274b8b));_0x282b33(_0x274b8b);})['catch'](function(_0x3e0690){logger[_0x56b1('0x10')](_0x56b1('0x23'),_0x3e0690[_0x56b1('0x13')],_0x2aa468);_0x3f129c(_0x961a2d[_0x56b1('0x10')](0x1f4,_0x3e0690[_0x56b1('0x13')]));});});};
\ No newline at end of file