Built motion from commit 10af8726.|2.6.34
[motion2.git] / server / api / intSalesforceAccount / intSalesforceAccount.rpc.js
index 3eb0c2c..4bebfb8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5cc6=['randomstring','ioredis','rpc','../../config/environment','jayson/promise','http','request','then','info','SalesforceAccount,\x20%s,\x20%s','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','GetSalesforceAccount','SalesforceAccount','findAll','raw','options','where','attributes','limit','include','map','model','ShowSalesforceAccount','lodash','util','moment'];(function(_0x3401ce,_0x5d1579){var _0x1bb79d=function(_0x46985e){while(--_0x46985e){_0x3401ce['push'](_0x3401ce['shift']());}};_0x1bb79d(++_0x5d1579);}(_0x5cc6,0x13d));var _0x65cc=function(_0x199bc4,_0x338105){_0x199bc4=_0x199bc4-0x0;var _0x136ffb=_0x5cc6[_0x199bc4];return _0x136ffb;};'use strict';var _=require(_0x65cc('0x0'));var util=require(_0x65cc('0x1'));var moment=require(_0x65cc('0x2'));var BPromise=require('bluebird');var rs=require(_0x65cc('0x3'));var fs=require('fs');var Redis=require(_0x65cc('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x65cc('0x5'));var config=require(_0x65cc('0x6'));var jayson=require(_0x65cc('0x7'));var client=jayson['client'][_0x65cc('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x503655,_0x31aaed,_0x3601b0){return new BPromise(function(_0x397737,_0x1d494c){return client[_0x65cc('0x9')](_0x503655,_0x3601b0)[_0x65cc('0xa')](function(_0x31b3c4){logger[_0x65cc('0xb')](_0x65cc('0xc'),_0x31aaed,'request\x20sent');logger[_0x65cc('0xd')](_0x65cc('0xe'),_0x31aaed,_0x65cc('0xf'),JSON[_0x65cc('0x10')](_0x31b3c4));if(_0x31b3c4['error']){if(_0x31b3c4['error']['code']===0x1f4){logger['error'](_0x65cc('0xc'),_0x31aaed,_0x31b3c4[_0x65cc('0x11')][_0x65cc('0x12')]);return _0x1d494c(_0x31b3c4[_0x65cc('0x11')][_0x65cc('0x12')]);}logger['error'](_0x65cc('0xc'),_0x31aaed,_0x31b3c4['error'][_0x65cc('0x12')]);return _0x397737(_0x31b3c4[_0x65cc('0x11')][_0x65cc('0x12')]);}else{logger[_0x65cc('0xb')](_0x65cc('0xc'),_0x31aaed,'request\x20sent');_0x397737(_0x31b3c4['result']['message']);}})[_0x65cc('0x13')](function(_0x5a9c29){logger[_0x65cc('0x11')](_0x65cc('0xc'),_0x31aaed,_0x5a9c29);_0x1d494c(_0x5a9c29);});});}exports[_0x65cc('0x14')]=function(_0x5bfc0e){var _0x114560=this;return new Promise(function(_0x7d5685,_0x13e52e){return db[_0x65cc('0x15')][_0x65cc('0x16')]({'raw':_0x5bfc0e['options']?_0x5bfc0e['options'][_0x65cc('0x17')]===undefined?!![]:![]:!![],'where':_0x5bfc0e[_0x65cc('0x18')]?_0x5bfc0e[_0x65cc('0x18')][_0x65cc('0x19')]||null:null,'attributes':_0x5bfc0e['options']?_0x5bfc0e[_0x65cc('0x18')][_0x65cc('0x1a')]||null:null,'limit':_0x5bfc0e[_0x65cc('0x18')]?_0x5bfc0e[_0x65cc('0x18')][_0x65cc('0x1b')]||null:null,'include':_0x5bfc0e[_0x65cc('0x18')]?_0x5bfc0e[_0x65cc('0x18')][_0x65cc('0x1c')]?_[_0x65cc('0x1d')](_0x5bfc0e['options'][_0x65cc('0x1c')],function(_0xc2fcd8){return{'model':db[_0xc2fcd8[_0x65cc('0x1e')]],'as':_0xc2fcd8['as'],'attributes':_0xc2fcd8[_0x65cc('0x1a')],'include':_0xc2fcd8['include']?_[_0x65cc('0x1d')](_0xc2fcd8[_0x65cc('0x1c')],function(_0x1a014b){return{'model':db[_0x1a014b[_0x65cc('0x1e')]],'as':_0x1a014b['as'],'attributes':_0x1a014b[_0x65cc('0x1a')],'include':_0x1a014b['include']?_[_0x65cc('0x1d')](_0x1a014b['include'],function(_0x403a0f){return{'model':db[_0x403a0f[_0x65cc('0x1e')]],'as':_0x403a0f['as'],'attributes':_0x403a0f[_0x65cc('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x65cc('0xa')](function(_0x442a41){logger['info'](_0x65cc('0x14'),_0x5bfc0e);logger[_0x65cc('0xd')](_0x65cc('0x14'),_0x5bfc0e,JSON[_0x65cc('0x10')](_0x442a41));_0x7d5685(_0x442a41);})[_0x65cc('0x13')](function(_0x20c07f){logger[_0x65cc('0x11')](_0x65cc('0x14'),_0x20c07f[_0x65cc('0x12')],_0x5bfc0e);_0x13e52e(_0x114560[_0x65cc('0x11')](0x1f4,_0x20c07f[_0x65cc('0x12')]));});});};exports[_0x65cc('0x1f')]=function(_0x23ee54){var _0x23cfb5=this;return new Promise(function(_0x208c5a,_0x49bbd8){return db[_0x65cc('0x15')]['find']({'raw':_0x23ee54[_0x65cc('0x18')]?_0x23ee54[_0x65cc('0x18')][_0x65cc('0x17')]===undefined?!![]:![]:!![],'where':_0x23ee54[_0x65cc('0x18')]?_0x23ee54[_0x65cc('0x18')][_0x65cc('0x19')]||null:null,'attributes':_0x23ee54['options']?_0x23ee54[_0x65cc('0x18')]['attributes']||null:null,'include':_0x23ee54['options']?_0x23ee54[_0x65cc('0x18')][_0x65cc('0x1c')]?_[_0x65cc('0x1d')](_0x23ee54['options']['include'],function(_0x49ee9d){return{'model':db[_0x49ee9d[_0x65cc('0x1e')]],'as':_0x49ee9d['as'],'attributes':_0x49ee9d[_0x65cc('0x1a')],'include':_0x49ee9d[_0x65cc('0x1c')]?_[_0x65cc('0x1d')](_0x49ee9d[_0x65cc('0x1c')],function(_0x14755f){return{'model':db[_0x14755f[_0x65cc('0x1e')]],'as':_0x14755f['as'],'attributes':_0x14755f[_0x65cc('0x1a')],'include':_0x14755f[_0x65cc('0x1c')]?_[_0x65cc('0x1d')](_0x14755f[_0x65cc('0x1c')],function(_0x5ef8fd){return{'model':db[_0x5ef8fd[_0x65cc('0x1e')]],'as':_0x5ef8fd['as'],'attributes':_0x5ef8fd[_0x65cc('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5b3559){logger['info'](_0x65cc('0x1f'),_0x23ee54);logger[_0x65cc('0xd')](_0x65cc('0x1f'),_0x23ee54,JSON[_0x65cc('0x10')](_0x5b3559));_0x208c5a(_0x5b3559);})[_0x65cc('0x13')](function(_0x552144){logger['error'](_0x65cc('0x1f'),_0x552144[_0x65cc('0x12')],_0x23ee54);_0x49bbd8(_0x23cfb5[_0x65cc('0x11')](0x1f4,_0x552144[_0x65cc('0x12')]));});});};
\ No newline at end of file
+var _0xd85e=['limit','include','map','model','attributes','ShowSalesforceAccount','lodash','util','moment','bluebird','../../config/logger','rpc','http','then','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','catch','GetSalesforceAccount','options','raw','where'];(function(_0x3be9da,_0x4113e8){var _0x392bf6=function(_0x573aa7){while(--_0x573aa7){_0x3be9da['push'](_0x3be9da['shift']());}};_0x392bf6(++_0x4113e8);}(_0xd85e,0x72));var _0xed85=function(_0x1b9ee2,_0x5cbd3e){_0x1b9ee2=_0x1b9ee2-0x0;var _0xdc1b94=_0xd85e[_0x1b9ee2];return _0xdc1b94;};'use strict';var _=require(_0xed85('0x0'));var util=require(_0xed85('0x1'));var moment=require(_0xed85('0x2'));var BPromise=require(_0xed85('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xed85('0x4'))(_0xed85('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xed85('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x1147e3,_0x50ca4b,_0x801c9c){return new BPromise(function(_0x1c1543,_0x25fe72){return client['request'](_0x1147e3,_0x801c9c)[_0xed85('0x7')](function(_0x4c1f31){logger['info'](_0xed85('0x8'),_0x50ca4b,_0xed85('0x9'));logger[_0xed85('0xa')]('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x50ca4b,'request\x20sent',JSON[_0xed85('0xb')](_0x4c1f31));if(_0x4c1f31['error']){if(_0x4c1f31[_0xed85('0xc')]['code']===0x1f4){logger[_0xed85('0xc')](_0xed85('0x8'),_0x50ca4b,_0x4c1f31[_0xed85('0xc')][_0xed85('0xd')]);return _0x25fe72(_0x4c1f31[_0xed85('0xc')][_0xed85('0xd')]);}logger[_0xed85('0xc')](_0xed85('0x8'),_0x50ca4b,_0x4c1f31[_0xed85('0xc')][_0xed85('0xd')]);return _0x1c1543(_0x4c1f31[_0xed85('0xc')][_0xed85('0xd')]);}else{logger[_0xed85('0xe')]('SalesforceAccount,\x20%s,\x20%s',_0x50ca4b,_0xed85('0x9'));_0x1c1543(_0x4c1f31[_0xed85('0xf')]['message']);}})[_0xed85('0x10')](function(_0x1816d3){logger[_0xed85('0xc')](_0xed85('0x8'),_0x50ca4b,_0x1816d3);_0x25fe72(_0x1816d3);});});}exports[_0xed85('0x11')]=function(_0x339707){var _0x234c55=this;return new Promise(function(_0x1dd1f2,_0x45208c){return db['SalesforceAccount']['findAll']({'raw':_0x339707[_0xed85('0x12')]?_0x339707['options'][_0xed85('0x13')]===undefined?!![]:![]:!![],'where':_0x339707[_0xed85('0x12')]?_0x339707['options'][_0xed85('0x14')]||null:null,'attributes':_0x339707[_0xed85('0x12')]?_0x339707['options']['attributes']||null:null,'limit':_0x339707[_0xed85('0x12')]?_0x339707[_0xed85('0x12')][_0xed85('0x15')]||null:null,'include':_0x339707[_0xed85('0x12')]?_0x339707[_0xed85('0x12')][_0xed85('0x16')]?_[_0xed85('0x17')](_0x339707[_0xed85('0x12')][_0xed85('0x16')],function(_0x165b14){return{'model':db[_0x165b14[_0xed85('0x18')]],'as':_0x165b14['as'],'attributes':_0x165b14['attributes'],'include':_0x165b14[_0xed85('0x16')]?_[_0xed85('0x17')](_0x165b14[_0xed85('0x16')],function(_0x1eb69e){return{'model':db[_0x1eb69e[_0xed85('0x18')]],'as':_0x1eb69e['as'],'attributes':_0x1eb69e[_0xed85('0x19')],'include':_0x1eb69e['include']?_[_0xed85('0x17')](_0x1eb69e[_0xed85('0x16')],function(_0xa15599){return{'model':db[_0xa15599[_0xed85('0x18')]],'as':_0xa15599['as'],'attributes':_0xa15599['attributes']};}):[]};}):[]};}):[]:[]})[_0xed85('0x7')](function(_0x2e4e7e){logger[_0xed85('0xe')]('GetSalesforceAccount',_0x339707);logger[_0xed85('0xa')](_0xed85('0x11'),_0x339707,JSON[_0xed85('0xb')](_0x2e4e7e));_0x1dd1f2(_0x2e4e7e);})['catch'](function(_0x36093e){logger[_0xed85('0xc')](_0xed85('0x11'),_0x36093e[_0xed85('0xd')],_0x339707);_0x45208c(_0x234c55[_0xed85('0xc')](0x1f4,_0x36093e[_0xed85('0xd')]));});});};exports['ShowSalesforceAccount']=function(_0x1094b1){var _0x28be58=this;return new Promise(function(_0x5dfd78,_0x3f09a5){return db['SalesforceAccount']['find']({'raw':_0x1094b1[_0xed85('0x12')]?_0x1094b1[_0xed85('0x12')][_0xed85('0x13')]===undefined?!![]:![]:!![],'where':_0x1094b1[_0xed85('0x12')]?_0x1094b1[_0xed85('0x12')][_0xed85('0x14')]||null:null,'attributes':_0x1094b1[_0xed85('0x12')]?_0x1094b1[_0xed85('0x12')][_0xed85('0x19')]||null:null,'include':_0x1094b1[_0xed85('0x12')]?_0x1094b1[_0xed85('0x12')][_0xed85('0x16')]?_[_0xed85('0x17')](_0x1094b1[_0xed85('0x12')][_0xed85('0x16')],function(_0x1c2386){return{'model':db[_0x1c2386[_0xed85('0x18')]],'as':_0x1c2386['as'],'attributes':_0x1c2386['attributes'],'include':_0x1c2386[_0xed85('0x16')]?_[_0xed85('0x17')](_0x1c2386['include'],function(_0x3e4212){return{'model':db[_0x3e4212[_0xed85('0x18')]],'as':_0x3e4212['as'],'attributes':_0x3e4212[_0xed85('0x19')],'include':_0x3e4212['include']?_[_0xed85('0x17')](_0x3e4212[_0xed85('0x16')],function(_0x119fc7){return{'model':db[_0x119fc7[_0xed85('0x18')]],'as':_0x119fc7['as'],'attributes':_0x119fc7[_0xed85('0x19')]};}):[]};}):[]};}):[]:[]})[_0xed85('0x7')](function(_0x39a3e6){logger['info']('ShowSalesforceAccount',_0x1094b1);logger[_0xed85('0xa')](_0xed85('0x1a'),_0x1094b1,JSON[_0xed85('0xb')](_0x39a3e6));_0x5dfd78(_0x39a3e6);})[_0xed85('0x10')](function(_0x2cbed6){logger['error'](_0xed85('0x1a'),_0x2cbed6[_0xed85('0xd')],_0x1094b1);_0x3f09a5(_0x28be58[_0xed85('0xc')](0x1f4,_0x2cbed6[_0xed85('0xd')]));});});};
\ No newline at end of file